From 30313d9a80e69c4ef6930d0c742d509824150d1b Mon Sep 17 00:00:00 2001 From: Dean Coakley Date: Mon, 11 Mar 2024 13:07:40 +0000 Subject: [PATCH] Fix install-tools (#581) * tools.go has been replaced with Makefile.tools in line with agent v3 approach * Lint tool naming * Fix vendoring of deps target * Lint Makefile * Fix format target * Pin docker dep versions * Fix sdk codegen Makefile. Add tool debug msg * Pin all versions. Remove protobuf sub command * Pin golang-ci lint version * Pin swagger version --- Makefile | 74 +- Makefile.tools | 35 + go.mod | 274 +- go.sum | 1170 +- go.work.sum | 92 +- scripts/tools.go | 22 - sdk/Makefile | 2 +- sdk/go.mod | 2 +- sdk/go.sum | 4 +- sdk/vendor/modules.txt | 2 +- test/integration/go.mod | 22 +- test/integration/go.sum | 59 +- .../client/client.go | 17 +- .../credentials/error.go | 11 +- .../docker/go-connections/nat/nat.go | 40 +- .../docker/go-connections/nat/parse.go | 28 +- .../docker/go-connections/nat/sort.go | 4 +- .../docker/go-connections/sockets/proxy.go | 39 +- .../docker/go-connections/sockets/sockets.go | 23 +- .../go-connections/sockets/sockets_unix.go | 12 +- .../go-connections/sockets/sockets_windows.go | 5 +- .../go-connections/sockets/unix_socket.go | 118 +- .../go-connections/tlsconfig/certpool.go | 2 - .../go-connections/tlsconfig/certpool_go17.go | 18 - .../tlsconfig/certpool_other.go | 13 - .../docker/go-connections/tlsconfig/config.go | 85 +- .../tlsconfig/config_client_ciphers.go | 3 - .../tlsconfig/config_legacy_client_ciphers.go | 15 - .../github.com/klauspost/compress/README.md | 14 +- .../github.com/klauspost/compress/s2sx.mod | 2 +- .../klauspost/compress/zstd/decodeheader.go | 56 +- .../compress/zstd/encoder_options.go | 6 +- .../klauspost/compress/zstd/frameenc.go | 2 +- .../compress/zstd/fse_decoder_generic.go | 11 +- .../klauspost/compress/zstd/seqdec_amd64.s | 136 +- .../github.com/nginx/agent/sdk/v2/Makefile | 2 +- .../net/http/otelhttp/handler.go | 28 +- .../otelhttp/internal/semconvutil/httpconv.go | 182 +- .../otelhttp/internal/semconvutil/netconv.go | 12 +- .../net/http/otelhttp/version.go | 2 +- .../go.opentelemetry.io/otel/CHANGELOG.md | 43 +- .../go.opentelemetry.io/otel/CONTRIBUTING.md | 21 + .../vendor/go.opentelemetry.io/otel/README.md | 2 +- .../go.opentelemetry.io/otel/RELEASING.md | 6 +- .../go.opentelemetry.io/otel/attribute/set.go | 87 +- .../otel/baggage/baggage.go | 330 +- .../vendor/go.opentelemetry.io/otel/doc.go | 2 +- .../otel/propagation/trace_context.go | 94 +- .../otel/sdk/resource/builtin.go | 2 +- .../otel/sdk/resource/container.go | 2 +- .../otel/sdk/resource/env.go | 2 +- .../otel/sdk/resource/host_id.go | 2 +- .../otel/sdk/resource/os.go | 2 +- .../otel/sdk/resource/process.go | 2 +- .../otel/sdk/trace/span.go | 19 +- .../go.opentelemetry.io/otel/sdk/version.go | 2 +- .../otel/semconv/v1.20.0/attribute_group.go | 0 .../otel/semconv/v1.20.0/doc.go | 0 .../otel/semconv/v1.20.0/event.go | 0 .../otel/semconv/v1.20.0/exception.go | 0 .../otel/semconv/v1.20.0/http.go | 0 .../otel/semconv/v1.20.0/resource.go | 0 .../otel/semconv/v1.20.0/schema.go | 0 .../otel/semconv/v1.20.0/trace.go | 0 .../otel/semconv/v1.21.0/doc.go | 4 +- .../otel/semconv/v1.24.0/attribute_group.go | 4398 +++ .../otel/semconv/v1.24.0}/doc.go | 6 +- .../otel/semconv/v1.24.0}/event.go | 148 +- .../otel/semconv/v1.24.0}/exception.go | 2 +- .../otel/semconv/v1.24.0}/resource.go | 3070 +- .../otel/semconv/v1.24.0}/schema.go | 4 +- .../otel/semconv/v1.24.0}/trace.go | 2287 +- .../otel/trace/tracestate.go | 197 +- .../go.opentelemetry.io/otel/version.go | 2 +- .../go.opentelemetry.io/otel/versions.yaml | 4 +- test/integration/vendor/modules.txt | 26 +- test/performance/go.mod | 4 +- test/performance/go.sum | 12 +- .../klauspost/compress/flate/deflate.go | 2 +- .../compress/internal/race/norace.go | 12 +- .../klauspost/compress/internal/race/race.go | 26 + .../klauspost/compress/s2/decode.go | 6 + .../klauspost/compress/s2/encode_amd64.go | 14 + .../klauspost/compress/s2/reader.go | 16 +- .../github.com/klauspost/compress/s2/s2.go | 4 + .../klauspost/compress/s2/writer.go | 14 +- .../github.com/nginx/agent/sdk/v2/Makefile | 2 +- test/performance/vendor/modules.txt | 5 +- .../gocheckcompilerdirectives/LICENSE | 21 - .../checkcompilerdirectives.go | 105 - vendor/4d63.com/gochecknoglobals/LICENSE | 21 - .../checknoglobals/check_no_globals.go | 200 - vendor/dario.cat/mergo/.deepsource.toml | 12 - vendor/dario.cat/mergo/.gitignore | 33 - vendor/dario.cat/mergo/.travis.yml | 12 - vendor/dario.cat/mergo/CODE_OF_CONDUCT.md | 46 - vendor/dario.cat/mergo/CONTRIBUTING.md | 112 - vendor/dario.cat/mergo/LICENSE | 28 - vendor/dario.cat/mergo/README.md | 248 - vendor/dario.cat/mergo/SECURITY.md | 14 - vendor/dario.cat/mergo/doc.go | 148 - vendor/dario.cat/mergo/map.go | 178 - vendor/dario.cat/mergo/merge.go | 409 - vendor/dario.cat/mergo/mergo.go | 81 - vendor/github.com/4meepo/tagalign/.gitignore | 75 - .../github.com/4meepo/tagalign/.golangci.yml | 106 - .../4meepo/tagalign/.goreleaser.yml | 32 - vendor/github.com/4meepo/tagalign/LICENSE | 21 - vendor/github.com/4meepo/tagalign/Makefile | 7 - vendor/github.com/4meepo/tagalign/README.md | 130 - vendor/github.com/4meepo/tagalign/options.go | 37 - vendor/github.com/4meepo/tagalign/tagalign.go | 459 - .../github.com/Abirdcfly/dupword/.gitignore | 183 - .../Abirdcfly/dupword/.goreleaser.yml | 72 - vendor/github.com/Abirdcfly/dupword/LICENSE | 21 - vendor/github.com/Abirdcfly/dupword/README.md | 153 - .../github.com/Abirdcfly/dupword/dupword.go | 331 - .../github.com/Abirdcfly/dupword/version.go | 41 - vendor/github.com/AlekSi/pointer/LICENSE | 21 - vendor/github.com/AlekSi/pointer/README.md | 44 - vendor/github.com/AlekSi/pointer/generic.go | 36 - vendor/github.com/AlekSi/pointer/pointer.go | 124 - .../AlekSi/pointer/pointer_or_nil.go | 189 - vendor/github.com/AlekSi/pointer/value.go | 189 - vendor/github.com/Antonboom/errname/LICENSE | 21 - .../errname/pkg/analyzer/analyzer.go | 135 - .../Antonboom/errname/pkg/analyzer/facts.go | 272 - vendor/github.com/Antonboom/nilnil/LICENSE | 21 - .../Antonboom/nilnil/pkg/analyzer/analyzer.go | 158 - .../Antonboom/nilnil/pkg/analyzer/config.go | 77 - .../nilnil/pkg/analyzer/func_type_stack.go | 29 - .../github.com/Antonboom/testifylint/LICENSE | 21 - .../testifylint/analyzer/analyzer.go | 93 - .../testifylint/analyzer/checkers_factory.go | 71 - .../testifylint/internal/analysisutil/doc.go | 9 - .../testifylint/internal/analysisutil/file.go | 28 - .../internal/analysisutil/format.go | 34 - .../internal/analysisutil/object.go | 34 - .../testifylint/internal/analysisutil/pkg.go | 19 - .../internal/checkers/blank_import.go | 69 - .../internal/checkers/bool_compare.go | 248 - .../internal/checkers/call_meta.go | 136 - .../testifylint/internal/checkers/checker.go | 23 - .../internal/checkers/checkers_registry.go | 105 - .../testifylint/internal/checkers/compares.go | 96 - .../internal/checkers/diagnostic.go | 60 - .../testifylint/internal/checkers/empty.go | 172 - .../internal/checkers/error_is_as.go | 166 - .../internal/checkers/error_nil.go | 113 - .../internal/checkers/expected_actual.go | 212 - .../internal/checkers/float_compare.go | 70 - .../internal/checkers/go_require.go | 301 - .../testifylint/internal/checkers/len.go | 97 - .../internal/checkers/nil_compare.go | 69 - .../internal/checkers/require_error.go | 305 - .../internal/checkers/suite_dont_use_pkg.go | 96 - .../checkers/suite_extra_assert_call.go | 99 - .../internal/checkers/suite_thelper.go | 130 - .../internal/checkers/useless_assert.go | 71 - .../testifylint/internal/config/config.go | 103 - .../internal/config/flag_value_types.go | 114 - .../testifylint/internal/testify/const.go | 17 - vendor/github.com/Azure/go-ansiterm/LICENSE | 21 - vendor/github.com/Azure/go-ansiterm/README.md | 12 - .../github.com/Azure/go-ansiterm/SECURITY.md | 41 - .../github.com/Azure/go-ansiterm/constants.go | 188 - .../github.com/Azure/go-ansiterm/context.go | 7 - .../Azure/go-ansiterm/csi_entry_state.go | 49 - .../Azure/go-ansiterm/csi_param_state.go | 38 - .../go-ansiterm/escape_intermediate_state.go | 36 - .../Azure/go-ansiterm/escape_state.go | 47 - .../Azure/go-ansiterm/event_handler.go | 90 - .../Azure/go-ansiterm/ground_state.go | 24 - .../Azure/go-ansiterm/osc_string_state.go | 31 - vendor/github.com/Azure/go-ansiterm/parser.go | 151 - .../go-ansiterm/parser_action_helpers.go | 99 - .../Azure/go-ansiterm/parser_actions.go | 119 - vendor/github.com/Azure/go-ansiterm/states.go | 71 - .../github.com/Azure/go-ansiterm/utilities.go | 21 - .../Azure/go-ansiterm/winterm/ansi.go | 196 - .../Azure/go-ansiterm/winterm/api.go | 327 - .../go-ansiterm/winterm/attr_translation.go | 100 - .../go-ansiterm/winterm/cursor_helpers.go | 101 - .../go-ansiterm/winterm/erase_helpers.go | 84 - .../go-ansiterm/winterm/scroll_helper.go | 118 - .../Azure/go-ansiterm/winterm/utilities.go | 9 - .../go-ansiterm/winterm/win_event_handler.go | 743 - vendor/github.com/BurntSushi/toml/.gitignore | 2 - vendor/github.com/BurntSushi/toml/COPYING | 21 - vendor/github.com/BurntSushi/toml/README.md | 120 - vendor/github.com/BurntSushi/toml/decode.go | 602 - .../BurntSushi/toml/decode_go116.go | 19 - .../github.com/BurntSushi/toml/deprecated.go | 29 - vendor/github.com/BurntSushi/toml/doc.go | 11 - vendor/github.com/BurntSushi/toml/encode.go | 759 - vendor/github.com/BurntSushi/toml/error.go | 279 - .../github.com/BurntSushi/toml/internal/tz.go | 36 - vendor/github.com/BurntSushi/toml/lex.go | 1283 - vendor/github.com/BurntSushi/toml/meta.go | 121 - vendor/github.com/BurntSushi/toml/parse.go | 811 - .../github.com/BurntSushi/toml/type_fields.go | 242 - .../github.com/BurntSushi/toml/type_toml.go | 70 - .../github.com/Djarvur/go-err113/.gitignore | 15 - .../Djarvur/go-err113/.golangci.yml | 150 - .../github.com/Djarvur/go-err113/.travis.yml | 24 - vendor/github.com/Djarvur/go-err113/LICENSE | 21 - .../github.com/Djarvur/go-err113/README.adoc | 75 - .../Djarvur/go-err113/comparison.go | 123 - .../Djarvur/go-err113/definition.go | 74 - vendor/github.com/Djarvur/go-err113/err113.go | 90 - .../go-exhaustruct/v3/LICENSE | 21 - .../go-exhaustruct/v3/analyzer/analyzer.go | 291 - .../v3/internal/comment/cache.go | 35 - .../v3/internal/comment/directive.go | 28 - .../v3/internal/pattern/list.go | 82 - .../v3/internal/structure/fields-cache.go | 35 - .../v3/internal/structure/fields.go | 127 - vendor/github.com/MakeNowJust/heredoc/LICENSE | 21 - .../github.com/MakeNowJust/heredoc/README.md | 52 - .../github.com/MakeNowJust/heredoc/heredoc.go | 105 - .../Masterminds/goutils/.travis.yml | 18 - .../Masterminds/goutils/CHANGELOG.md | 8 - .../Masterminds/goutils/LICENSE.txt | 202 - .../github.com/Masterminds/goutils/README.md | 70 - .../Masterminds/goutils/appveyor.yml | 21 - .../goutils/cryptorandomstringutils.go | 230 - .../Masterminds/goutils/randomstringutils.go | 248 - .../Masterminds/goutils/stringutils.go | 240 - .../Masterminds/goutils/wordutils.go | 357 - .../github.com/Masterminds/semver/.travis.yml | 29 - .../Masterminds/semver/CHANGELOG.md | 109 - .../github.com/Masterminds/semver/LICENSE.txt | 19 - vendor/github.com/Masterminds/semver/Makefile | 36 - .../github.com/Masterminds/semver/README.md | 194 - .../Masterminds/semver/appveyor.yml | 44 - .../Masterminds/semver/collection.go | 24 - .../Masterminds/semver/constraints.go | 423 - vendor/github.com/Masterminds/semver/doc.go | 115 - .../Masterminds/semver/v3/.gitignore | 1 - .../Masterminds/semver/v3/.golangci.yml | 27 - .../Masterminds/semver/v3/CHANGELOG.md | 214 - .../Masterminds/semver/v3/LICENSE.txt | 19 - .../github.com/Masterminds/semver/v3/Makefile | 30 - .../Masterminds/semver/v3/README.md | 258 - .../Masterminds/semver/v3/SECURITY.md | 19 - .../Masterminds/semver/v3/collection.go | 24 - .../Masterminds/semver/v3/constraints.go | 594 - .../github.com/Masterminds/semver/v3/doc.go | 184 - .../Masterminds/semver/v3/version.go | 639 - .../github.com/Masterminds/semver/version.go | 425 - .../Masterminds/semver/version_fuzz.go | 10 - .../github.com/Masterminds/sprig/.gitignore | 2 - .../github.com/Masterminds/sprig/.travis.yml | 26 - .../github.com/Masterminds/sprig/CHANGELOG.md | 282 - .../github.com/Masterminds/sprig/LICENSE.txt | 20 - vendor/github.com/Masterminds/sprig/Makefile | 13 - vendor/github.com/Masterminds/sprig/README.md | 78 - .../github.com/Masterminds/sprig/appveyor.yml | 26 - vendor/github.com/Masterminds/sprig/crypto.go | 502 - vendor/github.com/Masterminds/sprig/date.go | 83 - .../github.com/Masterminds/sprig/defaults.go | 83 - vendor/github.com/Masterminds/sprig/dict.go | 119 - vendor/github.com/Masterminds/sprig/doc.go | 19 - .../github.com/Masterminds/sprig/functions.go | 306 - .../github.com/Masterminds/sprig/glide.yaml | 19 - vendor/github.com/Masterminds/sprig/list.go | 311 - .../github.com/Masterminds/sprig/network.go | 12 - .../github.com/Masterminds/sprig/numeric.go | 169 - .../github.com/Masterminds/sprig/reflect.go | 28 - vendor/github.com/Masterminds/sprig/regex.go | 35 - vendor/github.com/Masterminds/sprig/semver.go | 23 - .../github.com/Masterminds/sprig/strings.go | 233 - vendor/github.com/Masterminds/sprig/url.go | 66 - .../Masterminds/sprig/v3/.gitignore | 2 - .../Masterminds/sprig/v3/CHANGELOG.md | 383 - .../Masterminds/sprig/v3/LICENSE.txt | 19 - .../github.com/Masterminds/sprig/v3/Makefile | 9 - .../github.com/Masterminds/sprig/v3/README.md | 100 - .../github.com/Masterminds/sprig/v3/crypto.go | 653 - .../github.com/Masterminds/sprig/v3/date.go | 152 - .../Masterminds/sprig/v3/defaults.go | 163 - .../github.com/Masterminds/sprig/v3/dict.go | 174 - vendor/github.com/Masterminds/sprig/v3/doc.go | 19 - .../Masterminds/sprig/v3/functions.go | 382 - .../github.com/Masterminds/sprig/v3/list.go | 464 - .../Masterminds/sprig/v3/network.go | 12 - .../Masterminds/sprig/v3/numeric.go | 186 - .../Masterminds/sprig/v3/reflect.go | 28 - .../github.com/Masterminds/sprig/v3/regex.go | 83 - .../github.com/Masterminds/sprig/v3/semver.go | 23 - .../Masterminds/sprig/v3/strings.go | 236 - vendor/github.com/Masterminds/sprig/v3/url.go | 66 - .../Microsoft/go-winio/.gitattributes | 1 - .../github.com/Microsoft/go-winio/.gitignore | 10 - .../Microsoft/go-winio/.golangci.yml | 149 - .../github.com/Microsoft/go-winio/CODEOWNERS | 1 - vendor/github.com/Microsoft/go-winio/LICENSE | 22 - .../github.com/Microsoft/go-winio/README.md | 89 - .../github.com/Microsoft/go-winio/SECURITY.md | 41 - .../github.com/Microsoft/go-winio/backup.go | 290 - vendor/github.com/Microsoft/go-winio/doc.go | 22 - vendor/github.com/Microsoft/go-winio/ea.go | 137 - vendor/github.com/Microsoft/go-winio/file.go | 331 - .../github.com/Microsoft/go-winio/fileinfo.go | 92 - .../github.com/Microsoft/go-winio/hvsock.go | 575 - .../Microsoft/go-winio/internal/fs/doc.go | 2 - .../Microsoft/go-winio/internal/fs/fs.go | 202 - .../go-winio/internal/fs/security.go | 12 - .../go-winio/internal/fs/zsyscall_windows.go | 64 - .../go-winio/internal/socket/rawaddr.go | 20 - .../go-winio/internal/socket/socket.go | 179 - .../internal/socket/zsyscall_windows.go | 72 - .../go-winio/internal/stringbuffer/wstring.go | 132 - vendor/github.com/Microsoft/go-winio/pipe.go | 525 - .../Microsoft/go-winio/pkg/guid/guid.go | 232 - .../go-winio/pkg/guid/guid_nonwindows.go | 16 - .../go-winio/pkg/guid/guid_windows.go | 13 - .../go-winio/pkg/guid/variant_string.go | 27 - .../Microsoft/go-winio/privilege.go | 197 - .../github.com/Microsoft/go-winio/reparse.go | 131 - vendor/github.com/Microsoft/go-winio/sd.go | 144 - .../github.com/Microsoft/go-winio/syscall.go | 5 - vendor/github.com/Microsoft/go-winio/tools.go | 5 - .../Microsoft/go-winio/zsyscall_windows.go | 419 - .../OpenPeeDeeP/depguard/v2/.gitignore | 15 - .../OpenPeeDeeP/depguard/v2/LICENSE | 674 - .../OpenPeeDeeP/depguard/v2/README.md | 163 - .../OpenPeeDeeP/depguard/v2/depguard.go | 95 - .../depguard/v2/internal/utils/errors.go | 18 - .../depguard/v2/internal/utils/variables.go | 131 - .../OpenPeeDeeP/depguard/v2/settings.go | 240 - .../github.com/ProtonMail/go-crypto/AUTHORS | 3 - .../ProtonMail/go-crypto/CONTRIBUTORS | 3 - .../github.com/ProtonMail/go-crypto/LICENSE | 27 - .../github.com/ProtonMail/go-crypto/PATENTS | 22 - .../go-crypto/bitcurves/bitcurve.go | 381 - .../go-crypto/brainpool/brainpool.go | 134 - .../ProtonMail/go-crypto/brainpool/rcurve.go | 83 - .../ProtonMail/go-crypto/eax/eax.go | 162 - .../go-crypto/eax/eax_test_vectors.go | 58 - .../go-crypto/eax/random_vectors.go | 131 - .../go-crypto/internal/byteutil/byteutil.go | 90 - .../ProtonMail/go-crypto/ocb/ocb.go | 317 - .../go-crypto/ocb/random_vectors.go | 136 - .../ocb/rfc7253_test_vectors_suite_a.go | 78 - .../ocb/rfc7253_test_vectors_suite_b.go | 25 - .../go-crypto/openpgp/aes/keywrap/keywrap.go | 153 - .../go-crypto/openpgp/armor/armor.go | 231 - .../go-crypto/openpgp/armor/encode.go | 161 - .../go-crypto/openpgp/canonical_text.go | 65 - .../go-crypto/openpgp/clearsign/clearsign.go | 464 - .../ProtonMail/go-crypto/openpgp/ecdh/ecdh.go | 210 - .../go-crypto/openpgp/ecdsa/ecdsa.go | 80 - .../go-crypto/openpgp/eddsa/eddsa.go | 91 - .../go-crypto/openpgp/elgamal/elgamal.go | 124 - .../go-crypto/openpgp/errors/errors.go | 116 - .../ProtonMail/go-crypto/openpgp/hash.go | 24 - .../openpgp/internal/algorithm/aead.go | 65 - .../openpgp/internal/algorithm/cipher.go | 107 - .../openpgp/internal/algorithm/hash.go | 143 - .../openpgp/internal/ecc/curve25519.go | 171 - .../openpgp/internal/ecc/curve_info.go | 140 - .../go-crypto/openpgp/internal/ecc/curves.go | 48 - .../go-crypto/openpgp/internal/ecc/ed25519.go | 112 - .../go-crypto/openpgp/internal/ecc/ed448.go | 111 - .../go-crypto/openpgp/internal/ecc/generic.go | 149 - .../go-crypto/openpgp/internal/ecc/x448.go | 105 - .../openpgp/internal/encoding/encoding.go | 27 - .../openpgp/internal/encoding/mpi.go | 91 - .../openpgp/internal/encoding/oid.go | 88 - .../go-crypto/openpgp/key_generation.go | 389 - .../ProtonMail/go-crypto/openpgp/keys.go | 842 - .../go-crypto/openpgp/keys_test_data.go | 538 - .../go-crypto/openpgp/packet/aead_config.go | 67 - .../go-crypto/openpgp/packet/aead_crypter.go | 264 - .../openpgp/packet/aead_encrypted.go | 96 - .../go-crypto/openpgp/packet/compressed.go | 125 - .../go-crypto/openpgp/packet/config.go | 248 - .../go-crypto/openpgp/packet/encrypted_key.go | 286 - .../go-crypto/openpgp/packet/literal.go | 91 - .../go-crypto/openpgp/packet/notation.go | 29 - .../go-crypto/openpgp/packet/ocfb.go | 137 - .../openpgp/packet/one_pass_signature.go | 73 - .../go-crypto/openpgp/packet/opaque.go | 171 - .../go-crypto/openpgp/packet/packet.go | 551 - .../go-crypto/openpgp/packet/private_key.go | 837 - .../openpgp/packet/private_key_test_data.go | 12 - .../go-crypto/openpgp/packet/public_key.go | 806 - .../openpgp/packet/public_key_test_data.go | 24 - .../go-crypto/openpgp/packet/reader.go | 86 - .../go-crypto/openpgp/packet/signature.go | 1084 - .../openpgp/packet/symmetric_key_encrypted.go | 276 - .../openpgp/packet/symmetrically_encrypted.go | 90 - .../packet/symmetrically_encrypted_aead.go | 156 - .../packet/symmetrically_encrypted_mdc.go | 256 - .../go-crypto/openpgp/packet/userattribute.go | 101 - .../go-crypto/openpgp/packet/userid.go | 167 - .../ProtonMail/go-crypto/openpgp/read.go | 592 - .../go-crypto/openpgp/read_write_test_data.go | 274 - .../ProtonMail/go-crypto/openpgp/s2k/s2k.go | 407 - .../go-crypto/openpgp/s2k/s2k_cache.go | 26 - .../go-crypto/openpgp/s2k/s2k_config.go | 129 - .../ProtonMail/go-crypto/openpgp/write.go | 583 - .../go-check-sumtype/.goreleaser.yml | 32 - .../alecthomas/go-check-sumtype/COPYING | 3 - .../alecthomas/go-check-sumtype/LICENSE-MIT | 21 - .../alecthomas/go-check-sumtype/README.md | 120 - .../alecthomas/go-check-sumtype/UNLICENSE | 24 - .../alecthomas/go-check-sumtype/check.go | 184 - .../alecthomas/go-check-sumtype/decl.go | 69 - .../alecthomas/go-check-sumtype/def.go | 173 - .../alecthomas/go-check-sumtype/doc.go | 53 - .../alecthomas/go-check-sumtype/run.go | 26 - .../alexkohler/nakedret/v2/.gitignore | 8 - .../github.com/alexkohler/nakedret/v2/LICENSE | 21 - .../alexkohler/nakedret/v2/README.md | 125 - .../alexkohler/nakedret/v2/import.go | 310 - .../alexkohler/nakedret/v2/nakedret.go | 309 - vendor/github.com/alexkohler/prealloc/LICENSE | 21 - .../alexkohler/prealloc/pkg/prealloc.go | 267 - .../github.com/alingse/asasalint/.gitignore | 18 - .../alingse/asasalint/.goreleaser.yml | 72 - vendor/github.com/alingse/asasalint/LICENSE | 21 - vendor/github.com/alingse/asasalint/Makefile | 15 - vendor/github.com/alingse/asasalint/README.md | 76 - .../github.com/alingse/asasalint/asasalint.go | 166 - .../asaskevich/govalidator/.gitignore | 15 - .../asaskevich/govalidator/.travis.yml | 12 - .../asaskevich/govalidator/CODE_OF_CONDUCT.md | 43 - .../asaskevich/govalidator/CONTRIBUTING.md | 63 - .../github.com/asaskevich/govalidator/LICENSE | 21 - .../asaskevich/govalidator/README.md | 622 - .../asaskevich/govalidator/arrays.go | 87 - .../asaskevich/govalidator/converter.go | 81 - .../github.com/asaskevich/govalidator/doc.go | 3 - .../asaskevich/govalidator/error.go | 47 - .../asaskevich/govalidator/numerics.go | 100 - .../asaskevich/govalidator/patterns.go | 113 - .../asaskevich/govalidator/types.go | 656 - .../asaskevich/govalidator/utils.go | 270 - .../asaskevich/govalidator/validator.go | 1768 - .../asaskevich/govalidator/wercker.yml | 15 - .../github.com/ashanbrown/forbidigo/LICENSE | 13 - .../forbidigo/forbidigo/config_options.go | 129 - .../forbidigo/forbidigo/forbidigo.go | 398 - .../forbidigo/forbidigo/patterns.go | 127 - vendor/github.com/ashanbrown/makezero/LICENSE | 13 - .../ashanbrown/makezero/makezero/makezero.go | 230 - .../aymanbagabas/go-osc52/v2/LICENSE | 21 - .../aymanbagabas/go-osc52/v2/README.md | 83 - .../aymanbagabas/go-osc52/v2/osc52.go | 305 - vendor/github.com/bkielbasa/cyclop/LICENSE | 21 - .../bkielbasa/cyclop/pkg/analyzer/analyzer.go | 107 - vendor/github.com/blakesmith/ar/.gitignore | 1 - vendor/github.com/blakesmith/ar/COPYING | 20 - vendor/github.com/blakesmith/ar/README.md | 9 - vendor/github.com/blakesmith/ar/common.go | 48 - vendor/github.com/blakesmith/ar/reader.go | 155 - vendor/github.com/blakesmith/ar/writer.go | 124 - .../blizzy78/varnamelen/.editorconfig | 13 - .../github.com/blizzy78/varnamelen/.gitignore | 1 - .../blizzy78/varnamelen/.golangci.yml | 70 - vendor/github.com/blizzy78/varnamelen/LICENSE | 18 - .../github.com/blizzy78/varnamelen/README.md | 155 - vendor/github.com/blizzy78/varnamelen/doc.go | 3 - .../github.com/blizzy78/varnamelen/flags.go | 109 - .../blizzy78/varnamelen/typeparam.go | 35 - .../blizzy78/varnamelen/typeparam_go1.16.go | 11 - .../varnamelen/varnamelen.code-workspace | 13 - .../blizzy78/varnamelen/varnamelen.go | 891 - vendor/github.com/bombsimon/wsl/v3/.gitignore | 70 - .../github.com/bombsimon/wsl/v3/.golangci.yml | 78 - vendor/github.com/bombsimon/wsl/v3/LICENSE | 21 - vendor/github.com/bombsimon/wsl/v3/README.md | 126 - vendor/github.com/bombsimon/wsl/v3/wsl.go | 1264 - vendor/github.com/breml/bidichk/LICENSE | 21 - .../breml/bidichk/pkg/bidichk/bidichk.go | 180 - .../breml/bidichk/pkg/bidichk/version.go | 19 - vendor/github.com/breml/errchkjson/.gitignore | 29 - .../breml/errchkjson/.goreleaser.yml | 34 - vendor/github.com/breml/errchkjson/LICENSE | 21 - vendor/github.com/breml/errchkjson/README.md | 131 - .../github.com/breml/errchkjson/errchkjson.go | 348 - .../breml/errchkjson/noexported_error.go | 23 - .../breml/errchkjson/unsupported_error.go | 23 - vendor/github.com/breml/errchkjson/version.go | 19 - .../github.com/briandowns/spinner/.gitignore | 29 - .../github.com/briandowns/spinner/.travis.yml | 18 - vendor/github.com/briandowns/spinner/LICENSE | 174 - vendor/github.com/briandowns/spinner/Makefile | 20 - .../github.com/briandowns/spinner/NOTICE.txt | 4 - .../github.com/briandowns/spinner/README.md | 285 - .../briandowns/spinner/character_sets.go | 121 - .../github.com/briandowns/spinner/spinner.go | 557 - vendor/github.com/bufbuild/buf/LICENSE | 201 - .../github.com/bufbuild/buf/cmd/buf/main.go | 21 - .../bufbuild/buf/private/buf/bufapp/bufapp.go | 60 - .../buf/private/buf/bufapp/usage.gen.go | 19 - .../bufbuild/buf/private/buf/bufcli/bufcli.go | 1060 - .../bufbuild/buf/private/buf/bufcli/errors.go | 206 - .../buf/private/buf/bufcli/usage.gen.go | 19 - .../buf/private/buf/bufconvert/bufconvert.go | 128 - .../buf/bufconvert/message_encoding_ref.go | 40 - .../buf/private/buf/bufconvert/usage.gen.go | 19 - .../buf/private/buf/bufcurl/bufcurl.go | 54 - .../buf/private/buf/bufcurl/headers.go | 173 - .../buf/private/buf/bufcurl/invoker.go | 442 - .../bufbuild/buf/private/buf/bufcurl/io.go | 69 - .../buf/bufcurl/reflection_resolver.go | 521 - .../bufbuild/buf/private/buf/bufcurl/tls.go | 156 - .../buf/private/buf/bufcurl/usage.gen.go | 19 - .../private/buf/bufcurl/verbose_transport.go | 271 - .../buf/private/buf/buffetch/buffetch.go | 362 - .../buf/private/buf/buffetch/format.go | 141 - .../buf/private/buf/buffetch/image_ref.go | 57 - .../buf/buffetch/internal/archive_ref.go | 121 - .../private/buf/buffetch/internal/dir_ref.go | 80 - .../private/buf/buffetch/internal/errors.go | 180 - .../private/buf/buffetch/internal/git_ref.go | 158 - .../private/buf/buffetch/internal/internal.go | 813 - .../buf/buffetch/internal/module_ref.go | 74 - .../buf/buffetch/internal/proto_file_ref.go | 54 - .../buffetch/internal/read_bucket_closer.go | 57 - ...d_bucket_closer_terminate_file_provider.go | 37 - .../internal/read_write_bucket_closer.go | 57 - .../private/buf/buffetch/internal/reader.go | 914 - .../buf/buffetch/internal/ref_parser.go | 409 - .../buf/buffetch/internal/single_ref.go | 144 - .../buf/buffetch/internal/terminate_file.go | 39 - .../internal/terminate_file_provider.go | 32 - .../buf/buffetch/internal/usage.gen.go | 19 - .../buf/private/buf/buffetch/internal/util.go | 36 - .../private/buf/buffetch/internal/writer.go | 190 - .../buf/private/buf/buffetch/module_ref.go | 46 - .../private/buf/buffetch/proto_file_ref.go | 72 - .../buf/private/buf/buffetch/reader.go | 169 - .../buf/private/buf/buffetch/ref_parser.go | 587 - .../buf/private/buf/buffetch/source_ref.go | 70 - .../buf/private/buf/buffetch/usage.gen.go | 19 - .../buf/private/buf/buffetch/writer.go | 48 - .../buf/private/buf/bufformat/bufformat.go | 68 - .../buf/private/buf/bufformat/formatter.go | 2318 -- .../buf/private/buf/bufformat/usage.gen.go | 19 - .../bufbuild/buf/private/buf/bufgen/bufgen.go | 581 - .../bufbuild/buf/private/buf/bufgen/config.go | 666 - .../buf/private/buf/bufgen/features.go | 132 - .../buf/private/buf/bufgen/generator.go | 734 - .../buf/private/buf/bufgen/image_provider.go | 60 - .../buf/private/buf/bufgen/provider.go | 72 - .../buf/private/buf/bufgen/usage.gen.go | 19 - .../buf/private/buf/bufmigrate/bufmigrate.go | 42 - .../buf/private/buf/bufmigrate/usage.gen.go | 19 - .../buf/bufmigrate/v1beta1_migrator.go | 553 - .../buf/private/buf/bufprint/bufprint.go | 204 - .../buf/bufprint/curated_plugin_printer.go | 112 - .../buf/bufprint/organization_printer.go | 111 - .../buf/bufprint/pagination_wrapper.go | 20 - .../buf/bufprint/repository_commit_printer.go | 103 - .../buf/bufprint/repository_draft_printer.go | 103 - .../buf/bufprint/repository_printer.go | 158 - .../buf/bufprint/repository_tag_printer.go | 113 - .../buf/private/buf/bufprint/stats_printer.go | 74 - .../buf/private/buf/bufprint/tab_writer.go | 43 - .../buf/bufprint/token_json_printer.go | 44 - .../buf/bufprint/token_text_printer.go | 61 - .../buf/private/buf/bufprint/usage.gen.go | 19 - .../bufbuild/buf/private/buf/bufref/bufref.go | 61 - .../bufbuild/buf/private/buf/bufref/errors.go | 44 - .../buf/private/buf/bufref/usage.gen.go | 19 - .../buf/private/buf/bufsync/bufsync.go | 173 - .../buf/private/buf/bufsync/module_commit.go | 65 - .../private/buf/bufsync/syncable_module.go | 55 - .../buf/private/buf/bufsync/syncer.go | 234 - .../buf/private/buf/bufsync/usage.gen.go | 19 - .../buf/private/buf/bufwire/bufwire.go | 255 - .../buf/private/buf/bufwire/file_lister.go | 268 - .../buf/private/buf/bufwire/image_config.go | 40 - .../buf/bufwire/image_config_reader.go | 313 - .../buf/private/buf/bufwire/image_reader.go | 170 - .../buf/private/buf/bufwire/image_writer.go | 123 - .../buf/private/buf/bufwire/module_config.go | 40 - .../buf/bufwire/module_config_reader.go | 680 - .../private/buf/bufwire/module_config_set.go | 39 - .../buf/bufwire/proto_encoding_reader.go | 109 - .../buf/bufwire/proto_encoding_writer.go | 87 - .../buf/private/buf/bufwire/usage.gen.go | 19 - .../buf/private/buf/bufwork/bufwork.go | 373 - .../buf/private/buf/bufwork/config.go | 87 - .../bufbuild/buf/private/buf/bufwork/get.go | 144 - .../buf/private/buf/bufwork/usage.gen.go | 19 - .../private/buf/bufwork/workspace_builder.go | 277 - .../bufbuild/buf/private/buf/cmd/buf/buf.go | 262 - .../alpha/package/goversion/goversion.go | 124 - .../alpha/package/goversion/usage.gen.go | 19 - .../package/mavenversion/mavenversion.go | 124 - .../alpha/package/mavenversion/usage.gen.go | 19 - .../alpha/package/npmversion/npmversion.go | 124 - .../alpha/package/npmversion/usage.gen.go | 19 - .../package/swiftversion/swiftversion.go | 124 - .../alpha/package/swiftversion/usage.gen.go | 19 - .../buf/command/alpha/protoc/const_unix.go | 26 - .../buf/command/alpha/protoc/const_windows.go | 24 - .../cmd/buf/command/alpha/protoc/errors.go | 103 - .../buf/cmd/buf/command/alpha/protoc/flags.go | 526 - .../buf/command/alpha/protoc/flags_unix.go | 36 - .../buf/command/alpha/protoc/flags_windows.go | 40 - .../cmd/buf/command/alpha/protoc/plugin.go | 91 - .../cmd/buf/command/alpha/protoc/protoc.go | 253 - .../cmd/buf/command/alpha/protoc/usage.gen.go | 19 - .../registry/token/tokendelete/tokendelete.go | 117 - .../registry/token/tokendelete/usage.gen.go | 19 - .../alpha/registry/token/tokenget/tokenget.go | 123 - .../registry/token/tokenget/usage.gen.go | 19 - .../registry/token/tokenlist/tokenlist.go | 136 - .../registry/token/tokenlist/usage.gen.go | 19 - .../command/alpha/repo/reposync/reposync.go | 448 - .../command/alpha/repo/reposync/usage.gen.go | 19 - .../workspace/workspacepush/usage.gen.go | 19 - .../workspace/workspacepush/workspacepush.go | 108 - .../buf/cmd/buf/command/beta/graph/graph.go | 186 - .../cmd/buf/command/beta/graph/usage.gen.go | 19 - .../beta/migratev1beta1/migratev1beta1.go | 88 - .../command/beta/migratev1beta1/usage.gen.go | 19 - .../buf/cmd/buf/command/beta/price/price.go | 207 - .../cmd/buf/command/beta/price/usage.gen.go | 19 - .../registry/commit/commitget/commitget.go | 113 - .../registry/commit/commitget/usage.gen.go | 19 - .../registry/commit/commitlist/commitlist.go | 145 - .../registry/commit/commitlist/usage.gen.go | 19 - .../registry/draft/draftdelete/draftdelete.go | 124 - .../registry/draft/draftdelete/usage.gen.go | 19 - .../registry/draft/draftlist/draftlist.go | 134 - .../registry/draft/draftlist/usage.gen.go | 19 - .../organizationcreate/organizationcreate.go | 113 - .../organizationcreate/usage.gen.go | 19 - .../organizationdelete/organizationdelete.go | 111 - .../organizationdelete/usage.gen.go | 19 - .../organizationget/organizationget.go | 113 - .../organization/organizationget/usage.gen.go | 19 - .../plugin/plugindelete/plugindelete.go | 101 - .../registry/plugin/plugindelete/usage.gen.go | 19 - .../registry/plugin/pluginpush/pluginpush.go | 493 - .../registry/plugin/pluginpush/usage.gen.go | 19 - .../repositorycreate/repositorycreate.go | 126 - .../repository/repositorycreate/usage.gen.go | 19 - .../repositorydelete/repositorydelete.go | 111 - .../repository/repositorydelete/usage.gen.go | 19 - .../repositorydeprecate.go | 103 - .../repositorydeprecate/usage.gen.go | 19 - .../repository/repositoryget/repositoryget.go | 115 - .../repository/repositoryget/usage.gen.go | 19 - .../repositorylist/repositorylist.go | 140 - .../repository/repositorylist/usage.gen.go | 19 - .../repositoryundeprecate.go | 73 - .../repositoryundeprecate/usage.gen.go | 19 - .../repositoryupdate/repositoryupdate.go | 108 - .../repository/repositoryupdate/usage.gen.go | 19 - .../beta/registry/tag/tagcreate/tagcreate.go | 138 - .../beta/registry/tag/tagcreate/usage.gen.go | 19 - .../beta/registry/tag/taglist/taglist.go | 148 - .../beta/registry/tag/taglist/usage.gen.go | 19 - .../webhook/webhookcreate/usage.gen.go | 19 - .../webhook/webhookcreate/webhookcreate.go | 145 - .../webhook/webhookdelete/usage.gen.go | 19 - .../webhook/webhookdelete/webhookdelete.go | 102 - .../registry/webhook/webhooklist/usage.gen.go | 19 - .../webhook/webhooklist/webhooklist.go | 127 - .../buf/cmd/buf/command/beta/stats/stats.go | 142 - .../cmd/buf/command/beta/stats/usage.gen.go | 19 - .../command/beta/studioagent/studioagent.go | 223 - .../buf/command/beta/studioagent/usage.gen.go | 19 - .../buf/cmd/buf/command/breaking/breaking.go | 308 - .../buf/cmd/buf/command/breaking/usage.gen.go | 19 - .../buf/cmd/buf/command/convert/convert.go | 238 - .../buf/cmd/buf/command/convert/usage.gen.go | 19 - .../private/buf/cmd/buf/command/curl/curl.go | 1026 - .../buf/cmd/buf/command/curl/usage.gen.go | 19 - .../buf/cmd/buf/command/export/export.go | 381 - .../buf/cmd/buf/command/export/usage.gen.go | 19 - .../buf/cmd/buf/command/format/format.go | 621 - .../buf/cmd/buf/command/format/usage.gen.go | 19 - .../buf/cmd/buf/command/generate/generate.go | 423 - .../buf/cmd/buf/command/generate/usage.gen.go | 19 - .../private/buf/cmd/buf/command/lint/lint.go | 177 - .../buf/cmd/buf/command/lint/usage.gen.go | 19 - .../buf/cmd/buf/command/lsfiles/lsfiles.go | 173 - .../buf/cmd/buf/command/lsfiles/usage.gen.go | 19 - .../cmd/buf/command/mod/internal/internal.go | 75 - .../cmd/buf/command/mod/internal/usage.gen.go | 19 - .../mod/modclearcache/modclearcache.go | 85 - .../command/mod/modclearcache/usage.gen.go | 19 - .../cmd/buf/command/mod/modinit/modinit.go | 171 - .../cmd/buf/command/mod/modinit/usage.gen.go | 19 - .../modlsbreakingrules/modlsbreakingrules.go | 134 - .../mod/modlsbreakingrules/usage.gen.go | 19 - .../mod/modlslintrules/modlslintrules.go | 134 - .../command/mod/modlslintrules/usage.gen.go | 19 - .../cmd/buf/command/mod/modopen/modopen.go | 85 - .../cmd/buf/command/mod/modopen/usage.gen.go | 19 - .../cmd/buf/command/mod/modprune/modprune.go | 171 - .../cmd/buf/command/mod/modprune/usage.gen.go | 19 - .../buf/command/mod/modupdate/modupdate.go | 321 - .../buf/command/mod/modupdate/usage.gen.go | 19 - .../private/buf/cmd/buf/command/push/push.go | 301 - .../buf/cmd/buf/command/push/usage.gen.go | 19 - .../registry/registrylogin/registrylogin.go | 228 - .../registry/registrylogin/usage.gen.go | 19 - .../registry/registrylogout/registrylogout.go | 90 - .../registry/registrylogout/usage.gen.go | 19 - .../buf/private/buf/cmd/buf/usage.gen.go | 19 - .../private/bufpkg/bufanalysis/bufanalysis.go | 315 - .../bufpkg/bufanalysis/file_annotation.go | 107 - .../buf/private/bufpkg/bufanalysis/print.go | 295 - .../private/bufpkg/bufanalysis/usage.gen.go | 19 - .../buf/private/bufpkg/bufanalysis/util.go | 22 - .../bufpkg/bufapimodule/bufapimodule.go | 60 - .../bufpkg/bufapimodule/module_reader.go | 100 - .../bufpkg/bufapimodule/module_resolver.go | 72 - .../private/bufpkg/bufapimodule/usage.gen.go | 19 - .../bufcheck/bufbreaking/bufbreaking.go | 140 - .../bufbreakingconfig/bufbreakingconfig.go | 225 - .../bufbreakingconfig/usage.gen.go | 19 - .../bufpkg/bufcheck/bufbreaking/handler.go | 64 - .../bufbreakingbuild/bufbreakingbuild.go | 371 - .../internal/bufbreakingbuild/usage.gen.go | 19 - .../bufbreakingcheck/bufbreakingcheck.go | 1105 - .../internal/bufbreakingcheck/usage.gen.go | 19 - .../internal/bufbreakingcheck/util.go | 353 - .../internal/bufbreakingv1/bufbreakingv1.go | 37 - .../internal/bufbreakingv1/usage.gen.go | 19 - .../internal/bufbreakingv1/vars.go | 334 - .../bufbreakingv1beta1/bufbreakingv1beta1.go | 27 - .../internal/bufbreakingv1beta1/usage.gen.go | 19 - .../internal/bufbreakingv1beta1/vars.go | 325 - .../bufpkg/bufcheck/bufbreaking/usage.gen.go | 19 - .../buf/private/bufpkg/bufcheck/bufcheck.go | 107 - .../bufpkg/bufcheck/buflint/buflint.go | 149 - .../buflint/buflintconfig/buflintconfig.go | 360 - .../buflint/buflintconfig/usage.gen.go | 19 - .../bufpkg/bufcheck/buflint/handler.go | 63 - .../internal/buflintbuild/buflintbuild.go | 359 - .../internal/buflintbuild/usage.gen.go | 19 - .../internal/buflintcheck/buflintcheck.go | 965 - .../internal/buflintcheck/usage.gen.go | 19 - .../buflint/internal/buflintcheck/util.go | 288 - .../buflint/internal/buflintv1/buflintv1.go | 80 - .../buflint/internal/buflintv1/usage.gen.go | 19 - .../buflint/internal/buflintv1/vars.go | 233 - .../internal/buflintv1beta1/buflintv1beta1.go | 27 - .../internal/buflintv1beta1/usage.gen.go | 19 - .../buflint/internal/buflintv1beta1/vars.go | 275 - .../bufpkg/bufcheck/buflint/usage.gen.go | 19 - .../bufpkg/bufcheck/internal/config.go | 323 - .../bufpkg/bufcheck/internal/helper.go | 171 - .../private/bufpkg/bufcheck/internal/rule.go | 103 - .../bufpkg/bufcheck/internal/rule_builder.go | 96 - .../bufpkg/bufcheck/internal/runner.go | 204 - .../bufpkg/bufcheck/internal/usage.gen.go | 19 - .../private/bufpkg/bufcheck/internal/vars.go | 59 - .../bufpkg/bufcheck/internal/version_spec.go | 75 - .../buf/private/bufpkg/bufcheck/usage.gen.go | 19 - .../buf/private/bufpkg/bufconfig/bufconfig.go | 260 - .../buf/private/bufpkg/bufconfig/config.go | 64 - .../buf/private/bufpkg/bufconfig/get.go | 133 - .../buf/private/bufpkg/bufconfig/read.go | 58 - .../buf/private/bufpkg/bufconfig/usage.gen.go | 19 - .../buf/private/bufpkg/bufconfig/write.go | 467 - .../private/bufpkg/bufconnect/bufconnect.go | 32 - .../buf/private/bufpkg/bufconnect/errors.go | 49 - .../private/bufpkg/bufconnect/interceptors.go | 109 - .../bufpkg/bufconnect/netrc_token_provider.go | 46 - .../bufconnect/static_token_provider.go | 135 - .../private/bufpkg/bufconnect/usage.gen.go | 19 - .../buf/private/bufpkg/bufgraph/bufgraph.go | 88 - .../buf/private/bufpkg/bufgraph/builder.go | 226 - .../buf/private/bufpkg/bufgraph/usage.gen.go | 19 - .../buf/private/bufpkg/bufimage/bufimage.go | 614 - .../bufimage/bufimagebuild/bufimagebuild.go | 80 - .../bufpkg/bufimage/bufimagebuild/builder.go | 649 - .../bufimage/bufimagebuild/usage.gen.go | 19 - .../bufimage/bufimagemodify/bufimagemodify.go | 349 - .../bufimagemodify/cc_enable_arenas.go | 90 - .../bufimagemodify/csharp_namespace.go | 151 - .../bufimagemodify/file_option_sweeper.go | 115 - .../bufimage/bufimagemodify/go_package.go | 137 - .../bufimagemodify/java_multiple_files.go | 103 - .../bufimagemodify/java_outer_classname.go | 97 - .../bufimage/bufimagemodify/java_package.go | 153 - .../bufimagemodify/java_string_check_utf8.go | 90 - .../bufimage/bufimagemodify/multi_modifier.go | 45 - .../bufimagemodify/objc_class_prefix.go | 151 - .../bufimage/bufimagemodify/optimize_for.go | 130 - .../bufimagemodify/php_metadata_namespace.go | 94 - .../bufimage/bufimagemodify/php_namespace.go | 203 - .../bufimage/bufimagemodify/ruby_package.go | 136 - .../bufimage/bufimagemodify/usage.gen.go | 19 - .../bufimage/bufimageutil/bufimageutil.go | 919 - .../bufimage/bufimageutil/image_index.go | 200 - .../bufimage/bufimageutil/input_file.go | 34 - .../bufimageutil/source_paths_remap.go | 145 - .../bufpkg/bufimage/bufimageutil/tags.go | 39 - .../bufpkg/bufimage/bufimageutil/usage.gen.go | 19 - .../buf/private/bufpkg/bufimage/image.go | 125 - .../buf/private/bufpkg/bufimage/image_file.go | 98 - .../bufimage/image_module_dependency.go | 61 - .../private/bufpkg/bufimage/import_tracker.go | 226 - .../buf/private/bufpkg/bufimage/usage.gen.go | 19 - .../buf/private/bufpkg/bufimage/util.go | 568 - .../buf/private/bufpkg/bufimage/validate.go | 73 - .../buf/private/bufpkg/buflock/buflock.go | 154 - .../buf/private/bufpkg/buflock/lock_file.go | 85 - .../buf/private/bufpkg/buflock/usage.gen.go | 19 - .../buf/private/bufpkg/bufmanifest/bucket.go | 49 - .../private/bufpkg/bufmanifest/bufmanifest.go | 15 - .../buf/private/bufpkg/bufmanifest/mapper.go | 146 - .../private/bufpkg/bufmanifest/usage.gen.go | 19 - .../buf/private/bufpkg/bufmodule/bufmodule.go | 566 - .../bufmodulebuild/bufmodulebuild.go | 170 - .../bufmodulebuild/module_bucket_builder.go | 170 - .../bufmodulebuild/module_file_set_builder.go | 175 - .../bufmodulebuild/module_include_builder.go | 118 - .../bufmodule/bufmodulebuild/usage.gen.go | 19 - .../bufpkg/bufmodule/bufmodulebuild/util.go | 121 - .../bufmodulecache/bufmodulecache.go | 49 - .../bufmodule/bufmodulecache/cache_stats.go | 48 - .../bufmodulecache/cas_module_cacher.go | 265 - .../bufmodulecache/cas_module_reader.go | 108 - .../bufmodule/bufmodulecache/usage.gen.go | 19 - .../bufpkg/bufmodule/bufmodulecache/util.go | 54 - .../bufmoduleconfig/bufmoduleconfig.go | 63 - .../bufmodule/bufmoduleconfig/config.go | 161 - .../bufmodule/bufmoduleconfig/usage.gen.go | 19 - .../bufmoduleprotocompile.go | 126 - .../bufmoduleprotocompile/path_resolver.go | 153 - .../bufmoduleprotocompile/usage.gen.go | 19 - .../bufmodule/bufmoduleref/bufmoduleref.go | 575 - .../bufmodule/bufmoduleref/file_info.go | 99 - .../bufmodule/bufmoduleref/module_identity.go | 56 - .../bufmodule/bufmoduleref/module_owner.go | 44 - .../bufmodule/bufmoduleref/module_pin.go | 131 - .../bufmoduleref/module_reference.go | 99 - .../bufmodule/bufmoduleref/usage.gen.go | 19 - .../bufpkg/bufmodule/bufmoduleref/util.go | 143 - .../bufpkg/bufmodule/bufmoduleref/validate.go | 210 - .../bufmodule/bufmodulestat/bufmodulestat.go | 31 - .../bufmodule/bufmodulestat/file_walker.go | 53 - .../bufmodule/bufmodulestat/usage.gen.go | 19 - .../bufpkg/bufmodule/internal/internal.go | 86 - .../bufpkg/bufmodule/internal/usage.gen.go | 19 - .../buf/private/bufpkg/bufmodule/module.go | 371 - .../private/bufpkg/bufmodule/module_file.go | 37 - .../bufpkg/bufmodule/module_file_set.go | 124 - .../bufpkg/bufmodule/module_object_info.go | 48 - .../bufpkg/bufmodule/module_read_bucket.go | 35 - .../bufmodule/multi_module_read_bucket.go | 63 - .../bufpkg/bufmodule/nop_module_reader.go | 32 - .../bufpkg/bufmodule/nop_module_resolver.go | 32 - .../bufmodule/single_module_read_bucket.go | 59 - .../bufpkg/bufmodule/targeting_module.go | 248 - .../buf/private/bufpkg/bufmodule/usage.gen.go | 19 - .../buf/private/bufpkg/bufmodule/util.go | 127 - .../buf/private/bufpkg/bufmodule/validate.go | 65 - .../buf/private/bufpkg/bufmodule/workspace.go | 64 - .../buf/private/bufpkg/bufplugin/bufplugin.go | 502 - .../bufpluginconfig/bufpluginconfig.go | 472 - .../bufplugin/bufpluginconfig/config.go | 375 - .../bufpkg/bufplugin/bufpluginconfig/get.go | 140 - .../bufplugin/bufpluginconfig/usage.gen.go | 19 - .../bufplugindocker/bufplugindocker.go | 19 - .../bufplugin/bufplugindocker/docker.go | 309 - .../bufplugindocker/registry_auth_config.go | 54 - .../bufplugin/bufplugindocker/usage.gen.go | 19 - .../bufplugin/bufpluginref/bufpluginref.go | 157 - .../bufplugin/bufpluginref/plugin_identity.go | 88 - .../bufpluginref/plugin_reference.go | 92 - .../bufplugin/bufpluginref/usage.gen.go | 19 - .../buf/private/bufpkg/bufplugin/plugin.go | 96 - .../buf/private/bufpkg/bufplugin/usage.gen.go | 19 - .../bufpkg/bufpluginexec/binary_handler.go | 133 - .../bufpkg/bufpluginexec/bufpluginexec.go | 243 - .../bufpluginexec/bufpluginexec_go18.go | 32 - .../bufpluginexec/bufpluginexec_go19.go | 37 - .../private/bufpkg/bufpluginexec/generator.go | 99 - .../private/bufpkg/bufpluginexec/normalize.go | 78 - .../protoc_gen_swift_stderr_write_closer.go | 73 - .../bufpluginexec/protoc_proxy_handler.go | 202 - .../private/bufpkg/bufpluginexec/usage.gen.go | 19 - .../buf/private/bufpkg/bufpluginexec/util.go | 46 - .../bufpkg/bufpluginexec/util_darwin.go | 20 - .../bufpkg/bufpluginexec/util_undarwin.go | 20 - .../private/bufpkg/bufpluginexec/version.go | 154 - .../bufpkg/bufpluginexec/wasm_handler.go | 150 - .../private/bufpkg/bufreflect/bufreflect.go | 60 - .../private/bufpkg/bufreflect/usage.gen.go | 19 - .../bufpkg/bufremoteplugin/bufremoteplugin.go | 59 - .../bufpkg/bufremoteplugin/usage.gen.go | 19 - .../bufpkg/bufstudioagent/buffer_codec.go | 69 - .../bufpkg/bufstudioagent/bufstudioagent.go | 67 - .../bufstudioagent/plain_post_handler.go | 269 - .../bufpkg/bufstudioagent/usage.gen.go | 19 - .../bufpkg/buftransport/buftransport.go | 30 - .../private/bufpkg/buftransport/usage.gen.go | 19 - .../buf/private/bufpkg/bufwasm/bufwasm.go | 289 - .../private/bufpkg/bufwasm/testdata/echo.wasm | Bin 208 -> 0 bytes .../buf/private/bufpkg/bufwasm/usage.gen.go | 19 - .../private/gen/data/dataspdx/dataspdx.gen.go | 1536 - .../private/gen/data/dataspdx/usage.gen.go | 19 - .../private/gen/data/datawkt/datawkt.gen.go | 173 - .../buf/private/gen/data/datawkt/usage.gen.go | 19 - .../registryv1alpha1connect/admin.connect.go | 369 - .../registryv1alpha1connect/authn.connect.go | 162 - .../registryv1alpha1connect/authz.connect.go | 818 - .../convert.connect.go | 123 - .../display.connect.go | 351 - .../registryv1alpha1connect/doc.connect.go | 263 - .../download.connect.go | 158 - .../generate.connect.go | 157 - .../registryv1alpha1connect/github.connect.go | 124 - .../registryv1alpha1connect/image.connect.go | 124 - .../jsonschema.connect.go | 128 - .../registryv1alpha1connect/labels.connect.go | 175 - .../organization.connect.go | 593 - .../registryv1alpha1connect/owner.connect.go | 125 - .../registryv1alpha1connect/plugin.connect.go | 573 - .../plugin_curation.connect.go | 296 - .../registryv1alpha1connect/push.connect.go | 155 - .../recommendation.connect.go | 229 - .../reference.connect.go | 195 - .../repository.connect.go | 668 - .../repository_branch.connect.go | 159 - .../repository_commit.connect.go | 301 - .../repository_tag.connect.go | 191 - .../resolve.connect.go | 360 - .../resource.connect.go | 126 - .../registryv1alpha1connect/schema.connect.go | 156 - .../scim_token.connect.go | 197 - .../registryv1alpha1connect/search.connect.go | 184 - .../registryv1alpha1connect/studio.connect.go | 153 - .../studio_request.connect.go | 219 - .../registryv1alpha1connect/sync.connect.go | 156 - .../registryv1alpha1connect/token.connect.go | 224 - .../registryv1alpha1connect/usage.gen.go | 19 - .../registryv1alpha1connect/user.connect.go | 395 - .../webhook.connect.go | 188 - .../go/buf/alpha/breaking/v1/config.pb.go | 319 - .../go/buf/alpha/breaking/v1/usage.gen.go | 19 - .../proto/go/buf/alpha/image/v1/image.pb.go | 717 - .../proto/go/buf/alpha/image/v1/usage.gen.go | 19 - .../proto/go/buf/alpha/lint/v1/config.pb.go | 380 - .../proto/go/buf/alpha/lint/v1/usage.gen.go | 19 - .../go/buf/alpha/module/v1alpha1/module.pb.go | 788 - .../go/buf/alpha/module/v1alpha1/usage.gen.go | 19 - .../buf/alpha/registry/v1alpha1/admin.pb.go | 1979 - .../buf/alpha/registry/v1alpha1/authn.pb.go | 379 - .../buf/alpha/registry/v1alpha1/authz.pb.go | 3057 -- .../buf/alpha/registry/v1alpha1/convert.pb.go | 368 - .../buf/alpha/registry/v1alpha1/display.pb.go | 1354 - .../go/buf/alpha/registry/v1alpha1/doc.pb.go | 3468 -- .../alpha/registry/v1alpha1/download.pb.go | 459 - .../alpha/registry/v1alpha1/generate.pb.go | 897 - .../registry/v1alpha1/git_metadata.pb.go | 319 - .../buf/alpha/registry/v1alpha1/github.pb.go | 308 - .../buf/alpha/registry/v1alpha1/image.pb.go | 404 - .../alpha/registry/v1alpha1/jsonschema.pb.go | 288 - .../buf/alpha/registry/v1alpha1/labels.pb.go | 927 - .../buf/alpha/registry/v1alpha1/module.pb.go | 334 - .../registry/v1alpha1/organization.pb.go | 2860 -- .../buf/alpha/registry/v1alpha1/owner.pb.go | 375 - .../buf/alpha/registry/v1alpha1/plugin.pb.go | 3845 -- .../registry/v1alpha1/plugin_curation.pb.go | 3564 -- .../go/buf/alpha/registry/v1alpha1/push.pb.go | 545 - .../registry/v1alpha1/recommendation.pb.go | 936 - .../alpha/registry/v1alpha1/reference.pb.go | 1044 - .../alpha/registry/v1alpha1/repository.pb.go | 3616 -- .../registry/v1alpha1/repository_branch.pb.go | 559 - .../registry/v1alpha1/repository_commit.pb.go | 1492 - .../registry/v1alpha1/repository_tag.pb.go | 785 - .../buf/alpha/registry/v1alpha1/resolve.pb.go | 1366 - .../alpha/registry/v1alpha1/resource.pb.go | 387 - .../go/buf/alpha/registry/v1alpha1/role.pb.go | 509 - .../buf/alpha/registry/v1alpha1/schema.pb.go | 945 - .../alpha/registry/v1alpha1/scim_token.pb.go | 647 - .../buf/alpha/registry/v1alpha1/search.pb.go | 1787 - .../buf/alpha/registry/v1alpha1/studio.pb.go | 529 - .../registry/v1alpha1/studio_request.pb.go | 1165 - .../go/buf/alpha/registry/v1alpha1/sync.pb.go | 633 - .../buf/alpha/registry/v1alpha1/token.pb.go | 823 - .../buf/alpha/registry/v1alpha1/usage.gen.go | 19 - .../go/buf/alpha/registry/v1alpha1/user.pb.go | 1998 - .../v1alpha1/verification_status.pb.go | 176 - .../buf/alpha/registry/v1alpha1/webhook.pb.go | 816 - .../go/buf/alpha/studio/v1alpha1/invoke.pb.go | 395 - .../go/buf/alpha/studio/v1alpha1/usage.gen.go | 19 - .../go/buf/alpha/wasmplugin/v1/usage.gen.go | 19 - .../buf/alpha/wasmplugin/v1/wasmplugin.pb.go | 346 - .../go/grpc/reflection/v1/reflection.pb.go | 961 - .../proto/go/grpc/reflection/v1/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/app/app.go | 352 - .../bufbuild/buf/private/pkg/app/app_error.go | 49 - .../bufbuild/buf/private/pkg/app/app_unix.go | 121 - .../buf/private/pkg/app/app_windows.go | 110 - .../buf/private/pkg/app/appcmd/appcmd.go | 378 - .../buf/private/pkg/app/appcmd/cobra.go | 58 - .../buf/private/pkg/app/appcmd/error.go | 29 - .../buf/private/pkg/app/appcmd/usage.gen.go | 19 - .../buf/private/pkg/app/appcmd/webpages.go | 398 - .../buf/private/pkg/app/appflag/appflag.go | 66 - .../buf/private/pkg/app/appflag/builder.go | 241 - .../buf/private/pkg/app/appflag/container.go | 77 - .../buf/private/pkg/app/appflag/usage.gen.go | 19 - .../buf/private/pkg/app/applog/applog.go | 82 - .../buf/private/pkg/app/applog/container.go | 33 - .../buf/private/pkg/app/applog/usage.gen.go | 19 - .../buf/private/pkg/app/appname/appname.go | 141 - .../buf/private/pkg/app/appname/container.go | 132 - .../buf/private/pkg/app/appname/usage.gen.go | 19 - .../buf/private/pkg/app/appproto/appproto.go | 298 - .../pkg/app/appproto/appprotoos/appprotoos.go | 68 - .../appproto/appprotoos/response_writer.go | 301 - .../pkg/app/appproto/appprotoos/usage.gen.go | 19 - .../buf/private/pkg/app/appproto/generator.go | 72 - .../pkg/app/appproto/response_builder.go | 159 - .../pkg/app/appproto/response_writer.go | 154 - .../buf/private/pkg/app/appproto/usage.gen.go | 19 - .../private/pkg/app/appverbose/appverbose.go | 39 - .../private/pkg/app/appverbose/container.go | 31 - .../private/pkg/app/appverbose/usage.gen.go | 19 - .../buf/private/pkg/app/arg_container.go | 35 - .../bufbuild/buf/private/pkg/app/container.go | 39 - .../buf/private/pkg/app/env_container.go | 74 - .../buf/private/pkg/app/stderr_container.go | 38 - .../buf/private/pkg/app/stdin_container.go | 38 - .../buf/private/pkg/app/stdout_container.go | 38 - .../bufbuild/buf/private/pkg/app/usage.gen.go | 19 - .../private/pkg/cert/certclient/certclient.go | 64 - .../private/pkg/cert/certclient/usage.gen.go | 19 - .../buf/private/pkg/cert/certclient/util.go | 68 - .../buf/private/pkg/command/command.go | 213 - .../buf/private/pkg/command/process.go | 69 - .../buf/private/pkg/command/runner.go | 131 - .../buf/private/pkg/command/usage.gen.go | 19 - .../pkg/connectclient/connectclient.go | 80 - .../private/pkg/connectclient/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/dag/dag.go | 450 - .../bufbuild/buf/private/pkg/dag/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/diff/diff.go | 201 - .../buf/private/pkg/diff/usage.gen.go | 19 - .../buf/private/pkg/encoding/encoding.go | 202 - .../buf/private/pkg/encoding/usage.gen.go | 19 - .../pkg/filepathextended/filepathextended.go | 220 - .../private/pkg/filepathextended/usage.gen.go | 19 - .../buf/private/pkg/git/annotated_tag.go | 75 - .../bufbuild/buf/private/pkg/git/branch.go | 45 - .../bufbuild/buf/private/pkg/git/cloner.go | 398 - .../bufbuild/buf/private/pkg/git/commit.go | 91 - .../bufbuild/buf/private/pkg/git/git.go | 319 - .../bufbuild/buf/private/pkg/git/hash.go | 66 - .../bufbuild/buf/private/pkg/git/ident.go | 87 - .../bufbuild/buf/private/pkg/git/lister.go | 131 - .../buf/private/pkg/git/object_reader.go | 170 - .../buf/private/pkg/git/packed_refs.go | 106 - .../bufbuild/buf/private/pkg/git/ref.go | 45 - .../buf/private/pkg/git/ref_branch.go | 58 - .../buf/private/pkg/git/repository.go | 325 - .../bufbuild/buf/private/pkg/git/tree.go | 115 - .../bufbuild/buf/private/pkg/git/tree_node.go | 86 - .../bufbuild/buf/private/pkg/git/usage.gen.go | 19 - .../private/pkg/httpauth/env_authenticator.go | 46 - .../buf/private/pkg/httpauth/httpauth.go | 63 - .../pkg/httpauth/multi_authenticator.go | 51 - .../pkg/httpauth/netrc_authenticator.go | 52 - .../private/pkg/httpauth/nop_authenticator.go | 31 - .../buf/private/pkg/httpauth/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/httpauth/util.go | 50 - .../buf/private/pkg/interrupt/interrupt.go | 52 - .../private/pkg/interrupt/interrupt_unix.go | 35 - .../pkg/interrupt/interrupt_windows.go | 28 - .../buf/private/pkg/interrupt/usage.gen.go | 19 - .../buf/private/pkg/ioextended/ioextended.go | 126 - .../buf/private/pkg/ioextended/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/manifest/blob.go | 275 - .../buf/private/pkg/manifest/digest.go | 138 - .../buf/private/pkg/manifest/manifest.go | 304 - .../buf/private/pkg/manifest/usage.gen.go | 19 - .../private/pkg/netextended/netextended.go | 104 - .../buf/private/pkg/netextended/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/netrc/machine.go | 45 - .../bufbuild/buf/private/pkg/netrc/netrc.go | 177 - .../buf/private/pkg/netrc/netrc_unix.go | 26 - .../buf/private/pkg/netrc/netrc_windows.go | 24 - .../buf/private/pkg/netrc/usage.gen.go | 19 - .../buf/private/pkg/normalpath/normalpath.go | 373 - .../private/pkg/normalpath/normalpath_unix.go | 161 - .../pkg/normalpath/normalpath_windows.go | 181 - .../buf/private/pkg/normalpath/usage.gen.go | 19 - .../pkg/observabilityzap/observabilityzap.go | 45 - .../tracer_provider_closer.go | 44 - .../private/pkg/observabilityzap/usage.gen.go | 19 - .../pkg/observabilityzap/zapexporter.go | 56 - .../buf/private/pkg/osextended/osextended.go | 46 - .../buf/private/pkg/osextended/usage.gen.go | 19 - .../pkg/protodescriptor/protodescriptor.go | 288 - .../private/pkg/protodescriptor/usage.gen.go | 19 - .../pkg/protoencoding/json_marshaler.go | 74 - .../pkg/protoencoding/json_unmarshaler.go | 39 - .../pkg/protoencoding/protoencoding.go | 115 - .../pkg/protoencoding/reparse_unrecognized.go | 76 - .../buf/private/pkg/protoencoding/resolver.go | 159 - .../private/pkg/protoencoding/usage.gen.go | 19 - .../pkg/protoencoding/wire_marshaler.go | 32 - .../pkg/protoencoding/wire_unmarshaler.go | 36 - .../buf/private/pkg/protosource/descriptor.go | 48 - .../buf/private/pkg/protosource/enum.go | 101 - .../buf/private/pkg/protosource/enum_range.go | 58 - .../buf/private/pkg/protosource/enum_value.go | 59 - .../buf/private/pkg/protosource/field.go | 209 - .../buf/private/pkg/protosource/file.go | 837 - .../private/pkg/protosource/file_import.go | 74 - .../buf/private/pkg/protosource/files.go | 105 - .../buf/private/pkg/protosource/location.go | 93 - .../pkg/protosource/location_descriptor.go | 35 - .../private/pkg/protosource/location_store.go | 71 - .../pkg/protosource/merge_comment_location.go | 66 - .../buf/private/pkg/protosource/message.go | 175 - .../private/pkg/protosource/message_range.go | 94 - .../buf/private/pkg/protosource/method.go | 113 - .../pkg/protosource/named_descriptor.go | 75 - .../buf/private/pkg/protosource/oneof.go | 47 - .../option_extension_descriptor.go | 128 - .../buf/private/pkg/protosource/paths.go | 309 - .../private/pkg/protosource/protosource.go | 1252 - .../private/pkg/protosource/reserved_name.go | 40 - .../buf/private/pkg/protosource/service.go | 47 - .../buf/private/pkg/protosource/usage.gen.go | 19 - .../buf/private/pkg/protostat/protostat.go | 196 - .../buf/private/pkg/protostat/usage.gen.go | 19 - .../buf/private/pkg/prototime/prototime.go | 31 - .../buf/private/pkg/prototime/usage.gen.go | 19 - .../pkg/protoversion/package_version.go | 204 - .../private/pkg/protoversion/protoversion.go | 90 - .../buf/private/pkg/protoversion/usage.gen.go | 19 - .../buf/private/pkg/storage/bucket.go | 249 - .../bufbuild/buf/private/pkg/storage/copy.go | 174 - .../bufbuild/buf/private/pkg/storage/diff.go | 320 - .../buf/private/pkg/storage/errors.go | 93 - .../bufbuild/buf/private/pkg/storage/limit.go | 92 - .../bufbuild/buf/private/pkg/storage/map.go | 253 - .../buf/private/pkg/storage/mapper.go | 163 - .../buf/private/pkg/storage/matcher.go | 204 - .../bufbuild/buf/private/pkg/storage/multi.go | 144 - .../buf/private/pkg/storage/storage.go | 21 - .../storage/storagearchive/storagearchive.go | 261 - .../storage/storagearchive/untar_options.go | 27 - .../pkg/storage/storagearchive/usage.gen.go | 19 - .../private/pkg/storage/storagegit/bucket.go | 218 - .../buf/private/pkg/storage/storagegit/doc.go | 16 - .../pkg/storage/storagegit/provider.go | 58 - .../pkg/storage/storagegit/storagegit.go | 60 - .../pkg/storage/storagegit/usage.gen.go | 19 - .../pkg/storage/storagemanifest/bucket.go | 140 - .../storagemanifest/read_object_closer.go | 33 - .../storagemanifest/storagemanifest.go | 50 - .../pkg/storage/storagemanifest/usage.gen.go | 19 - .../private/pkg/storage/storagemem/bucket.go | 159 - .../storagemem/internal/immutable_object.go | 57 - .../storage/storagemem/internal/usage.gen.go | 19 - .../storage/storagemem/read_object_closer.go | 52 - .../pkg/storage/storagemem/storagemem.go | 48 - .../pkg/storage/storagemem/usage.gen.go | 19 - .../storage/storagemem/write_object_closer.go | 77 - .../private/pkg/storage/storageos/bucket.go | 438 - .../private/pkg/storage/storageos/provider.go | 52 - .../pkg/storage/storageos/storageos.go | 65 - .../pkg/storage/storageos/usage.gen.go | 19 - .../pkg/storage/storageutil/storageutil.go | 99 - .../pkg/storage/storageutil/usage.gen.go | 19 - .../buf/private/pkg/storage/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/storage/util.go | 171 - .../buf/private/pkg/stringutil/stringutil.go | 332 - .../buf/private/pkg/stringutil/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/thread/thread.go | 147 - .../buf/private/pkg/thread/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/tmp/tmp.go | 179 - .../bufbuild/buf/private/pkg/tmp/usage.gen.go | 19 - .../pkg/transport/http/httpclient/client.go | 29 - .../transport/http/httpclient/httpclient.go | 25 - .../transport/http/httpclient/usage.gen.go | 19 - .../transport/http/httpserver/httpserver.go | 176 - .../transport/http/httpserver/usage.gen.go | 19 - .../buf/private/pkg/uuidutil/usage.gen.go | 19 - .../buf/private/pkg/uuidutil/uuidutil.go | 95 - .../buf/private/pkg/verbose/usage.gen.go | 19 - .../buf/private/pkg/verbose/verbose.go | 75 - .../buf/private/pkg/zaputil/usage.gen.go | 19 - .../bufbuild/buf/private/pkg/zaputil/vars.go | 66 - .../buf/private/pkg/zaputil/zaputil.go | 53 - .../bufbuild/buf/private/usage/usage.go | 47 - .../bufbuild/buf/private/usage/usage_unix.go | 20 - .../buf/private/usage/usage_windows.go | 20 - .../github.com/bufbuild/connect-go/.gitignore | 5 - .../bufbuild/connect-go/.golangci.yml | 124 - vendor/github.com/bufbuild/connect-go/LICENSE | 201 - .../github.com/bufbuild/connect-go/Makefile | 94 - .../github.com/bufbuild/connect-go/README.md | 185 - .../bufbuild/connect-go/buf.gen.yaml | 12 - .../bufbuild/connect-go/buf.work.yaml | 3 - .../bufbuild/connect-go/buffer_pool.go | 54 - .../github.com/bufbuild/connect-go/client.go | 273 - .../bufbuild/connect-go/client_stream.go | 273 - vendor/github.com/bufbuild/connect-go/code.go | 226 - .../github.com/bufbuild/connect-go/codec.go | 251 - .../bufbuild/connect-go/compression.go | 215 - .../github.com/bufbuild/connect-go/connect.go | 377 - .../bufbuild/connect-go/duplex_http_call.go | 318 - .../bufbuild/connect-go/envelope.go | 302 - .../github.com/bufbuild/connect-go/error.go | 411 - .../bufbuild/connect-go/error_writer.go | 168 - .../github.com/bufbuild/connect-go/handler.go | 333 - .../bufbuild/connect-go/handler_stream.go | 189 - .../github.com/bufbuild/connect-go/header.go | 87 - .../bufbuild/connect-go/idempotency_level.go | 68 - .../bufbuild/connect-go/interceptor.go | 105 - .../connectext/grpc/status/v1/status.pb.go | 202 - .../github.com/bufbuild/connect-go/option.go | 559 - .../bufbuild/connect-go/protobuf_util.go | 42 - .../bufbuild/connect-go/protocol.go | 398 - .../bufbuild/connect-go/protocol_connect.go | 1303 - .../bufbuild/connect-go/protocol_grpc.go | 938 - .../github.com/bufbuild/connect-go/recover.go | 80 - .../connect-opentelemetry-go/.gitignore | 4 - .../connect-opentelemetry-go/.golangci.yml | 74 - .../bufbuild/connect-opentelemetry-go/LICENSE | 201 - .../connect-opentelemetry-go/Makefile | 98 - .../connect-opentelemetry-go/README.md | 139 - .../connect-opentelemetry-go/attributes.go | 143 - .../connect-opentelemetry-go/buf.gen.yaml | 12 - .../connect-opentelemetry-go/buf.work.yaml | 3 - .../bufbuild/connect-opentelemetry-go/doc.go | 22 - .../connect-opentelemetry-go/instruments.go | 94 - .../connect-opentelemetry-go/interceptor.go | 356 - .../connect-opentelemetry-go/option.go | 211 - .../connect-opentelemetry-go/otelconnect.go | 59 - .../payloadinterceptor.go | 116 - .../connect-opentelemetry-go/streaming.go | 144 - .../bufbuild/protocompile/.gitignore | 3 - .../bufbuild/protocompile/.golangci.yml | 99 - .../github.com/bufbuild/protocompile/LICENSE | 201 - .../github.com/bufbuild/protocompile/Makefile | 159 - .../bufbuild/protocompile/README.md | 91 - .../bufbuild/protocompile/ast/doc.go | 75 - .../bufbuild/protocompile/ast/enum.go | 165 - .../bufbuild/protocompile/ast/field.go | 672 - .../bufbuild/protocompile/ast/file.go | 277 - .../bufbuild/protocompile/ast/file_info.go | 676 - .../bufbuild/protocompile/ast/identifiers.go | 148 - .../bufbuild/protocompile/ast/message.go | 213 - .../bufbuild/protocompile/ast/no_source.go | 119 - .../bufbuild/protocompile/ast/node.go | 139 - .../bufbuild/protocompile/ast/options.go | 373 - .../bufbuild/protocompile/ast/ranges.go | 319 - .../bufbuild/protocompile/ast/service.go | 286 - .../bufbuild/protocompile/ast/values.go | 558 - .../bufbuild/protocompile/ast/walk.go | 910 - .../bufbuild/protocompile/compiler.go | 650 - .../github.com/bufbuild/protocompile/doc.go | 82 - .../github.com/bufbuild/protocompile/go.work | 7 - .../bufbuild/protocompile/go.work.sum | 410 - .../protocompile/internal/message_context.go | 98 - .../bufbuild/protocompile/internal/norace.go | 19 - .../bufbuild/protocompile/internal/options.go | 59 - .../bufbuild/protocompile/internal/race.go | 19 - .../bufbuild/protocompile/internal/tags.go | 243 - .../bufbuild/protocompile/internal/types.go | 35 - .../bufbuild/protocompile/internal/util.go | 119 - .../protocompile/linker/descriptors.go | 1876 - .../bufbuild/protocompile/linker/doc.go | 48 - .../bufbuild/protocompile/linker/files.go | 362 - .../bufbuild/protocompile/linker/linker.go | 166 - .../protocompile/linker/pathkey_no_unsafe.go | 35 - .../protocompile/linker/pathkey_unsafe.go | 36 - .../bufbuild/protocompile/linker/resolve.go | 801 - .../bufbuild/protocompile/linker/symbols.go | 567 - .../bufbuild/protocompile/linker/validate.go | 283 - .../bufbuild/protocompile/options/options.go | 1667 - .../bufbuild/protocompile/parser/.gitignore | 1 - .../bufbuild/protocompile/parser/ast.go | 216 - .../bufbuild/protocompile/parser/clone.go | 182 - .../bufbuild/protocompile/parser/doc.go | 25 - .../bufbuild/protocompile/parser/errors.go | 22 - .../bufbuild/protocompile/parser/lexer.go | 760 - .../bufbuild/protocompile/parser/parser.go | 193 - .../bufbuild/protocompile/parser/proto.y | 1219 - .../bufbuild/protocompile/parser/proto.y.go | 2408 -- .../bufbuild/protocompile/parser/result.go | 928 - .../bufbuild/protocompile/parser/validate.go | 499 - .../bufbuild/protocompile/protoutil/protos.go | 261 - .../bufbuild/protocompile/reporter/errors.go | 68 - .../protocompile/reporter/reporter.go | 232 - .../bufbuild/protocompile/resolver.go | 194 - .../sourceinfo/source_code_info.go | 814 - .../bufbuild/protocompile/std_imports.go | 62 - .../bufbuild/protocompile/walk/walk.go | 445 - vendor/github.com/butuzov/ireturn/LICENSE | 21 - .../butuzov/ireturn/analyzer/analyzer.go | 242 - .../butuzov/ireturn/analyzer/disallow.go | 45 - .../ireturn/analyzer/internal/config/allow.go | 17 - .../analyzer/internal/config/config.go | 66 - .../ireturn/analyzer/internal/config/new.go | 74 - .../analyzer/internal/config/reject.go | 17 - .../ireturn/analyzer/internal/types/iface.go | 49 - .../ireturn/analyzer/internal/types/names.go | 9 - .../ireturn/analyzer/internal/types/types.go | 12 - .../butuzov/ireturn/analyzer/std.go | 200 - .../butuzov/ireturn/analyzer/typeparams.go | 38 - vendor/github.com/butuzov/mirror/.act | 2 - .../github.com/butuzov/mirror/.editorconfig | 28 - vendor/github.com/butuzov/mirror/.gitignore | 11 - .../butuzov/mirror/.goreleaser.yaml | 61 - vendor/github.com/butuzov/mirror/LICENSE | 21 - .../github.com/butuzov/mirror/MIRROR_FUNCS.md | 150 - vendor/github.com/butuzov/mirror/Makefile | 58 - vendor/github.com/butuzov/mirror/Taskfile.yml | 28 - vendor/github.com/butuzov/mirror/analyzer.go | 144 - .../butuzov/mirror/checkers_bufio.go | 56 - .../butuzov/mirror/checkers_bytes.go | 326 - .../butuzov/mirror/checkers_httptest.go | 36 - .../butuzov/mirror/checkers_maphash.go | 36 - .../github.com/butuzov/mirror/checkers_os.go | 36 - .../butuzov/mirror/checkers_regexp.go | 187 - .../butuzov/mirror/checkers_strings.go | 299 - .../butuzov/mirror/checkers_utf8.go | 138 - .../mirror/internal/checker/checker.go | 147 - .../mirror/internal/checker/imports.go | 89 - .../mirror/internal/checker/violation.go | 208 - vendor/github.com/butuzov/mirror/readme.md | 60 - .../github.com/caarlos0/go-version/.gitignore | 2 - .../caarlos0/go-version/.goreleaser.yml | 3 - .../github.com/caarlos0/go-version/LICENSE.md | 13 - .../github.com/caarlos0/go-version/README.md | 27 - .../github.com/caarlos0/go-version/version.go | 206 - .../github.com/catenacyber/perfsprint/LICENSE | 21 - .../perfsprint/analyzer/analyzer.go | 594 - .../cavaliergopher/cpio/.travis.yml | 10 - vendor/github.com/cavaliergopher/cpio/LICENSE | 26 - .../github.com/cavaliergopher/cpio/README.md | 9 - vendor/github.com/cavaliergopher/cpio/doc.go | 9 - .../cavaliergopher/cpio/fileinfo.go | 58 - vendor/github.com/cavaliergopher/cpio/hash.go | 45 - .../github.com/cavaliergopher/cpio/header.go | 156 - .../github.com/cavaliergopher/cpio/reader.go | 72 - vendor/github.com/cavaliergopher/cpio/svr4.go | 152 - .../github.com/cavaliergopher/cpio/writer.go | 140 - .../github.com/ccojocar/zxcvbn-go/.gitignore | 5 - .../ccojocar/zxcvbn-go/.golangci.yml | 39 - .../ccojocar/zxcvbn-go/.goreleaser.yml | 27 - .../github.com/ccojocar/zxcvbn-go/LICENSE.txt | 20 - vendor/github.com/ccojocar/zxcvbn-go/Makefile | 61 - .../github.com/ccojocar/zxcvbn-go/README.md | 78 - .../zxcvbn-go/adjacency/adjcmartix.go | 105 - .../ccojocar/zxcvbn-go/data/bindata.go | 446 - .../zxcvbn-go/entropy/entropyCalculator.go | 217 - .../ccojocar/zxcvbn-go/frequency/frequency.go | 50 - .../ccojocar/zxcvbn-go/match/match.go | 45 - .../zxcvbn-go/matching/dateMatchers.go | 206 - .../zxcvbn-go/matching/dictionaryMatch.go | 56 - .../ccojocar/zxcvbn-go/matching/leet.go | 234 - .../ccojocar/zxcvbn-go/matching/matching.go | 79 - .../zxcvbn-go/matching/repeatMatch.go | 68 - .../zxcvbn-go/matching/sequenceMatch.go | 74 - .../zxcvbn-go/matching/spatialMatch.go | 87 - .../ccojocar/zxcvbn-go/renovate.json | 25 - .../ccojocar/zxcvbn-go/scoring/scoring.go | 180 - .../zxcvbn-go/utils/math/mathutils.go | 40 - .../github.com/ccojocar/zxcvbn-go/zxcvbn.go | 22 - .../charithe/durationcheck/.gitignore | 1 - .../github.com/charithe/durationcheck/LICENSE | 201 - .../charithe/durationcheck/Makefile | 5 - .../charithe/durationcheck/README.md | 51 - .../charithe/durationcheck/durationcheck.go | 191 - .../charmbracelet/lipgloss/.gitignore | 1 - .../charmbracelet/lipgloss/.golangci-soft.yml | 47 - .../charmbracelet/lipgloss/.golangci.yml | 29 - .../github.com/charmbracelet/lipgloss/LICENSE | 21 - .../charmbracelet/lipgloss/README.md | 458 - .../charmbracelet/lipgloss/align.go | 82 - .../charmbracelet/lipgloss/ansi_unix.go | 7 - .../charmbracelet/lipgloss/ansi_windows.go | 22 - .../charmbracelet/lipgloss/borders.go | 412 - .../charmbracelet/lipgloss/color.go | 172 - .../github.com/charmbracelet/lipgloss/get.go | 481 - .../github.com/charmbracelet/lipgloss/join.go | 175 - .../charmbracelet/lipgloss/position.go | 154 - .../charmbracelet/lipgloss/renderer.go | 143 - .../charmbracelet/lipgloss/runes.go | 43 - .../github.com/charmbracelet/lipgloss/set.go | 634 - .../github.com/charmbracelet/lipgloss/size.go | 41 - .../charmbracelet/lipgloss/style.go | 497 - .../charmbracelet/lipgloss/unset.go | 306 - .../charmbracelet/lipgloss/whitespace.go | 83 - vendor/github.com/chavacava/garif/.gitignore | 3 - vendor/github.com/chavacava/garif/LICENSE | 21 - vendor/github.com/chavacava/garif/README.md | 52 - .../chavacava/garif/constructors.go | 338 - .../github.com/chavacava/garif/decorators.go | 94 - vendor/github.com/chavacava/garif/doc.go | 11 - vendor/github.com/chavacava/garif/enums.go | 41 - vendor/github.com/chavacava/garif/io.go | 26 - vendor/github.com/chavacava/garif/models.go | 1486 - vendor/github.com/cloudflare/circl/LICENSE | 57 - .../cloudflare/circl/dh/x25519/curve.go | 96 - .../cloudflare/circl/dh/x25519/curve_amd64.go | 30 - .../cloudflare/circl/dh/x25519/curve_amd64.h | 111 - .../cloudflare/circl/dh/x25519/curve_amd64.s | 156 - .../circl/dh/x25519/curve_generic.go | 85 - .../cloudflare/circl/dh/x25519/curve_noasm.go | 11 - .../cloudflare/circl/dh/x25519/doc.go | 19 - .../cloudflare/circl/dh/x25519/key.go | 47 - .../cloudflare/circl/dh/x25519/table.go | 268 - .../cloudflare/circl/dh/x448/curve.go | 104 - .../cloudflare/circl/dh/x448/curve_amd64.go | 30 - .../cloudflare/circl/dh/x448/curve_amd64.h | 111 - .../cloudflare/circl/dh/x448/curve_amd64.s | 193 - .../cloudflare/circl/dh/x448/curve_generic.go | 100 - .../cloudflare/circl/dh/x448/curve_noasm.go | 11 - .../cloudflare/circl/dh/x448/doc.go | 19 - .../cloudflare/circl/dh/x448/key.go | 46 - .../cloudflare/circl/dh/x448/table.go | 460 - .../circl/ecc/goldilocks/constants.go | 71 - .../cloudflare/circl/ecc/goldilocks/curve.go | 80 - .../circl/ecc/goldilocks/isogeny.go | 52 - .../cloudflare/circl/ecc/goldilocks/point.go | 171 - .../cloudflare/circl/ecc/goldilocks/scalar.go | 203 - .../cloudflare/circl/ecc/goldilocks/twist.go | 138 - .../circl/ecc/goldilocks/twistPoint.go | 135 - .../circl/ecc/goldilocks/twistTables.go | 216 - .../circl/ecc/goldilocks/twist_basemult.go | 62 - .../cloudflare/circl/internal/conv/conv.go | 140 - .../cloudflare/circl/internal/sha3/doc.go | 62 - .../cloudflare/circl/internal/sha3/hashes.go | 69 - .../cloudflare/circl/internal/sha3/keccakf.go | 391 - .../cloudflare/circl/internal/sha3/rc.go | 29 - .../cloudflare/circl/internal/sha3/sha3.go | 200 - .../circl/internal/sha3/sha3_s390x.s | 33 - .../cloudflare/circl/internal/sha3/shake.go | 119 - .../cloudflare/circl/internal/sha3/xor.go | 15 - .../circl/internal/sha3/xor_generic.go | 33 - .../circl/internal/sha3/xor_unaligned.go | 61 - .../cloudflare/circl/math/fp25519/fp.go | 205 - .../cloudflare/circl/math/fp25519/fp_amd64.go | 45 - .../cloudflare/circl/math/fp25519/fp_amd64.h | 351 - .../cloudflare/circl/math/fp25519/fp_amd64.s | 111 - .../circl/math/fp25519/fp_generic.go | 317 - .../cloudflare/circl/math/fp25519/fp_noasm.go | 13 - .../cloudflare/circl/math/fp448/fp.go | 164 - .../cloudflare/circl/math/fp448/fp_amd64.go | 43 - .../cloudflare/circl/math/fp448/fp_amd64.h | 591 - .../cloudflare/circl/math/fp448/fp_amd64.s | 74 - .../cloudflare/circl/math/fp448/fp_generic.go | 339 - .../cloudflare/circl/math/fp448/fp_noasm.go | 12 - .../cloudflare/circl/math/fp448/fuzzer.go | 75 - .../cloudflare/circl/math/mlsbset/mlsbset.go | 122 - .../cloudflare/circl/math/mlsbset/power.go | 64 - .../cloudflare/circl/math/primes.go | 34 - .../github.com/cloudflare/circl/math/wnaf.go | 84 - .../cloudflare/circl/sign/ed25519/ed25519.go | 453 - .../cloudflare/circl/sign/ed25519/modular.go | 175 - .../cloudflare/circl/sign/ed25519/mult.go | 180 - .../cloudflare/circl/sign/ed25519/point.go | 195 - .../cloudflare/circl/sign/ed25519/pubkey.go | 9 - .../circl/sign/ed25519/pubkey112.go | 7 - .../cloudflare/circl/sign/ed25519/signapi.go | 87 - .../cloudflare/circl/sign/ed25519/tables.go | 213 - .../cloudflare/circl/sign/ed448/ed448.go | 411 - .../cloudflare/circl/sign/ed448/signapi.go | 87 - .../github.com/cloudflare/circl/sign/sign.go | 110 - .../stargz-snapshotter/estargz/LICENSE | 202 - .../stargz-snapshotter/estargz/build.go | 690 - .../estargz/errorutil/errors.go | 40 - .../stargz-snapshotter/estargz/estargz.go | 1223 - .../stargz-snapshotter/estargz/gzip.go | 237 - .../stargz-snapshotter/estargz/testutil.go | 2366 -- .../stargz-snapshotter/estargz/types.go | 342 - .../cpuguy83/go-md2man/v2/LICENSE.md | 21 - .../cpuguy83/go-md2man/v2/md2man/md2man.go | 16 - .../cpuguy83/go-md2man/v2/md2man/roff.go | 348 - vendor/github.com/creack/pty/.gitignore | 4 - .../github.com/creack/pty/Dockerfile.golang | 17 - vendor/github.com/creack/pty/Dockerfile.riscv | 23 - vendor/github.com/creack/pty/LICENSE | 23 - vendor/github.com/creack/pty/README.md | 107 - .../github.com/creack/pty/asm_solaris_amd64.s | 18 - vendor/github.com/creack/pty/doc.go | 16 - vendor/github.com/creack/pty/ioctl.go | 19 - vendor/github.com/creack/pty/ioctl_bsd.go | 40 - vendor/github.com/creack/pty/ioctl_solaris.go | 48 - .../creack/pty/ioctl_unsupported.go | 13 - vendor/github.com/creack/pty/mktypes.bash | 19 - vendor/github.com/creack/pty/pty_darwin.go | 68 - vendor/github.com/creack/pty/pty_dragonfly.go | 83 - vendor/github.com/creack/pty/pty_freebsd.go | 81 - vendor/github.com/creack/pty/pty_linux.go | 54 - vendor/github.com/creack/pty/pty_netbsd.go | 69 - vendor/github.com/creack/pty/pty_openbsd.go | 36 - vendor/github.com/creack/pty/pty_solaris.go | 152 - .../github.com/creack/pty/pty_unsupported.go | 12 - vendor/github.com/creack/pty/run.go | 57 - vendor/github.com/creack/pty/start.go | 25 - vendor/github.com/creack/pty/start_windows.go | 19 - .../creack/pty/test_crosscompile.sh | 64 - vendor/github.com/creack/pty/winsize.go | 27 - vendor/github.com/creack/pty/winsize_unix.go | 35 - .../creack/pty/winsize_unsupported.go | 23 - vendor/github.com/creack/pty/ztypes_386.go | 12 - vendor/github.com/creack/pty/ztypes_amd64.go | 12 - vendor/github.com/creack/pty/ztypes_arm.go | 12 - vendor/github.com/creack/pty/ztypes_arm64.go | 12 - .../creack/pty/ztypes_dragonfly_amd64.go | 17 - .../creack/pty/ztypes_freebsd_386.go | 16 - .../creack/pty/ztypes_freebsd_amd64.go | 17 - .../creack/pty/ztypes_freebsd_arm.go | 16 - .../creack/pty/ztypes_freebsd_arm64.go | 16 - .../creack/pty/ztypes_freebsd_ppc64.go | 14 - .../github.com/creack/pty/ztypes_loong64.go | 12 - vendor/github.com/creack/pty/ztypes_mipsx.go | 13 - .../creack/pty/ztypes_netbsd_32bit_int.go | 17 - .../creack/pty/ztypes_openbsd_32bit_int.go | 14 - vendor/github.com/creack/pty/ztypes_ppc64.go | 12 - .../github.com/creack/pty/ztypes_ppc64le.go | 12 - vendor/github.com/creack/pty/ztypes_riscvx.go | 12 - vendor/github.com/creack/pty/ztypes_s390x.go | 12 - .../curioswitch/go-reassign/.gitattributes | 2 - .../curioswitch/go-reassign/.gitignore | 6 - .../curioswitch/go-reassign/.golangci.yml | 38 - .../curioswitch/go-reassign/.goreleaser.yaml | 27 - .../curioswitch/go-reassign/LICENSE | 21 - .../curioswitch/go-reassign/README.md | 53 - .../curioswitch/go-reassign/analyzer.go | 13 - .../go-reassign/internal/analyzer/analyzer.go | 84 - .../cyphar/filepath-securejoin/LICENSE | 28 - .../cyphar/filepath-securejoin/README.md | 79 - .../cyphar/filepath-securejoin/VERSION | 1 - .../cyphar/filepath-securejoin/join.go | 125 - .../cyphar/filepath-securejoin/vfs.go | 41 - vendor/github.com/daixiang0/gci/LICENSE | 29 - .../daixiang0/gci/pkg/config/config.go | 90 - .../daixiang0/gci/pkg/format/format.go | 46 - .../github.com/daixiang0/gci/pkg/gci/gci.go | 229 - .../daixiang0/gci/pkg/gci/testdata.go | 1278 - .../github.com/daixiang0/gci/pkg/io/file.go | 64 - .../github.com/daixiang0/gci/pkg/io/search.go | 77 - .../github.com/daixiang0/gci/pkg/io/stdin.go | 27 - .../github.com/daixiang0/gci/pkg/log/log.go | 50 - .../daixiang0/gci/pkg/parse/parse.go | 197 - .../daixiang0/gci/pkg/section/alias.go | 25 - .../daixiang0/gci/pkg/section/blank.go | 25 - .../daixiang0/gci/pkg/section/commentline.go | 24 - .../daixiang0/gci/pkg/section/default.go | 22 - .../daixiang0/gci/pkg/section/dot.go | 25 - .../daixiang0/gci/pkg/section/errors.go | 107 - .../daixiang0/gci/pkg/section/newline.go | 22 - .../daixiang0/gci/pkg/section/parser.go | 46 - .../daixiang0/gci/pkg/section/prefix.go | 38 - .../daixiang0/gci/pkg/section/section.go | 36 - .../daixiang0/gci/pkg/section/standard.go | 30 - .../gci/pkg/section/standard_list.go | 168 - .../daixiang0/gci/pkg/specificity/default.go | 19 - .../daixiang0/gci/pkg/specificity/match.go | 24 - .../daixiang0/gci/pkg/specificity/mismatch.go | 19 - .../daixiang0/gci/pkg/specificity/name.go | 19 - .../gci/pkg/specificity/specificity.go | 27 - .../daixiang0/gci/pkg/specificity/standard.go | 19 - .../daixiang0/gci/pkg/utils/constants.go | 12 - .../denis-tingaikin/go-header/.gitignore | 1 - .../denis-tingaikin/go-header/.go-header.yml | 19 - .../denis-tingaikin/go-header/LICENSE | 674 - .../denis-tingaikin/go-header/README.md | 81 - .../denis-tingaikin/go-header/analyzer.go | 146 - .../denis-tingaikin/go-header/config.go | 99 - .../denis-tingaikin/go-header/issue.go | 48 - .../denis-tingaikin/go-header/location.go | 35 - .../denis-tingaikin/go-header/option.go | 44 - .../denis-tingaikin/go-header/reader.go | 116 - .../denis-tingaikin/go-header/value.go | 128 - .../distribution/reference/.gitattributes | 1 - .../distribution/reference/.gitignore | 2 - .../distribution/reference/.golangci.yml | 18 - .../distribution/reference/CODE-OF-CONDUCT.md | 5 - .../distribution/reference/CONTRIBUTING.md | 114 - .../distribution/reference/GOVERNANCE.md | 144 - .../github.com/distribution/reference/LICENSE | 202 - .../distribution/reference/MAINTAINERS | 26 - .../distribution/reference/Makefile | 25 - .../distribution/reference/README.md | 30 - .../distribution/reference/SECURITY.md | 7 - .../reference/distribution-logo.svg | 1 - .../distribution/reference/helpers.go | 42 - .../distribution/reference/normalize.go | 224 - .../distribution/reference/reference.go | 436 - .../distribution/reference/regexp.go | 163 - .../github.com/distribution/reference/sort.go | 75 - vendor/github.com/docker/cli/AUTHORS | 852 - vendor/github.com/docker/cli/LICENSE | 191 - vendor/github.com/docker/cli/NOTICE | 19 - .../docker/cli/cli/config/config.go | 153 - .../docker/cli/cli/config/configfile/file.go | 352 - .../cli/cli/config/configfile/file_unix.go | 36 - .../cli/cli/config/configfile/file_windows.go | 5 - .../cli/cli/config/credentials/credentials.go | 17 - .../cli/config/credentials/default_store.go | 21 - .../credentials/default_store_darwin.go | 5 - .../config/credentials/default_store_linux.go | 13 - .../credentials/default_store_unsupported.go | 8 - .../credentials/default_store_windows.go | 5 - .../cli/cli/config/credentials/file_store.go | 81 - .../cli/config/credentials/native_store.go | 143 - .../docker/cli/cli/config/types/authconfig.go | 22 - vendor/github.com/docker/distribution/LICENSE | 202 - .../reference/helpers_deprecated.go | 34 - .../reference/normalize_deprecated.go | 92 - .../reference/reference_deprecated.go | 172 - .../reference/regexp_deprecated.go | 50 - .../distribution/reference/sort_deprecated.go | 10 - .../registry/client/auth/challenge/addr.go | 27 - .../client/auth/challenge/authchallenge.go | 237 - .../docker/docker-credential-helpers/LICENSE | 20 - .../client/client.go | 121 - .../client/command.go | 54 - .../credentials/credentials.go | 209 - .../credentials/error.go | 121 - .../credentials/helper.go | 14 - .../credentials/version.go | 16 - vendor/github.com/docker/docker/AUTHORS | 2390 -- vendor/github.com/docker/docker/LICENSE | 191 - vendor/github.com/docker/docker/NOTICE | 19 - vendor/github.com/docker/docker/api/README.md | 42 - vendor/github.com/docker/docker/api/common.go | 11 - .../docker/docker/api/common_unix.go | 7 - .../docker/docker/api/common_windows.go | 8 - .../docker/docker/api/swagger-gen.yaml | 12 - .../github.com/docker/docker/api/swagger.yaml | 12145 ------ .../docker/docker/api/types/auth.go | 7 - .../docker/docker/api/types/blkiodev/blkio.go | 23 - .../docker/docker/api/types/client.go | 444 - .../docker/docker/api/types/configs.go | 67 - .../container/change_response_deprecated.go | 6 - .../docker/api/types/container/change_type.go | 15 - .../api/types/container/change_types.go | 23 - .../docker/api/types/container/config.go | 96 - .../api/types/container/container_top.go | 22 - .../api/types/container/container_update.go | 16 - .../api/types/container/create_response.go | 19 - .../api/types/container/filesystem_change.go | 19 - .../docker/api/types/container/hostconfig.go | 456 - .../api/types/container/hostconfig_unix.go | 42 - .../api/types/container/hostconfig_windows.go | 40 - .../api/types/container/wait_exit_error.go | 12 - .../api/types/container/wait_response.go | 18 - .../api/types/container/waitcondition.go | 22 - .../docker/docker/api/types/error_response.go | 13 - .../docker/api/types/error_response_ext.go | 6 - .../docker/docker/api/types/events/events.go | 47 - .../docker/docker/api/types/filters/errors.go | 37 - .../docker/docker/api/types/filters/parse.go | 346 - .../docker/api/types/graph_driver_data.go | 23 - .../docker/docker/api/types/id_response.go | 13 - .../docker/api/types/image/image_history.go | 36 - .../docker/docker/api/types/image/opts.go | 9 - .../api/types/image_delete_response_item.go | 15 - .../docker/docker/api/types/image_summary.go | 94 - .../docker/docker/api/types/mount/mount.go | 140 - .../docker/api/types/network/network.go | 126 - .../docker/docker/api/types/plugin.go | 203 - .../docker/docker/api/types/plugin_device.go | 25 - .../docker/docker/api/types/plugin_env.go | 25 - .../docker/api/types/plugin_interface_type.go | 21 - .../docker/docker/api/types/plugin_mount.go | 37 - .../docker/api/types/plugin_responses.go | 71 - .../docker/docker/api/types/port.go | 23 - .../docker/api/types/registry/authconfig.go | 99 - .../docker/api/types/registry/authenticate.go | 21 - .../docker/api/types/registry/registry.go | 120 - .../api/types/service_update_response.go | 12 - .../docker/docker/api/types/stats.go | 181 - .../docker/api/types/strslice/strslice.go | 30 - .../docker/docker/api/types/swarm/common.go | 48 - .../docker/docker/api/types/swarm/config.go | 40 - .../docker/api/types/swarm/container.go | 80 - .../docker/docker/api/types/swarm/network.go | 121 - .../docker/docker/api/types/swarm/node.go | 139 - .../docker/docker/api/types/swarm/runtime.go | 27 - .../docker/api/types/swarm/runtime/gen.go | 3 - .../api/types/swarm/runtime/plugin.pb.go | 754 - .../api/types/swarm/runtime/plugin.proto | 21 - .../docker/docker/api/types/swarm/secret.go | 36 - .../docker/docker/api/types/swarm/service.go | 202 - .../docker/docker/api/types/swarm/swarm.go | 237 - .../docker/docker/api/types/swarm/task.go | 225 - .../docker/docker/api/types/time/timestamp.go | 131 - .../docker/docker/api/types/types.go | 811 - .../docker/api/types/versions/README.md | 14 - .../docker/api/types/versions/compare.go | 65 - .../docker/api/types/volume/cluster_volume.go | 420 - .../docker/api/types/volume/create_options.go | 29 - .../docker/api/types/volume/list_response.go | 18 - .../docker/docker/api/types/volume/options.go | 8 - .../docker/docker/api/types/volume/volume.go | 75 - .../docker/api/types/volume/volume_update.go | 7 - .../github.com/docker/docker/client/README.md | 35 - .../docker/docker/client/build_cancel.go | 16 - .../docker/docker/client/build_prune.go | 45 - .../docker/docker/client/checkpoint_create.go | 14 - .../docker/docker/client/checkpoint_delete.go | 20 - .../docker/docker/client/checkpoint_list.go | 28 - .../github.com/docker/docker/client/client.go | 354 - .../docker/docker/client/client_deprecated.go | 27 - .../docker/docker/client/client_unix.go | 8 - .../docker/docker/client/client_windows.go | 5 - .../docker/docker/client/config_create.go | 25 - .../docker/docker/client/config_inspect.go | 36 - .../docker/docker/client/config_list.go | 38 - .../docker/docker/client/config_remove.go | 13 - .../docker/docker/client/config_update.go | 20 - .../docker/docker/client/container_attach.go | 59 - .../docker/docker/client/container_commit.go | 55 - .../docker/docker/client/container_copy.go | 93 - .../docker/docker/client/container_create.go | 83 - .../docker/docker/client/container_diff.go | 23 - .../docker/docker/client/container_exec.go | 66 - .../docker/docker/client/container_export.go | 19 - .../docker/docker/client/container_inspect.go | 53 - .../docker/docker/client/container_kill.go | 18 - .../docker/docker/client/container_list.go | 57 - .../docker/docker/client/container_logs.go | 80 - .../docker/docker/client/container_pause.go | 10 - .../docker/docker/client/container_prune.go | 36 - .../docker/docker/client/container_remove.go | 27 - .../docker/docker/client/container_rename.go | 15 - .../docker/docker/client/container_resize.go | 29 - .../docker/docker/client/container_restart.go | 26 - .../docker/docker/client/container_start.go | 23 - .../docker/docker/client/container_stats.go | 42 - .../docker/docker/client/container_stop.go | 30 - .../docker/docker/client/container_top.go | 28 - .../docker/docker/client/container_unpause.go | 10 - .../docker/docker/client/container_update.go | 21 - .../docker/docker/client/container_wait.go | 104 - .../docker/docker/client/disk_usage.go | 33 - .../docker/client/distribution_inspect.go | 38 - .../docker/docker/client/envvars.go | 90 - .../github.com/docker/docker/client/errors.go | 68 - .../github.com/docker/docker/client/events.go | 101 - .../github.com/docker/docker/client/hijack.go | 148 - .../docker/docker/client/image_build.go | 146 - .../docker/docker/client/image_create.go | 38 - .../docker/docker/client/image_history.go | 22 - .../docker/docker/client/image_import.go | 40 - .../docker/docker/client/image_inspect.go | 32 - .../docker/docker/client/image_list.go | 49 - .../docker/docker/client/image_load.go | 29 - .../docker/docker/client/image_prune.go | 36 - .../docker/docker/client/image_pull.go | 64 - .../docker/docker/client/image_push.go | 55 - .../docker/docker/client/image_remove.go | 31 - .../docker/docker/client/image_save.go | 21 - .../docker/docker/client/image_search.go | 53 - .../docker/docker/client/image_tag.go | 37 - .../github.com/docker/docker/client/info.go | 26 - .../docker/docker/client/interface.go | 201 - .../docker/client/interface_experimental.go | 18 - .../docker/docker/client/interface_stable.go | 10 - .../github.com/docker/docker/client/login.go | 24 - .../docker/docker/client/network_connect.go | 19 - .../docker/docker/client/network_create.go | 25 - .../docker/client/network_disconnect.go | 15 - .../docker/docker/client/network_inspect.go | 49 - .../docker/docker/client/network_list.go | 32 - .../docker/docker/client/network_prune.go | 36 - .../docker/docker/client/network_remove.go | 10 - .../docker/docker/client/node_inspect.go | 32 - .../docker/docker/client/node_list.go | 36 - .../docker/docker/client/node_remove.go | 20 - .../docker/docker/client/node_update.go | 17 - .../docker/docker/client/options.go | 210 - .../github.com/docker/docker/client/ping.go | 75 - .../docker/docker/client/plugin_create.go | 23 - .../docker/docker/client/plugin_disable.go | 19 - .../docker/docker/client/plugin_enable.go | 19 - .../docker/docker/client/plugin_inspect.go | 31 - .../docker/docker/client/plugin_install.go | 114 - .../docker/docker/client/plugin_list.go | 33 - .../docker/docker/client/plugin_push.go | 18 - .../docker/docker/client/plugin_remove.go | 20 - .../docker/docker/client/plugin_set.go | 12 - .../docker/docker/client/plugin_upgrade.go | 40 - .../docker/docker/client/request.go | 275 - .../docker/docker/client/secret_create.go | 25 - .../docker/docker/client/secret_inspect.go | 36 - .../docker/docker/client/secret_list.go | 38 - .../docker/docker/client/secret_remove.go | 13 - .../docker/docker/client/secret_update.go | 20 - .../docker/docker/client/service_create.go | 179 - .../docker/docker/client/service_inspect.go | 37 - .../docker/docker/client/service_list.go | 39 - .../docker/docker/client/service_logs.go | 52 - .../docker/docker/client/service_remove.go | 10 - .../docker/docker/client/service_update.go | 75 - .../docker/client/swarm_get_unlock_key.go | 21 - .../docker/docker/client/swarm_init.go | 21 - .../docker/docker/client/swarm_inspect.go | 21 - .../docker/docker/client/swarm_join.go | 14 - .../docker/docker/client/swarm_leave.go | 17 - .../docker/docker/client/swarm_unlock.go | 14 - .../docker/docker/client/swarm_update.go | 21 - .../docker/docker/client/task_inspect.go | 32 - .../docker/docker/client/task_list.go | 35 - .../docker/docker/client/task_logs.go | 51 - .../docker/docker/client/transport.go | 17 - .../github.com/docker/docker/client/utils.go | 34 - .../docker/docker/client/version.go | 21 - .../docker/docker/client/volume_create.go | 20 - .../docker/docker/client/volume_inspect.go | 38 - .../docker/docker/client/volume_list.go | 33 - .../docker/docker/client/volume_prune.go | 36 - .../docker/docker/client/volume_remove.go | 21 - .../docker/docker/client/volume_update.go | 24 - .../github.com/docker/docker/errdefs/defs.go | 69 - .../github.com/docker/docker/errdefs/doc.go | 8 - .../docker/docker/errdefs/helpers.go | 279 - .../docker/docker/errdefs/http_helpers.go | 46 - vendor/github.com/docker/docker/errdefs/is.go | 107 - .../docker/pkg/homedir/homedir_linux.go | 105 - .../docker/pkg/homedir/homedir_others.go | 33 - .../docker/docker/pkg/homedir/homedir_unix.go | 39 - .../docker/pkg/homedir/homedir_windows.go | 24 - .../docker/pkg/jsonmessage/jsonmessage.go | 307 - .../docker/docker/pkg/stringid/stringid.go | 73 - .../github.com/docker/go-connections/LICENSE | 191 - .../docker/go-connections/nat/nat.go | 242 - .../docker/go-connections/nat/parse.go | 57 - .../docker/go-connections/nat/sort.go | 96 - .../docker/go-connections/sockets/README.md | 0 .../go-connections/sockets/inmem_socket.go | 81 - .../docker/go-connections/sockets/proxy.go | 51 - .../docker/go-connections/sockets/sockets.go | 38 - .../go-connections/sockets/sockets_unix.go | 35 - .../go-connections/sockets/sockets_windows.go | 27 - .../go-connections/sockets/tcp_socket.go | 22 - .../go-connections/sockets/unix_socket.go | 32 - .../tlsconfig/certpool_other.go | 13 - .../docker/go-connections/tlsconfig/config.go | 254 - .../tlsconfig/config_client_ciphers.go | 17 - .../tlsconfig/config_legacy_client_ciphers.go | 15 - .../docker/go-units/CONTRIBUTING.md | 67 - vendor/github.com/docker/go-units/LICENSE | 191 - vendor/github.com/docker/go-units/MAINTAINERS | 46 - vendor/github.com/docker/go-units/README.md | 16 - vendor/github.com/docker/go-units/circle.yml | 11 - vendor/github.com/docker/go-units/duration.go | 35 - vendor/github.com/docker/go-units/size.go | 154 - vendor/github.com/docker/go-units/ulimit.go | 123 - vendor/github.com/emirpasic/gods/LICENSE | 41 - .../emirpasic/gods/containers/containers.go | 36 - .../emirpasic/gods/containers/enumerable.go | 57 - .../emirpasic/gods/containers/iterator.go | 133 - .../gods/containers/serialization.go | 21 - .../gods/lists/arraylist/arraylist.go | 227 - .../gods/lists/arraylist/enumerable.go | 78 - .../gods/lists/arraylist/iterator.go | 110 - .../gods/lists/arraylist/serialization.go | 38 - .../github.com/emirpasic/gods/lists/lists.go | 34 - .../gods/trees/binaryheap/binaryheap.go | 166 - .../gods/trees/binaryheap/iterator.go | 143 - .../gods/trees/binaryheap/serialization.go | 33 - .../github.com/emirpasic/gods/trees/trees.go | 22 - .../emirpasic/gods/utils/comparator.go | 251 - .../github.com/emirpasic/gods/utils/sort.go | 29 - .../github.com/emirpasic/gods/utils/utils.go | 47 - .../envoyproxy/protoc-gen-validate/LICENSE | 202 - .../protoc-gen-validate/validate/BUILD | 74 - .../protoc-gen-validate/validate/validate.h | 183 - .../validate/validate.pb.go | 4106 -- .../validate/validate.proto | 862 - vendor/github.com/esimonov/ifshort/LICENSE | 21 - .../esimonov/ifshort/pkg/analyzer/analyzer.go | 280 - .../ifshort/pkg/analyzer/occurrences.go | 268 - vendor/github.com/ettle/strcase/.gitignore | 18 - vendor/github.com/ettle/strcase/.golangci.yml | 82 - vendor/github.com/ettle/strcase/.readme.tmpl | 80 - vendor/github.com/ettle/strcase/LICENSE | 21 - vendor/github.com/ettle/strcase/Makefile | 19 - vendor/github.com/ettle/strcase/README.md | 553 - vendor/github.com/ettle/strcase/assert.go | 24 - vendor/github.com/ettle/strcase/caser.go | 87 - vendor/github.com/ettle/strcase/convert.go | 306 - vendor/github.com/ettle/strcase/doc.go | 150 - vendor/github.com/ettle/strcase/initialism.go | 43 - vendor/github.com/ettle/strcase/split.go | 165 - vendor/github.com/ettle/strcase/strcase.go | 81 - vendor/github.com/ettle/strcase/unicode.go | 48 - .../evilmartians/lefthook/.gitignore | 22 - .../evilmartians/lefthook/.golangci.yml | 57 - .../evilmartians/lefthook/.goreleaser.yml | 88 - .../evilmartians/lefthook/CHANGELOG.md | 403 - .../evilmartians/lefthook/CONTRIBUTING.md | 14 - .../github.com/evilmartians/lefthook/LICENSE | 22 - .../github.com/evilmartians/lefthook/Makefile | 34 - .../evilmartians/lefthook/README.md | 228 - .../evilmartians/lefthook/SECURITY.md | 16 - .../evilmartians/lefthook/cmd/add-doc.txt | 11 - .../evilmartians/lefthook/cmd/add.go | 37 - .../evilmartians/lefthook/cmd/dump.go | 31 - .../evilmartians/lefthook/cmd/install.go | 30 - .../evilmartians/lefthook/cmd/lefthook.go | 16 - .../evilmartians/lefthook/cmd/root.go | 58 - .../evilmartians/lefthook/cmd/run.go | 30 - .../evilmartians/lefthook/cmd/uninstall.go | 36 - .../evilmartians/lefthook/cmd/version.go | 28 - .../internal/config/available_hooks.go | 58 - .../lefthook/internal/config/command.go | 116 - .../lefthook/internal/config/config.go | 95 - .../lefthook/internal/config/files.go | 17 - .../lefthook/internal/config/hook.go | 86 - .../lefthook/internal/config/load.go | 231 - .../lefthook/internal/config/remote.go | 15 - .../lefthook/internal/config/script.go | 136 - .../lefthook/internal/config/skip.go | 50 - .../lefthook/internal/git/exec.go | 81 - .../evilmartians/lefthook/internal/git/lfs.go | 35 - .../lefthook/internal/git/remote.go | 110 - .../lefthook/internal/git/repository.go | 328 - .../lefthook/internal/git/state.go | 83 - .../lefthook/internal/lefthook/add.go | 79 - .../lefthook/internal/lefthook/dump.go | 30 - .../lefthook/internal/lefthook/install.go | 287 - .../lefthook/internal/lefthook/lefthook.go | 121 - .../lefthook/internal/lefthook/run.go | 198 - .../internal/lefthook/runner/execute_unix.go | 82 - .../lefthook/runner/execute_windows.go | 59 - .../internal/lefthook/runner/executor.go | 20 - .../internal/lefthook/runner/filters.go | 52 - .../lefthook/runner/prepare_command.go | 187 - .../lefthook/runner/prepare_script.go | 45 - .../internal/lefthook/runner/result.go | 20 - .../internal/lefthook/runner/runner.go | 501 - .../lefthook/internal/lefthook/uninstall.go | 101 - .../evilmartians/lefthook/internal/log/log.go | 357 - .../lefthook/internal/log/skip_settings.go | 71 - .../lefthook/internal/templates/config.tmpl | 35 - .../lefthook/internal/templates/hook.tmpl | 54 - .../lefthook/internal/templates/templates.go | 55 - .../lefthook/internal/version/version.go | 88 - .../github.com/evilmartians/lefthook/logo.svg | 1 - .../evilmartians/lefthook/logo_sign.svg | 1 - .../github.com/evilmartians/lefthook/main.go | 11 - vendor/github.com/fatih/color/LICENSE.md | 20 - vendor/github.com/fatih/color/README.md | 176 - vendor/github.com/fatih/color/color.go | 650 - .../github.com/fatih/color/color_windows.go | 19 - vendor/github.com/fatih/color/doc.go | 134 - vendor/github.com/fatih/structtag/LICENSE | 60 - vendor/github.com/fatih/structtag/README.md | 73 - vendor/github.com/fatih/structtag/tags.go | 315 - .../fgprof/BenchmarkProfilerGoroutines.txt | 25 - vendor/github.com/felixge/fgprof/LICENSE.txt | 8 - vendor/github.com/felixge/fgprof/README.md | 204 - vendor/github.com/felixge/fgprof/fgprof.go | 307 - vendor/github.com/felixge/fgprof/handler.go | 35 - .../github.com/felixge/httpsnoop/.gitignore | 0 .../github.com/felixge/httpsnoop/LICENSE.txt | 19 - vendor/github.com/felixge/httpsnoop/Makefile | 10 - vendor/github.com/felixge/httpsnoop/README.md | 95 - .../felixge/httpsnoop/capture_metrics.go | 86 - vendor/github.com/felixge/httpsnoop/docs.go | 10 - .../httpsnoop/wrap_generated_gteq_1.8.go | 436 - .../httpsnoop/wrap_generated_lt_1.8.go | 278 - .../firefart/nonamedreturns/LICENSE | 674 - .../nonamedreturns/analyzer/analyzer.go | 134 - vendor/github.com/fzipp/gocyclo/CHANGELOG.md | 58 - vendor/github.com/fzipp/gocyclo/CONTRIBUTORS | 7 - vendor/github.com/fzipp/gocyclo/LICENSE | 27 - vendor/github.com/fzipp/gocyclo/README.md | 106 - vendor/github.com/fzipp/gocyclo/analyze.go | 154 - vendor/github.com/fzipp/gocyclo/complexity.go | 48 - vendor/github.com/fzipp/gocyclo/directives.go | 39 - vendor/github.com/fzipp/gocyclo/recv.go | 26 - .../github.com/fzipp/gocyclo/recv_pre118.go | 24 - vendor/github.com/fzipp/gocyclo/stats.go | 73 - .../ghostiam/protogetter/.goreleaser.yaml | 24 - .../github.com/ghostiam/protogetter/LICENSE | 21 - .../github.com/ghostiam/protogetter/Makefile | 9 - .../github.com/ghostiam/protogetter/README.md | 73 - .../ghostiam/protogetter/posfilter.go | 65 - .../ghostiam/protogetter/processor.go | 353 - .../ghostiam/protogetter/protogetter.go | 279 - vendor/github.com/go-chi/chi/v5/.gitignore | 3 - vendor/github.com/go-chi/chi/v5/CHANGELOG.md | 320 - .../github.com/go-chi/chi/v5/CONTRIBUTING.md | 31 - vendor/github.com/go-chi/chi/v5/LICENSE | 20 - vendor/github.com/go-chi/chi/v5/Makefile | 22 - vendor/github.com/go-chi/chi/v5/README.md | 500 - vendor/github.com/go-chi/chi/v5/chain.go | 49 - vendor/github.com/go-chi/chi/v5/chi.go | 134 - vendor/github.com/go-chi/chi/v5/context.go | 159 - vendor/github.com/go-chi/chi/v5/mux.go | 487 - vendor/github.com/go-chi/chi/v5/tree.go | 866 - vendor/github.com/go-critic/go-critic/LICENSE | 21 - .../checkers/appendAssign_checker.go | 103 - .../checkers/appendCombine_checker.go | 103 - .../go-critic/checkers/badCond_checker.go | 161 - .../go-critic/checkers/badRegexp_checker.go | 446 - .../checkers/boolExprSimplify_checker.go | 346 - .../checkers/builtinShadowDecl_checker.go | 63 - .../checkers/builtinShadow_checker.go | 36 - .../go-critic/checkers/captLocal_checker.go | 49 - .../go-critic/checkers/caseOrder_checker.go | 88 - .../go-critic/go-critic/checkers/checkers.go | 19 - .../checkers/codegenComment_checker.go | 61 - .../checkers/commentFormatting_checker.go | 119 - .../checkers/commentedOutCode_checker.go | 167 - .../checkers/commentedOutImport_checker.go | 76 - .../checkers/defaultCaseOrder_checker.go | 65 - .../go-critic/checkers/deferInLoop_checker.go | 70 - .../checkers/deprecatedComment_checker.go | 156 - .../go-critic/checkers/docStub_checker.go | 95 - .../checkers/dupBranchBody_checker.go | 59 - .../go-critic/checkers/dupCase_checker.go | 70 - .../go-critic/checkers/dupImports_checker.go | 63 - .../go-critic/checkers/dupSubExpr_checker.go | 103 - .../go-critic/checkers/elseif_checker.go | 72 - .../go-critic/checkers/embedded_rules.go | 108 - .../checkers/emptyFallthrough_checker.go | 70 - .../go-critic/checkers/evalOrder_checker.go | 88 - .../checkers/exitAfterDefer_checker.go | 85 - .../checkers/filepathJoin_checker.go | 51 - .../go-critic/checkers/flagName_checker.go | 89 - .../go-critic/checkers/hexLiteral_checker.go | 61 - .../go-critic/checkers/hugeParam_checker.go | 83 - .../go-critic/checkers/ifElseChain_checker.go | 110 - .../checkers/importShadow_checker.go | 47 - .../go-critic/checkers/initClause_checker.go | 57 - .../internal/astwalk/comment_walker.go | 41 - .../internal/astwalk/doc_comment_walker.go | 48 - .../checkers/internal/astwalk/expr_walker.go | 31 - .../internal/astwalk/func_decl_walker.go | 23 - .../internal/astwalk/local_comment_walker.go | 32 - .../internal/astwalk/local_def_visitor.go | 49 - .../internal/astwalk/local_def_walker.go | 118 - .../internal/astwalk/local_expr_walker.go | 29 - .../internal/astwalk/stmt_list_walker.go | 33 - .../checkers/internal/astwalk/stmt_walker.go | 29 - .../internal/astwalk/type_expr_walker.go | 119 - .../checkers/internal/astwalk/visitor.go | 77 - .../checkers/internal/astwalk/walk_handler.go | 34 - .../checkers/internal/astwalk/walker.go | 57 - .../checkers/internal/lintutil/astfind.go | 41 - .../checkers/internal/lintutil/astflow.go | 86 - .../checkers/internal/lintutil/astset.go | 44 - .../checkers/internal/lintutil/zero_value.go | 94 - .../go-critic/checkers/mapKey_checker.go | 125 - .../checkers/methodExprCall_checker.go | 58 - .../checkers/nestingReduce_checker.go | 73 - .../go-critic/checkers/newDeref_checker.go | 51 - .../checkers/nilValReturn_checker.go | 72 - .../checkers/octalLiteral_checker.go | 51 - .../checkers/paramTypeCombine_checker.go | 97 - .../checkers/ptrToRefParam_checker.go | 70 - .../checkers/rangeExprCopy_checker.go | 80 - .../checkers/rangeValCopy_checker.go | 76 - .../checkers/regexpPattern_checker.go | 68 - .../checkers/regexpSimplify_checker.go | 512 - .../go-critic/checkers/ruleguard_checker.go | 322 - .../go-critic/checkers/rulesdata/rulesdata.go | 2586 -- .../checkers/singleCaseSwitch_checker.go | 85 - .../checkers/sloppyReassign_checker.go | 81 - .../checkers/sloppyTypeAssert_checker.go | 56 - .../go-critic/checkers/sortSlice_checker.go | 136 - .../go-critic/checkers/sqlQuery_checker.go | 168 - .../todoCommentWithoutDetail_checker.go | 50 - .../checkers/tooManyResults_checker.go | 54 - .../go-critic/checkers/truncateCmp_checker.go | 124 - .../checkers/typeAssertChain_checker.go | 133 - .../checkers/typeDefFirst_checker.go | 92 - .../checkers/typeSwitchVar_checker.go | 98 - .../go-critic/checkers/typeUnparen_checker.go | 96 - .../go-critic/checkers/underef_checker.go | 128 - .../go-critic/checkers/unlabelStmt_checker.go | 181 - .../go-critic/checkers/unlambda_checker.go | 118 - .../checkers/unnamedResult_checker.go | 103 - .../checkers/unnecessaryBlock_checker.go | 78 - .../checkers/unnecessaryDefer_checker.go | 112 - .../go-critic/go-critic/checkers/utils.go | 309 - .../go-critic/checkers/weakCond_checker.go | 78 - .../go-critic/checkers/whyNoLint_checker.go | 50 - .../go-critic/go-critic/linter/go_version.go | 52 - .../go-critic/go-critic/linter/helpers.go | 136 - .../go-critic/go-critic/linter/linter.go | 401 - vendor/github.com/go-git/gcfg/.gitignore | 1 - vendor/github.com/go-git/gcfg/LICENSE | 28 - vendor/github.com/go-git/gcfg/Makefile | 17 - vendor/github.com/go-git/gcfg/README | 4 - vendor/github.com/go-git/gcfg/doc.go | 145 - vendor/github.com/go-git/gcfg/errors.go | 41 - vendor/github.com/go-git/gcfg/read.go | 273 - .../github.com/go-git/gcfg/scanner/errors.go | 121 - .../github.com/go-git/gcfg/scanner/scanner.go | 334 - vendor/github.com/go-git/gcfg/set.go | 334 - .../github.com/go-git/gcfg/token/position.go | 435 - .../github.com/go-git/gcfg/token/serialize.go | 56 - vendor/github.com/go-git/gcfg/token/token.go | 83 - vendor/github.com/go-git/gcfg/types/bool.go | 23 - vendor/github.com/go-git/gcfg/types/doc.go | 4 - vendor/github.com/go-git/gcfg/types/enum.go | 44 - vendor/github.com/go-git/gcfg/types/int.go | 86 - vendor/github.com/go-git/gcfg/types/scan.go | 23 - .../github.com/go-git/go-billy/v5/.gitignore | 4 - vendor/github.com/go-git/go-billy/v5/LICENSE | 201 - vendor/github.com/go-git/go-billy/v5/Makefile | 11 - .../github.com/go-git/go-billy/v5/README.md | 73 - vendor/github.com/go-git/go-billy/v5/fs.go | 202 - .../go-billy/v5/helper/chroot/chroot.go | 242 - .../go-billy/v5/helper/polyfill/polyfill.go | 105 - .../go-git/go-billy/v5/memfs/memory.go | 410 - .../go-git/go-billy/v5/memfs/storage.go | 238 - .../github.com/go-git/go-billy/v5/osfs/os.go | 127 - .../go-git/go-billy/v5/osfs/os_bound.go | 261 - .../go-git/go-billy/v5/osfs/os_chroot.go | 112 - .../go-git/go-billy/v5/osfs/os_js.go | 25 - .../go-git/go-billy/v5/osfs/os_options.go | 3 - .../go-git/go-billy/v5/osfs/os_plan9.go | 91 - .../go-git/go-billy/v5/osfs/os_posix.go | 38 - .../go-git/go-billy/v5/osfs/os_windows.go | 58 - .../go-git/go-billy/v5/util/glob.go | 111 - .../go-git/go-billy/v5/util/util.go | 282 - .../go-git/go-billy/v5/util/walk.go | 72 - vendor/github.com/go-git/go-git/v5/.gitignore | 7 - .../go-git/go-git/v5/CODE_OF_CONDUCT.md | 74 - .../go-git/go-git/v5/COMPATIBILITY.md | 233 - .../go-git/go-git/v5/CONTRIBUTING.md | 46 - .../github.com/go-git/go-git/v5/EXTENDING.md | 78 - vendor/github.com/go-git/go-git/v5/LICENSE | 201 - vendor/github.com/go-git/go-git/v5/Makefile | 53 - vendor/github.com/go-git/go-git/v5/README.md | 131 - .../github.com/go-git/go-git/v5/SECURITY.md | 38 - vendor/github.com/go-git/go-git/v5/blame.go | 590 - vendor/github.com/go-git/go-git/v5/common.go | 20 - .../go-git/go-git/v5/config/branch.go | 123 - .../go-git/go-git/v5/config/config.go | 696 - .../go-git/go-git/v5/config/modules.go | 139 - .../go-git/go-git/v5/config/refspec.go | 155 - .../github.com/go-git/go-git/v5/config/url.go | 81 - vendor/github.com/go-git/go-git/v5/doc.go | 10 - .../go-git/v5/internal/path_util/path_util.go | 29 - .../go-git/v5/internal/revision/parser.go | 626 - .../go-git/v5/internal/revision/scanner.go | 117 - .../go-git/v5/internal/revision/token.go | 28 - .../go-git/go-git/v5/internal/url/url.go | 39 - .../go-git/go-git/v5/object_walker.go | 104 - vendor/github.com/go-git/go-git/v5/options.go | 756 - .../github.com/go-git/go-git/v5/oss-fuzz.sh | 35 - .../go-git/v5/plumbing/cache/buffer_lru.go | 98 - .../go-git/go-git/v5/plumbing/cache/common.go | 39 - .../go-git/v5/plumbing/cache/object_lru.go | 101 - .../go-git/go-git/v5/plumbing/color/color.go | 38 - .../go-git/go-git/v5/plumbing/error.go | 35 - .../go-git/v5/plumbing/filemode/filemode.go | 188 - .../v5/plumbing/format/config/common.go | 109 - .../v5/plumbing/format/config/decoder.go | 37 - .../go-git/v5/plumbing/format/config/doc.go | 122 - .../v5/plumbing/format/config/encoder.go | 82 - .../v5/plumbing/format/config/format.go | 53 - .../v5/plumbing/format/config/option.go | 127 - .../v5/plumbing/format/config/section.go | 181 - .../v5/plumbing/format/diff/colorconfig.go | 97 - .../go-git/v5/plumbing/format/diff/patch.go | 58 - .../plumbing/format/diff/unified_encoder.go | 395 - .../v5/plumbing/format/gitignore/dir.go | 144 - .../v5/plumbing/format/gitignore/doc.go | 70 - .../v5/plumbing/format/gitignore/matcher.go | 30 - .../v5/plumbing/format/gitignore/pattern.go | 155 - .../v5/plumbing/format/idxfile/decoder.go | 178 - .../go-git/v5/plumbing/format/idxfile/doc.go | 128 - .../v5/plumbing/format/idxfile/encoder.go | 141 - .../v5/plumbing/format/idxfile/idxfile.go | 347 - .../v5/plumbing/format/idxfile/writer.go | 193 - .../v5/plumbing/format/index/decoder.go | 478 - .../go-git/v5/plumbing/format/index/doc.go | 360 - .../v5/plumbing/format/index/encoder.go | 165 - .../go-git/v5/plumbing/format/index/index.go | 231 - .../go-git/v5/plumbing/format/index/match.go | 186 - .../go-git/v5/plumbing/format/objfile/doc.go | 2 - .../v5/plumbing/format/objfile/reader.go | 117 - .../v5/plumbing/format/objfile/writer.go | 112 - .../v5/plumbing/format/packfile/common.go | 60 - .../plumbing/format/packfile/delta_index.go | 297 - .../format/packfile/delta_selector.go | 369 - .../v5/plumbing/format/packfile/diff_delta.go | 204 - .../go-git/v5/plumbing/format/packfile/doc.go | 39 - .../v5/plumbing/format/packfile/encoder.go | 221 - .../v5/plumbing/format/packfile/error.go | 30 - .../v5/plumbing/format/packfile/fsobject.go | 119 - .../plumbing/format/packfile/object_pack.go | 164 - .../v5/plumbing/format/packfile/packfile.go | 641 - .../v5/plumbing/format/packfile/parser.go | 611 - .../plumbing/format/packfile/patch_delta.go | 526 - .../v5/plumbing/format/packfile/scanner.go | 474 - .../v5/plumbing/format/pktline/encoder.go | 126 - .../v5/plumbing/format/pktline/error.go | 51 - .../v5/plumbing/format/pktline/scanner.go | 146 - .../go-git/go-git/v5/plumbing/hash.go | 84 - .../go-git/go-git/v5/plumbing/hash/hash.go | 60 - .../go-git/v5/plumbing/hash/hash_sha1.go | 15 - .../go-git/v5/plumbing/hash/hash_sha256.go | 15 - .../go-git/go-git/v5/plumbing/memory.go | 72 - .../go-git/go-git/v5/plumbing/object.go | 111 - .../go-git/go-git/v5/plumbing/object/blob.go | 144 - .../go-git/v5/plumbing/object/change.go | 159 - .../v5/plumbing/object/change_adaptor.go | 61 - .../go-git/v5/plumbing/object/commit.go | 507 - .../v5/plumbing/object/commit_walker.go | 327 - .../v5/plumbing/object/commit_walker_bfs.go | 100 - .../object/commit_walker_bfs_filtered.go | 175 - .../v5/plumbing/object/commit_walker_ctime.go | 103 - .../v5/plumbing/object/commit_walker_limit.go | 65 - .../v5/plumbing/object/commit_walker_path.go | 160 - .../go-git/v5/plumbing/object/difftree.go | 98 - .../go-git/go-git/v5/plumbing/object/file.go | 137 - .../go-git/v5/plumbing/object/merge_base.go | 210 - .../go-git/v5/plumbing/object/object.go | 239 - .../go-git/go-git/v5/plumbing/object/patch.go | 350 - .../go-git/v5/plumbing/object/rename.go | 816 - .../go-git/v5/plumbing/object/signature.go | 101 - .../go-git/go-git/v5/plumbing/object/tag.go | 330 - .../go-git/go-git/v5/plumbing/object/tree.go | 525 - .../go-git/v5/plumbing/object/treenoder.go | 140 - .../v5/plumbing/protocol/packp/advrefs.go | 211 - .../plumbing/protocol/packp/advrefs_decode.go | 289 - .../plumbing/protocol/packp/advrefs_encode.go | 176 - .../protocol/packp/capability/capability.go | 272 - .../protocol/packp/capability/list.go | 195 - .../v5/plumbing/protocol/packp/common.go | 74 - .../go-git/v5/plumbing/protocol/packp/doc.go | 724 - .../v5/plumbing/protocol/packp/gitproto.go | 120 - .../plumbing/protocol/packp/report_status.go | 165 - .../v5/plumbing/protocol/packp/shallowupd.go | 92 - .../protocol/packp/sideband/common.go | 33 - .../plumbing/protocol/packp/sideband/demux.go | 148 - .../plumbing/protocol/packp/sideband/doc.go | 31 - .../plumbing/protocol/packp/sideband/muxer.go | 65 - .../v5/plumbing/protocol/packp/srvresp.go | 141 - .../v5/plumbing/protocol/packp/ulreq.go | 168 - .../plumbing/protocol/packp/ulreq_decode.go | 257 - .../plumbing/protocol/packp/ulreq_encode.go | 145 - .../v5/plumbing/protocol/packp/updreq.go | 128 - .../plumbing/protocol/packp/updreq_decode.go | 249 - .../plumbing/protocol/packp/updreq_encode.go | 89 - .../v5/plumbing/protocol/packp/uppackreq.go | 98 - .../v5/plumbing/protocol/packp/uppackresp.go | 108 - .../go-git/go-git/v5/plumbing/reference.go | 315 - .../go-git/go-git/v5/plumbing/revision.go | 11 - .../go-git/v5/plumbing/revlist/revlist.go | 230 - .../go-git/go-git/v5/plumbing/storer/doc.go | 2 - .../go-git/go-git/v5/plumbing/storer/index.go | 9 - .../go-git/v5/plumbing/storer/object.go | 289 - .../go-git/v5/plumbing/storer/reference.go | 240 - .../go-git/v5/plumbing/storer/shallow.go | 10 - .../go-git/v5/plumbing/storer/storer.go | 15 - .../v5/plumbing/transport/client/client.go | 51 - .../go-git/v5/plumbing/transport/common.go | 320 - .../v5/plumbing/transport/file/client.go | 156 - .../v5/plumbing/transport/file/server.go | 53 - .../v5/plumbing/transport/git/common.go | 108 - .../v5/plumbing/transport/http/common.go | 452 - .../plumbing/transport/http/receive_pack.go | 109 - .../v5/plumbing/transport/http/transport.go | 40 - .../v5/plumbing/transport/http/upload_pack.go | 126 - .../transport/internal/common/common.go | 492 - .../transport/internal/common/mocks.go | 46 - .../transport/internal/common/server.go | 73 - .../v5/plumbing/transport/server/loader.go | 64 - .../v5/plumbing/transport/server/server.go | 432 - .../v5/plumbing/transport/ssh/auth_method.go | 313 - .../v5/plumbing/transport/ssh/common.go | 274 - vendor/github.com/go-git/go-git/v5/prune.go | 66 - vendor/github.com/go-git/go-git/v5/remote.go | 1499 - .../github.com/go-git/go-git/v5/repository.go | 1849 - vendor/github.com/go-git/go-git/v5/status.go | 79 - .../go-git/v5/storage/filesystem/config.go | 48 - .../v5/storage/filesystem/deltaobject.go | 37 - .../v5/storage/filesystem/dotgit/dotgit.go | 1255 - .../dotgit/dotgit_rewrite_packed_refs.go | 81 - .../filesystem/dotgit/dotgit_setref.go | 90 - .../v5/storage/filesystem/dotgit/reader.go | 79 - .../dotgit/repository_filesystem.go | 111 - .../v5/storage/filesystem/dotgit/writers.go | 285 - .../go-git/v5/storage/filesystem/index.go | 54 - .../go-git/v5/storage/filesystem/module.go | 20 - .../go-git/v5/storage/filesystem/object.go | 892 - .../go-git/v5/storage/filesystem/reference.go | 44 - .../go-git/v5/storage/filesystem/shallow.go | 54 - .../go-git/v5/storage/filesystem/storage.go | 85 - .../go-git/v5/storage/memory/storage.go | 324 - .../go-git/go-git/v5/storage/storer.go | 30 - .../github.com/go-git/go-git/v5/submodule.go | 398 - .../go-git/go-git/v5/utils/binary/read.go | 180 - .../go-git/go-git/v5/utils/binary/write.go | 50 - .../go-git/go-git/v5/utils/diff/diff.go | 61 - .../go-git/go-git/v5/utils/ioutil/common.go | 210 - .../go-git/v5/utils/merkletrie/change.go | 149 - .../go-git/v5/utils/merkletrie/difftree.go | 453 - .../go-git/go-git/v5/utils/merkletrie/doc.go | 34 - .../go-git/v5/utils/merkletrie/doubleiter.go | 187 - .../v5/utils/merkletrie/filesystem/node.go | 203 - .../go-git/v5/utils/merkletrie/index/node.go | 95 - .../utils/merkletrie/internal/frame/frame.go | 91 - .../go-git/go-git/v5/utils/merkletrie/iter.go | 216 - .../go-git/v5/utils/merkletrie/noder/noder.go | 60 - .../go-git/v5/utils/merkletrie/noder/path.go | 98 - .../go-git/go-git/v5/utils/sync/bufio.go | 29 - .../go-git/go-git/v5/utils/sync/bytes.go | 51 - .../go-git/go-git/v5/utils/sync/zlib.go | 74 - .../go-git/go-git/v5/utils/trace/trace.go | 55 - .../github.com/go-git/go-git/v5/worktree.go | 1125 - .../go-git/go-git/v5/worktree_bsd.go | 26 - .../go-git/go-git/v5/worktree_commit.go | 266 - .../go-git/go-git/v5/worktree_js.go | 26 - .../go-git/go-git/v5/worktree_linux.go | 26 - .../go-git/go-git/v5/worktree_plan9.go | 31 - .../go-git/go-git/v5/worktree_status.go | 706 - .../go-git/go-git/v5/worktree_unix_other.go | 26 - .../go-git/go-git/v5/worktree_windows.go | 35 - vendor/github.com/go-logr/logr/.golangci.yaml | 26 - vendor/github.com/go-logr/logr/CHANGELOG.md | 6 - .../github.com/go-logr/logr/CONTRIBUTING.md | 17 - vendor/github.com/go-logr/logr/LICENSE | 201 - vendor/github.com/go-logr/logr/README.md | 406 - vendor/github.com/go-logr/logr/SECURITY.md | 18 - vendor/github.com/go-logr/logr/context.go | 33 - .../github.com/go-logr/logr/context_noslog.go | 49 - .../github.com/go-logr/logr/context_slog.go | 83 - vendor/github.com/go-logr/logr/discard.go | 24 - vendor/github.com/go-logr/logr/funcr/funcr.go | 911 - .../github.com/go-logr/logr/funcr/slogsink.go | 105 - vendor/github.com/go-logr/logr/logr.go | 520 - vendor/github.com/go-logr/logr/sloghandler.go | 192 - vendor/github.com/go-logr/logr/slogr.go | 100 - vendor/github.com/go-logr/logr/slogsink.go | 120 - vendor/github.com/go-logr/stdr/LICENSE | 201 - vendor/github.com/go-logr/stdr/README.md | 6 - vendor/github.com/go-logr/stdr/stdr.go | 170 - .../go-openapi/analysis/.codecov.yml | 5 - .../go-openapi/analysis/.gitattributes | 2 - .../github.com/go-openapi/analysis/.gitignore | 5 - .../go-openapi/analysis/.golangci.yml | 56 - .../go-openapi/analysis/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/analysis/LICENSE | 202 - .../github.com/go-openapi/analysis/README.md | 31 - .../go-openapi/analysis/analyzer.go | 1064 - .../go-openapi/analysis/appveyor.yml | 32 - .../github.com/go-openapi/analysis/debug.go | 23 - vendor/github.com/go-openapi/analysis/doc.go | 43 - .../github.com/go-openapi/analysis/fixer.go | 79 - .../github.com/go-openapi/analysis/flatten.go | 802 - .../go-openapi/analysis/flatten_name.go | 293 - .../go-openapi/analysis/flatten_options.go | 78 - .../analysis/internal/debug/debug.go | 41 - .../internal/flatten/normalize/normalize.go | 87 - .../internal/flatten/operations/operations.go | 90 - .../internal/flatten/replace/replace.go | 434 - .../flatten/schutils/flatten_schema.go | 29 - .../analysis/internal/flatten/sortref/keys.go | 201 - .../internal/flatten/sortref/sort_ref.go | 141 - .../github.com/go-openapi/analysis/mixin.go | 515 - .../github.com/go-openapi/analysis/schema.go | 256 - .../go-openapi/errors/.gitattributes | 1 - .../github.com/go-openapi/errors/.gitignore | 2 - .../go-openapi/errors/.golangci.yml | 48 - .../go-openapi/errors/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/errors/LICENSE | 202 - vendor/github.com/go-openapi/errors/README.md | 11 - vendor/github.com/go-openapi/errors/api.go | 182 - vendor/github.com/go-openapi/errors/auth.go | 22 - vendor/github.com/go-openapi/errors/doc.go | 26 - .../github.com/go-openapi/errors/headers.go | 103 - .../go-openapi/errors/middleware.go | 50 - .../github.com/go-openapi/errors/parsing.go | 78 - vendor/github.com/go-openapi/errors/schema.go | 611 - .../github.com/go-openapi/inflect/.hgignore | 1 - vendor/github.com/go-openapi/inflect/LICENCE | 7 - vendor/github.com/go-openapi/inflect/README | 168 - .../github.com/go-openapi/inflect/inflect.go | 713 - .../go-openapi/jsonpointer/.editorconfig | 26 - .../go-openapi/jsonpointer/.gitignore | 1 - .../go-openapi/jsonpointer/CODE_OF_CONDUCT.md | 74 - .../github.com/go-openapi/jsonpointer/LICENSE | 202 - .../go-openapi/jsonpointer/README.md | 15 - .../go-openapi/jsonpointer/pointer.go | 511 - .../go-openapi/jsonreference/.gitignore | 1 - .../go-openapi/jsonreference/.golangci.yml | 50 - .../jsonreference/CODE_OF_CONDUCT.md | 74 - .../go-openapi/jsonreference/LICENSE | 202 - .../go-openapi/jsonreference/README.md | 15 - .../jsonreference/internal/normalize_url.go | 69 - .../go-openapi/jsonreference/reference.go | 158 - .../github.com/go-openapi/loads/.editorconfig | 26 - vendor/github.com/go-openapi/loads/.gitignore | 4 - .../github.com/go-openapi/loads/.golangci.yml | 44 - .../github.com/go-openapi/loads/.travis.yml | 25 - .../go-openapi/loads/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/loads/LICENSE | 202 - vendor/github.com/go-openapi/loads/README.md | 6 - vendor/github.com/go-openapi/loads/doc.go | 21 - .../github.com/go-openapi/loads/fmts/yaml.go | 30 - vendor/github.com/go-openapi/loads/loaders.go | 134 - vendor/github.com/go-openapi/loads/options.go | 61 - vendor/github.com/go-openapi/loads/spec.go | 266 - .../go-openapi/runtime/.editorconfig | 26 - .../go-openapi/runtime/.gitattributes | 1 - .../github.com/go-openapi/runtime/.gitignore | 5 - .../go-openapi/runtime/.golangci.yml | 44 - .../go-openapi/runtime/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/runtime/LICENSE | 202 - .../github.com/go-openapi/runtime/README.md | 7 - .../go-openapi/runtime/bytestream.go | 169 - .../go-openapi/runtime/client_auth_info.go | 30 - .../go-openapi/runtime/client_operation.go | 41 - .../go-openapi/runtime/client_request.go | 152 - .../go-openapi/runtime/client_response.go | 110 - .../go-openapi/runtime/constants.go | 49 - vendor/github.com/go-openapi/runtime/csv.go | 77 - .../github.com/go-openapi/runtime/discard.go | 9 - vendor/github.com/go-openapi/runtime/file.go | 19 - .../github.com/go-openapi/runtime/headers.go | 45 - .../go-openapi/runtime/interfaces.go | 112 - vendor/github.com/go-openapi/runtime/json.go | 38 - .../go-openapi/runtime/logger/logger.go | 20 - .../go-openapi/runtime/logger/standard.go | 22 - .../go-openapi/runtime/middleware/context.go | 635 - .../runtime/middleware/denco/LICENSE | 19 - .../runtime/middleware/denco/README.md | 180 - .../runtime/middleware/denco/router.go | 460 - .../runtime/middleware/denco/server.go | 106 - .../runtime/middleware/denco/util.go | 12 - .../go-openapi/runtime/middleware/doc.go | 62 - .../go-openapi/runtime/middleware/go18.go | 9 - .../runtime/middleware/header/header.go | 329 - .../runtime/middleware/negotiate.go | 98 - .../runtime/middleware/not_implemented.go | 67 - .../runtime/middleware/operation.go | 30 - .../runtime/middleware/parameter.go | 485 - .../go-openapi/runtime/middleware/pre_go18.go | 9 - .../go-openapi/runtime/middleware/rapidoc.go | 90 - .../go-openapi/runtime/middleware/redoc.go | 103 - .../go-openapi/runtime/middleware/request.go | 104 - .../go-openapi/runtime/middleware/router.go | 488 - .../go-openapi/runtime/middleware/security.go | 39 - .../go-openapi/runtime/middleware/spec.go | 48 - .../runtime/middleware/swaggerui.go | 168 - .../runtime/middleware/swaggerui_oauth2.go | 122 - .../runtime/middleware/untyped/api.go | 286 - .../runtime/middleware/validation.go | 126 - .../github.com/go-openapi/runtime/request.go | 139 - .../runtime/security/authenticator.go | 276 - .../go-openapi/runtime/security/authorizer.go | 27 - .../github.com/go-openapi/runtime/statuses.go | 90 - vendor/github.com/go-openapi/runtime/text.go | 116 - .../github.com/go-openapi/runtime/values.go | 19 - vendor/github.com/go-openapi/runtime/xml.go | 36 - .../github.com/go-openapi/spec/.editorconfig | 26 - vendor/github.com/go-openapi/spec/.gitignore | 2 - .../github.com/go-openapi/spec/.golangci.yml | 42 - .../go-openapi/spec/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/spec/LICENSE | 202 - vendor/github.com/go-openapi/spec/README.md | 34 - .../github.com/go-openapi/spec/appveyor.yml | 32 - vendor/github.com/go-openapi/spec/bindata.go | 297 - vendor/github.com/go-openapi/spec/cache.go | 98 - .../go-openapi/spec/contact_info.go | 57 - vendor/github.com/go-openapi/spec/debug.go | 49 - vendor/github.com/go-openapi/spec/errors.go | 19 - vendor/github.com/go-openapi/spec/expander.go | 594 - .../go-openapi/spec/external_docs.go | 24 - vendor/github.com/go-openapi/spec/header.go | 203 - vendor/github.com/go-openapi/spec/info.go | 184 - vendor/github.com/go-openapi/spec/items.go | 234 - vendor/github.com/go-openapi/spec/license.go | 56 - .../github.com/go-openapi/spec/normalizer.go | 202 - .../go-openapi/spec/normalizer_nonwindows.go | 44 - .../go-openapi/spec/normalizer_windows.go | 154 - .../github.com/go-openapi/spec/operation.go | 397 - .../github.com/go-openapi/spec/parameter.go | 326 - .../github.com/go-openapi/spec/path_item.go | 87 - vendor/github.com/go-openapi/spec/paths.go | 97 - .../github.com/go-openapi/spec/properties.go | 91 - vendor/github.com/go-openapi/spec/ref.go | 193 - vendor/github.com/go-openapi/spec/resolver.go | 127 - vendor/github.com/go-openapi/spec/response.go | 152 - .../github.com/go-openapi/spec/responses.go | 140 - vendor/github.com/go-openapi/spec/schema.go | 645 - .../go-openapi/spec/schema_loader.go | 338 - .../go-openapi/spec/security_scheme.go | 170 - vendor/github.com/go-openapi/spec/spec.go | 78 - vendor/github.com/go-openapi/spec/swagger.go | 448 - vendor/github.com/go-openapi/spec/tag.go | 75 - vendor/github.com/go-openapi/spec/url_go18.go | 8 - vendor/github.com/go-openapi/spec/url_go19.go | 14 - .../github.com/go-openapi/spec/validations.go | 215 - .../github.com/go-openapi/spec/xml_object.go | 68 - .../go-openapi/strfmt/.editorconfig | 26 - .../go-openapi/strfmt/.gitattributes | 2 - .../github.com/go-openapi/strfmt/.gitignore | 2 - .../go-openapi/strfmt/.golangci.yml | 59 - .../go-openapi/strfmt/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/strfmt/LICENSE | 202 - vendor/github.com/go-openapi/strfmt/README.md | 88 - vendor/github.com/go-openapi/strfmt/bson.go | 165 - vendor/github.com/go-openapi/strfmt/date.go | 187 - .../github.com/go-openapi/strfmt/default.go | 2035 - vendor/github.com/go-openapi/strfmt/doc.go | 18 - .../github.com/go-openapi/strfmt/duration.go | 211 - vendor/github.com/go-openapi/strfmt/format.go | 326 - vendor/github.com/go-openapi/strfmt/time.go | 319 - vendor/github.com/go-openapi/strfmt/ulid.go | 230 - .../github.com/go-openapi/swag/.editorconfig | 26 - .../github.com/go-openapi/swag/.gitattributes | 2 - vendor/github.com/go-openapi/swag/.gitignore | 4 - .../github.com/go-openapi/swag/.golangci.yml | 54 - .../go-openapi/swag/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/swag/LICENSE | 202 - vendor/github.com/go-openapi/swag/README.md | 21 - vendor/github.com/go-openapi/swag/convert.go | 208 - .../go-openapi/swag/convert_types.go | 730 - vendor/github.com/go-openapi/swag/doc.go | 31 - vendor/github.com/go-openapi/swag/file.go | 33 - vendor/github.com/go-openapi/swag/json.go | 312 - vendor/github.com/go-openapi/swag/loading.go | 121 - .../github.com/go-openapi/swag/name_lexem.go | 87 - vendor/github.com/go-openapi/swag/net.go | 38 - vendor/github.com/go-openapi/swag/path.go | 59 - .../github.com/go-openapi/swag/post_go18.go | 24 - .../github.com/go-openapi/swag/post_go19.go | 68 - vendor/github.com/go-openapi/swag/pre_go18.go | 24 - vendor/github.com/go-openapi/swag/pre_go19.go | 70 - vendor/github.com/go-openapi/swag/split.go | 262 - vendor/github.com/go-openapi/swag/util.go | 394 - vendor/github.com/go-openapi/swag/yaml.go | 450 - .../go-openapi/validate/.editorconfig | 26 - .../go-openapi/validate/.gitattributes | 2 - .../github.com/go-openapi/validate/.gitignore | 5 - .../go-openapi/validate/.golangci.yml | 50 - .../go-openapi/validate/CODE_OF_CONDUCT.md | 74 - vendor/github.com/go-openapi/validate/LICENSE | 202 - .../github.com/go-openapi/validate/README.md | 38 - .../go-openapi/validate/appveyor.yml | 32 - .../github.com/go-openapi/validate/context.go | 56 - .../github.com/go-openapi/validate/debug.go | 47 - .../go-openapi/validate/default_validator.go | 281 - vendor/github.com/go-openapi/validate/doc.go | 85 - .../go-openapi/validate/example_validator.go | 270 - .../github.com/go-openapi/validate/formats.go | 69 - .../github.com/go-openapi/validate/helpers.go | 324 - .../go-openapi/validate/object_validator.go | 279 - .../github.com/go-openapi/validate/options.go | 43 - .../github.com/go-openapi/validate/result.go | 486 - vendor/github.com/go-openapi/validate/rexp.go | 71 - .../github.com/go-openapi/validate/schema.go | 260 - .../go-openapi/validate/schema_messages.go | 78 - .../go-openapi/validate/schema_option.go | 54 - .../go-openapi/validate/schema_props.go | 240 - .../go-openapi/validate/slice_validator.go | 105 - vendor/github.com/go-openapi/validate/spec.go | 804 - .../go-openapi/validate/spec_messages.go | 360 - vendor/github.com/go-openapi/validate/type.go | 177 - .../go-openapi/validate/update-fixtures.sh | 15 - .../go-openapi/validate/validator.go | 645 - .../github.com/go-openapi/validate/values.go | 450 - .../github.com/go-swagger/go-swagger/LICENSE | 202 - .../go-swagger/cmd/swagger/.gitignore | 5 - .../go-swagger/cmd/swagger/commands/diff.go | 145 - .../cmd/swagger/commands/diff/array_diff.go | 106 - .../cmd/swagger/commands/diff/checks.go | 266 - .../swagger/commands/diff/compatibility.go | 111 - .../commands/diff/difference_location.go | 22 - .../cmd/swagger/commands/diff/difftypes.go | 337 - .../cmd/swagger/commands/diff/node.go | 82 - .../cmd/swagger/commands/diff/reporting.go | 118 - .../cmd/swagger/commands/diff/schema.go | 126 - .../swagger/commands/diff/spec_analyser.go | 759 - .../swagger/commands/diff/spec_difference.go | 216 - .../swagger/commands/diff/type_adapters.go | 163 - .../go-swagger/cmd/swagger/commands/expand.go | 81 - .../cmd/swagger/commands/flatten.go | 48 - .../cmd/swagger/commands/generate.go | 29 - .../cmd/swagger/commands/generate/cli.go | 26 - .../cmd/swagger/commands/generate/client.go | 86 - .../cmd/swagger/commands/generate/contrib.go | 17 - .../cmd/swagger/commands/generate/markdown.go | 33 - .../cmd/swagger/commands/generate/model.go | 98 - .../swagger/commands/generate/operation.go | 104 - .../cmd/swagger/commands/generate/server.go | 119 - .../cmd/swagger/commands/generate/shared.go | 240 - .../commands/generate/sharedopts_nonwin.go | 19 - .../commands/generate/sharedopts_win.go | 8 - .../cmd/swagger/commands/generate/spec.go | 125 - .../swagger/commands/generate/spec_go111.go | 119 - .../cmd/swagger/commands/generate/support.go | 67 - .../cmd/swagger/commands/initcmd.go | 13 - .../cmd/swagger/commands/initcmd/spec.go | 111 - .../go-swagger/cmd/swagger/commands/mixin.go | 117 - .../go-swagger/cmd/swagger/commands/serve.go | 117 - .../cmd/swagger/commands/validate.go | 83 - .../cmd/swagger/commands/version.go | 37 - .../go-swagger/cmd/swagger/swagger.go | 143 - .../go-swagger/go-swagger/codescan/README.md | 3 - .../go-swagger/codescan/application.go | 674 - .../go-swagger/go-swagger/codescan/doc.go | 6 - .../go-swagger/go-swagger/codescan/enum.go | 32 - .../go-swagger/go-swagger/codescan/meta.go | 252 - .../go-swagger/codescan/operations.go | 170 - .../go-swagger/codescan/parameters.go | 518 - .../go-swagger/go-swagger/codescan/parser.go | 1667 - .../go-swagger/codescan/parser_helpers.go | 51 - .../codescan/parser_helpers_go118.go | 42 - .../go-swagger/codescan/regexprs.go | 96 - .../go-swagger/codescan/responses.go | 454 - .../go-swagger/codescan/route_params.go | 263 - .../go-swagger/go-swagger/codescan/routes.go | 93 - .../go-swagger/go-swagger/codescan/schema.go | 1155 - .../go-swagger/go-swagger/codescan/spec.go | 258 - .../go-swagger/generator/.gitignore | 1 - .../go-swagger/generator/bindata.go | 40 - .../go-swagger/go-swagger/generator/client.go | 120 - .../go-swagger/go-swagger/generator/config.go | 61 - .../go-swagger/go-swagger/generator/debug.go | 64 - .../go-swagger/generator/discriminators.go | 75 - .../go-swagger/go-swagger/generator/doc.go | 78 - .../go-swagger/generator/formats.go | 226 - .../go-swagger/generator/genopts_nonwin.go | 50 - .../go-swagger/generator/genopts_win.go | 12 - .../go-swagger/generator/language.go | 440 - .../go-swagger/go-swagger/generator/media.go | 191 - .../go-swagger/go-swagger/generator/model.go | 2118 -- .../go-swagger/generator/operation.go | 1303 - .../go-swagger/go-swagger/generator/shared.go | 1096 - .../go-swagger/go-swagger/generator/spec.go | 273 - .../go-swagger/generator/structs.go | 803 - .../go-swagger/generator/support.go | 546 - .../go-swagger/generator/template_repo.go | 855 - .../generator/templates/cli/cli.gotmpl | 242 - .../generator/templates/cli/completion.gotmpl | 77 - .../generator/templates/cli/main.gotmpl | 28 - .../generator/templates/cli/modelcli.gotmpl | 25 - .../generator/templates/cli/operation.gotmpl | 230 - .../templates/cli/registerflag.gotmpl | 97 - .../templates/cli/retrieveflag.gotmpl | 59 - .../generator/templates/cli/schema.gotmpl | 193 - .../generator/templates/client/client.gotmpl | 127 - .../generator/templates/client/facade.gotmpl | 129 - .../templates/client/parameter.gotmpl | 406 - .../templates/client/response.gotmpl | 346 - .../templates/contrib/stratoscale/README.md | 311 - .../contrib/stratoscale/client/client.gotmpl | 111 - .../contrib/stratoscale/client/facade.gotmpl | 83 - .../stratoscale/server/configureapi.gotmpl | 222 - .../contrib/stratoscale/server/server.gotmpl | 9 - .../generator/templates/docstring.gotmpl | 25 - .../generator/templates/header.gotmpl | 20 - .../generator/templates/markdown/docs.gotmpl | 527 - .../generator/templates/model.gotmpl | 27 - .../generator/templates/schema.gotmpl | 131 - .../generator/templates/schemabody.gotmpl | 330 - .../generator/templates/schemaembedded.gotmpl | 21 - .../templates/schemapolymorphic.gotmpl | 53 - .../generator/templates/schematype.gotmpl | 29 - .../templates/schemavalidator.gotmpl | 1194 - .../additionalpropertiesserializer.gotmpl | 94 - .../serializers/aliasedserializer.gotmpl | 11 - .../serializers/allofserializer.gotmpl | 180 - .../serializers/basetypeserializer.gotmpl | 69 - .../marshalbinaryserializer.gotmpl | 19 - .../serializers/schemaserializer.gotmpl | 15 - .../serializers/subtypeserializer.gotmpl | 172 - .../serializers/tupleserializer.gotmpl | 66 - .../templates/server/autoconfigureapi.gotmpl | 205 - .../generator/templates/server/builder.gotmpl | 446 - .../templates/server/configureapi.gotmpl | 167 - .../generator/templates/server/doc.gotmpl | 63 - .../generator/templates/server/main.gotmpl | 186 - .../templates/server/operation.gotmpl | 92 - .../templates/server/parameter.gotmpl | 720 - .../templates/server/responses.gotmpl | 271 - .../generator/templates/server/server.gotmpl | 660 - .../templates/server/urlbuilder.gotmpl | 213 - .../simpleschema/defaultsinit.gotmpl | 23 - .../templates/simpleschema/defaultsvar.gotmpl | 29 - .../generator/templates/structfield.gotmpl | 41 - .../templates/swagger_json_embed.gotmpl | 30 - .../templates/validation/customformat.gotmpl | 3 - .../templates/validation/maximum.gotmpl | 23 - .../templates/validation/minimum.gotmpl | 23 - .../templates/validation/multipleOf.gotmpl | 23 - .../templates/validation/primitive.gotmpl | 29 - .../templates/validation/structfield.gotmpl | 62 - .../go-swagger/go-swagger/generator/types.go | 1284 - .../go-swagger/go-swagger/scan/README.md | 3 - .../go-swagger/go-swagger/scan/classifier.go | 166 - .../go-swagger/go-swagger/scan/doc.go | 89 - .../go-swagger/go-swagger/scan/enum.go | 84 - .../go-swagger/go-swagger/scan/meta.go | 246 - .../go-swagger/go-swagger/scan/operations.go | 85 - .../go-swagger/go-swagger/scan/parameters.go | 515 - .../go-swagger/go-swagger/scan/path.go | 151 - .../go-swagger/go-swagger/scan/responses.go | 453 - .../go-swagger/scan/route_params.go | 253 - .../go-swagger/go-swagger/scan/routes.go | 146 - .../go-swagger/go-swagger/scan/scanner.go | 974 - .../go-swagger/go-swagger/scan/schema.go | 1358 - .../go-swagger/go-swagger/scan/validators.go | 829 - .../github.com/go-toolsmith/astcast/LICENSE | 21 - .../github.com/go-toolsmith/astcast/README.md | 103 - .../go-toolsmith/astcast/astcast.go | 590 - .../github.com/go-toolsmith/astcopy/LICENSE | 21 - .../github.com/go-toolsmith/astcopy/README.md | 57 - .../go-toolsmith/astcopy/astcopy.go | 945 - .../go-toolsmith/astcopy/astcopy_go117.go | 30 - .../go-toolsmith/astcopy/astcopy_go118.go | 36 - .../go-toolsmith/astequal/.gitignore | 5 - .../github.com/go-toolsmith/astequal/LICENSE | 21 - .../go-toolsmith/astequal/README.md | 82 - .../go-toolsmith/astequal/astequal.go | 771 - .../github.com/go-toolsmith/astequal/diff.go | 23 - vendor/github.com/go-toolsmith/astfmt/LICENSE | 21 - .../github.com/go-toolsmith/astfmt/README.md | 55 - .../github.com/go-toolsmith/astfmt/astfmt.go | 111 - vendor/github.com/go-toolsmith/astp/LICENSE | 21 - vendor/github.com/go-toolsmith/astp/README.md | 54 - vendor/github.com/go-toolsmith/astp/decl.go | 39 - vendor/github.com/go-toolsmith/astp/expr.go | 141 - vendor/github.com/go-toolsmith/astp/stmt.go | 135 - .../github.com/go-toolsmith/strparse/LICENSE | 21 - .../go-toolsmith/strparse/README.md | 48 - .../go-toolsmith/strparse/strparse.go | 59 - vendor/github.com/go-toolsmith/typep/LICENSE | 21 - .../github.com/go-toolsmith/typep/README.md | 54 - vendor/github.com/go-toolsmith/typep/doc.go | 2 - .../go-toolsmith/typep/predicates.go | 36 - .../go-toolsmith/typep/safe_expr.go | 73 - .../go-toolsmith/typep/simple_predicates.go | 359 - vendor/github.com/go-xmlfmt/xmlfmt/LICENSE | 21 - vendor/github.com/go-xmlfmt/xmlfmt/README.md | 245 - vendor/github.com/go-xmlfmt/xmlfmt/xmlfmt.go | 92 - vendor/github.com/gobwas/glob/.gitignore | 8 - vendor/github.com/gobwas/glob/.travis.yml | 9 - vendor/github.com/gobwas/glob/LICENSE | 21 - vendor/github.com/gobwas/glob/bench.sh | 26 - .../gobwas/glob/compiler/compiler.go | 525 - vendor/github.com/gobwas/glob/glob.go | 80 - vendor/github.com/gobwas/glob/match/any.go | 45 - vendor/github.com/gobwas/glob/match/any_of.go | 82 - vendor/github.com/gobwas/glob/match/btree.go | 146 - .../github.com/gobwas/glob/match/contains.go | 58 - .../github.com/gobwas/glob/match/every_of.go | 99 - vendor/github.com/gobwas/glob/match/list.go | 49 - vendor/github.com/gobwas/glob/match/match.go | 81 - vendor/github.com/gobwas/glob/match/max.go | 49 - vendor/github.com/gobwas/glob/match/min.go | 57 - .../github.com/gobwas/glob/match/nothing.go | 27 - vendor/github.com/gobwas/glob/match/prefix.go | 50 - .../gobwas/glob/match/prefix_any.go | 55 - .../gobwas/glob/match/prefix_suffix.go | 62 - vendor/github.com/gobwas/glob/match/range.go | 48 - vendor/github.com/gobwas/glob/match/row.go | 77 - .../github.com/gobwas/glob/match/segments.go | 91 - vendor/github.com/gobwas/glob/match/single.go | 43 - vendor/github.com/gobwas/glob/match/suffix.go | 35 - .../gobwas/glob/match/suffix_any.go | 43 - vendor/github.com/gobwas/glob/match/super.go | 33 - vendor/github.com/gobwas/glob/match/text.go | 45 - vendor/github.com/gobwas/glob/readme.md | 148 - .../github.com/gobwas/glob/syntax/ast/ast.go | 122 - .../gobwas/glob/syntax/ast/parser.go | 157 - .../gobwas/glob/syntax/lexer/lexer.go | 273 - .../gobwas/glob/syntax/lexer/token.go | 88 - .../github.com/gobwas/glob/syntax/syntax.go | 14 - .../gobwas/glob/util/runes/runes.go | 154 - .../gobwas/glob/util/strings/strings.go | 39 - vendor/github.com/gofrs/flock/.gitignore | 24 - vendor/github.com/gofrs/flock/.travis.yml | 10 - vendor/github.com/gofrs/flock/LICENSE | 27 - vendor/github.com/gofrs/flock/README.md | 41 - vendor/github.com/gofrs/flock/appveyor.yml | 25 - vendor/github.com/gofrs/flock/flock.go | 144 - vendor/github.com/gofrs/flock/flock_aix.go | 281 - vendor/github.com/gofrs/flock/flock_unix.go | 197 - vendor/github.com/gofrs/flock/flock_winapi.go | 76 - .../github.com/gofrs/flock/flock_windows.go | 142 - vendor/github.com/gofrs/uuid/v5/.gitignore | 15 - vendor/github.com/gofrs/uuid/v5/LICENSE | 20 - vendor/github.com/gofrs/uuid/v5/README.md | 95 - vendor/github.com/gofrs/uuid/v5/codec.go | 234 - vendor/github.com/gofrs/uuid/v5/fuzz.go | 48 - vendor/github.com/gofrs/uuid/v5/generator.go | 456 - vendor/github.com/gofrs/uuid/v5/sql.go | 116 - vendor/github.com/gofrs/uuid/v5/uuid.go | 285 - .../gogo/protobuf/plugin/compare/compare.go | 580 - .../protobuf/plugin/compare/comparetest.go | 118 - .../plugin/defaultcheck/defaultcheck.go | 133 - .../plugin/description/description.go | 201 - .../plugin/description/descriptiontest.go | 73 - .../protobuf/plugin/embedcheck/embedcheck.go | 200 - .../plugin/enumstringer/enumstringer.go | 104 - .../gogo/protobuf/plugin/equal/equal.go | 694 - .../gogo/protobuf/plugin/equal/equaltest.go | 109 - .../gogo/protobuf/plugin/face/face.go | 233 - .../gogo/protobuf/plugin/face/facetest.go | 82 - .../gogo/protobuf/plugin/gostring/gostring.go | 386 - .../protobuf/plugin/gostring/gostringtest.go | 90 - .../protobuf/plugin/marshalto/marshalto.go | 1140 - .../protobuf/plugin/oneofcheck/oneofcheck.go | 93 - .../gogo/protobuf/plugin/populate/populate.go | 815 - .../gogo/protobuf/plugin/size/size.go | 696 - .../gogo/protobuf/plugin/size/sizetest.go | 134 - .../gogo/protobuf/plugin/stringer/stringer.go | 347 - .../protobuf/plugin/stringer/stringertest.go | 83 - .../gogo/protobuf/plugin/testgen/testgen.go | 608 - .../gogo/protobuf/plugin/union/union.go | 209 - .../gogo/protobuf/plugin/union/uniontest.go | 86 - .../protobuf/plugin/unmarshal/unmarshal.go | 1657 - .../gogo/protobuf/protoc-gen-gogo/Makefile | 41 - .../gogo/protobuf/protoc-gen-gogo/doc.go | 51 - .../protoc-gen-gogo/generator/generator.go | 3444 -- .../protoc-gen-gogo/generator/helper.go | 461 - .../generator/internal/remap/remap.go | 117 - .../protobuf/protoc-gen-gogo/grpc/grpc.go | 536 - .../gogo/protobuf/protoc-gen-gogo/main.go | 57 - .../protobuf/protoc-gen-gogo/plugin/Makefile | 37 - .../protoc-gen-gogo/plugin/plugin.pb.go | 365 - .../gogo/protobuf/protoc-gen-gogofast/main.go | 47 - .../gogo/protobuf/vanity/command/command.go | 161 - .../github.com/gogo/protobuf/vanity/enum.go | 78 - .../github.com/gogo/protobuf/vanity/field.go | 90 - .../github.com/gogo/protobuf/vanity/file.go | 197 - .../gogo/protobuf/vanity/foreach.go | 125 - vendor/github.com/gogo/protobuf/vanity/msg.go | 154 - vendor/github.com/golang/groupcache/LICENSE | 191 - .../github.com/golang/groupcache/lru/lru.go | 133 - .../protoc-gen-go/descriptor/descriptor.pb.go | 200 - .../protoc-gen-go/plugin/plugin.pb.go | 75 - vendor/github.com/golangci/check/LICENSE | 674 - .../check/cmd/structcheck/structcheck.go | 193 - .../golangci/check/cmd/varcheck/varcheck.go | 163 - vendor/github.com/golangci/dupl/.travis.yml | 5 - vendor/github.com/golangci/dupl/LICENSE | 21 - vendor/github.com/golangci/dupl/README.md | 63 - .../github.com/golangci/dupl/job/buildtree.go | 22 - vendor/github.com/golangci/dupl/job/parse.go | 36 - vendor/github.com/golangci/dupl/main.go | 148 - .../github.com/golangci/dupl/printer/html.go | 120 - .../golangci/dupl/printer/plumbing.go | 50 - .../golangci/dupl/printer/printer.go | 11 - .../github.com/golangci/dupl/printer/text.go | 100 - .../golangci/dupl/suffixtree/dupl.go | 98 - .../golangci/dupl/suffixtree/suffixtree.go | 216 - .../golangci/dupl/syntax/golang/golang.go | 392 - .../github.com/golangci/dupl/syntax/syntax.go | 175 - vendor/github.com/golangci/go-misc/LICENSE | 27 - .../golangci/go-misc/deadcode/README.md | 18 - .../golangci/go-misc/deadcode/deadcode.go | 138 - .../github.com/golangci/gofmt/gofmt/LICENSE | 27 - vendor/github.com/golangci/gofmt/gofmt/doc.go | 106 - .../github.com/golangci/gofmt/gofmt/gofmt.go | 504 - .../golangci/gofmt/gofmt/golangci.go | 100 - .../golangci/gofmt/gofmt/internal.go | 183 - .../gofmt/gofmt/internal/diff/diff.go | 261 - .../github.com/golangci/gofmt/gofmt/readme.md | 5 - .../golangci/gofmt/gofmt/rewrite.go | 311 - .../golangci/gofmt/gofmt/simplify.go | 169 - .../golangci/gofmt/goimports/LICENSE | 27 - .../golangci/gofmt/goimports/goimports.go | 89 - .../golangci/gofmt/goimports/golangci.go | 35 - .../golangci/gofmt/goimports/readme.md | 4 - .../github.com/golangci/golangci-lint/LICENSE | 674 - .../golangci-lint/cmd/golangci-lint/main.go | 45 - .../golangci-lint/internal/cache/cache.go | 525 - .../golangci-lint/internal/cache/default.go | 88 - .../golangci-lint/internal/cache/hash.go | 186 - .../golangci-lint/internal/cache/readme.md | 18 - .../internal/errorutil/errors.go | 23 - .../internal/pkgcache/pkgcache.go | 229 - .../golangci-lint/internal/renameio/readme.md | 10 - .../internal/renameio/renameio.go | 93 - .../golangci-lint/internal/robustio/readme.md | 6 - .../internal/robustio/robustio.go | 53 - .../internal/robustio/robustio_darwin.go | 21 - .../internal/robustio/robustio_flaky.go | 91 - .../internal/robustio/robustio_other.go | 27 - .../internal/robustio/robustio_windows.go | 30 - .../golangci-lint/pkg/commands/cache.go | 72 - .../golangci-lint/pkg/commands/config.go | 61 - .../golangci-lint/pkg/commands/executor.go | 253 - .../golangci-lint/pkg/commands/help.go | 96 - .../golangci-lint/pkg/commands/linters.go | 57 - .../golangci-lint/pkg/commands/root.go | 174 - .../golangci-lint/pkg/commands/run.go | 611 - .../golangci-lint/pkg/commands/version.go | 83 - .../golangci-lint/pkg/config/config.go | 71 - .../golangci-lint/pkg/config/issues.go | 213 - .../golangci-lint/pkg/config/linters.go | 11 - .../pkg/config/linters_settings.go | 896 - .../golangci-lint/pkg/config/output.go | 41 - .../golangci-lint/pkg/config/reader.go | 248 - .../golangci/golangci-lint/pkg/config/run.go | 40 - .../golangci-lint/pkg/config/severity.go | 18 - .../golangci-lint/pkg/exitcodes/exitcodes.go | 32 - .../golangci-lint/pkg/fsutils/filecache.go | 65 - .../golangci-lint/pkg/fsutils/files.go | 33 - .../golangci-lint/pkg/fsutils/fsutils.go | 100 - .../golangci-lint/pkg/fsutils/linecache.go | 68 - .../golangci-lint/pkg/fsutils/path_unix.go | 8 - .../golangci-lint/pkg/fsutils/path_windows.go | 28 - .../golangci-lint/pkg/golinters/asasalint.go | 30 - .../golangci-lint/pkg/golinters/asciicheck.go | 17 - .../golangci-lint/pkg/golinters/bidichk.go | 59 - .../golangci-lint/pkg/golinters/bodyclose.go | 17 - .../golangci-lint/pkg/golinters/commons.go | 6 - .../pkg/golinters/containedctx.go | 19 - .../pkg/golinters/contextcheck.go | 22 - .../golangci-lint/pkg/golinters/cyclop.go | 39 - .../golangci-lint/pkg/golinters/deadcode.go | 61 - .../golangci-lint/pkg/golinters/decorder.go | 44 - .../golangci-lint/pkg/golinters/depguard.go | 49 - .../golangci-lint/pkg/golinters/dogsled.go | 111 - .../golangci-lint/pkg/golinters/dupl.go | 96 - .../golangci-lint/pkg/golinters/dupword.go | 30 - .../pkg/golinters/durationcheck.go | 19 - .../golangci-lint/pkg/golinters/errcheck.go | 269 - .../golangci-lint/pkg/golinters/errchkjson.go | 33 - .../golangci-lint/pkg/golinters/errname.go | 17 - .../golangci-lint/pkg/golinters/errorlint.go | 32 - .../pkg/golinters/execinquery.go | 19 - .../golangci-lint/pkg/golinters/exhaustive.go | 36 - .../pkg/golinters/exhaustivestruct.go | 31 - .../pkg/golinters/exhaustruct.go | 29 - .../pkg/golinters/exportloopref.go | 19 - .../golangci-lint/pkg/golinters/forbidigo.go | 104 - .../pkg/golinters/forcetypeassert.go | 19 - .../golangci-lint/pkg/golinters/funlen.go | 76 - .../golangci-lint/pkg/golinters/gci.go | 157 - .../pkg/golinters/ginkgolinter.go | 34 - .../pkg/golinters/goanalysis/adapters.go | 41 - .../pkg/golinters/goanalysis/errors.go | 72 - .../pkg/golinters/goanalysis/issue.go | 31 - .../pkg/golinters/goanalysis/linter.go | 217 - .../pkg/golinters/goanalysis/load/guard.go | 30 - .../pkg/golinters/goanalysis/metalinter.go | 90 - .../pkg/golinters/goanalysis/runner.go | 342 - .../pkg/golinters/goanalysis/runner_action.go | 389 - .../pkg/golinters/goanalysis/runner_facts.go | 125 - .../goanalysis/runner_loadingpackage.go | 499 - .../pkg/golinters/goanalysis/runners.go | 270 - .../golinters/gocheckcompilerdirectives.go | 19 - .../pkg/golinters/gochecknoglobals.go | 29 - .../pkg/golinters/gochecknoinits.go | 74 - .../pkg/golinters/gochecksumtype.go | 80 - .../golangci-lint/pkg/golinters/gocognit.go | 80 - .../golangci-lint/pkg/golinters/goconst.go | 97 - .../golangci-lint/pkg/golinters/gocritic.go | 641 - .../golangci-lint/pkg/golinters/gocyclo.go | 76 - .../golangci-lint/pkg/golinters/godot.go | 102 - .../golangci-lint/pkg/golinters/godox.go | 76 - .../golangci-lint/pkg/golinters/goerr113.go | 17 - .../golangci-lint/pkg/golinters/gofmt.go | 85 - .../pkg/golinters/gofmt_common.go | 290 - .../golangci-lint/pkg/golinters/gofumpt.go | 119 - .../golangci-lint/pkg/golinters/goheader.go | 104 - .../golangci-lint/pkg/golinters/goimports.go | 83 - .../golangci-lint/pkg/golinters/golint.go | 84 - .../golangci-lint/pkg/golinters/gomnd.go | 45 - .../pkg/golinters/gomoddirectives.go | 65 - .../golangci-lint/pkg/golinters/gomodguard.go | 94 - .../pkg/golinters/goprintffuncname.go | 17 - .../golangci-lint/pkg/golinters/gosec.go | 205 - .../golangci-lint/pkg/golinters/gosimple.go | 21 - .../pkg/golinters/gosmopolitan.go | 32 - .../golangci-lint/pkg/golinters/govet.go | 205 - .../golangci-lint/pkg/golinters/grouper.go | 32 - .../golangci-lint/pkg/golinters/ifshort.go | 28 - .../golangci-lint/pkg/golinters/importas.go | 67 - .../pkg/golinters/inamedparam.go | 19 - .../pkg/golinters/ineffassign.go | 17 - .../pkg/golinters/interfacebloat.go | 29 - .../golangci-lint/pkg/golinters/interfacer.go | 82 - .../golangci-lint/pkg/golinters/ireturn.go | 30 - .../golangci-lint/pkg/golinters/lll.go | 156 - .../pkg/golinters/loggercheck.go | 44 - .../golangci-lint/pkg/golinters/maintidx.go | 30 - .../golangci-lint/pkg/golinters/makezero.go | 75 - .../golangci-lint/pkg/golinters/maligned.go | 74 - .../golangci-lint/pkg/golinters/mirror.go | 70 - .../golangci-lint/pkg/golinters/misspell.go | 143 - .../golangci-lint/pkg/golinters/musttag.go | 29 - .../golangci-lint/pkg/golinters/nakedret.go | 27 - .../golangci-lint/pkg/golinters/nestif.go | 79 - .../golangci-lint/pkg/golinters/nilerr.go | 19 - .../golangci-lint/pkg/golinters/nilnil.go | 30 - .../golangci-lint/pkg/golinters/nlreturn.go | 27 - .../golangci-lint/pkg/golinters/noctx.go | 17 - .../golangci-lint/pkg/golinters/nolintlint.go | 105 - .../pkg/golinters/nolintlint/README.md | 31 - .../pkg/golinters/nolintlint/nolintlint.go | 308 - .../pkg/golinters/nonamedreturns.go | 29 - .../pkg/golinters/nosnakecase.go | 19 - .../pkg/golinters/nosprintfhostport.go | 19 - .../pkg/golinters/paralleltest.go | 30 - .../golangci-lint/pkg/golinters/perfsprint.go | 19 - .../golangci-lint/pkg/golinters/prealloc.go | 65 - .../pkg/golinters/predeclared.go | 26 - .../golangci-lint/pkg/golinters/promlinter.go | 77 - .../pkg/golinters/protogetter.go | 59 - .../golangci-lint/pkg/golinters/reassign.go | 32 - .../golangci-lint/pkg/golinters/revive.go | 392 - .../pkg/golinters/rowserrcheck.go | 25 - .../golangci-lint/pkg/golinters/scopelint.go | 190 - .../golangci-lint/pkg/golinters/sloglint.go | 27 - .../pkg/golinters/sqlclosecheck.go | 19 - .../pkg/golinters/staticcheck.go | 21 - .../pkg/golinters/staticcheck_common.go | 168 - .../pkg/golinters/structcheck.go | 71 - .../golangci-lint/pkg/golinters/stylecheck.go | 30 - .../golangci-lint/pkg/golinters/tagalign.go | 75 - .../pkg/golinters/tagliatelle.go | 35 - .../golangci-lint/pkg/golinters/tenv.go | 29 - .../pkg/golinters/testableexamples.go | 19 - .../pkg/golinters/testifylint.go | 36 - .../pkg/golinters/testpackage.go | 28 - .../golangci-lint/pkg/golinters/thelper.go | 82 - .../golangci-lint/pkg/golinters/tparallel.go | 17 - .../golangci-lint/pkg/golinters/typecheck.go | 24 - .../golangci-lint/pkg/golinters/unconvert.go | 67 - .../golangci-lint/pkg/golinters/unparam.go | 90 - .../golangci-lint/pkg/golinters/unused.go | 112 - .../pkg/golinters/usestdlibvars.go | 38 - .../golangci-lint/pkg/golinters/util.go | 41 - .../golangci-lint/pkg/golinters/varcheck.go | 72 - .../golangci-lint/pkg/golinters/varnamelen.go | 46 - .../pkg/golinters/wastedassign.go | 17 - .../golangci-lint/pkg/golinters/whitespace.go | 108 - .../golangci-lint/pkg/golinters/wrapcheck.go | 38 - .../golangci-lint/pkg/golinters/wsl.go | 89 - .../pkg/golinters/zerologlint.go | 17 - .../golangci/golangci-lint/pkg/goutil/env.go | 60 - .../golangci-lint/pkg/lint/linter/config.go | 158 - .../golangci-lint/pkg/lint/linter/context.go | 49 - .../golangci-lint/pkg/lint/linter/linter.go | 35 - .../pkg/lint/lintersdb/custom_linters.go | 131 - .../pkg/lint/lintersdb/enabled_set.go | 223 - .../pkg/lint/lintersdb/manager.go | 987 - .../pkg/lint/lintersdb/validator.go | 108 - .../golangci/golangci-lint/pkg/lint/load.go | 326 - .../golangci/golangci-lint/pkg/lint/runner.go | 350 - .../golangci-lint/pkg/logutils/log.go | 31 - .../golangci-lint/pkg/logutils/logutils.go | 106 - .../golangci-lint/pkg/logutils/mock.go | 47 - .../golangci-lint/pkg/logutils/out.go | 9 - .../golangci-lint/pkg/logutils/stderr_log.go | 129 - .../golangci-lint/pkg/packages/errors.go | 37 - .../golangci-lint/pkg/packages/skip.go | 25 - .../golangci-lint/pkg/packages/util.go | 102 - .../golangci-lint/pkg/printers/checkstyle.go | 97 - .../golangci-lint/pkg/printers/codeclimate.go | 59 - .../golangci-lint/pkg/printers/github.go | 52 - .../golangci-lint/pkg/printers/html.go | 156 - .../golangci-lint/pkg/printers/json.go | 38 - .../golangci-lint/pkg/printers/junitxml.go | 88 - .../golangci-lint/pkg/printers/printer.go | 9 - .../golangci-lint/pkg/printers/tab.go | 67 - .../golangci-lint/pkg/printers/teamcity.go | 122 - .../golangci-lint/pkg/printers/text.go | 94 - .../golangci/golangci-lint/pkg/report/data.go | 26 - .../golangci/golangci-lint/pkg/report/log.go | 64 - .../golangci-lint/pkg/result/issue.go | 98 - .../processors/autogenerated_exclude.go | 133 - .../pkg/result/processors/base_rule.go | 74 - .../pkg/result/processors/cgo.go | 57 - .../pkg/result/processors/diff.go | 78 - .../pkg/result/processors/exclude.go | 59 - .../pkg/result/processors/exclude_rules.go | 95 - .../result/processors/filename_unadjuster.go | 131 - .../pkg/result/processors/fixer.go | 255 - .../result/processors/identifier_marker.go | 125 - .../pkg/result/processors/issues.go | 46 - .../pkg/result/processors/max_from_linter.go | 54 - .../processors/max_per_file_from_linter.go | 59 - .../pkg/result/processors/max_same_issues.go | 81 - .../pkg/result/processors/nolint.go | 314 - .../pkg/result/processors/path_prefixer.go | 36 - .../pkg/result/processors/path_prettifier.go | 48 - .../pkg/result/processors/path_shortener.go | 40 - .../pkg/result/processors/processor.go | 11 - .../pkg/result/processors/severity_rules.go | 108 - .../pkg/result/processors/skip_dirs.go | 146 - .../pkg/result/processors/skip_files.go | 56 - .../pkg/result/processors/sort_results.go | 166 - .../pkg/result/processors/source_code.go | 47 - .../pkg/result/processors/uniq_by_line.go | 58 - .../golangci-lint/pkg/timeutils/stopwatch.go | 116 - vendor/github.com/golangci/lint-1/.travis.yml | 19 - .../golangci/lint-1/CONTRIBUTING.md | 15 - vendor/github.com/golangci/lint-1/LICENSE | 27 - vendor/github.com/golangci/lint-1/README.md | 88 - vendor/github.com/golangci/lint-1/lint.go | 1655 - vendor/github.com/golangci/maligned/LICENSE | 27 - vendor/github.com/golangci/maligned/README | 7 - .../github.com/golangci/maligned/maligned.go | 253 - .../github.com/golangci/misspell/.gitignore | 37 - .../golangci/misspell/.golangci.yml | 109 - .../github.com/golangci/misspell/Dockerfile | 35 - vendor/github.com/golangci/misspell/LICENSE | 21 - vendor/github.com/golangci/misspell/Makefile | 66 - vendor/github.com/golangci/misspell/README.md | 424 - .../golangci/misspell/RELEASE-HOWTO.md | 38 - vendor/github.com/golangci/misspell/ascii.go | 60 - vendor/github.com/golangci/misspell/case.go | 58 - .../golangci/misspell/goreleaser.yml | 30 - .../golangci/misspell/install-misspell.sh | 365 - vendor/github.com/golangci/misspell/legal.go | 47 - vendor/github.com/golangci/misspell/mime.go | 205 - .../github.com/golangci/misspell/notwords.go | 85 - .../github.com/golangci/misspell/replace.go | 247 - .../golangci/misspell/stringreplacer.go | 333 - .../golangci/misspell/stringreplacer_test.gox | 421 - vendor/github.com/golangci/misspell/url.go | 18 - vendor/github.com/golangci/misspell/words.go | 31194 ---------------- vendor/github.com/golangci/revgrep/.gitignore | 1 - .../github.com/golangci/revgrep/.golangci.yml | 82 - vendor/github.com/golangci/revgrep/LICENSE | 201 - vendor/github.com/golangci/revgrep/Makefile | 12 - vendor/github.com/golangci/revgrep/README.md | 55 - vendor/github.com/golangci/revgrep/revgrep.go | 461 - vendor/github.com/golangci/unconvert/LICENSE | 27 - vendor/github.com/golangci/unconvert/README | 36 - .../golangci/unconvert/unconvert.go | 665 - .../google/go-containerregistry/LICENSE | 202 - .../internal/and/and_closer.go | 48 - .../internal/compression/compression.go | 97 - .../internal/estargz/estargz.go | 54 - .../go-containerregistry/internal/gzip/zip.go | 118 - .../internal/redact/redact.go | 89 - .../internal/retry/retry.go | 94 - .../wait/kubernetes_apimachinery_wait.go | 123 - .../internal/verify/verify.go | 122 - .../internal/zstd/zstd.go | 116 - .../go-containerregistry/pkg/authn/README.md | 322 - .../go-containerregistry/pkg/authn/anon.go | 26 - .../go-containerregistry/pkg/authn/auth.go | 30 - .../go-containerregistry/pkg/authn/authn.go | 115 - .../go-containerregistry/pkg/authn/basic.go | 29 - .../go-containerregistry/pkg/authn/bearer.go | 27 - .../go-containerregistry/pkg/authn/doc.go | 17 - .../pkg/authn/keychain.go | 249 - .../pkg/authn/multikeychain.go | 41 - .../pkg/compression/compression.go | 26 - .../go-containerregistry/pkg/logs/logs.go | 39 - .../go-containerregistry/pkg/name/README.md | 3 - .../go-containerregistry/pkg/name/check.go | 43 - .../go-containerregistry/pkg/name/digest.go | 94 - .../go-containerregistry/pkg/name/doc.go | 42 - .../go-containerregistry/pkg/name/errors.go | 48 - .../go-containerregistry/pkg/name/options.go | 83 - .../go-containerregistry/pkg/name/ref.go | 75 - .../go-containerregistry/pkg/name/registry.go | 142 - .../pkg/name/repository.go | 121 - .../go-containerregistry/pkg/name/tag.go | 108 - .../go-containerregistry/pkg/v1/config.go | 151 - .../google/go-containerregistry/pkg/v1/doc.go | 18 - .../pkg/v1/empty/README.md | 8 - .../go-containerregistry/pkg/v1/empty/doc.go | 16 - .../pkg/v1/empty/image.go | 52 - .../pkg/v1/empty/index.go | 65 - .../go-containerregistry/pkg/v1/hash.go | 123 - .../go-containerregistry/pkg/v1/image.go | 59 - .../go-containerregistry/pkg/v1/index.go | 43 - .../go-containerregistry/pkg/v1/layer.go | 42 - .../go-containerregistry/pkg/v1/manifest.go | 71 - .../pkg/v1/match/match.go | 92 - .../pkg/v1/mutate/README.md | 56 - .../go-containerregistry/pkg/v1/mutate/doc.go | 16 - .../pkg/v1/mutate/image.go | 293 - .../pkg/v1/mutate/index.go | 232 - .../pkg/v1/mutate/mutate.go | 553 - .../pkg/v1/mutate/rebase.go | 144 - .../pkg/v1/partial/README.md | 82 - .../pkg/v1/partial/compressed.go | 188 - .../pkg/v1/partial/doc.go | 17 - .../pkg/v1/partial/image.go | 28 - .../pkg/v1/partial/index.go | 165 - .../pkg/v1/partial/uncompressed.go | 223 - .../pkg/v1/partial/with.go | 436 - .../go-containerregistry/pkg/v1/platform.go | 149 - .../go-containerregistry/pkg/v1/progress.go | 25 - .../pkg/v1/remote/README.md | 117 - .../pkg/v1/remote/catalog.go | 159 - .../pkg/v1/remote/check.go | 72 - .../pkg/v1/remote/delete.go | 28 - .../pkg/v1/remote/descriptor.go | 206 - .../go-containerregistry/pkg/v1/remote/doc.go | 17 - .../pkg/v1/remote/fetcher.go | 311 - .../pkg/v1/remote/image.go | 277 - .../pkg/v1/remote/index.go | 287 - .../pkg/v1/remote/layer.go | 77 - .../pkg/v1/remote/list.go | 152 - .../pkg/v1/remote/mount.go | 108 - .../pkg/v1/remote/multi_write.go | 46 - .../pkg/v1/remote/options.go | 348 - .../pkg/v1/remote/progress.go | 76 - .../pkg/v1/remote/puller.go | 222 - .../pkg/v1/remote/pusher.go | 559 - .../pkg/v1/remote/referrers.go | 117 - .../pkg/v1/remote/schema1.go | 118 - .../pkg/v1/remote/transport/README.md | 129 - .../pkg/v1/remote/transport/basic.go | 62 - .../pkg/v1/remote/transport/bearer.go | 320 - .../pkg/v1/remote/transport/doc.go | 18 - .../pkg/v1/remote/transport/error.go | 196 - .../pkg/v1/remote/transport/logger.go | 91 - .../pkg/v1/remote/transport/ping.go | 227 - .../pkg/v1/remote/transport/retry.go | 111 - .../pkg/v1/remote/transport/schemer.go | 44 - .../pkg/v1/remote/transport/scope.go | 24 - .../pkg/v1/remote/transport/transport.go | 116 - .../pkg/v1/remote/transport/useragent.go | 94 - .../pkg/v1/remote/write.go | 700 - .../pkg/v1/stream/README.md | 68 - .../pkg/v1/stream/layer.go | 275 - .../pkg/v1/tarball/README.md | 280 - .../pkg/v1/tarball/doc.go | 17 - .../pkg/v1/tarball/image.go | 429 - .../pkg/v1/tarball/layer.go | 354 - .../pkg/v1/tarball/write.go | 457 - .../pkg/v1/types/types.go | 98 - .../pkg/v1/zz_deepcopy_generated.go | 339 - vendor/github.com/google/pprof/AUTHORS | 7 - vendor/github.com/google/pprof/CONTRIBUTORS | 16 - vendor/github.com/google/pprof/LICENSE | 202 - .../github.com/google/pprof/profile/encode.go | 588 - .../github.com/google/pprof/profile/filter.go | 274 - .../github.com/google/pprof/profile/index.go | 64 - .../pprof/profile/legacy_java_profile.go | 315 - .../google/pprof/profile/legacy_profile.go | 1228 - .../github.com/google/pprof/profile/merge.go | 667 - .../google/pprof/profile/profile.go | 856 - .../github.com/google/pprof/profile/proto.go | 367 - .../github.com/google/pprof/profile/prune.go | 194 - vendor/github.com/google/rpmpack/.gitignore | 3 - vendor/github.com/google/rpmpack/BUILD.bazel | 58 - .../github.com/google/rpmpack/CONTRIBUTING.md | 28 - vendor/github.com/google/rpmpack/LICENSE | 202 - vendor/github.com/google/rpmpack/README.md | 161 - vendor/github.com/google/rpmpack/WORKSPACE | 35 - .../github.com/google/rpmpack/cloudbuild.yaml | 15 - vendor/github.com/google/rpmpack/def.bzl | 63 - vendor/github.com/google/rpmpack/deps.bzl | 40 - vendor/github.com/google/rpmpack/dir.go | 41 - .../github.com/google/rpmpack/file_types.go | 47 - vendor/github.com/google/rpmpack/header.go | 202 - vendor/github.com/google/rpmpack/rpm.go | 559 - vendor/github.com/google/rpmpack/sense.go | 168 - vendor/github.com/google/rpmpack/tags.go | 102 - vendor/github.com/google/rpmpack/tar.go | 78 - .../gordonklaus/ineffassign/LICENSE | 21 - .../pkg/ineffassign/ineffassign.go | 610 - .../goreleaser/chglog/.gitattributes | 6 - .../github.com/goreleaser/chglog/.gitignore | 9 - .../goreleaser/chglog/.golangci.yaml | 32 - .../goreleaser/chglog/.goreleaser.yml | 99 - vendor/github.com/goreleaser/chglog/LICENSE | 21 - vendor/github.com/goreleaser/chglog/Makefile | 30 - vendor/github.com/goreleaser/chglog/README.md | 115 - vendor/github.com/goreleaser/chglog/add.go | 109 - vendor/github.com/goreleaser/chglog/files.go | 33 - vendor/github.com/goreleaser/chglog/format.go | 17 - vendor/github.com/goreleaser/chglog/git.go | 64 - vendor/github.com/goreleaser/chglog/init.go | 136 - .../github.com/goreleaser/chglog/templates.go | 74 - vendor/github.com/goreleaser/chglog/types.go | 96 - .../github.com/goreleaser/fileglob/.gitignore | 16 - .../goreleaser/fileglob/.golangci.yml | 13 - .../goreleaser/fileglob/.goreleaser.yml | 20 - vendor/github.com/goreleaser/fileglob/LICENSE | 21 - .../github.com/goreleaser/fileglob/README.md | 40 - vendor/github.com/goreleaser/fileglob/doc.go | 2 - vendor/github.com/goreleaser/fileglob/glob.go | 242 - .../github.com/goreleaser/fileglob/prefix.go | 96 - .../goreleaser/nfpm/v2/.gitattributes | 7 - .../github.com/goreleaser/nfpm/v2/.gitignore | 21 - .../goreleaser/nfpm/v2/.golangci.yml | 33 - .../goreleaser/nfpm/v2/.goreleaser.yml | 282 - .../goreleaser/nfpm/v2/.lintian-overrides | 2 - .../goreleaser/nfpm/v2/CODE_OF_CONDUCT.md | 74 - .../goreleaser/nfpm/v2/CONTRIBUTING.md | 88 - .../github.com/goreleaser/nfpm/v2/Dockerfile | 4 - .../github.com/goreleaser/nfpm/v2/LICENSE.md | 21 - .../github.com/goreleaser/nfpm/v2/README.md | 56 - .../github.com/goreleaser/nfpm/v2/SECURITY.md | 11 - .../goreleaser/nfpm/v2/Taskfile.yml | 154 - .../github.com/goreleaser/nfpm/v2/apk/apk.go | 504 - .../goreleaser/nfpm/v2/arch/arch.go | 598 - .../goreleaser/nfpm/v2/cmd/nfpm/art.txt | 5 - .../goreleaser/nfpm/v2/cmd/nfpm/main.go | 56 - .../github.com/goreleaser/nfpm/v2/deb/deb.go | 767 - .../nfpm/v2/deprecation/deprecation.go | 31 - .../goreleaser/nfpm/v2/files/files.go | 547 - .../goreleaser/nfpm/v2/internal/cmd/doc.go | 2 - .../goreleaser/nfpm/v2/internal/cmd/docs.go | 36 - .../goreleaser/nfpm/v2/internal/cmd/init.go | 92 - .../goreleaser/nfpm/v2/internal/cmd/man.go | 39 - .../nfpm/v2/internal/cmd/package.go | 113 - .../goreleaser/nfpm/v2/internal/cmd/root.go | 58 - .../goreleaser/nfpm/v2/internal/cmd/schema.go | 55 - .../goreleaser/nfpm/v2/internal/glob/glob.go | 114 - .../goreleaser/nfpm/v2/internal/sign/pgp.go | 259 - .../goreleaser/nfpm/v2/internal/sign/rsa.go | 122 - vendor/github.com/goreleaser/nfpm/v2/nfpm.go | 529 - .../github.com/goreleaser/nfpm/v2/rpm/rpm.go | 424 - vendor/github.com/gorilla/handlers/LICENSE | 22 - vendor/github.com/gorilla/handlers/README.md | 56 - .../github.com/gorilla/handlers/canonical.go | 74 - .../github.com/gorilla/handlers/compress.go | 143 - vendor/github.com/gorilla/handlers/cors.go | 355 - vendor/github.com/gorilla/handlers/doc.go | 9 - .../github.com/gorilla/handlers/handlers.go | 147 - vendor/github.com/gorilla/handlers/logging.go | 244 - .../gorilla/handlers/proxy_headers.go | 120 - .../github.com/gorilla/handlers/recovery.go | 96 - .../gostaticanalysis/analysisutil/LICENSE | 21 - .../gostaticanalysis/analysisutil/README.md | 5 - .../gostaticanalysis/analysisutil/call.go | 405 - .../analysisutil/diagnostic.go | 45 - .../gostaticanalysis/analysisutil/file.go | 30 - .../gostaticanalysis/analysisutil/pkg.go | 49 - .../gostaticanalysis/analysisutil/ssa.go | 152 - .../analysisutil/ssainspect.go | 47 - .../gostaticanalysis/analysisutil/types.go | 228 - .../gostaticanalysis/comment/LICENSE | 21 - .../gostaticanalysis/comment/README.md | 10 - .../gostaticanalysis/comment/comment.go | 152 - .../comment/passes/commentmap/commentmap.go | 21 - .../forcetypeassert/.reviewdog.yml | 8 - .../gostaticanalysis/forcetypeassert/LICENSE | 21 - .../forcetypeassert/README.md | 28 - .../forcetypeassert/forcetypeassert.go | 143 - .../gostaticanalysis/nilerr/LICENSE | 21 - .../gostaticanalysis/nilerr/README.md | 41 - .../gostaticanalysis/nilerr/nilerr.go | 291 - vendor/github.com/hashicorp/errwrap/LICENSE | 354 - vendor/github.com/hashicorp/errwrap/README.md | 89 - .../github.com/hashicorp/errwrap/errwrap.go | 178 - .../hashicorp/go-multierror/LICENSE | 353 - .../hashicorp/go-multierror/Makefile | 31 - .../hashicorp/go-multierror/README.md | 150 - .../hashicorp/go-multierror/append.go | 43 - .../hashicorp/go-multierror/flatten.go | 26 - .../hashicorp/go-multierror/format.go | 27 - .../hashicorp/go-multierror/group.go | 38 - .../hashicorp/go-multierror/multierror.go | 121 - .../hashicorp/go-multierror/prefix.go | 37 - .../hashicorp/go-multierror/sort.go | 16 - .../hashicorp/go-version/CHANGELOG.md | 45 - .../github.com/hashicorp/go-version/LICENSE | 354 - .../github.com/hashicorp/go-version/README.md | 66 - .../hashicorp/go-version/constraint.go | 296 - .../hashicorp/go-version/version.go | 407 - .../go-version/version_collection.go | 17 - vendor/github.com/hexops/gotextdiff/LICENSE | 27 - vendor/github.com/hexops/gotextdiff/README.md | 54 - vendor/github.com/hexops/gotextdiff/diff.go | 159 - .../hexops/gotextdiff/myers/diff.go | 205 - .../hexops/gotextdiff/span/parse.go | 100 - .../github.com/hexops/gotextdiff/span/span.go | 285 - .../hexops/gotextdiff/span/token.go | 194 - .../hexops/gotextdiff/span/token111.go | 39 - .../hexops/gotextdiff/span/token112.go | 16 - .../github.com/hexops/gotextdiff/span/uri.go | 169 - .../hexops/gotextdiff/span/utf16.go | 91 - .../github.com/hexops/gotextdiff/unified.go | 210 - vendor/github.com/huandu/xstrings/.gitignore | 24 - .../huandu/xstrings/CONTRIBUTING.md | 23 - vendor/github.com/huandu/xstrings/LICENSE | 22 - vendor/github.com/huandu/xstrings/README.md | 117 - vendor/github.com/huandu/xstrings/common.go | 21 - vendor/github.com/huandu/xstrings/convert.go | 593 - vendor/github.com/huandu/xstrings/count.go | 120 - vendor/github.com/huandu/xstrings/doc.go | 8 - vendor/github.com/huandu/xstrings/format.go | 173 - .../github.com/huandu/xstrings/manipulate.go | 220 - .../huandu/xstrings/stringbuilder.go | 8 - .../huandu/xstrings/stringbuilder_go110.go | 10 - .../github.com/huandu/xstrings/translate.go | 552 - .../github.com/iancoleman/orderedmap/LICENSE | 21 - .../iancoleman/orderedmap/orderedmap.go | 329 - .../iancoleman/orderedmap/readme.md | 73 - .../github.com/imdario/mergo/.deepsource.toml | 12 - vendor/github.com/imdario/mergo/.gitignore | 33 - vendor/github.com/imdario/mergo/.travis.yml | 12 - .../imdario/mergo/CODE_OF_CONDUCT.md | 46 - .../github.com/imdario/mergo/CONTRIBUTING.md | 112 - vendor/github.com/imdario/mergo/LICENSE | 28 - vendor/github.com/imdario/mergo/README.md | 242 - vendor/github.com/imdario/mergo/SECURITY.md | 14 - vendor/github.com/imdario/mergo/doc.go | 143 - vendor/github.com/imdario/mergo/map.go | 178 - vendor/github.com/imdario/mergo/merge.go | 409 - vendor/github.com/imdario/mergo/mergo.go | 81 - .../invopop/jsonschema/.golangci.yml | 89 - vendor/github.com/invopop/jsonschema/COPYING | 19 - .../github.com/invopop/jsonschema/README.md | 363 - .../invopop/jsonschema/comment_extractor.go | 90 - vendor/github.com/invopop/jsonschema/id.go | 76 - .../github.com/invopop/jsonschema/reflect.go | 1133 - vendor/github.com/invopop/jsonschema/utils.go | 18 - vendor/github.com/jbenet/go-context/LICENSE | 21 - .../github.com/jbenet/go-context/io/ctxio.go | 120 - vendor/github.com/jdxcode/netrc/.travis.yml | 4 - vendor/github.com/jdxcode/netrc/LICENSE | 21 - vendor/github.com/jdxcode/netrc/README.md | 22 - vendor/github.com/jdxcode/netrc/netrc.go | 257 - .../github.com/jessevdk/go-flags/.travis.yml | 39 - vendor/github.com/jessevdk/go-flags/LICENSE | 26 - vendor/github.com/jessevdk/go-flags/README.md | 139 - vendor/github.com/jessevdk/go-flags/arg.go | 27 - .../jessevdk/go-flags/check_crosscompile.sh | 20 - .../github.com/jessevdk/go-flags/closest.go | 59 - .../github.com/jessevdk/go-flags/command.go | 465 - .../jessevdk/go-flags/completion.go | 315 - .../github.com/jessevdk/go-flags/convert.go | 357 - vendor/github.com/jessevdk/go-flags/error.go | 138 - vendor/github.com/jessevdk/go-flags/flags.go | 263 - vendor/github.com/jessevdk/go-flags/group.go | 429 - vendor/github.com/jessevdk/go-flags/help.go | 514 - vendor/github.com/jessevdk/go-flags/ini.go | 615 - vendor/github.com/jessevdk/go-flags/man.go | 223 - .../github.com/jessevdk/go-flags/multitag.go | 140 - vendor/github.com/jessevdk/go-flags/option.go | 569 - .../jessevdk/go-flags/optstyle_other.go | 67 - .../jessevdk/go-flags/optstyle_windows.go | 108 - vendor/github.com/jessevdk/go-flags/parser.go | 714 - .../github.com/jessevdk/go-flags/termsize.go | 15 - .../jessevdk/go-flags/termsize_nosysioctl.go | 7 - .../jessevdk/go-flags/termsize_windows.go | 85 - .../github.com/jgautheron/goconst/.gitignore | 2 - vendor/github.com/jgautheron/goconst/LICENSE | 21 - .../github.com/jgautheron/goconst/README.md | 51 - vendor/github.com/jgautheron/goconst/api.go | 76 - .../github.com/jgautheron/goconst/parser.go | 187 - .../github.com/jgautheron/goconst/visitor.go | 156 - .../github.com/jingyugao/rowserrcheck/LICENSE | 21 - .../rowserrcheck/passes/rowserr/rowserr.go | 304 - .../jirfag/go-printf-func-name/LICENSE | 21 - .../pkg/analyzer/analyzer.go | 74 - vendor/github.com/josharian/intern/README.md | 5 - vendor/github.com/josharian/intern/intern.go | 44 - vendor/github.com/josharian/intern/license.md | 21 - vendor/github.com/julz/importas/.gitignore | 2 - vendor/github.com/julz/importas/LICENSE | 201 - vendor/github.com/julz/importas/README.md | 59 - vendor/github.com/julz/importas/analyzer.go | 141 - vendor/github.com/julz/importas/config.go | 70 - vendor/github.com/julz/importas/flags.go | 32 - .../kevinburke/ssh_config/.gitattributes | 1 - .../kevinburke/ssh_config/.gitignore | 0 .../github.com/kevinburke/ssh_config/.mailmap | 1 - .../kevinburke/ssh_config/AUTHORS.txt | 9 - .../kevinburke/ssh_config/CHANGELOG.md | 19 - .../github.com/kevinburke/ssh_config/LICENSE | 49 - .../github.com/kevinburke/ssh_config/Makefile | 33 - .../kevinburke/ssh_config/README.md | 92 - .../kevinburke/ssh_config/config.go | 803 - .../github.com/kevinburke/ssh_config/lexer.go | 240 - .../kevinburke/ssh_config/parser.go | 200 - .../kevinburke/ssh_config/position.go | 25 - .../github.com/kevinburke/ssh_config/token.go | 49 - .../kevinburke/ssh_config/validators.go | 186 - vendor/github.com/kisielk/errcheck/LICENSE | 22 - .../kisielk/errcheck/errcheck/analyzer.go | 77 - .../errcheck/errcheck/embedded_walker.go | 143 - .../kisielk/errcheck/errcheck/errcheck.go | 668 - .../kisielk/errcheck/errcheck/excludes.go | 83 - .../kisielk/errcheck/errcheck/tags.go | 12 - .../kisielk/errcheck/errcheck/tags_compat.go | 13 - vendor/github.com/kisielk/gotool/.travis.yml | 23 - vendor/github.com/kisielk/gotool/LEGAL | 32 - vendor/github.com/kisielk/gotool/LICENSE | 20 - vendor/github.com/kisielk/gotool/README.md | 6 - vendor/github.com/kisielk/gotool/go13.go | 15 - vendor/github.com/kisielk/gotool/go14-15.go | 15 - vendor/github.com/kisielk/gotool/go16-18.go | 15 - .../kisielk/gotool/internal/load/path.go | 27 - .../kisielk/gotool/internal/load/pkg.go | 25 - .../kisielk/gotool/internal/load/search.go | 354 - vendor/github.com/kisielk/gotool/match.go | 56 - vendor/github.com/kisielk/gotool/match18.go | 317 - vendor/github.com/kisielk/gotool/tool.go | 48 - .../kkHAIKE/contextcheck/.gitignore | 18 - .../github.com/kkHAIKE/contextcheck/LICENSE | 201 - .../github.com/kkHAIKE/contextcheck/Makefile | 5 - .../github.com/kkHAIKE/contextcheck/README.md | 157 - .../kkHAIKE/contextcheck/contextcheck.go | 835 - .../klauspost/compress/.gitattributes | 2 - .../github.com/klauspost/compress/.gitignore | 32 - .../klauspost/compress/.goreleaser.yml | 127 - vendor/github.com/klauspost/compress/LICENSE | 304 - .../github.com/klauspost/compress/README.md | 669 - .../github.com/klauspost/compress/SECURITY.md | 25 - .../klauspost/compress/compressible.go | 85 - .../klauspost/compress/flate/deflate.go | 1017 - .../klauspost/compress/flate/dict_decoder.go | 184 - .../klauspost/compress/flate/fast_encoder.go | 193 - .../compress/flate/huffman_bit_writer.go | 1182 - .../klauspost/compress/flate/huffman_code.go | 417 - .../compress/flate/huffman_sortByFreq.go | 159 - .../compress/flate/huffman_sortByLiteral.go | 201 - .../klauspost/compress/flate/inflate.go | 829 - .../klauspost/compress/flate/inflate_gen.go | 1283 - .../klauspost/compress/flate/level1.go | 241 - .../klauspost/compress/flate/level2.go | 214 - .../klauspost/compress/flate/level3.go | 241 - .../klauspost/compress/flate/level4.go | 221 - .../klauspost/compress/flate/level5.go | 708 - .../klauspost/compress/flate/level6.go | 325 - .../compress/flate/matchlen_amd64.go | 16 - .../klauspost/compress/flate/matchlen_amd64.s | 68 - .../compress/flate/matchlen_generic.go | 33 - .../klauspost/compress/flate/regmask_amd64.go | 37 - .../klauspost/compress/flate/regmask_other.go | 40 - .../klauspost/compress/flate/stateless.go | 318 - .../klauspost/compress/flate/token.go | 379 - .../klauspost/compress/fse/README.md | 79 - .../klauspost/compress/fse/bitreader.go | 122 - .../klauspost/compress/fse/bitwriter.go | 167 - .../klauspost/compress/fse/bytereader.go | 47 - .../klauspost/compress/fse/compress.go | 683 - .../klauspost/compress/fse/decompress.go | 376 - .../github.com/klauspost/compress/fse/fse.go | 144 - vendor/github.com/klauspost/compress/gen.sh | 4 - .../klauspost/compress/huff0/.gitignore | 1 - .../klauspost/compress/huff0/README.md | 89 - .../klauspost/compress/huff0/bitreader.go | 229 - .../klauspost/compress/huff0/bitwriter.go | 102 - .../klauspost/compress/huff0/compress.go | 742 - .../klauspost/compress/huff0/decompress.go | 1167 - .../compress/huff0/decompress_amd64.go | 226 - .../compress/huff0/decompress_amd64.s | 830 - .../compress/huff0/decompress_generic.go | 299 - .../klauspost/compress/huff0/huff0.go | 337 - .../compress/internal/cpuinfo/cpuinfo.go | 34 - .../internal/cpuinfo/cpuinfo_amd64.go | 11 - .../compress/internal/cpuinfo/cpuinfo_amd64.s | 36 - .../compress/internal/snapref/LICENSE | 27 - .../compress/internal/snapref/decode.go | 264 - .../compress/internal/snapref/decode_other.go | 113 - .../compress/internal/snapref/encode.go | 289 - .../compress/internal/snapref/encode_other.go | 250 - .../compress/internal/snapref/snappy.go | 98 - vendor/github.com/klauspost/compress/s2sx.mod | 4 - vendor/github.com/klauspost/compress/s2sx.sum | 0 .../klauspost/compress/zip/reader.go | 901 - .../klauspost/compress/zip/register.go | 148 - .../klauspost/compress/zip/struct.go | 392 - .../klauspost/compress/zip/writer.go | 641 - .../klauspost/compress/zstd/README.md | 441 - .../klauspost/compress/zstd/bitreader.go | 136 - .../klauspost/compress/zstd/bitwriter.go | 112 - .../klauspost/compress/zstd/blockdec.go | 726 - .../klauspost/compress/zstd/blockenc.go | 889 - .../compress/zstd/blocktype_string.go | 85 - .../klauspost/compress/zstd/bytebuf.go | 131 - .../klauspost/compress/zstd/bytereader.go | 82 - .../klauspost/compress/zstd/decodeheader.go | 229 - .../klauspost/compress/zstd/decoder.go | 948 - .../compress/zstd/decoder_options.go | 169 - .../klauspost/compress/zstd/dict.go | 534 - .../klauspost/compress/zstd/enc_base.go | 173 - .../klauspost/compress/zstd/enc_best.go | 541 - .../klauspost/compress/zstd/enc_better.go | 1241 - .../klauspost/compress/zstd/enc_dfast.go | 1123 - .../klauspost/compress/zstd/enc_fast.go | 891 - .../klauspost/compress/zstd/encoder.go | 619 - .../compress/zstd/encoder_options.go | 339 - .../klauspost/compress/zstd/framedec.go | 413 - .../klauspost/compress/zstd/frameenc.go | 137 - .../klauspost/compress/zstd/fse_decoder.go | 307 - .../compress/zstd/fse_decoder_amd64.go | 65 - .../compress/zstd/fse_decoder_amd64.s | 126 - .../compress/zstd/fse_decoder_generic.go | 72 - .../klauspost/compress/zstd/fse_encoder.go | 701 - .../klauspost/compress/zstd/fse_predefined.go | 158 - .../klauspost/compress/zstd/hash.go | 35 - .../klauspost/compress/zstd/history.go | 116 - .../compress/zstd/internal/xxhash/LICENSE.txt | 22 - .../compress/zstd/internal/xxhash/README.md | 71 - .../compress/zstd/internal/xxhash/xxhash.go | 230 - .../zstd/internal/xxhash/xxhash_amd64.s | 210 - .../zstd/internal/xxhash/xxhash_arm64.s | 184 - .../zstd/internal/xxhash/xxhash_asm.go | 16 - .../zstd/internal/xxhash/xxhash_other.go | 76 - .../zstd/internal/xxhash/xxhash_safe.go | 11 - .../klauspost/compress/zstd/matchlen_amd64.go | 16 - .../klauspost/compress/zstd/matchlen_amd64.s | 68 - .../compress/zstd/matchlen_generic.go | 33 - .../klauspost/compress/zstd/seqdec.go | 503 - .../klauspost/compress/zstd/seqdec_amd64.go | 394 - .../klauspost/compress/zstd/seqdec_amd64.s | 4175 --- .../klauspost/compress/zstd/seqdec_generic.go | 237 - .../klauspost/compress/zstd/seqenc.go | 114 - .../klauspost/compress/zstd/snappy.go | 434 - .../github.com/klauspost/compress/zstd/zip.go | 141 - .../klauspost/compress/zstd/zstd.go | 121 - vendor/github.com/klauspost/pgzip/.gitignore | 24 - vendor/github.com/klauspost/pgzip/.travis.yml | 28 - vendor/github.com/klauspost/pgzip/GO_LICENSE | 27 - vendor/github.com/klauspost/pgzip/LICENSE | 22 - vendor/github.com/klauspost/pgzip/README.md | 134 - vendor/github.com/klauspost/pgzip/gunzip.go | 597 - vendor/github.com/klauspost/pgzip/gzip.go | 519 - vendor/github.com/kr/pretty/.gitignore | 5 - vendor/github.com/kr/pretty/License | 19 - vendor/github.com/kr/pretty/Readme | 9 - vendor/github.com/kr/pretty/diff.go | 295 - vendor/github.com/kr/pretty/formatter.go | 355 - vendor/github.com/kr/pretty/pretty.go | 108 - vendor/github.com/kr/pretty/zero.go | 41 - vendor/github.com/kr/text/License | 19 - vendor/github.com/kr/text/Readme | 3 - vendor/github.com/kr/text/doc.go | 3 - vendor/github.com/kr/text/indent.go | 74 - vendor/github.com/kr/text/wrap.go | 86 - vendor/github.com/kulti/thelper/LICENSE | 21 - .../kulti/thelper/pkg/analyzer/analyzer.go | 639 - .../kulti/thelper/pkg/analyzer/report.go | 56 - .../kunwardeep/paralleltest/LICENSE | 21 - .../pkg/paralleltest/paralleltest.go | 318 - .../kyoh86/exportloopref/.golangci.yml | 4 - .../kyoh86/exportloopref/.goreleaser.yml | 51 - .../github.com/kyoh86/exportloopref/LICENSE | 21 - .../github.com/kyoh86/exportloopref/Makefile | 16 - .../github.com/kyoh86/exportloopref/README.md | 223 - .../kyoh86/exportloopref/exportloopref.go | 334 - .../ldez/gomoddirectives/.gitignore | 2 - .../ldez/gomoddirectives/.golangci.yml | 88 - .../github.com/ldez/gomoddirectives/LICENSE | 190 - .../github.com/ldez/gomoddirectives/Makefile | 15 - .../ldez/gomoddirectives/gomoddirectives.go | 125 - .../github.com/ldez/gomoddirectives/module.go | 48 - .../github.com/ldez/gomoddirectives/readme.md | 16 - vendor/github.com/ldez/tagliatelle/.gitignore | 3 - .../github.com/ldez/tagliatelle/.golangci.yml | 88 - vendor/github.com/ldez/tagliatelle/LICENSE | 190 - vendor/github.com/ldez/tagliatelle/Makefile | 15 - vendor/github.com/ldez/tagliatelle/readme.md | 177 - .../ldez/tagliatelle/tagliatelle.go | 218 - .../github.com/leonklingele/grouper/LICENSE | 674 - .../grouper/pkg/analyzer/analyzer.go | 89 - .../grouper/pkg/analyzer/config.go | 15 - .../grouper/pkg/analyzer/consts/analyzer.go | 19 - .../grouper/pkg/analyzer/consts/config.go | 6 - .../grouper/pkg/analyzer/flags.go | 37 - .../grouper/pkg/analyzer/globals/analyzer.go | 105 - .../grouper/pkg/analyzer/imports/analyzer.go | 103 - .../grouper/pkg/analyzer/imports/config.go | 6 - .../grouper/pkg/analyzer/types/analyzer.go | 19 - .../grouper/pkg/analyzer/types/config.go | 6 - .../grouper/pkg/analyzer/vars/analyzer.go | 19 - .../grouper/pkg/analyzer/vars/config.go | 6 - .../lucasb-eyer/go-colorful/.gitignore | 101 - .../lucasb-eyer/go-colorful/CHANGELOG.md | 42 - .../lucasb-eyer/go-colorful/LICENSE | 7 - .../lucasb-eyer/go-colorful/README.md | 482 - .../lucasb-eyer/go-colorful/colorgens.go | 55 - .../lucasb-eyer/go-colorful/colors.go | 979 - .../go-colorful/happy_palettegen.go | 25 - .../lucasb-eyer/go-colorful/hexcolor.go | 67 - .../go-colorful/hsluv-snapshot-rev4.json | 1 - .../lucasb-eyer/go-colorful/hsluv.go | 207 - .../go-colorful/soft_palettegen.go | 185 - .../go-colorful/warm_palettegen.go | 25 - .../github.com/lufeee/execinquery/.gitignore | 1 - vendor/github.com/lufeee/execinquery/LICENSE | 21 - .../github.com/lufeee/execinquery/README.md | 76 - .../lufeee/execinquery/execinquery.go | 135 - .../github.com/macabu/inamedparam/.gitignore | 22 - .../macabu/inamedparam/.golangci.yml | 33 - .../github.com/macabu/inamedparam/LICENSE-MIT | 21 - .../github.com/macabu/inamedparam/README.md | 38 - .../macabu/inamedparam/inamedparam.go | 94 - vendor/github.com/mailru/easyjson/LICENSE | 7 - .../github.com/mailru/easyjson/buffer/pool.go | 278 - .../mailru/easyjson/jlexer/bytestostr.go | 24 - .../easyjson/jlexer/bytestostr_nounsafe.go | 13 - .../mailru/easyjson/jlexer/error.go | 15 - .../mailru/easyjson/jlexer/lexer.go | 1244 - .../mailru/easyjson/jwriter/writer.go | 405 - .../maratori/testableexamples/LICENSE | 21 - .../pkg/testableexamples/testableexamples.go | 34 - .../github.com/maratori/testpackage/LICENSE | 21 - .../pkg/testpackage/testpackage.go | 73 - vendor/github.com/matoous/godox/.gitignore | 19 - vendor/github.com/matoous/godox/.golangci.yml | 75 - vendor/github.com/matoous/godox/.revive.toml | 136 - vendor/github.com/matoous/godox/LICENSE | 21 - vendor/github.com/matoous/godox/Makefile | 20 - vendor/github.com/matoous/godox/README.md | 23 - vendor/github.com/matoous/godox/godox.go | 121 - vendor/github.com/mattn/go-colorable/LICENSE | 21 - .../github.com/mattn/go-colorable/README.md | 48 - .../mattn/go-colorable/colorable_appengine.go | 38 - .../mattn/go-colorable/colorable_others.go | 38 - .../mattn/go-colorable/colorable_windows.go | 1047 - .../github.com/mattn/go-colorable/go.test.sh | 12 - .../mattn/go-colorable/noncolorable.go | 57 - vendor/github.com/mattn/go-isatty/LICENSE | 9 - vendor/github.com/mattn/go-isatty/README.md | 50 - vendor/github.com/mattn/go-isatty/doc.go | 2 - vendor/github.com/mattn/go-isatty/go.test.sh | 12 - .../github.com/mattn/go-isatty/isatty_bsd.go | 20 - .../mattn/go-isatty/isatty_others.go | 17 - .../mattn/go-isatty/isatty_plan9.go | 23 - .../mattn/go-isatty/isatty_solaris.go | 21 - .../mattn/go-isatty/isatty_tcgets.go | 20 - .../mattn/go-isatty/isatty_windows.go | 125 - vendor/github.com/mattn/go-runewidth/LICENSE | 21 - .../github.com/mattn/go-runewidth/README.md | 27 - .../mattn/go-runewidth/runewidth.go | 358 - .../mattn/go-runewidth/runewidth_appengine.go | 9 - .../mattn/go-runewidth/runewidth_js.go | 9 - .../mattn/go-runewidth/runewidth_posix.go | 81 - .../mattn/go-runewidth/runewidth_table.go | 439 - .../mattn/go-runewidth/runewidth_windows.go | 28 - .../mbilski/exhaustivestruct/LICENSE | 21 - .../exhaustivestruct/pkg/analyzer/analyzer.go | 187 - vendor/github.com/mgechev/revive/LICENSE | 21 - .../mgechev/revive/config/config.go | 247 - .../mgechev/revive/formatter/checkstyle.go | 77 - .../mgechev/revive/formatter/default.go | 28 - .../mgechev/revive/formatter/doc.go | 2 - .../mgechev/revive/formatter/friendly.go | 141 - .../mgechev/revive/formatter/json.go | 40 - .../mgechev/revive/formatter/ndjson.go | 35 - .../mgechev/revive/formatter/plain.go | 28 - .../mgechev/revive/formatter/sarif.go | 107 - .../mgechev/revive/formatter/severity.go | 13 - .../mgechev/revive/formatter/stylish.go | 89 - .../mgechev/revive/formatter/unix.go | 30 - .../mgechev/revive/internal/ifelse/args.go | 11 - .../mgechev/revive/internal/ifelse/branch.go | 93 - .../revive/internal/ifelse/branch_kind.go | 101 - .../mgechev/revive/internal/ifelse/chain.go | 10 - .../mgechev/revive/internal/ifelse/doc.go | 6 - .../mgechev/revive/internal/ifelse/func.go | 51 - .../mgechev/revive/internal/ifelse/rule.go | 105 - .../mgechev/revive/internal/ifelse/target.go | 25 - .../revive/internal/typeparams/typeparams.go | 29 - .../internal/typeparams/typeparams_go117.go | 12 - .../internal/typeparams/typeparams_go118.go | 20 - .../github.com/mgechev/revive/lint/config.go | 64 - vendor/github.com/mgechev/revive/lint/doc.go | 2 - .../github.com/mgechev/revive/lint/failure.go | 39 - vendor/github.com/mgechev/revive/lint/file.go | 280 - .../mgechev/revive/lint/filefilter.go | 128 - .../mgechev/revive/lint/formatter.go | 14 - .../github.com/mgechev/revive/lint/linter.go | 163 - .../github.com/mgechev/revive/lint/package.go | 190 - vendor/github.com/mgechev/revive/lint/rule.go | 31 - .../github.com/mgechev/revive/lint/utils.go | 128 - .../mgechev/revive/rule/add-constant.go | 261 - .../mgechev/revive/rule/argument-limit.go | 84 - .../github.com/mgechev/revive/rule/atomic.go | 94 - .../mgechev/revive/rule/banned-characters.go | 90 - .../mgechev/revive/rule/bare-return.go | 84 - .../mgechev/revive/rule/blank-imports.go | 75 - .../revive/rule/bool-literal-in-expr.go | 73 - .../mgechev/revive/rule/call-to-gc.go | 70 - .../revive/rule/cognitive-complexity.go | 212 - .../mgechev/revive/rule/comment-spacings.go | 91 - .../mgechev/revive/rule/confusing-naming.go | 191 - .../mgechev/revive/rule/confusing-results.go | 66 - .../revive/rule/constant-logical-expr.go | 100 - .../revive/rule/context-as-argument.go | 110 - .../mgechev/revive/rule/context-keys-type.go | 81 - .../mgechev/revive/rule/cyclomatic.go | 136 - .../mgechev/revive/rule/datarace.go | 142 - .../mgechev/revive/rule/deep-exit.go | 94 - .../github.com/mgechev/revive/rule/defer.go | 177 - vendor/github.com/mgechev/revive/rule/doc.go | 2 - .../mgechev/revive/rule/dot-imports.go | 106 - .../mgechev/revive/rule/duplicated-imports.go | 39 - .../mgechev/revive/rule/early-return.go | 51 - .../mgechev/revive/rule/empty-block.go | 75 - .../mgechev/revive/rule/empty-lines.go | 105 - .../mgechev/revive/rule/enforce-map-style.go | 164 - .../rule/enforce-repeated-arg-type-style.go | 191 - .../revive/rule/enforce-slice-style.go | 193 - .../mgechev/revive/rule/error-naming.go | 79 - .../mgechev/revive/rule/error-return.go | 67 - .../mgechev/revive/rule/error-strings.go | 199 - .../github.com/mgechev/revive/rule/errorf.go | 93 - .../mgechev/revive/rule/exported.go | 340 - .../mgechev/revive/rule/file-header.go | 87 - .../mgechev/revive/rule/flag-param.go | 105 - .../mgechev/revive/rule/function-length.go | 177 - .../revive/rule/function-result-limit.go | 83 - .../mgechev/revive/rule/get-return.go | 70 - .../mgechev/revive/rule/identical-branches.go | 84 - .../mgechev/revive/rule/if-return.go | 115 - .../revive/rule/import-alias-naming.go | 126 - .../mgechev/revive/rule/import-shadowing.go | 115 - .../mgechev/revive/rule/imports-blacklist.go | 73 - .../revive/rule/increment-decrement.go | 73 - .../mgechev/revive/rule/indent-error-flow.go | 45 - .../mgechev/revive/rule/line-length-limit.go | 102 - .../mgechev/revive/rule/max-public-structs.go | 88 - .../mgechev/revive/rule/modifies-param.go | 80 - .../revive/rule/modifies-value-receiver.go | 129 - .../mgechev/revive/rule/nested-structs.go | 75 - .../revive/rule/optimize-operands-order.go | 77 - .../mgechev/revive/rule/package-comments.go | 172 - .../mgechev/revive/rule/range-val-address.go | 162 - .../revive/rule/range-val-in-closure.go | 121 - .../github.com/mgechev/revive/rule/range.go | 82 - .../mgechev/revive/rule/receiver-naming.go | 81 - .../revive/rule/redefines-builtin-id.go | 179 - .../revive/rule/redundant-import-alias.go | 52 - .../mgechev/revive/rule/string-format.go | 311 - .../mgechev/revive/rule/string-of-int.go | 95 - .../mgechev/revive/rule/struct-tag.go | 421 - .../mgechev/revive/rule/superfluous-else.go | 46 - .../mgechev/revive/rule/time-equal.go | 76 - .../mgechev/revive/rule/time-naming.go | 95 - .../revive/rule/unchecked-type-assertion.go | 194 - .../revive/rule/unconditional-recursion.go | 199 - .../mgechev/revive/rule/unexported-naming.go | 115 - .../mgechev/revive/rule/unexported-return.go | 107 - .../mgechev/revive/rule/unhandled-error.go | 178 - .../mgechev/revive/rule/unnecessary-stmt.go | 107 - .../mgechev/revive/rule/unreachable-code.go | 122 - .../mgechev/revive/rule/unused-param.go | 157 - .../mgechev/revive/rule/unused-receiver.go | 133 - .../github.com/mgechev/revive/rule/use-any.go | 54 - .../mgechev/revive/rule/useless-break.go | 82 - .../github.com/mgechev/revive/rule/utils.go | 167 - .../mgechev/revive/rule/var-declarations.go | 120 - .../mgechev/revive/rule/var-naming.go | 281 - .../mgechev/revive/rule/waitgroup-by-value.go | 66 - .../mitchellh/copystructure/LICENSE | 21 - .../mitchellh/copystructure/README.md | 21 - .../mitchellh/copystructure/copier_time.go | 15 - .../mitchellh/copystructure/copystructure.go | 631 - .../github.com/mitchellh/go-homedir/LICENSE | 21 - .../github.com/mitchellh/go-homedir/README.md | 14 - .../mitchellh/go-homedir/homedir.go | 167 - .../mitchellh/reflectwalk/.travis.yml | 1 - .../github.com/mitchellh/reflectwalk/LICENSE | 21 - .../mitchellh/reflectwalk/README.md | 6 - .../mitchellh/reflectwalk/location.go | 19 - .../mitchellh/reflectwalk/location_string.go | 16 - .../mitchellh/reflectwalk/reflectwalk.go | 420 - vendor/github.com/moby/term/.gitignore | 8 - vendor/github.com/moby/term/LICENSE | 191 - vendor/github.com/moby/term/README.md | 36 - vendor/github.com/moby/term/ascii.go | 66 - vendor/github.com/moby/term/doc.go | 3 - vendor/github.com/moby/term/proxy.go | 88 - vendor/github.com/moby/term/term.go | 85 - vendor/github.com/moby/term/term_unix.go | 98 - vendor/github.com/moby/term/term_windows.go | 176 - vendor/github.com/moby/term/termios_bsd.go | 13 - vendor/github.com/moby/term/termios_nonbsd.go | 13 - vendor/github.com/moby/term/termios_unix.go | 35 - .../github.com/moby/term/termios_windows.go | 37 - .../moby/term/windows/ansi_reader.go | 252 - .../moby/term/windows/ansi_writer.go | 57 - .../github.com/moby/term/windows/console.go | 43 - vendor/github.com/moby/term/windows/doc.go | 5 - .../github.com/moricho/tparallel/.gitignore | 3 - .../moricho/tparallel/.goreleaser.yaml | 52 - vendor/github.com/moricho/tparallel/LICENSE | 21 - vendor/github.com/moricho/tparallel/Makefile | 13 - vendor/github.com/moricho/tparallel/README.md | 112 - .../moricho/tparallel/pkg/ssafunc/ssafunc.go | 34 - .../tparallel/pkg/ssainstr/ssainstr.go | 63 - .../github.com/moricho/tparallel/testmap.go | 63 - .../github.com/moricho/tparallel/tparallel.go | 72 - vendor/github.com/morikuni/aec/LICENSE | 21 - vendor/github.com/morikuni/aec/README.md | 178 - vendor/github.com/morikuni/aec/aec.go | 137 - vendor/github.com/morikuni/aec/ansi.go | 59 - vendor/github.com/morikuni/aec/builder.go | 388 - vendor/github.com/morikuni/aec/sample.gif | Bin 12548 -> 0 bytes vendor/github.com/morikuni/aec/sgr.go | 202 - .../github.com/muesli/mango-cobra/.gitignore | 17 - .../muesli/mango-cobra/.golangci-soft.yml | 47 - .../muesli/mango-cobra/.golangci.yml | 29 - vendor/github.com/muesli/mango-cobra/LICENSE | 21 - .../github.com/muesli/mango-cobra/README.md | 39 - .../github.com/muesli/mango-cobra/mcobra.go | 61 - .../github.com/muesli/mango-pflag/.gitignore | 17 - .../muesli/mango-pflag/.golangci-soft.yml | 47 - .../muesli/mango-pflag/.golangci.yml | 29 - vendor/github.com/muesli/mango-pflag/LICENSE | 21 - .../github.com/muesli/mango-pflag/README.md | 33 - .../github.com/muesli/mango-pflag/mpflag.go | 30 - vendor/github.com/muesli/mango/.gitignore | 19 - .../muesli/mango/.golangci-soft.yml | 47 - vendor/github.com/muesli/mango/.golangci.yml | 29 - vendor/github.com/muesli/mango/LICENSE | 21 - vendor/github.com/muesli/mango/README.md | 150 - vendor/github.com/muesli/mango/builder.go | 21 - vendor/github.com/muesli/mango/mango.go | 221 - vendor/github.com/muesli/mango/mango.png | Bin 34520 -> 0 bytes vendor/github.com/muesli/reflow/LICENSE | 21 - vendor/github.com/muesli/reflow/ansi/ansi.go | 7 - .../github.com/muesli/reflow/ansi/buffer.go | 40 - .../github.com/muesli/reflow/ansi/writer.go | 76 - .../muesli/reflow/truncate/truncate.go | 120 - .../muesli/reflow/wordwrap/wordwrap.go | 167 - vendor/github.com/muesli/reflow/wrap/wrap.go | 134 - vendor/github.com/muesli/roff/.gitignore | 15 - .../github.com/muesli/roff/.golangci-soft.yml | 47 - vendor/github.com/muesli/roff/.golangci.yml | 29 - vendor/github.com/muesli/roff/LICENSE | 21 - vendor/github.com/muesli/roff/README.md | 65 - vendor/github.com/muesli/roff/roff.go | 163 - vendor/github.com/muesli/termenv/.gitignore | 15 - .../muesli/termenv/.golangci-soft.yml | 47 - .../github.com/muesli/termenv/.golangci.yml | 29 - vendor/github.com/muesli/termenv/LICENSE | 21 - vendor/github.com/muesli/termenv/README.md | 431 - .../github.com/muesli/termenv/ansi_compat.md | 65 - .../github.com/muesli/termenv/ansicolors.go | 281 - vendor/github.com/muesli/termenv/color.go | 204 - .../muesli/termenv/constants_linux.go | 8 - .../muesli/termenv/constants_solaris.go | 8 - .../muesli/termenv/constants_unix.go | 13 - vendor/github.com/muesli/termenv/copy.go | 37 - vendor/github.com/muesli/termenv/hyperlink.go | 11 - .../github.com/muesli/termenv/notification.go | 11 - vendor/github.com/muesli/termenv/output.go | 197 - vendor/github.com/muesli/termenv/profile.go | 97 - vendor/github.com/muesli/termenv/screen.go | 590 - vendor/github.com/muesli/termenv/style.go | 126 - .../muesli/termenv/templatehelper.go | 86 - vendor/github.com/muesli/termenv/termenv.go | 114 - .../muesli/termenv/termenv_other.go | 30 - .../muesli/termenv/termenv_posix.go | 17 - .../muesli/termenv/termenv_solaris.go | 22 - .../github.com/muesli/termenv/termenv_unix.go | 289 - .../muesli/termenv/termenv_windows.go | 139 - .../mwitkow/go-proto-validators/.bazelignore | 1 - .../mwitkow/go-proto-validators/.bazelrc | 14 - .../mwitkow/go-proto-validators/.gitignore | 11 - .../mwitkow/go-proto-validators/.travis.yml | 31 - .../mwitkow/go-proto-validators/BUILD.bazel | 83 - .../mwitkow/go-proto-validators/LICENSE.txt | 201 - .../mwitkow/go-proto-validators/Makefile | 66 - .../mwitkow/go-proto-validators/README.md | 141 - .../mwitkow/go-proto-validators/WORKSPACE | 69 - .../mwitkow/go-proto-validators/go_deps.bzl | 57 - .../mwitkow/go-proto-validators/helper.go | 39 - .../go-proto-validators/plugin/BUILD.bazel | 16 - .../go-proto-validators/plugin/plugin.go | 689 - .../protoc-gen-govalidators/BUILD.bazel | 19 - .../protoc-gen-govalidators/main.go | 67 - .../go-proto-validators/validator.pb.go | 326 - .../go-proto-validators/validator.proto | 80 - vendor/github.com/nakabonne/nestif/.gitignore | 16 - vendor/github.com/nakabonne/nestif/LICENSE | 25 - vendor/github.com/nakabonne/nestif/README.md | 128 - vendor/github.com/nakabonne/nestif/nestif.go | 148 - vendor/github.com/nginx/agent/sdk/v2/Makefile | 2 +- .../nishanths/exhaustive/.gitignore | 12 - .../github.com/nishanths/exhaustive/LICENSE | 25 - .../github.com/nishanths/exhaustive/Makefile | 43 - .../github.com/nishanths/exhaustive/README.md | 104 - .../nishanths/exhaustive/comment.go | 29 - .../nishanths/exhaustive/comment_go121.go | 11 - .../nishanths/exhaustive/comment_pre_go121.go | 27 - .../github.com/nishanths/exhaustive/common.go | 474 - vendor/github.com/nishanths/exhaustive/doc.go | 216 - .../github.com/nishanths/exhaustive/enum.go | 177 - .../nishanths/exhaustive/exhaustive.go | 152 - .../github.com/nishanths/exhaustive/fact.go | 28 - .../github.com/nishanths/exhaustive/flag.go | 75 - vendor/github.com/nishanths/exhaustive/map.go | 134 - .../github.com/nishanths/exhaustive/switch.go | 236 - .../github.com/nishanths/predeclared/LICENSE | 29 - .../predeclared/passes/predeclared/go18.go | 9 - .../passes/predeclared/pre_go18.go | 53 - .../passes/predeclared/predeclared.go | 202 - .../nunnatsa/ginkgolinter/.gitignore | 2 - .../nunnatsa/ginkgolinter/.golangci.yml | 3 - .../github.com/nunnatsa/ginkgolinter/LICENSE | 21 - .../github.com/nunnatsa/ginkgolinter/Makefile | 27 - .../nunnatsa/ginkgolinter/README.md | 433 - .../nunnatsa/ginkgolinter/ginkgo_linter.go | 1499 - .../ginkgolinter/ginkgohandler/handler.go | 97 - .../ginkgolinter/gomegahandler/handler.go | 236 - .../ginkgolinter/interfaces/interfaces.go | 76 - .../reverseassertion/reverse_assertion.go | 42 - .../nunnatsa/ginkgolinter/types/boolean.go | 32 - .../nunnatsa/ginkgolinter/types/config.go | 94 - .../nunnatsa/ginkgolinter/version/version.go | 14 - vendor/github.com/oklog/ulid/.gitignore | 29 - vendor/github.com/oklog/ulid/.travis.yml | 16 - vendor/github.com/oklog/ulid/AUTHORS.md | 2 - vendor/github.com/oklog/ulid/CHANGELOG.md | 33 - vendor/github.com/oklog/ulid/CONTRIBUTING.md | 17 - vendor/github.com/oklog/ulid/Gopkg.lock | 15 - vendor/github.com/oklog/ulid/Gopkg.toml | 26 - vendor/github.com/oklog/ulid/LICENSE | 201 - vendor/github.com/oklog/ulid/README.md | 150 - vendor/github.com/oklog/ulid/ulid.go | 614 - .../olekukonko/tablewriter/.gitignore | 15 - .../olekukonko/tablewriter/.travis.yml | 22 - .../olekukonko/tablewriter/LICENSE.md | 19 - .../olekukonko/tablewriter/README.md | 431 - .../github.com/olekukonko/tablewriter/csv.go | 52 - .../olekukonko/tablewriter/table.go | 967 - .../tablewriter/table_with_color.go | 136 - .../github.com/olekukonko/tablewriter/util.go | 93 - .../github.com/olekukonko/tablewriter/wrap.go | 99 - .../opencontainers/go-digest/.mailmap | 4 - .../opencontainers/go-digest/.pullapprove.yml | 28 - .../opencontainers/go-digest/.travis.yml | 5 - .../opencontainers/go-digest/CONTRIBUTING.md | 72 - .../opencontainers/go-digest/LICENSE | 192 - .../opencontainers/go-digest/LICENSE.docs | 425 - .../opencontainers/go-digest/MAINTAINERS | 5 - .../opencontainers/go-digest/README.md | 96 - .../opencontainers/go-digest/algorithm.go | 193 - .../opencontainers/go-digest/digest.go | 157 - .../opencontainers/go-digest/digester.go | 40 - .../opencontainers/go-digest/digestset/set.go | 262 - .../opencontainers/go-digest/doc.go | 62 - .../opencontainers/go-digest/verifiers.go | 46 - .../opencontainers/image-spec/LICENSE | 191 - .../image-spec/specs-go/v1/annotations.go | 62 - .../image-spec/specs-go/v1/config.go | 111 - .../image-spec/specs-go/v1/descriptor.go | 80 - .../image-spec/specs-go/v1/index.go | 38 - .../image-spec/specs-go/v1/layout.go | 32 - .../image-spec/specs-go/v1/manifest.go | 41 - .../image-spec/specs-go/v1/mediatype.go | 75 - .../image-spec/specs-go/version.go | 32 - .../image-spec/specs-go/versioned.go | 23 - vendor/github.com/pjbgf/sha1cd/Dockerfile.arm | 23 - .../github.com/pjbgf/sha1cd/Dockerfile.arm64 | 23 - vendor/github.com/pjbgf/sha1cd/LICENSE | 201 - vendor/github.com/pjbgf/sha1cd/Makefile | 40 - vendor/github.com/pjbgf/sha1cd/README.md | 58 - vendor/github.com/pjbgf/sha1cd/detection.go | 11 - .../github.com/pjbgf/sha1cd/internal/const.go | 42 - vendor/github.com/pjbgf/sha1cd/sha1cd.go | 227 - .../pjbgf/sha1cd/sha1cdblock_amd64.go | 50 - .../pjbgf/sha1cd/sha1cdblock_amd64.s | 2274 -- .../pjbgf/sha1cd/sha1cdblock_generic.go | 268 - .../pjbgf/sha1cd/sha1cdblock_noasm.go | 8 - vendor/github.com/pjbgf/sha1cd/ubc/check.go | 368 - vendor/github.com/pjbgf/sha1cd/ubc/const.go | 624 - vendor/github.com/pjbgf/sha1cd/ubc/doc.go | 3 - vendor/github.com/pkg/browser/LICENSE | 23 - vendor/github.com/pkg/browser/README.md | 55 - vendor/github.com/pkg/browser/browser.go | 57 - .../github.com/pkg/browser/browser_darwin.go | 5 - .../github.com/pkg/browser/browser_freebsd.go | 14 - .../github.com/pkg/browser/browser_linux.go | 21 - .../github.com/pkg/browser/browser_netbsd.go | 14 - .../github.com/pkg/browser/browser_openbsd.go | 14 - .../pkg/browser/browser_unsupported.go | 12 - .../github.com/pkg/browser/browser_windows.go | 7 - vendor/github.com/pkg/errors/.gitignore | 24 - vendor/github.com/pkg/errors/.travis.yml | 10 - vendor/github.com/pkg/errors/LICENSE | 23 - vendor/github.com/pkg/errors/Makefile | 44 - vendor/github.com/pkg/errors/README.md | 59 - vendor/github.com/pkg/errors/appveyor.yml | 32 - vendor/github.com/pkg/errors/errors.go | 288 - vendor/github.com/pkg/errors/go113.go | 38 - vendor/github.com/pkg/errors/stack.go | 177 - vendor/github.com/pkg/profile/.travis.yml | 9 - vendor/github.com/pkg/profile/AUTHORS | 1 - vendor/github.com/pkg/profile/LICENSE | 24 - vendor/github.com/pkg/profile/README.md | 57 - vendor/github.com/pkg/profile/profile.go | 327 - .../github.com/polyfloyd/go-errorlint/LICENSE | 21 - .../go-errorlint/errorlint/allowed.go | 222 - .../go-errorlint/errorlint/analysis.go | 113 - .../polyfloyd/go-errorlint/errorlint/lint.go | 375 - .../go-errorlint/errorlint/printf.go | 122 - .../prometheus/testutil/promlint/problem.go | 33 - .../prometheus/testutil/promlint/promlint.go | 123 - .../testutil/promlint/validation.go | 33 - .../validations/counter_validations.go | 40 - .../validations/generic_name_validations.go | 101 - .../promlint/validations/help_validations.go | 32 - .../validations/histogram_validations.go | 63 - .../testutil/promlint/validations/units.go | 118 - .../pseudomuto/protoc-gen-doc/.dockerignore | 6 - .../pseudomuto/protoc-gen-doc/.gitignore | 4 - .../protoc-gen-doc/.goreleaser.yaml | 48 - .../pseudomuto/protoc-gen-doc/CHANGELOG.md | 206 - .../pseudomuto/protoc-gen-doc/CONTRIBUTING.md | 78 - .../pseudomuto/protoc-gen-doc/Dockerfile | 13 - .../pseudomuto/protoc-gen-doc/LICENSE.md | 21 - .../pseudomuto/protoc-gen-doc/Makefile | 121 - .../pseudomuto/protoc-gen-doc/README.md | 203 - .../cmd/protoc-gen-doc/flags.go | 101 - .../protoc-gen-doc/cmd/protoc-gen-doc/main.go | 53 - .../pseudomuto/protoc-gen-doc/doc.go | 19 - .../envoyproxy_validate.go | 91 - .../protoc-gen-doc/extensions/extensions.go | 35 - .../google_api_http/google_api_http.go | 65 - .../extensions/lyft_validate/alias.go | 9 - .../validator_field/validator_field.go | 83 - .../pseudomuto/protoc-gen-doc/filters.go | 44 - .../pseudomuto/protoc-gen-doc/plugin.go | 168 - .../pseudomuto/protoc-gen-doc/renderer.go | 151 - .../pseudomuto/protoc-gen-doc/resources.go | 16 - .../protoc-gen-doc/resources/docbook.tmpl | 218 - .../protoc-gen-doc/resources/html.tmpl | 437 - .../protoc-gen-doc/resources/markdown.tmpl | 104 - .../protoc-gen-doc/resources/scalars.json | 167 - .../pseudomuto/protoc-gen-doc/revive.toml | 54 - .../pseudomuto/protoc-gen-doc/template.go | 599 - .../pseudomuto/protoc-gen-doc/version.go | 4 - .../github.com/pseudomuto/protokit/.gitignore | 3 - .../pseudomuto/protokit/.gofmtignore | 2 - .../pseudomuto/protokit/.travis.yml | 32 - .../pseudomuto/protokit/CHANGELOG.md | 41 - .../github.com/pseudomuto/protokit/Gopkg.lock | 46 - .../github.com/pseudomuto/protokit/Gopkg.toml | 37 - vendor/github.com/pseudomuto/protokit/LICENSE | 21 - .../github.com/pseudomuto/protokit/Makefile | 29 - .../github.com/pseudomuto/protokit/README.md | 71 - .../pseudomuto/protokit/comments.go | 93 - .../github.com/pseudomuto/protokit/context.go | 58 - vendor/github.com/pseudomuto/protokit/doc.go | 13 - .../github.com/pseudomuto/protokit/parser.go | 289 - .../github.com/pseudomuto/protokit/plugin.go | 67 - .../github.com/pseudomuto/protokit/tools.json | 13 - .../github.com/pseudomuto/protokit/types.go | 350 - .../github.com/pseudomuto/protokit/version.go | 4 - .../github.com/quasilyte/go-ruleguard/LICENSE | 29 - .../go-ruleguard/internal/goenv/goenv.go | 34 - .../go-ruleguard/internal/golist/golist.go | 30 - .../internal/xsrcimporter/xsrcimporter.go | 29 - .../go-ruleguard/internal/xtypes/xtypes.go | 266 - .../go-ruleguard/ruleguard/ast_walker.go | 369 - .../go-ruleguard/ruleguard/bundle.go | 19 - .../go-ruleguard/ruleguard/engine.go | 270 - .../go-ruleguard/ruleguard/filters.go | 835 - .../go-ruleguard/ruleguard/go_version.go | 58 - .../go-ruleguard/ruleguard/gorule.go | 154 - .../go-ruleguard/ruleguard/goutil/goutil.go | 67 - .../go-ruleguard/ruleguard/goutil/resolve.go | 33 - .../go-ruleguard/ruleguard/importer.go | 95 - .../ruleguard/ir/filter_op.gen.go | 282 - .../ruleguard/ir/gen_filter_op.go | 148 - .../quasilyte/go-ruleguard/ruleguard/ir/ir.go | 113 - .../go-ruleguard/ruleguard/ir_loader.go | 890 - .../go-ruleguard/ruleguard/ir_utils.go | 41 - .../go-ruleguard/ruleguard/irconv/irconv.go | 858 - .../go-ruleguard/ruleguard/libdsl.go | 401 - .../go-ruleguard/ruleguard/match_data.go | 19 - .../go-ruleguard/ruleguard/nodepath.go | 49 - .../ruleguard/profiling/no_labels.go | 16 - .../ruleguard/profiling/with_labels.go | 21 - .../go-ruleguard/ruleguard/quasigo/compile.go | 868 - .../ruleguard/quasigo/debug_info.go | 17 - .../go-ruleguard/ruleguard/quasigo/disasm.go | 84 - .../go-ruleguard/ruleguard/quasigo/env.go | 42 - .../go-ruleguard/ruleguard/quasigo/eval.go | 265 - .../ruleguard/quasigo/gen_opcodes.go | 192 - .../ruleguard/quasigo/opcode_string.go | 69 - .../ruleguard/quasigo/opcodes.gen.go | 249 - .../go-ruleguard/ruleguard/quasigo/quasigo.go | 199 - .../ruleguard/quasigo/stdlib/qfmt/qfmt.go | 17 - .../quasigo/stdlib/qstrconv/qstrconv.go | 24 - .../quasigo/stdlib/qstrings/qstrings.go | 62 - .../go-ruleguard/ruleguard/quasigo/utils.go | 60 - .../go-ruleguard/ruleguard/ruleguard.go | 221 - .../go-ruleguard/ruleguard/runner.go | 562 - .../ruleguard/textmatch/compile.go | 84 - .../ruleguard/textmatch/matchers.go | 72 - .../ruleguard/textmatch/textmatch.go | 26 - .../ruleguard/typematch/patternop_string.go | 36 - .../ruleguard/typematch/typematch.go | 607 - .../quasilyte/go-ruleguard/ruleguard/utils.go | 304 - vendor/github.com/quasilyte/gogrep/.gitignore | 4 - .../github.com/quasilyte/gogrep/.golangci.yml | 49 - vendor/github.com/quasilyte/gogrep/LICENSE | 33 - vendor/github.com/quasilyte/gogrep/Makefile | 19 - vendor/github.com/quasilyte/gogrep/README.md | 41 - vendor/github.com/quasilyte/gogrep/compile.go | 1264 - .../quasilyte/gogrep/compile_import.go | 57 - .../quasilyte/gogrep/gen_operations.go | 366 - vendor/github.com/quasilyte/gogrep/gogrep.go | 187 - .../quasilyte/gogrep/instructions.go | 116 - .../gogrep/internal/stdinfo/stdinfo.go | 151 - vendor/github.com/quasilyte/gogrep/match.go | 1024 - .../quasilyte/gogrep/nodetag/nodetag.go | 287 - .../quasilyte/gogrep/operation_string.go | 154 - .../quasilyte/gogrep/operations.gen.go | 1671 - vendor/github.com/quasilyte/gogrep/parse.go | 403 - vendor/github.com/quasilyte/gogrep/slices.go | 150 - .../github.com/quasilyte/regex/syntax/LICENSE | 21 - .../quasilyte/regex/syntax/README.md | 29 - .../github.com/quasilyte/regex/syntax/ast.go | 64 - .../quasilyte/regex/syntax/errors.go | 27 - .../quasilyte/regex/syntax/lexer.go | 454 - .../quasilyte/regex/syntax/operation.go | 195 - .../regex/syntax/operation_string.go | 59 - .../quasilyte/regex/syntax/parser.go | 503 - .../github.com/quasilyte/regex/syntax/pos.go | 10 - .../regex/syntax/tokenkind_string.go | 59 - .../quasilyte/regex/syntax/utils.go | 30 - vendor/github.com/quasilyte/stdinfo/LICENSE | 21 - .../github.com/quasilyte/stdinfo/stdinfo.go | 30 - .../quasilyte/stdinfo/stdinfo_gen.go | 274 - vendor/github.com/rivo/uniseg/LICENSE.txt | 21 - vendor/github.com/rivo/uniseg/README.md | 137 - vendor/github.com/rivo/uniseg/doc.go | 108 - .../github.com/rivo/uniseg/eastasianwidth.go | 2588 -- .../rivo/uniseg/emojipresentation.go | 295 - .../github.com/rivo/uniseg/gen_breaktest.go | 215 - .../github.com/rivo/uniseg/gen_properties.go | 261 - vendor/github.com/rivo/uniseg/grapheme.go | 334 - .../rivo/uniseg/graphemeproperties.go | 1915 - .../github.com/rivo/uniseg/graphemerules.go | 176 - vendor/github.com/rivo/uniseg/line.go | 134 - .../github.com/rivo/uniseg/lineproperties.go | 3554 -- vendor/github.com/rivo/uniseg/linerules.go | 626 - vendor/github.com/rivo/uniseg/properties.go | 208 - vendor/github.com/rivo/uniseg/sentence.go | 90 - .../rivo/uniseg/sentenceproperties.go | 2845 -- .../github.com/rivo/uniseg/sentencerules.go | 276 - vendor/github.com/rivo/uniseg/step.go | 246 - vendor/github.com/rivo/uniseg/width.go | 61 - vendor/github.com/rivo/uniseg/word.go | 89 - .../github.com/rivo/uniseg/wordproperties.go | 1883 - vendor/github.com/rivo/uniseg/wordrules.go | 282 - .../github.com/rogpeppe/go-internal/LICENSE | 27 - .../rogpeppe/go-internal/fmtsort/mapelem.go | 20 - .../rogpeppe/go-internal/fmtsort/sort.go | 209 - .../russross/blackfriday/v2/.gitignore | 8 - .../russross/blackfriday/v2/.travis.yml | 17 - .../russross/blackfriday/v2/LICENSE.txt | 29 - .../russross/blackfriday/v2/README.md | 335 - .../russross/blackfriday/v2/block.go | 1612 - .../github.com/russross/blackfriday/v2/doc.go | 46 - .../russross/blackfriday/v2/entities.go | 2236 -- .../github.com/russross/blackfriday/v2/esc.go | 70 - .../russross/blackfriday/v2/html.go | 952 - .../russross/blackfriday/v2/inline.go | 1228 - .../russross/blackfriday/v2/markdown.go | 950 - .../russross/blackfriday/v2/node.go | 360 - .../russross/blackfriday/v2/smartypants.go | 457 - .../ryancurrah/gomodguard/.dockerignore | 1 - .../ryancurrah/gomodguard/.gitignore | 25 - .../ryancurrah/gomodguard/.golangci.yml | 111 - .../ryancurrah/gomodguard/.goreleaser.yml | 28 - .../ryancurrah/gomodguard/Dockerfile | 13 - .../gomodguard/Dockerfile.goreleaser | 6 - .../github.com/ryancurrah/gomodguard/LICENSE | 21 - .../github.com/ryancurrah/gomodguard/Makefile | 46 - .../ryancurrah/gomodguard/README.md | 131 - .../ryancurrah/gomodguard/allowed.go | 39 - .../ryancurrah/gomodguard/blocked.go | 189 - .../github.com/ryancurrah/gomodguard/issue.go | 20 - .../ryancurrah/gomodguard/processor.go | 291 - .../github.com/ryancurrah/gomodguard/tools.go | 5 - .../ryanrolds/sqlclosecheck/LICENSE | 19 - .../sqlclosecheck/pkg/analyzer/analyzer.go | 405 - .../sanposhiho/wastedassign/v2/LICENSE | 21 - .../sanposhiho/wastedassign/v2/README.md | 75 - .../wastedassign/v2/wastedassign.go | 272 - .../sashamelentyev/interfacebloat/LICENSE | 21 - .../interfacebloat/pkg/analyzer/analyzer.go | 57 - .../sashamelentyev/usestdlibvars/LICENSE | 21 - .../usestdlibvars/pkg/analyzer/analyzer.go | 569 - .../pkg/analyzer/internal/mapping/mapping.go | 202 - .../github.com/securego/gosec/v2/.gitignore | 39 - .../securego/gosec/v2/.golangci.yml | 45 - .../securego/gosec/v2/.goreleaser.yml | 36 - .../github.com/securego/gosec/v2/Dockerfile | 15 - .../github.com/securego/gosec/v2/LICENSE.txt | 154 - vendor/github.com/securego/gosec/v2/Makefile | 95 - vendor/github.com/securego/gosec/v2/README.md | 474 - vendor/github.com/securego/gosec/v2/USERS.md | 30 - .../github.com/securego/gosec/v2/action.yml | 19 - .../github.com/securego/gosec/v2/analyzer.go | 698 - .../gosec/v2/analyzers/slice_bounds.go | 386 - .../securego/gosec/v2/analyzers/util.go | 98 - .../github.com/securego/gosec/v2/call_list.go | 118 - vendor/github.com/securego/gosec/v2/config.go | 137 - .../github.com/securego/gosec/v2/cosign.pub | 4 - .../github.com/securego/gosec/v2/cwe/data.go | 140 - .../github.com/securego/gosec/v2/cwe/types.go | 38 - .../securego/gosec/v2/entrypoint.sh | 11 - vendor/github.com/securego/gosec/v2/errors.go | 33 - .../github.com/securego/gosec/v2/helpers.go | 519 - .../securego/gosec/v2/import_tracker.go | 70 - .../github.com/securego/gosec/v2/install.sh | 377 - .../securego/gosec/v2/issue/issue.go | 225 - .../securego/gosec/v2/renovate.json | 25 - vendor/github.com/securego/gosec/v2/report.go | 28 - .../github.com/securego/gosec/v2/resolve.go | 95 - vendor/github.com/securego/gosec/v2/rule.go | 72 - .../securego/gosec/v2/rules/archive.go | 66 - .../securego/gosec/v2/rules/bind.go | 84 - .../securego/gosec/v2/rules/blocklist.go | 95 - .../gosec/v2/rules/decompression-bomb.go | 111 - .../gosec/v2/rules/directory-traversal.go | 65 - .../securego/gosec/v2/rules/errors.go | 122 - .../securego/gosec/v2/rules/fileperms.go | 164 - .../gosec/v2/rules/hardcoded_credentials.go | 398 - .../securego/gosec/v2/rules/http_serve.go | 39 - .../gosec/v2/rules/implicit_aliasing.go | 142 - .../gosec/v2/rules/integer_overflow.go | 90 - .../securego/gosec/v2/rules/math_big_rat.go | 45 - .../securego/gosec/v2/rules/pprof.go | 43 - .../securego/gosec/v2/rules/rand.go | 59 - .../securego/gosec/v2/rules/readfile.go | 152 - .../github.com/securego/gosec/v2/rules/rsa.go | 59 - .../securego/gosec/v2/rules/rulelist.go | 130 - .../securego/gosec/v2/rules/slowloris.go | 71 - .../github.com/securego/gosec/v2/rules/sql.go | 405 - .../github.com/securego/gosec/v2/rules/ssh.go | 39 - .../securego/gosec/v2/rules/ssrf.go | 67 - .../securego/gosec/v2/rules/subproc.go | 123 - .../securego/gosec/v2/rules/tempfiles.go | 88 - .../securego/gosec/v2/rules/templates.go | 61 - .../github.com/securego/gosec/v2/rules/tls.go | 239 - .../securego/gosec/v2/rules/tls_config.go | 93 - .../securego/gosec/v2/rules/unsafe.go | 54 - .../securego/gosec/v2/rules/weakcrypto.go | 59 - vendor/github.com/sergi/go-diff/AUTHORS | 25 - vendor/github.com/sergi/go-diff/CONTRIBUTORS | 32 - vendor/github.com/sergi/go-diff/LICENSE | 20 - .../sergi/go-diff/diffmatchpatch/diff.go | 1352 - .../go-diff/diffmatchpatch/diffmatchpatch.go | 46 - .../sergi/go-diff/diffmatchpatch/match.go | 160 - .../sergi/go-diff/diffmatchpatch/mathutil.go | 23 - .../diffmatchpatch/operation_string.go | 17 - .../sergi/go-diff/diffmatchpatch/patch.go | 556 - .../go-diff/diffmatchpatch/stringutil.go | 106 - vendor/github.com/shazow/go-diff/LICENSE | 22 - .../shazow/go-diff/difflib/differ.go | 39 - .../github.com/shopspring/decimal/.gitignore | 9 - .../github.com/shopspring/decimal/.travis.yml | 19 - .../shopspring/decimal/CHANGELOG.md | 49 - vendor/github.com/shopspring/decimal/LICENSE | 45 - .../github.com/shopspring/decimal/README.md | 130 - .../shopspring/decimal/decimal-go.go | 415 - .../github.com/shopspring/decimal/decimal.go | 1904 - .../github.com/shopspring/decimal/rounding.go | 160 - .../sivchari/containedctx/.golangci.yml | 38 - .../github.com/sivchari/containedctx/LICENCE | 21 - .../sivchari/containedctx/README.md | 64 - .../sivchari/containedctx/containedctx.go | 45 - .../sivchari/nosnakecase/.gitignore | 15 - .../sivchari/nosnakecase/.golangci.yml | 40 - .../github.com/sivchari/nosnakecase/LICENSE | 21 - .../github.com/sivchari/nosnakecase/README.md | 224 - .../sivchari/nosnakecase/nosnakecase.go | 63 - vendor/github.com/sivchari/tenv/.gitignore | 17 - vendor/github.com/sivchari/tenv/.golangci.yml | 38 - vendor/github.com/sivchari/tenv/LICENSE | 21 - vendor/github.com/sivchari/tenv/README.md | 107 - vendor/github.com/sivchari/tenv/tenv.go | 213 - vendor/github.com/sivchari/tenv/tenv.png | Bin 247119 -> 0 bytes vendor/github.com/skeema/knownhosts/LICENSE | 201 - vendor/github.com/skeema/knownhosts/NOTICE | 13 - vendor/github.com/skeema/knownhosts/README.md | 117 - .../skeema/knownhosts/knownhosts.go | 182 - vendor/github.com/sonatard/noctx/.gitignore | 1 - .../github.com/sonatard/noctx/.golangci.yml | 14 - vendor/github.com/sonatard/noctx/LICENSE | 21 - vendor/github.com/sonatard/noctx/Makefile | 16 - vendor/github.com/sonatard/noctx/README.md | 174 - .../github.com/sonatard/noctx/ngfunc/main.go | 61 - .../sonatard/noctx/ngfunc/report.go | 29 - .../github.com/sonatard/noctx/ngfunc/types.go | 65 - vendor/github.com/sonatard/noctx/noctx.go | 35 - .../sonatard/noctx/reqwithoutctx/main.go | 14 - .../sonatard/noctx/reqwithoutctx/report.go | 26 - .../sonatard/noctx/reqwithoutctx/ssa.go | 185 - vendor/github.com/sourcegraph/go-diff/LICENSE | 46 - .../sourcegraph/go-diff/diff/diff.go | 136 - .../sourcegraph/go-diff/diff/doc.go | 2 - .../sourcegraph/go-diff/diff/parse.go | 865 - .../sourcegraph/go-diff/diff/print.go | 141 - .../sourcegraph/go-diff/diff/reader_util.go | 120 - vendor/github.com/spf13/cobra/doc/man_docs.go | 246 - vendor/github.com/spf13/cobra/doc/md_docs.go | 158 - .../github.com/spf13/cobra/doc/rest_docs.go | 186 - vendor/github.com/spf13/cobra/doc/util.go | 52 - .../github.com/spf13/cobra/doc/yaml_docs.go | 175 - vendor/github.com/ssgreg/nlreturn/v2/LICENSE | 21 - .../nlreturn/v2/pkg/nlreturn/nlreturn.go | 95 - .../stbenjam/no-sprintf-host-port/LICENSE | 21 - .../pkg/analyzer/analyzer.go | 96 - .../t-yuki/gocover-cobertura/.travis.yml | 12 - .../t-yuki/gocover-cobertura/LICENSE | 19 - .../t-yuki/gocover-cobertura/README.md | 35 - .../t-yuki/gocover-cobertura/cobertura.go | 178 - .../gocover-cobertura/gocover-cobertura.go | 176 - .../t-yuki/gocover-cobertura/profile.go | 202 - .../github.com/tdakkota/asciicheck/.gitignore | 32 - vendor/github.com/tdakkota/asciicheck/LICENSE | 21 - .../github.com/tdakkota/asciicheck/README.md | 72 - .../github.com/tdakkota/asciicheck/ascii.go | 21 - .../tdakkota/asciicheck/asciicheck.go | 49 - vendor/github.com/tetafro/godot/.gitignore | 5 - vendor/github.com/tetafro/godot/.godot.yaml | 16 - vendor/github.com/tetafro/godot/.golangci.yml | 80 - .../github.com/tetafro/godot/.goreleaser.yml | 11 - vendor/github.com/tetafro/godot/LICENSE | 21 - vendor/github.com/tetafro/godot/Makefile | 25 - vendor/github.com/tetafro/godot/README.md | 84 - vendor/github.com/tetafro/godot/checks.go | 296 - vendor/github.com/tetafro/godot/getters.go | 289 - vendor/github.com/tetafro/godot/godot.go | 129 - vendor/github.com/tetafro/godot/settings.go | 29 - .../tetratelabs/wazero/.editorconfig | 7 - .../tetratelabs/wazero/.gitattributes | 2 - .../github.com/tetratelabs/wazero/.gitignore | 41 - .../github.com/tetratelabs/wazero/.gitmodules | 3 - .../tetratelabs/wazero/CONTRIBUTING.md | 75 - vendor/github.com/tetratelabs/wazero/LICENSE | 201 - vendor/github.com/tetratelabs/wazero/Makefile | 347 - vendor/github.com/tetratelabs/wazero/NOTICE | 2 - .../tetratelabs/wazero/RATIONALE.md | 1107 - .../github.com/tetratelabs/wazero/README.md | 135 - .../tetratelabs/wazero/api/features.go | 212 - .../github.com/tetratelabs/wazero/api/wasm.go | 736 - .../github.com/tetratelabs/wazero/builder.go | 352 - vendor/github.com/tetratelabs/wazero/cache.go | 116 - .../github.com/tetratelabs/wazero/codecov.yml | 9 - .../github.com/tetratelabs/wazero/config.go | 870 - .../tetratelabs/wazero/config_supported.go | 14 - .../tetratelabs/wazero/config_unsupported.go | 8 - .../wazero/examples/basic/testdata/add.wasm | Bin 6093 -> 0 bytes .../wazero/experimental/experimental.go | 41 - .../wazero/experimental/gojs/README.md | 26 - .../wazero/experimental/gojs/gojs.go | 211 - .../wazero/experimental/listener.go | 361 - .../logging/testdata/listener.wasm | Bin 318 -> 0 bytes .../github.com/tetratelabs/wazero/fsconfig.go | 185 - .../imports/wasi_snapshot_preview1/args.go | 97 - .../imports/wasi_snapshot_preview1/clock.go | 116 - .../imports/wasi_snapshot_preview1/environ.go | 100 - .../imports/wasi_snapshot_preview1/fs.go | 1969 - .../imports/wasi_snapshot_preview1/poll.go | 251 - .../imports/wasi_snapshot_preview1/proc.go | 44 - .../imports/wasi_snapshot_preview1/random.go | 55 - .../imports/wasi_snapshot_preview1/sched.go | 22 - .../imports/wasi_snapshot_preview1/sock.go | 187 - .../testdata/cargo-wasi/Cargo.toml | 11 - .../testdata/cargo-wasi/wasi.rs | 89 - .../testdata/cargo-wasi/wasi.wasm | Bin 94484 -> 0 bytes .../testdata/exit_on_start.wasm | Bin 137 -> 0 bytes .../testdata/exit_on_start.wat | 9 - .../testdata/exit_on_start_unstable.wasm | Bin 128 -> 0 bytes .../testdata/exit_on_start_unstable.wat | 10 - .../testdata/gotip/wasi.go | 162 - .../testdata/print_args.wasm | Bin 219 -> 0 bytes .../testdata/print_args.wat | 61 - .../testdata/print_prestat_dirname.wasm | Bin 231 -> 0 bytes .../testdata/print_prestat_dirname.wat | 42 - .../testdata/zig-cc/wasi.c | 222 - .../testdata/zig-cc/wasi.wasm | Bin 62102 -> 0 bytes .../testdata/zig/build.zig | 16 - .../testdata/zig/wasi.wasm | Bin 10787 -> 0 bytes .../testdata/zig/wasi.zig | 50 - .../imports/wasi_snapshot_preview1/wasi.go | 314 - .../wazero/internal/asm/amd64/assembler.go | 98 - .../wazero/internal/asm/amd64/consts.go | 1248 - .../wazero/internal/asm/amd64/impl.go | 2812 -- .../internal/asm/amd64/impl_staticconst.go | 181 - .../wazero/internal/asm/arm64/assembler.go | 115 - .../wazero/internal/asm/arm64/consts.go | 1476 - .../wazero/internal/asm/arm64/impl.go | 3900 -- .../wazero/internal/asm/assembler.go | 209 - .../tetratelabs/wazero/internal/asm/buffer.go | 235 - .../tetratelabs/wazero/internal/asm/impl.go | 59 - .../wazero/internal/bitpack/offset_array.go | 224 - .../wazero/internal/descriptor/table.go | 164 - .../internal/engine/compiler/RATIONALE.md | 112 - .../wazero/internal/engine/compiler/arch.go | 19 - .../internal/engine/compiler/arch_amd64.go | 35 - .../internal/engine/compiler/arch_amd64.s | 9 - .../internal/engine/compiler/arch_arm64.go | 70 - .../internal/engine/compiler/arch_arm64.s | 21 - .../internal/engine/compiler/arch_other.go | 26 - .../internal/engine/compiler/arch_other.s | 3 - .../internal/engine/compiler/compiler.go | 335 - .../internal/engine/compiler/compiler_drop.go | 126 - .../compiler/compiler_value_location.go | 425 - .../wazero/internal/engine/compiler/engine.go | 1563 - .../internal/engine/compiler/engine_cache.go | 233 - .../internal/engine/compiler/impl_amd64.go | 5208 --- .../internal/engine/compiler/impl_arm64.go | 4355 --- .../engine/compiler/impl_vec_amd64.go | 2812 -- .../engine/compiler/impl_vec_arm64.go | 1592 - .../engine/interpreter/interpreter.go | 4147 -- .../internal/filecache/compilationcache.go | 42 - .../wazero/internal/filecache/file_cache.go | 91 - .../wazero/internal/fsapi/constants.go | 13 - .../wazero/internal/fsapi/constants_js.go | 8 - .../wazero/internal/fsapi/constants_sun.go | 12 - .../internal/fsapi/constants_windows.go | 24 - .../tetratelabs/wazero/internal/fsapi/dir.go | 99 - .../tetratelabs/wazero/internal/fsapi/file.go | 382 - .../tetratelabs/wazero/internal/fsapi/fs.go | 365 - .../tetratelabs/wazero/internal/fsapi/stat.go | 48 - .../wazero/internal/fsapi/unimplemented.go | 205 - .../wazero/internal/gojs/argsenv.go | 73 - .../wazero/internal/gojs/builtin.go | 58 - .../wazero/internal/gojs/config/config.go | 71 - .../wazero/internal/gojs/crypto.go | 31 - .../wazero/internal/gojs/custom/crypto.go | 17 - .../wazero/internal/gojs/custom/date.go | 17 - .../wazero/internal/gojs/custom/fs.go | 248 - .../wazero/internal/gojs/custom/names.go | 196 - .../wazero/internal/gojs/custom/process.go | 53 - .../tetratelabs/wazero/internal/gojs/errno.go | 113 - .../tetratelabs/wazero/internal/gojs/fs.go | 731 - .../wazero/internal/gojs/goarch/wasm.go | 180 - .../wazero/internal/gojs/goos/goos.go | 311 - .../tetratelabs/wazero/internal/gojs/http.go | 156 - .../tetratelabs/wazero/internal/gojs/js.go | 83 - .../wazero/internal/gojs/process.go | 103 - .../wazero/internal/gojs/run/gojs.go | 44 - .../wazero/internal/gojs/runtime.go | 165 - .../tetratelabs/wazero/internal/gojs/state.go | 243 - .../wazero/internal/gojs/syscall.go | 381 - .../tetratelabs/wazero/internal/gojs/time.go | 28 - .../wazero/internal/gojs/util/util.go | 70 - .../wazero/internal/gojs/values/values.go | 73 - .../wazero/internal/ieee754/ieee754.go | 29 - .../engine/testdata/infinite_loop.wasm | Bin 48 -> 0 bytes .../integration_test/vs/testdata/fac.wasm | Bin 146 -> 0 bytes .../vs/testdata/mem_grow.wasm | Bin 59 -> 0 bytes .../wazero/internal/internalapi/internal.go | 9 - .../wazero/internal/leb128/leb128.go | 285 - .../wazero/internal/moremath/moremath.go | 271 - .../wazero/internal/platform/cpuid_amd64.go | 79 - .../wazero/internal/platform/cpuid_amd64.s | 14 - .../wazero/internal/platform/crypto.go | 17 - .../wazero/internal/platform/errno.go | 9 - .../wazero/internal/platform/errno_windows.go | 72 - .../wazero/internal/platform/error.go | 52 - .../wazero/internal/platform/fdset.go | 23 - .../wazero/internal/platform/fdset_darwin.go | 8 - .../wazero/internal/platform/fdset_linux.go | 8 - .../internal/platform/fdset_unsupported.go | 10 - .../wazero/internal/platform/mmap_linux.go | 76 - .../wazero/internal/platform/mmap_other.go | 18 - .../wazero/internal/platform/mmap_unix.go | 47 - .../internal/platform/mmap_unsupported.go | 26 - .../wazero/internal/platform/mmap_windows.go | 106 - .../wazero/internal/platform/mremap_other.go | 23 - .../wazero/internal/platform/mremap_unix.go | 21 - .../wazero/internal/platform/path.go | 6 - .../wazero/internal/platform/path_windows.go | 17 - .../wazero/internal/platform/platform.go | 85 - .../internal/platform/platform_amd64.go | 7 - .../internal/platform/platform_arm64.go | 7 - .../wazero/internal/platform/time.go | 76 - .../wazero/internal/platform/time_cgo.go | 11 - .../wazero/internal/platform/time_notcgo.go | 7 - .../wazero/internal/platform/time_windows.go | 40 - .../tetratelabs/wazero/internal/sock/sock.go | 88 - .../tetratelabs/wazero/internal/sys/fs.go | 482 - .../tetratelabs/wazero/internal/sys/lazy.go | 136 - .../tetratelabs/wazero/internal/sys/stdio.go | 121 - .../tetratelabs/wazero/internal/sys/sys.go | 232 - .../wazero/internal/sys/testdata/empty.txt | 0 .../internal/sys/testdata/sub/sub/test.txt | 1 - .../wazero/internal/sys/testdata/sub/test.txt | 1 - .../wazero/internal/sys/testdata/test.txt | 1 - .../wazero/internal/sysfs/adapter.go | 78 - .../wazero/internal/sysfs/chown.go | 30 - .../wazero/internal/sysfs/chown_unix.go | 13 - .../internal/sysfs/chown_unsupported.go | 11 - .../wazero/internal/sysfs/datasync_linux.go | 14 - .../internal/sysfs/datasync_unsupported.go | 13 - .../tetratelabs/wazero/internal/sysfs/dir.go | 26 - .../wazero/internal/sysfs/dirfs.go | 146 - .../tetratelabs/wazero/internal/sysfs/file.go | 434 - .../wazero/internal/sysfs/file_test.go | 1061 - .../wazero/internal/sysfs/file_unix.go | 21 - .../wazero/internal/sysfs/file_unsupported.go | 12 - .../wazero/internal/sysfs/futimens.go | 132 - .../wazero/internal/sysfs/futimens_darwin.go | 49 - .../wazero/internal/sysfs/futimens_darwin.s | 8 - .../wazero/internal/sysfs/futimens_linux.go | 43 - .../internal/sysfs/futimens_unsupported.go | 23 - .../wazero/internal/sysfs/futimens_windows.go | 72 - .../wazero/internal/sysfs/nonblock_unix.go | 9 - .../wazero/internal/sysfs/nonblock_windows.go | 9 - .../wazero/internal/sysfs/open_file.go | 26 - .../wazero/internal/sysfs/open_file_js.go | 19 - .../wazero/internal/sysfs/open_file_sun.go | 21 - .../internal/sysfs/open_file_windows.go | 199 - .../wazero/internal/sysfs/osfile.go | 268 - .../wazero/internal/sysfs/readfs.go | 260 - .../wazero/internal/sysfs/rename.go | 16 - .../wazero/internal/sysfs/rename_windows.go | 47 - .../wazero/internal/sysfs/rootfs.go | 559 - .../wazero/internal/sysfs/select.go | 36 - .../wazero/internal/sysfs/select_darwin.go | 45 - .../wazero/internal/sysfs/select_darwin.s | 8 - .../wazero/internal/sysfs/select_linux.go | 18 - .../internal/sysfs/select_unsupported.go | 14 - .../wazero/internal/sysfs/select_windows.go | 127 - .../tetratelabs/wazero/internal/sysfs/sock.go | 37 - .../wazero/internal/sysfs/sock_unix.go | 155 - .../wazero/internal/sysfs/sock_unsupported.go | 26 - .../wazero/internal/sysfs/sock_windows.go | 192 - .../tetratelabs/wazero/internal/sysfs/stat.go | 32 - .../wazero/internal/sysfs/stat_bsd.go | 60 - .../wazero/internal/sysfs/stat_linux.go | 63 - .../wazero/internal/sysfs/stat_unsupported.go | 42 - .../wazero/internal/sysfs/stat_windows.go | 142 - .../tetratelabs/wazero/internal/sysfs/sync.go | 14 - .../wazero/internal/sysfs/sync_windows.go | 21 - .../wazero/internal/sysfs/syscall6_darwin.go | 13 - .../wazero/internal/sysfs/sysfs.go | 6 - .../wazero/internal/sysfs/testdata/empty.txt | 0 .../wazero/internal/sysfs/testdata/wazero.txt | 1 - .../wazero/internal/sysfs/unlink.go | 17 - .../wazero/internal/sysfs/unlink_windows.go | 27 - .../tetratelabs/wazero/internal/u32/u32.go | 11 - .../tetratelabs/wazero/internal/u64/u64.go | 15 - .../wazero/internal/version/version.go | 52 - .../wazero/internal/wasip1/args.go | 6 - .../wazero/internal/wasip1/clock.go | 16 - .../wazero/internal/wasip1/environ.go | 6 - .../wazero/internal/wasip1/errno.go | 311 - .../tetratelabs/wazero/internal/wasip1/fs.go | 164 - .../wazero/internal/wasip1/poll.go | 15 - .../wazero/internal/wasip1/proc.go | 6 - .../wazero/internal/wasip1/random.go | 3 - .../wazero/internal/wasip1/rights.go | 148 - .../wazero/internal/wasip1/sched.go | 3 - .../wazero/internal/wasip1/sock.go | 71 - .../wazero/internal/wasip1/wasi.go | 26 - .../wazero/internal/wasm/binary/code.go | 100 - .../wazero/internal/wasm/binary/const_expr.go | 105 - .../wazero/internal/wasm/binary/custom.go | 22 - .../wazero/internal/wasm/binary/data.go | 79 - .../wazero/internal/wasm/binary/decoder.go | 193 - .../wazero/internal/wasm/binary/element.go | 272 - .../wazero/internal/wasm/binary/errors.go | 11 - .../wazero/internal/wasm/binary/export.go | 32 - .../wazero/internal/wasm/binary/function.go | 56 - .../wazero/internal/wasm/binary/global.go | 50 - .../wazero/internal/wasm/binary/header.go | 9 - .../wazero/internal/wasm/binary/import.go | 52 - .../wazero/internal/wasm/binary/limits.go | 42 - .../wazero/internal/wasm/binary/memory.go | 26 - .../wazero/internal/wasm/binary/names.go | 151 - .../wazero/internal/wasm/binary/section.go | 225 - .../wazero/internal/wasm/binary/table.go | 39 - .../wazero/internal/wasm/binary/value.go | 60 - .../wazero/internal/wasm/counts.go | 51 - .../wazero/internal/wasm/engine.go | 54 - .../wazero/internal/wasm/func_validation.go | 1954 - .../internal/wasm/function_definition.go | 188 - .../wazero/internal/wasm/global.go | 56 - .../wazero/internal/wasm/gofunc.go | 279 - .../tetratelabs/wazero/internal/wasm/host.go | 179 - .../wazero/internal/wasm/instruction.go | 1550 - .../wazero/internal/wasm/memory.go | 286 - .../wazero/internal/wasm/memory_definition.go | 128 - .../wazero/internal/wasm/module.go | 1060 - .../wazero/internal/wasm/module_instance.go | 238 - .../tetratelabs/wazero/internal/wasm/store.go | 618 - .../wazero/internal/wasm/store_module_list.go | 97 - .../tetratelabs/wazero/internal/wasm/table.go | 340 - .../wazero/internal/wasmdebug/debug.go | 157 - .../wazero/internal/wasmdebug/dwarf.go | 226 - .../wazero/internal/wasmruntime/errors.go | 44 - .../wazero/internal/wazeroir/compiler.go | 3068 -- .../wazero/internal/wazeroir/format.go | 24 - .../wazero/internal/wazeroir/operations.go | 2567 -- .../wazero/internal/wazeroir/signature.go | 713 - .../wazero/internal/wazeroir/wazeroir.go | 8 - .../tetratelabs/wazero/netlify.toml | 15 - .../github.com/tetratelabs/wazero/runtime.go | 370 - .../tetratelabs/wazero/sys/clock.go | 26 - .../tetratelabs/wazero/sys/error.go | 83 - .../tetratelabs/wazero/testdata/index.html | 2 - vendor/github.com/timakin/bodyclose/LICENSE | 21 - .../bodyclose/passes/bodyclose/bodyclose.go | 388 - .../timonwong/loggercheck/.codecov.yml | 16 - .../timonwong/loggercheck/.gitignore | 9 - .../timonwong/loggercheck/.golangci.yml | 94 - .../timonwong/loggercheck/.goreleaser.yml | 59 - .../github.com/timonwong/loggercheck/LICENSE | 21 - .../github.com/timonwong/loggercheck/Makefile | 22 - .../timonwong/loggercheck/README.md | 103 - .../internal/bytebufferpool/pool.go | 22 - .../loggercheck/internal/checkers/checker.go | 59 - .../loggercheck/internal/checkers/common.go | 49 - .../loggercheck/internal/checkers/general.go | 68 - .../internal/checkers/printf/printf.go | 252 - .../loggercheck/internal/checkers/zap.go | 42 - .../loggercheck/internal/rules/rules.go | 201 - .../loggercheck/internal/sets/string.go | 59 - .../loggercheck/internal/stringutil/is.go | 15 - .../timonwong/loggercheck/loggercheck.go | 196 - .../timonwong/loggercheck/options.go | 31 - .../timonwong/loggercheck/staticrules.go | 68 - .../github.com/tomarrell/wrapcheck/v2/LICENSE | 21 - .../wrapcheck/v2/wrapcheck/wrapcheck.go | 439 - .../tommy-muehle/go-mnd/v2/.editorconfig | 21 - .../tommy-muehle/go-mnd/v2/.gitattributes | 9 - .../tommy-muehle/go-mnd/v2/.gitignore | 3 - .../tommy-muehle/go-mnd/v2/.goreleaser.yml | 54 - .../tommy-muehle/go-mnd/v2/Dockerfile | 17 - .../github.com/tommy-muehle/go-mnd/v2/LICENSE | 21 - .../tommy-muehle/go-mnd/v2/Makefile | 32 - .../tommy-muehle/go-mnd/v2/README.md | 230 - .../tommy-muehle/go-mnd/v2/action.yml | 19 - .../tommy-muehle/go-mnd/v2/analyzer.go | 118 - .../tommy-muehle/go-mnd/v2/checks/argument.go | 125 - .../tommy-muehle/go-mnd/v2/checks/assign.go | 86 - .../tommy-muehle/go-mnd/v2/checks/case.go | 68 - .../tommy-muehle/go-mnd/v2/checks/checks.go | 3 - .../go-mnd/v2/checks/condition.go | 55 - .../go-mnd/v2/checks/operation.go | 77 - .../tommy-muehle/go-mnd/v2/checks/return.go | 68 - .../tommy-muehle/go-mnd/v2/config/config.go | 124 - .../tommy-muehle/go-mnd/v2/entrypoint.sh | 7 - .../toqueteos/webbrowser/.travis.yml | 9 - .../toqueteos/webbrowser/CONTRIBUTING.md | 11 - .../toqueteos/webbrowser/LICENSE.md | 19 - .../github.com/toqueteos/webbrowser/README.md | 56 - .../toqueteos/webbrowser/webbrowser.go | 137 - vendor/github.com/ulikunitz/xz/.gitignore | 28 - vendor/github.com/ulikunitz/xz/LICENSE | 26 - vendor/github.com/ulikunitz/xz/README.md | 77 - vendor/github.com/ulikunitz/xz/SECURITY.md | 10 - vendor/github.com/ulikunitz/xz/TODO.md | 372 - vendor/github.com/ulikunitz/xz/bits.go | 79 - vendor/github.com/ulikunitz/xz/crc.go | 54 - vendor/github.com/ulikunitz/xz/format.go | 721 - .../github.com/ulikunitz/xz/fox-check-none.xz | Bin 96 -> 0 bytes vendor/github.com/ulikunitz/xz/fox.xz | Bin 104 -> 0 bytes .../ulikunitz/xz/internal/hash/cyclic_poly.go | 181 - .../ulikunitz/xz/internal/hash/doc.go | 14 - .../ulikunitz/xz/internal/hash/rabin_karp.go | 66 - .../ulikunitz/xz/internal/hash/roller.go | 29 - .../ulikunitz/xz/internal/xlog/xlog.go | 456 - .../github.com/ulikunitz/xz/lzma/bintree.go | 522 - vendor/github.com/ulikunitz/xz/lzma/bitops.go | 47 - .../github.com/ulikunitz/xz/lzma/breader.go | 39 - vendor/github.com/ulikunitz/xz/lzma/buffer.go | 171 - .../ulikunitz/xz/lzma/bytewriter.go | 37 - .../github.com/ulikunitz/xz/lzma/decoder.go | 277 - .../ulikunitz/xz/lzma/decoderdict.go | 128 - .../ulikunitz/xz/lzma/directcodec.go | 38 - .../github.com/ulikunitz/xz/lzma/distcodec.go | 140 - .../github.com/ulikunitz/xz/lzma/encoder.go | 268 - .../ulikunitz/xz/lzma/encoderdict.go | 149 - vendor/github.com/ulikunitz/xz/lzma/fox.lzma | Bin 67 -> 0 bytes .../github.com/ulikunitz/xz/lzma/hashtable.go | 309 - vendor/github.com/ulikunitz/xz/lzma/header.go | 167 - .../github.com/ulikunitz/xz/lzma/header2.go | 398 - .../ulikunitz/xz/lzma/lengthcodec.go | 115 - .../ulikunitz/xz/lzma/literalcodec.go | 125 - .../ulikunitz/xz/lzma/matchalgorithm.go | 52 - .../github.com/ulikunitz/xz/lzma/operation.go | 55 - vendor/github.com/ulikunitz/xz/lzma/prob.go | 53 - .../ulikunitz/xz/lzma/properties.go | 69 - .../ulikunitz/xz/lzma/rangecodec.go | 222 - vendor/github.com/ulikunitz/xz/lzma/reader.go | 100 - .../github.com/ulikunitz/xz/lzma/reader2.go | 231 - vendor/github.com/ulikunitz/xz/lzma/state.go | 145 - .../ulikunitz/xz/lzma/treecodecs.go | 133 - vendor/github.com/ulikunitz/xz/lzma/writer.go | 209 - .../github.com/ulikunitz/xz/lzma/writer2.go | 305 - vendor/github.com/ulikunitz/xz/lzmafilter.go | 117 - vendor/github.com/ulikunitz/xz/make-docs | 5 - vendor/github.com/ulikunitz/xz/none-check.go | 23 - vendor/github.com/ulikunitz/xz/reader.go | 359 - vendor/github.com/ulikunitz/xz/writer.go | 399 - vendor/github.com/ultraware/funlen/LICENSE | 7 - vendor/github.com/ultraware/funlen/README.md | 47 - vendor/github.com/ultraware/funlen/main.go | 124 - .../github.com/ultraware/whitespace/LICENSE | 7 - .../github.com/ultraware/whitespace/README.md | 9 - .../ultraware/whitespace/whitespace.go | 307 - vendor/github.com/uudashr/gocognit/LICENSE | 21 - vendor/github.com/uudashr/gocognit/README.md | 226 - vendor/github.com/uudashr/gocognit/doc.go | 2 - .../github.com/uudashr/gocognit/gocognit.go | 399 - vendor/github.com/uudashr/gocognit/recv.go | 24 - .../uudashr/gocognit/recv_pre118.go | 20 - vendor/github.com/vbatts/tar-split/LICENSE | 28 - .../vbatts/tar-split/archive/tar/common.go | 723 - .../vbatts/tar-split/archive/tar/format.go | 303 - .../vbatts/tar-split/archive/tar/reader.go | 925 - .../tar-split/archive/tar/stat_actime1.go | 20 - .../tar-split/archive/tar/stat_actime2.go | 20 - .../vbatts/tar-split/archive/tar/stat_unix.go | 96 - .../vbatts/tar-split/archive/tar/strconv.go | 326 - .../vbatts/tar-split/archive/tar/writer.go | 653 - vendor/github.com/xanzy/ssh-agent/.gitignore | 24 - vendor/github.com/xanzy/ssh-agent/LICENSE | 202 - vendor/github.com/xanzy/ssh-agent/README.md | 23 - .../xanzy/ssh-agent/pageant_windows.go | 149 - vendor/github.com/xanzy/ssh-agent/sshagent.go | 50 - .../xanzy/ssh-agent/sshagent_windows.go | 104 - .../xen0n/gosmopolitan/.editorconfig | 23 - .../github.com/xen0n/gosmopolitan/.gitignore | 188 - .../xen0n/gosmopolitan/.golangci.yml | 31 - vendor/github.com/xen0n/gosmopolitan/LICENSE | 674 - .../github.com/xen0n/gosmopolitan/README.md | 84 - .../xen0n/gosmopolitan/README.zh-Hans.md | 69 - vendor/github.com/xen0n/gosmopolitan/lib.go | 385 - vendor/github.com/yagipy/maintidx/.gitignore | 2 - vendor/github.com/yagipy/maintidx/LICENSE | 21 - vendor/github.com/yagipy/maintidx/Makefile | 2 - vendor/github.com/yagipy/maintidx/README.md | 45 - vendor/github.com/yagipy/maintidx/maintidx.go | 63 - .../github.com/yagipy/maintidx/pkg/cyc/cyc.go | 36 - .../yagipy/maintidx/pkg/halstvol/halstvol.go | 71 - .../yagipy/maintidx/pkg/halstvol/handle.go | 151 - vendor/github.com/yagipy/maintidx/visitor.go | 77 - .../github.com/yeya24/promlinter/.gitignore | 20 - vendor/github.com/yeya24/promlinter/LICENSE | 201 - vendor/github.com/yeya24/promlinter/Makefile | 39 - vendor/github.com/yeya24/promlinter/README.md | 80 - .../yeya24/promlinter/promlinter.go | 668 - .../ykadowak/zerologlint/.goreleaser.yaml | 24 - .../github.com/ykadowak/zerologlint/LICENSE | 21 - .../github.com/ykadowak/zerologlint/README.md | 63 - .../ykadowak/zerologlint/zerologlint.go | 261 - vendor/gitlab.com/bosi/decorder/.gitignore | 7 - .../bosi/decorder/.gitlab-ci.params.yml | 15 - .../gitlab.com/bosi/decorder/.gitlab-ci.yml | 63 - vendor/gitlab.com/bosi/decorder/LICENSE.md | 16 - vendor/gitlab.com/bosi/decorder/Makefile | 7 - vendor/gitlab.com/bosi/decorder/README.md | 50 - vendor/gitlab.com/bosi/decorder/analyzer.go | 255 - vendor/gitlab.com/bosi/decorder/renovate.json | 7 - .../go-conventional-commit/.gitignore | 21 - .../go-conventional-commit/LICENSE | 13 - .../go-conventional-commit/Makefile | 48 - .../go-conventional-commit/README.md | 3 - .../conventional_commits.go | 112 - .../go-conventional-commit/types.go | 116 - vendor/go-simpler.org/sloglint/.golangci.yml | 22 - .../go-simpler.org/sloglint/.goreleaser.yml | 18 - vendor/go-simpler.org/sloglint/LICENSE | 373 - vendor/go-simpler.org/sloglint/README.md | 165 - vendor/go-simpler.org/sloglint/sloglint.go | 347 - vendor/go.mongodb.org/mongo-driver/LICENSE | 201 - .../go.mongodb.org/mongo-driver/bson/bson.go | 50 - .../bson/bsoncodec/array_codec.go | 50 - .../mongo-driver/bson/bsoncodec/bsoncodec.go | 238 - .../bson/bsoncodec/byte_slice_codec.go | 111 - .../bson/bsoncodec/cond_addr_codec.go | 63 - .../bson/bsoncodec/default_value_decoders.go | 1729 - .../bson/bsoncodec/default_value_encoders.go | 766 - .../mongo-driver/bson/bsoncodec/doc.go | 90 - .../bson/bsoncodec/empty_interface_codec.go | 147 - .../mongo-driver/bson/bsoncodec/map_codec.go | 309 - .../mongo-driver/bson/bsoncodec/mode.go | 65 - .../bson/bsoncodec/pointer_codec.go | 109 - .../mongo-driver/bson/bsoncodec/proxy.go | 14 - .../mongo-driver/bson/bsoncodec/registry.go | 469 - .../bson/bsoncodec/slice_codec.go | 199 - .../bson/bsoncodec/string_codec.go | 119 - .../bson/bsoncodec/struct_codec.go | 664 - .../bson/bsoncodec/struct_tag_parser.go | 139 - .../mongo-driver/bson/bsoncodec/time_codec.go | 127 - .../mongo-driver/bson/bsoncodec/types.go | 57 - .../mongo-driver/bson/bsoncodec/uint_codec.go | 173 - .../bsonoptions/byte_slice_codec_options.go | 38 - .../mongo-driver/bson/bsonoptions/doc.go | 8 - .../empty_interface_codec_options.go | 38 - .../bson/bsonoptions/map_codec_options.go | 67 - .../bson/bsonoptions/slice_codec_options.go | 38 - .../bson/bsonoptions/string_codec_options.go | 41 - .../bson/bsonoptions/struct_codec_options.go | 87 - .../bson/bsonoptions/time_codec_options.go | 38 - .../bson/bsonoptions/uint_codec_options.go | 38 - .../mongo-driver/bson/bsonrw/copier.go | 445 - .../mongo-driver/bson/bsonrw/doc.go | 9 - .../bson/bsonrw/extjson_parser.go | 806 - .../bson/bsonrw/extjson_reader.go | 644 - .../bson/bsonrw/extjson_tables.go | 223 - .../bson/bsonrw/extjson_wrappers.go | 492 - .../bson/bsonrw/extjson_writer.go | 732 - .../mongo-driver/bson/bsonrw/json_scanner.go | 528 - .../mongo-driver/bson/bsonrw/mode.go | 108 - .../mongo-driver/bson/bsonrw/reader.go | 63 - .../mongo-driver/bson/bsonrw/value_reader.go | 874 - .../mongo-driver/bson/bsonrw/value_writer.go | 606 - .../mongo-driver/bson/bsonrw/writer.go | 78 - .../mongo-driver/bson/bsontype/bsontype.go | 97 - .../mongo-driver/bson/decoder.go | 141 - .../go.mongodb.org/mongo-driver/bson/doc.go | 141 - .../mongo-driver/bson/encoder.go | 99 - .../mongo-driver/bson/marshal.go | 248 - .../mongo-driver/bson/primitive/decimal.go | 423 - .../mongo-driver/bson/primitive/objectid.go | 206 - .../mongo-driver/bson/primitive/primitive.go | 217 - .../mongo-driver/bson/primitive_codecs.go | 92 - .../go.mongodb.org/mongo-driver/bson/raw.go | 85 - .../mongo-driver/bson/raw_element.go | 51 - .../mongo-driver/bson/raw_value.go | 309 - .../mongo-driver/bson/registry.go | 24 - .../go.mongodb.org/mongo-driver/bson/types.go | 36 - .../mongo-driver/bson/unmarshal.go | 101 - .../mongo-driver/x/bsonx/bsoncore/array.go | 164 - .../x/bsonx/bsoncore/bson_arraybuilder.go | 201 - .../x/bsonx/bsoncore/bson_documentbuilder.go | 189 - .../mongo-driver/x/bsonx/bsoncore/bsoncore.go | 862 - .../mongo-driver/x/bsonx/bsoncore/document.go | 386 - .../x/bsonx/bsoncore/document_sequence.go | 189 - .../mongo-driver/x/bsonx/bsoncore/element.go | 152 - .../mongo-driver/x/bsonx/bsoncore/tables.go | 223 - .../mongo-driver/x/bsonx/bsoncore/value.go | 980 - .../go.opentelemetry.io/otel/.codespellignore | 5 - vendor/go.opentelemetry.io/otel/.codespellrc | 10 - .../go.opentelemetry.io/otel/.gitattributes | 3 - vendor/go.opentelemetry.io/otel/.gitignore | 22 - vendor/go.opentelemetry.io/otel/.gitmodules | 3 - vendor/go.opentelemetry.io/otel/.golangci.yml | 296 - vendor/go.opentelemetry.io/otel/.lycheeignore | 6 - .../otel/.markdownlint.yaml | 29 - vendor/go.opentelemetry.io/otel/CHANGELOG.md | 2818 -- vendor/go.opentelemetry.io/otel/CODEOWNERS | 17 - .../go.opentelemetry.io/otel/CONTRIBUTING.md | 624 - vendor/go.opentelemetry.io/otel/LICENSE | 201 - vendor/go.opentelemetry.io/otel/Makefile | 318 - vendor/go.opentelemetry.io/otel/README.md | 108 - vendor/go.opentelemetry.io/otel/RELEASING.md | 139 - vendor/go.opentelemetry.io/otel/VERSIONING.md | 224 - .../go.opentelemetry.io/otel/attribute/doc.go | 16 - .../otel/attribute/encoder.go | 146 - .../otel/attribute/filter.go | 60 - .../otel/attribute/iterator.go | 161 - .../go.opentelemetry.io/otel/attribute/key.go | 134 - .../go.opentelemetry.io/otel/attribute/kv.go | 86 - .../go.opentelemetry.io/otel/attribute/set.go | 429 - .../otel/attribute/type_string.go | 31 - .../otel/attribute/value.go | 270 - .../otel/baggage/baggage.go | 552 - .../otel/baggage/context.go | 39 - .../go.opentelemetry.io/otel/baggage/doc.go | 20 - .../go.opentelemetry.io/otel/codes/codes.go | 116 - vendor/go.opentelemetry.io/otel/codes/doc.go | 21 - vendor/go.opentelemetry.io/otel/doc.go | 34 - .../go.opentelemetry.io/otel/error_handler.go | 38 - .../go.opentelemetry.io/otel/get_main_pkgs.sh | 41 - vendor/go.opentelemetry.io/otel/handler.go | 48 - .../otel/internal/attribute/attribute.go | 111 - .../otel/internal/baggage/baggage.go | 43 - .../otel/internal/baggage/context.go | 92 - .../go.opentelemetry.io/otel/internal/gen.go | 29 - .../otel/internal/global/handler.go | 102 - .../otel/internal/global/instruments.go | 371 - .../otel/internal/global/internal_logging.go | 69 - .../otel/internal/global/meter.go | 354 - .../otel/internal/global/propagator.go | 82 - .../otel/internal/global/state.go | 156 - .../otel/internal/global/trace.go | 199 - .../otel/internal/rawhelpers.go | 55 - .../otel/internal_logging.go | 26 - vendor/go.opentelemetry.io/otel/metric.go | 53 - .../go.opentelemetry.io/otel/metric/LICENSE | 201 - .../otel/metric/asyncfloat64.go | 271 - .../otel/metric/asyncint64.go | 269 - .../go.opentelemetry.io/otel/metric/config.go | 92 - vendor/go.opentelemetry.io/otel/metric/doc.go | 170 - .../otel/metric/embedded/embedded.go | 234 - .../otel/metric/instrument.go | 357 - .../go.opentelemetry.io/otel/metric/meter.go | 212 - .../otel/metric/noop/noop.go | 264 - .../otel/metric/syncfloat64.go | 185 - .../otel/metric/syncint64.go | 185 - .../go.opentelemetry.io/otel/propagation.go | 31 - .../otel/propagation/baggage.go | 58 - .../otel/propagation/doc.go | 24 - .../otel/propagation/propagation.go | 153 - .../otel/propagation/trace_context.go | 161 - .../go.opentelemetry.io/otel/requirements.txt | 1 - vendor/go.opentelemetry.io/otel/sdk/LICENSE | 201 - .../otel/sdk/instrumentation/doc.go | 24 - .../otel/sdk/instrumentation/library.go | 19 - .../otel/sdk/instrumentation/scope.go | 26 - .../otel/sdk/internal/env/env.go | 177 - .../otel/sdk/internal/gen.go | 29 - .../otel/sdk/internal/internal.go | 28 - .../otel/sdk/resource/auto.go | 108 - .../otel/sdk/resource/builtin.go | 108 - .../otel/sdk/resource/config.go | 206 - .../otel/sdk/resource/container.go | 100 - .../otel/sdk/resource/doc.go | 31 - .../otel/sdk/resource/env.go | 106 - .../otel/sdk/resource/host_id.go | 120 - .../otel/sdk/resource/host_id_bsd.go | 23 - .../otel/sdk/resource/host_id_darwin.go | 19 - .../otel/sdk/resource/host_id_exec.go | 29 - .../otel/sdk/resource/host_id_linux.go | 22 - .../otel/sdk/resource/host_id_readfile.go | 28 - .../otel/sdk/resource/host_id_unsupported.go | 36 - .../otel/sdk/resource/host_id_windows.go | 48 - .../otel/sdk/resource/os.go | 100 - .../otel/sdk/resource/os_release_darwin.go | 102 - .../otel/sdk/resource/os_release_unix.go | 154 - .../otel/sdk/resource/os_unix.go | 90 - .../otel/sdk/resource/os_unsupported.go | 34 - .../otel/sdk/resource/os_windows.go | 101 - .../otel/sdk/resource/process.go | 184 - .../otel/sdk/resource/resource.go | 271 - .../otel/sdk/trace/batch_span_processor.go | 420 - .../go.opentelemetry.io/otel/sdk/trace/doc.go | 21 - .../otel/sdk/trace/event.go | 37 - .../otel/sdk/trace/evictedqueue.go | 44 - .../otel/sdk/trace/id_generator.go | 77 - .../otel/sdk/trace/link.go | 34 - .../otel/sdk/trace/provider.go | 504 - .../otel/sdk/trace/sampler_env.go | 108 - .../otel/sdk/trace/sampling.go | 293 - .../otel/sdk/trace/simple_span_processor.go | 131 - .../otel/sdk/trace/snapshot.go | 144 - .../otel/sdk/trace/span.go | 835 - .../otel/sdk/trace/span_exporter.go | 47 - .../otel/sdk/trace/span_limits.go | 125 - .../otel/sdk/trace/span_processor.go | 72 - .../otel/sdk/trace/tracer.go | 164 - .../otel/sdk/trace/version.go | 20 - .../go.opentelemetry.io/otel/sdk/version.go | 20 - .../otel/semconv/internal/http.go | 338 - .../otel/semconv/v1.12.0/doc.go | 20 - .../otel/semconv/v1.12.0/exception.go | 20 - .../otel/semconv/v1.12.0/http.go | 114 - .../otel/semconv/v1.12.0/resource.go | 1042 - .../otel/semconv/v1.12.0/schema.go | 20 - .../otel/semconv/v1.12.0/trace.go | 1704 - .../otel/semconv/v1.21.0/attribute_group.go | 1877 - vendor/go.opentelemetry.io/otel/trace.go | 47 - vendor/go.opentelemetry.io/otel/trace/LICENSE | 201 - .../go.opentelemetry.io/otel/trace/config.go | 334 - .../go.opentelemetry.io/otel/trace/context.go | 61 - vendor/go.opentelemetry.io/otel/trace/doc.go | 130 - .../otel/trace/embedded/embedded.go | 56 - .../otel/trace/nonrecording.go | 27 - vendor/go.opentelemetry.io/otel/trace/noop.go | 93 - .../otel/trace/noop/noop.go | 118 - .../go.opentelemetry.io/otel/trace/trace.go | 577 - .../otel/trace/tracestate.go | 222 - .../otel/verify_examples.sh | 85 - vendor/go.opentelemetry.io/otel/version.go | 20 - vendor/go.opentelemetry.io/otel/versions.yaml | 52 - vendor/go.tmz.dev/musttag/.golangci.yml | 23 - vendor/go.tmz.dev/musttag/.goreleaser.yml | 27 - vendor/go.tmz.dev/musttag/LICENSE | 373 - vendor/go.tmz.dev/musttag/README.md | 106 - vendor/go.tmz.dev/musttag/builtins.go | 67 - vendor/go.tmz.dev/musttag/musttag.go | 259 - vendor/go.tmz.dev/musttag/utils.go | 57 - vendor/go.uber.org/mock/CONTRIBUTORS | 37 - vendor/go.uber.org/mock/gomock/controller.go | 2 + vendor/go.uber.org/mock/gomock/matchers.go | 75 + .../go.uber.org/mock/mockgen/generic_go118.go | 116 - .../mock/mockgen/generic_notgo118.go | 41 - vendor/go.uber.org/mock/mockgen/mockgen.go | 870 - .../go.uber.org/mock/mockgen/model/model.go | 533 - vendor/go.uber.org/mock/mockgen/parse.go | 802 - vendor/go.uber.org/mock/mockgen/reflect.go | 255 - vendor/go.uber.org/mock/mockgen/version.go | 31 - vendor/go.uber.org/zap/.codecov.yml | 17 - vendor/go.uber.org/zap/.gitignore | 32 - vendor/go.uber.org/zap/.golangci.yml | 77 - vendor/go.uber.org/zap/.readme.tmpl | 109 - vendor/go.uber.org/zap/CHANGELOG.md | 671 - vendor/go.uber.org/zap/CODE_OF_CONDUCT.md | 75 - vendor/go.uber.org/zap/CONTRIBUTING.md | 70 - vendor/go.uber.org/zap/FAQ.md | 164 - vendor/go.uber.org/zap/LICENSE.txt | 19 - vendor/go.uber.org/zap/Makefile | 76 - vendor/go.uber.org/zap/README.md | 137 - vendor/go.uber.org/zap/array.go | 447 - vendor/go.uber.org/zap/buffer/buffer.go | 146 - vendor/go.uber.org/zap/buffer/pool.go | 53 - vendor/go.uber.org/zap/checklicense.sh | 17 - vendor/go.uber.org/zap/config.go | 330 - vendor/go.uber.org/zap/doc.go | 117 - vendor/go.uber.org/zap/encoder.go | 79 - vendor/go.uber.org/zap/error.go | 82 - vendor/go.uber.org/zap/field.go | 613 - vendor/go.uber.org/zap/flag.go | 39 - vendor/go.uber.org/zap/glide.yaml | 34 - vendor/go.uber.org/zap/global.go | 169 - vendor/go.uber.org/zap/http_handler.go | 140 - .../zap/internal/bufferpool/bufferpool.go | 31 - .../go.uber.org/zap/internal/color/color.go | 44 - vendor/go.uber.org/zap/internal/exit/exit.go | 66 - .../go.uber.org/zap/internal/level_enabler.go | 37 - vendor/go.uber.org/zap/internal/pool/pool.go | 58 - .../zap/internal/stacktrace/stack.go | 181 - vendor/go.uber.org/zap/level.go | 153 - vendor/go.uber.org/zap/logger.go | 432 - vendor/go.uber.org/zap/options.go | 167 - vendor/go.uber.org/zap/sink.go | 180 - vendor/go.uber.org/zap/sugar.go | 437 - vendor/go.uber.org/zap/time.go | 27 - vendor/go.uber.org/zap/writer.go | 98 - .../zap/zapcore/buffered_write_syncer.go | 219 - vendor/go.uber.org/zap/zapcore/clock.go | 48 - .../zap/zapcore/console_encoder.go | 157 - vendor/go.uber.org/zap/zapcore/core.go | 122 - vendor/go.uber.org/zap/zapcore/doc.go | 24 - vendor/go.uber.org/zap/zapcore/encoder.go | 451 - vendor/go.uber.org/zap/zapcore/entry.go | 298 - vendor/go.uber.org/zap/zapcore/error.go | 136 - vendor/go.uber.org/zap/zapcore/field.go | 233 - vendor/go.uber.org/zap/zapcore/hook.go | 77 - .../go.uber.org/zap/zapcore/increase_level.go | 75 - .../go.uber.org/zap/zapcore/json_encoder.go | 583 - vendor/go.uber.org/zap/zapcore/lazy_with.go | 54 - vendor/go.uber.org/zap/zapcore/level.go | 229 - .../go.uber.org/zap/zapcore/level_strings.go | 46 - vendor/go.uber.org/zap/zapcore/marshaler.go | 61 - .../go.uber.org/zap/zapcore/memory_encoder.go | 179 - .../zap/zapcore/reflected_encoder.go | 41 - vendor/go.uber.org/zap/zapcore/sampler.go | 229 - vendor/go.uber.org/zap/zapcore/tee.go | 96 - .../go.uber.org/zap/zapcore/write_syncer.go | 122 - vendor/golang.org/x/crypto/LICENSE | 27 - vendor/golang.org/x/crypto/PATENTS | 22 - vendor/golang.org/x/crypto/argon2/argon2.go | 283 - vendor/golang.org/x/crypto/argon2/blake2b.go | 53 - .../x/crypto/argon2/blamka_amd64.go | 60 - .../golang.org/x/crypto/argon2/blamka_amd64.s | 243 - .../x/crypto/argon2/blamka_generic.go | 163 - .../golang.org/x/crypto/argon2/blamka_ref.go | 15 - vendor/golang.org/x/crypto/bcrypt/base64.go | 35 - vendor/golang.org/x/crypto/bcrypt/bcrypt.go | 304 - vendor/golang.org/x/crypto/blake2b/blake2b.go | 291 - .../x/crypto/blake2b/blake2bAVX2_amd64.go | 37 - .../x/crypto/blake2b/blake2bAVX2_amd64.s | 744 - .../x/crypto/blake2b/blake2b_amd64.s | 278 - .../x/crypto/blake2b/blake2b_generic.go | 182 - .../x/crypto/blake2b/blake2b_ref.go | 11 - vendor/golang.org/x/crypto/blake2b/blake2x.go | 177 - .../golang.org/x/crypto/blake2b/register.go | 30 - vendor/golang.org/x/crypto/blowfish/block.go | 159 - vendor/golang.org/x/crypto/blowfish/cipher.go | 99 - vendor/golang.org/x/crypto/blowfish/const.go | 199 - vendor/golang.org/x/crypto/cast5/cast5.go | 536 - .../x/crypto/chacha20/chacha_arm64.go | 16 - .../x/crypto/chacha20/chacha_arm64.s | 307 - .../x/crypto/chacha20/chacha_generic.go | 398 - .../x/crypto/chacha20/chacha_noasm.go | 13 - .../x/crypto/chacha20/chacha_ppc64le.go | 16 - .../x/crypto/chacha20/chacha_ppc64le.s | 449 - .../x/crypto/chacha20/chacha_s390x.go | 27 - .../x/crypto/chacha20/chacha_s390x.s | 224 - vendor/golang.org/x/crypto/chacha20/xor.go | 42 - .../x/crypto/curve25519/curve25519.go | 59 - .../x/crypto/curve25519/curve25519_compat.go | 105 - .../x/crypto/curve25519/curve25519_go120.go | 46 - .../x/crypto/curve25519/internal/field/README | 7 - .../x/crypto/curve25519/internal/field/fe.go | 416 - .../curve25519/internal/field/fe_amd64.go | 15 - .../curve25519/internal/field/fe_amd64.s | 378 - .../internal/field/fe_amd64_noasm.go | 11 - .../curve25519/internal/field/fe_arm64.go | 15 - .../curve25519/internal/field/fe_arm64.s | 42 - .../internal/field/fe_arm64_noasm.go | 11 - .../curve25519/internal/field/fe_generic.go | 264 - .../curve25519/internal/field/sync.checkpoint | 1 - .../crypto/curve25519/internal/field/sync.sh | 19 - vendor/golang.org/x/crypto/hkdf/hkdf.go | 95 - .../x/crypto/internal/alias/alias.go | 31 - .../x/crypto/internal/alias/alias_purego.go | 34 - .../x/crypto/internal/poly1305/mac_noasm.go | 9 - .../x/crypto/internal/poly1305/poly1305.go | 99 - .../x/crypto/internal/poly1305/sum_amd64.go | 47 - .../x/crypto/internal/poly1305/sum_amd64.s | 108 - .../x/crypto/internal/poly1305/sum_generic.go | 312 - .../x/crypto/internal/poly1305/sum_ppc64le.go | 47 - .../x/crypto/internal/poly1305/sum_ppc64le.s | 181 - .../x/crypto/internal/poly1305/sum_s390x.go | 76 - .../x/crypto/internal/poly1305/sum_s390x.s | 503 - vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go | 77 - vendor/golang.org/x/crypto/scrypt/scrypt.go | 212 - vendor/golang.org/x/crypto/sha3/doc.go | 62 - vendor/golang.org/x/crypto/sha3/hashes.go | 97 - .../x/crypto/sha3/hashes_generic.go | 27 - vendor/golang.org/x/crypto/sha3/keccakf.go | 414 - .../golang.org/x/crypto/sha3/keccakf_amd64.s | 390 - vendor/golang.org/x/crypto/sha3/register.go | 18 - vendor/golang.org/x/crypto/sha3/sha3.go | 197 - vendor/golang.org/x/crypto/sha3/sha3_s390x.go | 288 - vendor/golang.org/x/crypto/sha3/sha3_s390x.s | 33 - vendor/golang.org/x/crypto/sha3/shake.go | 172 - .../golang.org/x/crypto/sha3/shake_generic.go | 19 - vendor/golang.org/x/crypto/sha3/xor.go | 23 - .../golang.org/x/crypto/sha3/xor_generic.go | 28 - .../golang.org/x/crypto/sha3/xor_unaligned.go | 66 - .../golang.org/x/crypto/ssh/agent/client.go | 854 - .../golang.org/x/crypto/ssh/agent/forward.go | 103 - .../golang.org/x/crypto/ssh/agent/keyring.go | 241 - .../golang.org/x/crypto/ssh/agent/server.go | 570 - vendor/golang.org/x/crypto/ssh/buffer.go | 97 - vendor/golang.org/x/crypto/ssh/certs.go | 611 - vendor/golang.org/x/crypto/ssh/channel.go | 645 - vendor/golang.org/x/crypto/ssh/cipher.go | 789 - vendor/golang.org/x/crypto/ssh/client.go | 282 - vendor/golang.org/x/crypto/ssh/client_auth.go | 779 - vendor/golang.org/x/crypto/ssh/common.go | 476 - vendor/golang.org/x/crypto/ssh/connection.go | 143 - vendor/golang.org/x/crypto/ssh/doc.go | 23 - vendor/golang.org/x/crypto/ssh/handshake.go | 806 - .../ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go | 93 - vendor/golang.org/x/crypto/ssh/kex.go | 786 - vendor/golang.org/x/crypto/ssh/keys.go | 1728 - .../x/crypto/ssh/knownhosts/knownhosts.go | 540 - vendor/golang.org/x/crypto/ssh/mac.go | 68 - vendor/golang.org/x/crypto/ssh/messages.go | 891 - vendor/golang.org/x/crypto/ssh/mux.go | 357 - vendor/golang.org/x/crypto/ssh/server.go | 802 - vendor/golang.org/x/crypto/ssh/session.go | 647 - vendor/golang.org/x/crypto/ssh/ssh_gss.go | 139 - vendor/golang.org/x/crypto/ssh/streamlocal.go | 116 - vendor/golang.org/x/crypto/ssh/tcpip.go | 509 - vendor/golang.org/x/crypto/ssh/transport.go | 380 - vendor/golang.org/x/exp/typeparams/LICENSE | 27 - vendor/golang.org/x/exp/typeparams/common.go | 182 - .../golang.org/x/exp/typeparams/normalize.go | 200 - .../golang.org/x/exp/typeparams/termlist.go | 172 - .../x/exp/typeparams/typeparams_go117.go | 201 - .../x/exp/typeparams/typeparams_go118.go | 147 - .../golang.org/x/exp/typeparams/typeterm.go | 169 - vendor/golang.org/x/mod/modfile/print.go | 184 - vendor/golang.org/x/mod/modfile/read.go | 958 - vendor/golang.org/x/mod/modfile/rule.go | 1663 - vendor/golang.org/x/mod/modfile/work.go | 285 - vendor/golang.org/x/net/context/context.go | 56 - vendor/golang.org/x/net/context/go17.go | 72 - vendor/golang.org/x/net/context/go19.go | 20 - vendor/golang.org/x/net/context/pre_go17.go | 300 - vendor/golang.org/x/net/context/pre_go19.go | 109 - vendor/golang.org/x/net/http2/h2c/h2c.go | 240 - .../golang.org/x/net/internal/socks/client.go | 168 - .../golang.org/x/net/internal/socks/socks.go | 317 - vendor/golang.org/x/net/proxy/dial.go | 54 - vendor/golang.org/x/net/proxy/direct.go | 31 - vendor/golang.org/x/net/proxy/per_host.go | 155 - vendor/golang.org/x/net/proxy/proxy.go | 149 - vendor/golang.org/x/net/proxy/socks5.go | 42 - .../golang.org/x/sync/semaphore/semaphore.go | 136 - vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s | 17 - vendor/golang.org/x/sys/cpu/byteorder.go | 66 - vendor/golang.org/x/sys/cpu/cpu.go | 290 - vendor/golang.org/x/sys/cpu/cpu_aix.go | 33 - vendor/golang.org/x/sys/cpu/cpu_arm.go | 73 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 172 - vendor/golang.org/x/sys/cpu/cpu_arm64.s | 31 - vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go | 21 - vendor/golang.org/x/sys/cpu/cpu_gc_x86.go | 15 - .../golang.org/x/sys/cpu/cpu_gccgo_arm64.go | 11 - .../golang.org/x/sys/cpu/cpu_gccgo_s390x.go | 22 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c | 37 - vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go | 31 - vendor/golang.org/x/sys/cpu/cpu_linux.go | 15 - vendor/golang.org/x/sys/cpu/cpu_linux_arm.go | 39 - .../golang.org/x/sys/cpu/cpu_linux_arm64.go | 111 - .../golang.org/x/sys/cpu/cpu_linux_mips64x.go | 22 - .../golang.org/x/sys/cpu/cpu_linux_noinit.go | 9 - .../golang.org/x/sys/cpu/cpu_linux_ppc64x.go | 30 - .../golang.org/x/sys/cpu/cpu_linux_s390x.go | 40 - vendor/golang.org/x/sys/cpu/cpu_loong64.go | 12 - vendor/golang.org/x/sys/cpu/cpu_mips64x.go | 15 - vendor/golang.org/x/sys/cpu/cpu_mipsx.go | 11 - .../golang.org/x/sys/cpu/cpu_netbsd_arm64.go | 173 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 - .../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 - vendor/golang.org/x/sys/cpu/cpu_other_arm.go | 9 - .../golang.org/x/sys/cpu/cpu_other_arm64.go | 9 - .../golang.org/x/sys/cpu/cpu_other_mips64x.go | 11 - .../golang.org/x/sys/cpu/cpu_other_ppc64x.go | 12 - .../golang.org/x/sys/cpu/cpu_other_riscv64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_ppc64x.go | 16 - vendor/golang.org/x/sys/cpu/cpu_riscv64.go | 11 - vendor/golang.org/x/sys/cpu/cpu_s390x.go | 172 - vendor/golang.org/x/sys/cpu/cpu_s390x.s | 57 - vendor/golang.org/x/sys/cpu/cpu_wasm.go | 17 - vendor/golang.org/x/sys/cpu/cpu_x86.go | 151 - vendor/golang.org/x/sys/cpu/cpu_x86.s | 26 - vendor/golang.org/x/sys/cpu/cpu_zos.go | 10 - vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go | 25 - vendor/golang.org/x/sys/cpu/endian_big.go | 10 - vendor/golang.org/x/sys/cpu/endian_little.go | 10 - vendor/golang.org/x/sys/cpu/hwcap_linux.go | 71 - vendor/golang.org/x/sys/cpu/parse.go | 43 - .../x/sys/cpu/proc_cpuinfo_linux.go | 53 - vendor/golang.org/x/sys/cpu/runtime_auxv.go | 16 - .../x/sys/cpu/runtime_auxv_go121.go | 18 - .../golang.org/x/sys/cpu/syscall_aix_gccgo.go | 26 - .../x/sys/cpu/syscall_aix_ppc64_gc.go | 35 - vendor/golang.org/x/sys/execabs/execabs.go | 102 - .../golang.org/x/sys/execabs/execabs_go118.go | 17 - .../golang.org/x/sys/execabs/execabs_go119.go | 20 - vendor/golang.org/x/sys/plan9/asm.s | 8 - vendor/golang.org/x/sys/plan9/asm_plan9_386.s | 30 - .../golang.org/x/sys/plan9/asm_plan9_amd64.s | 30 - vendor/golang.org/x/sys/plan9/asm_plan9_arm.s | 25 - vendor/golang.org/x/sys/plan9/const_plan9.go | 70 - vendor/golang.org/x/sys/plan9/dir_plan9.go | 212 - vendor/golang.org/x/sys/plan9/env_plan9.go | 31 - vendor/golang.org/x/sys/plan9/errors_plan9.go | 50 - vendor/golang.org/x/sys/plan9/mkall.sh | 150 - vendor/golang.org/x/sys/plan9/mkerrors.sh | 246 - .../golang.org/x/sys/plan9/mksysnum_plan9.sh | 23 - .../golang.org/x/sys/plan9/pwd_go15_plan9.go | 21 - vendor/golang.org/x/sys/plan9/pwd_plan9.go | 23 - vendor/golang.org/x/sys/plan9/race.go | 30 - vendor/golang.org/x/sys/plan9/race0.go | 25 - vendor/golang.org/x/sys/plan9/str.go | 22 - vendor/golang.org/x/sys/plan9/syscall.go | 109 - .../golang.org/x/sys/plan9/syscall_plan9.go | 361 - .../x/sys/plan9/zsyscall_plan9_386.go | 284 - .../x/sys/plan9/zsyscall_plan9_amd64.go | 284 - .../x/sys/plan9/zsyscall_plan9_arm.go | 284 - .../golang.org/x/sys/plan9/zsysnum_plan9.go | 49 - vendor/golang.org/x/term/CONTRIBUTING.md | 26 - vendor/golang.org/x/term/LICENSE | 27 - vendor/golang.org/x/term/PATENTS | 22 - vendor/golang.org/x/term/README.md | 19 - vendor/golang.org/x/term/codereview.cfg | 1 - vendor/golang.org/x/term/term.go | 60 - vendor/golang.org/x/term/term_plan9.go | 42 - vendor/golang.org/x/term/term_unix.go | 91 - vendor/golang.org/x/term/term_unix_bsd.go | 12 - vendor/golang.org/x/term/term_unix_other.go | 12 - vendor/golang.org/x/term/term_unsupported.go | 38 - vendor/golang.org/x/term/term_windows.go | 79 - vendor/golang.org/x/term/terminal.go | 986 - vendor/golang.org/x/text/width/kind_string.go | 28 - .../golang.org/x/text/width/tables10.0.0.go | 1328 - .../golang.org/x/text/width/tables11.0.0.go | 1340 - .../golang.org/x/text/width/tables12.0.0.go | 1360 - .../golang.org/x/text/width/tables13.0.0.go | 1361 - .../golang.org/x/text/width/tables15.0.0.go | 1367 - vendor/golang.org/x/text/width/tables9.0.0.go | 1296 - vendor/golang.org/x/text/width/transform.go | 239 - vendor/golang.org/x/text/width/trieval.go | 30 - vendor/golang.org/x/text/width/width.go | 206 - .../x/tools/cmd/stringer/stringer.go | 660 - .../x/tools/go/analysis/analysis.go | 227 - .../x/tools/go/analysis/diagnostic.go | 74 - vendor/golang.org/x/tools/go/analysis/doc.go | 319 - .../go/analysis/passes/appends/appends.go | 47 - .../x/tools/go/analysis/passes/appends/doc.go | 20 - .../analysis/passes/asmdecl/arches_go118.go | 12 - .../analysis/passes/asmdecl/arches_go119.go | 14 - .../go/analysis/passes/asmdecl/asmdecl.go | 825 - .../tools/go/analysis/passes/assign/assign.go | 88 - .../x/tools/go/analysis/passes/assign/doc.go | 14 - .../tools/go/analysis/passes/atomic/atomic.go | 85 - .../x/tools/go/analysis/passes/atomic/doc.go | 17 - .../passes/atomicalign/atomicalign.go | 108 - .../x/tools/go/analysis/passes/bools/bools.go | 183 - .../go/analysis/passes/buildssa/buildssa.go | 94 - .../go/analysis/passes/buildtag/buildtag.go | 368 - .../analysis/passes/buildtag/buildtag_old.go | 174 - .../go/analysis/passes/cgocall/cgocall.go | 379 - .../analysis/passes/cgocall/cgocall_go120.go | 13 - .../analysis/passes/cgocall/cgocall_go121.go | 13 - .../go/analysis/passes/composite/composite.go | 170 - .../go/analysis/passes/composite/whitelist.go | 35 - .../go/analysis/passes/copylock/copylock.go | 349 - .../go/analysis/passes/ctrlflow/ctrlflow.go | 231 - .../passes/deepequalerrors/deepequalerrors.go | 118 - .../tools/go/analysis/passes/defers/defers.go | 59 - .../x/tools/go/analysis/passes/defers/doc.go | 25 - .../go/analysis/passes/directive/directive.go | 209 - .../go/analysis/passes/errorsas/errorsas.go | 89 - .../passes/fieldalignment/fieldalignment.go | 374 - .../go/analysis/passes/findcall/findcall.go | 99 - .../passes/framepointer/framepointer.go | 92 - .../passes/httpresponse/httpresponse.go | 173 - .../go/analysis/passes/ifaceassert/doc.go | 24 - .../passes/ifaceassert/ifaceassert.go | 99 - .../passes/ifaceassert/parameterized.go | 113 - .../go/analysis/passes/inspect/inspect.go | 49 - .../passes/internal/analysisutil/util.go | 156 - .../go/analysis/passes/loopclosure/doc.go | 75 - .../passes/loopclosure/loopclosure.go | 375 - .../go/analysis/passes/lostcancel/doc.go | 16 - .../analysis/passes/lostcancel/lostcancel.go | 318 - .../x/tools/go/analysis/passes/nilfunc/doc.go | 13 - .../go/analysis/passes/nilfunc/nilfunc.go | 83 - .../x/tools/go/analysis/passes/nilness/doc.go | 45 - .../go/analysis/passes/nilness/nilness.go | 362 - .../go/analysis/passes/pkgfact/pkgfact.go | 128 - .../x/tools/go/analysis/passes/printf/doc.go | 47 - .../tools/go/analysis/passes/printf/printf.go | 1110 - .../tools/go/analysis/passes/printf/types.go | 301 - .../passes/reflectvaluecompare/doc.go | 27 - .../reflectvaluecompare.go | 77 - .../x/tools/go/analysis/passes/shadow/doc.go | 33 - .../tools/go/analysis/passes/shadow/shadow.go | 268 - .../x/tools/go/analysis/passes/shift/dead.go | 101 - .../x/tools/go/analysis/passes/shift/shift.go | 132 - .../go/analysis/passes/sigchanyzer/doc.go | 17 - .../passes/sigchanyzer/sigchanyzer.go | 159 - .../x/tools/go/analysis/passes/slog/doc.go | 23 - .../x/tools/go/analysis/passes/slog/slog.go | 234 - .../go/analysis/passes/sortslice/analyzer.go | 134 - .../go/analysis/passes/stdmethods/doc.go | 30 - .../analysis/passes/stdmethods/stdmethods.go | 202 - .../go/analysis/passes/stringintconv/doc.go | 21 - .../analysis/passes/stringintconv/string.go | 210 - .../go/analysis/passes/structtag/structtag.go | 314 - .../analysis/passes/testinggoroutine/doc.go | 22 - .../testinggoroutine/testinggoroutine.go | 278 - .../analysis/passes/testinggoroutine/util.go | 96 - .../x/tools/go/analysis/passes/tests/doc.go | 18 - .../x/tools/go/analysis/passes/tests/tests.go | 473 - .../go/analysis/passes/timeformat/doc.go | 15 - .../analysis/passes/timeformat/timeformat.go | 120 - .../tools/go/analysis/passes/unmarshal/doc.go | 14 - .../go/analysis/passes/unmarshal/unmarshal.go | 106 - .../go/analysis/passes/unreachable/doc.go | 14 - .../passes/unreachable/unreachable.go | 324 - .../tools/go/analysis/passes/unsafeptr/doc.go | 17 - .../go/analysis/passes/unsafeptr/unsafeptr.go | 157 - .../go/analysis/passes/unusedresult/doc.go | 19 - .../passes/unusedresult/unusedresult.go | 161 - .../go/analysis/passes/unusedwrite/doc.go | 34 - .../passes/unusedwrite/unusedwrite.go | 172 - .../x/tools/go/analysis/validate.go | 137 - .../x/tools/go/ast/inspector/inspector.go | 220 - .../x/tools/go/ast/inspector/typeof.go | 227 - .../x/tools/go/buildutil/allpackages.go | 195 - .../x/tools/go/buildutil/fakecontext.go | 111 - .../x/tools/go/buildutil/overlay.go | 101 - .../golang.org/x/tools/go/buildutil/tags.go | 80 - .../golang.org/x/tools/go/buildutil/util.go | 209 - vendor/golang.org/x/tools/go/cfg/builder.go | 507 - vendor/golang.org/x/tools/go/cfg/cfg.go | 149 - .../golang.org/x/tools/go/internal/cgo/cgo.go | 219 - .../x/tools/go/internal/cgo/cgo_pkgconfig.go | 39 - vendor/golang.org/x/tools/go/loader/doc.go | 202 - vendor/golang.org/x/tools/go/loader/loader.go | 1066 - vendor/golang.org/x/tools/go/loader/util.go | 123 - vendor/golang.org/x/tools/go/ssa/TODO | 16 - vendor/golang.org/x/tools/go/ssa/block.go | 113 - vendor/golang.org/x/tools/go/ssa/blockopt.go | 183 - vendor/golang.org/x/tools/go/ssa/builder.go | 2758 -- vendor/golang.org/x/tools/go/ssa/const.go | 231 - vendor/golang.org/x/tools/go/ssa/coretype.go | 159 - vendor/golang.org/x/tools/go/ssa/create.go | 331 - vendor/golang.org/x/tools/go/ssa/doc.go | 122 - vendor/golang.org/x/tools/go/ssa/dom.go | 335 - vendor/golang.org/x/tools/go/ssa/emit.go | 619 - vendor/golang.org/x/tools/go/ssa/func.go | 634 - .../golang.org/x/tools/go/ssa/instantiate.go | 114 - vendor/golang.org/x/tools/go/ssa/lift.go | 644 - vendor/golang.org/x/tools/go/ssa/lvalue.go | 153 - vendor/golang.org/x/tools/go/ssa/methods.go | 273 - vendor/golang.org/x/tools/go/ssa/mode.go | 111 - .../x/tools/go/ssa/parameterized.go | 141 - vendor/golang.org/x/tools/go/ssa/print.go | 464 - vendor/golang.org/x/tools/go/ssa/sanity.go | 557 - vendor/golang.org/x/tools/go/ssa/source.go | 290 - vendor/golang.org/x/tools/go/ssa/ssa.go | 1835 - .../golang.org/x/tools/go/ssa/ssautil/load.go | 214 - .../x/tools/go/ssa/ssautil/switch.go | 230 - .../x/tools/go/ssa/ssautil/visit.go | 157 - vendor/golang.org/x/tools/go/ssa/subst.go | 475 - vendor/golang.org/x/tools/go/ssa/util.go | 381 - vendor/golang.org/x/tools/go/ssa/wrappers.go | 351 - .../internal/analysisinternal/analysis.go | 386 - .../internal/analysisinternal/extractdoc.go | 113 - vendor/google.golang.org/genproto/LICENSE | 202 - .../genproto/googleapis/api/LICENSE | 202 - .../api/annotations/annotations.pb.go | 119 - .../googleapis/api/annotations/client.pb.go | 1780 - .../api/annotations/field_behavior.pb.go | 266 - .../api/annotations/field_info.pb.go | 295 - .../googleapis/api/annotations/http.pb.go | 782 - .../googleapis/api/annotations/resource.pb.go | 655 - .../googleapis/api/annotations/routing.pb.go | 693 - .../googleapis/api/launch_stage.pb.go | 203 - .../genproto/googleapis/api/tidyfix.go | 23 - .../genproto/internal/doc.go | 17 - .../grpc/cmd/protoc-gen-go-grpc/LICENSE | 202 - .../grpc/cmd/protoc-gen-go-grpc/README.md | 21 - .../grpc/cmd/protoc-gen-go-grpc/grpc.go | 535 - .../grpc/cmd/protoc-gen-go-grpc/main.go | 71 - .../protobuf/compiler/protogen/protogen.go | 1391 - .../protobuf/types/dynamicpb/dynamic.go | 718 - .../protobuf/types/dynamicpb/types.go | 184 - .../protobuf/types/known/apipb/api.pb.go | 575 - .../protobuf/types/known/emptypb/empty.pb.go | 166 - .../types/known/fieldmaskpb/field_mask.pb.go | 588 - .../sourcecontextpb/source_context.pb.go | 176 - .../types/known/structpb/struct.pb.go | 810 - .../protobuf/types/known/typepb/type.pb.go | 990 - .../types/known/wrapperspb/wrappers.pb.go | 760 - .../protobuf/types/pluginpb/plugin.pb.go | 661 - .../alessio/shellescape.v1/.gitignore | 24 - .../alessio/shellescape.v1/.travis.yml | 4 - .../gopkg.in/alessio/shellescape.v1/AUTHORS | 1 - .../gopkg.in/alessio/shellescape.v1/LICENSE | 21 - .../gopkg.in/alessio/shellescape.v1/README.md | 57 - .../alessio/shellescape.v1/shellescape.go | 39 - vendor/gopkg.in/warnings.v0/LICENSE | 24 - vendor/gopkg.in/warnings.v0/README | 77 - vendor/gopkg.in/warnings.v0/warnings.go | 194 - vendor/honnef.co/go/tools/LICENSE | 20 - vendor/honnef.co/go/tools/LICENSE-THIRD-PARTY | 121 - .../honnef.co/go/tools/analysis/code/code.go | 357 - .../honnef.co/go/tools/analysis/code/visit.go | 51 - .../honnef.co/go/tools/analysis/edit/edit.go | 83 - .../analysis/facts/deprecated/deprecated.go | 154 - .../analysis/facts/directives/directives.go | 20 - .../analysis/facts/generated/generated.go | 97 - .../tools/analysis/facts/nilness/nilness.go | 256 - .../go/tools/analysis/facts/purity/purity.go | 264 - .../tools/analysis/facts/tokenfile/token.go | 24 - .../analysis/facts/typedness/typedness.go | 253 - .../honnef.co/go/tools/analysis/lint/lint.go | 291 - .../go/tools/analysis/report/report.go | 247 - vendor/honnef.co/go/tools/config/config.go | 266 - vendor/honnef.co/go/tools/config/example.conf | 14 - .../go/tools/go/ast/astutil/upstream.go | 20 - .../honnef.co/go/tools/go/ast/astutil/util.go | 362 - vendor/honnef.co/go/tools/go/ir/LICENSE | 28 - vendor/honnef.co/go/tools/go/ir/UPSTREAM | 9 - vendor/honnef.co/go/tools/go/ir/blockopt.go | 205 - vendor/honnef.co/go/tools/go/ir/builder.go | 2672 -- vendor/honnef.co/go/tools/go/ir/const.go | 285 - vendor/honnef.co/go/tools/go/ir/create.go | 282 - vendor/honnef.co/go/tools/go/ir/doc.go | 130 - vendor/honnef.co/go/tools/go/ir/dom.go | 466 - vendor/honnef.co/go/tools/go/ir/emit.go | 548 - vendor/honnef.co/go/tools/go/ir/exits.go | 369 - vendor/honnef.co/go/tools/go/ir/func.go | 957 - vendor/honnef.co/go/tools/go/ir/html.go | 1124 - .../honnef.co/go/tools/go/ir/irutil/load.go | 181 - .../honnef.co/go/tools/go/ir/irutil/loops.go | 54 - .../honnef.co/go/tools/go/ir/irutil/stub.go | 32 - .../honnef.co/go/tools/go/ir/irutil/switch.go | 260 - .../go/tools/go/ir/irutil/terminates.go | 70 - .../honnef.co/go/tools/go/ir/irutil/util.go | 178 - .../honnef.co/go/tools/go/ir/irutil/visit.go | 78 - vendor/honnef.co/go/tools/go/ir/lift.go | 1753 - vendor/honnef.co/go/tools/go/ir/lvalue.go | 141 - vendor/honnef.co/go/tools/go/ir/methods.go | 241 - vendor/honnef.co/go/tools/go/ir/mode.go | 104 - vendor/honnef.co/go/tools/go/ir/print.go | 507 - vendor/honnef.co/go/tools/go/ir/sanity.go | 560 - vendor/honnef.co/go/tools/go/ir/source.go | 263 - vendor/honnef.co/go/tools/go/ir/ssa.go | 2104 -- vendor/honnef.co/go/tools/go/ir/util.go | 148 - vendor/honnef.co/go/tools/go/ir/wrappers.go | 381 - vendor/honnef.co/go/tools/go/ir/write.go | 5 - .../go/tools/go/types/typeutil/ext.go | 18 - .../go/tools/go/types/typeutil/typeparams.go | 110 - .../go/tools/go/types/typeutil/upstream.go | 52 - .../go/tools/go/types/typeutil/util.go | 133 - .../tools/internal/passes/buildir/buildir.go | 107 - .../go/tools/internal/sharedcheck/lint.go | 209 - vendor/honnef.co/go/tools/knowledge/arg.go | 69 - .../go/tools/knowledge/deprecated.go | 272 - vendor/honnef.co/go/tools/knowledge/doc.go | 2 - .../go/tools/knowledge/signatures.go | 107 - vendor/honnef.co/go/tools/pattern/convert.go | 243 - vendor/honnef.co/go/tools/pattern/doc.go | 272 - vendor/honnef.co/go/tools/pattern/lexer.go | 221 - vendor/honnef.co/go/tools/pattern/match.go | 699 - vendor/honnef.co/go/tools/pattern/parser.go | 526 - vendor/honnef.co/go/tools/pattern/pattern.go | 524 - vendor/honnef.co/go/tools/printf/fuzz.go | 12 - vendor/honnef.co/go/tools/printf/printf.go | 198 - vendor/honnef.co/go/tools/simple/analysis.go | 153 - vendor/honnef.co/go/tools/simple/doc.go | 469 - vendor/honnef.co/go/tools/simple/lint.go | 2192 -- .../go/tools/staticcheck/analysis.go | 330 - .../go/tools/staticcheck/buildtag.go | 21 - vendor/honnef.co/go/tools/staticcheck/doc.go | 1302 - .../go/tools/staticcheck/fakejson/encode.go | 370 - .../staticcheck/fakereflect/fakereflect.go | 131 - .../go/tools/staticcheck/fakexml/marshal.go | 375 - .../go/tools/staticcheck/fakexml/typeinfo.go | 389 - .../go/tools/staticcheck/fakexml/xml.go | 33 - vendor/honnef.co/go/tools/staticcheck/lint.go | 5237 --- .../honnef.co/go/tools/staticcheck/rules.go | 294 - .../go/tools/staticcheck/structtag.go | 58 - .../honnef.co/go/tools/stylecheck/analysis.go | 84 - vendor/honnef.co/go/tools/stylecheck/doc.go | 262 - vendor/honnef.co/go/tools/stylecheck/lint.go | 990 - vendor/honnef.co/go/tools/stylecheck/names.go | 285 - .../honnef.co/go/tools/unused/implements.go | 82 - vendor/honnef.co/go/tools/unused/runtime.go | 331 - vendor/honnef.co/go/tools/unused/serialize.go | 99 - vendor/honnef.co/go/tools/unused/unused.go | 1679 - vendor/modules.txt | 1559 +- vendor/mvdan.cc/gofumpt/.gitattributes | 2 - vendor/mvdan.cc/gofumpt/CHANGELOG.md | 175 - vendor/mvdan.cc/gofumpt/LICENSE | 27 - vendor/mvdan.cc/gofumpt/LICENSE.google | 27 - vendor/mvdan.cc/gofumpt/README.md | 664 - vendor/mvdan.cc/gofumpt/doc.go | 5 - vendor/mvdan.cc/gofumpt/format/format.go | 1094 - vendor/mvdan.cc/gofumpt/format/rewrite.go | 113 - vendor/mvdan.cc/gofumpt/format/simplify.go | 169 - vendor/mvdan.cc/gofumpt/gofmt.go | 630 - vendor/mvdan.cc/gofumpt/internal.go | 177 - .../gofumpt/internal/govendor/diff/diff.go | 261 - .../internal/govendor/go/doc/comment/doc.go | 36 - .../internal/govendor/go/doc/comment/html.go | 169 - .../govendor/go/doc/comment/markdown.go | 188 - .../internal/govendor/go/doc/comment/parse.go | 1262 - .../internal/govendor/go/doc/comment/print.go | 288 - .../internal/govendor/go/doc/comment/std.go | 47 - .../internal/govendor/go/doc/comment/text.go | 337 - .../internal/govendor/go/format/format.go | 134 - .../internal/govendor/go/format/internal.go | 177 - .../internal/govendor/go/printer/comment.go | 156 - .../internal/govendor/go/printer/gobuild.go | 170 - .../internal/govendor/go/printer/nodes.go | 2001 - .../internal/govendor/go/printer/printer.go | 1435 - .../gofumpt/internal/version/version.go | 105 - vendor/mvdan.cc/interfacer/LICENSE | 27 - vendor/mvdan.cc/interfacer/check/cache.go | 50 - vendor/mvdan.cc/interfacer/check/check.go | 462 - vendor/mvdan.cc/interfacer/check/types.go | 170 - vendor/mvdan.cc/lint/.travis.yml | 7 - vendor/mvdan.cc/lint/LICENSE | 27 - vendor/mvdan.cc/lint/README.md | 27 - vendor/mvdan.cc/lint/lint.go | 28 - vendor/mvdan.cc/unparam/LICENSE | 27 - vendor/mvdan.cc/unparam/check/check.go | 1018 - 5657 files changed, 8181 insertions(+), 1032712 deletions(-) create mode 100644 Makefile.tools delete mode 100644 scripts/tools.go rename vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go => test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool.go (95%) delete mode 100644 test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go delete mode 100644 test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go delete mode 100644 test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/event.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/http.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go (100%) rename {vendor => test/integration/vendor}/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go (100%) create mode 100644 test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/doc.go (91%) rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/event.go (66%) rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/exception.go (99%) rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/resource.go (82%) rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/schema.go (93%) rename {vendor/go.opentelemetry.io/otel/semconv/v1.21.0 => test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0}/trace.go (52%) rename vendor/golang.org/x/crypto/sha3/keccakf_amd64.go => test/performance/vendor/github.com/klauspost/compress/internal/race/norace.go (52%) create mode 100644 test/performance/vendor/github.com/klauspost/compress/internal/race/race.go delete mode 100644 vendor/4d63.com/gocheckcompilerdirectives/LICENSE delete mode 100644 vendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.go delete mode 100644 vendor/4d63.com/gochecknoglobals/LICENSE delete mode 100644 vendor/4d63.com/gochecknoglobals/checknoglobals/check_no_globals.go delete mode 100644 vendor/dario.cat/mergo/.deepsource.toml delete mode 100644 vendor/dario.cat/mergo/.gitignore delete mode 100644 vendor/dario.cat/mergo/.travis.yml delete mode 100644 vendor/dario.cat/mergo/CODE_OF_CONDUCT.md delete mode 100644 vendor/dario.cat/mergo/CONTRIBUTING.md delete mode 100644 vendor/dario.cat/mergo/LICENSE delete mode 100644 vendor/dario.cat/mergo/README.md delete mode 100644 vendor/dario.cat/mergo/SECURITY.md delete mode 100644 vendor/dario.cat/mergo/doc.go delete mode 100644 vendor/dario.cat/mergo/map.go delete mode 100644 vendor/dario.cat/mergo/merge.go delete mode 100644 vendor/dario.cat/mergo/mergo.go delete mode 100644 vendor/github.com/4meepo/tagalign/.gitignore delete mode 100644 vendor/github.com/4meepo/tagalign/.golangci.yml delete mode 100644 vendor/github.com/4meepo/tagalign/.goreleaser.yml delete mode 100644 vendor/github.com/4meepo/tagalign/LICENSE delete mode 100644 vendor/github.com/4meepo/tagalign/Makefile delete mode 100644 vendor/github.com/4meepo/tagalign/README.md delete mode 100644 vendor/github.com/4meepo/tagalign/options.go delete mode 100644 vendor/github.com/4meepo/tagalign/tagalign.go delete mode 100644 vendor/github.com/Abirdcfly/dupword/.gitignore delete mode 100644 vendor/github.com/Abirdcfly/dupword/.goreleaser.yml delete mode 100644 vendor/github.com/Abirdcfly/dupword/LICENSE delete mode 100644 vendor/github.com/Abirdcfly/dupword/README.md delete mode 100644 vendor/github.com/Abirdcfly/dupword/dupword.go delete mode 100644 vendor/github.com/Abirdcfly/dupword/version.go delete mode 100644 vendor/github.com/AlekSi/pointer/LICENSE delete mode 100644 vendor/github.com/AlekSi/pointer/README.md delete mode 100644 vendor/github.com/AlekSi/pointer/generic.go delete mode 100644 vendor/github.com/AlekSi/pointer/pointer.go delete mode 100644 vendor/github.com/AlekSi/pointer/pointer_or_nil.go delete mode 100644 vendor/github.com/AlekSi/pointer/value.go delete mode 100644 vendor/github.com/Antonboom/errname/LICENSE delete mode 100644 vendor/github.com/Antonboom/errname/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/Antonboom/errname/pkg/analyzer/facts.go delete mode 100644 vendor/github.com/Antonboom/nilnil/LICENSE delete mode 100644 vendor/github.com/Antonboom/nilnil/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/Antonboom/nilnil/pkg/analyzer/config.go delete mode 100644 vendor/github.com/Antonboom/nilnil/pkg/analyzer/func_type_stack.go delete mode 100644 vendor/github.com/Antonboom/testifylint/LICENSE delete mode 100644 vendor/github.com/Antonboom/testifylint/analyzer/analyzer.go delete mode 100644 vendor/github.com/Antonboom/testifylint/analyzer/checkers_factory.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/analysisutil/doc.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/analysisutil/file.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/analysisutil/format.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/analysisutil/object.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/analysisutil/pkg.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/blank_import.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/bool_compare.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/call_meta.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/checker.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/checkers_registry.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/compares.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/diagnostic.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/empty.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/error_is_as.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/error_nil.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/expected_actual.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/float_compare.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/go_require.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/len.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/nil_compare.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/require_error.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/suite_dont_use_pkg.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/suite_extra_assert_call.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/suite_thelper.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/checkers/useless_assert.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/config/config.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/config/flag_value_types.go delete mode 100644 vendor/github.com/Antonboom/testifylint/internal/testify/const.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/LICENSE delete mode 100644 vendor/github.com/Azure/go-ansiterm/README.md delete mode 100644 vendor/github.com/Azure/go-ansiterm/SECURITY.md delete mode 100644 vendor/github.com/Azure/go-ansiterm/constants.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/context.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/csi_entry_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/csi_param_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/escape_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/event_handler.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/ground_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/osc_string_state.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/parser.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/parser_actions.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/states.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/utilities.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/ansi.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/api.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/utilities.go delete mode 100644 vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go delete mode 100644 vendor/github.com/BurntSushi/toml/.gitignore delete mode 100644 vendor/github.com/BurntSushi/toml/COPYING delete mode 100644 vendor/github.com/BurntSushi/toml/README.md delete mode 100644 vendor/github.com/BurntSushi/toml/decode.go delete mode 100644 vendor/github.com/BurntSushi/toml/decode_go116.go delete mode 100644 vendor/github.com/BurntSushi/toml/deprecated.go delete mode 100644 vendor/github.com/BurntSushi/toml/doc.go delete mode 100644 vendor/github.com/BurntSushi/toml/encode.go delete mode 100644 vendor/github.com/BurntSushi/toml/error.go delete mode 100644 vendor/github.com/BurntSushi/toml/internal/tz.go delete mode 100644 vendor/github.com/BurntSushi/toml/lex.go delete mode 100644 vendor/github.com/BurntSushi/toml/meta.go delete mode 100644 vendor/github.com/BurntSushi/toml/parse.go delete mode 100644 vendor/github.com/BurntSushi/toml/type_fields.go delete mode 100644 vendor/github.com/BurntSushi/toml/type_toml.go delete mode 100644 vendor/github.com/Djarvur/go-err113/.gitignore delete mode 100644 vendor/github.com/Djarvur/go-err113/.golangci.yml delete mode 100644 vendor/github.com/Djarvur/go-err113/.travis.yml delete mode 100644 vendor/github.com/Djarvur/go-err113/LICENSE delete mode 100644 vendor/github.com/Djarvur/go-err113/README.adoc delete mode 100644 vendor/github.com/Djarvur/go-err113/comparison.go delete mode 100644 vendor/github.com/Djarvur/go-err113/definition.go delete mode 100644 vendor/github.com/Djarvur/go-err113/err113.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/LICENSE delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer/analyzer.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/cache.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/directive.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/pattern/list.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields-cache.go delete mode 100644 vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields.go delete mode 100644 vendor/github.com/MakeNowJust/heredoc/LICENSE delete mode 100644 vendor/github.com/MakeNowJust/heredoc/README.md delete mode 100644 vendor/github.com/MakeNowJust/heredoc/heredoc.go delete mode 100644 vendor/github.com/Masterminds/goutils/.travis.yml delete mode 100644 vendor/github.com/Masterminds/goutils/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/goutils/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/goutils/README.md delete mode 100644 vendor/github.com/Masterminds/goutils/appveyor.yml delete mode 100644 vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/randomstringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/stringutils.go delete mode 100644 vendor/github.com/Masterminds/goutils/wordutils.go delete mode 100644 vendor/github.com/Masterminds/semver/.travis.yml delete mode 100644 vendor/github.com/Masterminds/semver/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/semver/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/semver/Makefile delete mode 100644 vendor/github.com/Masterminds/semver/README.md delete mode 100644 vendor/github.com/Masterminds/semver/appveyor.yml delete mode 100644 vendor/github.com/Masterminds/semver/collection.go delete mode 100644 vendor/github.com/Masterminds/semver/constraints.go delete mode 100644 vendor/github.com/Masterminds/semver/doc.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/.gitignore delete mode 100644 vendor/github.com/Masterminds/semver/v3/.golangci.yml delete mode 100644 vendor/github.com/Masterminds/semver/v3/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/semver/v3/Makefile delete mode 100644 vendor/github.com/Masterminds/semver/v3/README.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/SECURITY.md delete mode 100644 vendor/github.com/Masterminds/semver/v3/collection.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/constraints.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/doc.go delete mode 100644 vendor/github.com/Masterminds/semver/v3/version.go delete mode 100644 vendor/github.com/Masterminds/semver/version.go delete mode 100644 vendor/github.com/Masterminds/semver/version_fuzz.go delete mode 100644 vendor/github.com/Masterminds/sprig/.gitignore delete mode 100644 vendor/github.com/Masterminds/sprig/.travis.yml delete mode 100644 vendor/github.com/Masterminds/sprig/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/sprig/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/sprig/Makefile delete mode 100644 vendor/github.com/Masterminds/sprig/README.md delete mode 100644 vendor/github.com/Masterminds/sprig/appveyor.yml delete mode 100644 vendor/github.com/Masterminds/sprig/crypto.go delete mode 100644 vendor/github.com/Masterminds/sprig/date.go delete mode 100644 vendor/github.com/Masterminds/sprig/defaults.go delete mode 100644 vendor/github.com/Masterminds/sprig/dict.go delete mode 100644 vendor/github.com/Masterminds/sprig/doc.go delete mode 100644 vendor/github.com/Masterminds/sprig/functions.go delete mode 100644 vendor/github.com/Masterminds/sprig/glide.yaml delete mode 100644 vendor/github.com/Masterminds/sprig/list.go delete mode 100644 vendor/github.com/Masterminds/sprig/network.go delete mode 100644 vendor/github.com/Masterminds/sprig/numeric.go delete mode 100644 vendor/github.com/Masterminds/sprig/reflect.go delete mode 100644 vendor/github.com/Masterminds/sprig/regex.go delete mode 100644 vendor/github.com/Masterminds/sprig/semver.go delete mode 100644 vendor/github.com/Masterminds/sprig/strings.go delete mode 100644 vendor/github.com/Masterminds/sprig/url.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/.gitignore delete mode 100644 vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md delete mode 100644 vendor/github.com/Masterminds/sprig/v3/LICENSE.txt delete mode 100644 vendor/github.com/Masterminds/sprig/v3/Makefile delete mode 100644 vendor/github.com/Masterminds/sprig/v3/README.md delete mode 100644 vendor/github.com/Masterminds/sprig/v3/crypto.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/date.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/defaults.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/dict.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/doc.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/functions.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/list.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/network.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/numeric.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/reflect.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/regex.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/semver.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/strings.go delete mode 100644 vendor/github.com/Masterminds/sprig/v3/url.go delete mode 100644 vendor/github.com/Microsoft/go-winio/.gitattributes delete mode 100644 vendor/github.com/Microsoft/go-winio/.gitignore delete mode 100644 vendor/github.com/Microsoft/go-winio/.golangci.yml delete mode 100644 vendor/github.com/Microsoft/go-winio/CODEOWNERS delete mode 100644 vendor/github.com/Microsoft/go-winio/LICENSE delete mode 100644 vendor/github.com/Microsoft/go-winio/README.md delete mode 100644 vendor/github.com/Microsoft/go-winio/SECURITY.md delete mode 100644 vendor/github.com/Microsoft/go-winio/backup.go delete mode 100644 vendor/github.com/Microsoft/go-winio/doc.go delete mode 100644 vendor/github.com/Microsoft/go-winio/ea.go delete mode 100644 vendor/github.com/Microsoft/go-winio/file.go delete mode 100644 vendor/github.com/Microsoft/go-winio/fileinfo.go delete mode 100644 vendor/github.com/Microsoft/go-winio/hvsock.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/fs/doc.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/fs/fs.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/fs/security.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/socket/socket.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go delete mode 100644 vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pipe.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go delete mode 100644 vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go delete mode 100644 vendor/github.com/Microsoft/go-winio/privilege.go delete mode 100644 vendor/github.com/Microsoft/go-winio/reparse.go delete mode 100644 vendor/github.com/Microsoft/go-winio/sd.go delete mode 100644 vendor/github.com/Microsoft/go-winio/syscall.go delete mode 100644 vendor/github.com/Microsoft/go-winio/tools.go delete mode 100644 vendor/github.com/Microsoft/go-winio/zsyscall_windows.go delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/.gitignore delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/LICENSE delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/README.md delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/depguard.go delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/errors.go delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/variables.go delete mode 100644 vendor/github.com/OpenPeeDeeP/depguard/v2/settings.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/AUTHORS delete mode 100644 vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS delete mode 100644 vendor/github.com/ProtonMail/go-crypto/LICENSE delete mode 100644 vendor/github.com/ProtonMail/go-crypto/PATENTS delete mode 100644 vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/eax/eax.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/clearsign/clearsign.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/read.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go delete mode 100644 vendor/github.com/ProtonMail/go-crypto/openpgp/write.go delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/.goreleaser.yml delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/COPYING delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/LICENSE-MIT delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/README.md delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/UNLICENSE delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/check.go delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/decl.go delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/def.go delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/doc.go delete mode 100644 vendor/github.com/alecthomas/go-check-sumtype/run.go delete mode 100644 vendor/github.com/alexkohler/nakedret/v2/.gitignore delete mode 100644 vendor/github.com/alexkohler/nakedret/v2/LICENSE delete mode 100644 vendor/github.com/alexkohler/nakedret/v2/README.md delete mode 100644 vendor/github.com/alexkohler/nakedret/v2/import.go delete mode 100644 vendor/github.com/alexkohler/nakedret/v2/nakedret.go delete mode 100644 vendor/github.com/alexkohler/prealloc/LICENSE delete mode 100644 vendor/github.com/alexkohler/prealloc/pkg/prealloc.go delete mode 100644 vendor/github.com/alingse/asasalint/.gitignore delete mode 100644 vendor/github.com/alingse/asasalint/.goreleaser.yml delete mode 100644 vendor/github.com/alingse/asasalint/LICENSE delete mode 100644 vendor/github.com/alingse/asasalint/Makefile delete mode 100644 vendor/github.com/alingse/asasalint/README.md delete mode 100644 vendor/github.com/alingse/asasalint/asasalint.go delete mode 100644 vendor/github.com/asaskevich/govalidator/.gitignore delete mode 100644 vendor/github.com/asaskevich/govalidator/.travis.yml delete mode 100644 vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md delete mode 100644 vendor/github.com/asaskevich/govalidator/LICENSE delete mode 100644 vendor/github.com/asaskevich/govalidator/README.md delete mode 100644 vendor/github.com/asaskevich/govalidator/arrays.go delete mode 100644 vendor/github.com/asaskevich/govalidator/converter.go delete mode 100644 vendor/github.com/asaskevich/govalidator/doc.go delete mode 100644 vendor/github.com/asaskevich/govalidator/error.go delete mode 100644 vendor/github.com/asaskevich/govalidator/numerics.go delete mode 100644 vendor/github.com/asaskevich/govalidator/patterns.go delete mode 100644 vendor/github.com/asaskevich/govalidator/types.go delete mode 100644 vendor/github.com/asaskevich/govalidator/utils.go delete mode 100644 vendor/github.com/asaskevich/govalidator/validator.go delete mode 100644 vendor/github.com/asaskevich/govalidator/wercker.yml delete mode 100644 vendor/github.com/ashanbrown/forbidigo/LICENSE delete mode 100644 vendor/github.com/ashanbrown/forbidigo/forbidigo/config_options.go delete mode 100644 vendor/github.com/ashanbrown/forbidigo/forbidigo/forbidigo.go delete mode 100644 vendor/github.com/ashanbrown/forbidigo/forbidigo/patterns.go delete mode 100644 vendor/github.com/ashanbrown/makezero/LICENSE delete mode 100644 vendor/github.com/ashanbrown/makezero/makezero/makezero.go delete mode 100644 vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE delete mode 100644 vendor/github.com/aymanbagabas/go-osc52/v2/README.md delete mode 100644 vendor/github.com/aymanbagabas/go-osc52/v2/osc52.go delete mode 100644 vendor/github.com/bkielbasa/cyclop/LICENSE delete mode 100644 vendor/github.com/bkielbasa/cyclop/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/blakesmith/ar/.gitignore delete mode 100644 vendor/github.com/blakesmith/ar/COPYING delete mode 100644 vendor/github.com/blakesmith/ar/README.md delete mode 100644 vendor/github.com/blakesmith/ar/common.go delete mode 100644 vendor/github.com/blakesmith/ar/reader.go delete mode 100644 vendor/github.com/blakesmith/ar/writer.go delete mode 100644 vendor/github.com/blizzy78/varnamelen/.editorconfig delete mode 100644 vendor/github.com/blizzy78/varnamelen/.gitignore delete mode 100644 vendor/github.com/blizzy78/varnamelen/.golangci.yml delete mode 100644 vendor/github.com/blizzy78/varnamelen/LICENSE delete mode 100644 vendor/github.com/blizzy78/varnamelen/README.md delete mode 100644 vendor/github.com/blizzy78/varnamelen/doc.go delete mode 100644 vendor/github.com/blizzy78/varnamelen/flags.go delete mode 100644 vendor/github.com/blizzy78/varnamelen/typeparam.go delete mode 100644 vendor/github.com/blizzy78/varnamelen/typeparam_go1.16.go delete mode 100644 vendor/github.com/blizzy78/varnamelen/varnamelen.code-workspace delete mode 100644 vendor/github.com/blizzy78/varnamelen/varnamelen.go delete mode 100644 vendor/github.com/bombsimon/wsl/v3/.gitignore delete mode 100644 vendor/github.com/bombsimon/wsl/v3/.golangci.yml delete mode 100644 vendor/github.com/bombsimon/wsl/v3/LICENSE delete mode 100644 vendor/github.com/bombsimon/wsl/v3/README.md delete mode 100644 vendor/github.com/bombsimon/wsl/v3/wsl.go delete mode 100644 vendor/github.com/breml/bidichk/LICENSE delete mode 100644 vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go delete mode 100644 vendor/github.com/breml/bidichk/pkg/bidichk/version.go delete mode 100644 vendor/github.com/breml/errchkjson/.gitignore delete mode 100644 vendor/github.com/breml/errchkjson/.goreleaser.yml delete mode 100644 vendor/github.com/breml/errchkjson/LICENSE delete mode 100644 vendor/github.com/breml/errchkjson/README.md delete mode 100644 vendor/github.com/breml/errchkjson/errchkjson.go delete mode 100644 vendor/github.com/breml/errchkjson/noexported_error.go delete mode 100644 vendor/github.com/breml/errchkjson/unsupported_error.go delete mode 100644 vendor/github.com/breml/errchkjson/version.go delete mode 100644 vendor/github.com/briandowns/spinner/.gitignore delete mode 100644 vendor/github.com/briandowns/spinner/.travis.yml delete mode 100644 vendor/github.com/briandowns/spinner/LICENSE delete mode 100644 vendor/github.com/briandowns/spinner/Makefile delete mode 100644 vendor/github.com/briandowns/spinner/NOTICE.txt delete mode 100644 vendor/github.com/briandowns/spinner/README.md delete mode 100644 vendor/github.com/briandowns/spinner/character_sets.go delete mode 100644 vendor/github.com/briandowns/spinner/spinner.go delete mode 100644 vendor/github.com/bufbuild/buf/LICENSE delete mode 100644 vendor/github.com/bufbuild/buf/cmd/buf/main.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufapp/bufapp.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufapp/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcli/bufcli.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcli/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcli/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufconvert/bufconvert.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufconvert/message_encoding_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufconvert/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/bufcurl.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/headers.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/invoker.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/io.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/reflection_resolver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/tls.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufcurl/verbose_transport.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/buffetch.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/format.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/image_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/archive_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/dir_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/git_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/internal.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/module_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/proto_file_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer_terminate_file_provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_write_bucket_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/ref_parser.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/single_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file_provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/module_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/proto_file_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/ref_parser.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/source_ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/buffetch/writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufformat/bufformat.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufformat/formatter.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufformat/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/bufgen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/features.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/generator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/image_provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufgen/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufmigrate/bufmigrate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufmigrate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufmigrate/v1beta1_migrator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/bufprint.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/curated_plugin_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/organization_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/pagination_wrapper.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_commit_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_draft_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_tag_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/stats_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/tab_writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/token_json_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/token_text_printer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufprint/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufref/bufref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufref/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufref/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufsync/bufsync.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufsync/module_commit.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufsync/syncable_module.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufsync/syncer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufsync/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/bufwire.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/file_lister.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/image_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/image_writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_set.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwire/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwork/bufwork.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwork/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwork/get.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwork/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/bufwork/workspace_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/buf.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/goversion.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/mavenversion.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/npmversion.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/swiftversion.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/plugin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/protoc.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/tokendelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/tokenget.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/tokenlist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/reposync.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/workspacepush.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/graph.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/price.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/commitget.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/commitlist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/draftdelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/draftlist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/organizationcreate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/organizationdelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/organizationget.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/plugindelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/pluginpush.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/repositorycreate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/repositorydelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/repositorydeprecate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/repositoryget.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/repositorylist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/repositoryundeprecate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/repositoryupdate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/tagcreate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/taglist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/webhookcreate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/webhookdelete.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/webhooklist.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/stats.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/studioagent.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/breaking.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/convert.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/curl.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/export.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/format.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/generate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/lint.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/lsfiles.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/internal.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/modclearcache.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/modinit.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/modopen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/modprune.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/modupdate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/push.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/registrylogin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/registrylogout.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/buf/cmd/buf/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysis.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/file_annotation.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/print.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/bufapimodule.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_resolver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreaking.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/bufbreakingconfig.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/bufbreakingbuild.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/bufbreakingcheck.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/bufbreakingv1.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/bufbreakingv1beta1.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheck.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflint.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/buflintconfig.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/buflintbuild.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/buflintcheck.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/buflintv1.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/buflintv1beta1.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/helper.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/runner.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/version_spec.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/bufconfig.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/get.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/read.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/write.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/bufconnect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/interceptors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/netrc_token_provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/static_token_provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/bufgraph.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimage.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/bufimagebuild.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/bufimagemodify.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/cc_enable_arenas.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/csharp_namespace.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/file_option_sweeper.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/go_package.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_multiple_files.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_outer_classname.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_package.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_string_check_utf8.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/multi_modifier.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/objc_class_prefix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/optimize_for.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_metadata_namespace.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_namespace.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/ruby_package.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/bufimageutil.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/image_index.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/input_file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/source_paths_remap.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/tags.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_module_dependency.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/import_tracker.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/validate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/buflock/buflock.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/buflock/lock_file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/buflock/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bufmanifest.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/mapper.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodule.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/bufmodulebuild.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_bucket_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_file_set_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_include_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/bufmodulecache.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cache_stats.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_cacher.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/bufmoduleconfig.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/bufmoduleprotocompile.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/path_resolver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/bufmoduleref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/file_info.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_identity.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_owner.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_pin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_reference.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/validate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/bufmodulestat.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/file_walker.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/internal.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file_set.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_object_info.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_read_bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/multi_module_read_bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_resolver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/single_module_read_bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/targeting_module.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/validate.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/workspace.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/bufpluginconfig.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/get.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/bufplugindocker.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/docker.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/registry_auth_config.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/bufpluginref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_identity.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_reference.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/plugin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/binary_handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go18.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go19.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/generator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/normalize.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_gen_swift_stderr_write_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_proxy_handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_darwin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_undarwin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/version.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/wasm_handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/bufreflect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremoteplugin.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/buffer_codec.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/bufstudioagent.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/plain_post_handler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/buftransport.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/bufwasm.go delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/testdata/echo.wasm delete mode 100644 vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/data/dataspdx/dataspdx.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/data/dataspdx/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/data/datawkt/datawkt.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/data/datawkt/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/admin.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/authn.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/authz.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/convert.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/display.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/doc.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/download.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/generate.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/github.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/image.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/jsonschema.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/labels.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/organization.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/owner.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/plugin.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/plugin_curation.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/push.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/recommendation.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/reference.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_branch.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_commit.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/repository_tag.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/resolve.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/resource.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/schema.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/scim_token.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/search.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/studio.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/studio_request.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/sync.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/token.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/user.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect/webhook.connect.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1/config.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/image.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/config.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/module.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/admin.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authn.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authz.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/convert.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/display.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/doc.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/download.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/generate.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/git_metadata.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/github.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/image.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/jsonschema.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/labels.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/module.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/organization.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/owner.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/push.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/recommendation.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/reference.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_branch.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_commit.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_tag.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resolve.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resource.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/role.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/schema.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/scim_token.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/search.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio_request.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/sync.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/token.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/user.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/verification_status.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/webhook.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/invoke.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/wasmplugin.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/reflection.pb.go delete mode 100644 vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/app.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/app_error.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/app_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/app_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/appcmd.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/cobra.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/error.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/webpages.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appflag/appflag.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appflag/builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appflag/container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appflag/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/applog/applog.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/applog/container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/applog/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appname/appname.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appname/container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appname/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appproto.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/appprotoos.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/response_writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/generator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_builder.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_writer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appproto/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/appverbose.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/arg_container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/env_container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/stderr_container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/stdin_container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/stdout_container.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/app/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/certclient.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/command/command.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/command/process.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/command/runner.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/command/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/connectclient/connectclient.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/connectclient/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/dag/dag.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/dag/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/diff/diff.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/diff/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/encoding/encoding.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/encoding/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/filepathextended/filepathextended.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/filepathextended/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/annotated_tag.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/branch.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/cloner.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/commit.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/git.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/hash.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/ident.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/lister.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/object_reader.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/packed_refs.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/ref.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/ref_branch.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/repository.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/tree.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/tree_node.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/git/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/env_authenticator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/httpauth.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/multi_authenticator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/netrc_authenticator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/nop_authenticator.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/httpauth/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/interrupt/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/ioextended/ioextended.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/ioextended/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/manifest/blob.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/manifest/digest.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/manifest/manifest.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/manifest/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netextended/netextended.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netextended/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netrc/machine.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/netrc/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_windows.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/normalpath/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/observabilityzap.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/tracer_provider_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/zapexporter.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/osextended/osextended.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/osextended/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/protodescriptor.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_marshaler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_unmarshaler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/protoencoding.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/reparse_unrecognized.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/resolver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_marshaler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_unmarshaler.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/descriptor.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/enum.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_range.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_value.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/field.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/file.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/file_import.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/files.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/location.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/location_descriptor.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/location_store.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/merge_comment_location.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/message.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/message_range.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/method.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/named_descriptor.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/oneof.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/option_extension_descriptor.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/paths.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/protosource.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/reserved_name.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/service.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protosource/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protostat/protostat.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protostat/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/prototime/prototime.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/prototime/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoversion/package_version.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoversion/protoversion.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/protoversion/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/copy.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/diff.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/errors.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/limit.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/map.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/mapper.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/matcher.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/multi.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storage.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/storagearchive.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/untar_options.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/doc.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/storagegit.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/read_object_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/storagemanifest.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/immutable_object.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/read_object_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/storagemem.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/write_object_closer.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/bucket.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/provider.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/storageos.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/storageutil.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/storage/util.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/stringutil/stringutil.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/stringutil/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/thread/thread.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/thread/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/tmp/tmp.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/tmp/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/client.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/httpclient.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/httpserver.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/uuidutil/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/uuidutil/uuidutil.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/verbose/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/verbose/verbose.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/zaputil/usage.gen.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/zaputil/vars.go delete mode 100644 vendor/github.com/bufbuild/buf/private/pkg/zaputil/zaputil.go delete mode 100644 vendor/github.com/bufbuild/buf/private/usage/usage.go delete mode 100644 vendor/github.com/bufbuild/buf/private/usage/usage_unix.go delete mode 100644 vendor/github.com/bufbuild/buf/private/usage/usage_windows.go delete mode 100644 vendor/github.com/bufbuild/connect-go/.gitignore delete mode 100644 vendor/github.com/bufbuild/connect-go/.golangci.yml delete mode 100644 vendor/github.com/bufbuild/connect-go/LICENSE delete mode 100644 vendor/github.com/bufbuild/connect-go/Makefile delete mode 100644 vendor/github.com/bufbuild/connect-go/README.md delete mode 100644 vendor/github.com/bufbuild/connect-go/buf.gen.yaml delete mode 100644 vendor/github.com/bufbuild/connect-go/buf.work.yaml delete mode 100644 vendor/github.com/bufbuild/connect-go/buffer_pool.go delete mode 100644 vendor/github.com/bufbuild/connect-go/client.go delete mode 100644 vendor/github.com/bufbuild/connect-go/client_stream.go delete mode 100644 vendor/github.com/bufbuild/connect-go/code.go delete mode 100644 vendor/github.com/bufbuild/connect-go/codec.go delete mode 100644 vendor/github.com/bufbuild/connect-go/compression.go delete mode 100644 vendor/github.com/bufbuild/connect-go/connect.go delete mode 100644 vendor/github.com/bufbuild/connect-go/duplex_http_call.go delete mode 100644 vendor/github.com/bufbuild/connect-go/envelope.go delete mode 100644 vendor/github.com/bufbuild/connect-go/error.go delete mode 100644 vendor/github.com/bufbuild/connect-go/error_writer.go delete mode 100644 vendor/github.com/bufbuild/connect-go/handler.go delete mode 100644 vendor/github.com/bufbuild/connect-go/handler_stream.go delete mode 100644 vendor/github.com/bufbuild/connect-go/header.go delete mode 100644 vendor/github.com/bufbuild/connect-go/idempotency_level.go delete mode 100644 vendor/github.com/bufbuild/connect-go/interceptor.go delete mode 100644 vendor/github.com/bufbuild/connect-go/internal/gen/connectext/grpc/status/v1/status.pb.go delete mode 100644 vendor/github.com/bufbuild/connect-go/option.go delete mode 100644 vendor/github.com/bufbuild/connect-go/protobuf_util.go delete mode 100644 vendor/github.com/bufbuild/connect-go/protocol.go delete mode 100644 vendor/github.com/bufbuild/connect-go/protocol_connect.go delete mode 100644 vendor/github.com/bufbuild/connect-go/protocol_grpc.go delete mode 100644 vendor/github.com/bufbuild/connect-go/recover.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/.gitignore delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/.golangci.yml delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/LICENSE delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/Makefile delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/README.md delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/attributes.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/buf.gen.yaml delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/buf.work.yaml delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/doc.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/instruments.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/interceptor.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/option.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/otelconnect.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/payloadinterceptor.go delete mode 100644 vendor/github.com/bufbuild/connect-opentelemetry-go/streaming.go delete mode 100644 vendor/github.com/bufbuild/protocompile/.gitignore delete mode 100644 vendor/github.com/bufbuild/protocompile/.golangci.yml delete mode 100644 vendor/github.com/bufbuild/protocompile/LICENSE delete mode 100644 vendor/github.com/bufbuild/protocompile/Makefile delete mode 100644 vendor/github.com/bufbuild/protocompile/README.md delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/doc.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/enum.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/field.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/file.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/file_info.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/identifiers.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/message.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/no_source.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/node.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/options.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/ranges.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/service.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/values.go delete mode 100644 vendor/github.com/bufbuild/protocompile/ast/walk.go delete mode 100644 vendor/github.com/bufbuild/protocompile/compiler.go delete mode 100644 vendor/github.com/bufbuild/protocompile/doc.go delete mode 100644 vendor/github.com/bufbuild/protocompile/go.work delete mode 100644 vendor/github.com/bufbuild/protocompile/go.work.sum delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/message_context.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/norace.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/options.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/race.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/tags.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/types.go delete mode 100644 vendor/github.com/bufbuild/protocompile/internal/util.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/descriptors.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/doc.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/files.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/linker.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/pathkey_no_unsafe.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/resolve.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/symbols.go delete mode 100644 vendor/github.com/bufbuild/protocompile/linker/validate.go delete mode 100644 vendor/github.com/bufbuild/protocompile/options/options.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/.gitignore delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/ast.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/clone.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/doc.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/errors.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/lexer.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/parser.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/proto.y delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/proto.y.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/result.go delete mode 100644 vendor/github.com/bufbuild/protocompile/parser/validate.go delete mode 100644 vendor/github.com/bufbuild/protocompile/protoutil/protos.go delete mode 100644 vendor/github.com/bufbuild/protocompile/reporter/errors.go delete mode 100644 vendor/github.com/bufbuild/protocompile/reporter/reporter.go delete mode 100644 vendor/github.com/bufbuild/protocompile/resolver.go delete mode 100644 vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go delete mode 100644 vendor/github.com/bufbuild/protocompile/std_imports.go delete mode 100644 vendor/github.com/bufbuild/protocompile/walk/walk.go delete mode 100644 vendor/github.com/butuzov/ireturn/LICENSE delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/analyzer.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/disallow.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/config/allow.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/config/config.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/config/new.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/config/reject.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/types/iface.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/types/names.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/internal/types/types.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/std.go delete mode 100644 vendor/github.com/butuzov/ireturn/analyzer/typeparams.go delete mode 100644 vendor/github.com/butuzov/mirror/.act delete mode 100644 vendor/github.com/butuzov/mirror/.editorconfig delete mode 100644 vendor/github.com/butuzov/mirror/.gitignore delete mode 100644 vendor/github.com/butuzov/mirror/.goreleaser.yaml delete mode 100644 vendor/github.com/butuzov/mirror/LICENSE delete mode 100644 vendor/github.com/butuzov/mirror/MIRROR_FUNCS.md delete mode 100644 vendor/github.com/butuzov/mirror/Makefile delete mode 100644 vendor/github.com/butuzov/mirror/Taskfile.yml delete mode 100644 vendor/github.com/butuzov/mirror/analyzer.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_bufio.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_bytes.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_httptest.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_maphash.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_os.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_regexp.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_strings.go delete mode 100644 vendor/github.com/butuzov/mirror/checkers_utf8.go delete mode 100644 vendor/github.com/butuzov/mirror/internal/checker/checker.go delete mode 100644 vendor/github.com/butuzov/mirror/internal/checker/imports.go delete mode 100644 vendor/github.com/butuzov/mirror/internal/checker/violation.go delete mode 100644 vendor/github.com/butuzov/mirror/readme.md delete mode 100644 vendor/github.com/caarlos0/go-version/.gitignore delete mode 100644 vendor/github.com/caarlos0/go-version/.goreleaser.yml delete mode 100644 vendor/github.com/caarlos0/go-version/LICENSE.md delete mode 100644 vendor/github.com/caarlos0/go-version/README.md delete mode 100644 vendor/github.com/caarlos0/go-version/version.go delete mode 100644 vendor/github.com/catenacyber/perfsprint/LICENSE delete mode 100644 vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/.travis.yml delete mode 100644 vendor/github.com/cavaliergopher/cpio/LICENSE delete mode 100644 vendor/github.com/cavaliergopher/cpio/README.md delete mode 100644 vendor/github.com/cavaliergopher/cpio/doc.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/fileinfo.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/hash.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/header.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/reader.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/svr4.go delete mode 100644 vendor/github.com/cavaliergopher/cpio/writer.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/.gitignore delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/.golangci.yml delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/.goreleaser.yml delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/LICENSE.txt delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/Makefile delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/README.md delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/adjacency/adjcmartix.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/data/bindata.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/entropy/entropyCalculator.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/frequency/frequency.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/match/match.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/dateMatchers.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/dictionaryMatch.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/leet.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/matching.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/repeatMatch.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/sequenceMatch.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/matching/spatialMatch.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/renovate.json delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/scoring/scoring.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/utils/math/mathutils.go delete mode 100644 vendor/github.com/ccojocar/zxcvbn-go/zxcvbn.go delete mode 100644 vendor/github.com/charithe/durationcheck/.gitignore delete mode 100644 vendor/github.com/charithe/durationcheck/LICENSE delete mode 100644 vendor/github.com/charithe/durationcheck/Makefile delete mode 100644 vendor/github.com/charithe/durationcheck/README.md delete mode 100644 vendor/github.com/charithe/durationcheck/durationcheck.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/.gitignore delete mode 100644 vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml delete mode 100644 vendor/github.com/charmbracelet/lipgloss/.golangci.yml delete mode 100644 vendor/github.com/charmbracelet/lipgloss/LICENSE delete mode 100644 vendor/github.com/charmbracelet/lipgloss/README.md delete mode 100644 vendor/github.com/charmbracelet/lipgloss/align.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/ansi_unix.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/ansi_windows.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/borders.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/color.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/get.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/join.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/position.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/renderer.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/runes.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/set.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/size.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/style.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/unset.go delete mode 100644 vendor/github.com/charmbracelet/lipgloss/whitespace.go delete mode 100644 vendor/github.com/chavacava/garif/.gitignore delete mode 100644 vendor/github.com/chavacava/garif/LICENSE delete mode 100644 vendor/github.com/chavacava/garif/README.md delete mode 100644 vendor/github.com/chavacava/garif/constructors.go delete mode 100644 vendor/github.com/chavacava/garif/decorators.go delete mode 100644 vendor/github.com/chavacava/garif/doc.go delete mode 100644 vendor/github.com/chavacava/garif/enums.go delete mode 100644 vendor/github.com/chavacava/garif/io.go delete mode 100644 vendor/github.com/chavacava/garif/models.go delete mode 100644 vendor/github.com/cloudflare/circl/LICENSE delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/doc.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/key.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x25519/table.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/doc.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/key.go delete mode 100644 vendor/github.com/cloudflare/circl/dh/x448/table.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go delete mode 100644 vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/conv/conv.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/doc.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/hashes.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/rc.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/sha3.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/shake.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/xor.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go delete mode 100644 vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.s delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp_generic.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go delete mode 100644 vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go delete mode 100644 vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go delete mode 100644 vendor/github.com/cloudflare/circl/math/mlsbset/power.go delete mode 100644 vendor/github.com/cloudflare/circl/math/primes.go delete mode 100644 vendor/github.com/cloudflare/circl/math/wnaf.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/modular.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/mult.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/point.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed25519/tables.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed448/ed448.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/ed448/signapi.go delete mode 100644 vendor/github.com/cloudflare/circl/sign/sign.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/build.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go delete mode 100644 vendor/github.com/containerd/stargz-snapshotter/estargz/types.go delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go delete mode 100644 vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go delete mode 100644 vendor/github.com/creack/pty/.gitignore delete mode 100644 vendor/github.com/creack/pty/Dockerfile.golang delete mode 100644 vendor/github.com/creack/pty/Dockerfile.riscv delete mode 100644 vendor/github.com/creack/pty/LICENSE delete mode 100644 vendor/github.com/creack/pty/README.md delete mode 100644 vendor/github.com/creack/pty/asm_solaris_amd64.s delete mode 100644 vendor/github.com/creack/pty/doc.go delete mode 100644 vendor/github.com/creack/pty/ioctl.go delete mode 100644 vendor/github.com/creack/pty/ioctl_bsd.go delete mode 100644 vendor/github.com/creack/pty/ioctl_solaris.go delete mode 100644 vendor/github.com/creack/pty/ioctl_unsupported.go delete mode 100644 vendor/github.com/creack/pty/mktypes.bash delete mode 100644 vendor/github.com/creack/pty/pty_darwin.go delete mode 100644 vendor/github.com/creack/pty/pty_dragonfly.go delete mode 100644 vendor/github.com/creack/pty/pty_freebsd.go delete mode 100644 vendor/github.com/creack/pty/pty_linux.go delete mode 100644 vendor/github.com/creack/pty/pty_netbsd.go delete mode 100644 vendor/github.com/creack/pty/pty_openbsd.go delete mode 100644 vendor/github.com/creack/pty/pty_solaris.go delete mode 100644 vendor/github.com/creack/pty/pty_unsupported.go delete mode 100644 vendor/github.com/creack/pty/run.go delete mode 100644 vendor/github.com/creack/pty/start.go delete mode 100644 vendor/github.com/creack/pty/start_windows.go delete mode 100644 vendor/github.com/creack/pty/test_crosscompile.sh delete mode 100644 vendor/github.com/creack/pty/winsize.go delete mode 100644 vendor/github.com/creack/pty/winsize_unix.go delete mode 100644 vendor/github.com/creack/pty/winsize_unsupported.go delete mode 100644 vendor/github.com/creack/pty/ztypes_386.go delete mode 100644 vendor/github.com/creack/pty/ztypes_amd64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_arm.go delete mode 100644 vendor/github.com/creack/pty/ztypes_arm64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_freebsd_386.go delete mode 100644 vendor/github.com/creack/pty/ztypes_freebsd_amd64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_freebsd_arm.go delete mode 100644 vendor/github.com/creack/pty/ztypes_freebsd_arm64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_freebsd_ppc64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_loong64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_mipsx.go delete mode 100644 vendor/github.com/creack/pty/ztypes_netbsd_32bit_int.go delete mode 100644 vendor/github.com/creack/pty/ztypes_openbsd_32bit_int.go delete mode 100644 vendor/github.com/creack/pty/ztypes_ppc64.go delete mode 100644 vendor/github.com/creack/pty/ztypes_ppc64le.go delete mode 100644 vendor/github.com/creack/pty/ztypes_riscvx.go delete mode 100644 vendor/github.com/creack/pty/ztypes_s390x.go delete mode 100644 vendor/github.com/curioswitch/go-reassign/.gitattributes delete mode 100644 vendor/github.com/curioswitch/go-reassign/.gitignore delete mode 100644 vendor/github.com/curioswitch/go-reassign/.golangci.yml delete mode 100644 vendor/github.com/curioswitch/go-reassign/.goreleaser.yaml delete mode 100644 vendor/github.com/curioswitch/go-reassign/LICENSE delete mode 100644 vendor/github.com/curioswitch/go-reassign/README.md delete mode 100644 vendor/github.com/curioswitch/go-reassign/analyzer.go delete mode 100644 vendor/github.com/curioswitch/go-reassign/internal/analyzer/analyzer.go delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/LICENSE delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/README.md delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/VERSION delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/join.go delete mode 100644 vendor/github.com/cyphar/filepath-securejoin/vfs.go delete mode 100644 vendor/github.com/daixiang0/gci/LICENSE delete mode 100644 vendor/github.com/daixiang0/gci/pkg/config/config.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/format/format.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/gci/gci.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/gci/testdata.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/io/file.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/io/search.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/io/stdin.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/log/log.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/parse/parse.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/alias.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/blank.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/commentline.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/default.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/dot.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/errors.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/newline.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/parser.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/prefix.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/section.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/standard.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/section/standard_list.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/default.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/match.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/mismatch.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/name.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/specificity.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/specificity/standard.go delete mode 100644 vendor/github.com/daixiang0/gci/pkg/utils/constants.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/.gitignore delete mode 100644 vendor/github.com/denis-tingaikin/go-header/.go-header.yml delete mode 100644 vendor/github.com/denis-tingaikin/go-header/LICENSE delete mode 100644 vendor/github.com/denis-tingaikin/go-header/README.md delete mode 100644 vendor/github.com/denis-tingaikin/go-header/analyzer.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/config.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/issue.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/location.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/option.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/reader.go delete mode 100644 vendor/github.com/denis-tingaikin/go-header/value.go delete mode 100644 vendor/github.com/distribution/reference/.gitattributes delete mode 100644 vendor/github.com/distribution/reference/.gitignore delete mode 100644 vendor/github.com/distribution/reference/.golangci.yml delete mode 100644 vendor/github.com/distribution/reference/CODE-OF-CONDUCT.md delete mode 100644 vendor/github.com/distribution/reference/CONTRIBUTING.md delete mode 100644 vendor/github.com/distribution/reference/GOVERNANCE.md delete mode 100644 vendor/github.com/distribution/reference/LICENSE delete mode 100644 vendor/github.com/distribution/reference/MAINTAINERS delete mode 100644 vendor/github.com/distribution/reference/Makefile delete mode 100644 vendor/github.com/distribution/reference/README.md delete mode 100644 vendor/github.com/distribution/reference/SECURITY.md delete mode 100644 vendor/github.com/distribution/reference/distribution-logo.svg delete mode 100644 vendor/github.com/distribution/reference/helpers.go delete mode 100644 vendor/github.com/distribution/reference/normalize.go delete mode 100644 vendor/github.com/distribution/reference/reference.go delete mode 100644 vendor/github.com/distribution/reference/regexp.go delete mode 100644 vendor/github.com/distribution/reference/sort.go delete mode 100644 vendor/github.com/docker/cli/AUTHORS delete mode 100644 vendor/github.com/docker/cli/LICENSE delete mode 100644 vendor/github.com/docker/cli/NOTICE delete mode 100644 vendor/github.com/docker/cli/cli/config/config.go delete mode 100644 vendor/github.com/docker/cli/cli/config/configfile/file.go delete mode 100644 vendor/github.com/docker/cli/cli/config/configfile/file_unix.go delete mode 100644 vendor/github.com/docker/cli/cli/config/configfile/file_windows.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/credentials.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/default_store.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/default_store_darwin.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/default_store_linux.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/default_store_unsupported.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/default_store_windows.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/file_store.go delete mode 100644 vendor/github.com/docker/cli/cli/config/credentials/native_store.go delete mode 100644 vendor/github.com/docker/cli/cli/config/types/authconfig.go delete mode 100644 vendor/github.com/docker/distribution/LICENSE delete mode 100644 vendor/github.com/docker/distribution/reference/helpers_deprecated.go delete mode 100644 vendor/github.com/docker/distribution/reference/normalize_deprecated.go delete mode 100644 vendor/github.com/docker/distribution/reference/reference_deprecated.go delete mode 100644 vendor/github.com/docker/distribution/reference/regexp_deprecated.go delete mode 100644 vendor/github.com/docker/distribution/reference/sort_deprecated.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/auth/challenge/addr.go delete mode 100644 vendor/github.com/docker/distribution/registry/client/auth/challenge/authchallenge.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/LICENSE delete mode 100644 vendor/github.com/docker/docker-credential-helpers/client/client.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/client/command.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/credentials/error.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/credentials/helper.go delete mode 100644 vendor/github.com/docker/docker-credential-helpers/credentials/version.go delete mode 100644 vendor/github.com/docker/docker/AUTHORS delete mode 100644 vendor/github.com/docker/docker/LICENSE delete mode 100644 vendor/github.com/docker/docker/NOTICE delete mode 100644 vendor/github.com/docker/docker/api/README.md delete mode 100644 vendor/github.com/docker/docker/api/common.go delete mode 100644 vendor/github.com/docker/docker/api/common_unix.go delete mode 100644 vendor/github.com/docker/docker/api/common_windows.go delete mode 100644 vendor/github.com/docker/docker/api/swagger-gen.yaml delete mode 100644 vendor/github.com/docker/docker/api/swagger.yaml delete mode 100644 vendor/github.com/docker/docker/api/types/auth.go delete mode 100644 vendor/github.com/docker/docker/api/types/blkiodev/blkio.go delete mode 100644 vendor/github.com/docker/docker/api/types/client.go delete mode 100644 vendor/github.com/docker/docker/api/types/configs.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/change_response_deprecated.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/change_type.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/change_types.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/config.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/container_top.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/container_update.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/create_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/filesystem_change.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/hostconfig.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/hostconfig_unix.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/wait_exit_error.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/wait_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/container/waitcondition.go delete mode 100644 vendor/github.com/docker/docker/api/types/error_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/error_response_ext.go delete mode 100644 vendor/github.com/docker/docker/api/types/events/events.go delete mode 100644 vendor/github.com/docker/docker/api/types/filters/errors.go delete mode 100644 vendor/github.com/docker/docker/api/types/filters/parse.go delete mode 100644 vendor/github.com/docker/docker/api/types/graph_driver_data.go delete mode 100644 vendor/github.com/docker/docker/api/types/id_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/image/image_history.go delete mode 100644 vendor/github.com/docker/docker/api/types/image/opts.go delete mode 100644 vendor/github.com/docker/docker/api/types/image_delete_response_item.go delete mode 100644 vendor/github.com/docker/docker/api/types/image_summary.go delete mode 100644 vendor/github.com/docker/docker/api/types/mount/mount.go delete mode 100644 vendor/github.com/docker/docker/api/types/network/network.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin_device.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin_env.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin_interface_type.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin_mount.go delete mode 100644 vendor/github.com/docker/docker/api/types/plugin_responses.go delete mode 100644 vendor/github.com/docker/docker/api/types/port.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/authconfig.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/authenticate.go delete mode 100644 vendor/github.com/docker/docker/api/types/registry/registry.go delete mode 100644 vendor/github.com/docker/docker/api/types/service_update_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/stats.go delete mode 100644 vendor/github.com/docker/docker/api/types/strslice/strslice.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/common.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/config.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/container.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/network.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/node.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/runtime.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/runtime/gen.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.pb.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/secret.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/service.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/swarm.go delete mode 100644 vendor/github.com/docker/docker/api/types/swarm/task.go delete mode 100644 vendor/github.com/docker/docker/api/types/time/timestamp.go delete mode 100644 vendor/github.com/docker/docker/api/types/types.go delete mode 100644 vendor/github.com/docker/docker/api/types/versions/README.md delete mode 100644 vendor/github.com/docker/docker/api/types/versions/compare.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/cluster_volume.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/create_options.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/list_response.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/options.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/volume.go delete mode 100644 vendor/github.com/docker/docker/api/types/volume/volume_update.go delete mode 100644 vendor/github.com/docker/docker/client/README.md delete mode 100644 vendor/github.com/docker/docker/client/build_cancel.go delete mode 100644 vendor/github.com/docker/docker/client/build_prune.go delete mode 100644 vendor/github.com/docker/docker/client/checkpoint_create.go delete mode 100644 vendor/github.com/docker/docker/client/checkpoint_delete.go delete mode 100644 vendor/github.com/docker/docker/client/checkpoint_list.go delete mode 100644 vendor/github.com/docker/docker/client/client.go delete mode 100644 vendor/github.com/docker/docker/client/client_deprecated.go delete mode 100644 vendor/github.com/docker/docker/client/client_unix.go delete mode 100644 vendor/github.com/docker/docker/client/client_windows.go delete mode 100644 vendor/github.com/docker/docker/client/config_create.go delete mode 100644 vendor/github.com/docker/docker/client/config_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/config_list.go delete mode 100644 vendor/github.com/docker/docker/client/config_remove.go delete mode 100644 vendor/github.com/docker/docker/client/config_update.go delete mode 100644 vendor/github.com/docker/docker/client/container_attach.go delete mode 100644 vendor/github.com/docker/docker/client/container_commit.go delete mode 100644 vendor/github.com/docker/docker/client/container_copy.go delete mode 100644 vendor/github.com/docker/docker/client/container_create.go delete mode 100644 vendor/github.com/docker/docker/client/container_diff.go delete mode 100644 vendor/github.com/docker/docker/client/container_exec.go delete mode 100644 vendor/github.com/docker/docker/client/container_export.go delete mode 100644 vendor/github.com/docker/docker/client/container_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/container_kill.go delete mode 100644 vendor/github.com/docker/docker/client/container_list.go delete mode 100644 vendor/github.com/docker/docker/client/container_logs.go delete mode 100644 vendor/github.com/docker/docker/client/container_pause.go delete mode 100644 vendor/github.com/docker/docker/client/container_prune.go delete mode 100644 vendor/github.com/docker/docker/client/container_remove.go delete mode 100644 vendor/github.com/docker/docker/client/container_rename.go delete mode 100644 vendor/github.com/docker/docker/client/container_resize.go delete mode 100644 vendor/github.com/docker/docker/client/container_restart.go delete mode 100644 vendor/github.com/docker/docker/client/container_start.go delete mode 100644 vendor/github.com/docker/docker/client/container_stats.go delete mode 100644 vendor/github.com/docker/docker/client/container_stop.go delete mode 100644 vendor/github.com/docker/docker/client/container_top.go delete mode 100644 vendor/github.com/docker/docker/client/container_unpause.go delete mode 100644 vendor/github.com/docker/docker/client/container_update.go delete mode 100644 vendor/github.com/docker/docker/client/container_wait.go delete mode 100644 vendor/github.com/docker/docker/client/disk_usage.go delete mode 100644 vendor/github.com/docker/docker/client/distribution_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/envvars.go delete mode 100644 vendor/github.com/docker/docker/client/errors.go delete mode 100644 vendor/github.com/docker/docker/client/events.go delete mode 100644 vendor/github.com/docker/docker/client/hijack.go delete mode 100644 vendor/github.com/docker/docker/client/image_build.go delete mode 100644 vendor/github.com/docker/docker/client/image_create.go delete mode 100644 vendor/github.com/docker/docker/client/image_history.go delete mode 100644 vendor/github.com/docker/docker/client/image_import.go delete mode 100644 vendor/github.com/docker/docker/client/image_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/image_list.go delete mode 100644 vendor/github.com/docker/docker/client/image_load.go delete mode 100644 vendor/github.com/docker/docker/client/image_prune.go delete mode 100644 vendor/github.com/docker/docker/client/image_pull.go delete mode 100644 vendor/github.com/docker/docker/client/image_push.go delete mode 100644 vendor/github.com/docker/docker/client/image_remove.go delete mode 100644 vendor/github.com/docker/docker/client/image_save.go delete mode 100644 vendor/github.com/docker/docker/client/image_search.go delete mode 100644 vendor/github.com/docker/docker/client/image_tag.go delete mode 100644 vendor/github.com/docker/docker/client/info.go delete mode 100644 vendor/github.com/docker/docker/client/interface.go delete mode 100644 vendor/github.com/docker/docker/client/interface_experimental.go delete mode 100644 vendor/github.com/docker/docker/client/interface_stable.go delete mode 100644 vendor/github.com/docker/docker/client/login.go delete mode 100644 vendor/github.com/docker/docker/client/network_connect.go delete mode 100644 vendor/github.com/docker/docker/client/network_create.go delete mode 100644 vendor/github.com/docker/docker/client/network_disconnect.go delete mode 100644 vendor/github.com/docker/docker/client/network_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/network_list.go delete mode 100644 vendor/github.com/docker/docker/client/network_prune.go delete mode 100644 vendor/github.com/docker/docker/client/network_remove.go delete mode 100644 vendor/github.com/docker/docker/client/node_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/node_list.go delete mode 100644 vendor/github.com/docker/docker/client/node_remove.go delete mode 100644 vendor/github.com/docker/docker/client/node_update.go delete mode 100644 vendor/github.com/docker/docker/client/options.go delete mode 100644 vendor/github.com/docker/docker/client/ping.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_create.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_disable.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_enable.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_install.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_list.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_push.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_remove.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_set.go delete mode 100644 vendor/github.com/docker/docker/client/plugin_upgrade.go delete mode 100644 vendor/github.com/docker/docker/client/request.go delete mode 100644 vendor/github.com/docker/docker/client/secret_create.go delete mode 100644 vendor/github.com/docker/docker/client/secret_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/secret_list.go delete mode 100644 vendor/github.com/docker/docker/client/secret_remove.go delete mode 100644 vendor/github.com/docker/docker/client/secret_update.go delete mode 100644 vendor/github.com/docker/docker/client/service_create.go delete mode 100644 vendor/github.com/docker/docker/client/service_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/service_list.go delete mode 100644 vendor/github.com/docker/docker/client/service_logs.go delete mode 100644 vendor/github.com/docker/docker/client/service_remove.go delete mode 100644 vendor/github.com/docker/docker/client/service_update.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_get_unlock_key.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_init.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_join.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_leave.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_unlock.go delete mode 100644 vendor/github.com/docker/docker/client/swarm_update.go delete mode 100644 vendor/github.com/docker/docker/client/task_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/task_list.go delete mode 100644 vendor/github.com/docker/docker/client/task_logs.go delete mode 100644 vendor/github.com/docker/docker/client/transport.go delete mode 100644 vendor/github.com/docker/docker/client/utils.go delete mode 100644 vendor/github.com/docker/docker/client/version.go delete mode 100644 vendor/github.com/docker/docker/client/volume_create.go delete mode 100644 vendor/github.com/docker/docker/client/volume_inspect.go delete mode 100644 vendor/github.com/docker/docker/client/volume_list.go delete mode 100644 vendor/github.com/docker/docker/client/volume_prune.go delete mode 100644 vendor/github.com/docker/docker/client/volume_remove.go delete mode 100644 vendor/github.com/docker/docker/client/volume_update.go delete mode 100644 vendor/github.com/docker/docker/errdefs/defs.go delete mode 100644 vendor/github.com/docker/docker/errdefs/doc.go delete mode 100644 vendor/github.com/docker/docker/errdefs/helpers.go delete mode 100644 vendor/github.com/docker/docker/errdefs/http_helpers.go delete mode 100644 vendor/github.com/docker/docker/errdefs/is.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_others.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_unix.go delete mode 100644 vendor/github.com/docker/docker/pkg/homedir/homedir_windows.go delete mode 100644 vendor/github.com/docker/docker/pkg/jsonmessage/jsonmessage.go delete mode 100644 vendor/github.com/docker/docker/pkg/stringid/stringid.go delete mode 100644 vendor/github.com/docker/go-connections/LICENSE delete mode 100644 vendor/github.com/docker/go-connections/nat/nat.go delete mode 100644 vendor/github.com/docker/go-connections/nat/parse.go delete mode 100644 vendor/github.com/docker/go-connections/nat/sort.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/README.md delete mode 100644 vendor/github.com/docker/go-connections/sockets/inmem_socket.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/proxy.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/sockets.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/sockets_unix.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/sockets_windows.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/tcp_socket.go delete mode 100644 vendor/github.com/docker/go-connections/sockets/unix_socket.go delete mode 100644 vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go delete mode 100644 vendor/github.com/docker/go-connections/tlsconfig/config.go delete mode 100644 vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go delete mode 100644 vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go delete mode 100644 vendor/github.com/docker/go-units/CONTRIBUTING.md delete mode 100644 vendor/github.com/docker/go-units/LICENSE delete mode 100644 vendor/github.com/docker/go-units/MAINTAINERS delete mode 100644 vendor/github.com/docker/go-units/README.md delete mode 100644 vendor/github.com/docker/go-units/circle.yml delete mode 100644 vendor/github.com/docker/go-units/duration.go delete mode 100644 vendor/github.com/docker/go-units/size.go delete mode 100644 vendor/github.com/docker/go-units/ulimit.go delete mode 100644 vendor/github.com/emirpasic/gods/LICENSE delete mode 100644 vendor/github.com/emirpasic/gods/containers/containers.go delete mode 100644 vendor/github.com/emirpasic/gods/containers/enumerable.go delete mode 100644 vendor/github.com/emirpasic/gods/containers/iterator.go delete mode 100644 vendor/github.com/emirpasic/gods/containers/serialization.go delete mode 100644 vendor/github.com/emirpasic/gods/lists/arraylist/arraylist.go delete mode 100644 vendor/github.com/emirpasic/gods/lists/arraylist/enumerable.go delete mode 100644 vendor/github.com/emirpasic/gods/lists/arraylist/iterator.go delete mode 100644 vendor/github.com/emirpasic/gods/lists/arraylist/serialization.go delete mode 100644 vendor/github.com/emirpasic/gods/lists/lists.go delete mode 100644 vendor/github.com/emirpasic/gods/trees/binaryheap/binaryheap.go delete mode 100644 vendor/github.com/emirpasic/gods/trees/binaryheap/iterator.go delete mode 100644 vendor/github.com/emirpasic/gods/trees/binaryheap/serialization.go delete mode 100644 vendor/github.com/emirpasic/gods/trees/trees.go delete mode 100644 vendor/github.com/emirpasic/gods/utils/comparator.go delete mode 100644 vendor/github.com/emirpasic/gods/utils/sort.go delete mode 100644 vendor/github.com/emirpasic/gods/utils/utils.go delete mode 100644 vendor/github.com/envoyproxy/protoc-gen-validate/LICENSE delete mode 100644 vendor/github.com/envoyproxy/protoc-gen-validate/validate/BUILD delete mode 100644 vendor/github.com/envoyproxy/protoc-gen-validate/validate/validate.h delete mode 100644 vendor/github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go delete mode 100644 vendor/github.com/envoyproxy/protoc-gen-validate/validate/validate.proto delete mode 100644 vendor/github.com/esimonov/ifshort/LICENSE delete mode 100644 vendor/github.com/esimonov/ifshort/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/esimonov/ifshort/pkg/analyzer/occurrences.go delete mode 100644 vendor/github.com/ettle/strcase/.gitignore delete mode 100644 vendor/github.com/ettle/strcase/.golangci.yml delete mode 100644 vendor/github.com/ettle/strcase/.readme.tmpl delete mode 100644 vendor/github.com/ettle/strcase/LICENSE delete mode 100644 vendor/github.com/ettle/strcase/Makefile delete mode 100644 vendor/github.com/ettle/strcase/README.md delete mode 100644 vendor/github.com/ettle/strcase/assert.go delete mode 100644 vendor/github.com/ettle/strcase/caser.go delete mode 100644 vendor/github.com/ettle/strcase/convert.go delete mode 100644 vendor/github.com/ettle/strcase/doc.go delete mode 100644 vendor/github.com/ettle/strcase/initialism.go delete mode 100644 vendor/github.com/ettle/strcase/split.go delete mode 100644 vendor/github.com/ettle/strcase/strcase.go delete mode 100644 vendor/github.com/ettle/strcase/unicode.go delete mode 100644 vendor/github.com/evilmartians/lefthook/.gitignore delete mode 100644 vendor/github.com/evilmartians/lefthook/.golangci.yml delete mode 100644 vendor/github.com/evilmartians/lefthook/.goreleaser.yml delete mode 100644 vendor/github.com/evilmartians/lefthook/CHANGELOG.md delete mode 100644 vendor/github.com/evilmartians/lefthook/CONTRIBUTING.md delete mode 100644 vendor/github.com/evilmartians/lefthook/LICENSE delete mode 100644 vendor/github.com/evilmartians/lefthook/Makefile delete mode 100644 vendor/github.com/evilmartians/lefthook/README.md delete mode 100644 vendor/github.com/evilmartians/lefthook/SECURITY.md delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/add-doc.txt delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/add.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/dump.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/install.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/lefthook.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/root.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/run.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/uninstall.go delete mode 100644 vendor/github.com/evilmartians/lefthook/cmd/version.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/available_hooks.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/command.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/config.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/files.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/hook.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/load.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/remote.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/script.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/config/skip.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/git/exec.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/git/lfs.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/git/remote.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/git/repository.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/git/state.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/add.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/dump.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/install.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/lefthook.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/run.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_unix.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_windows.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/executor.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/filters.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_command.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_script.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/result.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/runner.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/lefthook/uninstall.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/log/log.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/log/skip_settings.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/templates/config.tmpl delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/templates/hook.tmpl delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/templates/templates.go delete mode 100644 vendor/github.com/evilmartians/lefthook/internal/version/version.go delete mode 100644 vendor/github.com/evilmartians/lefthook/logo.svg delete mode 100644 vendor/github.com/evilmartians/lefthook/logo_sign.svg delete mode 100644 vendor/github.com/evilmartians/lefthook/main.go delete mode 100644 vendor/github.com/fatih/color/LICENSE.md delete mode 100644 vendor/github.com/fatih/color/README.md delete mode 100644 vendor/github.com/fatih/color/color.go delete mode 100644 vendor/github.com/fatih/color/color_windows.go delete mode 100644 vendor/github.com/fatih/color/doc.go delete mode 100644 vendor/github.com/fatih/structtag/LICENSE delete mode 100644 vendor/github.com/fatih/structtag/README.md delete mode 100644 vendor/github.com/fatih/structtag/tags.go delete mode 100644 vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt delete mode 100644 vendor/github.com/felixge/fgprof/LICENSE.txt delete mode 100644 vendor/github.com/felixge/fgprof/README.md delete mode 100644 vendor/github.com/felixge/fgprof/fgprof.go delete mode 100644 vendor/github.com/felixge/fgprof/handler.go delete mode 100644 vendor/github.com/felixge/httpsnoop/.gitignore delete mode 100644 vendor/github.com/felixge/httpsnoop/LICENSE.txt delete mode 100644 vendor/github.com/felixge/httpsnoop/Makefile delete mode 100644 vendor/github.com/felixge/httpsnoop/README.md delete mode 100644 vendor/github.com/felixge/httpsnoop/capture_metrics.go delete mode 100644 vendor/github.com/felixge/httpsnoop/docs.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go delete mode 100644 vendor/github.com/firefart/nonamedreturns/LICENSE delete mode 100644 vendor/github.com/firefart/nonamedreturns/analyzer/analyzer.go delete mode 100644 vendor/github.com/fzipp/gocyclo/CHANGELOG.md delete mode 100644 vendor/github.com/fzipp/gocyclo/CONTRIBUTORS delete mode 100644 vendor/github.com/fzipp/gocyclo/LICENSE delete mode 100644 vendor/github.com/fzipp/gocyclo/README.md delete mode 100644 vendor/github.com/fzipp/gocyclo/analyze.go delete mode 100644 vendor/github.com/fzipp/gocyclo/complexity.go delete mode 100644 vendor/github.com/fzipp/gocyclo/directives.go delete mode 100644 vendor/github.com/fzipp/gocyclo/recv.go delete mode 100644 vendor/github.com/fzipp/gocyclo/recv_pre118.go delete mode 100644 vendor/github.com/fzipp/gocyclo/stats.go delete mode 100644 vendor/github.com/ghostiam/protogetter/.goreleaser.yaml delete mode 100644 vendor/github.com/ghostiam/protogetter/LICENSE delete mode 100644 vendor/github.com/ghostiam/protogetter/Makefile delete mode 100644 vendor/github.com/ghostiam/protogetter/README.md delete mode 100644 vendor/github.com/ghostiam/protogetter/posfilter.go delete mode 100644 vendor/github.com/ghostiam/protogetter/processor.go delete mode 100644 vendor/github.com/ghostiam/protogetter/protogetter.go delete mode 100644 vendor/github.com/go-chi/chi/v5/.gitignore delete mode 100644 vendor/github.com/go-chi/chi/v5/CHANGELOG.md delete mode 100644 vendor/github.com/go-chi/chi/v5/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-chi/chi/v5/LICENSE delete mode 100644 vendor/github.com/go-chi/chi/v5/Makefile delete mode 100644 vendor/github.com/go-chi/chi/v5/README.md delete mode 100644 vendor/github.com/go-chi/chi/v5/chain.go delete mode 100644 vendor/github.com/go-chi/chi/v5/chi.go delete mode 100644 vendor/github.com/go-chi/chi/v5/context.go delete mode 100644 vendor/github.com/go-chi/chi/v5/mux.go delete mode 100644 vendor/github.com/go-chi/chi/v5/tree.go delete mode 100644 vendor/github.com/go-critic/go-critic/LICENSE delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/builtinShadowDecl_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/checkers.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/deferInLoop_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/embedded_rules.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astfind.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astflow.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astset.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/zero_value.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/rulesdata/rulesdata.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/todoCommentWithoutDetail_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/tooManyResults_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/typeDefFirst_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/underef_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/utils.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go delete mode 100644 vendor/github.com/go-critic/go-critic/linter/go_version.go delete mode 100644 vendor/github.com/go-critic/go-critic/linter/helpers.go delete mode 100644 vendor/github.com/go-critic/go-critic/linter/linter.go delete mode 100644 vendor/github.com/go-git/gcfg/.gitignore delete mode 100644 vendor/github.com/go-git/gcfg/LICENSE delete mode 100644 vendor/github.com/go-git/gcfg/Makefile delete mode 100644 vendor/github.com/go-git/gcfg/README delete mode 100644 vendor/github.com/go-git/gcfg/doc.go delete mode 100644 vendor/github.com/go-git/gcfg/errors.go delete mode 100644 vendor/github.com/go-git/gcfg/read.go delete mode 100644 vendor/github.com/go-git/gcfg/scanner/errors.go delete mode 100644 vendor/github.com/go-git/gcfg/scanner/scanner.go delete mode 100644 vendor/github.com/go-git/gcfg/set.go delete mode 100644 vendor/github.com/go-git/gcfg/token/position.go delete mode 100644 vendor/github.com/go-git/gcfg/token/serialize.go delete mode 100644 vendor/github.com/go-git/gcfg/token/token.go delete mode 100644 vendor/github.com/go-git/gcfg/types/bool.go delete mode 100644 vendor/github.com/go-git/gcfg/types/doc.go delete mode 100644 vendor/github.com/go-git/gcfg/types/enum.go delete mode 100644 vendor/github.com/go-git/gcfg/types/int.go delete mode 100644 vendor/github.com/go-git/gcfg/types/scan.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/.gitignore delete mode 100644 vendor/github.com/go-git/go-billy/v5/LICENSE delete mode 100644 vendor/github.com/go-git/go-billy/v5/Makefile delete mode 100644 vendor/github.com/go-git/go-billy/v5/README.md delete mode 100644 vendor/github.com/go-git/go-billy/v5/fs.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/helper/chroot/chroot.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/helper/polyfill/polyfill.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/memfs/memory.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/memfs/storage.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_bound.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_chroot.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_js.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_options.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_plan9.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_posix.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/osfs/os_windows.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/util/glob.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/util/util.go delete mode 100644 vendor/github.com/go-git/go-billy/v5/util/walk.go delete mode 100644 vendor/github.com/go-git/go-git/v5/.gitignore delete mode 100644 vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md delete mode 100644 vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-git/go-git/v5/EXTENDING.md delete mode 100644 vendor/github.com/go-git/go-git/v5/LICENSE delete mode 100644 vendor/github.com/go-git/go-git/v5/Makefile delete mode 100644 vendor/github.com/go-git/go-git/v5/README.md delete mode 100644 vendor/github.com/go-git/go-git/v5/SECURITY.md delete mode 100644 vendor/github.com/go-git/go-git/v5/blame.go delete mode 100644 vendor/github.com/go-git/go-git/v5/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/config/branch.go delete mode 100644 vendor/github.com/go-git/go-git/v5/config/config.go delete mode 100644 vendor/github.com/go-git/go-git/v5/config/modules.go delete mode 100644 vendor/github.com/go-git/go-git/v5/config/refspec.go delete mode 100644 vendor/github.com/go-git/go-git/v5/config/url.go delete mode 100644 vendor/github.com/go-git/go-git/v5/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/internal/path_util/path_util.go delete mode 100644 vendor/github.com/go-git/go-git/v5/internal/revision/parser.go delete mode 100644 vendor/github.com/go-git/go-git/v5/internal/revision/scanner.go delete mode 100644 vendor/github.com/go-git/go-git/v5/internal/revision/token.go delete mode 100644 vendor/github.com/go-git/go-git/v5/internal/url/url.go delete mode 100644 vendor/github.com/go-git/go-git/v5/object_walker.go delete mode 100644 vendor/github.com/go-git/go-git/v5/options.go delete mode 100644 vendor/github.com/go-git/go-git/v5/oss-fuzz.sh delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/cache/buffer_lru.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/cache/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/cache/object_lru.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/color/color.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/error.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/filemode/filemode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/decoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/format.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/diff/colorconfig.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/diff/patch.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/dir.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/matcher.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/pattern.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/decoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/idxfile.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/writer.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/index/decoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/index/encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/index/match.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/reader.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/writer.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_index.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_selector.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/error.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/fsobject.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/object_pack.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/scanner.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/encoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/error.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/scanner.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/hash.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/hash/hash.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha1.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha256.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/memory.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/blob.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/change.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/change_adaptor.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs_filtered.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_ctime.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_limit.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_path.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/file.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/merge_base.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/object.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/rename.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/signature.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/tag.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/object/treenoder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_decode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_encode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/capability.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/list.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/gitproto.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/report_status.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/shallowupd.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/demux.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/muxer.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/srvresp.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_decode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_encode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_decode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_encode.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackreq.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackresp.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/reference.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/revision.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/revlist/revlist.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/index.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/object.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/reference.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/shallow.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/storer/storer.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/client/client.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/file/client.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/file/server.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/git/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/http/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/http/receive_pack.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/http/transport.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/http/upload_pack.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/mocks.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/server.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/server/loader.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/auth_method.go delete mode 100644 vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/prune.go delete mode 100644 vendor/github.com/go-git/go-git/v5/remote.go delete mode 100644 vendor/github.com/go-git/go-git/v5/repository.go delete mode 100644 vendor/github.com/go-git/go-git/v5/status.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/deltaobject.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_rewrite_packed_refs.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_setref.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/reader.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/repository_filesystem.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/writers.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/index.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/module.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/reference.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/shallow.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/filesystem/storage.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/memory/storage.go delete mode 100644 vendor/github.com/go-git/go-git/v5/storage/storer.go delete mode 100644 vendor/github.com/go-git/go-git/v5/submodule.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/binary/read.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/binary/write.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/diff/diff.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/ioutil/common.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/change.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/doc.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/doubleiter.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/filesystem/node.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/index/node.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/path.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/sync/bufio.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/sync/bytes.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/sync/zlib.go delete mode 100644 vendor/github.com/go-git/go-git/v5/utils/trace/trace.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_bsd.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_commit.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_js.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_linux.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_plan9.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_status.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_unix_other.go delete mode 100644 vendor/github.com/go-git/go-git/v5/worktree_windows.go delete mode 100644 vendor/github.com/go-logr/logr/.golangci.yaml delete mode 100644 vendor/github.com/go-logr/logr/CHANGELOG.md delete mode 100644 vendor/github.com/go-logr/logr/CONTRIBUTING.md delete mode 100644 vendor/github.com/go-logr/logr/LICENSE delete mode 100644 vendor/github.com/go-logr/logr/README.md delete mode 100644 vendor/github.com/go-logr/logr/SECURITY.md delete mode 100644 vendor/github.com/go-logr/logr/context.go delete mode 100644 vendor/github.com/go-logr/logr/context_noslog.go delete mode 100644 vendor/github.com/go-logr/logr/context_slog.go delete mode 100644 vendor/github.com/go-logr/logr/discard.go delete mode 100644 vendor/github.com/go-logr/logr/funcr/funcr.go delete mode 100644 vendor/github.com/go-logr/logr/funcr/slogsink.go delete mode 100644 vendor/github.com/go-logr/logr/logr.go delete mode 100644 vendor/github.com/go-logr/logr/sloghandler.go delete mode 100644 vendor/github.com/go-logr/logr/slogr.go delete mode 100644 vendor/github.com/go-logr/logr/slogsink.go delete mode 100644 vendor/github.com/go-logr/stdr/LICENSE delete mode 100644 vendor/github.com/go-logr/stdr/README.md delete mode 100644 vendor/github.com/go-logr/stdr/stdr.go delete mode 100644 vendor/github.com/go-openapi/analysis/.codecov.yml delete mode 100644 vendor/github.com/go-openapi/analysis/.gitattributes delete mode 100644 vendor/github.com/go-openapi/analysis/.gitignore delete mode 100644 vendor/github.com/go-openapi/analysis/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/analysis/LICENSE delete mode 100644 vendor/github.com/go-openapi/analysis/README.md delete mode 100644 vendor/github.com/go-openapi/analysis/analyzer.go delete mode 100644 vendor/github.com/go-openapi/analysis/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/analysis/debug.go delete mode 100644 vendor/github.com/go-openapi/analysis/doc.go delete mode 100644 vendor/github.com/go-openapi/analysis/fixer.go delete mode 100644 vendor/github.com/go-openapi/analysis/flatten.go delete mode 100644 vendor/github.com/go-openapi/analysis/flatten_name.go delete mode 100644 vendor/github.com/go-openapi/analysis/flatten_options.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/debug/debug.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go delete mode 100644 vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go delete mode 100644 vendor/github.com/go-openapi/analysis/mixin.go delete mode 100644 vendor/github.com/go-openapi/analysis/schema.go delete mode 100644 vendor/github.com/go-openapi/errors/.gitattributes delete mode 100644 vendor/github.com/go-openapi/errors/.gitignore delete mode 100644 vendor/github.com/go-openapi/errors/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/errors/LICENSE delete mode 100644 vendor/github.com/go-openapi/errors/README.md delete mode 100644 vendor/github.com/go-openapi/errors/api.go delete mode 100644 vendor/github.com/go-openapi/errors/auth.go delete mode 100644 vendor/github.com/go-openapi/errors/doc.go delete mode 100644 vendor/github.com/go-openapi/errors/headers.go delete mode 100644 vendor/github.com/go-openapi/errors/middleware.go delete mode 100644 vendor/github.com/go-openapi/errors/parsing.go delete mode 100644 vendor/github.com/go-openapi/errors/schema.go delete mode 100644 vendor/github.com/go-openapi/inflect/.hgignore delete mode 100644 vendor/github.com/go-openapi/inflect/LICENCE delete mode 100644 vendor/github.com/go-openapi/inflect/README delete mode 100644 vendor/github.com/go-openapi/inflect/inflect.go delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.editorconfig delete mode 100644 vendor/github.com/go-openapi/jsonpointer/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonpointer/README.md delete mode 100644 vendor/github.com/go-openapi/jsonpointer/pointer.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/.gitignore delete mode 100644 vendor/github.com/go-openapi/jsonreference/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/LICENSE delete mode 100644 vendor/github.com/go-openapi/jsonreference/README.md delete mode 100644 vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go delete mode 100644 vendor/github.com/go-openapi/jsonreference/reference.go delete mode 100644 vendor/github.com/go-openapi/loads/.editorconfig delete mode 100644 vendor/github.com/go-openapi/loads/.gitignore delete mode 100644 vendor/github.com/go-openapi/loads/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/loads/.travis.yml delete mode 100644 vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/loads/LICENSE delete mode 100644 vendor/github.com/go-openapi/loads/README.md delete mode 100644 vendor/github.com/go-openapi/loads/doc.go delete mode 100644 vendor/github.com/go-openapi/loads/fmts/yaml.go delete mode 100644 vendor/github.com/go-openapi/loads/loaders.go delete mode 100644 vendor/github.com/go-openapi/loads/options.go delete mode 100644 vendor/github.com/go-openapi/loads/spec.go delete mode 100644 vendor/github.com/go-openapi/runtime/.editorconfig delete mode 100644 vendor/github.com/go-openapi/runtime/.gitattributes delete mode 100644 vendor/github.com/go-openapi/runtime/.gitignore delete mode 100644 vendor/github.com/go-openapi/runtime/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/runtime/LICENSE delete mode 100644 vendor/github.com/go-openapi/runtime/README.md delete mode 100644 vendor/github.com/go-openapi/runtime/bytestream.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_auth_info.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_operation.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_request.go delete mode 100644 vendor/github.com/go-openapi/runtime/client_response.go delete mode 100644 vendor/github.com/go-openapi/runtime/constants.go delete mode 100644 vendor/github.com/go-openapi/runtime/csv.go delete mode 100644 vendor/github.com/go-openapi/runtime/discard.go delete mode 100644 vendor/github.com/go-openapi/runtime/file.go delete mode 100644 vendor/github.com/go-openapi/runtime/headers.go delete mode 100644 vendor/github.com/go-openapi/runtime/interfaces.go delete mode 100644 vendor/github.com/go-openapi/runtime/json.go delete mode 100644 vendor/github.com/go-openapi/runtime/logger/logger.go delete mode 100644 vendor/github.com/go-openapi/runtime/logger/standard.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/context.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/README.md delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/router.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/server.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/denco/util.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/doc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/go18.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/header/header.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/negotiate.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/not_implemented.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/operation.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/parameter.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/rapidoc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/redoc.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/request.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/router.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/security.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/spec.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/swaggerui.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/untyped/api.go delete mode 100644 vendor/github.com/go-openapi/runtime/middleware/validation.go delete mode 100644 vendor/github.com/go-openapi/runtime/request.go delete mode 100644 vendor/github.com/go-openapi/runtime/security/authenticator.go delete mode 100644 vendor/github.com/go-openapi/runtime/security/authorizer.go delete mode 100644 vendor/github.com/go-openapi/runtime/statuses.go delete mode 100644 vendor/github.com/go-openapi/runtime/text.go delete mode 100644 vendor/github.com/go-openapi/runtime/values.go delete mode 100644 vendor/github.com/go-openapi/runtime/xml.go delete mode 100644 vendor/github.com/go-openapi/spec/.editorconfig delete mode 100644 vendor/github.com/go-openapi/spec/.gitignore delete mode 100644 vendor/github.com/go-openapi/spec/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/spec/LICENSE delete mode 100644 vendor/github.com/go-openapi/spec/README.md delete mode 100644 vendor/github.com/go-openapi/spec/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/spec/bindata.go delete mode 100644 vendor/github.com/go-openapi/spec/cache.go delete mode 100644 vendor/github.com/go-openapi/spec/contact_info.go delete mode 100644 vendor/github.com/go-openapi/spec/debug.go delete mode 100644 vendor/github.com/go-openapi/spec/errors.go delete mode 100644 vendor/github.com/go-openapi/spec/expander.go delete mode 100644 vendor/github.com/go-openapi/spec/external_docs.go delete mode 100644 vendor/github.com/go-openapi/spec/header.go delete mode 100644 vendor/github.com/go-openapi/spec/info.go delete mode 100644 vendor/github.com/go-openapi/spec/items.go delete mode 100644 vendor/github.com/go-openapi/spec/license.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer_nonwindows.go delete mode 100644 vendor/github.com/go-openapi/spec/normalizer_windows.go delete mode 100644 vendor/github.com/go-openapi/spec/operation.go delete mode 100644 vendor/github.com/go-openapi/spec/parameter.go delete mode 100644 vendor/github.com/go-openapi/spec/path_item.go delete mode 100644 vendor/github.com/go-openapi/spec/paths.go delete mode 100644 vendor/github.com/go-openapi/spec/properties.go delete mode 100644 vendor/github.com/go-openapi/spec/ref.go delete mode 100644 vendor/github.com/go-openapi/spec/resolver.go delete mode 100644 vendor/github.com/go-openapi/spec/response.go delete mode 100644 vendor/github.com/go-openapi/spec/responses.go delete mode 100644 vendor/github.com/go-openapi/spec/schema.go delete mode 100644 vendor/github.com/go-openapi/spec/schema_loader.go delete mode 100644 vendor/github.com/go-openapi/spec/security_scheme.go delete mode 100644 vendor/github.com/go-openapi/spec/spec.go delete mode 100644 vendor/github.com/go-openapi/spec/swagger.go delete mode 100644 vendor/github.com/go-openapi/spec/tag.go delete mode 100644 vendor/github.com/go-openapi/spec/url_go18.go delete mode 100644 vendor/github.com/go-openapi/spec/url_go19.go delete mode 100644 vendor/github.com/go-openapi/spec/validations.go delete mode 100644 vendor/github.com/go-openapi/spec/xml_object.go delete mode 100644 vendor/github.com/go-openapi/strfmt/.editorconfig delete mode 100644 vendor/github.com/go-openapi/strfmt/.gitattributes delete mode 100644 vendor/github.com/go-openapi/strfmt/.gitignore delete mode 100644 vendor/github.com/go-openapi/strfmt/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/strfmt/LICENSE delete mode 100644 vendor/github.com/go-openapi/strfmt/README.md delete mode 100644 vendor/github.com/go-openapi/strfmt/bson.go delete mode 100644 vendor/github.com/go-openapi/strfmt/date.go delete mode 100644 vendor/github.com/go-openapi/strfmt/default.go delete mode 100644 vendor/github.com/go-openapi/strfmt/doc.go delete mode 100644 vendor/github.com/go-openapi/strfmt/duration.go delete mode 100644 vendor/github.com/go-openapi/strfmt/format.go delete mode 100644 vendor/github.com/go-openapi/strfmt/time.go delete mode 100644 vendor/github.com/go-openapi/strfmt/ulid.go delete mode 100644 vendor/github.com/go-openapi/swag/.editorconfig delete mode 100644 vendor/github.com/go-openapi/swag/.gitattributes delete mode 100644 vendor/github.com/go-openapi/swag/.gitignore delete mode 100644 vendor/github.com/go-openapi/swag/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/swag/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/swag/LICENSE delete mode 100644 vendor/github.com/go-openapi/swag/README.md delete mode 100644 vendor/github.com/go-openapi/swag/convert.go delete mode 100644 vendor/github.com/go-openapi/swag/convert_types.go delete mode 100644 vendor/github.com/go-openapi/swag/doc.go delete mode 100644 vendor/github.com/go-openapi/swag/file.go delete mode 100644 vendor/github.com/go-openapi/swag/json.go delete mode 100644 vendor/github.com/go-openapi/swag/loading.go delete mode 100644 vendor/github.com/go-openapi/swag/name_lexem.go delete mode 100644 vendor/github.com/go-openapi/swag/net.go delete mode 100644 vendor/github.com/go-openapi/swag/path.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/post_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go18.go delete mode 100644 vendor/github.com/go-openapi/swag/pre_go19.go delete mode 100644 vendor/github.com/go-openapi/swag/split.go delete mode 100644 vendor/github.com/go-openapi/swag/util.go delete mode 100644 vendor/github.com/go-openapi/swag/yaml.go delete mode 100644 vendor/github.com/go-openapi/validate/.editorconfig delete mode 100644 vendor/github.com/go-openapi/validate/.gitattributes delete mode 100644 vendor/github.com/go-openapi/validate/.gitignore delete mode 100644 vendor/github.com/go-openapi/validate/.golangci.yml delete mode 100644 vendor/github.com/go-openapi/validate/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/go-openapi/validate/LICENSE delete mode 100644 vendor/github.com/go-openapi/validate/README.md delete mode 100644 vendor/github.com/go-openapi/validate/appveyor.yml delete mode 100644 vendor/github.com/go-openapi/validate/context.go delete mode 100644 vendor/github.com/go-openapi/validate/debug.go delete mode 100644 vendor/github.com/go-openapi/validate/default_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/doc.go delete mode 100644 vendor/github.com/go-openapi/validate/example_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/formats.go delete mode 100644 vendor/github.com/go-openapi/validate/helpers.go delete mode 100644 vendor/github.com/go-openapi/validate/object_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/options.go delete mode 100644 vendor/github.com/go-openapi/validate/result.go delete mode 100644 vendor/github.com/go-openapi/validate/rexp.go delete mode 100644 vendor/github.com/go-openapi/validate/schema.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_messages.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_option.go delete mode 100644 vendor/github.com/go-openapi/validate/schema_props.go delete mode 100644 vendor/github.com/go-openapi/validate/slice_validator.go delete mode 100644 vendor/github.com/go-openapi/validate/spec.go delete mode 100644 vendor/github.com/go-openapi/validate/spec_messages.go delete mode 100644 vendor/github.com/go-openapi/validate/type.go delete mode 100644 vendor/github.com/go-openapi/validate/update-fixtures.sh delete mode 100644 vendor/github.com/go-openapi/validate/validator.go delete mode 100644 vendor/github.com/go-openapi/validate/values.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/LICENSE delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/.gitignore delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/array_diff.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/checks.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/compatibility.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/difference_location.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/difftypes.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/node.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/reporting.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/schema.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/spec_analyser.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/spec_difference.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/diff/type_adapters.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/expand.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/flatten.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/cli.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/client.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/contrib.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/markdown.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/model.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/operation.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/server.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/shared.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/sharedopts_nonwin.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/sharedopts_win.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/spec.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/spec_go111.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/generate/support.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/initcmd.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/initcmd/spec.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/mixin.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/serve.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/validate.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/commands/version.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/cmd/swagger/swagger.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/README.md delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/application.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/doc.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/enum.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/meta.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/operations.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/parameters.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/parser.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/parser_helpers.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/parser_helpers_go118.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/regexprs.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/responses.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/route_params.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/routes.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/schema.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/codescan/spec.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/.gitignore delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/bindata.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/client.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/config.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/debug.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/discriminators.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/doc.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/formats.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/genopts_nonwin.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/genopts_win.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/language.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/media.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/model.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/operation.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/shared.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/spec.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/structs.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/support.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/template_repo.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/cli.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/completion.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/main.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/modelcli.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/operation.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/registerflag.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/retrieveflag.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/cli/schema.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/client/client.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/client/facade.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/client/parameter.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/client/response.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/contrib/stratoscale/README.md delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/contrib/stratoscale/client/client.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/contrib/stratoscale/client/facade.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/contrib/stratoscale/server/configureapi.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/contrib/stratoscale/server/server.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/docstring.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/header.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/markdown/docs.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/model.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schema.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schemabody.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schemaembedded.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schemapolymorphic.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schematype.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/schemavalidator.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/additionalpropertiesserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/aliasedserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/allofserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/basetypeserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/marshalbinaryserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/schemaserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/subtypeserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/serializers/tupleserializer.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/autoconfigureapi.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/builder.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/configureapi.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/doc.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/main.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/operation.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/parameter.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/responses.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/server.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/server/urlbuilder.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/simpleschema/defaultsinit.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/simpleschema/defaultsvar.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/structfield.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/swagger_json_embed.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/customformat.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/maximum.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/minimum.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/multipleOf.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/primitive.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/templates/validation/structfield.gotmpl delete mode 100644 vendor/github.com/go-swagger/go-swagger/generator/types.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/README.md delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/classifier.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/doc.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/enum.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/meta.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/operations.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/parameters.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/path.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/responses.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/route_params.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/routes.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/scanner.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/schema.go delete mode 100644 vendor/github.com/go-swagger/go-swagger/scan/validators.go delete mode 100644 vendor/github.com/go-toolsmith/astcast/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/astcast/README.md delete mode 100644 vendor/github.com/go-toolsmith/astcast/astcast.go delete mode 100644 vendor/github.com/go-toolsmith/astcopy/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/astcopy/README.md delete mode 100644 vendor/github.com/go-toolsmith/astcopy/astcopy.go delete mode 100644 vendor/github.com/go-toolsmith/astcopy/astcopy_go117.go delete mode 100644 vendor/github.com/go-toolsmith/astcopy/astcopy_go118.go delete mode 100644 vendor/github.com/go-toolsmith/astequal/.gitignore delete mode 100644 vendor/github.com/go-toolsmith/astequal/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/astequal/README.md delete mode 100644 vendor/github.com/go-toolsmith/astequal/astequal.go delete mode 100644 vendor/github.com/go-toolsmith/astequal/diff.go delete mode 100644 vendor/github.com/go-toolsmith/astfmt/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/astfmt/README.md delete mode 100644 vendor/github.com/go-toolsmith/astfmt/astfmt.go delete mode 100644 vendor/github.com/go-toolsmith/astp/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/astp/README.md delete mode 100644 vendor/github.com/go-toolsmith/astp/decl.go delete mode 100644 vendor/github.com/go-toolsmith/astp/expr.go delete mode 100644 vendor/github.com/go-toolsmith/astp/stmt.go delete mode 100644 vendor/github.com/go-toolsmith/strparse/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/strparse/README.md delete mode 100644 vendor/github.com/go-toolsmith/strparse/strparse.go delete mode 100644 vendor/github.com/go-toolsmith/typep/LICENSE delete mode 100644 vendor/github.com/go-toolsmith/typep/README.md delete mode 100644 vendor/github.com/go-toolsmith/typep/doc.go delete mode 100644 vendor/github.com/go-toolsmith/typep/predicates.go delete mode 100644 vendor/github.com/go-toolsmith/typep/safe_expr.go delete mode 100644 vendor/github.com/go-toolsmith/typep/simple_predicates.go delete mode 100644 vendor/github.com/go-xmlfmt/xmlfmt/LICENSE delete mode 100644 vendor/github.com/go-xmlfmt/xmlfmt/README.md delete mode 100644 vendor/github.com/go-xmlfmt/xmlfmt/xmlfmt.go delete mode 100644 vendor/github.com/gobwas/glob/.gitignore delete mode 100644 vendor/github.com/gobwas/glob/.travis.yml delete mode 100644 vendor/github.com/gobwas/glob/LICENSE delete mode 100644 vendor/github.com/gobwas/glob/bench.sh delete mode 100644 vendor/github.com/gobwas/glob/compiler/compiler.go delete mode 100644 vendor/github.com/gobwas/glob/glob.go delete mode 100644 vendor/github.com/gobwas/glob/match/any.go delete mode 100644 vendor/github.com/gobwas/glob/match/any_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/btree.go delete mode 100644 vendor/github.com/gobwas/glob/match/contains.go delete mode 100644 vendor/github.com/gobwas/glob/match/every_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/list.go delete mode 100644 vendor/github.com/gobwas/glob/match/match.go delete mode 100644 vendor/github.com/gobwas/glob/match/max.go delete mode 100644 vendor/github.com/gobwas/glob/match/min.go delete mode 100644 vendor/github.com/gobwas/glob/match/nothing.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/range.go delete mode 100644 vendor/github.com/gobwas/glob/match/row.go delete mode 100644 vendor/github.com/gobwas/glob/match/segments.go delete mode 100644 vendor/github.com/gobwas/glob/match/single.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/super.go delete mode 100644 vendor/github.com/gobwas/glob/match/text.go delete mode 100644 vendor/github.com/gobwas/glob/readme.md delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/ast.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/parser.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/lexer.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/token.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/syntax.go delete mode 100644 vendor/github.com/gobwas/glob/util/runes/runes.go delete mode 100644 vendor/github.com/gobwas/glob/util/strings/strings.go delete mode 100644 vendor/github.com/gofrs/flock/.gitignore delete mode 100644 vendor/github.com/gofrs/flock/.travis.yml delete mode 100644 vendor/github.com/gofrs/flock/LICENSE delete mode 100644 vendor/github.com/gofrs/flock/README.md delete mode 100644 vendor/github.com/gofrs/flock/appveyor.yml delete mode 100644 vendor/github.com/gofrs/flock/flock.go delete mode 100644 vendor/github.com/gofrs/flock/flock_aix.go delete mode 100644 vendor/github.com/gofrs/flock/flock_unix.go delete mode 100644 vendor/github.com/gofrs/flock/flock_winapi.go delete mode 100644 vendor/github.com/gofrs/flock/flock_windows.go delete mode 100644 vendor/github.com/gofrs/uuid/v5/.gitignore delete mode 100644 vendor/github.com/gofrs/uuid/v5/LICENSE delete mode 100644 vendor/github.com/gofrs/uuid/v5/README.md delete mode 100644 vendor/github.com/gofrs/uuid/v5/codec.go delete mode 100644 vendor/github.com/gofrs/uuid/v5/fuzz.go delete mode 100644 vendor/github.com/gofrs/uuid/v5/generator.go delete mode 100644 vendor/github.com/gofrs/uuid/v5/sql.go delete mode 100644 vendor/github.com/gofrs/uuid/v5/uuid.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/compare/compare.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/compare/comparetest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/defaultcheck/defaultcheck.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/description/description.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/description/descriptiontest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/embedcheck/embedcheck.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/enumstringer/enumstringer.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/equal/equal.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/equal/equaltest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/face/face.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/face/facetest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/gostring/gostring.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/gostring/gostringtest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/marshalto/marshalto.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/oneofcheck/oneofcheck.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/populate/populate.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/size/size.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/size/sizetest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/stringer/stringer.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/stringer/stringertest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/testgen/testgen.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/union/union.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/union/uniontest.go delete mode 100644 vendor/github.com/gogo/protobuf/plugin/unmarshal/unmarshal.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/Makefile delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/doc.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/generator.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/helper.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/generator/internal/remap/remap.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/grpc/grpc.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/main.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/Makefile delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogo/plugin/plugin.pb.go delete mode 100644 vendor/github.com/gogo/protobuf/protoc-gen-gogofast/main.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/command/command.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/enum.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/field.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/file.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/foreach.go delete mode 100644 vendor/github.com/gogo/protobuf/vanity/msg.go delete mode 100644 vendor/github.com/golang/groupcache/LICENSE delete mode 100644 vendor/github.com/golang/groupcache/lru/lru.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/descriptor/descriptor.pb.go delete mode 100644 vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go delete mode 100644 vendor/github.com/golangci/check/LICENSE delete mode 100644 vendor/github.com/golangci/check/cmd/structcheck/structcheck.go delete mode 100644 vendor/github.com/golangci/check/cmd/varcheck/varcheck.go delete mode 100644 vendor/github.com/golangci/dupl/.travis.yml delete mode 100644 vendor/github.com/golangci/dupl/LICENSE delete mode 100644 vendor/github.com/golangci/dupl/README.md delete mode 100644 vendor/github.com/golangci/dupl/job/buildtree.go delete mode 100644 vendor/github.com/golangci/dupl/job/parse.go delete mode 100644 vendor/github.com/golangci/dupl/main.go delete mode 100644 vendor/github.com/golangci/dupl/printer/html.go delete mode 100644 vendor/github.com/golangci/dupl/printer/plumbing.go delete mode 100644 vendor/github.com/golangci/dupl/printer/printer.go delete mode 100644 vendor/github.com/golangci/dupl/printer/text.go delete mode 100644 vendor/github.com/golangci/dupl/suffixtree/dupl.go delete mode 100644 vendor/github.com/golangci/dupl/suffixtree/suffixtree.go delete mode 100644 vendor/github.com/golangci/dupl/syntax/golang/golang.go delete mode 100644 vendor/github.com/golangci/dupl/syntax/syntax.go delete mode 100644 vendor/github.com/golangci/go-misc/LICENSE delete mode 100644 vendor/github.com/golangci/go-misc/deadcode/README.md delete mode 100644 vendor/github.com/golangci/go-misc/deadcode/deadcode.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/LICENSE delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/doc.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/gofmt.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/golangci.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/internal.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/internal/diff/diff.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/readme.md delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/rewrite.go delete mode 100644 vendor/github.com/golangci/gofmt/gofmt/simplify.go delete mode 100644 vendor/github.com/golangci/gofmt/goimports/LICENSE delete mode 100644 vendor/github.com/golangci/gofmt/goimports/goimports.go delete mode 100644 vendor/github.com/golangci/gofmt/goimports/golangci.go delete mode 100644 vendor/github.com/golangci/gofmt/goimports/readme.md delete mode 100644 vendor/github.com/golangci/golangci-lint/LICENSE delete mode 100644 vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/cache/cache.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/cache/default.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/cache/hash.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/cache/readme.md delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/errorutil/errors.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/pkgcache/pkgcache.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/renameio/readme.md delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/renameio/renameio.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/readme.md delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/robustio.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_darwin.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_flaky.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_other.go delete mode 100644 vendor/github.com/golangci/golangci-lint/internal/robustio/robustio_windows.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/cache.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/config.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/help.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/linters.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/root.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/run.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/commands/version.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/config.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/issues.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/linters.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/linters_settings.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/output.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/reader.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/run.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/config/severity.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/exitcodes/exitcodes.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/filecache.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/files.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/fsutils.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/linecache.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/path_unix.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/fsutils/path_windows.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/asasalint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/asciicheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/bidichk.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/bodyclose.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/commons.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/containedctx.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/contextcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/cyclop.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/deadcode.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/decorder.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/depguard.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/dogsled.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/dupword.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/durationcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/errcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/errchkjson.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/errname.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/errorlint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/execinquery.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustive.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustivestruct.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/exhaustruct.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/exportloopref.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/forbidigo.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/forcetypeassert.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/funlen.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gci.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/ginkgolinter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/adapters.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/errors.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/issue.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/linter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load/guard.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/metalinter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_action.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_facts.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner_loadingpackage.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runners.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gocheckcompilerdirectives.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoglobals.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoinits.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecksumtype.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goconst.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/godot.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/godox.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goerr113.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gofumpt.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goheader.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/golint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gomnd.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gomoddirectives.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gomodguard.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/goprintffuncname.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gosimple.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/gosmopolitan.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/govet.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/grouper.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/ifshort.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/importas.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/inamedparam.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacebloat.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacer.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/ireturn.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/loggercheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/maintidx.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/makezero.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/maligned.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/mirror.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/musttag.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nakedret.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nestif.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nilerr.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nilnil.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nlreturn.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/noctx.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nolintlint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nolintlint/README.md delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nolintlint/nolintlint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nonamedreturns.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nosnakecase.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/nosprintfhostport.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/paralleltest.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/perfsprint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/prealloc.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/predeclared.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/promlinter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/protogetter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/reassign.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/revive.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/rowserrcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/scopelint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/sloglint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/sqlclosecheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck_common.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/structcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/stylecheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/tagalign.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/tagliatelle.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/tenv.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/testableexamples.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/testifylint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/testpackage.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/thelper.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/tparallel.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/typecheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/unconvert.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/unparam.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/usestdlibvars.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/util.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/varcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/varnamelen.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/wastedassign.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/whitespace.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/wrapcheck.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/golinters/zerologlint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/goutil/env.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/linter/context.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/linter/linter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/custom_linters.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/load.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/logutils/log.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/logutils/logutils.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/logutils/mock.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/logutils/out.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/logutils/stderr_log.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/packages/errors.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/packages/skip.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/packages/util.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/github.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/html.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/json.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/printer.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/tab.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/teamcity.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/printers/text.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/report/data.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/report/log.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/issue.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/base_rule.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/cgo.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/diff.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/fixer.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/identifier_marker.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/issues.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_from_linter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_per_file_from_linter.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_same_issues.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_prefixer.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_prettifier.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/path_shortener.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/processor.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/severity_rules.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_dirs.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/skip_files.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/sort_results.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/source_code.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/result/processors/uniq_by_line.go delete mode 100644 vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go delete mode 100644 vendor/github.com/golangci/lint-1/.travis.yml delete mode 100644 vendor/github.com/golangci/lint-1/CONTRIBUTING.md delete mode 100644 vendor/github.com/golangci/lint-1/LICENSE delete mode 100644 vendor/github.com/golangci/lint-1/README.md delete mode 100644 vendor/github.com/golangci/lint-1/lint.go delete mode 100644 vendor/github.com/golangci/maligned/LICENSE delete mode 100644 vendor/github.com/golangci/maligned/README delete mode 100644 vendor/github.com/golangci/maligned/maligned.go delete mode 100644 vendor/github.com/golangci/misspell/.gitignore delete mode 100644 vendor/github.com/golangci/misspell/.golangci.yml delete mode 100644 vendor/github.com/golangci/misspell/Dockerfile delete mode 100644 vendor/github.com/golangci/misspell/LICENSE delete mode 100644 vendor/github.com/golangci/misspell/Makefile delete mode 100644 vendor/github.com/golangci/misspell/README.md delete mode 100644 vendor/github.com/golangci/misspell/RELEASE-HOWTO.md delete mode 100644 vendor/github.com/golangci/misspell/ascii.go delete mode 100644 vendor/github.com/golangci/misspell/case.go delete mode 100644 vendor/github.com/golangci/misspell/goreleaser.yml delete mode 100644 vendor/github.com/golangci/misspell/install-misspell.sh delete mode 100644 vendor/github.com/golangci/misspell/legal.go delete mode 100644 vendor/github.com/golangci/misspell/mime.go delete mode 100644 vendor/github.com/golangci/misspell/notwords.go delete mode 100644 vendor/github.com/golangci/misspell/replace.go delete mode 100644 vendor/github.com/golangci/misspell/stringreplacer.go delete mode 100644 vendor/github.com/golangci/misspell/stringreplacer_test.gox delete mode 100644 vendor/github.com/golangci/misspell/url.go delete mode 100644 vendor/github.com/golangci/misspell/words.go delete mode 100644 vendor/github.com/golangci/revgrep/.gitignore delete mode 100644 vendor/github.com/golangci/revgrep/.golangci.yml delete mode 100644 vendor/github.com/golangci/revgrep/LICENSE delete mode 100644 vendor/github.com/golangci/revgrep/Makefile delete mode 100644 vendor/github.com/golangci/revgrep/README.md delete mode 100644 vendor/github.com/golangci/revgrep/revgrep.go delete mode 100644 vendor/github.com/golangci/unconvert/LICENSE delete mode 100644 vendor/github.com/golangci/unconvert/README delete mode 100644 vendor/github.com/golangci/unconvert/unconvert.go delete mode 100644 vendor/github.com/google/go-containerregistry/LICENSE delete mode 100644 vendor/github.com/google/go-containerregistry/internal/and/and_closer.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/compression/compression.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/estargz/estargz.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/gzip/zip.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/redact/redact.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/retry/retry.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/retry/wait/kubernetes_apimachinery_wait.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/verify/verify.go delete mode 100644 vendor/github.com/google/go-containerregistry/internal/zstd/zstd.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/anon.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/auth.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/authn.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/basic.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/bearer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/keychain.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/authn/multikeychain.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/compression/compression.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/logs/logs.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/check.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/digest.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/errors.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/options.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/ref.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/registry.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/repository.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/name/tag.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/config.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/empty/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/empty/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/empty/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/empty/index.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/hash.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/index.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/layer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/manifest.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/match/match.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/index.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/mutate.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/mutate/rebase.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/compressed.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/index.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/uncompressed.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/partial/with.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/platform.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/progress.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/catalog.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/check.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/delete.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/descriptor.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/fetcher.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/index.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/layer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/list.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/mount.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/multi_write.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/options.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/progress.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/puller.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/pusher.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/referrers.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/schema1.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/basic.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/bearer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/error.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/logger.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/ping.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/retry.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/schemer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/scope.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/transport.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/transport/useragent.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/stream/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/stream/layer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/tarball/README.md delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/tarball/doc.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/tarball/image.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/tarball/layer.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/tarball/write.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/types/types.go delete mode 100644 vendor/github.com/google/go-containerregistry/pkg/v1/zz_deepcopy_generated.go delete mode 100644 vendor/github.com/google/pprof/AUTHORS delete mode 100644 vendor/github.com/google/pprof/CONTRIBUTORS delete mode 100644 vendor/github.com/google/pprof/LICENSE delete mode 100644 vendor/github.com/google/pprof/profile/encode.go delete mode 100644 vendor/github.com/google/pprof/profile/filter.go delete mode 100644 vendor/github.com/google/pprof/profile/index.go delete mode 100644 vendor/github.com/google/pprof/profile/legacy_java_profile.go delete mode 100644 vendor/github.com/google/pprof/profile/legacy_profile.go delete mode 100644 vendor/github.com/google/pprof/profile/merge.go delete mode 100644 vendor/github.com/google/pprof/profile/profile.go delete mode 100644 vendor/github.com/google/pprof/profile/proto.go delete mode 100644 vendor/github.com/google/pprof/profile/prune.go delete mode 100644 vendor/github.com/google/rpmpack/.gitignore delete mode 100644 vendor/github.com/google/rpmpack/BUILD.bazel delete mode 100644 vendor/github.com/google/rpmpack/CONTRIBUTING.md delete mode 100644 vendor/github.com/google/rpmpack/LICENSE delete mode 100644 vendor/github.com/google/rpmpack/README.md delete mode 100644 vendor/github.com/google/rpmpack/WORKSPACE delete mode 100644 vendor/github.com/google/rpmpack/cloudbuild.yaml delete mode 100644 vendor/github.com/google/rpmpack/def.bzl delete mode 100644 vendor/github.com/google/rpmpack/deps.bzl delete mode 100644 vendor/github.com/google/rpmpack/dir.go delete mode 100644 vendor/github.com/google/rpmpack/file_types.go delete mode 100644 vendor/github.com/google/rpmpack/header.go delete mode 100644 vendor/github.com/google/rpmpack/rpm.go delete mode 100644 vendor/github.com/google/rpmpack/sense.go delete mode 100644 vendor/github.com/google/rpmpack/tags.go delete mode 100644 vendor/github.com/google/rpmpack/tar.go delete mode 100644 vendor/github.com/gordonklaus/ineffassign/LICENSE delete mode 100644 vendor/github.com/gordonklaus/ineffassign/pkg/ineffassign/ineffassign.go delete mode 100644 vendor/github.com/goreleaser/chglog/.gitattributes delete mode 100644 vendor/github.com/goreleaser/chglog/.gitignore delete mode 100644 vendor/github.com/goreleaser/chglog/.golangci.yaml delete mode 100644 vendor/github.com/goreleaser/chglog/.goreleaser.yml delete mode 100644 vendor/github.com/goreleaser/chglog/LICENSE delete mode 100644 vendor/github.com/goreleaser/chglog/Makefile delete mode 100644 vendor/github.com/goreleaser/chglog/README.md delete mode 100644 vendor/github.com/goreleaser/chglog/add.go delete mode 100644 vendor/github.com/goreleaser/chglog/files.go delete mode 100644 vendor/github.com/goreleaser/chglog/format.go delete mode 100644 vendor/github.com/goreleaser/chglog/git.go delete mode 100644 vendor/github.com/goreleaser/chglog/init.go delete mode 100644 vendor/github.com/goreleaser/chglog/templates.go delete mode 100644 vendor/github.com/goreleaser/chglog/types.go delete mode 100644 vendor/github.com/goreleaser/fileglob/.gitignore delete mode 100644 vendor/github.com/goreleaser/fileglob/.golangci.yml delete mode 100644 vendor/github.com/goreleaser/fileglob/.goreleaser.yml delete mode 100644 vendor/github.com/goreleaser/fileglob/LICENSE delete mode 100644 vendor/github.com/goreleaser/fileglob/README.md delete mode 100644 vendor/github.com/goreleaser/fileglob/doc.go delete mode 100644 vendor/github.com/goreleaser/fileglob/glob.go delete mode 100644 vendor/github.com/goreleaser/fileglob/prefix.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/.gitattributes delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/.gitignore delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/.golangci.yml delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/.goreleaser.yml delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/.lintian-overrides delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/CONTRIBUTING.md delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/Dockerfile delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/LICENSE.md delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/README.md delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/SECURITY.md delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/Taskfile.yml delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/apk/apk.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/arch/arch.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/cmd/nfpm/art.txt delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/cmd/nfpm/main.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/deb/deb.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/deprecation/deprecation.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/files/files.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/doc.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/docs.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/init.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/man.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/package.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/root.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/cmd/schema.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/glob/glob.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/sign/pgp.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/internal/sign/rsa.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/nfpm.go delete mode 100644 vendor/github.com/goreleaser/nfpm/v2/rpm/rpm.go delete mode 100644 vendor/github.com/gorilla/handlers/LICENSE delete mode 100644 vendor/github.com/gorilla/handlers/README.md delete mode 100644 vendor/github.com/gorilla/handlers/canonical.go delete mode 100644 vendor/github.com/gorilla/handlers/compress.go delete mode 100644 vendor/github.com/gorilla/handlers/cors.go delete mode 100644 vendor/github.com/gorilla/handlers/doc.go delete mode 100644 vendor/github.com/gorilla/handlers/handlers.go delete mode 100644 vendor/github.com/gorilla/handlers/logging.go delete mode 100644 vendor/github.com/gorilla/handlers/proxy_headers.go delete mode 100644 vendor/github.com/gorilla/handlers/recovery.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/LICENSE delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/README.md delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/call.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/diagnostic.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/file.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/pkg.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/ssa.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/ssainspect.go delete mode 100644 vendor/github.com/gostaticanalysis/analysisutil/types.go delete mode 100644 vendor/github.com/gostaticanalysis/comment/LICENSE delete mode 100644 vendor/github.com/gostaticanalysis/comment/README.md delete mode 100644 vendor/github.com/gostaticanalysis/comment/comment.go delete mode 100644 vendor/github.com/gostaticanalysis/comment/passes/commentmap/commentmap.go delete mode 100644 vendor/github.com/gostaticanalysis/forcetypeassert/.reviewdog.yml delete mode 100644 vendor/github.com/gostaticanalysis/forcetypeassert/LICENSE delete mode 100644 vendor/github.com/gostaticanalysis/forcetypeassert/README.md delete mode 100644 vendor/github.com/gostaticanalysis/forcetypeassert/forcetypeassert.go delete mode 100644 vendor/github.com/gostaticanalysis/nilerr/LICENSE delete mode 100644 vendor/github.com/gostaticanalysis/nilerr/README.md delete mode 100644 vendor/github.com/gostaticanalysis/nilerr/nilerr.go delete mode 100644 vendor/github.com/hashicorp/errwrap/LICENSE delete mode 100644 vendor/github.com/hashicorp/errwrap/README.md delete mode 100644 vendor/github.com/hashicorp/errwrap/errwrap.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-multierror/Makefile delete mode 100644 vendor/github.com/hashicorp/go-multierror/README.md delete mode 100644 vendor/github.com/hashicorp/go-multierror/append.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/flatten.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/format.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/group.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/multierror.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/prefix.go delete mode 100644 vendor/github.com/hashicorp/go-multierror/sort.go delete mode 100644 vendor/github.com/hashicorp/go-version/CHANGELOG.md delete mode 100644 vendor/github.com/hashicorp/go-version/LICENSE delete mode 100644 vendor/github.com/hashicorp/go-version/README.md delete mode 100644 vendor/github.com/hashicorp/go-version/constraint.go delete mode 100644 vendor/github.com/hashicorp/go-version/version.go delete mode 100644 vendor/github.com/hashicorp/go-version/version_collection.go delete mode 100644 vendor/github.com/hexops/gotextdiff/LICENSE delete mode 100644 vendor/github.com/hexops/gotextdiff/README.md delete mode 100644 vendor/github.com/hexops/gotextdiff/diff.go delete mode 100644 vendor/github.com/hexops/gotextdiff/myers/diff.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/parse.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/span.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/token.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/token111.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/token112.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/uri.go delete mode 100644 vendor/github.com/hexops/gotextdiff/span/utf16.go delete mode 100644 vendor/github.com/hexops/gotextdiff/unified.go delete mode 100644 vendor/github.com/huandu/xstrings/.gitignore delete mode 100644 vendor/github.com/huandu/xstrings/CONTRIBUTING.md delete mode 100644 vendor/github.com/huandu/xstrings/LICENSE delete mode 100644 vendor/github.com/huandu/xstrings/README.md delete mode 100644 vendor/github.com/huandu/xstrings/common.go delete mode 100644 vendor/github.com/huandu/xstrings/convert.go delete mode 100644 vendor/github.com/huandu/xstrings/count.go delete mode 100644 vendor/github.com/huandu/xstrings/doc.go delete mode 100644 vendor/github.com/huandu/xstrings/format.go delete mode 100644 vendor/github.com/huandu/xstrings/manipulate.go delete mode 100644 vendor/github.com/huandu/xstrings/stringbuilder.go delete mode 100644 vendor/github.com/huandu/xstrings/stringbuilder_go110.go delete mode 100644 vendor/github.com/huandu/xstrings/translate.go delete mode 100644 vendor/github.com/iancoleman/orderedmap/LICENSE delete mode 100644 vendor/github.com/iancoleman/orderedmap/orderedmap.go delete mode 100644 vendor/github.com/iancoleman/orderedmap/readme.md delete mode 100644 vendor/github.com/imdario/mergo/.deepsource.toml delete mode 100644 vendor/github.com/imdario/mergo/.gitignore delete mode 100644 vendor/github.com/imdario/mergo/.travis.yml delete mode 100644 vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md delete mode 100644 vendor/github.com/imdario/mergo/CONTRIBUTING.md delete mode 100644 vendor/github.com/imdario/mergo/LICENSE delete mode 100644 vendor/github.com/imdario/mergo/README.md delete mode 100644 vendor/github.com/imdario/mergo/SECURITY.md delete mode 100644 vendor/github.com/imdario/mergo/doc.go delete mode 100644 vendor/github.com/imdario/mergo/map.go delete mode 100644 vendor/github.com/imdario/mergo/merge.go delete mode 100644 vendor/github.com/imdario/mergo/mergo.go delete mode 100644 vendor/github.com/invopop/jsonschema/.golangci.yml delete mode 100644 vendor/github.com/invopop/jsonschema/COPYING delete mode 100644 vendor/github.com/invopop/jsonschema/README.md delete mode 100644 vendor/github.com/invopop/jsonschema/comment_extractor.go delete mode 100644 vendor/github.com/invopop/jsonschema/id.go delete mode 100644 vendor/github.com/invopop/jsonschema/reflect.go delete mode 100644 vendor/github.com/invopop/jsonschema/utils.go delete mode 100644 vendor/github.com/jbenet/go-context/LICENSE delete mode 100644 vendor/github.com/jbenet/go-context/io/ctxio.go delete mode 100644 vendor/github.com/jdxcode/netrc/.travis.yml delete mode 100644 vendor/github.com/jdxcode/netrc/LICENSE delete mode 100644 vendor/github.com/jdxcode/netrc/README.md delete mode 100644 vendor/github.com/jdxcode/netrc/netrc.go delete mode 100644 vendor/github.com/jessevdk/go-flags/.travis.yml delete mode 100644 vendor/github.com/jessevdk/go-flags/LICENSE delete mode 100644 vendor/github.com/jessevdk/go-flags/README.md delete mode 100644 vendor/github.com/jessevdk/go-flags/arg.go delete mode 100644 vendor/github.com/jessevdk/go-flags/check_crosscompile.sh delete mode 100644 vendor/github.com/jessevdk/go-flags/closest.go delete mode 100644 vendor/github.com/jessevdk/go-flags/command.go delete mode 100644 vendor/github.com/jessevdk/go-flags/completion.go delete mode 100644 vendor/github.com/jessevdk/go-flags/convert.go delete mode 100644 vendor/github.com/jessevdk/go-flags/error.go delete mode 100644 vendor/github.com/jessevdk/go-flags/flags.go delete mode 100644 vendor/github.com/jessevdk/go-flags/group.go delete mode 100644 vendor/github.com/jessevdk/go-flags/help.go delete mode 100644 vendor/github.com/jessevdk/go-flags/ini.go delete mode 100644 vendor/github.com/jessevdk/go-flags/man.go delete mode 100644 vendor/github.com/jessevdk/go-flags/multitag.go delete mode 100644 vendor/github.com/jessevdk/go-flags/option.go delete mode 100644 vendor/github.com/jessevdk/go-flags/optstyle_other.go delete mode 100644 vendor/github.com/jessevdk/go-flags/optstyle_windows.go delete mode 100644 vendor/github.com/jessevdk/go-flags/parser.go delete mode 100644 vendor/github.com/jessevdk/go-flags/termsize.go delete mode 100644 vendor/github.com/jessevdk/go-flags/termsize_nosysioctl.go delete mode 100644 vendor/github.com/jessevdk/go-flags/termsize_windows.go delete mode 100644 vendor/github.com/jgautheron/goconst/.gitignore delete mode 100644 vendor/github.com/jgautheron/goconst/LICENSE delete mode 100644 vendor/github.com/jgautheron/goconst/README.md delete mode 100644 vendor/github.com/jgautheron/goconst/api.go delete mode 100644 vendor/github.com/jgautheron/goconst/parser.go delete mode 100644 vendor/github.com/jgautheron/goconst/visitor.go delete mode 100644 vendor/github.com/jingyugao/rowserrcheck/LICENSE delete mode 100644 vendor/github.com/jingyugao/rowserrcheck/passes/rowserr/rowserr.go delete mode 100644 vendor/github.com/jirfag/go-printf-func-name/LICENSE delete mode 100644 vendor/github.com/jirfag/go-printf-func-name/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/josharian/intern/README.md delete mode 100644 vendor/github.com/josharian/intern/intern.go delete mode 100644 vendor/github.com/josharian/intern/license.md delete mode 100644 vendor/github.com/julz/importas/.gitignore delete mode 100644 vendor/github.com/julz/importas/LICENSE delete mode 100644 vendor/github.com/julz/importas/README.md delete mode 100644 vendor/github.com/julz/importas/analyzer.go delete mode 100644 vendor/github.com/julz/importas/config.go delete mode 100644 vendor/github.com/julz/importas/flags.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/.gitattributes delete mode 100644 vendor/github.com/kevinburke/ssh_config/.gitignore delete mode 100644 vendor/github.com/kevinburke/ssh_config/.mailmap delete mode 100644 vendor/github.com/kevinburke/ssh_config/AUTHORS.txt delete mode 100644 vendor/github.com/kevinburke/ssh_config/CHANGELOG.md delete mode 100644 vendor/github.com/kevinburke/ssh_config/LICENSE delete mode 100644 vendor/github.com/kevinburke/ssh_config/Makefile delete mode 100644 vendor/github.com/kevinburke/ssh_config/README.md delete mode 100644 vendor/github.com/kevinburke/ssh_config/config.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/lexer.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/parser.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/position.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/token.go delete mode 100644 vendor/github.com/kevinburke/ssh_config/validators.go delete mode 100644 vendor/github.com/kisielk/errcheck/LICENSE delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/analyzer.go delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/embedded_walker.go delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/errcheck.go delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/excludes.go delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/tags.go delete mode 100644 vendor/github.com/kisielk/errcheck/errcheck/tags_compat.go delete mode 100644 vendor/github.com/kisielk/gotool/.travis.yml delete mode 100644 vendor/github.com/kisielk/gotool/LEGAL delete mode 100644 vendor/github.com/kisielk/gotool/LICENSE delete mode 100644 vendor/github.com/kisielk/gotool/README.md delete mode 100644 vendor/github.com/kisielk/gotool/go13.go delete mode 100644 vendor/github.com/kisielk/gotool/go14-15.go delete mode 100644 vendor/github.com/kisielk/gotool/go16-18.go delete mode 100644 vendor/github.com/kisielk/gotool/internal/load/path.go delete mode 100644 vendor/github.com/kisielk/gotool/internal/load/pkg.go delete mode 100644 vendor/github.com/kisielk/gotool/internal/load/search.go delete mode 100644 vendor/github.com/kisielk/gotool/match.go delete mode 100644 vendor/github.com/kisielk/gotool/match18.go delete mode 100644 vendor/github.com/kisielk/gotool/tool.go delete mode 100644 vendor/github.com/kkHAIKE/contextcheck/.gitignore delete mode 100644 vendor/github.com/kkHAIKE/contextcheck/LICENSE delete mode 100644 vendor/github.com/kkHAIKE/contextcheck/Makefile delete mode 100644 vendor/github.com/kkHAIKE/contextcheck/README.md delete mode 100644 vendor/github.com/kkHAIKE/contextcheck/contextcheck.go delete mode 100644 vendor/github.com/klauspost/compress/.gitattributes delete mode 100644 vendor/github.com/klauspost/compress/.gitignore delete mode 100644 vendor/github.com/klauspost/compress/.goreleaser.yml delete mode 100644 vendor/github.com/klauspost/compress/LICENSE delete mode 100644 vendor/github.com/klauspost/compress/README.md delete mode 100644 vendor/github.com/klauspost/compress/SECURITY.md delete mode 100644 vendor/github.com/klauspost/compress/compressible.go delete mode 100644 vendor/github.com/klauspost/compress/flate/deflate.go delete mode 100644 vendor/github.com/klauspost/compress/flate/dict_decoder.go delete mode 100644 vendor/github.com/klauspost/compress/flate/fast_encoder.go delete mode 100644 vendor/github.com/klauspost/compress/flate/huffman_bit_writer.go delete mode 100644 vendor/github.com/klauspost/compress/flate/huffman_code.go delete mode 100644 vendor/github.com/klauspost/compress/flate/huffman_sortByFreq.go delete mode 100644 vendor/github.com/klauspost/compress/flate/huffman_sortByLiteral.go delete mode 100644 vendor/github.com/klauspost/compress/flate/inflate.go delete mode 100644 vendor/github.com/klauspost/compress/flate/inflate_gen.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level1.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level2.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level3.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level4.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level5.go delete mode 100644 vendor/github.com/klauspost/compress/flate/level6.go delete mode 100644 vendor/github.com/klauspost/compress/flate/matchlen_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/flate/matchlen_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/flate/matchlen_generic.go delete mode 100644 vendor/github.com/klauspost/compress/flate/regmask_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/flate/regmask_other.go delete mode 100644 vendor/github.com/klauspost/compress/flate/stateless.go delete mode 100644 vendor/github.com/klauspost/compress/flate/token.go delete mode 100644 vendor/github.com/klauspost/compress/fse/README.md delete mode 100644 vendor/github.com/klauspost/compress/fse/bitreader.go delete mode 100644 vendor/github.com/klauspost/compress/fse/bitwriter.go delete mode 100644 vendor/github.com/klauspost/compress/fse/bytereader.go delete mode 100644 vendor/github.com/klauspost/compress/fse/compress.go delete mode 100644 vendor/github.com/klauspost/compress/fse/decompress.go delete mode 100644 vendor/github.com/klauspost/compress/fse/fse.go delete mode 100644 vendor/github.com/klauspost/compress/gen.sh delete mode 100644 vendor/github.com/klauspost/compress/huff0/.gitignore delete mode 100644 vendor/github.com/klauspost/compress/huff0/README.md delete mode 100644 vendor/github.com/klauspost/compress/huff0/bitreader.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/bitwriter.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/compress.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/huff0/decompress_generic.go delete mode 100644 vendor/github.com/klauspost/compress/huff0/huff0.go delete mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo.go delete mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/internal/cpuinfo/cpuinfo_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/LICENSE delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/decode.go delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/decode_other.go delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/encode.go delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/encode_other.go delete mode 100644 vendor/github.com/klauspost/compress/internal/snapref/snappy.go delete mode 100644 vendor/github.com/klauspost/compress/s2sx.mod delete mode 100644 vendor/github.com/klauspost/compress/s2sx.sum delete mode 100644 vendor/github.com/klauspost/compress/zip/reader.go delete mode 100644 vendor/github.com/klauspost/compress/zip/register.go delete mode 100644 vendor/github.com/klauspost/compress/zip/struct.go delete mode 100644 vendor/github.com/klauspost/compress/zip/writer.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/README.md delete mode 100644 vendor/github.com/klauspost/compress/zstd/bitreader.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/bitwriter.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/blockdec.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/blockenc.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/blocktype_string.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/bytebuf.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/bytereader.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/decodeheader.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/decoder.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/decoder_options.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/dict.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_base.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_best.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_better.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_dfast.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/enc_fast.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/encoder.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/encoder_options.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/framedec.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/frameenc.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_encoder.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/fse_predefined.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/hash.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/history.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_arm64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_asm.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/matchlen_generic.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s delete mode 100644 vendor/github.com/klauspost/compress/zstd/seqdec_generic.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/seqenc.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/snappy.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/zip.go delete mode 100644 vendor/github.com/klauspost/compress/zstd/zstd.go delete mode 100644 vendor/github.com/klauspost/pgzip/.gitignore delete mode 100644 vendor/github.com/klauspost/pgzip/.travis.yml delete mode 100644 vendor/github.com/klauspost/pgzip/GO_LICENSE delete mode 100644 vendor/github.com/klauspost/pgzip/LICENSE delete mode 100644 vendor/github.com/klauspost/pgzip/README.md delete mode 100644 vendor/github.com/klauspost/pgzip/gunzip.go delete mode 100644 vendor/github.com/klauspost/pgzip/gzip.go delete mode 100644 vendor/github.com/kr/pretty/.gitignore delete mode 100644 vendor/github.com/kr/pretty/License delete mode 100644 vendor/github.com/kr/pretty/Readme delete mode 100644 vendor/github.com/kr/pretty/diff.go delete mode 100644 vendor/github.com/kr/pretty/formatter.go delete mode 100644 vendor/github.com/kr/pretty/pretty.go delete mode 100644 vendor/github.com/kr/pretty/zero.go delete mode 100644 vendor/github.com/kr/text/License delete mode 100644 vendor/github.com/kr/text/Readme delete mode 100644 vendor/github.com/kr/text/doc.go delete mode 100644 vendor/github.com/kr/text/indent.go delete mode 100644 vendor/github.com/kr/text/wrap.go delete mode 100644 vendor/github.com/kulti/thelper/LICENSE delete mode 100644 vendor/github.com/kulti/thelper/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/kulti/thelper/pkg/analyzer/report.go delete mode 100644 vendor/github.com/kunwardeep/paralleltest/LICENSE delete mode 100644 vendor/github.com/kunwardeep/paralleltest/pkg/paralleltest/paralleltest.go delete mode 100644 vendor/github.com/kyoh86/exportloopref/.golangci.yml delete mode 100644 vendor/github.com/kyoh86/exportloopref/.goreleaser.yml delete mode 100644 vendor/github.com/kyoh86/exportloopref/LICENSE delete mode 100644 vendor/github.com/kyoh86/exportloopref/Makefile delete mode 100644 vendor/github.com/kyoh86/exportloopref/README.md delete mode 100644 vendor/github.com/kyoh86/exportloopref/exportloopref.go delete mode 100644 vendor/github.com/ldez/gomoddirectives/.gitignore delete mode 100644 vendor/github.com/ldez/gomoddirectives/.golangci.yml delete mode 100644 vendor/github.com/ldez/gomoddirectives/LICENSE delete mode 100644 vendor/github.com/ldez/gomoddirectives/Makefile delete mode 100644 vendor/github.com/ldez/gomoddirectives/gomoddirectives.go delete mode 100644 vendor/github.com/ldez/gomoddirectives/module.go delete mode 100644 vendor/github.com/ldez/gomoddirectives/readme.md delete mode 100644 vendor/github.com/ldez/tagliatelle/.gitignore delete mode 100644 vendor/github.com/ldez/tagliatelle/.golangci.yml delete mode 100644 vendor/github.com/ldez/tagliatelle/LICENSE delete mode 100644 vendor/github.com/ldez/tagliatelle/Makefile delete mode 100644 vendor/github.com/ldez/tagliatelle/readme.md delete mode 100644 vendor/github.com/ldez/tagliatelle/tagliatelle.go delete mode 100644 vendor/github.com/leonklingele/grouper/LICENSE delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/config.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/consts/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/consts/config.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/flags.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/globals/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/imports/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/imports/config.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/types/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/types/config.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/vars/analyzer.go delete mode 100644 vendor/github.com/leonklingele/grouper/pkg/analyzer/vars/config.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/.gitignore delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/LICENSE delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/README.md delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/colorgens.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/colors.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/hexcolor.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/hsluv-snapshot-rev4.json delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/hsluv.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/soft_palettegen.go delete mode 100644 vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go delete mode 100644 vendor/github.com/lufeee/execinquery/.gitignore delete mode 100644 vendor/github.com/lufeee/execinquery/LICENSE delete mode 100644 vendor/github.com/lufeee/execinquery/README.md delete mode 100644 vendor/github.com/lufeee/execinquery/execinquery.go delete mode 100644 vendor/github.com/macabu/inamedparam/.gitignore delete mode 100644 vendor/github.com/macabu/inamedparam/.golangci.yml delete mode 100644 vendor/github.com/macabu/inamedparam/LICENSE-MIT delete mode 100644 vendor/github.com/macabu/inamedparam/README.md delete mode 100644 vendor/github.com/macabu/inamedparam/inamedparam.go delete mode 100644 vendor/github.com/mailru/easyjson/LICENSE delete mode 100644 vendor/github.com/mailru/easyjson/buffer/pool.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/bytestostr_nounsafe.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/error.go delete mode 100644 vendor/github.com/mailru/easyjson/jlexer/lexer.go delete mode 100644 vendor/github.com/mailru/easyjson/jwriter/writer.go delete mode 100644 vendor/github.com/maratori/testableexamples/LICENSE delete mode 100644 vendor/github.com/maratori/testableexamples/pkg/testableexamples/testableexamples.go delete mode 100644 vendor/github.com/maratori/testpackage/LICENSE delete mode 100644 vendor/github.com/maratori/testpackage/pkg/testpackage/testpackage.go delete mode 100644 vendor/github.com/matoous/godox/.gitignore delete mode 100644 vendor/github.com/matoous/godox/.golangci.yml delete mode 100644 vendor/github.com/matoous/godox/.revive.toml delete mode 100644 vendor/github.com/matoous/godox/LICENSE delete mode 100644 vendor/github.com/matoous/godox/Makefile delete mode 100644 vendor/github.com/matoous/godox/README.md delete mode 100644 vendor/github.com/matoous/godox/godox.go delete mode 100644 vendor/github.com/mattn/go-colorable/LICENSE delete mode 100644 vendor/github.com/mattn/go-colorable/README.md delete mode 100644 vendor/github.com/mattn/go-colorable/colorable_appengine.go delete mode 100644 vendor/github.com/mattn/go-colorable/colorable_others.go delete mode 100644 vendor/github.com/mattn/go-colorable/colorable_windows.go delete mode 100644 vendor/github.com/mattn/go-colorable/go.test.sh delete mode 100644 vendor/github.com/mattn/go-colorable/noncolorable.go delete mode 100644 vendor/github.com/mattn/go-isatty/LICENSE delete mode 100644 vendor/github.com/mattn/go-isatty/README.md delete mode 100644 vendor/github.com/mattn/go-isatty/doc.go delete mode 100644 vendor/github.com/mattn/go-isatty/go.test.sh delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_bsd.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_others.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_plan9.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_solaris.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_tcgets.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_windows.go delete mode 100644 vendor/github.com/mattn/go-runewidth/LICENSE delete mode 100644 vendor/github.com/mattn/go-runewidth/README.md delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_appengine.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_js.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_posix.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_table.go delete mode 100644 vendor/github.com/mattn/go-runewidth/runewidth_windows.go delete mode 100644 vendor/github.com/mbilski/exhaustivestruct/LICENSE delete mode 100644 vendor/github.com/mbilski/exhaustivestruct/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/mgechev/revive/LICENSE delete mode 100644 vendor/github.com/mgechev/revive/config/config.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/checkstyle.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/default.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/doc.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/friendly.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/json.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/ndjson.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/plain.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/sarif.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/severity.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/stylish.go delete mode 100644 vendor/github.com/mgechev/revive/formatter/unix.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/args.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/branch.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/branch_kind.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/chain.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/doc.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/func.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/rule.go delete mode 100644 vendor/github.com/mgechev/revive/internal/ifelse/target.go delete mode 100644 vendor/github.com/mgechev/revive/internal/typeparams/typeparams.go delete mode 100644 vendor/github.com/mgechev/revive/internal/typeparams/typeparams_go117.go delete mode 100644 vendor/github.com/mgechev/revive/internal/typeparams/typeparams_go118.go delete mode 100644 vendor/github.com/mgechev/revive/lint/config.go delete mode 100644 vendor/github.com/mgechev/revive/lint/doc.go delete mode 100644 vendor/github.com/mgechev/revive/lint/failure.go delete mode 100644 vendor/github.com/mgechev/revive/lint/file.go delete mode 100644 vendor/github.com/mgechev/revive/lint/filefilter.go delete mode 100644 vendor/github.com/mgechev/revive/lint/formatter.go delete mode 100644 vendor/github.com/mgechev/revive/lint/linter.go delete mode 100644 vendor/github.com/mgechev/revive/lint/package.go delete mode 100644 vendor/github.com/mgechev/revive/lint/rule.go delete mode 100644 vendor/github.com/mgechev/revive/lint/utils.go delete mode 100644 vendor/github.com/mgechev/revive/rule/add-constant.go delete mode 100644 vendor/github.com/mgechev/revive/rule/argument-limit.go delete mode 100644 vendor/github.com/mgechev/revive/rule/atomic.go delete mode 100644 vendor/github.com/mgechev/revive/rule/banned-characters.go delete mode 100644 vendor/github.com/mgechev/revive/rule/bare-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/blank-imports.go delete mode 100644 vendor/github.com/mgechev/revive/rule/bool-literal-in-expr.go delete mode 100644 vendor/github.com/mgechev/revive/rule/call-to-gc.go delete mode 100644 vendor/github.com/mgechev/revive/rule/cognitive-complexity.go delete mode 100644 vendor/github.com/mgechev/revive/rule/comment-spacings.go delete mode 100644 vendor/github.com/mgechev/revive/rule/confusing-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/confusing-results.go delete mode 100644 vendor/github.com/mgechev/revive/rule/constant-logical-expr.go delete mode 100644 vendor/github.com/mgechev/revive/rule/context-as-argument.go delete mode 100644 vendor/github.com/mgechev/revive/rule/context-keys-type.go delete mode 100644 vendor/github.com/mgechev/revive/rule/cyclomatic.go delete mode 100644 vendor/github.com/mgechev/revive/rule/datarace.go delete mode 100644 vendor/github.com/mgechev/revive/rule/deep-exit.go delete mode 100644 vendor/github.com/mgechev/revive/rule/defer.go delete mode 100644 vendor/github.com/mgechev/revive/rule/doc.go delete mode 100644 vendor/github.com/mgechev/revive/rule/dot-imports.go delete mode 100644 vendor/github.com/mgechev/revive/rule/duplicated-imports.go delete mode 100644 vendor/github.com/mgechev/revive/rule/early-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/empty-block.go delete mode 100644 vendor/github.com/mgechev/revive/rule/empty-lines.go delete mode 100644 vendor/github.com/mgechev/revive/rule/enforce-map-style.go delete mode 100644 vendor/github.com/mgechev/revive/rule/enforce-repeated-arg-type-style.go delete mode 100644 vendor/github.com/mgechev/revive/rule/enforce-slice-style.go delete mode 100644 vendor/github.com/mgechev/revive/rule/error-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/error-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/error-strings.go delete mode 100644 vendor/github.com/mgechev/revive/rule/errorf.go delete mode 100644 vendor/github.com/mgechev/revive/rule/exported.go delete mode 100644 vendor/github.com/mgechev/revive/rule/file-header.go delete mode 100644 vendor/github.com/mgechev/revive/rule/flag-param.go delete mode 100644 vendor/github.com/mgechev/revive/rule/function-length.go delete mode 100644 vendor/github.com/mgechev/revive/rule/function-result-limit.go delete mode 100644 vendor/github.com/mgechev/revive/rule/get-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/identical-branches.go delete mode 100644 vendor/github.com/mgechev/revive/rule/if-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/import-alias-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/import-shadowing.go delete mode 100644 vendor/github.com/mgechev/revive/rule/imports-blacklist.go delete mode 100644 vendor/github.com/mgechev/revive/rule/increment-decrement.go delete mode 100644 vendor/github.com/mgechev/revive/rule/indent-error-flow.go delete mode 100644 vendor/github.com/mgechev/revive/rule/line-length-limit.go delete mode 100644 vendor/github.com/mgechev/revive/rule/max-public-structs.go delete mode 100644 vendor/github.com/mgechev/revive/rule/modifies-param.go delete mode 100644 vendor/github.com/mgechev/revive/rule/modifies-value-receiver.go delete mode 100644 vendor/github.com/mgechev/revive/rule/nested-structs.go delete mode 100644 vendor/github.com/mgechev/revive/rule/optimize-operands-order.go delete mode 100644 vendor/github.com/mgechev/revive/rule/package-comments.go delete mode 100644 vendor/github.com/mgechev/revive/rule/range-val-address.go delete mode 100644 vendor/github.com/mgechev/revive/rule/range-val-in-closure.go delete mode 100644 vendor/github.com/mgechev/revive/rule/range.go delete mode 100644 vendor/github.com/mgechev/revive/rule/receiver-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/redefines-builtin-id.go delete mode 100644 vendor/github.com/mgechev/revive/rule/redundant-import-alias.go delete mode 100644 vendor/github.com/mgechev/revive/rule/string-format.go delete mode 100644 vendor/github.com/mgechev/revive/rule/string-of-int.go delete mode 100644 vendor/github.com/mgechev/revive/rule/struct-tag.go delete mode 100644 vendor/github.com/mgechev/revive/rule/superfluous-else.go delete mode 100644 vendor/github.com/mgechev/revive/rule/time-equal.go delete mode 100644 vendor/github.com/mgechev/revive/rule/time-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unchecked-type-assertion.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unconditional-recursion.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unexported-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unexported-return.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unhandled-error.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unnecessary-stmt.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unreachable-code.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unused-param.go delete mode 100644 vendor/github.com/mgechev/revive/rule/unused-receiver.go delete mode 100644 vendor/github.com/mgechev/revive/rule/use-any.go delete mode 100644 vendor/github.com/mgechev/revive/rule/useless-break.go delete mode 100644 vendor/github.com/mgechev/revive/rule/utils.go delete mode 100644 vendor/github.com/mgechev/revive/rule/var-declarations.go delete mode 100644 vendor/github.com/mgechev/revive/rule/var-naming.go delete mode 100644 vendor/github.com/mgechev/revive/rule/waitgroup-by-value.go delete mode 100644 vendor/github.com/mitchellh/copystructure/LICENSE delete mode 100644 vendor/github.com/mitchellh/copystructure/README.md delete mode 100644 vendor/github.com/mitchellh/copystructure/copier_time.go delete mode 100644 vendor/github.com/mitchellh/copystructure/copystructure.go delete mode 100644 vendor/github.com/mitchellh/go-homedir/LICENSE delete mode 100644 vendor/github.com/mitchellh/go-homedir/README.md delete mode 100644 vendor/github.com/mitchellh/go-homedir/homedir.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/.travis.yml delete mode 100644 vendor/github.com/mitchellh/reflectwalk/LICENSE delete mode 100644 vendor/github.com/mitchellh/reflectwalk/README.md delete mode 100644 vendor/github.com/mitchellh/reflectwalk/location.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/location_string.go delete mode 100644 vendor/github.com/mitchellh/reflectwalk/reflectwalk.go delete mode 100644 vendor/github.com/moby/term/.gitignore delete mode 100644 vendor/github.com/moby/term/LICENSE delete mode 100644 vendor/github.com/moby/term/README.md delete mode 100644 vendor/github.com/moby/term/ascii.go delete mode 100644 vendor/github.com/moby/term/doc.go delete mode 100644 vendor/github.com/moby/term/proxy.go delete mode 100644 vendor/github.com/moby/term/term.go delete mode 100644 vendor/github.com/moby/term/term_unix.go delete mode 100644 vendor/github.com/moby/term/term_windows.go delete mode 100644 vendor/github.com/moby/term/termios_bsd.go delete mode 100644 vendor/github.com/moby/term/termios_nonbsd.go delete mode 100644 vendor/github.com/moby/term/termios_unix.go delete mode 100644 vendor/github.com/moby/term/termios_windows.go delete mode 100644 vendor/github.com/moby/term/windows/ansi_reader.go delete mode 100644 vendor/github.com/moby/term/windows/ansi_writer.go delete mode 100644 vendor/github.com/moby/term/windows/console.go delete mode 100644 vendor/github.com/moby/term/windows/doc.go delete mode 100644 vendor/github.com/moricho/tparallel/.gitignore delete mode 100644 vendor/github.com/moricho/tparallel/.goreleaser.yaml delete mode 100644 vendor/github.com/moricho/tparallel/LICENSE delete mode 100644 vendor/github.com/moricho/tparallel/Makefile delete mode 100644 vendor/github.com/moricho/tparallel/README.md delete mode 100644 vendor/github.com/moricho/tparallel/pkg/ssafunc/ssafunc.go delete mode 100644 vendor/github.com/moricho/tparallel/pkg/ssainstr/ssainstr.go delete mode 100644 vendor/github.com/moricho/tparallel/testmap.go delete mode 100644 vendor/github.com/moricho/tparallel/tparallel.go delete mode 100644 vendor/github.com/morikuni/aec/LICENSE delete mode 100644 vendor/github.com/morikuni/aec/README.md delete mode 100644 vendor/github.com/morikuni/aec/aec.go delete mode 100644 vendor/github.com/morikuni/aec/ansi.go delete mode 100644 vendor/github.com/morikuni/aec/builder.go delete mode 100644 vendor/github.com/morikuni/aec/sample.gif delete mode 100644 vendor/github.com/morikuni/aec/sgr.go delete mode 100644 vendor/github.com/muesli/mango-cobra/.gitignore delete mode 100644 vendor/github.com/muesli/mango-cobra/.golangci-soft.yml delete mode 100644 vendor/github.com/muesli/mango-cobra/.golangci.yml delete mode 100644 vendor/github.com/muesli/mango-cobra/LICENSE delete mode 100644 vendor/github.com/muesli/mango-cobra/README.md delete mode 100644 vendor/github.com/muesli/mango-cobra/mcobra.go delete mode 100644 vendor/github.com/muesli/mango-pflag/.gitignore delete mode 100644 vendor/github.com/muesli/mango-pflag/.golangci-soft.yml delete mode 100644 vendor/github.com/muesli/mango-pflag/.golangci.yml delete mode 100644 vendor/github.com/muesli/mango-pflag/LICENSE delete mode 100644 vendor/github.com/muesli/mango-pflag/README.md delete mode 100644 vendor/github.com/muesli/mango-pflag/mpflag.go delete mode 100644 vendor/github.com/muesli/mango/.gitignore delete mode 100644 vendor/github.com/muesli/mango/.golangci-soft.yml delete mode 100644 vendor/github.com/muesli/mango/.golangci.yml delete mode 100644 vendor/github.com/muesli/mango/LICENSE delete mode 100644 vendor/github.com/muesli/mango/README.md delete mode 100644 vendor/github.com/muesli/mango/builder.go delete mode 100644 vendor/github.com/muesli/mango/mango.go delete mode 100644 vendor/github.com/muesli/mango/mango.png delete mode 100644 vendor/github.com/muesli/reflow/LICENSE delete mode 100644 vendor/github.com/muesli/reflow/ansi/ansi.go delete mode 100644 vendor/github.com/muesli/reflow/ansi/buffer.go delete mode 100644 vendor/github.com/muesli/reflow/ansi/writer.go delete mode 100644 vendor/github.com/muesli/reflow/truncate/truncate.go delete mode 100644 vendor/github.com/muesli/reflow/wordwrap/wordwrap.go delete mode 100644 vendor/github.com/muesli/reflow/wrap/wrap.go delete mode 100644 vendor/github.com/muesli/roff/.gitignore delete mode 100644 vendor/github.com/muesli/roff/.golangci-soft.yml delete mode 100644 vendor/github.com/muesli/roff/.golangci.yml delete mode 100644 vendor/github.com/muesli/roff/LICENSE delete mode 100644 vendor/github.com/muesli/roff/README.md delete mode 100644 vendor/github.com/muesli/roff/roff.go delete mode 100644 vendor/github.com/muesli/termenv/.gitignore delete mode 100644 vendor/github.com/muesli/termenv/.golangci-soft.yml delete mode 100644 vendor/github.com/muesli/termenv/.golangci.yml delete mode 100644 vendor/github.com/muesli/termenv/LICENSE delete mode 100644 vendor/github.com/muesli/termenv/README.md delete mode 100644 vendor/github.com/muesli/termenv/ansi_compat.md delete mode 100644 vendor/github.com/muesli/termenv/ansicolors.go delete mode 100644 vendor/github.com/muesli/termenv/color.go delete mode 100644 vendor/github.com/muesli/termenv/constants_linux.go delete mode 100644 vendor/github.com/muesli/termenv/constants_solaris.go delete mode 100644 vendor/github.com/muesli/termenv/constants_unix.go delete mode 100644 vendor/github.com/muesli/termenv/copy.go delete mode 100644 vendor/github.com/muesli/termenv/hyperlink.go delete mode 100644 vendor/github.com/muesli/termenv/notification.go delete mode 100644 vendor/github.com/muesli/termenv/output.go delete mode 100644 vendor/github.com/muesli/termenv/profile.go delete mode 100644 vendor/github.com/muesli/termenv/screen.go delete mode 100644 vendor/github.com/muesli/termenv/style.go delete mode 100644 vendor/github.com/muesli/termenv/templatehelper.go delete mode 100644 vendor/github.com/muesli/termenv/termenv.go delete mode 100644 vendor/github.com/muesli/termenv/termenv_other.go delete mode 100644 vendor/github.com/muesli/termenv/termenv_posix.go delete mode 100644 vendor/github.com/muesli/termenv/termenv_solaris.go delete mode 100644 vendor/github.com/muesli/termenv/termenv_unix.go delete mode 100644 vendor/github.com/muesli/termenv/termenv_windows.go delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/.bazelignore delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/.bazelrc delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/.gitignore delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/.travis.yml delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/BUILD.bazel delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/LICENSE.txt delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/Makefile delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/README.md delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/WORKSPACE delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/go_deps.bzl delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/helper.go delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/plugin/BUILD.bazel delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/plugin/plugin.go delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/protoc-gen-govalidators/BUILD.bazel delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/protoc-gen-govalidators/main.go delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/validator.pb.go delete mode 100644 vendor/github.com/mwitkow/go-proto-validators/validator.proto delete mode 100644 vendor/github.com/nakabonne/nestif/.gitignore delete mode 100644 vendor/github.com/nakabonne/nestif/LICENSE delete mode 100644 vendor/github.com/nakabonne/nestif/README.md delete mode 100644 vendor/github.com/nakabonne/nestif/nestif.go delete mode 100644 vendor/github.com/nishanths/exhaustive/.gitignore delete mode 100644 vendor/github.com/nishanths/exhaustive/LICENSE delete mode 100644 vendor/github.com/nishanths/exhaustive/Makefile delete mode 100644 vendor/github.com/nishanths/exhaustive/README.md delete mode 100644 vendor/github.com/nishanths/exhaustive/comment.go delete mode 100644 vendor/github.com/nishanths/exhaustive/comment_go121.go delete mode 100644 vendor/github.com/nishanths/exhaustive/comment_pre_go121.go delete mode 100644 vendor/github.com/nishanths/exhaustive/common.go delete mode 100644 vendor/github.com/nishanths/exhaustive/doc.go delete mode 100644 vendor/github.com/nishanths/exhaustive/enum.go delete mode 100644 vendor/github.com/nishanths/exhaustive/exhaustive.go delete mode 100644 vendor/github.com/nishanths/exhaustive/fact.go delete mode 100644 vendor/github.com/nishanths/exhaustive/flag.go delete mode 100644 vendor/github.com/nishanths/exhaustive/map.go delete mode 100644 vendor/github.com/nishanths/exhaustive/switch.go delete mode 100644 vendor/github.com/nishanths/predeclared/LICENSE delete mode 100644 vendor/github.com/nishanths/predeclared/passes/predeclared/go18.go delete mode 100644 vendor/github.com/nishanths/predeclared/passes/predeclared/pre_go18.go delete mode 100644 vendor/github.com/nishanths/predeclared/passes/predeclared/predeclared.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/.gitignore delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/.golangci.yml delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/LICENSE delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/Makefile delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/README.md delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/ginkgo_linter.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/ginkgohandler/handler.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/gomegahandler/handler.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/interfaces/interfaces.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/reverseassertion/reverse_assertion.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/types/boolean.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/types/config.go delete mode 100644 vendor/github.com/nunnatsa/ginkgolinter/version/version.go delete mode 100644 vendor/github.com/oklog/ulid/.gitignore delete mode 100644 vendor/github.com/oklog/ulid/.travis.yml delete mode 100644 vendor/github.com/oklog/ulid/AUTHORS.md delete mode 100644 vendor/github.com/oklog/ulid/CHANGELOG.md delete mode 100644 vendor/github.com/oklog/ulid/CONTRIBUTING.md delete mode 100644 vendor/github.com/oklog/ulid/Gopkg.lock delete mode 100644 vendor/github.com/oklog/ulid/Gopkg.toml delete mode 100644 vendor/github.com/oklog/ulid/LICENSE delete mode 100644 vendor/github.com/oklog/ulid/README.md delete mode 100644 vendor/github.com/oklog/ulid/ulid.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/.gitignore delete mode 100644 vendor/github.com/olekukonko/tablewriter/.travis.yml delete mode 100644 vendor/github.com/olekukonko/tablewriter/LICENSE.md delete mode 100644 vendor/github.com/olekukonko/tablewriter/README.md delete mode 100644 vendor/github.com/olekukonko/tablewriter/csv.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/table.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/table_with_color.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/util.go delete mode 100644 vendor/github.com/olekukonko/tablewriter/wrap.go delete mode 100644 vendor/github.com/opencontainers/go-digest/.mailmap delete mode 100644 vendor/github.com/opencontainers/go-digest/.pullapprove.yml delete mode 100644 vendor/github.com/opencontainers/go-digest/.travis.yml delete mode 100644 vendor/github.com/opencontainers/go-digest/CONTRIBUTING.md delete mode 100644 vendor/github.com/opencontainers/go-digest/LICENSE delete mode 100644 vendor/github.com/opencontainers/go-digest/LICENSE.docs delete mode 100644 vendor/github.com/opencontainers/go-digest/MAINTAINERS delete mode 100644 vendor/github.com/opencontainers/go-digest/README.md delete mode 100644 vendor/github.com/opencontainers/go-digest/algorithm.go delete mode 100644 vendor/github.com/opencontainers/go-digest/digest.go delete mode 100644 vendor/github.com/opencontainers/go-digest/digester.go delete mode 100644 vendor/github.com/opencontainers/go-digest/digestset/set.go delete mode 100644 vendor/github.com/opencontainers/go-digest/doc.go delete mode 100644 vendor/github.com/opencontainers/go-digest/verifiers.go delete mode 100644 vendor/github.com/opencontainers/image-spec/LICENSE delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/annotations.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/version.go delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/versioned.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/Dockerfile.arm delete mode 100644 vendor/github.com/pjbgf/sha1cd/Dockerfile.arm64 delete mode 100644 vendor/github.com/pjbgf/sha1cd/LICENSE delete mode 100644 vendor/github.com/pjbgf/sha1cd/Makefile delete mode 100644 vendor/github.com/pjbgf/sha1cd/README.md delete mode 100644 vendor/github.com/pjbgf/sha1cd/detection.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/internal/const.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/sha1cd.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/sha1cdblock_amd64.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/sha1cdblock_amd64.s delete mode 100644 vendor/github.com/pjbgf/sha1cd/sha1cdblock_generic.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/sha1cdblock_noasm.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/ubc/check.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/ubc/const.go delete mode 100644 vendor/github.com/pjbgf/sha1cd/ubc/doc.go delete mode 100644 vendor/github.com/pkg/browser/LICENSE delete mode 100644 vendor/github.com/pkg/browser/README.md delete mode 100644 vendor/github.com/pkg/browser/browser.go delete mode 100644 vendor/github.com/pkg/browser/browser_darwin.go delete mode 100644 vendor/github.com/pkg/browser/browser_freebsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_linux.go delete mode 100644 vendor/github.com/pkg/browser/browser_netbsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_openbsd.go delete mode 100644 vendor/github.com/pkg/browser/browser_unsupported.go delete mode 100644 vendor/github.com/pkg/browser/browser_windows.go delete mode 100644 vendor/github.com/pkg/errors/.gitignore delete mode 100644 vendor/github.com/pkg/errors/.travis.yml delete mode 100644 vendor/github.com/pkg/errors/LICENSE delete mode 100644 vendor/github.com/pkg/errors/Makefile delete mode 100644 vendor/github.com/pkg/errors/README.md delete mode 100644 vendor/github.com/pkg/errors/appveyor.yml delete mode 100644 vendor/github.com/pkg/errors/errors.go delete mode 100644 vendor/github.com/pkg/errors/go113.go delete mode 100644 vendor/github.com/pkg/errors/stack.go delete mode 100644 vendor/github.com/pkg/profile/.travis.yml delete mode 100644 vendor/github.com/pkg/profile/AUTHORS delete mode 100644 vendor/github.com/pkg/profile/LICENSE delete mode 100644 vendor/github.com/pkg/profile/README.md delete mode 100644 vendor/github.com/pkg/profile/profile.go delete mode 100644 vendor/github.com/polyfloyd/go-errorlint/LICENSE delete mode 100644 vendor/github.com/polyfloyd/go-errorlint/errorlint/allowed.go delete mode 100644 vendor/github.com/polyfloyd/go-errorlint/errorlint/analysis.go delete mode 100644 vendor/github.com/polyfloyd/go-errorlint/errorlint/lint.go delete mode 100644 vendor/github.com/polyfloyd/go-errorlint/errorlint/printf.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/problem.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/promlint.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validation.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/counter_validations.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/generic_name_validations.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/help_validations.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/histogram_validations.go delete mode 100644 vendor/github.com/prometheus/client_golang/prometheus/testutil/promlint/validations/units.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/.dockerignore delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/.gitignore delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/.goreleaser.yaml delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/CHANGELOG.md delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/CONTRIBUTING.md delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/Dockerfile delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/LICENSE.md delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/Makefile delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/README.md delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc/flags.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc/main.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/doc.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/extensions/envoyproxy_validate/envoyproxy_validate.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/extensions/extensions.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/extensions/google_api_http/google_api_http.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/extensions/lyft_validate/alias.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/extensions/validator_field/validator_field.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/filters.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/plugin.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/renderer.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/resources.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/resources/docbook.tmpl delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/resources/html.tmpl delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/resources/markdown.tmpl delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/resources/scalars.json delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/revive.toml delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/template.go delete mode 100644 vendor/github.com/pseudomuto/protoc-gen-doc/version.go delete mode 100644 vendor/github.com/pseudomuto/protokit/.gitignore delete mode 100644 vendor/github.com/pseudomuto/protokit/.gofmtignore delete mode 100644 vendor/github.com/pseudomuto/protokit/.travis.yml delete mode 100644 vendor/github.com/pseudomuto/protokit/CHANGELOG.md delete mode 100644 vendor/github.com/pseudomuto/protokit/Gopkg.lock delete mode 100644 vendor/github.com/pseudomuto/protokit/Gopkg.toml delete mode 100644 vendor/github.com/pseudomuto/protokit/LICENSE delete mode 100644 vendor/github.com/pseudomuto/protokit/Makefile delete mode 100644 vendor/github.com/pseudomuto/protokit/README.md delete mode 100644 vendor/github.com/pseudomuto/protokit/comments.go delete mode 100644 vendor/github.com/pseudomuto/protokit/context.go delete mode 100644 vendor/github.com/pseudomuto/protokit/doc.go delete mode 100644 vendor/github.com/pseudomuto/protokit/parser.go delete mode 100644 vendor/github.com/pseudomuto/protokit/plugin.go delete mode 100644 vendor/github.com/pseudomuto/protokit/tools.json delete mode 100644 vendor/github.com/pseudomuto/protokit/types.go delete mode 100644 vendor/github.com/pseudomuto/protokit/version.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/LICENSE delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/internal/goenv/goenv.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/internal/golist/golist.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/internal/xsrcimporter/xsrcimporter.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/internal/xtypes/xtypes.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ast_walker.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/bundle.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/engine.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/filters.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/go_version.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/gorule.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/goutil/goutil.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/goutil/resolve.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/importer.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/filter_op.gen.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/gen_filter_op.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir/ir.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_loader.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ir_utils.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/irconv/irconv.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/libdsl.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/match_data.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/nodepath.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/profiling/no_labels.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/profiling/with_labels.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/compile.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/debug_info.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/disasm.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/env.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/eval.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/gen_opcodes.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/opcode_string.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/opcodes.gen.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/quasigo.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qfmt/qfmt.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qstrconv/qstrconv.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/stdlib/qstrings/qstrings.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/quasigo/utils.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/ruleguard.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/runner.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/textmatch/compile.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/textmatch/matchers.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/textmatch/textmatch.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/typematch/patternop_string.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/typematch/typematch.go delete mode 100644 vendor/github.com/quasilyte/go-ruleguard/ruleguard/utils.go delete mode 100644 vendor/github.com/quasilyte/gogrep/.gitignore delete mode 100644 vendor/github.com/quasilyte/gogrep/.golangci.yml delete mode 100644 vendor/github.com/quasilyte/gogrep/LICENSE delete mode 100644 vendor/github.com/quasilyte/gogrep/Makefile delete mode 100644 vendor/github.com/quasilyte/gogrep/README.md delete mode 100644 vendor/github.com/quasilyte/gogrep/compile.go delete mode 100644 vendor/github.com/quasilyte/gogrep/compile_import.go delete mode 100644 vendor/github.com/quasilyte/gogrep/gen_operations.go delete mode 100644 vendor/github.com/quasilyte/gogrep/gogrep.go delete mode 100644 vendor/github.com/quasilyte/gogrep/instructions.go delete mode 100644 vendor/github.com/quasilyte/gogrep/internal/stdinfo/stdinfo.go delete mode 100644 vendor/github.com/quasilyte/gogrep/match.go delete mode 100644 vendor/github.com/quasilyte/gogrep/nodetag/nodetag.go delete mode 100644 vendor/github.com/quasilyte/gogrep/operation_string.go delete mode 100644 vendor/github.com/quasilyte/gogrep/operations.gen.go delete mode 100644 vendor/github.com/quasilyte/gogrep/parse.go delete mode 100644 vendor/github.com/quasilyte/gogrep/slices.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/LICENSE delete mode 100644 vendor/github.com/quasilyte/regex/syntax/README.md delete mode 100644 vendor/github.com/quasilyte/regex/syntax/ast.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/errors.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/lexer.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/operation.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/operation_string.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/parser.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/pos.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/tokenkind_string.go delete mode 100644 vendor/github.com/quasilyte/regex/syntax/utils.go delete mode 100644 vendor/github.com/quasilyte/stdinfo/LICENSE delete mode 100644 vendor/github.com/quasilyte/stdinfo/stdinfo.go delete mode 100644 vendor/github.com/quasilyte/stdinfo/stdinfo_gen.go delete mode 100644 vendor/github.com/rivo/uniseg/LICENSE.txt delete mode 100644 vendor/github.com/rivo/uniseg/README.md delete mode 100644 vendor/github.com/rivo/uniseg/doc.go delete mode 100644 vendor/github.com/rivo/uniseg/eastasianwidth.go delete mode 100644 vendor/github.com/rivo/uniseg/emojipresentation.go delete mode 100644 vendor/github.com/rivo/uniseg/gen_breaktest.go delete mode 100644 vendor/github.com/rivo/uniseg/gen_properties.go delete mode 100644 vendor/github.com/rivo/uniseg/grapheme.go delete mode 100644 vendor/github.com/rivo/uniseg/graphemeproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/graphemerules.go delete mode 100644 vendor/github.com/rivo/uniseg/line.go delete mode 100644 vendor/github.com/rivo/uniseg/lineproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/linerules.go delete mode 100644 vendor/github.com/rivo/uniseg/properties.go delete mode 100644 vendor/github.com/rivo/uniseg/sentence.go delete mode 100644 vendor/github.com/rivo/uniseg/sentenceproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/sentencerules.go delete mode 100644 vendor/github.com/rivo/uniseg/step.go delete mode 100644 vendor/github.com/rivo/uniseg/width.go delete mode 100644 vendor/github.com/rivo/uniseg/word.go delete mode 100644 vendor/github.com/rivo/uniseg/wordproperties.go delete mode 100644 vendor/github.com/rivo/uniseg/wordrules.go delete mode 100644 vendor/github.com/rogpeppe/go-internal/LICENSE delete mode 100644 vendor/github.com/rogpeppe/go-internal/fmtsort/mapelem.go delete mode 100644 vendor/github.com/rogpeppe/go-internal/fmtsort/sort.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/.gitignore delete mode 100644 vendor/github.com/russross/blackfriday/v2/.travis.yml delete mode 100644 vendor/github.com/russross/blackfriday/v2/LICENSE.txt delete mode 100644 vendor/github.com/russross/blackfriday/v2/README.md delete mode 100644 vendor/github.com/russross/blackfriday/v2/block.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/doc.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/entities.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/esc.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/html.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/inline.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/markdown.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/node.go delete mode 100644 vendor/github.com/russross/blackfriday/v2/smartypants.go delete mode 100644 vendor/github.com/ryancurrah/gomodguard/.dockerignore delete mode 100644 vendor/github.com/ryancurrah/gomodguard/.gitignore delete mode 100644 vendor/github.com/ryancurrah/gomodguard/.golangci.yml delete mode 100644 vendor/github.com/ryancurrah/gomodguard/.goreleaser.yml delete mode 100644 vendor/github.com/ryancurrah/gomodguard/Dockerfile delete mode 100644 vendor/github.com/ryancurrah/gomodguard/Dockerfile.goreleaser delete mode 100644 vendor/github.com/ryancurrah/gomodguard/LICENSE delete mode 100644 vendor/github.com/ryancurrah/gomodguard/Makefile delete mode 100644 vendor/github.com/ryancurrah/gomodguard/README.md delete mode 100644 vendor/github.com/ryancurrah/gomodguard/allowed.go delete mode 100644 vendor/github.com/ryancurrah/gomodguard/blocked.go delete mode 100644 vendor/github.com/ryancurrah/gomodguard/issue.go delete mode 100644 vendor/github.com/ryancurrah/gomodguard/processor.go delete mode 100644 vendor/github.com/ryancurrah/gomodguard/tools.go delete mode 100644 vendor/github.com/ryanrolds/sqlclosecheck/LICENSE delete mode 100644 vendor/github.com/ryanrolds/sqlclosecheck/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/sanposhiho/wastedassign/v2/LICENSE delete mode 100644 vendor/github.com/sanposhiho/wastedassign/v2/README.md delete mode 100644 vendor/github.com/sanposhiho/wastedassign/v2/wastedassign.go delete mode 100644 vendor/github.com/sashamelentyev/interfacebloat/LICENSE delete mode 100644 vendor/github.com/sashamelentyev/interfacebloat/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/sashamelentyev/usestdlibvars/LICENSE delete mode 100644 vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping/mapping.go delete mode 100644 vendor/github.com/securego/gosec/v2/.gitignore delete mode 100644 vendor/github.com/securego/gosec/v2/.golangci.yml delete mode 100644 vendor/github.com/securego/gosec/v2/.goreleaser.yml delete mode 100644 vendor/github.com/securego/gosec/v2/Dockerfile delete mode 100644 vendor/github.com/securego/gosec/v2/LICENSE.txt delete mode 100644 vendor/github.com/securego/gosec/v2/Makefile delete mode 100644 vendor/github.com/securego/gosec/v2/README.md delete mode 100644 vendor/github.com/securego/gosec/v2/USERS.md delete mode 100644 vendor/github.com/securego/gosec/v2/action.yml delete mode 100644 vendor/github.com/securego/gosec/v2/analyzer.go delete mode 100644 vendor/github.com/securego/gosec/v2/analyzers/slice_bounds.go delete mode 100644 vendor/github.com/securego/gosec/v2/analyzers/util.go delete mode 100644 vendor/github.com/securego/gosec/v2/call_list.go delete mode 100644 vendor/github.com/securego/gosec/v2/config.go delete mode 100644 vendor/github.com/securego/gosec/v2/cosign.pub delete mode 100644 vendor/github.com/securego/gosec/v2/cwe/data.go delete mode 100644 vendor/github.com/securego/gosec/v2/cwe/types.go delete mode 100644 vendor/github.com/securego/gosec/v2/entrypoint.sh delete mode 100644 vendor/github.com/securego/gosec/v2/errors.go delete mode 100644 vendor/github.com/securego/gosec/v2/helpers.go delete mode 100644 vendor/github.com/securego/gosec/v2/import_tracker.go delete mode 100644 vendor/github.com/securego/gosec/v2/install.sh delete mode 100644 vendor/github.com/securego/gosec/v2/issue/issue.go delete mode 100644 vendor/github.com/securego/gosec/v2/renovate.json delete mode 100644 vendor/github.com/securego/gosec/v2/report.go delete mode 100644 vendor/github.com/securego/gosec/v2/resolve.go delete mode 100644 vendor/github.com/securego/gosec/v2/rule.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/archive.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/bind.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/blocklist.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/decompression-bomb.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/directory-traversal.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/errors.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/fileperms.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/hardcoded_credentials.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/http_serve.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/implicit_aliasing.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/integer_overflow.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/math_big_rat.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/pprof.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/rand.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/readfile.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/rsa.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/rulelist.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/slowloris.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/sql.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/ssh.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/ssrf.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/subproc.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/tempfiles.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/templates.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/tls.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/tls_config.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/unsafe.go delete mode 100644 vendor/github.com/securego/gosec/v2/rules/weakcrypto.go delete mode 100644 vendor/github.com/sergi/go-diff/AUTHORS delete mode 100644 vendor/github.com/sergi/go-diff/CONTRIBUTORS delete mode 100644 vendor/github.com/sergi/go-diff/LICENSE delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/match.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/mathutil.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/operation_string.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go delete mode 100644 vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go delete mode 100644 vendor/github.com/shazow/go-diff/LICENSE delete mode 100644 vendor/github.com/shazow/go-diff/difflib/differ.go delete mode 100644 vendor/github.com/shopspring/decimal/.gitignore delete mode 100644 vendor/github.com/shopspring/decimal/.travis.yml delete mode 100644 vendor/github.com/shopspring/decimal/CHANGELOG.md delete mode 100644 vendor/github.com/shopspring/decimal/LICENSE delete mode 100644 vendor/github.com/shopspring/decimal/README.md delete mode 100644 vendor/github.com/shopspring/decimal/decimal-go.go delete mode 100644 vendor/github.com/shopspring/decimal/decimal.go delete mode 100644 vendor/github.com/shopspring/decimal/rounding.go delete mode 100644 vendor/github.com/sivchari/containedctx/.golangci.yml delete mode 100644 vendor/github.com/sivchari/containedctx/LICENCE delete mode 100644 vendor/github.com/sivchari/containedctx/README.md delete mode 100644 vendor/github.com/sivchari/containedctx/containedctx.go delete mode 100644 vendor/github.com/sivchari/nosnakecase/.gitignore delete mode 100644 vendor/github.com/sivchari/nosnakecase/.golangci.yml delete mode 100644 vendor/github.com/sivchari/nosnakecase/LICENSE delete mode 100644 vendor/github.com/sivchari/nosnakecase/README.md delete mode 100644 vendor/github.com/sivchari/nosnakecase/nosnakecase.go delete mode 100644 vendor/github.com/sivchari/tenv/.gitignore delete mode 100644 vendor/github.com/sivchari/tenv/.golangci.yml delete mode 100644 vendor/github.com/sivchari/tenv/LICENSE delete mode 100644 vendor/github.com/sivchari/tenv/README.md delete mode 100644 vendor/github.com/sivchari/tenv/tenv.go delete mode 100644 vendor/github.com/sivchari/tenv/tenv.png delete mode 100644 vendor/github.com/skeema/knownhosts/LICENSE delete mode 100644 vendor/github.com/skeema/knownhosts/NOTICE delete mode 100644 vendor/github.com/skeema/knownhosts/README.md delete mode 100644 vendor/github.com/skeema/knownhosts/knownhosts.go delete mode 100644 vendor/github.com/sonatard/noctx/.gitignore delete mode 100644 vendor/github.com/sonatard/noctx/.golangci.yml delete mode 100644 vendor/github.com/sonatard/noctx/LICENSE delete mode 100644 vendor/github.com/sonatard/noctx/Makefile delete mode 100644 vendor/github.com/sonatard/noctx/README.md delete mode 100644 vendor/github.com/sonatard/noctx/ngfunc/main.go delete mode 100644 vendor/github.com/sonatard/noctx/ngfunc/report.go delete mode 100644 vendor/github.com/sonatard/noctx/ngfunc/types.go delete mode 100644 vendor/github.com/sonatard/noctx/noctx.go delete mode 100644 vendor/github.com/sonatard/noctx/reqwithoutctx/main.go delete mode 100644 vendor/github.com/sonatard/noctx/reqwithoutctx/report.go delete mode 100644 vendor/github.com/sonatard/noctx/reqwithoutctx/ssa.go delete mode 100644 vendor/github.com/sourcegraph/go-diff/LICENSE delete mode 100644 vendor/github.com/sourcegraph/go-diff/diff/diff.go delete mode 100644 vendor/github.com/sourcegraph/go-diff/diff/doc.go delete mode 100644 vendor/github.com/sourcegraph/go-diff/diff/parse.go delete mode 100644 vendor/github.com/sourcegraph/go-diff/diff/print.go delete mode 100644 vendor/github.com/sourcegraph/go-diff/diff/reader_util.go delete mode 100644 vendor/github.com/spf13/cobra/doc/man_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/md_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/rest_docs.go delete mode 100644 vendor/github.com/spf13/cobra/doc/util.go delete mode 100644 vendor/github.com/spf13/cobra/doc/yaml_docs.go delete mode 100644 vendor/github.com/ssgreg/nlreturn/v2/LICENSE delete mode 100644 vendor/github.com/ssgreg/nlreturn/v2/pkg/nlreturn/nlreturn.go delete mode 100644 vendor/github.com/stbenjam/no-sprintf-host-port/LICENSE delete mode 100644 vendor/github.com/stbenjam/no-sprintf-host-port/pkg/analyzer/analyzer.go delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/.travis.yml delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/LICENSE delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/README.md delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/cobertura.go delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/gocover-cobertura.go delete mode 100644 vendor/github.com/t-yuki/gocover-cobertura/profile.go delete mode 100644 vendor/github.com/tdakkota/asciicheck/.gitignore delete mode 100644 vendor/github.com/tdakkota/asciicheck/LICENSE delete mode 100644 vendor/github.com/tdakkota/asciicheck/README.md delete mode 100644 vendor/github.com/tdakkota/asciicheck/ascii.go delete mode 100644 vendor/github.com/tdakkota/asciicheck/asciicheck.go delete mode 100644 vendor/github.com/tetafro/godot/.gitignore delete mode 100644 vendor/github.com/tetafro/godot/.godot.yaml delete mode 100644 vendor/github.com/tetafro/godot/.golangci.yml delete mode 100644 vendor/github.com/tetafro/godot/.goreleaser.yml delete mode 100644 vendor/github.com/tetafro/godot/LICENSE delete mode 100644 vendor/github.com/tetafro/godot/Makefile delete mode 100644 vendor/github.com/tetafro/godot/README.md delete mode 100644 vendor/github.com/tetafro/godot/checks.go delete mode 100644 vendor/github.com/tetafro/godot/getters.go delete mode 100644 vendor/github.com/tetafro/godot/godot.go delete mode 100644 vendor/github.com/tetafro/godot/settings.go delete mode 100644 vendor/github.com/tetratelabs/wazero/.editorconfig delete mode 100644 vendor/github.com/tetratelabs/wazero/.gitattributes delete mode 100644 vendor/github.com/tetratelabs/wazero/.gitignore delete mode 100644 vendor/github.com/tetratelabs/wazero/.gitmodules delete mode 100644 vendor/github.com/tetratelabs/wazero/CONTRIBUTING.md delete mode 100644 vendor/github.com/tetratelabs/wazero/LICENSE delete mode 100644 vendor/github.com/tetratelabs/wazero/Makefile delete mode 100644 vendor/github.com/tetratelabs/wazero/NOTICE delete mode 100644 vendor/github.com/tetratelabs/wazero/RATIONALE.md delete mode 100644 vendor/github.com/tetratelabs/wazero/README.md delete mode 100644 vendor/github.com/tetratelabs/wazero/api/features.go delete mode 100644 vendor/github.com/tetratelabs/wazero/api/wasm.go delete mode 100644 vendor/github.com/tetratelabs/wazero/builder.go delete mode 100644 vendor/github.com/tetratelabs/wazero/cache.go delete mode 100644 vendor/github.com/tetratelabs/wazero/codecov.yml delete mode 100644 vendor/github.com/tetratelabs/wazero/config.go delete mode 100644 vendor/github.com/tetratelabs/wazero/config_supported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/config_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/examples/basic/testdata/add.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/experimental/experimental.go delete mode 100644 vendor/github.com/tetratelabs/wazero/experimental/gojs/README.md delete mode 100644 vendor/github.com/tetratelabs/wazero/experimental/gojs/gojs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/experimental/listener.go delete mode 100644 vendor/github.com/tetratelabs/wazero/experimental/logging/testdata/listener.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/fsconfig.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/Cargo.toml delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.rs delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wat delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wat delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/gotip/wasi.go delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wat delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wat delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.c delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/build.zig delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.zig delete mode 100644 vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/amd64/assembler.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/amd64/consts.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl_staticconst.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/arm64/assembler.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/arm64/consts.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/arm64/impl.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/assembler.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/buffer.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/asm/impl.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/bitpack/offset_array.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/descriptor/table.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/RATIONALE.md delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_amd64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_amd64.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_arm64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_arm64.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_drop.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_value_location.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine_cache.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_amd64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_arm64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_amd64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_arm64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/constants.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_js.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_sun.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/dir.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/file.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/stat.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/fsapi/unimplemented.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/argsenv.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/builtin.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/config/config.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/crypto.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/custom/crypto.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/custom/date.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/custom/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/custom/names.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/custom/process.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/errno.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/goarch/wasm.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/goos/goos.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/http.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/js.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/process.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/run/gojs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/runtime.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/state.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/syscall.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/time.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/util/util.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/gojs/values/values.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/integration_test/engine/testdata/infinite_loop.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/fac.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/mem_grow.wasm delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/internalapi/internal.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/leb128/leb128.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/errno.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/errno_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/error.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/fdset.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/fdset_darwin.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/fdset_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/fdset_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mremap_other.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/mremap_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/path.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/platform.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/platform_amd64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/platform_arm64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/time.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/time_notcgo.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sock/sock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/lazy.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/stdio.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/sys.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/testdata/empty.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/sub/test.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/test.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sys/testdata/test.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/chown.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/file.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/file_test.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_js.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_sun.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/rename.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/rootfs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.s delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/select_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_bsd.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_linux.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/empty.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/wazero.txt delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/u32/u32.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/u64/u64.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/version/version.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/args.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/random.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/counts.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/engine.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/global.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/host.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/module.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/store.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasm/table.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wazeroir/compiler.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wazeroir/format.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wazeroir/operations.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wazeroir/signature.go delete mode 100644 vendor/github.com/tetratelabs/wazero/internal/wazeroir/wazeroir.go delete mode 100644 vendor/github.com/tetratelabs/wazero/netlify.toml delete mode 100644 vendor/github.com/tetratelabs/wazero/runtime.go delete mode 100644 vendor/github.com/tetratelabs/wazero/sys/clock.go delete mode 100644 vendor/github.com/tetratelabs/wazero/sys/error.go delete mode 100644 vendor/github.com/tetratelabs/wazero/testdata/index.html delete mode 100644 vendor/github.com/timakin/bodyclose/LICENSE delete mode 100644 vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go delete mode 100644 vendor/github.com/timonwong/loggercheck/.codecov.yml delete mode 100644 vendor/github.com/timonwong/loggercheck/.gitignore delete mode 100644 vendor/github.com/timonwong/loggercheck/.golangci.yml delete mode 100644 vendor/github.com/timonwong/loggercheck/.goreleaser.yml delete mode 100644 vendor/github.com/timonwong/loggercheck/LICENSE delete mode 100644 vendor/github.com/timonwong/loggercheck/Makefile delete mode 100644 vendor/github.com/timonwong/loggercheck/README.md delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/bytebufferpool/pool.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/checkers/checker.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/checkers/common.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/checkers/general.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/checkers/printf/printf.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/checkers/zap.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/rules/rules.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/sets/string.go delete mode 100644 vendor/github.com/timonwong/loggercheck/internal/stringutil/is.go delete mode 100644 vendor/github.com/timonwong/loggercheck/loggercheck.go delete mode 100644 vendor/github.com/timonwong/loggercheck/options.go delete mode 100644 vendor/github.com/timonwong/loggercheck/staticrules.go delete mode 100644 vendor/github.com/tomarrell/wrapcheck/v2/LICENSE delete mode 100644 vendor/github.com/tomarrell/wrapcheck/v2/wrapcheck/wrapcheck.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/.editorconfig delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/.gitattributes delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/.gitignore delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/.goreleaser.yml delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/Dockerfile delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/LICENSE delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/Makefile delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/README.md delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/action.yml delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/analyzer.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/argument.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/assign.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/case.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/checks.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/condition.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/operation.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/checks/return.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/config/config.go delete mode 100644 vendor/github.com/tommy-muehle/go-mnd/v2/entrypoint.sh delete mode 100644 vendor/github.com/toqueteos/webbrowser/.travis.yml delete mode 100644 vendor/github.com/toqueteos/webbrowser/CONTRIBUTING.md delete mode 100644 vendor/github.com/toqueteos/webbrowser/LICENSE.md delete mode 100644 vendor/github.com/toqueteos/webbrowser/README.md delete mode 100644 vendor/github.com/toqueteos/webbrowser/webbrowser.go delete mode 100644 vendor/github.com/ulikunitz/xz/.gitignore delete mode 100644 vendor/github.com/ulikunitz/xz/LICENSE delete mode 100644 vendor/github.com/ulikunitz/xz/README.md delete mode 100644 vendor/github.com/ulikunitz/xz/SECURITY.md delete mode 100644 vendor/github.com/ulikunitz/xz/TODO.md delete mode 100644 vendor/github.com/ulikunitz/xz/bits.go delete mode 100644 vendor/github.com/ulikunitz/xz/crc.go delete mode 100644 vendor/github.com/ulikunitz/xz/format.go delete mode 100644 vendor/github.com/ulikunitz/xz/fox-check-none.xz delete mode 100644 vendor/github.com/ulikunitz/xz/fox.xz delete mode 100644 vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go delete mode 100644 vendor/github.com/ulikunitz/xz/internal/hash/doc.go delete mode 100644 vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go delete mode 100644 vendor/github.com/ulikunitz/xz/internal/hash/roller.go delete mode 100644 vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/bintree.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/bitops.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/breader.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/buffer.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/bytewriter.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/decoder.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/decoderdict.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/directcodec.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/distcodec.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/encoder.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/encoderdict.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/fox.lzma delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/hashtable.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/header.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/header2.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/literalcodec.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/operation.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/prob.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/properties.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/rangecodec.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/reader.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/reader2.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/state.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/treecodecs.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/writer.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzma/writer2.go delete mode 100644 vendor/github.com/ulikunitz/xz/lzmafilter.go delete mode 100644 vendor/github.com/ulikunitz/xz/make-docs delete mode 100644 vendor/github.com/ulikunitz/xz/none-check.go delete mode 100644 vendor/github.com/ulikunitz/xz/reader.go delete mode 100644 vendor/github.com/ulikunitz/xz/writer.go delete mode 100644 vendor/github.com/ultraware/funlen/LICENSE delete mode 100644 vendor/github.com/ultraware/funlen/README.md delete mode 100644 vendor/github.com/ultraware/funlen/main.go delete mode 100644 vendor/github.com/ultraware/whitespace/LICENSE delete mode 100644 vendor/github.com/ultraware/whitespace/README.md delete mode 100644 vendor/github.com/ultraware/whitespace/whitespace.go delete mode 100644 vendor/github.com/uudashr/gocognit/LICENSE delete mode 100644 vendor/github.com/uudashr/gocognit/README.md delete mode 100644 vendor/github.com/uudashr/gocognit/doc.go delete mode 100644 vendor/github.com/uudashr/gocognit/gocognit.go delete mode 100644 vendor/github.com/uudashr/gocognit/recv.go delete mode 100644 vendor/github.com/uudashr/gocognit/recv_pre118.go delete mode 100644 vendor/github.com/vbatts/tar-split/LICENSE delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/common.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/format.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/reader.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/stat_actime1.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/stat_actime2.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/strconv.go delete mode 100644 vendor/github.com/vbatts/tar-split/archive/tar/writer.go delete mode 100644 vendor/github.com/xanzy/ssh-agent/.gitignore delete mode 100644 vendor/github.com/xanzy/ssh-agent/LICENSE delete mode 100644 vendor/github.com/xanzy/ssh-agent/README.md delete mode 100644 vendor/github.com/xanzy/ssh-agent/pageant_windows.go delete mode 100644 vendor/github.com/xanzy/ssh-agent/sshagent.go delete mode 100644 vendor/github.com/xanzy/ssh-agent/sshagent_windows.go delete mode 100644 vendor/github.com/xen0n/gosmopolitan/.editorconfig delete mode 100644 vendor/github.com/xen0n/gosmopolitan/.gitignore delete mode 100644 vendor/github.com/xen0n/gosmopolitan/.golangci.yml delete mode 100644 vendor/github.com/xen0n/gosmopolitan/LICENSE delete mode 100644 vendor/github.com/xen0n/gosmopolitan/README.md delete mode 100644 vendor/github.com/xen0n/gosmopolitan/README.zh-Hans.md delete mode 100644 vendor/github.com/xen0n/gosmopolitan/lib.go delete mode 100644 vendor/github.com/yagipy/maintidx/.gitignore delete mode 100644 vendor/github.com/yagipy/maintidx/LICENSE delete mode 100644 vendor/github.com/yagipy/maintidx/Makefile delete mode 100644 vendor/github.com/yagipy/maintidx/README.md delete mode 100644 vendor/github.com/yagipy/maintidx/maintidx.go delete mode 100644 vendor/github.com/yagipy/maintidx/pkg/cyc/cyc.go delete mode 100644 vendor/github.com/yagipy/maintidx/pkg/halstvol/halstvol.go delete mode 100644 vendor/github.com/yagipy/maintidx/pkg/halstvol/handle.go delete mode 100644 vendor/github.com/yagipy/maintidx/visitor.go delete mode 100644 vendor/github.com/yeya24/promlinter/.gitignore delete mode 100644 vendor/github.com/yeya24/promlinter/LICENSE delete mode 100644 vendor/github.com/yeya24/promlinter/Makefile delete mode 100644 vendor/github.com/yeya24/promlinter/README.md delete mode 100644 vendor/github.com/yeya24/promlinter/promlinter.go delete mode 100644 vendor/github.com/ykadowak/zerologlint/.goreleaser.yaml delete mode 100644 vendor/github.com/ykadowak/zerologlint/LICENSE delete mode 100644 vendor/github.com/ykadowak/zerologlint/README.md delete mode 100644 vendor/github.com/ykadowak/zerologlint/zerologlint.go delete mode 100644 vendor/gitlab.com/bosi/decorder/.gitignore delete mode 100644 vendor/gitlab.com/bosi/decorder/.gitlab-ci.params.yml delete mode 100644 vendor/gitlab.com/bosi/decorder/.gitlab-ci.yml delete mode 100644 vendor/gitlab.com/bosi/decorder/LICENSE.md delete mode 100644 vendor/gitlab.com/bosi/decorder/Makefile delete mode 100644 vendor/gitlab.com/bosi/decorder/README.md delete mode 100644 vendor/gitlab.com/bosi/decorder/analyzer.go delete mode 100644 vendor/gitlab.com/bosi/decorder/renovate.json delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/.gitignore delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/LICENSE delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/Makefile delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/README.md delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/conventional_commits.go delete mode 100644 vendor/gitlab.com/digitalxero/go-conventional-commit/types.go delete mode 100644 vendor/go-simpler.org/sloglint/.golangci.yml delete mode 100644 vendor/go-simpler.org/sloglint/.goreleaser.yml delete mode 100644 vendor/go-simpler.org/sloglint/LICENSE delete mode 100644 vendor/go-simpler.org/sloglint/README.md delete mode 100644 vendor/go-simpler.org/sloglint/sloglint.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/LICENSE delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bson.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/array_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/bsoncodec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/byte_slice_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/cond_addr_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_decoders.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/default_value_encoders.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/empty_interface_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/map_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/mode.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/pointer_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/proxy.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/registry.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/slice_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/string_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/struct_tag_parser.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/time_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/types.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsoncodec/uint_codec.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/byte_slice_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/empty_interface_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/map_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/slice_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/struct_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/time_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/uint_codec_options.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/copier.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_parser.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_tables.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_wrappers.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/extjson_writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/json_scanner.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/mode.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_reader.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/value_writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsonrw/writer.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/bsontype/bsontype.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/decoder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/doc.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/encoder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/marshal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/decimal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/objectid.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive/primitive.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/primitive_codecs.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw_element.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/raw_value.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/registry.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/types.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/bson/unmarshal.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_arraybuilder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bson_documentbuilder.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/bsoncore.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/document_sequence.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/element.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/tables.go delete mode 100644 vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/value.go delete mode 100644 vendor/go.opentelemetry.io/otel/.codespellignore delete mode 100644 vendor/go.opentelemetry.io/otel/.codespellrc delete mode 100644 vendor/go.opentelemetry.io/otel/.gitattributes delete mode 100644 vendor/go.opentelemetry.io/otel/.gitignore delete mode 100644 vendor/go.opentelemetry.io/otel/.gitmodules delete mode 100644 vendor/go.opentelemetry.io/otel/.golangci.yml delete mode 100644 vendor/go.opentelemetry.io/otel/.lycheeignore delete mode 100644 vendor/go.opentelemetry.io/otel/.markdownlint.yaml delete mode 100644 vendor/go.opentelemetry.io/otel/CHANGELOG.md delete mode 100644 vendor/go.opentelemetry.io/otel/CODEOWNERS delete mode 100644 vendor/go.opentelemetry.io/otel/CONTRIBUTING.md delete mode 100644 vendor/go.opentelemetry.io/otel/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/Makefile delete mode 100644 vendor/go.opentelemetry.io/otel/README.md delete mode 100644 vendor/go.opentelemetry.io/otel/RELEASING.md delete mode 100644 vendor/go.opentelemetry.io/otel/VERSIONING.md delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/encoder.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/filter.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/iterator.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/key.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/kv.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/set.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/type_string.go delete mode 100644 vendor/go.opentelemetry.io/otel/attribute/value.go delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/context.go delete mode 100644 vendor/go.opentelemetry.io/otel/baggage/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/codes/codes.go delete mode 100644 vendor/go.opentelemetry.io/otel/codes/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/error_handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/get_main_pkgs.sh delete mode 100644 vendor/go.opentelemetry.io/otel/handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/attribute/attribute.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/baggage/context.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/gen.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/handler.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/instruments.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/internal_logging.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/meter.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/propagator.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/state.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/global/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal/rawhelpers.go delete mode 100644 vendor/go.opentelemetry.io/otel/internal_logging.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncfloat64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/asyncint64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/config.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/embedded/embedded.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/instrument.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/meter.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/noop/noop.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/syncfloat64.go delete mode 100644 vendor/go.opentelemetry.io/otel/metric/syncint64.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/baggage.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/propagation.go delete mode 100644 vendor/go.opentelemetry.io/otel/propagation/trace_context.go delete mode 100644 vendor/go.opentelemetry.io/otel/requirements.txt delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/library.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/instrumentation/scope.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/env/env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/gen.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/internal/internal.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/auto.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/config.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/container.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_bsd.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_darwin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_exec.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_linux.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_readfile.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_unsupported.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/host_id_windows.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_darwin.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_release_unix.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unix.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_unsupported.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/os_windows.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/process.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/resource/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/batch_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/event.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/evictedqueue.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/id_generator.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/link.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/provider.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/sampler_env.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/sampling.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/simple_span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/snapshot.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_exporter.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_limits.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/span_processor.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/tracer.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/trace/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/sdk/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/internal/http.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/exception.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/http.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/resource.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/schema.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.12.0/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/semconv/v1.21.0/attribute_group.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/LICENSE delete mode 100644 vendor/go.opentelemetry.io/otel/trace/config.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/context.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/doc.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/embedded/embedded.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/nonrecording.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/noop.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/noop/noop.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/trace.go delete mode 100644 vendor/go.opentelemetry.io/otel/trace/tracestate.go delete mode 100644 vendor/go.opentelemetry.io/otel/verify_examples.sh delete mode 100644 vendor/go.opentelemetry.io/otel/version.go delete mode 100644 vendor/go.opentelemetry.io/otel/versions.yaml delete mode 100644 vendor/go.tmz.dev/musttag/.golangci.yml delete mode 100644 vendor/go.tmz.dev/musttag/.goreleaser.yml delete mode 100644 vendor/go.tmz.dev/musttag/LICENSE delete mode 100644 vendor/go.tmz.dev/musttag/README.md delete mode 100644 vendor/go.tmz.dev/musttag/builtins.go delete mode 100644 vendor/go.tmz.dev/musttag/musttag.go delete mode 100644 vendor/go.tmz.dev/musttag/utils.go delete mode 100644 vendor/go.uber.org/mock/CONTRIBUTORS delete mode 100644 vendor/go.uber.org/mock/mockgen/generic_go118.go delete mode 100644 vendor/go.uber.org/mock/mockgen/generic_notgo118.go delete mode 100644 vendor/go.uber.org/mock/mockgen/mockgen.go delete mode 100644 vendor/go.uber.org/mock/mockgen/model/model.go delete mode 100644 vendor/go.uber.org/mock/mockgen/parse.go delete mode 100644 vendor/go.uber.org/mock/mockgen/reflect.go delete mode 100644 vendor/go.uber.org/mock/mockgen/version.go delete mode 100644 vendor/go.uber.org/zap/.codecov.yml delete mode 100644 vendor/go.uber.org/zap/.gitignore delete mode 100644 vendor/go.uber.org/zap/.golangci.yml delete mode 100644 vendor/go.uber.org/zap/.readme.tmpl delete mode 100644 vendor/go.uber.org/zap/CHANGELOG.md delete mode 100644 vendor/go.uber.org/zap/CODE_OF_CONDUCT.md delete mode 100644 vendor/go.uber.org/zap/CONTRIBUTING.md delete mode 100644 vendor/go.uber.org/zap/FAQ.md delete mode 100644 vendor/go.uber.org/zap/LICENSE.txt delete mode 100644 vendor/go.uber.org/zap/Makefile delete mode 100644 vendor/go.uber.org/zap/README.md delete mode 100644 vendor/go.uber.org/zap/array.go delete mode 100644 vendor/go.uber.org/zap/buffer/buffer.go delete mode 100644 vendor/go.uber.org/zap/buffer/pool.go delete mode 100644 vendor/go.uber.org/zap/checklicense.sh delete mode 100644 vendor/go.uber.org/zap/config.go delete mode 100644 vendor/go.uber.org/zap/doc.go delete mode 100644 vendor/go.uber.org/zap/encoder.go delete mode 100644 vendor/go.uber.org/zap/error.go delete mode 100644 vendor/go.uber.org/zap/field.go delete mode 100644 vendor/go.uber.org/zap/flag.go delete mode 100644 vendor/go.uber.org/zap/glide.yaml delete mode 100644 vendor/go.uber.org/zap/global.go delete mode 100644 vendor/go.uber.org/zap/http_handler.go delete mode 100644 vendor/go.uber.org/zap/internal/bufferpool/bufferpool.go delete mode 100644 vendor/go.uber.org/zap/internal/color/color.go delete mode 100644 vendor/go.uber.org/zap/internal/exit/exit.go delete mode 100644 vendor/go.uber.org/zap/internal/level_enabler.go delete mode 100644 vendor/go.uber.org/zap/internal/pool/pool.go delete mode 100644 vendor/go.uber.org/zap/internal/stacktrace/stack.go delete mode 100644 vendor/go.uber.org/zap/level.go delete mode 100644 vendor/go.uber.org/zap/logger.go delete mode 100644 vendor/go.uber.org/zap/options.go delete mode 100644 vendor/go.uber.org/zap/sink.go delete mode 100644 vendor/go.uber.org/zap/sugar.go delete mode 100644 vendor/go.uber.org/zap/time.go delete mode 100644 vendor/go.uber.org/zap/writer.go delete mode 100644 vendor/go.uber.org/zap/zapcore/buffered_write_syncer.go delete mode 100644 vendor/go.uber.org/zap/zapcore/clock.go delete mode 100644 vendor/go.uber.org/zap/zapcore/console_encoder.go delete mode 100644 vendor/go.uber.org/zap/zapcore/core.go delete mode 100644 vendor/go.uber.org/zap/zapcore/doc.go delete mode 100644 vendor/go.uber.org/zap/zapcore/encoder.go delete mode 100644 vendor/go.uber.org/zap/zapcore/entry.go delete mode 100644 vendor/go.uber.org/zap/zapcore/error.go delete mode 100644 vendor/go.uber.org/zap/zapcore/field.go delete mode 100644 vendor/go.uber.org/zap/zapcore/hook.go delete mode 100644 vendor/go.uber.org/zap/zapcore/increase_level.go delete mode 100644 vendor/go.uber.org/zap/zapcore/json_encoder.go delete mode 100644 vendor/go.uber.org/zap/zapcore/lazy_with.go delete mode 100644 vendor/go.uber.org/zap/zapcore/level.go delete mode 100644 vendor/go.uber.org/zap/zapcore/level_strings.go delete mode 100644 vendor/go.uber.org/zap/zapcore/marshaler.go delete mode 100644 vendor/go.uber.org/zap/zapcore/memory_encoder.go delete mode 100644 vendor/go.uber.org/zap/zapcore/reflected_encoder.go delete mode 100644 vendor/go.uber.org/zap/zapcore/sampler.go delete mode 100644 vendor/go.uber.org/zap/zapcore/tee.go delete mode 100644 vendor/go.uber.org/zap/zapcore/write_syncer.go delete mode 100644 vendor/golang.org/x/crypto/LICENSE delete mode 100644 vendor/golang.org/x/crypto/PATENTS delete mode 100644 vendor/golang.org/x/crypto/argon2/argon2.go delete mode 100644 vendor/golang.org/x/crypto/argon2/blake2b.go delete mode 100644 vendor/golang.org/x/crypto/argon2/blamka_amd64.go delete mode 100644 vendor/golang.org/x/crypto/argon2/blamka_amd64.s delete mode 100644 vendor/golang.org/x/crypto/argon2/blamka_generic.go delete mode 100644 vendor/golang.org/x/crypto/argon2/blamka_ref.go delete mode 100644 vendor/golang.org/x/crypto/bcrypt/base64.go delete mode 100644 vendor/golang.org/x/crypto/bcrypt/bcrypt.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2b.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2b_generic.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2b_ref.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2x.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/register.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/block.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/cipher.go delete mode 100644 vendor/golang.org/x/crypto/blowfish/const.go delete mode 100644 vendor/golang.org/x/crypto/cast5/cast5.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_arm64.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_generic.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_noasm.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_ppc64le.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.go delete mode 100644 vendor/golang.org/x/crypto/chacha20/chacha_s390x.s delete mode 100644 vendor/golang.org/x/crypto/chacha20/xor.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_compat.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/curve25519_go120.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/README delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_amd64_noasm.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64.s delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_arm64_noasm.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/fe_generic.go delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.checkpoint delete mode 100644 vendor/golang.org/x/crypto/curve25519/internal/field/sync.sh delete mode 100644 vendor/golang.org/x/crypto/hkdf/hkdf.go delete mode 100644 vendor/golang.org/x/crypto/internal/alias/alias.go delete mode 100644 vendor/golang.org/x/crypto/internal/alias/alias_purego.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/poly1305.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.s delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_generic.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64le.s delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.go delete mode 100644 vendor/golang.org/x/crypto/internal/poly1305/sum_s390x.s delete mode 100644 vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go delete mode 100644 vendor/golang.org/x/crypto/scrypt/scrypt.go delete mode 100644 vendor/golang.org/x/crypto/sha3/doc.go delete mode 100644 vendor/golang.org/x/crypto/sha3/hashes.go delete mode 100644 vendor/golang.org/x/crypto/sha3/hashes_generic.go delete mode 100644 vendor/golang.org/x/crypto/sha3/keccakf.go delete mode 100644 vendor/golang.org/x/crypto/sha3/keccakf_amd64.s delete mode 100644 vendor/golang.org/x/crypto/sha3/register.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3_s390x.go delete mode 100644 vendor/golang.org/x/crypto/sha3/sha3_s390x.s delete mode 100644 vendor/golang.org/x/crypto/sha3/shake.go delete mode 100644 vendor/golang.org/x/crypto/sha3/shake_generic.go delete mode 100644 vendor/golang.org/x/crypto/sha3/xor.go delete mode 100644 vendor/golang.org/x/crypto/sha3/xor_generic.go delete mode 100644 vendor/golang.org/x/crypto/sha3/xor_unaligned.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/client.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/forward.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/keyring.go delete mode 100644 vendor/golang.org/x/crypto/ssh/agent/server.go delete mode 100644 vendor/golang.org/x/crypto/ssh/buffer.go delete mode 100644 vendor/golang.org/x/crypto/ssh/certs.go delete mode 100644 vendor/golang.org/x/crypto/ssh/channel.go delete mode 100644 vendor/golang.org/x/crypto/ssh/cipher.go delete mode 100644 vendor/golang.org/x/crypto/ssh/client.go delete mode 100644 vendor/golang.org/x/crypto/ssh/client_auth.go delete mode 100644 vendor/golang.org/x/crypto/ssh/common.go delete mode 100644 vendor/golang.org/x/crypto/ssh/connection.go delete mode 100644 vendor/golang.org/x/crypto/ssh/doc.go delete mode 100644 vendor/golang.org/x/crypto/ssh/handshake.go delete mode 100644 vendor/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf/bcrypt_pbkdf.go delete mode 100644 vendor/golang.org/x/crypto/ssh/kex.go delete mode 100644 vendor/golang.org/x/crypto/ssh/keys.go delete mode 100644 vendor/golang.org/x/crypto/ssh/knownhosts/knownhosts.go delete mode 100644 vendor/golang.org/x/crypto/ssh/mac.go delete mode 100644 vendor/golang.org/x/crypto/ssh/messages.go delete mode 100644 vendor/golang.org/x/crypto/ssh/mux.go delete mode 100644 vendor/golang.org/x/crypto/ssh/server.go delete mode 100644 vendor/golang.org/x/crypto/ssh/session.go delete mode 100644 vendor/golang.org/x/crypto/ssh/ssh_gss.go delete mode 100644 vendor/golang.org/x/crypto/ssh/streamlocal.go delete mode 100644 vendor/golang.org/x/crypto/ssh/tcpip.go delete mode 100644 vendor/golang.org/x/crypto/ssh/transport.go delete mode 100644 vendor/golang.org/x/exp/typeparams/LICENSE delete mode 100644 vendor/golang.org/x/exp/typeparams/common.go delete mode 100644 vendor/golang.org/x/exp/typeparams/normalize.go delete mode 100644 vendor/golang.org/x/exp/typeparams/termlist.go delete mode 100644 vendor/golang.org/x/exp/typeparams/typeparams_go117.go delete mode 100644 vendor/golang.org/x/exp/typeparams/typeparams_go118.go delete mode 100644 vendor/golang.org/x/exp/typeparams/typeterm.go delete mode 100644 vendor/golang.org/x/mod/modfile/print.go delete mode 100644 vendor/golang.org/x/mod/modfile/read.go delete mode 100644 vendor/golang.org/x/mod/modfile/rule.go delete mode 100644 vendor/golang.org/x/mod/modfile/work.go delete mode 100644 vendor/golang.org/x/net/context/context.go delete mode 100644 vendor/golang.org/x/net/context/go17.go delete mode 100644 vendor/golang.org/x/net/context/go19.go delete mode 100644 vendor/golang.org/x/net/context/pre_go17.go delete mode 100644 vendor/golang.org/x/net/context/pre_go19.go delete mode 100644 vendor/golang.org/x/net/http2/h2c/h2c.go delete mode 100644 vendor/golang.org/x/net/internal/socks/client.go delete mode 100644 vendor/golang.org/x/net/internal/socks/socks.go delete mode 100644 vendor/golang.org/x/net/proxy/dial.go delete mode 100644 vendor/golang.org/x/net/proxy/direct.go delete mode 100644 vendor/golang.org/x/net/proxy/per_host.go delete mode 100644 vendor/golang.org/x/net/proxy/proxy.go delete mode 100644 vendor/golang.org/x/net/proxy/socks5.go delete mode 100644 vendor/golang.org/x/sync/semaphore/semaphore.go delete mode 100644 vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s delete mode 100644 vendor/golang.org/x/sys/cpu/byteorder.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_aix.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gc_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_loong64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_mipsx.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_netbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_arm64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_ppc64x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_riscv64.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_s390x.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_wasm.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_x86.s delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos.go delete mode 100644 vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_big.go delete mode 100644 vendor/golang.org/x/sys/cpu/endian_little.go delete mode 100644 vendor/golang.org/x/sys/cpu/hwcap_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/parse.go delete mode 100644 vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv.go delete mode 100644 vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go delete mode 100644 vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs_go118.go delete mode 100644 vendor/golang.org/x/sys/execabs/execabs_go119.go delete mode 100644 vendor/golang.org/x/sys/plan9/asm.s delete mode 100644 vendor/golang.org/x/sys/plan9/asm_plan9_386.s delete mode 100644 vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s delete mode 100644 vendor/golang.org/x/sys/plan9/asm_plan9_arm.s delete mode 100644 vendor/golang.org/x/sys/plan9/const_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/dir_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/env_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/errors_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/mkall.sh delete mode 100644 vendor/golang.org/x/sys/plan9/mkerrors.sh delete mode 100644 vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh delete mode 100644 vendor/golang.org/x/sys/plan9/pwd_go15_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/pwd_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/race.go delete mode 100644 vendor/golang.org/x/sys/plan9/race0.go delete mode 100644 vendor/golang.org/x/sys/plan9/str.go delete mode 100644 vendor/golang.org/x/sys/plan9/syscall.go delete mode 100644 vendor/golang.org/x/sys/plan9/syscall_plan9.go delete mode 100644 vendor/golang.org/x/sys/plan9/zsyscall_plan9_386.go delete mode 100644 vendor/golang.org/x/sys/plan9/zsyscall_plan9_amd64.go delete mode 100644 vendor/golang.org/x/sys/plan9/zsyscall_plan9_arm.go delete mode 100644 vendor/golang.org/x/sys/plan9/zsysnum_plan9.go delete mode 100644 vendor/golang.org/x/term/CONTRIBUTING.md delete mode 100644 vendor/golang.org/x/term/LICENSE delete mode 100644 vendor/golang.org/x/term/PATENTS delete mode 100644 vendor/golang.org/x/term/README.md delete mode 100644 vendor/golang.org/x/term/codereview.cfg delete mode 100644 vendor/golang.org/x/term/term.go delete mode 100644 vendor/golang.org/x/term/term_plan9.go delete mode 100644 vendor/golang.org/x/term/term_unix.go delete mode 100644 vendor/golang.org/x/term/term_unix_bsd.go delete mode 100644 vendor/golang.org/x/term/term_unix_other.go delete mode 100644 vendor/golang.org/x/term/term_unsupported.go delete mode 100644 vendor/golang.org/x/term/term_windows.go delete mode 100644 vendor/golang.org/x/term/terminal.go delete mode 100644 vendor/golang.org/x/text/width/kind_string.go delete mode 100644 vendor/golang.org/x/text/width/tables10.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables11.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables12.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables13.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables15.0.0.go delete mode 100644 vendor/golang.org/x/text/width/tables9.0.0.go delete mode 100644 vendor/golang.org/x/text/width/transform.go delete mode 100644 vendor/golang.org/x/text/width/trieval.go delete mode 100644 vendor/golang.org/x/text/width/width.go delete mode 100644 vendor/golang.org/x/tools/cmd/stringer/stringer.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/analysis.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/diagnostic.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/appends/appends.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/appends/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/asmdecl/arches_go118.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/asmdecl/arches_go119.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/assign/assign.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/assign/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/atomic/atomic.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/atomic/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/atomicalign/atomicalign.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/bools/bools.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/buildssa/buildssa.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag_old.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall_go120.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall_go121.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/composite/composite.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/composite/whitelist.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/ctrlflow/ctrlflow.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/deepequalerrors/deepequalerrors.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/defers/defers.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/defers/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/errorsas/errorsas.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/fieldalignment/fieldalignment.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/findcall/findcall.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/framepointer/framepointer.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/httpresponse/httpresponse.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/ifaceassert.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/ifaceassert/parameterized.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/inspect/inspect.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/loopclosure/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/loopclosure/loopclosure.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/lostcancel/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/nilfunc/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/nilfunc/nilfunc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/nilness/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/nilness/nilness.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/pkgfact/pkgfact.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/printf/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/printf/types.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/reflectvaluecompare/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/reflectvaluecompare/reflectvaluecompare.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/shadow/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/shadow/shadow.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/shift/dead.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/shift/shift.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/sigchanyzer/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/sigchanyzer/sigchanyzer.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/slog/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/slog/slog.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/sortslice/analyzer.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/stdmethods/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/stdmethods/stdmethods.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/stringintconv/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/stringintconv/string.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/structtag/structtag.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/testinggoroutine.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/util.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/tests/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/tests/tests.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/timeformat/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/timeformat/timeformat.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unmarshal/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unmarshal/unmarshal.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unreachable/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unreachable/unreachable.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unsafeptr/unsafeptr.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unusedresult/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unusedresult/unusedresult.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unusedwrite/doc.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/passes/unusedwrite/unusedwrite.go delete mode 100644 vendor/golang.org/x/tools/go/analysis/validate.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/inspector.go delete mode 100644 vendor/golang.org/x/tools/go/ast/inspector/typeof.go delete mode 100644 vendor/golang.org/x/tools/go/buildutil/allpackages.go delete mode 100644 vendor/golang.org/x/tools/go/buildutil/fakecontext.go delete mode 100644 vendor/golang.org/x/tools/go/buildutil/overlay.go delete mode 100644 vendor/golang.org/x/tools/go/buildutil/tags.go delete mode 100644 vendor/golang.org/x/tools/go/buildutil/util.go delete mode 100644 vendor/golang.org/x/tools/go/cfg/builder.go delete mode 100644 vendor/golang.org/x/tools/go/cfg/cfg.go delete mode 100644 vendor/golang.org/x/tools/go/internal/cgo/cgo.go delete mode 100644 vendor/golang.org/x/tools/go/internal/cgo/cgo_pkgconfig.go delete mode 100644 vendor/golang.org/x/tools/go/loader/doc.go delete mode 100644 vendor/golang.org/x/tools/go/loader/loader.go delete mode 100644 vendor/golang.org/x/tools/go/loader/util.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/TODO delete mode 100644 vendor/golang.org/x/tools/go/ssa/block.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/blockopt.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/builder.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/const.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/coretype.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/create.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/doc.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/dom.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/emit.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/func.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/instantiate.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/lift.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/lvalue.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/methods.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/mode.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/parameterized.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/print.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/sanity.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/source.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/ssa.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/ssautil/load.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/ssautil/switch.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/ssautil/visit.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/subst.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/util.go delete mode 100644 vendor/golang.org/x/tools/go/ssa/wrappers.go delete mode 100644 vendor/golang.org/x/tools/internal/analysisinternal/analysis.go delete mode 100644 vendor/golang.org/x/tools/internal/analysisinternal/extractdoc.go delete mode 100644 vendor/google.golang.org/genproto/LICENSE delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/LICENSE delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/field_info.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/annotations/routing.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/launch_stage.pb.go delete mode 100644 vendor/google.golang.org/genproto/googleapis/api/tidyfix.go delete mode 100644 vendor/google.golang.org/genproto/internal/doc.go delete mode 100644 vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/LICENSE delete mode 100644 vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/README.md delete mode 100644 vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/grpc.go delete mode 100644 vendor/google.golang.org/grpc/cmd/protoc-gen-go-grpc/main.go delete mode 100644 vendor/google.golang.org/protobuf/compiler/protogen/protogen.go delete mode 100644 vendor/google.golang.org/protobuf/types/dynamicpb/dynamic.go delete mode 100644 vendor/google.golang.org/protobuf/types/dynamicpb/types.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/apipb/api.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/emptypb/empty.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/sourcecontextpb/source_context.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/structpb/struct.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/typepb/type.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/wrapperspb/wrappers.pb.go delete mode 100644 vendor/google.golang.org/protobuf/types/pluginpb/plugin.pb.go delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/.gitignore delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/.travis.yml delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/AUTHORS delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/LICENSE delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/README.md delete mode 100644 vendor/gopkg.in/alessio/shellescape.v1/shellescape.go delete mode 100644 vendor/gopkg.in/warnings.v0/LICENSE delete mode 100644 vendor/gopkg.in/warnings.v0/README delete mode 100644 vendor/gopkg.in/warnings.v0/warnings.go delete mode 100644 vendor/honnef.co/go/tools/LICENSE delete mode 100644 vendor/honnef.co/go/tools/LICENSE-THIRD-PARTY delete mode 100644 vendor/honnef.co/go/tools/analysis/code/code.go delete mode 100644 vendor/honnef.co/go/tools/analysis/code/visit.go delete mode 100644 vendor/honnef.co/go/tools/analysis/edit/edit.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/deprecated/deprecated.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/directives/directives.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/generated/generated.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/nilness/nilness.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/purity/purity.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/tokenfile/token.go delete mode 100644 vendor/honnef.co/go/tools/analysis/facts/typedness/typedness.go delete mode 100644 vendor/honnef.co/go/tools/analysis/lint/lint.go delete mode 100644 vendor/honnef.co/go/tools/analysis/report/report.go delete mode 100644 vendor/honnef.co/go/tools/config/config.go delete mode 100644 vendor/honnef.co/go/tools/config/example.conf delete mode 100644 vendor/honnef.co/go/tools/go/ast/astutil/upstream.go delete mode 100644 vendor/honnef.co/go/tools/go/ast/astutil/util.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/LICENSE delete mode 100644 vendor/honnef.co/go/tools/go/ir/UPSTREAM delete mode 100644 vendor/honnef.co/go/tools/go/ir/blockopt.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/builder.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/const.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/create.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/doc.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/dom.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/emit.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/exits.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/func.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/html.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/load.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/loops.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/stub.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/switch.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/terminates.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/util.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/irutil/visit.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/lift.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/lvalue.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/methods.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/mode.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/print.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/sanity.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/source.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/ssa.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/util.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/wrappers.go delete mode 100644 vendor/honnef.co/go/tools/go/ir/write.go delete mode 100644 vendor/honnef.co/go/tools/go/types/typeutil/ext.go delete mode 100644 vendor/honnef.co/go/tools/go/types/typeutil/typeparams.go delete mode 100644 vendor/honnef.co/go/tools/go/types/typeutil/upstream.go delete mode 100644 vendor/honnef.co/go/tools/go/types/typeutil/util.go delete mode 100644 vendor/honnef.co/go/tools/internal/passes/buildir/buildir.go delete mode 100644 vendor/honnef.co/go/tools/internal/sharedcheck/lint.go delete mode 100644 vendor/honnef.co/go/tools/knowledge/arg.go delete mode 100644 vendor/honnef.co/go/tools/knowledge/deprecated.go delete mode 100644 vendor/honnef.co/go/tools/knowledge/doc.go delete mode 100644 vendor/honnef.co/go/tools/knowledge/signatures.go delete mode 100644 vendor/honnef.co/go/tools/pattern/convert.go delete mode 100644 vendor/honnef.co/go/tools/pattern/doc.go delete mode 100644 vendor/honnef.co/go/tools/pattern/lexer.go delete mode 100644 vendor/honnef.co/go/tools/pattern/match.go delete mode 100644 vendor/honnef.co/go/tools/pattern/parser.go delete mode 100644 vendor/honnef.co/go/tools/pattern/pattern.go delete mode 100644 vendor/honnef.co/go/tools/printf/fuzz.go delete mode 100644 vendor/honnef.co/go/tools/printf/printf.go delete mode 100644 vendor/honnef.co/go/tools/simple/analysis.go delete mode 100644 vendor/honnef.co/go/tools/simple/doc.go delete mode 100644 vendor/honnef.co/go/tools/simple/lint.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/analysis.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/buildtag.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/doc.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/fakejson/encode.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/fakereflect/fakereflect.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/fakexml/marshal.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/fakexml/typeinfo.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/fakexml/xml.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/lint.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/rules.go delete mode 100644 vendor/honnef.co/go/tools/staticcheck/structtag.go delete mode 100644 vendor/honnef.co/go/tools/stylecheck/analysis.go delete mode 100644 vendor/honnef.co/go/tools/stylecheck/doc.go delete mode 100644 vendor/honnef.co/go/tools/stylecheck/lint.go delete mode 100644 vendor/honnef.co/go/tools/stylecheck/names.go delete mode 100644 vendor/honnef.co/go/tools/unused/implements.go delete mode 100644 vendor/honnef.co/go/tools/unused/runtime.go delete mode 100644 vendor/honnef.co/go/tools/unused/serialize.go delete mode 100644 vendor/honnef.co/go/tools/unused/unused.go delete mode 100644 vendor/mvdan.cc/gofumpt/.gitattributes delete mode 100644 vendor/mvdan.cc/gofumpt/CHANGELOG.md delete mode 100644 vendor/mvdan.cc/gofumpt/LICENSE delete mode 100644 vendor/mvdan.cc/gofumpt/LICENSE.google delete mode 100644 vendor/mvdan.cc/gofumpt/README.md delete mode 100644 vendor/mvdan.cc/gofumpt/doc.go delete mode 100644 vendor/mvdan.cc/gofumpt/format/format.go delete mode 100644 vendor/mvdan.cc/gofumpt/format/rewrite.go delete mode 100644 vendor/mvdan.cc/gofumpt/format/simplify.go delete mode 100644 vendor/mvdan.cc/gofumpt/gofmt.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/diff/diff.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/doc.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/html.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/markdown.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/parse.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/print.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/std.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/doc/comment/text.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/format/format.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/format/internal.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/printer/comment.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/printer/gobuild.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/printer/nodes.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/govendor/go/printer/printer.go delete mode 100644 vendor/mvdan.cc/gofumpt/internal/version/version.go delete mode 100644 vendor/mvdan.cc/interfacer/LICENSE delete mode 100644 vendor/mvdan.cc/interfacer/check/cache.go delete mode 100644 vendor/mvdan.cc/interfacer/check/check.go delete mode 100644 vendor/mvdan.cc/interfacer/check/types.go delete mode 100644 vendor/mvdan.cc/lint/.travis.yml delete mode 100644 vendor/mvdan.cc/lint/LICENSE delete mode 100644 vendor/mvdan.cc/lint/README.md delete mode 100644 vendor/mvdan.cc/lint/lint.go delete mode 100644 vendor/mvdan.cc/unparam/LICENSE delete mode 100644 vendor/mvdan.cc/unparam/check/check.go diff --git a/Makefile b/Makefile index e1f028a440..ac33a67501 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +include Makefile.containers +include Makefile.tools +include Makefile.packaging + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Variable Definitions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -8,6 +12,16 @@ endif COMMIT = $(shell git rev-parse --short HEAD) DATE = $(shell date +%F_%H-%M-%S) +GOCMD = go +GOBUILD = $(GOCMD) build +GOTEST = $(GOCMD) test +GOTOOL = $(GOCMD) tool +GORUN = ${GOCMD} run +GOINST = ${GOCMD} install +GOGET = ${GOCMD} get +GOGEN = ${GOCMD} generate +GOVET = ${GOCMD} vet + # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # https://docs.nginx.com/nginx/releases/ # # These images are based on https://github.com/nginxinc/docker-nginx and are NOT recommended for production # @@ -68,7 +82,6 @@ CERT_SERVER_INT_CN := server-int.local CERT_SERVER_EE_CN := server-ee.local CERT_SERVER_DNS := tls.example.com -include Makefile.containers # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Developer Targets # @@ -98,12 +111,12 @@ run-debug: ## Run code ./build/nginx-agent build: ## Build agent executable - GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} go build -pgo=auto -ldflags=${LDFLAGS} -o ./build/nginx-agent + GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} ${GOBUILD} -pgo=auto -ldflags=${LDFLAGS} -o ./build/nginx-agent deps: ## Update dependencies in vendor folders cd sdk && make generate for dir in ${VENDOR_LOCATIONS}; do \ - (cd "$$dir" && echo "Running vendor commands on $$dir" && go mod tidy && go mod vendor && cd "$$OLDPWD" || exit) \ + (cd "$$dir" && echo "Running vendor commands on $$dir" && go mod tidy && GOWORK=off go mod vendor && cd "$$OLDPWD" || exit) \ done go mod download go work sync @@ -113,38 +126,33 @@ no-local-changes: lint: ## Run linter GOWORK=off go vet ./... - GOWORK=off go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 run -c ./scripts/.golangci.yml + GOWORK=off $(GORUN) $(GOLANGCI_LINT) run -c ./scripts/.golangci.yml cd sdk && make lint format: ## Format code - go run mvdan.cc/gofumpt -l -w . + $(GORUN) ${GOFUMPT} -l -w . buf format -w ./sdk/proto/ -install-tools: ## Install dependencies in tools.go using vendored version see https://www.jvt.me/posts/2023/06/19/go-install-from-mod/ - @echo "Installing Tools" - @grep _ ./scripts/tools.go | awk '{print $$2}' | xargs -tI % env GOBIN=$$(git rev-parse --show-toplevel)/bin GOWORK=off go install -mod=vendor % - @go run github.com/evilmartians/lefthook install pre-push - generate-swagger: ## Generates swagger.json from source code - go run github.com/go-swagger/go-swagger/cmd/swagger generate spec -o ./docs/swagger.json --scan-models + $(GORUN) $(GO_SWAGGER) generate spec -o ./docs/swagger.json --scan-models launch-swagger-ui: generate-swagger ## Launch Swagger UI - go run github.com/go-swagger/go-swagger/cmd/swagger serve ./docs/swagger.json -F=swagger --port=8082 --no-open + $(GORUN) $(GO_SWAGGER) serve ./docs/swagger.json -F=swagger --port=8082 --no-open # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Local Packaging # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # local-apk-package: ## Create local apk package GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} GOOS=linux go build -pgo=auto -ldflags=${DEBUG_LDFLAGS} -o ./build/nginx-agent - ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') go run github.com/goreleaser/nfpm/v2/cmd/nfpm pkg --config ./scripts/.local-nfpm.yaml --packager apk --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.apk; + ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') $(GORUN) ${NFPM} pkg --config ./scripts/.local-nfpm.yaml --packager apk --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.apk; local-deb-package: ## Create local deb package GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} GOOS=linux go build -pgo=auto -ldflags=${DEBUG_LDFLAGS} -o ./build/nginx-agent - ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') go run github.com/goreleaser/nfpm/v2/cmd/nfpm pkg --config ./scripts/.local-nfpm.yaml --packager deb --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.deb; + ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') $(GORUN) ${NFPM} pkg --config ./scripts/.local-nfpm.yaml --packager deb --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.deb; local-rpm-package: ## Create local rpm package GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} GOOS=linux go build -pgo=auto -ldflags=${DEBUG_LDFLAGS} -o ./build/nginx-agent - ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') go run github.com/goreleaser/nfpm/v2/cmd/nfpm pkg --config ./scripts/.local-nfpm.yaml --packager rpm --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.rpm; + ARCH=${OSARCH} VERSION=$(shell echo ${VERSION} | tr -d 'v') $(GORUN) ${NFPM} pkg --config ./scripts/.local-nfpm.yaml --packager rpm --target ./build/${PACKAGE_PREFIX}-$(shell echo ${VERSION} | tr -d 'v')-SNAPSHOT-${COMMIT}.rpm; local-txz-package: ## Create local txz package GOWORK=off CGO_ENABLED=0 GOARCH=${OSARCH} GOOS=freebsd go build -pgo=auto -ldflags=${DEBUG_LDFLAGS} -o ./build/nginx-agent @@ -154,8 +162,6 @@ txz-packager-image: ## Builds txz packager container image @echo Building Local Packager; \ $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t build-local-packager:1.0.0 --build-arg package_type=local-package . --no-cache -f ./scripts/packages/packager/Dockerfile -include Makefile.packaging - # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Testing # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # @@ -190,7 +196,7 @@ test-sdk: $(TEST_BUILD_DIR) ## Run sdk unit tests from root directory component-test: test-component-build test-component-run ## Run component tests test-component-build: ## Compile component tests - GOWORK=off CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test ./test/component -c -o component.test + GOWORK=off CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ${GOTEST} ./test/component -c -o component.test test-container-component: ## Run integration tests in container for container in ${$(CONTAINER_CLITOOL) ps -aqf "name=^nginx-agent_"}; do echo && $(CONTAINER_CLITOOL) ps -f "id=$$container" --format "{{.Image}}" && $(CONTAINER_CLITOOL) exec $$container ./tmp/component.test -test.v; done @@ -205,22 +211,22 @@ performance-test: ## Run performance tests integration-test: PACKAGES_REPO=${OSS_PACKAGES_REPO} INSTALL_FROM_REPO=${INSTALL_FROM_REPO} PACKAGE_NAME=${PACKAGE_NAME} BASE_IMAGE=${BASE_IMAGE} \ OS_VERSION=${OS_VERSION} OS_RELEASE=${OS_RELEASE} DOCKER_COMPOSE_FILE="docker-compose-${CONTAINER_OS_TYPE}.yml" \ - go test -v ./test/integration/install + ${GOTEST} -v ./test/integration/install PACKAGES_REPO=${OSS_PACKAGES_REPO} INSTALL_FROM_REPO=${INSTALL_FROM_REPO} PACKAGE_NAME=${PACKAGE_NAME} BASE_IMAGE=${BASE_IMAGE} \ OS_VERSION=${OS_VERSION} OS_RELEASE=${OS_RELEASE} DOCKER_COMPOSE_FILE="docker-compose-${CONTAINER_OS_TYPE}.yml" \ - go test -v ./test/integration/api + ${GOTEST} -v ./test/integration/api PACKAGES_REPO=${OSS_PACKAGES_REPO} INSTALL_FROM_REPO=${INSTALL_FROM_REPO} PACKAGE_NAME=${PACKAGE_NAME} BASE_IMAGE=${BASE_IMAGE} \ OS_VERSION=${OS_VERSION} OS_RELEASE=${OS_RELEASE} DOCKER_COMPOSE_FILE="docker-compose-${CONTAINER_OS_TYPE}.yml" \ - go test -v ./test/integration/features + ${GOTEST} -v ./test/integration/features PACKAGES_REPO=${OSS_PACKAGES_REPO} INSTALL_FROM_REPO=${INSTALL_FROM_REPO} PACKAGE_NAME=${PACKAGE_NAME} BASE_IMAGE=${BASE_IMAGE} \ OS_VERSION=${OS_VERSION} OS_RELEASE=${OS_RELEASE} DOCKER_COMPOSE_FILE="docker-compose-${CONTAINER_OS_TYPE}.yml" \ - go test -v ./test/integration/grpc + ${GOTEST} -v ./test/integration/grpc test-bench: ## Run benchmark tests - cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem metrics_test.go - cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 1 -bench=. -benchmem user_workflow_test.go - cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem plugins_test.go - cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem environment_test.go + cd test/performance && GOWORK=off CGO_ENABLED=0 ${GOTEST} -mod=vendor -count 5 -timeout 2m -bench=. -benchmem metrics_test.go + cd test/performance && GOWORK=off CGO_ENABLED=0 ${GOTEST} -mod=vendor -count 1 -bench=. -benchmem user_workflow_test.go + cd test/performance && GOWORK=off CGO_ENABLED=0 ${GOTEST} -mod=vendor -count 5 -timeout 2m -bench=. -benchmem plugins_test.go + cd test/performance && GOWORK=off CGO_ENABLED=0 ${GOTEST} -mod=vendor -count 5 -timeout 2m -bench=. -benchmem environment_test.go benchmark-image: ## Build benchmark test container image for NGINX Plus, need nginx-repo.crt and nginx-repo.key in build directory $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build --no-cache -t nginx-agent-benchmark:1.0.0 \ @@ -276,14 +282,14 @@ image: ## Build agent container image for NGINX Plus, need nginx-repo.crt and ng oss-image: ## Build agent container image for NGINX OSS @echo Building image with $(CONTAINER_CLITOOL); \ $(CONTAINER_BUILDENV) $(CONTAINER_CLITOOL) build -t ${IMAGE_TAG} . \ - --no-cache -f ./scripts/docker/nginx-oss/${CONTAINER_OS_TYPE}/Dockerfile \ - --target install-agent-local \ - --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ - --build-arg PACKAGES_REPO=${OSS_PACKAGES_REPO} \ - --build-arg BASE_IMAGE=${BASE_IMAGE} \ - --build-arg OS_RELEASE=${OS_RELEASE} \ - --build-arg OS_VERSION=${OS_VERSION} \ - --build-arg ENTRY_POINT=./scripts/docker/entrypoint.sh + --no-cache -f ./scripts/docker/nginx-oss/${CONTAINER_OS_TYPE}/Dockerfile \ + --target install-agent-local \ + --build-arg PACKAGE_NAME=${PACKAGE_NAME} \ + --build-arg PACKAGES_REPO=${OSS_PACKAGES_REPO} \ + --build-arg BASE_IMAGE=${BASE_IMAGE} \ + --build-arg OS_RELEASE=${OS_RELEASE} \ + --build-arg OS_VERSION=${OS_VERSION} \ + --build-arg ENTRY_POINT=./scripts/docker/entrypoint.sh run-container: ## Run container from specified IMAGE_TAG @echo Running ${IMAGE_TAG} with $(CONTAINER_CLITOOL); \ diff --git a/Makefile.tools b/Makefile.tools new file mode 100644 index 0000000000..08acab53fa --- /dev/null +++ b/Makefile.tools @@ -0,0 +1,35 @@ +#!/usr/bin/make -f + +BUF = "github.com/bufbuild/buf/cmd/buf@v1.29.0" +OAPI_CODEGEN = "github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen@v2.0.0" +LEFTHOOK = "github.com/evilmartians/lefthook@v1.5.5" +GO_SWAGGER = "github.com/go-swagger/go-swagger/cmd/swagger@abb53530bfcf49c470e5f4c7071ee43f37ec7437" # v0.30.5 currently broken. Update expected shortly. Ref: https://github.com/go-swagger/go-swagger/issues/3070 +PROTOBUF = "github.com/gogo/protobuf/protoc-gen-gogo@v1.3.2" +GOLANGCI_LINT = "github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2" +PROTOC_GENGO = "google.golang.org/protobuf/cmd/protoc-gen-go@v1.32.0" +PROTOC_VALIDATORS = "github.com/mwitkow/go-proto-validators/protoc-gen-govalidators@v0.3.2" +PROTOC_GEN_DOC = "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1" +PROTOC_GEN_GO_GRPC = "google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0" +NFPM = "github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.35.3" +MOCKGEN = "go.uber.org/mock/mockgen@v0.4.0" +GOFUMPT = "mvdan.cc/gofumpt@v0.6.0" +COUNTERFEITER = "github.com/maxbrunsfeld/counterfeiter/v6@v6.7.0" + +install-tools: ## Install tool dependencies + @echo "Installing Tools" + @$(GOGET) $(BUF) + @$(GOGET) $(OAPI_CODEGEN) + @$(GOGET) $(LEFTHOOK) + @$(GOGET) $(GO_SWAGGER) + @$(GOGET) $(PROTOBUF) + @$(GOGET) $(GOLANGCI_LINT) + @$(GOGET) $(PROTOC_GENGO) + @$(GOGET) $(PROTOC_VALIDATORS) + @$(GOGET) $(PROTOC_GEN_DOC) + @$(GOGET) $(PROTOC_GEN_GO_GRPC) + @$(GOGET) $(NFPM) + @$(GOGET) $(MOCKGEN) + @$(GOINST) $(GOFUMPT) + @$(GOGET) $(COUNTERFEITER) + @echo "Setting up git hooks" + @$(GORUN) $(LEFTHOOK) install pre-push diff --git a/go.mod b/go.mod index 439013fae7..7ee8ebc77a 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,8 @@ require ( github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.5.0 github.com/klauspost/cpuid/v2 v2.2.5 - github.com/maxbrunsfeld/counterfeiter/v6 v6.7.0 + github.com/maxbrunsfeld/counterfeiter/v6 v6.7.0 // indirect github.com/mitchellh/mapstructure v1.5.0 - github.com/mwitkow/go-proto-validators v0.3.2 github.com/nginxinc/nginx-plus-go-client v1.1.0 github.com/nginxinc/nginx-prometheus-exporter v0.11.0 github.com/nxadm/tail v1.4.11 @@ -29,327 +28,60 @@ require ( go.uber.org/atomic v1.11.0 golang.org/x/sync v0.6.0 google.golang.org/grpc v1.60.1 - google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 google.golang.org/protobuf v1.32.0 // indirect gopkg.in/mcuadros/go-syslog.v2 v2.3.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/bufbuild/buf v1.24.0 - github.com/evilmartians/lefthook v1.4.5 github.com/go-resty/resty/v2 v2.11.0 - github.com/go-swagger/go-swagger v0.30.5 - github.com/golangci/golangci-lint v1.55.2 - github.com/goreleaser/nfpm/v2 v2.32.0 github.com/nginx/agent/sdk/v2 v2.30.3 github.com/prometheus/client_golang v1.18.0 - github.com/pseudomuto/protoc-gen-doc v1.5.1 github.com/rs/cors v1.10.1 - go.uber.org/mock v0.3.0 + go.uber.org/mock v0.4.0 golang.org/x/sys v0.17.0 golang.org/x/text v0.14.0 gopkg.in/yaml.v2 v2.4.0 - mvdan.cc/gofumpt v0.6.0 ) require ( - 4d63.com/gocheckcompilerdirectives v1.2.1 // indirect - 4d63.com/gochecknoglobals v0.2.1 // indirect - dario.cat/mergo v1.0.0 // indirect - github.com/4meepo/tagalign v1.3.3 // indirect - github.com/Abirdcfly/dupword v0.0.13 // indirect - github.com/AlekSi/pointer v1.2.0 // indirect - github.com/Antonboom/errname v0.1.12 // indirect - github.com/Antonboom/nilnil v0.1.7 // indirect - github.com/Antonboom/testifylint v1.1.0 // indirect - github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/BurntSushi/toml v1.3.2 // indirect - github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect - github.com/MakeNowJust/heredoc v1.0.0 // indirect - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/Masterminds/sprig v2.22.0+incompatible // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect - github.com/alecthomas/go-check-sumtype v0.1.4 // indirect - github.com/alexkohler/nakedret/v2 v2.0.2 // indirect - github.com/alexkohler/prealloc v1.0.0 // indirect - github.com/alingse/asasalint v0.0.11 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/ashanbrown/forbidigo v1.6.0 // indirect - github.com/ashanbrown/makezero v1.1.1 // indirect - github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bkielbasa/cyclop v1.2.1 // indirect - github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb // indirect - github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v3 v3.4.0 // indirect - github.com/breml/bidichk v0.2.7 // indirect - github.com/breml/errchkjson v0.3.6 // indirect - github.com/briandowns/spinner v1.23.0 // indirect - github.com/bufbuild/connect-go v1.9.0 // indirect - github.com/bufbuild/connect-opentelemetry-go v0.4.0 // indirect - github.com/bufbuild/protocompile v0.5.1 // indirect - github.com/butuzov/ireturn v0.2.2 // indirect - github.com/butuzov/mirror v1.1.0 // indirect - github.com/caarlos0/go-version v0.1.1 // indirect - github.com/catenacyber/perfsprint v0.5.0 // indirect - github.com/cavaliergopher/cpio v1.0.1 // indirect - github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/charithe/durationcheck v0.0.10 // indirect - github.com/charmbracelet/lipgloss v0.7.1 // indirect - github.com/chavacava/garif v0.1.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect - github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect - github.com/creack/pty v1.1.18 // indirect - github.com/curioswitch/go-reassign v0.2.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect - github.com/daixiang0/gci v0.12.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/denis-tingaikin/go-header v0.4.3 // indirect - github.com/distribution/reference v0.5.0 // indirect - github.com/docker/cli v24.0.6+incompatible // indirect - github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v24.0.7+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.0 // indirect - github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.5.0 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect - github.com/esimonov/ifshort v1.0.4 // indirect - github.com/ettle/strcase v0.2.0 // indirect - github.com/fatih/color v1.16.0 // indirect - github.com/fatih/structtag v1.2.0 // indirect - github.com/felixge/fgprof v0.9.3 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/firefart/nonamedreturns v1.0.4 // indirect - github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/ghostiam/protogetter v0.3.4 // indirect - github.com/go-chi/chi/v5 v5.0.8 // indirect - github.com/go-critic/go-critic v0.11.0 // indirect - github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect - github.com/go-git/go-git/v5 v5.11.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.3.0 // indirect - github.com/go-openapi/analysis v0.21.4 // indirect - github.com/go-openapi/errors v0.20.4 // indirect - github.com/go-openapi/inflect v0.19.0 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/loads v0.21.2 // indirect - github.com/go-openapi/runtime v0.26.0 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-openapi/strfmt v0.21.7 // indirect - github.com/go-openapi/swag v0.22.4 // indirect - github.com/go-openapi/validate v0.22.1 // indirect - github.com/go-toolsmith/astcast v1.1.0 // indirect - github.com/go-toolsmith/astcopy v1.1.0 // indirect - github.com/go-toolsmith/astequal v1.2.0 // indirect - github.com/go-toolsmith/astfmt v1.1.0 // indirect - github.com/go-toolsmith/astp v1.1.0 // indirect - github.com/go-toolsmith/strparse v1.1.0 // indirect - github.com/go-toolsmith/typep v1.1.0 // indirect - github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect - github.com/gobwas/glob v0.2.3 // indirect - github.com/gofrs/flock v0.8.1 // indirect - github.com/gofrs/uuid/v5 v5.0.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect - github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20231019111953-be8c47862aaa // indirect - github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect - github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.4.1 // indirect - github.com/golangci/revgrep v0.5.2 // indirect - github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect - github.com/google/go-containerregistry v0.15.2 // indirect - github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 // indirect - github.com/google/rpmpack v0.5.0 // indirect - github.com/gordonklaus/ineffassign v0.1.0 // indirect - github.com/goreleaser/chglog v0.5.0 // indirect - github.com/goreleaser/fileglob v1.3.0 // indirect - github.com/gorilla/handlers v1.5.1 // indirect - github.com/gostaticanalysis/analysisutil v0.7.1 // indirect - github.com/gostaticanalysis/comment v1.4.2 // indirect - github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect - github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect - github.com/hashicorp/errwrap v1.1.0 // indirect - github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/huandu/xstrings v1.4.0 // indirect - github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 // indirect - github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/invopop/jsonschema v0.7.0 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 // indirect - github.com/jessevdk/go-flags v1.5.0 // indirect - github.com/jgautheron/goconst v1.7.0 // indirect - github.com/jingyugao/rowserrcheck v1.1.1 // indirect - github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect - github.com/josharian/intern v1.0.0 // indirect github.com/jstemmer/go-junit-report v1.0.0 // indirect - github.com/julz/importas v0.1.0 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/kisielk/errcheck v1.6.3 // indirect - github.com/kisielk/gotool v1.0.0 // indirect - github.com/kkHAIKE/contextcheck v1.1.4 // indirect - github.com/klauspost/compress v1.17.4 // indirect - github.com/klauspost/pgzip v1.2.6 // indirect - github.com/kr/pretty v0.3.1 // indirect - github.com/kr/text v0.2.0 // indirect - github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.9 // indirect - github.com/kyoh86/exportloopref v0.1.11 // indirect - github.com/ldez/gomoddirectives v0.2.3 // indirect - github.com/ldez/tagliatelle v0.5.0 // indirect - github.com/leonklingele/grouper v1.1.1 // indirect - github.com/lucasb-eyer/go-colorful v1.2.0 // indirect - github.com/lufeee/execinquery v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect - github.com/macabu/inamedparam v0.1.3 // indirect github.com/magiconair/properties v1.8.7 // indirect - github.com/mailru/easyjson v0.7.7 // indirect - github.com/maratori/testableexamples v1.0.0 // indirect - github.com/maratori/testpackage v1.1.1 // indirect - github.com/matoous/godox v0.0.0-20240105082147-c5b5e0e7c0c0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.6 // indirect - github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/moby/term v0.5.0 // indirect - github.com/moricho/tparallel v0.3.1 // indirect - github.com/morikuni/aec v1.0.0 // indirect - github.com/muesli/mango v0.1.0 // indirect - github.com/muesli/mango-cobra v1.2.0 // indirect - github.com/muesli/mango-pflag v0.1.0 // indirect - github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/roff v0.1.0 // indirect - github.com/muesli/termenv v0.15.1 // indirect - github.com/nakabonne/nestif v0.3.1 // indirect github.com/nginxinc/nginx-go-crossplane v0.4.33 // indirect - github.com/nishanths/exhaustive v0.12.0 // indirect - github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nunnatsa/ginkgolinter v0.15.2 // indirect - github.com/oklog/ulid v1.3.1 // indirect - github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - github.com/pkg/errors v0.9.1 // indirect - github.com/pkg/profile v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/polyfloyd/go-errorlint v1.4.8 // indirect github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.46.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/pseudomuto/protokit v0.2.0 // indirect - github.com/quasilyte/go-ruleguard v0.4.0 // indirect - github.com/quasilyte/gogrep v0.5.0 // indirect - github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect - github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect - github.com/rivo/uniseg v0.4.6 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ryancurrah/gomodguard v1.3.0 // indirect - github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect - github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect - github.com/securego/gosec/v2 v2.18.2 // indirect - github.com/sergi/go-diff v1.3.1 // indirect - github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shopspring/decimal v1.3.1 // indirect - github.com/sivchari/containedctx v1.0.3 // indirect - github.com/sivchari/nosnakecase v1.7.0 // indirect - github.com/sivchari/tenv v1.7.1 // indirect - github.com/skeema/knownhosts v1.2.1 // indirect - github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/conc v0.3.0 // indirect - github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect - github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect - github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect github.com/stretchr/objx v0.5.1 // indirect github.com/subosito/gotenv v1.6.0 // indirect - github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect - github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.16 // indirect - github.com/tetratelabs/wazero v1.2.1 // indirect - github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a // indirect - github.com/timonwong/loggercheck v0.9.4 // indirect github.com/tklauser/go-sysconf v0.3.12 // indirect github.com/tklauser/numcpus v0.6.1 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect - github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect - github.com/toqueteos/webbrowser v1.2.0 // indirect github.com/trivago/tgo v1.0.7 // indirect - github.com/ulikunitz/xz v0.5.11 // indirect - github.com/ultraware/funlen v0.1.0 // indirect - github.com/ultraware/whitespace v0.1.0 // indirect - github.com/uudashr/gocognit v1.1.2 // indirect - github.com/vbatts/tar-split v0.11.3 // indirect - github.com/xanzy/ssh-agent v0.3.3 // indirect - github.com/xen0n/gosmopolitan v1.2.2 // indirect - github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.2.0 // indirect - github.com/ykadowak/zerologlint v0.1.5 // indirect github.com/yusufpapurcu/wmi v1.2.3 // indirect - gitlab.com/bosi/decorder v0.4.1 // indirect - gitlab.com/digitalxero/go-conventional-commit v1.0.7 // indirect - go-simpler.org/sloglint v0.4.0 // indirect - go.mongodb.org/mongo-driver v1.11.3 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/sdk v1.20.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - go.tmz.dev/musttag v0.7.2 // indirect - go.uber.org/goleak v1.2.1 // indirect go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect - golang.org/x/exp/typeparams v0.0.0-20240119083558-1b970713d09a // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.21.0 // indirect - golang.org/x/term v0.17.0 // indirect golang.org/x/tools v0.17.0 // indirect - google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect - gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect - gotest.tools/v3 v3.5.1 // indirect - honnef.co/go/tools v0.4.6 // indirect - mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect - mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 // indirect ) replace github.com/nginx/agent/sdk/v2 => ./sdk diff --git a/go.sum b/go.sum index 9fb4913468..665fb67736 100644 --- a/go.sum +++ b/go.sum @@ -1,835 +1,126 @@ -4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= -4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= -4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= -4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= -dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= -github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= -github.com/Abirdcfly/dupword v0.0.13 h1:SMS17YXypwP000fA7Lr+kfyBQyW14tTT+nRv9ASwUUo= -github.com/Abirdcfly/dupword v0.0.13/go.mod h1:Ut6Ue2KgF/kCOawpW4LnExT+xZLQviJPE4klBPMK/5Y= -github.com/AlekSi/pointer v1.2.0 h1:glcy/gc4h8HnG2Z3ZECSzZ1IX1x2JxRVuDzaJwQE0+w= -github.com/AlekSi/pointer v1.2.0/go.mod h1:gZGfd3dpW4vEc/UlyfKKi1roIqcCgwOIvb0tSNSBle0= -github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= -github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= -github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= -github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= -github.com/Antonboom/testifylint v1.1.0 h1:HrgwOEqVQc5eAsWEDA6JvK7ZSzfdTBjWt0PAYHweu+o= -github.com/Antonboom/testifylint v1.1.0/go.mod h1:m62Du5rtu7uwrWsypuLPTVeKbTB3NZgPWrxfffu2r/8= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= -github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 h1:sATXp1x6/axKxz2Gjxv8MALP0bXaNRfQinEwyfMcx8c= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0/go.mod h1:Nl76DrGNJTA1KJ0LePKBw/vznBX1EHbAZX8mwjR82nI= -github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= -github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= -github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= -github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= -github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= -github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k= -github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= -github.com/ProtonMail/gopenpgp/v2 v2.7.1 h1:Awsg7MPc2gD3I7IFac2qE3Gdls0lZW8SzrFZ3k1oz0s= -github.com/ProtonMail/gopenpgp/v2 v2.7.1/go.mod h1:/BU5gfAVwqyd8EfC3Eu7zmuhwYQpKs+cGD8M//iiaxs= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= -github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= -github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= -github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= -github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alessio/shellescape v1.4.1 h1:V7yhSDDn8LP4lc4jS8pFkt0zCnzVJlG5JXy9BVKJUX0= -github.com/alessio/shellescape v1.4.1/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= -github.com/alexkohler/nakedret/v2 v2.0.2 h1:qnXuZNvv3/AxkAb22q/sEsEpcA99YxLFACDtEw9TPxE= -github.com/alexkohler/nakedret/v2 v2.0.2/go.mod h1:2b8Gkk0GsOrqQv/gPWjNLDSKwG8I5moSXG1K4VIBcTQ= -github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= -github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= -github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= -github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= -github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= -github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= -github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= -github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= -github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb h1:m935MPodAbYS46DG4pJSv7WO+VECIWUQ7OJYSoTrMh4= -github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= -github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= -github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= -github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= -github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= -github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= -github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= -github.com/briandowns/spinner v1.23.0 h1:alDF2guRWqa/FOZZYWjlMIx2L6H0wyewPxo/CH4Pt2A= -github.com/briandowns/spinner v1.23.0/go.mod h1:rPG4gmXeN3wQV/TsAY4w8lPdIM6RX3yqeBQJSrbXjuE= -github.com/bufbuild/buf v1.24.0 h1:36rVJMJX7BI9Z6nUPpirF+TUO9tVZ45u5VAfj5E7Bgw= -github.com/bufbuild/buf v1.24.0/go.mod h1:cacBvncWbYnUcNX580lqllR3qlEetMX/KVm27pUc4Kc= -github.com/bufbuild/connect-go v1.9.0 h1:JIgAeNuFpo+SUPfU19Yt5TcWlznsN5Bv10/gI/6Pjoc= -github.com/bufbuild/connect-go v1.9.0/go.mod h1:CAIePUgkDR5pAFaylSMtNK45ANQjp9JvpluG20rhpV8= -github.com/bufbuild/connect-opentelemetry-go v0.4.0 h1:6JAn10SNqlQ/URhvRNGrIlczKw1wEXknBUUtmWqOiak= -github.com/bufbuild/connect-opentelemetry-go v0.4.0/go.mod h1:nwPXYoDOoc2DGyKE/6pT1Q9MPSi2Et2e6BieMD0l6WU= -github.com/bufbuild/protocompile v0.5.1 h1:mixz5lJX4Hiz4FpqFREJHIXLfaLBntfaJv1h+/jS+Qg= -github.com/bufbuild/protocompile v0.5.1/go.mod h1:G5iLmavmF4NsYtpZFvE3B/zFch2GIY8+wjsYLR/lc40= -github.com/butuzov/ireturn v0.2.2 h1:jWI36dxXwVrI+RnXDwux2IZOewpmfv930OuIRfaBUJ0= -github.com/butuzov/ireturn v0.2.2/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= -github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= -github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11 h1:IRrDwVlWQr6kS1U8/EtyA1+EHcc4yl8pndcqXWrEamg= -github.com/caarlos0/go-rpmutils v0.2.1-0.20211112020245-2cd62ff89b11/go.mod h1:je2KZ+LxaCNvCoKg32jtOIULcFogJKcL1ZWUaIBjKj0= -github.com/caarlos0/go-version v0.1.1 h1:1bikKHkGGVIIxqCmufhSSs3hpBScgHGacrvsi8FuIfc= -github.com/caarlos0/go-version v0.1.1/go.mod h1:Ze5Qx4TsBBi5FyrSKVg1Ibc44KGV/llAaKGp86oTwZ0= -github.com/caarlos0/testfs v0.4.4 h1:3PHvzHi5Lt+g332CiShwS8ogTgS3HjrmzZxCm6JCDr8= -github.com/caarlos0/testfs v0.4.4/go.mod h1:bRN55zgG4XCUVVHZCeU+/Tz1Q6AxEJOEJTliBy+1DMk= -github.com/catenacyber/perfsprint v0.5.0 h1:FNBJRKm2Lar44u1s7DUfpbiY4iN2LmnK6THY3d5rL40= -github.com/catenacyber/perfsprint v0.5.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= -github.com/cavaliergopher/cpio v1.0.1 h1:KQFSeKmZhv0cr+kawA3a0xTQCU4QxXF1vhU7P7av2KM= -github.com/cavaliergopher/cpio v1.0.1/go.mod h1:pBdaqQjnvXxdS/6CvNDwIANIFSP0xRKI16PX4xejRQc= -github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= -github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= -github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= -github.com/charmbracelet/lipgloss v0.7.1 h1:17WMwi7N1b1rVWOjMT+rCh7sQkvDU75B2hbZpc5Kc1E= -github.com/charmbracelet/lipgloss v0.7.1/go.mod h1:yG0k3giv8Qj8edTCbbg6AlQ5e8KNWpFujkNawKNhE2c= -github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= -github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= -github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= -github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= -github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= -github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= -github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.12.1 h1:ugsG+KRYny1VK4oqrX4Vtj70bo4akYKa0tgT1DXMYiY= -github.com/daixiang0/gci v0.12.1/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0= -github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= -github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= -github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= -github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= -github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= -github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= -github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= -github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= -github.com/evilmartians/lefthook v1.4.5 h1:osXe6m7QionntprxX5RlEO8HI70p0AfJeqe/HaZvcxk= -github.com/evilmartians/lefthook v1.4.5/go.mod h1:wGvLhEBXf0YPxuDoMkxy7b6NFM5hr+CK4QCvCgcJEpw= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= -github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= -github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= -github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -github.com/ghostiam/protogetter v0.3.4 h1:5SZ+lZSNmNkSbGVSF9hUHhv/b7ELF9Rwchoq7btYo6c= -github.com/ghostiam/protogetter v0.3.4/go.mod h1:A0JgIhs0fgVnotGinjQiKaFVG3waItLJNwPmcMzDnvk= -github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= -github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= -github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= -github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= -github.com/go-critic/go-critic v0.11.0 h1:mARtIFX7jPtJ3SzxO9Isa5T2jd2dZxFmQHK3yNf0wrE= -github.com/go-critic/go-critic v0.11.0/go.mod h1:Cz6lr1PlkIu/0Y0U9KqJgcIJJECAF8mEwmzVjKnhbfI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= -github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= -github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4= -github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= -github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= -github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY= -github.com/go-openapi/analysis v0.21.4 h1:ZDFLvSNxpDaomuCueM0BlSXxpANBlFYiBvr+GXrvIHc= -github.com/go-openapi/analysis v0.21.4/go.mod h1:4zQ35W4neeZTqh3ol0rv/O8JBbka9QyAgQRPp9y3pfo= -github.com/go-openapi/errors v0.19.8/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.19.9/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.2/go.mod h1:cM//ZKUKyO06HSwqAelJ5NsEMMcpa6VpXe8DOa1Mi1M= -github.com/go-openapi/errors v0.20.4 h1:unTcVm6PispJsMECE3zWgvG4xTiKda1LIR5rCRWLG6M= -github.com/go-openapi/errors v0.20.4/go.mod h1:Z3FlZ4I8jEGxjUK+bugx3on2mIAk4txuAOhlsB1FSgk= -github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4= -github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/aim5Dprw5bqpKkTvns= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/loads v0.21.1/go.mod h1:/DtAMXXneXFjbQMGEtbamCZb+4x7eGwkvZCvBmwUG+g= -github.com/go-openapi/loads v0.21.2 h1:r2a/xFIYeZ4Qd2TnGpWDIQNcP80dIaZgf704za8enro= -github.com/go-openapi/loads v0.21.2/go.mod h1:Jq58Os6SSGz0rzh62ptiu8Z31I+OTHqmULx5e/gJbNw= -github.com/go-openapi/runtime v0.26.0 h1:HYOFtG00FM1UvqrcxbEJg/SwvDRvYLQKGhw2zaQjTcc= -github.com/go-openapi/runtime v0.26.0/go.mod h1:QgRGeZwrUcSHdeh4Ka9Glvo0ug1LC5WyE+EV88plZrQ= -github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.21.0/go.mod h1:ZRQ409bWMj+SOgXofQAGTIo2Ebu72Gs+WaRADcS5iNg= -github.com/go-openapi/strfmt v0.21.1/go.mod h1:I/XVKeLc5+MM5oPNN7P6urMOpuLXEcNrCX/rPGuWb0k= -github.com/go-openapi/strfmt v0.21.3/go.mod h1:k+RzNO0Da+k3FrrynSNN8F7n/peCmQQqbbXjtDfvmGg= -github.com/go-openapi/strfmt v0.21.7 h1:rspiXgNWgeUzhjo1YU01do6qsahtJNByjLVbPLNHb8k= -github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KAzYjclFs3ew= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= -github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= github.com/go-resty/resty/v2 v2.11.0 h1:i7jMfNOJYMp69lq7qozJP+bjgzfAzeOhuGlyDrqxT/8= github.com/go-resty/resty/v2 v2.11.0/go.mod h1:iiP/OpA0CkcL3IGt1O0+/SIItFUbkkyw5BGXiVdTu+A= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-swagger/go-swagger v0.30.5 h1:SQ2+xSonWjjoEMOV5tcOnZJVlfyUfCBhGQGArS1b9+U= -github.com/go-swagger/go-swagger v0.30.5/go.mod h1:cWUhSyCNqV7J1wkkxfr5QmbcnCewetCdvEXqgPvbc/Q= -github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013 h1:l9rI6sNaZgNC0LnF3MiE+qTmyBA/tZAg1rtyrGbUMK0= -github.com/go-swagger/scan-repo-boundary v0.0.0-20180623220736-973b3573c013/go.mod h1:b65mBPzqzZWxOZGxSWrqs4GInLIn+u99Q9q7p+GKni0= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= -github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= -github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= -github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= -github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= -github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= -github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= -github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= -github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= -github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= -github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= -github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= -github.com/go-toolsmith/pkgload v1.2.2 h1:0CtmHq/02QhxcF7E9N5LIFcYFsMR5rdovfqTtRKkgIk= -github.com/go-toolsmith/pkgload v1.2.2/go.mod h1:R2hxLNRKuAsiXCo2i5J6ZQPhnPMOVtU+f0arbFPWCus= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= -github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= -github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= -github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= -github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= -github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= -github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= -github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= -github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= -github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= -github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= -github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= -github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= -github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= -github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= -github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= -github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= -github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= -github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= -github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= -github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= -github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= -github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid/v5 v5.0.0 h1:p544++a97kEL+svbcFbCQVM9KFu0Yo25UoISXGNNH9M= -github.com/gofrs/uuid/v5 v5.0.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20231019111953-be8c47862aaa h1:L0Zq43Px2HrLroRKEgfCsQLMJUkjskJBB1kd1Zjcvvc= -github.com/golangci/gofmt v0.0.0-20231019111953-be8c47862aaa/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.55.2 h1:yllEIsSJ7MtlDBwDJ9IMBkyEUz2fYE0b5B8IUgO1oP8= -github.com/golangci/golangci-lint v1.55.2/go.mod h1:H60CZ0fuqoTwlTvnbyjhpZPWp7KmsjwV2yupIMiMXbM= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= -github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= -github.com/golangci/revgrep v0.5.2 h1:EndcWoRhcnfj2NHQ+28hyuXpLMF+dQmCN+YaeeIl4FU= -github.com/golangci/revgrep v0.5.2/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.15.2 h1:MMkSh+tjSdnmJZO7ljvEqV1DjfekB6VUEAZgy3a+TQE= -github.com/google/go-containerregistry v0.15.2/go.mod h1:wWK+LnOv4jXMM23IT/F1wdYftGWGr47Is8CG+pmHK1Q= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= -github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= -github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/rpmpack v0.5.0 h1:L16KZ3QvkFGpYhmp23iQip+mx1X39foEsqszjMNBm8A= -github.com/google/rpmpack v0.5.0/go.mod h1:uqVAUVQLq8UY2hCDfmJ/+rtO3aw7qyhc90rCVEabEfI= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g= -github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= -github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= -github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/goreleaser/chglog v0.5.0 h1:Sk6BMIpx8+vpAf8KyPit34OgWui8c7nKTMHhYx88jJ4= -github.com/goreleaser/chglog v0.5.0/go.mod h1:Ri46M3lrMuv76FHszs3vtABR8J8k1w9JHYAzxeeOl28= -github.com/goreleaser/fileglob v1.3.0 h1:/X6J7U8lbDpQtBvGcwwPS6OpzkNVlVEsFUVRx9+k+7I= -github.com/goreleaser/fileglob v1.3.0/go.mod h1:Jx6BoXv3mbYkEzwm9THo7xbr5egkAraxkGorbJb4RxU= -github.com/goreleaser/nfpm/v2 v2.32.0 h1:0eOOiSLGch55HvltFDfnd5Z0H28tO61YY6JaXznFKUc= -github.com/goreleaser/nfpm/v2 v2.32.0/go.mod h1:EdmpSQzxrZRmsR25NJW1+RUD9vW5BY5qwIObxHX7U5c= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0 h1:nhdCmubdmDF6VEatUNjgUZBJKWRqugoISdUv3PPQgHY= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= -github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= -github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0 h1:i462o439ZjprVSFSZLZxcsoAe592sZB1rci2Z8j4wdk= -github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/invopop/jsonschema v0.7.0 h1:2vgQcBz1n256N+FpX3Jq7Y17AjYt46Ig3zIWyy770So= -github.com/invopop/jsonschema v0.7.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84 h1:2uT3aivO7NVpUPGcQX7RbHijHMyWix/yCnIrCWc+5co= -github.com/jdxcode/netrc v0.0.0-20221124155335-4616370d1a84/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jgautheron/goconst v1.7.0 h1:cEqH+YBKLsECnRSd4F4TK5ri8t/aXtt/qoL0Ft252B0= -github.com/jgautheron/goconst v1.7.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= -github.com/jhump/protoreflect v1.15.1/go.mod h1:jD/2GMKKE6OqX8qTjhADU1e6DShO+gavG9e0Q693nKo= -github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= -github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v1.0.0 h1:8X1gzZpR+nVQLAht+L/foqOeX2l9DTZoaIPbEQHxsds= github.com/jstemmer/go-junit-report v1.0.0/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= -github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= -github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= -github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= -github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= -github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.9 h1:3Sr2IfFNcsMmlqPk1cjTUbJ4zofKPGyHxenwPebgTug= -github.com/kunwardeep/paralleltest v1.0.9/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= -github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= -github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= -github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= -github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= -github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= -github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= -github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= -github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed h1:036IscGBfJsFIgJQzlui7nK1Ncm0tp2ktmPj8xO4N/0= github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k= -github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= -github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= -github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= -github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= -github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= -github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= -github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= -github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/matoous/godox v0.0.0-20240105082147-c5b5e0e7c0c0 h1:Ny7cm4KSWceJLYyI1sm+aFIVDWSGXLcOJ0O0UaS5wdU= -github.com/matoous/godox v0.0.0-20240105082147-c5b5e0e7c0c0/go.mod h1:jgE/3fUXiTurkdHOLT5WEkThTSuE7yxHv5iWPa80afs= -github.com/matryer/is v1.4.0 h1:sosSmIWwkYITGrxZ25ULNDeKiMNzFSr4V/eqBQP0PeE= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk= -github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= -github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/maxbrunsfeld/counterfeiter/v6 v6.7.0 h1:z0CfPybq3CxaJvrrpf7Gme1psZTqHhJxf83q6apkSpI= github.com/maxbrunsfeld/counterfeiter/v6 v6.7.0/go.mod h1:RVP6/F85JyxTrbJxWIdKU2vlSvK48iCMnMXRkSz7xtg= -github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/revive v1.3.6 h1:ZNKZiHb/LciAqzwa/9HnwI8S/OJutYhMvaqgMT1Ylgo= -github.com/mgechev/revive v1.3.6/go.mod h1:75Je+5jKBgdgADNzGhsq7H5J6CmyXSzEk9eLOU4i8Pg= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= -github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= -github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= -github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= -github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= -github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= -github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= -github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/muesli/mango v0.1.0 h1:DZQK45d2gGbql1arsYA4vfg4d7I9Hfx5rX/GCmzsAvI= -github.com/muesli/mango v0.1.0/go.mod h1:5XFpbC8jY5UUv89YQciiXNlbi+iJgt29VDC5xbzrLL4= -github.com/muesli/mango-cobra v1.2.0 h1:DQvjzAM0PMZr85Iv9LIMaYISpTOliMEg+uMFtNbYvWg= -github.com/muesli/mango-cobra v1.2.0/go.mod h1:vMJL54QytZAJhCT13LPVDfkvCUJ5/4jNUKF/8NC2UjA= -github.com/muesli/mango-pflag v0.1.0 h1:UADqbYgpUyRoBja3g6LUL+3LErjpsOwaC9ywvBWe7Sg= -github.com/muesli/mango-pflag v0.1.0/go.mod h1:YEQomTxaCUp8PrbhFh10UfbhbQrM/xJ4i2PB8VTLLW0= -github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= -github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/roff v0.1.0 h1:YD0lalCotmYuF5HhZliKWlIx7IEhiXeSfq7hNjFqGF8= -github.com/muesli/roff v0.1.0/go.mod h1:pjAHQM9hdUUwm/krAfrLGgJkXJ+YuhtsfZ42kieB2Ig= -github.com/muesli/termenv v0.15.1 h1:UzuTb/+hhlBugQz28rpzey4ZuKcZ03MeKsoG7IJZIxs= -github.com/muesli/termenv v0.15.1/go.mod h1:HeAQPTzpfs016yGtA4g00CsdYnVLJvxsS4ANqrZs2sQ= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= -github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= -github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/nginxinc/nginx-go-crossplane v0.4.33 h1:Sr6ptE+xzQ7Vc5xs1SXNDDBWvVwKA7BTtQJZIGTS7RY= github.com/nginxinc/nginx-go-crossplane v0.4.33/go.mod h1:UzbZnyFv0vPlt1Urbnp/mrFCzBL4tYCReFuNBpFQEfI= github.com/nginxinc/nginx-plus-go-client v1.1.0 h1:J860nVSuF5w+uwDLFEWTGRD7NPJnF67kKqaH/oNAkx4= github.com/nginxinc/nginx-plus-go-client v1.1.0/go.mod h1:n8OFLzrJulJ2fur28Cwa1Qp5DZNS2VicLV+Adt30LQ4= github.com/nginxinc/nginx-prometheus-exporter v0.11.0 h1:21xjnqNgxtni2jDgAQ90bl15uDnrTreO9sIlu1YsX/U= github.com/nginxinc/nginx-prometheus-exporter v0.11.0/go.mod h1:GdyHnWAb8q8OW1Pssrrqbcqra0SH0Vn6UXICMmyWkw8= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= -github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= -github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.15.2 h1:N2ORxUxPU56R9gsfLIlVVvCv/V/VVou5qVI1oBKBNHg= -github.com/nunnatsa/ginkgolinter v0.15.2/go.mod h1:oYxE7dt1vZI8cK2rZOs3RgTaBN2vggkqnENmoJ8kVvc= github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= -github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= -github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= -github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= -github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.4.8 h1:jiEjKDH33ouFktyez7sckv6pHWif9B7SuS8cutDXFHw= -github.com/polyfloyd/go-errorlint v1.4.8/go.mod h1:NNCxFcFjZcw3xNjVdCchERkEM6Oz7wta2XJVxRftwO4= github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig= github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/pseudomuto/protoc-gen-doc v1.5.1 h1:Ah259kcrio7Ix1Rhb6u8FCaOkzf9qRBqXnvAufg061w= -github.com/pseudomuto/protoc-gen-doc v1.5.1/go.mod h1:XpMKYg6zkcpgfpCfQ8GcWBDRtRxOmMR5w7pz4Xo+dYM= -github.com/pseudomuto/protokit v0.2.0 h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= -github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= -github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= -github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= -github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= -github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= -github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= -github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.6 h1:Sovz9sDSwbOz9tgUy8JpT+KgCkPYJEN/oYzlJiYTNLg= -github.com/rivo/uniseg v0.4.6/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= -github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= -github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= -github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= -github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= -github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.24.0 h1:MKNzmXtGh5N0y74Z/CIaJh4GlB364l0K1RUT08WSWAc= -github.com/sashamelentyev/usestdlibvars v1.24.0/go.mod h1:9cYkq+gYJ+a5W2RPdhfaSCnTVUC1OQP/bSiiBhq3OZE= github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8= github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM= -github.com/securego/gosec/v2 v2.18.2 h1:DkDt3wCiOtAHf1XkiXZBhQ6m6mK/b9T/wD257R3/c+I= -github.com/securego/gosec/v2 v2.18.2/go.mod h1:xUuqSF6i0So56Y2wwohWAmB07EdBkUN6crbLlHwbyJs= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil/v3 v3.23.10 h1:/N42opWlYzegYaVkWejXWJpbzKv2JDy3mrgGzKsh9hM= @@ -838,55 +129,21 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= -github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= -github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= -github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= -github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= -github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/smartystreets/assertions v1.13.1 h1:Ef7KhSmjZcK6AVf9YbJdvPYG9avaF0ZxudX+ThRdWfU= -github.com/smartystreets/assertions v1.13.1/go.mod h1:cXr/IwVfSo/RbCSPhoAPv73p3hlSdrBH/b3SdnW/LMY= -github.com/smartystreets/goconvey v1.8.0 h1:Oi49ha/2MURE0WexF052Z0m+BNSGirfjg5RL+JXWq3w= -github.com/smartystreets/goconvey v1.8.0/go.mod h1:EdX8jtrTIj26jmjCOVNMVSIYAtgexqXKHOXW2Dx9JLg= -github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= -github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= -github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= -github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -895,591 +152,172 @@ github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= -github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= -github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= -github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.16 h1:4ChfhveiNLk4NveAZ9Pu2AN8QZ2nkUGFuadM9lrr5D0= -github.com/tetafro/godot v1.4.16/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= -github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs= -github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= -github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a h1:A6uKudFIfAEpoPdaal3aSqGxBzLyU8TqyXImLwo6dIo= -github.com/timakin/bodyclose v0.0.0-20240125160201-f835fa56326a/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= -github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= -github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= -github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= -github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= -github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= -github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= -github.com/toqueteos/webbrowser v1.2.0 h1:tVP/gpK69Fx+qMJKsLE7TD8LuGWPnEV71wBN9rrstGQ= -github.com/toqueteos/webbrowser v1.2.0/go.mod h1:XWoZq4cyp9WeUeak7w7LXRUQf1F1ATJMir8RTqb4ayM= github.com/trivago/grok v1.0.0 h1:oV2ljyZT63tgXkmgEHg2U0jMqiKKuL0hkn49s6aRavQ= github.com/trivago/grok v1.0.0/go.mod h1:9t59xLInhrncYq9a3J7488NgiBZi5y5yC7bss+w4NHM= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= -github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8= -github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= -github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= -github.com/ultraware/whitespace v0.1.0 h1:O1HKYoh0kIeqE8sFqZf1o0qbORXUCOQFrlaQyZsczZw= -github.com/ultraware/whitespace v0.1.0/go.mod h1:/se4r3beMFNmewJ4Xmz0nMQ941GJt+qmSHGP9emHYe0= -github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= -github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= -github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= github.com/vardius/message-bus v1.1.5 h1:YSAC2WB4HRlwc4neFPTmT88kzzoiQ+9WRRbej/E/LZc= github.com/vardius/message-bus v1.1.5/go.mod h1:6xladCV2lMkUAE4bzzS85qKOiB5miV7aBVRafiTJGqw= -github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= -github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= -github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= -github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= -github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= -github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= -github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= -github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo= -github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= -github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= -github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= -github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= -github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= -gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= -gitlab.com/digitalxero/go-conventional-commit v1.0.7 h1:8/dO6WWG+98PMhlZowt/YjuiKhqhGlOCwlIV8SqqGh8= -gitlab.com/digitalxero/go-conventional-commit v1.0.7/go.mod h1:05Xc2BFsSyC5tKhK0y+P3bs0AwUtNuTp+mTpbCU/DZ0= -go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= -go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= -go-simpler.org/sloglint v0.4.0 h1:UVJuUJo63iNQNFEOtZ6o1xAgagVg/giVLLvG9nNLobI= -go-simpler.org/sloglint v0.4.0/go.mod h1:v6zJ++j/thFPhefs2wEXoCKwT10yo5nkBDYRCXyqgNQ= -go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= -go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= -go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= -go.mongodb.org/mongo-driver v1.11.3 h1:Ql6K6qYHEzB6xvu4+AU0BoRoqf9vFPcc4o7MUIdPW8Y= -go.mongodb.org/mongo-driver v1.11.3/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= -go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= -go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= -go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= -go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= -go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 h1:/RIbNt/Zr7rVhIkQhooTxCxFcdWLGIKnZA4IXNFSrvo= golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08= -golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20240119083558-1b970713d09a h1:8qmSSA8Gz/1kTrCe0nqR0R3Gb/NDhykzWw2q2mWZydM= -golang.org/x/exp/typeparams v0.0.0-20240119083558-1b970713d09a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= -golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220906165534-d0df966e6959/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= -golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 h1:/IWabOtPziuXTEtI1KYCpM6Ss7vaAkeMxk+uXV/xvZs= -google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61 h1:8ajkpB4hXVftY5ko905id+dOnmorcS2CHNxxHLLDcFM= -gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61/go.mod h1:IfMagxm39Ys4ybJrDb7W3Ob8RwxftP0Yy+or/NVz1O8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mcuadros/go-syslog.v2 v2.3.0 h1:kcsiS+WsTKyIEPABJBJtoG0KkOS6yzvJ+/eZlhD79kk= gopkg.in/mcuadros/go-syslog.v2 v2.3.0/go.mod h1:l5LPIyOOyIdQquNg+oU6Z3524YwrcqEm0aKH+5zpt2U= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= -honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -mvdan.cc/gofumpt v0.6.0 h1:G3QvahNDmpD+Aek/bNOLrFR2XC6ZAdo62dZu65gmwGo= -mvdan.cc/gofumpt v0.6.0/go.mod h1:4L0wf+kgIPZtcCWXynNS2e6bhmj73umwnuXSZarixzA= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14 h1:zCr3iRRgdk5eIikZNDphGcM6KGVTx3Yu+/Uu9Es254w= -mvdan.cc/unparam v0.0.0-20240104100049-c549a3470d14/go.mod h1:ZzZjEpJDOmx8TdVU6umamY3Xy0UAQUI2DHbf05USVbI= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/go.work.sum b/go.work.sum index 88615ccf18..44fd990e65 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1257,6 +1257,7 @@ github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0 h1:XMEdVDFxgul github.com/AzureAD/microsoft-authentication-library-for-go v0.6.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/Djarvur/go-err113 v0.0.0-20200410182137-af658d038157/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= @@ -1289,6 +1290,7 @@ github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8 github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= github.com/OpenPeeDeeP/depguard v1.1.1/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= +github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= @@ -1318,6 +1320,7 @@ github.com/alecthomas/kingpin/v2 v2.3.2 h1:H0aULhgmSzN8xQ3nX1uxtdlTHYoPLu5AhHxWr github.com/alecthomas/kingpin/v2 v2.3.2/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= github.com/alecthomas/kingpin/v2 v2.4.0 h1:f48lwail6p8zpO1bC4TxtqACaGqHYA22qkHjHpqDjYY= github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= @@ -1330,8 +1333,6 @@ github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwc github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20220418222510-f25a4f6275ed/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= -github.com/aokoli/goutils v1.0.1 h1:7fpzNGoJ3VA8qcrm++XEE1QUe0mIwNeLa02Nwq7RDkg= -github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4xei5aX110hRiI= github.com/apache/arrow/go/v12 v12.0.0 h1:xtZE63VWl7qLdB0JObIXvvhGjoVNrQ9ciIHG2OK5cmc= @@ -1361,6 +1362,7 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/ashanbrown/forbidigo v1.5.1/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= @@ -1426,6 +1428,7 @@ github.com/aws/smithy-go v1.11.2 h1:eG/N+CcUMAvsdffgMvjMKwfyDzIkjM6pfxMJ8Mzc6mE= github.com/aws/smithy-go v1.11.2/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= github.com/aws/smithy-go v1.13.5/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -1450,13 +1453,14 @@ github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBT github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bshuster-repo/logrus-logstash-hook v1.0.0 h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70= github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= +github.com/bwesterb/go-ristretto v1.2.0 h1:xxWOVbN5m8NNKiSDZXE1jtZvZnC6JSJ9cYFADiZcWtw= github.com/bwesterb/go-ristretto v1.2.3 h1:1w53tCkGhCQ5djbat3+MH0BAQ5Kfgbt56UZQ/JMzngw= github.com/bytecodealliance/wasmtime-go v0.36.0/go.mod h1:q320gUxqyI8yB+ZqRuaJOEnGkAnHh6WtJjMaT2CW4wI= github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= +github.com/caarlos0/go-rpmutils v0.2.1-0.20240105125627-01185134a559 h1:5TPRjT2njvPKzXUcrcg6Dt+JPzQF+M5K7xb5V1Nwteg= github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e/go.mod h1:9IOqJGCPMSc6E5ydlp5NIonxObaeu/Iub/X03EKPVYo= github.com/cavaliercoder/go-cpio v0.0.0-20180626203310-925f9528c45e/go.mod h1:oDpT4efm8tSYHXV5tHSdRvBet/b/QzxZ+XyyPehvm3A= github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= @@ -1495,6 +1499,7 @@ github.com/cilium/ebpf v0.9.1/go.mod h1:+OhNOIXx/Fnu1IE8bJz2dzOA+VSfyTfdNUVdlQnx github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= @@ -1569,6 +1574,8 @@ github.com/containerd/nri v0.4.0/go.mod h1:Zw9q2lP16sdg0zYybemZ9yTDy8g7fPCIB3KXO github.com/containerd/stargz-snapshotter v0.0.0-20201027054423-3a04e4c2c116/go.mod h1:o59b3PCKVAf9jjiKtCc/9hLAd+5p/rfhBfm6aBcTEr4= github.com/containerd/stargz-snapshotter v0.14.3/go.mod h1:j2Ya4JeA5gMZJr8BchSkPjlcCEh++auAxp4nidPI6N0= github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= +github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= +github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= @@ -1616,6 +1623,7 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cristalhq/acmd v0.11.1 h1:DJ4fh2Pv0nPKmqT646IU/0Vh5FNdGblxvF+3/W3NAUI= @@ -1633,6 +1641,8 @@ github.com/cucumber/messages/go/v21 v21.0.1/go.mod h1:zheH/2HS9JLVFukdrsPWoPdmUt github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -1641,6 +1651,8 @@ github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7h github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/danieljoos/wincred v1.2.0 h1:ozqKHaLK0W/ii4KVbbvluM91W2H3Sh0BncbUNPS7jLE= github.com/danieljoos/wincred v1.2.0/go.mod h1:FzQLLMKBFdvu+osBrnFODiv32YGwCfx0SkRa/eYHgec= +github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= +github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d h1:1iy2qD6JEhHKKhUOA9IWs7mjco7lnw2qx8FsRI2wirE= @@ -1714,8 +1726,6 @@ github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avu github.com/docker/docker-credential-helpers v0.6.4/go.mod h1:ofX3UI0Gz1TteYBjtgs07O36Pyasyp66D2uKT7H8W1c= github.com/docker/docker-credential-helpers v0.7.0 h1:xtCHsjxogADNZcdv1pKUHXryefjlVRqWqIhk/uXJp0A= github.com/docker/docker-credential-helpers v0.7.0/go.mod h1:rETQfLdHNT3foU5kuNkFR1R1V12OJRRO5lzt2D1b5X0= -github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= -github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libnetwork v0.8.0-dev.2.0.20200917202933-d0951081b35f/go.mod h1:93m0aTqz6z+g32wla4l4WxTrdtvBRmVzYRkYvasA5Z8= @@ -1731,6 +1741,10 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 h1:pEtiCjIXx3RvGjlUJuCNxNOw0MNblyR9Wi+vJGBFh+8= +github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= +github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2 h1:dWB6v3RcOy03t/bUadywsbyrQwCqZeNIEX6M1OtSZOM= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= @@ -1756,6 +1770,8 @@ github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0+ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs= +github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -1767,6 +1783,7 @@ github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -1810,6 +1827,7 @@ github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3I github.com/go-ini/ini v1.66.6/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.9.0 h1:wDJmvq38kDhkVxi50ni9ykkdUr1PKgqKOoi01fa0Mdk= github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= @@ -1873,6 +1891,8 @@ github.com/gobuffalo/mapi v1.0.2 h1:fq9WcL1BYrm36SzK6+aAnZ8hcp+SrmnDyAxhNx8dvJk= github.com/gobuffalo/packd v0.1.0 h1:4sGKOD8yaYJ+dek1FDkwcxCHA40M4kfKgFHx8N2kwbU= github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZCj6A= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= @@ -1956,6 +1976,7 @@ github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8 github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod h1:KyKXa9ciM8+lgMXwOVsXi7UxGrsf9mM61Mzs+xKUrKE= github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4= github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= +github.com/google/go-containerregistry v0.14.0 h1:z58vMqHxuwvAsVwvKEkmVBz2TlgBgH5k6koEXBtlYkw= github.com/google/go-containerregistry v0.14.0/go.mod h1:aiJ2fp/SXvkWgmYHioXnbMdlgB8eXiiYOY55gfN91Wk= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= @@ -1988,6 +2009,7 @@ github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= github.com/google/rpmpack v0.0.0-20191226140753-aa36bfddb3a0/go.mod h1:RaTPr0KUf2K7fnZYLNDrr8rxAamWs3iNywJLtQ2AzBg= @@ -2062,6 +2084,8 @@ github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhj github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -2163,6 +2187,7 @@ github.com/hashicorp/uuid v0.0.0-20160311170451-ebb0a03e909c/go.mod h1:fHzc09Uny github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= @@ -2190,6 +2215,7 @@ github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFr github.com/jaguilar/vt100 v0.0.0-20150826170717-2703a27b14ea/go.mod h1:QMdK4dGB3YhEW2BmA1wgGpPYI3HZy/5gD705PXKUVSg= github.com/jarcoal/httpmock v1.0.5/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/jhump/protoreflect v1.15.4 h1:mrwJhfQGGljwvR/jPEocli8KA6G9afbQpH8NY2wORcI= github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= github.com/jinzhu/now v1.1.1 h1:g39TucaRWyV3dwDO++eEc6qf8TVIQ/Da48WmqjZ3i7E= github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= @@ -2208,17 +2234,21 @@ github.com/josephspurrier/goversioninfo v1.4.0 h1:Puhl12NSHUSALHSuzYwPYQkqa2E1+7 github.com/josephspurrier/goversioninfo v1.4.0/go.mod h1:JWzv5rKQr+MmW+LvM412ToT/IkYDZjaclF2pKDss8IY= github.com/jpillora/backoff v0.0.0-20180909062703-3050d21c67d7/go.mod h1:2iMrUgbbvHEiQClaW2NsSzMyGHqN+rDFqY705q49KG0= github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI= github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/junk1tm/musttag v0.5.0/go.mod h1:PcR7BA+oREQYvHwgjIDmw3exJeds5JzRcvEJTfjrA0M= github.com/karrick/godirwalk v1.10.3 h1:lOpSw2vJP0y5eLBW906QwKsUK/fe/QDyoqM5rnnuPDY= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= +github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/klauspost/asmfmt v1.3.2 h1:4Ri7ox3EwapiOjCki+hw14RyKk201CN4rzyCJRFLpK4= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= @@ -2231,14 +2261,13 @@ github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= -github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= -github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.2.0 h1:NMpwD2G9JSFOE1/TJjGSo5zG7Yb2bTe7eq1jH+irmeE= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.1.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -2268,6 +2297,7 @@ github.com/lestrrat-go/jwx v1.2.25 h1:tAx93jN2SdPvFn08fHNAhqFJazn5mBBOB8Zli0g0ot github.com/lestrrat-go/jwx v1.2.25/go.mod h1:zoNuZymNl5lgdcu6P7K6ie2QRll5HVfF4xwxBBK1NxY= github.com/lestrrat-go/option v1.0.0 h1:WqAWL8kh8VcSoD6xjSH34/1m8yxluXQbDeKNfvFeEO4= github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= +github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f h1:I1iYfgQavGa2tgdgKn+2Qg1yQhHEETvh/mNSxG3x5c0= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -2310,7 +2340,6 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= @@ -2352,6 +2381,8 @@ github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkO github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= @@ -2412,6 +2443,7 @@ github.com/mrunalp/fileutils v0.5.1 h1:F+S7ZlNKnrwHfSwdlgNSkKo67ReVf8o9fel6C3dkm github.com/mrunalp/fileutils v0.5.1/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= @@ -2539,8 +2571,11 @@ github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.5.0 h1:042Buzk+NhDI+DeSAA62RwJL8VAuZUMQZUjCsRz1Mug= github.com/pkg/profile v1.5.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1 h1:I2qBYMChEhIjOgazfJmV3/mZM256btk6wkCDRmW7JYs= @@ -2630,6 +2665,7 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/ruudk/golang-pdf417 v0.0.0-20181029194003-1af4ab5afa58/go.mod h1:6lfFZQK844Gfx8o5WFuvpxWRwnSoipWe/p622j1v06w= github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZKsJ8yyVxGRWYNEm9oFB8ieLgKFnamEyDmSA0BRk= github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= @@ -2660,6 +2696,8 @@ github.com/securego/gosec/v2 v2.3.0/go.mod h1:UzeVyUXbxukhLeHKV3VVqo7HdoQR9MrRfF github.com/securego/gosec/v2 v2.15.0/go.mod h1:VOjTrZOkUtSDt2QLSJmQBMWnvwiQPEjg0l+5juIqGk8= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002 h1:ka9QPuQg2u4LGipiZGsgkg3rJCo4iIUCy75FddM0GRQ= github.com/serialx/hashring v0.0.0-20190422032157-8b2912629002/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= @@ -2694,6 +2732,7 @@ github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY52 github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= +github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -2786,6 +2825,7 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.4/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= github.com/uudashr/gocognit v1.0.6/go.mod h1:nAIUuVBnYU7pcninia3BHOvQkpQCeO76Uscky5BOwcY= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -2795,6 +2835,7 @@ github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOV github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= github.com/vektah/gqlparser/v2 v2.4.5 h1:C02NsyEsL4TXJB7ndonqTfuQOL4XPIu0aAWugdmTgmc= @@ -2916,8 +2957,6 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0 h1:pginetY go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0/go.mod h1:XiYsayHc36K3EByOO6nbAXnAWbrUxdjUROCEeeROOH8= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0/go.mod h1:62CPTSry9QZtOaSsE3tOzhx6LzDhHnXJ6xHeMNNiM6Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.0/go.mod h1:HyABWq60Uy1kjJSa2BVOxUVao8Cdick5AWSKPutqy6U= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= @@ -2930,8 +2969,6 @@ go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeH go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= go.opentelemetry.io/otel v1.19.0/go.mod h1:i0QyjOq3UPoTzff0PJB2N66fb4S0+rSbSB15/oyH9fY= go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= -go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel/exporters/jaeger v1.14.0 h1:CjbUNd4iN2hHmWekmOqZ+zSCU+dzZppG8XsV+A3oc8Q= go.opentelemetry.io/otel/exporters/jaeger v1.14.0/go.mod h1:4Ay9kk5vELRrbg5z4cpP9EtmQRFap2Wb0woPG4lujZA= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1 h1:imIM3vRDMyZK1ypQlQlO+brE22I9lRhJsBDXpDWjlz8= @@ -2950,6 +2987,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0/go.mod h1:ceUgdyfNv4h4g go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 h1:TKf2uAs2ueguzLaxOCBXNpHxfO/aC7PAdDsSH0IbeRQ= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0/go.mod h1:HrbCVv40OOLTABmOn1ZWty6CHXkU8DK/Urc43tHug70= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.0.1/go.mod h1:xOvWoTOrQjxjW61xtOmD/WKGRYb/P4NzRo3bs65U6Rk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1 h1:AxqDiGk8CorEXStMDZF5Hz9vo9Z7ZZ+I5m8JRl/ko40= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.4.1/go.mod h1:c6E4V3/U+miqjs/8l950wggHGL1qzlp0Ypj9xoGrPqo= @@ -2961,6 +3000,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1 h1:8qOago go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.4.1/go.mod h1:VwYo0Hak6Efuy0TXsZs8o1hnV3dHDPNtDbycG0hI8+M= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY= go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk= go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= @@ -2971,8 +3012,6 @@ go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxx go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= go.opentelemetry.io/otel/metric v1.19.0/go.mod h1:L5rUsV9kM1IxCj1MmSdS+JQAcVm319EUrDVLrt7jqt8= go.opentelemetry.io/otel/metric v1.20.0/go.mod h1:90DRw3nfK4D7Sm/75yQ00gTJxtkBxX+wu6YaNymbpVM= -go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= -go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI= go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= @@ -2983,6 +3022,8 @@ go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= go.opentelemetry.io/otel/sdk/metric v0.40.0/go.mod h1:dWxHtdzdJvg+ciJUKLTKwrMe5P6Dv3FyDbh8UkfgkVs= +go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= +go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= @@ -2995,8 +3036,6 @@ go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLk go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= go.opentelemetry.io/otel/trace v1.19.0/go.mod h1:mfaSyvGyEJEI0nyV2I4qhNQnbBOUUmYZpYojqMnX2vo= go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= -go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= -go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.9.0/go.mod h1:1vKfU9rv61e9EVGthD1zNvUbiwPcimSsOPU9brfSHJg= go.opentelemetry.io/proto/otlp v0.12.0 h1:CMJ/3Wp7iOWES+CYLfnBv+DVmPbB+kmy9PJ92XvlR6c= @@ -3022,6 +3061,7 @@ go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= gocloud.dev v0.19.0/go.mod h1:SmKwiR8YwIMMJvQBKLsC3fHNyMwXLw3PMDO+VVteJMI= @@ -3052,7 +3092,7 @@ golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= @@ -3086,16 +3126,17 @@ golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeap golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -3139,7 +3180,6 @@ golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -3148,8 +3188,10 @@ golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -3190,6 +3232,7 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -3244,7 +3287,6 @@ golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -3278,9 +3320,9 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= @@ -3317,7 +3359,6 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -3343,7 +3384,6 @@ golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= @@ -3352,6 +3392,7 @@ golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.11.0/go.mod h1:anzJrxPjNtfgiYQYirP2CPGzGLxrH2u2QBhn6Bf3qY8= golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= @@ -3568,7 +3609,6 @@ google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqv google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= -google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0= google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= @@ -3588,6 +3628,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go. google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97/go.mod h1:iargEX0SFPm3xcfMI0d1domjg0ZF4Aa0p2awqyxhvF0= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577 h1:ZX0eQu2J+jOO87sq8fQG8J/Nfp7D7BhHpixIE5EYK/k= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230807174057-1744710a1577/go.mod h1:NjCQG/D8JandXxM57PZbAJL1DCNL6EypA0vPPwfsc7c= @@ -3689,6 +3730,7 @@ gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -3696,7 +3738,6 @@ gopkg.in/warnings.v0 v0.1.1/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/gotestsum v1.10.0 h1:lVO4uQJoxdsJb7jgmr1fg8QW7zGQ/tuqvsq5fHKyoHQ= gotest.tools/gotestsum v1.10.0/go.mod h1:6JHCiN6TEjA7Kaz23q1bH0e2Dc3YJjDUZ0DmctFZf+w= @@ -3706,6 +3747,7 @@ gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= honnef.co/go/tools v0.4.3/go.mod h1:36ZgoUOrqOk1GxwHhyryEkq8FQWkUO2xGuSMhUCcdvA= diff --git a/scripts/tools.go b/scripts/tools.go deleted file mode 100644 index 48ad7d877f..0000000000 --- a/scripts/tools.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build tools -// +build tools - -// https://www.jvt.me/posts/2022/06/15/go-tools-dependency-management/ - -package tools - -import ( - _ "github.com/bufbuild/buf/cmd/buf" - _ "github.com/evilmartians/lefthook" - _ "github.com/go-swagger/go-swagger/cmd/swagger" - _ "github.com/gogo/protobuf/protoc-gen-gogo" - _ "github.com/gogo/protobuf/protoc-gen-gogofast" - _ "github.com/golangci/golangci-lint/cmd/golangci-lint" - _ "github.com/goreleaser/nfpm/v2/cmd/nfpm" - _ "github.com/maxbrunsfeld/counterfeiter/v6" - _ "github.com/mwitkow/go-proto-validators/protoc-gen-govalidators" - _ "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" - _ "go.uber.org/mock/mockgen" - _ "google.golang.org/grpc/cmd/protoc-gen-go-grpc" - _ "mvdan.cc/gofumpt" -) diff --git a/sdk/Makefile b/sdk/Makefile index d47379b42c..5a88d94ab6 100644 --- a/sdk/Makefile +++ b/sdk/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/sdk/go.mod b/sdk/go.mod index 36323b7d7e..f5d508792e 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -30,7 +30,7 @@ require ( golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/go.sum b/sdk/go.sum index ffbbd5f7a0..7b5e5257d9 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -153,8 +153,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/sdk/vendor/modules.txt b/sdk/vendor/modules.txt index 90637008d0..802cb596ec 100644 --- a/sdk/vendor/modules.txt +++ b/sdk/vendor/modules.txt @@ -115,7 +115,7 @@ golang.org/x/tools/internal/tokeninternal golang.org/x/tools/internal/typeparams golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.60.1 diff --git a/test/integration/go.mod b/test/integration/go.mod index 05ac3d7c73..e3c225c65e 100644 --- a/test/integration/go.mod +++ b/test/integration/go.mod @@ -48,13 +48,13 @@ require ( github.com/distribution/distribution/v3 v3.0.0-20230830064551-b9b19409cf45 // indirect github.com/distribution/reference v0.5.0 // indirect github.com/docker/buildx v0.11.2 // indirect - github.com/docker/cli v24.0.6+incompatible // indirect + github.com/docker/cli v24.0.7+incompatible // indirect github.com/docker/compose/v2 v2.20.3 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker v24.0.7+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.0 // indirect + github.com/docker/docker-credential-helpers v0.8.1 // indirect github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect @@ -95,7 +95,7 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/jstemmer/go-junit-report v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.5 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -169,14 +169,14 @@ require ( github.com/yusufpapurcu/wmi v1.2.3 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.0 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect + go.opentelemetry.io/otel v1.22.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/sdk v1.20.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.22.0 // indirect + go.opentelemetry.io/otel/sdk v1.22.0 // indirect + go.opentelemetry.io/otel/trace v1.22.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.19.0 // indirect @@ -192,8 +192,8 @@ require ( golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/test/integration/go.sum b/test/integration/go.sum index e2d171f3d0..cc23155115 100644 --- a/test/integration/go.sum +++ b/test/integration/go.sum @@ -132,8 +132,8 @@ github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/docker/buildx v0.11.2 h1:R3p9F0gnI4FwvQ0p40UwdX1T4ugap4UWxY3TFHoP4Ws= github.com/docker/buildx v0.11.2/go.mod h1:CWAABt10iIuGpleypA3103mplDfcGu0A2AvT03xfpTc= -github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= -github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v24.0.7+incompatible h1:wa/nIwYFW7BVTGa7SWPVyyXU9lgORqUb1xfI36MSkFg= +github.com/docker/cli v24.0.7+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/compose/v2 v2.20.3 h1:UM6EaYgpjANQBKo7r7S4yNEdOeXr9IhBOpFFhOhqyd4= github.com/docker/compose/v2 v2.20.3/go.mod h1:xbMcMnkNJQfwh1PlMie2DfzIYAcqhtc2ipgcRGUOHfo= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= @@ -141,12 +141,13 @@ github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBi github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM= github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.8.0 h1:YQFtbBQb4VrpoPxhFuzEBPQ9E16qz5SpHLS+uswaCp8= -github.com/docker/docker-credential-helpers v0.8.0/go.mod h1:UGFXcuoQ5TxPiB54nHOZ32AWRqQdECoh/Mg0AlEYb40= +github.com/docker/docker-credential-helpers v0.8.1 h1:j/eKUktUltBtMzKqmfLB0PAgqYyMHOp5vfsD1807oKo= +github.com/docker/docker-credential-helpers v0.8.1/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= @@ -254,8 +255,8 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= -github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= @@ -318,8 +319,8 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= +github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -551,8 +552,8 @@ github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531 h1:Y/M5lygoNPKwVN github.com/tonistiigi/vt100 v0.0.0-20230623042737-f9a4f7ef6531/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= github.com/vardius/message-bus v1.1.5 h1:YSAC2WB4HRlwc4neFPTmT88kzzoiQ+9WRRbej/E/LZc= github.com/vardius/message-bus v1.1.5/go.mod h1:6xladCV2lMkUAE4bzzS85qKOiB5miV7aBVRafiTJGqw= -github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= -github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= +github.com/vbatts/tar-split v0.11.2 h1:Via6XqJr0hceW4wff3QRzD5gAk/tatMw/4ZA7cTlIME= +github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= github.com/weppos/publicsuffix-go v0.30.1 h1:8q+QwBS1MY56Zjfk/50ycu33NN8aa1iCCEQwo/71Oos= github.com/weppos/publicsuffix-go v0.30.1/go.mod h1:s41lQh6dIsDWIC1OWh7ChWJXLH0zkJ9KHZVqA7vHyuQ= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -578,30 +579,30 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.4 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0/go.mod h1:Ct6zzQEuGK3WpJs2n4dn+wfJYzd/+hNnxMRTWjGn30M= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.0 h1:WUMhXWqLmFlznidWF4B9iML8VMdZy4TzJVYzdYTCuaM= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.46.0/go.mod h1:H1XIOXyXFff1aZa7nQeFHGYMB+gHH1TtZSti37uHX6o= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= -go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= -go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= +go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y= +go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 h1:3d+S281UTjM+AbF31XSOYn1qXn3BgIdWl8HNEpx08Jk= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0/go.mod h1:0+KuTDyKL4gjKCF75pHOX4wuzYDUZYfAQdSu43o+Z2I= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= -go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= -go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= -go.opentelemetry.io/otel/sdk v1.20.0 h1:5Jf6imeFZlZtKv9Qbo6qt2ZkmWtdWx/wzcCbNUlAWGM= -go.opentelemetry.io/otel/sdk v1.20.0/go.mod h1:rmkSx1cZCm/tn16iWDn1GQbLtsW/LvsdEEFzCSRM6V0= -go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= -go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg= +go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY= +go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw= +go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc= +go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0= +go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo= go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -760,10 +761,10 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 h1:/IWabOtPziuXTEtI1KYCpM6Ss7vaAkeMxk+uXV/xvZs= google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM= -google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac h1:OZkkudMUu9LVQMCoRUbI/1p5VCo9BOrlvkqMvWtqa6s= +google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:B5xPO//w8qmBDjGReYLpR6UJPnkldGkCSMoH/2vxJeg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -807,8 +808,8 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= -gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= k8s.io/api v0.28.1 h1:i+0O8k2NPBCPYaMB+uCkseEbawEt/eFaiRqUx8aB108= diff --git a/test/integration/vendor/github.com/docker/docker-credential-helpers/client/client.go b/test/integration/vendor/github.com/docker/docker-credential-helpers/client/client.go index 678153cf88..7ca5ab7222 100644 --- a/test/integration/vendor/github.com/docker/docker-credential-helpers/client/client.go +++ b/test/integration/vendor/github.com/docker/docker-credential-helpers/client/client.go @@ -16,11 +16,9 @@ func isValidCredsMessage(msg string) error { if credentials.IsCredentialsMissingServerURLMessage(msg) { return credentials.NewErrCredentialsMissingServerURL() } - if credentials.IsCredentialsMissingUsernameMessage(msg) { return credentials.NewErrCredentialsMissingUsername() } - return nil } @@ -36,13 +34,10 @@ func Store(program ProgramFunc, creds *credentials.Credentials) error { out, err := cmd.Output() if err != nil { - t := strings.TrimSpace(string(out)) - - if isValidErr := isValidCredsMessage(t); isValidErr != nil { + if isValidErr := isValidCredsMessage(string(out)); isValidErr != nil { err = isValidErr } - - return fmt.Errorf("error storing credentials - err: %v, out: `%s`", err, t) + return fmt.Errorf("error storing credentials - err: %v, out: `%s`", err, strings.TrimSpace(string(out))) } return nil @@ -55,17 +50,15 @@ func Get(program ProgramFunc, serverURL string) (*credentials.Credentials, error out, err := cmd.Output() if err != nil { - t := strings.TrimSpace(string(out)) - - if credentials.IsErrCredentialsNotFoundMessage(t) { + if credentials.IsErrCredentialsNotFoundMessage(string(out)) { return nil, credentials.NewErrCredentialsNotFound() } - if isValidErr := isValidCredsMessage(t); isValidErr != nil { + if isValidErr := isValidCredsMessage(string(out)); isValidErr != nil { err = isValidErr } - return nil, fmt.Errorf("error getting credentials - err: %v, out: `%s`", err, t) + return nil, fmt.Errorf("error getting credentials - err: %v, out: `%s`", err, strings.TrimSpace(string(out))) } resp := &credentials.Credentials{ diff --git a/test/integration/vendor/github.com/docker/docker-credential-helpers/credentials/error.go b/test/integration/vendor/github.com/docker/docker-credential-helpers/credentials/error.go index 8fa4d5d254..2283d5a44c 100644 --- a/test/integration/vendor/github.com/docker/docker-credential-helpers/credentials/error.go +++ b/test/integration/vendor/github.com/docker/docker-credential-helpers/credentials/error.go @@ -1,6 +1,9 @@ package credentials -import "errors" +import ( + "errors" + "strings" +) const ( // ErrCredentialsNotFound standardizes the not found error, so every helper returns @@ -47,7 +50,7 @@ func IsErrCredentialsNotFound(err error) bool { // This function helps to check messages returned by an // external program via its standard output. func IsErrCredentialsNotFoundMessage(err string) bool { - return err == errCredentialsNotFoundMessage + return strings.TrimSpace(err) == errCredentialsNotFoundMessage } // errCredentialsMissingServerURL represents an error raised @@ -104,7 +107,7 @@ func IsCredentialsMissingServerURL(err error) bool { // IsCredentialsMissingServerURLMessage checks for an // errCredentialsMissingServerURL in the error message. func IsCredentialsMissingServerURLMessage(err string) bool { - return err == errCredentialsMissingServerURLMessage + return strings.TrimSpace(err) == errCredentialsMissingServerURLMessage } // IsCredentialsMissingUsername returns true if the error @@ -117,5 +120,5 @@ func IsCredentialsMissingUsername(err error) bool { // IsCredentialsMissingUsernameMessage checks for an // errCredentialsMissingUsername in the error message. func IsCredentialsMissingUsernameMessage(err string) bool { - return err == errCredentialsMissingUsernameMessage + return strings.TrimSpace(err) == errCredentialsMissingUsernameMessage } diff --git a/test/integration/vendor/github.com/docker/go-connections/nat/nat.go b/test/integration/vendor/github.com/docker/go-connections/nat/nat.go index bb7e4e3369..4049d780c5 100644 --- a/test/integration/vendor/github.com/docker/go-connections/nat/nat.go +++ b/test/integration/vendor/github.com/docker/go-connections/nat/nat.go @@ -8,11 +8,6 @@ import ( "strings" ) -const ( - // portSpecTemplate is the expected format for port specifications - portSpecTemplate = "ip:hostPort:containerPort" -) - // PortBinding represents a binding between a Host IP address and a Host Port type PortBinding struct { // HostIP is the host IP Address @@ -158,48 +153,51 @@ type PortMapping struct { func splitParts(rawport string) (string, string, string) { parts := strings.Split(rawport, ":") n := len(parts) - containerport := parts[n-1] + containerPort := parts[n-1] switch n { case 1: - return "", "", containerport + return "", "", containerPort case 2: - return "", parts[0], containerport + return "", parts[0], containerPort case 3: - return parts[0], parts[1], containerport + return parts[0], parts[1], containerPort default: - return strings.Join(parts[:n-2], ":"), parts[n-2], containerport + return strings.Join(parts[:n-2], ":"), parts[n-2], containerPort } } // ParsePortSpec parses a port specification string into a slice of PortMappings func ParsePortSpec(rawPort string) ([]PortMapping, error) { var proto string - rawIP, hostPort, containerPort := splitParts(rawPort) + ip, hostPort, containerPort := splitParts(rawPort) proto, containerPort = SplitProtoPort(containerPort) - // Strip [] from IPV6 addresses - ip, _, err := net.SplitHostPort(rawIP + ":") - if err != nil { - return nil, fmt.Errorf("Invalid ip address %v: %s", rawIP, err) + if ip != "" && ip[0] == '[' { + // Strip [] from IPV6 addresses + rawIP, _, err := net.SplitHostPort(ip + ":") + if err != nil { + return nil, fmt.Errorf("invalid IP address %v: %w", ip, err) + } + ip = rawIP } if ip != "" && net.ParseIP(ip) == nil { - return nil, fmt.Errorf("Invalid ip address: %s", ip) + return nil, fmt.Errorf("invalid IP address: %s", ip) } if containerPort == "" { - return nil, fmt.Errorf("No port specified: %s", rawPort) + return nil, fmt.Errorf("no port specified: %s", rawPort) } startPort, endPort, err := ParsePortRange(containerPort) if err != nil { - return nil, fmt.Errorf("Invalid containerPort: %s", containerPort) + return nil, fmt.Errorf("invalid containerPort: %s", containerPort) } var startHostPort, endHostPort uint64 = 0, 0 if len(hostPort) > 0 { startHostPort, endHostPort, err = ParsePortRange(hostPort) if err != nil { - return nil, fmt.Errorf("Invalid hostPort: %s", hostPort) + return nil, fmt.Errorf("invalid hostPort: %s", hostPort) } } @@ -208,12 +206,12 @@ func ParsePortSpec(rawPort string) ([]PortMapping, error) { // In this case, use the host port range as the dynamic // host port range to allocate into. if endPort != startPort { - return nil, fmt.Errorf("Invalid ranges specified for container and host Ports: %s and %s", containerPort, hostPort) + return nil, fmt.Errorf("invalid ranges specified for container and host Ports: %s and %s", containerPort, hostPort) } } if !validateProto(strings.ToLower(proto)) { - return nil, fmt.Errorf("Invalid proto: %s", proto) + return nil, fmt.Errorf("invalid proto: %s", proto) } ports := []PortMapping{} diff --git a/test/integration/vendor/github.com/docker/go-connections/nat/parse.go b/test/integration/vendor/github.com/docker/go-connections/nat/parse.go index 892adf8c66..e4b53e8a32 100644 --- a/test/integration/vendor/github.com/docker/go-connections/nat/parse.go +++ b/test/integration/vendor/github.com/docker/go-connections/nat/parse.go @@ -6,34 +6,10 @@ import ( "strings" ) -// PartParser parses and validates the specified string (data) using the specified template -// e.g. ip:public:private -> 192.168.0.1:80:8000 -// DEPRECATED: do not use, this function may be removed in a future version -func PartParser(template, data string) (map[string]string, error) { - // ip:public:private - var ( - templateParts = strings.Split(template, ":") - parts = strings.Split(data, ":") - out = make(map[string]string, len(templateParts)) - ) - if len(parts) != len(templateParts) { - return nil, fmt.Errorf("Invalid format to parse. %s should match template %s", data, template) - } - - for i, t := range templateParts { - value := "" - if len(parts) > i { - value = parts[i] - } - out[t] = value - } - return out, nil -} - // ParsePortRange parses and validates the specified string as a port-range (8000-9000) func ParsePortRange(ports string) (uint64, uint64, error) { if ports == "" { - return 0, 0, fmt.Errorf("Empty string specified for ports.") + return 0, 0, fmt.Errorf("empty string specified for ports") } if !strings.Contains(ports, "-") { start, err := strconv.ParseUint(ports, 10, 16) @@ -51,7 +27,7 @@ func ParsePortRange(ports string) (uint64, uint64, error) { return 0, 0, err } if end < start { - return 0, 0, fmt.Errorf("Invalid range specified for the Port: %s", ports) + return 0, 0, fmt.Errorf("invalid range specified for port: %s", ports) } return start, end, nil } diff --git a/test/integration/vendor/github.com/docker/go-connections/nat/sort.go b/test/integration/vendor/github.com/docker/go-connections/nat/sort.go index ce950171e3..b6eed145e1 100644 --- a/test/integration/vendor/github.com/docker/go-connections/nat/sort.go +++ b/test/integration/vendor/github.com/docker/go-connections/nat/sort.go @@ -43,7 +43,7 @@ type portMapSorter []portMapEntry func (s portMapSorter) Len() int { return len(s) } func (s portMapSorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -// sort the port so that the order is: +// Less sorts the port so that the order is: // 1. port with larger specified bindings // 2. larger port // 3. port with tcp protocol @@ -58,7 +58,7 @@ func (s portMapSorter) Less(i, j int) bool { func SortPortMap(ports []Port, bindings PortMap) { s := portMapSorter{} for _, p := range ports { - if binding, ok := bindings[p]; ok { + if binding, ok := bindings[p]; ok && len(binding) > 0 { for _, b := range binding { s = append(s, portMapEntry{port: p, binding: b}) } diff --git a/test/integration/vendor/github.com/docker/go-connections/sockets/proxy.go b/test/integration/vendor/github.com/docker/go-connections/sockets/proxy.go index 98e9a1dc61..c897cb02ad 100644 --- a/test/integration/vendor/github.com/docker/go-connections/sockets/proxy.go +++ b/test/integration/vendor/github.com/docker/go-connections/sockets/proxy.go @@ -2,11 +2,8 @@ package sockets import ( "net" - "net/url" "os" "strings" - - "golang.org/x/net/proxy" ) // GetProxyEnv allows access to the uppercase and the lowercase forms of @@ -20,32 +17,12 @@ func GetProxyEnv(key string) string { return proxyValue } -// DialerFromEnvironment takes in a "direct" *net.Dialer and returns a -// proxy.Dialer which will route the connections through the proxy using the -// given dialer. -func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error) { - allProxy := GetProxyEnv("all_proxy") - if len(allProxy) == 0 { - return direct, nil - } - - proxyURL, err := url.Parse(allProxy) - if err != nil { - return direct, err - } - - proxyFromURL, err := proxy.FromURL(proxyURL, direct) - if err != nil { - return direct, err - } - - noProxy := GetProxyEnv("no_proxy") - if len(noProxy) == 0 { - return proxyFromURL, nil - } - - perHost := proxy.NewPerHost(proxyFromURL, direct) - perHost.AddFromString(noProxy) - - return perHost, nil +// DialerFromEnvironment was previously used to configure a net.Dialer to route +// connections through a SOCKS proxy. +// DEPRECATED: SOCKS proxies are now supported by configuring only +// http.Transport.Proxy, and no longer require changing http.Transport.Dial. +// Therefore, only sockets.ConfigureTransport() needs to be called, and any +// sockets.DialerFromEnvironment() calls can be dropped. +func DialerFromEnvironment(direct *net.Dialer) (*net.Dialer, error) { + return direct, nil } diff --git a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets.go b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets.go index a1d7beb4d8..b0eae239d2 100644 --- a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets.go +++ b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets.go @@ -8,16 +8,18 @@ import ( "time" ) -// Why 32? See https://github.com/docker/docker/pull/8035. -const defaultTimeout = 32 * time.Second +const defaultTimeout = 10 * time.Second // ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system. var ErrProtocolNotAvailable = errors.New("protocol not available") -// ConfigureTransport configures the specified Transport according to the -// specified proto and addr. -// If the proto is unix (using a unix socket to communicate) or npipe the -// compression is disabled. +// ConfigureTransport configures the specified [http.Transport] according to the specified proto +// and addr. +// +// If the proto is unix (using a unix socket to communicate) or npipe the compression is disabled. +// For other protos, compression is enabled. If you want to manually enable/disable compression, +// make sure you do it _after_ any subsequent calls to ConfigureTransport is made against the same +// [http.Transport]. func ConfigureTransport(tr *http.Transport, proto, addr string) error { switch proto { case "unix": @@ -26,13 +28,10 @@ func ConfigureTransport(tr *http.Transport, proto, addr string) error { return configureNpipeTransport(tr, proto, addr) default: tr.Proxy = http.ProxyFromEnvironment - dialer, err := DialerFromEnvironment(&net.Dialer{ + tr.DisableCompression = false + tr.DialContext = (&net.Dialer{ Timeout: defaultTimeout, - }) - if err != nil { - return err - } - tr.Dial = dialer.Dial + }).DialContext } return nil } diff --git a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_unix.go b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_unix.go index 386cf0dbbd..78a34a980d 100644 --- a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_unix.go +++ b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_unix.go @@ -1,8 +1,9 @@ -// +build !windows +//go:build !windows package sockets import ( + "context" "fmt" "net" "net/http" @@ -14,12 +15,15 @@ const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) func configureUnixTransport(tr *http.Transport, proto, addr string) error { if len(addr) > maxUnixSocketPathSize { - return fmt.Errorf("Unix socket path %q is too long", addr) + return fmt.Errorf("unix socket path %q is too long", addr) } // No need for compression in local communications. tr.DisableCompression = true - tr.Dial = func(_, _ string) (net.Conn, error) { - return net.DialTimeout(proto, addr, defaultTimeout) + dialer := &net.Dialer{ + Timeout: defaultTimeout, + } + tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) { + return dialer.DialContext(ctx, proto, addr) } return nil } diff --git a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_windows.go b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_windows.go index 5c21644e1f..7acafc5a2a 100644 --- a/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_windows.go +++ b/test/integration/vendor/github.com/docker/go-connections/sockets/sockets_windows.go @@ -1,6 +1,7 @@ package sockets import ( + "context" "net" "net/http" "time" @@ -15,8 +16,8 @@ func configureUnixTransport(tr *http.Transport, proto, addr string) error { func configureNpipeTransport(tr *http.Transport, proto, addr string) error { // No need for compression in local communications. tr.DisableCompression = true - tr.Dial = func(_, _ string) (net.Conn, error) { - return DialPipe(addr, defaultTimeout) + tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) { + return winio.DialPipeContext(ctx, addr) } return nil } diff --git a/test/integration/vendor/github.com/docker/go-connections/sockets/unix_socket.go b/test/integration/vendor/github.com/docker/go-connections/sockets/unix_socket.go index a8b5dbb6fd..b9233521e4 100644 --- a/test/integration/vendor/github.com/docker/go-connections/sockets/unix_socket.go +++ b/test/integration/vendor/github.com/docker/go-connections/sockets/unix_socket.go @@ -1,5 +1,51 @@ -// +build !windows +//go:build !windows +/* +Package sockets is a simple unix domain socket wrapper. + +# Usage + +For example: + + import( + "fmt" + "net" + "os" + "github.com/docker/go-connections/sockets" + ) + + func main() { + l, err := sockets.NewUnixSocketWithOpts("/path/to/sockets", + sockets.WithChown(0,0),sockets.WithChmod(0660)) + if err != nil { + panic(err) + } + echoStr := "hello" + + go func() { + for { + conn, err := l.Accept() + if err != nil { + return + } + conn.Write([]byte(echoStr)) + conn.Close() + } + }() + + conn, err := net.Dial("unix", path) + if err != nil { + t.Fatal(err) + } + + buf := make([]byte, 5) + if _, err := conn.Read(buf); err != nil { + panic(err) + } else if string(buf) != echoStr { + panic(fmt.Errorf("msg may lost")) + } + } +*/ package sockets import ( @@ -8,25 +54,73 @@ import ( "syscall" ) -// NewUnixSocket creates a unix socket with the specified path and group. -func NewUnixSocket(path string, gid int) (net.Listener, error) { +// SockOption sets up socket file's creating option +type SockOption func(string) error + +// WithChown modifies the socket file's uid and gid +func WithChown(uid, gid int) SockOption { + return func(path string) error { + if err := os.Chown(path, uid, gid); err != nil { + return err + } + return nil + } +} + +// WithChmod modifies socket file's access mode. +func WithChmod(mask os.FileMode) SockOption { + return func(path string) error { + if err := os.Chmod(path, mask); err != nil { + return err + } + return nil + } +} + +// NewUnixSocketWithOpts creates a unix socket with the specified options. +// By default, socket permissions are 0000 (i.e.: no access for anyone); pass +// WithChmod() and WithChown() to set the desired ownership and permissions. +// +// This function temporarily changes the system's "umask" to 0777 to work around +// a race condition between creating the socket and setting its permissions. While +// this should only be for a short duration, it may affect other processes that +// create files/directories during that period. +func NewUnixSocketWithOpts(path string, opts ...SockOption) (net.Listener, error) { if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { return nil, err } - mask := syscall.Umask(0777) - defer syscall.Umask(mask) + // net.Listen does not allow for permissions to be set. As a result, when + // specifying custom permissions ("WithChmod()"), there is a short time + // between creating the socket and applying the permissions, during which + // the socket permissions are Less restrictive than desired. + // + // To work around this limitation of net.Listen(), we temporarily set the + // umask to 0777, which forces the socket to be created with 000 permissions + // (i.e.: no access for anyone). After that, WithChmod() must be used to set + // the desired permissions. + // + // We don't use "defer" here, to reset the umask to its original value as soon + // as possible. Ideally we'd be able to detect if WithChmod() was passed as + // an option, and skip changing umask if default permissions are used. + origUmask := syscall.Umask(0o777) l, err := net.Listen("unix", path) + syscall.Umask(origUmask) if err != nil { return nil, err } - if err := os.Chown(path, 0, gid); err != nil { - l.Close() - return nil, err - } - if err := os.Chmod(path, 0660); err != nil { - l.Close() - return nil, err + + for _, op := range opts { + if err := op(path); err != nil { + _ = l.Close() + return nil, err + } } + return l, nil } + +// NewUnixSocket creates a unix socket with the specified path and group. +func NewUnixSocket(path string, gid int) (net.Listener, error) { + return NewUnixSocketWithOpts(path, WithChown(0, gid), WithChmod(0o660)) +} diff --git a/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool.go similarity index 95% rename from vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go rename to test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool.go index 1ca0965e06..f84c624ba0 100644 --- a/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go +++ b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool.go @@ -1,5 +1,3 @@ -// +build go1.7 - package tlsconfig import ( diff --git a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go deleted file mode 100644 index 1ca0965e06..0000000000 --- a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build go1.7 - -package tlsconfig - -import ( - "crypto/x509" - "runtime" -) - -// SystemCertPool returns a copy of the system cert pool, -// returns an error if failed to load or empty pool on windows. -func SystemCertPool() (*x509.CertPool, error) { - certpool, err := x509.SystemCertPool() - if err != nil && runtime.GOOS == "windows" { - return x509.NewCertPool(), nil - } - return certpool, err -} diff --git a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go deleted file mode 100644 index 1ff81c333c..0000000000 --- a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go +++ /dev/null @@ -1,13 +0,0 @@ -// +build !go1.7 - -package tlsconfig - -import ( - "crypto/x509" -) - -// SystemCertPool returns an new empty cert pool, -// accessing system cert pool is supported in go 1.7 -func SystemCertPool() (*x509.CertPool, error) { - return x509.NewCertPool(), nil -} diff --git a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config.go index 0ef3fdcb46..606c98a38b 100644 --- a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config.go +++ b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config.go @@ -1,6 +1,7 @@ // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. // // As a reminder from https://golang.org/pkg/crypto/tls/#Config: +// // A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified. // A Config may be reused; the tls package will also not modify it. package tlsconfig @@ -9,11 +10,9 @@ import ( "crypto/tls" "crypto/x509" "encoding/pem" + "errors" "fmt" - "io/ioutil" "os" - - "github.com/pkg/errors" ) // Options represents the information needed to create client and server TLS configurations. @@ -36,7 +35,12 @@ type Options struct { ExclusiveRootPools bool MinVersion uint16 // If Passphrase is set, it will be used to decrypt a TLS private key - // if the key is encrypted + // if the key is encrypted. + // + // Deprecated: Use of encrypted TLS private keys has been deprecated, and + // will be removed in a future release. Golang has deprecated support for + // legacy PEM encryption (as specified in RFC 1423), as it is insecure by + // design (see https://go-review.googlesource.com/c/go/+/264159). Passphrase string } @@ -53,18 +57,9 @@ var acceptedCBCCiphers = []uint16{ // known weak algorithms removed. var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...) -// allTLSVersions lists all the TLS versions and is used by the code that validates -// a uint16 value as a TLS version. -var allTLSVersions = map[uint16]struct{}{ - tls.VersionSSL30: {}, - tls.VersionTLS10: {}, - tls.VersionTLS11: {}, - tls.VersionTLS12: {}, -} - // ServerDefault returns a secure-enough TLS configuration for the server TLS configuration. func ServerDefault(ops ...func(*tls.Config)) *tls.Config { - tlsconfig := &tls.Config{ + tlsConfig := &tls.Config{ // Avoid fallback by default to SSL protocols < TLS1.2 MinVersion: tls.VersionTLS12, PreferServerCipherSuites: true, @@ -72,25 +67,25 @@ func ServerDefault(ops ...func(*tls.Config)) *tls.Config { } for _, op := range ops { - op(tlsconfig) + op(tlsConfig) } - return tlsconfig + return tlsConfig } // ClientDefault returns a secure-enough TLS configuration for the client TLS configuration. func ClientDefault(ops ...func(*tls.Config)) *tls.Config { - tlsconfig := &tls.Config{ + tlsConfig := &tls.Config{ // Prefer TLS1.2 as the client minimum MinVersion: tls.VersionTLS12, CipherSuites: clientCipherSuites, } for _, op := range ops { - op(tlsconfig) + op(tlsConfig) } - return tlsconfig + return tlsConfig } // certPool returns an X.509 certificate pool from `caFile`, the certificate file. @@ -108,16 +103,25 @@ func certPool(caFile string, exclusivePool bool) (*x509.CertPool, error) { return nil, fmt.Errorf("failed to read system certificates: %v", err) } } - pem, err := ioutil.ReadFile(caFile) + pemData, err := os.ReadFile(caFile) if err != nil { return nil, fmt.Errorf("could not read CA certificate %q: %v", caFile, err) } - if !certPool.AppendCertsFromPEM(pem) { + if !certPool.AppendCertsFromPEM(pemData) { return nil, fmt.Errorf("failed to append certificates from PEM file: %q", caFile) } return certPool, nil } +// allTLSVersions lists all the TLS versions and is used by the code that validates +// a uint16 value as a TLS version. +var allTLSVersions = map[uint16]struct{}{ + tls.VersionTLS10: {}, + tls.VersionTLS11: {}, + tls.VersionTLS12: {}, + tls.VersionTLS13: {}, +} + // isValidMinVersion checks that the input value is a valid tls minimum version func isValidMinVersion(version uint16) bool { _, ok := allTLSVersions[version] @@ -129,10 +133,10 @@ func isValidMinVersion(version uint16) bool { func adjustMinVersion(options Options, config *tls.Config) error { if options.MinVersion > 0 { if !isValidMinVersion(options.MinVersion) { - return fmt.Errorf("Invalid minimum TLS version: %x", options.MinVersion) + return fmt.Errorf("invalid minimum TLS version: %x", options.MinVersion) } if options.MinVersion < config.MinVersion { - return fmt.Errorf("Requested minimum TLS version is too low. Should be at-least: %x", config.MinVersion) + return fmt.Errorf("requested minimum TLS version is too low. Should be at-least: %x", config.MinVersion) } config.MinVersion = options.MinVersion } @@ -141,9 +145,14 @@ func adjustMinVersion(options Options, config *tls.Config) error { } // IsErrEncryptedKey returns true if the 'err' is an error of incorrect -// password when tryin to decrypt a TLS private key +// password when trying to decrypt a TLS private key. +// +// Deprecated: Use of encrypted TLS private keys has been deprecated, and +// will be removed in a future release. Golang has deprecated support for +// legacy PEM encryption (as specified in RFC 1423), as it is insecure by +// design (see https://go-review.googlesource.com/c/go/+/264159). func IsErrEncryptedKey(err error) bool { - return errors.Cause(err) == x509.IncorrectPasswordError + return errors.Is(err, x509.IncorrectPasswordError) } // getPrivateKey returns the private key in 'keyBytes', in PEM-encoded format. @@ -157,10 +166,10 @@ func getPrivateKey(keyBytes []byte, passphrase string) ([]byte, error) { } var err error - if x509.IsEncryptedPEMBlock(pemBlock) { - keyBytes, err = x509.DecryptPEMBlock(pemBlock, []byte(passphrase)) + if x509.IsEncryptedPEMBlock(pemBlock) { //nolint:staticcheck // Ignore SA1019 (IsEncryptedPEMBlock is deprecated) + keyBytes, err = x509.DecryptPEMBlock(pemBlock, []byte(passphrase)) //nolint:staticcheck // Ignore SA1019 (DecryptPEMBlock is deprecated) if err != nil { - return nil, errors.Wrap(err, "private key is encrypted, but could not decrypt it") + return nil, fmt.Errorf("private key is encrypted, but could not decrypt it: %w", err) } keyBytes = pem.EncodeToMemory(&pem.Block{Type: pemBlock.Type, Bytes: keyBytes}) } @@ -176,26 +185,24 @@ func getCert(options Options) ([]tls.Certificate, error) { return nil, nil } - errMessage := "Could not load X509 key pair" - - cert, err := ioutil.ReadFile(options.CertFile) + cert, err := os.ReadFile(options.CertFile) if err != nil { - return nil, errors.Wrap(err, errMessage) + return nil, err } - prKeyBytes, err := ioutil.ReadFile(options.KeyFile) + prKeyBytes, err := os.ReadFile(options.KeyFile) if err != nil { - return nil, errors.Wrap(err, errMessage) + return nil, err } prKeyBytes, err = getPrivateKey(prKeyBytes, options.Passphrase) if err != nil { - return nil, errors.Wrap(err, errMessage) + return nil, err } tlsCert, err := tls.X509KeyPair(cert, prKeyBytes) if err != nil { - return nil, errors.Wrap(err, errMessage) + return nil, err } return []tls.Certificate{tlsCert}, nil @@ -215,7 +222,7 @@ func Client(options Options) (*tls.Config, error) { tlsCerts, err := getCert(options) if err != nil { - return nil, err + return nil, fmt.Errorf("could not load X509 key pair: %w", err) } tlsConfig.Certificates = tlsCerts @@ -233,9 +240,9 @@ func Server(options Options) (*tls.Config, error) { tlsCert, err := tls.LoadX509KeyPair(options.CertFile, options.KeyFile) if err != nil { if os.IsNotExist(err) { - return nil, fmt.Errorf("Could not load X509 key pair (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) + return nil, fmt.Errorf("could not load X509 key pair (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) } - return nil, fmt.Errorf("Error reading X509 key pair (cert: %q, key: %q): %v. Make sure the key is not encrypted.", options.CertFile, options.KeyFile, err) + return nil, fmt.Errorf("error reading X509 key pair - make sure the key is not encrypted (cert: %q, key: %q): %v", options.CertFile, options.KeyFile, err) } tlsConfig.Certificates = []tls.Certificate{tlsCert} if options.ClientAuth >= tls.VerifyClientCertIfGiven && options.CAFile != "" { diff --git a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go index 6b4c6a7c0d..a82f9fa52e 100644 --- a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go +++ b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go @@ -1,7 +1,4 @@ -// +build go1.5 - // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. -// package tlsconfig import ( diff --git a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go b/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go deleted file mode 100644 index ee22df47cb..0000000000 --- a/test/integration/vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go +++ /dev/null @@ -1,15 +0,0 @@ -// +build !go1.5 - -// Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. -// -package tlsconfig - -import ( - "crypto/tls" -) - -// Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) -var clientCipherSuites = []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, -} diff --git a/test/integration/vendor/github.com/klauspost/compress/README.md b/test/integration/vendor/github.com/klauspost/compress/README.md index 7e83f583c0..c918f11d8b 100644 --- a/test/integration/vendor/github.com/klauspost/compress/README.md +++ b/test/integration/vendor/github.com/klauspost/compress/README.md @@ -16,6 +16,18 @@ This package provides various compression algorithms. # changelog +* Dec 1st, 2023 - [v1.17.4](https://github.com/klauspost/compress/releases/tag/v1.17.4) + * huff0: Speed up symbol counting by @greatroar in https://github.com/klauspost/compress/pull/887 + * huff0: Remove byteReader by @greatroar in https://github.com/klauspost/compress/pull/886 + * gzhttp: Allow overriding decompression on transport https://github.com/klauspost/compress/pull/892 + * gzhttp: Clamp compression level https://github.com/klauspost/compress/pull/890 + * gzip: Error out if reserved bits are set https://github.com/klauspost/compress/pull/891 + +* Nov 15th, 2023 - [v1.17.3](https://github.com/klauspost/compress/releases/tag/v1.17.3) + * fse: Fix max header size https://github.com/klauspost/compress/pull/881 + * zstd: Improve better/best compression https://github.com/klauspost/compress/pull/877 + * gzhttp: Fix missing content type on Close https://github.com/klauspost/compress/pull/883 + * Oct 22nd, 2023 - [v1.17.2](https://github.com/klauspost/compress/releases/tag/v1.17.2) * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 @@ -554,7 +566,7 @@ For direct deflate use, NewStatelessWriter and StatelessDeflate are available. S A `bufio.Writer` can of course be used to control write sizes. For example, to use a 4KB buffer: -``` +```go // replace 'ioutil.Discard' with your output. gzw, err := gzip.NewWriterLevel(ioutil.Discard, gzip.StatelessCompression) if err != nil { diff --git a/test/integration/vendor/github.com/klauspost/compress/s2sx.mod b/test/integration/vendor/github.com/klauspost/compress/s2sx.mod index 2263853fca..5a4412f907 100644 --- a/test/integration/vendor/github.com/klauspost/compress/s2sx.mod +++ b/test/integration/vendor/github.com/klauspost/compress/s2sx.mod @@ -1,4 +1,4 @@ module github.com/klauspost/compress -go 1.16 +go 1.19 diff --git a/test/integration/vendor/github.com/klauspost/compress/zstd/decodeheader.go b/test/integration/vendor/github.com/klauspost/compress/zstd/decodeheader.go index f6a240970d..6a5a2988b6 100644 --- a/test/integration/vendor/github.com/klauspost/compress/zstd/decodeheader.go +++ b/test/integration/vendor/github.com/klauspost/compress/zstd/decodeheader.go @@ -95,42 +95,54 @@ type Header struct { // If there isn't enough input, io.ErrUnexpectedEOF is returned. // The FirstBlock.OK will indicate if enough information was available to decode the first block header. func (h *Header) Decode(in []byte) error { + _, err := h.DecodeAndStrip(in) + return err +} + +// DecodeAndStrip will decode the header from the beginning of the stream +// and on success return the remaining bytes. +// This will decode the frame header and the first block header if enough bytes are provided. +// It is recommended to provide at least HeaderMaxSize bytes. +// If the frame header cannot be read an error will be returned. +// If there isn't enough input, io.ErrUnexpectedEOF is returned. +// The FirstBlock.OK will indicate if enough information was available to decode the first block header. +func (h *Header) DecodeAndStrip(in []byte) (remain []byte, err error) { *h = Header{} if len(in) < 4 { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } h.HeaderSize += 4 b, in := in[:4], in[4:] if string(b) != frameMagic { if string(b[1:4]) != skippableFrameMagic || b[0]&0xf0 != 0x50 { - return ErrMagicMismatch + return nil, ErrMagicMismatch } if len(in) < 4 { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } h.HeaderSize += 4 h.Skippable = true h.SkippableID = int(b[0] & 0xf) h.SkippableSize = binary.LittleEndian.Uint32(in) - return nil + return in[4:], nil } // Read Window_Descriptor // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor if len(in) < 1 { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } fhd, in := in[0], in[1:] h.HeaderSize++ h.SingleSegment = fhd&(1<<5) != 0 h.HasCheckSum = fhd&(1<<2) != 0 if fhd&(1<<3) != 0 { - return errors.New("reserved bit set on frame header") + return nil, errors.New("reserved bit set on frame header") } if !h.SingleSegment { if len(in) < 1 { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } var wd byte wd, in = in[0], in[1:] @@ -148,7 +160,7 @@ func (h *Header) Decode(in []byte) error { size = 4 } if len(in) < int(size) { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } b, in = in[:size], in[size:] h.HeaderSize += int(size) @@ -178,7 +190,7 @@ func (h *Header) Decode(in []byte) error { if fcsSize > 0 { h.HasFCS = true if len(in) < fcsSize { - return io.ErrUnexpectedEOF + return nil, io.ErrUnexpectedEOF } b, in = in[:fcsSize], in[fcsSize:] h.HeaderSize += int(fcsSize) @@ -199,7 +211,7 @@ func (h *Header) Decode(in []byte) error { // Frame Header done, we will not fail from now on. if len(in) < 3 { - return nil + return in, nil } tmp := in[:3] bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16) @@ -209,7 +221,7 @@ func (h *Header) Decode(in []byte) error { cSize := int(bh >> 3) switch blockType { case blockTypeReserved: - return nil + return in, nil case blockTypeRLE: h.FirstBlock.Compressed = true h.FirstBlock.DecompressedSize = cSize @@ -225,5 +237,25 @@ func (h *Header) Decode(in []byte) error { } h.FirstBlock.OK = true - return nil + return in, nil +} + +// AppendTo will append the encoded header to the dst slice. +// There is no error checking performed on the header values. +func (h *Header) AppendTo(dst []byte) ([]byte, error) { + if h.Skippable { + magic := [4]byte{0x50, 0x2a, 0x4d, 0x18} + magic[0] |= byte(h.SkippableID & 0xf) + dst = append(dst, magic[:]...) + f := h.SkippableSize + return append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24)), nil + } + f := frameHeader{ + ContentSize: h.FrameContentSize, + WindowSize: uint32(h.WindowSize), + SingleSegment: h.SingleSegment, + Checksum: h.HasCheckSum, + DictID: h.DictionaryID, + } + return f.appendTo(dst), nil } diff --git a/test/integration/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/test/integration/vendor/github.com/klauspost/compress/zstd/encoder_options.go index faaf81921c..20671dcb91 100644 --- a/test/integration/vendor/github.com/klauspost/compress/zstd/encoder_options.go +++ b/test/integration/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -94,7 +94,7 @@ func WithEncoderConcurrency(n int) EOption { // The value must be a power of two between MinWindowSize and MaxWindowSize. // A larger value will enable better compression but allocate more memory and, // for above-default values, take considerably longer. -// The default value is determined by the compression level. +// The default value is determined by the compression level and max 8MB. func WithWindowSize(n int) EOption { return func(o *encoderOptions) error { switch { @@ -232,9 +232,9 @@ func WithEncoderLevel(l EncoderLevel) EOption { case SpeedDefault: o.windowSize = 8 << 20 case SpeedBetterCompression: - o.windowSize = 16 << 20 + o.windowSize = 8 << 20 case SpeedBestCompression: - o.windowSize = 32 << 20 + o.windowSize = 8 << 20 } } if !o.customALEntropy { diff --git a/test/integration/vendor/github.com/klauspost/compress/zstd/frameenc.go b/test/integration/vendor/github.com/klauspost/compress/zstd/frameenc.go index 2f5d5ed454..667ca06794 100644 --- a/test/integration/vendor/github.com/klauspost/compress/zstd/frameenc.go +++ b/test/integration/vendor/github.com/klauspost/compress/zstd/frameenc.go @@ -76,7 +76,7 @@ func (f frameHeader) appendTo(dst []byte) []byte { if f.SingleSegment { dst = append(dst, uint8(f.ContentSize)) } - // Unless SingleSegment is set, framessizes < 256 are nto stored. + // Unless SingleSegment is set, framessizes < 256 are not stored. case 1: f.ContentSize -= 256 dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8)) diff --git a/test/integration/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go b/test/integration/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go index 332e51fe44..8adfebb029 100644 --- a/test/integration/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go +++ b/test/integration/vendor/github.com/klauspost/compress/zstd/fse_decoder_generic.go @@ -20,10 +20,9 @@ func (s *fseDecoder) buildDtable() error { if v == -1 { s.dt[highThreshold].setAddBits(uint8(i)) highThreshold-- - symbolNext[i] = 1 - } else { - symbolNext[i] = uint16(v) + v = 1 } + symbolNext[i] = uint16(v) } } @@ -35,10 +34,12 @@ func (s *fseDecoder) buildDtable() error { for ss, v := range s.norm[:s.symbolLen] { for i := 0; i < int(v); i++ { s.dt[position].setAddBits(uint8(ss)) - position = (position + step) & tableMask - for position > highThreshold { + for { // lowprob area position = (position + step) & tableMask + if position <= highThreshold { + break + } } } } diff --git a/test/integration/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s b/test/integration/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s index 974b99725f..5b06174b89 100644 --- a/test/integration/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s +++ b/test/integration/vendor/github.com/klauspost/compress/zstd/seqdec_amd64.s @@ -157,8 +157,7 @@ sequenceDecs_decode_amd64_ll_update_zero: // Update Literal Length State MOVBQZX DI, R14 - SHRQ $0x10, DI - MOVWQZX DI, DI + SHRL $0x10, DI LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -177,8 +176,7 @@ sequenceDecs_decode_amd64_ll_update_zero: // Update Match Length State MOVBQZX R8, R14 - SHRQ $0x10, R8 - MOVWQZX R8, R8 + SHRL $0x10, R8 LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -197,8 +195,7 @@ sequenceDecs_decode_amd64_ll_update_zero: // Update Offset State MOVBQZX R9, R14 - SHRQ $0x10, R9 - MOVWQZX R9, R9 + SHRL $0x10, R9 LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -459,8 +456,7 @@ sequenceDecs_decode_56_amd64_ll_update_zero: // Update Literal Length State MOVBQZX DI, R14 - SHRQ $0x10, DI - MOVWQZX DI, DI + SHRL $0x10, DI LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -479,8 +475,7 @@ sequenceDecs_decode_56_amd64_ll_update_zero: // Update Match Length State MOVBQZX R8, R14 - SHRQ $0x10, R8 - MOVWQZX R8, R8 + SHRL $0x10, R8 LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -499,8 +494,7 @@ sequenceDecs_decode_56_amd64_ll_update_zero: // Update Offset State MOVBQZX R9, R14 - SHRQ $0x10, R9 - MOVWQZX R9, R9 + SHRL $0x10, R9 LEAQ (BX)(R14*1), CX MOVQ DX, R15 MOVQ CX, BX @@ -772,11 +766,10 @@ sequenceDecs_decode_bmi2_fill_2_end: BZHIQ R14, R15, R15 // Update Offset State - BZHIQ R8, R15, CX - SHRXQ R8, R15, R15 - MOVQ $0x00001010, R14 - BEXTRQ R14, R8, R8 - ADDQ CX, R8 + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + SHRL $0x10, R8 + ADDQ CX, R8 // Load ctx.ofTable MOVQ ctx+16(FP), CX @@ -784,11 +777,10 @@ sequenceDecs_decode_bmi2_fill_2_end: MOVQ (CX)(R8*8), R8 // Update Match Length State - BZHIQ DI, R15, CX - SHRXQ DI, R15, R15 - MOVQ $0x00001010, R14 - BEXTRQ R14, DI, DI - ADDQ CX, DI + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + SHRL $0x10, DI + ADDQ CX, DI // Load ctx.mlTable MOVQ ctx+16(FP), CX @@ -796,10 +788,9 @@ sequenceDecs_decode_bmi2_fill_2_end: MOVQ (CX)(DI*8), DI // Update Literal Length State - BZHIQ SI, R15, CX - MOVQ $0x00001010, R14 - BEXTRQ R14, SI, SI - ADDQ CX, SI + BZHIQ SI, R15, CX + SHRL $0x10, SI + ADDQ CX, SI // Load ctx.llTable MOVQ ctx+16(FP), CX @@ -1032,11 +1023,10 @@ sequenceDecs_decode_56_bmi2_fill_end: BZHIQ R14, R15, R15 // Update Offset State - BZHIQ R8, R15, CX - SHRXQ R8, R15, R15 - MOVQ $0x00001010, R14 - BEXTRQ R14, R8, R8 - ADDQ CX, R8 + BZHIQ R8, R15, CX + SHRXQ R8, R15, R15 + SHRL $0x10, R8 + ADDQ CX, R8 // Load ctx.ofTable MOVQ ctx+16(FP), CX @@ -1044,11 +1034,10 @@ sequenceDecs_decode_56_bmi2_fill_end: MOVQ (CX)(R8*8), R8 // Update Match Length State - BZHIQ DI, R15, CX - SHRXQ DI, R15, R15 - MOVQ $0x00001010, R14 - BEXTRQ R14, DI, DI - ADDQ CX, DI + BZHIQ DI, R15, CX + SHRXQ DI, R15, R15 + SHRL $0x10, DI + ADDQ CX, DI // Load ctx.mlTable MOVQ ctx+16(FP), CX @@ -1056,10 +1045,9 @@ sequenceDecs_decode_56_bmi2_fill_end: MOVQ (CX)(DI*8), DI // Update Literal Length State - BZHIQ SI, R15, CX - MOVQ $0x00001010, R14 - BEXTRQ R14, SI, SI - ADDQ CX, SI + BZHIQ SI, R15, CX + SHRL $0x10, SI + ADDQ CX, SI // Load ctx.llTable MOVQ ctx+16(FP), CX @@ -1967,8 +1955,7 @@ sequenceDecs_decodeSync_amd64_ll_update_zero: // Update Literal Length State MOVBQZX DI, R13 - SHRQ $0x10, DI - MOVWQZX DI, DI + SHRL $0x10, DI LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -1987,8 +1974,7 @@ sequenceDecs_decodeSync_amd64_ll_update_zero: // Update Match Length State MOVBQZX R8, R13 - SHRQ $0x10, R8 - MOVWQZX R8, R8 + SHRL $0x10, R8 LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -2007,8 +1993,7 @@ sequenceDecs_decodeSync_amd64_ll_update_zero: // Update Offset State MOVBQZX R9, R13 - SHRQ $0x10, R9 - MOVWQZX R9, R9 + SHRL $0x10, R9 LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -2514,11 +2499,10 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: BZHIQ R13, R14, R14 // Update Offset State - BZHIQ R8, R14, CX - SHRXQ R8, R14, R14 - MOVQ $0x00001010, R13 - BEXTRQ R13, R8, R8 - ADDQ CX, R8 + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + SHRL $0x10, R8 + ADDQ CX, R8 // Load ctx.ofTable MOVQ ctx+16(FP), CX @@ -2526,11 +2510,10 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: MOVQ (CX)(R8*8), R8 // Update Match Length State - BZHIQ DI, R14, CX - SHRXQ DI, R14, R14 - MOVQ $0x00001010, R13 - BEXTRQ R13, DI, DI - ADDQ CX, DI + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + SHRL $0x10, DI + ADDQ CX, DI // Load ctx.mlTable MOVQ ctx+16(FP), CX @@ -2538,10 +2521,9 @@ sequenceDecs_decodeSync_bmi2_fill_2_end: MOVQ (CX)(DI*8), DI // Update Literal Length State - BZHIQ SI, R14, CX - MOVQ $0x00001010, R13 - BEXTRQ R13, SI, SI - ADDQ CX, SI + BZHIQ SI, R14, CX + SHRL $0x10, SI + ADDQ CX, SI // Load ctx.llTable MOVQ ctx+16(FP), CX @@ -3055,8 +3037,7 @@ sequenceDecs_decodeSync_safe_amd64_ll_update_zero: // Update Literal Length State MOVBQZX DI, R13 - SHRQ $0x10, DI - MOVWQZX DI, DI + SHRL $0x10, DI LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -3075,8 +3056,7 @@ sequenceDecs_decodeSync_safe_amd64_ll_update_zero: // Update Match Length State MOVBQZX R8, R13 - SHRQ $0x10, R8 - MOVWQZX R8, R8 + SHRL $0x10, R8 LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -3095,8 +3075,7 @@ sequenceDecs_decodeSync_safe_amd64_ll_update_zero: // Update Offset State MOVBQZX R9, R13 - SHRQ $0x10, R9 - MOVWQZX R9, R9 + SHRL $0x10, R9 LEAQ (BX)(R13*1), CX MOVQ DX, R14 MOVQ CX, BX @@ -3704,11 +3683,10 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: BZHIQ R13, R14, R14 // Update Offset State - BZHIQ R8, R14, CX - SHRXQ R8, R14, R14 - MOVQ $0x00001010, R13 - BEXTRQ R13, R8, R8 - ADDQ CX, R8 + BZHIQ R8, R14, CX + SHRXQ R8, R14, R14 + SHRL $0x10, R8 + ADDQ CX, R8 // Load ctx.ofTable MOVQ ctx+16(FP), CX @@ -3716,11 +3694,10 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: MOVQ (CX)(R8*8), R8 // Update Match Length State - BZHIQ DI, R14, CX - SHRXQ DI, R14, R14 - MOVQ $0x00001010, R13 - BEXTRQ R13, DI, DI - ADDQ CX, DI + BZHIQ DI, R14, CX + SHRXQ DI, R14, R14 + SHRL $0x10, DI + ADDQ CX, DI // Load ctx.mlTable MOVQ ctx+16(FP), CX @@ -3728,10 +3705,9 @@ sequenceDecs_decodeSync_safe_bmi2_fill_2_end: MOVQ (CX)(DI*8), DI // Update Literal Length State - BZHIQ SI, R14, CX - MOVQ $0x00001010, R13 - BEXTRQ R13, SI, SI - ADDQ CX, SI + BZHIQ SI, R14, CX + SHRL $0x10, SI + ADDQ CX, SI // Load ctx.llTable MOVQ ctx+16(FP), CX diff --git a/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile b/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile index d47379b42c..5a88d94ab6 100644 --- a/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile +++ b/test/integration/vendor/github.com/nginx/agent/sdk/v2/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go index 9a8260059d..af84f0e4bb 100644 --- a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go +++ b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/handler.go @@ -26,7 +26,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + semconv "go.opentelemetry.io/otel/semconv/v1.20.0" "go.opentelemetry.io/otel/trace" ) @@ -43,10 +43,12 @@ type middleware struct { writeEvent bool filters []Filter spanNameFormatter func(string, *http.Request) string - counters map[string]metric.Int64Counter - valueRecorders map[string]metric.Float64Histogram publicEndpoint bool publicEndpointFn func(*http.Request) bool + + requestBytesCounter metric.Int64Counter + responseBytesCounter metric.Int64Counter + serverLatencyMeasure metric.Float64Histogram } func defaultHandlerFormatter(operation string, _ *http.Request) string { @@ -104,33 +106,27 @@ func handleErr(err error) { } func (h *middleware) createMeasures() { - h.counters = make(map[string]metric.Int64Counter) - h.valueRecorders = make(map[string]metric.Float64Histogram) - - requestBytesCounter, err := h.meter.Int64Counter( + var err error + h.requestBytesCounter, err = h.meter.Int64Counter( RequestContentLength, metric.WithUnit("By"), metric.WithDescription("Measures the size of HTTP request content length (uncompressed)"), ) handleErr(err) - responseBytesCounter, err := h.meter.Int64Counter( + h.responseBytesCounter, err = h.meter.Int64Counter( ResponseContentLength, metric.WithUnit("By"), metric.WithDescription("Measures the size of HTTP response content length (uncompressed)"), ) handleErr(err) - serverLatencyMeasure, err := h.meter.Float64Histogram( + h.serverLatencyMeasure, err = h.meter.Float64Histogram( ServerLatency, metric.WithUnit("ms"), metric.WithDescription("Measures the duration of HTTP request handling"), ) handleErr(err) - - h.counters[RequestContentLength] = requestBytesCounter - h.counters[ResponseContentLength] = responseBytesCounter - h.valueRecorders[ServerLatency] = serverLatencyMeasure } // serveHTTP sets up tracing and calls the given next http.Handler with the span @@ -236,13 +232,13 @@ func (h *middleware) serveHTTP(w http.ResponseWriter, r *http.Request, next http attributes = append(attributes, semconv.HTTPStatusCode(rww.statusCode)) } o := metric.WithAttributes(attributes...) - h.counters[RequestContentLength].Add(ctx, bw.read, o) - h.counters[ResponseContentLength].Add(ctx, rww.written, o) + h.requestBytesCounter.Add(ctx, bw.read, o) + h.responseBytesCounter.Add(ctx, rww.written, o) // Use floating point division here for higher precision (instead of Millisecond method). elapsedTime := float64(time.Since(requestStartTime)) / float64(time.Millisecond) - h.valueRecorders[ServerLatency].Record(ctx, elapsedTime, o) + h.serverLatencyMeasure.Record(ctx, elapsedTime, o) } func setAfterServeAttributes(span trace.Span, read, wrote int64, statusCode int, rerr, werr error) { diff --git a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go index d3dede9ebb..794d4c26a4 100644 --- a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go +++ b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/httpconv.go @@ -24,7 +24,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + semconv "go.opentelemetry.io/otel/semconv/v1.20.0" ) // HTTPClientResponse returns trace attributes for an HTTP response received by a @@ -149,9 +149,7 @@ func HTTPResponseHeader(h http.Header) []attribute.KeyValue { type httpConv struct { NetConv *netConv - EnduserIDKey attribute.Key HTTPClientIPKey attribute.Key - HTTPFlavorKey attribute.Key HTTPMethodKey attribute.Key HTTPRequestContentLengthKey attribute.Key HTTPResponseContentLengthKey attribute.Key @@ -161,15 +159,13 @@ type httpConv struct { HTTPStatusCodeKey attribute.Key HTTPTargetKey attribute.Key HTTPURLKey attribute.Key - HTTPUserAgentKey attribute.Key + UserAgentOriginalKey attribute.Key } var hc = &httpConv{ NetConv: nc, - EnduserIDKey: semconv.EnduserIDKey, HTTPClientIPKey: semconv.HTTPClientIPKey, - HTTPFlavorKey: semconv.HTTPFlavorKey, HTTPMethodKey: semconv.HTTPMethodKey, HTTPRequestContentLengthKey: semconv.HTTPRequestContentLengthKey, HTTPResponseContentLengthKey: semconv.HTTPResponseContentLengthKey, @@ -179,7 +175,7 @@ var hc = &httpConv{ HTTPStatusCodeKey: semconv.HTTPStatusCodeKey, HTTPTargetKey: semconv.HTTPTargetKey, HTTPURLKey: semconv.HTTPURLKey, - HTTPUserAgentKey: semconv.HTTPUserAgentKey, + UserAgentOriginalKey: semconv.UserAgentOriginalKey, } // ClientResponse returns attributes for an HTTP response received by a client @@ -193,6 +189,10 @@ var hc = &httpConv{ // // append(ClientResponse(resp), ClientRequest(resp.Request)...) func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue { + /* The following semantic conventions are returned if present: + http.status_code int + http.response_content_length int + */ var n int if resp.StatusCode > 0 { n++ @@ -212,11 +212,31 @@ func (c *httpConv) ClientResponse(resp *http.Response) []attribute.KeyValue { } // ClientRequest returns attributes for an HTTP request made by a client. The -// following attributes are always returned: "http.url", "http.flavor", -// "http.method", "net.peer.name". The following attributes are returned if the -// related values are defined in req: "net.peer.port", "http.user_agent", -// "http.request_content_length", "enduser.id". +// following attributes are always returned: "http.url", "http.method", +// "net.peer.name". The following attributes are returned if the related values +// are defined in req: "net.peer.port", "http.user_agent", +// "http.request_content_length", "user_agent.original". func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue { + /* The following semantic conventions are returned if present: + http.method string + user_agent.original string + http.url string + net.peer.name string + net.peer.port int + http.request_content_length int + */ + + /* The following semantic conventions are not returned: + http.status_code This requires the response. See ClientResponse. + http.response_content_length This requires the response. See ClientResponse. + net.sock.family This requires the socket used. + net.sock.peer.addr This requires the socket used. + net.sock.peer.name This requires the socket used. + net.sock.peer.port This requires the socket used. + http.resend_count This is something outside of a single request. + net.protocol.name The value is the Request is ignored, and the go client will always use "http". + net.protocol.version The value in the Request is ignored, and the go client will always use 1.1 or 2.0. + */ n := 3 // URL, peer name, proto, and method. var h string if req.URL != nil { @@ -234,14 +254,10 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue { if req.ContentLength > 0 { n++ } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } + attrs := make([]attribute.KeyValue, 0, n) attrs = append(attrs, c.method(req.Method)) - attrs = append(attrs, c.flavor(req.Proto)) var u string if req.URL != nil { @@ -260,17 +276,13 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue { } if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) + attrs = append(attrs, c.UserAgentOriginalKey.String(useragent)) } if l := req.ContentLength; l > 0 { attrs = append(attrs, c.HTTPRequestContentLengthKey.Int64(l)) } - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) - } - return attrs } @@ -291,18 +303,35 @@ func (c *httpConv) ClientRequest(req *http.Request) []attribute.KeyValue { // The req Host will be used to determine the server instead. // // The following attributes are always returned: "http.method", "http.scheme", -// "http.flavor", "http.target", "net.host.name". The following attributes are -// returned if they related values are defined in req: "net.host.port", -// "net.sock.peer.addr", "net.sock.peer.port", "http.user_agent", "enduser.id", -// "http.client_ip". +// "http.target", "net.host.name". The following attributes are returned if they +// related values are defined in req: "net.host.port", "net.sock.peer.addr", +// "net.sock.peer.port", "user_agent.original", "http.client_ip", +// "net.protocol.name", "net.protocol.version". func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.KeyValue { - // TODO: This currently does not add the specification required - // `http.target` attribute. It has too high of a cardinality to safely be - // added. An alternate should be added, or this comment removed, when it is - // addressed by the specification. If it is ultimately decided to continue - // not including the attribute, the HTTPTargetKey field of the httpConv - // should be removed as well. - + /* The following semantic conventions are returned if present: + http.method string + http.scheme string + net.host.name string + net.host.port int + net.sock.peer.addr string + net.sock.peer.port int + user_agent.original string + http.client_ip string + net.protocol.name string Note: not set if the value is "http". + net.protocol.version string + http.target string Note: doesn't include the query parameter. + */ + + /* The following semantic conventions are not returned: + http.status_code This requires the response. + http.request_content_length This requires the len() of body, which can mutate it. + http.response_content_length This requires the response. + http.route This is not available. + net.sock.peer.name This would require a DNS lookup. + net.sock.host.addr The request doesn't have access to the underlying socket. + net.sock.host.port The request doesn't have access to the underlying socket. + + */ n := 4 // Method, scheme, proto, and host name. var host string var p int @@ -330,19 +359,31 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K if useragent != "" { n++ } - userID, _, hasUserID := req.BasicAuth() - if hasUserID { - n++ - } + clientIP := serverClientIP(req.Header.Get("X-Forwarded-For")) if clientIP != "" { n++ } + + var target string + if req.URL != nil { + target = req.URL.Path + if target != "" { + n++ + } + } + protoName, protoVersion := netProtocol(req.Proto) + if protoName != "" && protoName != "http" { + n++ + } + if protoVersion != "" { + n++ + } + attrs := make([]attribute.KeyValue, 0, n) attrs = append(attrs, c.method(req.Method)) attrs = append(attrs, c.scheme(req.TLS != nil)) - attrs = append(attrs, c.flavor(req.Proto)) attrs = append(attrs, c.NetConv.HostName(host)) if hostPort > 0 { @@ -359,17 +400,24 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K } if useragent != "" { - attrs = append(attrs, c.HTTPUserAgentKey.String(useragent)) - } - - if hasUserID { - attrs = append(attrs, c.EnduserIDKey.String(userID)) + attrs = append(attrs, c.UserAgentOriginalKey.String(useragent)) } if clientIP != "" { attrs = append(attrs, c.HTTPClientIPKey.String(clientIP)) } + if target != "" { + attrs = append(attrs, c.HTTPTargetKey.String(target)) + } + + if protoName != "" && protoName != "http" { + attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName)) + } + if protoVersion != "" { + attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion)) + } + return attrs } @@ -394,14 +442,18 @@ func (c *httpConv) ServerRequest(server string, req *http.Request) []attribute.K // "http.flavor", "net.host.name". The following attributes are // returned if they related values are defined in req: "net.host.port". func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attribute.KeyValue { - // TODO: This currently does not add the specification required - // `http.target` attribute. It has too high of a cardinality to safely be - // added. An alternate should be added, or this comment removed, when it is - // addressed by the specification. If it is ultimately decided to continue - // not including the attribute, the HTTPTargetKey field of the httpConv - // should be removed as well. - - n := 4 // Method, scheme, proto, and host name. + /* The following semantic conventions are returned if present: + http.scheme string + http.route string + http.method string + http.status_code int + net.host.name string + net.host.port int + net.protocol.name string Note: not set if the value is "http". + net.protocol.version string + */ + + n := 3 // Method, scheme, and host name. var host string var p int if server == "" { @@ -417,16 +469,29 @@ func (c *httpConv) ServerRequestMetrics(server string, req *http.Request) []attr if hostPort > 0 { n++ } + protoName, protoVersion := netProtocol(req.Proto) + if protoName != "" { + n++ + } + if protoVersion != "" { + n++ + } + attrs := make([]attribute.KeyValue, 0, n) attrs = append(attrs, c.methodMetric(req.Method)) attrs = append(attrs, c.scheme(req.TLS != nil)) - attrs = append(attrs, c.flavor(req.Proto)) attrs = append(attrs, c.NetConv.HostName(host)) if hostPort > 0 { attrs = append(attrs, c.NetConv.HostPort(hostPort)) } + if protoName != "" { + attrs = append(attrs, c.NetConv.NetProtocolName.String(protoName)) + } + if protoVersion != "" { + attrs = append(attrs, c.NetConv.NetProtocolVersion.String(protoVersion)) + } return attrs } @@ -455,21 +520,6 @@ func (c *httpConv) scheme(https bool) attribute.KeyValue { // nolint:revive return c.HTTPSchemeHTTP } -func (c *httpConv) flavor(proto string) attribute.KeyValue { - switch proto { - case "HTTP/1.0": - return c.HTTPFlavorKey.String("1.0") - case "HTTP/1.1": - return c.HTTPFlavorKey.String("1.1") - case "HTTP/2": - return c.HTTPFlavorKey.String("2.0") - case "HTTP/3": - return c.HTTPFlavorKey.String("3.0") - default: - return c.HTTPFlavorKey.String(proto) - } -} - func serverClientIP(xForwardedFor string) string { if idx := strings.Index(xForwardedFor, ","); idx >= 0 { xForwardedFor = xForwardedFor[:idx] diff --git a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go index bde8893437..cb4cb9355d 100644 --- a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go +++ b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil/netconv.go @@ -22,7 +22,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.17.0" + semconv "go.opentelemetry.io/otel/semconv/v1.20.0" ) // NetTransport returns a trace attribute describing the transport protocol of the @@ -57,6 +57,8 @@ type netConv struct { NetHostPortKey attribute.Key NetPeerNameKey attribute.Key NetPeerPortKey attribute.Key + NetProtocolName attribute.Key + NetProtocolVersion attribute.Key NetSockFamilyKey attribute.Key NetSockPeerAddrKey attribute.Key NetSockPeerPortKey attribute.Key @@ -73,6 +75,8 @@ var nc = &netConv{ NetHostPortKey: semconv.NetHostPortKey, NetPeerNameKey: semconv.NetPeerNameKey, NetPeerPortKey: semconv.NetPeerPortKey, + NetProtocolName: semconv.NetProtocolNameKey, + NetProtocolVersion: semconv.NetProtocolVersionKey, NetSockFamilyKey: semconv.NetSockFamilyKey, NetSockPeerAddrKey: semconv.NetSockPeerAddrKey, NetSockPeerPortKey: semconv.NetSockPeerPortKey, @@ -366,3 +370,9 @@ func splitHostPort(hostport string) (host string, port int) { } return host, int(p) } + +func netProtocol(proto string) (name string, version string) { + name, version, _ = strings.Cut(proto, "/") + name = strings.ToLower(name) + return name, version +} diff --git a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go index bd41c18042..9a4a02143d 100644 --- a/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go +++ b/test/integration/vendor/go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/version.go @@ -16,7 +16,7 @@ package otelhttp // import "go.opentelemetry.io/contrib/instrumentation/net/http // Version is the current release version of the otelhttp instrumentation. func Version() string { - return "0.46.1" + return "0.47.0" // This string is updated by the pre_release.sh script during release } diff --git a/test/integration/vendor/go.opentelemetry.io/otel/CHANGELOG.md b/test/integration/vendor/go.opentelemetry.io/otel/CHANGELOG.md index 24874f856e..fe670d79cc 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/CHANGELOG.md +++ b/test/integration/vendor/go.opentelemetry.io/otel/CHANGELOG.md @@ -8,6 +8,46 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +## [1.22.0/0.45.0] 2024-01-17 + +### Added + +- The `go.opentelemetry.io/otel/semconv/v1.22.0` package. + The package contains semantic conventions from the `v1.22.0` version of the OpenTelemetry Semantic Conventions. (#4735) +- The `go.opentelemetry.io/otel/semconv/v1.23.0` package. + The package contains semantic conventions from the `v1.23.0` version of the OpenTelemetry Semantic Conventions. (#4746) +- The `go.opentelemetry.io/otel/semconv/v1.23.1` package. + The package contains semantic conventions from the `v1.23.1` version of the OpenTelemetry Semantic Conventions. (#4749) +- The `go.opentelemetry.io/otel/semconv/v1.24.0` package. + The package contains semantic conventions from the `v1.24.0` version of the OpenTelemetry Semantic Conventions. (#4770) +- Add `WithResourceAsConstantLabels` option to apply resource attributes for every metric emitted by the Prometheus exporter. (#4733) +- Experimental cardinality limiting is added to the metric SDK. + See [metric documentation](./sdk/metric/EXPERIMENTAL.md#cardinality-limit) for more information about this feature and how to enable it. (#4457) +- Add `NewMemberRaw` and `NewKeyValuePropertyRaw` in `go.opentelemetry.io/otel/baggage`. (#4804) + +### Changed + +- Upgrade all use of `go.opentelemetry.io/otel/semconv` to use `v1.24.0`. (#4754) +- Update transformations in `go.opentelemetry.io/otel/exporters/zipkin` to follow `v1.19.0` version of the OpenTelemetry specification. (#4754) +- Record synchronous measurements when the passed context is canceled instead of dropping in `go.opentelemetry.io/otel/sdk/metric`. + If you do not want to make a measurement when the context is cancelled, you need to handle it yourself (e.g `if ctx.Err() != nil`). (#4671) +- Improve `go.opentelemetry.io/otel/trace.TraceState`'s performance. (#4722) +- Improve `go.opentelemetry.io/otel/propagation.TraceContext`'s performance. (#4721) +- Improve `go.opentelemetry.io/otel/baggage` performance. (#4743) +- Improve performance of the `(*Set).Filter` method in `go.opentelemetry.io/otel/attribute` when the passed filter does not filter out any attributes from the set. (#4774) +- `Member.String` in `go.opentelemetry.io/otel/baggage` percent-encodes only when necessary. (#4775) +- Improve `go.opentelemetry.io/otel/trace.Span`'s performance when adding multiple attributes. (#4818) +- `Property.Value` in `go.opentelemetry.io/otel/baggage` now returns a raw string instead of a percent-encoded value. (#4804) + +### Fixed + +- Fix `Parse` in `go.opentelemetry.io/otel/baggage` to validate member value before percent-decoding. (#4755) +- Fix whitespace encoding of `Member.String` in `go.opentelemetry.io/otel/baggage`. (#4756) +- Fix observable not registered error when the asynchronous instrument has a drop aggregation in `go.opentelemetry.io/otel/sdk/metric`. (#4772) +- Fix baggage item key so that it is not canonicalized in `go.opentelemetry.io/otel/bridge/opentracing`. (#4776) +- Fix `go.opentelemetry.io/otel/bridge/opentracing` to properly handle baggage values that requires escaping during propagation. (#4804) +- Fix a bug where using multiple readers resulted in incorrect asynchronous counter values in `go.opentelemetry.io/otel/sdk/metric`. (#4742) + ## [1.21.0/0.44.0] 2023-11-16 ### Removed @@ -2735,7 +2775,8 @@ It contains api and sdk for trace and meter. - CircleCI build CI manifest files. - CODEOWNERS file to track owners of this project. -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.21.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go/compare/v1.22.0...HEAD +[1.22.0/0.45.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.22.0 [1.21.0/0.44.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.21.0 [1.20.0/0.43.0]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.20.0 [1.19.0/0.42.0/0.0.7]: https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.19.0 diff --git a/test/integration/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md b/test/integration/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md index 850606ae69..31857a6173 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md +++ b/test/integration/vendor/go.opentelemetry.io/otel/CONTRIBUTING.md @@ -591,6 +591,26 @@ this. [^3]: https://github.com/open-telemetry/opentelemetry-go/issues/3548 +### Ignoring context cancellation + +OpenTelemetry API implementations need to ignore the cancellation of the context that are +passed when recording a value (e.g. starting a span, recording a measurement, emitting a log). +Recording methods should not return an error describing the cancellation state of the context +when they complete, nor should they abort any work. + +This rule may not apply if the OpenTelemetry specification defines a timeout mechanism for +the method. In that case the context cancellation can be used for the timeout with the +restriction that this behavior is documented for the method. Otherwise, timeouts +are expected to be handled by the user calling the API, not the implementation. + +Stoppage of the telemetry pipeline is handled by calling the appropriate `Shutdown` method +of a provider. It is assumed the context passed from a user is not used for this purpose. + +Outside of the direct recording of telemetry from the API (e.g. exporting telemetry, +force flushing telemetry, shutting down a signal provider) the context cancellation +should be honored. This means all work done on behalf of the user provided context +should be canceled. + ## Approvers and Maintainers ### Approvers @@ -610,6 +630,7 @@ this. ### Emeritus +- [Liz Fong-Jones](https://github.com/lizthegrey), Honeycomb - [Gustavo Silva Paiva](https://github.com/paivagustavo), LightStep - [Josh MacDonald](https://github.com/jmacd), LightStep diff --git a/test/integration/vendor/go.opentelemetry.io/otel/README.md b/test/integration/vendor/go.opentelemetry.io/otel/README.md index 2c5b0cc28a..44e1bfc9b5 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/README.md +++ b/test/integration/vendor/go.opentelemetry.io/otel/README.md @@ -66,7 +66,7 @@ are made for those systems currently. ## Getting Started -You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/go/getting-started/). +You can find a getting started guide on [opentelemetry.io](https://opentelemetry.io/docs/languages/go/getting-started/). OpenTelemetry's goal is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability diff --git a/test/integration/vendor/go.opentelemetry.io/otel/RELEASING.md b/test/integration/vendor/go.opentelemetry.io/otel/RELEASING.md index 82ce3ee46a..d2691d0bd8 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/RELEASING.md +++ b/test/integration/vendor/go.opentelemetry.io/otel/RELEASING.md @@ -123,12 +123,12 @@ Once verified be sure to [make a release for the `contrib` repository](https://g ### Website Documentation -Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/instrumentation/go]. +Update the [Go instrumentation documentation] in the OpenTelemetry website under [content/en/docs/languages/go]. Importantly, bump any package versions referenced to be the latest one you just released and ensure all code examples still compile and are accurate. [OpenTelemetry Semantic Conventions]: https://github.com/open-telemetry/semantic-conventions -[Go instrumentation documentation]: https://opentelemetry.io/docs/instrumentation/go/ -[content/en/docs/instrumentation/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/go +[Go instrumentation documentation]: https://opentelemetry.io/docs/languages/go/ +[content/en/docs/languages/go]: https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/languages/go ### Demo Repository diff --git a/test/integration/vendor/go.opentelemetry.io/otel/attribute/set.go b/test/integration/vendor/go.opentelemetry.io/otel/attribute/set.go index 9f9303d4f1..7e6765b06b 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/attribute/set.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/attribute/set.go @@ -279,52 +279,75 @@ func NewSetWithSortableFiltered(kvs []KeyValue, tmp *Sortable, filter Filter) (S position-- kvs[offset], kvs[position] = kvs[position], kvs[offset] } + kvs = kvs[position:] + if filter != nil { - return filterSet(kvs[position:], filter) + if div := filteredToFront(kvs, filter); div != 0 { + return Set{equivalent: computeDistinct(kvs[div:])}, kvs[:div] + } } - return Set{ - equivalent: computeDistinct(kvs[position:]), - }, nil + return Set{equivalent: computeDistinct(kvs)}, nil } -// filterSet reorders kvs so that included keys are contiguous at the end of -// the slice, while excluded keys precede the included keys. -func filterSet(kvs []KeyValue, filter Filter) (Set, []KeyValue) { - var excluded []KeyValue - - // Move attributes that do not match the filter so they're adjacent before - // calling computeDistinct(). - distinctPosition := len(kvs) - - // Swap indistinct keys forward and distinct keys toward the - // end of the slice. - offset := len(kvs) - 1 - for ; offset >= 0; offset-- { - if filter(kvs[offset]) { - distinctPosition-- - kvs[offset], kvs[distinctPosition] = kvs[distinctPosition], kvs[offset] - continue +// filteredToFront filters slice in-place using keep function. All KeyValues that need to +// be removed are moved to the front. All KeyValues that need to be kept are +// moved (in-order) to the back. The index for the first KeyValue to be kept is +// returned. +func filteredToFront(slice []KeyValue, keep Filter) int { + n := len(slice) + j := n + for i := n - 1; i >= 0; i-- { + if keep(slice[i]) { + j-- + slice[i], slice[j] = slice[j], slice[i] } } - excluded = kvs[:distinctPosition] - - return Set{ - equivalent: computeDistinct(kvs[distinctPosition:]), - }, excluded + return j } // Filter returns a filtered copy of this Set. See the documentation for // NewSetWithSortableFiltered for more details. func (l *Set) Filter(re Filter) (Set, []KeyValue) { if re == nil { - return Set{ - equivalent: l.equivalent, - }, nil + return *l, nil } - // Note: This could be refactored to avoid the temporary slice - // allocation, if it proves to be expensive. - return filterSet(l.ToSlice(), re) + // Iterate in reverse to the first attribute that will be filtered out. + n := l.Len() + first := n - 1 + for ; first >= 0; first-- { + kv, _ := l.Get(first) + if !re(kv) { + break + } + } + + // No attributes will be dropped, return the immutable Set l and nil. + if first < 0 { + return *l, nil + } + + // Copy now that we know we need to return a modified set. + // + // Do not do this in-place on the underlying storage of *Set l. Sets are + // immutable and filtering should not change this. + slice := l.ToSlice() + + // Don't re-iterate the slice if only slice[0] is filtered. + if first == 0 { + // It is safe to assume len(slice) >= 1 given we found at least one + // attribute above that needs to be filtered out. + return Set{equivalent: computeDistinct(slice[1:])}, slice[:1] + } + + // Move the filtered slice[first] to the front (preserving order). + kv := slice[first] + copy(slice[1:first+1], slice[:first]) + slice[0] = kv + + // Do not re-evaluate re(slice[first+1:]). + div := filteredToFront(slice[1:first+1], re) + 1 + return Set{equivalent: computeDistinct(slice[div:])}, slice[:div] } // computeDistinct returns a Distinct using either the fixed- or diff --git a/test/integration/vendor/go.opentelemetry.io/otel/baggage/baggage.go b/test/integration/vendor/go.opentelemetry.io/otel/baggage/baggage.go index 84532cb1da..7d27cf77d5 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/baggage/baggage.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/baggage/baggage.go @@ -18,7 +18,6 @@ import ( "errors" "fmt" "net/url" - "regexp" "strings" "go.opentelemetry.io/otel/internal/baggage" @@ -32,16 +31,6 @@ const ( listDelimiter = "," keyValueDelimiter = "=" propertyDelimiter = ";" - - keyDef = `([\x21\x23-\x27\x2A\x2B\x2D\x2E\x30-\x39\x41-\x5a\x5e-\x7a\x7c\x7e]+)` - valueDef = `([\x21\x23-\x2b\x2d-\x3a\x3c-\x5B\x5D-\x7e]*)` - keyValueDef = `\s*` + keyDef + `\s*` + keyValueDelimiter + `\s*` + valueDef + `\s*` -) - -var ( - keyRe = regexp.MustCompile(`^` + keyDef + `$`) - valueRe = regexp.MustCompile(`^` + valueDef + `$`) - propertyRe = regexp.MustCompile(`^(?:\s*` + keyDef + `\s*|` + keyValueDef + `)$`) ) var ( @@ -67,7 +56,7 @@ type Property struct { // // If key is invalid, an error will be returned. func NewKeyProperty(key string) (Property, error) { - if !keyRe.MatchString(key) { + if !validateKey(key) { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) } @@ -77,14 +66,29 @@ func NewKeyProperty(key string) (Property, error) { // NewKeyValueProperty returns a new Property for key with value. // -// If key or value are invalid, an error will be returned. +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewKeyValuePropertyRaw] instead +// that does not require precent-encoding of the value. func NewKeyValueProperty(key, value string) (Property, error) { - if !keyRe.MatchString(key) { - return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + if !validateValue(value) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) } - if !valueRe.MatchString(value) { + decodedValue, err := url.PathUnescape(value) + if err != nil { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidValue, value) } + return NewKeyValuePropertyRaw(key, decodedValue) +} + +// NewKeyValuePropertyRaw returns a new Property for key with value. +// +// The passed key must be compliant with W3C Baggage specification. +func NewKeyValuePropertyRaw(key, value string) (Property, error) { + if !validateKey(key) { + return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidKey, key) + } p := Property{ key: key, @@ -106,20 +110,11 @@ func parseProperty(property string) (Property, error) { return newInvalidProperty(), nil } - match := propertyRe.FindStringSubmatch(property) - if len(match) != 4 { + p, ok := parsePropertyInternal(property) + if !ok { return newInvalidProperty(), fmt.Errorf("%w: %q", errInvalidProperty, property) } - var p Property - if match[1] != "" { - p.key = match[1] - } else { - p.key = match[2] - p.value = match[3] - p.hasValue = true - } - return p, nil } @@ -130,12 +125,9 @@ func (p Property) validate() error { return fmt.Errorf("invalid property: %w", err) } - if !keyRe.MatchString(p.key) { + if !validateKey(p.key) { return errFunc(fmt.Errorf("%w: %q", errInvalidKey, p.key)) } - if p.hasValue && !valueRe.MatchString(p.value) { - return errFunc(fmt.Errorf("%w: %q", errInvalidValue, p.value)) - } if !p.hasValue && p.value != "" { return errFunc(errors.New("inconsistent value")) } @@ -154,11 +146,11 @@ func (p Property) Value() (string, bool) { return p.value, p.hasValue } -// String encodes Property into a string compliant with the W3C Baggage +// String encodes Property into a header string compliant with the W3C Baggage // specification. func (p Property) String() string { if p.hasValue { - return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, p.value) + return fmt.Sprintf("%s%s%v", p.key, keyValueDelimiter, valueEscape(p.value)) } return p.key } @@ -218,7 +210,7 @@ func (p properties) validate() error { return nil } -// String encodes properties into a string compliant with the W3C Baggage +// String encodes properties into a header string compliant with the W3C Baggage // specification. func (p properties) String() string { props := make([]string, len(p)) @@ -240,11 +232,28 @@ type Member struct { hasData bool } -// NewMember returns a new Member from the passed arguments. The key will be -// used directly while the value will be url decoded after validation. An error -// is returned if the created Member would be invalid according to the W3C -// Baggage specification. +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +// The passed value must be precent-encoded as defined in W3C Baggage specification. +// +// Notice: Consider using [NewMemberRaw] instead +// that does not require precent-encoding of the value. func NewMember(key, value string, props ...Property) (Member, error) { + if !validateValue(value) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + decodedValue, err := url.PathUnescape(value) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + } + return NewMemberRaw(key, decodedValue, props...) +} + +// NewMemberRaw returns a new Member from the passed arguments. +// +// The passed key must be compliant with W3C Baggage specification. +func NewMemberRaw(key, value string, props ...Property) (Member, error) { m := Member{ key: key, value: value, @@ -254,11 +263,6 @@ func NewMember(key, value string, props ...Property) (Member, error) { if err := m.validate(); err != nil { return newInvalidMember(), err } - decodedValue, err := url.PathUnescape(value) - if err != nil { - return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) - } - m.value = decodedValue return m, nil } @@ -274,11 +278,7 @@ func parseMember(member string) (Member, error) { return newInvalidMember(), fmt.Errorf("%w: %d", errMemberBytes, n) } - var ( - key, value string - props properties - ) - + var props properties keyValue, properties, found := strings.Cut(member, propertyDelimiter) if found { // Parse the member properties. @@ -299,36 +299,34 @@ func parseMember(member string) (Member, error) { } // "Leading and trailing whitespaces are allowed but MUST be trimmed // when converting the header into a data structure." - key = strings.TrimSpace(k) - var err error - value, err = url.PathUnescape(strings.TrimSpace(v)) - if err != nil { - return newInvalidMember(), fmt.Errorf("%w: %q", err, value) - } - if !keyRe.MatchString(key) { + key := strings.TrimSpace(k) + if !validateKey(key) { return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidKey, key) } - if !valueRe.MatchString(value) { - return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, value) + + val := strings.TrimSpace(v) + if !validateValue(val) { + return newInvalidMember(), fmt.Errorf("%w: %q", errInvalidValue, v) } + // Decode a precent-encoded value. + value, err := url.PathUnescape(val) + if err != nil { + return newInvalidMember(), fmt.Errorf("%w: %v", errInvalidValue, err) + } return Member{key: key, value: value, properties: props, hasData: true}, nil } // validate ensures m conforms to the W3C Baggage specification. -// A key is just an ASCII string, but a value must be URL encoded UTF-8, -// returning an error otherwise. +// A key must be an ASCII string, returning an error otherwise. func (m Member) validate() error { if !m.hasData { return fmt.Errorf("%w: %q", errInvalidMember, m) } - if !keyRe.MatchString(m.key) { + if !validateKey(m.key) { return fmt.Errorf("%w: %q", errInvalidKey, m.key) } - if !valueRe.MatchString(m.value) { - return fmt.Errorf("%w: %q", errInvalidValue, m.value) - } return m.properties.validate() } @@ -341,11 +339,13 @@ func (m Member) Value() string { return m.value } // Properties returns a copy of the Member properties. func (m Member) Properties() []Property { return m.properties.Copy() } -// String encodes Member into a string compliant with the W3C Baggage +// String encodes Member into a header string compliant with the W3C Baggage // specification. func (m Member) String() string { - // A key is just an ASCII string, but a value is URL encoded UTF-8. - s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, url.QueryEscape(m.value)) + // A key is just an ASCII string. A value is restricted to be + // US-ASCII characters excluding CTLs, whitespace, + // DQUOTE, comma, semicolon, and backslash. + s := fmt.Sprintf("%s%s%s", m.key, keyValueDelimiter, valueEscape(m.value)) if len(m.properties) > 0 { s = fmt.Sprintf("%s%s%s", s, propertyDelimiter, m.properties.String()) } @@ -536,9 +536,8 @@ func (b Baggage) Len() int { return len(b.list) } -// String encodes Baggage into a string compliant with the W3C Baggage -// specification. The returned string will be invalid if the Baggage contains -// any invalid list-members. +// String encodes Baggage into a header string compliant with the W3C Baggage +// specification. func (b Baggage) String() string { members := make([]string, 0, len(b.list)) for k, v := range b.list { @@ -550,3 +549,196 @@ func (b Baggage) String() string { } return strings.Join(members, listDelimiter) } + +// parsePropertyInternal attempts to decode a Property from the passed string. +// It follows the spec at https://www.w3.org/TR/baggage/#definition. +func parsePropertyInternal(s string) (p Property, ok bool) { + // For the entire function we will use " key = value " as an example. + // Attempting to parse the key. + // First skip spaces at the beginning "< >key = value " (they could be empty). + index := skipSpace(s, 0) + + // Parse the key: " = value ". + keyStart := index + keyEnd := index + for _, c := range s[keyStart:] { + if !validateKeyChar(c) { + break + } + keyEnd++ + } + + // If we couldn't find any valid key character, + // it means the key is either empty or invalid. + if keyStart == keyEnd { + return + } + + // Skip spaces after the key: " key< >= value ". + index = skipSpace(s, keyEnd) + + if index == len(s) { + // A key can have no value, like: " key ". + ok = true + p.key = s[keyStart:keyEnd] + return + } + + // If we have not reached the end and we can't find the '=' delimiter, + // it means the property is invalid. + if s[index] != keyValueDelimiter[0] { + return + } + + // Attempting to parse the value. + // Match: " key =< >value ". + index = skipSpace(s, index+1) + + // Match the value string: " key = ". + // A valid property can be: " key =". + // Therefore, we don't have to check if the value is empty. + valueStart := index + valueEnd := index + for _, c := range s[valueStart:] { + if !validateValueChar(c) { + break + } + valueEnd++ + } + + // Skip all trailing whitespaces: " key = value< >". + index = skipSpace(s, valueEnd) + + // If after looking for the value and skipping whitespaces + // we have not reached the end, it means the property is + // invalid, something like: " key = value value1". + if index != len(s) { + return + } + + // Decode a precent-encoded value. + value, err := url.PathUnescape(s[valueStart:valueEnd]) + if err != nil { + return + } + + ok = true + p.key = s[keyStart:keyEnd] + p.hasValue = true + + p.value = value + return +} + +func skipSpace(s string, offset int) int { + i := offset + for ; i < len(s); i++ { + c := s[i] + if c != ' ' && c != '\t' { + break + } + } + return i +} + +func validateKey(s string) bool { + if len(s) == 0 { + return false + } + + for _, c := range s { + if !validateKeyChar(c) { + return false + } + } + + return true +} + +func validateKeyChar(c int32) bool { + return (c >= 0x23 && c <= 0x27) || + (c >= 0x30 && c <= 0x39) || + (c >= 0x41 && c <= 0x5a) || + (c >= 0x5e && c <= 0x7a) || + c == 0x21 || + c == 0x2a || + c == 0x2b || + c == 0x2d || + c == 0x2e || + c == 0x7c || + c == 0x7e +} + +func validateValue(s string) bool { + for _, c := range s { + if !validateValueChar(c) { + return false + } + } + + return true +} + +func validateValueChar(c int32) bool { + return c == 0x21 || + (c >= 0x23 && c <= 0x2b) || + (c >= 0x2d && c <= 0x3a) || + (c >= 0x3c && c <= 0x5b) || + (c >= 0x5d && c <= 0x7e) +} + +// valueEscape escapes the string so it can be safely placed inside a baggage value, +// replacing special characters with %XX sequences as needed. +// +// The implementation is based on: +// https://github.com/golang/go/blob/f6509cf5cdbb5787061b784973782933c47f1782/src/net/url/url.go#L285. +func valueEscape(s string) string { + hexCount := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(c) { + hexCount++ + } + } + + if hexCount == 0 { + return s + } + + var buf [64]byte + var t []byte + + required := len(s) + 2*hexCount + if required <= len(buf) { + t = buf[:required] + } else { + t = make([]byte, required) + } + + j := 0 + for i := 0; i < len(s); i++ { + c := s[i] + if shouldEscape(s[i]) { + const upperhex = "0123456789ABCDEF" + t[j] = '%' + t[j+1] = upperhex[c>>4] + t[j+2] = upperhex[c&15] + j += 3 + } else { + t[j] = c + j++ + } + } + + return string(t) +} + +// shouldEscape returns true if the specified byte should be escaped when +// appearing in a baggage value string. +func shouldEscape(c byte) bool { + if c == '%' { + // The percent character must be encoded so that percent-encoding can work. + return true + } + return !validateValueChar(int32(c)) +} diff --git a/test/integration/vendor/go.opentelemetry.io/otel/doc.go b/test/integration/vendor/go.opentelemetry.io/otel/doc.go index daa36c89dc..36d7c24e88 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/doc.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/doc.go @@ -22,7 +22,7 @@ transmitted anywhere. An implementation of the OpenTelemetry SDK, like the default SDK implementation (go.opentelemetry.io/otel/sdk), and associated exporters are used to process and transport this data. -To read the getting started guide, see https://opentelemetry.io/docs/go/getting-started/. +To read the getting started guide, see https://opentelemetry.io/docs/languages/go/getting-started/. To read more about tracing, see go.opentelemetry.io/otel/trace. diff --git a/test/integration/vendor/go.opentelemetry.io/otel/propagation/trace_context.go b/test/integration/vendor/go.opentelemetry.io/otel/propagation/trace_context.go index 75a8f3435a..63e5d62221 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/propagation/trace_context.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/propagation/trace_context.go @@ -18,7 +18,7 @@ import ( "context" "encoding/hex" "fmt" - "regexp" + "strings" "go.opentelemetry.io/otel/trace" ) @@ -28,6 +28,7 @@ const ( maxVersion = 254 traceparentHeader = "traceparent" tracestateHeader = "tracestate" + delimiter = "-" ) // TraceContext is a propagator that supports the W3C Trace Context format @@ -41,8 +42,8 @@ const ( type TraceContext struct{} var ( - _ TextMapPropagator = TraceContext{} - traceCtxRegExp = regexp.MustCompile("^(?P[0-9a-f]{2})-(?P[a-f0-9]{32})-(?P[a-f0-9]{16})-(?P[a-f0-9]{2})(?:-.*)?$") + _ TextMapPropagator = TraceContext{} + versionPart = fmt.Sprintf("%.2X", supportedVersion) ) // Inject set tracecontext from the Context into the carrier. @@ -59,12 +60,19 @@ func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) { // Clear all flags other than the trace-context supported sampling bit. flags := sc.TraceFlags() & trace.FlagsSampled - h := fmt.Sprintf("%.2x-%s-%s-%s", - supportedVersion, - sc.TraceID(), - sc.SpanID(), - flags) - carrier.Set(traceparentHeader, h) + var sb strings.Builder + sb.Grow(2 + 32 + 16 + 2 + 3) + _, _ = sb.WriteString(versionPart) + traceID := sc.TraceID() + spanID := sc.SpanID() + flagByte := [1]byte{byte(flags)} + var buf [32]byte + for _, src := range [][]byte{traceID[:], spanID[:], flagByte[:]} { + _ = sb.WriteByte(delimiter[0]) + n := hex.Encode(buf[:], src) + _, _ = sb.Write(buf[:n]) + } + carrier.Set(traceparentHeader, sb.String()) } // Extract reads tracecontext from the carrier into a returned Context. @@ -86,21 +94,8 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { return trace.SpanContext{} } - matches := traceCtxRegExp.FindStringSubmatch(h) - - if len(matches) == 0 { - return trace.SpanContext{} - } - - if len(matches) < 5 { // four subgroups plus the overall match - return trace.SpanContext{} - } - - if len(matches[1]) != 2 { - return trace.SpanContext{} - } - ver, err := hex.DecodeString(matches[1]) - if err != nil { + var ver [1]byte + if !extractPart(ver[:], &h, 2) { return trace.SpanContext{} } version := int(ver[0]) @@ -108,36 +103,24 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { return trace.SpanContext{} } - if version == 0 && len(matches) != 5 { // four subgroups plus the overall match - return trace.SpanContext{} - } - - if len(matches[2]) != 32 { - return trace.SpanContext{} - } - var scc trace.SpanContextConfig - - scc.TraceID, err = trace.TraceIDFromHex(matches[2][:32]) - if err != nil { + if !extractPart(scc.TraceID[:], &h, 32) { return trace.SpanContext{} } - - if len(matches[3]) != 16 { - return trace.SpanContext{} - } - scc.SpanID, err = trace.SpanIDFromHex(matches[3]) - if err != nil { + if !extractPart(scc.SpanID[:], &h, 16) { return trace.SpanContext{} } - if len(matches[4]) != 2 { + var opts [1]byte + if !extractPart(opts[:], &h, 2) { return trace.SpanContext{} } - opts, err := hex.DecodeString(matches[4]) - if err != nil || len(opts) < 1 || (version == 0 && opts[0] > 2) { + if version == 0 && (h != "" || opts[0] > 2) { + // version 0 not allow extra + // version 0 not allow other flag return trace.SpanContext{} } + // Clear all flags other than the trace-context supported sampling bit. scc.TraceFlags = trace.TraceFlags(opts[0]) & trace.FlagsSampled @@ -155,6 +138,29 @@ func (tc TraceContext) extract(carrier TextMapCarrier) trace.SpanContext { return sc } +// upperHex detect hex is upper case Unicode characters. +func upperHex(v string) bool { + for _, c := range v { + if c >= 'A' && c <= 'F' { + return true + } + } + return false +} + +func extractPart(dst []byte, h *string, n int) bool { + part, left, _ := strings.Cut(*h, delimiter) + *h = left + // hex.Decode decodes unsupported upper-case characters, so exclude explicitly. + if len(part) != n || upperHex(part) { + return false + } + if p, err := hex.Decode(dst, []byte(part)); err != nil || p != n/2 { + return false + } + return true +} + // Fields returns the keys who's values are set with Inject. func (tc TraceContext) Fields() []string { return []string{traceparentHeader, tracestateHeader} diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go index c63a0dd1f8..6a2c08293a 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/builtin.go @@ -22,7 +22,7 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type ( diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/container.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/container.go index 3d53622828..c881b2895b 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/container.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/container.go @@ -22,7 +22,7 @@ import ( "os" "regexp" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type containerIDProvider func() (string, error) diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/env.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/env.go index e29ae563a6..be4cbe423e 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/env.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/env.go @@ -23,7 +23,7 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) const ( diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go index fb1ebf2cab..f579329c2c 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/host_id.go @@ -19,7 +19,7 @@ import ( "errors" "strings" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type hostIDProvider func() (string, error) diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/os.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/os.go index 0cbd559739..8fbf071c17 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/os.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/os.go @@ -19,7 +19,7 @@ import ( "strings" "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type osDescriptionProvider func() (string, error) diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/process.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/process.go index ecdd11dd76..739ea4512a 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/process.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/resource/process.go @@ -22,7 +22,7 @@ import ( "path/filepath" "runtime" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" ) type ( diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/trace/span.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/trace/span.go index 36dbf67764..85bc702a01 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/trace/span.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/trace/span.go @@ -30,7 +30,7 @@ import ( "go.opentelemetry.io/otel/sdk/instrumentation" "go.opentelemetry.io/otel/sdk/internal" "go.opentelemetry.io/otel/sdk/resource" - semconv "go.opentelemetry.io/otel/semconv/v1.21.0" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" "go.opentelemetry.io/otel/trace" "go.opentelemetry.io/otel/trace/embedded" ) @@ -208,6 +208,16 @@ func (s *recordingSpan) SetStatus(code codes.Code, description string) { s.status = status } +// ensureAttributesCapacity inlines functionality from slices.Grow +// so that we can avoid needing to import golang.org/x/exp for go1.20. +// Once support for go1.20 is dropped, we can use slices.Grow available since go1.21 instead. +// Tracking issue: https://github.com/open-telemetry/opentelemetry-go/issues/4819. +func (s *recordingSpan) ensureAttributesCapacity(minCapacity int) { + if n := minCapacity - cap(s.attributes); n > 0 { + s.attributes = append(s.attributes[:cap(s.attributes)], make([]attribute.KeyValue, n)...)[:len(s.attributes)] + } +} + // SetAttributes sets attributes of this span. // // If a key from attributes already exists the value associated with that key @@ -242,6 +252,7 @@ func (s *recordingSpan) SetAttributes(attributes ...attribute.KeyValue) { // Otherwise, add without deduplication. When attributes are read they // will be deduplicated, optimizing the operation. + s.ensureAttributesCapacity(len(s.attributes) + len(attributes)) for _, a := range attributes { if !a.Valid() { // Drop all invalid attributes. @@ -277,6 +288,12 @@ func (s *recordingSpan) addOverCapAttrs(limit int, attrs []attribute.KeyValue) { // Now that s.attributes is deduplicated, adding unique attributes up to // the capacity of s will not over allocate s.attributes. + if sum := len(attrs) + len(s.attributes); sum < limit { + // After support for go1.20 is dropped, simplify if-else to min(sum, limit). + s.ensureAttributesCapacity(sum) + } else { + s.ensureAttributesCapacity(limit) + } for _, a := range attrs { if !a.Valid() { // Drop all invalid attributes. diff --git a/test/integration/vendor/go.opentelemetry.io/otel/sdk/version.go b/test/integration/vendor/go.opentelemetry.io/otel/sdk/version.go index 7048c788e9..17b16cc796 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/sdk/version.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/sdk/version.go @@ -16,5 +16,5 @@ package sdk // import "go.opentelemetry.io/otel/sdk" // Version is the current release version of the OpenTelemetry SDK in use. func Version() string { - return "1.20.0" + return "1.22.0" } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/attribute_group.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/doc.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/event.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/exception.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/http.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/resource.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/schema.go diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go similarity index 100% rename from vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.20.0/trace.go diff --git a/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go index 7cf424855e..0318b5ec48 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go @@ -15,6 +15,6 @@ // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the conventions -// as of the v1.21.0 version of the OpenTelemetry specification. +// patterns for OpenTelemetry things. This package represents the v1.21.0 +// version of the OpenTelemetry semantic conventions. package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" diff --git a/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go new file mode 100644 index 0000000000..31726598d6 --- /dev/null +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/attribute_group.go @@ -0,0 +1,4398 @@ +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated from semantic convention specification. DO NOT EDIT. + +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" + +import "go.opentelemetry.io/otel/attribute" + +// Describes FaaS attributes. +const ( + // FaaSInvokedNameKey is the attribute Key conforming to the + // "faas.invoked_name" semantic conventions. It represents the name of the + // invoked function. + // + // Type: string + // RequirementLevel: Required + // Stability: experimental + // Examples: 'my-function' + // Note: SHOULD be equal to the `faas.name` resource attribute of the + // invoked function. + FaaSInvokedNameKey = attribute.Key("faas.invoked_name") + + // FaaSInvokedProviderKey is the attribute Key conforming to the + // "faas.invoked_provider" semantic conventions. It represents the cloud + // provider of the invoked function. + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + // Note: SHOULD be equal to the `cloud.provider` resource attribute of the + // invoked function. + FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") + + // FaaSInvokedRegionKey is the attribute Key conforming to the + // "faas.invoked_region" semantic conventions. It represents the cloud + // region of the invoked function. + // + // Type: string + // RequirementLevel: ConditionallyRequired (For some cloud providers, like + // AWS or GCP, the region in which a function is hosted is essential to + // uniquely identify the function and also part of its endpoint. Since it's + // part of the endpoint being called, the region is always known to + // clients. In these cases, `faas.invoked_region` MUST be set accordingly. + // If the region is unknown to the client or not required for identifying + // the invoked function, setting `faas.invoked_region` is optional.) + // Stability: experimental + // Examples: 'eu-central-1' + // Note: SHOULD be equal to the `cloud.region` resource attribute of the + // invoked function. + FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") + + // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" + // semantic conventions. It represents the type of the trigger which caused + // this function invocation. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + FaaSTriggerKey = attribute.Key("faas.trigger") +) + +var ( + // Alibaba Cloud + FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") + // Amazon Web Services + FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") + // Microsoft Azure + FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") + // Google Cloud Platform + FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") + // Tencent Cloud + FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") +) + +var ( + // A response to some data source operation such as a database or filesystem read/write + FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") + // To provide an answer to an inbound HTTP request + FaaSTriggerHTTP = FaaSTriggerKey.String("http") + // A function is set to be executed when messages are sent to a messaging system + FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") + // A function is scheduled to be executed regularly + FaaSTriggerTimer = FaaSTriggerKey.String("timer") + // If none of the others apply + FaaSTriggerOther = FaaSTriggerKey.String("other") +) + +// FaaSInvokedName returns an attribute KeyValue conforming to the +// "faas.invoked_name" semantic conventions. It represents the name of the +// invoked function. +func FaaSInvokedName(val string) attribute.KeyValue { + return FaaSInvokedNameKey.String(val) +} + +// FaaSInvokedRegion returns an attribute KeyValue conforming to the +// "faas.invoked_region" semantic conventions. It represents the cloud region +// of the invoked function. +func FaaSInvokedRegion(val string) attribute.KeyValue { + return FaaSInvokedRegionKey.String(val) +} + +// Attributes for Events represented using Log Records. +const ( + // EventNameKey is the attribute Key conforming to the "event.name" + // semantic conventions. It represents the identifies the class / type of + // event. + // + // Type: string + // RequirementLevel: Required + // Stability: experimental + // Examples: 'browser.mouse.click', 'device.app.lifecycle' + // Note: Event names are subject to the same rules as [attribute + // names](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md). + // Notably, event names are namespaced to avoid collisions and provide a + // clean separation of semantics for events in separate domains like + // browser, mobile, and kubernetes. + EventNameKey = attribute.Key("event.name") +) + +// EventName returns an attribute KeyValue conforming to the "event.name" +// semantic conventions. It represents the identifies the class / type of +// event. +func EventName(val string) attribute.KeyValue { + return EventNameKey.String(val) +} + +// The attributes described in this section are rather generic. They may be +// used in any Log Record they apply to. +const ( + // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" + // semantic conventions. It represents a unique identifier for the Log + // Record. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV' + // Note: If an id is provided, other log records with the same id will be + // considered duplicates and can be removed safely. This means, that two + // distinguishable log records MUST have different values. + // The id MAY be an [Universally Unique Lexicographically Sortable + // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers + // (e.g. UUID) may be used as needed. + LogRecordUIDKey = attribute.Key("log.record.uid") +) + +// LogRecordUID returns an attribute KeyValue conforming to the +// "log.record.uid" semantic conventions. It represents a unique identifier for +// the Log Record. +func LogRecordUID(val string) attribute.KeyValue { + return LogRecordUIDKey.String(val) +} + +// Describes Log attributes +const ( + // LogIostreamKey is the attribute Key conforming to the "log.iostream" + // semantic conventions. It represents the stream associated with the log. + // See below for a list of well-known values. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + LogIostreamKey = attribute.Key("log.iostream") +) + +var ( + // Logs from stdout stream + LogIostreamStdout = LogIostreamKey.String("stdout") + // Events from stderr stream + LogIostreamStderr = LogIostreamKey.String("stderr") +) + +// A file to which log was emitted. +const ( + // LogFileNameKey is the attribute Key conforming to the "log.file.name" + // semantic conventions. It represents the basename of the file. + // + // Type: string + // RequirementLevel: Recommended + // Stability: experimental + // Examples: 'audit.log' + LogFileNameKey = attribute.Key("log.file.name") + + // LogFileNameResolvedKey is the attribute Key conforming to the + // "log.file.name_resolved" semantic conventions. It represents the + // basename of the file, with symlinks resolved. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'uuid.log' + LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") + + // LogFilePathKey is the attribute Key conforming to the "log.file.path" + // semantic conventions. It represents the full path to the file. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/var/log/mysql/audit.log' + LogFilePathKey = attribute.Key("log.file.path") + + // LogFilePathResolvedKey is the attribute Key conforming to the + // "log.file.path_resolved" semantic conventions. It represents the full + // path to the file, with symlinks resolved. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/var/lib/docker/uuid.log' + LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") +) + +// LogFileName returns an attribute KeyValue conforming to the +// "log.file.name" semantic conventions. It represents the basename of the +// file. +func LogFileName(val string) attribute.KeyValue { + return LogFileNameKey.String(val) +} + +// LogFileNameResolved returns an attribute KeyValue conforming to the +// "log.file.name_resolved" semantic conventions. It represents the basename of +// the file, with symlinks resolved. +func LogFileNameResolved(val string) attribute.KeyValue { + return LogFileNameResolvedKey.String(val) +} + +// LogFilePath returns an attribute KeyValue conforming to the +// "log.file.path" semantic conventions. It represents the full path to the +// file. +func LogFilePath(val string) attribute.KeyValue { + return LogFilePathKey.String(val) +} + +// LogFilePathResolved returns an attribute KeyValue conforming to the +// "log.file.path_resolved" semantic conventions. It represents the full path +// to the file, with symlinks resolved. +func LogFilePathResolved(val string) attribute.KeyValue { + return LogFilePathResolvedKey.String(val) +} + +// Describes Database attributes +const ( + // PoolNameKey is the attribute Key conforming to the "pool.name" semantic + // conventions. It represents the name of the connection pool; unique + // within the instrumented application. In case the connection pool + // implementation doesn't provide a name, then the + // [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) + // should be used + // + // Type: string + // RequirementLevel: Required + // Stability: experimental + // Examples: 'myDataSource' + PoolNameKey = attribute.Key("pool.name") + + // StateKey is the attribute Key conforming to the "state" semantic + // conventions. It represents the state of a connection in the pool + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + // Examples: 'idle' + StateKey = attribute.Key("state") +) + +var ( + // idle + StateIdle = StateKey.String("idle") + // used + StateUsed = StateKey.String("used") +) + +// PoolName returns an attribute KeyValue conforming to the "pool.name" +// semantic conventions. It represents the name of the connection pool; unique +// within the instrumented application. In case the connection pool +// implementation doesn't provide a name, then the +// [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) +// should be used +func PoolName(val string) attribute.KeyValue { + return PoolNameKey.String(val) +} + +// ASP.NET Core attributes +const ( + // AspnetcoreDiagnosticsHandlerTypeKey is the attribute Key conforming to + // the "aspnetcore.diagnostics.handler.type" semantic conventions. It + // represents the full type name of the + // [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) + // implementation that handled the exception. + // + // Type: string + // RequirementLevel: ConditionallyRequired (if and only if the exception + // was handled by this handler.) + // Stability: experimental + // Examples: 'Contoso.MyHandler' + AspnetcoreDiagnosticsHandlerTypeKey = attribute.Key("aspnetcore.diagnostics.handler.type") + + // AspnetcoreRateLimitingPolicyKey is the attribute Key conforming to the + // "aspnetcore.rate_limiting.policy" semantic conventions. It represents + // the rate limiting policy name. + // + // Type: string + // RequirementLevel: ConditionallyRequired (if the matched endpoint for the + // request had a rate-limiting policy.) + // Stability: experimental + // Examples: 'fixed', 'sliding', 'token' + AspnetcoreRateLimitingPolicyKey = attribute.Key("aspnetcore.rate_limiting.policy") + + // AspnetcoreRateLimitingResultKey is the attribute Key conforming to the + // "aspnetcore.rate_limiting.result" semantic conventions. It represents + // the rate-limiting result, shows whether the lease was acquired or + // contains a rejection reason + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + // Examples: 'acquired', 'request_canceled' + AspnetcoreRateLimitingResultKey = attribute.Key("aspnetcore.rate_limiting.result") + + // AspnetcoreRequestIsUnhandledKey is the attribute Key conforming to the + // "aspnetcore.request.is_unhandled" semantic conventions. It represents + // the flag indicating if request was handled by the application pipeline. + // + // Type: boolean + // RequirementLevel: ConditionallyRequired (if and only if the request was + // not handled.) + // Stability: experimental + // Examples: True + AspnetcoreRequestIsUnhandledKey = attribute.Key("aspnetcore.request.is_unhandled") + + // AspnetcoreRoutingIsFallbackKey is the attribute Key conforming to the + // "aspnetcore.routing.is_fallback" semantic conventions. It represents a + // value that indicates whether the matched route is a fallback route. + // + // Type: boolean + // RequirementLevel: ConditionallyRequired (If and only if a route was + // successfully matched.) + // Stability: experimental + // Examples: True + AspnetcoreRoutingIsFallbackKey = attribute.Key("aspnetcore.routing.is_fallback") +) + +var ( + // Lease was acquired + AspnetcoreRateLimitingResultAcquired = AspnetcoreRateLimitingResultKey.String("acquired") + // Lease request was rejected by the endpoint limiter + AspnetcoreRateLimitingResultEndpointLimiter = AspnetcoreRateLimitingResultKey.String("endpoint_limiter") + // Lease request was rejected by the global limiter + AspnetcoreRateLimitingResultGlobalLimiter = AspnetcoreRateLimitingResultKey.String("global_limiter") + // Lease request was canceled + AspnetcoreRateLimitingResultRequestCanceled = AspnetcoreRateLimitingResultKey.String("request_canceled") +) + +// AspnetcoreDiagnosticsHandlerType returns an attribute KeyValue conforming +// to the "aspnetcore.diagnostics.handler.type" semantic conventions. It +// represents the full type name of the +// [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) +// implementation that handled the exception. +func AspnetcoreDiagnosticsHandlerType(val string) attribute.KeyValue { + return AspnetcoreDiagnosticsHandlerTypeKey.String(val) +} + +// AspnetcoreRateLimitingPolicy returns an attribute KeyValue conforming to +// the "aspnetcore.rate_limiting.policy" semantic conventions. It represents +// the rate limiting policy name. +func AspnetcoreRateLimitingPolicy(val string) attribute.KeyValue { + return AspnetcoreRateLimitingPolicyKey.String(val) +} + +// AspnetcoreRequestIsUnhandled returns an attribute KeyValue conforming to +// the "aspnetcore.request.is_unhandled" semantic conventions. It represents +// the flag indicating if request was handled by the application pipeline. +func AspnetcoreRequestIsUnhandled(val bool) attribute.KeyValue { + return AspnetcoreRequestIsUnhandledKey.Bool(val) +} + +// AspnetcoreRoutingIsFallback returns an attribute KeyValue conforming to +// the "aspnetcore.routing.is_fallback" semantic conventions. It represents a +// value that indicates whether the matched route is a fallback route. +func AspnetcoreRoutingIsFallback(val bool) attribute.KeyValue { + return AspnetcoreRoutingIsFallbackKey.Bool(val) +} + +// SignalR attributes +const ( + // SignalrConnectionStatusKey is the attribute Key conforming to the + // "signalr.connection.status" semantic conventions. It represents the + // signalR HTTP connection closure status. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'app_shutdown', 'timeout' + SignalrConnectionStatusKey = attribute.Key("signalr.connection.status") + + // SignalrTransportKey is the attribute Key conforming to the + // "signalr.transport" semantic conventions. It represents the [SignalR + // transport + // type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md) + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'web_sockets', 'long_polling' + SignalrTransportKey = attribute.Key("signalr.transport") +) + +var ( + // The connection was closed normally + SignalrConnectionStatusNormalClosure = SignalrConnectionStatusKey.String("normal_closure") + // The connection was closed due to a timeout + SignalrConnectionStatusTimeout = SignalrConnectionStatusKey.String("timeout") + // The connection was closed because the app is shutting down + SignalrConnectionStatusAppShutdown = SignalrConnectionStatusKey.String("app_shutdown") +) + +var ( + // ServerSentEvents protocol + SignalrTransportServerSentEvents = SignalrTransportKey.String("server_sent_events") + // LongPolling protocol + SignalrTransportLongPolling = SignalrTransportKey.String("long_polling") + // WebSockets protocol + SignalrTransportWebSockets = SignalrTransportKey.String("web_sockets") +) + +// Describes JVM buffer metric attributes. +const ( + // JvmBufferPoolNameKey is the attribute Key conforming to the + // "jvm.buffer.pool.name" semantic conventions. It represents the name of + // the buffer pool. + // + // Type: string + // RequirementLevel: Recommended + // Stability: experimental + // Examples: 'mapped', 'direct' + // Note: Pool names are generally obtained via + // [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). + JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name") +) + +// JvmBufferPoolName returns an attribute KeyValue conforming to the +// "jvm.buffer.pool.name" semantic conventions. It represents the name of the +// buffer pool. +func JvmBufferPoolName(val string) attribute.KeyValue { + return JvmBufferPoolNameKey.String(val) +} + +// Describes JVM memory metric attributes. +const ( + // JvmMemoryPoolNameKey is the attribute Key conforming to the + // "jvm.memory.pool.name" semantic conventions. It represents the name of + // the memory pool. + // + // Type: string + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space' + // Note: Pool names are generally obtained via + // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). + JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name") + + // JvmMemoryTypeKey is the attribute Key conforming to the + // "jvm.memory.type" semantic conventions. It represents the type of + // memory. + // + // Type: Enum + // RequirementLevel: Recommended + // Stability: stable + // Examples: 'heap', 'non_heap' + JvmMemoryTypeKey = attribute.Key("jvm.memory.type") +) + +var ( + // Heap memory + JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap") + // Non-heap memory + JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap") +) + +// JvmMemoryPoolName returns an attribute KeyValue conforming to the +// "jvm.memory.pool.name" semantic conventions. It represents the name of the +// memory pool. +func JvmMemoryPoolName(val string) attribute.KeyValue { + return JvmMemoryPoolNameKey.String(val) +} + +// Describes System metric attributes +const ( + // SystemDeviceKey is the attribute Key conforming to the "system.device" + // semantic conventions. It represents the device identifier + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '(identifier)' + SystemDeviceKey = attribute.Key("system.device") +) + +// SystemDevice returns an attribute KeyValue conforming to the +// "system.device" semantic conventions. It represents the device identifier +func SystemDevice(val string) attribute.KeyValue { + return SystemDeviceKey.String(val) +} + +// Describes System CPU metric attributes +const ( + // SystemCPULogicalNumberKey is the attribute Key conforming to the + // "system.cpu.logical_number" semantic conventions. It represents the + // logical CPU number [0..n-1] + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1 + SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number") + + // SystemCPUStateKey is the attribute Key conforming to the + // "system.cpu.state" semantic conventions. It represents the state of the + // CPU + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'idle', 'interrupt' + SystemCPUStateKey = attribute.Key("system.cpu.state") +) + +var ( + // user + SystemCPUStateUser = SystemCPUStateKey.String("user") + // system + SystemCPUStateSystem = SystemCPUStateKey.String("system") + // nice + SystemCPUStateNice = SystemCPUStateKey.String("nice") + // idle + SystemCPUStateIdle = SystemCPUStateKey.String("idle") + // iowait + SystemCPUStateIowait = SystemCPUStateKey.String("iowait") + // interrupt + SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt") + // steal + SystemCPUStateSteal = SystemCPUStateKey.String("steal") +) + +// SystemCPULogicalNumber returns an attribute KeyValue conforming to the +// "system.cpu.logical_number" semantic conventions. It represents the logical +// CPU number [0..n-1] +func SystemCPULogicalNumber(val int) attribute.KeyValue { + return SystemCPULogicalNumberKey.Int(val) +} + +// Describes System Memory metric attributes +const ( + // SystemMemoryStateKey is the attribute Key conforming to the + // "system.memory.state" semantic conventions. It represents the memory + // state + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'free', 'cached' + SystemMemoryStateKey = attribute.Key("system.memory.state") +) + +var ( + // used + SystemMemoryStateUsed = SystemMemoryStateKey.String("used") + // free + SystemMemoryStateFree = SystemMemoryStateKey.String("free") + // shared + SystemMemoryStateShared = SystemMemoryStateKey.String("shared") + // buffers + SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers") + // cached + SystemMemoryStateCached = SystemMemoryStateKey.String("cached") +) + +// Describes System Memory Paging metric attributes +const ( + // SystemPagingDirectionKey is the attribute Key conforming to the + // "system.paging.direction" semantic conventions. It represents the paging + // access direction + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'in' + SystemPagingDirectionKey = attribute.Key("system.paging.direction") + + // SystemPagingStateKey is the attribute Key conforming to the + // "system.paging.state" semantic conventions. It represents the memory + // paging state + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'free' + SystemPagingStateKey = attribute.Key("system.paging.state") + + // SystemPagingTypeKey is the attribute Key conforming to the + // "system.paging.type" semantic conventions. It represents the memory + // paging type + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'minor' + SystemPagingTypeKey = attribute.Key("system.paging.type") +) + +var ( + // in + SystemPagingDirectionIn = SystemPagingDirectionKey.String("in") + // out + SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") +) + +var ( + // used + SystemPagingStateUsed = SystemPagingStateKey.String("used") + // free + SystemPagingStateFree = SystemPagingStateKey.String("free") +) + +var ( + // major + SystemPagingTypeMajor = SystemPagingTypeKey.String("major") + // minor + SystemPagingTypeMinor = SystemPagingTypeKey.String("minor") +) + +// Describes Filesystem metric attributes +const ( + // SystemFilesystemModeKey is the attribute Key conforming to the + // "system.filesystem.mode" semantic conventions. It represents the + // filesystem mode + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'rw, ro' + SystemFilesystemModeKey = attribute.Key("system.filesystem.mode") + + // SystemFilesystemMountpointKey is the attribute Key conforming to the + // "system.filesystem.mountpoint" semantic conventions. It represents the + // filesystem mount path + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/mnt/data' + SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint") + + // SystemFilesystemStateKey is the attribute Key conforming to the + // "system.filesystem.state" semantic conventions. It represents the + // filesystem state + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'used' + SystemFilesystemStateKey = attribute.Key("system.filesystem.state") + + // SystemFilesystemTypeKey is the attribute Key conforming to the + // "system.filesystem.type" semantic conventions. It represents the + // filesystem type + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'ext4' + SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") +) + +var ( + // used + SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used") + // free + SystemFilesystemStateFree = SystemFilesystemStateKey.String("free") + // reserved + SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved") +) + +var ( + // fat32 + SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32") + // exfat + SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat") + // ntfs + SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs") + // refs + SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs") + // hfsplus + SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus") + // ext4 + SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") +) + +// SystemFilesystemMode returns an attribute KeyValue conforming to the +// "system.filesystem.mode" semantic conventions. It represents the filesystem +// mode +func SystemFilesystemMode(val string) attribute.KeyValue { + return SystemFilesystemModeKey.String(val) +} + +// SystemFilesystemMountpoint returns an attribute KeyValue conforming to +// the "system.filesystem.mountpoint" semantic conventions. It represents the +// filesystem mount path +func SystemFilesystemMountpoint(val string) attribute.KeyValue { + return SystemFilesystemMountpointKey.String(val) +} + +// Describes Network metric attributes +const ( + // SystemNetworkStateKey is the attribute Key conforming to the + // "system.network.state" semantic conventions. It represents a stateless + // protocol MUST NOT set this attribute + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'close_wait' + SystemNetworkStateKey = attribute.Key("system.network.state") +) + +var ( + // close + SystemNetworkStateClose = SystemNetworkStateKey.String("close") + // close_wait + SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait") + // closing + SystemNetworkStateClosing = SystemNetworkStateKey.String("closing") + // delete + SystemNetworkStateDelete = SystemNetworkStateKey.String("delete") + // established + SystemNetworkStateEstablished = SystemNetworkStateKey.String("established") + // fin_wait_1 + SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1") + // fin_wait_2 + SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2") + // last_ack + SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack") + // listen + SystemNetworkStateListen = SystemNetworkStateKey.String("listen") + // syn_recv + SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv") + // syn_sent + SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent") + // time_wait + SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait") +) + +// Describes System Process metric attributes +const ( + // SystemProcessesStatusKey is the attribute Key conforming to the + // "system.processes.status" semantic conventions. It represents the + // process state, e.g., [Linux Process State + // Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'running' + SystemProcessesStatusKey = attribute.Key("system.processes.status") +) + +var ( + // running + SystemProcessesStatusRunning = SystemProcessesStatusKey.String("running") + // sleeping + SystemProcessesStatusSleeping = SystemProcessesStatusKey.String("sleeping") + // stopped + SystemProcessesStatusStopped = SystemProcessesStatusKey.String("stopped") + // defunct + SystemProcessesStatusDefunct = SystemProcessesStatusKey.String("defunct") +) + +// These attributes may be used to describe the client in a connection-based +// network interaction where there is one side that initiates the connection +// (the client is the side that initiates the connection). This covers all TCP +// network interactions since TCP is connection-based and one side initiates +// the connection (an exception is made for peer-to-peer communication over TCP +// where the "user-facing" surface of the protocol / API doesn't expose a clear +// notion of client and server). This also covers UDP network interactions +// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. +const ( + // ClientAddressKey is the attribute Key conforming to the "client.address" + // semantic conventions. It represents the client address - domain name if + // available without reverse DNS lookup; otherwise, IP address or Unix + // domain socket name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock' + // Note: When observed from the server side, and when communicating through + // an intermediary, `client.address` SHOULD represent the client address + // behind any intermediaries, for example proxies, if it's available. + ClientAddressKey = attribute.Key("client.address") + + // ClientPortKey is the attribute Key conforming to the "client.port" + // semantic conventions. It represents the client port number. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 65123 + // Note: When observed from the server side, and when communicating through + // an intermediary, `client.port` SHOULD represent the client port behind + // any intermediaries, for example proxies, if it's available. + ClientPortKey = attribute.Key("client.port") +) + +// ClientAddress returns an attribute KeyValue conforming to the +// "client.address" semantic conventions. It represents the client address - +// domain name if available without reverse DNS lookup; otherwise, IP address +// or Unix domain socket name. +func ClientAddress(val string) attribute.KeyValue { + return ClientAddressKey.String(val) +} + +// ClientPort returns an attribute KeyValue conforming to the "client.port" +// semantic conventions. It represents the client port number. +func ClientPort(val int) attribute.KeyValue { + return ClientPortKey.Int(val) +} + +// The attributes used to describe telemetry in the context of databases. +const ( + // DBCassandraConsistencyLevelKey is the attribute Key conforming to the + // "db.cassandra.consistency_level" semantic conventions. It represents the + // consistency level of the query. Based on consistency values from + // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") + + // DBCassandraCoordinatorDCKey is the attribute Key conforming to the + // "db.cassandra.coordinator.dc" semantic conventions. It represents the + // data center of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'us-west-2' + DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") + + // DBCassandraCoordinatorIDKey is the attribute Key conforming to the + // "db.cassandra.coordinator.id" semantic conventions. It represents the ID + // of the coordinating node for a query. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' + DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") + + // DBCassandraIdempotenceKey is the attribute Key conforming to the + // "db.cassandra.idempotence" semantic conventions. It represents the + // whether or not the query is idempotent. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") + + // DBCassandraPageSizeKey is the attribute Key conforming to the + // "db.cassandra.page_size" semantic conventions. It represents the fetch + // size used for paging, i.e. how many rows will be returned at once. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 5000 + DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") + + // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming + // to the "db.cassandra.speculative_execution_count" semantic conventions. + // It represents the number of times a query was speculatively executed. + // Not set or `0` if the query was not executed speculatively. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 0, 2 + DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") + + // DBCassandraTableKey is the attribute Key conforming to the + // "db.cassandra.table" semantic conventions. It represents the name of the + // primary Cassandra table that the operation is acting upon, including the + // keyspace name (if applicable). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'mytable' + // Note: This mirrors the db.sql.table attribute but references cassandra + // rather than sql. It is not recommended to attempt any client-side + // parsing of `db.statement` just to get this property, but it should be + // set if it is provided by the library being instrumented. If the + // operation is acting upon an anonymous table, or more than one table, + // this value MUST NOT be set. + DBCassandraTableKey = attribute.Key("db.cassandra.table") + + // DBConnectionStringKey is the attribute Key conforming to the + // "db.connection_string" semantic conventions. It represents the + // connection string used to connect to the database. It is recommended to + // remove embedded credentials. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' + DBConnectionStringKey = attribute.Key("db.connection_string") + + // DBCosmosDBClientIDKey is the attribute Key conforming to the + // "db.cosmosdb.client_id" semantic conventions. It represents the unique + // Cosmos client instance id. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' + DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") + + // DBCosmosDBConnectionModeKey is the attribute Key conforming to the + // "db.cosmosdb.connection_mode" semantic conventions. It represents the + // cosmos client connection mode. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") + + // DBCosmosDBContainerKey is the attribute Key conforming to the + // "db.cosmosdb.container" semantic conventions. It represents the cosmos + // DB container name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'anystring' + DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") + + // DBCosmosDBOperationTypeKey is the attribute Key conforming to the + // "db.cosmosdb.operation_type" semantic conventions. It represents the + // cosmosDB Operation Type. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") + + // DBCosmosDBRequestChargeKey is the attribute Key conforming to the + // "db.cosmosdb.request_charge" semantic conventions. It represents the rU + // consumed for that operation + // + // Type: double + // RequirementLevel: Optional + // Stability: experimental + // Examples: 46.18, 1.0 + DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") + + // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the + // "db.cosmosdb.request_content_length" semantic conventions. It represents + // the request payload size in bytes + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") + + // DBCosmosDBStatusCodeKey is the attribute Key conforming to the + // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos + // DB status code. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 200, 201 + DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") + + // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the + // "db.cosmosdb.sub_status_code" semantic conventions. It represents the + // cosmos DB sub status code. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1000, 1002 + DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") + + // DBElasticsearchClusterNameKey is the attribute Key conforming to the + // "db.elasticsearch.cluster.name" semantic conventions. It represents the + // represents the identifier of an Elasticsearch cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'e9106fc68e3044f0b1475b04bf4ffd5f' + DBElasticsearchClusterNameKey = attribute.Key("db.elasticsearch.cluster.name") + + // DBElasticsearchNodeNameKey is the attribute Key conforming to the + // "db.elasticsearch.node.name" semantic conventions. It represents the + // represents the human-readable identifier of the node/instance to which a + // request was routed. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'instance-0000000001' + DBElasticsearchNodeNameKey = attribute.Key("db.elasticsearch.node.name") + + // DBInstanceIDKey is the attribute Key conforming to the "db.instance.id" + // semantic conventions. It represents an identifier (address, unique name, + // or any other identifier) of the database instance that is executing + // queries or mutations on the current connection. This is useful in cases + // where the database is running in a clustered environment and the + // instrumentation is able to record the node executing the query. The + // client may obtain this value in databases like MySQL using queries like + // `select @@hostname`. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'mysql-e26b99z.example.com' + DBInstanceIDKey = attribute.Key("db.instance.id") + + // DBJDBCDriverClassnameKey is the attribute Key conforming to the + // "db.jdbc.driver_classname" semantic conventions. It represents the + // fully-qualified class name of the [Java Database Connectivity + // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) + // driver used to connect. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'org.postgresql.Driver', + // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' + DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") + + // DBMongoDBCollectionKey is the attribute Key conforming to the + // "db.mongodb.collection" semantic conventions. It represents the MongoDB + // collection being accessed within the database stated in `db.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'customers', 'products' + DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") + + // DBMSSQLInstanceNameKey is the attribute Key conforming to the + // "db.mssql.instance_name" semantic conventions. It represents the + // Microsoft SQL Server [instance + // name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) + // connecting to. This name is used to determine the port of a named + // instance. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MSSQLSERVER' + // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer + // required (but still recommended if non-standard). + DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") + + // DBNameKey is the attribute Key conforming to the "db.name" semantic + // conventions. It represents the this attribute is used to report the name + // of the database being accessed. For commands that switch the database, + // this should be set to the target database (even if the command fails). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'customers', 'main' + // Note: In some SQL databases, the database name to be used is called + // "schema name". In case there are multiple layers that could be + // considered for database name (e.g. Oracle instance name and schema + // name), the database name to be used is the more specific layer (e.g. + // Oracle schema name). + DBNameKey = attribute.Key("db.name") + + // DBOperationKey is the attribute Key conforming to the "db.operation" + // semantic conventions. It represents the name of the operation being + // executed, e.g. the [MongoDB command + // name](https://docs.mongodb.com/manual/reference/command/#database-operations) + // such as `findAndModify`, or the SQL keyword. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'findAndModify', 'HMSET', 'SELECT' + // Note: When setting this to an SQL keyword, it is not recommended to + // attempt any client-side parsing of `db.statement` just to get this + // property, but it should be set if the operation name is provided by the + // library being instrumented. If the SQL statement has an ambiguous + // operation, or performs more than one operation, this value may be + // omitted. + DBOperationKey = attribute.Key("db.operation") + + // DBRedisDBIndexKey is the attribute Key conforming to the + // "db.redis.database_index" semantic conventions. It represents the index + // of the database being accessed as used in the [`SELECT` + // command](https://redis.io/commands/select), provided as an integer. To + // be used instead of the generic `db.name` attribute. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 0, 1, 15 + DBRedisDBIndexKey = attribute.Key("db.redis.database_index") + + // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" + // semantic conventions. It represents the name of the primary table that + // the operation is acting upon, including the database name (if + // applicable). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'public.users', 'customers' + // Note: It is not recommended to attempt any client-side parsing of + // `db.statement` just to get this property, but it should be set if it is + // provided by the library being instrumented. If the operation is acting + // upon an anonymous table, or more than one table, this value MUST NOT be + // set. + DBSQLTableKey = attribute.Key("db.sql.table") + + // DBStatementKey is the attribute Key conforming to the "db.statement" + // semantic conventions. It represents the database statement being + // executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' + DBStatementKey = attribute.Key("db.statement") + + // DBSystemKey is the attribute Key conforming to the "db.system" semantic + // conventions. It represents an identifier for the database management + // system (DBMS) product being used. See below for a list of well-known + // identifiers. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + DBSystemKey = attribute.Key("db.system") + + // DBUserKey is the attribute Key conforming to the "db.user" semantic + // conventions. It represents the username for accessing the database. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'readonly_user', 'reporting_user' + DBUserKey = attribute.Key("db.user") +) + +var ( + // all + DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") + // each_quorum + DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") + // quorum + DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") + // local_quorum + DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") + // one + DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") + // two + DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") + // three + DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") + // local_one + DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") + // any + DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") + // serial + DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") + // local_serial + DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") +) + +var ( + // Gateway (HTTP) connections mode + DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") + // Direct connection + DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") +) + +var ( + // invalid + DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") + // create + DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") + // patch + DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") + // read + DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") + // read_feed + DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") + // delete + DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") + // replace + DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") + // execute + DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") + // query + DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") + // head + DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") + // head_feed + DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") + // upsert + DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") + // batch + DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") + // query_plan + DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") + // execute_javascript + DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") +) + +var ( + // Some other SQL database. Fallback only. See notes + DBSystemOtherSQL = DBSystemKey.String("other_sql") + // Microsoft SQL Server + DBSystemMSSQL = DBSystemKey.String("mssql") + // Microsoft SQL Server Compact + DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") + // MySQL + DBSystemMySQL = DBSystemKey.String("mysql") + // Oracle Database + DBSystemOracle = DBSystemKey.String("oracle") + // IBM DB2 + DBSystemDB2 = DBSystemKey.String("db2") + // PostgreSQL + DBSystemPostgreSQL = DBSystemKey.String("postgresql") + // Amazon Redshift + DBSystemRedshift = DBSystemKey.String("redshift") + // Apache Hive + DBSystemHive = DBSystemKey.String("hive") + // Cloudscape + DBSystemCloudscape = DBSystemKey.String("cloudscape") + // HyperSQL DataBase + DBSystemHSQLDB = DBSystemKey.String("hsqldb") + // Progress Database + DBSystemProgress = DBSystemKey.String("progress") + // SAP MaxDB + DBSystemMaxDB = DBSystemKey.String("maxdb") + // SAP HANA + DBSystemHanaDB = DBSystemKey.String("hanadb") + // Ingres + DBSystemIngres = DBSystemKey.String("ingres") + // FirstSQL + DBSystemFirstSQL = DBSystemKey.String("firstsql") + // EnterpriseDB + DBSystemEDB = DBSystemKey.String("edb") + // InterSystems Caché + DBSystemCache = DBSystemKey.String("cache") + // Adabas (Adaptable Database System) + DBSystemAdabas = DBSystemKey.String("adabas") + // Firebird + DBSystemFirebird = DBSystemKey.String("firebird") + // Apache Derby + DBSystemDerby = DBSystemKey.String("derby") + // FileMaker + DBSystemFilemaker = DBSystemKey.String("filemaker") + // Informix + DBSystemInformix = DBSystemKey.String("informix") + // InstantDB + DBSystemInstantDB = DBSystemKey.String("instantdb") + // InterBase + DBSystemInterbase = DBSystemKey.String("interbase") + // MariaDB + DBSystemMariaDB = DBSystemKey.String("mariadb") + // Netezza + DBSystemNetezza = DBSystemKey.String("netezza") + // Pervasive PSQL + DBSystemPervasive = DBSystemKey.String("pervasive") + // PointBase + DBSystemPointbase = DBSystemKey.String("pointbase") + // SQLite + DBSystemSqlite = DBSystemKey.String("sqlite") + // Sybase + DBSystemSybase = DBSystemKey.String("sybase") + // Teradata + DBSystemTeradata = DBSystemKey.String("teradata") + // Vertica + DBSystemVertica = DBSystemKey.String("vertica") + // H2 + DBSystemH2 = DBSystemKey.String("h2") + // ColdFusion IMQ + DBSystemColdfusion = DBSystemKey.String("coldfusion") + // Apache Cassandra + DBSystemCassandra = DBSystemKey.String("cassandra") + // Apache HBase + DBSystemHBase = DBSystemKey.String("hbase") + // MongoDB + DBSystemMongoDB = DBSystemKey.String("mongodb") + // Redis + DBSystemRedis = DBSystemKey.String("redis") + // Couchbase + DBSystemCouchbase = DBSystemKey.String("couchbase") + // CouchDB + DBSystemCouchDB = DBSystemKey.String("couchdb") + // Microsoft Azure Cosmos DB + DBSystemCosmosDB = DBSystemKey.String("cosmosdb") + // Amazon DynamoDB + DBSystemDynamoDB = DBSystemKey.String("dynamodb") + // Neo4j + DBSystemNeo4j = DBSystemKey.String("neo4j") + // Apache Geode + DBSystemGeode = DBSystemKey.String("geode") + // Elasticsearch + DBSystemElasticsearch = DBSystemKey.String("elasticsearch") + // Memcached + DBSystemMemcached = DBSystemKey.String("memcached") + // CockroachDB + DBSystemCockroachdb = DBSystemKey.String("cockroachdb") + // OpenSearch + DBSystemOpensearch = DBSystemKey.String("opensearch") + // ClickHouse + DBSystemClickhouse = DBSystemKey.String("clickhouse") + // Cloud Spanner + DBSystemSpanner = DBSystemKey.String("spanner") + // Trino + DBSystemTrino = DBSystemKey.String("trino") +) + +// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.dc" semantic conventions. It represents the data +// center of the coordinating node for a query. +func DBCassandraCoordinatorDC(val string) attribute.KeyValue { + return DBCassandraCoordinatorDCKey.String(val) +} + +// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the +// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of +// the coordinating node for a query. +func DBCassandraCoordinatorID(val string) attribute.KeyValue { + return DBCassandraCoordinatorIDKey.String(val) +} + +// DBCassandraIdempotence returns an attribute KeyValue conforming to the +// "db.cassandra.idempotence" semantic conventions. It represents the whether +// or not the query is idempotent. +func DBCassandraIdempotence(val bool) attribute.KeyValue { + return DBCassandraIdempotenceKey.Bool(val) +} + +// DBCassandraPageSize returns an attribute KeyValue conforming to the +// "db.cassandra.page_size" semantic conventions. It represents the fetch size +// used for paging, i.e. how many rows will be returned at once. +func DBCassandraPageSize(val int) attribute.KeyValue { + return DBCassandraPageSizeKey.Int(val) +} + +// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue +// conforming to the "db.cassandra.speculative_execution_count" semantic +// conventions. It represents the number of times a query was speculatively +// executed. Not set or `0` if the query was not executed speculatively. +func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { + return DBCassandraSpeculativeExecutionCountKey.Int(val) +} + +// DBCassandraTable returns an attribute KeyValue conforming to the +// "db.cassandra.table" semantic conventions. It represents the name of the +// primary Cassandra table that the operation is acting upon, including the +// keyspace name (if applicable). +func DBCassandraTable(val string) attribute.KeyValue { + return DBCassandraTableKey.String(val) +} + +// DBConnectionString returns an attribute KeyValue conforming to the +// "db.connection_string" semantic conventions. It represents the connection +// string used to connect to the database. It is recommended to remove embedded +// credentials. +func DBConnectionString(val string) attribute.KeyValue { + return DBConnectionStringKey.String(val) +} + +// DBCosmosDBClientID returns an attribute KeyValue conforming to the +// "db.cosmosdb.client_id" semantic conventions. It represents the unique +// Cosmos client instance id. +func DBCosmosDBClientID(val string) attribute.KeyValue { + return DBCosmosDBClientIDKey.String(val) +} + +// DBCosmosDBContainer returns an attribute KeyValue conforming to the +// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB +// container name. +func DBCosmosDBContainer(val string) attribute.KeyValue { + return DBCosmosDBContainerKey.String(val) +} + +// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the +// "db.cosmosdb.request_charge" semantic conventions. It represents the rU +// consumed for that operation +func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { + return DBCosmosDBRequestChargeKey.Float64(val) +} + +// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming +// to the "db.cosmosdb.request_content_length" semantic conventions. It +// represents the request payload size in bytes +func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { + return DBCosmosDBRequestContentLengthKey.Int(val) +} + +// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the +// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB +// status code. +func DBCosmosDBStatusCode(val int) attribute.KeyValue { + return DBCosmosDBStatusCodeKey.Int(val) +} + +// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the +// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos +// DB sub status code. +func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { + return DBCosmosDBSubStatusCodeKey.Int(val) +} + +// DBElasticsearchClusterName returns an attribute KeyValue conforming to +// the "db.elasticsearch.cluster.name" semantic conventions. It represents the +// represents the identifier of an Elasticsearch cluster. +func DBElasticsearchClusterName(val string) attribute.KeyValue { + return DBElasticsearchClusterNameKey.String(val) +} + +// DBElasticsearchNodeName returns an attribute KeyValue conforming to the +// "db.elasticsearch.node.name" semantic conventions. It represents the +// represents the human-readable identifier of the node/instance to which a +// request was routed. +func DBElasticsearchNodeName(val string) attribute.KeyValue { + return DBElasticsearchNodeNameKey.String(val) +} + +// DBInstanceID returns an attribute KeyValue conforming to the +// "db.instance.id" semantic conventions. It represents an identifier (address, +// unique name, or any other identifier) of the database instance that is +// executing queries or mutations on the current connection. This is useful in +// cases where the database is running in a clustered environment and the +// instrumentation is able to record the node executing the query. The client +// may obtain this value in databases like MySQL using queries like `select +// @@hostname`. +func DBInstanceID(val string) attribute.KeyValue { + return DBInstanceIDKey.String(val) +} + +// DBJDBCDriverClassname returns an attribute KeyValue conforming to the +// "db.jdbc.driver_classname" semantic conventions. It represents the +// fully-qualified class name of the [Java Database Connectivity +// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver +// used to connect. +func DBJDBCDriverClassname(val string) attribute.KeyValue { + return DBJDBCDriverClassnameKey.String(val) +} + +// DBMongoDBCollection returns an attribute KeyValue conforming to the +// "db.mongodb.collection" semantic conventions. It represents the MongoDB +// collection being accessed within the database stated in `db.name`. +func DBMongoDBCollection(val string) attribute.KeyValue { + return DBMongoDBCollectionKey.String(val) +} + +// DBMSSQLInstanceName returns an attribute KeyValue conforming to the +// "db.mssql.instance_name" semantic conventions. It represents the Microsoft +// SQL Server [instance +// name](https://docs.microsoft.com/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) +// connecting to. This name is used to determine the port of a named instance. +func DBMSSQLInstanceName(val string) attribute.KeyValue { + return DBMSSQLInstanceNameKey.String(val) +} + +// DBName returns an attribute KeyValue conforming to the "db.name" semantic +// conventions. It represents the this attribute is used to report the name of +// the database being accessed. For commands that switch the database, this +// should be set to the target database (even if the command fails). +func DBName(val string) attribute.KeyValue { + return DBNameKey.String(val) +} + +// DBOperation returns an attribute KeyValue conforming to the +// "db.operation" semantic conventions. It represents the name of the operation +// being executed, e.g. the [MongoDB command +// name](https://docs.mongodb.com/manual/reference/command/#database-operations) +// such as `findAndModify`, or the SQL keyword. +func DBOperation(val string) attribute.KeyValue { + return DBOperationKey.String(val) +} + +// DBRedisDBIndex returns an attribute KeyValue conforming to the +// "db.redis.database_index" semantic conventions. It represents the index of +// the database being accessed as used in the [`SELECT` +// command](https://redis.io/commands/select), provided as an integer. To be +// used instead of the generic `db.name` attribute. +func DBRedisDBIndex(val int) attribute.KeyValue { + return DBRedisDBIndexKey.Int(val) +} + +// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" +// semantic conventions. It represents the name of the primary table that the +// operation is acting upon, including the database name (if applicable). +func DBSQLTable(val string) attribute.KeyValue { + return DBSQLTableKey.String(val) +} + +// DBStatement returns an attribute KeyValue conforming to the +// "db.statement" semantic conventions. It represents the database statement +// being executed. +func DBStatement(val string) attribute.KeyValue { + return DBStatementKey.String(val) +} + +// DBUser returns an attribute KeyValue conforming to the "db.user" semantic +// conventions. It represents the username for accessing the database. +func DBUser(val string) attribute.KeyValue { + return DBUserKey.String(val) +} + +// Describes deprecated HTTP attributes. +const ( + // HTTPFlavorKey is the attribute Key conforming to the "http.flavor" + // semantic conventions. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: deprecated + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorKey = attribute.Key("http.flavor") + + // HTTPMethodKey is the attribute Key conforming to the "http.method" + // semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'GET', 'POST', 'HEAD' + // Deprecated: use `http.request.method` instead. + HTTPMethodKey = attribute.Key("http.method") + + // HTTPRequestContentLengthKey is the attribute Key conforming to the + // "http.request_content_length" semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 3495 + // Deprecated: use `http.request.header.content-length` instead. + HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") + + // HTTPResponseContentLengthKey is the attribute Key conforming to the + // "http.response_content_length" semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 3495 + // Deprecated: use `http.response.header.content-length` instead. + HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") + + // HTTPSchemeKey is the attribute Key conforming to the "http.scheme" + // semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'http', 'https' + // Deprecated: use `url.scheme` instead. + HTTPSchemeKey = attribute.Key("http.scheme") + + // HTTPStatusCodeKey is the attribute Key conforming to the + // "http.status_code" semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 200 + // Deprecated: use `http.response.status_code` instead. + HTTPStatusCodeKey = attribute.Key("http.status_code") + + // HTTPTargetKey is the attribute Key conforming to the "http.target" + // semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/search?q=OpenTelemetry#SemConv' + // Deprecated: use `url.path` and `url.query` instead. + HTTPTargetKey = attribute.Key("http.target") + + // HTTPURLKey is the attribute Key conforming to the "http.url" semantic + // conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' + // Deprecated: use `url.full` instead. + HTTPURLKey = attribute.Key("http.url") + + // HTTPUserAgentKey is the attribute Key conforming to the + // "http.user_agent" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU + // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) + // Version/14.1.2 Mobile/15E148 Safari/604.1' + // Deprecated: use `user_agent.original` instead. + HTTPUserAgentKey = attribute.Key("http.user_agent") +) + +var ( + // HTTP/1.0 + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0") + // HTTP/1.1 + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1") + // HTTP/2 + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0") + // HTTP/3 + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0") + // SPDY protocol + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY") + // QUIC protocol + // + // Deprecated: use `network.protocol.name` instead. + HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC") +) + +// HTTPMethod returns an attribute KeyValue conforming to the "http.method" +// semantic conventions. +// +// Deprecated: use `http.request.method` instead. +func HTTPMethod(val string) attribute.KeyValue { + return HTTPMethodKey.String(val) +} + +// HTTPRequestContentLength returns an attribute KeyValue conforming to the +// "http.request_content_length" semantic conventions. +// +// Deprecated: use `http.request.header.content-length` instead. +func HTTPRequestContentLength(val int) attribute.KeyValue { + return HTTPRequestContentLengthKey.Int(val) +} + +// HTTPResponseContentLength returns an attribute KeyValue conforming to the +// "http.response_content_length" semantic conventions. +// +// Deprecated: use `http.response.header.content-length` instead. +func HTTPResponseContentLength(val int) attribute.KeyValue { + return HTTPResponseContentLengthKey.Int(val) +} + +// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" +// semantic conventions. +// +// Deprecated: use `url.scheme` instead. +func HTTPScheme(val string) attribute.KeyValue { + return HTTPSchemeKey.String(val) +} + +// HTTPStatusCode returns an attribute KeyValue conforming to the +// "http.status_code" semantic conventions. +// +// Deprecated: use `http.response.status_code` instead. +func HTTPStatusCode(val int) attribute.KeyValue { + return HTTPStatusCodeKey.Int(val) +} + +// HTTPTarget returns an attribute KeyValue conforming to the "http.target" +// semantic conventions. +// +// Deprecated: use `url.path` and `url.query` instead. +func HTTPTarget(val string) attribute.KeyValue { + return HTTPTargetKey.String(val) +} + +// HTTPURL returns an attribute KeyValue conforming to the "http.url" +// semantic conventions. +// +// Deprecated: use `url.full` instead. +func HTTPURL(val string) attribute.KeyValue { + return HTTPURLKey.String(val) +} + +// HTTPUserAgent returns an attribute KeyValue conforming to the +// "http.user_agent" semantic conventions. +// +// Deprecated: use `user_agent.original` instead. +func HTTPUserAgent(val string) attribute.KeyValue { + return HTTPUserAgentKey.String(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetHostNameKey is the attribute Key conforming to the "net.host.name" + // semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'example.com' + // Deprecated: use `server.address`. + NetHostNameKey = attribute.Key("net.host.name") + + // NetHostPortKey is the attribute Key conforming to the "net.host.port" + // semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + // Deprecated: use `server.port`. + NetHostPortKey = attribute.Key("net.host.port") + + // NetPeerNameKey is the attribute Key conforming to the "net.peer.name" + // semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'example.com' + // Deprecated: use `server.address` on client spans and `client.address` on + // server spans. + NetPeerNameKey = attribute.Key("net.peer.name") + + // NetPeerPortKey is the attribute Key conforming to the "net.peer.port" + // semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + // Deprecated: use `server.port` on client spans and `client.port` on + // server spans. + NetPeerPortKey = attribute.Key("net.peer.port") + + // NetProtocolNameKey is the attribute Key conforming to the + // "net.protocol.name" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 'amqp', 'http', 'mqtt' + // Deprecated: use `network.protocol.name`. + NetProtocolNameKey = attribute.Key("net.protocol.name") + + // NetProtocolVersionKey is the attribute Key conforming to the + // "net.protocol.version" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '3.1.1' + // Deprecated: use `network.protocol.version`. + NetProtocolVersionKey = attribute.Key("net.protocol.version") + + // NetSockFamilyKey is the attribute Key conforming to the + // "net.sock.family" semantic conventions. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: deprecated + // Deprecated: use `network.transport` and `network.type`. + NetSockFamilyKey = attribute.Key("net.sock.family") + + // NetSockHostAddrKey is the attribute Key conforming to the + // "net.sock.host.addr" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/var/my.sock' + // Deprecated: use `network.local.address`. + NetSockHostAddrKey = attribute.Key("net.sock.host.addr") + + // NetSockHostPortKey is the attribute Key conforming to the + // "net.sock.host.port" semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 8080 + // Deprecated: use `network.local.port`. + NetSockHostPortKey = attribute.Key("net.sock.host.port") + + // NetSockPeerAddrKey is the attribute Key conforming to the + // "net.sock.peer.addr" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '192.168.0.1' + // Deprecated: use `network.peer.address`. + NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") + + // NetSockPeerNameKey is the attribute Key conforming to the + // "net.sock.peer.name" semantic conventions. + // + // Type: string + // RequirementLevel: Optional + // Stability: deprecated + // Examples: '/var/my.sock' + // Deprecated: no replacement at this time. + NetSockPeerNameKey = attribute.Key("net.sock.peer.name") + + // NetSockPeerPortKey is the attribute Key conforming to the + // "net.sock.peer.port" semantic conventions. + // + // Type: int + // RequirementLevel: Optional + // Stability: deprecated + // Examples: 65531 + // Deprecated: use `network.peer.port`. + NetSockPeerPortKey = attribute.Key("net.sock.peer.port") + + // NetTransportKey is the attribute Key conforming to the "net.transport" + // semantic conventions. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: deprecated + // Deprecated: use `network.transport`. + NetTransportKey = attribute.Key("net.transport") +) + +var ( + // IPv4 address + // + // Deprecated: use `network.transport` and `network.type`. + NetSockFamilyInet = NetSockFamilyKey.String("inet") + // IPv6 address + // + // Deprecated: use `network.transport` and `network.type`. + NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") + // Unix domain socket path + // + // Deprecated: use `network.transport` and `network.type`. + NetSockFamilyUnix = NetSockFamilyKey.String("unix") +) + +var ( + // ip_tcp + // + // Deprecated: use `network.transport`. + NetTransportTCP = NetTransportKey.String("ip_tcp") + // ip_udp + // + // Deprecated: use `network.transport`. + NetTransportUDP = NetTransportKey.String("ip_udp") + // Named or anonymous pipe + // + // Deprecated: use `network.transport`. + NetTransportPipe = NetTransportKey.String("pipe") + // In-process communication + // + // Deprecated: use `network.transport`. + NetTransportInProc = NetTransportKey.String("inproc") + // Something else (non IP-based) + // + // Deprecated: use `network.transport`. + NetTransportOther = NetTransportKey.String("other") +) + +// NetHostName returns an attribute KeyValue conforming to the +// "net.host.name" semantic conventions. +// +// Deprecated: use `server.address`. +func NetHostName(val string) attribute.KeyValue { + return NetHostNameKey.String(val) +} + +// NetHostPort returns an attribute KeyValue conforming to the +// "net.host.port" semantic conventions. +// +// Deprecated: use `server.port`. +func NetHostPort(val int) attribute.KeyValue { + return NetHostPortKey.Int(val) +} + +// NetPeerName returns an attribute KeyValue conforming to the +// "net.peer.name" semantic conventions. +// +// Deprecated: use `server.address` on client spans and `client.address` on +// server spans. +func NetPeerName(val string) attribute.KeyValue { + return NetPeerNameKey.String(val) +} + +// NetPeerPort returns an attribute KeyValue conforming to the +// "net.peer.port" semantic conventions. +// +// Deprecated: use `server.port` on client spans and `client.port` on server +// spans. +func NetPeerPort(val int) attribute.KeyValue { + return NetPeerPortKey.Int(val) +} + +// NetProtocolName returns an attribute KeyValue conforming to the +// "net.protocol.name" semantic conventions. +// +// Deprecated: use `network.protocol.name`. +func NetProtocolName(val string) attribute.KeyValue { + return NetProtocolNameKey.String(val) +} + +// NetProtocolVersion returns an attribute KeyValue conforming to the +// "net.protocol.version" semantic conventions. +// +// Deprecated: use `network.protocol.version`. +func NetProtocolVersion(val string) attribute.KeyValue { + return NetProtocolVersionKey.String(val) +} + +// NetSockHostAddr returns an attribute KeyValue conforming to the +// "net.sock.host.addr" semantic conventions. +// +// Deprecated: use `network.local.address`. +func NetSockHostAddr(val string) attribute.KeyValue { + return NetSockHostAddrKey.String(val) +} + +// NetSockHostPort returns an attribute KeyValue conforming to the +// "net.sock.host.port" semantic conventions. +// +// Deprecated: use `network.local.port`. +func NetSockHostPort(val int) attribute.KeyValue { + return NetSockHostPortKey.Int(val) +} + +// NetSockPeerAddr returns an attribute KeyValue conforming to the +// "net.sock.peer.addr" semantic conventions. +// +// Deprecated: use `network.peer.address`. +func NetSockPeerAddr(val string) attribute.KeyValue { + return NetSockPeerAddrKey.String(val) +} + +// NetSockPeerName returns an attribute KeyValue conforming to the +// "net.sock.peer.name" semantic conventions. +// +// Deprecated: no replacement at this time. +func NetSockPeerName(val string) attribute.KeyValue { + return NetSockPeerNameKey.String(val) +} + +// NetSockPeerPort returns an attribute KeyValue conforming to the +// "net.sock.peer.port" semantic conventions. +// +// Deprecated: use `network.peer.port`. +func NetSockPeerPort(val int) attribute.KeyValue { + return NetSockPeerPortKey.Int(val) +} + +// These attributes may be used to describe the receiver of a network +// exchange/packet. These should be used when there is no client/server +// relationship between the two sides, or when that relationship is unknown. +// This covers low-level network interactions (e.g. packet tracing) where you +// don't know if there was a connection or which side initiated it. This also +// covers unidirectional UDP flows and peer-to-peer communication where the +// "user-facing" surface of the protocol / API doesn't expose a clear notion of +// client and server. +const ( + // DestinationAddressKey is the attribute Key conforming to the + // "destination.address" semantic conventions. It represents the + // destination address - domain name if available without reverse DNS + // lookup; otherwise, IP address or Unix domain socket name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock' + // Note: When observed from the source side, and when communicating through + // an intermediary, `destination.address` SHOULD represent the destination + // address behind any intermediaries, for example proxies, if it's + // available. + DestinationAddressKey = attribute.Key("destination.address") + + // DestinationPortKey is the attribute Key conforming to the + // "destination.port" semantic conventions. It represents the destination + // port number + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 3389, 2888 + DestinationPortKey = attribute.Key("destination.port") +) + +// DestinationAddress returns an attribute KeyValue conforming to the +// "destination.address" semantic conventions. It represents the destination +// address - domain name if available without reverse DNS lookup; otherwise, IP +// address or Unix domain socket name. +func DestinationAddress(val string) attribute.KeyValue { + return DestinationAddressKey.String(val) +} + +// DestinationPort returns an attribute KeyValue conforming to the +// "destination.port" semantic conventions. It represents the destination port +// number +func DestinationPort(val int) attribute.KeyValue { + return DestinationPortKey.Int(val) +} + +// These attributes may be used for any disk related operation. +const ( + // DiskIoDirectionKey is the attribute Key conforming to the + // "disk.io.direction" semantic conventions. It represents the disk IO + // operation direction. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'read' + DiskIoDirectionKey = attribute.Key("disk.io.direction") +) + +var ( + // read + DiskIoDirectionRead = DiskIoDirectionKey.String("read") + // write + DiskIoDirectionWrite = DiskIoDirectionKey.String("write") +) + +// The shared attributes used to report an error. +const ( + // ErrorTypeKey is the attribute Key conforming to the "error.type" + // semantic conventions. It represents the describes a class of error the + // operation ended with. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'timeout', 'java.net.UnknownHostException', + // 'server_certificate_invalid', '500' + // Note: The `error.type` SHOULD be predictable and SHOULD have low + // cardinality. + // Instrumentations SHOULD document the list of errors they report. + // + // The cardinality of `error.type` within one instrumentation library + // SHOULD be low. + // Telemetry consumers that aggregate data from multiple instrumentation + // libraries and applications + // should be prepared for `error.type` to have high cardinality at query + // time when no + // additional filters are applied. + // + // If the operation has completed successfully, instrumentations SHOULD NOT + // set `error.type`. + // + // If a specific domain defines its own set of error identifiers (such as + // HTTP or gRPC status codes), + // it's RECOMMENDED to: + // + // * Use a domain-specific attribute + // * Set `error.type` to capture all errors, regardless of whether they are + // defined within the domain-specific set or not. + ErrorTypeKey = attribute.Key("error.type") +) + +var ( + // A fallback error value to be used when the instrumentation doesn't define a custom value + ErrorTypeOther = ErrorTypeKey.String("_OTHER") +) + +// The shared attributes used to report a single exception associated with a +// span or log. +const ( + // ExceptionEscapedKey is the attribute Key conforming to the + // "exception.escaped" semantic conventions. It represents the sHOULD be + // set to true if the exception event is recorded at a point where it is + // known that the exception is escaping the scope of the span. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + // Note: An exception is considered to have escaped (or left) the scope of + // a span, + // if that span is ended while the exception is still logically "in + // flight". + // This may be actually "in flight" in some languages (e.g. if the + // exception + // is passed to a Context manager's `__exit__` method in Python) but will + // usually be caught at the point of recording the exception in most + // languages. + // + // It is usually not possible to determine at the point where an exception + // is thrown + // whether it will escape the scope of a span. + // However, it is trivial to know that an exception + // will escape, if one checks for an active exception just before ending + // the span, + // as done in the [example for recording span + // exceptions](#recording-an-exception). + // + // It follows that an exception may still escape the scope of the span + // even if the `exception.escaped` attribute was not set or set to false, + // since the event might have been recorded at a time where it was not + // clear whether the exception will escape. + ExceptionEscapedKey = attribute.Key("exception.escaped") + + // ExceptionMessageKey is the attribute Key conforming to the + // "exception.message" semantic conventions. It represents the exception + // message. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Division by zero', "Can't convert 'int' object to str + // implicitly" + ExceptionMessageKey = attribute.Key("exception.message") + + // ExceptionStacktraceKey is the attribute Key conforming to the + // "exception.stacktrace" semantic conventions. It represents a stacktrace + // as a string in the natural representation for the language runtime. The + // representation is to be determined and documented by each language SIG. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test + // exception\\n at ' + // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' + // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' + // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' + ExceptionStacktraceKey = attribute.Key("exception.stacktrace") + + // ExceptionTypeKey is the attribute Key conforming to the "exception.type" + // semantic conventions. It represents the type of the exception (its + // fully-qualified class name, if applicable). The dynamic type of the + // exception should be preferred over the static type in languages that + // support it. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'java.net.ConnectException', 'OSError' + ExceptionTypeKey = attribute.Key("exception.type") +) + +// ExceptionEscaped returns an attribute KeyValue conforming to the +// "exception.escaped" semantic conventions. It represents the sHOULD be set to +// true if the exception event is recorded at a point where it is known that +// the exception is escaping the scope of the span. +func ExceptionEscaped(val bool) attribute.KeyValue { + return ExceptionEscapedKey.Bool(val) +} + +// ExceptionMessage returns an attribute KeyValue conforming to the +// "exception.message" semantic conventions. It represents the exception +// message. +func ExceptionMessage(val string) attribute.KeyValue { + return ExceptionMessageKey.String(val) +} + +// ExceptionStacktrace returns an attribute KeyValue conforming to the +// "exception.stacktrace" semantic conventions. It represents a stacktrace as a +// string in the natural representation for the language runtime. The +// representation is to be determined and documented by each language SIG. +func ExceptionStacktrace(val string) attribute.KeyValue { + return ExceptionStacktraceKey.String(val) +} + +// ExceptionType returns an attribute KeyValue conforming to the +// "exception.type" semantic conventions. It represents the type of the +// exception (its fully-qualified class name, if applicable). The dynamic type +// of the exception should be preferred over the static type in languages that +// support it. +func ExceptionType(val string) attribute.KeyValue { + return ExceptionTypeKey.String(val) +} + +// Semantic convention attributes in the HTTP namespace. +const ( + // HTTPRequestBodySizeKey is the attribute Key conforming to the + // "http.request.body.size" semantic conventions. It represents the size of + // the request payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 3495 + HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") + + // HTTPRequestMethodKey is the attribute Key conforming to the + // "http.request.method" semantic conventions. It represents the hTTP + // request method. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'GET', 'POST', 'HEAD' + // Note: HTTP request method value SHOULD be "known" to the + // instrumentation. + // By default, this convention defines "known" methods as the ones listed + // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) + // and the PATCH method defined in + // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). + // + // If the HTTP request method is not known to instrumentation, it MUST set + // the `http.request.method` attribute to `_OTHER`. + // + // If the HTTP instrumentation could end up converting valid HTTP request + // methods to `_OTHER`, then it MUST provide a way to override + // the list of known HTTP methods. If this override is done via environment + // variable, then the environment variable MUST be named + // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated + // list of case-sensitive known HTTP methods + // (this list MUST be a full override of the default known method, it is + // not a list of known methods in addition to the defaults). + // + // HTTP method names are case-sensitive and `http.request.method` attribute + // value MUST match a known HTTP method name exactly. + // Instrumentations for specific web frameworks that consider HTTP methods + // to be case insensitive, SHOULD populate a canonical equivalent. + // Tracing instrumentations that do so, MUST also set + // `http.request.method_original` to the original value. + HTTPRequestMethodKey = attribute.Key("http.request.method") + + // HTTPRequestMethodOriginalKey is the attribute Key conforming to the + // "http.request.method_original" semantic conventions. It represents the + // original HTTP method sent by the client in the request line. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'GeT', 'ACL', 'foo' + HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") + + // HTTPRequestResendCountKey is the attribute Key conforming to the + // "http.request.resend_count" semantic conventions. It represents the + // ordinal number of request resending attempt (for any reason, including + // redirects). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 3 + // Note: The resend count SHOULD be updated each time an HTTP request gets + // resent by the client, regardless of what was the cause of the resending + // (e.g. redirection, authorization failure, 503 Server Unavailable, + // network issues, or any other). + HTTPRequestResendCountKey = attribute.Key("http.request.resend_count") + + // HTTPResponseBodySizeKey is the attribute Key conforming to the + // "http.response.body.size" semantic conventions. It represents the size + // of the response payload body in bytes. This is the number of bytes + // transferred excluding headers and is often, but not always, present as + // the + // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) + // header. For requests using transport encoding, this should be the + // compressed size. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 3495 + HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") + + // HTTPResponseStatusCodeKey is the attribute Key conforming to the + // "http.response.status_code" semantic conventions. It represents the + // [HTTP response status + // code](https://tools.ietf.org/html/rfc7231#section-6). + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 200 + HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") + + // HTTPRouteKey is the attribute Key conforming to the "http.route" + // semantic conventions. It represents the matched route, that is, the path + // template in the format used by the respective server framework. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/users/:userID?', '{controller}/{action}/{id?}' + // Note: MUST NOT be populated when this is not supported by the HTTP + // server framework as the route attribute should have low-cardinality and + // the URI path can NOT substitute it. + // SHOULD include the [application + // root](/docs/http/http-spans.md#http-server-definitions) if there is one. + HTTPRouteKey = attribute.Key("http.route") +) + +var ( + // CONNECT method + HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") + // DELETE method + HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") + // GET method + HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") + // HEAD method + HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") + // OPTIONS method + HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") + // PATCH method + HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") + // POST method + HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") + // PUT method + HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") + // TRACE method + HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") + // Any HTTP method that the instrumentation has no prior knowledge of + HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") +) + +// HTTPRequestBodySize returns an attribute KeyValue conforming to the +// "http.request.body.size" semantic conventions. It represents the size of the +// request payload body in bytes. This is the number of bytes transferred +// excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPRequestBodySize(val int) attribute.KeyValue { + return HTTPRequestBodySizeKey.Int(val) +} + +// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the +// "http.request.method_original" semantic conventions. It represents the +// original HTTP method sent by the client in the request line. +func HTTPRequestMethodOriginal(val string) attribute.KeyValue { + return HTTPRequestMethodOriginalKey.String(val) +} + +// HTTPRequestResendCount returns an attribute KeyValue conforming to the +// "http.request.resend_count" semantic conventions. It represents the ordinal +// number of request resending attempt (for any reason, including redirects). +func HTTPRequestResendCount(val int) attribute.KeyValue { + return HTTPRequestResendCountKey.Int(val) +} + +// HTTPResponseBodySize returns an attribute KeyValue conforming to the +// "http.response.body.size" semantic conventions. It represents the size of +// the response payload body in bytes. This is the number of bytes transferred +// excluding headers and is often, but not always, present as the +// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) +// header. For requests using transport encoding, this should be the compressed +// size. +func HTTPResponseBodySize(val int) attribute.KeyValue { + return HTTPResponseBodySizeKey.Int(val) +} + +// HTTPResponseStatusCode returns an attribute KeyValue conforming to the +// "http.response.status_code" semantic conventions. It represents the [HTTP +// response status code](https://tools.ietf.org/html/rfc7231#section-6). +func HTTPResponseStatusCode(val int) attribute.KeyValue { + return HTTPResponseStatusCodeKey.Int(val) +} + +// HTTPRoute returns an attribute KeyValue conforming to the "http.route" +// semantic conventions. It represents the matched route, that is, the path +// template in the format used by the respective server framework. +func HTTPRoute(val string) attribute.KeyValue { + return HTTPRouteKey.String(val) +} + +// Attributes describing telemetry around messaging systems and messaging +// activities. +const ( + // MessagingBatchMessageCountKey is the attribute Key conforming to the + // "messaging.batch.message_count" semantic conventions. It represents the + // number of messages sent, received, or processed in the scope of the + // batching operation. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 0, 1, 2 + // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on + // spans that operate with a single message. When a messaging client + // library supports both batch and single-message API for the same + // operation, instrumentations SHOULD use `messaging.batch.message_count` + // for batching APIs and SHOULD NOT use it for single-message APIs. + MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") + + // MessagingClientIDKey is the attribute Key conforming to the + // "messaging.client_id" semantic conventions. It represents a unique + // identifier for the client that consumes or produces a message. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'client-5', 'myhost@8742@s8083jm' + MessagingClientIDKey = attribute.Key("messaging.client_id") + + // MessagingDestinationAnonymousKey is the attribute Key conforming to the + // "messaging.destination.anonymous" semantic conventions. It represents a + // boolean that is true if the message destination is anonymous (could be + // unnamed or have auto-generated name). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") + + // MessagingDestinationNameKey is the attribute Key conforming to the + // "messaging.destination.name" semantic conventions. It represents the + // message destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MyQueue', 'MyTopic' + // Note: Destination name SHOULD uniquely identify a specific queue, topic + // or other entity within the broker. If + // the broker doesn't have such notion, the destination name SHOULD + // uniquely identify the broker. + MessagingDestinationNameKey = attribute.Key("messaging.destination.name") + + // MessagingDestinationTemplateKey is the attribute Key conforming to the + // "messaging.destination.template" semantic conventions. It represents the + // low cardinality representation of the messaging destination name + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/customers/{customerID}' + // Note: Destination names could be constructed from templates. An example + // would be a destination name involving a user name or product id. + // Although the destination name in this case is of high cardinality, the + // underlying template is of low cardinality and can be effectively used + // for grouping and aggregation. + MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") + + // MessagingDestinationTemporaryKey is the attribute Key conforming to the + // "messaging.destination.temporary" semantic conventions. It represents a + // boolean that is true if the message destination is temporary and might + // not exist anymore after messages are processed. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") + + // MessagingDestinationPublishAnonymousKey is the attribute Key conforming + // to the "messaging.destination_publish.anonymous" semantic conventions. + // It represents a boolean that is true if the publish message destination + // is anonymous (could be unnamed or have auto-generated name). + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous") + + // MessagingDestinationPublishNameKey is the attribute Key conforming to + // the "messaging.destination_publish.name" semantic conventions. It + // represents the name of the original destination the message was + // published to + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MyQueue', 'MyTopic' + // Note: The name SHOULD uniquely identify a specific queue, topic, or + // other entity within the broker. If + // the broker doesn't have such notion, the original destination name + // SHOULD uniquely identify the broker. + MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name") + + // MessagingGCPPubsubMessageOrderingKeyKey is the attribute Key conforming + // to the "messaging.gcp_pubsub.message.ordering_key" semantic conventions. + // It represents the ordering key for a given message. If the attribute is + // not present, the message does not have an ordering key. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'ordering_key' + MessagingGCPPubsubMessageOrderingKeyKey = attribute.Key("messaging.gcp_pubsub.message.ordering_key") + + // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the + // "messaging.kafka.consumer.group" semantic conventions. It represents the + // name of the Kafka Consumer Group that is handling the message. Only + // applies to consumers, not producers. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'my-group' + MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") + + // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to + // the "messaging.kafka.destination.partition" semantic conventions. It + // represents the partition the message is sent to. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 2 + MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") + + // MessagingKafkaMessageKeyKey is the attribute Key conforming to the + // "messaging.kafka.message.key" semantic conventions. It represents the + // message keys in Kafka are used for grouping alike messages to ensure + // they're processed on the same partition. They differ from + // `messaging.message.id` in that they're not unique. If the key is `null`, + // the attribute MUST NOT be set. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myKey' + // Note: If the key type is not string, it's string representation has to + // be supplied for the attribute. If the key has no unambiguous, canonical + // string form, don't include its value. + MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") + + // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the + // "messaging.kafka.message.offset" semantic conventions. It represents the + // offset of a record in the corresponding Kafka partition. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 42 + MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") + + // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the + // "messaging.kafka.message.tombstone" semantic conventions. It represents + // a boolean that is true if the message is a tombstone. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") + + // MessagingMessageBodySizeKey is the attribute Key conforming to the + // "messaging.message.body.size" semantic conventions. It represents the + // size of the message body in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1439 + // Note: This can refer to both the compressed or uncompressed body size. + // If both sizes are known, the uncompressed + // body size should be used. + MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size") + + // MessagingMessageConversationIDKey is the attribute Key conforming to the + // "messaging.message.conversation_id" semantic conventions. It represents + // the conversation ID identifying the conversation to which the message + // belongs, represented as a string. Sometimes called "Correlation ID". + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MyConversationID' + MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") + + // MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the + // "messaging.message.envelope.size" semantic conventions. It represents + // the size of the message body and metadata in bytes. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 2738 + // Note: This can refer to both the compressed or uncompressed size. If + // both sizes are known, the uncompressed + // size should be used. + MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size") + + // MessagingMessageIDKey is the attribute Key conforming to the + // "messaging.message.id" semantic conventions. It represents a value used + // by the messaging system as an identifier for the message, represented as + // a string. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '452a7c7c7c7048c2f887f61572b18fc2' + MessagingMessageIDKey = attribute.Key("messaging.message.id") + + // MessagingOperationKey is the attribute Key conforming to the + // "messaging.operation" semantic conventions. It represents a string + // identifying the kind of messaging operation. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Note: If a custom value is used, it MUST be of low cardinality. + MessagingOperationKey = attribute.Key("messaging.operation") + + // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key + // conforming to the "messaging.rabbitmq.destination.routing_key" semantic + // conventions. It represents the rabbitMQ message routing key. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myKey' + MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") + + // MessagingRocketmqClientGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.client_group" semantic conventions. It represents + // the name of the RocketMQ producer/consumer group that is handling the + // message. The client type is identified by the SpanKind. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myConsumerGroup' + MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") + + // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to + // the "messaging.rocketmq.consumption_model" semantic conventions. It + // represents the model of message consumption. This only applies to + // consumer spans. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") + + // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delay_time_level" semantic + // conventions. It represents the delay time level for delay message, which + // determines the message delay time. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 3 + MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") + + // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key + // conforming to the "messaging.rocketmq.message.delivery_timestamp" + // semantic conventions. It represents the timestamp in milliseconds that + // the delay message is expected to be delivered to consumer. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1665987217045 + MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") + + // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the + // "messaging.rocketmq.message.group" semantic conventions. It represents + // the it is essential for FIFO message. Messages that belong to the same + // message group are always processed one by one within the same consumer + // group. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myMessageGroup' + MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") + + // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the + // "messaging.rocketmq.message.keys" semantic conventions. It represents + // the key(s) of message, another way to mark message besides message id. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'keyA', 'keyB' + MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") + + // MessagingRocketmqMessageTagKey is the attribute Key conforming to the + // "messaging.rocketmq.message.tag" semantic conventions. It represents the + // secondary classifier of message besides topic. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'tagA' + MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") + + // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the + // "messaging.rocketmq.message.type" semantic conventions. It represents + // the type of message. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") + + // MessagingRocketmqNamespaceKey is the attribute Key conforming to the + // "messaging.rocketmq.namespace" semantic conventions. It represents the + // namespace of RocketMQ resources, resources in different namespaces are + // individual. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myNamespace' + MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") + + // MessagingSystemKey is the attribute Key conforming to the + // "messaging.system" semantic conventions. It represents an identifier for + // the messaging system being used. See below for a list of well-known + // identifiers. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + MessagingSystemKey = attribute.Key("messaging.system") +) + +var ( + // One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created + MessagingOperationPublish = MessagingOperationKey.String("publish") + // A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios + MessagingOperationCreate = MessagingOperationKey.String("create") + // One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages + MessagingOperationReceive = MessagingOperationKey.String("receive") + // One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs + MessagingOperationDeliver = MessagingOperationKey.String("deliver") +) + +var ( + // Clustering consumption model + MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") + // Broadcasting consumption model + MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") +) + +var ( + // Normal message + MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") + // FIFO message + MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") + // Delay message + MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") + // Transaction message + MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") +) + +var ( + // Apache ActiveMQ + MessagingSystemActivemq = MessagingSystemKey.String("activemq") + // Amazon Simple Queue Service (SQS) + MessagingSystemAWSSqs = MessagingSystemKey.String("aws_sqs") + // Azure Event Grid + MessagingSystemAzureEventgrid = MessagingSystemKey.String("azure_eventgrid") + // Azure Event Hubs + MessagingSystemAzureEventhubs = MessagingSystemKey.String("azure_eventhubs") + // Azure Service Bus + MessagingSystemAzureServicebus = MessagingSystemKey.String("azure_servicebus") + // Google Cloud Pub/Sub + MessagingSystemGCPPubsub = MessagingSystemKey.String("gcp_pubsub") + // Java Message Service + MessagingSystemJms = MessagingSystemKey.String("jms") + // Apache Kafka + MessagingSystemKafka = MessagingSystemKey.String("kafka") + // RabbitMQ + MessagingSystemRabbitmq = MessagingSystemKey.String("rabbitmq") + // Apache RocketMQ + MessagingSystemRocketmq = MessagingSystemKey.String("rocketmq") +) + +// MessagingBatchMessageCount returns an attribute KeyValue conforming to +// the "messaging.batch.message_count" semantic conventions. It represents the +// number of messages sent, received, or processed in the scope of the batching +// operation. +func MessagingBatchMessageCount(val int) attribute.KeyValue { + return MessagingBatchMessageCountKey.Int(val) +} + +// MessagingClientID returns an attribute KeyValue conforming to the +// "messaging.client_id" semantic conventions. It represents a unique +// identifier for the client that consumes or produces a message. +func MessagingClientID(val string) attribute.KeyValue { + return MessagingClientIDKey.String(val) +} + +// MessagingDestinationAnonymous returns an attribute KeyValue conforming to +// the "messaging.destination.anonymous" semantic conventions. It represents a +// boolean that is true if the message destination is anonymous (could be +// unnamed or have auto-generated name). +func MessagingDestinationAnonymous(val bool) attribute.KeyValue { + return MessagingDestinationAnonymousKey.Bool(val) +} + +// MessagingDestinationName returns an attribute KeyValue conforming to the +// "messaging.destination.name" semantic conventions. It represents the message +// destination name +func MessagingDestinationName(val string) attribute.KeyValue { + return MessagingDestinationNameKey.String(val) +} + +// MessagingDestinationTemplate returns an attribute KeyValue conforming to +// the "messaging.destination.template" semantic conventions. It represents the +// low cardinality representation of the messaging destination name +func MessagingDestinationTemplate(val string) attribute.KeyValue { + return MessagingDestinationTemplateKey.String(val) +} + +// MessagingDestinationTemporary returns an attribute KeyValue conforming to +// the "messaging.destination.temporary" semantic conventions. It represents a +// boolean that is true if the message destination is temporary and might not +// exist anymore after messages are processed. +func MessagingDestinationTemporary(val bool) attribute.KeyValue { + return MessagingDestinationTemporaryKey.Bool(val) +} + +// MessagingDestinationPublishAnonymous returns an attribute KeyValue +// conforming to the "messaging.destination_publish.anonymous" semantic +// conventions. It represents a boolean that is true if the publish message +// destination is anonymous (could be unnamed or have auto-generated name). +func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue { + return MessagingDestinationPublishAnonymousKey.Bool(val) +} + +// MessagingDestinationPublishName returns an attribute KeyValue conforming +// to the "messaging.destination_publish.name" semantic conventions. It +// represents the name of the original destination the message was published to +func MessagingDestinationPublishName(val string) attribute.KeyValue { + return MessagingDestinationPublishNameKey.String(val) +} + +// MessagingGCPPubsubMessageOrderingKey returns an attribute KeyValue +// conforming to the "messaging.gcp_pubsub.message.ordering_key" semantic +// conventions. It represents the ordering key for a given message. If the +// attribute is not present, the message does not have an ordering key. +func MessagingGCPPubsubMessageOrderingKey(val string) attribute.KeyValue { + return MessagingGCPPubsubMessageOrderingKeyKey.String(val) +} + +// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to +// the "messaging.kafka.consumer.group" semantic conventions. It represents the +// name of the Kafka Consumer Group that is handling the message. Only applies +// to consumers, not producers. +func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { + return MessagingKafkaConsumerGroupKey.String(val) +} + +// MessagingKafkaDestinationPartition returns an attribute KeyValue +// conforming to the "messaging.kafka.destination.partition" semantic +// conventions. It represents the partition the message is sent to. +func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { + return MessagingKafkaDestinationPartitionKey.Int(val) +} + +// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the +// "messaging.kafka.message.key" semantic conventions. It represents the +// message keys in Kafka are used for grouping alike messages to ensure they're +// processed on the same partition. They differ from `messaging.message.id` in +// that they're not unique. If the key is `null`, the attribute MUST NOT be +// set. +func MessagingKafkaMessageKey(val string) attribute.KeyValue { + return MessagingKafkaMessageKeyKey.String(val) +} + +// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to +// the "messaging.kafka.message.offset" semantic conventions. It represents the +// offset of a record in the corresponding Kafka partition. +func MessagingKafkaMessageOffset(val int) attribute.KeyValue { + return MessagingKafkaMessageOffsetKey.Int(val) +} + +// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming +// to the "messaging.kafka.message.tombstone" semantic conventions. It +// represents a boolean that is true if the message is a tombstone. +func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { + return MessagingKafkaMessageTombstoneKey.Bool(val) +} + +// MessagingMessageBodySize returns an attribute KeyValue conforming to the +// "messaging.message.body.size" semantic conventions. It represents the size +// of the message body in bytes. +func MessagingMessageBodySize(val int) attribute.KeyValue { + return MessagingMessageBodySizeKey.Int(val) +} + +// MessagingMessageConversationID returns an attribute KeyValue conforming +// to the "messaging.message.conversation_id" semantic conventions. It +// represents the conversation ID identifying the conversation to which the +// message belongs, represented as a string. Sometimes called "Correlation ID". +func MessagingMessageConversationID(val string) attribute.KeyValue { + return MessagingMessageConversationIDKey.String(val) +} + +// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to +// the "messaging.message.envelope.size" semantic conventions. It represents +// the size of the message body and metadata in bytes. +func MessagingMessageEnvelopeSize(val int) attribute.KeyValue { + return MessagingMessageEnvelopeSizeKey.Int(val) +} + +// MessagingMessageID returns an attribute KeyValue conforming to the +// "messaging.message.id" semantic conventions. It represents a value used by +// the messaging system as an identifier for the message, represented as a +// string. +func MessagingMessageID(val string) attribute.KeyValue { + return MessagingMessageIDKey.String(val) +} + +// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue +// conforming to the "messaging.rabbitmq.destination.routing_key" semantic +// conventions. It represents the rabbitMQ message routing key. +func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { + return MessagingRabbitmqDestinationRoutingKeyKey.String(val) +} + +// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.client_group" semantic conventions. It represents +// the name of the RocketMQ producer/consumer group that is handling the +// message. The client type is identified by the SpanKind. +func MessagingRocketmqClientGroup(val string) attribute.KeyValue { + return MessagingRocketmqClientGroupKey.String(val) +} + +// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delay_time_level" semantic +// conventions. It represents the delay time level for delay message, which +// determines the message delay time. +func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { + return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) +} + +// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue +// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic +// conventions. It represents the timestamp in milliseconds that the delay +// message is expected to be delivered to consumer. +func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { + return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) +} + +// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.group" semantic conventions. It represents +// the it is essential for FIFO message. Messages that belong to the same +// message group are always processed one by one within the same consumer +// group. +func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { + return MessagingRocketmqMessageGroupKey.String(val) +} + +// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.keys" semantic conventions. It represents +// the key(s) of message, another way to mark message besides message id. +func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { + return MessagingRocketmqMessageKeysKey.StringSlice(val) +} + +// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to +// the "messaging.rocketmq.message.tag" semantic conventions. It represents the +// secondary classifier of message besides topic. +func MessagingRocketmqMessageTag(val string) attribute.KeyValue { + return MessagingRocketmqMessageTagKey.String(val) +} + +// MessagingRocketmqNamespace returns an attribute KeyValue conforming to +// the "messaging.rocketmq.namespace" semantic conventions. It represents the +// namespace of RocketMQ resources, resources in different namespaces are +// individual. +func MessagingRocketmqNamespace(val string) attribute.KeyValue { + return MessagingRocketmqNamespaceKey.String(val) +} + +// These attributes may be used for any network related operation. +const ( + // NetworkCarrierIccKey is the attribute Key conforming to the + // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 + // alpha-2 2-character country code associated with the mobile carrier + // network. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'DE' + NetworkCarrierIccKey = attribute.Key("network.carrier.icc") + + // NetworkCarrierMccKey is the attribute Key conforming to the + // "network.carrier.mcc" semantic conventions. It represents the mobile + // carrier country code. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '310' + NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") + + // NetworkCarrierMncKey is the attribute Key conforming to the + // "network.carrier.mnc" semantic conventions. It represents the mobile + // carrier network code. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '001' + NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") + + // NetworkCarrierNameKey is the attribute Key conforming to the + // "network.carrier.name" semantic conventions. It represents the name of + // the mobile carrier. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'sprint' + NetworkCarrierNameKey = attribute.Key("network.carrier.name") + + // NetworkConnectionSubtypeKey is the attribute Key conforming to the + // "network.connection.subtype" semantic conventions. It represents the + // this describes more details regarding the connection.type. It may be the + // type of cell technology connection, but it could be used for describing + // details about a wifi connection. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'LTE' + NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") + + // NetworkConnectionTypeKey is the attribute Key conforming to the + // "network.connection.type" semantic conventions. It represents the + // internet connection type. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'wifi' + NetworkConnectionTypeKey = attribute.Key("network.connection.type") + + // NetworkIoDirectionKey is the attribute Key conforming to the + // "network.io.direction" semantic conventions. It represents the network + // IO operation direction. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'transmit' + NetworkIoDirectionKey = attribute.Key("network.io.direction") + + // NetworkLocalAddressKey is the attribute Key conforming to the + // "network.local.address" semantic conventions. It represents the local + // address of the network connection - IP address or Unix domain socket + // name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10.1.2.80', '/tmp/my.sock' + NetworkLocalAddressKey = attribute.Key("network.local.address") + + // NetworkLocalPortKey is the attribute Key conforming to the + // "network.local.port" semantic conventions. It represents the local port + // number of the network connection. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 65123 + NetworkLocalPortKey = attribute.Key("network.local.port") + + // NetworkPeerAddressKey is the attribute Key conforming to the + // "network.peer.address" semantic conventions. It represents the peer + // address of the network connection - IP address or Unix domain socket + // name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '10.1.2.80', '/tmp/my.sock' + NetworkPeerAddressKey = attribute.Key("network.peer.address") + + // NetworkPeerPortKey is the attribute Key conforming to the + // "network.peer.port" semantic conventions. It represents the peer port + // number of the network connection. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 65123 + NetworkPeerPortKey = attribute.Key("network.peer.port") + + // NetworkProtocolNameKey is the attribute Key conforming to the + // "network.protocol.name" semantic conventions. It represents the [OSI + // application layer](https://osi-model.com/application-layer/) or non-OSI + // equivalent. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'amqp', 'http', 'mqtt' + // Note: The value SHOULD be normalized to lowercase. + NetworkProtocolNameKey = attribute.Key("network.protocol.name") + + // NetworkProtocolVersionKey is the attribute Key conforming to the + // "network.protocol.version" semantic conventions. It represents the + // version of the protocol specified in `network.protocol.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '3.1.1' + // Note: `network.protocol.version` refers to the version of the protocol + // used and might be different from the protocol client's version. If the + // HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, + // this attribute should be set to `1.1`. + NetworkProtocolVersionKey = attribute.Key("network.protocol.version") + + // NetworkTransportKey is the attribute Key conforming to the + // "network.transport" semantic conventions. It represents the [OSI + // transport layer](https://osi-model.com/transport-layer/) or + // [inter-process communication + // method](https://wikipedia.org/wiki/Inter-process_communication). + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'tcp', 'udp' + // Note: The value SHOULD be normalized to lowercase. + // + // Consider always setting the transport when setting a port number, since + // a port number is ambiguous without knowing the transport. For example + // different processes could be listening on TCP port 12345 and UDP port + // 12345. + NetworkTransportKey = attribute.Key("network.transport") + + // NetworkTypeKey is the attribute Key conforming to the "network.type" + // semantic conventions. It represents the [OSI network + // layer](https://osi-model.com/network-layer/) or non-OSI equivalent. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: stable + // Examples: 'ipv4', 'ipv6' + // Note: The value SHOULD be normalized to lowercase. + NetworkTypeKey = attribute.Key("network.type") +) + +var ( + // GPRS + NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") + // EDGE + NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") + // UMTS + NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") + // CDMA + NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") + // EVDO Rel. 0 + NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") + // EVDO Rev. A + NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") + // CDMA2000 1XRTT + NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") + // HSDPA + NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") + // HSUPA + NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") + // HSPA + NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") + // IDEN + NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") + // EVDO Rev. B + NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") + // LTE + NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") + // EHRPD + NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") + // HSPAP + NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") + // GSM + NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") + // TD-SCDMA + NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") + // IWLAN + NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") + // 5G NR (New Radio) + NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") + // 5G NRNSA (New Radio Non-Standalone) + NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") + // LTE CA + NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") +) + +var ( + // wifi + NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") + // wired + NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") + // cell + NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") + // unavailable + NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") + // unknown + NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") +) + +var ( + // transmit + NetworkIoDirectionTransmit = NetworkIoDirectionKey.String("transmit") + // receive + NetworkIoDirectionReceive = NetworkIoDirectionKey.String("receive") +) + +var ( + // TCP + NetworkTransportTCP = NetworkTransportKey.String("tcp") + // UDP + NetworkTransportUDP = NetworkTransportKey.String("udp") + // Named or anonymous pipe + NetworkTransportPipe = NetworkTransportKey.String("pipe") + // Unix domain socket + NetworkTransportUnix = NetworkTransportKey.String("unix") +) + +var ( + // IPv4 + NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") + // IPv6 + NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") +) + +// NetworkCarrierIcc returns an attribute KeyValue conforming to the +// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 +// alpha-2 2-character country code associated with the mobile carrier network. +func NetworkCarrierIcc(val string) attribute.KeyValue { + return NetworkCarrierIccKey.String(val) +} + +// NetworkCarrierMcc returns an attribute KeyValue conforming to the +// "network.carrier.mcc" semantic conventions. It represents the mobile carrier +// country code. +func NetworkCarrierMcc(val string) attribute.KeyValue { + return NetworkCarrierMccKey.String(val) +} + +// NetworkCarrierMnc returns an attribute KeyValue conforming to the +// "network.carrier.mnc" semantic conventions. It represents the mobile carrier +// network code. +func NetworkCarrierMnc(val string) attribute.KeyValue { + return NetworkCarrierMncKey.String(val) +} + +// NetworkCarrierName returns an attribute KeyValue conforming to the +// "network.carrier.name" semantic conventions. It represents the name of the +// mobile carrier. +func NetworkCarrierName(val string) attribute.KeyValue { + return NetworkCarrierNameKey.String(val) +} + +// NetworkLocalAddress returns an attribute KeyValue conforming to the +// "network.local.address" semantic conventions. It represents the local +// address of the network connection - IP address or Unix domain socket name. +func NetworkLocalAddress(val string) attribute.KeyValue { + return NetworkLocalAddressKey.String(val) +} + +// NetworkLocalPort returns an attribute KeyValue conforming to the +// "network.local.port" semantic conventions. It represents the local port +// number of the network connection. +func NetworkLocalPort(val int) attribute.KeyValue { + return NetworkLocalPortKey.Int(val) +} + +// NetworkPeerAddress returns an attribute KeyValue conforming to the +// "network.peer.address" semantic conventions. It represents the peer address +// of the network connection - IP address or Unix domain socket name. +func NetworkPeerAddress(val string) attribute.KeyValue { + return NetworkPeerAddressKey.String(val) +} + +// NetworkPeerPort returns an attribute KeyValue conforming to the +// "network.peer.port" semantic conventions. It represents the peer port number +// of the network connection. +func NetworkPeerPort(val int) attribute.KeyValue { + return NetworkPeerPortKey.Int(val) +} + +// NetworkProtocolName returns an attribute KeyValue conforming to the +// "network.protocol.name" semantic conventions. It represents the [OSI +// application layer](https://osi-model.com/application-layer/) or non-OSI +// equivalent. +func NetworkProtocolName(val string) attribute.KeyValue { + return NetworkProtocolNameKey.String(val) +} + +// NetworkProtocolVersion returns an attribute KeyValue conforming to the +// "network.protocol.version" semantic conventions. It represents the version +// of the protocol specified in `network.protocol.name`. +func NetworkProtocolVersion(val string) attribute.KeyValue { + return NetworkProtocolVersionKey.String(val) +} + +// Attributes for remote procedure calls. +const ( + // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the + // "rpc.connect_rpc.error_code" semantic conventions. It represents the + // [error codes](https://connect.build/docs/protocol/#error-codes) of the + // Connect request. Error codes are always string values. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") + + // RPCGRPCStatusCodeKey is the attribute Key conforming to the + // "rpc.grpc.status_code" semantic conventions. It represents the [numeric + // status + // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of + // the gRPC request. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") + + // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_code" semantic conventions. It represents the + // `error.code` property of response if it is an error response. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: -32700, 100 + RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") + + // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the + // "rpc.jsonrpc.error_message" semantic conventions. It represents the + // `error.message` property of response if it is an error response. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Parse error', 'User already exists' + RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") + + // RPCJsonrpcRequestIDKey is the attribute Key conforming to the + // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` + // property of request or response. Since protocol allows id to be int, + // string, `null` or missing (for notifications), value is expected to be + // cast to string for simplicity. Use empty string in case of `null` value. + // Omit entirely if this is a notification. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '10', 'request-7', '' + RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") + + // RPCJsonrpcVersionKey is the attribute Key conforming to the + // "rpc.jsonrpc.version" semantic conventions. It represents the protocol + // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 + // doesn't specify this, the value can be omitted. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '2.0', '1.0' + RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") + + // RPCMethodKey is the attribute Key conforming to the "rpc.method" + // semantic conventions. It represents the name of the (logical) method + // being called, must be equal to the $method part in the span name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'exampleMethod' + // Note: This is the logical name of the method from the RPC interface + // perspective, which can be different from the name of any implementing + // method/function. The `code.function` attribute may be used to store the + // latter (e.g., method actually executing the call on the server side, RPC + // client stub method on the client side). + RPCMethodKey = attribute.Key("rpc.method") + + // RPCServiceKey is the attribute Key conforming to the "rpc.service" + // semantic conventions. It represents the full (logical) name of the + // service being called, including its package name, if applicable. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myservice.EchoService' + // Note: This is the logical name of the service from the RPC interface + // perspective, which can be different from the name of any implementing + // class. The `code.namespace` attribute may be used to store the latter + // (despite the attribute name, it may include a class name; e.g., class + // with method actually executing the call on the server side, RPC client + // stub class on the client side). + RPCServiceKey = attribute.Key("rpc.service") + + // RPCSystemKey is the attribute Key conforming to the "rpc.system" + // semantic conventions. It represents a string identifying the remoting + // system. See below for a list of well-known identifiers. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + RPCSystemKey = attribute.Key("rpc.system") +) + +var ( + // cancelled + RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") + // unknown + RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") + // invalid_argument + RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") + // deadline_exceeded + RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") + // not_found + RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") + // already_exists + RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") + // permission_denied + RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") + // resource_exhausted + RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") + // failed_precondition + RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") + // aborted + RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") + // out_of_range + RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") + // unimplemented + RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") + // internal + RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") + // unavailable + RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") + // data_loss + RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") + // unauthenticated + RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") +) + +var ( + // OK + RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) + // CANCELLED + RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) + // UNKNOWN + RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) + // INVALID_ARGUMENT + RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) + // DEADLINE_EXCEEDED + RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) + // NOT_FOUND + RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) + // ALREADY_EXISTS + RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) + // PERMISSION_DENIED + RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) + // RESOURCE_EXHAUSTED + RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) + // FAILED_PRECONDITION + RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) + // ABORTED + RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) + // OUT_OF_RANGE + RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) + // UNIMPLEMENTED + RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) + // INTERNAL + RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) + // UNAVAILABLE + RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) + // DATA_LOSS + RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) + // UNAUTHENTICATED + RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) +) + +var ( + // gRPC + RPCSystemGRPC = RPCSystemKey.String("grpc") + // Java RMI + RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") + // .NET WCF + RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") + // Apache Dubbo + RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") + // Connect RPC + RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") +) + +// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_code" semantic conventions. It represents the +// `error.code` property of response if it is an error response. +func RPCJsonrpcErrorCode(val int) attribute.KeyValue { + return RPCJsonrpcErrorCodeKey.Int(val) +} + +// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.error_message" semantic conventions. It represents the +// `error.message` property of response if it is an error response. +func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { + return RPCJsonrpcErrorMessageKey.String(val) +} + +// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` +// property of request or response. Since protocol allows id to be int, string, +// `null` or missing (for notifications), value is expected to be cast to +// string for simplicity. Use empty string in case of `null` value. Omit +// entirely if this is a notification. +func RPCJsonrpcRequestID(val string) attribute.KeyValue { + return RPCJsonrpcRequestIDKey.String(val) +} + +// RPCJsonrpcVersion returns an attribute KeyValue conforming to the +// "rpc.jsonrpc.version" semantic conventions. It represents the protocol +// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 +// doesn't specify this, the value can be omitted. +func RPCJsonrpcVersion(val string) attribute.KeyValue { + return RPCJsonrpcVersionKey.String(val) +} + +// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" +// semantic conventions. It represents the name of the (logical) method being +// called, must be equal to the $method part in the span name. +func RPCMethod(val string) attribute.KeyValue { + return RPCMethodKey.String(val) +} + +// RPCService returns an attribute KeyValue conforming to the "rpc.service" +// semantic conventions. It represents the full (logical) name of the service +// being called, including its package name, if applicable. +func RPCService(val string) attribute.KeyValue { + return RPCServiceKey.String(val) +} + +// These attributes may be used to describe the server in a connection-based +// network interaction where there is one side that initiates the connection +// (the client is the side that initiates the connection). This covers all TCP +// network interactions since TCP is connection-based and one side initiates +// the connection (an exception is made for peer-to-peer communication over TCP +// where the "user-facing" surface of the protocol / API doesn't expose a clear +// notion of client and server). This also covers UDP network interactions +// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. +const ( + // ServerAddressKey is the attribute Key conforming to the "server.address" + // semantic conventions. It represents the server domain name if available + // without reverse DNS lookup; otherwise, IP address or Unix domain socket + // name. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'example.com', '10.1.2.80', '/tmp/my.sock' + // Note: When observed from the client side, and when communicating through + // an intermediary, `server.address` SHOULD represent the server address + // behind any intermediaries, for example proxies, if it's available. + ServerAddressKey = attribute.Key("server.address") + + // ServerPortKey is the attribute Key conforming to the "server.port" + // semantic conventions. It represents the server port number. + // + // Type: int + // RequirementLevel: Optional + // Stability: stable + // Examples: 80, 8080, 443 + // Note: When observed from the client side, and when communicating through + // an intermediary, `server.port` SHOULD represent the server port behind + // any intermediaries, for example proxies, if it's available. + ServerPortKey = attribute.Key("server.port") +) + +// ServerAddress returns an attribute KeyValue conforming to the +// "server.address" semantic conventions. It represents the server domain name +// if available without reverse DNS lookup; otherwise, IP address or Unix +// domain socket name. +func ServerAddress(val string) attribute.KeyValue { + return ServerAddressKey.String(val) +} + +// ServerPort returns an attribute KeyValue conforming to the "server.port" +// semantic conventions. It represents the server port number. +func ServerPort(val int) attribute.KeyValue { + return ServerPortKey.Int(val) +} + +// These attributes may be used to describe the sender of a network +// exchange/packet. These should be used when there is no client/server +// relationship between the two sides, or when that relationship is unknown. +// This covers low-level network interactions (e.g. packet tracing) where you +// don't know if there was a connection or which side initiated it. This also +// covers unidirectional UDP flows and peer-to-peer communication where the +// "user-facing" surface of the protocol / API doesn't expose a clear notion of +// client and server. +const ( + // SourceAddressKey is the attribute Key conforming to the "source.address" + // semantic conventions. It represents the source address - domain name if + // available without reverse DNS lookup; otherwise, IP address or Unix + // domain socket name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock' + // Note: When observed from the destination side, and when communicating + // through an intermediary, `source.address` SHOULD represent the source + // address behind any intermediaries, for example proxies, if it's + // available. + SourceAddressKey = attribute.Key("source.address") + + // SourcePortKey is the attribute Key conforming to the "source.port" + // semantic conventions. It represents the source port number + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 3389, 2888 + SourcePortKey = attribute.Key("source.port") +) + +// SourceAddress returns an attribute KeyValue conforming to the +// "source.address" semantic conventions. It represents the source address - +// domain name if available without reverse DNS lookup; otherwise, IP address +// or Unix domain socket name. +func SourceAddress(val string) attribute.KeyValue { + return SourceAddressKey.String(val) +} + +// SourcePort returns an attribute KeyValue conforming to the "source.port" +// semantic conventions. It represents the source port number +func SourcePort(val int) attribute.KeyValue { + return SourcePortKey.Int(val) +} + +// Semantic convention attributes in the TLS namespace. +const ( + // TLSCipherKey is the attribute Key conforming to the "tls.cipher" + // semantic conventions. It represents the string indicating the + // [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) + // used during the current connection. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'TLS_RSA_WITH_3DES_EDE_CBC_SHA', + // 'TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256' + // Note: The values allowed for `tls.cipher` MUST be one of the + // `Descriptions` of the [registered TLS Cipher + // Suits](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#table-tls-parameters-4). + TLSCipherKey = attribute.Key("tls.cipher") + + // TLSClientCertificateKey is the attribute Key conforming to the + // "tls.client.certificate" semantic conventions. It represents the + // pEM-encoded stand-alone certificate offered by the client. This is + // usually mutually-exclusive of `client.certificate_chain` since this + // value also exists in that list. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MII...' + TLSClientCertificateKey = attribute.Key("tls.client.certificate") + + // TLSClientCertificateChainKey is the attribute Key conforming to the + // "tls.client.certificate_chain" semantic conventions. It represents the + // array of PEM-encoded certificates that make up the certificate chain + // offered by the client. This is usually mutually-exclusive of + // `client.certificate` since that value should be the first certificate in + // the chain. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MII...', 'MI...' + TLSClientCertificateChainKey = attribute.Key("tls.client.certificate_chain") + + // TLSClientHashMd5Key is the attribute Key conforming to the + // "tls.client.hash.md5" semantic conventions. It represents the + // certificate fingerprint using the MD5 digest of DER-encoded version of + // certificate offered by the client. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC' + TLSClientHashMd5Key = attribute.Key("tls.client.hash.md5") + + // TLSClientHashSha1Key is the attribute Key conforming to the + // "tls.client.hash.sha1" semantic conventions. It represents the + // certificate fingerprint using the SHA1 digest of DER-encoded version of + // certificate offered by the client. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A' + TLSClientHashSha1Key = attribute.Key("tls.client.hash.sha1") + + // TLSClientHashSha256Key is the attribute Key conforming to the + // "tls.client.hash.sha256" semantic conventions. It represents the + // certificate fingerprint using the SHA256 digest of DER-encoded version + // of certificate offered by the client. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0' + TLSClientHashSha256Key = attribute.Key("tls.client.hash.sha256") + + // TLSClientIssuerKey is the attribute Key conforming to the + // "tls.client.issuer" semantic conventions. It represents the + // distinguished name of + // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) + // of the issuer of the x.509 certificate presented by the client. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example, + // DC=com' + TLSClientIssuerKey = attribute.Key("tls.client.issuer") + + // TLSClientJa3Key is the attribute Key conforming to the "tls.client.ja3" + // semantic conventions. It represents a hash that identifies clients based + // on how they perform an SSL/TLS handshake. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'd4e5b18d6b55c71272893221c96ba240' + TLSClientJa3Key = attribute.Key("tls.client.ja3") + + // TLSClientNotAfterKey is the attribute Key conforming to the + // "tls.client.not_after" semantic conventions. It represents the date/Time + // indicating when client certificate is no longer considered valid. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '2021-01-01T00:00:00.000Z' + TLSClientNotAfterKey = attribute.Key("tls.client.not_after") + + // TLSClientNotBeforeKey is the attribute Key conforming to the + // "tls.client.not_before" semantic conventions. It represents the + // date/Time indicating when client certificate is first considered valid. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '1970-01-01T00:00:00.000Z' + TLSClientNotBeforeKey = attribute.Key("tls.client.not_before") + + // TLSClientServerNameKey is the attribute Key conforming to the + // "tls.client.server_name" semantic conventions. It represents the also + // called an SNI, this tells the server which hostname to which the client + // is attempting to connect to. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'opentelemetry.io' + TLSClientServerNameKey = attribute.Key("tls.client.server_name") + + // TLSClientSubjectKey is the attribute Key conforming to the + // "tls.client.subject" semantic conventions. It represents the + // distinguished name of subject of the x.509 certificate presented by the + // client. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'CN=myclient, OU=Documentation Team, DC=example, DC=com' + TLSClientSubjectKey = attribute.Key("tls.client.subject") + + // TLSClientSupportedCiphersKey is the attribute Key conforming to the + // "tls.client.supported_ciphers" semantic conventions. It represents the + // array of ciphers offered by the client during the client hello. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: '"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + // "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "..."' + TLSClientSupportedCiphersKey = attribute.Key("tls.client.supported_ciphers") + + // TLSCurveKey is the attribute Key conforming to the "tls.curve" semantic + // conventions. It represents the string indicating the curve used for the + // given cipher, when applicable + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'secp256r1' + TLSCurveKey = attribute.Key("tls.curve") + + // TLSEstablishedKey is the attribute Key conforming to the + // "tls.established" semantic conventions. It represents the boolean flag + // indicating if the TLS negotiation was successful and transitioned to an + // encrypted tunnel. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + // Examples: True + TLSEstablishedKey = attribute.Key("tls.established") + + // TLSNextProtocolKey is the attribute Key conforming to the + // "tls.next_protocol" semantic conventions. It represents the string + // indicating the protocol being tunneled. Per the values in the [IANA + // registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), + // this string should be lower case. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'http/1.1' + TLSNextProtocolKey = attribute.Key("tls.next_protocol") + + // TLSProtocolNameKey is the attribute Key conforming to the + // "tls.protocol.name" semantic conventions. It represents the normalized + // lowercase protocol name parsed from original string of the negotiated + // [SSL/TLS protocol + // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + TLSProtocolNameKey = attribute.Key("tls.protocol.name") + + // TLSProtocolVersionKey is the attribute Key conforming to the + // "tls.protocol.version" semantic conventions. It represents the numeric + // part of the version parsed from the original string of the negotiated + // [SSL/TLS protocol + // version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '1.2', '3' + TLSProtocolVersionKey = attribute.Key("tls.protocol.version") + + // TLSResumedKey is the attribute Key conforming to the "tls.resumed" + // semantic conventions. It represents the boolean flag indicating if this + // TLS connection was resumed from an existing TLS negotiation. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + // Examples: True + TLSResumedKey = attribute.Key("tls.resumed") + + // TLSServerCertificateKey is the attribute Key conforming to the + // "tls.server.certificate" semantic conventions. It represents the + // pEM-encoded stand-alone certificate offered by the server. This is + // usually mutually-exclusive of `server.certificate_chain` since this + // value also exists in that list. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MII...' + TLSServerCertificateKey = attribute.Key("tls.server.certificate") + + // TLSServerCertificateChainKey is the attribute Key conforming to the + // "tls.server.certificate_chain" semantic conventions. It represents the + // array of PEM-encoded certificates that make up the certificate chain + // offered by the server. This is usually mutually-exclusive of + // `server.certificate` since that value should be the first certificate in + // the chain. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'MII...', 'MI...' + TLSServerCertificateChainKey = attribute.Key("tls.server.certificate_chain") + + // TLSServerHashMd5Key is the attribute Key conforming to the + // "tls.server.hash.md5" semantic conventions. It represents the + // certificate fingerprint using the MD5 digest of DER-encoded version of + // certificate offered by the server. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '0F76C7F2C55BFD7D8E8B8F4BFBF0C9EC' + TLSServerHashMd5Key = attribute.Key("tls.server.hash.md5") + + // TLSServerHashSha1Key is the attribute Key conforming to the + // "tls.server.hash.sha1" semantic conventions. It represents the + // certificate fingerprint using the SHA1 digest of DER-encoded version of + // certificate offered by the server. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '9E393D93138888D288266C2D915214D1D1CCEB2A' + TLSServerHashSha1Key = attribute.Key("tls.server.hash.sha1") + + // TLSServerHashSha256Key is the attribute Key conforming to the + // "tls.server.hash.sha256" semantic conventions. It represents the + // certificate fingerprint using the SHA256 digest of DER-encoded version + // of certificate offered by the server. For consistency with other hash + // values, this value should be formatted as an uppercase hash. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // '0687F666A054EF17A08E2F2162EAB4CBC0D265E1D7875BE74BF3C712CA92DAF0' + TLSServerHashSha256Key = attribute.Key("tls.server.hash.sha256") + + // TLSServerIssuerKey is the attribute Key conforming to the + // "tls.server.issuer" semantic conventions. It represents the + // distinguished name of + // [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) + // of the issuer of the x.509 certificate presented by the client. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'CN=Example Root CA, OU=Infrastructure Team, DC=example, + // DC=com' + TLSServerIssuerKey = attribute.Key("tls.server.issuer") + + // TLSServerJa3sKey is the attribute Key conforming to the + // "tls.server.ja3s" semantic conventions. It represents a hash that + // identifies servers based on how they perform an SSL/TLS handshake. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'd4e5b18d6b55c71272893221c96ba240' + TLSServerJa3sKey = attribute.Key("tls.server.ja3s") + + // TLSServerNotAfterKey is the attribute Key conforming to the + // "tls.server.not_after" semantic conventions. It represents the date/Time + // indicating when server certificate is no longer considered valid. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '2021-01-01T00:00:00.000Z' + TLSServerNotAfterKey = attribute.Key("tls.server.not_after") + + // TLSServerNotBeforeKey is the attribute Key conforming to the + // "tls.server.not_before" semantic conventions. It represents the + // date/Time indicating when server certificate is first considered valid. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '1970-01-01T00:00:00.000Z' + TLSServerNotBeforeKey = attribute.Key("tls.server.not_before") + + // TLSServerSubjectKey is the attribute Key conforming to the + // "tls.server.subject" semantic conventions. It represents the + // distinguished name of subject of the x.509 certificate presented by the + // server. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'CN=myserver, OU=Documentation Team, DC=example, DC=com' + TLSServerSubjectKey = attribute.Key("tls.server.subject") +) + +var ( + // ssl + TLSProtocolNameSsl = TLSProtocolNameKey.String("ssl") + // tls + TLSProtocolNameTLS = TLSProtocolNameKey.String("tls") +) + +// TLSCipher returns an attribute KeyValue conforming to the "tls.cipher" +// semantic conventions. It represents the string indicating the +// [cipher](https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.5) used +// during the current connection. +func TLSCipher(val string) attribute.KeyValue { + return TLSCipherKey.String(val) +} + +// TLSClientCertificate returns an attribute KeyValue conforming to the +// "tls.client.certificate" semantic conventions. It represents the pEM-encoded +// stand-alone certificate offered by the client. This is usually +// mutually-exclusive of `client.certificate_chain` since this value also +// exists in that list. +func TLSClientCertificate(val string) attribute.KeyValue { + return TLSClientCertificateKey.String(val) +} + +// TLSClientCertificateChain returns an attribute KeyValue conforming to the +// "tls.client.certificate_chain" semantic conventions. It represents the array +// of PEM-encoded certificates that make up the certificate chain offered by +// the client. This is usually mutually-exclusive of `client.certificate` since +// that value should be the first certificate in the chain. +func TLSClientCertificateChain(val ...string) attribute.KeyValue { + return TLSClientCertificateChainKey.StringSlice(val) +} + +// TLSClientHashMd5 returns an attribute KeyValue conforming to the +// "tls.client.hash.md5" semantic conventions. It represents the certificate +// fingerprint using the MD5 digest of DER-encoded version of certificate +// offered by the client. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSClientHashMd5(val string) attribute.KeyValue { + return TLSClientHashMd5Key.String(val) +} + +// TLSClientHashSha1 returns an attribute KeyValue conforming to the +// "tls.client.hash.sha1" semantic conventions. It represents the certificate +// fingerprint using the SHA1 digest of DER-encoded version of certificate +// offered by the client. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSClientHashSha1(val string) attribute.KeyValue { + return TLSClientHashSha1Key.String(val) +} + +// TLSClientHashSha256 returns an attribute KeyValue conforming to the +// "tls.client.hash.sha256" semantic conventions. It represents the certificate +// fingerprint using the SHA256 digest of DER-encoded version of certificate +// offered by the client. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSClientHashSha256(val string) attribute.KeyValue { + return TLSClientHashSha256Key.String(val) +} + +// TLSClientIssuer returns an attribute KeyValue conforming to the +// "tls.client.issuer" semantic conventions. It represents the distinguished +// name of +// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of +// the issuer of the x.509 certificate presented by the client. +func TLSClientIssuer(val string) attribute.KeyValue { + return TLSClientIssuerKey.String(val) +} + +// TLSClientJa3 returns an attribute KeyValue conforming to the +// "tls.client.ja3" semantic conventions. It represents a hash that identifies +// clients based on how they perform an SSL/TLS handshake. +func TLSClientJa3(val string) attribute.KeyValue { + return TLSClientJa3Key.String(val) +} + +// TLSClientNotAfter returns an attribute KeyValue conforming to the +// "tls.client.not_after" semantic conventions. It represents the date/Time +// indicating when client certificate is no longer considered valid. +func TLSClientNotAfter(val string) attribute.KeyValue { + return TLSClientNotAfterKey.String(val) +} + +// TLSClientNotBefore returns an attribute KeyValue conforming to the +// "tls.client.not_before" semantic conventions. It represents the date/Time +// indicating when client certificate is first considered valid. +func TLSClientNotBefore(val string) attribute.KeyValue { + return TLSClientNotBeforeKey.String(val) +} + +// TLSClientServerName returns an attribute KeyValue conforming to the +// "tls.client.server_name" semantic conventions. It represents the also called +// an SNI, this tells the server which hostname to which the client is +// attempting to connect to. +func TLSClientServerName(val string) attribute.KeyValue { + return TLSClientServerNameKey.String(val) +} + +// TLSClientSubject returns an attribute KeyValue conforming to the +// "tls.client.subject" semantic conventions. It represents the distinguished +// name of subject of the x.509 certificate presented by the client. +func TLSClientSubject(val string) attribute.KeyValue { + return TLSClientSubjectKey.String(val) +} + +// TLSClientSupportedCiphers returns an attribute KeyValue conforming to the +// "tls.client.supported_ciphers" semantic conventions. It represents the array +// of ciphers offered by the client during the client hello. +func TLSClientSupportedCiphers(val ...string) attribute.KeyValue { + return TLSClientSupportedCiphersKey.StringSlice(val) +} + +// TLSCurve returns an attribute KeyValue conforming to the "tls.curve" +// semantic conventions. It represents the string indicating the curve used for +// the given cipher, when applicable +func TLSCurve(val string) attribute.KeyValue { + return TLSCurveKey.String(val) +} + +// TLSEstablished returns an attribute KeyValue conforming to the +// "tls.established" semantic conventions. It represents the boolean flag +// indicating if the TLS negotiation was successful and transitioned to an +// encrypted tunnel. +func TLSEstablished(val bool) attribute.KeyValue { + return TLSEstablishedKey.Bool(val) +} + +// TLSNextProtocol returns an attribute KeyValue conforming to the +// "tls.next_protocol" semantic conventions. It represents the string +// indicating the protocol being tunneled. Per the values in the [IANA +// registry](https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids), +// this string should be lower case. +func TLSNextProtocol(val string) attribute.KeyValue { + return TLSNextProtocolKey.String(val) +} + +// TLSProtocolVersion returns an attribute KeyValue conforming to the +// "tls.protocol.version" semantic conventions. It represents the numeric part +// of the version parsed from the original string of the negotiated [SSL/TLS +// protocol +// version](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html#RETURN-VALUES) +func TLSProtocolVersion(val string) attribute.KeyValue { + return TLSProtocolVersionKey.String(val) +} + +// TLSResumed returns an attribute KeyValue conforming to the "tls.resumed" +// semantic conventions. It represents the boolean flag indicating if this TLS +// connection was resumed from an existing TLS negotiation. +func TLSResumed(val bool) attribute.KeyValue { + return TLSResumedKey.Bool(val) +} + +// TLSServerCertificate returns an attribute KeyValue conforming to the +// "tls.server.certificate" semantic conventions. It represents the pEM-encoded +// stand-alone certificate offered by the server. This is usually +// mutually-exclusive of `server.certificate_chain` since this value also +// exists in that list. +func TLSServerCertificate(val string) attribute.KeyValue { + return TLSServerCertificateKey.String(val) +} + +// TLSServerCertificateChain returns an attribute KeyValue conforming to the +// "tls.server.certificate_chain" semantic conventions. It represents the array +// of PEM-encoded certificates that make up the certificate chain offered by +// the server. This is usually mutually-exclusive of `server.certificate` since +// that value should be the first certificate in the chain. +func TLSServerCertificateChain(val ...string) attribute.KeyValue { + return TLSServerCertificateChainKey.StringSlice(val) +} + +// TLSServerHashMd5 returns an attribute KeyValue conforming to the +// "tls.server.hash.md5" semantic conventions. It represents the certificate +// fingerprint using the MD5 digest of DER-encoded version of certificate +// offered by the server. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSServerHashMd5(val string) attribute.KeyValue { + return TLSServerHashMd5Key.String(val) +} + +// TLSServerHashSha1 returns an attribute KeyValue conforming to the +// "tls.server.hash.sha1" semantic conventions. It represents the certificate +// fingerprint using the SHA1 digest of DER-encoded version of certificate +// offered by the server. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSServerHashSha1(val string) attribute.KeyValue { + return TLSServerHashSha1Key.String(val) +} + +// TLSServerHashSha256 returns an attribute KeyValue conforming to the +// "tls.server.hash.sha256" semantic conventions. It represents the certificate +// fingerprint using the SHA256 digest of DER-encoded version of certificate +// offered by the server. For consistency with other hash values, this value +// should be formatted as an uppercase hash. +func TLSServerHashSha256(val string) attribute.KeyValue { + return TLSServerHashSha256Key.String(val) +} + +// TLSServerIssuer returns an attribute KeyValue conforming to the +// "tls.server.issuer" semantic conventions. It represents the distinguished +// name of +// [subject](https://datatracker.ietf.org/doc/html/rfc5280#section-4.1.2.6) of +// the issuer of the x.509 certificate presented by the client. +func TLSServerIssuer(val string) attribute.KeyValue { + return TLSServerIssuerKey.String(val) +} + +// TLSServerJa3s returns an attribute KeyValue conforming to the +// "tls.server.ja3s" semantic conventions. It represents a hash that identifies +// servers based on how they perform an SSL/TLS handshake. +func TLSServerJa3s(val string) attribute.KeyValue { + return TLSServerJa3sKey.String(val) +} + +// TLSServerNotAfter returns an attribute KeyValue conforming to the +// "tls.server.not_after" semantic conventions. It represents the date/Time +// indicating when server certificate is no longer considered valid. +func TLSServerNotAfter(val string) attribute.KeyValue { + return TLSServerNotAfterKey.String(val) +} + +// TLSServerNotBefore returns an attribute KeyValue conforming to the +// "tls.server.not_before" semantic conventions. It represents the date/Time +// indicating when server certificate is first considered valid. +func TLSServerNotBefore(val string) attribute.KeyValue { + return TLSServerNotBeforeKey.String(val) +} + +// TLSServerSubject returns an attribute KeyValue conforming to the +// "tls.server.subject" semantic conventions. It represents the distinguished +// name of subject of the x.509 certificate presented by the server. +func TLSServerSubject(val string) attribute.KeyValue { + return TLSServerSubjectKey.String(val) +} + +// Attributes describing URL. +const ( + // URLFragmentKey is the attribute Key conforming to the "url.fragment" + // semantic conventions. It represents the [URI + // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'SemConv' + URLFragmentKey = attribute.Key("url.fragment") + + // URLFullKey is the attribute Key conforming to the "url.full" semantic + // conventions. It represents the absolute URL describing a network + // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv', + // '//localhost' + // Note: For network calls, URL usually has + // `scheme://host[:port][path][?query][#fragment]` format, where the + // fragment is not transmitted over HTTP, but if it is known, it SHOULD be + // included nevertheless. + // `url.full` MUST NOT contain credentials passed via URL in form of + // `https://username:password@www.example.com/`. In such case username and + // password SHOULD be redacted and attribute's value SHOULD be + // `https://REDACTED:REDACTED@www.example.com/`. + // `url.full` SHOULD capture the absolute URL when it is available (or can + // be reconstructed) and SHOULD NOT be validated or modified except for + // sanitizing purposes. + URLFullKey = attribute.Key("url.full") + + // URLPathKey is the attribute Key conforming to the "url.path" semantic + // conventions. It represents the [URI + // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: '/search' + URLPathKey = attribute.Key("url.path") + + // URLQueryKey is the attribute Key conforming to the "url.query" semantic + // conventions. It represents the [URI + // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'q=OpenTelemetry' + // Note: Sensitive content provided in query string SHOULD be scrubbed when + // instrumentations can identify it. + URLQueryKey = attribute.Key("url.query") + + // URLSchemeKey is the attribute Key conforming to the "url.scheme" + // semantic conventions. It represents the [URI + // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component + // identifying the used protocol. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'https', 'ftp', 'telnet' + URLSchemeKey = attribute.Key("url.scheme") +) + +// URLFragment returns an attribute KeyValue conforming to the +// "url.fragment" semantic conventions. It represents the [URI +// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component +func URLFragment(val string) attribute.KeyValue { + return URLFragmentKey.String(val) +} + +// URLFull returns an attribute KeyValue conforming to the "url.full" +// semantic conventions. It represents the absolute URL describing a network +// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) +func URLFull(val string) attribute.KeyValue { + return URLFullKey.String(val) +} + +// URLPath returns an attribute KeyValue conforming to the "url.path" +// semantic conventions. It represents the [URI +// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component +func URLPath(val string) attribute.KeyValue { + return URLPathKey.String(val) +} + +// URLQuery returns an attribute KeyValue conforming to the "url.query" +// semantic conventions. It represents the [URI +// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component +func URLQuery(val string) attribute.KeyValue { + return URLQueryKey.String(val) +} + +// URLScheme returns an attribute KeyValue conforming to the "url.scheme" +// semantic conventions. It represents the [URI +// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component +// identifying the used protocol. +func URLScheme(val string) attribute.KeyValue { + return URLSchemeKey.String(val) +} + +// Describes user-agent attributes. +const ( + // UserAgentOriginalKey is the attribute Key conforming to the + // "user_agent.original" semantic conventions. It represents the value of + // the [HTTP + // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) + // header sent by the client. + // + // Type: string + // RequirementLevel: Optional + // Stability: stable + // Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU + // iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) + // Version/14.1.2 Mobile/15E148 Safari/604.1' + UserAgentOriginalKey = attribute.Key("user_agent.original") +) + +// UserAgentOriginal returns an attribute KeyValue conforming to the +// "user_agent.original" semantic conventions. It represents the value of the +// [HTTP +// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) +// header sent by the client. +func UserAgentOriginal(val string) attribute.KeyValue { + return UserAgentOriginalKey.String(val) +} + +// Session is defined as the period of time encompassing all activities +// performed by the application and the actions executed by the end user. +// Consequently, a Session is represented as a collection of Logs, Events, and +// Spans emitted by the Client Application throughout the Session's duration. +// Each Session is assigned a unique identifier, which is included as an +// attribute in the Logs, Events, and Spans generated during the Session's +// lifecycle. +// When a session reaches end of life, typically due to user inactivity or +// session timeout, a new session identifier will be assigned. The previous +// session identifier may be provided by the instrumentation so that telemetry +// backends can link the two sessions. +const ( + // SessionIDKey is the attribute Key conforming to the "session.id" + // semantic conventions. It represents a unique id to identify a session. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '00112233-4455-6677-8899-aabbccddeeff' + SessionIDKey = attribute.Key("session.id") + + // SessionPreviousIDKey is the attribute Key conforming to the + // "session.previous_id" semantic conventions. It represents the previous + // `session.id` for this user, when known. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '00112233-4455-6677-8899-aabbccddeeff' + SessionPreviousIDKey = attribute.Key("session.previous_id") +) + +// SessionID returns an attribute KeyValue conforming to the "session.id" +// semantic conventions. It represents a unique id to identify a session. +func SessionID(val string) attribute.KeyValue { + return SessionIDKey.String(val) +} + +// SessionPreviousID returns an attribute KeyValue conforming to the +// "session.previous_id" semantic conventions. It represents the previous +// `session.id` for this user, when known. +func SessionPreviousID(val string) attribute.KeyValue { + return SessionPreviousIDKey.String(val) +} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go similarity index 91% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go index 7cf424855e..9b802db272 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/doc.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/doc.go @@ -15,6 +15,6 @@ // Package semconv implements OpenTelemetry semantic conventions. // // OpenTelemetry semantic conventions are agreed standardized naming -// patterns for OpenTelemetry things. This package represents the conventions -// as of the v1.21.0 version of the OpenTelemetry specification. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +// patterns for OpenTelemetry things. This package represents the v1.24.0 +// version of the OpenTelemetry semantic conventions. +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go similarity index 66% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go index 30ae34fe47..cd3c716295 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/event.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/event.go @@ -14,10 +14,65 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" import "go.opentelemetry.io/otel/attribute" +// This event represents an occurrence of a lifecycle transition on the iOS +// platform. +const ( + // IosStateKey is the attribute Key conforming to the "ios.state" semantic + // conventions. It represents the this attribute represents the state the + // application has transitioned into at the occurrence of the event. + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + // Note: The iOS lifecycle states are defined in the [UIApplicationDelegate + // documentation](https://developer.apple.com/documentation/uikit/uiapplicationdelegate#1656902), + // and from which the `OS terminology` column values are derived. + IosStateKey = attribute.Key("ios.state") +) + +var ( + // The app has become `active`. Associated with UIKit notification `applicationDidBecomeActive` + IosStateActive = IosStateKey.String("active") + // The app is now `inactive`. Associated with UIKit notification `applicationWillResignActive` + IosStateInactive = IosStateKey.String("inactive") + // The app is now in the background. This value is associated with UIKit notification `applicationDidEnterBackground` + IosStateBackground = IosStateKey.String("background") + // The app is now in the foreground. This value is associated with UIKit notification `applicationWillEnterForeground` + IosStateForeground = IosStateKey.String("foreground") + // The app is about to terminate. Associated with UIKit notification `applicationWillTerminate` + IosStateTerminate = IosStateKey.String("terminate") +) + +// This event represents an occurrence of a lifecycle transition on the Android +// platform. +const ( + // AndroidStateKey is the attribute Key conforming to the "android.state" + // semantic conventions. It represents the this attribute represents the + // state the application has transitioned into at the occurrence of the + // event. + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + // Note: The Android lifecycle states are defined in [Activity lifecycle + // callbacks](https://developer.android.com/guide/components/activities/activity-lifecycle#lc), + // and from which the `OS identifiers` are derived. + AndroidStateKey = attribute.Key("android.state") +) + +var ( + // Any time before Activity.onResume() or, if the app has no Activity, Context.startService() has been called in the app for the first time + AndroidStateCreated = AndroidStateKey.String("created") + // Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has been called when the app was in the foreground state + AndroidStateBackground = AndroidStateKey.String("background") + // Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has been called when the app was in either the created or background states + AndroidStateForeground = AndroidStateKey.String("foreground") +) + // This semantic convention defines the attributes used to represent a feature // flag evaluation as an event. const ( @@ -27,7 +82,7 @@ const ( // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'logo-color' FeatureFlagKeyKey = attribute.Key("feature_flag.key") @@ -37,7 +92,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: stable + // Stability: experimental // Examples: 'Flag Manager' FeatureFlagProviderNameKey = attribute.Key("feature_flag.provider_name") @@ -48,7 +103,7 @@ const ( // // Type: string // RequirementLevel: Recommended - // Stability: stable + // Stability: experimental // Examples: 'red', 'true', 'on' // Note: A semantic identifier, commonly referred to as a variant, provides // a means @@ -86,14 +141,14 @@ func FeatureFlagVariant(val string) attribute.KeyValue { // RPC received/sent message. const ( - // MessageTypeKey is the attribute Key conforming to the "message.type" - // semantic conventions. It represents the whether this is a received or - // sent message. + // MessageCompressedSizeKey is the attribute Key conforming to the + // "message.compressed_size" semantic conventions. It represents the + // compressed size of the message in bytes. // - // Type: Enum + // Type: int // RequirementLevel: Optional - // Stability: stable - MessageTypeKey = attribute.Key("message.type") + // Stability: experimental + MessageCompressedSizeKey = attribute.Key("message.compressed_size") // MessageIDKey is the attribute Key conforming to the "message.id" // semantic conventions. It represents the mUST be calculated as two @@ -102,19 +157,19 @@ const ( // // Type: int // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Note: This way we guarantee that the values will be consistent between // different implementations. MessageIDKey = attribute.Key("message.id") - // MessageCompressedSizeKey is the attribute Key conforming to the - // "message.compressed_size" semantic conventions. It represents the - // compressed size of the message in bytes. + // MessageTypeKey is the attribute Key conforming to the "message.type" + // semantic conventions. It represents the whether this is a received or + // sent message. // - // Type: int + // Type: Enum // RequirementLevel: Optional - // Stability: stable - MessageCompressedSizeKey = attribute.Key("message.compressed_size") + // Stability: experimental + MessageTypeKey = attribute.Key("message.type") // MessageUncompressedSizeKey is the attribute Key conforming to the // "message.uncompressed_size" semantic conventions. It represents the @@ -122,7 +177,7 @@ const ( // // Type: int // RequirementLevel: Optional - // Stability: stable + // Stability: experimental MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") ) @@ -133,6 +188,13 @@ var ( MessageTypeReceived = MessageTypeKey.String("RECEIVED") ) +// MessageCompressedSize returns an attribute KeyValue conforming to the +// "message.compressed_size" semantic conventions. It represents the compressed +// size of the message in bytes. +func MessageCompressedSize(val int) attribute.KeyValue { + return MessageCompressedSizeKey.Int(val) +} + // MessageID returns an attribute KeyValue conforming to the "message.id" // semantic conventions. It represents the mUST be calculated as two different // counters starting from `1` one for sent messages and one for received @@ -141,59 +203,9 @@ func MessageID(val int) attribute.KeyValue { return MessageIDKey.Int(val) } -// MessageCompressedSize returns an attribute KeyValue conforming to the -// "message.compressed_size" semantic conventions. It represents the compressed -// size of the message in bytes. -func MessageCompressedSize(val int) attribute.KeyValue { - return MessageCompressedSizeKey.Int(val) -} - // MessageUncompressedSize returns an attribute KeyValue conforming to the // "message.uncompressed_size" semantic conventions. It represents the // uncompressed size of the message in bytes. func MessageUncompressedSize(val int) attribute.KeyValue { return MessageUncompressedSizeKey.Int(val) } - -// The attributes used to report a single exception associated with a span. -const ( - // ExceptionEscapedKey is the attribute Key conforming to the - // "exception.escaped" semantic conventions. It represents the sHOULD be - // set to true if the exception event is recorded at a point where it is - // known that the exception is escaping the scope of the span. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - // Note: An exception is considered to have escaped (or left) the scope of - // a span, - // if that span is ended while the exception is still logically "in - // flight". - // This may be actually "in flight" in some languages (e.g. if the - // exception - // is passed to a Context manager's `__exit__` method in Python) but will - // usually be caught at the point of recording the exception in most - // languages. - // - // It is usually not possible to determine at the point where an exception - // is thrown - // whether it will escape the scope of a span. - // However, it is trivial to know that an exception - // will escape, if one checks for an active exception just before ending - // the span, - // as done in the [example above](#recording-an-exception). - // - // It follows that an exception may still escape the scope of the span - // even if the `exception.escaped` attribute was not set or set to false, - // since the event might have been recorded at a time where it was not - // clear whether the exception will escape. - ExceptionEscapedKey = attribute.Key("exception.escaped") -) - -// ExceptionEscaped returns an attribute KeyValue conforming to the -// "exception.escaped" semantic conventions. It represents the sHOULD be set to -// true if the exception event is recorded at a point where it is known that -// the exception is escaping the scope of the span. -func ExceptionEscaped(val bool) attribute.KeyValue { - return ExceptionEscapedKey.Bool(val) -} diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go similarity index 99% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go index 93d3c1760c..ef9bbd37a8 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/exception.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/exception.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" const ( // ExceptionEventName is the name of the Span event representing an exception. diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go similarity index 82% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go index b6d8935cf9..69eda1959f 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/resource.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/resource.go @@ -14,138 +14,68 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" import "go.opentelemetry.io/otel/attribute" -// The web browser in which the application represented by the resource is -// running. The `browser.*` attributes MUST be used only for resources that -// represent applications running in a web browser (regardless of whether -// running on a mobile or desktop device). +// A cloud environment (e.g. GCP, Azure, AWS). const ( - // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" - // semantic conventions. It represents the array of brand name and version - // separated by a space - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.brands`). - BrowserBrandsKey = attribute.Key("browser.brands") - - // BrowserPlatformKey is the attribute Key conforming to the - // "browser.platform" semantic conventions. It represents the platform on - // which the browser is running + // CloudAccountIDKey is the attribute Key conforming to the + // "cloud.account.id" semantic conventions. It represents the cloud account + // ID the resource is assigned to. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'Windows', 'macOS', 'Android' - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.platform`). If unavailable, the legacy - // `navigator.platform` API SHOULD NOT be used instead and this attribute - // SHOULD be left unset in order for the values to be consistent. - // The list of possible values is defined in the [W3C User-Agent Client - // Hints - // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). - // Note that some (but not all) of these values can overlap with values in - // the [`os.type` and `os.name` attributes](./os.md). However, for - // consistency, the values in the `browser.platform` attribute should - // capture the exact value that the user agent provides. - BrowserPlatformKey = attribute.Key("browser.platform") + // Stability: experimental + // Examples: '111111111111', 'opentelemetry' + CloudAccountIDKey = attribute.Key("cloud.account.id") - // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" - // semantic conventions. It represents a boolean that is true if the - // browser is running on a mobile device + // CloudAvailabilityZoneKey is the attribute Key conforming to the + // "cloud.availability_zone" semantic conventions. It represents the cloud + // regions often have multiple, isolated locations known as zones to + // increase availability. Availability zone represents the zone where the + // resource is running. // - // Type: boolean + // Type: string // RequirementLevel: Optional - // Stability: stable - // Note: This value is intended to be taken from the [UA client hints - // API](https://wicg.github.io/ua-client-hints/#interface) - // (`navigator.userAgentData.mobile`). If unavailable, this attribute - // SHOULD be left unset. - BrowserMobileKey = attribute.Key("browser.mobile") + // Stability: experimental + // Examples: 'us-east-1c' + // Note: Availability zones are called "zones" on Alibaba Cloud and Google + // Cloud. + CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") - // BrowserLanguageKey is the attribute Key conforming to the - // "browser.language" semantic conventions. It represents the preferred - // language of the user using the browser + // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" + // semantic conventions. It represents the cloud platform in use. // - // Type: string + // Type: Enum // RequirementLevel: Optional - // Stability: stable - // Examples: 'en', 'en-US', 'fr', 'fr-FR' - // Note: This value is intended to be taken from the Navigator API - // `navigator.language`. - BrowserLanguageKey = attribute.Key("browser.language") -) - -// BrowserBrands returns an attribute KeyValue conforming to the -// "browser.brands" semantic conventions. It represents the array of brand name -// and version separated by a space -func BrowserBrands(val ...string) attribute.KeyValue { - return BrowserBrandsKey.StringSlice(val) -} - -// BrowserPlatform returns an attribute KeyValue conforming to the -// "browser.platform" semantic conventions. It represents the platform on which -// the browser is running -func BrowserPlatform(val string) attribute.KeyValue { - return BrowserPlatformKey.String(val) -} - -// BrowserMobile returns an attribute KeyValue conforming to the -// "browser.mobile" semantic conventions. It represents a boolean that is true -// if the browser is running on a mobile device -func BrowserMobile(val bool) attribute.KeyValue { - return BrowserMobileKey.Bool(val) -} - -// BrowserLanguage returns an attribute KeyValue conforming to the -// "browser.language" semantic conventions. It represents the preferred -// language of the user using the browser -func BrowserLanguage(val string) attribute.KeyValue { - return BrowserLanguageKey.String(val) -} + // Stability: experimental + // Note: The prefix of the service SHOULD match the one specified in + // `cloud.provider`. + CloudPlatformKey = attribute.Key("cloud.platform") -// A cloud environment (e.g. GCP, Azure, AWS) -const ( // CloudProviderKey is the attribute Key conforming to the "cloud.provider" // semantic conventions. It represents the name of the cloud provider. // // Type: Enum // RequirementLevel: Optional - // Stability: stable + // Stability: experimental CloudProviderKey = attribute.Key("cloud.provider") - // CloudAccountIDKey is the attribute Key conforming to the - // "cloud.account.id" semantic conventions. It represents the cloud account - // ID the resource is assigned to. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '111111111111', 'opentelemetry' - CloudAccountIDKey = attribute.Key("cloud.account.id") - // CloudRegionKey is the attribute Key conforming to the "cloud.region" // semantic conventions. It represents the geographical region the resource // is running. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'us-central1', 'us-east-1' // Note: Refer to your provider's docs to see the available regions, for // example [Alibaba Cloud // regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS // regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), // [Azure - // regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), + // regions](https://azure.microsoft.com/global-infrastructure/geographies/), // [Google Cloud regions](https://cloud.google.com/about/locations), or // [Tencent Cloud // regions](https://www.tencentcloud.com/document/product/213/6091). @@ -157,14 +87,14 @@ const ( // (e.g. an // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // on AWS, a [fully qualified resource - // ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) + // ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) // on Azure, a [full resource // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) // on GCP) // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'arn:aws:lambda:REGION:ACCOUNT_ID:function:my-function', // '//run.googleapis.com/projects/PROJECT_ID/locations/LOCATION_ID/services/SERVICE_ID', // '/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/' @@ -189,7 +119,7 @@ const ( // * **GCP:** The [URI of the // resource](https://cloud.google.com/iam/docs/full-resource-names) // * **Azure:** The [Fully Qualified Resource - // ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id) + // ID](https://docs.microsoft.com/rest/api/resources/resources/get-by-id) // of the invoked function, // *not* the function app, having the form // `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. @@ -197,47 +127,6 @@ const ( // app can host multiple functions that would usually share // a TracerProvider. CloudResourceIDKey = attribute.Key("cloud.resource_id") - - // CloudAvailabilityZoneKey is the attribute Key conforming to the - // "cloud.availability_zone" semantic conventions. It represents the cloud - // regions often have multiple, isolated locations known as zones to - // increase availability. Availability zone represents the zone where the - // resource is running. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-east-1c' - // Note: Availability zones are called "zones" on Alibaba Cloud and Google - // Cloud. - CloudAvailabilityZoneKey = attribute.Key("cloud.availability_zone") - - // CloudPlatformKey is the attribute Key conforming to the "cloud.platform" - // semantic conventions. It represents the cloud platform in use. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: The prefix of the service SHOULD match the one specified in - // `cloud.provider`. - CloudPlatformKey = attribute.Key("cloud.platform") -) - -var ( - // Alibaba Cloud - CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") - // Amazon Web Services - CloudProviderAWS = CloudProviderKey.String("aws") - // Microsoft Azure - CloudProviderAzure = CloudProviderKey.String("azure") - // Google Cloud Platform - CloudProviderGCP = CloudProviderKey.String("gcp") - // Heroku Platform as a Service - CloudProviderHeroku = CloudProviderKey.String("heroku") - // IBM Cloud - CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") - // Tencent Cloud - CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") ) var ( @@ -297,6 +186,23 @@ var ( CloudPlatformTencentCloudScf = CloudPlatformKey.String("tencent_cloud_scf") ) +var ( + // Alibaba Cloud + CloudProviderAlibabaCloud = CloudProviderKey.String("alibaba_cloud") + // Amazon Web Services + CloudProviderAWS = CloudProviderKey.String("aws") + // Microsoft Azure + CloudProviderAzure = CloudProviderKey.String("azure") + // Google Cloud Platform + CloudProviderGCP = CloudProviderKey.String("gcp") + // Heroku Platform as a Service + CloudProviderHeroku = CloudProviderKey.String("heroku") + // IBM Cloud + CloudProviderIbmCloud = CloudProviderKey.String("ibm_cloud") + // Tencent Cloud + CloudProviderTencentCloud = CloudProviderKey.String("tencent_cloud") +) + // CloudAccountID returns an attribute KeyValue conforming to the // "cloud.account.id" semantic conventions. It represents the cloud account ID // the resource is assigned to. @@ -304,6 +210,15 @@ func CloudAccountID(val string) attribute.KeyValue { return CloudAccountIDKey.String(val) } +// CloudAvailabilityZone returns an attribute KeyValue conforming to the +// "cloud.availability_zone" semantic conventions. It represents the cloud +// regions often have multiple, isolated locations known as zones to increase +// availability. Availability zone represents the zone where the resource is +// running. +func CloudAvailabilityZone(val string) attribute.KeyValue { + return CloudAvailabilityZoneKey.String(val) +} + // CloudRegion returns an attribute KeyValue conforming to the // "cloud.region" semantic conventions. It represents the geographical region // the resource is running. @@ -316,999 +231,766 @@ func CloudRegion(val string) attribute.KeyValue { // provider-specific native identifier of the monitored cloud resource (e.g. an // [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // on AWS, a [fully qualified resource -// ID](https://learn.microsoft.com/en-us/rest/api/resources/resources/get-by-id) -// on Azure, a [full resource +// ID](https://learn.microsoft.com/rest/api/resources/resources/get-by-id) on +// Azure, a [full resource // name](https://cloud.google.com/apis/design/resource_names#full_resource_name) // on GCP) func CloudResourceID(val string) attribute.KeyValue { return CloudResourceIDKey.String(val) } -// CloudAvailabilityZone returns an attribute KeyValue conforming to the -// "cloud.availability_zone" semantic conventions. It represents the cloud -// regions often have multiple, isolated locations known as zones to increase -// availability. Availability zone represents the zone where the resource is -// running. -func CloudAvailabilityZone(val string) attribute.KeyValue { - return CloudAvailabilityZoneKey.String(val) -} - -// Resources used by AWS Elastic Container Service (ECS). +// A container instance. const ( - // AWSECSContainerARNKey is the attribute Key conforming to the - // "aws.ecs.container.arn" semantic conventions. It represents the Amazon - // Resource Name (ARN) of an [ECS container - // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' - AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") - - // AWSECSClusterARNKey is the attribute Key conforming to the - // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an - // [ECS - // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + // ContainerCommandKey is the attribute Key conforming to the + // "container.command" semantic conventions. It represents the command used + // to run the container (i.e. the command name). // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") + // Stability: experimental + // Examples: 'otelcontribcol' + // Note: If using embedded credentials or sensitive data, it is recommended + // to remove them to prevent potential leakage. + ContainerCommandKey = attribute.Key("container.command") - // AWSECSLaunchtypeKey is the attribute Key conforming to the - // "aws.ecs.launchtype" semantic conventions. It represents the [launch - // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) - // for an ECS task. + // ContainerCommandArgsKey is the attribute Key conforming to the + // "container.command_args" semantic conventions. It represents the all the + // command arguments (including the command/executable itself) run by the + // container. [2] // - // Type: Enum + // Type: string[] // RequirementLevel: Optional - // Stability: stable - AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") + // Stability: experimental + // Examples: 'otelcontribcol, --config, config.yaml' + ContainerCommandArgsKey = attribute.Key("container.command_args") - // AWSECSTaskARNKey is the attribute Key conforming to the - // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an - // [ECS task - // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + // ContainerCommandLineKey is the attribute Key conforming to the + // "container.command_line" semantic conventions. It represents the full + // command run by the container as a single string representing the full + // command. [2] // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") + // Stability: experimental + // Examples: 'otelcontribcol --config config.yaml' + ContainerCommandLineKey = attribute.Key("container.command_line") - // AWSECSTaskFamilyKey is the attribute Key conforming to the - // "aws.ecs.task.family" semantic conventions. It represents the task - // definition family this task definition is a member of. + // ContainerIDKey is the attribute Key conforming to the "container.id" + // semantic conventions. It represents the container ID. Usually a UUID, as + // for example used to [identify Docker + // containers](https://docs.docker.com/engine/reference/run/#container-identification). + // The UUID might be abbreviated. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-family' - AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") + // Stability: experimental + // Examples: 'a3bf90e006b2' + ContainerIDKey = attribute.Key("container.id") - // AWSECSTaskRevisionKey is the attribute Key conforming to the - // "aws.ecs.task.revision" semantic conventions. It represents the revision - // for this task definition. + // ContainerImageIDKey is the attribute Key conforming to the + // "container.image.id" semantic conventions. It represents the runtime + // specific image identifier. Usually a hash algorithm followed by a UUID. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '8', '26' - AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") -) - -var ( - // ec2 - AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") - // fargate - AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") -) - -// AWSECSContainerARN returns an attribute KeyValue conforming to the -// "aws.ecs.container.arn" semantic conventions. It represents the Amazon -// Resource Name (ARN) of an [ECS container -// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). -func AWSECSContainerARN(val string) attribute.KeyValue { - return AWSECSContainerARNKey.String(val) -} - -// AWSECSClusterARN returns an attribute KeyValue conforming to the -// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS -// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). -func AWSECSClusterARN(val string) attribute.KeyValue { - return AWSECSClusterARNKey.String(val) -} - -// AWSECSTaskARN returns an attribute KeyValue conforming to the -// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS -// task -// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). -func AWSECSTaskARN(val string) attribute.KeyValue { - return AWSECSTaskARNKey.String(val) -} - -// AWSECSTaskFamily returns an attribute KeyValue conforming to the -// "aws.ecs.task.family" semantic conventions. It represents the task -// definition family this task definition is a member of. -func AWSECSTaskFamily(val string) attribute.KeyValue { - return AWSECSTaskFamilyKey.String(val) -} - -// AWSECSTaskRevision returns an attribute KeyValue conforming to the -// "aws.ecs.task.revision" semantic conventions. It represents the revision for -// this task definition. -func AWSECSTaskRevision(val string) attribute.KeyValue { - return AWSECSTaskRevisionKey.String(val) -} + // Stability: experimental + // Examples: + // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f' + // Note: Docker defines a sha256 of the image id; `container.image.id` + // corresponds to the `Image` field from the Docker container inspect + // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) + // endpoint. + // K8S defines a link to the container registry repository with digest + // `"imageID": "registry.azurecr.io + // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + // The ID is assinged by the container runtime and can vary in different + // environments. Consider using `oci.manifest.digest` if it is important to + // identify the same image in different environments/runtimes. + ContainerImageIDKey = attribute.Key("container.image.id") -// Resources used by AWS Elastic Kubernetes Service (EKS). -const ( - // AWSEKSClusterARNKey is the attribute Key conforming to the - // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an - // EKS cluster. + // ContainerImageNameKey is the attribute Key conforming to the + // "container.image.name" semantic conventions. It represents the name of + // the image the container was built on. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' - AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") -) - -// AWSEKSClusterARN returns an attribute KeyValue conforming to the -// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS -// cluster. -func AWSEKSClusterARN(val string) attribute.KeyValue { - return AWSEKSClusterARNKey.String(val) -} + // Stability: experimental + // Examples: 'gcr.io/opentelemetry/operator' + ContainerImageNameKey = attribute.Key("container.image.name") -// Resources specific to Amazon Web Services. -const ( - // AWSLogGroupNamesKey is the attribute Key conforming to the - // "aws.log.group.names" semantic conventions. It represents the name(s) of - // the AWS log group(s) an application is writing to. + // ContainerImageRepoDigestsKey is the attribute Key conforming to the + // "container.image.repo_digests" semantic conventions. It represents the + // repo digests of the container image as provided by the container + // runtime. // // Type: string[] // RequirementLevel: Optional - // Stability: stable - // Examples: '/aws/lambda/my-function', 'opentelemetry-service' - // Note: Multiple log groups must be supported for cases like - // multi-container applications, where a single application has sidecar - // containers, and each write to their own log group. - AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") - - // AWSLogGroupARNsKey is the attribute Key conforming to the - // "aws.log.group.arns" semantic conventions. It represents the Amazon - // Resource Name(s) (ARN) of the AWS log group(s). + // Stability: experimental + // Examples: + // 'example@sha256:afcc7f1ac1b49db317a7196c902e61c6c3c4607d63599ee1a82d702d249a0ccb', + // 'internal.registry.example.com:5000/example@sha256:b69959407d21e8a062e0416bf13405bb2b71ed7a84dde4158ebafacfa06f5578' + // Note: + // [Docker](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect) + // and + // [CRI](https://github.com/kubernetes/cri-api/blob/c75ef5b473bbe2d0a4fc92f82235efd665ea8e9f/pkg/apis/runtime/v1/api.proto#L1237-L1238) + // report those under the `RepoDigests` field. + ContainerImageRepoDigestsKey = attribute.Key("container.image.repo_digests") + + // ContainerImageTagsKey is the attribute Key conforming to the + // "container.image.tags" semantic conventions. It represents the container + // image tags. An example can be found in [Docker Image + // Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). + // Should be only the `` section of the full name for example from + // `registry.example.com/my-org/my-image:`. // // Type: string[] // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' - // Note: See the [log group ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") + // Stability: experimental + // Examples: 'v1.27.1', '3.5.7-0' + ContainerImageTagsKey = attribute.Key("container.image.tags") - // AWSLogStreamNamesKey is the attribute Key conforming to the - // "aws.log.stream.names" semantic conventions. It represents the name(s) - // of the AWS log stream(s) an application is writing to. + // ContainerNameKey is the attribute Key conforming to the "container.name" + // semantic conventions. It represents the container name used by container + // runtime. // - // Type: string[] + // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") + // Stability: experimental + // Examples: 'opentelemetry-autoconf' + ContainerNameKey = attribute.Key("container.name") - // AWSLogStreamARNsKey is the attribute Key conforming to the - // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of - // the AWS log stream(s). + // ContainerRuntimeKey is the attribute Key conforming to the + // "container.runtime" semantic conventions. It represents the container + // runtime managing this container. // - // Type: string[] + // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' - // Note: See the [log stream ARN format - // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - // One log group can contain several log streams, so these ARNs necessarily - // identify both a log group and a log stream. - AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") + // Stability: experimental + // Examples: 'docker', 'containerd', 'rkt' + ContainerRuntimeKey = attribute.Key("container.runtime") ) -// AWSLogGroupNames returns an attribute KeyValue conforming to the -// "aws.log.group.names" semantic conventions. It represents the name(s) of the -// AWS log group(s) an application is writing to. -func AWSLogGroupNames(val ...string) attribute.KeyValue { - return AWSLogGroupNamesKey.StringSlice(val) +// ContainerCommand returns an attribute KeyValue conforming to the +// "container.command" semantic conventions. It represents the command used to +// run the container (i.e. the command name). +func ContainerCommand(val string) attribute.KeyValue { + return ContainerCommandKey.String(val) } -// AWSLogGroupARNs returns an attribute KeyValue conforming to the -// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource -// Name(s) (ARN) of the AWS log group(s). -func AWSLogGroupARNs(val ...string) attribute.KeyValue { - return AWSLogGroupARNsKey.StringSlice(val) +// ContainerCommandArgs returns an attribute KeyValue conforming to the +// "container.command_args" semantic conventions. It represents the all the +// command arguments (including the command/executable itself) run by the +// container. [2] +func ContainerCommandArgs(val ...string) attribute.KeyValue { + return ContainerCommandArgsKey.StringSlice(val) } -// AWSLogStreamNames returns an attribute KeyValue conforming to the -// "aws.log.stream.names" semantic conventions. It represents the name(s) of -// the AWS log stream(s) an application is writing to. -func AWSLogStreamNames(val ...string) attribute.KeyValue { - return AWSLogStreamNamesKey.StringSlice(val) +// ContainerCommandLine returns an attribute KeyValue conforming to the +// "container.command_line" semantic conventions. It represents the full +// command run by the container as a single string representing the full +// command. [2] +func ContainerCommandLine(val string) attribute.KeyValue { + return ContainerCommandLineKey.String(val) } -// AWSLogStreamARNs returns an attribute KeyValue conforming to the -// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the -// AWS log stream(s). -func AWSLogStreamARNs(val ...string) attribute.KeyValue { - return AWSLogStreamARNsKey.StringSlice(val) +// ContainerID returns an attribute KeyValue conforming to the +// "container.id" semantic conventions. It represents the container ID. Usually +// a UUID, as for example used to [identify Docker +// containers](https://docs.docker.com/engine/reference/run/#container-identification). +// The UUID might be abbreviated. +func ContainerID(val string) attribute.KeyValue { + return ContainerIDKey.String(val) } -// Resource used by Google Cloud Run. -const ( - // GCPCloudRunJobExecutionKey is the attribute Key conforming to the - // "gcp.cloud_run.job.execution" semantic conventions. It represents the - // name of the Cloud Run - // [execution](https://cloud.google.com/run/docs/managing/job-executions) - // being run for the Job, as set by the - // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'job-name-xxxx', 'sample-job-mdw84' - GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") +// ContainerImageID returns an attribute KeyValue conforming to the +// "container.image.id" semantic conventions. It represents the runtime +// specific image identifier. Usually a hash algorithm followed by a UUID. +func ContainerImageID(val string) attribute.KeyValue { + return ContainerImageIDKey.String(val) +} - // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the - // "gcp.cloud_run.job.task_index" semantic conventions. It represents the - // index for a task within an execution as provided by the - // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) - // environment variable. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 1 - GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") -) +// ContainerImageName returns an attribute KeyValue conforming to the +// "container.image.name" semantic conventions. It represents the name of the +// image the container was built on. +func ContainerImageName(val string) attribute.KeyValue { + return ContainerImageNameKey.String(val) +} -// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.execution" semantic conventions. It represents the name -// of the Cloud Run -// [execution](https://cloud.google.com/run/docs/managing/job-executions) being -// run for the Job, as set by the -// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobExecution(val string) attribute.KeyValue { - return GCPCloudRunJobExecutionKey.String(val) +// ContainerImageRepoDigests returns an attribute KeyValue conforming to the +// "container.image.repo_digests" semantic conventions. It represents the repo +// digests of the container image as provided by the container runtime. +func ContainerImageRepoDigests(val ...string) attribute.KeyValue { + return ContainerImageRepoDigestsKey.StringSlice(val) } -// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the -// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index -// for a task within an execution as provided by the -// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) -// environment variable. -func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { - return GCPCloudRunJobTaskIndexKey.Int(val) +// ContainerImageTags returns an attribute KeyValue conforming to the +// "container.image.tags" semantic conventions. It represents the container +// image tags. An example can be found in [Docker Image +// Inspect](https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageInspect). +// Should be only the `` section of the full name for example from +// `registry.example.com/my-org/my-image:`. +func ContainerImageTags(val ...string) attribute.KeyValue { + return ContainerImageTagsKey.StringSlice(val) } -// Resources used by Google Compute Engine (GCE). +// ContainerName returns an attribute KeyValue conforming to the +// "container.name" semantic conventions. It represents the container name used +// by container runtime. +func ContainerName(val string) attribute.KeyValue { + return ContainerNameKey.String(val) +} + +// ContainerRuntime returns an attribute KeyValue conforming to the +// "container.runtime" semantic conventions. It represents the container +// runtime managing this container. +func ContainerRuntime(val string) attribute.KeyValue { + return ContainerRuntimeKey.String(val) +} + +// Describes device attributes. const ( - // GCPGceInstanceNameKey is the attribute Key conforming to the - // "gcp.gce.instance.name" semantic conventions. It represents the instance - // name of a GCE instance. This is the value provided by `host.name`, the - // visible name of the instance in the Cloud Console UI, and the prefix for - // the default hostname of the instance as defined by the [default internal - // DNS - // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + // DeviceIDKey is the attribute Key conforming to the "device.id" semantic + // conventions. It represents a unique identifier representing the device // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'instance-1', 'my-vm-name' - GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") - - // GCPGceInstanceHostnameKey is the attribute Key conforming to the - // "gcp.gce.instance.hostname" semantic conventions. It represents the - // hostname of a GCE instance. This is the full value of the default or - // [custom - // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'my-host1234.example.com', - // 'sample-vm.us-west1-b.c.my-project.internal' - GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") -) - -// GCPGceInstanceName returns an attribute KeyValue conforming to the -// "gcp.gce.instance.name" semantic conventions. It represents the instance -// name of a GCE instance. This is the value provided by `host.name`, the -// visible name of the instance in the Cloud Console UI, and the prefix for the -// default hostname of the instance as defined by the [default internal DNS -// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). -func GCPGceInstanceName(val string) attribute.KeyValue { - return GCPGceInstanceNameKey.String(val) -} - -// GCPGceInstanceHostname returns an attribute KeyValue conforming to the -// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname -// of a GCE instance. This is the full value of the default or [custom -// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). -func GCPGceInstanceHostname(val string) attribute.KeyValue { - return GCPGceInstanceHostnameKey.String(val) -} + // Stability: experimental + // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' + // Note: The device identifier MUST only be defined using the values + // outlined below. This value is not an advertising identifier and MUST NOT + // be used as such. On iOS (Swift or Objective-C), this value MUST be equal + // to the [vendor + // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). + // On Android (Java or Kotlin), this value MUST be equal to the Firebase + // Installation ID or a globally unique UUID which is persisted across + // sessions in your application. More information can be found + // [here](https://developer.android.com/training/articles/user-data-ids) on + // best practices and exact implementation details. Caution should be taken + // when storing personal data or anything which can identify a user. GDPR + // and data protection laws may apply, ensure you do your own due + // diligence. + DeviceIDKey = attribute.Key("device.id") -// Heroku dyno metadata -const ( - // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the - // "heroku.release.creation_timestamp" semantic conventions. It represents - // the time and date the release was created + // DeviceManufacturerKey is the attribute Key conforming to the + // "device.manufacturer" semantic conventions. It represents the name of + // the device manufacturer // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '2022-10-23T18:00:42Z' - HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") + // Stability: experimental + // Examples: 'Apple', 'Samsung' + // Note: The Android OS provides this field via + // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). + // iOS apps SHOULD hardcode the value `Apple`. + DeviceManufacturerKey = attribute.Key("device.manufacturer") - // HerokuReleaseCommitKey is the attribute Key conforming to the - // "heroku.release.commit" semantic conventions. It represents the commit - // hash for the current release + // DeviceModelIdentifierKey is the attribute Key conforming to the + // "device.model.identifier" semantic conventions. It represents the model + // identifier for the device // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec' - HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") + // Stability: experimental + // Examples: 'iPhone3,4', 'SM-G920F' + // Note: It's recommended this value represents a machine-readable version + // of the model identifier rather than the market or consumer-friendly name + // of the device. + DeviceModelIdentifierKey = attribute.Key("device.model.identifier") - // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" - // semantic conventions. It represents the unique identifier for the - // application + // DeviceModelNameKey is the attribute Key conforming to the + // "device.model.name" semantic conventions. It represents the marketing + // name for the device model // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da' - HerokuAppIDKey = attribute.Key("heroku.app.id") + // Stability: experimental + // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' + // Note: It's recommended this value represents a human-readable version of + // the device model rather than a machine-readable alternative. + DeviceModelNameKey = attribute.Key("device.model.name") ) -// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming -// to the "heroku.release.creation_timestamp" semantic conventions. It -// represents the time and date the release was created -func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { - return HerokuReleaseCreationTimestampKey.String(val) +// DeviceID returns an attribute KeyValue conforming to the "device.id" +// semantic conventions. It represents a unique identifier representing the +// device +func DeviceID(val string) attribute.KeyValue { + return DeviceIDKey.String(val) } -// HerokuReleaseCommit returns an attribute KeyValue conforming to the -// "heroku.release.commit" semantic conventions. It represents the commit hash -// for the current release -func HerokuReleaseCommit(val string) attribute.KeyValue { - return HerokuReleaseCommitKey.String(val) +// DeviceManufacturer returns an attribute KeyValue conforming to the +// "device.manufacturer" semantic conventions. It represents the name of the +// device manufacturer +func DeviceManufacturer(val string) attribute.KeyValue { + return DeviceManufacturerKey.String(val) } -// HerokuAppID returns an attribute KeyValue conforming to the -// "heroku.app.id" semantic conventions. It represents the unique identifier -// for the application -func HerokuAppID(val string) attribute.KeyValue { - return HerokuAppIDKey.String(val) +// DeviceModelIdentifier returns an attribute KeyValue conforming to the +// "device.model.identifier" semantic conventions. It represents the model +// identifier for the device +func DeviceModelIdentifier(val string) attribute.KeyValue { + return DeviceModelIdentifierKey.String(val) } -// A container instance. +// DeviceModelName returns an attribute KeyValue conforming to the +// "device.model.name" semantic conventions. It represents the marketing name +// for the device model +func DeviceModelName(val string) attribute.KeyValue { + return DeviceModelNameKey.String(val) +} + +// A host is defined as a computing instance. For example, physical servers, +// virtual machines, switches or disk array. const ( - // ContainerNameKey is the attribute Key conforming to the "container.name" - // semantic conventions. It represents the container name used by container - // runtime. + // HostArchKey is the attribute Key conforming to the "host.arch" semantic + // conventions. It represents the CPU architecture the host system is + // running on. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + HostArchKey = attribute.Key("host.arch") + + // HostCPUCacheL2SizeKey is the attribute Key conforming to the + // "host.cpu.cache.l2.size" semantic conventions. It represents the amount + // of level 2 memory cache available to the processor (in Bytes). + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 12288000 + HostCPUCacheL2SizeKey = attribute.Key("host.cpu.cache.l2.size") + + // HostCPUFamilyKey is the attribute Key conforming to the + // "host.cpu.family" semantic conventions. It represents the family or + // generation of the CPU. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-autoconf' - ContainerNameKey = attribute.Key("container.name") + // Stability: experimental + // Examples: '6', 'PA-RISC 1.1e' + HostCPUFamilyKey = attribute.Key("host.cpu.family") - // ContainerIDKey is the attribute Key conforming to the "container.id" - // semantic conventions. It represents the container ID. Usually a UUID, as - // for example used to [identify Docker - // containers](https://docs.docker.com/engine/reference/run/#container-identification). - // The UUID might be abbreviated. + // HostCPUModelIDKey is the attribute Key conforming to the + // "host.cpu.model.id" semantic conventions. It represents the model + // identifier. It provides more granular information about the CPU, + // distinguishing it from other CPUs within the same family. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'a3bf90e006b2' - ContainerIDKey = attribute.Key("container.id") + // Stability: experimental + // Examples: '6', '9000/778/B180L' + HostCPUModelIDKey = attribute.Key("host.cpu.model.id") - // ContainerRuntimeKey is the attribute Key conforming to the - // "container.runtime" semantic conventions. It represents the container - // runtime managing this container. + // HostCPUModelNameKey is the attribute Key conforming to the + // "host.cpu.model.name" semantic conventions. It represents the model + // designation of the processor. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'docker', 'containerd', 'rkt' - ContainerRuntimeKey = attribute.Key("container.runtime") + // Stability: experimental + // Examples: '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz' + HostCPUModelNameKey = attribute.Key("host.cpu.model.name") - // ContainerImageNameKey is the attribute Key conforming to the - // "container.image.name" semantic conventions. It represents the name of - // the image the container was built on. + // HostCPUSteppingKey is the attribute Key conforming to the + // "host.cpu.stepping" semantic conventions. It represents the stepping or + // core revisions. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1 + HostCPUSteppingKey = attribute.Key("host.cpu.stepping") + + // HostCPUVendorIDKey is the attribute Key conforming to the + // "host.cpu.vendor.id" semantic conventions. It represents the processor + // manufacturer identifier. A maximum 12-character string. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'gcr.io/opentelemetry/operator' - ContainerImageNameKey = attribute.Key("container.image.name") + // Stability: experimental + // Examples: 'GenuineIntel' + // Note: [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor + // ID string in EBX, EDX and ECX registers. Writing these to memory in this + // order results in a 12-character string. + HostCPUVendorIDKey = attribute.Key("host.cpu.vendor.id") - // ContainerImageTagKey is the attribute Key conforming to the - // "container.image.tag" semantic conventions. It represents the container - // image tag. + // HostIDKey is the attribute Key conforming to the "host.id" semantic + // conventions. It represents the unique host ID. For Cloud, this must be + // the instance_id assigned by the cloud provider. For non-containerized + // systems, this should be the `machine-id`. See the table below for the + // sources to use to determine the `machine-id` based on operating system. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - ContainerImageTagKey = attribute.Key("container.image.tag") + // Stability: experimental + // Examples: 'fdbf79e8af94cb7f9e8df36789187052' + HostIDKey = attribute.Key("host.id") - // ContainerImageIDKey is the attribute Key conforming to the - // "container.image.id" semantic conventions. It represents the runtime - // specific image identifier. Usually a hash algorithm followed by a UUID. + // HostImageIDKey is the attribute Key conforming to the "host.image.id" + // semantic conventions. It represents the vM image ID or host OS image ID. + // For Cloud, this value is from the provider. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'sha256:19c92d0a00d1b66d897bceaa7319bee0dd38a10a851c60bcec9474aa3f01e50f' - // Note: Docker defines a sha256 of the image id; `container.image.id` - // corresponds to the `Image` field from the Docker container inspect - // [API](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerInspect) - // endpoint. - // K8S defines a link to the container registry repository with digest - // `"imageID": "registry.azurecr.io - // /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - // OCI defines a digest of manifest. - ContainerImageIDKey = attribute.Key("container.image.id") + // Stability: experimental + // Examples: 'ami-07b06b442921831e5' + HostImageIDKey = attribute.Key("host.image.id") - // ContainerCommandKey is the attribute Key conforming to the - // "container.command" semantic conventions. It represents the command used - // to run the container (i.e. the command name). + // HostImageNameKey is the attribute Key conforming to the + // "host.image.name" semantic conventions. It represents the name of the VM + // image or OS install the host was instantiated from. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol' - // Note: If using embedded credentials or sensitive data, it is recommended - // to remove them to prevent potential leakage. - ContainerCommandKey = attribute.Key("container.command") + // Stability: experimental + // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' + HostImageNameKey = attribute.Key("host.image.name") - // ContainerCommandLineKey is the attribute Key conforming to the - // "container.command_line" semantic conventions. It represents the full - // command run by the container as a single string representing the full - // command. [2] + // HostImageVersionKey is the attribute Key conforming to the + // "host.image.version" semantic conventions. It represents the version + // string of the VM image or host OS as defined in [Version + // Attributes](/docs/resource/README.md#version-attributes). // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol --config config.yaml' - ContainerCommandLineKey = attribute.Key("container.command_line") + // Stability: experimental + // Examples: '0.1' + HostImageVersionKey = attribute.Key("host.image.version") - // ContainerCommandArgsKey is the attribute Key conforming to the - // "container.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) run by the - // container. [2] + // HostIPKey is the attribute Key conforming to the "host.ip" semantic + // conventions. It represents the available IP addresses of the host, + // excluding loopback interfaces. // // Type: string[] // RequirementLevel: Optional - // Stability: stable - // Examples: 'otelcontribcol, --config, config.yaml' - ContainerCommandArgsKey = attribute.Key("container.command_args") -) + // Stability: experimental + // Examples: '192.168.1.140', 'fe80::abc2:4a28:737a:609e' + // Note: IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 + // addresses MUST be specified in the [RFC + // 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format. + HostIPKey = attribute.Key("host.ip") -// ContainerName returns an attribute KeyValue conforming to the -// "container.name" semantic conventions. It represents the container name used -// by container runtime. -func ContainerName(val string) attribute.KeyValue { - return ContainerNameKey.String(val) -} + // HostMacKey is the attribute Key conforming to the "host.mac" semantic + // conventions. It represents the available MAC addresses of the host, + // excluding loopback interfaces. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F' + // Note: MAC Addresses MUST be represented in [IEEE RA hexadecimal + // form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): + // as hyphen-separated octets in uppercase hexadecimal form from most to + // least significant. + HostMacKey = attribute.Key("host.mac") -// ContainerID returns an attribute KeyValue conforming to the -// "container.id" semantic conventions. It represents the container ID. Usually -// a UUID, as for example used to [identify Docker -// containers](https://docs.docker.com/engine/reference/run/#container-identification). -// The UUID might be abbreviated. -func ContainerID(val string) attribute.KeyValue { - return ContainerIDKey.String(val) -} + // HostNameKey is the attribute Key conforming to the "host.name" semantic + // conventions. It represents the name of the host. On Unix systems, it may + // contain what the hostname command returns, or the fully qualified + // hostname, or another name specified by the user. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'opentelemetry-test' + HostNameKey = attribute.Key("host.name") -// ContainerRuntime returns an attribute KeyValue conforming to the -// "container.runtime" semantic conventions. It represents the container -// runtime managing this container. -func ContainerRuntime(val string) attribute.KeyValue { - return ContainerRuntimeKey.String(val) -} + // HostTypeKey is the attribute Key conforming to the "host.type" semantic + // conventions. It represents the type of host. For Cloud, this must be the + // machine type. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'n1-standard-1' + HostTypeKey = attribute.Key("host.type") +) -// ContainerImageName returns an attribute KeyValue conforming to the -// "container.image.name" semantic conventions. It represents the name of the -// image the container was built on. -func ContainerImageName(val string) attribute.KeyValue { - return ContainerImageNameKey.String(val) -} +var ( + // AMD64 + HostArchAMD64 = HostArchKey.String("amd64") + // ARM32 + HostArchARM32 = HostArchKey.String("arm32") + // ARM64 + HostArchARM64 = HostArchKey.String("arm64") + // Itanium + HostArchIA64 = HostArchKey.String("ia64") + // 32-bit PowerPC + HostArchPPC32 = HostArchKey.String("ppc32") + // 64-bit PowerPC + HostArchPPC64 = HostArchKey.String("ppc64") + // IBM z/Architecture + HostArchS390x = HostArchKey.String("s390x") + // 32-bit x86 + HostArchX86 = HostArchKey.String("x86") +) -// ContainerImageTag returns an attribute KeyValue conforming to the -// "container.image.tag" semantic conventions. It represents the container -// image tag. -func ContainerImageTag(val string) attribute.KeyValue { - return ContainerImageTagKey.String(val) +// HostCPUCacheL2Size returns an attribute KeyValue conforming to the +// "host.cpu.cache.l2.size" semantic conventions. It represents the amount of +// level 2 memory cache available to the processor (in Bytes). +func HostCPUCacheL2Size(val int) attribute.KeyValue { + return HostCPUCacheL2SizeKey.Int(val) } -// ContainerImageID returns an attribute KeyValue conforming to the -// "container.image.id" semantic conventions. It represents the runtime -// specific image identifier. Usually a hash algorithm followed by a UUID. -func ContainerImageID(val string) attribute.KeyValue { - return ContainerImageIDKey.String(val) +// HostCPUFamily returns an attribute KeyValue conforming to the +// "host.cpu.family" semantic conventions. It represents the family or +// generation of the CPU. +func HostCPUFamily(val string) attribute.KeyValue { + return HostCPUFamilyKey.String(val) } -// ContainerCommand returns an attribute KeyValue conforming to the -// "container.command" semantic conventions. It represents the command used to -// run the container (i.e. the command name). -func ContainerCommand(val string) attribute.KeyValue { - return ContainerCommandKey.String(val) +// HostCPUModelID returns an attribute KeyValue conforming to the +// "host.cpu.model.id" semantic conventions. It represents the model +// identifier. It provides more granular information about the CPU, +// distinguishing it from other CPUs within the same family. +func HostCPUModelID(val string) attribute.KeyValue { + return HostCPUModelIDKey.String(val) } -// ContainerCommandLine returns an attribute KeyValue conforming to the -// "container.command_line" semantic conventions. It represents the full -// command run by the container as a single string representing the full -// command. [2] -func ContainerCommandLine(val string) attribute.KeyValue { - return ContainerCommandLineKey.String(val) +// HostCPUModelName returns an attribute KeyValue conforming to the +// "host.cpu.model.name" semantic conventions. It represents the model +// designation of the processor. +func HostCPUModelName(val string) attribute.KeyValue { + return HostCPUModelNameKey.String(val) } -// ContainerCommandArgs returns an attribute KeyValue conforming to the -// "container.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) run by the -// container. [2] -func ContainerCommandArgs(val ...string) attribute.KeyValue { - return ContainerCommandArgsKey.StringSlice(val) +// HostCPUStepping returns an attribute KeyValue conforming to the +// "host.cpu.stepping" semantic conventions. It represents the stepping or core +// revisions. +func HostCPUStepping(val int) attribute.KeyValue { + return HostCPUSteppingKey.Int(val) } -// The software deployment. -const ( - // DeploymentEnvironmentKey is the attribute Key conforming to the - // "deployment.environment" semantic conventions. It represents the name of - // the [deployment - // environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka - // deployment tier). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'staging', 'production' - DeploymentEnvironmentKey = attribute.Key("deployment.environment") -) - -// DeploymentEnvironment returns an attribute KeyValue conforming to the -// "deployment.environment" semantic conventions. It represents the name of the -// [deployment -// environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka -// deployment tier). -func DeploymentEnvironment(val string) attribute.KeyValue { - return DeploymentEnvironmentKey.String(val) +// HostCPUVendorID returns an attribute KeyValue conforming to the +// "host.cpu.vendor.id" semantic conventions. It represents the processor +// manufacturer identifier. A maximum 12-character string. +func HostCPUVendorID(val string) attribute.KeyValue { + return HostCPUVendorIDKey.String(val) } -// The device on which the process represented by this resource is running. -const ( - // DeviceIDKey is the attribute Key conforming to the "device.id" semantic - // conventions. It represents a unique identifier representing the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '2ab2916d-a51f-4ac8-80ee-45ac31a28092' - // Note: The device identifier MUST only be defined using the values - // outlined below. This value is not an advertising identifier and MUST NOT - // be used as such. On iOS (Swift or Objective-C), this value MUST be equal - // to the [vendor - // identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). - // On Android (Java or Kotlin), this value MUST be equal to the Firebase - // Installation ID or a globally unique UUID which is persisted across - // sessions in your application. More information can be found - // [here](https://developer.android.com/training/articles/user-data-ids) on - // best practices and exact implementation details. Caution should be taken - // when storing personal data or anything which can identify a user. GDPR - // and data protection laws may apply, ensure you do your own due - // diligence. - DeviceIDKey = attribute.Key("device.id") +// HostID returns an attribute KeyValue conforming to the "host.id" semantic +// conventions. It represents the unique host ID. For Cloud, this must be the +// instance_id assigned by the cloud provider. For non-containerized systems, +// this should be the `machine-id`. See the table below for the sources to use +// to determine the `machine-id` based on operating system. +func HostID(val string) attribute.KeyValue { + return HostIDKey.String(val) +} - // DeviceModelIdentifierKey is the attribute Key conforming to the - // "device.model.identifier" semantic conventions. It represents the model - // identifier for the device - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone3,4', 'SM-G920F' - // Note: It's recommended this value represents a machine readable version - // of the model identifier rather than the market or consumer-friendly name - // of the device. - DeviceModelIdentifierKey = attribute.Key("device.model.identifier") +// HostImageID returns an attribute KeyValue conforming to the +// "host.image.id" semantic conventions. It represents the vM image ID or host +// OS image ID. For Cloud, this value is from the provider. +func HostImageID(val string) attribute.KeyValue { + return HostImageIDKey.String(val) +} - // DeviceModelNameKey is the attribute Key conforming to the - // "device.model.name" semantic conventions. It represents the marketing - // name for the device model - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'iPhone 6s Plus', 'Samsung Galaxy S6' - // Note: It's recommended this value represents a human readable version of - // the device model rather than a machine readable alternative. - DeviceModelNameKey = attribute.Key("device.model.name") +// HostImageName returns an attribute KeyValue conforming to the +// "host.image.name" semantic conventions. It represents the name of the VM +// image or OS install the host was instantiated from. +func HostImageName(val string) attribute.KeyValue { + return HostImageNameKey.String(val) +} - // DeviceManufacturerKey is the attribute Key conforming to the - // "device.manufacturer" semantic conventions. It represents the name of - // the device manufacturer - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Apple', 'Samsung' - // Note: The Android OS provides this field via - // [Build](https://developer.android.com/reference/android/os/Build#MANUFACTURER). - // iOS apps SHOULD hardcode the value `Apple`. - DeviceManufacturerKey = attribute.Key("device.manufacturer") -) +// HostImageVersion returns an attribute KeyValue conforming to the +// "host.image.version" semantic conventions. It represents the version string +// of the VM image or host OS as defined in [Version +// Attributes](/docs/resource/README.md#version-attributes). +func HostImageVersion(val string) attribute.KeyValue { + return HostImageVersionKey.String(val) +} -// DeviceID returns an attribute KeyValue conforming to the "device.id" -// semantic conventions. It represents a unique identifier representing the -// device -func DeviceID(val string) attribute.KeyValue { - return DeviceIDKey.String(val) +// HostIP returns an attribute KeyValue conforming to the "host.ip" semantic +// conventions. It represents the available IP addresses of the host, excluding +// loopback interfaces. +func HostIP(val ...string) attribute.KeyValue { + return HostIPKey.StringSlice(val) } -// DeviceModelIdentifier returns an attribute KeyValue conforming to the -// "device.model.identifier" semantic conventions. It represents the model -// identifier for the device -func DeviceModelIdentifier(val string) attribute.KeyValue { - return DeviceModelIdentifierKey.String(val) +// HostMac returns an attribute KeyValue conforming to the "host.mac" +// semantic conventions. It represents the available MAC addresses of the host, +// excluding loopback interfaces. +func HostMac(val ...string) attribute.KeyValue { + return HostMacKey.StringSlice(val) } -// DeviceModelName returns an attribute KeyValue conforming to the -// "device.model.name" semantic conventions. It represents the marketing name -// for the device model -func DeviceModelName(val string) attribute.KeyValue { - return DeviceModelNameKey.String(val) +// HostName returns an attribute KeyValue conforming to the "host.name" +// semantic conventions. It represents the name of the host. On Unix systems, +// it may contain what the hostname command returns, or the fully qualified +// hostname, or another name specified by the user. +func HostName(val string) attribute.KeyValue { + return HostNameKey.String(val) } -// DeviceManufacturer returns an attribute KeyValue conforming to the -// "device.manufacturer" semantic conventions. It represents the name of the -// device manufacturer -func DeviceManufacturer(val string) attribute.KeyValue { - return DeviceManufacturerKey.String(val) +// HostType returns an attribute KeyValue conforming to the "host.type" +// semantic conventions. It represents the type of host. For Cloud, this must +// be the machine type. +func HostType(val string) attribute.KeyValue { + return HostTypeKey.String(val) } -// A serverless instance. +// Kubernetes resource attributes. const ( - // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic - // conventions. It represents the name of the single function that this - // runtime instance executes. + // K8SClusterNameKey is the attribute Key conforming to the + // "k8s.cluster.name" semantic conventions. It represents the name of the + // cluster. // // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function', 'myazurefunctionapp/some-function-name' - // Note: This is the name of the function as configured/deployed on the - // FaaS - // platform and is usually different from the name of the callback - // function (which may be stored in the - // [`code.namespace`/`code.function`](/docs/general/general-attributes.md#source-code-attributes) - // span attributes). - // - // For some cloud providers, the above definition is ambiguous. The - // following - // definition of function name MUST be used for this attribute - // (and consequently the span name) for the listed cloud - // providers/products: - // - // * **Azure:** The full name `/`, i.e., function app name - // followed by a forward slash followed by the function name (this form - // can also be seen in the resource JSON for the function). - // This means that a span attribute MUST be used, as an Azure function - // app can host multiple functions that would usually share - // a TracerProvider (see also the `cloud.resource_id` attribute). - FaaSNameKey = attribute.Key("faas.name") + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'opentelemetry-cluster' + K8SClusterNameKey = attribute.Key("k8s.cluster.name") - // FaaSVersionKey is the attribute Key conforming to the "faas.version" - // semantic conventions. It represents the immutable version of the - // function being executed. + // K8SClusterUIDKey is the attribute Key conforming to the + // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for + // the cluster, set to the UID of the `kube-system` namespace. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '26', 'pinkfroid-00002' - // Note: Depending on the cloud provider and platform, use: + // Stability: experimental + // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' + // Note: K8S doesn't have support for obtaining a cluster ID. If this is + // ever + // added, we will recommend collecting the `k8s.cluster.uid` through the + // official APIs. In the meantime, we are able to use the `uid` of the + // `kube-system` namespace as a proxy for cluster ID. Read on for the + // rationale. // - // * **AWS Lambda:** The [function - // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - // (an integer represented as a decimal string). - // * **Google Cloud Run (Services):** The - // [revision](https://cloud.google.com/run/docs/managing/revisions) - // (i.e., the function name plus the revision suffix). - // * **Google Cloud Functions:** The value of the - // [`K_REVISION` environment - // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - // * **Azure Functions:** Not applicable. Do not set this attribute. - FaaSVersionKey = attribute.Key("faas.version") + // Every object created in a K8S cluster is assigned a distinct UID. The + // `kube-system` namespace is used by Kubernetes itself and will exist + // for the lifetime of the cluster. Using the `uid` of the `kube-system` + // namespace is a reasonable proxy for the K8S ClusterID as it will only + // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + // UUIDs as standardized by + // [ISO/IEC 9834-8 and ITU-T + // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). + // Which states: + // + // > If generated according to one of the mechanisms defined in Rec. + // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + // different from all other UUIDs generated before 3603 A.D., or is + // extremely likely to be different (depending on the mechanism chosen). + // + // Therefore, UIDs between clusters should be extremely unlikely to + // conflict. + K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") - // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" - // semantic conventions. It represents the execution environment ID as a - // string, that will be potentially reused for other invocations to the - // same function/function version. + // K8SContainerNameKey is the attribute Key conforming to the + // "k8s.container.name" semantic conventions. It represents the name of the + // Container from Pod specification, must be unique within a Pod. Container + // runtime usually uses different globally unique name (`container.name`). // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' - // Note: * **AWS Lambda:** Use the (full) log stream name. - FaaSInstanceKey = attribute.Key("faas.instance") + // Stability: experimental + // Examples: 'redis' + K8SContainerNameKey = attribute.Key("k8s.container.name") - // FaaSMaxMemoryKey is the attribute Key conforming to the - // "faas.max_memory" semantic conventions. It represents the amount of - // memory available to the serverless function converted to Bytes. + // K8SContainerRestartCountKey is the attribute Key conforming to the + // "k8s.container.restart_count" semantic conventions. It represents the + // number of times the container was restarted. This attribute can be used + // to identify a particular container (running or stopped) within a + // container spec. // // Type: int // RequirementLevel: Optional - // Stability: stable - // Examples: 134217728 - // Note: It's recommended to set this attribute since e.g. too little - // memory can easily stop a Java AWS Lambda function from working - // correctly. On AWS Lambda, the environment variable - // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must - // be multiplied by 1,048,576). - FaaSMaxMemoryKey = attribute.Key("faas.max_memory") -) - -// FaaSName returns an attribute KeyValue conforming to the "faas.name" -// semantic conventions. It represents the name of the single function that -// this runtime instance executes. -func FaaSName(val string) attribute.KeyValue { - return FaaSNameKey.String(val) -} - -// FaaSVersion returns an attribute KeyValue conforming to the -// "faas.version" semantic conventions. It represents the immutable version of -// the function being executed. -func FaaSVersion(val string) attribute.KeyValue { - return FaaSVersionKey.String(val) -} - -// FaaSInstance returns an attribute KeyValue conforming to the -// "faas.instance" semantic conventions. It represents the execution -// environment ID as a string, that will be potentially reused for other -// invocations to the same function/function version. -func FaaSInstance(val string) attribute.KeyValue { - return FaaSInstanceKey.String(val) -} - -// FaaSMaxMemory returns an attribute KeyValue conforming to the -// "faas.max_memory" semantic conventions. It represents the amount of memory -// available to the serverless function converted to Bytes. -func FaaSMaxMemory(val int) attribute.KeyValue { - return FaaSMaxMemoryKey.Int(val) -} + // Stability: experimental + // Examples: 0, 2 + K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") -// A host is defined as a computing instance. For example, physical servers, -// virtual machines, switches or disk array. -const ( - // HostIDKey is the attribute Key conforming to the "host.id" semantic - // conventions. It represents the unique host ID. For Cloud, this must be - // the instance_id assigned by the cloud provider. For non-containerized - // systems, this should be the `machine-id`. See the table below for the - // sources to use to determine the `machine-id` based on operating system. + // K8SCronJobNameKey is the attribute Key conforming to the + // "k8s.cronjob.name" semantic conventions. It represents the name of the + // CronJob. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'fdbf79e8af94cb7f9e8df36789187052' - HostIDKey = attribute.Key("host.id") + // Stability: experimental + // Examples: 'opentelemetry' + K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") - // HostNameKey is the attribute Key conforming to the "host.name" semantic - // conventions. It represents the name of the host. On Unix systems, it may - // contain what the hostname command returns, or the fully qualified - // hostname, or another name specified by the user. + // K8SCronJobUIDKey is the attribute Key conforming to the + // "k8s.cronjob.uid" semantic conventions. It represents the UID of the + // CronJob. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-test' - HostNameKey = attribute.Key("host.name") + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - // HostTypeKey is the attribute Key conforming to the "host.type" semantic - // conventions. It represents the type of host. For Cloud, this must be the - // machine type. + // K8SDaemonSetNameKey is the attribute Key conforming to the + // "k8s.daemonset.name" semantic conventions. It represents the name of the + // DaemonSet. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'n1-standard-1' - HostTypeKey = attribute.Key("host.type") + // Stability: experimental + // Examples: 'opentelemetry' + K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") - // HostArchKey is the attribute Key conforming to the "host.arch" semantic - // conventions. It represents the CPU architecture the host system is - // running on. + // K8SDaemonSetUIDKey is the attribute Key conforming to the + // "k8s.daemonset.uid" semantic conventions. It represents the UID of the + // DaemonSet. // - // Type: Enum + // Type: string // RequirementLevel: Optional - // Stability: stable - HostArchKey = attribute.Key("host.arch") + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - // HostImageNameKey is the attribute Key conforming to the - // "host.image.name" semantic conventions. It represents the name of the VM - // image or OS install the host was instantiated from. + // K8SDeploymentNameKey is the attribute Key conforming to the + // "k8s.deployment.name" semantic conventions. It represents the name of + // the Deployment. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905' - HostImageNameKey = attribute.Key("host.image.name") + // Stability: experimental + // Examples: 'opentelemetry' + K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") - // HostImageIDKey is the attribute Key conforming to the "host.image.id" - // semantic conventions. It represents the vM image ID or host OS image ID. - // For Cloud, this value is from the provider. + // K8SDeploymentUIDKey is the attribute Key conforming to the + // "k8s.deployment.uid" semantic conventions. It represents the UID of the + // Deployment. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'ami-07b06b442921831e5' - HostImageIDKey = attribute.Key("host.image.id") + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") - // HostImageVersionKey is the attribute Key conforming to the - // "host.image.version" semantic conventions. It represents the version - // string of the VM image or host OS as defined in [Version - // Attributes](README.md#version-attributes). + // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" + // semantic conventions. It represents the name of the Job. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '0.1' - HostImageVersionKey = attribute.Key("host.image.version") -) - -var ( - // AMD64 - HostArchAMD64 = HostArchKey.String("amd64") - // ARM32 - HostArchARM32 = HostArchKey.String("arm32") - // ARM64 - HostArchARM64 = HostArchKey.String("arm64") - // Itanium - HostArchIA64 = HostArchKey.String("ia64") - // 32-bit PowerPC - HostArchPPC32 = HostArchKey.String("ppc32") - // 64-bit PowerPC - HostArchPPC64 = HostArchKey.String("ppc64") - // IBM z/Architecture - HostArchS390x = HostArchKey.String("s390x") - // 32-bit x86 - HostArchX86 = HostArchKey.String("x86") -) - -// HostID returns an attribute KeyValue conforming to the "host.id" semantic -// conventions. It represents the unique host ID. For Cloud, this must be the -// instance_id assigned by the cloud provider. For non-containerized systems, -// this should be the `machine-id`. See the table below for the sources to use -// to determine the `machine-id` based on operating system. -func HostID(val string) attribute.KeyValue { - return HostIDKey.String(val) -} - -// HostName returns an attribute KeyValue conforming to the "host.name" -// semantic conventions. It represents the name of the host. On Unix systems, -// it may contain what the hostname command returns, or the fully qualified -// hostname, or another name specified by the user. -func HostName(val string) attribute.KeyValue { - return HostNameKey.String(val) -} - -// HostType returns an attribute KeyValue conforming to the "host.type" -// semantic conventions. It represents the type of host. For Cloud, this must -// be the machine type. -func HostType(val string) attribute.KeyValue { - return HostTypeKey.String(val) -} - -// HostImageName returns an attribute KeyValue conforming to the -// "host.image.name" semantic conventions. It represents the name of the VM -// image or OS install the host was instantiated from. -func HostImageName(val string) attribute.KeyValue { - return HostImageNameKey.String(val) -} - -// HostImageID returns an attribute KeyValue conforming to the -// "host.image.id" semantic conventions. It represents the vM image ID or host -// OS image ID. For Cloud, this value is from the provider. -func HostImageID(val string) attribute.KeyValue { - return HostImageIDKey.String(val) -} - -// HostImageVersion returns an attribute KeyValue conforming to the -// "host.image.version" semantic conventions. It represents the version string -// of the VM image or host OS as defined in [Version -// Attributes](README.md#version-attributes). -func HostImageVersion(val string) attribute.KeyValue { - return HostImageVersionKey.String(val) -} + // Stability: experimental + // Examples: 'opentelemetry' + K8SJobNameKey = attribute.Key("k8s.job.name") -// A Kubernetes Cluster. -const ( - // K8SClusterNameKey is the attribute Key conforming to the - // "k8s.cluster.name" semantic conventions. It represents the name of the - // cluster. + // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" + // semantic conventions. It represents the UID of the Job. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-cluster' - K8SClusterNameKey = attribute.Key("k8s.cluster.name") + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SJobUIDKey = attribute.Key("k8s.job.uid") - // K8SClusterUIDKey is the attribute Key conforming to the - // "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for - // the cluster, set to the UID of the `kube-system` namespace. + // K8SNamespaceNameKey is the attribute Key conforming to the + // "k8s.namespace.name" semantic conventions. It represents the name of the + // namespace that the pod is running in. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '218fc5a9-a5f1-4b54-aa05-46717d0ab26d' - // Note: K8S does not have support for obtaining a cluster ID. If this is - // ever - // added, we will recommend collecting the `k8s.cluster.uid` through the - // official APIs. In the meantime, we are able to use the `uid` of the - // `kube-system` namespace as a proxy for cluster ID. Read on for the - // rationale. - // - // Every object created in a K8S cluster is assigned a distinct UID. The - // `kube-system` namespace is used by Kubernetes itself and will exist - // for the lifetime of the cluster. Using the `uid` of the `kube-system` - // namespace is a reasonable proxy for the K8S ClusterID as it will only - // change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are - // UUIDs as standardized by - // [ISO/IEC 9834-8 and ITU-T - // X.667](https://www.itu.int/ITU-T/studygroups/com17/oid.html). - // Which states: - // - // > If generated according to one of the mechanisms defined in Rec. - // ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - // different from all other UUIDs generated before 3603 A.D., or is - // extremely likely to be different (depending on the mechanism chosen). - // - // Therefore, UIDs between clusters should be extremely unlikely to - // conflict. - K8SClusterUIDKey = attribute.Key("k8s.cluster.uid") -) - -// K8SClusterName returns an attribute KeyValue conforming to the -// "k8s.cluster.name" semantic conventions. It represents the name of the -// cluster. -func K8SClusterName(val string) attribute.KeyValue { - return K8SClusterNameKey.String(val) -} - -// K8SClusterUID returns an attribute KeyValue conforming to the -// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the -// cluster, set to the UID of the `kube-system` namespace. -func K8SClusterUID(val string) attribute.KeyValue { - return K8SClusterUIDKey.String(val) -} + // Stability: experimental + // Examples: 'default' + K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") -// A Kubernetes Node object. -const ( // K8SNodeNameKey is the attribute Key conforming to the "k8s.node.name" // semantic conventions. It represents the name of the Node. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'node-1' K8SNodeNameKey = attribute.Key("k8s.node.name") @@ -1317,103 +999,83 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '1eb3a0c6-0477-4080-a9cb-0cb7db65c6a2' K8SNodeUIDKey = attribute.Key("k8s.node.uid") -) - -// K8SNodeName returns an attribute KeyValue conforming to the -// "k8s.node.name" semantic conventions. It represents the name of the Node. -func K8SNodeName(val string) attribute.KeyValue { - return K8SNodeNameKey.String(val) -} -// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" -// semantic conventions. It represents the UID of the Node. -func K8SNodeUID(val string) attribute.KeyValue { - return K8SNodeUIDKey.String(val) -} - -// A Kubernetes Namespace. -const ( - // K8SNamespaceNameKey is the attribute Key conforming to the - // "k8s.namespace.name" semantic conventions. It represents the name of the - // namespace that the pod is running in. + // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" + // semantic conventions. It represents the name of the Pod. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'default' - K8SNamespaceNameKey = attribute.Key("k8s.namespace.name") -) - -// K8SNamespaceName returns an attribute KeyValue conforming to the -// "k8s.namespace.name" semantic conventions. It represents the name of the -// namespace that the pod is running in. -func K8SNamespaceName(val string) attribute.KeyValue { - return K8SNamespaceNameKey.String(val) -} + // Stability: experimental + // Examples: 'opentelemetry-pod-autoconf' + K8SPodNameKey = attribute.Key("k8s.pod.name") -// A Kubernetes Pod object. -const ( // K8SPodUIDKey is the attribute Key conforming to the "k8s.pod.uid" // semantic conventions. It represents the UID of the Pod. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' K8SPodUIDKey = attribute.Key("k8s.pod.uid") - // K8SPodNameKey is the attribute Key conforming to the "k8s.pod.name" - // semantic conventions. It represents the name of the Pod. + // K8SReplicaSetNameKey is the attribute Key conforming to the + // "k8s.replicaset.name" semantic conventions. It represents the name of + // the ReplicaSet. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry-pod-autoconf' - K8SPodNameKey = attribute.Key("k8s.pod.name") -) - -// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" -// semantic conventions. It represents the UID of the Pod. -func K8SPodUID(val string) attribute.KeyValue { - return K8SPodUIDKey.String(val) -} + // Stability: experimental + // Examples: 'opentelemetry' + K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") -// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" -// semantic conventions. It represents the name of the Pod. -func K8SPodName(val string) attribute.KeyValue { - return K8SPodNameKey.String(val) -} + // K8SReplicaSetUIDKey is the attribute Key conforming to the + // "k8s.replicaset.uid" semantic conventions. It represents the UID of the + // ReplicaSet. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") -// A container in a -// [PodTemplate](https://kubernetes.io/docs/concepts/workloads/pods/#pod-templates). -const ( - // K8SContainerNameKey is the attribute Key conforming to the - // "k8s.container.name" semantic conventions. It represents the name of the - // Container from Pod specification, must be unique within a Pod. Container - // runtime usually uses different globally unique name (`container.name`). + // K8SStatefulSetNameKey is the attribute Key conforming to the + // "k8s.statefulset.name" semantic conventions. It represents the name of + // the StatefulSet. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'redis' - K8SContainerNameKey = attribute.Key("k8s.container.name") + // Stability: experimental + // Examples: 'opentelemetry' + K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") - // K8SContainerRestartCountKey is the attribute Key conforming to the - // "k8s.container.restart_count" semantic conventions. It represents the - // number of times the container was restarted. This attribute can be used - // to identify a particular container (running or stopped) within a - // container spec. + // K8SStatefulSetUIDKey is the attribute Key conforming to the + // "k8s.statefulset.uid" semantic conventions. It represents the UID of the + // StatefulSet. // - // Type: int + // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - K8SContainerRestartCountKey = attribute.Key("k8s.container.restart_count") + // Stability: experimental + // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' + K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") ) +// K8SClusterName returns an attribute KeyValue conforming to the +// "k8s.cluster.name" semantic conventions. It represents the name of the +// cluster. +func K8SClusterName(val string) attribute.KeyValue { + return K8SClusterNameKey.String(val) +} + +// K8SClusterUID returns an attribute KeyValue conforming to the +// "k8s.cluster.uid" semantic conventions. It represents a pseudo-ID for the +// cluster, set to the UID of the `kube-system` namespace. +func K8SClusterUID(val string) attribute.KeyValue { + return K8SClusterUIDKey.String(val) +} + // K8SContainerName returns an attribute KeyValue conforming to the // "k8s.container.name" semantic conventions. It represents the name of the // Container from Pod specification, must be unique within a Pod. Container @@ -1430,65 +1092,40 @@ func K8SContainerRestartCount(val int) attribute.KeyValue { return K8SContainerRestartCountKey.Int(val) } -// A Kubernetes ReplicaSet object. -const ( - // K8SReplicaSetUIDKey is the attribute Key conforming to the - // "k8s.replicaset.uid" semantic conventions. It represents the UID of the - // ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SReplicaSetUIDKey = attribute.Key("k8s.replicaset.uid") - - // K8SReplicaSetNameKey is the attribute Key conforming to the - // "k8s.replicaset.name" semantic conventions. It represents the name of - // the ReplicaSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SReplicaSetNameKey = attribute.Key("k8s.replicaset.name") -) +// K8SCronJobName returns an attribute KeyValue conforming to the +// "k8s.cronjob.name" semantic conventions. It represents the name of the +// CronJob. +func K8SCronJobName(val string) attribute.KeyValue { + return K8SCronJobNameKey.String(val) +} -// K8SReplicaSetUID returns an attribute KeyValue conforming to the -// "k8s.replicaset.uid" semantic conventions. It represents the UID of the -// ReplicaSet. -func K8SReplicaSetUID(val string) attribute.KeyValue { - return K8SReplicaSetUIDKey.String(val) +// K8SCronJobUID returns an attribute KeyValue conforming to the +// "k8s.cronjob.uid" semantic conventions. It represents the UID of the +// CronJob. +func K8SCronJobUID(val string) attribute.KeyValue { + return K8SCronJobUIDKey.String(val) } -// K8SReplicaSetName returns an attribute KeyValue conforming to the -// "k8s.replicaset.name" semantic conventions. It represents the name of the -// ReplicaSet. -func K8SReplicaSetName(val string) attribute.KeyValue { - return K8SReplicaSetNameKey.String(val) +// K8SDaemonSetName returns an attribute KeyValue conforming to the +// "k8s.daemonset.name" semantic conventions. It represents the name of the +// DaemonSet. +func K8SDaemonSetName(val string) attribute.KeyValue { + return K8SDaemonSetNameKey.String(val) } -// A Kubernetes Deployment object. -const ( - // K8SDeploymentUIDKey is the attribute Key conforming to the - // "k8s.deployment.uid" semantic conventions. It represents the UID of the - // Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDeploymentUIDKey = attribute.Key("k8s.deployment.uid") +// K8SDaemonSetUID returns an attribute KeyValue conforming to the +// "k8s.daemonset.uid" semantic conventions. It represents the UID of the +// DaemonSet. +func K8SDaemonSetUID(val string) attribute.KeyValue { + return K8SDaemonSetUIDKey.String(val) +} - // K8SDeploymentNameKey is the attribute Key conforming to the - // "k8s.deployment.name" semantic conventions. It represents the name of - // the Deployment. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDeploymentNameKey = attribute.Key("k8s.deployment.name") -) +// K8SDeploymentName returns an attribute KeyValue conforming to the +// "k8s.deployment.name" semantic conventions. It represents the name of the +// Deployment. +func K8SDeploymentName(val string) attribute.KeyValue { + return K8SDeploymentNameKey.String(val) +} // K8SDeploymentUID returns an attribute KeyValue conforming to the // "k8s.deployment.uid" semantic conventions. It represents the UID of the @@ -1497,41 +1134,61 @@ func K8SDeploymentUID(val string) attribute.KeyValue { return K8SDeploymentUIDKey.String(val) } -// K8SDeploymentName returns an attribute KeyValue conforming to the -// "k8s.deployment.name" semantic conventions. It represents the name of the -// Deployment. -func K8SDeploymentName(val string) attribute.KeyValue { - return K8SDeploymentNameKey.String(val) +// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" +// semantic conventions. It represents the name of the Job. +func K8SJobName(val string) attribute.KeyValue { + return K8SJobNameKey.String(val) } -// A Kubernetes StatefulSet object. -const ( - // K8SStatefulSetUIDKey is the attribute Key conforming to the - // "k8s.statefulset.uid" semantic conventions. It represents the UID of the - // StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SStatefulSetUIDKey = attribute.Key("k8s.statefulset.uid") +// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" +// semantic conventions. It represents the UID of the Job. +func K8SJobUID(val string) attribute.KeyValue { + return K8SJobUIDKey.String(val) +} - // K8SStatefulSetNameKey is the attribute Key conforming to the - // "k8s.statefulset.name" semantic conventions. It represents the name of - // the StatefulSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SStatefulSetNameKey = attribute.Key("k8s.statefulset.name") -) +// K8SNamespaceName returns an attribute KeyValue conforming to the +// "k8s.namespace.name" semantic conventions. It represents the name of the +// namespace that the pod is running in. +func K8SNamespaceName(val string) attribute.KeyValue { + return K8SNamespaceNameKey.String(val) +} -// K8SStatefulSetUID returns an attribute KeyValue conforming to the -// "k8s.statefulset.uid" semantic conventions. It represents the UID of the -// StatefulSet. -func K8SStatefulSetUID(val string) attribute.KeyValue { - return K8SStatefulSetUIDKey.String(val) +// K8SNodeName returns an attribute KeyValue conforming to the +// "k8s.node.name" semantic conventions. It represents the name of the Node. +func K8SNodeName(val string) attribute.KeyValue { + return K8SNodeNameKey.String(val) +} + +// K8SNodeUID returns an attribute KeyValue conforming to the "k8s.node.uid" +// semantic conventions. It represents the UID of the Node. +func K8SNodeUID(val string) attribute.KeyValue { + return K8SNodeUIDKey.String(val) +} + +// K8SPodName returns an attribute KeyValue conforming to the "k8s.pod.name" +// semantic conventions. It represents the name of the Pod. +func K8SPodName(val string) attribute.KeyValue { + return K8SPodNameKey.String(val) +} + +// K8SPodUID returns an attribute KeyValue conforming to the "k8s.pod.uid" +// semantic conventions. It represents the UID of the Pod. +func K8SPodUID(val string) attribute.KeyValue { + return K8SPodUIDKey.String(val) +} + +// K8SReplicaSetName returns an attribute KeyValue conforming to the +// "k8s.replicaset.name" semantic conventions. It represents the name of the +// ReplicaSet. +func K8SReplicaSetName(val string) attribute.KeyValue { + return K8SReplicaSetNameKey.String(val) +} + +// K8SReplicaSetUID returns an attribute KeyValue conforming to the +// "k8s.replicaset.uid" semantic conventions. It represents the UID of the +// ReplicaSet. +func K8SReplicaSetUID(val string) attribute.KeyValue { + return K8SReplicaSetUIDKey.String(val) } // K8SStatefulSetName returns an attribute KeyValue conforming to the @@ -1541,123 +1198,54 @@ func K8SStatefulSetName(val string) attribute.KeyValue { return K8SStatefulSetNameKey.String(val) } -// A Kubernetes DaemonSet object. +// K8SStatefulSetUID returns an attribute KeyValue conforming to the +// "k8s.statefulset.uid" semantic conventions. It represents the UID of the +// StatefulSet. +func K8SStatefulSetUID(val string) attribute.KeyValue { + return K8SStatefulSetUIDKey.String(val) +} + +// An OCI image manifest. const ( - // K8SDaemonSetUIDKey is the attribute Key conforming to the - // "k8s.daemonset.uid" semantic conventions. It represents the UID of the - // DaemonSet. + // OciManifestDigestKey is the attribute Key conforming to the + // "oci.manifest.digest" semantic conventions. It represents the digest of + // the OCI image manifest. For container images specifically is the digest + // by which the container image is known. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SDaemonSetUIDKey = attribute.Key("k8s.daemonset.uid") - - // K8SDaemonSetNameKey is the attribute Key conforming to the - // "k8s.daemonset.name" semantic conventions. It represents the name of the - // DaemonSet. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SDaemonSetNameKey = attribute.Key("k8s.daemonset.name") -) - -// K8SDaemonSetUID returns an attribute KeyValue conforming to the -// "k8s.daemonset.uid" semantic conventions. It represents the UID of the -// DaemonSet. -func K8SDaemonSetUID(val string) attribute.KeyValue { - return K8SDaemonSetUIDKey.String(val) -} - -// K8SDaemonSetName returns an attribute KeyValue conforming to the -// "k8s.daemonset.name" semantic conventions. It represents the name of the -// DaemonSet. -func K8SDaemonSetName(val string) attribute.KeyValue { - return K8SDaemonSetNameKey.String(val) -} - -// A Kubernetes Job object. -const ( - // K8SJobUIDKey is the attribute Key conforming to the "k8s.job.uid" - // semantic conventions. It represents the UID of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SJobUIDKey = attribute.Key("k8s.job.uid") - - // K8SJobNameKey is the attribute Key conforming to the "k8s.job.name" - // semantic conventions. It represents the name of the Job. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SJobNameKey = attribute.Key("k8s.job.name") -) - -// K8SJobUID returns an attribute KeyValue conforming to the "k8s.job.uid" -// semantic conventions. It represents the UID of the Job. -func K8SJobUID(val string) attribute.KeyValue { - return K8SJobUIDKey.String(val) -} - -// K8SJobName returns an attribute KeyValue conforming to the "k8s.job.name" -// semantic conventions. It represents the name of the Job. -func K8SJobName(val string) attribute.KeyValue { - return K8SJobNameKey.String(val) -} - -// A Kubernetes CronJob object. -const ( - // K8SCronJobUIDKey is the attribute Key conforming to the - // "k8s.cronjob.uid" semantic conventions. It represents the UID of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '275ecb36-5aa8-4c2a-9c47-d8bb681b9aff' - K8SCronJobUIDKey = attribute.Key("k8s.cronjob.uid") - - // K8SCronJobNameKey is the attribute Key conforming to the - // "k8s.cronjob.name" semantic conventions. It represents the name of the - // CronJob. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'opentelemetry' - K8SCronJobNameKey = attribute.Key("k8s.cronjob.name") + // Stability: experimental + // Examples: + // 'sha256:e4ca62c0d62f3e886e684806dfe9d4e0cda60d54986898173c1083856cfda0f4' + // Note: Follows [OCI Image Manifest + // Specification](https://github.com/opencontainers/image-spec/blob/main/manifest.md), + // and specifically the [Digest + // property](https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests). + // An example can be found in [Example Image + // Manifest](https://docs.docker.com/registry/spec/manifest-v2-2/#example-image-manifest). + OciManifestDigestKey = attribute.Key("oci.manifest.digest") ) -// K8SCronJobUID returns an attribute KeyValue conforming to the -// "k8s.cronjob.uid" semantic conventions. It represents the UID of the -// CronJob. -func K8SCronJobUID(val string) attribute.KeyValue { - return K8SCronJobUIDKey.String(val) -} - -// K8SCronJobName returns an attribute KeyValue conforming to the -// "k8s.cronjob.name" semantic conventions. It represents the name of the -// CronJob. -func K8SCronJobName(val string) attribute.KeyValue { - return K8SCronJobNameKey.String(val) +// OciManifestDigest returns an attribute KeyValue conforming to the +// "oci.manifest.digest" semantic conventions. It represents the digest of the +// OCI image manifest. For container images specifically is the digest by which +// the container image is known. +func OciManifestDigest(val string) attribute.KeyValue { + return OciManifestDigestKey.String(val) } // The operating system (OS) on which the process represented by this resource // is running. const ( - // OSTypeKey is the attribute Key conforming to the "os.type" semantic - // conventions. It represents the operating system type. + // OSBuildIDKey is the attribute Key conforming to the "os.build_id" + // semantic conventions. It represents the unique identifier for a + // particular build or compilation of the operating system. // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - OSTypeKey = attribute.Key("os.type") + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'TQ3C.230805.001.B2', '20E247', '22621' + OSBuildIDKey = attribute.Key("os.build_id") // OSDescriptionKey is the attribute Key conforming to the "os.description" // semantic conventions. It represents the human readable (not intended to @@ -1666,7 +1254,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'Microsoft Windows [Version 10.0.18363.778]', 'Ubuntu 18.04.1 // LTS' OSDescriptionKey = attribute.Key("os.description") @@ -1676,10 +1264,18 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'iOS', 'Android', 'Ubuntu' OSNameKey = attribute.Key("os.name") + // OSTypeKey is the attribute Key conforming to the "os.type" semantic + // conventions. It represents the operating system type. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + OSTypeKey = attribute.Key("os.type") + // OSVersionKey is the attribute Key conforming to the "os.version" // semantic conventions. It represents the version string of the operating // system as defined in [Version @@ -1687,7 +1283,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '14.2.1', '18.04.1' OSVersionKey = attribute.Key("os.version") ) @@ -1717,6 +1313,13 @@ var ( OSTypeZOS = OSTypeKey.String("z_os") ) +// OSBuildID returns an attribute KeyValue conforming to the "os.build_id" +// semantic conventions. It represents the unique identifier for a particular +// build or compilation of the operating system. +func OSBuildID(val string) attribute.KeyValue { + return OSBuildIDKey.String(val) +} + // OSDescription returns an attribute KeyValue conforming to the // "os.description" semantic conventions. It represents the human readable (not // intended to be parsed) OS version information, like e.g. reported by `ver` @@ -1741,24 +1344,44 @@ func OSVersion(val string) attribute.KeyValue { // An operating system process. const ( - // ProcessPIDKey is the attribute Key conforming to the "process.pid" - // semantic conventions. It represents the process identifier (PID). + // ProcessCommandKey is the attribute Key conforming to the + // "process.command" semantic conventions. It represents the command used + // to launch the process (i.e. the command name). On Linux based systems, + // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can + // be set to the first parameter extracted from `GetCommandLineW`. // - // Type: int + // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 1234 - ProcessPIDKey = attribute.Key("process.pid") + // Stability: experimental + // Examples: 'cmd/otelcol' + ProcessCommandKey = attribute.Key("process.command") - // ProcessParentPIDKey is the attribute Key conforming to the - // "process.parent_pid" semantic conventions. It represents the parent - // Process identifier (PID). + // ProcessCommandArgsKey is the attribute Key conforming to the + // "process.command_args" semantic conventions. It represents the all the + // command arguments (including the command/executable itself) as received + // by the process. On Linux-based systems (and some other Unixoid systems + // supporting procfs), can be set according to the list of null-delimited + // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, + // this would be the full argv vector passed to `main`. // - // Type: int + // Type: string[] // RequirementLevel: Optional - // Stability: stable - // Examples: 111 - ProcessParentPIDKey = attribute.Key("process.parent_pid") + // Stability: experimental + // Examples: 'cmd/otecol', '--config=config.yaml' + ProcessCommandArgsKey = attribute.Key("process.command_args") + + // ProcessCommandLineKey is the attribute Key conforming to the + // "process.command_line" semantic conventions. It represents the full + // command used to launch the process as a single string representing the + // full command. On Windows, can be set to the result of `GetCommandLineW`. + // Do not set this if you have to assemble it just for monitoring; use + // `process.command_args` instead. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' + ProcessCommandLineKey = attribute.Key("process.command_line") // ProcessExecutableNameKey is the attribute Key conforming to the // "process.executable.name" semantic conventions. It represents the name @@ -1767,9 +1390,8 @@ const ( // of `GetProcessImageFileNameW`. // // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable + // RequirementLevel: Optional + // Stability: experimental // Examples: 'otelcol' ProcessExecutableNameKey = attribute.Key("process.executable.name") @@ -1780,76 +1402,102 @@ const ( // `GetProcessImageFileNameW`. // // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable + // RequirementLevel: Optional + // Stability: experimental // Examples: '/usr/bin/cmd/otelcol' ProcessExecutablePathKey = attribute.Key("process.executable.path") - // ProcessCommandKey is the attribute Key conforming to the - // "process.command" semantic conventions. It represents the command used - // to launch the process (i.e. the command name). On Linux based systems, - // can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can - // be set to the first parameter extracted from `GetCommandLineW`. + // ProcessOwnerKey is the attribute Key conforming to the "process.owner" + // semantic conventions. It represents the username of the user that owns + // the process. // // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otelcol' - ProcessCommandKey = attribute.Key("process.command") + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'root' + ProcessOwnerKey = attribute.Key("process.owner") - // ProcessCommandLineKey is the attribute Key conforming to the - // "process.command_line" semantic conventions. It represents the full - // command used to launch the process as a single string representing the - // full command. On Windows, can be set to the result of `GetCommandLineW`. - // Do not set this if you have to assemble it just for monitoring; use - // `process.command_args` instead. + // ProcessParentPIDKey is the attribute Key conforming to the + // "process.parent_pid" semantic conventions. It represents the parent + // Process identifier (PPID). + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 111 + ProcessParentPIDKey = attribute.Key("process.parent_pid") + + // ProcessPIDKey is the attribute Key conforming to the "process.pid" + // semantic conventions. It represents the process identifier (PID). + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 1234 + ProcessPIDKey = attribute.Key("process.pid") + + // ProcessRuntimeDescriptionKey is the attribute Key conforming to the + // "process.runtime.description" semantic conventions. It represents an + // additional description about the runtime of the process, for example a + // specific vendor customization of the runtime environment. // // Type: string - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'C:\\cmd\\otecol --config="my directory\\config.yaml"' - ProcessCommandLineKey = attribute.Key("process.command_line") + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' + ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") - // ProcessCommandArgsKey is the attribute Key conforming to the - // "process.command_args" semantic conventions. It represents the all the - // command arguments (including the command/executable itself) as received - // by the process. On Linux-based systems (and some other Unixoid systems - // supporting procfs), can be set according to the list of null-delimited - // strings extracted from `proc/[pid]/cmdline`. For libc-based executables, - // this would be the full argv vector passed to `main`. + // ProcessRuntimeNameKey is the attribute Key conforming to the + // "process.runtime.name" semantic conventions. It represents the name of + // the runtime of this process. For compiled native binaries, this SHOULD + // be the name of the compiler. // - // Type: string[] - // RequirementLevel: ConditionallyRequired (See alternative attributes - // below.) - // Stability: stable - // Examples: 'cmd/otecol', '--config=config.yaml' - ProcessCommandArgsKey = attribute.Key("process.command_args") + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'OpenJDK Runtime Environment' + ProcessRuntimeNameKey = attribute.Key("process.runtime.name") - // ProcessOwnerKey is the attribute Key conforming to the "process.owner" - // semantic conventions. It represents the username of the user that owns - // the process. + // ProcessRuntimeVersionKey is the attribute Key conforming to the + // "process.runtime.version" semantic conventions. It represents the + // version of the runtime of this process, as returned by the runtime + // without modification. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'root' - ProcessOwnerKey = attribute.Key("process.owner") + // Stability: experimental + // Examples: '14.0.2' + ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") ) -// ProcessPID returns an attribute KeyValue conforming to the "process.pid" -// semantic conventions. It represents the process identifier (PID). -func ProcessPID(val int) attribute.KeyValue { - return ProcessPIDKey.Int(val) +// ProcessCommand returns an attribute KeyValue conforming to the +// "process.command" semantic conventions. It represents the command used to +// launch the process (i.e. the command name). On Linux based systems, can be +// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to +// the first parameter extracted from `GetCommandLineW`. +func ProcessCommand(val string) attribute.KeyValue { + return ProcessCommandKey.String(val) } -// ProcessParentPID returns an attribute KeyValue conforming to the -// "process.parent_pid" semantic conventions. It represents the parent Process -// identifier (PID). -func ProcessParentPID(val int) attribute.KeyValue { - return ProcessParentPIDKey.Int(val) +// ProcessCommandArgs returns an attribute KeyValue conforming to the +// "process.command_args" semantic conventions. It represents the all the +// command arguments (including the command/executable itself) as received by +// the process. On Linux-based systems (and some other Unixoid systems +// supporting procfs), can be set according to the list of null-delimited +// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, +// this would be the full argv vector passed to `main`. +func ProcessCommandArgs(val ...string) attribute.KeyValue { + return ProcessCommandArgsKey.StringSlice(val) +} + +// ProcessCommandLine returns an attribute KeyValue conforming to the +// "process.command_line" semantic conventions. It represents the full command +// used to launch the process as a single string representing the full command. +// On Windows, can be set to the result of `GetCommandLineW`. Do not set this +// if you have to assemble it just for monitoring; use `process.command_args` +// instead. +func ProcessCommandLine(val string) attribute.KeyValue { + return ProcessCommandLineKey.String(val) } // ProcessExecutableName returns an attribute KeyValue conforming to the @@ -1870,101 +1518,675 @@ func ProcessExecutablePath(val string) attribute.KeyValue { return ProcessExecutablePathKey.String(val) } -// ProcessCommand returns an attribute KeyValue conforming to the -// "process.command" semantic conventions. It represents the command used to -// launch the process (i.e. the command name). On Linux based systems, can be -// set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to -// the first parameter extracted from `GetCommandLineW`. -func ProcessCommand(val string) attribute.KeyValue { - return ProcessCommandKey.String(val) +// ProcessOwner returns an attribute KeyValue conforming to the +// "process.owner" semantic conventions. It represents the username of the user +// that owns the process. +func ProcessOwner(val string) attribute.KeyValue { + return ProcessOwnerKey.String(val) } -// ProcessCommandLine returns an attribute KeyValue conforming to the -// "process.command_line" semantic conventions. It represents the full command -// used to launch the process as a single string representing the full command. -// On Windows, can be set to the result of `GetCommandLineW`. Do not set this -// if you have to assemble it just for monitoring; use `process.command_args` -// instead. -func ProcessCommandLine(val string) attribute.KeyValue { - return ProcessCommandLineKey.String(val) +// ProcessParentPID returns an attribute KeyValue conforming to the +// "process.parent_pid" semantic conventions. It represents the parent Process +// identifier (PPID). +func ProcessParentPID(val int) attribute.KeyValue { + return ProcessParentPIDKey.Int(val) } -// ProcessCommandArgs returns an attribute KeyValue conforming to the -// "process.command_args" semantic conventions. It represents the all the -// command arguments (including the command/executable itself) as received by -// the process. On Linux-based systems (and some other Unixoid systems -// supporting procfs), can be set according to the list of null-delimited -// strings extracted from `proc/[pid]/cmdline`. For libc-based executables, -// this would be the full argv vector passed to `main`. -func ProcessCommandArgs(val ...string) attribute.KeyValue { - return ProcessCommandArgsKey.StringSlice(val) +// ProcessPID returns an attribute KeyValue conforming to the "process.pid" +// semantic conventions. It represents the process identifier (PID). +func ProcessPID(val int) attribute.KeyValue { + return ProcessPIDKey.Int(val) +} + +// ProcessRuntimeDescription returns an attribute KeyValue conforming to the +// "process.runtime.description" semantic conventions. It represents an +// additional description about the runtime of the process, for example a +// specific vendor customization of the runtime environment. +func ProcessRuntimeDescription(val string) attribute.KeyValue { + return ProcessRuntimeDescriptionKey.String(val) +} + +// ProcessRuntimeName returns an attribute KeyValue conforming to the +// "process.runtime.name" semantic conventions. It represents the name of the +// runtime of this process. For compiled native binaries, this SHOULD be the +// name of the compiler. +func ProcessRuntimeName(val string) attribute.KeyValue { + return ProcessRuntimeNameKey.String(val) +} + +// ProcessRuntimeVersion returns an attribute KeyValue conforming to the +// "process.runtime.version" semantic conventions. It represents the version of +// the runtime of this process, as returned by the runtime without +// modification. +func ProcessRuntimeVersion(val string) attribute.KeyValue { + return ProcessRuntimeVersionKey.String(val) +} + +// The Android platform on which the Android application is running. +const ( + // AndroidOSAPILevelKey is the attribute Key conforming to the + // "android.os.api_level" semantic conventions. It represents the uniquely + // identifies the framework API revision offered by a version + // (`os.version`) of the android operating system. More information can be + // found + // [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '33', '32' + AndroidOSAPILevelKey = attribute.Key("android.os.api_level") +) + +// AndroidOSAPILevel returns an attribute KeyValue conforming to the +// "android.os.api_level" semantic conventions. It represents the uniquely +// identifies the framework API revision offered by a version (`os.version`) of +// the android operating system. More information can be found +// [here](https://developer.android.com/guide/topics/manifest/uses-sdk-element#APILevels). +func AndroidOSAPILevel(val string) attribute.KeyValue { + return AndroidOSAPILevelKey.String(val) +} + +// The web browser in which the application represented by the resource is +// running. The `browser.*` attributes MUST be used only for resources that +// represent applications running in a web browser (regardless of whether +// running on a mobile or desktop device). +const ( + // BrowserBrandsKey is the attribute Key conforming to the "browser.brands" + // semantic conventions. It represents the array of brand name and version + // separated by a space + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: ' Not A;Brand 99', 'Chromium 99', 'Chrome 99' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.brands`). + BrowserBrandsKey = attribute.Key("browser.brands") + + // BrowserLanguageKey is the attribute Key conforming to the + // "browser.language" semantic conventions. It represents the preferred + // language of the user using the browser + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'en', 'en-US', 'fr', 'fr-FR' + // Note: This value is intended to be taken from the Navigator API + // `navigator.language`. + BrowserLanguageKey = attribute.Key("browser.language") + + // BrowserMobileKey is the attribute Key conforming to the "browser.mobile" + // semantic conventions. It represents a boolean that is true if the + // browser is running on a mobile device + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.mobile`). If unavailable, this attribute + // SHOULD be left unset. + BrowserMobileKey = attribute.Key("browser.mobile") + + // BrowserPlatformKey is the attribute Key conforming to the + // "browser.platform" semantic conventions. It represents the platform on + // which the browser is running + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Windows', 'macOS', 'Android' + // Note: This value is intended to be taken from the [UA client hints + // API](https://wicg.github.io/ua-client-hints/#interface) + // (`navigator.userAgentData.platform`). If unavailable, the legacy + // `navigator.platform` API SHOULD NOT be used instead and this attribute + // SHOULD be left unset in order for the values to be consistent. + // The list of possible values is defined in the [W3C User-Agent Client + // Hints + // specification](https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform). + // Note that some (but not all) of these values can overlap with values in + // the [`os.type` and `os.name` attributes](./os.md). However, for + // consistency, the values in the `browser.platform` attribute should + // capture the exact value that the user agent provides. + BrowserPlatformKey = attribute.Key("browser.platform") +) + +// BrowserBrands returns an attribute KeyValue conforming to the +// "browser.brands" semantic conventions. It represents the array of brand name +// and version separated by a space +func BrowserBrands(val ...string) attribute.KeyValue { + return BrowserBrandsKey.StringSlice(val) +} + +// BrowserLanguage returns an attribute KeyValue conforming to the +// "browser.language" semantic conventions. It represents the preferred +// language of the user using the browser +func BrowserLanguage(val string) attribute.KeyValue { + return BrowserLanguageKey.String(val) +} + +// BrowserMobile returns an attribute KeyValue conforming to the +// "browser.mobile" semantic conventions. It represents a boolean that is true +// if the browser is running on a mobile device +func BrowserMobile(val bool) attribute.KeyValue { + return BrowserMobileKey.Bool(val) +} + +// BrowserPlatform returns an attribute KeyValue conforming to the +// "browser.platform" semantic conventions. It represents the platform on which +// the browser is running +func BrowserPlatform(val string) attribute.KeyValue { + return BrowserPlatformKey.String(val) +} + +// Resources used by AWS Elastic Container Service (ECS). +const ( + // AWSECSClusterARNKey is the attribute Key conforming to the + // "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an + // [ECS + // cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSECSClusterARNKey = attribute.Key("aws.ecs.cluster.arn") + + // AWSECSContainerARNKey is the attribute Key conforming to the + // "aws.ecs.container.arn" semantic conventions. It represents the Amazon + // Resource Name (ARN) of an [ECS container + // instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:container/32624152-9086-4f0e-acae-1a75b14fe4d9' + AWSECSContainerARNKey = attribute.Key("aws.ecs.container.arn") + + // AWSECSLaunchtypeKey is the attribute Key conforming to the + // "aws.ecs.launchtype" semantic conventions. It represents the [launch + // type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) + // for an ECS task. + // + // Type: Enum + // RequirementLevel: Optional + // Stability: experimental + AWSECSLaunchtypeKey = attribute.Key("aws.ecs.launchtype") + + // AWSECSTaskARNKey is the attribute Key conforming to the + // "aws.ecs.task.arn" semantic conventions. It represents the ARN of an + // [ECS task + // definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // 'arn:aws:ecs:us-west-1:123456789123:task/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSECSTaskARNKey = attribute.Key("aws.ecs.task.arn") + + // AWSECSTaskFamilyKey is the attribute Key conforming to the + // "aws.ecs.task.family" semantic conventions. It represents the task + // definition family this task definition is a member of. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'opentelemetry-family' + AWSECSTaskFamilyKey = attribute.Key("aws.ecs.task.family") + + // AWSECSTaskRevisionKey is the attribute Key conforming to the + // "aws.ecs.task.revision" semantic conventions. It represents the revision + // for this task definition. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '8', '26' + AWSECSTaskRevisionKey = attribute.Key("aws.ecs.task.revision") +) + +var ( + // ec2 + AWSECSLaunchtypeEC2 = AWSECSLaunchtypeKey.String("ec2") + // fargate + AWSECSLaunchtypeFargate = AWSECSLaunchtypeKey.String("fargate") +) + +// AWSECSClusterARN returns an attribute KeyValue conforming to the +// "aws.ecs.cluster.arn" semantic conventions. It represents the ARN of an [ECS +// cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). +func AWSECSClusterARN(val string) attribute.KeyValue { + return AWSECSClusterARNKey.String(val) +} + +// AWSECSContainerARN returns an attribute KeyValue conforming to the +// "aws.ecs.container.arn" semantic conventions. It represents the Amazon +// Resource Name (ARN) of an [ECS container +// instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). +func AWSECSContainerARN(val string) attribute.KeyValue { + return AWSECSContainerARNKey.String(val) +} + +// AWSECSTaskARN returns an attribute KeyValue conforming to the +// "aws.ecs.task.arn" semantic conventions. It represents the ARN of an [ECS +// task +// definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). +func AWSECSTaskARN(val string) attribute.KeyValue { + return AWSECSTaskARNKey.String(val) +} + +// AWSECSTaskFamily returns an attribute KeyValue conforming to the +// "aws.ecs.task.family" semantic conventions. It represents the task +// definition family this task definition is a member of. +func AWSECSTaskFamily(val string) attribute.KeyValue { + return AWSECSTaskFamilyKey.String(val) +} + +// AWSECSTaskRevision returns an attribute KeyValue conforming to the +// "aws.ecs.task.revision" semantic conventions. It represents the revision for +// this task definition. +func AWSECSTaskRevision(val string) attribute.KeyValue { + return AWSECSTaskRevisionKey.String(val) +} + +// Resources used by AWS Elastic Kubernetes Service (EKS). +const ( + // AWSEKSClusterARNKey is the attribute Key conforming to the + // "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an + // EKS cluster. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'arn:aws:ecs:us-west-2:123456789123:cluster/my-cluster' + AWSEKSClusterARNKey = attribute.Key("aws.eks.cluster.arn") +) + +// AWSEKSClusterARN returns an attribute KeyValue conforming to the +// "aws.eks.cluster.arn" semantic conventions. It represents the ARN of an EKS +// cluster. +func AWSEKSClusterARN(val string) attribute.KeyValue { + return AWSEKSClusterARNKey.String(val) +} + +// Resources specific to Amazon Web Services. +const ( + // AWSLogGroupARNsKey is the attribute Key conforming to the + // "aws.log.group.arns" semantic conventions. It represents the Amazon + // Resource Name(s) (ARN) of the AWS log group(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:*' + // Note: See the [log group ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + AWSLogGroupARNsKey = attribute.Key("aws.log.group.arns") + + // AWSLogGroupNamesKey is the attribute Key conforming to the + // "aws.log.group.names" semantic conventions. It represents the name(s) of + // the AWS log group(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/aws/lambda/my-function', 'opentelemetry-service' + // Note: Multiple log groups must be supported for cases like + // multi-container applications, where a single application has sidecar + // containers, and each write to their own log group. + AWSLogGroupNamesKey = attribute.Key("aws.log.group.names") + + // AWSLogStreamARNsKey is the attribute Key conforming to the + // "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of + // the AWS log stream(s). + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // 'arn:aws:logs:us-west-1:123456789012:log-group:/aws/my/group:log-stream:logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + // Note: See the [log stream ARN format + // documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). + // One log group can contain several log streams, so these ARNs necessarily + // identify both a log group and a log stream. + AWSLogStreamARNsKey = attribute.Key("aws.log.stream.arns") + + // AWSLogStreamNamesKey is the attribute Key conforming to the + // "aws.log.stream.names" semantic conventions. It represents the name(s) + // of the AWS log stream(s) an application is writing to. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'logs/main/10838bed-421f-43ef-870a-f43feacbbb5b' + AWSLogStreamNamesKey = attribute.Key("aws.log.stream.names") +) + +// AWSLogGroupARNs returns an attribute KeyValue conforming to the +// "aws.log.group.arns" semantic conventions. It represents the Amazon Resource +// Name(s) (ARN) of the AWS log group(s). +func AWSLogGroupARNs(val ...string) attribute.KeyValue { + return AWSLogGroupARNsKey.StringSlice(val) +} + +// AWSLogGroupNames returns an attribute KeyValue conforming to the +// "aws.log.group.names" semantic conventions. It represents the name(s) of the +// AWS log group(s) an application is writing to. +func AWSLogGroupNames(val ...string) attribute.KeyValue { + return AWSLogGroupNamesKey.StringSlice(val) +} + +// AWSLogStreamARNs returns an attribute KeyValue conforming to the +// "aws.log.stream.arns" semantic conventions. It represents the ARN(s) of the +// AWS log stream(s). +func AWSLogStreamARNs(val ...string) attribute.KeyValue { + return AWSLogStreamARNsKey.StringSlice(val) +} + +// AWSLogStreamNames returns an attribute KeyValue conforming to the +// "aws.log.stream.names" semantic conventions. It represents the name(s) of +// the AWS log stream(s) an application is writing to. +func AWSLogStreamNames(val ...string) attribute.KeyValue { + return AWSLogStreamNamesKey.StringSlice(val) +} + +// Resource used by Google Cloud Run. +const ( + // GCPCloudRunJobExecutionKey is the attribute Key conforming to the + // "gcp.cloud_run.job.execution" semantic conventions. It represents the + // name of the Cloud Run + // [execution](https://cloud.google.com/run/docs/managing/job-executions) + // being run for the Job, as set by the + // [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + // environment variable. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'job-name-xxxx', 'sample-job-mdw84' + GCPCloudRunJobExecutionKey = attribute.Key("gcp.cloud_run.job.execution") + + // GCPCloudRunJobTaskIndexKey is the attribute Key conforming to the + // "gcp.cloud_run.job.task_index" semantic conventions. It represents the + // index for a task within an execution as provided by the + // [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) + // environment variable. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 0, 1 + GCPCloudRunJobTaskIndexKey = attribute.Key("gcp.cloud_run.job.task_index") +) + +// GCPCloudRunJobExecution returns an attribute KeyValue conforming to the +// "gcp.cloud_run.job.execution" semantic conventions. It represents the name +// of the Cloud Run +// [execution](https://cloud.google.com/run/docs/managing/job-executions) being +// run for the Job, as set by the +// [`CLOUD_RUN_EXECUTION`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) +// environment variable. +func GCPCloudRunJobExecution(val string) attribute.KeyValue { + return GCPCloudRunJobExecutionKey.String(val) +} + +// GCPCloudRunJobTaskIndex returns an attribute KeyValue conforming to the +// "gcp.cloud_run.job.task_index" semantic conventions. It represents the index +// for a task within an execution as provided by the +// [`CLOUD_RUN_TASK_INDEX`](https://cloud.google.com/run/docs/container-contract#jobs-env-vars) +// environment variable. +func GCPCloudRunJobTaskIndex(val int) attribute.KeyValue { + return GCPCloudRunJobTaskIndexKey.Int(val) +} + +// Resources used by Google Compute Engine (GCE). +const ( + // GCPGceInstanceHostnameKey is the attribute Key conforming to the + // "gcp.gce.instance.hostname" semantic conventions. It represents the + // hostname of a GCE instance. This is the full value of the default or + // [custom + // hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'my-host1234.example.com', + // 'sample-vm.us-west1-b.c.my-project.internal' + GCPGceInstanceHostnameKey = attribute.Key("gcp.gce.instance.hostname") + + // GCPGceInstanceNameKey is the attribute Key conforming to the + // "gcp.gce.instance.name" semantic conventions. It represents the instance + // name of a GCE instance. This is the value provided by `host.name`, the + // visible name of the instance in the Cloud Console UI, and the prefix for + // the default hostname of the instance as defined by the [default internal + // DNS + // name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'instance-1', 'my-vm-name' + GCPGceInstanceNameKey = attribute.Key("gcp.gce.instance.name") +) + +// GCPGceInstanceHostname returns an attribute KeyValue conforming to the +// "gcp.gce.instance.hostname" semantic conventions. It represents the hostname +// of a GCE instance. This is the full value of the default or [custom +// hostname](https://cloud.google.com/compute/docs/instances/custom-hostname-vm). +func GCPGceInstanceHostname(val string) attribute.KeyValue { + return GCPGceInstanceHostnameKey.String(val) +} + +// GCPGceInstanceName returns an attribute KeyValue conforming to the +// "gcp.gce.instance.name" semantic conventions. It represents the instance +// name of a GCE instance. This is the value provided by `host.name`, the +// visible name of the instance in the Cloud Console UI, and the prefix for the +// default hostname of the instance as defined by the [default internal DNS +// name](https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +func GCPGceInstanceName(val string) attribute.KeyValue { + return GCPGceInstanceNameKey.String(val) +} + +// Heroku dyno metadata +const ( + // HerokuAppIDKey is the attribute Key conforming to the "heroku.app.id" + // semantic conventions. It represents the unique identifier for the + // application + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '2daa2797-e42b-4624-9322-ec3f968df4da' + HerokuAppIDKey = attribute.Key("heroku.app.id") + + // HerokuReleaseCommitKey is the attribute Key conforming to the + // "heroku.release.commit" semantic conventions. It represents the commit + // hash for the current release + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'e6134959463efd8966b20e75b913cafe3f5ec' + HerokuReleaseCommitKey = attribute.Key("heroku.release.commit") + + // HerokuReleaseCreationTimestampKey is the attribute Key conforming to the + // "heroku.release.creation_timestamp" semantic conventions. It represents + // the time and date the release was created + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '2022-10-23T18:00:42Z' + HerokuReleaseCreationTimestampKey = attribute.Key("heroku.release.creation_timestamp") +) + +// HerokuAppID returns an attribute KeyValue conforming to the +// "heroku.app.id" semantic conventions. It represents the unique identifier +// for the application +func HerokuAppID(val string) attribute.KeyValue { + return HerokuAppIDKey.String(val) +} + +// HerokuReleaseCommit returns an attribute KeyValue conforming to the +// "heroku.release.commit" semantic conventions. It represents the commit hash +// for the current release +func HerokuReleaseCommit(val string) attribute.KeyValue { + return HerokuReleaseCommitKey.String(val) +} + +// HerokuReleaseCreationTimestamp returns an attribute KeyValue conforming +// to the "heroku.release.creation_timestamp" semantic conventions. It +// represents the time and date the release was created +func HerokuReleaseCreationTimestamp(val string) attribute.KeyValue { + return HerokuReleaseCreationTimestampKey.String(val) } -// ProcessOwner returns an attribute KeyValue conforming to the -// "process.owner" semantic conventions. It represents the username of the user -// that owns the process. -func ProcessOwner(val string) attribute.KeyValue { - return ProcessOwnerKey.String(val) +// The software deployment. +const ( + // DeploymentEnvironmentKey is the attribute Key conforming to the + // "deployment.environment" semantic conventions. It represents the name of + // the [deployment + // environment](https://wikipedia.org/wiki/Deployment_environment) (aka + // deployment tier). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'staging', 'production' + // Note: `deployment.environment` does not affect the uniqueness + // constraints defined through + // the `service.namespace`, `service.name` and `service.instance.id` + // resource attributes. + // This implies that resources carrying the following attribute + // combinations MUST be + // considered to be identifying the same service: + // + // * `service.name=frontend`, `deployment.environment=production` + // * `service.name=frontend`, `deployment.environment=staging`. + DeploymentEnvironmentKey = attribute.Key("deployment.environment") +) + +// DeploymentEnvironment returns an attribute KeyValue conforming to the +// "deployment.environment" semantic conventions. It represents the name of the +// [deployment environment](https://wikipedia.org/wiki/Deployment_environment) +// (aka deployment tier). +func DeploymentEnvironment(val string) attribute.KeyValue { + return DeploymentEnvironmentKey.String(val) } -// The single (language) runtime instance which is monitored. +// A serverless instance. const ( - // ProcessRuntimeNameKey is the attribute Key conforming to the - // "process.runtime.name" semantic conventions. It represents the name of - // the runtime of this process. For compiled native binaries, this SHOULD - // be the name of the compiler. + // FaaSInstanceKey is the attribute Key conforming to the "faas.instance" + // semantic conventions. It represents the execution environment ID as a + // string, that will be potentially reused for other invocations to the + // same function/function version. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'OpenJDK Runtime Environment' - ProcessRuntimeNameKey = attribute.Key("process.runtime.name") + // Stability: experimental + // Examples: '2021/06/28/[$LATEST]2f399eb14537447da05ab2a2e39309de' + // Note: * **AWS Lambda:** Use the (full) log stream name. + FaaSInstanceKey = attribute.Key("faas.instance") - // ProcessRuntimeVersionKey is the attribute Key conforming to the - // "process.runtime.version" semantic conventions. It represents the - // version of the runtime of this process, as returned by the runtime - // without modification. + // FaaSMaxMemoryKey is the attribute Key conforming to the + // "faas.max_memory" semantic conventions. It represents the amount of + // memory available to the serverless function converted to Bytes. // - // Type: string + // Type: int // RequirementLevel: Optional - // Stability: stable - // Examples: '14.0.2' - ProcessRuntimeVersionKey = attribute.Key("process.runtime.version") + // Stability: experimental + // Examples: 134217728 + // Note: It's recommended to set this attribute since e.g. too little + // memory can easily stop a Java AWS Lambda function from working + // correctly. On AWS Lambda, the environment variable + // `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must + // be multiplied by 1,048,576). + FaaSMaxMemoryKey = attribute.Key("faas.max_memory") - // ProcessRuntimeDescriptionKey is the attribute Key conforming to the - // "process.runtime.description" semantic conventions. It represents an - // additional description about the runtime of the process, for example a - // specific vendor customization of the runtime environment. + // FaaSNameKey is the attribute Key conforming to the "faas.name" semantic + // conventions. It represents the name of the single function that this + // runtime instance executes. + // + // Type: string + // RequirementLevel: Required + // Stability: experimental + // Examples: 'my-function', 'myazurefunctionapp/some-function-name' + // Note: This is the name of the function as configured/deployed on the + // FaaS + // platform and is usually different from the name of the callback + // function (which may be stored in the + // [`code.namespace`/`code.function`](/docs/general/attributes.md#source-code-attributes) + // span attributes). + // + // For some cloud providers, the above definition is ambiguous. The + // following + // definition of function name MUST be used for this attribute + // (and consequently the span name) for the listed cloud + // providers/products: + // + // * **Azure:** The full name `/`, i.e., function app name + // followed by a forward slash followed by the function name (this form + // can also be seen in the resource JSON for the function). + // This means that a span attribute MUST be used, as an Azure function + // app can host multiple functions that would usually share + // a TracerProvider (see also the `cloud.resource_id` attribute). + FaaSNameKey = attribute.Key("faas.name") + + // FaaSVersionKey is the attribute Key conforming to the "faas.version" + // semantic conventions. It represents the immutable version of the + // function being executed. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'Eclipse OpenJ9 Eclipse OpenJ9 VM openj9-0.21.0' - ProcessRuntimeDescriptionKey = attribute.Key("process.runtime.description") + // Stability: experimental + // Examples: '26', 'pinkfroid-00002' + // Note: Depending on the cloud provider and platform, use: + // + // * **AWS Lambda:** The [function + // version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + // (an integer represented as a decimal string). + // * **Google Cloud Run (Services):** The + // [revision](https://cloud.google.com/run/docs/managing/revisions) + // (i.e., the function name plus the revision suffix). + // * **Google Cloud Functions:** The value of the + // [`K_REVISION` environment + // variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + // * **Azure Functions:** Not applicable. Do not set this attribute. + FaaSVersionKey = attribute.Key("faas.version") ) -// ProcessRuntimeName returns an attribute KeyValue conforming to the -// "process.runtime.name" semantic conventions. It represents the name of the -// runtime of this process. For compiled native binaries, this SHOULD be the -// name of the compiler. -func ProcessRuntimeName(val string) attribute.KeyValue { - return ProcessRuntimeNameKey.String(val) +// FaaSInstance returns an attribute KeyValue conforming to the +// "faas.instance" semantic conventions. It represents the execution +// environment ID as a string, that will be potentially reused for other +// invocations to the same function/function version. +func FaaSInstance(val string) attribute.KeyValue { + return FaaSInstanceKey.String(val) } -// ProcessRuntimeVersion returns an attribute KeyValue conforming to the -// "process.runtime.version" semantic conventions. It represents the version of -// the runtime of this process, as returned by the runtime without -// modification. -func ProcessRuntimeVersion(val string) attribute.KeyValue { - return ProcessRuntimeVersionKey.String(val) +// FaaSMaxMemory returns an attribute KeyValue conforming to the +// "faas.max_memory" semantic conventions. It represents the amount of memory +// available to the serverless function converted to Bytes. +func FaaSMaxMemory(val int) attribute.KeyValue { + return FaaSMaxMemoryKey.Int(val) } -// ProcessRuntimeDescription returns an attribute KeyValue conforming to the -// "process.runtime.description" semantic conventions. It represents an -// additional description about the runtime of the process, for example a -// specific vendor customization of the runtime environment. -func ProcessRuntimeDescription(val string) attribute.KeyValue { - return ProcessRuntimeDescriptionKey.String(val) +// FaaSName returns an attribute KeyValue conforming to the "faas.name" +// semantic conventions. It represents the name of the single function that +// this runtime instance executes. +func FaaSName(val string) attribute.KeyValue { + return FaaSNameKey.String(val) +} + +// FaaSVersion returns an attribute KeyValue conforming to the +// "faas.version" semantic conventions. It represents the immutable version of +// the function being executed. +func FaaSVersion(val string) attribute.KeyValue { + return FaaSVersionKey.String(val) } // A service instance. @@ -1974,7 +2196,7 @@ const ( // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'shoppingcart' // Note: MUST be the same for all instances of horizontally scaled // services. If the value was not specified, SDKs MUST fallback to @@ -1991,7 +2213,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '2.0.0', 'a01dbef8a' ServiceVersionKey = attribute.Key("service.version") ) @@ -2013,31 +2235,13 @@ func ServiceVersion(val string) attribute.KeyValue { // A service instance. const ( - // ServiceNamespaceKey is the attribute Key conforming to the - // "service.namespace" semantic conventions. It represents a namespace for - // `service.name`. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Shop' - // Note: A string value having a meaning that helps to distinguish a group - // of services, for example the team name that owns a group of services. - // `service.name` is expected to be unique within the same namespace. If - // `service.namespace` is not specified in the Resource then `service.name` - // is expected to be unique for all services that have no explicit - // namespace defined (so the empty/unspecified namespace is simply one more - // valid namespace). Zero-length namespace string is assumed equal to - // unspecified namespace. - ServiceNamespaceKey = attribute.Key("service.namespace") - // ServiceInstanceIDKey is the attribute Key conforming to the // "service.instance.id" semantic conventions. It represents the string ID // of the service instance. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'my-k8s-pod-deployment-1', // '627cc493-f310-47de-96bd-71410b7dec09' // Note: MUST be unique for each instance of the same @@ -2054,14 +2258,25 @@ const ( // RFC 4122 UUID (services aiming for reproducible UUIDs may also use // Version 5, see RFC 4122 for more recommendations). ServiceInstanceIDKey = attribute.Key("service.instance.id") -) -// ServiceNamespace returns an attribute KeyValue conforming to the -// "service.namespace" semantic conventions. It represents a namespace for -// `service.name`. -func ServiceNamespace(val string) attribute.KeyValue { - return ServiceNamespaceKey.String(val) -} + // ServiceNamespaceKey is the attribute Key conforming to the + // "service.namespace" semantic conventions. It represents a namespace for + // `service.name`. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Shop' + // Note: A string value having a meaning that helps to distinguish a group + // of services, for example the team name that owns a group of services. + // `service.name` is expected to be unique within the same namespace. If + // `service.namespace` is not specified in the Resource then `service.name` + // is expected to be unique for all services that have no explicit + // namespace defined (so the empty/unspecified namespace is simply one more + // valid namespace). Zero-length namespace string is assumed equal to + // unspecified namespace. + ServiceNamespaceKey = attribute.Key("service.namespace") +) // ServiceInstanceID returns an attribute KeyValue conforming to the // "service.instance.id" semantic conventions. It represents the string ID of @@ -2070,16 +2285,32 @@ func ServiceInstanceID(val string) attribute.KeyValue { return ServiceInstanceIDKey.String(val) } +// ServiceNamespace returns an attribute KeyValue conforming to the +// "service.namespace" semantic conventions. It represents a namespace for +// `service.name`. +func ServiceNamespace(val string) attribute.KeyValue { + return ServiceNamespaceKey.String(val) +} + // The telemetry SDK used to capture data recorded by the instrumentation // libraries. const ( + // TelemetrySDKLanguageKey is the attribute Key conforming to the + // "telemetry.sdk.language" semantic conventions. It represents the + // language of the telemetry SDK. + // + // Type: Enum + // RequirementLevel: Required + // Stability: experimental + TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") + // TelemetrySDKNameKey is the attribute Key conforming to the // "telemetry.sdk.name" semantic conventions. It represents the name of the // telemetry SDK as defined above. // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'opentelemetry' // Note: The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute // to `opentelemetry`. @@ -2094,22 +2325,13 @@ const ( // implementation. TelemetrySDKNameKey = attribute.Key("telemetry.sdk.name") - // TelemetrySDKLanguageKey is the attribute Key conforming to the - // "telemetry.sdk.language" semantic conventions. It represents the - // language of the telemetry SDK. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - TelemetrySDKLanguageKey = attribute.Key("telemetry.sdk.language") - // TelemetrySDKVersionKey is the attribute Key conforming to the // "telemetry.sdk.version" semantic conventions. It represents the version // string of the telemetry SDK. // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: '1.2.3' TelemetrySDKVersionKey = attribute.Key("telemetry.sdk.version") ) @@ -2158,33 +2380,67 @@ func TelemetrySDKVersion(val string) attribute.KeyValue { // The telemetry SDK used to capture data recorded by the instrumentation // libraries. const ( - // TelemetryAutoVersionKey is the attribute Key conforming to the - // "telemetry.auto.version" semantic conventions. It represents the version - // string of the auto instrumentation agent, if used. + // TelemetryDistroNameKey is the attribute Key conforming to the + // "telemetry.distro.name" semantic conventions. It represents the name of + // the auto instrumentation agent or distribution, if used. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'parts-unlimited-java' + // Note: Official auto instrumentation agents and distributions SHOULD set + // the `telemetry.distro.name` attribute to + // a string starting with `opentelemetry-`, e.g. + // `opentelemetry-java-instrumentation`. + TelemetryDistroNameKey = attribute.Key("telemetry.distro.name") + + // TelemetryDistroVersionKey is the attribute Key conforming to the + // "telemetry.distro.version" semantic conventions. It represents the + // version string of the auto instrumentation agent or distribution, if + // used. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '1.2.3' - TelemetryAutoVersionKey = attribute.Key("telemetry.auto.version") + TelemetryDistroVersionKey = attribute.Key("telemetry.distro.version") ) -// TelemetryAutoVersion returns an attribute KeyValue conforming to the -// "telemetry.auto.version" semantic conventions. It represents the version -// string of the auto instrumentation agent, if used. -func TelemetryAutoVersion(val string) attribute.KeyValue { - return TelemetryAutoVersionKey.String(val) +// TelemetryDistroName returns an attribute KeyValue conforming to the +// "telemetry.distro.name" semantic conventions. It represents the name of the +// auto instrumentation agent or distribution, if used. +func TelemetryDistroName(val string) attribute.KeyValue { + return TelemetryDistroNameKey.String(val) +} + +// TelemetryDistroVersion returns an attribute KeyValue conforming to the +// "telemetry.distro.version" semantic conventions. It represents the version +// string of the auto instrumentation agent or distribution, if used. +func TelemetryDistroVersion(val string) attribute.KeyValue { + return TelemetryDistroVersionKey.String(val) } // Resource describing the packaged software running the application code. Web // engines are typically executed using process.runtime. const ( + // WebEngineDescriptionKey is the attribute Key conforming to the + // "webengine.description" semantic conventions. It represents the + // additional description of the web engine (e.g. detailed version and + // edition information). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - + // 2.2.2.Final' + WebEngineDescriptionKey = attribute.Key("webengine.description") + // WebEngineNameKey is the attribute Key conforming to the "webengine.name" // semantic conventions. It represents the name of the web engine. // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'WildFly' WebEngineNameKey = attribute.Key("webengine.name") @@ -2194,23 +2450,19 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '21.0.0' WebEngineVersionKey = attribute.Key("webengine.version") - - // WebEngineDescriptionKey is the attribute Key conforming to the - // "webengine.description" semantic conventions. It represents the - // additional description of the web engine (e.g. detailed version and - // edition information). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'WildFly Full 21.0.0.Final (WildFly Core 13.0.1.Final) - - // 2.2.2.Final' - WebEngineDescriptionKey = attribute.Key("webengine.description") ) +// WebEngineDescription returns an attribute KeyValue conforming to the +// "webengine.description" semantic conventions. It represents the additional +// description of the web engine (e.g. detailed version and edition +// information). +func WebEngineDescription(val string) attribute.KeyValue { + return WebEngineDescriptionKey.String(val) +} + // WebEngineName returns an attribute KeyValue conforming to the // "webengine.name" semantic conventions. It represents the name of the web // engine. @@ -2225,14 +2477,6 @@ func WebEngineVersion(val string) attribute.KeyValue { return WebEngineVersionKey.String(val) } -// WebEngineDescription returns an attribute KeyValue conforming to the -// "webengine.description" semantic conventions. It represents the additional -// description of the web engine (e.g. detailed version and edition -// information). -func WebEngineDescription(val string) attribute.KeyValue { - return WebEngineDescriptionKey.String(val) -} - // Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's // concepts. const ( @@ -2242,7 +2486,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'io.opentelemetry.contrib.mongodb' OTelScopeNameKey = attribute.Key("otel.scope.name") @@ -2252,7 +2496,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '1.0.0' OTelScopeVersionKey = attribute.Key("otel.scope.version") ) @@ -2275,36 +2519,38 @@ func OTelScopeVersion(val string) attribute.KeyValue { // Scope's concepts. const ( // OTelLibraryNameKey is the attribute Key conforming to the - // "otel.library.name" semantic conventions. It represents the deprecated, - // use the `otel.scope.name` attribute. + // "otel.library.name" semantic conventions. // // Type: string // RequirementLevel: Optional // Stability: deprecated // Examples: 'io.opentelemetry.contrib.mongodb' + // Deprecated: use the `otel.scope.name` attribute. OTelLibraryNameKey = attribute.Key("otel.library.name") // OTelLibraryVersionKey is the attribute Key conforming to the - // "otel.library.version" semantic conventions. It represents the - // deprecated, use the `otel.scope.version` attribute. + // "otel.library.version" semantic conventions. // // Type: string // RequirementLevel: Optional // Stability: deprecated // Examples: '1.0.0' + // Deprecated: use the `otel.scope.version` attribute. OTelLibraryVersionKey = attribute.Key("otel.library.version") ) // OTelLibraryName returns an attribute KeyValue conforming to the -// "otel.library.name" semantic conventions. It represents the deprecated, use -// the `otel.scope.name` attribute. +// "otel.library.name" semantic conventions. +// +// Deprecated: use the `otel.scope.name` attribute. func OTelLibraryName(val string) attribute.KeyValue { return OTelLibraryNameKey.String(val) } // OTelLibraryVersion returns an attribute KeyValue conforming to the -// "otel.library.version" semantic conventions. It represents the deprecated, -// use the `otel.scope.version` attribute. +// "otel.library.version" semantic conventions. +// +// Deprecated: use the `otel.scope.version` attribute. func OTelLibraryVersion(val string) attribute.KeyValue { return OTelLibraryVersionKey.String(val) } diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go similarity index 93% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go index 66ffd5989f..9733ce888a 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/schema.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/schema.go @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" // SchemaURL is the schema URL that matches the version of the semantic conventions // that this package defines. Semconv packages starting from v1.4.0 must declare // non-empty schema URL in the form https://opentelemetry.io/schemas/ -const SchemaURL = "https://opentelemetry.io/schemas/1.21.0" +const SchemaURL = "https://opentelemetry.io/schemas/1.24.0" diff --git a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go similarity index 52% rename from vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go rename to test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go index b5a91450d4..397174818b 100644 --- a/vendor/go.opentelemetry.io/otel/semconv/v1.21.0/trace.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/semconv/v1.24.0/trace.go @@ -14,74 +14,260 @@ // Code generated from semantic convention specification. DO NOT EDIT. -package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0" +package semconv // import "go.opentelemetry.io/otel/semconv/v1.24.0" import "go.opentelemetry.io/otel/attribute" -// The shared attributes used to report a single exception associated with a -// span or log. +// Operations that access some remote service. +const ( + // PeerServiceKey is the attribute Key conforming to the "peer.service" + // semantic conventions. It represents the + // [`service.name`](/docs/resource/README.md#service) of the remote + // service. SHOULD be equal to the actual `service.name` resource attribute + // of the remote service if any. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'AuthTokenCache' + PeerServiceKey = attribute.Key("peer.service") +) + +// PeerService returns an attribute KeyValue conforming to the +// "peer.service" semantic conventions. It represents the +// [`service.name`](/docs/resource/README.md#service) of the remote service. +// SHOULD be equal to the actual `service.name` resource attribute of the +// remote service if any. +func PeerService(val string) attribute.KeyValue { + return PeerServiceKey.String(val) +} + +// These attributes may be used for any operation with an authenticated and/or +// authorized enduser. +const ( + // EnduserIDKey is the attribute Key conforming to the "enduser.id" + // semantic conventions. It represents the username or client_id extracted + // from the access token or + // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header + // in the inbound request from outside the system. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'username' + EnduserIDKey = attribute.Key("enduser.id") + + // EnduserRoleKey is the attribute Key conforming to the "enduser.role" + // semantic conventions. It represents the actual/assumed role the client + // is making the request under extracted from token or application security + // context. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'admin' + EnduserRoleKey = attribute.Key("enduser.role") + + // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" + // semantic conventions. It represents the scopes or granted authorities + // the client currently possesses extracted from token or application + // security context. The value would come from the scope associated with an + // [OAuth 2.0 Access + // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute + // value in a [SAML 2.0 + // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'read:message, write:files' + EnduserScopeKey = attribute.Key("enduser.scope") +) + +// EnduserID returns an attribute KeyValue conforming to the "enduser.id" +// semantic conventions. It represents the username or client_id extracted from +// the access token or +// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in +// the inbound request from outside the system. +func EnduserID(val string) attribute.KeyValue { + return EnduserIDKey.String(val) +} + +// EnduserRole returns an attribute KeyValue conforming to the +// "enduser.role" semantic conventions. It represents the actual/assumed role +// the client is making the request under extracted from token or application +// security context. +func EnduserRole(val string) attribute.KeyValue { + return EnduserRoleKey.String(val) +} + +// EnduserScope returns an attribute KeyValue conforming to the +// "enduser.scope" semantic conventions. It represents the scopes or granted +// authorities the client currently possesses extracted from token or +// application security context. The value would come from the scope associated +// with an [OAuth 2.0 Access +// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute +// value in a [SAML 2.0 +// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). +func EnduserScope(val string) attribute.KeyValue { + return EnduserScopeKey.String(val) +} + +// These attributes allow to report this unit of code and therefore to provide +// more context about the span. const ( - // ExceptionTypeKey is the attribute Key conforming to the "exception.type" - // semantic conventions. It represents the type of the exception (its - // fully-qualified class name, if applicable). The dynamic type of the - // exception should be preferred over the static type in languages that - // support it. + // CodeColumnKey is the attribute Key conforming to the "code.column" + // semantic conventions. It represents the column number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 16 + CodeColumnKey = attribute.Key("code.column") + + // CodeFilepathKey is the attribute Key conforming to the "code.filepath" + // semantic conventions. It represents the source code file name that + // identifies the code unit as uniquely as possible (preferably an absolute + // file path). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '/usr/local/MyApplication/content_root/app/index.php' + CodeFilepathKey = attribute.Key("code.filepath") + + // CodeFunctionKey is the attribute Key conforming to the "code.function" + // semantic conventions. It represents the method or function name, or + // equivalent (usually rightmost part of the code unit's name). // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'java.net.ConnectException', 'OSError' - ExceptionTypeKey = attribute.Key("exception.type") + // Stability: experimental + // Examples: 'serveRequest' + CodeFunctionKey = attribute.Key("code.function") + + // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" + // semantic conventions. It represents the line number in `code.filepath` + // best representing the operation. It SHOULD point within the code unit + // named in `code.function`. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 42 + CodeLineNumberKey = attribute.Key("code.lineno") - // ExceptionMessageKey is the attribute Key conforming to the - // "exception.message" semantic conventions. It represents the exception - // message. + // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" + // semantic conventions. It represents the "namespace" within which + // `code.function` is defined. Usually the qualified class or module name, + // such that `code.namespace` + some separator + `code.function` form a + // unique identifier for the code unit. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'Division by zero', "Can't convert 'int' object to str - // implicitly" - ExceptionMessageKey = attribute.Key("exception.message") - - // ExceptionStacktraceKey is the attribute Key conforming to the - // "exception.stacktrace" semantic conventions. It represents a stacktrace - // as a string in the natural representation for the language runtime. The + // Stability: experimental + // Examples: 'com.example.MyHTTPService' + CodeNamespaceKey = attribute.Key("code.namespace") + + // CodeStacktraceKey is the attribute Key conforming to the + // "code.stacktrace" semantic conventions. It represents a stacktrace as a + // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test - // exception\\n at ' - // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' + // Stability: experimental + // Examples: 'at + // com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at ' // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at ' // 'com.example.GenerateTrace.main(GenerateTrace.java:5)' - ExceptionStacktraceKey = attribute.Key("exception.stacktrace") + CodeStacktraceKey = attribute.Key("code.stacktrace") ) -// ExceptionType returns an attribute KeyValue conforming to the -// "exception.type" semantic conventions. It represents the type of the -// exception (its fully-qualified class name, if applicable). The dynamic type -// of the exception should be preferred over the static type in languages that -// support it. -func ExceptionType(val string) attribute.KeyValue { - return ExceptionTypeKey.String(val) +// CodeColumn returns an attribute KeyValue conforming to the "code.column" +// semantic conventions. It represents the column number in `code.filepath` +// best representing the operation. It SHOULD point within the code unit named +// in `code.function`. +func CodeColumn(val int) attribute.KeyValue { + return CodeColumnKey.Int(val) +} + +// CodeFilepath returns an attribute KeyValue conforming to the +// "code.filepath" semantic conventions. It represents the source code file +// name that identifies the code unit as uniquely as possible (preferably an +// absolute file path). +func CodeFilepath(val string) attribute.KeyValue { + return CodeFilepathKey.String(val) +} + +// CodeFunction returns an attribute KeyValue conforming to the +// "code.function" semantic conventions. It represents the method or function +// name, or equivalent (usually rightmost part of the code unit's name). +func CodeFunction(val string) attribute.KeyValue { + return CodeFunctionKey.String(val) +} + +// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" +// semantic conventions. It represents the line number in `code.filepath` best +// representing the operation. It SHOULD point within the code unit named in +// `code.function`. +func CodeLineNumber(val int) attribute.KeyValue { + return CodeLineNumberKey.Int(val) } -// ExceptionMessage returns an attribute KeyValue conforming to the -// "exception.message" semantic conventions. It represents the exception -// message. -func ExceptionMessage(val string) attribute.KeyValue { - return ExceptionMessageKey.String(val) +// CodeNamespace returns an attribute KeyValue conforming to the +// "code.namespace" semantic conventions. It represents the "namespace" within +// which `code.function` is defined. Usually the qualified class or module +// name, such that `code.namespace` + some separator + `code.function` form a +// unique identifier for the code unit. +func CodeNamespace(val string) attribute.KeyValue { + return CodeNamespaceKey.String(val) } -// ExceptionStacktrace returns an attribute KeyValue conforming to the -// "exception.stacktrace" semantic conventions. It represents a stacktrace as a +// CodeStacktrace returns an attribute KeyValue conforming to the +// "code.stacktrace" semantic conventions. It represents a stacktrace as a // string in the natural representation for the language runtime. The // representation is to be determined and documented by each language SIG. -func ExceptionStacktrace(val string) attribute.KeyValue { - return ExceptionStacktraceKey.String(val) +func CodeStacktrace(val string) attribute.KeyValue { + return CodeStacktraceKey.String(val) +} + +// These attributes may be used for any operation to store information about a +// thread that started a span. +const ( + // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic + // conventions. It represents the current "managed" thread ID (as opposed + // to OS thread ID). + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 42 + ThreadIDKey = attribute.Key("thread.id") + + // ThreadNameKey is the attribute Key conforming to the "thread.name" + // semantic conventions. It represents the current thread name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'main' + ThreadNameKey = attribute.Key("thread.name") +) + +// ThreadID returns an attribute KeyValue conforming to the "thread.id" +// semantic conventions. It represents the current "managed" thread ID (as +// opposed to OS thread ID). +func ThreadID(val int) attribute.KeyValue { + return ThreadIDKey.Int(val) +} + +// ThreadName returns an attribute KeyValue conforming to the "thread.name" +// semantic conventions. It represents the current thread name. +func ThreadName(val string) attribute.KeyValue { + return ThreadNameKey.String(val) } // Span attributes used by AWS Lambda (in addition to general `faas` @@ -95,7 +281,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' // Note: This may be different from `cloud.resource_id` if an alias is // involved. @@ -123,7 +309,7 @@ const ( // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") @@ -134,7 +320,7 @@ const ( // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'https://github.com/cloudevents', // '/cloudevents/spec/pull/123', 'my-service' CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") @@ -147,10 +333,22 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '1.0' CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") + // CloudeventsEventSubjectKey is the attribute Key conforming to the + // "cloudevents.event_subject" semantic conventions. It represents the + // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) + // of the event in the context of the event producer (identified by + // source). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'mynewfile.jpg' + CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") + // CloudeventsEventTypeKey is the attribute Key conforming to the // "cloudevents.event_type" semantic conventions. It represents the // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) @@ -159,22 +357,10 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'com.github.pull_request.opened', // 'com.example.object.deleted.v2' CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") - - // CloudeventsEventSubjectKey is the attribute Key conforming to the - // "cloudevents.event_subject" semantic conventions. It represents the - // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) - // of the event in the context of the event producer (identified by - // source). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'mynewfile.jpg' - CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") ) // CloudeventsEventID returns an attribute KeyValue conforming to the @@ -202,6 +388,14 @@ func CloudeventsEventSpecVersion(val string) attribute.KeyValue { return CloudeventsEventSpecVersionKey.String(val) } +// CloudeventsEventSubject returns an attribute KeyValue conforming to the +// "cloudevents.event_subject" semantic conventions. It represents the +// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) +// of the event in the context of the event producer (identified by source). +func CloudeventsEventSubject(val string) attribute.KeyValue { + return CloudeventsEventSubjectKey.String(val) +} + // CloudeventsEventType returns an attribute KeyValue conforming to the // "cloudevents.event_type" semantic conventions. It represents the // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) @@ -211,14 +405,6 @@ func CloudeventsEventType(val string) attribute.KeyValue { return CloudeventsEventTypeKey.String(val) } -// CloudeventsEventSubject returns an attribute KeyValue conforming to the -// "cloudevents.event_subject" semantic conventions. It represents the -// [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) -// of the event in the context of the event producer (identified by source). -func CloudeventsEventSubject(val string) attribute.KeyValue { - return CloudeventsEventSubjectKey.String(val) -} - // Semantic conventions for the OpenTracing Shim const ( // OpentracingRefTypeKey is the attribute Key conforming to the @@ -227,7 +413,7 @@ const ( // // Type: Enum // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Note: The causal relationship between a child Span and a parent Span. OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") ) @@ -235,688 +421,30 @@ const ( var ( // The parent Span depends on the child Span in some capacity OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") - // The parent Span does not depend in any way on the result of the child Span + // The parent Span doesn't depend in any way on the result of the child Span OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") ) -// The attributes used to perform database client calls. +// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's +// concepts. const ( - // DBSystemKey is the attribute Key conforming to the "db.system" semantic - // conventions. It represents an identifier for the database management - // system (DBMS) product being used. See below for a list of well-known - // identifiers. + // OTelStatusCodeKey is the attribute Key conforming to the + // "otel.status_code" semantic conventions. It represents the name of the + // code, either "OK" or "ERROR". MUST NOT be set if the status code is + // UNSET. // // Type: Enum - // RequirementLevel: Required - // Stability: stable - DBSystemKey = attribute.Key("db.system") + // RequirementLevel: Optional + // Stability: experimental + OTelStatusCodeKey = attribute.Key("otel.status_code") - // DBConnectionStringKey is the attribute Key conforming to the - // "db.connection_string" semantic conventions. It represents the - // connection string used to connect to the database. It is recommended to - // remove embedded credentials. + // OTelStatusDescriptionKey is the attribute Key conforming to the + // "otel.status_description" semantic conventions. It represents the + // description of the Status if it has a value, otherwise not set. // // Type: string // RequirementLevel: Optional - // Stability: stable - // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' - DBConnectionStringKey = attribute.Key("db.connection_string") - - // DBUserKey is the attribute Key conforming to the "db.user" semantic - // conventions. It represents the username for accessing the database. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'readonly_user', 'reporting_user' - DBUserKey = attribute.Key("db.user") - - // DBJDBCDriverClassnameKey is the attribute Key conforming to the - // "db.jdbc.driver_classname" semantic conventions. It represents the - // fully-qualified class name of the [Java Database Connectivity - // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) - // driver used to connect. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'org.postgresql.Driver', - // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' - DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") - - // DBNameKey is the attribute Key conforming to the "db.name" semantic - // conventions. It represents the this attribute is used to report the name - // of the database being accessed. For commands that switch the database, - // this should be set to the target database (even if the command fails). - // - // Type: string - // RequirementLevel: ConditionallyRequired (If applicable.) - // Stability: stable - // Examples: 'customers', 'main' - // Note: In some SQL databases, the database name to be used is called - // "schema name". In case there are multiple layers that could be - // considered for database name (e.g. Oracle instance name and schema - // name), the database name to be used is the more specific layer (e.g. - // Oracle schema name). - DBNameKey = attribute.Key("db.name") - - // DBStatementKey is the attribute Key conforming to the "db.statement" - // semantic conventions. It represents the database statement being - // executed. - // - // Type: string - // RequirementLevel: Recommended (Should be collected by default only if - // there is sanitization that excludes sensitive information.) - // Stability: stable - // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' - DBStatementKey = attribute.Key("db.statement") - - // DBOperationKey is the attribute Key conforming to the "db.operation" - // semantic conventions. It represents the name of the operation being - // executed, e.g. the [MongoDB command - // name](https://docs.mongodb.com/manual/reference/command/#database-operations) - // such as `findAndModify`, or the SQL keyword. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If `db.statement` is not - // applicable.) - // Stability: stable - // Examples: 'findAndModify', 'HMSET', 'SELECT' - // Note: When setting this to an SQL keyword, it is not recommended to - // attempt any client-side parsing of `db.statement` just to get this - // property, but it should be set if the operation name is provided by the - // library being instrumented. If the SQL statement has an ambiguous - // operation, or performs more than one operation, this value may be - // omitted. - DBOperationKey = attribute.Key("db.operation") -) - -var ( - // Some other SQL database. Fallback only. See notes - DBSystemOtherSQL = DBSystemKey.String("other_sql") - // Microsoft SQL Server - DBSystemMSSQL = DBSystemKey.String("mssql") - // Microsoft SQL Server Compact - DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") - // MySQL - DBSystemMySQL = DBSystemKey.String("mysql") - // Oracle Database - DBSystemOracle = DBSystemKey.String("oracle") - // IBM DB2 - DBSystemDB2 = DBSystemKey.String("db2") - // PostgreSQL - DBSystemPostgreSQL = DBSystemKey.String("postgresql") - // Amazon Redshift - DBSystemRedshift = DBSystemKey.String("redshift") - // Apache Hive - DBSystemHive = DBSystemKey.String("hive") - // Cloudscape - DBSystemCloudscape = DBSystemKey.String("cloudscape") - // HyperSQL DataBase - DBSystemHSQLDB = DBSystemKey.String("hsqldb") - // Progress Database - DBSystemProgress = DBSystemKey.String("progress") - // SAP MaxDB - DBSystemMaxDB = DBSystemKey.String("maxdb") - // SAP HANA - DBSystemHanaDB = DBSystemKey.String("hanadb") - // Ingres - DBSystemIngres = DBSystemKey.String("ingres") - // FirstSQL - DBSystemFirstSQL = DBSystemKey.String("firstsql") - // EnterpriseDB - DBSystemEDB = DBSystemKey.String("edb") - // InterSystems Caché - DBSystemCache = DBSystemKey.String("cache") - // Adabas (Adaptable Database System) - DBSystemAdabas = DBSystemKey.String("adabas") - // Firebird - DBSystemFirebird = DBSystemKey.String("firebird") - // Apache Derby - DBSystemDerby = DBSystemKey.String("derby") - // FileMaker - DBSystemFilemaker = DBSystemKey.String("filemaker") - // Informix - DBSystemInformix = DBSystemKey.String("informix") - // InstantDB - DBSystemInstantDB = DBSystemKey.String("instantdb") - // InterBase - DBSystemInterbase = DBSystemKey.String("interbase") - // MariaDB - DBSystemMariaDB = DBSystemKey.String("mariadb") - // Netezza - DBSystemNetezza = DBSystemKey.String("netezza") - // Pervasive PSQL - DBSystemPervasive = DBSystemKey.String("pervasive") - // PointBase - DBSystemPointbase = DBSystemKey.String("pointbase") - // SQLite - DBSystemSqlite = DBSystemKey.String("sqlite") - // Sybase - DBSystemSybase = DBSystemKey.String("sybase") - // Teradata - DBSystemTeradata = DBSystemKey.String("teradata") - // Vertica - DBSystemVertica = DBSystemKey.String("vertica") - // H2 - DBSystemH2 = DBSystemKey.String("h2") - // ColdFusion IMQ - DBSystemColdfusion = DBSystemKey.String("coldfusion") - // Apache Cassandra - DBSystemCassandra = DBSystemKey.String("cassandra") - // Apache HBase - DBSystemHBase = DBSystemKey.String("hbase") - // MongoDB - DBSystemMongoDB = DBSystemKey.String("mongodb") - // Redis - DBSystemRedis = DBSystemKey.String("redis") - // Couchbase - DBSystemCouchbase = DBSystemKey.String("couchbase") - // CouchDB - DBSystemCouchDB = DBSystemKey.String("couchdb") - // Microsoft Azure Cosmos DB - DBSystemCosmosDB = DBSystemKey.String("cosmosdb") - // Amazon DynamoDB - DBSystemDynamoDB = DBSystemKey.String("dynamodb") - // Neo4j - DBSystemNeo4j = DBSystemKey.String("neo4j") - // Apache Geode - DBSystemGeode = DBSystemKey.String("geode") - // Elasticsearch - DBSystemElasticsearch = DBSystemKey.String("elasticsearch") - // Memcached - DBSystemMemcached = DBSystemKey.String("memcached") - // CockroachDB - DBSystemCockroachdb = DBSystemKey.String("cockroachdb") - // OpenSearch - DBSystemOpensearch = DBSystemKey.String("opensearch") - // ClickHouse - DBSystemClickhouse = DBSystemKey.String("clickhouse") - // Cloud Spanner - DBSystemSpanner = DBSystemKey.String("spanner") - // Trino - DBSystemTrino = DBSystemKey.String("trino") -) - -// DBConnectionString returns an attribute KeyValue conforming to the -// "db.connection_string" semantic conventions. It represents the connection -// string used to connect to the database. It is recommended to remove embedded -// credentials. -func DBConnectionString(val string) attribute.KeyValue { - return DBConnectionStringKey.String(val) -} - -// DBUser returns an attribute KeyValue conforming to the "db.user" semantic -// conventions. It represents the username for accessing the database. -func DBUser(val string) attribute.KeyValue { - return DBUserKey.String(val) -} - -// DBJDBCDriverClassname returns an attribute KeyValue conforming to the -// "db.jdbc.driver_classname" semantic conventions. It represents the -// fully-qualified class name of the [Java Database Connectivity -// (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver -// used to connect. -func DBJDBCDriverClassname(val string) attribute.KeyValue { - return DBJDBCDriverClassnameKey.String(val) -} - -// DBName returns an attribute KeyValue conforming to the "db.name" semantic -// conventions. It represents the this attribute is used to report the name of -// the database being accessed. For commands that switch the database, this -// should be set to the target database (even if the command fails). -func DBName(val string) attribute.KeyValue { - return DBNameKey.String(val) -} - -// DBStatement returns an attribute KeyValue conforming to the -// "db.statement" semantic conventions. It represents the database statement -// being executed. -func DBStatement(val string) attribute.KeyValue { - return DBStatementKey.String(val) -} - -// DBOperation returns an attribute KeyValue conforming to the -// "db.operation" semantic conventions. It represents the name of the operation -// being executed, e.g. the [MongoDB command -// name](https://docs.mongodb.com/manual/reference/command/#database-operations) -// such as `findAndModify`, or the SQL keyword. -func DBOperation(val string) attribute.KeyValue { - return DBOperationKey.String(val) -} - -// Connection-level attributes for Microsoft SQL Server -const ( - // DBMSSQLInstanceNameKey is the attribute Key conforming to the - // "db.mssql.instance_name" semantic conventions. It represents the - // Microsoft SQL Server [instance - // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) - // connecting to. This name is used to determine the port of a named - // instance. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'MSSQLSERVER' - // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer - // required (but still recommended if non-standard). - DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") -) - -// DBMSSQLInstanceName returns an attribute KeyValue conforming to the -// "db.mssql.instance_name" semantic conventions. It represents the Microsoft -// SQL Server [instance -// name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) -// connecting to. This name is used to determine the port of a named instance. -func DBMSSQLInstanceName(val string) attribute.KeyValue { - return DBMSSQLInstanceNameKey.String(val) -} - -// Call-level attributes for Cassandra -const ( - // DBCassandraPageSizeKey is the attribute Key conforming to the - // "db.cassandra.page_size" semantic conventions. It represents the fetch - // size used for paging, i.e. how many rows will be returned at once. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 5000 - DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") - - // DBCassandraConsistencyLevelKey is the attribute Key conforming to the - // "db.cassandra.consistency_level" semantic conventions. It represents the - // consistency level of the query. Based on consistency values from - // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") - - // DBCassandraTableKey is the attribute Key conforming to the - // "db.cassandra.table" semantic conventions. It represents the name of the - // primary table that the operation is acting upon, including the keyspace - // name (if applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'mytable' - // Note: This mirrors the db.sql.table attribute but references cassandra - // rather than sql. It is not recommended to attempt any client-side - // parsing of `db.statement` just to get this property, but it should be - // set if it is provided by the library being instrumented. If the - // operation is acting upon an anonymous table, or more than one table, - // this value MUST NOT be set. - DBCassandraTableKey = attribute.Key("db.cassandra.table") - - // DBCassandraIdempotenceKey is the attribute Key conforming to the - // "db.cassandra.idempotence" semantic conventions. It represents the - // whether or not the query is idempotent. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") - - // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming - // to the "db.cassandra.speculative_execution_count" semantic conventions. - // It represents the number of times a query was speculatively executed. - // Not set or `0` if the query was not executed speculatively. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 0, 2 - DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") - - // DBCassandraCoordinatorIDKey is the attribute Key conforming to the - // "db.cassandra.coordinator.id" semantic conventions. It represents the ID - // of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' - DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") - - // DBCassandraCoordinatorDCKey is the attribute Key conforming to the - // "db.cassandra.coordinator.dc" semantic conventions. It represents the - // data center of the coordinating node for a query. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'us-west-2' - DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") -) - -var ( - // all - DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") - // each_quorum - DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") - // quorum - DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") - // local_quorum - DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") - // one - DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") - // two - DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") - // three - DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") - // local_one - DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") - // any - DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") - // serial - DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") - // local_serial - DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") -) - -// DBCassandraPageSize returns an attribute KeyValue conforming to the -// "db.cassandra.page_size" semantic conventions. It represents the fetch size -// used for paging, i.e. how many rows will be returned at once. -func DBCassandraPageSize(val int) attribute.KeyValue { - return DBCassandraPageSizeKey.Int(val) -} - -// DBCassandraTable returns an attribute KeyValue conforming to the -// "db.cassandra.table" semantic conventions. It represents the name of the -// primary table that the operation is acting upon, including the keyspace name -// (if applicable). -func DBCassandraTable(val string) attribute.KeyValue { - return DBCassandraTableKey.String(val) -} - -// DBCassandraIdempotence returns an attribute KeyValue conforming to the -// "db.cassandra.idempotence" semantic conventions. It represents the whether -// or not the query is idempotent. -func DBCassandraIdempotence(val bool) attribute.KeyValue { - return DBCassandraIdempotenceKey.Bool(val) -} - -// DBCassandraSpeculativeExecutionCount returns an attribute KeyValue -// conforming to the "db.cassandra.speculative_execution_count" semantic -// conventions. It represents the number of times a query was speculatively -// executed. Not set or `0` if the query was not executed speculatively. -func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { - return DBCassandraSpeculativeExecutionCountKey.Int(val) -} - -// DBCassandraCoordinatorID returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.id" semantic conventions. It represents the ID of -// the coordinating node for a query. -func DBCassandraCoordinatorID(val string) attribute.KeyValue { - return DBCassandraCoordinatorIDKey.String(val) -} - -// DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the -// "db.cassandra.coordinator.dc" semantic conventions. It represents the data -// center of the coordinating node for a query. -func DBCassandraCoordinatorDC(val string) attribute.KeyValue { - return DBCassandraCoordinatorDCKey.String(val) -} - -// Call-level attributes for Redis -const ( - // DBRedisDBIndexKey is the attribute Key conforming to the - // "db.redis.database_index" semantic conventions. It represents the index - // of the database being accessed as used in the [`SELECT` - // command](https://redis.io/commands/select), provided as an integer. To - // be used instead of the generic `db.name` attribute. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If other than the default - // database (`0`).) - // Stability: stable - // Examples: 0, 1, 15 - DBRedisDBIndexKey = attribute.Key("db.redis.database_index") -) - -// DBRedisDBIndex returns an attribute KeyValue conforming to the -// "db.redis.database_index" semantic conventions. It represents the index of -// the database being accessed as used in the [`SELECT` -// command](https://redis.io/commands/select), provided as an integer. To be -// used instead of the generic `db.name` attribute. -func DBRedisDBIndex(val int) attribute.KeyValue { - return DBRedisDBIndexKey.Int(val) -} - -// Call-level attributes for MongoDB -const ( - // DBMongoDBCollectionKey is the attribute Key conforming to the - // "db.mongodb.collection" semantic conventions. It represents the - // collection being accessed within the database stated in `db.name`. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'customers', 'products' - DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") -) - -// DBMongoDBCollection returns an attribute KeyValue conforming to the -// "db.mongodb.collection" semantic conventions. It represents the collection -// being accessed within the database stated in `db.name`. -func DBMongoDBCollection(val string) attribute.KeyValue { - return DBMongoDBCollectionKey.String(val) -} - -// Call-level attributes for SQL databases -const ( - // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" - // semantic conventions. It represents the name of the primary table that - // the operation is acting upon, including the database name (if - // applicable). - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'public.users', 'customers' - // Note: It is not recommended to attempt any client-side parsing of - // `db.statement` just to get this property, but it should be set if it is - // provided by the library being instrumented. If the operation is acting - // upon an anonymous table, or more than one table, this value MUST NOT be - // set. - DBSQLTableKey = attribute.Key("db.sql.table") -) - -// DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" -// semantic conventions. It represents the name of the primary table that the -// operation is acting upon, including the database name (if applicable). -func DBSQLTable(val string) attribute.KeyValue { - return DBSQLTableKey.String(val) -} - -// Call-level attributes for Cosmos DB. -const ( - // DBCosmosDBClientIDKey is the attribute Key conforming to the - // "db.cosmosdb.client_id" semantic conventions. It represents the unique - // Cosmos client instance id. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' - DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") - - // DBCosmosDBOperationTypeKey is the attribute Key conforming to the - // "db.cosmosdb.operation_type" semantic conventions. It represents the - // cosmosDB Operation Type. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (when performing one of the - // operations in this list) - // Stability: stable - DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") - - // DBCosmosDBConnectionModeKey is the attribute Key conforming to the - // "db.cosmosdb.connection_mode" semantic conventions. It represents the - // cosmos client connection mode. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as - // default)) - // Stability: stable - DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") - - // DBCosmosDBContainerKey is the attribute Key conforming to the - // "db.cosmosdb.container" semantic conventions. It represents the cosmos - // DB container name. - // - // Type: string - // RequirementLevel: ConditionallyRequired (if available) - // Stability: stable - // Examples: 'anystring' - DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") - - // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the - // "db.cosmosdb.request_content_length" semantic conventions. It represents - // the request payload size in bytes - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") - - // DBCosmosDBStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos - // DB status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (if response was received) - // Stability: stable - // Examples: 200, 201 - DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") - - // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the - // "db.cosmosdb.sub_status_code" semantic conventions. It represents the - // cosmos DB sub status code. - // - // Type: int - // RequirementLevel: ConditionallyRequired (when response was received and - // contained sub-code.) - // Stability: stable - // Examples: 1000, 1002 - DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") - - // DBCosmosDBRequestChargeKey is the attribute Key conforming to the - // "db.cosmosdb.request_charge" semantic conventions. It represents the rU - // consumed for that operation - // - // Type: double - // RequirementLevel: ConditionallyRequired (when available) - // Stability: stable - // Examples: 46.18, 1.0 - DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") -) - -var ( - // invalid - DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") - // create - DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") - // patch - DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") - // read - DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") - // read_feed - DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") - // delete - DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") - // replace - DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") - // execute - DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") - // query - DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") - // head - DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") - // head_feed - DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") - // upsert - DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") - // batch - DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") - // query_plan - DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") - // execute_javascript - DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") -) - -var ( - // Gateway (HTTP) connections mode - DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") - // Direct connection - DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") -) - -// DBCosmosDBClientID returns an attribute KeyValue conforming to the -// "db.cosmosdb.client_id" semantic conventions. It represents the unique -// Cosmos client instance id. -func DBCosmosDBClientID(val string) attribute.KeyValue { - return DBCosmosDBClientIDKey.String(val) -} - -// DBCosmosDBContainer returns an attribute KeyValue conforming to the -// "db.cosmosdb.container" semantic conventions. It represents the cosmos DB -// container name. -func DBCosmosDBContainer(val string) attribute.KeyValue { - return DBCosmosDBContainerKey.String(val) -} - -// DBCosmosDBRequestContentLength returns an attribute KeyValue conforming -// to the "db.cosmosdb.request_content_length" semantic conventions. It -// represents the request payload size in bytes -func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { - return DBCosmosDBRequestContentLengthKey.Int(val) -} - -// DBCosmosDBStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB -// status code. -func DBCosmosDBStatusCode(val int) attribute.KeyValue { - return DBCosmosDBStatusCodeKey.Int(val) -} - -// DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the -// "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos -// DB sub status code. -func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { - return DBCosmosDBSubStatusCodeKey.Int(val) -} - -// DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the -// "db.cosmosdb.request_charge" semantic conventions. It represents the rU -// consumed for that operation -func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { - return DBCosmosDBRequestChargeKey.Float64(val) -} - -// Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's -// concepts. -const ( - // OTelStatusCodeKey is the attribute Key conforming to the - // "otel.status_code" semantic conventions. It represents the name of the - // code, either "OK" or "ERROR". MUST NOT be set if the status code is - // UNSET. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - OTelStatusCodeKey = attribute.Key("otel.status_code") - - // OTelStatusDescriptionKey is the attribute Key conforming to the - // "otel.status_description" semantic conventions. It represents the - // description of the Status if it has a value, otherwise not set. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'resource not found' OTelStatusDescriptionKey = attribute.Key("otel.status_description") ) @@ -939,48 +467,17 @@ func OTelStatusDescription(val string) attribute.KeyValue { // without provisioning or managing of servers (also known as serverless // functions or Function as a Service (FaaS)) with spans. const ( - // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" - // semantic conventions. It represents the type of the trigger which caused - // this function invocation. - // - // Type: Enum - // RequirementLevel: Optional - // Stability: stable - // Note: For the server/consumer span on the incoming side, - // `faas.trigger` MUST be set. - // - // Clients invoking FaaS instances usually cannot set `faas.trigger`, - // since they would typically need to look in the payload to determine - // the event type. If clients set it, it should be the same as the - // trigger that corresponding incoming would have (i.e., this has - // nothing to do with the underlying transport used to make the API - // call to invoke the lambda, which is often HTTP). - FaaSTriggerKey = attribute.Key("faas.trigger") - // FaaSInvocationIDKey is the attribute Key conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation // ID of the current function invocation. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' FaaSInvocationIDKey = attribute.Key("faas.invocation_id") ) -var ( - // A response to some data source operation such as a database or filesystem read/write - FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") - // To provide an answer to an inbound HTTP request - FaaSTriggerHTTP = FaaSTriggerKey.String("http") - // A function is set to be executed when messages are sent to a messaging system - FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") - // A function is scheduled to be executed regularly - FaaSTriggerTimer = FaaSTriggerKey.String("timer") - // If none of the others apply - FaaSTriggerOther = FaaSTriggerKey.String("other") -) - // FaaSInvocationID returns an attribute KeyValue conforming to the // "faas.invocation_id" semantic conventions. It represents the invocation ID // of the current function invocation. @@ -999,17 +496,28 @@ const ( // // Type: string // RequirementLevel: Required - // Stability: stable + // Stability: experimental // Examples: 'myBucketName', 'myDBName' FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") + // FaaSDocumentNameKey is the attribute Key conforming to the + // "faas.document.name" semantic conventions. It represents the document + // name/table subjected to the operation. For example, in Cloud Storage or + // S3 is the name of the file, and in Cosmos DB the table name. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'myFile.txt', 'myTableName' + FaaSDocumentNameKey = attribute.Key("faas.document.name") + // FaaSDocumentOperationKey is the attribute Key conforming to the // "faas.document.operation" semantic conventions. It represents the // describes the type of the operation that was performed on the data. // // Type: Enum // RequirementLevel: Required - // Stability: stable + // Stability: experimental FaaSDocumentOperationKey = attribute.Key("faas.document.operation") // FaaSDocumentTimeKey is the attribute Key conforming to the @@ -1020,20 +528,9 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '2020-01-23T13:47:06Z' FaaSDocumentTimeKey = attribute.Key("faas.document.time") - - // FaaSDocumentNameKey is the attribute Key conforming to the - // "faas.document.name" semantic conventions. It represents the document - // name/table subjected to the operation. For example, in Cloud Storage or - // S3 is the name of the file, and in Cosmos DB the table name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'myFile.txt', 'myTableName' - FaaSDocumentNameKey = attribute.Key("faas.document.name") ) var ( @@ -1054,6 +551,14 @@ func FaaSDocumentCollection(val string) attribute.KeyValue { return FaaSDocumentCollectionKey.String(val) } +// FaaSDocumentName returns an attribute KeyValue conforming to the +// "faas.document.name" semantic conventions. It represents the document +// name/table subjected to the operation. For example, in Cloud Storage or S3 +// is the name of the file, and in Cosmos DB the table name. +func FaaSDocumentName(val string) attribute.KeyValue { + return FaaSDocumentNameKey.String(val) +} + // FaaSDocumentTime returns an attribute KeyValue conforming to the // "faas.document.time" semantic conventions. It represents a string containing // the time when the data was accessed in the [ISO @@ -1063,16 +568,19 @@ func FaaSDocumentTime(val string) attribute.KeyValue { return FaaSDocumentTimeKey.String(val) } -// FaaSDocumentName returns an attribute KeyValue conforming to the -// "faas.document.name" semantic conventions. It represents the document -// name/table subjected to the operation. For example, in Cloud Storage or S3 -// is the name of the file, and in Cosmos DB the table name. -func FaaSDocumentName(val string) attribute.KeyValue { - return FaaSDocumentNameKey.String(val) -} - // Semantic Convention for FaaS scheduled to be executed regularly. const ( + // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic + // conventions. It represents a string containing the schedule period as + // [Cron + // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: '0/5 * * * ? *' + FaaSCronKey = attribute.Key("faas.cron") + // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic // conventions. It represents a string containing the function invocation // time in the [ISO @@ -1081,31 +589,11 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '2020-01-23T13:47:06Z' FaaSTimeKey = attribute.Key("faas.time") - - // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic - // conventions. It represents a string containing the schedule period as - // [Cron - // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '0/5 * * * ? *' - FaaSCronKey = attribute.Key("faas.cron") ) -// FaaSTime returns an attribute KeyValue conforming to the "faas.time" -// semantic conventions. It represents a string containing the function -// invocation time in the [ISO -// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format -// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). -func FaaSTime(val string) attribute.KeyValue { - return FaaSTimeKey.String(val) -} - // FaaSCron returns an attribute KeyValue conforming to the "faas.cron" // semantic conventions. It represents a string containing the schedule period // as [Cron @@ -1114,349 +602,32 @@ func FaaSCron(val string) attribute.KeyValue { return FaaSCronKey.String(val) } -// Contains additional attributes for incoming FaaS spans. -const ( - // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" - // semantic conventions. It represents a boolean that is true if the - // serverless function is executed for the first time (aka cold-start). - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - FaaSColdstartKey = attribute.Key("faas.coldstart") -) - -// FaaSColdstart returns an attribute KeyValue conforming to the -// "faas.coldstart" semantic conventions. It represents a boolean that is true -// if the serverless function is executed for the first time (aka cold-start). -func FaaSColdstart(val bool) attribute.KeyValue { - return FaaSColdstartKey.Bool(val) -} - -// Contains additional attributes for outgoing FaaS spans. -const ( - // FaaSInvokedNameKey is the attribute Key conforming to the - // "faas.invoked_name" semantic conventions. It represents the name of the - // invoked function. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'my-function' - // Note: SHOULD be equal to the `faas.name` resource attribute of the - // invoked function. - FaaSInvokedNameKey = attribute.Key("faas.invoked_name") - - // FaaSInvokedProviderKey is the attribute Key conforming to the - // "faas.invoked_provider" semantic conventions. It represents the cloud - // provider of the invoked function. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: SHOULD be equal to the `cloud.provider` resource attribute of the - // invoked function. - FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") - - // FaaSInvokedRegionKey is the attribute Key conforming to the - // "faas.invoked_region" semantic conventions. It represents the cloud - // region of the invoked function. - // - // Type: string - // RequirementLevel: ConditionallyRequired (For some cloud providers, like - // AWS or GCP, the region in which a function is hosted is essential to - // uniquely identify the function and also part of its endpoint. Since it's - // part of the endpoint being called, the region is always known to - // clients. In these cases, `faas.invoked_region` MUST be set accordingly. - // If the region is unknown to the client or not required for identifying - // the invoked function, setting `faas.invoked_region` is optional.) - // Stability: stable - // Examples: 'eu-central-1' - // Note: SHOULD be equal to the `cloud.region` resource attribute of the - // invoked function. - FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") -) - -var ( - // Alibaba Cloud - FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") - // Amazon Web Services - FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") - // Microsoft Azure - FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") - // Google Cloud Platform - FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") - // Tencent Cloud - FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") -) - -// FaaSInvokedName returns an attribute KeyValue conforming to the -// "faas.invoked_name" semantic conventions. It represents the name of the -// invoked function. -func FaaSInvokedName(val string) attribute.KeyValue { - return FaaSInvokedNameKey.String(val) -} - -// FaaSInvokedRegion returns an attribute KeyValue conforming to the -// "faas.invoked_region" semantic conventions. It represents the cloud region -// of the invoked function. -func FaaSInvokedRegion(val string) attribute.KeyValue { - return FaaSInvokedRegionKey.String(val) -} - -// Operations that access some remote service. -const ( - // PeerServiceKey is the attribute Key conforming to the "peer.service" - // semantic conventions. It represents the - // [`service.name`](/docs/resource/README.md#service) of the remote - // service. SHOULD be equal to the actual `service.name` resource attribute - // of the remote service if any. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'AuthTokenCache' - PeerServiceKey = attribute.Key("peer.service") -) - -// PeerService returns an attribute KeyValue conforming to the -// "peer.service" semantic conventions. It represents the -// [`service.name`](/docs/resource/README.md#service) of the remote service. -// SHOULD be equal to the actual `service.name` resource attribute of the -// remote service if any. -func PeerService(val string) attribute.KeyValue { - return PeerServiceKey.String(val) -} - -// These attributes may be used for any operation with an authenticated and/or -// authorized enduser. -const ( - // EnduserIDKey is the attribute Key conforming to the "enduser.id" - // semantic conventions. It represents the username or client_id extracted - // from the access token or - // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header - // in the inbound request from outside the system. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'username' - EnduserIDKey = attribute.Key("enduser.id") - - // EnduserRoleKey is the attribute Key conforming to the "enduser.role" - // semantic conventions. It represents the actual/assumed role the client - // is making the request under extracted from token or application security - // context. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'admin' - EnduserRoleKey = attribute.Key("enduser.role") - - // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" - // semantic conventions. It represents the scopes or granted authorities - // the client currently possesses extracted from token or application - // security context. The value would come from the scope associated with an - // [OAuth 2.0 Access - // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute - // value in a [SAML 2.0 - // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'read:message, write:files' - EnduserScopeKey = attribute.Key("enduser.scope") -) - -// EnduserID returns an attribute KeyValue conforming to the "enduser.id" -// semantic conventions. It represents the username or client_id extracted from -// the access token or -// [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in -// the inbound request from outside the system. -func EnduserID(val string) attribute.KeyValue { - return EnduserIDKey.String(val) -} - -// EnduserRole returns an attribute KeyValue conforming to the -// "enduser.role" semantic conventions. It represents the actual/assumed role -// the client is making the request under extracted from token or application -// security context. -func EnduserRole(val string) attribute.KeyValue { - return EnduserRoleKey.String(val) -} - -// EnduserScope returns an attribute KeyValue conforming to the -// "enduser.scope" semantic conventions. It represents the scopes or granted -// authorities the client currently possesses extracted from token or -// application security context. The value would come from the scope associated -// with an [OAuth 2.0 Access -// Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute -// value in a [SAML 2.0 -// Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). -func EnduserScope(val string) attribute.KeyValue { - return EnduserScopeKey.String(val) -} - -// These attributes may be used for any operation to store information about a -// thread that started a span. -const ( - // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic - // conventions. It represents the current "managed" thread ID (as opposed - // to OS thread ID). - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - ThreadIDKey = attribute.Key("thread.id") - - // ThreadNameKey is the attribute Key conforming to the "thread.name" - // semantic conventions. It represents the current thread name. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'main' - ThreadNameKey = attribute.Key("thread.name") -) - -// ThreadID returns an attribute KeyValue conforming to the "thread.id" -// semantic conventions. It represents the current "managed" thread ID (as -// opposed to OS thread ID). -func ThreadID(val int) attribute.KeyValue { - return ThreadIDKey.Int(val) -} - -// ThreadName returns an attribute KeyValue conforming to the "thread.name" -// semantic conventions. It represents the current thread name. -func ThreadName(val string) attribute.KeyValue { - return ThreadNameKey.String(val) -} - -// These attributes allow to report this unit of code and therefore to provide -// more context about the span. -const ( - // CodeFunctionKey is the attribute Key conforming to the "code.function" - // semantic conventions. It represents the method or function name, or - // equivalent (usually rightmost part of the code unit's name). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'serveRequest' - CodeFunctionKey = attribute.Key("code.function") - - // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" - // semantic conventions. It represents the "namespace" within which - // `code.function` is defined. Usually the qualified class or module name, - // such that `code.namespace` + some separator + `code.function` form a - // unique identifier for the code unit. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'com.example.MyHTTPService' - CodeNamespaceKey = attribute.Key("code.namespace") - - // CodeFilepathKey is the attribute Key conforming to the "code.filepath" - // semantic conventions. It represents the source code file name that - // identifies the code unit as uniquely as possible (preferably an absolute - // file path). - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '/usr/local/MyApplication/content_root/app/index.php' - CodeFilepathKey = attribute.Key("code.filepath") - - // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" - // semantic conventions. It represents the line number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 42 - CodeLineNumberKey = attribute.Key("code.lineno") - - // CodeColumnKey is the attribute Key conforming to the "code.column" - // semantic conventions. It represents the column number in `code.filepath` - // best representing the operation. It SHOULD point within the code unit - // named in `code.function`. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 16 - CodeColumnKey = attribute.Key("code.column") -) - -// CodeFunction returns an attribute KeyValue conforming to the -// "code.function" semantic conventions. It represents the method or function -// name, or equivalent (usually rightmost part of the code unit's name). -func CodeFunction(val string) attribute.KeyValue { - return CodeFunctionKey.String(val) -} - -// CodeNamespace returns an attribute KeyValue conforming to the -// "code.namespace" semantic conventions. It represents the "namespace" within -// which `code.function` is defined. Usually the qualified class or module -// name, such that `code.namespace` + some separator + `code.function` form a -// unique identifier for the code unit. -func CodeNamespace(val string) attribute.KeyValue { - return CodeNamespaceKey.String(val) -} - -// CodeFilepath returns an attribute KeyValue conforming to the -// "code.filepath" semantic conventions. It represents the source code file -// name that identifies the code unit as uniquely as possible (preferably an -// absolute file path). -func CodeFilepath(val string) attribute.KeyValue { - return CodeFilepathKey.String(val) -} - -// CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" -// semantic conventions. It represents the line number in `code.filepath` best -// representing the operation. It SHOULD point within the code unit named in -// `code.function`. -func CodeLineNumber(val int) attribute.KeyValue { - return CodeLineNumberKey.Int(val) -} - -// CodeColumn returns an attribute KeyValue conforming to the "code.column" -// semantic conventions. It represents the column number in `code.filepath` -// best representing the operation. It SHOULD point within the code unit named -// in `code.function`. -func CodeColumn(val int) attribute.KeyValue { - return CodeColumnKey.Int(val) +// FaaSTime returns an attribute KeyValue conforming to the "faas.time" +// semantic conventions. It represents a string containing the function +// invocation time in the [ISO +// 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format +// expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). +func FaaSTime(val string) attribute.KeyValue { + return FaaSTimeKey.String(val) } -// Semantic Convention for HTTP Client +// Contains additional attributes for incoming FaaS spans. const ( - // HTTPResendCountKey is the attribute Key conforming to the - // "http.resend_count" semantic conventions. It represents the ordinal - // number of request resending attempt (for any reason, including - // redirects). + // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" + // semantic conventions. It represents a boolean that is true if the + // serverless function is executed for the first time (aka cold-start). // - // Type: int - // RequirementLevel: Recommended (if and only if request was retried.) - // Stability: stable - // Examples: 3 - // Note: The resend count SHOULD be updated each time an HTTP request gets - // resent by the client, regardless of what was the cause of the resending - // (e.g. redirection, authorization failure, 503 Server Unavailable, - // network issues, or any other). - HTTPResendCountKey = attribute.Key("http.resend_count") + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + FaaSColdstartKey = attribute.Key("faas.coldstart") ) -// HTTPResendCount returns an attribute KeyValue conforming to the -// "http.resend_count" semantic conventions. It represents the ordinal number -// of request resending attempt (for any reason, including redirects). -func HTTPResendCount(val int) attribute.KeyValue { - return HTTPResendCountKey.Int(val) +// FaaSColdstart returns an attribute KeyValue conforming to the +// "faas.coldstart" semantic conventions. It represents a boolean that is true +// if the serverless function is executed for the first time (aka cold-start). +func FaaSColdstart(val bool) attribute.KeyValue { + return FaaSColdstartKey.Bool(val) } // The `aws` conventions apply to operations using the AWS SDK. They map @@ -1473,7 +644,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ' AWSRequestIDKey = attribute.Key("aws.request_id") ) @@ -1487,15 +658,24 @@ func AWSRequestID(val string) attribute.KeyValue { // Attributes that exist for multiple DynamoDB request types. const ( - // AWSDynamoDBTableNamesKey is the attribute Key conforming to the - // "aws.dynamodb.table_names" semantic conventions. It represents the keys - // in the `RequestItems` object field. + // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the + // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the + // value of the `AttributesToGet` request parameter. // // Type: string[] // RequirementLevel: Optional - // Stability: stable - // Examples: 'Users', 'Cats' - AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") + // Stability: experimental + // Examples: 'lives', 'id' + AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") + + // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the + // "aws.dynamodb.consistent_read" semantic conventions. It represents the + // value of the `ConsistentRead` request parameter. + // + // Type: boolean + // RequirementLevel: Optional + // Stability: experimental + AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the @@ -1504,7 +684,7 @@ const ( // // Type: string[] // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : @@ -1515,6 +695,16 @@ const ( // "WriteCapacityUnits": number }' AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") + // AWSDynamoDBIndexNameKey is the attribute Key conforming to the + // "aws.dynamodb.index_name" semantic conventions. It represents the value + // of the `IndexName` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'name_to_group' + AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") + // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to // the "aws.dynamodb.item_collection_metrics" semantic conventions. It // represents the JSON-serialized value of the `ItemCollectionMetrics` @@ -1522,7 +712,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], @@ -1530,6 +720,27 @@ const ( // "SizeEstimateRangeGB": [ number ] } ] }' AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") + // AWSDynamoDBLimitKey is the attribute Key conforming to the + // "aws.dynamodb.limit" semantic conventions. It represents the value of + // the `Limit` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 10 + AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") + + // AWSDynamoDBProjectionKey is the attribute Key conforming to the + // "aws.dynamodb.projection" semantic conventions. It represents the value + // of the `ProjectionExpression` request parameter. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Title', 'Title, Price, Color', 'Title, Description, + // RelatedItems, ProductReviews' + AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") + // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` @@ -1537,7 +748,7 @@ const ( // // Type: double // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 1.0, 2.0 AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") @@ -1548,76 +759,43 @@ const ( // // Type: double // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 1.0, 2.0 AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") - // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the - // "aws.dynamodb.consistent_read" semantic conventions. It represents the - // value of the `ConsistentRead` request parameter. - // - // Type: boolean - // RequirementLevel: Optional - // Stability: stable - AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") - - // AWSDynamoDBProjectionKey is the attribute Key conforming to the - // "aws.dynamodb.projection" semantic conventions. It represents the value - // of the `ProjectionExpression` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Title', 'Title, Price, Color', 'Title, Description, - // RelatedItems, ProductReviews' - AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") - - // AWSDynamoDBLimitKey is the attribute Key conforming to the - // "aws.dynamodb.limit" semantic conventions. It represents the value of - // the `Limit` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") - - // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the - // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the - // value of the `AttributesToGet` request parameter. - // - // Type: string[] - // RequirementLevel: Optional - // Stability: stable - // Examples: 'lives', 'id' - AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") - - // AWSDynamoDBIndexNameKey is the attribute Key conforming to the - // "aws.dynamodb.index_name" semantic conventions. It represents the value - // of the `IndexName` request parameter. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'name_to_group' - AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") - // AWSDynamoDBSelectKey is the attribute Key conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of // the `Select` request parameter. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'ALL_ATTRIBUTES', 'COUNT' AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") + + // AWSDynamoDBTableNamesKey is the attribute Key conforming to the + // "aws.dynamodb.table_names" semantic conventions. It represents the keys + // in the `RequestItems` object field. + // + // Type: string[] + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'Users', 'Cats' + AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") ) -// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the -// "aws.dynamodb.table_names" semantic conventions. It represents the keys in -// the `RequestItems` object field. -func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { - return AWSDynamoDBTableNamesKey.StringSlice(val) +// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to +// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the +// value of the `AttributesToGet` request parameter. +func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { + return AWSDynamoDBAttributesToGetKey.StringSlice(val) +} + +// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the +// "aws.dynamodb.consistent_read" semantic conventions. It represents the value +// of the `ConsistentRead` request parameter. +func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { + return AWSDynamoDBConsistentReadKey.Bool(val) } // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to @@ -1627,6 +805,13 @@ func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { return AWSDynamoDBConsumedCapacityKey.StringSlice(val) } +// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the +// "aws.dynamodb.index_name" semantic conventions. It represents the value of +// the `IndexName` request parameter. +func AWSDynamoDBIndexName(val string) attribute.KeyValue { + return AWSDynamoDBIndexNameKey.String(val) +} + // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming // to the "aws.dynamodb.item_collection_metrics" semantic conventions. It // represents the JSON-serialized value of the `ItemCollectionMetrics` response @@ -1635,6 +820,20 @@ func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { return AWSDynamoDBItemCollectionMetricsKey.String(val) } +// AWSDynamoDBLimit returns an attribute KeyValue conforming to the +// "aws.dynamodb.limit" semantic conventions. It represents the value of the +// `Limit` request parameter. +func AWSDynamoDBLimit(val int) attribute.KeyValue { + return AWSDynamoDBLimitKey.Int(val) +} + +// AWSDynamoDBProjection returns an attribute KeyValue conforming to the +// "aws.dynamodb.projection" semantic conventions. It represents the value of +// the `ProjectionExpression` request parameter. +func AWSDynamoDBProjection(val string) attribute.KeyValue { + return AWSDynamoDBProjectionKey.String(val) +} + // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue // conforming to the "aws.dynamodb.provisioned_read_capacity" semantic // conventions. It represents the value of the @@ -1651,41 +850,6 @@ func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) } -// AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the -// "aws.dynamodb.consistent_read" semantic conventions. It represents the value -// of the `ConsistentRead` request parameter. -func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { - return AWSDynamoDBConsistentReadKey.Bool(val) -} - -// AWSDynamoDBProjection returns an attribute KeyValue conforming to the -// "aws.dynamodb.projection" semantic conventions. It represents the value of -// the `ProjectionExpression` request parameter. -func AWSDynamoDBProjection(val string) attribute.KeyValue { - return AWSDynamoDBProjectionKey.String(val) -} - -// AWSDynamoDBLimit returns an attribute KeyValue conforming to the -// "aws.dynamodb.limit" semantic conventions. It represents the value of the -// `Limit` request parameter. -func AWSDynamoDBLimit(val int) attribute.KeyValue { - return AWSDynamoDBLimitKey.Int(val) -} - -// AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to -// the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the -// value of the `AttributesToGet` request parameter. -func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { - return AWSDynamoDBAttributesToGetKey.StringSlice(val) -} - -// AWSDynamoDBIndexName returns an attribute KeyValue conforming to the -// "aws.dynamodb.index_name" semantic conventions. It represents the value of -// the `IndexName` request parameter. -func AWSDynamoDBIndexName(val string) attribute.KeyValue { - return AWSDynamoDBIndexNameKey.String(val) -} - // AWSDynamoDBSelect returns an attribute KeyValue conforming to the // "aws.dynamodb.select" semantic conventions. It represents the value of the // `Select` request parameter. @@ -1693,6 +857,13 @@ func AWSDynamoDBSelect(val string) attribute.KeyValue { return AWSDynamoDBSelectKey.String(val) } +// AWSDynamoDBTableNames returns an attribute KeyValue conforming to the +// "aws.dynamodb.table_names" semantic conventions. It represents the keys in +// the `RequestItems` object field. +func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { + return AWSDynamoDBTableNamesKey.StringSlice(val) +} + // DynamoDB.CreateTable const ( // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to @@ -1702,7 +873,7 @@ const ( // // Type: string[] // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { @@ -1716,7 +887,7 @@ const ( // // Type: string[] // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "IndexARN": "string", "IndexName": "string", // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { // "AttributeName": "string", "KeyType": "string" } ], "Projection": { @@ -1748,7 +919,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'Users', 'CatsTable' AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") @@ -1758,7 +929,7 @@ const ( // // Type: int // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 20 AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") ) @@ -1785,7 +956,7 @@ const ( // // Type: boolean // RequirementLevel: Optional - // Stability: stable + // Stability: experimental AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") ) @@ -1798,33 +969,13 @@ func AWSDynamoDBScanForward(val bool) attribute.KeyValue { // DynamoDB.Scan const ( - // AWSDynamoDBSegmentKey is the attribute Key conforming to the - // "aws.dynamodb.segment" semantic conventions. It represents the value of - // the `Segment` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 10 - AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") - - // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the - // "aws.dynamodb.total_segments" semantic conventions. It represents the - // value of the `TotalSegments` request parameter. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 100 - AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") - // AWSDynamoDBCountKey is the attribute Key conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of // the `Count` response parameter. // // Type: int // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 10 AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") @@ -1834,24 +985,30 @@ const ( // // Type: int // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 50 AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") -) -// AWSDynamoDBSegment returns an attribute KeyValue conforming to the -// "aws.dynamodb.segment" semantic conventions. It represents the value of the -// `Segment` request parameter. -func AWSDynamoDBSegment(val int) attribute.KeyValue { - return AWSDynamoDBSegmentKey.Int(val) -} + // AWSDynamoDBSegmentKey is the attribute Key conforming to the + // "aws.dynamodb.segment" semantic conventions. It represents the value of + // the `Segment` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 10 + AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") -// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the -// "aws.dynamodb.total_segments" semantic conventions. It represents the value -// of the `TotalSegments` request parameter. -func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { - return AWSDynamoDBTotalSegmentsKey.Int(val) -} + // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the + // "aws.dynamodb.total_segments" semantic conventions. It represents the + // value of the `TotalSegments` request parameter. + // + // Type: int + // RequirementLevel: Optional + // Stability: experimental + // Examples: 100 + AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") +) // AWSDynamoDBCount returns an attribute KeyValue conforming to the // "aws.dynamodb.count" semantic conventions. It represents the value of the @@ -1860,11 +1017,25 @@ func AWSDynamoDBCount(val int) attribute.KeyValue { return AWSDynamoDBCountKey.Int(val) } -// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the -// "aws.dynamodb.scanned_count" semantic conventions. It represents the value -// of the `ScannedCount` response parameter. -func AWSDynamoDBScannedCount(val int) attribute.KeyValue { - return AWSDynamoDBScannedCountKey.Int(val) +// AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the +// "aws.dynamodb.scanned_count" semantic conventions. It represents the value +// of the `ScannedCount` response parameter. +func AWSDynamoDBScannedCount(val int) attribute.KeyValue { + return AWSDynamoDBScannedCountKey.Int(val) +} + +// AWSDynamoDBSegment returns an attribute KeyValue conforming to the +// "aws.dynamodb.segment" semantic conventions. It represents the value of the +// `Segment` request parameter. +func AWSDynamoDBSegment(val int) attribute.KeyValue { + return AWSDynamoDBSegmentKey.Int(val) +} + +// AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the +// "aws.dynamodb.total_segments" semantic conventions. It represents the value +// of the `TotalSegments` request parameter. +func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { + return AWSDynamoDBTotalSegmentsKey.Int(val) } // DynamoDB.UpdateTable @@ -1876,7 +1047,7 @@ const ( // // Type: string[] // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") @@ -1887,7 +1058,7 @@ const ( // // Type: string[] // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { // "AttributeName": "string", "KeyType": "string" } ], "Projection": { // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, @@ -1922,7 +1093,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'some-bucket-name' // Note: The `bucket` attribute is applicable to all S3 operations that // reference a bucket, i.e. that require the bucket name as a mandatory @@ -1930,6 +1101,43 @@ const ( // This applies to almost all S3 operations except `list-buckets`. AWSS3BucketKey = attribute.Key("aws.s3.bucket") + // AWSS3CopySourceKey is the attribute Key conforming to the + // "aws.s3.copy_source" semantic conventions. It represents the source + // object (in the form `bucket`/`key`) for the copy operation. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'someFile.yml' + // Note: The `copy_source` attribute applies to S3 copy operations and + // corresponds to the `--copy-source` parameter + // of the [copy-object operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). + // This applies in particular to the following operations: + // + // - + // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) + // - + // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) + AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") + + // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" + // semantic conventions. It represents the delete request container that + // specifies the objects to be deleted. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: + // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' + // Note: The `delete` attribute is only applicable to the + // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) + // operation. + // The `delete` attribute corresponds to the `--delete` parameter of the + // [delete-objects operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). + AWSS3DeleteKey = attribute.Key("aws.s3.delete") + // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic // conventions. It represents the S3 object key the request refers to. // Corresponds to the `--key` parameter of the [S3 @@ -1938,7 +1146,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'someFile.yml' // Note: The `key` attribute is applicable to all object-related S3 // operations, i.e. that require the object key as a mandatory parameter. @@ -1972,25 +1180,25 @@ const ( // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) AWSS3KeyKey = attribute.Key("aws.s3.key") - // AWSS3CopySourceKey is the attribute Key conforming to the - // "aws.s3.copy_source" semantic conventions. It represents the source - // object (in the form `bucket`/`key`) for the copy operation. + // AWSS3PartNumberKey is the attribute Key conforming to the + // "aws.s3.part_number" semantic conventions. It represents the part number + // of the part being uploaded in a multipart-upload operation. This is a + // positive integer between 1 and 10,000. // - // Type: string + // Type: int // RequirementLevel: Optional - // Stability: stable - // Examples: 'someFile.yml' - // Note: The `copy_source` attribute applies to S3 copy operations and - // corresponds to the `--copy-source` parameter - // of the [copy-object operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). - // This applies in particular to the following operations: - // - // - - // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) - // - + // Stability: experimental + // Examples: 3456 + // Note: The `part_number` attribute is only applicable to the + // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) + // and // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") + // operations. + // The `part_number` attribute corresponds to the `--part-number` parameter + // of the + // [upload-part operation within the S3 + // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). + AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") // AWSS3UploadIDKey is the attribute Key conforming to the // "aws.s3.upload_id" semantic conventions. It represents the upload ID @@ -1998,7 +1206,7 @@ const ( // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' // Note: The `upload_id` attribute applies to S3 multipart-upload // operations and corresponds to the `--upload-id` parameter @@ -2018,43 +1226,6 @@ const ( // - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") - - // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" - // semantic conventions. It represents the delete request container that - // specifies the objects to be deleted. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: - // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' - // Note: The `delete` attribute is only applicable to the - // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) - // operation. - // The `delete` attribute corresponds to the `--delete` parameter of the - // [delete-objects operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). - AWSS3DeleteKey = attribute.Key("aws.s3.delete") - - // AWSS3PartNumberKey is the attribute Key conforming to the - // "aws.s3.part_number" semantic conventions. It represents the part number - // of the part being uploaded in a multipart-upload operation. This is a - // positive integer between 1 and 10,000. - // - // Type: int - // RequirementLevel: Optional - // Stability: stable - // Examples: 3456 - // Note: The `part_number` attribute is only applicable to the - // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) - // and - // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) - // operations. - // The `part_number` attribute corresponds to the `--part-number` parameter - // of the - // [upload-part operation within the S3 - // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). - AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") ) // AWSS3Bucket returns an attribute KeyValue conforming to the @@ -2066,15 +1237,6 @@ func AWSS3Bucket(val string) attribute.KeyValue { return AWSS3BucketKey.String(val) } -// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" -// semantic conventions. It represents the S3 object key the request refers to. -// Corresponds to the `--key` parameter of the [S3 -// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) -// operations. -func AWSS3Key(val string) attribute.KeyValue { - return AWSS3KeyKey.String(val) -} - // AWSS3CopySource returns an attribute KeyValue conforming to the // "aws.s3.copy_source" semantic conventions. It represents the source object // (in the form `bucket`/`key`) for the copy operation. @@ -2082,13 +1244,6 @@ func AWSS3CopySource(val string) attribute.KeyValue { return AWSS3CopySourceKey.String(val) } -// AWSS3UploadID returns an attribute KeyValue conforming to the -// "aws.s3.upload_id" semantic conventions. It represents the upload ID that -// identifies the multipart upload. -func AWSS3UploadID(val string) attribute.KeyValue { - return AWSS3UploadIDKey.String(val) -} - // AWSS3Delete returns an attribute KeyValue conforming to the // "aws.s3.delete" semantic conventions. It represents the delete request // container that specifies the objects to be deleted. @@ -2096,6 +1251,15 @@ func AWSS3Delete(val string) attribute.KeyValue { return AWSS3DeleteKey.String(val) } +// AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" +// semantic conventions. It represents the S3 object key the request refers to. +// Corresponds to the `--key` parameter of the [S3 +// API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) +// operations. +func AWSS3Key(val string) attribute.KeyValue { + return AWSS3KeyKey.String(val) +} + // AWSS3PartNumber returns an attribute KeyValue conforming to the // "aws.s3.part_number" semantic conventions. It represents the part number of // the part being uploaded in a multipart-upload operation. This is a positive @@ -2104,16 +1268,34 @@ func AWSS3PartNumber(val int) attribute.KeyValue { return AWSS3PartNumberKey.Int(val) } +// AWSS3UploadID returns an attribute KeyValue conforming to the +// "aws.s3.upload_id" semantic conventions. It represents the upload ID that +// identifies the multipart upload. +func AWSS3UploadID(val string) attribute.KeyValue { + return AWSS3UploadIDKey.String(val) +} + // Semantic conventions to apply when instrumenting the GraphQL implementation. // They map GraphQL operations to attributes on a Span. const ( + // GraphqlDocumentKey is the attribute Key conforming to the + // "graphql.document" semantic conventions. It represents the GraphQL + // document being executed. + // + // Type: string + // RequirementLevel: Optional + // Stability: experimental + // Examples: 'query findBookByID { bookByID(id: ?) { name } }' + // Note: The value may be sanitized to exclude sensitive information. + GraphqlDocumentKey = attribute.Key("graphql.document") + // GraphqlOperationNameKey is the attribute Key conforming to the // "graphql.operation.name" semantic conventions. It represents the name of // the operation being executed. // // Type: string // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'findBookByID' GraphqlOperationNameKey = attribute.Key("graphql.operation.name") @@ -2123,20 +1305,9 @@ const ( // // Type: Enum // RequirementLevel: Optional - // Stability: stable + // Stability: experimental // Examples: 'query', 'mutation', 'subscription' GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") - - // GraphqlDocumentKey is the attribute Key conforming to the - // "graphql.document" semantic conventions. It represents the GraphQL - // document being executed. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'query findBookByID { bookByID(id: ?) { name } }' - // Note: The value may be sanitized to exclude sensitive information. - GraphqlDocumentKey = attribute.Key("graphql.document") ) var ( @@ -2148,13 +1319,6 @@ var ( GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") ) -// GraphqlOperationName returns an attribute KeyValue conforming to the -// "graphql.operation.name" semantic conventions. It represents the name of the -// operation being executed. -func GraphqlOperationName(val string) attribute.KeyValue { - return GraphqlOperationNameKey.String(val) -} - // GraphqlDocument returns an attribute KeyValue conforming to the // "graphql.document" semantic conventions. It represents the GraphQL document // being executed. @@ -2162,334 +1326,9 @@ func GraphqlDocument(val string) attribute.KeyValue { return GraphqlDocumentKey.String(val) } -// General attributes used in messaging systems. -const ( - // MessagingSystemKey is the attribute Key conforming to the - // "messaging.system" semantic conventions. It represents a string - // identifying the messaging system. - // - // Type: string - // RequirementLevel: Required - // Stability: stable - // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' - MessagingSystemKey = attribute.Key("messaging.system") - - // MessagingOperationKey is the attribute Key conforming to the - // "messaging.operation" semantic conventions. It represents a string - // identifying the kind of messaging operation as defined in the [Operation - // names](#operation-names) section above. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - // Note: If a custom value is used, it MUST be of low cardinality. - MessagingOperationKey = attribute.Key("messaging.operation") - - // MessagingBatchMessageCountKey is the attribute Key conforming to the - // "messaging.batch.message_count" semantic conventions. It represents the - // number of messages sent, received, or processed in the scope of the - // batching operation. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If the span describes an - // operation on a batch of messages.) - // Stability: stable - // Examples: 0, 1, 2 - // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on - // spans that operate with a single message. When a messaging client - // library supports both batch and single-message API for the same - // operation, instrumentations SHOULD use `messaging.batch.message_count` - // for batching APIs and SHOULD NOT use it for single-message APIs. - MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") - - // MessagingClientIDKey is the attribute Key conforming to the - // "messaging.client_id" semantic conventions. It represents a unique - // identifier for the client that consumes or produces a message. - // - // Type: string - // RequirementLevel: Recommended (If a client id is available) - // Stability: stable - // Examples: 'client-5', 'myhost@8742@s8083jm' - MessagingClientIDKey = attribute.Key("messaging.client_id") -) - -var ( - // publish - MessagingOperationPublish = MessagingOperationKey.String("publish") - // receive - MessagingOperationReceive = MessagingOperationKey.String("receive") - // process - MessagingOperationProcess = MessagingOperationKey.String("process") -) - -// MessagingSystem returns an attribute KeyValue conforming to the -// "messaging.system" semantic conventions. It represents a string identifying -// the messaging system. -func MessagingSystem(val string) attribute.KeyValue { - return MessagingSystemKey.String(val) -} - -// MessagingBatchMessageCount returns an attribute KeyValue conforming to -// the "messaging.batch.message_count" semantic conventions. It represents the -// number of messages sent, received, or processed in the scope of the batching -// operation. -func MessagingBatchMessageCount(val int) attribute.KeyValue { - return MessagingBatchMessageCountKey.Int(val) -} - -// MessagingClientID returns an attribute KeyValue conforming to the -// "messaging.client_id" semantic conventions. It represents a unique -// identifier for the client that consumes or produces a message. -func MessagingClientID(val string) attribute.KeyValue { - return MessagingClientIDKey.String(val) -} - -// Semantic conventions for remote procedure calls. -const ( - // RPCSystemKey is the attribute Key conforming to the "rpc.system" - // semantic conventions. It represents a string identifying the remoting - // system. See below for a list of well-known identifiers. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCSystemKey = attribute.Key("rpc.system") - - // RPCServiceKey is the attribute Key conforming to the "rpc.service" - // semantic conventions. It represents the full (logical) name of the - // service being called, including its package name, if applicable. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'myservice.EchoService' - // Note: This is the logical name of the service from the RPC interface - // perspective, which can be different from the name of any implementing - // class. The `code.namespace` attribute may be used to store the latter - // (despite the attribute name, it may include a class name; e.g., class - // with method actually executing the call on the server side, RPC client - // stub class on the client side). - RPCServiceKey = attribute.Key("rpc.service") - - // RPCMethodKey is the attribute Key conforming to the "rpc.method" - // semantic conventions. It represents the name of the (logical) method - // being called, must be equal to the $method part in the span name. - // - // Type: string - // RequirementLevel: Recommended - // Stability: stable - // Examples: 'exampleMethod' - // Note: This is the logical name of the method from the RPC interface - // perspective, which can be different from the name of any implementing - // method/function. The `code.function` attribute may be used to store the - // latter (e.g., method actually executing the call on the server side, RPC - // client stub method on the client side). - RPCMethodKey = attribute.Key("rpc.method") -) - -var ( - // gRPC - RPCSystemGRPC = RPCSystemKey.String("grpc") - // Java RMI - RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") - // .NET WCF - RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") - // Apache Dubbo - RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") - // Connect RPC - RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") -) - -// RPCService returns an attribute KeyValue conforming to the "rpc.service" -// semantic conventions. It represents the full (logical) name of the service -// being called, including its package name, if applicable. -func RPCService(val string) attribute.KeyValue { - return RPCServiceKey.String(val) -} - -// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" -// semantic conventions. It represents the name of the (logical) method being -// called, must be equal to the $method part in the span name. -func RPCMethod(val string) attribute.KeyValue { - return RPCMethodKey.String(val) -} - -// Tech-specific attributes for gRPC. -const ( - // RPCGRPCStatusCodeKey is the attribute Key conforming to the - // "rpc.grpc.status_code" semantic conventions. It represents the [numeric - // status - // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of - // the gRPC request. - // - // Type: Enum - // RequirementLevel: Required - // Stability: stable - RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") -) - -var ( - // OK - RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) - // CANCELLED - RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) - // UNKNOWN - RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) - // INVALID_ARGUMENT - RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) - // DEADLINE_EXCEEDED - RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) - // NOT_FOUND - RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) - // ALREADY_EXISTS - RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) - // PERMISSION_DENIED - RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) - // RESOURCE_EXHAUSTED - RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) - // FAILED_PRECONDITION - RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) - // ABORTED - RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) - // OUT_OF_RANGE - RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) - // UNIMPLEMENTED - RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) - // INTERNAL - RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) - // UNAVAILABLE - RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) - // DATA_LOSS - RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) - // UNAUTHENTICATED - RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) -) - -// Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). -const ( - // RPCJsonrpcVersionKey is the attribute Key conforming to the - // "rpc.jsonrpc.version" semantic conventions. It represents the protocol - // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 - // does not specify this, the value can be omitted. - // - // Type: string - // RequirementLevel: ConditionallyRequired (If other than the default - // version (`1.0`)) - // Stability: stable - // Examples: '2.0', '1.0' - RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") - - // RPCJsonrpcRequestIDKey is the attribute Key conforming to the - // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` - // property of request or response. Since protocol allows id to be int, - // string, `null` or missing (for notifications), value is expected to be - // cast to string for simplicity. Use empty string in case of `null` value. - // Omit entirely if this is a notification. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: '10', 'request-7', '' - RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") - - // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_code" semantic conventions. It represents the - // `error.code` property of response if it is an error response. - // - // Type: int - // RequirementLevel: ConditionallyRequired (If response is not successful.) - // Stability: stable - // Examples: -32700, 100 - RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") - - // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the - // "rpc.jsonrpc.error_message" semantic conventions. It represents the - // `error.message` property of response if it is an error response. - // - // Type: string - // RequirementLevel: Optional - // Stability: stable - // Examples: 'Parse error', 'User already exists' - RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") -) - -// RPCJsonrpcVersion returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.version" semantic conventions. It represents the protocol -// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 -// does not specify this, the value can be omitted. -func RPCJsonrpcVersion(val string) attribute.KeyValue { - return RPCJsonrpcVersionKey.String(val) -} - -// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` -// property of request or response. Since protocol allows id to be int, string, -// `null` or missing (for notifications), value is expected to be cast to -// string for simplicity. Use empty string in case of `null` value. Omit -// entirely if this is a notification. -func RPCJsonrpcRequestID(val string) attribute.KeyValue { - return RPCJsonrpcRequestIDKey.String(val) -} - -// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_code" semantic conventions. It represents the -// `error.code` property of response if it is an error response. -func RPCJsonrpcErrorCode(val int) attribute.KeyValue { - return RPCJsonrpcErrorCodeKey.Int(val) -} - -// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the -// "rpc.jsonrpc.error_message" semantic conventions. It represents the -// `error.message` property of response if it is an error response. -func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { - return RPCJsonrpcErrorMessageKey.String(val) +// GraphqlOperationName returns an attribute KeyValue conforming to the +// "graphql.operation.name" semantic conventions. It represents the name of the +// operation being executed. +func GraphqlOperationName(val string) attribute.KeyValue { + return GraphqlOperationNameKey.String(val) } - -// Tech-specific attributes for Connect RPC. -const ( - // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the - // "rpc.connect_rpc.error_code" semantic conventions. It represents the - // [error codes](https://connect.build/docs/protocol/#error-codes) of the - // Connect request. Error codes are always string values. - // - // Type: Enum - // RequirementLevel: ConditionallyRequired (If response is not successful - // and if error code available.) - // Stability: stable - RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") -) - -var ( - // cancelled - RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") - // unknown - RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") - // invalid_argument - RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") - // deadline_exceeded - RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") - // not_found - RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") - // already_exists - RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") - // permission_denied - RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") - // resource_exhausted - RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") - // failed_precondition - RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") - // aborted - RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") - // out_of_range - RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") - // unimplemented - RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") - // internal - RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") - // unavailable - RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") - // data_loss - RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") - // unauthenticated - RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") -) diff --git a/test/integration/vendor/go.opentelemetry.io/otel/trace/tracestate.go b/test/integration/vendor/go.opentelemetry.io/otel/trace/tracestate.go index d1e47ca2fa..db936ba5b7 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/trace/tracestate.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/trace/tracestate.go @@ -17,20 +17,14 @@ package trace // import "go.opentelemetry.io/otel/trace" import ( "encoding/json" "fmt" - "regexp" "strings" ) const ( maxListMembers = 32 - listDelimiter = "," - - // based on the W3C Trace Context specification, see - // https://www.w3.org/TR/trace-context-1/#tracestate-header - noTenantKeyFormat = `[a-z][_0-9a-z\-\*\/]*` - withTenantKeyFormat = `[a-z0-9][_0-9a-z\-\*\/]*@[a-z][_0-9a-z\-\*\/]*` - valueFormat = `[\x20-\x2b\x2d-\x3c\x3e-\x7e]*[\x21-\x2b\x2d-\x3c\x3e-\x7e]` + listDelimiters = "," + memberDelimiter = "=" errInvalidKey errorConst = "invalid tracestate key" errInvalidValue errorConst = "invalid tracestate value" @@ -39,43 +33,128 @@ const ( errDuplicate errorConst = "duplicate list-member in tracestate" ) -var ( - noTenantKeyRe = regexp.MustCompile(`^` + noTenantKeyFormat + `$`) - withTenantKeyRe = regexp.MustCompile(`^` + withTenantKeyFormat + `$`) - valueRe = regexp.MustCompile(`^` + valueFormat + `$`) - memberRe = regexp.MustCompile(`^\s*((?:` + noTenantKeyFormat + `)|(?:` + withTenantKeyFormat + `))=(` + valueFormat + `)\s*$`) -) - type member struct { Key string Value string } -func newMember(key, value string) (member, error) { - if len(key) > 256 { - return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) +// according to (chr = %x20 / (nblk-char = %x21-2B / %x2D-3C / %x3E-7E) ) +// means (chr = %x20-2B / %x2D-3C / %x3E-7E) . +func checkValueChar(v byte) bool { + return v >= '\x20' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// according to (nblk-chr = %x21-2B / %x2D-3C / %x3E-7E) . +func checkValueLast(v byte) bool { + return v >= '\x21' && v <= '\x7e' && v != '\x2c' && v != '\x3d' +} + +// based on the W3C Trace Context specification +// +// value = (0*255(chr)) nblk-chr +// nblk-chr = %x21-2B / %x2D-3C / %x3E-7E +// chr = %x20 / nblk-chr +// +// see https://www.w3.org/TR/trace-context-1/#value +func checkValue(val string) bool { + n := len(val) + if n == 0 || n > 256 { + return false + } + for i := 0; i < n-1; i++ { + if !checkValueChar(val[i]) { + return false + } } - if !noTenantKeyRe.MatchString(key) { - if !withTenantKeyRe.MatchString(key) { - return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) + return checkValueLast(val[n-1]) +} + +func checkKeyRemain(key string) bool { + // ( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) + for _, v := range key { + if isAlphaNum(byte(v)) { + continue } - atIndex := strings.LastIndex(key, "@") - if atIndex > 241 || len(key)-1-atIndex > 14 { - return member{}, fmt.Errorf("%w: %s", errInvalidKey, key) + switch v { + case '_', '-', '*', '/': + continue } + return false + } + return true +} + +// according to +// +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// +// param n is remain part length, should be 255 in simple-key or 13 in system-id. +func checkKeyPart(key string, n int) bool { + if len(key) == 0 { + return false + } + first := key[0] // key's first char + ret := len(key[1:]) <= n + ret = ret && first >= 'a' && first <= 'z' + return ret && checkKeyRemain(key[1:]) +} + +func isAlphaNum(c byte) bool { + if c >= 'a' && c <= 'z' { + return true } - if len(value) > 256 || !valueRe.MatchString(value) { - return member{}, fmt.Errorf("%w: %s", errInvalidValue, value) + return c >= '0' && c <= '9' +} + +// according to +// +// tenant-id = ( lcalpha / DIGIT ) 0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" ) +// +// param n is remain part length, should be 240 exactly. +func checkKeyTenant(key string, n int) bool { + if len(key) == 0 { + return false + } + return isAlphaNum(key[0]) && len(key[1:]) <= n && checkKeyRemain(key[1:]) +} + +// based on the W3C Trace Context specification +// +// key = simple-key / multi-tenant-key +// simple-key = lcalpha (0*255( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// multi-tenant-key = tenant-id "@" system-id +// tenant-id = ( lcalpha / DIGIT ) (0*240( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// system-id = lcalpha (0*13( lcalpha / DIGIT / "_" / "-"/ "*" / "/" )) +// lcalpha = %x61-7A ; a-z +// +// see https://www.w3.org/TR/trace-context-1/#tracestate-header. +func checkKey(key string) bool { + tenant, system, ok := strings.Cut(key, "@") + if !ok { + return checkKeyPart(key, 255) + } + return checkKeyTenant(tenant, 240) && checkKeyPart(system, 13) +} + +func newMember(key, value string) (member, error) { + if !checkKey(key) { + return member{}, errInvalidKey + } + if !checkValue(value) { + return member{}, errInvalidValue } return member{Key: key, Value: value}, nil } func parseMember(m string) (member, error) { - matches := memberRe.FindStringSubmatch(m) - if len(matches) != 3 { + key, val, ok := strings.Cut(m, memberDelimiter) + if !ok { return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) } - result, e := newMember(matches[1], matches[2]) + key = strings.TrimLeft(key, " \t") + val = strings.TrimRight(val, " \t") + result, e := newMember(key, val) if e != nil { return member{}, fmt.Errorf("%w: %s", errInvalidMember, m) } @@ -85,7 +164,7 @@ func parseMember(m string) (member, error) { // String encodes member into a string compliant with the W3C Trace Context // specification. func (m member) String() string { - return fmt.Sprintf("%s=%s", m.Key, m.Value) + return m.Key + "=" + m.Value } // TraceState provides additional vendor-specific trace identification @@ -109,8 +188,8 @@ var _ json.Marshaler = TraceState{} // ParseTraceState attempts to decode a TraceState from the passed // string. It returns an error if the input is invalid according to the W3C // Trace Context specification. -func ParseTraceState(tracestate string) (TraceState, error) { - if tracestate == "" { +func ParseTraceState(ts string) (TraceState, error) { + if ts == "" { return TraceState{}, nil } @@ -120,7 +199,9 @@ func ParseTraceState(tracestate string) (TraceState, error) { var members []member found := make(map[string]struct{}) - for _, memberStr := range strings.Split(tracestate, listDelimiter) { + for ts != "" { + var memberStr string + memberStr, ts, _ = strings.Cut(ts, listDelimiters) if len(memberStr) == 0 { continue } @@ -153,11 +234,29 @@ func (ts TraceState) MarshalJSON() ([]byte, error) { // Trace Context specification. The returned string will be invalid if the // TraceState contains any invalid members. func (ts TraceState) String() string { - members := make([]string, len(ts.list)) - for i, m := range ts.list { - members[i] = m.String() + if len(ts.list) == 0 { + return "" + } + var n int + n += len(ts.list) // member delimiters: '=' + n += len(ts.list) - 1 // list delimiters: ',' + for _, mem := range ts.list { + n += len(mem.Key) + n += len(mem.Value) } - return strings.Join(members, listDelimiter) + + var sb strings.Builder + sb.Grow(n) + _, _ = sb.WriteString(ts.list[0].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[0].Value) + for i := 1; i < len(ts.list); i++ { + _ = sb.WriteByte(listDelimiters[0]) + _, _ = sb.WriteString(ts.list[i].Key) + _ = sb.WriteByte('=') + _, _ = sb.WriteString(ts.list[i].Value) + } + return sb.String() } // Get returns the value paired with key from the corresponding TraceState @@ -189,15 +288,25 @@ func (ts TraceState) Insert(key, value string) (TraceState, error) { if err != nil { return ts, err } - - cTS := ts.Delete(key) - if cTS.Len()+1 <= maxListMembers { - cTS.list = append(cTS.list, member{}) + n := len(ts.list) + found := n + for i := range ts.list { + if ts.list[i].Key == key { + found = i + } + } + cTS := TraceState{} + if found == n && n < maxListMembers { + cTS.list = make([]member, n+1) + } else { + cTS.list = make([]member, n) } - // When the number of members exceeds capacity, drop the "right-most". - copy(cTS.list[1:], cTS.list) cTS.list[0] = m - + // When the number of members exceeds capacity, drop the "right-most". + copy(cTS.list[1:], ts.list[0:found]) + if found < n { + copy(cTS.list[1+found:], ts.list[found+1:]) + } return cTS, nil } diff --git a/test/integration/vendor/go.opentelemetry.io/otel/version.go b/test/integration/vendor/go.opentelemetry.io/otel/version.go index e2f743585d..c7aba1c3f4 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/version.go +++ b/test/integration/vendor/go.opentelemetry.io/otel/version.go @@ -16,5 +16,5 @@ package otel // import "go.opentelemetry.io/otel" // Version is the current release version of OpenTelemetry in use. func Version() string { - return "1.21.0" + return "1.22.0" } diff --git a/test/integration/vendor/go.opentelemetry.io/otel/versions.yaml b/test/integration/vendor/go.opentelemetry.io/otel/versions.yaml index 3c153c9d6f..a9cfb80ae5 100644 --- a/test/integration/vendor/go.opentelemetry.io/otel/versions.yaml +++ b/test/integration/vendor/go.opentelemetry.io/otel/versions.yaml @@ -14,7 +14,7 @@ module-sets: stable-v1: - version: v1.21.0 + version: v1.22.0 modules: - go.opentelemetry.io/otel - go.opentelemetry.io/otel/bridge/opentracing @@ -34,7 +34,7 @@ module-sets: - go.opentelemetry.io/otel/sdk/metric - go.opentelemetry.io/otel/trace experimental-metrics: - version: v0.44.0 + version: v0.45.0 modules: - go.opentelemetry.io/otel/bridge/opencensus - go.opentelemetry.io/otel/bridge/opencensus/test diff --git a/test/integration/vendor/modules.txt b/test/integration/vendor/modules.txt index 0dfee722c8..634a16f12f 100644 --- a/test/integration/vendor/modules.txt +++ b/test/integration/vendor/modules.txt @@ -221,7 +221,7 @@ github.com/docker/buildx/util/platformutil github.com/docker/buildx/util/progress github.com/docker/buildx/util/resolver github.com/docker/buildx/util/waitmap -# github.com/docker/cli v24.0.6+incompatible +# github.com/docker/cli v24.0.7+incompatible ## explicit github.com/docker/cli/cli github.com/docker/cli/cli-plugins/manager @@ -326,15 +326,15 @@ github.com/docker/docker/pkg/streamformatter github.com/docker/docker/pkg/stringid github.com/docker/docker/pkg/system github.com/docker/docker/registry -# github.com/docker/docker-credential-helpers v0.8.0 +# github.com/docker/docker-credential-helpers v0.8.1 ## explicit; go 1.19 github.com/docker/docker-credential-helpers/client github.com/docker/docker-credential-helpers/credentials # github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c ## explicit github.com/docker/go/canonical/json -# github.com/docker/go-connections v0.4.0 -## explicit +# github.com/docker/go-connections v0.5.0 +## explicit; go 1.18 github.com/docker/go-connections/nat github.com/docker/go-connections/sockets github.com/docker/go-connections/tlsconfig @@ -502,7 +502,7 @@ github.com/jstemmer/go-junit-report/parser # github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 ## explicit github.com/kballard/go-shellquote -# github.com/klauspost/compress v1.17.4 +# github.com/klauspost/compress v1.17.5 ## explicit; go 1.19 github.com/klauspost/compress github.com/klauspost/compress/fse @@ -897,11 +897,11 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/inte ## explicit; go 1.20 go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace/internal/semconvutil -# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 +# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 ## explicit; go 1.20 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/semconvutil -# go.opentelemetry.io/otel v1.21.0 +# go.opentelemetry.io/otel v1.22.0 ## explicit; go 1.20 go.opentelemetry.io/otel go.opentelemetry.io/otel/attribute @@ -914,7 +914,9 @@ go.opentelemetry.io/otel/internal/global go.opentelemetry.io/otel/propagation go.opentelemetry.io/otel/semconv/v1.17.0 go.opentelemetry.io/otel/semconv/v1.18.0 +go.opentelemetry.io/otel/semconv/v1.20.0 go.opentelemetry.io/otel/semconv/v1.21.0 +go.opentelemetry.io/otel/semconv/v1.24.0 # go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 ## explicit; go 1.20 go.opentelemetry.io/otel/exporters/otlp/otlptrace @@ -933,11 +935,11 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/envconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/otlpconfig go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/internal/retry -# go.opentelemetry.io/otel/metric v1.21.0 +# go.opentelemetry.io/otel/metric v1.22.0 ## explicit; go 1.20 go.opentelemetry.io/otel/metric go.opentelemetry.io/otel/metric/embedded -# go.opentelemetry.io/otel/sdk v1.20.0 +# go.opentelemetry.io/otel/sdk v1.22.0 ## explicit; go 1.20 go.opentelemetry.io/otel/sdk go.opentelemetry.io/otel/sdk/instrumentation @@ -946,7 +948,7 @@ go.opentelemetry.io/otel/sdk/internal/env go.opentelemetry.io/otel/sdk/resource go.opentelemetry.io/otel/sdk/trace go.opentelemetry.io/otel/sdk/trace/tracetest -# go.opentelemetry.io/otel/trace v1.21.0 +# go.opentelemetry.io/otel/trace v1.22.0 ## explicit; go 1.20 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded @@ -1077,10 +1079,10 @@ google.golang.org/appengine/urlfetch # google.golang.org/genproto v0.0.0-20240108191215-35c7eff3a6b1 ## explicit; go 1.19 google.golang.org/genproto/protobuf/field_mask -# google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 +# google.golang.org/genproto/googleapis/api v0.0.0-20240116215550-a9fa1716bcac ## explicit; go 1.19 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/errdetails google.golang.org/genproto/googleapis/rpc/status diff --git a/test/performance/go.mod b/test/performance/go.mod index f7f9014663..83556b0ccc 100644 --- a/test/performance/go.mod +++ b/test/performance/go.mod @@ -32,7 +32,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jstemmer/go-junit-report v1.0.0 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.5 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/lufia/plan9stats v0.0.0-20231016141302-07b5767bb0ed // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -82,7 +82,7 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.17.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/mcuadros/go-syslog.v2 v2.3.0 // indirect diff --git a/test/performance/go.sum b/test/performance/go.sum index bd16ba8eba..4ff159d398 100644 --- a/test/performance/go.sum +++ b/test/performance/go.sum @@ -63,8 +63,8 @@ github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dv github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E= +github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -201,8 +201,8 @@ go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/mock v0.3.0 h1:3mUxI1No2/60yUYax92Pt8eNOEecx2D3lcXZh2NEZJo= -go.uber.org/mock v0.3.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= @@ -312,8 +312,8 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 h1:gphdwh0npgs8elJ4T6J+DQJHPVF7RsuJHCfwztUb4J4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/test/performance/vendor/github.com/klauspost/compress/flate/deflate.go b/test/performance/vendor/github.com/klauspost/compress/flate/deflate.go index de912e187c..66d1657d2c 100644 --- a/test/performance/vendor/github.com/klauspost/compress/flate/deflate.go +++ b/test/performance/vendor/github.com/klauspost/compress/flate/deflate.go @@ -212,7 +212,7 @@ func (d *compressor) writeBlockSkip(tok *tokens, index int, eof bool) error { // Should only be used after a start/reset. func (d *compressor) fillWindow(b []byte) { // Do not fill window if we are in store-only or huffman mode. - if d.level <= 0 { + if d.level <= 0 && d.level > -MinCustomWindowSize { return } if d.fast != nil { diff --git a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go b/test/performance/vendor/github.com/klauspost/compress/internal/race/norace.go similarity index 52% rename from vendor/golang.org/x/crypto/sha3/keccakf_amd64.go rename to test/performance/vendor/github.com/klauspost/compress/internal/race/norace.go index b908696be5..affbbbb595 100644 --- a/vendor/golang.org/x/crypto/sha3/keccakf_amd64.go +++ b/test/performance/vendor/github.com/klauspost/compress/internal/race/norace.go @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build amd64 && !purego && gc +//go:build !race -package sha3 +package race -// This function is implemented in keccakf_amd64.s. +func ReadSlice[T any](s []T) { +} -//go:noescape - -func keccakF1600(a *[25]uint64) +func WriteSlice[T any](s []T) { +} diff --git a/test/performance/vendor/github.com/klauspost/compress/internal/race/race.go b/test/performance/vendor/github.com/klauspost/compress/internal/race/race.go new file mode 100644 index 0000000000..f5e240dcde --- /dev/null +++ b/test/performance/vendor/github.com/klauspost/compress/internal/race/race.go @@ -0,0 +1,26 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build race + +package race + +import ( + "runtime" + "unsafe" +) + +func ReadSlice[T any](s []T) { + if len(s) == 0 { + return + } + runtime.RaceReadRange(unsafe.Pointer(&s[0]), len(s)*int(unsafe.Sizeof(s[0]))) +} + +func WriteSlice[T any](s []T) { + if len(s) == 0 { + return + } + runtime.RaceWriteRange(unsafe.Pointer(&s[0]), len(s)*int(unsafe.Sizeof(s[0]))) +} diff --git a/test/performance/vendor/github.com/klauspost/compress/s2/decode.go b/test/performance/vendor/github.com/klauspost/compress/s2/decode.go index 6c7feafcc6..264ffd0a9b 100644 --- a/test/performance/vendor/github.com/klauspost/compress/s2/decode.go +++ b/test/performance/vendor/github.com/klauspost/compress/s2/decode.go @@ -10,6 +10,8 @@ import ( "errors" "fmt" "strconv" + + "github.com/klauspost/compress/internal/race" ) var ( @@ -63,6 +65,10 @@ func Decode(dst, src []byte) ([]byte, error) { } else { dst = make([]byte, dLen) } + + race.WriteSlice(dst) + race.ReadSlice(src[s:]) + if s2Decode(dst, src[s:]) != 0 { return nil, ErrCorrupt } diff --git a/test/performance/vendor/github.com/klauspost/compress/s2/encode_amd64.go b/test/performance/vendor/github.com/klauspost/compress/s2/encode_amd64.go index ebc332ad5f..4f45206a4e 100644 --- a/test/performance/vendor/github.com/klauspost/compress/s2/encode_amd64.go +++ b/test/performance/vendor/github.com/klauspost/compress/s2/encode_amd64.go @@ -3,6 +3,8 @@ package s2 +import "github.com/klauspost/compress/internal/race" + const hasAmd64Asm = true // encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It @@ -14,6 +16,9 @@ const hasAmd64Asm = true // len(dst) >= MaxEncodedLen(len(src)) && // minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize func encodeBlock(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + const ( // Use 12 bit table when less than... limit12B = 16 << 10 @@ -50,6 +55,9 @@ func encodeBlock(dst, src []byte) (d int) { // len(dst) >= MaxEncodedLen(len(src)) && // minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize func encodeBlockBetter(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + const ( // Use 12 bit table when less than... limit12B = 16 << 10 @@ -86,6 +94,9 @@ func encodeBlockBetter(dst, src []byte) (d int) { // len(dst) >= MaxEncodedLen(len(src)) && // minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize func encodeBlockSnappy(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + const ( // Use 12 bit table when less than... limit12B = 16 << 10 @@ -121,6 +132,9 @@ func encodeBlockSnappy(dst, src []byte) (d int) { // len(dst) >= MaxEncodedLen(len(src)) && // minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize func encodeBlockBetterSnappy(dst, src []byte) (d int) { + race.ReadSlice(src) + race.WriteSlice(dst) + const ( // Use 12 bit table when less than... limit12B = 16 << 10 diff --git a/test/performance/vendor/github.com/klauspost/compress/s2/reader.go b/test/performance/vendor/github.com/klauspost/compress/s2/reader.go index 2f01a3987f..46ead58fe0 100644 --- a/test/performance/vendor/github.com/klauspost/compress/s2/reader.go +++ b/test/performance/vendor/github.com/klauspost/compress/s2/reader.go @@ -104,12 +104,14 @@ func ReaderIgnoreStreamIdentifier() ReaderOption { // For each chunk with the ID, the callback is called with the content. // Any returned non-nil error will abort decompression. // Only one callback per ID is supported, latest sent will be used. +// You can peek the stream, triggering the callback, by doing a Read with a 0 +// byte buffer. func ReaderSkippableCB(id uint8, fn func(r io.Reader) error) ReaderOption { return func(r *Reader) error { if id < 0x80 || id > 0xfd { return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfd (inclusive)") } - r.skippableCB[id] = fn + r.skippableCB[id-0x80] = fn return nil } } @@ -128,7 +130,7 @@ type Reader struct { err error decoded []byte buf []byte - skippableCB [0x80]func(r io.Reader) error + skippableCB [0xff - 0x80]func(r io.Reader) error blockStart int64 // Uncompressed offset at start of current. index *Index @@ -201,7 +203,7 @@ func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) { // The supplied slice does not need to be the size of the read. func (r *Reader) skippable(tmp []byte, n int, allowEOF bool, id uint8) (ok bool) { if id < 0x80 { - r.err = fmt.Errorf("interbal error: skippable id < 0x80") + r.err = fmt.Errorf("internal error: skippable id < 0x80") return false } if fn := r.skippableCB[id-0x80]; fn != nil { @@ -1048,15 +1050,17 @@ func (r *Reader) ReadByte() (byte, error) { } // SkippableCB will register a callback for chunks with the specified ID. -// ID must be a Reserved skippable chunks ID, 0x80-0xfe (inclusive). +// ID must be a Reserved skippable chunks ID, 0x80-0xfd (inclusive). // For each chunk with the ID, the callback is called with the content. // Any returned non-nil error will abort decompression. // Only one callback per ID is supported, latest sent will be used. // Sending a nil function will disable previous callbacks. +// You can peek the stream, triggering the callback, by doing a Read with a 0 +// byte buffer. func (r *Reader) SkippableCB(id uint8, fn func(r io.Reader) error) error { - if id < 0x80 || id > chunkTypePadding { + if id < 0x80 || id >= chunkTypePadding { return fmt.Errorf("ReaderSkippableCB: Invalid id provided, must be 0x80-0xfe (inclusive)") } - r.skippableCB[id] = fn + r.skippableCB[id-0x80] = fn return nil } diff --git a/test/performance/vendor/github.com/klauspost/compress/s2/s2.go b/test/performance/vendor/github.com/klauspost/compress/s2/s2.go index dae3f731fa..72bcb49453 100644 --- a/test/performance/vendor/github.com/klauspost/compress/s2/s2.go +++ b/test/performance/vendor/github.com/klauspost/compress/s2/s2.go @@ -37,6 +37,8 @@ package s2 import ( "bytes" "hash/crc32" + + "github.com/klauspost/compress/internal/race" ) /* @@ -112,6 +114,8 @@ var crcTable = crc32.MakeTable(crc32.Castagnoli) // crc implements the checksum specified in section 3 of // https://github.com/google/snappy/blob/master/framing_format.txt func crc(b []byte) uint32 { + race.ReadSlice(b) + c := crc32.Update(0, crcTable, b) return c>>15 | c<<17 + 0xa282ead8 } diff --git a/test/performance/vendor/github.com/klauspost/compress/s2/writer.go b/test/performance/vendor/github.com/klauspost/compress/s2/writer.go index 089cd36d8c..bba66a8766 100644 --- a/test/performance/vendor/github.com/klauspost/compress/s2/writer.go +++ b/test/performance/vendor/github.com/klauspost/compress/s2/writer.go @@ -13,6 +13,8 @@ import ( "io" "runtime" "sync" + + "github.com/klauspost/compress/internal/race" ) const ( @@ -271,7 +273,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) { return fmt.Errorf("skippable block excessed maximum size") } var header [4]byte - chunkLen := 4 + len(data) + chunkLen := len(data) header[0] = id header[1] = uint8(chunkLen >> 0) header[2] = uint8(chunkLen >> 8) @@ -282,7 +284,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) { if err = w.err(err); err != nil { return err } - if n != len(data) { + if n != len(b) { return w.err(io.ErrShortWrite) } w.written += int64(n) @@ -303,9 +305,7 @@ func (w *Writer) AddSkippableBlock(id uint8, data []byte) (err error) { if err := write(header[:]); err != nil { return err } - if err := write(data); err != nil { - return err - } + return write(data) } // Create output... @@ -385,6 +385,8 @@ func (w *Writer) EncodeBuffer(buf []byte) (err error) { buf = buf[len(uncompressed):] // Get an output buffer. obuf := w.buffers.Get().([]byte)[:len(uncompressed)+obufHeaderLen] + race.WriteSlice(obuf) + output := make(chan result) // Queue output now, so we keep order. w.output <- output @@ -393,6 +395,8 @@ func (w *Writer) EncodeBuffer(buf []byte) (err error) { } w.uncompWritten += int64(len(uncompressed)) go func() { + race.ReadSlice(uncompressed) + checksum := crc(uncompressed) // Set to uncompressed. diff --git a/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile b/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile index d47379b42c..5a88d94ab6 100644 --- a/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile +++ b/test/performance/vendor/github.com/nginx/agent/sdk/v2/Makefile @@ -48,7 +48,7 @@ Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types:\ proto/*.proto; \ grep -v '^swagger:' ./../docs/proto/proto.md > ./../docs/proto/tmp-proto.md && mv ./../docs/proto/tmp-proto.md ./../docs/proto/proto.md - go generate ./sdk/... + go generate ./... all-test: unit-test ## Run all tests diff --git a/test/performance/vendor/modules.txt b/test/performance/vendor/modules.txt index 5f6ba10fca..73332fffe8 100644 --- a/test/performance/vendor/modules.txt +++ b/test/performance/vendor/modules.txt @@ -74,9 +74,10 @@ github.com/jstemmer/go-junit-report/parser # github.com/kelseyhightower/envconfig v1.4.0 ## explicit github.com/kelseyhightower/envconfig -# github.com/klauspost/compress v1.17.4 +# github.com/klauspost/compress v1.17.5 ## explicit; go 1.19 github.com/klauspost/compress/flate +github.com/klauspost/compress/internal/race github.com/klauspost/compress/s2 # github.com/klauspost/cpuid/v2 v2.2.5 ## explicit; go 1.15 @@ -424,7 +425,7 @@ golang.org/x/tools/internal/tokeninternal golang.org/x/tools/internal/typeparams golang.org/x/tools/internal/typesinternal golang.org/x/tools/internal/versions -# google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.60.1 diff --git a/vendor/4d63.com/gocheckcompilerdirectives/LICENSE b/vendor/4d63.com/gocheckcompilerdirectives/LICENSE deleted file mode 100644 index 3f12625b06..0000000000 --- a/vendor/4d63.com/gocheckcompilerdirectives/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Leigh McCulloch - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.go b/vendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.go deleted file mode 100644 index 19948c4547..0000000000 --- a/vendor/4d63.com/gocheckcompilerdirectives/checkcompilerdirectives/checkcompilerdirectives.go +++ /dev/null @@ -1,105 +0,0 @@ -package checkcompilerdirectives - -import ( - "strings" - - "golang.org/x/tools/go/analysis" -) - -func Analyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "gocheckcompilerdirectives", - Doc: "Checks that go compiler directive comments (//go:) are valid.", - Run: run, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - for _, group := range file.Comments { - for _, comment := range group.List { - text := comment.Text - if !strings.HasPrefix(text, "//") { - continue - } - start := 2 - spaces := 0 - for _, c := range text[start:] { - if c == ' ' { - spaces++ - continue - } - break - } - start += spaces - if !strings.HasPrefix(text[start:], "go:") { - continue - } - start += 3 - end := strings.Index(text[start:], " ") - if end == -1 { - continue - } - directive := text[start : start+end] - if len(directive) == 0 { - continue - } - prefix := text[:start+end] - // Leading whitespace will cause the go directive to be ignored - // by the compiler with no error, causing it not to work. This - // is an easy mistake. - if spaces > 0 { - pass.ReportRangef(comment, "compiler directive contains space: %s", prefix) - } - // If the directive is unknown it will be ignored by the - // compiler with no error. This is an easy mistake to make, - // especially if you typo a directive. - if !isKnown(directive) { - pass.ReportRangef(comment, "compiler directive unrecognized: %s", prefix) - } - } - } - } - return nil, nil -} - -func isKnown(directive string) bool { - for _, k := range known { - if directive == k { - return true - } - } - return false -} - -var known = []string{ - // Found by running the following command on the source of go. - // git grep -o -E -h '//go:[a-z_]+' -- ':!**/*_test.go' ':!test/' ':!**/testdata/**' | sort -u - "binary", - "build", - "buildsomethingelse", - "cgo_dynamic_linker", - "cgo_export_dynamic", - "cgo_export_static", - "cgo_import_dynamic", - "cgo_import_static", - "cgo_ldflag", - "cgo_unsafe_args", - "embed", - "generate", - "linkname", - "name", - "nocheckptr", - "noescape", - "noinline", - "nointerface", - "norace", - "nosplit", - "notinheap", - "nowritebarrier", - "nowritebarrierrec", - "systemstack", - "uintptrescapes", - "uintptrkeepalive", - "yeswritebarrierrec", -} diff --git a/vendor/4d63.com/gochecknoglobals/LICENSE b/vendor/4d63.com/gochecknoglobals/LICENSE deleted file mode 100644 index c401e6608d..0000000000 --- a/vendor/4d63.com/gochecknoglobals/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Leigh McCulloch - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/4d63.com/gochecknoglobals/checknoglobals/check_no_globals.go b/vendor/4d63.com/gochecknoglobals/checknoglobals/check_no_globals.go deleted file mode 100644 index edf9193ecb..0000000000 --- a/vendor/4d63.com/gochecknoglobals/checknoglobals/check_no_globals.go +++ /dev/null @@ -1,200 +0,0 @@ -package checknoglobals - -import ( - "flag" - "fmt" - "go/ast" - "go/token" - "go/types" - "strings" - - "golang.org/x/tools/go/analysis" -) - -// allowedExpression is a struct representing packages and methods that will -// be an allowed combination to use as a global variable, f.ex. Name `regexp` -// and SelName `MustCompile`. -type allowedExpression struct { - Name string - SelName string -} - -const Doc = `check that no global variables exist - -This analyzer checks for global variables and errors on any found. - -A global variable is a variable declared in package scope and that can be read -and written to by any function within the package. Global variables can cause -side effects which are difficult to keep track of. A code in one function may -change the variables state while another unrelated chunk of code may be -effected by it.` - -// Analyzer provides an Analyzer that checks that there are no global -// variables, except for errors and variables containing regular -// expressions. -func Analyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "gochecknoglobals", - Doc: Doc, - Run: checkNoGlobals, - Flags: flags(), - RunDespiteErrors: true, - } -} - -func flags() flag.FlagSet { - flags := flag.NewFlagSet("", flag.ExitOnError) - flags.Bool("t", false, "Include tests") - - return *flags -} - -func isAllowed(cm ast.CommentMap, v ast.Node, ti *types.Info) bool { - switch i := v.(type) { - case *ast.GenDecl: - return hasEmbedComment(cm, i) - case *ast.Ident: - return i.Name == "_" || i.Name == "version" || isError(i, ti) || identHasEmbedComment(cm, i) - case *ast.CallExpr: - if expr, ok := i.Fun.(*ast.SelectorExpr); ok { - return isAllowedSelectorExpression(expr) - } - case *ast.CompositeLit: - if expr, ok := i.Type.(*ast.SelectorExpr); ok { - return isAllowedSelectorExpression(expr) - } - } - - return false -} - -func isAllowedSelectorExpression(v *ast.SelectorExpr) bool { - x, ok := v.X.(*ast.Ident) - if !ok { - return false - } - - allowList := []allowedExpression{ - {Name: "regexp", SelName: "MustCompile"}, - } - - for _, i := range allowList { - if x.Name == i.Name && v.Sel.Name == i.SelName { - return true - } - } - - return false -} - -// isError reports whether the AST identifier looks like -// an error and implements the error interface. -func isError(i *ast.Ident, ti *types.Info) bool { - return looksLikeError(i) && implementsError(i, ti) -} - -// looksLikeError returns true if the AST identifier starts -// with 'err' or 'Err', or false otherwise. -func looksLikeError(i *ast.Ident) bool { - prefix := "err" - if i.IsExported() { - prefix = "Err" - } - return strings.HasPrefix(i.Name, prefix) -} - -// implementsError reports whether the AST identifier -// implements the error interface. -func implementsError(i *ast.Ident, ti *types.Info) bool { - t := ti.TypeOf(i) - et := types.Universe.Lookup("error").Type().Underlying().(*types.Interface) - return types.Implements(t, et) -} - -func identHasEmbedComment(cm ast.CommentMap, i *ast.Ident) bool { - if i.Obj == nil { - return false - } - - spec, ok := i.Obj.Decl.(*ast.ValueSpec) - if !ok { - return false - } - - return hasEmbedComment(cm, spec) -} - -// hasEmbedComment returns true if the AST node has -// a '//go:embed ' comment, or false otherwise. -func hasEmbedComment(cm ast.CommentMap, n ast.Node) bool { - for _, g := range cm[n] { - for _, c := range g.List { - if strings.HasPrefix(c.Text, "//go:embed ") { - return true - } - } - } - return false -} - -func checkNoGlobals(pass *analysis.Pass) (interface{}, error) { - includeTests := pass.Analyzer.Flags.Lookup("t").Value.(flag.Getter).Get().(bool) - - for _, file := range pass.Files { - filename := pass.Fset.Position(file.Pos()).Filename - if !strings.HasSuffix(filename, ".go") { - continue - } - if !includeTests && strings.HasSuffix(filename, "_test.go") { - continue - } - - fileCommentMap := ast.NewCommentMap(pass.Fset, file, file.Comments) - - for _, decl := range file.Decls { - genDecl, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - if genDecl.Tok != token.VAR { - continue - } - if isAllowed(fileCommentMap, genDecl, pass.TypesInfo) { - continue - } - for _, spec := range genDecl.Specs { - valueSpec := spec.(*ast.ValueSpec) - onlyAllowedValues := false - - for _, vn := range valueSpec.Values { - if isAllowed(fileCommentMap, vn, pass.TypesInfo) { - onlyAllowedValues = true - continue - } - - onlyAllowedValues = false - break - } - - if onlyAllowedValues { - continue - } - - for _, vn := range valueSpec.Names { - if isAllowed(fileCommentMap, vn, pass.TypesInfo) { - continue - } - - message := fmt.Sprintf("%s is a global variable", vn.Name) - pass.Report(analysis.Diagnostic{ - Pos: vn.Pos(), - Category: "global", - Message: message, - }) - } - } - } - } - - return nil, nil -} diff --git a/vendor/dario.cat/mergo/.deepsource.toml b/vendor/dario.cat/mergo/.deepsource.toml deleted file mode 100644 index a8bc979e02..0000000000 --- a/vendor/dario.cat/mergo/.deepsource.toml +++ /dev/null @@ -1,12 +0,0 @@ -version = 1 - -test_patterns = [ - "*_test.go" -] - -[[analyzers]] -name = "go" -enabled = true - - [analyzers.meta] - import_path = "dario.cat/mergo" \ No newline at end of file diff --git a/vendor/dario.cat/mergo/.gitignore b/vendor/dario.cat/mergo/.gitignore deleted file mode 100644 index 529c3412ba..0000000000 --- a/vendor/dario.cat/mergo/.gitignore +++ /dev/null @@ -1,33 +0,0 @@ -#### joe made this: http://goel.io/joe - -#### go #### -# Binaries for programs and plugins -*.exe -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 -.glide/ - -#### vim #### -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-v][a-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags diff --git a/vendor/dario.cat/mergo/.travis.yml b/vendor/dario.cat/mergo/.travis.yml deleted file mode 100644 index d324c43ba4..0000000000 --- a/vendor/dario.cat/mergo/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -arch: - - amd64 - - ppc64le -install: - - go get -t - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls -script: - - go test -race -v ./... -after_script: - - $HOME/gopath/bin/goveralls -service=travis-ci -repotoken $COVERALLS_TOKEN diff --git a/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md b/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md deleted file mode 100644 index 469b44907a..0000000000 --- a/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at i@dario.im. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/dario.cat/mergo/CONTRIBUTING.md b/vendor/dario.cat/mergo/CONTRIBUTING.md deleted file mode 100644 index 0a1ff9f94d..0000000000 --- a/vendor/dario.cat/mergo/CONTRIBUTING.md +++ /dev/null @@ -1,112 +0,0 @@ - -# Contributing to mergo - -First off, thanks for taking the time to contribute! ❤️ - -All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉 - -> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about: -> - Star the project -> - Tweet about it -> - Refer this project in your project's readme -> - Mention the project at local meetups and tell your friends/colleagues - - -## Table of Contents - -- [Code of Conduct](#code-of-conduct) -- [I Have a Question](#i-have-a-question) -- [I Want To Contribute](#i-want-to-contribute) -- [Reporting Bugs](#reporting-bugs) -- [Suggesting Enhancements](#suggesting-enhancements) - -## Code of Conduct - -This project and everyone participating in it is governed by the -[mergo Code of Conduct](https://github.com/imdario/mergoblob/master/CODE_OF_CONDUCT.md). -By participating, you are expected to uphold this code. Please report unacceptable behavior -to <>. - - -## I Have a Question - -> If you want to ask a question, we assume that you have read the available [Documentation](https://pkg.go.dev/github.com/imdario/mergo). - -Before you ask a question, it is best to search for existing [Issues](https://github.com/imdario/mergo/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first. - -If you then still feel the need to ask a question and need clarification, we recommend the following: - -- Open an [Issue](https://github.com/imdario/mergo/issues/new). -- Provide as much context as you can about what you're running into. -- Provide project and platform versions (nodejs, npm, etc), depending on what seems relevant. - -We will then take care of the issue as soon as possible. - -## I Want To Contribute - -> ### Legal Notice -> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license. - -### Reporting Bugs - - -#### Before Submitting a Bug Report - -A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible. - -- Make sure that you are using the latest version. -- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](). If you are looking for support, you might want to check [this section](#i-have-a-question)). -- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/imdario/mergoissues?q=label%3Abug). -- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue. -- Collect information about the bug: -- Stack trace (Traceback) -- OS, Platform and Version (Windows, Linux, macOS, x86, ARM) -- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant. -- Possibly your input and the output -- Can you reliably reproduce the issue? And can you also reproduce it with older versions? - - -#### How Do I Submit a Good Bug Report? - -> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue tracker, or elsewhere in public. Instead sensitive bugs must be sent by email to . - - -We use GitHub issues to track bugs and errors. If you run into an issue with the project: - -- Open an [Issue](https://github.com/imdario/mergo/issues/new). (Since we can't be sure at this point whether it is a bug or not, we ask you not to talk about a bug yet and not to label the issue.) -- Explain the behavior you would expect and the actual behavior. -- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case. -- Provide the information you collected in the previous section. - -Once it's filed: - -- The project team will label the issue accordingly. -- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps and mark the issue as `needs-repro`. Bugs with the `needs-repro` tag will not be addressed until they are reproduced. -- If the team is able to reproduce the issue, it will be marked `needs-fix`, as well as possibly other tags (such as `critical`), and the issue will be left to be implemented by someone. - -### Suggesting Enhancements - -This section guides you through submitting an enhancement suggestion for mergo, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions. - - -#### Before Submitting an Enhancement - -- Make sure that you are using the latest version. -- Read the [documentation]() carefully and find out if the functionality is already covered, maybe by an individual configuration. -- Perform a [search](https://github.com/imdario/mergo/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. -- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library. - - -#### How Do I Submit a Good Enhancement Suggestion? - -Enhancement suggestions are tracked as [GitHub issues](https://github.com/imdario/mergo/issues). - -- Use a **clear and descriptive title** for the issue to identify the suggestion. -- Provide a **step-by-step description of the suggested enhancement** in as many details as possible. -- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. -- You may want to **include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) or [this tool](https://github.com/GNOME/byzanz) on Linux. -- **Explain why this enhancement would be useful** to most mergo users. You may also want to point out the other projects that solved it better and which could serve as inspiration. - - -## Attribution -This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)! diff --git a/vendor/dario.cat/mergo/LICENSE b/vendor/dario.cat/mergo/LICENSE deleted file mode 100644 index 686680298d..0000000000 --- a/vendor/dario.cat/mergo/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2013 Dario Castañé. All rights reserved. -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/dario.cat/mergo/README.md b/vendor/dario.cat/mergo/README.md deleted file mode 100644 index 7d0cf9f32a..0000000000 --- a/vendor/dario.cat/mergo/README.md +++ /dev/null @@ -1,248 +0,0 @@ -# Mergo - -[![GitHub release][5]][6] -[![GoCard][7]][8] -[![Test status][1]][2] -[![OpenSSF Scorecard][21]][22] -[![OpenSSF Best Practices][19]][20] -[![Coverage status][9]][10] -[![Sourcegraph][11]][12] -[![FOSSA status][13]][14] - -[![GoDoc][3]][4] -[![Become my sponsor][15]][16] -[![Tidelift][17]][18] - -[1]: https://github.com/imdario/mergo/workflows/tests/badge.svg?branch=master -[2]: https://github.com/imdario/mergo/actions/workflows/tests.yml -[3]: https://godoc.org/github.com/imdario/mergo?status.svg -[4]: https://godoc.org/github.com/imdario/mergo -[5]: https://img.shields.io/github/release/imdario/mergo.svg -[6]: https://github.com/imdario/mergo/releases -[7]: https://goreportcard.com/badge/imdario/mergo -[8]: https://goreportcard.com/report/github.com/imdario/mergo -[9]: https://coveralls.io/repos/github/imdario/mergo/badge.svg?branch=master -[10]: https://coveralls.io/github/imdario/mergo?branch=master -[11]: https://sourcegraph.com/github.com/imdario/mergo/-/badge.svg -[12]: https://sourcegraph.com/github.com/imdario/mergo?badge -[13]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=shield -[14]: https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_shield -[15]: https://img.shields.io/github/sponsors/imdario -[16]: https://github.com/sponsors/imdario -[17]: https://tidelift.com/badges/package/go/github.com%2Fimdario%2Fmergo -[18]: https://tidelift.com/subscription/pkg/go-github.com-imdario-mergo -[19]: https://bestpractices.coreinfrastructure.org/projects/7177/badge -[20]: https://bestpractices.coreinfrastructure.org/projects/7177 -[21]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo/badge -[22]: https://api.securityscorecards.dev/projects/github.com/imdario/mergo - -A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. - -Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). - -Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the Province of Ancona in the Italian region of Marche. - -## Status - -It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, Microsoft, etc](https://github.com/imdario/mergo#mergo-in-the-wild). - -### Important notes - -#### 1.0.0 - -In [1.0.0](//github.com/imdario/mergo/releases/tag/1.0.0) Mergo moves to a vanity URL `dario.cat/mergo`. - -#### 0.3.9 - -Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mergo/releases/tag/0.3.9). I reverted it in [0.3.10](//github.com/imdario/mergo/releases/tag/0.3.10), and I consider it stable but not bug-free. Also, this version adds support for go modules. - -Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code. - -If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u dario.cat/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). - -### Donations - -If Mergo is useful to you, consider buying me a coffee, a beer, or making a monthly donation to allow me to keep building great free software. :heart_eyes: - -Buy Me a Coffee at ko-fi.com -Donate using Liberapay -Become my sponsor - -### Mergo in the wild - -- [moby/moby](https://github.com/moby/moby) -- [kubernetes/kubernetes](https://github.com/kubernetes/kubernetes) -- [vmware/dispatch](https://github.com/vmware/dispatch) -- [Shopify/themekit](https://github.com/Shopify/themekit) -- [imdario/zas](https://github.com/imdario/zas) -- [matcornic/hermes](https://github.com/matcornic/hermes) -- [OpenBazaar/openbazaar-go](https://github.com/OpenBazaar/openbazaar-go) -- [kataras/iris](https://github.com/kataras/iris) -- [michaelsauter/crane](https://github.com/michaelsauter/crane) -- [go-task/task](https://github.com/go-task/task) -- [sensu/uchiwa](https://github.com/sensu/uchiwa) -- [ory/hydra](https://github.com/ory/hydra) -- [sisatech/vcli](https://github.com/sisatech/vcli) -- [dairycart/dairycart](https://github.com/dairycart/dairycart) -- [projectcalico/felix](https://github.com/projectcalico/felix) -- [resin-os/balena](https://github.com/resin-os/balena) -- [go-kivik/kivik](https://github.com/go-kivik/kivik) -- [Telefonica/govice](https://github.com/Telefonica/govice) -- [supergiant/supergiant](supergiant/supergiant) -- [SergeyTsalkov/brooce](https://github.com/SergeyTsalkov/brooce) -- [soniah/dnsmadeeasy](https://github.com/soniah/dnsmadeeasy) -- [ohsu-comp-bio/funnel](https://github.com/ohsu-comp-bio/funnel) -- [EagerIO/Stout](https://github.com/EagerIO/Stout) -- [lynndylanhurley/defsynth-api](https://github.com/lynndylanhurley/defsynth-api) -- [russross/canvasassignments](https://github.com/russross/canvasassignments) -- [rdegges/cryptly-api](https://github.com/rdegges/cryptly-api) -- [casualjim/exeggutor](https://github.com/casualjim/exeggutor) -- [divshot/gitling](https://github.com/divshot/gitling) -- [RWJMurphy/gorl](https://github.com/RWJMurphy/gorl) -- [andrerocker/deploy42](https://github.com/andrerocker/deploy42) -- [elwinar/rambler](https://github.com/elwinar/rambler) -- [tmaiaroto/gopartman](https://github.com/tmaiaroto/gopartman) -- [jfbus/impressionist](https://github.com/jfbus/impressionist) -- [Jmeyering/zealot](https://github.com/Jmeyering/zealot) -- [godep-migrator/rigger-host](https://github.com/godep-migrator/rigger-host) -- [Dronevery/MultiwaySwitch-Go](https://github.com/Dronevery/MultiwaySwitch-Go) -- [thoas/picfit](https://github.com/thoas/picfit) -- [mantasmatelis/whooplist-server](https://github.com/mantasmatelis/whooplist-server) -- [jnuthong/item_search](https://github.com/jnuthong/item_search) -- [bukalapak/snowboard](https://github.com/bukalapak/snowboard) -- [containerssh/containerssh](https://github.com/containerssh/containerssh) -- [goreleaser/goreleaser](https://github.com/goreleaser/goreleaser) -- [tjpnz/structbot](https://github.com/tjpnz/structbot) - -## Install - - go get dario.cat/mergo - - // use in your .go code - import ( - "dario.cat/mergo" - ) - -## Usage - -You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as [they are zero values](https://golang.org/ref/spec#The_zero_value) too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). - -```go -if err := mergo.Merge(&dst, src); err != nil { - // ... -} -``` - -Also, you can merge overwriting values using the transformer `WithOverride`. - -```go -if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { - // ... -} -``` - -Additionally, you can map a `map[string]interface{}` to a struct (and otherwise, from struct to map), following the same restrictions as in `Merge()`. Keys are capitalized to find each corresponding exported field. - -```go -if err := mergo.Map(&dst, srcMap); err != nil { - // ... -} -``` - -Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as `map[string]interface{}`. They will be just assigned as values. - -Here is a nice example: - -```go -package main - -import ( - "fmt" - "dario.cat/mergo" -) - -type Foo struct { - A string - B int64 -} - -func main() { - src := Foo{ - A: "one", - B: 2, - } - dest := Foo{ - A: "two", - } - mergo.Merge(&dest, src) - fmt.Println(dest) - // Will print - // {two 2} -} -``` - -Note: if test are failing due missing package, please execute: - - go get gopkg.in/yaml.v3 - -### Transformers - -Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, `time.Time` is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero `time.Time`? - -```go -package main - -import ( - "fmt" - "dario.cat/mergo" - "reflect" - "time" -) - -type timeTransformer struct { -} - -func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { - if typ == reflect.TypeOf(time.Time{}) { - return func(dst, src reflect.Value) error { - if dst.CanSet() { - isZero := dst.MethodByName("IsZero") - result := isZero.Call([]reflect.Value{}) - if result[0].Bool() { - dst.Set(src) - } - } - return nil - } - } - return nil -} - -type Snapshot struct { - Time time.Time - // ... -} - -func main() { - src := Snapshot{time.Now()} - dest := Snapshot{} - mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) - fmt.Println(dest) - // Will print - // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } -} -``` - -## Contact me - -If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): [@im_dario](https://twitter.com/im_dario) - -## About - -Written by [Dario Castañé](http://dario.im). - -## License - -[BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) license, as [Go language](http://golang.org/LICENSE). - -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fimdario%2Fmergo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fimdario%2Fmergo?ref=badge_large) diff --git a/vendor/dario.cat/mergo/SECURITY.md b/vendor/dario.cat/mergo/SECURITY.md deleted file mode 100644 index a5de61f77b..0000000000 --- a/vendor/dario.cat/mergo/SECURITY.md +++ /dev/null @@ -1,14 +0,0 @@ -# Security Policy - -## Supported Versions - -| Version | Supported | -| ------- | ------------------ | -| 0.3.x | :white_check_mark: | -| < 0.3 | :x: | - -## Security contact information - -To report a security vulnerability, please use the -[Tidelift security contact](https://tidelift.com/security). -Tidelift will coordinate the fix and disclosure. diff --git a/vendor/dario.cat/mergo/doc.go b/vendor/dario.cat/mergo/doc.go deleted file mode 100644 index 7d96ec0546..0000000000 --- a/vendor/dario.cat/mergo/doc.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -A helper to merge structs and maps in Golang. Useful for configuration default values, avoiding messy if-statements. - -Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). - -# Status - -It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc. - -# Important notes - -1.0.0 - -In 1.0.0 Mergo moves to a vanity URL `dario.cat/mergo`. - -0.3.9 - -Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules. - -Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code. - -If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u dario.cat/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). - -# Install - -Do your usual installation procedure: - - go get dario.cat/mergo - - // use in your .go code - import ( - "dario.cat/mergo" - ) - -# Usage - -You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). - - if err := mergo.Merge(&dst, src); err != nil { - // ... - } - -Also, you can merge overwriting values using the transformer WithOverride. - - if err := mergo.Merge(&dst, src, mergo.WithOverride); err != nil { - // ... - } - -Additionally, you can map a map[string]interface{} to a struct (and otherwise, from struct to map), following the same restrictions as in Merge(). Keys are capitalized to find each corresponding exported field. - - if err := mergo.Map(&dst, srcMap); err != nil { - // ... - } - -Warning: if you map a struct to map, it won't do it recursively. Don't expect Mergo to map struct members of your struct as map[string]interface{}. They will be just assigned as values. - -Here is a nice example: - - package main - - import ( - "fmt" - "dario.cat/mergo" - ) - - type Foo struct { - A string - B int64 - } - - func main() { - src := Foo{ - A: "one", - B: 2, - } - dest := Foo{ - A: "two", - } - mergo.Merge(&dest, src) - fmt.Println(dest) - // Will print - // {two 2} - } - -# Transformers - -Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time? - - package main - - import ( - "fmt" - "dario.cat/mergo" - "reflect" - "time" - ) - - type timeTransformer struct { - } - - func (t timeTransformer) Transformer(typ reflect.Type) func(dst, src reflect.Value) error { - if typ == reflect.TypeOf(time.Time{}) { - return func(dst, src reflect.Value) error { - if dst.CanSet() { - isZero := dst.MethodByName("IsZero") - result := isZero.Call([]reflect.Value{}) - if result[0].Bool() { - dst.Set(src) - } - } - return nil - } - } - return nil - } - - type Snapshot struct { - Time time.Time - // ... - } - - func main() { - src := Snapshot{time.Now()} - dest := Snapshot{} - mergo.Merge(&dest, src, mergo.WithTransformers(timeTransformer{})) - fmt.Println(dest) - // Will print - // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } - } - -# Contact me - -If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario - -# About - -Written by Dario Castañé: https://da.rio.hn - -# License - -BSD 3-Clause license, as Go language. -*/ -package mergo diff --git a/vendor/dario.cat/mergo/map.go b/vendor/dario.cat/mergo/map.go deleted file mode 100644 index b50d5c2a4e..0000000000 --- a/vendor/dario.cat/mergo/map.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2014 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "fmt" - "reflect" - "unicode" - "unicode/utf8" -) - -func changeInitialCase(s string, mapper func(rune) rune) string { - if s == "" { - return s - } - r, n := utf8.DecodeRuneInString(s) - return string(mapper(r)) + s[n:] -} - -func isExported(field reflect.StructField) bool { - r, _ := utf8.DecodeRuneInString(field.Name) - return r >= 'A' && r <= 'Z' -} - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { - overwrite := config.Overwrite - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{typ, seen, addr} - } - zeroValue := reflect.Value{} - switch dst.Kind() { - case reflect.Map: - dstMap := dst.Interface().(map[string]interface{}) - for i, n := 0, src.NumField(); i < n; i++ { - srcType := src.Type() - field := srcType.Field(i) - if !isExported(field) { - continue - } - fieldName := field.Name - fieldName = changeInitialCase(fieldName, unicode.ToLower) - if v, ok := dstMap[fieldName]; !ok || (isEmptyValue(reflect.ValueOf(v), !config.ShouldNotDereference) || overwrite) { - dstMap[fieldName] = src.Field(i).Interface() - } - } - case reflect.Ptr: - if dst.IsNil() { - v := reflect.New(dst.Type().Elem()) - dst.Set(v) - } - dst = dst.Elem() - fallthrough - case reflect.Struct: - srcMap := src.Interface().(map[string]interface{}) - for key := range srcMap { - config.overwriteWithEmptyValue = true - srcValue := srcMap[key] - fieldName := changeInitialCase(key, unicode.ToUpper) - dstElement := dst.FieldByName(fieldName) - if dstElement == zeroValue { - // We discard it because the field doesn't exist. - continue - } - srcElement := reflect.ValueOf(srcValue) - dstKind := dstElement.Kind() - srcKind := srcElement.Kind() - if srcKind == reflect.Ptr && dstKind != reflect.Ptr { - srcElement = srcElement.Elem() - srcKind = reflect.TypeOf(srcElement.Interface()).Kind() - } else if dstKind == reflect.Ptr { - // Can this work? I guess it can't. - if srcKind != reflect.Ptr && srcElement.CanAddr() { - srcPtr := srcElement.Addr() - srcElement = reflect.ValueOf(srcPtr) - srcKind = reflect.Ptr - } - } - - if !srcElement.IsValid() { - continue - } - if srcKind == dstKind { - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { - return - } - } else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface { - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { - return - } - } else if srcKind == reflect.Map { - if err = deepMap(dstElement, srcElement, visited, depth+1, config); err != nil { - return - } - } else { - return fmt.Errorf("type mismatch on %s field: found %v, expected %v", fieldName, srcKind, dstKind) - } - } - } - return -} - -// Map sets fields' values in dst from src. -// src can be a map with string keys or a struct. dst must be the opposite: -// if src is a map, dst must be a valid pointer to struct. If src is a struct, -// dst must be map[string]interface{}. -// It won't merge unexported (private) fields and will do recursively -// any exported field. -// If dst is a map, keys will be src fields' names in lower camel case. -// Missing key in src that doesn't match a field in dst will be skipped. This -// doesn't apply if dst is a map. -// This is separated method from Merge because it is cleaner and it keeps sane -// semantics: merging equal types, mapping different (restricted) types. -func Map(dst, src interface{}, opts ...func(*Config)) error { - return _map(dst, src, opts...) -} - -// MapWithOverwrite will do the same as Map except that non-empty dst attributes will be overridden by -// non-empty src attribute values. -// Deprecated: Use Map(…) with WithOverride -func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { - return _map(dst, src, append(opts, WithOverride)...) -} - -func _map(dst, src interface{}, opts ...func(*Config)) error { - if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { - return ErrNonPointerArgument - } - var ( - vDst, vSrc reflect.Value - err error - ) - config := &Config{} - - for _, opt := range opts { - opt(config) - } - - if vDst, vSrc, err = resolveValues(dst, src); err != nil { - return err - } - // To be friction-less, we redirect equal-type arguments - // to deepMerge. Only because arguments can be anything. - if vSrc.Kind() == vDst.Kind() { - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) - } - switch vSrc.Kind() { - case reflect.Struct: - if vDst.Kind() != reflect.Map { - return ErrExpectedMapAsDestination - } - case reflect.Map: - if vDst.Kind() != reflect.Struct { - return ErrExpectedStructAsDestination - } - default: - return ErrNotSupported - } - return deepMap(vDst, vSrc, make(map[uintptr]*visit), 0, config) -} diff --git a/vendor/dario.cat/mergo/merge.go b/vendor/dario.cat/mergo/merge.go deleted file mode 100644 index 0ef9b2138c..0000000000 --- a/vendor/dario.cat/mergo/merge.go +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "fmt" - "reflect" -) - -func hasMergeableFields(dst reflect.Value) (exported bool) { - for i, n := 0, dst.NumField(); i < n; i++ { - field := dst.Type().Field(i) - if field.Anonymous && dst.Field(i).Kind() == reflect.Struct { - exported = exported || hasMergeableFields(dst.Field(i)) - } else if isExportedComponent(&field) { - exported = exported || len(field.PkgPath) == 0 - } - } - return -} - -func isExportedComponent(field *reflect.StructField) bool { - pkgPath := field.PkgPath - if len(pkgPath) > 0 { - return false - } - c := field.Name[0] - if 'a' <= c && c <= 'z' || c == '_' { - return false - } - return true -} - -type Config struct { - Transformers Transformers - Overwrite bool - ShouldNotDereference bool - AppendSlice bool - TypeCheck bool - overwriteWithEmptyValue bool - overwriteSliceWithEmptyValue bool - sliceDeepCopy bool - debug bool -} - -type Transformers interface { - Transformer(reflect.Type) func(dst, src reflect.Value) error -} - -// Traverses recursively both values, assigning src's fields values to dst. -// The map argument tracks comparisons that have already been seen, which allows -// short circuiting on recursive types. -func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, config *Config) (err error) { - overwrite := config.Overwrite - typeCheck := config.TypeCheck - overwriteWithEmptySrc := config.overwriteWithEmptyValue - overwriteSliceWithEmptySrc := config.overwriteSliceWithEmptyValue - sliceDeepCopy := config.sliceDeepCopy - - if !src.IsValid() { - return - } - if dst.CanAddr() { - addr := dst.UnsafeAddr() - h := 17 * addr - seen := visited[h] - typ := dst.Type() - for p := seen; p != nil; p = p.next { - if p.ptr == addr && p.typ == typ { - return nil - } - } - // Remember, remember... - visited[h] = &visit{typ, seen, addr} - } - - if config.Transformers != nil && !isReflectNil(dst) && dst.IsValid() { - if fn := config.Transformers.Transformer(dst.Type()); fn != nil { - err = fn(dst, src) - return - } - } - - switch dst.Kind() { - case reflect.Struct: - if hasMergeableFields(dst) { - for i, n := 0, dst.NumField(); i < n; i++ { - if err = deepMerge(dst.Field(i), src.Field(i), visited, depth+1, config); err != nil { - return - } - } - } else { - if dst.CanSet() && (isReflectNil(dst) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc) { - dst.Set(src) - } - } - case reflect.Map: - if dst.IsNil() && !src.IsNil() { - if dst.CanSet() { - dst.Set(reflect.MakeMap(dst.Type())) - } else { - dst = src - return - } - } - - if src.Kind() != reflect.Map { - if overwrite && dst.CanSet() { - dst.Set(src) - } - return - } - - for _, key := range src.MapKeys() { - srcElement := src.MapIndex(key) - if !srcElement.IsValid() { - continue - } - dstElement := dst.MapIndex(key) - switch srcElement.Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Interface, reflect.Slice: - if srcElement.IsNil() { - if overwrite { - dst.SetMapIndex(key, srcElement) - } - continue - } - fallthrough - default: - if !srcElement.CanInterface() { - continue - } - switch reflect.TypeOf(srcElement.Interface()).Kind() { - case reflect.Struct: - fallthrough - case reflect.Ptr: - fallthrough - case reflect.Map: - srcMapElm := srcElement - dstMapElm := dstElement - if srcMapElm.CanInterface() { - srcMapElm = reflect.ValueOf(srcMapElm.Interface()) - if dstMapElm.IsValid() { - dstMapElm = reflect.ValueOf(dstMapElm.Interface()) - } - } - if err = deepMerge(dstMapElm, srcMapElm, visited, depth+1, config); err != nil { - return - } - case reflect.Slice: - srcSlice := reflect.ValueOf(srcElement.Interface()) - - var dstSlice reflect.Value - if !dstElement.IsValid() || dstElement.IsNil() { - dstSlice = reflect.MakeSlice(srcSlice.Type(), 0, srcSlice.Len()) - } else { - dstSlice = reflect.ValueOf(dstElement.Interface()) - } - - if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy { - if typeCheck && srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot override two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } - dstSlice = srcSlice - } else if config.AppendSlice { - if srcSlice.Type() != dstSlice.Type() { - return fmt.Errorf("cannot append two slices with different type (%s, %s)", srcSlice.Type(), dstSlice.Type()) - } - dstSlice = reflect.AppendSlice(dstSlice, srcSlice) - } else if sliceDeepCopy { - i := 0 - for ; i < srcSlice.Len() && i < dstSlice.Len(); i++ { - srcElement := srcSlice.Index(i) - dstElement := dstSlice.Index(i) - - if srcElement.CanInterface() { - srcElement = reflect.ValueOf(srcElement.Interface()) - } - if dstElement.CanInterface() { - dstElement = reflect.ValueOf(dstElement.Interface()) - } - - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { - return - } - } - - } - dst.SetMapIndex(key, dstSlice) - } - } - - if dstElement.IsValid() && !isEmptyValue(dstElement, !config.ShouldNotDereference) { - if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Slice { - continue - } - if reflect.TypeOf(srcElement.Interface()).Kind() == reflect.Map && reflect.TypeOf(dstElement.Interface()).Kind() == reflect.Map { - continue - } - } - - if srcElement.IsValid() && ((srcElement.Kind() != reflect.Ptr && overwrite) || !dstElement.IsValid() || isEmptyValue(dstElement, !config.ShouldNotDereference)) { - if dst.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) - } - dst.SetMapIndex(key, srcElement) - } - } - - // Ensure that all keys in dst are deleted if they are not in src. - if overwriteWithEmptySrc { - for _, key := range dst.MapKeys() { - srcElement := src.MapIndex(key) - if !srcElement.IsValid() { - dst.SetMapIndex(key, reflect.Value{}) - } - } - } - case reflect.Slice: - if !dst.CanSet() { - break - } - if (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc || overwriteSliceWithEmptySrc) && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) && !config.AppendSlice && !sliceDeepCopy { - dst.Set(src) - } else if config.AppendSlice { - if src.Type() != dst.Type() { - return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type()) - } - dst.Set(reflect.AppendSlice(dst, src)) - } else if sliceDeepCopy { - for i := 0; i < src.Len() && i < dst.Len(); i++ { - srcElement := src.Index(i) - dstElement := dst.Index(i) - if srcElement.CanInterface() { - srcElement = reflect.ValueOf(srcElement.Interface()) - } - if dstElement.CanInterface() { - dstElement = reflect.ValueOf(dstElement.Interface()) - } - - if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil { - return - } - } - } - case reflect.Ptr: - fallthrough - case reflect.Interface: - if isReflectNil(src) { - if overwriteWithEmptySrc && dst.CanSet() && src.Type().AssignableTo(dst.Type()) { - dst.Set(src) - } - break - } - - if src.Kind() != reflect.Interface { - if dst.IsNil() || (src.Kind() != reflect.Ptr && overwrite) { - if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) { - dst.Set(src) - } - } else if src.Kind() == reflect.Ptr { - if !config.ShouldNotDereference { - if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { - return - } - } else { - if overwriteWithEmptySrc || (overwrite && !src.IsNil()) || dst.IsNil() { - dst.Set(src) - } - } - } else if dst.Elem().Type() == src.Type() { - if err = deepMerge(dst.Elem(), src, visited, depth+1, config); err != nil { - return - } - } else { - return ErrDifferentArgumentsTypes - } - break - } - - if dst.IsNil() || overwrite { - if dst.CanSet() && (overwrite || isEmptyValue(dst, !config.ShouldNotDereference)) { - dst.Set(src) - } - break - } - - if dst.Elem().Kind() == src.Elem().Kind() { - if err = deepMerge(dst.Elem(), src.Elem(), visited, depth+1, config); err != nil { - return - } - break - } - default: - mustSet := (isEmptyValue(dst, !config.ShouldNotDereference) || overwrite) && (!isEmptyValue(src, !config.ShouldNotDereference) || overwriteWithEmptySrc) - if mustSet { - if dst.CanSet() { - dst.Set(src) - } else { - dst = src - } - } - } - - return -} - -// Merge will fill any empty for value type attributes on the dst struct using corresponding -// src attributes if they themselves are not empty. dst and src must be valid same-type structs -// and dst must be a pointer to struct. -// It won't merge unexported (private) fields and will do recursively any exported field. -func Merge(dst, src interface{}, opts ...func(*Config)) error { - return merge(dst, src, opts...) -} - -// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by -// non-empty src attribute values. -// Deprecated: use Merge(…) with WithOverride -func MergeWithOverwrite(dst, src interface{}, opts ...func(*Config)) error { - return merge(dst, src, append(opts, WithOverride)...) -} - -// WithTransformers adds transformers to merge, allowing to customize the merging of some types. -func WithTransformers(transformers Transformers) func(*Config) { - return func(config *Config) { - config.Transformers = transformers - } -} - -// WithOverride will make merge override non-empty dst attributes with non-empty src attributes values. -func WithOverride(config *Config) { - config.Overwrite = true -} - -// WithOverwriteWithEmptyValue will make merge override non empty dst attributes with empty src attributes values. -func WithOverwriteWithEmptyValue(config *Config) { - config.Overwrite = true - config.overwriteWithEmptyValue = true -} - -// WithOverrideEmptySlice will make merge override empty dst slice with empty src slice. -func WithOverrideEmptySlice(config *Config) { - config.overwriteSliceWithEmptyValue = true -} - -// WithoutDereference prevents dereferencing pointers when evaluating whether they are empty -// (i.e. a non-nil pointer is never considered empty). -func WithoutDereference(config *Config) { - config.ShouldNotDereference = true -} - -// WithAppendSlice will make merge append slices instead of overwriting it. -func WithAppendSlice(config *Config) { - config.AppendSlice = true -} - -// WithTypeCheck will make merge check types while overwriting it (must be used with WithOverride). -func WithTypeCheck(config *Config) { - config.TypeCheck = true -} - -// WithSliceDeepCopy will merge slice element one by one with Overwrite flag. -func WithSliceDeepCopy(config *Config) { - config.sliceDeepCopy = true - config.Overwrite = true -} - -func merge(dst, src interface{}, opts ...func(*Config)) error { - if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr { - return ErrNonPointerArgument - } - var ( - vDst, vSrc reflect.Value - err error - ) - - config := &Config{} - - for _, opt := range opts { - opt(config) - } - - if vDst, vSrc, err = resolveValues(dst, src); err != nil { - return err - } - if vDst.Type() != vSrc.Type() { - return ErrDifferentArgumentsTypes - } - return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config) -} - -// IsReflectNil is the reflect value provided nil -func isReflectNil(v reflect.Value) bool { - k := v.Kind() - switch k { - case reflect.Interface, reflect.Slice, reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr: - // Both interface and slice are nil if first word is 0. - // Both are always bigger than a word; assume flagIndir. - return v.IsNil() - default: - return false - } -} diff --git a/vendor/dario.cat/mergo/mergo.go b/vendor/dario.cat/mergo/mergo.go deleted file mode 100644 index 0a721e2d85..0000000000 --- a/vendor/dario.cat/mergo/mergo.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2013 Dario Castañé. All rights reserved. -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Based on src/pkg/reflect/deepequal.go from official -// golang's stdlib. - -package mergo - -import ( - "errors" - "reflect" -) - -// Errors reported by Mergo when it finds invalid arguments. -var ( - ErrNilArguments = errors.New("src and dst must not be nil") - ErrDifferentArgumentsTypes = errors.New("src and dst must be of same type") - ErrNotSupported = errors.New("only structs, maps, and slices are supported") - ErrExpectedMapAsDestination = errors.New("dst was expected to be a map") - ErrExpectedStructAsDestination = errors.New("dst was expected to be a struct") - ErrNonPointerArgument = errors.New("dst must be a pointer") -) - -// During deepMerge, must keep track of checks that are -// in progress. The comparison algorithm assumes that all -// checks in progress are true when it reencounters them. -// Visited are stored in a map indexed by 17 * a1 + a2; -type visit struct { - typ reflect.Type - next *visit - ptr uintptr -} - -// From src/pkg/encoding/json/encode.go. -func isEmptyValue(v reflect.Value, shouldDereference bool) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - if v.IsNil() { - return true - } - if shouldDereference { - return isEmptyValue(v.Elem(), shouldDereference) - } - return false - case reflect.Func: - return v.IsNil() - case reflect.Invalid: - return true - } - return false -} - -func resolveValues(dst, src interface{}) (vDst, vSrc reflect.Value, err error) { - if dst == nil || src == nil { - err = ErrNilArguments - return - } - vDst = reflect.ValueOf(dst).Elem() - if vDst.Kind() != reflect.Struct && vDst.Kind() != reflect.Map && vDst.Kind() != reflect.Slice { - err = ErrNotSupported - return - } - vSrc = reflect.ValueOf(src) - // We check if vSrc is a pointer to dereference it. - if vSrc.Kind() == reflect.Ptr { - vSrc = vSrc.Elem() - } - return -} diff --git a/vendor/github.com/4meepo/tagalign/.gitignore b/vendor/github.com/4meepo/tagalign/.gitignore deleted file mode 100644 index e37bb52e49..0000000000 --- a/vendor/github.com/4meepo/tagalign/.gitignore +++ /dev/null @@ -1,75 +0,0 @@ -# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig -# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,go -# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,go - -### Go ### -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -.vscode - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### macOS Patch ### -# iCloud generated files -*.icloud - -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,go - -# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) diff --git a/vendor/github.com/4meepo/tagalign/.golangci.yml b/vendor/github.com/4meepo/tagalign/.golangci.yml deleted file mode 100644 index e65f604fe1..0000000000 --- a/vendor/github.com/4meepo/tagalign/.golangci.yml +++ /dev/null @@ -1,106 +0,0 @@ -# See https://golangci-lint.run/usage/configuration/ - -linters-settings: - revive: - # see https://github.com/mgechev/revive#available-rules for details. - ignore-generated-header: true - severity: warning - rules: - - name: atomic - - name: blank-imports - - name: bool-literal-in-expr - - name: call-to-gc - - name: confusing-naming - - name: confusing-results - - name: constant-logical-expr - - name: context-as-argument - - name: context-keys-type - - name: deep-exit - - name: defer - - name: dot-imports - - name: duplicated-imports - - name: early-return - - name: empty-block - - name: empty-lines - - name: error-naming - - name: error-return - - name: error-strings - - name: errorf - - name: exported - - name: get-return - - name: identical-branches - - name: if-return - - name: import-shadowing - - name: increment-decrement - - name: indent-error-flow - - name: modifies-parameter - - name: modifies-value-receiver - - name: package-comments - - name: range - - name: range-val-address - - name: range-val-in-closure - - name: receiver-naming - - name: redefines-builtin-id - - name: string-of-int - - name: superfluous-else - - name: time-naming - - name: unconditional-recursion - - name: unexported-naming - - name: unexported-return - - name: unnecessary-stmt - - name: unreachable-code - - name: unused-parameter - - name: var-declaration - - name: var-naming - - name: waitgroup-by-value - -linters: - disable-all: true - enable: - - asciicheck - - bodyclose - - dogsled - - dupl - - durationcheck - - errcheck - - errorlint - - exhaustive - - exportloopref - - forcetypeassert - - gochecknoinits - - gocognit - - goconst - - gocritic - - gocyclo - - godot - - godox - - goimports - - gomoddirectives - - gomodguard - - goprintffuncname - - gosec - - gosimple - # - govet - - importas - - ineffassign - - makezero - - misspell - - nakedret - - nestif - - nilerr - - noctx - - nolintlint - - prealloc - - predeclared - - revive - - rowserrcheck - - sqlclosecheck - - staticcheck - - stylecheck - - thelper - - tparallel - - typecheck - - unconvert - - unparam - - unused - - whitespace diff --git a/vendor/github.com/4meepo/tagalign/.goreleaser.yml b/vendor/github.com/4meepo/tagalign/.goreleaser.yml deleted file mode 100644 index e7b6f6800e..0000000000 --- a/vendor/github.com/4meepo/tagalign/.goreleaser.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -project_name: tagalign - -release: - github: - owner: 4meepo - name: tagalign - -builds: - - binary: tagalign - goos: - - darwin - - windows - - linux - - freebsd - goarch: - - amd64 - - arm64 - - arm - goarm: - - 6 - - 7 - gomips: - - hardfloat - env: - - CGO_ENABLED=0 - ignore: - - goos: darwin - goarch: 386 - - goos: freebsd - goarch: arm64 - main: ./cmd/tagalign/ \ No newline at end of file diff --git a/vendor/github.com/4meepo/tagalign/LICENSE b/vendor/github.com/4meepo/tagalign/LICENSE deleted file mode 100644 index da3ae82706..0000000000 --- a/vendor/github.com/4meepo/tagalign/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Yifei Liu - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/4meepo/tagalign/Makefile b/vendor/github.com/4meepo/tagalign/Makefile deleted file mode 100644 index 614e7773c3..0000000000 --- a/vendor/github.com/4meepo/tagalign/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -.PHONY: lint -lint: - golangci-lint run ./... - -.PHONY: build -build: - go build -o tagalign cmd/tagalign/tagalign.go \ No newline at end of file diff --git a/vendor/github.com/4meepo/tagalign/README.md b/vendor/github.com/4meepo/tagalign/README.md deleted file mode 100644 index 9d04dccbf2..0000000000 --- a/vendor/github.com/4meepo/tagalign/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# Go Tag Align - -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/4meepo/tagalign?style=flat-square) -[![codecov](https://codecov.io/github/4meepo/tagalign/branch/main/graph/badge.svg?token=1R1T61UNBQ)](https://codecov.io/github/4meepo/tagalign) -[![GoDoc](https://godoc.org/github.com/4meepo/tagalign?status.svg)](https://pkg.go.dev/github.com/4meepo/tagalign) -[![Go Report Card](https://goreportcard.com/badge/github.com/4meepo/tagalign)](https://goreportcard.com/report/github.com/4meepo/tagalign) - -TagAlign is used to align and sort tags in Go struct. It can make the struct more readable and easier to maintain. - -For example, this struct - -```go -type FooBar struct { - Foo int `json:"foo" validate:"required"` - Bar string `json:"bar" validate:"required"` - FooFoo int8 `json:"foo_foo" validate:"required"` - BarBar int `json:"bar_bar" validate:"required"` - FooBar struct { - Foo int `json:"foo" yaml:"foo" validate:"required"` - Bar222 string `json:"bar222" validate:"required" yaml:"bar"` - } `json:"foo_bar" validate:"required"` - BarFoo string `json:"bar_foo" validate:"required"` - BarFooBar string `json:"bar_foo_bar" validate:"required"` -} -``` - -can be aligned to: - -```go -type FooBar struct { - Foo int `json:"foo" validate:"required"` - Bar string `json:"bar" validate:"required"` - FooFoo int8 `json:"foo_foo" validate:"required"` - BarBar int `json:"bar_bar" validate:"required"` - FooBar struct { - Foo int `json:"foo" yaml:"foo" validate:"required"` - Bar222 string `json:"bar222" validate:"required" yaml:"bar"` - } `json:"foo_bar" validate:"required"` - BarFoo string `json:"bar_foo" validate:"required"` - BarFooBar string `json:"bar_foo_bar" validate:"required"` -} -``` - -## Usage - -By default tagalign will only align tags, but not sort them. But alignment and [sort feature](https://github.com/4meepo/tagalign#sort-tag) can work together or separately. - -* As a Golangci Linter (Recommended) - - Tagalign is a built-in linter in [Golangci Lint](https://golangci-lint.run/usage/linters/#tagalign) since `v1.53`. - > Note: In order to have the best experience, add the `--fix` flag to `golangci-lint` to enable the autofix feature. - -* Standalone Mode - - Install it using `GO` or download it [here](https://github.com/4meepo/tagalign/releases). - - ```bash - go install github.com/4meepo/tagalign/cmd/tagalign@latest - ``` - - Run it in your terminal. - - ```bash - # Only align tags. - tagalign -fix {package path} - # Only sort tags with fixed order. - tagalign -fix -noalign -sort -order "json,xml" {package path} - # Align and sort together. - tagalign -fix -sort -order "json,xml" {package path} - # Align and sort together in strict style. - tagalign -fix -sort -order "json,xml" -strict {package path} - ``` - -## Advanced Features - -### Sort Tag - -In addition to alignment, it can also sort tags with fixed order. If we enable sort with fixed order `json,xml`, the following code - -```go -type SortExample struct { - Foo int `json:"foo,omitempty" yaml:"bar" xml:"baz" binding:"required" gorm:"column:foo" zip:"foo" validate:"required"` - Bar int `validate:"required" yaml:"foo" xml:"bar" binding:"required" json:"bar,omitempty" gorm:"column:bar" zip:"bar" ` - FooBar int `gorm:"column:bar" validate:"required" xml:"bar" binding:"required" json:"bar,omitempty" zip:"bar" yaml:"foo"` -} -``` - -will be sorted and aligned to: - -```go -type SortExample struct { - Foo int `json:"foo,omitempty" xml:"baz" binding:"required" gorm:"column:foo" validate:"required" yaml:"bar" zip:"foo"` - Bar int `json:"bar,omitempty" xml:"bar" binding:"required" gorm:"column:bar" validate:"required" yaml:"foo" zip:"bar"` - FooBar int `json:"bar,omitempty" xml:"bar" binding:"required" gorm:"column:bar" validate:"required" yaml:"foo" zip:"bar"` -} -``` - -The fixed order is `json,xml`, so the tags `json` and `xml` will be sorted and aligned first, and the rest tags will be sorted and aligned in the dictionary order. - -### Strict Style - -Sometimes, you may want to align your tags in strict style. In this style, the tags will be sorted and aligned in the dictionary order, and the tags with the same name will be aligned together. For example, the following code - -```go -type StrictStyleExample struct { - Foo int ` xml:"baz" yaml:"bar" zip:"foo" binding:"required" gorm:"column:foo" validate:"required"` - Bar int `validate:"required" gorm:"column:bar" yaml:"foo" xml:"bar" binding:"required" json:"bar,omitempty" ` -} -``` - -will be aligned to - -```go -type StrictStyleExample struct { - Foo int `binding:"required" gorm:"column:foo" validate:"required" xml:"baz" yaml:"bar" zip:"foo"` - Bar int `binding:"required" gorm:"column:bar" json:"bar,omitempty" validate:"required" xml:"bar" yaml:"foo"` -} -``` - -> ⚠️Note: The strict style can't run without the align or sort feature enabled. - -## References - -[Golang AST Visualizer](http://goast.yuroyoro.net/) - -[Create New Golang CI Linter](https://golangci-lint.run/contributing/new-linters/) - -[Autofix Example](https://github.com/golangci/golangci-lint/pull/2450/files) - -[Integrating](https://disaev.me/p/writing-useful-go-analysis-linter/#integrating) diff --git a/vendor/github.com/4meepo/tagalign/options.go b/vendor/github.com/4meepo/tagalign/options.go deleted file mode 100644 index ddec98da73..0000000000 --- a/vendor/github.com/4meepo/tagalign/options.go +++ /dev/null @@ -1,37 +0,0 @@ -package tagalign - -type Option func(*Helper) - -// WithMode specify the mode of tagalign. -func WithMode(mode Mode) Option { - return func(h *Helper) { - h.mode = mode - } -} - -// WithSort enable tags sort. -// fixedOrder specify the order of tags, the other tags will be sorted by name. -// Sory is disabled by default. -func WithSort(fixedOrder ...string) Option { - return func(h *Helper) { - h.sort = true - h.fixedTagOrder = fixedOrder - } -} - -// WithAlign configure whether enable tags align. -// Align is enabled by default. -func WithAlign(enabled bool) Option { - return func(h *Helper) { - h.align = enabled - } -} - -// WithStrictStyle configure whether enable strict style. -// StrictStyle is disabled by default. -// Note: StrictStyle must be used with WithAlign(true) and WithSort(...) together, or it will be ignored. -func WithStrictStyle() Option { - return func(h *Helper) { - h.style = StrictStyle - } -} diff --git a/vendor/github.com/4meepo/tagalign/tagalign.go b/vendor/github.com/4meepo/tagalign/tagalign.go deleted file mode 100644 index 4734b56661..0000000000 --- a/vendor/github.com/4meepo/tagalign/tagalign.go +++ /dev/null @@ -1,459 +0,0 @@ -package tagalign - -import ( - "fmt" - "go/ast" - "go/token" - "log" - "reflect" - "sort" - "strconv" - "strings" - - "github.com/fatih/structtag" - - "golang.org/x/tools/go/analysis" -) - -type Mode int - -const ( - StandaloneMode Mode = iota - GolangciLintMode -) - -type Style int - -const ( - DefaultStyle Style = iota - StrictStyle -) - -const ( - errTagValueSyntax = "bad syntax for struct tag value" -) - -func NewAnalyzer(options ...Option) *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "tagalign", - Doc: "check that struct tags are well aligned", - Run: func(p *analysis.Pass) (any, error) { - Run(p, options...) - return nil, nil - }, - } -} - -func Run(pass *analysis.Pass, options ...Option) []Issue { - var issues []Issue - for _, f := range pass.Files { - h := &Helper{ - mode: StandaloneMode, - style: DefaultStyle, - align: true, - } - for _, opt := range options { - opt(h) - } - - // StrictStyle must be used with WithAlign(true) and WithSort(...) together, or it will be ignored. - if h.style == StrictStyle && (!h.align || !h.sort) { - h.style = DefaultStyle - } - - if !h.align && !h.sort { - // do nothing - return nil - } - - ast.Inspect(f, func(n ast.Node) bool { - h.find(pass, n) - return true - }) - h.Process(pass) - issues = append(issues, h.issues...) - } - return issues -} - -type Helper struct { - mode Mode - - style Style - - align bool // whether enable tags align. - sort bool // whether enable tags sort. - fixedTagOrder []string // the order of tags, the other tags will be sorted by name. - - singleFields []*ast.Field - consecutiveFieldsGroups [][]*ast.Field // fields in this group, must be consecutive in struct. - issues []Issue -} - -// Issue is used to integrate with golangci-lint's inline auto fix. -type Issue struct { - Pos token.Position - Message string - InlineFix InlineFix -} -type InlineFix struct { - StartCol int // zero-based - Length int - NewString string -} - -func (w *Helper) find(pass *analysis.Pass, n ast.Node) { - v, ok := n.(*ast.StructType) - if !ok { - return - } - - fields := v.Fields.List - if len(fields) == 0 { - return - } - - fs := make([]*ast.Field, 0) - split := func() { - n := len(fs) - if n > 1 { - w.consecutiveFieldsGroups = append(w.consecutiveFieldsGroups, fs) - } else if n == 1 { - w.singleFields = append(w.singleFields, fs[0]) - } - - fs = nil - } - - for i, field := range fields { - if field.Tag == nil { - // field without tags - split() - continue - } - - if i > 0 { - if fields[i-1].Tag == nil { - // if previous filed do not have a tag - fs = append(fs, field) - continue - } - preLineNum := pass.Fset.Position(fields[i-1].Tag.Pos()).Line - lineNum := pass.Fset.Position(field.Tag.Pos()).Line - if lineNum-preLineNum > 1 { - // fields with tags are not consecutive, including two case: - // 1. splited by lines - // 2. splited by a struct - split() - - // check if the field is a struct - if _, ok := field.Type.(*ast.StructType); ok { - continue - } - } - } - - fs = append(fs, field) - } - - split() -} - -func (w *Helper) report(pass *analysis.Pass, field *ast.Field, startCol int, msg, replaceStr string) { - if w.mode == GolangciLintMode { - iss := Issue{ - Pos: pass.Fset.Position(field.Tag.Pos()), - Message: msg, - InlineFix: InlineFix{ - StartCol: startCol, - Length: len(field.Tag.Value), - NewString: replaceStr, - }, - } - w.issues = append(w.issues, iss) - } - - if w.mode == StandaloneMode { - pass.Report(analysis.Diagnostic{ - Pos: field.Tag.Pos(), - End: field.Tag.End(), - Message: msg, - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: msg, - TextEdits: []analysis.TextEdit{ - { - Pos: field.Tag.Pos(), - End: field.Tag.End(), - NewText: []byte(replaceStr), - }, - }, - }, - }, - }) - } -} - -func (w *Helper) Process(pass *analysis.Pass) { //nolint:gocognit - // process grouped fields - for _, fields := range w.consecutiveFieldsGroups { - offsets := make([]int, len(fields)) - - var maxTagNum int - var tagsGroup, notSortedTagsGroup [][]*structtag.Tag - - var uniqueKeys []string - addKey := func(k string) { - for _, key := range uniqueKeys { - if key == k { - return - } - } - uniqueKeys = append(uniqueKeys, k) - } - - for i := 0; i < len(fields); { - field := fields[i] - column := pass.Fset.Position(field.Tag.Pos()).Column - 1 - offsets[i] = column - - tag, err := strconv.Unquote(field.Tag.Value) - if err != nil { - // if tag value is not a valid string, report it directly - w.report(pass, field, column, errTagValueSyntax, field.Tag.Value) - fields = removeField(fields, i) - continue - } - - tags, err := structtag.Parse(tag) - if err != nil { - // if tag value is not a valid struct tag, report it directly - w.report(pass, field, column, err.Error(), field.Tag.Value) - fields = removeField(fields, i) - continue - } - - maxTagNum = max(maxTagNum, tags.Len()) - - if w.sort { - cp := make([]*structtag.Tag, tags.Len()) - for i, tag := range tags.Tags() { - cp[i] = tag - } - notSortedTagsGroup = append(notSortedTagsGroup, cp) - sortBy(w.fixedTagOrder, tags) - } - for _, t := range tags.Tags() { - addKey(t.Key) - } - tagsGroup = append(tagsGroup, tags.Tags()) - - i++ - } - - if w.sort && StrictStyle == w.style { - sortAllKeys(w.fixedTagOrder, uniqueKeys) - maxTagNum = len(uniqueKeys) - } - - // record the max length of each column tag - type tagLen struct { - Key string // present only when sort enabled - Len int - } - tagMaxLens := make([]tagLen, maxTagNum) - for j := 0; j < maxTagNum; j++ { - var maxLength int - var key string - for i := 0; i < len(tagsGroup); i++ { - if w.style == StrictStyle { - key = uniqueKeys[j] - // search by key - for _, tag := range tagsGroup[i] { - if tag.Key == key { - maxLength = max(maxLength, len(tag.String())) - break - } - } - } else { - if len(tagsGroup[i]) <= j { - // in case of index out of range - continue - } - maxLength = max(maxLength, len(tagsGroup[i][j].String())) - } - } - tagMaxLens[j] = tagLen{key, maxLength} - } - - for i, field := range fields { - tags := tagsGroup[i] - - var newTagStr string - if w.align { - // if align enabled, align tags. - newTagBuilder := strings.Builder{} - for i, n := 0, 0; i < len(tags) && n < len(tagMaxLens); { - tag := tags[i] - var format string - if w.style == StrictStyle { - if tagMaxLens[n].Key == tag.Key { - // match - format = alignFormat(tagMaxLens[n].Len + 1) // with an extra space - newTagBuilder.WriteString(fmt.Sprintf(format, tag.String())) - i++ - n++ - } else { - // tag missing - format = alignFormat(tagMaxLens[n].Len + 1) - newTagBuilder.WriteString(fmt.Sprintf(format, "")) - n++ - } - } else { - format = alignFormat(tagMaxLens[n].Len + 1) // with an extra space - newTagBuilder.WriteString(fmt.Sprintf(format, tag.String())) - i++ - n++ - } - } - newTagStr = newTagBuilder.String() - } else { - // otherwise check if tags order changed - if w.sort && reflect.DeepEqual(notSortedTagsGroup[i], tags) { - // if tags order not changed, do nothing - continue - } - tagsStr := make([]string, len(tags)) - for i, tag := range tags { - tagsStr[i] = tag.String() - } - newTagStr = strings.Join(tagsStr, " ") - } - - unquoteTag := strings.TrimRight(newTagStr, " ") - // unquoteTag := newTagStr - newTagValue := fmt.Sprintf("`%s`", unquoteTag) - if field.Tag.Value == newTagValue { - // nothing changed - continue - } - - msg := "tag is not aligned, should be: " + unquoteTag - - w.report(pass, field, offsets[i], msg, newTagValue) - } - } - - // process single fields - for _, field := range w.singleFields { - column := pass.Fset.Position(field.Tag.Pos()).Column - 1 - tag, err := strconv.Unquote(field.Tag.Value) - if err != nil { - w.report(pass, field, column, errTagValueSyntax, field.Tag.Value) - continue - } - - tags, err := structtag.Parse(tag) - if err != nil { - w.report(pass, field, column, err.Error(), field.Tag.Value) - continue - } - originalTags := append([]*structtag.Tag(nil), tags.Tags()...) - if w.sort { - sortBy(w.fixedTagOrder, tags) - } - - newTagValue := fmt.Sprintf("`%s`", tags.String()) - if reflect.DeepEqual(originalTags, tags.Tags()) && field.Tag.Value == newTagValue { - // if tags order not changed, do nothing - continue - } - - msg := "tag is not aligned , should be: " + tags.String() - - w.report(pass, field, column, msg, newTagValue) - } -} - -// Issues returns all issues found by the analyzer. -// It is used to integrate with golangci-lint. -func (w *Helper) Issues() []Issue { - log.Println("tagalign 's Issues() should only be called in golangci-lint mode") - return w.issues -} - -// sortBy sorts tags by fixed order. -// If a tag is not in the fixed order, it will be sorted by name. -func sortBy(fixedOrder []string, tags *structtag.Tags) { - // sort by fixed order - sort.Slice(tags.Tags(), func(i, j int) bool { - ti := tags.Tags()[i] - tj := tags.Tags()[j] - - oi := findIndex(fixedOrder, ti.Key) - oj := findIndex(fixedOrder, tj.Key) - - if oi == -1 && oj == -1 { - return ti.Key < tj.Key - } - - if oi == -1 { - return false - } - - if oj == -1 { - return true - } - - return oi < oj - }) -} - -func sortAllKeys(fixedOrder []string, keys []string) { - sort.Slice(keys, func(i, j int) bool { - oi := findIndex(fixedOrder, keys[i]) - oj := findIndex(fixedOrder, keys[j]) - - if oi == -1 && oj == -1 { - return keys[i] < keys[j] - } - - if oi == -1 { - return false - } - - if oj == -1 { - return true - } - - return oi < oj - }) -} - -func findIndex(s []string, e string) int { - for i, a := range s { - if a == e { - return i - } - } - return -1 -} - -func alignFormat(length int) string { - return "%" + fmt.Sprintf("-%ds", length) -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func removeField(fields []*ast.Field, index int) []*ast.Field { - if index < 0 || index >= len(fields) { - return fields - } - - return append(fields[:index], fields[index+1:]...) -} diff --git a/vendor/github.com/Abirdcfly/dupword/.gitignore b/vendor/github.com/Abirdcfly/dupword/.gitignore deleted file mode 100644 index b5109d2bbf..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/.gitignore +++ /dev/null @@ -1,183 +0,0 @@ - -# Godot-specific ignores -.import/ -export.cfg -export_presets.cfg - -# Mono-specific ignores -.mono/ -data_*/ - -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -.idea/artifacts -.idea/compiler.xml -.idea/jarRepositories.xml -.idea/modules.xml -.idea/*.iml -.idea/modules -*.iml -*.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### Emacs template -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.elc -auto-save-list -tramp -.\#* - -# Org-mode -.org-id-locations -*_archive - -# flymake-mode -*_flymake.* - -# eshell files -/eshell/history -/eshell/lastdir - -# elpa packages -/elpa/ - -# reftex files -*.rel - -# AUCTeX auto folder -/auto/ - -# cask packages -.cask/ -dist/ - -# Flycheck -flycheck_*.el - -# server auth directory -/server/ - -# projectiles files -.projectile - -# directory configuration -.dir-locals.el - -# network security -/network-security.data - - -### Vim template -# Swap -[._]*.s[a-v][a-z] -!*.svg # comment out if you don't need vector files -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim -Sessionx.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - -### macOS template -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - diff --git a/vendor/github.com/Abirdcfly/dupword/.goreleaser.yml b/vendor/github.com/Abirdcfly/dupword/.goreleaser.yml deleted file mode 100644 index c3401787a0..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/.goreleaser.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -project_name: dupword - -release: - github: - owner: Abirdcfly - name: dupword - -builds: - - binary: dupword - goos: - - darwin - - windows - - linux - - freebsd - goarch: - - amd64 - - arm64 - - arm - - 386 - - ppc64le - - s390x - - mips64 - - mips64le - - riscv64 - goarm: - - 6 - - 7 - gomips: - - hardfloat - env: - - CGO_ENABLED=0 - ignore: - - goos: darwin - goarch: 386 - - goos: freebsd - goarch: arm64 - main: ./cmd/dupword/ - flags: - - -trimpath - ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} - -archives: - - format: tar.gz - wrap_in_directory: true - format_overrides: - - goos: windows - format: zip - name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - files: - - LICENSE - - README.md - -snapshot: - name_template: SNAPSHOT-{{ .Commit }} - -checksum: - name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' - -changelog: - sort: asc - filters: - exclude: - - '(?i)^docs?:' - - '(?i)^docs\([^:]+\):' - - '(?i)^docs\[[^:]+\]:' - - '^tests?:' - - '(?i)^dev:' - - '^build\(deps\): bump .* in /docs \(#\d+\)' - - '^build\(deps\): bump .* in /\.github/peril \(#\d+\)' - - Merge pull request - - Merge branch diff --git a/vendor/github.com/Abirdcfly/dupword/LICENSE b/vendor/github.com/Abirdcfly/dupword/LICENSE deleted file mode 100644 index afa64c6e1e..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Abirdcfly - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Abirdcfly/dupword/README.md b/vendor/github.com/Abirdcfly/dupword/README.md deleted file mode 100644 index e6c5b919fa..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# dupword - -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/Abirdcfly/dupword?style=flat-square) -[![GoDoc](https://godoc.org/github.com/Abirdcfly/dupword?status.svg)](https://pkg.go.dev/github.com/Abirdcfly/dupword) -[![Actions Status](https://github.com/Abirdcfly/dupword/actions/workflows/lint.yml/badge.svg)](https://github.com/Abirdcfly/dupword/actions) -[![Go Report Card](https://goreportcard.com/badge/github.com/Abirdcfly/dupword)](https://goreportcard.com/report/github.com/Abirdcfly/dupword) - -A linter that checks for duplicate words in the source code (usually miswritten) - -Examples in real code and related issues can be viewed in [dupword#3](https://github.com/Abirdcfly/dupword/issues/3) - -## example - -1. Repeated words appear on two adjacent lines [commit](https://github.com/golang/go/commit/d8f90ce0f8119bf593efb6fb91825de5b61fcda7) - -```diff ---- a/src/cmd/compile/internal/ssa/schedule.go -+++ b/src/cmd/compile/internal/ssa/schedule.go -@@ -179,7 +179,7 @@ func schedule(f *Func) { - // scored CarryChainTail (and prove w is not a tail). - score[w.ID] = ScoreFlags - } -- // Verify v has not been scored. If v has not been visited, v may be the -+ // Verify v has not been scored. If v has not been visited, v may be - // the final (tail) operation in a carry chain. If v is not, v will be - // rescored above when v's carry-using op is scored. When scoring is done, - // only tail operations will retain the CarryChainTail score. -``` - -2. Repeated words appearing on the same line [commit](https://github.com/golang/go/commit/48da729e8468b630ee003ac51cbaac595d53bec8) - -```diff ---- a/src/net/http/cookiejar/jar.go -+++ b/src/net/http/cookiejar/jar.go -@@ -465,7 +465,7 @@ func (j *Jar) domainAndType(host, domain string) (string, bool, error) { - // dot in the domain-attribute before processing the cookie. - // - // Most browsers don't do that for IP addresses, only curl -- // version 7.54) and and IE (version 11) do not reject a -+ // version 7.54) and IE (version 11) do not reject a - // Set-Cookie: a=1; domain=.127.0.0.1 - // This leading dot is optional and serves only as hint for - // humans to indicate that a cookie with "domain=.bbc.co.uk" -``` - -## Install - -```bash -go install github.com/Abirdcfly/dupword/cmd/dupword@latest -``` - -**Or** install the main branch (including the last commit) with: - -```bash -go install github.com/Abirdcfly/dupword/cmd/dupword@main -``` - -## Usage - -### 1. default - -Run with default settings(include test file): - -**But note that not all repeated words are wrong** see [dupword#4](https://github.com/Abirdcfly/dupword/issues/4) for real code example. - -```bash -$ dupword ./... -/Users/xxx/go/src/dupword/dupword_test.go:88:10: Duplicate words (the) found -exit status 3 -``` - -### 2. skip test file - -Skip detection test file(`*_test.go`): - -```bash -$ dupword -test=false ./... -``` - -### 3. auto-fix - -```bash -$ dupword -fix ./... -``` - -### 4. all options - -All options: - -```bash -$ dupword --help -dupword: checks for duplicate words in the source code (usually miswritten) - -Usage: dupword [-flag] [package] - -This analyzer checks miswritten duplicate words in comments or package doc or string declaration - -Flags: - -V print version and exit - -all - no effect (deprecated) - -c int - display offending line with this many lines of context (default -1) - -cpuprofile string - write CPU profile to this file - -debug string - debug flags, any subset of "fpstv" - -fix - apply all suggested fixes - -flags - print analyzer flags in JSON - -ignore value - ignore words - -json - emit JSON output - -keyword value - keywords for detecting duplicate words - -memprofile string - write memory profile to this file - -source - no effect (deprecated) - -tags string - no effect (deprecated) - -test - indicates whether test files should be analyzed, too (default true) - -trace string - write trace log to this file - -v no effect (deprecated) -``` - -### 5. my advice - -use `--keyword=the,and,a` and `-fix` together. I think that specifying only commonly repeated prepositions can effectively avoid false positives. - -see [dupword#4](https://github.com/Abirdcfly/dupword/issues/4) for real code example. - -```bash -$ dupword --keyword=the,and,a -fix ./... -``` - -## TODO - -- [x] add this linter to golangci-lint -- [ ] rewrite the detection logic to make it more efficient - -## Limitation - -1. Only for `*.go` file.But some miswritten occurs in `*.md` or `*.json` file.(example: kubernetes), In this case, my advice is to use [rg](https://github.com/BurntSushi/ripgrep) to do the lookup and replace manually. -2. When use `-fix`, also running `go fmt` in the dark.([This logic is determined upstream](https://github.com/golang/tools/blob/248c34b88a4148128f89e41923498bd86f805b7d/go/analysis/internal/checker/checker.go#L424-L433), the project does not have this part of the code.) - -## License - -MIT diff --git a/vendor/github.com/Abirdcfly/dupword/dupword.go b/vendor/github.com/Abirdcfly/dupword/dupword.go deleted file mode 100644 index c291eab527..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/dupword.go +++ /dev/null @@ -1,331 +0,0 @@ -// MIT License -// -// Copyright (c) 2022 Abirdcfly -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// Package dupword defines an Analyzer that checks that duplicate words -// int the source code. -package dupword - -import ( - "flag" - "fmt" - "go/ast" - "go/token" - "sort" - "strconv" - "strings" - "unicode" - "unicode/utf8" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const ( - Name = "dupword" - Doc = `checks for duplicate words in the source code (usually miswritten) - -This analyzer checks miswritten duplicate words in comments or package doc or string declaration` - Message = "Duplicate words (%s) found" - CommentPrefix = `//` -) - -var ( - defaultWord = []string{} - // defaultWord = []string{"the", "and", "a"} - ignoreWord = map[string]bool{} -) - -type analyzer struct { - KeyWord []string -} - -func (a *analyzer) String() string { - return strings.Join(a.KeyWord, ",") -} - -func (a *analyzer) Set(w string) error { - if len(w) != 0 { - a.KeyWord = make([]string, 0) - a.KeyWord = append(a.KeyWord, strings.Split(w, ",")...) - } - return nil -} - -type ignore struct { -} - -func (a *ignore) String() string { - t := make([]string,0, len(ignoreWord)) - for k := range ignoreWord { - t = append(t, k) - } - return strings.Join(t, ",") -} - -func (a *ignore) Set(w string) error { - for _, k := range strings.Split(w, ","){ - ignoreWord[k] = true - } - return nil -} - -// for test only -func ClearIgnoreWord() { - ignoreWord = map[string]bool{} -} - -func NewAnalyzer() *analysis.Analyzer { - ignore := &ignore{} - analyzer := &analyzer{KeyWord: defaultWord} - a := &analysis.Analyzer{ - Name: Name, - Doc: Doc, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - Run: analyzer.run, - RunDespiteErrors: true, - } - a.Flags.Init(Name, flag.ExitOnError) - a.Flags.Var(analyzer, "keyword", "keywords for detecting duplicate words") - a.Flags.Var(ignore, "ignore", "ignore words") - a.Flags.Var(version{}, "V", "print version and exit") - return a -} - -func (a *analyzer) run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - a.fixDuplicateWordInComment(pass, file) - } - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.BasicLit)(nil), - } - inspect.Preorder(nodeFilter, func(n ast.Node) { - if lit, ok := n.(*ast.BasicLit); ok { - a.fixDuplicateWordInString(pass, lit) - } - }) - return nil, nil -} - -func (a *analyzer) fixDuplicateWordInComment(pass *analysis.Pass, f *ast.File) { - for _, cg := range f.Comments { - var preLine *ast.Comment - for _, c := range cg.List { - update, keyword, find := a.Check(c.Text) - if find { - pass.Report(analysis.Diagnostic{Pos: c.Slash, End: c.End(), Message: fmt.Sprintf(Message, keyword), SuggestedFixes: []analysis.SuggestedFix{{ - Message: "Update", - TextEdits: []analysis.TextEdit{{ - Pos: c.Slash, - End: c.End(), - NewText: []byte(update), - }}, - }}}) - } - if preLine != nil { - fields := strings.Fields(preLine.Text) - if len(fields) < 1 { - continue - } - preLineContent := fields[len(fields)-1] + "\n" - thisLineContent := c.Text - if find { - thisLineContent = update - } - before, after, _ := strings.Cut(thisLineContent, CommentPrefix) - update, keyword, find := a.Check(preLineContent + after) - if find { - var suggestedFixes []analysis.SuggestedFix - if strings.Contains(update, preLineContent) { - update = before + CommentPrefix + strings.TrimPrefix(update, preLineContent) - suggestedFixes = []analysis.SuggestedFix{{ - Message: "Update", - TextEdits: []analysis.TextEdit{{ - Pos: c.Slash, - End: c.End(), - NewText: []byte(update), - }}, - }} - } - pass.Report(analysis.Diagnostic{Pos: c.Slash, End: c.End(), Message: fmt.Sprintf(Message, keyword), SuggestedFixes: suggestedFixes}) - } - } - preLine = c - } - } -} - -func (a *analyzer) fixDuplicateWordInString(pass *analysis.Pass, lit *ast.BasicLit) { - if lit.Kind != token.STRING { - return - } - value, err := strconv.Unquote(lit.Value) - if err != nil { - fmt.Printf("lit.Value:%v, err: %v\n", lit.Value, err) - // fall back to default - value = lit.Value - } - quote := value != lit.Value - update, keyword, find := a.Check(value) - if quote { - update = strconv.Quote(update) - } - if find { - pass.Report(analysis.Diagnostic{Pos: lit.Pos(), End: lit.End(), Message: fmt.Sprintf(Message, keyword), SuggestedFixes: []analysis.SuggestedFix{{ - Message: "Update", - TextEdits: []analysis.TextEdit{{ - Pos: lit.Pos(), - End: lit.End(), - NewText: []byte(update), - }}, - }}}) - } -} - -// CheckOneKey use to check there is a defined duplicate word in a string. -// raw is checked line. key is the keyword to check. empty means just check duplicate word. -func CheckOneKey(raw, key string) (new string, findWord string, find bool) { - if key == "" { - has := false - fields := strings.Fields(raw) - for i := range fields { - if i == len(fields)-1 { - break - } - if fields[i] == fields[i+1] { - has = true - } - } - if !has { - return - } - } else { - if x := strings.Split(raw, key); len(x) < 2 { - return - } - } - - findWordMap := make(map[string]bool, 4) - newLine := strings.Builder{} - wordStart, spaceStart := 0, 0 - curWord, preWord := "", "" - lastSpace := "" - var lastRune int32 - for i, r := range raw { - if !unicode.IsSpace(r) && unicode.IsSpace(lastRune) { - // word start position - /* - i - | - hello[ spaceA ]the[ spaceB ]the[ spaceC ]word - ^ ^ - | curWord: the - preWord: the - */ - symbol := raw[spaceStart:i] - if ((key != "" && curWord == key) || key == "") && curWord == preWord && curWord != "" { - if !ExcludeWords(curWord) { - find = true - findWordMap[curWord] = true - newLine.WriteString(lastSpace) - symbol = "" - } - } else { - newLine.WriteString(lastSpace) - newLine.WriteString(curWord) - } - lastSpace = symbol - preWord = curWord - wordStart = i - } else if unicode.IsSpace(r) && !unicode.IsSpace(lastRune) { - // space start position - spaceStart = i - curWord = raw[wordStart:i] - } else if i == len(raw)-1 { - // last position - word := raw[wordStart:] - if ((key != "" && word == key) || key == "") && word == preWord { - if !ExcludeWords(word) { - find = true - findWordMap[word] = true - } - } else { - newLine.WriteString(lastSpace) - newLine.WriteString(word) - } - } - lastRune = r - } - if find { - new = newLine.String() - findWordSlice := make([]string, len(findWordMap)) - i := 0 - for k := range findWordMap { - findWordSlice[i] = k - i++ - } - sort.Strings(findWordSlice) - findWord = strings.Join(findWordSlice, ",") - } - return -} - -func (a *analyzer) Check(raw string) (update string, keyword string, find bool) { - for _, key := range a.KeyWord { - updateOne, _, findOne := CheckOneKey(raw, key) - if findOne { - raw = updateOne - find = findOne - update = updateOne - if keyword == "" { - keyword = key - } else { - keyword = keyword + "," + key - } - } - } - if len(a.KeyWord) == 0 { - return CheckOneKey(raw, "") - } - return -} - -// ExcludeWords determines whether duplicate words should be reported, -// -// e.g. %s, should not be reported. -func ExcludeWords(word string) (exclude bool) { - firstRune, _ := utf8.DecodeRuneInString(word) - if unicode.IsDigit(firstRune) { - return true - } - if unicode.IsPunct(firstRune) { - return true - } - if unicode.IsSymbol(firstRune) { - return true - } - if _, exist := ignoreWord[word]; exist { - return true - } - return false -} diff --git a/vendor/github.com/Abirdcfly/dupword/version.go b/vendor/github.com/Abirdcfly/dupword/version.go deleted file mode 100644 index 9d892d0c98..0000000000 --- a/vendor/github.com/Abirdcfly/dupword/version.go +++ /dev/null @@ -1,41 +0,0 @@ -// MIT License -// -// # Copyright (c) 2022 Abirdcfly -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -package dupword - -import ( - "fmt" - "os" -) - -var Version = "dev" - -type version struct{} - -func (version) IsBoolFlag() bool { return true } -func (version) Get() interface{} { return nil } -func (version) String() string { return "" } -func (version) Set(_ string) error { - fmt.Println(Version) - os.Exit(0) - return nil -} diff --git a/vendor/github.com/AlekSi/pointer/LICENSE b/vendor/github.com/AlekSi/pointer/LICENSE deleted file mode 100644 index 55f8794c86..0000000000 --- a/vendor/github.com/AlekSi/pointer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Alexey Palazhchenko - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/AlekSi/pointer/README.md b/vendor/github.com/AlekSi/pointer/README.md deleted file mode 100644 index 64c72d735b..0000000000 --- a/vendor/github.com/AlekSi/pointer/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# pointer - -[![Go Reference](https://pkg.go.dev/badge/github.com/AlekSi/pointer.svg)](https://pkg.go.dev/github.com/AlekSi/pointer) - -Go package `pointer` provides helpers to convert between pointers and values of built-in -(and, with Go 1.18+ generics, of any) types. - -``` -go get github.com/AlekSi/pointer -``` - -API is stable. [Documentation](https://pkg.go.dev/github.com/AlekSi/pointer). - -```go -package motivationalexample - -import ( - "encoding/json" - - "github.com/AlekSi/pointer" -) - -const ( - defaultName = "some name" -) - -// Stuff contains optional fields. -type Stuff struct { - Name *string - Comment *string - Value *int64 - Time *time.Time -} - -// SomeStuff makes some JSON-encoded stuff. -func SomeStuff() (data []byte, err error) { - return json.Marshal(&Stuff{ - Name: pointer.ToString(defaultName), // can't say &defaultName - Comment: pointer.ToString("not yet"), // can't say &"not yet" - Value: pointer.ToInt64(42), // can't say &42 or &int64(42) - Time: pointer.ToTime(time.Date(2014, 6, 25, 12, 24, 40, 0, time.UTC)), // can't say &time.Date(…) - }) -} -``` diff --git a/vendor/github.com/AlekSi/pointer/generic.go b/vendor/github.com/AlekSi/pointer/generic.go deleted file mode 100644 index 1ef976b1fc..0000000000 --- a/vendor/github.com/AlekSi/pointer/generic.go +++ /dev/null @@ -1,36 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -package pointer - -// To returns a pointer to the passed value. -func To[T any](t T) *T { - return &t -} - -// ToOrNil returns a pointer to the passed value, or nil, if the passed value is a zero value. -// If the passed value has `IsZero() bool` method (for example, time.Time instance), -// it is used to determine if the value is zero. -func ToOrNil[T comparable](t T) *T { - if z, ok := any(t).(interface{ IsZero() bool }); ok { - if z.IsZero() { - return nil - } - return &t - } - - var zero T - if t == zero { - return nil - } - return &t -} - -// Get returns the value from the passed pointer or the zero value if the pointer is nil. -func Get[T any](t *T) T { - if t == nil { - var zero T - return zero - } - return *t -} diff --git a/vendor/github.com/AlekSi/pointer/pointer.go b/vendor/github.com/AlekSi/pointer/pointer.go deleted file mode 100644 index 8203febdf7..0000000000 --- a/vendor/github.com/AlekSi/pointer/pointer.go +++ /dev/null @@ -1,124 +0,0 @@ -// Package pointer provides helpers to convert between pointers and values of built-in (and, with generics, of any) types. -package pointer // import "github.com/AlekSi/pointer" - -import ( - "time" -) - -/* -Order as in spec: - bool byte complex64 complex128 error float32 float64 - int int8 int16 int32 int64 rune string - uint uint8 uint16 uint32 uint64 uintptr - time.Duration time.Time -*/ - -// ToBool returns a pointer to the passed bool value. -func ToBool(b bool) *bool { - return &b -} - -// ToByte returns a pointer to the passed byte value. -func ToByte(b byte) *byte { - return &b -} - -// ToComplex64 returns a pointer to the passed complex64 value. -func ToComplex64(c complex64) *complex64 { - return &c -} - -// ToComplex128 returns a pointer to the passed complex128 value. -func ToComplex128(c complex128) *complex128 { - return &c -} - -// ToError returns a pointer to the passed error value. -func ToError(e error) *error { - return &e -} - -// ToFloat32 returns a pointer to the passed float32 value. -func ToFloat32(f float32) *float32 { - return &f -} - -// ToFloat64 returns a pointer to the passed float64 value. -func ToFloat64(f float64) *float64 { - return &f -} - -// ToInt returns a pointer to the passed int value. -func ToInt(i int) *int { - return &i -} - -// ToInt8 returns a pointer to the passed int8 value. -func ToInt8(i int8) *int8 { - return &i -} - -// ToInt16 returns a pointer to the passed int16 value. -func ToInt16(i int16) *int16 { - return &i -} - -// ToInt32 returns a pointer to the passed int32 value. -func ToInt32(i int32) *int32 { - return &i -} - -// ToInt64 returns a pointer to the passed int64 value. -func ToInt64(i int64) *int64 { - return &i -} - -// ToRune returns a pointer to the passed rune value. -func ToRune(r rune) *rune { - return &r -} - -// ToString returns a pointer to the passed string value. -func ToString(s string) *string { - return &s -} - -// ToUint returns a pointer to the passed uint value. -func ToUint(u uint) *uint { - return &u -} - -// ToUint8 returns a pointer to the passed uint8 value. -func ToUint8(u uint8) *uint8 { - return &u -} - -// ToUint16 returns a pointer to the passed uint16 value. -func ToUint16(u uint16) *uint16 { - return &u -} - -// ToUint32 returns a pointer to the passed uint32 value. -func ToUint32(u uint32) *uint32 { - return &u -} - -// ToUint64 returns a pointer to the passed uint64 value. -func ToUint64(u uint64) *uint64 { - return &u -} - -// ToUintptr returns a pointer to the passed uintptr value. -func ToUintptr(u uintptr) *uintptr { - return &u -} - -// ToDuration returns a pointer to the passed time.Duration value. -func ToDuration(d time.Duration) *time.Duration { - return &d -} - -// ToTime returns a pointer to the passed time.Time value. -func ToTime(t time.Time) *time.Time { - return &t -} diff --git a/vendor/github.com/AlekSi/pointer/pointer_or_nil.go b/vendor/github.com/AlekSi/pointer/pointer_or_nil.go deleted file mode 100644 index f464d2c610..0000000000 --- a/vendor/github.com/AlekSi/pointer/pointer_or_nil.go +++ /dev/null @@ -1,189 +0,0 @@ -package pointer - -import ( - "time" -) - -/* -Order as in spec: - bool byte complex64 complex128 error float32 float64 - int int8 int16 int32 int64 rune string - uint uint8 uint16 uint32 uint64 uintptr - time.Duration time.Time -*/ - -// ToBoolOrNil returns a pointer to the passed bool value, or nil, if passed value is a zero value. -func ToBoolOrNil(b bool) *bool { - if b == false { - return nil - } - return &b -} - -// ToByteOrNil returns a pointer to the passed byte value, or nil, if passed value is a zero value. -func ToByteOrNil(b byte) *byte { - if b == 0 { - return nil - } - return &b -} - -// ToComplex64OrNil returns a pointer to the passed complex64 value, or nil, if passed value is a zero value. -func ToComplex64OrNil(c complex64) *complex64 { - if c == 0 { - return nil - } - return &c -} - -// ToComplex128OrNil returns a pointer to the passed complex128 value, or nil, if passed value is a zero value. -func ToComplex128OrNil(c complex128) *complex128 { - if c == 0 { - return nil - } - return &c -} - -// ToErrorOrNil returns a pointer to the passed error value, or nil, if passed value is a zero value. -func ToErrorOrNil(e error) *error { - if e == nil { - return nil - } - return &e -} - -// ToFloat32OrNil returns a pointer to the passed float32 value, or nil, if passed value is a zero value. -func ToFloat32OrNil(f float32) *float32 { - if f == 0 { - return nil - } - return &f -} - -// ToFloat64OrNil returns a pointer to the passed float64 value, or nil, if passed value is a zero value. -func ToFloat64OrNil(f float64) *float64 { - if f == 0 { - return nil - } - return &f -} - -// ToIntOrNil returns a pointer to the passed int value, or nil, if passed value is a zero value. -func ToIntOrNil(i int) *int { - if i == 0 { - return nil - } - return &i -} - -// ToInt8OrNil returns a pointer to the passed int8 value, or nil, if passed value is a zero value. -func ToInt8OrNil(i int8) *int8 { - if i == 0 { - return nil - } - return &i -} - -// ToInt16OrNil returns a pointer to the passed int16 value, or nil, if passed value is a zero value. -func ToInt16OrNil(i int16) *int16 { - if i == 0 { - return nil - } - return &i -} - -// ToInt32OrNil returns a pointer to the passed int32 value, or nil, if passed value is a zero value. -func ToInt32OrNil(i int32) *int32 { - if i == 0 { - return nil - } - return &i -} - -// ToInt64OrNil returns a pointer to the passed int64 value, or nil, if passed value is a zero value. -func ToInt64OrNil(i int64) *int64 { - if i == 0 { - return nil - } - return &i -} - -// ToRuneOrNil returns a pointer to the passed rune value, or nil, if passed value is a zero value. -func ToRuneOrNil(r rune) *rune { - if r == 0 { - return nil - } - return &r -} - -// ToStringOrNil returns a pointer to the passed string value, or nil, if passed value is a zero value. -func ToStringOrNil(s string) *string { - if s == "" { - return nil - } - return &s -} - -// ToUintOrNil returns a pointer to the passed uint value, or nil, if passed value is a zero value. -func ToUintOrNil(u uint) *uint { - if u == 0 { - return nil - } - return &u -} - -// ToUint8OrNil returns a pointer to the passed uint8 value, or nil, if passed value is a zero value. -func ToUint8OrNil(u uint8) *uint8 { - if u == 0 { - return nil - } - return &u -} - -// ToUint16OrNil returns a pointer to the passed uint16 value, or nil, if passed value is a zero value. -func ToUint16OrNil(u uint16) *uint16 { - if u == 0 { - return nil - } - return &u -} - -// ToUint32OrNil returns a pointer to the passed uint32 value, or nil, if passed value is a zero value. -func ToUint32OrNil(u uint32) *uint32 { - if u == 0 { - return nil - } - return &u -} - -// ToUint64OrNil returns a pointer to the passed uint64 value, or nil, if passed value is a zero value. -func ToUint64OrNil(u uint64) *uint64 { - if u == 0 { - return nil - } - return &u -} - -// ToUintptrOrNil returns a pointer to the passed uintptr value, or nil, if passed value is a zero value. -func ToUintptrOrNil(u uintptr) *uintptr { - if u == 0 { - return nil - } - return &u -} - -// ToDurationOrNil returns a pointer to the passed time.Duration value, or nil, if passed value is a zero value. -func ToDurationOrNil(d time.Duration) *time.Duration { - if d == 0 { - return nil - } - return &d -} - -// ToTimeOrNil returns a pointer to the passed time.Time value, or nil, if passed value is a zero value (t.IsZero() returns true). -func ToTimeOrNil(t time.Time) *time.Time { - if t.IsZero() { - return nil - } - return &t -} diff --git a/vendor/github.com/AlekSi/pointer/value.go b/vendor/github.com/AlekSi/pointer/value.go deleted file mode 100644 index 23928ac03d..0000000000 --- a/vendor/github.com/AlekSi/pointer/value.go +++ /dev/null @@ -1,189 +0,0 @@ -package pointer - -import ( - "time" -) - -/* -Order as in spec: - bool byte complex64 complex128 error float32 float64 - int int8 int16 int32 int64 rune string - uint uint8 uint16 uint32 uint64 uintptr - time.Duration time.Time -*/ - -// GetBool returns the value of the bool pointer passed in or false if the pointer is nil. -func GetBool(b *bool) bool { - if b == nil { - return false - } - return *b -} - -// GetByte returns the value of the byte pointer passed in or 0 if the pointer is nil. -func GetByte(b *byte) byte { - if b == nil { - return 0 - } - return *b -} - -// GetComplex64 returns the value of the complex64 pointer passed in or 0 if the pointer is nil. -func GetComplex64(c *complex64) complex64 { - if c == nil { - return 0 - } - return *c -} - -// GetComplex128 returns the value of the complex128 pointer passed in or 0 if the pointer is nil. -func GetComplex128(c *complex128) complex128 { - if c == nil { - return 0 - } - return *c -} - -// GetError returns the value of the error pointer passed in or nil if the pointer is nil. -func GetError(e *error) error { - if e == nil { - return nil - } - return *e -} - -// GetFloat32 returns the value of the float32 pointer passed in or 0 if the pointer is nil. -func GetFloat32(f *float32) float32 { - if f == nil { - return 0 - } - return *f -} - -// GetFloat64 returns the value of the float64 pointer passed in or 0 if the pointer is nil. -func GetFloat64(f *float64) float64 { - if f == nil { - return 0 - } - return *f -} - -// GetInt returns the value of the int pointer passed in or 0 if the pointer is nil. -func GetInt(i *int) int { - if i == nil { - return 0 - } - return *i -} - -// GetInt8 returns the value of the int8 pointer passed in or 0 if the pointer is nil. -func GetInt8(i *int8) int8 { - if i == nil { - return 0 - } - return *i -} - -// GetInt16 returns the value of the int16 pointer passed in or 0 if the pointer is nil. -func GetInt16(i *int16) int16 { - if i == nil { - return 0 - } - return *i -} - -// GetInt32 returns the value of the int32 pointer passed in or 0 if the pointer is nil. -func GetInt32(i *int32) int32 { - if i == nil { - return 0 - } - return *i -} - -// GetInt64 returns the value of the int64 pointer passed in or 0 if the pointer is nil. -func GetInt64(i *int64) int64 { - if i == nil { - return 0 - } - return *i -} - -// GetRune returns the value of the rune pointer passed in or 0 if the pointer is nil. -func GetRune(r *rune) rune { - if r == nil { - return 0 - } - return *r -} - -// GetString returns the value of the string pointer passed in or empty string if the pointer is nil. -func GetString(s *string) string { - if s == nil { - return "" - } - return *s -} - -// GetUint returns the value of the uint pointer passed in or 0 if the pointer is nil. -func GetUint(u *uint) uint { - if u == nil { - return 0 - } - return *u -} - -// GetUint8 returns the value of the uint8 pointer passed in or 0 if the pointer is nil. -func GetUint8(u *uint8) uint8 { - if u == nil { - return 0 - } - return *u -} - -// GetUint16 returns the value of the uint16 pointer passed in or 0 if the pointer is nil. -func GetUint16(u *uint16) uint16 { - if u == nil { - return 0 - } - return *u -} - -// GetUint32 returns the value of the uint32 pointer passed in or 0 if the pointer is nil. -func GetUint32(u *uint32) uint32 { - if u == nil { - return 0 - } - return *u -} - -// GetUint64 returns the value of the uint64 pointer passed in or 0 if the pointer is nil. -func GetUint64(u *uint64) uint64 { - if u == nil { - return 0 - } - return *u -} - -// GetUintptr returns the value of the uintptr pointer passed in or 0 if the pointer is nil. -func GetUintptr(u *uintptr) uintptr { - if u == nil { - return 0 - } - return *u -} - -// GetDuration returns the value of the duration pointer passed in or 0 if the pointer is nil. -func GetDuration(d *time.Duration) time.Duration { - if d == nil { - return 0 - } - return *d -} - -// GetTime returns the value of the time pointer passed in or zero time.Time if the pointer is nil. -func GetTime(t *time.Time) time.Time { - if t == nil { - return time.Time{} - } - return *t -} diff --git a/vendor/github.com/Antonboom/errname/LICENSE b/vendor/github.com/Antonboom/errname/LICENSE deleted file mode 100644 index e2002e4d43..0000000000 --- a/vendor/github.com/Antonboom/errname/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Anton Telyshev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Antonboom/errname/pkg/analyzer/analyzer.go b/vendor/github.com/Antonboom/errname/pkg/analyzer/analyzer.go deleted file mode 100644 index aa85225108..0000000000 --- a/vendor/github.com/Antonboom/errname/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,135 +0,0 @@ -package analyzer - -import ( - "fmt" - "go/ast" - "go/token" - "strconv" - "strings" - "unicode" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -// New returns new errname analyzer. -func New() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "errname", - Doc: "Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`.", - Run: run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } -} - -type stringSet = map[string]struct{} - -var ( - importNodes = []ast.Node{(*ast.ImportSpec)(nil)} - typeNodes = []ast.Node{(*ast.TypeSpec)(nil)} - funcNodes = []ast.Node{(*ast.FuncDecl)(nil)} -) - -func run(pass *analysis.Pass) (interface{}, error) { - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - pkgAliases := map[string]string{} - insp.Preorder(importNodes, func(node ast.Node) { - i := node.(*ast.ImportSpec) - if n := i.Name; n != nil && i.Path != nil { - if path, err := strconv.Unquote(i.Path.Value); err == nil { - pkgAliases[n.Name] = getPkgFromPath(path) - } - } - }) - - allTypes := stringSet{} - typesSpecs := map[string]*ast.TypeSpec{} - insp.Preorder(typeNodes, func(node ast.Node) { - t := node.(*ast.TypeSpec) - allTypes[t.Name.Name] = struct{}{} - typesSpecs[t.Name.Name] = t - }) - - errorTypes := stringSet{} - insp.Preorder(funcNodes, func(node ast.Node) { - f := node.(*ast.FuncDecl) - t, ok := isMethodError(f) - if !ok { - return - } - errorTypes[t] = struct{}{} - - tSpec, ok := typesSpecs[t] - if !ok { - panic(fmt.Sprintf("no specification for type %q", t)) - } - - if _, ok := tSpec.Type.(*ast.ArrayType); ok { - if !isValidErrorArrayTypeName(t) { - reportAboutErrorType(pass, tSpec.Pos(), t, true) - } - } else if !isValidErrorTypeName(t) { - reportAboutErrorType(pass, tSpec.Pos(), t, false) - } - }) - - errorFuncs := stringSet{} - insp.Preorder(funcNodes, func(node ast.Node) { - f := node.(*ast.FuncDecl) - if isFuncReturningErr(f.Type, allTypes, errorTypes) { - errorFuncs[f.Name.Name] = struct{}{} - } - }) - - inspectPkgLevelVarsOnly := func(node ast.Node) bool { - switch v := node.(type) { - case *ast.FuncDecl: - return false - - case *ast.ValueSpec: - if name, ok := isSentinelError(v, pkgAliases, allTypes, errorTypes, errorFuncs); ok && !isValidErrorVarName(name) { - reportAboutErrorVar(pass, v.Pos(), name) - } - } - return true - } - for _, f := range pass.Files { - ast.Inspect(f, inspectPkgLevelVarsOnly) - } - - return nil, nil //nolint:nilnil -} - -func reportAboutErrorType(pass *analysis.Pass, typePos token.Pos, typeName string, isArrayType bool) { - var form string - if unicode.IsLower([]rune(typeName)[0]) { - form = "xxxError" - } else { - form = "XxxError" - } - - if isArrayType { - form += "s" - } - pass.Reportf(typePos, "the type name `%s` should conform to the `%s` format", typeName, form) -} - -func reportAboutErrorVar(pass *analysis.Pass, pos token.Pos, varName string) { - var form string - if unicode.IsLower([]rune(varName)[0]) { - form = "errXxx" - } else { - form = "ErrXxx" - } - pass.Reportf(pos, "the variable name `%s` should conform to the `%s` format", varName, form) -} - -func getPkgFromPath(p string) string { - idx := strings.LastIndex(p, "/") - if idx == -1 { - return p - } - return p[idx+1:] -} diff --git a/vendor/github.com/Antonboom/errname/pkg/analyzer/facts.go b/vendor/github.com/Antonboom/errname/pkg/analyzer/facts.go deleted file mode 100644 index 06f8d61d8e..0000000000 --- a/vendor/github.com/Antonboom/errname/pkg/analyzer/facts.go +++ /dev/null @@ -1,272 +0,0 @@ -package analyzer - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "strings" - "unicode" -) - -func isMethodError(f *ast.FuncDecl) (typeName string, ok bool) { - if f.Recv == nil || len(f.Recv.List) != 1 { - return "", false - } - if f.Name == nil || f.Name.Name != "Error" { - return "", false - } - - if f.Type == nil || f.Type.Results == nil || len(f.Type.Results.List) != 1 { - return "", false - } - - returnType, ok := f.Type.Results.List[0].Type.(*ast.Ident) - if !ok { - return "", false - } - - var receiverType string - - unwrapIdentName := func(e ast.Expr) string { - switch v := e.(type) { - case *ast.Ident: - return v.Name - case *ast.IndexExpr: - if i, ok := v.X.(*ast.Ident); ok { - return i.Name - } - case *ast.IndexListExpr: - if i, ok := v.X.(*ast.Ident); ok { - return i.Name - } - } - panic(fmt.Errorf("unsupported Error() receiver type %q", types.ExprString(e))) - } - - switch rt := f.Recv.List[0].Type; v := rt.(type) { - case *ast.Ident, *ast.IndexExpr, *ast.IndexListExpr: // SomeError, SomeError[T], SomeError[T1, T2, ...] - receiverType = unwrapIdentName(rt) - - case *ast.StarExpr: // *SomeError, *SomeError[T], *SomeError[T1, T2, ...] - receiverType = unwrapIdentName(v.X) - } - - return receiverType, returnType.Name == "string" -} - -func isValidErrorTypeName(s string) bool { - if isInitialism(s) { - return true - } - - words := split(s) - wordsCnt := wordsCount(words) - - if wordsCnt["error"] != 1 { - return false - } - return words[len(words)-1] == "error" -} - -func isValidErrorArrayTypeName(s string) bool { - if isInitialism(s) { - return true - } - - words := split(s) - wordsCnt := wordsCount(words) - - if wordsCnt["errors"] != 1 { - return false - } - return words[len(words)-1] == "errors" -} - -func isFuncReturningErr(fType *ast.FuncType, allTypes, errorTypes stringSet) bool { - if fType == nil || fType.Results == nil || len(fType.Results.List) != 1 { - return false - } - - var returnTypeName string - switch rt := fType.Results.List[0].Type.(type) { - case *ast.Ident: - returnTypeName = rt.Name - case *ast.StarExpr: - if i, ok := rt.X.(*ast.Ident); ok { - returnTypeName = i.Name - } - } - - return isErrorType(returnTypeName, allTypes, errorTypes) -} - -func isErrorType(tName string, allTypes, errorTypes stringSet) bool { - _, isUserType := allTypes[tName] - _, isErrType := errorTypes[tName] - return isErrType || (tName == "error" && !isUserType) -} - -var knownErrConstructors = stringSet{ - "fmt.Errorf": {}, - "errors.Errorf": {}, - "errors.New": {}, - "errors.Newf": {}, - "errors.NewWithDepth": {}, - "errors.NewWithDepthf": {}, - "errors.NewAssertionErrorWithWrappedErrf": {}, -} - -func isSentinelError( //nolint:gocognit,gocyclo - v *ast.ValueSpec, - pkgAliases map[string]string, - allTypes, errorTypes, errorFuncs stringSet, -) (varName string, ok bool) { - if len(v.Names) != 1 { - return "", false - } - varName = v.Names[0].Name - - switch vv := v.Type.(type) { - // var ErrEndOfFile error - // var ErrEndOfFile SomeErrType - case *ast.Ident: - if isErrorType(vv.Name, allTypes, errorTypes) { - return varName, true - } - - // var ErrEndOfFile *SomeErrType - case *ast.StarExpr: - if i, ok := vv.X.(*ast.Ident); ok && isErrorType(i.Name, allTypes, errorTypes) { - return varName, true - } - } - - if len(v.Values) != 1 { - return "", false - } - - switch vv := v.Values[0].(type) { - case *ast.CallExpr: - switch fun := vv.Fun.(type) { - // var ErrEndOfFile = errors.New("end of file") - case *ast.SelectorExpr: - pkg, ok := fun.X.(*ast.Ident) - if !ok { - return "", false - } - pkgFun := fun.Sel - - pkgName := pkg.Name - if a, ok := pkgAliases[pkgName]; ok { - pkgName = a - } - - _, ok = knownErrConstructors[pkgName+"."+pkgFun.Name] - return varName, ok - - // var ErrEndOfFile = newErrEndOfFile() - // var ErrEndOfFile = new(EndOfFileError) - // const ErrEndOfFile = constError("end of file") - // var statusCodeError = new(SomePtrError[string]) - case *ast.Ident: - if isErrorType(fun.Name, allTypes, errorTypes) { - return varName, true - } - - if _, ok := errorFuncs[fun.Name]; ok { - return varName, true - } - - if fun.Name == "new" && len(vv.Args) == 1 { - switch i := vv.Args[0].(type) { - case *ast.Ident: - return varName, isErrorType(i.Name, allTypes, errorTypes) - case *ast.IndexExpr: - if ii, ok := i.X.(*ast.Ident); ok { - return varName, isErrorType(ii.Name, allTypes, errorTypes) - } - } - } - - // var ErrEndOfFile = func() error { ... } - case *ast.FuncLit: - return varName, isFuncReturningErr(fun.Type, allTypes, errorTypes) - } - - // var ErrEndOfFile = &EndOfFileError{} - // var ErrOK = &SomePtrError[string]{Code: "200 OK"} - case *ast.UnaryExpr: - if vv.Op == token.AND { // & - if lit, ok := vv.X.(*ast.CompositeLit); ok { - switch i := lit.Type.(type) { - case *ast.Ident: - return varName, isErrorType(i.Name, allTypes, errorTypes) - case *ast.IndexExpr: - if ii, ok := i.X.(*ast.Ident); ok { - return varName, isErrorType(ii.Name, allTypes, errorTypes) - } - } - } - } - - // var ErrEndOfFile = EndOfFileError{} - // var ErrNotFound = SomeError[string]{Code: "Not Found"} - case *ast.CompositeLit: - switch i := vv.Type.(type) { - case *ast.Ident: - return varName, isErrorType(i.Name, allTypes, errorTypes) - case *ast.IndexExpr: - if ii, ok := i.X.(*ast.Ident); ok { - return varName, isErrorType(ii.Name, allTypes, errorTypes) - } - } - } - - return "", false -} - -func isValidErrorVarName(s string) bool { - if isInitialism(s) { - return true - } - - words := split(s) - wordsCnt := wordsCount(words) - - if wordsCnt["err"] != 1 { - return false - } - return words[0] == "err" -} - -func isInitialism(s string) bool { - return strings.ToLower(s) == s || strings.ToUpper(s) == s -} - -func split(s string) []string { - var words []string - ss := []rune(s) - - var b strings.Builder - b.WriteRune(ss[0]) - - for _, r := range ss[1:] { - if unicode.IsUpper(r) { - words = append(words, strings.ToLower(b.String())) - b.Reset() - } - b.WriteRune(r) - } - - words = append(words, strings.ToLower(b.String())) - return words -} - -func wordsCount(w []string) map[string]int { - result := make(map[string]int, len(w)) - for _, ww := range w { - result[ww]++ - } - return result -} diff --git a/vendor/github.com/Antonboom/nilnil/LICENSE b/vendor/github.com/Antonboom/nilnil/LICENSE deleted file mode 100644 index e2002e4d43..0000000000 --- a/vendor/github.com/Antonboom/nilnil/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Anton Telyshev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/analyzer.go b/vendor/github.com/Antonboom/nilnil/pkg/analyzer/analyzer.go deleted file mode 100644 index e980db5462..0000000000 --- a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,158 +0,0 @@ -package analyzer - -import ( - "go/ast" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const ( - name = "nilnil" - doc = "Checks that there is no simultaneous return of `nil` error and an invalid value." - - reportMsg = "return both the `nil` error and invalid value: use a sentinel error instead" -) - -// New returns new nilnil analyzer. -func New() *analysis.Analyzer { - n := newNilNil() - - a := &analysis.Analyzer{ - Name: name, - Doc: doc, - Run: n.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } - a.Flags.Var(&n.checkedTypes, "checked-types", "coma separated list") - - return a -} - -type nilNil struct { - checkedTypes checkedTypes -} - -func newNilNil() *nilNil { - return &nilNil{ - checkedTypes: newDefaultCheckedTypes(), - } -} - -var ( - types = []ast.Node{(*ast.TypeSpec)(nil)} - - funcAndReturns = []ast.Node{ - (*ast.FuncDecl)(nil), - (*ast.FuncLit)(nil), - (*ast.ReturnStmt)(nil), - } -) - -type typeSpecByName map[string]typer - -func (n *nilNil) run(pass *analysis.Pass) (interface{}, error) { - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - typeSpecs := typeSpecByName{ - "any": newTyper(new(ast.InterfaceType)), - } - insp.Preorder(types, func(node ast.Node) { - t := node.(*ast.TypeSpec) - typeSpecs[t.Name.Name] = newTyper(t.Type) - }) - - var fs funcTypeStack - insp.Nodes(funcAndReturns, func(node ast.Node, push bool) (proceed bool) { - switch v := node.(type) { - case *ast.FuncLit: - if push { - fs.Push(v.Type) - } else { - fs.Pop() - } - - case *ast.FuncDecl: - if push { - fs.Push(v.Type) - } else { - fs.Pop() - } - - case *ast.ReturnStmt: - ft := fs.Top() // Current function. - - if !push || len(v.Results) != 2 || ft == nil || ft.Results == nil || len(ft.Results.List) != 2 { - return false - } - - fRes1, fRes2 := ft.Results.List[0], ft.Results.List[1] - if !(n.isDangerNilField(fRes1, typeSpecs) && n.isErrorField(fRes2)) { - return false - } - - rRes1, rRes2 := v.Results[0], v.Results[1] - if isNil(rRes1) && isNil(rRes2) { - pass.Reportf(v.Pos(), reportMsg) - } - } - - return true - }) - - return nil, nil //nolint:nilnil -} - -func (n *nilNil) isDangerNilField(f *ast.Field, typeSpecs typeSpecByName) bool { - return n.isDangerNilType(f.Type, typeSpecs) -} - -func (n *nilNil) isDangerNilType(t ast.Expr, typeSpecs typeSpecByName) bool { - switch v := t.(type) { - case *ast.StarExpr: - return n.checkedTypes.Contains(ptrType) - - case *ast.FuncType: - return n.checkedTypes.Contains(funcType) - - case *ast.InterfaceType: - return n.checkedTypes.Contains(ifaceType) - - case *ast.MapType: - return n.checkedTypes.Contains(mapType) - - case *ast.ChanType: - return n.checkedTypes.Contains(chanType) - - case *ast.Ident: - if t, ok := typeSpecs[v.Name]; ok { - return n.isDangerNilType(t.Type(), typeSpecs) - } - } - return false -} - -func (n *nilNil) isErrorField(f *ast.Field) bool { - return isIdent(f.Type, "error") -} - -func isNil(e ast.Expr) bool { - return isIdent(e, "nil") -} - -func isIdent(n ast.Node, name string) bool { - i, ok := n.(*ast.Ident) - if !ok { - return false - } - return i.Name == name -} - -type typer interface { - Type() ast.Expr -} - -func newTyper(t ast.Expr) typer { return typerImpl{t: t} } // -type typerImpl struct{ t ast.Expr } // -func (ti typerImpl) Type() ast.Expr { return ti.t } diff --git a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/config.go b/vendor/github.com/Antonboom/nilnil/pkg/analyzer/config.go deleted file mode 100644 index 520b813a54..0000000000 --- a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/config.go +++ /dev/null @@ -1,77 +0,0 @@ -package analyzer - -import ( - "fmt" - "sort" - "strings" -) - -func newDefaultCheckedTypes() checkedTypes { - return checkedTypes{ - ptrType: struct{}{}, - funcType: struct{}{}, - ifaceType: struct{}{}, - mapType: struct{}{}, - chanType: struct{}{}, - } -} - -const separator = ',' - -type typeName string - -func (t typeName) S() string { - return string(t) -} - -const ( - ptrType typeName = "ptr" - funcType typeName = "func" - ifaceType typeName = "iface" - mapType typeName = "map" - chanType typeName = "chan" -) - -var knownTypes = []typeName{ptrType, funcType, ifaceType, mapType, chanType} - -type checkedTypes map[typeName]struct{} - -func (c checkedTypes) Contains(t typeName) bool { - _, ok := c[t] - return ok -} - -func (c checkedTypes) String() string { - result := make([]string, 0, len(c)) - for t := range c { - result = append(result, t.S()) - } - - sort.Strings(result) - return strings.Join(result, string(separator)) -} - -func (c checkedTypes) Set(s string) error { - types := strings.FieldsFunc(s, func(c rune) bool { return c == separator }) - if len(types) == 0 { - return nil - } - - c.disableAll() - for _, t := range types { - switch tt := typeName(t); tt { - case ptrType, funcType, ifaceType, mapType, chanType: - c[tt] = struct{}{} - default: - return fmt.Errorf("unknown checked type name %q (see help)", t) - } - } - - return nil -} - -func (c checkedTypes) disableAll() { - for k := range c { - delete(c, k) - } -} diff --git a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/func_type_stack.go b/vendor/github.com/Antonboom/nilnil/pkg/analyzer/func_type_stack.go deleted file mode 100644 index 0817615470..0000000000 --- a/vendor/github.com/Antonboom/nilnil/pkg/analyzer/func_type_stack.go +++ /dev/null @@ -1,29 +0,0 @@ -package analyzer - -import ( - "go/ast" -) - -type funcTypeStack []*ast.FuncType - -func (s *funcTypeStack) Push(f *ast.FuncType) { - *s = append(*s, f) -} - -func (s *funcTypeStack) Pop() *ast.FuncType { - if len(*s) == 0 { - return nil - } - - last := len(*s) - 1 - f := (*s)[last] - *s = (*s)[:last] - return f -} - -func (s *funcTypeStack) Top() *ast.FuncType { - if len(*s) == 0 { - return nil - } - return (*s)[len(*s)-1] -} diff --git a/vendor/github.com/Antonboom/testifylint/LICENSE b/vendor/github.com/Antonboom/testifylint/LICENSE deleted file mode 100644 index 9b1cf3a393..0000000000 --- a/vendor/github.com/Antonboom/testifylint/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Anton Telyshev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Antonboom/testifylint/analyzer/analyzer.go b/vendor/github.com/Antonboom/testifylint/analyzer/analyzer.go deleted file mode 100644 index 84d7e815dc..0000000000 --- a/vendor/github.com/Antonboom/testifylint/analyzer/analyzer.go +++ /dev/null @@ -1,93 +0,0 @@ -package analyzer - -import ( - "fmt" - "go/ast" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" - - "github.com/Antonboom/testifylint/internal/analysisutil" - "github.com/Antonboom/testifylint/internal/checkers" - "github.com/Antonboom/testifylint/internal/config" - "github.com/Antonboom/testifylint/internal/testify" -) - -const ( - name = "testifylint" - doc = "Checks usage of " + testify.ModulePath + "." - url = "https://github.com/antonboom/" + name -) - -// New returns new instance of testifylint analyzer. -func New() *analysis.Analyzer { - cfg := config.NewDefault() - - analyzer := &analysis.Analyzer{ - Name: name, - Doc: doc, - URL: url, - Run: func(pass *analysis.Pass) (any, error) { - regularCheckers, advancedCheckers, err := newCheckers(cfg) - if err != nil { - return nil, fmt.Errorf("build checkers: %v", err) - } - - tl := &testifyLint{ - regularCheckers: regularCheckers, - advancedCheckers: advancedCheckers, - } - return tl.run(pass) - }, - } - config.BindToFlags(&cfg, &analyzer.Flags) - - return analyzer -} - -type testifyLint struct { - regularCheckers []checkers.RegularChecker - advancedCheckers []checkers.AdvancedChecker -} - -func (tl *testifyLint) run(pass *analysis.Pass) (any, error) { - filesToAnalysis := make([]*ast.File, 0, len(pass.Files)) - for _, f := range pass.Files { - if !analysisutil.Imports(f, testify.AssertPkgPath, testify.RequirePkgPath, testify.SuitePkgPath) { - continue - } - filesToAnalysis = append(filesToAnalysis, f) - } - - insp := inspector.New(filesToAnalysis) - - // Regular checkers. - insp.Preorder([]ast.Node{(*ast.CallExpr)(nil)}, func(node ast.Node) { - tl.regularCheck(pass, node.(*ast.CallExpr)) - }) - - // Advanced checkers. - for _, ch := range tl.advancedCheckers { - for _, d := range ch.Check(pass, insp) { - pass.Report(d) - } - } - - return nil, nil -} - -func (tl *testifyLint) regularCheck(pass *analysis.Pass, ce *ast.CallExpr) { - call := checkers.NewCallMeta(pass, ce) - if nil == call { - return - } - - for _, ch := range tl.regularCheckers { - if d := ch.Check(pass, call); d != nil { - pass.Report(*d) - // NOTE(a.telyshev): I'm not interested in multiple diagnostics per assertion. - // This simplifies the code and also makes the linter more efficient. - return - } - } -} diff --git a/vendor/github.com/Antonboom/testifylint/analyzer/checkers_factory.go b/vendor/github.com/Antonboom/testifylint/analyzer/checkers_factory.go deleted file mode 100644 index de1d6017f5..0000000000 --- a/vendor/github.com/Antonboom/testifylint/analyzer/checkers_factory.go +++ /dev/null @@ -1,71 +0,0 @@ -package analyzer - -import ( - "fmt" - - "github.com/Antonboom/testifylint/internal/checkers" - "github.com/Antonboom/testifylint/internal/config" -) - -// newCheckers accepts linter config and returns slices of enabled checkers sorted by priority. -func newCheckers(cfg config.Config) ([]checkers.RegularChecker, []checkers.AdvancedChecker, error) { - if err := cfg.Validate(); err != nil { - return nil, nil, err - } - - enabledCheckersSet := make(map[string]struct{}) - - if cfg.EnableAll { - for _, checker := range checkers.All() { - enabledCheckersSet[checker] = struct{}{} - } - } else if !cfg.DisableAll { - for _, checker := range checkers.EnabledByDefault() { - enabledCheckersSet[checker] = struct{}{} - } - } - - for _, checker := range cfg.EnabledCheckers { - enabledCheckersSet[checker] = struct{}{} - } - - for _, checker := range cfg.DisabledCheckers { - delete(enabledCheckersSet, checker) - } - - enabledCheckers := make([]string, 0, len(enabledCheckersSet)) - for v := range enabledCheckersSet { - enabledCheckers = append(enabledCheckers, v) - } - checkers.SortByPriority(enabledCheckers) - - regularCheckers := make([]checkers.RegularChecker, 0, len(enabledCheckers)) - advancedCheckers := make([]checkers.AdvancedChecker, 0, len(enabledCheckers)/2) - - for _, name := range enabledCheckers { - ch, ok := checkers.Get(name) - if !ok { - return nil, nil, fmt.Errorf("unknown checker %q", name) - } - - switch c := ch.(type) { - case *checkers.ExpectedActual: - c.SetExpVarPattern(cfg.ExpectedActual.ExpVarPattern.Regexp) - - case *checkers.RequireError: - c.SetFnPattern(cfg.RequireError.FnPattern.Regexp) - - case *checkers.SuiteExtraAssertCall: - c.SetMode(cfg.SuiteExtraAssertCall.Mode) - } - - switch casted := ch.(type) { - case checkers.RegularChecker: - regularCheckers = append(regularCheckers, casted) - case checkers.AdvancedChecker: - advancedCheckers = append(advancedCheckers, casted) - } - } - - return regularCheckers, advancedCheckers, nil -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/doc.go b/vendor/github.com/Antonboom/testifylint/internal/analysisutil/doc.go deleted file mode 100644 index b57cbd9384..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Package analysisutil contains functions common for `analyzer` and `internal/checkers` packages. -// In addition, it is intended to "lighten" these packages. -// -// If the function is common to several packages, or it makes sense to test it separately without -// "polluting" the target package with tests of private functionality, then you can put function in this package. -// -// It's important to avoid dependency on `golang.org/x/tools/go/analysis` in the helpers API. -// This makes the API "narrower" and also allows you to test functions without some "abstraction leaks". -package analysisutil diff --git a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/file.go b/vendor/github.com/Antonboom/testifylint/internal/analysisutil/file.go deleted file mode 100644 index 3fc1f42b86..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/file.go +++ /dev/null @@ -1,28 +0,0 @@ -package analysisutil - -import ( - "go/ast" - "strconv" -) - -// Imports tells if the file imports at least one of the packages. -// If no packages provided then function returns false. -func Imports(file *ast.File, pkgs ...string) bool { - for _, i := range file.Imports { - if i.Path == nil { - continue - } - - path, err := strconv.Unquote(i.Path.Value) - if err != nil { - continue - } - // NOTE(a.telyshev): Don't use `slices.Contains` to keep the minimum module version 1.20. - for _, pkg := range pkgs { // Small O(n). - if pkg == path { - return true - } - } - } - return false -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/format.go b/vendor/github.com/Antonboom/testifylint/internal/analysisutil/format.go deleted file mode 100644 index fcb4b847f6..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/format.go +++ /dev/null @@ -1,34 +0,0 @@ -package analysisutil - -import ( - "bytes" - "go/ast" - "go/format" - "go/token" -) - -// NodeString is a more powerful analogue of types.ExprString. -// Return empty string if node AST is invalid. -func NodeString(fset *token.FileSet, node ast.Node) string { - if v := formatNode(fset, node); v != nil { - return v.String() - } - return "" -} - -// NodeBytes works as NodeString but returns a byte slice. -// Return nil if node AST is invalid. -func NodeBytes(fset *token.FileSet, node ast.Node) []byte { - if v := formatNode(fset, node); v != nil { - return v.Bytes() - } - return nil -} - -func formatNode(fset *token.FileSet, node ast.Node) *bytes.Buffer { - buf := new(bytes.Buffer) - if err := format.Node(buf, fset, node); err != nil { - return nil - } - return buf -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/object.go b/vendor/github.com/Antonboom/testifylint/internal/analysisutil/object.go deleted file mode 100644 index 4e0346d2ba..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/object.go +++ /dev/null @@ -1,34 +0,0 @@ -package analysisutil - -import ( - "go/ast" - "go/types" -) - -// ObjectOf works in context of Golang package and returns types.Object for the given object's package and name. -// The search is based on the provided package and its dependencies (imports). -// Returns nil if the object is not found. -func ObjectOf(pkg *types.Package, objPkg, objName string) types.Object { - if pkg.Path() == objPkg { - return pkg.Scope().Lookup(objName) - } - - for _, i := range pkg.Imports() { - if trimVendor(i.Path()) == objPkg { - return i.Scope().Lookup(objName) - } - } - return nil -} - -// IsObj returns true if expression is identifier which notes to given types.Object. -// Useful in combination with types.Universe objects. -func IsObj(typesInfo *types.Info, expr ast.Expr, expected types.Object) bool { - id, ok := expr.(*ast.Ident) - if !ok { - return false - } - - obj := typesInfo.ObjectOf(id) - return obj == expected -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/pkg.go b/vendor/github.com/Antonboom/testifylint/internal/analysisutil/pkg.go deleted file mode 100644 index d34be5d341..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/analysisutil/pkg.go +++ /dev/null @@ -1,19 +0,0 @@ -package analysisutil - -import ( - "go/types" - "strings" -) - -// IsPkg checks that package has corresponding objName and path. -// Supports vendored packages. -func IsPkg(pkg *types.Package, name, path string) bool { - return pkg.Name() == name && trimVendor(pkg.Path()) == path -} - -func trimVendor(path string) string { - if strings.HasPrefix(path, "vendor/") { - return path[len("vendor/"):] - } - return path -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/blank_import.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/blank_import.go deleted file mode 100644 index 403691e270..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/blank_import.go +++ /dev/null @@ -1,69 +0,0 @@ -package checkers - -import ( - "fmt" - "strconv" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" - - "github.com/Antonboom/testifylint/internal/testify" -) - -// BlankImport detects useless blank imports of testify's packages. -// These imports are useless since testify doesn't do any magic with init() function. -// -// The checker detects situations like -// -// import ( -// "testing" -// -// _ "github.com/stretchr/testify" -// _ "github.com/stretchr/testify/assert" -// _ "github.com/stretchr/testify/http" -// _ "github.com/stretchr/testify/mock" -// _ "github.com/stretchr/testify/require" -// _ "github.com/stretchr/testify/suite" -// ) -// -// and requires -// -// import ( -// "testing" -// ) -type BlankImport struct{} - -// NewBlankImport constructs BlankImport checker. -func NewBlankImport() BlankImport { return BlankImport{} } -func (BlankImport) Name() string { return "blank-import" } - -func (checker BlankImport) Check(pass *analysis.Pass, _ *inspector.Inspector) (diagnostics []analysis.Diagnostic) { - for _, file := range pass.Files { - for _, imp := range file.Imports { - if imp.Name == nil || imp.Name.Name != "_" { - continue - } - - pkg, err := strconv.Unquote(imp.Path.Value) - if err != nil { - continue - } - if _, ok := packagesNotIntendedForBlankImport[pkg]; !ok { - continue - } - - msg := fmt.Sprintf("avoid blank import of %s as it does nothing", pkg) - diagnostics = append(diagnostics, *newDiagnostic(checker.Name(), imp, msg, nil)) - } - } - return diagnostics -} - -var packagesNotIntendedForBlankImport = map[string]struct{}{ - testify.ModulePath: {}, - testify.AssertPkgPath: {}, - testify.HTTPPkgPath: {}, - testify.MockPkgPath: {}, - testify.RequirePkgPath: {}, - testify.SuitePkgPath: {}, -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/bool_compare.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/bool_compare.go deleted file mode 100644 index c8db9420e7..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/bool_compare.go +++ /dev/null @@ -1,248 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// BoolCompare detects situations like -// -// assert.Equal(t, false, result) -// assert.EqualValues(t, false, result) -// assert.Exactly(t, false, result) -// assert.NotEqual(t, true, result) -// assert.NotEqualValues(t, true, result) -// assert.False(t, !result) -// assert.True(t, result == true) -// ... -// -// and requires -// -// assert.False(t, result) -// assert.True(t, result) -type BoolCompare struct{} // - -// NewBoolCompare constructs BoolCompare checker. -func NewBoolCompare() BoolCompare { return BoolCompare{} } -func (BoolCompare) Name() string { return "bool-compare" } - -func (checker BoolCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - newUseFnDiagnostic := func(proposed string, survivingArg ast.Node, replaceStart, replaceEnd token.Pos) *analysis.Diagnostic { - return newUseFunctionDiagnostic(checker.Name(), call, proposed, - newSuggestedFuncReplacement(call, proposed, analysis.TextEdit{ - Pos: replaceStart, - End: replaceEnd, - NewText: analysisutil.NodeBytes(pass.Fset, survivingArg), - }), - ) - } - - newUseTrueDiagnostic := func(survivingArg ast.Node, replaceStart, replaceEnd token.Pos) *analysis.Diagnostic { - return newUseFnDiagnostic("True", survivingArg, replaceStart, replaceEnd) - } - - newUseFalseDiagnostic := func(survivingArg ast.Node, replaceStart, replaceEnd token.Pos) *analysis.Diagnostic { - return newUseFnDiagnostic("False", survivingArg, replaceStart, replaceEnd) - } - - newNeedSimplifyDiagnostic := func(survivingArg ast.Node, replaceStart, replaceEnd token.Pos) *analysis.Diagnostic { - return newDiagnostic(checker.Name(), call, "need to simplify the assertion", - &analysis.SuggestedFix{ - Message: "Simplify the assertion", - TextEdits: []analysis.TextEdit{{ - Pos: replaceStart, - End: replaceEnd, - NewText: analysisutil.NodeBytes(pass.Fset, survivingArg), - }}, - }, - ) - } - - switch call.Fn.NameFTrimmed { - case "Equal", "EqualValues", "Exactly": - if len(call.Args) < 2 { - return nil - } - - arg1, arg2 := call.Args[0], call.Args[1] - if isEmptyInterface(pass, arg1) || isEmptyInterface(pass, arg2) { - return nil - } - - t1, t2 := isUntypedTrue(pass, arg1), isUntypedTrue(pass, arg2) - f1, f2 := isUntypedFalse(pass, arg1), isUntypedFalse(pass, arg2) - - switch { - case xor(t1, t2): - survivingArg, _ := anyVal([]bool{t1, t2}, arg2, arg1) - return newUseTrueDiagnostic(survivingArg, arg1.Pos(), arg2.End()) - - case xor(f1, f2): - survivingArg, _ := anyVal([]bool{f1, f2}, arg2, arg1) - return newUseFalseDiagnostic(survivingArg, arg1.Pos(), arg2.End()) - } - - case "NotEqual", "NotEqualValues": - if len(call.Args) < 2 { - return nil - } - - arg1, arg2 := call.Args[0], call.Args[1] - if isEmptyInterface(pass, arg1) || isEmptyInterface(pass, arg2) { - return nil - } - - t1, t2 := isUntypedTrue(pass, arg1), isUntypedTrue(pass, arg2) - f1, f2 := isUntypedFalse(pass, arg1), isUntypedFalse(pass, arg2) - - switch { - case xor(t1, t2): - survivingArg, _ := anyVal([]bool{t1, t2}, arg2, arg1) - return newUseFalseDiagnostic(survivingArg, arg1.Pos(), arg2.End()) - - case xor(f1, f2): - survivingArg, _ := anyVal([]bool{f1, f2}, arg2, arg1) - return newUseTrueDiagnostic(survivingArg, arg1.Pos(), arg2.End()) - } - - case "True": - if len(call.Args) < 1 { - return nil - } - expr := call.Args[0] - - { - arg1, ok1 := isComparisonWithTrue(pass, expr, token.EQL) - arg2, ok2 := isComparisonWithFalse(pass, expr, token.NEQ) - - survivingArg, ok := anyVal([]bool{ok1, ok2}, arg1, arg2) - if ok && !isEmptyInterface(pass, survivingArg) { - return newNeedSimplifyDiagnostic(survivingArg, expr.Pos(), expr.End()) - } - } - - { - arg1, ok1 := isComparisonWithTrue(pass, expr, token.NEQ) - arg2, ok2 := isComparisonWithFalse(pass, expr, token.EQL) - arg3, ok3 := isNegation(expr) - - survivingArg, ok := anyVal([]bool{ok1, ok2, ok3}, arg1, arg2, arg3) - if ok && !isEmptyInterface(pass, survivingArg) { - return newUseFalseDiagnostic(survivingArg, expr.Pos(), expr.End()) - } - } - - case "False": - if len(call.Args) < 1 { - return nil - } - expr := call.Args[0] - - { - arg1, ok1 := isComparisonWithTrue(pass, expr, token.EQL) - arg2, ok2 := isComparisonWithFalse(pass, expr, token.NEQ) - - survivingArg, ok := anyVal([]bool{ok1, ok2}, arg1, arg2) - if ok && !isEmptyInterface(pass, survivingArg) { - return newNeedSimplifyDiagnostic(survivingArg, expr.Pos(), expr.End()) - } - } - - { - arg1, ok1 := isComparisonWithTrue(pass, expr, token.NEQ) - arg2, ok2 := isComparisonWithFalse(pass, expr, token.EQL) - arg3, ok3 := isNegation(expr) - - survivingArg, ok := anyVal([]bool{ok1, ok2, ok3}, arg1, arg2, arg3) - if ok && !isEmptyInterface(pass, survivingArg) { - return newUseTrueDiagnostic(survivingArg, expr.Pos(), expr.End()) - } - } - } - return nil -} - -var ( - falseObj = types.Universe.Lookup("false") - trueObj = types.Universe.Lookup("true") -) - -func isUntypedTrue(pass *analysis.Pass, e ast.Expr) bool { - return analysisutil.IsObj(pass.TypesInfo, e, trueObj) -} - -func isUntypedFalse(pass *analysis.Pass, e ast.Expr) bool { - return analysisutil.IsObj(pass.TypesInfo, e, falseObj) -} - -func isComparisonWithTrue(pass *analysis.Pass, e ast.Expr, op token.Token) (ast.Expr, bool) { - return isComparisonWith(pass, e, isUntypedTrue, op) -} - -func isComparisonWithFalse(pass *analysis.Pass, e ast.Expr, op token.Token) (ast.Expr, bool) { - return isComparisonWith(pass, e, isUntypedFalse, op) -} - -type predicate func(pass *analysis.Pass, e ast.Expr) bool - -func isComparisonWith(pass *analysis.Pass, e ast.Expr, predicate predicate, op token.Token) (ast.Expr, bool) { - be, ok := e.(*ast.BinaryExpr) - if !ok { - return nil, false - } - if be.Op != op { - return nil, false - } - - t1, t2 := predicate(pass, be.X), predicate(pass, be.Y) - if xor(t1, t2) { - if t1 { - return be.Y, true - } - return be.X, true - } - return nil, false -} - -func isNegation(e ast.Expr) (ast.Expr, bool) { - ue, ok := e.(*ast.UnaryExpr) - if !ok { - return nil, false - } - return ue.X, ue.Op == token.NOT -} - -func xor(a, b bool) bool { - return a != b -} - -// anyVal returns the first value[i] for which bools[i] is true. -func anyVal[T any](bools []bool, vals ...T) (T, bool) { - if len(bools) != len(vals) { - panic("inconsistent usage of valOr") //nolint:forbidigo // Does not depend on the code being analyzed. - } - - for i, b := range bools { - if b { - return vals[i], true - } - } - - var _default T - return _default, false -} - -func isEmptyInterface(pass *analysis.Pass, expr ast.Expr) bool { - t, ok := pass.TypesInfo.Types[expr] - if !ok { - return false - } - - iface, ok := t.Type.Underlying().(*types.Interface) - return ok && iface.NumMethods() == 0 -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/call_meta.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/call_meta.go deleted file mode 100644 index 44eed49a62..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/call_meta.go +++ /dev/null @@ -1,136 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - "strings" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" - "github.com/Antonboom/testifylint/internal/testify" -) - -// CallMeta stores meta info about assertion function/method call, for example -// -// assert.Equal(t, 42, result, "helpful comment") -type CallMeta struct { - // Range contains start and end position of assertion call. - analysis.Range - // IsPkg true if this is package (not object) call. - IsPkg bool - // IsAssert true if this is "testify/assert" package (or object) call. - IsAssert bool - // Selector is the AST expression of "assert.Equal". - Selector *ast.SelectorExpr - // SelectorXStr is a string representation of Selector's left part – value before point, e.g. "assert". - SelectorXStr string - // Fn stores meta info about assertion function itself. - Fn FnMeta - // Args stores assertion call arguments but without `t *testing.T` argument. - // E.g [42, result, "helpful comment"]. - Args []ast.Expr - // ArgsRaw stores assertion call initial arguments. - // E.g [t, 42, result, "helpful comment"]. - ArgsRaw []ast.Expr -} - -func (c CallMeta) String() string { - return c.SelectorXStr + "." + c.Fn.Name -} - -// FnMeta stores meta info about assertion function itself, for example "Equal". -type FnMeta struct { - // Range contains start and end position of function Name. - analysis.Range - // Name is a function name. - Name string - // NameFTrimmed is a function name without "f" suffix. - NameFTrimmed string - // IsFmt is true if function is formatted, e.g. "Equalf". - IsFmt bool -} - -// NewCallMeta returns meta information about testify assertion call. -// Returns nil if ast.CallExpr is not testify call. -func NewCallMeta(pass *analysis.Pass, ce *ast.CallExpr) *CallMeta { - se, ok := ce.Fun.(*ast.SelectorExpr) - if !ok || se.Sel == nil { - return nil - } - fnName := se.Sel.Name - - initiatorPkg, isPkgCall := func() (*types.Package, bool) { - // Examples: - // s.Assert -> method of *suite.Suite -> package suite ("vendor/github.com/stretchr/testify/suite") - // s.Assert().Equal -> method of *assert.Assertions -> package assert ("vendor/github.com/stretchr/testify/assert") - // s.Equal -> method of *assert.Assertions -> package assert ("vendor/github.com/stretchr/testify/assert") - // reqObj.Falsef -> method of *require.Assertions -> package require ("vendor/github.com/stretchr/testify/require") - if sel, ok := pass.TypesInfo.Selections[se]; ok { - return sel.Obj().Pkg(), false - } - - // Examples: - // assert.False -> assert -> package assert ("vendor/github.com/stretchr/testify/assert") - // require.NotEqualf -> require -> package require ("vendor/github.com/stretchr/testify/require") - if id, ok := se.X.(*ast.Ident); ok { - if selObj := pass.TypesInfo.ObjectOf(id); selObj != nil { - if pkg, ok := selObj.(*types.PkgName); ok { - return pkg.Imported(), true - } - } - } - return nil, false - }() - if initiatorPkg == nil { - return nil - } - - isAssert := analysisutil.IsPkg(initiatorPkg, testify.AssertPkgName, testify.AssertPkgPath) - isRequire := analysisutil.IsPkg(initiatorPkg, testify.RequirePkgName, testify.RequirePkgPath) - if !(isAssert || isRequire) { - return nil - } - - return &CallMeta{ - Range: ce, - IsPkg: isPkgCall, - IsAssert: isAssert, - Selector: se, - SelectorXStr: analysisutil.NodeString(pass.Fset, se.X), - Fn: FnMeta{ - Range: se.Sel, - Name: fnName, - NameFTrimmed: strings.TrimSuffix(fnName, "f"), - IsFmt: strings.HasSuffix(fnName, "f"), - }, - Args: trimTArg(pass, ce.Args), - ArgsRaw: ce.Args, - } -} - -func trimTArg(pass *analysis.Pass, args []ast.Expr) []ast.Expr { - if len(args) == 0 { - return args - } - - if isTestingTPtr(pass, args[0]) { - return args[1:] - } - return args -} - -func isTestingTPtr(pass *analysis.Pass, arg ast.Expr) bool { - assertTestingTObj := analysisutil.ObjectOf(pass.Pkg, testify.AssertPkgPath, "TestingT") - requireTestingTObj := analysisutil.ObjectOf(pass.Pkg, testify.RequirePkgPath, "TestingT") - - argType := pass.TypesInfo.TypeOf(arg) - if argType == nil { - return false - } - - return ((assertTestingTObj != nil) && - types.Implements(argType, assertTestingTObj.Type().Underlying().(*types.Interface))) || - ((requireTestingTObj != nil) && - types.Implements(argType, requireTestingTObj.Type().Underlying().(*types.Interface))) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/checker.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/checker.go deleted file mode 100644 index ac23af6f6f..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/checker.go +++ /dev/null @@ -1,23 +0,0 @@ -package checkers - -import ( - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" -) - -// Checker describes named checker. -type Checker interface { - Name() string -} - -// RegularChecker check assertion call presented in CallMeta form. -type RegularChecker interface { - Checker - Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic -} - -// AdvancedChecker implements complex Check logic different from trivial CallMeta check. -type AdvancedChecker interface { - Checker - Check(pass *analysis.Pass, inspector *inspector.Inspector) []analysis.Diagnostic -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/checkers_registry.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/checkers_registry.go deleted file mode 100644 index e34a21bf9c..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/checkers_registry.go +++ /dev/null @@ -1,105 +0,0 @@ -package checkers - -import ( - "sort" -) - -// registry stores checkers meta information in checkers' priority order. -var registry = checkersRegistry{ - // Regular checkers. - {factory: asCheckerFactory(NewFloatCompare), enabledByDefault: true}, - {factory: asCheckerFactory(NewBoolCompare), enabledByDefault: true}, - {factory: asCheckerFactory(NewEmpty), enabledByDefault: true}, - {factory: asCheckerFactory(NewLen), enabledByDefault: true}, - {factory: asCheckerFactory(NewCompares), enabledByDefault: true}, - {factory: asCheckerFactory(NewErrorNil), enabledByDefault: true}, - {factory: asCheckerFactory(NewNilCompare), enabledByDefault: true}, - {factory: asCheckerFactory(NewErrorIsAs), enabledByDefault: true}, - {factory: asCheckerFactory(NewExpectedActual), enabledByDefault: true}, - {factory: asCheckerFactory(NewSuiteExtraAssertCall), enabledByDefault: true}, - {factory: asCheckerFactory(NewSuiteDontUsePkg), enabledByDefault: true}, - {factory: asCheckerFactory(NewUselessAssert), enabledByDefault: true}, - // Advanced checkers. - {factory: asCheckerFactory(NewBlankImport), enabledByDefault: true}, - {factory: asCheckerFactory(NewGoRequire), enabledByDefault: true}, - {factory: asCheckerFactory(NewRequireError), enabledByDefault: true}, - {factory: asCheckerFactory(NewSuiteTHelper), enabledByDefault: false}, -} - -type checkersRegistry []checkerMeta - -type checkerMeta struct { - factory checkerFactory - enabledByDefault bool -} - -type checkerFactory func() Checker - -func asCheckerFactory[T Checker](fn func() T) checkerFactory { - return func() Checker { - return fn() - } -} - -func (r checkersRegistry) get(name string) (m checkerMeta, priority int, found bool) { - for i, meta := range r { - if meta.factory().Name() == name { - return meta, i, true - } - } - return checkerMeta{}, 0, false -} - -// All returns all checkers names sorted by checker's priority. -func All() []string { - result := make([]string, 0, len(registry)) - for _, meta := range registry { - result = append(result, meta.factory().Name()) - } - return result -} - -// EnabledByDefault returns checkers enabled by default sorted by checker's priority. -func EnabledByDefault() []string { - result := make([]string, 0, len(registry)) - for _, meta := range registry { - if meta.enabledByDefault { - result = append(result, meta.factory().Name()) - } - } - return result -} - -// Get returns new checker instance by checker's name. -func Get(name string) (Checker, bool) { - meta, _, ok := registry.get(name) - if ok { - return meta.factory(), true - } - return nil, false -} - -// IsKnown checks if there is a checker with that name. -func IsKnown(name string) bool { - _, _, ok := registry.get(name) - return ok -} - -// IsEnabledByDefault returns true if a checker is enabled by default. -// Returns false if there is no such checker in the registry. -// For pre-validation use Get or IsKnown. -func IsEnabledByDefault(name string) bool { - meta, _, ok := registry.get(name) - return ok && meta.enabledByDefault -} - -// SortByPriority mutates the input checkers names by sorting them in checker priority order. -// Ignores unknown checkers. For pre-validation use Get or IsKnown. -func SortByPriority(checkers []string) { - sort.Slice(checkers, func(i, j int) bool { - lhs, rhs := checkers[i], checkers[j] - _, lhsPriority, _ := registry.get(lhs) - _, rhsPriority, _ := registry.get(rhs) - return lhsPriority < rhsPriority - }) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/compares.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/compares.go deleted file mode 100644 index 336a345124..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/compares.go +++ /dev/null @@ -1,96 +0,0 @@ -package checkers - -import ( - "bytes" - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// Compares detects situations like -// -// assert.True(t, a == b) -// assert.True(t, a != b) -// assert.True(t, a > b) -// assert.True(t, a >= b) -// assert.True(t, a < b) -// assert.True(t, a <= b) -// assert.False(t, a == b) -// ... -// -// and requires -// -// assert.Equal(t, a, b) -// assert.NotEqual(t, a, b) -// assert.Greater(t, a, b) -// assert.GreaterOrEqual(t, a, b) -// assert.Less(t, a, b) -// assert.LessOrEqual(t, a, b) -type Compares struct{} - -// NewCompares constructs Compares checker. -func NewCompares() Compares { return Compares{} } -func (Compares) Name() string { return "compares" } - -func (checker Compares) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - if len(call.Args) < 1 { - return nil - } - - be, ok := call.Args[0].(*ast.BinaryExpr) - if !ok { - return nil - } - - var tokenToProposedFn map[token.Token]string - - switch call.Fn.NameFTrimmed { - case "True": - tokenToProposedFn = tokenToProposedFnInsteadOfTrue - case "False": - tokenToProposedFn = tokenToProposedFnInsteadOfFalse - default: - return nil - } - - if proposedFn, ok := tokenToProposedFn[be.Op]; ok { - a, b := be.X, be.Y - return newUseFunctionDiagnostic(checker.Name(), call, proposedFn, - newSuggestedFuncReplacement(call, proposedFn, analysis.TextEdit{ - Pos: be.X.Pos(), - End: be.Y.End(), - NewText: formatAsCallArgs(pass, a, b), - }), - ) - } - return nil -} - -var tokenToProposedFnInsteadOfTrue = map[token.Token]string{ - token.EQL: "Equal", - token.NEQ: "NotEqual", - token.GTR: "Greater", - token.GEQ: "GreaterOrEqual", - token.LSS: "Less", - token.LEQ: "LessOrEqual", -} - -var tokenToProposedFnInsteadOfFalse = map[token.Token]string{ - token.EQL: "NotEqual", - token.NEQ: "Equal", - token.GTR: "LessOrEqual", - token.GEQ: "Less", - token.LSS: "GreaterOrEqual", - token.LEQ: "Greater", -} - -// formatAsCallArgs joins a and b and return bytes like `a, b`. -func formatAsCallArgs(pass *analysis.Pass, a, b ast.Node) []byte { - return bytes.Join([][]byte{ - analysisutil.NodeBytes(pass.Fset, a), - analysisutil.NodeBytes(pass.Fset, b), - }, []byte(", ")) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/diagnostic.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/diagnostic.go deleted file mode 100644 index 4ab69c69bb..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/diagnostic.go +++ /dev/null @@ -1,60 +0,0 @@ -package checkers - -import ( - "fmt" - - "golang.org/x/tools/go/analysis" -) - -func newUseFunctionDiagnostic( - checker string, - call *CallMeta, - proposedFn string, - fix *analysis.SuggestedFix, -) *analysis.Diagnostic { - f := proposedFn - if call.Fn.IsFmt { - f += "f" - } - msg := fmt.Sprintf("use %s.%s", call.SelectorXStr, f) - - return newDiagnostic(checker, call, msg, fix) -} - -func newDiagnostic( - checker string, - rng analysis.Range, - msg string, - fix *analysis.SuggestedFix, -) *analysis.Diagnostic { - d := analysis.Diagnostic{ - Pos: rng.Pos(), - End: rng.End(), - Category: checker, - Message: checker + ": " + msg, - } - if fix != nil { - d.SuggestedFixes = []analysis.SuggestedFix{*fix} - } - return &d -} - -func newSuggestedFuncReplacement( - call *CallMeta, - proposedFn string, - additionalEdits ...analysis.TextEdit, -) *analysis.SuggestedFix { - if call.Fn.IsFmt { - proposedFn += "f" - } - return &analysis.SuggestedFix{ - Message: fmt.Sprintf("Replace `%s` with `%s`", call.Fn.Name, proposedFn), - TextEdits: append([]analysis.TextEdit{ - { - Pos: call.Fn.Pos(), - End: call.Fn.End(), - NewText: []byte(proposedFn), - }, - }, additionalEdits...), - } -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/empty.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/empty.go deleted file mode 100644 index 5ad371bb4f..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/empty.go +++ /dev/null @@ -1,172 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// Empty detects situations like -// -// assert.Len(t, arr, 0) -// assert.Equal(t, 0, len(arr)) -// assert.EqualValues(t, 0, len(arr)) -// assert.Exactly(t, 0, len(arr)) -// assert.LessOrEqual(t, len(arr), 0) -// assert.GreaterOrEqual(t, 0, len(arr)) -// assert.Less(t, len(arr), 0) -// assert.Greater(t, 0, len(arr)) -// assert.Less(t, len(arr), 1) -// assert.Greater(t, 1, len(arr)) -// -// assert.NotEqual(t, 0, len(arr)) -// assert.NotEqualValues(t, 0, len(arr)) -// assert.Less(t, 0, len(arr)) -// assert.Greater(t, len(arr), 0) -// -// and requires -// -// assert.Empty(t, arr) -// assert.NotEmpty(t, arr) -type Empty struct{} - -// NewEmpty constructs Empty checker. -func NewEmpty() Empty { return Empty{} } -func (Empty) Name() string { return "empty" } - -func (checker Empty) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - if d := checker.checkEmpty(pass, call); d != nil { - return d - } - return checker.checkNotEmpty(pass, call) -} - -func (checker Empty) checkEmpty(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { //nolint:gocognit - newUseEmptyDiagnostic := func(replaceStart, replaceEnd token.Pos, replaceWith ast.Expr) *analysis.Diagnostic { - const proposed = "Empty" - return newUseFunctionDiagnostic(checker.Name(), call, proposed, - newSuggestedFuncReplacement(call, proposed, analysis.TextEdit{ - Pos: replaceStart, - End: replaceEnd, - NewText: analysisutil.NodeBytes(pass.Fset, replaceWith), - }), - ) - } - - if len(call.Args) < 2 { - return nil - } - a, b := call.Args[0], call.Args[1] - - switch call.Fn.NameFTrimmed { - case "Len": - if isZero(b) { - return newUseEmptyDiagnostic(a.Pos(), b.End(), a) - } - - case "Equal", "EqualValues", "Exactly": - arg1, ok1 := isLenCallAndZero(pass, a, b) - arg2, ok2 := isLenCallAndZero(pass, b, a) - - if lenArg, ok := anyVal([]bool{ok1, ok2}, arg1, arg2); ok { - return newUseEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "LessOrEqual": - if lenArg, ok := isBuiltinLenCall(pass, a); ok && isZero(b) { - return newUseEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "GreaterOrEqual": - if lenArg, ok := isBuiltinLenCall(pass, b); ok && isZero(a) { - return newUseEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "Less": - if lenArg, ok := isBuiltinLenCall(pass, a); ok && (isOne(b) || isZero(b)) { - return newUseEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "Greater": - if lenArg, ok := isBuiltinLenCall(pass, b); ok && (isOne(a) || isZero(a)) { - return newUseEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - } - return nil -} - -func (checker Empty) checkNotEmpty(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { //nolint:gocognit - newUseNotEmptyDiagnostic := func(replaceStart, replaceEnd token.Pos, replaceWith ast.Expr) *analysis.Diagnostic { - const proposed = "NotEmpty" - return newUseFunctionDiagnostic(checker.Name(), call, proposed, - newSuggestedFuncReplacement(call, proposed, analysis.TextEdit{ - Pos: replaceStart, - End: replaceEnd, - NewText: analysisutil.NodeBytes(pass.Fset, replaceWith), - }), - ) - } - - if len(call.Args) < 2 { - return nil - } - a, b := call.Args[0], call.Args[1] - - switch call.Fn.NameFTrimmed { - case "NotEqual", "NotEqualValues": - arg1, ok1 := isLenCallAndZero(pass, a, b) - arg2, ok2 := isLenCallAndZero(pass, b, a) - - if lenArg, ok := anyVal([]bool{ok1, ok2}, arg1, arg2); ok { - return newUseNotEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "Less": - if lenArg, ok := isBuiltinLenCall(pass, b); ok && isZero(a) { - return newUseNotEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - - case "Greater": - if lenArg, ok := isBuiltinLenCall(pass, a); ok && isZero(b) { - return newUseNotEmptyDiagnostic(a.Pos(), b.End(), lenArg) - } - } - return nil -} - -var lenObj = types.Universe.Lookup("len") - -func isLenCallAndZero(pass *analysis.Pass, a, b ast.Expr) (ast.Expr, bool) { - lenArg, ok := isBuiltinLenCall(pass, a) - return lenArg, ok && isZero(b) -} - -func isBuiltinLenCall(pass *analysis.Pass, e ast.Expr) (ast.Expr, bool) { - ce, ok := e.(*ast.CallExpr) - if !ok { - return nil, false - } - - if analysisutil.IsObj(pass.TypesInfo, ce.Fun, lenObj) && len(ce.Args) == 1 { - return ce.Args[0], true - } - return nil, false -} - -func isZero(e ast.Expr) bool { - return isIntNumber(e, 0) -} - -func isOne(e ast.Expr) bool { - return isIntNumber(e, 1) -} - -func isIntNumber(e ast.Expr, v int) bool { - bl, ok := e.(*ast.BasicLit) - return ok && bl.Kind == token.INT && bl.Value == fmt.Sprintf("%d", v) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/error_is_as.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/error_is_as.go deleted file mode 100644 index 0363873a63..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/error_is_as.go +++ /dev/null @@ -1,166 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// ErrorIsAs detects situations like -// -// assert.Error(t, err, errSentinel) -// assert.NoError(t, err, errSentinel) -// assert.True(t, errors.Is(err, errSentinel)) -// assert.False(t, errors.Is(err, errSentinel)) -// assert.True(t, errors.As(err, &target)) -// -// and requires -// -// assert.ErrorIs(t, err, errSentinel) -// assert.NotErrorIs(t, err, errSentinel) -// assert.ErrorAs(t, err, &target) -// -// Also ErrorIsAs repeats go vet's "errorsas" check logic. -type ErrorIsAs struct{} - -// NewErrorIsAs constructs ErrorIsAs checker. -func NewErrorIsAs() ErrorIsAs { return ErrorIsAs{} } -func (ErrorIsAs) Name() string { return "error-is-as" } - -func (checker ErrorIsAs) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - switch call.Fn.NameFTrimmed { - case "Error": - if len(call.Args) >= 2 && isError(pass, call.Args[1]) { - const proposed = "ErrorIs" - msg := fmt.Sprintf("invalid usage of %[1]s.Error, use %[1]s.%[2]s instead", call.SelectorXStr, proposed) - return newDiagnostic(checker.Name(), call, msg, newSuggestedFuncReplacement(call, proposed)) - } - - case "NoError": - if len(call.Args) >= 2 && isError(pass, call.Args[1]) { - const proposed = "NotErrorIs" - msg := fmt.Sprintf("invalid usage of %[1]s.NoError, use %[1]s.%[2]s instead", call.SelectorXStr, proposed) - return newDiagnostic(checker.Name(), call, msg, newSuggestedFuncReplacement(call, proposed)) - } - - case "True": - if len(call.Args) < 1 { - return nil - } - - ce, ok := call.Args[0].(*ast.CallExpr) - if !ok { - return nil - } - if len(ce.Args) != 2 { - return nil - } - - var proposed string - switch { - case isErrorsIsCall(pass, ce): - proposed = "ErrorIs" - case isErrorsAsCall(pass, ce): - proposed = "ErrorAs" - } - if proposed != "" { - return newUseFunctionDiagnostic(checker.Name(), call, proposed, - newSuggestedFuncReplacement(call, proposed, analysis.TextEdit{ - Pos: ce.Pos(), - End: ce.End(), - NewText: formatAsCallArgs(pass, ce.Args[0], ce.Args[1]), - }), - ) - } - - case "False": - if len(call.Args) < 1 { - return nil - } - - ce, ok := call.Args[0].(*ast.CallExpr) - if !ok { - return nil - } - if len(ce.Args) != 2 { - return nil - } - - if isErrorsIsCall(pass, ce) { - const proposed = "NotErrorIs" - return newUseFunctionDiagnostic(checker.Name(), call, proposed, - newSuggestedFuncReplacement(call, proposed, analysis.TextEdit{ - Pos: ce.Pos(), - End: ce.End(), - NewText: formatAsCallArgs(pass, ce.Args[0], ce.Args[1]), - }), - ) - } - - case "ErrorAs": - if len(call.Args) < 2 { - return nil - } - - // NOTE(a.telyshev): Logic below must be consistent with - // https://cs.opensource.google/go/x/tools/+/master:go/analysis/passes/errorsas/errorsas.go - - var ( - defaultReport = fmt.Sprintf("second argument to %s must be a non-nil pointer to either a type that implements error, or to any interface type", call) //nolint:lll - errorPtrReport = fmt.Sprintf("second argument to %s should not be *error", call) - ) - - target := call.Args[1] - - if isEmptyInterface(pass, target) { - // `any` interface case. It is always allowed, since it often indicates - // a value forwarded from another source. - return nil - } - - tv, ok := pass.TypesInfo.Types[target] - if !ok { - return nil - } - - pt, ok := tv.Type.Underlying().(*types.Pointer) - if !ok { - return newDiagnostic(checker.Name(), call, defaultReport, nil) - } - if pt.Elem() == errorType { - return newDiagnostic(checker.Name(), call, errorPtrReport, nil) - } - - _, isInterface := pt.Elem().Underlying().(*types.Interface) - if !isInterface && !types.Implements(pt.Elem(), errorIface) { - return newDiagnostic(checker.Name(), call, defaultReport, nil) - } - } - return nil -} - -func isErrorsIsCall(pass *analysis.Pass, ce *ast.CallExpr) bool { - return isErrorsPkgFnCall(pass, ce, "Is") -} - -func isErrorsAsCall(pass *analysis.Pass, ce *ast.CallExpr) bool { - return isErrorsPkgFnCall(pass, ce, "As") -} - -func isErrorsPkgFnCall(pass *analysis.Pass, ce *ast.CallExpr, fn string) bool { - se, ok := ce.Fun.(*ast.SelectorExpr) - if !ok { - return false - } - - errorsIsObj := analysisutil.ObjectOf(pass.Pkg, "errors", fn) - if errorsIsObj == nil { - return false - } - - return analysisutil.IsObj(pass.TypesInfo, se.Sel, errorsIsObj) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/error_nil.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/error_nil.go deleted file mode 100644 index 5b0af7458f..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/error_nil.go +++ /dev/null @@ -1,113 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// ErrorNil detects situations like -// -// assert.Nil(t, err) -// assert.NotNil(t, err) -// assert.Equal(t, nil, err) -// assert.EqualValues(t, nil, err) -// assert.Exactly(t, nil, err) -// assert.ErrorIs(t, err, nil) -// -// assert.NotEqual(t, nil, err) -// assert.NotEqualValues(t, nil, err) -// assert.NotErrorIs(t, err, nil) -// -// and requires -// -// assert.NoError(t, err) -// assert.Error(t, err) -type ErrorNil struct{} - -// NewErrorNil constructs ErrorNil checker. -func NewErrorNil() ErrorNil { return ErrorNil{} } -func (ErrorNil) Name() string { return "error-nil" } - -func (checker ErrorNil) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - const ( - errorFn = "Error" - noErrorFn = "NoError" - ) - - proposedFn, survivingArg, replacementEndPos := func() (string, ast.Expr, token.Pos) { - switch call.Fn.NameFTrimmed { - case "Nil": - if len(call.Args) >= 1 && isError(pass, call.Args[0]) { - return noErrorFn, call.Args[0], call.Args[0].End() - } - - case "NotNil": - if len(call.Args) >= 1 && isError(pass, call.Args[0]) { - return errorFn, call.Args[0], call.Args[0].End() - } - - case "Equal", "EqualValues", "Exactly", "ErrorIs": - if len(call.Args) < 2 { - return "", nil, token.NoPos - } - a, b := call.Args[0], call.Args[1] - - switch { - case isError(pass, a) && isNil(b): - return noErrorFn, a, b.End() - case isNil(a) && isError(pass, b): - return noErrorFn, b, b.End() - } - - case "NotEqual", "NotEqualValues", "NotErrorIs": - if len(call.Args) < 2 { - return "", nil, token.NoPos - } - a, b := call.Args[0], call.Args[1] - - switch { - case isError(pass, a) && isNil(b): - return errorFn, a, b.End() - case isNil(a) && isError(pass, b): - return errorFn, b, b.End() - } - } - return "", nil, token.NoPos - }() - - if proposedFn != "" { - return newUseFunctionDiagnostic(checker.Name(), call, proposedFn, - newSuggestedFuncReplacement(call, proposedFn, analysis.TextEdit{ - Pos: call.Args[0].Pos(), - End: replacementEndPos, - NewText: analysisutil.NodeBytes(pass.Fset, survivingArg), - }), - ) - } - return nil -} - -var ( - errorType = types.Universe.Lookup("error").Type() - errorIface = errorType.Underlying().(*types.Interface) -) - -func isError(pass *analysis.Pass, expr ast.Expr) bool { - t := pass.TypesInfo.TypeOf(expr) - if t == nil { - return false - } - - _, ok := t.Underlying().(*types.Interface) - return ok && types.Implements(t, errorIface) -} - -func isNil(expr ast.Expr) bool { - ident, ok := expr.(*ast.Ident) - return ok && ident.Name == "nil" -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/expected_actual.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/expected_actual.go deleted file mode 100644 index 0cd01dedaf..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/expected_actual.go +++ /dev/null @@ -1,212 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - "regexp" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// DefaultExpectedVarPattern matches variables with "expected" or "wanted" prefix or suffix in the name. -var DefaultExpectedVarPattern = regexp.MustCompile( - `(^(exp(ected)?|want(ed)?)([A-Z]\w*)?$)|(^(\w*[a-z])?(Exp(ected)?|Want(ed)?)$)`) - -// ExpectedActual detects situation like -// -// assert.Equal(t, result, expected) -// assert.EqualExportedValues(t, resultObj, User{Name: "Anton"}) -// assert.EqualValues(t, result, 42) -// assert.Exactly(t, result, int64(42)) -// assert.JSONEq(t, result, `{"version": 3}`) -// assert.InDelta(t, result, 42.42, 1.0) -// assert.InDeltaMapValues(t, result, map[string]float64{"score": 0.99}, 1.0) -// assert.InDeltaSlice(t, result, []float64{0.98, 0.99}, 1.0) -// assert.InEpsilon(t, result, 42.42, 0.0001) -// assert.InEpsilonSlice(t, result, []float64{0.9801, 0.9902}, 0.0001) -// assert.IsType(t, result, (*User)(nil)) -// assert.NotEqual(t, result, "expected") -// assert.NotEqualValues(t, result, "expected") -// assert.NotSame(t, resultPtr, &value) -// assert.Same(t, resultPtr, &value) -// assert.WithinDuration(t, resultTime, time.Date(2023, 01, 12, 11, 46, 33, 0, nil), time.Second) -// assert.YAMLEq(t, result, "version: '3'") -// -// and requires -// -// assert.Equal(t, expected, result) -// assert.EqualExportedValues(t, User{Name: "Anton"}, resultObj) -// assert.EqualValues(t, 42, result) -// ... -type ExpectedActual struct { - expVarPattern *regexp.Regexp -} - -// NewExpectedActual constructs ExpectedActual checker using DefaultExpectedVarPattern. -func NewExpectedActual() *ExpectedActual { - return &ExpectedActual{expVarPattern: DefaultExpectedVarPattern} -} - -func (ExpectedActual) Name() string { return "expected-actual" } - -func (checker *ExpectedActual) SetExpVarPattern(p *regexp.Regexp) *ExpectedActual { - if p != nil { - checker.expVarPattern = p - } - return checker -} - -func (checker ExpectedActual) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - switch call.Fn.NameFTrimmed { - case "Equal", - "EqualExportedValues", - "EqualValues", - "Exactly", - "InDelta", - "InDeltaMapValues", - "InDeltaSlice", - "InEpsilon", - "InEpsilonSlice", - "IsType", - "JSONEq", - "NotEqual", - "NotEqualValues", - "NotSame", - "Same", - "WithinDuration", - "YAMLEq": - default: - return nil - } - - if len(call.Args) < 2 { - return nil - } - first, second := call.Args[0], call.Args[1] - - if checker.isWrongExpectedActualOrder(pass, first, second) { - return newDiagnostic(checker.Name(), call, "need to reverse actual and expected values", &analysis.SuggestedFix{ - Message: "Reverse actual and expected values", - TextEdits: []analysis.TextEdit{ - { - Pos: first.Pos(), - End: second.End(), - NewText: formatAsCallArgs(pass, second, first), - }, - }, - }) - } - return nil -} - -func (checker ExpectedActual) isWrongExpectedActualOrder(pass *analysis.Pass, first, second ast.Expr) bool { - leftIsCandidate := checker.isExpectedValueCandidate(pass, first) - rightIsCandidate := checker.isExpectedValueCandidate(pass, second) - return rightIsCandidate && !leftIsCandidate -} - -func (checker ExpectedActual) isExpectedValueCandidate(pass *analysis.Pass, expr ast.Expr) bool { - switch v := expr.(type) { - case *ast.CompositeLit: - return true - - case *ast.CallExpr: - return isParenExpr(v) || - isCastedBasicLitOrExpectedValue(v, checker.expVarPattern) || - isExpectedValueFactory(pass, v, checker.expVarPattern) - } - - return isBasicLit(expr) || - isUntypedConst(pass, expr) || - isTypedConst(pass, expr) || - isAddressOperation(expr) || - isIdentNamedAsExpected(checker.expVarPattern, expr) || - isStructVarNamedAsExpected(checker.expVarPattern, expr) || - isStructFieldNamedAsExpected(checker.expVarPattern, expr) -} - -func isParenExpr(ce *ast.CallExpr) bool { - _, ok := ce.Fun.(*ast.ParenExpr) - return ok -} - -func isCastedBasicLitOrExpectedValue(ce *ast.CallExpr, pattern *regexp.Regexp) bool { - if len(ce.Args) != 1 { - return false - } - - fn, ok := ce.Fun.(*ast.Ident) - if !ok { - return false - } - - switch fn.Name { - case "complex64", "complex128": - return true - - case "uint", "uint8", "uint16", "uint32", "uint64", - "int", "int8", "int16", "int32", "int64", - "float32", "float64", - "rune", "string": - return isBasicLit(ce.Args[0]) || isIdentNamedAsExpected(pattern, ce.Args[0]) - } - return false -} - -func isExpectedValueFactory(pass *analysis.Pass, ce *ast.CallExpr, pattern *regexp.Regexp) bool { - switch fn := ce.Fun.(type) { - case *ast.Ident: - return pattern.MatchString(fn.Name) - - case *ast.SelectorExpr: - timeDateFn := analysisutil.ObjectOf(pass.Pkg, "time", "Date") - if timeDateFn != nil && analysisutil.IsObj(pass.TypesInfo, fn.Sel, timeDateFn) { - return true - } - return pattern.MatchString(fn.Sel.Name) - } - return false -} - -func isBasicLit(e ast.Expr) bool { - _, ok := e.(*ast.BasicLit) - return ok -} - -func isUntypedConst(p *analysis.Pass, e ast.Expr) bool { - t := p.TypesInfo.TypeOf(e) - if t == nil { - return false - } - - b, ok := t.(*types.Basic) - return ok && b.Info()&types.IsUntyped > 0 -} - -func isTypedConst(p *analysis.Pass, e ast.Expr) bool { - tt, ok := p.TypesInfo.Types[e] - return ok && tt.IsValue() && tt.Value != nil -} - -func isAddressOperation(e ast.Expr) bool { - ue, ok := e.(*ast.UnaryExpr) - return ok && ue.Op == token.AND -} - -func isIdentNamedAsExpected(pattern *regexp.Regexp, e ast.Expr) bool { - id, ok := e.(*ast.Ident) - return ok && pattern.MatchString(id.Name) -} - -func isStructVarNamedAsExpected(pattern *regexp.Regexp, e ast.Expr) bool { - s, ok := e.(*ast.SelectorExpr) - return ok && isIdentNamedAsExpected(pattern, s.X) -} - -func isStructFieldNamedAsExpected(pattern *regexp.Regexp, e ast.Expr) bool { - s, ok := e.(*ast.SelectorExpr) - return ok && isIdentNamedAsExpected(pattern, s.Sel) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/float_compare.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/float_compare.go deleted file mode 100644 index 10b1330de8..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/float_compare.go +++ /dev/null @@ -1,70 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" -) - -// FloatCompare detects situation like -// -// assert.Equal(t, 42.42, result) -// assert.EqualValues(t, 42.42, result) -// assert.Exactly(t, 42.42, result) -// assert.True(t, result == 42.42) -// assert.False(t, result != 42.42) -// -// and requires -// -// assert.InEpsilon(t, 42.42, result, 0.0001) // Or assert.InDelta -type FloatCompare struct{} - -// NewFloatCompare constructs FloatCompare checker. -func NewFloatCompare() FloatCompare { return FloatCompare{} } -func (FloatCompare) Name() string { return "float-compare" } - -func (checker FloatCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - invalid := func() bool { - switch call.Fn.NameFTrimmed { - case "Equal", "EqualValues", "Exactly": - return len(call.Args) > 1 && (isFloat(pass, call.Args[0]) || isFloat(pass, call.Args[1])) - - case "True": - return len(call.Args) > 0 && isFloatCompare(pass, call.Args[0], token.EQL) - - case "False": - return len(call.Args) > 0 && isFloatCompare(pass, call.Args[0], token.NEQ) - } - return false - }() - - if invalid { - format := "use %s.InEpsilon (or InDelta)" - if call.Fn.IsFmt { - format = "use %s.InEpsilonf (or InDeltaf)" - } - return newDiagnostic(checker.Name(), call, fmt.Sprintf(format, call.SelectorXStr), nil) - } - return nil -} - -func isFloat(pass *analysis.Pass, expr ast.Expr) bool { - t := pass.TypesInfo.TypeOf(expr) - if t == nil { - return false - } - - bt, ok := t.Underlying().(*types.Basic) - return ok && (bt.Info()&types.IsFloat > 0) -} - -func isFloatCompare(p *analysis.Pass, e ast.Expr, op token.Token) bool { - be, ok := e.(*ast.BinaryExpr) - if !ok { - return false - } - return be.Op == op && (isFloat(p, be.X) || isFloat(p, be.Y)) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/go_require.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/go_require.go deleted file mode 100644 index 4c0c9d1fd7..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/go_require.go +++ /dev/null @@ -1,301 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -const ( - goRequireFnReportFormat = "%s contains assertions that must only be used in the goroutine running the test function" - goRequireCallReportFormat = "%s must only be used in the goroutine running the test function" -) - -// GoRequire takes idea from go vet's "testinggoroutine" check -// and detects usage of require package's functions or assert.FailNow in the non-test goroutines -// -// go func() { -// conn, err = lis.Accept() -// require.NoError(t, err) -// -// if assert.Error(err) { -// assert.FailNow(t, msg) -// } -// }() -type GoRequire struct{} - -// NewGoRequire constructs GoRequire checker. -func NewGoRequire() GoRequire { return GoRequire{} } -func (GoRequire) Name() string { return "go-require" } - -// Check should be consistent with -// https://cs.opensource.google/go/x/tools/+/master:go/analysis/passes/testinggoroutine/testinggoroutine.go -// -// But due to the fact that the Check covers cases missed by go vet, -// the implementation turned out to be terribly complicated. -// -// In simple words, the algorithm is as follows: -// - we walk along the call tree and store the status, whether we are in the test goroutine or not; -// - if we are in a test goroutine, then require is allowed, otherwise not; -// - when we encounter the launch of a subtest or `go` statement, the status changes; -// - in order to correctly handle the return to the correct status when exiting the current function, -// we have to store a stack of statuses (inGoroutineRunningTestFunc). -// -// Other test functions called in the test function are also analyzed to make a verdict about the current function. -// This leads to recursion, which the cache of processed functions (processedFuncs) helps reduce the impact of. -// Also, because of this, we have to pre-collect a list of test function declarations (testsDecls). -func (checker GoRequire) Check(pass *analysis.Pass, inspector *inspector.Inspector) (diagnostics []analysis.Diagnostic) { - testsDecls := make(funcDeclarations) - inspector.Preorder([]ast.Node{(*ast.FuncDecl)(nil)}, func(node ast.Node) { - fd := node.(*ast.FuncDecl) - - if isTestingFuncOrMethod(pass, fd) { - if tf, ok := pass.TypesInfo.ObjectOf(fd.Name).(*types.Func); ok { - testsDecls[tf] = fd - } - } - }) - - var inGoroutineRunningTestFunc boolStack - processedFuncs := make(map[*ast.FuncDecl]goRequireVerdict) - - nodesFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - (*ast.GoStmt)(nil), - (*ast.CallExpr)(nil), - } - inspector.Nodes(nodesFilter, func(node ast.Node, push bool) bool { - if fd, ok := node.(*ast.FuncDecl); ok { - if !isTestingFuncOrMethod(pass, fd) { - return false - } - - if push { - inGoroutineRunningTestFunc.Push(true) - } else { - inGoroutineRunningTestFunc.Pop() - } - return true - } - - if _, ok := node.(*ast.GoStmt); ok { - if push { - inGoroutineRunningTestFunc.Push(false) - } else { - inGoroutineRunningTestFunc.Pop() - } - return true - } - - ce := node.(*ast.CallExpr) - if isSubTestRun(pass, ce) { - if push { - // t.Run spawns the new testing goroutine and declines - // possible warnings from previous "simple" goroutine. - inGoroutineRunningTestFunc.Push(true) - } else { - inGoroutineRunningTestFunc.Pop() - } - return true - } - - if !push { - return false - } - if inGoroutineRunningTestFunc.Last() { - // We are in testing goroutine and can skip any assertion checks. - return true - } - - testifyCall := NewCallMeta(pass, ce) - if testifyCall != nil { - switch checker.checkCall(testifyCall) { - case goRequireVerdictRequire: - d := newDiagnostic(checker.Name(), testifyCall, fmt.Sprintf(goRequireCallReportFormat, "require"), nil) - diagnostics = append(diagnostics, *d) - - case goRequireVerdictAssertFailNow: - d := newDiagnostic(checker.Name(), testifyCall, fmt.Sprintf(goRequireCallReportFormat, testifyCall), nil) - diagnostics = append(diagnostics, *d) - - case goRequireVerdictNoExit: - } - return false - } - - // Case of nested function call. - { - calledFd := testsDecls.Get(pass, ce) - if calledFd == nil { - return true - } - - if v := checker.checkFunc(pass, calledFd, testsDecls, processedFuncs); v != goRequireVerdictNoExit { - caller := analysisutil.NodeString(pass.Fset, ce.Fun) - d := newDiagnostic(checker.Name(), ce, fmt.Sprintf(goRequireFnReportFormat, caller), nil) - diagnostics = append(diagnostics, *d) - } - } - return true - }) - - return diagnostics -} - -func (checker GoRequire) checkFunc( - pass *analysis.Pass, - fd *ast.FuncDecl, - testsDecls funcDeclarations, - processedFuncs map[*ast.FuncDecl]goRequireVerdict, -) (result goRequireVerdict) { - if v, ok := processedFuncs[fd]; ok { - return v - } - - ast.Inspect(fd, func(node ast.Node) bool { - if result != goRequireVerdictNoExit { - return false - } - - if _, ok := node.(*ast.GoStmt); ok { - return false - } - - ce, ok := node.(*ast.CallExpr) - if !ok { - return true - } - - testifyCall := NewCallMeta(pass, ce) - if testifyCall != nil { - if v := checker.checkCall(testifyCall); v != goRequireVerdictNoExit { - result, processedFuncs[fd] = v, v - } - return false - } - - // Case of nested function call. - { - calledFd := testsDecls.Get(pass, ce) - if calledFd == nil { - return true - } - if calledFd == fd { - // Recursion. - return true - } - - if v := checker.checkFunc(pass, calledFd, testsDecls, processedFuncs); v != goRequireVerdictNoExit { - result = v - return false - } - return true - } - }) - - return result -} - -type goRequireVerdict int - -const ( - goRequireVerdictNoExit goRequireVerdict = iota - goRequireVerdictRequire - goRequireVerdictAssertFailNow -) - -func (checker GoRequire) checkCall(call *CallMeta) goRequireVerdict { - if !call.IsAssert { - return goRequireVerdictRequire - } - if call.Fn.NameFTrimmed == "FailNow" { - return goRequireVerdictAssertFailNow - } - return goRequireVerdictNoExit -} - -type funcDeclarations map[*types.Func]*ast.FuncDecl - -// Get returns the declaration of a called function or method. -// Currently, only static calls within the same package are supported, otherwise returns nil. -func (fd funcDeclarations) Get(pass *analysis.Pass, ce *ast.CallExpr) *ast.FuncDecl { - var obj types.Object - - switch fun := ce.Fun.(type) { - case *ast.SelectorExpr: - obj = pass.TypesInfo.ObjectOf(fun.Sel) - - case *ast.Ident: - obj = pass.TypesInfo.ObjectOf(fun) - - case *ast.IndexExpr: - if id, ok := fun.X.(*ast.Ident); ok { - obj = pass.TypesInfo.ObjectOf(id) - } - - case *ast.IndexListExpr: - if id, ok := fun.X.(*ast.Ident); ok { - obj = pass.TypesInfo.ObjectOf(id) - } - } - - if tf, ok := obj.(*types.Func); ok { - return fd[tf] - } - return nil -} - -type boolStack []bool - -func (s *boolStack) Push(v bool) { - *s = append(*s, v) -} - -func (s *boolStack) Pop() bool { - n := len(*s) - if n == 0 { - return false - } - - last := (*s)[n-1] - *s = (*s)[:n-1] - return last -} - -func (s boolStack) Last() bool { - n := len(s) - if n == 0 { - return false - } - return s[n-1] -} - -func isSubTestRun(pass *analysis.Pass, ce *ast.CallExpr) bool { - se, ok := ce.Fun.(*ast.SelectorExpr) - if !ok || se.Sel == nil { - return false - } - return (isTestingTPtr(pass, se.X) || implementsTestifySuiteIface(pass, se.X)) && se.Sel.Name == "Run" -} - -func isTestingFuncOrMethod(pass *analysis.Pass, fd *ast.FuncDecl) bool { - return hasTestingTParam(pass, fd) || isTestifySuiteMethod(pass, fd) -} - -func hasTestingTParam(pass *analysis.Pass, fd *ast.FuncDecl) bool { - if fd.Type == nil || fd.Type.Params == nil { - return false - } - - for _, param := range fd.Type.Params.List { - if isTestingTPtr(pass, param.Type) { - return true - } - } - return false -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/len.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/len.go deleted file mode 100644 index d4e6a48b5b..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/len.go +++ /dev/null @@ -1,97 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" -) - -// Len detects situations like -// -// assert.Equal(t, 3, len(arr)) -// assert.EqualValues(t, 3, len(arr)) -// assert.Exactly(t, 3, len(arr)) -// assert.True(t, len(arr) == 3) -// -// and requires -// -// assert.Len(t, arr, 3) -type Len struct{} - -// NewLen constructs Len checker. -func NewLen() Len { return Len{} } -func (Len) Name() string { return "len" } - -func (checker Len) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - const proposedFn = "Len" - - switch call.Fn.NameFTrimmed { - case "Equal", "EqualValues", "Exactly": - if len(call.Args) < 2 { - return nil - } - a, b := call.Args[0], call.Args[1] - - if lenArg, expectedLen, ok := xorLenCall(pass, a, b); ok { - if expectedLen == b && !isIntBasicLit(expectedLen) { - // https://github.com/Antonboom/testifylint/issues/9 - return nil - } - return newUseFunctionDiagnostic(checker.Name(), call, proposedFn, - newSuggestedFuncReplacement(call, proposedFn, analysis.TextEdit{ - Pos: a.Pos(), - End: b.End(), - NewText: formatAsCallArgs(pass, lenArg, expectedLen), - }), - ) - } - - case "True": - if len(call.Args) < 1 { - return nil - } - expr := call.Args[0] - - if lenArg, expectedLen, ok := isLenEquality(pass, expr); ok && isIntBasicLit(expectedLen) { - return newUseFunctionDiagnostic(checker.Name(), call, proposedFn, - newSuggestedFuncReplacement(call, proposedFn, analysis.TextEdit{ - Pos: expr.Pos(), - End: expr.End(), - NewText: formatAsCallArgs(pass, lenArg, expectedLen), - }), - ) - } - } - return nil -} - -func xorLenCall(pass *analysis.Pass, a, b ast.Expr) (lenArg ast.Expr, expectedLen ast.Expr, ok bool) { - arg1, ok1 := isBuiltinLenCall(pass, a) - arg2, ok2 := isBuiltinLenCall(pass, b) - - if xor(ok1, ok2) { - if ok1 { - return arg1, b, true - } - return arg2, a, true - } - return nil, nil, false -} - -func isLenEquality(pass *analysis.Pass, e ast.Expr) (ast.Expr, ast.Expr, bool) { - be, ok := e.(*ast.BinaryExpr) - if !ok { - return nil, nil, false - } - - if be.Op != token.EQL { - return nil, nil, false - } - return xorLenCall(pass, be.X, be.Y) -} - -func isIntBasicLit(e ast.Expr) bool { - bl, ok := e.(*ast.BasicLit) - return ok && bl.Kind == token.INT -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/nil_compare.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/nil_compare.go deleted file mode 100644 index 89680a0699..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/nil_compare.go +++ /dev/null @@ -1,69 +0,0 @@ -package checkers - -import ( - "go/ast" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// NilCompare detects situations like -// -// assert.Equal(t, nil, value) -// assert.EqualValues(t, nil, value) -// assert.Exactly(t, nil, value) -// -// assert.NotEqual(t, nil, value) -// assert.NotEqualValues(t, nil, value) -// -// and requires -// -// assert.Nil(t, value) -// assert.NotNil(t, value) -type NilCompare struct{} - -// NewNilCompare constructs NilCompare checker. -func NewNilCompare() NilCompare { return NilCompare{} } -func (NilCompare) Name() string { return "nil-compare" } - -func (checker NilCompare) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - if len(call.Args) < 2 { - return nil - } - - survivingArg, ok := xorNil(call.Args[0], call.Args[1]) - if !ok { - return nil - } - - var proposedFn string - - switch call.Fn.NameFTrimmed { - case "Equal", "EqualValues", "Exactly": - proposedFn = "Nil" - case "NotEqual", "NotEqualValues": - proposedFn = "NotNil" - default: - return nil - } - - return newUseFunctionDiagnostic(checker.Name(), call, proposedFn, - newSuggestedFuncReplacement(call, proposedFn, analysis.TextEdit{ - Pos: call.Args[0].Pos(), - End: call.Args[1].End(), - NewText: analysisutil.NodeBytes(pass.Fset, survivingArg), - }), - ) -} - -func xorNil(first, second ast.Expr) (ast.Expr, bool) { - a, b := isNil(first), isNil(second) - if xor(a, b) { - if a { - return second, true - } - return first, true - } - return nil, false -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/require_error.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/require_error.go deleted file mode 100644 index 938ffc8b3e..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/require_error.go +++ /dev/null @@ -1,305 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/token" - "regexp" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" -) - -const requireErrorReport = "for error assertions use require" - -// RequireError detects error assertions like -// -// assert.Error(t, err) // s.Error(err), s.Assert().Error(err) -// assert.ErrorIs(t, err, io.EOF) -// assert.ErrorAs(t, err, &target) -// assert.EqualError(t, err, "end of file") -// assert.ErrorContains(t, err, "end of file") -// assert.NoError(t, err) -// assert.NotErrorIs(t, err, io.EOF) -// -// and requires -// -// require.Error(t, err) // s.Require().Error(err), s.Require().Error(err) -// require.ErrorIs(t, err, io.EOF) -// require.ErrorAs(t, err, &target) -// ... -// -// RequireError ignores: -// - assertion in the `if` condition; -// - the entire `if-else` block, if there is an assertion in the `if` condition; -// - the last assertion in the block, if there are no methods/functions calls after it; -// - assertions in an explicit goroutine; -// - assertions in an explicit testing cleanup function or suite teardown methods; -// - sequence of NoError assertions. -type RequireError struct { - fnPattern *regexp.Regexp -} - -// NewRequireError constructs RequireError checker. -func NewRequireError() *RequireError { return new(RequireError) } -func (RequireError) Name() string { return "require-error" } - -func (checker *RequireError) SetFnPattern(p *regexp.Regexp) *RequireError { - if p != nil { - checker.fnPattern = p - } - return checker -} - -func (checker RequireError) Check(pass *analysis.Pass, inspector *inspector.Inspector) []analysis.Diagnostic { - callsByFunc := make(map[funcID][]*callMeta) - - // Stage 1. Collect meta information about any calls inside functions. - - inspector.WithStack([]ast.Node{(*ast.CallExpr)(nil)}, func(node ast.Node, push bool, stack []ast.Node) bool { - if !push { - return false - } - if len(stack) < 3 { - return true - } - - fID := findSurroundingFunc(pass, stack) - if fID == nil { - return true - } - - _, prevIsIfStmt := stack[len(stack)-2].(*ast.IfStmt) - _, prevIsAssignStmt := stack[len(stack)-2].(*ast.AssignStmt) - _, prevPrevIsIfStmt := stack[len(stack)-3].(*ast.IfStmt) - inIfCond := prevIsIfStmt || (prevPrevIsIfStmt && prevIsAssignStmt) - - callExpr := node.(*ast.CallExpr) - testifyCall := NewCallMeta(pass, callExpr) - - call := &callMeta{ - call: callExpr, - testifyCall: testifyCall, - parentIf: findNearestNode[*ast.IfStmt](stack), - parentBlock: findNearestNode[*ast.BlockStmt](stack), - inIfCond: inIfCond, - inNoErrorSeq: false, // Will be filled in below. - } - - callsByFunc[*fID] = append(callsByFunc[*fID], call) - return testifyCall == nil // Do not support asserts in asserts. - }) - - // Stage 2. Analyze calls and block context. - - var diagnostics []analysis.Diagnostic - - callsByBlock := map[*ast.BlockStmt][]*callMeta{} - for _, calls := range callsByFunc { - for _, c := range calls { - if b := c.parentBlock; b != nil { - callsByBlock[b] = append(callsByBlock[b], c) - } - } - } - - markCallsInNoErrorSequence(callsByBlock) - - for funcInfo, calls := range callsByFunc { - for i, c := range calls { - if funcInfo.isTestCleanup { - continue - } - if funcInfo.isGoroutine { - continue - } - - if c.testifyCall == nil { - continue - } - if !c.testifyCall.IsAssert { - continue - } - switch c.testifyCall.Fn.NameFTrimmed { - default: - continue - case "Error", "ErrorIs", "ErrorAs", "EqualError", "ErrorContains", "NoError", "NotErrorIs": - } - - if needToSkipBasedOnContext(c, i, calls, callsByBlock) { - continue - } - if p := checker.fnPattern; p != nil && !p.MatchString(c.testifyCall.Fn.Name) { - continue - } - - diagnostics = append(diagnostics, - *newDiagnostic(checker.Name(), c.testifyCall, requireErrorReport, nil)) - } - } - - return diagnostics -} - -func needToSkipBasedOnContext( - currCall *callMeta, - currCallIndex int, - otherCalls []*callMeta, - callsByBlock map[*ast.BlockStmt][]*callMeta, -) bool { - if currCall.inNoErrorSeq { - // Skip `assert.NoError` sequence. - return true - } - - if currCall.inIfCond { - // Skip assertions in the "if condition". - return true - } - - if currCall.parentIf != nil { - for _, rootCall := range otherCalls { - if (rootCall.parentIf == currCall.parentIf) && rootCall.inIfCond { - // Skip assertions in the entire if-else parentBlock, if the "if condition" contains assertion. - return true - } - } - } - - block := currCall.parentBlock - blockCalls := callsByBlock[block] - isLastCallInBlock := blockCalls[len(blockCalls)-1] == currCall - - noCallsAfter := true - - _, blockEndWithReturn := block.List[len(block.List)-1].(*ast.ReturnStmt) - if !blockEndWithReturn { - for i := currCallIndex + 1; i < len(otherCalls); i++ { - if (otherCalls[i].parentIf == nil) || (otherCalls[i].parentIf != currCall.parentIf) { - noCallsAfter = false - break - } - } - } - - // Skip assertion if this is the last operation in the test. - return isLastCallInBlock && noCallsAfter -} - -func findSurroundingFunc(pass *analysis.Pass, stack []ast.Node) *funcID { - for i := len(stack) - 2; i >= 0; i-- { - var fType *ast.FuncType - var fName string - var isTestCleanup bool - var isGoroutine bool - - switch fd := stack[i].(type) { - case *ast.FuncDecl: - fType, fName = fd.Type, fd.Name.Name - - if isTestifySuiteMethod(pass, fd) { - if ident := fd.Name; ident != nil && isAfterTestMethod(ident.Name) { - isTestCleanup = true - } - } - - case *ast.FuncLit: - fType, fName = fd.Type, "anonymous" - - if i >= 2 { //nolint:nestif - if ce, ok := stack[i-1].(*ast.CallExpr); ok { - if se, ok := ce.Fun.(*ast.SelectorExpr); ok { - isTestCleanup = isTestingTPtr(pass, se.X) && se.Sel != nil && (se.Sel.Name == "Cleanup") - } - - if _, ok := stack[i-2].(*ast.GoStmt); ok { - isGoroutine = true - } - } - } - - default: - continue - } - - return &funcID{ - pos: fType.Pos(), - posStr: pass.Fset.Position(fType.Pos()).String(), - name: fName, - isTestCleanup: isTestCleanup, - isGoroutine: isGoroutine, - } - } - return nil -} - -func findNearestNode[T ast.Node](stack []ast.Node) (v T) { - for i := len(stack) - 2; i >= 0; i-- { - if n, ok := stack[i].(T); ok { - return n - } - } - return -} - -func markCallsInNoErrorSequence(callsByBlock map[*ast.BlockStmt][]*callMeta) { - for _, calls := range callsByBlock { - for i, c := range calls { - if c.testifyCall == nil { - continue - } - - var prevIsNoError bool - if i > 0 { - if prev := calls[i-1].testifyCall; prev != nil { - prevIsNoError = isNoErrorAssertion(prev.Fn.Name) - } - } - - var nextIsNoError bool - if i < len(calls)-1 { - if next := calls[i+1].testifyCall; next != nil { - nextIsNoError = isNoErrorAssertion(next.Fn.Name) - } - } - - if isNoErrorAssertion(c.testifyCall.Fn.Name) && (prevIsNoError || nextIsNoError) { - calls[i].inNoErrorSeq = true - } - } - } -} - -type callMeta struct { - call *ast.CallExpr - testifyCall *CallMeta - parentIf *ast.IfStmt - parentBlock *ast.BlockStmt - inIfCond bool // True for code like `if assert.ErrorAs(t, err, &target) {`. - inNoErrorSeq bool // True for sequence of `assert.NoError` assertions. -} - -type funcID struct { - pos token.Pos - posStr string - name string - isTestCleanup bool - isGoroutine bool -} - -func (id funcID) String() string { - return fmt.Sprintf("%s at %s", id.name, id.posStr) -} - -func isAfterTestMethod(name string) bool { - // https://github.com/stretchr/testify/blob/master/suite/interfaces.go - switch name { - case "TearDownSuite", "TearDownTest", "AfterTest", "HandleStats", "TearDownSubTest": - return true - } - return false -} - -func isNoErrorAssertion(fnName string) bool { - return (fnName == "NoError") || (fnName == "NoErrorf") -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_dont_use_pkg.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_dont_use_pkg.go deleted file mode 100644 index bf84f6378e..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_dont_use_pkg.go +++ /dev/null @@ -1,96 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" - "github.com/Antonboom/testifylint/internal/testify" -) - -// SuiteDontUsePkg detects situation like -// -// func (s *MySuite) TestSomething() { -// assert.Equal(s.T(), 42, value) -// } -// -// and requires -// -// func (s *MySuite) TestSomething() { -// s.Equal(42, value) -// } -type SuiteDontUsePkg struct{} - -// NewSuiteDontUsePkg constructs SuiteDontUsePkg checker. -func NewSuiteDontUsePkg() SuiteDontUsePkg { return SuiteDontUsePkg{} } -func (SuiteDontUsePkg) Name() string { return "suite-dont-use-pkg" } - -func (checker SuiteDontUsePkg) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - if !call.IsPkg { - return nil - } - - args := call.ArgsRaw - if len(args) < 2 { - return nil - } - t := args[0] - - ce, ok := t.(*ast.CallExpr) - if !ok { - return nil - } - se, ok := ce.Fun.(*ast.SelectorExpr) - if !ok { - return nil - } - if se.X == nil || !implementsTestifySuiteIface(pass, se.X) { - return nil - } - if se.Sel == nil || se.Sel.Name != "T" { - return nil - } - rcv, ok := se.X.(*ast.Ident) // At this point we ensure that `s.T()` is used as the first argument of assertion. - if !ok { - return nil - } - - newSelector := rcv.Name - if !call.IsAssert { - newSelector += "." + "Require()" - } - - msg := fmt.Sprintf("use %s.%s", newSelector, call.Fn.Name) - return newDiagnostic(checker.Name(), call, msg, &analysis.SuggestedFix{ - Message: fmt.Sprintf("Replace `%s` with `%s`", call.SelectorXStr, newSelector), - TextEdits: []analysis.TextEdit{ - // Replace package function with suite method. - { - Pos: call.Selector.X.Pos(), - End: call.Selector.X.End(), - NewText: []byte(newSelector), - }, - // Remove `s.T()`. - { - Pos: t.Pos(), - End: args[1].Pos(), - NewText: []byte(""), - }, - }, - }) -} - -func implementsTestifySuiteIface(pass *analysis.Pass, rcv ast.Expr) bool { - suiteIface := analysisutil.ObjectOf(pass.Pkg, testify.SuitePkgPath, "TestingSuite") - if suiteIface == nil { - return false - } - - return types.Implements( - pass.TypesInfo.TypeOf(rcv), - suiteIface.Type().Underlying().(*types.Interface), - ) -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_extra_assert_call.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_extra_assert_call.go deleted file mode 100644 index 791488b651..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_extra_assert_call.go +++ /dev/null @@ -1,99 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// SuiteExtraAssertCallMode reflects different modes of work of SuiteExtraAssertCall checker. -type SuiteExtraAssertCallMode int - -const ( - SuiteExtraAssertCallModeRemove SuiteExtraAssertCallMode = iota - SuiteExtraAssertCallModeRequire -) - -const DefaultSuiteExtraAssertCallMode = SuiteExtraAssertCallModeRemove - -// SuiteExtraAssertCall detects situation like -// -// func (s *MySuite) TestSomething() { -// s.Assert().Equal(42, value) -// } -// -// and requires -// -// func (s *MySuite) TestSomething() { -// s.Equal(42, value) -// } -// -// or vice versa (depending on the configurable mode). -type SuiteExtraAssertCall struct { - mode SuiteExtraAssertCallMode -} - -// NewSuiteExtraAssertCall constructs SuiteExtraAssertCall checker. -func NewSuiteExtraAssertCall() *SuiteExtraAssertCall { - return &SuiteExtraAssertCall{mode: DefaultSuiteExtraAssertCallMode} -} - -func (SuiteExtraAssertCall) Name() string { return "suite-extra-assert-call" } - -func (checker *SuiteExtraAssertCall) SetMode(m SuiteExtraAssertCallMode) *SuiteExtraAssertCall { - checker.mode = m - return checker -} - -func (checker SuiteExtraAssertCall) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - if call.IsPkg { - return nil - } - - switch checker.mode { - case SuiteExtraAssertCallModeRequire: - x, ok := call.Selector.X.(*ast.Ident) // s.True - if !ok || x == nil || !implementsTestifySuiteIface(pass, x) { - return nil - } - - msg := fmt.Sprintf("use an explicit %s.Assert().%s", analysisutil.NodeString(pass.Fset, x), call.Fn.Name) - return newDiagnostic(checker.Name(), call, msg, &analysis.SuggestedFix{ - Message: "Add `Assert()` call", - TextEdits: []analysis.TextEdit{{ - Pos: x.End(), - End: x.End(), // Pure insertion. - NewText: []byte(".Assert()"), - }}, - }) - - case SuiteExtraAssertCallModeRemove: - x, ok := call.Selector.X.(*ast.CallExpr) // s.Assert().True - if !ok { - return nil - } - - se, ok := x.Fun.(*ast.SelectorExpr) - if !ok || se == nil || !implementsTestifySuiteIface(pass, se.X) { - return nil - } - if se.Sel == nil || se.Sel.Name != "Assert" { - return nil - } - - msg := fmt.Sprintf("need to simplify the assertion to %s.%s", analysisutil.NodeString(pass.Fset, se.X), call.Fn.Name) - return newDiagnostic(checker.Name(), call, msg, &analysis.SuggestedFix{ - Message: "Remove `Assert()` call", - TextEdits: []analysis.TextEdit{{ - Pos: se.Sel.Pos(), - End: x.End() + 1, // +1 for dot. - NewText: []byte(""), - }}, - }) - } - - return nil -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_thelper.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_thelper.go deleted file mode 100644 index 5cadc93ada..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/suite_thelper.go +++ /dev/null @@ -1,130 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" - - "github.com/Antonboom/testifylint/internal/analysisutil" - "github.com/Antonboom/testifylint/internal/testify" -) - -// SuiteTHelper requires t.Helper() call in suite helpers: -// -// func (s *RoomSuite) assertRoomRound(roundID RoundID) { -// s.T().Helper() -// s.Equal(roundID, s.getRoom().CurrentRound.ID) -// } -type SuiteTHelper struct{} - -// NewSuiteTHelper constructs SuiteTHelper checker. -func NewSuiteTHelper() SuiteTHelper { return SuiteTHelper{} } -func (SuiteTHelper) Name() string { return "suite-thelper" } - -func (checker SuiteTHelper) Check(pass *analysis.Pass, inspector *inspector.Inspector) (diagnostics []analysis.Diagnostic) { - inspector.Preorder([]ast.Node{(*ast.FuncDecl)(nil)}, func(node ast.Node) { - fd := node.(*ast.FuncDecl) - if !isTestifySuiteMethod(pass, fd) { - return - } - - if ident := fd.Name; ident == nil || isTestMethod(ident.Name) || isServiceMethod(ident.Name) { - return - } - - if !containsSuiteAssertions(pass, fd) { - return - } - - rcv := fd.Recv.List[0] - if len(rcv.Names) != 1 || rcv.Names[0] == nil { - return - } - rcvName := rcv.Names[0].Name - - helperCallStr := fmt.Sprintf("%s.T().Helper()", rcvName) - - firstStmt := fd.Body.List[0] - if analysisutil.NodeString(pass.Fset, firstStmt) == helperCallStr { - return - } - - msg := fmt.Sprintf("suite helper method must start with " + helperCallStr) - d := newDiagnostic(checker.Name(), fd, msg, &analysis.SuggestedFix{ - Message: fmt.Sprintf("Insert `%s`", helperCallStr), - TextEdits: []analysis.TextEdit{ - { - Pos: firstStmt.Pos(), - End: firstStmt.Pos(), // Pure insertion. - NewText: []byte(helperCallStr + "\n\n"), - }, - }, - }) - diagnostics = append(diagnostics, *d) - }) - return diagnostics -} - -func isTestifySuiteMethod(pass *analysis.Pass, fDecl *ast.FuncDecl) bool { - if fDecl.Recv == nil || len(fDecl.Recv.List) != 1 { - return false - } - - rcv := fDecl.Recv.List[0] - return implementsTestifySuiteIface(pass, rcv.Type) -} - -func isTestMethod(name string) bool { - return strings.HasPrefix(name, "Test") -} - -func isServiceMethod(name string) bool { - // https://github.com/stretchr/testify/blob/master/suite/interfaces.go - switch name { - case "T", "SetT", "SetS", "SetupSuite", "SetupTest", "TearDownSuite", "TearDownTest", - "BeforeTest", "AfterTest", "HandleStats", "SetupSubTest", "TearDownSubTest": - return true - } - return false -} - -func containsSuiteAssertions(pass *analysis.Pass, fn *ast.FuncDecl) bool { - if fn.Body == nil { - return false - } - - for _, s := range fn.Body.List { - if isSuiteAssertion(pass, s) { - return true - } - } - return false -} - -func isSuiteAssertion(pass *analysis.Pass, stmt ast.Stmt) bool { - expr, ok := stmt.(*ast.ExprStmt) - if !ok { - return false - } - - ce, ok := expr.X.(*ast.CallExpr) - if !ok { - return false - } - - se, ok := ce.Fun.(*ast.SelectorExpr) - if !ok || se.Sel == nil { - return false - } - - if sel, ok := pass.TypesInfo.Selections[se]; ok { - pkg := sel.Obj().Pkg() - isAssert := analysisutil.IsPkg(pkg, testify.AssertPkgName, testify.AssertPkgPath) - isRequire := analysisutil.IsPkg(pkg, testify.RequirePkgName, testify.RequirePkgPath) - return isAssert || isRequire - } - return false -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/checkers/useless_assert.go b/vendor/github.com/Antonboom/testifylint/internal/checkers/useless_assert.go deleted file mode 100644 index 669f9d187d..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/checkers/useless_assert.go +++ /dev/null @@ -1,71 +0,0 @@ -package checkers - -import ( - "golang.org/x/tools/go/analysis" - - "github.com/Antonboom/testifylint/internal/analysisutil" -) - -// UselessAssert detects useless asserts like -// -// 1) Asserting of the same variable -// -// assert.Equal(t, tt.value, tt.value) -// assert.ElementsMatch(t, users, users) -// ... -// -// 2) Open for contribution... -type UselessAssert struct{} - -// NewUselessAssert constructs UselessAssert checker. -func NewUselessAssert() UselessAssert { return UselessAssert{} } -func (UselessAssert) Name() string { return "useless-assert" } - -func (checker UselessAssert) Check(pass *analysis.Pass, call *CallMeta) *analysis.Diagnostic { - switch call.Fn.NameFTrimmed { - case - "Contains", - "ElementsMatch", - "Equal", - "EqualExportedValues", - "EqualValues", - "ErrorAs", - "ErrorIs", - "Exactly", - "Greater", - "GreaterOrEqual", - "Implements", - "InDelta", - "InDeltaMapValues", - "InDeltaSlice", - "InEpsilon", - "InEpsilonSlice", - "IsType", - "JSONEq", - "Less", - "LessOrEqual", - "NotEqual", - "NotEqualValues", - "NotErrorIs", - "NotRegexp", - "NotSame", - "NotSubset", - "Regexp", - "Same", - "Subset", - "WithinDuration", - "YAMLEq": - default: - return nil - } - - if len(call.Args) < 2 { - return nil - } - first, second := call.Args[0], call.Args[1] - - if analysisutil.NodeString(pass.Fset, first) == analysisutil.NodeString(pass.Fset, second) { - return newDiagnostic(checker.Name(), call, "asserting of the same variable", nil) - } - return nil -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/config/config.go b/vendor/github.com/Antonboom/testifylint/internal/config/config.go deleted file mode 100644 index 6dcfbdb52e..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/config/config.go +++ /dev/null @@ -1,103 +0,0 @@ -package config - -import ( - "errors" - "flag" - "fmt" - - "github.com/Antonboom/testifylint/internal/checkers" -) - -// NewDefault builds default testifylint config. -func NewDefault() Config { - return Config{ - EnableAll: false, - DisabledCheckers: nil, - DisableAll: false, - EnabledCheckers: nil, - ExpectedActual: ExpectedActualConfig{ - ExpVarPattern: RegexpValue{checkers.DefaultExpectedVarPattern}, - }, - RequireError: RequireErrorConfig{ - FnPattern: RegexpValue{nil}, - }, - SuiteExtraAssertCall: SuiteExtraAssertCallConfig{ - Mode: checkers.DefaultSuiteExtraAssertCallMode, - }, - } -} - -// Config implements testifylint configuration. -type Config struct { - EnableAll bool - DisabledCheckers KnownCheckersValue - DisableAll bool - EnabledCheckers KnownCheckersValue - - ExpectedActual ExpectedActualConfig - RequireError RequireErrorConfig - SuiteExtraAssertCall SuiteExtraAssertCallConfig -} - -// ExpectedActualConfig implements configuration of checkers.ExpectedActual. -type ExpectedActualConfig struct { - ExpVarPattern RegexpValue -} - -// RequireErrorConfig implements configuration of checkers.RequireError. -type RequireErrorConfig struct { - FnPattern RegexpValue -} - -// SuiteExtraAssertCallConfig implements configuration of checkers.SuiteExtraAssertCall. -type SuiteExtraAssertCallConfig struct { - Mode checkers.SuiteExtraAssertCallMode -} - -func (cfg Config) Validate() error { - if cfg.EnableAll { - if cfg.DisableAll { - return errors.New("enable-all and disable-all options must not be combined") - } - - if len(cfg.EnabledCheckers) != 0 { - return errors.New("enable-all and enable options must not be combined") - } - } - - if cfg.DisableAll { - if len(cfg.DisabledCheckers) != 0 { - return errors.New("disable-all and disable options must not be combined") - } - - if len(cfg.EnabledCheckers) == 0 { - return errors.New("all checkers were disabled, but no one checker was enabled: at least one must be enabled") - } - } - - for _, checker := range cfg.DisabledCheckers { - if cfg.EnabledCheckers.Contains(checker) { - return fmt.Errorf("checker %q disabled and enabled at one moment", checker) - } - } - - return nil -} - -// BindToFlags binds Config fields to according flags. -func BindToFlags(cfg *Config, fs *flag.FlagSet) { - fs.BoolVar(&cfg.EnableAll, "enable-all", false, "enable all checkers") - fs.Var(&cfg.DisabledCheckers, "disable", "comma separated list of disabled checkers (to exclude from enabled by default)") - fs.BoolVar(&cfg.DisableAll, "disable-all", false, "disable all checkers") - fs.Var(&cfg.EnabledCheckers, "enable", "comma separated list of enabled checkers (in addition to enabled by default)") - - fs.Var(&cfg.ExpectedActual.ExpVarPattern, "expected-actual.pattern", "regexp for expected variable name") - fs.Var(&cfg.RequireError.FnPattern, "require-error.fn-pattern", "regexp for error assertions that should only be analyzed") - fs.Var(NewEnumValue(suiteExtraAssertCallModeAsString, &cfg.SuiteExtraAssertCall.Mode), - "suite-extra-assert-call.mode", "to require or remove extra Assert() call") -} - -var suiteExtraAssertCallModeAsString = map[string]checkers.SuiteExtraAssertCallMode{ - "remove": checkers.SuiteExtraAssertCallModeRemove, - "require": checkers.SuiteExtraAssertCallModeRequire, -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/config/flag_value_types.go b/vendor/github.com/Antonboom/testifylint/internal/config/flag_value_types.go deleted file mode 100644 index 5b08ec47b1..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/config/flag_value_types.go +++ /dev/null @@ -1,114 +0,0 @@ -package config - -import ( - "flag" - "fmt" - "regexp" - "sort" - "strings" - - "github.com/Antonboom/testifylint/internal/checkers" -) - -var ( - _ flag.Value = (*KnownCheckersValue)(nil) - _ flag.Value = (*RegexpValue)(nil) - _ flag.Value = (*EnumValue[checkers.SuiteExtraAssertCallMode])(nil) -) - -// KnownCheckersValue implements comma separated list of testify checkers. -type KnownCheckersValue []string - -func (kcv KnownCheckersValue) String() string { - return strings.Join(kcv, ",") -} - -func (kcv *KnownCheckersValue) Set(v string) error { - chckrs := strings.Split(v, ",") - for _, checkerName := range chckrs { - if ok := checkers.IsKnown(checkerName); !ok { - return fmt.Errorf("unknown checker %q", checkerName) - } - } - - *kcv = chckrs - return nil -} - -func (kcv KnownCheckersValue) Contains(v string) bool { - for _, checker := range kcv { - if checker == v { - return true - } - } - return false -} - -// RegexpValue is a special wrapper for support of flag.FlagSet over regexp.Regexp. -// Original regexp is available through RegexpValue.Regexp. -type RegexpValue struct { - *regexp.Regexp -} - -func (rv RegexpValue) String() string { - if rv.Regexp == nil { - return "" - } - return rv.Regexp.String() -} - -func (rv *RegexpValue) Set(v string) error { - compiled, err := regexp.Compile(v) - if err != nil { - return err - } - - rv.Regexp = compiled - return nil -} - -// EnumValue is a special type for support of flag.FlagSet over user-defined constants. -type EnumValue[EnumT comparable] struct { - mapping map[string]EnumT - keys []string - dst *EnumT -} - -// NewEnumValue takes the "enum-value-name to enum-value" mapping and a destination for the value passed through the CLI. -// Returns an EnumValue instance suitable for flag.FlagSet.Var. -func NewEnumValue[EnumT comparable](mapping map[string]EnumT, dst *EnumT) *EnumValue[EnumT] { - keys := make([]string, 0, len(mapping)) - for k := range mapping { - keys = append(keys, k) - } - sort.Strings(keys) - - return &EnumValue[EnumT]{ - mapping: mapping, - keys: keys, - dst: dst, - } -} - -func (e EnumValue[EnumT]) String() string { - if e.dst == nil { - return "" - } - - for k, v := range e.mapping { - if v == *e.dst { - return k - } - } - return "" -} - -func (e *EnumValue[EnumT]) Set(s string) error { - v, ok := e.mapping[s] - if !ok { - return fmt.Errorf("use one of (%v)", strings.Join(e.keys, " | ")) - } - - *e.dst = v - return nil -} diff --git a/vendor/github.com/Antonboom/testifylint/internal/testify/const.go b/vendor/github.com/Antonboom/testifylint/internal/testify/const.go deleted file mode 100644 index 3476e40402..0000000000 --- a/vendor/github.com/Antonboom/testifylint/internal/testify/const.go +++ /dev/null @@ -1,17 +0,0 @@ -package testify - -const ( - ModulePath = "github.com/stretchr/testify" - - AssertPkgName = "assert" - HTTPPkgName = "http" - MockPkgName = "mock" - RequirePkgName = "require" - SuitePkgName = "suite" - - AssertPkgPath = ModulePath + "/" + AssertPkgName - HTTPPkgPath = ModulePath + "/" + HTTPPkgName - MockPkgPath = ModulePath + "/" + MockPkgName - RequirePkgPath = ModulePath + "/" + RequirePkgName - SuitePkgPath = ModulePath + "/" + SuitePkgName -) diff --git a/vendor/github.com/Azure/go-ansiterm/LICENSE b/vendor/github.com/Azure/go-ansiterm/LICENSE deleted file mode 100644 index e3d9a64d1d..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft Corporation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Azure/go-ansiterm/README.md b/vendor/github.com/Azure/go-ansiterm/README.md deleted file mode 100644 index 261c041e7a..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# go-ansiterm - -This is a cross platform Ansi Terminal Emulation library. It reads a stream of Ansi characters and produces the appropriate function calls. The results of the function calls are platform dependent. - -For example the parser might receive "ESC, [, A" as a stream of three characters. This is the code for Cursor Up (http://www.vt100.net/docs/vt510-rm/CUU). The parser then calls the cursor up function (CUU()) on an event handler. The event handler determines what platform specific work must be done to cause the cursor to move up one position. - -The parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png). There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go). - -See parser_test.go for examples exercising the state machine and generating appropriate function calls. - ------ -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/vendor/github.com/Azure/go-ansiterm/SECURITY.md b/vendor/github.com/Azure/go-ansiterm/SECURITY.md deleted file mode 100644 index e138ec5d6a..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/vendor/github.com/Azure/go-ansiterm/constants.go b/vendor/github.com/Azure/go-ansiterm/constants.go deleted file mode 100644 index 96504a33bc..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/constants.go +++ /dev/null @@ -1,188 +0,0 @@ -package ansiterm - -const LogEnv = "DEBUG_TERMINAL" - -// ANSI constants -// References: -// -- http://www.ecma-international.org/publications/standards/Ecma-048.htm -// -- http://man7.org/linux/man-pages/man4/console_codes.4.html -// -- http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html -// -- http://en.wikipedia.org/wiki/ANSI_escape_code -// -- http://vt100.net/emu/dec_ansi_parser -// -- http://vt100.net/emu/vt500_parser.svg -// -- http://invisible-island.net/xterm/ctlseqs/ctlseqs.html -// -- http://www.inwap.com/pdp10/ansicode.txt -const ( - // ECMA-48 Set Graphics Rendition - // Note: - // -- Constants leading with an underscore (e.g., _ANSI_xxx) are unsupported or reserved - // -- Fonts could possibly be supported via SetCurrentConsoleFontEx - // -- Windows does not expose the per-window cursor (i.e., caret) blink times - ANSI_SGR_RESET = 0 - ANSI_SGR_BOLD = 1 - ANSI_SGR_DIM = 2 - _ANSI_SGR_ITALIC = 3 - ANSI_SGR_UNDERLINE = 4 - _ANSI_SGR_BLINKSLOW = 5 - _ANSI_SGR_BLINKFAST = 6 - ANSI_SGR_REVERSE = 7 - _ANSI_SGR_INVISIBLE = 8 - _ANSI_SGR_LINETHROUGH = 9 - _ANSI_SGR_FONT_00 = 10 - _ANSI_SGR_FONT_01 = 11 - _ANSI_SGR_FONT_02 = 12 - _ANSI_SGR_FONT_03 = 13 - _ANSI_SGR_FONT_04 = 14 - _ANSI_SGR_FONT_05 = 15 - _ANSI_SGR_FONT_06 = 16 - _ANSI_SGR_FONT_07 = 17 - _ANSI_SGR_FONT_08 = 18 - _ANSI_SGR_FONT_09 = 19 - _ANSI_SGR_FONT_10 = 20 - _ANSI_SGR_DOUBLEUNDERLINE = 21 - ANSI_SGR_BOLD_DIM_OFF = 22 - _ANSI_SGR_ITALIC_OFF = 23 - ANSI_SGR_UNDERLINE_OFF = 24 - _ANSI_SGR_BLINK_OFF = 25 - _ANSI_SGR_RESERVED_00 = 26 - ANSI_SGR_REVERSE_OFF = 27 - _ANSI_SGR_INVISIBLE_OFF = 28 - _ANSI_SGR_LINETHROUGH_OFF = 29 - ANSI_SGR_FOREGROUND_BLACK = 30 - ANSI_SGR_FOREGROUND_RED = 31 - ANSI_SGR_FOREGROUND_GREEN = 32 - ANSI_SGR_FOREGROUND_YELLOW = 33 - ANSI_SGR_FOREGROUND_BLUE = 34 - ANSI_SGR_FOREGROUND_MAGENTA = 35 - ANSI_SGR_FOREGROUND_CYAN = 36 - ANSI_SGR_FOREGROUND_WHITE = 37 - _ANSI_SGR_RESERVED_01 = 38 - ANSI_SGR_FOREGROUND_DEFAULT = 39 - ANSI_SGR_BACKGROUND_BLACK = 40 - ANSI_SGR_BACKGROUND_RED = 41 - ANSI_SGR_BACKGROUND_GREEN = 42 - ANSI_SGR_BACKGROUND_YELLOW = 43 - ANSI_SGR_BACKGROUND_BLUE = 44 - ANSI_SGR_BACKGROUND_MAGENTA = 45 - ANSI_SGR_BACKGROUND_CYAN = 46 - ANSI_SGR_BACKGROUND_WHITE = 47 - _ANSI_SGR_RESERVED_02 = 48 - ANSI_SGR_BACKGROUND_DEFAULT = 49 - // 50 - 65: Unsupported - - ANSI_MAX_CMD_LENGTH = 4096 - - MAX_INPUT_EVENTS = 128 - DEFAULT_WIDTH = 80 - DEFAULT_HEIGHT = 24 - - ANSI_BEL = 0x07 - ANSI_BACKSPACE = 0x08 - ANSI_TAB = 0x09 - ANSI_LINE_FEED = 0x0A - ANSI_VERTICAL_TAB = 0x0B - ANSI_FORM_FEED = 0x0C - ANSI_CARRIAGE_RETURN = 0x0D - ANSI_ESCAPE_PRIMARY = 0x1B - ANSI_ESCAPE_SECONDARY = 0x5B - ANSI_OSC_STRING_ENTRY = 0x5D - ANSI_COMMAND_FIRST = 0x40 - ANSI_COMMAND_LAST = 0x7E - DCS_ENTRY = 0x90 - CSI_ENTRY = 0x9B - OSC_STRING = 0x9D - ANSI_PARAMETER_SEP = ";" - ANSI_CMD_G0 = '(' - ANSI_CMD_G1 = ')' - ANSI_CMD_G2 = '*' - ANSI_CMD_G3 = '+' - ANSI_CMD_DECPNM = '>' - ANSI_CMD_DECPAM = '=' - ANSI_CMD_OSC = ']' - ANSI_CMD_STR_TERM = '\\' - - KEY_CONTROL_PARAM_2 = ";2" - KEY_CONTROL_PARAM_3 = ";3" - KEY_CONTROL_PARAM_4 = ";4" - KEY_CONTROL_PARAM_5 = ";5" - KEY_CONTROL_PARAM_6 = ";6" - KEY_CONTROL_PARAM_7 = ";7" - KEY_CONTROL_PARAM_8 = ";8" - KEY_ESC_CSI = "\x1B[" - KEY_ESC_N = "\x1BN" - KEY_ESC_O = "\x1BO" - - FILL_CHARACTER = ' ' -) - -func getByteRange(start byte, end byte) []byte { - bytes := make([]byte, 0, 32) - for i := start; i <= end; i++ { - bytes = append(bytes, byte(i)) - } - - return bytes -} - -var toGroundBytes = getToGroundBytes() -var executors = getExecuteBytes() - -// SPACE 20+A0 hex Always and everywhere a blank space -// Intermediate 20-2F hex !"#$%&'()*+,-./ -var intermeds = getByteRange(0x20, 0x2F) - -// Parameters 30-3F hex 0123456789:;<=>? -// CSI Parameters 30-39, 3B hex 0123456789; -var csiParams = getByteRange(0x30, 0x3F) - -var csiCollectables = append(getByteRange(0x30, 0x39), getByteRange(0x3B, 0x3F)...) - -// Uppercase 40-5F hex @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ -var upperCase = getByteRange(0x40, 0x5F) - -// Lowercase 60-7E hex `abcdefghijlkmnopqrstuvwxyz{|}~ -var lowerCase = getByteRange(0x60, 0x7E) - -// Alphabetics 40-7E hex (all of upper and lower case) -var alphabetics = append(upperCase, lowerCase...) - -var printables = getByteRange(0x20, 0x7F) - -var escapeIntermediateToGroundBytes = getByteRange(0x30, 0x7E) -var escapeToGroundBytes = getEscapeToGroundBytes() - -// See http://www.vt100.net/emu/vt500_parser.png for description of the complex -// byte ranges below - -func getEscapeToGroundBytes() []byte { - escapeToGroundBytes := getByteRange(0x30, 0x4F) - escapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x51, 0x57)...) - escapeToGroundBytes = append(escapeToGroundBytes, 0x59) - escapeToGroundBytes = append(escapeToGroundBytes, 0x5A) - escapeToGroundBytes = append(escapeToGroundBytes, 0x5C) - escapeToGroundBytes = append(escapeToGroundBytes, getByteRange(0x60, 0x7E)...) - return escapeToGroundBytes -} - -func getExecuteBytes() []byte { - executeBytes := getByteRange(0x00, 0x17) - executeBytes = append(executeBytes, 0x19) - executeBytes = append(executeBytes, getByteRange(0x1C, 0x1F)...) - return executeBytes -} - -func getToGroundBytes() []byte { - groundBytes := []byte{0x18} - groundBytes = append(groundBytes, 0x1A) - groundBytes = append(groundBytes, getByteRange(0x80, 0x8F)...) - groundBytes = append(groundBytes, getByteRange(0x91, 0x97)...) - groundBytes = append(groundBytes, 0x99) - groundBytes = append(groundBytes, 0x9A) - groundBytes = append(groundBytes, 0x9C) - return groundBytes -} - -// Delete 7F hex Always and everywhere ignored -// C1 Control 80-9F hex 32 additional control characters -// G1 Displayable A1-FE hex 94 additional displayable characters -// Special A0+FF hex Same as SPACE and DELETE diff --git a/vendor/github.com/Azure/go-ansiterm/context.go b/vendor/github.com/Azure/go-ansiterm/context.go deleted file mode 100644 index 8d66e777c0..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/context.go +++ /dev/null @@ -1,7 +0,0 @@ -package ansiterm - -type ansiContext struct { - currentChar byte - paramBuffer []byte - interBuffer []byte -} diff --git a/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go b/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go deleted file mode 100644 index bcbe00d0c5..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/csi_entry_state.go +++ /dev/null @@ -1,49 +0,0 @@ -package ansiterm - -type csiEntryState struct { - baseState -} - -func (csiState csiEntryState) Handle(b byte) (s state, e error) { - csiState.parser.logf("CsiEntry::Handle %#x", b) - - nextState, err := csiState.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case sliceContains(alphabetics, b): - return csiState.parser.ground, nil - case sliceContains(csiCollectables, b): - return csiState.parser.csiParam, nil - case sliceContains(executors, b): - return csiState, csiState.parser.execute() - } - - return csiState, nil -} - -func (csiState csiEntryState) Transition(s state) error { - csiState.parser.logf("CsiEntry::Transition %s --> %s", csiState.Name(), s.Name()) - csiState.baseState.Transition(s) - - switch s { - case csiState.parser.ground: - return csiState.parser.csiDispatch() - case csiState.parser.csiParam: - switch { - case sliceContains(csiParams, csiState.parser.context.currentChar): - csiState.parser.collectParam() - case sliceContains(intermeds, csiState.parser.context.currentChar): - csiState.parser.collectInter() - } - } - - return nil -} - -func (csiState csiEntryState) Enter() error { - csiState.parser.clear() - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/csi_param_state.go b/vendor/github.com/Azure/go-ansiterm/csi_param_state.go deleted file mode 100644 index 7ed5e01c34..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/csi_param_state.go +++ /dev/null @@ -1,38 +0,0 @@ -package ansiterm - -type csiParamState struct { - baseState -} - -func (csiState csiParamState) Handle(b byte) (s state, e error) { - csiState.parser.logf("CsiParam::Handle %#x", b) - - nextState, err := csiState.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case sliceContains(alphabetics, b): - return csiState.parser.ground, nil - case sliceContains(csiCollectables, b): - csiState.parser.collectParam() - return csiState, nil - case sliceContains(executors, b): - return csiState, csiState.parser.execute() - } - - return csiState, nil -} - -func (csiState csiParamState) Transition(s state) error { - csiState.parser.logf("CsiParam::Transition %s --> %s", csiState.Name(), s.Name()) - csiState.baseState.Transition(s) - - switch s { - case csiState.parser.ground: - return csiState.parser.csiDispatch() - } - - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go b/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go deleted file mode 100644 index 1c719db9e4..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go +++ /dev/null @@ -1,36 +0,0 @@ -package ansiterm - -type escapeIntermediateState struct { - baseState -} - -func (escState escapeIntermediateState) Handle(b byte) (s state, e error) { - escState.parser.logf("escapeIntermediateState::Handle %#x", b) - nextState, err := escState.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case sliceContains(intermeds, b): - return escState, escState.parser.collectInter() - case sliceContains(executors, b): - return escState, escState.parser.execute() - case sliceContains(escapeIntermediateToGroundBytes, b): - return escState.parser.ground, nil - } - - return escState, nil -} - -func (escState escapeIntermediateState) Transition(s state) error { - escState.parser.logf("escapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name()) - escState.baseState.Transition(s) - - switch s { - case escState.parser.ground: - return escState.parser.escDispatch() - } - - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/escape_state.go b/vendor/github.com/Azure/go-ansiterm/escape_state.go deleted file mode 100644 index 6390abd231..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/escape_state.go +++ /dev/null @@ -1,47 +0,0 @@ -package ansiterm - -type escapeState struct { - baseState -} - -func (escState escapeState) Handle(b byte) (s state, e error) { - escState.parser.logf("escapeState::Handle %#x", b) - nextState, err := escState.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case b == ANSI_ESCAPE_SECONDARY: - return escState.parser.csiEntry, nil - case b == ANSI_OSC_STRING_ENTRY: - return escState.parser.oscString, nil - case sliceContains(executors, b): - return escState, escState.parser.execute() - case sliceContains(escapeToGroundBytes, b): - return escState.parser.ground, nil - case sliceContains(intermeds, b): - return escState.parser.escapeIntermediate, nil - } - - return escState, nil -} - -func (escState escapeState) Transition(s state) error { - escState.parser.logf("Escape::Transition %s --> %s", escState.Name(), s.Name()) - escState.baseState.Transition(s) - - switch s { - case escState.parser.ground: - return escState.parser.escDispatch() - case escState.parser.escapeIntermediate: - return escState.parser.collectInter() - } - - return nil -} - -func (escState escapeState) Enter() error { - escState.parser.clear() - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/event_handler.go b/vendor/github.com/Azure/go-ansiterm/event_handler.go deleted file mode 100644 index 98087b38c2..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/event_handler.go +++ /dev/null @@ -1,90 +0,0 @@ -package ansiterm - -type AnsiEventHandler interface { - // Print - Print(b byte) error - - // Execute C0 commands - Execute(b byte) error - - // CUrsor Up - CUU(int) error - - // CUrsor Down - CUD(int) error - - // CUrsor Forward - CUF(int) error - - // CUrsor Backward - CUB(int) error - - // Cursor to Next Line - CNL(int) error - - // Cursor to Previous Line - CPL(int) error - - // Cursor Horizontal position Absolute - CHA(int) error - - // Vertical line Position Absolute - VPA(int) error - - // CUrsor Position - CUP(int, int) error - - // Horizontal and Vertical Position (depends on PUM) - HVP(int, int) error - - // Text Cursor Enable Mode - DECTCEM(bool) error - - // Origin Mode - DECOM(bool) error - - // 132 Column Mode - DECCOLM(bool) error - - // Erase in Display - ED(int) error - - // Erase in Line - EL(int) error - - // Insert Line - IL(int) error - - // Delete Line - DL(int) error - - // Insert Character - ICH(int) error - - // Delete Character - DCH(int) error - - // Set Graphics Rendition - SGR([]int) error - - // Pan Down - SU(int) error - - // Pan Up - SD(int) error - - // Device Attributes - DA([]string) error - - // Set Top and Bottom Margins - DECSTBM(int, int) error - - // Index - IND() error - - // Reverse Index - RI() error - - // Flush updates from previous commands - Flush() error -} diff --git a/vendor/github.com/Azure/go-ansiterm/ground_state.go b/vendor/github.com/Azure/go-ansiterm/ground_state.go deleted file mode 100644 index 52451e9469..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/ground_state.go +++ /dev/null @@ -1,24 +0,0 @@ -package ansiterm - -type groundState struct { - baseState -} - -func (gs groundState) Handle(b byte) (s state, e error) { - gs.parser.context.currentChar = b - - nextState, err := gs.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case sliceContains(printables, b): - return gs, gs.parser.print() - - case sliceContains(executors, b): - return gs, gs.parser.execute() - } - - return gs, nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go b/vendor/github.com/Azure/go-ansiterm/osc_string_state.go deleted file mode 100644 index 593b10ab69..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/osc_string_state.go +++ /dev/null @@ -1,31 +0,0 @@ -package ansiterm - -type oscStringState struct { - baseState -} - -func (oscState oscStringState) Handle(b byte) (s state, e error) { - oscState.parser.logf("OscString::Handle %#x", b) - nextState, err := oscState.baseState.Handle(b) - if nextState != nil || err != nil { - return nextState, err - } - - switch { - case isOscStringTerminator(b): - return oscState.parser.ground, nil - } - - return oscState, nil -} - -// See below for OSC string terminators for linux -// http://man7.org/linux/man-pages/man4/console_codes.4.html -func isOscStringTerminator(b byte) bool { - - if b == ANSI_BEL || b == 0x5C { - return true - } - - return false -} diff --git a/vendor/github.com/Azure/go-ansiterm/parser.go b/vendor/github.com/Azure/go-ansiterm/parser.go deleted file mode 100644 index 03cec7ada6..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/parser.go +++ /dev/null @@ -1,151 +0,0 @@ -package ansiterm - -import ( - "errors" - "log" - "os" -) - -type AnsiParser struct { - currState state - eventHandler AnsiEventHandler - context *ansiContext - csiEntry state - csiParam state - dcsEntry state - escape state - escapeIntermediate state - error state - ground state - oscString state - stateMap []state - - logf func(string, ...interface{}) -} - -type Option func(*AnsiParser) - -func WithLogf(f func(string, ...interface{})) Option { - return func(ap *AnsiParser) { - ap.logf = f - } -} - -func CreateParser(initialState string, evtHandler AnsiEventHandler, opts ...Option) *AnsiParser { - ap := &AnsiParser{ - eventHandler: evtHandler, - context: &ansiContext{}, - } - for _, o := range opts { - o(ap) - } - - if isDebugEnv := os.Getenv(LogEnv); isDebugEnv == "1" { - logFile, _ := os.Create("ansiParser.log") - logger := log.New(logFile, "", log.LstdFlags) - if ap.logf != nil { - l := ap.logf - ap.logf = func(s string, v ...interface{}) { - l(s, v...) - logger.Printf(s, v...) - } - } else { - ap.logf = logger.Printf - } - } - - if ap.logf == nil { - ap.logf = func(string, ...interface{}) {} - } - - ap.csiEntry = csiEntryState{baseState{name: "CsiEntry", parser: ap}} - ap.csiParam = csiParamState{baseState{name: "CsiParam", parser: ap}} - ap.dcsEntry = dcsEntryState{baseState{name: "DcsEntry", parser: ap}} - ap.escape = escapeState{baseState{name: "Escape", parser: ap}} - ap.escapeIntermediate = escapeIntermediateState{baseState{name: "EscapeIntermediate", parser: ap}} - ap.error = errorState{baseState{name: "Error", parser: ap}} - ap.ground = groundState{baseState{name: "Ground", parser: ap}} - ap.oscString = oscStringState{baseState{name: "OscString", parser: ap}} - - ap.stateMap = []state{ - ap.csiEntry, - ap.csiParam, - ap.dcsEntry, - ap.escape, - ap.escapeIntermediate, - ap.error, - ap.ground, - ap.oscString, - } - - ap.currState = getState(initialState, ap.stateMap) - - ap.logf("CreateParser: parser %p", ap) - return ap -} - -func getState(name string, states []state) state { - for _, el := range states { - if el.Name() == name { - return el - } - } - - return nil -} - -func (ap *AnsiParser) Parse(bytes []byte) (int, error) { - for i, b := range bytes { - if err := ap.handle(b); err != nil { - return i, err - } - } - - return len(bytes), ap.eventHandler.Flush() -} - -func (ap *AnsiParser) handle(b byte) error { - ap.context.currentChar = b - newState, err := ap.currState.Handle(b) - if err != nil { - return err - } - - if newState == nil { - ap.logf("WARNING: newState is nil") - return errors.New("New state of 'nil' is invalid.") - } - - if newState != ap.currState { - if err := ap.changeState(newState); err != nil { - return err - } - } - - return nil -} - -func (ap *AnsiParser) changeState(newState state) error { - ap.logf("ChangeState %s --> %s", ap.currState.Name(), newState.Name()) - - // Exit old state - if err := ap.currState.Exit(); err != nil { - ap.logf("Exit state '%s' failed with : '%v'", ap.currState.Name(), err) - return err - } - - // Perform transition action - if err := ap.currState.Transition(newState); err != nil { - ap.logf("Transition from '%s' to '%s' failed with: '%v'", ap.currState.Name(), newState.Name, err) - return err - } - - // Enter new state - if err := newState.Enter(); err != nil { - ap.logf("Enter state '%s' failed with: '%v'", newState.Name(), err) - return err - } - - ap.currState = newState - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go b/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go deleted file mode 100644 index de0a1f9cde..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/parser_action_helpers.go +++ /dev/null @@ -1,99 +0,0 @@ -package ansiterm - -import ( - "strconv" -) - -func parseParams(bytes []byte) ([]string, error) { - paramBuff := make([]byte, 0, 0) - params := []string{} - - for _, v := range bytes { - if v == ';' { - if len(paramBuff) > 0 { - // Completed parameter, append it to the list - s := string(paramBuff) - params = append(params, s) - paramBuff = make([]byte, 0, 0) - } - } else { - paramBuff = append(paramBuff, v) - } - } - - // Last parameter may not be terminated with ';' - if len(paramBuff) > 0 { - s := string(paramBuff) - params = append(params, s) - } - - return params, nil -} - -func parseCmd(context ansiContext) (string, error) { - return string(context.currentChar), nil -} - -func getInt(params []string, dflt int) int { - i := getInts(params, 1, dflt)[0] - return i -} - -func getInts(params []string, minCount int, dflt int) []int { - ints := []int{} - - for _, v := range params { - i, _ := strconv.Atoi(v) - // Zero is mapped to the default value in VT100. - if i == 0 { - i = dflt - } - ints = append(ints, i) - } - - if len(ints) < minCount { - remaining := minCount - len(ints) - for i := 0; i < remaining; i++ { - ints = append(ints, dflt) - } - } - - return ints -} - -func (ap *AnsiParser) modeDispatch(param string, set bool) error { - switch param { - case "?3": - return ap.eventHandler.DECCOLM(set) - case "?6": - return ap.eventHandler.DECOM(set) - case "?25": - return ap.eventHandler.DECTCEM(set) - } - return nil -} - -func (ap *AnsiParser) hDispatch(params []string) error { - if len(params) == 1 { - return ap.modeDispatch(params[0], true) - } - - return nil -} - -func (ap *AnsiParser) lDispatch(params []string) error { - if len(params) == 1 { - return ap.modeDispatch(params[0], false) - } - - return nil -} - -func getEraseParam(params []string) int { - param := getInt(params, 0) - if param < 0 || 3 < param { - param = 0 - } - - return param -} diff --git a/vendor/github.com/Azure/go-ansiterm/parser_actions.go b/vendor/github.com/Azure/go-ansiterm/parser_actions.go deleted file mode 100644 index 0bb5e51e9a..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/parser_actions.go +++ /dev/null @@ -1,119 +0,0 @@ -package ansiterm - -func (ap *AnsiParser) collectParam() error { - currChar := ap.context.currentChar - ap.logf("collectParam %#x", currChar) - ap.context.paramBuffer = append(ap.context.paramBuffer, currChar) - return nil -} - -func (ap *AnsiParser) collectInter() error { - currChar := ap.context.currentChar - ap.logf("collectInter %#x", currChar) - ap.context.paramBuffer = append(ap.context.interBuffer, currChar) - return nil -} - -func (ap *AnsiParser) escDispatch() error { - cmd, _ := parseCmd(*ap.context) - intermeds := ap.context.interBuffer - ap.logf("escDispatch currentChar: %#x", ap.context.currentChar) - ap.logf("escDispatch: %v(%v)", cmd, intermeds) - - switch cmd { - case "D": // IND - return ap.eventHandler.IND() - case "E": // NEL, equivalent to CRLF - err := ap.eventHandler.Execute(ANSI_CARRIAGE_RETURN) - if err == nil { - err = ap.eventHandler.Execute(ANSI_LINE_FEED) - } - return err - case "M": // RI - return ap.eventHandler.RI() - } - - return nil -} - -func (ap *AnsiParser) csiDispatch() error { - cmd, _ := parseCmd(*ap.context) - params, _ := parseParams(ap.context.paramBuffer) - ap.logf("Parsed params: %v with length: %d", params, len(params)) - - ap.logf("csiDispatch: %v(%v)", cmd, params) - - switch cmd { - case "@": - return ap.eventHandler.ICH(getInt(params, 1)) - case "A": - return ap.eventHandler.CUU(getInt(params, 1)) - case "B": - return ap.eventHandler.CUD(getInt(params, 1)) - case "C": - return ap.eventHandler.CUF(getInt(params, 1)) - case "D": - return ap.eventHandler.CUB(getInt(params, 1)) - case "E": - return ap.eventHandler.CNL(getInt(params, 1)) - case "F": - return ap.eventHandler.CPL(getInt(params, 1)) - case "G": - return ap.eventHandler.CHA(getInt(params, 1)) - case "H": - ints := getInts(params, 2, 1) - x, y := ints[0], ints[1] - return ap.eventHandler.CUP(x, y) - case "J": - param := getEraseParam(params) - return ap.eventHandler.ED(param) - case "K": - param := getEraseParam(params) - return ap.eventHandler.EL(param) - case "L": - return ap.eventHandler.IL(getInt(params, 1)) - case "M": - return ap.eventHandler.DL(getInt(params, 1)) - case "P": - return ap.eventHandler.DCH(getInt(params, 1)) - case "S": - return ap.eventHandler.SU(getInt(params, 1)) - case "T": - return ap.eventHandler.SD(getInt(params, 1)) - case "c": - return ap.eventHandler.DA(params) - case "d": - return ap.eventHandler.VPA(getInt(params, 1)) - case "f": - ints := getInts(params, 2, 1) - x, y := ints[0], ints[1] - return ap.eventHandler.HVP(x, y) - case "h": - return ap.hDispatch(params) - case "l": - return ap.lDispatch(params) - case "m": - return ap.eventHandler.SGR(getInts(params, 1, 0)) - case "r": - ints := getInts(params, 2, 1) - top, bottom := ints[0], ints[1] - return ap.eventHandler.DECSTBM(top, bottom) - default: - ap.logf("ERROR: Unsupported CSI command: '%s', with full context: %v", cmd, ap.context) - return nil - } - -} - -func (ap *AnsiParser) print() error { - return ap.eventHandler.Print(ap.context.currentChar) -} - -func (ap *AnsiParser) clear() error { - ap.context = &ansiContext{} - return nil -} - -func (ap *AnsiParser) execute() error { - return ap.eventHandler.Execute(ap.context.currentChar) -} diff --git a/vendor/github.com/Azure/go-ansiterm/states.go b/vendor/github.com/Azure/go-ansiterm/states.go deleted file mode 100644 index f2ea1fcd12..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/states.go +++ /dev/null @@ -1,71 +0,0 @@ -package ansiterm - -type stateID int - -type state interface { - Enter() error - Exit() error - Handle(byte) (state, error) - Name() string - Transition(state) error -} - -type baseState struct { - name string - parser *AnsiParser -} - -func (base baseState) Enter() error { - return nil -} - -func (base baseState) Exit() error { - return nil -} - -func (base baseState) Handle(b byte) (s state, e error) { - - switch { - case b == CSI_ENTRY: - return base.parser.csiEntry, nil - case b == DCS_ENTRY: - return base.parser.dcsEntry, nil - case b == ANSI_ESCAPE_PRIMARY: - return base.parser.escape, nil - case b == OSC_STRING: - return base.parser.oscString, nil - case sliceContains(toGroundBytes, b): - return base.parser.ground, nil - } - - return nil, nil -} - -func (base baseState) Name() string { - return base.name -} - -func (base baseState) Transition(s state) error { - if s == base.parser.ground { - execBytes := []byte{0x18} - execBytes = append(execBytes, 0x1A) - execBytes = append(execBytes, getByteRange(0x80, 0x8F)...) - execBytes = append(execBytes, getByteRange(0x91, 0x97)...) - execBytes = append(execBytes, 0x99) - execBytes = append(execBytes, 0x9A) - - if sliceContains(execBytes, base.parser.context.currentChar) { - return base.parser.execute() - } - } - - return nil -} - -type dcsEntryState struct { - baseState -} - -type errorState struct { - baseState -} diff --git a/vendor/github.com/Azure/go-ansiterm/utilities.go b/vendor/github.com/Azure/go-ansiterm/utilities.go deleted file mode 100644 index 392114493a..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/utilities.go +++ /dev/null @@ -1,21 +0,0 @@ -package ansiterm - -import ( - "strconv" -) - -func sliceContains(bytes []byte, b byte) bool { - for _, v := range bytes { - if v == b { - return true - } - } - - return false -} - -func convertBytesToInteger(bytes []byte) int { - s := string(bytes) - i, _ := strconv.Atoi(s) - return i -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go b/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go deleted file mode 100644 index 5599082ae9..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/ansi.go +++ /dev/null @@ -1,196 +0,0 @@ -// +build windows - -package winterm - -import ( - "fmt" - "os" - "strconv" - "strings" - "syscall" - - "github.com/Azure/go-ansiterm" - windows "golang.org/x/sys/windows" -) - -// Windows keyboard constants -// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85).aspx. -const ( - VK_PRIOR = 0x21 // PAGE UP key - VK_NEXT = 0x22 // PAGE DOWN key - VK_END = 0x23 // END key - VK_HOME = 0x24 // HOME key - VK_LEFT = 0x25 // LEFT ARROW key - VK_UP = 0x26 // UP ARROW key - VK_RIGHT = 0x27 // RIGHT ARROW key - VK_DOWN = 0x28 // DOWN ARROW key - VK_SELECT = 0x29 // SELECT key - VK_PRINT = 0x2A // PRINT key - VK_EXECUTE = 0x2B // EXECUTE key - VK_SNAPSHOT = 0x2C // PRINT SCREEN key - VK_INSERT = 0x2D // INS key - VK_DELETE = 0x2E // DEL key - VK_HELP = 0x2F // HELP key - VK_F1 = 0x70 // F1 key - VK_F2 = 0x71 // F2 key - VK_F3 = 0x72 // F3 key - VK_F4 = 0x73 // F4 key - VK_F5 = 0x74 // F5 key - VK_F6 = 0x75 // F6 key - VK_F7 = 0x76 // F7 key - VK_F8 = 0x77 // F8 key - VK_F9 = 0x78 // F9 key - VK_F10 = 0x79 // F10 key - VK_F11 = 0x7A // F11 key - VK_F12 = 0x7B // F12 key - - RIGHT_ALT_PRESSED = 0x0001 - LEFT_ALT_PRESSED = 0x0002 - RIGHT_CTRL_PRESSED = 0x0004 - LEFT_CTRL_PRESSED = 0x0008 - SHIFT_PRESSED = 0x0010 - NUMLOCK_ON = 0x0020 - SCROLLLOCK_ON = 0x0040 - CAPSLOCK_ON = 0x0080 - ENHANCED_KEY = 0x0100 -) - -type ansiCommand struct { - CommandBytes []byte - Command string - Parameters []string - IsSpecial bool -} - -func newAnsiCommand(command []byte) *ansiCommand { - - if isCharacterSelectionCmdChar(command[1]) { - // Is Character Set Selection commands - return &ansiCommand{ - CommandBytes: command, - Command: string(command), - IsSpecial: true, - } - } - - // last char is command character - lastCharIndex := len(command) - 1 - - ac := &ansiCommand{ - CommandBytes: command, - Command: string(command[lastCharIndex]), - IsSpecial: false, - } - - // more than a single escape - if lastCharIndex != 0 { - start := 1 - // skip if double char escape sequence - if command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_ESCAPE_SECONDARY { - start++ - } - // convert this to GetNextParam method - ac.Parameters = strings.Split(string(command[start:lastCharIndex]), ansiterm.ANSI_PARAMETER_SEP) - } - - return ac -} - -func (ac *ansiCommand) paramAsSHORT(index int, defaultValue int16) int16 { - if index < 0 || index >= len(ac.Parameters) { - return defaultValue - } - - param, err := strconv.ParseInt(ac.Parameters[index], 10, 16) - if err != nil { - return defaultValue - } - - return int16(param) -} - -func (ac *ansiCommand) String() string { - return fmt.Sprintf("0x%v \"%v\" (\"%v\")", - bytesToHex(ac.CommandBytes), - ac.Command, - strings.Join(ac.Parameters, "\",\"")) -} - -// isAnsiCommandChar returns true if the passed byte falls within the range of ANSI commands. -// See http://manpages.ubuntu.com/manpages/intrepid/man4/console_codes.4.html. -func isAnsiCommandChar(b byte) bool { - switch { - case ansiterm.ANSI_COMMAND_FIRST <= b && b <= ansiterm.ANSI_COMMAND_LAST && b != ansiterm.ANSI_ESCAPE_SECONDARY: - return true - case b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_OSC || b == ansiterm.ANSI_CMD_DECPAM || b == ansiterm.ANSI_CMD_DECPNM: - // non-CSI escape sequence terminator - return true - case b == ansiterm.ANSI_CMD_STR_TERM || b == ansiterm.ANSI_BEL: - // String escape sequence terminator - return true - } - return false -} - -func isXtermOscSequence(command []byte, current byte) bool { - return (len(command) >= 2 && command[0] == ansiterm.ANSI_ESCAPE_PRIMARY && command[1] == ansiterm.ANSI_CMD_OSC && current != ansiterm.ANSI_BEL) -} - -func isCharacterSelectionCmdChar(b byte) bool { - return (b == ansiterm.ANSI_CMD_G0 || b == ansiterm.ANSI_CMD_G1 || b == ansiterm.ANSI_CMD_G2 || b == ansiterm.ANSI_CMD_G3) -} - -// bytesToHex converts a slice of bytes to a human-readable string. -func bytesToHex(b []byte) string { - hex := make([]string, len(b)) - for i, ch := range b { - hex[i] = fmt.Sprintf("%X", ch) - } - return strings.Join(hex, "") -} - -// ensureInRange adjusts the passed value, if necessary, to ensure it is within -// the passed min / max range. -func ensureInRange(n int16, min int16, max int16) int16 { - if n < min { - return min - } else if n > max { - return max - } else { - return n - } -} - -func GetStdFile(nFile int) (*os.File, uintptr) { - var file *os.File - - // syscall uses negative numbers - // windows package uses very big uint32 - // Keep these switches split so we don't have to convert ints too much. - switch uint32(nFile) { - case windows.STD_INPUT_HANDLE: - file = os.Stdin - case windows.STD_OUTPUT_HANDLE: - file = os.Stdout - case windows.STD_ERROR_HANDLE: - file = os.Stderr - default: - switch nFile { - case syscall.STD_INPUT_HANDLE: - file = os.Stdin - case syscall.STD_OUTPUT_HANDLE: - file = os.Stdout - case syscall.STD_ERROR_HANDLE: - file = os.Stderr - default: - panic(fmt.Errorf("Invalid standard handle identifier: %v", nFile)) - } - } - - fd, err := syscall.GetStdHandle(nFile) - if err != nil { - panic(fmt.Errorf("Invalid standard handle identifier: %v -- %v", nFile, err)) - } - - return file, uintptr(fd) -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/api.go b/vendor/github.com/Azure/go-ansiterm/winterm/api.go deleted file mode 100644 index 6055e33b91..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/api.go +++ /dev/null @@ -1,327 +0,0 @@ -// +build windows - -package winterm - -import ( - "fmt" - "syscall" - "unsafe" -) - -//=========================================================================================================== -// IMPORTANT NOTE: -// -// The methods below make extensive use of the "unsafe" package to obtain the required pointers. -// Beginning in Go 1.3, the garbage collector may release local variables (e.g., incoming arguments, stack -// variables) the pointers reference *before* the API completes. -// -// As a result, in those cases, the code must hint that the variables remain in active by invoking the -// dummy method "use" (see below). Newer versions of Go are planned to change the mechanism to no longer -// require unsafe pointers. -// -// If you add or modify methods, ENSURE protection of local variables through the "use" builtin to inform -// the garbage collector the variables remain in use if: -// -// -- The value is not a pointer (e.g., int32, struct) -// -- The value is not referenced by the method after passing the pointer to Windows -// -// See http://golang.org/doc/go1.3. -//=========================================================================================================== - -var ( - kernel32DLL = syscall.NewLazyDLL("kernel32.dll") - - getConsoleCursorInfoProc = kernel32DLL.NewProc("GetConsoleCursorInfo") - setConsoleCursorInfoProc = kernel32DLL.NewProc("SetConsoleCursorInfo") - setConsoleCursorPositionProc = kernel32DLL.NewProc("SetConsoleCursorPosition") - setConsoleModeProc = kernel32DLL.NewProc("SetConsoleMode") - getConsoleScreenBufferInfoProc = kernel32DLL.NewProc("GetConsoleScreenBufferInfo") - setConsoleScreenBufferSizeProc = kernel32DLL.NewProc("SetConsoleScreenBufferSize") - scrollConsoleScreenBufferProc = kernel32DLL.NewProc("ScrollConsoleScreenBufferA") - setConsoleTextAttributeProc = kernel32DLL.NewProc("SetConsoleTextAttribute") - setConsoleWindowInfoProc = kernel32DLL.NewProc("SetConsoleWindowInfo") - writeConsoleOutputProc = kernel32DLL.NewProc("WriteConsoleOutputW") - readConsoleInputProc = kernel32DLL.NewProc("ReadConsoleInputW") - waitForSingleObjectProc = kernel32DLL.NewProc("WaitForSingleObject") -) - -// Windows Console constants -const ( - // Console modes - // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx. - ENABLE_PROCESSED_INPUT = 0x0001 - ENABLE_LINE_INPUT = 0x0002 - ENABLE_ECHO_INPUT = 0x0004 - ENABLE_WINDOW_INPUT = 0x0008 - ENABLE_MOUSE_INPUT = 0x0010 - ENABLE_INSERT_MODE = 0x0020 - ENABLE_QUICK_EDIT_MODE = 0x0040 - ENABLE_EXTENDED_FLAGS = 0x0080 - ENABLE_AUTO_POSITION = 0x0100 - ENABLE_VIRTUAL_TERMINAL_INPUT = 0x0200 - - ENABLE_PROCESSED_OUTPUT = 0x0001 - ENABLE_WRAP_AT_EOL_OUTPUT = 0x0002 - ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004 - DISABLE_NEWLINE_AUTO_RETURN = 0x0008 - ENABLE_LVB_GRID_WORLDWIDE = 0x0010 - - // Character attributes - // Note: - // -- The attributes are combined to produce various colors (e.g., Blue + Green will create Cyan). - // Clearing all foreground or background colors results in black; setting all creates white. - // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682088(v=vs.85).aspx#_win32_character_attributes. - FOREGROUND_BLUE uint16 = 0x0001 - FOREGROUND_GREEN uint16 = 0x0002 - FOREGROUND_RED uint16 = 0x0004 - FOREGROUND_INTENSITY uint16 = 0x0008 - FOREGROUND_MASK uint16 = 0x000F - - BACKGROUND_BLUE uint16 = 0x0010 - BACKGROUND_GREEN uint16 = 0x0020 - BACKGROUND_RED uint16 = 0x0040 - BACKGROUND_INTENSITY uint16 = 0x0080 - BACKGROUND_MASK uint16 = 0x00F0 - - COMMON_LVB_MASK uint16 = 0xFF00 - COMMON_LVB_REVERSE_VIDEO uint16 = 0x4000 - COMMON_LVB_UNDERSCORE uint16 = 0x8000 - - // Input event types - // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx. - KEY_EVENT = 0x0001 - MOUSE_EVENT = 0x0002 - WINDOW_BUFFER_SIZE_EVENT = 0x0004 - MENU_EVENT = 0x0008 - FOCUS_EVENT = 0x0010 - - // WaitForSingleObject return codes - WAIT_ABANDONED = 0x00000080 - WAIT_FAILED = 0xFFFFFFFF - WAIT_SIGNALED = 0x0000000 - WAIT_TIMEOUT = 0x00000102 - - // WaitForSingleObject wait duration - WAIT_INFINITE = 0xFFFFFFFF - WAIT_ONE_SECOND = 1000 - WAIT_HALF_SECOND = 500 - WAIT_QUARTER_SECOND = 250 -) - -// Windows API Console types -// -- See https://msdn.microsoft.com/en-us/library/windows/desktop/ms682101(v=vs.85).aspx for Console specific types (e.g., COORD) -// -- See https://msdn.microsoft.com/en-us/library/aa296569(v=vs.60).aspx for comments on alignment -type ( - CHAR_INFO struct { - UnicodeChar uint16 - Attributes uint16 - } - - CONSOLE_CURSOR_INFO struct { - Size uint32 - Visible int32 - } - - CONSOLE_SCREEN_BUFFER_INFO struct { - Size COORD - CursorPosition COORD - Attributes uint16 - Window SMALL_RECT - MaximumWindowSize COORD - } - - COORD struct { - X int16 - Y int16 - } - - SMALL_RECT struct { - Left int16 - Top int16 - Right int16 - Bottom int16 - } - - // INPUT_RECORD is a C/C++ union of which KEY_EVENT_RECORD is one case, it is also the largest - // See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683499(v=vs.85).aspx. - INPUT_RECORD struct { - EventType uint16 - KeyEvent KEY_EVENT_RECORD - } - - KEY_EVENT_RECORD struct { - KeyDown int32 - RepeatCount uint16 - VirtualKeyCode uint16 - VirtualScanCode uint16 - UnicodeChar uint16 - ControlKeyState uint32 - } - - WINDOW_BUFFER_SIZE struct { - Size COORD - } -) - -// boolToBOOL converts a Go bool into a Windows int32. -func boolToBOOL(f bool) int32 { - if f { - return int32(1) - } else { - return int32(0) - } -} - -// GetConsoleCursorInfo retrieves information about the size and visiblity of the console cursor. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683163(v=vs.85).aspx. -func GetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error { - r1, r2, err := getConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0) - return checkError(r1, r2, err) -} - -// SetConsoleCursorInfo sets the size and visiblity of the console cursor. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686019(v=vs.85).aspx. -func SetConsoleCursorInfo(handle uintptr, cursorInfo *CONSOLE_CURSOR_INFO) error { - r1, r2, err := setConsoleCursorInfoProc.Call(handle, uintptr(unsafe.Pointer(cursorInfo)), 0) - return checkError(r1, r2, err) -} - -// SetConsoleCursorPosition location of the console cursor. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686025(v=vs.85).aspx. -func SetConsoleCursorPosition(handle uintptr, coord COORD) error { - r1, r2, err := setConsoleCursorPositionProc.Call(handle, coordToPointer(coord)) - use(coord) - return checkError(r1, r2, err) -} - -// GetConsoleMode gets the console mode for given file descriptor -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683167(v=vs.85).aspx. -func GetConsoleMode(handle uintptr) (mode uint32, err error) { - err = syscall.GetConsoleMode(syscall.Handle(handle), &mode) - return mode, err -} - -// SetConsoleMode sets the console mode for given file descriptor -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx. -func SetConsoleMode(handle uintptr, mode uint32) error { - r1, r2, err := setConsoleModeProc.Call(handle, uintptr(mode), 0) - use(mode) - return checkError(r1, r2, err) -} - -// GetConsoleScreenBufferInfo retrieves information about the specified console screen buffer. -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms683171(v=vs.85).aspx. -func GetConsoleScreenBufferInfo(handle uintptr) (*CONSOLE_SCREEN_BUFFER_INFO, error) { - info := CONSOLE_SCREEN_BUFFER_INFO{} - err := checkError(getConsoleScreenBufferInfoProc.Call(handle, uintptr(unsafe.Pointer(&info)), 0)) - if err != nil { - return nil, err - } - return &info, nil -} - -func ScrollConsoleScreenBuffer(handle uintptr, scrollRect SMALL_RECT, clipRect SMALL_RECT, destOrigin COORD, char CHAR_INFO) error { - r1, r2, err := scrollConsoleScreenBufferProc.Call(handle, uintptr(unsafe.Pointer(&scrollRect)), uintptr(unsafe.Pointer(&clipRect)), coordToPointer(destOrigin), uintptr(unsafe.Pointer(&char))) - use(scrollRect) - use(clipRect) - use(destOrigin) - use(char) - return checkError(r1, r2, err) -} - -// SetConsoleScreenBufferSize sets the size of the console screen buffer. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686044(v=vs.85).aspx. -func SetConsoleScreenBufferSize(handle uintptr, coord COORD) error { - r1, r2, err := setConsoleScreenBufferSizeProc.Call(handle, coordToPointer(coord)) - use(coord) - return checkError(r1, r2, err) -} - -// SetConsoleTextAttribute sets the attributes of characters written to the -// console screen buffer by the WriteFile or WriteConsole function. -// See http://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx. -func SetConsoleTextAttribute(handle uintptr, attribute uint16) error { - r1, r2, err := setConsoleTextAttributeProc.Call(handle, uintptr(attribute), 0) - use(attribute) - return checkError(r1, r2, err) -} - -// SetConsoleWindowInfo sets the size and position of the console screen buffer's window. -// Note that the size and location must be within and no larger than the backing console screen buffer. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686125(v=vs.85).aspx. -func SetConsoleWindowInfo(handle uintptr, isAbsolute bool, rect SMALL_RECT) error { - r1, r2, err := setConsoleWindowInfoProc.Call(handle, uintptr(boolToBOOL(isAbsolute)), uintptr(unsafe.Pointer(&rect))) - use(isAbsolute) - use(rect) - return checkError(r1, r2, err) -} - -// WriteConsoleOutput writes the CHAR_INFOs from the provided buffer to the active console buffer. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687404(v=vs.85).aspx. -func WriteConsoleOutput(handle uintptr, buffer []CHAR_INFO, bufferSize COORD, bufferCoord COORD, writeRegion *SMALL_RECT) error { - r1, r2, err := writeConsoleOutputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), coordToPointer(bufferSize), coordToPointer(bufferCoord), uintptr(unsafe.Pointer(writeRegion))) - use(buffer) - use(bufferSize) - use(bufferCoord) - return checkError(r1, r2, err) -} - -// ReadConsoleInput reads (and removes) data from the console input buffer. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms684961(v=vs.85).aspx. -func ReadConsoleInput(handle uintptr, buffer []INPUT_RECORD, count *uint32) error { - r1, r2, err := readConsoleInputProc.Call(handle, uintptr(unsafe.Pointer(&buffer[0])), uintptr(len(buffer)), uintptr(unsafe.Pointer(count))) - use(buffer) - return checkError(r1, r2, err) -} - -// WaitForSingleObject waits for the passed handle to be signaled. -// It returns true if the handle was signaled; false otherwise. -// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms687032(v=vs.85).aspx. -func WaitForSingleObject(handle uintptr, msWait uint32) (bool, error) { - r1, _, err := waitForSingleObjectProc.Call(handle, uintptr(uint32(msWait))) - switch r1 { - case WAIT_ABANDONED, WAIT_TIMEOUT: - return false, nil - case WAIT_SIGNALED: - return true, nil - } - use(msWait) - return false, err -} - -// String helpers -func (info CONSOLE_SCREEN_BUFFER_INFO) String() string { - return fmt.Sprintf("Size(%v) Cursor(%v) Window(%v) Max(%v)", info.Size, info.CursorPosition, info.Window, info.MaximumWindowSize) -} - -func (coord COORD) String() string { - return fmt.Sprintf("%v,%v", coord.X, coord.Y) -} - -func (rect SMALL_RECT) String() string { - return fmt.Sprintf("(%v,%v),(%v,%v)", rect.Left, rect.Top, rect.Right, rect.Bottom) -} - -// checkError evaluates the results of a Windows API call and returns the error if it failed. -func checkError(r1, r2 uintptr, err error) error { - // Windows APIs return non-zero to indicate success - if r1 != 0 { - return nil - } - - // Return the error if provided, otherwise default to EINVAL - if err != nil { - return err - } - return syscall.EINVAL -} - -// coordToPointer converts a COORD into a uintptr (by fooling the type system). -func coordToPointer(c COORD) uintptr { - // Note: This code assumes the two SHORTs are correctly laid out; the "cast" to uint32 is just to get a pointer to pass. - return uintptr(*((*uint32)(unsafe.Pointer(&c)))) -} - -// use is a no-op, but the compiler cannot see that it is. -// Calling use(p) ensures that p is kept live until that point. -func use(p interface{}) {} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go b/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go deleted file mode 100644 index cbec8f728f..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/attr_translation.go +++ /dev/null @@ -1,100 +0,0 @@ -// +build windows - -package winterm - -import "github.com/Azure/go-ansiterm" - -const ( - FOREGROUND_COLOR_MASK = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE - BACKGROUND_COLOR_MASK = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE -) - -// collectAnsiIntoWindowsAttributes modifies the passed Windows text mode flags to reflect the -// request represented by the passed ANSI mode. -func collectAnsiIntoWindowsAttributes(windowsMode uint16, inverted bool, baseMode uint16, ansiMode int16) (uint16, bool) { - switch ansiMode { - - // Mode styles - case ansiterm.ANSI_SGR_BOLD: - windowsMode = windowsMode | FOREGROUND_INTENSITY - - case ansiterm.ANSI_SGR_DIM, ansiterm.ANSI_SGR_BOLD_DIM_OFF: - windowsMode &^= FOREGROUND_INTENSITY - - case ansiterm.ANSI_SGR_UNDERLINE: - windowsMode = windowsMode | COMMON_LVB_UNDERSCORE - - case ansiterm.ANSI_SGR_REVERSE: - inverted = true - - case ansiterm.ANSI_SGR_REVERSE_OFF: - inverted = false - - case ansiterm.ANSI_SGR_UNDERLINE_OFF: - windowsMode &^= COMMON_LVB_UNDERSCORE - - // Foreground colors - case ansiterm.ANSI_SGR_FOREGROUND_DEFAULT: - windowsMode = (windowsMode &^ FOREGROUND_MASK) | (baseMode & FOREGROUND_MASK) - - case ansiterm.ANSI_SGR_FOREGROUND_BLACK: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) - - case ansiterm.ANSI_SGR_FOREGROUND_RED: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED - - case ansiterm.ANSI_SGR_FOREGROUND_GREEN: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN - - case ansiterm.ANSI_SGR_FOREGROUND_YELLOW: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN - - case ansiterm.ANSI_SGR_FOREGROUND_BLUE: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_BLUE - - case ansiterm.ANSI_SGR_FOREGROUND_MAGENTA: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_BLUE - - case ansiterm.ANSI_SGR_FOREGROUND_CYAN: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_GREEN | FOREGROUND_BLUE - - case ansiterm.ANSI_SGR_FOREGROUND_WHITE: - windowsMode = (windowsMode &^ FOREGROUND_COLOR_MASK) | FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE - - // Background colors - case ansiterm.ANSI_SGR_BACKGROUND_DEFAULT: - // Black with no intensity - windowsMode = (windowsMode &^ BACKGROUND_MASK) | (baseMode & BACKGROUND_MASK) - - case ansiterm.ANSI_SGR_BACKGROUND_BLACK: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) - - case ansiterm.ANSI_SGR_BACKGROUND_RED: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED - - case ansiterm.ANSI_SGR_BACKGROUND_GREEN: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN - - case ansiterm.ANSI_SGR_BACKGROUND_YELLOW: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN - - case ansiterm.ANSI_SGR_BACKGROUND_BLUE: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_BLUE - - case ansiterm.ANSI_SGR_BACKGROUND_MAGENTA: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_BLUE - - case ansiterm.ANSI_SGR_BACKGROUND_CYAN: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_GREEN | BACKGROUND_BLUE - - case ansiterm.ANSI_SGR_BACKGROUND_WHITE: - windowsMode = (windowsMode &^ BACKGROUND_COLOR_MASK) | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE - } - - return windowsMode, inverted -} - -// invertAttributes inverts the foreground and background colors of a Windows attributes value -func invertAttributes(windowsMode uint16) uint16 { - return (COMMON_LVB_MASK & windowsMode) | ((FOREGROUND_MASK & windowsMode) << 4) | ((BACKGROUND_MASK & windowsMode) >> 4) -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go b/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go deleted file mode 100644 index 3ee06ea728..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/cursor_helpers.go +++ /dev/null @@ -1,101 +0,0 @@ -// +build windows - -package winterm - -const ( - horizontal = iota - vertical -) - -func (h *windowsAnsiEventHandler) getCursorWindow(info *CONSOLE_SCREEN_BUFFER_INFO) SMALL_RECT { - if h.originMode { - sr := h.effectiveSr(info.Window) - return SMALL_RECT{ - Top: sr.top, - Bottom: sr.bottom, - Left: 0, - Right: info.Size.X - 1, - } - } else { - return SMALL_RECT{ - Top: info.Window.Top, - Bottom: info.Window.Bottom, - Left: 0, - Right: info.Size.X - 1, - } - } -} - -// setCursorPosition sets the cursor to the specified position, bounded to the screen size -func (h *windowsAnsiEventHandler) setCursorPosition(position COORD, window SMALL_RECT) error { - position.X = ensureInRange(position.X, window.Left, window.Right) - position.Y = ensureInRange(position.Y, window.Top, window.Bottom) - err := SetConsoleCursorPosition(h.fd, position) - if err != nil { - return err - } - h.logf("Cursor position set: (%d, %d)", position.X, position.Y) - return err -} - -func (h *windowsAnsiEventHandler) moveCursorVertical(param int) error { - return h.moveCursor(vertical, param) -} - -func (h *windowsAnsiEventHandler) moveCursorHorizontal(param int) error { - return h.moveCursor(horizontal, param) -} - -func (h *windowsAnsiEventHandler) moveCursor(moveMode int, param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - position := info.CursorPosition - switch moveMode { - case horizontal: - position.X += int16(param) - case vertical: - position.Y += int16(param) - } - - if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { - return err - } - - return nil -} - -func (h *windowsAnsiEventHandler) moveCursorLine(param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - position := info.CursorPosition - position.X = 0 - position.Y += int16(param) - - if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { - return err - } - - return nil -} - -func (h *windowsAnsiEventHandler) moveCursorColumn(param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - position := info.CursorPosition - position.X = int16(param) - 1 - - if err = h.setCursorPosition(position, h.getCursorWindow(info)); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go b/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go deleted file mode 100644 index 244b5fa25e..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/erase_helpers.go +++ /dev/null @@ -1,84 +0,0 @@ -// +build windows - -package winterm - -import "github.com/Azure/go-ansiterm" - -func (h *windowsAnsiEventHandler) clearRange(attributes uint16, fromCoord COORD, toCoord COORD) error { - // Ignore an invalid (negative area) request - if toCoord.Y < fromCoord.Y { - return nil - } - - var err error - - var coordStart = COORD{} - var coordEnd = COORD{} - - xCurrent, yCurrent := fromCoord.X, fromCoord.Y - xEnd, yEnd := toCoord.X, toCoord.Y - - // Clear any partial initial line - if xCurrent > 0 { - coordStart.X, coordStart.Y = xCurrent, yCurrent - coordEnd.X, coordEnd.Y = xEnd, yCurrent - - err = h.clearRect(attributes, coordStart, coordEnd) - if err != nil { - return err - } - - xCurrent = 0 - yCurrent += 1 - } - - // Clear intervening rectangular section - if yCurrent < yEnd { - coordStart.X, coordStart.Y = xCurrent, yCurrent - coordEnd.X, coordEnd.Y = xEnd, yEnd-1 - - err = h.clearRect(attributes, coordStart, coordEnd) - if err != nil { - return err - } - - xCurrent = 0 - yCurrent = yEnd - } - - // Clear remaining partial ending line - coordStart.X, coordStart.Y = xCurrent, yCurrent - coordEnd.X, coordEnd.Y = xEnd, yEnd - - err = h.clearRect(attributes, coordStart, coordEnd) - if err != nil { - return err - } - - return nil -} - -func (h *windowsAnsiEventHandler) clearRect(attributes uint16, fromCoord COORD, toCoord COORD) error { - region := SMALL_RECT{Top: fromCoord.Y, Left: fromCoord.X, Bottom: toCoord.Y, Right: toCoord.X} - width := toCoord.X - fromCoord.X + 1 - height := toCoord.Y - fromCoord.Y + 1 - size := uint32(width) * uint32(height) - - if size <= 0 { - return nil - } - - buffer := make([]CHAR_INFO, size) - - char := CHAR_INFO{ansiterm.FILL_CHARACTER, attributes} - for i := 0; i < int(size); i++ { - buffer[i] = char - } - - err := WriteConsoleOutput(h.fd, buffer, COORD{X: width, Y: height}, COORD{X: 0, Y: 0}, ®ion) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go b/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go deleted file mode 100644 index 2d27fa1d02..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/scroll_helper.go +++ /dev/null @@ -1,118 +0,0 @@ -// +build windows - -package winterm - -// effectiveSr gets the current effective scroll region in buffer coordinates -func (h *windowsAnsiEventHandler) effectiveSr(window SMALL_RECT) scrollRegion { - top := addInRange(window.Top, h.sr.top, window.Top, window.Bottom) - bottom := addInRange(window.Top, h.sr.bottom, window.Top, window.Bottom) - if top >= bottom { - top = window.Top - bottom = window.Bottom - } - return scrollRegion{top: top, bottom: bottom} -} - -func (h *windowsAnsiEventHandler) scrollUp(param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - sr := h.effectiveSr(info.Window) - return h.scroll(param, sr, info) -} - -func (h *windowsAnsiEventHandler) scrollDown(param int) error { - return h.scrollUp(-param) -} - -func (h *windowsAnsiEventHandler) deleteLines(param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - start := info.CursorPosition.Y - sr := h.effectiveSr(info.Window) - // Lines cannot be inserted or deleted outside the scrolling region. - if start >= sr.top && start <= sr.bottom { - sr.top = start - return h.scroll(param, sr, info) - } else { - return nil - } -} - -func (h *windowsAnsiEventHandler) insertLines(param int) error { - return h.deleteLines(-param) -} - -// scroll scrolls the provided scroll region by param lines. The scroll region is in buffer coordinates. -func (h *windowsAnsiEventHandler) scroll(param int, sr scrollRegion, info *CONSOLE_SCREEN_BUFFER_INFO) error { - h.logf("scroll: scrollTop: %d, scrollBottom: %d", sr.top, sr.bottom) - h.logf("scroll: windowTop: %d, windowBottom: %d", info.Window.Top, info.Window.Bottom) - - // Copy from and clip to the scroll region (full buffer width) - scrollRect := SMALL_RECT{ - Top: sr.top, - Bottom: sr.bottom, - Left: 0, - Right: info.Size.X - 1, - } - - // Origin to which area should be copied - destOrigin := COORD{ - X: 0, - Y: sr.top - int16(param), - } - - char := CHAR_INFO{ - UnicodeChar: ' ', - Attributes: h.attributes, - } - - if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil { - return err - } - return nil -} - -func (h *windowsAnsiEventHandler) deleteCharacters(param int) error { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - return h.scrollLine(param, info.CursorPosition, info) -} - -func (h *windowsAnsiEventHandler) insertCharacters(param int) error { - return h.deleteCharacters(-param) -} - -// scrollLine scrolls a line horizontally starting at the provided position by a number of columns. -func (h *windowsAnsiEventHandler) scrollLine(columns int, position COORD, info *CONSOLE_SCREEN_BUFFER_INFO) error { - // Copy from and clip to the scroll region (full buffer width) - scrollRect := SMALL_RECT{ - Top: position.Y, - Bottom: position.Y, - Left: position.X, - Right: info.Size.X - 1, - } - - // Origin to which area should be copied - destOrigin := COORD{ - X: position.X - int16(columns), - Y: position.Y, - } - - char := CHAR_INFO{ - UnicodeChar: ' ', - Attributes: h.attributes, - } - - if err := ScrollConsoleScreenBuffer(h.fd, scrollRect, scrollRect, destOrigin, char); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go b/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go deleted file mode 100644 index afa7635d77..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/utilities.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build windows - -package winterm - -// AddInRange increments a value by the passed quantity while ensuring the values -// always remain within the supplied min / max range. -func addInRange(n int16, increment int16, min int16, max int16) int16 { - return ensureInRange(n+increment, min, max) -} diff --git a/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go b/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go deleted file mode 100644 index 2d40fb75ad..0000000000 --- a/vendor/github.com/Azure/go-ansiterm/winterm/win_event_handler.go +++ /dev/null @@ -1,743 +0,0 @@ -// +build windows - -package winterm - -import ( - "bytes" - "log" - "os" - "strconv" - - "github.com/Azure/go-ansiterm" -) - -type windowsAnsiEventHandler struct { - fd uintptr - file *os.File - infoReset *CONSOLE_SCREEN_BUFFER_INFO - sr scrollRegion - buffer bytes.Buffer - attributes uint16 - inverted bool - wrapNext bool - drewMarginByte bool - originMode bool - marginByte byte - curInfo *CONSOLE_SCREEN_BUFFER_INFO - curPos COORD - logf func(string, ...interface{}) -} - -type Option func(*windowsAnsiEventHandler) - -func WithLogf(f func(string, ...interface{})) Option { - return func(w *windowsAnsiEventHandler) { - w.logf = f - } -} - -func CreateWinEventHandler(fd uintptr, file *os.File, opts ...Option) ansiterm.AnsiEventHandler { - infoReset, err := GetConsoleScreenBufferInfo(fd) - if err != nil { - return nil - } - - h := &windowsAnsiEventHandler{ - fd: fd, - file: file, - infoReset: infoReset, - attributes: infoReset.Attributes, - } - for _, o := range opts { - o(h) - } - - if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" { - logFile, _ := os.Create("winEventHandler.log") - logger := log.New(logFile, "", log.LstdFlags) - if h.logf != nil { - l := h.logf - h.logf = func(s string, v ...interface{}) { - l(s, v...) - logger.Printf(s, v...) - } - } else { - h.logf = logger.Printf - } - } - - if h.logf == nil { - h.logf = func(string, ...interface{}) {} - } - - return h -} - -type scrollRegion struct { - top int16 - bottom int16 -} - -// simulateLF simulates a LF or CR+LF by scrolling if necessary to handle the -// current cursor position and scroll region settings, in which case it returns -// true. If no special handling is necessary, then it does nothing and returns -// false. -// -// In the false case, the caller should ensure that a carriage return -// and line feed are inserted or that the text is otherwise wrapped. -func (h *windowsAnsiEventHandler) simulateLF(includeCR bool) (bool, error) { - if h.wrapNext { - if err := h.Flush(); err != nil { - return false, err - } - h.clearWrap() - } - pos, info, err := h.getCurrentInfo() - if err != nil { - return false, err - } - sr := h.effectiveSr(info.Window) - if pos.Y == sr.bottom { - // Scrolling is necessary. Let Windows automatically scroll if the scrolling region - // is the full window. - if sr.top == info.Window.Top && sr.bottom == info.Window.Bottom { - if includeCR { - pos.X = 0 - h.updatePos(pos) - } - return false, nil - } - - // A custom scroll region is active. Scroll the window manually to simulate - // the LF. - if err := h.Flush(); err != nil { - return false, err - } - h.logf("Simulating LF inside scroll region") - if err := h.scrollUp(1); err != nil { - return false, err - } - if includeCR { - pos.X = 0 - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return false, err - } - } - return true, nil - - } else if pos.Y < info.Window.Bottom { - // Let Windows handle the LF. - pos.Y++ - if includeCR { - pos.X = 0 - } - h.updatePos(pos) - return false, nil - } else { - // The cursor is at the bottom of the screen but outside the scroll - // region. Skip the LF. - h.logf("Simulating LF outside scroll region") - if includeCR { - if err := h.Flush(); err != nil { - return false, err - } - pos.X = 0 - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return false, err - } - } - return true, nil - } -} - -// executeLF executes a LF without a CR. -func (h *windowsAnsiEventHandler) executeLF() error { - handled, err := h.simulateLF(false) - if err != nil { - return err - } - if !handled { - // Windows LF will reset the cursor column position. Write the LF - // and restore the cursor position. - pos, _, err := h.getCurrentInfo() - if err != nil { - return err - } - h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED) - if pos.X != 0 { - if err := h.Flush(); err != nil { - return err - } - h.logf("Resetting cursor position for LF without CR") - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return err - } - } - } - return nil -} - -func (h *windowsAnsiEventHandler) Print(b byte) error { - if h.wrapNext { - h.buffer.WriteByte(h.marginByte) - h.clearWrap() - if _, err := h.simulateLF(true); err != nil { - return err - } - } - pos, info, err := h.getCurrentInfo() - if err != nil { - return err - } - if pos.X == info.Size.X-1 { - h.wrapNext = true - h.marginByte = b - } else { - pos.X++ - h.updatePos(pos) - h.buffer.WriteByte(b) - } - return nil -} - -func (h *windowsAnsiEventHandler) Execute(b byte) error { - switch b { - case ansiterm.ANSI_TAB: - h.logf("Execute(TAB)") - // Move to the next tab stop, but preserve auto-wrap if already set. - if !h.wrapNext { - pos, info, err := h.getCurrentInfo() - if err != nil { - return err - } - pos.X = (pos.X + 8) - pos.X%8 - if pos.X >= info.Size.X { - pos.X = info.Size.X - 1 - } - if err := h.Flush(); err != nil { - return err - } - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return err - } - } - return nil - - case ansiterm.ANSI_BEL: - h.buffer.WriteByte(ansiterm.ANSI_BEL) - return nil - - case ansiterm.ANSI_BACKSPACE: - if h.wrapNext { - if err := h.Flush(); err != nil { - return err - } - h.clearWrap() - } - pos, _, err := h.getCurrentInfo() - if err != nil { - return err - } - if pos.X > 0 { - pos.X-- - h.updatePos(pos) - h.buffer.WriteByte(ansiterm.ANSI_BACKSPACE) - } - return nil - - case ansiterm.ANSI_VERTICAL_TAB, ansiterm.ANSI_FORM_FEED: - // Treat as true LF. - return h.executeLF() - - case ansiterm.ANSI_LINE_FEED: - // Simulate a CR and LF for now since there is no way in go-ansiterm - // to tell if the LF should include CR (and more things break when it's - // missing than when it's incorrectly added). - handled, err := h.simulateLF(true) - if handled || err != nil { - return err - } - return h.buffer.WriteByte(ansiterm.ANSI_LINE_FEED) - - case ansiterm.ANSI_CARRIAGE_RETURN: - if h.wrapNext { - if err := h.Flush(); err != nil { - return err - } - h.clearWrap() - } - pos, _, err := h.getCurrentInfo() - if err != nil { - return err - } - if pos.X != 0 { - pos.X = 0 - h.updatePos(pos) - h.buffer.WriteByte(ansiterm.ANSI_CARRIAGE_RETURN) - } - return nil - - default: - return nil - } -} - -func (h *windowsAnsiEventHandler) CUU(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CUU: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorVertical(-param) -} - -func (h *windowsAnsiEventHandler) CUD(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CUD: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorVertical(param) -} - -func (h *windowsAnsiEventHandler) CUF(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CUF: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorHorizontal(param) -} - -func (h *windowsAnsiEventHandler) CUB(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CUB: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorHorizontal(-param) -} - -func (h *windowsAnsiEventHandler) CNL(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CNL: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorLine(param) -} - -func (h *windowsAnsiEventHandler) CPL(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CPL: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorLine(-param) -} - -func (h *windowsAnsiEventHandler) CHA(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CHA: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.moveCursorColumn(param) -} - -func (h *windowsAnsiEventHandler) VPA(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("VPA: [[%d]]", param) - h.clearWrap() - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - window := h.getCursorWindow(info) - position := info.CursorPosition - position.Y = window.Top + int16(param) - 1 - return h.setCursorPosition(position, window) -} - -func (h *windowsAnsiEventHandler) CUP(row int, col int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("CUP: [[%d %d]]", row, col) - h.clearWrap() - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - window := h.getCursorWindow(info) - position := COORD{window.Left + int16(col) - 1, window.Top + int16(row) - 1} - return h.setCursorPosition(position, window) -} - -func (h *windowsAnsiEventHandler) HVP(row int, col int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("HVP: [[%d %d]]", row, col) - h.clearWrap() - return h.CUP(row, col) -} - -func (h *windowsAnsiEventHandler) DECTCEM(visible bool) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DECTCEM: [%v]", []string{strconv.FormatBool(visible)}) - h.clearWrap() - return nil -} - -func (h *windowsAnsiEventHandler) DECOM(enable bool) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DECOM: [%v]", []string{strconv.FormatBool(enable)}) - h.clearWrap() - h.originMode = enable - return h.CUP(1, 1) -} - -func (h *windowsAnsiEventHandler) DECCOLM(use132 bool) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DECCOLM: [%v]", []string{strconv.FormatBool(use132)}) - h.clearWrap() - if err := h.ED(2); err != nil { - return err - } - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - targetWidth := int16(80) - if use132 { - targetWidth = 132 - } - if info.Size.X < targetWidth { - if err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil { - h.logf("set buffer failed: %v", err) - return err - } - } - window := info.Window - window.Left = 0 - window.Right = targetWidth - 1 - if err := SetConsoleWindowInfo(h.fd, true, window); err != nil { - h.logf("set window failed: %v", err) - return err - } - if info.Size.X > targetWidth { - if err := SetConsoleScreenBufferSize(h.fd, COORD{targetWidth, info.Size.Y}); err != nil { - h.logf("set buffer failed: %v", err) - return err - } - } - return SetConsoleCursorPosition(h.fd, COORD{0, 0}) -} - -func (h *windowsAnsiEventHandler) ED(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("ED: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - - // [J -- Erases from the cursor to the end of the screen, including the cursor position. - // [1J -- Erases from the beginning of the screen to the cursor, including the cursor position. - // [2J -- Erases the complete display. The cursor does not move. - // Notes: - // -- Clearing the entire buffer, versus just the Window, works best for Windows Consoles - - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - var start COORD - var end COORD - - switch param { - case 0: - start = info.CursorPosition - end = COORD{info.Size.X - 1, info.Size.Y - 1} - - case 1: - start = COORD{0, 0} - end = info.CursorPosition - - case 2: - start = COORD{0, 0} - end = COORD{info.Size.X - 1, info.Size.Y - 1} - } - - err = h.clearRange(h.attributes, start, end) - if err != nil { - return err - } - - // If the whole buffer was cleared, move the window to the top while preserving - // the window-relative cursor position. - if param == 2 { - pos := info.CursorPosition - window := info.Window - pos.Y -= window.Top - window.Bottom -= window.Top - window.Top = 0 - if err := SetConsoleCursorPosition(h.fd, pos); err != nil { - return err - } - if err := SetConsoleWindowInfo(h.fd, true, window); err != nil { - return err - } - } - - return nil -} - -func (h *windowsAnsiEventHandler) EL(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("EL: [%v]", strconv.Itoa(param)) - h.clearWrap() - - // [K -- Erases from the cursor to the end of the line, including the cursor position. - // [1K -- Erases from the beginning of the line to the cursor, including the cursor position. - // [2K -- Erases the complete line. - - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - var start COORD - var end COORD - - switch param { - case 0: - start = info.CursorPosition - end = COORD{info.Size.X, info.CursorPosition.Y} - - case 1: - start = COORD{0, info.CursorPosition.Y} - end = info.CursorPosition - - case 2: - start = COORD{0, info.CursorPosition.Y} - end = COORD{info.Size.X, info.CursorPosition.Y} - } - - err = h.clearRange(h.attributes, start, end) - if err != nil { - return err - } - - return nil -} - -func (h *windowsAnsiEventHandler) IL(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("IL: [%v]", strconv.Itoa(param)) - h.clearWrap() - return h.insertLines(param) -} - -func (h *windowsAnsiEventHandler) DL(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DL: [%v]", strconv.Itoa(param)) - h.clearWrap() - return h.deleteLines(param) -} - -func (h *windowsAnsiEventHandler) ICH(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("ICH: [%v]", strconv.Itoa(param)) - h.clearWrap() - return h.insertCharacters(param) -} - -func (h *windowsAnsiEventHandler) DCH(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DCH: [%v]", strconv.Itoa(param)) - h.clearWrap() - return h.deleteCharacters(param) -} - -func (h *windowsAnsiEventHandler) SGR(params []int) error { - if err := h.Flush(); err != nil { - return err - } - strings := []string{} - for _, v := range params { - strings = append(strings, strconv.Itoa(v)) - } - - h.logf("SGR: [%v]", strings) - - if len(params) <= 0 { - h.attributes = h.infoReset.Attributes - h.inverted = false - } else { - for _, attr := range params { - - if attr == ansiterm.ANSI_SGR_RESET { - h.attributes = h.infoReset.Attributes - h.inverted = false - continue - } - - h.attributes, h.inverted = collectAnsiIntoWindowsAttributes(h.attributes, h.inverted, h.infoReset.Attributes, int16(attr)) - } - } - - attributes := h.attributes - if h.inverted { - attributes = invertAttributes(attributes) - } - err := SetConsoleTextAttribute(h.fd, attributes) - if err != nil { - return err - } - - return nil -} - -func (h *windowsAnsiEventHandler) SU(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("SU: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.scrollUp(param) -} - -func (h *windowsAnsiEventHandler) SD(param int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("SD: [%v]", []string{strconv.Itoa(param)}) - h.clearWrap() - return h.scrollDown(param) -} - -func (h *windowsAnsiEventHandler) DA(params []string) error { - h.logf("DA: [%v]", params) - // DA cannot be implemented because it must send data on the VT100 input stream, - // which is not available to go-ansiterm. - return nil -} - -func (h *windowsAnsiEventHandler) DECSTBM(top int, bottom int) error { - if err := h.Flush(); err != nil { - return err - } - h.logf("DECSTBM: [%d, %d]", top, bottom) - - // Windows is 0 indexed, Linux is 1 indexed - h.sr.top = int16(top - 1) - h.sr.bottom = int16(bottom - 1) - - // This command also moves the cursor to the origin. - h.clearWrap() - return h.CUP(1, 1) -} - -func (h *windowsAnsiEventHandler) RI() error { - if err := h.Flush(); err != nil { - return err - } - h.logf("RI: []") - h.clearWrap() - - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - sr := h.effectiveSr(info.Window) - if info.CursorPosition.Y == sr.top { - return h.scrollDown(1) - } - - return h.moveCursorVertical(-1) -} - -func (h *windowsAnsiEventHandler) IND() error { - h.logf("IND: []") - return h.executeLF() -} - -func (h *windowsAnsiEventHandler) Flush() error { - h.curInfo = nil - if h.buffer.Len() > 0 { - h.logf("Flush: [%s]", h.buffer.Bytes()) - if _, err := h.buffer.WriteTo(h.file); err != nil { - return err - } - } - - if h.wrapNext && !h.drewMarginByte { - h.logf("Flush: drawing margin byte '%c'", h.marginByte) - - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return err - } - - charInfo := []CHAR_INFO{{UnicodeChar: uint16(h.marginByte), Attributes: info.Attributes}} - size := COORD{1, 1} - position := COORD{0, 0} - region := SMALL_RECT{Left: info.CursorPosition.X, Top: info.CursorPosition.Y, Right: info.CursorPosition.X, Bottom: info.CursorPosition.Y} - if err := WriteConsoleOutput(h.fd, charInfo, size, position, ®ion); err != nil { - return err - } - h.drewMarginByte = true - } - return nil -} - -// cacheConsoleInfo ensures that the current console screen information has been queried -// since the last call to Flush(). It must be called before accessing h.curInfo or h.curPos. -func (h *windowsAnsiEventHandler) getCurrentInfo() (COORD, *CONSOLE_SCREEN_BUFFER_INFO, error) { - if h.curInfo == nil { - info, err := GetConsoleScreenBufferInfo(h.fd) - if err != nil { - return COORD{}, nil, err - } - h.curInfo = info - h.curPos = info.CursorPosition - } - return h.curPos, h.curInfo, nil -} - -func (h *windowsAnsiEventHandler) updatePos(pos COORD) { - if h.curInfo == nil { - panic("failed to call getCurrentInfo before calling updatePos") - } - h.curPos = pos -} - -// clearWrap clears the state where the cursor is in the margin -// waiting for the next character before wrapping the line. This must -// be done before most operations that act on the cursor. -func (h *windowsAnsiEventHandler) clearWrap() { - h.wrapNext = false - h.drewMarginByte = false -} diff --git a/vendor/github.com/BurntSushi/toml/.gitignore b/vendor/github.com/BurntSushi/toml/.gitignore deleted file mode 100644 index fe79e3adda..0000000000 --- a/vendor/github.com/BurntSushi/toml/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/toml.test -/toml-test diff --git a/vendor/github.com/BurntSushi/toml/COPYING b/vendor/github.com/BurntSushi/toml/COPYING deleted file mode 100644 index 01b5743200..0000000000 --- a/vendor/github.com/BurntSushi/toml/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 TOML authors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/BurntSushi/toml/README.md b/vendor/github.com/BurntSushi/toml/README.md deleted file mode 100644 index 3651cfa960..0000000000 --- a/vendor/github.com/BurntSushi/toml/README.md +++ /dev/null @@ -1,120 +0,0 @@ -TOML stands for Tom's Obvious, Minimal Language. This Go package provides a -reflection interface similar to Go's standard library `json` and `xml` packages. - -Compatible with TOML version [v1.0.0](https://toml.io/en/v1.0.0). - -Documentation: https://godocs.io/github.com/BurntSushi/toml - -See the [releases page](https://github.com/BurntSushi/toml/releases) for a -changelog; this information is also in the git tag annotations (e.g. `git show -v0.4.0`). - -This library requires Go 1.13 or newer; add it to your go.mod with: - - % go get github.com/BurntSushi/toml@latest - -It also comes with a TOML validator CLI tool: - - % go install github.com/BurntSushi/toml/cmd/tomlv@latest - % tomlv some-toml-file.toml - -### Examples -For the simplest example, consider some TOML file as just a list of keys and -values: - -```toml -Age = 25 -Cats = [ "Cauchy", "Plato" ] -Pi = 3.14 -Perfection = [ 6, 28, 496, 8128 ] -DOB = 1987-07-05T05:45:00Z -``` - -Which can be decoded with: - -```go -type Config struct { - Age int - Cats []string - Pi float64 - Perfection []int - DOB time.Time -} - -var conf Config -_, err := toml.Decode(tomlData, &conf) -``` - -You can also use struct tags if your struct field name doesn't map to a TOML key -value directly: - -```toml -some_key_NAME = "wat" -``` - -```go -type TOML struct { - ObscureKey string `toml:"some_key_NAME"` -} -``` - -Beware that like other decoders **only exported fields** are considered when -encoding and decoding; private fields are silently ignored. - -### Using the `Marshaler` and `encoding.TextUnmarshaler` interfaces -Here's an example that automatically parses values in a `mail.Address`: - -```toml -contacts = [ - "Donald Duck ", - "Scrooge McDuck ", -] -``` - -Can be decoded with: - -```go -// Create address type which satisfies the encoding.TextUnmarshaler interface. -type address struct { - *mail.Address -} - -func (a *address) UnmarshalText(text []byte) error { - var err error - a.Address, err = mail.ParseAddress(string(text)) - return err -} - -// Decode it. -func decode() { - blob := ` - contacts = [ - "Donald Duck ", - "Scrooge McDuck ", - ] - ` - - var contacts struct { - Contacts []address - } - - _, err := toml.Decode(blob, &contacts) - if err != nil { - log.Fatal(err) - } - - for _, c := range contacts.Contacts { - fmt.Printf("%#v\n", c.Address) - } - - // Output: - // &mail.Address{Name:"Donald Duck", Address:"donald@duckburg.com"} - // &mail.Address{Name:"Scrooge McDuck", Address:"scrooge@duckburg.com"} -} -``` - -To target TOML specifically you can implement `UnmarshalTOML` TOML interface in -a similar way. - -### More complex usage -See the [`_example/`](/_example) directory for a more complex example. diff --git a/vendor/github.com/BurntSushi/toml/decode.go b/vendor/github.com/BurntSushi/toml/decode.go deleted file mode 100644 index 4d38f3bfce..0000000000 --- a/vendor/github.com/BurntSushi/toml/decode.go +++ /dev/null @@ -1,602 +0,0 @@ -package toml - -import ( - "bytes" - "encoding" - "encoding/json" - "fmt" - "io" - "io/ioutil" - "math" - "os" - "reflect" - "strconv" - "strings" - "time" -) - -// Unmarshaler is the interface implemented by objects that can unmarshal a -// TOML description of themselves. -type Unmarshaler interface { - UnmarshalTOML(interface{}) error -} - -// Unmarshal decodes the contents of data in TOML format into a pointer v. -// -// See [Decoder] for a description of the decoding process. -func Unmarshal(data []byte, v interface{}) error { - _, err := NewDecoder(bytes.NewReader(data)).Decode(v) - return err -} - -// Decode the TOML data in to the pointer v. -// -// See [Decoder] for a description of the decoding process. -func Decode(data string, v interface{}) (MetaData, error) { - return NewDecoder(strings.NewReader(data)).Decode(v) -} - -// DecodeFile reads the contents of a file and decodes it with [Decode]. -func DecodeFile(path string, v interface{}) (MetaData, error) { - fp, err := os.Open(path) - if err != nil { - return MetaData{}, err - } - defer fp.Close() - return NewDecoder(fp).Decode(v) -} - -// Primitive is a TOML value that hasn't been decoded into a Go value. -// -// This type can be used for any value, which will cause decoding to be delayed. -// You can use [PrimitiveDecode] to "manually" decode these values. -// -// NOTE: The underlying representation of a `Primitive` value is subject to -// change. Do not rely on it. -// -// NOTE: Primitive values are still parsed, so using them will only avoid the -// overhead of reflection. They can be useful when you don't know the exact type -// of TOML data until runtime. -type Primitive struct { - undecoded interface{} - context Key -} - -// The significand precision for float32 and float64 is 24 and 53 bits; this is -// the range a natural number can be stored in a float without loss of data. -const ( - maxSafeFloat32Int = 16777215 // 2^24-1 - maxSafeFloat64Int = int64(9007199254740991) // 2^53-1 -) - -// Decoder decodes TOML data. -// -// TOML tables correspond to Go structs or maps; they can be used -// interchangeably, but structs offer better type safety. -// -// TOML table arrays correspond to either a slice of structs or a slice of maps. -// -// TOML datetimes correspond to [time.Time]. Local datetimes are parsed in the -// local timezone. -// -// [time.Duration] types are treated as nanoseconds if the TOML value is an -// integer, or they're parsed with time.ParseDuration() if they're strings. -// -// All other TOML types (float, string, int, bool and array) correspond to the -// obvious Go types. -// -// An exception to the above rules is if a type implements the TextUnmarshaler -// interface, in which case any primitive TOML value (floats, strings, integers, -// booleans, datetimes) will be converted to a []byte and given to the value's -// UnmarshalText method. See the Unmarshaler example for a demonstration with -// email addresses. -// -// # Key mapping -// -// TOML keys can map to either keys in a Go map or field names in a Go struct. -// The special `toml` struct tag can be used to map TOML keys to struct fields -// that don't match the key name exactly (see the example). A case insensitive -// match to struct names will be tried if an exact match can't be found. -// -// The mapping between TOML values and Go values is loose. That is, there may -// exist TOML values that cannot be placed into your representation, and there -// may be parts of your representation that do not correspond to TOML values. -// This loose mapping can be made stricter by using the IsDefined and/or -// Undecoded methods on the MetaData returned. -// -// This decoder does not handle cyclic types. Decode will not terminate if a -// cyclic type is passed. -type Decoder struct { - r io.Reader -} - -// NewDecoder creates a new Decoder. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{r: r} -} - -var ( - unmarshalToml = reflect.TypeOf((*Unmarshaler)(nil)).Elem() - unmarshalText = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() - primitiveType = reflect.TypeOf((*Primitive)(nil)).Elem() -) - -// Decode TOML data in to the pointer `v`. -func (dec *Decoder) Decode(v interface{}) (MetaData, error) { - rv := reflect.ValueOf(v) - if rv.Kind() != reflect.Ptr { - s := "%q" - if reflect.TypeOf(v) == nil { - s = "%v" - } - - return MetaData{}, fmt.Errorf("toml: cannot decode to non-pointer "+s, reflect.TypeOf(v)) - } - if rv.IsNil() { - return MetaData{}, fmt.Errorf("toml: cannot decode to nil value of %q", reflect.TypeOf(v)) - } - - // Check if this is a supported type: struct, map, interface{}, or something - // that implements UnmarshalTOML or UnmarshalText. - rv = indirect(rv) - rt := rv.Type() - if rv.Kind() != reflect.Struct && rv.Kind() != reflect.Map && - !(rv.Kind() == reflect.Interface && rv.NumMethod() == 0) && - !rt.Implements(unmarshalToml) && !rt.Implements(unmarshalText) { - return MetaData{}, fmt.Errorf("toml: cannot decode to type %s", rt) - } - - // TODO: parser should read from io.Reader? Or at the very least, make it - // read from []byte rather than string - data, err := ioutil.ReadAll(dec.r) - if err != nil { - return MetaData{}, err - } - - p, err := parse(string(data)) - if err != nil { - return MetaData{}, err - } - - md := MetaData{ - mapping: p.mapping, - keyInfo: p.keyInfo, - keys: p.ordered, - decoded: make(map[string]struct{}, len(p.ordered)), - context: nil, - data: data, - } - return md, md.unify(p.mapping, rv) -} - -// PrimitiveDecode is just like the other Decode* functions, except it decodes a -// TOML value that has already been parsed. Valid primitive values can *only* be -// obtained from values filled by the decoder functions, including this method. -// (i.e., v may contain more [Primitive] values.) -// -// Meta data for primitive values is included in the meta data returned by the -// Decode* functions with one exception: keys returned by the Undecoded method -// will only reflect keys that were decoded. Namely, any keys hidden behind a -// Primitive will be considered undecoded. Executing this method will update the -// undecoded keys in the meta data. (See the example.) -func (md *MetaData) PrimitiveDecode(primValue Primitive, v interface{}) error { - md.context = primValue.context - defer func() { md.context = nil }() - return md.unify(primValue.undecoded, rvalue(v)) -} - -// unify performs a sort of type unification based on the structure of `rv`, -// which is the client representation. -// -// Any type mismatch produces an error. Finding a type that we don't know -// how to handle produces an unsupported type error. -func (md *MetaData) unify(data interface{}, rv reflect.Value) error { - // Special case. Look for a `Primitive` value. - // TODO: #76 would make this superfluous after implemented. - if rv.Type() == primitiveType { - // Save the undecoded data and the key context into the primitive - // value. - context := make(Key, len(md.context)) - copy(context, md.context) - rv.Set(reflect.ValueOf(Primitive{ - undecoded: data, - context: context, - })) - return nil - } - - rvi := rv.Interface() - if v, ok := rvi.(Unmarshaler); ok { - return v.UnmarshalTOML(data) - } - if v, ok := rvi.(encoding.TextUnmarshaler); ok { - return md.unifyText(data, v) - } - - // TODO: - // The behavior here is incorrect whenever a Go type satisfies the - // encoding.TextUnmarshaler interface but also corresponds to a TOML hash or - // array. In particular, the unmarshaler should only be applied to primitive - // TOML values. But at this point, it will be applied to all kinds of values - // and produce an incorrect error whenever those values are hashes or arrays - // (including arrays of tables). - - k := rv.Kind() - - if k >= reflect.Int && k <= reflect.Uint64 { - return md.unifyInt(data, rv) - } - switch k { - case reflect.Ptr: - elem := reflect.New(rv.Type().Elem()) - err := md.unify(data, reflect.Indirect(elem)) - if err != nil { - return err - } - rv.Set(elem) - return nil - case reflect.Struct: - return md.unifyStruct(data, rv) - case reflect.Map: - return md.unifyMap(data, rv) - case reflect.Array: - return md.unifyArray(data, rv) - case reflect.Slice: - return md.unifySlice(data, rv) - case reflect.String: - return md.unifyString(data, rv) - case reflect.Bool: - return md.unifyBool(data, rv) - case reflect.Interface: - if rv.NumMethod() > 0 { /// Only empty interfaces are supported. - return md.e("unsupported type %s", rv.Type()) - } - return md.unifyAnything(data, rv) - case reflect.Float32, reflect.Float64: - return md.unifyFloat64(data, rv) - } - return md.e("unsupported type %s", rv.Kind()) -} - -func (md *MetaData) unifyStruct(mapping interface{}, rv reflect.Value) error { - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if mapping == nil { - return nil - } - return md.e("type mismatch for %s: expected table but found %T", - rv.Type().String(), mapping) - } - - for key, datum := range tmap { - var f *field - fields := cachedTypeFields(rv.Type()) - for i := range fields { - ff := &fields[i] - if ff.name == key { - f = ff - break - } - if f == nil && strings.EqualFold(ff.name, key) { - f = ff - } - } - if f != nil { - subv := rv - for _, i := range f.index { - subv = indirect(subv.Field(i)) - } - - if isUnifiable(subv) { - md.decoded[md.context.add(key).String()] = struct{}{} - md.context = append(md.context, key) - - err := md.unify(datum, subv) - if err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - } else if f.name != "" { - return md.e("cannot write unexported field %s.%s", rv.Type().String(), f.name) - } - } - } - return nil -} - -func (md *MetaData) unifyMap(mapping interface{}, rv reflect.Value) error { - keyType := rv.Type().Key().Kind() - if keyType != reflect.String && keyType != reflect.Interface { - return fmt.Errorf("toml: cannot decode to a map with non-string key type (%s in %q)", - keyType, rv.Type()) - } - - tmap, ok := mapping.(map[string]interface{}) - if !ok { - if tmap == nil { - return nil - } - return md.badtype("map", mapping) - } - if rv.IsNil() { - rv.Set(reflect.MakeMap(rv.Type())) - } - for k, v := range tmap { - md.decoded[md.context.add(k).String()] = struct{}{} - md.context = append(md.context, k) - - rvval := reflect.Indirect(reflect.New(rv.Type().Elem())) - - err := md.unify(v, indirect(rvval)) - if err != nil { - return err - } - md.context = md.context[0 : len(md.context)-1] - - rvkey := indirect(reflect.New(rv.Type().Key())) - - switch keyType { - case reflect.Interface: - rvkey.Set(reflect.ValueOf(k)) - case reflect.String: - rvkey.SetString(k) - } - - rv.SetMapIndex(rvkey, rvval) - } - return nil -} - -func (md *MetaData) unifyArray(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return md.badtype("slice", data) - } - if l := datav.Len(); l != rv.Len() { - return md.e("expected array length %d; got TOML array of length %d", rv.Len(), l) - } - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySlice(data interface{}, rv reflect.Value) error { - datav := reflect.ValueOf(data) - if datav.Kind() != reflect.Slice { - if !datav.IsValid() { - return nil - } - return md.badtype("slice", data) - } - n := datav.Len() - if rv.IsNil() || rv.Cap() < n { - rv.Set(reflect.MakeSlice(rv.Type(), n, n)) - } - rv.SetLen(n) - return md.unifySliceArray(datav, rv) -} - -func (md *MetaData) unifySliceArray(data, rv reflect.Value) error { - l := data.Len() - for i := 0; i < l; i++ { - err := md.unify(data.Index(i).Interface(), indirect(rv.Index(i))) - if err != nil { - return err - } - } - return nil -} - -func (md *MetaData) unifyString(data interface{}, rv reflect.Value) error { - _, ok := rv.Interface().(json.Number) - if ok { - if i, ok := data.(int64); ok { - rv.SetString(strconv.FormatInt(i, 10)) - } else if f, ok := data.(float64); ok { - rv.SetString(strconv.FormatFloat(f, 'f', -1, 64)) - } else { - return md.badtype("string", data) - } - return nil - } - - if s, ok := data.(string); ok { - rv.SetString(s) - return nil - } - return md.badtype("string", data) -} - -func (md *MetaData) unifyFloat64(data interface{}, rv reflect.Value) error { - rvk := rv.Kind() - - if num, ok := data.(float64); ok { - switch rvk { - case reflect.Float32: - if num < -math.MaxFloat32 || num > math.MaxFloat32 { - return md.parseErr(errParseRange{i: num, size: rvk.String()}) - } - fallthrough - case reflect.Float64: - rv.SetFloat(num) - default: - panic("bug") - } - return nil - } - - if num, ok := data.(int64); ok { - if (rvk == reflect.Float32 && (num < -maxSafeFloat32Int || num > maxSafeFloat32Int)) || - (rvk == reflect.Float64 && (num < -maxSafeFloat64Int || num > maxSafeFloat64Int)) { - return md.parseErr(errParseRange{i: num, size: rvk.String()}) - } - rv.SetFloat(float64(num)) - return nil - } - - return md.badtype("float", data) -} - -func (md *MetaData) unifyInt(data interface{}, rv reflect.Value) error { - _, ok := rv.Interface().(time.Duration) - if ok { - // Parse as string duration, and fall back to regular integer parsing - // (as nanosecond) if this is not a string. - if s, ok := data.(string); ok { - dur, err := time.ParseDuration(s) - if err != nil { - return md.parseErr(errParseDuration{s}) - } - rv.SetInt(int64(dur)) - return nil - } - } - - num, ok := data.(int64) - if !ok { - return md.badtype("integer", data) - } - - rvk := rv.Kind() - switch { - case rvk >= reflect.Int && rvk <= reflect.Int64: - if (rvk == reflect.Int8 && (num < math.MinInt8 || num > math.MaxInt8)) || - (rvk == reflect.Int16 && (num < math.MinInt16 || num > math.MaxInt16)) || - (rvk == reflect.Int32 && (num < math.MinInt32 || num > math.MaxInt32)) { - return md.parseErr(errParseRange{i: num, size: rvk.String()}) - } - rv.SetInt(num) - case rvk >= reflect.Uint && rvk <= reflect.Uint64: - unum := uint64(num) - if rvk == reflect.Uint8 && (num < 0 || unum > math.MaxUint8) || - rvk == reflect.Uint16 && (num < 0 || unum > math.MaxUint16) || - rvk == reflect.Uint32 && (num < 0 || unum > math.MaxUint32) { - return md.parseErr(errParseRange{i: num, size: rvk.String()}) - } - rv.SetUint(unum) - default: - panic("unreachable") - } - return nil -} - -func (md *MetaData) unifyBool(data interface{}, rv reflect.Value) error { - if b, ok := data.(bool); ok { - rv.SetBool(b) - return nil - } - return md.badtype("boolean", data) -} - -func (md *MetaData) unifyAnything(data interface{}, rv reflect.Value) error { - rv.Set(reflect.ValueOf(data)) - return nil -} - -func (md *MetaData) unifyText(data interface{}, v encoding.TextUnmarshaler) error { - var s string - switch sdata := data.(type) { - case Marshaler: - text, err := sdata.MarshalTOML() - if err != nil { - return err - } - s = string(text) - case encoding.TextMarshaler: - text, err := sdata.MarshalText() - if err != nil { - return err - } - s = string(text) - case fmt.Stringer: - s = sdata.String() - case string: - s = sdata - case bool: - s = fmt.Sprintf("%v", sdata) - case int64: - s = fmt.Sprintf("%d", sdata) - case float64: - s = fmt.Sprintf("%f", sdata) - default: - return md.badtype("primitive (string-like)", data) - } - if err := v.UnmarshalText([]byte(s)); err != nil { - return err - } - return nil -} - -func (md *MetaData) badtype(dst string, data interface{}) error { - return md.e("incompatible types: TOML value has type %T; destination has type %s", data, dst) -} - -func (md *MetaData) parseErr(err error) error { - k := md.context.String() - return ParseError{ - LastKey: k, - Position: md.keyInfo[k].pos, - Line: md.keyInfo[k].pos.Line, - err: err, - input: string(md.data), - } -} - -func (md *MetaData) e(format string, args ...interface{}) error { - f := "toml: " - if len(md.context) > 0 { - f = fmt.Sprintf("toml: (last key %q): ", md.context) - p := md.keyInfo[md.context.String()].pos - if p.Line > 0 { - f = fmt.Sprintf("toml: line %d (last key %q): ", p.Line, md.context) - } - } - return fmt.Errorf(f+format, args...) -} - -// rvalue returns a reflect.Value of `v`. All pointers are resolved. -func rvalue(v interface{}) reflect.Value { - return indirect(reflect.ValueOf(v)) -} - -// indirect returns the value pointed to by a pointer. -// -// Pointers are followed until the value is not a pointer. New values are -// allocated for each nil pointer. -// -// An exception to this rule is if the value satisfies an interface of interest -// to us (like encoding.TextUnmarshaler). -func indirect(v reflect.Value) reflect.Value { - if v.Kind() != reflect.Ptr { - if v.CanSet() { - pv := v.Addr() - pvi := pv.Interface() - if _, ok := pvi.(encoding.TextUnmarshaler); ok { - return pv - } - if _, ok := pvi.(Unmarshaler); ok { - return pv - } - } - return v - } - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - return indirect(reflect.Indirect(v)) -} - -func isUnifiable(rv reflect.Value) bool { - if rv.CanSet() { - return true - } - rvi := rv.Interface() - if _, ok := rvi.(encoding.TextUnmarshaler); ok { - return true - } - if _, ok := rvi.(Unmarshaler); ok { - return true - } - return false -} diff --git a/vendor/github.com/BurntSushi/toml/decode_go116.go b/vendor/github.com/BurntSushi/toml/decode_go116.go deleted file mode 100644 index 086d0b6866..0000000000 --- a/vendor/github.com/BurntSushi/toml/decode_go116.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -package toml - -import ( - "io/fs" -) - -// DecodeFS reads the contents of a file from [fs.FS] and decodes it with -// [Decode]. -func DecodeFS(fsys fs.FS, path string, v interface{}) (MetaData, error) { - fp, err := fsys.Open(path) - if err != nil { - return MetaData{}, err - } - defer fp.Close() - return NewDecoder(fp).Decode(v) -} diff --git a/vendor/github.com/BurntSushi/toml/deprecated.go b/vendor/github.com/BurntSushi/toml/deprecated.go deleted file mode 100644 index b9e309717e..0000000000 --- a/vendor/github.com/BurntSushi/toml/deprecated.go +++ /dev/null @@ -1,29 +0,0 @@ -package toml - -import ( - "encoding" - "io" -) - -// TextMarshaler is an alias for encoding.TextMarshaler. -// -// Deprecated: use encoding.TextMarshaler -type TextMarshaler encoding.TextMarshaler - -// TextUnmarshaler is an alias for encoding.TextUnmarshaler. -// -// Deprecated: use encoding.TextUnmarshaler -type TextUnmarshaler encoding.TextUnmarshaler - -// PrimitiveDecode is an alias for MetaData.PrimitiveDecode(). -// -// Deprecated: use MetaData.PrimitiveDecode. -func PrimitiveDecode(primValue Primitive, v interface{}) error { - md := MetaData{decoded: make(map[string]struct{})} - return md.unify(primValue.undecoded, rvalue(v)) -} - -// DecodeReader is an alias for NewDecoder(r).Decode(v). -// -// Deprecated: use NewDecoder(reader).Decode(&value). -func DecodeReader(r io.Reader, v interface{}) (MetaData, error) { return NewDecoder(r).Decode(v) } diff --git a/vendor/github.com/BurntSushi/toml/doc.go b/vendor/github.com/BurntSushi/toml/doc.go deleted file mode 100644 index 81a7c0fe9f..0000000000 --- a/vendor/github.com/BurntSushi/toml/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package toml implements decoding and encoding of TOML files. -// -// This package supports TOML v1.0.0, as specified at https://toml.io -// -// There is also support for delaying decoding with the Primitive type, and -// querying the set of keys in a TOML document with the MetaData type. -// -// The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator, -// and can be used to verify if TOML document is valid. It can also be used to -// print the type of each key. -package toml diff --git a/vendor/github.com/BurntSushi/toml/encode.go b/vendor/github.com/BurntSushi/toml/encode.go deleted file mode 100644 index 9cd25d7571..0000000000 --- a/vendor/github.com/BurntSushi/toml/encode.go +++ /dev/null @@ -1,759 +0,0 @@ -package toml - -import ( - "bufio" - "encoding" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "reflect" - "sort" - "strconv" - "strings" - "time" - - "github.com/BurntSushi/toml/internal" -) - -type tomlEncodeError struct{ error } - -var ( - errArrayNilElement = errors.New("toml: cannot encode array with nil element") - errNonString = errors.New("toml: cannot encode a map with non-string key type") - errNoKey = errors.New("toml: top-level values must be Go maps or structs") - errAnything = errors.New("") // used in testing -) - -var dblQuotedReplacer = strings.NewReplacer( - "\"", "\\\"", - "\\", "\\\\", - "\x00", `\u0000`, - "\x01", `\u0001`, - "\x02", `\u0002`, - "\x03", `\u0003`, - "\x04", `\u0004`, - "\x05", `\u0005`, - "\x06", `\u0006`, - "\x07", `\u0007`, - "\b", `\b`, - "\t", `\t`, - "\n", `\n`, - "\x0b", `\u000b`, - "\f", `\f`, - "\r", `\r`, - "\x0e", `\u000e`, - "\x0f", `\u000f`, - "\x10", `\u0010`, - "\x11", `\u0011`, - "\x12", `\u0012`, - "\x13", `\u0013`, - "\x14", `\u0014`, - "\x15", `\u0015`, - "\x16", `\u0016`, - "\x17", `\u0017`, - "\x18", `\u0018`, - "\x19", `\u0019`, - "\x1a", `\u001a`, - "\x1b", `\u001b`, - "\x1c", `\u001c`, - "\x1d", `\u001d`, - "\x1e", `\u001e`, - "\x1f", `\u001f`, - "\x7f", `\u007f`, -) - -var ( - marshalToml = reflect.TypeOf((*Marshaler)(nil)).Elem() - marshalText = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() - timeType = reflect.TypeOf((*time.Time)(nil)).Elem() -) - -// Marshaler is the interface implemented by types that can marshal themselves -// into valid TOML. -type Marshaler interface { - MarshalTOML() ([]byte, error) -} - -// Encoder encodes a Go to a TOML document. -// -// The mapping between Go values and TOML values should be precisely the same as -// for [Decode]. -// -// time.Time is encoded as a RFC 3339 string, and time.Duration as its string -// representation. -// -// The [Marshaler] and [encoding.TextMarshaler] interfaces are supported to -// encoding the value as custom TOML. -// -// If you want to write arbitrary binary data then you will need to use -// something like base64 since TOML does not have any binary types. -// -// When encoding TOML hashes (Go maps or structs), keys without any sub-hashes -// are encoded first. -// -// Go maps will be sorted alphabetically by key for deterministic output. -// -// The toml struct tag can be used to provide the key name; if omitted the -// struct field name will be used. If the "omitempty" option is present the -// following value will be skipped: -// -// - arrays, slices, maps, and string with len of 0 -// - struct with all zero values -// - bool false -// -// If omitzero is given all int and float types with a value of 0 will be -// skipped. -// -// Encoding Go values without a corresponding TOML representation will return an -// error. Examples of this includes maps with non-string keys, slices with nil -// elements, embedded non-struct types, and nested slices containing maps or -// structs. (e.g. [][]map[string]string is not allowed but []map[string]string -// is okay, as is []map[string][]string). -// -// NOTE: only exported keys are encoded due to the use of reflection. Unexported -// keys are silently discarded. -type Encoder struct { - // String to use for a single indentation level; default is two spaces. - Indent string - - w *bufio.Writer - hasWritten bool // written any output to w yet? -} - -// NewEncoder create a new Encoder. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - w: bufio.NewWriter(w), - Indent: " ", - } -} - -// Encode writes a TOML representation of the Go value to the [Encoder]'s writer. -// -// An error is returned if the value given cannot be encoded to a valid TOML -// document. -func (enc *Encoder) Encode(v interface{}) error { - rv := eindirect(reflect.ValueOf(v)) - err := enc.safeEncode(Key([]string{}), rv) - if err != nil { - return err - } - return enc.w.Flush() -} - -func (enc *Encoder) safeEncode(key Key, rv reflect.Value) (err error) { - defer func() { - if r := recover(); r != nil { - if terr, ok := r.(tomlEncodeError); ok { - err = terr.error - return - } - panic(r) - } - }() - enc.encode(key, rv) - return nil -} - -func (enc *Encoder) encode(key Key, rv reflect.Value) { - // If we can marshal the type to text, then we use that. This prevents the - // encoder for handling these types as generic structs (or whatever the - // underlying type of a TextMarshaler is). - switch { - case isMarshaler(rv): - enc.writeKeyValue(key, rv, false) - return - case rv.Type() == primitiveType: // TODO: #76 would make this superfluous after implemented. - enc.encode(key, reflect.ValueOf(rv.Interface().(Primitive).undecoded)) - return - } - - k := rv.Kind() - switch k { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64, - reflect.Float32, reflect.Float64, reflect.String, reflect.Bool: - enc.writeKeyValue(key, rv, false) - case reflect.Array, reflect.Slice: - if typeEqual(tomlArrayHash, tomlTypeOfGo(rv)) { - enc.eArrayOfTables(key, rv) - } else { - enc.writeKeyValue(key, rv, false) - } - case reflect.Interface: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Map: - if rv.IsNil() { - return - } - enc.eTable(key, rv) - case reflect.Ptr: - if rv.IsNil() { - return - } - enc.encode(key, rv.Elem()) - case reflect.Struct: - enc.eTable(key, rv) - default: - encPanic(fmt.Errorf("unsupported type for key '%s': %s", key, k)) - } -} - -// eElement encodes any value that can be an array element. -func (enc *Encoder) eElement(rv reflect.Value) { - switch v := rv.Interface().(type) { - case time.Time: // Using TextMarshaler adds extra quotes, which we don't want. - format := time.RFC3339Nano - switch v.Location() { - case internal.LocalDatetime: - format = "2006-01-02T15:04:05.999999999" - case internal.LocalDate: - format = "2006-01-02" - case internal.LocalTime: - format = "15:04:05.999999999" - } - switch v.Location() { - default: - enc.wf(v.Format(format)) - case internal.LocalDatetime, internal.LocalDate, internal.LocalTime: - enc.wf(v.In(time.UTC).Format(format)) - } - return - case Marshaler: - s, err := v.MarshalTOML() - if err != nil { - encPanic(err) - } - if s == nil { - encPanic(errors.New("MarshalTOML returned nil and no error")) - } - enc.w.Write(s) - return - case encoding.TextMarshaler: - s, err := v.MarshalText() - if err != nil { - encPanic(err) - } - if s == nil { - encPanic(errors.New("MarshalText returned nil and no error")) - } - enc.writeQuoted(string(s)) - return - case time.Duration: - enc.writeQuoted(v.String()) - return - case json.Number: - n, _ := rv.Interface().(json.Number) - - if n == "" { /// Useful zero value. - enc.w.WriteByte('0') - return - } else if v, err := n.Int64(); err == nil { - enc.eElement(reflect.ValueOf(v)) - return - } else if v, err := n.Float64(); err == nil { - enc.eElement(reflect.ValueOf(v)) - return - } - encPanic(fmt.Errorf("unable to convert %q to int64 or float64", n)) - } - - switch rv.Kind() { - case reflect.Ptr: - enc.eElement(rv.Elem()) - return - case reflect.String: - enc.writeQuoted(rv.String()) - case reflect.Bool: - enc.wf(strconv.FormatBool(rv.Bool())) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - enc.wf(strconv.FormatInt(rv.Int(), 10)) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - enc.wf(strconv.FormatUint(rv.Uint(), 10)) - case reflect.Float32: - f := rv.Float() - if math.IsNaN(f) { - enc.wf("nan") - } else if math.IsInf(f, 0) { - enc.wf("%cinf", map[bool]byte{true: '-', false: '+'}[math.Signbit(f)]) - } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 32))) - } - case reflect.Float64: - f := rv.Float() - if math.IsNaN(f) { - enc.wf("nan") - } else if math.IsInf(f, 0) { - enc.wf("%cinf", map[bool]byte{true: '-', false: '+'}[math.Signbit(f)]) - } else { - enc.wf(floatAddDecimal(strconv.FormatFloat(f, 'f', -1, 64))) - } - case reflect.Array, reflect.Slice: - enc.eArrayOrSliceElement(rv) - case reflect.Struct: - enc.eStruct(nil, rv, true) - case reflect.Map: - enc.eMap(nil, rv, true) - case reflect.Interface: - enc.eElement(rv.Elem()) - default: - encPanic(fmt.Errorf("unexpected type: %T", rv.Interface())) - } -} - -// By the TOML spec, all floats must have a decimal with at least one number on -// either side. -func floatAddDecimal(fstr string) string { - if !strings.Contains(fstr, ".") { - return fstr + ".0" - } - return fstr -} - -func (enc *Encoder) writeQuoted(s string) { - enc.wf("\"%s\"", dblQuotedReplacer.Replace(s)) -} - -func (enc *Encoder) eArrayOrSliceElement(rv reflect.Value) { - length := rv.Len() - enc.wf("[") - for i := 0; i < length; i++ { - elem := eindirect(rv.Index(i)) - enc.eElement(elem) - if i != length-1 { - enc.wf(", ") - } - } - enc.wf("]") -} - -func (enc *Encoder) eArrayOfTables(key Key, rv reflect.Value) { - if len(key) == 0 { - encPanic(errNoKey) - } - for i := 0; i < rv.Len(); i++ { - trv := eindirect(rv.Index(i)) - if isNil(trv) { - continue - } - enc.newline() - enc.wf("%s[[%s]]", enc.indentStr(key), key) - enc.newline() - enc.eMapOrStruct(key, trv, false) - } -} - -func (enc *Encoder) eTable(key Key, rv reflect.Value) { - if len(key) == 1 { - // Output an extra newline between top-level tables. - // (The newline isn't written if nothing else has been written though.) - enc.newline() - } - if len(key) > 0 { - enc.wf("%s[%s]", enc.indentStr(key), key) - enc.newline() - } - enc.eMapOrStruct(key, rv, false) -} - -func (enc *Encoder) eMapOrStruct(key Key, rv reflect.Value, inline bool) { - switch rv.Kind() { - case reflect.Map: - enc.eMap(key, rv, inline) - case reflect.Struct: - enc.eStruct(key, rv, inline) - default: - // Should never happen? - panic("eTable: unhandled reflect.Value Kind: " + rv.Kind().String()) - } -} - -func (enc *Encoder) eMap(key Key, rv reflect.Value, inline bool) { - rt := rv.Type() - if rt.Key().Kind() != reflect.String { - encPanic(errNonString) - } - - // Sort keys so that we have deterministic output. And write keys directly - // underneath this key first, before writing sub-structs or sub-maps. - var mapKeysDirect, mapKeysSub []string - for _, mapKey := range rv.MapKeys() { - k := mapKey.String() - if typeIsTable(tomlTypeOfGo(eindirect(rv.MapIndex(mapKey)))) { - mapKeysSub = append(mapKeysSub, k) - } else { - mapKeysDirect = append(mapKeysDirect, k) - } - } - - var writeMapKeys = func(mapKeys []string, trailC bool) { - sort.Strings(mapKeys) - for i, mapKey := range mapKeys { - val := eindirect(rv.MapIndex(reflect.ValueOf(mapKey))) - if isNil(val) { - continue - } - - if inline { - enc.writeKeyValue(Key{mapKey}, val, true) - if trailC || i != len(mapKeys)-1 { - enc.wf(", ") - } - } else { - enc.encode(key.add(mapKey), val) - } - } - } - - if inline { - enc.wf("{") - } - writeMapKeys(mapKeysDirect, len(mapKeysSub) > 0) - writeMapKeys(mapKeysSub, false) - if inline { - enc.wf("}") - } -} - -const is32Bit = (32 << (^uint(0) >> 63)) == 32 - -func pointerTo(t reflect.Type) reflect.Type { - if t.Kind() == reflect.Ptr { - return pointerTo(t.Elem()) - } - return t -} - -func (enc *Encoder) eStruct(key Key, rv reflect.Value, inline bool) { - // Write keys for fields directly under this key first, because if we write - // a field that creates a new table then all keys under it will be in that - // table (not the one we're writing here). - // - // Fields is a [][]int: for fieldsDirect this always has one entry (the - // struct index). For fieldsSub it contains two entries: the parent field - // index from tv, and the field indexes for the fields of the sub. - var ( - rt = rv.Type() - fieldsDirect, fieldsSub [][]int - addFields func(rt reflect.Type, rv reflect.Value, start []int) - ) - addFields = func(rt reflect.Type, rv reflect.Value, start []int) { - for i := 0; i < rt.NumField(); i++ { - f := rt.Field(i) - isEmbed := f.Anonymous && pointerTo(f.Type).Kind() == reflect.Struct - if f.PkgPath != "" && !isEmbed { /// Skip unexported fields. - continue - } - opts := getOptions(f.Tag) - if opts.skip { - continue - } - - frv := eindirect(rv.Field(i)) - - if is32Bit { - // Copy so it works correct on 32bit archs; not clear why this - // is needed. See #314, and https://www.reddit.com/r/golang/comments/pnx8v4 - // This also works fine on 64bit, but 32bit archs are somewhat - // rare and this is a wee bit faster. - copyStart := make([]int, len(start)) - copy(copyStart, start) - start = copyStart - } - - // Treat anonymous struct fields with tag names as though they are - // not anonymous, like encoding/json does. - // - // Non-struct anonymous fields use the normal encoding logic. - if isEmbed { - if getOptions(f.Tag).name == "" && frv.Kind() == reflect.Struct { - addFields(frv.Type(), frv, append(start, f.Index...)) - continue - } - } - - if typeIsTable(tomlTypeOfGo(frv)) { - fieldsSub = append(fieldsSub, append(start, f.Index...)) - } else { - fieldsDirect = append(fieldsDirect, append(start, f.Index...)) - } - } - } - addFields(rt, rv, nil) - - writeFields := func(fields [][]int) { - for _, fieldIndex := range fields { - fieldType := rt.FieldByIndex(fieldIndex) - fieldVal := rv.FieldByIndex(fieldIndex) - - opts := getOptions(fieldType.Tag) - if opts.skip { - continue - } - if opts.omitempty && isEmpty(fieldVal) { - continue - } - - fieldVal = eindirect(fieldVal) - - if isNil(fieldVal) { /// Don't write anything for nil fields. - continue - } - - keyName := fieldType.Name - if opts.name != "" { - keyName = opts.name - } - - if opts.omitzero && isZero(fieldVal) { - continue - } - - if inline { - enc.writeKeyValue(Key{keyName}, fieldVal, true) - if fieldIndex[0] != len(fields)-1 { - enc.wf(", ") - } - } else { - enc.encode(key.add(keyName), fieldVal) - } - } - } - - if inline { - enc.wf("{") - } - writeFields(fieldsDirect) - writeFields(fieldsSub) - if inline { - enc.wf("}") - } -} - -// tomlTypeOfGo returns the TOML type name of the Go value's type. -// -// It is used to determine whether the types of array elements are mixed (which -// is forbidden). If the Go value is nil, then it is illegal for it to be an -// array element, and valueIsNil is returned as true. -// -// The type may be `nil`, which means no concrete TOML type could be found. -func tomlTypeOfGo(rv reflect.Value) tomlType { - if isNil(rv) || !rv.IsValid() { - return nil - } - - if rv.Kind() == reflect.Struct { - if rv.Type() == timeType { - return tomlDatetime - } - if isMarshaler(rv) { - return tomlString - } - return tomlHash - } - - if isMarshaler(rv) { - return tomlString - } - - switch rv.Kind() { - case reflect.Bool: - return tomlBool - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, - reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, - reflect.Uint64: - return tomlInteger - case reflect.Float32, reflect.Float64: - return tomlFloat - case reflect.Array, reflect.Slice: - if isTableArray(rv) { - return tomlArrayHash - } - return tomlArray - case reflect.Ptr, reflect.Interface: - return tomlTypeOfGo(rv.Elem()) - case reflect.String: - return tomlString - case reflect.Map: - return tomlHash - default: - encPanic(errors.New("unsupported type: " + rv.Kind().String())) - panic("unreachable") - } -} - -func isMarshaler(rv reflect.Value) bool { - return rv.Type().Implements(marshalText) || rv.Type().Implements(marshalToml) -} - -// isTableArray reports if all entries in the array or slice are a table. -func isTableArray(arr reflect.Value) bool { - if isNil(arr) || !arr.IsValid() || arr.Len() == 0 { - return false - } - - ret := true - for i := 0; i < arr.Len(); i++ { - tt := tomlTypeOfGo(eindirect(arr.Index(i))) - // Don't allow nil. - if tt == nil { - encPanic(errArrayNilElement) - } - - if ret && !typeEqual(tomlHash, tt) { - ret = false - } - } - return ret -} - -type tagOptions struct { - skip bool // "-" - name string - omitempty bool - omitzero bool -} - -func getOptions(tag reflect.StructTag) tagOptions { - t := tag.Get("toml") - if t == "-" { - return tagOptions{skip: true} - } - var opts tagOptions - parts := strings.Split(t, ",") - opts.name = parts[0] - for _, s := range parts[1:] { - switch s { - case "omitempty": - opts.omitempty = true - case "omitzero": - opts.omitzero = true - } - } - return opts -} - -func isZero(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - return rv.Uint() == 0 - case reflect.Float32, reflect.Float64: - return rv.Float() == 0.0 - } - return false -} - -func isEmpty(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return rv.Len() == 0 - case reflect.Struct: - if rv.Type().Comparable() { - return reflect.Zero(rv.Type()).Interface() == rv.Interface() - } - // Need to also check if all the fields are empty, otherwise something - // like this with uncomparable types will always return true: - // - // type a struct{ field b } - // type b struct{ s []string } - // s := a{field: b{s: []string{"AAA"}}} - for i := 0; i < rv.NumField(); i++ { - if !isEmpty(rv.Field(i)) { - return false - } - } - return true - case reflect.Bool: - return !rv.Bool() - case reflect.Ptr: - return rv.IsNil() - } - return false -} - -func (enc *Encoder) newline() { - if enc.hasWritten { - enc.wf("\n") - } -} - -// Write a key/value pair: -// -// key = -// -// This is also used for "k = v" in inline tables; so something like this will -// be written in three calls: -// -// ┌───────────────────┐ -// │ ┌───┐ ┌────┐│ -// v v v v vv -// key = {k = 1, k2 = 2} -func (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) { - /// Marshaler used on top-level document; call eElement() to just call - /// Marshal{TOML,Text}. - if len(key) == 0 { - enc.eElement(val) - return - } - enc.wf("%s%s = ", enc.indentStr(key), key.maybeQuoted(len(key)-1)) - enc.eElement(val) - if !inline { - enc.newline() - } -} - -func (enc *Encoder) wf(format string, v ...interface{}) { - _, err := fmt.Fprintf(enc.w, format, v...) - if err != nil { - encPanic(err) - } - enc.hasWritten = true -} - -func (enc *Encoder) indentStr(key Key) string { - return strings.Repeat(enc.Indent, len(key)-1) -} - -func encPanic(err error) { - panic(tomlEncodeError{err}) -} - -// Resolve any level of pointers to the actual value (e.g. **string → string). -func eindirect(v reflect.Value) reflect.Value { - if v.Kind() != reflect.Ptr && v.Kind() != reflect.Interface { - if isMarshaler(v) { - return v - } - if v.CanAddr() { /// Special case for marshalers; see #358. - if pv := v.Addr(); isMarshaler(pv) { - return pv - } - } - return v - } - - if v.IsNil() { - return v - } - - return eindirect(v.Elem()) -} - -func isNil(rv reflect.Value) bool { - switch rv.Kind() { - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return rv.IsNil() - default: - return false - } -} diff --git a/vendor/github.com/BurntSushi/toml/error.go b/vendor/github.com/BurntSushi/toml/error.go deleted file mode 100644 index efd68865bb..0000000000 --- a/vendor/github.com/BurntSushi/toml/error.go +++ /dev/null @@ -1,279 +0,0 @@ -package toml - -import ( - "fmt" - "strings" -) - -// ParseError is returned when there is an error parsing the TOML syntax such as -// invalid syntax, duplicate keys, etc. -// -// In addition to the error message itself, you can also print detailed location -// information with context by using [ErrorWithPosition]: -// -// toml: error: Key 'fruit' was already created and cannot be used as an array. -// -// At line 4, column 2-7: -// -// 2 | fruit = [] -// 3 | -// 4 | [[fruit]] # Not allowed -// ^^^^^ -// -// [ErrorWithUsage] can be used to print the above with some more detailed usage -// guidance: -// -// toml: error: newlines not allowed within inline tables -// -// At line 1, column 18: -// -// 1 | x = [{ key = 42 # -// ^ -// -// Error help: -// -// Inline tables must always be on a single line: -// -// table = {key = 42, second = 43} -// -// It is invalid to split them over multiple lines like so: -// -// # INVALID -// table = { -// key = 42, -// second = 43 -// } -// -// Use regular for this: -// -// [table] -// key = 42 -// second = 43 -type ParseError struct { - Message string // Short technical message. - Usage string // Longer message with usage guidance; may be blank. - Position Position // Position of the error - LastKey string // Last parsed key, may be blank. - - // Line the error occurred. - // - // Deprecated: use [Position]. - Line int - - err error - input string -} - -// Position of an error. -type Position struct { - Line int // Line number, starting at 1. - Start int // Start of error, as byte offset starting at 0. - Len int // Lenght in bytes. -} - -func (pe ParseError) Error() string { - msg := pe.Message - if msg == "" { // Error from errorf() - msg = pe.err.Error() - } - - if pe.LastKey == "" { - return fmt.Sprintf("toml: line %d: %s", pe.Position.Line, msg) - } - return fmt.Sprintf("toml: line %d (last key %q): %s", - pe.Position.Line, pe.LastKey, msg) -} - -// ErrorWithPosition returns the error with detailed location context. -// -// See the documentation on [ParseError]. -func (pe ParseError) ErrorWithPosition() string { - if pe.input == "" { // Should never happen, but just in case. - return pe.Error() - } - - var ( - lines = strings.Split(pe.input, "\n") - col = pe.column(lines) - b = new(strings.Builder) - ) - - msg := pe.Message - if msg == "" { - msg = pe.err.Error() - } - - // TODO: don't show control characters as literals? This may not show up - // well everywhere. - - if pe.Position.Len == 1 { - fmt.Fprintf(b, "toml: error: %s\n\nAt line %d, column %d:\n\n", - msg, pe.Position.Line, col+1) - } else { - fmt.Fprintf(b, "toml: error: %s\n\nAt line %d, column %d-%d:\n\n", - msg, pe.Position.Line, col, col+pe.Position.Len) - } - if pe.Position.Line > 2 { - fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line-2, lines[pe.Position.Line-3]) - } - if pe.Position.Line > 1 { - fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line-1, lines[pe.Position.Line-2]) - } - fmt.Fprintf(b, "% 7d | %s\n", pe.Position.Line, lines[pe.Position.Line-1]) - fmt.Fprintf(b, "% 10s%s%s\n", "", strings.Repeat(" ", col), strings.Repeat("^", pe.Position.Len)) - return b.String() -} - -// ErrorWithUsage returns the error with detailed location context and usage -// guidance. -// -// See the documentation on [ParseError]. -func (pe ParseError) ErrorWithUsage() string { - m := pe.ErrorWithPosition() - if u, ok := pe.err.(interface{ Usage() string }); ok && u.Usage() != "" { - lines := strings.Split(strings.TrimSpace(u.Usage()), "\n") - for i := range lines { - if lines[i] != "" { - lines[i] = " " + lines[i] - } - } - return m + "Error help:\n\n" + strings.Join(lines, "\n") + "\n" - } - return m -} - -func (pe ParseError) column(lines []string) int { - var pos, col int - for i := range lines { - ll := len(lines[i]) + 1 // +1 for the removed newline - if pos+ll >= pe.Position.Start { - col = pe.Position.Start - pos - if col < 0 { // Should never happen, but just in case. - col = 0 - } - break - } - pos += ll - } - - return col -} - -type ( - errLexControl struct{ r rune } - errLexEscape struct{ r rune } - errLexUTF8 struct{ b byte } - errLexInvalidNum struct{ v string } - errLexInvalidDate struct{ v string } - errLexInlineTableNL struct{} - errLexStringNL struct{} - errParseRange struct { - i interface{} // int or float - size string // "int64", "uint16", etc. - } - errParseDuration struct{ d string } -) - -func (e errLexControl) Error() string { - return fmt.Sprintf("TOML files cannot contain control characters: '0x%02x'", e.r) -} -func (e errLexControl) Usage() string { return "" } - -func (e errLexEscape) Error() string { return fmt.Sprintf(`invalid escape in string '\%c'`, e.r) } -func (e errLexEscape) Usage() string { return usageEscape } -func (e errLexUTF8) Error() string { return fmt.Sprintf("invalid UTF-8 byte: 0x%02x", e.b) } -func (e errLexUTF8) Usage() string { return "" } -func (e errLexInvalidNum) Error() string { return fmt.Sprintf("invalid number: %q", e.v) } -func (e errLexInvalidNum) Usage() string { return "" } -func (e errLexInvalidDate) Error() string { return fmt.Sprintf("invalid date: %q", e.v) } -func (e errLexInvalidDate) Usage() string { return "" } -func (e errLexInlineTableNL) Error() string { return "newlines not allowed within inline tables" } -func (e errLexInlineTableNL) Usage() string { return usageInlineNewline } -func (e errLexStringNL) Error() string { return "strings cannot contain newlines" } -func (e errLexStringNL) Usage() string { return usageStringNewline } -func (e errParseRange) Error() string { return fmt.Sprintf("%v is out of range for %s", e.i, e.size) } -func (e errParseRange) Usage() string { return usageIntOverflow } -func (e errParseDuration) Error() string { return fmt.Sprintf("invalid duration: %q", e.d) } -func (e errParseDuration) Usage() string { return usageDuration } - -const usageEscape = ` -A '\' inside a "-delimited string is interpreted as an escape character. - -The following escape sequences are supported: -\b, \t, \n, \f, \r, \", \\, \uXXXX, and \UXXXXXXXX - -To prevent a '\' from being recognized as an escape character, use either: - -- a ' or '''-delimited string; escape characters aren't processed in them; or -- write two backslashes to get a single backslash: '\\'. - -If you're trying to add a Windows path (e.g. "C:\Users\martin") then using '/' -instead of '\' will usually also work: "C:/Users/martin". -` - -const usageInlineNewline = ` -Inline tables must always be on a single line: - - table = {key = 42, second = 43} - -It is invalid to split them over multiple lines like so: - - # INVALID - table = { - key = 42, - second = 43 - } - -Use regular for this: - - [table] - key = 42 - second = 43 -` - -const usageStringNewline = ` -Strings must always be on a single line, and cannot span more than one line: - - # INVALID - string = "Hello, - world!" - -Instead use """ or ''' to split strings over multiple lines: - - string = """Hello, - world!""" -` - -const usageIntOverflow = ` -This number is too large; this may be an error in the TOML, but it can also be a -bug in the program that uses too small of an integer. - -The maximum and minimum values are: - - size │ lowest │ highest - ───────┼────────────────┼────────── - int8 │ -128 │ 127 - int16 │ -32,768 │ 32,767 - int32 │ -2,147,483,648 │ 2,147,483,647 - int64 │ -9.2 × 10¹⁷ │ 9.2 × 10¹⁷ - uint8 │ 0 │ 255 - uint16 │ 0 │ 65535 - uint32 │ 0 │ 4294967295 - uint64 │ 0 │ 1.8 × 10¹⁸ - -int refers to int32 on 32-bit systems and int64 on 64-bit systems. -` - -const usageDuration = ` -A duration must be as "number", without any spaces. Valid units are: - - ns nanoseconds (billionth of a second) - us, µs microseconds (millionth of a second) - ms milliseconds (thousands of a second) - s seconds - m minutes - h hours - -You can combine multiple units; for example "5m10s" for 5 minutes and 10 -seconds. -` diff --git a/vendor/github.com/BurntSushi/toml/internal/tz.go b/vendor/github.com/BurntSushi/toml/internal/tz.go deleted file mode 100644 index 022f15bc2b..0000000000 --- a/vendor/github.com/BurntSushi/toml/internal/tz.go +++ /dev/null @@ -1,36 +0,0 @@ -package internal - -import "time" - -// Timezones used for local datetime, date, and time TOML types. -// -// The exact way times and dates without a timezone should be interpreted is not -// well-defined in the TOML specification and left to the implementation. These -// defaults to current local timezone offset of the computer, but this can be -// changed by changing these variables before decoding. -// -// TODO: -// Ideally we'd like to offer people the ability to configure the used timezone -// by setting Decoder.Timezone and Encoder.Timezone; however, this is a bit -// tricky: the reason we use three different variables for this is to support -// round-tripping – without these specific TZ names we wouldn't know which -// format to use. -// -// There isn't a good way to encode this right now though, and passing this sort -// of information also ties in to various related issues such as string format -// encoding, encoding of comments, etc. -// -// So, for the time being, just put this in internal until we can write a good -// comprehensive API for doing all of this. -// -// The reason they're exported is because they're referred from in e.g. -// internal/tag. -// -// Note that this behaviour is valid according to the TOML spec as the exact -// behaviour is left up to implementations. -var ( - localOffset = func() int { _, o := time.Now().Zone(); return o }() - LocalDatetime = time.FixedZone("datetime-local", localOffset) - LocalDate = time.FixedZone("date-local", localOffset) - LocalTime = time.FixedZone("time-local", localOffset) -) diff --git a/vendor/github.com/BurntSushi/toml/lex.go b/vendor/github.com/BurntSushi/toml/lex.go deleted file mode 100644 index 3545a6ad66..0000000000 --- a/vendor/github.com/BurntSushi/toml/lex.go +++ /dev/null @@ -1,1283 +0,0 @@ -package toml - -import ( - "fmt" - "reflect" - "runtime" - "strings" - "unicode" - "unicode/utf8" -) - -type itemType int - -const ( - itemError itemType = iota - itemNIL // used in the parser to indicate no type - itemEOF - itemText - itemString - itemRawString - itemMultilineString - itemRawMultilineString - itemBool - itemInteger - itemFloat - itemDatetime - itemArray // the start of an array - itemArrayEnd - itemTableStart - itemTableEnd - itemArrayTableStart - itemArrayTableEnd - itemKeyStart - itemKeyEnd - itemCommentStart - itemInlineTableStart - itemInlineTableEnd -) - -const eof = 0 - -type stateFn func(lx *lexer) stateFn - -func (p Position) String() string { - return fmt.Sprintf("at line %d; start %d; length %d", p.Line, p.Start, p.Len) -} - -type lexer struct { - input string - start int - pos int - line int - state stateFn - items chan item - tomlNext bool - - // Allow for backing up up to 4 runes. This is necessary because TOML - // contains 3-rune tokens (""" and '''). - prevWidths [4]int - nprev int // how many of prevWidths are in use - atEOF bool // If we emit an eof, we can still back up, but it is not OK to call next again. - - // A stack of state functions used to maintain context. - // - // The idea is to reuse parts of the state machine in various places. For - // example, values can appear at the top level or within arbitrarily nested - // arrays. The last state on the stack is used after a value has been lexed. - // Similarly for comments. - stack []stateFn -} - -type item struct { - typ itemType - val string - err error - pos Position -} - -func (lx *lexer) nextItem() item { - for { - select { - case item := <-lx.items: - return item - default: - lx.state = lx.state(lx) - //fmt.Printf(" STATE %-24s current: %-10s stack: %s\n", lx.state, lx.current(), lx.stack) - } - } -} - -func lex(input string, tomlNext bool) *lexer { - lx := &lexer{ - input: input, - state: lexTop, - items: make(chan item, 10), - stack: make([]stateFn, 0, 10), - line: 1, - tomlNext: tomlNext, - } - return lx -} - -func (lx *lexer) push(state stateFn) { - lx.stack = append(lx.stack, state) -} - -func (lx *lexer) pop() stateFn { - if len(lx.stack) == 0 { - return lx.errorf("BUG in lexer: no states to pop") - } - last := lx.stack[len(lx.stack)-1] - lx.stack = lx.stack[0 : len(lx.stack)-1] - return last -} - -func (lx *lexer) current() string { - return lx.input[lx.start:lx.pos] -} - -func (lx lexer) getPos() Position { - p := Position{ - Line: lx.line, - Start: lx.start, - Len: lx.pos - lx.start, - } - if p.Len <= 0 { - p.Len = 1 - } - return p -} - -func (lx *lexer) emit(typ itemType) { - // Needed for multiline strings ending with an incomplete UTF-8 sequence. - if lx.start > lx.pos { - lx.error(errLexUTF8{lx.input[lx.pos]}) - return - } - lx.items <- item{typ: typ, pos: lx.getPos(), val: lx.current()} - lx.start = lx.pos -} - -func (lx *lexer) emitTrim(typ itemType) { - lx.items <- item{typ: typ, pos: lx.getPos(), val: strings.TrimSpace(lx.current())} - lx.start = lx.pos -} - -func (lx *lexer) next() (r rune) { - if lx.atEOF { - panic("BUG in lexer: next called after EOF") - } - if lx.pos >= len(lx.input) { - lx.atEOF = true - return eof - } - - if lx.input[lx.pos] == '\n' { - lx.line++ - } - lx.prevWidths[3] = lx.prevWidths[2] - lx.prevWidths[2] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[0] - if lx.nprev < 4 { - lx.nprev++ - } - - r, w := utf8.DecodeRuneInString(lx.input[lx.pos:]) - if r == utf8.RuneError { - lx.error(errLexUTF8{lx.input[lx.pos]}) - return utf8.RuneError - } - - // Note: don't use peek() here, as this calls next(). - if isControl(r) || (r == '\r' && (len(lx.input)-1 == lx.pos || lx.input[lx.pos+1] != '\n')) { - lx.errorControlChar(r) - return utf8.RuneError - } - - lx.prevWidths[0] = w - lx.pos += w - return r -} - -// ignore skips over the pending input before this point. -func (lx *lexer) ignore() { - lx.start = lx.pos -} - -// backup steps back one rune. Can be called 4 times between calls to next. -func (lx *lexer) backup() { - if lx.atEOF { - lx.atEOF = false - return - } - if lx.nprev < 1 { - panic("BUG in lexer: backed up too far") - } - w := lx.prevWidths[0] - lx.prevWidths[0] = lx.prevWidths[1] - lx.prevWidths[1] = lx.prevWidths[2] - lx.prevWidths[2] = lx.prevWidths[3] - lx.nprev-- - - lx.pos -= w - if lx.pos < len(lx.input) && lx.input[lx.pos] == '\n' { - lx.line-- - } -} - -// accept consumes the next rune if it's equal to `valid`. -func (lx *lexer) accept(valid rune) bool { - if lx.next() == valid { - return true - } - lx.backup() - return false -} - -// peek returns but does not consume the next rune in the input. -func (lx *lexer) peek() rune { - r := lx.next() - lx.backup() - return r -} - -// skip ignores all input that matches the given predicate. -func (lx *lexer) skip(pred func(rune) bool) { - for { - r := lx.next() - if pred(r) { - continue - } - lx.backup() - lx.ignore() - return - } -} - -// error stops all lexing by emitting an error and returning `nil`. -// -// Note that any value that is a character is escaped if it's a special -// character (newlines, tabs, etc.). -func (lx *lexer) error(err error) stateFn { - if lx.atEOF { - return lx.errorPrevLine(err) - } - lx.items <- item{typ: itemError, pos: lx.getPos(), err: err} - return nil -} - -// errorfPrevline is like error(), but sets the position to the last column of -// the previous line. -// -// This is so that unexpected EOF or NL errors don't show on a new blank line. -func (lx *lexer) errorPrevLine(err error) stateFn { - pos := lx.getPos() - pos.Line-- - pos.Len = 1 - pos.Start = lx.pos - 1 - lx.items <- item{typ: itemError, pos: pos, err: err} - return nil -} - -// errorPos is like error(), but allows explicitly setting the position. -func (lx *lexer) errorPos(start, length int, err error) stateFn { - pos := lx.getPos() - pos.Start = start - pos.Len = length - lx.items <- item{typ: itemError, pos: pos, err: err} - return nil -} - -// errorf is like error, and creates a new error. -func (lx *lexer) errorf(format string, values ...interface{}) stateFn { - if lx.atEOF { - pos := lx.getPos() - pos.Line-- - pos.Len = 1 - pos.Start = lx.pos - 1 - lx.items <- item{typ: itemError, pos: pos, err: fmt.Errorf(format, values...)} - return nil - } - lx.items <- item{typ: itemError, pos: lx.getPos(), err: fmt.Errorf(format, values...)} - return nil -} - -func (lx *lexer) errorControlChar(cc rune) stateFn { - return lx.errorPos(lx.pos-1, 1, errLexControl{cc}) -} - -// lexTop consumes elements at the top level of TOML data. -func lexTop(lx *lexer) stateFn { - r := lx.next() - if isWhitespace(r) || isNL(r) { - return lexSkip(lx, lexTop) - } - switch r { - case '#': - lx.push(lexTop) - return lexCommentStart - case '[': - return lexTableStart - case eof: - if lx.pos > lx.start { - return lx.errorf("unexpected EOF") - } - lx.emit(itemEOF) - return nil - } - - // At this point, the only valid item can be a key, so we back up - // and let the key lexer do the rest. - lx.backup() - lx.push(lexTopEnd) - return lexKeyStart -} - -// lexTopEnd is entered whenever a top-level item has been consumed. (A value -// or a table.) It must see only whitespace, and will turn back to lexTop -// upon a newline. If it sees EOF, it will quit the lexer successfully. -func lexTopEnd(lx *lexer) stateFn { - r := lx.next() - switch { - case r == '#': - // a comment will read to a newline for us. - lx.push(lexTop) - return lexCommentStart - case isWhitespace(r): - return lexTopEnd - case isNL(r): - lx.ignore() - return lexTop - case r == eof: - lx.emit(itemEOF) - return nil - } - return lx.errorf( - "expected a top-level item to end with a newline, comment, or EOF, but got %q instead", - r) -} - -// lexTable lexes the beginning of a table. Namely, it makes sure that -// it starts with a character other than '.' and ']'. -// It assumes that '[' has already been consumed. -// It also handles the case that this is an item in an array of tables. -// e.g., '[[name]]'. -func lexTableStart(lx *lexer) stateFn { - if lx.peek() == '[' { - lx.next() - lx.emit(itemArrayTableStart) - lx.push(lexArrayTableEnd) - } else { - lx.emit(itemTableStart) - lx.push(lexTableEnd) - } - return lexTableNameStart -} - -func lexTableEnd(lx *lexer) stateFn { - lx.emit(itemTableEnd) - return lexTopEnd -} - -func lexArrayTableEnd(lx *lexer) stateFn { - if r := lx.next(); r != ']' { - return lx.errorf("expected end of table array name delimiter ']', but got %q instead", r) - } - lx.emit(itemArrayTableEnd) - return lexTopEnd -} - -func lexTableNameStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == ']' || r == eof: - return lx.errorf("unexpected end of table name (table names cannot be empty)") - case r == '.': - return lx.errorf("unexpected table separator (table names cannot be empty)") - case r == '"' || r == '\'': - lx.ignore() - lx.push(lexTableNameEnd) - return lexQuotedName - default: - lx.push(lexTableNameEnd) - return lexBareName - } -} - -// lexTableNameEnd reads the end of a piece of a table name, optionally -// consuming whitespace. -func lexTableNameEnd(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.next(); { - case isWhitespace(r): - return lexTableNameEnd - case r == '.': - lx.ignore() - return lexTableNameStart - case r == ']': - return lx.pop() - default: - return lx.errorf("expected '.' or ']' to end table name, but got %q instead", r) - } -} - -// lexBareName lexes one part of a key or table. -// -// It assumes that at least one valid character for the table has already been -// read. -// -// Lexes only one part, e.g. only 'a' inside 'a.b'. -func lexBareName(lx *lexer) stateFn { - r := lx.next() - if isBareKeyChar(r, lx.tomlNext) { - return lexBareName - } - lx.backup() - lx.emit(itemText) - return lx.pop() -} - -// lexBareName lexes one part of a key or table. -// -// It assumes that at least one valid character for the table has already been -// read. -// -// Lexes only one part, e.g. only '"a"' inside '"a".b'. -func lexQuotedName(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) - case r == '"': - lx.ignore() // ignore the '"' - return lexString - case r == '\'': - lx.ignore() // ignore the "'" - return lexRawString - case r == eof: - return lx.errorf("unexpected EOF; expected value") - default: - return lx.errorf("expected value but found %q instead", r) - } -} - -// lexKeyStart consumes all key parts until a '='. -func lexKeyStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == '=' || r == eof: - return lx.errorf("unexpected '=': key name appears blank") - case r == '.': - return lx.errorf("unexpected '.': keys cannot start with a '.'") - case r == '"' || r == '\'': - lx.ignore() - fallthrough - default: // Bare key - lx.emit(itemKeyStart) - return lexKeyNameStart - } -} - -func lexKeyNameStart(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.peek(); { - case r == '=' || r == eof: - return lx.errorf("unexpected '='") - case r == '.': - return lx.errorf("unexpected '.'") - case r == '"' || r == '\'': - lx.ignore() - lx.push(lexKeyEnd) - return lexQuotedName - default: - lx.push(lexKeyEnd) - return lexBareName - } -} - -// lexKeyEnd consumes the end of a key and trims whitespace (up to the key -// separator). -func lexKeyEnd(lx *lexer) stateFn { - lx.skip(isWhitespace) - switch r := lx.next(); { - case isWhitespace(r): - return lexSkip(lx, lexKeyEnd) - case r == eof: - return lx.errorf("unexpected EOF; expected key separator '='") - case r == '.': - lx.ignore() - return lexKeyNameStart - case r == '=': - lx.emit(itemKeyEnd) - return lexSkip(lx, lexValue) - default: - return lx.errorf("expected '.' or '=', but got %q instead", r) - } -} - -// lexValue starts the consumption of a value anywhere a value is expected. -// lexValue will ignore whitespace. -// After a value is lexed, the last state on the next is popped and returned. -func lexValue(lx *lexer) stateFn { - // We allow whitespace to precede a value, but NOT newlines. - // In array syntax, the array states are responsible for ignoring newlines. - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexValue) - case isDigit(r): - lx.backup() // avoid an extra state and use the same as above - return lexNumberOrDateStart - } - switch r { - case '[': - lx.ignore() - lx.emit(itemArray) - return lexArrayValue - case '{': - lx.ignore() - lx.emit(itemInlineTableStart) - return lexInlineTableValue - case '"': - if lx.accept('"') { - if lx.accept('"') { - lx.ignore() // Ignore """ - return lexMultilineString - } - lx.backup() - } - lx.ignore() // ignore the '"' - return lexString - case '\'': - if lx.accept('\'') { - if lx.accept('\'') { - lx.ignore() // Ignore """ - return lexMultilineRawString - } - lx.backup() - } - lx.ignore() // ignore the "'" - return lexRawString - case '.': // special error case, be kind to users - return lx.errorf("floats must start with a digit, not '.'") - case 'i', 'n': - if (lx.accept('n') && lx.accept('f')) || (lx.accept('a') && lx.accept('n')) { - lx.emit(itemFloat) - return lx.pop() - } - case '-', '+': - return lexDecimalNumberStart - } - if unicode.IsLetter(r) { - // Be permissive here; lexBool will give a nice error if the - // user wrote something like - // x = foo - // (i.e. not 'true' or 'false' but is something else word-like.) - lx.backup() - return lexBool - } - if r == eof { - return lx.errorf("unexpected EOF; expected value") - } - return lx.errorf("expected value but found %q instead", r) -} - -// lexArrayValue consumes one value in an array. It assumes that '[' or ',' -// have already been consumed. All whitespace and newlines are ignored. -func lexArrayValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValue) - case r == '#': - lx.push(lexArrayValue) - return lexCommentStart - case r == ',': - return lx.errorf("unexpected comma") - case r == ']': - return lexArrayEnd - } - - lx.backup() - lx.push(lexArrayValueEnd) - return lexValue -} - -// lexArrayValueEnd consumes everything between the end of an array value and -// the next value (or the end of the array): it ignores whitespace and newlines -// and expects either a ',' or a ']'. -func lexArrayValueEnd(lx *lexer) stateFn { - switch r := lx.next(); { - case isWhitespace(r) || isNL(r): - return lexSkip(lx, lexArrayValueEnd) - case r == '#': - lx.push(lexArrayValueEnd) - return lexCommentStart - case r == ',': - lx.ignore() - return lexArrayValue // move on to the next value - case r == ']': - return lexArrayEnd - default: - return lx.errorf("expected a comma (',') or array terminator (']'), but got %s", runeOrEOF(r)) - } -} - -// lexArrayEnd finishes the lexing of an array. -// It assumes that a ']' has just been consumed. -func lexArrayEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemArrayEnd) - return lx.pop() -} - -// lexInlineTableValue consumes one key/value pair in an inline table. -// It assumes that '{' or ',' have already been consumed. Whitespace is ignored. -func lexInlineTableValue(lx *lexer) stateFn { - r := lx.next() - switch { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValue) - case isNL(r): - if lx.tomlNext { - return lexSkip(lx, lexInlineTableValue) - } - return lx.errorPrevLine(errLexInlineTableNL{}) - case r == '#': - lx.push(lexInlineTableValue) - return lexCommentStart - case r == ',': - return lx.errorf("unexpected comma") - case r == '}': - return lexInlineTableEnd - } - lx.backup() - lx.push(lexInlineTableValueEnd) - return lexKeyStart -} - -// lexInlineTableValueEnd consumes everything between the end of an inline table -// key/value pair and the next pair (or the end of the table): -// it ignores whitespace and expects either a ',' or a '}'. -func lexInlineTableValueEnd(lx *lexer) stateFn { - switch r := lx.next(); { - case isWhitespace(r): - return lexSkip(lx, lexInlineTableValueEnd) - case isNL(r): - if lx.tomlNext { - return lexSkip(lx, lexInlineTableValueEnd) - } - return lx.errorPrevLine(errLexInlineTableNL{}) - case r == '#': - lx.push(lexInlineTableValueEnd) - return lexCommentStart - case r == ',': - lx.ignore() - lx.skip(isWhitespace) - if lx.peek() == '}' { - if lx.tomlNext { - return lexInlineTableValueEnd - } - return lx.errorf("trailing comma not allowed in inline tables") - } - return lexInlineTableValue - case r == '}': - return lexInlineTableEnd - default: - return lx.errorf("expected a comma or an inline table terminator '}', but got %s instead", runeOrEOF(r)) - } -} - -func runeOrEOF(r rune) string { - if r == eof { - return "end of file" - } - return "'" + string(r) + "'" -} - -// lexInlineTableEnd finishes the lexing of an inline table. -// It assumes that a '}' has just been consumed. -func lexInlineTableEnd(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemInlineTableEnd) - return lx.pop() -} - -// lexString consumes the inner contents of a string. It assumes that the -// beginning '"' has already been consumed and ignored. -func lexString(lx *lexer) stateFn { - r := lx.next() - switch { - case r == eof: - return lx.errorf(`unexpected EOF; expected '"'`) - case isNL(r): - return lx.errorPrevLine(errLexStringNL{}) - case r == '\\': - lx.push(lexString) - return lexStringEscape - case r == '"': - lx.backup() - lx.emit(itemString) - lx.next() - lx.ignore() - return lx.pop() - } - return lexString -} - -// lexMultilineString consumes the inner contents of a string. It assumes that -// the beginning '"""' has already been consumed and ignored. -func lexMultilineString(lx *lexer) stateFn { - r := lx.next() - switch r { - default: - return lexMultilineString - case eof: - return lx.errorf(`unexpected EOF; expected '"""'`) - case '\\': - return lexMultilineStringEscape - case '"': - /// Found " → try to read two more "". - if lx.accept('"') { - if lx.accept('"') { - /// Peek ahead: the string can contain " and "", including at the - /// end: """str""""" - /// 6 or more at the end, however, is an error. - if lx.peek() == '"' { - /// Check if we already lexed 5 's; if so we have 6 now, and - /// that's just too many man! - /// - /// Second check is for the edge case: - /// - /// two quotes allowed. - /// vv - /// """lol \"""""" - /// ^^ ^^^---- closing three - /// escaped - /// - /// But ugly, but it works - if strings.HasSuffix(lx.current(), `"""""`) && !strings.HasSuffix(lx.current(), `\"""""`) { - return lx.errorf(`unexpected '""""""'`) - } - lx.backup() - lx.backup() - return lexMultilineString - } - - lx.backup() /// backup: don't include the """ in the item. - lx.backup() - lx.backup() - lx.emit(itemMultilineString) - lx.next() /// Read over ''' again and discard it. - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - return lexMultilineString - } -} - -// lexRawString consumes a raw string. Nothing can be escaped in such a string. -// It assumes that the beginning "'" has already been consumed and ignored. -func lexRawString(lx *lexer) stateFn { - r := lx.next() - switch { - default: - return lexRawString - case r == eof: - return lx.errorf(`unexpected EOF; expected "'"`) - case isNL(r): - return lx.errorPrevLine(errLexStringNL{}) - case r == '\'': - lx.backup() - lx.emit(itemRawString) - lx.next() - lx.ignore() - return lx.pop() - } -} - -// lexMultilineRawString consumes a raw string. Nothing can be escaped in such a -// string. It assumes that the beginning triple-' has already been consumed and -// ignored. -func lexMultilineRawString(lx *lexer) stateFn { - r := lx.next() - switch r { - default: - return lexMultilineRawString - case eof: - return lx.errorf(`unexpected EOF; expected "'''"`) - case '\'': - /// Found ' → try to read two more ''. - if lx.accept('\'') { - if lx.accept('\'') { - /// Peek ahead: the string can contain ' and '', including at the - /// end: '''str''''' - /// 6 or more at the end, however, is an error. - if lx.peek() == '\'' { - /// Check if we already lexed 5 's; if so we have 6 now, and - /// that's just too many man! - if strings.HasSuffix(lx.current(), "'''''") { - return lx.errorf(`unexpected "''''''"`) - } - lx.backup() - lx.backup() - return lexMultilineRawString - } - - lx.backup() /// backup: don't include the ''' in the item. - lx.backup() - lx.backup() - lx.emit(itemRawMultilineString) - lx.next() /// Read over ''' again and discard it. - lx.next() - lx.next() - lx.ignore() - return lx.pop() - } - lx.backup() - } - return lexMultilineRawString - } -} - -// lexMultilineStringEscape consumes an escaped character. It assumes that the -// preceding '\\' has already been consumed. -func lexMultilineStringEscape(lx *lexer) stateFn { - if isNL(lx.next()) { /// \ escaping newline. - return lexMultilineString - } - lx.backup() - lx.push(lexMultilineString) - return lexStringEscape(lx) -} - -func lexStringEscape(lx *lexer) stateFn { - r := lx.next() - switch r { - case 'e': - if !lx.tomlNext { - return lx.error(errLexEscape{r}) - } - fallthrough - case 'b': - fallthrough - case 't': - fallthrough - case 'n': - fallthrough - case 'f': - fallthrough - case 'r': - fallthrough - case '"': - fallthrough - case ' ', '\t': - // Inside """ .. """ strings you can use \ to escape newlines, and any - // amount of whitespace can be between the \ and \n. - fallthrough - case '\\': - return lx.pop() - case 'x': - if !lx.tomlNext { - return lx.error(errLexEscape{r}) - } - return lexHexEscape - case 'u': - return lexShortUnicodeEscape - case 'U': - return lexLongUnicodeEscape - } - return lx.error(errLexEscape{r}) -} - -func lexHexEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 2; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf( - `expected two hexadecimal digits after '\x', but got %q instead`, - lx.current()) - } - } - return lx.pop() -} - -func lexShortUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 4; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf( - `expected four hexadecimal digits after '\u', but got %q instead`, - lx.current()) - } - } - return lx.pop() -} - -func lexLongUnicodeEscape(lx *lexer) stateFn { - var r rune - for i := 0; i < 8; i++ { - r = lx.next() - if !isHexadecimal(r) { - return lx.errorf( - `expected eight hexadecimal digits after '\U', but got %q instead`, - lx.current()) - } - } - return lx.pop() -} - -// lexNumberOrDateStart processes the first character of a value which begins -// with a digit. It exists to catch values starting with '0', so that -// lexBaseNumberOrDate can differentiate base prefixed integers from other -// types. -func lexNumberOrDateStart(lx *lexer) stateFn { - r := lx.next() - switch r { - case '0': - return lexBaseNumberOrDate - } - - if !isDigit(r) { - // The only way to reach this state is if the value starts - // with a digit, so specifically treat anything else as an - // error. - return lx.errorf("expected a digit but got %q", r) - } - - return lexNumberOrDate -} - -// lexNumberOrDate consumes either an integer, float or datetime. -func lexNumberOrDate(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '-', ':': - return lexDatetime - case '_': - return lexDecimalNumber - case '.', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDatetime consumes a Datetime, to a first approximation. -// The parser validates that it matches one of the accepted formats. -func lexDatetime(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexDatetime - } - switch r { - case '-', ':', 'T', 't', ' ', '.', 'Z', 'z', '+': - return lexDatetime - } - - lx.backup() - lx.emitTrim(itemDatetime) - return lx.pop() -} - -// lexHexInteger consumes a hexadecimal integer after seeing the '0x' prefix. -func lexHexInteger(lx *lexer) stateFn { - r := lx.next() - if isHexadecimal(r) { - return lexHexInteger - } - switch r { - case '_': - return lexHexInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexOctalInteger consumes an octal integer after seeing the '0o' prefix. -func lexOctalInteger(lx *lexer) stateFn { - r := lx.next() - if isOctal(r) { - return lexOctalInteger - } - switch r { - case '_': - return lexOctalInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexBinaryInteger consumes a binary integer after seeing the '0b' prefix. -func lexBinaryInteger(lx *lexer) stateFn { - r := lx.next() - if isBinary(r) { - return lexBinaryInteger - } - switch r { - case '_': - return lexBinaryInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDecimalNumber consumes a decimal float or integer. -func lexDecimalNumber(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexDecimalNumber - } - switch r { - case '.', 'e', 'E': - return lexFloat - case '_': - return lexDecimalNumber - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexDecimalNumber consumes the first digit of a number beginning with a sign. -// It assumes the sign has already been consumed. Values which start with a sign -// are only allowed to be decimal integers or floats. -// -// The special "nan" and "inf" values are also recognized. -func lexDecimalNumberStart(lx *lexer) stateFn { - r := lx.next() - - // Special error cases to give users better error messages - switch r { - case 'i': - if !lx.accept('n') || !lx.accept('f') { - return lx.errorf("invalid float: '%s'", lx.current()) - } - lx.emit(itemFloat) - return lx.pop() - case 'n': - if !lx.accept('a') || !lx.accept('n') { - return lx.errorf("invalid float: '%s'", lx.current()) - } - lx.emit(itemFloat) - return lx.pop() - case '0': - p := lx.peek() - switch p { - case 'b', 'o', 'x': - return lx.errorf("cannot use sign with non-decimal numbers: '%s%c'", lx.current(), p) - } - case '.': - return lx.errorf("floats must start with a digit, not '.'") - } - - if isDigit(r) { - return lexDecimalNumber - } - - return lx.errorf("expected a digit but got %q", r) -} - -// lexBaseNumberOrDate differentiates between the possible values which -// start with '0'. It assumes that before reaching this state, the initial '0' -// has been consumed. -func lexBaseNumberOrDate(lx *lexer) stateFn { - r := lx.next() - // Note: All datetimes start with at least two digits, so we don't - // handle date characters (':', '-', etc.) here. - if isDigit(r) { - return lexNumberOrDate - } - switch r { - case '_': - // Can only be decimal, because there can't be an underscore - // between the '0' and the base designator, and dates can't - // contain underscores. - return lexDecimalNumber - case '.', 'e', 'E': - return lexFloat - case 'b': - r = lx.peek() - if !isBinary(r) { - lx.errorf("not a binary number: '%s%c'", lx.current(), r) - } - return lexBinaryInteger - case 'o': - r = lx.peek() - if !isOctal(r) { - lx.errorf("not an octal number: '%s%c'", lx.current(), r) - } - return lexOctalInteger - case 'x': - r = lx.peek() - if !isHexadecimal(r) { - lx.errorf("not a hexidecimal number: '%s%c'", lx.current(), r) - } - return lexHexInteger - } - - lx.backup() - lx.emit(itemInteger) - return lx.pop() -} - -// lexFloat consumes the elements of a float. It allows any sequence of -// float-like characters, so floats emitted by the lexer are only a first -// approximation and must be validated by the parser. -func lexFloat(lx *lexer) stateFn { - r := lx.next() - if isDigit(r) { - return lexFloat - } - switch r { - case '_', '.', '-', '+', 'e', 'E': - return lexFloat - } - - lx.backup() - lx.emit(itemFloat) - return lx.pop() -} - -// lexBool consumes a bool string: 'true' or 'false. -func lexBool(lx *lexer) stateFn { - var rs []rune - for { - r := lx.next() - if !unicode.IsLetter(r) { - lx.backup() - break - } - rs = append(rs, r) - } - s := string(rs) - switch s { - case "true", "false": - lx.emit(itemBool) - return lx.pop() - } - return lx.errorf("expected value but found %q instead", s) -} - -// lexCommentStart begins the lexing of a comment. It will emit -// itemCommentStart and consume no characters, passing control to lexComment. -func lexCommentStart(lx *lexer) stateFn { - lx.ignore() - lx.emit(itemCommentStart) - return lexComment -} - -// lexComment lexes an entire comment. It assumes that '#' has been consumed. -// It will consume *up to* the first newline character, and pass control -// back to the last state on the stack. -func lexComment(lx *lexer) stateFn { - switch r := lx.next(); { - case isNL(r) || r == eof: - lx.backup() - lx.emit(itemText) - return lx.pop() - default: - return lexComment - } -} - -// lexSkip ignores all slurped input and moves on to the next state. -func lexSkip(lx *lexer, nextState stateFn) stateFn { - lx.ignore() - return nextState -} - -func (s stateFn) String() string { - name := runtime.FuncForPC(reflect.ValueOf(s).Pointer()).Name() - if i := strings.LastIndexByte(name, '.'); i > -1 { - name = name[i+1:] - } - if s == nil { - name = "" - } - return name + "()" -} - -func (itype itemType) String() string { - switch itype { - case itemError: - return "Error" - case itemNIL: - return "NIL" - case itemEOF: - return "EOF" - case itemText: - return "Text" - case itemString, itemRawString, itemMultilineString, itemRawMultilineString: - return "String" - case itemBool: - return "Bool" - case itemInteger: - return "Integer" - case itemFloat: - return "Float" - case itemDatetime: - return "DateTime" - case itemTableStart: - return "TableStart" - case itemTableEnd: - return "TableEnd" - case itemKeyStart: - return "KeyStart" - case itemKeyEnd: - return "KeyEnd" - case itemArray: - return "Array" - case itemArrayEnd: - return "ArrayEnd" - case itemCommentStart: - return "CommentStart" - case itemInlineTableStart: - return "InlineTableStart" - case itemInlineTableEnd: - return "InlineTableEnd" - } - panic(fmt.Sprintf("BUG: Unknown type '%d'.", int(itype))) -} - -func (item item) String() string { - return fmt.Sprintf("(%s, %s)", item.typ.String(), item.val) -} - -func isWhitespace(r rune) bool { return r == '\t' || r == ' ' } -func isNL(r rune) bool { return r == '\n' || r == '\r' } -func isControl(r rune) bool { // Control characters except \t, \r, \n - switch r { - case '\t', '\r', '\n': - return false - default: - return (r >= 0x00 && r <= 0x1f) || r == 0x7f - } -} -func isDigit(r rune) bool { return r >= '0' && r <= '9' } -func isBinary(r rune) bool { return r == '0' || r == '1' } -func isOctal(r rune) bool { return r >= '0' && r <= '7' } -func isHexadecimal(r rune) bool { - return (r >= '0' && r <= '9') || (r >= 'a' && r <= 'f') || (r >= 'A' && r <= 'F') -} - -func isBareKeyChar(r rune, tomlNext bool) bool { - if tomlNext { - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || r == '-' || - r == 0xb2 || r == 0xb3 || r == 0xb9 || (r >= 0xbc && r <= 0xbe) || - (r >= 0xc0 && r <= 0xd6) || (r >= 0xd8 && r <= 0xf6) || (r >= 0xf8 && r <= 0x037d) || - (r >= 0x037f && r <= 0x1fff) || - (r >= 0x200c && r <= 0x200d) || (r >= 0x203f && r <= 0x2040) || - (r >= 0x2070 && r <= 0x218f) || (r >= 0x2460 && r <= 0x24ff) || - (r >= 0x2c00 && r <= 0x2fef) || (r >= 0x3001 && r <= 0xd7ff) || - (r >= 0xf900 && r <= 0xfdcf) || (r >= 0xfdf0 && r <= 0xfffd) || - (r >= 0x10000 && r <= 0xeffff) - } - - return (r >= 'A' && r <= 'Z') || - (r >= 'a' && r <= 'z') || - (r >= '0' && r <= '9') || - r == '_' || r == '-' -} diff --git a/vendor/github.com/BurntSushi/toml/meta.go b/vendor/github.com/BurntSushi/toml/meta.go deleted file mode 100644 index 2e78b24e95..0000000000 --- a/vendor/github.com/BurntSushi/toml/meta.go +++ /dev/null @@ -1,121 +0,0 @@ -package toml - -import ( - "strings" -) - -// MetaData allows access to meta information about TOML data that's not -// accessible otherwise. -// -// It allows checking if a key is defined in the TOML data, whether any keys -// were undecoded, and the TOML type of a key. -type MetaData struct { - context Key // Used only during decoding. - - keyInfo map[string]keyInfo - mapping map[string]interface{} - keys []Key - decoded map[string]struct{} - data []byte // Input file; for errors. -} - -// IsDefined reports if the key exists in the TOML data. -// -// The key should be specified hierarchically, for example to access the TOML -// key "a.b.c" you would use IsDefined("a", "b", "c"). Keys are case sensitive. -// -// Returns false for an empty key. -func (md *MetaData) IsDefined(key ...string) bool { - if len(key) == 0 { - return false - } - - var ( - hash map[string]interface{} - ok bool - hashOrVal interface{} = md.mapping - ) - for _, k := range key { - if hash, ok = hashOrVal.(map[string]interface{}); !ok { - return false - } - if hashOrVal, ok = hash[k]; !ok { - return false - } - } - return true -} - -// Type returns a string representation of the type of the key specified. -// -// Type will return the empty string if given an empty key or a key that does -// not exist. Keys are case sensitive. -func (md *MetaData) Type(key ...string) string { - if ki, ok := md.keyInfo[Key(key).String()]; ok { - return ki.tomlType.typeString() - } - return "" -} - -// Keys returns a slice of every key in the TOML data, including key groups. -// -// Each key is itself a slice, where the first element is the top of the -// hierarchy and the last is the most specific. The list will have the same -// order as the keys appeared in the TOML data. -// -// All keys returned are non-empty. -func (md *MetaData) Keys() []Key { - return md.keys -} - -// Undecoded returns all keys that have not been decoded in the order in which -// they appear in the original TOML document. -// -// This includes keys that haven't been decoded because of a [Primitive] value. -// Once the Primitive value is decoded, the keys will be considered decoded. -// -// Also note that decoding into an empty interface will result in no decoding, -// and so no keys will be considered decoded. -// -// In this sense, the Undecoded keys correspond to keys in the TOML document -// that do not have a concrete type in your representation. -func (md *MetaData) Undecoded() []Key { - undecoded := make([]Key, 0, len(md.keys)) - for _, key := range md.keys { - if _, ok := md.decoded[key.String()]; !ok { - undecoded = append(undecoded, key) - } - } - return undecoded -} - -// Key represents any TOML key, including key groups. Use [MetaData.Keys] to get -// values of this type. -type Key []string - -func (k Key) String() string { - ss := make([]string, len(k)) - for i := range k { - ss[i] = k.maybeQuoted(i) - } - return strings.Join(ss, ".") -} - -func (k Key) maybeQuoted(i int) string { - if k[i] == "" { - return `""` - } - for _, c := range k[i] { - if !isBareKeyChar(c, false) { - return `"` + dblQuotedReplacer.Replace(k[i]) + `"` - } - } - return k[i] -} - -func (k Key) add(piece string) Key { - newKey := make(Key, len(k)+1) - copy(newKey, k) - newKey[len(k)] = piece - return newKey -} diff --git a/vendor/github.com/BurntSushi/toml/parse.go b/vendor/github.com/BurntSushi/toml/parse.go deleted file mode 100644 index 9c19153698..0000000000 --- a/vendor/github.com/BurntSushi/toml/parse.go +++ /dev/null @@ -1,811 +0,0 @@ -package toml - -import ( - "fmt" - "os" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/BurntSushi/toml/internal" -) - -type parser struct { - lx *lexer - context Key // Full key for the current hash in scope. - currentKey string // Base key name for everything except hashes. - pos Position // Current position in the TOML file. - tomlNext bool - - ordered []Key // List of keys in the order that they appear in the TOML data. - - keyInfo map[string]keyInfo // Map keyname → info about the TOML key. - mapping map[string]interface{} // Map keyname → key value. - implicits map[string]struct{} // Record implicit keys (e.g. "key.group.names"). -} - -type keyInfo struct { - pos Position - tomlType tomlType -} - -func parse(data string) (p *parser, err error) { - _, tomlNext := os.LookupEnv("BURNTSUSHI_TOML_110") - - defer func() { - if r := recover(); r != nil { - if pErr, ok := r.(ParseError); ok { - pErr.input = data - err = pErr - return - } - panic(r) - } - }() - - // Read over BOM; do this here as the lexer calls utf8.DecodeRuneInString() - // which mangles stuff. UTF-16 BOM isn't strictly valid, but some tools add - // it anyway. - if strings.HasPrefix(data, "\xff\xfe") || strings.HasPrefix(data, "\xfe\xff") { // UTF-16 - data = data[2:] - } else if strings.HasPrefix(data, "\xef\xbb\xbf") { // UTF-8 - data = data[3:] - } - - // Examine first few bytes for NULL bytes; this probably means it's a UTF-16 - // file (second byte in surrogate pair being NULL). Again, do this here to - // avoid having to deal with UTF-8/16 stuff in the lexer. - ex := 6 - if len(data) < 6 { - ex = len(data) - } - if i := strings.IndexRune(data[:ex], 0); i > -1 { - return nil, ParseError{ - Message: "files cannot contain NULL bytes; probably using UTF-16; TOML files must be UTF-8", - Position: Position{Line: 1, Start: i, Len: 1}, - Line: 1, - input: data, - } - } - - p = &parser{ - keyInfo: make(map[string]keyInfo), - mapping: make(map[string]interface{}), - lx: lex(data, tomlNext), - ordered: make([]Key, 0), - implicits: make(map[string]struct{}), - tomlNext: tomlNext, - } - for { - item := p.next() - if item.typ == itemEOF { - break - } - p.topLevel(item) - } - - return p, nil -} - -func (p *parser) panicErr(it item, err error) { - panic(ParseError{ - err: err, - Position: it.pos, - Line: it.pos.Len, - LastKey: p.current(), - }) -} - -func (p *parser) panicItemf(it item, format string, v ...interface{}) { - panic(ParseError{ - Message: fmt.Sprintf(format, v...), - Position: it.pos, - Line: it.pos.Len, - LastKey: p.current(), - }) -} - -func (p *parser) panicf(format string, v ...interface{}) { - panic(ParseError{ - Message: fmt.Sprintf(format, v...), - Position: p.pos, - Line: p.pos.Line, - LastKey: p.current(), - }) -} - -func (p *parser) next() item { - it := p.lx.nextItem() - //fmt.Printf("ITEM %-18s line %-3d │ %q\n", it.typ, it.pos.Line, it.val) - if it.typ == itemError { - if it.err != nil { - panic(ParseError{ - Position: it.pos, - Line: it.pos.Line, - LastKey: p.current(), - err: it.err, - }) - } - - p.panicItemf(it, "%s", it.val) - } - return it -} - -func (p *parser) nextPos() item { - it := p.next() - p.pos = it.pos - return it -} - -func (p *parser) bug(format string, v ...interface{}) { - panic(fmt.Sprintf("BUG: "+format+"\n\n", v...)) -} - -func (p *parser) expect(typ itemType) item { - it := p.next() - p.assertEqual(typ, it.typ) - return it -} - -func (p *parser) assertEqual(expected, got itemType) { - if expected != got { - p.bug("Expected '%s' but got '%s'.", expected, got) - } -} - -func (p *parser) topLevel(item item) { - switch item.typ { - case itemCommentStart: // # .. - p.expect(itemText) - case itemTableStart: // [ .. ] - name := p.nextPos() - - var key Key - for ; name.typ != itemTableEnd && name.typ != itemEOF; name = p.next() { - key = append(key, p.keyString(name)) - } - p.assertEqual(itemTableEnd, name.typ) - - p.addContext(key, false) - p.setType("", tomlHash, item.pos) - p.ordered = append(p.ordered, key) - case itemArrayTableStart: // [[ .. ]] - name := p.nextPos() - - var key Key - for ; name.typ != itemArrayTableEnd && name.typ != itemEOF; name = p.next() { - key = append(key, p.keyString(name)) - } - p.assertEqual(itemArrayTableEnd, name.typ) - - p.addContext(key, true) - p.setType("", tomlArrayHash, item.pos) - p.ordered = append(p.ordered, key) - case itemKeyStart: // key = .. - outerContext := p.context - /// Read all the key parts (e.g. 'a' and 'b' in 'a.b') - k := p.nextPos() - var key Key - for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { - key = append(key, p.keyString(k)) - } - p.assertEqual(itemKeyEnd, k.typ) - - /// The current key is the last part. - p.currentKey = key[len(key)-1] - - /// All the other parts (if any) are the context; need to set each part - /// as implicit. - context := key[:len(key)-1] - for i := range context { - p.addImplicitContext(append(p.context, context[i:i+1]...)) - } - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - - /// Set value. - vItem := p.next() - val, typ := p.value(vItem, false) - p.set(p.currentKey, val, typ, vItem.pos) - - /// Remove the context we added (preserving any context from [tbl] lines). - p.context = outerContext - p.currentKey = "" - default: - p.bug("Unexpected type at top level: %s", item.typ) - } -} - -// Gets a string for a key (or part of a key in a table name). -func (p *parser) keyString(it item) string { - switch it.typ { - case itemText: - return it.val - case itemString, itemMultilineString, - itemRawString, itemRawMultilineString: - s, _ := p.value(it, false) - return s.(string) - default: - p.bug("Unexpected key type: %s", it.typ) - } - panic("unreachable") -} - -var datetimeRepl = strings.NewReplacer( - "z", "Z", - "t", "T", - " ", "T") - -// value translates an expected value from the lexer into a Go value wrapped -// as an empty interface. -func (p *parser) value(it item, parentIsArray bool) (interface{}, tomlType) { - switch it.typ { - case itemString: - return p.replaceEscapes(it, it.val), p.typeOfPrimitive(it) - case itemMultilineString: - return p.replaceEscapes(it, p.stripEscapedNewlines(stripFirstNewline(it.val))), p.typeOfPrimitive(it) - case itemRawString: - return it.val, p.typeOfPrimitive(it) - case itemRawMultilineString: - return stripFirstNewline(it.val), p.typeOfPrimitive(it) - case itemInteger: - return p.valueInteger(it) - case itemFloat: - return p.valueFloat(it) - case itemBool: - switch it.val { - case "true": - return true, p.typeOfPrimitive(it) - case "false": - return false, p.typeOfPrimitive(it) - default: - p.bug("Expected boolean value, but got '%s'.", it.val) - } - case itemDatetime: - return p.valueDatetime(it) - case itemArray: - return p.valueArray(it) - case itemInlineTableStart: - return p.valueInlineTable(it, parentIsArray) - default: - p.bug("Unexpected value type: %s", it.typ) - } - panic("unreachable") -} - -func (p *parser) valueInteger(it item) (interface{}, tomlType) { - if !numUnderscoresOK(it.val) { - p.panicItemf(it, "Invalid integer %q: underscores must be surrounded by digits", it.val) - } - if numHasLeadingZero(it.val) { - p.panicItemf(it, "Invalid integer %q: cannot have leading zeroes", it.val) - } - - num, err := strconv.ParseInt(it.val, 0, 64) - if err != nil { - // Distinguish integer values. Normally, it'd be a bug if the lexer - // provides an invalid integer, but it's possible that the number is - // out of range of valid values (which the lexer cannot determine). - // So mark the former as a bug but the latter as a legitimate user - // error. - if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { - p.panicErr(it, errParseRange{i: it.val, size: "int64"}) - } else { - p.bug("Expected integer value, but got '%s'.", it.val) - } - } - return num, p.typeOfPrimitive(it) -} - -func (p *parser) valueFloat(it item) (interface{}, tomlType) { - parts := strings.FieldsFunc(it.val, func(r rune) bool { - switch r { - case '.', 'e', 'E': - return true - } - return false - }) - for _, part := range parts { - if !numUnderscoresOK(part) { - p.panicItemf(it, "Invalid float %q: underscores must be surrounded by digits", it.val) - } - } - if len(parts) > 0 && numHasLeadingZero(parts[0]) { - p.panicItemf(it, "Invalid float %q: cannot have leading zeroes", it.val) - } - if !numPeriodsOK(it.val) { - // As a special case, numbers like '123.' or '1.e2', - // which are valid as far as Go/strconv are concerned, - // must be rejected because TOML says that a fractional - // part consists of '.' followed by 1+ digits. - p.panicItemf(it, "Invalid float %q: '.' must be followed by one or more digits", it.val) - } - val := strings.Replace(it.val, "_", "", -1) - if val == "+nan" || val == "-nan" { // Go doesn't support this, but TOML spec does. - val = "nan" - } - num, err := strconv.ParseFloat(val, 64) - if err != nil { - if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { - p.panicErr(it, errParseRange{i: it.val, size: "float64"}) - } else { - p.panicItemf(it, "Invalid float value: %q", it.val) - } - } - return num, p.typeOfPrimitive(it) -} - -var dtTypes = []struct { - fmt string - zone *time.Location - next bool -}{ - {time.RFC3339Nano, time.Local, false}, - {"2006-01-02T15:04:05.999999999", internal.LocalDatetime, false}, - {"2006-01-02", internal.LocalDate, false}, - {"15:04:05.999999999", internal.LocalTime, false}, - - // tomlNext - {"2006-01-02T15:04Z07:00", time.Local, true}, - {"2006-01-02T15:04", internal.LocalDatetime, true}, - {"15:04", internal.LocalTime, true}, -} - -func (p *parser) valueDatetime(it item) (interface{}, tomlType) { - it.val = datetimeRepl.Replace(it.val) - var ( - t time.Time - ok bool - err error - ) - for _, dt := range dtTypes { - if dt.next && !p.tomlNext { - continue - } - t, err = time.ParseInLocation(dt.fmt, it.val, dt.zone) - if err == nil { - ok = true - break - } - } - if !ok { - p.panicItemf(it, "Invalid TOML Datetime: %q.", it.val) - } - return t, p.typeOfPrimitive(it) -} - -func (p *parser) valueArray(it item) (interface{}, tomlType) { - p.setType(p.currentKey, tomlArray, it.pos) - - var ( - types []tomlType - - // Initialize to a non-nil empty slice. This makes it consistent with - // how S = [] decodes into a non-nil slice inside something like struct - // { S []string }. See #338 - array = []interface{}{} - ) - for it = p.next(); it.typ != itemArrayEnd; it = p.next() { - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - val, typ := p.value(it, true) - array = append(array, val) - types = append(types, typ) - - // XXX: types isn't used here, we need it to record the accurate type - // information. - // - // Not entirely sure how to best store this; could use "key[0]", - // "key[1]" notation, or maybe store it on the Array type? - _ = types - } - return array, tomlArray -} - -func (p *parser) valueInlineTable(it item, parentIsArray bool) (interface{}, tomlType) { - var ( - hash = make(map[string]interface{}) - outerContext = p.context - outerKey = p.currentKey - ) - - p.context = append(p.context, p.currentKey) - prevContext := p.context - p.currentKey = "" - - p.addImplicit(p.context) - p.addContext(p.context, parentIsArray) - - /// Loop over all table key/value pairs. - for it := p.next(); it.typ != itemInlineTableEnd; it = p.next() { - if it.typ == itemCommentStart { - p.expect(itemText) - continue - } - - /// Read all key parts. - k := p.nextPos() - var key Key - for ; k.typ != itemKeyEnd && k.typ != itemEOF; k = p.next() { - key = append(key, p.keyString(k)) - } - p.assertEqual(itemKeyEnd, k.typ) - - /// The current key is the last part. - p.currentKey = key[len(key)-1] - - /// All the other parts (if any) are the context; need to set each part - /// as implicit. - context := key[:len(key)-1] - for i := range context { - p.addImplicitContext(append(p.context, context[i:i+1]...)) - } - p.ordered = append(p.ordered, p.context.add(p.currentKey)) - - /// Set the value. - val, typ := p.value(p.next(), false) - p.set(p.currentKey, val, typ, it.pos) - hash[p.currentKey] = val - - /// Restore context. - p.context = prevContext - } - p.context = outerContext - p.currentKey = outerKey - return hash, tomlHash -} - -// numHasLeadingZero checks if this number has leading zeroes, allowing for '0', -// +/- signs, and base prefixes. -func numHasLeadingZero(s string) bool { - if len(s) > 1 && s[0] == '0' && !(s[1] == 'b' || s[1] == 'o' || s[1] == 'x') { // Allow 0b, 0o, 0x - return true - } - if len(s) > 2 && (s[0] == '-' || s[0] == '+') && s[1] == '0' { - return true - } - return false -} - -// numUnderscoresOK checks whether each underscore in s is surrounded by -// characters that are not underscores. -func numUnderscoresOK(s string) bool { - switch s { - case "nan", "+nan", "-nan", "inf", "-inf", "+inf": - return true - } - accept := false - for _, r := range s { - if r == '_' { - if !accept { - return false - } - } - - // isHexadecimal is a superset of all the permissable characters - // surrounding an underscore. - accept = isHexadecimal(r) - } - return accept -} - -// numPeriodsOK checks whether every period in s is followed by a digit. -func numPeriodsOK(s string) bool { - period := false - for _, r := range s { - if period && !isDigit(r) { - return false - } - period = r == '.' - } - return !period -} - -// Set the current context of the parser, where the context is either a hash or -// an array of hashes, depending on the value of the `array` parameter. -// -// Establishing the context also makes sure that the key isn't a duplicate, and -// will create implicit hashes automatically. -func (p *parser) addContext(key Key, array bool) { - var ok bool - - // Always start at the top level and drill down for our context. - hashContext := p.mapping - keyContext := make(Key, 0) - - // We only need implicit hashes for key[0:-1] - for _, k := range key[0 : len(key)-1] { - _, ok = hashContext[k] - keyContext = append(keyContext, k) - - // No key? Make an implicit hash and move on. - if !ok { - p.addImplicit(keyContext) - hashContext[k] = make(map[string]interface{}) - } - - // If the hash context is actually an array of tables, then set - // the hash context to the last element in that array. - // - // Otherwise, it better be a table, since this MUST be a key group (by - // virtue of it not being the last element in a key). - switch t := hashContext[k].(type) { - case []map[string]interface{}: - hashContext = t[len(t)-1] - case map[string]interface{}: - hashContext = t - default: - p.panicf("Key '%s' was already created as a hash.", keyContext) - } - } - - p.context = keyContext - if array { - // If this is the first element for this array, then allocate a new - // list of tables for it. - k := key[len(key)-1] - if _, ok := hashContext[k]; !ok { - hashContext[k] = make([]map[string]interface{}, 0, 4) - } - - // Add a new table. But make sure the key hasn't already been used - // for something else. - if hash, ok := hashContext[k].([]map[string]interface{}); ok { - hashContext[k] = append(hash, make(map[string]interface{})) - } else { - p.panicf("Key '%s' was already created and cannot be used as an array.", key) - } - } else { - p.setValue(key[len(key)-1], make(map[string]interface{})) - } - p.context = append(p.context, key[len(key)-1]) -} - -// set calls setValue and setType. -func (p *parser) set(key string, val interface{}, typ tomlType, pos Position) { - p.setValue(key, val) - p.setType(key, typ, pos) -} - -// setValue sets the given key to the given value in the current context. -// It will make sure that the key hasn't already been defined, account for -// implicit key groups. -func (p *parser) setValue(key string, value interface{}) { - var ( - tmpHash interface{} - ok bool - hash = p.mapping - keyContext Key - ) - for _, k := range p.context { - keyContext = append(keyContext, k) - if tmpHash, ok = hash[k]; !ok { - p.bug("Context for key '%s' has not been established.", keyContext) - } - switch t := tmpHash.(type) { - case []map[string]interface{}: - // The context is a table of hashes. Pick the most recent table - // defined as the current hash. - hash = t[len(t)-1] - case map[string]interface{}: - hash = t - default: - p.panicf("Key '%s' has already been defined.", keyContext) - } - } - keyContext = append(keyContext, key) - - if _, ok := hash[key]; ok { - // Normally redefining keys isn't allowed, but the key could have been - // defined implicitly and it's allowed to be redefined concretely. (See - // the `valid/implicit-and-explicit-after.toml` in toml-test) - // - // But we have to make sure to stop marking it as an implicit. (So that - // another redefinition provokes an error.) - // - // Note that since it has already been defined (as a hash), we don't - // want to overwrite it. So our business is done. - if p.isArray(keyContext) { - p.removeImplicit(keyContext) - hash[key] = value - return - } - if p.isImplicit(keyContext) { - p.removeImplicit(keyContext) - return - } - - // Otherwise, we have a concrete key trying to override a previous - // key, which is *always* wrong. - p.panicf("Key '%s' has already been defined.", keyContext) - } - - hash[key] = value -} - -// setType sets the type of a particular value at a given key. It should be -// called immediately AFTER setValue. -// -// Note that if `key` is empty, then the type given will be applied to the -// current context (which is either a table or an array of tables). -func (p *parser) setType(key string, typ tomlType, pos Position) { - keyContext := make(Key, 0, len(p.context)+1) - keyContext = append(keyContext, p.context...) - if len(key) > 0 { // allow type setting for hashes - keyContext = append(keyContext, key) - } - // Special case to make empty keys ("" = 1) work. - // Without it it will set "" rather than `""`. - // TODO: why is this needed? And why is this only needed here? - if len(keyContext) == 0 { - keyContext = Key{""} - } - p.keyInfo[keyContext.String()] = keyInfo{tomlType: typ, pos: pos} -} - -// Implicit keys need to be created when tables are implied in "a.b.c.d = 1" and -// "[a.b.c]" (the "a", "b", and "c" hashes are never created explicitly). -func (p *parser) addImplicit(key Key) { p.implicits[key.String()] = struct{}{} } -func (p *parser) removeImplicit(key Key) { delete(p.implicits, key.String()) } -func (p *parser) isImplicit(key Key) bool { _, ok := p.implicits[key.String()]; return ok } -func (p *parser) isArray(key Key) bool { return p.keyInfo[key.String()].tomlType == tomlArray } -func (p *parser) addImplicitContext(key Key) { p.addImplicit(key); p.addContext(key, false) } - -// current returns the full key name of the current context. -func (p *parser) current() string { - if len(p.currentKey) == 0 { - return p.context.String() - } - if len(p.context) == 0 { - return p.currentKey - } - return fmt.Sprintf("%s.%s", p.context, p.currentKey) -} - -func stripFirstNewline(s string) string { - if len(s) > 0 && s[0] == '\n' { - return s[1:] - } - if len(s) > 1 && s[0] == '\r' && s[1] == '\n' { - return s[2:] - } - return s -} - -// stripEscapedNewlines removes whitespace after line-ending backslashes in -// multiline strings. -// -// A line-ending backslash is an unescaped \ followed only by whitespace until -// the next newline. After a line-ending backslash, all whitespace is removed -// until the next non-whitespace character. -func (p *parser) stripEscapedNewlines(s string) string { - var b strings.Builder - var i int - for { - ix := strings.Index(s[i:], `\`) - if ix < 0 { - b.WriteString(s) - return b.String() - } - i += ix - - if len(s) > i+1 && s[i+1] == '\\' { - // Escaped backslash. - i += 2 - continue - } - // Scan until the next non-whitespace. - j := i + 1 - whitespaceLoop: - for ; j < len(s); j++ { - switch s[j] { - case ' ', '\t', '\r', '\n': - default: - break whitespaceLoop - } - } - if j == i+1 { - // Not a whitespace escape. - i++ - continue - } - if !strings.Contains(s[i:j], "\n") { - // This is not a line-ending backslash. - // (It's a bad escape sequence, but we can let - // replaceEscapes catch it.) - i++ - continue - } - b.WriteString(s[:i]) - s = s[j:] - i = 0 - } -} - -func (p *parser) replaceEscapes(it item, str string) string { - replaced := make([]rune, 0, len(str)) - s := []byte(str) - r := 0 - for r < len(s) { - if s[r] != '\\' { - c, size := utf8.DecodeRune(s[r:]) - r += size - replaced = append(replaced, c) - continue - } - r += 1 - if r >= len(s) { - p.bug("Escape sequence at end of string.") - return "" - } - switch s[r] { - default: - p.bug("Expected valid escape code after \\, but got %q.", s[r]) - case ' ', '\t': - p.panicItemf(it, "invalid escape: '\\%c'", s[r]) - case 'b': - replaced = append(replaced, rune(0x0008)) - r += 1 - case 't': - replaced = append(replaced, rune(0x0009)) - r += 1 - case 'n': - replaced = append(replaced, rune(0x000A)) - r += 1 - case 'f': - replaced = append(replaced, rune(0x000C)) - r += 1 - case 'r': - replaced = append(replaced, rune(0x000D)) - r += 1 - case 'e': - if p.tomlNext { - replaced = append(replaced, rune(0x001B)) - r += 1 - } - case '"': - replaced = append(replaced, rune(0x0022)) - r += 1 - case '\\': - replaced = append(replaced, rune(0x005C)) - r += 1 - case 'x': - if p.tomlNext { - escaped := p.asciiEscapeToUnicode(it, s[r+1:r+3]) - replaced = append(replaced, escaped) - r += 3 - } - case 'u': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+5). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(it, s[r+1:r+5]) - replaced = append(replaced, escaped) - r += 5 - case 'U': - // At this point, we know we have a Unicode escape of the form - // `uXXXX` at [r, r+9). (Because the lexer guarantees this - // for us.) - escaped := p.asciiEscapeToUnicode(it, s[r+1:r+9]) - replaced = append(replaced, escaped) - r += 9 - } - } - return string(replaced) -} - -func (p *parser) asciiEscapeToUnicode(it item, bs []byte) rune { - s := string(bs) - hex, err := strconv.ParseUint(strings.ToLower(s), 16, 32) - if err != nil { - p.bug("Could not parse '%s' as a hexadecimal number, but the lexer claims it's OK: %s", s, err) - } - if !utf8.ValidRune(rune(hex)) { - p.panicItemf(it, "Escaped character '\\u%s' is not valid UTF-8.", s) - } - return rune(hex) -} diff --git a/vendor/github.com/BurntSushi/toml/type_fields.go b/vendor/github.com/BurntSushi/toml/type_fields.go deleted file mode 100644 index 254ca82e54..0000000000 --- a/vendor/github.com/BurntSushi/toml/type_fields.go +++ /dev/null @@ -1,242 +0,0 @@ -package toml - -// Struct field handling is adapted from code in encoding/json: -// -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the Go distribution. - -import ( - "reflect" - "sort" - "sync" -) - -// A field represents a single field found in a struct. -type field struct { - name string // the name of the field (`toml` tag included) - tag bool // whether field has a `toml` tag - index []int // represents the depth of an anonymous field - typ reflect.Type // the type of the field -} - -// byName sorts field by name, breaking ties with depth, -// then breaking ties with "name came from toml tag", then -// breaking ties with index sequence. -type byName []field - -func (x byName) Len() int { return len(x) } - -func (x byName) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byName) Less(i, j int) bool { - if x[i].name != x[j].name { - return x[i].name < x[j].name - } - if len(x[i].index) != len(x[j].index) { - return len(x[i].index) < len(x[j].index) - } - if x[i].tag != x[j].tag { - return x[i].tag - } - return byIndex(x).Less(i, j) -} - -// byIndex sorts field by index sequence. -type byIndex []field - -func (x byIndex) Len() int { return len(x) } - -func (x byIndex) Swap(i, j int) { x[i], x[j] = x[j], x[i] } - -func (x byIndex) Less(i, j int) bool { - for k, xik := range x[i].index { - if k >= len(x[j].index) { - return false - } - if xik != x[j].index[k] { - return xik < x[j].index[k] - } - } - return len(x[i].index) < len(x[j].index) -} - -// typeFields returns a list of fields that TOML should recognize for the given -// type. The algorithm is breadth-first search over the set of structs to -// include - the top struct and then any reachable anonymous structs. -func typeFields(t reflect.Type) []field { - // Anonymous fields to explore at the current level and the next. - current := []field{} - next := []field{{typ: t}} - - // Count of queued names for current level and the next. - var count map[reflect.Type]int - var nextCount map[reflect.Type]int - - // Types already visited at an earlier level. - visited := map[reflect.Type]bool{} - - // Fields found. - var fields []field - - for len(next) > 0 { - current, next = next, current[:0] - count, nextCount = nextCount, map[reflect.Type]int{} - - for _, f := range current { - if visited[f.typ] { - continue - } - visited[f.typ] = true - - // Scan f.typ for fields to include. - for i := 0; i < f.typ.NumField(); i++ { - sf := f.typ.Field(i) - if sf.PkgPath != "" && !sf.Anonymous { // unexported - continue - } - opts := getOptions(sf.Tag) - if opts.skip { - continue - } - index := make([]int, len(f.index)+1) - copy(index, f.index) - index[len(f.index)] = i - - ft := sf.Type - if ft.Name() == "" && ft.Kind() == reflect.Ptr { - // Follow pointer. - ft = ft.Elem() - } - - // Record found field and index sequence. - if opts.name != "" || !sf.Anonymous || ft.Kind() != reflect.Struct { - tagged := opts.name != "" - name := opts.name - if name == "" { - name = sf.Name - } - fields = append(fields, field{name, tagged, index, ft}) - if count[f.typ] > 1 { - // If there were multiple instances, add a second, - // so that the annihilation code will see a duplicate. - // It only cares about the distinction between 1 or 2, - // so don't bother generating any more copies. - fields = append(fields, fields[len(fields)-1]) - } - continue - } - - // Record new anonymous struct to explore in next round. - nextCount[ft]++ - if nextCount[ft] == 1 { - f := field{name: ft.Name(), index: index, typ: ft} - next = append(next, f) - } - } - } - } - - sort.Sort(byName(fields)) - - // Delete all fields that are hidden by the Go rules for embedded fields, - // except that fields with TOML tags are promoted. - - // The fields are sorted in primary order of name, secondary order - // of field index length. Loop over names; for each name, delete - // hidden fields by choosing the one dominant field that survives. - out := fields[:0] - for advance, i := 0, 0; i < len(fields); i += advance { - // One iteration per name. - // Find the sequence of fields with the name of this first field. - fi := fields[i] - name := fi.name - for advance = 1; i+advance < len(fields); advance++ { - fj := fields[i+advance] - if fj.name != name { - break - } - } - if advance == 1 { // Only one field with this name - out = append(out, fi) - continue - } - dominant, ok := dominantField(fields[i : i+advance]) - if ok { - out = append(out, dominant) - } - } - - fields = out - sort.Sort(byIndex(fields)) - - return fields -} - -// dominantField looks through the fields, all of which are known to -// have the same name, to find the single field that dominates the -// others using Go's embedding rules, modified by the presence of -// TOML tags. If there are multiple top-level fields, the boolean -// will be false: This condition is an error in Go and we skip all -// the fields. -func dominantField(fields []field) (field, bool) { - // The fields are sorted in increasing index-length order. The winner - // must therefore be one with the shortest index length. Drop all - // longer entries, which is easy: just truncate the slice. - length := len(fields[0].index) - tagged := -1 // Index of first tagged field. - for i, f := range fields { - if len(f.index) > length { - fields = fields[:i] - break - } - if f.tag { - if tagged >= 0 { - // Multiple tagged fields at the same level: conflict. - // Return no field. - return field{}, false - } - tagged = i - } - } - if tagged >= 0 { - return fields[tagged], true - } - // All remaining fields have the same length. If there's more than one, - // we have a conflict (two fields named "X" at the same level) and we - // return no field. - if len(fields) > 1 { - return field{}, false - } - return fields[0], true -} - -var fieldCache struct { - sync.RWMutex - m map[reflect.Type][]field -} - -// cachedTypeFields is like typeFields but uses a cache to avoid repeated work. -func cachedTypeFields(t reflect.Type) []field { - fieldCache.RLock() - f := fieldCache.m[t] - fieldCache.RUnlock() - if f != nil { - return f - } - - // Compute fields without lock. - // Might duplicate effort but won't hold other computations back. - f = typeFields(t) - if f == nil { - f = []field{} - } - - fieldCache.Lock() - if fieldCache.m == nil { - fieldCache.m = map[reflect.Type][]field{} - } - fieldCache.m[t] = f - fieldCache.Unlock() - return f -} diff --git a/vendor/github.com/BurntSushi/toml/type_toml.go b/vendor/github.com/BurntSushi/toml/type_toml.go deleted file mode 100644 index 4e90d77373..0000000000 --- a/vendor/github.com/BurntSushi/toml/type_toml.go +++ /dev/null @@ -1,70 +0,0 @@ -package toml - -// tomlType represents any Go type that corresponds to a TOML type. -// While the first draft of the TOML spec has a simplistic type system that -// probably doesn't need this level of sophistication, we seem to be militating -// toward adding real composite types. -type tomlType interface { - typeString() string -} - -// typeEqual accepts any two types and returns true if they are equal. -func typeEqual(t1, t2 tomlType) bool { - if t1 == nil || t2 == nil { - return false - } - return t1.typeString() == t2.typeString() -} - -func typeIsTable(t tomlType) bool { - return typeEqual(t, tomlHash) || typeEqual(t, tomlArrayHash) -} - -type tomlBaseType string - -func (btype tomlBaseType) typeString() string { - return string(btype) -} - -func (btype tomlBaseType) String() string { - return btype.typeString() -} - -var ( - tomlInteger tomlBaseType = "Integer" - tomlFloat tomlBaseType = "Float" - tomlDatetime tomlBaseType = "Datetime" - tomlString tomlBaseType = "String" - tomlBool tomlBaseType = "Bool" - tomlArray tomlBaseType = "Array" - tomlHash tomlBaseType = "Hash" - tomlArrayHash tomlBaseType = "ArrayHash" -) - -// typeOfPrimitive returns a tomlType of any primitive value in TOML. -// Primitive values are: Integer, Float, Datetime, String and Bool. -// -// Passing a lexer item other than the following will cause a BUG message -// to occur: itemString, itemBool, itemInteger, itemFloat, itemDatetime. -func (p *parser) typeOfPrimitive(lexItem item) tomlType { - switch lexItem.typ { - case itemInteger: - return tomlInteger - case itemFloat: - return tomlFloat - case itemDatetime: - return tomlDatetime - case itemString: - return tomlString - case itemMultilineString: - return tomlString - case itemRawString: - return tomlString - case itemRawMultilineString: - return tomlString - case itemBool: - return tomlBool - } - p.bug("Cannot infer primitive type of lex item '%s'.", lexItem) - panic("unreachable") -} diff --git a/vendor/github.com/Djarvur/go-err113/.gitignore b/vendor/github.com/Djarvur/go-err113/.gitignore deleted file mode 100644 index 66fd13c903..0000000000 --- a/vendor/github.com/Djarvur/go-err113/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ diff --git a/vendor/github.com/Djarvur/go-err113/.golangci.yml b/vendor/github.com/Djarvur/go-err113/.golangci.yml deleted file mode 100644 index 2abdfc6392..0000000000 --- a/vendor/github.com/Djarvur/go-err113/.golangci.yml +++ /dev/null @@ -1,150 +0,0 @@ -# This file contains all available configuration options -# with their default values. - -# options for analysis running -run: - # default concurrency is a available CPU number - concurrency: 4 - - # timeout for analysis, e.g. 30s, 5m, default is 1m - deadline: 15m - - # exit code when at least one issue was found, default is 1 - issues-exit-code: 1 - - # include test files or not, default is true - tests: false - - # list of build tags, all linters use it. Default is empty list. - #build-tags: - # - mytag - - # which dirs to skip: they won't be analyzed; - # can use regexp here: generated.*, regexp is applied on full path; - # default value is empty list, but next dirs are always skipped independently - # from this option's value: - # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - skip-dirs: - - /gen$ - - # which files to skip: they will be analyzed, but issues from them - # won't be reported. Default value is empty list, but there is - # no need to include all autogenerated files, we confidently recognize - # autogenerated files. If it's not please let us know. - skip-files: - - ".*\\.my\\.go$" - - lib/bad.go - - ".*\\.template\\.go$" - -# output configuration options -output: - # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" - format: colored-line-number - - # print lines of code with issue, default is true - print-issued-lines: true - - # print linter name in the end of issue text, default is true - print-linter-name: true - -# all available settings of specific linters -linters-settings: - errcheck: - # report about not checking of errors in type assetions: `a := b.(MyStruct)`; - # default is false: such cases aren't reported by default. - check-type-assertions: false - - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; - # default is false: such cases aren't reported by default. - check-blank: false - govet: - # report about shadowed variables - check-shadowing: true - - # Obtain type information from installed (to $GOPATH/pkg) package files: - # golangci-lint will execute `go install -i` and `go test -i` for analyzed packages - # before analyzing them. - # By default this option is disabled and govet gets type information by loader from source code. - # Loading from source code is slow, but it's done only once for all linters. - # Go-installing of packages first time is much slower than loading them from source code, - # therefore this option is disabled by default. - # But repeated installation is fast in go >= 1.10 because of build caching. - # Enable this option only if all conditions are met: - # 1. you use only "fast" linters (--fast e.g.): no program loading occurs - # 2. you use go >= 1.10 - # 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI. - use-installed-packages: false - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 - gofmt: - # simplify code: gofmt with `-s` option, true by default - simplify: true - gocyclo: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - min-complexity: 10 - maligned: - # print struct with more effective memory layout or not, false by default - suggest-new: true - dupl: - # tokens count to trigger issue, 150 by default - threshold: 100 - goconst: - # minimal length of string constant, 3 by default - min-len: 3 - # minimal occurrences count to trigger, 3 by default - min-occurrences: 3 - depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/davecgh/go-spew/spew - -linters: - #enable: - # - staticcheck - # - unused - # - gosimple - enable-all: true - disable: - - lll - disable-all: false - #presets: - # - bugs - # - unused - fast: false - -issues: - # List of regexps of issue texts to exclude, empty list by default. - # But independently from this option we use default exclude patterns, - # it can be disabled by `exclude-use-default: false`. To list all - # excluded by default patterns execute `golangci-lint run --help` - exclude: - - "`parseTained` is unused" - - "`parseState` is unused" - - # Independently from option `exclude` we use default exclude patterns, - # it can be disabled by this option. To list all - # excluded by default patterns execute `golangci-lint run --help`. - # Default value for this option is false. - exclude-use-default: false - - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-per-linter: 0 - - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. - max-same: 0 - - # Show only new issues: if there are unstaged changes or untracked files, - # only those changes are analyzed, else only changes in HEAD~ are analyzed. - # It's a super-useful option for integration of golangci-lint into existing - # large codebase. It's not practical to fix all existing issues at the moment - # of integration: much better don't allow issues in new code. - # Default is false. - new: false - - # Show only new issues created after git revision `REV` - #new-from-rev: REV - - # Show only new issues created in git patch with set file path. - #new-from-patch: path/to/patch/file \ No newline at end of file diff --git a/vendor/github.com/Djarvur/go-err113/.travis.yml b/vendor/github.com/Djarvur/go-err113/.travis.yml deleted file mode 100644 index 44fe77d53a..0000000000 --- a/vendor/github.com/Djarvur/go-err113/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: go - -go: - - "1.13" - - "1.14" - - tip - -env: - - GO111MODULE=on - -before_install: - - go get github.com/axw/gocov/gocov - - go get github.com/mattn/goveralls - - go get golang.org/x/tools/cmd/cover - - go get golang.org/x/tools/cmd/goimports - - wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh - -script: - - test -z "$(goimports -d ./ 2>&1)" - - ./bin/golangci-lint run - - go test -v -race ./... - -after_success: - - test "$TRAVIS_GO_VERSION" = "1.14" && goveralls -service=travis-ci diff --git a/vendor/github.com/Djarvur/go-err113/LICENSE b/vendor/github.com/Djarvur/go-err113/LICENSE deleted file mode 100644 index a78ad8c776..0000000000 --- a/vendor/github.com/Djarvur/go-err113/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Djarvur - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/Djarvur/go-err113/README.adoc b/vendor/github.com/Djarvur/go-err113/README.adoc deleted file mode 100644 index b26af40386..0000000000 --- a/vendor/github.com/Djarvur/go-err113/README.adoc +++ /dev/null @@ -1,75 +0,0 @@ -= err113 image:https://godoc.org/github.com/Djarvur/go-err113?status.svg["GoDoc",link="http://godoc.org/github.com/Djarvur/go-err113"] image:https://travis-ci.org/Djarvur/go-err113.svg["Build Status",link="https://travis-ci.org/Djarvur/go-err113"] image:https://coveralls.io/repos/Djarvur/go-err113/badge.svg?branch=master&service=github["Coverage Status",link="https://coveralls.io/github/Djarvur/go-err113?branch=master"] -Daniel Podolsky -:toc: - -Golang linter to check the errors handling expressions - -== Details - -Starting from Go 1.13 the standard `error` type behaviour was changed: one `error` could be derived from another with `fmt.Errorf()` method using `%w` format specifier. - -So the errors hierarchy could be built for flexible and responsible errors processing. - -And to make this possible at least two simple rules should be followed: - -1. `error` values should not be compared directly but with `errors.Is()` method. -1. `error` should not be created dynamically from scratch but by the wrapping the static (package-level) error. - -This linter is checking the code for these 2 rules compliance. - -=== Reports - -So, `err113` reports every `==` and `!=` comparison for exact `error` type variables except comparison to `nil` and `io.EOF`. - -Also, any call of `errors.New()` and `fmt.Errorf()` methods are reported except the calls used to initialise package-level variables and the `fmt.Errorf()` calls wrapping the other errors. - -Note: non-standard packages, like `github.com/pkg/errors` are ignored completely. - -== Install - -``` -go get -u github.com/Djarvur/go-err113/cmd/err113 -``` - -== Usage - -Defined by link:https://pkg.go.dev/golang.org/x/tools/go/analysis/singlechecker[singlechecker] package. - -``` -err113: checks the error handling rules according to the Go 1.13 new error type - -Usage: err113 [-flag] [package] - - -Flags: - -V print version and exit - -all - no effect (deprecated) - -c int - display offending line with this many lines of context (default -1) - -cpuprofile string - write CPU profile to this file - -debug string - debug flags, any subset of "fpstv" - -fix - apply all suggested fixes - -flags - print analyzer flags in JSON - -json - emit JSON output - -memprofile string - write memory profile to this file - -source - no effect (deprecated) - -tags string - no effect (deprecated) - -trace string - write trace log to this file - -v no effect (deprecated) -``` - -== Thanks - -To link:https://github.com/quasilyte[Iskander (Alex) Sharipov] for the really useful advices. - -To link:https://github.com/jackwhelpton[Jack Whelpton] for the bugfix provided. \ No newline at end of file diff --git a/vendor/github.com/Djarvur/go-err113/comparison.go b/vendor/github.com/Djarvur/go-err113/comparison.go deleted file mode 100644 index 8a85557837..0000000000 --- a/vendor/github.com/Djarvur/go-err113/comparison.go +++ /dev/null @@ -1,123 +0,0 @@ -package err113 - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" -) - -func inspectComparision(pass *analysis.Pass, n ast.Node) bool { // nolint: unparam - // check whether the call expression matches time.Now().Sub() - be, ok := n.(*ast.BinaryExpr) - if !ok { - return true - } - - // check if it is a comparison operation - if be.Op != token.EQL && be.Op != token.NEQ { - return true - } - - if !areBothErrors(be.X, be.Y, pass.TypesInfo) { - return true - } - - oldExpr := render(pass.Fset, be) - - negate := "" - if be.Op == token.NEQ { - negate = "!" - } - - newExpr := fmt.Sprintf("%s%s.Is(%s, %s)", negate, "errors", rawString(be.X), rawString(be.Y)) - - pass.Report( - analysis.Diagnostic{ - Pos: be.Pos(), - Message: fmt.Sprintf("do not compare errors directly %q, use %q instead", oldExpr, newExpr), - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: fmt.Sprintf("should replace %q with %q", oldExpr, newExpr), - TextEdits: []analysis.TextEdit{ - { - Pos: be.Pos(), - End: be.End(), - NewText: []byte(newExpr), - }, - }, - }, - }, - }, - ) - - return true -} - -func isError(v ast.Expr, info *types.Info) bool { - if intf, ok := info.TypeOf(v).Underlying().(*types.Interface); ok { - return intf.NumMethods() == 1 && intf.Method(0).FullName() == "(error).Error" - } - - return false -} - -func isEOF(ex ast.Expr, info *types.Info) bool { - se, ok := ex.(*ast.SelectorExpr) - if !ok || se.Sel.Name != "EOF" { - return false - } - - if ep, ok := asImportedName(se.X, info); !ok || ep != "io" { - return false - } - - return true -} - -func asImportedName(ex ast.Expr, info *types.Info) (string, bool) { - ei, ok := ex.(*ast.Ident) - if !ok { - return "", false - } - - ep, ok := info.ObjectOf(ei).(*types.PkgName) - if !ok { - return "", false - } - - return ep.Imported().Path(), true -} - -func areBothErrors(x, y ast.Expr, typesInfo *types.Info) bool { - // check that both left and right hand side are not nil - if typesInfo.Types[x].IsNil() || typesInfo.Types[y].IsNil() { - return false - } - - // check that both left and right hand side are not io.EOF - if isEOF(x, typesInfo) || isEOF(y, typesInfo) { - return false - } - - // check that both left and right hand side are errors - if !isError(x, typesInfo) && !isError(y, typesInfo) { - return false - } - - return true -} - -func rawString(x ast.Expr) string { - switch t := x.(type) { - case *ast.Ident: - return t.Name - case *ast.SelectorExpr: - return fmt.Sprintf("%s.%s", rawString(t.X), t.Sel.Name) - case *ast.CallExpr: - return fmt.Sprintf("%s()", rawString(t.Fun)) - } - return fmt.Sprintf("%s", x) -} diff --git a/vendor/github.com/Djarvur/go-err113/definition.go b/vendor/github.com/Djarvur/go-err113/definition.go deleted file mode 100644 index 689236bac3..0000000000 --- a/vendor/github.com/Djarvur/go-err113/definition.go +++ /dev/null @@ -1,74 +0,0 @@ -package err113 - -import ( - "go/ast" - "go/types" - "strings" - - "golang.org/x/tools/go/analysis" -) - -var methods2check = map[string]map[string]func(*ast.CallExpr, *types.Info) bool{ // nolint: gochecknoglobals - "errors": {"New": justTrue}, - "fmt": {"Errorf": checkWrap}, -} - -func justTrue(*ast.CallExpr, *types.Info) bool { - return true -} - -func checkWrap(ce *ast.CallExpr, info *types.Info) bool { - return !(len(ce.Args) > 0 && strings.Contains(toString(ce.Args[0], info), `%w`)) -} - -func inspectDefinition(pass *analysis.Pass, tlds map[*ast.CallExpr]struct{}, n ast.Node) bool { //nolint: unparam - // check whether the call expression matches time.Now().Sub() - ce, ok := n.(*ast.CallExpr) - if !ok { - return true - } - - if _, ok = tlds[ce]; ok { - return true - } - - fn, ok := ce.Fun.(*ast.SelectorExpr) - if !ok { - return true - } - - fxName, ok := asImportedName(fn.X, pass.TypesInfo) - if !ok { - return true - } - - methods, ok := methods2check[fxName] - if !ok { - return true - } - - checkFunc, ok := methods[fn.Sel.Name] - if !ok { - return true - } - - if !checkFunc(ce, pass.TypesInfo) { - return true - } - - pass.Reportf( - ce.Pos(), - "do not define dynamic errors, use wrapped static errors instead: %q", - render(pass.Fset, ce), - ) - - return true -} - -func toString(ex ast.Expr, info *types.Info) string { - if tv, ok := info.Types[ex]; ok && tv.Value != nil { - return tv.Value.ExactString() - } - - return "" -} diff --git a/vendor/github.com/Djarvur/go-err113/err113.go b/vendor/github.com/Djarvur/go-err113/err113.go deleted file mode 100644 index ec4f52ac72..0000000000 --- a/vendor/github.com/Djarvur/go-err113/err113.go +++ /dev/null @@ -1,90 +0,0 @@ -// Package err113 is a Golang linter to check the errors handling expressions -package err113 - -import ( - "bytes" - "go/ast" - "go/printer" - "go/token" - - "golang.org/x/tools/go/analysis" -) - -// NewAnalyzer creates a new analysis.Analyzer instance tuned to run err113 checks. -func NewAnalyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "err113", - Doc: "checks the error handling rules according to the Go 1.13 new error type", - Run: run, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - tlds := enumerateFileDecls(file) - - ast.Inspect( - file, - func(n ast.Node) bool { - return inspectComparision(pass, n) && - inspectDefinition(pass, tlds, n) - }, - ) - } - - return nil, nil -} - -// render returns the pretty-print of the given node. -func render(fset *token.FileSet, x interface{}) string { - var buf bytes.Buffer - if err := printer.Fprint(&buf, fset, x); err != nil { - panic(err) - } - - return buf.String() -} - -func enumerateFileDecls(f *ast.File) map[*ast.CallExpr]struct{} { - res := make(map[*ast.CallExpr]struct{}) - - var ces []*ast.CallExpr // nolint: prealloc - - for _, d := range f.Decls { - ces = append(ces, enumerateDeclVars(d)...) - } - - for _, ce := range ces { - res[ce] = struct{}{} - } - - return res -} - -func enumerateDeclVars(d ast.Decl) (res []*ast.CallExpr) { - td, ok := d.(*ast.GenDecl) - if !ok || td.Tok != token.VAR { - return nil - } - - for _, s := range td.Specs { - res = append(res, enumerateSpecValues(s)...) - } - - return res -} - -func enumerateSpecValues(s ast.Spec) (res []*ast.CallExpr) { - vs, ok := s.(*ast.ValueSpec) - if !ok { - return nil - } - - for _, v := range vs.Values { - if ce, ok := v.(*ast.CallExpr); ok { - res = append(res, ce) - } - } - - return res -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/LICENSE b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/LICENSE deleted file mode 100644 index 6698196c5a..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Gaijin Entertainment - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer/analyzer.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer/analyzer.go deleted file mode 100644 index b490f1c640..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer/analyzer.go +++ /dev/null @@ -1,291 +0,0 @@ -package analyzer - -import ( - "flag" - "fmt" - "go/ast" - "go/token" - "go/types" - "sync" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment" - "github.com/GaijinEntertainment/go-exhaustruct/v3/internal/pattern" - "github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure" -) - -type analyzer struct { - include pattern.List `exhaustruct:"optional"` - exclude pattern.List `exhaustruct:"optional"` - - structFields structure.FieldsCache `exhaustruct:"optional"` - comments comment.Cache `exhaustruct:"optional"` - - typeProcessingNeed map[string]bool - typeProcessingNeedMu sync.RWMutex `exhaustruct:"optional"` -} - -func NewAnalyzer(include, exclude []string) (*analysis.Analyzer, error) { - a := analyzer{ - typeProcessingNeed: make(map[string]bool), - comments: comment.Cache{}, - } - - var err error - - a.include, err = pattern.NewList(include...) - if err != nil { - return nil, err //nolint:wrapcheck - } - - a.exclude, err = pattern.NewList(exclude...) - if err != nil { - return nil, err //nolint:wrapcheck - } - - return &analysis.Analyzer{ //nolint:exhaustruct - Name: "exhaustruct", - Doc: "Checks if all structure fields are initialized", - Run: a.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - Flags: a.newFlagSet(), - }, nil -} - -func (a *analyzer) newFlagSet() flag.FlagSet { - fs := flag.NewFlagSet("", flag.PanicOnError) - - fs.Var(&a.include, "i", `Regular expression to match type names, can receive multiple flags. -Anonymous structs can be matched by '' alias. -4ex: - github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer\. - github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer\.TypeInfo`) - fs.Var(&a.exclude, "e", `Regular expression to exclude type names, can receive multiple flags. -Anonymous structs can be matched by '' alias. -4ex: - github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer\. - github.com/GaijinEntertainment/go-exhaustruct/v3/analyzer\.TypeInfo`) - - return *fs -} - -func (a *analyzer) run(pass *analysis.Pass) (any, error) { - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) //nolint:forcetypeassert - - insp.WithStack([]ast.Node{(*ast.CompositeLit)(nil)}, a.newVisitor(pass)) - - return nil, nil //nolint:nilnil -} - -// newVisitor returns visitor that only expects [ast.CompositeLit] nodes. -func (a *analyzer) newVisitor(pass *analysis.Pass) func(n ast.Node, push bool, stack []ast.Node) bool { - return func(n ast.Node, push bool, stack []ast.Node) bool { - if !push { - return true - } - - lit, ok := n.(*ast.CompositeLit) - if !ok { - // this should never happen, but better be prepared - return true - } - - structTyp, typeInfo, ok := getStructType(pass, lit) - if !ok { - return true - } - - if len(lit.Elts) == 0 { - if ret, ok := stackParentIsReturn(stack); ok { - if returnContainsNonNilError(pass, ret) { - // it is okay to return uninitialized structure in case struct's direct parent is - // a return statement containing non-nil error - // - // we're unable to check if returned error is custom, but at least we're able to - // cover str [error] type. - return true - } - } - } - - file := a.comments.Get(pass.Fset, stack[0].(*ast.File)) //nolint:forcetypeassert - rc := getCompositeLitRelatedComments(stack, file) - pos, msg := a.processStruct(pass, lit, structTyp, typeInfo, rc) - - if pos != nil { - pass.Reportf(*pos, msg) - } - - return true - } -} - -// getCompositeLitRelatedComments returns all comments that are related to checked node. We -// have to traverse the stack manually as ast do not associate comments with -// [ast.CompositeLit]. -func getCompositeLitRelatedComments(stack []ast.Node, cm ast.CommentMap) []*ast.CommentGroup { - comments := make([]*ast.CommentGroup, 0) - - for i := len(stack) - 1; i >= 0; i-- { - node := stack[i] - - switch node.(type) { - case *ast.CompositeLit, // stack[len(stack)-1] - *ast.ReturnStmt, // return ... - *ast.IndexExpr, // map[enum]...{...}[key] - *ast.CallExpr, // myfunc(map...) - *ast.UnaryExpr, // &map... - *ast.AssignStmt, // variable assignment (without var keyword) - *ast.DeclStmt, // var declaration, parent of *ast.GenDecl - *ast.GenDecl, // var declaration, parent of *ast.ValueSpec - *ast.ValueSpec: // var declaration - comments = append(comments, cm[node]...) - - default: - return comments - } - } - - return comments -} - -func getStructType(pass *analysis.Pass, lit *ast.CompositeLit) (*types.Struct, *TypeInfo, bool) { - switch typ := pass.TypesInfo.TypeOf(lit).(type) { - case *types.Named: // named type - if structTyp, ok := typ.Underlying().(*types.Struct); ok { - pkg := typ.Obj().Pkg() - ti := TypeInfo{ - Name: typ.Obj().Name(), - PackageName: pkg.Name(), - PackagePath: pkg.Path(), - } - - return structTyp, &ti, true - } - - return nil, nil, false - - case *types.Struct: // anonymous struct - ti := TypeInfo{ - Name: "", - PackageName: pass.Pkg.Name(), - PackagePath: pass.Pkg.Path(), - } - - return typ, &ti, true - - default: - return nil, nil, false - } -} - -func stackParentIsReturn(stack []ast.Node) (*ast.ReturnStmt, bool) { - // it is safe to skip boundary check, since stack always has at least one element - // - whole file. - ret, ok := stack[len(stack)-2].(*ast.ReturnStmt) - - return ret, ok -} - -func returnContainsNonNilError(pass *analysis.Pass, ret *ast.ReturnStmt) bool { - // errors are mostly located at the end of return statement, so we're starting - // from the end. - for i := len(ret.Results) - 1; i >= 0; i-- { - if pass.TypesInfo.TypeOf(ret.Results[i]).String() == "error" { - return true - } - } - - return false -} - -func (a *analyzer) processStruct( - pass *analysis.Pass, - lit *ast.CompositeLit, - structTyp *types.Struct, - info *TypeInfo, - comments []*ast.CommentGroup, -) (*token.Pos, string) { - shouldProcess := a.shouldProcessType(info) - - if shouldProcess && comment.HasDirective(comments, comment.DirectiveIgnore) { - return nil, "" - } - - if !shouldProcess && !comment.HasDirective(comments, comment.DirectiveEnforce) { - return nil, "" - } - - // unnamed structures are only defined in same package, along with types that has - // prefix identical to current package name. - isSamePackage := info.PackagePath == pass.Pkg.Path() - - if f := a.litSkippedFields(lit, structTyp, !isSamePackage); len(f) > 0 { - pos := lit.Pos() - - if len(f) == 1 { - return &pos, fmt.Sprintf("%s is missing field %s", info.ShortString(), f.String()) - } - - return &pos, fmt.Sprintf("%s is missing fields %s", info.ShortString(), f.String()) - } - - return nil, "" -} - -// shouldProcessType returns true if type should be processed basing off include -// and exclude patterns, defined though constructor and\or flags. -func (a *analyzer) shouldProcessType(info *TypeInfo) bool { - if len(a.include) == 0 && len(a.exclude) == 0 { - return true - } - - name := info.String() - - a.typeProcessingNeedMu.RLock() - res, ok := a.typeProcessingNeed[name] - a.typeProcessingNeedMu.RUnlock() - - if !ok { - a.typeProcessingNeedMu.Lock() - res = true - - if a.include != nil && !a.include.MatchFullString(name) { - res = false - } - - if res && a.exclude != nil && a.exclude.MatchFullString(name) { - res = false - } - - a.typeProcessingNeed[name] = res - a.typeProcessingNeedMu.Unlock() - } - - return res -} - -func (a *analyzer) litSkippedFields( - lit *ast.CompositeLit, - typ *types.Struct, - onlyExported bool, -) structure.Fields { - return a.structFields.Get(typ).Skipped(lit, onlyExported) -} - -type TypeInfo struct { - Name string - PackageName string - PackagePath string -} - -func (t TypeInfo) String() string { - return t.PackagePath + "." + t.Name -} - -func (t TypeInfo) ShortString() string { - return t.PackageName + "." + t.Name -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/cache.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/cache.go deleted file mode 100644 index 88edef638a..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/cache.go +++ /dev/null @@ -1,35 +0,0 @@ -package comment - -import ( - "go/ast" - "go/token" - "sync" -) - -type Cache struct { - comments map[*ast.File]ast.CommentMap - mu sync.RWMutex -} - -// Get returns a comment map for a given file. In case if a comment map is not -// found, it creates a new one. -func (c *Cache) Get(fset *token.FileSet, f *ast.File) ast.CommentMap { - c.mu.RLock() - if cm, ok := c.comments[f]; ok { - c.mu.RUnlock() - return cm - } - c.mu.RUnlock() - - c.mu.Lock() - defer c.mu.Unlock() - - if c.comments == nil { - c.comments = make(map[*ast.File]ast.CommentMap) - } - - cm := ast.NewCommentMap(fset, f, f.Comments) - c.comments[f] = cm - - return cm -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/directive.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/directive.go deleted file mode 100644 index a39a8076fa..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/comment/directive.go +++ /dev/null @@ -1,28 +0,0 @@ -package comment - -import ( - "go/ast" - "strings" -) - -type Directive string - -const ( - prefix = `//exhaustruct:` - DirectiveIgnore Directive = prefix + `ignore` - DirectiveEnforce Directive = prefix + `enforce` -) - -// HasDirective parses a directive from a given list of comments. -// If no directive is found, the second return value is `false`. -func HasDirective(comments []*ast.CommentGroup, expected Directive) bool { - for _, cg := range comments { - for _, commentLine := range cg.List { - if strings.HasPrefix(commentLine.Text, string(expected)) { - return true - } - } - } - - return false -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/pattern/list.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/pattern/list.go deleted file mode 100644 index a16e5058d2..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/pattern/list.go +++ /dev/null @@ -1,82 +0,0 @@ -package pattern - -import ( - "fmt" - "regexp" - "strings" -) - -var ( - ErrEmptyPattern = fmt.Errorf("pattern can't be empty") - ErrCompilationFailed = fmt.Errorf("pattern compilation failed") -) - -// List is a list of regular expressions. -type List []*regexp.Regexp - -// NewList parses slice of strings to a slice of compiled regular expressions. -func NewList(strs ...string) (List, error) { - if len(strs) == 0 { - return nil, nil - } - - l := make(List, 0, len(strs)) - - for _, str := range strs { - re, err := strToRe(str) - if err != nil { - return nil, err - } - - l = append(l, re) - } - - return l, nil -} - -// MatchFullString matches provided string against all regexps in a slice and returns -// true if any of them matches whole string. -func (l List) MatchFullString(str string) bool { - for i := 0; i < len(l); i++ { - if m := l[i].FindStringSubmatch(str); len(m) > 0 && m[0] == str { - return true - } - } - - return false -} - -func (l *List) Set(value string) error { - re, err := strToRe(value) - if err != nil { - return err - } - - *l = append(*l, re) - - return nil -} - -func (l *List) String() string { - res := make([]string, 0, len(*l)) - - for _, re := range *l { - res = append(res, `"`+re.String()+`"`) - } - - return strings.Join(res, ", ") -} - -// strToRe parses string to a compiled regular expression that matches full string. -func strToRe(str string) (*regexp.Regexp, error) { - if str == "" { - return nil, ErrEmptyPattern - } - - re, err := regexp.Compile(str) - if err != nil { - return nil, fmt.Errorf("%w: %s: %w", ErrCompilationFailed, str, err) - } - - return re, nil -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields-cache.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields-cache.go deleted file mode 100644 index 12a3796926..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields-cache.go +++ /dev/null @@ -1,35 +0,0 @@ -package structure - -import ( - "go/types" - "sync" -) - -type FieldsCache struct { - fields map[*types.Struct]Fields - mu sync.RWMutex -} - -// Get returns a struct fields for a given type. In case if a struct fields is -// not found, it creates a new one from type definition. -func (c *FieldsCache) Get(typ *types.Struct) Fields { - c.mu.RLock() - fields, ok := c.fields[typ] - c.mu.RUnlock() - - if ok { - return fields - } - - c.mu.Lock() - defer c.mu.Unlock() - - if c.fields == nil { - c.fields = make(map[*types.Struct]Fields) - } - - fields = NewFields(typ) - c.fields[typ] = fields - - return fields -} diff --git a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields.go b/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields.go deleted file mode 100644 index b6b1a48c87..0000000000 --- a/vendor/github.com/GaijinEntertainment/go-exhaustruct/v3/internal/structure/fields.go +++ /dev/null @@ -1,127 +0,0 @@ -package structure - -import ( - "go/ast" - "go/types" - "reflect" - "strings" -) - -const ( - tagName = "exhaustruct" - optionalTagValue = "optional" -) - -type Field struct { - Name string - Exported bool - Optional bool -} - -type Fields []*Field - -// NewFields creates a new [Fields] from a given struct type. -// Fields items are listed in order they appear in the struct. -func NewFields(strct *types.Struct) Fields { - sf := make(Fields, 0, strct.NumFields()) - - for i := 0; i < strct.NumFields(); i++ { - f := strct.Field(i) - - sf = append(sf, &Field{ - Name: f.Name(), - Exported: f.Exported(), - Optional: HasOptionalTag(strct.Tag(i)), - }) - } - - return sf -} - -func HasOptionalTag(tags string) bool { - return reflect.StructTag(tags).Get(tagName) == optionalTagValue -} - -// String returns a comma-separated list of field names. -func (sf Fields) String() string { - b := strings.Builder{} - - for i := 0; i < len(sf); i++ { - if b.Len() != 0 { - b.WriteString(", ") - } - - b.WriteString(sf[i].Name) - } - - return b.String() -} - -// Skipped returns a list of fields that are not present in the given -// literal, but expected to. -// -//revive:disable-next-line:cyclomatic -func (sf Fields) Skipped(lit *ast.CompositeLit, onlyExported bool) Fields { - if len(lit.Elts) != 0 && !isNamedLiteral(lit) { - if len(lit.Elts) == len(sf) { - return nil - } - - return sf[len(lit.Elts):] - } - - em := sf.existenceMap() - res := make(Fields, 0, len(sf)) - - for i := 0; i < len(lit.Elts); i++ { - kv, ok := lit.Elts[i].(*ast.KeyValueExpr) - if !ok { - continue - } - - k, ok := kv.Key.(*ast.Ident) - if !ok { - continue - } - - em[k.Name] = true - } - - for i := 0; i < len(sf); i++ { - if em[sf[i].Name] || (!sf[i].Exported && onlyExported) || sf[i].Optional { - continue - } - - res = append(res, sf[i]) - } - - if len(res) == 0 { - return nil - } - - return res -} - -func (sf Fields) existenceMap() map[string]bool { - m := make(map[string]bool, len(sf)) - - for i := 0; i < len(sf); i++ { - m[sf[i].Name] = false - } - - return m -} - -// isNamedLiteral returns true if the given literal is unnamed. -// -// The logic is basing on the principle that literal is named or unnamed, -// therefore is literal's first element is a [ast.KeyValueExpr], it is named. -// -// Method will panic if the given literal is empty. -func isNamedLiteral(lit *ast.CompositeLit) bool { - if _, ok := lit.Elts[0].(*ast.KeyValueExpr); !ok { - return false - } - - return true -} diff --git a/vendor/github.com/MakeNowJust/heredoc/LICENSE b/vendor/github.com/MakeNowJust/heredoc/LICENSE deleted file mode 100644 index 6d0eb9d5d6..0000000000 --- a/vendor/github.com/MakeNowJust/heredoc/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2019 TSUYUSATO Kitsune - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/MakeNowJust/heredoc/README.md b/vendor/github.com/MakeNowJust/heredoc/README.md deleted file mode 100644 index e9924d2974..0000000000 --- a/vendor/github.com/MakeNowJust/heredoc/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# heredoc - -[![Build Status](https://circleci.com/gh/MakeNowJust/heredoc.svg?style=svg)](https://circleci.com/gh/MakeNowJust/heredoc) [![GoDoc](https://godoc.org/github.com/MakeNowJusti/heredoc?status.svg)](https://godoc.org/github.com/MakeNowJust/heredoc) - -## About - -Package heredoc provides the here-document with keeping indent. - -## Install - -```console -$ go get github.com/MakeNowJust/heredoc -``` - -## Import - -```go -// usual -import "github.com/MakeNowJust/heredoc" -``` - -## Example - -```go -package main - -import ( - "fmt" - "github.com/MakeNowJust/heredoc" -) - -func main() { - fmt.Println(heredoc.Doc(` - Lorem ipsum dolor sit amet, consectetur adipisicing elit, - sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, ... - `)) - // Output: - // Lorem ipsum dolor sit amet, consectetur adipisicing elit, - // sed do eiusmod tempor incididunt ut labore et dolore magna - // aliqua. Ut enim ad minim veniam, ... - // -} -``` - -## API Document - - - [heredoc - GoDoc](https://godoc.org/github.com/MakeNowJust/heredoc) - -## License - -This software is released under the MIT License, see LICENSE. diff --git a/vendor/github.com/MakeNowJust/heredoc/heredoc.go b/vendor/github.com/MakeNowJust/heredoc/heredoc.go deleted file mode 100644 index 1fc0469555..0000000000 --- a/vendor/github.com/MakeNowJust/heredoc/heredoc.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) 2014-2019 TSUYUSATO Kitsune -// This software is released under the MIT License. -// http://opensource.org/licenses/mit-license.php - -// Package heredoc provides creation of here-documents from raw strings. -// -// Golang supports raw-string syntax. -// -// doc := ` -// Foo -// Bar -// ` -// -// But raw-string cannot recognize indentation. Thus such content is an indented string, equivalent to -// -// "\n\tFoo\n\tBar\n" -// -// I dont't want this! -// -// However this problem is solved by package heredoc. -// -// doc := heredoc.Doc(` -// Foo -// Bar -// `) -// -// Is equivalent to -// -// "Foo\nBar\n" -package heredoc - -import ( - "fmt" - "strings" - "unicode" -) - -const maxInt = int(^uint(0) >> 1) - -// Doc returns un-indented string as here-document. -func Doc(raw string) string { - skipFirstLine := false - if len(raw) > 0 && raw[0] == '\n' { - raw = raw[1:] - } else { - skipFirstLine = true - } - - lines := strings.Split(raw, "\n") - - minIndentSize := getMinIndent(lines, skipFirstLine) - lines = removeIndentation(lines, minIndentSize, skipFirstLine) - - return strings.Join(lines, "\n") -} - -// getMinIndent calculates the minimum indentation in lines, excluding empty lines. -func getMinIndent(lines []string, skipFirstLine bool) int { - minIndentSize := maxInt - - for i, line := range lines { - if i == 0 && skipFirstLine { - continue - } - - indentSize := 0 - for _, r := range []rune(line) { - if unicode.IsSpace(r) { - indentSize += 1 - } else { - break - } - } - - if len(line) == indentSize { - if i == len(lines)-1 && indentSize < minIndentSize { - lines[i] = "" - } - } else if indentSize < minIndentSize { - minIndentSize = indentSize - } - } - return minIndentSize -} - -// removeIndentation removes n characters from the front of each line in lines. -// Skips first line if skipFirstLine is true, skips empty lines. -func removeIndentation(lines []string, n int, skipFirstLine bool) []string { - for i, line := range lines { - if i == 0 && skipFirstLine { - continue - } - - if len(lines[i]) >= n { - lines[i] = line[n:] - } - } - return lines -} - -// Docf returns unindented and formatted string as here-document. -// Formatting is done as for fmt.Printf(). -func Docf(raw string, args ...interface{}) string { - return fmt.Sprintf(Doc(raw), args...) -} diff --git a/vendor/github.com/Masterminds/goutils/.travis.yml b/vendor/github.com/Masterminds/goutils/.travis.yml deleted file mode 100644 index 4025e01ec4..0000000000 --- a/vendor/github.com/Masterminds/goutils/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go - -go: - - 1.6 - - 1.7 - - 1.8 - - tip - -script: - - go test -v - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/06e3328629952dabe3e0 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/goutils/CHANGELOG.md b/vendor/github.com/Masterminds/goutils/CHANGELOG.md deleted file mode 100644 index d700ec47f2..0000000000 --- a/vendor/github.com/Masterminds/goutils/CHANGELOG.md +++ /dev/null @@ -1,8 +0,0 @@ -# 1.0.1 (2017-05-31) - -## Fixed -- #21: Fix generation of alphanumeric strings (thanks @dbarranco) - -# 1.0.0 (2014-04-30) - -- Initial release. diff --git a/vendor/github.com/Masterminds/goutils/LICENSE.txt b/vendor/github.com/Masterminds/goutils/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/Masterminds/goutils/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Masterminds/goutils/README.md b/vendor/github.com/Masterminds/goutils/README.md deleted file mode 100644 index 163ffe72a8..0000000000 --- a/vendor/github.com/Masterminds/goutils/README.md +++ /dev/null @@ -1,70 +0,0 @@ -GoUtils -=========== -[![Stability: Maintenance](https://masterminds.github.io/stability/maintenance.svg)](https://masterminds.github.io/stability/maintenance.html) -[![GoDoc](https://godoc.org/github.com/Masterminds/goutils?status.png)](https://godoc.org/github.com/Masterminds/goutils) [![Build Status](https://travis-ci.org/Masterminds/goutils.svg?branch=master)](https://travis-ci.org/Masterminds/goutils) [![Build status](https://ci.appveyor.com/api/projects/status/sc2b1ew0m7f0aiju?svg=true)](https://ci.appveyor.com/project/mattfarina/goutils) - - -GoUtils provides users with utility functions to manipulate strings in various ways. It is a Go implementation of some -string manipulation libraries of Java Apache Commons. GoUtils includes the following Java Apache Commons classes: -* WordUtils -* RandomStringUtils -* StringUtils (partial implementation) - -## Installation -If you have Go set up on your system, from the GOPATH directory within the command line/terminal, enter this: - - go get github.com/Masterminds/goutils - -If you do not have Go set up on your system, please follow the [Go installation directions from the documenation](http://golang.org/doc/install), and then follow the instructions above to install GoUtils. - - -## Documentation -GoUtils doc is available here: [![GoDoc](https://godoc.org/github.com/Masterminds/goutils?status.png)](https://godoc.org/github.com/Masterminds/goutils) - - -## Usage -The code snippets below show examples of how to use GoUtils. Some functions return errors while others do not. The first instance below, which does not return an error, is the `Initials` function (located within the `wordutils.go` file). - - package main - - import ( - "fmt" - "github.com/Masterminds/goutils" - ) - - func main() { - - // EXAMPLE 1: A goutils function which returns no errors - fmt.Println (goutils.Initials("John Doe Foo")) // Prints out "JDF" - - } -Some functions return errors mainly due to illegal arguements used as parameters. The code example below illustrates how to deal with function that returns an error. In this instance, the function is the `Random` function (located within the `randomstringutils.go` file). - - package main - - import ( - "fmt" - "github.com/Masterminds/goutils" - ) - - func main() { - - // EXAMPLE 2: A goutils function which returns an error - rand1, err1 := goutils.Random (-1, 0, 0, true, true) - - if err1 != nil { - fmt.Println(err1) // Prints out error message because -1 was entered as the first parameter in goutils.Random(...) - } else { - fmt.Println(rand1) - } - - } - -## License -GoUtils is licensed under the Apache License, Version 2.0. Please check the LICENSE.txt file or visit http://www.apache.org/licenses/LICENSE-2.0 for a copy of the license. - -## Issue Reporting -Make suggestions or report issues using the Git issue tracker: https://github.com/Masterminds/goutils/issues - -## Website -* [GoUtils webpage](http://Masterminds.github.io/goutils/) diff --git a/vendor/github.com/Masterminds/goutils/appveyor.yml b/vendor/github.com/Masterminds/goutils/appveyor.yml deleted file mode 100644 index 657564a847..0000000000 --- a/vendor/github.com/Masterminds/goutils/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\Masterminds\goutils -shallow_clone: true - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -build: off - -install: - - go version - - go env - -test_script: - - go test -v - -deploy: off diff --git a/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go b/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go deleted file mode 100644 index 8dbd924858..0000000000 --- a/vendor/github.com/Masterminds/goutils/cryptorandomstringutils.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "crypto/rand" - "fmt" - "math" - "math/big" - "unicode" -) - -/* -CryptoRandomNonAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of all characters (ASCII/Unicode values between 0 to 2,147,483,647 (math.MaxInt32)). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomNonAlphaNumeric(count int) (string, error) { - return CryptoRandomAlphaNumericCustom(count, false, false) -} - -/* -CryptoRandomAscii creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of characters whose ASCII value is between 32 and 126 (inclusive). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAscii(count int) (string, error) { - return CryptoRandom(count, 32, 127, false, false) -} - -/* -CryptoRandomNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomNumeric(count int) (string, error) { - return CryptoRandom(count, 0, 0, false, true) -} - -/* -CryptoRandomAlphabetic creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphabetic(count int) (string, error) { - return CryptoRandom(count, 0, 0, true, false) -} - -/* -CryptoRandomAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphaNumeric(count int) (string, error) { - return CryptoRandom(count, 0, 0, true, true) -} - -/* -CryptoRandomAlphaNumericCustom creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, CryptoRandom(...) -*/ -func CryptoRandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error) { - return CryptoRandom(count, 0, 0, letters, numbers) -} - -/* -CryptoRandom creates a random string based on a variety of options, using using golang's crypto/rand source of randomness. -If the parameters start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, -unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32, respectively. -If chars is not nil, characters stored in chars that are between start and end are chosen. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode int) to start at - end - the position in set of chars (ASCII/Unicode int) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - -Returns: - string - the random string - error - an error stemming from invalid parameters: if count < 0; or the provided chars array is empty; or end <= start; or end > len(chars) -*/ -func CryptoRandom(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error) { - if count == 0 { - return "", nil - } else if count < 0 { - err := fmt.Errorf("randomstringutils illegal argument: Requested random string length %v is less than 0.", count) // equiv to err := errors.New("...") - return "", err - } - if chars != nil && len(chars) == 0 { - err := fmt.Errorf("randomstringutils illegal argument: The chars array must not be empty") - return "", err - } - - if start == 0 && end == 0 { - if chars != nil { - end = len(chars) - } else { - if !letters && !numbers { - end = math.MaxInt32 - } else { - end = 'z' + 1 - start = ' ' - } - } - } else { - if end <= start { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) must be greater than start (%v)", end, start) - return "", err - } - - if chars != nil && end > len(chars) { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) cannot be greater than len(chars) (%v)", end, len(chars)) - return "", err - } - } - - buffer := make([]rune, count) - gap := end - start - - // high-surrogates range, (\uD800-\uDBFF) = 55296 - 56319 - // low-surrogates range, (\uDC00-\uDFFF) = 56320 - 57343 - - for count != 0 { - count-- - var ch rune - if chars == nil { - ch = rune(getCryptoRandomInt(gap) + int64(start)) - } else { - ch = chars[getCryptoRandomInt(gap)+int64(start)] - } - - if letters && unicode.IsLetter(ch) || numbers && unicode.IsDigit(ch) || !letters && !numbers { - if ch >= 56320 && ch <= 57343 { // low surrogate range - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = ch - count-- - // Insert high surrogate - buffer[count] = rune(55296 + getCryptoRandomInt(128)) - } - } else if ch >= 55296 && ch <= 56191 { // High surrogates range (Partial) - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = rune(56320 + getCryptoRandomInt(128)) - count-- - // Insert high surrogate - buffer[count] = ch - } - } else if ch >= 56192 && ch <= 56319 { - // private high surrogate, skip it - count++ - } else { - // not one of the surrogates* - buffer[count] = ch - } - } else { - count++ - } - } - return string(buffer), nil -} - -func getCryptoRandomInt(count int) int64 { - nBig, err := rand.Int(rand.Reader, big.NewInt(int64(count))) - if err != nil { - panic(err) - } - return nBig.Int64() -} diff --git a/vendor/github.com/Masterminds/goutils/randomstringutils.go b/vendor/github.com/Masterminds/goutils/randomstringutils.go deleted file mode 100644 index 272670231a..0000000000 --- a/vendor/github.com/Masterminds/goutils/randomstringutils.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "fmt" - "math" - "math/rand" - "time" - "unicode" -) - -// RANDOM provides the time-based seed used to generate random numbers -var RANDOM = rand.New(rand.NewSource(time.Now().UnixNano())) - -/* -RandomNonAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of all characters (ASCII/Unicode values between 0 to 2,147,483,647 (math.MaxInt32)). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomNonAlphaNumeric(count int) (string, error) { - return RandomAlphaNumericCustom(count, false, false) -} - -/* -RandomAscii creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of characters whose ASCII value is between 32 and 126 (inclusive). - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAscii(count int) (string, error) { - return Random(count, 32, 127, false, false) -} - -/* -RandomNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomNumeric(count int) (string, error) { - return Random(count, 0, 0, false, true) -} - -/* -RandomAlphabetic creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alphabetic characters. - -Parameters: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphabetic(count int) (string, error) { - return Random(count, 0, 0, true, false) -} - -/* -RandomAlphaNumeric creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters. - -Parameter: - count - the length of random string to create - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphaNumeric(count int) (string, error) { - return Random(count, 0, 0, true, true) -} - -/* -RandomAlphaNumericCustom creates a random string whose length is the number of characters specified. -Characters will be chosen from the set of alpha-numeric characters as indicated by the arguments. - -Parameters: - count - the length of random string to create - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func RandomAlphaNumericCustom(count int, letters bool, numbers bool) (string, error) { - return Random(count, 0, 0, letters, numbers) -} - -/* -Random creates a random string based on a variety of options, using default source of randomness. -This method has exactly the same semantics as RandomSeed(int, int, int, bool, bool, []char, *rand.Rand), but -instead of using an externally supplied source of randomness, it uses the internal *rand.Rand instance. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode int) to start at - end - the position in set of chars (ASCII/Unicode int) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - -Returns: - string - the random string - error - an error stemming from an invalid parameter within underlying function, RandomSeed(...) -*/ -func Random(count int, start int, end int, letters bool, numbers bool, chars ...rune) (string, error) { - return RandomSeed(count, start, end, letters, numbers, chars, RANDOM) -} - -/* -RandomSeed creates a random string based on a variety of options, using supplied source of randomness. -If the parameters start and end are both 0, start and end are set to ' ' and 'z', the ASCII printable characters, will be used, -unless letters and numbers are both false, in which case, start and end are set to 0 and math.MaxInt32, respectively. -If chars is not nil, characters stored in chars that are between start and end are chosen. -This method accepts a user-supplied *rand.Rand instance to use as a source of randomness. By seeding a single *rand.Rand instance -with a fixed seed and using it for each call, the same random sequence of strings can be generated repeatedly and predictably. - -Parameters: - count - the length of random string to create - start - the position in set of chars (ASCII/Unicode decimals) to start at - end - the position in set of chars (ASCII/Unicode decimals) to end before - letters - if true, generated string may include alphabetic characters - numbers - if true, generated string may include numeric characters - chars - the set of chars to choose randoms from. If nil, then it will use the set of all chars. - random - a source of randomness. - -Returns: - string - the random string - error - an error stemming from invalid parameters: if count < 0; or the provided chars array is empty; or end <= start; or end > len(chars) -*/ -func RandomSeed(count int, start int, end int, letters bool, numbers bool, chars []rune, random *rand.Rand) (string, error) { - - if count == 0 { - return "", nil - } else if count < 0 { - err := fmt.Errorf("randomstringutils illegal argument: Requested random string length %v is less than 0.", count) // equiv to err := errors.New("...") - return "", err - } - if chars != nil && len(chars) == 0 { - err := fmt.Errorf("randomstringutils illegal argument: The chars array must not be empty") - return "", err - } - - if start == 0 && end == 0 { - if chars != nil { - end = len(chars) - } else { - if !letters && !numbers { - end = math.MaxInt32 - } else { - end = 'z' + 1 - start = ' ' - } - } - } else { - if end <= start { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) must be greater than start (%v)", end, start) - return "", err - } - - if chars != nil && end > len(chars) { - err := fmt.Errorf("randomstringutils illegal argument: Parameter end (%v) cannot be greater than len(chars) (%v)", end, len(chars)) - return "", err - } - } - - buffer := make([]rune, count) - gap := end - start - - // high-surrogates range, (\uD800-\uDBFF) = 55296 - 56319 - // low-surrogates range, (\uDC00-\uDFFF) = 56320 - 57343 - - for count != 0 { - count-- - var ch rune - if chars == nil { - ch = rune(random.Intn(gap) + start) - } else { - ch = chars[random.Intn(gap)+start] - } - - if letters && unicode.IsLetter(ch) || numbers && unicode.IsDigit(ch) || !letters && !numbers { - if ch >= 56320 && ch <= 57343 { // low surrogate range - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = ch - count-- - // Insert high surrogate - buffer[count] = rune(55296 + random.Intn(128)) - } - } else if ch >= 55296 && ch <= 56191 { // High surrogates range (Partial) - if count == 0 { - count++ - } else { - // Insert low surrogate - buffer[count] = rune(56320 + random.Intn(128)) - count-- - // Insert high surrogate - buffer[count] = ch - } - } else if ch >= 56192 && ch <= 56319 { - // private high surrogate, skip it - count++ - } else { - // not one of the surrogates* - buffer[count] = ch - } - } else { - count++ - } - } - return string(buffer), nil -} diff --git a/vendor/github.com/Masterminds/goutils/stringutils.go b/vendor/github.com/Masterminds/goutils/stringutils.go deleted file mode 100644 index 741bb530e8..0000000000 --- a/vendor/github.com/Masterminds/goutils/stringutils.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goutils - -import ( - "bytes" - "fmt" - "strings" - "unicode" -) - -// Typically returned by functions where a searched item cannot be found -const INDEX_NOT_FOUND = -1 - -/* -Abbreviate abbreviates a string using ellipses. This will turn the string "Now is the time for all good men" into "Now is the time for..." - -Specifically, the algorithm is as follows: - - - If str is less than maxWidth characters long, return it. - - Else abbreviate it to (str[0:maxWidth - 3] + "..."). - - If maxWidth is less than 4, return an illegal argument error. - - In no case will it return a string of length greater than maxWidth. - -Parameters: - str - the string to check - maxWidth - maximum length of result string, must be at least 4 - -Returns: - string - abbreviated string - error - if the width is too small -*/ -func Abbreviate(str string, maxWidth int) (string, error) { - return AbbreviateFull(str, 0, maxWidth) -} - -/* -AbbreviateFull abbreviates a string using ellipses. This will turn the string "Now is the time for all good men" into "...is the time for..." -This function works like Abbreviate(string, int), but allows you to specify a "left edge" offset. Note that this left edge is not -necessarily going to be the leftmost character in the result, or the first character following the ellipses, but it will appear -somewhere in the result. -In no case will it return a string of length greater than maxWidth. - -Parameters: - str - the string to check - offset - left edge of source string - maxWidth - maximum length of result string, must be at least 4 - -Returns: - string - abbreviated string - error - if the width is too small -*/ -func AbbreviateFull(str string, offset int, maxWidth int) (string, error) { - if str == "" { - return "", nil - } - if maxWidth < 4 { - err := fmt.Errorf("stringutils illegal argument: Minimum abbreviation width is 4") - return "", err - } - if len(str) <= maxWidth { - return str, nil - } - if offset > len(str) { - offset = len(str) - } - if len(str)-offset < (maxWidth - 3) { // 15 - 5 < 10 - 3 = 10 < 7 - offset = len(str) - (maxWidth - 3) - } - abrevMarker := "..." - if offset <= 4 { - return str[0:maxWidth-3] + abrevMarker, nil // str.substring(0, maxWidth - 3) + abrevMarker; - } - if maxWidth < 7 { - err := fmt.Errorf("stringutils illegal argument: Minimum abbreviation width with offset is 7") - return "", err - } - if (offset + maxWidth - 3) < len(str) { // 5 + (10-3) < 15 = 12 < 15 - abrevStr, _ := Abbreviate(str[offset:len(str)], (maxWidth - 3)) - return abrevMarker + abrevStr, nil // abrevMarker + abbreviate(str.substring(offset), maxWidth - 3); - } - return abrevMarker + str[(len(str)-(maxWidth-3)):len(str)], nil // abrevMarker + str.substring(str.length() - (maxWidth - 3)); -} - -/* -DeleteWhiteSpace deletes all whitespaces from a string as defined by unicode.IsSpace(rune). -It returns the string without whitespaces. - -Parameter: - str - the string to delete whitespace from, may be nil - -Returns: - the string without whitespaces -*/ -func DeleteWhiteSpace(str string) string { - if str == "" { - return str - } - sz := len(str) - var chs bytes.Buffer - count := 0 - for i := 0; i < sz; i++ { - ch := rune(str[i]) - if !unicode.IsSpace(ch) { - chs.WriteRune(ch) - count++ - } - } - if count == sz { - return str - } - return chs.String() -} - -/* -IndexOfDifference compares two strings, and returns the index at which the strings begin to differ. - -Parameters: - str1 - the first string - str2 - the second string - -Returns: - the index where str1 and str2 begin to differ; -1 if they are equal -*/ -func IndexOfDifference(str1 string, str2 string) int { - if str1 == str2 { - return INDEX_NOT_FOUND - } - if IsEmpty(str1) || IsEmpty(str2) { - return 0 - } - var i int - for i = 0; i < len(str1) && i < len(str2); i++ { - if rune(str1[i]) != rune(str2[i]) { - break - } - } - if i < len(str2) || i < len(str1) { - return i - } - return INDEX_NOT_FOUND -} - -/* -IsBlank checks if a string is whitespace or empty (""). Observe the following behavior: - - goutils.IsBlank("") = true - goutils.IsBlank(" ") = true - goutils.IsBlank("bob") = false - goutils.IsBlank(" bob ") = false - -Parameter: - str - the string to check - -Returns: - true - if the string is whitespace or empty ("") -*/ -func IsBlank(str string) bool { - strLen := len(str) - if str == "" || strLen == 0 { - return true - } - for i := 0; i < strLen; i++ { - if unicode.IsSpace(rune(str[i])) == false { - return false - } - } - return true -} - -/* -IndexOf returns the index of the first instance of sub in str, with the search beginning from the -index start point specified. -1 is returned if sub is not present in str. - -An empty string ("") will return -1 (INDEX_NOT_FOUND). A negative start position is treated as zero. -A start position greater than the string length returns -1. - -Parameters: - str - the string to check - sub - the substring to find - start - the start position; negative treated as zero - -Returns: - the first index where the sub string was found (always >= start) -*/ -func IndexOf(str string, sub string, start int) int { - - if start < 0 { - start = 0 - } - - if len(str) < start { - return INDEX_NOT_FOUND - } - - if IsEmpty(str) || IsEmpty(sub) { - return INDEX_NOT_FOUND - } - - partialIndex := strings.Index(str[start:len(str)], sub) - if partialIndex == -1 { - return INDEX_NOT_FOUND - } - return partialIndex + start -} - -// IsEmpty checks if a string is empty (""). Returns true if empty, and false otherwise. -func IsEmpty(str string) bool { - return len(str) == 0 -} - -// Returns either the passed in string, or if the string is empty, the value of defaultStr. -func DefaultString(str string, defaultStr string) string { - if IsEmpty(str) { - return defaultStr - } - return str -} - -// Returns either the passed in string, or if the string is whitespace, empty (""), the value of defaultStr. -func DefaultIfBlank(str string, defaultStr string) string { - if IsBlank(str) { - return defaultStr - } - return str -} diff --git a/vendor/github.com/Masterminds/goutils/wordutils.go b/vendor/github.com/Masterminds/goutils/wordutils.go deleted file mode 100644 index 034cad8e21..0000000000 --- a/vendor/github.com/Masterminds/goutils/wordutils.go +++ /dev/null @@ -1,357 +0,0 @@ -/* -Copyright 2014 Alexander Okoli - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* -Package goutils provides utility functions to manipulate strings in various ways. -The code snippets below show examples of how to use goutils. Some functions return -errors while others do not, so usage would vary as a result. - -Example: - - package main - - import ( - "fmt" - "github.com/aokoli/goutils" - ) - - func main() { - - // EXAMPLE 1: A goutils function which returns no errors - fmt.Println (goutils.Initials("John Doe Foo")) // Prints out "JDF" - - - - // EXAMPLE 2: A goutils function which returns an error - rand1, err1 := goutils.Random (-1, 0, 0, true, true) - - if err1 != nil { - fmt.Println(err1) // Prints out error message because -1 was entered as the first parameter in goutils.Random(...) - } else { - fmt.Println(rand1) - } - } -*/ -package goutils - -import ( - "bytes" - "strings" - "unicode" -) - -// VERSION indicates the current version of goutils -const VERSION = "1.0.0" - -/* -Wrap wraps a single line of text, identifying words by ' '. -New lines will be separated by '\n'. Very long words, such as URLs will not be wrapped. -Leading spaces on a new line are stripped. Trailing spaces are not stripped. - -Parameters: - str - the string to be word wrapped - wrapLength - the column (a column can fit only one character) to wrap the words at, less than 1 is treated as 1 - -Returns: - a line with newlines inserted -*/ -func Wrap(str string, wrapLength int) string { - return WrapCustom(str, wrapLength, "", false) -} - -/* -WrapCustom wraps a single line of text, identifying words by ' '. -Leading spaces on a new line are stripped. Trailing spaces are not stripped. - -Parameters: - str - the string to be word wrapped - wrapLength - the column number (a column can fit only one character) to wrap the words at, less than 1 is treated as 1 - newLineStr - the string to insert for a new line, "" uses '\n' - wrapLongWords - true if long words (such as URLs) should be wrapped - -Returns: - a line with newlines inserted -*/ -func WrapCustom(str string, wrapLength int, newLineStr string, wrapLongWords bool) string { - - if str == "" { - return "" - } - if newLineStr == "" { - newLineStr = "\n" // TODO Assumes "\n" is seperator. Explore SystemUtils.LINE_SEPARATOR from Apache Commons - } - if wrapLength < 1 { - wrapLength = 1 - } - - inputLineLength := len(str) - offset := 0 - - var wrappedLine bytes.Buffer - - for inputLineLength-offset > wrapLength { - - if rune(str[offset]) == ' ' { - offset++ - continue - } - - end := wrapLength + offset + 1 - spaceToWrapAt := strings.LastIndex(str[offset:end], " ") + offset - - if spaceToWrapAt >= offset { - // normal word (not longer than wrapLength) - wrappedLine.WriteString(str[offset:spaceToWrapAt]) - wrappedLine.WriteString(newLineStr) - offset = spaceToWrapAt + 1 - - } else { - // long word or URL - if wrapLongWords { - end := wrapLength + offset - // long words are wrapped one line at a time - wrappedLine.WriteString(str[offset:end]) - wrappedLine.WriteString(newLineStr) - offset += wrapLength - } else { - // long words aren't wrapped, just extended beyond limit - end := wrapLength + offset - index := strings.IndexRune(str[end:len(str)], ' ') - if index == -1 { - wrappedLine.WriteString(str[offset:len(str)]) - offset = inputLineLength - } else { - spaceToWrapAt = index + end - wrappedLine.WriteString(str[offset:spaceToWrapAt]) - wrappedLine.WriteString(newLineStr) - offset = spaceToWrapAt + 1 - } - } - } - } - - wrappedLine.WriteString(str[offset:len(str)]) - - return wrappedLine.String() - -} - -/* -Capitalize capitalizes all the delimiter separated words in a string. Only the first letter of each word is changed. -To convert the rest of each word to lowercase at the same time, use CapitalizeFully(str string, delimiters ...rune). -The delimiters represent a set of characters understood to separate words. The first string character -and the first non-delimiter character after a delimiter will be capitalized. A "" input string returns "". -Capitalization uses the Unicode title case, normally equivalent to upper case. - -Parameters: - str - the string to capitalize - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - capitalized string -*/ -func Capitalize(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - - buffer := []rune(str) - capitalizeNext := true - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if isDelimiter(ch, delimiters...) { - capitalizeNext = true - } else if capitalizeNext { - buffer[i] = unicode.ToTitle(ch) - capitalizeNext = false - } - } - return string(buffer) - -} - -/* -CapitalizeFully converts all the delimiter separated words in a string into capitalized words, that is each word is made up of a -titlecase character and then a series of lowercase characters. The delimiters represent a set of characters understood -to separate words. The first string character and the first non-delimiter character after a delimiter will be capitalized. -Capitalization uses the Unicode title case, normally equivalent to upper case. - -Parameters: - str - the string to capitalize fully - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - capitalized string -*/ -func CapitalizeFully(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - str = strings.ToLower(str) - return Capitalize(str, delimiters...) -} - -/* -Uncapitalize uncapitalizes all the whitespace separated words in a string. Only the first letter of each word is changed. -The delimiters represent a set of characters understood to separate words. The first string character and the first non-delimiter -character after a delimiter will be uncapitalized. Whitespace is defined by unicode.IsSpace(char). - -Parameters: - str - the string to uncapitalize fully - delimiters - set of characters to determine capitalization, exclusion of this parameter means whitespace would be delimeter - -Returns: - uncapitalized string -*/ -func Uncapitalize(str string, delimiters ...rune) string { - - var delimLen int - - if delimiters == nil { - delimLen = -1 - } else { - delimLen = len(delimiters) - } - - if str == "" || delimLen == 0 { - return str - } - - buffer := []rune(str) - uncapitalizeNext := true // TODO Always makes capitalize/un apply to first char. - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if isDelimiter(ch, delimiters...) { - uncapitalizeNext = true - } else if uncapitalizeNext { - buffer[i] = unicode.ToLower(ch) - uncapitalizeNext = false - } - } - return string(buffer) -} - -/* -SwapCase swaps the case of a string using a word based algorithm. - -Conversion algorithm: - - Upper case character converts to Lower case - Title case character converts to Lower case - Lower case character after Whitespace or at start converts to Title case - Other Lower case character converts to Upper case - Whitespace is defined by unicode.IsSpace(char). - -Parameters: - str - the string to swap case - -Returns: - the changed string -*/ -func SwapCase(str string) string { - if str == "" { - return str - } - buffer := []rune(str) - - whitespace := true - - for i := 0; i < len(buffer); i++ { - ch := buffer[i] - if unicode.IsUpper(ch) { - buffer[i] = unicode.ToLower(ch) - whitespace = false - } else if unicode.IsTitle(ch) { - buffer[i] = unicode.ToLower(ch) - whitespace = false - } else if unicode.IsLower(ch) { - if whitespace { - buffer[i] = unicode.ToTitle(ch) - whitespace = false - } else { - buffer[i] = unicode.ToUpper(ch) - } - } else { - whitespace = unicode.IsSpace(ch) - } - } - return string(buffer) -} - -/* -Initials extracts the initial letters from each word in the string. The first letter of the string and all first -letters after the defined delimiters are returned as a new string. Their case is not changed. If the delimiters -parameter is excluded, then Whitespace is used. Whitespace is defined by unicode.IsSpacea(char). An empty delimiter array returns an empty string. - -Parameters: - str - the string to get initials from - delimiters - set of characters to determine words, exclusion of this parameter means whitespace would be delimeter -Returns: - string of initial letters -*/ -func Initials(str string, delimiters ...rune) string { - if str == "" { - return str - } - if delimiters != nil && len(delimiters) == 0 { - return "" - } - strLen := len(str) - var buf bytes.Buffer - lastWasGap := true - for i := 0; i < strLen; i++ { - ch := rune(str[i]) - - if isDelimiter(ch, delimiters...) { - lastWasGap = true - } else if lastWasGap { - buf.WriteRune(ch) - lastWasGap = false - } - } - return buf.String() -} - -// private function (lower case func name) -func isDelimiter(ch rune, delimiters ...rune) bool { - if delimiters == nil { - return unicode.IsSpace(ch) - } - for _, delimiter := range delimiters { - if ch == delimiter { - return true - } - } - return false -} diff --git a/vendor/github.com/Masterminds/semver/.travis.yml b/vendor/github.com/Masterminds/semver/.travis.yml deleted file mode 100644 index 096369d44d..0000000000 --- a/vendor/github.com/Masterminds/semver/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: go - -go: - - 1.6.x - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - tip - -# Setting sudo access to false will let Travis CI use containers rather than -# VMs to run the tests. For more details see: -# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ -# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ -sudo: false - -script: - - make setup - - make test - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/06e3328629952dabe3e0 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/semver/CHANGELOG.md b/vendor/github.com/Masterminds/semver/CHANGELOG.md deleted file mode 100644 index e405c9a84d..0000000000 --- a/vendor/github.com/Masterminds/semver/CHANGELOG.md +++ /dev/null @@ -1,109 +0,0 @@ -# 1.5.0 (2019-09-11) - -## Added - -- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) - -## Changed - -- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) -- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) -- #72: Adding docs comment pointing to vert for a cli -- #71: Update the docs on pre-release comparator handling -- #89: Test with new go versions (thanks @thedevsaddam) -- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) - -## Fixed - -- #78: Fix unchecked error in example code (thanks @ravron) -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case -- #97: Fixed copyright file for proper display on GitHub -- #107: Fix handling prerelease when sorting alphanum and num -- #109: Fixed where Validate sometimes returns wrong message on error - -# 1.4.2 (2018-04-10) - -## Changed -- #72: Updated the docs to point to vert for a console appliaction -- #71: Update the docs on pre-release comparator handling - -## Fixed -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case - -# 1.4.1 (2018-04-02) - -## Fixed -- Fixed #64: Fix pre-release precedence issue (thanks @uudashr) - -# 1.4.0 (2017-10-04) - -## Changed -- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) - -# 1.3.1 (2017-07-10) - -## Fixed -- Fixed #57: number comparisons in prerelease sometimes inaccurate - -# 1.3.0 (2017-05-02) - -## Added -- #45: Added json (un)marshaling support (thanks @mh-cbon) -- Stability marker. See https://masterminds.github.io/stability/ - -## Fixed -- #51: Fix handling of single digit tilde constraint (thanks @dgodd) - -## Changed -- #55: The godoc icon moved from png to svg - -# 1.2.3 (2017-04-03) - -## Fixed -- #46: Fixed 0.x.x and 0.0.x in constraints being treated as * - -# Release 1.2.2 (2016-12-13) - -## Fixed -- #34: Fixed issue where hyphen range was not working with pre-release parsing. - -# Release 1.2.1 (2016-11-28) - -## Fixed -- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" - properly. - -# Release 1.2.0 (2016-11-04) - -## Added -- #20: Added MustParse function for versions (thanks @adamreese) -- #15: Added increment methods on versions (thanks @mh-cbon) - -## Fixed -- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and - might not satisfy the intended compatibility. The change here ignores pre-releases - on constraint checks (e.g., ~ or ^) when a pre-release is not part of the - constraint. For example, `^1.2.3` will ignore pre-releases while - `^1.2.3-alpha` will include them. - -# Release 1.1.1 (2016-06-30) - -## Changed -- Issue #9: Speed up version comparison performance (thanks @sdboyer) -- Issue #8: Added benchmarks (thanks @sdboyer) -- Updated Go Report Card URL to new location -- Updated Readme to add code snippet formatting (thanks @mh-cbon) -- Updating tagging to v[SemVer] structure for compatibility with other tools. - -# Release 1.1.0 (2016-03-11) - -- Issue #2: Implemented validation to provide reasons a versions failed a - constraint. - -# Release 1.0.1 (2015-12-31) - -- Fixed #1: * constraint failing on valid versions. - -# Release 1.0.0 (2015-10-20) - -- Initial release diff --git a/vendor/github.com/Masterminds/semver/LICENSE.txt b/vendor/github.com/Masterminds/semver/LICENSE.txt deleted file mode 100644 index 9ff7da9c48..0000000000 --- a/vendor/github.com/Masterminds/semver/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014-2019, Matt Butcher and Matt Farina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/semver/Makefile b/vendor/github.com/Masterminds/semver/Makefile deleted file mode 100644 index a7a1b4e36d..0000000000 --- a/vendor/github.com/Masterminds/semver/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -.PHONY: setup -setup: - go get -u gopkg.in/alecthomas/gometalinter.v1 - gometalinter.v1 --install - -.PHONY: test -test: validate lint - @echo "==> Running tests" - go test -v - -.PHONY: validate -validate: - @echo "==> Running static validations" - @gometalinter.v1 \ - --disable-all \ - --enable deadcode \ - --severity deadcode:error \ - --enable gofmt \ - --enable gosimple \ - --enable ineffassign \ - --enable misspell \ - --enable vet \ - --tests \ - --vendor \ - --deadline 60s \ - ./... || exit_code=1 - -.PHONY: lint -lint: - @echo "==> Running linters" - @gometalinter.v1 \ - --disable-all \ - --enable golint \ - --vendor \ - --deadline 60s \ - ./... || : diff --git a/vendor/github.com/Masterminds/semver/README.md b/vendor/github.com/Masterminds/semver/README.md deleted file mode 100644 index 1b52d2f436..0000000000 --- a/vendor/github.com/Masterminds/semver/README.md +++ /dev/null @@ -1,194 +0,0 @@ -# SemVer - -The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: - -* Parse semantic versions -* Sort semantic versions -* Check if a semantic version fits within a set of constraints -* Optionally work with a `v` prefix - -[![Stability: -Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) -[![Build Status](https://travis-ci.org/Masterminds/semver.svg)](https://travis-ci.org/Masterminds/semver) [![Build status](https://ci.appveyor.com/api/projects/status/jfk66lib7hb985k8/branch/master?svg=true&passingText=windows%20build%20passing&failingText=windows%20build%20failing)](https://ci.appveyor.com/project/mattfarina/semver/branch/master) [![GoDoc](https://godoc.org/github.com/Masterminds/semver?status.svg)](https://godoc.org/github.com/Masterminds/semver) [![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) - -If you are looking for a command line tool for version comparisons please see -[vert](https://github.com/Masterminds/vert) which uses this library. - -## Parsing Semantic Versions - -To parse a semantic version use the `NewVersion` function. For example, - -```go - v, err := semver.NewVersion("1.2.3-beta.1+build345") -``` - -If there is an error the version wasn't parseable. The version object has methods -to get the parts of the version, compare it to other versions, convert the -version back into a string, and get the original string. For more details -please see the [documentation](https://godoc.org/github.com/Masterminds/semver). - -## Sorting Semantic Versions - -A set of versions can be sorted using the [`sort`](https://golang.org/pkg/sort/) -package from the standard library. For example, - -```go - raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} - vs := make([]*semver.Version, len(raw)) - for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v - } - - sort.Sort(semver.Collection(vs)) -``` - -## Checking Version Constraints - -Checking a version against version constraints is one of the most featureful -parts of the package. - -```go - c, err := semver.NewConstraint(">= 1.2.3") - if err != nil { - // Handle constraint not being parseable. - } - - v, _ := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) -``` - -## Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of comma separated and comparisons. These are then separated by || separated or -comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. - -The basic comparisons are: - -* `=`: equal (aliased to no operator) -* `!=`: not equal -* `>`: greater than -* `<`: less than -* `>=`: greater than or equal to -* `<=`: less than or equal to - -## Working With Pre-release Versions - -Pre-releases, for those not familiar with them, are used for software releases -prior to stable or generally available releases. Examples of pre-releases include -development, alpha, beta, and release candidate releases. A pre-release may be -a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the -order of precidence, pre-releases come before their associated releases. In this -example `1.2.3-beta.1 < 1.2.3`. - -According to the Semantic Version specification pre-releases may not be -API compliant with their release counterpart. It says, - -> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. - -SemVer comparisons without a pre-release comparator will skip pre-release versions. -For example, `>=1.2.3` will skip pre-releases when looking at a list of releases -while `>=1.2.3-0` will evaluate and find pre-releases. - -The reason for the `0` as a pre-release version in the example comparison is -because pre-releases can only contain ASCII alphanumerics and hyphens (along with -`.` separators), per the spec. Sorting happens in ASCII sort order, again per the spec. The lowest character is a `0` in ASCII sort order (see an [ASCII Table](http://www.asciitable.com/)) - -Understanding ASCII sort ordering is important because A-Z comes before a-z. That -means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case -sensitivity doesn't apply here. This is due to ASCII sort ordering which is what -the spec specifies. - -## Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - -* `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` -* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5` - -## Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the pack level comparison (see tilde below). For example, - -* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `>= 1.2.x` is equivalent to `>= 1.2.0` -* `<= 2.x` is equivalent to `< 3` -* `*` is equivalent to `>= 0.0.0` - -## Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - -* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` -* `~1` is equivalent to `>= 1, < 2` -* `~2.3` is equivalent to `>= 2.3, < 2.4` -* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `~1.x` is equivalent to `>= 1, < 2` - -## Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes. This is useful -when comparisons of API versions as a major change is API breaking. For example, - -* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` -* `^0.0.1` is equivalent to `>= 0.0.1, < 1.0.0` -* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` -* `^2.3` is equivalent to `>= 2.3, < 3` -* `^2.x` is equivalent to `>= 2.0.0, < 3` - -# Validation - -In addition to testing a version against a constraint, a version can be validated -against a constraint. When validation fails a slice of errors containing why a -version didn't meet the constraint is returned. For example, - -```go - c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") - if err != nil { - // Handle constraint not being parseable. - } - - v, _ := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - - // Validate a version against a constraint. - a, msgs := c.Validate(v) - // a is false - for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" - } -``` - -# Fuzzing - - [dvyukov/go-fuzz](https://github.com/dvyukov/go-fuzz) is used for fuzzing. - -1. `go-fuzz-build` -2. `go-fuzz -workdir=fuzz` - -# Contribute - -If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) -or [create a pull request](https://github.com/Masterminds/semver/pulls). diff --git a/vendor/github.com/Masterminds/semver/appveyor.yml b/vendor/github.com/Masterminds/semver/appveyor.yml deleted file mode 100644 index b2778df15a..0000000000 --- a/vendor/github.com/Masterminds/semver/appveyor.yml +++ /dev/null @@ -1,44 +0,0 @@ -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\Masterminds\semver -shallow_clone: true - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -install: - - go version - - go env - - go get -u gopkg.in/alecthomas/gometalinter.v1 - - set PATH=%PATH%;%GOPATH%\bin - - gometalinter.v1.exe --install - -build_script: - - go install -v ./... - -test_script: - - "gometalinter.v1 \ - --disable-all \ - --enable deadcode \ - --severity deadcode:error \ - --enable gofmt \ - --enable gosimple \ - --enable ineffassign \ - --enable misspell \ - --enable vet \ - --tests \ - --vendor \ - --deadline 60s \ - ./... || exit_code=1" - - "gometalinter.v1 \ - --disable-all \ - --enable golint \ - --vendor \ - --deadline 60s \ - ./... || :" - - go test -v - -deploy: off diff --git a/vendor/github.com/Masterminds/semver/collection.go b/vendor/github.com/Masterminds/semver/collection.go deleted file mode 100644 index a78235895f..0000000000 --- a/vendor/github.com/Masterminds/semver/collection.go +++ /dev/null @@ -1,24 +0,0 @@ -package semver - -// Collection is a collection of Version instances and implements the sort -// interface. See the sort package for more details. -// https://golang.org/pkg/sort/ -type Collection []*Version - -// Len returns the length of a collection. The number of Version instances -// on the slice. -func (c Collection) Len() int { - return len(c) -} - -// Less is needed for the sort interface to compare two Version objects on the -// slice. If checks if one is less than the other. -func (c Collection) Less(i, j int) bool { - return c[i].LessThan(c[j]) -} - -// Swap is needed for the sort interface to replace the Version objects -// at two different positions in the slice. -func (c Collection) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} diff --git a/vendor/github.com/Masterminds/semver/constraints.go b/vendor/github.com/Masterminds/semver/constraints.go deleted file mode 100644 index b94b93413f..0000000000 --- a/vendor/github.com/Masterminds/semver/constraints.go +++ /dev/null @@ -1,423 +0,0 @@ -package semver - -import ( - "errors" - "fmt" - "regexp" - "strings" -) - -// Constraints is one or more constraint that a semantic version can be -// checked against. -type Constraints struct { - constraints [][]*constraint -} - -// NewConstraint returns a Constraints instance that a Version instance can -// be checked against. If there is a parse error it will be returned. -func NewConstraint(c string) (*Constraints, error) { - - // Rewrite - ranges into a comparison operation. - c = rewriteRange(c) - - ors := strings.Split(c, "||") - or := make([][]*constraint, len(ors)) - for k, v := range ors { - cs := strings.Split(v, ",") - result := make([]*constraint, len(cs)) - for i, s := range cs { - pc, err := parseConstraint(s) - if err != nil { - return nil, err - } - - result[i] = pc - } - or[k] = result - } - - o := &Constraints{constraints: or} - return o, nil -} - -// Check tests if a version satisfies the constraints. -func (cs Constraints) Check(v *Version) bool { - // loop over the ORs and check the inner ANDs - for _, o := range cs.constraints { - joy := true - for _, c := range o { - if !c.check(v) { - joy = false - break - } - } - - if joy { - return true - } - } - - return false -} - -// Validate checks if a version satisfies a constraint. If not a slice of -// reasons for the failure are returned in addition to a bool. -func (cs Constraints) Validate(v *Version) (bool, []error) { - // loop over the ORs and check the inner ANDs - var e []error - - // Capture the prerelease message only once. When it happens the first time - // this var is marked - var prerelesase bool - for _, o := range cs.constraints { - joy := true - for _, c := range o { - // Before running the check handle the case there the version is - // a prerelease and the check is not searching for prereleases. - if c.con.pre == "" && v.pre != "" { - if !prerelesase { - em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - e = append(e, em) - prerelesase = true - } - joy = false - - } else { - - if !c.check(v) { - em := fmt.Errorf(c.msg, v, c.orig) - e = append(e, em) - joy = false - } - } - } - - if joy { - return true, []error{} - } - } - - return false, e -} - -var constraintOps map[string]cfunc -var constraintMsg map[string]string -var constraintRegex *regexp.Regexp - -func init() { - constraintOps = map[string]cfunc{ - "": constraintTildeOrEqual, - "=": constraintTildeOrEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "=>": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "=<": constraintLessThanEqual, - "~": constraintTilde, - "~>": constraintTilde, - "^": constraintCaret, - } - - constraintMsg = map[string]string{ - "": "%s is not equal to %s", - "=": "%s is not equal to %s", - "!=": "%s is equal to %s", - ">": "%s is less than or equal to %s", - "<": "%s is greater than or equal to %s", - ">=": "%s is less than %s", - "=>": "%s is less than %s", - "<=": "%s is greater than %s", - "=<": "%s is greater than %s", - "~": "%s does not have same major and minor version as %s", - "~>": "%s does not have same major and minor version as %s", - "^": "%s does not have same major version as %s", - } - - ops := make([]string, 0, len(constraintOps)) - for k := range constraintOps { - ops = append(ops, regexp.QuoteMeta(k)) - } - - constraintRegex = regexp.MustCompile(fmt.Sprintf( - `^\s*(%s)\s*(%s)\s*$`, - strings.Join(ops, "|"), - cvRegex)) - - constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( - `\s*(%s)\s+-\s+(%s)\s*`, - cvRegex, cvRegex)) -} - -// An individual constraint -type constraint struct { - // The callback function for the restraint. It performs the logic for - // the constraint. - function cfunc - - msg string - - // The version used in the constraint check. For example, if a constraint - // is '<= 2.0.0' the con a version instance representing 2.0.0. - con *Version - - // The original parsed version (e.g., 4.x from != 4.x) - orig string - - // When an x is used as part of the version (e.g., 1.x) - minorDirty bool - dirty bool - patchDirty bool -} - -// Check if a version meets the constraint -func (c *constraint) check(v *Version) bool { - return c.function(v, c) -} - -type cfunc func(v *Version, c *constraint) bool - -func parseConstraint(c string) (*constraint, error) { - m := constraintRegex.FindStringSubmatch(c) - if m == nil { - return nil, fmt.Errorf("improper constraint: %s", c) - } - - ver := m[2] - orig := ver - minorDirty := false - patchDirty := false - dirty := false - if isX(m[3]) { - ver = "0.0.0" - dirty = true - } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { - minorDirty = true - dirty = true - ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) - } else if isX(strings.TrimPrefix(m[5], ".")) { - dirty = true - patchDirty = true - ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) - } - - con, err := NewVersion(ver) - if err != nil { - - // The constraintRegex should catch any regex parsing errors. So, - // we should never get here. - return nil, errors.New("constraint Parser Error") - } - - cs := &constraint{ - function: constraintOps[m[1]], - msg: constraintMsg[m[1]], - con: con, - orig: orig, - minorDirty: minorDirty, - patchDirty: patchDirty, - dirty: dirty, - } - return cs, nil -} - -// Constraint functions -func constraintNotEqual(v *Version, c *constraint) bool { - if c.dirty { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if c.con.Major() != v.Major() { - return true - } - if c.con.Minor() != v.Minor() && !c.minorDirty { - return true - } else if c.minorDirty { - return false - } - - return false - } - - return !v.Equal(c.con) -} - -func constraintGreaterThan(v *Version, c *constraint) bool { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - return v.Compare(c.con) == 1 -} - -func constraintLessThan(v *Version, c *constraint) bool { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if !c.dirty { - return v.Compare(c.con) < 0 - } - - if v.Major() > c.con.Major() { - return false - } else if v.Minor() > c.con.Minor() && !c.minorDirty { - return false - } - - return true -} - -func constraintGreaterThanEqual(v *Version, c *constraint) bool { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - return v.Compare(c.con) >= 0 -} - -func constraintLessThanEqual(v *Version, c *constraint) bool { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if !c.dirty { - return v.Compare(c.con) <= 0 - } - - if v.Major() > c.con.Major() { - return false - } else if v.Minor() > c.con.Minor() && !c.minorDirty { - return false - } - - return true -} - -// ~*, ~>* --> >= 0.0.0 (any) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 -func constraintTilde(v *Version, c *constraint) bool { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if v.LessThan(c.con) { - return false - } - - // ~0.0.0 is a special case where all constraints are accepted. It's - // equivalent to >= 0.0.0. - if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && - !c.minorDirty && !c.patchDirty { - return true - } - - if v.Major() != c.con.Major() { - return false - } - - if v.Minor() != c.con.Minor() && !c.minorDirty { - return false - } - - return true -} - -// When there is a .x (dirty) status it automatically opts in to ~. Otherwise -// it's a straight = -func constraintTildeOrEqual(v *Version, c *constraint) bool { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if c.dirty { - c.msg = constraintMsg["~"] - return constraintTilde(v, c) - } - - return v.Equal(c.con) -} - -// ^* --> (any) -// ^2, ^2.x, ^2.x.x --> >=2.0.0, <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0, <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0, <2.0.0 -// ^1.2.3 --> >=1.2.3, <2.0.0 -// ^1.2.0 --> >=1.2.0, <2.0.0 -func constraintCaret(v *Version, c *constraint) bool { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false - } - - if v.LessThan(c.con) { - return false - } - - if v.Major() != c.con.Major() { - return false - } - - return true -} - -var constraintRangeRegex *regexp.Regexp - -const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -func isX(x string) bool { - switch x { - case "x", "*", "X": - return true - default: - return false - } -} - -func rewriteRange(i string) string { - m := constraintRangeRegex.FindAllStringSubmatch(i, -1) - if m == nil { - return i - } - o := i - for _, v := range m { - t := fmt.Sprintf(">= %s, <= %s", v[1], v[11]) - o = strings.Replace(o, v[0], t, 1) - } - - return o -} diff --git a/vendor/github.com/Masterminds/semver/doc.go b/vendor/github.com/Masterminds/semver/doc.go deleted file mode 100644 index 6a6c24c6d6..0000000000 --- a/vendor/github.com/Masterminds/semver/doc.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. - -Specifically it provides the ability to: - - * Parse semantic versions - * Sort semantic versions - * Check if a semantic version fits within a set of constraints - * Optionally work with a `v` prefix - -Parsing Semantic Versions - -To parse a semantic version use the `NewVersion` function. For example, - - v, err := semver.NewVersion("1.2.3-beta.1+build345") - -If there is an error the version wasn't parseable. The version object has methods -to get the parts of the version, compare it to other versions, convert the -version back into a string, and get the original string. For more details -please see the documentation at https://godoc.org/github.com/Masterminds/semver. - -Sorting Semantic Versions - -A set of versions can be sorted using the `sort` package from the standard library. -For example, - - raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} - vs := make([]*semver.Version, len(raw)) - for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v - } - - sort.Sort(semver.Collection(vs)) - -Checking Version Constraints - -Checking a version against version constraints is one of the most featureful -parts of the package. - - c, err := semver.NewConstraint(">= 1.2.3") - if err != nil { - // Handle constraint not being parseable. - } - - v, err := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) - -Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of comma separated and comparisons. These are then separated by || separated or -comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. - -The basic comparisons are: - - * `=`: equal (aliased to no operator) - * `!=`: not equal - * `>`: greater than - * `<`: less than - * `>=`: greater than or equal to - * `<=`: less than or equal to - -Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - - * `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` - * `2.3.4 - 4.5` which is equivalent to `>= 2.3.4, <= 4.5` - -Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the pack level comparison (see tilde below). For example, - - * `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` - * `>= 1.2.x` is equivalent to `>= 1.2.0` - * `<= 2.x` is equivalent to `<= 3` - * `*` is equivalent to `>= 0.0.0` - -Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - - * `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` - * `~1` is equivalent to `>= 1, < 2` - * `~2.3` is equivalent to `>= 2.3, < 2.4` - * `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` - * `~1.x` is equivalent to `>= 1, < 2` - -Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes. This is useful -when comparisons of API versions as a major change is API breaking. For example, - - * `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` - * `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` - * `^2.3` is equivalent to `>= 2.3, < 3` - * `^2.x` is equivalent to `>= 2.0.0, < 3` -*/ -package semver diff --git a/vendor/github.com/Masterminds/semver/v3/.gitignore b/vendor/github.com/Masterminds/semver/v3/.gitignore deleted file mode 100644 index 6b061e6174..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_fuzz/ \ No newline at end of file diff --git a/vendor/github.com/Masterminds/semver/v3/.golangci.yml b/vendor/github.com/Masterminds/semver/v3/.golangci.yml deleted file mode 100644 index fbc6332592..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/.golangci.yml +++ /dev/null @@ -1,27 +0,0 @@ -run: - deadline: 2m - -linters: - disable-all: true - enable: - - misspell - - govet - - staticcheck - - errcheck - - unparam - - ineffassign - - nakedret - - gocyclo - - dupl - - goimports - - revive - - gosec - - gosimple - - typecheck - - unused - -linters-settings: - gofmt: - simplify: true - dupl: - threshold: 600 diff --git a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md b/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md deleted file mode 100644 index f12626423a..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/CHANGELOG.md +++ /dev/null @@ -1,214 +0,0 @@ -# Changelog - -## 3.2.0 (2022-11-28) - -### Added - -- #190: Added text marshaling and unmarshaling -- #167: Added JSON marshalling for constraints (thanks @SimonTheLeg) -- #173: Implement encoding.TextMarshaler and encoding.TextUnmarshaler on Version (thanks @MarkRosemaker) -- #179: Added New() version constructor (thanks @kazhuravlev) - -### Changed - -- #182/#183: Updated CI testing setup - -### Fixed - -- #186: Fixing issue where validation of constraint section gave false positives -- #176: Fix constraints check with *-0 (thanks @mtt0) -- #181: Fixed Caret operator (^) gives unexpected results when the minor version in constraint is 0 (thanks @arshchimni) -- #161: Fixed godoc (thanks @afirth) - -## 3.1.1 (2020-11-23) - -### Fixed - -- #158: Fixed issue with generated regex operation order that could cause problem - -## 3.1.0 (2020-04-15) - -### Added - -- #131: Add support for serializing/deserializing SQL (thanks @ryancurrah) - -### Changed - -- #148: More accurate validation messages on constraints - -## 3.0.3 (2019-12-13) - -### Fixed - -- #141: Fixed issue with <= comparison - -## 3.0.2 (2019-11-14) - -### Fixed - -- #134: Fixed broken constraint checking with ^0.0 (thanks @krmichelos) - -## 3.0.1 (2019-09-13) - -### Fixed - -- #125: Fixes issue with module path for v3 - -## 3.0.0 (2019-09-12) - -This is a major release of the semver package which includes API changes. The Go -API is compatible with ^1. The Go API was not changed because many people are using -`go get` without Go modules for their applications and API breaking changes cause -errors which we have or would need to support. - -The changes in this release are the handling based on the data passed into the -functions. These are described in the added and changed sections below. - -### Added - -- StrictNewVersion function. This is similar to NewVersion but will return an - error if the version passed in is not a strict semantic version. For example, - 1.2.3 would pass but v1.2.3 or 1.2 would fail because they are not strictly - speaking semantic versions. This function is faster, performs fewer operations, - and uses fewer allocations than NewVersion. -- Fuzzing has been performed on NewVersion, StrictNewVersion, and NewConstraint. - The Makefile contains the operations used. For more information on you can start - on Wikipedia at https://en.wikipedia.org/wiki/Fuzzing -- Now using Go modules - -### Changed - -- NewVersion has proper prerelease and metadata validation with error messages - to signal an issue with either of them -- ^ now operates using a similar set of rules to npm/js and Rust/Cargo. If the - version is >=1 the ^ ranges works the same as v1. For major versions of 0 the - rules have changed. The minor version is treated as the stable version unless - a patch is specified and then it is equivalent to =. One difference from npm/js - is that prereleases there are only to a specific version (e.g. 1.2.3). - Prereleases here look over multiple versions and follow semantic version - ordering rules. This pattern now follows along with the expected and requested - handling of this packaged by numerous users. - -## 1.5.0 (2019-09-11) - -### Added - -- #103: Add basic fuzzing for `NewVersion()` (thanks @jesse-c) - -### Changed - -- #82: Clarify wildcard meaning in range constraints and update tests for it (thanks @greysteil) -- #83: Clarify caret operator range for pre-1.0.0 dependencies (thanks @greysteil) -- #72: Adding docs comment pointing to vert for a cli -- #71: Update the docs on pre-release comparator handling -- #89: Test with new go versions (thanks @thedevsaddam) -- #87: Added $ to ValidPrerelease for better validation (thanks @jeremycarroll) - -### Fixed - -- #78: Fix unchecked error in example code (thanks @ravron) -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case -- #97: Fixed copyright file for proper display on GitHub -- #107: Fix handling prerelease when sorting alphanum and num -- #109: Fixed where Validate sometimes returns wrong message on error - -## 1.4.2 (2018-04-10) - -### Changed - -- #72: Updated the docs to point to vert for a console appliaction -- #71: Update the docs on pre-release comparator handling - -### Fixed - -- #70: Fix the handling of pre-releases and the 0.0.0 release edge case - -## 1.4.1 (2018-04-02) - -### Fixed - -- Fixed #64: Fix pre-release precedence issue (thanks @uudashr) - -## 1.4.0 (2017-10-04) - -### Changed - -- #61: Update NewVersion to parse ints with a 64bit int size (thanks @zknill) - -## 1.3.1 (2017-07-10) - -### Fixed - -- Fixed #57: number comparisons in prerelease sometimes inaccurate - -## 1.3.0 (2017-05-02) - -### Added - -- #45: Added json (un)marshaling support (thanks @mh-cbon) -- Stability marker. See https://masterminds.github.io/stability/ - -### Fixed - -- #51: Fix handling of single digit tilde constraint (thanks @dgodd) - -### Changed - -- #55: The godoc icon moved from png to svg - -## 1.2.3 (2017-04-03) - -### Fixed - -- #46: Fixed 0.x.x and 0.0.x in constraints being treated as * - -## Release 1.2.2 (2016-12-13) - -### Fixed - -- #34: Fixed issue where hyphen range was not working with pre-release parsing. - -## Release 1.2.1 (2016-11-28) - -### Fixed - -- #24: Fixed edge case issue where constraint "> 0" does not handle "0.0.1-alpha" - properly. - -## Release 1.2.0 (2016-11-04) - -### Added - -- #20: Added MustParse function for versions (thanks @adamreese) -- #15: Added increment methods on versions (thanks @mh-cbon) - -### Fixed - -- Issue #21: Per the SemVer spec (section 9) a pre-release is unstable and - might not satisfy the intended compatibility. The change here ignores pre-releases - on constraint checks (e.g., ~ or ^) when a pre-release is not part of the - constraint. For example, `^1.2.3` will ignore pre-releases while - `^1.2.3-alpha` will include them. - -## Release 1.1.1 (2016-06-30) - -### Changed - -- Issue #9: Speed up version comparison performance (thanks @sdboyer) -- Issue #8: Added benchmarks (thanks @sdboyer) -- Updated Go Report Card URL to new location -- Updated Readme to add code snippet formatting (thanks @mh-cbon) -- Updating tagging to v[SemVer] structure for compatibility with other tools. - -## Release 1.1.0 (2016-03-11) - -- Issue #2: Implemented validation to provide reasons a versions failed a - constraint. - -## Release 1.0.1 (2015-12-31) - -- Fixed #1: * constraint failing on valid versions. - -## Release 1.0.0 (2015-10-20) - -- Initial release diff --git a/vendor/github.com/Masterminds/semver/v3/LICENSE.txt b/vendor/github.com/Masterminds/semver/v3/LICENSE.txt deleted file mode 100644 index 9ff7da9c48..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014-2019, Matt Butcher and Matt Farina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/semver/v3/Makefile b/vendor/github.com/Masterminds/semver/v3/Makefile deleted file mode 100644 index 0e7b5c7138..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -GOPATH=$(shell go env GOPATH) -GOLANGCI_LINT=$(GOPATH)/bin/golangci-lint - -.PHONY: lint -lint: $(GOLANGCI_LINT) - @echo "==> Linting codebase" - @$(GOLANGCI_LINT) run - -.PHONY: test -test: - @echo "==> Running tests" - GO111MODULE=on go test -v - -.PHONY: test-cover -test-cover: - @echo "==> Running Tests with coverage" - GO111MODULE=on go test -cover . - -.PHONY: fuzz -fuzz: - @echo "==> Running Fuzz Tests" - go test -fuzz=FuzzNewVersion -fuzztime=15s . - go test -fuzz=FuzzStrictNewVersion -fuzztime=15s . - go test -fuzz=FuzzNewConstraint -fuzztime=15s . - -$(GOLANGCI_LINT): - # Install golangci-lint. The configuration for it is in the .golangci.yml - # file in the root of the repository - echo ${GOPATH} - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.17.1 diff --git a/vendor/github.com/Masterminds/semver/v3/README.md b/vendor/github.com/Masterminds/semver/v3/README.md deleted file mode 100644 index eab8cac3b7..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/README.md +++ /dev/null @@ -1,258 +0,0 @@ -# SemVer - -The `semver` package provides the ability to work with [Semantic Versions](http://semver.org) in Go. Specifically it provides the ability to: - -* Parse semantic versions -* Sort semantic versions -* Check if a semantic version fits within a set of constraints -* Optionally work with a `v` prefix - -[![Stability: -Active](https://masterminds.github.io/stability/active.svg)](https://masterminds.github.io/stability/active.html) -[![](https://github.com/Masterminds/semver/workflows/Tests/badge.svg)](https://github.com/Masterminds/semver/actions) -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/semver/v3) -[![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/semver)](https://goreportcard.com/report/github.com/Masterminds/semver) - -If you are looking for a command line tool for version comparisons please see -[vert](https://github.com/Masterminds/vert) which uses this library. - -## Package Versions - -Note, import `github.com/github.com/Masterminds/semver/v3` to use the latest version. - -There are three major versions fo the `semver` package. - -* 3.x.x is the stable and active version. This version is focused on constraint - compatibility for range handling in other tools from other languages. It has - a similar API to the v1 releases. The development of this version is on the master - branch. The documentation for this version is below. -* 2.x was developed primarily for [dep](https://github.com/golang/dep). There are - no tagged releases and the development was performed by [@sdboyer](https://github.com/sdboyer). - There are API breaking changes from v1. This version lives on the [2.x branch](https://github.com/Masterminds/semver/tree/2.x). -* 1.x.x is the original release. It is no longer maintained. You should use the - v3 release instead. You can read the documentation for the 1.x.x release - [here](https://github.com/Masterminds/semver/blob/release-1/README.md). - -## Parsing Semantic Versions - -There are two functions that can parse semantic versions. The `StrictNewVersion` -function only parses valid version 2 semantic versions as outlined in the -specification. The `NewVersion` function attempts to coerce a version into a -semantic version and parse it. For example, if there is a leading v or a version -listed without all 3 parts (e.g. `v1.2`) it will attempt to coerce it into a valid -semantic version (e.g., 1.2.0). In both cases a `Version` object is returned -that can be sorted, compared, and used in constraints. - -When parsing a version an error is returned if there is an issue parsing the -version. For example, - - v, err := semver.NewVersion("1.2.3-beta.1+build345") - -The version object has methods to get the parts of the version, compare it to -other versions, convert the version back into a string, and get the original -string. Getting the original string is useful if the semantic version was coerced -into a valid form. - -## Sorting Semantic Versions - -A set of versions can be sorted using the `sort` package from the standard library. -For example, - -```go -raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} -vs := make([]*semver.Version, len(raw)) -for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v -} - -sort.Sort(semver.Collection(vs)) -``` - -## Checking Version Constraints - -There are two methods for comparing versions. One uses comparison methods on -`Version` instances and the other uses `Constraints`. There are some important -differences to notes between these two methods of comparison. - -1. When two versions are compared using functions such as `Compare`, `LessThan`, - and others it will follow the specification and always include prereleases - within the comparison. It will provide an answer that is valid with the - comparison section of the spec at https://semver.org/#spec-item-11 -2. When constraint checking is used for checks or validation it will follow a - different set of rules that are common for ranges with tools like npm/js - and Rust/Cargo. This includes considering prereleases to be invalid if the - ranges does not include one. If you want to have it include pre-releases a - simple solution is to include `-0` in your range. -3. Constraint ranges can have some complex rules including the shorthand use of - ~ and ^. For more details on those see the options below. - -There are differences between the two methods or checking versions because the -comparison methods on `Version` follow the specification while comparison ranges -are not part of the specification. Different packages and tools have taken it -upon themselves to come up with range rules. This has resulted in differences. -For example, npm/js and Cargo/Rust follow similar patterns while PHP has a -different pattern for ^. The comparison features in this package follow the -npm/js and Cargo/Rust lead because applications using it have followed similar -patters with their versions. - -Checking a version against version constraints is one of the most featureful -parts of the package. - -```go -c, err := semver.NewConstraint(">= 1.2.3") -if err != nil { - // Handle constraint not being parsable. -} - -v, err := semver.NewVersion("1.3") -if err != nil { - // Handle version not being parsable. -} -// Check if the version meets the constraints. The a variable will be true. -a := c.Check(v) -``` - -### Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of space or comma separated AND comparisons. These are then separated by || (OR) -comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. - -The basic comparisons are: - -* `=`: equal (aliased to no operator) -* `!=`: not equal -* `>`: greater than -* `<`: less than -* `>=`: greater than or equal to -* `<=`: less than or equal to - -### Working With Prerelease Versions - -Pre-releases, for those not familiar with them, are used for software releases -prior to stable or generally available releases. Examples of prereleases include -development, alpha, beta, and release candidate releases. A prerelease may be -a version such as `1.2.3-beta.1` while the stable release would be `1.2.3`. In the -order of precedence, prereleases come before their associated releases. In this -example `1.2.3-beta.1 < 1.2.3`. - -According to the Semantic Version specification prereleases may not be -API compliant with their release counterpart. It says, - -> A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. - -SemVer comparisons using constraints without a prerelease comparator will skip -prerelease versions. For example, `>=1.2.3` will skip prereleases when looking -at a list of releases while `>=1.2.3-0` will evaluate and find prereleases. - -The reason for the `0` as a pre-release version in the example comparison is -because pre-releases can only contain ASCII alphanumerics and hyphens (along with -`.` separators), per the spec. Sorting happens in ASCII sort order, again per the -spec. The lowest character is a `0` in ASCII sort order -(see an [ASCII Table](http://www.asciitable.com/)) - -Understanding ASCII sort ordering is important because A-Z comes before a-z. That -means `>=1.2.3-BETA` will return `1.2.3-alpha`. What you might expect from case -sensitivity doesn't apply here. This is due to ASCII sort ordering which is what -the spec specifies. - -### Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - -* `1.2 - 1.4.5` which is equivalent to `>= 1.2 <= 1.4.5` -* `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` - -### Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the patch level comparison (see tilde below). For example, - -* `1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `>= 1.2.x` is equivalent to `>= 1.2.0` -* `<= 2.x` is equivalent to `< 3` -* `*` is equivalent to `>= 0.0.0` - -### Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - -* `~1.2.3` is equivalent to `>= 1.2.3, < 1.3.0` -* `~1` is equivalent to `>= 1, < 2` -* `~2.3` is equivalent to `>= 2.3, < 2.4` -* `~1.2.x` is equivalent to `>= 1.2.0, < 1.3.0` -* `~1.x` is equivalent to `>= 1, < 2` - -### Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes once a stable -(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts -as the API stability level. This is useful when comparisons of API versions as a -major change is API breaking. For example, - -* `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` -* `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` -* `^2.3` is equivalent to `>= 2.3, < 3` -* `^2.x` is equivalent to `>= 2.0.0, < 3` -* `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` -* `^0.2` is equivalent to `>=0.2.0 <0.3.0` -* `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` -* `^0.0` is equivalent to `>=0.0.0 <0.1.0` -* `^0` is equivalent to `>=0.0.0 <1.0.0` - -## Validation - -In addition to testing a version against a constraint, a version can be validated -against a constraint. When validation fails a slice of errors containing why a -version didn't meet the constraint is returned. For example, - -```go -c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") -if err != nil { - // Handle constraint not being parseable. -} - -v, err := semver.NewVersion("1.3") -if err != nil { - // Handle version not being parseable. -} - -// Validate a version against a constraint. -a, msgs := c.Validate(v) -// a is false -for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" -} -``` - -## Contribute - -If you find an issue or want to contribute please file an [issue](https://github.com/Masterminds/semver/issues) -or [create a pull request](https://github.com/Masterminds/semver/pulls). - -## Security - -Security is an important consideration for this project. The project currently -uses the following tools to help discover security issues: - -* [CodeQL](https://github.com/Masterminds/semver) -* [gosec](https://github.com/securego/gosec) -* Daily Fuzz testing - -If you believe you have found a security vulnerability you can privately disclose -it through the [GitHub security page](https://github.com/Masterminds/semver/security). diff --git a/vendor/github.com/Masterminds/semver/v3/SECURITY.md b/vendor/github.com/Masterminds/semver/v3/SECURITY.md deleted file mode 100644 index a30a66b1f7..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/SECURITY.md +++ /dev/null @@ -1,19 +0,0 @@ -# Security Policy - -## Supported Versions - -The following versions of semver are currently supported: - -| Version | Supported | -| ------- | ------------------ | -| 3.x | :white_check_mark: | -| 2.x | :x: | -| 1.x | :x: | - -Fixes are only released for the latest minor version in the form of a patch release. - -## Reporting a Vulnerability - -You can privately disclose a vulnerability through GitHubs -[private vulnerability reporting](https://github.com/Masterminds/semver/security/advisories) -mechanism. diff --git a/vendor/github.com/Masterminds/semver/v3/collection.go b/vendor/github.com/Masterminds/semver/v3/collection.go deleted file mode 100644 index a78235895f..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/collection.go +++ /dev/null @@ -1,24 +0,0 @@ -package semver - -// Collection is a collection of Version instances and implements the sort -// interface. See the sort package for more details. -// https://golang.org/pkg/sort/ -type Collection []*Version - -// Len returns the length of a collection. The number of Version instances -// on the slice. -func (c Collection) Len() int { - return len(c) -} - -// Less is needed for the sort interface to compare two Version objects on the -// slice. If checks if one is less than the other. -func (c Collection) Less(i, j int) bool { - return c[i].LessThan(c[j]) -} - -// Swap is needed for the sort interface to replace the Version objects -// at two different positions in the slice. -func (c Collection) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} diff --git a/vendor/github.com/Masterminds/semver/v3/constraints.go b/vendor/github.com/Masterminds/semver/v3/constraints.go deleted file mode 100644 index 8461c7ed90..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/constraints.go +++ /dev/null @@ -1,594 +0,0 @@ -package semver - -import ( - "bytes" - "errors" - "fmt" - "regexp" - "strings" -) - -// Constraints is one or more constraint that a semantic version can be -// checked against. -type Constraints struct { - constraints [][]*constraint -} - -// NewConstraint returns a Constraints instance that a Version instance can -// be checked against. If there is a parse error it will be returned. -func NewConstraint(c string) (*Constraints, error) { - - // Rewrite - ranges into a comparison operation. - c = rewriteRange(c) - - ors := strings.Split(c, "||") - or := make([][]*constraint, len(ors)) - for k, v := range ors { - - // TODO: Find a way to validate and fetch all the constraints in a simpler form - - // Validate the segment - if !validConstraintRegex.MatchString(v) { - return nil, fmt.Errorf("improper constraint: %s", v) - } - - cs := findConstraintRegex.FindAllString(v, -1) - if cs == nil { - cs = append(cs, v) - } - result := make([]*constraint, len(cs)) - for i, s := range cs { - pc, err := parseConstraint(s) - if err != nil { - return nil, err - } - - result[i] = pc - } - or[k] = result - } - - o := &Constraints{constraints: or} - return o, nil -} - -// Check tests if a version satisfies the constraints. -func (cs Constraints) Check(v *Version) bool { - // TODO(mattfarina): For v4 of this library consolidate the Check and Validate - // functions as the underlying functions make that possible now. - // loop over the ORs and check the inner ANDs - for _, o := range cs.constraints { - joy := true - for _, c := range o { - if check, _ := c.check(v); !check { - joy = false - break - } - } - - if joy { - return true - } - } - - return false -} - -// Validate checks if a version satisfies a constraint. If not a slice of -// reasons for the failure are returned in addition to a bool. -func (cs Constraints) Validate(v *Version) (bool, []error) { - // loop over the ORs and check the inner ANDs - var e []error - - // Capture the prerelease message only once. When it happens the first time - // this var is marked - var prerelesase bool - for _, o := range cs.constraints { - joy := true - for _, c := range o { - // Before running the check handle the case there the version is - // a prerelease and the check is not searching for prereleases. - if c.con.pre == "" && v.pre != "" { - if !prerelesase { - em := fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - e = append(e, em) - prerelesase = true - } - joy = false - - } else { - - if _, err := c.check(v); err != nil { - e = append(e, err) - joy = false - } - } - } - - if joy { - return true, []error{} - } - } - - return false, e -} - -func (cs Constraints) String() string { - buf := make([]string, len(cs.constraints)) - var tmp bytes.Buffer - - for k, v := range cs.constraints { - tmp.Reset() - vlen := len(v) - for kk, c := range v { - tmp.WriteString(c.string()) - - // Space separate the AND conditions - if vlen > 1 && kk < vlen-1 { - tmp.WriteString(" ") - } - } - buf[k] = tmp.String() - } - - return strings.Join(buf, " || ") -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (cs *Constraints) UnmarshalText(text []byte) error { - temp, err := NewConstraint(string(text)) - if err != nil { - return err - } - - *cs = *temp - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (cs Constraints) MarshalText() ([]byte, error) { - return []byte(cs.String()), nil -} - -var constraintOps map[string]cfunc -var constraintRegex *regexp.Regexp -var constraintRangeRegex *regexp.Regexp - -// Used to find individual constraints within a multi-constraint string -var findConstraintRegex *regexp.Regexp - -// Used to validate an segment of ANDs is valid -var validConstraintRegex *regexp.Regexp - -const cvRegex string = `v?([0-9|x|X|\*]+)(\.[0-9|x|X|\*]+)?(\.[0-9|x|X|\*]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -func init() { - constraintOps = map[string]cfunc{ - "": constraintTildeOrEqual, - "=": constraintTildeOrEqual, - "!=": constraintNotEqual, - ">": constraintGreaterThan, - "<": constraintLessThan, - ">=": constraintGreaterThanEqual, - "=>": constraintGreaterThanEqual, - "<=": constraintLessThanEqual, - "=<": constraintLessThanEqual, - "~": constraintTilde, - "~>": constraintTilde, - "^": constraintCaret, - } - - ops := `=||!=|>|<|>=|=>|<=|=<|~|~>|\^` - - constraintRegex = regexp.MustCompile(fmt.Sprintf( - `^\s*(%s)\s*(%s)\s*$`, - ops, - cvRegex)) - - constraintRangeRegex = regexp.MustCompile(fmt.Sprintf( - `\s*(%s)\s+-\s+(%s)\s*`, - cvRegex, cvRegex)) - - findConstraintRegex = regexp.MustCompile(fmt.Sprintf( - `(%s)\s*(%s)`, - ops, - cvRegex)) - - // The first time a constraint shows up will look slightly different from - // future times it shows up due to a leading space or comma in a given - // string. - validConstraintRegex = regexp.MustCompile(fmt.Sprintf( - `^(\s*(%s)\s*(%s)\s*)((?:\s+|,\s*)(%s)\s*(%s)\s*)*$`, - ops, - cvRegex, - ops, - cvRegex)) -} - -// An individual constraint -type constraint struct { - // The version used in the constraint check. For example, if a constraint - // is '<= 2.0.0' the con a version instance representing 2.0.0. - con *Version - - // The original parsed version (e.g., 4.x from != 4.x) - orig string - - // The original operator for the constraint - origfunc string - - // When an x is used as part of the version (e.g., 1.x) - minorDirty bool - dirty bool - patchDirty bool -} - -// Check if a version meets the constraint -func (c *constraint) check(v *Version) (bool, error) { - return constraintOps[c.origfunc](v, c) -} - -// String prints an individual constraint into a string -func (c *constraint) string() string { - return c.origfunc + c.orig -} - -type cfunc func(v *Version, c *constraint) (bool, error) - -func parseConstraint(c string) (*constraint, error) { - if len(c) > 0 { - m := constraintRegex.FindStringSubmatch(c) - if m == nil { - return nil, fmt.Errorf("improper constraint: %s", c) - } - - cs := &constraint{ - orig: m[2], - origfunc: m[1], - } - - ver := m[2] - minorDirty := false - patchDirty := false - dirty := false - if isX(m[3]) || m[3] == "" { - ver = fmt.Sprintf("0.0.0%s", m[6]) - dirty = true - } else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" { - minorDirty = true - dirty = true - ver = fmt.Sprintf("%s.0.0%s", m[3], m[6]) - } else if isX(strings.TrimPrefix(m[5], ".")) || m[5] == "" { - dirty = true - patchDirty = true - ver = fmt.Sprintf("%s%s.0%s", m[3], m[4], m[6]) - } - - con, err := NewVersion(ver) - if err != nil { - - // The constraintRegex should catch any regex parsing errors. So, - // we should never get here. - return nil, errors.New("constraint Parser Error") - } - - cs.con = con - cs.minorDirty = minorDirty - cs.patchDirty = patchDirty - cs.dirty = dirty - - return cs, nil - } - - // The rest is the special case where an empty string was passed in which - // is equivalent to * or >=0.0.0 - con, err := StrictNewVersion("0.0.0") - if err != nil { - - // The constraintRegex should catch any regex parsing errors. So, - // we should never get here. - return nil, errors.New("constraint Parser Error") - } - - cs := &constraint{ - con: con, - orig: c, - origfunc: "", - minorDirty: false, - patchDirty: false, - dirty: true, - } - return cs, nil -} - -// Constraint functions -func constraintNotEqual(v *Version, c *constraint) (bool, error) { - if c.dirty { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if c.con.Major() != v.Major() { - return true, nil - } - if c.con.Minor() != v.Minor() && !c.minorDirty { - return true, nil - } else if c.minorDirty { - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } else if c.con.Patch() != v.Patch() && !c.patchDirty { - return true, nil - } else if c.patchDirty { - // Need to handle prereleases if present - if v.Prerelease() != "" || c.con.Prerelease() != "" { - eq := comparePrerelease(v.Prerelease(), c.con.Prerelease()) != 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - } - - eq := v.Equal(c.con) - if eq { - return false, fmt.Errorf("%s is equal to %s", v, c.orig) - } - - return true, nil -} - -func constraintGreaterThan(v *Version, c *constraint) (bool, error) { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - var eq bool - - if !c.dirty { - eq = v.Compare(c.con) == 1 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } - - if v.Major() > c.con.Major() { - return true, nil - } else if v.Major() < c.con.Major() { - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } else if c.minorDirty { - // This is a range case such as >11. When the version is something like - // 11.1.0 is it not > 11. For that we would need 12 or higher - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } else if c.patchDirty { - // This is for ranges such as >11.1. A version of 11.1.1 is not greater - // which one of 11.2.1 is greater - eq = v.Minor() > c.con.Minor() - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) - } - - // If we have gotten here we are not comparing pre-preleases and can use the - // Compare function to accomplish that. - eq = v.Compare(c.con) == 1 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than or equal to %s", v, c.orig) -} - -func constraintLessThan(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - eq := v.Compare(c.con) < 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is greater than or equal to %s", v, c.orig) -} - -func constraintGreaterThanEqual(v *Version, c *constraint) (bool, error) { - - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - eq := v.Compare(c.con) >= 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is less than %s", v, c.orig) -} - -func constraintLessThanEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - var eq bool - - if !c.dirty { - eq = v.Compare(c.con) <= 0 - if eq { - return true, nil - } - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } - - if v.Major() > c.con.Major() { - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } else if v.Major() == c.con.Major() && v.Minor() > c.con.Minor() && !c.minorDirty { - return false, fmt.Errorf("%s is greater than %s", v, c.orig) - } - - return true, nil -} - -// ~*, ~>* --> >= 0.0.0 (any) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0, <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0, <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0, <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3, <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0, <1.3.0 -func constraintTilde(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if v.LessThan(c.con) { - return false, fmt.Errorf("%s is less than %s", v, c.orig) - } - - // ~0.0.0 is a special case where all constraints are accepted. It's - // equivalent to >= 0.0.0. - if c.con.Major() == 0 && c.con.Minor() == 0 && c.con.Patch() == 0 && - !c.minorDirty && !c.patchDirty { - return true, nil - } - - if v.Major() != c.con.Major() { - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - - if v.Minor() != c.con.Minor() && !c.minorDirty { - return false, fmt.Errorf("%s does not have same major and minor version as %s", v, c.orig) - } - - return true, nil -} - -// When there is a .x (dirty) status it automatically opts in to ~. Otherwise -// it's a straight = -func constraintTildeOrEqual(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - if c.dirty { - return constraintTilde(v, c) - } - - eq := v.Equal(c.con) - if eq { - return true, nil - } - - return false, fmt.Errorf("%s is not equal to %s", v, c.orig) -} - -// ^* --> (any) -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2 --> >=1.2.0 <2.0.0 -// ^1 --> >=1.0.0 <2.0.0 -// ^0.2.3 --> >=0.2.3 <0.3.0 -// ^0.2 --> >=0.2.0 <0.3.0 -// ^0.0.3 --> >=0.0.3 <0.0.4 -// ^0.0 --> >=0.0.0 <0.1.0 -// ^0 --> >=0.0.0 <1.0.0 -func constraintCaret(v *Version, c *constraint) (bool, error) { - // If there is a pre-release on the version but the constraint isn't looking - // for them assume that pre-releases are not compatible. See issue 21 for - // more details. - if v.Prerelease() != "" && c.con.Prerelease() == "" { - return false, fmt.Errorf("%s is a prerelease version and the constraint is only looking for release versions", v) - } - - // This less than handles prereleases - if v.LessThan(c.con) { - return false, fmt.Errorf("%s is less than %s", v, c.orig) - } - - var eq bool - - // ^ when the major > 0 is >=x.y.z < x+1 - if c.con.Major() > 0 || c.minorDirty { - - // ^ has to be within a major range for > 0. Everything less than was - // filtered out with the LessThan call above. This filters out those - // that greater but not within the same major range. - eq = v.Major() == c.con.Major() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - - // ^ when the major is 0 and minor > 0 is >=0.y.z < 0.y+1 - if c.con.Major() == 0 && v.Major() > 0 { - return false, fmt.Errorf("%s does not have same major version as %s", v, c.orig) - } - // If the con Minor is > 0 it is not dirty - if c.con.Minor() > 0 || c.patchDirty { - eq = v.Minor() == c.con.Minor() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not have same minor version as %s. Expected minor versions to match when constraint major version is 0", v, c.orig) - } - // ^ when the minor is 0 and minor > 0 is =0.0.z - if c.con.Minor() == 0 && v.Minor() > 0 { - return false, fmt.Errorf("%s does not have same minor version as %s", v, c.orig) - } - - // At this point the major is 0 and the minor is 0 and not dirty. The patch - // is not dirty so we need to check if they are equal. If they are not equal - eq = c.con.Patch() == v.Patch() - if eq { - return true, nil - } - return false, fmt.Errorf("%s does not equal %s. Expect version and constraint to equal when major and minor versions are 0", v, c.orig) -} - -func isX(x string) bool { - switch x { - case "x", "*", "X": - return true - default: - return false - } -} - -func rewriteRange(i string) string { - m := constraintRangeRegex.FindAllStringSubmatch(i, -1) - if m == nil { - return i - } - o := i - for _, v := range m { - t := fmt.Sprintf(">= %s, <= %s ", v[1], v[11]) - o = strings.Replace(o, v[0], t, 1) - } - - return o -} diff --git a/vendor/github.com/Masterminds/semver/v3/doc.go b/vendor/github.com/Masterminds/semver/v3/doc.go deleted file mode 100644 index 74f97caa57..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/doc.go +++ /dev/null @@ -1,184 +0,0 @@ -/* -Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. - -Specifically it provides the ability to: - - - Parse semantic versions - - Sort semantic versions - - Check if a semantic version fits within a set of constraints - - Optionally work with a `v` prefix - -# Parsing Semantic Versions - -There are two functions that can parse semantic versions. The `StrictNewVersion` -function only parses valid version 2 semantic versions as outlined in the -specification. The `NewVersion` function attempts to coerce a version into a -semantic version and parse it. For example, if there is a leading v or a version -listed without all 3 parts (e.g. 1.2) it will attempt to coerce it into a valid -semantic version (e.g., 1.2.0). In both cases a `Version` object is returned -that can be sorted, compared, and used in constraints. - -When parsing a version an optional error can be returned if there is an issue -parsing the version. For example, - - v, err := semver.NewVersion("1.2.3-beta.1+b345") - -The version object has methods to get the parts of the version, compare it to -other versions, convert the version back into a string, and get the original -string. For more details please see the documentation -at https://godoc.org/github.com/Masterminds/semver. - -# Sorting Semantic Versions - -A set of versions can be sorted using the `sort` package from the standard library. -For example, - - raw := []string{"1.2.3", "1.0", "1.3", "2", "0.4.2",} - vs := make([]*semver.Version, len(raw)) - for i, r := range raw { - v, err := semver.NewVersion(r) - if err != nil { - t.Errorf("Error parsing version: %s", err) - } - - vs[i] = v - } - - sort.Sort(semver.Collection(vs)) - -# Checking Version Constraints and Comparing Versions - -There are two methods for comparing versions. One uses comparison methods on -`Version` instances and the other is using Constraints. There are some important -differences to notes between these two methods of comparison. - - 1. When two versions are compared using functions such as `Compare`, `LessThan`, - and others it will follow the specification and always include prereleases - within the comparison. It will provide an answer valid with the comparison - spec section at https://semver.org/#spec-item-11 - 2. When constraint checking is used for checks or validation it will follow a - different set of rules that are common for ranges with tools like npm/js - and Rust/Cargo. This includes considering prereleases to be invalid if the - ranges does not include on. If you want to have it include pre-releases a - simple solution is to include `-0` in your range. - 3. Constraint ranges can have some complex rules including the shorthard use of - ~ and ^. For more details on those see the options below. - -There are differences between the two methods or checking versions because the -comparison methods on `Version` follow the specification while comparison ranges -are not part of the specification. Different packages and tools have taken it -upon themselves to come up with range rules. This has resulted in differences. -For example, npm/js and Cargo/Rust follow similar patterns which PHP has a -different pattern for ^. The comparison features in this package follow the -npm/js and Cargo/Rust lead because applications using it have followed similar -patters with their versions. - -Checking a version against version constraints is one of the most featureful -parts of the package. - - c, err := semver.NewConstraint(">= 1.2.3") - if err != nil { - // Handle constraint not being parsable. - } - - v, err := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parsable. - } - // Check if the version meets the constraints. The a variable will be true. - a := c.Check(v) - -# Basic Comparisons - -There are two elements to the comparisons. First, a comparison string is a list -of comma or space separated AND comparisons. These are then separated by || (OR) -comparisons. For example, `">= 1.2 < 3.0.0 || >= 4.2.3"` is looking for a -comparison that's greater than or equal to 1.2 and less than 3.0.0 or is -greater than or equal to 4.2.3. This can also be written as -`">= 1.2, < 3.0.0 || >= 4.2.3"` - -The basic comparisons are: - - - `=`: equal (aliased to no operator) - - `!=`: not equal - - `>`: greater than - - `<`: less than - - `>=`: greater than or equal to - - `<=`: less than or equal to - -# Hyphen Range Comparisons - -There are multiple methods to handle ranges and the first is hyphens ranges. -These look like: - - - `1.2 - 1.4.5` which is equivalent to `>= 1.2, <= 1.4.5` - - `2.3.4 - 4.5` which is equivalent to `>= 2.3.4 <= 4.5` - -# Wildcards In Comparisons - -The `x`, `X`, and `*` characters can be used as a wildcard character. This works -for all comparison operators. When used on the `=` operator it falls -back to the tilde operation. For example, - - - `1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - - `>= 1.2.x` is equivalent to `>= 1.2.0` - - `<= 2.x` is equivalent to `<= 3` - - `*` is equivalent to `>= 0.0.0` - -Tilde Range Comparisons (Patch) - -The tilde (`~`) comparison operator is for patch level ranges when a minor -version is specified and major level changes when the minor number is missing. -For example, - - - `~1.2.3` is equivalent to `>= 1.2.3 < 1.3.0` - - `~1` is equivalent to `>= 1, < 2` - - `~2.3` is equivalent to `>= 2.3 < 2.4` - - `~1.2.x` is equivalent to `>= 1.2.0 < 1.3.0` - - `~1.x` is equivalent to `>= 1 < 2` - -Caret Range Comparisons (Major) - -The caret (`^`) comparison operator is for major level changes once a stable -(1.0.0) release has occurred. Prior to a 1.0.0 release the minor versions acts -as the API stability level. This is useful when comparisons of API versions as a -major change is API breaking. For example, - - - `^1.2.3` is equivalent to `>= 1.2.3, < 2.0.0` - - `^1.2.x` is equivalent to `>= 1.2.0, < 2.0.0` - - `^2.3` is equivalent to `>= 2.3, < 3` - - `^2.x` is equivalent to `>= 2.0.0, < 3` - - `^0.2.3` is equivalent to `>=0.2.3 <0.3.0` - - `^0.2` is equivalent to `>=0.2.0 <0.3.0` - - `^0.0.3` is equivalent to `>=0.0.3 <0.0.4` - - `^0.0` is equivalent to `>=0.0.0 <0.1.0` - - `^0` is equivalent to `>=0.0.0 <1.0.0` - -# Validation - -In addition to testing a version against a constraint, a version can be validated -against a constraint. When validation fails a slice of errors containing why a -version didn't meet the constraint is returned. For example, - - c, err := semver.NewConstraint("<= 1.2.3, >= 1.4") - if err != nil { - // Handle constraint not being parseable. - } - - v, _ := semver.NewVersion("1.3") - if err != nil { - // Handle version not being parseable. - } - - // Validate a version against a constraint. - a, msgs := c.Validate(v) - // a is false - for _, m := range msgs { - fmt.Println(m) - - // Loops over the errors which would read - // "1.3 is greater than 1.2.3" - // "1.3 is less than 1.4" - } -*/ -package semver diff --git a/vendor/github.com/Masterminds/semver/v3/version.go b/vendor/github.com/Masterminds/semver/v3/version.go deleted file mode 100644 index 7c4bed3347..0000000000 --- a/vendor/github.com/Masterminds/semver/v3/version.go +++ /dev/null @@ -1,639 +0,0 @@ -package semver - -import ( - "bytes" - "database/sql/driver" - "encoding/json" - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -// The compiled version of the regex created at init() is cached here so it -// only needs to be created once. -var versionRegex *regexp.Regexp - -var ( - // ErrInvalidSemVer is returned a version is found to be invalid when - // being parsed. - ErrInvalidSemVer = errors.New("Invalid Semantic Version") - - // ErrEmptyString is returned when an empty string is passed in for parsing. - ErrEmptyString = errors.New("Version string empty") - - // ErrInvalidCharacters is returned when invalid characters are found as - // part of a version - ErrInvalidCharacters = errors.New("Invalid characters in version") - - // ErrSegmentStartsZero is returned when a version segment starts with 0. - // This is invalid in SemVer. - ErrSegmentStartsZero = errors.New("Version segment starts with 0") - - // ErrInvalidMetadata is returned when the metadata is an invalid format - ErrInvalidMetadata = errors.New("Invalid Metadata string") - - // ErrInvalidPrerelease is returned when the pre-release is an invalid format - ErrInvalidPrerelease = errors.New("Invalid Prerelease string") -) - -// semVerRegex is the regular expression used to parse a semantic version. -const semVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -// Version represents a single semantic version. -type Version struct { - major, minor, patch uint64 - pre string - metadata string - original string -} - -func init() { - versionRegex = regexp.MustCompile("^" + semVerRegex + "$") -} - -const ( - num string = "0123456789" - allowed string = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + num -) - -// StrictNewVersion parses a given version and returns an instance of Version or -// an error if unable to parse the version. Only parses valid semantic versions. -// Performs checking that can find errors within the version. -// If you want to coerce a version such as 1 or 1.2 and parse it as the 1.x -// releases of semver did, use the NewVersion() function. -func StrictNewVersion(v string) (*Version, error) { - // Parsing here does not use RegEx in order to increase performance and reduce - // allocations. - - if len(v) == 0 { - return nil, ErrEmptyString - } - - // Split the parts into [0]major, [1]minor, and [2]patch,prerelease,build - parts := strings.SplitN(v, ".", 3) - if len(parts) != 3 { - return nil, ErrInvalidSemVer - } - - sv := &Version{ - original: v, - } - - // check for prerelease or build metadata - var extra []string - if strings.ContainsAny(parts[2], "-+") { - // Start with the build metadata first as it needs to be on the right - extra = strings.SplitN(parts[2], "+", 2) - if len(extra) > 1 { - // build metadata found - sv.metadata = extra[1] - parts[2] = extra[0] - } - - extra = strings.SplitN(parts[2], "-", 2) - if len(extra) > 1 { - // prerelease found - sv.pre = extra[1] - parts[2] = extra[0] - } - } - - // Validate the number segments are valid. This includes only having positive - // numbers and no leading 0's. - for _, p := range parts { - if !containsOnly(p, num) { - return nil, ErrInvalidCharacters - } - - if len(p) > 1 && p[0] == '0' { - return nil, ErrSegmentStartsZero - } - } - - // Extract the major, minor, and patch elements onto the returned Version - var err error - sv.major, err = strconv.ParseUint(parts[0], 10, 64) - if err != nil { - return nil, err - } - - sv.minor, err = strconv.ParseUint(parts[1], 10, 64) - if err != nil { - return nil, err - } - - sv.patch, err = strconv.ParseUint(parts[2], 10, 64) - if err != nil { - return nil, err - } - - // No prerelease or build metadata found so returning now as a fastpath. - if sv.pre == "" && sv.metadata == "" { - return sv, nil - } - - if sv.pre != "" { - if err = validatePrerelease(sv.pre); err != nil { - return nil, err - } - } - - if sv.metadata != "" { - if err = validateMetadata(sv.metadata); err != nil { - return nil, err - } - } - - return sv, nil -} - -// NewVersion parses a given version and returns an instance of Version or -// an error if unable to parse the version. If the version is SemVer-ish it -// attempts to convert it to SemVer. If you want to validate it was a strict -// semantic version at parse time see StrictNewVersion(). -func NewVersion(v string) (*Version, error) { - m := versionRegex.FindStringSubmatch(v) - if m == nil { - return nil, ErrInvalidSemVer - } - - sv := &Version{ - metadata: m[8], - pre: m[5], - original: v, - } - - var err error - sv.major, err = strconv.ParseUint(m[1], 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - - if m[2] != "" { - sv.minor, err = strconv.ParseUint(strings.TrimPrefix(m[2], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - } else { - sv.minor = 0 - } - - if m[3] != "" { - sv.patch, err = strconv.ParseUint(strings.TrimPrefix(m[3], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - } else { - sv.patch = 0 - } - - // Perform some basic due diligence on the extra parts to ensure they are - // valid. - - if sv.pre != "" { - if err = validatePrerelease(sv.pre); err != nil { - return nil, err - } - } - - if sv.metadata != "" { - if err = validateMetadata(sv.metadata); err != nil { - return nil, err - } - } - - return sv, nil -} - -// New creates a new instance of Version with each of the parts passed in as -// arguments instead of parsing a version string. -func New(major, minor, patch uint64, pre, metadata string) *Version { - v := Version{ - major: major, - minor: minor, - patch: patch, - pre: pre, - metadata: metadata, - original: "", - } - - v.original = v.String() - - return &v -} - -// MustParse parses a given version and panics on error. -func MustParse(v string) *Version { - sv, err := NewVersion(v) - if err != nil { - panic(err) - } - return sv -} - -// String converts a Version object to a string. -// Note, if the original version contained a leading v this version will not. -// See the Original() method to retrieve the original value. Semantic Versions -// don't contain a leading v per the spec. Instead it's optional on -// implementation. -func (v Version) String() string { - var buf bytes.Buffer - - fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) - if v.pre != "" { - fmt.Fprintf(&buf, "-%s", v.pre) - } - if v.metadata != "" { - fmt.Fprintf(&buf, "+%s", v.metadata) - } - - return buf.String() -} - -// Original returns the original value passed in to be parsed. -func (v *Version) Original() string { - return v.original -} - -// Major returns the major version. -func (v Version) Major() uint64 { - return v.major -} - -// Minor returns the minor version. -func (v Version) Minor() uint64 { - return v.minor -} - -// Patch returns the patch version. -func (v Version) Patch() uint64 { - return v.patch -} - -// Prerelease returns the pre-release version. -func (v Version) Prerelease() string { - return v.pre -} - -// Metadata returns the metadata on the version. -func (v Version) Metadata() string { - return v.metadata -} - -// originalVPrefix returns the original 'v' prefix if any. -func (v Version) originalVPrefix() string { - // Note, only lowercase v is supported as a prefix by the parser. - if v.original != "" && v.original[:1] == "v" { - return v.original[:1] - } - return "" -} - -// IncPatch produces the next patch version. -// If the current version does not have prerelease/metadata information, -// it unsets metadata and prerelease values, increments patch number. -// If the current version has any of prerelease or metadata information, -// it unsets both values and keeps current patch value -func (v Version) IncPatch() Version { - vNext := v - // according to http://semver.org/#spec-item-9 - // Pre-release versions have a lower precedence than the associated normal version. - // according to http://semver.org/#spec-item-10 - // Build metadata SHOULD be ignored when determining version precedence. - if v.pre != "" { - vNext.metadata = "" - vNext.pre = "" - } else { - vNext.metadata = "" - vNext.pre = "" - vNext.patch = v.patch + 1 - } - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMinor produces the next minor version. -// Sets patch to 0. -// Increments minor number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMinor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = v.minor + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMajor produces the next major version. -// Sets patch to 0. -// Sets minor to 0. -// Increments major number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMajor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = 0 - vNext.major = v.major + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// SetPrerelease defines the prerelease value. -// Value must not include the required 'hyphen' prefix. -func (v Version) SetPrerelease(prerelease string) (Version, error) { - vNext := v - if len(prerelease) > 0 { - if err := validatePrerelease(prerelease); err != nil { - return vNext, err - } - } - vNext.pre = prerelease - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// SetMetadata defines metadata value. -// Value must not include the required 'plus' prefix. -func (v Version) SetMetadata(metadata string) (Version, error) { - vNext := v - if len(metadata) > 0 { - if err := validateMetadata(metadata); err != nil { - return vNext, err - } - } - vNext.metadata = metadata - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// LessThan tests if one version is less than another one. -func (v *Version) LessThan(o *Version) bool { - return v.Compare(o) < 0 -} - -// GreaterThan tests if one version is greater than another one. -func (v *Version) GreaterThan(o *Version) bool { - return v.Compare(o) > 0 -} - -// Equal tests if two versions are equal to each other. -// Note, versions can be equal with different metadata since metadata -// is not considered part of the comparable version. -func (v *Version) Equal(o *Version) bool { - return v.Compare(o) == 0 -} - -// Compare compares this version to another one. It returns -1, 0, or 1 if -// the version smaller, equal, or larger than the other version. -// -// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is -// lower than the version without a prerelease. Compare always takes into account -// prereleases. If you want to work with ranges using typical range syntaxes that -// skip prereleases if the range is not looking for them use constraints. -func (v *Version) Compare(o *Version) int { - // Compare the major, minor, and patch version for differences. If a - // difference is found return the comparison. - if d := compareSegment(v.Major(), o.Major()); d != 0 { - return d - } - if d := compareSegment(v.Minor(), o.Minor()); d != 0 { - return d - } - if d := compareSegment(v.Patch(), o.Patch()); d != 0 { - return d - } - - // At this point the major, minor, and patch versions are the same. - ps := v.pre - po := o.Prerelease() - - if ps == "" && po == "" { - return 0 - } - if ps == "" { - return 1 - } - if po == "" { - return -1 - } - - return comparePrerelease(ps, po) -} - -// UnmarshalJSON implements JSON.Unmarshaler interface. -func (v *Version) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - temp, err := NewVersion(s) - if err != nil { - return err - } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original - return nil -} - -// MarshalJSON implements JSON.Marshaler interface. -func (v Version) MarshalJSON() ([]byte, error) { - return json.Marshal(v.String()) -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface. -func (v *Version) UnmarshalText(text []byte) error { - temp, err := NewVersion(string(text)) - if err != nil { - return err - } - - *v = *temp - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface. -func (v Version) MarshalText() ([]byte, error) { - return []byte(v.String()), nil -} - -// Scan implements the SQL.Scanner interface. -func (v *Version) Scan(value interface{}) error { - var s string - s, _ = value.(string) - temp, err := NewVersion(s) - if err != nil { - return err - } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original - return nil -} - -// Value implements the Driver.Valuer interface. -func (v Version) Value() (driver.Value, error) { - return v.String(), nil -} - -func compareSegment(v, o uint64) int { - if v < o { - return -1 - } - if v > o { - return 1 - } - - return 0 -} - -func comparePrerelease(v, o string) int { - // split the prelease versions by their part. The separator, per the spec, - // is a . - sparts := strings.Split(v, ".") - oparts := strings.Split(o, ".") - - // Find the longer length of the parts to know how many loop iterations to - // go through. - slen := len(sparts) - olen := len(oparts) - - l := slen - if olen > slen { - l = olen - } - - // Iterate over each part of the prereleases to compare the differences. - for i := 0; i < l; i++ { - // Since the lentgh of the parts can be different we need to create - // a placeholder. This is to avoid out of bounds issues. - stemp := "" - if i < slen { - stemp = sparts[i] - } - - otemp := "" - if i < olen { - otemp = oparts[i] - } - - d := comparePrePart(stemp, otemp) - if d != 0 { - return d - } - } - - // Reaching here means two versions are of equal value but have different - // metadata (the part following a +). They are not identical in string form - // but the version comparison finds them to be equal. - return 0 -} - -func comparePrePart(s, o string) int { - // Fastpath if they are equal - if s == o { - return 0 - } - - // When s or o are empty we can use the other in an attempt to determine - // the response. - if s == "" { - if o != "" { - return -1 - } - return 1 - } - - if o == "" { - if s != "" { - return 1 - } - return -1 - } - - // When comparing strings "99" is greater than "103". To handle - // cases like this we need to detect numbers and compare them. According - // to the semver spec, numbers are always positive. If there is a - at the - // start like -99 this is to be evaluated as an alphanum. numbers always - // have precedence over alphanum. Parsing as Uints because negative numbers - // are ignored. - - oi, n1 := strconv.ParseUint(o, 10, 64) - si, n2 := strconv.ParseUint(s, 10, 64) - - // The case where both are strings compare the strings - if n1 != nil && n2 != nil { - if s > o { - return 1 - } - return -1 - } else if n1 != nil { - // o is a string and s is a number - return -1 - } else if n2 != nil { - // s is a string and o is a number - return 1 - } - // Both are numbers - if si > oi { - return 1 - } - return -1 -} - -// Like strings.ContainsAny but does an only instead of any. -func containsOnly(s string, comp string) bool { - return strings.IndexFunc(s, func(r rune) bool { - return !strings.ContainsRune(comp, r) - }) == -1 -} - -// From the spec, "Identifiers MUST comprise only -// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. -// Numeric identifiers MUST NOT include leading zeroes.". These segments can -// be dot separated. -func validatePrerelease(p string) error { - eparts := strings.Split(p, ".") - for _, p := range eparts { - if containsOnly(p, num) { - if len(p) > 1 && p[0] == '0' { - return ErrSegmentStartsZero - } - } else if !containsOnly(p, allowed) { - return ErrInvalidPrerelease - } - } - - return nil -} - -// From the spec, "Build metadata MAY be denoted by -// appending a plus sign and a series of dot separated identifiers immediately -// following the patch or pre-release version. Identifiers MUST comprise only -// ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty." -func validateMetadata(m string) error { - eparts := strings.Split(m, ".") - for _, p := range eparts { - if !containsOnly(p, allowed) { - return ErrInvalidMetadata - } - } - return nil -} diff --git a/vendor/github.com/Masterminds/semver/version.go b/vendor/github.com/Masterminds/semver/version.go deleted file mode 100644 index 400d4f9341..0000000000 --- a/vendor/github.com/Masterminds/semver/version.go +++ /dev/null @@ -1,425 +0,0 @@ -package semver - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "regexp" - "strconv" - "strings" -) - -// The compiled version of the regex created at init() is cached here so it -// only needs to be created once. -var versionRegex *regexp.Regexp -var validPrereleaseRegex *regexp.Regexp - -var ( - // ErrInvalidSemVer is returned a version is found to be invalid when - // being parsed. - ErrInvalidSemVer = errors.New("Invalid Semantic Version") - - // ErrInvalidMetadata is returned when the metadata is an invalid format - ErrInvalidMetadata = errors.New("Invalid Metadata string") - - // ErrInvalidPrerelease is returned when the pre-release is an invalid format - ErrInvalidPrerelease = errors.New("Invalid Prerelease string") -) - -// SemVerRegex is the regular expression used to parse a semantic version. -const SemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` + - `(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` + - `(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` - -// ValidPrerelease is the regular expression which validates -// both prerelease and metadata values. -const ValidPrerelease string = `^([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*)$` - -// Version represents a single semantic version. -type Version struct { - major, minor, patch int64 - pre string - metadata string - original string -} - -func init() { - versionRegex = regexp.MustCompile("^" + SemVerRegex + "$") - validPrereleaseRegex = regexp.MustCompile(ValidPrerelease) -} - -// NewVersion parses a given version and returns an instance of Version or -// an error if unable to parse the version. -func NewVersion(v string) (*Version, error) { - m := versionRegex.FindStringSubmatch(v) - if m == nil { - return nil, ErrInvalidSemVer - } - - sv := &Version{ - metadata: m[8], - pre: m[5], - original: v, - } - - var temp int64 - temp, err := strconv.ParseInt(m[1], 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - sv.major = temp - - if m[2] != "" { - temp, err = strconv.ParseInt(strings.TrimPrefix(m[2], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - sv.minor = temp - } else { - sv.minor = 0 - } - - if m[3] != "" { - temp, err = strconv.ParseInt(strings.TrimPrefix(m[3], "."), 10, 64) - if err != nil { - return nil, fmt.Errorf("Error parsing version segment: %s", err) - } - sv.patch = temp - } else { - sv.patch = 0 - } - - return sv, nil -} - -// MustParse parses a given version and panics on error. -func MustParse(v string) *Version { - sv, err := NewVersion(v) - if err != nil { - panic(err) - } - return sv -} - -// String converts a Version object to a string. -// Note, if the original version contained a leading v this version will not. -// See the Original() method to retrieve the original value. Semantic Versions -// don't contain a leading v per the spec. Instead it's optional on -// implementation. -func (v *Version) String() string { - var buf bytes.Buffer - - fmt.Fprintf(&buf, "%d.%d.%d", v.major, v.minor, v.patch) - if v.pre != "" { - fmt.Fprintf(&buf, "-%s", v.pre) - } - if v.metadata != "" { - fmt.Fprintf(&buf, "+%s", v.metadata) - } - - return buf.String() -} - -// Original returns the original value passed in to be parsed. -func (v *Version) Original() string { - return v.original -} - -// Major returns the major version. -func (v *Version) Major() int64 { - return v.major -} - -// Minor returns the minor version. -func (v *Version) Minor() int64 { - return v.minor -} - -// Patch returns the patch version. -func (v *Version) Patch() int64 { - return v.patch -} - -// Prerelease returns the pre-release version. -func (v *Version) Prerelease() string { - return v.pre -} - -// Metadata returns the metadata on the version. -func (v *Version) Metadata() string { - return v.metadata -} - -// originalVPrefix returns the original 'v' prefix if any. -func (v *Version) originalVPrefix() string { - - // Note, only lowercase v is supported as a prefix by the parser. - if v.original != "" && v.original[:1] == "v" { - return v.original[:1] - } - return "" -} - -// IncPatch produces the next patch version. -// If the current version does not have prerelease/metadata information, -// it unsets metadata and prerelease values, increments patch number. -// If the current version has any of prerelease or metadata information, -// it unsets both values and keeps curent patch value -func (v Version) IncPatch() Version { - vNext := v - // according to http://semver.org/#spec-item-9 - // Pre-release versions have a lower precedence than the associated normal version. - // according to http://semver.org/#spec-item-10 - // Build metadata SHOULD be ignored when determining version precedence. - if v.pre != "" { - vNext.metadata = "" - vNext.pre = "" - } else { - vNext.metadata = "" - vNext.pre = "" - vNext.patch = v.patch + 1 - } - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMinor produces the next minor version. -// Sets patch to 0. -// Increments minor number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMinor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = v.minor + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// IncMajor produces the next major version. -// Sets patch to 0. -// Sets minor to 0. -// Increments major number. -// Unsets metadata. -// Unsets prerelease status. -func (v Version) IncMajor() Version { - vNext := v - vNext.metadata = "" - vNext.pre = "" - vNext.patch = 0 - vNext.minor = 0 - vNext.major = v.major + 1 - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext -} - -// SetPrerelease defines the prerelease value. -// Value must not include the required 'hypen' prefix. -func (v Version) SetPrerelease(prerelease string) (Version, error) { - vNext := v - if len(prerelease) > 0 && !validPrereleaseRegex.MatchString(prerelease) { - return vNext, ErrInvalidPrerelease - } - vNext.pre = prerelease - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// SetMetadata defines metadata value. -// Value must not include the required 'plus' prefix. -func (v Version) SetMetadata(metadata string) (Version, error) { - vNext := v - if len(metadata) > 0 && !validPrereleaseRegex.MatchString(metadata) { - return vNext, ErrInvalidMetadata - } - vNext.metadata = metadata - vNext.original = v.originalVPrefix() + "" + vNext.String() - return vNext, nil -} - -// LessThan tests if one version is less than another one. -func (v *Version) LessThan(o *Version) bool { - return v.Compare(o) < 0 -} - -// GreaterThan tests if one version is greater than another one. -func (v *Version) GreaterThan(o *Version) bool { - return v.Compare(o) > 0 -} - -// Equal tests if two versions are equal to each other. -// Note, versions can be equal with different metadata since metadata -// is not considered part of the comparable version. -func (v *Version) Equal(o *Version) bool { - return v.Compare(o) == 0 -} - -// Compare compares this version to another one. It returns -1, 0, or 1 if -// the version smaller, equal, or larger than the other version. -// -// Versions are compared by X.Y.Z. Build metadata is ignored. Prerelease is -// lower than the version without a prerelease. -func (v *Version) Compare(o *Version) int { - // Compare the major, minor, and patch version for differences. If a - // difference is found return the comparison. - if d := compareSegment(v.Major(), o.Major()); d != 0 { - return d - } - if d := compareSegment(v.Minor(), o.Minor()); d != 0 { - return d - } - if d := compareSegment(v.Patch(), o.Patch()); d != 0 { - return d - } - - // At this point the major, minor, and patch versions are the same. - ps := v.pre - po := o.Prerelease() - - if ps == "" && po == "" { - return 0 - } - if ps == "" { - return 1 - } - if po == "" { - return -1 - } - - return comparePrerelease(ps, po) -} - -// UnmarshalJSON implements JSON.Unmarshaler interface. -func (v *Version) UnmarshalJSON(b []byte) error { - var s string - if err := json.Unmarshal(b, &s); err != nil { - return err - } - temp, err := NewVersion(s) - if err != nil { - return err - } - v.major = temp.major - v.minor = temp.minor - v.patch = temp.patch - v.pre = temp.pre - v.metadata = temp.metadata - v.original = temp.original - temp = nil - return nil -} - -// MarshalJSON implements JSON.Marshaler interface. -func (v *Version) MarshalJSON() ([]byte, error) { - return json.Marshal(v.String()) -} - -func compareSegment(v, o int64) int { - if v < o { - return -1 - } - if v > o { - return 1 - } - - return 0 -} - -func comparePrerelease(v, o string) int { - - // split the prelease versions by their part. The separator, per the spec, - // is a . - sparts := strings.Split(v, ".") - oparts := strings.Split(o, ".") - - // Find the longer length of the parts to know how many loop iterations to - // go through. - slen := len(sparts) - olen := len(oparts) - - l := slen - if olen > slen { - l = olen - } - - // Iterate over each part of the prereleases to compare the differences. - for i := 0; i < l; i++ { - // Since the lentgh of the parts can be different we need to create - // a placeholder. This is to avoid out of bounds issues. - stemp := "" - if i < slen { - stemp = sparts[i] - } - - otemp := "" - if i < olen { - otemp = oparts[i] - } - - d := comparePrePart(stemp, otemp) - if d != 0 { - return d - } - } - - // Reaching here means two versions are of equal value but have different - // metadata (the part following a +). They are not identical in string form - // but the version comparison finds them to be equal. - return 0 -} - -func comparePrePart(s, o string) int { - // Fastpath if they are equal - if s == o { - return 0 - } - - // When s or o are empty we can use the other in an attempt to determine - // the response. - if s == "" { - if o != "" { - return -1 - } - return 1 - } - - if o == "" { - if s != "" { - return 1 - } - return -1 - } - - // When comparing strings "99" is greater than "103". To handle - // cases like this we need to detect numbers and compare them. According - // to the semver spec, numbers are always positive. If there is a - at the - // start like -99 this is to be evaluated as an alphanum. numbers always - // have precedence over alphanum. Parsing as Uints because negative numbers - // are ignored. - - oi, n1 := strconv.ParseUint(o, 10, 64) - si, n2 := strconv.ParseUint(s, 10, 64) - - // The case where both are strings compare the strings - if n1 != nil && n2 != nil { - if s > o { - return 1 - } - return -1 - } else if n1 != nil { - // o is a string and s is a number - return -1 - } else if n2 != nil { - // s is a string and o is a number - return 1 - } - // Both are numbers - if si > oi { - return 1 - } - return -1 - -} diff --git a/vendor/github.com/Masterminds/semver/version_fuzz.go b/vendor/github.com/Masterminds/semver/version_fuzz.go deleted file mode 100644 index b42bcd62b9..0000000000 --- a/vendor/github.com/Masterminds/semver/version_fuzz.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build gofuzz - -package semver - -func Fuzz(data []byte) int { - if _, err := NewVersion(string(data)); err != nil { - return 0 - } - return 1 -} diff --git a/vendor/github.com/Masterminds/sprig/.gitignore b/vendor/github.com/Masterminds/sprig/.gitignore deleted file mode 100644 index 5e3002f88f..0000000000 --- a/vendor/github.com/Masterminds/sprig/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -/.glide diff --git a/vendor/github.com/Masterminds/sprig/.travis.yml b/vendor/github.com/Masterminds/sprig/.travis.yml deleted file mode 100644 index b9da8b825b..0000000000 --- a/vendor/github.com/Masterminds/sprig/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: go - -go: - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - 1.13.x - - tip - -# Setting sudo access to false will let Travis CI use containers rather than -# VMs to run the tests. For more details see: -# - http://docs.travis-ci.com/user/workers/container-based-infrastructure/ -# - http://docs.travis-ci.com/user/workers/standard-infrastructure/ -sudo: false - -script: - - make setup test - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/06e3328629952dabe3e0 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always diff --git a/vendor/github.com/Masterminds/sprig/CHANGELOG.md b/vendor/github.com/Masterminds/sprig/CHANGELOG.md deleted file mode 100644 index 6a79fbde46..0000000000 --- a/vendor/github.com/Masterminds/sprig/CHANGELOG.md +++ /dev/null @@ -1,282 +0,0 @@ -# Changelog - -## Release 2.22.0 (2019-10-02) - -### Added - -- #173: Added getHostByName function to resolve dns names to ips (thanks @fcgravalos) -- #195: Added deepCopy function for use with dicts - -### Changed - -- Updated merge and mergeOverwrite documentation to explain copying and how to - use deepCopy with it - -## Release 2.21.0 (2019-09-18) - -### Added - -- #122: Added encryptAES/decryptAES functions (thanks @n0madic) -- #128: Added toDecimal support (thanks @Dean-Coakley) -- #169: Added list contcat (thanks @astorath) -- #174: Added deepEqual function (thanks @bonifaido) -- #170: Added url parse and join functions (thanks @astorath) - -### Changed - -- #171: Updated glide config for Google UUID to v1 and to add ranges to semver and testify - -### Fixed - -- #172: Fix semver wildcard example (thanks @piepmatz) -- #175: Fix dateInZone doc example (thanks @s3than) - -## Release 2.20.0 (2019-06-18) - -### Added - -- #164: Adding function to get unix epoch for a time (@mattfarina) -- #166: Adding tests for date_in_zone (@mattfarina) - -### Changed - -- #144: Fix function comments based on best practices from Effective Go (@CodeLingoTeam) -- #150: Handles pointer type for time.Time in "htmlDate" (@mapreal19) -- #161, #157, #160, #153, #158, #156, #155, #159, #152 documentation updates (@badeadan) - -### Fixed - -## Release 2.19.0 (2019-03-02) - -IMPORTANT: This release reverts a change from 2.18.0 - -In the previous release (2.18), we prematurely merged a partial change to the crypto functions that led to creating two sets of crypto functions (I blame @technosophos -- since that's me). This release rolls back that change, and does what was originally intended: It alters the existing crypto functions to use secure random. - -We debated whether this classifies as a change worthy of major revision, but given the proximity to the last release, we have decided that treating 2.18 as a faulty release is the correct course of action. We apologize for any inconvenience. - -### Changed - -- Fix substr panic 35fb796 (Alexey igrychev) -- Remove extra period 1eb7729 (Matthew Lorimor) -- Make random string functions use crypto by default 6ceff26 (Matthew Lorimor) -- README edits/fixes/suggestions 08fe136 (Lauri Apple) - - -## Release 2.18.0 (2019-02-12) - -### Added - -- Added mergeOverwrite function -- cryptographic functions that use secure random (see fe1de12) - -### Changed - -- Improve documentation of regexMatch function, resolves #139 90b89ce (Jan Tagscherer) -- Handle has for nil list 9c10885 (Daniel Cohen) -- Document behaviour of mergeOverwrite fe0dbe9 (Lukas Rieder) -- doc: adds missing documentation. 4b871e6 (Fernandez Ludovic) -- Replace outdated goutils imports 01893d2 (Matthew Lorimor) -- Surface crypto secure random strings from goutils fe1de12 (Matthew Lorimor) -- Handle untyped nil values as paramters to string functions 2b2ec8f (Morten Torkildsen) - -### Fixed - -- Fix dict merge issue and provide mergeOverwrite .dst .src1 to overwrite from src -> dst 4c59c12 (Lukas Rieder) -- Fix substr var names and comments d581f80 (Dean Coakley) -- Fix substr documentation 2737203 (Dean Coakley) - -## Release 2.17.1 (2019-01-03) - -### Fixed - -The 2.17.0 release did not have a version pinned for xstrings, which caused compilation failures when xstrings < 1.2 was used. This adds the correct version string to glide.yaml. - -## Release 2.17.0 (2019-01-03) - -### Added - -- adds alder32sum function and test 6908fc2 (marshallford) -- Added kebabcase function ca331a1 (Ilyes512) - -### Changed - -- Update goutils to 1.1.0 4e1125d (Matt Butcher) - -### Fixed - -- Fix 'has' documentation e3f2a85 (dean-coakley) -- docs(dict): fix typo in pick example dc424f9 (Dustin Specker) -- fixes spelling errors... not sure how that happened 4cf188a (marshallford) - -## Release 2.16.0 (2018-08-13) - -### Added - -- add splitn function fccb0b0 (Helgi Þorbjörnsson) -- Add slice func df28ca7 (gongdo) -- Generate serial number a3bdffd (Cody Coons) -- Extract values of dict with values function df39312 (Lawrence Jones) - -### Changed - -- Modify panic message for list.slice ae38335 (gongdo) -- Minor improvement in code quality - Removed an unreachable piece of code at defaults.go#L26:6 - Resolve formatting issues. 5834241 (Abhishek Kashyap) -- Remove duplicated documentation 1d97af1 (Matthew Fisher) -- Test on go 1.11 49df809 (Helgi Þormar Þorbjörnsson) - -### Fixed - -- Fix file permissions c5f40b5 (gongdo) -- Fix example for buildCustomCert 7779e0d (Tin Lam) - -## Release 2.15.0 (2018-04-02) - -### Added - -- #68 and #69: Add json helpers to docs (thanks @arunvelsriram) -- #66: Add ternary function (thanks @binoculars) -- #67: Allow keys function to take multiple dicts (thanks @binoculars) -- #89: Added sha1sum to crypto function (thanks @benkeil) -- #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei) -- #92: Add travis testing for go 1.10 -- #93: Adding appveyor config for windows testing - -### Changed - -- #90: Updating to more recent dependencies -- #73: replace satori/go.uuid with google/uuid (thanks @petterw) - -### Fixed - -- #76: Fixed documentation typos (thanks @Thiht) -- Fixed rounding issue on the `ago` function. Note, the removes support for Go 1.8 and older - -## Release 2.14.1 (2017-12-01) - -### Fixed - -- #60: Fix typo in function name documentation (thanks @neil-ca-moore) -- #61: Removing line with {{ due to blocking github pages genertion -- #64: Update the list functions to handle int, string, and other slices for compatibility - -## Release 2.14.0 (2017-10-06) - -This new version of Sprig adds a set of functions for generating and working with SSL certificates. - -- `genCA` generates an SSL Certificate Authority -- `genSelfSignedCert` generates an SSL self-signed certificate -- `genSignedCert` generates an SSL certificate and key based on a given CA - -## Release 2.13.0 (2017-09-18) - -This release adds new functions, including: - -- `regexMatch`, `regexFindAll`, `regexFind`, `regexReplaceAll`, `regexReplaceAllLiteral`, and `regexSplit` to work with regular expressions -- `floor`, `ceil`, and `round` math functions -- `toDate` converts a string to a date -- `nindent` is just like `indent` but also prepends a new line -- `ago` returns the time from `time.Now` - -### Added - -- #40: Added basic regex functionality (thanks @alanquillin) -- #41: Added ceil floor and round functions (thanks @alanquillin) -- #48: Added toDate function (thanks @andreynering) -- #50: Added nindent function (thanks @binoculars) -- #46: Added ago function (thanks @slayer) - -### Changed - -- #51: Updated godocs to include new string functions (thanks @curtisallen) -- #49: Added ability to merge multiple dicts (thanks @binoculars) - -## Release 2.12.0 (2017-05-17) - -- `snakecase`, `camelcase`, and `shuffle` are three new string functions -- `fail` allows you to bail out of a template render when conditions are not met - -## Release 2.11.0 (2017-05-02) - -- Added `toJson` and `toPrettyJson` -- Added `merge` -- Refactored documentation - -## Release 2.10.0 (2017-03-15) - -- Added `semver` and `semverCompare` for Semantic Versions -- `list` replaces `tuple` -- Fixed issue with `join` -- Added `first`, `last`, `intial`, `rest`, `prepend`, `append`, `toString`, `toStrings`, `sortAlpha`, `reverse`, `coalesce`, `pluck`, `pick`, `compact`, `keys`, `omit`, `uniq`, `has`, `without` - -## Release 2.9.0 (2017-02-23) - -- Added `splitList` to split a list -- Added crypto functions of `genPrivateKey` and `derivePassword` - -## Release 2.8.0 (2016-12-21) - -- Added access to several path functions (`base`, `dir`, `clean`, `ext`, and `abs`) -- Added functions for _mutating_ dictionaries (`set`, `unset`, `hasKey`) - -## Release 2.7.0 (2016-12-01) - -- Added `sha256sum` to generate a hash of an input -- Added functions to convert a numeric or string to `int`, `int64`, `float64` - -## Release 2.6.0 (2016-10-03) - -- Added a `uuidv4` template function for generating UUIDs inside of a template. - -## Release 2.5.0 (2016-08-19) - -- New `trimSuffix`, `trimPrefix`, `hasSuffix`, and `hasPrefix` functions -- New aliases have been added for a few functions that didn't follow the naming conventions (`trimAll` and `abbrevBoth`) -- `trimall` and `abbrevboth` (notice the case) are deprecated and will be removed in 3.0.0 - -## Release 2.4.0 (2016-08-16) - -- Adds two functions: `until` and `untilStep` - -## Release 2.3.0 (2016-06-21) - -- cat: Concatenate strings with whitespace separators. -- replace: Replace parts of a string: `replace " " "-" "Me First"` renders "Me-First" -- plural: Format plurals: `len "foo" | plural "one foo" "many foos"` renders "many foos" -- indent: Indent blocks of text in a way that is sensitive to "\n" characters. - -## Release 2.2.0 (2016-04-21) - -- Added a `genPrivateKey` function (Thanks @bacongobbler) - -## Release 2.1.0 (2016-03-30) - -- `default` now prints the default value when it does not receive a value down the pipeline. It is much safer now to do `{{.Foo | default "bar"}}`. -- Added accessors for "hermetic" functions. These return only functions that, when given the same input, produce the same output. - -## Release 2.0.0 (2016-03-29) - -Because we switched from `int` to `int64` as the return value for all integer math functions, the library's major version number has been incremented. - -- `min` complements `max` (formerly `biggest`) -- `empty` indicates that a value is the empty value for its type -- `tuple` creates a tuple inside of a template: `{{$t := tuple "a", "b" "c"}}` -- `dict` creates a dictionary inside of a template `{{$d := dict "key1" "val1" "key2" "val2"}}` -- Date formatters have been added for HTML dates (as used in `date` input fields) -- Integer math functions can convert from a number of types, including `string` (via `strconv.ParseInt`). - -## Release 1.2.0 (2016-02-01) - -- Added quote and squote -- Added b32enc and b32dec -- add now takes varargs -- biggest now takes varargs - -## Release 1.1.0 (2015-12-29) - -- Added #4: Added contains function. strings.Contains, but with the arguments - switched to simplify common pipelines. (thanks krancour) -- Added Travis-CI testing support - -## Release 1.0.0 (2015-12-23) - -- Initial release diff --git a/vendor/github.com/Masterminds/sprig/LICENSE.txt b/vendor/github.com/Masterminds/sprig/LICENSE.txt deleted file mode 100644 index 5c95accc2e..0000000000 --- a/vendor/github.com/Masterminds/sprig/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Sprig -Copyright (C) 2013 Masterminds - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/sprig/Makefile b/vendor/github.com/Masterminds/sprig/Makefile deleted file mode 100644 index 63a93fdf79..0000000000 --- a/vendor/github.com/Masterminds/sprig/Makefile +++ /dev/null @@ -1,13 +0,0 @@ - -HAS_GLIDE := $(shell command -v glide;) - -.PHONY: test -test: - go test -v . - -.PHONY: setup -setup: -ifndef HAS_GLIDE - go get -u github.com/Masterminds/glide -endif - glide install diff --git a/vendor/github.com/Masterminds/sprig/README.md b/vendor/github.com/Masterminds/sprig/README.md deleted file mode 100644 index b70569585f..0000000000 --- a/vendor/github.com/Masterminds/sprig/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# Sprig: Template functions for Go templates -[![Stability: Sustained](https://masterminds.github.io/stability/sustained.svg)](https://masterminds.github.io/stability/sustained.html) -[![Build Status](https://travis-ci.org/Masterminds/sprig.svg?branch=master)](https://travis-ci.org/Masterminds/sprig) - -The Go language comes with a [built-in template -language](http://golang.org/pkg/text/template/), but not -very many template functions. Sprig is a library that provides more than 100 commonly -used template functions. - -It is inspired by the template functions found in -[Twig](http://twig.sensiolabs.org/documentation) and in various -JavaScript libraries, such as [underscore.js](http://underscorejs.org/). - -## Usage - -**Template developers**: Please use Sprig's [function documentation](http://masterminds.github.io/sprig/) for -detailed instructions and code snippets for the >100 template functions available. - -**Go developers**: If you'd like to include Sprig as a library in your program, -our API documentation is available [at GoDoc.org](http://godoc.org/github.com/Masterminds/sprig). - -For standard usage, read on. - -### Load the Sprig library - -To load the Sprig `FuncMap`: - -```go - -import ( - "github.com/Masterminds/sprig" - "html/template" -) - -// This example illustrates that the FuncMap *must* be set before the -// templates themselves are loaded. -tpl := template.Must( - template.New("base").Funcs(sprig.FuncMap()).ParseGlob("*.html") -) - - -``` - -### Calling the functions inside of templates - -By convention, all functions are lowercase. This seems to follow the Go -idiom for template functions (as opposed to template methods, which are -TitleCase). For example, this: - -``` -{{ "hello!" | upper | repeat 5 }} -``` - -produces this: - -``` -HELLO!HELLO!HELLO!HELLO!HELLO! -``` - -## Principles Driving Our Function Selection - -We followed these principles to decide which functions to add and how to implement them: - -- Use template functions to build layout. The following - types of operations are within the domain of template functions: - - Formatting - - Layout - - Simple type conversions - - Utilities that assist in handling common formatting and layout needs (e.g. arithmetic) -- Template functions should not return errors unless there is no way to print - a sensible value. For example, converting a string to an integer should not - produce an error if conversion fails. Instead, it should display a default - value. -- Simple math is necessary for grid layouts, pagers, and so on. Complex math - (anything other than arithmetic) should be done outside of templates. -- Template functions only deal with the data passed into them. They never retrieve - data from a source. -- Finally, do not override core Go template functions. diff --git a/vendor/github.com/Masterminds/sprig/appveyor.yml b/vendor/github.com/Masterminds/sprig/appveyor.yml deleted file mode 100644 index d545a987a3..0000000000 --- a/vendor/github.com/Masterminds/sprig/appveyor.yml +++ /dev/null @@ -1,26 +0,0 @@ - -version: build-{build}.{branch} - -clone_folder: C:\gopath\src\github.com\Masterminds\sprig -shallow_clone: true - -environment: - GOPATH: C:\gopath - -platform: - - x64 - -install: - - go get -u github.com/Masterminds/glide - - set PATH=%GOPATH%\bin;%PATH% - - go version - - go env - -build_script: - - glide install - - go install ./... - -test_script: - - go test -v - -deploy: off diff --git a/vendor/github.com/Masterminds/sprig/crypto.go b/vendor/github.com/Masterminds/sprig/crypto.go deleted file mode 100644 index 7a418ba88d..0000000000 --- a/vendor/github.com/Masterminds/sprig/crypto.go +++ /dev/null @@ -1,502 +0,0 @@ -package sprig - -import ( - "bytes" - "crypto/aes" - "crypto/cipher" - "crypto/dsa" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/hmac" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/sha256" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/binary" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "io" - "hash/adler32" - "math/big" - "net" - "time" - - "github.com/google/uuid" - "golang.org/x/crypto/scrypt" -) - -func sha256sum(input string) string { - hash := sha256.Sum256([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func sha1sum(input string) string { - hash := sha1.Sum([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func adler32sum(input string) string { - hash := adler32.Checksum([]byte(input)) - return fmt.Sprintf("%d", hash) -} - -// uuidv4 provides a safe and secure UUID v4 implementation -func uuidv4() string { - return fmt.Sprintf("%s", uuid.New()) -} - -var master_password_seed = "com.lyndir.masterpassword" - -var password_type_templates = map[string][][]byte{ - "maximum": {[]byte("anoxxxxxxxxxxxxxxxxx"), []byte("axxxxxxxxxxxxxxxxxno")}, - "long": {[]byte("CvcvnoCvcvCvcv"), []byte("CvcvCvcvnoCvcv"), []byte("CvcvCvcvCvcvno"), []byte("CvccnoCvcvCvcv"), []byte("CvccCvcvnoCvcv"), - []byte("CvccCvcvCvcvno"), []byte("CvcvnoCvccCvcv"), []byte("CvcvCvccnoCvcv"), []byte("CvcvCvccCvcvno"), []byte("CvcvnoCvcvCvcc"), - []byte("CvcvCvcvnoCvcc"), []byte("CvcvCvcvCvccno"), []byte("CvccnoCvccCvcv"), []byte("CvccCvccnoCvcv"), []byte("CvccCvccCvcvno"), - []byte("CvcvnoCvccCvcc"), []byte("CvcvCvccnoCvcc"), []byte("CvcvCvccCvccno"), []byte("CvccnoCvcvCvcc"), []byte("CvccCvcvnoCvcc"), - []byte("CvccCvcvCvccno")}, - "medium": {[]byte("CvcnoCvc"), []byte("CvcCvcno")}, - "short": {[]byte("Cvcn")}, - "basic": {[]byte("aaanaaan"), []byte("aannaaan"), []byte("aaannaaa")}, - "pin": {[]byte("nnnn")}, -} - -var template_characters = map[byte]string{ - 'V': "AEIOU", - 'C': "BCDFGHJKLMNPQRSTVWXYZ", - 'v': "aeiou", - 'c': "bcdfghjklmnpqrstvwxyz", - 'A': "AEIOUBCDFGHJKLMNPQRSTVWXYZ", - 'a': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz", - 'n': "0123456789", - 'o': "@&%?,=[]_:-+*$#!'^~;()/.", - 'x': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&*()", -} - -func derivePassword(counter uint32, password_type, password, user, site string) string { - var templates = password_type_templates[password_type] - if templates == nil { - return fmt.Sprintf("cannot find password template %s", password_type) - } - - var buffer bytes.Buffer - buffer.WriteString(master_password_seed) - binary.Write(&buffer, binary.BigEndian, uint32(len(user))) - buffer.WriteString(user) - - salt := buffer.Bytes() - key, err := scrypt.Key([]byte(password), salt, 32768, 8, 2, 64) - if err != nil { - return fmt.Sprintf("failed to derive password: %s", err) - } - - buffer.Truncate(len(master_password_seed)) - binary.Write(&buffer, binary.BigEndian, uint32(len(site))) - buffer.WriteString(site) - binary.Write(&buffer, binary.BigEndian, counter) - - var hmacv = hmac.New(sha256.New, key) - hmacv.Write(buffer.Bytes()) - var seed = hmacv.Sum(nil) - var temp = templates[int(seed[0])%len(templates)] - - buffer.Truncate(0) - for i, element := range temp { - pass_chars := template_characters[element] - pass_char := pass_chars[int(seed[i+1])%len(pass_chars)] - buffer.WriteByte(pass_char) - } - - return buffer.String() -} - -func generatePrivateKey(typ string) string { - var priv interface{} - var err error - switch typ { - case "", "rsa": - // good enough for government work - priv, err = rsa.GenerateKey(rand.Reader, 4096) - case "dsa": - key := new(dsa.PrivateKey) - // again, good enough for government work - if err = dsa.GenerateParameters(&key.Parameters, rand.Reader, dsa.L2048N256); err != nil { - return fmt.Sprintf("failed to generate dsa params: %s", err) - } - err = dsa.GenerateKey(key, rand.Reader) - priv = key - case "ecdsa": - // again, good enough for government work - priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - default: - return "Unknown type " + typ - } - if err != nil { - return fmt.Sprintf("failed to generate private key: %s", err) - } - - return string(pem.EncodeToMemory(pemBlockForKey(priv))) -} - -type DSAKeyFormat struct { - Version int - P, Q, G, Y, X *big.Int -} - -func pemBlockForKey(priv interface{}) *pem.Block { - switch k := priv.(type) { - case *rsa.PrivateKey: - return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} - case *dsa.PrivateKey: - val := DSAKeyFormat{ - P: k.P, Q: k.Q, G: k.G, - Y: k.Y, X: k.X, - } - bytes, _ := asn1.Marshal(val) - return &pem.Block{Type: "DSA PRIVATE KEY", Bytes: bytes} - case *ecdsa.PrivateKey: - b, _ := x509.MarshalECPrivateKey(k) - return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b} - default: - return nil - } -} - -type certificate struct { - Cert string - Key string -} - -func buildCustomCertificate(b64cert string, b64key string) (certificate, error) { - crt := certificate{} - - cert, err := base64.StdEncoding.DecodeString(b64cert) - if err != nil { - return crt, errors.New("unable to decode base64 certificate") - } - - key, err := base64.StdEncoding.DecodeString(b64key) - if err != nil { - return crt, errors.New("unable to decode base64 private key") - } - - decodedCert, _ := pem.Decode(cert) - if decodedCert == nil { - return crt, errors.New("unable to decode certificate") - } - _, err = x509.ParseCertificate(decodedCert.Bytes) - if err != nil { - return crt, fmt.Errorf( - "error parsing certificate: decodedCert.Bytes: %s", - err, - ) - } - - decodedKey, _ := pem.Decode(key) - if decodedKey == nil { - return crt, errors.New("unable to decode key") - } - _, err = x509.ParsePKCS1PrivateKey(decodedKey.Bytes) - if err != nil { - return crt, fmt.Errorf( - "error parsing prive key: decodedKey.Bytes: %s", - err, - ) - } - - crt.Cert = string(cert) - crt.Key = string(key) - - return crt, nil -} - -func generateCertificateAuthority( - cn string, - daysValid int, -) (certificate, error) { - ca := certificate{} - - template, err := getBaseCertTemplate(cn, nil, nil, daysValid) - if err != nil { - return ca, err - } - // Override KeyUsage and IsCA - template.KeyUsage = x509.KeyUsageKeyEncipherment | - x509.KeyUsageDigitalSignature | - x509.KeyUsageCertSign - template.IsCA = true - - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return ca, fmt.Errorf("error generating rsa key: %s", err) - } - - ca.Cert, ca.Key, err = getCertAndKey(template, priv, template, priv) - if err != nil { - return ca, err - } - - return ca, nil -} - -func generateSelfSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (certificate, error) { - cert := certificate{} - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return cert, fmt.Errorf("error generating rsa key: %s", err) - } - - cert.Cert, cert.Key, err = getCertAndKey(template, priv, template, priv) - if err != nil { - return cert, err - } - - return cert, nil -} - -func generateSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, -) (certificate, error) { - cert := certificate{} - - decodedSignerCert, _ := pem.Decode([]byte(ca.Cert)) - if decodedSignerCert == nil { - return cert, errors.New("unable to decode certificate") - } - signerCert, err := x509.ParseCertificate(decodedSignerCert.Bytes) - if err != nil { - return cert, fmt.Errorf( - "error parsing certificate: decodedSignerCert.Bytes: %s", - err, - ) - } - decodedSignerKey, _ := pem.Decode([]byte(ca.Key)) - if decodedSignerKey == nil { - return cert, errors.New("unable to decode key") - } - signerKey, err := x509.ParsePKCS1PrivateKey(decodedSignerKey.Bytes) - if err != nil { - return cert, fmt.Errorf( - "error parsing prive key: decodedSignerKey.Bytes: %s", - err, - ) - } - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return cert, fmt.Errorf("error generating rsa key: %s", err) - } - - cert.Cert, cert.Key, err = getCertAndKey( - template, - priv, - signerCert, - signerKey, - ) - if err != nil { - return cert, err - } - - return cert, nil -} - -func getCertAndKey( - template *x509.Certificate, - signeeKey *rsa.PrivateKey, - parent *x509.Certificate, - signingKey *rsa.PrivateKey, -) (string, string, error) { - derBytes, err := x509.CreateCertificate( - rand.Reader, - template, - parent, - &signeeKey.PublicKey, - signingKey, - ) - if err != nil { - return "", "", fmt.Errorf("error creating certificate: %s", err) - } - - certBuffer := bytes.Buffer{} - if err := pem.Encode( - &certBuffer, - &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}, - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding certificate: %s", err) - } - - keyBuffer := bytes.Buffer{} - if err := pem.Encode( - &keyBuffer, - &pem.Block{ - Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(signeeKey), - }, - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding key: %s", err) - } - - return string(certBuffer.Bytes()), string(keyBuffer.Bytes()), nil -} - -func getBaseCertTemplate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (*x509.Certificate, error) { - ipAddresses, err := getNetIPs(ips) - if err != nil { - return nil, err - } - dnsNames, err := getAlternateDNSStrs(alternateDNS) - if err != nil { - return nil, err - } - serialNumberUpperBound := new(big.Int).Lsh(big.NewInt(1), 128) - serialNumber, err := rand.Int(rand.Reader, serialNumberUpperBound) - if err != nil { - return nil, err - } - return &x509.Certificate{ - SerialNumber: serialNumber, - Subject: pkix.Name{ - CommonName: cn, - }, - IPAddresses: ipAddresses, - DNSNames: dnsNames, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * time.Duration(daysValid)), - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, - ExtKeyUsage: []x509.ExtKeyUsage{ - x509.ExtKeyUsageServerAuth, - x509.ExtKeyUsageClientAuth, - }, - BasicConstraintsValid: true, - }, nil -} - -func getNetIPs(ips []interface{}) ([]net.IP, error) { - if ips == nil { - return []net.IP{}, nil - } - var ipStr string - var ok bool - var netIP net.IP - netIPs := make([]net.IP, len(ips)) - for i, ip := range ips { - ipStr, ok = ip.(string) - if !ok { - return nil, fmt.Errorf("error parsing ip: %v is not a string", ip) - } - netIP = net.ParseIP(ipStr) - if netIP == nil { - return nil, fmt.Errorf("error parsing ip: %s", ipStr) - } - netIPs[i] = netIP - } - return netIPs, nil -} - -func getAlternateDNSStrs(alternateDNS []interface{}) ([]string, error) { - if alternateDNS == nil { - return []string{}, nil - } - var dnsStr string - var ok bool - alternateDNSStrs := make([]string, len(alternateDNS)) - for i, dns := range alternateDNS { - dnsStr, ok = dns.(string) - if !ok { - return nil, fmt.Errorf( - "error processing alternate dns name: %v is not a string", - dns, - ) - } - alternateDNSStrs[i] = dnsStr - } - return alternateDNSStrs, nil -} - -func encryptAES(password string, plaintext string) (string, error) { - if plaintext == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - content := []byte(plaintext) - blockSize := block.BlockSize() - padding := blockSize - len(content)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - content = append(content, padtext...) - - ciphertext := make([]byte, aes.BlockSize+len(content)) - - iv := ciphertext[:aes.BlockSize] - if _, err := io.ReadFull(rand.Reader, iv); err != nil { - return "", err - } - - mode := cipher.NewCBCEncrypter(block, iv) - mode.CryptBlocks(ciphertext[aes.BlockSize:], content) - - return base64.StdEncoding.EncodeToString(ciphertext), nil -} - -func decryptAES(password string, crypt64 string) (string, error) { - if crypt64 == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - - crypt, err := base64.StdEncoding.DecodeString(crypt64) - if err != nil { - return "", err - } - - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - iv := crypt[:aes.BlockSize] - crypt = crypt[aes.BlockSize:] - decrypted := make([]byte, len(crypt)) - mode := cipher.NewCBCDecrypter(block, iv) - mode.CryptBlocks(decrypted, crypt) - - return string(decrypted[:len(decrypted)-int(decrypted[len(decrypted)-1])]), nil -} diff --git a/vendor/github.com/Masterminds/sprig/date.go b/vendor/github.com/Masterminds/sprig/date.go deleted file mode 100644 index d1d6155d72..0000000000 --- a/vendor/github.com/Masterminds/sprig/date.go +++ /dev/null @@ -1,83 +0,0 @@ -package sprig - -import ( - "strconv" - "time" -) - -// Given a format and a date, format the date string. -// -// Date can be a `time.Time` or an `int, int32, int64`. -// In the later case, it is treated as seconds since UNIX -// epoch. -func date(fmt string, date interface{}) string { - return dateInZone(fmt, date, "Local") -} - -func htmlDate(date interface{}) string { - return dateInZone("2006-01-02", date, "Local") -} - -func htmlDateInZone(date interface{}, zone string) string { - return dateInZone("2006-01-02", date, zone) -} - -func dateInZone(fmt string, date interface{}, zone string) string { - var t time.Time - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case *time.Time: - t = *date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - case int32: - t = time.Unix(int64(date), 0) - } - - loc, err := time.LoadLocation(zone) - if err != nil { - loc, _ = time.LoadLocation("UTC") - } - - return t.In(loc).Format(fmt) -} - -func dateModify(fmt string, date time.Time) time.Time { - d, err := time.ParseDuration(fmt) - if err != nil { - return date - } - return date.Add(d) -} - -func dateAgo(date interface{}) string { - var t time.Time - - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - } - // Drop resolution to seconds - duration := time.Since(t).Round(time.Second) - return duration.String() -} - -func toDate(fmt, str string) time.Time { - t, _ := time.ParseInLocation(fmt, str, time.Local) - return t -} - -func unixEpoch(date time.Time) string { - return strconv.FormatInt(date.Unix(), 10) -} diff --git a/vendor/github.com/Masterminds/sprig/defaults.go b/vendor/github.com/Masterminds/sprig/defaults.go deleted file mode 100644 index ed6a8ab291..0000000000 --- a/vendor/github.com/Masterminds/sprig/defaults.go +++ /dev/null @@ -1,83 +0,0 @@ -package sprig - -import ( - "encoding/json" - "reflect" -) - -// dfault checks whether `given` is set, and returns default if not set. -// -// This returns `d` if `given` appears not to be set, and `given` otherwise. -// -// For numeric types 0 is unset. -// For strings, maps, arrays, and slices, len() = 0 is considered unset. -// For bool, false is unset. -// Structs are never considered unset. -// -// For everything else, including pointers, a nil value is unset. -func dfault(d interface{}, given ...interface{}) interface{} { - - if empty(given) || empty(given[0]) { - return d - } - return given[0] -} - -// empty returns true if the given value has the zero value for its type. -func empty(given interface{}) bool { - g := reflect.ValueOf(given) - if !g.IsValid() { - return true - } - - // Basically adapted from text/template.isTrue - switch g.Kind() { - default: - return g.IsNil() - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return g.Len() == 0 - case reflect.Bool: - return g.Bool() == false - case reflect.Complex64, reflect.Complex128: - return g.Complex() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return g.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return g.Uint() == 0 - case reflect.Float32, reflect.Float64: - return g.Float() == 0 - case reflect.Struct: - return false - } -} - -// coalesce returns the first non-empty value. -func coalesce(v ...interface{}) interface{} { - for _, val := range v { - if !empty(val) { - return val - } - } - return nil -} - -// toJson encodes an item into a JSON string -func toJson(v interface{}) string { - output, _ := json.Marshal(v) - return string(output) -} - -// toPrettyJson encodes an item into a pretty (indented) JSON string -func toPrettyJson(v interface{}) string { - output, _ := json.MarshalIndent(v, "", " ") - return string(output) -} - -// ternary returns the first value if the last value is true, otherwise returns the second value. -func ternary(vt interface{}, vf interface{}, v bool) interface{} { - if v { - return vt - } - - return vf -} diff --git a/vendor/github.com/Masterminds/sprig/dict.go b/vendor/github.com/Masterminds/sprig/dict.go deleted file mode 100644 index 738405b433..0000000000 --- a/vendor/github.com/Masterminds/sprig/dict.go +++ /dev/null @@ -1,119 +0,0 @@ -package sprig - -import ( - "github.com/imdario/mergo" - "github.com/mitchellh/copystructure" -) - -func set(d map[string]interface{}, key string, value interface{}) map[string]interface{} { - d[key] = value - return d -} - -func unset(d map[string]interface{}, key string) map[string]interface{} { - delete(d, key) - return d -} - -func hasKey(d map[string]interface{}, key string) bool { - _, ok := d[key] - return ok -} - -func pluck(key string, d ...map[string]interface{}) []interface{} { - res := []interface{}{} - for _, dict := range d { - if val, ok := dict[key]; ok { - res = append(res, val) - } - } - return res -} - -func keys(dicts ...map[string]interface{}) []string { - k := []string{} - for _, dict := range dicts { - for key := range dict { - k = append(k, key) - } - } - return k -} - -func pick(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - for _, k := range keys { - if v, ok := dict[k]; ok { - res[k] = v - } - } - return res -} - -func omit(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - - omit := make(map[string]bool, len(keys)) - for _, k := range keys { - omit[k] = true - } - - for k, v := range dict { - if _, ok := omit[k]; !ok { - res[k] = v - } - } - return res -} - -func dict(v ...interface{}) map[string]interface{} { - dict := map[string]interface{}{} - lenv := len(v) - for i := 0; i < lenv; i += 2 { - key := strval(v[i]) - if i+1 >= lenv { - dict[key] = "" - continue - } - dict[key] = v[i+1] - } - return dict -} - -func merge(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.Merge(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func mergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.MergeWithOverwrite(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func values(dict map[string]interface{}) []interface{} { - values := []interface{}{} - for _, value := range dict { - values = append(values, value) - } - - return values -} - -func deepCopy(i interface{}) interface{} { - c, err := copystructure.Copy(i) - if err != nil { - panic("deepCopy error: " + err.Error()) - } - - return c -} diff --git a/vendor/github.com/Masterminds/sprig/doc.go b/vendor/github.com/Masterminds/sprig/doc.go deleted file mode 100644 index 8f8f1d7370..0000000000 --- a/vendor/github.com/Masterminds/sprig/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Sprig: Template functions for Go. - -This package contains a number of utility functions for working with data -inside of Go `html/template` and `text/template` files. - -To add these functions, use the `template.Funcs()` method: - - t := templates.New("foo").Funcs(sprig.FuncMap()) - -Note that you should add the function map before you parse any template files. - - In several cases, Sprig reverses the order of arguments from the way they - appear in the standard library. This is to make it easier to pipe - arguments into functions. - -See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions. -*/ -package sprig diff --git a/vendor/github.com/Masterminds/sprig/functions.go b/vendor/github.com/Masterminds/sprig/functions.go deleted file mode 100644 index 7b5b0af86c..0000000000 --- a/vendor/github.com/Masterminds/sprig/functions.go +++ /dev/null @@ -1,306 +0,0 @@ -package sprig - -import ( - "errors" - "html/template" - "os" - "path" - "reflect" - "strconv" - "strings" - ttemplate "text/template" - "time" - - util "github.com/Masterminds/goutils" - "github.com/huandu/xstrings" -) - -// Produce the function map. -// -// Use this to pass the functions into the template engine: -// -// tpl := template.New("foo").Funcs(sprig.FuncMap())) -// -func FuncMap() template.FuncMap { - return HtmlFuncMap() -} - -// HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions. -func HermeticTxtFuncMap() ttemplate.FuncMap { - r := TxtFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions. -func HermeticHtmlFuncMap() template.FuncMap { - r := HtmlFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// TxtFuncMap returns a 'text/template'.FuncMap -func TxtFuncMap() ttemplate.FuncMap { - return ttemplate.FuncMap(GenericFuncMap()) -} - -// HtmlFuncMap returns an 'html/template'.Funcmap -func HtmlFuncMap() template.FuncMap { - return template.FuncMap(GenericFuncMap()) -} - -// GenericFuncMap returns a copy of the basic function map as a map[string]interface{}. -func GenericFuncMap() map[string]interface{} { - gfm := make(map[string]interface{}, len(genericMap)) - for k, v := range genericMap { - gfm[k] = v - } - return gfm -} - -// These functions are not guaranteed to evaluate to the same result for given input, because they -// refer to the environemnt or global state. -var nonhermeticFunctions = []string{ - // Date functions - "date", - "date_in_zone", - "date_modify", - "now", - "htmlDate", - "htmlDateInZone", - "dateInZone", - "dateModify", - - // Strings - "randAlphaNum", - "randAlpha", - "randAscii", - "randNumeric", - "uuidv4", - - // OS - "env", - "expandenv", - - // Network - "getHostByName", -} - -var genericMap = map[string]interface{}{ - "hello": func() string { return "Hello!" }, - - // Date functions - "date": date, - "date_in_zone": dateInZone, - "date_modify": dateModify, - "now": func() time.Time { return time.Now() }, - "htmlDate": htmlDate, - "htmlDateInZone": htmlDateInZone, - "dateInZone": dateInZone, - "dateModify": dateModify, - "ago": dateAgo, - "toDate": toDate, - "unixEpoch": unixEpoch, - - // Strings - "abbrev": abbrev, - "abbrevboth": abbrevboth, - "trunc": trunc, - "trim": strings.TrimSpace, - "upper": strings.ToUpper, - "lower": strings.ToLower, - "title": strings.Title, - "untitle": untitle, - "substr": substring, - // Switch order so that "foo" | repeat 5 - "repeat": func(count int, str string) string { return strings.Repeat(str, count) }, - // Deprecated: Use trimAll. - "trimall": func(a, b string) string { return strings.Trim(b, a) }, - // Switch order so that "$foo" | trimall "$" - "trimAll": func(a, b string) string { return strings.Trim(b, a) }, - "trimSuffix": func(a, b string) string { return strings.TrimSuffix(b, a) }, - "trimPrefix": func(a, b string) string { return strings.TrimPrefix(b, a) }, - "nospace": util.DeleteWhiteSpace, - "initials": initials, - "randAlphaNum": randAlphaNumeric, - "randAlpha": randAlpha, - "randAscii": randAscii, - "randNumeric": randNumeric, - "swapcase": util.SwapCase, - "shuffle": xstrings.Shuffle, - "snakecase": xstrings.ToSnakeCase, - "camelcase": xstrings.ToCamelCase, - "kebabcase": xstrings.ToKebabCase, - "wrap": func(l int, s string) string { return util.Wrap(s, l) }, - "wrapWith": func(l int, sep, str string) string { return util.WrapCustom(str, l, sep, true) }, - // Switch order so that "foobar" | contains "foo" - "contains": func(substr string, str string) bool { return strings.Contains(str, substr) }, - "hasPrefix": func(substr string, str string) bool { return strings.HasPrefix(str, substr) }, - "hasSuffix": func(substr string, str string) bool { return strings.HasSuffix(str, substr) }, - "quote": quote, - "squote": squote, - "cat": cat, - "indent": indent, - "nindent": nindent, - "replace": replace, - "plural": plural, - "sha1sum": sha1sum, - "sha256sum": sha256sum, - "adler32sum": adler32sum, - "toString": strval, - - // Wrap Atoi to stop errors. - "atoi": func(a string) int { i, _ := strconv.Atoi(a); return i }, - "int64": toInt64, - "int": toInt, - "float64": toFloat64, - "toDecimal": toDecimal, - - //"gt": func(a, b int) bool {return a > b}, - //"gte": func(a, b int) bool {return a >= b}, - //"lt": func(a, b int) bool {return a < b}, - //"lte": func(a, b int) bool {return a <= b}, - - // split "/" foo/bar returns map[int]string{0: foo, 1: bar} - "split": split, - "splitList": func(sep, orig string) []string { return strings.Split(orig, sep) }, - // splitn "/" foo/bar/fuu returns map[int]string{0: foo, 1: bar/fuu} - "splitn": splitn, - "toStrings": strslice, - - "until": until, - "untilStep": untilStep, - - // VERY basic arithmetic. - "add1": func(i interface{}) int64 { return toInt64(i) + 1 }, - "add": func(i ...interface{}) int64 { - var a int64 = 0 - for _, b := range i { - a += toInt64(b) - } - return a - }, - "sub": func(a, b interface{}) int64 { return toInt64(a) - toInt64(b) }, - "div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) }, - "mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) }, - "mul": func(a interface{}, v ...interface{}) int64 { - val := toInt64(a) - for _, b := range v { - val = val * toInt64(b) - } - return val - }, - "biggest": max, - "max": max, - "min": min, - "ceil": ceil, - "floor": floor, - "round": round, - - // string slices. Note that we reverse the order b/c that's better - // for template processing. - "join": join, - "sortAlpha": sortAlpha, - - // Defaults - "default": dfault, - "empty": empty, - "coalesce": coalesce, - "compact": compact, - "deepCopy": deepCopy, - "toJson": toJson, - "toPrettyJson": toPrettyJson, - "ternary": ternary, - - // Reflection - "typeOf": typeOf, - "typeIs": typeIs, - "typeIsLike": typeIsLike, - "kindOf": kindOf, - "kindIs": kindIs, - "deepEqual": reflect.DeepEqual, - - // OS: - "env": func(s string) string { return os.Getenv(s) }, - "expandenv": func(s string) string { return os.ExpandEnv(s) }, - - // Network: - "getHostByName": getHostByName, - - // File Paths: - "base": path.Base, - "dir": path.Dir, - "clean": path.Clean, - "ext": path.Ext, - "isAbs": path.IsAbs, - - // Encoding: - "b64enc": base64encode, - "b64dec": base64decode, - "b32enc": base32encode, - "b32dec": base32decode, - - // Data Structures: - "tuple": list, // FIXME: with the addition of append/prepend these are no longer immutable. - "list": list, - "dict": dict, - "set": set, - "unset": unset, - "hasKey": hasKey, - "pluck": pluck, - "keys": keys, - "pick": pick, - "omit": omit, - "merge": merge, - "mergeOverwrite": mergeOverwrite, - "values": values, - - "append": push, "push": push, - "prepend": prepend, - "first": first, - "rest": rest, - "last": last, - "initial": initial, - "reverse": reverse, - "uniq": uniq, - "without": without, - "has": has, - "slice": slice, - "concat": concat, - - // Crypto: - "genPrivateKey": generatePrivateKey, - "derivePassword": derivePassword, - "buildCustomCert": buildCustomCertificate, - "genCA": generateCertificateAuthority, - "genSelfSignedCert": generateSelfSignedCertificate, - "genSignedCert": generateSignedCertificate, - "encryptAES": encryptAES, - "decryptAES": decryptAES, - - // UUIDs: - "uuidv4": uuidv4, - - // SemVer: - "semver": semver, - "semverCompare": semverCompare, - - // Flow Control: - "fail": func(msg string) (string, error) { return "", errors.New(msg) }, - - // Regex - "regexMatch": regexMatch, - "regexFindAll": regexFindAll, - "regexFind": regexFind, - "regexReplaceAll": regexReplaceAll, - "regexReplaceAllLiteral": regexReplaceAllLiteral, - "regexSplit": regexSplit, - - // URLs: - "urlParse": urlParse, - "urlJoin": urlJoin, -} diff --git a/vendor/github.com/Masterminds/sprig/glide.yaml b/vendor/github.com/Masterminds/sprig/glide.yaml deleted file mode 100644 index f317d2b2b1..0000000000 --- a/vendor/github.com/Masterminds/sprig/glide.yaml +++ /dev/null @@ -1,19 +0,0 @@ -package: github.com/Masterminds/sprig -import: -- package: github.com/Masterminds/goutils - version: ^1.0.0 -- package: github.com/google/uuid - version: ^1.0.0 -- package: golang.org/x/crypto - subpackages: - - scrypt -- package: github.com/Masterminds/semver - version: ^v1.2.2 -- package: github.com/stretchr/testify - version: ^v1.2.2 -- package: github.com/imdario/mergo - version: ~0.3.7 -- package: github.com/huandu/xstrings - version: ^1.2 -- package: github.com/mitchellh/copystructure - version: ^1.0.0 diff --git a/vendor/github.com/Masterminds/sprig/list.go b/vendor/github.com/Masterminds/sprig/list.go deleted file mode 100644 index c0381bbb65..0000000000 --- a/vendor/github.com/Masterminds/sprig/list.go +++ /dev/null @@ -1,311 +0,0 @@ -package sprig - -import ( - "fmt" - "reflect" - "sort" -) - -// Reflection is used in these functions so that slices and arrays of strings, -// ints, and other types not implementing []interface{} can be worked with. -// For example, this is useful if you need to work on the output of regexs. - -func list(v ...interface{}) []interface{} { - return v -} - -func push(list interface{}, v interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append(nl, v) - - default: - panic(fmt.Sprintf("Cannot push on type %s", tp)) - } -} - -func prepend(list interface{}, v interface{}) []interface{} { - //return append([]interface{}{v}, list...) - - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append([]interface{}{v}, nl...) - - default: - panic(fmt.Sprintf("Cannot prepend on type %s", tp)) - } -} - -func last(list interface{}) interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil - } - - return l2.Index(l - 1).Interface() - default: - panic(fmt.Sprintf("Cannot find last on type %s", tp)) - } -} - -func first(list interface{}) interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil - } - - return l2.Index(0).Interface() - default: - panic(fmt.Sprintf("Cannot find first on type %s", tp)) - } -} - -func rest(list interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil - } - - nl := make([]interface{}, l-1) - for i := 1; i < l; i++ { - nl[i-1] = l2.Index(i).Interface() - } - - return nl - default: - panic(fmt.Sprintf("Cannot find rest on type %s", tp)) - } -} - -func initial(list interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil - } - - nl := make([]interface{}, l-1) - for i := 0; i < l-1; i++ { - nl[i] = l2.Index(i).Interface() - } - - return nl - default: - panic(fmt.Sprintf("Cannot find initial on type %s", tp)) - } -} - -func sortAlpha(list interface{}) []string { - k := reflect.Indirect(reflect.ValueOf(list)).Kind() - switch k { - case reflect.Slice, reflect.Array: - a := strslice(list) - s := sort.StringSlice(a) - s.Sort() - return s - } - return []string{strval(list)} -} - -func reverse(v interface{}) []interface{} { - tp := reflect.TypeOf(v).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(v) - - l := l2.Len() - // We do not sort in place because the incoming array should not be altered. - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[l-i-1] = l2.Index(i).Interface() - } - - return nl - default: - panic(fmt.Sprintf("Cannot find reverse on type %s", tp)) - } -} - -func compact(list interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !empty(item) { - nl = append(nl, item) - } - } - - return nl - default: - panic(fmt.Sprintf("Cannot compact on type %s", tp)) - } -} - -func uniq(list interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - dest := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(dest, item) { - dest = append(dest, item) - } - } - - return dest - default: - panic(fmt.Sprintf("Cannot find uniq on type %s", tp)) - } -} - -func inList(haystack []interface{}, needle interface{}) bool { - for _, h := range haystack { - if reflect.DeepEqual(needle, h) { - return true - } - } - return false -} - -func without(list interface{}, omit ...interface{}) []interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - res := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(omit, item) { - res = append(res, item) - } - } - - return res - default: - panic(fmt.Sprintf("Cannot find without on type %s", tp)) - } -} - -func has(needle interface{}, haystack interface{}) bool { - if haystack == nil { - return false - } - tp := reflect.TypeOf(haystack).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(haystack) - var item interface{} - l := l2.Len() - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if reflect.DeepEqual(needle, item) { - return true - } - } - - return false - default: - panic(fmt.Sprintf("Cannot find has on type %s", tp)) - } -} - -// $list := [1, 2, 3, 4, 5] -// slice $list -> list[0:5] = list[:] -// slice $list 0 3 -> list[0:3] = list[:3] -// slice $list 3 5 -> list[3:5] -// slice $list 3 -> list[3:5] = list[3:] -func slice(list interface{}, indices ...interface{}) interface{} { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil - } - - var start, end int - if len(indices) > 0 { - start = toInt(indices[0]) - } - if len(indices) < 2 { - end = l - } else { - end = toInt(indices[1]) - } - - return l2.Slice(start, end).Interface() - default: - panic(fmt.Sprintf("list should be type of slice or array but %s", tp)) - } -} - -func concat(lists ...interface{}) interface{} { - var res []interface{} - for _, list := range lists { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - for i := 0; i < l2.Len(); i++ { - res = append(res, l2.Index(i).Interface()) - } - default: - panic(fmt.Sprintf("Cannot concat type %s as list", tp)) - } - } - return res -} diff --git a/vendor/github.com/Masterminds/sprig/network.go b/vendor/github.com/Masterminds/sprig/network.go deleted file mode 100644 index d786cc7363..0000000000 --- a/vendor/github.com/Masterminds/sprig/network.go +++ /dev/null @@ -1,12 +0,0 @@ -package sprig - -import ( - "math/rand" - "net" -) - -func getHostByName(name string) string { - addrs, _ := net.LookupHost(name) - //TODO: add error handing when release v3 cames out - return addrs[rand.Intn(len(addrs))] -} diff --git a/vendor/github.com/Masterminds/sprig/numeric.go b/vendor/github.com/Masterminds/sprig/numeric.go deleted file mode 100644 index f4af4af2a7..0000000000 --- a/vendor/github.com/Masterminds/sprig/numeric.go +++ /dev/null @@ -1,169 +0,0 @@ -package sprig - -import ( - "fmt" - "math" - "reflect" - "strconv" -) - -// toFloat64 converts 64-bit floats -func toFloat64(v interface{}) float64 { - if str, ok := v.(string); ok { - iv, err := strconv.ParseFloat(str, 64) - if err != nil { - return 0 - } - return iv - } - - val := reflect.Indirect(reflect.ValueOf(v)) - switch val.Kind() { - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return float64(val.Int()) - case reflect.Uint8, reflect.Uint16, reflect.Uint32: - return float64(val.Uint()) - case reflect.Uint, reflect.Uint64: - return float64(val.Uint()) - case reflect.Float32, reflect.Float64: - return val.Float() - case reflect.Bool: - if val.Bool() == true { - return 1 - } - return 0 - default: - return 0 - } -} - -func toInt(v interface{}) int { - //It's not optimal. Bud I don't want duplicate toInt64 code. - return int(toInt64(v)) -} - -// toInt64 converts integer types to 64-bit integers -func toInt64(v interface{}) int64 { - if str, ok := v.(string); ok { - iv, err := strconv.ParseInt(str, 10, 64) - if err != nil { - return 0 - } - return iv - } - - val := reflect.Indirect(reflect.ValueOf(v)) - switch val.Kind() { - case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: - return val.Int() - case reflect.Uint8, reflect.Uint16, reflect.Uint32: - return int64(val.Uint()) - case reflect.Uint, reflect.Uint64: - tv := val.Uint() - if tv <= math.MaxInt64 { - return int64(tv) - } - // TODO: What is the sensible thing to do here? - return math.MaxInt64 - case reflect.Float32, reflect.Float64: - return int64(val.Float()) - case reflect.Bool: - if val.Bool() == true { - return 1 - } - return 0 - default: - return 0 - } -} - -func max(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb > aa { - aa = bb - } - } - return aa -} - -func min(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb < aa { - aa = bb - } - } - return aa -} - -func until(count int) []int { - step := 1 - if count < 0 { - step = -1 - } - return untilStep(0, count, step) -} - -func untilStep(start, stop, step int) []int { - v := []int{} - - if stop < start { - if step >= 0 { - return v - } - for i := start; i > stop; i += step { - v = append(v, i) - } - return v - } - - if step <= 0 { - return v - } - for i := start; i < stop; i += step { - v = append(v, i) - } - return v -} - -func floor(a interface{}) float64 { - aa := toFloat64(a) - return math.Floor(aa) -} - -func ceil(a interface{}) float64 { - aa := toFloat64(a) - return math.Ceil(aa) -} - -func round(a interface{}, p int, r_opt ...float64) float64 { - roundOn := .5 - if len(r_opt) > 0 { - roundOn = r_opt[0] - } - val := toFloat64(a) - places := toFloat64(p) - - var round float64 - pow := math.Pow(10, places) - digit := pow * val - _, div := math.Modf(digit) - if div >= roundOn { - round = math.Ceil(digit) - } else { - round = math.Floor(digit) - } - return round / pow -} - -// converts unix octal to decimal -func toDecimal(v interface{}) int64 { - result, err := strconv.ParseInt(fmt.Sprint(v), 8, 64) - if err != nil { - return 0 - } - return result -} diff --git a/vendor/github.com/Masterminds/sprig/reflect.go b/vendor/github.com/Masterminds/sprig/reflect.go deleted file mode 100644 index 8a65c132f0..0000000000 --- a/vendor/github.com/Masterminds/sprig/reflect.go +++ /dev/null @@ -1,28 +0,0 @@ -package sprig - -import ( - "fmt" - "reflect" -) - -// typeIs returns true if the src is the type named in target. -func typeIs(target string, src interface{}) bool { - return target == typeOf(src) -} - -func typeIsLike(target string, src interface{}) bool { - t := typeOf(src) - return target == t || "*"+target == t -} - -func typeOf(src interface{}) string { - return fmt.Sprintf("%T", src) -} - -func kindIs(target string, src interface{}) bool { - return target == kindOf(src) -} - -func kindOf(src interface{}) string { - return reflect.ValueOf(src).Kind().String() -} diff --git a/vendor/github.com/Masterminds/sprig/regex.go b/vendor/github.com/Masterminds/sprig/regex.go deleted file mode 100644 index 2016f66336..0000000000 --- a/vendor/github.com/Masterminds/sprig/regex.go +++ /dev/null @@ -1,35 +0,0 @@ -package sprig - -import ( - "regexp" -) - -func regexMatch(regex string, s string) bool { - match, _ := regexp.MatchString(regex, s) - return match -} - -func regexFindAll(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.FindAllString(s, n) -} - -func regexFind(regex string, s string) string { - r := regexp.MustCompile(regex) - return r.FindString(s) -} - -func regexReplaceAll(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllString(s, repl) -} - -func regexReplaceAllLiteral(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllLiteralString(s, repl) -} - -func regexSplit(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.Split(s, n) -} diff --git a/vendor/github.com/Masterminds/sprig/semver.go b/vendor/github.com/Masterminds/sprig/semver.go deleted file mode 100644 index c2bf8a1fdf..0000000000 --- a/vendor/github.com/Masterminds/sprig/semver.go +++ /dev/null @@ -1,23 +0,0 @@ -package sprig - -import ( - sv2 "github.com/Masterminds/semver" -) - -func semverCompare(constraint, version string) (bool, error) { - c, err := sv2.NewConstraint(constraint) - if err != nil { - return false, err - } - - v, err := sv2.NewVersion(version) - if err != nil { - return false, err - } - - return c.Check(v), nil -} - -func semver(version string) (*sv2.Version, error) { - return sv2.NewVersion(version) -} diff --git a/vendor/github.com/Masterminds/sprig/strings.go b/vendor/github.com/Masterminds/sprig/strings.go deleted file mode 100644 index 943fa3e8ad..0000000000 --- a/vendor/github.com/Masterminds/sprig/strings.go +++ /dev/null @@ -1,233 +0,0 @@ -package sprig - -import ( - "encoding/base32" - "encoding/base64" - "fmt" - "reflect" - "strconv" - "strings" - - util "github.com/Masterminds/goutils" -) - -func base64encode(v string) string { - return base64.StdEncoding.EncodeToString([]byte(v)) -} - -func base64decode(v string) string { - data, err := base64.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func base32encode(v string) string { - return base32.StdEncoding.EncodeToString([]byte(v)) -} - -func base32decode(v string) string { - data, err := base32.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func abbrev(width int, s string) string { - if width < 4 { - return s - } - r, _ := util.Abbreviate(s, width) - return r -} - -func abbrevboth(left, right int, s string) string { - if right < 4 || left > 0 && right < 7 { - return s - } - r, _ := util.AbbreviateFull(s, left, right) - return r -} -func initials(s string) string { - // Wrap this just to eliminate the var args, which templates don't do well. - return util.Initials(s) -} - -func randAlphaNumeric(count int) string { - // It is not possible, it appears, to actually generate an error here. - r, _ := util.CryptoRandomAlphaNumeric(count) - return r -} - -func randAlpha(count int) string { - r, _ := util.CryptoRandomAlphabetic(count) - return r -} - -func randAscii(count int) string { - r, _ := util.CryptoRandomAscii(count) - return r -} - -func randNumeric(count int) string { - r, _ := util.CryptoRandomNumeric(count) - return r -} - -func untitle(str string) string { - return util.Uncapitalize(str) -} - -func quote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("%q", strval(s))) - } - } - return strings.Join(out, " ") -} - -func squote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("'%v'", s)) - } - } - return strings.Join(out, " ") -} - -func cat(v ...interface{}) string { - v = removeNilElements(v) - r := strings.TrimSpace(strings.Repeat("%v ", len(v))) - return fmt.Sprintf(r, v...) -} - -func indent(spaces int, v string) string { - pad := strings.Repeat(" ", spaces) - return pad + strings.Replace(v, "\n", "\n"+pad, -1) -} - -func nindent(spaces int, v string) string { - return "\n" + indent(spaces, v) -} - -func replace(old, new, src string) string { - return strings.Replace(src, old, new, -1) -} - -func plural(one, many string, count int) string { - if count == 1 { - return one - } - return many -} - -func strslice(v interface{}) []string { - switch v := v.(type) { - case []string: - return v - case []interface{}: - b := make([]string, 0, len(v)) - for _, s := range v { - if s != nil { - b = append(b, strval(s)) - } - } - return b - default: - val := reflect.ValueOf(v) - switch val.Kind() { - case reflect.Array, reflect.Slice: - l := val.Len() - b := make([]string, 0, l) - for i := 0; i < l; i++ { - value := val.Index(i).Interface() - if value != nil { - b = append(b, strval(value)) - } - } - return b - default: - if v == nil { - return []string{} - } else { - return []string{strval(v)} - } - } - } -} - -func removeNilElements(v []interface{}) []interface{} { - newSlice := make([]interface{}, 0, len(v)) - for _, i := range v { - if i != nil { - newSlice = append(newSlice, i) - } - } - return newSlice -} - -func strval(v interface{}) string { - switch v := v.(type) { - case string: - return v - case []byte: - return string(v) - case error: - return v.Error() - case fmt.Stringer: - return v.String() - default: - return fmt.Sprintf("%v", v) - } -} - -func trunc(c int, s string) string { - if len(s) <= c { - return s - } - return s[0:c] -} - -func join(sep string, v interface{}) string { - return strings.Join(strslice(v), sep) -} - -func split(sep, orig string) map[string]string { - parts := strings.Split(orig, sep) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -func splitn(sep string, n int, orig string) map[string]string { - parts := strings.SplitN(orig, sep, n) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -// substring creates a substring of the given string. -// -// If start is < 0, this calls string[:end]. -// -// If start is >= 0 and end < 0 or end bigger than s length, this calls string[start:] -// -// Otherwise, this calls string[start, end]. -func substring(start, end int, s string) string { - if start < 0 { - return s[:end] - } - if end < 0 || end > len(s) { - return s[start:] - } - return s[start:end] -} diff --git a/vendor/github.com/Masterminds/sprig/url.go b/vendor/github.com/Masterminds/sprig/url.go deleted file mode 100644 index 5f22d801f9..0000000000 --- a/vendor/github.com/Masterminds/sprig/url.go +++ /dev/null @@ -1,66 +0,0 @@ -package sprig - -import ( - "fmt" - "net/url" - "reflect" -) - -func dictGetOrEmpty(dict map[string]interface{}, key string) string { - value, ok := dict[key]; if !ok { - return "" - } - tp := reflect.TypeOf(value).Kind() - if tp != reflect.String { - panic(fmt.Sprintf("unable to parse %s key, must be of type string, but %s found", key, tp.String())) - } - return reflect.ValueOf(value).String() -} - -// parses given URL to return dict object -func urlParse(v string) map[string]interface{} { - dict := map[string]interface{}{} - parsedUrl, err := url.Parse(v) - if err != nil { - panic(fmt.Sprintf("unable to parse url: %s", err)) - } - dict["scheme"] = parsedUrl.Scheme - dict["host"] = parsedUrl.Host - dict["hostname"] = parsedUrl.Hostname() - dict["path"] = parsedUrl.Path - dict["query"] = parsedUrl.RawQuery - dict["opaque"] = parsedUrl.Opaque - dict["fragment"] = parsedUrl.Fragment - if parsedUrl.User != nil { - dict["userinfo"] = parsedUrl.User.String() - } else { - dict["userinfo"] = "" - } - - return dict -} - -// join given dict to URL string -func urlJoin(d map[string]interface{}) string { - resUrl := url.URL{ - Scheme: dictGetOrEmpty(d, "scheme"), - Host: dictGetOrEmpty(d, "host"), - Path: dictGetOrEmpty(d, "path"), - RawQuery: dictGetOrEmpty(d, "query"), - Opaque: dictGetOrEmpty(d, "opaque"), - Fragment: dictGetOrEmpty(d, "fragment"), - - } - userinfo := dictGetOrEmpty(d, "userinfo") - var user *url.Userinfo = nil - if userinfo != "" { - tempUrl, err := url.Parse(fmt.Sprintf("proto://%s@host", userinfo)) - if err != nil { - panic(fmt.Sprintf("unable to parse userinfo in dict: %s", err)) - } - user = tempUrl.User - } - - resUrl.User = user - return resUrl.String() -} diff --git a/vendor/github.com/Masterminds/sprig/v3/.gitignore b/vendor/github.com/Masterminds/sprig/v3/.gitignore deleted file mode 100644 index 5e3002f88f..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/ -/.glide diff --git a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md b/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md deleted file mode 100644 index 2ce45dd4ec..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/CHANGELOG.md +++ /dev/null @@ -1,383 +0,0 @@ -# Changelog - -## Release 3.2.3 (2022-11-29) - -### Changed - -- Updated docs (thanks @book987 @aJetHorn @neelayu @pellizzetti @apricote @SaigyoujiYuyuko233 @AlekSi) -- #348: Updated huandu/xstrings which fixed a snake case bug (thanks @yxxhero) -- #353: Updated masterminds/semver which included bug fixes -- #354: Updated golang.org/x/crypto which included bug fixes - -## Release 3.2.2 (2021-02-04) - -This is a re-release of 3.2.1 to satisfy something with the Go module system. - -## Release 3.2.1 (2021-02-04) - -### Changed - -- Upgraded `Masterminds/goutils` to `v1.1.1`. see the [Security Advisory](https://github.com/Masterminds/goutils/security/advisories/GHSA-xg2h-wx96-xgxr) - -## Release 3.2.0 (2020-12-14) - -### Added - -- #211: Added randInt function (thanks @kochurovro) -- #223: Added fromJson and mustFromJson functions (thanks @mholt) -- #242: Added a bcrypt function (thanks @robbiet480) -- #253: Added randBytes function (thanks @MikaelSmith) -- #254: Added dig function for dicts (thanks @nyarly) -- #257: Added regexQuoteMeta for quoting regex metadata (thanks @rheaton) -- #261: Added filepath functions osBase, osDir, osExt, osClean, osIsAbs (thanks @zugl) -- #268: Added and and all functions for testing conditions (thanks @phuslu) -- #181: Added float64 arithmetic addf, add1f, subf, divf, mulf, maxf, and minf - (thanks @andrewmostello) -- #265: Added chunk function to split array into smaller arrays (thanks @karelbilek) -- #270: Extend certificate functions to handle non-RSA keys + add support for - ed25519 keys (thanks @misberner) - -### Changed - -- Removed testing and support for Go 1.12. ed25519 support requires Go 1.13 or newer -- Using semver 3.1.1 and mergo 0.3.11 - -### Fixed - -- #249: Fix htmlDateInZone example (thanks @spawnia) - -NOTE: The dependency github.com/imdario/mergo reverted the breaking change in -0.3.9 via 0.3.10 release. - -## Release 3.1.0 (2020-04-16) - -NOTE: The dependency github.com/imdario/mergo made a behavior change in 0.3.9 -that impacts sprig functionality. Do not use sprig with a version newer than 0.3.8. - -### Added - -- #225: Added support for generating htpasswd hash (thanks @rustycl0ck) -- #224: Added duration filter (thanks @frebib) -- #205: Added `seq` function (thanks @thadc23) - -### Changed - -- #203: Unlambda functions with correct signature (thanks @muesli) -- #236: Updated the license formatting for GitHub display purposes -- #238: Updated package dependency versions. Note, mergo not updated to 0.3.9 - as it causes a breaking change for sprig. That issue is tracked at - https://github.com/imdario/mergo/issues/139 - -### Fixed - -- #229: Fix `seq` example in docs (thanks @kalmant) - -## Release 3.0.2 (2019-12-13) - -### Fixed - -- #220: Updating to semver v3.0.3 to fix issue with <= ranges -- #218: fix typo elyptical->elliptic in ecdsa key description (thanks @laverya) - -## Release 3.0.1 (2019-12-08) - -### Fixed - -- #212: Updated semver fixing broken constraint checking with ^0.0 - -## Release 3.0.0 (2019-10-02) - -### Added - -- #187: Added durationRound function (thanks @yjp20) -- #189: Added numerous template functions that return errors rather than panic (thanks @nrvnrvn) -- #193: Added toRawJson support (thanks @Dean-Coakley) -- #197: Added get support to dicts (thanks @Dean-Coakley) - -### Changed - -- #186: Moving dependency management to Go modules -- #186: Updated semver to v3. This has changes in the way ^ is handled -- #194: Updated documentation on merging and how it copies. Added example using deepCopy -- #196: trunc now supports negative values (thanks @Dean-Coakley) - -## Release 2.22.0 (2019-10-02) - -### Added - -- #173: Added getHostByName function to resolve dns names to ips (thanks @fcgravalos) -- #195: Added deepCopy function for use with dicts - -### Changed - -- Updated merge and mergeOverwrite documentation to explain copying and how to - use deepCopy with it - -## Release 2.21.0 (2019-09-18) - -### Added - -- #122: Added encryptAES/decryptAES functions (thanks @n0madic) -- #128: Added toDecimal support (thanks @Dean-Coakley) -- #169: Added list contcat (thanks @astorath) -- #174: Added deepEqual function (thanks @bonifaido) -- #170: Added url parse and join functions (thanks @astorath) - -### Changed - -- #171: Updated glide config for Google UUID to v1 and to add ranges to semver and testify - -### Fixed - -- #172: Fix semver wildcard example (thanks @piepmatz) -- #175: Fix dateInZone doc example (thanks @s3than) - -## Release 2.20.0 (2019-06-18) - -### Added - -- #164: Adding function to get unix epoch for a time (@mattfarina) -- #166: Adding tests for date_in_zone (@mattfarina) - -### Changed - -- #144: Fix function comments based on best practices from Effective Go (@CodeLingoTeam) -- #150: Handles pointer type for time.Time in "htmlDate" (@mapreal19) -- #161, #157, #160, #153, #158, #156, #155, #159, #152 documentation updates (@badeadan) - -### Fixed - -## Release 2.19.0 (2019-03-02) - -IMPORTANT: This release reverts a change from 2.18.0 - -In the previous release (2.18), we prematurely merged a partial change to the crypto functions that led to creating two sets of crypto functions (I blame @technosophos -- since that's me). This release rolls back that change, and does what was originally intended: It alters the existing crypto functions to use secure random. - -We debated whether this classifies as a change worthy of major revision, but given the proximity to the last release, we have decided that treating 2.18 as a faulty release is the correct course of action. We apologize for any inconvenience. - -### Changed - -- Fix substr panic 35fb796 (Alexey igrychev) -- Remove extra period 1eb7729 (Matthew Lorimor) -- Make random string functions use crypto by default 6ceff26 (Matthew Lorimor) -- README edits/fixes/suggestions 08fe136 (Lauri Apple) - - -## Release 2.18.0 (2019-02-12) - -### Added - -- Added mergeOverwrite function -- cryptographic functions that use secure random (see fe1de12) - -### Changed - -- Improve documentation of regexMatch function, resolves #139 90b89ce (Jan Tagscherer) -- Handle has for nil list 9c10885 (Daniel Cohen) -- Document behaviour of mergeOverwrite fe0dbe9 (Lukas Rieder) -- doc: adds missing documentation. 4b871e6 (Fernandez Ludovic) -- Replace outdated goutils imports 01893d2 (Matthew Lorimor) -- Surface crypto secure random strings from goutils fe1de12 (Matthew Lorimor) -- Handle untyped nil values as paramters to string functions 2b2ec8f (Morten Torkildsen) - -### Fixed - -- Fix dict merge issue and provide mergeOverwrite .dst .src1 to overwrite from src -> dst 4c59c12 (Lukas Rieder) -- Fix substr var names and comments d581f80 (Dean Coakley) -- Fix substr documentation 2737203 (Dean Coakley) - -## Release 2.17.1 (2019-01-03) - -### Fixed - -The 2.17.0 release did not have a version pinned for xstrings, which caused compilation failures when xstrings < 1.2 was used. This adds the correct version string to glide.yaml. - -## Release 2.17.0 (2019-01-03) - -### Added - -- adds alder32sum function and test 6908fc2 (marshallford) -- Added kebabcase function ca331a1 (Ilyes512) - -### Changed - -- Update goutils to 1.1.0 4e1125d (Matt Butcher) - -### Fixed - -- Fix 'has' documentation e3f2a85 (dean-coakley) -- docs(dict): fix typo in pick example dc424f9 (Dustin Specker) -- fixes spelling errors... not sure how that happened 4cf188a (marshallford) - -## Release 2.16.0 (2018-08-13) - -### Added - -- add splitn function fccb0b0 (Helgi Þorbjörnsson) -- Add slice func df28ca7 (gongdo) -- Generate serial number a3bdffd (Cody Coons) -- Extract values of dict with values function df39312 (Lawrence Jones) - -### Changed - -- Modify panic message for list.slice ae38335 (gongdo) -- Minor improvement in code quality - Removed an unreachable piece of code at defaults.go#L26:6 - Resolve formatting issues. 5834241 (Abhishek Kashyap) -- Remove duplicated documentation 1d97af1 (Matthew Fisher) -- Test on go 1.11 49df809 (Helgi Þormar Þorbjörnsson) - -### Fixed - -- Fix file permissions c5f40b5 (gongdo) -- Fix example for buildCustomCert 7779e0d (Tin Lam) - -## Release 2.15.0 (2018-04-02) - -### Added - -- #68 and #69: Add json helpers to docs (thanks @arunvelsriram) -- #66: Add ternary function (thanks @binoculars) -- #67: Allow keys function to take multiple dicts (thanks @binoculars) -- #89: Added sha1sum to crypto function (thanks @benkeil) -- #81: Allow customizing Root CA that used by genSignedCert (thanks @chenzhiwei) -- #92: Add travis testing for go 1.10 -- #93: Adding appveyor config for windows testing - -### Changed - -- #90: Updating to more recent dependencies -- #73: replace satori/go.uuid with google/uuid (thanks @petterw) - -### Fixed - -- #76: Fixed documentation typos (thanks @Thiht) -- Fixed rounding issue on the `ago` function. Note, the removes support for Go 1.8 and older - -## Release 2.14.1 (2017-12-01) - -### Fixed - -- #60: Fix typo in function name documentation (thanks @neil-ca-moore) -- #61: Removing line with {{ due to blocking github pages genertion -- #64: Update the list functions to handle int, string, and other slices for compatibility - -## Release 2.14.0 (2017-10-06) - -This new version of Sprig adds a set of functions for generating and working with SSL certificates. - -- `genCA` generates an SSL Certificate Authority -- `genSelfSignedCert` generates an SSL self-signed certificate -- `genSignedCert` generates an SSL certificate and key based on a given CA - -## Release 2.13.0 (2017-09-18) - -This release adds new functions, including: - -- `regexMatch`, `regexFindAll`, `regexFind`, `regexReplaceAll`, `regexReplaceAllLiteral`, and `regexSplit` to work with regular expressions -- `floor`, `ceil`, and `round` math functions -- `toDate` converts a string to a date -- `nindent` is just like `indent` but also prepends a new line -- `ago` returns the time from `time.Now` - -### Added - -- #40: Added basic regex functionality (thanks @alanquillin) -- #41: Added ceil floor and round functions (thanks @alanquillin) -- #48: Added toDate function (thanks @andreynering) -- #50: Added nindent function (thanks @binoculars) -- #46: Added ago function (thanks @slayer) - -### Changed - -- #51: Updated godocs to include new string functions (thanks @curtisallen) -- #49: Added ability to merge multiple dicts (thanks @binoculars) - -## Release 2.12.0 (2017-05-17) - -- `snakecase`, `camelcase`, and `shuffle` are three new string functions -- `fail` allows you to bail out of a template render when conditions are not met - -## Release 2.11.0 (2017-05-02) - -- Added `toJson` and `toPrettyJson` -- Added `merge` -- Refactored documentation - -## Release 2.10.0 (2017-03-15) - -- Added `semver` and `semverCompare` for Semantic Versions -- `list` replaces `tuple` -- Fixed issue with `join` -- Added `first`, `last`, `intial`, `rest`, `prepend`, `append`, `toString`, `toStrings`, `sortAlpha`, `reverse`, `coalesce`, `pluck`, `pick`, `compact`, `keys`, `omit`, `uniq`, `has`, `without` - -## Release 2.9.0 (2017-02-23) - -- Added `splitList` to split a list -- Added crypto functions of `genPrivateKey` and `derivePassword` - -## Release 2.8.0 (2016-12-21) - -- Added access to several path functions (`base`, `dir`, `clean`, `ext`, and `abs`) -- Added functions for _mutating_ dictionaries (`set`, `unset`, `hasKey`) - -## Release 2.7.0 (2016-12-01) - -- Added `sha256sum` to generate a hash of an input -- Added functions to convert a numeric or string to `int`, `int64`, `float64` - -## Release 2.6.0 (2016-10-03) - -- Added a `uuidv4` template function for generating UUIDs inside of a template. - -## Release 2.5.0 (2016-08-19) - -- New `trimSuffix`, `trimPrefix`, `hasSuffix`, and `hasPrefix` functions -- New aliases have been added for a few functions that didn't follow the naming conventions (`trimAll` and `abbrevBoth`) -- `trimall` and `abbrevboth` (notice the case) are deprecated and will be removed in 3.0.0 - -## Release 2.4.0 (2016-08-16) - -- Adds two functions: `until` and `untilStep` - -## Release 2.3.0 (2016-06-21) - -- cat: Concatenate strings with whitespace separators. -- replace: Replace parts of a string: `replace " " "-" "Me First"` renders "Me-First" -- plural: Format plurals: `len "foo" | plural "one foo" "many foos"` renders "many foos" -- indent: Indent blocks of text in a way that is sensitive to "\n" characters. - -## Release 2.2.0 (2016-04-21) - -- Added a `genPrivateKey` function (Thanks @bacongobbler) - -## Release 2.1.0 (2016-03-30) - -- `default` now prints the default value when it does not receive a value down the pipeline. It is much safer now to do `{{.Foo | default "bar"}}`. -- Added accessors for "hermetic" functions. These return only functions that, when given the same input, produce the same output. - -## Release 2.0.0 (2016-03-29) - -Because we switched from `int` to `int64` as the return value for all integer math functions, the library's major version number has been incremented. - -- `min` complements `max` (formerly `biggest`) -- `empty` indicates that a value is the empty value for its type -- `tuple` creates a tuple inside of a template: `{{$t := tuple "a", "b" "c"}}` -- `dict` creates a dictionary inside of a template `{{$d := dict "key1" "val1" "key2" "val2"}}` -- Date formatters have been added for HTML dates (as used in `date` input fields) -- Integer math functions can convert from a number of types, including `string` (via `strconv.ParseInt`). - -## Release 1.2.0 (2016-02-01) - -- Added quote and squote -- Added b32enc and b32dec -- add now takes varargs -- biggest now takes varargs - -## Release 1.1.0 (2015-12-29) - -- Added #4: Added contains function. strings.Contains, but with the arguments - switched to simplify common pipelines. (thanks krancour) -- Added Travis-CI testing support - -## Release 1.0.0 (2015-12-23) - -- Initial release diff --git a/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt b/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt deleted file mode 100644 index f311b1eaaa..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2013-2020 Masterminds - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/Masterminds/sprig/v3/Makefile b/vendor/github.com/Masterminds/sprig/v3/Makefile deleted file mode 100644 index 78d409cde2..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: test -test: - @echo "==> Running tests" - GO111MODULE=on go test -v - -.PHONY: test-cover -test-cover: - @echo "==> Running Tests with coverage" - GO111MODULE=on go test -cover . diff --git a/vendor/github.com/Masterminds/sprig/v3/README.md b/vendor/github.com/Masterminds/sprig/v3/README.md deleted file mode 100644 index 3e22c60e1a..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# Sprig: Template functions for Go templates - -[![GoDoc](https://img.shields.io/static/v1?label=godoc&message=reference&color=blue)](https://pkg.go.dev/github.com/Masterminds/sprig/v3) -[![Go Report Card](https://goreportcard.com/badge/github.com/Masterminds/sprig)](https://goreportcard.com/report/github.com/Masterminds/sprig) -[![Stability: Sustained](https://masterminds.github.io/stability/sustained.svg)](https://masterminds.github.io/stability/sustained.html) -[![](https://github.com/Masterminds/sprig/workflows/Tests/badge.svg)](https://github.com/Masterminds/sprig/actions) - -The Go language comes with a [built-in template -language](http://golang.org/pkg/text/template/), but not -very many template functions. Sprig is a library that provides more than 100 commonly -used template functions. - -It is inspired by the template functions found in -[Twig](http://twig.sensiolabs.org/documentation) and in various -JavaScript libraries, such as [underscore.js](http://underscorejs.org/). - -## IMPORTANT NOTES - -Sprig leverages [mergo](https://github.com/imdario/mergo) to handle merges. In -its v0.3.9 release, there was a behavior change that impacts merging template -functions in sprig. It is currently recommended to use v0.3.10 or later of that package. -Using v0.3.9 will cause sprig tests to fail. - -## Package Versions - -There are two active major versions of the `sprig` package. - -* v3 is currently stable release series on the `master` branch. The Go API should - remain compatible with v2, the current stable version. Behavior change behind - some functions is the reason for the new major version. -* v2 is the previous stable release series. It has been more than three years since - the initial release of v2. You can read the documentation and see the code - on the [release-2](https://github.com/Masterminds/sprig/tree/release-2) branch. - Bug fixes to this major version will continue for some time. - -## Usage - -**Template developers**: Please use Sprig's [function documentation](http://masterminds.github.io/sprig/) for -detailed instructions and code snippets for the >100 template functions available. - -**Go developers**: If you'd like to include Sprig as a library in your program, -our API documentation is available [at GoDoc.org](http://godoc.org/github.com/Masterminds/sprig). - -For standard usage, read on. - -### Load the Sprig library - -To load the Sprig `FuncMap`: - -```go - -import ( - "github.com/Masterminds/sprig/v3" - "html/template" -) - -// This example illustrates that the FuncMap *must* be set before the -// templates themselves are loaded. -tpl := template.Must( - template.New("base").Funcs(sprig.FuncMap()).ParseGlob("*.html") -) - - -``` - -### Calling the functions inside of templates - -By convention, all functions are lowercase. This seems to follow the Go -idiom for template functions (as opposed to template methods, which are -TitleCase). For example, this: - -``` -{{ "hello!" | upper | repeat 5 }} -``` - -produces this: - -``` -HELLO!HELLO!HELLO!HELLO!HELLO! -``` - -## Principles Driving Our Function Selection - -We followed these principles to decide which functions to add and how to implement them: - -- Use template functions to build layout. The following - types of operations are within the domain of template functions: - - Formatting - - Layout - - Simple type conversions - - Utilities that assist in handling common formatting and layout needs (e.g. arithmetic) -- Template functions should not return errors unless there is no way to print - a sensible value. For example, converting a string to an integer should not - produce an error if conversion fails. Instead, it should display a default - value. -- Simple math is necessary for grid layouts, pagers, and so on. Complex math - (anything other than arithmetic) should be done outside of templates. -- Template functions only deal with the data passed into them. They never retrieve - data from a source. -- Finally, do not override core Go template functions. diff --git a/vendor/github.com/Masterminds/sprig/v3/crypto.go b/vendor/github.com/Masterminds/sprig/v3/crypto.go deleted file mode 100644 index 13a5cd5593..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/crypto.go +++ /dev/null @@ -1,653 +0,0 @@ -package sprig - -import ( - "bytes" - "crypto" - "crypto/aes" - "crypto/cipher" - "crypto/dsa" - "crypto/ecdsa" - "crypto/ed25519" - "crypto/elliptic" - "crypto/hmac" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/sha256" - "crypto/x509" - "crypto/x509/pkix" - "encoding/asn1" - "encoding/base64" - "encoding/binary" - "encoding/hex" - "encoding/pem" - "errors" - "fmt" - "hash/adler32" - "io" - "math/big" - "net" - "time" - - "strings" - - "github.com/google/uuid" - bcrypt_lib "golang.org/x/crypto/bcrypt" - "golang.org/x/crypto/scrypt" -) - -func sha256sum(input string) string { - hash := sha256.Sum256([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func sha1sum(input string) string { - hash := sha1.Sum([]byte(input)) - return hex.EncodeToString(hash[:]) -} - -func adler32sum(input string) string { - hash := adler32.Checksum([]byte(input)) - return fmt.Sprintf("%d", hash) -} - -func bcrypt(input string) string { - hash, err := bcrypt_lib.GenerateFromPassword([]byte(input), bcrypt_lib.DefaultCost) - if err != nil { - return fmt.Sprintf("failed to encrypt string with bcrypt: %s", err) - } - - return string(hash) -} - -func htpasswd(username string, password string) string { - if strings.Contains(username, ":") { - return fmt.Sprintf("invalid username: %s", username) - } - return fmt.Sprintf("%s:%s", username, bcrypt(password)) -} - -func randBytes(count int) (string, error) { - buf := make([]byte, count) - if _, err := rand.Read(buf); err != nil { - return "", err - } - return base64.StdEncoding.EncodeToString(buf), nil -} - -// uuidv4 provides a safe and secure UUID v4 implementation -func uuidv4() string { - return uuid.New().String() -} - -var masterPasswordSeed = "com.lyndir.masterpassword" - -var passwordTypeTemplates = map[string][][]byte{ - "maximum": {[]byte("anoxxxxxxxxxxxxxxxxx"), []byte("axxxxxxxxxxxxxxxxxno")}, - "long": {[]byte("CvcvnoCvcvCvcv"), []byte("CvcvCvcvnoCvcv"), []byte("CvcvCvcvCvcvno"), []byte("CvccnoCvcvCvcv"), []byte("CvccCvcvnoCvcv"), - []byte("CvccCvcvCvcvno"), []byte("CvcvnoCvccCvcv"), []byte("CvcvCvccnoCvcv"), []byte("CvcvCvccCvcvno"), []byte("CvcvnoCvcvCvcc"), - []byte("CvcvCvcvnoCvcc"), []byte("CvcvCvcvCvccno"), []byte("CvccnoCvccCvcv"), []byte("CvccCvccnoCvcv"), []byte("CvccCvccCvcvno"), - []byte("CvcvnoCvccCvcc"), []byte("CvcvCvccnoCvcc"), []byte("CvcvCvccCvccno"), []byte("CvccnoCvcvCvcc"), []byte("CvccCvcvnoCvcc"), - []byte("CvccCvcvCvccno")}, - "medium": {[]byte("CvcnoCvc"), []byte("CvcCvcno")}, - "short": {[]byte("Cvcn")}, - "basic": {[]byte("aaanaaan"), []byte("aannaaan"), []byte("aaannaaa")}, - "pin": {[]byte("nnnn")}, -} - -var templateCharacters = map[byte]string{ - 'V': "AEIOU", - 'C': "BCDFGHJKLMNPQRSTVWXYZ", - 'v': "aeiou", - 'c': "bcdfghjklmnpqrstvwxyz", - 'A': "AEIOUBCDFGHJKLMNPQRSTVWXYZ", - 'a': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz", - 'n': "0123456789", - 'o': "@&%?,=[]_:-+*$#!'^~;()/.", - 'x': "AEIOUaeiouBCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz0123456789!@#$%^&*()", -} - -func derivePassword(counter uint32, passwordType, password, user, site string) string { - var templates = passwordTypeTemplates[passwordType] - if templates == nil { - return fmt.Sprintf("cannot find password template %s", passwordType) - } - - var buffer bytes.Buffer - buffer.WriteString(masterPasswordSeed) - binary.Write(&buffer, binary.BigEndian, uint32(len(user))) - buffer.WriteString(user) - - salt := buffer.Bytes() - key, err := scrypt.Key([]byte(password), salt, 32768, 8, 2, 64) - if err != nil { - return fmt.Sprintf("failed to derive password: %s", err) - } - - buffer.Truncate(len(masterPasswordSeed)) - binary.Write(&buffer, binary.BigEndian, uint32(len(site))) - buffer.WriteString(site) - binary.Write(&buffer, binary.BigEndian, counter) - - var hmacv = hmac.New(sha256.New, key) - hmacv.Write(buffer.Bytes()) - var seed = hmacv.Sum(nil) - var temp = templates[int(seed[0])%len(templates)] - - buffer.Truncate(0) - for i, element := range temp { - passChars := templateCharacters[element] - passChar := passChars[int(seed[i+1])%len(passChars)] - buffer.WriteByte(passChar) - } - - return buffer.String() -} - -func generatePrivateKey(typ string) string { - var priv interface{} - var err error - switch typ { - case "", "rsa": - // good enough for government work - priv, err = rsa.GenerateKey(rand.Reader, 4096) - case "dsa": - key := new(dsa.PrivateKey) - // again, good enough for government work - if err = dsa.GenerateParameters(&key.Parameters, rand.Reader, dsa.L2048N256); err != nil { - return fmt.Sprintf("failed to generate dsa params: %s", err) - } - err = dsa.GenerateKey(key, rand.Reader) - priv = key - case "ecdsa": - // again, good enough for government work - priv, err = ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - case "ed25519": - _, priv, err = ed25519.GenerateKey(rand.Reader) - default: - return "Unknown type " + typ - } - if err != nil { - return fmt.Sprintf("failed to generate private key: %s", err) - } - - return string(pem.EncodeToMemory(pemBlockForKey(priv))) -} - -// DSAKeyFormat stores the format for DSA keys. -// Used by pemBlockForKey -type DSAKeyFormat struct { - Version int - P, Q, G, Y, X *big.Int -} - -func pemBlockForKey(priv interface{}) *pem.Block { - switch k := priv.(type) { - case *rsa.PrivateKey: - return &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(k)} - case *dsa.PrivateKey: - val := DSAKeyFormat{ - P: k.P, Q: k.Q, G: k.G, - Y: k.Y, X: k.X, - } - bytes, _ := asn1.Marshal(val) - return &pem.Block{Type: "DSA PRIVATE KEY", Bytes: bytes} - case *ecdsa.PrivateKey: - b, _ := x509.MarshalECPrivateKey(k) - return &pem.Block{Type: "EC PRIVATE KEY", Bytes: b} - default: - // attempt PKCS#8 format for all other keys - b, err := x509.MarshalPKCS8PrivateKey(k) - if err != nil { - return nil - } - return &pem.Block{Type: "PRIVATE KEY", Bytes: b} - } -} - -func parsePrivateKeyPEM(pemBlock string) (crypto.PrivateKey, error) { - block, _ := pem.Decode([]byte(pemBlock)) - if block == nil { - return nil, errors.New("no PEM data in input") - } - - if block.Type == "PRIVATE KEY" { - priv, err := x509.ParsePKCS8PrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("decoding PEM as PKCS#8: %s", err) - } - return priv, nil - } else if !strings.HasSuffix(block.Type, " PRIVATE KEY") { - return nil, fmt.Errorf("no private key data in PEM block of type %s", block.Type) - } - - switch block.Type[:len(block.Type)-12] { // strip " PRIVATE KEY" - case "RSA": - priv, err := x509.ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("parsing RSA private key from PEM: %s", err) - } - return priv, nil - case "EC": - priv, err := x509.ParseECPrivateKey(block.Bytes) - if err != nil { - return nil, fmt.Errorf("parsing EC private key from PEM: %s", err) - } - return priv, nil - case "DSA": - var k DSAKeyFormat - _, err := asn1.Unmarshal(block.Bytes, &k) - if err != nil { - return nil, fmt.Errorf("parsing DSA private key from PEM: %s", err) - } - priv := &dsa.PrivateKey{ - PublicKey: dsa.PublicKey{ - Parameters: dsa.Parameters{ - P: k.P, Q: k.Q, G: k.G, - }, - Y: k.Y, - }, - X: k.X, - } - return priv, nil - default: - return nil, fmt.Errorf("invalid private key type %s", block.Type) - } -} - -func getPublicKey(priv crypto.PrivateKey) (crypto.PublicKey, error) { - switch k := priv.(type) { - case interface{ Public() crypto.PublicKey }: - return k.Public(), nil - case *dsa.PrivateKey: - return &k.PublicKey, nil - default: - return nil, fmt.Errorf("unable to get public key for type %T", priv) - } -} - -type certificate struct { - Cert string - Key string -} - -func buildCustomCertificate(b64cert string, b64key string) (certificate, error) { - crt := certificate{} - - cert, err := base64.StdEncoding.DecodeString(b64cert) - if err != nil { - return crt, errors.New("unable to decode base64 certificate") - } - - key, err := base64.StdEncoding.DecodeString(b64key) - if err != nil { - return crt, errors.New("unable to decode base64 private key") - } - - decodedCert, _ := pem.Decode(cert) - if decodedCert == nil { - return crt, errors.New("unable to decode certificate") - } - _, err = x509.ParseCertificate(decodedCert.Bytes) - if err != nil { - return crt, fmt.Errorf( - "error parsing certificate: decodedCert.Bytes: %s", - err, - ) - } - - _, err = parsePrivateKeyPEM(string(key)) - if err != nil { - return crt, fmt.Errorf( - "error parsing private key: %s", - err, - ) - } - - crt.Cert = string(cert) - crt.Key = string(key) - - return crt, nil -} - -func generateCertificateAuthority( - cn string, - daysValid int, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - - return generateCertificateAuthorityWithKeyInternal(cn, daysValid, priv) -} - -func generateCertificateAuthorityWithPEMKey( - cn string, - daysValid int, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateCertificateAuthorityWithKeyInternal(cn, daysValid, priv) -} - -func generateCertificateAuthorityWithKeyInternal( - cn string, - daysValid int, - priv crypto.PrivateKey, -) (certificate, error) { - ca := certificate{} - - template, err := getBaseCertTemplate(cn, nil, nil, daysValid) - if err != nil { - return ca, err - } - // Override KeyUsage and IsCA - template.KeyUsage = x509.KeyUsageKeyEncipherment | - x509.KeyUsageDigitalSignature | - x509.KeyUsageCertSign - template.IsCA = true - - ca.Cert, ca.Key, err = getCertAndKey(template, priv, template, priv) - - return ca, err -} - -func generateSelfSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - return generateSelfSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, priv) -} - -func generateSelfSignedCertificateWithPEMKey( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateSelfSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, priv) -} - -func generateSelfSignedCertificateWithKeyInternal( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - priv crypto.PrivateKey, -) (certificate, error) { - cert := certificate{} - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - cert.Cert, cert.Key, err = getCertAndKey(template, priv, template, priv) - - return cert, err -} - -func generateSignedCertificate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, -) (certificate, error) { - priv, err := rsa.GenerateKey(rand.Reader, 2048) - if err != nil { - return certificate{}, fmt.Errorf("error generating rsa key: %s", err) - } - return generateSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, ca, priv) -} - -func generateSignedCertificateWithPEMKey( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, - privPEM string, -) (certificate, error) { - priv, err := parsePrivateKeyPEM(privPEM) - if err != nil { - return certificate{}, fmt.Errorf("parsing private key: %s", err) - } - return generateSignedCertificateWithKeyInternal(cn, ips, alternateDNS, daysValid, ca, priv) -} - -func generateSignedCertificateWithKeyInternal( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, - ca certificate, - priv crypto.PrivateKey, -) (certificate, error) { - cert := certificate{} - - decodedSignerCert, _ := pem.Decode([]byte(ca.Cert)) - if decodedSignerCert == nil { - return cert, errors.New("unable to decode certificate") - } - signerCert, err := x509.ParseCertificate(decodedSignerCert.Bytes) - if err != nil { - return cert, fmt.Errorf( - "error parsing certificate: decodedSignerCert.Bytes: %s", - err, - ) - } - signerKey, err := parsePrivateKeyPEM(ca.Key) - if err != nil { - return cert, fmt.Errorf( - "error parsing private key: %s", - err, - ) - } - - template, err := getBaseCertTemplate(cn, ips, alternateDNS, daysValid) - if err != nil { - return cert, err - } - - cert.Cert, cert.Key, err = getCertAndKey( - template, - priv, - signerCert, - signerKey, - ) - - return cert, err -} - -func getCertAndKey( - template *x509.Certificate, - signeeKey crypto.PrivateKey, - parent *x509.Certificate, - signingKey crypto.PrivateKey, -) (string, string, error) { - signeePubKey, err := getPublicKey(signeeKey) - if err != nil { - return "", "", fmt.Errorf("error retrieving public key from signee key: %s", err) - } - derBytes, err := x509.CreateCertificate( - rand.Reader, - template, - parent, - signeePubKey, - signingKey, - ) - if err != nil { - return "", "", fmt.Errorf("error creating certificate: %s", err) - } - - certBuffer := bytes.Buffer{} - if err := pem.Encode( - &certBuffer, - &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}, - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding certificate: %s", err) - } - - keyBuffer := bytes.Buffer{} - if err := pem.Encode( - &keyBuffer, - pemBlockForKey(signeeKey), - ); err != nil { - return "", "", fmt.Errorf("error pem-encoding key: %s", err) - } - - return certBuffer.String(), keyBuffer.String(), nil -} - -func getBaseCertTemplate( - cn string, - ips []interface{}, - alternateDNS []interface{}, - daysValid int, -) (*x509.Certificate, error) { - ipAddresses, err := getNetIPs(ips) - if err != nil { - return nil, err - } - dnsNames, err := getAlternateDNSStrs(alternateDNS) - if err != nil { - return nil, err - } - serialNumberUpperBound := new(big.Int).Lsh(big.NewInt(1), 128) - serialNumber, err := rand.Int(rand.Reader, serialNumberUpperBound) - if err != nil { - return nil, err - } - return &x509.Certificate{ - SerialNumber: serialNumber, - Subject: pkix.Name{ - CommonName: cn, - }, - IPAddresses: ipAddresses, - DNSNames: dnsNames, - NotBefore: time.Now(), - NotAfter: time.Now().Add(time.Hour * 24 * time.Duration(daysValid)), - KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature, - ExtKeyUsage: []x509.ExtKeyUsage{ - x509.ExtKeyUsageServerAuth, - x509.ExtKeyUsageClientAuth, - }, - BasicConstraintsValid: true, - }, nil -} - -func getNetIPs(ips []interface{}) ([]net.IP, error) { - if ips == nil { - return []net.IP{}, nil - } - var ipStr string - var ok bool - var netIP net.IP - netIPs := make([]net.IP, len(ips)) - for i, ip := range ips { - ipStr, ok = ip.(string) - if !ok { - return nil, fmt.Errorf("error parsing ip: %v is not a string", ip) - } - netIP = net.ParseIP(ipStr) - if netIP == nil { - return nil, fmt.Errorf("error parsing ip: %s", ipStr) - } - netIPs[i] = netIP - } - return netIPs, nil -} - -func getAlternateDNSStrs(alternateDNS []interface{}) ([]string, error) { - if alternateDNS == nil { - return []string{}, nil - } - var dnsStr string - var ok bool - alternateDNSStrs := make([]string, len(alternateDNS)) - for i, dns := range alternateDNS { - dnsStr, ok = dns.(string) - if !ok { - return nil, fmt.Errorf( - "error processing alternate dns name: %v is not a string", - dns, - ) - } - alternateDNSStrs[i] = dnsStr - } - return alternateDNSStrs, nil -} - -func encryptAES(password string, plaintext string) (string, error) { - if plaintext == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - content := []byte(plaintext) - blockSize := block.BlockSize() - padding := blockSize - len(content)%blockSize - padtext := bytes.Repeat([]byte{byte(padding)}, padding) - content = append(content, padtext...) - - ciphertext := make([]byte, aes.BlockSize+len(content)) - - iv := ciphertext[:aes.BlockSize] - if _, err := io.ReadFull(rand.Reader, iv); err != nil { - return "", err - } - - mode := cipher.NewCBCEncrypter(block, iv) - mode.CryptBlocks(ciphertext[aes.BlockSize:], content) - - return base64.StdEncoding.EncodeToString(ciphertext), nil -} - -func decryptAES(password string, crypt64 string) (string, error) { - if crypt64 == "" { - return "", nil - } - - key := make([]byte, 32) - copy(key, []byte(password)) - - crypt, err := base64.StdEncoding.DecodeString(crypt64) - if err != nil { - return "", err - } - - block, err := aes.NewCipher(key) - if err != nil { - return "", err - } - - iv := crypt[:aes.BlockSize] - crypt = crypt[aes.BlockSize:] - decrypted := make([]byte, len(crypt)) - mode := cipher.NewCBCDecrypter(block, iv) - mode.CryptBlocks(decrypted, crypt) - - return string(decrypted[:len(decrypted)-int(decrypted[len(decrypted)-1])]), nil -} diff --git a/vendor/github.com/Masterminds/sprig/v3/date.go b/vendor/github.com/Masterminds/sprig/v3/date.go deleted file mode 100644 index ed022ddaca..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/date.go +++ /dev/null @@ -1,152 +0,0 @@ -package sprig - -import ( - "strconv" - "time" -) - -// Given a format and a date, format the date string. -// -// Date can be a `time.Time` or an `int, int32, int64`. -// In the later case, it is treated as seconds since UNIX -// epoch. -func date(fmt string, date interface{}) string { - return dateInZone(fmt, date, "Local") -} - -func htmlDate(date interface{}) string { - return dateInZone("2006-01-02", date, "Local") -} - -func htmlDateInZone(date interface{}, zone string) string { - return dateInZone("2006-01-02", date, zone) -} - -func dateInZone(fmt string, date interface{}, zone string) string { - var t time.Time - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case *time.Time: - t = *date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - case int32: - t = time.Unix(int64(date), 0) - } - - loc, err := time.LoadLocation(zone) - if err != nil { - loc, _ = time.LoadLocation("UTC") - } - - return t.In(loc).Format(fmt) -} - -func dateModify(fmt string, date time.Time) time.Time { - d, err := time.ParseDuration(fmt) - if err != nil { - return date - } - return date.Add(d) -} - -func mustDateModify(fmt string, date time.Time) (time.Time, error) { - d, err := time.ParseDuration(fmt) - if err != nil { - return time.Time{}, err - } - return date.Add(d), nil -} - -func dateAgo(date interface{}) string { - var t time.Time - - switch date := date.(type) { - default: - t = time.Now() - case time.Time: - t = date - case int64: - t = time.Unix(date, 0) - case int: - t = time.Unix(int64(date), 0) - } - // Drop resolution to seconds - duration := time.Since(t).Round(time.Second) - return duration.String() -} - -func duration(sec interface{}) string { - var n int64 - switch value := sec.(type) { - default: - n = 0 - case string: - n, _ = strconv.ParseInt(value, 10, 64) - case int64: - n = value - } - return (time.Duration(n) * time.Second).String() -} - -func durationRound(duration interface{}) string { - var d time.Duration - switch duration := duration.(type) { - default: - d = 0 - case string: - d, _ = time.ParseDuration(duration) - case int64: - d = time.Duration(duration) - case time.Time: - d = time.Since(duration) - } - - u := uint64(d) - neg := d < 0 - if neg { - u = -u - } - - var ( - year = uint64(time.Hour) * 24 * 365 - month = uint64(time.Hour) * 24 * 30 - day = uint64(time.Hour) * 24 - hour = uint64(time.Hour) - minute = uint64(time.Minute) - second = uint64(time.Second) - ) - switch { - case u > year: - return strconv.FormatUint(u/year, 10) + "y" - case u > month: - return strconv.FormatUint(u/month, 10) + "mo" - case u > day: - return strconv.FormatUint(u/day, 10) + "d" - case u > hour: - return strconv.FormatUint(u/hour, 10) + "h" - case u > minute: - return strconv.FormatUint(u/minute, 10) + "m" - case u > second: - return strconv.FormatUint(u/second, 10) + "s" - } - return "0s" -} - -func toDate(fmt, str string) time.Time { - t, _ := time.ParseInLocation(fmt, str, time.Local) - return t -} - -func mustToDate(fmt, str string) (time.Time, error) { - return time.ParseInLocation(fmt, str, time.Local) -} - -func unixEpoch(date time.Time) string { - return strconv.FormatInt(date.Unix(), 10) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/defaults.go b/vendor/github.com/Masterminds/sprig/v3/defaults.go deleted file mode 100644 index b9f979666d..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/defaults.go +++ /dev/null @@ -1,163 +0,0 @@ -package sprig - -import ( - "bytes" - "encoding/json" - "math/rand" - "reflect" - "strings" - "time" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// dfault checks whether `given` is set, and returns default if not set. -// -// This returns `d` if `given` appears not to be set, and `given` otherwise. -// -// For numeric types 0 is unset. -// For strings, maps, arrays, and slices, len() = 0 is considered unset. -// For bool, false is unset. -// Structs are never considered unset. -// -// For everything else, including pointers, a nil value is unset. -func dfault(d interface{}, given ...interface{}) interface{} { - - if empty(given) || empty(given[0]) { - return d - } - return given[0] -} - -// empty returns true if the given value has the zero value for its type. -func empty(given interface{}) bool { - g := reflect.ValueOf(given) - if !g.IsValid() { - return true - } - - // Basically adapted from text/template.isTrue - switch g.Kind() { - default: - return g.IsNil() - case reflect.Array, reflect.Slice, reflect.Map, reflect.String: - return g.Len() == 0 - case reflect.Bool: - return !g.Bool() - case reflect.Complex64, reflect.Complex128: - return g.Complex() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return g.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return g.Uint() == 0 - case reflect.Float32, reflect.Float64: - return g.Float() == 0 - case reflect.Struct: - return false - } -} - -// coalesce returns the first non-empty value. -func coalesce(v ...interface{}) interface{} { - for _, val := range v { - if !empty(val) { - return val - } - } - return nil -} - -// all returns true if empty(x) is false for all values x in the list. -// If the list is empty, return true. -func all(v ...interface{}) bool { - for _, val := range v { - if empty(val) { - return false - } - } - return true -} - -// any returns true if empty(x) is false for any x in the list. -// If the list is empty, return false. -func any(v ...interface{}) bool { - for _, val := range v { - if !empty(val) { - return true - } - } - return false -} - -// fromJson decodes JSON into a structured value, ignoring errors. -func fromJson(v string) interface{} { - output, _ := mustFromJson(v) - return output -} - -// mustFromJson decodes JSON into a structured value, returning errors. -func mustFromJson(v string) (interface{}, error) { - var output interface{} - err := json.Unmarshal([]byte(v), &output) - return output, err -} - -// toJson encodes an item into a JSON string -func toJson(v interface{}) string { - output, _ := json.Marshal(v) - return string(output) -} - -func mustToJson(v interface{}) (string, error) { - output, err := json.Marshal(v) - if err != nil { - return "", err - } - return string(output), nil -} - -// toPrettyJson encodes an item into a pretty (indented) JSON string -func toPrettyJson(v interface{}) string { - output, _ := json.MarshalIndent(v, "", " ") - return string(output) -} - -func mustToPrettyJson(v interface{}) (string, error) { - output, err := json.MarshalIndent(v, "", " ") - if err != nil { - return "", err - } - return string(output), nil -} - -// toRawJson encodes an item into a JSON string with no escaping of HTML characters. -func toRawJson(v interface{}) string { - output, err := mustToRawJson(v) - if err != nil { - panic(err) - } - return string(output) -} - -// mustToRawJson encodes an item into a JSON string with no escaping of HTML characters. -func mustToRawJson(v interface{}) (string, error) { - buf := new(bytes.Buffer) - enc := json.NewEncoder(buf) - enc.SetEscapeHTML(false) - err := enc.Encode(&v) - if err != nil { - return "", err - } - return strings.TrimSuffix(buf.String(), "\n"), nil -} - -// ternary returns the first value if the last value is true, otherwise returns the second value. -func ternary(vt interface{}, vf interface{}, v bool) interface{} { - if v { - return vt - } - - return vf -} diff --git a/vendor/github.com/Masterminds/sprig/v3/dict.go b/vendor/github.com/Masterminds/sprig/v3/dict.go deleted file mode 100644 index ade8896984..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/dict.go +++ /dev/null @@ -1,174 +0,0 @@ -package sprig - -import ( - "github.com/imdario/mergo" - "github.com/mitchellh/copystructure" -) - -func get(d map[string]interface{}, key string) interface{} { - if val, ok := d[key]; ok { - return val - } - return "" -} - -func set(d map[string]interface{}, key string, value interface{}) map[string]interface{} { - d[key] = value - return d -} - -func unset(d map[string]interface{}, key string) map[string]interface{} { - delete(d, key) - return d -} - -func hasKey(d map[string]interface{}, key string) bool { - _, ok := d[key] - return ok -} - -func pluck(key string, d ...map[string]interface{}) []interface{} { - res := []interface{}{} - for _, dict := range d { - if val, ok := dict[key]; ok { - res = append(res, val) - } - } - return res -} - -func keys(dicts ...map[string]interface{}) []string { - k := []string{} - for _, dict := range dicts { - for key := range dict { - k = append(k, key) - } - } - return k -} - -func pick(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - for _, k := range keys { - if v, ok := dict[k]; ok { - res[k] = v - } - } - return res -} - -func omit(dict map[string]interface{}, keys ...string) map[string]interface{} { - res := map[string]interface{}{} - - omit := make(map[string]bool, len(keys)) - for _, k := range keys { - omit[k] = true - } - - for k, v := range dict { - if _, ok := omit[k]; !ok { - res[k] = v - } - } - return res -} - -func dict(v ...interface{}) map[string]interface{} { - dict := map[string]interface{}{} - lenv := len(v) - for i := 0; i < lenv; i += 2 { - key := strval(v[i]) - if i+1 >= lenv { - dict[key] = "" - continue - } - dict[key] = v[i+1] - } - return dict -} - -func merge(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.Merge(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func mustMerge(dst map[string]interface{}, srcs ...map[string]interface{}) (interface{}, error) { - for _, src := range srcs { - if err := mergo.Merge(&dst, src); err != nil { - return nil, err - } - } - return dst, nil -} - -func mergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) interface{} { - for _, src := range srcs { - if err := mergo.MergeWithOverwrite(&dst, src); err != nil { - // Swallow errors inside of a template. - return "" - } - } - return dst -} - -func mustMergeOverwrite(dst map[string]interface{}, srcs ...map[string]interface{}) (interface{}, error) { - for _, src := range srcs { - if err := mergo.MergeWithOverwrite(&dst, src); err != nil { - return nil, err - } - } - return dst, nil -} - -func values(dict map[string]interface{}) []interface{} { - values := []interface{}{} - for _, value := range dict { - values = append(values, value) - } - - return values -} - -func deepCopy(i interface{}) interface{} { - c, err := mustDeepCopy(i) - if err != nil { - panic("deepCopy error: " + err.Error()) - } - - return c -} - -func mustDeepCopy(i interface{}) (interface{}, error) { - return copystructure.Copy(i) -} - -func dig(ps ...interface{}) (interface{}, error) { - if len(ps) < 3 { - panic("dig needs at least three arguments") - } - dict := ps[len(ps)-1].(map[string]interface{}) - def := ps[len(ps)-2] - ks := make([]string, len(ps)-2) - for i := 0; i < len(ks); i++ { - ks[i] = ps[i].(string) - } - - return digFromDict(dict, def, ks) -} - -func digFromDict(dict map[string]interface{}, d interface{}, ks []string) (interface{}, error) { - k, ns := ks[0], ks[1:len(ks)] - step, has := dict[k] - if !has { - return d, nil - } - if len(ns) == 0 { - return step, nil - } - return digFromDict(step.(map[string]interface{}), d, ns) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/doc.go b/vendor/github.com/Masterminds/sprig/v3/doc.go deleted file mode 100644 index aabb9d4489..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Package sprig provides template functions for Go. - -This package contains a number of utility functions for working with data -inside of Go `html/template` and `text/template` files. - -To add these functions, use the `template.Funcs()` method: - - t := templates.New("foo").Funcs(sprig.FuncMap()) - -Note that you should add the function map before you parse any template files. - - In several cases, Sprig reverses the order of arguments from the way they - appear in the standard library. This is to make it easier to pipe - arguments into functions. - -See http://masterminds.github.io/sprig/ for more detailed documentation on each of the available functions. -*/ -package sprig diff --git a/vendor/github.com/Masterminds/sprig/v3/functions.go b/vendor/github.com/Masterminds/sprig/v3/functions.go deleted file mode 100644 index 57fcec1d9e..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/functions.go +++ /dev/null @@ -1,382 +0,0 @@ -package sprig - -import ( - "errors" - "html/template" - "math/rand" - "os" - "path" - "path/filepath" - "reflect" - "strconv" - "strings" - ttemplate "text/template" - "time" - - util "github.com/Masterminds/goutils" - "github.com/huandu/xstrings" - "github.com/shopspring/decimal" -) - -// FuncMap produces the function map. -// -// Use this to pass the functions into the template engine: -// -// tpl := template.New("foo").Funcs(sprig.FuncMap())) -// -func FuncMap() template.FuncMap { - return HtmlFuncMap() -} - -// HermeticTxtFuncMap returns a 'text/template'.FuncMap with only repeatable functions. -func HermeticTxtFuncMap() ttemplate.FuncMap { - r := TxtFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// HermeticHtmlFuncMap returns an 'html/template'.Funcmap with only repeatable functions. -func HermeticHtmlFuncMap() template.FuncMap { - r := HtmlFuncMap() - for _, name := range nonhermeticFunctions { - delete(r, name) - } - return r -} - -// TxtFuncMap returns a 'text/template'.FuncMap -func TxtFuncMap() ttemplate.FuncMap { - return ttemplate.FuncMap(GenericFuncMap()) -} - -// HtmlFuncMap returns an 'html/template'.Funcmap -func HtmlFuncMap() template.FuncMap { - return template.FuncMap(GenericFuncMap()) -} - -// GenericFuncMap returns a copy of the basic function map as a map[string]interface{}. -func GenericFuncMap() map[string]interface{} { - gfm := make(map[string]interface{}, len(genericMap)) - for k, v := range genericMap { - gfm[k] = v - } - return gfm -} - -// These functions are not guaranteed to evaluate to the same result for given input, because they -// refer to the environment or global state. -var nonhermeticFunctions = []string{ - // Date functions - "date", - "date_in_zone", - "date_modify", - "now", - "htmlDate", - "htmlDateInZone", - "dateInZone", - "dateModify", - - // Strings - "randAlphaNum", - "randAlpha", - "randAscii", - "randNumeric", - "randBytes", - "uuidv4", - - // OS - "env", - "expandenv", - - // Network - "getHostByName", -} - -var genericMap = map[string]interface{}{ - "hello": func() string { return "Hello!" }, - - // Date functions - "ago": dateAgo, - "date": date, - "date_in_zone": dateInZone, - "date_modify": dateModify, - "dateInZone": dateInZone, - "dateModify": dateModify, - "duration": duration, - "durationRound": durationRound, - "htmlDate": htmlDate, - "htmlDateInZone": htmlDateInZone, - "must_date_modify": mustDateModify, - "mustDateModify": mustDateModify, - "mustToDate": mustToDate, - "now": time.Now, - "toDate": toDate, - "unixEpoch": unixEpoch, - - // Strings - "abbrev": abbrev, - "abbrevboth": abbrevboth, - "trunc": trunc, - "trim": strings.TrimSpace, - "upper": strings.ToUpper, - "lower": strings.ToLower, - "title": strings.Title, - "untitle": untitle, - "substr": substring, - // Switch order so that "foo" | repeat 5 - "repeat": func(count int, str string) string { return strings.Repeat(str, count) }, - // Deprecated: Use trimAll. - "trimall": func(a, b string) string { return strings.Trim(b, a) }, - // Switch order so that "$foo" | trimall "$" - "trimAll": func(a, b string) string { return strings.Trim(b, a) }, - "trimSuffix": func(a, b string) string { return strings.TrimSuffix(b, a) }, - "trimPrefix": func(a, b string) string { return strings.TrimPrefix(b, a) }, - "nospace": util.DeleteWhiteSpace, - "initials": initials, - "randAlphaNum": randAlphaNumeric, - "randAlpha": randAlpha, - "randAscii": randAscii, - "randNumeric": randNumeric, - "swapcase": util.SwapCase, - "shuffle": xstrings.Shuffle, - "snakecase": xstrings.ToSnakeCase, - "camelcase": xstrings.ToCamelCase, - "kebabcase": xstrings.ToKebabCase, - "wrap": func(l int, s string) string { return util.Wrap(s, l) }, - "wrapWith": func(l int, sep, str string) string { return util.WrapCustom(str, l, sep, true) }, - // Switch order so that "foobar" | contains "foo" - "contains": func(substr string, str string) bool { return strings.Contains(str, substr) }, - "hasPrefix": func(substr string, str string) bool { return strings.HasPrefix(str, substr) }, - "hasSuffix": func(substr string, str string) bool { return strings.HasSuffix(str, substr) }, - "quote": quote, - "squote": squote, - "cat": cat, - "indent": indent, - "nindent": nindent, - "replace": replace, - "plural": plural, - "sha1sum": sha1sum, - "sha256sum": sha256sum, - "adler32sum": adler32sum, - "toString": strval, - - // Wrap Atoi to stop errors. - "atoi": func(a string) int { i, _ := strconv.Atoi(a); return i }, - "int64": toInt64, - "int": toInt, - "float64": toFloat64, - "seq": seq, - "toDecimal": toDecimal, - - //"gt": func(a, b int) bool {return a > b}, - //"gte": func(a, b int) bool {return a >= b}, - //"lt": func(a, b int) bool {return a < b}, - //"lte": func(a, b int) bool {return a <= b}, - - // split "/" foo/bar returns map[int]string{0: foo, 1: bar} - "split": split, - "splitList": func(sep, orig string) []string { return strings.Split(orig, sep) }, - // splitn "/" foo/bar/fuu returns map[int]string{0: foo, 1: bar/fuu} - "splitn": splitn, - "toStrings": strslice, - - "until": until, - "untilStep": untilStep, - - // VERY basic arithmetic. - "add1": func(i interface{}) int64 { return toInt64(i) + 1 }, - "add": func(i ...interface{}) int64 { - var a int64 = 0 - for _, b := range i { - a += toInt64(b) - } - return a - }, - "sub": func(a, b interface{}) int64 { return toInt64(a) - toInt64(b) }, - "div": func(a, b interface{}) int64 { return toInt64(a) / toInt64(b) }, - "mod": func(a, b interface{}) int64 { return toInt64(a) % toInt64(b) }, - "mul": func(a interface{}, v ...interface{}) int64 { - val := toInt64(a) - for _, b := range v { - val = val * toInt64(b) - } - return val - }, - "randInt": func(min, max int) int { return rand.Intn(max-min) + min }, - "add1f": func(i interface{}) float64 { - return execDecimalOp(i, []interface{}{1}, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) }) - }, - "addf": func(i ...interface{}) float64 { - a := interface{}(float64(0)) - return execDecimalOp(a, i, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Add(d2) }) - }, - "subf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Sub(d2) }) - }, - "divf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Div(d2) }) - }, - "mulf": func(a interface{}, v ...interface{}) float64 { - return execDecimalOp(a, v, func(d1, d2 decimal.Decimal) decimal.Decimal { return d1.Mul(d2) }) - }, - "biggest": max, - "max": max, - "min": min, - "maxf": maxf, - "minf": minf, - "ceil": ceil, - "floor": floor, - "round": round, - - // string slices. Note that we reverse the order b/c that's better - // for template processing. - "join": join, - "sortAlpha": sortAlpha, - - // Defaults - "default": dfault, - "empty": empty, - "coalesce": coalesce, - "all": all, - "any": any, - "compact": compact, - "mustCompact": mustCompact, - "fromJson": fromJson, - "toJson": toJson, - "toPrettyJson": toPrettyJson, - "toRawJson": toRawJson, - "mustFromJson": mustFromJson, - "mustToJson": mustToJson, - "mustToPrettyJson": mustToPrettyJson, - "mustToRawJson": mustToRawJson, - "ternary": ternary, - "deepCopy": deepCopy, - "mustDeepCopy": mustDeepCopy, - - // Reflection - "typeOf": typeOf, - "typeIs": typeIs, - "typeIsLike": typeIsLike, - "kindOf": kindOf, - "kindIs": kindIs, - "deepEqual": reflect.DeepEqual, - - // OS: - "env": os.Getenv, - "expandenv": os.ExpandEnv, - - // Network: - "getHostByName": getHostByName, - - // Paths: - "base": path.Base, - "dir": path.Dir, - "clean": path.Clean, - "ext": path.Ext, - "isAbs": path.IsAbs, - - // Filepaths: - "osBase": filepath.Base, - "osClean": filepath.Clean, - "osDir": filepath.Dir, - "osExt": filepath.Ext, - "osIsAbs": filepath.IsAbs, - - // Encoding: - "b64enc": base64encode, - "b64dec": base64decode, - "b32enc": base32encode, - "b32dec": base32decode, - - // Data Structures: - "tuple": list, // FIXME: with the addition of append/prepend these are no longer immutable. - "list": list, - "dict": dict, - "get": get, - "set": set, - "unset": unset, - "hasKey": hasKey, - "pluck": pluck, - "keys": keys, - "pick": pick, - "omit": omit, - "merge": merge, - "mergeOverwrite": mergeOverwrite, - "mustMerge": mustMerge, - "mustMergeOverwrite": mustMergeOverwrite, - "values": values, - - "append": push, "push": push, - "mustAppend": mustPush, "mustPush": mustPush, - "prepend": prepend, - "mustPrepend": mustPrepend, - "first": first, - "mustFirst": mustFirst, - "rest": rest, - "mustRest": mustRest, - "last": last, - "mustLast": mustLast, - "initial": initial, - "mustInitial": mustInitial, - "reverse": reverse, - "mustReverse": mustReverse, - "uniq": uniq, - "mustUniq": mustUniq, - "without": without, - "mustWithout": mustWithout, - "has": has, - "mustHas": mustHas, - "slice": slice, - "mustSlice": mustSlice, - "concat": concat, - "dig": dig, - "chunk": chunk, - "mustChunk": mustChunk, - - // Crypto: - "bcrypt": bcrypt, - "htpasswd": htpasswd, - "genPrivateKey": generatePrivateKey, - "derivePassword": derivePassword, - "buildCustomCert": buildCustomCertificate, - "genCA": generateCertificateAuthority, - "genCAWithKey": generateCertificateAuthorityWithPEMKey, - "genSelfSignedCert": generateSelfSignedCertificate, - "genSelfSignedCertWithKey": generateSelfSignedCertificateWithPEMKey, - "genSignedCert": generateSignedCertificate, - "genSignedCertWithKey": generateSignedCertificateWithPEMKey, - "encryptAES": encryptAES, - "decryptAES": decryptAES, - "randBytes": randBytes, - - // UUIDs: - "uuidv4": uuidv4, - - // SemVer: - "semver": semver, - "semverCompare": semverCompare, - - // Flow Control: - "fail": func(msg string) (string, error) { return "", errors.New(msg) }, - - // Regex - "regexMatch": regexMatch, - "mustRegexMatch": mustRegexMatch, - "regexFindAll": regexFindAll, - "mustRegexFindAll": mustRegexFindAll, - "regexFind": regexFind, - "mustRegexFind": mustRegexFind, - "regexReplaceAll": regexReplaceAll, - "mustRegexReplaceAll": mustRegexReplaceAll, - "regexReplaceAllLiteral": regexReplaceAllLiteral, - "mustRegexReplaceAllLiteral": mustRegexReplaceAllLiteral, - "regexSplit": regexSplit, - "mustRegexSplit": mustRegexSplit, - "regexQuoteMeta": regexQuoteMeta, - - // URLs: - "urlParse": urlParse, - "urlJoin": urlJoin, -} diff --git a/vendor/github.com/Masterminds/sprig/v3/list.go b/vendor/github.com/Masterminds/sprig/v3/list.go deleted file mode 100644 index ca0fbb7893..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/list.go +++ /dev/null @@ -1,464 +0,0 @@ -package sprig - -import ( - "fmt" - "math" - "reflect" - "sort" -) - -// Reflection is used in these functions so that slices and arrays of strings, -// ints, and other types not implementing []interface{} can be worked with. -// For example, this is useful if you need to work on the output of regexs. - -func list(v ...interface{}) []interface{} { - return v -} - -func push(list interface{}, v interface{}) []interface{} { - l, err := mustPush(list, v) - if err != nil { - panic(err) - } - - return l -} - -func mustPush(list interface{}, v interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append(nl, v), nil - - default: - return nil, fmt.Errorf("Cannot push on type %s", tp) - } -} - -func prepend(list interface{}, v interface{}) []interface{} { - l, err := mustPrepend(list, v) - if err != nil { - panic(err) - } - - return l -} - -func mustPrepend(list interface{}, v interface{}) ([]interface{}, error) { - //return append([]interface{}{v}, list...) - - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[i] = l2.Index(i).Interface() - } - - return append([]interface{}{v}, nl...), nil - - default: - return nil, fmt.Errorf("Cannot prepend on type %s", tp) - } -} - -func chunk(size int, list interface{}) [][]interface{} { - l, err := mustChunk(size, list) - if err != nil { - panic(err) - } - - return l -} - -func mustChunk(size int, list interface{}) ([][]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - - cs := int(math.Floor(float64(l-1)/float64(size)) + 1) - nl := make([][]interface{}, cs) - - for i := 0; i < cs; i++ { - clen := size - if i == cs-1 { - clen = int(math.Floor(math.Mod(float64(l), float64(size)))) - if clen == 0 { - clen = size - } - } - - nl[i] = make([]interface{}, clen) - - for j := 0; j < clen; j++ { - ix := i*size + j - nl[i][j] = l2.Index(ix).Interface() - } - } - - return nl, nil - - default: - return nil, fmt.Errorf("Cannot chunk type %s", tp) - } -} - -func last(list interface{}) interface{} { - l, err := mustLast(list) - if err != nil { - panic(err) - } - - return l -} - -func mustLast(list interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - return l2.Index(l - 1).Interface(), nil - default: - return nil, fmt.Errorf("Cannot find last on type %s", tp) - } -} - -func first(list interface{}) interface{} { - l, err := mustFirst(list) - if err != nil { - panic(err) - } - - return l -} - -func mustFirst(list interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - return l2.Index(0).Interface(), nil - default: - return nil, fmt.Errorf("Cannot find first on type %s", tp) - } -} - -func rest(list interface{}) []interface{} { - l, err := mustRest(list) - if err != nil { - panic(err) - } - - return l -} - -func mustRest(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - nl := make([]interface{}, l-1) - for i := 1; i < l; i++ { - nl[i-1] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find rest on type %s", tp) - } -} - -func initial(list interface{}) []interface{} { - l, err := mustInitial(list) - if err != nil { - panic(err) - } - - return l -} - -func mustInitial(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - nl := make([]interface{}, l-1) - for i := 0; i < l-1; i++ { - nl[i] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find initial on type %s", tp) - } -} - -func sortAlpha(list interface{}) []string { - k := reflect.Indirect(reflect.ValueOf(list)).Kind() - switch k { - case reflect.Slice, reflect.Array: - a := strslice(list) - s := sort.StringSlice(a) - s.Sort() - return s - } - return []string{strval(list)} -} - -func reverse(v interface{}) []interface{} { - l, err := mustReverse(v) - if err != nil { - panic(err) - } - - return l -} - -func mustReverse(v interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(v).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(v) - - l := l2.Len() - // We do not sort in place because the incoming array should not be altered. - nl := make([]interface{}, l) - for i := 0; i < l; i++ { - nl[l-i-1] = l2.Index(i).Interface() - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot find reverse on type %s", tp) - } -} - -func compact(list interface{}) []interface{} { - l, err := mustCompact(list) - if err != nil { - panic(err) - } - - return l -} - -func mustCompact(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - nl := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !empty(item) { - nl = append(nl, item) - } - } - - return nl, nil - default: - return nil, fmt.Errorf("Cannot compact on type %s", tp) - } -} - -func uniq(list interface{}) []interface{} { - l, err := mustUniq(list) - if err != nil { - panic(err) - } - - return l -} - -func mustUniq(list interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - dest := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(dest, item) { - dest = append(dest, item) - } - } - - return dest, nil - default: - return nil, fmt.Errorf("Cannot find uniq on type %s", tp) - } -} - -func inList(haystack []interface{}, needle interface{}) bool { - for _, h := range haystack { - if reflect.DeepEqual(needle, h) { - return true - } - } - return false -} - -func without(list interface{}, omit ...interface{}) []interface{} { - l, err := mustWithout(list, omit...) - if err != nil { - panic(err) - } - - return l -} - -func mustWithout(list interface{}, omit ...interface{}) ([]interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - res := []interface{}{} - var item interface{} - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if !inList(omit, item) { - res = append(res, item) - } - } - - return res, nil - default: - return nil, fmt.Errorf("Cannot find without on type %s", tp) - } -} - -func has(needle interface{}, haystack interface{}) bool { - l, err := mustHas(needle, haystack) - if err != nil { - panic(err) - } - - return l -} - -func mustHas(needle interface{}, haystack interface{}) (bool, error) { - if haystack == nil { - return false, nil - } - tp := reflect.TypeOf(haystack).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(haystack) - var item interface{} - l := l2.Len() - for i := 0; i < l; i++ { - item = l2.Index(i).Interface() - if reflect.DeepEqual(needle, item) { - return true, nil - } - } - - return false, nil - default: - return false, fmt.Errorf("Cannot find has on type %s", tp) - } -} - -// $list := [1, 2, 3, 4, 5] -// slice $list -> list[0:5] = list[:] -// slice $list 0 3 -> list[0:3] = list[:3] -// slice $list 3 5 -> list[3:5] -// slice $list 3 -> list[3:5] = list[3:] -func slice(list interface{}, indices ...interface{}) interface{} { - l, err := mustSlice(list, indices...) - if err != nil { - panic(err) - } - - return l -} - -func mustSlice(list interface{}, indices ...interface{}) (interface{}, error) { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - - l := l2.Len() - if l == 0 { - return nil, nil - } - - var start, end int - if len(indices) > 0 { - start = toInt(indices[0]) - } - if len(indices) < 2 { - end = l - } else { - end = toInt(indices[1]) - } - - return l2.Slice(start, end).Interface(), nil - default: - return nil, fmt.Errorf("list should be type of slice or array but %s", tp) - } -} - -func concat(lists ...interface{}) interface{} { - var res []interface{} - for _, list := range lists { - tp := reflect.TypeOf(list).Kind() - switch tp { - case reflect.Slice, reflect.Array: - l2 := reflect.ValueOf(list) - for i := 0; i < l2.Len(); i++ { - res = append(res, l2.Index(i).Interface()) - } - default: - panic(fmt.Sprintf("Cannot concat type %s as list", tp)) - } - } - return res -} diff --git a/vendor/github.com/Masterminds/sprig/v3/network.go b/vendor/github.com/Masterminds/sprig/v3/network.go deleted file mode 100644 index 108d78a946..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/network.go +++ /dev/null @@ -1,12 +0,0 @@ -package sprig - -import ( - "math/rand" - "net" -) - -func getHostByName(name string) string { - addrs, _ := net.LookupHost(name) - //TODO: add error handing when release v3 comes out - return addrs[rand.Intn(len(addrs))] -} diff --git a/vendor/github.com/Masterminds/sprig/v3/numeric.go b/vendor/github.com/Masterminds/sprig/v3/numeric.go deleted file mode 100644 index f68e4182ee..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/numeric.go +++ /dev/null @@ -1,186 +0,0 @@ -package sprig - -import ( - "fmt" - "math" - "strconv" - "strings" - - "github.com/spf13/cast" - "github.com/shopspring/decimal" -) - -// toFloat64 converts 64-bit floats -func toFloat64(v interface{}) float64 { - return cast.ToFloat64(v) -} - -func toInt(v interface{}) int { - return cast.ToInt(v) -} - -// toInt64 converts integer types to 64-bit integers -func toInt64(v interface{}) int64 { - return cast.ToInt64(v) -} - -func max(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb > aa { - aa = bb - } - } - return aa -} - -func maxf(a interface{}, i ...interface{}) float64 { - aa := toFloat64(a) - for _, b := range i { - bb := toFloat64(b) - aa = math.Max(aa, bb) - } - return aa -} - -func min(a interface{}, i ...interface{}) int64 { - aa := toInt64(a) - for _, b := range i { - bb := toInt64(b) - if bb < aa { - aa = bb - } - } - return aa -} - -func minf(a interface{}, i ...interface{}) float64 { - aa := toFloat64(a) - for _, b := range i { - bb := toFloat64(b) - aa = math.Min(aa, bb) - } - return aa -} - -func until(count int) []int { - step := 1 - if count < 0 { - step = -1 - } - return untilStep(0, count, step) -} - -func untilStep(start, stop, step int) []int { - v := []int{} - - if stop < start { - if step >= 0 { - return v - } - for i := start; i > stop; i += step { - v = append(v, i) - } - return v - } - - if step <= 0 { - return v - } - for i := start; i < stop; i += step { - v = append(v, i) - } - return v -} - -func floor(a interface{}) float64 { - aa := toFloat64(a) - return math.Floor(aa) -} - -func ceil(a interface{}) float64 { - aa := toFloat64(a) - return math.Ceil(aa) -} - -func round(a interface{}, p int, rOpt ...float64) float64 { - roundOn := .5 - if len(rOpt) > 0 { - roundOn = rOpt[0] - } - val := toFloat64(a) - places := toFloat64(p) - - var round float64 - pow := math.Pow(10, places) - digit := pow * val - _, div := math.Modf(digit) - if div >= roundOn { - round = math.Ceil(digit) - } else { - round = math.Floor(digit) - } - return round / pow -} - -// converts unix octal to decimal -func toDecimal(v interface{}) int64 { - result, err := strconv.ParseInt(fmt.Sprint(v), 8, 64) - if err != nil { - return 0 - } - return result -} - -func seq(params ...int) string { - increment := 1 - switch len(params) { - case 0: - return "" - case 1: - start := 1 - end := params[0] - if end < start { - increment = -1 - } - return intArrayToString(untilStep(start, end+increment, increment), " ") - case 3: - start := params[0] - end := params[2] - step := params[1] - if end < start { - increment = -1 - if step > 0 { - return "" - } - } - return intArrayToString(untilStep(start, end+increment, step), " ") - case 2: - start := params[0] - end := params[1] - step := 1 - if end < start { - step = -1 - } - return intArrayToString(untilStep(start, end+step, step), " ") - default: - return "" - } -} - -func intArrayToString(slice []int, delimeter string) string { - return strings.Trim(strings.Join(strings.Fields(fmt.Sprint(slice)), delimeter), "[]") -} - -// performs a float and subsequent decimal.Decimal conversion on inputs, -// and iterates through a and b executing the mathmetical operation f -func execDecimalOp(a interface{}, b []interface{}, f func(d1, d2 decimal.Decimal) decimal.Decimal) float64 { - prt := decimal.NewFromFloat(toFloat64(a)) - for _, x := range b { - dx := decimal.NewFromFloat(toFloat64(x)) - prt = f(prt, dx) - } - rslt, _ := prt.Float64() - return rslt -} diff --git a/vendor/github.com/Masterminds/sprig/v3/reflect.go b/vendor/github.com/Masterminds/sprig/v3/reflect.go deleted file mode 100644 index 8a65c132f0..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/reflect.go +++ /dev/null @@ -1,28 +0,0 @@ -package sprig - -import ( - "fmt" - "reflect" -) - -// typeIs returns true if the src is the type named in target. -func typeIs(target string, src interface{}) bool { - return target == typeOf(src) -} - -func typeIsLike(target string, src interface{}) bool { - t := typeOf(src) - return target == t || "*"+target == t -} - -func typeOf(src interface{}) string { - return fmt.Sprintf("%T", src) -} - -func kindIs(target string, src interface{}) bool { - return target == kindOf(src) -} - -func kindOf(src interface{}) string { - return reflect.ValueOf(src).Kind().String() -} diff --git a/vendor/github.com/Masterminds/sprig/v3/regex.go b/vendor/github.com/Masterminds/sprig/v3/regex.go deleted file mode 100644 index fab5510189..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/regex.go +++ /dev/null @@ -1,83 +0,0 @@ -package sprig - -import ( - "regexp" -) - -func regexMatch(regex string, s string) bool { - match, _ := regexp.MatchString(regex, s) - return match -} - -func mustRegexMatch(regex string, s string) (bool, error) { - return regexp.MatchString(regex, s) -} - -func regexFindAll(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.FindAllString(s, n) -} - -func mustRegexFindAll(regex string, s string, n int) ([]string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return []string{}, err - } - return r.FindAllString(s, n), nil -} - -func regexFind(regex string, s string) string { - r := regexp.MustCompile(regex) - return r.FindString(s) -} - -func mustRegexFind(regex string, s string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.FindString(s), nil -} - -func regexReplaceAll(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllString(s, repl) -} - -func mustRegexReplaceAll(regex string, s string, repl string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.ReplaceAllString(s, repl), nil -} - -func regexReplaceAllLiteral(regex string, s string, repl string) string { - r := regexp.MustCompile(regex) - return r.ReplaceAllLiteralString(s, repl) -} - -func mustRegexReplaceAllLiteral(regex string, s string, repl string) (string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return "", err - } - return r.ReplaceAllLiteralString(s, repl), nil -} - -func regexSplit(regex string, s string, n int) []string { - r := regexp.MustCompile(regex) - return r.Split(s, n) -} - -func mustRegexSplit(regex string, s string, n int) ([]string, error) { - r, err := regexp.Compile(regex) - if err != nil { - return []string{}, err - } - return r.Split(s, n), nil -} - -func regexQuoteMeta(s string) string { - return regexp.QuoteMeta(s) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/semver.go b/vendor/github.com/Masterminds/sprig/v3/semver.go deleted file mode 100644 index 3fbe08aa63..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/semver.go +++ /dev/null @@ -1,23 +0,0 @@ -package sprig - -import ( - sv2 "github.com/Masterminds/semver/v3" -) - -func semverCompare(constraint, version string) (bool, error) { - c, err := sv2.NewConstraint(constraint) - if err != nil { - return false, err - } - - v, err := sv2.NewVersion(version) - if err != nil { - return false, err - } - - return c.Check(v), nil -} - -func semver(version string) (*sv2.Version, error) { - return sv2.NewVersion(version) -} diff --git a/vendor/github.com/Masterminds/sprig/v3/strings.go b/vendor/github.com/Masterminds/sprig/v3/strings.go deleted file mode 100644 index e0ae628c84..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/strings.go +++ /dev/null @@ -1,236 +0,0 @@ -package sprig - -import ( - "encoding/base32" - "encoding/base64" - "fmt" - "reflect" - "strconv" - "strings" - - util "github.com/Masterminds/goutils" -) - -func base64encode(v string) string { - return base64.StdEncoding.EncodeToString([]byte(v)) -} - -func base64decode(v string) string { - data, err := base64.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func base32encode(v string) string { - return base32.StdEncoding.EncodeToString([]byte(v)) -} - -func base32decode(v string) string { - data, err := base32.StdEncoding.DecodeString(v) - if err != nil { - return err.Error() - } - return string(data) -} - -func abbrev(width int, s string) string { - if width < 4 { - return s - } - r, _ := util.Abbreviate(s, width) - return r -} - -func abbrevboth(left, right int, s string) string { - if right < 4 || left > 0 && right < 7 { - return s - } - r, _ := util.AbbreviateFull(s, left, right) - return r -} -func initials(s string) string { - // Wrap this just to eliminate the var args, which templates don't do well. - return util.Initials(s) -} - -func randAlphaNumeric(count int) string { - // It is not possible, it appears, to actually generate an error here. - r, _ := util.CryptoRandomAlphaNumeric(count) - return r -} - -func randAlpha(count int) string { - r, _ := util.CryptoRandomAlphabetic(count) - return r -} - -func randAscii(count int) string { - r, _ := util.CryptoRandomAscii(count) - return r -} - -func randNumeric(count int) string { - r, _ := util.CryptoRandomNumeric(count) - return r -} - -func untitle(str string) string { - return util.Uncapitalize(str) -} - -func quote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("%q", strval(s))) - } - } - return strings.Join(out, " ") -} - -func squote(str ...interface{}) string { - out := make([]string, 0, len(str)) - for _, s := range str { - if s != nil { - out = append(out, fmt.Sprintf("'%v'", s)) - } - } - return strings.Join(out, " ") -} - -func cat(v ...interface{}) string { - v = removeNilElements(v) - r := strings.TrimSpace(strings.Repeat("%v ", len(v))) - return fmt.Sprintf(r, v...) -} - -func indent(spaces int, v string) string { - pad := strings.Repeat(" ", spaces) - return pad + strings.Replace(v, "\n", "\n"+pad, -1) -} - -func nindent(spaces int, v string) string { - return "\n" + indent(spaces, v) -} - -func replace(old, new, src string) string { - return strings.Replace(src, old, new, -1) -} - -func plural(one, many string, count int) string { - if count == 1 { - return one - } - return many -} - -func strslice(v interface{}) []string { - switch v := v.(type) { - case []string: - return v - case []interface{}: - b := make([]string, 0, len(v)) - for _, s := range v { - if s != nil { - b = append(b, strval(s)) - } - } - return b - default: - val := reflect.ValueOf(v) - switch val.Kind() { - case reflect.Array, reflect.Slice: - l := val.Len() - b := make([]string, 0, l) - for i := 0; i < l; i++ { - value := val.Index(i).Interface() - if value != nil { - b = append(b, strval(value)) - } - } - return b - default: - if v == nil { - return []string{} - } - - return []string{strval(v)} - } - } -} - -func removeNilElements(v []interface{}) []interface{} { - newSlice := make([]interface{}, 0, len(v)) - for _, i := range v { - if i != nil { - newSlice = append(newSlice, i) - } - } - return newSlice -} - -func strval(v interface{}) string { - switch v := v.(type) { - case string: - return v - case []byte: - return string(v) - case error: - return v.Error() - case fmt.Stringer: - return v.String() - default: - return fmt.Sprintf("%v", v) - } -} - -func trunc(c int, s string) string { - if c < 0 && len(s)+c > 0 { - return s[len(s)+c:] - } - if c >= 0 && len(s) > c { - return s[:c] - } - return s -} - -func join(sep string, v interface{}) string { - return strings.Join(strslice(v), sep) -} - -func split(sep, orig string) map[string]string { - parts := strings.Split(orig, sep) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -func splitn(sep string, n int, orig string) map[string]string { - parts := strings.SplitN(orig, sep, n) - res := make(map[string]string, len(parts)) - for i, v := range parts { - res["_"+strconv.Itoa(i)] = v - } - return res -} - -// substring creates a substring of the given string. -// -// If start is < 0, this calls string[:end]. -// -// If start is >= 0 and end < 0 or end bigger than s length, this calls string[start:] -// -// Otherwise, this calls string[start, end]. -func substring(start, end int, s string) string { - if start < 0 { - return s[:end] - } - if end < 0 || end > len(s) { - return s[start:] - } - return s[start:end] -} diff --git a/vendor/github.com/Masterminds/sprig/v3/url.go b/vendor/github.com/Masterminds/sprig/v3/url.go deleted file mode 100644 index b8e120e19b..0000000000 --- a/vendor/github.com/Masterminds/sprig/v3/url.go +++ /dev/null @@ -1,66 +0,0 @@ -package sprig - -import ( - "fmt" - "net/url" - "reflect" -) - -func dictGetOrEmpty(dict map[string]interface{}, key string) string { - value, ok := dict[key] - if !ok { - return "" - } - tp := reflect.TypeOf(value).Kind() - if tp != reflect.String { - panic(fmt.Sprintf("unable to parse %s key, must be of type string, but %s found", key, tp.String())) - } - return reflect.ValueOf(value).String() -} - -// parses given URL to return dict object -func urlParse(v string) map[string]interface{} { - dict := map[string]interface{}{} - parsedURL, err := url.Parse(v) - if err != nil { - panic(fmt.Sprintf("unable to parse url: %s", err)) - } - dict["scheme"] = parsedURL.Scheme - dict["host"] = parsedURL.Host - dict["hostname"] = parsedURL.Hostname() - dict["path"] = parsedURL.Path - dict["query"] = parsedURL.RawQuery - dict["opaque"] = parsedURL.Opaque - dict["fragment"] = parsedURL.Fragment - if parsedURL.User != nil { - dict["userinfo"] = parsedURL.User.String() - } else { - dict["userinfo"] = "" - } - - return dict -} - -// join given dict to URL string -func urlJoin(d map[string]interface{}) string { - resURL := url.URL{ - Scheme: dictGetOrEmpty(d, "scheme"), - Host: dictGetOrEmpty(d, "host"), - Path: dictGetOrEmpty(d, "path"), - RawQuery: dictGetOrEmpty(d, "query"), - Opaque: dictGetOrEmpty(d, "opaque"), - Fragment: dictGetOrEmpty(d, "fragment"), - } - userinfo := dictGetOrEmpty(d, "userinfo") - var user *url.Userinfo - if userinfo != "" { - tempURL, err := url.Parse(fmt.Sprintf("proto://%s@host", userinfo)) - if err != nil { - panic(fmt.Sprintf("unable to parse userinfo in dict: %s", err)) - } - user = tempURL.User - } - - resURL.User = user - return resURL.String() -} diff --git a/vendor/github.com/Microsoft/go-winio/.gitattributes b/vendor/github.com/Microsoft/go-winio/.gitattributes deleted file mode 100644 index 94f480de94..0000000000 --- a/vendor/github.com/Microsoft/go-winio/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto eol=lf \ No newline at end of file diff --git a/vendor/github.com/Microsoft/go-winio/.gitignore b/vendor/github.com/Microsoft/go-winio/.gitignore deleted file mode 100644 index 815e20660e..0000000000 --- a/vendor/github.com/Microsoft/go-winio/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -.vscode/ - -*.exe - -# testing -testdata - -# go workspaces -go.work -go.work.sum diff --git a/vendor/github.com/Microsoft/go-winio/.golangci.yml b/vendor/github.com/Microsoft/go-winio/.golangci.yml deleted file mode 100644 index 7b503d26a3..0000000000 --- a/vendor/github.com/Microsoft/go-winio/.golangci.yml +++ /dev/null @@ -1,149 +0,0 @@ -run: - skip-dirs: - - pkg/etw/sample - -linters: - enable: - # style - - containedctx # struct contains a context - - dupl # duplicate code - - errname # erorrs are named correctly - - nolintlint # "//nolint" directives are properly explained - - revive # golint replacement - - unconvert # unnecessary conversions - - wastedassign - - # bugs, performance, unused, etc ... - - contextcheck # function uses a non-inherited context - - errorlint # errors not wrapped for 1.13 - - exhaustive # check exhaustiveness of enum switch statements - - gofmt # files are gofmt'ed - - gosec # security - - nilerr # returns nil even with non-nil error - - unparam # unused function params - -issues: - exclude-rules: - # err is very often shadowed in nested scopes - - linters: - - govet - text: '^shadow: declaration of "err" shadows declaration' - - # ignore long lines for skip autogen directives - - linters: - - revive - text: "^line-length-limit: " - source: "^//(go:generate|sys) " - - #TODO: remove after upgrading to go1.18 - # ignore comment spacing for nolint and sys directives - - linters: - - revive - text: "^comment-spacings: no space between comment delimiter and comment text" - source: "//(cspell:|nolint:|sys |todo)" - - # not on go 1.18 yet, so no any - - linters: - - revive - text: "^use-any: since GO 1.18 'interface{}' can be replaced by 'any'" - - # allow unjustified ignores of error checks in defer statements - - linters: - - nolintlint - text: "^directive `//nolint:errcheck` should provide explanation" - source: '^\s*defer ' - - # allow unjustified ignores of error lints for io.EOF - - linters: - - nolintlint - text: "^directive `//nolint:errorlint` should provide explanation" - source: '[=|!]= io.EOF' - - -linters-settings: - exhaustive: - default-signifies-exhaustive: true - govet: - enable-all: true - disable: - # struct order is often for Win32 compat - # also, ignore pointer bytes/GC issues for now until performance becomes an issue - - fieldalignment - check-shadowing: true - nolintlint: - allow-leading-space: false - require-explanation: true - require-specific: true - revive: - # revive is more configurable than static check, so likely the preferred alternative to static-check - # (once the perf issue is solved: https://github.com/golangci/golangci-lint/issues/2997) - enable-all-rules: - true - # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md - rules: - # rules with required arguments - - name: argument-limit - disabled: true - - name: banned-characters - disabled: true - - name: cognitive-complexity - disabled: true - - name: cyclomatic - disabled: true - - name: file-header - disabled: true - - name: function-length - disabled: true - - name: function-result-limit - disabled: true - - name: max-public-structs - disabled: true - # geneally annoying rules - - name: add-constant # complains about any and all strings and integers - disabled: true - - name: confusing-naming # we frequently use "Foo()" and "foo()" together - disabled: true - - name: flag-parameter # excessive, and a common idiom we use - disabled: true - - name: unhandled-error # warns over common fmt.Print* and io.Close; rely on errcheck instead - disabled: true - # general config - - name: line-length-limit - arguments: - - 140 - - name: var-naming - arguments: - - [] - - - CID - - CRI - - CTRD - - DACL - - DLL - - DOS - - ETW - - FSCTL - - GCS - - GMSA - - HCS - - HV - - IO - - LCOW - - LDAP - - LPAC - - LTSC - - MMIO - - NT - - OCI - - PMEM - - PWSH - - RX - - SACl - - SID - - SMB - - TX - - VHD - - VHDX - - VMID - - VPCI - - WCOW - - WIM diff --git a/vendor/github.com/Microsoft/go-winio/CODEOWNERS b/vendor/github.com/Microsoft/go-winio/CODEOWNERS deleted file mode 100644 index ae1b4942b9..0000000000 --- a/vendor/github.com/Microsoft/go-winio/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ - * @microsoft/containerplat diff --git a/vendor/github.com/Microsoft/go-winio/LICENSE b/vendor/github.com/Microsoft/go-winio/LICENSE deleted file mode 100644 index b8b569d774..0000000000 --- a/vendor/github.com/Microsoft/go-winio/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/Microsoft/go-winio/README.md b/vendor/github.com/Microsoft/go-winio/README.md deleted file mode 100644 index 7474b4f0b6..0000000000 --- a/vendor/github.com/Microsoft/go-winio/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# go-winio [![Build Status](https://github.com/microsoft/go-winio/actions/workflows/ci.yml/badge.svg)](https://github.com/microsoft/go-winio/actions/workflows/ci.yml) - -This repository contains utilities for efficiently performing Win32 IO operations in -Go. Currently, this is focused on accessing named pipes and other file handles, and -for using named pipes as a net transport. - -This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go -to reuse the thread to schedule another goroutine. This limits support to Windows Vista and -newer operating systems. This is similar to the implementation of network sockets in Go's net -package. - -Please see the LICENSE file for licensing information. - -## Contributing - -This project welcomes contributions and suggestions. -Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that -you have the right to, and actually do, grant us the rights to use your contribution. -For details, visit [Microsoft CLA](https://cla.microsoft.com). - -When you submit a pull request, a CLA-bot will automatically determine whether you need to -provide a CLA and decorate the PR appropriately (e.g., label, comment). -Simply follow the instructions provided by the bot. -You will only need to do this once across all repos using our CLA. - -Additionally, the pull request pipeline requires the following steps to be performed before -mergining. - -### Code Sign-Off - -We require that contributors sign their commits using [`git commit --signoff`][git-commit-s] -to certify they either authored the work themselves or otherwise have permission to use it in this project. - -A range of commits can be signed off using [`git rebase --signoff`][git-rebase-s]. - -Please see [the developer certificate](https://developercertificate.org) for more info, -as well as to make sure that you can attest to the rules listed. -Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off. - -### Linting - -Code must pass a linting stage, which uses [`golangci-lint`][lint]. -The linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run -automatically with VSCode by adding the following to your workspace or folder settings: - -```json - "go.lintTool": "golangci-lint", - "go.lintOnSave": "package", -``` - -Additional editor [integrations options are also available][lint-ide]. - -Alternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root: - -```shell -# use . or specify a path to only lint a package -# to show all lint errors, use flags "--max-issues-per-linter=0 --max-same-issues=0" -> golangci-lint run ./... -``` - -### Go Generate - -The pipeline checks that auto-generated code, via `go generate`, are up to date. - -This can be done for the entire repo: - -```shell -> go generate ./... -``` - -## Code of Conduct - -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). -For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or -contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. - -## Special Thanks - -Thanks to [natefinch][natefinch] for the inspiration for this library. -See [npipe](https://github.com/natefinch/npipe) for another named pipe implementation. - -[lint]: https://golangci-lint.run/ -[lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration -[lint-install]: https://golangci-lint.run/usage/install/#local-installation - -[git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s -[git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff - -[natefinch]: https://github.com/natefinch diff --git a/vendor/github.com/Microsoft/go-winio/SECURITY.md b/vendor/github.com/Microsoft/go-winio/SECURITY.md deleted file mode 100644 index 869fdfe2b2..0000000000 --- a/vendor/github.com/Microsoft/go-winio/SECURITY.md +++ /dev/null @@ -1,41 +0,0 @@ - - -## Security - -Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). - -If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below. - -## Reporting Security Issues - -**Please do not report security vulnerabilities through public GitHub issues.** - -Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report). - -If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey). - -You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc). - -Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: - - * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) - * Full paths of source file(s) related to the manifestation of the issue - * The location of the affected source code (tag/branch/commit or direct URL) - * Any special configuration required to reproduce the issue - * Step-by-step instructions to reproduce the issue - * Proof-of-concept or exploit code (if possible) - * Impact of the issue, including how an attacker might exploit the issue - -This information will help us triage your report more quickly. - -If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs. - -## Preferred Languages - -We prefer all communications to be in English. - -## Policy - -Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd). - - diff --git a/vendor/github.com/Microsoft/go-winio/backup.go b/vendor/github.com/Microsoft/go-winio/backup.go deleted file mode 100644 index 09621c8846..0000000000 --- a/vendor/github.com/Microsoft/go-winio/backup.go +++ /dev/null @@ -1,290 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "encoding/binary" - "errors" - "fmt" - "io" - "os" - "runtime" - "syscall" - "unicode/utf16" - - "golang.org/x/sys/windows" -) - -//sys backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupRead -//sys backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) = BackupWrite - -const ( - BackupData = uint32(iota + 1) - BackupEaData - BackupSecurity - BackupAlternateData - BackupLink - BackupPropertyData - BackupObjectId //revive:disable-line:var-naming ID, not Id - BackupReparseData - BackupSparseBlock - BackupTxfsData -) - -const ( - StreamSparseAttributes = uint32(8) -) - -//nolint:revive // var-naming: ALL_CAPS -const ( - WRITE_DAC = windows.WRITE_DAC - WRITE_OWNER = windows.WRITE_OWNER - ACCESS_SYSTEM_SECURITY = windows.ACCESS_SYSTEM_SECURITY -) - -// BackupHeader represents a backup stream of a file. -type BackupHeader struct { - //revive:disable-next-line:var-naming ID, not Id - Id uint32 // The backup stream ID - Attributes uint32 // Stream attributes - Size int64 // The size of the stream in bytes - Name string // The name of the stream (for BackupAlternateData only). - Offset int64 // The offset of the stream in the file (for BackupSparseBlock only). -} - -type win32StreamID struct { - StreamID uint32 - Attributes uint32 - Size uint64 - NameSize uint32 -} - -// BackupStreamReader reads from a stream produced by the BackupRead Win32 API and produces a series -// of BackupHeader values. -type BackupStreamReader struct { - r io.Reader - bytesLeft int64 -} - -// NewBackupStreamReader produces a BackupStreamReader from any io.Reader. -func NewBackupStreamReader(r io.Reader) *BackupStreamReader { - return &BackupStreamReader{r, 0} -} - -// Next returns the next backup stream and prepares for calls to Read(). It skips the remainder of the current stream if -// it was not completely read. -func (r *BackupStreamReader) Next() (*BackupHeader, error) { - if r.bytesLeft > 0 { //nolint:nestif // todo: flatten this - if s, ok := r.r.(io.Seeker); ok { - // Make sure Seek on io.SeekCurrent sometimes succeeds - // before trying the actual seek. - if _, err := s.Seek(0, io.SeekCurrent); err == nil { - if _, err = s.Seek(r.bytesLeft, io.SeekCurrent); err != nil { - return nil, err - } - r.bytesLeft = 0 - } - } - if _, err := io.Copy(io.Discard, r); err != nil { - return nil, err - } - } - var wsi win32StreamID - if err := binary.Read(r.r, binary.LittleEndian, &wsi); err != nil { - return nil, err - } - hdr := &BackupHeader{ - Id: wsi.StreamID, - Attributes: wsi.Attributes, - Size: int64(wsi.Size), - } - if wsi.NameSize != 0 { - name := make([]uint16, int(wsi.NameSize/2)) - if err := binary.Read(r.r, binary.LittleEndian, name); err != nil { - return nil, err - } - hdr.Name = syscall.UTF16ToString(name) - } - if wsi.StreamID == BackupSparseBlock { - if err := binary.Read(r.r, binary.LittleEndian, &hdr.Offset); err != nil { - return nil, err - } - hdr.Size -= 8 - } - r.bytesLeft = hdr.Size - return hdr, nil -} - -// Read reads from the current backup stream. -func (r *BackupStreamReader) Read(b []byte) (int, error) { - if r.bytesLeft == 0 { - return 0, io.EOF - } - if int64(len(b)) > r.bytesLeft { - b = b[:r.bytesLeft] - } - n, err := r.r.Read(b) - r.bytesLeft -= int64(n) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } else if r.bytesLeft == 0 && err == nil { - err = io.EOF - } - return n, err -} - -// BackupStreamWriter writes a stream compatible with the BackupWrite Win32 API. -type BackupStreamWriter struct { - w io.Writer - bytesLeft int64 -} - -// NewBackupStreamWriter produces a BackupStreamWriter on top of an io.Writer. -func NewBackupStreamWriter(w io.Writer) *BackupStreamWriter { - return &BackupStreamWriter{w, 0} -} - -// WriteHeader writes the next backup stream header and prepares for calls to Write(). -func (w *BackupStreamWriter) WriteHeader(hdr *BackupHeader) error { - if w.bytesLeft != 0 { - return fmt.Errorf("missing %d bytes", w.bytesLeft) - } - name := utf16.Encode([]rune(hdr.Name)) - wsi := win32StreamID{ - StreamID: hdr.Id, - Attributes: hdr.Attributes, - Size: uint64(hdr.Size), - NameSize: uint32(len(name) * 2), - } - if hdr.Id == BackupSparseBlock { - // Include space for the int64 block offset - wsi.Size += 8 - } - if err := binary.Write(w.w, binary.LittleEndian, &wsi); err != nil { - return err - } - if len(name) != 0 { - if err := binary.Write(w.w, binary.LittleEndian, name); err != nil { - return err - } - } - if hdr.Id == BackupSparseBlock { - if err := binary.Write(w.w, binary.LittleEndian, hdr.Offset); err != nil { - return err - } - } - w.bytesLeft = hdr.Size - return nil -} - -// Write writes to the current backup stream. -func (w *BackupStreamWriter) Write(b []byte) (int, error) { - if w.bytesLeft < int64(len(b)) { - return 0, fmt.Errorf("too many bytes by %d", int64(len(b))-w.bytesLeft) - } - n, err := w.w.Write(b) - w.bytesLeft -= int64(n) - return n, err -} - -// BackupFileReader provides an io.ReadCloser interface on top of the BackupRead Win32 API. -type BackupFileReader struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileReader returns a new BackupFileReader from a file handle. If includeSecurity is true, -// Read will attempt to read the security descriptor of the file. -func NewBackupFileReader(f *os.File, includeSecurity bool) *BackupFileReader { - r := &BackupFileReader{f, includeSecurity, 0} - return r -} - -// Read reads a backup stream from the file by calling the Win32 API BackupRead(). -func (r *BackupFileReader) Read(b []byte) (int, error) { - var bytesRead uint32 - err := backupRead(syscall.Handle(r.f.Fd()), b, &bytesRead, false, r.includeSecurity, &r.ctx) - if err != nil { - return 0, &os.PathError{Op: "BackupRead", Path: r.f.Name(), Err: err} - } - runtime.KeepAlive(r.f) - if bytesRead == 0 { - return 0, io.EOF - } - return int(bytesRead), nil -} - -// Close frees Win32 resources associated with the BackupFileReader. It does not close -// the underlying file. -func (r *BackupFileReader) Close() error { - if r.ctx != 0 { - _ = backupRead(syscall.Handle(r.f.Fd()), nil, nil, true, false, &r.ctx) - runtime.KeepAlive(r.f) - r.ctx = 0 - } - return nil -} - -// BackupFileWriter provides an io.WriteCloser interface on top of the BackupWrite Win32 API. -type BackupFileWriter struct { - f *os.File - includeSecurity bool - ctx uintptr -} - -// NewBackupFileWriter returns a new BackupFileWriter from a file handle. If includeSecurity is true, -// Write() will attempt to restore the security descriptor from the stream. -func NewBackupFileWriter(f *os.File, includeSecurity bool) *BackupFileWriter { - w := &BackupFileWriter{f, includeSecurity, 0} - return w -} - -// Write restores a portion of the file using the provided backup stream. -func (w *BackupFileWriter) Write(b []byte) (int, error) { - var bytesWritten uint32 - err := backupWrite(syscall.Handle(w.f.Fd()), b, &bytesWritten, false, w.includeSecurity, &w.ctx) - if err != nil { - return 0, &os.PathError{Op: "BackupWrite", Path: w.f.Name(), Err: err} - } - runtime.KeepAlive(w.f) - if int(bytesWritten) != len(b) { - return int(bytesWritten), errors.New("not all bytes could be written") - } - return len(b), nil -} - -// Close frees Win32 resources associated with the BackupFileWriter. It does not -// close the underlying file. -func (w *BackupFileWriter) Close() error { - if w.ctx != 0 { - _ = backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx) - runtime.KeepAlive(w.f) - w.ctx = 0 - } - return nil -} - -// OpenForBackup opens a file or directory, potentially skipping access checks if the backup -// or restore privileges have been acquired. -// -// If the file opened was a directory, it cannot be used with Readdir(). -func OpenForBackup(path string, access uint32, share uint32, createmode uint32) (*os.File, error) { - winPath, err := syscall.UTF16FromString(path) - if err != nil { - return nil, err - } - h, err := syscall.CreateFile(&winPath[0], - access, - share, - nil, - createmode, - syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OPEN_REPARSE_POINT, - 0) - if err != nil { - err = &os.PathError{Op: "open", Path: path, Err: err} - return nil, err - } - return os.NewFile(uintptr(h), path), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/doc.go b/vendor/github.com/Microsoft/go-winio/doc.go deleted file mode 100644 index 1f5bfe2d54..0000000000 --- a/vendor/github.com/Microsoft/go-winio/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// This package provides utilities for efficiently performing Win32 IO operations in Go. -// Currently, this package is provides support for genreal IO and management of -// - named pipes -// - files -// - [Hyper-V sockets] -// -// This code is similar to Go's [net] package, and uses IO completion ports to avoid -// blocking IO on system threads, allowing Go to reuse the thread to schedule other goroutines. -// -// This limits support to Windows Vista and newer operating systems. -// -// Additionally, this package provides support for: -// - creating and managing GUIDs -// - writing to [ETW] -// - opening and manageing VHDs -// - parsing [Windows Image files] -// - auto-generating Win32 API code -// -// [Hyper-V sockets]: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service -// [ETW]: https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/event-tracing-for-windows--etw- -// [Windows Image files]: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/work-with-windows-images -package winio diff --git a/vendor/github.com/Microsoft/go-winio/ea.go b/vendor/github.com/Microsoft/go-winio/ea.go deleted file mode 100644 index e104dbdfdf..0000000000 --- a/vendor/github.com/Microsoft/go-winio/ea.go +++ /dev/null @@ -1,137 +0,0 @@ -package winio - -import ( - "bytes" - "encoding/binary" - "errors" -) - -type fileFullEaInformation struct { - NextEntryOffset uint32 - Flags uint8 - NameLength uint8 - ValueLength uint16 -} - -var ( - fileFullEaInformationSize = binary.Size(&fileFullEaInformation{}) - - errInvalidEaBuffer = errors.New("invalid extended attribute buffer") - errEaNameTooLarge = errors.New("extended attribute name too large") - errEaValueTooLarge = errors.New("extended attribute value too large") -) - -// ExtendedAttribute represents a single Windows EA. -type ExtendedAttribute struct { - Name string - Value []byte - Flags uint8 -} - -func parseEa(b []byte) (ea ExtendedAttribute, nb []byte, err error) { - var info fileFullEaInformation - err = binary.Read(bytes.NewReader(b), binary.LittleEndian, &info) - if err != nil { - err = errInvalidEaBuffer - return ea, nb, err - } - - nameOffset := fileFullEaInformationSize - nameLen := int(info.NameLength) - valueOffset := nameOffset + int(info.NameLength) + 1 - valueLen := int(info.ValueLength) - nextOffset := int(info.NextEntryOffset) - if valueLen+valueOffset > len(b) || nextOffset < 0 || nextOffset > len(b) { - err = errInvalidEaBuffer - return ea, nb, err - } - - ea.Name = string(b[nameOffset : nameOffset+nameLen]) - ea.Value = b[valueOffset : valueOffset+valueLen] - ea.Flags = info.Flags - if info.NextEntryOffset != 0 { - nb = b[info.NextEntryOffset:] - } - return ea, nb, err -} - -// DecodeExtendedAttributes decodes a list of EAs from a FILE_FULL_EA_INFORMATION -// buffer retrieved from BackupRead, ZwQueryEaFile, etc. -func DecodeExtendedAttributes(b []byte) (eas []ExtendedAttribute, err error) { - for len(b) != 0 { - ea, nb, err := parseEa(b) - if err != nil { - return nil, err - } - - eas = append(eas, ea) - b = nb - } - return eas, err -} - -func writeEa(buf *bytes.Buffer, ea *ExtendedAttribute, last bool) error { - if int(uint8(len(ea.Name))) != len(ea.Name) { - return errEaNameTooLarge - } - if int(uint16(len(ea.Value))) != len(ea.Value) { - return errEaValueTooLarge - } - entrySize := uint32(fileFullEaInformationSize + len(ea.Name) + 1 + len(ea.Value)) - withPadding := (entrySize + 3) &^ 3 - nextOffset := uint32(0) - if !last { - nextOffset = withPadding - } - info := fileFullEaInformation{ - NextEntryOffset: nextOffset, - Flags: ea.Flags, - NameLength: uint8(len(ea.Name)), - ValueLength: uint16(len(ea.Value)), - } - - err := binary.Write(buf, binary.LittleEndian, &info) - if err != nil { - return err - } - - _, err = buf.Write([]byte(ea.Name)) - if err != nil { - return err - } - - err = buf.WriteByte(0) - if err != nil { - return err - } - - _, err = buf.Write(ea.Value) - if err != nil { - return err - } - - _, err = buf.Write([]byte{0, 0, 0}[0 : withPadding-entrySize]) - if err != nil { - return err - } - - return nil -} - -// EncodeExtendedAttributes encodes a list of EAs into a FILE_FULL_EA_INFORMATION -// buffer for use with BackupWrite, ZwSetEaFile, etc. -func EncodeExtendedAttributes(eas []ExtendedAttribute) ([]byte, error) { - var buf bytes.Buffer - for i := range eas { - last := false - if i == len(eas)-1 { - last = true - } - - err := writeEa(&buf, &eas[i], last) - if err != nil { - return nil, err - } - } - return buf.Bytes(), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/file.go b/vendor/github.com/Microsoft/go-winio/file.go deleted file mode 100644 index 175a99d3f4..0000000000 --- a/vendor/github.com/Microsoft/go-winio/file.go +++ /dev/null @@ -1,331 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "errors" - "io" - "runtime" - "sync" - "sync/atomic" - "syscall" - "time" - - "golang.org/x/sys/windows" -) - -//sys cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) = CancelIoEx -//sys createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) = CreateIoCompletionPort -//sys getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) = GetQueuedCompletionStatus -//sys setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) = SetFileCompletionNotificationModes -//sys wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) = ws2_32.WSAGetOverlappedResult - -type atomicBool int32 - -func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 } -func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) } -func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) } - -//revive:disable-next-line:predeclared Keep "new" to maintain consistency with "atomic" pkg -func (b *atomicBool) swap(new bool) bool { - var newInt int32 - if new { - newInt = 1 - } - return atomic.SwapInt32((*int32)(b), newInt) == 1 -} - -var ( - ErrFileClosed = errors.New("file has already been closed") - ErrTimeout = &timeoutError{} -) - -type timeoutError struct{} - -func (*timeoutError) Error() string { return "i/o timeout" } -func (*timeoutError) Timeout() bool { return true } -func (*timeoutError) Temporary() bool { return true } - -type timeoutChan chan struct{} - -var ioInitOnce sync.Once -var ioCompletionPort syscall.Handle - -// ioResult contains the result of an asynchronous IO operation. -type ioResult struct { - bytes uint32 - err error -} - -// ioOperation represents an outstanding asynchronous Win32 IO. -type ioOperation struct { - o syscall.Overlapped - ch chan ioResult -} - -func initIO() { - h, err := createIoCompletionPort(syscall.InvalidHandle, 0, 0, 0xffffffff) - if err != nil { - panic(err) - } - ioCompletionPort = h - go ioCompletionProcessor(h) -} - -// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall. -// It takes ownership of this handle and will close it if it is garbage collected. -type win32File struct { - handle syscall.Handle - wg sync.WaitGroup - wgLock sync.RWMutex - closing atomicBool - socket bool - readDeadline deadlineHandler - writeDeadline deadlineHandler -} - -type deadlineHandler struct { - setLock sync.Mutex - channel timeoutChan - channelLock sync.RWMutex - timer *time.Timer - timedout atomicBool -} - -// makeWin32File makes a new win32File from an existing file handle. -func makeWin32File(h syscall.Handle) (*win32File, error) { - f := &win32File{handle: h} - ioInitOnce.Do(initIO) - _, err := createIoCompletionPort(h, ioCompletionPort, 0, 0xffffffff) - if err != nil { - return nil, err - } - err = setFileCompletionNotificationModes(h, windows.FILE_SKIP_COMPLETION_PORT_ON_SUCCESS|windows.FILE_SKIP_SET_EVENT_ON_HANDLE) - if err != nil { - return nil, err - } - f.readDeadline.channel = make(timeoutChan) - f.writeDeadline.channel = make(timeoutChan) - return f, nil -} - -func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) { - // If we return the result of makeWin32File directly, it can result in an - // interface-wrapped nil, rather than a nil interface value. - f, err := makeWin32File(h) - if err != nil { - return nil, err - } - return f, nil -} - -// closeHandle closes the resources associated with a Win32 handle. -func (f *win32File) closeHandle() { - f.wgLock.Lock() - // Atomically set that we are closing, releasing the resources only once. - if !f.closing.swap(true) { - f.wgLock.Unlock() - // cancel all IO and wait for it to complete - _ = cancelIoEx(f.handle, nil) - f.wg.Wait() - // at this point, no new IO can start - syscall.Close(f.handle) - f.handle = 0 - } else { - f.wgLock.Unlock() - } -} - -// Close closes a win32File. -func (f *win32File) Close() error { - f.closeHandle() - return nil -} - -// IsClosed checks if the file has been closed. -func (f *win32File) IsClosed() bool { - return f.closing.isSet() -} - -// prepareIO prepares for a new IO operation. -// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning. -func (f *win32File) prepareIO() (*ioOperation, error) { - f.wgLock.RLock() - if f.closing.isSet() { - f.wgLock.RUnlock() - return nil, ErrFileClosed - } - f.wg.Add(1) - f.wgLock.RUnlock() - c := &ioOperation{} - c.ch = make(chan ioResult) - return c, nil -} - -// ioCompletionProcessor processes completed async IOs forever. -func ioCompletionProcessor(h syscall.Handle) { - for { - var bytes uint32 - var key uintptr - var op *ioOperation - err := getQueuedCompletionStatus(h, &bytes, &key, &op, syscall.INFINITE) - if op == nil { - panic(err) - } - op.ch <- ioResult{bytes, err} - } -} - -// todo: helsaawy - create an asyncIO version that takes a context - -// asyncIO processes the return value from ReadFile or WriteFile, blocking until -// the operation has actually completed. -func (f *win32File) asyncIO(c *ioOperation, d *deadlineHandler, bytes uint32, err error) (int, error) { - if err != syscall.ERROR_IO_PENDING { //nolint:errorlint // err is Errno - return int(bytes), err - } - - if f.closing.isSet() { - _ = cancelIoEx(f.handle, &c.o) - } - - var timeout timeoutChan - if d != nil { - d.channelLock.Lock() - timeout = d.channel - d.channelLock.Unlock() - } - - var r ioResult - select { - case r = <-c.ch: - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno - if f.closing.isSet() { - err = ErrFileClosed - } - } else if err != nil && f.socket { - // err is from Win32. Query the overlapped structure to get the winsock error. - var bytes, flags uint32 - err = wsaGetOverlappedResult(f.handle, &c.o, &bytes, false, &flags) - } - case <-timeout: - _ = cancelIoEx(f.handle, &c.o) - r = <-c.ch - err = r.err - if err == syscall.ERROR_OPERATION_ABORTED { //nolint:errorlint // err is Errno - err = ErrTimeout - } - } - - // runtime.KeepAlive is needed, as c is passed via native - // code to ioCompletionProcessor, c must remain alive - // until the channel read is complete. - // todo: (de)allocate *ioOperation via win32 heap functions, instead of needing to KeepAlive? - runtime.KeepAlive(c) - return int(r.bytes), err -} - -// Read reads from a file handle. -func (f *win32File) Read(b []byte) (int, error) { - c, err := f.prepareIO() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.readDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.ReadFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIO(c, &f.readDeadline, bytes, err) - runtime.KeepAlive(b) - - // Handle EOF conditions. - if err == nil && n == 0 && len(b) != 0 { - return 0, io.EOF - } else if err == syscall.ERROR_BROKEN_PIPE { //nolint:errorlint // err is Errno - return 0, io.EOF - } else { - return n, err - } -} - -// Write writes to a file handle. -func (f *win32File) Write(b []byte) (int, error) { - c, err := f.prepareIO() - if err != nil { - return 0, err - } - defer f.wg.Done() - - if f.writeDeadline.timedout.isSet() { - return 0, ErrTimeout - } - - var bytes uint32 - err = syscall.WriteFile(f.handle, b, &bytes, &c.o) - n, err := f.asyncIO(c, &f.writeDeadline, bytes, err) - runtime.KeepAlive(b) - return n, err -} - -func (f *win32File) SetReadDeadline(deadline time.Time) error { - return f.readDeadline.set(deadline) -} - -func (f *win32File) SetWriteDeadline(deadline time.Time) error { - return f.writeDeadline.set(deadline) -} - -func (f *win32File) Flush() error { - return syscall.FlushFileBuffers(f.handle) -} - -func (f *win32File) Fd() uintptr { - return uintptr(f.handle) -} - -func (d *deadlineHandler) set(deadline time.Time) error { - d.setLock.Lock() - defer d.setLock.Unlock() - - if d.timer != nil { - if !d.timer.Stop() { - <-d.channel - } - d.timer = nil - } - d.timedout.setFalse() - - select { - case <-d.channel: - d.channelLock.Lock() - d.channel = make(chan struct{}) - d.channelLock.Unlock() - default: - } - - if deadline.IsZero() { - return nil - } - - timeoutIO := func() { - d.timedout.setTrue() - close(d.channel) - } - - now := time.Now() - duration := deadline.Sub(now) - if deadline.After(now) { - // Deadline is in the future, set a timer to wait - d.timer = time.AfterFunc(duration, timeoutIO) - } else { - // Deadline is in the past. Cancel all pending IO now. - timeoutIO() - } - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/fileinfo.go b/vendor/github.com/Microsoft/go-winio/fileinfo.go deleted file mode 100644 index 702950e72a..0000000000 --- a/vendor/github.com/Microsoft/go-winio/fileinfo.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "os" - "runtime" - "unsafe" - - "golang.org/x/sys/windows" -) - -// FileBasicInfo contains file access time and file attributes information. -type FileBasicInfo struct { - CreationTime, LastAccessTime, LastWriteTime, ChangeTime windows.Filetime - FileAttributes uint32 - _ uint32 // padding -} - -// GetFileBasicInfo retrieves times and attributes for a file. -func GetFileBasicInfo(f *os.File) (*FileBasicInfo, error) { - bi := &FileBasicInfo{} - if err := windows.GetFileInformationByHandleEx( - windows.Handle(f.Fd()), - windows.FileBasicInfo, - (*byte)(unsafe.Pointer(bi)), - uint32(unsafe.Sizeof(*bi)), - ); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return bi, nil -} - -// SetFileBasicInfo sets times and attributes for a file. -func SetFileBasicInfo(f *os.File, bi *FileBasicInfo) error { - if err := windows.SetFileInformationByHandle( - windows.Handle(f.Fd()), - windows.FileBasicInfo, - (*byte)(unsafe.Pointer(bi)), - uint32(unsafe.Sizeof(*bi)), - ); err != nil { - return &os.PathError{Op: "SetFileInformationByHandle", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return nil -} - -// FileStandardInfo contains extended information for the file. -// FILE_STANDARD_INFO in WinBase.h -// https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_standard_info -type FileStandardInfo struct { - AllocationSize, EndOfFile int64 - NumberOfLinks uint32 - DeletePending, Directory bool -} - -// GetFileStandardInfo retrieves ended information for the file. -func GetFileStandardInfo(f *os.File) (*FileStandardInfo, error) { - si := &FileStandardInfo{} - if err := windows.GetFileInformationByHandleEx(windows.Handle(f.Fd()), - windows.FileStandardInfo, - (*byte)(unsafe.Pointer(si)), - uint32(unsafe.Sizeof(*si))); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return si, nil -} - -// FileIDInfo contains the volume serial number and file ID for a file. This pair should be -// unique on a system. -type FileIDInfo struct { - VolumeSerialNumber uint64 - FileID [16]byte -} - -// GetFileID retrieves the unique (volume, file ID) pair for a file. -func GetFileID(f *os.File) (*FileIDInfo, error) { - fileID := &FileIDInfo{} - if err := windows.GetFileInformationByHandleEx( - windows.Handle(f.Fd()), - windows.FileIdInfo, - (*byte)(unsafe.Pointer(fileID)), - uint32(unsafe.Sizeof(*fileID)), - ); err != nil { - return nil, &os.PathError{Op: "GetFileInformationByHandleEx", Path: f.Name(), Err: err} - } - runtime.KeepAlive(f) - return fileID, nil -} diff --git a/vendor/github.com/Microsoft/go-winio/hvsock.go b/vendor/github.com/Microsoft/go-winio/hvsock.go deleted file mode 100644 index c881916583..0000000000 --- a/vendor/github.com/Microsoft/go-winio/hvsock.go +++ /dev/null @@ -1,575 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "os" - "syscall" - "time" - "unsafe" - - "golang.org/x/sys/windows" - - "github.com/Microsoft/go-winio/internal/socket" - "github.com/Microsoft/go-winio/pkg/guid" -) - -const afHVSock = 34 // AF_HYPERV - -// Well known Service and VM IDs -// https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/make-integration-service#vmid-wildcards - -// HvsockGUIDWildcard is the wildcard VmId for accepting connections from all partitions. -func HvsockGUIDWildcard() guid.GUID { // 00000000-0000-0000-0000-000000000000 - return guid.GUID{} -} - -// HvsockGUIDBroadcast is the wildcard VmId for broadcasting sends to all partitions. -func HvsockGUIDBroadcast() guid.GUID { // ffffffff-ffff-ffff-ffff-ffffffffffff - return guid.GUID{ - Data1: 0xffffffff, - Data2: 0xffff, - Data3: 0xffff, - Data4: [8]uint8{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, - } -} - -// HvsockGUIDLoopback is the Loopback VmId for accepting connections to the same partition as the connector. -func HvsockGUIDLoopback() guid.GUID { // e0e16197-dd56-4a10-9195-5ee7a155a838 - return guid.GUID{ - Data1: 0xe0e16197, - Data2: 0xdd56, - Data3: 0x4a10, - Data4: [8]uint8{0x91, 0x95, 0x5e, 0xe7, 0xa1, 0x55, 0xa8, 0x38}, - } -} - -// HvsockGUIDSiloHost is the address of a silo's host partition: -// - The silo host of a hosted silo is the utility VM. -// - The silo host of a silo on a physical host is the physical host. -func HvsockGUIDSiloHost() guid.GUID { // 36bd0c5c-7276-4223-88ba-7d03b654c568 - return guid.GUID{ - Data1: 0x36bd0c5c, - Data2: 0x7276, - Data3: 0x4223, - Data4: [8]byte{0x88, 0xba, 0x7d, 0x03, 0xb6, 0x54, 0xc5, 0x68}, - } -} - -// HvsockGUIDChildren is the wildcard VmId for accepting connections from the connector's child partitions. -func HvsockGUIDChildren() guid.GUID { // 90db8b89-0d35-4f79-8ce9-49ea0ac8b7cd - return guid.GUID{ - Data1: 0x90db8b89, - Data2: 0xd35, - Data3: 0x4f79, - Data4: [8]uint8{0x8c, 0xe9, 0x49, 0xea, 0xa, 0xc8, 0xb7, 0xcd}, - } -} - -// HvsockGUIDParent is the wildcard VmId for accepting connections from the connector's parent partition. -// Listening on this VmId accepts connection from: -// - Inside silos: silo host partition. -// - Inside hosted silo: host of the VM. -// - Inside VM: VM host. -// - Physical host: Not supported. -func HvsockGUIDParent() guid.GUID { // a42e7cda-d03f-480c-9cc2-a4de20abb878 - return guid.GUID{ - Data1: 0xa42e7cda, - Data2: 0xd03f, - Data3: 0x480c, - Data4: [8]uint8{0x9c, 0xc2, 0xa4, 0xde, 0x20, 0xab, 0xb8, 0x78}, - } -} - -// hvsockVsockServiceTemplate is the Service GUID used for the VSOCK protocol. -func hvsockVsockServiceTemplate() guid.GUID { // 00000000-facb-11e6-bd58-64006a7986d3 - return guid.GUID{ - Data2: 0xfacb, - Data3: 0x11e6, - Data4: [8]uint8{0xbd, 0x58, 0x64, 0x00, 0x6a, 0x79, 0x86, 0xd3}, - } -} - -// An HvsockAddr is an address for a AF_HYPERV socket. -type HvsockAddr struct { - VMID guid.GUID - ServiceID guid.GUID -} - -type rawHvsockAddr struct { - Family uint16 - _ uint16 - VMID guid.GUID - ServiceID guid.GUID -} - -var _ socket.RawSockaddr = &rawHvsockAddr{} - -// Network returns the address's network name, "hvsock". -func (*HvsockAddr) Network() string { - return "hvsock" -} - -func (addr *HvsockAddr) String() string { - return fmt.Sprintf("%s:%s", &addr.VMID, &addr.ServiceID) -} - -// VsockServiceID returns an hvsock service ID corresponding to the specified AF_VSOCK port. -func VsockServiceID(port uint32) guid.GUID { - g := hvsockVsockServiceTemplate() // make a copy - g.Data1 = port - return g -} - -func (addr *HvsockAddr) raw() rawHvsockAddr { - return rawHvsockAddr{ - Family: afHVSock, - VMID: addr.VMID, - ServiceID: addr.ServiceID, - } -} - -func (addr *HvsockAddr) fromRaw(raw *rawHvsockAddr) { - addr.VMID = raw.VMID - addr.ServiceID = raw.ServiceID -} - -// Sockaddr returns a pointer to and the size of this struct. -// -// Implements the [socket.RawSockaddr] interface, and allows use in -// [socket.Bind] and [socket.ConnectEx]. -func (r *rawHvsockAddr) Sockaddr() (unsafe.Pointer, int32, error) { - return unsafe.Pointer(r), int32(unsafe.Sizeof(rawHvsockAddr{})), nil -} - -// Sockaddr interface allows use with `sockets.Bind()` and `.ConnectEx()`. -func (r *rawHvsockAddr) FromBytes(b []byte) error { - n := int(unsafe.Sizeof(rawHvsockAddr{})) - - if len(b) < n { - return fmt.Errorf("got %d, want %d: %w", len(b), n, socket.ErrBufferSize) - } - - copy(unsafe.Slice((*byte)(unsafe.Pointer(r)), n), b[:n]) - if r.Family != afHVSock { - return fmt.Errorf("got %d, want %d: %w", r.Family, afHVSock, socket.ErrAddrFamily) - } - - return nil -} - -// HvsockListener is a socket listener for the AF_HYPERV address family. -type HvsockListener struct { - sock *win32File - addr HvsockAddr -} - -var _ net.Listener = &HvsockListener{} - -// HvsockConn is a connected socket of the AF_HYPERV address family. -type HvsockConn struct { - sock *win32File - local, remote HvsockAddr -} - -var _ net.Conn = &HvsockConn{} - -func newHVSocket() (*win32File, error) { - fd, err := syscall.Socket(afHVSock, syscall.SOCK_STREAM, 1) - if err != nil { - return nil, os.NewSyscallError("socket", err) - } - f, err := makeWin32File(fd) - if err != nil { - syscall.Close(fd) - return nil, err - } - f.socket = true - return f, nil -} - -// ListenHvsock listens for connections on the specified hvsock address. -func ListenHvsock(addr *HvsockAddr) (_ *HvsockListener, err error) { - l := &HvsockListener{addr: *addr} - sock, err := newHVSocket() - if err != nil { - return nil, l.opErr("listen", err) - } - sa := addr.raw() - err = socket.Bind(windows.Handle(sock.handle), &sa) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("socket", err)) - } - err = syscall.Listen(sock.handle, 16) - if err != nil { - return nil, l.opErr("listen", os.NewSyscallError("listen", err)) - } - return &HvsockListener{sock: sock, addr: *addr}, nil -} - -func (l *HvsockListener) opErr(op string, err error) error { - return &net.OpError{Op: op, Net: "hvsock", Addr: &l.addr, Err: err} -} - -// Addr returns the listener's network address. -func (l *HvsockListener) Addr() net.Addr { - return &l.addr -} - -// Accept waits for the next connection and returns it. -func (l *HvsockListener) Accept() (_ net.Conn, err error) { - sock, err := newHVSocket() - if err != nil { - return nil, l.opErr("accept", err) - } - defer func() { - if sock != nil { - sock.Close() - } - }() - c, err := l.sock.prepareIO() - if err != nil { - return nil, l.opErr("accept", err) - } - defer l.sock.wg.Done() - - // AcceptEx, per documentation, requires an extra 16 bytes per address. - // - // https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-acceptex - const addrlen = uint32(16 + unsafe.Sizeof(rawHvsockAddr{})) - var addrbuf [addrlen * 2]byte - - var bytes uint32 - err = syscall.AcceptEx(l.sock.handle, sock.handle, &addrbuf[0], 0 /* rxdatalen */, addrlen, addrlen, &bytes, &c.o) - if _, err = l.sock.asyncIO(c, nil, bytes, err); err != nil { - return nil, l.opErr("accept", os.NewSyscallError("acceptex", err)) - } - - conn := &HvsockConn{ - sock: sock, - } - // The local address returned in the AcceptEx buffer is the same as the Listener socket's - // address. However, the service GUID reported by GetSockName is different from the Listeners - // socket, and is sometimes the same as the local address of the socket that dialed the - // address, with the service GUID.Data1 incremented, but othertimes is different. - // todo: does the local address matter? is the listener's address or the actual address appropriate? - conn.local.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[0]))) - conn.remote.fromRaw((*rawHvsockAddr)(unsafe.Pointer(&addrbuf[addrlen]))) - - // initialize the accepted socket and update its properties with those of the listening socket - if err = windows.Setsockopt(windows.Handle(sock.handle), - windows.SOL_SOCKET, windows.SO_UPDATE_ACCEPT_CONTEXT, - (*byte)(unsafe.Pointer(&l.sock.handle)), int32(unsafe.Sizeof(l.sock.handle))); err != nil { - return nil, conn.opErr("accept", os.NewSyscallError("setsockopt", err)) - } - - sock = nil - return conn, nil -} - -// Close closes the listener, causing any pending Accept calls to fail. -func (l *HvsockListener) Close() error { - return l.sock.Close() -} - -// HvsockDialer configures and dials a Hyper-V Socket (ie, [HvsockConn]). -type HvsockDialer struct { - // Deadline is the time the Dial operation must connect before erroring. - Deadline time.Time - - // Retries is the number of additional connects to try if the connection times out, is refused, - // or the host is unreachable - Retries uint - - // RetryWait is the time to wait after a connection error to retry - RetryWait time.Duration - - rt *time.Timer // redial wait timer -} - -// Dial the Hyper-V socket at addr. -// -// See [HvsockDialer.Dial] for more information. -func Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) { - return (&HvsockDialer{}).Dial(ctx, addr) -} - -// Dial attempts to connect to the Hyper-V socket at addr, and returns a connection if successful. -// Will attempt (HvsockDialer).Retries if dialing fails, waiting (HvsockDialer).RetryWait between -// retries. -// -// Dialing can be cancelled either by providing (HvsockDialer).Deadline, or cancelling ctx. -func (d *HvsockDialer) Dial(ctx context.Context, addr *HvsockAddr) (conn *HvsockConn, err error) { - op := "dial" - // create the conn early to use opErr() - conn = &HvsockConn{ - remote: *addr, - } - - if !d.Deadline.IsZero() { - var cancel context.CancelFunc - ctx, cancel = context.WithDeadline(ctx, d.Deadline) - defer cancel() - } - - // preemptive timeout/cancellation check - if err = ctx.Err(); err != nil { - return nil, conn.opErr(op, err) - } - - sock, err := newHVSocket() - if err != nil { - return nil, conn.opErr(op, err) - } - defer func() { - if sock != nil { - sock.Close() - } - }() - - sa := addr.raw() - err = socket.Bind(windows.Handle(sock.handle), &sa) - if err != nil { - return nil, conn.opErr(op, os.NewSyscallError("bind", err)) - } - - c, err := sock.prepareIO() - if err != nil { - return nil, conn.opErr(op, err) - } - defer sock.wg.Done() - var bytes uint32 - for i := uint(0); i <= d.Retries; i++ { - err = socket.ConnectEx( - windows.Handle(sock.handle), - &sa, - nil, // sendBuf - 0, // sendDataLen - &bytes, - (*windows.Overlapped)(unsafe.Pointer(&c.o))) - _, err = sock.asyncIO(c, nil, bytes, err) - if i < d.Retries && canRedial(err) { - if err = d.redialWait(ctx); err == nil { - continue - } - } - break - } - if err != nil { - return nil, conn.opErr(op, os.NewSyscallError("connectex", err)) - } - - // update the connection properties, so shutdown can be used - if err = windows.Setsockopt( - windows.Handle(sock.handle), - windows.SOL_SOCKET, - windows.SO_UPDATE_CONNECT_CONTEXT, - nil, // optvalue - 0, // optlen - ); err != nil { - return nil, conn.opErr(op, os.NewSyscallError("setsockopt", err)) - } - - // get the local name - var sal rawHvsockAddr - err = socket.GetSockName(windows.Handle(sock.handle), &sal) - if err != nil { - return nil, conn.opErr(op, os.NewSyscallError("getsockname", err)) - } - conn.local.fromRaw(&sal) - - // one last check for timeout, since asyncIO doesn't check the context - if err = ctx.Err(); err != nil { - return nil, conn.opErr(op, err) - } - - conn.sock = sock - sock = nil - - return conn, nil -} - -// redialWait waits before attempting to redial, resetting the timer as appropriate. -func (d *HvsockDialer) redialWait(ctx context.Context) (err error) { - if d.RetryWait == 0 { - return nil - } - - if d.rt == nil { - d.rt = time.NewTimer(d.RetryWait) - } else { - // should already be stopped and drained - d.rt.Reset(d.RetryWait) - } - - select { - case <-ctx.Done(): - case <-d.rt.C: - return nil - } - - // stop and drain the timer - if !d.rt.Stop() { - <-d.rt.C - } - return ctx.Err() -} - -// assumes error is a plain, unwrapped syscall.Errno provided by direct syscall. -func canRedial(err error) bool { - //nolint:errorlint // guaranteed to be an Errno - switch err { - case windows.WSAECONNREFUSED, windows.WSAENETUNREACH, windows.WSAETIMEDOUT, - windows.ERROR_CONNECTION_REFUSED, windows.ERROR_CONNECTION_UNAVAIL: - return true - default: - return false - } -} - -func (conn *HvsockConn) opErr(op string, err error) error { - // translate from "file closed" to "socket closed" - if errors.Is(err, ErrFileClosed) { - err = socket.ErrSocketClosed - } - return &net.OpError{Op: op, Net: "hvsock", Source: &conn.local, Addr: &conn.remote, Err: err} -} - -func (conn *HvsockConn) Read(b []byte) (int, error) { - c, err := conn.sock.prepareIO() - if err != nil { - return 0, conn.opErr("read", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var flags, bytes uint32 - err = syscall.WSARecv(conn.sock.handle, &buf, 1, &bytes, &flags, &c.o, nil) - n, err := conn.sock.asyncIO(c, &conn.sock.readDeadline, bytes, err) - if err != nil { - var eno windows.Errno - if errors.As(err, &eno) { - err = os.NewSyscallError("wsarecv", eno) - } - return 0, conn.opErr("read", err) - } else if n == 0 { - err = io.EOF - } - return n, err -} - -func (conn *HvsockConn) Write(b []byte) (int, error) { - t := 0 - for len(b) != 0 { - n, err := conn.write(b) - if err != nil { - return t + n, err - } - t += n - b = b[n:] - } - return t, nil -} - -func (conn *HvsockConn) write(b []byte) (int, error) { - c, err := conn.sock.prepareIO() - if err != nil { - return 0, conn.opErr("write", err) - } - defer conn.sock.wg.Done() - buf := syscall.WSABuf{Buf: &b[0], Len: uint32(len(b))} - var bytes uint32 - err = syscall.WSASend(conn.sock.handle, &buf, 1, &bytes, 0, &c.o, nil) - n, err := conn.sock.asyncIO(c, &conn.sock.writeDeadline, bytes, err) - if err != nil { - var eno windows.Errno - if errors.As(err, &eno) { - err = os.NewSyscallError("wsasend", eno) - } - return 0, conn.opErr("write", err) - } - return n, err -} - -// Close closes the socket connection, failing any pending read or write calls. -func (conn *HvsockConn) Close() error { - return conn.sock.Close() -} - -func (conn *HvsockConn) IsClosed() bool { - return conn.sock.IsClosed() -} - -// shutdown disables sending or receiving on a socket. -func (conn *HvsockConn) shutdown(how int) error { - if conn.IsClosed() { - return socket.ErrSocketClosed - } - - err := syscall.Shutdown(conn.sock.handle, how) - if err != nil { - // If the connection was closed, shutdowns fail with "not connected" - if errors.Is(err, windows.WSAENOTCONN) || - errors.Is(err, windows.WSAESHUTDOWN) { - err = socket.ErrSocketClosed - } - return os.NewSyscallError("shutdown", err) - } - return nil -} - -// CloseRead shuts down the read end of the socket, preventing future read operations. -func (conn *HvsockConn) CloseRead() error { - err := conn.shutdown(syscall.SHUT_RD) - if err != nil { - return conn.opErr("closeread", err) - } - return nil -} - -// CloseWrite shuts down the write end of the socket, preventing future write operations and -// notifying the other endpoint that no more data will be written. -func (conn *HvsockConn) CloseWrite() error { - err := conn.shutdown(syscall.SHUT_WR) - if err != nil { - return conn.opErr("closewrite", err) - } - return nil -} - -// LocalAddr returns the local address of the connection. -func (conn *HvsockConn) LocalAddr() net.Addr { - return &conn.local -} - -// RemoteAddr returns the remote address of the connection. -func (conn *HvsockConn) RemoteAddr() net.Addr { - return &conn.remote -} - -// SetDeadline implements the net.Conn SetDeadline method. -func (conn *HvsockConn) SetDeadline(t time.Time) error { - // todo: implement `SetDeadline` for `win32File` - if err := conn.SetReadDeadline(t); err != nil { - return fmt.Errorf("set read deadline: %w", err) - } - if err := conn.SetWriteDeadline(t); err != nil { - return fmt.Errorf("set write deadline: %w", err) - } - return nil -} - -// SetReadDeadline implements the net.Conn SetReadDeadline method. -func (conn *HvsockConn) SetReadDeadline(t time.Time) error { - return conn.sock.SetReadDeadline(t) -} - -// SetWriteDeadline implements the net.Conn SetWriteDeadline method. -func (conn *HvsockConn) SetWriteDeadline(t time.Time) error { - return conn.sock.SetWriteDeadline(t) -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/doc.go b/vendor/github.com/Microsoft/go-winio/internal/fs/doc.go deleted file mode 100644 index 1f65388178..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// This package contains Win32 filesystem functionality. -package fs diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go b/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go deleted file mode 100644 index 509b3ec641..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/fs.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build windows - -package fs - -import ( - "golang.org/x/sys/windows" - - "github.com/Microsoft/go-winio/internal/stringbuffer" -) - -//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go fs.go - -// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew -//sys CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) [failretval==windows.InvalidHandle] = CreateFileW - -const NullHandle windows.Handle = 0 - -// AccessMask defines standard, specific, and generic rights. -// -// Bitmask: -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---------------+---------------+-------------------------------+ -// |G|G|G|G|Resvd|A| StandardRights| SpecificRights | -// |R|W|E|A| |S| | | -// +-+-------------+---------------+-------------------------------+ -// -// GR Generic Read -// GW Generic Write -// GE Generic Exectue -// GA Generic All -// Resvd Reserved -// AS Access Security System -// -// https://learn.microsoft.com/en-us/windows/win32/secauthz/access-mask -// -// https://learn.microsoft.com/en-us/windows/win32/secauthz/generic-access-rights -// -// https://learn.microsoft.com/en-us/windows/win32/fileio/file-access-rights-constants -type AccessMask = windows.ACCESS_MASK - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // Not actually any. - // - // For CreateFile: "query certain metadata such as file, directory, or device attributes without accessing that file or device" - // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew#parameters - FILE_ANY_ACCESS AccessMask = 0 - - // Specific Object Access - // from ntioapi.h - - FILE_READ_DATA AccessMask = (0x0001) // file & pipe - FILE_LIST_DIRECTORY AccessMask = (0x0001) // directory - - FILE_WRITE_DATA AccessMask = (0x0002) // file & pipe - FILE_ADD_FILE AccessMask = (0x0002) // directory - - FILE_APPEND_DATA AccessMask = (0x0004) // file - FILE_ADD_SUBDIRECTORY AccessMask = (0x0004) // directory - FILE_CREATE_PIPE_INSTANCE AccessMask = (0x0004) // named pipe - - FILE_READ_EA AccessMask = (0x0008) // file & directory - FILE_READ_PROPERTIES AccessMask = FILE_READ_EA - - FILE_WRITE_EA AccessMask = (0x0010) // file & directory - FILE_WRITE_PROPERTIES AccessMask = FILE_WRITE_EA - - FILE_EXECUTE AccessMask = (0x0020) // file - FILE_TRAVERSE AccessMask = (0x0020) // directory - - FILE_DELETE_CHILD AccessMask = (0x0040) // directory - - FILE_READ_ATTRIBUTES AccessMask = (0x0080) // all - - FILE_WRITE_ATTRIBUTES AccessMask = (0x0100) // all - - FILE_ALL_ACCESS AccessMask = (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) - FILE_GENERIC_READ AccessMask = (STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE) - FILE_GENERIC_WRITE AccessMask = (STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE) - FILE_GENERIC_EXECUTE AccessMask = (STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE) - - SPECIFIC_RIGHTS_ALL AccessMask = 0x0000FFFF - - // Standard Access - // from ntseapi.h - - DELETE AccessMask = 0x0001_0000 - READ_CONTROL AccessMask = 0x0002_0000 - WRITE_DAC AccessMask = 0x0004_0000 - WRITE_OWNER AccessMask = 0x0008_0000 - SYNCHRONIZE AccessMask = 0x0010_0000 - - STANDARD_RIGHTS_REQUIRED AccessMask = 0x000F_0000 - - STANDARD_RIGHTS_READ AccessMask = READ_CONTROL - STANDARD_RIGHTS_WRITE AccessMask = READ_CONTROL - STANDARD_RIGHTS_EXECUTE AccessMask = READ_CONTROL - - STANDARD_RIGHTS_ALL AccessMask = 0x001F_0000 -) - -type FileShareMode uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - FILE_SHARE_NONE FileShareMode = 0x00 - FILE_SHARE_READ FileShareMode = 0x01 - FILE_SHARE_WRITE FileShareMode = 0x02 - FILE_SHARE_DELETE FileShareMode = 0x04 - FILE_SHARE_VALID_FLAGS FileShareMode = 0x07 -) - -type FileCreationDisposition uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - // from winbase.h - - CREATE_NEW FileCreationDisposition = 0x01 - CREATE_ALWAYS FileCreationDisposition = 0x02 - OPEN_EXISTING FileCreationDisposition = 0x03 - OPEN_ALWAYS FileCreationDisposition = 0x04 - TRUNCATE_EXISTING FileCreationDisposition = 0x05 -) - -// CreateFile and co. take flags or attributes together as one parameter. -// Define alias until we can use generics to allow both - -// https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants -type FileFlagOrAttribute uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( // from winnt.h - FILE_FLAG_WRITE_THROUGH FileFlagOrAttribute = 0x8000_0000 - FILE_FLAG_OVERLAPPED FileFlagOrAttribute = 0x4000_0000 - FILE_FLAG_NO_BUFFERING FileFlagOrAttribute = 0x2000_0000 - FILE_FLAG_RANDOM_ACCESS FileFlagOrAttribute = 0x1000_0000 - FILE_FLAG_SEQUENTIAL_SCAN FileFlagOrAttribute = 0x0800_0000 - FILE_FLAG_DELETE_ON_CLOSE FileFlagOrAttribute = 0x0400_0000 - FILE_FLAG_BACKUP_SEMANTICS FileFlagOrAttribute = 0x0200_0000 - FILE_FLAG_POSIX_SEMANTICS FileFlagOrAttribute = 0x0100_0000 - FILE_FLAG_OPEN_REPARSE_POINT FileFlagOrAttribute = 0x0020_0000 - FILE_FLAG_OPEN_NO_RECALL FileFlagOrAttribute = 0x0010_0000 - FILE_FLAG_FIRST_PIPE_INSTANCE FileFlagOrAttribute = 0x0008_0000 -) - -type FileSQSFlag = FileFlagOrAttribute - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( // from winbase.h - SECURITY_ANONYMOUS FileSQSFlag = FileSQSFlag(SecurityAnonymous << 16) - SECURITY_IDENTIFICATION FileSQSFlag = FileSQSFlag(SecurityIdentification << 16) - SECURITY_IMPERSONATION FileSQSFlag = FileSQSFlag(SecurityImpersonation << 16) - SECURITY_DELEGATION FileSQSFlag = FileSQSFlag(SecurityDelegation << 16) - - SECURITY_SQOS_PRESENT FileSQSFlag = 0x00100000 - SECURITY_VALID_SQOS_FLAGS FileSQSFlag = 0x001F0000 -) - -// GetFinalPathNameByHandle flags -// -// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew#parameters -type GetFinalPathFlag uint32 - -//nolint:revive // SNAKE_CASE is not idiomatic in Go, but aligned with Win32 API. -const ( - GetFinalPathDefaultFlag GetFinalPathFlag = 0x0 - - FILE_NAME_NORMALIZED GetFinalPathFlag = 0x0 - FILE_NAME_OPENED GetFinalPathFlag = 0x8 - - VOLUME_NAME_DOS GetFinalPathFlag = 0x0 - VOLUME_NAME_GUID GetFinalPathFlag = 0x1 - VOLUME_NAME_NT GetFinalPathFlag = 0x2 - VOLUME_NAME_NONE GetFinalPathFlag = 0x4 -) - -// getFinalPathNameByHandle facilitates calling the Windows API GetFinalPathNameByHandle -// with the given handle and flags. It transparently takes care of creating a buffer of the -// correct size for the call. -// -// https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfinalpathnamebyhandlew -func GetFinalPathNameByHandle(h windows.Handle, flags GetFinalPathFlag) (string, error) { - b := stringbuffer.NewWString() - //TODO: can loop infinitely if Win32 keeps returning the same (or a larger) n? - for { - n, err := windows.GetFinalPathNameByHandle(h, b.Pointer(), b.Cap(), uint32(flags)) - if err != nil { - return "", err - } - // If the buffer wasn't large enough, n will be the total size needed (including null terminator). - // Resize and try again. - if n > b.Cap() { - b.ResizeTo(n) - continue - } - // If the buffer is large enough, n will be the size not including the null terminator. - // Convert to a Go string and return. - return b.String(), nil - } -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/security.go b/vendor/github.com/Microsoft/go-winio/internal/fs/security.go deleted file mode 100644 index 81760ac67e..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/security.go +++ /dev/null @@ -1,12 +0,0 @@ -package fs - -// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level -type SecurityImpersonationLevel int32 // C default enums underlying type is `int`, which is Go `int32` - -// Impersonation levels -const ( - SecurityAnonymous SecurityImpersonationLevel = 0 - SecurityIdentification SecurityImpersonationLevel = 1 - SecurityImpersonation SecurityImpersonationLevel = 2 - SecurityDelegation SecurityImpersonationLevel = 3 -) diff --git a/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go deleted file mode 100644 index e2f7bb24e5..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/fs/zsyscall_windows.go +++ /dev/null @@ -1,64 +0,0 @@ -//go:build windows - -// Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. - -package fs - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - - procCreateFileW = modkernel32.NewProc("CreateFileW") -) - -func CreateFile(name string, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _CreateFile(_p0, access, mode, sa, createmode, attrs, templatefile) -} - -func _CreateFile(name *uint16, access AccessMask, mode FileShareMode, sa *syscall.SecurityAttributes, createmode FileCreationDisposition, attrs FileFlagOrAttribute, templatefile windows.Handle) (handle windows.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) - handle = windows.Handle(r0) - if handle == windows.InvalidHandle { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go b/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go deleted file mode 100644 index 7e82f9afa9..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/socket/rawaddr.go +++ /dev/null @@ -1,20 +0,0 @@ -package socket - -import ( - "unsafe" -) - -// RawSockaddr allows structs to be used with [Bind] and [ConnectEx]. The -// struct must meet the Win32 sockaddr requirements specified here: -// https://docs.microsoft.com/en-us/windows/win32/winsock/sockaddr-2 -// -// Specifically, the struct size must be least larger than an int16 (unsigned short) -// for the address family. -type RawSockaddr interface { - // Sockaddr returns a pointer to the RawSockaddr and its struct size, allowing - // for the RawSockaddr's data to be overwritten by syscalls (if necessary). - // - // It is the callers responsibility to validate that the values are valid; invalid - // pointers or size can cause a panic. - Sockaddr() (unsafe.Pointer, int32, error) -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go b/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go deleted file mode 100644 index aeb7b7250f..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/socket/socket.go +++ /dev/null @@ -1,179 +0,0 @@ -//go:build windows - -package socket - -import ( - "errors" - "fmt" - "net" - "sync" - "syscall" - "unsafe" - - "github.com/Microsoft/go-winio/pkg/guid" - "golang.org/x/sys/windows" -) - -//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go socket.go - -//sys getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getsockname -//sys getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) [failretval==socketError] = ws2_32.getpeername -//sys bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) [failretval==socketError] = ws2_32.bind - -const socketError = uintptr(^uint32(0)) - -var ( - // todo(helsaawy): create custom error types to store the desired vs actual size and addr family? - - ErrBufferSize = errors.New("buffer size") - ErrAddrFamily = errors.New("address family") - ErrInvalidPointer = errors.New("invalid pointer") - ErrSocketClosed = fmt.Errorf("socket closed: %w", net.ErrClosed) -) - -// todo(helsaawy): replace these with generics, ie: GetSockName[S RawSockaddr](s windows.Handle) (S, error) - -// GetSockName writes the local address of socket s to the [RawSockaddr] rsa. -// If rsa is not large enough, the [windows.WSAEFAULT] is returned. -func GetSockName(s windows.Handle, rsa RawSockaddr) error { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - // although getsockname returns WSAEFAULT if the buffer is too small, it does not set - // &l to the correct size, so--apart from doubling the buffer repeatedly--there is no remedy - return getsockname(s, ptr, &l) -} - -// GetPeerName returns the remote address the socket is connected to. -// -// See [GetSockName] for more information. -func GetPeerName(s windows.Handle, rsa RawSockaddr) error { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - return getpeername(s, ptr, &l) -} - -func Bind(s windows.Handle, rsa RawSockaddr) (err error) { - ptr, l, err := rsa.Sockaddr() - if err != nil { - return fmt.Errorf("could not retrieve socket pointer and size: %w", err) - } - - return bind(s, ptr, l) -} - -// "golang.org/x/sys/windows".ConnectEx and .Bind only accept internal implementations of the -// their sockaddr interface, so they cannot be used with HvsockAddr -// Replicate functionality here from -// https://cs.opensource.google/go/x/sys/+/master:windows/syscall_windows.go - -// The function pointers to `AcceptEx`, `ConnectEx` and `GetAcceptExSockaddrs` must be loaded at -// runtime via a WSAIoctl call: -// https://docs.microsoft.com/en-us/windows/win32/api/Mswsock/nc-mswsock-lpfn_connectex#remarks - -type runtimeFunc struct { - id guid.GUID - once sync.Once - addr uintptr - err error -} - -func (f *runtimeFunc) Load() error { - f.once.Do(func() { - var s windows.Handle - s, f.err = windows.Socket(windows.AF_INET, windows.SOCK_STREAM, windows.IPPROTO_TCP) - if f.err != nil { - return - } - defer windows.CloseHandle(s) //nolint:errcheck - - var n uint32 - f.err = windows.WSAIoctl(s, - windows.SIO_GET_EXTENSION_FUNCTION_POINTER, - (*byte)(unsafe.Pointer(&f.id)), - uint32(unsafe.Sizeof(f.id)), - (*byte)(unsafe.Pointer(&f.addr)), - uint32(unsafe.Sizeof(f.addr)), - &n, - nil, // overlapped - 0, // completionRoutine - ) - }) - return f.err -} - -var ( - // todo: add `AcceptEx` and `GetAcceptExSockaddrs` - WSAID_CONNECTEX = guid.GUID{ //revive:disable-line:var-naming ALL_CAPS - Data1: 0x25a207b9, - Data2: 0xddf3, - Data3: 0x4660, - Data4: [8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e}, - } - - connectExFunc = runtimeFunc{id: WSAID_CONNECTEX} -) - -func ConnectEx( - fd windows.Handle, - rsa RawSockaddr, - sendBuf *byte, - sendDataLen uint32, - bytesSent *uint32, - overlapped *windows.Overlapped, -) error { - if err := connectExFunc.Load(); err != nil { - return fmt.Errorf("failed to load ConnectEx function pointer: %w", err) - } - ptr, n, err := rsa.Sockaddr() - if err != nil { - return err - } - return connectEx(fd, ptr, n, sendBuf, sendDataLen, bytesSent, overlapped) -} - -// BOOL LpfnConnectex( -// [in] SOCKET s, -// [in] const sockaddr *name, -// [in] int namelen, -// [in, optional] PVOID lpSendBuffer, -// [in] DWORD dwSendDataLength, -// [out] LPDWORD lpdwBytesSent, -// [in] LPOVERLAPPED lpOverlapped -// ) - -func connectEx( - s windows.Handle, - name unsafe.Pointer, - namelen int32, - sendBuf *byte, - sendDataLen uint32, - bytesSent *uint32, - overlapped *windows.Overlapped, -) (err error) { - // todo: after upgrading to 1.18, switch from syscall.Syscall9 to syscall.SyscallN - r1, _, e1 := syscall.Syscall9(connectExFunc.addr, - 7, - uintptr(s), - uintptr(name), - uintptr(namelen), - uintptr(unsafe.Pointer(sendBuf)), - uintptr(sendDataLen), - uintptr(unsafe.Pointer(bytesSent)), - uintptr(unsafe.Pointer(overlapped)), - 0, - 0) - if r1 == 0 { - if e1 != 0 { - err = error(e1) - } else { - err = syscall.EINVAL - } - } - return err -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go deleted file mode 100644 index 6d2e1a9e44..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/socket/zsyscall_windows.go +++ /dev/null @@ -1,72 +0,0 @@ -//go:build windows - -// Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. - -package socket - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - - procbind = modws2_32.NewProc("bind") - procgetpeername = modws2_32.NewProc("getpeername") - procgetsockname = modws2_32.NewProc("getsockname") -) - -func bind(s windows.Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) - if r1 == socketError { - err = errnoErr(e1) - } - return -} - -func getpeername(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) - if r1 == socketError { - err = errnoErr(e1) - } - return -} - -func getsockname(s windows.Handle, name unsafe.Pointer, namelen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(name), uintptr(unsafe.Pointer(namelen))) - if r1 == socketError { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go b/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go deleted file mode 100644 index 7ad5057024..0000000000 --- a/vendor/github.com/Microsoft/go-winio/internal/stringbuffer/wstring.go +++ /dev/null @@ -1,132 +0,0 @@ -package stringbuffer - -import ( - "sync" - "unicode/utf16" -) - -// TODO: worth exporting and using in mkwinsyscall? - -// Uint16BufferSize is the buffer size in the pool, chosen somewhat arbitrarily to accommodate -// large path strings: -// MAX_PATH (260) + size of volume GUID prefix (49) + null terminator = 310. -const MinWStringCap = 310 - -// use *[]uint16 since []uint16 creates an extra allocation where the slice header -// is copied to heap and then referenced via pointer in the interface header that sync.Pool -// stores. -var pathPool = sync.Pool{ // if go1.18+ adds Pool[T], use that to store []uint16 directly - New: func() interface{} { - b := make([]uint16, MinWStringCap) - return &b - }, -} - -func newBuffer() []uint16 { return *(pathPool.Get().(*[]uint16)) } - -// freeBuffer copies the slice header data, and puts a pointer to that in the pool. -// This avoids taking a pointer to the slice header in WString, which can be set to nil. -func freeBuffer(b []uint16) { pathPool.Put(&b) } - -// WString is a wide string buffer ([]uint16) meant for storing UTF-16 encoded strings -// for interacting with Win32 APIs. -// Sizes are specified as uint32 and not int. -// -// It is not thread safe. -type WString struct { - // type-def allows casting to []uint16 directly, use struct to prevent that and allow adding fields in the future. - - // raw buffer - b []uint16 -} - -// NewWString returns a [WString] allocated from a shared pool with an -// initial capacity of at least [MinWStringCap]. -// Since the buffer may have been previously used, its contents are not guaranteed to be empty. -// -// The buffer should be freed via [WString.Free] -func NewWString() *WString { - return &WString{ - b: newBuffer(), - } -} - -func (b *WString) Free() { - if b.empty() { - return - } - freeBuffer(b.b) - b.b = nil -} - -// ResizeTo grows the buffer to at least c and returns the new capacity, freeing the -// previous buffer back into pool. -func (b *WString) ResizeTo(c uint32) uint32 { - // allready sufficient (or n is 0) - if c <= b.Cap() { - return b.Cap() - } - - if c <= MinWStringCap { - c = MinWStringCap - } - // allocate at-least double buffer size, as is done in [bytes.Buffer] and other places - if c <= 2*b.Cap() { - c = 2 * b.Cap() - } - - b2 := make([]uint16, c) - if !b.empty() { - copy(b2, b.b) - freeBuffer(b.b) - } - b.b = b2 - return c -} - -// Buffer returns the underlying []uint16 buffer. -func (b *WString) Buffer() []uint16 { - if b.empty() { - return nil - } - return b.b -} - -// Pointer returns a pointer to the first uint16 in the buffer. -// If the [WString.Free] has already been called, the pointer will be nil. -func (b *WString) Pointer() *uint16 { - if b.empty() { - return nil - } - return &b.b[0] -} - -// String returns the returns the UTF-8 encoding of the UTF-16 string in the buffer. -// -// It assumes that the data is null-terminated. -func (b *WString) String() string { - // Using [windows.UTF16ToString] would require importing "golang.org/x/sys/windows" - // and would make this code Windows-only, which makes no sense. - // So copy UTF16ToString code into here. - // If other windows-specific code is added, switch to [windows.UTF16ToString] - - s := b.b - for i, v := range s { - if v == 0 { - s = s[:i] - break - } - } - return string(utf16.Decode(s)) -} - -// Cap returns the underlying buffer capacity. -func (b *WString) Cap() uint32 { - if b.empty() { - return 0 - } - return b.cap() -} - -func (b *WString) cap() uint32 { return uint32(cap(b.b)) } -func (b *WString) empty() bool { return b == nil || b.cap() == 0 } diff --git a/vendor/github.com/Microsoft/go-winio/pipe.go b/vendor/github.com/Microsoft/go-winio/pipe.go deleted file mode 100644 index 25cc811031..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pipe.go +++ /dev/null @@ -1,525 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "context" - "errors" - "fmt" - "io" - "net" - "os" - "runtime" - "syscall" - "time" - "unsafe" - - "golang.org/x/sys/windows" - - "github.com/Microsoft/go-winio/internal/fs" -) - -//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe -//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW -//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo -//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW -//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc -//sys ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) = ntdll.NtCreateNamedPipeFile -//sys rtlNtStatusToDosError(status ntStatus) (winerr error) = ntdll.RtlNtStatusToDosErrorNoTeb -//sys rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) = ntdll.RtlDosPathNameToNtPathName_U -//sys rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) = ntdll.RtlDefaultNpAcl - -type ioStatusBlock struct { - Status, Information uintptr -} - -type objectAttributes struct { - Length uintptr - RootDirectory uintptr - ObjectName *unicodeString - Attributes uintptr - SecurityDescriptor *securityDescriptor - SecurityQoS uintptr -} - -type unicodeString struct { - Length uint16 - MaximumLength uint16 - Buffer uintptr -} - -type securityDescriptor struct { - Revision byte - Sbz1 byte - Control uint16 - Owner uintptr - Group uintptr - Sacl uintptr //revive:disable-line:var-naming SACL, not Sacl - Dacl uintptr //revive:disable-line:var-naming DACL, not Dacl -} - -type ntStatus int32 - -func (status ntStatus) Err() error { - if status >= 0 { - return nil - } - return rtlNtStatusToDosError(status) -} - -var ( - // ErrPipeListenerClosed is returned for pipe operations on listeners that have been closed. - ErrPipeListenerClosed = net.ErrClosed - - errPipeWriteClosed = errors.New("pipe has been closed for write") -) - -type win32Pipe struct { - *win32File - path string -} - -type win32MessageBytePipe struct { - win32Pipe - writeClosed bool - readEOF bool -} - -type pipeAddress string - -func (f *win32Pipe) LocalAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) RemoteAddr() net.Addr { - return pipeAddress(f.path) -} - -func (f *win32Pipe) SetDeadline(t time.Time) error { - if err := f.SetReadDeadline(t); err != nil { - return err - } - return f.SetWriteDeadline(t) -} - -// CloseWrite closes the write side of a message pipe in byte mode. -func (f *win32MessageBytePipe) CloseWrite() error { - if f.writeClosed { - return errPipeWriteClosed - } - err := f.win32File.Flush() - if err != nil { - return err - } - _, err = f.win32File.Write(nil) - if err != nil { - return err - } - f.writeClosed = true - return nil -} - -// Write writes bytes to a message pipe in byte mode. Zero-byte writes are ignored, since -// they are used to implement CloseWrite(). -func (f *win32MessageBytePipe) Write(b []byte) (int, error) { - if f.writeClosed { - return 0, errPipeWriteClosed - } - if len(b) == 0 { - return 0, nil - } - return f.win32File.Write(b) -} - -// Read reads bytes from a message pipe in byte mode. A read of a zero-byte message on a message -// mode pipe will return io.EOF, as will all subsequent reads. -func (f *win32MessageBytePipe) Read(b []byte) (int, error) { - if f.readEOF { - return 0, io.EOF - } - n, err := f.win32File.Read(b) - if err == io.EOF { //nolint:errorlint - // If this was the result of a zero-byte read, then - // it is possible that the read was due to a zero-size - // message. Since we are simulating CloseWrite with a - // zero-byte message, ensure that all future Read() calls - // also return EOF. - f.readEOF = true - } else if err == syscall.ERROR_MORE_DATA { //nolint:errorlint // err is Errno - // ERROR_MORE_DATA indicates that the pipe's read mode is message mode - // and the message still has more bytes. Treat this as a success, since - // this package presents all named pipes as byte streams. - err = nil - } - return n, err -} - -func (pipeAddress) Network() string { - return "pipe" -} - -func (s pipeAddress) String() string { - return string(s) -} - -// tryDialPipe attempts to dial the pipe at `path` until `ctx` cancellation or timeout. -func tryDialPipe(ctx context.Context, path *string, access fs.AccessMask) (syscall.Handle, error) { - for { - select { - case <-ctx.Done(): - return syscall.Handle(0), ctx.Err() - default: - wh, err := fs.CreateFile(*path, - access, - 0, // mode - nil, // security attributes - fs.OPEN_EXISTING, - fs.FILE_FLAG_OVERLAPPED|fs.SECURITY_SQOS_PRESENT|fs.SECURITY_ANONYMOUS, - 0, // template file handle - ) - h := syscall.Handle(wh) - if err == nil { - return h, nil - } - if err != windows.ERROR_PIPE_BUSY { //nolint:errorlint // err is Errno - return h, &os.PathError{Err: err, Op: "open", Path: *path} - } - // Wait 10 msec and try again. This is a rather simplistic - // view, as we always try each 10 milliseconds. - time.Sleep(10 * time.Millisecond) - } - } -} - -// DialPipe connects to a named pipe by path, timing out if the connection -// takes longer than the specified duration. If timeout is nil, then we use -// a default timeout of 2 seconds. (We do not use WaitNamedPipe.) -func DialPipe(path string, timeout *time.Duration) (net.Conn, error) { - var absTimeout time.Time - if timeout != nil { - absTimeout = time.Now().Add(*timeout) - } else { - absTimeout = time.Now().Add(2 * time.Second) - } - ctx, cancel := context.WithDeadline(context.Background(), absTimeout) - defer cancel() - conn, err := DialPipeContext(ctx, path) - if errors.Is(err, context.DeadlineExceeded) { - return nil, ErrTimeout - } - return conn, err -} - -// DialPipeContext attempts to connect to a named pipe by `path` until `ctx` -// cancellation or timeout. -func DialPipeContext(ctx context.Context, path string) (net.Conn, error) { - return DialPipeAccess(ctx, path, syscall.GENERIC_READ|syscall.GENERIC_WRITE) -} - -// DialPipeAccess attempts to connect to a named pipe by `path` with `access` until `ctx` -// cancellation or timeout. -func DialPipeAccess(ctx context.Context, path string, access uint32) (net.Conn, error) { - var err error - var h syscall.Handle - h, err = tryDialPipe(ctx, &path, fs.AccessMask(access)) - if err != nil { - return nil, err - } - - var flags uint32 - err = getNamedPipeInfo(h, &flags, nil, nil, nil) - if err != nil { - return nil, err - } - - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - - // If the pipe is in message mode, return a message byte pipe, which - // supports CloseWrite(). - if flags&windows.PIPE_TYPE_MESSAGE != 0 { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: f, path: path}, - }, nil - } - return &win32Pipe{win32File: f, path: path}, nil -} - -type acceptResponse struct { - f *win32File - err error -} - -type win32PipeListener struct { - firstHandle syscall.Handle - path string - config PipeConfig - acceptCh chan (chan acceptResponse) - closeCh chan int - doneCh chan int -} - -func makeServerPipeHandle(path string, sd []byte, c *PipeConfig, first bool) (syscall.Handle, error) { - path16, err := syscall.UTF16FromString(path) - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - var oa objectAttributes - oa.Length = unsafe.Sizeof(oa) - - var ntPath unicodeString - if err := rtlDosPathNameToNtPathName(&path16[0], - &ntPath, - 0, - 0, - ).Err(); err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - defer localFree(ntPath.Buffer) - oa.ObjectName = &ntPath - oa.Attributes = windows.OBJ_CASE_INSENSITIVE - - // The security descriptor is only needed for the first pipe. - if first { - if sd != nil { - l := uint32(len(sd)) - sdb := localAlloc(0, l) - defer localFree(sdb) - copy((*[0xffff]byte)(unsafe.Pointer(sdb))[:], sd) - oa.SecurityDescriptor = (*securityDescriptor)(unsafe.Pointer(sdb)) - } else { - // Construct the default named pipe security descriptor. - var dacl uintptr - if err := rtlDefaultNpAcl(&dacl).Err(); err != nil { - return 0, fmt.Errorf("getting default named pipe ACL: %w", err) - } - defer localFree(dacl) - - sdb := &securityDescriptor{ - Revision: 1, - Control: windows.SE_DACL_PRESENT, - Dacl: dacl, - } - oa.SecurityDescriptor = sdb - } - } - - typ := uint32(windows.FILE_PIPE_REJECT_REMOTE_CLIENTS) - if c.MessageMode { - typ |= windows.FILE_PIPE_MESSAGE_TYPE - } - - disposition := uint32(windows.FILE_OPEN) - access := uint32(syscall.GENERIC_READ | syscall.GENERIC_WRITE | syscall.SYNCHRONIZE) - if first { - disposition = windows.FILE_CREATE - // By not asking for read or write access, the named pipe file system - // will put this pipe into an initially disconnected state, blocking - // client connections until the next call with first == false. - access = syscall.SYNCHRONIZE - } - - timeout := int64(-50 * 10000) // 50ms - - var ( - h syscall.Handle - iosb ioStatusBlock - ) - err = ntCreateNamedPipeFile(&h, - access, - &oa, - &iosb, - syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE, - disposition, - 0, - typ, - 0, - 0, - 0xffffffff, - uint32(c.InputBufferSize), - uint32(c.OutputBufferSize), - &timeout).Err() - if err != nil { - return 0, &os.PathError{Op: "open", Path: path, Err: err} - } - - runtime.KeepAlive(ntPath) - return h, nil -} - -func (l *win32PipeListener) makeServerPipe() (*win32File, error) { - h, err := makeServerPipeHandle(l.path, nil, &l.config, false) - if err != nil { - return nil, err - } - f, err := makeWin32File(h) - if err != nil { - syscall.Close(h) - return nil, err - } - return f, nil -} - -func (l *win32PipeListener) makeConnectedServerPipe() (*win32File, error) { - p, err := l.makeServerPipe() - if err != nil { - return nil, err - } - - // Wait for the client to connect. - ch := make(chan error) - go func(p *win32File) { - ch <- connectPipe(p) - }(p) - - select { - case err = <-ch: - if err != nil { - p.Close() - p = nil - } - case <-l.closeCh: - // Abort the connect request by closing the handle. - p.Close() - p = nil - err = <-ch - if err == nil || err == ErrFileClosed { //nolint:errorlint // err is Errno - err = ErrPipeListenerClosed - } - } - return p, err -} - -func (l *win32PipeListener) listenerRoutine() { - closed := false - for !closed { - select { - case <-l.closeCh: - closed = true - case responseCh := <-l.acceptCh: - var ( - p *win32File - err error - ) - for { - p, err = l.makeConnectedServerPipe() - // If the connection was immediately closed by the client, try - // again. - if err != windows.ERROR_NO_DATA { //nolint:errorlint // err is Errno - break - } - } - responseCh <- acceptResponse{p, err} - closed = err == ErrPipeListenerClosed //nolint:errorlint // err is Errno - } - } - syscall.Close(l.firstHandle) - l.firstHandle = 0 - // Notify Close() and Accept() callers that the handle has been closed. - close(l.doneCh) -} - -// PipeConfig contain configuration for the pipe listener. -type PipeConfig struct { - // SecurityDescriptor contains a Windows security descriptor in SDDL format. - SecurityDescriptor string - - // MessageMode determines whether the pipe is in byte or message mode. In either - // case the pipe is read in byte mode by default. The only practical difference in - // this implementation is that CloseWrite() is only supported for message mode pipes; - // CloseWrite() is implemented as a zero-byte write, but zero-byte writes are only - // transferred to the reader (and returned as io.EOF in this implementation) - // when the pipe is in message mode. - MessageMode bool - - // InputBufferSize specifies the size of the input buffer, in bytes. - InputBufferSize int32 - - // OutputBufferSize specifies the size of the output buffer, in bytes. - OutputBufferSize int32 -} - -// ListenPipe creates a listener on a Windows named pipe path, e.g. \\.\pipe\mypipe. -// The pipe must not already exist. -func ListenPipe(path string, c *PipeConfig) (net.Listener, error) { - var ( - sd []byte - err error - ) - if c == nil { - c = &PipeConfig{} - } - if c.SecurityDescriptor != "" { - sd, err = SddlToSecurityDescriptor(c.SecurityDescriptor) - if err != nil { - return nil, err - } - } - h, err := makeServerPipeHandle(path, sd, c, true) - if err != nil { - return nil, err - } - l := &win32PipeListener{ - firstHandle: h, - path: path, - config: *c, - acceptCh: make(chan (chan acceptResponse)), - closeCh: make(chan int), - doneCh: make(chan int), - } - go l.listenerRoutine() - return l, nil -} - -func connectPipe(p *win32File) error { - c, err := p.prepareIO() - if err != nil { - return err - } - defer p.wg.Done() - - err = connectNamedPipe(p.handle, &c.o) - _, err = p.asyncIO(c, nil, 0, err) - if err != nil && err != windows.ERROR_PIPE_CONNECTED { //nolint:errorlint // err is Errno - return err - } - return nil -} - -func (l *win32PipeListener) Accept() (net.Conn, error) { - ch := make(chan acceptResponse) - select { - case l.acceptCh <- ch: - response := <-ch - err := response.err - if err != nil { - return nil, err - } - if l.config.MessageMode { - return &win32MessageBytePipe{ - win32Pipe: win32Pipe{win32File: response.f, path: l.path}, - }, nil - } - return &win32Pipe{win32File: response.f, path: l.path}, nil - case <-l.doneCh: - return nil, ErrPipeListenerClosed - } -} - -func (l *win32PipeListener) Close() error { - select { - case l.closeCh <- 1: - <-l.doneCh - case <-l.doneCh: - } - return nil -} - -func (l *win32PipeListener) Addr() net.Addr { - return pipeAddress(l.path) -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go deleted file mode 100644 index 48ce4e9243..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid.go +++ /dev/null @@ -1,232 +0,0 @@ -// Package guid provides a GUID type. The backing structure for a GUID is -// identical to that used by the golang.org/x/sys/windows GUID type. -// There are two main binary encodings used for a GUID, the big-endian encoding, -// and the Windows (mixed-endian) encoding. See here for details: -// https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding -package guid - -import ( - "crypto/rand" - "crypto/sha1" //nolint:gosec // not used for secure application - "encoding" - "encoding/binary" - "fmt" - "strconv" -) - -//go:generate go run golang.org/x/tools/cmd/stringer -type=Variant -trimprefix=Variant -linecomment - -// Variant specifies which GUID variant (or "type") of the GUID. It determines -// how the entirety of the rest of the GUID is interpreted. -type Variant uint8 - -// The variants specified by RFC 4122 section 4.1.1. -const ( - // VariantUnknown specifies a GUID variant which does not conform to one of - // the variant encodings specified in RFC 4122. - VariantUnknown Variant = iota - VariantNCS - VariantRFC4122 // RFC 4122 - VariantMicrosoft - VariantFuture -) - -// Version specifies how the bits in the GUID were generated. For instance, a -// version 4 GUID is randomly generated, and a version 5 is generated from the -// hash of an input string. -type Version uint8 - -func (v Version) String() string { - return strconv.FormatUint(uint64(v), 10) -} - -var _ = (encoding.TextMarshaler)(GUID{}) -var _ = (encoding.TextUnmarshaler)(&GUID{}) - -// NewV4 returns a new version 4 (pseudorandom) GUID, as defined by RFC 4122. -func NewV4() (GUID, error) { - var b [16]byte - if _, err := rand.Read(b[:]); err != nil { - return GUID{}, err - } - - g := FromArray(b) - g.setVersion(4) // Version 4 means randomly generated. - g.setVariant(VariantRFC4122) - - return g, nil -} - -// NewV5 returns a new version 5 (generated from a string via SHA-1 hashing) -// GUID, as defined by RFC 4122. The RFC is unclear on the encoding of the name, -// and the sample code treats it as a series of bytes, so we do the same here. -// -// Some implementations, such as those found on Windows, treat the name as a -// big-endian UTF16 stream of bytes. If that is desired, the string can be -// encoded as such before being passed to this function. -func NewV5(namespace GUID, name []byte) (GUID, error) { - b := sha1.New() //nolint:gosec // not used for secure application - namespaceBytes := namespace.ToArray() - b.Write(namespaceBytes[:]) - b.Write(name) - - a := [16]byte{} - copy(a[:], b.Sum(nil)) - - g := FromArray(a) - g.setVersion(5) // Version 5 means generated from a string. - g.setVariant(VariantRFC4122) - - return g, nil -} - -func fromArray(b [16]byte, order binary.ByteOrder) GUID { - var g GUID - g.Data1 = order.Uint32(b[0:4]) - g.Data2 = order.Uint16(b[4:6]) - g.Data3 = order.Uint16(b[6:8]) - copy(g.Data4[:], b[8:16]) - return g -} - -func (g GUID) toArray(order binary.ByteOrder) [16]byte { - b := [16]byte{} - order.PutUint32(b[0:4], g.Data1) - order.PutUint16(b[4:6], g.Data2) - order.PutUint16(b[6:8], g.Data3) - copy(b[8:16], g.Data4[:]) - return b -} - -// FromArray constructs a GUID from a big-endian encoding array of 16 bytes. -func FromArray(b [16]byte) GUID { - return fromArray(b, binary.BigEndian) -} - -// ToArray returns an array of 16 bytes representing the GUID in big-endian -// encoding. -func (g GUID) ToArray() [16]byte { - return g.toArray(binary.BigEndian) -} - -// FromWindowsArray constructs a GUID from a Windows encoding array of bytes. -func FromWindowsArray(b [16]byte) GUID { - return fromArray(b, binary.LittleEndian) -} - -// ToWindowsArray returns an array of 16 bytes representing the GUID in Windows -// encoding. -func (g GUID) ToWindowsArray() [16]byte { - return g.toArray(binary.LittleEndian) -} - -func (g GUID) String() string { - return fmt.Sprintf( - "%08x-%04x-%04x-%04x-%012x", - g.Data1, - g.Data2, - g.Data3, - g.Data4[:2], - g.Data4[2:]) -} - -// FromString parses a string containing a GUID and returns the GUID. The only -// format currently supported is the `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` -// format. -func FromString(s string) (GUID, error) { - if len(s) != 36 { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - - var g GUID - - data1, err := strconv.ParseUint(s[0:8], 16, 32) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data1 = uint32(data1) - - data2, err := strconv.ParseUint(s[9:13], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data2 = uint16(data2) - - data3, err := strconv.ParseUint(s[14:18], 16, 16) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data3 = uint16(data3) - - for i, x := range []int{19, 21, 24, 26, 28, 30, 32, 34} { - v, err := strconv.ParseUint(s[x:x+2], 16, 8) - if err != nil { - return GUID{}, fmt.Errorf("invalid GUID %q", s) - } - g.Data4[i] = uint8(v) - } - - return g, nil -} - -func (g *GUID) setVariant(v Variant) { - d := g.Data4[0] - switch v { - case VariantNCS: - d = (d & 0x7f) - case VariantRFC4122: - d = (d & 0x3f) | 0x80 - case VariantMicrosoft: - d = (d & 0x1f) | 0xc0 - case VariantFuture: - d = (d & 0x0f) | 0xe0 - case VariantUnknown: - fallthrough - default: - panic(fmt.Sprintf("invalid variant: %d", v)) - } - g.Data4[0] = d -} - -// Variant returns the GUID variant, as defined in RFC 4122. -func (g GUID) Variant() Variant { - b := g.Data4[0] - if b&0x80 == 0 { - return VariantNCS - } else if b&0xc0 == 0x80 { - return VariantRFC4122 - } else if b&0xe0 == 0xc0 { - return VariantMicrosoft - } else if b&0xe0 == 0xe0 { - return VariantFuture - } - return VariantUnknown -} - -func (g *GUID) setVersion(v Version) { - g.Data3 = (g.Data3 & 0x0fff) | (uint16(v) << 12) -} - -// Version returns the GUID version, as defined in RFC 4122. -func (g GUID) Version() Version { - return Version((g.Data3 & 0xF000) >> 12) -} - -// MarshalText returns the textual representation of the GUID. -func (g GUID) MarshalText() ([]byte, error) { - return []byte(g.String()), nil -} - -// UnmarshalText takes the textual representation of a GUID, and unmarhals it -// into this GUID. -func (g *GUID) UnmarshalText(text []byte) error { - g2, err := FromString(string(text)) - if err != nil { - return err - } - *g = g2 - return nil -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go deleted file mode 100644 index 805bd35484..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_nonwindows.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build !windows -// +build !windows - -package guid - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type as that is only available to builds -// targeted at `windows`. The representation matches that used by native Windows -// code. -type GUID struct { - Data1 uint32 - Data2 uint16 - Data3 uint16 - Data4 [8]byte -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go deleted file mode 100644 index 27e45ee5cc..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/guid_windows.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build windows -// +build windows - -package guid - -import "golang.org/x/sys/windows" - -// GUID represents a GUID/UUID. It has the same structure as -// golang.org/x/sys/windows.GUID so that it can be used with functions expecting -// that type. It is defined as its own type so that stringification and -// marshaling can be supported. The representation matches that used by native -// Windows code. -type GUID windows.GUID diff --git a/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go b/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go deleted file mode 100644 index 4076d3132f..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/guid/variant_string.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by "stringer -type=Variant -trimprefix=Variant -linecomment"; DO NOT EDIT. - -package guid - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[VariantUnknown-0] - _ = x[VariantNCS-1] - _ = x[VariantRFC4122-2] - _ = x[VariantMicrosoft-3] - _ = x[VariantFuture-4] -} - -const _Variant_name = "UnknownNCSRFC 4122MicrosoftFuture" - -var _Variant_index = [...]uint8{0, 7, 10, 18, 27, 33} - -func (i Variant) String() string { - if i >= Variant(len(_Variant_index)-1) { - return "Variant(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Variant_name[_Variant_index[i]:_Variant_index[i+1]] -} diff --git a/vendor/github.com/Microsoft/go-winio/privilege.go b/vendor/github.com/Microsoft/go-winio/privilege.go deleted file mode 100644 index 0ff9dac906..0000000000 --- a/vendor/github.com/Microsoft/go-winio/privilege.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "runtime" - "sync" - "syscall" - "unicode/utf16" - - "golang.org/x/sys/windows" -) - -//sys adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) [true] = advapi32.AdjustTokenPrivileges -//sys impersonateSelf(level uint32) (err error) = advapi32.ImpersonateSelf -//sys revertToSelf() (err error) = advapi32.RevertToSelf -//sys openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) = advapi32.OpenThreadToken -//sys getCurrentThread() (h syscall.Handle) = GetCurrentThread -//sys lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) = advapi32.LookupPrivilegeValueW -//sys lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) = advapi32.LookupPrivilegeNameW -//sys lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) = advapi32.LookupPrivilegeDisplayNameW - -const ( - //revive:disable-next-line:var-naming ALL_CAPS - SE_PRIVILEGE_ENABLED = windows.SE_PRIVILEGE_ENABLED - - //revive:disable-next-line:var-naming ALL_CAPS - ERROR_NOT_ALL_ASSIGNED syscall.Errno = windows.ERROR_NOT_ALL_ASSIGNED - - SeBackupPrivilege = "SeBackupPrivilege" - SeRestorePrivilege = "SeRestorePrivilege" - SeSecurityPrivilege = "SeSecurityPrivilege" -) - -var ( - privNames = make(map[string]uint64) - privNameMutex sync.Mutex -) - -// PrivilegeError represents an error enabling privileges. -type PrivilegeError struct { - privileges []uint64 -} - -func (e *PrivilegeError) Error() string { - s := "Could not enable privilege " - if len(e.privileges) > 1 { - s = "Could not enable privileges " - } - for i, p := range e.privileges { - if i != 0 { - s += ", " - } - s += `"` - s += getPrivilegeName(p) - s += `"` - } - return s -} - -// RunWithPrivilege enables a single privilege for a function call. -func RunWithPrivilege(name string, fn func() error) error { - return RunWithPrivileges([]string{name}, fn) -} - -// RunWithPrivileges enables privileges for a function call. -func RunWithPrivileges(names []string, fn func() error) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - runtime.LockOSThread() - defer runtime.UnlockOSThread() - token, err := newThreadToken() - if err != nil { - return err - } - defer releaseThreadToken(token) - err = adjustPrivileges(token, privileges, SE_PRIVILEGE_ENABLED) - if err != nil { - return err - } - return fn() -} - -func mapPrivileges(names []string) ([]uint64, error) { - privileges := make([]uint64, 0, len(names)) - privNameMutex.Lock() - defer privNameMutex.Unlock() - for _, name := range names { - p, ok := privNames[name] - if !ok { - err := lookupPrivilegeValue("", name, &p) - if err != nil { - return nil, err - } - privNames[name] = p - } - privileges = append(privileges, p) - } - return privileges, nil -} - -// EnableProcessPrivileges enables privileges globally for the process. -func EnableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, SE_PRIVILEGE_ENABLED) -} - -// DisableProcessPrivileges disables privileges globally for the process. -func DisableProcessPrivileges(names []string) error { - return enableDisableProcessPrivilege(names, 0) -} - -func enableDisableProcessPrivilege(names []string, action uint32) error { - privileges, err := mapPrivileges(names) - if err != nil { - return err - } - - p := windows.CurrentProcess() - var token windows.Token - err = windows.OpenProcessToken(p, windows.TOKEN_ADJUST_PRIVILEGES|windows.TOKEN_QUERY, &token) - if err != nil { - return err - } - - defer token.Close() - return adjustPrivileges(token, privileges, action) -} - -func adjustPrivileges(token windows.Token, privileges []uint64, action uint32) error { - var b bytes.Buffer - _ = binary.Write(&b, binary.LittleEndian, uint32(len(privileges))) - for _, p := range privileges { - _ = binary.Write(&b, binary.LittleEndian, p) - _ = binary.Write(&b, binary.LittleEndian, action) - } - prevState := make([]byte, b.Len()) - reqSize := uint32(0) - success, err := adjustTokenPrivileges(token, false, &b.Bytes()[0], uint32(len(prevState)), &prevState[0], &reqSize) - if !success { - return err - } - if err == ERROR_NOT_ALL_ASSIGNED { //nolint:errorlint // err is Errno - return &PrivilegeError{privileges} - } - return nil -} - -func getPrivilegeName(luid uint64) string { - var nameBuffer [256]uint16 - bufSize := uint32(len(nameBuffer)) - err := lookupPrivilegeName("", &luid, &nameBuffer[0], &bufSize) - if err != nil { - return fmt.Sprintf("", luid) - } - - var displayNameBuffer [256]uint16 - displayBufSize := uint32(len(displayNameBuffer)) - var langID uint32 - err = lookupPrivilegeDisplayName("", &nameBuffer[0], &displayNameBuffer[0], &displayBufSize, &langID) - if err != nil { - return fmt.Sprintf("", string(utf16.Decode(nameBuffer[:bufSize]))) - } - - return string(utf16.Decode(displayNameBuffer[:displayBufSize])) -} - -func newThreadToken() (windows.Token, error) { - err := impersonateSelf(windows.SecurityImpersonation) - if err != nil { - return 0, err - } - - var token windows.Token - err = openThreadToken(getCurrentThread(), syscall.TOKEN_ADJUST_PRIVILEGES|syscall.TOKEN_QUERY, false, &token) - if err != nil { - rerr := revertToSelf() - if rerr != nil { - panic(rerr) - } - return 0, err - } - return token, nil -} - -func releaseThreadToken(h windows.Token) { - err := revertToSelf() - if err != nil { - panic(err) - } - h.Close() -} diff --git a/vendor/github.com/Microsoft/go-winio/reparse.go b/vendor/github.com/Microsoft/go-winio/reparse.go deleted file mode 100644 index 67d1a104a6..0000000000 --- a/vendor/github.com/Microsoft/go-winio/reparse.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "bytes" - "encoding/binary" - "fmt" - "strings" - "unicode/utf16" - "unsafe" -) - -const ( - reparseTagMountPoint = 0xA0000003 - reparseTagSymlink = 0xA000000C -) - -type reparseDataBuffer struct { - ReparseTag uint32 - ReparseDataLength uint16 - Reserved uint16 - SubstituteNameOffset uint16 - SubstituteNameLength uint16 - PrintNameOffset uint16 - PrintNameLength uint16 -} - -// ReparsePoint describes a Win32 symlink or mount point. -type ReparsePoint struct { - Target string - IsMountPoint bool -} - -// UnsupportedReparsePointError is returned when trying to decode a non-symlink or -// mount point reparse point. -type UnsupportedReparsePointError struct { - Tag uint32 -} - -func (e *UnsupportedReparsePointError) Error() string { - return fmt.Sprintf("unsupported reparse point %x", e.Tag) -} - -// DecodeReparsePoint decodes a Win32 REPARSE_DATA_BUFFER structure containing either a symlink -// or a mount point. -func DecodeReparsePoint(b []byte) (*ReparsePoint, error) { - tag := binary.LittleEndian.Uint32(b[0:4]) - return DecodeReparsePointData(tag, b[8:]) -} - -func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) { - isMountPoint := false - switch tag { - case reparseTagMountPoint: - isMountPoint = true - case reparseTagSymlink: - default: - return nil, &UnsupportedReparsePointError{tag} - } - nameOffset := 8 + binary.LittleEndian.Uint16(b[4:6]) - if !isMountPoint { - nameOffset += 4 - } - nameLength := binary.LittleEndian.Uint16(b[6:8]) - name := make([]uint16, nameLength/2) - err := binary.Read(bytes.NewReader(b[nameOffset:nameOffset+nameLength]), binary.LittleEndian, &name) - if err != nil { - return nil, err - } - return &ReparsePoint{string(utf16.Decode(name)), isMountPoint}, nil -} - -func isDriveLetter(c byte) bool { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') -} - -// EncodeReparsePoint encodes a Win32 REPARSE_DATA_BUFFER structure describing a symlink or -// mount point. -func EncodeReparsePoint(rp *ReparsePoint) []byte { - // Generate an NT path and determine if this is a relative path. - var ntTarget string - relative := false - if strings.HasPrefix(rp.Target, `\\?\`) { - ntTarget = `\??\` + rp.Target[4:] - } else if strings.HasPrefix(rp.Target, `\\`) { - ntTarget = `\??\UNC\` + rp.Target[2:] - } else if len(rp.Target) >= 2 && isDriveLetter(rp.Target[0]) && rp.Target[1] == ':' { - ntTarget = `\??\` + rp.Target - } else { - ntTarget = rp.Target - relative = true - } - - // The paths must be NUL-terminated even though they are counted strings. - target16 := utf16.Encode([]rune(rp.Target + "\x00")) - ntTarget16 := utf16.Encode([]rune(ntTarget + "\x00")) - - size := int(unsafe.Sizeof(reparseDataBuffer{})) - 8 - size += len(ntTarget16)*2 + len(target16)*2 - - tag := uint32(reparseTagMountPoint) - if !rp.IsMountPoint { - tag = reparseTagSymlink - size += 4 // Add room for symlink flags - } - - data := reparseDataBuffer{ - ReparseTag: tag, - ReparseDataLength: uint16(size), - SubstituteNameOffset: 0, - SubstituteNameLength: uint16((len(ntTarget16) - 1) * 2), - PrintNameOffset: uint16(len(ntTarget16) * 2), - PrintNameLength: uint16((len(target16) - 1) * 2), - } - - var b bytes.Buffer - _ = binary.Write(&b, binary.LittleEndian, &data) - if !rp.IsMountPoint { - flags := uint32(0) - if relative { - flags |= 1 - } - _ = binary.Write(&b, binary.LittleEndian, flags) - } - - _ = binary.Write(&b, binary.LittleEndian, ntTarget16) - _ = binary.Write(&b, binary.LittleEndian, target16) - return b.Bytes() -} diff --git a/vendor/github.com/Microsoft/go-winio/sd.go b/vendor/github.com/Microsoft/go-winio/sd.go deleted file mode 100644 index 5550ef6b61..0000000000 --- a/vendor/github.com/Microsoft/go-winio/sd.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build windows -// +build windows - -package winio - -import ( - "errors" - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -//sys lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountNameW -//sys lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) = advapi32.LookupAccountSidW -//sys convertSidToStringSid(sid *byte, str **uint16) (err error) = advapi32.ConvertSidToStringSidW -//sys convertStringSidToSid(str *uint16, sid **byte) (err error) = advapi32.ConvertStringSidToSidW -//sys convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) = advapi32.ConvertStringSecurityDescriptorToSecurityDescriptorW -//sys convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) = advapi32.ConvertSecurityDescriptorToStringSecurityDescriptorW -//sys localFree(mem uintptr) = LocalFree -//sys getSecurityDescriptorLength(sd uintptr) (len uint32) = advapi32.GetSecurityDescriptorLength - -type AccountLookupError struct { - Name string - Err error -} - -func (e *AccountLookupError) Error() string { - if e.Name == "" { - return "lookup account: empty account name specified" - } - var s string - switch { - case errors.Is(e.Err, windows.ERROR_INVALID_SID): - s = "the security ID structure is invalid" - case errors.Is(e.Err, windows.ERROR_NONE_MAPPED): - s = "not found" - default: - s = e.Err.Error() - } - return "lookup account " + e.Name + ": " + s -} - -func (e *AccountLookupError) Unwrap() error { return e.Err } - -type SddlConversionError struct { - Sddl string - Err error -} - -func (e *SddlConversionError) Error() string { - return "convert " + e.Sddl + ": " + e.Err.Error() -} - -func (e *SddlConversionError) Unwrap() error { return e.Err } - -// LookupSidByName looks up the SID of an account by name -// -//revive:disable-next-line:var-naming SID, not Sid -func LookupSidByName(name string) (sid string, err error) { - if name == "" { - return "", &AccountLookupError{name, windows.ERROR_NONE_MAPPED} - } - - var sidSize, sidNameUse, refDomainSize uint32 - err = lookupAccountName(nil, name, nil, &sidSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != syscall.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno - return "", &AccountLookupError{name, err} - } - sidBuffer := make([]byte, sidSize) - refDomainBuffer := make([]uint16, refDomainSize) - err = lookupAccountName(nil, name, &sidBuffer[0], &sidSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) - if err != nil { - return "", &AccountLookupError{name, err} - } - var strBuffer *uint16 - err = convertSidToStringSid(&sidBuffer[0], &strBuffer) - if err != nil { - return "", &AccountLookupError{name, err} - } - sid = syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(strBuffer))[:]) - localFree(uintptr(unsafe.Pointer(strBuffer))) - return sid, nil -} - -// LookupNameBySid looks up the name of an account by SID -// -//revive:disable-next-line:var-naming SID, not Sid -func LookupNameBySid(sid string) (name string, err error) { - if sid == "" { - return "", &AccountLookupError{sid, windows.ERROR_NONE_MAPPED} - } - - sidBuffer, err := windows.UTF16PtrFromString(sid) - if err != nil { - return "", &AccountLookupError{sid, err} - } - - var sidPtr *byte - if err = convertStringSidToSid(sidBuffer, &sidPtr); err != nil { - return "", &AccountLookupError{sid, err} - } - defer localFree(uintptr(unsafe.Pointer(sidPtr))) - - var nameSize, refDomainSize, sidNameUse uint32 - err = lookupAccountSid(nil, sidPtr, nil, &nameSize, nil, &refDomainSize, &sidNameUse) - if err != nil && err != windows.ERROR_INSUFFICIENT_BUFFER { //nolint:errorlint // err is Errno - return "", &AccountLookupError{sid, err} - } - - nameBuffer := make([]uint16, nameSize) - refDomainBuffer := make([]uint16, refDomainSize) - err = lookupAccountSid(nil, sidPtr, &nameBuffer[0], &nameSize, &refDomainBuffer[0], &refDomainSize, &sidNameUse) - if err != nil { - return "", &AccountLookupError{sid, err} - } - - name = windows.UTF16ToString(nameBuffer) - return name, nil -} - -func SddlToSecurityDescriptor(sddl string) ([]byte, error) { - var sdBuffer uintptr - err := convertStringSecurityDescriptorToSecurityDescriptor(sddl, 1, &sdBuffer, nil) - if err != nil { - return nil, &SddlConversionError{sddl, err} - } - defer localFree(sdBuffer) - sd := make([]byte, getSecurityDescriptorLength(sdBuffer)) - copy(sd, (*[0xffff]byte)(unsafe.Pointer(sdBuffer))[:len(sd)]) - return sd, nil -} - -func SecurityDescriptorToSddl(sd []byte) (string, error) { - var sddl *uint16 - // The returned string length seems to include an arbitrary number of terminating NULs. - // Don't use it. - err := convertSecurityDescriptorToStringSecurityDescriptor(&sd[0], 1, 0xff, &sddl, nil) - if err != nil { - return "", err - } - defer localFree(uintptr(unsafe.Pointer(sddl))) - return syscall.UTF16ToString((*[0xffff]uint16)(unsafe.Pointer(sddl))[:]), nil -} diff --git a/vendor/github.com/Microsoft/go-winio/syscall.go b/vendor/github.com/Microsoft/go-winio/syscall.go deleted file mode 100644 index a6ca111b39..0000000000 --- a/vendor/github.com/Microsoft/go-winio/syscall.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build windows - -package winio - -//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go ./*.go diff --git a/vendor/github.com/Microsoft/go-winio/tools.go b/vendor/github.com/Microsoft/go-winio/tools.go deleted file mode 100644 index 2aa045843e..0000000000 --- a/vendor/github.com/Microsoft/go-winio/tools.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build tools - -package winio - -import _ "golang.org/x/tools/cmd/stringer" diff --git a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go deleted file mode 100644 index 469b16f639..0000000000 --- a/vendor/github.com/Microsoft/go-winio/zsyscall_windows.go +++ /dev/null @@ -1,419 +0,0 @@ -//go:build windows - -// Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. - -package winio - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modadvapi32 = windows.NewLazySystemDLL("advapi32.dll") - modkernel32 = windows.NewLazySystemDLL("kernel32.dll") - modntdll = windows.NewLazySystemDLL("ntdll.dll") - modws2_32 = windows.NewLazySystemDLL("ws2_32.dll") - - procAdjustTokenPrivileges = modadvapi32.NewProc("AdjustTokenPrivileges") - procConvertSecurityDescriptorToStringSecurityDescriptorW = modadvapi32.NewProc("ConvertSecurityDescriptorToStringSecurityDescriptorW") - procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW") - procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW") - procConvertStringSidToSidW = modadvapi32.NewProc("ConvertStringSidToSidW") - procGetSecurityDescriptorLength = modadvapi32.NewProc("GetSecurityDescriptorLength") - procImpersonateSelf = modadvapi32.NewProc("ImpersonateSelf") - procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW") - procLookupAccountSidW = modadvapi32.NewProc("LookupAccountSidW") - procLookupPrivilegeDisplayNameW = modadvapi32.NewProc("LookupPrivilegeDisplayNameW") - procLookupPrivilegeNameW = modadvapi32.NewProc("LookupPrivilegeNameW") - procLookupPrivilegeValueW = modadvapi32.NewProc("LookupPrivilegeValueW") - procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken") - procRevertToSelf = modadvapi32.NewProc("RevertToSelf") - procBackupRead = modkernel32.NewProc("BackupRead") - procBackupWrite = modkernel32.NewProc("BackupWrite") - procCancelIoEx = modkernel32.NewProc("CancelIoEx") - procConnectNamedPipe = modkernel32.NewProc("ConnectNamedPipe") - procCreateIoCompletionPort = modkernel32.NewProc("CreateIoCompletionPort") - procCreateNamedPipeW = modkernel32.NewProc("CreateNamedPipeW") - procGetCurrentThread = modkernel32.NewProc("GetCurrentThread") - procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW") - procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo") - procGetQueuedCompletionStatus = modkernel32.NewProc("GetQueuedCompletionStatus") - procLocalAlloc = modkernel32.NewProc("LocalAlloc") - procLocalFree = modkernel32.NewProc("LocalFree") - procSetFileCompletionNotificationModes = modkernel32.NewProc("SetFileCompletionNotificationModes") - procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") - procRtlDefaultNpAcl = modntdll.NewProc("RtlDefaultNpAcl") - procRtlDosPathNameToNtPathName_U = modntdll.NewProc("RtlDosPathNameToNtPathName_U") - procRtlNtStatusToDosErrorNoTeb = modntdll.NewProc("RtlNtStatusToDosErrorNoTeb") - procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") -) - -func adjustTokenPrivileges(token windows.Token, releaseAll bool, input *byte, outputSize uint32, output *byte, requiredSize *uint32) (success bool, err error) { - var _p0 uint32 - if releaseAll { - _p0 = 1 - } - r0, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(input)), uintptr(outputSize), uintptr(unsafe.Pointer(output)), uintptr(unsafe.Pointer(requiredSize))) - success = r0 != 0 - if true { - err = errnoErr(e1) - } - return -} - -func convertSecurityDescriptorToStringSecurityDescriptor(sd *byte, revision uint32, secInfo uint32, sddl **uint16, sddlSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(secInfo), uintptr(unsafe.Pointer(sddl)), uintptr(unsafe.Pointer(sddlSize)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertSidToStringSid(sid *byte, str **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(str)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision uint32, sd *uintptr, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(str) - if err != nil { - return - } - return _convertStringSecurityDescriptorToSecurityDescriptor(_p0, revision, sd, size) -} - -func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd *uintptr, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func convertStringSidToSid(str *uint16, sid **byte) (err error) { - r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(sid)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getSecurityDescriptorLength(sd uintptr) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(sd), 0, 0) - len = uint32(r0) - return -} - -func impersonateSelf(level uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(level), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(accountName) - if err != nil { - return - } - return _lookupAccountName(systemName, _p0, sid, sidSize, refDomain, refDomainSize, sidNameUse) -} - -func _lookupAccountName(systemName *uint16, accountName *uint16, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupAccountSid(systemName *uint16, sid *byte, name *uint16, nameSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameSize)), uintptr(unsafe.Pointer(refDomain)), uintptr(unsafe.Pointer(refDomainSize)), uintptr(unsafe.Pointer(sidNameUse)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeDisplayName(systemName string, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeDisplayName(_p0, name, buffer, size, languageId) -} - -func _lookupPrivilegeDisplayName(systemName *uint16, name *uint16, buffer *uint16, size *uint32, languageId *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeDisplayNameW.Addr(), 5, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(languageId)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeName(systemName string, luid *uint64, buffer *uint16, size *uint32) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - return _lookupPrivilegeName(_p0, luid, buffer, size) -} - -func _lookupPrivilegeName(systemName *uint16, luid *uint64, buffer *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procLookupPrivilegeNameW.Addr(), 4, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(luid)), uintptr(unsafe.Pointer(buffer)), uintptr(unsafe.Pointer(size)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func lookupPrivilegeValue(systemName string, name string, luid *uint64) (err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(systemName) - if err != nil { - return - } - var _p1 *uint16 - _p1, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _lookupPrivilegeValue(_p0, _p1, luid) -} - -func _lookupPrivilegeValue(systemName *uint16, name *uint16, luid *uint64) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func openThreadToken(thread syscall.Handle, accessMask uint32, openAsSelf bool, token *windows.Token) (err error) { - var _p0 uint32 - if openAsSelf { - _p0 = 1 - } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(accessMask), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func revertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func backupRead(h syscall.Handle, b []byte, bytesRead *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } - r1, _, e1 := syscall.Syscall9(procBackupRead.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesRead)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func backupWrite(h syscall.Handle, b []byte, bytesWritten *uint32, abort bool, processSecurity bool, context *uintptr) (err error) { - var _p0 *byte - if len(b) > 0 { - _p0 = &b[0] - } - var _p1 uint32 - if abort { - _p1 = 1 - } - var _p2 uint32 - if processSecurity { - _p2 = 1 - } - r1, _, e1 := syscall.Syscall9(procBackupWrite.Addr(), 7, uintptr(h), uintptr(unsafe.Pointer(_p0)), uintptr(len(b)), uintptr(unsafe.Pointer(bytesWritten)), uintptr(_p1), uintptr(_p2), uintptr(unsafe.Pointer(context)), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func cancelIoEx(file syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(file), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(o)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func createIoCompletionPort(file syscall.Handle, port syscall.Handle, key uintptr, threadCount uint32) (newport syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(file), uintptr(port), uintptr(key), uintptr(threadCount), 0, 0) - newport = syscall.Handle(r0) - if newport == 0 { - err = errnoErr(e1) - } - return -} - -func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - var _p0 *uint16 - _p0, err = syscall.UTF16PtrFromString(name) - if err != nil { - return - } - return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa) -} - -func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) - handle = syscall.Handle(r0) - if handle == syscall.InvalidHandle { - err = errnoErr(e1) - } - return -} - -func getCurrentThread() (h syscall.Handle) { - r0, _, _ := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) - h = syscall.Handle(r0) - return -} - -func getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func getQueuedCompletionStatus(port syscall.Handle, bytes *uint32, key *uintptr, o **ioOperation, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(port), uintptr(unsafe.Pointer(bytes)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(o)), uintptr(timeout), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func localAlloc(uFlags uint32, length uint32) (ptr uintptr) { - r0, _, _ := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(uFlags), uintptr(length), 0) - ptr = uintptr(r0) - return -} - -func localFree(mem uintptr) { - syscall.Syscall(procLocalFree.Addr(), 1, uintptr(mem), 0, 0) - return -} - -func setFileCompletionNotificationModes(h syscall.Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(h), uintptr(flags), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} - -func ntCreateNamedPipeFile(pipe *syscall.Handle, access uint32, oa *objectAttributes, iosb *ioStatusBlock, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (status ntStatus) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) - status = ntStatus(r0) - return -} - -func rtlDefaultNpAcl(dacl *uintptr) (status ntStatus) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(dacl)), 0, 0) - status = ntStatus(r0) - return -} - -func rtlDosPathNameToNtPathName(name *uint16, ntName *unicodeString, filePart uintptr, reserved uintptr) (status ntStatus) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(ntName)), uintptr(filePart), uintptr(reserved), 0, 0) - status = ntStatus(r0) - return -} - -func rtlNtStatusToDosError(status ntStatus) (winerr error) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(status), 0, 0) - if r0 != 0 { - winerr = syscall.Errno(r0) - } - return -} - -func wsaGetOverlappedResult(h syscall.Handle, o *syscall.Overlapped, bytes *uint32, wait bool, flags *uint32) (err error) { - var _p0 uint32 - if wait { - _p0 = 1 - } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) - if r1 == 0 { - err = errnoErr(e1) - } - return -} diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/.gitignore b/vendor/github.com/OpenPeeDeeP/depguard/v2/.gitignore deleted file mode 100644 index e189bdb220..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -.idea -.null-ls*.go diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/LICENSE b/vendor/github.com/OpenPeeDeeP/depguard/v2/LICENSE deleted file mode 100644 index 94a9ed024d..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md b/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md deleted file mode 100644 index 2ccfa22c59..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/README.md +++ /dev/null @@ -1,163 +0,0 @@ -# Depguard - -A Go linter that checks package imports are in a list of acceptable packages. -This allows you to allow imports from a whole organization or only -allow specific packages within a repository. - -## Install - -```bash -go install github.com/OpenPeeDeeP/depguard@latest -``` - -## Config - -The Depguard binary looks for a file named `^\.?depguard\.(yaml|yml|json|toml)$` in the current working directory. Examples include (`.depguard.yml` or `depguard.toml`). - -The following is an example configuration file. - -```json -{ - "main": { - "files": [ - "$all", - "!$test" - ], - "listMode": "Strict", - "allow": [ - "$gostd", - "github.com/OpenPeeDeeP" - ], - "deny": { - "reflect": "Who needs reflection", - } - }, - "tests": { - "files": [ - "$test" - ], - "listMode": "Lax", - "deny": { - "github.com/stretchr/testify": "Please use standard library for tests" - } - } -} -``` - -- The top level is a map of lists. The key of the map is a name that shows up in -the linter's output. -- `files` - list of file globs that will match this list of settings to compare against -- `allow` - list of allowed packages -- `deny` - map of packages that are not allowed where the value is a suggestion -= `listMode` - the mode to use for package matching - -Files are matched using [Globs](https://github.com/gobwas/glob). If the files -list is empty, then all files will match that list. Prefixing a file -with an exclamation mark `!` will put that glob in a "don't match" list. A file -will match a list if it is allowed and not denied. - -> Should always prefix a file glob with `**/` as files are matched against absolute paths. - -Allow is a prefix of packages to allow. A dollar sign `$` can be used at the end -of a package to specify it must be exact match only. - -Deny is a map where the key is a prefix of the package to deny, and the value -is a suggestion on what to use instead. A dollar sign `$` can be used at the end -of a package to specify it must be exact match only. - -A Prefix List just means that a package will match a value, if the value is a -prefix of the package. Example `github.com/OpenPeeDeeP/depguard` package will match -a value of `github.com/OpenPeeDeeP` but won't match `github.com/OpenPeeDeeP/depguard/v2`. - -ListMode is used to determine the package matching priority. There are three -different modes; Original, Strict, and Lax. - -Original is the original way that the package was written to use. It is not recommended -to stay with this and is only here for backwards compatibility. - -Strict, at its roots, is everything is denied unless in allowed. - -Lax, at its roots, is everything is allowed unless it is denied. - -There are cases where a package can be matched in both the allow and denied lists. -You may allow a subpackage but deny the root or vice versa. The `settings_tests.go` file -has many scenarios listed out under `TestListImportAllowed`. These tests will stay -up to date as features are added. - -### Variables - -There are variable replacements for each type of list (file or package). This is -to reduce repetition and tedious behaviors. - -#### File Variables - -> you can still use an exclamation mark `!` in front of a variable to say not to -use it. Example `!$test` will match any file that is not a go test file. - -- `$all` - matches all go files -- `$test` - matches all go test files - -#### Package Variables - -- `$gostd` - matches all of go's standard library (Pulled from GOROOT) - -### Example Configs - -Below: - -- non-test go files will match `Main` and test go files will match `Test`. -- both allow all of go standard library except for the `reflect` package which will -tell the user "Please don't use reflect package". -- go test files are also allowed to use https://github.com/stretchr/testify package -and any sub-package of it. - -```yaml -Main: - files: - - $all - - "!$test" - allow: - - $gostd - deny: - reflect: Please don't use reflect package -Test: - files: - - $test - allow: - - $gostd - - github.com/stretchr/testify - deny: - reflect: Please don't use reflect package -``` - -Below: - -- All go files will match `Main` -- Go files in internal will match both `Main` and `Internal` - -```yaml -Main: - files: - - $all -Internal: - files: - - "**/internal/**/*.go" -``` - -Below: - -- All packages are allowed except for `github.com/OpenPeeDeeP/depguard`. Though -`github.com/OpenPeeDeeP/depguard/v2` and `github.com/OpenPeeDeeP/depguard/somepackage` -would be allowed. - -```yaml -Main: - deny: - - github.com/OpenPeeDeeP/depguard$ -``` - -## Golangci-lint - -This linter was built with -[Golangci-lint](https://github.com/golangci/golangci-lint) in mind. It is compatible -and read their docs to see how to implement all their linters, including this one. diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/depguard.go b/vendor/github.com/OpenPeeDeeP/depguard/v2/depguard.go deleted file mode 100644 index 2729091e8a..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/depguard.go +++ /dev/null @@ -1,95 +0,0 @@ -package depguard - -import ( - "fmt" - "go/ast" - "path/filepath" - "strings" - - "golang.org/x/tools/go/analysis" -) - -// NewAnalyzer creates a new analyzer from the settings passed in. -// This can fail if the passed in LinterSettings does not compile. -// Use NewUncompiledAnalyzer if you need control when the compile happens. -func NewAnalyzer(settings *LinterSettings) (*analysis.Analyzer, error) { - s, err := settings.compile() - if err != nil { - return nil, err - } - analyzer := newAnalyzer(s.run) - return analyzer, nil -} - -type UncompiledAnalyzer struct { - Analyzer *analysis.Analyzer - settings *LinterSettings -} - -// NewUncompiledAnalyzer creates a new analyzer from the settings passed in. -// This can never error unlike NewAnalyzer. -// It is advised to call the Compile method on the returned Analyzer before running. -func NewUncompiledAnalyzer(settings *LinterSettings) *UncompiledAnalyzer { - return &UncompiledAnalyzer{ - Analyzer: newAnalyzer(settings.run), - settings: settings, - } -} - -// Compile the settings ahead of time so each subsuquent run of the analyzer doesn't -// need to do this work. -func (ua *UncompiledAnalyzer) Compile() error { - s, err := ua.settings.compile() - if err != nil { - return err - } - ua.Analyzer.Run = s.run - return nil -} - -func (settings LinterSettings) run(pass *analysis.Pass) (interface{}, error) { - s, err := settings.compile() - if err != nil { - return nil, err - } - return s.run(pass) -} - -func newAnalyzer(run func(*analysis.Pass) (interface{}, error)) *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "depguard", - Doc: "Go linter that checks if package imports are in a list of acceptable packages", - URL: "https://github.com/OpenPeeDeeP/depguard", - Run: run, - RunDespiteErrors: false, - } -} - -func (s linterSettings) run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - // For Windows need to replace separator with '/' - fileName := filepath.ToSlash(pass.Fset.Position(file.Pos()).Filename) - lists := s.whichLists(fileName) - for _, imp := range file.Imports { - for _, l := range lists { - if allowed, sugg := l.importAllowed(rawBasicLit(imp.Path)); !allowed { - diag := analysis.Diagnostic{ - Pos: imp.Pos(), - End: imp.End(), - Message: fmt.Sprintf("import '%s' is not allowed from list '%s'", rawBasicLit(imp.Path), l.name), - } - if sugg != "" { - diag.Message = fmt.Sprintf("%s: %s", diag.Message, sugg) - diag.SuggestedFixes = append(diag.SuggestedFixes, analysis.SuggestedFix{Message: sugg}) - } - pass.Report(diag) - } - } - } - } - return nil, nil -} - -func rawBasicLit(lit *ast.BasicLit) string { - return strings.Trim(lit.Value, "\"") -} diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/errors.go b/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/errors.go deleted file mode 100644 index 65325f6128..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/errors.go +++ /dev/null @@ -1,18 +0,0 @@ -package utils - -import ( - "strings" -) - -type MultiError []error - -func (me MultiError) Error() string { - b := strings.Builder{} - for i, e := range me { - b.WriteString(e.Error()) - if i < len(me)-1 { - b.WriteByte('\n') - } - } - return b.String() -} diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/variables.go b/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/variables.go deleted file mode 100644 index 3363bd8400..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/internal/utils/variables.go +++ /dev/null @@ -1,131 +0,0 @@ -package utils - -import ( - "fmt" - "os" - "os/exec" - "path" - "path/filepath" - "runtime" - "strings" -) - -type Expander interface { - Expand() ([]string, error) -} - -type ExpanderMap map[string]Expander - -var ( - PathExpandable = ExpanderMap{ - "$all": &allExpander{}, - "$test": &testExpander{}, - } - PackageExpandable = ExpanderMap{ - "$gostd": &gostdExpander{}, - } -) - -type allExpander struct{} - -func (*allExpander) Expand() ([]string, error) { - return []string{"**/*.go"}, nil -} - -type testExpander struct{} - -func (*testExpander) Expand() ([]string, error) { - return []string{"**/*_test.go"}, nil -} - -type gostdExpander struct { - cache []string -} - -// We can do this as all imports that are not root are either prefixed with a domain -// or prefixed with `./` or `/` to dictate it is a local file reference -func (e *gostdExpander) Expand() ([]string, error) { - if len(e.cache) != 0 { - return e.cache, nil - } - root := path.Join(findGOROOT(), "src") - fs, err := os.ReadDir(root) - if err != nil { - return nil, fmt.Errorf("could not read GOROOT directory: %w", err) - } - var pkgPrefix []string - for _, f := range fs { - if !f.IsDir() { - continue - } - pkgPrefix = append(pkgPrefix, f.Name()) - } - e.cache = pkgPrefix - return pkgPrefix, nil -} - -func findGOROOT() string { - // code borrowed from https://github.com/golang/tools/blob/86c93e8732cce300d0270bce23117456ce92bb17/cmd/godoc/goroot.go#L15-L30 - if env := os.Getenv("GOROOT"); env != "" { - return filepath.Clean(env) - } - def := filepath.Clean(runtime.GOROOT()) - if runtime.Compiler == "gccgo" { - // gccgo has no real GOROOT, and it certainly doesn't - // depend on the executable's location. - return def - } - out, err := exec.Command("go", "env", "GOROOT").Output() - if err != nil { - return def - } - return strings.TrimSpace(string(out)) -} - -func ExpandSlice(sl []string, exp ExpanderMap) ([]string, error) { - for i, s := range sl { - f, found := exp[s] - if !found { - continue - } - e, err := f.Expand() - if err != nil { - return nil, fmt.Errorf("couldn't expand %s: %w", s, err) - } - sl = insertSlice(sl, i, e...) - } - return sl, nil -} - -func ExpandMap(m map[string]string, exp ExpanderMap) error { - for k, v := range m { - f, found := exp[k] - if !found { - continue - } - e, err := f.Expand() - if err != nil { - return fmt.Errorf("couldn't expand %s: %w", k, err) - } - for _, ex := range e { - m[ex] = v - } - delete(m, k) - } - return nil -} - -func insertSlice(a []string, k int, b ...string) []string { - n := len(a) + len(b) - 1 - if n <= cap(a) { - a2 := a[:n] - copy(a2[k+len(b):], a[k+1:]) - copy(a2[k:], b) - return a2 - } - a2 := make([]string, n) - copy(a2, a[:k]) - copy(a2[k:], b) - copy(a2[k+len(b):], a[k+1:]) - return a2 -} diff --git a/vendor/github.com/OpenPeeDeeP/depguard/v2/settings.go b/vendor/github.com/OpenPeeDeeP/depguard/v2/settings.go deleted file mode 100644 index 311cacc889..0000000000 --- a/vendor/github.com/OpenPeeDeeP/depguard/v2/settings.go +++ /dev/null @@ -1,240 +0,0 @@ -package depguard - -import ( - "errors" - "fmt" - "sort" - "strings" - - "github.com/OpenPeeDeeP/depguard/v2/internal/utils" - "github.com/gobwas/glob" -) - -type List struct { - ListMode string `json:"listMode" yaml:"listMode" toml:"listMode" mapstructure:"listMode"` - Files []string `json:"files" yaml:"files" toml:"files" mapstructure:"files"` - Allow []string `json:"allow" yaml:"allow" toml:"allow" mapstructure:"allow"` - Deny map[string]string `json:"deny" yaml:"deny" toml:"deny" mapstructure:"deny"` -} - -type listMode int - -const ( - listModeOriginal listMode = iota - listModeStrict - listModeLax -) - -type list struct { - listMode listMode - name string - files []glob.Glob - negFiles []glob.Glob - allow []string - deny []string - suggestions []string -} - -func (l *List) compile() (*list, error) { - if l == nil { - return nil, nil - } - li := &list{} - var errs utils.MultiError - var err error - - // Determine List Mode - switch strings.ToLower(l.ListMode) { - case "": - li.listMode = listModeOriginal - case "original": - li.listMode = listModeOriginal - case "strict": - li.listMode = listModeStrict - case "lax": - li.listMode = listModeLax - default: - errs = append(errs, fmt.Errorf("%s is not a known list mode", l.ListMode)) - } - - // Compile Files - for _, f := range l.Files { - var negate bool - if len(f) > 0 && f[0] == '!' { - negate = true - f = f[1:] - } - // Expand File if needed - fs, err := utils.ExpandSlice([]string{f}, utils.PathExpandable) - if err != nil { - errs = append(errs, err) - } - for _, exp := range fs { - g, err := glob.Compile(exp, '/') - if err != nil { - errs = append(errs, fmt.Errorf("%s could not be compiled: %w", exp, err)) - continue - } - if negate { - li.negFiles = append(li.negFiles, g) - continue - } - li.files = append(li.files, g) - } - } - - if len(l.Allow) > 0 { - // Expand Allow - l.Allow, err = utils.ExpandSlice(l.Allow, utils.PackageExpandable) - if err != nil { - errs = append(errs, err) - } - - // Sort Allow - li.allow = make([]string, len(l.Allow)) - copy(li.allow, l.Allow) - sort.Strings(li.allow) - } - - if l.Deny != nil { - // Expand Deny Map (to keep suggestions) - err = utils.ExpandMap(l.Deny, utils.PackageExpandable) - if err != nil { - errs = append(errs, err) - } - - // Split Deny Into Package Slice - li.deny = make([]string, 0, len(l.Deny)) - for pkg := range l.Deny { - li.deny = append(li.deny, pkg) - } - - // Sort Deny - sort.Strings(li.deny) - - // Populate Suggestions to match the Deny order - li.suggestions = make([]string, 0, len(li.deny)) - for _, dp := range li.deny { - li.suggestions = append(li.suggestions, strings.TrimSpace(l.Deny[dp])) - } - } - - // Populate the type of this list - if len(li.allow) == 0 && len(li.deny) == 0 { - errs = append(errs, errors.New("must have an Allow and/or Deny package list")) - } - - if len(errs) > 0 { - return nil, errs - } - return li, nil -} - -func (l *list) fileMatch(fileName string) bool { - inAllowed := len(l.files) == 0 || strInGlobList(fileName, l.files) - inDenied := strInGlobList(fileName, l.negFiles) - return inAllowed && !inDenied -} - -func (l *list) importAllowed(imp string) (bool, string) { - inAllowed, aIdx := strInPrefixList(imp, l.allow) - inDenied, dIdx := strInPrefixList(imp, l.deny) - var allowed bool - switch l.listMode { - case listModeOriginal: - inAllowed = len(l.allow) == 0 || inAllowed - allowed = inAllowed && !inDenied - case listModeStrict: - allowed = inAllowed && (!inDenied || len(l.allow[aIdx]) > len(l.deny[dIdx])) - case listModeLax: - allowed = !inDenied || (inAllowed && len(l.allow[aIdx]) > len(l.deny[dIdx])) - default: - allowed = false - } - sugg := "" - if !allowed && inDenied && dIdx != -1 { - sugg = l.suggestions[dIdx] - } - return allowed, sugg -} - -type LinterSettings map[string]*List - -type linterSettings []*list - -func (l LinterSettings) compile() (linterSettings, error) { - if len(l) == 0 { - // Only allow $gostd in all files - set := &List{ - Files: []string{"$all"}, - Allow: []string{"$gostd"}, - } - li, err := set.compile() - if err != nil { - return nil, err - } - li.name = "Main" - return linterSettings{li}, nil - } - names := make([]string, 0, len(l)) - for name := range l { - names = append(names, name) - } - sort.Strings(names) - li := make(linterSettings, 0, len(l)) - var errs utils.MultiError - for _, name := range names { - c, err := l[name].compile() - if err != nil { - errs = append(errs, err) - continue - } - if c == nil { - continue - } - c.name = name - li = append(li, c) - } - if len(errs) > 0 { - return nil, errs - } - - return li, nil -} - -func (ls linterSettings) whichLists(fileName string) []*list { - var matches []*list - for _, l := range ls { - if l.fileMatch(fileName) { - matches = append(matches, l) - } - } - return matches -} - -func strInGlobList(str string, globList []glob.Glob) bool { - for _, g := range globList { - if g.Match(str) { - return true - } - } - return false -} - -func strInPrefixList(str string, prefixList []string) (bool, int) { - // Idx represents where in the prefix slice the passed in string would go - // when sorted. -1 Just means that it would be at the very front of the slice. - idx := sort.Search(len(prefixList), func(i int) bool { - return strings.TrimRight(prefixList[i], "$") > str - }) - 1 - // This means that the string passed in has no way to be prefixed by anything - // in the prefix list as it is already smaller then everything - if idx == -1 { - return false, idx - } - ioc := prefixList[idx] - if ioc[len(ioc)-1] == '$' { - return str == ioc[:len(ioc)-1], idx - } - return strings.HasPrefix(str, prefixList[idx]), idx -} diff --git a/vendor/github.com/ProtonMail/go-crypto/AUTHORS b/vendor/github.com/ProtonMail/go-crypto/AUTHORS deleted file mode 100644 index 2b00ddba0d..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at https://tip.golang.org/AUTHORS. diff --git a/vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS b/vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS deleted file mode 100644 index 1fbd3e976f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at https://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/github.com/ProtonMail/go-crypto/LICENSE b/vendor/github.com/ProtonMail/go-crypto/LICENSE deleted file mode 100644 index 6a66aea5ea..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/ProtonMail/go-crypto/PATENTS b/vendor/github.com/ProtonMail/go-crypto/PATENTS deleted file mode 100644 index 733099041f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/PATENTS +++ /dev/null @@ -1,22 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Go project. - -Google hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) -patent license to make, have made, use, offer to sell, sell, import, -transfer and otherwise run, modify and propagate the contents of this -implementation of Go, where such license applies only to those patent -claims, both currently owned or controlled by Google and acquired in -the future, licensable by Google that are necessarily infringed by this -implementation of Go. This grant does not include claims that would be -infringed only as a consequence of further modification of this -implementation. If you or your agent or exclusive licensee institute or -order or agree to the institution of patent litigation against any -entity (including a cross-claim or counterclaim in a lawsuit) alleging -that this implementation of Go or any code incorporated within this -implementation of Go constitutes direct or contributory patent -infringement, or inducement of patent infringement, then any patent -rights granted to you under this License for this implementation of Go -shall terminate as of the date such litigation is filed. diff --git a/vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go b/vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go deleted file mode 100644 index c85e6befec..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/bitcurves/bitcurve.go +++ /dev/null @@ -1,381 +0,0 @@ -package bitcurves - -// Copyright 2010 The Go Authors. All rights reserved. -// Copyright 2011 ThePiachu. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package bitelliptic implements several Koblitz elliptic curves over prime -// fields. - -// This package operates, internally, on Jacobian coordinates. For a given -// (x, y) position on the curve, the Jacobian coordinates are (x1, y1, z1) -// where x = x1/z1² and y = y1/z1³. The greatest speedups come when the whole -// calculation can be performed within the transform (as in ScalarMult and -// ScalarBaseMult). But even for Add and Double, it's faster to apply and -// reverse the transform than to operate in affine coordinates. - -import ( - "crypto/elliptic" - "io" - "math/big" - "sync" -) - -// A BitCurve represents a Koblitz Curve with a=0. -// See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html -type BitCurve struct { - Name string - P *big.Int // the order of the underlying field - N *big.Int // the order of the base point - B *big.Int // the constant of the BitCurve equation - Gx, Gy *big.Int // (x,y) of the base point - BitSize int // the size of the underlying field -} - -// Params returns the parameters of the given BitCurve (see BitCurve struct) -func (bitCurve *BitCurve) Params() (cp *elliptic.CurveParams) { - cp = new(elliptic.CurveParams) - cp.Name = bitCurve.Name - cp.P = bitCurve.P - cp.N = bitCurve.N - cp.Gx = bitCurve.Gx - cp.Gy = bitCurve.Gy - cp.BitSize = bitCurve.BitSize - return cp -} - -// IsOnCurve returns true if the given (x,y) lies on the BitCurve. -func (bitCurve *BitCurve) IsOnCurve(x, y *big.Int) bool { - // y² = x³ + b - y2 := new(big.Int).Mul(y, y) //y² - y2.Mod(y2, bitCurve.P) //y²%P - - x3 := new(big.Int).Mul(x, x) //x² - x3.Mul(x3, x) //x³ - - x3.Add(x3, bitCurve.B) //x³+B - x3.Mod(x3, bitCurve.P) //(x³+B)%P - - return x3.Cmp(y2) == 0 -} - -// affineFromJacobian reverses the Jacobian transform. See the comment at the -// top of the file. -func (bitCurve *BitCurve) affineFromJacobian(x, y, z *big.Int) (xOut, yOut *big.Int) { - if z.Cmp(big.NewInt(0)) == 0 { - panic("bitcurve: Can't convert to affine with Jacobian Z = 0") - } - // x = YZ^2 mod P - zinv := new(big.Int).ModInverse(z, bitCurve.P) - zinvsq := new(big.Int).Mul(zinv, zinv) - - xOut = new(big.Int).Mul(x, zinvsq) - xOut.Mod(xOut, bitCurve.P) - // y = YZ^3 mod P - zinvsq.Mul(zinvsq, zinv) - yOut = new(big.Int).Mul(y, zinvsq) - yOut.Mod(yOut, bitCurve.P) - return xOut, yOut -} - -// Add returns the sum of (x1,y1) and (x2,y2) -func (bitCurve *BitCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) { - z := new(big.Int).SetInt64(1) - x, y, z := bitCurve.addJacobian(x1, y1, z, x2, y2, z) - return bitCurve.affineFromJacobian(x, y, z) -} - -// addJacobian takes two points in Jacobian coordinates, (x1, y1, z1) and -// (x2, y2, z2) and returns their sum, also in Jacobian form. -func (bitCurve *BitCurve) addJacobian(x1, y1, z1, x2, y2, z2 *big.Int) (*big.Int, *big.Int, *big.Int) { - // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-2007-bl - z1z1 := new(big.Int).Mul(z1, z1) - z1z1.Mod(z1z1, bitCurve.P) - z2z2 := new(big.Int).Mul(z2, z2) - z2z2.Mod(z2z2, bitCurve.P) - - u1 := new(big.Int).Mul(x1, z2z2) - u1.Mod(u1, bitCurve.P) - u2 := new(big.Int).Mul(x2, z1z1) - u2.Mod(u2, bitCurve.P) - h := new(big.Int).Sub(u2, u1) - if h.Sign() == -1 { - h.Add(h, bitCurve.P) - } - i := new(big.Int).Lsh(h, 1) - i.Mul(i, i) - j := new(big.Int).Mul(h, i) - - s1 := new(big.Int).Mul(y1, z2) - s1.Mul(s1, z2z2) - s1.Mod(s1, bitCurve.P) - s2 := new(big.Int).Mul(y2, z1) - s2.Mul(s2, z1z1) - s2.Mod(s2, bitCurve.P) - r := new(big.Int).Sub(s2, s1) - if r.Sign() == -1 { - r.Add(r, bitCurve.P) - } - r.Lsh(r, 1) - v := new(big.Int).Mul(u1, i) - - x3 := new(big.Int).Set(r) - x3.Mul(x3, x3) - x3.Sub(x3, j) - x3.Sub(x3, v) - x3.Sub(x3, v) - x3.Mod(x3, bitCurve.P) - - y3 := new(big.Int).Set(r) - v.Sub(v, x3) - y3.Mul(y3, v) - s1.Mul(s1, j) - s1.Lsh(s1, 1) - y3.Sub(y3, s1) - y3.Mod(y3, bitCurve.P) - - z3 := new(big.Int).Add(z1, z2) - z3.Mul(z3, z3) - z3.Sub(z3, z1z1) - if z3.Sign() == -1 { - z3.Add(z3, bitCurve.P) - } - z3.Sub(z3, z2z2) - if z3.Sign() == -1 { - z3.Add(z3, bitCurve.P) - } - z3.Mul(z3, h) - z3.Mod(z3, bitCurve.P) - - return x3, y3, z3 -} - -// Double returns 2*(x,y) -func (bitCurve *BitCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int) { - z1 := new(big.Int).SetInt64(1) - return bitCurve.affineFromJacobian(bitCurve.doubleJacobian(x1, y1, z1)) -} - -// doubleJacobian takes a point in Jacobian coordinates, (x, y, z), and -// returns its double, also in Jacobian form. -func (bitCurve *BitCurve) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, *big.Int) { - // See http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l - - a := new(big.Int).Mul(x, x) //X1² - b := new(big.Int).Mul(y, y) //Y1² - c := new(big.Int).Mul(b, b) //B² - - d := new(big.Int).Add(x, b) //X1+B - d.Mul(d, d) //(X1+B)² - d.Sub(d, a) //(X1+B)²-A - d.Sub(d, c) //(X1+B)²-A-C - d.Mul(d, big.NewInt(2)) //2*((X1+B)²-A-C) - - e := new(big.Int).Mul(big.NewInt(3), a) //3*A - f := new(big.Int).Mul(e, e) //E² - - x3 := new(big.Int).Mul(big.NewInt(2), d) //2*D - x3.Sub(f, x3) //F-2*D - x3.Mod(x3, bitCurve.P) - - y3 := new(big.Int).Sub(d, x3) //D-X3 - y3.Mul(e, y3) //E*(D-X3) - y3.Sub(y3, new(big.Int).Mul(big.NewInt(8), c)) //E*(D-X3)-8*C - y3.Mod(y3, bitCurve.P) - - z3 := new(big.Int).Mul(y, z) //Y1*Z1 - z3.Mul(big.NewInt(2), z3) //3*Y1*Z1 - z3.Mod(z3, bitCurve.P) - - return x3, y3, z3 -} - -// TODO: double check if it is okay -// ScalarMult returns k*(Bx,By) where k is a number in big-endian form. -func (bitCurve *BitCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) { - // We have a slight problem in that the identity of the group (the - // point at infinity) cannot be represented in (x, y) form on a finite - // machine. Thus the standard add/double algorithm has to be tweaked - // slightly: our initial state is not the identity, but x, and we - // ignore the first true bit in |k|. If we don't find any true bits in - // |k|, then we return nil, nil, because we cannot return the identity - // element. - - Bz := new(big.Int).SetInt64(1) - x := Bx - y := By - z := Bz - - seenFirstTrue := false - for _, byte := range k { - for bitNum := 0; bitNum < 8; bitNum++ { - if seenFirstTrue { - x, y, z = bitCurve.doubleJacobian(x, y, z) - } - if byte&0x80 == 0x80 { - if !seenFirstTrue { - seenFirstTrue = true - } else { - x, y, z = bitCurve.addJacobian(Bx, By, Bz, x, y, z) - } - } - byte <<= 1 - } - } - - if !seenFirstTrue { - return nil, nil - } - - return bitCurve.affineFromJacobian(x, y, z) -} - -// ScalarBaseMult returns k*G, where G is the base point of the group and k is -// an integer in big-endian form. -func (bitCurve *BitCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int) { - return bitCurve.ScalarMult(bitCurve.Gx, bitCurve.Gy, k) -} - -var mask = []byte{0xff, 0x1, 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f} - -// TODO: double check if it is okay -// GenerateKey returns a public/private key pair. The private key is generated -// using the given reader, which must return random data. -func (bitCurve *BitCurve) GenerateKey(rand io.Reader) (priv []byte, x, y *big.Int, err error) { - byteLen := (bitCurve.BitSize + 7) >> 3 - priv = make([]byte, byteLen) - - for x == nil { - _, err = io.ReadFull(rand, priv) - if err != nil { - return - } - // We have to mask off any excess bits in the case that the size of the - // underlying field is not a whole number of bytes. - priv[0] &= mask[bitCurve.BitSize%8] - // This is because, in tests, rand will return all zeros and we don't - // want to get the point at infinity and loop forever. - priv[1] ^= 0x42 - x, y = bitCurve.ScalarBaseMult(priv) - } - return -} - -// Marshal converts a point into the form specified in section 4.3.6 of ANSI -// X9.62. -func (bitCurve *BitCurve) Marshal(x, y *big.Int) []byte { - byteLen := (bitCurve.BitSize + 7) >> 3 - - ret := make([]byte, 1+2*byteLen) - ret[0] = 4 // uncompressed point - - xBytes := x.Bytes() - copy(ret[1+byteLen-len(xBytes):], xBytes) - yBytes := y.Bytes() - copy(ret[1+2*byteLen-len(yBytes):], yBytes) - return ret -} - -// Unmarshal converts a point, serialised by Marshal, into an x, y pair. On -// error, x = nil. -func (bitCurve *BitCurve) Unmarshal(data []byte) (x, y *big.Int) { - byteLen := (bitCurve.BitSize + 7) >> 3 - if len(data) != 1+2*byteLen { - return - } - if data[0] != 4 { // uncompressed form - return - } - x = new(big.Int).SetBytes(data[1 : 1+byteLen]) - y = new(big.Int).SetBytes(data[1+byteLen:]) - return -} - -//curve parameters taken from: -//http://www.secg.org/collateral/sec2_final.pdf - -var initonce sync.Once -var secp160k1 *BitCurve -var secp192k1 *BitCurve -var secp224k1 *BitCurve -var secp256k1 *BitCurve - -func initAll() { - initS160() - initS192() - initS224() - initS256() -} - -func initS160() { - // See SEC 2 section 2.4.1 - secp160k1 = new(BitCurve) - secp160k1.Name = "secp160k1" - secp160k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", 16) - secp160k1.N, _ = new(big.Int).SetString("0100000000000000000001B8FA16DFAB9ACA16B6B3", 16) - secp160k1.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000007", 16) - secp160k1.Gx, _ = new(big.Int).SetString("3B4C382CE37AA192A4019E763036F4F5DD4D7EBB", 16) - secp160k1.Gy, _ = new(big.Int).SetString("938CF935318FDCED6BC28286531733C3F03C4FEE", 16) - secp160k1.BitSize = 160 -} - -func initS192() { - // See SEC 2 section 2.5.1 - secp192k1 = new(BitCurve) - secp192k1.Name = "secp192k1" - secp192k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", 16) - secp192k1.N, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", 16) - secp192k1.B, _ = new(big.Int).SetString("000000000000000000000000000000000000000000000003", 16) - secp192k1.Gx, _ = new(big.Int).SetString("DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", 16) - secp192k1.Gy, _ = new(big.Int).SetString("9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", 16) - secp192k1.BitSize = 192 -} - -func initS224() { - // See SEC 2 section 2.6.1 - secp224k1 = new(BitCurve) - secp224k1.Name = "secp224k1" - secp224k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", 16) - secp224k1.N, _ = new(big.Int).SetString("010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", 16) - secp224k1.B, _ = new(big.Int).SetString("00000000000000000000000000000000000000000000000000000005", 16) - secp224k1.Gx, _ = new(big.Int).SetString("A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", 16) - secp224k1.Gy, _ = new(big.Int).SetString("7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", 16) - secp224k1.BitSize = 224 -} - -func initS256() { - // See SEC 2 section 2.7.1 - secp256k1 = new(BitCurve) - secp256k1.Name = "secp256k1" - secp256k1.P, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", 16) - secp256k1.N, _ = new(big.Int).SetString("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 16) - secp256k1.B, _ = new(big.Int).SetString("0000000000000000000000000000000000000000000000000000000000000007", 16) - secp256k1.Gx, _ = new(big.Int).SetString("79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798", 16) - secp256k1.Gy, _ = new(big.Int).SetString("483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8", 16) - secp256k1.BitSize = 256 -} - -// S160 returns a BitCurve which implements secp160k1 (see SEC 2 section 2.4.1) -func S160() *BitCurve { - initonce.Do(initAll) - return secp160k1 -} - -// S192 returns a BitCurve which implements secp192k1 (see SEC 2 section 2.5.1) -func S192() *BitCurve { - initonce.Do(initAll) - return secp192k1 -} - -// S224 returns a BitCurve which implements secp224k1 (see SEC 2 section 2.6.1) -func S224() *BitCurve { - initonce.Do(initAll) - return secp224k1 -} - -// S256 returns a BitCurve which implements bitcurves (see SEC 2 section 2.7.1) -func S256() *BitCurve { - initonce.Do(initAll) - return secp256k1 -} diff --git a/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go b/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go deleted file mode 100644 index cb6676de24..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/brainpool/brainpool.go +++ /dev/null @@ -1,134 +0,0 @@ -// Package brainpool implements Brainpool elliptic curves. -// Implementation of rcurves is from github.com/ebfe/brainpool -// Note that these curves are implemented with naive, non-constant time operations -// and are likely not suitable for environments where timing attacks are a concern. -package brainpool - -import ( - "crypto/elliptic" - "math/big" - "sync" -) - -var ( - once sync.Once - p256t1, p384t1, p512t1 *elliptic.CurveParams - p256r1, p384r1, p512r1 *rcurve -) - -func initAll() { - initP256t1() - initP384t1() - initP512t1() - initP256r1() - initP384r1() - initP512r1() -} - -func initP256t1() { - p256t1 = &elliptic.CurveParams{Name: "brainpoolP256t1"} - p256t1.P, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", 16) - p256t1.N, _ = new(big.Int).SetString("A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 16) - p256t1.B, _ = new(big.Int).SetString("662C61C430D84EA4FE66A7733D0B76B7BF93EBC4AF2F49256AE58101FEE92B04", 16) - p256t1.Gx, _ = new(big.Int).SetString("A3E8EB3CC1CFE7B7732213B23A656149AFA142C47AAFBC2B79A191562E1305F4", 16) - p256t1.Gy, _ = new(big.Int).SetString("2D996C823439C56D7F7B22E14644417E69BCB6DE39D027001DABE8F35B25C9BE", 16) - p256t1.BitSize = 256 -} - -func initP256r1() { - twisted := p256t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP256r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", 16) - params.Gy, _ = new(big.Int).SetString("547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", 16) - z, _ := new(big.Int).SetString("3E2D4BD9597B58639AE7AA669CAB9837CF5CF20A2C852D10F655668DFC150EF0", 16) - p256r1 = newrcurve(twisted, params, z) -} - -func initP384t1() { - p384t1 = &elliptic.CurveParams{Name: "brainpoolP384t1"} - p384t1.P, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", 16) - p384t1.N, _ = new(big.Int).SetString("8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 16) - p384t1.B, _ = new(big.Int).SetString("7F519EADA7BDA81BD826DBA647910F8C4B9346ED8CCDC64E4B1ABD11756DCE1D2074AA263B88805CED70355A33B471EE", 16) - p384t1.Gx, _ = new(big.Int).SetString("18DE98B02DB9A306F2AFCD7235F72A819B80AB12EBD653172476FECD462AABFFC4FF191B946A5F54D8D0AA2F418808CC", 16) - p384t1.Gy, _ = new(big.Int).SetString("25AB056962D30651A114AFD2755AD336747F93475B7A1FCA3B88F2B6A208CCFE469408584DC2B2912675BF5B9E582928", 16) - p384t1.BitSize = 384 -} - -func initP384r1() { - twisted := p384t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP384r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", 16) - params.Gy, _ = new(big.Int).SetString("8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", 16) - z, _ := new(big.Int).SetString("41DFE8DD399331F7166A66076734A89CD0D2BCDB7D068E44E1F378F41ECBAE97D2D63DBC87BCCDDCCC5DA39E8589291C", 16) - p384r1 = newrcurve(twisted, params, z) -} - -func initP512t1() { - p512t1 = &elliptic.CurveParams{Name: "brainpoolP512t1"} - p512t1.P, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", 16) - p512t1.N, _ = new(big.Int).SetString("AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 16) - p512t1.B, _ = new(big.Int).SetString("7CBBBCF9441CFAB76E1890E46884EAE321F70C0BCB4981527897504BEC3E36A62BCDFA2304976540F6450085F2DAE145C22553B465763689180EA2571867423E", 16) - p512t1.Gx, _ = new(big.Int).SetString("640ECE5C12788717B9C1BA06CBC2A6FEBA85842458C56DDE9DB1758D39C0313D82BA51735CDB3EA499AA77A7D6943A64F7A3F25FE26F06B51BAA2696FA9035DA", 16) - p512t1.Gy, _ = new(big.Int).SetString("5B534BD595F5AF0FA2C892376C84ACE1BB4E3019B71634C01131159CAE03CEE9D9932184BEEF216BD71DF2DADF86A627306ECFF96DBB8BACE198B61E00F8B332", 16) - p512t1.BitSize = 512 -} - -func initP512r1() { - twisted := p512t1 - params := &elliptic.CurveParams{ - Name: "brainpoolP512r1", - P: twisted.P, - N: twisted.N, - BitSize: twisted.BitSize, - } - params.Gx, _ = new(big.Int).SetString("81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", 16) - params.Gy, _ = new(big.Int).SetString("7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", 16) - z, _ := new(big.Int).SetString("12EE58E6764838B69782136F0F2D3BA06E27695716054092E60A80BEDB212B64E585D90BCE13761F85C3F1D2A64E3BE8FEA2220F01EBA5EEB0F35DBD29D922AB", 16) - p512r1 = newrcurve(twisted, params, z) -} - -// P256t1 returns a Curve which implements Brainpool P256t1 (see RFC 5639, section 3.4) -func P256t1() elliptic.Curve { - once.Do(initAll) - return p256t1 -} - -// P256r1 returns a Curve which implements Brainpool P256r1 (see RFC 5639, section 3.4) -func P256r1() elliptic.Curve { - once.Do(initAll) - return p256r1 -} - -// P384t1 returns a Curve which implements Brainpool P384t1 (see RFC 5639, section 3.6) -func P384t1() elliptic.Curve { - once.Do(initAll) - return p384t1 -} - -// P384r1 returns a Curve which implements Brainpool P384r1 (see RFC 5639, section 3.6) -func P384r1() elliptic.Curve { - once.Do(initAll) - return p384r1 -} - -// P512t1 returns a Curve which implements Brainpool P512t1 (see RFC 5639, section 3.7) -func P512t1() elliptic.Curve { - once.Do(initAll) - return p512t1 -} - -// P512r1 returns a Curve which implements Brainpool P512r1 (see RFC 5639, section 3.7) -func P512r1() elliptic.Curve { - once.Do(initAll) - return p512r1 -} diff --git a/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go b/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go deleted file mode 100644 index 7e291d6aa4..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/brainpool/rcurve.go +++ /dev/null @@ -1,83 +0,0 @@ -package brainpool - -import ( - "crypto/elliptic" - "math/big" -) - -var _ elliptic.Curve = (*rcurve)(nil) - -type rcurve struct { - twisted elliptic.Curve - params *elliptic.CurveParams - z *big.Int - zinv *big.Int - z2 *big.Int - z3 *big.Int - zinv2 *big.Int - zinv3 *big.Int -} - -var ( - two = big.NewInt(2) - three = big.NewInt(3) -) - -func newrcurve(twisted elliptic.Curve, params *elliptic.CurveParams, z *big.Int) *rcurve { - zinv := new(big.Int).ModInverse(z, params.P) - return &rcurve{ - twisted: twisted, - params: params, - z: z, - zinv: zinv, - z2: new(big.Int).Exp(z, two, params.P), - z3: new(big.Int).Exp(z, three, params.P), - zinv2: new(big.Int).Exp(zinv, two, params.P), - zinv3: new(big.Int).Exp(zinv, three, params.P), - } -} - -func (curve *rcurve) toTwisted(x, y *big.Int) (*big.Int, *big.Int) { - var tx, ty big.Int - tx.Mul(x, curve.z2) - tx.Mod(&tx, curve.params.P) - ty.Mul(y, curve.z3) - ty.Mod(&ty, curve.params.P) - return &tx, &ty -} - -func (curve *rcurve) fromTwisted(tx, ty *big.Int) (*big.Int, *big.Int) { - var x, y big.Int - x.Mul(tx, curve.zinv2) - x.Mod(&x, curve.params.P) - y.Mul(ty, curve.zinv3) - y.Mod(&y, curve.params.P) - return &x, &y -} - -func (curve *rcurve) Params() *elliptic.CurveParams { - return curve.params -} - -func (curve *rcurve) IsOnCurve(x, y *big.Int) bool { - return curve.twisted.IsOnCurve(curve.toTwisted(x, y)) -} - -func (curve *rcurve) Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int) { - tx1, ty1 := curve.toTwisted(x1, y1) - tx2, ty2 := curve.toTwisted(x2, y2) - return curve.fromTwisted(curve.twisted.Add(tx1, ty1, tx2, ty2)) -} - -func (curve *rcurve) Double(x1, y1 *big.Int) (x, y *big.Int) { - return curve.fromTwisted(curve.twisted.Double(curve.toTwisted(x1, y1))) -} - -func (curve *rcurve) ScalarMult(x1, y1 *big.Int, scalar []byte) (x, y *big.Int) { - tx1, ty1 := curve.toTwisted(x1, y1) - return curve.fromTwisted(curve.twisted.ScalarMult(tx1, ty1, scalar)) -} - -func (curve *rcurve) ScalarBaseMult(scalar []byte) (x, y *big.Int) { - return curve.fromTwisted(curve.twisted.ScalarBaseMult(scalar)) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/eax.go b/vendor/github.com/ProtonMail/go-crypto/eax/eax.go deleted file mode 100644 index 3ae91d594c..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/eax/eax.go +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -// Package eax provides an implementation of the EAX -// (encrypt-authenticate-translate) mode of operation, as described in -// Bellare, Rogaway, and Wagner "THE EAX MODE OF OPERATION: A TWO-PASS -// AUTHENTICATED-ENCRYPTION SCHEME OPTIMIZED FOR SIMPLICITY AND EFFICIENCY." -// In FSE'04, volume 3017 of LNCS, 2004 -package eax - -import ( - "crypto/cipher" - "crypto/subtle" - "errors" - "github.com/ProtonMail/go-crypto/internal/byteutil" -) - -const ( - defaultTagSize = 16 - defaultNonceSize = 16 -) - -type eax struct { - block cipher.Block // Only AES-{128, 192, 256} supported - tagSize int // At least 12 bytes recommended - nonceSize int -} - -func (e *eax) NonceSize() int { - return e.nonceSize -} - -func (e *eax) Overhead() int { - return e.tagSize -} - -// NewEAX returns an EAX instance with AES-{KEYLENGTH} and default nonce and -// tag lengths. Supports {128, 192, 256}- bit key length. -func NewEAX(block cipher.Block) (cipher.AEAD, error) { - return NewEAXWithNonceAndTagSize(block, defaultNonceSize, defaultTagSize) -} - -// NewEAXWithNonceAndTagSize returns an EAX instance with AES-{keyLength} and -// given nonce and tag lengths in bytes. Panics on zero nonceSize and -// exceedingly long tags. -// -// It is recommended to use at least 12 bytes as tag length (see, for instance, -// NIST SP 800-38D). -// -// Only to be used for compatibility with existing cryptosystems with -// non-standard parameters. For all other cases, prefer NewEAX. -func NewEAXWithNonceAndTagSize( - block cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error) { - if nonceSize < 1 { - return nil, eaxError("Cannot initialize EAX with nonceSize = 0") - } - if tagSize > block.BlockSize() { - return nil, eaxError("Custom tag length exceeds blocksize") - } - return &eax{ - block: block, - tagSize: tagSize, - nonceSize: nonceSize, - }, nil -} - -func (e *eax) Seal(dst, nonce, plaintext, adata []byte) []byte { - if len(nonce) > e.nonceSize { - panic("crypto/eax: Nonce too long for this instance") - } - ret, out := byteutil.SliceForAppend(dst, len(plaintext)+e.tagSize) - omacNonce := e.omacT(0, nonce) - omacAdata := e.omacT(1, adata) - - // Encrypt message using CTR mode and omacNonce as IV - ctr := cipher.NewCTR(e.block, omacNonce) - ciphertextData := out[:len(plaintext)] - ctr.XORKeyStream(ciphertextData, plaintext) - - omacCiphertext := e.omacT(2, ciphertextData) - - tag := out[len(plaintext):] - for i := 0; i < e.tagSize; i++ { - tag[i] = omacCiphertext[i] ^ omacNonce[i] ^ omacAdata[i] - } - return ret -} - -func (e *eax) Open(dst, nonce, ciphertext, adata []byte) ([]byte, error) { - if len(nonce) > e.nonceSize { - panic("crypto/eax: Nonce too long for this instance") - } - if len(ciphertext) < e.tagSize { - return nil, eaxError("Ciphertext shorter than tag length") - } - sep := len(ciphertext) - e.tagSize - - // Compute tag - omacNonce := e.omacT(0, nonce) - omacAdata := e.omacT(1, adata) - omacCiphertext := e.omacT(2, ciphertext[:sep]) - - tag := make([]byte, e.tagSize) - for i := 0; i < e.tagSize; i++ { - tag[i] = omacCiphertext[i] ^ omacNonce[i] ^ omacAdata[i] - } - - // Compare tags - if subtle.ConstantTimeCompare(ciphertext[sep:], tag) != 1 { - return nil, eaxError("Tag authentication failed") - } - - // Decrypt ciphertext - ret, out := byteutil.SliceForAppend(dst, len(ciphertext)) - ctr := cipher.NewCTR(e.block, omacNonce) - ctr.XORKeyStream(out, ciphertext[:sep]) - - return ret[:sep], nil -} - -// Tweakable OMAC - Calls OMAC_K([t]_n || plaintext) -func (e *eax) omacT(t byte, plaintext []byte) []byte { - blockSize := e.block.BlockSize() - byteT := make([]byte, blockSize) - byteT[blockSize-1] = t - concat := append(byteT, plaintext...) - return e.omac(concat) -} - -func (e *eax) omac(plaintext []byte) []byte { - blockSize := e.block.BlockSize() - // L ← E_K(0^n); B ← 2L; P ← 4L - L := make([]byte, blockSize) - e.block.Encrypt(L, L) - B := byteutil.GfnDouble(L) - P := byteutil.GfnDouble(B) - - // CBC with IV = 0 - cbc := cipher.NewCBCEncrypter(e.block, make([]byte, blockSize)) - padded := e.pad(plaintext, B, P) - cbcCiphertext := make([]byte, len(padded)) - cbc.CryptBlocks(cbcCiphertext, padded) - - return cbcCiphertext[len(cbcCiphertext)-blockSize:] -} - -func (e *eax) pad(plaintext, B, P []byte) []byte { - // if |M| in {n, 2n, 3n, ...} - blockSize := e.block.BlockSize() - if len(plaintext) != 0 && len(plaintext)%blockSize == 0 { - return byteutil.RightXor(plaintext, B) - } - - // else return (M || 1 || 0^(n−1−(|M| % n))) xor→ P - ending := make([]byte, blockSize-len(plaintext)%blockSize) - ending[0] = 0x80 - padded := append(plaintext, ending...) - return byteutil.RightXor(padded, P) -} - -func eaxError(err string) error { - return errors.New("crypto/eax: " + err) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go b/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go deleted file mode 100644 index ddb53d0790..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/eax/eax_test_vectors.go +++ /dev/null @@ -1,58 +0,0 @@ -package eax - -// Test vectors from -// https://web.cs.ucdavis.edu/~rogaway/papers/eax.pdf -var testVectors = []struct { - msg, key, nonce, header, ciphertext string -}{ - {"", - "233952DEE4D5ED5F9B9C6D6FF80FF478", - "62EC67F9C3A4A407FCB2A8C49031A8B3", - "6BFB914FD07EAE6B", - "E037830E8389F27B025A2D6527E79D01"}, - {"F7FB", - "91945D3F4DCBEE0BF45EF52255F095A4", - "BECAF043B0A23D843194BA972C66DEBD", - "FA3BFD4806EB53FA", - "19DD5C4C9331049D0BDAB0277408F67967E5"}, - {"1A47CB4933", - "01F74AD64077F2E704C0F60ADA3DD523", - "70C3DB4F0D26368400A10ED05D2BFF5E", - "234A3463C1264AC6", - "D851D5BAE03A59F238A23E39199DC9266626C40F80"}, - {"481C9E39B1", - "D07CF6CBB7F313BDDE66B727AFD3C5E8", - "8408DFFF3C1A2B1292DC199E46B7D617", - "33CCE2EABFF5A79D", - "632A9D131AD4C168A4225D8E1FF755939974A7BEDE"}, - {"40D0C07DA5E4", - "35B6D0580005BBC12B0587124557D2C2", - "FDB6B06676EEDC5C61D74276E1F8E816", - "AEB96EAEBE2970E9", - "071DFE16C675CB0677E536F73AFE6A14B74EE49844DD"}, - {"4DE3B35C3FC039245BD1FB7D", - "BD8E6E11475E60B268784C38C62FEB22", - "6EAC5C93072D8E8513F750935E46DA1B", - "D4482D1CA78DCE0F", - "835BB4F15D743E350E728414ABB8644FD6CCB86947C5E10590210A4F"}, - {"8B0A79306C9CE7ED99DAE4F87F8DD61636", - "7C77D6E813BED5AC98BAA417477A2E7D", - "1A8C98DCD73D38393B2BF1569DEEFC19", - "65D2017990D62528", - "02083E3979DA014812F59F11D52630DA30137327D10649B0AA6E1C181DB617D7F2"}, - {"1BDA122BCE8A8DBAF1877D962B8592DD2D56", - "5FFF20CAFAB119CA2FC73549E20F5B0D", - "DDE59B97D722156D4D9AFF2BC7559826", - "54B9F04E6A09189A", - "2EC47B2C4954A489AFC7BA4897EDCDAE8CC33B60450599BD02C96382902AEF7F832A"}, - {"6CF36720872B8513F6EAB1A8A44438D5EF11", - "A4A4782BCFFD3EC5E7EF6D8C34A56123", - "B781FCF2F75FA5A8DE97A9CA48E522EC", - "899A175897561D7E", - "0DE18FD0FDD91E7AF19F1D8EE8733938B1E8E7F6D2231618102FDB7FE55FF1991700"}, - {"CA40D7446E545FFAED3BD12A740A659FFBBB3CEAB7", - "8395FCF1E95BEBD697BD010BC766AAC3", - "22E7ADD93CFC6393C57EC0B3C17D6B44", - "126735FCC320D25A", - "CB8920F87A6C75CFF39627B56E3ED197C552D295A7CFC46AFC253B4652B1AF3795B124AB6E"}, -} diff --git a/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go b/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go deleted file mode 100644 index 4eb19f28d9..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/eax/random_vectors.go +++ /dev/null @@ -1,131 +0,0 @@ -// These vectors include key length in {128, 192, 256}, tag size 128, and -// random nonce, header, and plaintext lengths. - -// This file was automatically generated. - -package eax - -var randomVectors = []struct { - key, nonce, header, plaintext, ciphertext string -}{ - {"DFDE093F36B0356E5A81F609786982E3", - "1D8AC604419001816905BA72B14CED7E", - "152A1517A998D7A24163FCDD146DE81AC347C8B97088F502093C1ABB8F6E33D9A219C34D7603A18B1F5ABE02E56661B7D7F67E81EC08C1302EF38D80A859486D450E94A4F26AD9E68EEBBC0C857A0FC5CF9E641D63D565A7E361BC8908F5A8DC8FD6", - "1C8EAAB71077FE18B39730A3156ADE29C5EE824C7EE86ED2A253B775603FB237116E654F6FEC588DD27F523A0E01246FE73FE348491F2A8E9ABC6CA58D663F71CDBCF4AD798BE46C42AE6EE8B599DB44A1A48D7BBBBA0F7D2750181E1C5E66967F7D57CBD30AFBDA5727", - "79E7E150934BBEBF7013F61C60462A14D8B15AF7A248AFB8A344EF021C1500E16666891D6E973D8BB56B71A371F12CA34660C4410C016982B20F547E3762A58B7BF4F20236CADCF559E2BE7D783B13723B2741FC7CDC8997D839E39A3DDD2BADB96743DD7049F1BDB0516A262869915B3F70498AFB7B191BF960"}, - {"F10619EF02E5D94D7550EB84ED364A21", - "8DC0D4F2F745BBAE835CC5574B942D20", - "FE561358F2E8DF7E1024FF1AE9A8D36EBD01352214505CB99D644777A8A1F6027FA2BDBFC529A9B91136D5F2416CFC5F0F4EC3A1AFD32BDDA23CA504C5A5CB451785FABF4DFE4CD50D817491991A60615B30286361C100A95D1712F2A45F8E374461F4CA2B", - "D7B5A971FC219631D30EFC3664AE3127D9CF3097DAD9C24AC7905D15E8D9B25B026B31D68CAE00975CDB81EB1FD96FD5E1A12E2BB83FA25F1B1D91363457657FC03875C27F2946C5", - "2F336ED42D3CC38FC61660C4CD60BA4BD438B05F5965D8B7B399D2E7167F5D34F792D318F94DB15D67463AC449E13D568CC09BFCE32A35EE3EE96A041927680AE329811811E27F2D1E8E657707AF99BA96D13A478D695D59"}, - {"429F514EFC64D98A698A9247274CFF45", - "976AA5EB072F912D126ACEBC954FEC38", - "A71D89DC5B6CEDBB7451A27C3C2CAE09126DB4C421", - "5632FE62AB1DC549D54D3BC3FC868ACCEDEFD9ECF5E9F8", - "848AE4306CA8C7F416F8707625B7F55881C0AB430353A5C967CDA2DA787F581A70E34DBEBB2385"}, - {"398138F309085F47F8457CDF53895A63", - "F8A8A7F2D28E5FFF7BBC2F24353F7A36", - "5D633C21BA7764B8855CAB586F3746E236AD486039C83C6B56EFA9C651D38A41D6B20DAEE3418BFEA44B8BD6", - "A3BBAA91920AF5E10659818B1B3B300AC79BFC129C8329E75251F73A66D3AE0128EB91D5031E0A65C329DB7D1E9C0493E268", - "D078097267606E5FB07CFB7E2B4B718172A82C6A4CEE65D549A4DFB9838003BD2FBF64A7A66988AC1A632FD88F9E9FBB57C5A78AD2E086EACBA3DB68511D81C2970A"}, - {"7A4151EBD3901B42CBA45DAFB2E931BA", - "0FC88ACEE74DD538040321C330974EB8", - "250464FB04733BAB934C59E6AD2D6AE8D662CBCFEFBE61E5A308D4211E58C4C25935B72C69107722E946BFCBF416796600542D76AEB73F2B25BF53BAF97BDEB36ED3A7A51C31E7F170EB897457E7C17571D1BA0A908954E9", - "88C41F3EBEC23FAB8A362D969CAC810FAD4F7CA6A7F7D0D44F060F92E37E1183768DD4A8C733F71C96058D362A39876D183B86C103DE", - "74A25B2182C51096D48A870D80F18E1CE15867778E34FCBA6BD7BFB3739FDCD42AD0F2D9F4EBA29085285C6048C15BCE5E5166F1F962D3337AA88E6062F05523029D0A7F0BF9"}, - {"BFB147E1CD5459424F8C0271FC0E0DC5", - "EABCC126442BF373969EA3015988CC45", - "4C0880E1D71AA2C7", - "BE1B5EC78FBF73E7A6682B21BA7E0E5D2D1C7ABE", - "5660D7C1380E2F306895B1402CB2D6C37876504276B414D120F4CF92FDDDBB293A238EA0"}, - {"595DD6F52D18BC2CA8EB4EDAA18D9FA3", - "0F84B5D36CF4BC3B863313AF3B4D2E97", - "30AE6CC5F99580F12A779D98BD379A60948020C0B6FBD5746B30BA3A15C6CD33DAF376C70A9F15B6C0EB410A93161F7958AE23", - "8EF3687A1642B070970B0B91462229D1D76ABC154D18211F7152AA9FF368", - "317C1DDB11417E5A9CC4DDE7FDFF6659A5AC4B31DE025212580A05CDAC6024D3E4AE7C2966E52B9129E9ECDBED86"}, - {"44E6F2DC8FDC778AD007137D11410F50", - "270A237AD977F7187AA6C158A0BAB24F", - "509B0F0EB12E2AA5C5BA2DE553C07FAF4CE0C9E926531AA709A3D6224FCB783ACCF1559E10B1123EBB7D52E8AB54E6B5352A9ED0D04124BF0E9D9BACFD7E32B817B2E625F5EE94A64EDE9E470DE7FE6886C19B294F9F828209FE257A78", - "8B3D7815DF25618A5D0C55A601711881483878F113A12EC36CF64900549A3199555528559DC118F789788A55FAFD944E6E99A9CA3F72F238CD3F4D88223F7A745992B3FAED1848", - "1CC00D79F7AD82FDA71B58D286E5F34D0CC4CEF30704E771CC1E50746BDF83E182B078DB27149A42BAE619DF0F85B0B1090AD55D3B4471B0D6F6ECCD09C8F876B30081F0E7537A9624F8AAF29DA85E324122EFB4D68A56"}, - {"BB7BC352A03044B4428D8DBB4B0701FDEC4649FD17B81452", - "8B4BBE26CCD9859DCD84884159D6B0A4", - "2212BEB0E78E0F044A86944CF33C8D5C80D9DBE1034BF3BCF73611835C7D3A52F5BD2D81B68FD681B68540A496EE5DA16FD8AC8824E60E1EC2042BE28FB0BFAD4E4B03596446BDD8C37D936D9B3D5295BE19F19CF5ACE1D33A46C952CE4DE5C12F92C1DD051E04AEED", - "9037234CC44FFF828FABED3A7084AF40FA7ABFF8E0C0EFB57A1CC361E18FC4FAC1AB54F3ABFE9FF77263ACE16C3A", - "A9391B805CCD956081E0B63D282BEA46E7025126F1C1631239C33E92AA6F92CD56E5A4C56F00FF9658E93D48AF4EF0EF81628E34AD4DB0CDAEDCD2A17EE7"}, - {"99C0AD703196D2F60A74E6B378B838B31F82EA861F06FC4E", - "92745C018AA708ECFEB1667E9F3F1B01", - "828C69F376C0C0EC651C67749C69577D589EE39E51404D80EBF70C8660A8F5FD375473F4A7C611D59CB546A605D67446CE2AA844135FCD78BB5FBC90222A00D42920BB1D7EEDFB0C4672554F583EF23184F89063CDECBE482367B5F9AF3ACBC3AF61392BD94CBCD9B64677", - "A879214658FD0A5B0E09836639BF82E05EC7A5EF71D4701934BDA228435C68AC3D5CEB54997878B06A655EEACEFB1345C15867E7FE6C6423660C8B88DF128EBD6BCD85118DBAE16E9252FFB204324E5C8F38CA97759BDBF3CB0083", - "51FE87996F194A2585E438B023B345439EA60D1AEBED4650CDAF48A4D4EEC4FC77DC71CC4B09D3BEEF8B7B7AF716CE2B4EFFB3AC9E6323C18AC35E0AA6E2BBBC8889490EB6226C896B0D105EAB42BFE7053CCF00ED66BA94C1BA09A792AA873F0C3B26C5C5F9A936E57B25"}, - {"7086816D00D648FB8304AA8C9E552E1B69A9955FB59B25D1", - "0F45CF7F0BF31CCEB85D9DA10F4D749F", - "93F27C60A417D9F0669E86ACC784FC8917B502DAF30A6338F11B30B94D74FEFE2F8BE1BBE2EAD10FAB7EED3C6F72B7C3ECEE1937C32ED4970A6404E139209C05", - "877F046601F3CBE4FB1491943FA29487E738F94B99AF206262A1D6FF856C9AA0B8D4D08A54370C98F8E88FA3DCC2B14C1F76D71B2A4C7963AEE8AF960464C5BEC8357AD00DC8", - "FE96906B895CE6A8E72BC72344E2C8BB3C63113D70EAFA26C299BAFE77A8A6568172EB447FB3E86648A0AF3512DEB1AAC0819F3EC553903BF28A9FB0F43411237A774BF9EE03E445D280FBB9CD12B9BAAB6EF5E52691"}, - {"062F65A896D5BF1401BADFF70E91B458E1F9BD4888CB2E4D", - "5B11EA1D6008EBB41CF892FCA5B943D1", - "BAF4FF5C8242", - "A8870E091238355984EB2F7D61A865B9170F440BFF999A5993DD41A10F4440D21FF948DDA2BF663B2E03AC3324492DC5E40262ECC6A65C07672353BE23E7FB3A9D79FF6AA38D97960905A38DECC312CB6A59E5467ECF06C311CD43ADC0B543EDF34FE8BE611F176460D5627CA51F8F8D9FED71F55C", - "B10E127A632172CF8AA7539B140D2C9C2590E6F28C3CB892FC498FCE56A34F732FBFF32E79C7B9747D9094E8635A0C084D6F0247F9768FB5FF83493799A9BEC6C39572120C40E9292C8C947AE8573462A9108C36D9D7112E6995AE5867E6C8BB387D1C5D4BEF524F391B9FD9F0A3B4BFA079E915BCD920185CFD38D114C558928BD7D47877"}, - {"38A8E45D6D705A11AF58AED5A1344896998EACF359F2E26A", - "FD82B5B31804FF47D44199B533D0CF84", - "DE454D4E62FE879F2050EE3E25853623D3E9AC52EEC1A1779A48CFAF5ECA0BFDE44749391866D1", - "B804", - "164BB965C05EBE0931A1A63293EDF9C38C27"}, - {"34C33C97C6D7A0850DA94D78A58DC61EC717CD7574833068", - "343BE00DA9483F05C14F2E9EB8EA6AE8", - "78312A43EFDE3CAE34A65796FF059A3FE15304EEA5CF1D9306949FE5BF3349D4977D4EBE76C040FE894C5949E4E4D6681153DA87FB9AC5062063CA2EA183566343362370944CE0362D25FC195E124FD60E8682E665D13F2229DDA3E4B2CB1DCA", - "CC11BB284B1153578E4A5ED9D937B869DAF00F5B1960C23455CA9CC43F486A3BE0B66254F1041F04FDF459C8640465B6E1D2CF899A381451E8E7FCB50CF87823BE77E24B132BBEEDC72E53369B275E1D8F49ECE59F4F215230AC4FE133FC80E4F634EE80BA4682B62C86", - "E7F703DC31A95E3A4919FF957836CB76C063D81702AEA4703E1C2BF30831E58C4609D626EC6810E12EAA5B930F049FF9EFC22C3E3F1EBD4A1FB285CB02A1AC5AD46B425199FC0A85670A5C4E3DAA9636C8F64C199F42F18AAC8EA7457FD377F322DD7752D7D01B946C8F0A97E6113F0D50106F319AFD291AAACE"}, - {"C6ECF7F053573E403E61B83052A343D93CBCC179D1E835BE", - "E280E13D7367042E3AA09A80111B6184", - "21486C9D7A9647", - "5F2639AFA6F17931853791CD8C92382BBB677FD72D0AB1A080D0E49BFAA21810E963E4FACD422E92F65CBFAD5884A60CD94740DF31AF02F95AA57DA0C4401B0ED906", - "5C51DB20755302070C45F52E50128A67C8B2E4ED0EACB7E29998CCE2E8C289DD5655913EC1A51CC3AABE5CDC2402B2BE7D6D4BF6945F266FBD70BA9F37109067157AE7530678B45F64475D4EBFCB5FFF46A5"}, - {"5EC6CF7401BC57B18EF154E8C38ACCA8959E57D2F3975FF5", - "656B41CB3F9CF8C08BAD7EBFC80BD225", - "6B817C2906E2AF425861A7EF59BA5801F143EE2A139EE72697CDE168B4", - "2C0E1DDC9B1E5389BA63845B18B1F8A1DB062037151BCC56EF7C21C0BB4DAE366636BBA975685D7CC5A94AFBE89C769016388C56FB7B57CE750A12B718A8BDCF70E80E8659A8330EFC8F86640F21735E8C80E23FE43ABF23507CE3F964AE4EC99D", - "ED780CF911E6D1AA8C979B889B0B9DC1ABE261832980BDBFB576901D9EF5AB8048998E31A15BE54B3E5845A4D136AD24D0BDA1C3006168DF2F8AC06729CB0818867398150020131D8F04EDF1923758C9EABB5F735DE5EA1758D4BC0ACFCA98AFD202E9839B8720253693B874C65586C6F0"}, - {"C92F678EB2208662F5BCF3403EC05F5961E957908A3E79421E1D25FC19054153", - "DA0F3A40983D92F2D4C01FED33C7A192", - "2B6E9D26DB406A0FAB47608657AA10EFC2B4AA5F459B29FF85AC9A40BFFE7AEB04F77E9A11FAAA116D7F6D4DA417671A9AB02C588E0EF59CB1BFB4B1CC931B63A3B3A159FCEC97A04D1E6F0C7E6A9CEF6B0ABB04758A69F1FE754DF4C2610E8C46B6CF413BDB31351D55BEDCB7B4A13A1C98E10984475E0F2F957853", - "F37326A80E08", - "83519E53E321D334F7C10B568183775C0E9AAE55F806"}, - {"6847E0491BE57E72995D186D50094B0B3593957A5146798FCE68B287B2FB37B5", - "3EE1182AEBB19A02B128F28E1D5F7F99", - "D9F35ABB16D776CE", - "DB7566ED8EA95BDF837F23DB277BAFBC5E70D1105ADFD0D9EF15475051B1EF94709C67DCA9F8D5", - "2CDCED0C9EBD6E2A508822A685F7DCD1CDD99E7A5FCA786C234E7F7F1D27EC49751AD5DCFA30C5EDA87C43CAE3B919B6BBCFE34C8EDA59"}, - {"82B019673642C08388D3E42075A4D5D587558C229E4AB8F660E37650C4C41A0A", - "336F5D681E0410FAE7B607246092C6DC", - "D430CBD8FE435B64214E9E9CDC5DE99D31CFCFB8C10AA0587A49DF276611", - "998404153AD77003E1737EDE93ED79859EE6DCCA93CB40C4363AA817ABF2DBBD46E42A14A7183B6CC01E12A577888141363D0AE011EB6E8D28C0B235", - "9BEF69EEB60BD3D6065707B7557F25292A8872857CFBD24F2F3C088E4450995333088DA50FD9121221C504DF1D0CD5EFE6A12666C5D5BB12282CF4C19906E9CFAB97E9BDF7F49DC17CFC384B"}, - {"747B2E269B1859F0622C15C8BAD6A725028B1F94B8DB7326948D1E6ED663A8BC", - "AB91F7245DDCE3F1C747872D47BE0A8A", - "3B03F786EF1DDD76E1D42646DA4CD2A5165DC5383CE86D1A0B5F13F910DC278A4E451EE0192CBA178E13B3BA27FDC7840DF73D2E104B", - "6B803F4701114F3E5FE21718845F8416F70F626303F545BE197189E0A2BA396F37CE06D389EB2658BC7D56D67868708F6D0D32", - "1570DDB0BCE75AA25D1957A287A2C36B1A5F2270186DA81BA6112B7F43B0F3D1D0ED072591DCF1F1C99BBB25621FC39B896FF9BD9413A2845363A9DCD310C32CF98E57"}, - {"02E59853FB29AEDA0FE1C5F19180AD99A12FF2F144670BB2B8BADF09AD812E0A", - "C691294EF67CD04D1B9242AF83DD1421", - "879334DAE3", - "1E17F46A98FEF5CBB40759D95354", - "FED8C3FF27DDF6313AED444A2985B36CBA268AAD6AAC563C0BA28F6DB5DB"}, - {"F6C1FB9B4188F2288FF03BD716023198C3582CF2A037FC2F29760916C2B7FCDB", - "4228DA0678CA3534588859E77DFF014C", - "D8153CAF35539A61DD8D05B3C9B44F01E564FB9348BCD09A1C23B84195171308861058F0A3CD2A55B912A3AAEE06FF4D356C77275828F2157C2FC7C115DA39E443210CCC56BEDB0CC99BBFB227ABD5CC454F4E7F547C7378A659EEB6A7E809101A84F866503CB18D4484E1FA09B3EC7FC75EB2E35270800AA7", - "23B660A779AD285704B12EC1C580387A47BEC7B00D452C6570", - "5AA642BBABA8E49849002A2FAF31DB8FC7773EFDD656E469CEC19B3206D4174C9A263D0A05484261F6"}, - {"8FF6086F1FADB9A3FBE245EAC52640C43B39D43F89526BB5A6EBA47710931446", - "943188480C99437495958B0AE4831AA9", - "AD5CD0BDA426F6EBA23C8EB23DC73FF9FEC173355EDBD6C9344C4C4383F211888F7CE6B29899A6801DF6B38651A7C77150941A", - "80CD5EA8D7F81DDF5070B934937912E8F541A5301877528EB41AB60C020968D459960ED8FB73083329841A", - "ABAE8EB7F36FCA2362551E72DAC890BA1BB6794797E0FC3B67426EC9372726ED4725D379EA0AC9147E48DCD0005C502863C2C5358A38817C8264B5"}, - {"A083B54E6B1FE01B65D42FCD248F97BB477A41462BBFE6FD591006C022C8FD84", - "B0490F5BD68A52459556B3749ACDF40E", - "8892E047DA5CFBBDF7F3CFCBD1BD21C6D4C80774B1826999234394BD3E513CC7C222BB40E1E3140A152F19B3802F0D036C24A590512AD0E8", - "D7B15752789DC94ED0F36778A5C7BBB207BEC32BAC66E702B39966F06E381E090C6757653C3D26A81EC6AD6C364D66867A334C91BB0B8A8A4B6EACDF0783D09010AEBA2DD2062308FE99CC1F", - "C071280A732ADC93DF272BF1E613B2BB7D46FC6665EF2DC1671F3E211D6BDE1D6ADDD28DF3AA2E47053FC8BB8AE9271EC8BC8B2CFFA320D225B451685B6D23ACEFDD241FE284F8ADC8DB07F456985B14330BBB66E0FB212213E05B3E"}, -} diff --git a/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go b/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go deleted file mode 100644 index affb74a764..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/internal/byteutil/byteutil.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG -// This file contains necessary tools for the aex and ocb packages. -// -// These functions SHOULD NOT be used elsewhere, since they are optimized for -// specific input nature in the EAX and OCB modes of operation. - -package byteutil - -// GfnDouble computes 2 * input in the field of 2^n elements. -// The irreducible polynomial in the finite field for n=128 is -// x^128 + x^7 + x^2 + x + 1 (equals 0x87) -// Constant-time execution in order to avoid side-channel attacks -func GfnDouble(input []byte) []byte { - if len(input) != 16 { - panic("Doubling in GFn only implemented for n = 128") - } - // If the first bit is zero, return 2L = L << 1 - // Else return (L << 1) xor 0^120 10000111 - shifted := ShiftBytesLeft(input) - shifted[15] ^= ((input[0] >> 7) * 0x87) - return shifted -} - -// ShiftBytesLeft outputs the byte array corresponding to x << 1 in binary. -func ShiftBytesLeft(x []byte) []byte { - l := len(x) - dst := make([]byte, l) - for i := 0; i < l-1; i++ { - dst[i] = (x[i] << 1) | (x[i+1] >> 7) - } - dst[l-1] = x[l-1] << 1 - return dst -} - -// ShiftNBytesLeft puts in dst the byte array corresponding to x << n in binary. -func ShiftNBytesLeft(dst, x []byte, n int) { - // Erase first n / 8 bytes - copy(dst, x[n/8:]) - - // Shift the remaining n % 8 bits - bits := uint(n % 8) - l := len(dst) - for i := 0; i < l-1; i++ { - dst[i] = (dst[i] << bits) | (dst[i+1] >> uint(8-bits)) - } - dst[l-1] = dst[l-1] << bits - - // Append trailing zeroes - dst = append(dst, make([]byte, n/8)...) -} - -// XorBytesMut assumes equal input length, replaces X with X XOR Y -func XorBytesMut(X, Y []byte) { - for i := 0; i < len(X); i++ { - X[i] ^= Y[i] - } -} - -// XorBytes assumes equal input length, puts X XOR Y into Z -func XorBytes(Z, X, Y []byte) { - for i := 0; i < len(X); i++ { - Z[i] = X[i] ^ Y[i] - } -} - -// RightXor XORs smaller input (assumed Y) at the right of the larger input (assumed X) -func RightXor(X, Y []byte) []byte { - offset := len(X) - len(Y) - xored := make([]byte, len(X)) - copy(xored, X) - for i := 0; i < len(Y); i++ { - xored[offset+i] ^= Y[i] - } - return xored -} - -// SliceForAppend takes a slice and a requested number of bytes. It returns a -// slice with the contents of the given slice followed by that many bytes and a -// second slice that aliases into it and contains only the extra bytes. If the -// original slice has sufficient capacity then no allocation is performed. -func SliceForAppend(in []byte, n int) (head, tail []byte) { - if total := len(in) + n; cap(in) >= total { - head = in[:total] - } else { - head = make([]byte, total) - copy(head, in) - } - tail = head[len(in):] - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go b/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go deleted file mode 100644 index 1a6f73502e..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/ocb/ocb.go +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -// Package ocb provides an implementation of the OCB (offset codebook) mode of -// operation, as described in RFC-7253 of the IRTF and in Rogaway, Bellare, -// Black and Krovetz - OCB: A BLOCK-CIPHER MODE OF OPERATION FOR EFFICIENT -// AUTHENTICATED ENCRYPTION (2003). -// Security considerations (from RFC-7253): A private key MUST NOT be used to -// encrypt more than 2^48 blocks. Tag length should be at least 12 bytes (a -// brute-force forging adversary succeeds after 2^{tag length} attempts). A -// single key SHOULD NOT be used to decrypt ciphertext with different tag -// lengths. Nonces need not be secret, but MUST NOT be reused. -// This package only supports underlying block ciphers with 128-bit blocks, -// such as AES-{128, 192, 256}, but may be extended to other sizes. -package ocb - -import ( - "bytes" - "crypto/cipher" - "crypto/subtle" - "errors" - "github.com/ProtonMail/go-crypto/internal/byteutil" - "math/bits" -) - -type ocb struct { - block cipher.Block - tagSize int - nonceSize int - mask mask - // Optimized en/decrypt: For each nonce N used to en/decrypt, the 'Ktop' - // internal variable can be reused for en/decrypting with nonces sharing - // all but the last 6 bits with N. The prefix of the first nonce used to - // compute the new Ktop, and the Ktop value itself, are stored in - // reusableKtop. If using incremental nonces, this saves one block cipher - // call every 63 out of 64 OCB encryptions, and stores one nonce and one - // output of the block cipher in memory only. - reusableKtop reusableKtop -} - -type mask struct { - // L_*, L_$, (L_i)_{i ∈ N} - lAst []byte - lDol []byte - L [][]byte -} - -type reusableKtop struct { - noncePrefix []byte - Ktop []byte -} - -const ( - defaultTagSize = 16 - defaultNonceSize = 15 -) - -const ( - enc = iota - dec -) - -func (o *ocb) NonceSize() int { - return o.nonceSize -} - -func (o *ocb) Overhead() int { - return o.tagSize -} - -// NewOCB returns an OCB instance with the given block cipher and default -// tag and nonce sizes. -func NewOCB(block cipher.Block) (cipher.AEAD, error) { - return NewOCBWithNonceAndTagSize(block, defaultNonceSize, defaultTagSize) -} - -// NewOCBWithNonceAndTagSize returns an OCB instance with the given block -// cipher, nonce length, and tag length. Panics on zero nonceSize and -// exceedingly long tag size. -// -// It is recommended to use at least 12 bytes as tag length. -func NewOCBWithNonceAndTagSize( - block cipher.Block, nonceSize, tagSize int) (cipher.AEAD, error) { - if block.BlockSize() != 16 { - return nil, ocbError("Block cipher must have 128-bit blocks") - } - if nonceSize < 1 { - return nil, ocbError("Incorrect nonce length") - } - if nonceSize >= block.BlockSize() { - return nil, ocbError("Nonce length exceeds blocksize - 1") - } - if tagSize > block.BlockSize() { - return nil, ocbError("Custom tag length exceeds blocksize") - } - return &ocb{ - block: block, - tagSize: tagSize, - nonceSize: nonceSize, - mask: initializeMaskTable(block), - reusableKtop: reusableKtop{ - noncePrefix: nil, - Ktop: nil, - }, - }, nil -} - -func (o *ocb) Seal(dst, nonce, plaintext, adata []byte) []byte { - if len(nonce) > o.nonceSize { - panic("crypto/ocb: Incorrect nonce length given to OCB") - } - ret, out := byteutil.SliceForAppend(dst, len(plaintext)+o.tagSize) - o.crypt(enc, out, nonce, adata, plaintext) - return ret -} - -func (o *ocb) Open(dst, nonce, ciphertext, adata []byte) ([]byte, error) { - if len(nonce) > o.nonceSize { - panic("Nonce too long for this instance") - } - if len(ciphertext) < o.tagSize { - return nil, ocbError("Ciphertext shorter than tag length") - } - sep := len(ciphertext) - o.tagSize - ret, out := byteutil.SliceForAppend(dst, len(ciphertext)) - ciphertextData := ciphertext[:sep] - tag := ciphertext[sep:] - o.crypt(dec, out, nonce, adata, ciphertextData) - if subtle.ConstantTimeCompare(ret[sep:], tag) == 1 { - ret = ret[:sep] - return ret, nil - } - for i := range out { - out[i] = 0 - } - return nil, ocbError("Tag authentication failed") -} - -// On instruction enc (resp. dec), crypt is the encrypt (resp. decrypt) -// function. It returns the resulting plain/ciphertext with the tag appended. -func (o *ocb) crypt(instruction int, Y, nonce, adata, X []byte) []byte { - // - // Consider X as a sequence of 128-bit blocks - // - // Note: For encryption (resp. decryption), X is the plaintext (resp., the - // ciphertext without the tag). - blockSize := o.block.BlockSize() - - // - // Nonce-dependent and per-encryption variables - // - // Zero out the last 6 bits of the nonce into truncatedNonce to see if Ktop - // is already computed. - truncatedNonce := make([]byte, len(nonce)) - copy(truncatedNonce, nonce) - truncatedNonce[len(truncatedNonce)-1] &= 192 - Ktop := make([]byte, blockSize) - if bytes.Equal(truncatedNonce, o.reusableKtop.noncePrefix) { - Ktop = o.reusableKtop.Ktop - } else { - // Nonce = num2str(TAGLEN mod 128, 7) || zeros(120 - bitlen(N)) || 1 || N - paddedNonce := append(make([]byte, blockSize-1-len(nonce)), 1) - paddedNonce = append(paddedNonce, truncatedNonce...) - paddedNonce[0] |= byte(((8 * o.tagSize) % (8 * blockSize)) << 1) - // Last 6 bits of paddedNonce are already zero. Encrypt into Ktop - paddedNonce[blockSize-1] &= 192 - Ktop = paddedNonce - o.block.Encrypt(Ktop, Ktop) - o.reusableKtop.noncePrefix = truncatedNonce - o.reusableKtop.Ktop = Ktop - } - - // Stretch = Ktop || ((lower half of Ktop) XOR (lower half of Ktop << 8)) - xorHalves := make([]byte, blockSize/2) - byteutil.XorBytes(xorHalves, Ktop[:blockSize/2], Ktop[1:1+blockSize/2]) - stretch := append(Ktop, xorHalves...) - bottom := int(nonce[len(nonce)-1] & 63) - offset := make([]byte, len(stretch)) - byteutil.ShiftNBytesLeft(offset, stretch, bottom) - offset = offset[:blockSize] - - // - // Process any whole blocks - // - // Note: For encryption Y is ciphertext || tag, for decryption Y is - // plaintext || tag. - checksum := make([]byte, blockSize) - m := len(X) / blockSize - for i := 0; i < m; i++ { - index := bits.TrailingZeros(uint(i + 1)) - if len(o.mask.L)-1 < index { - o.mask.extendTable(index) - } - byteutil.XorBytesMut(offset, o.mask.L[bits.TrailingZeros(uint(i+1))]) - blockX := X[i*blockSize : (i+1)*blockSize] - blockY := Y[i*blockSize : (i+1)*blockSize] - byteutil.XorBytes(blockY, blockX, offset) - switch instruction { - case enc: - o.block.Encrypt(blockY, blockY) - byteutil.XorBytesMut(blockY, offset) - byteutil.XorBytesMut(checksum, blockX) - case dec: - o.block.Decrypt(blockY, blockY) - byteutil.XorBytesMut(blockY, offset) - byteutil.XorBytesMut(checksum, blockY) - } - } - // - // Process any final partial block and compute raw tag - // - tag := make([]byte, blockSize) - if len(X)%blockSize != 0 { - byteutil.XorBytesMut(offset, o.mask.lAst) - pad := make([]byte, blockSize) - o.block.Encrypt(pad, offset) - chunkX := X[blockSize*m:] - chunkY := Y[blockSize*m : len(X)] - byteutil.XorBytes(chunkY, chunkX, pad[:len(chunkX)]) - // P_* || bit(1) || zeroes(127) - len(P_*) - switch instruction { - case enc: - paddedY := append(chunkX, byte(128)) - paddedY = append(paddedY, make([]byte, blockSize-len(chunkX)-1)...) - byteutil.XorBytesMut(checksum, paddedY) - case dec: - paddedX := append(chunkY, byte(128)) - paddedX = append(paddedX, make([]byte, blockSize-len(chunkY)-1)...) - byteutil.XorBytesMut(checksum, paddedX) - } - byteutil.XorBytes(tag, checksum, offset) - byteutil.XorBytesMut(tag, o.mask.lDol) - o.block.Encrypt(tag, tag) - byteutil.XorBytesMut(tag, o.hash(adata)) - copy(Y[blockSize*m+len(chunkY):], tag[:o.tagSize]) - } else { - byteutil.XorBytes(tag, checksum, offset) - byteutil.XorBytesMut(tag, o.mask.lDol) - o.block.Encrypt(tag, tag) - byteutil.XorBytesMut(tag, o.hash(adata)) - copy(Y[blockSize*m:], tag[:o.tagSize]) - } - return Y -} - -// This hash function is used to compute the tag. Per design, on empty input it -// returns a slice of zeros, of the same length as the underlying block cipher -// block size. -func (o *ocb) hash(adata []byte) []byte { - // - // Consider A as a sequence of 128-bit blocks - // - A := make([]byte, len(adata)) - copy(A, adata) - blockSize := o.block.BlockSize() - - // - // Process any whole blocks - // - sum := make([]byte, blockSize) - offset := make([]byte, blockSize) - m := len(A) / blockSize - for i := 0; i < m; i++ { - chunk := A[blockSize*i : blockSize*(i+1)] - index := bits.TrailingZeros(uint(i + 1)) - // If the mask table is too short - if len(o.mask.L)-1 < index { - o.mask.extendTable(index) - } - byteutil.XorBytesMut(offset, o.mask.L[index]) - byteutil.XorBytesMut(chunk, offset) - o.block.Encrypt(chunk, chunk) - byteutil.XorBytesMut(sum, chunk) - } - - // - // Process any final partial block; compute final hash value - // - if len(A)%blockSize != 0 { - byteutil.XorBytesMut(offset, o.mask.lAst) - // Pad block with 1 || 0 ^ 127 - bitlength(a) - ending := make([]byte, blockSize-len(A)%blockSize) - ending[0] = 0x80 - encrypted := append(A[blockSize*m:], ending...) - byteutil.XorBytesMut(encrypted, offset) - o.block.Encrypt(encrypted, encrypted) - byteutil.XorBytesMut(sum, encrypted) - } - return sum -} - -func initializeMaskTable(block cipher.Block) mask { - // - // Key-dependent variables - // - lAst := make([]byte, block.BlockSize()) - block.Encrypt(lAst, lAst) - lDol := byteutil.GfnDouble(lAst) - L := make([][]byte, 1) - L[0] = byteutil.GfnDouble(lDol) - - return mask{ - lAst: lAst, - lDol: lDol, - L: L, - } -} - -// Extends the L array of mask m up to L[limit], with L[i] = GfnDouble(L[i-1]) -func (m *mask) extendTable(limit int) { - for i := len(m.L); i <= limit; i++ { - m.L = append(m.L, byteutil.GfnDouble(m.L[i-1])) - } -} - -func ocbError(err string) error { - return errors.New("crypto/ocb: " + err) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go b/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go deleted file mode 100644 index 0efaf344fd..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/ocb/random_vectors.go +++ /dev/null @@ -1,136 +0,0 @@ -// In the test vectors provided by RFC 7253, the "bottom" -// internal variable, which defines "offset" for the first time, does not -// exceed 15. However, it can attain values up to 63. - -// These vectors include key length in {128, 192, 256}, tag size 128, and -// random nonce, header, and plaintext lengths. - -// This file was automatically generated. - -package ocb - -var randomVectors = []struct { - key, nonce, header, plaintext, ciphertext string -}{ - - {"9438C5D599308EAF13F800D2D31EA7F0", - "C38EE4801BEBFFA1CD8635BE", - "0E507B7DADD8A98CDFE272D3CB6B3E8332B56AE583FB049C0874D4200BED16BD1A044182434E9DA0E841F182DFD5B3016B34641CED0784F1745F63AB3D0DA22D3351C9EF9A658B8081E24498EBF61FCE40DA6D8E184536", - "962D227786FB8913A8BAD5DC3250", - "EEDEF5FFA5986D1E3BF86DDD33EF9ADC79DCA06E215FA772CCBA814F63AD"}, - {"BA7DE631C7D6712167C6724F5B9A2B1D", - "35263EBDA05765DC0E71F1F5", - "0103257B4224507C0242FEFE821EA7FA42E0A82863E5F8B68F7D881B4B44FA428A2B6B21D2F591260802D8AB6D83", - "9D6D1FC93AE8A64E7889B7B2E3521EFA9B920A8DDB692E6F833DDC4A38AFA535E5E2A3ED82CB7E26404AB86C54D01C4668F28398C2DF33D5D561CBA1C8DCFA7A912F5048E545B59483C0E3221F54B14DAA2E4EB657B3BEF9554F34CAD69B2724AE962D3D8A", - "E93852D1985C5E775655E937FA79CE5BF28A585F2AF53A5018853B9634BE3C84499AC0081918FDCE0624494D60E25F76ACD6853AC7576E3C350F332249BFCABD4E73CEABC36BE4EDDA40914E598AE74174A0D7442149B26990899491BDDFE8FC54D6C18E83AE9E9A6FFBF5D376565633862EEAD88D"}, - {"2E74B25289F6FD3E578C24866E9C72A5", - "FD912F15025AF8414642BA1D1D", - "FB5FB8C26F365EEDAB5FE260C6E3CCD27806729C8335F146063A7F9EA93290E56CF84576EB446350D22AD730547C267B1F0BBB97EB34E1E2C41A", - "6C092EBF78F76EE8C1C6E592277D9545BA16EDB67BC7D8480B9827702DC2F8A129E2B08A2CE710CA7E1DA45CE162BB6CD4B512E632116E2211D3C90871EFB06B8D4B902681C7FB", - "6AC0A77F26531BF4F354A1737F99E49BE32ECD909A7A71AD69352906F54B08A9CE9B8CA5D724CBFFC5673437F23F630697F3B84117A1431D6FA8CC13A974FB4AD360300522E09511B99E71065D5AC4BBCB1D791E864EF4"}, - {"E7EC507C802528F790AFF5303A017B17", - "4B97A7A568940A9E3CE7A99E93031E", - "28349BDC5A09390C480F9B8AA3EDEA3DDB8B9D64BCA322C570B8225DF0E31190DAB25A4014BA39519E02ABFB12B89AA28BBFD29E486E7FB28734258C817B63CED9912DBAFEBB93E2798AB2890DE3B0ACFCFF906AB15563EF7823CE83D27CDB251195E22BD1337BCBDE65E7C2C427321C463C2777BFE5AEAA", - "9455B3EA706B74", - "7F33BA3EA848D48A96B9530E26888F43EBD4463C9399B6"}, - {"6C928AA3224736F28EE7378DE0090191", - "8936138E2E4C6A13280017A1622D", - "6202717F2631565BDCDC57C6584543E72A7C8BD444D0D108ED35069819633C", - "DA0691439E5F035F3E455269D14FE5C201C8C9B0A3FE2D3F86BCC59387C868FE65733D388360B31E3CE28B4BF6A8BE636706B536D5720DB66B47CF1C7A5AFD6F61E0EF90F1726D6B0E169F9A768B2B7AE4EE00A17F630AC905FCAAA1B707FFF25B3A1AAE83B504837C64A5639B2A34002B300EC035C9B43654DA55", - "B8804D182AB0F0EEB464FA7BD1329AD6154F982013F3765FEDFE09E26DAC078C9C1439BFC1159D6C02A25E3FF83EF852570117B315852AD5EE20E0FA3AA0A626B0E43BC0CEA38B44579DD36803455FB46989B90E6D229F513FD727AF8372517E9488384C515D6067704119C931299A0982EDDFB9C2E86A90C450C077EB222511EC9CCABC9FCFDB19F70088"}, - {"ECEA315CA4B3F425B0C9957A17805EA4", - "664CDAE18403F4F9BA13015A44FC", - "642AFB090D6C6DB46783F08B01A3EF2A8FEB5736B531EAC226E7888FCC8505F396818F83105065FACB3267485B9E5E4A0261F621041C08FCCB2A809A49AB5252A91D0971BCC620B9D614BD77E57A0EED2FA5", - "6852C31F8083E20E364CEA21BB7854D67CEE812FE1C9ED2425C0932A90D3780728D1BB", - "2ECEF962A9695A463ADABB275BDA9FF8B2BA57AEC2F52EFFB700CD9271A74D2A011C24AEA946051BD6291776429B7E681BA33E"}, - {"4EE616C4A58AAA380878F71A373461F6", - "91B8C9C176D9C385E9C47E52", - "CDA440B7F9762C572A718AC754EDEECC119E5EE0CCB9FEA4FFB22EEE75087C032EBF3DA9CDD8A28CC010B99ED45143B41A4BA50EA2A005473F89639237838867A57F23B0F0ED3BF22490E4501DAC9C658A9B9F", - "D6E645FA9AE410D15B8123FD757FA356A8DBE9258DDB5BE88832E615910993F497EC", - "B70ED7BF959FB2AAED4F36174A2A99BFB16992C8CDF369C782C4DB9C73DE78C5DB8E0615F647243B97ACDB24503BC9CADC48"}, - {"DCD475773136C830D5E3D0C5FE05B7FF", - "BB8E1FBB483BE7616A922C4A", - "36FEF2E1CB29E76A6EA663FC3AF66ECD7404F466382F7B040AABED62293302B56E8783EF7EBC21B4A16C3E78A7483A0A403F253A2CDC5BBF79DC3DAE6C73F39A961D8FBBE8D41B", - "441E886EA38322B2437ECA7DEB5282518865A66780A454E510878E61BFEC3106A3CD93D2A02052E6F9E1832F9791053E3B76BF4C07EFDD6D4106E3027FABB752E60C1AA425416A87D53938163817A1051EBA1D1DEEB4B9B25C7E97368B52E5911A31810B0EC5AF547559B6142D9F4C4A6EF24A4CF75271BF9D48F62B", - "1BE4DD2F4E25A6512C2CC71D24BBB07368589A94C2714962CD0ACE5605688F06342587521E75F0ACAFFD86212FB5C34327D238DB36CF2B787794B9A4412E7CD1410EA5DDD2450C265F29CF96013CD213FD2880657694D718558964BC189B4A84AFCF47EB012935483052399DBA5B088B0A0477F20DFE0E85DCB735E21F22A439FB837DD365A93116D063E607"}, - {"3FBA2B3D30177FFE15C1C59ED2148BB2C091F5615FBA7C07", - "FACF804A4BEBF998505FF9DE", - "8213B9263B2971A5BDA18DBD02208EE1", - "15B323926993B326EA19F892D704439FC478828322AF72118748284A1FD8A6D814E641F70512FD706980337379F31DC63355974738D7FEA87AD2858C0C2EBBFBE74371C21450072373C7B651B334D7C4D43260B9D7CCD3AF9EDB", - "6D35DC1469B26E6AAB26272A41B46916397C24C485B61162E640A062D9275BC33DDCFD3D9E1A53B6C8F51AC89B66A41D59B3574197A40D9B6DCF8A4E2A001409C8112F16B9C389E0096179DB914E05D6D11ED0005AD17E1CE105A2F0BAB8F6B1540DEB968B7A5428FF44"}, - {"53B52B8D4D748BCDF1DDE68857832FA46227FA6E2F32EFA1", - "0B0EF53D4606B28D1398355F", - "F23882436349094AF98BCACA8218E81581A043B19009E28EFBF2DE37883E04864148CC01D240552CA8844EC1456F42034653067DA67E80F87105FD06E14FF771246C9612867BE4D215F6D761", - "F15030679BD4088D42CAC9BF2E9606EAD4798782FA3ED8C57EBE7F84A53236F51B25967C6489D0CD20C9EEA752F9BC", - "67B96E2D67C3729C96DAEAEDF821D61C17E648643A2134C5621FEC621186915AD80864BFD1EB5B238BF526A679385E012A457F583AFA78134242E9D9C1B4E4"}, - {"0272DD80F23399F49BFC320381A5CD8225867245A49A7D41", - "5C83F4896D0738E1366B1836", - "69B0337289B19F73A12BAEEA857CCAF396C11113715D9500CCCF48BA08CFF12BC8B4BADB3084E63B85719DB5058FA7C2C11DEB096D7943CFA7CAF5", - "C01AD10FC8B562CD17C7BC2FAB3E26CBDFF8D7F4DEA816794BBCC12336991712972F52816AABAB244EB43B0137E2BAC1DD413CE79531E78BEF782E6B439612BB3AEF154DE3502784F287958EBC159419F9EBA27916A28D6307324129F506B1DE80C1755A929F87", - "FEFE52DD7159C8DD6E8EC2D3D3C0F37AB6CB471A75A071D17EC4ACDD8F3AA4D7D4F7BB559F3C09099E3D9003E5E8AA1F556B79CECDE66F85B08FA5955E6976BF2695EA076388A62D2AD5BAB7CBF1A7F3F4C8D5CDF37CDE99BD3E30B685D9E5EEE48C7C89118EF4878EB89747F28271FA2CC45F8E9E7601"}, - {"3EEAED04A455D6E5E5AB53CFD5AFD2F2BC625C7BF4BE49A5", - "36B88F63ADBB5668588181D774", - "D367E3CB3703E762D23C6533188EF7028EFF9D935A3977150361997EC9DEAF1E4794BDE26AA8B53C124980B1362EC86FCDDFC7A90073171C1BAEE351A53234B86C66E8AB92FAE99EC6967A6D3428892D80", - "573454C719A9A55E04437BF7CBAAF27563CCCD92ADD5E515CD63305DFF0687E5EEF790C5DCA5C0033E9AB129505E2775438D92B38F08F3B0356BA142C6F694", - "E9F79A5B432D9E682C9AAA5661CFC2E49A0FCB81A431E54B42EB73DD3BED3F377FEC556ABA81624BA64A5D739AD41467460088F8D4F442180A9382CA635745473794C382FCDDC49BA4EB6D8A44AE3C"}, - {"B695C691538F8CBD60F039D0E28894E3693CC7C36D92D79D", - "BC099AEB637361BAC536B57618", - "BFFF1A65AE38D1DC142C71637319F5F6508E2CB33C9DCB94202B359ED5A5ED8042E7F4F09231D32A7242976677E6F4C549BF65FADC99E5AF43F7A46FD95E16C2", - "081DF3FD85B415D803F0BE5AC58CFF0023FDDED99788296C3731D8", - "E50C64E3614D94FE69C47092E46ACC9957C6FEA2CCBF96BC62FBABE7424753C75F9C147C42AE26FE171531"}, - {"C9ACBD2718F0689A1BE9802A551B6B8D9CF5614DAF5E65ED", - "B1B0AAF373B8B026EB80422051D8", - "6648C0E61AC733C76119D23FB24548D637751387AA2EAE9D80E912B7BD486CAAD9EAF4D7A5FE2B54AAD481E8EC94BB4D558000896E2010462B70C9FED1E7273080D1", - "189F591F6CB6D59AFEDD14C341741A8F1037DC0DF00FC57CE65C30F49E860255CEA5DC6019380CC0FE8880BC1A9E685F41C239C38F36E3F2A1388865C5C311059C0A", - "922A5E949B61D03BE34AB5F4E58607D4504EA14017BB363DAE3C873059EA7A1C77A746FB78981671D26C2CF6D9F24952D510044CE02A10177E9DB42D0145211DFE6E84369C5E3BC2669EAB4147B2822895F9"}, - {"7A832BD2CF5BF4919F353CE2A8C86A5E406DA2D52BE16A72", - "2F2F17CECF7E5A756D10785A3CB9DB", - "61DA05E3788CC2D8405DBA70C7A28E5AF699863C9F72E6C6770126929F5D6FA267F005EBCF49495CB46400958A3AE80D1289D1C671", - "44E91121195A41AF14E8CFDBD39A4B517BE0DF1A72977ED8A3EEF8EEDA1166B2EB6DB2C4AE2E74FA0F0C74537F659BFBD141E5DDEC67E64EDA85AABD3F52C85A785B9FB3CECD70E7DF", - "BEDF596EA21288D2B84901E188F6EE1468B14D5161D3802DBFE00D60203A24E2AB62714BF272A45551489838C3A7FEAADC177B591836E73684867CCF4E12901DCF2064058726BBA554E84ADC5136F507E961188D4AF06943D3"}, - {"1508E8AE9079AA15F1CEC4F776B4D11BCCB061B58AA56C18", - "BCA625674F41D1E3AB47672DC0C3", - "8B12CF84F16360F0EAD2A41BC021530FFCEC7F3579CAE658E10E2D3D81870F65AFCED0C77C6C4C6E6BA424FF23088C796BA6195ABA35094BF1829E089662E7A95FC90750AE16D0C8AFA55DAC789D7735B970B58D4BE7CEC7341DA82A0179A01929C27A59C5063215B859EA43", - "E525422519ECE070E82C", - "B47BC07C3ED1C0A43BA52C43CBACBCDBB29CAF1001E09FDF7107"}, - {"7550C2761644E911FE9ADD119BAC07376BEA442845FEAD876D7E7AC1B713E464", - "36D2EC25ADD33CDEDF495205BBC923", - "7FCFE81A3790DE97FFC3DE160C470847EA7E841177C2F759571CBD837EA004A6CA8C6F4AEBFF2E9FD552D73EB8A30705D58D70C0B67AEEA280CBBF0A477358ACEF1E7508F2735CD9A0E4F9AC92B8C008F575D3B6278F1C18BD01227E3502E5255F3AB1893632AD00C717C588EF652A51A43209E7EE90", - "2B1A62F8FDFAA3C16470A21AD307C9A7D03ADE8EF72C69B06F8D738CDE578D7AEFD0D40BD9C022FB9F580DF5394C998ACCCEFC5471A3996FB8F1045A81FDC6F32D13502EA65A211390C8D882B8E0BEFD8DD8CBEF51D1597B124E9F7F", - "C873E02A22DB89EB0787DB6A60B99F7E4A0A085D5C4232A81ADCE2D60AA36F92DDC33F93DD8640AC0E08416B187FB382B3EC3EE85A64B0E6EE41C1366A5AD2A282F66605E87031CCBA2FA7B2DA201D975994AADE3DD1EE122AE09604AD489B84BF0C1AB7129EE16C6934850E"}, - {"A51300285E554FDBDE7F771A9A9A80955639DD87129FAEF74987C91FB9687C71", - "81691D5D20EC818FCFF24B33DECC", - "C948093218AA9EB2A8E44A87EEA73FC8B6B75A196819A14BD83709EA323E8DF8B491045220E1D88729A38DBCFFB60D3056DAD4564498FD6574F74512945DEB34B69329ACED9FFC05D5D59DFCD5B973E2ACAFE6AD1EF8BBBC49351A2DD12508ED89ED", - "EB861165DAF7625F827C6B574ED703F03215", - "C6CD1CE76D2B3679C1B5AA1CFD67CCB55444B6BFD3E22C81CBC9BB738796B83E54E3"}, - {"8CE0156D26FAEB7E0B9B800BBB2E9D4075B5EAC5C62358B0E7F6FCE610223282", - "D2A7B94DD12CDACA909D3AD7", - "E021A78F374FC271389AB9A3E97077D755", - "7C26000B58929F5095E1CEE154F76C2A299248E299F9B5ADE6C403AA1FD4A67FD4E0232F214CE7B919EE7A1027D2B76C57475715CD078461", - "C556FB38DF069B56F337B5FF5775CE6EAA16824DFA754F20B78819028EA635C3BB7AA731DE8776B2DCB67DCA2D33EEDF3C7E52EA450013722A41755A0752433ED17BDD5991AAE77A"}, - {"1E8000A2CE00A561C9920A30BF0D7B983FEF8A1014C8F04C35CA6970E6BA02BD", - "65ED3D63F79F90BBFD19775E", - "336A8C0B7243582A46B221AA677647FCAE91", - "134A8B34824A290E7B", - "914FBEF80D0E6E17F8BDBB6097EBF5FBB0554952DC2B9E5151"}, - {"53D5607BBE690B6E8D8F6D97F3DF2BA853B682597A214B8AA0EA6E598650AF15", - "C391A856B9FE234E14BA1AC7BB40FF", - "479682BC21349C4BE1641D5E78FE2C79EC1B9CF5470936DCAD9967A4DCD7C4EFADA593BC9EDE71E6A08829B8580901B61E274227E9D918502DE3", - "EAD154DC09C5E26C5D26FF33ED148B27120C7F2C23225CC0D0631B03E1F6C6D96FEB88C1A4052ACB4CE746B884B6502931F407021126C6AAB8C514C077A5A38438AE88EE", - "938821286EBB671D999B87C032E1D6055392EB564E57970D55E545FC5E8BAB90E6E3E3C0913F6320995FC636D72CD9919657CC38BD51552F4A502D8D1FE56DB33EBAC5092630E69EBB986F0E15CEE9FC8C052501"}, - {"294362FCC984F440CEA3E9F7D2C06AF20C53AAC1B3738CA2186C914A6E193ABB", - "B15B61C8BB39261A8F55AB178EC3", - "D0729B6B75BB", - "2BD089ADCE9F334BAE3B065996C7D616DD0C27DF4218DCEEA0FBCA0F968837CE26B0876083327E25681FDDD620A32EC0DA12F73FAE826CC94BFF2B90A54D2651", - "AC94B25E4E21DE2437B806966CCD5D9385EF0CD4A51AB9FA6DE675C7B8952D67802E9FEC1FDE9F5D1EAB06057498BC0EEA454804FC9D2068982A3E24182D9AC2E7AB9994DDC899A604264583F63D066B"}, - {"959DBFEB039B1A5B8CE6A44649B602AAA5F98A906DB96143D202CD2024F749D9", - "01D7BDB1133E9C347486C1EFA6", - "F3843955BD741F379DD750585EDC55E2CDA05CCBA8C1F4622AC2FE35214BC3A019B8BD12C4CC42D9213D1E1556941E8D8450830287FFB3B763A13722DD4140ED9846FB5FFF745D7B0B967D810A068222E10B259AF1D392035B0D83DC1498A6830B11B2418A840212599171E0258A1C203B05362978", - "A21811232C950FA8B12237C2EBD6A7CD2C3A155905E9E0C7C120", - "63C1CE397B22F1A03F1FA549B43178BC405B152D3C95E977426D519B3DFCA28498823240592B6EEE7A14"}, - {"096AE499F5294173F34FF2B375F0E5D5AB79D0D03B33B1A74D7D576826345DF4", - "0C52B3D11D636E5910A4DD76D32C", - "229E9ECA3053789E937447BC719467075B6138A142DA528DA8F0CF8DDF022FD9AF8E74779BA3AC306609", - "8B7A00038783E8BAF6EDEAE0C4EAB48FC8FD501A588C7E4A4DB71E3604F2155A97687D3D2FFF8569261375A513CF4398CE0F87CA1658A1050F6EF6C4EA3E25", - "C20B6CF8D3C8241825FD90B2EDAC7593600646E579A8D8DAAE9E2E40C3835FE801B2BE4379131452BC5182C90307B176DFBE2049544222FE7783147B690774F6D9D7CEF52A91E61E298E9AA15464AC"}, -} diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go deleted file mode 100644 index 330309ff5f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_a.go +++ /dev/null @@ -1,78 +0,0 @@ -package ocb - -import ( - "encoding/hex" -) - -// Test vectors from https://tools.ietf.org/html/rfc7253. Note that key is -// shared across tests. -var testKey, _ = hex.DecodeString("000102030405060708090A0B0C0D0E0F") - -var rfc7253testVectors = []struct { - nonce, header, plaintext, ciphertext string -}{ - {"BBAA99887766554433221100", - "", - "", - "785407BFFFC8AD9EDCC5520AC9111EE6"}, - {"BBAA99887766554433221101", - "0001020304050607", - "0001020304050607", - "6820B3657B6F615A5725BDA0D3B4EB3A257C9AF1F8F03009"}, - {"BBAA99887766554433221102", - "0001020304050607", - "", - "81017F8203F081277152FADE694A0A00"}, - {"BBAA99887766554433221103", - "", - "0001020304050607", - "45DD69F8F5AAE72414054CD1F35D82760B2CD00D2F99BFA9"}, - {"BBAA99887766554433221104", - "000102030405060708090A0B0C0D0E0F", - "000102030405060708090A0B0C0D0E0F", - "571D535B60B277188BE5147170A9A22C3AD7A4FF3835B8C5701C1CCEC8FC3358"}, - {"BBAA99887766554433221105", - "000102030405060708090A0B0C0D0E0F", - "", - "8CF761B6902EF764462AD86498CA6B97"}, - {"BBAA99887766554433221106", - "", - "000102030405060708090A0B0C0D0E0F", - "5CE88EC2E0692706A915C00AEB8B2396F40E1C743F52436BDF06D8FA1ECA343D"}, - {"BBAA99887766554433221107", - "000102030405060708090A0B0C0D0E0F1011121314151617", - "000102030405060708090A0B0C0D0E0F1011121314151617", - "1CA2207308C87C010756104D8840CE1952F09673A448A122C92C62241051F57356D7F3C90BB0E07F"}, - {"BBAA99887766554433221108", - "000102030405060708090A0B0C0D0E0F1011121314151617", - "", - "6DC225A071FC1B9F7C69F93B0F1E10DE"}, - {"BBAA99887766554433221109", - "", - "000102030405060708090A0B0C0D0E0F1011121314151617", - "221BD0DE7FA6FE993ECCD769460A0AF2D6CDED0C395B1C3CE725F32494B9F914D85C0B1EB38357FF"}, - {"BBAA9988776655443322110A", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F", - "BD6F6C496201C69296C11EFD138A467ABD3C707924B964DEAFFC40319AF5A48540FBBA186C5553C68AD9F592A79A4240"}, - {"BBAA9988776655443322110B", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F", - "", - "FE80690BEE8A485D11F32965BC9D2A32"}, - {"BBAA9988776655443322110C", - "", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F", - "2942BFC773BDA23CABC6ACFD9BFD5835BD300F0973792EF46040C53F1432BCDFB5E1DDE3BC18A5F840B52E653444D5DF"}, - {"BBAA9988776655443322110D", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "D5CA91748410C1751FF8A2F618255B68A0A12E093FF454606E59F9C1D0DDC54B65E8628E568BAD7AED07BA06A4A69483A7035490C5769E60"}, - {"BBAA9988776655443322110E", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "", - "C5CD9D1850C141E358649994EE701B68"}, - {"BBAA9988776655443322110F", - "", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "4412923493C57D5DE0D700F753CCE0D1D2D95060122E9F15A5DDBFC5787E50B5CC55EE507BCB084E479AD363AC366B95A98CA5F3000B1479"}, -} diff --git a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go b/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go deleted file mode 100644 index 14a3c336fb..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/ocb/rfc7253_test_vectors_suite_b.go +++ /dev/null @@ -1,25 +0,0 @@ -package ocb - -// Second set of test vectors from https://tools.ietf.org/html/rfc7253 -var rfc7253TestVectorTaglen96 = struct { - key, nonce, header, plaintext, ciphertext string -}{"0F0E0D0C0B0A09080706050403020100", - "BBAA9988776655443322110D", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627", - "1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1A0124B0A55BAE884ED93481529C76B6AD0C515F4D1CDD4FDAC4F02AA"} - -var rfc7253AlgorithmTest = []struct { - KEYLEN, TAGLEN int - OUTPUT string -}{ - {128, 128, "67E944D23256C5E0B6C61FA22FDF1EA2"}, - {192, 128, "F673F2C3E7174AAE7BAE986CA9F29E17"}, - {256, 128, "D90EB8E9C977C88B79DD793D7FFA161C"}, - {128, 96, "77A3D8E73589158D25D01209"}, - {192, 96, "05D56EAD2752C86BE6932C5E"}, - {256, 96, "5458359AC23B0CBA9E6330DD"}, - {128, 64, "192C9B7BD90BA06A"}, - {192, 64, "0066BC6E0EF34E24"}, - {256, 64, "7D4EA5D445501CBE"}, -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go deleted file mode 100644 index 3c6251d1ce..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/aes/keywrap/keywrap.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2014 Matthew Endsley -// All rights reserved -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted providing that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -// OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -// IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -// POSSIBILITY OF SUCH DAMAGE. - -// Package keywrap is an implementation of the RFC 3394 AES key wrapping -// algorithm. This is used in OpenPGP with elliptic curve keys. -package keywrap - -import ( - "crypto/aes" - "encoding/binary" - "errors" -) - -var ( - // ErrWrapPlaintext is returned if the plaintext is not a multiple - // of 64 bits. - ErrWrapPlaintext = errors.New("keywrap: plainText must be a multiple of 64 bits") - - // ErrUnwrapCiphertext is returned if the ciphertext is not a - // multiple of 64 bits. - ErrUnwrapCiphertext = errors.New("keywrap: cipherText must by a multiple of 64 bits") - - // ErrUnwrapFailed is returned if unwrapping a key fails. - ErrUnwrapFailed = errors.New("keywrap: failed to unwrap key") - - // NB: the AES NewCipher call only fails if the key is an invalid length. - - // ErrInvalidKey is returned when the AES key is invalid. - ErrInvalidKey = errors.New("keywrap: invalid AES key") -) - -// Wrap a key using the RFC 3394 AES Key Wrap Algorithm. -func Wrap(key, plainText []byte) ([]byte, error) { - if len(plainText)%8 != 0 { - return nil, ErrWrapPlaintext - } - - c, err := aes.NewCipher(key) - if err != nil { - return nil, ErrInvalidKey - } - - nblocks := len(plainText) / 8 - - // 1) Initialize variables. - var block [aes.BlockSize]byte - // - Set A = IV, an initial value (see 2.2.3) - for ii := 0; ii < 8; ii++ { - block[ii] = 0xA6 - } - - // - For i = 1 to n - // - Set R[i] = P[i] - intermediate := make([]byte, len(plainText)) - copy(intermediate, plainText) - - // 2) Calculate intermediate values. - for ii := 0; ii < 6; ii++ { - for jj := 0; jj < nblocks; jj++ { - // - B = AES(K, A | R[i]) - copy(block[8:], intermediate[jj*8:jj*8+8]) - c.Encrypt(block[:], block[:]) - - // - A = MSB(64, B) ^ t where t = (n*j)+1 - t := uint64(ii*nblocks + jj + 1) - val := binary.BigEndian.Uint64(block[:8]) ^ t - binary.BigEndian.PutUint64(block[:8], val) - - // - R[i] = LSB(64, B) - copy(intermediate[jj*8:jj*8+8], block[8:]) - } - } - - // 3) Output results. - // - Set C[0] = A - // - For i = 1 to n - // - C[i] = R[i] - return append(block[:8], intermediate...), nil -} - -// Unwrap a key using the RFC 3394 AES Key Wrap Algorithm. -func Unwrap(key, cipherText []byte) ([]byte, error) { - if len(cipherText)%8 != 0 { - return nil, ErrUnwrapCiphertext - } - - c, err := aes.NewCipher(key) - if err != nil { - return nil, ErrInvalidKey - } - - nblocks := len(cipherText)/8 - 1 - - // 1) Initialize variables. - var block [aes.BlockSize]byte - // - Set A = C[0] - copy(block[:8], cipherText[:8]) - - // - For i = 1 to n - // - Set R[i] = C[i] - intermediate := make([]byte, len(cipherText)-8) - copy(intermediate, cipherText[8:]) - - // 2) Compute intermediate values. - for jj := 5; jj >= 0; jj-- { - for ii := nblocks - 1; ii >= 0; ii-- { - // - B = AES-1(K, (A ^ t) | R[i]) where t = n*j+1 - // - A = MSB(64, B) - t := uint64(jj*nblocks + ii + 1) - val := binary.BigEndian.Uint64(block[:8]) ^ t - binary.BigEndian.PutUint64(block[:8], val) - - copy(block[8:], intermediate[ii*8:ii*8+8]) - c.Decrypt(block[:], block[:]) - - // - R[i] = LSB(B, 64) - copy(intermediate[ii*8:ii*8+8], block[8:]) - } - } - - // 3) Output results. - // - If A is an appropriate initial value (see 2.2.3), - for ii := 0; ii < 8; ii++ { - if block[ii] != 0xA6 { - return nil, ErrUnwrapFailed - } - } - - // - For i = 1 to n - // - P[i] = R[i] - return intermediate, nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go deleted file mode 100644 index d7af9141e3..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/armor.go +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package armor implements OpenPGP ASCII Armor, see RFC 4880. OpenPGP Armor is -// very similar to PEM except that it has an additional CRC checksum. -package armor // import "github.com/ProtonMail/go-crypto/openpgp/armor" - -import ( - "bufio" - "bytes" - "encoding/base64" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// A Block represents an OpenPGP armored structure. -// -// The encoded form is: -// -// -----BEGIN Type----- -// Headers -// -// base64-encoded Bytes -// '=' base64 encoded checksum -// -----END Type----- -// -// where Headers is a possibly empty sequence of Key: Value lines. -// -// Since the armored data can be very large, this package presents a streaming -// interface. -type Block struct { - Type string // The type, taken from the preamble (i.e. "PGP SIGNATURE"). - Header map[string]string // Optional headers. - Body io.Reader // A Reader from which the contents can be read - lReader lineReader - oReader openpgpReader -} - -var ArmorCorrupt error = errors.StructuralError("armor invalid") - -const crc24Init = 0xb704ce -const crc24Poly = 0x1864cfb -const crc24Mask = 0xffffff - -// crc24 calculates the OpenPGP checksum as specified in RFC 4880, section 6.1 -func crc24(crc uint32, d []byte) uint32 { - for _, b := range d { - crc ^= uint32(b) << 16 - for i := 0; i < 8; i++ { - crc <<= 1 - if crc&0x1000000 != 0 { - crc ^= crc24Poly - } - } - } - return crc -} - -var armorStart = []byte("-----BEGIN ") -var armorEnd = []byte("-----END ") -var armorEndOfLine = []byte("-----") - -// lineReader wraps a line based reader. It watches for the end of an armor -// block and records the expected CRC value. -type lineReader struct { - in *bufio.Reader - buf []byte - eof bool - crc uint32 - crcSet bool -} - -func (l *lineReader) Read(p []byte) (n int, err error) { - if l.eof { - return 0, io.EOF - } - - if len(l.buf) > 0 { - n = copy(p, l.buf) - l.buf = l.buf[n:] - return - } - - line, isPrefix, err := l.in.ReadLine() - if err != nil { - return - } - if isPrefix { - return 0, ArmorCorrupt - } - - if bytes.HasPrefix(line, armorEnd) { - l.eof = true - return 0, io.EOF - } - - if len(line) == 5 && line[0] == '=' { - // This is the checksum line - var expectedBytes [3]byte - var m int - m, err = base64.StdEncoding.Decode(expectedBytes[0:], line[1:]) - if m != 3 || err != nil { - return - } - l.crc = uint32(expectedBytes[0])<<16 | - uint32(expectedBytes[1])<<8 | - uint32(expectedBytes[2]) - - line, _, err = l.in.ReadLine() - if err != nil && err != io.EOF { - return - } - if !bytes.HasPrefix(line, armorEnd) { - return 0, ArmorCorrupt - } - - l.eof = true - l.crcSet = true - return 0, io.EOF - } - - if len(line) > 96 { - return 0, ArmorCorrupt - } - - n = copy(p, line) - bytesToSave := len(line) - n - if bytesToSave > 0 { - if cap(l.buf) < bytesToSave { - l.buf = make([]byte, 0, bytesToSave) - } - l.buf = l.buf[0:bytesToSave] - copy(l.buf, line[n:]) - } - - return -} - -// openpgpReader passes Read calls to the underlying base64 decoder, but keeps -// a running CRC of the resulting data and checks the CRC against the value -// found by the lineReader at EOF. -type openpgpReader struct { - lReader *lineReader - b64Reader io.Reader - currentCRC uint32 -} - -func (r *openpgpReader) Read(p []byte) (n int, err error) { - n, err = r.b64Reader.Read(p) - r.currentCRC = crc24(r.currentCRC, p[:n]) - - if err == io.EOF && r.lReader.crcSet && r.lReader.crc != uint32(r.currentCRC&crc24Mask) { - return 0, ArmorCorrupt - } - - return -} - -// Decode reads a PGP armored block from the given Reader. It will ignore -// leading garbage. If it doesn't find a block, it will return nil, io.EOF. The -// given Reader is not usable after calling this function: an arbitrary amount -// of data may have been read past the end of the block. -func Decode(in io.Reader) (p *Block, err error) { - r := bufio.NewReaderSize(in, 100) - var line []byte - ignoreNext := false - -TryNextBlock: - p = nil - - // Skip leading garbage - for { - ignoreThis := ignoreNext - line, ignoreNext, err = r.ReadLine() - if err != nil { - return - } - if ignoreNext || ignoreThis { - continue - } - line = bytes.TrimSpace(line) - if len(line) > len(armorStart)+len(armorEndOfLine) && bytes.HasPrefix(line, armorStart) { - break - } - } - - p = new(Block) - p.Type = string(line[len(armorStart) : len(line)-len(armorEndOfLine)]) - p.Header = make(map[string]string) - nextIsContinuation := false - var lastKey string - - // Read headers - for { - isContinuation := nextIsContinuation - line, nextIsContinuation, err = r.ReadLine() - if err != nil { - p = nil - return - } - if isContinuation { - p.Header[lastKey] += string(line) - continue - } - line = bytes.TrimSpace(line) - if len(line) == 0 { - break - } - - i := bytes.Index(line, []byte(":")) - if i == -1 { - goto TryNextBlock - } - lastKey = string(line[:i]) - var value string - if len(line) > i+2 { - value = string(line[i+2:]) - } - p.Header[lastKey] = value - } - - p.lReader.in = r - p.oReader.currentCRC = crc24Init - p.oReader.lReader = &p.lReader - p.oReader.b64Reader = base64.NewDecoder(base64.StdEncoding, &p.lReader) - p.Body = &p.oReader - - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go deleted file mode 100644 index 5b6e16c19d..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/armor/encode.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package armor - -import ( - "encoding/base64" - "io" -) - -var armorHeaderSep = []byte(": ") -var blockEnd = []byte("\n=") -var newline = []byte("\n") -var armorEndOfLineOut = []byte("-----\n") - -// writeSlices writes its arguments to the given Writer. -func writeSlices(out io.Writer, slices ...[]byte) (err error) { - for _, s := range slices { - _, err = out.Write(s) - if err != nil { - return err - } - } - return -} - -// lineBreaker breaks data across several lines, all of the same byte length -// (except possibly the last). Lines are broken with a single '\n'. -type lineBreaker struct { - lineLength int - line []byte - used int - out io.Writer - haveWritten bool -} - -func newLineBreaker(out io.Writer, lineLength int) *lineBreaker { - return &lineBreaker{ - lineLength: lineLength, - line: make([]byte, lineLength), - used: 0, - out: out, - } -} - -func (l *lineBreaker) Write(b []byte) (n int, err error) { - n = len(b) - - if n == 0 { - return - } - - if l.used == 0 && l.haveWritten { - _, err = l.out.Write([]byte{'\n'}) - if err != nil { - return - } - } - - if l.used+len(b) < l.lineLength { - l.used += copy(l.line[l.used:], b) - return - } - - l.haveWritten = true - _, err = l.out.Write(l.line[0:l.used]) - if err != nil { - return - } - excess := l.lineLength - l.used - l.used = 0 - - _, err = l.out.Write(b[0:excess]) - if err != nil { - return - } - - _, err = l.Write(b[excess:]) - return -} - -func (l *lineBreaker) Close() (err error) { - if l.used > 0 { - _, err = l.out.Write(l.line[0:l.used]) - if err != nil { - return - } - } - - return -} - -// encoding keeps track of a running CRC24 over the data which has been written -// to it and outputs a OpenPGP checksum when closed, followed by an armor -// trailer. -// -// It's built into a stack of io.Writers: -// -// encoding -> base64 encoder -> lineBreaker -> out -type encoding struct { - out io.Writer - breaker *lineBreaker - b64 io.WriteCloser - crc uint32 - blockType []byte -} - -func (e *encoding) Write(data []byte) (n int, err error) { - e.crc = crc24(e.crc, data) - return e.b64.Write(data) -} - -func (e *encoding) Close() (err error) { - err = e.b64.Close() - if err != nil { - return - } - e.breaker.Close() - - var checksumBytes [3]byte - checksumBytes[0] = byte(e.crc >> 16) - checksumBytes[1] = byte(e.crc >> 8) - checksumBytes[2] = byte(e.crc) - - var b64ChecksumBytes [4]byte - base64.StdEncoding.Encode(b64ChecksumBytes[:], checksumBytes[:]) - - return writeSlices(e.out, blockEnd, b64ChecksumBytes[:], newline, armorEnd, e.blockType, armorEndOfLine) -} - -// Encode returns a WriteCloser which will encode the data written to it in -// OpenPGP armor. -func Encode(out io.Writer, blockType string, headers map[string]string) (w io.WriteCloser, err error) { - bType := []byte(blockType) - err = writeSlices(out, armorStart, bType, armorEndOfLineOut) - if err != nil { - return - } - - for k, v := range headers { - err = writeSlices(out, []byte(k), armorHeaderSep, []byte(v), newline) - if err != nil { - return - } - } - - _, err = out.Write(newline) - if err != nil { - return - } - - e := &encoding{ - out: out, - breaker: newLineBreaker(out, 64), - crc: crc24Init, - blockType: bType, - } - e.b64 = base64.NewEncoder(base64.StdEncoding, e.breaker) - return e, nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go deleted file mode 100644 index a94f6150c4..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/canonical_text.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - "hash" - "io" -) - -// NewCanonicalTextHash reformats text written to it into the canonical -// form and then applies the hash h. See RFC 4880, section 5.2.1. -func NewCanonicalTextHash(h hash.Hash) hash.Hash { - return &canonicalTextHash{h, 0} -} - -type canonicalTextHash struct { - h hash.Hash - s int -} - -var newline = []byte{'\r', '\n'} - -func writeCanonical(cw io.Writer, buf []byte, s *int) (int, error) { - start := 0 - for i, c := range buf { - switch *s { - case 0: - if c == '\r' { - *s = 1 - } else if c == '\n' { - cw.Write(buf[start:i]) - cw.Write(newline) - start = i + 1 - } - case 1: - *s = 0 - } - } - - cw.Write(buf[start:]) - return len(buf), nil -} - -func (cth *canonicalTextHash) Write(buf []byte) (int, error) { - return writeCanonical(cth.h, buf, &cth.s) -} - -func (cth *canonicalTextHash) Sum(in []byte) []byte { - return cth.h.Sum(in) -} - -func (cth *canonicalTextHash) Reset() { - cth.h.Reset() - cth.s = 0 -} - -func (cth *canonicalTextHash) Size() int { - return cth.h.Size() -} - -func (cth *canonicalTextHash) BlockSize() int { - return cth.h.BlockSize() -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/clearsign/clearsign.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/clearsign/clearsign.go deleted file mode 100644 index 8f70b37300..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/clearsign/clearsign.go +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package clearsign generates and processes OpenPGP, clear-signed data. See -// RFC 4880, section 7. -// -// Clearsigned messages are cryptographically signed, but the contents of the -// message are kept in plaintext so that it can be read without special tools. -package clearsign // import "github.com/ProtonMail/go-crypto/openpgp/clearsign" - -import ( - "bufio" - "bytes" - "crypto" - "fmt" - "hash" - "io" - "net/textproto" - "strconv" - "strings" - - "github.com/ProtonMail/go-crypto/openpgp" - "github.com/ProtonMail/go-crypto/openpgp/armor" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/packet" -) - -// A Block represents a clearsigned message. A signature on a Block can -// be checked by calling Block.VerifySignature. -type Block struct { - Headers textproto.MIMEHeader // Optional unverified Hash headers - Plaintext []byte // The original message text - Bytes []byte // The signed message - ArmoredSignature *armor.Block // The signature block -} - -// start is the marker which denotes the beginning of a clearsigned message. -var start = []byte("\n-----BEGIN PGP SIGNED MESSAGE-----") - -// dashEscape is prefixed to any lines that begin with a hyphen so that they -// can't be confused with endText. -var dashEscape = []byte("- ") - -// endText is a marker which denotes the end of the message and the start of -// an armored signature. -var endText = []byte("-----BEGIN PGP SIGNATURE-----") - -// end is a marker which denotes the end of the armored signature. -var end = []byte("\n-----END PGP SIGNATURE-----") - -var crlf = []byte("\r\n") -var lf = byte('\n') - -// getLine returns the first \r\n or \n delineated line from the given byte -// array. The line does not include the \r\n or \n. The remainder of the byte -// array (also not including the new line bytes) is also returned and this will -// always be smaller than the original argument. -func getLine(data []byte) (line, rest []byte) { - i := bytes.Index(data, []byte{'\n'}) - var j int - if i < 0 { - i = len(data) - j = i - } else { - j = i + 1 - if i > 0 && data[i-1] == '\r' { - i-- - } - } - return data[0:i], data[j:] -} - -// Decode finds the first clearsigned message in data and returns it, as well as -// the suffix of data which remains after the message. Any prefix data is -// discarded. -// -// If no message is found, or if the message is invalid, Decode returns nil and -// the whole data slice. The only allowed header type is Hash, and it is not -// verified against the signature hash. -func Decode(data []byte) (b *Block, rest []byte) { - // start begins with a newline. However, at the very beginning of - // the byte array, we'll accept the start string without it. - rest = data - if bytes.HasPrefix(data, start[1:]) { - rest = rest[len(start)-1:] - } else if i := bytes.Index(data, start); i >= 0 { - rest = rest[i+len(start):] - } else { - return nil, data - } - - // Consume the start line and check it does not have a suffix. - suffix, rest := getLine(rest) - if len(suffix) != 0 { - return nil, data - } - - var line []byte - b = &Block{ - Headers: make(textproto.MIMEHeader), - } - - // Next come a series of header lines. - for { - // This loop terminates because getLine's second result is - // always smaller than its argument. - if len(rest) == 0 { - return nil, data - } - // An empty line marks the end of the headers. - if line, rest = getLine(rest); len(line) == 0 { - break - } - - // Reject headers with control or Unicode characters. - if i := bytes.IndexFunc(line, func(r rune) bool { - return r < 0x20 || r > 0x7e - }); i != -1 { - return nil, data - } - - i := bytes.Index(line, []byte{':'}) - if i == -1 { - return nil, data - } - - key, val := string(line[0:i]), string(line[i+1:]) - key = strings.TrimSpace(key) - if key != "Hash" { - return nil, data - } - for _, val := range strings.Split(val, ",") { - val = strings.TrimSpace(val) - b.Headers.Add(key, val) - } - } - - firstLine := true - for { - start := rest - - line, rest = getLine(rest) - if len(line) == 0 && len(rest) == 0 { - // No armored data was found, so this isn't a complete message. - return nil, data - } - if bytes.Equal(line, endText) { - // Back up to the start of the line because armor expects to see the - // header line. - rest = start - break - } - - // The final CRLF isn't included in the hash so we don't write it until - // we've seen the next line. - if firstLine { - firstLine = false - } else { - b.Bytes = append(b.Bytes, crlf...) - } - - if bytes.HasPrefix(line, dashEscape) { - line = line[2:] - } - line = bytes.TrimRight(line, " \t") - b.Bytes = append(b.Bytes, line...) - - b.Plaintext = append(b.Plaintext, line...) - b.Plaintext = append(b.Plaintext, lf) - } - - // We want to find the extent of the armored data (including any newlines at - // the end). - i := bytes.Index(rest, end) - if i == -1 { - return nil, data - } - i += len(end) - for i < len(rest) && (rest[i] == '\r' || rest[i] == '\n') { - i++ - } - armored := rest[:i] - rest = rest[i:] - - var err error - b.ArmoredSignature, err = armor.Decode(bytes.NewBuffer(armored)) - if err != nil { - return nil, data - } - - return b, rest -} - -// A dashEscaper is an io.WriteCloser which processes the body of a clear-signed -// message. The clear-signed message is written to buffered and a hash, suitable -// for signing, is maintained in h. -// -// When closed, an armored signature is created and written to complete the -// message. -type dashEscaper struct { - buffered *bufio.Writer - hashers []hash.Hash // one per key in privateKeys - hashType crypto.Hash - toHash io.Writer // writes to all the hashes in hashers - - atBeginningOfLine bool - isFirstLine bool - - whitespace []byte - byteBuf []byte // a one byte buffer to save allocations - - privateKeys []*packet.PrivateKey - config *packet.Config -} - -func (d *dashEscaper) Write(data []byte) (n int, err error) { - for _, b := range data { - d.byteBuf[0] = b - - if d.atBeginningOfLine { - // The final CRLF isn't included in the hash so we have to wait - // until this point (the start of the next line) before writing it. - if !d.isFirstLine { - d.toHash.Write(crlf) - } - d.isFirstLine = false - } - - // Any whitespace at the end of the line has to be removed so we - // buffer it until we find out whether there's more on this line. - if b == ' ' || b == '\t' || b == '\r' { - d.whitespace = append(d.whitespace, b) - d.atBeginningOfLine = false - continue - } - - if d.atBeginningOfLine { - // At the beginning of a line, hyphens have to be escaped. - if b == '-' { - // The signature isn't calculated over the dash-escaped text so - // the escape is only written to buffered. - if _, err = d.buffered.Write(dashEscape); err != nil { - return - } - d.toHash.Write(d.byteBuf) - d.atBeginningOfLine = false - } else if b == '\n' { - // Nothing to do because we delay writing CRLF to the hash. - } else { - d.toHash.Write(d.byteBuf) - d.atBeginningOfLine = false - } - if err = d.buffered.WriteByte(b); err != nil { - return - } - } else { - if b == '\n' { - // We got a raw \n. Drop any trailing whitespace and write a - // CRLF. - d.whitespace = d.whitespace[:0] - // We delay writing CRLF to the hash until the start of the - // next line. - if err = d.buffered.WriteByte(b); err != nil { - return - } - d.atBeginningOfLine = true - } else { - // Any buffered whitespace wasn't at the end of the line so - // we need to write it out. - if len(d.whitespace) > 0 { - d.toHash.Write(d.whitespace) - if _, err = d.buffered.Write(d.whitespace); err != nil { - return - } - d.whitespace = d.whitespace[:0] - } - d.toHash.Write(d.byteBuf) - if err = d.buffered.WriteByte(b); err != nil { - return - } - } - } - } - - n = len(data) - return -} - -func (d *dashEscaper) Close() (err error) { - if !d.atBeginningOfLine { - if err = d.buffered.WriteByte(lf); err != nil { - return - } - } - - out, err := armor.Encode(d.buffered, "PGP SIGNATURE", nil) - if err != nil { - return - } - - t := d.config.Now() - for i, k := range d.privateKeys { - sig := new(packet.Signature) - sig.SigType = packet.SigTypeText - sig.PubKeyAlgo = k.PubKeyAlgo - sig.Hash = d.hashType - sig.CreationTime = t - sig.IssuerKeyId = &k.KeyId - sig.IssuerFingerprint = k.Fingerprint - sig.Notations = d.config.Notations() - sigLifetimeSecs := d.config.SigLifetime() - sig.SigLifetimeSecs = &sigLifetimeSecs - - if err = sig.Sign(d.hashers[i], k, d.config); err != nil { - return - } - if err = sig.Serialize(out); err != nil { - return - } - } - - if err = out.Close(); err != nil { - return - } - if err = d.buffered.Flush(); err != nil { - return - } - return -} - -// Encode returns a WriteCloser which will clear-sign a message with privateKey -// and write it to w. If config is nil, sensible defaults are used. -func Encode(w io.Writer, privateKey *packet.PrivateKey, config *packet.Config) (plaintext io.WriteCloser, err error) { - return EncodeMulti(w, []*packet.PrivateKey{privateKey}, config) -} - -// EncodeMulti returns a WriteCloser which will clear-sign a message with all the -// private keys indicated and write it to w. If config is nil, sensible defaults -// are used. -func EncodeMulti(w io.Writer, privateKeys []*packet.PrivateKey, config *packet.Config) (plaintext io.WriteCloser, err error) { - for _, k := range privateKeys { - if k.Encrypted { - return nil, errors.InvalidArgumentError(fmt.Sprintf("signing key %s is encrypted", k.KeyIdString())) - } - } - - hashType := config.Hash() - name := nameOfHash(hashType) - if len(name) == 0 { - return nil, errors.UnsupportedError("unknown hash type: " + strconv.Itoa(int(hashType))) - } - - if !hashType.Available() { - return nil, errors.UnsupportedError("unsupported hash type: " + strconv.Itoa(int(hashType))) - } - var hashers []hash.Hash - var ws []io.Writer - for range privateKeys { - h := hashType.New() - hashers = append(hashers, h) - ws = append(ws, h) - } - toHash := io.MultiWriter(ws...) - - buffered := bufio.NewWriter(w) - // start has a \n at the beginning that we don't want here. - if _, err = buffered.Write(start[1:]); err != nil { - return - } - if err = buffered.WriteByte(lf); err != nil { - return - } - if _, err = buffered.WriteString("Hash: "); err != nil { - return - } - if _, err = buffered.WriteString(name); err != nil { - return - } - if err = buffered.WriteByte(lf); err != nil { - return - } - if err = buffered.WriteByte(lf); err != nil { - return - } - - plaintext = &dashEscaper{ - buffered: buffered, - hashers: hashers, - hashType: hashType, - toHash: toHash, - - atBeginningOfLine: true, - isFirstLine: true, - - byteBuf: make([]byte, 1), - - privateKeys: privateKeys, - config: config, - } - - return -} - -// VerifySignature checks a clearsigned message signature, and checks that the -// hash algorithm in the header matches the hash algorithm in the signature. -func (b *Block) VerifySignature(keyring openpgp.KeyRing, config *packet.Config) (signer *openpgp.Entity, err error) { - var expectedHashes []crypto.Hash - for _, v := range b.Headers { - for _, name := range v { - expectedHash := nameToHash(name) - if uint8(expectedHash) == 0 { - return nil, errors.StructuralError("unknown hash algorithm in cleartext message headers") - } - expectedHashes = append(expectedHashes, expectedHash) - } - } - if len(expectedHashes) == 0 { - expectedHashes = append(expectedHashes, crypto.MD5) - } - return openpgp.CheckDetachedSignatureAndHash(keyring, bytes.NewBuffer(b.Bytes), b.ArmoredSignature.Body, expectedHashes, config) -} - -// nameOfHash returns the OpenPGP name for the given hash, or the empty string -// if the name isn't known. See RFC 4880, section 9.4. -func nameOfHash(h crypto.Hash) string { - switch h { - case crypto.SHA224: - return "SHA224" - case crypto.SHA256: - return "SHA256" - case crypto.SHA384: - return "SHA384" - case crypto.SHA512: - return "SHA512" - case crypto.SHA3_256: - return "SHA3-256" - case crypto.SHA3_512: - return "SHA3-512" - } - return "" -} - -// nameToHash returns a hash for a given OpenPGP name, or 0 -// if the name isn't known. See RFC 4880, section 9.4. -func nameToHash(h string) crypto.Hash { - switch h { - case "SHA1": - return crypto.SHA1 - case "SHA224": - return crypto.SHA224 - case "SHA256": - return crypto.SHA256 - case "SHA384": - return crypto.SHA384 - case "SHA512": - return crypto.SHA512 - case "SHA3-256": - return crypto.SHA3_256 - case "SHA3-512": - return crypto.SHA3_512 - } - return crypto.Hash(0) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go deleted file mode 100644 index c895bad6bb..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdh/ecdh.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ecdh implements ECDH encryption, suitable for OpenPGP, -// as specified in RFC 6637, section 8. -package ecdh - -import ( - "bytes" - "errors" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/aes/keywrap" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/internal/ecc" -) - -type KDF struct { - Hash algorithm.Hash - Cipher algorithm.Cipher -} - -type PublicKey struct { - curve ecc.ECDHCurve - Point []byte - KDF -} - -type PrivateKey struct { - PublicKey - D []byte -} - -func NewPublicKey(curve ecc.ECDHCurve, kdfHash algorithm.Hash, kdfCipher algorithm.Cipher) *PublicKey { - return &PublicKey{ - curve: curve, - KDF: KDF{ - Hash: kdfHash, - Cipher: kdfCipher, - }, - } -} - -func NewPrivateKey(key PublicKey) *PrivateKey { - return &PrivateKey{ - PublicKey: key, - } -} - -func (pk *PublicKey) GetCurve() ecc.ECDHCurve { - return pk.curve -} - -func (pk *PublicKey) MarshalPoint() []byte { - return pk.curve.MarshalBytePoint(pk.Point) -} - -func (pk *PublicKey) UnmarshalPoint(p []byte) error { - pk.Point = pk.curve.UnmarshalBytePoint(p) - if pk.Point == nil { - return errors.New("ecdh: failed to parse EC point") - } - return nil -} - -func (sk *PrivateKey) MarshalByteSecret() []byte { - return sk.curve.MarshalByteSecret(sk.D) -} - -func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error { - sk.D = sk.curve.UnmarshalByteSecret(d) - - if sk.D == nil { - return errors.New("ecdh: failed to parse scalar") - } - return nil -} - -func GenerateKey(rand io.Reader, c ecc.ECDHCurve, kdf KDF) (priv *PrivateKey, err error) { - priv = new(PrivateKey) - priv.PublicKey.curve = c - priv.PublicKey.KDF = kdf - priv.PublicKey.Point, priv.D, err = c.GenerateECDH(rand) - return -} - -func Encrypt(random io.Reader, pub *PublicKey, msg, curveOID, fingerprint []byte) (vsG, c []byte, err error) { - if len(msg) > 40 { - return nil, nil, errors.New("ecdh: message too long") - } - // the sender MAY use 21, 13, and 5 bytes of padding for AES-128, - // AES-192, and AES-256, respectively, to provide the same number of - // octets, 40 total, as an input to the key wrapping method. - padding := make([]byte, 40-len(msg)) - for i := range padding { - padding[i] = byte(40 - len(msg)) - } - m := append(msg, padding...) - - ephemeral, zb, err := pub.curve.Encaps(random, pub.Point) - if err != nil { - return nil, nil, err - } - - vsG = pub.curve.MarshalBytePoint(ephemeral) - - z, err := buildKey(pub, zb, curveOID, fingerprint, false, false) - if err != nil { - return nil, nil, err - } - - if c, err = keywrap.Wrap(z, m); err != nil { - return nil, nil, err - } - - return vsG, c, nil - -} - -func Decrypt(priv *PrivateKey, vsG, c, curveOID, fingerprint []byte) (msg []byte, err error) { - var m []byte - zb, err := priv.PublicKey.curve.Decaps(priv.curve.UnmarshalBytePoint(vsG), priv.D) - - // Try buildKey three times to workaround an old bug, see comments in buildKey. - for i := 0; i < 3; i++ { - var z []byte - // RFC6637 §8: "Compute Z = KDF( S, Z_len, Param );" - z, err = buildKey(&priv.PublicKey, zb, curveOID, fingerprint, i == 1, i == 2) - if err != nil { - return nil, err - } - - // RFC6637 §8: "Compute C = AESKeyWrap( Z, c ) as per [RFC3394]" - m, err = keywrap.Unwrap(z, c) - if err == nil { - break - } - } - - // Only return an error after we've tried all (required) variants of buildKey. - if err != nil { - return nil, err - } - - // RFC6637 §8: "m = symm_alg_ID || session key || checksum || pkcs5_padding" - // The last byte should be the length of the padding, as per PKCS5; strip it off. - return m[:len(m)-int(m[len(m)-1])], nil -} - -func buildKey(pub *PublicKey, zb []byte, curveOID, fingerprint []byte, stripLeading, stripTrailing bool) ([]byte, error) { - // Param = curve_OID_len || curve_OID || public_key_alg_ID || 03 - // || 01 || KDF_hash_ID || KEK_alg_ID for AESKeyWrap - // || "Anonymous Sender " || recipient_fingerprint; - param := new(bytes.Buffer) - if _, err := param.Write(curveOID); err != nil { - return nil, err - } - algKDF := []byte{18, 3, 1, pub.KDF.Hash.Id(), pub.KDF.Cipher.Id()} - if _, err := param.Write(algKDF); err != nil { - return nil, err - } - if _, err := param.Write([]byte("Anonymous Sender ")); err != nil { - return nil, err - } - // For v5 keys, the 20 leftmost octets of the fingerprint are used. - if _, err := param.Write(fingerprint[:20]); err != nil { - return nil, err - } - if param.Len()-len(curveOID) != 45 { - return nil, errors.New("ecdh: malformed KDF Param") - } - - // MB = Hash ( 00 || 00 || 00 || 01 || ZB || Param ); - h := pub.KDF.Hash.New() - if _, err := h.Write([]byte{0x0, 0x0, 0x0, 0x1}); err != nil { - return nil, err - } - zbLen := len(zb) - i := 0 - j := zbLen - 1 - if stripLeading { - // Work around old go crypto bug where the leading zeros are missing. - for i < zbLen && zb[i] == 0 { - i++ - } - } - if stripTrailing { - // Work around old OpenPGP.js bug where insignificant trailing zeros in - // this little-endian number are missing. - // (See https://github.com/openpgpjs/openpgpjs/pull/853.) - for j >= 0 && zb[j] == 0 { - j-- - } - } - if _, err := h.Write(zb[i : j+1]); err != nil { - return nil, err - } - if _, err := h.Write(param.Bytes()); err != nil { - return nil, err - } - mb := h.Sum(nil) - - return mb[:pub.KDF.Cipher.KeySize()], nil // return oBits leftmost bits of MB. - -} - -func Validate(priv *PrivateKey) error { - return priv.curve.ValidateECDH(priv.Point, priv.D) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go deleted file mode 100644 index f94ae1b2f5..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/ecdsa/ecdsa.go +++ /dev/null @@ -1,80 +0,0 @@ -// Package ecdsa implements ECDSA signature, suitable for OpenPGP, -// as specified in RFC 6637, section 5. -package ecdsa - -import ( - "errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/ecc" - "io" - "math/big" -) - -type PublicKey struct { - X, Y *big.Int - curve ecc.ECDSACurve -} - -type PrivateKey struct { - PublicKey - D *big.Int -} - -func NewPublicKey(curve ecc.ECDSACurve) *PublicKey { - return &PublicKey{ - curve: curve, - } -} - -func NewPrivateKey(key PublicKey) *PrivateKey { - return &PrivateKey{ - PublicKey: key, - } -} - -func (pk *PublicKey) GetCurve() ecc.ECDSACurve { - return pk.curve -} - -func (pk *PublicKey) MarshalPoint() []byte { - return pk.curve.MarshalIntegerPoint(pk.X, pk.Y) -} - -func (pk *PublicKey) UnmarshalPoint(p []byte) error { - pk.X, pk.Y = pk.curve.UnmarshalIntegerPoint(p) - if pk.X == nil { - return errors.New("ecdsa: failed to parse EC point") - } - return nil -} - -func (sk *PrivateKey) MarshalIntegerSecret() []byte { - return sk.curve.MarshalIntegerSecret(sk.D) -} - -func (sk *PrivateKey) UnmarshalIntegerSecret(d []byte) error { - sk.D = sk.curve.UnmarshalIntegerSecret(d) - - if sk.D == nil { - return errors.New("ecdsa: failed to parse scalar") - } - return nil -} - -func GenerateKey(rand io.Reader, c ecc.ECDSACurve) (priv *PrivateKey, err error) { - priv = new(PrivateKey) - priv.PublicKey.curve = c - priv.PublicKey.X, priv.PublicKey.Y, priv.D, err = c.GenerateECDSA(rand) - return -} - -func Sign(rand io.Reader, priv *PrivateKey, hash []byte) (r, s *big.Int, err error) { - return priv.PublicKey.curve.Sign(rand, priv.X, priv.Y, priv.D, hash) -} - -func Verify(pub *PublicKey, hash []byte, r, s *big.Int) bool { - return pub.curve.Verify(pub.X, pub.Y, hash, r, s) -} - -func Validate(priv *PrivateKey) error { - return priv.curve.ValidateECDSA(priv.X, priv.Y, priv.D.Bytes()) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go deleted file mode 100644 index 99ecfc7f12..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/eddsa/eddsa.go +++ /dev/null @@ -1,91 +0,0 @@ -// Package eddsa implements EdDSA signature, suitable for OpenPGP, as specified in -// https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7 -package eddsa - -import ( - "errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/ecc" - "io" -) - -type PublicKey struct { - X []byte - curve ecc.EdDSACurve -} - -type PrivateKey struct { - PublicKey - D []byte -} - -func NewPublicKey(curve ecc.EdDSACurve) *PublicKey { - return &PublicKey{ - curve: curve, - } -} - -func NewPrivateKey(key PublicKey) *PrivateKey { - return &PrivateKey{ - PublicKey: key, - } -} - -func (pk *PublicKey) GetCurve() ecc.EdDSACurve { - return pk.curve -} - -func (pk *PublicKey) MarshalPoint() []byte { - return pk.curve.MarshalBytePoint(pk.X) -} - -func (pk *PublicKey) UnmarshalPoint(x []byte) error { - pk.X = pk.curve.UnmarshalBytePoint(x) - - if pk.X == nil { - return errors.New("eddsa: failed to parse EC point") - } - return nil -} - -func (sk *PrivateKey) MarshalByteSecret() []byte { - return sk.curve.MarshalByteSecret(sk.D) -} - -func (sk *PrivateKey) UnmarshalByteSecret(d []byte) error { - sk.D = sk.curve.UnmarshalByteSecret(d) - - if sk.D == nil { - return errors.New("eddsa: failed to parse scalar") - } - return nil -} - -func GenerateKey(rand io.Reader, c ecc.EdDSACurve) (priv *PrivateKey, err error) { - priv = new(PrivateKey) - priv.PublicKey.curve = c - priv.PublicKey.X, priv.D, err = c.GenerateEdDSA(rand) - return -} - -func Sign(priv *PrivateKey, message []byte) (r, s []byte, err error) { - sig, err := priv.PublicKey.curve.Sign(priv.PublicKey.X, priv.D, message) - if err != nil { - return nil, nil, err - } - - r, s = priv.PublicKey.curve.MarshalSignature(sig) - return -} - -func Verify(pub *PublicKey, message, r, s []byte) bool { - sig := pub.curve.UnmarshalSignature(r, s) - if sig == nil { - return false - } - - return pub.curve.Verify(pub.X, message, sig) -} - -func Validate(priv *PrivateKey) error { - return priv.curve.ValidateEdDSA(priv.PublicKey.X, priv.D) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go deleted file mode 100644 index bad2774344..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/elgamal/elgamal.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package elgamal implements ElGamal encryption, suitable for OpenPGP, -// as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on -// Discrete Logarithms," IEEE Transactions on Information Theory, v. IT-31, -// n. 4, 1985, pp. 469-472. -// -// This form of ElGamal embeds PKCS#1 v1.5 padding, which may make it -// unsuitable for other protocols. RSA should be used in preference in any -// case. -package elgamal // import "github.com/ProtonMail/go-crypto/openpgp/elgamal" - -import ( - "crypto/rand" - "crypto/subtle" - "errors" - "io" - "math/big" -) - -// PublicKey represents an ElGamal public key. -type PublicKey struct { - G, P, Y *big.Int -} - -// PrivateKey represents an ElGamal private key. -type PrivateKey struct { - PublicKey - X *big.Int -} - -// Encrypt encrypts the given message to the given public key. The result is a -// pair of integers. Errors can result from reading random, or because msg is -// too large to be encrypted to the public key. -func Encrypt(random io.Reader, pub *PublicKey, msg []byte) (c1, c2 *big.Int, err error) { - pLen := (pub.P.BitLen() + 7) / 8 - if len(msg) > pLen-11 { - err = errors.New("elgamal: message too long") - return - } - - // EM = 0x02 || PS || 0x00 || M - em := make([]byte, pLen-1) - em[0] = 2 - ps, mm := em[1:len(em)-len(msg)-1], em[len(em)-len(msg):] - err = nonZeroRandomBytes(ps, random) - if err != nil { - return - } - em[len(em)-len(msg)-1] = 0 - copy(mm, msg) - - m := new(big.Int).SetBytes(em) - - k, err := rand.Int(random, pub.P) - if err != nil { - return - } - - c1 = new(big.Int).Exp(pub.G, k, pub.P) - s := new(big.Int).Exp(pub.Y, k, pub.P) - c2 = s.Mul(s, m) - c2.Mod(c2, pub.P) - - return -} - -// Decrypt takes two integers, resulting from an ElGamal encryption, and -// returns the plaintext of the message. An error can result only if the -// ciphertext is invalid. Users should keep in mind that this is a padding -// oracle and thus, if exposed to an adaptive chosen ciphertext attack, can -// be used to break the cryptosystem. See “Chosen Ciphertext Attacks -// Against Protocols Based on the RSA Encryption Standard PKCS #1”, Daniel -// Bleichenbacher, Advances in Cryptology (Crypto '98), -func Decrypt(priv *PrivateKey, c1, c2 *big.Int) (msg []byte, err error) { - s := new(big.Int).Exp(c1, priv.X, priv.P) - if s.ModInverse(s, priv.P) == nil { - return nil, errors.New("elgamal: invalid private key") - } - s.Mul(s, c2) - s.Mod(s, priv.P) - em := s.Bytes() - - firstByteIsTwo := subtle.ConstantTimeByteEq(em[0], 2) - - // The remainder of the plaintext must be a string of non-zero random - // octets, followed by a 0, followed by the message. - // lookingForIndex: 1 iff we are still looking for the zero. - // index: the offset of the first zero byte. - var lookingForIndex, index int - lookingForIndex = 1 - - for i := 1; i < len(em); i++ { - equals0 := subtle.ConstantTimeByteEq(em[i], 0) - index = subtle.ConstantTimeSelect(lookingForIndex&equals0, i, index) - lookingForIndex = subtle.ConstantTimeSelect(equals0, 0, lookingForIndex) - } - - if firstByteIsTwo != 1 || lookingForIndex != 0 || index < 9 { - return nil, errors.New("elgamal: decryption error") - } - return em[index+1:], nil -} - -// nonZeroRandomBytes fills the given slice with non-zero random octets. -func nonZeroRandomBytes(s []byte, rand io.Reader) (err error) { - _, err = io.ReadFull(rand, s) - if err != nil { - return - } - - for i := 0; i < len(s); i++ { - for s[i] == 0 { - _, err = io.ReadFull(rand, s[i:i+1]) - if err != nil { - return - } - } - } - - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go deleted file mode 100644 index 17e2bcfed2..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/errors/errors.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package errors contains common error types for the OpenPGP packages. -package errors // import "github.com/ProtonMail/go-crypto/openpgp/errors" - -import ( - "strconv" -) - -// A StructuralError is returned when OpenPGP data is found to be syntactically -// invalid. -type StructuralError string - -func (s StructuralError) Error() string { - return "openpgp: invalid data: " + string(s) -} - -// UnsupportedError indicates that, although the OpenPGP data is valid, it -// makes use of currently unimplemented features. -type UnsupportedError string - -func (s UnsupportedError) Error() string { - return "openpgp: unsupported feature: " + string(s) -} - -// InvalidArgumentError indicates that the caller is in error and passed an -// incorrect value. -type InvalidArgumentError string - -func (i InvalidArgumentError) Error() string { - return "openpgp: invalid argument: " + string(i) -} - -// SignatureError indicates that a syntactically valid signature failed to -// validate. -type SignatureError string - -func (b SignatureError) Error() string { - return "openpgp: invalid signature: " + string(b) -} - -var ErrMDCHashMismatch error = SignatureError("MDC hash mismatch") -var ErrMDCMissing error = SignatureError("MDC packet not found") - -type signatureExpiredError int - -func (se signatureExpiredError) Error() string { - return "openpgp: signature expired" -} - -var ErrSignatureExpired error = signatureExpiredError(0) - -type keyExpiredError int - -func (ke keyExpiredError) Error() string { - return "openpgp: key expired" -} - -var ErrKeyExpired error = keyExpiredError(0) - -type keyIncorrectError int - -func (ki keyIncorrectError) Error() string { - return "openpgp: incorrect key" -} - -var ErrKeyIncorrect error = keyIncorrectError(0) - -// KeyInvalidError indicates that the public key parameters are invalid -// as they do not match the private ones -type KeyInvalidError string - -func (e KeyInvalidError) Error() string { - return "openpgp: invalid key: " + string(e) -} - -type unknownIssuerError int - -func (unknownIssuerError) Error() string { - return "openpgp: signature made by unknown entity" -} - -var ErrUnknownIssuer error = unknownIssuerError(0) - -type keyRevokedError int - -func (keyRevokedError) Error() string { - return "openpgp: signature made by revoked key" -} - -var ErrKeyRevoked error = keyRevokedError(0) - -type UnknownPacketTypeError uint8 - -func (upte UnknownPacketTypeError) Error() string { - return "openpgp: unknown packet type: " + strconv.Itoa(int(upte)) -} - -// AEADError indicates that there is a problem when initializing or using a -// AEAD instance, configuration struct, nonces or index values. -type AEADError string - -func (ae AEADError) Error() string { - return "openpgp: aead error: " + string(ae) -} - -// ErrDummyPrivateKey results when operations are attempted on a private key -// that is just a dummy key. See -// https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;h=fe55ae16ab4e26d8356dc574c9e8bc935e71aef1;hb=23191d7851eae2217ecdac6484349849a24fd94a#l1109 -type ErrDummyPrivateKey string - -func (dke ErrDummyPrivateKey) Error() string { - return "openpgp: s2k GNU dummy key: " + string(dke) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go deleted file mode 100644 index 526bd7777f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/hash.go +++ /dev/null @@ -1,24 +0,0 @@ -package openpgp - -import ( - "crypto" - - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" -) - -// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP -// hash id. -func HashIdToHash(id byte) (h crypto.Hash, ok bool) { - return algorithm.HashIdToHash(id) -} - -// HashIdToString returns the name of the hash function corresponding to the -// given OpenPGP hash id. -func HashIdToString(id byte) (name string, ok bool) { - return algorithm.HashIdToString(id) -} - -// HashToHashId returns an OpenPGP hash id which corresponds the given Hash. -func HashToHashId(h crypto.Hash) (id byte, ok bool) { - return algorithm.HashToHashId(h) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go deleted file mode 100644 index d067065186..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/aead.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -package algorithm - -import ( - "crypto/cipher" - "github.com/ProtonMail/go-crypto/eax" - "github.com/ProtonMail/go-crypto/ocb" -) - -// AEADMode defines the Authenticated Encryption with Associated Data mode of -// operation. -type AEADMode uint8 - -// Supported modes of operation (see RFC4880bis [EAX] and RFC7253) -const ( - AEADModeEAX = AEADMode(1) - AEADModeOCB = AEADMode(2) - AEADModeGCM = AEADMode(3) -) - -// TagLength returns the length in bytes of authentication tags. -func (mode AEADMode) TagLength() int { - switch mode { - case AEADModeEAX: - return 16 - case AEADModeOCB: - return 16 - case AEADModeGCM: - return 16 - default: - return 0 - } -} - -// NonceLength returns the length in bytes of nonces. -func (mode AEADMode) NonceLength() int { - switch mode { - case AEADModeEAX: - return 16 - case AEADModeOCB: - return 15 - case AEADModeGCM: - return 12 - default: - return 0 - } -} - -// New returns a fresh instance of the given mode -func (mode AEADMode) New(block cipher.Block) (alg cipher.AEAD) { - var err error - switch mode { - case AEADModeEAX: - alg, err = eax.NewEAX(block) - case AEADModeOCB: - alg, err = ocb.NewOCB(block) - case AEADModeGCM: - alg, err = cipher.NewGCM(block) - } - if err != nil { - panic(err.Error()) - } - return alg -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go deleted file mode 100644 index 5760cff80e..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/cipher.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package algorithm - -import ( - "crypto/aes" - "crypto/cipher" - "crypto/des" - - "golang.org/x/crypto/cast5" -) - -// Cipher is an official symmetric key cipher algorithm. See RFC 4880, -// section 9.2. -type Cipher interface { - // Id returns the algorithm ID, as a byte, of the cipher. - Id() uint8 - // KeySize returns the key size, in bytes, of the cipher. - KeySize() int - // BlockSize returns the block size, in bytes, of the cipher. - BlockSize() int - // New returns a fresh instance of the given cipher. - New(key []byte) cipher.Block -} - -// The following constants mirror the OpenPGP standard (RFC 4880). -const ( - TripleDES = CipherFunction(2) - CAST5 = CipherFunction(3) - AES128 = CipherFunction(7) - AES192 = CipherFunction(8) - AES256 = CipherFunction(9) -) - -// CipherById represents the different block ciphers specified for OpenPGP. See -// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13 -var CipherById = map[uint8]Cipher{ - TripleDES.Id(): TripleDES, - CAST5.Id(): CAST5, - AES128.Id(): AES128, - AES192.Id(): AES192, - AES256.Id(): AES256, -} - -type CipherFunction uint8 - -// ID returns the algorithm Id, as a byte, of cipher. -func (sk CipherFunction) Id() uint8 { - return uint8(sk) -} - -var keySizeByID = map[uint8]int{ - TripleDES.Id(): 24, - CAST5.Id(): cast5.KeySize, - AES128.Id(): 16, - AES192.Id(): 24, - AES256.Id(): 32, -} - -// KeySize returns the key size, in bytes, of cipher. -func (cipher CipherFunction) KeySize() int { - switch cipher { - case TripleDES: - return 24 - case CAST5: - return cast5.KeySize - case AES128: - return 16 - case AES192: - return 24 - case AES256: - return 32 - } - return 0 -} - -// BlockSize returns the block size, in bytes, of cipher. -func (cipher CipherFunction) BlockSize() int { - switch cipher { - case TripleDES: - return des.BlockSize - case CAST5: - return 8 - case AES128, AES192, AES256: - return 16 - } - return 0 -} - -// New returns a fresh instance of the given cipher. -func (cipher CipherFunction) New(key []byte) (block cipher.Block) { - var err error - switch cipher { - case TripleDES: - block, err = des.NewTripleDESCipher(key) - case CAST5: - block, err = cast5.NewCipher(key) - case AES128, AES192, AES256: - block, err = aes.NewCipher(key) - } - if err != nil { - panic(err.Error()) - } - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go deleted file mode 100644 index d1a00fc749..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/algorithm/hash.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package algorithm - -import ( - "crypto" - "fmt" - "hash" -) - -// Hash is an official hash function algorithm. See RFC 4880, section 9.4. -type Hash interface { - // Id returns the algorithm ID, as a byte, of Hash. - Id() uint8 - // Available reports whether the given hash function is linked into the binary. - Available() bool - // HashFunc simply returns the value of h so that Hash implements SignerOpts. - HashFunc() crypto.Hash - // New returns a new hash.Hash calculating the given hash function. New - // panics if the hash function is not linked into the binary. - New() hash.Hash - // Size returns the length, in bytes, of a digest resulting from the given - // hash function. It doesn't require that the hash function in question be - // linked into the program. - Size() int - // String is the name of the hash function corresponding to the given - // OpenPGP hash id. - String() string -} - -// The following vars mirror the crypto/Hash supported hash functions. -var ( - SHA1 Hash = cryptoHash{2, crypto.SHA1} - SHA256 Hash = cryptoHash{8, crypto.SHA256} - SHA384 Hash = cryptoHash{9, crypto.SHA384} - SHA512 Hash = cryptoHash{10, crypto.SHA512} - SHA224 Hash = cryptoHash{11, crypto.SHA224} - SHA3_256 Hash = cryptoHash{12, crypto.SHA3_256} - SHA3_512 Hash = cryptoHash{14, crypto.SHA3_512} -) - -// HashById represents the different hash functions specified for OpenPGP. See -// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-14 -var ( - HashById = map[uint8]Hash{ - SHA256.Id(): SHA256, - SHA384.Id(): SHA384, - SHA512.Id(): SHA512, - SHA224.Id(): SHA224, - SHA3_256.Id(): SHA3_256, - SHA3_512.Id(): SHA3_512, - } -) - -// cryptoHash contains pairs relating OpenPGP's hash identifier with -// Go's crypto.Hash type. See RFC 4880, section 9.4. -type cryptoHash struct { - id uint8 - crypto.Hash -} - -// Id returns the algorithm ID, as a byte, of cryptoHash. -func (h cryptoHash) Id() uint8 { - return h.id -} - -var hashNames = map[uint8]string{ - SHA256.Id(): "SHA256", - SHA384.Id(): "SHA384", - SHA512.Id(): "SHA512", - SHA224.Id(): "SHA224", - SHA3_256.Id(): "SHA3-256", - SHA3_512.Id(): "SHA3-512", -} - -func (h cryptoHash) String() string { - s, ok := hashNames[h.id] - if !ok { - panic(fmt.Sprintf("Unsupported hash function %d", h.id)) - } - return s -} - -// HashIdToHash returns a crypto.Hash which corresponds to the given OpenPGP -// hash id. -func HashIdToHash(id byte) (h crypto.Hash, ok bool) { - if hash, ok := HashById[id]; ok { - return hash.HashFunc(), true - } - return 0, false -} - -// HashIdToHashWithSha1 returns a crypto.Hash which corresponds to the given OpenPGP -// hash id, allowing sha1. -func HashIdToHashWithSha1(id byte) (h crypto.Hash, ok bool) { - if hash, ok := HashById[id]; ok { - return hash.HashFunc(), true - } - - if id == SHA1.Id() { - return SHA1.HashFunc(), true - } - - return 0, false -} - -// HashIdToString returns the name of the hash function corresponding to the -// given OpenPGP hash id. -func HashIdToString(id byte) (name string, ok bool) { - if hash, ok := HashById[id]; ok { - return hash.String(), true - } - return "", false -} - -// HashToHashId returns an OpenPGP hash id which corresponds the given Hash. -func HashToHashId(h crypto.Hash) (id byte, ok bool) { - for id, hash := range HashById { - if hash.HashFunc() == h { - return id, true - } - } - - return 0, false -} - -// HashToHashIdWithSha1 returns an OpenPGP hash id which corresponds the given Hash, -// allowing instances of SHA1 -func HashToHashIdWithSha1(h crypto.Hash) (id byte, ok bool) { - for id, hash := range HashById { - if hash.HashFunc() == h { - return id, true - } - } - - if h == SHA1.HashFunc() { - return SHA1.Id(), true - } - - return 0, false -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go deleted file mode 100644 index 888767c4e4..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve25519.go +++ /dev/null @@ -1,171 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "crypto/subtle" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - x25519lib "github.com/cloudflare/circl/dh/x25519" -) - -type curve25519 struct{} - -func NewCurve25519() *curve25519 { - return &curve25519{} -} - -func (c *curve25519) GetCurveName() string { - return "curve25519" -} - -// MarshalBytePoint encodes the public point from native format, adding the prefix. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6 -func (c *curve25519) MarshalBytePoint(point []byte) []byte { - return append([]byte{0x40}, point...) -} - -// UnmarshalBytePoint decodes the public point to native format, removing the prefix. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6 -func (c *curve25519) UnmarshalBytePoint(point []byte) []byte { - if len(point) != x25519lib.Size+1 { - return nil - } - - // Remove prefix - return point[1:] -} - -// MarshalByteSecret encodes the secret scalar from native format. -// Note that the EC secret scalar differs from the definition of public keys in -// [Curve25519] in two ways: (1) the byte-ordering is big-endian, which is -// more uniform with how big integers are represented in OpenPGP, and (2) the -// leading zeros are truncated. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.1 -// Note that leading zero bytes are stripped later when encoding as an MPI. -func (c *curve25519) MarshalByteSecret(secret []byte) []byte { - d := make([]byte, x25519lib.Size) - copyReversed(d, secret) - - // The following ensures that the private key is a number of the form - // 2^{254} + 8 * [0, 2^{251}), in order to avoid the small subgroup of - // the curve. - // - // This masking is done internally in the underlying lib and so is unnecessary - // for security, but OpenPGP implementations require that private keys be - // pre-masked. - d[0] &= 127 - d[0] |= 64 - d[31] &= 248 - - return d -} - -// UnmarshalByteSecret decodes the secret scalar from native format. -// Note that the EC secret scalar differs from the definition of public keys in -// [Curve25519] in two ways: (1) the byte-ordering is big-endian, which is -// more uniform with how big integers are represented in OpenPGP, and (2) the -// leading zeros are truncated. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.1 -func (c *curve25519) UnmarshalByteSecret(d []byte) []byte { - if len(d) > x25519lib.Size { - return nil - } - - // Ensure truncated leading bytes are re-added - secret := make([]byte, x25519lib.Size) - copyReversed(secret, d) - - return secret -} - -// generateKeyPairBytes Generates a private-public key-pair. -// 'priv' is a private key; a little-endian scalar belonging to the set -// 2^{254} + 8 * [0, 2^{251}), in order to avoid the small subgroup of the -// curve. 'pub' is simply 'priv' * G where G is the base point. -// See https://cr.yp.to/ecdh.html and RFC7748, sec 5. -func (c *curve25519) generateKeyPairBytes(rand io.Reader) (priv, pub x25519lib.Key, err error) { - _, err = io.ReadFull(rand, priv[:]) - if err != nil { - return - } - - x25519lib.KeyGen(&pub, &priv) - return -} - -func (c *curve25519) GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error) { - priv, pub, err := c.generateKeyPairBytes(rand) - if err != nil { - return - } - - return pub[:], priv[:], nil -} - -func (c *genericCurve) MaskSecret(secret []byte) []byte { - return secret -} - -func (c *curve25519) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) { - // RFC6637 §8: "Generate an ephemeral key pair {v, V=vG}" - // ephemeralPrivate corresponds to `v`. - // ephemeralPublic corresponds to `V`. - ephemeralPrivate, ephemeralPublic, err := c.generateKeyPairBytes(rand) - if err != nil { - return nil, nil, err - } - - // RFC6637 §8: "Obtain the authenticated recipient public key R" - // pubKey corresponds to `R`. - var pubKey x25519lib.Key - copy(pubKey[:], point) - - // RFC6637 §8: "Compute the shared point S = vR" - // "VB = convert point V to the octet string" - // sharedPoint corresponds to `VB`. - var sharedPoint x25519lib.Key - x25519lib.Shared(&sharedPoint, &ephemeralPrivate, &pubKey) - - return ephemeralPublic[:], sharedPoint[:], nil -} - -func (c *curve25519) Decaps(vsG, secret []byte) (sharedSecret []byte, err error) { - var ephemeralPublic, decodedPrivate, sharedPoint x25519lib.Key - // RFC6637 §8: "The decryption is the inverse of the method given." - // All quoted descriptions in comments below describe encryption, and - // the reverse is performed. - // vsG corresponds to `VB` in RFC6637 §8 . - - // RFC6637 §8: "VB = convert point V to the octet string" - copy(ephemeralPublic[:], vsG) - - // decodedPrivate corresponds to `r` in RFC6637 §8 . - copy(decodedPrivate[:], secret) - - // RFC6637 §8: "Note that the recipient obtains the shared secret by calculating - // S = rV = rvG, where (r,R) is the recipient's key pair." - // sharedPoint corresponds to `S`. - x25519lib.Shared(&sharedPoint, &decodedPrivate, &ephemeralPublic) - - return sharedPoint[:], nil -} - -func (c *curve25519) ValidateECDH(point []byte, secret []byte) (err error) { - var pk, sk x25519lib.Key - copy(sk[:], secret) - x25519lib.KeyGen(&pk, &sk) - - if subtle.ConstantTimeCompare(point, pk[:]) == 0 { - return errors.KeyInvalidError("ecc: invalid curve25519 public point") - } - - return nil -} - -func copyReversed(out []byte, in []byte) { - l := len(in) - for i := 0; i < l; i++ { - out[i] = in[l-i-1] - } -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go deleted file mode 100644 index 35751034dd..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curve_info.go +++ /dev/null @@ -1,140 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "bytes" - "crypto/elliptic" - "github.com/ProtonMail/go-crypto/bitcurves" - "github.com/ProtonMail/go-crypto/brainpool" - "github.com/ProtonMail/go-crypto/openpgp/internal/encoding" -) - -type CurveInfo struct { - GenName string - Oid *encoding.OID - Curve Curve -} - -var Curves = []CurveInfo{ - { - // NIST P-256 - GenName: "P256", - Oid: encoding.NewOID([]byte{0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07}), - Curve: NewGenericCurve(elliptic.P256()), - }, - { - // NIST P-384 - GenName: "P384", - Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x22}), - Curve: NewGenericCurve(elliptic.P384()), - }, - { - // NIST P-521 - GenName: "P521", - Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x23}), - Curve: NewGenericCurve(elliptic.P521()), - }, - { - // SecP256k1 - GenName: "SecP256k1", - Oid: encoding.NewOID([]byte{0x2B, 0x81, 0x04, 0x00, 0x0A}), - Curve: NewGenericCurve(bitcurves.S256()), - }, - { - // Curve25519 - GenName: "Curve25519", - Oid: encoding.NewOID([]byte{0x2B, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x05, 0x01}), - Curve: NewCurve25519(), - }, - { - // X448 - GenName: "Curve448", - Oid: encoding.NewOID([]byte{0x2B, 0x65, 0x6F}), - Curve: NewX448(), - }, - { - // Ed25519 - GenName: "Curve25519", - Oid: encoding.NewOID([]byte{0x2B, 0x06, 0x01, 0x04, 0x01, 0xDA, 0x47, 0x0F, 0x01}), - Curve: NewEd25519(), - }, - { - // Ed448 - GenName: "Curve448", - Oid: encoding.NewOID([]byte{0x2B, 0x65, 0x71}), - Curve: NewEd448(), - }, - { - // BrainpoolP256r1 - GenName: "BrainpoolP256", - Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07}), - Curve: NewGenericCurve(brainpool.P256r1()), - }, - { - // BrainpoolP384r1 - GenName: "BrainpoolP384", - Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0B}), - Curve: NewGenericCurve(brainpool.P384r1()), - }, - { - // BrainpoolP512r1 - GenName: "BrainpoolP512", - Oid: encoding.NewOID([]byte{0x2B, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0D}), - Curve: NewGenericCurve(brainpool.P512r1()), - }, -} - -func FindByCurve(curve Curve) *CurveInfo { - for _, curveInfo := range Curves { - if curveInfo.Curve.GetCurveName() == curve.GetCurveName() { - return &curveInfo - } - } - return nil -} - -func FindByOid(oid encoding.Field) *CurveInfo { - var rawBytes = oid.Bytes() - for _, curveInfo := range Curves { - if bytes.Equal(curveInfo.Oid.Bytes(), rawBytes) { - return &curveInfo - } - } - return nil -} - -func FindEdDSAByGenName(curveGenName string) EdDSACurve { - for _, curveInfo := range Curves { - if curveInfo.GenName == curveGenName { - curve, ok := curveInfo.Curve.(EdDSACurve) - if ok { - return curve - } - } - } - return nil -} - -func FindECDSAByGenName(curveGenName string) ECDSACurve { - for _, curveInfo := range Curves { - if curveInfo.GenName == curveGenName { - curve, ok := curveInfo.Curve.(ECDSACurve) - if ok { - return curve - } - } - } - return nil -} - -func FindECDHByGenName(curveGenName string) ECDHCurve { - for _, curveInfo := range Curves { - if curveInfo.GenName == curveGenName { - curve, ok := curveInfo.Curve.(ECDHCurve) - if ok { - return curve - } - } - } - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go deleted file mode 100644 index 5ed9c93b3d..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/curves.go +++ /dev/null @@ -1,48 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "io" - "math/big" -) - -type Curve interface { - GetCurveName() string -} - -type ECDSACurve interface { - Curve - MarshalIntegerPoint(x, y *big.Int) []byte - UnmarshalIntegerPoint([]byte) (x, y *big.Int) - MarshalIntegerSecret(d *big.Int) []byte - UnmarshalIntegerSecret(d []byte) *big.Int - GenerateECDSA(rand io.Reader) (x, y, secret *big.Int, err error) - Sign(rand io.Reader, x, y, d *big.Int, hash []byte) (r, s *big.Int, err error) - Verify(x, y *big.Int, hash []byte, r, s *big.Int) bool - ValidateECDSA(x, y *big.Int, secret []byte) error -} - -type EdDSACurve interface { - Curve - MarshalBytePoint(x []byte) []byte - UnmarshalBytePoint([]byte) (x []byte) - MarshalByteSecret(d []byte) []byte - UnmarshalByteSecret(d []byte) []byte - MarshalSignature(sig []byte) (r, s []byte) - UnmarshalSignature(r, s []byte) (sig []byte) - GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error) - Sign(publicKey, privateKey, message []byte) (sig []byte, err error) - Verify(publicKey, message, sig []byte) bool - ValidateEdDSA(publicKey, privateKey []byte) (err error) -} -type ECDHCurve interface { - Curve - MarshalBytePoint([]byte) (encoded []byte) - UnmarshalBytePoint(encoded []byte) []byte - MarshalByteSecret(d []byte) []byte - UnmarshalByteSecret(d []byte) []byte - GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error) - Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) - Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error) - ValidateECDH(public []byte, secret []byte) error -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go deleted file mode 100644 index 54a08a8a38..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed25519.go +++ /dev/null @@ -1,112 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "crypto/subtle" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - ed25519lib "github.com/cloudflare/circl/sign/ed25519" -) - -const ed25519Size = 32 - -type ed25519 struct{} - -func NewEd25519() *ed25519 { - return &ed25519{} -} - -func (c *ed25519) GetCurveName() string { - return "ed25519" -} - -// MarshalBytePoint encodes the public point from native format, adding the prefix. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed25519) MarshalBytePoint(x []byte) []byte { - return append([]byte{0x40}, x...) -} - -// UnmarshalBytePoint decodes a point from prefixed format to native. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed25519) UnmarshalBytePoint(point []byte) (x []byte) { - if len(point) != ed25519lib.PublicKeySize+1 { - return nil - } - - // Return unprefixed - return point[1:] -} - -// MarshalByteSecret encodes a scalar in native format. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed25519) MarshalByteSecret(d []byte) []byte { - return d -} - -// UnmarshalByteSecret decodes a scalar in native format and re-adds the stripped leading zeroes -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed25519) UnmarshalByteSecret(s []byte) (d []byte) { - if len(s) > ed25519lib.SeedSize { - return nil - } - - // Handle stripped leading zeroes - d = make([]byte, ed25519lib.SeedSize) - copy(d[ed25519lib.SeedSize-len(s):], s) - return -} - -// MarshalSignature splits a signature in R and S. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.1 -func (c *ed25519) MarshalSignature(sig []byte) (r, s []byte) { - return sig[:ed25519Size], sig[ed25519Size:] -} - -// UnmarshalSignature decodes R and S in the native format, re-adding the stripped leading zeroes -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.1 -func (c *ed25519) UnmarshalSignature(r, s []byte) (sig []byte) { - // Check size - if len(r) > 32 || len(s) > 32 { - return nil - } - - sig = make([]byte, ed25519lib.SignatureSize) - - // Handle stripped leading zeroes - copy(sig[ed25519Size-len(r):ed25519Size], r) - copy(sig[ed25519lib.SignatureSize-len(s):], s) - return sig -} - -func (c *ed25519) GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error) { - pk, sk, err := ed25519lib.GenerateKey(rand) - - if err != nil { - return nil, nil, err - } - - return pk, sk[:ed25519lib.SeedSize], nil -} - -func getEd25519Sk(publicKey, privateKey []byte) ed25519lib.PrivateKey { - return append(privateKey, publicKey...) -} - -func (c *ed25519) Sign(publicKey, privateKey, message []byte) (sig []byte, err error) { - sig = ed25519lib.Sign(getEd25519Sk(publicKey, privateKey), message) - return sig, nil -} - -func (c *ed25519) Verify(publicKey, message, sig []byte) bool { - return ed25519lib.Verify(publicKey, message, sig) -} - -func (c *ed25519) ValidateEdDSA(publicKey, privateKey []byte) (err error) { - priv := getEd25519Sk(publicKey, privateKey) - expectedPriv := ed25519lib.NewKeyFromSeed(priv.Seed()) - if subtle.ConstantTimeCompare(priv, expectedPriv) == 0 { - return errors.KeyInvalidError("ecc: invalid ed25519 secret") - } - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go deleted file mode 100644 index 18cd80434b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/ed448.go +++ /dev/null @@ -1,111 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "crypto/subtle" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - ed448lib "github.com/cloudflare/circl/sign/ed448" -) - -type ed448 struct{} - -func NewEd448() *ed448 { - return &ed448{} -} - -func (c *ed448) GetCurveName() string { - return "ed448" -} - -// MarshalBytePoint encodes the public point from native format, adding the prefix. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed448) MarshalBytePoint(x []byte) []byte { - // Return prefixed - return append([]byte{0x40}, x...) -} - -// UnmarshalBytePoint decodes a point from prefixed format to native. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed448) UnmarshalBytePoint(point []byte) (x []byte) { - if len(point) != ed448lib.PublicKeySize+1 { - return nil - } - - // Strip prefix - return point[1:] -} - -// MarshalByteSecret encoded a scalar from native format to prefixed. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed448) MarshalByteSecret(d []byte) []byte { - // Return prefixed - return append([]byte{0x40}, d...) -} - -// UnmarshalByteSecret decodes a scalar from prefixed format to native. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.5 -func (c *ed448) UnmarshalByteSecret(s []byte) (d []byte) { - // Check prefixed size - if len(s) != ed448lib.SeedSize+1 { - return nil - } - - // Strip prefix - return s[1:] -} - -// MarshalSignature splits a signature in R and S, where R is in prefixed native format and -// S is an MPI with value zero. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.2 -func (c *ed448) MarshalSignature(sig []byte) (r, s []byte) { - return append([]byte{0x40}, sig...), []byte{} -} - -// UnmarshalSignature decodes R and S in the native format. Only R is used, in prefixed native format. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.2.3.3.2 -func (c *ed448) UnmarshalSignature(r, s []byte) (sig []byte) { - if len(r) != ed448lib.SignatureSize+1 { - return nil - } - - return r[1:] -} - -func (c *ed448) GenerateEdDSA(rand io.Reader) (pub, priv []byte, err error) { - pk, sk, err := ed448lib.GenerateKey(rand) - - if err != nil { - return nil, nil, err - } - - return pk, sk[:ed448lib.SeedSize], nil -} - -func getEd448Sk(publicKey, privateKey []byte) ed448lib.PrivateKey { - return append(privateKey, publicKey...) -} - -func (c *ed448) Sign(publicKey, privateKey, message []byte) (sig []byte, err error) { - // Ed448 is used with the empty string as a context string. - // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7 - sig = ed448lib.Sign(getEd448Sk(publicKey, privateKey), message, "") - - return sig, nil -} - -func (c *ed448) Verify(publicKey, message, sig []byte) bool { - // Ed448 is used with the empty string as a context string. - // See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-13.7 - return ed448lib.Verify(publicKey, message, sig, "") -} - -func (c *ed448) ValidateEdDSA(publicKey, privateKey []byte) (err error) { - priv := getEd448Sk(publicKey, privateKey) - expectedPriv := ed448lib.NewKeyFromSeed(priv.Seed()) - if subtle.ConstantTimeCompare(priv, expectedPriv) == 0 { - return errors.KeyInvalidError("ecc: invalid ed448 secret") - } - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go deleted file mode 100644 index e28d7c7106..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/generic.go +++ /dev/null @@ -1,149 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "crypto/ecdsa" - "crypto/elliptic" - "fmt" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "io" - "math/big" -) - -type genericCurve struct { - Curve elliptic.Curve -} - -func NewGenericCurve(c elliptic.Curve) *genericCurve { - return &genericCurve{ - Curve: c, - } -} - -func (c *genericCurve) GetCurveName() string { - return c.Curve.Params().Name -} - -func (c *genericCurve) MarshalBytePoint(point []byte) []byte { - return point -} - -func (c *genericCurve) UnmarshalBytePoint(point []byte) []byte { - return point -} - -func (c *genericCurve) MarshalIntegerPoint(x, y *big.Int) []byte { - return elliptic.Marshal(c.Curve, x, y) -} - -func (c *genericCurve) UnmarshalIntegerPoint(point []byte) (x, y *big.Int) { - return elliptic.Unmarshal(c.Curve, point) -} - -func (c *genericCurve) MarshalByteSecret(d []byte) []byte { - return d -} - -func (c *genericCurve) UnmarshalByteSecret(d []byte) []byte { - return d -} - -func (c *genericCurve) MarshalIntegerSecret(d *big.Int) []byte { - return d.Bytes() -} - -func (c *genericCurve) UnmarshalIntegerSecret(d []byte) *big.Int { - return new(big.Int).SetBytes(d) -} - -func (c *genericCurve) GenerateECDH(rand io.Reader) (point, secret []byte, err error) { - secret, x, y, err := elliptic.GenerateKey(c.Curve, rand) - if err != nil { - return nil, nil, err - } - - point = elliptic.Marshal(c.Curve, x, y) - return point, secret, nil -} - -func (c *genericCurve) GenerateECDSA(rand io.Reader) (x, y, secret *big.Int, err error) { - priv, err := ecdsa.GenerateKey(c.Curve, rand) - if err != nil { - return - } - - return priv.X, priv.Y, priv.D, nil -} - -func (c *genericCurve) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) { - xP, yP := elliptic.Unmarshal(c.Curve, point) - if xP == nil { - panic("invalid point") - } - - d, x, y, err := elliptic.GenerateKey(c.Curve, rand) - if err != nil { - return nil, nil, err - } - - vsG := elliptic.Marshal(c.Curve, x, y) - zbBig, _ := c.Curve.ScalarMult(xP, yP, d) - - byteLen := (c.Curve.Params().BitSize + 7) >> 3 - zb := make([]byte, byteLen) - zbBytes := zbBig.Bytes() - copy(zb[byteLen-len(zbBytes):], zbBytes) - - return vsG, zb, nil -} - -func (c *genericCurve) Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error) { - x, y := elliptic.Unmarshal(c.Curve, ephemeral) - zbBig, _ := c.Curve.ScalarMult(x, y, secret) - byteLen := (c.Curve.Params().BitSize + 7) >> 3 - zb := make([]byte, byteLen) - zbBytes := zbBig.Bytes() - copy(zb[byteLen-len(zbBytes):], zbBytes) - - return zb, nil -} - -func (c *genericCurve) Sign(rand io.Reader, x, y, d *big.Int, hash []byte) (r, s *big.Int, err error) { - priv := &ecdsa.PrivateKey{D: d, PublicKey: ecdsa.PublicKey{X: x, Y: y, Curve: c.Curve}} - return ecdsa.Sign(rand, priv, hash) -} - -func (c *genericCurve) Verify(x, y *big.Int, hash []byte, r, s *big.Int) bool { - pub := &ecdsa.PublicKey{X: x, Y: y, Curve: c.Curve} - return ecdsa.Verify(pub, hash, r, s) -} - -func (c *genericCurve) validate(xP, yP *big.Int, secret []byte) error { - // the public point should not be at infinity (0,0) - zero := new(big.Int) - if xP.Cmp(zero) == 0 && yP.Cmp(zero) == 0 { - return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): infinity point", c.Curve.Params().Name)) - } - - // re-derive the public point Q' = (X,Y) = dG - // to compare to declared Q in public key - expectedX, expectedY := c.Curve.ScalarBaseMult(secret) - if xP.Cmp(expectedX) != 0 || yP.Cmp(expectedY) != 0 { - return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name)) - } - - return nil -} - -func (c *genericCurve) ValidateECDSA(xP, yP *big.Int, secret []byte) error { - return c.validate(xP, yP, secret) -} - -func (c *genericCurve) ValidateECDH(point []byte, secret []byte) error { - xP, yP := elliptic.Unmarshal(c.Curve, point) - if xP == nil { - return errors.KeyInvalidError(fmt.Sprintf("ecc (%s): invalid point", c.Curve.Params().Name)) - } - - return c.validate(xP, yP, secret) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go deleted file mode 100644 index ffdd51513b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/ecc/x448.go +++ /dev/null @@ -1,105 +0,0 @@ -// Package ecc implements a generic interface for ECDH, ECDSA, and EdDSA. -package ecc - -import ( - "crypto/subtle" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - x448lib "github.com/cloudflare/circl/dh/x448" -) - -type x448 struct{} - -func NewX448() *x448 { - return &x448{} -} - -func (c *x448) GetCurveName() string { - return "x448" -} - -// MarshalBytePoint encodes the public point from native format, adding the prefix. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6 -func (c *x448) MarshalBytePoint(point []byte) []byte { - return append([]byte{0x40}, point...) -} - -// UnmarshalBytePoint decodes a point from prefixed format to native. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6 -func (c *x448) UnmarshalBytePoint(point []byte) []byte { - if len(point) != x448lib.Size+1 { - return nil - } - - return point[1:] -} - -// MarshalByteSecret encoded a scalar from native format to prefixed. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.2 -func (c *x448) MarshalByteSecret(d []byte) []byte { - return append([]byte{0x40}, d...) -} - -// UnmarshalByteSecret decodes a scalar from prefixed format to native. -// See https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh-06#section-5.5.5.6.1.2 -func (c *x448) UnmarshalByteSecret(d []byte) []byte { - if len(d) != x448lib.Size+1 { - return nil - } - - // Store without prefix - return d[1:] -} - -func (c *x448) generateKeyPairBytes(rand io.Reader) (sk, pk x448lib.Key, err error) { - if _, err = rand.Read(sk[:]); err != nil { - return - } - - x448lib.KeyGen(&pk, &sk) - return -} - -func (c *x448) GenerateECDH(rand io.Reader) (point []byte, secret []byte, err error) { - priv, pub, err := c.generateKeyPairBytes(rand) - if err != nil { - return - } - - return pub[:], priv[:], nil -} - -func (c *x448) Encaps(rand io.Reader, point []byte) (ephemeral, sharedSecret []byte, err error) { - var pk, ss x448lib.Key - seed, e, err := c.generateKeyPairBytes(rand) - - copy(pk[:], point) - x448lib.Shared(&ss, &seed, &pk) - - return e[:], ss[:], nil -} - -func (c *x448) Decaps(ephemeral, secret []byte) (sharedSecret []byte, err error) { - var ss, sk, e x448lib.Key - - copy(sk[:], secret) - copy(e[:], ephemeral) - x448lib.Shared(&ss, &sk, &e) - - return ss[:], nil -} - -func (c *x448) ValidateECDH(point []byte, secret []byte) error { - var sk, pk, expectedPk x448lib.Key - - copy(pk[:], point) - copy(sk[:], secret) - x448lib.KeyGen(&expectedPk, &sk) - - if subtle.ConstantTimeCompare(expectedPk[:], pk[:]) == 0 { - return errors.KeyInvalidError("ecc: invalid curve25519 public point") - } - - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go deleted file mode 100644 index 6c921481b7..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/encoding.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package encoding implements openpgp packet field encodings as specified in -// RFC 4880 and 6637. -package encoding - -import "io" - -// Field is an encoded field of an openpgp packet. -type Field interface { - // Bytes returns the decoded data. - Bytes() []byte - - // BitLength is the size in bits of the decoded data. - BitLength() uint16 - - // EncodedBytes returns the encoded data. - EncodedBytes() []byte - - // EncodedLength is the size in bytes of the encoded data. - EncodedLength() uint16 - - // ReadFrom reads the next Field from r. - ReadFrom(r io.Reader) (int64, error) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go deleted file mode 100644 index 02e5e695c3..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/mpi.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package encoding - -import ( - "io" - "math/big" - "math/bits" -) - -// An MPI is used to store the contents of a big integer, along with the bit -// length that was specified in the original input. This allows the MPI to be -// reserialized exactly. -type MPI struct { - bytes []byte - bitLength uint16 -} - -// NewMPI returns a MPI initialized with bytes. -func NewMPI(bytes []byte) *MPI { - for len(bytes) != 0 && bytes[0] == 0 { - bytes = bytes[1:] - } - if len(bytes) == 0 { - bitLength := uint16(0) - return &MPI{bytes, bitLength} - } - bitLength := 8*uint16(len(bytes)-1) + uint16(bits.Len8(bytes[0])) - return &MPI{bytes, bitLength} -} - -// Bytes returns the decoded data. -func (m *MPI) Bytes() []byte { - return m.bytes -} - -// BitLength is the size in bits of the decoded data. -func (m *MPI) BitLength() uint16 { - return m.bitLength -} - -// EncodedBytes returns the encoded data. -func (m *MPI) EncodedBytes() []byte { - return append([]byte{byte(m.bitLength >> 8), byte(m.bitLength)}, m.bytes...) -} - -// EncodedLength is the size in bytes of the encoded data. -func (m *MPI) EncodedLength() uint16 { - return uint16(2 + len(m.bytes)) -} - -// ReadFrom reads into m the next MPI from r. -func (m *MPI) ReadFrom(r io.Reader) (int64, error) { - var buf [2]byte - n, err := io.ReadFull(r, buf[0:]) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return int64(n), err - } - - m.bitLength = uint16(buf[0])<<8 | uint16(buf[1]) - m.bytes = make([]byte, (int(m.bitLength)+7)/8) - - nn, err := io.ReadFull(r, m.bytes) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - - // remove leading zero bytes from malformed GnuPG encoded MPIs: - // https://bugs.gnupg.org/gnupg/issue1853 - // for _, b := range m.bytes { - // if b != 0 { - // break - // } - // m.bytes = m.bytes[1:] - // m.bitLength -= 8 - // } - - return int64(n) + int64(nn), err -} - -// SetBig initializes m with the bits from n. -func (m *MPI) SetBig(n *big.Int) *MPI { - m.bytes = n.Bytes() - m.bitLength = uint16(n.BitLen()) - return m -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go deleted file mode 100644 index c9df9fe232..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/internal/encoding/oid.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package encoding - -import ( - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// OID is used to store a variable-length field with a one-octet size -// prefix. See https://tools.ietf.org/html/rfc6637#section-9. -type OID struct { - bytes []byte -} - -const ( - // maxOID is the maximum number of bytes in a OID. - maxOID = 254 - // reservedOIDLength1 and reservedOIDLength2 are OID lengths that the RFC - // specifies are reserved. - reservedOIDLength1 = 0 - reservedOIDLength2 = 0xff -) - -// NewOID returns a OID initialized with bytes. -func NewOID(bytes []byte) *OID { - switch len(bytes) { - case reservedOIDLength1, reservedOIDLength2: - panic("encoding: NewOID argument length is reserved") - default: - if len(bytes) > maxOID { - panic("encoding: NewOID argument too large") - } - } - - return &OID{ - bytes: bytes, - } -} - -// Bytes returns the decoded data. -func (o *OID) Bytes() []byte { - return o.bytes -} - -// BitLength is the size in bits of the decoded data. -func (o *OID) BitLength() uint16 { - return uint16(len(o.bytes) * 8) -} - -// EncodedBytes returns the encoded data. -func (o *OID) EncodedBytes() []byte { - return append([]byte{byte(len(o.bytes))}, o.bytes...) -} - -// EncodedLength is the size in bytes of the encoded data. -func (o *OID) EncodedLength() uint16 { - return uint16(1 + len(o.bytes)) -} - -// ReadFrom reads into b the next OID from r. -func (o *OID) ReadFrom(r io.Reader) (int64, error) { - var buf [1]byte - n, err := io.ReadFull(r, buf[:]) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return int64(n), err - } - - switch buf[0] { - case reservedOIDLength1, reservedOIDLength2: - return int64(n), errors.UnsupportedError("reserved for future extensions") - } - - o.bytes = make([]byte, buf[0]) - - nn, err := io.ReadFull(r, o.bytes) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - - return int64(n) + int64(nn), err -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go deleted file mode 100644 index 0e71934cd9..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/key_generation.go +++ /dev/null @@ -1,389 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - "crypto" - "crypto/rand" - "crypto/rsa" - goerrors "errors" - "io" - "math/big" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/ecdh" - "github.com/ProtonMail/go-crypto/openpgp/ecdsa" - "github.com/ProtonMail/go-crypto/openpgp/eddsa" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/internal/ecc" - "github.com/ProtonMail/go-crypto/openpgp/packet" -) - -// NewEntity returns an Entity that contains a fresh RSA/RSA keypair with a -// single identity composed of the given full name, comment and email, any of -// which may be empty but must not contain any of "()<>\x00". -// If config is nil, sensible defaults will be used. -func NewEntity(name, comment, email string, config *packet.Config) (*Entity, error) { - creationTime := config.Now() - keyLifetimeSecs := config.KeyLifetime() - - // Generate a primary signing key - primaryPrivRaw, err := newSigner(config) - if err != nil { - return nil, err - } - primary := packet.NewSignerPrivateKey(creationTime, primaryPrivRaw) - if config != nil && config.V5Keys { - primary.UpgradeToV5() - } - - e := &Entity{ - PrimaryKey: &primary.PublicKey, - PrivateKey: primary, - Identities: make(map[string]*Identity), - Subkeys: []Subkey{}, - } - - err = e.addUserId(name, comment, email, config, creationTime, keyLifetimeSecs) - if err != nil { - return nil, err - } - - // NOTE: No key expiry here, but we will not return this subkey in EncryptionKey() - // if the primary/master key has expired. - err = e.addEncryptionSubkey(config, creationTime, 0) - if err != nil { - return nil, err - } - - return e, nil -} - -func (t *Entity) AddUserId(name, comment, email string, config *packet.Config) error { - creationTime := config.Now() - keyLifetimeSecs := config.KeyLifetime() - return t.addUserId(name, comment, email, config, creationTime, keyLifetimeSecs) -} - -func (t *Entity) addUserId(name, comment, email string, config *packet.Config, creationTime time.Time, keyLifetimeSecs uint32) error { - uid := packet.NewUserId(name, comment, email) - if uid == nil { - return errors.InvalidArgumentError("user id field contained invalid characters") - } - - if _, ok := t.Identities[uid.Id]; ok { - return errors.InvalidArgumentError("user id exist") - } - - primary := t.PrivateKey - - isPrimaryId := len(t.Identities) == 0 - - selfSignature := createSignaturePacket(&primary.PublicKey, packet.SigTypePositiveCert, config) - selfSignature.CreationTime = creationTime - selfSignature.KeyLifetimeSecs = &keyLifetimeSecs - selfSignature.IsPrimaryId = &isPrimaryId - selfSignature.FlagsValid = true - selfSignature.FlagSign = true - selfSignature.FlagCertify = true - selfSignature.SEIPDv1 = true // true by default, see 5.8 vs. 5.14 - selfSignature.SEIPDv2 = config.AEAD() != nil - - // Set the PreferredHash for the SelfSignature from the packet.Config. - // If it is not the must-implement algorithm from rfc4880bis, append that. - hash, ok := algorithm.HashToHashId(config.Hash()) - if !ok { - return errors.UnsupportedError("unsupported preferred hash function") - } - - selfSignature.PreferredHash = []uint8{hash} - if config.Hash() != crypto.SHA256 { - selfSignature.PreferredHash = append(selfSignature.PreferredHash, hashToHashId(crypto.SHA256)) - } - - // Likewise for DefaultCipher. - selfSignature.PreferredSymmetric = []uint8{uint8(config.Cipher())} - if config.Cipher() != packet.CipherAES128 { - selfSignature.PreferredSymmetric = append(selfSignature.PreferredSymmetric, uint8(packet.CipherAES128)) - } - - // We set CompressionNone as the preferred compression algorithm because - // of compression side channel attacks, then append the configured - // DefaultCompressionAlgo if any is set (to signal support for cases - // where the application knows that using compression is safe). - selfSignature.PreferredCompression = []uint8{uint8(packet.CompressionNone)} - if config.Compression() != packet.CompressionNone { - selfSignature.PreferredCompression = append(selfSignature.PreferredCompression, uint8(config.Compression())) - } - - // And for DefaultMode. - modes := []uint8{uint8(config.AEAD().Mode())} - if config.AEAD().Mode() != packet.AEADModeOCB { - modes = append(modes, uint8(packet.AEADModeOCB)) - } - - // For preferred (AES256, GCM), we'll generate (AES256, GCM), (AES256, OCB), (AES128, GCM), (AES128, OCB) - for _, cipher := range selfSignature.PreferredSymmetric { - for _, mode := range modes { - selfSignature.PreferredCipherSuites = append(selfSignature.PreferredCipherSuites, [2]uint8{cipher, mode}) - } - } - - // User ID binding signature - err := selfSignature.SignUserId(uid.Id, &primary.PublicKey, primary, config) - if err != nil { - return err - } - t.Identities[uid.Id] = &Identity{ - Name: uid.Id, - UserId: uid, - SelfSignature: selfSignature, - Signatures: []*packet.Signature{selfSignature}, - } - return nil -} - -// AddSigningSubkey adds a signing keypair as a subkey to the Entity. -// If config is nil, sensible defaults will be used. -func (e *Entity) AddSigningSubkey(config *packet.Config) error { - creationTime := config.Now() - keyLifetimeSecs := config.KeyLifetime() - - subPrivRaw, err := newSigner(config) - if err != nil { - return err - } - sub := packet.NewSignerPrivateKey(creationTime, subPrivRaw) - sub.IsSubkey = true - if config != nil && config.V5Keys { - sub.UpgradeToV5() - } - - subkey := Subkey{ - PublicKey: &sub.PublicKey, - PrivateKey: sub, - } - subkey.Sig = createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyBinding, config) - subkey.Sig.CreationTime = creationTime - subkey.Sig.KeyLifetimeSecs = &keyLifetimeSecs - subkey.Sig.FlagsValid = true - subkey.Sig.FlagSign = true - subkey.Sig.EmbeddedSignature = createSignaturePacket(subkey.PublicKey, packet.SigTypePrimaryKeyBinding, config) - subkey.Sig.EmbeddedSignature.CreationTime = creationTime - - err = subkey.Sig.EmbeddedSignature.CrossSignKey(subkey.PublicKey, e.PrimaryKey, subkey.PrivateKey, config) - if err != nil { - return err - } - - err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) - if err != nil { - return err - } - - e.Subkeys = append(e.Subkeys, subkey) - return nil -} - -// AddEncryptionSubkey adds an encryption keypair as a subkey to the Entity. -// If config is nil, sensible defaults will be used. -func (e *Entity) AddEncryptionSubkey(config *packet.Config) error { - creationTime := config.Now() - keyLifetimeSecs := config.KeyLifetime() - return e.addEncryptionSubkey(config, creationTime, keyLifetimeSecs) -} - -func (e *Entity) addEncryptionSubkey(config *packet.Config, creationTime time.Time, keyLifetimeSecs uint32) error { - subPrivRaw, err := newDecrypter(config) - if err != nil { - return err - } - sub := packet.NewDecrypterPrivateKey(creationTime, subPrivRaw) - sub.IsSubkey = true - if config != nil && config.V5Keys { - sub.UpgradeToV5() - } - - subkey := Subkey{ - PublicKey: &sub.PublicKey, - PrivateKey: sub, - } - subkey.Sig = createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyBinding, config) - subkey.Sig.CreationTime = creationTime - subkey.Sig.KeyLifetimeSecs = &keyLifetimeSecs - subkey.Sig.FlagsValid = true - subkey.Sig.FlagEncryptStorage = true - subkey.Sig.FlagEncryptCommunications = true - - err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) - if err != nil { - return err - } - - e.Subkeys = append(e.Subkeys, subkey) - return nil -} - -// Generates a signing key -func newSigner(config *packet.Config) (signer interface{}, err error) { - switch config.PublicKeyAlgorithm() { - case packet.PubKeyAlgoRSA: - bits := config.RSAModulusBits() - if bits < 1024 { - return nil, errors.InvalidArgumentError("bits must be >= 1024") - } - if config != nil && len(config.RSAPrimes) >= 2 { - primes := config.RSAPrimes[0:2] - config.RSAPrimes = config.RSAPrimes[2:] - return generateRSAKeyWithPrimes(config.Random(), 2, bits, primes) - } - return rsa.GenerateKey(config.Random(), bits) - case packet.PubKeyAlgoEdDSA: - curve := ecc.FindEdDSAByGenName(string(config.CurveName())) - if curve == nil { - return nil, errors.InvalidArgumentError("unsupported curve") - } - - priv, err := eddsa.GenerateKey(config.Random(), curve) - if err != nil { - return nil, err - } - return priv, nil - case packet.PubKeyAlgoECDSA: - curve := ecc.FindECDSAByGenName(string(config.CurveName())) - if curve == nil { - return nil, errors.InvalidArgumentError("unsupported curve") - } - - priv, err := ecdsa.GenerateKey(config.Random(), curve) - if err != nil { - return nil, err - } - return priv, nil - default: - return nil, errors.InvalidArgumentError("unsupported public key algorithm") - } -} - -// Generates an encryption/decryption key -func newDecrypter(config *packet.Config) (decrypter interface{}, err error) { - switch config.PublicKeyAlgorithm() { - case packet.PubKeyAlgoRSA: - bits := config.RSAModulusBits() - if bits < 1024 { - return nil, errors.InvalidArgumentError("bits must be >= 1024") - } - if config != nil && len(config.RSAPrimes) >= 2 { - primes := config.RSAPrimes[0:2] - config.RSAPrimes = config.RSAPrimes[2:] - return generateRSAKeyWithPrimes(config.Random(), 2, bits, primes) - } - return rsa.GenerateKey(config.Random(), bits) - case packet.PubKeyAlgoEdDSA, packet.PubKeyAlgoECDSA: - fallthrough // When passing EdDSA or ECDSA, we generate an ECDH subkey - case packet.PubKeyAlgoECDH: - var kdf = ecdh.KDF{ - Hash: algorithm.SHA512, - Cipher: algorithm.AES256, - } - curve := ecc.FindECDHByGenName(string(config.CurveName())) - if curve == nil { - return nil, errors.InvalidArgumentError("unsupported curve") - } - return ecdh.GenerateKey(config.Random(), curve, kdf) - default: - return nil, errors.InvalidArgumentError("unsupported public key algorithm") - } -} - -var bigOne = big.NewInt(1) - -// generateRSAKeyWithPrimes generates a multi-prime RSA keypair of the -// given bit size, using the given random source and prepopulated primes. -func generateRSAKeyWithPrimes(random io.Reader, nprimes int, bits int, prepopulatedPrimes []*big.Int) (*rsa.PrivateKey, error) { - priv := new(rsa.PrivateKey) - priv.E = 65537 - - if nprimes < 2 { - return nil, goerrors.New("generateRSAKeyWithPrimes: nprimes must be >= 2") - } - - if bits < 1024 { - return nil, goerrors.New("generateRSAKeyWithPrimes: bits must be >= 1024") - } - - primes := make([]*big.Int, nprimes) - -NextSetOfPrimes: - for { - todo := bits - // crypto/rand should set the top two bits in each prime. - // Thus each prime has the form - // p_i = 2^bitlen(p_i) × 0.11... (in base 2). - // And the product is: - // P = 2^todo × α - // where α is the product of nprimes numbers of the form 0.11... - // - // If α < 1/2 (which can happen for nprimes > 2), we need to - // shift todo to compensate for lost bits: the mean value of 0.11... - // is 7/8, so todo + shift - nprimes * log2(7/8) ~= bits - 1/2 - // will give good results. - if nprimes >= 7 { - todo += (nprimes - 2) / 5 - } - for i := 0; i < nprimes; i++ { - var err error - if len(prepopulatedPrimes) == 0 { - primes[i], err = rand.Prime(random, todo/(nprimes-i)) - if err != nil { - return nil, err - } - } else { - primes[i] = prepopulatedPrimes[0] - prepopulatedPrimes = prepopulatedPrimes[1:] - } - - todo -= primes[i].BitLen() - } - - // Make sure that primes is pairwise unequal. - for i, prime := range primes { - for j := 0; j < i; j++ { - if prime.Cmp(primes[j]) == 0 { - continue NextSetOfPrimes - } - } - } - - n := new(big.Int).Set(bigOne) - totient := new(big.Int).Set(bigOne) - pminus1 := new(big.Int) - for _, prime := range primes { - n.Mul(n, prime) - pminus1.Sub(prime, bigOne) - totient.Mul(totient, pminus1) - } - if n.BitLen() != bits { - // This should never happen for nprimes == 2 because - // crypto/rand should set the top two bits in each prime. - // For nprimes > 2 we hope it does not happen often. - continue NextSetOfPrimes - } - - priv.D = new(big.Int) - e := big.NewInt(int64(priv.E)) - ok := priv.D.ModInverse(e, totient) - - if ok != nil { - priv.Primes = primes - priv.N = n - break - } - } - - priv.Precompute() - return priv, nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go deleted file mode 100644 index 2d7b0cf373..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys.go +++ /dev/null @@ -1,842 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - goerrors "errors" - "io" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/armor" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/packet" -) - -// PublicKeyType is the armor type for a PGP public key. -var PublicKeyType = "PGP PUBLIC KEY BLOCK" - -// PrivateKeyType is the armor type for a PGP private key. -var PrivateKeyType = "PGP PRIVATE KEY BLOCK" - -// An Entity represents the components of an OpenPGP key: a primary public key -// (which must be a signing key), one or more identities claimed by that key, -// and zero or more subkeys, which may be encryption keys. -type Entity struct { - PrimaryKey *packet.PublicKey - PrivateKey *packet.PrivateKey - Identities map[string]*Identity // indexed by Identity.Name - Revocations []*packet.Signature - Subkeys []Subkey -} - -// An Identity represents an identity claimed by an Entity and zero or more -// assertions by other entities about that claim. -type Identity struct { - Name string // by convention, has the form "Full Name (comment) " - UserId *packet.UserId - SelfSignature *packet.Signature - Revocations []*packet.Signature - Signatures []*packet.Signature // all (potentially unverified) self-signatures, revocations, and third-party signatures -} - -// A Subkey is an additional public key in an Entity. Subkeys can be used for -// encryption. -type Subkey struct { - PublicKey *packet.PublicKey - PrivateKey *packet.PrivateKey - Sig *packet.Signature - Revocations []*packet.Signature -} - -// A Key identifies a specific public key in an Entity. This is either the -// Entity's primary key or a subkey. -type Key struct { - Entity *Entity - PublicKey *packet.PublicKey - PrivateKey *packet.PrivateKey - SelfSignature *packet.Signature - Revocations []*packet.Signature -} - -// A KeyRing provides access to public and private keys. -type KeyRing interface { - // KeysById returns the set of keys that have the given key id. - KeysById(id uint64) []Key - // KeysByIdAndUsage returns the set of keys with the given id - // that also meet the key usage given by requiredUsage. - // The requiredUsage is expressed as the bitwise-OR of - // packet.KeyFlag* values. - KeysByIdUsage(id uint64, requiredUsage byte) []Key - // DecryptionKeys returns all private keys that are valid for - // decryption. - DecryptionKeys() []Key -} - -// PrimaryIdentity returns an Identity, preferring non-revoked identities, -// identities marked as primary, or the latest-created identity, in that order. -func (e *Entity) PrimaryIdentity() *Identity { - var primaryIdentity *Identity - for _, ident := range e.Identities { - if shouldPreferIdentity(primaryIdentity, ident) { - primaryIdentity = ident - } - } - return primaryIdentity -} - -func shouldPreferIdentity(existingId, potentialNewId *Identity) bool { - if existingId == nil { - return true - } - - if len(existingId.Revocations) > len(potentialNewId.Revocations) { - return true - } - - if len(existingId.Revocations) < len(potentialNewId.Revocations) { - return false - } - - if existingId.SelfSignature == nil { - return true - } - - if existingId.SelfSignature.IsPrimaryId != nil && *existingId.SelfSignature.IsPrimaryId && - !(potentialNewId.SelfSignature.IsPrimaryId != nil && *potentialNewId.SelfSignature.IsPrimaryId) { - return false - } - - if !(existingId.SelfSignature.IsPrimaryId != nil && *existingId.SelfSignature.IsPrimaryId) && - potentialNewId.SelfSignature.IsPrimaryId != nil && *potentialNewId.SelfSignature.IsPrimaryId { - return true - } - - return potentialNewId.SelfSignature.CreationTime.After(existingId.SelfSignature.CreationTime) -} - -// EncryptionKey returns the best candidate Key for encrypting a message to the -// given Entity. -func (e *Entity) EncryptionKey(now time.Time) (Key, bool) { - // Fail to find any encryption key if the... - i := e.PrimaryIdentity() - if e.PrimaryKey.KeyExpired(i.SelfSignature, now) || // primary key has expired - i.SelfSignature == nil || // user ID has no self-signature - i.SelfSignature.SigExpired(now) || // user ID self-signature has expired - e.Revoked(now) || // primary key has been revoked - i.Revoked(now) { // user ID has been revoked - return Key{}, false - } - - // Iterate the keys to find the newest, unexpired one - candidateSubkey := -1 - var maxTime time.Time - for i, subkey := range e.Subkeys { - if subkey.Sig.FlagsValid && - subkey.Sig.FlagEncryptCommunications && - subkey.PublicKey.PubKeyAlgo.CanEncrypt() && - !subkey.PublicKey.KeyExpired(subkey.Sig, now) && - !subkey.Sig.SigExpired(now) && - !subkey.Revoked(now) && - (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) { - candidateSubkey = i - maxTime = subkey.Sig.CreationTime - } - } - - if candidateSubkey != -1 { - subkey := e.Subkeys[candidateSubkey] - return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig, subkey.Revocations}, true - } - - // If we don't have any subkeys for encryption and the primary key - // is marked as OK to encrypt with, then we can use it. - if i.SelfSignature.FlagsValid && i.SelfSignature.FlagEncryptCommunications && - e.PrimaryKey.PubKeyAlgo.CanEncrypt() { - return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature, e.Revocations}, true - } - - return Key{}, false -} - -// CertificationKey return the best candidate Key for certifying a key with this -// Entity. -func (e *Entity) CertificationKey(now time.Time) (Key, bool) { - return e.CertificationKeyById(now, 0) -} - -// CertificationKeyById return the Key for key certification with this -// Entity and keyID. -func (e *Entity) CertificationKeyById(now time.Time, id uint64) (Key, bool) { - return e.signingKeyByIdUsage(now, id, packet.KeyFlagCertify) -} - -// SigningKey return the best candidate Key for signing a message with this -// Entity. -func (e *Entity) SigningKey(now time.Time) (Key, bool) { - return e.SigningKeyById(now, 0) -} - -// SigningKeyById return the Key for signing a message with this -// Entity and keyID. -func (e *Entity) SigningKeyById(now time.Time, id uint64) (Key, bool) { - return e.signingKeyByIdUsage(now, id, packet.KeyFlagSign) -} - -func (e *Entity) signingKeyByIdUsage(now time.Time, id uint64, flags int) (Key, bool) { - // Fail to find any signing key if the... - i := e.PrimaryIdentity() - if e.PrimaryKey.KeyExpired(i.SelfSignature, now) || // primary key has expired - i.SelfSignature == nil || // user ID has no self-signature - i.SelfSignature.SigExpired(now) || // user ID self-signature has expired - e.Revoked(now) || // primary key has been revoked - i.Revoked(now) { // user ID has been revoked - return Key{}, false - } - - // Iterate the keys to find the newest, unexpired one - candidateSubkey := -1 - var maxTime time.Time - for idx, subkey := range e.Subkeys { - if subkey.Sig.FlagsValid && - (flags&packet.KeyFlagCertify == 0 || subkey.Sig.FlagCertify) && - (flags&packet.KeyFlagSign == 0 || subkey.Sig.FlagSign) && - subkey.PublicKey.PubKeyAlgo.CanSign() && - !subkey.PublicKey.KeyExpired(subkey.Sig, now) && - !subkey.Sig.SigExpired(now) && - !subkey.Revoked(now) && - (maxTime.IsZero() || subkey.Sig.CreationTime.After(maxTime)) && - (id == 0 || subkey.PublicKey.KeyId == id) { - candidateSubkey = idx - maxTime = subkey.Sig.CreationTime - } - } - - if candidateSubkey != -1 { - subkey := e.Subkeys[candidateSubkey] - return Key{e, subkey.PublicKey, subkey.PrivateKey, subkey.Sig, subkey.Revocations}, true - } - - // If we don't have any subkeys for signing and the primary key - // is marked as OK to sign with, then we can use it. - if i.SelfSignature.FlagsValid && - (flags&packet.KeyFlagCertify == 0 || i.SelfSignature.FlagCertify) && - (flags&packet.KeyFlagSign == 0 || i.SelfSignature.FlagSign) && - e.PrimaryKey.PubKeyAlgo.CanSign() && - (id == 0 || e.PrimaryKey.KeyId == id) { - return Key{e, e.PrimaryKey, e.PrivateKey, i.SelfSignature, e.Revocations}, true - } - - // No keys with a valid Signing Flag or no keys matched the id passed in - return Key{}, false -} - -func revoked(revocations []*packet.Signature, now time.Time) bool { - for _, revocation := range revocations { - if revocation.RevocationReason != nil && *revocation.RevocationReason == packet.KeyCompromised { - // If the key is compromised, the key is considered revoked even before the revocation date. - return true - } - if !revocation.SigExpired(now) { - return true - } - } - return false -} - -// Revoked returns whether the entity has any direct key revocation signatures. -// Note that third-party revocation signatures are not supported. -// Note also that Identity and Subkey revocation should be checked separately. -func (e *Entity) Revoked(now time.Time) bool { - return revoked(e.Revocations, now) -} - -// EncryptPrivateKeys encrypts all non-encrypted keys in the entity with the same key -// derived from the provided passphrase. Public keys and dummy keys are ignored, -// and don't cause an error to be returned. -func (e *Entity) EncryptPrivateKeys(passphrase []byte, config *packet.Config) error { - var keysToEncrypt []*packet.PrivateKey - // Add entity private key to encrypt. - if e.PrivateKey != nil && !e.PrivateKey.Dummy() && !e.PrivateKey.Encrypted { - keysToEncrypt = append(keysToEncrypt, e.PrivateKey) - } - - // Add subkeys to encrypt. - for _, sub := range e.Subkeys { - if sub.PrivateKey != nil && !sub.PrivateKey.Dummy() && !sub.PrivateKey.Encrypted { - keysToEncrypt = append(keysToEncrypt, sub.PrivateKey) - } - } - return packet.EncryptPrivateKeys(keysToEncrypt, passphrase, config) -} - -// DecryptPrivateKeys decrypts all encrypted keys in the entitiy with the given passphrase. -// Avoids recomputation of similar s2k key derivations. Public keys and dummy keys are ignored, -// and don't cause an error to be returned. -func (e *Entity) DecryptPrivateKeys(passphrase []byte) error { - var keysToDecrypt []*packet.PrivateKey - // Add entity private key to decrypt. - if e.PrivateKey != nil && !e.PrivateKey.Dummy() && e.PrivateKey.Encrypted { - keysToDecrypt = append(keysToDecrypt, e.PrivateKey) - } - - // Add subkeys to decrypt. - for _, sub := range e.Subkeys { - if sub.PrivateKey != nil && !sub.PrivateKey.Dummy() && sub.PrivateKey.Encrypted { - keysToDecrypt = append(keysToDecrypt, sub.PrivateKey) - } - } - return packet.DecryptPrivateKeys(keysToDecrypt, passphrase) -} - -// Revoked returns whether the identity has been revoked by a self-signature. -// Note that third-party revocation signatures are not supported. -func (i *Identity) Revoked(now time.Time) bool { - return revoked(i.Revocations, now) -} - -// Revoked returns whether the subkey has been revoked by a self-signature. -// Note that third-party revocation signatures are not supported. -func (s *Subkey) Revoked(now time.Time) bool { - return revoked(s.Revocations, now) -} - -// Revoked returns whether the key or subkey has been revoked by a self-signature. -// Note that third-party revocation signatures are not supported. -// Note also that Identity revocation should be checked separately. -// Normally, it's not necessary to call this function, except on keys returned by -// KeysById or KeysByIdUsage. -func (key *Key) Revoked(now time.Time) bool { - return revoked(key.Revocations, now) -} - -// An EntityList contains one or more Entities. -type EntityList []*Entity - -// KeysById returns the set of keys that have the given key id. -func (el EntityList) KeysById(id uint64) (keys []Key) { - for _, e := range el { - if e.PrimaryKey.KeyId == id { - ident := e.PrimaryIdentity() - selfSig := ident.SelfSignature - keys = append(keys, Key{e, e.PrimaryKey, e.PrivateKey, selfSig, e.Revocations}) - } - - for _, subKey := range e.Subkeys { - if subKey.PublicKey.KeyId == id { - keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig, subKey.Revocations}) - } - } - } - return -} - -// KeysByIdAndUsage returns the set of keys with the given id that also meet -// the key usage given by requiredUsage. The requiredUsage is expressed as -// the bitwise-OR of packet.KeyFlag* values. -func (el EntityList) KeysByIdUsage(id uint64, requiredUsage byte) (keys []Key) { - for _, key := range el.KeysById(id) { - if requiredUsage != 0 { - if key.SelfSignature == nil || !key.SelfSignature.FlagsValid { - continue - } - - var usage byte - if key.SelfSignature.FlagCertify { - usage |= packet.KeyFlagCertify - } - if key.SelfSignature.FlagSign { - usage |= packet.KeyFlagSign - } - if key.SelfSignature.FlagEncryptCommunications { - usage |= packet.KeyFlagEncryptCommunications - } - if key.SelfSignature.FlagEncryptStorage { - usage |= packet.KeyFlagEncryptStorage - } - if usage&requiredUsage != requiredUsage { - continue - } - } - - keys = append(keys, key) - } - return -} - -// DecryptionKeys returns all private keys that are valid for decryption. -func (el EntityList) DecryptionKeys() (keys []Key) { - for _, e := range el { - for _, subKey := range e.Subkeys { - if subKey.PrivateKey != nil && subKey.Sig.FlagsValid && (subKey.Sig.FlagEncryptStorage || subKey.Sig.FlagEncryptCommunications) { - keys = append(keys, Key{e, subKey.PublicKey, subKey.PrivateKey, subKey.Sig, subKey.Revocations}) - } - } - } - return -} - -// ReadArmoredKeyRing reads one or more public/private keys from an armor keyring file. -func ReadArmoredKeyRing(r io.Reader) (EntityList, error) { - block, err := armor.Decode(r) - if err == io.EOF { - return nil, errors.InvalidArgumentError("no armored data found") - } - if err != nil { - return nil, err - } - if block.Type != PublicKeyType && block.Type != PrivateKeyType { - return nil, errors.InvalidArgumentError("expected public or private key block, got: " + block.Type) - } - - return ReadKeyRing(block.Body) -} - -// ReadKeyRing reads one or more public/private keys. Unsupported keys are -// ignored as long as at least a single valid key is found. -func ReadKeyRing(r io.Reader) (el EntityList, err error) { - packets := packet.NewReader(r) - var lastUnsupportedError error - - for { - var e *Entity - e, err = ReadEntity(packets) - if err != nil { - // TODO: warn about skipped unsupported/unreadable keys - if _, ok := err.(errors.UnsupportedError); ok { - lastUnsupportedError = err - err = readToNextPublicKey(packets) - } else if _, ok := err.(errors.StructuralError); ok { - // Skip unreadable, badly-formatted keys - lastUnsupportedError = err - err = readToNextPublicKey(packets) - } - if err == io.EOF { - err = nil - break - } - if err != nil { - el = nil - break - } - } else { - el = append(el, e) - } - } - - if len(el) == 0 && err == nil { - err = lastUnsupportedError - } - return -} - -// readToNextPublicKey reads packets until the start of the entity and leaves -// the first packet of the new entity in the Reader. -func readToNextPublicKey(packets *packet.Reader) (err error) { - var p packet.Packet - for { - p, err = packets.Next() - if err == io.EOF { - return - } else if err != nil { - if _, ok := err.(errors.UnsupportedError); ok { - err = nil - continue - } - return - } - - if pk, ok := p.(*packet.PublicKey); ok && !pk.IsSubkey { - packets.Unread(p) - return - } - } -} - -// ReadEntity reads an entity (public key, identities, subkeys etc) from the -// given Reader. -func ReadEntity(packets *packet.Reader) (*Entity, error) { - e := new(Entity) - e.Identities = make(map[string]*Identity) - - p, err := packets.Next() - if err != nil { - return nil, err - } - - var ok bool - if e.PrimaryKey, ok = p.(*packet.PublicKey); !ok { - if e.PrivateKey, ok = p.(*packet.PrivateKey); !ok { - packets.Unread(p) - return nil, errors.StructuralError("first packet was not a public/private key") - } - e.PrimaryKey = &e.PrivateKey.PublicKey - } - - if !e.PrimaryKey.PubKeyAlgo.CanSign() { - return nil, errors.StructuralError("primary key cannot be used for signatures") - } - - var revocations []*packet.Signature -EachPacket: - for { - p, err := packets.Next() - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - - switch pkt := p.(type) { - case *packet.UserId: - if err := addUserID(e, packets, pkt); err != nil { - return nil, err - } - case *packet.Signature: - if pkt.SigType == packet.SigTypeKeyRevocation { - revocations = append(revocations, pkt) - } else if pkt.SigType == packet.SigTypeDirectSignature { - // TODO: RFC4880 5.2.1 permits signatures - // directly on keys (eg. to bind additional - // revocation keys). - } - // Else, ignoring the signature as it does not follow anything - // we would know to attach it to. - case *packet.PrivateKey: - if !pkt.IsSubkey { - packets.Unread(p) - break EachPacket - } - err = addSubkey(e, packets, &pkt.PublicKey, pkt) - if err != nil { - return nil, err - } - case *packet.PublicKey: - if !pkt.IsSubkey { - packets.Unread(p) - break EachPacket - } - err = addSubkey(e, packets, pkt, nil) - if err != nil { - return nil, err - } - default: - // we ignore unknown packets - } - } - - if len(e.Identities) == 0 { - return nil, errors.StructuralError("entity without any identities") - } - - for _, revocation := range revocations { - err = e.PrimaryKey.VerifyRevocationSignature(revocation) - if err == nil { - e.Revocations = append(e.Revocations, revocation) - } else { - // TODO: RFC 4880 5.2.3.15 defines revocation keys. - return nil, errors.StructuralError("revocation signature signed by alternate key") - } - } - - return e, nil -} - -func addUserID(e *Entity, packets *packet.Reader, pkt *packet.UserId) error { - // Make a new Identity object, that we might wind up throwing away. - // We'll only add it if we get a valid self-signature over this - // userID. - identity := new(Identity) - identity.Name = pkt.Id - identity.UserId = pkt - - for { - p, err := packets.Next() - if err == io.EOF { - break - } else if err != nil { - return err - } - - sig, ok := p.(*packet.Signature) - if !ok { - packets.Unread(p) - break - } - - if sig.SigType != packet.SigTypeGenericCert && - sig.SigType != packet.SigTypePersonaCert && - sig.SigType != packet.SigTypeCasualCert && - sig.SigType != packet.SigTypePositiveCert && - sig.SigType != packet.SigTypeCertificationRevocation { - return errors.StructuralError("user ID signature with wrong type") - } - - if sig.CheckKeyIdOrFingerprint(e.PrimaryKey) { - if err = e.PrimaryKey.VerifyUserIdSignature(pkt.Id, e.PrimaryKey, sig); err != nil { - return errors.StructuralError("user ID self-signature invalid: " + err.Error()) - } - if sig.SigType == packet.SigTypeCertificationRevocation { - identity.Revocations = append(identity.Revocations, sig) - } else if identity.SelfSignature == nil || sig.CreationTime.After(identity.SelfSignature.CreationTime) { - identity.SelfSignature = sig - } - identity.Signatures = append(identity.Signatures, sig) - e.Identities[pkt.Id] = identity - } else { - identity.Signatures = append(identity.Signatures, sig) - } - } - - return nil -} - -func addSubkey(e *Entity, packets *packet.Reader, pub *packet.PublicKey, priv *packet.PrivateKey) error { - var subKey Subkey - subKey.PublicKey = pub - subKey.PrivateKey = priv - - for { - p, err := packets.Next() - if err == io.EOF { - break - } else if err != nil { - return errors.StructuralError("subkey signature invalid: " + err.Error()) - } - - sig, ok := p.(*packet.Signature) - if !ok { - packets.Unread(p) - break - } - - if sig.SigType != packet.SigTypeSubkeyBinding && sig.SigType != packet.SigTypeSubkeyRevocation { - return errors.StructuralError("subkey signature with wrong type") - } - - if err := e.PrimaryKey.VerifyKeySignature(subKey.PublicKey, sig); err != nil { - return errors.StructuralError("subkey signature invalid: " + err.Error()) - } - - switch sig.SigType { - case packet.SigTypeSubkeyRevocation: - subKey.Revocations = append(subKey.Revocations, sig) - case packet.SigTypeSubkeyBinding: - if subKey.Sig == nil || sig.CreationTime.After(subKey.Sig.CreationTime) { - subKey.Sig = sig - } - } - } - - if subKey.Sig == nil { - return errors.StructuralError("subkey packet not followed by signature") - } - - e.Subkeys = append(e.Subkeys, subKey) - - return nil -} - -// SerializePrivate serializes an Entity, including private key material, but -// excluding signatures from other entities, to the given Writer. -// Identities and subkeys are re-signed in case they changed since NewEntry. -// If config is nil, sensible defaults will be used. -func (e *Entity) SerializePrivate(w io.Writer, config *packet.Config) (err error) { - if e.PrivateKey.Dummy() { - return errors.ErrDummyPrivateKey("dummy private key cannot re-sign identities") - } - return e.serializePrivate(w, config, true) -} - -// SerializePrivateWithoutSigning serializes an Entity, including private key -// material, but excluding signatures from other entities, to the given Writer. -// Self-signatures of identities and subkeys are not re-signed. This is useful -// when serializing GNU dummy keys, among other things. -// If config is nil, sensible defaults will be used. -func (e *Entity) SerializePrivateWithoutSigning(w io.Writer, config *packet.Config) (err error) { - return e.serializePrivate(w, config, false) -} - -func (e *Entity) serializePrivate(w io.Writer, config *packet.Config, reSign bool) (err error) { - if e.PrivateKey == nil { - return goerrors.New("openpgp: private key is missing") - } - err = e.PrivateKey.Serialize(w) - if err != nil { - return - } - for _, revocation := range e.Revocations { - err := revocation.Serialize(w) - if err != nil { - return err - } - } - for _, ident := range e.Identities { - err = ident.UserId.Serialize(w) - if err != nil { - return - } - if reSign { - if ident.SelfSignature == nil { - return goerrors.New("openpgp: can't re-sign identity without valid self-signature") - } - err = ident.SelfSignature.SignUserId(ident.UserId.Id, e.PrimaryKey, e.PrivateKey, config) - if err != nil { - return - } - } - for _, sig := range ident.Signatures { - err = sig.Serialize(w) - if err != nil { - return err - } - } - } - for _, subkey := range e.Subkeys { - err = subkey.PrivateKey.Serialize(w) - if err != nil { - return - } - if reSign { - err = subkey.Sig.SignKey(subkey.PublicKey, e.PrivateKey, config) - if err != nil { - return - } - if subkey.Sig.EmbeddedSignature != nil { - err = subkey.Sig.EmbeddedSignature.CrossSignKey(subkey.PublicKey, e.PrimaryKey, - subkey.PrivateKey, config) - if err != nil { - return - } - } - } - for _, revocation := range subkey.Revocations { - err := revocation.Serialize(w) - if err != nil { - return err - } - } - err = subkey.Sig.Serialize(w) - if err != nil { - return - } - } - return nil -} - -// Serialize writes the public part of the given Entity to w, including -// signatures from other entities. No private key material will be output. -func (e *Entity) Serialize(w io.Writer) error { - err := e.PrimaryKey.Serialize(w) - if err != nil { - return err - } - for _, revocation := range e.Revocations { - err := revocation.Serialize(w) - if err != nil { - return err - } - } - for _, ident := range e.Identities { - err = ident.UserId.Serialize(w) - if err != nil { - return err - } - for _, sig := range ident.Signatures { - err = sig.Serialize(w) - if err != nil { - return err - } - } - } - for _, subkey := range e.Subkeys { - err = subkey.PublicKey.Serialize(w) - if err != nil { - return err - } - for _, revocation := range subkey.Revocations { - err := revocation.Serialize(w) - if err != nil { - return err - } - } - err = subkey.Sig.Serialize(w) - if err != nil { - return err - } - } - return nil -} - -// SignIdentity adds a signature to e, from signer, attesting that identity is -// associated with e. The provided identity must already be an element of -// e.Identities and the private key of signer must have been decrypted if -// necessary. -// If config is nil, sensible defaults will be used. -func (e *Entity) SignIdentity(identity string, signer *Entity, config *packet.Config) error { - certificationKey, ok := signer.CertificationKey(config.Now()) - if !ok { - return errors.InvalidArgumentError("no valid certification key found") - } - - if certificationKey.PrivateKey.Encrypted { - return errors.InvalidArgumentError("signing Entity's private key must be decrypted") - } - - ident, ok := e.Identities[identity] - if !ok { - return errors.InvalidArgumentError("given identity string not found in Entity") - } - - sig := createSignaturePacket(certificationKey.PublicKey, packet.SigTypeGenericCert, config) - - signingUserID := config.SigningUserId() - if signingUserID != "" { - if _, ok := signer.Identities[signingUserID]; !ok { - return errors.InvalidArgumentError("signer identity string not found in signer Entity") - } - sig.SignerUserId = &signingUserID - } - - if err := sig.SignUserId(identity, e.PrimaryKey, certificationKey.PrivateKey, config); err != nil { - return err - } - ident.Signatures = append(ident.Signatures, sig) - return nil -} - -// RevokeKey generates a key revocation signature (packet.SigTypeKeyRevocation) with the -// specified reason code and text (RFC4880 section-5.2.3.23). -// If config is nil, sensible defaults will be used. -func (e *Entity) RevokeKey(reason packet.ReasonForRevocation, reasonText string, config *packet.Config) error { - revSig := createSignaturePacket(e.PrimaryKey, packet.SigTypeKeyRevocation, config) - revSig.RevocationReason = &reason - revSig.RevocationReasonText = reasonText - - if err := revSig.RevokeKey(e.PrimaryKey, e.PrivateKey, config); err != nil { - return err - } - e.Revocations = append(e.Revocations, revSig) - return nil -} - -// RevokeSubkey generates a subkey revocation signature (packet.SigTypeSubkeyRevocation) for -// a subkey with the specified reason code and text (RFC4880 section-5.2.3.23). -// If config is nil, sensible defaults will be used. -func (e *Entity) RevokeSubkey(sk *Subkey, reason packet.ReasonForRevocation, reasonText string, config *packet.Config) error { - if err := e.PrimaryKey.VerifyKeySignature(sk.PublicKey, sk.Sig); err != nil { - return errors.InvalidArgumentError("given subkey is not associated with this key") - } - - revSig := createSignaturePacket(e.PrimaryKey, packet.SigTypeSubkeyRevocation, config) - revSig.RevocationReason = &reason - revSig.RevocationReasonText = reasonText - - if err := revSig.RevokeSubkey(sk.PublicKey, e.PrivateKey, config); err != nil { - return err - } - - sk.Revocations = append(sk.Revocations, revSig) - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go deleted file mode 100644 index 108fd096f3..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/keys_test_data.go +++ /dev/null @@ -1,538 +0,0 @@ -package openpgp - -const expiringKeyHex = "c6c04d0451d0c680010800abbb021fd03ffc4e96618901180c3fdcb060ee69eeead97b91256d11420d80b5f1b51930248044130bd300605cf8a05b7a40d3d8cfb0a910be2e3db50dcd50a9c54064c2a5550801daa834ff4480b33d3d3ca495ff8a4e84a886977d17d998f881241a874083d8b995beab555b6d22b8a4817ab17ac3e7304f7d4d2c05c495fb2218348d3bc13651db1d92732e368a9dd7dcefa6eddff30b94706a9aaee47e9d39321460b740c59c6fc3c2fd8ab6c0fb868cb87c0051f0321301fe0f0e1820b15e7fb7063395769b525005c7e30a7ce85984f5cac00504e7b4fdc45d74958de8388436fd5c7ba9ea121f1c851b5911dd1b47a14d81a09e92ef37721e2325b6790011010001cd00c2c07b041001080025050251d0c680050900278d00060b09070803020415080a0203160201021901021b03021e01000a0910e7b484133a890a35ae4b0800a1beb82e7f28eaf5273d6af9d3391314f6280b2b624eaca2851f89a9ebcaf80ac589ebd509f168bc4322106ca2e2ce77a76e071a3c7444787d65216b5f05e82c77928860b92aace3b7d0327db59492f422eb9dfab7249266d37429870b091a98aba8724c2259ebf8f85093f21255eafa75aa841e31d94f2ac891b9755fed455e539044ee69fc47950b80e003fc9f298d695660f28329eaa38037c367efde1727458e514faf990d439a21461b719edaddf9296d3d0647b43ca56cb8dbf63b4fcf8b9968e7928c463470fab3b98e44d0d95645062f94b2d04fe56bd52822b71934db8ce845622c40b92fcbe765a142e7f38b61a6aa9606c8e8858dcd3b6eb1894acec04d0451d1f06b01080088bea67444e1789390e7c0335c86775502d58ec783d99c8ef4e06de235ed3dd4b0467f6f358d818c7d8989d43ec6d69fcbc8c32632d5a1b605e3fa8e41d695fcdcaa535936cd0157f9040dce362519803b908eafe838bb13216c885c6f93e9e8d5745607f0d062322085d6bdc760969149a8ff8dd9f5c18d9bfe2e6f63a06e17694cf1f67587c6fb70e9aebf90ffc528ca3b615ac7c9d4a21ea4f7c06f2e98fbbd90a859b8608bf9ea638e3a54289ce44c283110d0c45fa458de6251cd6e7baf71f80f12c8978340490fd90c92b81736ae902ed958e478dceae2835953d189c45d182aff02ea2be61b81d8e94430f041d638647b43e2fcb45fd512fbf5068b810011010001c2c06504180108000f050251d1f06b050900081095021b0c000a0910e7b484133a890a35e63407fe2ec88d6d1e6c9ce7553ece0cb2524747217bad29f251d33df84599ffcc900141a355abd62126800744068a5e05dc167056aa9205273dc7765a2ed49db15c2a83b8d6e6429c902136f1e12229086c1c10c0053242c2a4ae1930db58163387a48cad64607ff2153c320e42843dec28e3fce90e7399d63ac0affa2fee1f0adc0953c89eb3f46ef1d6c04328ed13b491669d5120a3782e3ffb7c69575fb77eebd108794f4dda9d34be2bae57e8e59ec8ebfda2f6f06104b2321be408ea146e2db482b00c5055c8618de36ac9716f80da2617e225556d0fce61b01c8cea2d1e0ea982c31711060ca370f2739366e1e708f38405d784b49d16a26cf62d152eae734327cec04d0451d1f07b010800d5af91c5e7c2fd8951c8d254eab0c97cdcb66822f868b79b78c366255059a68fd74ebca9adb9b970cd9e586690e6e0756705432306878c897b10a4b4ca0005966f99ac8fa4e6f9caf54bf8e53844544beee9872a7ac64c119cf1393d96e674254b661f61ee975633d0e8a8672531edb6bb8e211204e7754a9efa802342118eee850beea742bac95a3f706cc2024cf6037a308bb68162b2f53b9a6346a96e6d31871a2456186e24a1c7a82b82ac04afdfd57cd7fb9ba77a9c760d40b76a170f7be525e5fb6a9848cc726e806187710d9b190387df28700f321f988a392899f93815cc937f309129eb94d5299c5547cb2c085898e6639496e70d746c9d3fb9881d0011010001c2c06504180108000f050251d1f07b050900266305021b0c000a0910e7b484133a890a35bff207fd10dfe8c4a6ea1dd30568012b6fd6891a763c87ad0f7a1d112aad9e8e3239378a3b85588c235865bac2e614348cb4f216d7217f53b3ef48c192e0a4d31d64d7bfa5faccf21155965fa156e887056db644a05ad08a85cc6152d1377d9e37b46f4ff462bbe68ace2dc586ef90070314576c985d8037c2ba63f0a7dc17a62e15bd77e88bc61d9d00858979709f12304264a4cf4225c5cf86f12c8e19486cb9cdcc69f18f027e5f16f4ca8b50e28b3115eaff3a345acd21f624aef81f6ede515c1b55b26b84c1e32264754eab672d5489b287e7277ea855e0a5ff2aa9e8b8c76d579a964ec225255f4d57bf66639ccb34b64798846943e162a41096a7002ca21c7f56" -const subkeyUsageHex = "988d04533a52bc010400d26af43085558f65b9e7dbc90cb9238015259aed5e954637adcfa2181548b2d0b60c65f1f42ec5081cbf1bc0a8aa4900acfb77070837c58f26012fbce297d70afe96e759ad63531f0037538e70dbf8e384569b9720d99d8eb39d8d0a2947233ed242436cb6ac7dfe74123354b3d0119b5c235d3dd9c9d6c004f8ffaf67ad8583001101000188b7041f010200210502533b8552170c8001ce094aa433f7040bb2ddf0be3893cb843d0fe70c020700000a0910a42704b92866382aa98404009d63d916a27543da4221c60087c33f1c44bec9998c5438018ed370cca4962876c748e94b73eb39c58eb698063f3fd6346d58dd2a11c0247934c4a9d71f24754f7468f96fb24c3e791dd2392b62f626148ad724189498cbf993db2df7c0cdc2d677c35da0f16cb16c9ce7c33b4de65a4a91b1d21a130ae9cc26067718910ef8e2b417556d627261203c756d627261407379642e65642e61753e88b80413010200220502533a52bc021b03060b090807030206150802090a0b0416020301021e01021780000a0910a42704b92866382a47840400c0c2bd04f5fca586de408b395b3c280a278259c93eaaa8b79a53b97003f8ed502a8a00446dd9947fb462677e4fcac0dac2f0701847d15130aadb6cd9e0705ea0cf5f92f129136c7be21a718d46c8e641eb7f044f2adae573e11ae423a0a9ca51324f03a8a2f34b91fa40c3cc764bee4dccadedb54c768ba0469b683ea53f1c29b88d04533a52bc01040099c92a5d6f8b744224da27bc2369127c35269b58bec179de6bbc038f749344222f85a31933224f26b70243c4e4b2d242f0c4777eaef7b5502f9dad6d8bf3aaeb471210674b74de2d7078af497d55f5cdad97c7bedfbc1b41e8065a97c9c3d344b21fc81d27723af8e374bc595da26ea242dccb6ae497be26eea57e563ed517e90011010001889f0418010200090502533a52bc021b0c000a0910a42704b92866382afa1403ff70284c2de8a043ff51d8d29772602fa98009b7861c540535f874f2c230af8caf5638151a636b21f8255003997ccd29747fdd06777bb24f9593bd7d98a3e887689bf902f999915fcc94625ae487e5d13e6616f89090ebc4fdc7eb5cad8943e4056995bb61c6af37f8043016876a958ec7ebf39c43d20d53b7f546cfa83e8d2604b88d04533b8283010400c0b529316dbdf58b4c54461e7e669dc11c09eb7f73819f178ccd4177b9182b91d138605fcf1e463262fabefa73f94a52b5e15d1904635541c7ea540f07050ce0fb51b73e6f88644cec86e91107c957a114f69554548a85295d2b70bd0b203992f76eb5d493d86d9eabcaa7ef3fc7db7e458438db3fcdb0ca1cc97c638439a9170011010001889f0418010200090502533b8283021b0c000a0910a42704b92866382adc6d0400cfff6258485a21675adb7a811c3e19ebca18851533f75a7ba317950b9997fda8d1a4c8c76505c08c04b6c2cc31dc704d33da36a21273f2b388a1a706f7c3378b66d887197a525936ed9a69acb57fe7f718133da85ec742001c5d1864e9c6c8ea1b94f1c3759cebfd93b18606066c063a63be86085b7e37bdbc65f9a915bf084bb901a204533b85cd110400aed3d2c52af2b38b5b67904b0ef73d6dd7aef86adb770e2b153cd22489654dcc91730892087bb9856ae2d9f7ed1eb48f214243fe86bfe87b349ebd7c30e630e49c07b21fdabf78b7a95c8b7f969e97e3d33f2e074c63552ba64a2ded7badc05ce0ea2be6d53485f6900c7860c7aa76560376ce963d7271b9b54638a4028b573f00a0d8854bfcdb04986141568046202192263b9b67350400aaa1049dbc7943141ef590a70dcb028d730371d92ea4863de715f7f0f16d168bd3dc266c2450457d46dcbbf0b071547e5fbee7700a820c3750b236335d8d5848adb3c0da010e998908dfd93d961480084f3aea20b247034f8988eccb5546efaa35a92d0451df3aaf1aee5aa36a4c4d462c760ecd9cebcabfbe1412b1f21450f203fd126687cd486496e971a87fd9e1a8a765fe654baa219a6871ab97768596ab05c26c1aeea8f1a2c72395a58dbc12ef9640d2b95784e974a4d2d5a9b17c25fedacfe551bda52602de8f6d2e48443f5dd1a2a2a8e6a5e70ecdb88cd6e766ad9745c7ee91d78cc55c3d06536b49c3fee6c3d0b6ff0fb2bf13a314f57c953b8f4d93bf88e70418010200090502533b85cd021b0200520910a42704b92866382a47200419110200060502533b85cd000a091042ce2c64bc0ba99214b2009e26b26852c8b13b10c35768e40e78fbbb48bd084100a0c79d9ea0844fa5853dd3c85ff3ecae6f2c9dd6c557aa04008bbbc964cd65b9b8299d4ebf31f41cc7264b8cf33a00e82c5af022331fac79efc9563a822497ba012953cefe2629f1242fcdcb911dbb2315985bab060bfd58261ace3c654bdbbe2e8ed27a46e836490145c86dc7bae15c011f7e1ffc33730109b9338cd9f483e7cef3d2f396aab5bd80efb6646d7e778270ee99d934d187dd98" -const revokedKeyHex = "988d045331ce82010400c4fdf7b40a5477f206e6ee278eaef888ca73bf9128a9eef9f2f1ddb8b7b71a4c07cfa241f028a04edb405e4d916c61d6beabc333813dc7b484d2b3c52ee233c6a79b1eea4e9cc51596ba9cd5ac5aeb9df62d86ea051055b79d03f8a4fa9f38386f5bd17529138f3325d46801514ea9047977e0829ed728e68636802796801be10011010001889f04200102000905025331d0e3021d03000a0910a401d9f09a34f7c042aa040086631196405b7e6af71026b88e98012eab44aa9849f6ef3fa930c7c9f23deaedba9db1538830f8652fb7648ec3fcade8dbcbf9eaf428e83c6cbcc272201bfe2fbb90d41963397a7c0637a1a9d9448ce695d9790db2dc95433ad7be19eb3de72dacf1d6db82c3644c13eae2a3d072b99bb341debba012c5ce4006a7d34a1f4b94b444526567205265766f6b657220283c52656727732022424d204261726973746122204b657920262530305c303e5c29203c72656740626d626172697374612e636f2e61753e88b704130102002205025331ce82021b03060b090807030206150802090a0b0416020301021e01021780000a0910a401d9f09a34f7c0019c03f75edfbeb6a73e7225ad3cc52724e2872e04260d7daf0d693c170d8c4b243b8767bc7785763533febc62ec2600c30603c433c095453ede59ff2fcabeb84ce32e0ed9d5cf15ffcbc816202b64370d4d77c1e9077d74e94a16fb4fa2e5bec23a56d7a73cf275f91691ae1801a976fcde09e981a2f6327ac27ea1fecf3185df0d56889c04100102000605025331cfb5000a0910fe9645554e8266b64b4303fc084075396674fb6f778d302ac07cef6bc0b5d07b66b2004c44aef711cbac79617ef06d836b4957522d8772dd94bf41a2f4ac8b1ee6d70c57503f837445a74765a076d07b829b8111fc2a918423ddb817ead7ca2a613ef0bfb9c6b3562aec6c3cf3c75ef3031d81d95f6563e4cdcc9960bcb386c5d757b104fcca5fe11fc709df884604101102000605025331cfe7000a09107b15a67f0b3ddc0317f6009e360beea58f29c1d963a22b962b80788c3fa6c84e009d148cfde6b351469b8eae91187eff07ad9d08fcaab88d045331ce820104009f25e20a42b904f3fa555530fe5c46737cf7bd076c35a2a0d22b11f7e0b61a69320b768f4a80fe13980ce380d1cfc4a0cd8fbe2d2e2ef85416668b77208baa65bf973fe8e500e78cc310d7c8705cdb34328bf80e24f0385fce5845c33bc7943cf6b11b02348a23da0bf6428e57c05135f2dc6bd7c1ce325d666d5a5fd2fd5e410011010001889f04180102000905025331ce82021b0c000a0910a401d9f09a34f7c0418003fe34feafcbeaef348a800a0d908a7a6809cc7304017d820f70f0474d5e23cb17e38b67dc6dca282c6ca00961f4ec9edf2738d0f087b1d81e4871ef08e1798010863afb4eac4c44a376cb343be929c5be66a78cfd4456ae9ec6a99d97f4e1c3ff3583351db2147a65c0acef5c003fb544ab3a2e2dc4d43646f58b811a6c3a369d1f" -const revokedSubkeyHex = "988d04533121f6010400aefc803a3e4bb1a61c86e8a86d2726c6a43e0079e9f2713f1fa017e9854c83877f4aced8e331d675c67ea83ddab80aacbfa0b9040bb12d96f5a3d6be09455e2a76546cbd21677537db941cab710216b6d24ec277ee0bd65b910f416737ed120f6b93a9d3b306245c8cfd8394606fdb462e5cf43c551438d2864506c63367fc890011010001b41d416c696365203c616c69636540626d626172697374612e636f2e61753e88bb041301020025021b03060b090807030206150802090a0b0416020301021e01021780050253312798021901000a09104ef7e4beccde97f015a803ff5448437780f63263b0df8442a995e7f76c221351a51edd06f2063d8166cf3157aada4923dfc44aa0f2a6a4da5cf83b7fe722ba8ab416c976e77c6b5682e7f1069026673bd0de56ba06fd5d7a9f177607f277d9b55ff940a638c3e68525c67517e2b3d976899b93ca267f705b3e5efad7d61220e96b618a4497eab8d04403d23f8846041011020006050253312910000a09107b15a67f0b3ddc03d96e009f50b6365d86c4be5d5e9d0ea42d5e56f5794c617700a0ab274e19c2827780016d23417ce89e0a2c0d987d889c04100102000605025331cf7a000a0910a401d9f09a34f7c0ee970400aca292f213041c9f3b3fc49148cbda9d84afee6183c8dd6c5ff2600b29482db5fecd4303797be1ee6d544a20a858080fec43412061c9a71fae4039fd58013b4ae341273e6c66ad4c7cdd9e68245bedb260562e7b166f2461a1032f2b38c0e0e5715fb3d1656979e052b55ca827a76f872b78a9fdae64bc298170bfcebedc1271b41a416c696365203c616c696365407379646973702e6f722e61753e88b804130102002205025331278b021b03060b090807030206150802090a0b0416020301021e01021780000a09104ef7e4beccde97f06a7003fa03c3af68d272ebc1fa08aa72a03b02189c26496a2833d90450801c4e42c5b5f51ad96ce2d2c9cef4b7c02a6a2fcf1412d6a2d486098eb762f5010a201819c17fd2888aec8eda20c65a3b75744de7ee5cc8ac7bfc470cbe3cb982720405a27a3c6a8c229cfe36905f881b02ed5680f6a8f05866efb9d6c5844897e631deb949ca8846041011020006050253312910000a09107b15a67f0b3ddc0347bc009f7fa35db59147469eb6f2c5aaf6428accb138b22800a0caa2f5f0874bacc5909c652a57a31beda65eddd5889c04100102000605025331cf7a000a0910a401d9f09a34f7c0316403ff46f2a5c101256627f16384d34a38fb47a6c88ba60506843e532d91614339fccae5f884a5741e7582ffaf292ba38ee10a270a05f139bde3814b6a077e8cd2db0f105ebea2a83af70d385f13b507fac2ad93ff79d84950328bb86f3074745a8b7f9b64990fb142e2a12976e27e8d09a28dc5621f957ac49091116da410ac3cbde1b88d04533121f6010400cbd785b56905e4192e2fb62a720727d43c4fa487821203cf72138b884b78b701093243e1d8c92a0248a6c0203a5a88693da34af357499abacaf4b3309c640797d03093870a323b4b6f37865f6eaa2838148a67df4735d43a90ca87942554cdf1c4a751b1e75f9fd4ce4e97e278d6c1c7ed59d33441df7d084f3f02beb68896c70011010001889f0418010200090502533121f6021b0c000a09104ef7e4beccde97f0b98b03fc0a5ccf6a372995835a2f5da33b282a7d612c0ab2a97f59cf9fff73e9110981aac2858c41399afa29624a7fd8a0add11654e3d882c0fd199e161bdad65e5e2548f7b68a437ea64293db1246e3011cbb94dc1bcdeaf0f2539bd88ff16d95547144d97cead6a8c5927660a91e6db0d16eb36b7b49a3525b54d1644e65599b032b7eb901a204533127a0110400bd3edaa09eff9809c4edc2c2a0ebe52e53c50a19c1e49ab78e6167bf61473bb08f2050d78a5cbbc6ed66aff7b42cd503f16b4a0b99fa1609681fca9b7ce2bbb1a5b3864d6cdda4d7ef7849d156d534dea30fb0efb9e4cf8959a2b2ce623905882d5430b995a15c3b9fe92906086788b891002924f94abe139b42cbbfaaabe42f00a0b65dc1a1ad27d798adbcb5b5ad02d2688c89477b03ff4eebb6f7b15a73b96a96bed201c0e5e4ea27e4c6e2dd1005b94d4b90137a5b1cf5e01c6226c070c4cc999938101578877ee76d296b9aab8246d57049caacf489e80a3f40589cade790a020b1ac146d6f7a6241184b8c7fcde680eae3188f5dcbe846d7f7bdad34f6fcfca08413e19c1d5df83fc7c7c627d493492e009c2f52a80400a2fe82de87136fd2e8845888c4431b032ba29d9a29a804277e31002a8201fb8591a3e55c7a0d0881496caf8b9fb07544a5a4879291d0dc026a0ea9e5bd88eb4aa4947bbd694b25012e208a250d65ddc6f1eea59d3aed3b4ec15fcab85e2afaa23a40ab1ef9ce3e11e1bc1c34a0e758e7aa64deb8739276df0af7d4121f834a9b88e70418010200090502533127a0021b02005209104ef7e4beccde97f047200419110200060502533127a0000a0910dbce4ee19529437fe045009c0b32f5ead48ee8a7e98fac0dea3d3e6c0e2c552500a0ad71fadc5007cfaf842d9b7db3335a8cdad15d3d1a6404009b08e2c68fe8f3b45c1bb72a4b3278cdf3012aa0f229883ad74aa1f6000bb90b18301b2f85372ca5d6b9bf478d235b733b1b197d19ccca48e9daf8e890cb64546b4ce1b178faccfff07003c172a2d4f5ebaba9f57153955f3f61a9b80a4f5cb959908f8b211b03b7026a8a82fc612bfedd3794969bcf458c4ce92be215a1176ab88d045331d144010400a5063000c5aaf34953c1aa3bfc95045b3aab9882b9a8027fecfe2142dc6b47ba8aca667399990244d513dd0504716908c17d92c65e74219e004f7b83fc125e575dd58efec3ab6dd22e3580106998523dea42ec75bf9aa111734c82df54630bebdff20fe981cfc36c76f865eb1c2fb62c9e85bc3a6e5015a361a2eb1c8431578d0011010001889f04280102000905025331d433021d03000a09104ef7e4beccde97f02e5503ff5e0630d1b65291f4882b6d40a29da4616bb5088717d469fbcc3648b8276de04a04988b1f1b9f3e18f52265c1f8b6c85861691c1a6b8a3a25a1809a0b32ad330aec5667cb4262f4450649184e8113849b05e5ad06a316ea80c001e8e71838190339a6e48bbde30647bcf245134b9a97fa875c1d83a9862cae87ffd7e2c4ce3a1b89013d04180102000905025331d144021b0200a809104ef7e4beccde97f09d2004190102000605025331d144000a0910677815e371c2fd23522203fe22ab62b8e7a151383cea3edd3a12995693911426f8ccf125e1f6426388c0010f88d9ca7da2224aee8d1c12135998640c5e1813d55a93df472faae75bef858457248db41b4505827590aeccf6f9eb646da7f980655dd3050c6897feddddaca90676dee856d66db8923477d251712bb9b3186b4d0114daf7d6b59272b53218dd1da94a03ff64006fcbe71211e5daecd9961fba66cdb6de3f914882c58ba5beddeba7dcb950c1156d7fba18c19ea880dccc800eae335deec34e3b84ac75ffa24864f782f87815cda1c0f634b3dd2fa67cea30811d21723d21d9551fa12ccbcfa62b6d3a15d01307b99925707992556d50065505b090aadb8579083a20fe65bd2a270da9b011" - -const missingCrossSignatureKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Charset: UTF-8 - -mQENBFMYynYBCACVOZ3/e8Bm2b9KH9QyIlHGo/i1bnkpqsgXj8tpJ2MIUOnXMMAY -ztW7kKFLCmgVdLIC0vSoLA4yhaLcMojznh/2CcUglZeb6Ao8Gtelr//Rd5DRfPpG -zqcfUo+m+eO1co2Orabw0tZDfGpg5p3AYl0hmxhUyYSc/xUq93xL1UJzBFgYXY54 -QsM8dgeQgFseSk/YvdP5SMx1ev+eraUyiiUtWzWrWC1TdyRa5p4UZg6Rkoppf+WJ -QrW6BWrhAtqATHc8ozV7uJjeONjUEq24roRc/OFZdmQQGK6yrzKnnbA6MdHhqpdo -9kWDcXYb7pSE63Lc+OBa5X2GUVvXJLS/3nrtABEBAAG0F2ludmFsaWQtc2lnbmlu -Zy1zdWJrZXlziQEoBBMBAgASBQJTnKB5AhsBAgsHAhUIAh4BAAoJEO3UDQUIHpI/ -dN4H/idX4FQ1LIZCnpHS/oxoWQWfpRgdKAEM0qCqjMgiipJeEwSQbqjTCynuh5/R -JlODDz85ABR06aoF4l5ebGLQWFCYifPnJZ/Yf5OYcMGtb7dIbqxWVFL9iLMO/oDL -ioI3dotjPui5e+2hI9pVH1UHB/bZ/GvMGo6Zg0XxLPolKQODMVjpjLAQ0YJ3spew -RAmOGre6tIvbDsMBnm8qREt7a07cBJ6XK7xjxYaZHQBiHVxyEWDa6gyANONx8duW -/fhQ/zDTnyVM/ik6VO0Ty9BhPpcEYLFwh5c1ilFari1ta3e6qKo6ZGa9YMk/REhu -yBHd9nTkI+0CiQUmbckUiVjDKKe5AQ0EUxjKdgEIAJcXQeP+NmuciE99YcJoffxv -2gVLU4ZXBNHEaP0mgaJ1+tmMD089vUQAcyGRvw8jfsNsVZQIOAuRxY94aHQhIRHR -bUzBN28ofo/AJJtfx62C15xt6fDKRV6HXYqAiygrHIpEoRLyiN69iScUsjIJeyFL -C8wa72e8pSL6dkHoaV1N9ZH/xmrJ+k0vsgkQaAh9CzYufncDxcwkoP+aOlGtX1gP -WwWoIbz0JwLEMPHBWvDDXQcQPQTYQyj+LGC9U6f9VZHN25E94subM1MjuT9OhN9Y -MLfWaaIc5WyhLFyQKW2Upofn9wSFi8ubyBnv640Dfd0rVmaWv7LNTZpoZ/GbJAMA -EQEAAYkBHwQYAQIACQUCU5ygeQIbAgAKCRDt1A0FCB6SP0zCB/sEzaVR38vpx+OQ -MMynCBJrakiqDmUZv9xtplY7zsHSQjpd6xGflbU2n+iX99Q+nav0ETQZifNUEd4N -1ljDGQejcTyKD6Pkg6wBL3x9/RJye7Zszazm4+toJXZ8xJ3800+BtaPoI39akYJm -+ijzbskvN0v/j5GOFJwQO0pPRAFtdHqRs9Kf4YanxhedB4dIUblzlIJuKsxFit6N -lgGRblagG3Vv2eBszbxzPbJjHCgVLR3RmrVezKOsZjr/2i7X+xLWIR0uD3IN1qOW -CXQxLBizEEmSNVNxsp7KPGTLnqO3bPtqFirxS9PJLIMPTPLNBY7ZYuPNTMqVIUWF -4artDmrG -=7FfJ ------END PGP PUBLIC KEY BLOCK-----` - -const invalidCrossSignatureKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mQENBFMYynYBCACVOZ3/e8Bm2b9KH9QyIlHGo/i1bnkpqsgXj8tpJ2MIUOnXMMAY -ztW7kKFLCmgVdLIC0vSoLA4yhaLcMojznh/2CcUglZeb6Ao8Gtelr//Rd5DRfPpG -zqcfUo+m+eO1co2Orabw0tZDfGpg5p3AYl0hmxhUyYSc/xUq93xL1UJzBFgYXY54 -QsM8dgeQgFseSk/YvdP5SMx1ev+eraUyiiUtWzWrWC1TdyRa5p4UZg6Rkoppf+WJ -QrW6BWrhAtqATHc8ozV7uJjeONjUEq24roRc/OFZdmQQGK6yrzKnnbA6MdHhqpdo -9kWDcXYb7pSE63Lc+OBa5X2GUVvXJLS/3nrtABEBAAG0F2ludmFsaWQtc2lnbmlu -Zy1zdWJrZXlziQEoBBMBAgASBQJTnKB5AhsBAgsHAhUIAh4BAAoJEO3UDQUIHpI/ -dN4H/idX4FQ1LIZCnpHS/oxoWQWfpRgdKAEM0qCqjMgiipJeEwSQbqjTCynuh5/R -JlODDz85ABR06aoF4l5ebGLQWFCYifPnJZ/Yf5OYcMGtb7dIbqxWVFL9iLMO/oDL -ioI3dotjPui5e+2hI9pVH1UHB/bZ/GvMGo6Zg0XxLPolKQODMVjpjLAQ0YJ3spew -RAmOGre6tIvbDsMBnm8qREt7a07cBJ6XK7xjxYaZHQBiHVxyEWDa6gyANONx8duW -/fhQ/zDTnyVM/ik6VO0Ty9BhPpcEYLFwh5c1ilFari1ta3e6qKo6ZGa9YMk/REhu -yBHd9nTkI+0CiQUmbckUiVjDKKe5AQ0EUxjKdgEIAIINDqlj7X6jYKc6DjwrOkjQ -UIRWbQQar0LwmNilehmt70g5DCL1SYm9q4LcgJJ2Nhxj0/5qqsYib50OSWMcKeEe -iRXpXzv1ObpcQtI5ithp0gR53YPXBib80t3bUzomQ5UyZqAAHzMp3BKC54/vUrSK -FeRaxDzNLrCeyI00+LHNUtwghAqHvdNcsIf8VRumK8oTm3RmDh0TyjASWYbrt9c8 -R1Um3zuoACOVy+mEIgIzsfHq0u7dwYwJB5+KeM7ZLx+HGIYdUYzHuUE1sLwVoELh -+SHIGHI1HDicOjzqgajShuIjj5hZTyQySVprrsLKiXS6NEwHAP20+XjayJ/R3tEA -EQEAAYkCPgQYAQIBKAUCU5ygeQIbAsBdIAQZAQIABgUCU5ygeQAKCRCpVlnFZmhO -52RJB/9uD1MSa0wjY6tHOIgquZcP3bHBvHmrHNMw9HR2wRCMO91ZkhrpdS3ZHtgb -u3/55etj0FdvDo1tb8P8FGSVtO5Vcwf5APM8sbbqoi8L951Q3i7qt847lfhu6sMl -w0LWFvPTOLHrliZHItPRjOltS1WAWfr2jUYhsU9ytaDAJmvf9DujxEOsN5G1YJep -54JCKVCkM/y585Zcnn+yxk/XwqoNQ0/iJUT9qRrZWvoeasxhl1PQcwihCwss44A+ -YXaAt3hbk+6LEQuZoYS73yR3WHj+42tfm7YxRGeubXfgCEz/brETEWXMh4pe0vCL -bfWrmfSPq2rDegYcAybxRQz0lF8PAAoJEO3UDQUIHpI/exkH/0vQfdHA8g/N4T6E -i6b1CUVBAkvtdJpCATZjWPhXmShOw62gkDw306vHPilL4SCvEEi4KzG72zkp6VsB -DSRcpxCwT4mHue+duiy53/aRMtSJ+vDfiV1Vhq+3sWAck/yUtfDU9/u4eFaiNok1 -8/Gd7reyuZt5CiJnpdPpjCwelK21l2w7sHAnJF55ITXdOxI8oG3BRKufz0z5lyDY -s2tXYmhhQIggdgelN8LbcMhWs/PBbtUr6uZlNJG2lW1yscD4aI529VjwJlCeo745 -U7pO4eF05VViUJ2mmfoivL3tkhoTUWhx8xs8xCUcCg8DoEoSIhxtOmoTPR22Z9BL -6LCg2mg= -=Dhm4 ------END PGP PUBLIC KEY BLOCK-----` - -const goodCrossSignatureKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mI0EVUqeVwEEAMufHRrMPWK3gyvi0O0tABCs/oON9zV9KDZlr1a1M91ShCSFwCPo -7r80PxdWVWcj0V5h50/CJYtpN3eE/mUIgW2z1uDYQF1OzrQ8ubrksfsJvpAhENom -lTQEppv9mV8qhcM278teb7TX0pgrUHLYF5CfPdp1L957JLLXoQR/lwLVABEBAAG0 -E2dvb2Qtc2lnbmluZy1zdWJrZXmIuAQTAQIAIgUCVUqeVwIbAwYLCQgHAwIGFQgC -CQoLBBYCAwECHgECF4AACgkQNRjL95IRWP69XQQAlH6+eyXJN4DZTLX78KGjHrsw -6FCvxxClEPtPUjcJy/1KCRQmtLAt9PbbA78dvgzjDeZMZqRAwdjyJhjyg/fkU2OH -7wq4ktjUu+dLcOBb+BFMEY+YjKZhf6EJuVfxoTVr5f82XNPbYHfTho9/OABKH6kv -X70PaKZhbwnwij8Nts65AaIEVUqftREEAJ3WxZfqAX0bTDbQPf2CMT2IVMGDfhK7 -GyubOZgDFFjwUJQvHNvsrbeGLZ0xOBumLINyPO1amIfTgJNm1iiWFWfmnHReGcDl -y5mpYG60Mb79Whdcer7CMm3AqYh/dW4g6IB02NwZMKoUHo3PXmFLxMKXnWyJ0clw -R0LI/Qn509yXAKDh1SO20rqrBM+EAP2c5bfI98kyNwQAi3buu94qo3RR1ZbvfxgW -CKXDVm6N99jdZGNK7FbRifXqzJJDLcXZKLnstnC4Sd3uyfyf1uFhmDLIQRryn5m+ -LBYHfDBPN3kdm7bsZDDq9GbTHiFZUfm/tChVKXWxkhpAmHhU/tH6GGzNSMXuIWSO -aOz3Rqq0ED4NXyNKjdF9MiwD/i83S0ZBc0LmJYt4Z10jtH2B6tYdqnAK29uQaadx -yZCX2scE09UIm32/w7pV77CKr1Cp/4OzAXS1tmFzQ+bX7DR+Gl8t4wxr57VeEMvl -BGw4Vjh3X8//m3xynxycQU18Q1zJ6PkiMyPw2owZ/nss3hpSRKFJsxMLhW3fKmKr -Ey2KiOcEGAECAAkFAlVKn7UCGwIAUgkQNRjL95IRWP5HIAQZEQIABgUCVUqftQAK -CRD98VjDN10SqkWrAKDTpEY8D8HC02E/KVC5YUI01B30wgCgurpILm20kXEDCeHp -C5pygfXw1DJrhAP+NyPJ4um/bU1I+rXaHHJYroYJs8YSweiNcwiHDQn0Engh/mVZ -SqLHvbKh2dL/RXymC3+rjPvQf5cup9bPxNMa6WagdYBNAfzWGtkVISeaQW+cTEp/ -MtgVijRGXR/lGLGETPg2X3Afwn9N9bLMBkBprKgbBqU7lpaoPupxT61bL70= -=vtbN ------END PGP PUBLIC KEY BLOCK-----` - -const revokedUserIDKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mQENBFsgO5EBCADhREPmcjsPkXe1z7ctvyWL0S7oa9JaoGZ9oPDHFDlQxd0qlX2e -DZJZDg0qYvVixmaULIulApq1puEsaJCn3lHUbHlb4PYKwLEywYXM28JN91KtLsz/ -uaEX2KC5WqeP40utmzkNLq+oRX/xnRMgwbO7yUNVG2UlEa6eI+xOXO3YtLdmJMBW -ClQ066ZnOIzEo1JxnIwha1CDBMWLLfOLrg6l8InUqaXbtEBbnaIYO6fXVXELUjkx -nmk7t/QOk0tXCy8muH9UDqJkwDUESY2l79XwBAcx9riX8vY7vwC34pm22fAUVLCJ -x1SJx0J8bkeNp38jKM2Zd9SUQqSbfBopQ4pPABEBAAG0I0dvbGFuZyBHb3BoZXIg -PG5vLXJlcGx5QGdvbGFuZy5jb20+iQFUBBMBCgA+FiEE5Ik5JLcNx6l6rZfw1oFy -9I6cUoMFAlsgO5ECGwMFCQPCZwAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQ -1oFy9I6cUoMIkwf8DNPeD23i4jRwd/pylbvxwZintZl1fSwTJW1xcOa1emXaEtX2 -depuqhP04fjlRQGfsYAQh7X9jOJxAHjTmhqFBi5sD7QvKU00cPFYbJ/JTx0B41bl -aXnSbGhRPh63QtEZL7ACAs+shwvvojJqysx7kyVRu0EW2wqjXdHwR/SJO6nhNBa2 -DXzSiOU/SUA42mmG+5kjF8Aabq9wPwT9wjraHShEweNerNMmOqJExBOy3yFeyDpa -XwEZFzBfOKoxFNkIaVf5GSdIUGhFECkGvBMB935khftmgR8APxdU4BE7XrXexFJU -8RCuPXonm4WQOwTWR0vQg64pb2WKAzZ8HhwTGbQiR29sYW5nIEdvcGhlciA8cmV2 -b2tlZEBnb2xhbmcuY29tPokBNgQwAQoAIBYhBOSJOSS3Dcepeq2X8NaBcvSOnFKD -BQJbIDv3Ah0AAAoJENaBcvSOnFKDfWMIAKhI/Tvu3h8fSUxp/gSAcduT6bC1JttG -0lYQ5ilKB/58lBUA5CO3ZrKDKlzW3M8VEcvohVaqeTMKeoQd5rCZq8KxHn/KvN6N -s85REfXfniCKfAbnGgVXX3kDmZ1g63pkxrFu0fDZjVDXC6vy+I0sGyI/Inro0Pzb -tvn0QCsxjapKK15BtmSrpgHgzVqVg0cUp8vqZeKFxarYbYB2idtGRci4b9tObOK0 -BSTVFy26+I/mrFGaPrySYiy2Kz5NMEcRhjmTxJ8jSwEr2O2sUR0yjbgUAXbTxDVE -/jg5fQZ1ACvBRQnB7LvMHcInbzjyeTM3FazkkSYQD6b97+dkWwb1iWG5AQ0EWyA7 -kQEIALkg04REDZo1JgdYV4x8HJKFS4xAYWbIva1ZPqvDNmZRUbQZR2+gpJGEwn7z -VofGvnOYiGW56AS5j31SFf5kro1+1bZQ5iOONBng08OOo58/l1hRseIIVGB5TGSa -PCdChKKHreJI6hS3mShxH6hdfFtiZuB45rwoaArMMsYcjaezLwKeLc396cpUwwcZ -snLUNd1Xu5EWEF2OdFkZ2a1qYdxBvAYdQf4+1Nr+NRIx1u1NS9c8jp3PuMOkrQEi -bNtc1v6v0Jy52mKLG4y7mC/erIkvkQBYJdxPaP7LZVaPYc3/xskcyijrJ/5ufoD8 -K71/ShtsZUXSQn9jlRaYR0EbojMAEQEAAYkBPAQYAQoAJhYhBOSJOSS3Dcepeq2X -8NaBcvSOnFKDBQJbIDuRAhsMBQkDwmcAAAoJENaBcvSOnFKDkFMIAIt64bVZ8x7+ -TitH1bR4pgcNkaKmgKoZz6FXu80+SnbuEt2NnDyf1cLOSimSTILpwLIuv9Uft5Pb -OraQbYt3xi9yrqdKqGLv80bxqK0NuryNkvh9yyx5WoG1iKqMj9/FjGghuPrRaT4l -QinNAghGVkEy1+aXGFrG2DsOC1FFI51CC2WVTzZ5RwR2GpiNRfESsU1rZAUqf/2V -yJl9bD5R4SUNy8oQmhOxi+gbhD4Ao34e4W0ilibslI/uawvCiOwlu5NGd8zv5n+U -heiQvzkApQup5c+BhH5zFDFdKJ2CBByxw9+7QjMFI/wgLixKuE0Ob2kAokXf7RlB -7qTZOahrETw= -=IKnw ------END PGP PUBLIC KEY BLOCK-----` - -const keyWithFirstUserIDRevoked = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Version: OpenPGP.js v4.10.10 -Comment: https://openpgpjs.org - -xsBNBFsgO5EBCADhREPmcjsPkXe1z7ctvyWL0S7oa9JaoGZ9oPDHFDlQxd0q -lX2eDZJZDg0qYvVixmaULIulApq1puEsaJCn3lHUbHlb4PYKwLEywYXM28JN -91KtLsz/uaEX2KC5WqeP40utmzkNLq+oRX/xnRMgwbO7yUNVG2UlEa6eI+xO -XO3YtLdmJMBWClQ066ZnOIzEo1JxnIwha1CDBMWLLfOLrg6l8InUqaXbtEBb -naIYO6fXVXELUjkxnmk7t/QOk0tXCy8muH9UDqJkwDUESY2l79XwBAcx9riX -8vY7vwC34pm22fAUVLCJx1SJx0J8bkeNp38jKM2Zd9SUQqSbfBopQ4pPABEB -AAHNIkdvbGFuZyBHb3BoZXIgPHJldm9rZWRAZ29sYW5nLmNvbT7CwI0EMAEK -ACAWIQTkiTkktw3HqXqtl/DWgXL0jpxSgwUCWyA79wIdAAAhCRDWgXL0jpxS -gxYhBOSJOSS3Dcepeq2X8NaBcvSOnFKDfWMIAKhI/Tvu3h8fSUxp/gSAcduT -6bC1JttG0lYQ5ilKB/58lBUA5CO3ZrKDKlzW3M8VEcvohVaqeTMKeoQd5rCZ -q8KxHn/KvN6Ns85REfXfniCKfAbnGgVXX3kDmZ1g63pkxrFu0fDZjVDXC6vy -+I0sGyI/Inro0Pzbtvn0QCsxjapKK15BtmSrpgHgzVqVg0cUp8vqZeKFxarY -bYB2idtGRci4b9tObOK0BSTVFy26+I/mrFGaPrySYiy2Kz5NMEcRhjmTxJ8j -SwEr2O2sUR0yjbgUAXbTxDVE/jg5fQZ1ACvBRQnB7LvMHcInbzjyeTM3Fazk -kSYQD6b97+dkWwb1iWHNI0dvbGFuZyBHb3BoZXIgPG5vLXJlcGx5QGdvbGFu -Zy5jb20+wsCrBBMBCgA+FiEE5Ik5JLcNx6l6rZfw1oFy9I6cUoMFAlsgO5EC -GwMFCQPCZwAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AAIQkQ1oFy9I6cUoMW -IQTkiTkktw3HqXqtl/DWgXL0jpxSgwiTB/wM094PbeLiNHB3+nKVu/HBmKe1 -mXV9LBMlbXFw5rV6ZdoS1fZ16m6qE/Th+OVFAZ+xgBCHtf2M4nEAeNOaGoUG -LmwPtC8pTTRw8Vhsn8lPHQHjVuVpedJsaFE+HrdC0RkvsAICz6yHC++iMmrK -zHuTJVG7QRbbCqNd0fBH9Ik7qeE0FrYNfNKI5T9JQDjaaYb7mSMXwBpur3A/ -BP3COtodKETB416s0yY6okTEE7LfIV7IOlpfARkXMF84qjEU2QhpV/kZJ0hQ -aEUQKQa8EwH3fmSF+2aBHwA/F1TgETtetd7EUlTxEK49eiebhZA7BNZHS9CD -rilvZYoDNnweHBMZzsBNBFsgO5EBCAC5INOERA2aNSYHWFeMfByShUuMQGFm -yL2tWT6rwzZmUVG0GUdvoKSRhMJ+81aHxr5zmIhluegEuY99UhX+ZK6NftW2 -UOYjjjQZ4NPDjqOfP5dYUbHiCFRgeUxkmjwnQoSih63iSOoUt5kocR+oXXxb -YmbgeOa8KGgKzDLGHI2nsy8Cni3N/enKVMMHGbJy1DXdV7uRFhBdjnRZGdmt -amHcQbwGHUH+PtTa/jUSMdbtTUvXPI6dz7jDpK0BImzbXNb+r9CcudpiixuM -u5gv3qyJL5EAWCXcT2j+y2VWj2HN/8bJHMoo6yf+bn6A/Cu9f0obbGVF0kJ/ -Y5UWmEdBG6IzABEBAAHCwJMEGAEKACYWIQTkiTkktw3HqXqtl/DWgXL0jpxS -gwUCWyA7kQIbDAUJA8JnAAAhCRDWgXL0jpxSgxYhBOSJOSS3Dcepeq2X8NaB -cvSOnFKDkFMIAIt64bVZ8x7+TitH1bR4pgcNkaKmgKoZz6FXu80+SnbuEt2N -nDyf1cLOSimSTILpwLIuv9Uft5PbOraQbYt3xi9yrqdKqGLv80bxqK0NuryN -kvh9yyx5WoG1iKqMj9/FjGghuPrRaT4lQinNAghGVkEy1+aXGFrG2DsOC1FF -I51CC2WVTzZ5RwR2GpiNRfESsU1rZAUqf/2VyJl9bD5R4SUNy8oQmhOxi+gb -hD4Ao34e4W0ilibslI/uawvCiOwlu5NGd8zv5n+UheiQvzkApQup5c+BhH5z -FDFdKJ2CBByxw9+7QjMFI/wgLixKuE0Ob2kAokXf7RlB7qTZOahrETw= -=+2T8 ------END PGP PUBLIC KEY BLOCK----- -` - -const keyWithOnlyUserIDRevoked = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mDMEYYwB7RYJKwYBBAHaRw8BAQdARimqhPPzyGAXmfQJjcqM1QVPzLtURJSzNVll -JV4tEaW0KVJldm9rZWQgUHJpbWFyeSBVc2VyIElEIDxyZXZva2VkQGtleS5jb20+ -iHgEMBYIACAWIQSpyJZAXYqVEFkjyKutFcS0yeB0LQUCYYwCtgIdAAAKCRCtFcS0 -yeB0LbSsAQD8OYMaaBjrdzzpwIkP1stgmPd4/kzN/ZG28Ywl6a5F5QEA5Xg7aq4e -/t6Fsb4F5iqB956kSPe6YJrikobD/tBbMwSIkAQTFggAOBYhBKnIlkBdipUQWSPI -q60VxLTJ4HQtBQJhjAHtAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEK0V -xLTJ4HQtBaoBAPZL7luTCji+Tqhn7XNfFE/0QIahCt8k9wfO1cGlB3inAQDf8Tzw -ZGR5fNluUcNoVxQT7bUSFStbaGo3k0BaOYPbCLg4BGGMAe0SCisGAQQBl1UBBQEB -B0DLwSpveSrbIO/IVZD13yrs1XuB3FURZUnafGrRq7+jUAMBCAeIeAQYFggAIBYh -BKnIlkBdipUQWSPIq60VxLTJ4HQtBQJhjAHtAhsMAAoJEK0VxLTJ4HQtZ1oA/j9u -8+p3xTNzsmabTL6BkNbMeB/RUKCrlm6woM6AV+vxAQCcXTn3JC2sNoNrLoXuVzaA -mcG3/TwG5GSQUUPkrDsGDA== -=mFWy ------END PGP PUBLIC KEY BLOCK----- -` - -const keyWithSubKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mI0EWyKwKQEEALwXhKBnyaaNFeK3ljfc/qn9X/QFw+28EUfgZPHjRmHubuXLE2uR -s3ZoSXY2z7Dkv+NyHYMt8p+X8q5fR7JvUjK2XbPyKoiJVnHINll83yl67DaWfKNL -EjNoO0kIfbXfCkZ7EG6DL+iKtuxniGTcnGT47e+HJSqb/STpLMnWwXjBABEBAAG0 -I0dvbGFuZyBHb3BoZXIgPG5vLXJlcGx5QGdvbGFuZy5jb20+iM4EEwEKADgWIQQ/ -lRafP/p9PytHbwxMvYJsOQdOOAUCWyKwKQIbAwULCQgHAwUVCgkICwUWAgMBAAIe -AQIXgAAKCRBMvYJsOQdOOOsFBAC62mXww8XuqvYLcVOvHkWLT6mhxrQOJXnlfpn7 -2uBV9CMhoG/Ycd43NONsJrB95Apr9TDIqWnVszNbqPCuBhZQSGLdbiDKjxnCWBk0 -69qv4RNtkpOhYB7jK4s8F5oQZqId6JasT/PmJTH92mhBYhhTQr0GYFuPX2UJdkw9 -Sn9C67iNBFsisDUBBAC3A+Yo9lgCnxi/pfskyLrweYif6kIXWLAtLTsM6g/6jt7b -wTrknuCPyTv0QKGXsAEe/cK/Xq3HvX9WfXPGIHc/X56ZIsHQ+RLowbZV/Lhok1IW -FAuQm8axr/by80cRwFnzhfPc/ukkAq2Qyj4hLsGblu6mxeAhzcp8aqmWOO2H9QAR -AQABiLYEKAEKACAWIQQ/lRafP/p9PytHbwxMvYJsOQdOOAUCWyK16gIdAAAKCRBM -vYJsOQdOOB1vA/4u4uLONsE+2GVOyBsHyy7uTdkuxaR9b54A/cz6jT/tzUbeIzgx -22neWhgvIEghnUZd0vEyK9k1wy5vbDlEo6nKzHso32N1QExGr5upRERAxweDxGOj -7luDwNypI7QcifE64lS/JmlnunwRCdRWMKc0Fp+7jtRc5mpwyHN/Suf5RokBagQY -AQoAIBYhBD+VFp8/+n0/K0dvDEy9gmw5B044BQJbIrA1AhsCAL8JEEy9gmw5B044 -tCAEGQEKAB0WIQSNdnkaWY6t62iX336UXbGvYdhXJwUCWyKwNQAKCRCUXbGvYdhX -JxJSA/9fCPHP6sUtGF1o3G1a3yvOUDGr1JWcct9U+QpbCt1mZoNopCNDDQAJvDWl -mvDgHfuogmgNJRjOMznvahbF+wpTXmB7LS0SK412gJzl1fFIpK4bgnhu0TwxNsO1 -8UkCZWqxRMgcNUn9z6XWONK8dgt5JNvHSHrwF4CxxwjL23AAtK+FA/UUoi3U4kbC -0XnSr1Sl+mrzQi1+H7xyMe7zjqe+gGANtskqexHzwWPUJCPZ5qpIa2l8ghiUim6b -4ymJ+N8/T8Yva1FaPEqfMzzqJr8McYFm0URioXJPvOAlRxdHPteZ0qUopt/Jawxl -Xt6B9h1YpeLoJwjwsvbi98UTRs0jXwoY -=3fWu ------END PGP PUBLIC KEY BLOCK-----` - -const keyWithSubKeyAndBadSelfSigOrder = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mI0EWyLLDQEEAOqIOpJ/ha1OYAGduu9tS3rBz5vyjbNgJO4sFveEM0mgsHQ0X9/L -plonW+d0gRoO1dhJ8QICjDAc6+cna1DE3tEb5m6JtQ30teLZuqrR398Cf6w7NNVz -r3lrlmnH9JaKRuXl7tZciwyovneBfZVCdtsRZjaLI1uMQCz/BToiYe3DABEBAAG0 -I0dvbGFuZyBHb3BoZXIgPG5vLXJlcGx5QGdvbGFuZy5jb20+iM4EEwEKADgWIQRZ -sixZOfQcZdW0wUqmgmdsv1O9xgUCWyLLDQIbAwULCQgHAwUVCgkICwUWAgMBAAIe -AQIXgAAKCRCmgmdsv1O9xql2A/4pix98NxjhdsXtazA9agpAKeADf9tG4Za27Gj+ -3DCww/E4iP2X35jZimSm/30QRB6j08uGCqd9vXkkJxtOt63y/IpVOtWX6vMWSTUm -k8xKkaYMP0/IzKNJ1qC/qYEUYpwERBKg9Z+k99E2Ql4kRHdxXUHq6OzY79H18Y+s -GdeM/riNBFsiyxsBBAC54Pxg/8ZWaZX1phGdwfe5mek27SOYpC0AxIDCSOdMeQ6G -HPk38pywl1d+S+KmF/F4Tdi+kWro62O4eG2uc/T8JQuRDUhSjX0Qa51gPzJrUOVT -CFyUkiZ/3ZDhtXkgfuso8ua2ChBgR9Ngr4v43tSqa9y6AK7v0qjxD1x+xMrjXQAR -AQABiQFxBBgBCgAmAhsCFiEEWbIsWTn0HGXVtMFKpoJnbL9TvcYFAlsizTIFCQAN -MRcAv7QgBBkBCgAdFiEEJcoVUVJIk5RWj1c/o62jUpRPICQFAlsiyxsACgkQo62j -UpRPICQq5gQApoWIigZxXFoM0uw4uJBS5JFZtirTANvirZV5RhndwHeMN6JttaBS -YnjyA4+n1D+zB2VqliD2QrsX12KJN6rGOehCtEIClQ1Hodo9nC6kMzzAwW1O8bZs -nRJmXV+bsvD4sidLZLjdwOVa3Cxh6pvq4Uur6a7/UYx121hEY0Qx0s8JEKaCZ2y/ -U73GGi0D/i20VW8AWYAPACm2zMlzExKTOAV01YTQH/3vW0WLrOse53WcIVZga6es -HuO4So0SOEAvxKMe5HpRIu2dJxTvd99Bo9xk9xJU0AoFrO0vNCRnL+5y68xMlODK -lEw5/kl0jeaTBp6xX0HDQOEVOpPGUwWV4Ij2EnvfNDXaE1vK1kffiQFrBBgBCgAg -AhsCFiEEWbIsWTn0HGXVtMFKpoJnbL9TvcYFAlsi0AYAv7QgBBkBCgAdFiEEJcoV -UVJIk5RWj1c/o62jUpRPICQFAlsiyxsACgkQo62jUpRPICQq5gQApoWIigZxXFoM -0uw4uJBS5JFZtirTANvirZV5RhndwHeMN6JttaBSYnjyA4+n1D+zB2VqliD2QrsX -12KJN6rGOehCtEIClQ1Hodo9nC6kMzzAwW1O8bZsnRJmXV+bsvD4sidLZLjdwOVa -3Cxh6pvq4Uur6a7/UYx121hEY0Qx0s8JEKaCZ2y/U73GRl0EAJokkXmy4zKDHWWi -wvK9gi2gQgRkVnu2AiONxJb5vjeLhM/07BRmH6K1o+w3fOeEQp4FjXj1eQ5fPSM6 -Hhwx2CTl9SDnPSBMiKXsEFRkmwQ2AAsQZLmQZvKBkLZYeBiwf+IY621eYDhZfo+G -1dh1WoUCyREZsJQg2YoIpWIcvw+a -=bNRo ------END PGP PUBLIC KEY BLOCK----- -` - -const onlySubkeyNoPrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- -Version: GnuPG v1 - -lQCVBFggvocBBAC7vBsHn7MKmS6IiiZNTXdciplVgS9cqVd+RTdIAoyNTcsiV1H0 -GQ3QtodOPeDlQDNoqinqaobd7R9g3m3hS53Nor7yBZkCWQ5x9v9JxRtoAq0sklh1 -I1X2zEqZk2l6YrfBF/64zWrhjnW3j23szkrAIVu0faQXbQ4z56tmZrw11wARAQAB -/gdlAkdOVQG0CUdOVSBEdW1teYi4BBMBAgAiBQJYIL6HAhsDBgsJCAcDAgYVCAIJ -CgsEFgIDAQIeAQIXgAAKCRCd1xxWp1CYAnjGA/9synn6ZXJUKAXQzySgmCZvCIbl -rqBfEpxwLG4Q/lONhm5vthAE0z49I8hj5Gc5e2tLYUtq0o0OCRdCrYHa/efOYWpJ -6RsK99bePOisVzmOABLIgZkcr022kHoMCmkPgv9CUGKP1yqbGl+zzAwQfUjRUmvD -ZIcWLHi2ge4GzPMPi50B2ARYIL6cAQQAxWHnicKejAFcFcF1/3gUSgSH7eiwuBPX -M7vDdgGzlve1o1jbV4tzrjN9jsCl6r0nJPDMfBSzgLr1auNTRG6HpJ4abcOx86ED -Ad+avDcQPZb7z3dPhH/gb2lQejZsHh7bbeOS8WMSzHV3RqCLd8J/xwWPNR5zKn1f -yp4IGfopidMAEQEAAQAD+wQOelnR82+dxyM2IFmZdOB9wSXQeCVOvxSaNMh6Y3lk -UOOkO8Nlic4x0ungQRvjoRs4wBmCuwFK/MII6jKui0B7dn/NDf51i7rGdNGuJXDH -e676By1sEY/NGkc74jr74T+5GWNU64W0vkpfgVmjSAzsUtpmhJMXsc7beBhJdnVl -AgDKCb8hZqj1alcdmLoNvb7ibA3K/V8J462CPD7bMySPBa/uayoFhNxibpoXml2r -oOtHa5izF3b0/9JY97F6rqkdAgD6GdTJ+xmlCoz1Sewoif1I6krq6xoa7gOYpIXo -UL1Afr+LiJeyAnF/M34j/kjIVmPanZJjry0kkjHE5ILjH3uvAf4/6n9np+Th8ujS -YDCIzKwR7639+H+qccOaddCep8Y6KGUMVdD/vTKEx1rMtK+hK/CDkkkxnFslifMJ -kqoqv3WUqCWJAT0EGAECAAkFAlggvpwCGwIAqAkQndccVqdQmAKdIAQZAQIABgUC -WCC+nAAKCRDmGUholQPwvQk+A/9latnSsR5s5/1A9TFki11GzSEnfLbx46FYOdkW -n3YBxZoPQGxNA1vIn8GmouxZInw9CF4jdOJxEdzLlYQJ9YLTLtN5tQEMl/19/bR8 -/qLacAZ9IOezYRWxxZsyn6//jfl7A0Y+FV59d4YajKkEfItcIIlgVBSW6T+TNQT3 -R+EH5HJ/A/4/AN0CmBhhE2vGzTnVU0VPrE4V64pjn1rufFdclgpixNZCuuqpKpoE -VVHn6mnBf4njKjZrAGPs5kfQ+H4NsM7v3Zz4yV6deu9FZc4O6E+V1WJ38rO8eBix -7G2jko106CC6vtxsCPVIzY7aaG3H5pjRtomw+pX7SzrQ7FUg2PGumg== -=F/T0 ------END PGP PRIVATE KEY BLOCK-----` - -const ecdsaPrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- - -xaUEX1KsSRMIKoZIzj0DAQcCAwTpYqJsnJiFhKKh+8TulWD+lVmerBFNS+Ii -B+nlG3T0xQQ4Sy5eIjJ0CExIQQzi3EElF/Z2l4F3WC5taFA11NgA/gkDCHSS -PThf1M2K4LN8F1MRcvR+sb7i0nH55ojkwuVB1DE6jqIT9m9i+mX1tzjSAS+6 -lPQiweCJvG7xTC7Hs3AzRapf/r1At4TB+v+5G2/CKynNFEJpbGwgPGJpbGxA -aG9tZS5jb20+wncEEBMIAB8FAl9SrEkGCwkHCAMCBBUICgIDFgIBAhkBAhsD -Ah4BAAoJEMpwT3+q3+xqw5UBAMebZN9isEZ1ML+R/jWAAWMwa/knMugrEZ1v -Bl9+ZwM0AQCZdf80/wYY4Nve01qSRFv8OmKswLli3TvDv6FKc4cLz8epBF9S -rEkSCCqGSM49AwEHAgMEAjKnT9b5wY2bf9TpAV3d7OUfPOxKj9c4VzeVzSrH -AtQgo/MuI1cdYVURicV4i76DNjFhQHQFTk7BrC+C2u1yqQMBCAf+CQMIHImA -iYfzQtjgQWSFZYUkCFpbbwhNF0ch+3HNaZkaHCnZRIsWsRnc6FCb6lRQyK9+ -Dq59kHlduE5QgY40894jfmP2JdJHU6nBdYrivbEdbMJhBBgTCAAJBQJfUqxJ -AhsMAAoJEMpwT3+q3+xqUI0BAMykhV08kQ4Ip9Qlbss6Jdufv7YrU0Vd5hou -b5TmiPd0APoDBh3qIic+aLLUcAuG3+Gt1P1AbUlmqV61ozn1WfHxfw== -=KLN8 ------END PGP PRIVATE KEY BLOCK-----` - -const dsaPrivateKeyWithElGamalSubkey = `-----BEGIN PGP PRIVATE KEY BLOCK----- - -lQOBBF9/MLsRCACeaF6BI0jTgDAs86t8/kXPfwlPvR2MCYzB0BCqAdcq1hV/GTYd -oNmJRna/ZJfsI/vf+d8Nv+EYOQkPheFS1MJVBitkAXjQPgm8i1tQWen1FCWZxqGk -/vwZYF4yo8GhZ+Wxi3w09W9Cp9QM/CTmyE1Xe7wpPBGe+oD+me8Zxjyt8JBS4Qx+ -gvWbfHxfHnggh4pz7U8QkItlLsBNQEdX4R5+zwRN66g2ZSX/shaa/EkVnihUhD7r -njP9I51ORWucTQD6OvgooaNQZCkQ/Se9TzdakwWKS2XSIFXiY/e2E5ZgKI/pfKDU -iA/KessxddPb7nP/05OIJqg9AoDrD4vmehLzAQD+zsUS3LDU1m9/cG4LMsQbT2VK -Te4HqbGIAle+eu/asQf8DDJMrbZpiJZvADum9j0TJ0oep6VdMbzo9RSDKvlLKT9m -kG63H8oDWnCZm1a+HmGq9YIX+JHWmsLXXsFLeEouLzHO+mZo0X28eji3V2T87hyR -MmUM0wFo4k7jK8uVmkDXv3XwNp2uByWxUKZd7EnWmcEZWqIiexJ7XpCS0Pg3tRaI -zxve0SRe/dxfUPnTk/9KQ9hS6DWroBKquL182zx1Fggh4LIWWE2zq+UYn8BI0E8A -rmIDFJdF8ymFQGRrEy6g79NnkPmkrZWsgMRYY65P6v4zLVmqohJKkpm3/Uxa6QAP -CCoPh/JTOvPeCP2bOJH8z4Z9Py3ouMIjofQW8sXqRgf/RIHbh0KsINHrwwZ4gVIr -MK3RofpaYxw1ztPIWb4cMWoWZHH1Pxh7ggTGSBpAhKXkiWw2Rxat8QF5aA7e962c -bLvVv8dqsPrD/RnVJHag89cbPTzjn7gY9elE8EM8ithV3oQkwHTr4avYlpDZsgNd -hUW3YgRwGo31tdzxoG04AcpV2t+07P8XMPr9hsfWs4rHohXPi38Hseu1Ji+dBoWQ -3+1w/HH3o55s+jy4Ruaz78AIrjbmAJq+6rA2mIcCgrhw3DnzuwQAKeBvSeqn9zfS -ZC812osMBVmkycwelpaIh64WZ0vWL3GvdXDctV2kXM+qVpDTLEny0LuiXxrwCKQL -Ev4HAwK9uQBcreDEEud7pfRb8EYP5lzO2ZA7RaIvje6EWAGBvJGMRT0QQE5SGqc7 -Fw5geigBdt+vVyRuNNhg3c2fdn/OBQaYu0J/8AiOogG8EaM8tCFlbGdhbWFsQGRz -YS5jb20gPGVsZ2FtYWxAZHNhLmNvbT6IkAQTEQgAOBYhBI+gnfiHQxB35/Dp0XAQ -aE/rsWC5BQJffzC7AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEHAQaE/r -sWC5A4EA/0GcJmyPtN+Klc7b9sVT3JgKTRnB/URxOJfYJofP0hZLAQCkqyMO+adV -JvbgDH0zaITQWZSSXPqpgMpCA6juTrDsd50CawRffzC7EAgAxFFFSAAEQzWTgKU5 -EBtpxxoPzHqcChawTHRxHxjcELXzmUBS5PzfA1HXSPnNqK/x3Ut5ycC3CsW41Fnt -Gm3706Wu9VFbFZVn55F9lPiplUo61n5pqMvOr1gmuQsdXiTa0t5FRa4TZ2VSiHFw -vdAVSPTUsT4ZxJ1rPyFYRtq1n3pQcvdZowd07r0JnzTMjLLMFYCKhwIowoOC4zqJ -iB8enjwOlpaqBATRm9xpVF7SJkroPF6/B1vdhj7E3c1aJyHlo0PYBAg756sSHWHg -UuLyUQ4TA0hcCVenn/L/aSY2LnbdZB1EBhlYjA7dTCgwIqsQhfQmPkjz6g64A7+Y -HbbrLwADBQgAk14QIEQ+J/VHetpQV/jt2pNsFK1kVK7mXK0spTExaC2yj2sXlHjL -Ie3bO5T/KqmIaBEB5db5fA5xK9cZt79qrQHDKsEqUetUeMUWLBx77zBsus3grIgy -bwDZKseRzQ715pwxquxQlScGoDIBKEh08HpwHkq140eIj3w+MAIfndaZaSCNaxaP -Snky7BQmJ7Wc7qrIwoQP6yrnUqyW2yNi81nJYUhxjChqaFSlwzLs/iNGryBKo0ic -BqVIRjikKHBlwBng6WyrltQo/Vt9GG8w+lqaAVXbJRlaBZJUR+2NKi/YhP3qQse3 -v8fi4kns0gh5LK+2C01RvdX4T49QSExuIf4HAwLJqYIGwadA2uem5v7/765ZtFWV -oL0iZ0ueTJDby4wTFDpLVzzDi/uVcB0ZRFrGOp7w6OYcNYTtV8n3xmli2Q5Trw0c -wZVzvg+ABKWiv7faBjMczIFF8y6WZKOIeAQYEQgAIBYhBI+gnfiHQxB35/Dp0XAQ -aE/rsWC5BQJffzC7AhsMAAoJEHAQaE/rsWC5ZmIA/jhS4r4lClbvjuPWt0Yqdn7R -fss2SPMYvMrrDh42aE0OAQD8xn4G6CN8UtW9xihXOY6FpxiJ/sMc2VaneeUd34oa -4g== -=XZm8 ------END PGP PRIVATE KEY BLOCK-----` - -// https://tests.sequoia-pgp.org/#Certificate_expiration -// P _ U p -const expiringPrimaryUIDKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -xsDNBF2lnPIBDAC5cL9PQoQLTMuhjbYvb4Ncuuo0bfmgPRFywX53jPhoFf4Zg6mv -/seOXpgecTdOcVttfzC8ycIKrt3aQTiwOG/ctaR4Bk/t6ayNFfdUNxHWk4WCKzdz -/56fW2O0F23qIRd8UUJp5IIlN4RDdRCtdhVQIAuzvp2oVy/LaS2kxQoKvph/5pQ/ -5whqsyroEWDJoSV0yOb25B/iwk/pLUFoyhDG9bj0kIzDxrEqW+7Ba8nocQlecMF3 -X5KMN5kp2zraLv9dlBBpWW43XktjcCZgMy20SouraVma8Je/ECwUWYUiAZxLIlMv -9CurEOtxUw6N3RdOtLmYZS9uEnn5y1UkF88o8Nku890uk6BrewFzJyLAx5wRZ4F0 -qV/yq36UWQ0JB/AUGhHVPdFf6pl6eaxBwT5GXvbBUibtf8YI2og5RsgTWtXfU7eb -SGXrl5ZMpbA6mbfhd0R8aPxWfmDWiIOhBufhMCvUHh1sApMKVZnvIff9/0Dca3wb -vLIwa3T4CyshfT0AEQEAAc0hQm9iIEJhYmJhZ2UgPGJvYkBvcGVucGdwLmV4YW1w -bGU+wsFcBBMBCgCQBYJhesp/BYkEWQPJBQsJCAcCCRD7/MgqAV5zMEcUAAAAAAAe -ACBzYWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmeEOQlNyTLFkc9I/elp+BpY -495V7KatqtDmsyDr+zDAdwYVCgkICwIEFgIDAQIXgAIbAwIeARYhBNGmbhojsYLJ -mA94jPv8yCoBXnMwAABSCQv/av8hKyynMtXVKFuWOGJw0mR8auDm84WdhMFRZg8t -yTJ1L88+Ny4WUAFeqo2j7DU2yPGrm5rmuvzlEedFYFeOWt+A4adz+oumgRd0nsgG -Lf3QYUWQhLWVlz+H7zubgKqSB2A2RqV65S7mTTVro42nb2Mng6rvGWiqeKG5nrXN -/01p1mIBQGR/KnZSqYLzA2Pw2PiJoSkXT26PDz/kiEMXpjKMR6sicV4bKVlEdUvm -pIImIPBHZq1EsKXEyWtWC41w/pc+FofGE+uSFs2aef1vvEHFkj3BHSK8gRcH3kfR -eFroTET8C2q9V1AOELWm+Ys6PzGzF72URK1MKXlThuL4t4LjvXWGNA78IKW+/RQH -DzK4U0jqSO0mL6qxqVS5Ij6jjL6OTrVEGdtDf5n0vI8tcUTBKtVqYAYk+t2YGT05 -ayxALtb7viVKo8f10WEcCuKshn0gdsEFMRZQzJ89uQIY3R3FbsdRCaE6OEaDgKMQ -UTFROyfhthgzRKbRxfcplMUCzsDNBF2lnPIBDADWML9cbGMrp12CtF9b2P6z9TTT -74S8iyBOzaSvdGDQY/sUtZXRg21HWamXnn9sSXvIDEINOQ6A9QxdxoqWdCHrOuW3 -ofneYXoG+zeKc4dC86wa1TR2q9vW+RMXSO4uImA+Uzula/6k1DogDf28qhCxMwG/ -i/m9g1c/0aApuDyKdQ1PXsHHNlgd/Dn6rrd5y2AObaifV7wIhEJnvqgFXDN2RXGj -LeCOHV4Q2WTYPg/S4k1nMXVDwZXrvIsA0YwIMgIT86Rafp1qKlgPNbiIlC1g9RY/ -iFaGN2b4Ir6GDohBQSfZW2+LXoPZuVE/wGlQ01rh827KVZW4lXvqsge+wtnWlszc -selGATyzqOK9LdHPdZGzROZYI2e8c+paLNDdVPL6vdRBUnkCaEkOtl1mr2JpQi5n -TU+gTX4IeInC7E+1a9UDF/Y85ybUz8XV8rUnR76UqVC7KidNepdHbZjjXCt8/Zo+ -Tec9JNbYNQB/e9ExmDntmlHEsSEQzFwzj8sxH48AEQEAAcLA9gQYAQoAIBYhBNGm -bhojsYLJmA94jPv8yCoBXnMwBQJdpZzyAhsMAAoJEPv8yCoBXnMw6f8L/26C34dk -jBffTzMj5Bdzm8MtF67OYneJ4TQMw7+41IL4rVcSKhIhk/3Ud5knaRtP2ef1+5F6 -6h9/RPQOJ5+tvBwhBAcUWSupKnUrdVaZQanYmtSxcVV2PL9+QEiNN3tzluhaWO// -rACxJ+K/ZXQlIzwQVTpNhfGzAaMVV9zpf3u0k14itcv6alKY8+rLZvO1wIIeRZLm -U0tZDD5HtWDvUV7rIFI1WuoLb+KZgbYn3OWjCPHVdTrdZ2CqnZbG3SXw6awH9bzR -LV9EXkbhIMez0deCVdeo+wFFklh8/5VK2b0vk/+wqMJxfpa1lHvJLobzOP9fvrsw -sr92MA2+k901WeISR7qEzcI0Fdg8AyFAExaEK6VyjP7SXGLwvfisw34OxuZr3qmx -1Sufu4toH3XrB7QJN8XyqqbsGxUCBqWif9RSK4xjzRTe56iPeiSJJOIciMP9i2ld -I+KgLycyeDvGoBj0HCLO3gVaBe4ubVrj5KjhX2PVNEJd3XZRzaXZE2aAMQ== -=AmgT ------END PGP PUBLIC KEY BLOCK-----` - -const rsa2048PrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- -Comment: gpg (GnuPG) 2.2.27 with libgcrypt 1.9.4 - -lQPGBGL07P0BCADL0etN8efyAXA6sL2WfQvHe5wEKYXPWeN2+jiqSppfeRZAOlzP -kZ3U+cloeJriplYvVJwI3ID2aw52Z/TRn8iKRP5eOUFrEgcgl06lazLtOndK7o7p -oBV5mLtHEirFHm6W61fNt10jzM0jx0PV6nseLhFB2J42F1cmU/aBgFo41wjLSZYr -owR+v+O9S5sUXblQF6sEDcY01sBEu09zrIgT49VFwQ1Cvdh9XZEOTQBfdiugoj5a -DS3fAqAka3r1VoQK4eR7/upnYSgSACGeaQ4pUelKku5rpm50gdWTY8ppq0k9e1eT -y2x0OQcW3hWE+j4os1ca0ZEADMdqr/99MOxrABEBAAH+BwMCJWxU4VOZOJ7/I6vX -FxdfBhIBEXlJ52FM3S/oYtXqLhkGyrtmZOeEazVvUtuCe3M3ScHI8xCthcmE8E0j -bi+ZEHPS2NiBZtgHFF27BLn7zZuTc+oD5WKduZdK3463egnyThTqIIMl25WZBuab -k5ycwYrWwBH0jfA4gwJ13ai4pufKC2RM8qIu6YAVPglYBKFLKGvvJHa5vI+LuA0E -K+k35hIic7yVUcQneNnAF2598X5yWiieYnOZpmHlRw1zfbMwOJr3ZNj2v94u7b+L -sTa/1Uv9887Vb6sJp0c2Sh4cwEccoPYkvMqFn3ZrJUr3UdDu1K2vWohPtswzhrYV -+RdPZE5RLoCQufKvlPezk0Pzhzb3bBU7XjUbdGY1nH/EyQeBNp+Gw6qldKvzcBaB -cyOK1c6hPSszpJX93m5UxCN55IeifmcNjmbDh8vGCCdajy6d56qV2n4F3k7vt1J1 -0UlxIGhqijJoaTCX66xjLMC6VXkSz6aHQ35rnXosm/cqPcQshsZTdlfSyWkorfdr -4Hj8viBER26mjYurTMLBKDtUN724ZrR0Ev5jorX9uoKlgl87bDZHty2Ku2S+vR68 -VAvnj6Fi1BYNclnDoqxdRB2z5T9JbWE52HuG83/QsplhEqXxESDxriTyTHMbNxEe -88soVCDh4tgflZFa2ucUr6gEKJKij7jgahARnyaXfPZlQBUAS1YUeILYmN+VR+M/ -sHENpwDWc7TInn8VN638nJV+ScZGMih3AwWZTIoiLju3MMt1K0YZ3NuiqwGH4Jwg -/BbEdTWeCci9y3NEQHQ3uZZ5p6j2CwFVlK11idemCMvAiTVxF+gKdaLMkeCwKxru -J3YzhKEo+iDVYbPYBYizx/EHBn2U5kITQ5SBXzjTaaFMNZJEf9JYsL1ybPB6HOFY -VNVB2KT8CGVwtCJHb2xhbmcgR29waGVyIDxnb2xhbmdAZXhhbXBsZS5vcmc+iQFO -BBMBCgA4FiEEC6K7U7f4qesybTnqSkra7gHusm0FAmL07P0CGwMFCwkIBwIGFQoJ -CAsCBBYCAwECHgECF4AACgkQSkra7gHusm1MvwgAxpClWkeSqIhMQfbiuz0+lOkE -89y1DCFw8bHjZoUf4/4K8hFA3dGkk+q72XFgiyaCpfXxMt6Gi+dN47t+tTv9NIqC -sukbaoJBmJDhN6+djmJOgOYy+FWsW2LAk2LOwKYulpnBZdcA5rlMAhBg7gevQpF+ -ruSU69P7UUaFJl/DC7hDmaIcj+4cjBE/HO26SnVQjoTfjZT82rDh1Wsuf8LnkJUk -b3wezBLpXKjDvdHikdv4gdlR4AputVM38aZntYYglh/EASo5TneyZ7ZscdLNRdcF -r5O2fKqrOJLOdaoYRFZZWOvP5GtEVFDU7WGivOSVfiszBE0wZR3dgZRJipHCXJ0D -xgRi9Oz9AQgAtMJcJqLLVANJHl90tWuoizDkm+Imcwq2ubQAjpclnNrODnDK+7o4 -pBsWmXbZSdkC4gY+LhOQA6bPDD0JEHM58DOnrm49BddxXAyK0HPsk4sGGt2SS86B -OawWNdfJVyqw4bAiHWDmQg4PcjBbt3ocOIxAR6I5kBSiQVxuGQs9T+Zvg3G1r3Or -fS6DzlgY3HFUML5YsGH4lOxNSOoKAP68GIH/WNdUZ+feiRg9knIib6I3Hgtf5eO8 -JRH7aWE/TD7eNu36bLLjT5TZPq5r6xaD2plbtPOyXbNPWs9qI1yG+VnErfaLY0w8 -Qo0aqzbgID+CTZVomXSOpOcQseaFKw8ZfQARAQAB/gcDArha6+/+d4OY/w9N32K9 -hFNYt4LufTETMQ+k/sBeaMuAVzmT47DlAXzkrZhGW4dZOtXMu1rXaUwHlqkhEyzL -L4MYEWVXfD+LbZNEK3MEFss6RK+UAMeT/PTV9aA8cXQVPcSJYzfBXHQ1U1hnOgrO -apn92MN8RmkhX8wJLyeWTMMuP4lXByJMmmGo8WvifeRD2kFY4y0WVBDAXJAV4Ljf -Di/bBiwoc5a+gxHuZT2W9ZSxBQJNXdt4Un2IlyZuo58s5MLx2N0EaNJ8PwRUE6fM -RZYO8aZCEPUtINE4njbvsWOMCtrblsMPwZ1B0SiIaWmLaNyGdCNKea+fCIW7kasC -JYMhnLumpUTXg5HNexkCsl7ABWj0PYBflOE61h8EjWpnQ7JBBVKS2ua4lMjwHRX7 -5o5yxym9k5UZNFdGoXVL7xpizCcdGawxTJvwhs3vBqu1ZWYCegOAZWDrOkCyhUpq -8uKMROZFbn+FwE+7tjt+v2ed62FVEvD6g4V3ThCA6mQqeOARfJWN8GZY8BDm8lht -crOXriUkrx+FlrgGtm2CkwjW5/9Xd7AhFpHnQdFeozOHyq1asNSgJF9sNi9Lz94W -skQSVRi0IExxSXYGI3Y0nnAZUe2BAQflYPJdEveSr3sKlUqXiETTA1VXsTPK3kOC -92CbLzj/Hz199jZvywwyu53I+GKMpF42rMq7zxr2oa61YWY4YE/GDezwwys/wLx/ -QpCW4X3ppI7wJjCSSqEV0baYZSSli1ayheS6dxi8QnSpX1Bmpz6gU7m/M9Sns+hl -J7ZvgpjCAiV7KJTjtclr5/S02zP78LTVkoTWoz/6MOTROwaP63VBUXX8pbJhf/vu -DLmNnDk8joMJxoDXWeNU0EnNl4hP7Z/jExRBOEO4oAnUf/Sf6gCWQhL5qcajtg6w -tGv7vx3f2IkBNgQYAQoAIBYhBAuiu1O3+KnrMm056kpK2u4B7rJtBQJi9Oz9AhsM -AAoJEEpK2u4B7rJt6lgIAMBWqP4BCOGnQXBbgJ0+ACVghpkFUXZTb/tXJc8UUvTM -8uov6k/RsqDGZrvhhufD7Wwt7j9v7dD7VPp7bPyjVWyimglQzWguTUUqLDGlstYH -5uYv1pzma0ZsAGNqFeGlTLsKOSGKFMH4rB2KfN2n51L8POvtp1y7GKZQbWIWneaB -cZr3BINU5GMvYYU7pAYcoR+mJPdJx5Up3Ocn+bn8Tu1sy9C/ArtCQucazGnoE9u1 -HhNLrh0CdzzX7TNH6TQ8LwPOvq0K5l/WqbN9lE0WBBhMv2HydxhluO8AhU+A5GqC -C+wET7nVDnhoOm/fstIeb7/LN7OYejKPeHdFBJEL9GA= -=u442 ------END PGP PRIVATE KEY BLOCK-----` - -const curve25519PrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- -Comment: gpg (GnuPG) 2.2.27 with libgcrypt 1.9.4 - -lFgEYvTtQBYJKwYBBAHaRw8BAQdAxsNXLbrk5xOjpO24VhOMvQ0/F+JcyIkckMDH -X3FIGxcAAQDFOlunZWYuPsCx5JLp78vKqUTfgef9TGG4oD6I/Sa0zBMstCJHb2xh -bmcgR29waGVyIDxnb2xhbmdAZXhhbXBsZS5vcmc+iJAEExYIADgWIQSFQHEOazmo -h1ldII4MvfnLQ4JBNwUCYvTtQAIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAK -CRAMvfnLQ4JBN5yeAQCKdry8B5ScCPrev2+UByMCss7Sdu5RhomCFsHdNPLcKAEA -8ugei+1owHsV+3cGwWWzKk6sLa8ZN87i3SKuOGp9DQycXQRi9O1AEgorBgEEAZdV -AQUBAQdA5CubPp8l7lrVQ25h7Hx5XN2C8xanRnnpcjzEooCaEA0DAQgHAAD/Rpc+ -sOZUXrFk9HOWB1XU41LoWbDBoG8sP8RWAVYwD5AQRYh4BBgWCAAgFiEEhUBxDms5 -qIdZXSCODL35y0OCQTcFAmL07UACGwwACgkQDL35y0OCQTcvdwEA7lb5g/YisrEf -iq660uwMGoepLUfvtqKzuQ6heYe83y0BAN65Ffg5HYOJzUEi0kZQRf7OhdtuL2kJ -SRXn8DmCTfEB -=cELM ------END PGP PRIVATE KEY BLOCK-----` - -const curve448PrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- -Comment: C1DB 65D5 80D7 B922 7254 4B1E A699 9895 FABA CE52 - -xYUEYV2UmRYDK2VxAc9AFyxgh5xnSbyt50TWl558mw9xdMN+/UBLr5+UMP8IsrvV -MdXuTIE8CyaUQKSotHtH2RkYEXj5nsMAAAHPQIbTMSzjIWug8UFECzAex5FHgAgH -gYF3RK+TS8D24wX8kOu2C/NoVxwGY+p+i0JHaB+7yljriSKAGxs6wsBEBB8WCgCD -BYJhXZSZBYkFpI+9AwsJBwkQppmYlfq6zlJHFAAAAAAAHgAgc2FsdEBub3RhdGlv -bnMuc2VxdW9pYS1wZ3Aub3Jn5wSpIutJ5HncJWk4ruUV8GzQF390rR5+qWEAnAoY -akcDFQoIApsBAh4BFiEEwdtl1YDXuSJyVEseppmYlfq6zlIAALzdA5dA/fsgYg/J -qaQriYKaPUkyHL7EB3BXhV2d1h/gk+qJLvXQuU2WEJ/XSs3GrsBRiiZwvPH4o+7b -mleAxjy5wpS523vqrrBR2YZ5FwIku7WS4litSdn4AtVam/TlLdMNIf41CtFeZKBe -c5R5VNdQy8y7qy8AAADNEUN1cnZlNDQ4IE9wdGlvbiA4wsBHBBMWCgCGBYJhXZSZ -BYkFpI+9AwsJBwkQppmYlfq6zlJHFAAAAAAAHgAgc2FsdEBub3RhdGlvbnMuc2Vx -dW9pYS1wZ3Aub3JnD55UsYMzE6OACP+mgw5zvT+BBgol8/uFQjHg4krjUCMDFQoI -ApkBApsBAh4BFiEEwdtl1YDXuSJyVEseppmYlfq6zlIAAPQJA5dA0Xqwzn/0uwCq -RlsOVCB3f5NOj1exKnlBvRw0xT1VBee1yxvlUt5eIAoCxWoRlWBJob3TTkhm9AEA -8dyhwPmyGfWHzPw5NFG3xsXrZdNXNvit9WMVAPcmsyR7teXuDlJItxRAdJJc/qfJ -YVbBFoaNrhYAAADHhQRhXZSZFgMrZXEBz0BL7THZ9MnCLfSPJ1FMLim9eGkQ3Bfn -M3he5rOwO3t14QI1LjI96OjkeJipMgcFAmEP1Bq/ZHGO7oAAAc9AFnE8iNBaT3OU -EFtxkmWHXtdaYMmGGRdopw9JPXr/UxuunDln5o9dxPxf7q7z26zXrZen+qed/Isa -HsDCwSwEGBYKAWsFgmFdlJkFiQWkj70JEKaZmJX6us5SRxQAAAAAAB4AIHNhbHRA -bm90YXRpb25zLnNlcXVvaWEtcGdwLm9yZxREUizdTcepBzgSMOv2VWQCWbl++3CZ -EbgAWDryvSsyApsCwDGgBBkWCgBvBYJhXZSZCRBKo3SL4S5djkcUAAAAAAAeACBz -YWx0QG5vdGF0aW9ucy5zZXF1b2lhLXBncC5vcmemoGTDjmNQiIzw6HOEddvS0OB7 -UZ/P07jM/EVmnYxTlBYhBAxsnkGpx1UCiH6gUUqjdIvhLl2OAAALYQOXQAMB1oKq -OWxSFmvmgCKNcbAAyA3piF5ERIqs4z07oJvqDYrOWt75UsEIH/04gU/vHc4EmfG2 -JDLJgOLlyTUPkL/08f0ydGZPofFQBhn8HkuFFjnNtJ5oz3GIP4cdWMQFaUw0uvjb -PM9Tm3ptENGd6Ts1AAAAFiEEwdtl1YDXuSJyVEseppmYlfq6zlIAAGpTA5dATR6i -U2GrpUcQgpG+JqfAsGmF4yAOhgFxc1UfidFk3nTup3fLgjipkYY170WLRNbyKkVO -Sodx93GAs58rizO1acDAWiLq3cyEPBFXbyFThbcNPcLl+/77Uk/mgkYrPQFAQWdK -1kSRm4SizDBK37K8ChAAAADHhwRhXZSZEgMrZW8Bx0DMhzvhQo+OsXeqQ6QVw4sF -CaexHh6rLohh7TzL3hQSjoJ27fV6JBkIWdn0LfrMlJIDbSv2SLdlgQMBCgkAAcdA -MO7Dc1myF6Co1fAH+EuP+OxhxP/7V6ljuSCZENDfA49tQkzTta+PniG+pOVB2LHb -huyaKBkqiaogo8LAOQQYFgoAeAWCYV2UmQWJBaSPvQkQppmYlfq6zlJHFAAAAAAA -HgAgc2FsdEBub3RhdGlvbnMuc2VxdW9pYS1wZ3Aub3JnEjBMQAmc/2u45u5FQGmB -QAytjSG2LM3JQN+PPVl5vEkCmwwWIQTB22XVgNe5InJUSx6mmZiV+rrOUgAASdYD -l0DXEHQ9ykNP2rZP35ET1dmiFagFtTj/hLQcWlg16LqvJNGqOgYXuqTerbiOOt02 -XLCBln+wdewpU4ChEffMUDRBfqfQco/YsMqWV7bHJHAO0eC/DMKCjyU90xdH7R/d -QgqsfguR1PqPuJxpXV4bSr6CGAAAAA== -=MSvh ------END PGP PRIVATE KEY BLOCK-----` - -const keyWithNotation = `-----BEGIN PGP PRIVATE KEY BLOCK----- - -xVgEY9gIshYJKwYBBAHaRw8BAQdAF25fSM8OpFlXZhop4Qpqo5ywGZ4jgWlR -ppjhIKDthREAAQC+LFpzFcMJYcjxGKzBGHN0Px2jU4d04YSRnFAik+lVVQ6u -zRdUZXN0IDx0ZXN0QGV4YW1wbGUuY29tPsLACgQQFgoAfAUCY9gIsgQLCQcI -CRD/utJOCym8pR0UgAAAAAAQAAR0ZXh0QGV4YW1wbGUuY29tdGVzdB8UAAAA -AAASAARiaW5hcnlAZXhhbXBsZS5jb20AAQIDAxUICgQWAAIBAhkBAhsDAh4B -FiEEEMCQTUVGKgCX5rDQ/7rSTgspvKUAAPl5AP9Npz90LxzrB97Qr2DrGwfG -wuYn4FSYwtuPfZHHeoIabwD/QEbvpQJ/NBb9EAZuow4Rirlt1yv19mmnF+j5 -8yUzhQjHXQRj2AiyEgorBgEEAZdVAQUBAQdARXAo30DmKcyUg6co7OUm0RNT -z9iqFbDBzA8A47JEt1MDAQgHAAD/XKK3lBm0SqMR558HLWdBrNG6NqKuqb5X -joCML987ZNgRD8J4BBgWCAAqBQJj2AiyCRD/utJOCym8pQIbDBYhBBDAkE1F -RioAl+aw0P+60k4LKbylAADRxgEAg7UfBDiDPp5LHcW9D+SgFHk6+GyEU4ev -VppQxdtxPvAA/34snHBX7Twnip1nMt7P4e2hDiw/hwQ7oqioOvc6jMkP -=Z8YJ ------END PGP PRIVATE KEY BLOCK----- -` diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go deleted file mode 100644 index fec41a0e73..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_config.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -package packet - -import "math/bits" - -// CipherSuite contains a combination of Cipher and Mode -type CipherSuite struct { - // The cipher function - Cipher CipherFunction - // The AEAD mode of operation. - Mode AEADMode -} - -// AEADConfig collects a number of AEAD parameters along with sensible defaults. -// A nil AEADConfig is valid and results in all default values. -type AEADConfig struct { - // The AEAD mode of operation. - DefaultMode AEADMode - // Amount of octets in each chunk of data - ChunkSize uint64 -} - -// Mode returns the AEAD mode of operation. -func (conf *AEADConfig) Mode() AEADMode { - // If no preference is specified, OCB is used (which is mandatory to implement). - if conf == nil || conf.DefaultMode == 0 { - return AEADModeOCB - } - - mode := conf.DefaultMode - if mode != AEADModeEAX && mode != AEADModeOCB && mode != AEADModeGCM { - panic("AEAD mode unsupported") - } - return mode -} - -// ChunkSizeByte returns the byte indicating the chunk size. The effective -// chunk size is computed with the formula uint64(1) << (chunkSizeByte + 6) -// limit to 16 = 4 MiB -// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2 -func (conf *AEADConfig) ChunkSizeByte() byte { - if conf == nil || conf.ChunkSize == 0 { - return 12 // 1 << (12 + 6) == 262144 bytes - } - - chunkSize := conf.ChunkSize - exponent := bits.Len64(chunkSize) - 1 - switch { - case exponent < 6: - exponent = 6 - case exponent > 16: - exponent = 16 - } - - return byte(exponent - 6) -} - -// decodeAEADChunkSize returns the effective chunk size. In 32-bit systems, the -// maximum returned value is 1 << 30. -func decodeAEADChunkSize(c byte) int { - size := uint64(1 << (c + 6)) - if size != uint64(int(size)) { - return 1 << 30 - } - return int(size) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go deleted file mode 100644 index cee83bdc7a..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_crypter.go +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -package packet - -import ( - "bytes" - "crypto/cipher" - "encoding/binary" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// aeadCrypter is an AEAD opener/sealer, its configuration, and data for en/decryption. -type aeadCrypter struct { - aead cipher.AEAD - chunkSize int - initialNonce []byte - associatedData []byte // Chunk-independent associated data - chunkIndex []byte // Chunk counter - packetTag packetType // SEIP packet (v2) or AEAD Encrypted Data packet - bytesProcessed int // Amount of plaintext bytes encrypted/decrypted - buffer bytes.Buffer // Buffered bytes across chunks -} - -// computeNonce takes the incremental index and computes an eXclusive OR with -// the least significant 8 bytes of the receivers' initial nonce (see sec. -// 5.16.1 and 5.16.2). It returns the resulting nonce. -func (wo *aeadCrypter) computeNextNonce() (nonce []byte) { - if wo.packetTag == packetTypeSymmetricallyEncryptedIntegrityProtected { - return append(wo.initialNonce, wo.chunkIndex...) - } - - nonce = make([]byte, len(wo.initialNonce)) - copy(nonce, wo.initialNonce) - offset := len(wo.initialNonce) - 8 - for i := 0; i < 8; i++ { - nonce[i+offset] ^= wo.chunkIndex[i] - } - return -} - -// incrementIndex performs an integer increment by 1 of the integer represented by the -// slice, modifying it accordingly. -func (wo *aeadCrypter) incrementIndex() error { - index := wo.chunkIndex - if len(index) == 0 { - return errors.AEADError("Index has length 0") - } - for i := len(index) - 1; i >= 0; i-- { - if index[i] < 255 { - index[i]++ - return nil - } - index[i] = 0 - } - return errors.AEADError("cannot further increment index") -} - -// aeadDecrypter reads and decrypts bytes. It buffers extra decrypted bytes when -// necessary, similar to aeadEncrypter. -type aeadDecrypter struct { - aeadCrypter // Embedded ciphertext opener - reader io.Reader // 'reader' is a partialLengthReader - peekedBytes []byte // Used to detect last chunk - eof bool -} - -// Read decrypts bytes and reads them into dst. It decrypts when necessary and -// buffers extra decrypted bytes. It returns the number of bytes copied into dst -// and an error. -func (ar *aeadDecrypter) Read(dst []byte) (n int, err error) { - // Return buffered plaintext bytes from previous calls - if ar.buffer.Len() > 0 { - return ar.buffer.Read(dst) - } - - // Return EOF if we've previously validated the final tag - if ar.eof { - return 0, io.EOF - } - - // Read a chunk - tagLen := ar.aead.Overhead() - cipherChunkBuf := new(bytes.Buffer) - _, errRead := io.CopyN(cipherChunkBuf, ar.reader, int64(ar.chunkSize+tagLen)) - cipherChunk := cipherChunkBuf.Bytes() - if errRead != nil && errRead != io.EOF { - return 0, errRead - } - decrypted, errChunk := ar.openChunk(cipherChunk) - if errChunk != nil { - return 0, errChunk - } - - // Return decrypted bytes, buffering if necessary - if len(dst) < len(decrypted) { - n = copy(dst, decrypted[:len(dst)]) - ar.buffer.Write(decrypted[len(dst):]) - } else { - n = copy(dst, decrypted) - } - - // Check final authentication tag - if errRead == io.EOF { - errChunk := ar.validateFinalTag(ar.peekedBytes) - if errChunk != nil { - return n, errChunk - } - ar.eof = true // Mark EOF for when we've returned all buffered data - } - return -} - -// Close is noOp. The final authentication tag of the stream was already -// checked in the last Read call. In the future, this function could be used to -// wipe the reader and peeked, decrypted bytes, if necessary. -func (ar *aeadDecrypter) Close() (err error) { - return nil -} - -// openChunk decrypts and checks integrity of an encrypted chunk, returning -// the underlying plaintext and an error. It accesses peeked bytes from next -// chunk, to identify the last chunk and decrypt/validate accordingly. -func (ar *aeadDecrypter) openChunk(data []byte) ([]byte, error) { - tagLen := ar.aead.Overhead() - // Restore carried bytes from last call - chunkExtra := append(ar.peekedBytes, data...) - // 'chunk' contains encrypted bytes, followed by an authentication tag. - chunk := chunkExtra[:len(chunkExtra)-tagLen] - ar.peekedBytes = chunkExtra[len(chunkExtra)-tagLen:] - - adata := ar.associatedData - if ar.aeadCrypter.packetTag == packetTypeAEADEncrypted { - adata = append(ar.associatedData, ar.chunkIndex...) - } - - nonce := ar.computeNextNonce() - plainChunk, err := ar.aead.Open(nil, nonce, chunk, adata) - if err != nil { - return nil, err - } - ar.bytesProcessed += len(plainChunk) - if err = ar.aeadCrypter.incrementIndex(); err != nil { - return nil, err - } - return plainChunk, nil -} - -// Checks the summary tag. It takes into account the total decrypted bytes into -// the associated data. It returns an error, or nil if the tag is valid. -func (ar *aeadDecrypter) validateFinalTag(tag []byte) error { - // Associated: tag, version, cipher, aead, chunk size, ... - amountBytes := make([]byte, 8) - binary.BigEndian.PutUint64(amountBytes, uint64(ar.bytesProcessed)) - - adata := ar.associatedData - if ar.aeadCrypter.packetTag == packetTypeAEADEncrypted { - // ... index ... - adata = append(ar.associatedData, ar.chunkIndex...) - } - - // ... and total number of encrypted octets - adata = append(adata, amountBytes...) - nonce := ar.computeNextNonce() - _, err := ar.aead.Open(nil, nonce, tag, adata) - if err != nil { - return err - } - return nil -} - -// aeadEncrypter encrypts and writes bytes. It encrypts when necessary according -// to the AEAD block size, and buffers the extra encrypted bytes for next write. -type aeadEncrypter struct { - aeadCrypter // Embedded plaintext sealer - writer io.WriteCloser // 'writer' is a partialLengthWriter -} - -// Write encrypts and writes bytes. It encrypts when necessary and buffers extra -// plaintext bytes for next call. When the stream is finished, Close() MUST be -// called to append the final tag. -func (aw *aeadEncrypter) Write(plaintextBytes []byte) (n int, err error) { - // Append plaintextBytes to existing buffered bytes - n, err = aw.buffer.Write(plaintextBytes) - if err != nil { - return n, err - } - // Encrypt and write chunks - for aw.buffer.Len() >= aw.chunkSize { - plainChunk := aw.buffer.Next(aw.chunkSize) - encryptedChunk, err := aw.sealChunk(plainChunk) - if err != nil { - return n, err - } - _, err = aw.writer.Write(encryptedChunk) - if err != nil { - return n, err - } - } - return -} - -// Close encrypts and writes the remaining buffered plaintext if any, appends -// the final authentication tag, and closes the embedded writer. This function -// MUST be called at the end of a stream. -func (aw *aeadEncrypter) Close() (err error) { - // Encrypt and write a chunk if there's buffered data left, or if we haven't - // written any chunks yet. - if aw.buffer.Len() > 0 || aw.bytesProcessed == 0 { - plainChunk := aw.buffer.Bytes() - lastEncryptedChunk, err := aw.sealChunk(plainChunk) - if err != nil { - return err - } - _, err = aw.writer.Write(lastEncryptedChunk) - if err != nil { - return err - } - } - // Compute final tag (associated data: packet tag, version, cipher, aead, - // chunk size... - adata := aw.associatedData - - if aw.aeadCrypter.packetTag == packetTypeAEADEncrypted { - // ... index ... - adata = append(aw.associatedData, aw.chunkIndex...) - } - - // ... and total number of encrypted octets - amountBytes := make([]byte, 8) - binary.BigEndian.PutUint64(amountBytes, uint64(aw.bytesProcessed)) - adata = append(adata, amountBytes...) - - nonce := aw.computeNextNonce() - finalTag := aw.aead.Seal(nil, nonce, nil, adata) - _, err = aw.writer.Write(finalTag) - if err != nil { - return err - } - return aw.writer.Close() -} - -// sealChunk Encrypts and authenticates the given chunk. -func (aw *aeadEncrypter) sealChunk(data []byte) ([]byte, error) { - if len(data) > aw.chunkSize { - return nil, errors.AEADError("chunk exceeds maximum length") - } - if aw.associatedData == nil { - return nil, errors.AEADError("can't seal without headers") - } - adata := aw.associatedData - if aw.aeadCrypter.packetTag == packetTypeAEADEncrypted { - adata = append(aw.associatedData, aw.chunkIndex...) - } - - nonce := aw.computeNextNonce() - encrypted := aw.aead.Seal(nil, nonce, data, adata) - aw.bytesProcessed += len(data) - if err := aw.aeadCrypter.incrementIndex(); err != nil { - return nil, err - } - return encrypted, nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go deleted file mode 100644 index 98bd876bf2..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/aead_encrypted.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2019 ProtonTech AG - -package packet - -import ( - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" -) - -// AEADEncrypted represents an AEAD Encrypted Packet. -// See https://www.ietf.org/archive/id/draft-koch-openpgp-2015-rfc4880bis-00.html#name-aead-encrypted-data-packet-t -type AEADEncrypted struct { - cipher CipherFunction - mode AEADMode - chunkSizeByte byte - Contents io.Reader // Encrypted chunks and tags - initialNonce []byte // Referred to as IV in RFC4880-bis -} - -// Only currently defined version -const aeadEncryptedVersion = 1 - -func (ae *AEADEncrypted) parse(buf io.Reader) error { - headerData := make([]byte, 4) - if n, err := io.ReadFull(buf, headerData); n < 4 { - return errors.AEADError("could not read aead header:" + err.Error()) - } - // Read initial nonce - mode := AEADMode(headerData[2]) - nonceLen := mode.IvLength() - - // This packet supports only EAX and OCB - // https://www.ietf.org/archive/id/draft-koch-openpgp-2015-rfc4880bis-00.html#name-aead-encrypted-data-packet-t - if nonceLen == 0 || mode > AEADModeOCB { - return errors.AEADError("unknown mode") - } - - initialNonce := make([]byte, nonceLen) - if n, err := io.ReadFull(buf, initialNonce); n < nonceLen { - return errors.AEADError("could not read aead nonce:" + err.Error()) - } - ae.Contents = buf - ae.initialNonce = initialNonce - c := headerData[1] - if _, ok := algorithm.CipherById[c]; !ok { - return errors.UnsupportedError("unknown cipher: " + string(c)) - } - ae.cipher = CipherFunction(c) - ae.mode = mode - ae.chunkSizeByte = headerData[3] - return nil -} - -// Decrypt returns a io.ReadCloser from which decrypted bytes can be read, or -// an error. -func (ae *AEADEncrypted) Decrypt(ciph CipherFunction, key []byte) (io.ReadCloser, error) { - return ae.decrypt(key) -} - -// decrypt prepares an aeadCrypter and returns a ReadCloser from which -// decrypted bytes can be read (see aeadDecrypter.Read()). -func (ae *AEADEncrypted) decrypt(key []byte) (io.ReadCloser, error) { - blockCipher := ae.cipher.new(key) - aead := ae.mode.new(blockCipher) - // Carry the first tagLen bytes - tagLen := ae.mode.TagLength() - peekedBytes := make([]byte, tagLen) - n, err := io.ReadFull(ae.Contents, peekedBytes) - if n < tagLen || (err != nil && err != io.EOF) { - return nil, errors.AEADError("Not enough data to decrypt:" + err.Error()) - } - chunkSize := decodeAEADChunkSize(ae.chunkSizeByte) - return &aeadDecrypter{ - aeadCrypter: aeadCrypter{ - aead: aead, - chunkSize: chunkSize, - initialNonce: ae.initialNonce, - associatedData: ae.associatedData(), - chunkIndex: make([]byte, 8), - packetTag: packetTypeAEADEncrypted, - }, - reader: ae.Contents, - peekedBytes: peekedBytes}, nil -} - -// associatedData for chunks: tag, version, cipher, mode, chunk size byte -func (ae *AEADEncrypted) associatedData() []byte { - return []byte{ - 0xD4, - aeadEncryptedVersion, - byte(ae.cipher), - byte(ae.mode), - ae.chunkSizeByte} -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go deleted file mode 100644 index 2f5cad71da..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/compressed.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "compress/bzip2" - "compress/flate" - "compress/zlib" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "io" - "strconv" -) - -// Compressed represents a compressed OpenPGP packet. The decompressed contents -// will contain more OpenPGP packets. See RFC 4880, section 5.6. -type Compressed struct { - Body io.Reader -} - -const ( - NoCompression = flate.NoCompression - BestSpeed = flate.BestSpeed - BestCompression = flate.BestCompression - DefaultCompression = flate.DefaultCompression -) - -// CompressionConfig contains compressor configuration settings. -type CompressionConfig struct { - // Level is the compression level to use. It must be set to - // between -1 and 9, with -1 causing the compressor to use the - // default compression level, 0 causing the compressor to use - // no compression and 1 to 9 representing increasing (better, - // slower) compression levels. If Level is less than -1 or - // more then 9, a non-nil error will be returned during - // encryption. See the constants above for convenient common - // settings for Level. - Level int -} - -func (c *Compressed) parse(r io.Reader) error { - var buf [1]byte - _, err := readFull(r, buf[:]) - if err != nil { - return err - } - - switch buf[0] { - case 0: - c.Body = r - case 1: - c.Body = flate.NewReader(r) - case 2: - c.Body, err = zlib.NewReader(r) - case 3: - c.Body = bzip2.NewReader(r) - default: - err = errors.UnsupportedError("unknown compression algorithm: " + strconv.Itoa(int(buf[0]))) - } - - return err -} - -// compressedWriterCloser represents the serialized compression stream -// header and the compressor. Its Close() method ensures that both the -// compressor and serialized stream header are closed. Its Write() -// method writes to the compressor. -type compressedWriteCloser struct { - sh io.Closer // Stream Header - c io.WriteCloser // Compressor -} - -func (cwc compressedWriteCloser) Write(p []byte) (int, error) { - return cwc.c.Write(p) -} - -func (cwc compressedWriteCloser) Close() (err error) { - err = cwc.c.Close() - if err != nil { - return err - } - - return cwc.sh.Close() -} - -// SerializeCompressed serializes a compressed data packet to w and -// returns a WriteCloser to which the literal data packets themselves -// can be written and which MUST be closed on completion. If cc is -// nil, sensible defaults will be used to configure the compression -// algorithm. -func SerializeCompressed(w io.WriteCloser, algo CompressionAlgo, cc *CompressionConfig) (literaldata io.WriteCloser, err error) { - compressed, err := serializeStreamHeader(w, packetTypeCompressed) - if err != nil { - return - } - - _, err = compressed.Write([]byte{uint8(algo)}) - if err != nil { - return - } - - level := DefaultCompression - if cc != nil { - level = cc.Level - } - - var compressor io.WriteCloser - switch algo { - case CompressionZIP: - compressor, err = flate.NewWriter(compressed, level) - case CompressionZLIB: - compressor, err = zlib.NewWriterLevel(compressed, level) - default: - s := strconv.Itoa(int(algo)) - err = errors.UnsupportedError("Unsupported compression algorithm: " + s) - } - if err != nil { - return - } - - literaldata = compressedWriteCloser{compressed, compressor} - - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go deleted file mode 100644 index 04994bec97..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/config.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto" - "crypto/rand" - "io" - "math/big" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/s2k" -) - -// Config collects a number of parameters along with sensible defaults. -// A nil *Config is valid and results in all default values. -type Config struct { - // Rand provides the source of entropy. - // If nil, the crypto/rand Reader is used. - Rand io.Reader - // DefaultHash is the default hash function to be used. - // If zero, SHA-256 is used. - DefaultHash crypto.Hash - // DefaultCipher is the cipher to be used. - // If zero, AES-128 is used. - DefaultCipher CipherFunction - // Time returns the current time as the number of seconds since the - // epoch. If Time is nil, time.Now is used. - Time func() time.Time - // DefaultCompressionAlgo is the compression algorithm to be - // applied to the plaintext before encryption. If zero, no - // compression is done. - DefaultCompressionAlgo CompressionAlgo - // CompressionConfig configures the compression settings. - CompressionConfig *CompressionConfig - // S2K (String to Key) config, used for key derivation in the context of secret key encryption - // and password-encrypted data. - // If nil, the default configuration is used - S2KConfig *s2k.Config - // Iteration count for Iterated S2K (String to Key). - // Only used if sk2.Mode is nil. - // This value is duplicated here from s2k.Config for backwards compatibility. - // It determines the strength of the passphrase stretching when - // the said passphrase is hashed to produce a key. S2KCount - // should be between 65536 and 65011712, inclusive. If Config - // is nil or S2KCount is 0, the value 16777216 used. Not all - // values in the above range can be represented. S2KCount will - // be rounded up to the next representable value if it cannot - // be encoded exactly. When set, it is strongly encrouraged to - // use a value that is at least 65536. See RFC 4880 Section - // 3.7.1.3. - // - // Deprecated: SK2Count should be configured in S2KConfig instead. - S2KCount int - // RSABits is the number of bits in new RSA keys made with NewEntity. - // If zero, then 2048 bit keys are created. - RSABits int - // The public key algorithm to use - will always create a signing primary - // key and encryption subkey. - Algorithm PublicKeyAlgorithm - // Some known primes that are optionally prepopulated by the caller - RSAPrimes []*big.Int - // Curve configures the desired packet.Curve if the Algorithm is PubKeyAlgoECDSA, - // PubKeyAlgoEdDSA, or PubKeyAlgoECDH. If empty Curve25519 is used. - Curve Curve - // AEADConfig configures the use of the new AEAD Encrypted Data Packet, - // defined in the draft of the next version of the OpenPGP specification. - // If a non-nil AEADConfig is passed, usage of this packet is enabled. By - // default, it is disabled. See the documentation of AEADConfig for more - // configuration options related to AEAD. - // **Note: using this option may break compatibility with other OpenPGP - // implementations, as well as future versions of this library.** - AEADConfig *AEADConfig - // V5Keys configures version 5 key generation. If false, this package still - // supports version 5 keys, but produces version 4 keys. - V5Keys bool - // "The validity period of the key. This is the number of seconds after - // the key creation time that the key expires. If this is not present - // or has a value of zero, the key never expires. This is found only on - // a self-signature."" - // https://tools.ietf.org/html/rfc4880#section-5.2.3.6 - KeyLifetimeSecs uint32 - // "The validity period of the signature. This is the number of seconds - // after the signature creation time that the signature expires. If - // this is not present or has a value of zero, it never expires." - // https://tools.ietf.org/html/rfc4880#section-5.2.3.10 - SigLifetimeSecs uint32 - // SigningKeyId is used to specify the signing key to use (by Key ID). - // By default, the signing key is selected automatically, preferring - // signing subkeys if available. - SigningKeyId uint64 - // SigningIdentity is used to specify a user ID (packet Signer's User ID, type 28) - // when producing a generic certification signature onto an existing user ID. - // The identity must be present in the signer Entity. - SigningIdentity string - // InsecureAllowUnauthenticatedMessages controls, whether it is tolerated to read - // encrypted messages without Modification Detection Code (MDC). - // MDC is mandated by the IETF OpenPGP Crypto Refresh draft and has long been implemented - // in most OpenPGP implementations. Messages without MDC are considered unnecessarily - // insecure and should be prevented whenever possible. - // In case one needs to deal with messages from very old OpenPGP implementations, there - // might be no other way than to tolerate the missing MDC. Setting this flag, allows this - // mode of operation. It should be considered a measure of last resort. - InsecureAllowUnauthenticatedMessages bool - // KnownNotations is a map of Notation Data names to bools, which controls - // the notation names that are allowed to be present in critical Notation Data - // signature subpackets. - KnownNotations map[string]bool - // SignatureNotations is a list of Notations to be added to any signatures. - SignatureNotations []*Notation -} - -func (c *Config) Random() io.Reader { - if c == nil || c.Rand == nil { - return rand.Reader - } - return c.Rand -} - -func (c *Config) Hash() crypto.Hash { - if c == nil || uint(c.DefaultHash) == 0 { - return crypto.SHA256 - } - return c.DefaultHash -} - -func (c *Config) Cipher() CipherFunction { - if c == nil || uint8(c.DefaultCipher) == 0 { - return CipherAES128 - } - return c.DefaultCipher -} - -func (c *Config) Now() time.Time { - if c == nil || c.Time == nil { - return time.Now().Truncate(time.Second) - } - return c.Time().Truncate(time.Second) -} - -// KeyLifetime returns the validity period of the key. -func (c *Config) KeyLifetime() uint32 { - if c == nil { - return 0 - } - return c.KeyLifetimeSecs -} - -// SigLifetime returns the validity period of the signature. -func (c *Config) SigLifetime() uint32 { - if c == nil { - return 0 - } - return c.SigLifetimeSecs -} - -func (c *Config) Compression() CompressionAlgo { - if c == nil { - return CompressionNone - } - return c.DefaultCompressionAlgo -} - -func (c *Config) RSAModulusBits() int { - if c == nil || c.RSABits == 0 { - return 2048 - } - return c.RSABits -} - -func (c *Config) PublicKeyAlgorithm() PublicKeyAlgorithm { - if c == nil || c.Algorithm == 0 { - return PubKeyAlgoRSA - } - return c.Algorithm -} - -func (c *Config) CurveName() Curve { - if c == nil || c.Curve == "" { - return Curve25519 - } - return c.Curve -} - -// Deprecated: The hash iterations should now be queried via the S2K() method. -func (c *Config) PasswordHashIterations() int { - if c == nil || c.S2KCount == 0 { - return 0 - } - return c.S2KCount -} - -func (c *Config) S2K() *s2k.Config { - if c == nil { - return nil - } - // for backwards compatibility - if c != nil && c.S2KCount > 0 && c.S2KConfig == nil { - return &s2k.Config{ - S2KCount: c.S2KCount, - } - } - return c.S2KConfig -} - -func (c *Config) AEAD() *AEADConfig { - if c == nil { - return nil - } - return c.AEADConfig -} - -func (c *Config) SigningKey() uint64 { - if c == nil { - return 0 - } - return c.SigningKeyId -} - -func (c *Config) SigningUserId() string { - if c == nil { - return "" - } - return c.SigningIdentity -} - -func (c *Config) AllowUnauthenticatedMessages() bool { - if c == nil { - return false - } - return c.InsecureAllowUnauthenticatedMessages -} - -func (c *Config) KnownNotation(notationName string) bool { - if c == nil { - return false - } - return c.KnownNotations[notationName] -} - -func (c *Config) Notations() []*Notation { - if c == nil { - return nil - } - return c.SignatureNotations -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go deleted file mode 100644 index eeff2902c1..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/encrypted_key.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto" - "crypto/rsa" - "encoding/binary" - "io" - "math/big" - "strconv" - - "github.com/ProtonMail/go-crypto/openpgp/ecdh" - "github.com/ProtonMail/go-crypto/openpgp/elgamal" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/encoding" -) - -const encryptedKeyVersion = 3 - -// EncryptedKey represents a public-key encrypted session key. See RFC 4880, -// section 5.1. -type EncryptedKey struct { - KeyId uint64 - Algo PublicKeyAlgorithm - CipherFunc CipherFunction // only valid after a successful Decrypt for a v3 packet - Key []byte // only valid after a successful Decrypt - - encryptedMPI1, encryptedMPI2 encoding.Field -} - -func (e *EncryptedKey) parse(r io.Reader) (err error) { - var buf [10]byte - _, err = readFull(r, buf[:]) - if err != nil { - return - } - if buf[0] != encryptedKeyVersion { - return errors.UnsupportedError("unknown EncryptedKey version " + strconv.Itoa(int(buf[0]))) - } - e.KeyId = binary.BigEndian.Uint64(buf[1:9]) - e.Algo = PublicKeyAlgorithm(buf[9]) - switch e.Algo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - e.encryptedMPI1 = new(encoding.MPI) - if _, err = e.encryptedMPI1.ReadFrom(r); err != nil { - return - } - case PubKeyAlgoElGamal: - e.encryptedMPI1 = new(encoding.MPI) - if _, err = e.encryptedMPI1.ReadFrom(r); err != nil { - return - } - - e.encryptedMPI2 = new(encoding.MPI) - if _, err = e.encryptedMPI2.ReadFrom(r); err != nil { - return - } - case PubKeyAlgoECDH: - e.encryptedMPI1 = new(encoding.MPI) - if _, err = e.encryptedMPI1.ReadFrom(r); err != nil { - return - } - - e.encryptedMPI2 = new(encoding.OID) - if _, err = e.encryptedMPI2.ReadFrom(r); err != nil { - return - } - } - _, err = consumeAll(r) - return -} - -func checksumKeyMaterial(key []byte) uint16 { - var checksum uint16 - for _, v := range key { - checksum += uint16(v) - } - return checksum -} - -// Decrypt decrypts an encrypted session key with the given private key. The -// private key must have been decrypted first. -// If config is nil, sensible defaults will be used. -func (e *EncryptedKey) Decrypt(priv *PrivateKey, config *Config) error { - if e.KeyId != 0 && e.KeyId != priv.KeyId { - return errors.InvalidArgumentError("cannot decrypt encrypted session key for key id " + strconv.FormatUint(e.KeyId, 16) + " with private key id " + strconv.FormatUint(priv.KeyId, 16)) - } - if e.Algo != priv.PubKeyAlgo { - return errors.InvalidArgumentError("cannot decrypt encrypted session key of type " + strconv.Itoa(int(e.Algo)) + " with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo))) - } - if priv.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - - var err error - var b []byte - - // TODO(agl): use session key decryption routines here to avoid - // padding oracle attacks. - switch priv.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - // Supports both *rsa.PrivateKey and crypto.Decrypter - k := priv.PrivateKey.(crypto.Decrypter) - b, err = k.Decrypt(config.Random(), padToKeySize(k.Public().(*rsa.PublicKey), e.encryptedMPI1.Bytes()), nil) - case PubKeyAlgoElGamal: - c1 := new(big.Int).SetBytes(e.encryptedMPI1.Bytes()) - c2 := new(big.Int).SetBytes(e.encryptedMPI2.Bytes()) - b, err = elgamal.Decrypt(priv.PrivateKey.(*elgamal.PrivateKey), c1, c2) - case PubKeyAlgoECDH: - vsG := e.encryptedMPI1.Bytes() - m := e.encryptedMPI2.Bytes() - oid := priv.PublicKey.oid.EncodedBytes() - b, err = ecdh.Decrypt(priv.PrivateKey.(*ecdh.PrivateKey), vsG, m, oid, priv.PublicKey.Fingerprint[:]) - default: - err = errors.InvalidArgumentError("cannot decrypt encrypted session key with private key of type " + strconv.Itoa(int(priv.PubKeyAlgo))) - } - - if err != nil { - return err - } - - e.CipherFunc = CipherFunction(b[0]) - if !e.CipherFunc.IsSupported() { - return errors.UnsupportedError("unsupported encryption function") - } - - e.Key = b[1 : len(b)-2] - expectedChecksum := uint16(b[len(b)-2])<<8 | uint16(b[len(b)-1]) - checksum := checksumKeyMaterial(e.Key) - if checksum != expectedChecksum { - return errors.StructuralError("EncryptedKey checksum incorrect") - } - - return nil -} - -// Serialize writes the encrypted key packet, e, to w. -func (e *EncryptedKey) Serialize(w io.Writer) error { - var mpiLen int - switch e.Algo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - mpiLen = int(e.encryptedMPI1.EncodedLength()) - case PubKeyAlgoElGamal: - mpiLen = int(e.encryptedMPI1.EncodedLength()) + int(e.encryptedMPI2.EncodedLength()) - case PubKeyAlgoECDH: - mpiLen = int(e.encryptedMPI1.EncodedLength()) + int(e.encryptedMPI2.EncodedLength()) - default: - return errors.InvalidArgumentError("don't know how to serialize encrypted key type " + strconv.Itoa(int(e.Algo))) - } - - err := serializeHeader(w, packetTypeEncryptedKey, 1 /* version */ +8 /* key id */ +1 /* algo */ +mpiLen) - if err != nil { - return err - } - - w.Write([]byte{encryptedKeyVersion}) - binary.Write(w, binary.BigEndian, e.KeyId) - w.Write([]byte{byte(e.Algo)}) - - switch e.Algo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - _, err := w.Write(e.encryptedMPI1.EncodedBytes()) - return err - case PubKeyAlgoElGamal: - if _, err := w.Write(e.encryptedMPI1.EncodedBytes()); err != nil { - return err - } - _, err := w.Write(e.encryptedMPI2.EncodedBytes()) - return err - case PubKeyAlgoECDH: - if _, err := w.Write(e.encryptedMPI1.EncodedBytes()); err != nil { - return err - } - _, err := w.Write(e.encryptedMPI2.EncodedBytes()) - return err - default: - panic("internal error") - } -} - -// SerializeEncryptedKey serializes an encrypted key packet to w that contains -// key, encrypted to pub. -// If config is nil, sensible defaults will be used. -func SerializeEncryptedKey(w io.Writer, pub *PublicKey, cipherFunc CipherFunction, key []byte, config *Config) error { - var buf [10]byte - buf[0] = encryptedKeyVersion - binary.BigEndian.PutUint64(buf[1:9], pub.KeyId) - buf[9] = byte(pub.PubKeyAlgo) - - keyBlock := make([]byte, 1 /* cipher type */ +len(key)+2 /* checksum */) - keyBlock[0] = byte(cipherFunc) - copy(keyBlock[1:], key) - checksum := checksumKeyMaterial(key) - keyBlock[1+len(key)] = byte(checksum >> 8) - keyBlock[1+len(key)+1] = byte(checksum) - - switch pub.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly: - return serializeEncryptedKeyRSA(w, config.Random(), buf, pub.PublicKey.(*rsa.PublicKey), keyBlock) - case PubKeyAlgoElGamal: - return serializeEncryptedKeyElGamal(w, config.Random(), buf, pub.PublicKey.(*elgamal.PublicKey), keyBlock) - case PubKeyAlgoECDH: - return serializeEncryptedKeyECDH(w, config.Random(), buf, pub.PublicKey.(*ecdh.PublicKey), keyBlock, pub.oid, pub.Fingerprint) - case PubKeyAlgoDSA, PubKeyAlgoRSASignOnly: - return errors.InvalidArgumentError("cannot encrypt to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo))) - } - - return errors.UnsupportedError("encrypting a key to public key of type " + strconv.Itoa(int(pub.PubKeyAlgo))) -} - -func serializeEncryptedKeyRSA(w io.Writer, rand io.Reader, header [10]byte, pub *rsa.PublicKey, keyBlock []byte) error { - cipherText, err := rsa.EncryptPKCS1v15(rand, pub, keyBlock) - if err != nil { - return errors.InvalidArgumentError("RSA encryption failed: " + err.Error()) - } - - cipherMPI := encoding.NewMPI(cipherText) - packetLen := 10 /* header length */ + int(cipherMPI.EncodedLength()) - - err = serializeHeader(w, packetTypeEncryptedKey, packetLen) - if err != nil { - return err - } - _, err = w.Write(header[:]) - if err != nil { - return err - } - _, err = w.Write(cipherMPI.EncodedBytes()) - return err -} - -func serializeEncryptedKeyElGamal(w io.Writer, rand io.Reader, header [10]byte, pub *elgamal.PublicKey, keyBlock []byte) error { - c1, c2, err := elgamal.Encrypt(rand, pub, keyBlock) - if err != nil { - return errors.InvalidArgumentError("ElGamal encryption failed: " + err.Error()) - } - - packetLen := 10 /* header length */ - packetLen += 2 /* mpi size */ + (c1.BitLen()+7)/8 - packetLen += 2 /* mpi size */ + (c2.BitLen()+7)/8 - - err = serializeHeader(w, packetTypeEncryptedKey, packetLen) - if err != nil { - return err - } - _, err = w.Write(header[:]) - if err != nil { - return err - } - if _, err = w.Write(new(encoding.MPI).SetBig(c1).EncodedBytes()); err != nil { - return err - } - _, err = w.Write(new(encoding.MPI).SetBig(c2).EncodedBytes()) - return err -} - -func serializeEncryptedKeyECDH(w io.Writer, rand io.Reader, header [10]byte, pub *ecdh.PublicKey, keyBlock []byte, oid encoding.Field, fingerprint []byte) error { - vsG, c, err := ecdh.Encrypt(rand, pub, keyBlock, oid.EncodedBytes(), fingerprint) - if err != nil { - return errors.InvalidArgumentError("ECDH encryption failed: " + err.Error()) - } - - g := encoding.NewMPI(vsG) - m := encoding.NewOID(c) - - packetLen := 10 /* header length */ - packetLen += int(g.EncodedLength()) + int(m.EncodedLength()) - - err = serializeHeader(w, packetTypeEncryptedKey, packetLen) - if err != nil { - return err - } - - _, err = w.Write(header[:]) - if err != nil { - return err - } - if _, err = w.Write(g.EncodedBytes()); err != nil { - return err - } - _, err = w.Write(m.EncodedBytes()) - return err -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go deleted file mode 100644 index 4be987609b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/literal.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "encoding/binary" - "io" -) - -// LiteralData represents an encrypted file. See RFC 4880, section 5.9. -type LiteralData struct { - Format uint8 - IsBinary bool - FileName string - Time uint32 // Unix epoch time. Either creation time or modification time. 0 means undefined. - Body io.Reader -} - -// ForEyesOnly returns whether the contents of the LiteralData have been marked -// as especially sensitive. -func (l *LiteralData) ForEyesOnly() bool { - return l.FileName == "_CONSOLE" -} - -func (l *LiteralData) parse(r io.Reader) (err error) { - var buf [256]byte - - _, err = readFull(r, buf[:2]) - if err != nil { - return - } - - l.Format = buf[0] - l.IsBinary = l.Format == 'b' - fileNameLen := int(buf[1]) - - _, err = readFull(r, buf[:fileNameLen]) - if err != nil { - return - } - - l.FileName = string(buf[:fileNameLen]) - - _, err = readFull(r, buf[:4]) - if err != nil { - return - } - - l.Time = binary.BigEndian.Uint32(buf[:4]) - l.Body = r - return -} - -// SerializeLiteral serializes a literal data packet to w and returns a -// WriteCloser to which the data itself can be written and which MUST be closed -// on completion. The fileName is truncated to 255 bytes. -func SerializeLiteral(w io.WriteCloser, isBinary bool, fileName string, time uint32) (plaintext io.WriteCloser, err error) { - var buf [4]byte - buf[0] = 't' - if isBinary { - buf[0] = 'b' - } - if len(fileName) > 255 { - fileName = fileName[:255] - } - buf[1] = byte(len(fileName)) - - inner, err := serializeStreamHeader(w, packetTypeLiteralData) - if err != nil { - return - } - - _, err = inner.Write(buf[:2]) - if err != nil { - return - } - _, err = inner.Write([]byte(fileName)) - if err != nil { - return - } - binary.BigEndian.PutUint32(buf[:], time) - _, err = inner.Write(buf[:]) - if err != nil { - return - } - - plaintext = inner - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go deleted file mode 100644 index 2c3e3f50b2..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/notation.go +++ /dev/null @@ -1,29 +0,0 @@ -package packet - -// Notation type represents a Notation Data subpacket -// see https://tools.ietf.org/html/rfc4880#section-5.2.3.16 -type Notation struct { - Name string - Value []byte - IsCritical bool - IsHumanReadable bool -} - -func (notation *Notation) getData() []byte { - nameData := []byte(notation.Name) - nameLen := len(nameData) - valueLen := len(notation.Value) - - data := make([]byte, 8+nameLen+valueLen) - if notation.IsHumanReadable { - data[0] = 0x80 - } - - data[4] = byte(nameLen >> 8) - data[5] = byte(nameLen) - data[6] = byte(valueLen >> 8) - data[7] = byte(valueLen) - copy(data[8:8+nameLen], nameData) - copy(data[8+nameLen:], notation.Value) - return data -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go deleted file mode 100644 index 4f26d0a00b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/ocfb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// OpenPGP CFB Mode. http://tools.ietf.org/html/rfc4880#section-13.9 - -package packet - -import ( - "crypto/cipher" -) - -type ocfbEncrypter struct { - b cipher.Block - fre []byte - outUsed int -} - -// An OCFBResyncOption determines if the "resynchronization step" of OCFB is -// performed. -type OCFBResyncOption bool - -const ( - OCFBResync OCFBResyncOption = true - OCFBNoResync OCFBResyncOption = false -) - -// NewOCFBEncrypter returns a cipher.Stream which encrypts data with OpenPGP's -// cipher feedback mode using the given cipher.Block, and an initial amount of -// ciphertext. randData must be random bytes and be the same length as the -// cipher.Block's block size. Resync determines if the "resynchronization step" -// from RFC 4880, 13.9 step 7 is performed. Different parts of OpenPGP vary on -// this point. -func NewOCFBEncrypter(block cipher.Block, randData []byte, resync OCFBResyncOption) (cipher.Stream, []byte) { - blockSize := block.BlockSize() - if len(randData) != blockSize { - return nil, nil - } - - x := &ocfbEncrypter{ - b: block, - fre: make([]byte, blockSize), - outUsed: 0, - } - prefix := make([]byte, blockSize+2) - - block.Encrypt(x.fre, x.fre) - for i := 0; i < blockSize; i++ { - prefix[i] = randData[i] ^ x.fre[i] - } - - block.Encrypt(x.fre, prefix[:blockSize]) - prefix[blockSize] = x.fre[0] ^ randData[blockSize-2] - prefix[blockSize+1] = x.fre[1] ^ randData[blockSize-1] - - if resync { - block.Encrypt(x.fre, prefix[2:]) - } else { - x.fre[0] = prefix[blockSize] - x.fre[1] = prefix[blockSize+1] - x.outUsed = 2 - } - return x, prefix -} - -func (x *ocfbEncrypter) XORKeyStream(dst, src []byte) { - for i := 0; i < len(src); i++ { - if x.outUsed == len(x.fre) { - x.b.Encrypt(x.fre, x.fre) - x.outUsed = 0 - } - - x.fre[x.outUsed] ^= src[i] - dst[i] = x.fre[x.outUsed] - x.outUsed++ - } -} - -type ocfbDecrypter struct { - b cipher.Block - fre []byte - outUsed int -} - -// NewOCFBDecrypter returns a cipher.Stream which decrypts data with OpenPGP's -// cipher feedback mode using the given cipher.Block. Prefix must be the first -// blockSize + 2 bytes of the ciphertext, where blockSize is the cipher.Block's -// block size. On successful exit, blockSize+2 bytes of decrypted data are written into -// prefix. Resync determines if the "resynchronization step" from RFC 4880, -// 13.9 step 7 is performed. Different parts of OpenPGP vary on this point. -func NewOCFBDecrypter(block cipher.Block, prefix []byte, resync OCFBResyncOption) cipher.Stream { - blockSize := block.BlockSize() - if len(prefix) != blockSize+2 { - return nil - } - - x := &ocfbDecrypter{ - b: block, - fre: make([]byte, blockSize), - outUsed: 0, - } - prefixCopy := make([]byte, len(prefix)) - copy(prefixCopy, prefix) - - block.Encrypt(x.fre, x.fre) - for i := 0; i < blockSize; i++ { - prefixCopy[i] ^= x.fre[i] - } - - block.Encrypt(x.fre, prefix[:blockSize]) - prefixCopy[blockSize] ^= x.fre[0] - prefixCopy[blockSize+1] ^= x.fre[1] - - if resync { - block.Encrypt(x.fre, prefix[2:]) - } else { - x.fre[0] = prefix[blockSize] - x.fre[1] = prefix[blockSize+1] - x.outUsed = 2 - } - copy(prefix, prefixCopy) - return x -} - -func (x *ocfbDecrypter) XORKeyStream(dst, src []byte) { - for i := 0; i < len(src); i++ { - if x.outUsed == len(x.fre) { - x.b.Encrypt(x.fre, x.fre) - x.outUsed = 0 - } - - c := src[i] - dst[i] = x.fre[x.outUsed] ^ src[i] - x.fre[x.outUsed] = c - x.outUsed++ - } -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go deleted file mode 100644 index 033fb2d7e8..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/one_pass_signature.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto" - "encoding/binary" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "io" - "strconv" -) - -// OnePassSignature represents a one-pass signature packet. See RFC 4880, -// section 5.4. -type OnePassSignature struct { - SigType SignatureType - Hash crypto.Hash - PubKeyAlgo PublicKeyAlgorithm - KeyId uint64 - IsLast bool -} - -const onePassSignatureVersion = 3 - -func (ops *OnePassSignature) parse(r io.Reader) (err error) { - var buf [13]byte - - _, err = readFull(r, buf[:]) - if err != nil { - return - } - if buf[0] != onePassSignatureVersion { - err = errors.UnsupportedError("one-pass-signature packet version " + strconv.Itoa(int(buf[0]))) - } - - var ok bool - ops.Hash, ok = algorithm.HashIdToHashWithSha1(buf[2]) - if !ok { - return errors.UnsupportedError("hash function: " + strconv.Itoa(int(buf[2]))) - } - - ops.SigType = SignatureType(buf[1]) - ops.PubKeyAlgo = PublicKeyAlgorithm(buf[3]) - ops.KeyId = binary.BigEndian.Uint64(buf[4:12]) - ops.IsLast = buf[12] != 0 - return -} - -// Serialize marshals the given OnePassSignature to w. -func (ops *OnePassSignature) Serialize(w io.Writer) error { - var buf [13]byte - buf[0] = onePassSignatureVersion - buf[1] = uint8(ops.SigType) - var ok bool - buf[2], ok = algorithm.HashToHashIdWithSha1(ops.Hash) - if !ok { - return errors.UnsupportedError("hash type: " + strconv.Itoa(int(ops.Hash))) - } - buf[3] = uint8(ops.PubKeyAlgo) - binary.BigEndian.PutUint64(buf[4:12], ops.KeyId) - if ops.IsLast { - buf[12] = 1 - } - - if err := serializeHeader(w, packetTypeOnePassSignature, len(buf)); err != nil { - return err - } - _, err := w.Write(buf[:]) - return err -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go deleted file mode 100644 index 4f8204079f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/opaque.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "io" - "io/ioutil" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// OpaquePacket represents an OpenPGP packet as raw, unparsed data. This is -// useful for splitting and storing the original packet contents separately, -// handling unsupported packet types or accessing parts of the packet not yet -// implemented by this package. -type OpaquePacket struct { - // Packet type - Tag uint8 - // Reason why the packet was parsed opaquely - Reason error - // Binary contents of the packet data - Contents []byte -} - -func (op *OpaquePacket) parse(r io.Reader) (err error) { - op.Contents, err = ioutil.ReadAll(r) - return -} - -// Serialize marshals the packet to a writer in its original form, including -// the packet header. -func (op *OpaquePacket) Serialize(w io.Writer) (err error) { - err = serializeHeader(w, packetType(op.Tag), len(op.Contents)) - if err == nil { - _, err = w.Write(op.Contents) - } - return -} - -// Parse attempts to parse the opaque contents into a structure supported by -// this package. If the packet is not known then the result will be another -// OpaquePacket. -func (op *OpaquePacket) Parse() (p Packet, err error) { - hdr := bytes.NewBuffer(nil) - err = serializeHeader(hdr, packetType(op.Tag), len(op.Contents)) - if err != nil { - op.Reason = err - return op, err - } - p, err = Read(io.MultiReader(hdr, bytes.NewBuffer(op.Contents))) - if err != nil { - op.Reason = err - p = op - } - return -} - -// OpaqueReader reads OpaquePackets from an io.Reader. -type OpaqueReader struct { - r io.Reader -} - -func NewOpaqueReader(r io.Reader) *OpaqueReader { - return &OpaqueReader{r: r} -} - -// Read the next OpaquePacket. -func (or *OpaqueReader) Next() (op *OpaquePacket, err error) { - tag, _, contents, err := readHeader(or.r) - if err != nil { - return - } - op = &OpaquePacket{Tag: uint8(tag), Reason: err} - err = op.parse(contents) - if err != nil { - consumeAll(contents) - } - return -} - -// OpaqueSubpacket represents an unparsed OpenPGP subpacket, -// as found in signature and user attribute packets. -type OpaqueSubpacket struct { - SubType uint8 - EncodedLength []byte // Store the original encoded length for signature verifications. - Contents []byte -} - -// OpaqueSubpackets extracts opaque, unparsed OpenPGP subpackets from -// their byte representation. -func OpaqueSubpackets(contents []byte) (result []*OpaqueSubpacket, err error) { - var ( - subHeaderLen int - subPacket *OpaqueSubpacket - ) - for len(contents) > 0 { - subHeaderLen, subPacket, err = nextSubpacket(contents) - if err != nil { - break - } - result = append(result, subPacket) - contents = contents[subHeaderLen+len(subPacket.Contents):] - } - return -} - -func nextSubpacket(contents []byte) (subHeaderLen int, subPacket *OpaqueSubpacket, err error) { - // RFC 4880, section 5.2.3.1 - var subLen uint32 - var encodedLength []byte - if len(contents) < 1 { - goto Truncated - } - subPacket = &OpaqueSubpacket{} - switch { - case contents[0] < 192: - subHeaderLen = 2 // 1 length byte, 1 subtype byte - if len(contents) < subHeaderLen { - goto Truncated - } - encodedLength = contents[0:1] - subLen = uint32(contents[0]) - contents = contents[1:] - case contents[0] < 255: - subHeaderLen = 3 // 2 length bytes, 1 subtype - if len(contents) < subHeaderLen { - goto Truncated - } - encodedLength = contents[0:2] - subLen = uint32(contents[0]-192)<<8 + uint32(contents[1]) + 192 - contents = contents[2:] - default: - subHeaderLen = 6 // 5 length bytes, 1 subtype - if len(contents) < subHeaderLen { - goto Truncated - } - encodedLength = contents[0:5] - subLen = uint32(contents[1])<<24 | - uint32(contents[2])<<16 | - uint32(contents[3])<<8 | - uint32(contents[4]) - contents = contents[5:] - - } - if subLen > uint32(len(contents)) || subLen == 0 { - goto Truncated - } - subPacket.SubType = contents[0] - subPacket.EncodedLength = encodedLength - subPacket.Contents = contents[1:subLen] - return -Truncated: - err = errors.StructuralError("subpacket truncated") - return -} - -func (osp *OpaqueSubpacket) Serialize(w io.Writer) (err error) { - buf := make([]byte, 6) - copy(buf, osp.EncodedLength) - n := len(osp.EncodedLength) - - buf[n] = osp.SubType - if _, err = w.Write(buf[:n+1]); err != nil { - return - } - _, err = w.Write(osp.Contents) - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go deleted file mode 100644 index 4d86a7da82..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/packet.go +++ /dev/null @@ -1,551 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package packet implements parsing and serialization of OpenPGP packets, as -// specified in RFC 4880. -package packet // import "github.com/ProtonMail/go-crypto/openpgp/packet" - -import ( - "bytes" - "crypto/cipher" - "crypto/rsa" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" -) - -// readFull is the same as io.ReadFull except that reading zero bytes returns -// ErrUnexpectedEOF rather than EOF. -func readFull(r io.Reader, buf []byte) (n int, err error) { - n, err = io.ReadFull(r, buf) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return -} - -// readLength reads an OpenPGP length from r. See RFC 4880, section 4.2.2. -func readLength(r io.Reader) (length int64, isPartial bool, err error) { - var buf [4]byte - _, err = readFull(r, buf[:1]) - if err != nil { - return - } - switch { - case buf[0] < 192: - length = int64(buf[0]) - case buf[0] < 224: - length = int64(buf[0]-192) << 8 - _, err = readFull(r, buf[0:1]) - if err != nil { - return - } - length += int64(buf[0]) + 192 - case buf[0] < 255: - length = int64(1) << (buf[0] & 0x1f) - isPartial = true - default: - _, err = readFull(r, buf[0:4]) - if err != nil { - return - } - length = int64(buf[0])<<24 | - int64(buf[1])<<16 | - int64(buf[2])<<8 | - int64(buf[3]) - } - return -} - -// partialLengthReader wraps an io.Reader and handles OpenPGP partial lengths. -// The continuation lengths are parsed and removed from the stream and EOF is -// returned at the end of the packet. See RFC 4880, section 4.2.2.4. -type partialLengthReader struct { - r io.Reader - remaining int64 - isPartial bool -} - -func (r *partialLengthReader) Read(p []byte) (n int, err error) { - for r.remaining == 0 { - if !r.isPartial { - return 0, io.EOF - } - r.remaining, r.isPartial, err = readLength(r.r) - if err != nil { - return 0, err - } - } - - toRead := int64(len(p)) - if toRead > r.remaining { - toRead = r.remaining - } - - n, err = r.r.Read(p[:int(toRead)]) - r.remaining -= int64(n) - if n < int(toRead) && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return -} - -// partialLengthWriter writes a stream of data using OpenPGP partial lengths. -// See RFC 4880, section 4.2.2.4. -type partialLengthWriter struct { - w io.WriteCloser - buf bytes.Buffer - lengthByte [1]byte -} - -func (w *partialLengthWriter) Write(p []byte) (n int, err error) { - bufLen := w.buf.Len() - if bufLen > 512 { - for power := uint(30); ; power-- { - l := 1 << power - if bufLen >= l { - w.lengthByte[0] = 224 + uint8(power) - _, err = w.w.Write(w.lengthByte[:]) - if err != nil { - return - } - var m int - m, err = w.w.Write(w.buf.Next(l)) - if err != nil { - return - } - if m != l { - return 0, io.ErrShortWrite - } - break - } - } - } - return w.buf.Write(p) -} - -func (w *partialLengthWriter) Close() (err error) { - len := w.buf.Len() - err = serializeLength(w.w, len) - if err != nil { - return err - } - _, err = w.buf.WriteTo(w.w) - if err != nil { - return err - } - return w.w.Close() -} - -// A spanReader is an io.LimitReader, but it returns ErrUnexpectedEOF if the -// underlying Reader returns EOF before the limit has been reached. -type spanReader struct { - r io.Reader - n int64 -} - -func (l *spanReader) Read(p []byte) (n int, err error) { - if l.n <= 0 { - return 0, io.EOF - } - if int64(len(p)) > l.n { - p = p[0:l.n] - } - n, err = l.r.Read(p) - l.n -= int64(n) - if l.n > 0 && err == io.EOF { - err = io.ErrUnexpectedEOF - } - return -} - -// readHeader parses a packet header and returns an io.Reader which will return -// the contents of the packet. See RFC 4880, section 4.2. -func readHeader(r io.Reader) (tag packetType, length int64, contents io.Reader, err error) { - var buf [4]byte - _, err = io.ReadFull(r, buf[:1]) - if err != nil { - return - } - if buf[0]&0x80 == 0 { - err = errors.StructuralError("tag byte does not have MSB set") - return - } - if buf[0]&0x40 == 0 { - // Old format packet - tag = packetType((buf[0] & 0x3f) >> 2) - lengthType := buf[0] & 3 - if lengthType == 3 { - length = -1 - contents = r - return - } - lengthBytes := 1 << lengthType - _, err = readFull(r, buf[0:lengthBytes]) - if err != nil { - return - } - for i := 0; i < lengthBytes; i++ { - length <<= 8 - length |= int64(buf[i]) - } - contents = &spanReader{r, length} - return - } - - // New format packet - tag = packetType(buf[0] & 0x3f) - length, isPartial, err := readLength(r) - if err != nil { - return - } - if isPartial { - contents = &partialLengthReader{ - remaining: length, - isPartial: true, - r: r, - } - length = -1 - } else { - contents = &spanReader{r, length} - } - return -} - -// serializeHeader writes an OpenPGP packet header to w. See RFC 4880, section -// 4.2. -func serializeHeader(w io.Writer, ptype packetType, length int) (err error) { - err = serializeType(w, ptype) - if err != nil { - return - } - return serializeLength(w, length) -} - -// serializeType writes an OpenPGP packet type to w. See RFC 4880, section -// 4.2. -func serializeType(w io.Writer, ptype packetType) (err error) { - var buf [1]byte - buf[0] = 0x80 | 0x40 | byte(ptype) - _, err = w.Write(buf[:]) - return -} - -// serializeLength writes an OpenPGP packet length to w. See RFC 4880, section -// 4.2.2. -func serializeLength(w io.Writer, length int) (err error) { - var buf [5]byte - var n int - - if length < 192 { - buf[0] = byte(length) - n = 1 - } else if length < 8384 { - length -= 192 - buf[0] = 192 + byte(length>>8) - buf[1] = byte(length) - n = 2 - } else { - buf[0] = 255 - buf[1] = byte(length >> 24) - buf[2] = byte(length >> 16) - buf[3] = byte(length >> 8) - buf[4] = byte(length) - n = 5 - } - - _, err = w.Write(buf[:n]) - return -} - -// serializeStreamHeader writes an OpenPGP packet header to w where the -// length of the packet is unknown. It returns a io.WriteCloser which can be -// used to write the contents of the packet. See RFC 4880, section 4.2. -func serializeStreamHeader(w io.WriteCloser, ptype packetType) (out io.WriteCloser, err error) { - err = serializeType(w, ptype) - if err != nil { - return - } - out = &partialLengthWriter{w: w} - return -} - -// Packet represents an OpenPGP packet. Users are expected to try casting -// instances of this interface to specific packet types. -type Packet interface { - parse(io.Reader) error -} - -// consumeAll reads from the given Reader until error, returning the number of -// bytes read. -func consumeAll(r io.Reader) (n int64, err error) { - var m int - var buf [1024]byte - - for { - m, err = r.Read(buf[:]) - n += int64(m) - if err == io.EOF { - err = nil - return - } - if err != nil { - return - } - } -} - -// packetType represents the numeric ids of the different OpenPGP packet types. See -// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-2 -type packetType uint8 - -const ( - packetTypeEncryptedKey packetType = 1 - packetTypeSignature packetType = 2 - packetTypeSymmetricKeyEncrypted packetType = 3 - packetTypeOnePassSignature packetType = 4 - packetTypePrivateKey packetType = 5 - packetTypePublicKey packetType = 6 - packetTypePrivateSubkey packetType = 7 - packetTypeCompressed packetType = 8 - packetTypeSymmetricallyEncrypted packetType = 9 - packetTypeLiteralData packetType = 11 - packetTypeUserId packetType = 13 - packetTypePublicSubkey packetType = 14 - packetTypeUserAttribute packetType = 17 - packetTypeSymmetricallyEncryptedIntegrityProtected packetType = 18 - packetTypeAEADEncrypted packetType = 20 -) - -// EncryptedDataPacket holds encrypted data. It is currently implemented by -// SymmetricallyEncrypted and AEADEncrypted. -type EncryptedDataPacket interface { - Decrypt(CipherFunction, []byte) (io.ReadCloser, error) -} - -// Read reads a single OpenPGP packet from the given io.Reader. If there is an -// error parsing a packet, the whole packet is consumed from the input. -func Read(r io.Reader) (p Packet, err error) { - tag, _, contents, err := readHeader(r) - if err != nil { - return - } - - switch tag { - case packetTypeEncryptedKey: - p = new(EncryptedKey) - case packetTypeSignature: - p = new(Signature) - case packetTypeSymmetricKeyEncrypted: - p = new(SymmetricKeyEncrypted) - case packetTypeOnePassSignature: - p = new(OnePassSignature) - case packetTypePrivateKey, packetTypePrivateSubkey: - pk := new(PrivateKey) - if tag == packetTypePrivateSubkey { - pk.IsSubkey = true - } - p = pk - case packetTypePublicKey, packetTypePublicSubkey: - isSubkey := tag == packetTypePublicSubkey - p = &PublicKey{IsSubkey: isSubkey} - case packetTypeCompressed: - p = new(Compressed) - case packetTypeSymmetricallyEncrypted: - p = new(SymmetricallyEncrypted) - case packetTypeLiteralData: - p = new(LiteralData) - case packetTypeUserId: - p = new(UserId) - case packetTypeUserAttribute: - p = new(UserAttribute) - case packetTypeSymmetricallyEncryptedIntegrityProtected: - se := new(SymmetricallyEncrypted) - se.IntegrityProtected = true - p = se - case packetTypeAEADEncrypted: - p = new(AEADEncrypted) - default: - err = errors.UnknownPacketTypeError(tag) - } - if p != nil { - err = p.parse(contents) - } - if err != nil { - consumeAll(contents) - } - return -} - -// SignatureType represents the different semantic meanings of an OpenPGP -// signature. See RFC 4880, section 5.2.1. -type SignatureType uint8 - -const ( - SigTypeBinary SignatureType = 0x00 - SigTypeText = 0x01 - SigTypeGenericCert = 0x10 - SigTypePersonaCert = 0x11 - SigTypeCasualCert = 0x12 - SigTypePositiveCert = 0x13 - SigTypeSubkeyBinding = 0x18 - SigTypePrimaryKeyBinding = 0x19 - SigTypeDirectSignature = 0x1F - SigTypeKeyRevocation = 0x20 - SigTypeSubkeyRevocation = 0x28 - SigTypeCertificationRevocation = 0x30 -) - -// PublicKeyAlgorithm represents the different public key system specified for -// OpenPGP. See -// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-12 -type PublicKeyAlgorithm uint8 - -const ( - PubKeyAlgoRSA PublicKeyAlgorithm = 1 - PubKeyAlgoElGamal PublicKeyAlgorithm = 16 - PubKeyAlgoDSA PublicKeyAlgorithm = 17 - // RFC 6637, Section 5. - PubKeyAlgoECDH PublicKeyAlgorithm = 18 - PubKeyAlgoECDSA PublicKeyAlgorithm = 19 - // https://www.ietf.org/archive/id/draft-koch-eddsa-for-openpgp-04.txt - PubKeyAlgoEdDSA PublicKeyAlgorithm = 22 - - // Deprecated in RFC 4880, Section 13.5. Use key flags instead. - PubKeyAlgoRSAEncryptOnly PublicKeyAlgorithm = 2 - PubKeyAlgoRSASignOnly PublicKeyAlgorithm = 3 -) - -// CanEncrypt returns true if it's possible to encrypt a message to a public -// key of the given type. -func (pka PublicKeyAlgorithm) CanEncrypt() bool { - switch pka { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoElGamal, PubKeyAlgoECDH: - return true - } - return false -} - -// CanSign returns true if it's possible for a public key of the given type to -// sign a message. -func (pka PublicKeyAlgorithm) CanSign() bool { - switch pka { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA: - return true - } - return false -} - -// CipherFunction represents the different block ciphers specified for OpenPGP. See -// http://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtml#pgp-parameters-13 -type CipherFunction algorithm.CipherFunction - -const ( - Cipher3DES CipherFunction = 2 - CipherCAST5 CipherFunction = 3 - CipherAES128 CipherFunction = 7 - CipherAES192 CipherFunction = 8 - CipherAES256 CipherFunction = 9 -) - -// KeySize returns the key size, in bytes, of cipher. -func (cipher CipherFunction) KeySize() int { - return algorithm.CipherFunction(cipher).KeySize() -} - -// IsSupported returns true if the cipher is supported from the library -func (cipher CipherFunction) IsSupported() bool { - return algorithm.CipherFunction(cipher).KeySize() > 0 -} - -// blockSize returns the block size, in bytes, of cipher. -func (cipher CipherFunction) blockSize() int { - return algorithm.CipherFunction(cipher).BlockSize() -} - -// new returns a fresh instance of the given cipher. -func (cipher CipherFunction) new(key []byte) (block cipher.Block) { - return algorithm.CipherFunction(cipher).New(key) -} - -// padToKeySize left-pads a MPI with zeroes to match the length of the -// specified RSA public. -func padToKeySize(pub *rsa.PublicKey, b []byte) []byte { - k := (pub.N.BitLen() + 7) / 8 - if len(b) >= k { - return b - } - bb := make([]byte, k) - copy(bb[len(bb)-len(b):], b) - return bb -} - -// CompressionAlgo Represents the different compression algorithms -// supported by OpenPGP (except for BZIP2, which is not currently -// supported). See Section 9.3 of RFC 4880. -type CompressionAlgo uint8 - -const ( - CompressionNone CompressionAlgo = 0 - CompressionZIP CompressionAlgo = 1 - CompressionZLIB CompressionAlgo = 2 -) - -// AEADMode represents the different Authenticated Encryption with Associated -// Data specified for OpenPGP. -// See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.6 -type AEADMode algorithm.AEADMode - -const ( - AEADModeEAX AEADMode = 1 - AEADModeOCB AEADMode = 2 - AEADModeGCM AEADMode = 3 -) - -func (mode AEADMode) IvLength() int { - return algorithm.AEADMode(mode).NonceLength() -} - -func (mode AEADMode) TagLength() int { - return algorithm.AEADMode(mode).TagLength() -} - -// new returns a fresh instance of the given mode. -func (mode AEADMode) new(block cipher.Block) cipher.AEAD { - return algorithm.AEADMode(mode).New(block) -} - -// ReasonForRevocation represents a revocation reason code as per RFC4880 -// section 5.2.3.23. -type ReasonForRevocation uint8 - -const ( - NoReason ReasonForRevocation = 0 - KeySuperseded ReasonForRevocation = 1 - KeyCompromised ReasonForRevocation = 2 - KeyRetired ReasonForRevocation = 3 -) - -// Curve is a mapping to supported ECC curves for key generation. -// See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-06.html#name-curve-specific-wire-formats -type Curve string - -const ( - Curve25519 Curve = "Curve25519" - Curve448 Curve = "Curve448" - CurveNistP256 Curve = "P256" - CurveNistP384 Curve = "P384" - CurveNistP521 Curve = "P521" - CurveSecP256k1 Curve = "SecP256k1" - CurveBrainpoolP256 Curve = "BrainpoolP256" - CurveBrainpoolP384 Curve = "BrainpoolP384" - CurveBrainpoolP512 Curve = "BrainpoolP512" -) - -// TrustLevel represents a trust level per RFC4880 5.2.3.13 -type TrustLevel uint8 - -// TrustAmount represents a trust amount per RFC4880 5.2.3.13 -type TrustAmount uint8 diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go deleted file mode 100644 index 2fc4386437..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key.go +++ /dev/null @@ -1,837 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "crypto" - "crypto/cipher" - "crypto/dsa" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "io" - "io/ioutil" - "math/big" - "strconv" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/ecdh" - "github.com/ProtonMail/go-crypto/openpgp/ecdsa" - "github.com/ProtonMail/go-crypto/openpgp/eddsa" - "github.com/ProtonMail/go-crypto/openpgp/elgamal" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/encoding" - "github.com/ProtonMail/go-crypto/openpgp/s2k" -) - -// PrivateKey represents a possibly encrypted private key. See RFC 4880, -// section 5.5.3. -type PrivateKey struct { - PublicKey - Encrypted bool // if true then the private key is unavailable until Decrypt has been called. - encryptedData []byte - cipher CipherFunction - s2k func(out, in []byte) - // An *{rsa|dsa|elgamal|ecdh|ecdsa|ed25519}.PrivateKey or - // crypto.Signer/crypto.Decrypter (Decryptor RSA only). - PrivateKey interface{} - sha1Checksum bool - iv []byte - - // Type of encryption of the S2K packet - // Allowed values are 0 (Not encrypted), 254 (SHA1), or - // 255 (2-byte checksum) - s2kType S2KType - // Full parameters of the S2K packet - s2kParams *s2k.Params -} - -// S2KType s2k packet type -type S2KType uint8 - -const ( - // S2KNON unencrypt - S2KNON S2KType = 0 - // S2KSHA1 sha1 sum check - S2KSHA1 S2KType = 254 - // S2KCHECKSUM sum check - S2KCHECKSUM S2KType = 255 -) - -func NewRSAPrivateKey(creationTime time.Time, priv *rsa.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewRSAPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -func NewDSAPrivateKey(creationTime time.Time, priv *dsa.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewDSAPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -func NewElGamalPrivateKey(creationTime time.Time, priv *elgamal.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewElGamalPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -func NewECDSAPrivateKey(creationTime time.Time, priv *ecdsa.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewECDSAPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -func NewEdDSAPrivateKey(creationTime time.Time, priv *eddsa.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewEdDSAPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -func NewECDHPrivateKey(creationTime time.Time, priv *ecdh.PrivateKey) *PrivateKey { - pk := new(PrivateKey) - pk.PublicKey = *NewECDHPublicKey(creationTime, &priv.PublicKey) - pk.PrivateKey = priv - return pk -} - -// NewSignerPrivateKey creates a PrivateKey from a crypto.Signer that -// implements RSA, ECDSA or EdDSA. -func NewSignerPrivateKey(creationTime time.Time, signer interface{}) *PrivateKey { - pk := new(PrivateKey) - // In general, the public Keys should be used as pointers. We still - // type-switch on the values, for backwards-compatibility. - switch pubkey := signer.(type) { - case *rsa.PrivateKey: - pk.PublicKey = *NewRSAPublicKey(creationTime, &pubkey.PublicKey) - case rsa.PrivateKey: - pk.PublicKey = *NewRSAPublicKey(creationTime, &pubkey.PublicKey) - case *ecdsa.PrivateKey: - pk.PublicKey = *NewECDSAPublicKey(creationTime, &pubkey.PublicKey) - case ecdsa.PrivateKey: - pk.PublicKey = *NewECDSAPublicKey(creationTime, &pubkey.PublicKey) - case *eddsa.PrivateKey: - pk.PublicKey = *NewEdDSAPublicKey(creationTime, &pubkey.PublicKey) - case eddsa.PrivateKey: - pk.PublicKey = *NewEdDSAPublicKey(creationTime, &pubkey.PublicKey) - default: - panic("openpgp: unknown signer type in NewSignerPrivateKey") - } - pk.PrivateKey = signer - return pk -} - -// NewDecrypterPrivateKey creates a PrivateKey from a *{rsa|elgamal|ecdh}.PrivateKey. -func NewDecrypterPrivateKey(creationTime time.Time, decrypter interface{}) *PrivateKey { - pk := new(PrivateKey) - switch priv := decrypter.(type) { - case *rsa.PrivateKey: - pk.PublicKey = *NewRSAPublicKey(creationTime, &priv.PublicKey) - case *elgamal.PrivateKey: - pk.PublicKey = *NewElGamalPublicKey(creationTime, &priv.PublicKey) - case *ecdh.PrivateKey: - pk.PublicKey = *NewECDHPublicKey(creationTime, &priv.PublicKey) - default: - panic("openpgp: unknown decrypter type in NewDecrypterPrivateKey") - } - pk.PrivateKey = decrypter - return pk -} - -func (pk *PrivateKey) parse(r io.Reader) (err error) { - err = (&pk.PublicKey).parse(r) - if err != nil { - return - } - v5 := pk.PublicKey.Version == 5 - - var buf [1]byte - _, err = readFull(r, buf[:]) - if err != nil { - return - } - pk.s2kType = S2KType(buf[0]) - var optCount [1]byte - if v5 { - if _, err = readFull(r, optCount[:]); err != nil { - return - } - } - - switch pk.s2kType { - case S2KNON: - pk.s2k = nil - pk.Encrypted = false - case S2KSHA1, S2KCHECKSUM: - if v5 && pk.s2kType == S2KCHECKSUM { - return errors.StructuralError("wrong s2k identifier for version 5") - } - _, err = readFull(r, buf[:]) - if err != nil { - return - } - pk.cipher = CipherFunction(buf[0]) - if pk.cipher != 0 && !pk.cipher.IsSupported() { - return errors.UnsupportedError("unsupported cipher function in private key") - } - pk.s2kParams, err = s2k.ParseIntoParams(r) - if err != nil { - return - } - if pk.s2kParams.Dummy() { - return - } - pk.s2k, err = pk.s2kParams.Function() - if err != nil { - return - } - pk.Encrypted = true - if pk.s2kType == S2KSHA1 { - pk.sha1Checksum = true - } - default: - return errors.UnsupportedError("deprecated s2k function in private key") - } - - if pk.Encrypted { - blockSize := pk.cipher.blockSize() - if blockSize == 0 { - return errors.UnsupportedError("unsupported cipher in private key: " + strconv.Itoa(int(pk.cipher))) - } - pk.iv = make([]byte, blockSize) - _, err = readFull(r, pk.iv) - if err != nil { - return - } - } - - var privateKeyData []byte - if v5 { - var n [4]byte /* secret material four octet count */ - _, err = readFull(r, n[:]) - if err != nil { - return - } - count := uint32(uint32(n[0])<<24 | uint32(n[1])<<16 | uint32(n[2])<<8 | uint32(n[3])) - if !pk.Encrypted { - count = count + 2 /* two octet checksum */ - } - privateKeyData = make([]byte, count) - _, err = readFull(r, privateKeyData) - if err != nil { - return - } - } else { - privateKeyData, err = ioutil.ReadAll(r) - if err != nil { - return - } - } - if !pk.Encrypted { - if len(privateKeyData) < 2 { - return errors.StructuralError("truncated private key data") - } - var sum uint16 - for i := 0; i < len(privateKeyData)-2; i++ { - sum += uint16(privateKeyData[i]) - } - if privateKeyData[len(privateKeyData)-2] != uint8(sum>>8) || - privateKeyData[len(privateKeyData)-1] != uint8(sum) { - return errors.StructuralError("private key checksum failure") - } - privateKeyData = privateKeyData[:len(privateKeyData)-2] - return pk.parsePrivateKey(privateKeyData) - } - - pk.encryptedData = privateKeyData - return -} - -// Dummy returns true if the private key is a dummy key. This is a GNU extension. -func (pk *PrivateKey) Dummy() bool { - return pk.s2kParams.Dummy() -} - -func mod64kHash(d []byte) uint16 { - var h uint16 - for _, b := range d { - h += uint16(b) - } - return h -} - -func (pk *PrivateKey) Serialize(w io.Writer) (err error) { - contents := bytes.NewBuffer(nil) - err = pk.PublicKey.serializeWithoutHeaders(contents) - if err != nil { - return - } - if _, err = contents.Write([]byte{uint8(pk.s2kType)}); err != nil { - return - } - - optional := bytes.NewBuffer(nil) - if pk.Encrypted || pk.Dummy() { - optional.Write([]byte{uint8(pk.cipher)}) - if err := pk.s2kParams.Serialize(optional); err != nil { - return err - } - if pk.Encrypted { - optional.Write(pk.iv) - } - } - if pk.Version == 5 { - contents.Write([]byte{uint8(optional.Len())}) - } - io.Copy(contents, optional) - - if !pk.Dummy() { - l := 0 - var priv []byte - if !pk.Encrypted { - buf := bytes.NewBuffer(nil) - err = pk.serializePrivateKey(buf) - if err != nil { - return err - } - l = buf.Len() - checksum := mod64kHash(buf.Bytes()) - buf.Write([]byte{byte(checksum >> 8), byte(checksum)}) - priv = buf.Bytes() - } else { - priv, l = pk.encryptedData, len(pk.encryptedData) - } - - if pk.Version == 5 { - contents.Write([]byte{byte(l >> 24), byte(l >> 16), byte(l >> 8), byte(l)}) - } - contents.Write(priv) - } - - ptype := packetTypePrivateKey - if pk.IsSubkey { - ptype = packetTypePrivateSubkey - } - err = serializeHeader(w, ptype, contents.Len()) - if err != nil { - return - } - _, err = io.Copy(w, contents) - if err != nil { - return - } - return -} - -func serializeRSAPrivateKey(w io.Writer, priv *rsa.PrivateKey) error { - if _, err := w.Write(new(encoding.MPI).SetBig(priv.D).EncodedBytes()); err != nil { - return err - } - if _, err := w.Write(new(encoding.MPI).SetBig(priv.Primes[1]).EncodedBytes()); err != nil { - return err - } - if _, err := w.Write(new(encoding.MPI).SetBig(priv.Primes[0]).EncodedBytes()); err != nil { - return err - } - _, err := w.Write(new(encoding.MPI).SetBig(priv.Precomputed.Qinv).EncodedBytes()) - return err -} - -func serializeDSAPrivateKey(w io.Writer, priv *dsa.PrivateKey) error { - _, err := w.Write(new(encoding.MPI).SetBig(priv.X).EncodedBytes()) - return err -} - -func serializeElGamalPrivateKey(w io.Writer, priv *elgamal.PrivateKey) error { - _, err := w.Write(new(encoding.MPI).SetBig(priv.X).EncodedBytes()) - return err -} - -func serializeECDSAPrivateKey(w io.Writer, priv *ecdsa.PrivateKey) error { - _, err := w.Write(encoding.NewMPI(priv.MarshalIntegerSecret()).EncodedBytes()) - return err -} - -func serializeEdDSAPrivateKey(w io.Writer, priv *eddsa.PrivateKey) error { - _, err := w.Write(encoding.NewMPI(priv.MarshalByteSecret()).EncodedBytes()) - return err -} - -func serializeECDHPrivateKey(w io.Writer, priv *ecdh.PrivateKey) error { - _, err := w.Write(encoding.NewMPI(priv.MarshalByteSecret()).EncodedBytes()) - return err -} - -// decrypt decrypts an encrypted private key using a decryption key. -func (pk *PrivateKey) decrypt(decryptionKey []byte) error { - if pk.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - if !pk.Encrypted { - return nil - } - - block := pk.cipher.new(decryptionKey) - cfb := cipher.NewCFBDecrypter(block, pk.iv) - - data := make([]byte, len(pk.encryptedData)) - cfb.XORKeyStream(data, pk.encryptedData) - - if pk.sha1Checksum { - if len(data) < sha1.Size { - return errors.StructuralError("truncated private key data") - } - h := sha1.New() - h.Write(data[:len(data)-sha1.Size]) - sum := h.Sum(nil) - if !bytes.Equal(sum, data[len(data)-sha1.Size:]) { - return errors.StructuralError("private key checksum failure") - } - data = data[:len(data)-sha1.Size] - } else { - if len(data) < 2 { - return errors.StructuralError("truncated private key data") - } - var sum uint16 - for i := 0; i < len(data)-2; i++ { - sum += uint16(data[i]) - } - if data[len(data)-2] != uint8(sum>>8) || - data[len(data)-1] != uint8(sum) { - return errors.StructuralError("private key checksum failure") - } - data = data[:len(data)-2] - } - - err := pk.parsePrivateKey(data) - if _, ok := err.(errors.KeyInvalidError); ok { - return errors.KeyInvalidError("invalid key parameters") - } - if err != nil { - return err - } - - // Mark key as unencrypted - pk.s2kType = S2KNON - pk.s2k = nil - pk.Encrypted = false - pk.encryptedData = nil - - return nil -} - -func (pk *PrivateKey) decryptWithCache(passphrase []byte, keyCache *s2k.Cache) error { - if pk.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - if !pk.Encrypted { - return nil - } - - key, err := keyCache.GetOrComputeDerivedKey(passphrase, pk.s2kParams, pk.cipher.KeySize()) - if err != nil { - return err - } - return pk.decrypt(key) -} - -// Decrypt decrypts an encrypted private key using a passphrase. -func (pk *PrivateKey) Decrypt(passphrase []byte) error { - if pk.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - if !pk.Encrypted { - return nil - } - - key := make([]byte, pk.cipher.KeySize()) - pk.s2k(key, passphrase) - return pk.decrypt(key) -} - -// DecryptPrivateKeys decrypts all encrypted keys with the given config and passphrase. -// Avoids recomputation of similar s2k key derivations. -func DecryptPrivateKeys(keys []*PrivateKey, passphrase []byte) error { - // Create a cache to avoid recomputation of key derviations for the same passphrase. - s2kCache := &s2k.Cache{} - for _, key := range keys { - if key != nil && !key.Dummy() && key.Encrypted { - err := key.decryptWithCache(passphrase, s2kCache) - if err != nil { - return err - } - } - } - return nil -} - -// encrypt encrypts an unencrypted private key. -func (pk *PrivateKey) encrypt(key []byte, params *s2k.Params, cipherFunction CipherFunction) error { - if pk.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - if pk.Encrypted { - return nil - } - // check if encryptionKey has the correct size - if len(key) != cipherFunction.KeySize() { - return errors.InvalidArgumentError("supplied encryption key has the wrong size") - } - - priv := bytes.NewBuffer(nil) - err := pk.serializePrivateKey(priv) - if err != nil { - return err - } - - pk.cipher = cipherFunction - pk.s2kParams = params - pk.s2k, err = pk.s2kParams.Function() - if err != nil { - return err - } - - privateKeyBytes := priv.Bytes() - pk.sha1Checksum = true - block := pk.cipher.new(key) - pk.iv = make([]byte, pk.cipher.blockSize()) - _, err = rand.Read(pk.iv) - if err != nil { - return err - } - cfb := cipher.NewCFBEncrypter(block, pk.iv) - - if pk.sha1Checksum { - pk.s2kType = S2KSHA1 - h := sha1.New() - h.Write(privateKeyBytes) - sum := h.Sum(nil) - privateKeyBytes = append(privateKeyBytes, sum...) - } else { - pk.s2kType = S2KCHECKSUM - var sum uint16 - for _, b := range privateKeyBytes { - sum += uint16(b) - } - priv.Write([]byte{uint8(sum >> 8), uint8(sum)}) - } - - pk.encryptedData = make([]byte, len(privateKeyBytes)) - cfb.XORKeyStream(pk.encryptedData, privateKeyBytes) - pk.Encrypted = true - pk.PrivateKey = nil - return err -} - -// EncryptWithConfig encrypts an unencrypted private key using the passphrase and the config. -func (pk *PrivateKey) EncryptWithConfig(passphrase []byte, config *Config) error { - params, err := s2k.Generate(config.Random(), config.S2K()) - if err != nil { - return err - } - // Derive an encryption key with the configured s2k function. - key := make([]byte, config.Cipher().KeySize()) - s2k, err := params.Function() - if err != nil { - return err - } - s2k(key, passphrase) - // Encrypt the private key with the derived encryption key. - return pk.encrypt(key, params, config.Cipher()) -} - -// EncryptPrivateKeys encrypts all unencrypted keys with the given config and passphrase. -// Only derives one key from the passphrase, which is then used to encrypt each key. -func EncryptPrivateKeys(keys []*PrivateKey, passphrase []byte, config *Config) error { - params, err := s2k.Generate(config.Random(), config.S2K()) - if err != nil { - return err - } - // Derive an encryption key with the configured s2k function. - encryptionKey := make([]byte, config.Cipher().KeySize()) - s2k, err := params.Function() - if err != nil { - return err - } - s2k(encryptionKey, passphrase) - for _, key := range keys { - if key != nil && !key.Dummy() && !key.Encrypted { - err = key.encrypt(encryptionKey, params, config.Cipher()) - if err != nil { - return err - } - } - } - return nil -} - -// Encrypt encrypts an unencrypted private key using a passphrase. -func (pk *PrivateKey) Encrypt(passphrase []byte) error { - // Default config of private key encryption - config := &Config{ - S2KConfig: &s2k.Config{ - S2KMode: s2k.IteratedSaltedS2K, - S2KCount: 65536, - Hash: crypto.SHA256, - } , - DefaultCipher: CipherAES256, - } - return pk.EncryptWithConfig(passphrase, config) -} - -func (pk *PrivateKey) serializePrivateKey(w io.Writer) (err error) { - switch priv := pk.PrivateKey.(type) { - case *rsa.PrivateKey: - err = serializeRSAPrivateKey(w, priv) - case *dsa.PrivateKey: - err = serializeDSAPrivateKey(w, priv) - case *elgamal.PrivateKey: - err = serializeElGamalPrivateKey(w, priv) - case *ecdsa.PrivateKey: - err = serializeECDSAPrivateKey(w, priv) - case *eddsa.PrivateKey: - err = serializeEdDSAPrivateKey(w, priv) - case *ecdh.PrivateKey: - err = serializeECDHPrivateKey(w, priv) - default: - err = errors.InvalidArgumentError("unknown private key type") - } - return -} - -func (pk *PrivateKey) parsePrivateKey(data []byte) (err error) { - switch pk.PublicKey.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoRSAEncryptOnly: - return pk.parseRSAPrivateKey(data) - case PubKeyAlgoDSA: - return pk.parseDSAPrivateKey(data) - case PubKeyAlgoElGamal: - return pk.parseElGamalPrivateKey(data) - case PubKeyAlgoECDSA: - return pk.parseECDSAPrivateKey(data) - case PubKeyAlgoECDH: - return pk.parseECDHPrivateKey(data) - case PubKeyAlgoEdDSA: - return pk.parseEdDSAPrivateKey(data) - } - panic("impossible") -} - -func (pk *PrivateKey) parseRSAPrivateKey(data []byte) (err error) { - rsaPub := pk.PublicKey.PublicKey.(*rsa.PublicKey) - rsaPriv := new(rsa.PrivateKey) - rsaPriv.PublicKey = *rsaPub - - buf := bytes.NewBuffer(data) - d := new(encoding.MPI) - if _, err := d.ReadFrom(buf); err != nil { - return err - } - - p := new(encoding.MPI) - if _, err := p.ReadFrom(buf); err != nil { - return err - } - - q := new(encoding.MPI) - if _, err := q.ReadFrom(buf); err != nil { - return err - } - - rsaPriv.D = new(big.Int).SetBytes(d.Bytes()) - rsaPriv.Primes = make([]*big.Int, 2) - rsaPriv.Primes[0] = new(big.Int).SetBytes(p.Bytes()) - rsaPriv.Primes[1] = new(big.Int).SetBytes(q.Bytes()) - if err := rsaPriv.Validate(); err != nil { - return errors.KeyInvalidError(err.Error()) - } - rsaPriv.Precompute() - pk.PrivateKey = rsaPriv - - return nil -} - -func (pk *PrivateKey) parseDSAPrivateKey(data []byte) (err error) { - dsaPub := pk.PublicKey.PublicKey.(*dsa.PublicKey) - dsaPriv := new(dsa.PrivateKey) - dsaPriv.PublicKey = *dsaPub - - buf := bytes.NewBuffer(data) - x := new(encoding.MPI) - if _, err := x.ReadFrom(buf); err != nil { - return err - } - - dsaPriv.X = new(big.Int).SetBytes(x.Bytes()) - if err := validateDSAParameters(dsaPriv); err != nil { - return err - } - pk.PrivateKey = dsaPriv - - return nil -} - -func (pk *PrivateKey) parseElGamalPrivateKey(data []byte) (err error) { - pub := pk.PublicKey.PublicKey.(*elgamal.PublicKey) - priv := new(elgamal.PrivateKey) - priv.PublicKey = *pub - - buf := bytes.NewBuffer(data) - x := new(encoding.MPI) - if _, err := x.ReadFrom(buf); err != nil { - return err - } - - priv.X = new(big.Int).SetBytes(x.Bytes()) - if err := validateElGamalParameters(priv); err != nil { - return err - } - pk.PrivateKey = priv - - return nil -} - -func (pk *PrivateKey) parseECDSAPrivateKey(data []byte) (err error) { - ecdsaPub := pk.PublicKey.PublicKey.(*ecdsa.PublicKey) - ecdsaPriv := ecdsa.NewPrivateKey(*ecdsaPub) - - buf := bytes.NewBuffer(data) - d := new(encoding.MPI) - if _, err := d.ReadFrom(buf); err != nil { - return err - } - - if err := ecdsaPriv.UnmarshalIntegerSecret(d.Bytes()); err != nil { - return err - } - if err := ecdsa.Validate(ecdsaPriv); err != nil { - return err - } - pk.PrivateKey = ecdsaPriv - - return nil -} - -func (pk *PrivateKey) parseECDHPrivateKey(data []byte) (err error) { - ecdhPub := pk.PublicKey.PublicKey.(*ecdh.PublicKey) - ecdhPriv := ecdh.NewPrivateKey(*ecdhPub) - - buf := bytes.NewBuffer(data) - d := new(encoding.MPI) - if _, err := d.ReadFrom(buf); err != nil { - return err - } - - if err := ecdhPriv.UnmarshalByteSecret(d.Bytes()); err != nil { - return err - } - - if err := ecdh.Validate(ecdhPriv); err != nil { - return err - } - - pk.PrivateKey = ecdhPriv - - return nil -} - -func (pk *PrivateKey) parseEdDSAPrivateKey(data []byte) (err error) { - eddsaPub := pk.PublicKey.PublicKey.(*eddsa.PublicKey) - eddsaPriv := eddsa.NewPrivateKey(*eddsaPub) - eddsaPriv.PublicKey = *eddsaPub - - buf := bytes.NewBuffer(data) - d := new(encoding.MPI) - if _, err := d.ReadFrom(buf); err != nil { - return err - } - - if err = eddsaPriv.UnmarshalByteSecret(d.Bytes()); err != nil { - return err - } - - if err := eddsa.Validate(eddsaPriv); err != nil { - return err - } - - pk.PrivateKey = eddsaPriv - - return nil -} - -func validateDSAParameters(priv *dsa.PrivateKey) error { - p := priv.P // group prime - q := priv.Q // subgroup order - g := priv.G // g has order q mod p - x := priv.X // secret - y := priv.Y // y == g**x mod p - one := big.NewInt(1) - // expect g, y >= 2 and g < p - if g.Cmp(one) <= 0 || y.Cmp(one) <= 0 || g.Cmp(p) > 0 { - return errors.KeyInvalidError("dsa: invalid group") - } - // expect p > q - if p.Cmp(q) <= 0 { - return errors.KeyInvalidError("dsa: invalid group prime") - } - // q should be large enough and divide p-1 - pSub1 := new(big.Int).Sub(p, one) - if q.BitLen() < 150 || new(big.Int).Mod(pSub1, q).Cmp(big.NewInt(0)) != 0 { - return errors.KeyInvalidError("dsa: invalid order") - } - // confirm that g has order q mod p - if !q.ProbablyPrime(32) || new(big.Int).Exp(g, q, p).Cmp(one) != 0 { - return errors.KeyInvalidError("dsa: invalid order") - } - // check y - if new(big.Int).Exp(g, x, p).Cmp(y) != 0 { - return errors.KeyInvalidError("dsa: mismatching values") - } - - return nil -} - -func validateElGamalParameters(priv *elgamal.PrivateKey) error { - p := priv.P // group prime - g := priv.G // g has order p-1 mod p - x := priv.X // secret - y := priv.Y // y == g**x mod p - one := big.NewInt(1) - // Expect g, y >= 2 and g < p - if g.Cmp(one) <= 0 || y.Cmp(one) <= 0 || g.Cmp(p) > 0 { - return errors.KeyInvalidError("elgamal: invalid group") - } - if p.BitLen() < 1024 { - return errors.KeyInvalidError("elgamal: group order too small") - } - pSub1 := new(big.Int).Sub(p, one) - if new(big.Int).Exp(g, pSub1, p).Cmp(one) != 0 { - return errors.KeyInvalidError("elgamal: invalid group") - } - // Since p-1 is not prime, g might have a smaller order that divides p-1. - // We cannot confirm the exact order of g, but we make sure it is not too small. - gExpI := new(big.Int).Set(g) - i := 1 - threshold := 2 << 17 // we want order > threshold - for i < threshold { - i++ // we check every order to make sure key validation is not easily bypassed by guessing y' - gExpI.Mod(new(big.Int).Mul(gExpI, g), p) - if gExpI.Cmp(one) == 0 { - return errors.KeyInvalidError("elgamal: order too small") - } - } - // Check y - if new(big.Int).Exp(g, x, p).Cmp(y) != 0 { - return errors.KeyInvalidError("elgamal: mismatching values") - } - - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go deleted file mode 100644 index 029b8f1aab..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/private_key_test_data.go +++ /dev/null @@ -1,12 +0,0 @@ -package packet - -// Generated with `gpg --export-secret-keys "Test Key 2"` -const privKeyRSAHex = "9501fe044cc349a8010400b70ca0010e98c090008d45d1ee8f9113bd5861fd57b88bacb7c68658747663f1e1a3b5a98f32fda6472373c024b97359cd2efc88ff60f77751adfbf6af5e615e6a1408cfad8bf0cea30b0d5f53aa27ad59089ba9b15b7ebc2777a25d7b436144027e3bcd203909f147d0e332b240cf63d3395f5dfe0df0a6c04e8655af7eacdf0011010001fe0303024a252e7d475fd445607de39a265472aa74a9320ba2dac395faa687e9e0336aeb7e9a7397e511b5afd9dc84557c80ac0f3d4d7bfec5ae16f20d41c8c84a04552a33870b930420e230e179564f6d19bb153145e76c33ae993886c388832b0fa042ddda7f133924f3854481533e0ede31d51278c0519b29abc3bf53da673e13e3e1214b52413d179d7f66deee35cac8eacb060f78379d70ef4af8607e68131ff529439668fc39c9ce6dfef8a5ac234d234802cbfb749a26107db26406213ae5c06d4673253a3cbee1fcbae58d6ab77e38d6e2c0e7c6317c48e054edadb5a40d0d48acb44643d998139a8a66bb820be1f3f80185bc777d14b5954b60effe2448a036d565c6bc0b915fcea518acdd20ab07bc1529f561c58cd044f723109b93f6fd99f876ff891d64306b5d08f48bab59f38695e9109c4dec34013ba3153488ce070268381ba923ee1eb77125b36afcb4347ec3478c8f2735b06ef17351d872e577fa95d0c397c88c71b59629a36aec" - -// Generated by `gpg --export-secret-keys` followed by a manual extraction of -// the ElGamal subkey from the packets. -const privKeyElGamalHex = "9d0157044df9ee1a100400eb8e136a58ec39b582629cdadf830bc64e0a94ed8103ca8bb247b27b11b46d1d25297ef4bcc3071785ba0c0bedfe89eabc5287fcc0edf81ab5896c1c8e4b20d27d79813c7aede75320b33eaeeaa586edc00fd1036c10133e6ba0ff277245d0d59d04b2b3421b7244aca5f4a8d870c6f1c1fbff9e1c26699a860b9504f35ca1d700030503fd1ededd3b840795be6d9ccbe3c51ee42e2f39233c432b831ddd9c4e72b7025a819317e47bf94f9ee316d7273b05d5fcf2999c3a681f519b1234bbfa6d359b4752bd9c3f77d6b6456cde152464763414ca130f4e91d91041432f90620fec0e6d6b5116076c2985d5aeaae13be492b9b329efcaf7ee25120159a0a30cd976b42d7afe030302dae7eb80db744d4960c4df930d57e87fe81412eaace9f900e6c839817a614ddb75ba6603b9417c33ea7b6c93967dfa2bcff3fa3c74a5ce2c962db65b03aece14c96cbd0038fc" - -// pkcs1PrivKeyHex is a PKCS#1, RSA private key. -// Generated by `openssl genrsa 1024 | openssl rsa -outform DER | xxd -p` -const pkcs1PrivKeyHex = "3082025d02010002818100e98edfa1c3b35884a54d0b36a6a603b0290fa85e49e30fa23fc94fef9c6790bc4849928607aa48d809da326fb42a969d06ad756b98b9c1a90f5d4a2b6d0ac05953c97f4da3120164a21a679793ce181c906dc01d235cc085ddcdf6ea06c389b6ab8885dfd685959e693138856a68a7e5db263337ff82a088d583a897cf2d59e9020301000102818100b6d5c9eb70b02d5369b3ee5b520a14490b5bde8a317d36f7e4c74b7460141311d1e5067735f8f01d6f5908b2b96fbd881f7a1ab9a84d82753e39e19e2d36856be960d05ac9ef8e8782ea1b6d65aee28fdfe1d61451e8cff0adfe84322f12cf455028b581cf60eb9e0e140ba5d21aeba6c2634d7c65318b9a665fc01c3191ca21024100fa5e818da3705b0fa33278bb28d4b6f6050388af2d4b75ec9375dd91ccf2e7d7068086a8b82a8f6282e4fbbdb8a7f2622eb97295249d87acea7f5f816f54d347024100eecf9406d7dc49cdfb95ab1eff4064de84c7a30f64b2798936a0d2018ba9eb52e4b636f82e96c49cc63b80b675e91e40d1b2e4017d4b9adaf33ab3d9cf1c214f024100c173704ace742c082323066226a4655226819a85304c542b9dacbeacbf5d1881ee863485fcf6f59f3a604f9b42289282067447f2b13dfeed3eab7851fc81e0550240741fc41f3fc002b382eed8730e33c5d8de40256e4accee846667f536832f711ab1d4590e7db91a8a116ac5bff3be13d3f9243ff2e976662aa9b395d907f8e9c9024046a5696c9ef882363e06c9fa4e2f5b580906452befba03f4a99d0f873697ef1f851d2226ca7934b30b7c3e80cb634a67172bbbf4781735fe3e09263e2dd723e7" diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go deleted file mode 100644 index 3402b8c140..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key.go +++ /dev/null @@ -1,806 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto" - "crypto/dsa" - "crypto/rsa" - "crypto/sha1" - "crypto/sha256" - _ "crypto/sha512" - "encoding/binary" - "fmt" - "hash" - "io" - "math/big" - "strconv" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/ecdh" - "github.com/ProtonMail/go-crypto/openpgp/ecdsa" - "github.com/ProtonMail/go-crypto/openpgp/eddsa" - "github.com/ProtonMail/go-crypto/openpgp/elgamal" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/internal/ecc" - "github.com/ProtonMail/go-crypto/openpgp/internal/encoding" -) - -type kdfHashFunction byte -type kdfAlgorithm byte - -// PublicKey represents an OpenPGP public key. See RFC 4880, section 5.5.2. -type PublicKey struct { - Version int - CreationTime time.Time - PubKeyAlgo PublicKeyAlgorithm - PublicKey interface{} // *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey or *eddsa.PublicKey - Fingerprint []byte - KeyId uint64 - IsSubkey bool - - // RFC 4880 fields - n, e, p, q, g, y encoding.Field - - // RFC 6637 fields - // oid contains the OID byte sequence identifying the elliptic curve used - oid encoding.Field - - // kdf stores key derivation function parameters - // used for ECDH encryption. See RFC 6637, Section 9. - kdf encoding.Field -} - -// UpgradeToV5 updates the version of the key to v5, and updates all necessary -// fields. -func (pk *PublicKey) UpgradeToV5() { - pk.Version = 5 - pk.setFingerprintAndKeyId() -} - -// signingKey provides a convenient abstraction over signature verification -// for v3 and v4 public keys. -type signingKey interface { - SerializeForHash(io.Writer) error - SerializeSignaturePrefix(io.Writer) - serializeWithoutHeaders(io.Writer) error -} - -// NewRSAPublicKey returns a PublicKey that wraps the given rsa.PublicKey. -func NewRSAPublicKey(creationTime time.Time, pub *rsa.PublicKey) *PublicKey { - pk := &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoRSA, - PublicKey: pub, - n: new(encoding.MPI).SetBig(pub.N), - e: new(encoding.MPI).SetBig(big.NewInt(int64(pub.E))), - } - - pk.setFingerprintAndKeyId() - return pk -} - -// NewDSAPublicKey returns a PublicKey that wraps the given dsa.PublicKey. -func NewDSAPublicKey(creationTime time.Time, pub *dsa.PublicKey) *PublicKey { - pk := &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoDSA, - PublicKey: pub, - p: new(encoding.MPI).SetBig(pub.P), - q: new(encoding.MPI).SetBig(pub.Q), - g: new(encoding.MPI).SetBig(pub.G), - y: new(encoding.MPI).SetBig(pub.Y), - } - - pk.setFingerprintAndKeyId() - return pk -} - -// NewElGamalPublicKey returns a PublicKey that wraps the given elgamal.PublicKey. -func NewElGamalPublicKey(creationTime time.Time, pub *elgamal.PublicKey) *PublicKey { - pk := &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoElGamal, - PublicKey: pub, - p: new(encoding.MPI).SetBig(pub.P), - g: new(encoding.MPI).SetBig(pub.G), - y: new(encoding.MPI).SetBig(pub.Y), - } - - pk.setFingerprintAndKeyId() - return pk -} - -func NewECDSAPublicKey(creationTime time.Time, pub *ecdsa.PublicKey) *PublicKey { - pk := &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoECDSA, - PublicKey: pub, - p: encoding.NewMPI(pub.MarshalPoint()), - } - - curveInfo := ecc.FindByCurve(pub.GetCurve()) - if curveInfo == nil { - panic("unknown elliptic curve") - } - pk.oid = curveInfo.Oid - pk.setFingerprintAndKeyId() - return pk -} - -func NewECDHPublicKey(creationTime time.Time, pub *ecdh.PublicKey) *PublicKey { - var pk *PublicKey - var kdf = encoding.NewOID([]byte{0x1, pub.Hash.Id(), pub.Cipher.Id()}) - pk = &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoECDH, - PublicKey: pub, - p: encoding.NewMPI(pub.MarshalPoint()), - kdf: kdf, - } - - curveInfo := ecc.FindByCurve(pub.GetCurve()) - - if curveInfo == nil { - panic("unknown elliptic curve") - } - - pk.oid = curveInfo.Oid - pk.setFingerprintAndKeyId() - return pk -} - -func NewEdDSAPublicKey(creationTime time.Time, pub *eddsa.PublicKey) *PublicKey { - curveInfo := ecc.FindByCurve(pub.GetCurve()) - pk := &PublicKey{ - Version: 4, - CreationTime: creationTime, - PubKeyAlgo: PubKeyAlgoEdDSA, - PublicKey: pub, - oid: curveInfo.Oid, - // Native point format, see draft-koch-eddsa-for-openpgp-04, Appendix B - p: encoding.NewMPI(pub.MarshalPoint()), - } - - pk.setFingerprintAndKeyId() - return pk -} - -func (pk *PublicKey) parse(r io.Reader) (err error) { - // RFC 4880, section 5.5.2 - var buf [6]byte - _, err = readFull(r, buf[:]) - if err != nil { - return - } - if buf[0] != 4 && buf[0] != 5 { - return errors.UnsupportedError("public key version " + strconv.Itoa(int(buf[0]))) - } - - pk.Version = int(buf[0]) - if pk.Version == 5 { - var n [4]byte - _, err = readFull(r, n[:]) - if err != nil { - return - } - } - pk.CreationTime = time.Unix(int64(uint32(buf[1])<<24|uint32(buf[2])<<16|uint32(buf[3])<<8|uint32(buf[4])), 0) - pk.PubKeyAlgo = PublicKeyAlgorithm(buf[5]) - switch pk.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: - err = pk.parseRSA(r) - case PubKeyAlgoDSA: - err = pk.parseDSA(r) - case PubKeyAlgoElGamal: - err = pk.parseElGamal(r) - case PubKeyAlgoECDSA: - err = pk.parseECDSA(r) - case PubKeyAlgoECDH: - err = pk.parseECDH(r) - case PubKeyAlgoEdDSA: - err = pk.parseEdDSA(r) - default: - err = errors.UnsupportedError("public key type: " + strconv.Itoa(int(pk.PubKeyAlgo))) - } - if err != nil { - return - } - - pk.setFingerprintAndKeyId() - return -} - -func (pk *PublicKey) setFingerprintAndKeyId() { - // RFC 4880, section 12.2 - if pk.Version == 5 { - fingerprint := sha256.New() - pk.SerializeForHash(fingerprint) - pk.Fingerprint = make([]byte, 32) - copy(pk.Fingerprint, fingerprint.Sum(nil)) - pk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[:8]) - } else { - fingerprint := sha1.New() - pk.SerializeForHash(fingerprint) - pk.Fingerprint = make([]byte, 20) - copy(pk.Fingerprint, fingerprint.Sum(nil)) - pk.KeyId = binary.BigEndian.Uint64(pk.Fingerprint[12:20]) - } -} - -// parseRSA parses RSA public key material from the given Reader. See RFC 4880, -// section 5.5.2. -func (pk *PublicKey) parseRSA(r io.Reader) (err error) { - pk.n = new(encoding.MPI) - if _, err = pk.n.ReadFrom(r); err != nil { - return - } - pk.e = new(encoding.MPI) - if _, err = pk.e.ReadFrom(r); err != nil { - return - } - - if len(pk.e.Bytes()) > 3 { - err = errors.UnsupportedError("large public exponent") - return - } - rsa := &rsa.PublicKey{ - N: new(big.Int).SetBytes(pk.n.Bytes()), - E: 0, - } - for i := 0; i < len(pk.e.Bytes()); i++ { - rsa.E <<= 8 - rsa.E |= int(pk.e.Bytes()[i]) - } - pk.PublicKey = rsa - return -} - -// parseDSA parses DSA public key material from the given Reader. See RFC 4880, -// section 5.5.2. -func (pk *PublicKey) parseDSA(r io.Reader) (err error) { - pk.p = new(encoding.MPI) - if _, err = pk.p.ReadFrom(r); err != nil { - return - } - pk.q = new(encoding.MPI) - if _, err = pk.q.ReadFrom(r); err != nil { - return - } - pk.g = new(encoding.MPI) - if _, err = pk.g.ReadFrom(r); err != nil { - return - } - pk.y = new(encoding.MPI) - if _, err = pk.y.ReadFrom(r); err != nil { - return - } - - dsa := new(dsa.PublicKey) - dsa.P = new(big.Int).SetBytes(pk.p.Bytes()) - dsa.Q = new(big.Int).SetBytes(pk.q.Bytes()) - dsa.G = new(big.Int).SetBytes(pk.g.Bytes()) - dsa.Y = new(big.Int).SetBytes(pk.y.Bytes()) - pk.PublicKey = dsa - return -} - -// parseElGamal parses ElGamal public key material from the given Reader. See -// RFC 4880, section 5.5.2. -func (pk *PublicKey) parseElGamal(r io.Reader) (err error) { - pk.p = new(encoding.MPI) - if _, err = pk.p.ReadFrom(r); err != nil { - return - } - pk.g = new(encoding.MPI) - if _, err = pk.g.ReadFrom(r); err != nil { - return - } - pk.y = new(encoding.MPI) - if _, err = pk.y.ReadFrom(r); err != nil { - return - } - - elgamal := new(elgamal.PublicKey) - elgamal.P = new(big.Int).SetBytes(pk.p.Bytes()) - elgamal.G = new(big.Int).SetBytes(pk.g.Bytes()) - elgamal.Y = new(big.Int).SetBytes(pk.y.Bytes()) - pk.PublicKey = elgamal - return -} - -// parseECDSA parses ECDSA public key material from the given Reader. See -// RFC 6637, Section 9. -func (pk *PublicKey) parseECDSA(r io.Reader) (err error) { - pk.oid = new(encoding.OID) - if _, err = pk.oid.ReadFrom(r); err != nil { - return - } - pk.p = new(encoding.MPI) - if _, err = pk.p.ReadFrom(r); err != nil { - return - } - - curveInfo := ecc.FindByOid(pk.oid) - if curveInfo == nil { - return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid)) - } - - c, ok := curveInfo.Curve.(ecc.ECDSACurve) - if !ok { - return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid)) - } - - ecdsaKey := ecdsa.NewPublicKey(c) - err = ecdsaKey.UnmarshalPoint(pk.p.Bytes()) - pk.PublicKey = ecdsaKey - - return -} - -// parseECDH parses ECDH public key material from the given Reader. See -// RFC 6637, Section 9. -func (pk *PublicKey) parseECDH(r io.Reader) (err error) { - pk.oid = new(encoding.OID) - if _, err = pk.oid.ReadFrom(r); err != nil { - return - } - pk.p = new(encoding.MPI) - if _, err = pk.p.ReadFrom(r); err != nil { - return - } - pk.kdf = new(encoding.OID) - if _, err = pk.kdf.ReadFrom(r); err != nil { - return - } - - curveInfo := ecc.FindByOid(pk.oid) - - if curveInfo == nil { - return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid)) - } - - c, ok := curveInfo.Curve.(ecc.ECDHCurve) - if !ok { - return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid)) - } - - if kdfLen := len(pk.kdf.Bytes()); kdfLen < 3 { - return errors.UnsupportedError("unsupported ECDH KDF length: " + strconv.Itoa(kdfLen)) - } - if reserved := pk.kdf.Bytes()[0]; reserved != 0x01 { - return errors.UnsupportedError("unsupported KDF reserved field: " + strconv.Itoa(int(reserved))) - } - kdfHash, ok := algorithm.HashById[pk.kdf.Bytes()[1]] - if !ok { - return errors.UnsupportedError("unsupported ECDH KDF hash: " + strconv.Itoa(int(pk.kdf.Bytes()[1]))) - } - kdfCipher, ok := algorithm.CipherById[pk.kdf.Bytes()[2]] - if !ok { - return errors.UnsupportedError("unsupported ECDH KDF cipher: " + strconv.Itoa(int(pk.kdf.Bytes()[2]))) - } - - ecdhKey := ecdh.NewPublicKey(c, kdfHash, kdfCipher) - err = ecdhKey.UnmarshalPoint(pk.p.Bytes()) - pk.PublicKey = ecdhKey - - return -} - -func (pk *PublicKey) parseEdDSA(r io.Reader) (err error) { - pk.oid = new(encoding.OID) - if _, err = pk.oid.ReadFrom(r); err != nil { - return - } - curveInfo := ecc.FindByOid(pk.oid) - if curveInfo == nil { - return errors.UnsupportedError(fmt.Sprintf("unknown oid: %x", pk.oid)) - } - - c, ok := curveInfo.Curve.(ecc.EdDSACurve) - if !ok { - return errors.UnsupportedError(fmt.Sprintf("unsupported oid: %x", pk.oid)) - } - - pk.p = new(encoding.MPI) - if _, err = pk.p.ReadFrom(r); err != nil { - return - } - - if len(pk.p.Bytes()) == 0 { - return errors.StructuralError("empty EdDSA public key") - } - - pub := eddsa.NewPublicKey(c) - - switch flag := pk.p.Bytes()[0]; flag { - case 0x04: - // TODO: see _grcy_ecc_eddsa_ensure_compact in grcypt - return errors.UnsupportedError("unsupported EdDSA compression: " + strconv.Itoa(int(flag))) - case 0x40: - err = pub.UnmarshalPoint(pk.p.Bytes()) - default: - return errors.UnsupportedError("unsupported EdDSA compression: " + strconv.Itoa(int(flag))) - } - - pk.PublicKey = pub - return -} - -// SerializeForHash serializes the PublicKey to w with the special packet -// header format needed for hashing. -func (pk *PublicKey) SerializeForHash(w io.Writer) error { - pk.SerializeSignaturePrefix(w) - return pk.serializeWithoutHeaders(w) -} - -// SerializeSignaturePrefix writes the prefix for this public key to the given Writer. -// The prefix is used when calculating a signature over this public key. See -// RFC 4880, section 5.2.4. -func (pk *PublicKey) SerializeSignaturePrefix(w io.Writer) { - var pLength = pk.algorithmSpecificByteCount() - if pk.Version == 5 { - pLength += 10 // version, timestamp (4), algorithm, key octet count (4). - w.Write([]byte{ - 0x9A, - byte(pLength >> 24), - byte(pLength >> 16), - byte(pLength >> 8), - byte(pLength), - }) - return - } - pLength += 6 - w.Write([]byte{0x99, byte(pLength >> 8), byte(pLength)}) -} - -func (pk *PublicKey) Serialize(w io.Writer) (err error) { - length := 6 // 6 byte header - length += pk.algorithmSpecificByteCount() - if pk.Version == 5 { - length += 4 // octet key count - } - packetType := packetTypePublicKey - if pk.IsSubkey { - packetType = packetTypePublicSubkey - } - err = serializeHeader(w, packetType, length) - if err != nil { - return - } - return pk.serializeWithoutHeaders(w) -} - -func (pk *PublicKey) algorithmSpecificByteCount() int { - length := 0 - switch pk.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: - length += int(pk.n.EncodedLength()) - length += int(pk.e.EncodedLength()) - case PubKeyAlgoDSA: - length += int(pk.p.EncodedLength()) - length += int(pk.q.EncodedLength()) - length += int(pk.g.EncodedLength()) - length += int(pk.y.EncodedLength()) - case PubKeyAlgoElGamal: - length += int(pk.p.EncodedLength()) - length += int(pk.g.EncodedLength()) - length += int(pk.y.EncodedLength()) - case PubKeyAlgoECDSA: - length += int(pk.oid.EncodedLength()) - length += int(pk.p.EncodedLength()) - case PubKeyAlgoECDH: - length += int(pk.oid.EncodedLength()) - length += int(pk.p.EncodedLength()) - length += int(pk.kdf.EncodedLength()) - case PubKeyAlgoEdDSA: - length += int(pk.oid.EncodedLength()) - length += int(pk.p.EncodedLength()) - default: - panic("unknown public key algorithm") - } - return length -} - -// serializeWithoutHeaders marshals the PublicKey to w in the form of an -// OpenPGP public key packet, not including the packet header. -func (pk *PublicKey) serializeWithoutHeaders(w io.Writer) (err error) { - t := uint32(pk.CreationTime.Unix()) - if _, err = w.Write([]byte{ - byte(pk.Version), - byte(t >> 24), byte(t >> 16), byte(t >> 8), byte(t), - byte(pk.PubKeyAlgo), - }); err != nil { - return - } - - if pk.Version == 5 { - n := pk.algorithmSpecificByteCount() - if _, err = w.Write([]byte{ - byte(n >> 24), byte(n >> 16), byte(n >> 8), byte(n), - }); err != nil { - return - } - } - - switch pk.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: - if _, err = w.Write(pk.n.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.e.EncodedBytes()) - return - case PubKeyAlgoDSA: - if _, err = w.Write(pk.p.EncodedBytes()); err != nil { - return - } - if _, err = w.Write(pk.q.EncodedBytes()); err != nil { - return - } - if _, err = w.Write(pk.g.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.y.EncodedBytes()) - return - case PubKeyAlgoElGamal: - if _, err = w.Write(pk.p.EncodedBytes()); err != nil { - return - } - if _, err = w.Write(pk.g.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.y.EncodedBytes()) - return - case PubKeyAlgoECDSA: - if _, err = w.Write(pk.oid.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.p.EncodedBytes()) - return - case PubKeyAlgoECDH: - if _, err = w.Write(pk.oid.EncodedBytes()); err != nil { - return - } - if _, err = w.Write(pk.p.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.kdf.EncodedBytes()) - return - case PubKeyAlgoEdDSA: - if _, err = w.Write(pk.oid.EncodedBytes()); err != nil { - return - } - _, err = w.Write(pk.p.EncodedBytes()) - return - } - return errors.InvalidArgumentError("bad public-key algorithm") -} - -// CanSign returns true iff this public key can generate signatures -func (pk *PublicKey) CanSign() bool { - return pk.PubKeyAlgo != PubKeyAlgoRSAEncryptOnly && pk.PubKeyAlgo != PubKeyAlgoElGamal && pk.PubKeyAlgo != PubKeyAlgoECDH -} - -// VerifySignature returns nil iff sig is a valid signature, made by this -// public key, of the data hashed into signed. signed is mutated by this call. -func (pk *PublicKey) VerifySignature(signed hash.Hash, sig *Signature) (err error) { - if !pk.CanSign() { - return errors.InvalidArgumentError("public key cannot generate signatures") - } - if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) { - sig.AddMetadataToHashSuffix() - } - signed.Write(sig.HashSuffix) - hashBytes := signed.Sum(nil) - if sig.Version == 5 && (hashBytes[0] != sig.HashTag[0] || hashBytes[1] != sig.HashTag[1]) { - return errors.SignatureError("hash tag doesn't match") - } - - if pk.PubKeyAlgo != sig.PubKeyAlgo { - return errors.InvalidArgumentError("public key and signature use different algorithms") - } - - switch pk.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - rsaPublicKey, _ := pk.PublicKey.(*rsa.PublicKey) - err = rsa.VerifyPKCS1v15(rsaPublicKey, sig.Hash, hashBytes, padToKeySize(rsaPublicKey, sig.RSASignature.Bytes())) - if err != nil { - return errors.SignatureError("RSA verification failure") - } - return nil - case PubKeyAlgoDSA: - dsaPublicKey, _ := pk.PublicKey.(*dsa.PublicKey) - // Need to truncate hashBytes to match FIPS 186-3 section 4.6. - subgroupSize := (dsaPublicKey.Q.BitLen() + 7) / 8 - if len(hashBytes) > subgroupSize { - hashBytes = hashBytes[:subgroupSize] - } - if !dsa.Verify(dsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.DSASigR.Bytes()), new(big.Int).SetBytes(sig.DSASigS.Bytes())) { - return errors.SignatureError("DSA verification failure") - } - return nil - case PubKeyAlgoECDSA: - ecdsaPublicKey := pk.PublicKey.(*ecdsa.PublicKey) - if !ecdsa.Verify(ecdsaPublicKey, hashBytes, new(big.Int).SetBytes(sig.ECDSASigR.Bytes()), new(big.Int).SetBytes(sig.ECDSASigS.Bytes())) { - return errors.SignatureError("ECDSA verification failure") - } - return nil - case PubKeyAlgoEdDSA: - eddsaPublicKey := pk.PublicKey.(*eddsa.PublicKey) - if !eddsa.Verify(eddsaPublicKey, hashBytes, sig.EdDSASigR.Bytes(), sig.EdDSASigS.Bytes()) { - return errors.SignatureError("EdDSA verification failure") - } - return nil - default: - return errors.SignatureError("Unsupported public key algorithm used in signature") - } -} - -// keySignatureHash returns a Hash of the message that needs to be signed for -// pk to assert a subkey relationship to signed. -func keySignatureHash(pk, signed signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) { - if !hashFunc.Available() { - return nil, errors.UnsupportedError("hash function") - } - h = hashFunc.New() - - // RFC 4880, section 5.2.4 - err = pk.SerializeForHash(h) - if err != nil { - return nil, err - } - - err = signed.SerializeForHash(h) - return -} - -// VerifyKeySignature returns nil iff sig is a valid signature, made by this -// public key, of signed. -func (pk *PublicKey) VerifyKeySignature(signed *PublicKey, sig *Signature) error { - h, err := keySignatureHash(pk, signed, sig.Hash) - if err != nil { - return err - } - if err = pk.VerifySignature(h, sig); err != nil { - return err - } - - if sig.FlagSign { - // Signing subkeys must be cross-signed. See - // https://www.gnupg.org/faq/subkey-cross-certify.html. - if sig.EmbeddedSignature == nil { - return errors.StructuralError("signing subkey is missing cross-signature") - } - // Verify the cross-signature. This is calculated over the same - // data as the main signature, so we cannot just recursively - // call signed.VerifyKeySignature(...) - if h, err = keySignatureHash(pk, signed, sig.EmbeddedSignature.Hash); err != nil { - return errors.StructuralError("error while hashing for cross-signature: " + err.Error()) - } - if err := signed.VerifySignature(h, sig.EmbeddedSignature); err != nil { - return errors.StructuralError("error while verifying cross-signature: " + err.Error()) - } - } - - return nil -} - -func keyRevocationHash(pk signingKey, hashFunc crypto.Hash) (h hash.Hash, err error) { - if !hashFunc.Available() { - return nil, errors.UnsupportedError("hash function") - } - h = hashFunc.New() - - // RFC 4880, section 5.2.4 - err = pk.SerializeForHash(h) - - return -} - -// VerifyRevocationSignature returns nil iff sig is a valid signature, made by this -// public key. -func (pk *PublicKey) VerifyRevocationSignature(sig *Signature) (err error) { - h, err := keyRevocationHash(pk, sig.Hash) - if err != nil { - return err - } - return pk.VerifySignature(h, sig) -} - -// VerifySubkeyRevocationSignature returns nil iff sig is a valid subkey revocation signature, -// made by this public key, of signed. -func (pk *PublicKey) VerifySubkeyRevocationSignature(sig *Signature, signed *PublicKey) (err error) { - h, err := keySignatureHash(pk, signed, sig.Hash) - if err != nil { - return err - } - return pk.VerifySignature(h, sig) -} - -// userIdSignatureHash returns a Hash of the message that needs to be signed -// to assert that pk is a valid key for id. -func userIdSignatureHash(id string, pk *PublicKey, hashFunc crypto.Hash) (h hash.Hash, err error) { - if !hashFunc.Available() { - return nil, errors.UnsupportedError("hash function") - } - h = hashFunc.New() - - // RFC 4880, section 5.2.4 - pk.SerializeSignaturePrefix(h) - pk.serializeWithoutHeaders(h) - - var buf [5]byte - buf[0] = 0xb4 - buf[1] = byte(len(id) >> 24) - buf[2] = byte(len(id) >> 16) - buf[3] = byte(len(id) >> 8) - buf[4] = byte(len(id)) - h.Write(buf[:]) - h.Write([]byte(id)) - - return -} - -// VerifyUserIdSignature returns nil iff sig is a valid signature, made by this -// public key, that id is the identity of pub. -func (pk *PublicKey) VerifyUserIdSignature(id string, pub *PublicKey, sig *Signature) (err error) { - h, err := userIdSignatureHash(id, pub, sig.Hash) - if err != nil { - return err - } - return pk.VerifySignature(h, sig) -} - -// KeyIdString returns the public key's fingerprint in capital hex -// (e.g. "6C7EE1B8621CC013"). -func (pk *PublicKey) KeyIdString() string { - return fmt.Sprintf("%X", pk.Fingerprint[12:20]) -} - -// KeyIdShortString returns the short form of public key's fingerprint -// in capital hex, as shown by gpg --list-keys (e.g. "621CC013"). -func (pk *PublicKey) KeyIdShortString() string { - return fmt.Sprintf("%X", pk.Fingerprint[16:20]) -} - -// BitLength returns the bit length for the given public key. -func (pk *PublicKey) BitLength() (bitLength uint16, err error) { - switch pk.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSAEncryptOnly, PubKeyAlgoRSASignOnly: - bitLength = pk.n.BitLength() - case PubKeyAlgoDSA: - bitLength = pk.p.BitLength() - case PubKeyAlgoElGamal: - bitLength = pk.p.BitLength() - case PubKeyAlgoECDSA: - bitLength = pk.p.BitLength() - case PubKeyAlgoECDH: - bitLength = pk.p.BitLength() - case PubKeyAlgoEdDSA: - bitLength = pk.p.BitLength() - default: - err = errors.InvalidArgumentError("bad public-key algorithm") - } - return -} - -// KeyExpired returns whether sig is a self-signature of a key that has -// expired or is created in the future. -func (pk *PublicKey) KeyExpired(sig *Signature, currentTime time.Time) bool { - if pk.CreationTime.After(currentTime) { - return true - } - if sig.KeyLifetimeSecs == nil || *sig.KeyLifetimeSecs == 0 { - return false - } - expiry := pk.CreationTime.Add(time.Duration(*sig.KeyLifetimeSecs) * time.Second) - return currentTime.After(expiry) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go deleted file mode 100644 index b255f1f6f8..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/public_key_test_data.go +++ /dev/null @@ -1,24 +0,0 @@ -package packet - -const rsaFingerprintHex = "5fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb" - -const rsaPkDataHex = "988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001" - -const dsaFingerprintHex = "eece4c094db002103714c63c8e8fbe54062f19ed" - -const dsaPkDataHex = "9901a2044d432f89110400cd581334f0d7a1e1bdc8b9d6d8c0baf68793632735d2bb0903224cbaa1dfbf35a60ee7a13b92643421e1eb41aa8d79bea19a115a677f6b8ba3c7818ce53a6c2a24a1608bd8b8d6e55c5090cbde09dd26e356267465ae25e69ec8bdd57c7bbb2623e4d73336f73a0a9098f7f16da2e25252130fd694c0e8070c55a812a423ae7f00a0ebf50e70c2f19c3520a551bd4b08d30f23530d3d03ff7d0bf4a53a64a09dc5e6e6e35854b7d70c882b0c60293401958b1bd9e40abec3ea05ba87cf64899299d4bd6aa7f459c201d3fbbd6c82004bdc5e8a9eb8082d12054cc90fa9d4ec251a843236a588bf49552441817436c4f43326966fe85447d4e6d0acf8fa1ef0f014730770603ad7634c3088dc52501c237328417c31c89ed70400b2f1a98b0bf42f11fefc430704bebbaa41d9f355600c3facee1e490f64208e0e094ea55e3a598a219a58500bf78ac677b670a14f4e47e9cf8eab4f368cc1ddcaa18cc59309d4cc62dd4f680e73e6cc3e1ce87a84d0925efbcb26c575c093fc42eecf45135fabf6403a25c2016e1774c0484e440a18319072c617cc97ac0a3bb0" - -const ecdsaFingerprintHex = "9892270b38b8980b05c8d56d43fe956c542ca00b" - -const ecdsaPkDataHex = "9893045071c29413052b8104002304230401f4867769cedfa52c325018896245443968e52e51d0c2df8d939949cb5b330f2921711fbee1c9b9dddb95d15cb0255e99badeddda7cc23d9ddcaacbc290969b9f24019375d61c2e4e3b36953a28d8b2bc95f78c3f1d592fb24499be348656a7b17e3963187b4361afe497bc5f9f81213f04069f8e1fb9e6a6290ae295ca1a92b894396cb4" - -const ecdhFingerprintHex = "722354df2475a42164d1d49faa8b938f9a201946" - -const ecdhPkDataHex = "b90073044d53059212052b810400220303042faa84024a20b6735c4897efa5bfb41bf85b7eefeab5ca0cb9ffc8ea04a46acb25534a577694f9e25340a4ab5223a9dd1eda530c8aa2e6718db10d7e672558c7736fe09369ea5739a2a3554bf16d41faa50562f11c6d39bbd5dffb6b9a9ec91803010909" - -const eddsaFingerprintHex = "b2d5e5ec0e6deca6bc8eeeb00907e75e1dd99ad8" - -const eddsaPkDataHex = "98330456e2132b16092b06010401da470f01010740bbda39266affa511a8c2d02edf690fb784b0499c4406185811a163539ef11dc1b41d74657374696e67203c74657374696e674074657374696e672e636f6d3e8879041316080021050256e2132b021b03050b09080702061508090a0b020416020301021e01021780000a09100907e75e1dd99ad86d0c00fe39d2008359352782bc9b61ac382584cd8eff3f57a18c2287e3afeeb05d1f04ba00fe2d0bc1ddf3ff8adb9afa3e7d9287244b4ec567f3db4d60b74a9b5465ed528203" - -// Source: https://sites.google.com/site/brainhub/pgpecckeys#TOC-ECC-NIST-P-384-key -const ecc384PubHex = `99006f044d53059213052b81040022030304f6b8c5aced5b84ef9f4a209db2e4a9dfb70d28cb8c10ecd57674a9fa5a67389942b62d5e51367df4c7bfd3f8e500feecf07ed265a621a8ebbbe53e947ec78c677eba143bd1533c2b350e1c29f82313e1e1108eba063be1e64b10e6950e799c2db42465635f6473615f64685f333834203c6f70656e70677040627261696e6875622e6f72673e8900cb04101309005305024d530592301480000000002000077072656665727265642d656d61696c2d656e636f64696e67407067702e636f6d7067706d696d65040b090807021901051b03000000021602051e010000000415090a08000a0910098033880f54719fca2b0180aa37350968bd5f115afd8ce7bc7b103822152dbff06d0afcda835329510905b98cb469ba208faab87c7412b799e7b633017f58364ea480e8a1a3f253a0c5f22c446e8be9a9fce6210136ee30811abbd49139de28b5bdf8dc36d06ae748579e9ff503b90073044d53059212052b810400220303042faa84024a20b6735c4897efa5bfb41bf85b7eefeab5ca0cb9ffc8ea04a46acb25534a577694f9e25340a4ab5223a9dd1eda530c8aa2e6718db10d7e672558c7736fe09369ea5739a2a3554bf16d41faa50562f11c6d39bbd5dffb6b9a9ec9180301090989008404181309000c05024d530592051b0c000000000a0910098033880f54719f80970180eee7a6d8fcee41ee4f9289df17f9bcf9d955dca25c583b94336f3a2b2d4986dc5cf417b8d2dc86f741a9e1a6d236c0e3017d1c76575458a0cfb93ae8a2b274fcc65ceecd7a91eec83656ba13219969f06945b48c56bd04152c3a0553c5f2f4bd1267` diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go deleted file mode 100644 index 10215fe5f2..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/reader.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// Reader reads packets from an io.Reader and allows packets to be 'unread' so -// that they result from the next call to Next. -type Reader struct { - q []Packet - readers []io.Reader -} - -// New io.Readers are pushed when a compressed or encrypted packet is processed -// and recursively treated as a new source of packets. However, a carefully -// crafted packet can trigger an infinite recursive sequence of packets. See -// http://mumble.net/~campbell/misc/pgp-quine -// https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4402 -// This constant limits the number of recursive packets that may be pushed. -const maxReaders = 32 - -// Next returns the most recently unread Packet, or reads another packet from -// the top-most io.Reader. Unknown packet types are skipped. -func (r *Reader) Next() (p Packet, err error) { - if len(r.q) > 0 { - p = r.q[len(r.q)-1] - r.q = r.q[:len(r.q)-1] - return - } - - for len(r.readers) > 0 { - p, err = Read(r.readers[len(r.readers)-1]) - if err == nil { - return - } - if err == io.EOF { - r.readers = r.readers[:len(r.readers)-1] - continue - } - // TODO: Add strict mode that rejects unknown packets, instead of ignoring them. - if _, ok := err.(errors.UnknownPacketTypeError); ok { - continue - } - if _, ok := err.(errors.UnsupportedError); ok { - switch p.(type) { - case *SymmetricallyEncrypted, *AEADEncrypted, *Compressed, *LiteralData: - return nil, err - } - continue - } - return nil, err - } - - return nil, io.EOF -} - -// Push causes the Reader to start reading from a new io.Reader. When an EOF -// error is seen from the new io.Reader, it is popped and the Reader continues -// to read from the next most recent io.Reader. Push returns a StructuralError -// if pushing the reader would exceed the maximum recursion level, otherwise it -// returns nil. -func (r *Reader) Push(reader io.Reader) (err error) { - if len(r.readers) >= maxReaders { - return errors.StructuralError("too many layers of packets") - } - r.readers = append(r.readers, reader) - return nil -} - -// Unread causes the given Packet to be returned from the next call to Next. -func (r *Reader) Unread(p Packet) { - r.q = append(r.q, p) -} - -func NewReader(r io.Reader) *Reader { - return &Reader{ - q: nil, - readers: []io.Reader{r}, - } -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go deleted file mode 100644 index 80d0bb98e0..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/signature.go +++ /dev/null @@ -1,1084 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "crypto" - "crypto/dsa" - "encoding/binary" - "hash" - "io" - "strconv" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/ecdsa" - "github.com/ProtonMail/go-crypto/openpgp/eddsa" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/internal/encoding" -) - -const ( - // See RFC 4880, section 5.2.3.21 for details. - KeyFlagCertify = 1 << iota - KeyFlagSign - KeyFlagEncryptCommunications - KeyFlagEncryptStorage - KeyFlagSplitKey - KeyFlagAuthenticate - _ - KeyFlagGroupKey -) - -// Signature represents a signature. See RFC 4880, section 5.2. -type Signature struct { - Version int - SigType SignatureType - PubKeyAlgo PublicKeyAlgorithm - Hash crypto.Hash - - // HashSuffix is extra data that is hashed in after the signed data. - HashSuffix []byte - // HashTag contains the first two bytes of the hash for fast rejection - // of bad signed data. - HashTag [2]byte - - // Metadata includes format, filename and time, and is protected by v5 - // signatures of type 0x00 or 0x01. This metadata is included into the hash - // computation; if nil, six 0x00 bytes are used instead. See section 5.2.4. - Metadata *LiteralData - - CreationTime time.Time - - RSASignature encoding.Field - DSASigR, DSASigS encoding.Field - ECDSASigR, ECDSASigS encoding.Field - EdDSASigR, EdDSASigS encoding.Field - - // rawSubpackets contains the unparsed subpackets, in order. - rawSubpackets []outputSubpacket - - // The following are optional so are nil when not included in the - // signature. - - SigLifetimeSecs, KeyLifetimeSecs *uint32 - PreferredSymmetric, PreferredHash, PreferredCompression []uint8 - PreferredCipherSuites [][2]uint8 - IssuerKeyId *uint64 - IssuerFingerprint []byte - SignerUserId *string - IsPrimaryId *bool - Notations []*Notation - - // TrustLevel and TrustAmount can be set by the signer to assert that - // the key is not only valid but also trustworthy at the specified - // level. - // See RFC 4880, section 5.2.3.13 for details. - TrustLevel TrustLevel - TrustAmount TrustAmount - - // TrustRegularExpression can be used in conjunction with trust Signature - // packets to limit the scope of the trust that is extended. - // See RFC 4880, section 5.2.3.14 for details. - TrustRegularExpression *string - - // PolicyURI can be set to the URI of a document that describes the - // policy under which the signature was issued. See RFC 4880, section - // 5.2.3.20 for details. - PolicyURI string - - // FlagsValid is set if any flags were given. See RFC 4880, section - // 5.2.3.21 for details. - FlagsValid bool - FlagCertify, FlagSign, FlagEncryptCommunications, FlagEncryptStorage, FlagSplitKey, FlagAuthenticate, FlagGroupKey bool - - // RevocationReason is set if this signature has been revoked. - // See RFC 4880, section 5.2.3.23 for details. - RevocationReason *ReasonForRevocation - RevocationReasonText string - - // In a self-signature, these flags are set there is a features subpacket - // indicating that the issuer implementation supports these features - // see https://datatracker.ietf.org/doc/html/draft-ietf-openpgp-crypto-refresh#features-subpacket - SEIPDv1, SEIPDv2 bool - - // EmbeddedSignature, if non-nil, is a signature of the parent key, by - // this key. This prevents an attacker from claiming another's signing - // subkey as their own. - EmbeddedSignature *Signature - - outSubpackets []outputSubpacket -} - -func (sig *Signature) parse(r io.Reader) (err error) { - // RFC 4880, section 5.2.3 - var buf [5]byte - _, err = readFull(r, buf[:1]) - if err != nil { - return - } - if buf[0] != 4 && buf[0] != 5 { - err = errors.UnsupportedError("signature packet version " + strconv.Itoa(int(buf[0]))) - return - } - sig.Version = int(buf[0]) - _, err = readFull(r, buf[:5]) - if err != nil { - return - } - sig.SigType = SignatureType(buf[0]) - sig.PubKeyAlgo = PublicKeyAlgorithm(buf[1]) - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly, PubKeyAlgoDSA, PubKeyAlgoECDSA, PubKeyAlgoEdDSA: - default: - err = errors.UnsupportedError("public key algorithm " + strconv.Itoa(int(sig.PubKeyAlgo))) - return - } - - var ok bool - - if sig.Version < 5 { - sig.Hash, ok = algorithm.HashIdToHashWithSha1(buf[2]) - } else { - sig.Hash, ok = algorithm.HashIdToHash(buf[2]) - } - - if !ok { - return errors.UnsupportedError("hash function " + strconv.Itoa(int(buf[2]))) - } - - hashedSubpacketsLength := int(buf[3])<<8 | int(buf[4]) - hashedSubpackets := make([]byte, hashedSubpacketsLength) - _, err = readFull(r, hashedSubpackets) - if err != nil { - return - } - err = sig.buildHashSuffix(hashedSubpackets) - if err != nil { - return - } - - err = parseSignatureSubpackets(sig, hashedSubpackets, true) - if err != nil { - return - } - - _, err = readFull(r, buf[:2]) - if err != nil { - return - } - unhashedSubpacketsLength := int(buf[0])<<8 | int(buf[1]) - unhashedSubpackets := make([]byte, unhashedSubpacketsLength) - _, err = readFull(r, unhashedSubpackets) - if err != nil { - return - } - err = parseSignatureSubpackets(sig, unhashedSubpackets, false) - if err != nil { - return - } - - _, err = readFull(r, sig.HashTag[:2]) - if err != nil { - return - } - - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - sig.RSASignature = new(encoding.MPI) - _, err = sig.RSASignature.ReadFrom(r) - case PubKeyAlgoDSA: - sig.DSASigR = new(encoding.MPI) - if _, err = sig.DSASigR.ReadFrom(r); err != nil { - return - } - - sig.DSASigS = new(encoding.MPI) - _, err = sig.DSASigS.ReadFrom(r) - case PubKeyAlgoECDSA: - sig.ECDSASigR = new(encoding.MPI) - if _, err = sig.ECDSASigR.ReadFrom(r); err != nil { - return - } - - sig.ECDSASigS = new(encoding.MPI) - _, err = sig.ECDSASigS.ReadFrom(r) - case PubKeyAlgoEdDSA: - sig.EdDSASigR = new(encoding.MPI) - if _, err = sig.EdDSASigR.ReadFrom(r); err != nil { - return - } - - sig.EdDSASigS = new(encoding.MPI) - if _, err = sig.EdDSASigS.ReadFrom(r); err != nil { - return - } - default: - panic("unreachable") - } - return -} - -// parseSignatureSubpackets parses subpackets of the main signature packet. See -// RFC 4880, section 5.2.3.1. -func parseSignatureSubpackets(sig *Signature, subpackets []byte, isHashed bool) (err error) { - for len(subpackets) > 0 { - subpackets, err = parseSignatureSubpacket(sig, subpackets, isHashed) - if err != nil { - return - } - } - - if sig.CreationTime.IsZero() { - err = errors.StructuralError("no creation time in signature") - } - - return -} - -type signatureSubpacketType uint8 - -const ( - creationTimeSubpacket signatureSubpacketType = 2 - signatureExpirationSubpacket signatureSubpacketType = 3 - trustSubpacket signatureSubpacketType = 5 - regularExpressionSubpacket signatureSubpacketType = 6 - keyExpirationSubpacket signatureSubpacketType = 9 - prefSymmetricAlgosSubpacket signatureSubpacketType = 11 - issuerSubpacket signatureSubpacketType = 16 - notationDataSubpacket signatureSubpacketType = 20 - prefHashAlgosSubpacket signatureSubpacketType = 21 - prefCompressionSubpacket signatureSubpacketType = 22 - primaryUserIdSubpacket signatureSubpacketType = 25 - policyUriSubpacket signatureSubpacketType = 26 - keyFlagsSubpacket signatureSubpacketType = 27 - signerUserIdSubpacket signatureSubpacketType = 28 - reasonForRevocationSubpacket signatureSubpacketType = 29 - featuresSubpacket signatureSubpacketType = 30 - embeddedSignatureSubpacket signatureSubpacketType = 32 - issuerFingerprintSubpacket signatureSubpacketType = 33 - prefCipherSuitesSubpacket signatureSubpacketType = 39 -) - -// parseSignatureSubpacket parses a single subpacket. len(subpacket) is >= 1. -func parseSignatureSubpacket(sig *Signature, subpacket []byte, isHashed bool) (rest []byte, err error) { - // RFC 4880, section 5.2.3.1 - var ( - length uint32 - packetType signatureSubpacketType - isCritical bool - ) - if len(subpacket) == 0 { - err = errors.StructuralError("zero length signature subpacket") - return - } - switch { - case subpacket[0] < 192: - length = uint32(subpacket[0]) - subpacket = subpacket[1:] - case subpacket[0] < 255: - if len(subpacket) < 2 { - goto Truncated - } - length = uint32(subpacket[0]-192)<<8 + uint32(subpacket[1]) + 192 - subpacket = subpacket[2:] - default: - if len(subpacket) < 5 { - goto Truncated - } - length = uint32(subpacket[1])<<24 | - uint32(subpacket[2])<<16 | - uint32(subpacket[3])<<8 | - uint32(subpacket[4]) - subpacket = subpacket[5:] - } - if length > uint32(len(subpacket)) { - goto Truncated - } - rest = subpacket[length:] - subpacket = subpacket[:length] - if len(subpacket) == 0 { - err = errors.StructuralError("zero length signature subpacket") - return - } - packetType = signatureSubpacketType(subpacket[0] & 0x7f) - isCritical = subpacket[0]&0x80 == 0x80 - subpacket = subpacket[1:] - sig.rawSubpackets = append(sig.rawSubpackets, outputSubpacket{isHashed, packetType, isCritical, subpacket}) - if !isHashed && - packetType != issuerSubpacket && - packetType != issuerFingerprintSubpacket && - packetType != embeddedSignatureSubpacket { - return - } - switch packetType { - case creationTimeSubpacket: - if len(subpacket) != 4 { - err = errors.StructuralError("signature creation time not four bytes") - return - } - t := binary.BigEndian.Uint32(subpacket) - sig.CreationTime = time.Unix(int64(t), 0) - case signatureExpirationSubpacket: - // Signature expiration time, section 5.2.3.10 - if len(subpacket) != 4 { - err = errors.StructuralError("expiration subpacket with bad length") - return - } - sig.SigLifetimeSecs = new(uint32) - *sig.SigLifetimeSecs = binary.BigEndian.Uint32(subpacket) - case trustSubpacket: - if len(subpacket) != 2 { - err = errors.StructuralError("trust subpacket with bad length") - return - } - // Trust level and amount, section 5.2.3.13 - sig.TrustLevel = TrustLevel(subpacket[0]) - sig.TrustAmount = TrustAmount(subpacket[1]) - case regularExpressionSubpacket: - if len(subpacket) == 0 { - err = errors.StructuralError("regexp subpacket with bad length") - return - } - // Trust regular expression, section 5.2.3.14 - // RFC specifies the string should be null-terminated; remove a null byte from the end - if subpacket[len(subpacket)-1] != 0x00 { - err = errors.StructuralError("expected regular expression to be null-terminated") - return - } - trustRegularExpression := string(subpacket[:len(subpacket)-1]) - sig.TrustRegularExpression = &trustRegularExpression - case keyExpirationSubpacket: - // Key expiration time, section 5.2.3.6 - if len(subpacket) != 4 { - err = errors.StructuralError("key expiration subpacket with bad length") - return - } - sig.KeyLifetimeSecs = new(uint32) - *sig.KeyLifetimeSecs = binary.BigEndian.Uint32(subpacket) - case prefSymmetricAlgosSubpacket: - // Preferred symmetric algorithms, section 5.2.3.7 - sig.PreferredSymmetric = make([]byte, len(subpacket)) - copy(sig.PreferredSymmetric, subpacket) - case issuerSubpacket: - // Issuer, section 5.2.3.5 - if sig.Version > 4 { - err = errors.StructuralError("issuer subpacket found in v5 key") - return - } - if len(subpacket) != 8 { - err = errors.StructuralError("issuer subpacket with bad length") - return - } - sig.IssuerKeyId = new(uint64) - *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket) - case notationDataSubpacket: - // Notation data, section 5.2.3.16 - if len(subpacket) < 8 { - err = errors.StructuralError("notation data subpacket with bad length") - return - } - - nameLength := uint32(subpacket[4])<<8 | uint32(subpacket[5]) - valueLength := uint32(subpacket[6])<<8 | uint32(subpacket[7]) - if len(subpacket) != int(nameLength)+int(valueLength)+8 { - err = errors.StructuralError("notation data subpacket with bad length") - return - } - - notation := Notation{ - IsHumanReadable: (subpacket[0] & 0x80) == 0x80, - Name: string(subpacket[8:(nameLength + 8)]), - Value: subpacket[(nameLength + 8):(valueLength + nameLength + 8)], - IsCritical: isCritical, - } - - sig.Notations = append(sig.Notations, ¬ation) - case prefHashAlgosSubpacket: - // Preferred hash algorithms, section 5.2.3.8 - sig.PreferredHash = make([]byte, len(subpacket)) - copy(sig.PreferredHash, subpacket) - case prefCompressionSubpacket: - // Preferred compression algorithms, section 5.2.3.9 - sig.PreferredCompression = make([]byte, len(subpacket)) - copy(sig.PreferredCompression, subpacket) - case primaryUserIdSubpacket: - // Primary User ID, section 5.2.3.19 - if len(subpacket) != 1 { - err = errors.StructuralError("primary user id subpacket with bad length") - return - } - sig.IsPrimaryId = new(bool) - if subpacket[0] > 0 { - *sig.IsPrimaryId = true - } - case keyFlagsSubpacket: - // Key flags, section 5.2.3.21 - if len(subpacket) == 0 { - err = errors.StructuralError("empty key flags subpacket") - return - } - sig.FlagsValid = true - if subpacket[0]&KeyFlagCertify != 0 { - sig.FlagCertify = true - } - if subpacket[0]&KeyFlagSign != 0 { - sig.FlagSign = true - } - if subpacket[0]&KeyFlagEncryptCommunications != 0 { - sig.FlagEncryptCommunications = true - } - if subpacket[0]&KeyFlagEncryptStorage != 0 { - sig.FlagEncryptStorage = true - } - if subpacket[0]&KeyFlagSplitKey != 0 { - sig.FlagSplitKey = true - } - if subpacket[0]&KeyFlagAuthenticate != 0 { - sig.FlagAuthenticate = true - } - if subpacket[0]&KeyFlagGroupKey != 0 { - sig.FlagGroupKey = true - } - case signerUserIdSubpacket: - userId := string(subpacket) - sig.SignerUserId = &userId - case reasonForRevocationSubpacket: - // Reason For Revocation, section 5.2.3.23 - if len(subpacket) == 0 { - err = errors.StructuralError("empty revocation reason subpacket") - return - } - sig.RevocationReason = new(ReasonForRevocation) - *sig.RevocationReason = ReasonForRevocation(subpacket[0]) - sig.RevocationReasonText = string(subpacket[1:]) - case featuresSubpacket: - // Features subpacket, section 5.2.3.24 specifies a very general - // mechanism for OpenPGP implementations to signal support for new - // features. - if len(subpacket) > 0 { - if subpacket[0]&0x01 != 0 { - sig.SEIPDv1 = true - } - // 0x02 and 0x04 are reserved - if subpacket[0]&0x08 != 0 { - sig.SEIPDv2 = true - } - } - case embeddedSignatureSubpacket: - // Only usage is in signatures that cross-certify - // signing subkeys. section 5.2.3.26 describes the - // format, with its usage described in section 11.1 - if sig.EmbeddedSignature != nil { - err = errors.StructuralError("Cannot have multiple embedded signatures") - return - } - sig.EmbeddedSignature = new(Signature) - // Embedded signatures are required to be v4 signatures see - // section 12.1. However, we only parse v4 signatures in this - // file anyway. - if err := sig.EmbeddedSignature.parse(bytes.NewBuffer(subpacket)); err != nil { - return nil, err - } - if sigType := sig.EmbeddedSignature.SigType; sigType != SigTypePrimaryKeyBinding { - return nil, errors.StructuralError("cross-signature has unexpected type " + strconv.Itoa(int(sigType))) - } - case policyUriSubpacket: - // Policy URI, section 5.2.3.20 - sig.PolicyURI = string(subpacket) - case issuerFingerprintSubpacket: - if len(subpacket) == 0 { - err = errors.StructuralError("empty issuer fingerprint subpacket") - return - } - v, l := subpacket[0], len(subpacket[1:]) - if v == 5 && l != 32 || v != 5 && l != 20 { - return nil, errors.StructuralError("bad fingerprint length") - } - sig.IssuerFingerprint = make([]byte, l) - copy(sig.IssuerFingerprint, subpacket[1:]) - sig.IssuerKeyId = new(uint64) - if v == 5 { - *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket[1:9]) - } else { - *sig.IssuerKeyId = binary.BigEndian.Uint64(subpacket[13:21]) - } - case prefCipherSuitesSubpacket: - // Preferred AEAD cipher suites - // See https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#name-preferred-aead-ciphersuites - if len(subpacket)%2 != 0 { - err = errors.StructuralError("invalid aead cipher suite length") - return - } - - sig.PreferredCipherSuites = make([][2]byte, len(subpacket)/2) - - for i := 0; i < len(subpacket)/2; i++ { - sig.PreferredCipherSuites[i] = [2]uint8{subpacket[2*i], subpacket[2*i+1]} - } - default: - if isCritical { - err = errors.UnsupportedError("unknown critical signature subpacket type " + strconv.Itoa(int(packetType))) - return - } - } - return - -Truncated: - err = errors.StructuralError("signature subpacket truncated") - return -} - -// subpacketLengthLength returns the length, in bytes, of an encoded length value. -func subpacketLengthLength(length int) int { - if length < 192 { - return 1 - } - if length < 16320 { - return 2 - } - return 5 -} - -func (sig *Signature) CheckKeyIdOrFingerprint(pk *PublicKey) bool { - if sig.IssuerFingerprint != nil && len(sig.IssuerFingerprint) >= 20 { - return bytes.Equal(sig.IssuerFingerprint, pk.Fingerprint) - } - return sig.IssuerKeyId != nil && *sig.IssuerKeyId == pk.KeyId -} - -// serializeSubpacketLength marshals the given length into to. -func serializeSubpacketLength(to []byte, length int) int { - // RFC 4880, Section 4.2.2. - if length < 192 { - to[0] = byte(length) - return 1 - } - if length < 16320 { - length -= 192 - to[0] = byte((length >> 8) + 192) - to[1] = byte(length) - return 2 - } - to[0] = 255 - to[1] = byte(length >> 24) - to[2] = byte(length >> 16) - to[3] = byte(length >> 8) - to[4] = byte(length) - return 5 -} - -// subpacketsLength returns the serialized length, in bytes, of the given -// subpackets. -func subpacketsLength(subpackets []outputSubpacket, hashed bool) (length int) { - for _, subpacket := range subpackets { - if subpacket.hashed == hashed { - length += subpacketLengthLength(len(subpacket.contents) + 1) - length += 1 // type byte - length += len(subpacket.contents) - } - } - return -} - -// serializeSubpackets marshals the given subpackets into to. -func serializeSubpackets(to []byte, subpackets []outputSubpacket, hashed bool) { - for _, subpacket := range subpackets { - if subpacket.hashed == hashed { - n := serializeSubpacketLength(to, len(subpacket.contents)+1) - to[n] = byte(subpacket.subpacketType) - if subpacket.isCritical { - to[n] |= 0x80 - } - to = to[1+n:] - n = copy(to, subpacket.contents) - to = to[n:] - } - } - return -} - -// SigExpired returns whether sig is a signature that has expired or is created -// in the future. -func (sig *Signature) SigExpired(currentTime time.Time) bool { - if sig.CreationTime.After(currentTime) { - return true - } - if sig.SigLifetimeSecs == nil || *sig.SigLifetimeSecs == 0 { - return false - } - expiry := sig.CreationTime.Add(time.Duration(*sig.SigLifetimeSecs) * time.Second) - return currentTime.After(expiry) -} - -// buildHashSuffix constructs the HashSuffix member of sig in preparation for signing. -func (sig *Signature) buildHashSuffix(hashedSubpackets []byte) (err error) { - var hashId byte - var ok bool - - if sig.Version < 5 { - hashId, ok = algorithm.HashToHashIdWithSha1(sig.Hash) - } else { - hashId, ok = algorithm.HashToHashId(sig.Hash) - } - - if !ok { - sig.HashSuffix = nil - return errors.InvalidArgumentError("hash cannot be represented in OpenPGP: " + strconv.Itoa(int(sig.Hash))) - } - - hashedFields := bytes.NewBuffer([]byte{ - uint8(sig.Version), - uint8(sig.SigType), - uint8(sig.PubKeyAlgo), - uint8(hashId), - uint8(len(hashedSubpackets) >> 8), - uint8(len(hashedSubpackets)), - }) - hashedFields.Write(hashedSubpackets) - - var l uint64 = uint64(6 + len(hashedSubpackets)) - if sig.Version == 5 { - hashedFields.Write([]byte{0x05, 0xff}) - hashedFields.Write([]byte{ - uint8(l >> 56), uint8(l >> 48), uint8(l >> 40), uint8(l >> 32), - uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l), - }) - } else { - hashedFields.Write([]byte{0x04, 0xff}) - hashedFields.Write([]byte{ - uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l), - }) - } - sig.HashSuffix = make([]byte, hashedFields.Len()) - copy(sig.HashSuffix, hashedFields.Bytes()) - return -} - -func (sig *Signature) signPrepareHash(h hash.Hash) (digest []byte, err error) { - hashedSubpacketsLen := subpacketsLength(sig.outSubpackets, true) - hashedSubpackets := make([]byte, hashedSubpacketsLen) - serializeSubpackets(hashedSubpackets, sig.outSubpackets, true) - err = sig.buildHashSuffix(hashedSubpackets) - if err != nil { - return - } - if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) { - sig.AddMetadataToHashSuffix() - } - - h.Write(sig.HashSuffix) - digest = h.Sum(nil) - copy(sig.HashTag[:], digest) - return -} - -// Sign signs a message with a private key. The hash, h, must contain -// the hash of the message to be signed and will be mutated by this function. -// On success, the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) Sign(h hash.Hash, priv *PrivateKey, config *Config) (err error) { - if priv.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - sig.Version = priv.PublicKey.Version - sig.IssuerFingerprint = priv.PublicKey.Fingerprint - sig.outSubpackets, err = sig.buildSubpackets(priv.PublicKey) - if err != nil { - return err - } - digest, err := sig.signPrepareHash(h) - if err != nil { - return - } - switch priv.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - // supports both *rsa.PrivateKey and crypto.Signer - sigdata, err := priv.PrivateKey.(crypto.Signer).Sign(config.Random(), digest, sig.Hash) - if err == nil { - sig.RSASignature = encoding.NewMPI(sigdata) - } - case PubKeyAlgoDSA: - dsaPriv := priv.PrivateKey.(*dsa.PrivateKey) - - // Need to truncate hashBytes to match FIPS 186-3 section 4.6. - subgroupSize := (dsaPriv.Q.BitLen() + 7) / 8 - if len(digest) > subgroupSize { - digest = digest[:subgroupSize] - } - r, s, err := dsa.Sign(config.Random(), dsaPriv, digest) - if err == nil { - sig.DSASigR = new(encoding.MPI).SetBig(r) - sig.DSASigS = new(encoding.MPI).SetBig(s) - } - case PubKeyAlgoECDSA: - sk := priv.PrivateKey.(*ecdsa.PrivateKey) - r, s, err := ecdsa.Sign(config.Random(), sk, digest) - - if err == nil { - sig.ECDSASigR = new(encoding.MPI).SetBig(r) - sig.ECDSASigS = new(encoding.MPI).SetBig(s) - } - case PubKeyAlgoEdDSA: - sk := priv.PrivateKey.(*eddsa.PrivateKey) - r, s, err := eddsa.Sign(sk, digest) - if err == nil { - sig.EdDSASigR = encoding.NewMPI(r) - sig.EdDSASigS = encoding.NewMPI(s) - } - default: - err = errors.UnsupportedError("public key algorithm: " + strconv.Itoa(int(sig.PubKeyAlgo))) - } - - return -} - -// SignUserId computes a signature from priv, asserting that pub is a valid -// key for the identity id. On success, the signature is stored in sig. Call -// Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) SignUserId(id string, pub *PublicKey, priv *PrivateKey, config *Config) error { - if priv.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - h, err := userIdSignatureHash(id, pub, sig.Hash) - if err != nil { - return err - } - return sig.Sign(h, priv, config) -} - -// CrossSignKey computes a signature from signingKey on pub hashed using hashKey. On success, -// the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) CrossSignKey(pub *PublicKey, hashKey *PublicKey, signingKey *PrivateKey, - config *Config) error { - h, err := keySignatureHash(hashKey, pub, sig.Hash) - if err != nil { - return err - } - return sig.Sign(h, signingKey, config) -} - -// SignKey computes a signature from priv, asserting that pub is a subkey. On -// success, the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config) error { - if priv.Dummy() { - return errors.ErrDummyPrivateKey("dummy key found") - } - h, err := keySignatureHash(&priv.PublicKey, pub, sig.Hash) - if err != nil { - return err - } - return sig.Sign(h, priv, config) -} - -// RevokeKey computes a revocation signature of pub using priv. On success, the signature is -// stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) RevokeKey(pub *PublicKey, priv *PrivateKey, config *Config) error { - h, err := keyRevocationHash(pub, sig.Hash) - if err != nil { - return err - } - return sig.Sign(h, priv, config) -} - -// RevokeSubkey computes a subkey revocation signature of pub using priv. -// On success, the signature is stored in sig. Call Serialize to write it out. -// If config is nil, sensible defaults will be used. -func (sig *Signature) RevokeSubkey(pub *PublicKey, priv *PrivateKey, config *Config) error { - // Identical to a subkey binding signature - return sig.SignKey(pub, priv, config) -} - -// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been -// called first. -func (sig *Signature) Serialize(w io.Writer) (err error) { - if len(sig.outSubpackets) == 0 { - sig.outSubpackets = sig.rawSubpackets - } - if sig.RSASignature == nil && sig.DSASigR == nil && sig.ECDSASigR == nil && sig.EdDSASigR == nil { - return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize") - } - - sigLength := 0 - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - sigLength = int(sig.RSASignature.EncodedLength()) - case PubKeyAlgoDSA: - sigLength = int(sig.DSASigR.EncodedLength()) - sigLength += int(sig.DSASigS.EncodedLength()) - case PubKeyAlgoECDSA: - sigLength = int(sig.ECDSASigR.EncodedLength()) - sigLength += int(sig.ECDSASigS.EncodedLength()) - case PubKeyAlgoEdDSA: - sigLength = int(sig.EdDSASigR.EncodedLength()) - sigLength += int(sig.EdDSASigS.EncodedLength()) - default: - panic("impossible") - } - - unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false) - length := len(sig.HashSuffix) - 6 /* trailer not included */ + - 2 /* length of unhashed subpackets */ + unhashedSubpacketsLen + - 2 /* hash tag */ + sigLength - if sig.Version == 5 { - length -= 4 // eight-octet instead of four-octet big endian - } - err = serializeHeader(w, packetTypeSignature, length) - if err != nil { - return - } - err = sig.serializeBody(w) - if err != nil { - return err - } - return -} - -func (sig *Signature) serializeBody(w io.Writer) (err error) { - hashedSubpacketsLen := uint16(uint16(sig.HashSuffix[4])<<8) | uint16(sig.HashSuffix[5]) - fields := sig.HashSuffix[:6+hashedSubpacketsLen] - _, err = w.Write(fields) - if err != nil { - return - } - - unhashedSubpacketsLen := subpacketsLength(sig.outSubpackets, false) - unhashedSubpackets := make([]byte, 2+unhashedSubpacketsLen) - unhashedSubpackets[0] = byte(unhashedSubpacketsLen >> 8) - unhashedSubpackets[1] = byte(unhashedSubpacketsLen) - serializeSubpackets(unhashedSubpackets[2:], sig.outSubpackets, false) - - _, err = w.Write(unhashedSubpackets) - if err != nil { - return - } - _, err = w.Write(sig.HashTag[:]) - if err != nil { - return - } - - switch sig.PubKeyAlgo { - case PubKeyAlgoRSA, PubKeyAlgoRSASignOnly: - _, err = w.Write(sig.RSASignature.EncodedBytes()) - case PubKeyAlgoDSA: - if _, err = w.Write(sig.DSASigR.EncodedBytes()); err != nil { - return - } - _, err = w.Write(sig.DSASigS.EncodedBytes()) - case PubKeyAlgoECDSA: - if _, err = w.Write(sig.ECDSASigR.EncodedBytes()); err != nil { - return - } - _, err = w.Write(sig.ECDSASigS.EncodedBytes()) - case PubKeyAlgoEdDSA: - if _, err = w.Write(sig.EdDSASigR.EncodedBytes()); err != nil { - return - } - _, err = w.Write(sig.EdDSASigS.EncodedBytes()) - default: - panic("impossible") - } - return -} - -// outputSubpacket represents a subpacket to be marshaled. -type outputSubpacket struct { - hashed bool // true if this subpacket is in the hashed area. - subpacketType signatureSubpacketType - isCritical bool - contents []byte -} - -func (sig *Signature) buildSubpackets(issuer PublicKey) (subpackets []outputSubpacket, err error) { - creationTime := make([]byte, 4) - binary.BigEndian.PutUint32(creationTime, uint32(sig.CreationTime.Unix())) - subpackets = append(subpackets, outputSubpacket{true, creationTimeSubpacket, false, creationTime}) - - if sig.IssuerKeyId != nil && sig.Version == 4 { - keyId := make([]byte, 8) - binary.BigEndian.PutUint64(keyId, *sig.IssuerKeyId) - subpackets = append(subpackets, outputSubpacket{true, issuerSubpacket, false, keyId}) - } - if sig.IssuerFingerprint != nil { - contents := append([]uint8{uint8(issuer.Version)}, sig.IssuerFingerprint...) - subpackets = append(subpackets, outputSubpacket{true, issuerFingerprintSubpacket, sig.Version == 5, contents}) - } - if sig.SignerUserId != nil { - subpackets = append(subpackets, outputSubpacket{true, signerUserIdSubpacket, false, []byte(*sig.SignerUserId)}) - } - if sig.SigLifetimeSecs != nil && *sig.SigLifetimeSecs != 0 { - sigLifetime := make([]byte, 4) - binary.BigEndian.PutUint32(sigLifetime, *sig.SigLifetimeSecs) - subpackets = append(subpackets, outputSubpacket{true, signatureExpirationSubpacket, true, sigLifetime}) - } - - // Key flags may only appear in self-signatures or certification signatures. - - if sig.FlagsValid { - var flags byte - if sig.FlagCertify { - flags |= KeyFlagCertify - } - if sig.FlagSign { - flags |= KeyFlagSign - } - if sig.FlagEncryptCommunications { - flags |= KeyFlagEncryptCommunications - } - if sig.FlagEncryptStorage { - flags |= KeyFlagEncryptStorage - } - if sig.FlagSplitKey { - flags |= KeyFlagSplitKey - } - if sig.FlagAuthenticate { - flags |= KeyFlagAuthenticate - } - if sig.FlagGroupKey { - flags |= KeyFlagGroupKey - } - subpackets = append(subpackets, outputSubpacket{true, keyFlagsSubpacket, false, []byte{flags}}) - } - - for _, notation := range sig.Notations { - subpackets = append( - subpackets, - outputSubpacket{ - true, - notationDataSubpacket, - notation.IsCritical, - notation.getData(), - }) - } - - // The following subpackets may only appear in self-signatures. - - var features = byte(0x00) - if sig.SEIPDv1 { - features |= 0x01 - } - if sig.SEIPDv2 { - features |= 0x08 - } - - if features != 0x00 { - subpackets = append(subpackets, outputSubpacket{true, featuresSubpacket, false, []byte{features}}) - } - - if sig.TrustLevel != 0 { - subpackets = append(subpackets, outputSubpacket{true, trustSubpacket, true, []byte{byte(sig.TrustLevel), byte(sig.TrustAmount)}}) - } - - if sig.TrustRegularExpression != nil { - // RFC specifies the string should be null-terminated; add a null byte to the end - subpackets = append(subpackets, outputSubpacket{true, regularExpressionSubpacket, true, []byte(*sig.TrustRegularExpression + "\000")}) - } - - if sig.KeyLifetimeSecs != nil && *sig.KeyLifetimeSecs != 0 { - keyLifetime := make([]byte, 4) - binary.BigEndian.PutUint32(keyLifetime, *sig.KeyLifetimeSecs) - subpackets = append(subpackets, outputSubpacket{true, keyExpirationSubpacket, true, keyLifetime}) - } - - if sig.IsPrimaryId != nil && *sig.IsPrimaryId { - subpackets = append(subpackets, outputSubpacket{true, primaryUserIdSubpacket, false, []byte{1}}) - } - - if len(sig.PreferredSymmetric) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefSymmetricAlgosSubpacket, false, sig.PreferredSymmetric}) - } - - if len(sig.PreferredHash) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefHashAlgosSubpacket, false, sig.PreferredHash}) - } - - if len(sig.PreferredCompression) > 0 { - subpackets = append(subpackets, outputSubpacket{true, prefCompressionSubpacket, false, sig.PreferredCompression}) - } - - if len(sig.PolicyURI) > 0 { - subpackets = append(subpackets, outputSubpacket{true, policyUriSubpacket, false, []uint8(sig.PolicyURI)}) - } - - if len(sig.PreferredCipherSuites) > 0 { - serialized := make([]byte, len(sig.PreferredCipherSuites)*2) - for i, cipherSuite := range sig.PreferredCipherSuites { - serialized[2*i] = cipherSuite[0] - serialized[2*i+1] = cipherSuite[1] - } - subpackets = append(subpackets, outputSubpacket{true, prefCipherSuitesSubpacket, false, serialized}) - } - - // Revocation reason appears only in revocation signatures and is serialized as per section 5.2.3.23. - if sig.RevocationReason != nil { - subpackets = append(subpackets, outputSubpacket{true, reasonForRevocationSubpacket, true, - append([]uint8{uint8(*sig.RevocationReason)}, []uint8(sig.RevocationReasonText)...)}) - } - - // EmbeddedSignature appears only in subkeys capable of signing and is serialized as per section 5.2.3.26. - if sig.EmbeddedSignature != nil { - var buf bytes.Buffer - err = sig.EmbeddedSignature.serializeBody(&buf) - if err != nil { - return - } - subpackets = append(subpackets, outputSubpacket{true, embeddedSignatureSubpacket, true, buf.Bytes()}) - } - - return -} - -// AddMetadataToHashSuffix modifies the current hash suffix to include metadata -// (format, filename, and time). Version 5 keys protect this data including it -// in the hash computation. See section 5.2.4. -func (sig *Signature) AddMetadataToHashSuffix() { - if sig == nil || sig.Version != 5 { - return - } - if sig.SigType != 0x00 && sig.SigType != 0x01 { - return - } - lit := sig.Metadata - if lit == nil { - // This will translate into six 0x00 bytes. - lit = &LiteralData{} - } - - // Extract the current byte count - n := sig.HashSuffix[len(sig.HashSuffix)-8:] - l := uint64( - uint64(n[0])<<56 | uint64(n[1])<<48 | uint64(n[2])<<40 | uint64(n[3])<<32 | - uint64(n[4])<<24 | uint64(n[5])<<16 | uint64(n[6])<<8 | uint64(n[7])) - - suffix := bytes.NewBuffer(nil) - suffix.Write(sig.HashSuffix[:l]) - - // Add the metadata - var buf [4]byte - buf[0] = lit.Format - fileName := lit.FileName - if len(lit.FileName) > 255 { - fileName = fileName[:255] - } - buf[1] = byte(len(fileName)) - suffix.Write(buf[:2]) - suffix.Write([]byte(lit.FileName)) - binary.BigEndian.PutUint32(buf[:], lit.Time) - suffix.Write(buf[:]) - - // Update the counter and restore trailing bytes - l = uint64(suffix.Len()) - suffix.Write([]byte{0x05, 0xff}) - suffix.Write([]byte{ - uint8(l >> 56), uint8(l >> 48), uint8(l >> 40), uint8(l >> 32), - uint8(l >> 24), uint8(l >> 16), uint8(l >> 8), uint8(l), - }) - sig.HashSuffix = suffix.Bytes() -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go deleted file mode 100644 index bac2b132ea..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetric_key_encrypted.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "crypto/cipher" - "io" - "strconv" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/s2k" -) - -// This is the largest session key that we'll support. Since at most 256-bit cipher -// is supported in OpenPGP, this is large enough to contain also the auth tag. -const maxSessionKeySizeInBytes = 64 - -// SymmetricKeyEncrypted represents a passphrase protected session key. See RFC -// 4880, section 5.3. -type SymmetricKeyEncrypted struct { - Version int - CipherFunc CipherFunction - Mode AEADMode - s2k func(out, in []byte) - iv []byte - encryptedKey []byte // Contains also the authentication tag for AEAD -} - -// parse parses an SymmetricKeyEncrypted packet as specified in -// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#name-symmetric-key-encrypted-ses -func (ske *SymmetricKeyEncrypted) parse(r io.Reader) error { - var buf [1]byte - - // Version - if _, err := readFull(r, buf[:]); err != nil { - return err - } - ske.Version = int(buf[0]) - if ske.Version != 4 && ske.Version != 5 { - return errors.UnsupportedError("unknown SymmetricKeyEncrypted version") - } - - // Cipher function - if _, err := readFull(r, buf[:]); err != nil { - return err - } - ske.CipherFunc = CipherFunction(buf[0]) - if !ske.CipherFunc.IsSupported() { - return errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(buf[0]))) - } - - if ske.Version == 5 { - // AEAD mode - if _, err := readFull(r, buf[:]); err != nil { - return errors.StructuralError("cannot read AEAD octet from packet") - } - ske.Mode = AEADMode(buf[0]) - } - - var err error - if ske.s2k, err = s2k.Parse(r); err != nil { - if _, ok := err.(errors.ErrDummyPrivateKey); ok { - return errors.UnsupportedError("missing key GNU extension in session key") - } - return err - } - - if ske.Version == 5 { - // AEAD IV - iv := make([]byte, ske.Mode.IvLength()) - _, err := readFull(r, iv) - if err != nil { - return errors.StructuralError("cannot read AEAD IV") - } - - ske.iv = iv - } - - encryptedKey := make([]byte, maxSessionKeySizeInBytes) - // The session key may follow. We just have to try and read to find - // out. If it exists then we limit it to maxSessionKeySizeInBytes. - n, err := readFull(r, encryptedKey) - if err != nil && err != io.ErrUnexpectedEOF { - return err - } - - if n != 0 { - if n == maxSessionKeySizeInBytes { - return errors.UnsupportedError("oversized encrypted session key") - } - ske.encryptedKey = encryptedKey[:n] - } - return nil -} - -// Decrypt attempts to decrypt an encrypted session key and returns the key and -// the cipher to use when decrypting a subsequent Symmetrically Encrypted Data -// packet. -func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunction, error) { - key := make([]byte, ske.CipherFunc.KeySize()) - ske.s2k(key, passphrase) - if len(ske.encryptedKey) == 0 { - return key, ske.CipherFunc, nil - } - switch ske.Version { - case 4: - plaintextKey, cipherFunc, err := ske.decryptV4(key) - return plaintextKey, cipherFunc, err - case 5: - plaintextKey, err := ske.decryptV5(key) - return plaintextKey, CipherFunction(0), err - } - err := errors.UnsupportedError("unknown SymmetricKeyEncrypted version") - return nil, CipherFunction(0), err -} - -func (ske *SymmetricKeyEncrypted) decryptV4(key []byte) ([]byte, CipherFunction, error) { - // the IV is all zeros - iv := make([]byte, ske.CipherFunc.blockSize()) - c := cipher.NewCFBDecrypter(ske.CipherFunc.new(key), iv) - plaintextKey := make([]byte, len(ske.encryptedKey)) - c.XORKeyStream(plaintextKey, ske.encryptedKey) - cipherFunc := CipherFunction(plaintextKey[0]) - if cipherFunc.blockSize() == 0 { - return nil, ske.CipherFunc, errors.UnsupportedError( - "unknown cipher: " + strconv.Itoa(int(cipherFunc))) - } - plaintextKey = plaintextKey[1:] - if len(plaintextKey) != cipherFunc.KeySize() { - return nil, cipherFunc, errors.StructuralError( - "length of decrypted key not equal to cipher keysize") - } - return plaintextKey, cipherFunc, nil -} - -func (ske *SymmetricKeyEncrypted) decryptV5(key []byte) ([]byte, error) { - adata := []byte{0xc3, byte(5), byte(ske.CipherFunc), byte(ske.Mode)} - aead := getEncryptedKeyAeadInstance(ske.CipherFunc, ske.Mode, key, adata) - - plaintextKey, err := aead.Open(nil, ske.iv, ske.encryptedKey, adata) - if err != nil { - return nil, err - } - return plaintextKey, nil -} - -// SerializeSymmetricKeyEncrypted serializes a symmetric key packet to w. -// The packet contains a random session key, encrypted by a key derived from -// the given passphrase. The session key is returned and must be passed to -// SerializeSymmetricallyEncrypted. -// If config is nil, sensible defaults will be used. -func SerializeSymmetricKeyEncrypted(w io.Writer, passphrase []byte, config *Config) (key []byte, err error) { - cipherFunc := config.Cipher() - - sessionKey := make([]byte, cipherFunc.KeySize()) - _, err = io.ReadFull(config.Random(), sessionKey) - if err != nil { - return - } - - err = SerializeSymmetricKeyEncryptedReuseKey(w, sessionKey, passphrase, config) - if err != nil { - return - } - - key = sessionKey - return -} - -// SerializeSymmetricKeyEncryptedReuseKey serializes a symmetric key packet to w. -// The packet contains the given session key, encrypted by a key derived from -// the given passphrase. The returned session key must be passed to -// SerializeSymmetricallyEncrypted. -// If config is nil, sensible defaults will be used. -func SerializeSymmetricKeyEncryptedReuseKey(w io.Writer, sessionKey []byte, passphrase []byte, config *Config) (err error) { - var version int - if config.AEAD() != nil { - version = 5 - } else { - version = 4 - } - cipherFunc := config.Cipher() - // cipherFunc must be AES - if !cipherFunc.IsSupported() || cipherFunc < CipherAES128 || cipherFunc > CipherAES256 { - return errors.UnsupportedError("unsupported cipher: " + strconv.Itoa(int(cipherFunc))) - } - - keySize := cipherFunc.KeySize() - s2kBuf := new(bytes.Buffer) - keyEncryptingKey := make([]byte, keySize) - // s2k.Serialize salts and stretches the passphrase, and writes the - // resulting key to keyEncryptingKey and the s2k descriptor to s2kBuf. - err = s2k.Serialize(s2kBuf, keyEncryptingKey, config.Random(), passphrase, config.S2K()) - if err != nil { - return - } - s2kBytes := s2kBuf.Bytes() - - var packetLength int - switch version { - case 4: - packetLength = 2 /* header */ + len(s2kBytes) + 1 /* cipher type */ + keySize - case 5: - ivLen := config.AEAD().Mode().IvLength() - tagLen := config.AEAD().Mode().TagLength() - packetLength = 3 + len(s2kBytes) + ivLen + keySize + tagLen - } - err = serializeHeader(w, packetTypeSymmetricKeyEncrypted, packetLength) - if err != nil { - return - } - - // Symmetric Key Encrypted Version - buf := []byte{byte(version)} - - // Cipher function - buf = append(buf, byte(cipherFunc)) - - if version == 5 { - // AEAD mode - buf = append(buf, byte(config.AEAD().Mode())) - } - _, err = w.Write(buf) - if err != nil { - return - } - _, err = w.Write(s2kBytes) - if err != nil { - return - } - - switch version { - case 4: - iv := make([]byte, cipherFunc.blockSize()) - c := cipher.NewCFBEncrypter(cipherFunc.new(keyEncryptingKey), iv) - encryptedCipherAndKey := make([]byte, keySize+1) - c.XORKeyStream(encryptedCipherAndKey, buf[1:]) - c.XORKeyStream(encryptedCipherAndKey[1:], sessionKey) - _, err = w.Write(encryptedCipherAndKey) - if err != nil { - return - } - case 5: - mode := config.AEAD().Mode() - adata := []byte{0xc3, byte(5), byte(cipherFunc), byte(mode)} - aead := getEncryptedKeyAeadInstance(cipherFunc, mode, keyEncryptingKey, adata) - - // Sample iv using random reader - iv := make([]byte, config.AEAD().Mode().IvLength()) - _, err = io.ReadFull(config.Random(), iv) - if err != nil { - return - } - // Seal and write (encryptedData includes auth. tag) - - encryptedData := aead.Seal(nil, iv, sessionKey, adata) - _, err = w.Write(iv) - if err != nil { - return - } - _, err = w.Write(encryptedData) - if err != nil { - return - } - } - - return -} - -func getEncryptedKeyAeadInstance(c CipherFunction, mode AEADMode, inputKey, associatedData []byte) (aead cipher.AEAD) { - blockCipher := c.new(inputKey) - return mode.new(blockCipher) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go deleted file mode 100644 index e9bbf0327e..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -const aeadSaltSize = 32 - -// SymmetricallyEncrypted represents a symmetrically encrypted byte string. The -// encrypted Contents will consist of more OpenPGP packets. See RFC 4880, -// sections 5.7 and 5.13. -type SymmetricallyEncrypted struct { - Version int - Contents io.Reader // contains tag for version 2 - IntegrityProtected bool // If true it is type 18 (with MDC or AEAD). False is packet type 9 - - // Specific to version 1 - prefix []byte - - // Specific to version 2 - Cipher CipherFunction - Mode AEADMode - ChunkSizeByte byte - Salt [aeadSaltSize]byte -} - -const ( - symmetricallyEncryptedVersionMdc = 1 - symmetricallyEncryptedVersionAead = 2 -) - -func (se *SymmetricallyEncrypted) parse(r io.Reader) error { - if se.IntegrityProtected { - // See RFC 4880, section 5.13. - var buf [1]byte - _, err := readFull(r, buf[:]) - if err != nil { - return err - } - - switch buf[0] { - case symmetricallyEncryptedVersionMdc: - se.Version = symmetricallyEncryptedVersionMdc - case symmetricallyEncryptedVersionAead: - se.Version = symmetricallyEncryptedVersionAead - if err := se.parseAead(r); err != nil { - return err - } - default: - return errors.UnsupportedError("unknown SymmetricallyEncrypted version") - } - } - se.Contents = r - return nil -} - -// Decrypt returns a ReadCloser, from which the decrypted Contents of the -// packet can be read. An incorrect key will only be detected after trying -// to decrypt the entire data. -func (se *SymmetricallyEncrypted) Decrypt(c CipherFunction, key []byte) (io.ReadCloser, error) { - if se.Version == symmetricallyEncryptedVersionAead { - return se.decryptAead(key) - } - - return se.decryptMdc(c, key) -} - -// SerializeSymmetricallyEncrypted serializes a symmetrically encrypted packet -// to w and returns a WriteCloser to which the to-be-encrypted packets can be -// written. -// If config is nil, sensible defaults will be used. -func SerializeSymmetricallyEncrypted(w io.Writer, c CipherFunction, aeadSupported bool, cipherSuite CipherSuite, key []byte, config *Config) (Contents io.WriteCloser, err error) { - writeCloser := noOpCloser{w} - ciphertext, err := serializeStreamHeader(writeCloser, packetTypeSymmetricallyEncryptedIntegrityProtected) - if err != nil { - return - } - - if aeadSupported { - return serializeSymmetricallyEncryptedAead(ciphertext, cipherSuite, config.AEADConfig.ChunkSizeByte(), config.Random(), key) - } - - return serializeSymmetricallyEncryptedMdc(ciphertext, c, key, config) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go deleted file mode 100644 index e96252c196..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_aead.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2023 Proton AG. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto/cipher" - "crypto/sha256" - "io" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - "golang.org/x/crypto/hkdf" -) - -// parseAead parses a V2 SEIPD packet (AEAD) as specified in -// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2 -func (se *SymmetricallyEncrypted) parseAead(r io.Reader) error { - headerData := make([]byte, 3) - if n, err := io.ReadFull(r, headerData); n < 3 { - return errors.StructuralError("could not read aead header: " + err.Error()) - } - - // Cipher - se.Cipher = CipherFunction(headerData[0]) - // cipherFunc must have block size 16 to use AEAD - if se.Cipher.blockSize() != 16 { - return errors.UnsupportedError("invalid aead cipher: " + string(se.Cipher)) - } - - // Mode - se.Mode = AEADMode(headerData[1]) - if se.Mode.TagLength() == 0 { - return errors.UnsupportedError("unknown aead mode: " + string(se.Mode)) - } - - // Chunk size - se.ChunkSizeByte = headerData[2] - if se.ChunkSizeByte > 16 { - return errors.UnsupportedError("invalid aead chunk size byte: " + string(se.ChunkSizeByte)) - } - - // Salt - if n, err := io.ReadFull(r, se.Salt[:]); n < aeadSaltSize { - return errors.StructuralError("could not read aead salt: " + err.Error()) - } - - return nil -} - -// associatedData for chunks: tag, version, cipher, mode, chunk size byte -func (se *SymmetricallyEncrypted) associatedData() []byte { - return []byte{ - 0xD2, - symmetricallyEncryptedVersionAead, - byte(se.Cipher), - byte(se.Mode), - se.ChunkSizeByte, - } -} - -// decryptAead decrypts a V2 SEIPD packet (AEAD) as specified in -// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2 -func (se *SymmetricallyEncrypted) decryptAead(inputKey []byte) (io.ReadCloser, error) { - aead, nonce := getSymmetricallyEncryptedAeadInstance(se.Cipher, se.Mode, inputKey, se.Salt[:], se.associatedData()) - - // Carry the first tagLen bytes - tagLen := se.Mode.TagLength() - peekedBytes := make([]byte, tagLen) - n, err := io.ReadFull(se.Contents, peekedBytes) - if n < tagLen || (err != nil && err != io.EOF) { - return nil, errors.StructuralError("not enough data to decrypt:" + err.Error()) - } - - return &aeadDecrypter{ - aeadCrypter: aeadCrypter{ - aead: aead, - chunkSize: decodeAEADChunkSize(se.ChunkSizeByte), - initialNonce: nonce, - associatedData: se.associatedData(), - chunkIndex: make([]byte, 8), - packetTag: packetTypeSymmetricallyEncryptedIntegrityProtected, - }, - reader: se.Contents, - peekedBytes: peekedBytes, - }, nil -} - -// serializeSymmetricallyEncryptedAead encrypts to a writer a V2 SEIPD packet (AEAD) as specified in -// https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-5.13.2 -func serializeSymmetricallyEncryptedAead(ciphertext io.WriteCloser, cipherSuite CipherSuite, chunkSizeByte byte, rand io.Reader, inputKey []byte) (Contents io.WriteCloser, err error) { - // cipherFunc must have block size 16 to use AEAD - if cipherSuite.Cipher.blockSize() != 16 { - return nil, errors.InvalidArgumentError("invalid aead cipher function") - } - - if cipherSuite.Cipher.KeySize() != len(inputKey) { - return nil, errors.InvalidArgumentError("error in aead serialization: bad key length") - } - - // Data for en/decryption: tag, version, cipher, aead mode, chunk size - prefix := []byte{ - 0xD2, - symmetricallyEncryptedVersionAead, - byte(cipherSuite.Cipher), - byte(cipherSuite.Mode), - chunkSizeByte, - } - - // Write header (that correspond to prefix except first byte) - n, err := ciphertext.Write(prefix[1:]) - if err != nil || n < 4 { - return nil, err - } - - // Random salt - salt := make([]byte, aeadSaltSize) - if _, err := rand.Read(salt); err != nil { - return nil, err - } - - if _, err := ciphertext.Write(salt); err != nil { - return nil, err - } - - aead, nonce := getSymmetricallyEncryptedAeadInstance(cipherSuite.Cipher, cipherSuite.Mode, inputKey, salt, prefix) - - return &aeadEncrypter{ - aeadCrypter: aeadCrypter{ - aead: aead, - chunkSize: decodeAEADChunkSize(chunkSizeByte), - associatedData: prefix, - chunkIndex: make([]byte, 8), - initialNonce: nonce, - packetTag: packetTypeSymmetricallyEncryptedIntegrityProtected, - }, - writer: ciphertext, - }, nil -} - -func getSymmetricallyEncryptedAeadInstance(c CipherFunction, mode AEADMode, inputKey, salt, associatedData []byte) (aead cipher.AEAD, nonce []byte) { - hkdfReader := hkdf.New(sha256.New, inputKey, salt, associatedData) - - encryptionKey := make([]byte, c.KeySize()) - _, _ = readFull(hkdfReader, encryptionKey) - - // Last 64 bits of nonce are the counter - nonce = make([]byte, mode.IvLength()-8) - - _, _ = readFull(hkdfReader, nonce) - - blockCipher := c.new(encryptionKey) - aead = mode.new(blockCipher) - - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go deleted file mode 100644 index fa26bebe38..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/symmetrically_encrypted_mdc.go +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "crypto/cipher" - "crypto/sha1" - "crypto/subtle" - "hash" - "io" - "strconv" - - "github.com/ProtonMail/go-crypto/openpgp/errors" -) - -// seMdcReader wraps an io.Reader with a no-op Close method. -type seMdcReader struct { - in io.Reader -} - -func (ser seMdcReader) Read(buf []byte) (int, error) { - return ser.in.Read(buf) -} - -func (ser seMdcReader) Close() error { - return nil -} - -func (se *SymmetricallyEncrypted) decryptMdc(c CipherFunction, key []byte) (io.ReadCloser, error) { - if !c.IsSupported() { - return nil, errors.UnsupportedError("unsupported cipher: " + strconv.Itoa(int(c))) - } - - if len(key) != c.KeySize() { - return nil, errors.InvalidArgumentError("SymmetricallyEncrypted: incorrect key length") - } - - if se.prefix == nil { - se.prefix = make([]byte, c.blockSize()+2) - _, err := readFull(se.Contents, se.prefix) - if err != nil { - return nil, err - } - } else if len(se.prefix) != c.blockSize()+2 { - return nil, errors.InvalidArgumentError("can't try ciphers with different block lengths") - } - - ocfbResync := OCFBResync - if se.IntegrityProtected { - // MDC packets use a different form of OCFB mode. - ocfbResync = OCFBNoResync - } - - s := NewOCFBDecrypter(c.new(key), se.prefix, ocfbResync) - - plaintext := cipher.StreamReader{S: s, R: se.Contents} - - if se.IntegrityProtected { - // IntegrityProtected packets have an embedded hash that we need to check. - h := sha1.New() - h.Write(se.prefix) - return &seMDCReader{in: plaintext, h: h}, nil - } - - // Otherwise, we just need to wrap plaintext so that it's a valid ReadCloser. - return seMdcReader{plaintext}, nil -} - -const mdcTrailerSize = 1 /* tag byte */ + 1 /* length byte */ + sha1.Size - -// An seMDCReader wraps an io.Reader, maintains a running hash and keeps hold -// of the most recent 22 bytes (mdcTrailerSize). Upon EOF, those bytes form an -// MDC packet containing a hash of the previous Contents which is checked -// against the running hash. See RFC 4880, section 5.13. -type seMDCReader struct { - in io.Reader - h hash.Hash - trailer [mdcTrailerSize]byte - scratch [mdcTrailerSize]byte - trailerUsed int - error bool - eof bool -} - -func (ser *seMDCReader) Read(buf []byte) (n int, err error) { - if ser.error { - err = io.ErrUnexpectedEOF - return - } - if ser.eof { - err = io.EOF - return - } - - // If we haven't yet filled the trailer buffer then we must do that - // first. - for ser.trailerUsed < mdcTrailerSize { - n, err = ser.in.Read(ser.trailer[ser.trailerUsed:]) - ser.trailerUsed += n - if err == io.EOF { - if ser.trailerUsed != mdcTrailerSize { - n = 0 - err = io.ErrUnexpectedEOF - ser.error = true - return - } - ser.eof = true - n = 0 - return - } - - if err != nil { - n = 0 - return - } - } - - // If it's a short read then we read into a temporary buffer and shift - // the data into the caller's buffer. - if len(buf) <= mdcTrailerSize { - n, err = readFull(ser.in, ser.scratch[:len(buf)]) - copy(buf, ser.trailer[:n]) - ser.h.Write(buf[:n]) - copy(ser.trailer[:], ser.trailer[n:]) - copy(ser.trailer[mdcTrailerSize-n:], ser.scratch[:]) - if n < len(buf) { - ser.eof = true - err = io.EOF - } - return - } - - n, err = ser.in.Read(buf[mdcTrailerSize:]) - copy(buf, ser.trailer[:]) - ser.h.Write(buf[:n]) - copy(ser.trailer[:], buf[n:]) - - if err == io.EOF { - ser.eof = true - } - return -} - -// This is a new-format packet tag byte for a type 19 (Integrity Protected) packet. -const mdcPacketTagByte = byte(0x80) | 0x40 | 19 - -func (ser *seMDCReader) Close() error { - if ser.error { - return errors.ErrMDCMissing - } - - for !ser.eof { - // We haven't seen EOF so we need to read to the end - var buf [1024]byte - _, err := ser.Read(buf[:]) - if err == io.EOF { - break - } - if err != nil { - return errors.ErrMDCMissing - } - } - - ser.h.Write(ser.trailer[:2]) - - final := ser.h.Sum(nil) - if subtle.ConstantTimeCompare(final, ser.trailer[2:]) != 1 { - return errors.ErrMDCHashMismatch - } - // The hash already includes the MDC header, but we still check its value - // to confirm encryption correctness - if ser.trailer[0] != mdcPacketTagByte || ser.trailer[1] != sha1.Size { - return errors.ErrMDCMissing - } - return nil -} - -// An seMDCWriter writes through to an io.WriteCloser while maintains a running -// hash of the data written. On close, it emits an MDC packet containing the -// running hash. -type seMDCWriter struct { - w io.WriteCloser - h hash.Hash -} - -func (w *seMDCWriter) Write(buf []byte) (n int, err error) { - w.h.Write(buf) - return w.w.Write(buf) -} - -func (w *seMDCWriter) Close() (err error) { - var buf [mdcTrailerSize]byte - - buf[0] = mdcPacketTagByte - buf[1] = sha1.Size - w.h.Write(buf[:2]) - digest := w.h.Sum(nil) - copy(buf[2:], digest) - - _, err = w.w.Write(buf[:]) - if err != nil { - return - } - return w.w.Close() -} - -// noOpCloser is like an ioutil.NopCloser, but for an io.Writer. -type noOpCloser struct { - w io.Writer -} - -func (c noOpCloser) Write(data []byte) (n int, err error) { - return c.w.Write(data) -} - -func (c noOpCloser) Close() error { - return nil -} - -func serializeSymmetricallyEncryptedMdc(ciphertext io.WriteCloser, c CipherFunction, key []byte, config *Config) (Contents io.WriteCloser, err error) { - // Disallow old cipher suites - if !c.IsSupported() || c < CipherAES128 { - return nil, errors.InvalidArgumentError("invalid mdc cipher function") - } - - if c.KeySize() != len(key) { - return nil, errors.InvalidArgumentError("error in mdc serialization: bad key length") - } - - _, err = ciphertext.Write([]byte{symmetricallyEncryptedVersionMdc}) - if err != nil { - return - } - - block := c.new(key) - blockSize := block.BlockSize() - iv := make([]byte, blockSize) - _, err = config.Random().Read(iv) - if err != nil { - return - } - s, prefix := NewOCFBEncrypter(block, iv, OCFBNoResync) - _, err = ciphertext.Write(prefix) - if err != nil { - return - } - plaintext := cipher.StreamWriter{S: s, W: ciphertext} - - h := sha1.New() - h.Write(iv) - h.Write(iv[blockSize-2:]) - Contents = &seMDCWriter{w: plaintext, h: h} - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go deleted file mode 100644 index 88ec72c6c4..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userattribute.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "bytes" - "image" - "image/jpeg" - "io" - "io/ioutil" -) - -const UserAttrImageSubpacket = 1 - -// UserAttribute is capable of storing other types of data about a user -// beyond name, email and a text comment. In practice, user attributes are typically used -// to store a signed thumbnail photo JPEG image of the user. -// See RFC 4880, section 5.12. -type UserAttribute struct { - Contents []*OpaqueSubpacket -} - -// NewUserAttributePhoto creates a user attribute packet -// containing the given images. -func NewUserAttributePhoto(photos ...image.Image) (uat *UserAttribute, err error) { - uat = new(UserAttribute) - for _, photo := range photos { - var buf bytes.Buffer - // RFC 4880, Section 5.12.1. - data := []byte{ - 0x10, 0x00, // Little-endian image header length (16 bytes) - 0x01, // Image header version 1 - 0x01, // JPEG - 0, 0, 0, 0, // 12 reserved octets, must be all zero. - 0, 0, 0, 0, - 0, 0, 0, 0} - if _, err = buf.Write(data); err != nil { - return - } - if err = jpeg.Encode(&buf, photo, nil); err != nil { - return - } - - lengthBuf := make([]byte, 5) - n := serializeSubpacketLength(lengthBuf, len(buf.Bytes())+1) - lengthBuf = lengthBuf[:n] - - uat.Contents = append(uat.Contents, &OpaqueSubpacket{ - SubType: UserAttrImageSubpacket, - EncodedLength: lengthBuf, - Contents: buf.Bytes(), - }) - } - return -} - -// NewUserAttribute creates a new user attribute packet containing the given subpackets. -func NewUserAttribute(contents ...*OpaqueSubpacket) *UserAttribute { - return &UserAttribute{Contents: contents} -} - -func (uat *UserAttribute) parse(r io.Reader) (err error) { - // RFC 4880, section 5.13 - b, err := ioutil.ReadAll(r) - if err != nil { - return - } - uat.Contents, err = OpaqueSubpackets(b) - return -} - -// Serialize marshals the user attribute to w in the form of an OpenPGP packet, including -// header. -func (uat *UserAttribute) Serialize(w io.Writer) (err error) { - var buf bytes.Buffer - for _, sp := range uat.Contents { - err = sp.Serialize(&buf) - if err != nil { - return err - } - } - if err = serializeHeader(w, packetTypeUserAttribute, buf.Len()); err != nil { - return err - } - _, err = w.Write(buf.Bytes()) - return -} - -// ImageData returns zero or more byte slices, each containing -// JPEG File Interchange Format (JFIF), for each photo in the -// user attribute packet. -func (uat *UserAttribute) ImageData() (imageData [][]byte) { - for _, sp := range uat.Contents { - if sp.SubType == UserAttrImageSubpacket && len(sp.Contents) > 16 { - imageData = append(imageData, sp.Contents[16:]) - } - } - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go deleted file mode 100644 index 614fbafd5e..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/packet/userid.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package packet - -import ( - "io" - "io/ioutil" - "strings" -) - -// UserId contains text that is intended to represent the name and email -// address of the key holder. See RFC 4880, section 5.11. By convention, this -// takes the form "Full Name (Comment) " -type UserId struct { - Id string // By convention, this takes the form "Full Name (Comment) " which is split out in the fields below. - - Name, Comment, Email string -} - -func hasInvalidCharacters(s string) bool { - for _, c := range s { - switch c { - case '(', ')', '<', '>', 0: - return true - } - } - return false -} - -// NewUserId returns a UserId or nil if any of the arguments contain invalid -// characters. The invalid characters are '\x00', '(', ')', '<' and '>' -func NewUserId(name, comment, email string) *UserId { - // RFC 4880 doesn't deal with the structure of userid strings; the - // name, comment and email form is just a convention. However, there's - // no convention about escaping the metacharacters and GPG just refuses - // to create user ids where, say, the name contains a '('. We mirror - // this behaviour. - - if hasInvalidCharacters(name) || hasInvalidCharacters(comment) || hasInvalidCharacters(email) { - return nil - } - - uid := new(UserId) - uid.Name, uid.Comment, uid.Email = name, comment, email - uid.Id = name - if len(comment) > 0 { - if len(uid.Id) > 0 { - uid.Id += " " - } - uid.Id += "(" - uid.Id += comment - uid.Id += ")" - } - if len(email) > 0 { - if len(uid.Id) > 0 { - uid.Id += " " - } - uid.Id += "<" - uid.Id += email - uid.Id += ">" - } - return uid -} - -func (uid *UserId) parse(r io.Reader) (err error) { - // RFC 4880, section 5.11 - b, err := ioutil.ReadAll(r) - if err != nil { - return - } - uid.Id = string(b) - uid.Name, uid.Comment, uid.Email = parseUserId(uid.Id) - return -} - -// Serialize marshals uid to w in the form of an OpenPGP packet, including -// header. -func (uid *UserId) Serialize(w io.Writer) error { - err := serializeHeader(w, packetTypeUserId, len(uid.Id)) - if err != nil { - return err - } - _, err = w.Write([]byte(uid.Id)) - return err -} - -// parseUserId extracts the name, comment and email from a user id string that -// is formatted as "Full Name (Comment) ". -func parseUserId(id string) (name, comment, email string) { - var n, c, e struct { - start, end int - } - var state int - - for offset, rune := range id { - switch state { - case 0: - // Entering name - n.start = offset - state = 1 - fallthrough - case 1: - // In name - if rune == '(' { - state = 2 - n.end = offset - } else if rune == '<' { - state = 5 - n.end = offset - } - case 2: - // Entering comment - c.start = offset - state = 3 - fallthrough - case 3: - // In comment - if rune == ')' { - state = 4 - c.end = offset - } - case 4: - // Between comment and email - if rune == '<' { - state = 5 - } - case 5: - // Entering email - e.start = offset - state = 6 - fallthrough - case 6: - // In email - if rune == '>' { - state = 7 - e.end = offset - } - default: - // After email - } - } - switch state { - case 1: - // ended in the name - n.end = len(id) - case 3: - // ended in comment - c.end = len(id) - case 6: - // ended in email - e.end = len(id) - } - - name = strings.TrimSpace(id[n.start:n.end]) - comment = strings.TrimSpace(id[c.start:c.end]) - email = strings.TrimSpace(id[e.start:e.end]) - - // RFC 2822 3.4: alternate simple form of a mailbox - if email == "" && strings.ContainsRune(name, '@') { - email = name - name = "" - } - - return -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go deleted file mode 100644 index 8499c73790..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/read.go +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package openpgp implements high level operations on OpenPGP messages. -package openpgp // import "github.com/ProtonMail/go-crypto/openpgp" - -import ( - "crypto" - _ "crypto/sha256" - _ "crypto/sha512" - "hash" - "io" - "strconv" - - "github.com/ProtonMail/go-crypto/openpgp/armor" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/packet" - _ "golang.org/x/crypto/sha3" -) - -// SignatureType is the armor type for a PGP signature. -var SignatureType = "PGP SIGNATURE" - -// readArmored reads an armored block with the given type. -func readArmored(r io.Reader, expectedType string) (body io.Reader, err error) { - block, err := armor.Decode(r) - if err != nil { - return - } - - if block.Type != expectedType { - return nil, errors.InvalidArgumentError("expected '" + expectedType + "', got: " + block.Type) - } - - return block.Body, nil -} - -// MessageDetails contains the result of parsing an OpenPGP encrypted and/or -// signed message. -type MessageDetails struct { - IsEncrypted bool // true if the message was encrypted. - EncryptedToKeyIds []uint64 // the list of recipient key ids. - IsSymmetricallyEncrypted bool // true if a passphrase could have decrypted the message. - DecryptedWith Key // the private key used to decrypt the message, if any. - IsSigned bool // true if the message is signed. - SignedByKeyId uint64 // the key id of the signer, if any. - SignedBy *Key // the key of the signer, if available. - LiteralData *packet.LiteralData // the metadata of the contents - UnverifiedBody io.Reader // the contents of the message. - - // If IsSigned is true and SignedBy is non-zero then the signature will - // be verified as UnverifiedBody is read. The signature cannot be - // checked until the whole of UnverifiedBody is read so UnverifiedBody - // must be consumed until EOF before the data can be trusted. Even if a - // message isn't signed (or the signer is unknown) the data may contain - // an authentication code that is only checked once UnverifiedBody has - // been consumed. Once EOF has been seen, the following fields are - // valid. (An authentication code failure is reported as a - // SignatureError error when reading from UnverifiedBody.) - Signature *packet.Signature // the signature packet itself. - SignatureError error // nil if the signature is good. - UnverifiedSignatures []*packet.Signature // all other unverified signature packets. - - decrypted io.ReadCloser -} - -// A PromptFunction is used as a callback by functions that may need to decrypt -// a private key, or prompt for a passphrase. It is called with a list of -// acceptable, encrypted private keys and a boolean that indicates whether a -// passphrase is usable. It should either decrypt a private key or return a -// passphrase to try. If the decrypted private key or given passphrase isn't -// correct, the function will be called again, forever. Any error returned will -// be passed up. -type PromptFunction func(keys []Key, symmetric bool) ([]byte, error) - -// A keyEnvelopePair is used to store a private key with the envelope that -// contains a symmetric key, encrypted with that key. -type keyEnvelopePair struct { - key Key - encryptedKey *packet.EncryptedKey -} - -// ReadMessage parses an OpenPGP message that may be signed and/or encrypted. -// The given KeyRing should contain both public keys (for signature -// verification) and, possibly encrypted, private keys for decrypting. -// If config is nil, sensible defaults will be used. -func ReadMessage(r io.Reader, keyring KeyRing, prompt PromptFunction, config *packet.Config) (md *MessageDetails, err error) { - var p packet.Packet - - var symKeys []*packet.SymmetricKeyEncrypted - var pubKeys []keyEnvelopePair - // Integrity protected encrypted packet: SymmetricallyEncrypted or AEADEncrypted - var edp packet.EncryptedDataPacket - - packets := packet.NewReader(r) - md = new(MessageDetails) - md.IsEncrypted = true - - // The message, if encrypted, starts with a number of packets - // containing an encrypted decryption key. The decryption key is either - // encrypted to a public key, or with a passphrase. This loop - // collects these packets. -ParsePackets: - for { - p, err = packets.Next() - if err != nil { - return nil, err - } - switch p := p.(type) { - case *packet.SymmetricKeyEncrypted: - // This packet contains the decryption key encrypted with a passphrase. - md.IsSymmetricallyEncrypted = true - symKeys = append(symKeys, p) - case *packet.EncryptedKey: - // This packet contains the decryption key encrypted to a public key. - md.EncryptedToKeyIds = append(md.EncryptedToKeyIds, p.KeyId) - switch p.Algo { - case packet.PubKeyAlgoRSA, packet.PubKeyAlgoRSAEncryptOnly, packet.PubKeyAlgoElGamal, packet.PubKeyAlgoECDH: - break - default: - continue - } - if keyring != nil { - var keys []Key - if p.KeyId == 0 { - keys = keyring.DecryptionKeys() - } else { - keys = keyring.KeysById(p.KeyId) - } - for _, k := range keys { - pubKeys = append(pubKeys, keyEnvelopePair{k, p}) - } - } - case *packet.SymmetricallyEncrypted: - if !p.IntegrityProtected && !config.AllowUnauthenticatedMessages() { - return nil, errors.UnsupportedError("message is not integrity protected") - } - edp = p - break ParsePackets - case *packet.AEADEncrypted: - edp = p - break ParsePackets - case *packet.Compressed, *packet.LiteralData, *packet.OnePassSignature: - // This message isn't encrypted. - if len(symKeys) != 0 || len(pubKeys) != 0 { - return nil, errors.StructuralError("key material not followed by encrypted message") - } - packets.Unread(p) - return readSignedMessage(packets, nil, keyring, config) - } - } - - var candidates []Key - var decrypted io.ReadCloser - - // Now that we have the list of encrypted keys we need to decrypt at - // least one of them or, if we cannot, we need to call the prompt - // function so that it can decrypt a key or give us a passphrase. -FindKey: - for { - // See if any of the keys already have a private key available - candidates = candidates[:0] - candidateFingerprints := make(map[string]bool) - - for _, pk := range pubKeys { - if pk.key.PrivateKey == nil { - continue - } - if !pk.key.PrivateKey.Encrypted { - if len(pk.encryptedKey.Key) == 0 { - errDec := pk.encryptedKey.Decrypt(pk.key.PrivateKey, config) - if errDec != nil { - continue - } - } - // Try to decrypt symmetrically encrypted - decrypted, err = edp.Decrypt(pk.encryptedKey.CipherFunc, pk.encryptedKey.Key) - if err != nil && err != errors.ErrKeyIncorrect { - return nil, err - } - if decrypted != nil { - md.DecryptedWith = pk.key - break FindKey - } - } else { - fpr := string(pk.key.PublicKey.Fingerprint[:]) - if v := candidateFingerprints[fpr]; v { - continue - } - candidates = append(candidates, pk.key) - candidateFingerprints[fpr] = true - } - } - - if len(candidates) == 0 && len(symKeys) == 0 { - return nil, errors.ErrKeyIncorrect - } - - if prompt == nil { - return nil, errors.ErrKeyIncorrect - } - - passphrase, err := prompt(candidates, len(symKeys) != 0) - if err != nil { - return nil, err - } - - // Try the symmetric passphrase first - if len(symKeys) != 0 && passphrase != nil { - for _, s := range symKeys { - key, cipherFunc, err := s.Decrypt(passphrase) - // In v4, on wrong passphrase, session key decryption is very likely to result in an invalid cipherFunc: - // only for < 5% of cases we will proceed to decrypt the data - if err == nil { - decrypted, err = edp.Decrypt(cipherFunc, key) - if err != nil { - return nil, err - } - if decrypted != nil { - break FindKey - } - } - } - } - } - - md.decrypted = decrypted - if err := packets.Push(decrypted); err != nil { - return nil, err - } - mdFinal, sensitiveParsingErr := readSignedMessage(packets, md, keyring, config) - if sensitiveParsingErr != nil { - return nil, errors.StructuralError("parsing error") - } - return mdFinal, nil -} - -// readSignedMessage reads a possibly signed message if mdin is non-zero then -// that structure is updated and returned. Otherwise a fresh MessageDetails is -// used. -func readSignedMessage(packets *packet.Reader, mdin *MessageDetails, keyring KeyRing, config *packet.Config) (md *MessageDetails, err error) { - if mdin == nil { - mdin = new(MessageDetails) - } - md = mdin - - var p packet.Packet - var h hash.Hash - var wrappedHash hash.Hash - var prevLast bool -FindLiteralData: - for { - p, err = packets.Next() - if err != nil { - return nil, err - } - switch p := p.(type) { - case *packet.Compressed: - if err := packets.Push(p.Body); err != nil { - return nil, err - } - case *packet.OnePassSignature: - if prevLast { - return nil, errors.UnsupportedError("nested signature packets") - } - - if p.IsLast { - prevLast = true - } - - h, wrappedHash, err = hashForSignature(p.Hash, p.SigType) - if err != nil { - md.SignatureError = err - } - - md.IsSigned = true - md.SignedByKeyId = p.KeyId - if keyring != nil { - keys := keyring.KeysByIdUsage(p.KeyId, packet.KeyFlagSign) - if len(keys) > 0 { - md.SignedBy = &keys[0] - } - } - case *packet.LiteralData: - md.LiteralData = p - break FindLiteralData - } - } - - if md.IsSigned && md.SignatureError == nil { - md.UnverifiedBody = &signatureCheckReader{packets, h, wrappedHash, md, config} - } else if md.decrypted != nil { - md.UnverifiedBody = checkReader{md} - } else { - md.UnverifiedBody = md.LiteralData.Body - } - - return md, nil -} - -// hashForSignature returns a pair of hashes that can be used to verify a -// signature. The signature may specify that the contents of the signed message -// should be preprocessed (i.e. to normalize line endings). Thus this function -// returns two hashes. The second should be used to hash the message itself and -// performs any needed preprocessing. -func hashForSignature(hashFunc crypto.Hash, sigType packet.SignatureType) (hash.Hash, hash.Hash, error) { - if _, ok := algorithm.HashToHashIdWithSha1(hashFunc); !ok { - return nil, nil, errors.UnsupportedError("unsupported hash function") - } - if !hashFunc.Available() { - return nil, nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashFunc))) - } - h := hashFunc.New() - - switch sigType { - case packet.SigTypeBinary: - return h, h, nil - case packet.SigTypeText: - return h, NewCanonicalTextHash(h), nil - } - - return nil, nil, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(sigType))) -} - -// checkReader wraps an io.Reader from a LiteralData packet. When it sees EOF -// it closes the ReadCloser from any SymmetricallyEncrypted packet to trigger -// MDC checks. -type checkReader struct { - md *MessageDetails -} - -func (cr checkReader) Read(buf []byte) (int, error) { - n, sensitiveParsingError := cr.md.LiteralData.Body.Read(buf) - if sensitiveParsingError == io.EOF { - mdcErr := cr.md.decrypted.Close() - if mdcErr != nil { - return n, mdcErr - } - return n, io.EOF - } - - if sensitiveParsingError != nil { - return n, errors.StructuralError("parsing error") - } - - return n, nil -} - -// signatureCheckReader wraps an io.Reader from a LiteralData packet and hashes -// the data as it is read. When it sees an EOF from the underlying io.Reader -// it parses and checks a trailing Signature packet and triggers any MDC checks. -type signatureCheckReader struct { - packets *packet.Reader - h, wrappedHash hash.Hash - md *MessageDetails - config *packet.Config -} - -func (scr *signatureCheckReader) Read(buf []byte) (int, error) { - n, sensitiveParsingError := scr.md.LiteralData.Body.Read(buf) - - // Hash only if required - if scr.md.SignedBy != nil { - scr.wrappedHash.Write(buf[:n]) - } - - if sensitiveParsingError == io.EOF { - var p packet.Packet - var readError error - var sig *packet.Signature - - p, readError = scr.packets.Next() - for readError == nil { - var ok bool - if sig, ok = p.(*packet.Signature); ok { - if sig.Version == 5 && (sig.SigType == 0x00 || sig.SigType == 0x01) { - sig.Metadata = scr.md.LiteralData - } - - // If signature KeyID matches - if scr.md.SignedBy != nil && *sig.IssuerKeyId == scr.md.SignedByKeyId { - key := scr.md.SignedBy - signatureError := key.PublicKey.VerifySignature(scr.h, sig) - if signatureError == nil { - signatureError = checkSignatureDetails(key, sig, scr.config) - } - scr.md.Signature = sig - scr.md.SignatureError = signatureError - } else { - scr.md.UnverifiedSignatures = append(scr.md.UnverifiedSignatures, sig) - } - } - - p, readError = scr.packets.Next() - } - - if scr.md.SignedBy != nil && scr.md.Signature == nil { - if scr.md.UnverifiedSignatures == nil { - scr.md.SignatureError = errors.StructuralError("LiteralData not followed by signature") - } else { - scr.md.SignatureError = errors.StructuralError("No matching signature found") - } - } - - // The SymmetricallyEncrypted packet, if any, might have an - // unsigned hash of its own. In order to check this we need to - // close that Reader. - if scr.md.decrypted != nil { - mdcErr := scr.md.decrypted.Close() - if mdcErr != nil { - return n, mdcErr - } - } - return n, io.EOF - } - - if sensitiveParsingError != nil { - return n, errors.StructuralError("parsing error") - } - - return n, nil -} - -// VerifyDetachedSignature takes a signed file and a detached signature and -// returns the signature packet and the entity the signature was signed by, -// if any, and a possible signature verification error. -// If the signer isn't known, ErrUnknownIssuer is returned. -func VerifyDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) { - var expectedHashes []crypto.Hash - return verifyDetachedSignature(keyring, signed, signature, expectedHashes, config) -} - -// VerifyDetachedSignatureAndHash performs the same actions as -// VerifyDetachedSignature and checks that the expected hash functions were used. -func VerifyDetachedSignatureAndHash(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) { - return verifyDetachedSignature(keyring, signed, signature, expectedHashes, config) -} - -// CheckDetachedSignature takes a signed file and a detached signature and -// returns the entity the signature was signed by, if any, and a possible -// signature verification error. If the signer isn't known, -// ErrUnknownIssuer is returned. -func CheckDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (signer *Entity, err error) { - var expectedHashes []crypto.Hash - return CheckDetachedSignatureAndHash(keyring, signed, signature, expectedHashes, config) -} - -// CheckDetachedSignatureAndHash performs the same actions as -// CheckDetachedSignature and checks that the expected hash functions were used. -func CheckDetachedSignatureAndHash(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, config *packet.Config) (signer *Entity, err error) { - _, signer, err = verifyDetachedSignature(keyring, signed, signature, expectedHashes, config) - return -} - -func verifyDetachedSignature(keyring KeyRing, signed, signature io.Reader, expectedHashes []crypto.Hash, config *packet.Config) (sig *packet.Signature, signer *Entity, err error) { - var issuerKeyId uint64 - var hashFunc crypto.Hash - var sigType packet.SignatureType - var keys []Key - var p packet.Packet - - expectedHashesLen := len(expectedHashes) - packets := packet.NewReader(signature) - for { - p, err = packets.Next() - if err == io.EOF { - return nil, nil, errors.ErrUnknownIssuer - } - if err != nil { - return nil, nil, err - } - - var ok bool - sig, ok = p.(*packet.Signature) - if !ok { - return nil, nil, errors.StructuralError("non signature packet found") - } - if sig.IssuerKeyId == nil { - return nil, nil, errors.StructuralError("signature doesn't have an issuer") - } - issuerKeyId = *sig.IssuerKeyId - hashFunc = sig.Hash - sigType = sig.SigType - - for i, expectedHash := range expectedHashes { - if hashFunc == expectedHash { - break - } - if i+1 == expectedHashesLen { - return nil, nil, errors.StructuralError("hash algorithm mismatch with cleartext message headers") - } - } - - keys = keyring.KeysByIdUsage(issuerKeyId, packet.KeyFlagSign) - if len(keys) > 0 { - break - } - } - - if len(keys) == 0 { - panic("unreachable") - } - - h, wrappedHash, err := hashForSignature(hashFunc, sigType) - if err != nil { - return nil, nil, err - } - - if _, err := io.Copy(wrappedHash, signed); err != nil && err != io.EOF { - return nil, nil, err - } - - for _, key := range keys { - err = key.PublicKey.VerifySignature(h, sig) - if err == nil { - return sig, key.Entity, checkSignatureDetails(&key, sig, config) - } - } - - return nil, nil, err -} - -// CheckArmoredDetachedSignature performs the same actions as -// CheckDetachedSignature but expects the signature to be armored. -func CheckArmoredDetachedSignature(keyring KeyRing, signed, signature io.Reader, config *packet.Config) (signer *Entity, err error) { - body, err := readArmored(signature, SignatureType) - if err != nil { - return - } - - return CheckDetachedSignature(keyring, signed, body, config) -} - -// checkSignatureDetails returns an error if: -// - The signature (or one of the binding signatures mentioned below) -// has a unknown critical notation data subpacket -// - The primary key of the signing entity is revoked -// - The primary identity is revoked -// - The signature is expired -// - The primary key of the signing entity is expired according to the -// primary identity binding signature -// -// ... or, if the signature was signed by a subkey and: -// - The signing subkey is revoked -// - The signing subkey is expired according to the subkey binding signature -// - The signing subkey binding signature is expired -// - The signing subkey cross-signature is expired -// -// NOTE: The order of these checks is important, as the caller may choose to -// ignore ErrSignatureExpired or ErrKeyExpired errors, but should never -// ignore any other errors. -// -// TODO: Also return an error if: -// - The primary key is expired according to a direct-key signature -// - (For V5 keys only:) The direct-key signature (exists and) is expired -func checkSignatureDetails(key *Key, signature *packet.Signature, config *packet.Config) error { - now := config.Now() - primaryIdentity := key.Entity.PrimaryIdentity() - signedBySubKey := key.PublicKey != key.Entity.PrimaryKey - sigsToCheck := []*packet.Signature{signature, primaryIdentity.SelfSignature} - if signedBySubKey { - sigsToCheck = append(sigsToCheck, key.SelfSignature, key.SelfSignature.EmbeddedSignature) - } - for _, sig := range sigsToCheck { - for _, notation := range sig.Notations { - if notation.IsCritical && !config.KnownNotation(notation.Name) { - return errors.SignatureError("unknown critical notation: " + notation.Name) - } - } - } - if key.Entity.Revoked(now) || // primary key is revoked - (signedBySubKey && key.Revoked(now)) || // subkey is revoked - primaryIdentity.Revoked(now) { // primary identity is revoked - return errors.ErrKeyRevoked - } - if key.Entity.PrimaryKey.KeyExpired(primaryIdentity.SelfSignature, now) { // primary key is expired - return errors.ErrKeyExpired - } - if signedBySubKey { - if key.PublicKey.KeyExpired(key.SelfSignature, now) { // subkey is expired - return errors.ErrKeyExpired - } - } - for _, sig := range sigsToCheck { - if sig.SigExpired(now) { // any of the relevant signatures are expired - return errors.ErrSignatureExpired - } - } - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go deleted file mode 100644 index db6dad5c0b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/read_write_test_data.go +++ /dev/null @@ -1,274 +0,0 @@ -package openpgp - -const testKey1KeyId uint64 = 0xA34D7E18C20C31BB -const testKey3KeyId uint64 = 0x338934250CCC0360 -const testKeyP256KeyId uint64 = 0xd44a2c495918513e - -const signedInput = "Signed message\nline 2\nline 3\n" -const signedTextInput = "Signed message\r\nline 2\r\nline 3\r\n" - -const recipientUnspecifiedHex = "848c0300000000000000000103ff62d4d578d03cf40c3da998dfe216c074fa6ddec5e31c197c9666ba292830d91d18716a80f699f9d897389a90e6d62d0238f5f07a5248073c0f24920e4bc4a30c2d17ee4e0cae7c3d4aaa4e8dced50e3010a80ee692175fa0385f62ecca4b56ee6e9980aa3ec51b61b077096ac9e800edaf161268593eedb6cc7027ff5cb32745d250010d407a6221ae22ef18469b444f2822478c4d190b24d36371a95cb40087cdd42d9399c3d06a53c0673349bfb607927f20d1e122bde1e2bf3aa6cae6edf489629bcaa0689539ae3b718914d88ededc3b" - -const detachedSignatureHex = "889c04000102000605024d449cd1000a0910a34d7e18c20c31bb167603ff57718d09f28a519fdc7b5a68b6a3336da04df85e38c5cd5d5bd2092fa4629848a33d85b1729402a2aab39c3ac19f9d573f773cc62c264dc924c067a79dfd8a863ae06c7c8686120760749f5fd9b1e03a64d20a7df3446ddc8f0aeadeaeba7cbaee5c1e366d65b6a0c6cc749bcb912d2f15013f812795c2e29eb7f7b77f39ce77" - -const detachedSignatureTextHex = "889c04010102000605024d449d21000a0910a34d7e18c20c31bbc8c60400a24fbef7342603a41cb1165767bd18985d015fb72fe05db42db36cfb2f1d455967f1e491194fbf6cf88146222b23bf6ffbd50d17598d976a0417d3192ff9cc0034fd00f287b02e90418bbefe609484b09231e4e7a5f3562e199bf39909ab5276c4d37382fe088f6b5c3426fc1052865da8b3ab158672d58b6264b10823dc4b39" - -const detachedSignatureDSAHex = "884604001102000605024d6c4eac000a0910338934250ccc0360f18d00a087d743d6405ed7b87755476629600b8b694a39e900a0abff8126f46faf1547c1743c37b21b4ea15b8f83" - -const detachedSignatureP256Hex = "885e0400130a0006050256e5bb00000a0910d44a2c495918513edef001009841a4f792beb0befccb35c8838a6a87d9b936beaa86db6745ddc7b045eee0cf00fd1ac1f78306b17e965935dd3f8bae4587a76587e4af231efe19cc4011a8434817" - -// The plaintext is https://www.gutenberg.org/cache/epub/1080/pg1080.txt -const modestProposalSha512 = "lbbrB1+WP3T9AaC9OQqBdOcCjgeEQadlulXsNPgVx0tyqPzDHwUugZ2gE7V0ESKAw6kAVfgkcuvfgxAAGaeHtw==" - -const testKeys1And2Hex = "988d044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd0011010001b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b0020003b88d044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f0011010001889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab0020003988d044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b0020003b88d044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020003" - -const testKeys1And2PrivateHex = "9501d8044d3c5c10010400b1d13382944bd5aba23a4312968b5095d14f947f600eb478e14a6fcb16b0e0cac764884909c020bc495cfcc39a935387c661507bdb236a0612fb582cac3af9b29cc2c8c70090616c41b662f4da4c1201e195472eb7f4ae1ccbcbf9940fe21d985e379a5563dde5b9a23d35f1cfaa5790da3b79db26f23695107bfaca8e7b5bcd00110100010003ff4d91393b9a8e3430b14d6209df42f98dc927425b881f1209f319220841273a802a97c7bdb8b3a7740b3ab5866c4d1d308ad0d3a79bd1e883aacf1ac92dfe720285d10d08752a7efe3c609b1d00f17f2805b217be53999a7da7e493bfc3e9618fd17018991b8128aea70a05dbce30e4fbe626aa45775fa255dd9177aabf4df7cf0200c1ded12566e4bc2bb590455e5becfb2e2c9796482270a943343a7835de41080582c2be3caf5981aa838140e97afa40ad652a0b544f83eb1833b0957dce26e47b0200eacd6046741e9ce2ec5beb6fb5e6335457844fb09477f83b050a96be7da043e17f3a9523567ed40e7a521f818813a8b8a72209f1442844843ccc7eb9805442570200bdafe0438d97ac36e773c7162028d65844c4d463e2420aa2228c6e50dc2743c3d6c72d0d782a5173fe7be2169c8a9f4ef8a7cf3e37165e8c61b89c346cdc6c1799d2b41054657374204b6579203120285253412988b804130102002205024d3c5c10021b03060b090807030206150802090a0b0416020301021e01021780000a0910a34d7e18c20c31bbb5b304009cc45fe610b641a2c146331be94dade0a396e73ca725e1b25c21708d9cab46ecca5ccebc23055879df8f99eea39b377962a400f2ebdc36a7c99c333d74aeba346315137c3ff9d0a09b0273299090343048afb8107cf94cbd1400e3026f0ccac7ecebbc4d78588eb3e478fe2754d3ca664bcf3eac96ca4a6b0c8d7df5102f60f6b00200009d01d8044d3c5c10010400b201df61d67487301f11879d514f4248ade90c8f68c7af1284c161098de4c28c2850f1ec7b8e30f959793e571542ffc6532189409cb51c3d30dad78c4ad5165eda18b20d9826d8707d0f742e2ab492103a85bbd9ddf4f5720f6de7064feb0d39ee002219765bb07bcfb8b877f47abe270ddeda4f676108cecb6b9bb2ad484a4f00110100010003fd17a7490c22a79c59281fb7b20f5e6553ec0c1637ae382e8adaea295f50241037f8997cf42c1ce26417e015091451b15424b2c59eb8d4161b0975630408e394d3b00f88d4b4e18e2cc85e8251d4753a27c639c83f5ad4a571c4f19d7cd460b9b73c25ade730c99df09637bd173d8e3e981ac64432078263bb6dc30d3e974150dd0200d0ee05be3d4604d2146fb0457f31ba17c057560785aa804e8ca5530a7cd81d3440d0f4ba6851efcfd3954b7e68908fc0ba47f7ac37bf559c6c168b70d3a7c8cd0200da1c677c4bce06a068070f2b3733b0a714e88d62aa3f9a26c6f5216d48d5c2b5624144f3807c0df30be66b3268eeeca4df1fbded58faf49fc95dc3c35f134f8b01fd1396b6c0fc1b6c4f0eb8f5e44b8eace1e6073e20d0b8bc5385f86f1cf3f050f66af789f3ef1fc107b7f4421e19e0349c730c68f0a226981f4e889054fdb4dc149e8e889f04180102000905024d3c5c10021b0c000a0910a34d7e18c20c31bb1a03040085c8d62e16d05dc4e9dad64953c8a2eed8b6c12f92b1575eeaa6dcf7be9473dd5b24b37b6dffbb4e7c99ed1bd3cb11634be19b3e6e207bed7505c7ca111ccf47cb323bf1f8851eb6360e8034cbff8dd149993c959de89f8f77f38e7e98b8e3076323aa719328e2b408db5ec0d03936efd57422ba04f925cdc7b4c1af7590e40ab00200009501fe044d3c5c33010400b488c3e5f83f4d561f317817538d9d0397981e9aef1321ca68ebfae1cf8b7d388e19f4b5a24a82e2fbbf1c6c26557a6c5845307a03d815756f564ac7325b02bc83e87d5480a8fae848f07cb891f2d51ce7df83dcafdc12324517c86d472cc0ee10d47a68fd1d9ae49a6c19bbd36d82af597a0d88cc9c49de9df4e696fc1f0b5d0011010001fe030302e9030f3c783e14856063f16938530e148bc57a7aa3f3e4f90df9dceccdc779bc0835e1ad3d006e4a8d7b36d08b8e0de5a0d947254ecfbd22037e6572b426bcfdc517796b224b0036ff90bc574b5509bede85512f2eefb520fb4b02aa523ba739bff424a6fe81c5041f253f8d757e69a503d3563a104d0d49e9e890b9d0c26f96b55b743883b472caa7050c4acfd4a21f875bdf1258d88bd61224d303dc9df77f743137d51e6d5246b88c406780528fd9a3e15bab5452e5b93970d9dcc79f48b38651b9f15bfbcf6da452837e9cc70683d1bdca94507870f743e4ad902005812488dd342f836e72869afd00ce1850eea4cfa53ce10e3608e13d3c149394ee3cbd0e23d018fcbcb6e2ec5a1a22972d1d462ca05355d0d290dd2751e550d5efb38c6c89686344df64852bf4ff86638708f644e8ec6bd4af9b50d8541cb91891a431326ab2e332faa7ae86cfb6e0540aa63160c1e5cdd5a4add518b303fff0a20117c6bc77f7cfbaf36b04c865c6c2b42754657374204b6579203220285253412c20656e637279707465642070726976617465206b65792988b804130102002205024d3c5c33021b03060b090807030206150802090a0b0416020301021e01021780000a0910d4984f961e35246b98940400908a73b6a6169f700434f076c6c79015a49bee37130eaf23aaa3cfa9ce60bfe4acaa7bc95f1146ada5867e0079babb38804891f4f0b8ebca57a86b249dee786161a755b7a342e68ccf3f78ed6440a93a6626beb9a37aa66afcd4f888790cb4bb46d94a4ae3eb3d7d3e6b00f6bfec940303e89ec5b32a1eaaacce66497d539328b00200009d01fe044d3c5c33010400a4e913f9442abcc7f1804ccab27d2f787ffa592077ca935a8bb23165bd8d57576acac647cc596b2c3f814518cc8c82953c7a4478f32e0cf645630a5ba38d9618ef2bc3add69d459ae3dece5cab778938d988239f8c5ae437807075e06c828019959c644ff05ef6a5a1dab72227c98e3a040b0cf219026640698d7a13d8538a570011010001fe030302e9030f3c783e148560f936097339ae381d63116efcf802ff8b1c9360767db5219cc987375702a4123fd8657d3e22700f23f95020d1b261eda5257e9a72f9a918e8ef22dd5b3323ae03bbc1923dd224db988cadc16acc04b120a9f8b7e84da9716c53e0334d7b66586ddb9014df604b41be1e960dcfcbc96f4ed150a1a0dd070b9eb14276b9b6be413a769a75b519a53d3ecc0c220e85cd91ca354d57e7344517e64b43b6e29823cbd87eae26e2b2e78e6dedfbb76e3e9f77bcb844f9a8932eb3db2c3f9e44316e6f5d60e9e2a56e46b72abe6b06dc9a31cc63f10023d1f5e12d2a3ee93b675c96f504af0001220991c88db759e231b3320dcedf814dcf723fd9857e3d72d66a0f2af26950b915abdf56c1596f46a325bf17ad4810d3535fb02a259b247ac3dbd4cc3ecf9c51b6c07cebb009c1506fba0a89321ec8683e3fd009a6e551d50243e2d5092fefb3321083a4bad91320dc624bd6b5dddf93553e3d53924c05bfebec1fb4bd47e89a1a889f04180102000905024d3c5c33021b0c000a0910d4984f961e35246b26c703ff7ee29ef53bc1ae1ead533c408fa136db508434e233d6e62be621e031e5940bbd4c08142aed0f82217e7c3e1ec8de574bc06ccf3c36633be41ad78a9eacd209f861cae7b064100758545cc9dd83db71806dc1cfd5fb9ae5c7474bba0c19c44034ae61bae5eca379383339dece94ff56ff7aa44a582f3e5c38f45763af577c0934b0020000" - -const dsaElGamalTestKeysHex = "9501e1044dfcb16a110400aa3e5c1a1f43dd28c2ffae8abf5cfce555ee874134d8ba0a0f7b868ce2214beddc74e5e1e21ded354a95d18acdaf69e5e342371a71fbb9093162e0c5f3427de413a7f2c157d83f5cd2f9d791256dc4f6f0e13f13c3302af27f2384075ab3021dff7a050e14854bbde0a1094174855fc02f0bae8e00a340d94a1f22b32e48485700a0cec672ac21258fb95f61de2ce1af74b2c4fa3e6703ff698edc9be22c02ae4d916e4fa223f819d46582c0516235848a77b577ea49018dcd5e9e15cff9dbb4663a1ae6dd7580fa40946d40c05f72814b0f88481207e6c0832c3bded4853ebba0a7e3bd8e8c66df33d5a537cd4acf946d1080e7a3dcea679cb2b11a72a33a2b6a9dc85f466ad2ddf4c3db6283fa645343286971e3dd700703fc0c4e290d45767f370831a90187e74e9972aae5bff488eeff7d620af0362bfb95c1a6c3413ab5d15a2e4139e5d07a54d72583914661ed6a87cce810be28a0aa8879a2dd39e52fb6fe800f4f181ac7e328f740cde3d09a05cecf9483e4cca4253e60d4429ffd679d9996a520012aad119878c941e3cf151459873bdfc2a9563472fe0303027a728f9feb3b864260a1babe83925ce794710cfd642ee4ae0e5b9d74cee49e9c67b6cd0ea5dfbb582132195a121356a1513e1bca73e5b80c58c7ccb4164453412f456c47616d616c2054657374204b65792031886204131102002205024dfcb16a021b03060b090807030206150802090a0b0416020301021e01021780000a091033af447ccd759b09fadd00a0b8fd6f5a790bad7e9f2dbb7632046dc4493588db009c087c6a9ba9f7f49fab221587a74788c00db4889ab00200009d0157044dfcb16a1004008dec3f9291205255ccff8c532318133a6840739dd68b03ba942676f9038612071447bf07d00d559c5c0875724ea16a4c774f80d8338b55fca691a0522e530e604215b467bbc9ccfd483a1da99d7bc2648b4318fdbd27766fc8bfad3fddb37c62b8ae7ccfe9577e9b8d1e77c1d417ed2c2ef02d52f4da11600d85d3229607943700030503ff506c94c87c8cab778e963b76cf63770f0a79bf48fb49d3b4e52234620fc9f7657f9f8d56c96a2b7c7826ae6b57ebb2221a3fe154b03b6637cea7e6d98e3e45d87cf8dc432f723d3d71f89c5192ac8d7290684d2c25ce55846a80c9a7823f6acd9bb29fa6cd71f20bc90eccfca20451d0c976e460e672b000df49466408d527affe0303027a728f9feb3b864260abd761730327bca2aaa4ea0525c175e92bf240682a0e83b226f97ecb2e935b62c9a133858ce31b271fa8eb41f6a1b3cd72a63025ce1a75ee4180dcc284884904181102000905024dfcb16a021b0c000a091033af447ccd759b09dd0b009e3c3e7296092c81bee5a19929462caaf2fff3ae26009e218c437a2340e7ea628149af1ec98ec091a43992b00200009501e1044dfcb1be1104009f61faa61aa43df75d128cbe53de528c4aec49ce9360c992e70c77072ad5623de0a3a6212771b66b39a30dad6781799e92608316900518ec01184a85d872365b7d2ba4bacfb5882ea3c2473d3750dc6178cc1cf82147fb58caa28b28e9f12f6d1efcb0534abed644156c91cca4ab78834268495160b2400bc422beb37d237c2300a0cac94911b6d493bda1e1fbc6feeca7cb7421d34b03fe22cec6ccb39675bb7b94a335c2b7be888fd3906a1125f33301d8aa6ec6ee6878f46f73961c8d57a3e9544d8ef2a2cbfd4d52da665b1266928cfe4cb347a58c412815f3b2d2369dec04b41ac9a71cc9547426d5ab941cccf3b18575637ccfb42df1a802df3cfe0a999f9e7109331170e3a221991bf868543960f8c816c28097e503fe319db10fb98049f3a57d7c80c420da66d56f3644371631fad3f0ff4040a19a4fedc2d07727a1b27576f75a4d28c47d8246f27071e12d7a8de62aad216ddbae6aa02efd6b8a3e2818cda48526549791ab277e447b3a36c57cefe9b592f5eab73959743fcc8e83cbefec03a329b55018b53eec196765ae40ef9e20521a603c551efe0303020950d53a146bf9c66034d00c23130cce95576a2ff78016ca471276e8227fb30b1ffbd92e61804fb0c3eff9e30b1a826ee8f3e4730b4d86273ca977b4164453412f456c47616d616c2054657374204b65792032886204131102002205024dfcb1be021b03060b090807030206150802090a0b0416020301021e01021780000a0910a86bf526325b21b22bd9009e34511620415c974750a20df5cb56b182f3b48e6600a0a9466cb1a1305a84953445f77d461593f1d42bc1b00200009d0157044dfcb1be1004009565a951da1ee87119d600c077198f1c1bceb0f7aa54552489298e41ff788fa8f0d43a69871f0f6f77ebdfb14a4260cf9fbeb65d5844b4272a1904dd95136d06c3da745dc46327dd44a0f16f60135914368c8039a34033862261806bb2c5ce1152e2840254697872c85441ccb7321431d75a747a4bfb1d2c66362b51ce76311700030503fc0ea76601c196768070b7365a200e6ddb09307f262d5f39eec467b5f5784e22abdf1aa49226f59ab37cb49969d8f5230ea65caf56015abda62604544ed526c5c522bf92bed178a078789f6c807b6d34885688024a5bed9e9f8c58d11d4b82487b44c5f470c5606806a0443b79cadb45e0f897a561a53f724e5349b9267c75ca17fe0303020950d53a146bf9c660bc5f4ce8f072465e2d2466434320c1e712272fafc20e342fe7608101580fa1a1a367e60486a7cd1246b7ef5586cf5e10b32762b710a30144f12dd17dd4884904181102000905024dfcb1be021b0c000a0910a86bf526325b21b2904c00a0b2b66b4b39ccffda1d10f3ea8d58f827e30a8b8e009f4255b2d8112a184e40cde43a34e8655ca7809370b0020000" - -const signedMessageHex = "a3019bc0cbccc0c4b8d8b74ee2108fe16ec6d3ca490cbe362d3f8333d3f352531472538b8b13d353b97232f352158c20943157c71c16064626063656269052062e4e01987e9b6fccff4b7df3a34c534b23e679cbec3bc0f8f6e64dfb4b55fe3f8efa9ce110ddb5cd79faf1d753c51aecfa669f7e7aa043436596cccc3359cb7dd6bbe9ecaa69e5989d9e57209571edc0b2fa7f57b9b79a64ee6e99ce1371395fee92fec2796f7b15a77c386ff668ee27f6d38f0baa6c438b561657377bf6acff3c5947befd7bf4c196252f1d6e5c524d0300" - -const signedTextMessageHex = "a3019bc0cbccc8c4b8d8b74ee2108fe16ec6d36a250cbece0c178233d3f352531472538b8b13d35379b97232f352158ca0b4312f57c71c1646462606365626906a062e4e019811591798ff99bf8afee860b0d8a8c2a85c3387e3bcf0bb3b17987f2bbcfab2aa526d930cbfd3d98757184df3995c9f3e7790e36e3e9779f06089d4c64e9e47dd6202cb6e9bc73c5d11bb59fbaf89d22d8dc7cf199ddf17af96e77c5f65f9bbed56f427bd8db7af37f6c9984bf9385efaf5f184f986fb3e6adb0ecfe35bbf92d16a7aa2a344fb0bc52fb7624f0200" - -const signedEncryptedMessageHex = "c18c032a67d68660df41c70103ff5a84c9a72f80e74ef0384c2d6a9ebfe2b09e06a8f298394f6d2abf174e40934ab0ec01fb2d0ddf21211c6fe13eb238563663b017a6b44edca552eb4736c4b7dc6ed907dd9e12a21b51b64b46f902f76fb7aaf805c1db8070574d8d0431a23e324a750f77fb72340a17a42300ee4ca8207301e95a731da229a63ab9c6b44541fbd2c11d016d810b3b3b2b38f15b5b40f0a4910332829c2062f1f7cc61f5b03677d73c54cafa1004ced41f315d46444946faae571d6f426e6dbd45d9780eb466df042005298adabf7ce0ef766dfeb94cd449c7ed0046c880339599c4711af073ce649b1e237c40b50a5536283e03bdbb7afad78bd08707715c67fb43295f905b4c479178809d429a8e167a9a8c6dfd8ab20b4edebdc38d6dec879a3202e1b752690d9bb5b0c07c5a227c79cc200e713a99251a4219d62ad5556900cf69bd384b6c8e726c7be267471d0d23af956da165af4af757246c2ebcc302b39e8ef2fccb4971b234fcda22d759ddb20e27269ee7f7fe67898a9de721bfa02ab0becaa046d00ea16cb1afc4e2eab40d0ac17121c565686e5cbd0cbdfbd9d6db5c70278b9c9db5a83176d04f61fbfbc4471d721340ede2746e5c312ded4f26787985af92b64fae3f253dbdde97f6a5e1996fd4d865599e32ff76325d3e9abe93184c02988ee89a4504356a4ef3b9b7a57cbb9637ca90af34a7676b9ef559325c3cca4e29d69fec1887f5440bb101361d744ad292a8547f22b4f22b419a42aa836169b89190f46d9560824cb2ac6e8771de8223216a5e647e132ab9eebcba89569ab339cb1c3d70fe806b31f4f4c600b4103b8d7583ebff16e43dcda551e6530f975122eb8b29" - -const verifiedSignatureEncryptedMessageHex = "c2b304000108000605026048f6d600210910a34d7e18c20c31bb1621045fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb9a3b0400a32ddac1af259c1b0abab0041327ea04970944401978fb647dd1cf9aba4f164e43f0d8a9389501886474bdd4a6e77f6aea945c07dfbf87743835b44cc2c39a1f9aeecfa83135abc92e18e50396f2e6a06c44e0188b0081effbfb4160d28f118d4ff73dd199a102e47cffd8c7ff2bacd83ae72b5820c021a486766dd587b5da61" - -const unverifiedSignatureEncryptedMessageHex = "c2b304000108000605026048f6d600210910a34d7e18c20c31bb1621045fb74b1d03b1e3cb31bc2f8aa34d7e18c20c31bb9a3b0400a32ddac1af259c1b0abab0041327ea04970944401978fb647dd1cf9aba4f164e43f0d8a9389501886474bdd4a6e77f6aea945c07dfbf87743835b44cc2c39a1f9aeecfa83135abc92e18e50396f2e6a06c44e0188b0081effbfb4160d28f118d4ff73dd199a102e47cffd8c7ff2bacd83ae72b5820c021a486766dd587b5da61" - -const signedEncryptedMessage2Hex = "85010e03cf6a7abcd43e36731003fb057f5495b79db367e277cdbe4ab90d924ddee0c0381494112ff8c1238fb0184af35d1731573b01bc4c55ecacd2aafbe2003d36310487d1ecc9ac994f3fada7f9f7f5c3a64248ab7782906c82c6ff1303b69a84d9a9529c31ecafbcdb9ba87e05439897d87e8a2a3dec55e14df19bba7f7bd316291c002ae2efd24f83f9e3441203fc081c0c23dc3092a454ca8a082b27f631abf73aca341686982e8fbda7e0e7d863941d68f3de4a755c2964407f4b5e0477b3196b8c93d551dd23c8beef7d0f03fbb1b6066f78907faf4bf1677d8fcec72651124080e0b7feae6b476e72ab207d38d90b958759fdedfc3c6c35717c9dbfc979b3cfbbff0a76d24a5e57056bb88acbd2a901ef64bc6e4db02adc05b6250ff378de81dca18c1910ab257dff1b9771b85bb9bbe0a69f5989e6d1710a35e6dfcceb7d8fb5ccea8db3932b3d9ff3fe0d327597c68b3622aec8e3716c83a6c93f497543b459b58ba504ed6bcaa747d37d2ca746fe49ae0a6ce4a8b694234e941b5159ff8bd34b9023da2814076163b86f40eed7c9472f81b551452d5ab87004a373c0172ec87ea6ce42ccfa7dbdad66b745496c4873d8019e8c28d6b3" - -const signatureEncryptedMessage2Hex = "c24604001102000605024dfd0166000a091033af447ccd759b09bae600a096ec5e63ecf0a403085e10f75cc3bab327663282009f51fad9df457ed8d2b70d8a73c76e0443eac0f377" - -const symmetricallyEncryptedCompressedHex = "c32e040903085a357c1a7b5614ed00cc0d1d92f428162058b3f558a0fb0980d221ebac6c97d5eda4e0fe32f6e706e94dd263012d6ca1ef8c4bbd324098225e603a10c85ebf09cbf7b5aeeb5ce46381a52edc51038b76a8454483be74e6dcd1e50d5689a8ae7eceaeefed98a0023d49b22eb1f65c2aa1ef1783bb5e1995713b0457102ec3c3075fe871267ffa4b686ad5d52000d857" - -const dsaTestKeyHex = "9901a2044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794" - -const dsaTestKeyPrivateHex = "9501bb044d6c49de110400cb5ce438cf9250907ac2ba5bf6547931270b89f7c4b53d9d09f4d0213a5ef2ec1f26806d3d259960f872a4a102ef1581ea3f6d6882d15134f21ef6a84de933cc34c47cc9106efe3bd84c6aec12e78523661e29bc1a61f0aab17fa58a627fd5fd33f5149153fbe8cd70edf3d963bc287ef875270ff14b5bfdd1bca4483793923b00a0fe46d76cb6e4cbdc568435cd5480af3266d610d303fe33ae8273f30a96d4d34f42fa28ce1112d425b2e3bf7ea553d526e2db6b9255e9dc7419045ce817214d1a0056dbc8d5289956a4b1b69f20f1105124096e6a438f41f2e2495923b0f34b70642607d45559595c7fe94d7fa85fc41bf7d68c1fd509ebeaa5f315f6059a446b9369c277597e4f474a9591535354c7e7f4fd98a08aa60400b130c24ff20bdfbf683313f5daebf1c9b34b3bdadfc77f2ddd72ee1fb17e56c473664bc21d66467655dd74b9005e3a2bacce446f1920cd7017231ae447b67036c9b431b8179deacd5120262d894c26bc015bffe3d827ba7087ad9b700d2ca1f6d16cc1786581e5dd065f293c31209300f9b0afcc3f7c08dd26d0a22d87580b4d00009f592e0619d823953577d4503061706843317e4fee083db41054657374204b65792033202844534129886204131102002205024d6c49de021b03060b090807030206150802090a0b0416020301021e01021780000a0910338934250ccc03607e0400a0bdb9193e8a6b96fc2dfc108ae848914b504481f100a09c4dc148cb693293a67af24dd40d2b13a9e36794" - -const p256TestKeyHex = "98520456e5b83813082a8648ce3d030107020304a2072cd6d21321266c758cc5b83fab0510f751cb8d91897cddb7047d8d6f185546e2107111b0a95cb8ef063c33245502af7a65f004d5919d93ee74eb71a66253b424502d3235362054657374204b6579203c696e76616c6964406578616d706c652e636f6d3e8879041313080021050256e5b838021b03050b09080702061508090a0b020416020301021e01021780000a0910d44a2c495918513e54e50100dfa64f97d9b47766fc1943c6314ba3f2b2a103d71ad286dc5b1efb96a345b0c80100dbc8150b54241f559da6ef4baacea6d31902b4f4b1bdc09b34bf0502334b7754b8560456e5b83812082a8648ce3d030107020304bfe3cea9cee13486f8d518aa487fecab451f25467d2bf08e58f63e5fa525d5482133e6a79299c274b068ef0be448152ad65cf11cf764348588ca4f6a0bcf22b6030108078861041813080009050256e5b838021b0c000a0910d44a2c495918513e4a4800ff49d589fa64024ad30be363a032e3a0e0e6f5db56ba4c73db850518bf0121b8f20100fd78e065f4c70ea5be9df319ea67e493b936fc78da834a71828043d3154af56e" - -const p256TestKeyPrivateHex = "94a50456e5b83813082a8648ce3d030107020304a2072cd6d21321266c758cc5b83fab0510f751cb8d91897cddb7047d8d6f185546e2107111b0a95cb8ef063c33245502af7a65f004d5919d93ee74eb71a66253fe070302f0c2bfb0b6c30f87ee1599472b8636477eab23ced13b271886a4b50ed34c9d8436af5af5b8f88921f0efba6ef8c37c459bbb88bc1c6a13bbd25c4ce9b1e97679569ee77645d469bf4b43de637f5561b424502d3235362054657374204b6579203c696e76616c6964406578616d706c652e636f6d3e8879041313080021050256e5b838021b03050b09080702061508090a0b020416020301021e01021780000a0910d44a2c495918513e54e50100dfa64f97d9b47766fc1943c6314ba3f2b2a103d71ad286dc5b1efb96a345b0c80100dbc8150b54241f559da6ef4baacea6d31902b4f4b1bdc09b34bf0502334b77549ca90456e5b83812082a8648ce3d030107020304bfe3cea9cee13486f8d518aa487fecab451f25467d2bf08e58f63e5fa525d5482133e6a79299c274b068ef0be448152ad65cf11cf764348588ca4f6a0bcf22b603010807fe0703027510012471a603cfee2968dce19f732721ddf03e966fd133b4e3c7a685b788705cbc46fb026dc94724b830c9edbaecd2fb2c662f23169516cacd1fe423f0475c364ecc10abcabcfd4bbbda1a36a1bd8861041813080009050256e5b838021b0c000a0910d44a2c495918513e4a4800ff49d589fa64024ad30be363a032e3a0e0e6f5db56ba4c73db850518bf0121b8f20100fd78e065f4c70ea5be9df319ea67e493b936fc78da834a71828043d3154af56e" - -const armoredPrivateKeyBlock = `-----BEGIN PGP PRIVATE KEY BLOCK----- -Version: GnuPG v1.4.10 (GNU/Linux) - -lQHYBE2rFNoBBADFwqWQIW/DSqcB4yCQqnAFTJ27qS5AnB46ccAdw3u4Greeu3Bp -idpoHdjULy7zSKlwR1EA873dO/k/e11Ml3dlAFUinWeejWaK2ugFP6JjiieSsrKn -vWNicdCS4HTWn0X4sjl0ZiAygw6GNhqEQ3cpLeL0g8E9hnYzJKQ0LWJa0QARAQAB -AAP/TB81EIo2VYNmTq0pK1ZXwUpxCrvAAIG3hwKjEzHcbQznsjNvPUihZ+NZQ6+X -0HCfPAdPkGDCLCb6NavcSW+iNnLTrdDnSI6+3BbIONqWWdRDYJhqZCkqmG6zqSfL -IdkJgCw94taUg5BWP/AAeQrhzjChvpMQTVKQL5mnuZbUCeMCAN5qrYMP2S9iKdnk -VANIFj7656ARKt/nf4CBzxcpHTyB8+d2CtPDKCmlJP6vL8t58Jmih+kHJMvC0dzn -gr5f5+sCAOOe5gt9e0am7AvQWhdbHVfJU0TQJx+m2OiCJAqGTB1nvtBLHdJnfdC9 -TnXXQ6ZXibqLyBies/xeY2sCKL5qtTMCAKnX9+9d/5yQxRyrQUHt1NYhaXZnJbHx -q4ytu0eWz+5i68IYUSK69jJ1NWPM0T6SkqpB3KCAIv68VFm9PxqG1KmhSrQIVGVz -dCBLZXmIuAQTAQIAIgUCTasU2gIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AA -CgkQO9o98PRieSoLhgQAkLEZex02Qt7vGhZzMwuN0R22w3VwyYyjBx+fM3JFETy1 -ut4xcLJoJfIaF5ZS38UplgakHG0FQ+b49i8dMij0aZmDqGxrew1m4kBfjXw9B/v+ -eIqpODryb6cOSwyQFH0lQkXC040pjq9YqDsO5w0WYNXYKDnzRV0p4H1pweo2VDid -AdgETasU2gEEAN46UPeWRqKHvA99arOxee38fBt2CI08iiWyI8T3J6ivtFGixSqV -bRcPxYO/qLpVe5l84Nb3X71GfVXlc9hyv7CD6tcowL59hg1E/DC5ydI8K8iEpUmK -/UnHdIY5h8/kqgGxkY/T/hgp5fRQgW1ZoZxLajVlMRZ8W4tFtT0DeA+JABEBAAEA -A/0bE1jaaZKj6ndqcw86jd+QtD1SF+Cf21CWRNeLKnUds4FRRvclzTyUMuWPkUeX -TaNNsUOFqBsf6QQ2oHUBBK4VCHffHCW4ZEX2cd6umz7mpHW6XzN4DECEzOVksXtc -lUC1j4UB91DC/RNQqwX1IV2QLSwssVotPMPqhOi0ZLNY7wIA3n7DWKInxYZZ4K+6 -rQ+POsz6brEoRHwr8x6XlHenq1Oki855pSa1yXIARoTrSJkBtn5oI+f8AzrnN0BN -oyeQAwIA/7E++3HDi5aweWrViiul9cd3rcsS0dEnksPhvS0ozCJiHsq/6GFmy7J8 -QSHZPteedBnZyNp5jR+H7cIfVN3KgwH/Skq4PsuPhDq5TKK6i8Pc1WW8MA6DXTdU -nLkX7RGmMwjC0DBf7KWAlPjFaONAX3a8ndnz//fy1q7u2l9AZwrj1qa1iJ8EGAEC -AAkFAk2rFNoCGwwACgkQO9o98PRieSo2/QP/WTzr4ioINVsvN1akKuekmEMI3LAp -BfHwatufxxP1U+3Si/6YIk7kuPB9Hs+pRqCXzbvPRrI8NHZBmc8qIGthishdCYad -AHcVnXjtxrULkQFGbGvhKURLvS9WnzD/m1K2zzwxzkPTzT9/Yf06O6Mal5AdugPL -VrM0m72/jnpKo04= -=zNCn ------END PGP PRIVATE KEY BLOCK-----` - -const e2ePublicKey = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Charset: UTF-8 - -xv8AAABSBAAAAAATCCqGSM49AwEHAgME1LRoXSpOxtHXDUdmuvzchyg6005qIBJ4 -sfaSxX7QgH9RV2ONUhC+WiayCNADq+UMzuR/vunSr4aQffXvuGnR383/AAAAFDxk -Z2lsQHlhaG9vLWluYy5jb20+wv8AAACGBBATCAA4/wAAAAWCVGvAG/8AAAACiwn/ -AAAACZC2VkQCOjdvYf8AAAAFlQgJCgv/AAAAA5YBAv8AAAACngEAAE1BAP0X8veD -24IjmI5/C6ZAfVNXxgZZFhTAACFX75jUA3oD6AEAzoSwKf1aqH6oq62qhCN/pekX -+WAsVMBhNwzLpqtCRjLO/wAAAFYEAAAAABIIKoZIzj0DAQcCAwT50ain7vXiIRv8 -B1DO3x3cE/aattZ5sHNixJzRCXi2vQIA5QmOxZ6b5jjUekNbdHG3SZi1a2Ak5mfX -fRxC/5VGAwEIB8L/AAAAZQQYEwgAGP8AAAAFglRrwBz/AAAACZC2VkQCOjdvYQAA -FJAA9isX3xtGyMLYwp2F3nXm7QEdY5bq5VUcD/RJlj792VwA/1wH0pCzVLl4Q9F9 -ex7En5r7rHR5xwX82Msc+Rq9dSyO -=7MrZ ------END PGP PUBLIC KEY BLOCK-----` - -const dsaKeyWithSHA512 = `9901a2044f04b07f110400db244efecc7316553ee08d179972aab87bb1214de7692593fcf5b6feb1c80fba268722dd464748539b85b81d574cd2d7ad0ca2444de4d849b8756bad7768c486c83a824f9bba4af773d11742bdfb4ac3b89ef8cc9452d4aad31a37e4b630d33927bff68e879284a1672659b8b298222fc68f370f3e24dccacc4a862442b9438b00a0ea444a24088dc23e26df7daf8f43cba3bffc4fe703fe3d6cd7fdca199d54ed8ae501c30e3ec7871ea9cdd4cf63cfe6fc82281d70a5b8bb493f922cd99fba5f088935596af087c8d818d5ec4d0b9afa7f070b3d7c1dd32a84fca08d8280b4890c8da1dde334de8e3cad8450eed2a4a4fcc2db7b8e5528b869a74a7f0189e11ef097ef1253582348de072bb07a9fa8ab838e993cef0ee203ff49298723e2d1f549b00559f886cd417a41692ce58d0ac1307dc71d85a8af21b0cf6eaa14baf2922d3a70389bedf17cc514ba0febbd107675a372fe84b90162a9e88b14d4b1c6be855b96b33fb198c46f058568817780435b6936167ebb3724b680f32bf27382ada2e37a879b3d9de2abe0c3f399350afd1ad438883f4791e2e3b4184453412068617368207472756e636174696f6e207465737488620413110a002205024f04b07f021b03060b090807030206150802090a0b0416020301021e01021780000a0910ef20e0cefca131581318009e2bf3bf047a44d75a9bacd00161ee04d435522397009a03a60d51bd8a568c6c021c8d7cf1be8d990d6417b0020003` - -const unknownHashFunctionHex = `8a00000040040001990006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101` - -const rsaSignatureBadMPIlength = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101` - -const missingHashFunctionHex = `8a00000040040001030006050253863c24000a09103b4fe6acc0b21f32ffff0101010101010101010101010101010101010101010101010101010101010101010101010101` - -const campbellQuine = `a0b001000300fcffa0b001000d00f2ff000300fcffa0b001000d00f2ff8270a01c00000500faff8270a01c00000500faff000500faff001400ebff8270a01c00000500faff000500faff001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400001400ebff428821c400000000ffff000000ffff000b00f4ff428821c400000000ffff000000ffff000b00f4ff0233214c40000100feff000233214c40000100feff0000` - -const keyV4forVerifyingSignedMessageV3 = `-----BEGIN PGP PUBLIC KEY BLOCK----- -Comment: GPGTools - https://gpgtools.org - -mI0EVfxoFQEEAMBIqmbDfYygcvP6Phr1wr1XI41IF7Qixqybs/foBF8qqblD9gIY -BKpXjnBOtbkcVOJ0nljd3/sQIfH4E0vQwK5/4YRQSI59eKOqd6Fx+fWQOLG+uu6z -tewpeCj9LLHvibx/Sc7VWRnrznia6ftrXxJ/wHMezSab3tnGC0YPVdGNABEBAAG0 -JEdvY3J5cHRvIFRlc3QgS2V5IDx0aGVtYXhAZ21haWwuY29tPoi5BBMBCgAjBQJV -/GgVAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQeXnQmhdGW9PFVAP+ -K7TU0qX5ArvIONIxh/WAweyOk884c5cE8f+3NOPOOCRGyVy0FId5A7MmD5GOQh4H -JseOZVEVCqlmngEvtHZb3U1VYtVGE5WZ+6rQhGsMcWP5qaT4soYwMBlSYxgYwQcx -YhN9qOr292f9j2Y//TTIJmZT4Oa+lMxhWdqTfX+qMgG4jQRV/GgVAQQArhFSiij1 -b+hT3dnapbEU+23Z1yTu1DfF6zsxQ4XQWEV3eR8v+8mEDDNcz8oyyF56k6UQ3rXi -UMTIwRDg4V6SbZmaFbZYCOwp/EmXJ3rfhm7z7yzXj2OFN22luuqbyVhuL7LRdB0M -pxgmjXb4tTvfgKd26x34S+QqUJ7W6uprY4sAEQEAAYifBBgBCgAJBQJV/GgVAhsM -AAoJEHl50JoXRlvT7y8D/02ckx4OMkKBZo7viyrBw0MLG92i+DC2bs35PooHR6zz -786mitjOp5z2QWNLBvxC70S0qVfCIz8jKupO1J6rq6Z8CcbLF3qjm6h1omUBf8Nd -EfXKD2/2HV6zMKVknnKzIEzauh+eCKS2CeJUSSSryap/QLVAjRnckaES/OsEWhNB -=RZia ------END PGP PUBLIC KEY BLOCK----- -` - -const signedMessageV3 = `-----BEGIN PGP MESSAGE----- -Comment: GPGTools - https://gpgtools.org - -owGbwMvMwMVYWXlhlrhb9GXG03JJDKF/MtxDMjKLFYAoUaEktbhEITe1uDgxPVWP -q5NhKjMrWAVcC9evD8z/bF/uWNjqtk/X3y5/38XGRQHm/57rrDRYuGnTw597Xqka -uM3137/hH3Os+Jf2dc0fXOITKwJvXJvecPVs0ta+Vg7ZO1MLn8w58Xx+6L58mbka -DGHyU9yTueZE8D+QF/Tz28Y78dqtF56R1VPn9Xw4uJqrWYdd7b3vIZ1V6R4Nh05d -iT57d/OhWwA= -=hG7R ------END PGP MESSAGE----- -` - -// https://mailarchive.ietf.org/arch/msg/openpgp/9SheW_LENE0Kxf7haNllovPyAdY/ -const v5PrivKey = `-----BEGIN PGP PRIVATE KEY BLOCK----- - -lGEFXJH05BYAAAAtCSsGAQQB2kcPAQEHQFhZlVcVVtwf+21xNQPX+ecMJJBL0MPd -fj75iux+my8QAAAAAAAiAQCHZ1SnSUmWqxEsoI6facIVZQu6mph3cBFzzTvcm5lA -Ng5ctBhlbW1hLmdvbGRtYW5AZXhhbXBsZS5uZXSIlgUTFggASCIhBRk0e8mHJGQC -X5nfPsLgAA7ZiEiS4fez6kyUAJFZVptUBQJckfTkAhsDBQsJCAcCAyICAQYVCgkI -CwIEFgIDAQIeBwIXgAAA9cAA/jiR3yMsZMeEQ40u6uzEoXa6UXeV/S3wwJAXRJy9 -M8s0AP9vuL/7AyTfFXwwzSjDnYmzS0qAhbLDQ643N+MXGBJ2BZxmBVyR9OQSAAAA -MgorBgEEAZdVAQUBAQdA+nysrzml2UCweAqtpDuncSPlvrcBWKU0yfU0YvYWWAoD -AQgHAAAAAAAiAP9OdAPppjU1WwpqjIItkxr+VPQRT8Zm/Riw7U3F6v3OiBFHiHoF -GBYIACwiIQUZNHvJhyRkAl+Z3z7C4AAO2YhIkuH3s+pMlACRWVabVAUCXJH05AIb -DAAAOSQBAP4BOOIR/sGLNMOfeb5fPs/02QMieoiSjIBnijhob2U5AQC+RtOHCHx7 -TcIYl5/Uyoi+FOvPLcNw4hOv2nwUzSSVAw== -=IiS2 ------END PGP PRIVATE KEY BLOCK-----` - -// Generated with the above private key -const v5PrivKeyMsg = `-----BEGIN PGP MESSAGE----- -Version: OpenPGP.js v4.10.7 -Comment: https://openpgpjs.org - -xA0DAQoWGTR7yYckZAIByxF1B21zZy50eHRfbIGSdGVzdMJ3BQEWCgAGBQJf -bIGSACMiIQUZNHvJhyRkAl+Z3z7C4AAO2YhIkuH3s+pMlACRWVabVDQvAP9G -y29VPonFXqi2zKkpZrvyvZxg+n5e8Nt9wNbuxeCd3QD/TtO2s+JvjrE4Siwv -UQdl5MlBka1QSNbMq2Bz7XwNPg4= -=6lbM ------END PGP MESSAGE-----` - -const keyWithExpiredCrossSig = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -xsDNBF2lnPIBDAC5cL9PQoQLTMuhjbYvb4Ncuuo0bfmgPRFywX53jPhoFf4Zg6mv -/seOXpgecTdOcVttfzC8ycIKrt3aQTiwOG/ctaR4Bk/t6ayNFfdUNxHWk4WCKzdz -/56fW2O0F23qIRd8UUJp5IIlN4RDdRCtdhVQIAuzvp2oVy/LaS2kxQoKvph/5pQ/ -5whqsyroEWDJoSV0yOb25B/iwk/pLUFoyhDG9bj0kIzDxrEqW+7Ba8nocQlecMF3 -X5KMN5kp2zraLv9dlBBpWW43XktjcCZgMy20SouraVma8Je/ECwUWYUiAZxLIlMv -9CurEOtxUw6N3RdOtLmYZS9uEnn5y1UkF88o8Nku890uk6BrewFzJyLAx5wRZ4F0 -qV/yq36UWQ0JB/AUGhHVPdFf6pl6eaxBwT5GXvbBUibtf8YI2og5RsgTWtXfU7eb -SGXrl5ZMpbA6mbfhd0R8aPxWfmDWiIOhBufhMCvUHh1sApMKVZnvIff9/0Dca3wb -vLIwa3T4CyshfT0AEQEAAc0hQm9iIEJhYmJhZ2UgPGJvYkBvcGVucGdwLmV4YW1w -bGU+wsEABBMBCgATBYJeO2eVAgsJAxUICgKbAQIeAQAhCRD7/MgqAV5zMBYhBNGm -bhojsYLJmA94jPv8yCoBXnMwKWUMAJ3FKZfJ2mXvh+GFqgymvK4NoKkDRPB0CbUN -aDdG7ZOizQrWXo7Da2MYIZ6eZUDqBKLdhZ5gZfVnisDfu/yeCgpENaKib1MPHpA8 -nZQjnPejbBDomNqY8HRzr5jvXNlwywBpjWGtegCKUY9xbSynjbfzIlMrWL4S+Rfl -+bOOQKRyYJWXmECmVyqY8cz2VUYmETjNcwC8VCDUxQnhtcCJ7Aej22hfYwVEPb/J -BsJBPq8WECCiGfJ9Y2y6TF+62KzG9Kfs5hqUeHhQy8V4TSi479ewwL7DH86XmIIK -chSANBS+7iyMtctjNZfmF9zYdGJFvjI/mbBR/lK66E515Inuf75XnL8hqlXuwqvG -ni+i03Aet1DzULZEIio4uIU6ioc1lGO9h7K2Xn4S7QQH1QoISNMWqXibUR0RCGjw -FsEDTt2QwJl8XXxoJCooM7BCcCQo+rMNVUHDjIwrdoQjPld3YZsUQQRcqH6bLuln -cfn5ufl8zTGWKydoj/iTz8KcjZ7w187AzQRdpZzyAQwA1jC/XGxjK6ddgrRfW9j+ -s/U00++EvIsgTs2kr3Rg0GP7FLWV0YNtR1mpl55/bEl7yAxCDTkOgPUMXcaKlnQh -6zrlt6H53mF6Bvs3inOHQvOsGtU0dqvb1vkTF0juLiJgPlM7pWv+pNQ6IA39vKoQ -sTMBv4v5vYNXP9GgKbg8inUNT17BxzZYHfw5+q63ectgDm2on1e8CIRCZ76oBVwz -dkVxoy3gjh1eENlk2D4P0uJNZzF1Q8GV67yLANGMCDICE/OkWn6daipYDzW4iJQt -YPUWP4hWhjdm+CK+hg6IQUEn2Vtvi16D2blRP8BpUNNa4fNuylWVuJV76rIHvsLZ -1pbM3LHpRgE8s6jivS3Rz3WRs0TmWCNnvHPqWizQ3VTy+r3UQVJ5AmhJDrZdZq9i -aUIuZ01PoE1+CHiJwuxPtWvVAxf2POcm1M/F1fK1J0e+lKlQuyonTXqXR22Y41wr -fP2aPk3nPSTW2DUAf3vRMZg57ZpRxLEhEMxcM4/LMR+PABEBAAHCwrIEGAEKAAkF -gl8sAVYCmwIB3QkQ+/zIKgFeczDA+qAEGQEKAAwFgl47Z5UFgwB4TOAAIQkQfC+q -Tfk8N7IWIQQd3OFfCSF87i87N2B8L6pN+Tw3st58C/0exp0X2U4LqicSHEOSqHZj -jiysdqIELHGyo5DSPv92UFPp36aqjF9OFgtNNwSa56fmAVCD4+hor/fKARRIeIjF -qdIC5Y/9a4B10NQFJa5lsvB38x/d39LI2kEoglZnqWgdJskROo3vNQF4KlIcm6FH -dn4WI8UkC5oUUcrpZVMSKoacIaxLwqnXT42nIVgYYuqrd/ZagZZjG5WlrTOd5+NI -zi/l0fWProcPHGLjmAh4Thu8i7omtVw1nQaMnq9I77ffg3cPDgXknYrLL+q8xXh/ -0mEJyIhnmPwllWCSZuLv9DrD5pOexFfdlwXhf6cLzNpW6QhXD/Tf5KrqIPr9aOv8 -9xaEEXWh0vEby2kIsI2++ft+vfdIyxYw/wKqx0awTSnuBV1rG3z1dswX4BfoY66x -Bz3KOVqlz9+mG/FTRQwrgPvR+qgLCHbuotxoGN7fzW+PI75hQG5JQAqhsC9sHjQH -UrI21/VUNwzfw3v5pYsWuFb5bdQ3ASJetICQiMy7IW8WIQTRpm4aI7GCyZgPeIz7 -/MgqAV5zMG6/C/wLpPl/9e6Hf5wmXIUwpZNQbNZvpiCcyx9sXsHXaycOQVxn3McZ -nYOUP9/mobl1tIeDQyTNbkxWjU0zzJl8XQsDZerb5098pg+x7oGIL7M1vn5s5JMl -owROourqF88JEtOBxLMxlAM7X4hB48xKQ3Hu9hS1GdnqLKki4MqRGl4l5FUwyGOM -GjyS3TzkfiDJNwQxybQiC9n57ij20ieNyLfuWCMLcNNnZUgZtnF6wCctoq/0ZIWu -a7nvuA/XC2WW9YjEJJiWdy5109pqac+qWiY11HWy/nms4gpMdxVpT0RhrKGWq4o0 -M5q3ZElOoeN70UO3OSbU5EVrG7gB1GuwF9mTHUVlV0veSTw0axkta3FGT//XfSpD -lRrCkyLzwq0M+UUHQAuYpAfobDlDdnxxOD2jm5GyTzak3GSVFfjW09QFVO6HlGp5 -01/jtzkUiS6nwoHHkfnyn0beZuR8X6KlcrzLB0VFgQFLmkSM9cSOgYhD0PTu9aHb -hW1Hj9AO8lzggBQ= -=Nt+N ------END PGP PUBLIC KEY BLOCK----- -` - -const sigFromKeyWithExpiredCrossSig = `-----BEGIN PGP SIGNATURE----- - -wsDzBAABCgAGBYJfLAFsACEJEHwvqk35PDeyFiEEHdzhXwkhfO4vOzdgfC+qTfk8 -N7KiqwwAts4QGB7v9bABCC2qkTxJhmStC0wQMcHRcjL/qAiVnmasQWmvE9KVsdm3 -AaXd8mIx4a37/RRvr9dYrY2eE4uw72cMqPxNja2tvVXkHQvk1oEUqfkvbXs4ypKI -NyeTWjXNOTZEbg0hbm3nMy+Wv7zgB1CEvAsEboLDJlhGqPcD+X8a6CJGrBGUBUrv -KVmZr3U6vEzClz3DBLpoddCQseJRhT4YM1nKmBlZ5quh2LFgTSpajv5OsZheqt9y -EZAPbqmLhDmWRQwGzkWHKceKS7nZ/ox2WK6OS7Ob8ZGZkM64iPo6/EGj5Yc19vQN -AGiIaPEGszBBWlOpHTPhNm0LB0nMWqqaT87oNYwP8CQuuxDb6rKJ2lffCmZH27Lb -UbQZcH8J+0UhpeaiadPZxH5ATJAcenmVtVVMLVOFnm+eIlxzov9ntpgGYt8hLdXB -ITEG9mMgp3TGS9ZzSifMZ8UGtHdp9QdBg8NEVPFzDOMGxpc/Bftav7RRRuPiAER+ -7A5CBid5 -=aQkm ------END PGP SIGNATURE----- -` - -const signedMessageWithCriticalNotation = `-----BEGIN PGP MESSAGE----- - -owGbwMvMwMH4oOW7S46CznTG09xJDDE3Wl1KUotLuDousDAwcjBYiSmyXL+48d6x -U1PSGUxcj8IUszKBVMpMaWAAAgEGZpAeh9SKxNyCnFS95PzcytRiBi5OAZjyXXzM -f8WYLqv7TXP61Sa4rqT12CI3xaN73YS2pt089f96odCKaEPnWJ3iSGmzJaW/ug10 -2Zo8Wj2k4s7t8wt4H3HtTu+y5UZfV3VOO+l//sdE/o+Lsub8FZH7/eOq7OnbNp4n -vwjE8mqJXetNMfj8r2SCyvkEnlVRYR+/mnge+ib56FdJ8uKtqSxyvgA= -=fRXs ------END PGP MESSAGE-----` - -const criticalNotationSigner = `-----BEGIN PGP PUBLIC KEY BLOCK----- - -mI0EUmEvTgEEANyWtQQMOybQ9JltDqmaX0WnNPJeLILIM36sw6zL0nfTQ5zXSS3+ -fIF6P29lJFxpblWk02PSID5zX/DYU9/zjM2xPO8Oa4xo0cVTOTLj++Ri5mtr//f5 -GLsIXxFrBJhD/ghFsL3Op0GXOeLJ9A5bsOn8th7x6JucNKuaRB6bQbSPABEBAAG0 -JFRlc3QgTWNUZXN0aW5ndG9uIDx0ZXN0QGV4YW1wbGUuY29tPoi5BBMBAgAjBQJS -YS9OAhsvBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AACgkQSmNhOk1uQJQwDAP6 -AgrTyqkRlJVqz2pb46TfbDM2TDF7o9CBnBzIGoxBhlRwpqALz7z2kxBDmwpQa+ki -Bq3jZN/UosY9y8bhwMAlnrDY9jP1gdCo+H0sD48CdXybblNwaYpwqC8VSpDdTndf -9j2wE/weihGp/DAdy/2kyBCaiOY1sjhUfJ1GogF49rC4jQRSYS9OAQQA6R/PtBFa -JaT4jq10yqASk4sqwVMsc6HcifM5lSdxzExFP74naUMMyEsKHP53QxTF0Grqusag -Qg/ZtgT0CN1HUM152y7ACOdp1giKjpMzOTQClqCoclyvWOFB+L/SwGEIJf7LSCEr -woBuJifJc8xAVr0XX0JthoW+uP91eTQ3XpsAEQEAAYkBPQQYAQIACQUCUmEvTgIb -LgCoCRBKY2E6TW5AlJ0gBBkBAgAGBQJSYS9OAAoJEOCE90RsICyXuqIEANmmiRCA -SF7YK7PvFkieJNwzeK0V3F2lGX+uu6Y3Q/Zxdtwc4xR+me/CSBmsURyXTO29OWhP -GLszPH9zSJU9BdDi6v0yNprmFPX/1Ng0Abn/sCkwetvjxC1YIvTLFwtUL/7v6NS2 -bZpsUxRTg9+cSrMWWSNjiY9qUKajm1tuzPDZXAUEAMNmAN3xXN/Kjyvj2OK2ck0X -W748sl/tc3qiKPMJ+0AkMF7Pjhmh9nxqE9+QCEl7qinFqqBLjuzgUhBU4QlwX1GD -AtNTq6ihLMD5v1d82ZC7tNatdlDMGWnIdvEMCv2GZcuIqDQ9rXWs49e7tq1NncLY -hz3tYjKhoFTKEIq3y3Pp -=h/aX ------END PGP PUBLIC KEY BLOCK-----` diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go deleted file mode 100644 index a43695964b..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k.go +++ /dev/null @@ -1,407 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package s2k implements the various OpenPGP string-to-key transforms as -// specified in RFC 4800 section 3.7.1, and Argon2 specified in -// draft-ietf-openpgp-crypto-refresh-08 section 3.7.1.4. -package s2k // import "github.com/ProtonMail/go-crypto/openpgp/s2k" - -import ( - "crypto" - "hash" - "io" - "strconv" - - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "golang.org/x/crypto/argon2" -) - -type Mode uint8 - -// Defines the default S2KMode constants -// -// 0 (simple), 1(salted), 3(iterated), 4(argon2) -const ( - SimpleS2K Mode = 0 - SaltedS2K Mode = 1 - IteratedSaltedS2K Mode = 3 - Argon2S2K Mode = 4 - GnuS2K Mode = 101 -) - -const Argon2SaltSize int = 16 - -// Params contains all the parameters of the s2k packet -type Params struct { - // mode is the mode of s2k function. - // It can be 0 (simple), 1(salted), 3(iterated) - // 2(reserved) 100-110(private/experimental). - mode Mode - // hashId is the ID of the hash function used in any of the modes - hashId byte - // salt is a byte array to use as a salt in hashing process or argon2 - saltBytes [Argon2SaltSize]byte - // countByte is used to determine how many rounds of hashing are to - // be performed in s2k mode 3. See RFC 4880 Section 3.7.1.3. - countByte byte - // passes is a parameter in Argon2 to determine the number of iterations - // See RFC the crypto refresh Section 3.7.1.4. - passes byte - // parallelism is a parameter in Argon2 to determine the degree of paralellism - // See RFC the crypto refresh Section 3.7.1.4. - parallelism byte - // memoryExp is a parameter in Argon2 to determine the memory usage - // i.e., 2 ** memoryExp kibibytes - // See RFC the crypto refresh Section 3.7.1.4. - memoryExp byte -} - -// encodeCount converts an iterative "count" in the range 1024 to -// 65011712, inclusive, to an encoded count. The return value is the -// octet that is actually stored in the GPG file. encodeCount panics -// if i is not in the above range (encodedCount above takes care to -// pass i in the correct range). See RFC 4880 Section 3.7.7.1. -func encodeCount(i int) uint8 { - if i < 65536 || i > 65011712 { - panic("count arg i outside the required range") - } - - for encoded := 96; encoded < 256; encoded++ { - count := decodeCount(uint8(encoded)) - if count >= i { - return uint8(encoded) - } - } - - return 255 -} - -// decodeCount returns the s2k mode 3 iterative "count" corresponding to -// the encoded octet c. -func decodeCount(c uint8) int { - return (16 + int(c&15)) << (uint32(c>>4) + 6) -} - -// encodeMemory converts the Argon2 "memory" in the range parallelism*8 to -// 2**31, inclusive, to an encoded memory. The return value is the -// octet that is actually stored in the GPG file. encodeMemory panics -// if is not in the above range -// See OpenPGP crypto refresh Section 3.7.1.4. -func encodeMemory(memory uint32, parallelism uint8) uint8 { - if memory < (8 * uint32(parallelism)) || memory > uint32(2147483648) { - panic("Memory argument memory is outside the required range") - } - - for exp := 3; exp < 31; exp++ { - compare := decodeMemory(uint8(exp)) - if compare >= memory { - return uint8(exp) - } - } - - return 31 -} - -// decodeMemory computes the decoded memory in kibibytes as 2**memoryExponent -func decodeMemory(memoryExponent uint8) uint32 { - return uint32(1) << memoryExponent -} - -// Simple writes to out the result of computing the Simple S2K function (RFC -// 4880, section 3.7.1.1) using the given hash and input passphrase. -func Simple(out []byte, h hash.Hash, in []byte) { - Salted(out, h, in, nil) -} - -var zero [1]byte - -// Salted writes to out the result of computing the Salted S2K function (RFC -// 4880, section 3.7.1.2) using the given hash, input passphrase and salt. -func Salted(out []byte, h hash.Hash, in []byte, salt []byte) { - done := 0 - var digest []byte - - for i := 0; done < len(out); i++ { - h.Reset() - for j := 0; j < i; j++ { - h.Write(zero[:]) - } - h.Write(salt) - h.Write(in) - digest = h.Sum(digest[:0]) - n := copy(out[done:], digest) - done += n - } -} - -// Iterated writes to out the result of computing the Iterated and Salted S2K -// function (RFC 4880, section 3.7.1.3) using the given hash, input passphrase, -// salt and iteration count. -func Iterated(out []byte, h hash.Hash, in []byte, salt []byte, count int) { - combined := make([]byte, len(in)+len(salt)) - copy(combined, salt) - copy(combined[len(salt):], in) - - if count < len(combined) { - count = len(combined) - } - - done := 0 - var digest []byte - for i := 0; done < len(out); i++ { - h.Reset() - for j := 0; j < i; j++ { - h.Write(zero[:]) - } - written := 0 - for written < count { - if written+len(combined) > count { - todo := count - written - h.Write(combined[:todo]) - written = count - } else { - h.Write(combined) - written += len(combined) - } - } - digest = h.Sum(digest[:0]) - n := copy(out[done:], digest) - done += n - } -} - -// Argon2 writes to out the key derived from the password (in) with the Argon2 -// function (the crypto refresh, section 3.7.1.4) -func Argon2(out []byte, in []byte, salt []byte, passes uint8, paralellism uint8, memoryExp uint8) { - key := argon2.IDKey(in, salt, uint32(passes), decodeMemory(memoryExp), paralellism, uint32(len(out))) - copy(out[:], key) -} - -// Generate generates valid parameters from given configuration. -// It will enforce the Iterated and Salted or Argon2 S2K method. -func Generate(rand io.Reader, c *Config) (*Params, error) { - var params *Params - if c != nil && c.Mode() == Argon2S2K { - // handle Argon2 case - argonConfig := c.Argon2() - params = &Params{ - mode: Argon2S2K, - passes: argonConfig.Passes(), - parallelism: argonConfig.Parallelism(), - memoryExp: argonConfig.EncodedMemory(), - } - } else if c != nil && c.PassphraseIsHighEntropy && c.Mode() == SaltedS2K { // Allow SaltedS2K if PassphraseIsHighEntropy - hashId, ok := algorithm.HashToHashId(c.hash()) - if !ok { - return nil, errors.UnsupportedError("no such hash") - } - - params = &Params{ - mode: SaltedS2K, - hashId: hashId, - } - } else { // Enforce IteratedSaltedS2K method otherwise - hashId, ok := algorithm.HashToHashId(c.hash()) - if !ok { - return nil, errors.UnsupportedError("no such hash") - } - if c != nil { - c.S2KMode = IteratedSaltedS2K - } - params = &Params{ - mode: IteratedSaltedS2K, - hashId: hashId, - countByte: c.EncodedCount(), - } - } - if _, err := io.ReadFull(rand, params.salt()); err != nil { - return nil, err - } - return params, nil -} - -// Parse reads a binary specification for a string-to-key transformation from r -// and returns a function which performs that transform. If the S2K is a special -// GNU extension that indicates that the private key is missing, then the error -// returned is errors.ErrDummyPrivateKey. -func Parse(r io.Reader) (f func(out, in []byte), err error) { - params, err := ParseIntoParams(r) - if err != nil { - return nil, err - } - - return params.Function() -} - -// ParseIntoParams reads a binary specification for a string-to-key -// transformation from r and returns a struct describing the s2k parameters. -func ParseIntoParams(r io.Reader) (params *Params, err error) { - var buf [Argon2SaltSize + 3]byte - - _, err = io.ReadFull(r, buf[:1]) - if err != nil { - return - } - - params = &Params{ - mode: Mode(buf[0]), - } - - switch params.mode { - case SimpleS2K: - _, err = io.ReadFull(r, buf[:1]) - if err != nil { - return nil, err - } - params.hashId = buf[0] - return params, nil - case SaltedS2K: - _, err = io.ReadFull(r, buf[:9]) - if err != nil { - return nil, err - } - params.hashId = buf[0] - copy(params.salt(), buf[1:9]) - return params, nil - case IteratedSaltedS2K: - _, err = io.ReadFull(r, buf[:10]) - if err != nil { - return nil, err - } - params.hashId = buf[0] - copy(params.salt(), buf[1:9]) - params.countByte = buf[9] - return params, nil - case Argon2S2K: - _, err = io.ReadFull(r, buf[:Argon2SaltSize+3]) - if err != nil { - return nil, err - } - copy(params.salt(), buf[:Argon2SaltSize]) - params.passes = buf[Argon2SaltSize] - params.parallelism = buf[Argon2SaltSize+1] - params.memoryExp = buf[Argon2SaltSize+2] - return params, nil - case GnuS2K: - // This is a GNU extension. See - // https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=doc/DETAILS;h=fe55ae16ab4e26d8356dc574c9e8bc935e71aef1;hb=23191d7851eae2217ecdac6484349849a24fd94a#l1109 - if _, err = io.ReadFull(r, buf[:5]); err != nil { - return nil, err - } - params.hashId = buf[0] - if buf[1] == 'G' && buf[2] == 'N' && buf[3] == 'U' && buf[4] == 1 { - return params, nil - } - return nil, errors.UnsupportedError("GNU S2K extension") - } - - return nil, errors.UnsupportedError("S2K function") -} - -func (params *Params) Dummy() bool { - return params != nil && params.mode == GnuS2K -} - -func (params *Params) salt() []byte { - switch params.mode { - case SaltedS2K, IteratedSaltedS2K: return params.saltBytes[:8] - case Argon2S2K: return params.saltBytes[:Argon2SaltSize] - default: return nil - } -} - -func (params *Params) Function() (f func(out, in []byte), err error) { - if params.Dummy() { - return nil, errors.ErrDummyPrivateKey("dummy key found") - } - var hashObj crypto.Hash - if params.mode != Argon2S2K { - var ok bool - hashObj, ok = algorithm.HashIdToHashWithSha1(params.hashId) - if !ok { - return nil, errors.UnsupportedError("hash for S2K function: " + strconv.Itoa(int(params.hashId))) - } - if !hashObj.Available() { - return nil, errors.UnsupportedError("hash not available: " + strconv.Itoa(int(hashObj))) - } - } - - switch params.mode { - case SimpleS2K: - f := func(out, in []byte) { - Simple(out, hashObj.New(), in) - } - - return f, nil - case SaltedS2K: - f := func(out, in []byte) { - Salted(out, hashObj.New(), in, params.salt()) - } - - return f, nil - case IteratedSaltedS2K: - f := func(out, in []byte) { - Iterated(out, hashObj.New(), in, params.salt(), decodeCount(params.countByte)) - } - - return f, nil - case Argon2S2K: - f := func(out, in []byte) { - Argon2(out, in, params.salt(), params.passes, params.parallelism, params.memoryExp) - } - return f, nil - } - - return nil, errors.UnsupportedError("S2K function") -} - -func (params *Params) Serialize(w io.Writer) (err error) { - if _, err = w.Write([]byte{uint8(params.mode)}); err != nil { - return - } - if params.mode != Argon2S2K { - if _, err = w.Write([]byte{params.hashId}); err != nil { - return - } - } - if params.Dummy() { - _, err = w.Write(append([]byte("GNU"), 1)) - return - } - if params.mode > 0 { - if _, err = w.Write(params.salt()); err != nil { - return - } - if params.mode == IteratedSaltedS2K { - _, err = w.Write([]byte{params.countByte}) - } - if params.mode == Argon2S2K { - _, err = w.Write([]byte{params.passes, params.parallelism, params.memoryExp}) - } - } - return -} - -// Serialize salts and stretches the given passphrase and writes the -// resulting key into key. It also serializes an S2K descriptor to -// w. The key stretching can be configured with c, which may be -// nil. In that case, sensible defaults will be used. -func Serialize(w io.Writer, key []byte, rand io.Reader, passphrase []byte, c *Config) error { - params, err := Generate(rand, c) - if err != nil { - return err - } - err = params.Serialize(w) - if err != nil { - return err - } - - f, err := params.Function() - if err != nil { - return err - } - f(key, passphrase) - return nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go deleted file mode 100644 index 25a4442dfb..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_cache.go +++ /dev/null @@ -1,26 +0,0 @@ -package s2k - -// Cache stores keys derived with s2k functions from one passphrase -// to avoid recomputation if multiple items are encrypted with -// the same parameters. -type Cache map[Params][]byte - -// GetOrComputeDerivedKey tries to retrieve the key -// for the given s2k parameters from the cache. -// If there is no hit, it derives the key with the s2k function from the passphrase, -// updates the cache, and returns the key. -func (c *Cache) GetOrComputeDerivedKey(passphrase []byte, params *Params, expectedKeySize int) ([]byte, error) { - key, found := (*c)[*params] - if !found || len(key) != expectedKeySize { - var err error - derivedKey := make([]byte, expectedKeySize) - s2k, err := params.Function() - if err != nil { - return nil, err - } - s2k(derivedKey, passphrase) - (*c)[*params] = key - return derivedKey, nil - } - return key, nil -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go deleted file mode 100644 index b40be5228f..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/s2k/s2k_config.go +++ /dev/null @@ -1,129 +0,0 @@ -package s2k - -import "crypto" - -// Config collects configuration parameters for s2k key-stretching -// transformations. A nil *Config is valid and results in all default -// values. -type Config struct { - // S2K (String to Key) mode, used for key derivation in the context of secret key encryption - // and passphrase-encrypted data. Either s2k.Argon2S2K or s2k.IteratedSaltedS2K may be used. - // If the passphrase is a high-entropy key, indicated by setting PassphraseIsHighEntropy to true, - // s2k.SaltedS2K can also be used. - // Note: Argon2 is the strongest option but not all OpenPGP implementations are compatible with it - //(pending standardisation). - // 0 (simple), 1(salted), 3(iterated), 4(argon2) - // 2(reserved) 100-110(private/experimental). - S2KMode Mode - // Only relevant if S2KMode is not set to s2k.Argon2S2K. - // Hash is the default hash function to be used. If - // nil, SHA256 is used. - Hash crypto.Hash - // Argon2 parameters for S2K (String to Key). - // Only relevant if S2KMode is set to s2k.Argon2S2K. - // If nil, default parameters are used. - // For more details on the choice of parameters, see https://tools.ietf.org/html/rfc9106#section-4. - Argon2Config *Argon2Config - // Only relevant if S2KMode is set to s2k.IteratedSaltedS2K. - // Iteration count for Iterated S2K (String to Key). It - // determines the strength of the passphrase stretching when - // the said passphrase is hashed to produce a key. S2KCount - // should be between 65536 and 65011712, inclusive. If Config - // is nil or S2KCount is 0, the value 16777216 used. Not all - // values in the above range can be represented. S2KCount will - // be rounded up to the next representable value if it cannot - // be encoded exactly. When set, it is strongly encrouraged to - // use a value that is at least 65536. See RFC 4880 Section - // 3.7.1.3. - S2KCount int - // Indicates whether the passphrase passed by the application is a - // high-entropy key (e.g. it's randomly generated or derived from - // another passphrase using a strong key derivation function). - // When true, allows the S2KMode to be s2k.SaltedS2K. - // When the passphrase is not a high-entropy key, using SaltedS2K is - // insecure, and not allowed by draft-ietf-openpgp-crypto-refresh-08. - PassphraseIsHighEntropy bool -} - -// Argon2Config stores the Argon2 parameters -// A nil *Argon2Config is valid and results in all default -type Argon2Config struct { - NumberOfPasses uint8 - DegreeOfParallelism uint8 - // The memory parameter for Argon2 specifies desired memory usage in kibibytes. - // For example memory=64*1024 sets the memory cost to ~64 MB. - Memory uint32 -} - -func (c *Config) Mode() Mode { - if c == nil { - return IteratedSaltedS2K - } - return c.S2KMode -} - -func (c *Config) hash() crypto.Hash { - if c == nil || uint(c.Hash) == 0 { - return crypto.SHA256 - } - - return c.Hash -} - -func (c *Config) Argon2() *Argon2Config { - if c == nil || c.Argon2Config == nil { - return nil - } - return c.Argon2Config -} - -// EncodedCount get encoded count -func (c *Config) EncodedCount() uint8 { - if c == nil || c.S2KCount == 0 { - return 224 // The common case. Corresponding to 16777216 - } - - i := c.S2KCount - - switch { - case i < 65536: - i = 65536 - case i > 65011712: - i = 65011712 - } - - return encodeCount(i) -} - -func (c *Argon2Config) Passes() uint8 { - if c == nil || c.NumberOfPasses == 0 { - return 3 - } - return c.NumberOfPasses -} - -func (c *Argon2Config) Parallelism() uint8 { - if c == nil || c.DegreeOfParallelism == 0 { - return 4 - } - return c.DegreeOfParallelism -} - -func (c *Argon2Config) EncodedMemory() uint8 { - if c == nil || c.Memory == 0 { - return 16 // 64 MiB of RAM - } - - memory := c.Memory - lowerBound := uint32(c.Parallelism())*8 - upperBound := uint32(2147483648) - - switch { - case memory < lowerBound: - memory = lowerBound - case memory > upperBound: - memory = upperBound - } - - return encodeMemory(memory, c.Parallelism()) -} diff --git a/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go b/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go deleted file mode 100644 index 7fdd13a3dd..0000000000 --- a/vendor/github.com/ProtonMail/go-crypto/openpgp/write.go +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package openpgp - -import ( - "crypto" - "hash" - "io" - "strconv" - "time" - - "github.com/ProtonMail/go-crypto/openpgp/armor" - "github.com/ProtonMail/go-crypto/openpgp/errors" - "github.com/ProtonMail/go-crypto/openpgp/internal/algorithm" - "github.com/ProtonMail/go-crypto/openpgp/packet" -) - -// DetachSign signs message with the private key from signer (which must -// already have been decrypted) and writes the signature to w. -// If config is nil, sensible defaults will be used. -func DetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return detachSign(w, signer, message, packet.SigTypeBinary, config) -} - -// ArmoredDetachSign signs message with the private key from signer (which -// must already have been decrypted) and writes an armored signature to w. -// If config is nil, sensible defaults will be used. -func ArmoredDetachSign(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) (err error) { - return armoredDetachSign(w, signer, message, packet.SigTypeBinary, config) -} - -// DetachSignText signs message (after canonicalising the line endings) with -// the private key from signer (which must already have been decrypted) and -// writes the signature to w. -// If config is nil, sensible defaults will be used. -func DetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return detachSign(w, signer, message, packet.SigTypeText, config) -} - -// ArmoredDetachSignText signs message (after canonicalising the line endings) -// with the private key from signer (which must already have been decrypted) -// and writes an armored signature to w. -// If config is nil, sensible defaults will be used. -func ArmoredDetachSignText(w io.Writer, signer *Entity, message io.Reader, config *packet.Config) error { - return armoredDetachSign(w, signer, message, packet.SigTypeText, config) -} - -func armoredDetachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { - out, err := armor.Encode(w, SignatureType, nil) - if err != nil { - return - } - err = detachSign(out, signer, message, sigType, config) - if err != nil { - return - } - return out.Close() -} - -func detachSign(w io.Writer, signer *Entity, message io.Reader, sigType packet.SignatureType, config *packet.Config) (err error) { - signingKey, ok := signer.SigningKeyById(config.Now(), config.SigningKey()) - if !ok { - return errors.InvalidArgumentError("no valid signing keys") - } - if signingKey.PrivateKey == nil { - return errors.InvalidArgumentError("signing key doesn't have a private key") - } - if signingKey.PrivateKey.Encrypted { - return errors.InvalidArgumentError("signing key is encrypted") - } - if _, ok := algorithm.HashToHashId(config.Hash()); !ok { - return errors.InvalidArgumentError("invalid hash function") - } - - sig := createSignaturePacket(signingKey.PublicKey, sigType, config) - - h, wrappedHash, err := hashForSignature(sig.Hash, sig.SigType) - if err != nil { - return - } - if _, err = io.Copy(wrappedHash, message); err != nil { - return err - } - - err = sig.Sign(h, signingKey.PrivateKey, config) - if err != nil { - return - } - - return sig.Serialize(w) -} - -// FileHints contains metadata about encrypted files. This metadata is, itself, -// encrypted. -type FileHints struct { - // IsBinary can be set to hint that the contents are binary data. - IsBinary bool - // FileName hints at the name of the file that should be written. It's - // truncated to 255 bytes if longer. It may be empty to suggest that the - // file should not be written to disk. It may be equal to "_CONSOLE" to - // suggest the data should not be written to disk. - FileName string - // ModTime contains the modification time of the file, or the zero time if not applicable. - ModTime time.Time -} - -// SymmetricallyEncrypt acts like gpg -c: it encrypts a file with a passphrase. -// The resulting WriteCloser must be closed after the contents of the file have -// been written. -// If config is nil, sensible defaults will be used. -func SymmetricallyEncrypt(ciphertext io.Writer, passphrase []byte, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - if hints == nil { - hints = &FileHints{} - } - - key, err := packet.SerializeSymmetricKeyEncrypted(ciphertext, passphrase, config) - if err != nil { - return - } - - var w io.WriteCloser - cipherSuite := packet.CipherSuite{ - Cipher: config.Cipher(), - Mode: config.AEAD().Mode(), - } - w, err = packet.SerializeSymmetricallyEncrypted(ciphertext, config.Cipher(), config.AEAD() != nil, cipherSuite, key, config) - if err != nil { - return - } - - literalData := w - if algo := config.Compression(); algo != packet.CompressionNone { - var compConfig *packet.CompressionConfig - if config != nil { - compConfig = config.CompressionConfig - } - literalData, err = packet.SerializeCompressed(w, algo, compConfig) - if err != nil { - return - } - } - - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - return packet.SerializeLiteral(literalData, hints.IsBinary, hints.FileName, epochSeconds) -} - -// intersectPreferences mutates and returns a prefix of a that contains only -// the values in the intersection of a and b. The order of a is preserved. -func intersectPreferences(a []uint8, b []uint8) (intersection []uint8) { - var j int - for _, v := range a { - for _, v2 := range b { - if v == v2 { - a[j] = v - j++ - break - } - } - } - - return a[:j] -} - -// intersectPreferences mutates and returns a prefix of a that contains only -// the values in the intersection of a and b. The order of a is preserved. -func intersectCipherSuites(a [][2]uint8, b [][2]uint8) (intersection [][2]uint8) { - var j int - for _, v := range a { - for _, v2 := range b { - if v[0] == v2[0] && v[1] == v2[1] { - a[j] = v - j++ - break - } - } - } - - return a[:j] -} - -func hashToHashId(h crypto.Hash) uint8 { - v, ok := algorithm.HashToHashId(h) - if !ok { - panic("tried to convert unknown hash") - } - return v -} - -// EncryptText encrypts a message to a number of recipients and, optionally, -// signs it. Optional information is contained in 'hints', also encrypted, that -// aids the recipients in processing the message. The resulting WriteCloser -// must be closed after the contents of the file have been written. If config -// is nil, sensible defaults will be used. The signing is done in text mode. -func EncryptText(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - return encrypt(ciphertext, ciphertext, to, signed, hints, packet.SigTypeText, config) -} - -// Encrypt encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - return encrypt(ciphertext, ciphertext, to, signed, hints, packet.SigTypeBinary, config) -} - -// EncryptSplit encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func EncryptSplit(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - return encrypt(keyWriter, dataWriter, to, signed, hints, packet.SigTypeBinary, config) -} - -// EncryptTextSplit encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func EncryptTextSplit(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, config *packet.Config) (plaintext io.WriteCloser, err error) { - return encrypt(keyWriter, dataWriter, to, signed, hints, packet.SigTypeText, config) -} - -// writeAndSign writes the data as a payload package and, optionally, signs -// it. hints contains optional information, that is also encrypted, -// that aids the recipients in processing the message. The resulting -// WriteCloser must be closed after the contents of the file have been -// written. If config is nil, sensible defaults will be used. -func writeAndSign(payload io.WriteCloser, candidateHashes []uint8, signed *Entity, hints *FileHints, sigType packet.SignatureType, config *packet.Config) (plaintext io.WriteCloser, err error) { - var signer *packet.PrivateKey - if signed != nil { - signKey, ok := signed.SigningKeyById(config.Now(), config.SigningKey()) - if !ok { - return nil, errors.InvalidArgumentError("no valid signing keys") - } - signer = signKey.PrivateKey - if signer == nil { - return nil, errors.InvalidArgumentError("no private key in signing key") - } - if signer.Encrypted { - return nil, errors.InvalidArgumentError("signing key must be decrypted") - } - } - - var hash crypto.Hash - for _, hashId := range candidateHashes { - if h, ok := algorithm.HashIdToHash(hashId); ok && h.Available() { - hash = h - break - } - } - - // If the hash specified by config is a candidate, we'll use that. - if configuredHash := config.Hash(); configuredHash.Available() { - for _, hashId := range candidateHashes { - if h, ok := algorithm.HashIdToHash(hashId); ok && h == configuredHash { - hash = h - break - } - } - } - - if hash == 0 { - hashId := candidateHashes[0] - name, ok := algorithm.HashIdToString(hashId) - if !ok { - name = "#" + strconv.Itoa(int(hashId)) - } - return nil, errors.InvalidArgumentError("cannot encrypt because no candidate hash functions are compiled in. (Wanted " + name + " in this case.)") - } - - if signer != nil { - ops := &packet.OnePassSignature{ - SigType: sigType, - Hash: hash, - PubKeyAlgo: signer.PubKeyAlgo, - KeyId: signer.KeyId, - IsLast: true, - } - if err := ops.Serialize(payload); err != nil { - return nil, err - } - } - - if hints == nil { - hints = &FileHints{} - } - - w := payload - if signer != nil { - // If we need to write a signature packet after the literal - // data then we need to stop literalData from closing - // encryptedData. - w = noOpCloser{w} - - } - var epochSeconds uint32 - if !hints.ModTime.IsZero() { - epochSeconds = uint32(hints.ModTime.Unix()) - } - literalData, err := packet.SerializeLiteral(w, hints.IsBinary, hints.FileName, epochSeconds) - if err != nil { - return nil, err - } - - if signer != nil { - h, wrappedHash, err := hashForSignature(hash, sigType) - if err != nil { - return nil, err - } - metadata := &packet.LiteralData{ - Format: 't', - FileName: hints.FileName, - Time: epochSeconds, - } - if hints.IsBinary { - metadata.Format = 'b' - } - return signatureWriter{payload, literalData, hash, wrappedHash, h, signer, sigType, config, metadata}, nil - } - return literalData, nil -} - -// encrypt encrypts a message to a number of recipients and, optionally, signs -// it. hints contains optional information, that is also encrypted, that aids -// the recipients in processing the message. The resulting WriteCloser must -// be closed after the contents of the file have been written. -// If config is nil, sensible defaults will be used. -func encrypt(keyWriter io.Writer, dataWriter io.Writer, to []*Entity, signed *Entity, hints *FileHints, sigType packet.SignatureType, config *packet.Config) (plaintext io.WriteCloser, err error) { - if len(to) == 0 { - return nil, errors.InvalidArgumentError("no encryption recipient provided") - } - - // These are the possible ciphers that we'll use for the message. - candidateCiphers := []uint8{ - uint8(packet.CipherAES256), - uint8(packet.CipherAES128), - } - - // These are the possible hash functions that we'll use for the signature. - candidateHashes := []uint8{ - hashToHashId(crypto.SHA256), - hashToHashId(crypto.SHA384), - hashToHashId(crypto.SHA512), - hashToHashId(crypto.SHA3_256), - hashToHashId(crypto.SHA3_512), - } - - // Prefer GCM if everyone supports it - candidateCipherSuites := [][2]uint8{ - {uint8(packet.CipherAES256), uint8(packet.AEADModeGCM)}, - {uint8(packet.CipherAES256), uint8(packet.AEADModeEAX)}, - {uint8(packet.CipherAES256), uint8(packet.AEADModeOCB)}, - {uint8(packet.CipherAES128), uint8(packet.AEADModeGCM)}, - {uint8(packet.CipherAES128), uint8(packet.AEADModeEAX)}, - {uint8(packet.CipherAES128), uint8(packet.AEADModeOCB)}, - } - - candidateCompression := []uint8{ - uint8(packet.CompressionNone), - uint8(packet.CompressionZIP), - uint8(packet.CompressionZLIB), - } - - encryptKeys := make([]Key, len(to)) - - // AEAD is used only if config enables it and every key supports it - aeadSupported := config.AEAD() != nil - - for i := range to { - var ok bool - encryptKeys[i], ok = to[i].EncryptionKey(config.Now()) - if !ok { - return nil, errors.InvalidArgumentError("cannot encrypt a message to key id " + strconv.FormatUint(to[i].PrimaryKey.KeyId, 16) + " because it has no valid encryption keys") - } - - sig := to[i].PrimaryIdentity().SelfSignature - if !sig.SEIPDv2 { - aeadSupported = false - } - - candidateCiphers = intersectPreferences(candidateCiphers, sig.PreferredSymmetric) - candidateHashes = intersectPreferences(candidateHashes, sig.PreferredHash) - candidateCipherSuites = intersectCipherSuites(candidateCipherSuites, sig.PreferredCipherSuites) - candidateCompression = intersectPreferences(candidateCompression, sig.PreferredCompression) - } - - // In the event that the intersection of supported algorithms is empty we use the ones - // labelled as MUST that every implementation supports. - if len(candidateCiphers) == 0 { - // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.3 - candidateCiphers = []uint8{uint8(packet.CipherAES128)} - } - if len(candidateHashes) == 0 { - // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#hash-algos - candidateHashes = []uint8{hashToHashId(crypto.SHA256)} - } - if len(candidateCipherSuites) == 0 { - // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.6 - candidateCipherSuites = [][2]uint8{{uint8(packet.CipherAES128), uint8(packet.AEADModeOCB)}} - } - - cipher := packet.CipherFunction(candidateCiphers[0]) - aeadCipherSuite := packet.CipherSuite{ - Cipher: packet.CipherFunction(candidateCipherSuites[0][0]), - Mode: packet.AEADMode(candidateCipherSuites[0][1]), - } - - // If the cipher specified by config is a candidate, we'll use that. - configuredCipher := config.Cipher() - for _, c := range candidateCiphers { - cipherFunc := packet.CipherFunction(c) - if cipherFunc == configuredCipher { - cipher = cipherFunc - break - } - } - - symKey := make([]byte, cipher.KeySize()) - if _, err := io.ReadFull(config.Random(), symKey); err != nil { - return nil, err - } - - for _, key := range encryptKeys { - if err := packet.SerializeEncryptedKey(keyWriter, key.PublicKey, cipher, symKey, config); err != nil { - return nil, err - } - } - - var payload io.WriteCloser - payload, err = packet.SerializeSymmetricallyEncrypted(dataWriter, cipher, aeadSupported, aeadCipherSuite, symKey, config) - if err != nil { - return - } - - payload, err = handleCompression(payload, candidateCompression, config) - if err != nil { - return nil, err - } - - return writeAndSign(payload, candidateHashes, signed, hints, sigType, config) -} - -// Sign signs a message. The resulting WriteCloser must be closed after the -// contents of the file have been written. hints contains optional information -// that aids the recipients in processing the message. -// If config is nil, sensible defaults will be used. -func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Config) (input io.WriteCloser, err error) { - if signed == nil { - return nil, errors.InvalidArgumentError("no signer provided") - } - - // These are the possible hash functions that we'll use for the signature. - candidateHashes := []uint8{ - hashToHashId(crypto.SHA256), - hashToHashId(crypto.SHA384), - hashToHashId(crypto.SHA512), - hashToHashId(crypto.SHA3_256), - hashToHashId(crypto.SHA3_512), - } - defaultHashes := candidateHashes[0:1] - preferredHashes := signed.PrimaryIdentity().SelfSignature.PreferredHash - if len(preferredHashes) == 0 { - preferredHashes = defaultHashes - } - candidateHashes = intersectPreferences(candidateHashes, preferredHashes) - if len(candidateHashes) == 0 { - return nil, errors.InvalidArgumentError("cannot sign because signing key shares no common algorithms with candidate hashes") - } - - return writeAndSign(noOpCloser{output}, candidateHashes, signed, hints, packet.SigTypeBinary, config) -} - -// signatureWriter hashes the contents of a message while passing it along to -// literalData. When closed, it closes literalData, writes a signature packet -// to encryptedData and then also closes encryptedData. -type signatureWriter struct { - encryptedData io.WriteCloser - literalData io.WriteCloser - hashType crypto.Hash - wrappedHash hash.Hash - h hash.Hash - signer *packet.PrivateKey - sigType packet.SignatureType - config *packet.Config - metadata *packet.LiteralData // V5 signatures protect document metadata -} - -func (s signatureWriter) Write(data []byte) (int, error) { - s.wrappedHash.Write(data) - switch s.sigType { - case packet.SigTypeBinary: - return s.literalData.Write(data) - case packet.SigTypeText: - flag := 0 - return writeCanonical(s.literalData, data, &flag) - } - return 0, errors.UnsupportedError("unsupported signature type: " + strconv.Itoa(int(s.sigType))) -} - -func (s signatureWriter) Close() error { - sig := createSignaturePacket(&s.signer.PublicKey, s.sigType, s.config) - sig.Hash = s.hashType - sig.Metadata = s.metadata - - if err := sig.Sign(s.h, s.signer, s.config); err != nil { - return err - } - if err := s.literalData.Close(); err != nil { - return err - } - if err := sig.Serialize(s.encryptedData); err != nil { - return err - } - return s.encryptedData.Close() -} - -func createSignaturePacket(signer *packet.PublicKey, sigType packet.SignatureType, config *packet.Config) *packet.Signature { - sigLifetimeSecs := config.SigLifetime() - return &packet.Signature{ - Version: signer.Version, - SigType: sigType, - PubKeyAlgo: signer.PubKeyAlgo, - Hash: config.Hash(), - CreationTime: config.Now(), - IssuerKeyId: &signer.KeyId, - IssuerFingerprint: signer.Fingerprint, - Notations: config.Notations(), - SigLifetimeSecs: &sigLifetimeSecs, - } -} - -// noOpCloser is like an ioutil.NopCloser, but for an io.Writer. -// TODO: we have two of these in OpenPGP packages alone. This probably needs -// to be promoted somewhere more common. -type noOpCloser struct { - w io.Writer -} - -func (c noOpCloser) Write(data []byte) (n int, err error) { - return c.w.Write(data) -} - -func (c noOpCloser) Close() error { - return nil -} - -func handleCompression(compressed io.WriteCloser, candidateCompression []uint8, config *packet.Config) (data io.WriteCloser, err error) { - data = compressed - confAlgo := config.Compression() - if confAlgo == packet.CompressionNone { - return - } - - // Set algorithm labelled as MUST as fallback - // https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-07.html#section-9.4 - finalAlgo := packet.CompressionNone - // if compression specified by config available we will use it - for _, c := range candidateCompression { - if uint8(confAlgo) == c { - finalAlgo = confAlgo - break - } - } - - if finalAlgo != packet.CompressionNone { - var compConfig *packet.CompressionConfig - if config != nil { - compConfig = config.CompressionConfig - } - data, err = packet.SerializeCompressed(compressed, finalAlgo, compConfig) - if err != nil { - return - } - } - return data, nil -} diff --git a/vendor/github.com/alecthomas/go-check-sumtype/.goreleaser.yml b/vendor/github.com/alecthomas/go-check-sumtype/.goreleaser.yml deleted file mode 100644 index 33bd03d060..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/.goreleaser.yml +++ /dev/null @@ -1,32 +0,0 @@ -project_name: go-check-sumtype -release: - github: - owner: alecthomas - name: go-check-sumtype -env: - - CGO_ENABLED=0 -builds: -- goos: - - linux - - darwin - - windows - goarch: - - arm64 - - amd64 - - "386" - goarm: - - "6" - main: ./cmd/go-check-sumtype - binary: go-check-sumtype -archives: - - - format: tar.gz - name_template: '{{ .Binary }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ - .Arm }}{{ end }}' - files: - - COPYING - - README* -snapshot: - name_template: SNAPSHOT-{{ .Commit }} -checksum: - name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' diff --git a/vendor/github.com/alecthomas/go-check-sumtype/COPYING b/vendor/github.com/alecthomas/go-check-sumtype/COPYING deleted file mode 100644 index bb9c20a094..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/COPYING +++ /dev/null @@ -1,3 +0,0 @@ -This project is dual-licensed under the Unlicense and MIT licenses. - -You may use this code under the terms of either license. diff --git a/vendor/github.com/alecthomas/go-check-sumtype/LICENSE-MIT b/vendor/github.com/alecthomas/go-check-sumtype/LICENSE-MIT deleted file mode 100644 index 3b0a5dc09c..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/LICENSE-MIT +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Andrew Gallant - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/alecthomas/go-check-sumtype/README.md b/vendor/github.com/alecthomas/go-check-sumtype/README.md deleted file mode 100644 index 36614ef400..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/README.md +++ /dev/null @@ -1,120 +0,0 @@ -**Note: This is a fork of the great project [go-sumtype](https://github.com/BurntSushi/go-sumtype) by BurntSushi.** -**The original seems largely unmaintained, and the changes in this fork are backwards incompatible.** - -# go-check-sumtype [![CI](https://github.com/alecthomas/go-check-sumtype/actions/workflows/ci.yml/badge.svg)](https://github.com/alecthomas/go-check-sumtype/actions/workflows/ci.yml) -A simple utility for running exhaustiveness checks on type switch statements. -Exhaustiveness checks are only run on interfaces that are declared to be -"sum types." - -Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org). - -This work was inspired by our code at -[Diffeo](https://diffeo.com). - -## Installation - -```go -$ go get github.com/alecthomas/go-check-sumtype -``` - -For usage info, just run the command: - -``` -$ go-check-sumtype -``` - -Typical usage might look like this: - -``` -$ go-check-sumtype $(go list ./... | grep -v vendor) -``` - -## Usage - -`go-check-sumtype` takes a list of Go package paths or files and looks for sum type -declarations in each package/file provided. Exhaustiveness checks are then -performed for each use of a declared sum type in a type switch statement. -Namely, `go-check-sumtype` will report an error for any type switch statement that -either lacks a `default` clause or does not account for all possible variants. - -Declarations are provided in comments like so: - -``` -//sumtype:decl -type MySumType interface { ... } -``` - -`MySumType` must be *sealed*. That is, part of its interface definition -contains an unexported method. - -`go-check-sumtype` will produce an error if any of the above is not true. - -For valid declarations, `go-check-sumtype` will look for all occurrences in which a -value of type `MySumType` participates in a type switch statement. In those -occurrences, it will attempt to detect whether the type switch is exhaustive -or not. If it's not, `go-check-sumtype` will report an error. For example, running -`go-check-sumtype` on this source file: - -```go -package main - -//sumtype:decl -type MySumType interface { - sealed() -} - -type VariantA struct{} - -func (*VariantA) sealed() {} - -type VariantB struct{} - -func (*VariantB) sealed() {} - -func main() { - switch MySumType(nil).(type) { - case *VariantA: - } -} -``` - -produces the following: - -``` -$ sumtype mysumtype.go -mysumtype.go:18:2: exhaustiveness check failed for sum type 'MySumType': missing cases for VariantB -``` - -Adding either a `default` clause or a clause to handle `*VariantB` will cause -exhaustive checks to pass. - -As a special case, if the type switch statement contains a `default` clause -that always panics, then exhaustiveness checks are still performed. - -## Details and motivation - -Sum types are otherwise known as discriminated unions. That is, a sum type is -a finite set of disjoint values. In type systems that support sum types, the -language will guarantee that if one has a sum type `T`, then its value must -be one of its variants. - -Go's type system does not support sum types. A typical proxy for representing -sum types in Go is to use an interface with an unexported method and define -each variant of the sum type in the same package to satisfy said interface. -This guarantees that the set of types that satisfy the interface is closed -at compile time. Performing case analysis on these types is then done with -a type switch statement, e.g., `switch x.(type) { ... }`. Each clause of the -type switch corresponds to a *variant* of the sum type. The downside of this -approach is that Go's type system is not aware of the set of variants, so it -cannot tell you whether case analysis over a sum type is complete or not. - -The `go-check-sumtype` command recognizes this pattern, but it needs a small amount -of help to recognize which interfaces should be treated as sum types, which -is why the `//sumtype:decl` annotation is required. `go-check-sumtype` will -figure out all of the variants of a sum type by finding the set of types -defined in the same package that satisfy the interface specified by the -declaration. - -The `go-check-sumtype` command will prove its worth when you need to add a variant -to an existing sum type. Running `go-check-sumtype` will tell you immediately which -case analyses need to be updated to account for the new variant. diff --git a/vendor/github.com/alecthomas/go-check-sumtype/UNLICENSE b/vendor/github.com/alecthomas/go-check-sumtype/UNLICENSE deleted file mode 100644 index 68a49daad8..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/UNLICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to diff --git a/vendor/github.com/alecthomas/go-check-sumtype/check.go b/vendor/github.com/alecthomas/go-check-sumtype/check.go deleted file mode 100644 index 21d751af42..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/check.go +++ /dev/null @@ -1,184 +0,0 @@ -package gochecksumtype - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "sort" - "strings" - - "golang.org/x/tools/go/packages" -) - -// inexhaustiveError is returned from check for each occurrence of inexhaustive -// case analysis in a Go type switch statement. -type inexhaustiveError struct { - Position token.Position - Def sumTypeDef - Missing []types.Object -} - -func (e inexhaustiveError) Pos() token.Position { return e.Position } -func (e inexhaustiveError) Error() string { - return fmt.Sprintf( - "%s: exhaustiveness check failed for sum type %q (from %s): missing cases for %s", - e.Pos(), e.Def.Decl.TypeName, e.Def.Decl.Pos, strings.Join(e.Names(), ", ")) -} - -// Names returns a sorted list of names corresponding to the missing variant -// cases. -func (e inexhaustiveError) Names() []string { - var list []string - for _, o := range e.Missing { - list = append(list, o.Name()) - } - sort.Strings(list) - return list -} - -// check does exhaustiveness checking for the given sum type definitions in the -// given package. Every instance of inexhaustive case analysis is returned. -func check(pkg *packages.Package, defs []sumTypeDef) []error { - var errs []error - for _, astfile := range pkg.Syntax { - ast.Inspect(astfile, func(n ast.Node) bool { - swtch, ok := n.(*ast.TypeSwitchStmt) - if !ok { - return true - } - if err := checkSwitch(pkg, defs, swtch); err != nil { - errs = append(errs, err) - } - return true - }) - } - return errs -} - -// checkSwitch performs an exhaustiveness check on the given type switch -// statement. If the type switch is used on a sum type and does not cover -// all variants of that sum type, then an error is returned indicating which -// variants were missed. -// -// Note that if the type switch contains a non-panicing default case, then -// exhaustiveness checks are disabled. -func checkSwitch( - pkg *packages.Package, - defs []sumTypeDef, - swtch *ast.TypeSwitchStmt, -) error { - def, missing := missingVariantsInSwitch(pkg, defs, swtch) - if len(missing) > 0 { - return inexhaustiveError{ - Position: pkg.Fset.Position(swtch.Pos()), - Def: *def, - Missing: missing, - } - } - return nil -} - -// missingVariantsInSwitch returns a list of missing variants corresponding to -// the given switch statement. The corresponding sum type definition is also -// returned. (If no sum type definition could be found, then no exhaustiveness -// checks are performed, and therefore, no missing variants are returned.) -func missingVariantsInSwitch( - pkg *packages.Package, - defs []sumTypeDef, - swtch *ast.TypeSwitchStmt, -) (*sumTypeDef, []types.Object) { - asserted := findTypeAssertExpr(swtch) - ty := pkg.TypesInfo.TypeOf(asserted) - def := findDef(defs, ty) - if def == nil { - // We couldn't find a corresponding sum type, so there's - // nothing we can do to check it. - return nil, nil - } - variantExprs, hasDefault := switchVariants(swtch) - if hasDefault && !defaultClauseAlwaysPanics(swtch) { - // A catch-all case defeats all exhaustiveness checks. - return def, nil - } - var variantTypes []types.Type - for _, expr := range variantExprs { - variantTypes = append(variantTypes, pkg.TypesInfo.TypeOf(expr)) - } - return def, def.missing(variantTypes) -} - -// switchVariants returns all case expressions found in a type switch. This -// includes expressions from cases that have a list of expressions. -func switchVariants(swtch *ast.TypeSwitchStmt) (exprs []ast.Expr, hasDefault bool) { - for _, stmt := range swtch.Body.List { - clause := stmt.(*ast.CaseClause) - if clause.List == nil { - hasDefault = true - } else { - exprs = append(exprs, clause.List...) - } - } - return -} - -// defaultClauseAlwaysPanics returns true if the given switch statement has a -// default clause that always panics. Note that this is done on a best-effort -// basis. While there will never be any false positives, there may be false -// negatives. -// -// If the given switch statement has no default clause, then this function -// panics. -func defaultClauseAlwaysPanics(swtch *ast.TypeSwitchStmt) bool { - var clause *ast.CaseClause - for _, stmt := range swtch.Body.List { - c := stmt.(*ast.CaseClause) - if c.List == nil { - clause = c - break - } - } - if clause == nil { - panic("switch statement has no default clause") - } - if len(clause.Body) != 1 { - return false - } - exprStmt, ok := clause.Body[0].(*ast.ExprStmt) - if !ok { - return false - } - callExpr, ok := exprStmt.X.(*ast.CallExpr) - if !ok { - return false - } - fun, ok := callExpr.Fun.(*ast.Ident) - if !ok { - return false - } - return fun.Name == "panic" -} - -// findTypeAssertExpr extracts the expression that is being type asserted from a -// type swtich statement. -func findTypeAssertExpr(swtch *ast.TypeSwitchStmt) ast.Expr { - var expr ast.Expr - if assign, ok := swtch.Assign.(*ast.AssignStmt); ok { - expr = assign.Rhs[0] - } else { - expr = swtch.Assign.(*ast.ExprStmt).X - } - return expr.(*ast.TypeAssertExpr).X -} - -// findDef returns the sum type definition corresponding to the given type. If -// no such sum type definition exists, then nil is returned. -func findDef(defs []sumTypeDef, needle types.Type) *sumTypeDef { - for i := range defs { - def := &defs[i] - if types.Identical(needle.Underlying(), def.Ty) { - return def - } - } - return nil -} diff --git a/vendor/github.com/alecthomas/go-check-sumtype/decl.go b/vendor/github.com/alecthomas/go-check-sumtype/decl.go deleted file mode 100644 index 9dec9eefd5..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/decl.go +++ /dev/null @@ -1,69 +0,0 @@ -package gochecksumtype - -import ( - "go/ast" - "go/token" - "strings" - - "golang.org/x/tools/go/packages" -) - -// sumTypeDecl is a declaration of a sum type in a Go source file. -type sumTypeDecl struct { - // The package path that contains this decl. - Package *packages.Package - // The type named by this decl. - TypeName string - // Position where the declaration was found. - Pos token.Position -} - -// Location returns a short string describing where this declaration was found. -func (d sumTypeDecl) Location() string { - return d.Pos.String() -} - -// findSumTypeDecls searches every package given for sum type declarations of -// the form `sumtype:decl`. -func findSumTypeDecls(pkgs []*packages.Package) ([]sumTypeDecl, error) { - var decls []sumTypeDecl - var retErr error - for _, pkg := range pkgs { - for _, file := range pkg.Syntax { - ast.Inspect(file, func(node ast.Node) bool { - if node == nil { - return true - } - decl, ok := node.(*ast.GenDecl) - if !ok || decl.Doc == nil { - return true - } - var tspec *ast.TypeSpec - for _, spec := range decl.Specs { - ts, ok := spec.(*ast.TypeSpec) - if !ok { - continue - } - tspec = ts - } - for _, line := range decl.Doc.List { - if !strings.HasPrefix(line.Text, "//sumtype:decl") { - continue - } - pos := pkg.Fset.Position(decl.Pos()) - if tspec == nil { - retErr = notFoundError{Decl: sumTypeDecl{Package: pkg, Pos: pos}} - return false - } - pos = pkg.Fset.Position(tspec.Pos()) - decl := sumTypeDecl{Package: pkg, TypeName: tspec.Name.Name, Pos: pos} - debugf("found sum type decl: %s.%s", decl.Package.PkgPath, decl.TypeName) - decls = append(decls, decl) - break - } - return true - }) - } - } - return decls, retErr -} diff --git a/vendor/github.com/alecthomas/go-check-sumtype/def.go b/vendor/github.com/alecthomas/go-check-sumtype/def.go deleted file mode 100644 index 24729ac01b..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/def.go +++ /dev/null @@ -1,173 +0,0 @@ -package gochecksumtype - -import ( - "flag" - "fmt" - "go/token" - "go/types" - "log" -) - -var debug = flag.Bool("debug", false, "enable debug logging") - -func debugf(format string, args ...interface{}) { - if *debug { - log.Printf(format, args...) - } -} - -// Error as returned by Run() -type Error interface { - error - Pos() token.Position -} - -// unsealedError corresponds to a declared sum type whose interface is not -// sealed. A sealed interface requires at least one unexported method. -type unsealedError struct { - Decl sumTypeDecl -} - -func (e unsealedError) Pos() token.Position { return e.Decl.Pos } -func (e unsealedError) Error() string { - return fmt.Sprintf( - "%s: interface '%s' is not sealed "+ - "(sealing requires at least one unexported method)", - e.Decl.Location(), e.Decl.TypeName) -} - -// notFoundError corresponds to a declared sum type whose type definition -// could not be found in the same Go package. -type notFoundError struct { - Decl sumTypeDecl -} - -func (e notFoundError) Pos() token.Position { return e.Decl.Pos } -func (e notFoundError) Error() string { - return fmt.Sprintf("%s: type '%s' is not defined", e.Decl.Location(), e.Decl.TypeName) -} - -// notInterfaceError corresponds to a declared sum type that does not -// correspond to an interface. -type notInterfaceError struct { - Decl sumTypeDecl -} - -func (e notInterfaceError) Pos() token.Position { return e.Decl.Pos } -func (e notInterfaceError) Error() string { - return fmt.Sprintf("%s: type '%s' is not an interface", e.Decl.Location(), e.Decl.TypeName) -} - -// sumTypeDef corresponds to the definition of a Go interface that is -// interpreted as a sum type. Its variants are determined by finding all types -// that implement said interface in the same package. -type sumTypeDef struct { - Decl sumTypeDecl - Ty *types.Interface - Variants []types.Object -} - -// findSumTypeDefs attempts to find a Go type definition for each of the given -// sum type declarations. If no such sum type definition could be found for -// any of the given declarations, then an error is returned. -func findSumTypeDefs(decls []sumTypeDecl) ([]sumTypeDef, []error) { - var defs []sumTypeDef - var errs []error - for _, decl := range decls { - def, err := newSumTypeDef(decl.Package.Types, decl) - if err != nil { - errs = append(errs, err) - continue - } - if def == nil { - errs = append(errs, notFoundError{decl}) - continue - } - defs = append(defs, *def) - } - return defs, errs -} - -// newSumTypeDef attempts to extract a sum type definition from a single -// package. If no such type corresponds to the given decl, then this function -// returns a nil def and a nil error. -// -// If the decl corresponds to a type that isn't an interface containing at -// least one unexported method, then this returns an error. -func newSumTypeDef(pkg *types.Package, decl sumTypeDecl) (*sumTypeDef, error) { - obj := pkg.Scope().Lookup(decl.TypeName) - if obj == nil { - return nil, nil - } - iface, ok := obj.Type().Underlying().(*types.Interface) - if !ok { - return nil, notInterfaceError{decl} - } - hasUnexported := false - for i := 0; i < iface.NumMethods(); i++ { - if !iface.Method(i).Exported() { - hasUnexported = true - break - } - } - if !hasUnexported { - return nil, unsealedError{decl} - } - def := &sumTypeDef{ - Decl: decl, - Ty: iface, - } - debugf("searching for variants of %s.%s\n", pkg.Path(), decl.TypeName) - for _, name := range pkg.Scope().Names() { - obj, ok := pkg.Scope().Lookup(name).(*types.TypeName) - if !ok { - continue - } - ty := obj.Type() - if types.Identical(ty.Underlying(), iface) { - continue - } - // Skip generic types. - if named, ok := ty.(*types.Named); ok && named.TypeParams() != nil { - continue - } - if types.Implements(ty, iface) || types.Implements(types.NewPointer(ty), iface) { - debugf(" found variant: %s.%s\n", pkg.Path(), obj.Name()) - def.Variants = append(def.Variants, obj) - } - } - return def, nil -} - -func (def *sumTypeDef) String() string { - return def.Decl.TypeName -} - -// missing returns a list of variants in this sum type that are not in the -// given list of types. -func (def *sumTypeDef) missing(tys []types.Type) []types.Object { - // TODO(ag): This is O(n^2). Fix that. /shrug - var missing []types.Object - for _, v := range def.Variants { - found := false - varty := indirect(v.Type()) - for _, ty := range tys { - ty = indirect(ty) - if types.Identical(varty, ty) { - found = true - } - } - if !found { - missing = append(missing, v) - } - } - return missing -} - -// indirect dereferences through an arbitrary number of pointer types. -func indirect(ty types.Type) types.Type { - if ty, ok := ty.(*types.Pointer); ok { - return indirect(ty.Elem()) - } - return ty -} diff --git a/vendor/github.com/alecthomas/go-check-sumtype/doc.go b/vendor/github.com/alecthomas/go-check-sumtype/doc.go deleted file mode 100644 index 2b6e86764e..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/doc.go +++ /dev/null @@ -1,53 +0,0 @@ -/* -sumtype takes a list of Go package paths or files and looks for sum type -declarations in each package/file provided. Exhaustiveness checks are then -performed for each use of a declared sum type in a type switch statement. -Namely, sumtype will report an error for any type switch statement that -either lacks a default clause or does not account for all possible variants. - -Declarations are provided in comments like so: - - //sumtype:decl - type MySumType interface { ... } - -MySumType must be *sealed*. That is, part of its interface definition contains -an unexported method. - -sumtype will produce an error if any of the above is not true. - -For valid declarations, sumtype will look for all occurrences in which a -value of type MySumType participates in a type switch statement. In those -occurrences, it will attempt to detect whether the type switch is exhaustive -or not. If it's not, sumtype will report an error. For example: - - $ cat mysumtype.go - package gochecksumtype - - //sumtype:decl - type MySumType interface { - sealed() - } - - type VariantA struct{} - - func (a *VariantA) sealed() {} - - type VariantB struct{} - - func (b *VariantB) sealed() {} - - func main() { - switch MySumType(nil).(type) { - case *VariantA: - } - } - $ sumtype mysumtype.go - mysumtype.go:18:2: exhaustiveness check failed for sum type 'MySumType': missing cases for VariantB - -Adding either a default clause or a clause to handle *VariantB will cause -exhaustive checks to pass. - -As a special case, if the type switch statement contains a default clause -that always panics, then exhaustiveness checks are still performed. -*/ -package gochecksumtype diff --git a/vendor/github.com/alecthomas/go-check-sumtype/run.go b/vendor/github.com/alecthomas/go-check-sumtype/run.go deleted file mode 100644 index fdcb643c5d..0000000000 --- a/vendor/github.com/alecthomas/go-check-sumtype/run.go +++ /dev/null @@ -1,26 +0,0 @@ -package gochecksumtype - -import "golang.org/x/tools/go/packages" - -// Run sumtype checking on the given packages. -func Run(pkgs []*packages.Package) []error { - var errs []error - - decls, err := findSumTypeDecls(pkgs) - if err != nil { - return []error{err} - } - - defs, defErrs := findSumTypeDefs(decls) - errs = append(errs, defErrs...) - if len(defs) == 0 { - return errs - } - - for _, pkg := range pkgs { - if pkgErrs := check(pkg, defs); pkgErrs != nil { - errs = append(errs, pkgErrs...) - } - } - return errs -} diff --git a/vendor/github.com/alexkohler/nakedret/v2/.gitignore b/vendor/github.com/alexkohler/nakedret/v2/.gitignore deleted file mode 100644 index b4822913a0..0000000000 --- a/vendor/github.com/alexkohler/nakedret/v2/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# editor specific -.vscode - -# binary -/nakedret - -# usage video for docs -.github/images diff --git a/vendor/github.com/alexkohler/nakedret/v2/LICENSE b/vendor/github.com/alexkohler/nakedret/v2/LICENSE deleted file mode 100644 index 9310fbcffb..0000000000 --- a/vendor/github.com/alexkohler/nakedret/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Alex Kohler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/alexkohler/nakedret/v2/README.md b/vendor/github.com/alexkohler/nakedret/v2/README.md deleted file mode 100644 index e30a0cde76..0000000000 --- a/vendor/github.com/alexkohler/nakedret/v2/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# nakedret - -nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length. - -## Installation -Install Nakedret via go install: - -```cmd -go install github.com/alexkohler/nakedret/cmd/nakedret@latest -``` - -If you have not already added your `GOPATH/bin` directory to your `PATH` environment variable then you will need to do so. - -Windows (cmd): -```cmd -set PATH=%PATH%;C:\your\GOPATH\bin -``` - -Bash (you can verify a path has been set): -```Bash -# Check if nakedret is on PATH -which nakedret -export PATH=$PATH:/your/GOPATH/bin #to set path if it does not exist -``` - -## Usage - -Similar to other Go static anaylsis tools (such as `golint`, `go vet`), nakedret can be invoked with one or more filenames, directories, or packages named by its import path. Nakedret also supports the `...` wildcard. - - nakedret [flags] files/directories/packages - -Currently, the only flag supported is -l, which is an optional numeric flag to specify the maximum length a function can be (in terms of line length). If not specified, it defaults to 5. - -It can also be run using `go vet`: - -```shell -go vet -vettool=$(which nakedret) ./... -``` - -## Purpose - -As noted in Go's [Code Review comments](https://github.com/golang/go/wiki/CodeReviewComments#named-result-parameters): - -> Naked returns are okay if the function is a handful of lines. Once it's a medium sized function, be explicit with your return -> values. Corollary: it's not worth it to name result parameters just because it enables you to use naked returns. Clarity of docs is always more important than saving a line or two in your function. - -This tool aims to catch naked returns on non-trivial functions. - -## Example - -Let's take the `types` package in the Go source as an example: - -```Bash -$ nakedret -l 25 types/ -types/check.go:245 checkFiles naked returns on 26 line function -types/typexpr.go:443 collectParams naked returns on 53 line function -types/stmt.go:275 caseTypes naked returns on 27 line function -types/lookup.go:275 MissingMethod naked returns on 39 line function -``` - -Below is one of the not so intuitive uses of naked returns in `types/lookup.go` found by nakedret (nakedret will return the line number of the last naked return in the function): - - -```Go -func MissingMethod(V Type, T *Interface, static bool) (method *Func, wrongType bool) { - // fast path for common case - if T.Empty() { - return - } - - // TODO(gri) Consider using method sets here. Might be more efficient. - - if ityp, _ := V.Underlying().(*Interface); ityp != nil { - // TODO(gri) allMethods is sorted - can do this more efficiently - for _, m := range T.allMethods { - _, obj := lookupMethod(ityp.allMethods, m.pkg, m.name) - switch { - case obj == nil: - if static { - return m, false - } - case !Identical(obj.Type(), m.typ): - return m, true - } - } - return - } - - // A concrete type implements T if it implements all methods of T. - for _, m := range T.allMethods { - obj, _, _ := lookupFieldOrMethod(V, false, m.pkg, m.name) - - f, _ := obj.(*Func) - if f == nil { - return m, false - } - - if !Identical(f.typ, m.typ) { - return m, true - } - } - - return -} -``` - -## TODO - -- Unit tests (may require some refactoring to do correctly) -- supporting toggling of `build.Context.UseAllFiles` may be useful for some. -- Configuration on whether or not to run on test files -- Vim quickfix format? - - -## Contributing - -Pull requests welcome! - - -## Other static analysis tools - -If you've enjoyed nakedret, take a look at my other static anaylsis tools! - -- [unimport](https://github.com/alexkohler/unimport) - Finds unnecessary import aliases -- [prealloc](https://github.com/alexkohler/prealloc) - Finds slice declarations that could potentially be preallocated. diff --git a/vendor/github.com/alexkohler/nakedret/v2/import.go b/vendor/github.com/alexkohler/nakedret/v2/import.go deleted file mode 100644 index dea8423336..0000000000 --- a/vendor/github.com/alexkohler/nakedret/v2/import.go +++ /dev/null @@ -1,310 +0,0 @@ -package nakedret - -/* - -This file holds a direct copy of the import path matching code of -https://github.com/golang/go/blob/master/src/cmd/go/main.go. It can be -replaced when https://golang.org/issue/8768 is resolved. - -It has been updated to follow upstream changes in a few ways. - -*/ - -import ( - "fmt" - "go/build" - "log" - "os" - "path" - "path/filepath" - "regexp" - "runtime" - "strings" -) - -var buildContext = build.Default - -var ( - goroot = filepath.Clean(runtime.GOROOT()) - gorootSrc = filepath.Join(goroot, "src") -) - -// importPathsNoDotExpansion returns the import paths to use for the given -// command line, but it does no ... expansion. -func importPathsNoDotExpansion(args []string) []string { - if len(args) == 0 { - return []string{"."} - } - var out []string - for _, a := range args { - // Arguments are supposed to be import paths, but - // as a courtesy to Windows developers, rewrite \ to / - // in command-line arguments. Handles .\... and so on. - if filepath.Separator == '\\' { - a = strings.Replace(a, `\`, `/`, -1) - } - - // Put argument in canonical form, but preserve leading ./. - if strings.HasPrefix(a, "./") { - a = "./" + path.Clean(a) - if a == "./." { - a = "." - } - } else { - a = path.Clean(a) - } - if a == "all" || a == "std" { - out = append(out, allPackages(a)...) - continue - } - out = append(out, a) - } - return out -} - -// importPaths returns the import paths to use for the given command line. -func importPaths(args []string) []string { - args = importPathsNoDotExpansion(args) - var out []string - for _, a := range args { - if strings.Contains(a, "...") { - if build.IsLocalImport(a) { - out = append(out, allPackagesInFS(a)...) - } else { - out = append(out, allPackages(a)...) - } - continue - } - out = append(out, a) - } - return out -} - -// matchPattern(pattern)(name) reports whether -// name matches pattern. Pattern is a limited glob -// pattern in which '...' means 'any string' and there -// is no other special syntax. -func matchPattern(pattern string) func(name string) bool { - re := regexp.QuoteMeta(pattern) - re = strings.Replace(re, `\.\.\.`, `.*`, -1) - // Special case: foo/... matches foo too. - if strings.HasSuffix(re, `/.*`) { - re = re[:len(re)-len(`/.*`)] + `(/.*)?` - } - reg := regexp.MustCompile(`^` + re + `$`) - return func(name string) bool { - return reg.MatchString(name) - } -} - -// hasPathPrefix reports whether the path s begins with the -// elements in prefix. -func hasPathPrefix(s, prefix string) bool { - switch { - default: - return false - case len(s) == len(prefix): - return s == prefix - case len(s) > len(prefix): - if prefix != "" && prefix[len(prefix)-1] == '/' { - return strings.HasPrefix(s, prefix) - } - return s[len(prefix)] == '/' && s[:len(prefix)] == prefix - } -} - -// treeCanMatchPattern(pattern)(name) reports whether -// name or children of name can possibly match pattern. -// Pattern is the same limited glob accepted by matchPattern. -func treeCanMatchPattern(pattern string) func(name string) bool { - wildCard := false - if i := strings.Index(pattern, "..."); i >= 0 { - wildCard = true - pattern = pattern[:i] - } - return func(name string) bool { - return len(name) <= len(pattern) && hasPathPrefix(pattern, name) || - wildCard && strings.HasPrefix(name, pattern) - } -} - -// allPackages returns all the packages that can be found -// under the $GOPATH directories and $GOROOT matching pattern. -// The pattern is either "all" (all packages), "std" (standard packages) -// or a path including "...". -func allPackages(pattern string) []string { - pkgs := matchPackages(pattern) - if len(pkgs) == 0 { - fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) - } - return pkgs -} - -func matchPackages(pattern string) []string { - match := func(string) bool { return true } - treeCanMatch := func(string) bool { return true } - if pattern != "all" && pattern != "std" { - match = matchPattern(pattern) - treeCanMatch = treeCanMatchPattern(pattern) - } - - have := map[string]bool{ - "builtin": true, // ignore pseudo-package that exists only for documentation - } - if !buildContext.CgoEnabled { - have["runtime/cgo"] = true // ignore during walk - } - var pkgs []string - - // Commands - cmd := filepath.Join(goroot, "src/cmd") + string(filepath.Separator) - filepath.Walk(cmd, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() || path == cmd { - return nil - } - name := path[len(cmd):] - if !treeCanMatch(name) { - return filepath.SkipDir - } - // Commands are all in cmd/, not in subdirectories. - if strings.Contains(name, string(filepath.Separator)) { - return filepath.SkipDir - } - - // We use, e.g., cmd/gofmt as the pseudo import path for gofmt. - name = "cmd/" + name - if have[name] { - return nil - } - have[name] = true - if !match(name) { - return nil - } - _, err = buildContext.ImportDir(path, 0) - if err != nil { - if _, noGo := err.(*build.NoGoError); !noGo { - log.Print(err) - } - return nil - } - pkgs = append(pkgs, name) - return nil - }) - - for _, src := range buildContext.SrcDirs() { - if (pattern == "std" || pattern == "cmd") && src != gorootSrc { - continue - } - src = filepath.Clean(src) + string(filepath.Separator) - root := src - if pattern == "cmd" { - root += "cmd" + string(filepath.Separator) - } - filepath.Walk(root, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() || path == src { - return nil - } - - // Avoid .foo, _foo, testdata and vendor directory trees. - _, elem := filepath.Split(path) - if strings.HasPrefix(elem, ".") || strings.HasPrefix(elem, "_") || elem == "testdata" || elem == "vendor" { - return filepath.SkipDir - } - - name := filepath.ToSlash(path[len(src):]) - if pattern == "std" && (strings.Contains(name, ".") || name == "cmd") { - // The name "std" is only the standard library. - // If the name is cmd, it's the root of the command tree. - return filepath.SkipDir - } - if !treeCanMatch(name) { - return filepath.SkipDir - } - if have[name] { - return nil - } - have[name] = true - if !match(name) { - return nil - } - _, err = buildContext.ImportDir(path, 0) - if err != nil { - if _, noGo := err.(*build.NoGoError); noGo { - return nil - } - } - pkgs = append(pkgs, name) - return nil - }) - } - return pkgs -} - -// allPackagesInFS is like allPackages but is passed a pattern -// beginning ./ or ../, meaning it should scan the tree rooted -// at the given directory. There are ... in the pattern too. -func allPackagesInFS(pattern string) []string { - pkgs := matchPackagesInFS(pattern) - if len(pkgs) == 0 { - fmt.Fprintf(os.Stderr, "warning: %q matched no packages\n", pattern) - } - return pkgs -} - -func matchPackagesInFS(pattern string) []string { - // Find directory to begin the scan. - // Could be smarter but this one optimization - // is enough for now, since ... is usually at the - // end of a path. - i := strings.Index(pattern, "...") - dir, _ := path.Split(pattern[:i]) - - // pattern begins with ./ or ../. - // path.Clean will discard the ./ but not the ../. - // We need to preserve the ./ for pattern matching - // and in the returned import paths. - prefix := "" - if strings.HasPrefix(pattern, "./") { - prefix = "./" - } - match := matchPattern(pattern) - - var pkgs []string - filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error { - if err != nil || !fi.IsDir() { - return nil - } - if path == dir { - // filepath.Walk starts at dir and recurses. For the recursive case, - // the path is the result of filepath.Join, which calls filepath.Clean. - // The initial case is not Cleaned, though, so we do this explicitly. - // - // This converts a path like "./io/" to "io". Without this step, running - // "cd $GOROOT/src/pkg; go list ./io/..." would incorrectly skip the io - // package, because prepending the prefix "./" to the unclean path would - // result in "././io", and match("././io") returns false. - path = filepath.Clean(path) - } - - // Avoid .foo, _foo, testdata and vendor directory trees, but do not avoid "." or "..". - _, elem := filepath.Split(path) - dot := strings.HasPrefix(elem, ".") && elem != "." && elem != ".." - if dot || strings.HasPrefix(elem, "_") || elem == "testdata" || elem == "vendor" { - return filepath.SkipDir - } - - name := prefix + filepath.ToSlash(path) - if !match(name) { - return nil - } - if _, err = build.ImportDir(path, 0); err != nil { - if _, noGo := err.(*build.NoGoError); !noGo { - log.Print(err) - } - return nil - } - pkgs = append(pkgs, name) - return nil - }) - return pkgs -} diff --git a/vendor/github.com/alexkohler/nakedret/v2/nakedret.go b/vendor/github.com/alexkohler/nakedret/v2/nakedret.go deleted file mode 100644 index f78bb8cb6c..0000000000 --- a/vendor/github.com/alexkohler/nakedret/v2/nakedret.go +++ /dev/null @@ -1,309 +0,0 @@ -package nakedret - -import ( - "bytes" - "errors" - "flag" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/printer" - "go/token" - "log" - "os" - "path/filepath" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const pwd = "./" - -func NakedReturnAnalyzer(defaultLines uint) *analysis.Analyzer { - nakedRet := &NakedReturnRunner{} - flags := flag.NewFlagSet("nakedret", flag.ExitOnError) - flags.UintVar(&nakedRet.MaxLength, "l", defaultLines, "maximum number of lines for a naked return function") - var analyzer = &analysis.Analyzer{ - Name: "nakedret", - Doc: "Checks that functions with naked returns are not longer than a maximum size (can be zero).", - Run: nakedRet.run, - Flags: *flags, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } - return analyzer -} - -type NakedReturnRunner struct { - MaxLength uint -} - -func (n *NakedReturnRunner) run(pass *analysis.Pass) (any, error) { - inspector := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ // filter needed nodes: visit only them - (*ast.FuncDecl)(nil), - (*ast.FuncLit)(nil), - (*ast.ReturnStmt)(nil), - } - retVis := &returnsVisitor{ - pass: pass, - f: pass.Fset, - maxLength: n.MaxLength, - } - inspector.Nodes(nodeFilter, retVis.NodesVisit) - return nil, nil -} - -type returnsVisitor struct { - pass *analysis.Pass - f *token.FileSet - maxLength uint - - // functions contains funcInfo for each nested function definition encountered while visiting the AST. - functions []funcInfo -} - -type funcInfo struct { - // Details of the function we're currently dealing with - funcType *ast.FuncType - funcName string - funcLength int - reportNaked bool -} - -func checkNakedReturns(args []string, maxLength *uint, setExitStatus bool) error { - - fset := token.NewFileSet() - - files, err := parseInput(args, fset) - if err != nil { - return fmt.Errorf("could not parse input: %v", err) - } - - if maxLength == nil { - return errors.New("max length nil") - } - - analyzer := NakedReturnAnalyzer(*maxLength) - pass := &analysis.Pass{ - Analyzer: analyzer, - Fset: fset, - Files: files, - Report: func(d analysis.Diagnostic) { - log.Printf("%s:%d: %s", fset.Position(d.Pos).Filename, fset.Position(d.Pos).Line, d.Message) - }, - ResultOf: map[*analysis.Analyzer]any{}, - } - result, err := inspect.Analyzer.Run(pass) - if err != nil { - return err - } - pass.ResultOf[inspect.Analyzer] = result - - _, err = analyzer.Run(pass) - if err != nil { - return err - } - - return nil -} - -func parseInput(args []string, fset *token.FileSet) ([]*ast.File, error) { - var directoryList []string - var fileMode bool - files := make([]*ast.File, 0) - - if len(args) == 0 { - directoryList = append(directoryList, pwd) - } else { - for _, arg := range args { - if strings.HasSuffix(arg, "/...") && isDir(arg[:len(arg)-len("/...")]) { - - for _, dirname := range allPackagesInFS(arg) { - directoryList = append(directoryList, dirname) - } - - } else if isDir(arg) { - directoryList = append(directoryList, arg) - - } else if exists(arg) { - if strings.HasSuffix(arg, ".go") { - fileMode = true - f, err := parser.ParseFile(fset, arg, nil, 0) - if err != nil { - return nil, err - } - files = append(files, f) - } else { - return nil, fmt.Errorf("invalid file %v specified", arg) - } - } else { - - // TODO clean this up a bit - imPaths := importPaths([]string{arg}) - for _, importPath := range imPaths { - pkg, err := build.Import(importPath, ".", 0) - if err != nil { - return nil, err - } - var stringFiles []string - stringFiles = append(stringFiles, pkg.GoFiles...) - // files = append(files, pkg.CgoFiles...) - stringFiles = append(stringFiles, pkg.TestGoFiles...) - if pkg.Dir != "." { - for i, f := range stringFiles { - stringFiles[i] = filepath.Join(pkg.Dir, f) - } - } - - fileMode = true - for _, stringFile := range stringFiles { - f, err := parser.ParseFile(fset, stringFile, nil, 0) - if err != nil { - return nil, err - } - files = append(files, f) - } - - } - } - } - } - - // if we're not in file mode, then we need to grab each and every package in each directory - // we can to grab all the files - if !fileMode { - for _, fpath := range directoryList { - pkgs, err := parser.ParseDir(fset, fpath, nil, 0) - if err != nil { - return nil, err - } - - for _, pkg := range pkgs { - for _, f := range pkg.Files { - files = append(files, f) - } - } - } - } - - return files, nil -} - -func isDir(filename string) bool { - fi, err := os.Stat(filename) - return err == nil && fi.IsDir() -} - -func exists(filename string) bool { - _, err := os.Stat(filename) - return err == nil -} - -func hasNamedReturns(funcType *ast.FuncType) bool { - if funcType == nil || funcType.Results == nil { - return false - } - for _, field := range funcType.Results.List { - for _, ident := range field.Names { - if ident != nil { - return true - } - } - } - return false -} - -func nestedFuncName(functions []funcInfo) string { - var names []string - for _, f := range functions { - names = append(names, f.funcName) - } - return strings.Join(names, ".") -} - -func nakedReturnFix(s *ast.ReturnStmt, funcType *ast.FuncType) *ast.ReturnStmt { - var nameExprs []ast.Expr - for _, result := range funcType.Results.List { - for _, ident := range result.Names { - if ident != nil { - nameExprs = append(nameExprs, ident) - } - } - } - var sFix = *s - sFix.Results = nameExprs - return &sFix -} - -func (v *returnsVisitor) NodesVisit(node ast.Node, push bool) bool { - var ( - funcType *ast.FuncType - funcName string - ) - switch s := node.(type) { - case *ast.FuncDecl: - // We've found a function - funcType = s.Type - funcName = s.Name.Name - case *ast.FuncLit: - // We've found a function literal - funcType = s.Type - file := v.f.File(s.Pos()) - funcName = fmt.Sprintf("", file.Position(s.Pos()).Line) - case *ast.ReturnStmt: - // We've found a possibly naked return statement - fun := v.functions[len(v.functions)-1] - funName := nestedFuncName(v.functions) - if fun.reportNaked && len(s.Results) == 0 && push { - sFix := nakedReturnFix(s, fun.funcType) - b := &bytes.Buffer{} - err := printer.Fprint(b, v.f, sFix) - if err != nil { - log.Printf("failed to format named return fix: %s", err) - } - v.pass.Report(analysis.Diagnostic{ - Pos: s.Pos(), - End: s.End(), - Message: fmt.Sprintf("naked return in func `%s` with %d lines of code", funName, fun.funcLength), - SuggestedFixes: []analysis.SuggestedFix{{ - Message: "explicit return statement", - TextEdits: []analysis.TextEdit{{ - Pos: s.Pos(), - End: s.End(), - NewText: b.Bytes()}}, - }}, - }) - } - } - - if !push { - if funcType == nil { - return false - } - // Pop function info - v.functions = v.functions[:len(v.functions)-1] - return false - } - - if push && funcType != nil { - // Push function info to track returns for this function - file := v.f.File(node.Pos()) - length := file.Position(node.End()).Line - file.Position(node.Pos()).Line - if length == 0 { - // consider functions that finish on the same line as they start as single line functions, not zero lines! - length = 1 - } - v.functions = append(v.functions, funcInfo{ - funcType: funcType, - funcName: funcName, - funcLength: length, - reportNaked: uint(length) > v.maxLength && hasNamedReturns(funcType), - }) - } - - return true -} diff --git a/vendor/github.com/alexkohler/prealloc/LICENSE b/vendor/github.com/alexkohler/prealloc/LICENSE deleted file mode 100644 index 9310fbcffb..0000000000 --- a/vendor/github.com/alexkohler/prealloc/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Alex Kohler - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/alexkohler/prealloc/pkg/prealloc.go b/vendor/github.com/alexkohler/prealloc/pkg/prealloc.go deleted file mode 100644 index 72d8b95f7f..0000000000 --- a/vendor/github.com/alexkohler/prealloc/pkg/prealloc.go +++ /dev/null @@ -1,267 +0,0 @@ -package pkg - -import ( - "fmt" - "go/ast" - "go/token" -) - -type sliceDeclaration struct { - name string - // sType string - genD *ast.GenDecl -} - -type returnsVisitor struct { - // flags - simple bool - includeRangeLoops bool - includeForLoops bool - // visitor fields - sliceDeclarations []*sliceDeclaration - preallocHints []Hint - returnsInsideOfLoop bool - arrayTypes []string -} - -func Check(files []*ast.File, simple, includeRangeLoops, includeForLoops bool) []Hint { - hints := []Hint{} - for _, f := range files { - retVis := &returnsVisitor{ - simple: simple, - includeRangeLoops: includeRangeLoops, - includeForLoops: includeForLoops, - } - ast.Walk(retVis, f) - // if simple is true, then we actually have to check if we had returns - // inside of our loop. Otherwise, we can just report all messages. - if !retVis.simple || !retVis.returnsInsideOfLoop { - hints = append(hints, retVis.preallocHints...) - } - } - - return hints -} - -func contains(slice []string, item string) bool { - for _, s := range slice { - if s == item { - return true - } - } - - return false -} - -func (v *returnsVisitor) Visit(node ast.Node) ast.Visitor { - - v.sliceDeclarations = nil - v.returnsInsideOfLoop = false - - switch n := node.(type) { - case *ast.TypeSpec: - if _, ok := n.Type.(*ast.ArrayType); ok { - if n.Name != nil { - v.arrayTypes = append(v.arrayTypes, n.Name.Name) - } - } - case *ast.FuncDecl: - if n.Body != nil { - for _, stmt := range n.Body.List { - switch s := stmt.(type) { - // Find non pre-allocated slices - case *ast.DeclStmt: - genD, ok := s.Decl.(*ast.GenDecl) - if !ok { - continue - } - if genD.Tok == token.TYPE { - for _, spec := range genD.Specs { - tSpec, ok := spec.(*ast.TypeSpec) - if !ok { - continue - } - - if _, ok := tSpec.Type.(*ast.ArrayType); ok { - if tSpec.Name != nil { - v.arrayTypes = append(v.arrayTypes, tSpec.Name.Name) - } - } - } - } else if genD.Tok == token.VAR { - for _, spec := range genD.Specs { - vSpec, ok := spec.(*ast.ValueSpec) - if !ok { - continue - } - var isArrType bool - switch val := vSpec.Type.(type) { - case *ast.ArrayType: - isArrType = true - case *ast.Ident: - isArrType = contains(v.arrayTypes, val.Name) - } - if isArrType { - if vSpec.Names != nil { - /*atID, ok := arrayType.Elt.(*ast.Ident) - if !ok { - continue - }*/ - - // We should handle multiple slices declared on same line e.g. var mySlice1, mySlice2 []uint32 - for _, vName := range vSpec.Names { - v.sliceDeclarations = append(v.sliceDeclarations, &sliceDeclaration{name: vName.Name /*sType: atID.Name,*/, genD: genD}) - } - } - } - } - } - - case *ast.RangeStmt: - if v.includeRangeLoops { - if len(v.sliceDeclarations) == 0 { - continue - } - // Check the value being ranged over and ensure it's not a channel (we cannot offer any recommendations on channel ranges). - rangeIdent, ok := s.X.(*ast.Ident) - if ok && rangeIdent.Obj != nil { - valueSpec, ok := rangeIdent.Obj.Decl.(*ast.ValueSpec) - if ok { - if _, rangeTargetIsChannel := valueSpec.Type.(*ast.ChanType); rangeTargetIsChannel { - continue - } - } - } - if s.Body != nil { - v.handleLoops(s.Body) - } - } - - case *ast.ForStmt: - if v.includeForLoops { - if len(v.sliceDeclarations) == 0 { - continue - } - if s.Body != nil { - v.handleLoops(s.Body) - } - } - - default: - } - } - } - } - return v -} - -// handleLoops is a helper function to share the logic required for both *ast.RangeLoops and *ast.ForLoops -func (v *returnsVisitor) handleLoops(blockStmt *ast.BlockStmt) { - - for _, stmt := range blockStmt.List { - switch bodyStmt := stmt.(type) { - case *ast.AssignStmt: - asgnStmt := bodyStmt - for index, expr := range asgnStmt.Rhs { - if index >= len(asgnStmt.Lhs) { - continue - } - - lhsIdent, ok := asgnStmt.Lhs[index].(*ast.Ident) - if !ok { - continue - } - - callExpr, ok := expr.(*ast.CallExpr) - if !ok { - continue - } - - rhsFuncIdent, ok := callExpr.Fun.(*ast.Ident) - if !ok { - continue - } - - if rhsFuncIdent.Name != "append" { - continue - } - - // e.g., `x = append(x)` - // Pointless, but pre-allocation will not help. - if len(callExpr.Args) < 2 { - continue - } - - rhsIdent, ok := callExpr.Args[0].(*ast.Ident) - if !ok { - continue - } - - // e.g., `x = append(y, a)` - // This is weird (and maybe a logic error), - // but we cannot recommend pre-allocation. - if lhsIdent.Name != rhsIdent.Name { - continue - } - - // e.g., `x = append(x, y...)` - // we should ignore this. Pre-allocating in this case - // is confusing, and is not possible in general. - if callExpr.Ellipsis.IsValid() { - continue - } - - for _, sliceDecl := range v.sliceDeclarations { - if sliceDecl.name == lhsIdent.Name { - // This is a potential mark, we just need to make sure there are no returns/continues in the - // range loop. - // now we just need to grab whatever we're ranging over - /*sxIdent, ok := s.X.(*ast.Ident) - if !ok { - continue - }*/ - - v.preallocHints = append(v.preallocHints, Hint{ - Pos: sliceDecl.genD.Pos(), - DeclaredSliceName: sliceDecl.name, - }) - } - } - } - case *ast.IfStmt: - ifStmt := bodyStmt - if ifStmt.Body != nil { - for _, ifBodyStmt := range ifStmt.Body.List { - // TODO should probably handle embedded ifs here - switch /*ift :=*/ ifBodyStmt.(type) { - case *ast.BranchStmt, *ast.ReturnStmt: - v.returnsInsideOfLoop = true - default: - } - } - } - - default: - - } - } - -} - -// Hint stores the information about an occurrence of a slice that could be -// preallocated. -type Hint struct { - Pos token.Pos - DeclaredSliceName string -} - -func (h Hint) String() string { - return fmt.Sprintf("%v: Consider preallocating %v", h.Pos, h.DeclaredSliceName) -} - -func (h Hint) StringFromFS(f *token.FileSet) string { - file := f.File(h.Pos) - lineNumber := file.Position(h.Pos).Line - - return fmt.Sprintf("%v:%v Consider preallocating %v", file.Name(), lineNumber, h.DeclaredSliceName) -} diff --git a/vendor/github.com/alingse/asasalint/.gitignore b/vendor/github.com/alingse/asasalint/.gitignore deleted file mode 100644 index d0fc531c8c..0000000000 --- a/vendor/github.com/alingse/asasalint/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ -.vscode - -asasalint diff --git a/vendor/github.com/alingse/asasalint/.goreleaser.yml b/vendor/github.com/alingse/asasalint/.goreleaser.yml deleted file mode 100644 index e45d5860d6..0000000000 --- a/vendor/github.com/alingse/asasalint/.goreleaser.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -project_name: asasalint - -release: - github: - owner: alingse - name: asasalint - -builds: - - binary: asasalint - goos: - - darwin - - windows - - linux - - freebsd - goarch: - - amd64 - - arm64 - - arm - - 386 - - ppc64le - - s390x - - mips64 - - mips64le - - riscv64 - goarm: - - 6 - - 7 - gomips: - - hardfloat - env: - - CGO_ENABLED=0 - ignore: - - goos: darwin - goarch: 386 - - goos: freebsd - goarch: arm64 - main: ./cmd/asasalint/ - flags: - - -trimpath - ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} - -archives: - - format: tar.gz - wrap_in_directory: true - format_overrides: - - goos: windows - format: zip - name_template: '{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - files: - - LICENSE - - README.md - -snapshot: - name_template: SNAPSHOT-{{ .Commit }} - -checksum: - name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt' - -changelog: - sort: asc - filters: - exclude: - - '(?i)^docs?:' - - '(?i)^docs\([^:]+\):' - - '(?i)^docs\[[^:]+\]:' - - '^tests?:' - - '(?i)^dev:' - - '^build\(deps\): bump .* in /docs \(#\d+\)' - - '^build\(deps\): bump .* in /\.github/peril \(#\d+\)' - - Merge pull request - - Merge branch diff --git a/vendor/github.com/alingse/asasalint/LICENSE b/vendor/github.com/alingse/asasalint/LICENSE deleted file mode 100644 index a7c39f2e3d..0000000000 --- a/vendor/github.com/alingse/asasalint/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 alingse - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/alingse/asasalint/Makefile b/vendor/github.com/alingse/asasalint/Makefile deleted file mode 100644 index 12f8ba9283..0000000000 --- a/vendor/github.com/alingse/asasalint/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -.PHONY: clean check test build - -default: clean check test build - -clean: - rm -rf dist/ cover.out - -test: clean - go test -v -cover ./... - -check: - golangci-lint run - -build: - go build -ldflags "-s -w" -trimpath ./cmd/asasalint/ diff --git a/vendor/github.com/alingse/asasalint/README.md b/vendor/github.com/alingse/asasalint/README.md deleted file mode 100644 index 3fa7e65b34..0000000000 --- a/vendor/github.com/alingse/asasalint/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# asasalint -Golang linter, lint that pass any slice as any in variadic function - - -## Install - -```sh -go install github.com/alingse/asasalint/cmd/asasalint@latest -``` - -## Usage - -```sh -asasalint ./... -``` - -ignore some func that was by desgin - -```sh -asasalint -e append,Append ./... -``` - -## Why - -two kind of unexpected usage, and `go build` success - -```Go -package main - -import "fmt" - -func A(args ...any) int { - return len(args) -} - -func B(args ...any) int { - return A(args) -} - -func main() { - - // 1 - fmt.Println(B(1, 2, 3, 4)) -} -``` - - - -```Go -package main - -import "fmt" - -func errMsg(msg string, args ...any) string { - return fmt.Sprintf(msg, args...) -} - -func Err(msg string, args ...any) string { - return errMsg(msg, args) -} - -func main() { - - // p1 [hello world] p2 %!s(MISSING) - fmt.Println(Err("p1 %s p2 %s", "hello", "world")) -} -``` - - - -## TODO - -1. add to golangci-lint -2. given a SuggestEdition -3. add `append` to default exclude ? -4. ingore pattern `fn(a, b, []any{1,2,3})` , because `[]any{1,2,3}` is most likely by design diff --git a/vendor/github.com/alingse/asasalint/asasalint.go b/vendor/github.com/alingse/asasalint/asasalint.go deleted file mode 100644 index f34516a465..0000000000 --- a/vendor/github.com/alingse/asasalint/asasalint.go +++ /dev/null @@ -1,166 +0,0 @@ -package asasalint - -import ( - "bytes" - "fmt" - "go/ast" - "go/printer" - "go/token" - "go/types" - "log" - "regexp" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const BuiltinExclusions = `^(fmt|log|logger|t|)\.(Print|Fprint|Sprint|Fatal|Panic|Error|Warn|Warning|Info|Debug|Log)(|f|ln)$` - -type LinterSetting struct { - Exclude []string - NoBuiltinExclusions bool - IgnoreTest bool -} - -func NewAnalyzer(setting LinterSetting) (*analysis.Analyzer, error) { - a, err := newAnalyzer(setting) - if err != nil { - return nil, err - } - - return &analysis.Analyzer{ - Name: "asasalint", - Doc: "check for pass []any as any in variadic func(...any)", - Run: a.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - }, nil -} - -type analyzer struct { - excludes []*regexp.Regexp - setting LinterSetting -} - -func newAnalyzer(setting LinterSetting) (*analyzer, error) { - a := &analyzer{ - setting: setting, - } - - if !a.setting.NoBuiltinExclusions { - a.excludes = append(a.excludes, regexp.MustCompile(BuiltinExclusions)) - } - - for _, exclude := range a.setting.Exclude { - if exclude != "" { - exp, err := regexp.Compile(exclude) - if err != nil { - return nil, err - } - - a.excludes = append(a.excludes, exp) - } - } - - return a, nil -} - -func (a *analyzer) run(pass *analysis.Pass) (interface{}, error) { - inspectorInfo := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{(*ast.CallExpr)(nil)} - - inspectorInfo.Preorder(nodeFilter, a.AsCheckVisitor(pass)) - return nil, nil -} - -func (a *analyzer) AsCheckVisitor(pass *analysis.Pass) func(ast.Node) { - return func(n ast.Node) { - if a.setting.IgnoreTest { - pos := pass.Fset.Position(n.Pos()) - if strings.HasSuffix(pos.Filename, "_test.go") { - return - } - } - - caller, ok := n.(*ast.CallExpr) - if !ok { - return - } - if caller.Ellipsis != token.NoPos { - return - } - if len(caller.Args) == 0 { - return - } - - fnName, err := getFuncName(pass.Fset, caller) - if err != nil { - log.Println(err) - return - } - - for _, exclude := range a.excludes { - if exclude.MatchString(fnName) { - return - } - } - - fnType := pass.TypesInfo.TypeOf(caller.Fun) - if !isSliceAnyVariadicFuncType(fnType) { - return - } - - fnSign := fnType.(*types.Signature) - if len(caller.Args) != fnSign.Params().Len() { - return - } - - lastArg := caller.Args[len(caller.Args)-1] - argType := pass.TypesInfo.TypeOf(lastArg) - if !isSliceAnyType(argType) { - return - } - node := lastArg - - d := analysis.Diagnostic{ - Pos: node.Pos(), - End: node.End(), - Message: fmt.Sprintf("pass []any as any to func %s %s", fnName, fnType.String()), - Category: "asasalint", - } - pass.Report(d) - } -} - -func getFuncName(fset *token.FileSet, caller *ast.CallExpr) (string, error) { - buf := new(bytes.Buffer) - if err := printer.Fprint(buf, fset, caller.Fun); err != nil { - return "", fmt.Errorf("unable to print node at %s: %w", fset.Position(caller.Fun.Pos()), err) - } - - return buf.String(), nil -} - -func isSliceAnyVariadicFuncType(typ types.Type) (r bool) { - fnSign, ok := typ.(*types.Signature) - if !ok || !fnSign.Variadic() { - return false - } - - params := fnSign.Params() - lastParam := params.At(params.Len() - 1) - return isSliceAnyType(lastParam.Type()) -} - -func isSliceAnyType(typ types.Type) (r bool) { - sliceType, ok := typ.(*types.Slice) - if !ok { - return - } - elemType, ok := sliceType.Elem().(*types.Interface) - if !ok { - return - } - return elemType.NumMethods() == 0 -} diff --git a/vendor/github.com/asaskevich/govalidator/.gitignore b/vendor/github.com/asaskevich/govalidator/.gitignore deleted file mode 100644 index 8d69a9418a..0000000000 --- a/vendor/github.com/asaskevich/govalidator/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -bin/ -.idea/ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml deleted file mode 100644 index bb83c6670d..0000000000 --- a/vendor/github.com/asaskevich/govalidator/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81..0000000000 --- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1ed..0000000000 --- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE deleted file mode 100644 index cacba91024..0000000000 --- a/vendor/github.com/asaskevich/govalidator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md deleted file mode 100644 index 2c3fc35eb6..0000000000 --- a/vendor/github.com/asaskevich/govalidator/README.md +++ /dev/null @@ -1,622 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go deleted file mode 100644 index 3e1da7cb48..0000000000 --- a/vendor/github.com/asaskevich/govalidator/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go deleted file mode 100644 index d68e990fc2..0000000000 --- a/vendor/github.com/asaskevich/govalidator/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go deleted file mode 100644 index 55dce62dc8..0000000000 --- a/vendor/github.com/asaskevich/govalidator/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go deleted file mode 100644 index 1da2336f47..0000000000 --- a/vendor/github.com/asaskevich/govalidator/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go deleted file mode 100644 index 5041d9e868..0000000000 --- a/vendor/github.com/asaskevich/govalidator/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go deleted file mode 100644 index bafc3765ea..0000000000 --- a/vendor/github.com/asaskevich/govalidator/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go deleted file mode 100644 index c573abb51a..0000000000 --- a/vendor/github.com/asaskevich/govalidator/types.go +++ /dev/null @@ -1,656 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go deleted file mode 100644 index f4c30f824a..0000000000 --- a/vendor/github.com/asaskevich/govalidator/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go deleted file mode 100644 index c9c4fac065..0000000000 --- a/vendor/github.com/asaskevich/govalidator/validator.go +++ /dev/null @@ -1,1768 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number / 10, number % 10 - - var sum int64 - for i:=0; number > 0; i++ { - digit := number % 10 - - if i % 2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum + lastDigit) % 10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml deleted file mode 100644 index bc5f7b0864..0000000000 --- a/vendor/github.com/asaskevich/govalidator/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/ashanbrown/forbidigo/LICENSE b/vendor/github.com/ashanbrown/forbidigo/LICENSE deleted file mode 100644 index dc1d47ad54..0000000000 --- a/vendor/github.com/ashanbrown/forbidigo/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2019 Andrew Shannon Brown - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/github.com/ashanbrown/forbidigo/forbidigo/config_options.go b/vendor/github.com/ashanbrown/forbidigo/forbidigo/config_options.go deleted file mode 100644 index 3f0ed6682a..0000000000 --- a/vendor/github.com/ashanbrown/forbidigo/forbidigo/config_options.go +++ /dev/null @@ -1,129 +0,0 @@ -package forbidigo - -// Code generated by github.com/launchdarkly/go-options. DO NOT EDIT. - -import "fmt" - -import "github.com/google/go-cmp/cmp" - -type ApplyOptionFunc func(c *config) error - -func (f ApplyOptionFunc) apply(c *config) error { - return f(c) -} - -func newConfig(options ...Option) (config, error) { - var c config - err := applyConfigOptions(&c, options...) - return c, err -} - -func applyConfigOptions(c *config, options ...Option) error { - c.ExcludeGodocExamples = true - for _, o := range options { - if err := o.apply(c); err != nil { - return err - } - } - return nil -} - -type Option interface { - apply(*config) error -} - -type optionExcludeGodocExamplesImpl struct { - o bool -} - -func (o optionExcludeGodocExamplesImpl) apply(c *config) error { - c.ExcludeGodocExamples = o.o - return nil -} - -func (o optionExcludeGodocExamplesImpl) Equal(v optionExcludeGodocExamplesImpl) bool { - switch { - case !cmp.Equal(o.o, v.o): - return false - } - return true -} - -func (o optionExcludeGodocExamplesImpl) String() string { - name := "OptionExcludeGodocExamples" - - // hack to avoid go vet error about passing a function to Sprintf - var value interface{} = o.o - return fmt.Sprintf("%s: %+v", name, value) -} - -// OptionExcludeGodocExamples don't check inside Godoc examples (see https://blog.golang.org/examples) -func OptionExcludeGodocExamples(o bool) Option { - return optionExcludeGodocExamplesImpl{ - o: o, - } -} - -type optionIgnorePermitDirectivesImpl struct { - o bool -} - -func (o optionIgnorePermitDirectivesImpl) apply(c *config) error { - c.IgnorePermitDirectives = o.o - return nil -} - -func (o optionIgnorePermitDirectivesImpl) Equal(v optionIgnorePermitDirectivesImpl) bool { - switch { - case !cmp.Equal(o.o, v.o): - return false - } - return true -} - -func (o optionIgnorePermitDirectivesImpl) String() string { - name := "OptionIgnorePermitDirectives" - - // hack to avoid go vet error about passing a function to Sprintf - var value interface{} = o.o - return fmt.Sprintf("%s: %+v", name, value) -} - -// OptionIgnorePermitDirectives don't check for `permit` directives(for example, in favor of `nolint`) -func OptionIgnorePermitDirectives(o bool) Option { - return optionIgnorePermitDirectivesImpl{ - o: o, - } -} - -type optionAnalyzeTypesImpl struct { - o bool -} - -func (o optionAnalyzeTypesImpl) apply(c *config) error { - c.AnalyzeTypes = o.o - return nil -} - -func (o optionAnalyzeTypesImpl) Equal(v optionAnalyzeTypesImpl) bool { - switch { - case !cmp.Equal(o.o, v.o): - return false - } - return true -} - -func (o optionAnalyzeTypesImpl) String() string { - name := "OptionAnalyzeTypes" - - // hack to avoid go vet error about passing a function to Sprintf - var value interface{} = o.o - return fmt.Sprintf("%s: %+v", name, value) -} - -// OptionAnalyzeTypes enable to match canonical names for types and interfaces using type info -func OptionAnalyzeTypes(o bool) Option { - return optionAnalyzeTypesImpl{ - o: o, - } -} diff --git a/vendor/github.com/ashanbrown/forbidigo/forbidigo/forbidigo.go b/vendor/github.com/ashanbrown/forbidigo/forbidigo/forbidigo.go deleted file mode 100644 index a7a3ab591e..0000000000 --- a/vendor/github.com/ashanbrown/forbidigo/forbidigo/forbidigo.go +++ /dev/null @@ -1,398 +0,0 @@ -// Package forbidigo provides a linter for forbidding the use of specific identifiers -package forbidigo - -import ( - "bytes" - "fmt" - "go/ast" - "go/printer" - "go/token" - "go/types" - "log" - "regexp" - "strings" -) - -type Issue interface { - Details() string - Pos() token.Pos - Position() token.Position - String() string -} - -type UsedIssue struct { - identifier string - pattern string - pos token.Pos - position token.Position - customMsg string -} - -func (a UsedIssue) Details() string { - explanation := fmt.Sprintf(` because %q`, a.customMsg) - if a.customMsg == "" { - explanation = fmt.Sprintf(" by pattern `%s`", a.pattern) - } - return fmt.Sprintf("use of `%s` forbidden", a.identifier) + explanation -} - -func (a UsedIssue) Position() token.Position { - return a.position -} - -func (a UsedIssue) Pos() token.Pos { - return a.pos -} - -func (a UsedIssue) String() string { return toString(a) } - -func toString(i UsedIssue) string { - return fmt.Sprintf("%s at %s", i.Details(), i.Position()) -} - -type Linter struct { - cfg config - patterns []*pattern -} - -func DefaultPatterns() []string { - return []string{`^(fmt\.Print(|f|ln)|print|println)$`} -} - -//go:generate go-options config -type config struct { - // don't check inside Godoc examples (see https://blog.golang.org/examples) - ExcludeGodocExamples bool `options:",true"` - IgnorePermitDirectives bool // don't check for `permit` directives(for example, in favor of `nolint`) - AnalyzeTypes bool // enable to match canonical names for types and interfaces using type info -} - -func NewLinter(patterns []string, options ...Option) (*Linter, error) { - cfg, err := newConfig(options...) - if err != nil { - return nil, fmt.Errorf("failed to process options: %w", err) - } - - if len(patterns) == 0 { - patterns = DefaultPatterns() - } - compiledPatterns := make([]*pattern, 0, len(patterns)) - for _, ptrn := range patterns { - p, err := parse(ptrn) - if err != nil { - return nil, err - } - compiledPatterns = append(compiledPatterns, p) - } - return &Linter{ - cfg: cfg, - patterns: compiledPatterns, - }, nil -} - -type visitor struct { - cfg config - isTestFile bool // godoc only runs on test files - - linter *Linter - comments []*ast.CommentGroup - - runConfig RunConfig - issues []Issue -} - -// Deprecated: Run was the original entrypoint before RunWithConfig was introduced to support -// additional match patterns that need additional information. -func (l *Linter) Run(fset *token.FileSet, nodes ...ast.Node) ([]Issue, error) { - return l.RunWithConfig(RunConfig{Fset: fset}, nodes...) -} - -// RunConfig provides information that the linter needs for different kinds -// of match patterns. Ideally, all fields should get set. More fields may get -// added in the future as needed. -type RunConfig struct { - // FSet is required. - Fset *token.FileSet - - // TypesInfo is needed for expanding source code expressions. - // Nil disables that step, i.e. patterns match the literal source code. - TypesInfo *types.Info - - // DebugLog is used to print debug messages. May be nil. - DebugLog func(format string, args ...interface{}) -} - -func (l *Linter) RunWithConfig(config RunConfig, nodes ...ast.Node) ([]Issue, error) { - if config.DebugLog == nil { - config.DebugLog = func(format string, args ...interface{}) {} - } - var issues []Issue - for _, node := range nodes { - var comments []*ast.CommentGroup - isTestFile := false - isWholeFileExample := false - if file, ok := node.(*ast.File); ok { - comments = file.Comments - fileName := config.Fset.Position(file.Pos()).Filename - isTestFile = strings.HasSuffix(fileName, "_test.go") - - // From https://blog.golang.org/examples, a "whole file example" is: - // a file that ends in _test.go and contains exactly one example function, - // no test or benchmark functions, and at least one other package-level declaration. - if l.cfg.ExcludeGodocExamples && isTestFile && len(file.Decls) > 1 { - numExamples := 0 - numTestsAndBenchmarks := 0 - for _, decl := range file.Decls { - funcDecl, isFuncDecl := decl.(*ast.FuncDecl) - // consider only functions, not methods - if !isFuncDecl || funcDecl.Recv != nil || funcDecl.Name == nil { - continue - } - funcName := funcDecl.Name.Name - if strings.HasPrefix(funcName, "Test") || strings.HasPrefix(funcName, "Benchmark") { - numTestsAndBenchmarks++ - break // not a whole file example - } - if strings.HasPrefix(funcName, "Example") { - numExamples++ - } - } - - // if this is a whole file example, skip this node - isWholeFileExample = numExamples == 1 && numTestsAndBenchmarks == 0 - } - } - if isWholeFileExample { - continue - } - visitor := visitor{ - cfg: l.cfg, - isTestFile: isTestFile, - linter: l, - runConfig: config, - comments: comments, - } - ast.Walk(&visitor, node) - issues = append(issues, visitor.issues...) - } - return issues, nil -} - -func (v *visitor) Visit(node ast.Node) ast.Visitor { - switch node := node.(type) { - case *ast.FuncDecl: - // don't descend into godoc examples if we are ignoring them - isGodocExample := v.isTestFile && node.Recv == nil && node.Name != nil && strings.HasPrefix(node.Name.Name, "Example") - if isGodocExample && v.cfg.ExcludeGodocExamples { - return nil - } - ast.Walk(v, node.Type) - if node.Body != nil { - ast.Walk(v, node.Body) - } - return nil - // Ignore constant and type names - case *ast.ValueSpec: - // Look at only type and values for const and variable specs, and not names - if node.Type != nil { - ast.Walk(v, node.Type) - } - if node.Values != nil { - for _, x := range node.Values { - ast.Walk(v, x) - } - } - return nil - // Ignore import alias names - case *ast.ImportSpec: - return nil - // Ignore type names - case *ast.TypeSpec: - // Look at only type parameters for type spec - if node.TypeParams != nil { - ast.Walk(v, node.TypeParams) - } - ast.Walk(v, node.Type) - return nil - // Ignore field names - case *ast.Field: - if node.Type != nil { - ast.Walk(v, node.Type) - } - return nil - // The following two are handled below. - case *ast.SelectorExpr: - case *ast.Ident: - // Everything else isn't. - default: - return v - } - - // The text as it appears in the source is always used because issues - // use that. It's used for matching unless usage of type information - // is enabled. - srcText := v.textFor(node) - matchTexts, pkgText := v.expandMatchText(node, srcText) - v.runConfig.DebugLog("%s: match %v, package %q", v.runConfig.Fset.Position(node.Pos()), matchTexts, pkgText) - for _, p := range v.linter.patterns { - if p.matches(matchTexts) && - (p.Package == "" || p.pkgRe.MatchString(pkgText)) && - !v.permit(node) { - v.issues = append(v.issues, UsedIssue{ - identifier: srcText, // Always report the expression as it appears in the source code. - pattern: p.re.String(), - pos: node.Pos(), - position: v.runConfig.Fset.Position(node.Pos()), - customMsg: p.Msg, - }) - } - } - - // descend into the left-side of selectors - if selector, isSelector := node.(*ast.SelectorExpr); isSelector { - if _, leftSideIsIdentifier := selector.X.(*ast.Ident); !leftSideIsIdentifier { - return v - } - } - - return nil -} - -// textFor returns the expression as it appears in the source code (for -// example, .). -func (v *visitor) textFor(node ast.Node) string { - buf := new(bytes.Buffer) - if err := printer.Fprint(buf, v.runConfig.Fset, node); err != nil { - log.Fatalf("ERROR: unable to print node at %s: %s", v.runConfig.Fset.Position(node.Pos()), err) - } - return buf.String() -} - -// expandMatchText expands the selector in a selector expression to the full package -// name and (for variables) the type: -// -// - example.com/some/pkg.Function -// - example.com/some/pkg.CustomType.Method -// -// It updates the text to match against and fills the package string if possible, -// otherwise it just returns. -func (v *visitor) expandMatchText(node ast.Node, srcText string) (matchTexts []string, pkgText string) { - // The text to match against is the literal source code if we cannot - // come up with something different. - matchTexts = []string{srcText} - - if !v.cfg.AnalyzeTypes || v.runConfig.TypesInfo == nil { - return matchTexts, pkgText - } - - location := v.runConfig.Fset.Position(node.Pos()) - - switch node := node.(type) { - case *ast.Ident: - if object, ok := v.runConfig.TypesInfo.Uses[node]; !ok { - // No information about the identifier. Should - // not happen, but perhaps there were compile - // errors? - v.runConfig.DebugLog("%s: unknown identifier %q", location, srcText) - } else if pkg := object.Pkg(); pkg != nil { - pkgText = pkg.Path() - // if this is a method, don't include the package name - isMethod := false - if signature, ok := object.Type().(*types.Signature); ok && signature.Recv() != nil { - isMethod = true - } - v.runConfig.DebugLog("%s: identifier: %q -> %q in package %q", location, srcText, matchTexts, pkgText) - // match either with or without package name - if !isMethod { - matchTexts = []string{pkg.Name() + "." + srcText, srcText} - } - } else { - v.runConfig.DebugLog("%s: identifier: %q -> %q without package", location, srcText, matchTexts) - } - case *ast.SelectorExpr: - selector := node.X - field := node.Sel.Name - - // If we are lucky, the entire selector expression has a known - // type. We don't care about the value. - selectorText := v.textFor(node) - if typeAndValue, ok := v.runConfig.TypesInfo.Types[selector]; ok { - m, p, ok := typeNameWithPackage(typeAndValue.Type) - if !ok { - v.runConfig.DebugLog("%s: selector %q with supported type %T", location, selectorText, typeAndValue.Type) - } - matchTexts = []string{m + "." + field} - pkgText = p - v.runConfig.DebugLog("%s: selector %q with supported type %q: %q -> %q, package %q", location, selectorText, typeAndValue.Type.String(), srcText, matchTexts, pkgText) - } - // Some expressions need special treatment. - switch selector := selector.(type) { - case *ast.Ident: - if object, hasUses := v.runConfig.TypesInfo.Uses[selector]; hasUses { - switch object := object.(type) { - case *types.PkgName: - pkgText = object.Imported().Path() - matchTexts = []string{object.Imported().Name() + "." + field} - v.runConfig.DebugLog("%s: selector %q is package: %q -> %q, package %q", location, selectorText, srcText, matchTexts, pkgText) - case *types.Var: - if typeName, packageName, ok := typeNameWithPackage(object.Type()); ok { - matchTexts = []string{typeName + "." + field} - pkgText = packageName - v.runConfig.DebugLog("%s: selector %q is variable of type %q: %q -> %q, package %q", location, selectorText, object.Type().String(), srcText, matchTexts, pkgText) - } else { - v.runConfig.DebugLog("%s: selector %q is variable with unsupported type %T", location, selectorText, object.Type()) - } - default: - // Something else? - v.runConfig.DebugLog("%s: selector %q is identifier with unsupported type %T", location, selectorText, object) - } - } else { - // No information about the identifier. Should - // not happen, but perhaps there were compile - // errors? - v.runConfig.DebugLog("%s: unknown selector identifier %q", location, selectorText) - } - default: - v.runConfig.DebugLog("%s: selector %q of unsupported type %T", location, selectorText, selector) - } - default: - v.runConfig.DebugLog("%s: unsupported type %T", location, node) - } - return matchTexts, pkgText -} - -// typeNameWithPackage tries to determine `.` and the full -// package path. This only needs to work for types of a selector in a selector -// expression. -func typeNameWithPackage(t types.Type) (typeName, packagePath string, ok bool) { - if ptr, ok := t.(*types.Pointer); ok { - t = ptr.Elem() - } - - switch t := t.(type) { - case *types.Named: - obj := t.Obj() - pkg := obj.Pkg() - if pkg == nil { - return "", "", false - } - return pkg.Name() + "." + obj.Name(), pkg.Path(), true - default: - return "", "", false - } -} - -func (v *visitor) permit(node ast.Node) bool { - if v.cfg.IgnorePermitDirectives { - return false - } - nodePos := v.runConfig.Fset.Position(node.Pos()) - nolint := regexp.MustCompile(fmt.Sprintf(`^//\s?permit:%s\b`, regexp.QuoteMeta(v.textFor(node)))) - for _, c := range v.comments { - commentPos := v.runConfig.Fset.Position(c.Pos()) - if commentPos.Line == nodePos.Line && len(c.List) > 0 && nolint.MatchString(c.List[0].Text) { - return true - } - } - return false -} diff --git a/vendor/github.com/ashanbrown/forbidigo/forbidigo/patterns.go b/vendor/github.com/ashanbrown/forbidigo/forbidigo/patterns.go deleted file mode 100644 index 2692dcd24f..0000000000 --- a/vendor/github.com/ashanbrown/forbidigo/forbidigo/patterns.go +++ /dev/null @@ -1,127 +0,0 @@ -package forbidigo - -import ( - "fmt" - "regexp" - "regexp/syntax" - "strings" - - "gopkg.in/yaml.v2" -) - -// pattern matches code that is not supposed to be used. -type pattern struct { - re, pkgRe *regexp.Regexp - - // Pattern is the regular expression string that is used for matching. - // It gets matched against the literal source code text or the expanded - // text, depending on the mode in which the analyzer runs. - Pattern string `yaml:"p"` - - // Package is a regular expression for the full package path of - // an imported item. Ignored unless the analyzer is configured to - // determine that information. - Package string `yaml:"pkg,omitempty"` - - // Msg gets printed in addition to the normal message if a match is - // found. - Msg string `yaml:"msg,omitempty"` -} - -// A yamlPattern pattern in a YAML string may be represented either by a string -// (the traditional regular expression syntax) or a struct (for more complex -// patterns). -type yamlPattern pattern - -func (p *yamlPattern) UnmarshalYAML(unmarshal func(interface{}) error) error { - // Try struct first. It's unlikely that a regular expression string - // is valid YAML for a struct. - var ptrn pattern - if err := unmarshal(&ptrn); err != nil { - errStr := err.Error() - // Didn't work, try plain string. - var ptrn string - if err := unmarshal(&ptrn); err != nil { - return fmt.Errorf("pattern is neither a regular expression string (%s) nor a Pattern struct (%s)", err.Error(), errStr) - } - p.Pattern = ptrn - } else { - *p = yamlPattern(ptrn) - } - return ((*pattern)(p)).validate() -} - -var _ yaml.Unmarshaler = &yamlPattern{} - -// parse accepts a regular expression or, if the string starts with { or contains a line break, a -// JSON or YAML representation of a Pattern. -func parse(ptrn string) (*pattern, error) { - pattern := &pattern{} - - if strings.HasPrefix(strings.TrimSpace(ptrn), "{") || - strings.Contains(ptrn, "\n") { - // Embedded JSON or YAML. We can decode both with the YAML decoder. - if err := yaml.UnmarshalStrict([]byte(ptrn), pattern); err != nil { - return nil, fmt.Errorf("parsing as JSON or YAML failed: %v", err) - } - } else { - pattern.Pattern = ptrn - } - - if err := pattern.validate(); err != nil { - return nil, err - } - return pattern, nil -} - -func (p *pattern) validate() error { - ptrnRe, err := regexp.Compile(p.Pattern) - if err != nil { - return fmt.Errorf("unable to compile source code pattern `%s`: %s", p.Pattern, err) - } - re, err := syntax.Parse(p.Pattern, syntax.Perl) - if err != nil { - return fmt.Errorf("unable to parse source code pattern `%s`: %s", p.Pattern, err) - } - msg := extractComment(re) - if msg != "" { - p.Msg = msg - } - p.re = ptrnRe - - if p.Package != "" { - pkgRe, err := regexp.Compile(p.Package) - if err != nil { - return fmt.Errorf("unable to compile package pattern `%s`: %s", p.Package, err) - } - p.pkgRe = pkgRe - } - - return nil -} - -func (p *pattern) matches(matchTexts []string) bool { - for _, text := range matchTexts { - if p.re.MatchString(text) { - return true - } - } - return false -} - -// Traverse the leaf submatches in the regex tree and extract a comment, if any -// is present. -func extractComment(re *syntax.Regexp) string { - for _, sub := range re.Sub { - subStr := sub.String() - if strings.HasPrefix(subStr, "#") { - return strings.TrimSpace(strings.TrimPrefix(sub.String(), "#")) - } - if len(sub.Sub) > 0 { - if comment := extractComment(sub); comment != "" { - return comment - } - } - } - return "" -} diff --git a/vendor/github.com/ashanbrown/makezero/LICENSE b/vendor/github.com/ashanbrown/makezero/LICENSE deleted file mode 100644 index dc1d47ad54..0000000000 --- a/vendor/github.com/ashanbrown/makezero/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2019 Andrew Shannon Brown - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/github.com/ashanbrown/makezero/makezero/makezero.go b/vendor/github.com/ashanbrown/makezero/makezero/makezero.go deleted file mode 100644 index 18bcad3d0a..0000000000 --- a/vendor/github.com/ashanbrown/makezero/makezero/makezero.go +++ /dev/null @@ -1,230 +0,0 @@ -// Package makezero provides a linter for appends to slices initialized with non-zero length. -package makezero - -import ( - "bytes" - "fmt" - "go/ast" - "go/printer" - "go/token" - "go/types" - "log" - "regexp" -) - -// a decl might include multiple var, -// so var name with decl make final uniq obj. -type uniqDecl struct { - varName string - decl interface{} -} - -type Issue interface { - Details() string - Pos() token.Pos - Position() token.Position - String() string -} - -type AppendIssue struct { - name string - pos token.Pos - position token.Position -} - -func (a AppendIssue) Details() string { - return fmt.Sprintf("append to slice `%s` with non-zero initialized length", a.name) -} - -func (a AppendIssue) Pos() token.Pos { - return a.pos -} - -func (a AppendIssue) Position() token.Position { - return a.position -} - -func (a AppendIssue) String() string { return toString(a) } - -type MustHaveNonZeroInitLenIssue struct { - name string - pos token.Pos - position token.Position -} - -func (i MustHaveNonZeroInitLenIssue) Details() string { - return fmt.Sprintf("slice `%s` does not have non-zero initial length", i.name) -} - -func (i MustHaveNonZeroInitLenIssue) Pos() token.Pos { - return i.pos -} - -func (i MustHaveNonZeroInitLenIssue) Position() token.Position { - return i.position -} - -func (i MustHaveNonZeroInitLenIssue) String() string { return toString(i) } - -func toString(i Issue) string { - return fmt.Sprintf("%s at %s", i.Details(), i.Position()) -} - -type visitor struct { - initLenMustBeZero bool - - comments []*ast.CommentGroup // comments to apply during this visit - info *types.Info - - nonZeroLengthSliceDecls map[uniqDecl]struct{} - fset *token.FileSet - issues []Issue -} - -type Linter struct { - initLenMustBeZero bool -} - -func NewLinter(initialLengthMustBeZero bool) *Linter { - return &Linter{ - initLenMustBeZero: initialLengthMustBeZero, - } -} - -func (l Linter) Run(fset *token.FileSet, info *types.Info, nodes ...ast.Node) ([]Issue, error) { - var issues []Issue - for _, node := range nodes { - var comments []*ast.CommentGroup - if file, ok := node.(*ast.File); ok { - comments = file.Comments - } - visitor := visitor{ - nonZeroLengthSliceDecls: make(map[uniqDecl]struct{}), - initLenMustBeZero: l.initLenMustBeZero, - info: info, - fset: fset, - comments: comments, - } - ast.Walk(&visitor, node) - issues = append(issues, visitor.issues...) - } - return issues, nil -} - -func (v *visitor) Visit(node ast.Node) ast.Visitor { - switch node := node.(type) { - case *ast.CallExpr: - fun, ok := node.Fun.(*ast.Ident) - if !ok || fun.Name != "append" { - break - } - if sliceIdent, ok := node.Args[0].(*ast.Ident); ok && - v.hasNonZeroInitialLength(sliceIdent) && - !v.hasNoLintOnSameLine(fun) { - v.issues = append(v.issues, - AppendIssue{ - name: sliceIdent.Name, - pos: fun.Pos(), - position: v.fset.Position(fun.Pos()), - }) - } - case *ast.AssignStmt: - for i, right := range node.Rhs { - if right, ok := right.(*ast.CallExpr); ok { - fun, ok := right.Fun.(*ast.Ident) - if !ok || fun.Name != "make" { - continue - } - left := node.Lhs[i] - if len(right.Args) == 2 { - // ignore if not a slice or it has explicit zero length - if !v.isSlice(right.Args[0]) { - continue - } else if lit, ok := right.Args[1].(*ast.BasicLit); ok && lit.Kind == token.INT && lit.Value == "0" { - continue - } - if v.initLenMustBeZero && !v.hasNoLintOnSameLine(fun) { - v.issues = append(v.issues, MustHaveNonZeroInitLenIssue{ - name: v.textFor(left), - pos: node.Pos(), - position: v.fset.Position(node.Pos()), - }) - } - v.recordNonZeroLengthSlices(left) - } - } - } - } - return v -} - -func (v *visitor) textFor(node ast.Node) string { - typeBuf := new(bytes.Buffer) - if err := printer.Fprint(typeBuf, v.fset, node); err != nil { - log.Fatalf("ERROR: unable to print type: %s", err) - } - return typeBuf.String() -} - -func (v *visitor) hasNonZeroInitialLength(ident *ast.Ident) bool { - if ident.Obj == nil { - log.Printf("WARNING: could not determine with %q at %s is a slice (missing object type)", - ident.Name, v.fset.Position(ident.Pos()).String()) - return false - } - _, exists := v.nonZeroLengthSliceDecls[uniqDecl{ - varName: ident.Obj.Name, - decl: ident.Obj.Decl, - }] - return exists -} - -func (v *visitor) recordNonZeroLengthSlices(node ast.Node) { - ident, ok := node.(*ast.Ident) - if !ok { - return - } - if ident.Obj == nil { - return - } - v.nonZeroLengthSliceDecls[uniqDecl{ - varName: ident.Obj.Name, - decl: ident.Obj.Decl, - }] = struct{}{} -} - -func (v *visitor) isSlice(node ast.Node) bool { - // determine type if this is a user-defined type - if ident, ok := node.(*ast.Ident); ok { - obj := ident.Obj - if obj == nil { - if v.info != nil { - _, ok := v.info.ObjectOf(ident).Type().(*types.Slice) - return ok - } - return false - } - spec, ok := obj.Decl.(*ast.TypeSpec) - if !ok { - return false - } - node = spec.Type - } - - if node, ok := node.(*ast.ArrayType); ok { - return node.Len == nil // only slices have zero length - } - return false -} - -func (v *visitor) hasNoLintOnSameLine(node ast.Node) bool { - nolint := regexp.MustCompile(`^\s*nozero\b`) - nodePos := v.fset.Position(node.Pos()) - for _, c := range v.comments { - commentPos := v.fset.Position(c.Pos()) - if commentPos.Line == nodePos.Line && nolint.MatchString(c.Text()) { - return true - } - } - return false -} diff --git a/vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE b/vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE deleted file mode 100644 index 25cec1ed48..0000000000 --- a/vendor/github.com/aymanbagabas/go-osc52/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Ayman Bagabas - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/aymanbagabas/go-osc52/v2/README.md b/vendor/github.com/aymanbagabas/go-osc52/v2/README.md deleted file mode 100644 index 4de3a22d14..0000000000 --- a/vendor/github.com/aymanbagabas/go-osc52/v2/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -# go-osc52 - -

- Latest Release - GoDoc -

- -A Go library to work with the [ANSI OSC52](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands) terminal sequence. - -## Usage - -You can use this small library to construct an ANSI OSC52 sequence suitable for -your terminal. - - -### Example - -```go -import ( - "os" - "fmt" - - "github.com/aymanbagabas/go-osc52/v2" -) - -func main() { - s := "Hello World!" - - // Copy `s` to system clipboard - osc52.New(s).WriteTo(os.Stderr) - - // Copy `s` to primary clipboard (X11) - osc52.New(s).Primary().WriteTo(os.Stderr) - - // Query the clipboard - osc52.Query().WriteTo(os.Stderr) - - // Clear system clipboard - osc52.Clear().WriteTo(os.Stderr) - - // Use the fmt.Stringer interface to copy `s` to system clipboard - fmt.Fprint(os.Stderr, osc52.New(s)) - - // Or to primary clipboard - fmt.Fprint(os.Stderr, osc52.New(s).Primary()) -} -``` - -## SSH Example - -You can use this over SSH using [gliderlabs/ssh](https://github.com/gliderlabs/ssh) for instance: - -```go -var sshSession ssh.Session -seq := osc52.New("Hello awesome!") -// Check if term is screen or tmux -pty, _, _ := s.Pty() -if pty.Term == "screen" { - seq = seq.Screen() -} else if isTmux { - seq = seq.Tmux() -} -seq.WriteTo(sshSession.Stderr()) -``` - -## Tmux - -Make sure you have `set-clipboard on` in your config, otherwise, tmux won't -allow your application to access the clipboard [^1]. - -Using the tmux option, `osc52.TmuxMode` or `osc52.New(...).Tmux()`, wraps the -OSC52 sequence in a special tmux DCS sequence and pass it to the outer -terminal. This requires `allow-passthrough on` in your config. -`allow-passthrough` is no longer enabled by default -[since tmux 3.3a](https://github.com/tmux/tmux/issues/3218#issuecomment-1153089282) [^2]. - -[^1]: See [tmux clipboard](https://github.com/tmux/tmux/wiki/Clipboard) -[^2]: [What is allow-passthrough](https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-it) - -## Credits - -* [vim-oscyank](https://github.com/ojroques/vim-oscyank) this is heavily inspired by vim-oscyank. diff --git a/vendor/github.com/aymanbagabas/go-osc52/v2/osc52.go b/vendor/github.com/aymanbagabas/go-osc52/v2/osc52.go deleted file mode 100644 index dc758d2869..0000000000 --- a/vendor/github.com/aymanbagabas/go-osc52/v2/osc52.go +++ /dev/null @@ -1,305 +0,0 @@ -// OSC52 is a terminal escape sequence that allows copying text to the clipboard. -// -// The sequence consists of the following: -// -// OSC 52 ; Pc ; Pd BEL -// -// Pc is the clipboard choice: -// -// c: clipboard -// p: primary -// q: secondary (not supported) -// s: select (not supported) -// 0-7: cut-buffers (not supported) -// -// Pd is the data to copy to the clipboard. This string should be encoded in -// base64 (RFC-4648). -// -// If Pd is "?", the terminal replies to the host with the current contents of -// the clipboard. -// -// If Pd is neither a base64 string nor "?", the terminal clears the clipboard. -// -// See https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands -// where Ps = 52 => Manipulate Selection Data. -// -// Examples: -// -// // copy "hello world" to the system clipboard -// fmt.Fprint(os.Stderr, osc52.New("hello world")) -// -// // copy "hello world" to the primary Clipboard -// fmt.Fprint(os.Stderr, osc52.New("hello world").Primary()) -// -// // limit the size of the string to copy 10 bytes -// fmt.Fprint(os.Stderr, osc52.New("0123456789").Limit(10)) -// -// // escape the OSC52 sequence for screen using DCS sequences -// fmt.Fprint(os.Stderr, osc52.New("hello world").Screen()) -// -// // escape the OSC52 sequence for Tmux -// fmt.Fprint(os.Stderr, osc52.New("hello world").Tmux()) -// -// // query the system Clipboard -// fmt.Fprint(os.Stderr, osc52.Query()) -// -// // query the primary clipboard -// fmt.Fprint(os.Stderr, osc52.Query().Primary()) -// -// // clear the system Clipboard -// fmt.Fprint(os.Stderr, osc52.Clear()) -// -// // clear the primary Clipboard -// fmt.Fprint(os.Stderr, osc52.Clear().Primary()) -package osc52 - -import ( - "encoding/base64" - "fmt" - "io" - "strings" -) - -// Clipboard is the clipboard buffer to use. -type Clipboard rune - -const ( - // SystemClipboard is the system clipboard buffer. - SystemClipboard Clipboard = 'c' - // PrimaryClipboard is the primary clipboard buffer (X11). - PrimaryClipboard = 'p' -) - -// Mode is the mode to use for the OSC52 sequence. -type Mode uint - -const ( - // DefaultMode is the default OSC52 sequence mode. - DefaultMode Mode = iota - // ScreenMode escapes the OSC52 sequence for screen using DCS sequences. - ScreenMode - // TmuxMode escapes the OSC52 sequence for tmux. Not needed if tmux - // clipboard is set to `set-clipboard on` - TmuxMode -) - -// Operation is the OSC52 operation. -type Operation uint - -const ( - // SetOperation is the copy operation. - SetOperation Operation = iota - // QueryOperation is the query operation. - QueryOperation - // ClearOperation is the clear operation. - ClearOperation -) - -// Sequence is the OSC52 sequence. -type Sequence struct { - str string - limit int - op Operation - mode Mode - clipboard Clipboard -} - -var _ fmt.Stringer = Sequence{} - -var _ io.WriterTo = Sequence{} - -// String returns the OSC52 sequence. -func (s Sequence) String() string { - var seq strings.Builder - // mode escape sequences start - seq.WriteString(s.seqStart()) - // actual OSC52 sequence start - seq.WriteString(fmt.Sprintf("\x1b]52;%c;", s.clipboard)) - switch s.op { - case SetOperation: - str := s.str - if s.limit > 0 && len(str) > s.limit { - return "" - } - b64 := base64.StdEncoding.EncodeToString([]byte(str)) - switch s.mode { - case ScreenMode: - // Screen doesn't support OSC52 but will pass the contents of a DCS - // sequence to the outer terminal unchanged. - // - // Here, we split the encoded string into 76 bytes chunks and then - // join the chunks with sequences. Finally, - // wrap the whole thing in - // . - // s := strings.SplitN(b64, "", 76) - s := make([]string, 0, len(b64)/76+1) - for i := 0; i < len(b64); i += 76 { - end := i + 76 - if end > len(b64) { - end = len(b64) - } - s = append(s, b64[i:end]) - } - seq.WriteString(strings.Join(s, "\x1b\\\x1bP")) - default: - seq.WriteString(b64) - } - case QueryOperation: - // OSC52 queries the clipboard using "?" - seq.WriteString("?") - case ClearOperation: - // OSC52 clears the clipboard if the data is neither a base64 string nor "?" - // we're using "!" as a default - seq.WriteString("!") - } - // actual OSC52 sequence end - seq.WriteString("\x07") - // mode escape end - seq.WriteString(s.seqEnd()) - return seq.String() -} - -// WriteTo writes the OSC52 sequence to the writer. -func (s Sequence) WriteTo(out io.Writer) (int64, error) { - n, err := out.Write([]byte(s.String())) - return int64(n), err -} - -// Mode sets the mode for the OSC52 sequence. -func (s Sequence) Mode(m Mode) Sequence { - s.mode = m - return s -} - -// Tmux sets the mode to TmuxMode. -// Used to escape the OSC52 sequence for `tmux`. -// -// Note: this is not needed if tmux clipboard is set to `set-clipboard on`. If -// TmuxMode is used, tmux must have `allow-passthrough on` set. -// -// This is a syntactic sugar for s.Mode(TmuxMode). -func (s Sequence) Tmux() Sequence { - return s.Mode(TmuxMode) -} - -// Screen sets the mode to ScreenMode. -// Used to escape the OSC52 sequence for `screen`. -// -// This is a syntactic sugar for s.Mode(ScreenMode). -func (s Sequence) Screen() Sequence { - return s.Mode(ScreenMode) -} - -// Clipboard sets the clipboard buffer for the OSC52 sequence. -func (s Sequence) Clipboard(c Clipboard) Sequence { - s.clipboard = c - return s -} - -// Primary sets the clipboard buffer to PrimaryClipboard. -// This is the X11 primary clipboard. -// -// This is a syntactic sugar for s.Clipboard(PrimaryClipboard). -func (s Sequence) Primary() Sequence { - return s.Clipboard(PrimaryClipboard) -} - -// Limit sets the limit for the OSC52 sequence. -// The default limit is 0 (no limit). -// -// Strings longer than the limit get ignored. Settting the limit to 0 or a -// negative value disables the limit. Each terminal defines its own escapse -// sequence limit. -func (s Sequence) Limit(l int) Sequence { - if l < 0 { - s.limit = 0 - } else { - s.limit = l - } - return s -} - -// Operation sets the operation for the OSC52 sequence. -// The default operation is SetOperation. -func (s Sequence) Operation(o Operation) Sequence { - s.op = o - return s -} - -// Clear sets the operation to ClearOperation. -// This clears the clipboard. -// -// This is a syntactic sugar for s.Operation(ClearOperation). -func (s Sequence) Clear() Sequence { - return s.Operation(ClearOperation) -} - -// Query sets the operation to QueryOperation. -// This queries the clipboard contents. -// -// This is a syntactic sugar for s.Operation(QueryOperation). -func (s Sequence) Query() Sequence { - return s.Operation(QueryOperation) -} - -// SetString sets the string for the OSC52 sequence. Strings are joined with a -// space character. -func (s Sequence) SetString(strs ...string) Sequence { - s.str = strings.Join(strs, " ") - return s -} - -// New creates a new OSC52 sequence with the given string(s). Strings are -// joined with a space character. -func New(strs ...string) Sequence { - s := Sequence{ - str: strings.Join(strs, " "), - limit: 0, - mode: DefaultMode, - clipboard: SystemClipboard, - op: SetOperation, - } - return s -} - -// Query creates a new OSC52 sequence with the QueryOperation. -// This returns a new OSC52 sequence to query the clipboard contents. -// -// This is a syntactic sugar for New().Query(). -func Query() Sequence { - return New().Query() -} - -// Clear creates a new OSC52 sequence with the ClearOperation. -// This returns a new OSC52 sequence to clear the clipboard. -// -// This is a syntactic sugar for New().Clear(). -func Clear() Sequence { - return New().Clear() -} - -func (s Sequence) seqStart() string { - switch s.mode { - case TmuxMode: - // Write the start of a tmux escape sequence. - return "\x1bPtmux;\x1b" - case ScreenMode: - // Write the start of a DCS sequence. - return "\x1bP" - default: - return "" - } -} - -func (s Sequence) seqEnd() string { - switch s.mode { - case TmuxMode: - // Terminate the tmux escape sequence. - return "\x1b\\" - case ScreenMode: - // Write the end of a DCS sequence. - return "\x1b\x5c" - default: - return "" - } -} diff --git a/vendor/github.com/bkielbasa/cyclop/LICENSE b/vendor/github.com/bkielbasa/cyclop/LICENSE deleted file mode 100644 index b4a776a409..0000000000 --- a/vendor/github.com/bkielbasa/cyclop/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Bartłomiej Klimczak - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/bkielbasa/cyclop/pkg/analyzer/analyzer.go b/vendor/github.com/bkielbasa/cyclop/pkg/analyzer/analyzer.go deleted file mode 100644 index eaf408d6f3..0000000000 --- a/vendor/github.com/bkielbasa/cyclop/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,107 +0,0 @@ -package analyzer - -import ( - "flag" - "go/ast" - "go/token" - "strings" - - "golang.org/x/tools/go/analysis" -) - -//nolint:gochecknoglobals -var flagSet flag.FlagSet - -//nolint:gochecknoglobals -var ( - maxComplexity int - packageAverage float64 - skipTests bool -) - -//nolint:gochecknoinits -func init() { - flagSet.IntVar(&maxComplexity, "maxComplexity", 10, "max complexity the function can have") - flagSet.Float64Var(&packageAverage, "packageAverage", 0, "max average complexity in package") - flagSet.BoolVar(&skipTests, "skipTests", false, "should the linter execute on test files as well") -} - -func NewAnalyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "cyclop", - Doc: "calculates cyclomatic complexity", - Run: run, - Flags: flagSet, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - var sum, count float64 - var pkgName string - var pkgPos token.Pos - - for _, f := range pass.Files { - ast.Inspect(f, func(node ast.Node) bool { - f, ok := node.(*ast.FuncDecl) - if !ok { - if node == nil { - return true - } - if file, ok := node.(*ast.File); ok { - pkgName = file.Name.Name - pkgPos = node.Pos() - } - // we check function by function - return true - } - - if skipTests && testFunc(f) { - return true - } - - count++ - comp := complexity(f) - sum += float64(comp) - if comp > maxComplexity { - pass.Reportf(node.Pos(), "calculated cyclomatic complexity for function %s is %d, max is %d", f.Name.Name, comp, maxComplexity) - } - - return true - }) - } - - if packageAverage > 0 { - avg := sum / count - if avg > packageAverage { - pass.Reportf(pkgPos, "the average complexity for the package %s is %f, max is %f", pkgName, avg, packageAverage) - } - } - - return nil, nil -} - -func testFunc(f *ast.FuncDecl) bool { - return strings.HasPrefix(f.Name.Name, "Test") -} - -func complexity(fn *ast.FuncDecl) int { - v := complexityVisitor{} - ast.Walk(&v, fn) - return v.Complexity -} - -type complexityVisitor struct { - Complexity int -} - -func (v *complexityVisitor) Visit(n ast.Node) ast.Visitor { - switch n := n.(type) { - case *ast.FuncDecl, *ast.IfStmt, *ast.ForStmt, *ast.RangeStmt, *ast.CaseClause, *ast.CommClause: - v.Complexity++ - case *ast.BinaryExpr: - if n.Op == token.LAND || n.Op == token.LOR { - v.Complexity++ - } - } - return v -} diff --git a/vendor/github.com/blakesmith/ar/.gitignore b/vendor/github.com/blakesmith/ar/.gitignore deleted file mode 100644 index 99cf5ff7dc..0000000000 --- a/vendor/github.com/blakesmith/ar/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.*~ diff --git a/vendor/github.com/blakesmith/ar/COPYING b/vendor/github.com/blakesmith/ar/COPYING deleted file mode 100644 index c99e81289f..0000000000 --- a/vendor/github.com/blakesmith/ar/COPYING +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2013 Blake Smith - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/vendor/github.com/blakesmith/ar/README.md b/vendor/github.com/blakesmith/ar/README.md deleted file mode 100644 index ff75d7ff0f..0000000000 --- a/vendor/github.com/blakesmith/ar/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Golang ar (archive) file reader - -This is a simple library for reading and writing [ar](http://en.wikipedia.org/wiki/Ar_(Unix)) files in common format. It is influenced heavily in style and interface from the golang [tar](http://golang.org/pkg/archive/tar/) package. - -## Author - -Written by Blake Smith - -Licensed under the MIT license. \ No newline at end of file diff --git a/vendor/github.com/blakesmith/ar/common.go b/vendor/github.com/blakesmith/ar/common.go deleted file mode 100644 index 335bade4e2..0000000000 --- a/vendor/github.com/blakesmith/ar/common.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright (c) 2013 Blake Smith - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -package ar - -import ( - "time" -) - -const ( - HEADER_BYTE_SIZE = 60 - GLOBAL_HEADER = "!\n" -) - -type Header struct { - Name string - ModTime time.Time - Uid int - Gid int - Mode int64 - Size int64 -} - -type slicer []byte - -func (sp *slicer) next(n int) (b []byte) { - s := *sp - b, *sp = s[0:n], s[n:] - return -} diff --git a/vendor/github.com/blakesmith/ar/reader.go b/vendor/github.com/blakesmith/ar/reader.go deleted file mode 100644 index 4b82493982..0000000000 --- a/vendor/github.com/blakesmith/ar/reader.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright (c) 2013 Blake Smith - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -package ar - -import ( - "io" - "io/ioutil" - "os" - "strconv" - "time" -) - -// Provides read access to an ar archive. -// Call next to skip files -// -// Example: -// reader := NewReader(f) -// var buf bytes.Buffer -// for { -// _, err := reader.Next() -// if err == io.EOF { -// break -// } -// if err != nil { -// t.Errorf(err.Error()) -// } -// io.Copy(&buf, reader) -// } - -type Reader struct { - r io.Reader - nb int64 - pad int64 -} - -// Copies read data to r. Strips the global ar header. -func NewReader(r io.Reader) *Reader { - io.CopyN(ioutil.Discard, r, 8) // Discard global header - - return &Reader{r: r} -} - -func (rd *Reader) string(b []byte) string { - i := len(b)-1 - for i > 0 && b[i] == 32 { - i-- - } - - return string(b[0:i+1]) -} - -func (rd *Reader) numeric(b []byte) int64 { - i := len(b)-1 - for i > 0 && b[i] == 32 { - i-- - } - - n, _ := strconv.ParseInt(string(b[0:i+1]), 10, 64) - - return n -} - -func (rd *Reader) octal(b []byte) int64 { - i := len(b)-1 - for i > 0 && b[i] == 32 { - i-- - } - - n, _ := strconv.ParseInt(string(b[3:i+1]), 8, 64) - - return n -} - -func (rd *Reader) skipUnread() error { - skip := rd.nb + rd.pad - rd.nb, rd.pad = 0, 0 - if seeker, ok := rd.r.(io.Seeker); ok { - _, err := seeker.Seek(skip, os.SEEK_CUR) - return err - } - - _, err := io.CopyN(ioutil.Discard, rd.r, skip) - return err -} - -func (rd *Reader) readHeader() (*Header, error) { - headerBuf := make([]byte, HEADER_BYTE_SIZE) - if _, err := io.ReadFull(rd.r, headerBuf); err != nil { - return nil, err - } - - header := new(Header) - s := slicer(headerBuf) - - header.Name = rd.string(s.next(16)) - header.ModTime = time.Unix(rd.numeric(s.next(12)), 0) - header.Uid = int(rd.numeric(s.next(6))) - header.Gid = int(rd.numeric(s.next(6))) - header.Mode = rd.octal(s.next(8)) - header.Size = rd.numeric(s.next(10)) - - rd.nb = int64(header.Size) - if header.Size%2 == 1 { - rd.pad = 1 - } else { - rd.pad = 0 - } - - return header, nil -} - -// Call Next() to skip to the next file in the archive file. -// Returns a Header which contains the metadata about the -// file in the archive. -func (rd *Reader) Next() (*Header, error) { - err := rd.skipUnread() - if err != nil { - return nil, err - } - - return rd.readHeader() -} - -// Read data from the current entry in the archive. -func (rd *Reader) Read(b []byte) (n int, err error) { - if rd.nb == 0 { - return 0, io.EOF - } - if int64(len(b)) > rd.nb { - b = b[0:rd.nb] - } - n, err = rd.r.Read(b) - rd.nb -= int64(n) - - return -} diff --git a/vendor/github.com/blakesmith/ar/writer.go b/vendor/github.com/blakesmith/ar/writer.go deleted file mode 100644 index 680f5cbc74..0000000000 --- a/vendor/github.com/blakesmith/ar/writer.go +++ /dev/null @@ -1,124 +0,0 @@ -/* -Copyright (c) 2013 Blake Smith - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -package ar - -import ( - "errors" - "io" - "strconv" -) - -var ( - ErrWriteTooLong = errors.New("ar: write too long") -) - -// Writer provides sequential writing of an ar archive. -// An ar archive is sequence of header file pairs -// Call WriteHeader to begin writing a new file, then call Write to supply the file's data -// -// Example: -// archive := ar.NewWriter(writer) -// archive.WriteGlobalHeader() -// header := new(ar.Header) -// header.Size = 15 // bytes -// if err := archive.WriteHeader(header); err != nil { -// return err -// } -// io.Copy(archive, data) -type Writer struct { - w io.Writer - nb int64 // number of unwritten bytes for the current file entry -} - -// Create a new ar writer that writes to w -func NewWriter(w io.Writer) *Writer { return &Writer{w: w} } - -func (aw *Writer) numeric(b []byte, x int64) { - s := strconv.FormatInt(x, 10) - for len(s) < len(b) { - s = s + " " - } - copy(b, []byte(s)) -} - -func (aw *Writer) octal(b []byte, x int64) { - s := "100" + strconv.FormatInt(x, 8) - for len(s) < len(b) { - s = s + " " - } - copy(b, []byte(s)) -} - -func (aw *Writer) string(b []byte, str string) { - s := str - for len(s) < len(b) { - s = s + " " - } - copy(b, []byte(s)) -} - -// Writes to the current entry in the ar archive -// Returns ErrWriteTooLong if more than header.Size -// bytes are written after a call to WriteHeader -func (aw *Writer) Write(b []byte) (n int, err error) { - if int64(len(b)) > aw.nb { - b = b[0:aw.nb] - err = ErrWriteTooLong - } - n, werr := aw.w.Write(b) - aw.nb -= int64(n) - if werr != nil { - return n, werr - } - - if len(b)%2 == 1 { // data size must be aligned to an even byte - n2, _ := aw.w.Write([]byte{'\n'}) - return n+n2, err - } - - return -} - -func (aw *Writer) WriteGlobalHeader() error { - _, err := aw.w.Write([]byte(GLOBAL_HEADER)) - return err -} - -// Writes the header to the underlying writer and prepares -// to receive the file payload -func (aw *Writer) WriteHeader(hdr *Header) error { - aw.nb = int64(hdr.Size) - header := make([]byte, HEADER_BYTE_SIZE) - s := slicer(header) - - aw.string(s.next(16), hdr.Name) - aw.numeric(s.next(12), hdr.ModTime.Unix()) - aw.numeric(s.next(6), int64(hdr.Uid)) - aw.numeric(s.next(6), int64(hdr.Gid)) - aw.octal(s.next(8), hdr.Mode) - aw.numeric(s.next(10), hdr.Size) - aw.string(s.next(2), "`\n") - - _, err := aw.w.Write(header) - - return err -} diff --git a/vendor/github.com/blizzy78/varnamelen/.editorconfig b/vendor/github.com/blizzy78/varnamelen/.editorconfig deleted file mode 100644 index 7b64615455..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -root = true - -[**] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -indent_style = tab -indent_size = 4 -trim_trailing_whitespace = true - -[**/*.yml] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/blizzy78/varnamelen/.gitignore b/vendor/github.com/blizzy78/varnamelen/.gitignore deleted file mode 100644 index 1a4a71669f..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/cmd/__debug_bin diff --git a/vendor/github.com/blizzy78/varnamelen/.golangci.yml b/vendor/github.com/blizzy78/varnamelen/.golangci.yml deleted file mode 100644 index 566572363c..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/.golangci.yml +++ /dev/null @@ -1,70 +0,0 @@ -# https://github.com/golangci/golangci-lint/issues/456#issuecomment-617470264 -issues: - exclude-use-default: false - exclude: - # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok - - Error return value of .((os\.)?std(out|err)\..*|.*print(f|ln)?|os\.(Un)?Setenv). is not checked - # golint: False positive when tests are defined in package 'test' - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this - # gosec: Duplicated errcheck checks - - G104 - # gosec: Too many issues in popular repos - - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) - # gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' - - Potential file inclusion via variable - -linters: - enable: - - asciicheck - - bodyclose - - cyclop - - durationcheck - - errname - - errorlint - - exportloopref - - forcetypeassert - - gocognit - - gocritic - - goerr113 - - gofmt - - goprintffuncname - - gosec - - ifshort - - nakedret - - nestif - - nilerr - - noctx - - nolintlint - - prealloc - - predeclared - - promlinter - - revive - - rowserrcheck - - sqlclosecheck - - stylecheck - - thelper - - tparallel - - unconvert - - unparam - - varnamelen - - wastedassign - - wrapcheck - - wsl - -linters-settings: - gocognit: - min-complexity: 15 - nakedret: - max-func-lines: 0 - nolintlint: - allow-unused: false - allow-leading-space: false - require-explanation: true - require-specific: true - unused: - go: 1.16 - varnamelen: - check-return: true - ignore-type-assert-ok: true - ignore-map-index-ok: true - ignore-chan-recv-ok: true diff --git a/vendor/github.com/blizzy78/varnamelen/LICENSE b/vendor/github.com/blizzy78/varnamelen/LICENSE deleted file mode 100644 index c45156a2c3..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright 2021-2022 Maik Schreiber - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/blizzy78/varnamelen/README.md b/vendor/github.com/blizzy78/varnamelen/README.md deleted file mode 100644 index 02131ff298..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/README.md +++ /dev/null @@ -1,155 +0,0 @@ -[![GoDoc](https://pkg.go.dev/badge/github.com/blizzy78/varnamelen)](https://pkg.go.dev/github.com/blizzy78/varnamelen) - - -varnamelen -========== - -A Go Analyzer that checks that the length of a variable's name matches its usage scope: - -Variables with short names can be hard to use if the variable is used over a longer span of lines of code. -A longer variable name may be easier to comprehend. - -The analyzer also checks method receiver names, named return values, and type parameter names. - -Arbitrary declarations such as `f *foo` can be ignored, as well as idiomatic `ok` variables. -Conventional Go parameters such as `ctx context.Context` or `t *testing.T` will always be ignored. - -**Example output** - -``` -test.go:4:2: variable name 'x' is too short for the scope of its usage (varnamelen) - x := 123 - ^ -test.go:6:2: variable name 'i' is too short for the scope of its usage (varnamelen) - i := 10 - ^ -``` - - -golangci-lint Integration -------------------------- - -varnamelen is integrated into [golangci-lint] (though it may not always be the most recent version.) - -Example configuration for golangci-lint: - -```yaml -linters-settings: - varnamelen: - # The longest distance, in source lines, that is being considered a "small scope." (defaults to 5) - # Variables used in at most this many lines will be ignored. - max-distance: 5 - # The minimum length of a variable's name that is considered "long." (defaults to 3) - # Variable names that are at least this long will be ignored. - min-name-length: 3 - # Check method receiver. (defaults to false) - check-receiver: false - # Check named return values. (defaults to false) - check-return: false - # Check type parameters. (defaults to false) - check-type-param: false - # Ignore "ok" variables that hold the bool return value of a type assertion. (defaults to false) - ignore-type-assert-ok: false - # Ignore "ok" variables that hold the bool return value of a map index. (defaults to false) - ignore-map-index-ok: false - # Ignore "ok" variables that hold the bool return value of a channel receive. (defaults to false) - ignore-chan-recv-ok: false - # Optional list of variable names that should be ignored completely. (defaults to empty list) - ignore-names: - - err - # Optional list of variable declarations that should be ignored completely. (defaults to empty list) - # Entries must be in one of the following forms (see below for examples): - # - for variables, parameters, or named return values: - # - - # - * - # - for type parameters: - # - - # - for constants: - # - const - ignore-decls: - - c echo.Context - - t testing.T - - f *foo.Bar - - e error - - i int - - const C - - T any -``` - - -Standalone Usage ----------------- - -The `cmd/` folder provides a standalone command line utility. You can build it like this: - -``` -go build -o varnamelen ./cmd/ -``` - -**Usage** - -``` -varnamelen: checks that the length of a variable's name matches its scope - -Usage: varnamelen [-flag] [package] - -A variable with a short name can be hard to use if the variable is used -over a longer span of lines of code. A longer variable name may be easier -to comprehend. - -Flags: - -V print version and exit - -all - no effect (deprecated) - -c int - display offending line with this many lines of context (default -1) - -checkReceiver - check method receiver names - -checkReturn - check named return values - -checkTypeParam - check type parameter names - -cpuprofile string - write CPU profile to this file - -debug string - debug flags, any subset of "fpstv" - -fix - apply all suggested fixes - -flags - print analyzer flags in JSON - -ignoreChanRecvOk - ignore 'ok' variables that hold the bool return value of a channel receive - -ignoreDecls value - comma-separated list of ignored variable declarations - -ignoreMapIndexOk - ignore 'ok' variables that hold the bool return value of a map index - -ignoreNames value - comma-separated list of ignored variable names - -ignoreTypeAssertOk - ignore 'ok' variables that hold the bool return value of a type assertion - -json - emit JSON output - -maxDistance int - maximum number of lines of variable usage scope considered 'short' (default 5) - -memprofile string - write memory profile to this file - -minNameLength int - minimum length of variable name considered 'long' (default 3) - -source - no effect (deprecated) - -tags string - no effect (deprecated) - -trace string - write trace log to this file - -v no effect (deprecated) -``` - - -License -------- - -This package is licensed under the MIT license. - - - -[golangci-lint]: https://github.com/golangci/golangci-lint diff --git a/vendor/github.com/blizzy78/varnamelen/doc.go b/vendor/github.com/blizzy78/varnamelen/doc.go deleted file mode 100644 index d63c71cfb7..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package varnamelen implements an analyzer checking that the length of a variable's name -// matches its usage scope. -package varnamelen diff --git a/vendor/github.com/blizzy78/varnamelen/flags.go b/vendor/github.com/blizzy78/varnamelen/flags.go deleted file mode 100644 index ee80774f96..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/flags.go +++ /dev/null @@ -1,109 +0,0 @@ -package varnamelen - -import "strings" - -// stringsValue is the value of a list-of-strings flag. -type stringsValue struct { - Values []string -} - -// declarationsValue is the value of a list-of-declarations flag. -type declarationsValue struct { - Values []declaration -} - -// Set implements Value. -func (sv *stringsValue) Set(values string) error { - if strings.TrimSpace(values) == "" { - sv.Values = nil - return nil - } - - parts := strings.Split(values, ",") - - sv.Values = make([]string, len(parts)) - - for i, part := range parts { - sv.Values[i] = strings.TrimSpace(part) - } - - return nil -} - -// String implements Value. -func (sv *stringsValue) String() string { - return strings.Join(sv.Values, ",") -} - -// contains returns true if sv contains s. -func (sv *stringsValue) contains(s string) bool { - for _, v := range sv.Values { - if v == s { - return true - } - } - - return false -} - -// Set implements Value. -func (dv *declarationsValue) Set(values string) error { - if strings.TrimSpace(values) == "" { - dv.Values = nil - return nil - } - - parts := strings.Split(values, ",") - - dv.Values = make([]declaration, len(parts)) - - for idx, part := range parts { - dv.Values[idx] = parseDeclaration(strings.TrimSpace(part)) - } - - return nil -} - -// String implements Value. -func (dv *declarationsValue) String() string { - parts := make([]string, len(dv.Values)) - - for idx, val := range dv.Values { - parts[idx] = val.name + " " + val.typ - } - - return strings.Join(parts, ",") -} - -// matchVariable returns true if vari matches any of the declarations in dv. -func (dv *declarationsValue) matchVariable(vari variable) bool { - for _, decl := range dv.Values { - if vari.match(decl) { - return true - } - } - - return false -} - -// matchParameter returns true if param matches any of the declarations in dv. -func (dv *declarationsValue) matchParameter(param parameter) bool { - for _, decl := range dv.Values { - if param.match(decl) { - return true - } - } - - return false -} - -// matchParameter returns true if param matches any of the declarations in dv. -func (dv *declarationsValue) matchTypeParameter(param typeParam) bool { - for _, decl := range dv.Values { - if param.match(decl) { - return true - } - } - - return false -} diff --git a/vendor/github.com/blizzy78/varnamelen/typeparam.go b/vendor/github.com/blizzy78/varnamelen/typeparam.go deleted file mode 100644 index a1f3de99a3..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/typeparam.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -package varnamelen - -import "go/ast" - -// isTypeParam returns true if field is a type parameter of any of the given funcs. -func isTypeParam(field *ast.Field, funcs []*ast.FuncDecl, funcLits []*ast.FuncLit) bool { //nolint:gocognit // it's not that complicated - for _, f := range funcs { - if f.Type.TypeParams == nil { - continue - } - - for _, p := range f.Type.TypeParams.List { - if p == field { - return true - } - } - } - - for _, f := range funcLits { - if f.Type.TypeParams == nil { - continue - } - - for _, p := range f.Type.TypeParams.List { - if p == field { - return true - } - } - } - - return false -} diff --git a/vendor/github.com/blizzy78/varnamelen/typeparam_go1.16.go b/vendor/github.com/blizzy78/varnamelen/typeparam_go1.16.go deleted file mode 100644 index 7856651b90..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/typeparam_go1.16.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build (go1.16 && !go1.18) || (go1.17 && !go1.18) -// +build go1.16,!go1.18 go1.17,!go1.18 - -package varnamelen - -import "go/ast" - -// isTypeParam returns true if field is a type parameter of any of the given funcs. -func isTypeParam(_ *ast.Field, _ []*ast.FuncDecl, _ []*ast.FuncLit) bool { - return false -} diff --git a/vendor/github.com/blizzy78/varnamelen/varnamelen.code-workspace b/vendor/github.com/blizzy78/varnamelen/varnamelen.code-workspace deleted file mode 100644 index 68c485c968..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/varnamelen.code-workspace +++ /dev/null @@ -1,13 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "extensions": { - "recommendations": [ - "EditorConfig.EditorConfig", - "golang.go" - ] - } -} diff --git a/vendor/github.com/blizzy78/varnamelen/varnamelen.go b/vendor/github.com/blizzy78/varnamelen/varnamelen.go deleted file mode 100644 index a5b9603114..0000000000 --- a/vendor/github.com/blizzy78/varnamelen/varnamelen.go +++ /dev/null @@ -1,891 +0,0 @@ -package varnamelen - -import ( - "go/ast" - "go/token" - "go/types" - "sort" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -// varNameLen is an analyzer that checks that the length of a variable's name matches its usage scope. -// It will create a report for a variable's assignment if that variable has a short name, but its -// usage scope is not considered "small." -type varNameLen struct { - // maxDistance is the longest distance, in source lines, that is being considered a "small scope." - maxDistance int - - // minNameLength is the minimum length of a variable's name that is considered "long." - minNameLength int - - // ignoreNames is an optional list of variable names that should be ignored completely. - ignoreNames stringsValue - - // checkReceiver determines whether method receivers should be checked. - checkReceiver bool - - // checkReturn determines whether named return values should be checked. - checkReturn bool - - // ignoreTypeAssertOk determines whether "ok" variables that hold the bool return value of a type assertion should be ignored. - ignoreTypeAssertOk bool - - // ignoreMapIndexOk determines whether "ok" variables that hold the bool return value of a map index should be ignored. - ignoreMapIndexOk bool - - // ignoreChannelReceiveOk determines whether "ok" variables that hold the bool return value of a channel receive should be ignored. - ignoreChannelReceiveOk bool - - // ignoreDeclarations is an optional list of variable declarations that should be ignored completely. - ignoreDeclarations declarationsValue - - // checkTypeParameters determines whether type parameters should be checked. - checkTypeParameters bool -} - -// variable represents a declared variable. -type variable struct { - // name is the name of the variable. - name string - - // constant is true if the variable is actually a constant. - constant bool - - // typ is the type of the variable. - typ string - - // assign is the assign statement that declares the variable. - assign *ast.AssignStmt - - // valueSpec is the value specification that declares the variable. - valueSpec *ast.ValueSpec -} - -// parameter represents a declared function or method parameter. -type parameter struct { - // name is the name of the parameter. - name string - - // typ is the type of the parameter. - typ string - - // field is the declaration of the parameter. - field *ast.Field -} - -// typeParam represents a declared type parameter. -type typeParam struct { - // name is the name of the type parameter. - name string - - // typ is the type of the type parameter. - typ string - - // field is the field that declares the type parameter. - field *ast.Field -} - -// declaration is a variable declaration. -type declaration struct { - // name is the name of the variable. - name string - - // constant is true if the variable is actually a constant. - constant bool - - // typ is the type of the variable. Not used for constants. - typ string -} - -// importDeclaration is an import declaration. -type importDeclaration struct { - // name is the short name or alias for the imported package. This is either the package's default name, - // or the alias specified in the import statement. - // Not used if self is true. - name string - - // path is the full path to the imported package. - path string - - // self is true when this is an implicit import declaration for the current package. - self bool -} - -const ( - // defaultMaxDistance is the default value for the maximum distance between the declaration of a variable and its usage - // that is considered a "small scope." - defaultMaxDistance = 5 - - // defaultMinNameLength is the default value for the minimum length of a variable's name that is considered "long." - defaultMinNameLength = 3 -) - -// conventionalDecls is a list of conventional variable declarations. -var conventionalDecls = []declaration{ - parseDeclaration("ctx context.Context"), - - parseDeclaration("b *testing.B"), - parseDeclaration("f *testing.F"), - parseDeclaration("m *testing.M"), - parseDeclaration("pb *testing.PB"), - parseDeclaration("t *testing.T"), - parseDeclaration("tb testing.TB"), -} - -// NewAnalyzer returns a new analyzer. -func NewAnalyzer() *analysis.Analyzer { - vnl := varNameLen{ - maxDistance: defaultMaxDistance, - minNameLength: defaultMinNameLength, - ignoreNames: stringsValue{}, - ignoreDeclarations: declarationsValue{}, - } - - analyzer := analysis.Analyzer{ - Name: "varnamelen", - Doc: "checks that the length of a variable's name matches its scope\n\n" + - "A variable with a short name can be hard to use if the variable is used\n" + - "over a longer span of lines of code. A longer variable name may be easier\n" + - "to comprehend.", - - Run: func(pass *analysis.Pass) (interface{}, error) { - (&vnl).run(pass) - return nil, nil - }, - - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - } - - analyzer.Flags.IntVar(&vnl.maxDistance, "maxDistance", defaultMaxDistance, "maximum number of lines of variable usage scope considered 'short'") - analyzer.Flags.IntVar(&vnl.minNameLength, "minNameLength", defaultMinNameLength, "minimum length of variable name considered 'long'") - analyzer.Flags.Var(&vnl.ignoreNames, "ignoreNames", "comma-separated list of ignored variable names") - analyzer.Flags.BoolVar(&vnl.checkReceiver, "checkReceiver", false, "check method receivers") - analyzer.Flags.BoolVar(&vnl.checkReturn, "checkReturn", false, "check named return values") - analyzer.Flags.BoolVar(&vnl.ignoreTypeAssertOk, "ignoreTypeAssertOk", false, "ignore 'ok' variables that hold the bool return value of a type assertion") - analyzer.Flags.BoolVar(&vnl.ignoreMapIndexOk, "ignoreMapIndexOk", false, "ignore 'ok' variables that hold the bool return value of a map index") - analyzer.Flags.BoolVar(&vnl.ignoreChannelReceiveOk, "ignoreChanRecvOk", false, "ignore 'ok' variables that hold the bool return value of a channel receive") - analyzer.Flags.Var(&vnl.ignoreDeclarations, "ignoreDecls", "comma-separated list of ignored variable declarations") - analyzer.Flags.BoolVar(&vnl.checkTypeParameters, "checkTypeParam", false, "check type parameters") - - return &analyzer -} - -// Run applies v to a package, according to pass. -func (v *varNameLen) run(pass *analysis.Pass) { - varToDist, paramToDist, returnToDist, typeParamToDist := v.distances(pass) - - v.checkVariables(pass, varToDist) - v.checkParams(pass, paramToDist) - v.checkReturns(pass, returnToDist) - v.checkTypeParams(pass, typeParamToDist) -} - -// checkVariables applies v to variables in varToDist. -func (v *varNameLen) checkVariables(pass *analysis.Pass, varToDist map[variable]int) { //nolint:gocognit // it's not that complicated - for variable, dist := range varToDist { - if v.ignoreNames.contains(variable.name) { - continue - } - - if v.ignoreDeclarations.matchVariable(variable) { - continue - } - - if v.checkNameAndDistance(variable.name, dist) { - continue - } - - if v.checkTypeAssertOk(variable) { - continue - } - - if v.checkMapIndexOk(variable) { - continue - } - - if v.checkChannelReceiveOk(variable) { - continue - } - - if variable.isConventional() { - continue - } - - if variable.assign != nil { - pass.Reportf(variable.assign.Pos(), "%s name '%s' is too short for the scope of its usage", variable.kindName(), variable.name) - continue - } - - pass.Reportf(variable.valueSpec.Pos(), "%s name '%s' is too short for the scope of its usage", variable.kindName(), variable.name) - } -} - -// checkParams applies v to parameters in paramToDist. -func (v *varNameLen) checkParams(pass *analysis.Pass, paramToDist map[parameter]int) { - for param, dist := range paramToDist { - if v.ignoreNames.contains(param.name) { - continue - } - - if v.ignoreDeclarations.matchParameter(param) { - continue - } - - if v.checkNameAndDistance(param.name, dist) { - continue - } - - if param.isConventional() { - continue - } - - pass.Reportf(param.field.Pos(), "parameter name '%s' is too short for the scope of its usage", param.name) - } -} - -// checkReturns applies v to named return values in returnToDist. -func (v *varNameLen) checkReturns(pass *analysis.Pass, returnToDist map[parameter]int) { - for returnValue, dist := range returnToDist { - if v.ignoreNames.contains(returnValue.name) { - continue - } - - if v.ignoreDeclarations.matchParameter(returnValue) { - continue - } - - if v.checkNameAndDistance(returnValue.name, dist) { - continue - } - - pass.Reportf(returnValue.field.Pos(), "return value name '%s' is too short for the scope of its usage", returnValue.name) - } -} - -// checkTypeParams applies v to type parameters in paramToDist. -func (v *varNameLen) checkTypeParams(pass *analysis.Pass, paramToDist map[typeParam]int) { - for param, dist := range paramToDist { - if v.ignoreNames.contains(param.name) { - continue - } - - if v.ignoreDeclarations.matchTypeParameter(param) { - continue - } - - if v.checkNameAndDistance(param.name, dist) { - continue - } - - pass.Reportf(param.field.Pos(), "type parameter name '%s' is too short for the scope of its usage", param.name) - } -} - -// checkNameAndDistance returns true if name or dist are considered "short". -func (v *varNameLen) checkNameAndDistance(name string, dist int) bool { - if len(name) >= v.minNameLength { - return true - } - - if dist <= v.maxDistance { - return true - } - - return false -} - -// checkTypeAssertOk returns true if "ok" variables that hold the bool return value of a type assertion -// should be ignored, and if vari is such a variable. -func (v *varNameLen) checkTypeAssertOk(vari variable) bool { - return v.ignoreTypeAssertOk && vari.isTypeAssertOk() -} - -// checkMapIndexOk returns true if "ok" variables that hold the bool return value of a map index -// should be ignored, and if vari is such a variable. -func (v *varNameLen) checkMapIndexOk(vari variable) bool { - return v.ignoreMapIndexOk && vari.isMapIndexOk() -} - -// checkChannelReceiveOk returns true if "ok" variables that hold the bool return value of a channel receive -// should be ignored, and if vari is such a variable. -func (v *varNameLen) checkChannelReceiveOk(vari variable) bool { - return v.ignoreChannelReceiveOk && vari.isChannelReceiveOk() -} - -// distances returns maps of variables, parameters, return values, and type parameters mapping to their longest usage distances. -func (v *varNameLen) distances(pass *analysis.Pass) (map[variable]int, map[parameter]int, map[parameter]int, map[typeParam]int) { - assignIdents, valueSpecIdents, paramIdents, returnIdents, typeParamIdents, imports, switches := v.identsAndImports(pass) - - varToDist := map[variable]int{} - - for _, ident := range assignIdents { - assign := ident.Obj.Decl.(*ast.AssignStmt) //nolint:forcetypeassert // check is done in identsAndImports - - var typ string - if isTypeSwitchAssign(assign, switches) { - typ = "" - } else { - typ = shortTypeName(pass.TypesInfo.TypeOf(ident), imports) - } - - variable := variable{ - name: ident.Name, - typ: typ, - assign: assign, - } - - useLine := pass.Fset.Position(ident.NamePos).Line - declLine := pass.Fset.Position(assign.Pos()).Line - varToDist[variable] = useLine - declLine - } - - for _, ident := range valueSpecIdents { - valueSpec := ident.Obj.Decl.(*ast.ValueSpec) //nolint:forcetypeassert // check is done in identsAndImports - - variable := variable{ - name: ident.Name, - constant: ident.Obj.Kind == ast.Con, - typ: shortTypeName(pass.TypesInfo.TypeOf(ident), imports), - valueSpec: valueSpec, - } - - useLine := pass.Fset.Position(ident.NamePos).Line - declLine := pass.Fset.Position(valueSpec.Pos()).Line - varToDist[variable] = useLine - declLine - } - - paramToDist := map[parameter]int{} - - for _, ident := range paramIdents { - field := ident.Obj.Decl.(*ast.Field) //nolint:forcetypeassert // check is done in identsAndImports - - param := parameter{ - name: ident.Name, - typ: shortTypeName(pass.TypesInfo.TypeOf(field.Type), imports), - field: field, - } - - useLine := pass.Fset.Position(ident.NamePos).Line - declLine := pass.Fset.Position(field.Pos()).Line - paramToDist[param] = useLine - declLine - } - - returnToDist := map[parameter]int{} - - for _, ident := range returnIdents { - field := ident.Obj.Decl.(*ast.Field) //nolint:forcetypeassert // check is done in identsAndImports - - param := parameter{ - name: ident.Name, - typ: shortTypeName(pass.TypesInfo.TypeOf(ident), imports), - field: field, - } - - useLine := pass.Fset.Position(ident.NamePos).Line - declLine := pass.Fset.Position(field.Pos()).Line - returnToDist[param] = useLine - declLine - } - - typeParamToDist := map[typeParam]int{} - - for _, ident := range typeParamIdents { - field := ident.Obj.Decl.(*ast.Field) //nolint:forcetypeassert // check is done in identsAndImports - - param := typeParam{ - name: ident.Name, - typ: shortTypeName(pass.TypesInfo.TypeOf(field.Type), imports), - field: field, - } - - useLine := pass.Fset.Position(ident.NamePos).Line - declLine := pass.Fset.Position(field.Pos()).Line - typeParamToDist[param] = useLine - declLine - } - - return varToDist, paramToDist, returnToDist, typeParamToDist -} - -// identsAndImports returns Idents referencing assign statements, value specifications, parameters, -// return values, and type parameters, respectively, as well as import declarations, and type switch statements. -func (v *varNameLen) identsAndImports(pass *analysis.Pass) ([]*ast.Ident, []*ast.Ident, []*ast.Ident, []*ast.Ident, //nolint:gocognit,cyclop // this is complex stuff - []*ast.Ident, []importDeclaration, []*ast.TypeSwitchStmt) { - inspector := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) //nolint:forcetypeassert // inspect.Analyzer always returns *inspector.Inspector - - filter := []ast.Node{ - (*ast.ImportSpec)(nil), - (*ast.FuncDecl)(nil), - (*ast.FuncLit)(nil), - (*ast.CompositeLit)(nil), - (*ast.TypeSwitchStmt)(nil), - (*ast.Ident)(nil), - } - - assignIdents := []*ast.Ident{} - valueSpecIdents := []*ast.Ident{} - paramIdents := []*ast.Ident{} - returnIdents := []*ast.Ident{} - typeParamIdents := []*ast.Ident{} - imports := []importDeclaration{} - switches := []*ast.TypeSwitchStmt{} - - funcs := []*ast.FuncDecl{} - methods := []*ast.FuncDecl{} - funcLits := []*ast.FuncLit{} - compositeLits := []*ast.CompositeLit{} - - inspector.Preorder(filter, func(node ast.Node) { - switch node2 := node.(type) { - case *ast.ImportSpec: - decl, ok := importSpecToDecl(node2, pass.Pkg.Imports()) - if !ok { - return - } - - imports = append(imports, decl) - - case *ast.FuncDecl: - funcs = append(funcs, node2) - - if node2.Recv == nil { - return - } - - methods = append(methods, node2) - - case *ast.FuncLit: - funcLits = append(funcLits, node2) - - case *ast.CompositeLit: - compositeLits = append(compositeLits, node2) - - case *ast.TypeSwitchStmt: - switches = append(switches, node2) - - case *ast.Ident: - if node2.Obj == nil { - return - } - - if isCompositeLitKey(node2, compositeLits) { - return - } - - switch objDecl := node2.Obj.Decl.(type) { - case *ast.AssignStmt: - assignIdents = append(assignIdents, node2) - - case *ast.ValueSpec: - valueSpecIdents = append(valueSpecIdents, node2) - - case *ast.Field: - switch { - case isReceiver(objDecl, methods): - if !v.checkReceiver { - return - } - - paramIdents = append(paramIdents, node2) - - case isReturn(objDecl, funcs, funcLits): - if !v.checkReturn { - return - } - - returnIdents = append(returnIdents, node2) - - case isTypeParam(objDecl, funcs, funcLits): - if !v.checkTypeParameters { - return - } - - typeParamIdents = append(typeParamIdents, node2) - - case isParam(objDecl, funcs, funcLits, methods): - paramIdents = append(paramIdents, node2) - } - } - } - }) - - imports = append(imports, importDeclaration{ - path: pass.Pkg.Path(), - self: true, - }) - - sort.Slice(imports, func(a, b int) bool { - // reversed: longest path first - return len(imports[a].path) > len(imports[b].path) - }) - - return assignIdents, valueSpecIdents, paramIdents, returnIdents, typeParamIdents, imports, switches -} - -func importSpecToDecl(spec *ast.ImportSpec, imports []*types.Package) (importDeclaration, bool) { - path := strings.TrimSuffix(strings.TrimPrefix(spec.Path.Value, "\""), "\"") - - if spec.Name != nil { - return importDeclaration{ - name: spec.Name.Name, - path: path, - }, true - } - - for _, imp := range imports { - if imp.Path() == path { - return importDeclaration{ - name: imp.Name(), - path: path, - }, true - } - } - - return importDeclaration{}, false -} - -// isTypeAssertOk returns true if v is an "ok" variable that holds the bool return value of a type assertion. -func (v variable) isTypeAssertOk() bool { - if v.name != "ok" { - return false - } - - if v.assign == nil { - return false - } - - if len(v.assign.Lhs) != 2 { - return false - } - - ident, ok := v.assign.Lhs[1].(*ast.Ident) - if !ok { - return false - } - - if ident.Name != "ok" { - return false - } - - if len(v.assign.Rhs) != 1 { - return false - } - - if _, ok := v.assign.Rhs[0].(*ast.TypeAssertExpr); !ok { - return false - } - - return true -} - -// isMapIndexOk returns true if v is an "ok" variable that holds the bool return value of a map index. -func (v variable) isMapIndexOk() bool { - if v.name != "ok" { - return false - } - - if v.assign == nil { - return false - } - - if len(v.assign.Lhs) != 2 { - return false - } - - ident, ok := v.assign.Lhs[1].(*ast.Ident) - if !ok { - return false - } - - if ident.Name != "ok" { - return false - } - - if len(v.assign.Rhs) != 1 { - return false - } - - if _, ok := v.assign.Rhs[0].(*ast.IndexExpr); !ok { - return false - } - - return true -} - -// isChannelReceiveOk returns true if v is an "ok" variable that holds the bool return value of a channel receive. -func (v variable) isChannelReceiveOk() bool { - if v.name != "ok" { - return false - } - - if v.assign == nil { - return false - } - - if len(v.assign.Lhs) != 2 { - return false - } - - ident, ok := v.assign.Lhs[1].(*ast.Ident) - if !ok { - return false - } - - if ident.Name != "ok" { - return false - } - - if len(v.assign.Rhs) != 1 { - return false - } - - unary, ok := v.assign.Rhs[0].(*ast.UnaryExpr) - if !ok { - return false - } - - if unary.Op != token.ARROW { - return false - } - - return true -} - -// isConventional returns true if v matches a conventional Go variable/parameter name and type, -// such as "ctx context.Context" or "t *testing.T". -func (v variable) isConventional() bool { - for _, decl := range conventionalDecls { - if v.match(decl) { - return true - } - } - - return false -} - -// match returns true if v matches decl. -func (v variable) match(decl declaration) bool { - if v.name != decl.name { - return false - } - - if v.constant != decl.constant { - return false - } - - if v.constant { - return true - } - - if v.typ == "" { - return false - } - - return decl.matchType(v.typ) -} - -// kindName returns "constant" if v.constant==true, else "variable". -func (v variable) kindName() string { - if v.constant { - return "constant" - } - - return "variable" -} - -// isReceiver returns true if field is a receiver parameter of any of the given methods. -func isReceiver(field *ast.Field, methods []*ast.FuncDecl) bool { - for _, m := range methods { - for _, recv := range m.Recv.List { - if recv == field { - return true - } - } - } - - return false -} - -// isReturn returns true if field is a return value of any of the given funcs. -func isReturn(field *ast.Field, funcs []*ast.FuncDecl, funcLits []*ast.FuncLit) bool { //nolint:gocognit // it's not that complicated - for _, f := range funcs { - if f.Type.Results == nil { - continue - } - - for _, r := range f.Type.Results.List { - if r == field { - return true - } - } - } - - for _, f := range funcLits { - if f.Type.Results == nil { - continue - } - - for _, r := range f.Type.Results.List { - if r == field { - return true - } - } - } - - return false -} - -// isParam returns true if field is a parameter of any of the given funcs. -func isParam(field *ast.Field, funcs []*ast.FuncDecl, funcLits []*ast.FuncLit, methods []*ast.FuncDecl) bool { //nolint:gocognit,cyclop // it's not that complicated - for _, f := range funcs { - if f.Type.Params == nil { - continue - } - - for _, p := range f.Type.Params.List { - if p == field { - return true - } - } - } - - for _, f := range funcLits { - if f.Type.Params == nil { - continue - } - - for _, p := range f.Type.Params.List { - if p == field { - return true - } - } - } - - for _, m := range methods { - if m.Type.Params == nil { - continue - } - - for _, p := range m.Type.Params.List { - if p == field { - return true - } - } - } - - return false -} - -// isCompositeLitKey returns true if ident is a key of any of the given composite literals. -func isCompositeLitKey(ident *ast.Ident, compositeLits []*ast.CompositeLit) bool { - for _, cl := range compositeLits { - if _, ok := cl.Type.(*ast.MapType); ok { - continue - } - - for _, kvExpr := range cl.Elts { - kv, ok := kvExpr.(*ast.KeyValueExpr) - if !ok { - continue - } - - if kv.Key == ident { - return true - } - } - } - - return false -} - -// isTypeSwitchAssign returns true if assign is an assign statement of any of the given type switch statements. -func isTypeSwitchAssign(assign *ast.AssignStmt, switches []*ast.TypeSwitchStmt) bool { - for _, s := range switches { - if s.Assign == assign { - return true - } - } - - return false -} - -// isConventional returns true if v matches a conventional Go variable/parameter name and type, -// such as "ctx context.Context" or "t *testing.T". -func (p parameter) isConventional() bool { - for _, decl := range conventionalDecls { - if p.match(decl) { - return true - } - } - - return false -} - -// match returns whether p matches decl. -func (p parameter) match(decl declaration) bool { - if p.name != decl.name { - return false - } - - return decl.matchType(p.typ) -} - -// match returns whether p matches decl. -func (p typeParam) match(decl declaration) bool { - if p.name != decl.name { - return false - } - - return decl.matchType(p.typ) -} - -// parseDeclaration parses and returns a variable declaration parsed from decl. -func parseDeclaration(decl string) declaration { - if strings.HasPrefix(decl, "const ") { - return declaration{ - name: strings.TrimPrefix(decl, "const "), - constant: true, - } - } - - parts := strings.SplitN(decl, " ", 2) - - return declaration{ - name: parts[0], - typ: parts[1], - } -} - -// matchType returns true if typ matches d.typ. -func (d declaration) matchType(typ string) bool { - return d.typ == typ -} - -// shortTypeName returns the short name of typ, with respect to imports. -// For example, if package github.com/matryer/is is imported with alias "x", -// and typ represents []*github.com/matryer/is.I, shortTypeName will return "[]*x.I". -// For imports without aliases, the package's default name will be used. -func shortTypeName(typ types.Type, imports []importDeclaration) string { - if typ == nil { - return "" - } - - typStr := typ.String() - - for _, imp := range imports { - prefix := imp.path + "." - - replace := "" - if !imp.self { - replace = imp.name + "." - } - - typStr = strings.ReplaceAll(typStr, prefix, replace) - } - - return typStr -} diff --git a/vendor/github.com/bombsimon/wsl/v3/.gitignore b/vendor/github.com/bombsimon/wsl/v3/.gitignore deleted file mode 100644 index 1c8eba613e..0000000000 --- a/vendor/github.com/bombsimon/wsl/v3/.gitignore +++ /dev/null @@ -1,70 +0,0 @@ - -# Created by https://www.gitignore.io/api/go,vim,macos - -### Go ### -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -### Go Patch ### -/vendor/ -/Godeps/ - -### macOS ### -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -### Vim ### -# Swap -[._]*.s[a-v][a-z] -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - - -# End of https://www.gitignore.io/api/go,vim,macos diff --git a/vendor/github.com/bombsimon/wsl/v3/.golangci.yml b/vendor/github.com/bombsimon/wsl/v3/.golangci.yml deleted file mode 100644 index 336ad4bc86..0000000000 --- a/vendor/github.com/bombsimon/wsl/v3/.golangci.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -run: - deadline: 1m - issues-exit-code: 1 - tests: true - skip-dirs: - - vendor$ - -output: - format: colored-line-number - print-issued-lines: false - -linters-settings: - gocognit: - min-complexity: 10 - - depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/davecgh/go-spew/spew - - misspell: - locale: US - - gocritic: - # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` - # to see all tags and checks. Empty list by default. See - # https://github.com/go-critic/go-critic#usage -> section "Tags". - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - -linters: - enable-all: true - disable: - - cyclop - - deadcode - - dupl - - dupword - - exhaustivestruct - - exhaustruct - - forbidigo - - funlen - - gci - - gocognit - - gocyclo - - godox - - golint - - gomnd - - ifshort - - interfacer - - lll - - maintidx - - maligned - - nakedret - - nestif - - nlreturn - - nosnakecase - - paralleltest - - prealloc - - scopelint - - structcheck - - testpackage - - varcheck - - varnamelen - fast: false - - -issues: - exclude-use-default: true - max-issues-per-linter: 0 - max-same-issues: 0 - -# vim: set sw=2 ts=2 et: diff --git a/vendor/github.com/bombsimon/wsl/v3/LICENSE b/vendor/github.com/bombsimon/wsl/v3/LICENSE deleted file mode 100644 index 4dade6d1c9..0000000000 --- a/vendor/github.com/bombsimon/wsl/v3/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Simon Sawert - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/bombsimon/wsl/v3/README.md b/vendor/github.com/bombsimon/wsl/v3/README.md deleted file mode 100644 index 8ff74392bd..0000000000 --- a/vendor/github.com/bombsimon/wsl/v3/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# WSL - Whitespace Linter - -[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com) -[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) - -[![GitHub Actions](https://github.com/bombsimon/wsl/actions/workflows/go.yml/badge.svg)](https://github.com/bombsimon/wsl/actions/workflows/go.yml) -[![Coverage Status](https://coveralls.io/repos/github/bombsimon/wsl/badge.svg?branch=master)](https://coveralls.io/github/bombsimon/wsl?branch=master) - -WSL is a linter that enforces a very **non scientific** vision of how to make -code more readable by enforcing empty lines at the right places. - -I think too much code out there is to cuddly and a bit too warm for it's own -good, making it harder for other people to read and understand. The linter will -warn about newlines in and around blocks, in the beginning of files and other -places in the code. - -**I know this linter is aggressive** and a lot of projects I've tested it on -have failed miserably. For this linter to be useful at all I want to be open to -new ideas, configurations and discussions! Also note that some of the warnings -might be bugs or unintentional false positives so I would love an -[issue](https://github.com/bombsimon/wsl/issues/new) to fix, discuss, change or -make something configurable! - -## Installation - -### By `go get` (local installation) - -You can do that by using: - -```sh -go get -u github.com/bombsimon/wsl/v3/cmd/... -``` - -### By golangci-lint (CI automation) - -`wsl` is already integrated with -[golangci-lint](https://github.com/golangci/golangci-lint). Please refer to the -instructions there. - -## Usage - -How to use depends on how you install `wsl`. - -### With local binary - -The general command format for `wsl` is: - -```sh -$ wsl [flags] [files...] -$ wsl [flags] - -# Examples - -$ wsl ./main.go -$ wsl --no-test ./main.go -$ wsl --allow-cuddle-declarations ./main.go -$ wsl --no-test --allow-cuddle-declaration ./main.go -$ wsl --no-test --allow-trailing-comment ./myProject/... -``` - -The "..." wildcard is not used like other `go` commands but instead can only -be to a relative or absolute path. - -By default, the linter will run on `./...` which means all go files in the -current path and all subsequent paths, including test files. To disable linting -test files, use `-n` or `--no-test`. - -### By `golangci-lint` (CI automation) - -The recommended command is: - -```sh -golangci-lint run --disable-all --enable wsl -``` - -For more information, please refer to -[golangci-lint](https://github.com/golangci/golangci-lint)'s documentation. - -## Issues and configuration - -The linter suppers a few ways to configure it to satisfy more than one kind of -code style. These settings could be set either with flags or with YAML -configuration if used via `golangci-lint`. - -The supported configuration can be found [in the documentation](doc/configuration.md). - -Below are the available checklist for any hit from `wsl`. If you do not see any, -feel free to raise an [issue](https://github.com/bombsimon/wsl/issues/new). - -> **Note**: this linter doesn't take in consideration the issues that will be -> fixed with `go fmt -s` so ensure that the code is properly formatted before -> use. - -* [Anonymous switch statements should never be cuddled](doc/rules.md#anonymous-switch-statements-should-never-be-cuddled) -* [Append only allowed to cuddle with appended value](doc/rules.md#append-only-allowed-to-cuddle-with-appended-value) -* [Assignments should only be cuddled with other assignments](doc/rules.md#assignments-should-only-be-cuddled-with-other-assignments) -* [Block should not end with a whitespace (or comment)](doc/rules.md#block-should-not-end-with-a-whitespace-or-comment) -* [Block should not start with a whitespace](doc/rules.md#block-should-not-start-with-a-whitespace) -* [Case block should end with newline at this size](doc/rules.md#case-block-should-end-with-newline-at-this-size) -* [Branch statements should not be cuddled if block has more than two lines](doc/rules.md#branch-statements-should-not-be-cuddled-if-block-has-more-than-two-lines) -* [Declarations should never be cuddled](doc/rules.md#declarations-should-never-be-cuddled) -* [Defer statements should only be cuddled with expressions on same variable](doc/rules.md#defer-statements-should-only-be-cuddled-with-expressions-on-same-variable) -* [Expressions should not be cuddled with blocks](doc/rules.md#expressions-should-not-be-cuddled-with-blocks) -* [Expressions should not be cuddled with declarations or returns](doc/rules.md#expressions-should-not-be-cuddled-with-declarations-or-returns) -* [For statement without condition should never be cuddled](doc/rules.md#for-statement-without-condition-should-never-be-cuddled) -* [For statements should only be cuddled with assignments used in the iteration](doc/rules.md#for-statements-should-only-be-cuddled-with-assignments-used-in-the-iteration) -* [Go statements can only invoke functions assigned on line above](doc/rules.md#go-statements-can-only-invoke-functions-assigned-on-line-above) -* [If statements should only be cuddled with assignments](doc/rules.md#if-statements-should-only-be-cuddled-with-assignments) -* [If statements should only be cuddled with assignments used in the if - statement - itself](doc/rules.md#if-statements-should-only-be-cuddled-with-assignments-used-in-the-if-statement-itself) -* [If statements that check an error must be cuddled with the statement that assigned the error](doc/rules.md#if-statements-that-check-an-error-must-be-cuddled-with-the-statement-that-assigned-the-error) -* [Only cuddled expressions if assigning variable or using from line - above](doc/rules.md#only-cuddled-expressions-if-assigning-variable-or-using-from-line-above) -* [Only one cuddle assignment allowed before defer statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-defer-statement) -* [Only one cuddle assginment allowed before for statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-for-statement) -* [Only one cuddle assignment allowed before go statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-go-statement) -* [Only one cuddle assignment allowed before if statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-if-statement) -* [Only one cuddle assignment allowed before range statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-range-statement) -* [Only one cuddle assignment allowed before switch statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-switch-statement) -* [Only one cuddle assignment allowed before type switch statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-type-switch-statement) -* [Ranges should only be cuddled with assignments used in the iteration](doc/rules.md#ranges-should-only-be-cuddled-with-assignments-used-in-the-iteration) -* [Return statements should not be cuddled if block has more than two lines](doc/rules.md#return-statements-should-not-be-cuddled-if-block-has-more-than-two-lines) -* [Short declarations should cuddle only with other short declarations](doc/rules.md#short-declaration-should-cuddle-only-with-other-short-declarations) -* [Switch statements should only be cuddled with variables switched](doc/rules.md#switch-statements-should-only-be-cuddled-with-variables-switched) -* [Type switch statements should only be cuddled with variables switched](doc/rules.md#type-switch-statements-should-only-be-cuddled-with-variables-switched) diff --git a/vendor/github.com/bombsimon/wsl/v3/wsl.go b/vendor/github.com/bombsimon/wsl/v3/wsl.go deleted file mode 100644 index 1b139c0476..0000000000 --- a/vendor/github.com/bombsimon/wsl/v3/wsl.go +++ /dev/null @@ -1,1264 +0,0 @@ -package wsl - -import ( - "fmt" - "go/ast" - "go/parser" - "go/token" - "os" - "reflect" - "strings" -) - -// Error reason strings. -const ( - reasonMustCuddleErrCheck = "if statements that check an error must be cuddled with the statement that assigned the error" - reasonOnlyCuddleIfWithAssign = "if statements should only be cuddled with assignments" - reasonOnlyOneCuddle = "only one cuddle assignment allowed before if statement" - reasonOnlyCuddleWithUsedAssign = "if statements should only be cuddled with assignments used in the if statement itself" - reasonOnlyCuddle2LineReturn = "return statements should not be cuddled if block has more than two lines" - reasonMultiLineBranchCuddle = "branch statements should not be cuddled if block has more than two lines" - reasonAppendCuddledWithoutUse = "append only allowed to cuddle with appended value" - reasonAssignsCuddleAssign = "assignments should only be cuddled with other assignments" - reasonNeverCuddleDeclare = "declarations should never be cuddled" - reasonExpressionCuddledWithDeclOrRet = "expressions should not be cuddled with declarations or returns" - reasonExpressionCuddledWithBlock = "expressions should not be cuddled with blocks" - reasonExprCuddlingNonAssignedVar = "only cuddled expressions if assigning variable or using from line above" - reasonOneCuddleBeforeRange = "only one cuddle assignment allowed before range statement" - reasonRangeCuddledWithoutUse = "ranges should only be cuddled with assignments used in the iteration" - reasonOneCuddleBeforeDefer = "only one cuddle assignment allowed before defer statement" - reasonDeferCuddledWithOtherVar = "defer statements should only be cuddled with expressions on same variable" - reasonForWithoutCondition = "for statement without condition should never be cuddled" - reasonForWithMoreThanOneCuddle = "only one cuddle assignment allowed before for statement" - reasonForCuddledAssignWithoutUse = "for statements should only be cuddled with assignments used in the iteration" - reasonOneCuddleBeforeGo = "only one cuddle assignment allowed before go statement" - reasonGoFuncWithoutAssign = "go statements can only invoke functions assigned on line above" - reasonSwitchManyCuddles = "only one cuddle assignment allowed before switch statement" - reasonAnonSwitchCuddled = "anonymous switch statements should never be cuddled" - reasonSwitchCuddledWithoutUse = "switch statements should only be cuddled with variables switched" - reasonTypeSwitchTooCuddled = "only one cuddle assignment allowed before type switch statement" - reasonTypeSwitchCuddledWithoutUse = "type switch statements should only be cuddled with variables switched" - reasonBlockStartsWithWS = "block should not start with a whitespace" - reasonBlockEndsWithWS = "block should not end with a whitespace (or comment)" - reasonCaseBlockTooCuddly = "case block should end with newline at this size" - reasonShortDeclNotExclusive = "short declaration should cuddle only with other short declarations" -) - -// Warning strings. -const ( - warnTypeNotImplement = "type not implemented" - warnStmtNotImplemented = "stmt type not implemented" - warnBodyStmtTypeNotImplemented = "body statement type not implemented " - warnWSNodeTypeNotImplemented = "whitespace node type not implemented " - warnUnknownLHS = "UNKNOWN LHS" - warnUnknownRHS = "UNKNOWN RHS" -) - -type Configuration struct { - // StrictAppend will do strict checking when assigning from append (x = - // append(x, y)). If this is set to true the append call must append either - // a variable assigned, called or used on the line above. Example on not - // allowed when this is true: - // - // x := []string{} - // y := "not going in X" - // x = append(x, "not y") // This is not allowed with StrictAppend - // z := "going in X" - // - // x = append(x, z) // This is allowed with StrictAppend - // - // m := transform(z) - // x = append(x, z) // So is this because Z is used above. - StrictAppend bool - - // AllowAssignAndCallCuddle allows assignments to be cuddled with variables - // used in calls on line above and calls to be cuddled with assignments of - // variables used in call on line above. - // Example supported with this set to true: - // - // x.Call() - // x = Assign() - // x.AnotherCall() - // x = AnotherAssign() - AllowAssignAndCallCuddle bool - - // AllowAssignAndCallCuddle allows assignments to be cuddled with anything. - // Example supported with this set to true: - // if x == 1 { - // x = 0 - // } - // z := x + 2 - // fmt.Println("x") - // y := "x" - AllowAssignAndAnythingCuddle bool - - // AllowMultiLineAssignCuddle allows cuddling to assignments even if they - // span over multiple lines. This defaults to true which allows the - // following example: - // - // err := function( - // "multiple", "lines", - // ) - // if err != nil { - // // ... - // } - AllowMultiLineAssignCuddle bool - - // If the number of lines in a case block is equal to or lager than this - // number, the case *must* end white a newline. - ForceCaseTrailingWhitespaceLimit int - - // AllowTrailingComment will allow blocks to end with comments. - AllowTrailingComment bool - - // AllowSeparatedLeadingComment will allow multiple comments in the - // beginning of a block separated with newline. Example: - // func () { - // // Comment one - // - // // Comment two - // fmt.Println("x") - // } - AllowSeparatedLeadingComment bool - - // AllowCuddleDeclaration will allow multiple var/declaration statements to - // be cuddled. This defaults to false but setting it to true will enable the - // following example: - // var foo bool - // var err error - AllowCuddleDeclaration bool - - // AllowCuddleWithCalls is a list of call idents that everything can be - // cuddled with. Defaults to calls looking like locks to support a flow like - // this: - // - // mu.Lock() - // allow := thisAssignment - AllowCuddleWithCalls []string - - // AllowCuddleWithRHS is a list of right hand side variables that is allowed - // to be cuddled with anything. Defaults to assignments or calls looking - // like unlocks to support a flow like this: - // - // allow := thisAssignment() - // mu.Unlock() - AllowCuddleWithRHS []string - - // ForceCuddleErrCheckAndAssign will cause an error when an If statement that - // checks an error variable doesn't cuddle with the assignment of that variable. - // This defaults to false but setting it to true will cause the following - // to generate an error: - // - // err := ProduceError() - // - // if err != nil { - // return err - // } - ForceCuddleErrCheckAndAssign bool - - // When ForceCuddleErrCheckAndAssign is enabled this is a list of names - // used for error variables to check for in the conditional. - // Defaults to just "err" - ErrorVariableNames []string - - // ForceExclusiveShortDeclarations will cause an error if a short declaration - // (:=) cuddles with anything other than another short declaration. For example - // - // a := 2 - // b := 3 - // - // is allowed, but - // - // a := 2 - // b = 3 - // - // is not allowed. This logic overrides ForceCuddleErrCheckAndAssign among others. - ForceExclusiveShortDeclarations bool -} - -// DefaultConfig returns default configuration. -func DefaultConfig() Configuration { - return Configuration{ - StrictAppend: true, - AllowAssignAndCallCuddle: true, - AllowAssignAndAnythingCuddle: false, - AllowMultiLineAssignCuddle: true, - AllowTrailingComment: false, - AllowSeparatedLeadingComment: false, - ForceCuddleErrCheckAndAssign: false, - ForceExclusiveShortDeclarations: false, - ForceCaseTrailingWhitespaceLimit: 0, - AllowCuddleWithCalls: []string{"Lock", "RLock"}, - AllowCuddleWithRHS: []string{"Unlock", "RUnlock"}, - ErrorVariableNames: []string{"err"}, - } -} - -// Result represents the result of one error. -type Result struct { - FileName string - LineNumber int - Position token.Position - Reason string -} - -// String returns the filename, line number and reason of a Result. -func (r *Result) String() string { - return fmt.Sprintf("%s:%d: %s", r.FileName, r.LineNumber, r.Reason) -} - -type Processor struct { - config Configuration - result []Result - warnings []string - fileSet *token.FileSet - file *ast.File -} - -// NewProcessor will create a Processor. -// -//nolint:gocritic // It's fine to copy config struct -func NewProcessorWithConfig(cfg Configuration) *Processor { - return &Processor{ - result: []Result{}, - config: cfg, - } -} - -// NewProcessor will create a Processor. -func NewProcessor() *Processor { - return NewProcessorWithConfig(DefaultConfig()) -} - -// ProcessFiles takes a string slice with file names (full paths) and lints -// them. -// -//nolint:gocritic // Don't want named returns -func (p *Processor) ProcessFiles(filenames []string) ([]Result, []string) { - for _, filename := range filenames { - data, err := os.ReadFile(filename) - if err != nil { - panic(err) - } - - p.process(filename, data) - } - - return p.result, p.warnings -} - -func (p *Processor) process(filename string, data []byte) { - fileSet := token.NewFileSet() - file, err := parser.ParseFile(fileSet, filename, data, parser.ParseComments) - // If the file is not parsable let's add a syntax error and move on. - if err != nil { - p.result = append(p.result, Result{ - FileName: filename, - LineNumber: 0, - Reason: fmt.Sprintf("invalid syntax, file cannot be linted (%s)", err.Error()), - }) - - return - } - - p.fileSet = fileSet - p.file = file - - for _, d := range p.file.Decls { - switch v := d.(type) { - case *ast.FuncDecl: - p.parseBlockBody(v.Name, v.Body) - case *ast.GenDecl: - // `go fmt` will handle proper spacing for GenDecl such as imports, - // constants etc. - default: - p.addWarning(warnTypeNotImplement, d.Pos(), v) - } - } -} - -// parseBlockBody will parse any kind of block statements such as switch cases -// and if statements. A list of Result is returned. -func (p *Processor) parseBlockBody(ident *ast.Ident, block *ast.BlockStmt) { - // Nothing to do if there's no value. - if reflect.ValueOf(block).IsNil() { - return - } - - // Start by finding leading and trailing whitespaces. - p.findLeadingAndTrailingWhitespaces(ident, block, nil) - - // Parse the block body contents. - p.parseBlockStatements(block.List) -} - -// parseBlockStatements will parse all the statements found in the body of a -// node. A list of Result is returned. -func (p *Processor) parseBlockStatements(statements []ast.Stmt) { - for i, stmt := range statements { - // Start by checking if this statement is another block (other than if, - // for and range). This could be assignment to a function, defer or go - // call with an inline function or similar. If this is found we start by - // parsing this body block before moving on. - for _, stmtBlocks := range p.findBlockStmt(stmt) { - p.parseBlockBody(nil, stmtBlocks) - } - - firstBodyStatement := p.firstBodyStatement(i, statements) - - // First statement, nothing to do. - if i == 0 { - continue - } - - previousStatement := statements[i-1] - previousStatementIsMultiline := p.nodeStart(previousStatement) != p.nodeEnd(previousStatement) - cuddledWithLastStmt := p.nodeEnd(previousStatement) == p.nodeStart(stmt)-1 - - // If we're not cuddled and we don't need to enforce err-check cuddling - // then we can bail out here - if !cuddledWithLastStmt && !p.config.ForceCuddleErrCheckAndAssign { - continue - } - - // We don't force error cuddling for multilines. (#86) - if p.config.ForceCuddleErrCheckAndAssign && previousStatementIsMultiline && !cuddledWithLastStmt { - continue - } - - // Extract assigned variables on the line above - // which is the only thing we allow cuddling with. If the assignment is - // made over multiple lines we should not allow cuddling. - var assignedOnLineAbove []string - - // We want to keep track of what was called on the line above to support - // special handling of things such as mutexes. - var calledOnLineAbove []string - - // Check if the previous statement spans over multiple lines. - cuddledWithMultiLineAssignment := cuddledWithLastStmt && p.nodeStart(previousStatement) != p.nodeStart(stmt)-1 - - // Ensure previous line is not a multi line assignment and if not get - // rightAndLeftHandSide assigned variables. - if !cuddledWithMultiLineAssignment { - assignedOnLineAbove = p.findLHS(previousStatement) - calledOnLineAbove = p.findRHS(previousStatement) - } - - // If previous assignment is multi line and we allow it, fetch - // assignments (but only assignments). - if cuddledWithMultiLineAssignment && p.config.AllowMultiLineAssignCuddle { - if _, ok := previousStatement.(*ast.AssignStmt); ok { - assignedOnLineAbove = p.findLHS(previousStatement) - } - } - - // We could potentially have a block which require us to check the first - // argument before ruling out an allowed cuddle. - var calledOrAssignedFirstInBlock []string - - if firstBodyStatement != nil { - calledOrAssignedFirstInBlock = append(p.findLHS(firstBodyStatement), p.findRHS(firstBodyStatement)...) - } - - var ( - leftHandSide = p.findLHS(stmt) - rightHandSide = p.findRHS(stmt) - rightAndLeftHandSide = append(leftHandSide, rightHandSide...) - calledOrAssignedOnLineAbove = append(calledOnLineAbove, assignedOnLineAbove...) - ) - - // If we called some kind of lock on the line above we allow cuddling - // anything. - if atLeastOneInListsMatch(calledOnLineAbove, p.config.AllowCuddleWithCalls) { - continue - } - - // If we call some kind of unlock on this line we allow cuddling with - // anything. - if atLeastOneInListsMatch(rightHandSide, p.config.AllowCuddleWithRHS) { - continue - } - - moreThanOneStatementAbove := func() bool { - if i < 2 { - return false - } - - statementBeforePreviousStatement := statements[i-2] - - return p.nodeStart(previousStatement)-1 == p.nodeEnd(statementBeforePreviousStatement) - } - - isLastStatementInBlockOfOnlyTwoLines := func() bool { - // If we're the last statement, check if there's no more than two - // lines from the starting statement and the end of this statement. - // This is to support short return functions such as: - // func (t *Typ) X() { - // t.X = true - // return t - // } - if len(statements) == 2 && i == 1 { - if p.nodeEnd(stmt)-p.nodeStart(previousStatement) <= 2 { - return true - } - } - - return false - } - - // If it's a short declaration we should not cuddle with anything else - // if ForceExclusiveShortDeclarations is set on; either this or the - // previous statement could be the short decl, so we'll find out which - // it was and use *that* statement's position - if p.config.ForceExclusiveShortDeclarations && cuddledWithLastStmt { - if p.isShortDecl(stmt) && !p.isShortDecl(previousStatement) { - p.addError(stmt.Pos(), reasonShortDeclNotExclusive) - } else if p.isShortDecl(previousStatement) && !p.isShortDecl(stmt) { - p.addError(previousStatement.Pos(), reasonShortDeclNotExclusive) - } - } - - // If it's not an if statement and we're not cuddled move on. The only - // reason we need to keep going for if statements is to check if we - // should be cuddled with an error check. - if _, ok := stmt.(*ast.IfStmt); !ok { - if !cuddledWithLastStmt { - continue - } - } - - switch t := stmt.(type) { - case *ast.IfStmt: - checkingErrInitializedInline := func() bool { - if t.Init == nil { - return false - } - - // Variables were initialized inline in the if statement - // Let's make sure it's the err just to be safe - return atLeastOneInListsMatch(p.findLHS(t.Init), p.config.ErrorVariableNames) - } - - if !cuddledWithLastStmt { - checkingErr := atLeastOneInListsMatch(rightAndLeftHandSide, p.config.ErrorVariableNames) - if checkingErr { - // We only want to enforce cuddling error checks if the - // error was assigned on the line above. See - // https://github.com/bombsimon/wsl/issues/78. - // This is needed since `assignedOnLineAbove` is not - // actually just assignments but everything from LHS in the - // previous statement. This means that if previous line was - // `if err ...`, `err` will now be in the list - // `assignedOnLineAbove`. - if _, ok := previousStatement.(*ast.AssignStmt); !ok { - continue - } - - if checkingErrInitializedInline() { - continue - } - - if atLeastOneInListsMatch(assignedOnLineAbove, p.config.ErrorVariableNames) { - p.addError(t.Pos(), reasonMustCuddleErrCheck) - } - } - - continue - } - - if len(assignedOnLineAbove) == 0 { - p.addError(t.Pos(), reasonOnlyCuddleIfWithAssign) - continue - } - - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonOnlyOneCuddle) - continue - } - - if atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - continue - } - - if atLeastOneInListsMatch(assignedOnLineAbove, calledOrAssignedFirstInBlock) { - continue - } - - p.addError(t.Pos(), reasonOnlyCuddleWithUsedAssign) - case *ast.ReturnStmt: - if isLastStatementInBlockOfOnlyTwoLines() { - continue - } - - p.addError(t.Pos(), reasonOnlyCuddle2LineReturn) - case *ast.BranchStmt: - if isLastStatementInBlockOfOnlyTwoLines() { - continue - } - - p.addError(t.Pos(), reasonMultiLineBranchCuddle) - case *ast.AssignStmt: - // append is usually an assignment but should not be allowed to be - // cuddled with anything not appended. - if len(rightHandSide) > 0 && rightHandSide[len(rightHandSide)-1] == "append" { - if p.config.StrictAppend { - if !atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightHandSide) { - p.addError(t.Pos(), reasonAppendCuddledWithoutUse) - } - } - - continue - } - - if _, ok := previousStatement.(*ast.AssignStmt); ok { - continue - } - - if p.config.AllowAssignAndAnythingCuddle { - continue - } - - if _, ok := previousStatement.(*ast.DeclStmt); ok && p.config.AllowCuddleDeclaration { - continue - } - - // If the assignment is from a type or variable called on the line - // above we can allow it by setting AllowAssignAndCallCuddle to - // true. - // Example (x is used): - // x.function() - // a.Field = x.anotherFunction() - if p.config.AllowAssignAndCallCuddle { - if atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightAndLeftHandSide) { - continue - } - } - - p.addError(t.Pos(), reasonAssignsCuddleAssign) - case *ast.DeclStmt: - if !p.config.AllowCuddleDeclaration { - p.addError(t.Pos(), reasonNeverCuddleDeclare) - } - case *ast.ExprStmt: - switch previousStatement.(type) { - case *ast.DeclStmt, *ast.ReturnStmt: - if p.config.AllowAssignAndCallCuddle && p.config.AllowCuddleDeclaration { - continue - } - - p.addError(t.Pos(), reasonExpressionCuddledWithDeclOrRet) - case *ast.IfStmt, *ast.RangeStmt, *ast.SwitchStmt: - p.addError(t.Pos(), reasonExpressionCuddledWithBlock) - } - - // If the expression is called on a type or variable used or - // assigned on the line we can allow it by setting - // AllowAssignAndCallCuddle to true. - // Example of allowed cuddled (x is used): - // a.Field = x.func() - // x.function() - if p.config.AllowAssignAndCallCuddle { - if atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightAndLeftHandSide) { - continue - } - } - - // If we assigned variables on the line above but didn't use them in - // this expression there should probably be a newline between them. - if len(assignedOnLineAbove) > 0 && !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - p.addError(t.Pos(), reasonExprCuddlingNonAssignedVar) - } - case *ast.RangeStmt: - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonOneCuddleBeforeRange) - continue - } - - if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - if !atLeastOneInListsMatch(assignedOnLineAbove, calledOrAssignedFirstInBlock) { - p.addError(t.Pos(), reasonRangeCuddledWithoutUse) - } - } - case *ast.DeferStmt: - if _, ok := previousStatement.(*ast.DeferStmt); ok { - // We may cuddle multiple defers to group logic. - continue - } - - // Special treatment of deferring body closes after error checking - // according to best practices. See - // https://github.com/bombsimon/wsl/issues/31 which links to - // discussion about error handling after HTTP requests. This is hard - // coded and very specific but for now this is to be seen as a - // special case. What this does is that it *only* allows a defer - // statement with `Close` on the right hand side to be cuddled with - // an if-statement to support this: - // resp, err := client.Do(req) - // if err != nil { - // return err - // } - // defer resp.Body.Close() - if _, ok := previousStatement.(*ast.IfStmt); ok { - if atLeastOneInListsMatch(rightHandSide, []string{"Close"}) { - continue - } - } - - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonOneCuddleBeforeDefer) - - continue - } - - // Be extra nice with RHS, it's common to use this for locks: - // m.Lock() - // defer m.Unlock() - previousRHS := p.findRHS(previousStatement) - if atLeastOneInListsMatch(rightHandSide, previousRHS) { - continue - } - - // Allow use to cuddled defer func literals with usages on line - // abouve. Example: - // b := getB() - // defer func() { - // makesSenseToUse(b) - // }() - if c, ok := t.Call.Fun.(*ast.FuncLit); ok { - funcLitFirstStmt := append(p.findLHS(c.Body), p.findRHS(c.Body)...) - - if atLeastOneInListsMatch(assignedOnLineAbove, funcLitFirstStmt) { - continue - } - } - - if atLeastOneInListsMatch(assignedOnLineAbove, calledOrAssignedFirstInBlock) { - continue - } - - if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - p.addError(t.Pos(), reasonDeferCuddledWithOtherVar) - } - case *ast.ForStmt: - if len(rightAndLeftHandSide) == 0 { - p.addError(t.Pos(), reasonForWithoutCondition) - - continue - } - - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonForWithMoreThanOneCuddle) - - continue - } - - // The same rule applies for ranges as for if statements, see - // comments regarding variable usages on the line before or as the - // first line in the block for details. - if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - if !atLeastOneInListsMatch(assignedOnLineAbove, calledOrAssignedFirstInBlock) { - p.addError(t.Pos(), reasonForCuddledAssignWithoutUse) - } - } - case *ast.GoStmt: - if _, ok := previousStatement.(*ast.GoStmt); ok { - continue - } - - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonOneCuddleBeforeGo) - - continue - } - - if c, ok := t.Call.Fun.(*ast.SelectorExpr); ok { - goCallArgs := append(p.findLHS(c.X), p.findRHS(c.X)...) - - if atLeastOneInListsMatch(calledOnLineAbove, goCallArgs) { - continue - } - } - - if c, ok := t.Call.Fun.(*ast.FuncLit); ok { - goCallArgs := append(p.findLHS(c.Body), p.findRHS(c.Body)...) - - if atLeastOneInListsMatch(assignedOnLineAbove, goCallArgs) { - continue - } - } - - if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - p.addError(t.Pos(), reasonGoFuncWithoutAssign) - } - case *ast.SwitchStmt: - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonSwitchManyCuddles) - - continue - } - - if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { - if len(rightAndLeftHandSide) == 0 { - p.addError(t.Pos(), reasonAnonSwitchCuddled) - } else { - p.addError(t.Pos(), reasonSwitchCuddledWithoutUse) - } - } - case *ast.TypeSwitchStmt: - if moreThanOneStatementAbove() { - p.addError(t.Pos(), reasonTypeSwitchTooCuddled) - - continue - } - - // Allowed to type assert on variable assigned on line above. - if !atLeastOneInListsMatch(rightHandSide, assignedOnLineAbove) { - // Allow type assertion on variables used in the first case - // immediately. - if !atLeastOneInListsMatch(assignedOnLineAbove, calledOrAssignedFirstInBlock) { - p.addError(t.Pos(), reasonTypeSwitchCuddledWithoutUse) - } - } - case *ast.CaseClause, *ast.CommClause: - // Case clauses will be checked by not allowing leading ot trailing - // whitespaces within the block. There's nothing in the case itself - // that may be cuddled. - default: - p.addWarning(warnStmtNotImplemented, t.Pos(), t) - } - } -} - -// firstBodyStatement returns the first statement inside a body block. This is -// because variables may be cuddled with conditions or statements if it's used -// directly as the first argument inside a body. -// The body will then be parsed as a *ast.BlockStmt (regular block) or as a list -// of []ast.Stmt (case block). -func (p *Processor) firstBodyStatement(i int, allStmt []ast.Stmt) ast.Node { - stmt := allStmt[i] - - // Start by checking if the statement has a body (probably if-statement, - // a range, switch case or similar. Whenever a body is found we start by - // parsing it before moving on in the AST. - statementBody := reflect.Indirect(reflect.ValueOf(stmt)).FieldByName("Body") - - // Some cases allow cuddling depending on the first statement in a body - // of a block or case. If possible extract the first statement. - var firstBodyStatement ast.Node - - if !statementBody.IsValid() { - return firstBodyStatement - } - - switch statementBodyContent := statementBody.Interface().(type) { - case *ast.BlockStmt: - if len(statementBodyContent.List) > 0 { - firstBodyStatement = statementBodyContent.List[0] - - // If the first body statement is a *ast.CaseClause we're - // actually interested in the **next** body to know what's - // inside the first case. - if x, ok := firstBodyStatement.(*ast.CaseClause); ok { - if len(x.Body) > 0 { - firstBodyStatement = x.Body[0] - } - } - } - - p.parseBlockBody(nil, statementBodyContent) - case []ast.Stmt: - // The Body field for an *ast.CaseClause or *ast.CommClause is of type - // []ast.Stmt. We must check leading and trailing whitespaces and then - // pass the statements to parseBlockStatements to parse it's content. - var nextStatement ast.Node - - // Check if there's more statements (potential cases) after the - // current one. - if len(allStmt)-1 > i { - nextStatement = allStmt[i+1] - } - - p.findLeadingAndTrailingWhitespaces(nil, stmt, nextStatement) - p.parseBlockStatements(statementBodyContent) - default: - p.addWarning( - warnBodyStmtTypeNotImplemented, - stmt.Pos(), statementBodyContent, - ) - } - - return firstBodyStatement -} - -func (p *Processor) findLHS(node ast.Node) []string { - var lhs []string - - if node == nil { - return lhs - } - - switch t := node.(type) { - case *ast.BasicLit, *ast.FuncLit, *ast.SelectStmt, - *ast.LabeledStmt, *ast.ForStmt, *ast.SwitchStmt, - *ast.ReturnStmt, *ast.GoStmt, *ast.CaseClause, - *ast.CommClause, *ast.CallExpr, *ast.UnaryExpr, - *ast.BranchStmt, *ast.TypeSpec, *ast.ChanType, - *ast.DeferStmt, *ast.TypeAssertExpr, *ast.RangeStmt: - // Nothing to add to LHS - case *ast.IncDecStmt: - return p.findLHS(t.X) - case *ast.Ident: - return []string{t.Name} - case *ast.AssignStmt: - for _, v := range t.Lhs { - lhs = append(lhs, p.findLHS(v)...) - } - case *ast.GenDecl: - for _, v := range t.Specs { - lhs = append(lhs, p.findLHS(v)...) - } - case *ast.ValueSpec: - for _, v := range t.Names { - lhs = append(lhs, p.findLHS(v)...) - } - case *ast.BlockStmt: - for _, v := range t.List { - lhs = append(lhs, p.findLHS(v)...) - } - case *ast.BinaryExpr: - return append( - p.findLHS(t.X), - p.findLHS(t.Y)..., - ) - case *ast.DeclStmt: - return p.findLHS(t.Decl) - case *ast.IfStmt: - return p.findLHS(t.Cond) - case *ast.TypeSwitchStmt: - return p.findLHS(t.Assign) - case *ast.SendStmt: - return p.findLHS(t.Chan) - default: - if x, ok := maybeX(t); ok { - return p.findLHS(x) - } - - p.addWarning(warnUnknownLHS, t.Pos(), t) - } - - return lhs -} - -func (p *Processor) findRHS(node ast.Node) []string { - var rhs []string - - if node == nil { - return rhs - } - - switch t := node.(type) { - case *ast.BasicLit, *ast.SelectStmt, *ast.ChanType, - *ast.LabeledStmt, *ast.DeclStmt, *ast.BranchStmt, - *ast.TypeSpec, *ast.ArrayType, *ast.CaseClause, - *ast.CommClause, *ast.MapType, *ast.FuncLit: - // Nothing to add to RHS - case *ast.Ident: - return []string{t.Name} - case *ast.SelectorExpr: - // TODO: Should this be RHS? - // t.X is needed for defer as of now and t.Sel needed for special - // functions such as Lock() - rhs = p.findRHS(t.X) - rhs = append(rhs, p.findRHS(t.Sel)...) - case *ast.AssignStmt: - for _, v := range t.Rhs { - rhs = append(rhs, p.findRHS(v)...) - } - case *ast.CallExpr: - for _, v := range t.Args { - rhs = append(rhs, p.findRHS(v)...) - } - - rhs = append(rhs, p.findRHS(t.Fun)...) - case *ast.CompositeLit: - for _, v := range t.Elts { - rhs = append(rhs, p.findRHS(v)...) - } - case *ast.IfStmt: - rhs = append(rhs, p.findRHS(t.Cond)...) - rhs = append(rhs, p.findRHS(t.Init)...) - case *ast.BinaryExpr: - return append( - p.findRHS(t.X), - p.findRHS(t.Y)..., - ) - case *ast.TypeSwitchStmt: - return p.findRHS(t.Assign) - case *ast.ReturnStmt: - for _, v := range t.Results { - rhs = append(rhs, p.findRHS(v)...) - } - case *ast.BlockStmt: - for _, v := range t.List { - rhs = append(rhs, p.findRHS(v)...) - } - case *ast.SwitchStmt: - return p.findRHS(t.Tag) - case *ast.GoStmt: - return p.findRHS(t.Call) - case *ast.ForStmt: - return p.findRHS(t.Cond) - case *ast.DeferStmt: - return p.findRHS(t.Call) - case *ast.SendStmt: - return p.findLHS(t.Value) - case *ast.IndexExpr: - rhs = append(rhs, p.findRHS(t.Index)...) - rhs = append(rhs, p.findRHS(t.X)...) - case *ast.SliceExpr: - rhs = append(rhs, p.findRHS(t.X)...) - rhs = append(rhs, p.findRHS(t.Low)...) - rhs = append(rhs, p.findRHS(t.High)...) - case *ast.KeyValueExpr: - rhs = p.findRHS(t.Key) - rhs = append(rhs, p.findRHS(t.Value)...) - default: - if x, ok := maybeX(t); ok { - return p.findRHS(x) - } - - p.addWarning(warnUnknownRHS, t.Pos(), t) - } - - return rhs -} - -func (p *Processor) isShortDecl(node ast.Node) bool { - if t, ok := node.(*ast.AssignStmt); ok { - return t.Tok == token.DEFINE - } - - return false -} - -func (p *Processor) findBlockStmt(node ast.Node) []*ast.BlockStmt { - var blocks []*ast.BlockStmt - - switch t := node.(type) { - case *ast.AssignStmt: - for _, x := range t.Rhs { - blocks = append(blocks, p.findBlockStmt(x)...) - } - case *ast.CallExpr: - blocks = append(blocks, p.findBlockStmt(t.Fun)...) - case *ast.FuncLit: - blocks = append(blocks, t.Body) - case *ast.ExprStmt: - blocks = append(blocks, p.findBlockStmt(t.X)...) - case *ast.ReturnStmt: - for _, x := range t.Results { - blocks = append(blocks, p.findBlockStmt(x)...) - } - case *ast.DeferStmt: - blocks = append(blocks, p.findBlockStmt(t.Call)...) - case *ast.GoStmt: - blocks = append(blocks, p.findBlockStmt(t.Call)...) - } - - return blocks -} - -// maybeX extracts the X field from an AST node and returns it with a true value -// if it exists. If the node doesn't have an X field nil and false is returned. -// Known fields with X that are handled: -// IndexExpr, ExprStmt, SelectorExpr, StarExpr, ParentExpr, TypeAssertExpr, -// RangeStmt, UnaryExpr, ParenExpr, SliceExpr, IncDecStmt. -func maybeX(node interface{}) (ast.Node, bool) { - maybeHasX := reflect.Indirect(reflect.ValueOf(node)).FieldByName("X") - if !maybeHasX.IsValid() { - return nil, false - } - - n, ok := maybeHasX.Interface().(ast.Node) - if !ok { - return nil, false - } - - return n, true -} - -func atLeastOneInListsMatch(listOne, listTwo []string) bool { - sliceToMap := func(s []string) map[string]struct{} { - m := map[string]struct{}{} - - for _, v := range s { - m[v] = struct{}{} - } - - return m - } - - m1 := sliceToMap(listOne) - m2 := sliceToMap(listTwo) - - for k1 := range m1 { - if _, ok := m2[k1]; ok { - return true - } - } - - for k2 := range m2 { - if _, ok := m1[k2]; ok { - return true - } - } - - return false -} - -// findLeadingAndTrailingWhitespaces will find leading and trailing whitespaces -// in a node. The method takes comments in consideration which will make the -// parser more gentle. -func (p *Processor) findLeadingAndTrailingWhitespaces(ident *ast.Ident, stmt, nextStatement ast.Node) { - var ( - allowedLinesBeforeFirstStatement = 1 - commentMap = ast.NewCommentMap(p.fileSet, stmt, p.file.Comments) - blockStatements []ast.Stmt - blockStartLine int - blockEndLine int - blockStartPos token.Pos - blockEndPos token.Pos - ) - - // Depending on the block type, get the statements in the block and where - // the block starts (and ends). - switch t := stmt.(type) { - case *ast.BlockStmt: - blockStatements = t.List - blockStartPos = t.Lbrace - blockEndPos = t.Rbrace - case *ast.CaseClause: - blockStatements = t.Body - blockStartPos = t.Colon - case *ast.CommClause: - blockStatements = t.Body - blockStartPos = t.Colon - default: - p.addWarning(warnWSNodeTypeNotImplemented, stmt.Pos(), stmt) - - return - } - - // Ignore empty blocks even if they have newlines or just comments. - if len(blockStatements) < 1 { - return - } - - blockStartLine = p.fileSet.Position(blockStartPos).Line - blockEndLine = p.fileSet.Position(blockEndPos).Line - - // No whitespace possible if LBrace and RBrace is on the same line. - if blockStartLine == blockEndLine { - return - } - - var ( - firstStatement = blockStatements[0] - lastStatement = blockStatements[len(blockStatements)-1] - seenCommentGroups = 0 - ) - - // Get the comment related to the first statement, we do allow commends in - // the beginning of a block before the first statement. - if c, ok := commentMap[firstStatement]; ok { - for _, commentGroup := range c { - // If the comment group is on the same line as the block start - // (LBrace) we should not consider it. - if p.nodeStart(commentGroup) == blockStartLine { - continue - } - - // We only care about comments before our statement from the comment - // map. As soon as we hit comments after our statement let's break - // out! - if commentGroup.Pos() > firstStatement.Pos() { - break - } - - // We store number of seen comment groups because we allow multiple - // groups with a newline between them; but if the first one has WS - // before it, we're not going to count it to force an error. - if p.config.AllowSeparatedLeadingComment { - cg := p.fileSet.Position(commentGroup.Pos()).Line - - if seenCommentGroups > 0 || cg == blockStartLine+1 { - seenCommentGroups++ - } - } else { - seenCommentGroups++ - } - - // Support both /* multiline */ and //single line comments - for _, c := range commentGroup.List { - allowedLinesBeforeFirstStatement += len(strings.Split(c.Text, "\n")) - } - } - } - - // If we allow separated comments, allow for a space after each group - if p.config.AllowSeparatedLeadingComment { - if seenCommentGroups > 1 { - allowedLinesBeforeFirstStatement += seenCommentGroups - 1 - } else if seenCommentGroups == 1 { - allowedLinesBeforeFirstStatement++ - } - } - - // And now if the first statement is passed the number of allowed lines, - // then we had extra WS, possibly before the first comment group. - if p.nodeStart(firstStatement) > blockStartLine+allowedLinesBeforeFirstStatement { - p.addError( - blockStartPos, - reasonBlockStartsWithWS, - ) - } - - // If the blockEndLine is not 0 we're a regular block (not case). - if blockEndLine != 0 { - if p.config.AllowTrailingComment { - if lastComment, ok := commentMap[lastStatement]; ok { - var ( - lastCommentGroup = lastComment[len(lastComment)-1] - lastCommentLine = lastCommentGroup.List[len(lastCommentGroup.List)-1] - countNewlines = 0 - ) - - countNewlines += len(strings.Split(lastCommentLine.Text, "\n")) - - // No newlines between trailing comments and end of block. - if p.nodeStart(lastCommentLine)+countNewlines != blockEndLine-1 { - return - } - } - } - - if p.nodeEnd(lastStatement) != blockEndLine-1 && !isExampleFunc(ident) { - p.addError(blockEndPos, reasonBlockEndsWithWS) - } - - return - } - - // If we don't have any nextStatement the trailing whitespace will be - // handled when parsing the switch. If we do have a next statement we can - // see where it starts by getting it's colon position. We set the end of the - // current case to the position of the next case. - switch n := nextStatement.(type) { - case *ast.CaseClause: - blockEndPos = n.Case - case *ast.CommClause: - blockEndPos = n.Case - default: - // No more cases - return - } - - blockEndLine = p.fileSet.Position(blockEndPos).Line - 1 - - var ( - blockSize = blockEndLine - blockStartLine - caseTrailingCommentLines int - ) - - // TODO: I don't know what comments are bound to in cases. For regular - // blocks the last comment is bound to the last statement but for cases - // they are bound to the case clause expression. This will however get us all - // comments and depending on the case expression this gets tricky. - // - // To handle this I get the comment map from the current statement (the case - // itself) and iterate through all groups and all comment within all groups. - // I then get the comments after the last statement but before the next case - // clause and just map each line of comment that way. - for _, commentGroups := range commentMap { - for _, commentGroup := range commentGroups { - for _, comment := range commentGroup.List { - commentLine := p.fileSet.Position(comment.Pos()).Line - - // Ignore comments before the last statement. - if commentLine <= p.nodeStart(lastStatement) { - continue - } - - // Ignore comments after the end of this case. - if commentLine > blockEndLine { - continue - } - - // This allows /* multiline */ comments with newlines as well - // as regular (//) ones - caseTrailingCommentLines += len(strings.Split(comment.Text, "\n")) - } - } - } - - hasTrailingWhitespace := p.nodeEnd(lastStatement)+caseTrailingCommentLines != blockEndLine - - // If the force trailing limit is configured and we don't end with a newline. - if p.config.ForceCaseTrailingWhitespaceLimit > 0 && !hasTrailingWhitespace { - // Check if the block size is too big to miss the newline. - if blockSize >= p.config.ForceCaseTrailingWhitespaceLimit { - p.addError(lastStatement.Pos(), reasonCaseBlockTooCuddly) - } - } -} - -func isExampleFunc(ident *ast.Ident) bool { - return ident != nil && strings.HasPrefix(ident.Name, "Example") -} - -func (p *Processor) nodeStart(node ast.Node) int { - return p.fileSet.Position(node.Pos()).Line -} - -func (p *Processor) nodeEnd(node ast.Node) int { - line := p.fileSet.Position(node.End()).Line - - if isEmptyLabeledStmt(node) { - return p.fileSet.Position(node.Pos()).Line - } - - return line -} - -func isEmptyLabeledStmt(node ast.Node) bool { - v, ok := node.(*ast.LabeledStmt) - if !ok { - return false - } - - _, empty := v.Stmt.(*ast.EmptyStmt) - - return empty -} - -// Add an error for the file and line number for the current token.Pos with the -// given reason. -func (p *Processor) addError(pos token.Pos, reason string) { - position := p.fileSet.Position(pos) - - p.result = append(p.result, Result{ - FileName: position.Filename, - LineNumber: position.Line, - Position: position, - Reason: reason, - }) -} - -func (p *Processor) addWarning(w string, pos token.Pos, t interface{}) { - position := p.fileSet.Position(pos) - - p.warnings = append(p.warnings, - fmt.Sprintf("%s:%d: %s (%T)", position.Filename, position.Line, w, t), - ) -} diff --git a/vendor/github.com/breml/bidichk/LICENSE b/vendor/github.com/breml/bidichk/LICENSE deleted file mode 100644 index 47a8419ce9..0000000000 --- a/vendor/github.com/breml/bidichk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Lucas Bremgartner - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go b/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go deleted file mode 100644 index f1bf20faba..0000000000 --- a/vendor/github.com/breml/bidichk/pkg/bidichk/bidichk.go +++ /dev/null @@ -1,180 +0,0 @@ -package bidichk - -import ( - "bytes" - "flag" - "fmt" - "go/token" - "os" - "sort" - "strings" - "unicode/utf8" - - "golang.org/x/tools/go/analysis" -) - -const ( - doc = "bidichk detects dangerous unicode character sequences" - disallowedDoc = `comma separated list of disallowed runes (full name or short name) - -Supported runes - -LEFT-TO-RIGHT-EMBEDDING, LRE (u+202A) -RIGHT-TO-LEFT-EMBEDDING, RLE (u+202B) -POP-DIRECTIONAL-FORMATTING, PDF (u+202C) -LEFT-TO-RIGHT-OVERRIDE, LRO (u+202D) -RIGHT-TO-LEFT-OVERRIDE, RLO (u+202E) -LEFT-TO-RIGHT-ISOLATE, LRI (u+2066) -RIGHT-TO-LEFT-ISOLATE, RLI (u+2067) -FIRST-STRONG-ISOLATE, FSI (u+2068) -POP-DIRECTIONAL-ISOLATE, PDI (u+2069) -` -) - -type disallowedRunes map[string]rune - -func (m disallowedRunes) String() string { - ss := make([]string, 0, len(m)) - for s := range m { - ss = append(ss, s) - } - sort.Strings(ss) - return strings.Join(ss, ",") -} - -func (m disallowedRunes) Set(s string) error { - ss := strings.FieldsFunc(s, func(c rune) bool { return c == ',' }) - if len(ss) == 0 { - return nil - } - - for k := range m { - delete(m, k) - } - - for _, v := range ss { - switch v { - case runeShortNameLRE, runeShortNameRLE, runeShortNamePDF, - runeShortNameLRO, runeShortNameRLO, runeShortNameLRI, - runeShortNameRLI, runeShortNameFSI, runeShortNamePDI: - v = shortNameLookup[v] - fallthrough - case runeNameLRE, runeNameRLE, runeNamePDF, - runeNameLRO, runeNameRLO, runeNameLRI, - runeNameRLI, runeNameFSI, runeNamePDI: - m[v] = runeLookup[v] - default: - return fmt.Errorf("unknown check name %q (see help for full list)", v) - } - } - return nil -} - -const ( - runeNameLRE = "LEFT-TO-RIGHT-EMBEDDING" - runeNameRLE = "RIGHT-TO-LEFT-EMBEDDING" - runeNamePDF = "POP-DIRECTIONAL-FORMATTING" - runeNameLRO = "LEFT-TO-RIGHT-OVERRIDE" - runeNameRLO = "RIGHT-TO-LEFT-OVERRIDE" - runeNameLRI = "LEFT-TO-RIGHT-ISOLATE" - runeNameRLI = "RIGHT-TO-LEFT-ISOLATE" - runeNameFSI = "FIRST-STRONG-ISOLATE" - runeNamePDI = "POP-DIRECTIONAL-ISOLATE" - - runeShortNameLRE = "LRE" // LEFT-TO-RIGHT-EMBEDDING - runeShortNameRLE = "RLE" // RIGHT-TO-LEFT-EMBEDDING - runeShortNamePDF = "PDF" // POP-DIRECTIONAL-FORMATTING - runeShortNameLRO = "LRO" // LEFT-TO-RIGHT-OVERRIDE - runeShortNameRLO = "RLO" // RIGHT-TO-LEFT-OVERRIDE - runeShortNameLRI = "LRI" // LEFT-TO-RIGHT-ISOLATE - runeShortNameRLI = "RLI" // RIGHT-TO-LEFT-ISOLATE - runeShortNameFSI = "FSI" // FIRST-STRONG-ISOLATE - runeShortNamePDI = "PDI" // POP-DIRECTIONAL-ISOLATE -) - -var runeLookup = map[string]rune{ - runeNameLRE: '\u202A', // LEFT-TO-RIGHT-EMBEDDING - runeNameRLE: '\u202B', // RIGHT-TO-LEFT-EMBEDDING - runeNamePDF: '\u202C', // POP-DIRECTIONAL-FORMATTING - runeNameLRO: '\u202D', // LEFT-TO-RIGHT-OVERRIDE - runeNameRLO: '\u202E', // RIGHT-TO-LEFT-OVERRIDE - runeNameLRI: '\u2066', // LEFT-TO-RIGHT-ISOLATE - runeNameRLI: '\u2067', // RIGHT-TO-LEFT-ISOLATE - runeNameFSI: '\u2068', // FIRST-STRONG-ISOLATE - runeNamePDI: '\u2069', // POP-DIRECTIONAL-ISOLATE -} - -var shortNameLookup = map[string]string{ - runeShortNameLRE: runeNameLRE, - runeShortNameRLE: runeNameRLE, - runeShortNamePDF: runeNamePDF, - runeShortNameLRO: runeNameLRO, - runeShortNameRLO: runeNameRLO, - runeShortNameLRI: runeNameLRI, - runeShortNameRLI: runeNameRLI, - runeShortNameFSI: runeNameFSI, - runeShortNamePDI: runeNamePDI, -} - -type bidichk struct { - disallowedRunes disallowedRunes -} - -// NewAnalyzer return a new bidichk analyzer. -func NewAnalyzer() *analysis.Analyzer { - bidichk := bidichk{} - bidichk.disallowedRunes = make(map[string]rune, len(runeLookup)) - for k, v := range runeLookup { - bidichk.disallowedRunes[k] = v - } - - a := &analysis.Analyzer{ - Name: "bidichk", - Doc: doc, - Run: bidichk.run, - } - - a.Flags.Init("bidichk", flag.ExitOnError) - a.Flags.Var(&bidichk.disallowedRunes, "disallowed-runes", disallowedDoc) - a.Flags.Var(versionFlag{}, "V", "print version and exit") - - return a -} - -func (b bidichk) run(pass *analysis.Pass) (interface{}, error) { - var err error - - pass.Fset.Iterate(func(f *token.File) bool { - if strings.HasPrefix(f.Name(), "$GOROOT") { - return true - } - - return b.check(f.Name(), f.Pos(0), pass) == nil - }) - - return nil, err -} - -func (b bidichk) check(filename string, pos token.Pos, pass *analysis.Pass) error { - body, err := os.ReadFile(filename) - if err != nil { - return err - } - - for name, r := range b.disallowedRunes { - start := 0 - for { - idx := bytes.IndexRune(body[start:], r) - if idx == -1 { - break - } - start += idx - - pass.Reportf(pos+token.Pos(start), "found dangerous unicode character sequence %s", name) - - start += utf8.RuneLen(r) - } - } - - return nil -} diff --git a/vendor/github.com/breml/bidichk/pkg/bidichk/version.go b/vendor/github.com/breml/bidichk/pkg/bidichk/version.go deleted file mode 100644 index 4cfc57dd1e..0000000000 --- a/vendor/github.com/breml/bidichk/pkg/bidichk/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package bidichk - -import ( - "fmt" - "os" -) - -var Version = "bidichk version dev" - -type versionFlag struct{} - -func (versionFlag) IsBoolFlag() bool { return true } -func (versionFlag) Get() interface{} { return nil } -func (versionFlag) String() string { return "" } -func (versionFlag) Set(s string) error { - fmt.Println(Version) - os.Exit(0) - return nil -} diff --git a/vendor/github.com/breml/errchkjson/.gitignore b/vendor/github.com/breml/errchkjson/.gitignore deleted file mode 100644 index 0362de3016..0000000000 --- a/vendor/github.com/breml/errchkjson/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -/errchkjson -/cmd/errchkjson/errchkjson - -# Test binary, build with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out -coverage.html - -# Log files -*.log - -# Env files -.env - -# Exclude todo -TODO.md - -# Exclude IDE settings -.idea/ -*.iml -.vscode/ diff --git a/vendor/github.com/breml/errchkjson/.goreleaser.yml b/vendor/github.com/breml/errchkjson/.goreleaser.yml deleted file mode 100644 index a05c172cb6..0000000000 --- a/vendor/github.com/breml/errchkjson/.goreleaser.yml +++ /dev/null @@ -1,34 +0,0 @@ -# This is an example .goreleaser.yml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com -before: - hooks: - # You may remove this if you don't use go modules. - - go mod tidy -builds: - - main: ./cmd/errchkjson - binary: errchkjson - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin -archives: - - name_template: >- - {{- .Binary }}_ - {{- .Version }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end -}} -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - skip: true -release: - github: - owner: breml - name: errchkjson -gomod: - proxy: true diff --git a/vendor/github.com/breml/errchkjson/LICENSE b/vendor/github.com/breml/errchkjson/LICENSE deleted file mode 100644 index 08db5cb6fc..0000000000 --- a/vendor/github.com/breml/errchkjson/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Lucas Bremgartner - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/breml/errchkjson/README.md b/vendor/github.com/breml/errchkjson/README.md deleted file mode 100644 index 1979597387..0000000000 --- a/vendor/github.com/breml/errchkjson/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# errchkjson - -[![Test Status](https://github.com/breml/errchkjson/actions/workflows/ci.yml/badge.svg)](https://github.com/breml/errchkjson/actions/workflows/ci.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/breml/errchkjson)](https://goreportcard.com/report/github.com/breml/errchkjson) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) - -Checks types passed to the json encoding functions. Reports unsupported types and reports occurrences where the check for the returned error can be omitted. - -Consider this [http.Handler](https://pkg.go.dev/net/http#Handler): - -```Go -func JSONHelloWorld(w http.ResponseWriter, r *http.Request) { - response := struct { - Message string - Code int - }{ - Message: "Hello World", - Code: 200, - } - - body, err := json.Marshal(response) - if err != nil { - panic(err) // unreachable, because json encoding of a struct with just a string and an int will never return an error. - } - - w.Write(body) -} -``` - -Because the `panic` is not possible to happen, one might refactor the code like this: - -```Go -func JSONHelloWorld(w http.ResponseWriter, r *http.Request) { - response := struct { - Message string - Code int - }{ - Message: "Hello World", - Code: 200, - } - - body, _ := json.Marshal(response) - - w.Write(body) -} -``` - -This is ok, as long as the struct is not altered in such a way, that could potentially lead -to `json.Marshal` returning an error. - -`errchkjson` allows you to lint your code such that the above error returned from `json.Marshal` -can be omitted while still staying safe, because as soon as an unsafe type is added to the -response type, the linter will warn you. - -## Installation - -Download `errchkjson` from the [releases](https://github.com/breml/errchkjson/releases) or get the latest version from source with: - -```shell -go get github.com/breml/errchkjson/cmd/errchkjson -``` - -## Usage - -### Shell - -Check everything: - -```shell -errchkjson ./... -``` - -`errchkjson` also recognizes the following command-line options: - -The `-omit-safe` flag disables checking for safe returns of errors from json.Marshal - -## Types - -### Safe - -The following types are safe to use with [json encoding functions](https://pkg.go.dev/encoding/json), that is, the encoding to JSON can not fail: - -Safe basic types: - -* `bool` -* `int`, `int8`, `int16`, `int32`, `int64`, `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `uintptr` -* `string` -* Pointer type of the above listed basic types - -Composed types (struct, map, slice, array) are safe, if the type of the value is -safe. For structs, only exported fields are relevant. For maps, the key needs to be either an integer type or a string. - -### Unsafe - -The following types are unsafe to use with [json encoding functions](https://pkg.go.dev/encoding/json), that is, the encoding to JSON can fail (return an error): - -Unsafe basic types: - -* `float32`, `float64` -* `interface{}` -* Pointer type of the above listed basic types - -Any composed types (struct, map, slice, array) containing an unsafe basic type. - -If a type implements the `json.Marshaler` or `encoding.TextMarshaler` interface (e.g. `json.Number`). - -### Forbidden - -Forbidden basic types: - -* `complex64`, `complex128` -* `chan` -* `func` -* `unsafe.Pointer` - -Any composed types (struct, map, slice, array) containing a forbidden basic type. Any map -using a key with a forbidden type (`bool`, `float32`, `float64`, `struct`). - -## Accepted edge case - -For `encoding/json.MarshalIndent`, there is a (pathological) edge case, where this -function could [return an error](https://cs.opensource.google/go/go/+/refs/tags/go1.18:src/encoding/json/scanner.go;drc=refs%2Ftags%2Fgo1.18;l=181) for an otherwise safe argument, if the argument has -a nesting depth larger than [`10000`](https://cs.opensource.google/go/go/+/refs/tags/go1.18:src/encoding/json/scanner.go;drc=refs%2Ftags%2Fgo1.18;l=144) (as of Go 1.18). - -## Bugs found during development - -During the development of `errcheckjson`, the following issues in package `encoding/json` of the Go standard library have been found and PR have been merged: - -* [Issue #34154: encoding/json: string option (struct tag) on string field with SetEscapeHTML(false) escapes anyway](https://github.com/golang/go/issues/34154) -* [PR #34127: encoding/json: fix and optimize marshal for quoted string](https://github.com/golang/go/pull/34127) -* [Issue #34268: encoding/json: wrong encoding for json.Number field with string option (struct tag)](https://github.com/golang/go/issues/34268) -* [PR #34269: encoding/json: make Number with the ,string option marshal with quotes](https://github.com/golang/go/pull/34269) -* [PR #34272: encoding/json: validate strings when decoding into Number](https://github.com/golang/go/pull/34272) diff --git a/vendor/github.com/breml/errchkjson/errchkjson.go b/vendor/github.com/breml/errchkjson/errchkjson.go deleted file mode 100644 index 4a23929cf2..0000000000 --- a/vendor/github.com/breml/errchkjson/errchkjson.go +++ /dev/null @@ -1,348 +0,0 @@ -// Package errchkjson defines an Analyzer that finds places, where it is -// safe to omit checking the error returned from json.Marshal. -package errchkjson - -import ( - "flag" - "fmt" - "go/ast" - "go/token" - "go/types" - "reflect" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/types/typeutil" -) - -type errchkjson struct { - omitSafe bool // -omit-safe flag - reportNoExported bool // -report-no-exported flag -} - -// NewAnalyzer returns a new errchkjson analyzer. -func NewAnalyzer() *analysis.Analyzer { - errchkjson := &errchkjson{} - - a := &analysis.Analyzer{ - Name: "errchkjson", - Doc: "Checks types passed to the json encoding functions. Reports unsupported types and reports occations, where the check for the returned error can be omitted.", - Run: errchkjson.run, - } - - a.Flags.Init("errchkjson", flag.ExitOnError) - a.Flags.BoolVar(&errchkjson.omitSafe, "omit-safe", false, "if omit-safe is true, checking of safe returns is omitted") - a.Flags.BoolVar(&errchkjson.reportNoExported, "report-no-exported", false, "if report-no-exported is true, encoding a struct without exported fields is reported as issue") - a.Flags.Var(versionFlag{}, "V", "print version and exit") - - return a -} - -func (e *errchkjson) run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - ast.Inspect(file, func(n ast.Node) bool { - if n == nil { - return true - } - - // if the error is returned, it is the caller's responsibility to check - // the return value. - if _, ok := n.(*ast.ReturnStmt); ok { - return false - } - - ce, ok := n.(*ast.CallExpr) - if ok { - fn, _ := typeutil.Callee(pass.TypesInfo, ce).(*types.Func) - if fn == nil { - return true - } - - switch fn.FullName() { - case "encoding/json.Marshal", "encoding/json.MarshalIndent": - e.handleJSONMarshal(pass, ce, fn.FullName(), blankIdentifier, e.omitSafe) - case "(*encoding/json.Encoder).Encode": - e.handleJSONMarshal(pass, ce, fn.FullName(), blankIdentifier, true) - default: - e.inspectArgs(pass, ce.Args) - } - return false - } - - as, ok := n.(*ast.AssignStmt) - if !ok { - return true - } - - ce, ok = as.Rhs[0].(*ast.CallExpr) - if !ok { - return true - } - - fn, _ := typeutil.Callee(pass.TypesInfo, ce).(*types.Func) - if fn == nil { - return true - } - - switch fn.FullName() { - case "encoding/json.Marshal", "encoding/json.MarshalIndent": - e.handleJSONMarshal(pass, ce, fn.FullName(), evaluateMarshalErrorTarget(as.Lhs[1]), e.omitSafe) - case "(*encoding/json.Encoder).Encode": - e.handleJSONMarshal(pass, ce, fn.FullName(), evaluateMarshalErrorTarget(as.Lhs[0]), true) - default: - return true - } - return false - }) - } - - return nil, nil -} - -func evaluateMarshalErrorTarget(n ast.Expr) marshalErrorTarget { - if errIdent, ok := n.(*ast.Ident); ok { - if errIdent.Name == "_" { - return blankIdentifier - } - } - return variableAssignment -} - -type marshalErrorTarget int - -const ( - blankIdentifier = iota // the returned error from the JSON marshal function is assigned to the blank identifier "_". - variableAssignment // the returned error from the JSON marshal function is assigned to a variable. - functionArgument // the returned error from the JSON marshal function is passed to an other function as argument. -) - -func (e *errchkjson) handleJSONMarshal(pass *analysis.Pass, ce *ast.CallExpr, fnName string, errorTarget marshalErrorTarget, omitSafe bool) { - t := pass.TypesInfo.TypeOf(ce.Args[0]) - if t == nil { - // Not sure, if this is at all possible - if errorTarget == blankIdentifier { - pass.Reportf(ce.Pos(), "Type of argument to `%s` could not be evaluated and error return value is not checked", fnName) - } - return - } - - if _, ok := t.(*types.Pointer); ok { - t = t.(*types.Pointer).Elem() - } - - err := e.jsonSafe(t, 0, map[types.Type]struct{}{}) - if err != nil { - if _, ok := err.(unsupported); ok { - pass.Reportf(ce.Pos(), "`%s` for %v", fnName, err) - return - } - if _, ok := err.(noexported); ok { - pass.Reportf(ce.Pos(), "Error argument passed to `%s` does not contain any exported field", fnName) - } - // Only care about unsafe types if they are assigned to the blank identifier. - if errorTarget == blankIdentifier { - pass.Reportf(ce.Pos(), "Error return value of `%s` is not checked: %v", fnName, err) - } - } - if err == nil && errorTarget == variableAssignment && !omitSafe { - pass.Reportf(ce.Pos(), "Error return value of `%s` is checked but passed argument is safe", fnName) - } - // Report an error, if err for json.Marshal is not checked and safe types are omitted - if err == nil && errorTarget == blankIdentifier && omitSafe { - pass.Reportf(ce.Pos(), "Error return value of `%s` is not checked", fnName) - } -} - -const ( - allowedBasicTypes = types.IsBoolean | types.IsInteger | types.IsString - allowedMapKeyBasicTypes = types.IsInteger | types.IsString - unsupportedBasicTypes = types.IsComplex -) - -func (e *errchkjson) jsonSafe(t types.Type, level int, seenTypes map[types.Type]struct{}) error { - if _, ok := seenTypes[t]; ok { - return nil - } - - if types.Implements(t, textMarshalerInterface()) || types.Implements(t, jsonMarshalerInterface()) { - return fmt.Errorf("unsafe type `%s` found", t.String()) - } - - switch ut := t.Underlying().(type) { - case *types.Basic: - if ut.Info()&allowedBasicTypes > 0 { // bool, int-family, string - if ut.Info()&types.IsString > 0 && t.String() == "encoding/json.Number" { - return fmt.Errorf("unsafe type `%s` found", t.String()) - } - return nil - } - if ut.Info()&unsupportedBasicTypes > 0 { // complex64, complex128 - return newUnsupportedError(fmt.Errorf("unsupported type `%s` found", ut.String())) - } - switch ut.Kind() { - case types.UntypedNil: - return nil - case types.UnsafePointer: - return newUnsupportedError(fmt.Errorf("unsupported type `%s` found", ut.String())) - default: - // E.g. float32, float64 - return fmt.Errorf("unsafe type `%s` found", ut.String()) - } - - case *types.Array: - err := e.jsonSafe(ut.Elem(), level+1, seenTypes) - if err != nil { - return err - } - return nil - - case *types.Slice: - err := e.jsonSafe(ut.Elem(), level+1, seenTypes) - if err != nil { - return err - } - return nil - - case *types.Struct: - seenTypes[t] = struct{}{} - exported := 0 - for i := 0; i < ut.NumFields(); i++ { - if !ut.Field(i).Exported() { - // Unexported fields can be ignored - continue - } - if tag, ok := reflect.StructTag(ut.Tag(i)).Lookup("json"); ok { - if tag == "-" { - // Fields omitted in json can be ignored - continue - } - } - err := e.jsonSafe(ut.Field(i).Type(), level+1, seenTypes) - if err != nil { - return err - } - exported++ - } - if e.reportNoExported && level == 0 && exported == 0 { - return newNoexportedError(fmt.Errorf("struct does not export any field")) - } - return nil - - case *types.Pointer: - err := e.jsonSafe(ut.Elem(), level+1, seenTypes) - if err != nil { - return err - } - return nil - - case *types.Map: - err := jsonSafeMapKey(ut.Key()) - if err != nil { - return err - } - err = e.jsonSafe(ut.Elem(), level+1, seenTypes) - if err != nil { - return err - } - return nil - - case *types.Chan, *types.Signature: - // Types that are not supported for encoding to json: - return newUnsupportedError(fmt.Errorf("unsupported type `%s` found", ut.String())) - - default: - // Types that are not supported for encoding to json or are not completely safe, like: interfaces - return fmt.Errorf("unsafe type `%s` found", t.String()) - } -} - -func jsonSafeMapKey(t types.Type) error { - if types.Implements(t, textMarshalerInterface()) || types.Implements(t, jsonMarshalerInterface()) { - return fmt.Errorf("unsafe type `%s` as map key found", t.String()) - } - switch ut := t.Underlying().(type) { - case *types.Basic: - if ut.Info()&types.IsString > 0 && t.String() == "encoding/json.Number" { - return fmt.Errorf("unsafe type `%s` as map key found", t.String()) - } - if ut.Info()&allowedMapKeyBasicTypes > 0 { // bool, int-family, string - return nil - } - // E.g. bool, float32, float64, complex64, complex128 - return newUnsupportedError(fmt.Errorf("unsupported type `%s` as map key found", t.String())) - case *types.Interface: - return fmt.Errorf("unsafe type `%s` as map key found", t.String()) - default: - // E.g. struct composed solely of basic types, that are comparable - return newUnsupportedError(fmt.Errorf("unsupported type `%s` as map key found", t.String())) - } -} - -func (e *errchkjson) inspectArgs(pass *analysis.Pass, args []ast.Expr) { - for _, a := range args { - ast.Inspect(a, func(n ast.Node) bool { - if n == nil { - return true - } - - ce, ok := n.(*ast.CallExpr) - if !ok { - return false - } - - fn, _ := typeutil.Callee(pass.TypesInfo, ce).(*types.Func) - if fn == nil { - return true - } - - switch fn.FullName() { - case "encoding/json.Marshal", "encoding/json.MarshalIndent": - e.handleJSONMarshal(pass, ce, fn.FullName(), functionArgument, e.omitSafe) - case "(*encoding/json.Encoder).Encode": - e.handleJSONMarshal(pass, ce, fn.FullName(), functionArgument, true) - default: - e.inspectArgs(pass, ce.Args) - } - return false - }) - } -} - -// Construct *types.Interface for interface encoding.TextMarshaler -// -// type TextMarshaler interface { -// MarshalText() (text []byte, err error) -// } -func textMarshalerInterface() *types.Interface { - textMarshalerInterface := types.NewInterfaceType([]*types.Func{ - types.NewFunc(token.NoPos, nil, "MarshalText", types.NewSignatureType( - nil, nil, nil, nil, types.NewTuple( - types.NewVar(token.NoPos, nil, "text", - types.NewSlice( - types.Universe.Lookup("byte").Type())), - types.NewVar(token.NoPos, nil, "err", types.Universe.Lookup("error").Type())), - false)), - }, nil) - textMarshalerInterface.Complete() - - return textMarshalerInterface -} - -// Construct *types.Interface for interface json.Marshaler -// -// type Marshaler interface { -// MarshalJSON() ([]byte, error) -// } -func jsonMarshalerInterface() *types.Interface { - textMarshalerInterface := types.NewInterfaceType([]*types.Func{ - types.NewFunc(token.NoPos, nil, "MarshalJSON", types.NewSignatureType( - nil, nil, nil, nil, types.NewTuple( - types.NewVar(token.NoPos, nil, "", - types.NewSlice( - types.Universe.Lookup("byte").Type())), - types.NewVar(token.NoPos, nil, "", types.Universe.Lookup("error").Type())), - false)), - }, nil) - textMarshalerInterface.Complete() - - return textMarshalerInterface -} diff --git a/vendor/github.com/breml/errchkjson/noexported_error.go b/vendor/github.com/breml/errchkjson/noexported_error.go deleted file mode 100644 index 07b7a07d26..0000000000 --- a/vendor/github.com/breml/errchkjson/noexported_error.go +++ /dev/null @@ -1,23 +0,0 @@ -package errchkjson - -type noexported interface { - noexported() -} - -var _ noexported = noexportedError{} - -type noexportedError struct { - err error -} - -func newNoexportedError(err error) error { - return noexportedError{ - err: err, - } -} - -func (u noexportedError) noexported() {} - -func (u noexportedError) Error() string { - return u.err.Error() -} diff --git a/vendor/github.com/breml/errchkjson/unsupported_error.go b/vendor/github.com/breml/errchkjson/unsupported_error.go deleted file mode 100644 index 1a38c3f532..0000000000 --- a/vendor/github.com/breml/errchkjson/unsupported_error.go +++ /dev/null @@ -1,23 +0,0 @@ -package errchkjson - -type unsupported interface { - unsupported() -} - -var _ unsupported = unsupportedError{} - -type unsupportedError struct { - err error -} - -func newUnsupportedError(err error) error { - return unsupportedError{ - err: err, - } -} - -func (u unsupportedError) unsupported() {} - -func (u unsupportedError) Error() string { - return u.err.Error() -} diff --git a/vendor/github.com/breml/errchkjson/version.go b/vendor/github.com/breml/errchkjson/version.go deleted file mode 100644 index 77d8ef8bb0..0000000000 --- a/vendor/github.com/breml/errchkjson/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package errchkjson - -import ( - "fmt" - "os" -) - -var Version = "errchkjson version dev" - -type versionFlag struct{} - -func (versionFlag) IsBoolFlag() bool { return true } -func (versionFlag) Get() interface{} { return nil } -func (versionFlag) String() string { return "" } -func (versionFlag) Set(s string) error { - fmt.Println(Version) - os.Exit(0) - return nil -} diff --git a/vendor/github.com/briandowns/spinner/.gitignore b/vendor/github.com/briandowns/spinner/.gitignore deleted file mode 100644 index 21ec6b71b7..0000000000 --- a/vendor/github.com/briandowns/spinner/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Created by .gitignore support plugin (hsz.mobi) -### Go template -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -.idea -*.iml diff --git a/vendor/github.com/briandowns/spinner/.travis.yml b/vendor/github.com/briandowns/spinner/.travis.yml deleted file mode 100644 index 74d205aec0..0000000000 --- a/vendor/github.com/briandowns/spinner/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -arch: - - amd64 - - ppc64le -language: go -go: - - 1.16 - - 1.17.5 -env: - - GOARCH: amd64 - - GOARCH: 386 -script: - - go test -v -notifications: - email: - recipients: - - brian.downs@gmail.com - on_success: change - on_failure: always diff --git a/vendor/github.com/briandowns/spinner/LICENSE b/vendor/github.com/briandowns/spinner/LICENSE deleted file mode 100644 index dd5b3a58aa..0000000000 --- a/vendor/github.com/briandowns/spinner/LICENSE +++ /dev/null @@ -1,174 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. diff --git a/vendor/github.com/briandowns/spinner/Makefile b/vendor/github.com/briandowns/spinner/Makefile deleted file mode 100644 index 3cfdeb23c6..0000000000 --- a/vendor/github.com/briandowns/spinner/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -GO = go - -.PHONY: deps -deps: go.mod - -go.mod: - go mod init - go mod tidy - -.PHONY: test -test: - $(GO) test -v -cover ./... - -.PHONY: check -check: - if [ -d vendor ]; then cp -r vendor/* ${GOPATH}/src/; fi - -.PHONY: clean -clean: - $(GO) clean diff --git a/vendor/github.com/briandowns/spinner/NOTICE.txt b/vendor/github.com/briandowns/spinner/NOTICE.txt deleted file mode 100644 index 95e2a248b0..0000000000 --- a/vendor/github.com/briandowns/spinner/NOTICE.txt +++ /dev/null @@ -1,4 +0,0 @@ -Spinner -Copyright (c) 2022 Brian J. Downs -This product is licensed to you under the Apache 2.0 license (the "License"). You may not use this product except in compliance with the Apache 2.0 License. -This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. diff --git a/vendor/github.com/briandowns/spinner/README.md b/vendor/github.com/briandowns/spinner/README.md deleted file mode 100644 index 28b024d323..0000000000 --- a/vendor/github.com/briandowns/spinner/README.md +++ /dev/null @@ -1,285 +0,0 @@ -# Spinner - -[![GoDoc](https://godoc.org/github.com/briandowns/spinner?status.svg)](https://godoc.org/github.com/briandowns/spinner) [![CircleCI](https://circleci.com/gh/briandowns/spinner.svg?style=svg)](https://circleci.com/gh/briandowns/spinner) - -spinner is a simple package to add a spinner / progress indicator to any terminal application. Examples can be found below as well as full examples in the examples directory. - -For more detail about the library and its features, reference your local godoc once installed. - -Contributions welcome! - -## Installation - -```bash -go get github.com/briandowns/spinner -``` - -## Available Character Sets - -90 Character Sets. Some examples below: - -(Numbered by their slice index) - -| index | character set | sample gif | -| ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | -| 0 | ```←↖↑↗→↘↓↙``` | ![Sample Gif](gifs/0.gif) | -| 1 | ```▁▃▄▅▆▇█▇▆▅▄▃▁``` | ![Sample Gif](gifs/1.gif) | -| 2 | ```▖▘▝▗``` | ![Sample Gif](gifs/2.gif) | -| 3 | ```┤┘┴└├┌┬┐``` | ![Sample Gif](gifs/3.gif) | -| 4 | ```◢◣◤◥``` | ![Sample Gif](gifs/4.gif) | -| 5 | ```◰◳◲◱``` | ![Sample Gif](gifs/5.gif) | -| 6 | ```◴◷◶◵``` | ![Sample Gif](gifs/6.gif) | -| 7 | ```◐◓◑◒``` | ![Sample Gif](gifs/7.gif) | -| 8 | ```.oO@*``` | ![Sample Gif](gifs/8.gif) | -| 9 | ```\|/-\``` | ![Sample Gif](gifs/9.gif) | -| 10 | ```◡◡⊙⊙◠◠``` | ![Sample Gif](gifs/10.gif) | -| 11 | ```⣾⣽⣻⢿⡿⣟⣯⣷``` | ![Sample Gif](gifs/11.gif) | -| 12 | ```>))'> >))'> >))'> >))'> >))'> <'((< <'((< <'((<``` | ![Sample Gif](gifs/12.gif) | -| 13 | ```⠁⠂⠄⡀⢀⠠⠐⠈``` | ![Sample Gif](gifs/13.gif) | -| 14 | ```⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏``` | ![Sample Gif](gifs/14.gif) | -| 15 | ```abcdefghijklmnopqrstuvwxyz``` | ![Sample Gif](gifs/15.gif) | -| 16 | ```▉▊▋▌▍▎▏▎▍▌▋▊▉``` | ![Sample Gif](gifs/16.gif) | -| 17 | ```■□▪▫``` | ![Sample Gif](gifs/17.gif) | -| 18 | ```←↑→↓``` | ![Sample Gif](gifs/18.gif) | -| 19 | ```╫╪``` | ![Sample Gif](gifs/19.gif) | -| 20 | ```⇐⇖⇑⇗⇒⇘⇓⇙``` | ![Sample Gif](gifs/20.gif) | -| 21 | ```⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈``` | ![Sample Gif](gifs/21.gif) | -| 22 | ```⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈``` | ![Sample Gif](gifs/22.gif) | -| 23 | ```⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁``` | ![Sample Gif](gifs/23.gif) | -| 24 | ```⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋``` | ![Sample Gif](gifs/24.gif) | -| 25 | ```ヲァィゥェォャュョッアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン``` | ![Sample Gif](gifs/25.gif) | -| 26 | ```. .. ...``` | ![Sample Gif](gifs/26.gif) | -| 27 | ```▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁``` | ![Sample Gif](gifs/27.gif) | -| 28 | ```.oO°Oo.``` | ![Sample Gif](gifs/28.gif) | -| 29 | ```+x``` | ![Sample Gif](gifs/29.gif) | -| 30 | ```v<^>``` | ![Sample Gif](gifs/30.gif) | -| 31 | ```>>---> >>---> >>---> >>---> >>---> <---<< <---<< <---<< <---<< <---<<``` | ![Sample Gif](gifs/31.gif) | -| 32 | ```\| \|\| \|\|\| \|\|\|\| \|\|\|\|\| \|\|\|\|\|\| \|\|\|\|\| \|\|\|\| \|\|\| \|\| \|``` | ![Sample Gif](gifs/32.gif) | -| 33 | ```[] [=] [==] [===] [====] [=====] [======] [=======] [========] [=========] [==========]``` | ![Sample Gif](gifs/33.gif) | -| 34 | ```(*---------) (-*--------) (--*-------) (---*------) (----*-----) (-----*----) (------*---) (-------*--) (--------*-) (---------*)``` | ![Sample Gif](gifs/34.gif) | -| 35 | ```█▒▒▒▒▒▒▒▒▒ ███▒▒▒▒▒▒▒ █████▒▒▒▒▒ ███████▒▒▒ ██████████``` | ![Sample Gif](gifs/35.gif) | -| 36 | ```[ ] [=> ] [===> ] [=====> ] [======> ] [========> ] [==========> ] [============> ] [==============> ] [================> ] [==================> ] [===================>]``` | ![Sample Gif](gifs/36.gif) | -| 37 | ```🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 🕙 🕚 🕛``` | ![Sample Gif](gifs/37.gif) | -| 38 | ```🕐 🕜 🕑 🕝 🕒 🕞 🕓 🕟 🕔 🕠 🕕 🕡 🕖 🕢 🕗 🕣 🕘 🕤 🕙 🕥 🕚 🕦 🕛 🕧``` | ![Sample Gif](gifs/38.gif) | -| 39 | ```🌍 🌎 🌏``` | ![Sample Gif](gifs/39.gif) | -| 40 | ```◜ ◝ ◞ ◟``` | ![Sample Gif](gifs/40.gif) | -| 41 | ```⬒ ⬔ ⬓ ⬕``` | ![Sample Gif](gifs/41.gif) | -| 42 | ```⬖ ⬘ ⬗ ⬙``` | ![Sample Gif](gifs/42.gif) | -| 43 | ```[>>> >] []>>>> [] [] >>>> [] [] >>>> [] [] >>>> [] [] >>>>[] [>> >>]``` | ![Sample Gif](gifs/43.gif) | - -## Features - -* Start -* Stop -* Restart -* Reverse direction -* Update the spinner character set -* Update the spinner speed -* Prefix or append text -* Change spinner color, background, and text attributes such as bold / italics -* Get spinner status -* Chain, pipe, redirect output -* Output final string on spinner/indicator completion - -## Examples - -```Go -package main - -import ( - "github.com/briandowns/spinner" - "time" -) - -func main() { - s := spinner.New(spinner.CharSets[9], 100*time.Millisecond) // Build our new spinner - s.Start() // Start the spinner - time.Sleep(4 * time.Second) // Run for some time to simulate work - s.Stop() -} -``` - -## Update the character set and restart the spinner - -```Go -s.UpdateCharSet(spinner.CharSets[1]) // Update spinner to use a different character set -s.Restart() // Restart the spinner -time.Sleep(4 * time.Second) -s.Stop() -``` - -## Update spin speed and restart the spinner - -```Go -s.UpdateSpeed(200 * time.Millisecond) // Update the speed the spinner spins at -s.Restart() -time.Sleep(4 * time.Second) -s.Stop() -``` - -## Reverse the direction of the spinner - -```Go -s.Reverse() // Reverse the direction the spinner is spinning -s.Restart() -time.Sleep(4 * time.Second) -s.Stop() -``` - -## Provide your own spinner - -(or send me an issue or pull request to add to the project) - -```Go -someSet := []string{"+", "-"} -s := spinner.New(someSet, 100*time.Millisecond) -``` - -## Prefix or append text to the spinner - -```Go -s.Prefix = "prefixed text: " // Prefix text before the spinner -s.Suffix = " :appended text" // Append text after the spinner -``` - -## Set or change the color of the spinner. Default color is white. The spinner will need to be restarted to pick up the change. - -```Go -s.Color("red") // Set the spinner color to red -``` - -You can specify both the background and foreground color, as well as additional attributes such as `bold` or `underline`. - -```Go -s.Color("red", "bold") // Set the spinner color to a bold red -``` - -To set the background to black, the foreground to a bold red: - -```Go -s.Color("bgBlack", "bold", "fgRed") -``` - -Below is the full color and attribute list: - -```Go -// default colors -red -black -green -yellow -blue -magenta -cyan -white - -// attributes -reset -bold -faint -italic -underline -blinkslow -blinkrapid -reversevideo -concealed -crossedout - -// foreground text -fgBlack -fgRed -fgGreen -fgYellow -fgBlue -fgMagenta -fgCyan -fgWhite - -// foreground Hi-Intensity text -fgHiBlack -fgHiRed -fgHiGreen -fgHiYellow -fgHiBlue -fgHiMagenta -fgHiCyan -fgHiWhite - -// background text -bgBlack -bgRed -bgGreen -bgYellow -bgBlue -bgMagenta -bgCyan -bgWhite - -// background Hi-Intensity text -bgHiBlack -bgHiRed -bgHiGreen -bgHiYellow -bgHiBlue -bgHiMagenta -bgHiCyan -bgHiWhite -``` - -## Generate a sequence of numbers - -```Go -setOfDigits := spinner.GenerateNumberSequence(25) // Generate a 25 digit string of numbers -s := spinner.New(setOfDigits, 100*time.Millisecond) -``` - -## Get spinner status - -```Go -fmt.Println(s.Active()) -``` - -## Unix pipe and redirect - -Feature suggested and write up by [dekz](https://github.com/dekz) - -Setting the Spinner Writer to Stderr helps show progress to the user, with the enhancement to chain, pipe or redirect the output. - -This is the preferred method of setting a Writer at this time. - -```go -s := spinner.New(spinner.CharSets[11], 100*time.Millisecond, spinner.WithWriter(os.Stderr)) -s.Suffix = " Encrypting data..." -s.Start() -// Encrypt the data into ciphertext -fmt.Println(os.Stdout, ciphertext) -``` - -```sh -> myprog encrypt "Secret text" > encrypted.txt -⣯ Encrypting data... -``` - -```sh -> cat encrypted.txt -1243hjkbas23i9ah27sj39jghv237n2oa93hg83 -``` - -## Final String Output - -Add additional output when the spinner/indicator has completed. The "final" output string can be multi-lined and will be written to wherever the `io.Writer` has been configured for. - -```Go -s := spinner.New(spinner.CharSets[9], 100*time.Millisecond) -s.FinalMSG = "Complete!\nNew line!\nAnother one!\n" -s.Start() -time.Sleep(4 * time.Second) -s.Stop() -``` - -Output -```sh -Complete! -New line! -Another one! -``` diff --git a/vendor/github.com/briandowns/spinner/character_sets.go b/vendor/github.com/briandowns/spinner/character_sets.go deleted file mode 100644 index df41a0f2c5..0000000000 --- a/vendor/github.com/briandowns/spinner/character_sets.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2022 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spinner - -const ( - clockOneOClock = '\U0001F550' - clockOneThirty = '\U0001F55C' -) - -// CharSets contains the available character sets -var CharSets = map[int][]string{ - 0: {"←", "↖", "↑", "↗", "→", "↘", "↓", "↙"}, - 1: {"▁", "▃", "▄", "▅", "▆", "▇", "█", "▇", "▆", "▅", "▄", "▃", "▁"}, - 2: {"▖", "▘", "▝", "▗"}, - 3: {"┤", "┘", "┴", "└", "├", "┌", "┬", "┐"}, - 4: {"◢", "◣", "◤", "◥"}, - 5: {"◰", "◳", "◲", "◱"}, - 6: {"◴", "◷", "◶", "◵"}, - 7: {"◐", "◓", "◑", "◒"}, - 8: {".", "o", "O", "@", "*"}, - 9: {"|", "/", "-", "\\"}, - 10: {"◡◡", "⊙⊙", "◠◠"}, - 11: {"⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷"}, - 12: {">))'>", " >))'>", " >))'>", " >))'>", " >))'>", " <'((<", " <'((<", " <'((<"}, - 13: {"⠁", "⠂", "⠄", "⡀", "⢀", "⠠", "⠐", "⠈"}, - 14: {"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}, - 15: {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}, - 16: {"▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"}, - 17: {"■", "□", "▪", "▫"}, - - 18: {"←", "↑", "→", "↓"}, - 19: {"╫", "╪"}, - 20: {"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"}, - 21: {"⠁", "⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈", "⠈"}, - 22: {"⠈", "⠉", "⠋", "⠓", "⠒", "⠐", "⠐", "⠒", "⠖", "⠦", "⠤", "⠠", "⠠", "⠤", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋", "⠉", "⠈"}, - 23: {"⠁", "⠉", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠤", "⠄", "⠄", "⠤", "⠴", "⠲", "⠒", "⠂", "⠂", "⠒", "⠚", "⠙", "⠉", "⠁"}, - 24: {"⠋", "⠙", "⠚", "⠒", "⠂", "⠂", "⠒", "⠲", "⠴", "⠦", "⠖", "⠒", "⠐", "⠐", "⠒", "⠓", "⠋"}, - 25: {"ヲ", "ァ", "ィ", "ゥ", "ェ", "ォ", "ャ", "ュ", "ョ", "ッ", "ア", "イ", "ウ", "エ", "オ", "カ", "キ", "ク", "ケ", "コ", "サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "ヒ", "フ", "ヘ", "ホ", "マ", "ミ", "ム", "メ", "モ", "ヤ", "ユ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ワ", "ン"}, - 26: {".", "..", "..."}, - 27: {"▁", "▂", "▃", "▄", "▅", "▆", "▇", "█", "▉", "▊", "▋", "▌", "▍", "▎", "▏", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█", "▇", "▆", "▅", "▄", "▃", "▂", "▁"}, - 28: {".", "o", "O", "°", "O", "o", "."}, - 29: {"+", "x"}, - 30: {"v", "<", "^", ">"}, - 31: {">>--->", " >>--->", " >>--->", " >>--->", " >>--->", " <---<<", " <---<<", " <---<<", " <---<<", "<---<<"}, - 32: {"|", "||", "|||", "||||", "|||||", "|||||||", "||||||||", "|||||||", "||||||", "|||||", "||||", "|||", "||", "|"}, - 33: {"[ ]", "[= ]", "[== ]", "[=== ]", "[==== ]", "[===== ]", "[====== ]", "[======= ]", "[======== ]", "[========= ]", "[==========]"}, - 34: {"(*---------)", "(-*--------)", "(--*-------)", "(---*------)", "(----*-----)", "(-----*----)", "(------*---)", "(-------*--)", "(--------*-)", "(---------*)"}, - 35: {"█▒▒▒▒▒▒▒▒▒", "███▒▒▒▒▒▒▒", "█████▒▒▒▒▒", "███████▒▒▒", "██████████"}, - 36: {"[ ]", "[=> ]", "[===> ]", "[=====> ]", "[======> ]", "[========> ]", "[==========> ]", "[============> ]", "[==============> ]", "[================> ]", "[==================> ]", "[===================>]"}, - 39: {"🌍", "🌎", "🌏"}, - 40: {"◜", "◝", "◞", "◟"}, - 41: {"⬒", "⬔", "⬓", "⬕"}, - 42: {"⬖", "⬘", "⬗", "⬙"}, - 43: {"[>>> >]", "[]>>>> []", "[] >>>> []", "[] >>>> []", "[] >>>> []", "[] >>>>[]", "[>> >>]"}, - 44: {"♠", "♣", "♥", "♦"}, - 45: {"➞", "➟", "➠", "➡", "➠", "➟"}, - 46: {" | ", ` \ `, "_ ", ` \ `, " | ", " / ", " _", " / "}, - 47: {" . . . .", ". . . .", ". . . .", ". . . .", ". . . . ", ". . . . ."}, - 48: {" | ", " / ", " _ ", ` \ `, " | ", ` \ `, " _ ", " / "}, - 49: {"⎺", "⎻", "⎼", "⎽", "⎼", "⎻"}, - 50: {"▹▹▹▹▹", "▸▹▹▹▹", "▹▸▹▹▹", "▹▹▸▹▹", "▹▹▹▸▹", "▹▹▹▹▸"}, - 51: {"[ ]", "[ =]", "[ ==]", "[ ===]", "[====]", "[=== ]", "[== ]", "[= ]"}, - 52: {"( ● )", "( ● )", "( ● )", "( ● )", "( ●)", "( ● )", "( ● )", "( ● )", "( ● )"}, - 53: {"✶", "✸", "✹", "✺", "✹", "✷"}, - 54: {"▐|\\____________▌", "▐_|\\___________▌", "▐__|\\__________▌", "▐___|\\_________▌", "▐____|\\________▌", "▐_____|\\_______▌", "▐______|\\______▌", "▐_______|\\_____▌", "▐________|\\____▌", "▐_________|\\___▌", "▐__________|\\__▌", "▐___________|\\_▌", "▐____________|\\▌", "▐____________/|▌", "▐___________/|_▌", "▐__________/|__▌", "▐_________/|___▌", "▐________/|____▌", "▐_______/|_____▌", "▐______/|______▌", "▐_____/|_______▌", "▐____/|________▌", "▐___/|_________▌", "▐__/|__________▌", "▐_/|___________▌", "▐/|____________▌"}, - 55: {"▐⠂ ▌", "▐⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂▌", "▐ ⠠▌", "▐ ⡀▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐ ⠠ ▌", "▐ ⠂ ▌", "▐ ⠈ ▌", "▐ ⠂ ▌", "▐ ⠠ ▌", "▐ ⡀ ▌", "▐⠠ ▌"}, - 56: {"¿", "?"}, - 57: {"⢹", "⢺", "⢼", "⣸", "⣇", "⡧", "⡗", "⡏"}, - 58: {"⢄", "⢂", "⢁", "⡁", "⡈", "⡐", "⡠"}, - 59: {". ", ".. ", "...", " ..", " .", " "}, - 60: {".", "o", "O", "°", "O", "o", "."}, - 61: {"▓", "▒", "░"}, - 62: {"▌", "▀", "▐", "▄"}, - 63: {"⊶", "⊷"}, - 64: {"▪", "▫"}, - 65: {"□", "■"}, - 66: {"▮", "▯"}, - 67: {"-", "=", "≡"}, - 68: {"d", "q", "p", "b"}, - 69: {"∙∙∙", "●∙∙", "∙●∙", "∙∙●", "∙∙∙"}, - 70: {"🌑 ", "🌒 ", "🌓 ", "🌔 ", "🌕 ", "🌖 ", "🌗 ", "🌘 "}, - 71: {"☗", "☖"}, - 72: {"⧇", "⧆"}, - 73: {"◉", "◎"}, - 74: {"㊂", "㊀", "㊁"}, - 75: {"⦾", "⦿"}, - 76: {"ဝ", "၀"}, - 77: {"▌", "▀", "▐▄"}, - 78: {"⠈⠁", "⠈⠑", "⠈⠱", "⠈⡱", "⢀⡱", "⢄⡱", "⢄⡱", "⢆⡱", "⢎⡱", "⢎⡰", "⢎⡠", "⢎⡀", "⢎⠁", "⠎⠁", "⠊⠁"}, - 79: {"________", "-_______", "_-______", "__-_____", "___-____", "____-___", "_____-__", "______-_", "_______-", "________", "_______-", "______-_", "_____-__", "____-___", "___-____", "__-_____", "_-______", "-_______", "________"}, - 80: {"|_______", "_/______", "__-_____", "___\\____", "____|___", "_____/__", "______-_", "_______\\", "_______|", "______\\_", "_____-__", "____/___", "___|____", "__\\_____", "_-______"}, - 81: {"□", "◱", "◧", "▣", "■"}, - 82: {"□", "◱", "▨", "▩", "■"}, - 83: {"░", "▒", "▓", "█"}, - 84: {"░", "█"}, - 85: {"⚪", "⚫"}, - 86: {"◯", "⬤"}, - 87: {"▱", "▰"}, - 88: {"➊", "➋", "➌", "➍", "➎", "➏", "➐", "➑", "➒", "➓"}, - 89: {"½", "⅓", "⅔", "¼", "¾", "⅛", "⅜", "⅝", "⅞"}, - 90: {"↞", "↟", "↠", "↡"}, -} - -func init() { - for i := rune(0); i < 12; i++ { - CharSets[37] = append(CharSets[37], string([]rune{clockOneOClock + i})) - CharSets[38] = append(CharSets[38], string([]rune{clockOneOClock + i}), string([]rune{clockOneThirty + i})) - } -} diff --git a/vendor/github.com/briandowns/spinner/spinner.go b/vendor/github.com/briandowns/spinner/spinner.go deleted file mode 100644 index 97b1a8f74d..0000000000 --- a/vendor/github.com/briandowns/spinner/spinner.go +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright (c) 2021 Brian J. Downs -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package spinner is a simple package to add a spinner / progress indicator to any terminal application. -package spinner - -import ( - "errors" - "fmt" - "io" - "math" - "os" - "runtime" - "strconv" - "strings" - "sync" - "time" - "unicode/utf8" - - "github.com/fatih/color" - "github.com/mattn/go-isatty" - "golang.org/x/term" -) - -// errInvalidColor is returned when attempting to set an invalid color -var errInvalidColor = errors.New("invalid color") - -// validColors holds an array of the only colors allowed -var validColors = map[string]bool{ - // default colors for backwards compatibility - "black": true, - "red": true, - "green": true, - "yellow": true, - "blue": true, - "magenta": true, - "cyan": true, - "white": true, - - // attributes - "reset": true, - "bold": true, - "faint": true, - "italic": true, - "underline": true, - "blinkslow": true, - "blinkrapid": true, - "reversevideo": true, - "concealed": true, - "crossedout": true, - - // foreground text - "fgBlack": true, - "fgRed": true, - "fgGreen": true, - "fgYellow": true, - "fgBlue": true, - "fgMagenta": true, - "fgCyan": true, - "fgWhite": true, - - // foreground Hi-Intensity text - "fgHiBlack": true, - "fgHiRed": true, - "fgHiGreen": true, - "fgHiYellow": true, - "fgHiBlue": true, - "fgHiMagenta": true, - "fgHiCyan": true, - "fgHiWhite": true, - - // background text - "bgBlack": true, - "bgRed": true, - "bgGreen": true, - "bgYellow": true, - "bgBlue": true, - "bgMagenta": true, - "bgCyan": true, - "bgWhite": true, - - // background Hi-Intensity text - "bgHiBlack": true, - "bgHiRed": true, - "bgHiGreen": true, - "bgHiYellow": true, - "bgHiBlue": true, - "bgHiMagenta": true, - "bgHiCyan": true, - "bgHiWhite": true, -} - -// returns true if the OS is windows and the WT_SESSION env variable is set. -var isWindows = runtime.GOOS == "windows" -var isWindowsTerminalOnWindows = len(os.Getenv("WT_SESSION")) > 0 && isWindows - -// returns a valid color's foreground text color attribute -var colorAttributeMap = map[string]color.Attribute{ - // default colors for backwards compatibility - "black": color.FgBlack, - "red": color.FgRed, - "green": color.FgGreen, - "yellow": color.FgYellow, - "blue": color.FgBlue, - "magenta": color.FgMagenta, - "cyan": color.FgCyan, - "white": color.FgWhite, - - // attributes - "reset": color.Reset, - "bold": color.Bold, - "faint": color.Faint, - "italic": color.Italic, - "underline": color.Underline, - "blinkslow": color.BlinkSlow, - "blinkrapid": color.BlinkRapid, - "reversevideo": color.ReverseVideo, - "concealed": color.Concealed, - "crossedout": color.CrossedOut, - - // foreground text colors - "fgBlack": color.FgBlack, - "fgRed": color.FgRed, - "fgGreen": color.FgGreen, - "fgYellow": color.FgYellow, - "fgBlue": color.FgBlue, - "fgMagenta": color.FgMagenta, - "fgCyan": color.FgCyan, - "fgWhite": color.FgWhite, - - // foreground Hi-Intensity text colors - "fgHiBlack": color.FgHiBlack, - "fgHiRed": color.FgHiRed, - "fgHiGreen": color.FgHiGreen, - "fgHiYellow": color.FgHiYellow, - "fgHiBlue": color.FgHiBlue, - "fgHiMagenta": color.FgHiMagenta, - "fgHiCyan": color.FgHiCyan, - "fgHiWhite": color.FgHiWhite, - - // background text colors - "bgBlack": color.BgBlack, - "bgRed": color.BgRed, - "bgGreen": color.BgGreen, - "bgYellow": color.BgYellow, - "bgBlue": color.BgBlue, - "bgMagenta": color.BgMagenta, - "bgCyan": color.BgCyan, - "bgWhite": color.BgWhite, - - // background Hi-Intensity text colors - "bgHiBlack": color.BgHiBlack, - "bgHiRed": color.BgHiRed, - "bgHiGreen": color.BgHiGreen, - "bgHiYellow": color.BgHiYellow, - "bgHiBlue": color.BgHiBlue, - "bgHiMagenta": color.BgHiMagenta, - "bgHiCyan": color.BgHiCyan, - "bgHiWhite": color.BgHiWhite, -} - -// validColor will make sure the given color is actually allowed. -func validColor(c string) bool { - return validColors[c] -} - -// Spinner struct to hold the provided options. -type Spinner struct { - mu *sync.RWMutex - Delay time.Duration // Delay is the speed of the indicator - chars []string // chars holds the chosen character set - Prefix string // Prefix is the text preppended to the indicator - Suffix string // Suffix is the text appended to the indicator - FinalMSG string // string displayed after Stop() is called - lastOutputPlain string // last character(set) written - LastOutput string // last character(set) written with colors - color func(a ...interface{}) string // default color is white - Writer io.Writer // to make testing better, exported so users have access. Use `WithWriter` to update after initialization. - WriterFile *os.File // writer as file to allow terminal check - active bool // active holds the state of the spinner - enabled bool // indicates whether the spinner is enabled or not - stopChan chan struct{} // stopChan is a channel used to stop the indicator - HideCursor bool // hideCursor determines if the cursor is visible - PreUpdate func(s *Spinner) // will be triggered before every spinner update - PostUpdate func(s *Spinner) // will be triggered after every spinner update -} - -// New provides a pointer to an instance of Spinner with the supplied options. -func New(cs []string, d time.Duration, options ...Option) *Spinner { - s := &Spinner{ - Delay: d, - chars: cs, - color: color.New(color.FgWhite).SprintFunc(), - mu: &sync.RWMutex{}, - Writer: color.Output, - WriterFile: os.Stdout, // matches color.Output - stopChan: make(chan struct{}, 1), - active: false, - enabled: true, - HideCursor: true, - } - - for _, option := range options { - option(s) - } - - return s -} - -// Option is a function that takes a spinner and applies -// a given configuration. -type Option func(*Spinner) - -// Options contains fields to configure the spinner. -type Options struct { - Color string - Suffix string - FinalMSG string - HideCursor bool -} - -// WithColor adds the given color to the spinner. -func WithColor(color string) Option { - return func(s *Spinner) { - s.Color(color) - } -} - -// WithSuffix adds the given string to the spinner -// as the suffix. -func WithSuffix(suffix string) Option { - return func(s *Spinner) { - s.Suffix = suffix - } -} - -// WithFinalMSG adds the given string ot the spinner -// as the final message to be written. -func WithFinalMSG(finalMsg string) Option { - return func(s *Spinner) { - s.FinalMSG = finalMsg - } -} - -// WithHiddenCursor hides the cursor -// if hideCursor = true given. -func WithHiddenCursor(hideCursor bool) Option { - return func(s *Spinner) { - s.HideCursor = hideCursor - } -} - -// WithWriter adds the given writer to the spinner. This -// function should be favored over directly assigning to -// the struct value. Assumes it is not working on a terminal -// since it cannot determine from io.Writer. Use WithWriterFile -// to support terminal checks. -func WithWriter(w io.Writer) Option { - return func(s *Spinner) { - s.mu.Lock() - s.Writer = w - s.WriterFile = os.Stdout // emulate previous behavior for terminal check - s.mu.Unlock() - } -} - -// WithWriterFile adds the given writer to the spinner. This -// function should be favored over directly assigning to -// the struct value. Unlike WithWriter, this function allows -// us to check if displaying to a terminal (enable spinning) or -// not (disable spinning). Supersedes WithWriter() -func WithWriterFile(f *os.File) Option { - return func(s *Spinner) { - s.mu.Lock() - s.Writer = f // io.Writer for actual writing - s.WriterFile = f // file used only for terminal check - s.mu.Unlock() - } -} - -// Active will return whether or not the spinner is currently active. -func (s *Spinner) Active() bool { - return s.active -} - -// Enabled returns whether or not the spinner is enabled. -func (s *Spinner) Enabled() bool { - return s.enabled -} - -// Enable enables and restarts the spinner -func (s *Spinner) Enable() { - s.enabled = true - s.Restart() -} - -// Disable stops and disables the spinner -func (s *Spinner) Disable() { - s.enabled = false - s.Stop() -} - -// Start will start the indicator. -func (s *Spinner) Start() { - s.mu.Lock() - if s.active || !s.enabled || !isRunningInTerminal(s) { - s.mu.Unlock() - return - } - if s.HideCursor && !isWindowsTerminalOnWindows { - // hides the cursor - fmt.Fprint(s.Writer, "\033[?25l") - } - // Disable colors for simple Windows CMD or Powershell - // as they can not recognize them - if isWindows && !isWindowsTerminalOnWindows { - color.NoColor = true - } - - s.active = true - s.mu.Unlock() - - go func() { - for { - for i := 0; i < len(s.chars); i++ { - select { - case <-s.stopChan: - return - default: - s.mu.Lock() - if !s.active { - s.mu.Unlock() - return - } - if !isWindowsTerminalOnWindows { - s.erase() - } - - if s.PreUpdate != nil { - s.PreUpdate(s) - } - - var outColor string - if isWindows { - if s.Writer == os.Stderr { - outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.chars[i], s.Suffix) - } else { - outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.color(s.chars[i]), s.Suffix) - } - } else { - outColor = fmt.Sprintf("\r%s%s%s", s.Prefix, s.color(s.chars[i]), s.Suffix) - } - outPlain := fmt.Sprintf("\r%s%s%s", s.Prefix, s.chars[i], s.Suffix) - fmt.Fprint(s.Writer, outColor) - s.lastOutputPlain = outPlain - s.LastOutput = outColor - delay := s.Delay - - if s.PostUpdate != nil { - s.PostUpdate(s) - } - - s.mu.Unlock() - time.Sleep(delay) - } - } - } - }() -} - -// Stop stops the indicator. -func (s *Spinner) Stop() { - s.mu.Lock() - defer s.mu.Unlock() - if s.active { - s.active = false - if s.HideCursor && !isWindowsTerminalOnWindows { - // makes the cursor visible - fmt.Fprint(s.Writer, "\033[?25h") - } - s.erase() - if s.FinalMSG != "" { - if isWindowsTerminalOnWindows { - fmt.Fprint(s.Writer, "\r", s.FinalMSG) - } else { - fmt.Fprint(s.Writer, s.FinalMSG) - } - } - s.stopChan <- struct{}{} - } -} - -// Restart will stop and start the indicator. -func (s *Spinner) Restart() { - s.Stop() - s.Start() -} - -// Reverse will reverse the order of the slice assigned to the indicator. -func (s *Spinner) Reverse() { - s.mu.Lock() - for i, j := 0, len(s.chars)-1; i < j; i, j = i+1, j-1 { - s.chars[i], s.chars[j] = s.chars[j], s.chars[i] - } - s.mu.Unlock() -} - -// Color will set the struct field for the given color to be used. The spinner -// will need to be explicitly restarted. -func (s *Spinner) Color(colors ...string) error { - colorAttributes := make([]color.Attribute, len(colors)) - - // Verify colours are valid and place the appropriate attribute in the array - for index, c := range colors { - if !validColor(c) { - return errInvalidColor - } - colorAttributes[index] = colorAttributeMap[c] - } - - s.mu.Lock() - s.color = color.New(colorAttributes...).SprintFunc() - s.mu.Unlock() - return nil -} - -// UpdateSpeed will set the indicator delay to the given value. -func (s *Spinner) UpdateSpeed(d time.Duration) { - s.mu.Lock() - s.Delay = d - s.mu.Unlock() -} - -// UpdateCharSet will change the current character set to the given one. -func (s *Spinner) UpdateCharSet(cs []string) { - s.mu.Lock() - s.chars = cs - s.mu.Unlock() -} - -// erase deletes written characters on the current line. -// Caller must already hold s.lock. -func (s *Spinner) erase() { - n := utf8.RuneCountInString(s.lastOutputPlain) - if runtime.GOOS == "windows" && !isWindowsTerminalOnWindows { - clearString := "\r" + strings.Repeat(" ", n) + "\r" - fmt.Fprint(s.Writer, clearString) - s.lastOutputPlain = "" - return - } - - numberOfLinesToErase := computeNumberOfLinesNeededToPrintString(s.lastOutputPlain) - - // Taken from https://en.wikipedia.org/wiki/ANSI_escape_code: - // \r - Carriage return - Moves the cursor to column zero - // \033[K - Erases part of the line. If n is 0 (or missing), clear from - // cursor to the end of the line. If n is 1, clear from cursor to beginning - // of the line. If n is 2, clear entire line. Cursor position does not - // change. - // \033[F - Go to the beginning of previous line - eraseCodeString := strings.Builder{} - // current position is at the end of the last printed line. Start by erasing current line - eraseCodeString.WriteString("\r\033[K") // start by erasing current line - for i := 1; i < numberOfLinesToErase; i++ { - // For each additional lines, go up one line and erase it. - eraseCodeString.WriteString("\033[F\033[K") - } - fmt.Fprintf(s.Writer, eraseCodeString.String()) - s.lastOutputPlain = "" -} - -// Lock allows for manual control to lock the spinner. -func (s *Spinner) Lock() { - s.mu.Lock() -} - -// Unlock allows for manual control to unlock the spinner. -func (s *Spinner) Unlock() { - s.mu.Unlock() -} - -// GenerateNumberSequence will generate a slice of integers at the -// provided length and convert them each to a string. -func GenerateNumberSequence(length int) []string { - numSeq := make([]string, length) - for i := 0; i < length; i++ { - numSeq[i] = strconv.Itoa(i) - } - return numSeq -} - -// isRunningInTerminal check if the writer file descriptor is a terminal -func isRunningInTerminal(s *Spinner) bool { - return isatty.IsTerminal(s.WriterFile.Fd()) -} - -func computeNumberOfLinesNeededToPrintString(linePrinted string) int { - terminalWidth := math.MaxInt // assume infinity by default to keep behaviour consistent with what we had before - if term.IsTerminal(0) { - if width, _, err := term.GetSize(0); err == nil { - terminalWidth = width - } - } - return computeNumberOfLinesNeededToPrintStringInternal(linePrinted, terminalWidth) -} - -// isAnsiMarker returns if a rune denotes the start of an ANSI sequence -func isAnsiMarker(r rune) bool { - return r == '\x1b' -} - -// isAnsiTerminator returns if a rune denotes the end of an ANSI sequence -func isAnsiTerminator(r rune) bool { - return (r >= 0x40 && r <= 0x5a) || (r == 0x5e) || (r >= 0x60 && r <= 0x7e) -} - -// computeLineWidth returns the displayed width of a line -func computeLineWidth(line string) int { - width := 0 - ansi := false - - for _, r := range []rune(line) { - // increase width only when outside of ANSI escape sequences - if ansi || isAnsiMarker(r) { - ansi = !isAnsiTerminator(r) - } else { - width += utf8.RuneLen(r) - } - } - - return width -} - -func computeNumberOfLinesNeededToPrintStringInternal(linePrinted string, maxLineWidth int) int { - lineCount := 0 - for _, line := range strings.Split(linePrinted, "\n") { - lineCount += 1 - - lineWidth := computeLineWidth(line) - if lineWidth > maxLineWidth { - lineCount += int(float64(lineWidth) / float64(maxLineWidth)) - } - } - - return lineCount -} diff --git a/vendor/github.com/bufbuild/buf/LICENSE b/vendor/github.com/bufbuild/buf/LICENSE deleted file mode 100644 index 04cf1e316a..0000000000 --- a/vendor/github.com/bufbuild/buf/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020-2022 Buf Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/bufbuild/buf/cmd/buf/main.go b/vendor/github.com/bufbuild/buf/cmd/buf/main.go deleted file mode 100644 index 9111c1accd..0000000000 --- a/vendor/github.com/bufbuild/buf/cmd/buf/main.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package main - -import "github.com/bufbuild/buf/private/buf/cmd/buf" - -func main() { - buf.Main("buf") -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufapp/bufapp.go b/vendor/github.com/bufbuild/buf/private/buf/bufapp/bufapp.go deleted file mode 100644 index c8f4beb2c0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufapp/bufapp.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufapp - -import ( - "crypto/tls" - "fmt" - - "github.com/bufbuild/buf/private/pkg/app/appname" - "github.com/bufbuild/buf/private/pkg/cert/certclient" -) - -const currentVersion = "v1" - -// ExternalConfig is an external config. -type ExternalConfig struct { - // If editing ExternalConfig, make sure to update ExternalConfig.IsEmpty! - - Version string `json:"version,omitempty" yaml:"version,omitempty"` - TLS certclient.ExternalClientTLSConfig `json:"tls,omitempty" yaml:"tls,omitempty"` -} - -// IsEmpty returns true if the externalConfig is empty. -func (e ExternalConfig) IsEmpty() bool { - return e.Version == "" && e.TLS.IsEmpty() -} - -// Config is a config. -type Config struct { - TLS *tls.Config -} - -// NewConfig returns a new Config for the ExternalConfig. -func NewConfig( - container appname.Container, - externalConfig ExternalConfig, -) (*Config, error) { - if externalConfig.Version != currentVersion && !externalConfig.IsEmpty() { - return nil, fmt.Errorf("buf configuration at %q must declare 'version: %s'", container.ConfigDirPath(), currentVersion) - } - tlsConfig, err := certclient.NewClientTLSConfig(container, externalConfig.TLS) - if err != nil { - return nil, err - } - return &Config{ - TLS: tlsConfig, - }, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufapp/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufapp/usage.gen.go deleted file mode 100644 index 7d4be74f95..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufapp/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufapp - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcli/bufcli.go b/vendor/github.com/bufbuild/buf/private/buf/bufcli/bufcli.go deleted file mode 100644 index fee41c90ba..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcli/bufcli.go +++ /dev/null @@ -1,1060 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcli - -import ( - "bufio" - "context" - "errors" - "fmt" - "io" - "net/http" - "os" - "strings" - - "github.com/bufbuild/buf/private/buf/bufapp" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufwire" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufapimodule" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/buftransport" - "github.com/bufbuild/buf/private/gen/data/datawkt" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/app/appname" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/httpauth" - "github.com/bufbuild/buf/private/pkg/netrc" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/buf/private/pkg/transport/http/httpclient" - "github.com/bufbuild/connect-go" - otelconnect "github.com/bufbuild/connect-opentelemetry-go" - "github.com/spf13/pflag" - "go.uber.org/zap" - "golang.org/x/term" -) - -const ( - // Version is the CLI version of buf. - Version = "1.24.0" - - inputHTTPSUsernameEnvKey = "BUF_INPUT_HTTPS_USERNAME" - inputHTTPSPasswordEnvKey = "BUF_INPUT_HTTPS_PASSWORD" - inputSSHKeyFileEnvKey = "BUF_INPUT_SSH_KEY_FILE" - inputSSHKnownHostsFilesEnvKey = "BUF_INPUT_SSH_KNOWN_HOSTS_FILES" - - alphaSuppressWarningsEnvKey = "BUF_ALPHA_SUPPRESS_WARNINGS" - betaSuppressWarningsEnvKey = "BUF_BETA_SUPPRESS_WARNINGS" - - // AlphaEnableWASMEnvKey is an env var to enable WASM local plugin execution - AlphaEnableWASMEnvKey = "BUF_ALPHA_ENABLE_WASM" - - inputHashtagFlagName = "__hashtag__" - inputHashtagFlagShortName = "#" - - userPromptAttempts = 3 - - publicVisibility = "public" - privateVisibility = "private" - - // WASMCompilationCacheDir compiled WASM plugin cache directory - WASMCompilationCacheDir = "wasmplugin-bin" -) - -var ( - // defaultHTTPClient is the client we use for HTTP requests. - // Timeout should be set through context for calls to ImageConfigReader, not through http.Client - defaultHTTPClient = &http.Client{} - // defaultHTTPAuthenticator is the default authenticator - // used for HTTP requests. - defaultHTTPAuthenticator = httpauth.NewMultiAuthenticator( - httpauth.NewNetrcAuthenticator(), - // must keep this for legacy purposes - httpauth.NewEnvAuthenticator( - inputHTTPSPasswordEnvKey, - inputHTTPSPasswordEnvKey, - ), - ) - // defaultGitClonerOptions defines the default git clone options. - defaultGitClonerOptions = git.ClonerOptions{ - HTTPSUsernameEnvKey: inputHTTPSUsernameEnvKey, - HTTPSPasswordEnvKey: inputHTTPSPasswordEnvKey, - SSHKeyFileEnvKey: inputSSHKeyFileEnvKey, - SSHKnownHostsFilesEnvKey: inputSSHKnownHostsFilesEnvKey, - } - - // AllCacheModuleRelDirPaths are all directory paths for all time concerning the module cache. - // - // These are normalized. - // These are relative to container.CacheDirPath(). - // - // This variable is used for clearing the cache. - AllCacheModuleRelDirPaths = []string{ - v1beta1CacheModuleDataRelDirPath, - v1beta1CacheModuleLockRelDirPath, - v1CacheModuleDataRelDirPath, - v1CacheModuleLockRelDirPath, - v1CacheModuleSumRelDirPath, - v2CacheModuleRelDirPath, - } - - // ErrNotATTY is returned when an input io.Reader is not a TTY where it is expected. - ErrNotATTY = errors.New("reader was not a TTY as expected") - - // v1CacheModuleDataRelDirPath is the relative path to the cache directory where module data - // was stored in v1beta1. - // - // Normalized. - v1beta1CacheModuleDataRelDirPath = "mod" - - // v1CacheModuleLockRelDirPath is the relative path to the cache directory where module lock files - // were stored in v1beta1. - // - // Normalized. - v1beta1CacheModuleLockRelDirPath = normalpath.Join("lock", "mod") - - // v1CacheModuleDataRelDirPath is the relative path to the cache directory where module data is stored. - // - // Normalized. - // This is where the actual "clones" of the modules are located. - v1CacheModuleDataRelDirPath = normalpath.Join("v1", "module", "data") - // v1CacheModuleLockRelDirPath is the relative path to the cache directory where module lock files are stored. - // - // Normalized. - // These lock files are used to make sure that multiple buf processes do not corrupt the cache. - v1CacheModuleLockRelDirPath = normalpath.Join("v1", "module", "lock") - // v1CacheModuleSumRelDirPath is the relative path to the cache directory where module digests are stored. - // - // Normalized. - // These digests are used to make sure that the data written is actually what we expect, and if it is not, - // we clear an entry from the cache, i.e. delete the relevant data directory. - v1CacheModuleSumRelDirPath = normalpath.Join("v1", "module", "sum") - // v2CacheModuleRelDirPath is the relative path to the cache directory for content addressable storage. - // - // Normalized. - // This directory replaces the use of v1CacheModuleDataRelDirPath, v1CacheModuleLockRelDirPath, and - // v1CacheModuleSumRelDirPath with a cache implementation using content addressable storage. - v2CacheModuleRelDirPath = normalpath.Join("v2", "module") - - // allVisibiltyStrings are the possible options that a user can set the visibility flag with. - allVisibiltyStrings = []string{ - publicVisibility, - privateVisibility, - } -) - -// BindAsFileDescriptorSet binds the exclude-imports flag. -func BindAsFileDescriptorSet(flagSet *pflag.FlagSet, addr *bool, flagName string) { - flagSet.BoolVar( - addr, - flagName, - false, - `Output as a google.protobuf.FileDescriptorSet instead of an image -Note that images are wire compatible with FileDescriptorSets, but this flag strips -the additional metadata added for Buf usage`, - ) -} - -// BindExcludeImports binds the exclude-imports flag. -func BindExcludeImports(flagSet *pflag.FlagSet, addr *bool, flagName string) { - flagSet.BoolVar( - addr, - flagName, - false, - "Exclude imports.", - ) -} - -// BindExcludeSourceInfo binds the exclude-source-info flag. -func BindExcludeSourceInfo(flagSet *pflag.FlagSet, addr *bool, flagName string) { - flagSet.BoolVar( - addr, - flagName, - false, - "Exclude source info", - ) -} - -// BindPaths binds the paths flag. -func BindPaths( - flagSet *pflag.FlagSet, - pathsAddr *[]string, - pathsFlagName string, -) { - flagSet.StringSliceVar( - pathsAddr, - pathsFlagName, - nil, - `Limit to specific files or directories, e.g. "proto/a/a.proto", "proto/a" -If specified multiple times, the union is taken`, - ) -} - -// BindInputHashtag binds the input hashtag flag. -// -// This needs to be added to any command that has the input as the first argument. -// This deals with the situation "buf build -#format=json" which results in -// a parse error from pflag. -func BindInputHashtag(flagSet *pflag.FlagSet, addr *string) { - flagSet.StringVarP( - addr, - inputHashtagFlagName, - inputHashtagFlagShortName, - "", - "", - ) - _ = flagSet.MarkHidden(inputHashtagFlagName) -} - -// BindExcludePaths binds the exclude-path flag. -func BindExcludePaths( - flagSet *pflag.FlagSet, - excludePathsAddr *[]string, - excludePathsFlagName string, -) { - flagSet.StringSliceVar( - excludePathsAddr, - excludePathsFlagName, - nil, - `Exclude specific files or directories, e.g. "proto/a/a.proto", "proto/a" -If specified multiple times, the union is taken`, - ) -} - -// BindDisableSymlinks binds the disable-symlinks flag. -func BindDisableSymlinks(flagSet *pflag.FlagSet, addr *bool, flagName string) { - flagSet.BoolVar( - addr, - flagName, - false, - `Do not follow symlinks when reading sources or configuration from the local filesystem -By default, symlinks are followed in this CLI, but never followed on the Buf Schema Registry`, - ) -} - -// BindVisibility binds the visibility flag. -func BindVisibility(flagSet *pflag.FlagSet, addr *string, flagName string) { - flagSet.StringVar( - addr, - flagName, - "", - fmt.Sprintf(`The repository's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibiltyStrings)), - ) -} - -// BindCreateVisibility binds the create-visibility flag. Kept in this package -// so we can keep allVisibilityStrings private. -func BindCreateVisibility(flagSet *pflag.FlagSet, addr *string, flagName string, createFlagName string) { - flagSet.StringVar( - addr, - flagName, - "", - fmt.Sprintf(`The repository's visibility setting, if created. Must be set if --%s is set. Must be one of %s`, createFlagName, stringutil.SliceToString(allVisibiltyStrings)), - ) -} - -// GetInputLong gets the long command description for an input-based command. -func GetInputLong(inputArgDescription string) string { - return fmt.Sprintf( - `The first argument is %s. -The first argument must be one of format %s. -Defaults to "." if no argument is specified.`, - inputArgDescription, - buffetch.AllFormatsString, - ) -} - -// GetSourceLong gets the long command description for an input-based command. -func GetSourceLong(inputArgDescription string) string { - return fmt.Sprintf( - `The first argument is %s. -The first argument must be one of format %s. -Defaults to "." if no argument is specified.`, - inputArgDescription, - buffetch.SourceFormatsString, - ) -} - -// GetSourceDirLong gets the long command description for a directory-based command. -func GetSourceDirLong(inputArgDescription string) string { - return fmt.Sprintf( - `The first argument is %s. -The first argument must be one of format %s. -Defaults to "." if no argument is specified.`, - inputArgDescription, - buffetch.SourceDirFormatsString, - ) -} - -// GetSourceOrModuleLong gets the long command description for an input-based command. -func GetSourceOrModuleLong(inputArgDescription string) string { - return fmt.Sprintf( - `The first argument is %s. -The first argument must be one of format %s. -Defaults to "." if no argument is specified.`, - inputArgDescription, - buffetch.SourceOrModuleFormatsString, - ) -} - -// GetInputValue gets the first arg. -// -// Also parses the special input hashtag flag that deals with the situation "buf build -#format=json". -// The existence of 0 or 1 args should be handled by the Args field on Command. -func GetInputValue( - container app.ArgContainer, - inputHashtag string, - defaultValue string, -) (string, error) { - var arg string - switch numArgs := container.NumArgs(); numArgs { - case 0: - if inputHashtag != "" { - arg = "-#" + inputHashtag - } - case 1: - arg = container.Arg(0) - if arg == "" { - return "", errors.New("first argument is present but empty") - } - // if arg is non-empty and inputHashtag is non-empty, this means two arguments were specified - if inputHashtag != "" { - return "", errors.New("only 1 argument allowed but 2 arguments specified") - } - default: - return "", fmt.Errorf("only 1 argument allowed but %d arguments specified", numArgs) - } - if arg != "" { - return arg, nil - } - return defaultValue, nil -} - -// WarnAlphaCommand prints a warning for a alpha command unless the alphaSuppressWarningsEnvKey -// environment variable is set. -func WarnAlphaCommand(_ context.Context, container appflag.Container) { - if container.Env(alphaSuppressWarningsEnvKey) == "" { - container.Logger().Warn("This command is in alpha. It is hidden for a reason. This command is purely for development purposes, and may never even be promoted to beta, do not rely on this command's functionality. To suppress this warning, set " + alphaSuppressWarningsEnvKey + "=1") - } -} - -// WarnBetaCommand prints a warning for a beta command unless the betaSuppressWarningsEnvKey -// environment variable is set. -func WarnBetaCommand(_ context.Context, container appflag.Container) { - if container.Env(betaSuppressWarningsEnvKey) == "" { - container.Logger().Warn("This command is in beta. It is unstable and likely to change. To suppress this warning, set " + betaSuppressWarningsEnvKey + "=1") - } -} - -// NewStorageosProvider returns a new storageos.Provider based on the value of the disable-symlinks flag. -func NewStorageosProvider(disableSymlinks bool) storageos.Provider { - if disableSymlinks { - return storageos.NewProvider() - } - return storageos.NewProvider(storageos.ProviderWithSymlinks()) -} - -// NewWireImageConfigReader returns a new ImageConfigReader. -func NewWireImageConfigReader( - container appflag.Container, - storageosProvider storageos.Provider, - runner command.Runner, - clientConfig *connectclient.Config, -) (bufwire.ImageConfigReader, error) { - logger := container.Logger() - moduleResolver := bufapimodule.NewModuleResolver( - logger, - bufapimodule.NewRepositoryCommitServiceClientFactory(clientConfig), - ) - moduleReader, err := NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return nil, err - } - return bufwire.NewImageConfigReader( - logger, - storageosProvider, - NewFetchReader(logger, storageosProvider, runner, moduleResolver, moduleReader), - bufmodulebuild.NewModuleBucketBuilder(), - bufimagebuild.NewBuilder(logger, moduleReader), - ), nil -} - -// NewWireModuleConfigReader returns a new ModuleConfigReader. -func NewWireModuleConfigReader( - container appflag.Container, - storageosProvider storageos.Provider, - runner command.Runner, - clientConfig *connectclient.Config, -) (bufwire.ModuleConfigReader, error) { - logger := container.Logger() - moduleResolver := bufapimodule.NewModuleResolver( - logger, - bufapimodule.NewRepositoryCommitServiceClientFactory(clientConfig), - ) - moduleReader, err := NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return nil, err - } - return bufwire.NewModuleConfigReader( - logger, - storageosProvider, - NewFetchReader(logger, storageosProvider, runner, moduleResolver, moduleReader), - bufmodulebuild.NewModuleBucketBuilder(), - ), nil -} - -// NewWireModuleConfigReaderForModuleReader returns a new ModuleConfigReader using -// the given ModuleReader. -func NewWireModuleConfigReaderForModuleReader( - container appflag.Container, - storageosProvider storageos.Provider, - runner command.Runner, - clientConfig *connectclient.Config, - moduleReader bufmodule.ModuleReader, -) (bufwire.ModuleConfigReader, error) { - logger := container.Logger() - moduleResolver := bufapimodule.NewModuleResolver( - logger, - bufapimodule.NewRepositoryCommitServiceClientFactory(clientConfig), - ) - return bufwire.NewModuleConfigReader( - logger, - storageosProvider, - NewFetchReader(logger, storageosProvider, runner, moduleResolver, moduleReader), - bufmodulebuild.NewModuleBucketBuilder(), - ), nil -} - -// NewWireFileLister returns a new FileLister. -func NewWireFileLister( - container appflag.Container, - storageosProvider storageos.Provider, - runner command.Runner, - clientConfig *connectclient.Config, -) (bufwire.FileLister, error) { - logger := container.Logger() - moduleResolver := bufapimodule.NewModuleResolver( - logger, - bufapimodule.NewRepositoryCommitServiceClientFactory(clientConfig), - ) - moduleReader, err := NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return nil, err - } - return bufwire.NewFileLister( - logger, - storageosProvider, - NewFetchReader(logger, storageosProvider, runner, moduleResolver, moduleReader), - bufmodulebuild.NewModuleBucketBuilder(), - bufimagebuild.NewBuilder(logger, moduleReader), - ), nil -} - -// NewWireImageReader returns a new ImageReader. -func NewWireImageReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, -) bufwire.ImageReader { - return bufwire.NewImageReader( - logger, - newFetchImageReader(logger, storageosProvider, runner), - ) -} - -// NewWireImageWriter returns a new ImageWriter. -func NewWireImageWriter( - logger *zap.Logger, -) bufwire.ImageWriter { - return bufwire.NewImageWriter( - logger, - buffetch.NewWriter( - logger, - ), - ) -} - -// NewWireProtoEncodingReader returns a new ProtoEncodingReader. -func NewWireProtoEncodingReader( - logger *zap.Logger, -) bufwire.ProtoEncodingReader { - return bufwire.NewProtoEncodingReader( - logger, - ) -} - -// NewWireProtoEncodingWriter returns a new ProtoEncodingWriter. -func NewWireProtoEncodingWriter( - logger *zap.Logger, -) bufwire.ProtoEncodingWriter { - return bufwire.NewProtoEncodingWriter( - logger, - ) -} - -// NewModuleReaderAndCreateCacheDirs returns a new ModuleReader while creating the -// required cache directories. -func NewModuleReaderAndCreateCacheDirs( - container appflag.Container, - clientConfig *connectclient.Config, -) (bufmodule.ModuleReader, error) { - return newModuleReaderAndCreateCacheDirs(container, clientConfig) -} - -func newModuleReaderAndCreateCacheDirs( - container appflag.Container, - clientConfig *connectclient.Config, -) (bufmodule.ModuleReader, error) { - cacheModuleDirPathV2 := normalpath.Join(container.CacheDirPath(), v2CacheModuleRelDirPath) - if err := checkExistingCacheDirs(container.CacheDirPath(), cacheModuleDirPathV2); err != nil { - return nil, err - } - if err := createCacheDirs(cacheModuleDirPathV2); err != nil { - return nil, err - } - delegateReader := bufapimodule.NewModuleReader( - bufapimodule.NewDownloadServiceClientFactory(clientConfig), - ) - repositoryClientFactory := bufmodulecache.NewRepositoryServiceClientFactory(clientConfig) - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - var moduleReader bufmodule.ModuleReader - casModuleBucket, err := storageosProvider.NewReadWriteBucket(cacheModuleDirPathV2) - if err != nil { - return nil, err - } - moduleReader = bufmodulecache.NewModuleReader( - container.Logger(), - container.VerbosePrinter(), - casModuleBucket, - delegateReader, - repositoryClientFactory, - ) - return moduleReader, nil -} - -// NewConfig creates a new Config. -func NewConfig(container appflag.Container) (*bufapp.Config, error) { - externalConfig := bufapp.ExternalConfig{} - if err := appname.ReadConfig(container, &externalConfig); err != nil { - return nil, err - } - return bufapp.NewConfig(container, externalConfig) -} - -// Returns a registry provider with the given options applied in addition to default ones for all providers -func newConnectClientConfigWithOptions(container appflag.Container, opts ...connectclient.ConfigOption) (*connectclient.Config, error) { - config, err := NewConfig(container) - if err != nil { - return nil, err - } - client := httpclient.NewClient(config.TLS) - options := []connectclient.ConfigOption{ - connectclient.WithAddressMapper(func(address string) string { - if config.TLS == nil { - return buftransport.PrependHTTP(address) - } - return buftransport.PrependHTTPS(address) - }), - connectclient.WithInterceptors([]connect.Interceptor{ - bufconnect.NewSetCLIVersionInterceptor(Version), - bufconnect.NewCLIWarningInterceptor(container), - otelconnect.NewInterceptor(), - }), - } - options = append(options, opts...) - - return connectclient.NewConfig(client, options...), nil -} - -// NewConnectClientConfig creates a new connect.ClientConfig which uses a token reader to look -// up the token in the container or in netrc based on the address of each individual client. -// It is then set in the header of all outgoing requests from clients created using this config. -func NewConnectClientConfig(container appflag.Container) (*connectclient.Config, error) { - envTokenProvider, err := bufconnect.NewTokenProviderFromContainer(container) - if err != nil { - return nil, err - } - netrcTokenProvider := bufconnect.NewNetrcTokenProvider(container, netrc.GetMachineForName) - return newConnectClientConfigWithOptions( - container, - connectclient.WithAuthInterceptorProvider( - bufconnect.NewAuthorizationInterceptorProvider(envTokenProvider, netrcTokenProvider), - ), - ) -} - -// NewConnectClientConfigWithToken creates a new connect.ClientConfig with a given token. The provided token is -// set in the header of all outgoing requests from this provider -func NewConnectClientConfigWithToken(container appflag.Container, token string) (*connectclient.Config, error) { - tokenProvider, err := bufconnect.NewTokenProviderFromString(token) - if err != nil { - return nil, err - } - return newConnectClientConfigWithOptions( - container, - connectclient.WithAuthInterceptorProvider( - bufconnect.NewAuthorizationInterceptorProvider(tokenProvider), - ), - ) -} - -// NewFetchReader creates a new buffetch.Reader with the default HTTP client -// and git cloner. -func NewFetchReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) buffetch.Reader { - return buffetch.NewReader( - logger, - storageosProvider, - defaultHTTPClient, - defaultHTTPAuthenticator, - git.NewCloner(logger, storageosProvider, runner, defaultGitClonerOptions), - moduleResolver, - moduleReader, - ) -} - -// PromptUserForDelete is used to receive user confirmation that a specific -// entity should be deleted. If the user's answer does not match the expected -// answer, an error is returned. -// ErrNotATTY is returned if the input containers Stdin is not a terminal. -func PromptUserForDelete(container app.Container, entityType string, expectedAnswer string) error { - confirmation, err := PromptUser( - container, - fmt.Sprintf( - "Please confirm that you want to DELETE this %s by entering its name (%s) again."+ - "\nWARNING: This action is NOT reversible!\n", - entityType, - expectedAnswer, - ), - ) - if err != nil { - if errors.Is(err, ErrNotATTY) { - return errors.New("cannot perform an interactive delete from a non-TTY device") - } - return err - } - if confirmation != expectedAnswer { - return fmt.Errorf( - "expected %q, but received %q", - expectedAnswer, - confirmation, - ) - } - return nil -} - -// PromptUser reads a line from Stdin, prompting the user with the prompt first. -// The prompt is repeatedly shown until the user provides a non-empty response. -// ErrNotATTY is returned if the input containers Stdin is not a terminal. -func PromptUser(container app.Container, prompt string) (string, error) { - return promptUser(container, prompt, false) -} - -// PromptUserForPassword reads a line from Stdin, prompting the user with the prompt first. -// The prompt is repeatedly shown until the user provides a non-empty response. -// ErrNotATTY is returned if the input containers Stdin is not a terminal. -func PromptUserForPassword(container app.Container, prompt string) (string, error) { - return promptUser(container, prompt, true) -} - -// BucketAndConfigForSource returns a bucket and config. The bucket contains -// just the files that constitute a module. It also checks if config -// exists and defines a module identity, returning ErrNoConfigFile and -// ErrNoModuleName respectfully. -// -// Workspaces are disabled when fetching the source. -func BucketAndConfigForSource( - ctx context.Context, - logger *zap.Logger, - container app.EnvStdinContainer, - storageosProvider storageos.Provider, - runner command.Runner, - source string, -) (storage.ReadBucketCloser, *bufconfig.Config, error) { - sourceRef, err := buffetch.NewSourceRefParser( - logger, - ).GetSourceRef( - ctx, - source, - ) - if err != nil { - return nil, nil, err - } - sourceBucket, err := newFetchSourceReader( - logger, - storageosProvider, - runner, - ).GetSourceBucket( - ctx, - container, - sourceRef, - buffetch.GetSourceBucketWithWorkspacesDisabled(), - ) - if err != nil { - return nil, nil, err - } - existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, sourceBucket) - if err != nil { - return nil, nil, NewInternalError(err) - } - if existingConfigFilePath == "" { - return nil, nil, ErrNoConfigFile - } - // TODO: This should just read a lock file - sourceConfig, err := bufconfig.GetConfigForBucket( - ctx, - sourceBucket, - ) - if err != nil { - return nil, nil, err - } - if sourceConfig.ModuleIdentity == nil { - return nil, nil, ErrNoModuleName - } - - return sourceBucket, sourceConfig, nil -} - -// NewImageForSource resolves a single bufimage.Image from the user-provided source with the build options. -func NewImageForSource( - ctx context.Context, - container appflag.Container, - source string, - errorFormat string, - disableSymlinks bool, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, -) (bufimage.Image, error) { - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, source) - if err != nil { - return nil, err - } - storageosProvider := NewStorageosProvider(disableSymlinks) - runner := command.NewRunner() - clientConfig, err := NewConnectClientConfig(container) - if err != nil { - return nil, err - } - imageConfigReader, err := NewWireImageConfigReader( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return nil, err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - excludeSourceCodeInfo, - ) - if err != nil { - return nil, err - } - if len(fileAnnotations) > 0 { - // stderr since we do output to stdout potentially - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - errorFormat, - ); err != nil { - return nil, err - } - return nil, ErrFileAnnotation - } - images := make([]bufimage.Image, 0, len(imageConfigs)) - for _, imageConfig := range imageConfigs { - images = append(images, imageConfig.Image()) - } - return bufimage.MergeImages(images...) -} - -// WellKnownTypeImage returns the image for the well known type (google.protobuf.Duration for example). -func WellKnownTypeImage(ctx context.Context, logger *zap.Logger, wellKnownType string) (bufimage.Image, error) { - sourceConfig, err := bufconfig.GetConfigForBucket( - ctx, - storage.NopReadBucketCloser(datawkt.ReadBucket), - ) - if err != nil { - return nil, err - } - - module, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - datawkt.ReadBucket, - sourceConfig.Build, - ) - if err != nil { - return nil, err - } - image, _, err := bufimagebuild.NewBuilder(logger, bufmodule.NewNopModuleReader()).Build(ctx, module) - if err != nil { - return nil, err - } - return bufimageutil.ImageFilteredByTypes(image, wellKnownType) -} - -// VisibilityFlagToVisibility parses the given string as a registryv1alpha1.Visibility. -func VisibilityFlagToVisibility(visibility string) (registryv1alpha1.Visibility, error) { - switch visibility { - case publicVisibility: - return registryv1alpha1.Visibility_VISIBILITY_PUBLIC, nil - case privateVisibility: - return registryv1alpha1.Visibility_VISIBILITY_PRIVATE, nil - default: - return 0, fmt.Errorf("invalid visibility: %s, expected one of %s", visibility, stringutil.SliceToString(allVisibiltyStrings)) - } -} - -// VisibilityFlagToVisibilityAllowUnspecified parses the given string as a registryv1alpha1.Visibility, -// where an empty string will be parsed as unspecified -func VisibilityFlagToVisibilityAllowUnspecified(visibility string) (registryv1alpha1.Visibility, error) { - switch visibility { - case publicVisibility: - return registryv1alpha1.Visibility_VISIBILITY_PUBLIC, nil - case privateVisibility: - return registryv1alpha1.Visibility_VISIBILITY_PRIVATE, nil - case "": - return registryv1alpha1.Visibility_VISIBILITY_UNSPECIFIED, nil - default: - return 0, fmt.Errorf("invalid visibility: %s", visibility) - } -} - -// IsAlphaWASMEnabled returns an BUF_ALPHA_ENABLE_WASM is set to true. -func IsAlphaWASMEnabled(container app.EnvContainer) (bool, error) { - return app.EnvBool(container, AlphaEnableWASMEnvKey, false) -} - -// ValidateErrorFormatFlag validates the error format flag for all commands but lint. -func ValidateErrorFormatFlag(errorFormatString string, errorFormatFlagName string) error { - return validateErrorFormatFlag(bufanalysis.AllFormatStrings, errorFormatString, errorFormatFlagName) -} - -// ValidateErrorFormatFlagLint validates the error format flag for lint. -func ValidateErrorFormatFlagLint(errorFormatString string, errorFormatFlagName string) error { - return validateErrorFormatFlag(buflint.AllFormatStrings, errorFormatString, errorFormatFlagName) -} - -// PackageVersionShortDescription returns the long description for the -version command. -func PackageVersionShortDescription(name string) string { - return fmt.Sprintf("Resolve module and %s plugin reference to a specific remote package version", name) -} - -// PackageVersionLongDescription returns the long description for the -version command. -func PackageVersionLongDescription(registryName, commandName, examplePlugin string) string { - return fmt.Sprintf(`This command returns the version of the %s asset to be used with the %s registry. -Examples: - -Get the version of the eliza module and the %s plugin for use with %s. - $ buf alpha package %s --module=buf.build/bufbuild/eliza --plugin=%s - v1.7.0-20230609151053-e682db0d9918.1 - -Use a specific module version and plugin version. - $ buf alpha package %s --module=buf.build/bufbuild/eliza:e682db0d99184be88b41c4405ea8a417 --plugin=%s:v1.0.0 - v1.0.0-20230609151053-e682db0d9918.1 -`, registryName, registryName, examplePlugin, registryName, commandName, examplePlugin, commandName, examplePlugin) -} - -// SelectReferenceForRemote receives a list of module references and selects one for remote -// operations. In most cases, all references will have the same remote, which will result in the -// first reference being selected. In cases in which there is a mix of remotes, the first reference -// with a remote different than "buf.build" will be selected. This func is useful for targeting -// single-tenant BSR addresses. -func SelectReferenceForRemote(references []bufmoduleref.ModuleReference) bufmoduleref.ModuleReference { - if len(references) == 0 { - return nil - } - for _, ref := range references { - if ref == nil { - continue - } - if ref.Remote() != bufconnect.DefaultRemote { - return ref - } - } - return references[0] -} - -func validateErrorFormatFlag(validFormatStrings []string, errorFormatString string, errorFormatFlagName string) error { - for _, formatString := range validFormatStrings { - if errorFormatString == formatString { - return nil - } - } - return appcmd.NewInvalidArgumentErrorf("--%s: invalid format: %q", errorFormatFlagName, errorFormatString) -} - -// promptUser reads a line from Stdin, prompting the user with the prompt first. -// The prompt is repeatedly shown until the user provides a non-empty response. -// ErrNotATTY is returned if the input containers Stdin is not a terminal. -func promptUser(container app.Container, prompt string, isPassword bool) (string, error) { - file, ok := container.Stdin().(*os.File) - if !ok || !term.IsTerminal(int(file.Fd())) { - return "", ErrNotATTY - } - var attempts int - for attempts < userPromptAttempts { - attempts++ - if _, err := fmt.Fprint( - container.Stdout(), - prompt, - ); err != nil { - return "", NewInternalError(err) - } - var value string - if isPassword { - data, err := term.ReadPassword(int(file.Fd())) - if err != nil { - // If the user submitted an EOF (e.g. via ^D) then we - // should not treat it as an internal error; returning - // the error directly makes it more clear as to - // why the command failed. - if errors.Is(err, io.EOF) { - return "", err - } - return "", NewInternalError(err) - } - value = string(data) - } else { - scanner := bufio.NewScanner(container.Stdin()) - if !scanner.Scan() { - // scanner.Err() returns nil on EOF. - if err := scanner.Err(); err != nil { - return "", NewInternalError(err) - } - return "", io.EOF - } - value = scanner.Text() - if err := scanner.Err(); err != nil { - return "", NewInternalError(err) - } - } - if len(strings.TrimSpace(value)) != 0 { - // We want to preserve spaces in user input, so we only apply - // strings.TrimSpace to verify an answer was provided. - return value, nil - } - if attempts < userPromptAttempts { - // We only want to ask the user to try again if they actually - // have another attempt. - if _, err := fmt.Fprintln( - container.Stdout(), - "No answer was provided. Please try again.", - ); err != nil { - return "", NewInternalError(err) - } - } - } - return "", NewTooManyEmptyAnswersError(userPromptAttempts) -} - -// newFetchSourceReader creates a new buffetch.SourceReader with the default HTTP client -// and git cloner. -func newFetchSourceReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, -) buffetch.SourceReader { - return buffetch.NewSourceReader( - logger, - storageosProvider, - defaultHTTPClient, - defaultHTTPAuthenticator, - git.NewCloner(logger, storageosProvider, runner, defaultGitClonerOptions), - ) -} - -// newFetchImageReader creates a new buffetch.ImageReader with the default HTTP client -// and git cloner. -func newFetchImageReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, -) buffetch.ImageReader { - return buffetch.NewImageReader( - logger, - storageosProvider, - defaultHTTPClient, - defaultHTTPAuthenticator, - git.NewCloner(logger, storageosProvider, runner, defaultGitClonerOptions), - ) -} - -func checkExistingCacheDirs(baseCacheDirPath string, dirPaths ...string) error { - dirPathsToCheck := make([]string, 0, len(dirPaths)+1) - // Check base cache directory in addition to subdirectories - dirPathsToCheck = append(dirPathsToCheck, baseCacheDirPath) - dirPathsToCheck = append(dirPathsToCheck, dirPaths...) - for _, dirPath := range dirPathsToCheck { - dirPath = normalpath.Unnormalize(dirPath) - // OK to use os.Stat instead of os.LStat here as this is CLI-only - fileInfo, err := os.Stat(dirPath) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - if !fileInfo.IsDir() { - return fmt.Errorf("Expected %q to be a directory. This is used for buf's cache. You can override the base cache directory %q by setting the $BUF_CACHE_DIR environment variable.", dirPath, baseCacheDirPath) - } - if fileInfo.Mode().Perm()&0700 != 0700 { - return fmt.Errorf("Expected %q to be a writeable directory. This is used for buf's cache. You can override the base cache directory %q by setting the $BUF_CACHE_DIR environment variable.", dirPath, baseCacheDirPath) - } - } - return nil -} - -func createCacheDirs(dirPaths ...string) error { - for _, dirPath := range dirPaths { - // os.MkdirAll does nothing if the directory already exists - if err := os.MkdirAll(normalpath.Unnormalize(dirPath), 0755); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcli/errors.go b/vendor/github.com/bufbuild/buf/private/buf/bufcli/errors.go deleted file mode 100644 index 8da9acb7b3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcli/errors.go +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcli - -import ( - "context" - "errors" - "fmt" - "net" - - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/connect-go" -) - -const ( - // ExitCodeFileAnnotation is the exit code used when we print file annotations. - // - // We use a different exit code to be able to distinguish user-parsable errors from - // system errors. - ExitCodeFileAnnotation = 100 -) - -var ( - // ErrNoModuleName is used when the user does not specify a module name in their configuration file. - ErrNoModuleName = errors.New(`please specify a module name in your configuration file with the "name" key`) - - // ErrNoConfigFile is used when the user tries to execute a command without a configuration file. - ErrNoConfigFile = errors.New(`please define a configuration file in the current directory; you can create one by running "buf mod init"`) - - // ErrFileAnnotation is used when we print file annotations and want to return an error. - // - // The app package works on the concept that an error results in a non-zero exit - // code, and we already print the messages with PrintFileAnnotations, so we do - // not want to print any additional error message. - // - // We also exit with 100 to be able to distinguish user-parsable errors from - // system errors. - ErrFileAnnotation = app.NewError(ExitCodeFileAnnotation, "") -) - -// errInternal is returned when the user encounters an unexpected internal buf error. -type errInternal struct { - cause error -} - -// NewInternalError represents an internal error encountered by the buf CLI. -// These errors should not happen and therefore warrant a bug report. -func NewInternalError(err error) error { - if isInternalError(err) { - return err - } - return &errInternal{cause: err} -} - -// isInternalError returns whether the error provided, or -// any error wrapped by that error, is an internal error. -func isInternalError(err error) bool { - asErr := &errInternal{} - return errors.As(err, &asErr) -} - -func (e *errInternal) Error() string { - message := "it looks like you have found a bug in buf. " + - "Please file an issue at https://github.com/bufbuild/buf/issues/ " + - "and provide the command you ran" - if e.cause == nil { - return message - } - return message + ", as well as the following message: " + e.cause.Error() -} - -// NewErrorInterceptor returns a CLI interceptor that wraps Buf CLI errors. -func NewErrorInterceptor() appflag.Interceptor { - return func(next func(context.Context, appflag.Container) error) func(context.Context, appflag.Container) error { - return func(ctx context.Context, container appflag.Container) error { - return wrapError(next(ctx, container)) - } - } -} - -// NewTooManyEmptyAnswersError is used when the user does not answer a prompt in -// the given number of attempts. -func NewTooManyEmptyAnswersError(attempts int) error { - return fmt.Errorf("did not receive an answer in %d attempts", attempts) -} - -// NewOrganizationNameAlreadyExistsError informs the user that an organization with -// that name already exists. -func NewOrganizationNameAlreadyExistsError(name string) error { - return fmt.Errorf("an organization named %q already exists", name) -} - -// NewRepositoryNameAlreadyExistsError informs the user that a repository -// with that name already exists. -func NewRepositoryNameAlreadyExistsError(name string) error { - return fmt.Errorf("a repository named %q already exists", name) -} - -// NewTagOrDraftNameAlreadyExistsError informs the user that a tag -// or draft with that name already exists. -func NewTagOrDraftNameAlreadyExistsError(name string) error { - return fmt.Errorf("a tag or draft named %q already exists", name) -} - -// NewOrganizationNotFoundError informs the user that an organization with -// that name does not exist. -func NewOrganizationNotFoundError(name string) error { - return fmt.Errorf(`an organization named %q does not exist, use "buf beta registry organization create" to create one`, name) -} - -// NewRepositoryNotFoundError informs the user that a repository with -// that name does not exist. -func NewRepositoryNotFoundError(name string) error { - return fmt.Errorf(`a repository named %q does not exist, use "buf beta registry repository create" to create one`, name) -} - -// NewModuleReferenceNotFoundError informs the user that a module -// reference does not exist. -func NewModuleReferenceNotFoundError(reference bufmoduleref.ModuleReference) error { - return fmt.Errorf("%q does not exist", reference) -} - -// NewTokenNotFoundError informs the user that a token with -// that identifier does not exist. -func NewTokenNotFoundError(tokenID string) error { - return fmt.Errorf("a token with ID %q does not exist", tokenID) -} - -func NewUnimplementedRemoteError(err error, remote string, moduleIdentity string) error { - return fmt.Errorf("%w. Are you sure %q (derived from module name %q) is a Buf Schema Registry?", err, remote, moduleIdentity) -} - -// wrapError is used when a CLI command fails, regardless of its error code. -// Note that this function will wrap the error so that the underlying error -// can be recovered via 'errors.Is'. -func wrapError(err error) error { - if err == nil { - return nil - } - connectErr, ok := asConnectError(err) - - // If error is empty and not a Connect error, we return it as-is. - if !ok && err.Error() == "" { - return err - } - // If the error is a Connect error, then interpret it and return an intuitive message - if ok { - connectCode := connectErr.Code() - switch { - case connectCode == connect.CodeUnauthenticated, isEmptyUnknownError(err): - if authErr, ok := bufconnect.AsAuthError(err); ok && authErr.TokenEnvKey() != "" { - return fmt.Errorf(`Failure: the %[1]s environment variable is set, but is not valid. Set %[1]s to a valid Buf API key, or unset it. For details, visit https://docs.buf.build/bsr/authentication`, authErr.TokenEnvKey()) - } - return errors.New(`Failure: you are not authenticated. Create a new entry in your netrc, using a Buf API Key as the password. For details, visit https://docs.buf.build/bsr/authentication`) - case connectCode == connect.CodeUnavailable: - msg := `Failure: the server hosted at that remote is unavailable.` - // If the returned error is Unavailable, then determine if this is a DNS error. If so, get the address used - // so that we can display a more helpful error message. - if dnsError := (&net.DNSError{}); errors.As(err, &dnsError) && dnsError.IsNotFound { - return fmt.Errorf(`%s Are you sure "%s" is a valid remote address?`, msg, dnsError.Name) - } - - return errors.New(msg) - } - return fmt.Errorf("Failure: %s", connectErr.Message()) - } - - // Error was not a Connect error - return fmt.Errorf("Failure: %w", err) -} - -// asConnectError uses errors.As to unwrap any error and look for a *connect.Error. -func asConnectError(err error) (*connect.Error, bool) { - var connectErr *connect.Error - ok := errors.As(err, &connectErr) - return connectErr, ok -} - -// isEmptyUnknownError returns true if the given -// error is non-nil, but has an empty message -// and an unknown error code. -// -// This is relevant for errors returned by -// envoyauthd when the client does not provide -// an authentication header. -func isEmptyUnknownError(err error) bool { - if err == nil { - return false - } - return err.Error() == "" && connect.CodeOf(err) == connect.CodeUnknown -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcli/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufcli/usage.gen.go deleted file mode 100644 index 764ad00e94..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcli/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufcli - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/bufconvert.go b/vendor/github.com/bufbuild/buf/private/buf/bufconvert/bufconvert.go deleted file mode 100644 index 4e1394b2a6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/bufconvert.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconvert - -import ( - "context" - "fmt" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/buf/bufref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" -) - -const ( - // MessageEncodingBinpb is the binary image encoding. - MessageEncodingBinpb MessageEncoding = iota + 1 - // MessageEncodingJSON is the JSON image encoding. - MessageEncodingJSON - // formatBinpb is the binary format. - formatBinpb = "bin" - // formatJSON is the JSON format. - formatJSON = "json" - // formatBin is the binary format's old form, now deprecated. - formatBin = "binpb" -) - -var ( - // MessageEncodingFormatsString is the string representation of all message encoding formats. - // - // This does not include deprecated formats. - MessageEncodingFormatsString = stringutil.SliceToString(messageEncodingFormats) - // sorted - messageEncodingFormats = []string{ - formatBinpb, - formatJSON, - } -) - -// MessageEncoding is the encoding of the message -type MessageEncoding int - -// MessageEncodingRef is a message encoding file reference. -type MessageEncodingRef interface { - Path() string - MessageEncoding() MessageEncoding -} - -// NewMessageEncodingRef returns a new MessageEncodingRef. -func NewMessageEncodingRef( - ctx context.Context, - value string, - defaultEncoding MessageEncoding, -) (MessageEncodingRef, error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "new_message_encoding_ref") - defer span.End() - path, messageEncoding, err := getPathAndMessageEncoding(ctx, value, defaultEncoding) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return nil, err - } - return newMessageEncodingRef(path, messageEncoding), nil -} - -func getPathAndMessageEncoding( - ctx context.Context, - value string, - defaultEncoding MessageEncoding, -) (string, MessageEncoding, error) { - path, options, err := bufref.GetRawPathAndOptions(value) - if err != nil { - return "", 0, err - } - messageEncoding := parseMessageEncodingExt(filepath.Ext(path), defaultEncoding) - for key, value := range options { - switch key { - case "format": - if app.IsDevNull(path) { - return "", 0, fmt.Errorf("not allowed if path is %s", app.DevNullFilePath) - } - messageEncoding, err = parseMessageEncodingFormat(value) - if err != nil { - return "", 0, err - } - default: - return "", 0, fmt.Errorf("invalid options key: %q", key) - } - } - return path, messageEncoding, nil -} - -func parseMessageEncodingExt(ext string, defaultEncoding MessageEncoding) MessageEncoding { - switch strings.TrimPrefix(ext, ".") { - case formatBin, formatBinpb: - return MessageEncodingBinpb - case formatJSON: - return MessageEncodingJSON - default: - return defaultEncoding - } -} - -func parseMessageEncodingFormat(format string) (MessageEncoding, error) { - switch format { - case formatBin, formatBinpb: - return MessageEncodingBinpb, nil - case formatJSON: - return MessageEncodingJSON, nil - default: - return 0, fmt.Errorf("invalid format for message: %q", format) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/message_encoding_ref.go b/vendor/github.com/bufbuild/buf/private/buf/bufconvert/message_encoding_ref.go deleted file mode 100644 index 3790ba75e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/message_encoding_ref.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconvert - -var _ MessageEncodingRef = &messageEncodingRef{} - -type messageEncodingRef struct { - path string - messageEncoding MessageEncoding -} - -func newMessageEncodingRef( - path string, - messageEncoding MessageEncoding, -) *messageEncodingRef { - return &messageEncodingRef{ - path: path, - messageEncoding: messageEncoding, - } -} - -func (r *messageEncodingRef) Path() string { - return r.path -} - -func (r *messageEncodingRef) MessageEncoding() MessageEncoding { - return r.messageEncoding -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufconvert/usage.gen.go deleted file mode 100644 index 29527dd3b1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufconvert/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufconvert - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/bufcurl.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/bufcurl.go deleted file mode 100644 index 2ff6a980fd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/bufcurl.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "context" - "fmt" - "io" - "net/http" - - "github.com/bufbuild/buf/private/pkg/protoencoding" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -// Invoker provides the ability to invoke RPCs dynamically. -type Invoker interface { - // Invoke invokes an RPC method using the given input data and request headers. - // The dataSource is a string that describes the input data (e.g. a filename). - // The actual contents of the request data is read from the given reader. - Invoke(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error -} - -// ResolveMethodDescriptor uses the given resolver to find a descriptor for -// the requested service and method. The service name must be fully-qualified. -func ResolveMethodDescriptor(res protoencoding.Resolver, service, method string) (protoreflect.MethodDescriptor, error) { - descriptor, err := res.FindDescriptorByName(protoreflect.FullName(service)) - if err == protoregistry.NotFound { - return nil, fmt.Errorf("failed to find service named %q in schema", service) - } else if err != nil { - return nil, err - } - serviceDescriptor, ok := descriptor.(protoreflect.ServiceDescriptor) - if !ok { - return nil, fmt.Errorf("URL indicates service name %q, but that name is a %s", service, descriptorKind(descriptor)) - } - methodDescriptor := serviceDescriptor.Methods().ByName(protoreflect.Name(method)) - if methodDescriptor == nil { - return nil, fmt.Errorf("URL indicates method name %q, but service %q contains no such method", method, service) - } - return methodDescriptor, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/headers.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/headers.go deleted file mode 100644 index b83e224e48..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/headers.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "bufio" - "fmt" - "io" - "net/http" - "net/url" - "os" - "path/filepath" - "strings" - - "go.uber.org/multierr" -) - -// headersBlockList contains disallowed headers. These are headers that are part -// of the Connect or gRPC protocol and set by the protocol implementations, so -// should not be set otherwise. It also includes "transfer-encoding", which is -// not part of either protocol, but is unsafe for users to set as it handled -// by the user agent. -// -// In addition to these headers, header names that start with "Connect-" and -// "Grpc-" are also reserved for use by protocol implementations. -var headerBlockList = map[string]struct{}{ - "accept": {}, - "accept-encoding": {}, - "content-type": {}, - "content-encoding": {}, - "te": {}, - "transfer-encoding": {}, -} - -// GetAuthority determines the authority for a request with the given URL and -// request headers. If headers include a "Host" header, that is used. (If the -// request contains more than one, that is usually not valid or acceptable to -// servers, but this function will look at only the first.) If there is no -// such header, the authority is the host portion of the URL (both the domain -// name/IP address and port). -func GetAuthority(url *url.URL, headers http.Header) string { - header := headers.Get("host") - if header != "" { - return header - } - return url.Host -} - -// LoadHeaders computes the set of request headers from the given flag values, -// loading from file(s) if so instructed. A header flag is usually in the form -// "name: value", but it may start with "@" to indicate a filename from which -// headers are loaded. It may also be "*", to indicate that the given others -// are included in full. -// -// If the filename following an "@" header flag is "-", it means to read from -// stdin. -// -// The given dataFile is the name of a file from which request data is read. If -// a "@" header flag indicates to read from the same file, then the headers must -// be at the start of the file, following by a blank line, followed by the -// actual request body. In such a case, the returned ReadCloser will be non-nil -// and correspond to that point in the file (after headers and blank line), so -// the request body can be read from it. -func LoadHeaders(headerFlags []string, dataFile string, others http.Header) (http.Header, io.ReadCloser, error) { - var dataReader io.ReadCloser - headers := http.Header{} - for _, headerFlag := range headerFlags { - switch { - case strings.HasPrefix(headerFlag, "@"): - headerFile := strings.TrimPrefix(headerFlag, "@") - if headerFile != "-" { - if absFile, err := filepath.Abs(headerFile); err == nil { - headerFile = absFile - } - } - isAlsoDataFile := headerFile == dataFile - reader, err := readHeadersFile(headerFile, isAlsoDataFile, headers) - if err != nil { - return nil, nil, err - } - if isAlsoDataFile { - dataReader = reader - } - case headerFlag == "*": - for k, v := range others { - headers[k] = append(headers[k], v...) - } - default: - addHeader(headerFlag, headers) - } - } - // make sure there are no disallowed headers used - for key := range headers { - lowerKey := strings.ToLower(key) - if _, ok := headerBlockList[lowerKey]; ok || strings.HasPrefix(lowerKey, "grpc-") || strings.HasPrefix(lowerKey, "connect-") { - return nil, nil, fmt.Errorf("invalid header: %q is reserved and may not be used", key) - } - } - return headers, dataReader, nil -} - -func readHeadersFile(headerFile string, stopAtBlankLine bool, headers http.Header) (reader io.ReadCloser, err error) { - var f *os.File - if headerFile == "-" { - f = os.Stdin - } else { - f, err = os.Open(headerFile) - if err != nil { - return nil, ErrorHasFilename(err, headerFile) - } - } - defer func() { - if f != nil { - closeErr := f.Close() - if closeErr != nil { - err = multierr.Append(err, ErrorHasFilename(closeErr, headerFile)) - } - } - }() - in := &lineReader{r: bufio.NewReader(f)} - var lineNo int - for { - line, err := in.ReadLine() - if err == io.EOF { - if stopAtBlankLine { - // never hit a blank line - return nil, ErrorHasFilename(io.ErrUnexpectedEOF, headerFile) - } - return nil, nil - } else if err != nil { - return nil, ErrorHasFilename(err, headerFile) - } - if line == "" && stopAtBlankLine { - closer := f - // we don't want close f on return in above defer function, so we clear it - f = nil - return &readerWithClose{Reader: in, Closer: closer}, nil - } - line = strings.TrimSpace(line) - if strings.TrimSpace(line) == "" || strings.HasPrefix(line, "#") { - // ignore blank lines and shell-style comments - continue - } - if !addHeader(line, headers) { - return nil, fmt.Errorf("%s:%d: malformed header: %q", headerFile, lineNo, line) - } - lineNo++ - } -} - -func addHeader(header string, dest http.Header) bool { - parts := strings.SplitN(header, ":", 2) - headerName := parts[0] - hasValue := len(parts) > 1 - var headerVal string - if hasValue { - headerVal = parts[1] - } - dest.Add(strings.TrimSpace(headerName), strings.TrimSpace(headerVal)) - return hasValue -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/invoker.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/invoker.go deleted file mode 100644 index 3ebb7fa23e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/invoker.go +++ /dev/null @@ -1,442 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "bytes" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "net/http" - "net/http/httptest" - "sync" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/verbose" - "github.com/bufbuild/connect-go" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/dynamicpb" -) - -type deferredMessage struct { - data []byte -} - -type protoCodec struct{} - -func (p protoCodec) Name() string { - return "proto" -} - -func (p protoCodec) Marshal(a any) ([]byte, error) { - protoMessage, ok := a.(proto.Message) - if !ok { - return nil, fmt.Errorf("cannot marshal: %T does not implement proto.Message", a) - } - return protoencoding.NewWireMarshaler().Marshal(protoMessage) -} - -func (p protoCodec) Unmarshal(bytes []byte, a any) error { - if deferred, ok := a.(*deferredMessage); ok { - // must make a copy since Connect framework will re-use the byte slice - deferred.data = make([]byte, len(bytes)) - copy(deferred.data, bytes) - return nil - } - protoMessage, ok := a.(proto.Message) - if !ok { - return fmt.Errorf("cannot unmarshal: %T does not implement proto.Message", a) - } - return protoencoding.NewWireUnmarshaler(nil).Unmarshal(bytes, protoMessage) -} - -type invokeClient = connect.Client[dynamicpb.Message, deferredMessage] - -type invoker struct { - md protoreflect.MethodDescriptor - res protoencoding.Resolver - emitDefaults bool - client *invokeClient - output io.Writer - errOutput io.Writer - printer verbose.Printer -} - -// NewInvoker creates a new invoker for invoking the method described by the -// given descriptor. The given writer is used to write the output response(s) -// in JSON format. The given resolver is used to resolve Any messages and -// extensions that appear in the input or output. Other parameters are used -// to create a Connect client, for issuing the RPC. -func NewInvoker(container appflag.Container, md protoreflect.MethodDescriptor, res protoencoding.Resolver, emitDefaults bool, httpClient connect.HTTPClient, opts []connect.ClientOption, url string, out io.Writer) Invoker { - opts = append(opts, connect.WithCodec(protoCodec{})) - // TODO: could also provide custom compressor implementations that could give us - // optics into when request and response messages are compressed (which could be - // useful to include in verbose output). - return &invoker{ - md: md, - res: res, - emitDefaults: emitDefaults, - output: out, - printer: container.VerbosePrinter(), - errOutput: container.Stderr(), - client: connect.NewClient[dynamicpb.Message, deferredMessage](httpClient, url, opts...), - } -} - -func (inv *invoker) Invoke(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error { - inv.printer.Printf("* Invoking RPC %s\n", inv.md.FullName()) - // request's user-agent header(s) get overwritten by protocol, so we stash them in the - // context so that underlying transport can restore them - ctx = withUserAgent(ctx, headers) - switch { - case inv.md.IsStreamingServer() && inv.md.IsStreamingClient(): - return inv.handleBidiStream(ctx, dataSource, data, headers) - case inv.md.IsStreamingServer(): - return inv.handleServerStream(ctx, dataSource, data, headers) - case inv.md.IsStreamingClient(): - return inv.handleClientStream(ctx, dataSource, data, headers) - default: - return inv.handleUnary(ctx, dataSource, data, headers) - } -} - -func (inv *invoker) handleUnary(ctx context.Context, dataSource string, data io.Reader, headers http.Header) error { - provider := newMessageProvider(dataSource, data, inv.res) - msg := dynamicpb.NewMessage(inv.md.Input()) - if err := provider.next(msg); err != nil { - return err - } - // make sure input does not contain a second message - dummy := dynamicpb.NewMessage(inv.md.Input()) - if err := provider.next(dummy); err != io.EOF { - return fmt.Errorf("method %s is a unary RPC, but input contained more than one request message", inv.md.Name()) - } - - req := connect.NewRequest(msg) - for k, v := range headers { - req.Header()[k] = v - } - resp, err := inv.client.CallUnary(ctx, req) - if err != nil { - var connErr *connect.Error - if !errors.As(err, &connErr) { - return err - } - err := inv.handleErrorResponse(connErr) - return err - } - return inv.handleResponse(resp.Msg.data, nil) -} - -func (inv *invoker) handleClientStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) { - provider := newStreamMessageProvider(dataSource, data, inv.res) - msg := dynamicpb.NewMessage(inv.md.Input()) - stream := inv.client.CallClientStream(ctx) - for k, v := range headers { - stream.RequestHeader()[k] = v - } - defer func() { - if retErr != nil { - var connErr *connect.Error - if errors.As(retErr, &connErr) { - retErr = inv.handleErrorResponse(connErr) - } - } - }() - if err, isStreamError := inv.handleStreamRequest(provider, msg, stream); err != nil { - if isStreamError { - _, recvErr := stream.CloseAndReceive() - // stream.Send should return io.EOF on error, and caller is expected to call - // stream.Receive to get the actual RPC error. - if recvErr != nil { - return recvErr - } - } - return err - } - resp, err := stream.CloseAndReceive() - if err != nil { - return err - } - return inv.handleResponse(resp.Msg.data, nil) -} - -func (inv *invoker) handleServerStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) { - provider := newMessageProvider(dataSource, data, inv.res) - msg := dynamicpb.NewMessage(inv.md.Input()) - if err := provider.next(msg); err != nil { - return err - } - // make sure input does not contain a second message - dummy := dynamicpb.NewMessage(inv.md.Input()) - if err := provider.next(dummy); err != io.EOF { - return fmt.Errorf("method %s is a unary RPC, but input contained more than one request message", inv.md.Name()) - } - - req := connect.NewRequest(msg) - for k, v := range headers { - req.Header()[k] = v - } - defer func() { - if retErr != nil { - var connErr *connect.Error - if errors.As(retErr, &connErr) { - retErr = inv.handleErrorResponse(connErr) - } - } - }() - - stream, err := inv.client.CallServerStream(ctx, req) - if err != nil { - return err - } - return inv.handleStreamResponse(&serverStreamAdapter{stream: stream}) -} - -func (inv *invoker) handleBidiStream(ctx context.Context, dataSource string, data io.Reader, headers http.Header) (retErr error) { - ctx, cancel := context.WithCancel(ctx) - provider := newStreamMessageProvider(dataSource, data, inv.res) - msg := dynamicpb.NewMessage(inv.md.Input()) - stream := inv.client.CallBidiStream(ctx) - for k, v := range headers { - stream.RequestHeader()[k] = v - } - - defer func() { - if retErr != nil { - var connErr *connect.Error - if errors.As(retErr, &connErr) { - retErr = inv.handleErrorResponse(connErr) - } - } - }() - - var recvErr error - var wg sync.WaitGroup - wg.Add(1) - go func() { - defer wg.Done() - defer cancel() - if err := inv.handleStreamResponse(stream); err != nil { - recvErr = err - } - }() - defer func() { - wg.Wait() - if recvErr != nil { - // may just get io.EOF or cancel error when trying to write to closed - // request stream whereas actual error details will be seen on the read side - if retErr == nil || errors.Is(retErr, io.EOF) || isCancelled(retErr) { - retErr = recvErr - } - } - }() - shouldCancel := true - defer func() { - if shouldCancel { - cancel() - } - }() - - err, isStreamError := inv.handleStreamRequest(provider, msg, stream) - shouldCancel = err != nil && !isStreamError - if err != nil { - return err - } - return stream.CloseRequest() -} - -func isCancelled(err error) bool { - if errors.Is(err, context.Canceled) { - return true - } - var connErr *connect.Error - if errors.As(err, &connErr) { - return connErr.Code() == connect.CodeCanceled - } - return false -} - -func (inv *invoker) handleResponse(data []byte, msg *dynamicpb.Message) error { - if msg == nil { - msg = dynamicpb.NewMessage(inv.md.Output()) - } - if err := protoencoding.NewWireUnmarshaler(inv.res).Unmarshal(data, msg); err != nil { - return err - } - jsonMarshalerOptions := []protoencoding.JSONMarshalerOption{ - protoencoding.JSONMarshalerWithIndent(), - } - if inv.emitDefaults { - jsonMarshalerOptions = append( - jsonMarshalerOptions, - protoencoding.JSONMarshalerWithEmitUnpopulated(), - ) - } - outputBytes, err := protoencoding.NewJSONMarshaler(inv.res, jsonMarshalerOptions...).Marshal(msg) - if err != nil { - return err - } - _, err = fmt.Fprintf(inv.output, "%s\n", outputBytes) - return err -} - -type clientStream interface { - Send(message *dynamicpb.Message) error -} - -type serverStream interface { - Receive() (*deferredMessage, error) - CloseResponse() error -} - -type serverStreamAdapter struct { - stream *connect.ServerStreamForClient[deferredMessage] -} - -func (ssa *serverStreamAdapter) Receive() (*deferredMessage, error) { - if !ssa.stream.Receive() { - err := ssa.stream.Err() - if err == nil { - err = io.EOF - } - return nil, err - } - return ssa.stream.Msg(), nil -} - -func (ssa *serverStreamAdapter) CloseResponse() error { - return ssa.stream.Close() -} - -func (inv *invoker) handleStreamRequest(provider messageProvider, msg *dynamicpb.Message, stream clientStream) (error, bool) { - for { - if err := provider.next(msg); errors.Is(err, io.EOF) { - break - } else if err != nil { - return err, false - } - if err := stream.Send(msg); err != nil { - return err, true - } - } - return nil, false -} - -func (inv *invoker) handleStreamResponse(stream serverStream) (retError error) { - defer func() { - err := stream.CloseResponse() - if err != nil && retError == nil { - retError = err - } - }() - msg := dynamicpb.NewMessage(inv.md.Output()) - for { - responseMsg, err := stream.Receive() - if errors.Is(err, io.EOF) { - return nil - } else if err != nil { - return err - } - if err := inv.handleResponse(responseMsg.data, msg); err != nil { - return err - } - } -} - -func (inv *invoker) handleErrorResponse(connErr *connect.Error) error { - // NB: This is a nasty hack: we create a fake request that looks - // like a unary Connect request, so that the ErrorWriter will - // print the error in the format we want, which is just the - // JSON representation of the Connect error. (We don't need - // an end-stream message representation or for the content - // to be put into response headers, which is what it may - // choose to do if it detects a different protocol in the - // request). - req := &http.Request{ - Header: http.Header{}, - } - req.Header.Add("content-type", "application/json") - - w := connect.NewErrorWriter() - responseWriter := httptest.NewRecorder() - err := w.Write(responseWriter, req, connErr) - if err != nil { - return err - } - var prettyPrinted bytes.Buffer - if err := json.Indent(&prettyPrinted, responseWriter.Body.Bytes(), "", " "); err != nil { - return err - } - _, _ = inv.errOutput.Write(prettyPrinted.Bytes()) - _, _ = inv.errOutput.Write([]byte("\n")) - return app.NewError(int(connErr.Code()*8), "") -} - -func newStreamMessageProvider(dataSource string, data io.Reader, res protoencoding.Resolver) messageProvider { - if data == nil { - // if no data provided, treat as empty input - data = bytes.NewBuffer(nil) - } - return &streamMessageProvider{name: dataSource, dec: json.NewDecoder(data), res: res} -} - -func newMessageProvider(dataSource string, data io.Reader, res protoencoding.Resolver) messageProvider { - if data == nil { - // if no data provider, treat as if single empty message - return &singleEmptyMessageProvider{} - } else { - return newStreamMessageProvider(dataSource, data, res) - } -} - -type messageProvider interface { - next(proto.Message) error -} - -type singleEmptyMessageProvider struct { - read bool -} - -func (s *singleEmptyMessageProvider) next(_ proto.Message) error { - if !s.read { - s.read = true - return nil - } - return io.EOF -} - -type streamMessageProvider struct { - name string - dec *json.Decoder - res protoencoding.Resolver -} - -func (s *streamMessageProvider) next(msg proto.Message) error { - var jsonData json.RawMessage - if err := s.dec.Decode(&jsonData); err != nil { - if err == io.EOF { - return err - } - return fmt.Errorf("%s at offset %d: %w", s.name, s.dec.InputOffset(), err) - } - proto.Reset(msg) - return protoencoding.NewJSONUnmarshaler(s.res).Unmarshal(jsonData, msg) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/io.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/io.go deleted file mode 100644 index c185f89b4f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/io.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "bufio" - "fmt" - "io" - "strings" -) - -// ErrorHasFilename makes sure that the given error includes a reference to the -// given filename. If not, it wraps the given error and adds the filename. This -// is to make sure errors are useful -- an error related to file I/O is not very -// helpful if it doesn't indicate the name of the file. -func ErrorHasFilename(err error, filename string) error { - if strings.Contains(err.Error(), filename) { - return err - } - return fmt.Errorf("%s: %w", filename, err) -} - -type readerWithClose struct { - io.Reader - io.Closer -} - -// lineReader wraps a *bufio.Reader, making it easier to read a file one line -// at a time. -type lineReader struct { - r *bufio.Reader - err error -} - -func (r *lineReader) Read(p []byte) (n int, err error) { - return r.r.Read(p) -} - -func (r *lineReader) ReadLine() (string, error) { - if r.err != nil { - return "", r.err - } - str, err := r.r.ReadString('\n') - // Instead of returning data AND error, like bufio.Reader.ReadString, - // only return one or the other since that is easier for the caller. - if err != nil { - if str != "" { - r.err = err // save for next call - return str, nil - } - return "", err - } - // If bufio.Reader.ReadString returns nil err, then the string ends - // with the delimiter. Remove it. - str = strings.TrimSuffix(str, "\n") - return str, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/reflection_resolver.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/reflection_resolver.go deleted file mode 100644 index ac08279d1a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/reflection_resolver.go +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "context" - "errors" - "fmt" - "net/http" - "strconv" - "strings" - "sync" - - reflectionv1 "github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/verbose" - "github.com/bufbuild/connect-go" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/dynamicpb" -) - -const ( - // ReflectProtocolUnknown represents that the server reflection protocol - // is unknown. If given this value, the server reflection resolver will - // cycle through the known reflection protocols from newest to oldest, - // trying each one until a reflection protocol that works is found. - ReflectProtocolUnknown ReflectProtocol = iota + 1 - // ReflectProtocolGRPCV1 represents the gRPC server reflection protocol - // defined by the service grpc.reflection.v1.ServerReflection. - ReflectProtocolGRPCV1 - // ReflectProtocolGRPCV1Alpha represents the gRPC server reflection protocol - // defined by the service grpc.reflection.v1alpha.ServerReflection. - ReflectProtocolGRPCV1Alpha -) - -var ( - // AllKnownReflectProtocolStrings are all string values for - // ReflectProtocol that represent known reflection protocols. - AllKnownReflectProtocolStrings = []string{ - "grpc-v1", - "grpc-v1alpha", - } - - reflectProtocolToString = map[ReflectProtocol]string{ - ReflectProtocolUnknown: "", - ReflectProtocolGRPCV1: "grpc-v1", - ReflectProtocolGRPCV1Alpha: "grpc-v1alpha", - } - stringToReflectProtocol = map[string]ReflectProtocol{ - "": ReflectProtocolUnknown, - "grpc-v1": ReflectProtocolGRPCV1, - "grpc-v1alpha": ReflectProtocolGRPCV1Alpha, - } -) - -// ReflectProtocol is a reflection protocol. -type ReflectProtocol int - -// String implements fmt.Stringer. -func (r ReflectProtocol) String() string { - s, ok := reflectProtocolToString[r] - if !ok { - return strconv.Itoa(int(r)) - } - return s -} - -// ParseReflectProtocol parses the ReflectProtocol. -// -// The empty string is a parse error. -func ParseReflectProtocol(s string) (ReflectProtocol, error) { - r, ok := stringToReflectProtocol[strings.ToLower(strings.TrimSpace(s))] - if ok { - return r, nil - } - return 0, fmt.Errorf("unknown ReflectProtocol: %q", s) -} - -// NewServerReflectionResolver creates a new resolver using the given details to -// create an RPC reflection client, to ask the server for descriptors. -func NewServerReflectionResolver( - ctx context.Context, - httpClient connect.HTTPClient, - opts []connect.ClientOption, - baseURL string, - reflectProtocol ReflectProtocol, - headers http.Header, - printer verbose.Printer, -) (r protoencoding.Resolver, closeResolver func()) { - baseURL = strings.TrimSuffix(baseURL, "/") - var v1Client, v1alphaClient *reflectClient - if reflectProtocol != ReflectProtocolGRPCV1 { - v1alphaClient = connect.NewClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse](httpClient, baseURL+"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo", opts...) - } - if reflectProtocol != ReflectProtocolGRPCV1Alpha { - v1Client = connect.NewClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse](httpClient, baseURL+"/grpc.reflection.v1.ServerReflection/ServerReflectionInfo", opts...) - } - // if version is neither "v1" nor "v1alpha", then we have both clients and - // will automatically decide which one to use by trying v1 first and falling - // back to v1alpha on "not implemented" error - - // elide the "upload finished" trace message for reflection calls - ctx = skippingUploadFinishedMessage(ctx) - // request's user-agent header(s) get overwritten by protocol, so we stash them in the - // context so that underlying transport can restore them - ctx = withUserAgent(ctx, headers) - - res := &reflectionResolver{ - ctx: ctx, - v1Client: v1Client, - v1alphaClient: v1alphaClient, - useV1Alpha: reflectProtocol == ReflectProtocolGRPCV1Alpha, - headers: headers, - printer: printer, - downloadedProtos: map[string]*descriptorpb.FileDescriptorProto{}, - } - return res, res.Reset -} - -type reflectClient = connect.Client[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse] -type reflectStream = connect.BidiStreamForClient[reflectionv1.ServerReflectionRequest, reflectionv1.ServerReflectionResponse] - -type reflectionResolver struct { - ctx context.Context - headers http.Header - printer verbose.Printer - v1Client, v1alphaClient *reflectClient - - mu sync.Mutex - useV1Alpha bool - v1Stream, v1alphaStream *reflectStream - downloadedProtos map[string]*descriptorpb.FileDescriptorProto - cachedFiles protoregistry.Files - cachedExts protoregistry.Types -} - -func (r *reflectionResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { - r.mu.Lock() - defer r.mu.Unlock() - - d, err := r.cachedFiles.FindFileByPath(path) - if d != nil { - return d, nil - } - if err != protoregistry.NotFound { - return nil, err - } - // if not found in existing files, fetch more - fileDescriptorProtos, err := r.fileByNameLocked(path) - if err != nil { - // intentionally not using "%w" because, depending on the code, the bufcli - // app framework might incorrectly interpret it and report a bad error message. - return nil, fmt.Errorf("failed to resolve filename %q: %v", path, err) - } - if err := r.cacheFilesLocked(fileDescriptorProtos); err != nil { - return nil, err - } - // now it should definitely be in there! - return r.cachedFiles.FindFileByPath(path) -} - -func (r *reflectionResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { - r.mu.Lock() - defer r.mu.Unlock() - - d, err := r.cachedFiles.FindDescriptorByName(name) - if d != nil { - return d, nil - } - if err != protoregistry.NotFound { - return nil, err - } - // if not found in existing files, fetch more - fileDescriptorProtos, err := r.fileContainingSymbolLocked(name) - if err != nil { - // intentionally not using "%w" because, depending on the code, the bufcli - // app framework might incorrectly interpret it and report a bad error message. - return nil, fmt.Errorf("failed to resolve symbol %q: %v", name, err) - } - if err := r.cacheFilesLocked(fileDescriptorProtos); err != nil { - return nil, err - } - // now it should definitely be in there! - return r.cachedFiles.FindDescriptorByName(name) -} - -func (r *reflectionResolver) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) { - d, err := r.FindDescriptorByName(enum) - if err != nil { - return nil, err - } - ed, ok := d.(protoreflect.EnumDescriptor) - if !ok { - return nil, fmt.Errorf("element %s is a %s, not an enum", enum, descriptorKind(d)) - } - return dynamicpb.NewEnumType(ed), nil -} - -func (r *reflectionResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - d, err := r.FindDescriptorByName(message) - if err != nil { - return nil, err - } - md, ok := d.(protoreflect.MessageDescriptor) - if !ok { - return nil, fmt.Errorf("element %s is a %s, not a message", message, descriptorKind(d)) - } - return dynamicpb.NewMessageType(md), nil -} - -func (r *reflectionResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - pos := strings.LastIndexByte(url, '/') - typeName := url[pos+1:] - return r.FindMessageByName(protoreflect.FullName(typeName)) -} - -func (r *reflectionResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - d, err := r.FindDescriptorByName(field) - if err != nil { - return nil, err - } - fd, ok := d.(protoreflect.FieldDescriptor) - if !ok || !fd.IsExtension() { - return nil, fmt.Errorf("element %s is a %s, not an extension", field, descriptorKind(d)) - } - return dynamicpb.NewExtensionType(fd), nil -} - -func (r *reflectionResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - r.mu.Lock() - defer r.mu.Unlock() - - ext, err := r.cachedExts.FindExtensionByNumber(message, field) - if ext != nil { - return ext, nil - } - if err != protoregistry.NotFound { - return nil, err - } - // if not found in existing files, fetch more - fileDescriptorProtos, err := r.fileContainingExtensionLocked(message, field) - if err != nil { - // intentionally not using "%w" because, depending on the code, the bufcli - // app framework might incorrectly interpret it and report a bad error message. - return nil, fmt.Errorf("failed to resolve extension %d for %q: %v", field, message, err) - } - if err := r.cacheFilesLocked(fileDescriptorProtos); err != nil { - return nil, err - } - // now it should definitely be in there! - return r.cachedExts.FindExtensionByNumber(message, field) -} - -func (r *reflectionResolver) fileContainingSymbolLocked(name protoreflect.FullName) ([]*descriptorpb.FileDescriptorProto, error) { - r.printer.Printf("* Using server reflection to resolve %q\n", name) - resp, err := r.sendLocked(&reflectionv1.ServerReflectionRequest{ - MessageRequest: &reflectionv1.ServerReflectionRequest_FileContainingSymbol{ - FileContainingSymbol: string(name), - }, - }) - if err != nil { - return nil, err - } - return descriptorsInResponse(resp) -} - -func (r *reflectionResolver) fileContainingExtensionLocked(message protoreflect.FullName, field protoreflect.FieldNumber) ([]*descriptorpb.FileDescriptorProto, error) { - r.printer.Printf("* Using server reflection to retrieve extension %d for %q\n", field, message) - resp, err := r.sendLocked(&reflectionv1.ServerReflectionRequest{ - MessageRequest: &reflectionv1.ServerReflectionRequest_FileContainingExtension{ - FileContainingExtension: &reflectionv1.ExtensionRequest{ - ContainingType: string(message), - ExtensionNumber: int32(field), - }, - }, - }) - if err != nil { - return nil, err - } - return descriptorsInResponse(resp) -} - -func (r *reflectionResolver) fileByNameLocked(name string) ([]*descriptorpb.FileDescriptorProto, error) { - r.printer.Printf("* Using server reflection to download file %q\n", name) - resp, err := r.sendLocked(&reflectionv1.ServerReflectionRequest{ - MessageRequest: &reflectionv1.ServerReflectionRequest_FileByFilename{ - FileByFilename: name, - }, - }) - if err != nil { - return nil, err - } - return descriptorsInResponse(resp) -} - -func descriptorsInResponse(resp *reflectionv1.ServerReflectionResponse) ([]*descriptorpb.FileDescriptorProto, error) { - switch response := resp.MessageResponse.(type) { - case *reflectionv1.ServerReflectionResponse_ErrorResponse: - return nil, connect.NewWireError(connect.Code(response.ErrorResponse.ErrorCode), errors.New(response.ErrorResponse.ErrorMessage)) - case *reflectionv1.ServerReflectionResponse_FileDescriptorResponse: - files := make([]*descriptorpb.FileDescriptorProto, len(response.FileDescriptorResponse.FileDescriptorProto)) - for i, data := range response.FileDescriptorResponse.FileDescriptorProto { - var file descriptorpb.FileDescriptorProto - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(data, &file); err != nil { - return nil, err - } - files[i] = &file - } - return files, nil - default: - return nil, fmt.Errorf("server replied with unsupported response type: %T", resp.MessageResponse) - } -} - -func (r *reflectionResolver) cacheFilesLocked(files []*descriptorpb.FileDescriptorProto) error { - for _, file := range files { - if _, ok := r.downloadedProtos[file.GetName()]; ok { - continue // already downloaded, don't bother overwriting - } - r.downloadedProtos[file.GetName()] = file - } - for _, file := range files { - if err := r.cacheFileLocked(file.GetName(), nil); err != nil { - return err - } - } - return nil -} - -func (r *reflectionResolver) cacheFileLocked(name string, seen []string) error { - if _, err := r.cachedFiles.FindFileByPath(name); err == nil { - return nil // already processed this file - } - for i, alreadySeen := range seen { - if name == alreadySeen { - // we've seen this file already which means malformed - // file descriptor protos that have an import cycle - cycle := append(seen[i:], name) - return fmt.Errorf("downloaded files contain an import cycle: %s", strings.Join(cycle, " -> ")) - } - } - - file := r.downloadedProtos[name] - if file == nil { - // download missing file(s) - moreFiles, err := r.fileByNameLocked(name) - if err != nil { - return err - } - for _, newFile := range moreFiles { - r.downloadedProtos[newFile.GetName()] = newFile - if newFile.GetName() == name { - file = newFile - } - } - if file == nil { - return fmt.Errorf("requested file %q but response did not contain it", name) - } - } - - // make sure imports have been downloaded and cached - for _, dep := range file.Dependency { - if err := r.cacheFileLocked(dep, append(seen, name)); err != nil { - return err - } - } - - // now we can create and cache this file - fileDescriptor, err := protodesc.NewFile(file, &r.cachedFiles) - if err != nil { - return err - } - if err := r.cachedFiles.RegisterFile(fileDescriptor); err != nil { - return err - } - registerExtensions(&r.cachedExts, fileDescriptor) - r.printer.Printf("* Server reflection has resolved file %q\n", fileDescriptor.Path()) - return nil -} - -func (r *reflectionResolver) sendLocked(req *reflectionv1.ServerReflectionRequest) (*reflectionv1.ServerReflectionResponse, error) { - stream, isNew := r.getStreamLocked() - resp, err := send(stream, req) - if isNotImplemented(err) && !r.useV1Alpha && r.v1alphaClient != nil { - r.resetLocked() - r.useV1Alpha = true - stream, isNew = r.getStreamLocked() - resp, err = send(stream, req) - } - if err != nil && !isNew { - // the existing stream broke; try again with a new stream - r.resetLocked() - stream, _ = r.getStreamLocked() - resp, err = send(stream, req) - } - return resp, err -} - -func isNotImplemented(err error) bool { - var connErr *connect.Error - ok := errors.As(err, &connErr) - return ok && connErr.Code() == connect.CodeUnimplemented -} - -func send(stream *reflectStream, req *reflectionv1.ServerReflectionRequest) (*reflectionv1.ServerReflectionResponse, error) { - sendErr := stream.Send(req) - // even if sendErr != nil, we still call Receive because Send will typically return - // io.EOF and caller is expected to use Receive to get the RPC error result. - resp, recvErr := stream.Receive() - if sendErr != nil && recvErr == nil { - return nil, sendErr - } - return resp, recvErr -} - -func (r *reflectionResolver) getStreamLocked() (*reflectStream, bool) { - if r.useV1Alpha { - isNew := r.maybeCreateStreamLocked(r.v1alphaClient, &r.v1alphaStream) - return r.v1alphaStream, isNew - } - isNew := r.maybeCreateStreamLocked(r.v1Client, &r.v1Stream) - return r.v1Stream, isNew -} - -func (r *reflectionResolver) maybeCreateStreamLocked(client *reflectClient, stream **reflectStream) bool { - if *stream != nil { - return false // already created - } - *stream = client.CallBidiStream(r.ctx) - for k, v := range r.headers { - (*stream).RequestHeader()[k] = v - } - return true -} - -func (r *reflectionResolver) Reset() { - r.mu.Lock() - defer r.mu.Unlock() - r.resetLocked() -} - -func (r *reflectionResolver) resetLocked() { - if r.v1Stream != nil { - reset(r.v1Stream) - r.v1Stream = nil - } - if r.v1alphaStream != nil { - reset(r.v1alphaStream) - r.v1alphaStream = nil - } -} - -func reset(stream *reflectStream) { - _ = stream.CloseRequest() - // Try to terminate gracefully by receiving the end of stream - // (this call should return io.EOF). If we skip this and - // immediately call CloseResponse, it could result in the - // RPC being cancelled, which results in some nuisance - // "cancel" errors. - _, _ = stream.Receive() - _ = stream.CloseResponse() -} - -type extensionContainer interface { - Messages() protoreflect.MessageDescriptors - Extensions() protoreflect.ExtensionDescriptors -} - -func registerExtensions(reg *protoregistry.Types, descriptor extensionContainer) { - exts := descriptor.Extensions() - for i := 0; i < exts.Len(); i++ { - extType := dynamicpb.NewExtensionType(exts.Get(i)) - _ = reg.RegisterExtension(extType) - } - msgs := descriptor.Messages() - for i := 0; i < msgs.Len(); i++ { - registerExtensions(reg, msgs.Get(i)) - } -} - -// descriptorKind returns a succinct description of the type of the given descriptor. -func descriptorKind(d protoreflect.Descriptor) string { - switch d := d.(type) { - case protoreflect.FileDescriptor: - return "file" - case protoreflect.MessageDescriptor: - return "message" - case protoreflect.FieldDescriptor: - if d.IsExtension() { - return "extension" - } - return "field" - case protoreflect.OneofDescriptor: - return "oneof" - case protoreflect.EnumDescriptor: - return "enum" - case protoreflect.EnumValueDescriptor: - return "enum value" - case protoreflect.ServiceDescriptor: - return "service" - case protoreflect.MethodDescriptor: - return "method" - default: - return fmt.Sprintf("%T", d) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/tls.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/tls.go deleted file mode 100644 index b599d4174f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/tls.go +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "crypto/tls" - "crypto/x509" - "net" - "os" - "strings" - "time" - - "github.com/bufbuild/buf/private/pkg/verbose" -) - -// TLSSettings contains settings related to creating a TLS client. -type TLSSettings struct { - // Filenames for a private key, certificate, and CA certificate pool. - KeyFile, CertFile, CACertFile string - // Override server name, for SNI. - ServerName string - // If true, the server's certificate is not verified. - Insecure bool -} - -// MakeVerboseTLSConfig constructs a *tls.Config that logs information to the -// given printer as a TLS connection is negotiated. -func MakeVerboseTLSConfig(settings *TLSSettings, authority string, printer verbose.Printer) (*tls.Config, error) { - var conf tls.Config - // we verify manually so that we can emit verbose output while doing so - conf.InsecureSkipVerify = true - conf.VerifyConnection = func(state tls.ConnectionState) error { - printer.Printf("* TLS connection using %s / %s", versionName(state.Version), tls.CipherSuiteName(state.CipherSuite)) - if state.DidResume { - printer.Printf("* (TLS session resumed)") - } - if state.NegotiatedProtocol != "" { - printer.Printf("* ALPN, server accepted protocol %s", state.NegotiatedProtocol) - } - printer.Printf("* Server certificate:") - printer.Printf("* subject: %s", state.PeerCertificates[0].Subject.String()) - printer.Printf("* start date: %s", state.PeerCertificates[0].NotBefore) - printer.Printf("* end date: %s", state.PeerCertificates[0].NotAfter) - var subjectAlternatives []string - subjectAlternatives = append(subjectAlternatives, state.PeerCertificates[0].DNSNames...) - for _, ip := range state.PeerCertificates[0].IPAddresses { - subjectAlternatives = append(subjectAlternatives, ip.String()) - } - subjectAlternatives = append(subjectAlternatives, state.PeerCertificates[0].EmailAddresses...) - for _, uri := range state.PeerCertificates[0].URIs { - subjectAlternatives = append(subjectAlternatives, uri.String()) - } - printer.Printf("* subjectAltNames: [%s]", strings.Join(subjectAlternatives, ", ")) - printer.Printf("* issuer: %s", state.PeerCertificates[0].Issuer.String()) - - // now we do verification - if !settings.Insecure { - opts := x509.VerifyOptions{ - Roots: conf.RootCAs, - CurrentTime: time.Now(), - Intermediates: x509.NewCertPool(), - } - for _, cert := range state.PeerCertificates[1:] { - opts.Intermediates.AddCert(cert) - } - if _, err := state.PeerCertificates[0].Verify(opts); err != nil { - printer.Printf("* Server certificate chain could not be verified: %v", err) - return err - } - printer.Printf("* Server certificate chain verified") - if err := state.PeerCertificates[0].VerifyHostname(conf.ServerName); err != nil { - printer.Printf("* Server certificate is not valid for %s: %v", conf.ServerName, err) - return err - } - printer.Printf("* Server certificate is valid for %s", conf.ServerName) - } - return nil - } - if settings.ServerName != "" { - conf.ServerName = settings.ServerName - } else if authority != "" { - // strip port if present - host, _, err := net.SplitHostPort(authority) - if err == nil { - authority = host - } - conf.ServerName = authority - } - - if settings.CACertFile != "" { - caCert, err := os.ReadFile(settings.CACertFile) - if err != nil { - return nil, ErrorHasFilename(err, settings.CACertFile) - } - conf.RootCAs = x509.NewCertPool() - conf.RootCAs.AppendCertsFromPEM(caCert) - } - - if settings.KeyFile != "" && settings.CertFile != "" { - cert, err := os.ReadFile(settings.CertFile) - if err != nil { - return nil, ErrorHasFilename(err, settings.CertFile) - } - key, err := os.ReadFile(settings.KeyFile) - if err != nil { - return nil, ErrorHasFilename(err, settings.KeyFile) - } - certPair, err := tls.X509KeyPair(cert, key) - if err != nil { - return nil, err - } - certPair.Leaf, err = x509.ParseCertificate(certPair.Certificate[0]) - if err != nil { - return nil, err - } - conf.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { - printer.Printf("* Offering client cert:") - printer.Printf("* subject: %s", certPair.Leaf.Subject.String()) - printer.Printf("* start date: %s", certPair.Leaf.NotBefore) - printer.Printf("* end date: %s", certPair.Leaf.NotAfter) - printer.Printf("* issuer: %s", certPair.Leaf.Issuer.String()) - return &certPair, nil - } - } - - return &conf, nil -} - -func versionName(tlsVersion uint16) string { - // TODO: once we can use Go 1.20, it will provide tls.VersionName that we can use - // https://github.com/golang/go/issues/46308 - switch tlsVersion { - case tls.VersionTLS10: - return "TLSv1.0" - case tls.VersionTLS11: - return "TLSv1.1" - case tls.VersionTLS12: - return "TLSv1.2" - case tls.VersionTLS13: - return "TLSv1.3" - default: - return "(unrecognized TLS version)" - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/usage.gen.go deleted file mode 100644 index f35897b50d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufcurl - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/verbose_transport.go b/vendor/github.com/bufbuild/buf/private/buf/bufcurl/verbose_transport.go deleted file mode 100644 index c9247ab4d8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufcurl/verbose_transport.go +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufcurl - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "net/http" - "runtime" - "sort" - "strings" - - "github.com/bufbuild/buf/private/pkg/verbose" - "github.com/bufbuild/connect-go" - "go.uber.org/atomic" -) - -type skipUploadFinishedMessageKey struct{} - -func skippingUploadFinishedMessage(ctx context.Context) context.Context { - return context.WithValue(ctx, skipUploadFinishedMessageKey{}, true) -} - -type userAgentKey struct{} - -func withUserAgent(ctx context.Context, headers http.Header) context.Context { - if userAgentHeaders := headers.Values("user-agent"); len(userAgentHeaders) > 0 { - return context.WithValue(ctx, userAgentKey{}, userAgentHeaders) - } - return ctx // no change -} - -// DefaultUserAgent returns the default user agent for the given protocol. -func DefaultUserAgent(protocol string, bufVersion string) string { - // mirror the default user agent for the Connect client library, but - // add "buf/" in front of it. - libUserAgent := "connect-go" - if strings.Contains(protocol, "grpc") { - libUserAgent = "grpc-go-connect" - } - return fmt.Sprintf("buf/%s %s/%s (%s)", bufVersion, libUserAgent, connect.Version, runtime.Version()) -} - -// NewVerboseHTTPClient creates a new HTTP client with the given transport and -// printing verbose trace information to the given printer. -func NewVerboseHTTPClient(transport http.RoundTripper, printer verbose.Printer) connect.HTTPClient { - return &verboseClient{transport: transport, printer: printer} -} - -// TraceTrailersInterceptor returns an interceptor that will print information -// about trailers for streaming calls to the given printer. This is used with -// the Connect and gRPC-web protocols since these protocols include trailers in -// the request body, instead of using actual HTTP trailers. (For the gRPC -// protocol, which uses actual HTTP trailers, the verbose HTTP client suffices -// since it already prints information about the trailers.) -func TraceTrailersInterceptor(printer verbose.Printer) connect.Interceptor { - return traceTrailersInterceptor{printer: printer} -} - -type verboseClient struct { - transport http.RoundTripper - printer verbose.Printer - reqNum atomic.Int32 -} - -type reqNumAddrKey struct{} - -func (v *verboseClient) Do(req *http.Request) (*http.Response, error) { - if host := req.Header.Get("Host"); host != "" { - // Set based on host header. This way it is also correctly used as - // the ":authority" meta-header in HTTP/2. - req.Host = host - } - if userAgentHeaders, _ := req.Context().Value(userAgentKey{}).([]string); len(userAgentHeaders) > 0 { - req.Header.Del("user-agent") - for _, val := range userAgentHeaders { - req.Header.Add("user-agent", val) - } - } - - reqNum := v.reqNum.Add(1) - if reqNumAddr, _ := req.Context().Value(reqNumAddrKey{}).(*int32); reqNumAddr != nil { - *reqNumAddr = reqNum - } - rawBody := req.Body - if rawBody == nil { - rawBody = io.NopCloser(bytes.NewBuffer(nil)) - } - var atEnd func(error) - if skip, _ := req.Context().Value(skipUploadFinishedMessageKey{}).(bool); !skip { - atEnd = func(err error) { - if errors.Is(err, io.EOF) { - v.printer.Printf("* (#%d) Finished upload", reqNum) - } - } - } - req.Body = &verboseReader{ - ReadCloser: rawBody, - callback: func(count int) { - v.traceWriteRequestBytes(reqNum, count) - }, - whenDone: atEnd, - whenStart: func() { - // we defer this until body is read so that our HTTP client's dialer and TLS - // config can potentially log useful things about connection setup *before* - // we print the request info. - v.traceRequest(req, reqNum) - }, - } - resp, err := v.transport.RoundTrip(req) - if resp != nil { - v.traceResponse(resp, reqNum) - if resp.Body != nil { - resp.Body = &verboseReader{ - ReadCloser: resp.Body, - callback: func(count int) { - v.traceReadResponseBytes(reqNum, count) - }, - whenDone: func(err error) { - traceTrailers(v.printer, resp.Trailer, false, reqNum) - v.printer.Printf("* (#%d) Call complete", reqNum) - }, - } - } - } - - return resp, err -} - -func (v *verboseClient) traceRequest(r *http.Request, reqNum int32) { - // we look at the *raw* http headers, in case any get added by the - // Connect client impl or an interceptor after we could otherwise - // inspect them from an interceptor - var queryString string - if r.URL.RawQuery != "" { - queryString = "?" + r.URL.RawQuery - } else if r.URL.ForceQuery { - queryString = "?" - } - v.printer.Printf("> (#%d) %s %s%s\n", reqNum, r.Method, r.URL.Path, queryString) - traceMetadata(v.printer, r.Header, fmt.Sprintf("> (#%d) ", reqNum)) - v.printer.Printf("> (#%d)\n", reqNum) -} - -func (v *verboseClient) traceWriteRequestBytes(reqNum int32, count int) { - v.printer.Printf("} (#%d) [%d bytes data]", reqNum, count) -} - -func (v *verboseClient) traceResponse(r *http.Response, reqNum int32) { - v.printer.Printf("< (#%d) %s %s\n", reqNum, r.Proto, r.Status) - traceMetadata(v.printer, r.Header, fmt.Sprintf("< (#%d) ", reqNum)) - v.printer.Printf("< (#%d)\n", reqNum) -} - -func (v *verboseClient) traceReadResponseBytes(reqNum int32, count int) { - v.printer.Printf("{ (#%d) [%d bytes data]", reqNum, count) -} - -func traceMetadata(printer verbose.Printer, meta http.Header, prefix string) { - keys := make([]string, 0, len(meta)) - for key := range meta { - keys = append(keys, key) - } - sort.Strings(keys) - for _, key := range keys { - vals := meta[key] - for _, val := range vals { - printer.Printf("%s%s: %s\n", prefix, key, val) - } - } -} - -func traceTrailers(printer verbose.Printer, trailers http.Header, synthetic bool, reqNum int32) { - if len(trailers) == 0 { - return - } - printer.Printf("< (#%d)\n", reqNum) - prefix := fmt.Sprintf("< (#%d) ", reqNum) - if synthetic { - // mark synthetic trailers with an asterisk - prefix += "[*] " - } - traceMetadata(printer, trailers, prefix) -} - -type verboseReader struct { - io.ReadCloser - callback func(int) - whenStart func() - whenDone func(error) - started atomic.Bool - done atomic.Bool -} - -func (v *verboseReader) Read(dest []byte) (n int, err error) { - if v.started.CompareAndSwap(false, true) && v.whenStart != nil { - v.whenStart() - } - n, err = v.ReadCloser.Read(dest) - if n > 0 && v.callback != nil { - v.callback(n) - } - if err != nil { - if v.done.CompareAndSwap(false, true) && v.whenDone != nil { - v.whenDone(err) - } - } - return n, err -} - -func (v *verboseReader) Close() error { - err := v.ReadCloser.Close() - if v.done.CompareAndSwap(false, true) && v.whenDone != nil { - reportError := err - if reportError == nil { - reportError = io.EOF - } - v.whenDone(reportError) - } - return err -} - -type traceTrailersInterceptor struct { - printer verbose.Printer -} - -func (t traceTrailersInterceptor) WrapUnary(unaryFunc connect.UnaryFunc) connect.UnaryFunc { - return unaryFunc -} - -func (t traceTrailersInterceptor) WrapStreamingClient(clientFunc connect.StreamingClientFunc) connect.StreamingClientFunc { - return func(ctx context.Context, spec connect.Spec) connect.StreamingClientConn { - var reqNum int32 - ctx = context.WithValue(ctx, reqNumAddrKey{}, &reqNum) - return &traceTrailersStream{StreamingClientConn: clientFunc(ctx, spec), reqNum: &reqNum, printer: t.printer} - } -} - -func (t traceTrailersInterceptor) WrapStreamingHandler(handlerFunc connect.StreamingHandlerFunc) connect.StreamingHandlerFunc { - return handlerFunc -} - -type traceTrailersStream struct { - connect.StreamingClientConn - reqNum *int32 - printer verbose.Printer - done atomic.Bool -} - -func (s *traceTrailersStream) Receive(msg any) error { - err := s.StreamingClientConn.Receive(msg) - if err != nil && s.done.CompareAndSwap(false, true) { - traceTrailers(s.printer, s.ResponseTrailer(), true, *s.reqNum) - } - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/buffetch.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/buffetch.go deleted file mode 100644 index be239c0228..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/buffetch.go +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "context" - "io" - "net/http" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/httpauth" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/zap" -) - -const ( - // ImageEncodingBin is the binary image encoding. - ImageEncodingBin ImageEncoding = iota + 1 - // ImageEncodingJSON is the JSON image encoding. - ImageEncodingJSON -) - -var ( - // ImageFormatsString is the string representation of all image formats. - // - // This does not include deprecated formats. - ImageFormatsString = stringutil.SliceToString(imageFormatsNotDeprecated) - // SourceDirFormatsString is the string representation of all source directory formats. - // This includes all of the formats in SourceFormatsString except the protofile format. - // - // This does not include deprecated formats. - SourceDirFormatsString = stringutil.SliceToString(sourceDirFormatsNotDeprecated) - // SourceFormatsString is the string representation of all source formats. - // - // This does not include deprecated formats. - SourceFormatsString = stringutil.SliceToString(sourceFormatsNotDeprecated) - // ModuleFormatsString is the string representation of all module formats. - // - // Module formats are also source formats. - // - // This does not include deprecated formats. - ModuleFormatsString = stringutil.SliceToString(moduleFormatsNotDeprecated) - // SourceOrModuleFormatsString is the string representation of all source or module formats. - // - // This does not include deprecated formats. - SourceOrModuleFormatsString = stringutil.SliceToString(sourceOrModuleFormatsNotDeprecated) - // AllFormatsString is the string representation of all formats. - // - // This does not include deprecated formats. - AllFormatsString = stringutil.SliceToString(allFormatsNotDeprecated) -) - -// ImageEncoding is the encoding of the image. -type ImageEncoding int - -// PathResolver resolves external paths to paths. -type PathResolver interface { - // PathForExternalPath takes a path external to the asset and converts it to - // a path that is relative to the asset. - // - // The returned path will be normalized and validated. - // - // Example: - // Directory: /foo/bar - // ExternalPath: /foo/bar/baz/bat.proto - // Path: baz/bat.proto - // - // Example: - // Directory: . - // ExternalPath: baz/bat.proto - // Path: baz/bat.proto - PathForExternalPath(externalPath string) (string, error) -} - -// Ref is an image file or source bucket reference. -type Ref interface { - PathResolver - - internalRef() internal.Ref -} - -// ImageRef is an image file reference. -type ImageRef interface { - Ref - ImageEncoding() ImageEncoding - IsNull() bool - internalFileRef() internal.FileRef -} - -// SourceOrModuleRef is a source bucket or module reference. -type SourceOrModuleRef interface { - Ref - isSourceOrModuleRef() -} - -// SourceRef is a source bucket reference. -type SourceRef interface { - SourceOrModuleRef - internalBucketRef() internal.BucketRef -} - -// ModuleRef is a module reference. -type ModuleRef interface { - SourceOrModuleRef - internalModuleRef() internal.ModuleRef -} - -// ProtoFileRef is a proto file reference. -type ProtoFileRef interface { - SourceRef - IncludePackageFiles() bool - internalProtoFileRef() internal.ProtoFileRef -} - -// ImageRefParser is an image ref parser for Buf. -type ImageRefParser interface { - // GetImageRef gets the reference for the image file. - GetImageRef(ctx context.Context, value string) (ImageRef, error) -} - -// SourceRefParser is a source ref parser for Buf. -type SourceRefParser interface { - // GetSourceRef gets the reference for the source file. - GetSourceRef(ctx context.Context, value string) (SourceRef, error) -} - -// ModuleRefParser is a source ref parser for Buf. -type ModuleRefParser interface { - // GetModuleRef gets the reference for the source file. - // - // A module is a special type of source with additional properties. - GetModuleRef(ctx context.Context, value string) (ModuleRef, error) -} - -// SourceOrModuleRefParser is a source or module ref parser for Buf. -type SourceOrModuleRefParser interface { - SourceRefParser - ModuleRefParser - - // GetSourceOrModuleRef gets the reference for the image file or source bucket. - GetSourceOrModuleRef(ctx context.Context, value string) (SourceOrModuleRef, error) -} - -// RefParser is a ref parser for Buf. -type RefParser interface { - ImageRefParser - SourceOrModuleRefParser - - // GetRef gets the reference for the image file, source bucket, or module. - GetRef(ctx context.Context, value string) (Ref, error) -} - -// NewRefParser returns a new RefParser. -// -// This defaults to dir or module. -func NewRefParser(logger *zap.Logger) RefParser { - return newRefParser(logger) -} - -// NewImageRefParser returns a new RefParser for images only. -// -// This defaults to binary. -func NewImageRefParser(logger *zap.Logger) ImageRefParser { - return newImageRefParser(logger) -} - -// NewSourceRefParser returns a new RefParser for sources only. -// -// This defaults to dir or module. -func NewSourceRefParser(logger *zap.Logger) SourceRefParser { - return newSourceRefParser(logger) -} - -// NewModuleRefParser returns a new RefParser for modules only. -func NewModuleRefParser(logger *zap.Logger) ModuleRefParser { - return newModuleRefParser(logger) -} - -// NewSourceOrModuleRefParser returns a new RefParser for sources or modules only. -// -// This defaults to dir or module. -func NewSourceOrModuleRefParser(logger *zap.Logger) SourceOrModuleRefParser { - return newSourceOrModuleRefParser(logger) -} - -// ReadBucketCloser is a bucket returned from GetBucket. -// We need to surface the internal.ReadBucketCloser -// interface to other packages, so we use a type -// declaration to do so. -type ReadBucketCloser internal.ReadBucketCloser - -// ReadWriteBucketCloser is a bucket returned from GetBucket. -// We need to surface the internal.ReadWriteBucketCloser -// interface to other packages, so we use a type -// declaration to do so. -type ReadWriteBucketCloser internal.ReadWriteBucketCloser - -// ReadBucketCloserWithTerminateFileProvider is a ReadBucketCloser with a TerminateFileProvider. -type ReadBucketCloserWithTerminateFileProvider internal.ReadBucketCloserWithTerminateFileProvider - -// ImageReader is an image reader. -type ImageReader interface { - // GetImageFile gets the image file. - // - // The returned file will be uncompressed. - GetImageFile( - ctx context.Context, - container app.EnvStdinContainer, - imageRef ImageRef, - ) (io.ReadCloser, error) -} - -// SourceReader is a source reader. -type SourceReader interface { - // GetSourceBucket gets the source bucket. - // - // The returned bucket will only have .proto and configuration files. - // The returned bucket may be upgradeable to a ReadWriteBucketCloser. - GetSourceBucket( - ctx context.Context, - container app.EnvStdinContainer, - sourceRef SourceRef, - options ...GetSourceBucketOption, - ) (ReadBucketCloserWithTerminateFileProvider, error) -} - -// GetSourceBucketOption is an option for GetSourceBucket. -type GetSourceBucketOption func(*getSourceBucketOptions) - -// GetSourceBucketWithWorkspacesDisabled disables workspace mode. -func GetSourceBucketWithWorkspacesDisabled() GetSourceBucketOption { - return func(o *getSourceBucketOptions) { - o.workspacesDisabled = true - } -} - -// ModuleFetcher is a module fetcher. -type ModuleFetcher interface { - // GetModule gets the module. - // Unresolved ModuleRef's are automatically resolved. - GetModule( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef ModuleRef, - ) (bufmodule.Module, error) -} - -// Reader is a reader for Buf. -type Reader interface { - ImageReader - SourceReader - ModuleFetcher -} - -// NewReader returns a new Reader. -func NewReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) Reader { - return newReader( - logger, - storageosProvider, - httpClient, - httpAuthenticator, - gitCloner, - moduleResolver, - moduleReader, - ) -} - -// NewImageReader returns a new ImageReader. -func NewImageReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, -) ImageReader { - return newImageReader( - logger, - storageosProvider, - httpClient, - httpAuthenticator, - gitCloner, - ) -} - -// NewSourceReader returns a new SourceReader. -func NewSourceReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, -) SourceReader { - return newSourceReader( - logger, - storageosProvider, - httpClient, - httpAuthenticator, - gitCloner, - ) -} - -// NewModuleFetcher returns a new ModuleFetcher. -func NewModuleFetcher( - logger *zap.Logger, - storageosProvider storageos.Provider, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) ModuleFetcher { - return newModuleFetcher( - logger, - storageosProvider, - moduleResolver, - moduleReader, - ) -} - -// Writer is a writer for Buf. -type Writer interface { - // PutImageFile puts the image file. - PutImageFile( - ctx context.Context, - container app.EnvStdoutContainer, - imageRef ImageRef, - ) (io.WriteCloser, error) -} - -// NewWriter returns a new Writer. -func NewWriter( - logger *zap.Logger, -) Writer { - return newWriter( - logger, - ) -} - -type getSourceBucketOptions struct { - workspacesDisabled bool -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/format.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/format.go deleted file mode 100644 index 73e9dfeb29..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/format.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -const ( - // formatBinpb is the binary format. - formatBinpb = "binpb" - // formatDir is the directory format. - formatDir = "dir" - // formatGit is the git format. - formatGit = "git" - // formatJSON is the JSON format. - formatJSON = "json" - // formatMod is the module format. - formatMod = "mod" - // formatTar is the tar format. - formatTar = "tar" - // formatZip is the zip format. - formatZip = "zip" - // formatProtoFile is the proto file format. - formatProtoFile = "protofile" - - // formatBin is the binary format's old form, now deprecated. - formatBin = "bin" - // formatBingz is the binary gzipped format, now deprecated. - formatBingz = "bingz" - // formatJSONGZ is the JSON gzipped format, now deprecated. - formatJSONGZ = "jsongz" - // formatTargz is the tar gzipped format, now deprecated. - formatTargz = "targz" -) - -var ( - // sorted - imageFormats = []string{ - formatBin, - formatBinpb, - formatBingz, - formatJSON, - formatJSONGZ, - } - // sorted - imageFormatsNotDeprecated = []string{ - formatBinpb, - formatJSON, - } - // sorted - sourceFormats = []string{ - formatDir, - formatGit, - formatProtoFile, - formatTar, - formatTargz, - formatZip, - } - // sorted - sourceFormatsNotDeprecated = []string{ - formatDir, - formatGit, - formatProtoFile, - formatTar, - formatZip, - } - sourceDirFormatsNotDeprecated = []string{ - formatDir, - formatGit, - formatTar, - formatZip, - } - // sorted - moduleFormats = []string{ - formatMod, - } - // sorted - moduleFormatsNotDeprecated = []string{ - formatMod, - } - // sorted - sourceOrModuleFormats = []string{ - formatDir, - formatGit, - formatMod, - formatProtoFile, - formatTar, - formatTargz, - formatZip, - } - // sorted - sourceOrModuleFormatsNotDeprecated = []string{ - formatDir, - formatGit, - formatMod, - formatProtoFile, - formatTar, - formatZip, - } - // sorted - allFormats = []string{ - formatBin, - formatBinpb, - formatBingz, - formatDir, - formatGit, - formatJSON, - formatJSONGZ, - formatMod, - formatProtoFile, - formatTar, - formatTargz, - formatZip, - } - // sorted - allFormatsNotDeprecated = []string{ - formatBinpb, - formatDir, - formatGit, - formatJSON, - formatMod, - formatProtoFile, - formatTar, - formatZip, - } - - deprecatedCompressionFormatToReplacementFormat = map[string]string{ - formatBingz: formatBinpb, - formatJSONGZ: formatJSON, - formatTargz: formatTar, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/image_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/image_ref.go deleted file mode 100644 index b9eb995228..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/image_ref.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var _ ImageRef = &imageRef{} - -type imageRef struct { - fileRef internal.FileRef - imageEncoding ImageEncoding -} - -func newImageRef( - fileRef internal.FileRef, - imageEncoding ImageEncoding, -) *imageRef { - return &imageRef{ - fileRef: fileRef, - imageEncoding: imageEncoding, - } -} - -func (r *imageRef) PathForExternalPath(externalPath string) (string, error) { - return normalpath.NormalizeAndValidate(externalPath) -} - -func (r *imageRef) ImageEncoding() ImageEncoding { - return r.imageEncoding -} - -func (r *imageRef) IsNull() bool { - return r.fileRef.FileScheme() == internal.FileSchemeNull -} - -func (r *imageRef) internalRef() internal.Ref { - return r.fileRef -} - -func (r *imageRef) internalFileRef() internal.FileRef { - return r.fileRef -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/archive_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/archive_ref.go deleted file mode 100644 index 09552f0289..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/archive_ref.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "github.com/bufbuild/buf/private/pkg/normalpath" - -var ( - _ ParsedArchiveRef = &archiveRef{} -) - -type archiveRef struct { - format string - path string - fileScheme FileScheme - archiveType ArchiveType - compressionType CompressionType - stripComponents uint32 - subDirPath string -} - -func newArchiveRef( - format string, - path string, - archiveType ArchiveType, - compressionType CompressionType, - stripComponents uint32, - subDirPath string, -) (*archiveRef, error) { - if archiveType == ArchiveTypeZip && compressionType != CompressionTypeNone { - return nil, NewCannotSpecifyCompressionForZipError() - } - singleRef, err := newSingleRef( - format, - path, - compressionType, - ) - if err != nil { - return nil, err - } - subDirPath, err = normalpath.NormalizeAndValidate(subDirPath) - if err != nil { - return nil, err - } - if subDirPath == "." { - subDirPath = "" - } - return newDirectArchiveRef( - singleRef.Format(), - singleRef.Path(), - singleRef.FileScheme(), - archiveType, - singleRef.CompressionType(), - stripComponents, - subDirPath, - ), nil -} - -func newDirectArchiveRef( - format string, - path string, - fileScheme FileScheme, - archiveType ArchiveType, - compressionType CompressionType, - stripComponents uint32, - subDirPath string, -) *archiveRef { - return &archiveRef{ - format: format, - path: path, - fileScheme: fileScheme, - archiveType: archiveType, - compressionType: compressionType, - stripComponents: stripComponents, - subDirPath: subDirPath, - } -} - -func (r *archiveRef) Format() string { - return r.format -} - -func (r *archiveRef) Path() string { - return r.path -} - -func (r *archiveRef) FileScheme() FileScheme { - return r.fileScheme -} - -func (r *archiveRef) ArchiveType() ArchiveType { - return r.archiveType -} - -func (r *archiveRef) CompressionType() CompressionType { - return r.compressionType -} - -func (r *archiveRef) StripComponents() uint32 { - return r.stripComponents -} - -func (r *archiveRef) SubDirPath() string { - return r.subDirPath -} - -func (*archiveRef) ref() {} -func (*archiveRef) fileRef() {} -func (*archiveRef) bucketRef() {} -func (*archiveRef) archiveRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/dir_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/dir_ref.go deleted file mode 100644 index a359b5d777..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/dir_ref.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/filepathextended" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var ( - _ ParsedDirRef = &dirRef{} -) - -type dirRef struct { - format string - path string -} - -func newDirRef( - format string, - path string, -) (*dirRef, error) { - if path == "" { - return nil, NewNoPathError() - } - if app.IsDevStderr(path) { - return nil, NewInvalidPathError(format, path) - } - if path == "-" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) { - return nil, NewInvalidPathError(format, path) - } - if strings.Contains(path, "://") { - return nil, NewInvalidPathError(format, path) - } - path, err := filepathextended.RealClean(path) - if err != nil { - return nil, NewRealCleanPathError(path) - } - return newDirectDirRef( - format, - normalpath.Normalize(path), - ), nil -} - -func newDirectDirRef( - format string, - path string, -) *dirRef { - return &dirRef{ - format: format, - path: path, - } -} - -func (r *dirRef) Format() string { - return r.format -} - -func (r *dirRef) Path() string { - return r.path -} - -func (*dirRef) ref() {} -func (*dirRef) bucketRef() {} -func (*dirRef) dirRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/errors.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/errors.go deleted file mode 100644 index 1c9cd4ac13..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/errors.go +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "errors" - "fmt" - "strings" -) - -var ( - knownCompressionTypeStrings = []string{ - "none", - "gzip", - "zstd", - } -) - -// NewFormatNotAllowedError is a fetch error. -func NewFormatNotAllowedError(format string, allowedFormats map[string]struct{}) error { - return fmt.Errorf("format was %q but must be one of %s", format, formatsToString(allowedFormats)) -} - -// NewFormatCannotBeDeterminedError is a fetch error. -func NewFormatCannotBeDeterminedError(value string) error { - return fmt.Errorf("format cannot be determined from %q", value) -} - -// NewCannotSpecifyGitBranchAndTagError is a fetch error. -func NewCannotSpecifyGitBranchAndTagError() error { - return errors.New(`must specify only one of "branch", "tag"`) -} - -// NewCannotSpecifyTagWithRefError is a fetch error. -func NewCannotSpecifyTagWithRefError() error { - return errors.New(`cannot specify "tag" with "ref"`) -} - -// NewDepthParseError is a fetch error. -func NewDepthParseError(s string) error { - return fmt.Errorf(`could not parse "depth" value %q`, s) -} - -// NewDepthZeroError is a fetch error. -func NewDepthZeroError() error { - return errors.New(`"depth" must be >0 if specified`) -} - -// NewPathUnknownGzError is a fetch error. -func NewPathUnknownGzError(path string) error { - return fmt.Errorf("path %q had .gz extension with unknown format", path) -} - -// NewCompressionUnknownError is a fetch error. -func NewCompressionUnknownError(compression string) error { - return fmt.Errorf("unknown compression: %q (valid values are %q)", compression, strings.Join(knownCompressionTypeStrings, ",")) -} - -// NewCannotSpecifyCompressionForZipError is a fetch error. -func NewCannotSpecifyCompressionForZipError() error { - return errors.New("cannot specify compression type for zip files") -} - -// NewNoPathError is a fetch error. -func NewNoPathError() error { - return errors.New("value has no path once processed") -} - -// NewOptionsInvalidKeyError is a fetch error. -func NewOptionsInvalidKeyError(key string) error { - return fmt.Errorf("invalid options key: %q", key) -} - -// NewOptionsInvalidForFormatError is a fetch error. -func NewOptionsInvalidForFormatError(format string, s string) error { - return fmt.Errorf("invalid options for format %q: %q", format, s) -} - -// NewOptionsCouldNotParseStripComponentsError is a fetch error. -func NewOptionsCouldNotParseStripComponentsError(s string) error { - return fmt.Errorf("could not parse strip_components value %q", s) -} - -// NewOptionsCouldNotParseRecurseSubmodulesError is a fetch error. -func NewOptionsCouldNotParseRecurseSubmodulesError(s string) error { - return fmt.Errorf("could not parse recurse_submodules value %q", s) -} - -// NewFormatOverrideNotAllowedForDevNullError is a fetch error. -func NewFormatOverrideNotAllowedForDevNullError(devNull string) error { - return fmt.Errorf("not allowed if path is %s", devNull) -} - -// NewInvalidPathError is a fetch error. -func NewInvalidPathError(format string, path string) error { - if format != "" { - format = format + " " - } - return fmt.Errorf("invalid %spath: %q", format, path) -} - -// NewProtoFileCannotBeDevPathError is a fetch error. -func NewProtoFileCannotBeDevPathError(format string, path string) error { - if format != "" { - format = format + " " - } - return fmt.Errorf("invalid %spath: %q (protofiles cannot be read or written to or from stdio)", format, path) -} - -// NewRealCleanPathError is a fetch error. -func NewRealCleanPathError(path string) error { - return fmt.Errorf("could not clean relative path %q", path) -} - -// NewFormatUnknownError is a fetch error. -func NewFormatUnknownError(formatString string) error { - return fmt.Errorf("unknown format: %q", formatString) -} - -// NewReadDisabledError is a fetch error. -func NewReadDisabledError(scheme string) error { - return fmt.Errorf("reading assets from %s disabled", scheme) -} - -// NewReadHTTPDisabledError is a fetch error. -func NewReadHTTPDisabledError() error { - return NewReadDisabledError("http") -} - -// NewReadGitDisabledError is a fetch error. -func NewReadGitDisabledError() error { - return NewReadDisabledError("git") -} - -// NewReadLocalDisabledError is a fetch error. -func NewReadLocalDisabledError() error { - return NewReadDisabledError("local") -} - -// NewReadStdioDisabledError is a fetch error. -func NewReadStdioDisabledError() error { - return NewReadDisabledError("stdin") -} - -// NewReadModuleDisabledError is a fetch error. -func NewReadModuleDisabledError() error { - return NewReadDisabledError("module") -} - -// NewWriteDisabledError is a fetch error. -func NewWriteDisabledError(scheme string) error { - return fmt.Errorf("writing assets to %s disabled", scheme) -} - -// NewWriteHTTPDisabledError is a fetch error. -func NewWriteHTTPDisabledError() error { - return NewWriteDisabledError("http") -} - -// NewWriteLocalDisabledError is a fetch error. -func NewWriteLocalDisabledError() error { - return NewWriteDisabledError("local") -} - -// NewWriteStdioDisabledError is a fetch error. -func NewWriteStdioDisabledError() error { - return NewWriteDisabledError("stdout") -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/git_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/git_ref.go deleted file mode 100644 index 1fecaf4b35..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/git_ref.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var ( - _ ParsedGitRef = &gitRef{} - - gitSchemePrefixToGitScheme = map[string]GitScheme{ - "http://": GitSchemeHTTP, - "https://": GitSchemeHTTPS, - "file://": GitSchemeLocal, - "ssh://": GitSchemeSSH, - "git://": GitSchemeGit, - } -) - -type gitRef struct { - format string - path string - gitScheme GitScheme - gitName git.Name - depth uint32 - recurseSubmodules bool - subDirPath string -} - -func newGitRef( - format string, - path string, - gitName git.Name, - depth uint32, - recurseSubmodules bool, - subDirPath string, -) (*gitRef, error) { - gitScheme, path, err := getGitSchemeAndPath(format, path) - if err != nil { - return nil, err - } - if depth == 0 { - return nil, NewDepthZeroError() - } - subDirPath, err = normalpath.NormalizeAndValidate(subDirPath) - if err != nil { - return nil, err - } - if subDirPath == "." { - subDirPath = "" - } - return newDirectGitRef( - format, - path, - gitScheme, - gitName, - recurseSubmodules, - depth, - subDirPath, - ), nil -} - -func newDirectGitRef( - format string, - path string, - gitScheme GitScheme, - gitName git.Name, - recurseSubmodules bool, - depth uint32, - subDirPath string, -) *gitRef { - return &gitRef{ - format: format, - path: path, - gitScheme: gitScheme, - gitName: gitName, - depth: depth, - recurseSubmodules: recurseSubmodules, - subDirPath: subDirPath, - } -} - -func (r *gitRef) Format() string { - return r.format -} - -func (r *gitRef) Path() string { - return r.path -} - -func (r *gitRef) GitScheme() GitScheme { - return r.gitScheme -} - -func (r *gitRef) GitName() git.Name { - return r.gitName -} - -func (r *gitRef) Depth() uint32 { - return r.depth -} - -func (r *gitRef) RecurseSubmodules() bool { - return r.recurseSubmodules -} - -func (r *gitRef) SubDirPath() string { - return r.subDirPath -} - -func (*gitRef) ref() {} -func (*gitRef) bucketRef() {} -func (*gitRef) gitRef() {} - -func getGitSchemeAndPath(format string, path string) (GitScheme, string, error) { - if path == "" { - return 0, "", NewNoPathError() - } - if app.IsDevStderr(path) { - return 0, "", NewInvalidPathError(format, path) - } - if path == "-" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) { - return 0, "", NewInvalidPathError(format, path) - } - for prefix, gitScheme := range gitSchemePrefixToGitScheme { - if strings.HasPrefix(path, prefix) { - path := strings.TrimPrefix(path, prefix) - if gitScheme == GitSchemeLocal { - path = normalpath.Normalize(path) - } - if path == "" { - return 0, "", NewNoPathError() - } - return gitScheme, path, nil - } - } - if strings.Contains(path, "://") { - return 0, "", NewInvalidPathError(format, path) - } - return GitSchemeLocal, normalpath.Normalize(path), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/internal.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/internal.go deleted file mode 100644 index 5983dc7658..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/internal.go +++ /dev/null @@ -1,813 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "context" - "io" - "net/http" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/httpauth" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -const ( - // FileSchemeHTTP is the http file scheme. - FileSchemeHTTP FileScheme = iota + 1 - // FileSchemeHTTPS is the https file scheme. - FileSchemeHTTPS - // FileSchemeLocal is the local file scheme. - FileSchemeLocal - // FileSchemeStdio is the stdio file scheme. - // - // This can reference either stdin or stdout depending on if we are - // reading or writing. - FileSchemeStdio - // FileSchemeStdin is the stdin file scheme. - FileSchemeStdin - // FileSchemeStdout is the stdout file scheme. - FileSchemeStdout - // FileSchemeNull is the null file scheme. - FileSchemeNull - - // GitSchemeHTTP is the http git scheme. - GitSchemeHTTP GitScheme = iota + 1 - // GitSchemeHTTPS is the https git scheme. - GitSchemeHTTPS - // GitSchemeLocal is the local git scheme. - GitSchemeLocal - // GitSchemeSSH is the ssh git scheme. - GitSchemeSSH - // GitSchemeGit is the git git scheme. - GitSchemeGit - - // ArchiveTypeTar is a tar archive. - ArchiveTypeTar ArchiveType = iota + 1 - // ArchiveTypeZip is a zip archive. - ArchiveTypeZip - - // CompressionTypeNone is no compression. - CompressionTypeNone CompressionType = iota + 1 - // CompressionTypeGzip is gzip compression. - CompressionTypeGzip - // CompressionTypeZstd is zstd compression. - CompressionTypeZstd -) - -// FileScheme is a file scheme. -type FileScheme int - -// GitScheme is a git scheme. -type GitScheme int - -// ArchiveType is a archive type. -type ArchiveType int - -// CompressionType is a compression type. -type CompressionType int - -// Ref is a reference. -type Ref interface { - ref() -} - -// FileRef is a file reference. -type FileRef interface { - Ref - // Path is the path to the reference. - // - // This will be the non-empty path minus the scheme for http and https files. - // This will be the non-empty normalized file path for local files. - // This will be empty for stdio and null files. - Path() string - FileScheme() FileScheme - CompressionType() CompressionType - fileRef() -} - -// BucketRef is a bucket reference. -type BucketRef interface { - Ref - bucketRef() -} - -// SingleRef is a non-archive file reference. -type SingleRef interface { - FileRef - singleRef() -} - -// NewSingleRef returns a new SingleRef. -func NewSingleRef(path string, compressionType CompressionType) (SingleRef, error) { - return newSingleRef("", path, compressionType) -} - -// ArchiveRef is an archive reference. -// -// An ArchiveRef is a special type of reference that can be either a FileRef or a BucketRef. -// Note that if ArchiveType is ArchiveTypeZip, CompressionType will always be CompressionTypeNone. -type ArchiveRef interface { - FileRef - BucketRef - ArchiveType() ArchiveType - // Applied before subdir - StripComponents() uint32 - // Will be empty instead of "." for root directory - SubDirPath() string - archiveRef() -} - -// NewArchiveRef returns a new ArchiveRef. -func NewArchiveRef( - path string, - archiveType ArchiveType, - compressionType CompressionType, - stripComponents uint32, - subDirPath string, -) (ArchiveRef, error) { - return newArchiveRef("", path, archiveType, compressionType, stripComponents, subDirPath) -} - -// DirRef is a local directory reference. -type DirRef interface { - // Path is the path to the reference. - // - // This will be the non-empty normalized directory path for directories. - Path() string - BucketRef - dirRef() -} - -// NewDirRef returns a new DirRef. -func NewDirRef(path string) (DirRef, error) { - return newDirRef("", path) -} - -// ProtoFileRef is a file reference that incorporates a BucketRef. -type ProtoFileRef interface { - BucketRef - // Path is the normalized path to the file reference. - Path() string - // IncludePackageFiles says to include the same package files TODO update comment - IncludePackageFiles() bool - protoFileRef() -} - -// GitRef is a git reference. -type GitRef interface { - // Path is the path to the reference. - // - // This will be the non-empty path minus the scheme for http, https, ssh, and git repositories. - // This will be the non-empty normalized directory path for local git repositories. - Path() string - BucketRef - GitScheme() GitScheme - // Optional. May be nil, in which case clone the default branch. - GitName() git.Name - // Will always be >= 1 - Depth() uint32 - RecurseSubmodules() bool - // Will be empty instead of "." for root directory - SubDirPath() string - gitRef() -} - -// NewGitRef returns a new GitRef. -func NewGitRef( - path string, - gitName git.Name, - depth uint32, - recurseSubmodules bool, - subDirPath string, -) (GitRef, error) { - return newGitRef("", path, gitName, depth, recurseSubmodules, subDirPath) -} - -// ModuleRef is a module reference. -type ModuleRef interface { - Ref - ModuleReference() bufmoduleref.ModuleReference - moduleRef() -} - -// NewModuleRef returns a new ModuleRef. -// -// The path must be in the form server/owner/repository/branch[:digest]. -func NewModuleRef(path string) (ModuleRef, error) { - return newModuleRef("", path) -} - -// HasFormat is an object that has a format. -type HasFormat interface { - Format() string -} - -// ParsedRef is a parsed Ref. -type ParsedRef interface { - Ref - HasFormat -} - -// ParsedFileRef is a parsed FileRef. -type ParsedFileRef interface { - FileRef - HasFormat -} - -// ParsedBucketRef is a parsed BucketRef. -type ParsedBucketRef interface { - BucketRef - HasFormat -} - -// ParsedSingleRef is a parsed SingleRef. -type ParsedSingleRef interface { - SingleRef - HasFormat -} - -// NewDirectParsedSingleRef returns a new ParsedSingleRef with no validation checks. -// -// This should only be used for testing. -func NewDirectParsedSingleRef( - format string, - path string, - fileScheme FileScheme, - compressionType CompressionType, -) ParsedSingleRef { - return newDirectSingleRef( - format, - path, - fileScheme, - compressionType, - ) -} - -// ParsedArchiveRef is a parsed ArchiveRef. -type ParsedArchiveRef interface { - ArchiveRef - HasFormat -} - -// NewDirectParsedArchiveRef returns a new ParsedArchiveRef with no validation checks. -// -// This should only be used for testing. -func NewDirectParsedArchiveRef( - format string, - path string, - fileScheme FileScheme, - archiveType ArchiveType, - compressionType CompressionType, - stripComponents uint32, - subDirPath string, -) ParsedArchiveRef { - return newDirectArchiveRef( - format, - path, - fileScheme, - archiveType, - compressionType, - stripComponents, - subDirPath, - ) -} - -// ParsedDirRef is a parsed DirRef. -type ParsedDirRef interface { - DirRef - HasFormat -} - -// NewDirectParsedDirRef returns a new ParsedDirRef with no validation checks. -// -// This should only be used for testing. -func NewDirectParsedDirRef(format string, path string) ParsedDirRef { - return newDirectDirRef(format, path) -} - -// ParsedProtoFileRef is a parsed ProtoFileRef. -type ParsedProtoFileRef interface { - ProtoFileRef - HasFormat -} - -// ParsedGitRef is a parsed GitRef. -type ParsedGitRef interface { - GitRef - HasFormat -} - -// NewDirectParsedGitRef returns a new ParsedGitRef with no validation checks. -// -// This should only be used for testing. -func NewDirectParsedGitRef( - format string, - path string, - gitScheme GitScheme, - gitName git.Name, - recurseSubmodules bool, - depth uint32, - subDirPath string, -) ParsedGitRef { - return newDirectGitRef( - format, - path, - gitScheme, - gitName, - recurseSubmodules, - depth, - subDirPath, - ) -} - -// ParsedModuleRef is a parsed ModuleRef. -type ParsedModuleRef interface { - ModuleRef - HasFormat -} - -// NewDirectParsedModuleRef returns a new ParsedModuleRef with no validation checks. -// -// This should only be used for testing. -func NewDirectParsedModuleRef( - format string, - moduleReference bufmoduleref.ModuleReference, -) ParsedModuleRef { - return newDirectModuleRef( - format, - moduleReference, - ) -} - -// RefParser parses references. -type RefParser interface { - // GetParsedRef gets the ParsedRef for the value. - // - // The returned ParsedRef will be either a ParsedSingleRef, ParsedArchiveRef, ParsedDirRef, ParsedGitRef, or ParsedModuleRef. - // - // The options should be used to validate that you are getting one of the correct formats. - GetParsedRef(ctx context.Context, value string, options ...GetParsedRefOption) (ParsedRef, error) -} - -// NewRefParser returns a new RefParser. -func NewRefParser(logger *zap.Logger, options ...RefParserOption) RefParser { - return newRefParser(logger, options...) -} - -// TerminateFileProvider provides TerminateFiles. -type TerminateFileProvider interface { - // GetTerminateFiles returns the list of terminate files in priority order. - GetTerminateFiles() []TerminateFile -} - -// TerminateFile is a terminate file. -type TerminateFile interface { - // Name returns the name of the TerminateFile (i.e. the base of the fully-qualified file paths). - Name() string - // Path returns the normalized directory path where the TemrinateFile is located. - Path() string -} - -// ReadBucketCloserWithTerminateFileProvider is a ReadBucketCloser with a TerminateFileProvider. -type ReadBucketCloserWithTerminateFileProvider interface { - ReadBucketCloser - - // TerminateFileProvider returns a TerminateFileProvider. - TerminateFileProvider() TerminateFileProvider -} - -// ReadBucketCloser is a bucket returned from GetBucket. -type ReadBucketCloser interface { - storage.ReadBucketCloser - - // RelativeRootPath is the relative path to the root of the bucket - // based on the current working directory. - // - // This will be set if a terminate filename was specified and found. - RelativeRootPath() string - // SubDirPath is the subdir within the Bucket of the actual asset. - // - // This will be set if a terminate filename was specified and found. - // If so, the actual Bucket will be the directory that contained - // this terminate file, and the subdir will be the subdir of - // the actual asset relative to the terminate file. - SubDirPath() string - // SetSubDirPath sets the value of `SubDirPath`. - // - // This should only be called if a terminate file name was specified and found outside of - // a workspace where the bucket is originally closed. - SetSubDirPath(string) -} - -// ReadWriteBucketCloser is a bucket potentially returned from GetBucket. -// -// The returned ReadBucketCloser may be upgradeable to a ReadWriteBucketCloser. -type ReadWriteBucketCloser interface { - ReadBucketCloser - storage.WriteBucket -} - -// Reader is a reader. -type Reader interface { - // GetFile gets the file. - // SingleRefs and ArchiveRefs will result in decompressed files unless KeepFileCompression is set. - GetFile( - ctx context.Context, - container app.EnvStdinContainer, - fileRef FileRef, - options ...GetFileOption, - ) (io.ReadCloser, error) - // GetBucket gets the bucket. - // - // The returned ReadBucketCloser may actually be upgradeable to a ReadWriteBucketCloser. - GetBucket( - ctx context.Context, - container app.EnvStdinContainer, - bucketRef BucketRef, - options ...GetBucketOption, - ) (ReadBucketCloserWithTerminateFileProvider, error) - // GetModule gets the module. - GetModule( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef ModuleRef, - options ...GetModuleOption, - ) (bufmodule.Module, error) -} - -// NewReader returns a new Reader. -func NewReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - options ...ReaderOption, -) Reader { - return newReader( - logger, - storageosProvider, - options..., - ) -} - -// Writer is a writer. -type Writer interface { - // PutFile puts the file. - PutFile( - ctx context.Context, - container app.EnvStdoutContainer, - fileRef FileRef, - options ...PutFileOption, - ) (io.WriteCloser, error) -} - -// NewWriter returns a new Writer. -func NewWriter( - logger *zap.Logger, - options ...WriterOption, -) Writer { - return newWriter( - logger, - options..., - ) -} - -// RawRef is an unprocessed ref used for WithRefProcessor. -// -// A RawRefProcessor will allow modifications to a RawRef before continuing parsing. -// This allows defaults to be inferred from the path. -// -// The Path will be the only value set when the RawRefProcessor is invoked, and is not normalized. -// After the RawRefProcessor is called, options will be parsed. -type RawRef struct { - // Will always be set - // Not normalized yet - Path string - // Will always be set - // Set via RawRefProcessor if not explicitly set - Format string - // Only set for single, archive formats - // Cannot be set for zip archives - CompressionType CompressionType - // Only set for archive, git formats - SubDirPath string - // Only set for git formats - // Only one of GitBranch and GitTag will be set - GitBranch string - // Only set for git formats - // Only one of GitBranch and GitTag will be set - GitTag string - // Only set for git formats - // Specifies an exact git reference to use with git checkout. - // Can be used on its own or with GitBranch. Not allowed with GitTag. - // This is defined as anything that can be given to git checkout. - GitRef string - // Only set for git formats - GitRecurseSubmodules bool - // Only set for git formats. - // The depth to use when cloning a repository. Only allowed when GitRef - // is set. Defaults to 50 if unset. - GitDepth uint32 - // Only set for archive formats - ArchiveStripComponents uint32 - // Only set for proto file ref format. - // Sets whether or not to include the files in the rest of the package - // in the image for the ProtoFileRef. - // This defaults to false. - IncludePackageFiles bool -} - -// RefParserOption is an RefParser option. -type RefParserOption func(*refParser) - -// WithRawRefProcessor attaches the given RawRefProcessor. -// -// If format is not manually specified, the RefParser will use this format parser -// with the raw path, that is not normalized. -func WithRawRefProcessor(rawRefProcessor func(*RawRef) error) RefParserOption { - return func(refParser *refParser) { - refParser.rawRefProcessor = rawRefProcessor - } -} - -// WithSingleFormat attaches the given format as a single format. -// -// It is up to the user to not incorrectly attached a format twice. -func WithSingleFormat(format string, options ...SingleFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - singleFormatInfo := newSingleFormatInfo() - for _, option := range options { - option(singleFormatInfo) - } - refParser.singleFormatToInfo[format] = singleFormatInfo - } -} - -// WithArchiveFormat attaches the given format as an archive format. -// -// It is up to the user to not incorrectly attached a format twice. -func WithArchiveFormat(format string, archiveType ArchiveType, options ...ArchiveFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - archiveFormatInfo := newArchiveFormatInfo(archiveType) - for _, option := range options { - option(archiveFormatInfo) - } - refParser.archiveFormatToInfo[format] = archiveFormatInfo - } -} - -// WithDirFormat attaches the given format as a dir format. -// -// It is up to the user to not incorrectly attached a format twice. -func WithDirFormat(format string, options ...DirFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - dirFormatInfo := newDirFormatInfo() - for _, option := range options { - option(dirFormatInfo) - } - refParser.dirFormatToInfo[format] = dirFormatInfo - } -} - -// WithGitFormat attaches the given format as a git format. -// -// It is up to the user to not incorrectly attached a format twice. -func WithGitFormat(format string, options ...GitFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - gitFormatInfo := newGitFormatInfo() - for _, option := range options { - option(gitFormatInfo) - } - refParser.gitFormatToInfo[format] = gitFormatInfo - } -} - -// WithModuleFormat attaches the given format as a module format. -// -// It is up to the user to not incorrectly attach a format twice. -func WithModuleFormat(format string, options ...ModuleFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - moduleFormatInfo := newModuleFormatInfo() - for _, option := range options { - option(moduleFormatInfo) - } - refParser.moduleFormatToInfo[format] = moduleFormatInfo - } -} - -// WithProtoFileFormat attaches the given format as a single file format. -// -// It is up to the user to not incorrectly attach a format twice. -func WithProtoFileFormat(format string, options ...ProtoFileFormatOption) RefParserOption { - return func(refParser *refParser) { - format = normalizeFormat(format) - if format == "" { - return - } - protoFileFormatInfo := newProtoFileFormatInfo() - for _, option := range options { - option(protoFileFormatInfo) - } - refParser.protoFileFormatToInfo[format] = protoFileFormatInfo - } -} - -// SingleFormatOption is a single format option. -type SingleFormatOption func(*singleFormatInfo) - -// WithSingleDefaultCompressionType sets the default compression type. -func WithSingleDefaultCompressionType(defaultCompressionType CompressionType) SingleFormatOption { - return func(singleFormatInfo *singleFormatInfo) { - singleFormatInfo.defaultCompressionType = defaultCompressionType - } -} - -// ArchiveFormatOption is a archive format option. -type ArchiveFormatOption func(*archiveFormatInfo) - -// WithArchiveDefaultCompressionType sets the default compression type. -// -// Note this should never be set for zip. -func WithArchiveDefaultCompressionType(defaultCompressionType CompressionType) ArchiveFormatOption { - return func(archiveFormatInfo *archiveFormatInfo) { - archiveFormatInfo.defaultCompressionType = defaultCompressionType - } -} - -// DirFormatOption is a dir format option. -type DirFormatOption func(*dirFormatInfo) - -// GitFormatOption is a git format option. -type GitFormatOption func(*gitFormatInfo) - -// ModuleFormatOption is a module format option. -type ModuleFormatOption func(*moduleFormatInfo) - -// ReaderOption is a Reader option. -type ReaderOption func(*reader) - -// ProtoFileFormatOption is a single file format option. -type ProtoFileFormatOption func(*protoFileFormatInfo) - -// WithReaderHTTP enables HTTP. -func WithReaderHTTP(httpClient *http.Client, httpAuthenticator httpauth.Authenticator) ReaderOption { - return func(reader *reader) { - reader.httpEnabled = true - reader.httpClient = httpClient - reader.httpAuthenticator = httpAuthenticator - } -} - -// WithReaderGit enables Git. -func WithReaderGit(gitCloner git.Cloner) ReaderOption { - return func(reader *reader) { - reader.gitEnabled = true - reader.gitCloner = gitCloner - } -} - -// WithReaderModule enables modules. -func WithReaderModule( - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) ReaderOption { - return func(reader *reader) { - reader.moduleEnabled = true - reader.moduleResolver = moduleResolver - reader.moduleReader = moduleReader - } -} - -// WithReaderLocal enables local. -func WithReaderLocal() ReaderOption { - return func(reader *reader) { - reader.localEnabled = true - } -} - -// WithReaderStdio enables stdio. -func WithReaderStdio() ReaderOption { - return func(reader *reader) { - reader.stdioEnabled = true - } -} - -// WriterOption is an Writer option. -type WriterOption func(*writer) - -// WithWriterLocal enables local. -func WithWriterLocal() WriterOption { - return func(writer *writer) { - writer.localEnabled = true - } -} - -// WithWriterStdio enables stdio. -func WithWriterStdio() WriterOption { - return func(writer *writer) { - writer.stdioEnabled = true - } -} - -// GetParsedRefOption is a GetParsedRef option. -type GetParsedRefOption func(*getParsedRefOptions) - -// WithAllowedFormats limits the allowed formats to the given formats. -func WithAllowedFormats(formats ...string) GetParsedRefOption { - return func(getParsedRefOptions *getParsedRefOptions) { - for _, format := range formats { - getParsedRefOptions.allowedFormats[normalizeFormat(format)] = struct{}{} - } - } -} - -// GetFileOption is a GetFile option. -type GetFileOption func(*getFileOptions) - -// WithGetFileKeepFileCompression says to return compressed. -func WithGetFileKeepFileCompression() GetFileOption { - return func(getFileOptions *getFileOptions) { - getFileOptions.keepFileCompression = true - } -} - -// GetBucketOption is a GetBucket option. -type GetBucketOption func(*getBucketOptions) - -// WithGetBucketTerminateFileNames only applies if subdir is specified. -// -// The terminate files are organized as a slice of slices of file names. -// Priority will be given to the first slice of terminate file names, which will be workspace -// configuration files. The second layer of priority will be given to modules. -// -// This says that for a given subdir, ascend directories until you reach -// a file with one of these names, and if you do, the returned bucket will be -// for the directory with this filename, while SubDirPath on the -// returned bucket will be set to the original subdir relative -// to the terminate file. -// -// This is used for workspaces and modules. So if you have i.e. "proto/foo" -// subdir, and terminate file "proto/buf.work.yaml", the returned bucket will -// be for "proto", and the SubDirPath will be "foo". -// -// The terminateFileNames are expected to be valid and have no slashes. -// Example of terminateFileNames: -// -// [][]string{ -// []string{"buf.work.yaml", "buf.work"}, -// []string{"buf.yaml", "buf.mod"}, -// }. -func WithGetBucketTerminateFileNames(terminateFileNames [][]string) GetBucketOption { - return func(getBucketOptions *getBucketOptions) { - getBucketOptions.terminateFileNames = terminateFileNames - } -} - -// PutFileOption is a PutFile option. -type PutFileOption func(*putFileOptions) - -// WithPutFileNoFileCompression says to put s uncompressed. -func WithPutFileNoFileCompression() PutFileOption { - return func(putFileOptions *putFileOptions) { - putFileOptions.noFileCompression = true - } -} - -// GetModuleOption is a GetModule option. -type GetModuleOption func(*getModuleOptions) diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/module_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/module_ref.go deleted file mode 100644 index 68230f87ad..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/module_ref.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" -) - -var ( - _ ParsedModuleRef = &moduleRef{} -) - -type moduleRef struct { - format string - moduleReference bufmoduleref.ModuleReference -} - -func newModuleRef( - format string, - path string, -) (*moduleRef, error) { - if path == "" { - return nil, NewNoPathError() - } - if app.IsDevStderr(path) { - return nil, NewInvalidPathError(format, path) - } - if path == "-" || app.IsDevNull(path) || app.IsDevStdin(path) || app.IsDevStdout(path) { - return nil, NewInvalidPathError(format, path) - } - if strings.Contains(path, "://") { - return nil, NewInvalidPathError(format, path) - } - moduleReference, err := bufmoduleref.ModuleReferenceForString(path) - if err != nil { - // TODO: this is dumb - return nil, NewInvalidPathError(format, path) - } - return newDirectModuleRef(format, moduleReference), nil -} - -func newDirectModuleRef(format string, moduleReference bufmoduleref.ModuleReference) *moduleRef { - return &moduleRef{ - format: format, - moduleReference: moduleReference, - } -} - -func (r *moduleRef) Format() string { - return r.format -} - -func (r *moduleRef) ModuleReference() bufmoduleref.ModuleReference { - return r.moduleReference -} - -func (*moduleRef) ref() {} -func (*moduleRef) bucketRef() {} -func (*moduleRef) moduleRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/proto_file_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/proto_file_ref.go deleted file mode 100644 index 90a3989573..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/proto_file_ref.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "github.com/bufbuild/buf/private/pkg/app" - -var ( - _ ParsedProtoFileRef = &protoFileRef{} -) - -type protoFileRef struct { - format string - path string - includePackageFiles bool -} - -func newProtoFileRef(format string, path string, includePackageFiles bool) (*protoFileRef, error) { - if app.IsDevPath(path) || path == "-" { - return nil, NewProtoFileCannotBeDevPathError(format, path) - } - return &protoFileRef{ - format: format, - path: path, - includePackageFiles: includePackageFiles, - }, nil -} - -func (s *protoFileRef) Format() string { - return s.format -} - -func (s *protoFileRef) Path() string { - return s.path -} - -func (s *protoFileRef) IncludePackageFiles() bool { - return s.includePackageFiles -} - -func (*protoFileRef) ref() {} -func (*protoFileRef) bucketRef() {} -func (*protoFileRef) protoFileRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer.go deleted file mode 100644 index 5dcfbed174..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" -) - -var _ ReadBucketCloser = &readBucketCloser{} - -type readBucketCloser struct { - storage.ReadBucketCloser - - relativeRootPath string - subDirPath string -} - -func newReadBucketCloser( - storageReadBucketCloser storage.ReadBucketCloser, - relativeRootPath string, - subDirPath string, -) (*readBucketCloser, error) { - normalizedSubDirPath, err := normalpath.NormalizeAndValidate(subDirPath) - if err != nil { - return nil, err - } - return &readBucketCloser{ - ReadBucketCloser: storageReadBucketCloser, - relativeRootPath: normalpath.Normalize(relativeRootPath), - subDirPath: normalizedSubDirPath, - }, nil -} - -func (r *readBucketCloser) RelativeRootPath() string { - return r.relativeRootPath -} - -func (r *readBucketCloser) SubDirPath() string { - return r.subDirPath -} - -func (r *readBucketCloser) SetSubDirPath(subDirPath string) { - r.subDirPath = subDirPath -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer_terminate_file_provider.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer_terminate_file_provider.go deleted file mode 100644 index 678ed62f5c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_bucket_closer_terminate_file_provider.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -var _ ReadBucketCloserWithTerminateFileProvider = &readBucketCloserWithTerminateFileProvider{} - -type readBucketCloserWithTerminateFileProvider struct { - ReadBucketCloser - - terminateFileProvider TerminateFileProvider -} - -func newReadBucketCloserWithTerminateFiles( - readBucketCloser ReadBucketCloser, - terminateFileProvider TerminateFileProvider, -) *readBucketCloserWithTerminateFileProvider { - return &readBucketCloserWithTerminateFileProvider{ - ReadBucketCloser: readBucketCloser, - terminateFileProvider: terminateFileProvider, - } -} - -func (r *readBucketCloserWithTerminateFileProvider) TerminateFileProvider() TerminateFileProvider { - return r.terminateFileProvider -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_write_bucket_closer.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_write_bucket_closer.go deleted file mode 100644 index 0e86512e30..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/read_write_bucket_closer.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" -) - -var _ ReadWriteBucketCloser = &readWriteBucketCloser{} - -type readWriteBucketCloser struct { - storage.ReadWriteBucketCloser - - relativeRootPath string - subDirPath string -} - -func newReadWriteBucketCloser( - storageReadWriteBucketCloser storage.ReadWriteBucketCloser, - relativeRootPath string, - subDirPath string, -) (*readWriteBucketCloser, error) { - normalizedSubDirPath, err := normalpath.NormalizeAndValidate(subDirPath) - if err != nil { - return nil, err - } - return &readWriteBucketCloser{ - ReadWriteBucketCloser: storageReadWriteBucketCloser, - relativeRootPath: normalpath.Normalize(relativeRootPath), - subDirPath: normalizedSubDirPath, - }, nil -} - -func (r *readWriteBucketCloser) RelativeRootPath() string { - return r.relativeRootPath -} - -func (r *readWriteBucketCloser) SubDirPath() string { - return r.subDirPath -} - -func (r *readWriteBucketCloser) SetSubDirPath(subDirPath string) { - r.subDirPath = subDirPath -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/reader.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/reader.go deleted file mode 100644 index 2cc4de422c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/reader.go +++ /dev/null @@ -1,914 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "net/http" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/httpauth" - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/osextended" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagearchive" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/klauspost/compress/zstd" - "github.com/klauspost/pgzip" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type reader struct { - logger *zap.Logger - storageosProvider storageos.Provider - - localEnabled bool - stdioEnabled bool - - httpEnabled bool - httpClient *http.Client - httpAuthenticator httpauth.Authenticator - - gitEnabled bool - gitCloner git.Cloner - - moduleEnabled bool - moduleReader bufmodule.ModuleReader - moduleResolver bufmodule.ModuleResolver - tracer trace.Tracer -} - -func newReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - options ...ReaderOption, -) *reader { - reader := &reader{ - logger: logger, - storageosProvider: storageosProvider, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - } - for _, option := range options { - option(reader) - } - return reader -} - -func (r *reader) GetFile( - ctx context.Context, - container app.EnvStdinContainer, - fileRef FileRef, - options ...GetFileOption, -) (io.ReadCloser, error) { - getFileOptions := newGetFileOptions() - for _, option := range options { - option(getFileOptions) - } - switch t := fileRef.(type) { - case SingleRef: - return r.getSingle( - ctx, - container, - t, - getFileOptions.keepFileCompression, - ) - case ArchiveRef: - return r.getArchiveFile( - ctx, - container, - t, - getFileOptions.keepFileCompression, - ) - default: - return nil, fmt.Errorf("unknown FileRef type: %T", fileRef) - } -} - -func (r *reader) GetBucket( - ctx context.Context, - container app.EnvStdinContainer, - bucketRef BucketRef, - options ...GetBucketOption, -) (ReadBucketCloserWithTerminateFileProvider, error) { - getBucketOptions := newGetBucketOptions() - for _, option := range options { - option(getBucketOptions) - } - switch t := bucketRef.(type) { - case ArchiveRef: - return r.getArchiveBucket( - ctx, - container, - t, - getBucketOptions.terminateFileNames, - ) - case DirRef: - return r.getDirBucket( - ctx, - container, - t, - getBucketOptions.terminateFileNames, - ) - case GitRef: - return r.getGitBucket( - ctx, - container, - t, - getBucketOptions.terminateFileNames, - ) - case ProtoFileRef: - return r.getProtoFileBucket( - ctx, - container, - t, - getBucketOptions.terminateFileNames, - ) - default: - return nil, fmt.Errorf("unknown BucketRef type: %T", bucketRef) - } -} - -func (r *reader) GetModule( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef ModuleRef, - _ ...GetModuleOption, -) (bufmodule.Module, error) { - switch t := moduleRef.(type) { - case ModuleRef: - return r.getModule( - ctx, - container, - t, - ) - default: - return nil, fmt.Errorf("unknown ModuleRef type: %T", moduleRef) - } -} - -func (r *reader) getSingle( - ctx context.Context, - container app.EnvStdinContainer, - singleRef SingleRef, - keepFileCompression bool, -) (io.ReadCloser, error) { - readCloser, _, err := r.getFileReadCloserAndSize(ctx, container, singleRef, keepFileCompression) - return readCloser, err -} - -func (r *reader) getArchiveFile( - ctx context.Context, - container app.EnvStdinContainer, - archiveRef ArchiveRef, - keepFileCompression bool, -) (io.ReadCloser, error) { - readCloser, _, err := r.getFileReadCloserAndSize(ctx, container, archiveRef, keepFileCompression) - return readCloser, err -} - -func (r *reader) getArchiveBucket( - ctx context.Context, - container app.EnvStdinContainer, - archiveRef ArchiveRef, - terminateFileNames [][]string, -) (_ ReadBucketCloserWithTerminateFileProvider, retErr error) { - subDirPath, err := normalpath.NormalizeAndValidate(archiveRef.SubDirPath()) - if err != nil { - return nil, err - } - readCloser, size, err := r.getFileReadCloserAndSize(ctx, container, archiveRef, false) - if err != nil { - return nil, err - } - readWriteBucket := storagemem.NewReadWriteBucket() - ctx, span := r.tracer.Start(ctx, "unarchive") - defer span.End() - defer func() { - retErr = multierr.Append(retErr, readCloser.Close()) - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - switch archiveType := archiveRef.ArchiveType(); archiveType { - case ArchiveTypeTar: - if err := storagearchive.Untar( - ctx, - readCloser, - readWriteBucket, - nil, - archiveRef.StripComponents(), - ); err != nil { - return nil, err - } - case ArchiveTypeZip: - var readerAt io.ReaderAt - if size < 0 { - data, err := io.ReadAll(readCloser) - if err != nil { - return nil, err - } - readerAt = bytes.NewReader(data) - size = int64(len(data)) - } else { - readerAt, err = ioextended.ReaderAtForReader(readCloser) - if err != nil { - return nil, err - } - } - if err := storagearchive.Unzip( - ctx, - readerAt, - size, - readWriteBucket, - nil, - archiveRef.StripComponents(), - ); err != nil { - return nil, err - } - default: - return nil, fmt.Errorf("unknown ArchiveType: %v", archiveType) - } - terminateFileProvider, err := getTerminateFileProviderForBucket(ctx, readWriteBucket, subDirPath, terminateFileNames) - if err != nil { - return nil, err - } - var terminateFileDirectoryPath string - // Get the highest priority file found and use it as the terminate file directory path. - terminateFiles := terminateFileProvider.GetTerminateFiles() - if len(terminateFiles) != 0 { - terminateFileDirectoryPath = terminateFiles[0].Path() - } - if terminateFileDirectoryPath != "" { - relativeSubDirPath, err := normalpath.Rel(terminateFileDirectoryPath, subDirPath) - if err != nil { - return nil, err - } - readBucketCloser, err := newReadBucketCloser( - storage.NopReadBucketCloser(storage.MapReadBucket(readWriteBucket, storage.MapOnPrefix(terminateFileDirectoryPath))), - terminateFileDirectoryPath, - relativeSubDirPath, - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readBucketCloser, - nil, - ), nil - } - var readBucket storage.ReadBucket = readWriteBucket - if subDirPath != "." { - readBucket = storage.MapReadBucket(readWriteBucket, storage.MapOnPrefix(subDirPath)) - } - readBucketCloser, err := newReadBucketCloser( - storage.NopReadBucketCloser(readBucket), - "", - "", - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readBucketCloser, - nil, - ), nil -} - -func (r *reader) getDirBucket( - ctx context.Context, - container app.EnvStdinContainer, - dirRef DirRef, - terminateFileNames [][]string, -) (ReadBucketCloserWithTerminateFileProvider, error) { - if !r.localEnabled { - return nil, NewReadLocalDisabledError() - } - terminateFileProvider, err := getTerminateFileProviderForOS(dirRef.Path(), terminateFileNames) - if err != nil { - return nil, err - } - rootPath, dirRelativePath, err := r.getBucketRootPathAndRelativePath(ctx, container, dirRef.Path(), terminateFileProvider) - if err != nil { - return nil, err - } - readWriteBucket, err := r.storageosProvider.NewReadWriteBucket( - rootPath, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return nil, err - } - if dirRelativePath != "" { - // Verify that the subDirPath exists too. - if _, err := r.storageosProvider.NewReadWriteBucket( - normalpath.Join(rootPath, dirRelativePath), - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ); err != nil { - return nil, err - } - readWriteBucketCloser, err := newReadWriteBucketCloser( - storage.NopReadWriteBucketCloser(readWriteBucket), - rootPath, - dirRelativePath, - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readWriteBucketCloser, - nil, - ), nil - } - readBucketCloser, err := newReadWriteBucketCloser( - storage.NopReadWriteBucketCloser(readWriteBucket), - "", - "", - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readBucketCloser, - nil, - ), nil -} - -func (r *reader) getProtoFileBucket( - ctx context.Context, - container app.EnvStdinContainer, - protoFileRef ProtoFileRef, - terminateFileNames [][]string, -) (ReadBucketCloserWithTerminateFileProvider, error) { - if !r.localEnabled { - return nil, NewReadLocalDisabledError() - } - terminateFileProvider, err := getTerminateFileProviderForOS(normalpath.Dir(protoFileRef.Path()), terminateFileNames) - if err != nil { - return nil, err - } - rootPath, _, err := r.getBucketRootPathAndRelativePath(ctx, container, normalpath.Dir(protoFileRef.Path()), terminateFileProvider) - if err != nil { - return nil, err - } - readWriteBucket, err := r.storageosProvider.NewReadWriteBucket( - rootPath, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return nil, err - } - readWriteBucketCloser, err := newReadWriteBucketCloser( - storage.NopReadWriteBucketCloser(readWriteBucket), - rootPath, - "", // For ProtoFileRef, we default to using the working directory - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readWriteBucketCloser, - terminateFileProvider, - ), nil -} - -// getBucketRootPathAndRelativePath is a helper function that returns the rootPath and relative -// path if available for the readWriteBucket based on the dirRef and protoFileRef. -func (r *reader) getBucketRootPathAndRelativePath( - ctx context.Context, - container app.EnvStdinContainer, - dirPath string, - terminateFileProvider TerminateFileProvider, -) (string, string, error) { - // Set the terminateFile to the first terminateFilesPriorities result, since that's the highest - // priority file. - var terminateFileDirectoryAbsPath string - // Get the highest priority file found and use it as the terminate file directory path. - terminateFiles := terminateFileProvider.GetTerminateFiles() - if len(terminateFiles) != 0 { - terminateFileDirectoryAbsPath = terminateFiles[0].Path() - } - if terminateFileDirectoryAbsPath != "" { - // If the terminate file exists, we need to determine the relative path from the - // terminateFileDirectoryAbsPath to the target DirRef.Path. - wd, err := osextended.Getwd() - if err != nil { - return "", "", err - } - terminateFileRelativePath, err := normalpath.Rel(wd, terminateFileDirectoryAbsPath) - if err != nil { - return "", "", err - } - dirAbsPath, err := normalpath.NormalizeAndAbsolute(dirPath) - if err != nil { - return "", "", err - } - dirRelativePath, err := normalpath.Rel(terminateFileDirectoryAbsPath, dirAbsPath) - if err != nil { - return "", "", err - } - // It should be impossible for the dirRefRelativePath to be outside of the context - // diretory, but we validate just to make sure. - dirRelativePath, err = normalpath.NormalizeAndValidate(dirRelativePath) - if err != nil { - return "", "", err - } - rootPath := terminateFileRelativePath - if filepath.IsAbs(normalpath.Unnormalize(dirPath)) { - // If the input was provided as an absolute path, - // we preserve it by initializing the workspace - // bucket with an absolute path. - rootPath = terminateFileDirectoryAbsPath - } - return rootPath, dirRelativePath, nil - } - return dirPath, "", nil -} - -func (r *reader) getGitBucket( - ctx context.Context, - container app.EnvStdinContainer, - gitRef GitRef, - terminateFileNames [][]string, -) (_ ReadBucketCloserWithTerminateFileProvider, retErr error) { - if !r.gitEnabled { - return nil, NewReadGitDisabledError() - } - if r.gitCloner == nil { - return nil, errors.New("git cloner is nil") - } - subDirPath, err := normalpath.NormalizeAndValidate(gitRef.SubDirPath()) - if err != nil { - return nil, err - } - gitURL, err := getGitURL(gitRef) - if err != nil { - return nil, err - } - readWriteBucket := storagemem.NewReadWriteBucket() - if err := r.gitCloner.CloneToBucket( - ctx, - container, - gitURL, - gitRef.Depth(), - readWriteBucket, - git.CloneToBucketOptions{ - Name: gitRef.GitName(), - RecurseSubmodules: gitRef.RecurseSubmodules(), - }, - ); err != nil { - return nil, fmt.Errorf("could not clone %s: %v", gitURL, err) - } - terminateFileProvider, err := getTerminateFileProviderForBucket(ctx, readWriteBucket, subDirPath, terminateFileNames) - if err != nil { - return nil, err - } - var terminateFileDirectoryPath string - // Get the highest priority file found and use it as the terminate file directory path. - terminateFiles := terminateFileProvider.GetTerminateFiles() - if len(terminateFiles) != 0 { - terminateFileDirectoryPath = terminateFiles[0].Path() - } - if terminateFileDirectoryPath != "" { - relativeSubDirPath, err := normalpath.Rel(terminateFileDirectoryPath, subDirPath) - if err != nil { - return nil, err - } - readBucketCloser, err := newReadBucketCloser( - storage.NopReadBucketCloser(storage.MapReadBucket(readWriteBucket, storage.MapOnPrefix(terminateFileDirectoryPath))), - terminateFileDirectoryPath, - relativeSubDirPath, - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readBucketCloser, - nil, - ), nil - } - var readBucket storage.ReadBucket = readWriteBucket - if subDirPath != "." { - readBucket = storage.MapReadBucket(readBucket, storage.MapOnPrefix(subDirPath)) - } - readBucketCloser, err := newReadBucketCloser( - storage.NopReadBucketCloser(readBucket), - "", - "", - ) - if err != nil { - return nil, err - } - return newReadBucketCloserWithTerminateFiles( - readBucketCloser, - nil, - ), nil -} - -func (r *reader) getModule( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef ModuleRef, -) (bufmodule.Module, error) { - if !r.moduleEnabled { - return nil, NewReadModuleDisabledError() - } - if r.moduleReader == nil { - return nil, errors.New("module reader is nil") - } - if r.moduleResolver == nil { - return nil, errors.New("module resolver is nil") - } - modulePin, err := r.moduleResolver.GetModulePin(ctx, moduleRef.ModuleReference()) - if err != nil { - return nil, err - } - return r.moduleReader.GetModule(ctx, modulePin) -} - -func (r *reader) getFileReadCloserAndSize( - ctx context.Context, - container app.EnvStdinContainer, - fileRef FileRef, - keepFileCompression bool, -) (_ io.ReadCloser, _ int64, retErr error) { - readCloser, size, err := r.getFileReadCloserAndSizePotentiallyCompressed(ctx, container, fileRef) - if err != nil { - return nil, -1, err - } - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, readCloser.Close()) - } - }() - if keepFileCompression { - return readCloser, size, nil - } - switch compressionType := fileRef.CompressionType(); compressionType { - case CompressionTypeNone: - return readCloser, size, nil - case CompressionTypeGzip: - gzipReadCloser, err := pgzip.NewReader(readCloser) - if err != nil { - return nil, -1, err - } - return ioextended.CompositeReadCloser( - gzipReadCloser, - ioextended.ChainCloser( - gzipReadCloser, - readCloser, - ), - ), -1, nil - case CompressionTypeZstd: - zstdDecoder, err := zstd.NewReader(readCloser) - if err != nil { - return nil, -1, err - } - zstdReadCloser := zstdDecoder.IOReadCloser() - return ioextended.CompositeReadCloser( - zstdReadCloser, - ioextended.ChainCloser( - zstdReadCloser, - readCloser, - ), - ), -1, nil - default: - return nil, -1, fmt.Errorf("unknown CompressionType: %v", compressionType) - } -} - -// returns -1 if size unknown -func (r *reader) getFileReadCloserAndSizePotentiallyCompressed( - ctx context.Context, - container app.EnvStdinContainer, - fileRef FileRef, -) (io.ReadCloser, int64, error) { - switch fileScheme := fileRef.FileScheme(); fileScheme { - case FileSchemeHTTP: - if !r.httpEnabled { - return nil, -1, NewReadHTTPDisabledError() - } - return r.getFileReadCloserAndSizePotentiallyCompressedHTTP(ctx, container, "http://"+fileRef.Path()) - case FileSchemeHTTPS: - if !r.httpEnabled { - return nil, -1, NewReadHTTPDisabledError() - } - return r.getFileReadCloserAndSizePotentiallyCompressedHTTP(ctx, container, "https://"+fileRef.Path()) - case FileSchemeLocal: - if !r.localEnabled { - return nil, -1, NewReadLocalDisabledError() - } - file, err := os.Open(fileRef.Path()) - if err != nil { - return nil, -1, err - } - fileInfo, err := file.Stat() - if err != nil { - return nil, -1, err - } - return file, fileInfo.Size(), nil - case FileSchemeStdio, FileSchemeStdin: - if !r.stdioEnabled { - return nil, -1, NewReadStdioDisabledError() - } - return io.NopCloser(container.Stdin()), -1, nil - case FileSchemeStdout: - return nil, -1, errors.New("cannot read from stdout") - case FileSchemeNull: - return ioextended.DiscardReadCloser, 0, nil - default: - return nil, -1, fmt.Errorf("unknown FileScheme: %v", fileScheme) - } -} - -// the httpPath must have the scheme attached -func (r *reader) getFileReadCloserAndSizePotentiallyCompressedHTTP( - ctx context.Context, - container app.EnvStdinContainer, - httpPath string, -) (io.ReadCloser, int64, error) { - if r.httpClient == nil { - return nil, 0, errors.New("http client is nil") - } - if r.httpAuthenticator == nil { - return nil, 0, errors.New("http authenticator is nil") - } - request, err := http.NewRequestWithContext(ctx, "GET", httpPath, nil) - if err != nil { - return nil, -1, err - } - if _, err := r.httpAuthenticator.SetAuth(container, request); err != nil { - return nil, -1, err - } - response, err := r.httpClient.Do(request) - if err != nil { - return nil, -1, err - } - if response.StatusCode != http.StatusOK { - err := fmt.Errorf("got HTTP status code %d", response.StatusCode) - if response.Body != nil { - return nil, -1, multierr.Append(err, response.Body.Close()) - } - return nil, -1, err - } - // ContentLength is -1 if unknown, which is what we want - return response.Body, response.ContentLength, nil -} - -func getGitURL(gitRef GitRef) (string, error) { - switch gitScheme := gitRef.GitScheme(); gitScheme { - case GitSchemeHTTP: - return "http://" + gitRef.Path(), nil - case GitSchemeHTTPS: - return "https://" + gitRef.Path(), nil - case GitSchemeSSH: - return "ssh://" + gitRef.Path(), nil - case GitSchemeGit: - return "git://" + gitRef.Path(), nil - case GitSchemeLocal: - absPath, err := filepath.Abs(normalpath.Unnormalize(gitRef.Path())) - if err != nil { - return "", err - } - return "file://" + absPath, nil - default: - return "", fmt.Errorf("unknown GitScheme: %v", gitScheme) - } -} - -// getTerminateFileProviderForBucket returns the directory path that contains -// one of the terminateFileNames, starting with the subDirPath and ascending until the root -// of the bucket. -func getTerminateFileProviderForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - subDirPath string, - terminateFileNames [][]string, -) (TerminateFileProvider, error) { - terminateFiles := make([]TerminateFile, len(terminateFileNames)) - if len(terminateFileNames) == 0 { - return newTerminateFileProvider(terminateFiles), nil - } - terminateFileDirectoryPath := normalpath.Normalize(subDirPath) - var foundFiles int - for { - foundTerminateFiles, err := terminateFilesInBucket(ctx, readBucket, terminateFileDirectoryPath, terminateFileNames) - if err != nil { - return nil, err - } - for i, terminateFile := range foundTerminateFiles { - // We only want to return the first file for a hiearchy, so if a file already exists - // for a layer of hierarchy, we do not check again. - if terminateFiles[i] == nil { - // If a file is found for a specific layer of hierarchy, we return the first file found - // for that hierarchy. - if terminateFile != nil { - terminateFiles[i] = terminateFile - foundFiles++ - } - } - } - // If we have found a terminate file for each layer, we can return now. - if foundFiles == len(terminateFileNames) { - return newTerminateFileProvider(terminateFiles), nil - } - parent := normalpath.Dir(terminateFileDirectoryPath) - if parent == terminateFileDirectoryPath { - break - } - terminateFileDirectoryPath = parent - } - // The number of terminate files found is less than the number of layers of terminate files - // we are accepting, so we must prune the nil values from the initial instantiation of the slice. - var prunedTerminateFiles []TerminateFile - for _, terminateFile := range terminateFiles { - if terminateFile != nil { - prunedTerminateFiles = append(prunedTerminateFiles, terminateFile) - } - } - return newTerminateFileProvider(prunedTerminateFiles), nil -} - -func terminateFilesInBucket( - ctx context.Context, - readBucket storage.ReadBucket, - directoryPath string, - paths [][]string, -) ([]TerminateFile, error) { - foundPaths := make([]TerminateFile, len(paths)) - for i := range paths { - // We need to check for the existence of all the terminate files, so we ascend and prepend - // the current directory to determine the fully-qualified filepaths. - // - // For example: - // [][]string{ - // ["buf.work.yaml", "buf.work"], - // ["buf.yaml", "buf.mod"], - // } - // ==> - // - // [][]string{ - // ["/current/path/buf.work.yaml", "/current/path/buf.work"], - // ["/current/path/buf.yaml", "/current/path/buf.mod"], - // } - for _, path := range paths[i] { - path = normalpath.Join(directoryPath, path) - exists, err := storage.Exists(ctx, readBucket, path) - if err != nil { - return nil, err - } - if exists { - foundPaths[i] = newTerminateFile(normalpath.Base(path), normalpath.Dir(path)) - // We want the first file found for each layer of hierarchy. - break - } - } - } - return foundPaths, nil -} - -// getTerminateFileProviderForOS returns the directory that contains -// the terminateFileName, starting with the subDirPath and ascending until -// the root of the local filesystem. -func getTerminateFileProviderForOS( - subDirPath string, - terminateFileNames [][]string, -) (TerminateFileProvider, error) { - terminateFiles := make([]TerminateFile, len(terminateFileNames)) - if len(terminateFileNames) == 0 { - return newTerminateFileProvider(terminateFiles), nil - } - fileInfo, err := os.Stat(normalpath.Unnormalize(subDirPath)) - if err != nil { - if os.IsNotExist(err) { - return nil, storage.NewErrNotExist(subDirPath) - } - return nil, err - } - if !fileInfo.IsDir() { - return nil, normalpath.NewError(normalpath.Unnormalize(subDirPath), errors.New("not a directory")) - } - terminateFileDirectoryPath, err := normalpath.NormalizeAndAbsolute(subDirPath) - if err != nil { - return nil, err - } - var foundFiles int - for { - foundTerminateFiles, err := terminateFilesOnOS(terminateFileDirectoryPath, terminateFileNames) - if err != nil { - return nil, err - } - // More terminate files were found than layers of hierarchy, return an error. This path - // should be unreachable. - if len(foundTerminateFiles) > len(terminateFileNames) { - return nil, fmt.Errorf("more than one terminate file found per level of prioritization: %v", foundTerminateFiles) - } - for i, terminateFile := range foundTerminateFiles { - // We only want to return the first file for a hiearchy, so if a file already exists - // for a layer of hierarchy, we do not check again. - if terminateFiles[i] == nil { - // If a file is found for a specific layer of hierarchy, we return the first file found - // for that hierarchy. - if terminateFile != nil { - terminateFiles[i] = terminateFile - foundFiles++ - } - } - } - // If we have found a terminate file for each layer, we can return now. - if foundFiles == len(terminateFileNames) { - return newTerminateFileProvider(terminateFiles), nil - } - parent := normalpath.Dir(terminateFileDirectoryPath) - if parent == terminateFileDirectoryPath { - break - } - terminateFileDirectoryPath = parent - } - // The number of terminate files found is less than the number of layers of terminate files - // we are accepting, so we must prune the nil values from the initial instantiation of the slice. - var prunedTerminateFiles []TerminateFile - for _, terminateFile := range terminateFiles { - if terminateFile != nil { - prunedTerminateFiles = append(prunedTerminateFiles, terminateFile) - } - } - return newTerminateFileProvider(prunedTerminateFiles), nil -} - -func terminateFilesOnOS(directoryPath string, paths [][]string) ([]TerminateFile, error) { - foundPaths := make([]TerminateFile, len(paths)) - for i := range paths { - // We need to check for the existence of all the terminate files, so we ascend and prepend - // the current directory to determine the fully-qualified filepaths. - // - // For example: - // [][]string{ - // ["buf.work.yaml", "buf.work"], - // ["buf.yaml", "buf.mod"], - // } - // ==> - // - // [][]string{ - // ["/current/path/buf.work.yaml", "/current/path/buf.work"], - // ["/current/path/buf.yaml", "/current/path/buf.mod"], - // } - for _, path := range paths[i] { - path = normalpath.Unnormalize(normalpath.Join(directoryPath, path)) - fileInfo, err := os.Stat(path) - if err != nil && !os.IsNotExist(err) { - return nil, err - } - if fileInfo != nil && !fileInfo.IsDir() { - foundPaths[i] = newTerminateFile(normalpath.Base(path), normalpath.Dir(path)) - // We want the first file found for each layer of hierarchy. - break - } - } - } - return foundPaths, nil -} - -type getFileOptions struct { - keepFileCompression bool -} - -func newGetFileOptions() *getFileOptions { - return &getFileOptions{} -} - -type getBucketOptions struct { - terminateFileNames [][]string -} - -func newGetBucketOptions() *getBucketOptions { - return &getBucketOptions{} -} - -type getModuleOptions struct{} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/ref_parser.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/ref_parser.go deleted file mode 100644 index 49071108c4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/ref_parser.go +++ /dev/null @@ -1,409 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "context" - "strconv" - - "github.com/bufbuild/buf/private/buf/bufref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/normalpath" - "go.uber.org/zap" -) - -type refParser struct { - logger *zap.Logger - rawRefProcessor func(*RawRef) error - singleFormatToInfo map[string]*singleFormatInfo - archiveFormatToInfo map[string]*archiveFormatInfo - dirFormatToInfo map[string]*dirFormatInfo - gitFormatToInfo map[string]*gitFormatInfo - moduleFormatToInfo map[string]*moduleFormatInfo - protoFileFormatToInfo map[string]*protoFileFormatInfo -} - -func newRefParser(logger *zap.Logger, options ...RefParserOption) *refParser { - refParser := &refParser{ - logger: logger, - singleFormatToInfo: make(map[string]*singleFormatInfo), - archiveFormatToInfo: make(map[string]*archiveFormatInfo), - dirFormatToInfo: make(map[string]*dirFormatInfo), - gitFormatToInfo: make(map[string]*gitFormatInfo), - moduleFormatToInfo: make(map[string]*moduleFormatInfo), - protoFileFormatToInfo: make(map[string]*protoFileFormatInfo), - } - for _, option := range options { - option(refParser) - } - return refParser -} - -func (a *refParser) GetParsedRef( - ctx context.Context, - value string, - options ...GetParsedRefOption, -) (ParsedRef, error) { - getParsedRefOptions := newGetParsedRefOptions() - for _, option := range options { - option(getParsedRefOptions) - } - return a.getParsedRef(ctx, value, getParsedRefOptions.allowedFormats) -} - -func (a *refParser) getParsedRef( - ctx context.Context, - value string, - allowedFormats map[string]struct{}, -) (ParsedRef, error) { - rawRef, err := a.getRawRef(value) - if err != nil { - return nil, err - } - singleFormatInfo, singleOK := a.singleFormatToInfo[rawRef.Format] - archiveFormatInfo, archiveOK := a.archiveFormatToInfo[rawRef.Format] - _, dirOK := a.dirFormatToInfo[rawRef.Format] - _, gitOK := a.gitFormatToInfo[rawRef.Format] - _, moduleOK := a.moduleFormatToInfo[rawRef.Format] - _, protoFileOK := a.protoFileFormatToInfo[rawRef.Format] - if !(singleOK || archiveOK || dirOK || gitOK || moduleOK || protoFileOK) { - return nil, NewFormatUnknownError(rawRef.Format) - } - if len(allowedFormats) > 0 { - if _, ok := allowedFormats[rawRef.Format]; !ok { - return nil, NewFormatNotAllowedError(rawRef.Format, allowedFormats) - } - } - if singleOK { - return getSingleRef(rawRef, singleFormatInfo.defaultCompressionType) - } - if archiveOK { - return getArchiveRef(rawRef, archiveFormatInfo.archiveType, archiveFormatInfo.defaultCompressionType) - } - if protoFileOK { - return getProtoFileRef(rawRef) - } - if dirOK { - return getDirRef(rawRef) - } - if gitOK { - return getGitRef(rawRef) - } - if moduleOK { - return getModuleRef(rawRef) - } - return nil, NewFormatUnknownError(rawRef.Format) -} - -// validated per rules on rawRef -func (a *refParser) getRawRef(value string) (*RawRef, error) { - // path is never empty after returning from this function - path, options, err := bufref.GetRawPathAndOptions(value) - if err != nil { - return nil, err - } - rawRef := &RawRef{ - Path: path, - } - if a.rawRefProcessor != nil { - if err := a.rawRefProcessor(rawRef); err != nil { - return nil, err - } - } - for key, value := range options { - switch key { - case "format": - if app.IsDevNull(path) { - return nil, NewFormatOverrideNotAllowedForDevNullError(app.DevNullFilePath) - } - rawRef.Format = value - case "compression": - switch value { - case "none": - rawRef.CompressionType = CompressionTypeNone - case "gzip": - rawRef.CompressionType = CompressionTypeGzip - case "zstd": - rawRef.CompressionType = CompressionTypeZstd - default: - return nil, NewCompressionUnknownError(value) - } - case "branch": - if rawRef.GitBranch != "" || rawRef.GitTag != "" { - return nil, NewCannotSpecifyGitBranchAndTagError() - } - rawRef.GitBranch = value - case "tag": - if rawRef.GitBranch != "" || rawRef.GitTag != "" { - return nil, NewCannotSpecifyGitBranchAndTagError() - } - rawRef.GitTag = value - case "ref": - rawRef.GitRef = value - case "depth": - depth, err := strconv.ParseUint(value, 10, 32) - if err != nil { - return nil, NewDepthParseError(value) - } - if depth == 0 { - return nil, NewDepthZeroError() - } - rawRef.GitDepth = uint32(depth) - case "recurse_submodules": - // TODO: need to refactor to make sure this is not set for any non-git input - // ie right now recurse_submodules=false will not error - switch value { - case "true": - rawRef.GitRecurseSubmodules = true - case "false": - default: - return nil, NewOptionsCouldNotParseRecurseSubmodulesError(value) - } - case "strip_components": - // TODO: need to refactor to make sure this is not set for any non-tarball - // ie right now strip_components=0 will not error - stripComponents, err := strconv.ParseUint(value, 10, 32) - if err != nil { - return nil, NewOptionsCouldNotParseStripComponentsError(value) - } - rawRef.ArchiveStripComponents = uint32(stripComponents) - case "subdir": - subDirPath, err := normalpath.NormalizeAndValidate(value) - if err != nil { - return nil, err - } - if subDirPath != "." { - rawRef.SubDirPath = subDirPath - } - case "include_package_files": - switch value { - case "true": - rawRef.IncludePackageFiles = true - case "false", "": - rawRef.IncludePackageFiles = false - default: - return nil, NewOptionsInvalidKeyError(key) - } - default: - return nil, NewOptionsInvalidKeyError(key) - } - } - - if rawRef.Format == "" { - return nil, NewFormatCannotBeDeterminedError(value) - } - - _, gitOK := a.gitFormatToInfo[rawRef.Format] - archiveFormatInfo, archiveOK := a.archiveFormatToInfo[rawRef.Format] - _, singleOK := a.singleFormatToInfo[rawRef.Format] - if gitOK { - if rawRef.GitRef != "" && rawRef.GitTag != "" { - return nil, NewCannotSpecifyTagWithRefError() - } - if rawRef.GitDepth == 0 { - // Default to 1 - rawRef.GitDepth = 1 - if rawRef.GitRef != "" { - // Default to 50 when using ref - rawRef.GitDepth = 50 - } - } - } else { - if rawRef.GitBranch != "" || rawRef.GitTag != "" || rawRef.GitRef != "" || rawRef.GitRecurseSubmodules || rawRef.GitDepth > 0 { - return nil, NewOptionsInvalidForFormatError(rawRef.Format, value) - } - } - // not an archive format - if !archiveOK { - if rawRef.ArchiveStripComponents > 0 { - return nil, NewOptionsInvalidForFormatError(rawRef.Format, value) - } - } else { - if archiveFormatInfo.archiveType == ArchiveTypeZip && rawRef.CompressionType != 0 { - return nil, NewCannotSpecifyCompressionForZipError() - } - } - if !singleOK && !archiveOK { - if rawRef.CompressionType != 0 { - return nil, NewOptionsInvalidForFormatError(rawRef.Format, value) - } - } - if !archiveOK && !gitOK { - if rawRef.SubDirPath != "" { - return nil, NewOptionsInvalidForFormatError(rawRef.Format, value) - } - } - return rawRef, nil -} - -func getSingleRef( - rawRef *RawRef, - defaultCompressionType CompressionType, -) (ParsedSingleRef, error) { - compressionType := rawRef.CompressionType - if compressionType == 0 { - compressionType = defaultCompressionType - } - return newSingleRef( - rawRef.Format, - rawRef.Path, - compressionType, - ) -} - -func getArchiveRef( - rawRef *RawRef, - archiveType ArchiveType, - defaultCompressionType CompressionType, -) (ParsedArchiveRef, error) { - compressionType := rawRef.CompressionType - if compressionType == 0 { - compressionType = defaultCompressionType - } - return newArchiveRef( - rawRef.Format, - rawRef.Path, - archiveType, - compressionType, - rawRef.ArchiveStripComponents, - rawRef.SubDirPath, - ) -} - -func getDirRef( - rawRef *RawRef, -) (ParsedDirRef, error) { - return newDirRef( - rawRef.Format, - rawRef.Path, - ) -} - -func getGitRef( - rawRef *RawRef, -) (ParsedGitRef, error) { - gitRefName, err := getGitRefName(rawRef.Path, rawRef.GitBranch, rawRef.GitTag, rawRef.GitRef) - if err != nil { - return nil, err - } - return newGitRef( - rawRef.Format, - rawRef.Path, - gitRefName, - rawRef.GitDepth, - rawRef.GitRecurseSubmodules, - rawRef.SubDirPath, - ) -} - -func getModuleRef( - rawRef *RawRef, -) (ParsedModuleRef, error) { - return newModuleRef( - rawRef.Format, - rawRef.Path, - ) -} - -func getGitRefName(path string, branch string, tag string, ref string) (git.Name, error) { - if branch == "" && tag == "" && ref == "" { - return nil, nil - } - if branch != "" && tag != "" { - // already did this in getRawRef but just in case - return nil, NewCannotSpecifyGitBranchAndTagError() - } - if ref != "" && tag != "" { - // already did this in getRawRef but just in case - return nil, NewCannotSpecifyTagWithRefError() - } - if ref != "" && branch != "" { - return git.NewRefNameWithBranch(ref, branch), nil - } - if ref != "" { - return git.NewRefName(ref), nil - } - if branch != "" { - return git.NewBranchName(branch), nil - } - return git.NewTagName(tag), nil -} - -func getProtoFileRef(rawRef *RawRef) (ParsedProtoFileRef, error) { - return newProtoFileRef( - rawRef.Format, - rawRef.Path, - rawRef.IncludePackageFiles, - ) -} - -// options - -type singleFormatInfo struct { - defaultCompressionType CompressionType -} - -func newSingleFormatInfo() *singleFormatInfo { - return &singleFormatInfo{ - defaultCompressionType: CompressionTypeNone, - } -} - -type archiveFormatInfo struct { - archiveType ArchiveType - defaultCompressionType CompressionType -} - -func newArchiveFormatInfo(archiveType ArchiveType) *archiveFormatInfo { - return &archiveFormatInfo{ - archiveType: archiveType, - defaultCompressionType: CompressionTypeNone, - } -} - -type dirFormatInfo struct{} - -func newDirFormatInfo() *dirFormatInfo { - return &dirFormatInfo{} -} - -type gitFormatInfo struct{} - -func newGitFormatInfo() *gitFormatInfo { - return &gitFormatInfo{} -} - -type moduleFormatInfo struct{} - -func newModuleFormatInfo() *moduleFormatInfo { - return &moduleFormatInfo{} -} - -type getParsedRefOptions struct { - allowedFormats map[string]struct{} -} - -type protoFileFormatInfo struct{} - -func newProtoFileFormatInfo() *protoFileFormatInfo { - return &protoFileFormatInfo{} -} - -func newGetParsedRefOptions() *getParsedRefOptions { - return &getParsedRefOptions{ - allowedFormats: make(map[string]struct{}), - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/single_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/single_ref.go deleted file mode 100644 index addd35333c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/single_ref.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var ( - _ ParsedSingleRef = &singleRef{} - - fileSchemePrefixToFileScheme = map[string]FileScheme{ - "http://": FileSchemeHTTP, - "https://": FileSchemeHTTPS, - "file://": FileSchemeLocal, - } -) - -type singleRef struct { - format string - path string - fileScheme FileScheme - compressionType CompressionType -} - -func newSingleRef( - format string, - path string, - compressionType CompressionType, -) (*singleRef, error) { - if path == "" { - return nil, NewNoPathError() - } - if app.IsDevStderr(path) { - return nil, NewInvalidPathError(format, path) - } - if path == "-" { - return newDirectSingleRef( - format, - "", - FileSchemeStdio, - compressionType, - ), nil - } - if app.IsDevStdin(path) { - return newDirectSingleRef( - format, - "", - FileSchemeStdin, - compressionType, - ), nil - } - if app.IsDevStdout(path) { - return newDirectSingleRef( - format, - "", - FileSchemeStdout, - compressionType, - ), nil - } - if app.IsDevNull(path) { - return newDirectSingleRef( - format, - "", - FileSchemeNull, - compressionType, - ), nil - } - for prefix, fileScheme := range fileSchemePrefixToFileScheme { - if strings.HasPrefix(path, prefix) { - path = strings.TrimPrefix(path, prefix) - if fileScheme == FileSchemeLocal { - path = normalpath.Normalize(path) - } - if path == "" { - return nil, NewNoPathError() - } - return newDirectSingleRef( - format, - path, - fileScheme, - compressionType, - ), nil - } - } - if strings.Contains(path, "://") { - return nil, NewInvalidPathError(format, path) - } - return newDirectSingleRef( - format, - normalpath.Normalize(path), - FileSchemeLocal, - compressionType, - ), nil -} - -func newDirectSingleRef( - format string, - path string, - fileScheme FileScheme, - compressionType CompressionType, -) *singleRef { - return &singleRef{ - format: format, - path: path, - fileScheme: fileScheme, - compressionType: compressionType, - } -} - -func (r *singleRef) Format() string { - return r.format -} - -func (r *singleRef) Path() string { - return r.path -} - -func (r *singleRef) FileScheme() FileScheme { - return r.fileScheme -} - -func (r *singleRef) CompressionType() CompressionType { - return r.compressionType -} - -func (*singleRef) ref() {} -func (*singleRef) fileRef() {} -func (*singleRef) singleRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file.go deleted file mode 100644 index 68bfcce4a5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -var _ TerminateFile = &terminateFile{} - -type terminateFile struct { - name string - path string -} - -func newTerminateFile(name string, path string) TerminateFile { - return &terminateFile{ - name: name, - path: path, - } -} - -// Name returns the name of the TerminateFile (i.e. the base of the fully-qualified file paths). -func (t *terminateFile) Name() string { - return t.name -} - -// Path returns the normalized directory path where the TemrinateFile is located. -func (t *terminateFile) Path() string { - return t.path -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file_provider.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file_provider.go deleted file mode 100644 index 6dd718b4b0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/terminate_file_provider.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -var _ TerminateFileProvider = &terminateFileProvider{} - -type terminateFileProvider struct { - terminateFiles []TerminateFile -} - -func newTerminateFileProvider(terminateFiles []TerminateFile) TerminateFileProvider { - return &terminateFileProvider{ - terminateFiles: terminateFiles, - } -} - -// GetTerminateFiles returns the terminate files found. -func (t *terminateFileProvider) GetTerminateFiles() []TerminateFile { - return t.terminateFiles -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/usage.gen.go deleted file mode 100644 index b94f5ee09d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package internal - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/util.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/util.go deleted file mode 100644 index 89d648744d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/util.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "sort" - "strings" -) - -func normalizeFormat(format string) string { - return strings.ToLower(strings.TrimSpace(format)) -} - -func formatsToString(formats map[string]struct{}) string { - if len(formats) == 0 { - return "[]" - } - s := make([]string, 0, len(formats)) - for format := range formats { - s = append(s, format) - } - sort.Strings(s) - return "[" + strings.Join(s, ",") + "]" -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/writer.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/writer.go deleted file mode 100644 index 2f174ac622..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/internal/writer.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "compress/gzip" - "context" - "errors" - "fmt" - "io" - "os" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/klauspost/compress/zstd" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type writer struct { - logger *zap.Logger - - // never set for now (no corresponding option) - httpEnabled bool - localEnabled bool - stdioEnabled bool -} - -func newWriter( - logger *zap.Logger, - options ...WriterOption, -) *writer { - writer := &writer{ - logger: logger, - } - for _, option := range options { - option(writer) - } - return writer -} - -func (w *writer) PutFile( - ctx context.Context, - container app.EnvStdoutContainer, - fileRef FileRef, - options ...PutFileOption, -) (io.WriteCloser, error) { - putFileOptions := newPutFileOptions() - for _, option := range options { - option(putFileOptions) - } - switch t := fileRef.(type) { - case SingleRef: - return w.putSingle( - ctx, - container, - t, - putFileOptions.noFileCompression, - ) - case ArchiveRef: - return w.putArchiveFile( - ctx, - container, - t, - putFileOptions.noFileCompression, - ) - default: - return nil, fmt.Errorf("unknown FileRef type: %T", fileRef) - } -} - -func (w *writer) putSingle( - ctx context.Context, - container app.EnvStdoutContainer, - singleRef SingleRef, - noFileCompression bool, -) (io.WriteCloser, error) { - return w.putFileWriteCloser(ctx, container, singleRef, noFileCompression) -} - -func (w *writer) putArchiveFile( - ctx context.Context, - container app.EnvStdoutContainer, - archiveRef ArchiveRef, - noFileCompression bool, -) (io.WriteCloser, error) { - return w.putFileWriteCloser(ctx, container, archiveRef, noFileCompression) -} - -func (w *writer) putFileWriteCloser( - ctx context.Context, - container app.EnvStdoutContainer, - fileRef FileRef, - noFileCompression bool, -) (_ io.WriteCloser, retErr error) { - writeCloser, err := w.putFileWriteCloserPotentiallyUncompressed(ctx, container, fileRef) - if err != nil { - return nil, err - } - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, writeCloser.Close()) - } - }() - if noFileCompression { - return writeCloser, nil - } - switch compressionType := fileRef.CompressionType(); compressionType { - case CompressionTypeNone: - return writeCloser, nil - case CompressionTypeGzip: - gzipWriteCloser := gzip.NewWriter(writeCloser) - return ioextended.CompositeWriteCloser( - gzipWriteCloser, - ioextended.ChainCloser( - gzipWriteCloser, - writeCloser, - ), - ), nil - case CompressionTypeZstd: - zstdWriteCloser, err := zstd.NewWriter(writeCloser) - if err != nil { - return nil, err - } - return ioextended.CompositeWriteCloser( - zstdWriteCloser, - ioextended.ChainCloser( - zstdWriteCloser, - writeCloser, - ), - ), nil - default: - return nil, fmt.Errorf("unknown CompressionType: %v", compressionType) - } -} - -func (w *writer) putFileWriteCloserPotentiallyUncompressed( - ctx context.Context, - container app.EnvStdoutContainer, - fileRef FileRef, -) (io.WriteCloser, error) { - switch fileScheme := fileRef.FileScheme(); fileScheme { - case FileSchemeHTTP: - if !w.httpEnabled { - return nil, NewWriteHTTPDisabledError() - } - return nil, fmt.Errorf("http not supported for writes: %v", fileRef.Path()) - case FileSchemeHTTPS: - if !w.httpEnabled { - return nil, NewWriteHTTPDisabledError() - } - return nil, fmt.Errorf("https not supported for writes: %v", fileRef.Path()) - case FileSchemeLocal: - if !w.localEnabled { - return nil, NewWriteLocalDisabledError() - } - return os.Create(fileRef.Path()) - case FileSchemeStdio, FileSchemeStdout: - if !w.stdioEnabled { - return nil, NewWriteStdioDisabledError() - } - return ioextended.NopWriteCloser(container.Stdout()), nil - case FileSchemeStdin: - return nil, errors.New("cannot write to stdin") - case FileSchemeNull: - return ioextended.DiscardWriteCloser, nil - default: - return nil, fmt.Errorf("unknown FileScheme: %v", fileScheme) - } -} - -type putFileOptions struct { - noFileCompression bool -} - -func newPutFileOptions() *putFileOptions { - return &putFileOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/module_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/module_ref.go deleted file mode 100644 index 2fd9ab3ce4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/module_ref.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var _ ModuleRef = &moduleRef{} - -type moduleRef struct { - iModuleRef internal.ModuleRef -} - -func newModuleRef(iModuleRef internal.ModuleRef) *moduleRef { - return &moduleRef{ - iModuleRef: iModuleRef, - } -} - -func (r *moduleRef) PathForExternalPath(externalPath string) (string, error) { - return normalpath.NormalizeAndValidate(externalPath) -} - -func (r *moduleRef) internalRef() internal.Ref { - return r.iModuleRef -} - -func (r *moduleRef) internalModuleRef() internal.ModuleRef { - return r.iModuleRef -} - -func (*moduleRef) isSourceOrModuleRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/proto_file_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/proto_file_ref.go deleted file mode 100644 index 13b0348adc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/proto_file_ref.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "fmt" - "path/filepath" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var _ ProtoFileRef = &protoFileRef{} - -type protoFileRef struct { - protoFileRef internal.ProtoFileRef -} - -func newProtoFileRef(internalProtoFileRef internal.ProtoFileRef) *protoFileRef { - return &protoFileRef{ - protoFileRef: internalProtoFileRef, - } -} - -// PathForExternalPath for a proto file ref will only ever have one successful case, which -// is `".", ` and will error on all other paths. The `Path()` of the internal.ProtoFileRef -// will always point to a specific proto file, e.g. `foo/bar/baz.proto`, thus the function -// errors against inputs that are not matching to the proto file ref input. -func (r *protoFileRef) PathForExternalPath(externalPath string) (string, error) { - externalPathAbs, err := filepath.Abs(normalpath.Unnormalize(externalPath)) - if err != nil { - return "", err - } - internalRefPathAbs, err := filepath.Abs(normalpath.Unnormalize(r.protoFileRef.Path())) - if err != nil { - return "", err - } - if externalPathAbs != internalRefPathAbs { - return "", fmt.Errorf(`path provided "%s" does not match ref path "%s"`, externalPath, r.protoFileRef.Path()) - } - return ".", nil -} - -func (r *protoFileRef) IncludePackageFiles() bool { - return r.protoFileRef.IncludePackageFiles() -} - -func (r *protoFileRef) internalRef() internal.Ref { - return r.protoFileRef -} - -func (r *protoFileRef) internalBucketRef() internal.BucketRef { - return r.protoFileRef -} - -func (r *protoFileRef) internalProtoFileRef() internal.ProtoFileRef { - return r.protoFileRef -} - -func (*protoFileRef) isSourceOrModuleRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/reader.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/reader.go deleted file mode 100644 index 8194da79c2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/reader.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "context" - "io" - "net/http" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/buf/bufwork" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/httpauth" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -type reader struct { - internalReader internal.Reader -} - -func newReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) *reader { - return &reader{ - internalReader: internal.NewReader( - logger, - storageosProvider, - internal.WithReaderHTTP( - httpClient, - httpAuthenticator, - ), - internal.WithReaderGit( - gitCloner, - ), - internal.WithReaderLocal(), - internal.WithReaderStdio(), - internal.WithReaderModule( - moduleResolver, - moduleReader, - ), - ), - } -} - -func newImageReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, -) *reader { - return &reader{ - internalReader: internal.NewReader( - logger, - storageosProvider, - internal.WithReaderHTTP( - httpClient, - httpAuthenticator, - ), - internal.WithReaderLocal(), - internal.WithReaderStdio(), - ), - } -} - -func newSourceReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - httpClient *http.Client, - httpAuthenticator httpauth.Authenticator, - gitCloner git.Cloner, -) *reader { - return &reader{ - internalReader: internal.NewReader( - logger, - storageosProvider, - internal.WithReaderHTTP( - httpClient, - httpAuthenticator, - ), - internal.WithReaderGit( - gitCloner, - ), - internal.WithReaderLocal(), - internal.WithReaderStdio(), - ), - } -} - -func newModuleFetcher( - logger *zap.Logger, - storageosProvider storageos.Provider, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) *reader { - return &reader{ - internalReader: internal.NewReader( - logger, - storageosProvider, - internal.WithReaderModule( - moduleResolver, - moduleReader, - ), - ), - } -} - -func (a *reader) GetImageFile( - ctx context.Context, - container app.EnvStdinContainer, - imageRef ImageRef, -) (io.ReadCloser, error) { - return a.internalReader.GetFile(ctx, container, imageRef.internalFileRef()) -} - -func (a *reader) GetSourceBucket( - ctx context.Context, - container app.EnvStdinContainer, - sourceRef SourceRef, - options ...GetSourceBucketOption, -) (ReadBucketCloserWithTerminateFileProvider, error) { - getSourceBucketOptions := &getSourceBucketOptions{} - for _, option := range options { - option(getSourceBucketOptions) - } - var getBucketOptions []internal.GetBucketOption - if !getSourceBucketOptions.workspacesDisabled { - getBucketOptions = append( - getBucketOptions, - internal.WithGetBucketTerminateFileNames([][]string{bufwork.AllConfigFilePaths, bufconfig.AllConfigFilePaths}), - ) - } - return a.internalReader.GetBucket( - ctx, - container, - sourceRef.internalBucketRef(), - getBucketOptions..., - ) -} - -func (a *reader) GetModule( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef ModuleRef, -) (bufmodule.Module, error) { - return a.internalReader.GetModule(ctx, container, moduleRef.internalModuleRef()) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/ref_parser.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/ref_parser.go deleted file mode 100644 index ec2d9491df..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/ref_parser.go +++ /dev/null @@ -1,587 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "context" - "errors" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" -) - -const ( - loggerName = "buffetch" - tracerName = "bufbuild/buf" -) - -type refParser struct { - logger *zap.Logger - fetchRefParser internal.RefParser - tracer trace.Tracer -} - -func newRefParser(logger *zap.Logger) *refParser { - return &refParser{ - logger: logger.Named(loggerName), - tracer: otel.GetTracerProvider().Tracer(tracerName), - fetchRefParser: internal.NewRefParser( - logger, - internal.WithRawRefProcessor(newRawRefProcessor()), - internal.WithSingleFormat(formatBin), - internal.WithSingleFormat(formatBinpb), - internal.WithSingleFormat(formatJSON), - internal.WithSingleFormat( - formatBingz, - internal.WithSingleDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithSingleFormat( - formatJSONGZ, - internal.WithSingleDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithArchiveFormat( - formatTar, - internal.ArchiveTypeTar, - ), - internal.WithArchiveFormat( - formatTargz, - internal.ArchiveTypeTar, - internal.WithArchiveDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithArchiveFormat( - formatZip, - internal.ArchiveTypeZip, - ), - internal.WithGitFormat(formatGit), - internal.WithDirFormat(formatDir), - internal.WithModuleFormat(formatMod), - internal.WithProtoFileFormat(formatProtoFile), - ), - } -} - -func newImageRefParser(logger *zap.Logger) *refParser { - return &refParser{ - logger: logger.Named(loggerName), - fetchRefParser: internal.NewRefParser( - logger, - internal.WithRawRefProcessor(processRawRefImage), - internal.WithSingleFormat(formatBin), - internal.WithSingleFormat(formatBinpb), - internal.WithSingleFormat(formatJSON), - internal.WithSingleFormat( - formatBingz, - internal.WithSingleDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithSingleFormat( - formatJSONGZ, - internal.WithSingleDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - ), - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func newSourceRefParser(logger *zap.Logger) *refParser { - return &refParser{ - logger: logger.Named(loggerName), - fetchRefParser: internal.NewRefParser( - logger, - internal.WithRawRefProcessor(processRawRefSource), - internal.WithArchiveFormat( - formatTar, - internal.ArchiveTypeTar, - ), - internal.WithArchiveFormat( - formatTargz, - internal.ArchiveTypeTar, - internal.WithArchiveDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithArchiveFormat( - formatZip, - internal.ArchiveTypeZip, - ), - internal.WithGitFormat(formatGit), - internal.WithDirFormat(formatDir), - ), - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func newModuleRefParser(logger *zap.Logger) *refParser { - return &refParser{ - logger: logger.Named(loggerName), - fetchRefParser: internal.NewRefParser( - logger, - internal.WithRawRefProcessor(processRawRefModule), - internal.WithModuleFormat(formatMod), - ), - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func newSourceOrModuleRefParser(logger *zap.Logger) *refParser { - return &refParser{ - logger: logger.Named(loggerName), - fetchRefParser: internal.NewRefParser( - logger, - internal.WithRawRefProcessor(processRawRefSourceOrModule), - internal.WithArchiveFormat( - formatTar, - internal.ArchiveTypeTar, - ), - internal.WithArchiveFormat( - formatTargz, - internal.ArchiveTypeTar, - internal.WithArchiveDefaultCompressionType( - internal.CompressionTypeGzip, - ), - ), - internal.WithArchiveFormat( - formatZip, - internal.ArchiveTypeZip, - ), - internal.WithGitFormat(formatGit), - internal.WithDirFormat(formatDir), - internal.WithModuleFormat(formatMod), - ), - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func (a *refParser) GetRef( - ctx context.Context, - value string, -) (_ Ref, retErr error) { - ctx, span := a.tracer.Start(ctx, "get_ref") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - parsedRef, err := a.getParsedRef(ctx, value, allFormats) - if err != nil { - return nil, err - } - switch t := parsedRef.(type) { - case internal.ParsedSingleRef: - imageEncoding, err := parseImageEncoding(t.Format()) - if err != nil { - return nil, err - } - return newImageRef(t, imageEncoding), nil - case internal.ParsedArchiveRef: - return newSourceRef(t), nil - case internal.ParsedDirRef: - return newSourceRef(t), nil - case internal.ParsedGitRef: - return newSourceRef(t), nil - case internal.ParsedModuleRef: - return newModuleRef(t), nil - case internal.ProtoFileRef: - return newProtoFileRef(t), nil - default: - return nil, fmt.Errorf("unknown ParsedRef type: %T", parsedRef) - } -} - -func (a *refParser) GetSourceOrModuleRef( - ctx context.Context, - value string, -) (_ SourceOrModuleRef, retErr error) { - ctx, span := a.tracer.Start(ctx, "get_source_or_module_ref") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - parsedRef, err := a.getParsedRef(ctx, value, sourceOrModuleFormats) - if err != nil { - return nil, err - } - switch t := parsedRef.(type) { - case internal.ParsedSingleRef: - return nil, fmt.Errorf("invalid ParsedRef type for source or module: %T", parsedRef) - case internal.ParsedArchiveRef: - return newSourceRef(t), nil - case internal.ParsedDirRef: - return newSourceRef(t), nil - case internal.ParsedGitRef: - return newSourceRef(t), nil - case internal.ParsedModuleRef: - return newModuleRef(t), nil - case internal.ProtoFileRef: - return newProtoFileRef(t), nil - default: - return nil, fmt.Errorf("unknown ParsedRef type: %T", parsedRef) - } -} - -func (a *refParser) GetImageRef( - ctx context.Context, - value string, -) (_ ImageRef, retErr error) { - ctx, span := a.tracer.Start(ctx, "get_image_ref") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - parsedRef, err := a.getParsedRef(ctx, value, imageFormats) - if err != nil { - return nil, err - } - parsedSingleRef, ok := parsedRef.(internal.ParsedSingleRef) - if !ok { - return nil, fmt.Errorf("invalid ParsedRef type for image: %T", parsedRef) - } - imageEncoding, err := parseImageEncoding(parsedSingleRef.Format()) - if err != nil { - return nil, err - } - return newImageRef(parsedSingleRef, imageEncoding), nil -} - -func (a *refParser) GetSourceRef( - ctx context.Context, - value string, -) (_ SourceRef, retErr error) { - ctx, span := a.tracer.Start(ctx, "get_source_ref") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - parsedRef, err := a.getParsedRef(ctx, value, sourceFormats) - if err != nil { - return nil, err - } - parsedBucketRef, ok := parsedRef.(internal.ParsedBucketRef) - if !ok { - // this should never happen - return nil, fmt.Errorf("invalid ParsedRef type for source: %T", parsedRef) - } - return newSourceRef(parsedBucketRef), nil -} - -func (a *refParser) GetModuleRef( - ctx context.Context, - value string, -) (_ ModuleRef, retErr error) { - ctx, span := a.tracer.Start(ctx, "get_source_ref") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - parsedRef, err := a.getParsedRef(ctx, value, moduleFormats) - if err != nil { - return nil, err - } - parsedModuleRef, ok := parsedRef.(internal.ParsedModuleRef) - if !ok { - // this should never happen - return nil, fmt.Errorf("invalid ParsedRef type for source: %T", parsedRef) - } - return newModuleRef(parsedModuleRef), nil -} - -func (a *refParser) getParsedRef( - ctx context.Context, - value string, - allowedFormats []string, -) (internal.ParsedRef, error) { - parsedRef, err := a.fetchRefParser.GetParsedRef( - ctx, - value, - internal.WithAllowedFormats(allowedFormats...), - ) - if err != nil { - return nil, err - } - a.checkDeprecated(parsedRef) - return parsedRef, nil -} - -func (a *refParser) checkDeprecated(parsedRef internal.ParsedRef) { - format := parsedRef.Format() - if replacementFormat, ok := deprecatedCompressionFormatToReplacementFormat[format]; ok { - a.logger.Sugar().Warnf( - `Format %q is deprecated. Use "format=%s,compression=gzip" instead. This will continue to work forever, but updating is recommended.`, - format, - replacementFormat, - ) - } -} - -func newRawRefProcessor() func(*internal.RawRef) error { - return func(rawRef *internal.RawRef) error { - // if format option is not set and path is "-", default to bin - var format string - var compressionType internal.CompressionType - if rawRef.Path == "-" || app.IsDevNull(rawRef.Path) || app.IsDevStdin(rawRef.Path) || app.IsDevStdout(rawRef.Path) { - format = formatBinpb - } else { - switch filepath.Ext(rawRef.Path) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - case ".tar": - format = formatTar - case ".zip": - format = formatZip - case ".gz": - compressionType = internal.CompressionTypeGzip - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .gz extension with unknown format", rawRef.Path) - } - case ".zst": - compressionType = internal.CompressionTypeZstd - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .zst extension with unknown format", rawRef.Path) - } - case ".tgz": - format = formatTar - compressionType = internal.CompressionTypeGzip - case ".git": - format = formatGit - // This only applies if the option accept `ProtoFileRef` is passed in, otherwise - // it falls through to the `default` case. - case ".proto": - fileInfo, err := os.Stat(rawRef.Path) - if err != nil && !os.IsNotExist(err) { - return fmt.Errorf("path provided is not a valid proto file: %s, %w", rawRef.Path, err) - } - if fileInfo != nil && fileInfo.IsDir() { - return fmt.Errorf("path provided is not a valid proto file: a directory named %s already exists", rawRef.Path) - } - format = formatProtoFile - default: - var err error - format, err = assumeModuleOrDir(rawRef.Path) - if err != nil { - return err - } - } - } - rawRef.Format = format - rawRef.CompressionType = compressionType - return nil - } -} - -func processRawRefSource(rawRef *internal.RawRef) error { - // if format option is not set and path is "-", default to bin - var format string - var compressionType internal.CompressionType - switch filepath.Ext(rawRef.Path) { - case ".tar": - format = formatTar - case ".zip": - format = formatZip - case ".gz": - compressionType = internal.CompressionTypeGzip - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .gz extension with unknown format", rawRef.Path) - } - case ".zst": - compressionType = internal.CompressionTypeZstd - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .zst extension with unknown format", rawRef.Path) - } - case ".tgz": - format = formatTar - compressionType = internal.CompressionTypeGzip - case ".git": - format = formatGit - default: - format = formatDir - } - rawRef.Format = format - rawRef.CompressionType = compressionType - return nil -} - -func processRawRefSourceOrModule(rawRef *internal.RawRef) error { - // if format option is not set and path is "-", default to bin - var format string - var compressionType internal.CompressionType - switch filepath.Ext(rawRef.Path) { - case ".tar": - format = formatTar - case ".zip": - format = formatZip - case ".gz": - compressionType = internal.CompressionTypeGzip - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .gz extension with unknown format", rawRef.Path) - } - case ".zst": - compressionType = internal.CompressionTypeZstd - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".tar": - format = formatTar - default: - return fmt.Errorf("path %q had .zst extension with unknown format", rawRef.Path) - } - case ".tgz": - format = formatTar - compressionType = internal.CompressionTypeGzip - case ".git": - format = formatGit - default: - var err error - format, err = assumeModuleOrDir(rawRef.Path) - if err != nil { - return err - } - } - rawRef.Format = format - rawRef.CompressionType = compressionType - return nil -} - -func processRawRefImage(rawRef *internal.RawRef) error { - // if format option is not set and path is "-", default to bin - var format string - var compressionType internal.CompressionType - if rawRef.Path == "-" || app.IsDevNull(rawRef.Path) || app.IsDevStdin(rawRef.Path) || app.IsDevStdout(rawRef.Path) { - format = formatBinpb - } else { - switch filepath.Ext(rawRef.Path) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - case ".gz": - compressionType = internal.CompressionTypeGzip - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - default: - return fmt.Errorf("path %q had .gz extension with unknown format", rawRef.Path) - } - case ".zst": - compressionType = internal.CompressionTypeZstd - switch filepath.Ext(strings.TrimSuffix(rawRef.Path, filepath.Ext(rawRef.Path))) { - case ".bin", ".binpb": - format = formatBinpb - case ".json": - format = formatJSON - default: - return fmt.Errorf("path %q had .zst extension with unknown format", rawRef.Path) - } - default: - format = formatBinpb - } - } - rawRef.Format = format - rawRef.CompressionType = compressionType - return nil -} - -func processRawRefModule(rawRef *internal.RawRef) error { - rawRef.Format = formatMod - return nil -} - -func parseImageEncoding(format string) (ImageEncoding, error) { - switch format { - case formatBin, formatBinpb, formatBingz: - return ImageEncodingBin, nil - case formatJSON, formatJSONGZ: - return ImageEncodingJSON, nil - default: - return 0, fmt.Errorf("invalid format for image: %q", format) - } -} - -// TODO: this is a terrible heuristic, and we shouldn't be using what amounts -// to heuristics here (technically this is a documentable rule, but still) -func assumeModuleOrDir(path string) (string, error) { - if path == "" { - return "", errors.New("assumeModuleOrDir: no path given") - } - if _, err := bufmoduleref.ModuleReferenceForString(path); err == nil { - // this is possible to be a module, check if it is a directory though - // OK to use os.Stat instead of os.Lstat here - fileInfo, err := os.Stat(path) - if err == nil && fileInfo.IsDir() { - // if we have a directory, assume this is a directory - return formatDir, nil - } - // not a directory, assume module - return formatMod, nil - } - // cannot be parsed into a module, assume dir for here - return formatDir, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/source_ref.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/source_ref.go deleted file mode 100644 index 10177f28c5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/source_ref.go +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "path/filepath" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var _ SourceRef = &sourceRef{} - -type sourceRef struct { - bucketRef internal.BucketRef - dirPath string -} - -func newSourceRef(bucketRef internal.BucketRef) *sourceRef { - var dirPath string - if dirRef, ok := bucketRef.(internal.DirRef); ok { - dirPath = dirRef.Path() - } - return &sourceRef{ - bucketRef: bucketRef, - dirPath: dirPath, - } -} - -func (r *sourceRef) PathForExternalPath(externalPath string) (string, error) { - if r.dirPath == "" { - return normalpath.NormalizeAndValidate(externalPath) - } - absDirPath, err := filepath.Abs(normalpath.Unnormalize(r.dirPath)) - if err != nil { - return "", err - } - // we don't actually need to unnormalize externalPath but we do anyways - absExternalPath, err := filepath.Abs(normalpath.Unnormalize(externalPath)) - if err != nil { - return "", err - } - path, err := filepath.Rel(absDirPath, absExternalPath) - if err != nil { - return "", err - } - return normalpath.NormalizeAndValidate(path) -} - -func (r *sourceRef) internalRef() internal.Ref { - return r.bucketRef -} - -func (r *sourceRef) internalBucketRef() internal.BucketRef { - return r.bucketRef -} - -func (*sourceRef) isSourceOrModuleRef() {} diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/usage.gen.go deleted file mode 100644 index 8de955ea8d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buffetch - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/buffetch/writer.go b/vendor/github.com/bufbuild/buf/private/buf/buffetch/writer.go deleted file mode 100644 index 72d608ac89..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/buffetch/writer.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buffetch - -import ( - "context" - "io" - - "github.com/bufbuild/buf/private/buf/buffetch/internal" - "github.com/bufbuild/buf/private/pkg/app" - "go.uber.org/zap" -) - -type writer struct { - internalWriter internal.Writer -} - -func newWriter( - logger *zap.Logger, -) *writer { - return &writer{ - internalWriter: internal.NewWriter( - logger, - internal.WithWriterLocal(), - internal.WithWriterStdio(), - ), - } -} - -func (w *writer) PutImageFile( - ctx context.Context, - container app.EnvStdoutContainer, - imageRef ImageRef, -) (io.WriteCloser, error) { - return w.internalWriter.PutFile(ctx, container, imageRef.internalFileRef()) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufformat/bufformat.go b/vendor/github.com/bufbuild/buf/private/buf/bufformat/bufformat.go deleted file mode 100644 index 19e58841d8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufformat/bufformat.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufformat - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" - "github.com/bufbuild/buf/private/pkg/thread" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/reporter" - "go.uber.org/multierr" -) - -// Format formats and writes the target module files into a read bucket. -func Format(ctx context.Context, module bufmodule.Module) (_ storage.ReadBucket, retErr error) { - fileInfos, err := module.TargetFileInfos(ctx) - if err != nil { - return nil, err - } - readWriteBucket := storagemem.NewReadWriteBucket() - jobs := make([]func(context.Context) error, len(fileInfos)) - for i, fileInfo := range fileInfos { - fileInfo := fileInfo - jobs[i] = func(ctx context.Context) (retErr error) { - moduleFile, err := module.GetModuleFile(ctx, fileInfo.Path()) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, moduleFile.Close()) - }() - fileNode, err := parser.Parse(moduleFile.ExternalPath(), moduleFile, reporter.NewHandler(nil)) - if err != nil { - return err - } - writeObjectCloser, err := readWriteBucket.Put(ctx, moduleFile.Path()) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, writeObjectCloser.Close()) - }() - if err := newFormatter(writeObjectCloser, fileNode).Run(); err != nil { - return err - } - return writeObjectCloser.SetExternalPath(moduleFile.ExternalPath()) - } - } - if err := thread.Parallelize(ctx, jobs); err != nil { - return nil, err - } - return readWriteBucket, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufformat/formatter.go b/vendor/github.com/bufbuild/buf/private/buf/bufformat/formatter.go deleted file mode 100644 index 43db5e87d0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufformat/formatter.go +++ /dev/null @@ -1,2318 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufformat - -import ( - "errors" - "fmt" - "io" - "reflect" - "sort" - "strings" - "unicode" - "unicode/utf8" - - "github.com/bufbuild/protocompile/ast" - "go.uber.org/multierr" -) - -// formatter writes an *ast.FileNode as a .proto file. -type formatter struct { - writer io.Writer - fileNode *ast.FileNode - - // Current level of indentation. - indent int - // The last character written to writer. - lastWritten rune - - // The last node written. This must be updated from all functions - // that write comments with a node. This flag informs how the next - // node's leading comments and whitespace should be written. - previousNode ast.Node - - // If true, a space will be written to the output unless the next character - // written is a newline (don't wait errant trailing spaces). - pendingSpace bool - // If true, the formatter is in the middle of printing compact options. - inCompactOptions bool - - // Track runes that open blocks/scopes and are expected to increase indention - // level. For example, when runes "{" "[" "(" ")" are written, the pending - // value is 2 (increment three times for "{" "[" "("; decrement once for ")"). - // If it's greater than zero at the end of a line, we call In() so that - // subsequent lines are indented. If it's less than zero at the end of a line, - // we call Out(). This minimizes the amount of explicit indent/unindent code - // that is needed and makes it less error-prone. - pendingIndent int - // If true, an inline node/sequence is being written. We treat whitespace a - // little differently for when blocks are printed inline vs. across multiple - // lines. So this flag informs the logic that makes those whitespace decisions. - inline bool - - // Records all errors that occur during the formatting process. Nearly any - // non-nil error represents a bug in the implementation. - err error -} - -// newFormatter returns a new formatter for the given file. -func newFormatter( - writer io.Writer, - fileNode *ast.FileNode, -) *formatter { - return &formatter{ - writer: writer, - fileNode: fileNode, - } -} - -// Run runs the formatter and writes the file's content to the formatter's writer. -func (f *formatter) Run() error { - f.writeFile() - return f.err -} - -// P prints a line to the generated output. -// -// This will emit a newline and proper indentation. If you do not -// want to emit a newline and want to write a raw string, use -// WriteString (which P calls). -// -// If strings.TrimSpace(elem) is empty, no indentation is produced. -func (f *formatter) P(elem string) { - if len(strings.TrimSpace(elem)) > 0 { - // We only want to write an indent if we're - // writing a non-empty string (not just a newline). - f.Indent(nil) - f.WriteString(elem) - } - f.WriteString("\n") - - if f.pendingIndent > 0 { - f.In() - } else if f.pendingIndent < 0 { - f.Out() - } - f.pendingIndent = 0 -} - -// Space adds a space to the generated output. -func (f *formatter) Space() { - f.pendingSpace = true -} - -// In increases the current level of indentation. -func (f *formatter) In() { - f.indent++ -} - -// Out reduces the current level of indentation. -func (f *formatter) Out() { - if f.indent <= 0 { - // Unreachable. - f.err = multierr.Append( - f.err, - errors.New("internal error: attempted to decrement indentation at zero"), - ) - return - } - f.indent-- -} - -// Indent writes the number of spaces associated -// with the current level of indentation. -func (f *formatter) Indent(nextNode ast.Node) { - // only indent at beginning of line - if f.lastWritten != '\n' { - return - } - indent := f.indent - if rn, ok := nextNode.(*ast.RuneNode); ok && indent > 0 { - if strings.ContainsRune("}])>", rn.Rune) { - indent-- - } - } - f.WriteString(strings.Repeat(" ", indent)) -} - -// WriteString writes the given element to the generated output. -// -// This will not write indentation or newlines. Use P if you -// want to emit identation or newlines. -func (f *formatter) WriteString(elem string) { - if f.pendingSpace { - f.pendingSpace = false - first, _ := utf8.DecodeRuneInString(elem) - - // We don't want "dangling spaces" before certain characters: - // newlines, commas, and semicolons. Also, when writing - // elements inline, we don't want spaces before close parens - // and braces. Similarly, we don't want extra/doubled spaces - // or dangling spaces after certain characters when printing - // inline, like open parens/braces. So only print the space - // if the previous and next character don't match above - // conditions. - - prevBlockList := "\x00 \t\n" - nextBlockList := "\n;," - if f.inline { - prevBlockList = "\x00 \t\n<[{(" - nextBlockList = "\n;,)]}>" - } - - if !strings.ContainsRune(prevBlockList, f.lastWritten) && - !strings.ContainsRune(nextBlockList, first) { - if _, err := f.writer.Write([]byte{' '}); err != nil { - f.err = multierr.Append(f.err, err) - return - } - } - } - if len(elem) == 0 { - return - } - f.lastWritten, _ = utf8.DecodeLastRuneInString(elem) - if _, err := f.writer.Write([]byte(elem)); err != nil { - f.err = multierr.Append(f.err, err) - } -} - -// SetPreviousNode sets the previously written node. This should -// be called in all of the comment writing functions. -func (f *formatter) SetPreviousNode(node ast.Node) { - f.previousNode = node -} - -// writeFile writes the file node. -func (f *formatter) writeFile() { - f.writeFileHeader() - f.writeFileTypes() - if f.fileNode.EOF != nil { - info := f.fileNode.NodeInfo(f.fileNode.EOF) - f.writeMultilineComments(info.LeadingComments()) - } - if f.lastWritten != 0 && f.lastWritten != '\n' { - // If anything was written, we always conclude with - // a newline. - f.P("") - } -} - -// writeFileHeader writes the header of a .proto file. This includes the syntax, -// package, imports, and options (in that order). The imports and options are -// sorted. All other file elements are handled by f.writeFileTypes. -// -// For example, -// -// syntax = "proto3"; -// -// package acme.v1.weather; -// -// import "acme/payment/v1/payment.proto"; -// import "google/type/datetime.proto"; -// -// option cc_enable_arenas = true; -// option optimize_for = SPEED; -func (f *formatter) writeFileHeader() { - var ( - packageNode *ast.PackageNode - importNodes []*ast.ImportNode - optionNodes []*ast.OptionNode - ) - for _, fileElement := range f.fileNode.Decls { - switch node := fileElement.(type) { - case *ast.PackageNode: - packageNode = node - case *ast.ImportNode: - importNodes = append(importNodes, node) - case *ast.OptionNode: - optionNodes = append(optionNodes, node) - default: - continue - } - } - if f.fileNode.Syntax == nil && packageNode == nil && importNodes == nil && optionNodes == nil { - // There aren't any header values, so we can return early. - return - } - if syntaxNode := f.fileNode.Syntax; syntaxNode != nil { - f.writeSyntax(syntaxNode) - } - if packageNode != nil { - f.writePackage(packageNode) - } - sort.Slice(importNodes, func(i, j int) bool { - iName := importNodes[i].Name.AsString() - jName := importNodes[j].Name.AsString() - // sort by public > None > weak - iOrder := importSortOrder(importNodes[i]) - jOrder := importSortOrder(importNodes[j]) - - if iName < jName { - return true - } - if iName > jName { - return false - } - if iOrder > jOrder { - return true - } - if iOrder < jOrder { - return false - } - - // put commented import first - return !f.importHasComment(importNodes[j]) - }) - for i, importNode := range importNodes { - if i == 0 && f.previousNode != nil && !f.leadingCommentsContainBlankLine(importNode) { - f.P("") - } - - // since the imports are sorted, this will skip write imports - // if they have appear before and dont have comment - if i > 0 && importNode.Name.AsString() == importNodes[i-1].Name.AsString() && - !f.importHasComment(importNode) { - continue - } - - f.writeImport(importNode, i > 0) - } - sort.Slice(optionNodes, func(i, j int) bool { - // The default options (e.g. cc_enable_arenas) should always - // be sorted above custom options (which are identified by a - // leading '('). - left := stringForOptionName(optionNodes[i].Name) - right := stringForOptionName(optionNodes[j].Name) - if strings.HasPrefix(left, "(") && !strings.HasPrefix(right, "(") { - // Prefer the default option on the right. - return false - } - if !strings.HasPrefix(left, "(") && strings.HasPrefix(right, "(") { - // Prefer the default option on the left. - return true - } - // Both options are custom, so we defer to the standard sorting. - return left < right - }) - for i, optionNode := range optionNodes { - if i == 0 && f.previousNode != nil && !f.leadingCommentsContainBlankLine(optionNode) { - f.P("") - } - f.writeFileOption(optionNode, i > 0) - } -} - -// writeFileTypes writes the types defined in a .proto file. This includes the messages, enums, -// services, etc. All other elements are ignored since they are handled by f.writeFileHeader. -func (f *formatter) writeFileTypes() { - for i, fileElement := range f.fileNode.Decls { - switch node := fileElement.(type) { - case *ast.PackageNode, *ast.OptionNode, *ast.ImportNode, *ast.EmptyDeclNode: - // These elements have already been written by f.writeFileHeader. - continue - default: - info := f.fileNode.NodeInfo(node) - wantNewline := f.previousNode != nil && (i == 0 || info.LeadingComments().Len() > 0) - if wantNewline && !f.leadingCommentsContainBlankLine(node) { - f.P("") - } - f.writeNode(node) - } - } -} - -// writeSyntax writes the syntax. -// -// For example, -// -// syntax = "proto3"; -func (f *formatter) writeSyntax(syntaxNode *ast.SyntaxNode) { - f.writeStart(syntaxNode.Keyword) - f.Space() - f.writeInline(syntaxNode.Equals) - f.Space() - f.writeInline(syntaxNode.Syntax) - f.writeLineEnd(syntaxNode.Semicolon) -} - -// writePackage writes the package. -// -// For example, -// -// package acme.weather.v1; -func (f *formatter) writePackage(packageNode *ast.PackageNode) { - f.writeStart(packageNode.Keyword) - f.Space() - f.writeInline(packageNode.Name) - f.writeLineEnd(packageNode.Semicolon) -} - -// writeImport writes an import statement. -// -// For example, -// -// import "google/protobuf/descriptor.proto"; -func (f *formatter) writeImport(importNode *ast.ImportNode, forceCompact bool) { - f.writeStartMaybeCompact(importNode.Keyword, forceCompact) - f.Space() - // We don't want to write the "public" and "weak" nodes - // if they aren't defined. One could be set, but never both. - switch { - case importNode.Public != nil: - f.writeInline(importNode.Public) - f.Space() - case importNode.Weak != nil: - f.writeInline(importNode.Weak) - f.Space() - } - f.writeInline(importNode.Name) - f.writeLineEnd(importNode.Semicolon) -} - -// writeFileOption writes a file option. This function is slightly -// different than f.writeOption because file options are sorted at -// the top of the file, and leading comments are adjusted accordingly. -func (f *formatter) writeFileOption(optionNode *ast.OptionNode, forceCompact bool) { - f.writeStartMaybeCompact(optionNode.Keyword, forceCompact) - f.Space() - f.writeNode(optionNode.Name) - f.Space() - f.writeInline(optionNode.Equals) - if node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok { - // Compound string literals are written across multiple lines - // immediately after the '=', so we don't need a trailing - // space in the option prefix. - f.writeCompoundStringLiteralIndentEndInline(node) - f.writeLineEnd(optionNode.Semicolon) - return - } - f.Space() - f.writeInline(optionNode.Val) - f.writeLineEnd(optionNode.Semicolon) -} - -// writeOption writes an option. -// -// For example, -// -// option go_package = "github.com/foo/bar"; -func (f *formatter) writeOption(optionNode *ast.OptionNode) { - f.writeOptionPrefix(optionNode) - if optionNode.Semicolon != nil { - if node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok { - // Compound string literals are written across multiple lines - // immediately after the '=', so we don't need a trailing - // space in the option prefix. - f.writeCompoundStringLiteralIndentEndInline(node) - f.writeLineEnd(optionNode.Semicolon) - return - } - f.writeInline(optionNode.Val) - f.writeLineEnd(optionNode.Semicolon) - return - } - - if node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok { - f.writeCompoundStringLiteralIndent(node) - return - } - f.writeInline(optionNode.Val) -} - -// writeLastCompactOption writes a compact option but preserves its the -// trailing end comments. This is only used for the last compact option -// since it's the only time a trailing ',' will be omitted. -// -// For example, -// -// [ -// deprecated = true, -// json_name = "something" // Trailing comment on the last element. -// ] -func (f *formatter) writeLastCompactOption(optionNode *ast.OptionNode) { - f.writeOptionPrefix(optionNode) - f.writeLineEnd(optionNode.Val) -} - -// writeOptionValue writes the option prefix, which makes up all of the -// option's definition, excluding the final token(s). -// -// For example, -// -// deprecated = -func (f *formatter) writeOptionPrefix(optionNode *ast.OptionNode) { - if optionNode.Keyword != nil { - // Compact options don't have the keyword. - f.writeStart(optionNode.Keyword) - f.Space() - f.writeNode(optionNode.Name) - } else { - f.writeStart(optionNode.Name) - } - f.Space() - f.writeInline(optionNode.Equals) - f.Space() -} - -// writeOptionName writes an option name. -// -// For example, -// -// go_package -// (custom.thing) -// (custom.thing).bridge.(another.thing) -func (f *formatter) writeOptionName(optionNameNode *ast.OptionNameNode) { - for i := 0; i < len(optionNameNode.Parts); i++ { - if f.inCompactOptions && i == 0 { - // The leading comments of the first token (either open rune or the - // name) will have already been written, so we need to handle this - // case specially. - fieldReferenceNode := optionNameNode.Parts[0] - if fieldReferenceNode.Open != nil { - f.writeNode(fieldReferenceNode.Open) - if info := f.fileNode.NodeInfo(fieldReferenceNode.Open); info.TrailingComments().Len() > 0 { - f.writeInlineComments(info.TrailingComments()) - } - f.writeInline(fieldReferenceNode.Name) - } else { - f.writeNode(fieldReferenceNode.Name) - if info := f.fileNode.NodeInfo(fieldReferenceNode.Name); info.TrailingComments().Len() > 0 { - f.writeInlineComments(info.TrailingComments()) - } - } - if fieldReferenceNode.Close != nil { - f.writeInline(fieldReferenceNode.Close) - } - continue - } - if i > 0 { - // The length of this slice must be exactly len(Parts)-1. - f.writeInline(optionNameNode.Dots[i-1]) - } - f.writeNode(optionNameNode.Parts[i]) - } -} - -// writeMessage writes the message node. -// -// For example, -// -// message Foo { -// option deprecated = true; -// reserved 50 to 100; -// extensions 150 to 200; -// -// message Bar { -// string name = 1; -// } -// enum Baz { -// BAZ_UNSPECIFIED = 0; -// } -// extend Bar { -// string value = 2; -// } -// -// Bar bar = 1; -// Baz baz = 2; -// } -func (f *formatter) writeMessage(messageNode *ast.MessageNode) { - var elementWriterFunc func() - if len(messageNode.Decls) != 0 { - elementWriterFunc = func() { - for _, decl := range messageNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(messageNode.Keyword) - f.Space() - f.writeInline(messageNode.Name) - f.Space() - f.writeCompositeTypeBody( - messageNode.OpenBrace, - messageNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeMessageLiteral writes a message literal. -// -// For example, -// -// { -// foo: 1 -// foo: 2 -// foo: 3 -// bar: < -// name:"abc" -// id:123 -// > -// } -func (f *formatter) writeMessageLiteral(messageLiteralNode *ast.MessageLiteralNode) { - if f.maybeWriteCompactMessageLiteral(messageLiteralNode, false) { - return - } - var elementWriterFunc func() - if len(messageLiteralNode.Elements) > 0 { - elementWriterFunc = func() { - f.writeMessageLiteralElements(messageLiteralNode) - } - } - f.writeCompositeValueBody( - messageLiteralNode.Open, - messageLiteralNode.Close, - elementWriterFunc, - ) -} - -// writeMessageLiteral writes a message literal suitable for -// an element in an array literal. -func (f *formatter) writeMessageLiteralForArray( - messageLiteralNode *ast.MessageLiteralNode, - lastElement bool, -) { - if f.maybeWriteCompactMessageLiteral(messageLiteralNode, true) { - return - } - var elementWriterFunc func() - if len(messageLiteralNode.Elements) > 0 { - elementWriterFunc = func() { - f.writeMessageLiteralElements(messageLiteralNode) - } - } - closeWriter := f.writeBodyEndInline - if lastElement { - closeWriter = f.writeBodyEnd - } - f.writeBody( - messageLiteralNode.Open, - messageLiteralNode.Close, - elementWriterFunc, - f.writeOpenBracePrefixForArray, - closeWriter, - ) -} - -func (f *formatter) maybeWriteCompactMessageLiteral( - messageLiteralNode *ast.MessageLiteralNode, - inArrayLiteral bool, -) bool { - if len(messageLiteralNode.Elements) == 0 || len(messageLiteralNode.Elements) > 1 || - f.hasInteriorComments(messageLiteralNode.Children()...) || - messageLiteralHasNestedMessageOrArray(messageLiteralNode) { - return false - } - // messages with a single scalar field and no comments can be - // printed all on one line - if inArrayLiteral { - f.Indent(messageLiteralNode.Open) - } - f.writeInline(messageLiteralNode.Open) - fieldNode := messageLiteralNode.Elements[0] - f.writeInline(fieldNode.Name) - if fieldNode.Sep != nil { - f.writeInline(fieldNode.Sep) - } - f.Space() - f.writeInline(fieldNode.Val) - f.writeInline(messageLiteralNode.Close) - return true -} - -func messageLiteralHasNestedMessageOrArray(messageLiteralNode *ast.MessageLiteralNode) bool { - for _, elem := range messageLiteralNode.Elements { - switch elem.Val.(type) { - case *ast.ArrayLiteralNode, *ast.MessageLiteralNode: - return true - } - } - return false -} - -func arrayLiteralHasNestedMessageOrArray(arrayLiteralNode *ast.ArrayLiteralNode) bool { - for _, elem := range arrayLiteralNode.Elements { - switch elem.(type) { - case *ast.ArrayLiteralNode, *ast.MessageLiteralNode: - return true - } - } - return false -} - -// writeMessageLiteralElements writes the message literal's elements. -// -// For example, -// -// foo: 1 -// foo: 2 -func (f *formatter) writeMessageLiteralElements(messageLiteralNode *ast.MessageLiteralNode) { - for i := 0; i < len(messageLiteralNode.Elements); i++ { - if sep := messageLiteralNode.Seps[i]; sep != nil { - f.writeMessageFieldWithSeparator(messageLiteralNode.Elements[i]) - f.writeLineEnd(messageLiteralNode.Seps[i]) - continue - } - f.writeNode(messageLiteralNode.Elements[i]) - } -} - -// writeMessageField writes the message field node, and concludes the -// line without leaving room for a trailing separator in the parent -// message literal. -func (f *formatter) writeMessageField(messageFieldNode *ast.MessageFieldNode) { - f.writeMessageFieldPrefix(messageFieldNode) - if compoundStringLiteral, ok := messageFieldNode.Val.(*ast.CompoundStringLiteralNode); ok { - f.writeCompoundStringLiteralIndent(compoundStringLiteral) - return - } - f.writeLineEnd(messageFieldNode.Val) -} - -// writeMessageFieldWithSeparator writes the message field node, -// but leaves room for a trailing separator in the parent message -// literal. -func (f *formatter) writeMessageFieldWithSeparator(messageFieldNode *ast.MessageFieldNode) { - f.writeMessageFieldPrefix(messageFieldNode) - if compoundStringLiteral, ok := messageFieldNode.Val.(*ast.CompoundStringLiteralNode); ok { - f.writeCompoundStringLiteralIndentEndInline(compoundStringLiteral) - return - } - f.writeInline(messageFieldNode.Val) -} - -// writeMessageFieldPrefix writes the message field node as a single line. -// -// For example, -// -// foo:"bar" -func (f *formatter) writeMessageFieldPrefix(messageFieldNode *ast.MessageFieldNode) { - // The comments need to be written as a multiline comment above - // the message field name. - // - // Note that this is different than how field reference nodes are - // normally formatted in-line (i.e. as option name components). - fieldReferenceNode := messageFieldNode.Name - if fieldReferenceNode.Open != nil { - f.writeStart(fieldReferenceNode.Open) - f.writeInline(fieldReferenceNode.Name) - } else { - f.writeStart(fieldReferenceNode.Name) - } - if fieldReferenceNode.Close != nil { - f.writeInline(fieldReferenceNode.Close) - } - if messageFieldNode.Sep != nil { - f.writeInline(messageFieldNode.Sep) - } - f.Space() -} - -// writeEnum writes the enum node. -// -// For example, -// -// enum Foo { -// option deprecated = true; -// reserved 1 to 5; -// -// FOO_UNSPECIFIED = 0; -// } -func (f *formatter) writeEnum(enumNode *ast.EnumNode) { - var elementWriterFunc func() - if len(enumNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range enumNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(enumNode.Keyword) - f.Space() - f.writeInline(enumNode.Name) - f.Space() - f.writeCompositeTypeBody( - enumNode.OpenBrace, - enumNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeEnumValue writes the enum value as a single line. If the enum has -// compact options, it will be written across multiple lines. -// -// For example, -// -// FOO_UNSPECIFIED = 1 [ -// deprecated = true -// ]; -func (f *formatter) writeEnumValue(enumValueNode *ast.EnumValueNode) { - f.writeStart(enumValueNode.Name) - f.Space() - f.writeInline(enumValueNode.Equals) - f.Space() - f.writeInline(enumValueNode.Number) - if enumValueNode.Options != nil { - f.Space() - f.writeNode(enumValueNode.Options) - } - f.writeLineEnd(enumValueNode.Semicolon) -} - -// writeField writes the field node as a single line. If the field has -// compact options, it will be written across multiple lines. -// -// For example, -// -// repeated string name = 1 [ -// deprecated = true, -// json_name = "name" -// ]; -func (f *formatter) writeField(fieldNode *ast.FieldNode) { - // We need to handle the comments for the field label specially since - // a label might not be defined, but it has the leading comments attached - // to it. - if fieldNode.Label.KeywordNode != nil { - f.writeStart(fieldNode.Label) - f.Space() - f.writeInline(fieldNode.FldType) - } else { - // If a label was not written, the multiline comments will be - // attached to the type. - if compoundIdentNode, ok := fieldNode.FldType.(*ast.CompoundIdentNode); ok { - f.writeCompountIdentForFieldName(compoundIdentNode) - } else { - f.writeStart(fieldNode.FldType) - } - } - f.Space() - f.writeInline(fieldNode.Name) - f.Space() - f.writeInline(fieldNode.Equals) - f.Space() - f.writeInline(fieldNode.Tag) - if fieldNode.Options != nil { - f.Space() - f.writeNode(fieldNode.Options) - } - f.writeLineEnd(fieldNode.Semicolon) -} - -// writeMapField writes a map field (e.g. 'map pairs = 1;'). -func (f *formatter) writeMapField(mapFieldNode *ast.MapFieldNode) { - f.writeNode(mapFieldNode.MapType) - f.Space() - f.writeInline(mapFieldNode.Name) - f.Space() - f.writeInline(mapFieldNode.Equals) - f.Space() - f.writeInline(mapFieldNode.Tag) - if mapFieldNode.Options != nil { - f.Space() - f.writeNode(mapFieldNode.Options) - } - f.writeLineEnd(mapFieldNode.Semicolon) -} - -// writeMapType writes a map type (e.g. 'map'). -func (f *formatter) writeMapType(mapTypeNode *ast.MapTypeNode) { - f.writeStart(mapTypeNode.Keyword) - f.writeInline(mapTypeNode.OpenAngle) - f.writeInline(mapTypeNode.KeyType) - f.writeInline(mapTypeNode.Comma) - f.Space() - f.writeInline(mapTypeNode.ValueType) - f.writeInline(mapTypeNode.CloseAngle) -} - -// writeFieldReference writes a field reference (e.g. '(foo.bar)'). -func (f *formatter) writeFieldReference(fieldReferenceNode *ast.FieldReferenceNode) { - if fieldReferenceNode.Open != nil { - f.writeInline(fieldReferenceNode.Open) - } - f.writeInline(fieldReferenceNode.Name) - if fieldReferenceNode.Close != nil { - f.writeInline(fieldReferenceNode.Close) - } -} - -// writeExtend writes the extend node. -// -// For example, -// -// extend google.protobuf.FieldOptions { -// bool redacted = 33333; -// } -func (f *formatter) writeExtend(extendNode *ast.ExtendNode) { - var elementWriterFunc func() - if len(extendNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range extendNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(extendNode.Keyword) - f.Space() - f.writeInline(extendNode.Extendee) - f.Space() - f.writeCompositeTypeBody( - extendNode.OpenBrace, - extendNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeService writes the service node. -// -// For example, -// -// service FooService { -// option deprecated = true; -// -// rpc Foo(FooRequest) returns (FooResponse) {}; -func (f *formatter) writeService(serviceNode *ast.ServiceNode) { - var elementWriterFunc func() - if len(serviceNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range serviceNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(serviceNode.Keyword) - f.Space() - f.writeInline(serviceNode.Name) - f.Space() - f.writeCompositeTypeBody( - serviceNode.OpenBrace, - serviceNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeRPC writes the RPC node. RPCs are formatted in -// the following order: -// -// For example, -// -// rpc Foo(FooRequest) returns (FooResponse) { -// option deprecated = true; -// }; -func (f *formatter) writeRPC(rpcNode *ast.RPCNode) { - var elementWriterFunc func() - if len(rpcNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range rpcNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(rpcNode.Keyword) - f.Space() - f.writeInline(rpcNode.Name) - f.writeInline(rpcNode.Input) - f.Space() - f.writeInline(rpcNode.Returns) - f.Space() - f.writeInline(rpcNode.Output) - if rpcNode.OpenBrace == nil { - // This RPC doesn't have any elements, so we prefer the - // ';' form. - // - // rpc Ping(PingRequest) returns (PingResponse); - // - f.writeLineEnd(rpcNode.Semicolon) - return - } - f.Space() - f.writeCompositeTypeBody( - rpcNode.OpenBrace, - rpcNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeRPCType writes the RPC type node (e.g. (stream foo.Bar)). -func (f *formatter) writeRPCType(rpcTypeNode *ast.RPCTypeNode) { - f.writeInline(rpcTypeNode.OpenParen) - if rpcTypeNode.Stream != nil { - f.writeInline(rpcTypeNode.Stream) - f.Space() - } - f.writeInline(rpcTypeNode.MessageType) - f.writeInline(rpcTypeNode.CloseParen) -} - -// writeOneOf writes the oneof node. -// -// For example, -// -// oneof foo { -// option deprecated = true; -// -// string name = 1; -// int number = 2; -// } -func (f *formatter) writeOneOf(oneOfNode *ast.OneOfNode) { - var elementWriterFunc func() - if len(oneOfNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range oneOfNode.Decls { - f.writeNode(decl) - } - } - } - f.writeStart(oneOfNode.Keyword) - f.Space() - f.writeInline(oneOfNode.Name) - f.Space() - f.writeCompositeTypeBody( - oneOfNode.OpenBrace, - oneOfNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeGroup writes the group node. -// -// For example, -// -// optional group Key = 4 [ -// deprecated = true, -// json_name = "key" -// ] { -// optional uint64 id = 1; -// optional string name = 2; -// } -func (f *formatter) writeGroup(groupNode *ast.GroupNode) { - var elementWriterFunc func() - if len(groupNode.Decls) > 0 { - elementWriterFunc = func() { - for _, decl := range groupNode.Decls { - f.writeNode(decl) - } - } - } - // We need to handle the comments for the group label specially since - // a label might not be defined, but it has the leading comments attached - // to it. - if groupNode.Label.KeywordNode != nil { - f.writeStart(groupNode.Label) - f.Space() - f.writeInline(groupNode.Keyword) - } else { - // If a label was not written, the multiline comments will be - // attached to the keyword. - f.writeStart(groupNode.Keyword) - } - f.Space() - f.writeInline(groupNode.Name) - f.Space() - f.writeInline(groupNode.Equals) - f.Space() - f.writeInline(groupNode.Tag) - if groupNode.Options != nil { - f.Space() - f.writeNode(groupNode.Options) - } - f.Space() - f.writeCompositeTypeBody( - groupNode.OpenBrace, - groupNode.CloseBrace, - elementWriterFunc, - ) -} - -// writeExtensionRange writes the extension range node. -// -// For example, -// -// extensions 5-10, 100 to max [ -// deprecated = true -// ]; -func (f *formatter) writeExtensionRange(extensionRangeNode *ast.ExtensionRangeNode) { - f.writeStart(extensionRangeNode.Keyword) - f.Space() - for i := 0; i < len(extensionRangeNode.Ranges); i++ { - if i > 0 { - // The length of this slice must be exactly len(Ranges)-1. - f.writeInline(extensionRangeNode.Commas[i-1]) - f.Space() - } - f.writeNode(extensionRangeNode.Ranges[i]) - } - if extensionRangeNode.Options != nil { - f.Space() - f.writeNode(extensionRangeNode.Options) - } - f.writeLineEnd(extensionRangeNode.Semicolon) -} - -// writeReserved writes a reserved node. -// -// For example, -// -// reserved 5-10, 100 to max; -func (f *formatter) writeReserved(reservedNode *ast.ReservedNode) { - f.writeStart(reservedNode.Keyword) - // Either names or ranges will be set, but never both. - elements := make([]ast.Node, 0, len(reservedNode.Names)+len(reservedNode.Ranges)) - switch { - case reservedNode.Names != nil: - for _, nameNode := range reservedNode.Names { - elements = append(elements, nameNode) - } - case reservedNode.Ranges != nil: - for _, rangeNode := range reservedNode.Ranges { - elements = append(elements, rangeNode) - } - } - f.Space() - for i := 0; i < len(elements); i++ { - if i > 0 { - // The length of this slice must be exactly len({Names,Ranges})-1. - f.writeInline(reservedNode.Commas[i-1]) - f.Space() - } - f.writeInline(elements[i]) - } - f.writeLineEnd(reservedNode.Semicolon) -} - -// writeRange writes the given range node (e.g. '1 to max'). -func (f *formatter) writeRange(rangeNode *ast.RangeNode) { - f.writeInline(rangeNode.StartVal) - if rangeNode.To != nil { - f.Space() - f.writeInline(rangeNode.To) - } - // Either EndVal or Max will be set, but never both. - switch { - case rangeNode.EndVal != nil: - f.Space() - f.writeInline(rangeNode.EndVal) - case rangeNode.Max != nil: - f.Space() - f.writeInline(rangeNode.Max) - } -} - -// writeCompactOptions writes a compact options node. -// -// For example, -// -// [ -// deprecated = true, -// json_name = "something" -// ] -func (f *formatter) writeCompactOptions(compactOptionsNode *ast.CompactOptionsNode) { - f.inCompactOptions = true - defer func() { - f.inCompactOptions = false - }() - if len(compactOptionsNode.Options) == 1 && - !f.hasInteriorComments(compactOptionsNode.OpenBracket, compactOptionsNode.Options[0].Name) { - // If there's only a single compact scalar option without comments, we can write it - // in-line. For example: - // - // [deprecated = true] - // - // However, this does not include the case when the '[' has trailing comments, - // or the option name has leading comments. In those cases, we write the option - // across multiple lines. For example: - // - // [ - // // This type is deprecated. - // deprecated = true - // ] - // - optionNode := compactOptionsNode.Options[0] - f.writeInline(compactOptionsNode.OpenBracket) - f.writeInline(optionNode.Name) - f.Space() - f.writeInline(optionNode.Equals) - if node, ok := optionNode.Val.(*ast.CompoundStringLiteralNode); ok { - // If there's only a single compact option, the value needs to - // write its comments (if any) in a way that preserves the closing ']'. - f.writeCompoundStringLiteralNoIndentEndInline(node) - f.writeInline(compactOptionsNode.CloseBracket) - return - } - f.Space() - f.writeInline(optionNode.Val) - f.writeInline(compactOptionsNode.CloseBracket) - return - } - var elementWriterFunc func() - if len(compactOptionsNode.Options) > 0 { - elementWriterFunc = func() { - for i, opt := range compactOptionsNode.Options { - if i == len(compactOptionsNode.Options)-1 { - // The last element won't have a trailing comma. - f.writeLastCompactOption(opt) - return - } - f.writeNode(opt) - f.writeLineEnd(compactOptionsNode.Commas[i]) - } - } - } - f.writeCompositeValueBody( - compactOptionsNode.OpenBracket, - compactOptionsNode.CloseBracket, - elementWriterFunc, - ) -} - -func (f *formatter) hasInteriorComments(nodes ...ast.Node) bool { - for i, n := range nodes { - // interior comments mean we ignore leading comments on first - // token and trailing comments on the last one - info := f.fileNode.NodeInfo(n) - if i > 0 && info.LeadingComments().Len() > 0 { - return true - } - if i < len(nodes)-1 && info.TrailingComments().Len() > 0 { - return true - } - } - return false -} - -// writeArrayLiteral writes an array literal across multiple lines. -// -// For example, -// -// [ -// "foo", -// "bar" -// ] -func (f *formatter) writeArrayLiteral(arrayLiteralNode *ast.ArrayLiteralNode) { - if len(arrayLiteralNode.Elements) == 1 && - !f.hasInteriorComments(arrayLiteralNode.Children()...) && - !arrayLiteralHasNestedMessageOrArray(arrayLiteralNode) { - // arrays with a single scalar value and no comments can be - // printed all on one line - valueNode := arrayLiteralNode.Elements[0] - f.writeInline(arrayLiteralNode.OpenBracket) - f.writeInline(valueNode) - f.writeInline(arrayLiteralNode.CloseBracket) - return - } - - var elementWriterFunc func() - if len(arrayLiteralNode.Elements) > 0 { - elementWriterFunc = func() { - for i := 0; i < len(arrayLiteralNode.Elements); i++ { - lastElement := i == len(arrayLiteralNode.Elements)-1 - if compositeNode, ok := arrayLiteralNode.Elements[i].(ast.CompositeNode); ok { - f.writeCompositeValueForArrayLiteral(compositeNode, lastElement) - if !lastElement { - f.writeLineEnd(arrayLiteralNode.Commas[i]) - } - continue - } - if lastElement { - // The last element won't have a trailing comma. - f.writeLineElement(arrayLiteralNode.Elements[i]) - return - } - f.writeStart(arrayLiteralNode.Elements[i]) - f.writeLineEnd(arrayLiteralNode.Commas[i]) - } - } - } - f.writeCompositeValueBody( - arrayLiteralNode.OpenBracket, - arrayLiteralNode.CloseBracket, - elementWriterFunc, - ) -} - -// writeCompositeForArrayLiteral writes the composite node in a way that's suitable -// for array literals. In general, signed integers and compound strings should have their -// comments written in-line because they are one of many components in a single line. -// -// However, each of these composite types occupy a single line in an array literal, -// so they need their comments to be formatted like a standalone node. -// -// For example, -// -// option (value) = /* In-line comment for '-42' */ -42; -// -// option (thing) = { -// values: [ -// // Leading comment on -42. -// -42, // Trailing comment on -42. -// ] -// } -// -// The lastElement boolean is used to signal whether or not the composite value -// should be written as the last element (i.e. it doesn't have a trailing comma). -func (f *formatter) writeCompositeValueForArrayLiteral( - compositeNode ast.CompositeNode, - lastElement bool, -) { - switch node := compositeNode.(type) { - case *ast.CompoundStringLiteralNode: - f.writeCompoundStringLiteralForArray(node, lastElement) - case *ast.PositiveUintLiteralNode: - f.writePositiveUintLiteralForArray(node, lastElement) - case *ast.NegativeIntLiteralNode: - f.writeNegativeIntLiteralForArray(node, lastElement) - case *ast.SignedFloatLiteralNode: - f.writeSignedFloatLiteralForArray(node, lastElement) - case *ast.MessageLiteralNode: - f.writeMessageLiteralForArray(node, lastElement) - default: - f.err = multierr.Append(f.err, fmt.Errorf("unexpected array value node %T", node)) - } -} - -// writeCompositeTypeBody writes the body of a composite type, e.g. message, enum, extend, oneof, etc. -func (f *formatter) writeCompositeTypeBody( - openBrace *ast.RuneNode, - closeBrace *ast.RuneNode, - elementWriterFunc func(), -) { - f.writeBody( - openBrace, - closeBrace, - elementWriterFunc, - f.writeOpenBracePrefix, - f.writeBodyEnd, - ) -} - -// writeCompositeValueBody writes the body of a composite value, e.g. compact options, -// array literal, etc. We need to handle the ']' different than composite types because -// there could be more tokens following the final ']'. -func (f *formatter) writeCompositeValueBody( - openBrace *ast.RuneNode, - closeBrace *ast.RuneNode, - elementWriterFunc func(), -) { - f.writeBody( - openBrace, - closeBrace, - elementWriterFunc, - f.writeOpenBracePrefix, - f.writeBodyEndInline, - ) -} - -// writeBody writes the body of a type or value, e.g. message, enum, compact options, etc. -// The elementWriterFunc is used to write the declarations within the composite type (e.g. -// fields in a message). The openBraceWriterFunc and closeBraceWriterFunc functions are used -// to customize how the '{' and '} nodes are written, respectively. -func (f *formatter) writeBody( - openBrace *ast.RuneNode, - closeBrace *ast.RuneNode, - elementWriterFunc func(), - openBraceWriterFunc func(ast.Node), - closeBraceWriterFunc func(ast.Node, bool), -) { - if elementWriterFunc == nil && !f.hasInteriorComments(openBrace, closeBrace) { - // completely empty body - f.writeInline(openBrace) - closeBraceWriterFunc(closeBrace, true) - return - } - - openBraceWriterFunc(openBrace) - if elementWriterFunc != nil { - elementWriterFunc() - } - closeBraceWriterFunc(closeBrace, false) -} - -// writeOpenBracePrefix writes the open brace with its leading comments in-line. -// This is used for nearly every use case of f.writeBody, excluding the instances -// in array literals. -func (f *formatter) writeOpenBracePrefix(openBrace ast.Node) { - defer f.SetPreviousNode(openBrace) - info := f.fileNode.NodeInfo(openBrace) - if info.LeadingComments().Len() > 0 { - f.writeInlineComments(info.LeadingComments()) - if info.LeadingWhitespace() != "" { - f.Space() - } - } - f.writeNode(openBrace) - if info.TrailingComments().Len() > 0 { - f.writeTrailingEndComments(info.TrailingComments()) - } else { - f.P("") - } -} - -// writeOpenBracePrefixForArray writes the open brace with its leading comments -// on multiple lines. This is only used for message literals in arrays. -func (f *formatter) writeOpenBracePrefixForArray(openBrace ast.Node) { - defer f.SetPreviousNode(openBrace) - info := f.fileNode.NodeInfo(openBrace) - if info.LeadingComments().Len() > 0 { - f.writeMultilineComments(info.LeadingComments()) - } - f.Indent(openBrace) - f.writeNode(openBrace) - if info.TrailingComments().Len() > 0 { - f.writeTrailingEndComments(info.TrailingComments()) - } else { - f.P("") - } -} - -// writeCompoundIdent writes a compound identifier (e.g. '.com.foo.Bar'). -func (f *formatter) writeCompoundIdent(compoundIdentNode *ast.CompoundIdentNode) { - if compoundIdentNode.LeadingDot != nil { - f.writeInline(compoundIdentNode.LeadingDot) - } - for i := 0; i < len(compoundIdentNode.Components); i++ { - if i > 0 { - // The length of this slice must be exactly len(Components)-1. - f.writeInline(compoundIdentNode.Dots[i-1]) - } - f.writeInline(compoundIdentNode.Components[i]) - } -} - -// writeCompountIdentForFieldName writes a compound identifier, but handles comments -// specially for field names. -// -// For example, -// -// message Foo { -// // These are comments attached to bar. -// bar.v1.Bar bar = 1; -// } -func (f *formatter) writeCompountIdentForFieldName(compoundIdentNode *ast.CompoundIdentNode) { - if compoundIdentNode.LeadingDot != nil { - f.writeStart(compoundIdentNode.LeadingDot) - } - for i := 0; i < len(compoundIdentNode.Components); i++ { - if i == 0 && compoundIdentNode.LeadingDot == nil { - f.writeStart(compoundIdentNode.Components[i]) - continue - } - if i > 0 { - // The length of this slice must be exactly len(Components)-1. - f.writeInline(compoundIdentNode.Dots[i-1]) - } - f.writeInline(compoundIdentNode.Components[i]) - } -} - -// writeFieldLabel writes the field label node. -// -// For example, -// -// optional -// repeated -// required -func (f *formatter) writeFieldLabel(fieldLabel ast.FieldLabel) { - f.WriteString(fieldLabel.Val) -} - -// writeCompoundStringLiteral writes a compound string literal value. -// -// For example, -// -// "one," -// "two," -// "three" -func (f *formatter) writeCompoundStringLiteral( - compoundStringLiteralNode *ast.CompoundStringLiteralNode, - needsIndent bool, - hasTrailingPunctuation bool, -) { - f.P("") - if needsIndent { - f.In() - } - for i, child := range compoundStringLiteralNode.Children() { - if hasTrailingPunctuation && i == len(compoundStringLiteralNode.Children())-1 { - // inline because there may be a subsequent comma or punctuation from enclosing element - f.writeStart(child) - break - } - f.writeLineElement(child) - } - if needsIndent { - f.Out() - } -} - -func (f *formatter) writeCompoundStringLiteralIndent( - compoundStringLiteralNode *ast.CompoundStringLiteralNode, -) { - f.writeCompoundStringLiteral(compoundStringLiteralNode, true, false) -} - -func (f *formatter) writeCompoundStringLiteralIndentEndInline( - compoundStringLiteralNode *ast.CompoundStringLiteralNode, -) { - f.writeCompoundStringLiteral(compoundStringLiteralNode, true, true) -} - -func (f *formatter) writeCompoundStringLiteralNoIndentEndInline( - compoundStringLiteralNode *ast.CompoundStringLiteralNode, -) { - f.writeCompoundStringLiteral(compoundStringLiteralNode, false, true) -} - -// writeCompoundStringLiteralForArray writes a compound string literal value, -// but writes its comments suitable for an element in an array literal. -// -// The lastElement boolean is used to signal whether or not the value should -// be written as the last element (i.e. it doesn't have a trailing comma). -func (f *formatter) writeCompoundStringLiteralForArray( - compoundStringLiteralNode *ast.CompoundStringLiteralNode, - lastElement bool, -) { - for i, child := range compoundStringLiteralNode.Children() { - if !lastElement && i == len(compoundStringLiteralNode.Children())-1 { - f.writeStart(child) - return - } - f.writeLineElement(child) - } -} - -// writeFloatLiteral writes a float literal value (e.g. '42.2'). -func (f *formatter) writeFloatLiteral(floatLiteralNode *ast.FloatLiteralNode) { - f.writeRaw(floatLiteralNode) -} - -// writeSignedFloatLiteral writes a signed float literal value (e.g. '-42.2'). -func (f *formatter) writeSignedFloatLiteral(signedFloatLiteralNode *ast.SignedFloatLiteralNode) { - f.writeInline(signedFloatLiteralNode.Sign) - f.writeInline(signedFloatLiteralNode.Float) -} - -// writeSignedFloatLiteralForArray writes a signed float literal value, but writes -// its comments suitable for an element in an array literal. -// -// The lastElement boolean is used to signal whether or not the value should -// be written as the last element (i.e. it doesn't have a trailing comma). -func (f *formatter) writeSignedFloatLiteralForArray( - signedFloatLiteralNode *ast.SignedFloatLiteralNode, - lastElement bool, -) { - f.writeStart(signedFloatLiteralNode.Sign) - if lastElement { - f.writeLineEnd(signedFloatLiteralNode.Float) - return - } - f.writeInline(signedFloatLiteralNode.Float) -} - -// writeSpecialFloatLiteral writes a special float literal value (e.g. "nan" or "inf"). -func (f *formatter) writeSpecialFloatLiteral(specialFloatLiteralNode *ast.SpecialFloatLiteralNode) { - f.WriteString(specialFloatLiteralNode.KeywordNode.Val) -} - -// writeStringLiteral writes a string literal value (e.g. "foo"). -// Note that the raw string is written as-is so that it preserves -// the quote style used in the original source. -func (f *formatter) writeStringLiteral(stringLiteralNode *ast.StringLiteralNode) { - f.writeRaw(stringLiteralNode) -} - -// writeUintLiteral writes a uint literal (e.g. '42'). -func (f *formatter) writeUintLiteral(uintLiteralNode *ast.UintLiteralNode) { - f.writeRaw(uintLiteralNode) -} - -// writeNegativeIntLiteral writes a negative int literal (e.g. '-42'). -func (f *formatter) writeNegativeIntLiteral(negativeIntLiteralNode *ast.NegativeIntLiteralNode) { - f.writeInline(negativeIntLiteralNode.Minus) - f.writeInline(negativeIntLiteralNode.Uint) -} - -func (f *formatter) writeRaw(n ast.Node) { - info := f.fileNode.NodeInfo(n) - f.WriteString(info.RawText()) -} - -// writeNegativeIntLiteralForArray writes a negative int literal value, but writes -// its comments suitable for an element in an array literal. -// -// The lastElement boolean is used to signal whether or not the value should -// be written as the last element (i.e. it doesn't have a trailing comma). -func (f *formatter) writeNegativeIntLiteralForArray( - negativeIntLiteralNode *ast.NegativeIntLiteralNode, - lastElement bool, -) { - f.writeStart(negativeIntLiteralNode.Minus) - if lastElement { - f.writeLineEnd(negativeIntLiteralNode.Uint) - return - } - f.writeInline(negativeIntLiteralNode.Uint) -} - -// writePositiveUintLiteral writes a positive uint literal (e.g. '+42'). -func (f *formatter) writePositiveUintLiteral(positiveIntLiteralNode *ast.PositiveUintLiteralNode) { - f.writeInline(positiveIntLiteralNode.Plus) - f.writeInline(positiveIntLiteralNode.Uint) -} - -// writePositiveUintLiteralForArray writes a positive uint literal value, but writes -// its comments suitable for an element in an array literal. -// -// The lastElement boolean is used to signal whether or not the value should -// be written as the last element (i.e. it doesn't have a trailing comma). -func (f *formatter) writePositiveUintLiteralForArray( - positiveIntLiteralNode *ast.PositiveUintLiteralNode, - lastElement bool, -) { - f.writeStart(positiveIntLiteralNode.Plus) - if lastElement { - f.writeLineEnd(positiveIntLiteralNode.Uint) - return - } - f.writeInline(positiveIntLiteralNode.Uint) -} - -// writeIdent writes an identifier (e.g. 'foo'). -func (f *formatter) writeIdent(identNode *ast.IdentNode) { - f.WriteString(identNode.Val) -} - -// writeKeyword writes a keyword (e.g. 'syntax'). -func (f *formatter) writeKeyword(keywordNode *ast.KeywordNode) { - f.WriteString(keywordNode.Val) -} - -// writeRune writes a rune (e.g. '='). -func (f *formatter) writeRune(runeNode *ast.RuneNode) { - if strings.ContainsRune("{[(<", runeNode.Rune) { - f.pendingIndent++ - } else if strings.ContainsRune("}])>", runeNode.Rune) { - f.pendingIndent-- - } - f.WriteString(string(runeNode.Rune)) -} - -// writeNode writes the node by dispatching to a function tailored to its concrete type. -// -// Comments are handled in each respective write function so that it can determine whether -// to write the comments in-line or not. -func (f *formatter) writeNode(node ast.Node) { - switch element := node.(type) { - case *ast.ArrayLiteralNode: - f.writeArrayLiteral(element) - case *ast.CompactOptionsNode: - f.writeCompactOptions(element) - case *ast.CompoundIdentNode: - f.writeCompoundIdent(element) - case *ast.CompoundStringLiteralNode: - f.writeCompoundStringLiteralIndent(element) - case *ast.EnumNode: - f.writeEnum(element) - case *ast.EnumValueNode: - f.writeEnumValue(element) - case *ast.ExtendNode: - f.writeExtend(element) - case *ast.ExtensionRangeNode: - f.writeExtensionRange(element) - case ast.FieldLabel: - f.writeFieldLabel(element) - case *ast.FieldNode: - f.writeField(element) - case *ast.FieldReferenceNode: - f.writeFieldReference(element) - case *ast.FloatLiteralNode: - f.writeFloatLiteral(element) - case *ast.GroupNode: - f.writeGroup(element) - case *ast.IdentNode: - f.writeIdent(element) - case *ast.ImportNode: - f.writeImport(element, false) - case *ast.KeywordNode: - f.writeKeyword(element) - case *ast.MapFieldNode: - f.writeMapField(element) - case *ast.MapTypeNode: - f.writeMapType(element) - case *ast.MessageNode: - f.writeMessage(element) - case *ast.MessageFieldNode: - f.writeMessageField(element) - case *ast.MessageLiteralNode: - f.writeMessageLiteral(element) - case *ast.NegativeIntLiteralNode: - f.writeNegativeIntLiteral(element) - case *ast.OneOfNode: - f.writeOneOf(element) - case *ast.OptionNode: - f.writeOption(element) - case *ast.OptionNameNode: - f.writeOptionName(element) - case *ast.PackageNode: - f.writePackage(element) - case *ast.PositiveUintLiteralNode: - f.writePositiveUintLiteral(element) - case *ast.RangeNode: - f.writeRange(element) - case *ast.ReservedNode: - f.writeReserved(element) - case *ast.RPCNode: - f.writeRPC(element) - case *ast.RPCTypeNode: - f.writeRPCType(element) - case *ast.RuneNode: - f.writeRune(element) - case *ast.ServiceNode: - f.writeService(element) - case *ast.SignedFloatLiteralNode: - f.writeSignedFloatLiteral(element) - case *ast.SpecialFloatLiteralNode: - f.writeSpecialFloatLiteral(element) - case *ast.StringLiteralNode: - f.writeStringLiteral(element) - case *ast.SyntaxNode: - f.writeSyntax(element) - case *ast.UintLiteralNode: - f.writeUintLiteral(element) - case *ast.EmptyDeclNode: - // Nothing to do here. - default: - f.err = multierr.Append(f.err, fmt.Errorf("unexpected node: %T", node)) - } -} - -// writeStart writes the node across as the start of a line. -// Start nodes have their leading comments written across -// multiple lines, but their trailing comments must be written -// in-line to preserve the line structure. -// -// For example, -// -// // Leading comment on 'message'. -// // Spread across multiple lines. -// message /* This is a trailing comment on 'message' */ Foo {} -// -// Newlines are preserved, so that any logical grouping of elements -// is maintained in the formatted result. -// -// For example, -// -// // Type represents a set of different types. -// enum Type { -// // Unspecified is the naming convention for default enum values. -// TYPE_UNSPECIFIED = 0; -// -// // The following elements are the real values. -// TYPE_ONE = 1; -// TYPE_TWO = 2; -// } -// -// Start nodes are always indented according to the formatter's -// current level of indentation (e.g. nested messages, fields, etc). -// -// Note that this is one of the most complex component of the formatter - it -// controls how each node should be separated from one another and preserves -// newlines in the original source. -func (f *formatter) writeStart(node ast.Node) { - f.writeStartMaybeCompact(node, false) -} - -func (f *formatter) writeStartMaybeCompact(node ast.Node, forceCompact bool) { - defer f.SetPreviousNode(node) - info := f.fileNode.NodeInfo(node) - var ( - nodeNewlineCount = newlineCount(info.LeadingWhitespace()) - compact = forceCompact || isOpenBrace(f.previousNode) - ) - if length := info.LeadingComments().Len(); length > 0 { - // If leading comments are defined, the whitespace we care about - // is attached to the first comment. - f.writeMultilineCommentsMaybeCompact(info.LeadingComments(), forceCompact) - if !forceCompact && nodeNewlineCount > 1 { - // At this point, we're looking at the lines between - // a comment and the node its attached to. - // - // If the last comment is a standard comment, a single newline - // character is sufficient to warrant a separation of the - // two. - // - // If the last comment is a C-style comment, multiple newline - // characters are required because C-style comments don't consume - // a newline. - f.P("") - } - } else if !compact && nodeNewlineCount > 1 { - // If the previous node is an open brace, this is the first element - // in the body of a composite type, so we don't want to write a - // newline. This makes it so that trailing newlines are removed. - // - // For example, - // - // message Foo { - // - // string bar = 1; - // } - // - // Is formatted into the following: - // - // message Foo { - // string bar = 1; - // } - f.P("") - } - f.Indent(node) - f.writeNode(node) - if info.TrailingComments().Len() > 0 { - f.writeInlineComments(info.TrailingComments()) - } -} - -// writeInline writes the node and its surrounding comments in-line. -// -// This is useful for writing individual nodes like keywords, runes, -// string literals, etc. -// -// For example, -// -// // This is a leading comment on the syntax keyword. -// syntax = /* This is a leading comment on 'proto3' */" proto3"; -func (f *formatter) writeInline(node ast.Node) { - f.inline = true - defer func() { - f.inline = false - }() - if _, ok := node.(ast.CompositeNode); ok { - // We only want to write comments for terminal nodes. - // Otherwise comments accessible from CompositeNodes - // will be written twice. - f.writeNode(node) - return - } - defer f.SetPreviousNode(node) - info := f.fileNode.NodeInfo(node) - if info.LeadingComments().Len() > 0 { - f.writeInlineComments(info.LeadingComments()) - if info.LeadingWhitespace() != "" { - f.Space() - } - } - f.writeNode(node) - f.writeInlineComments(info.TrailingComments()) -} - -// writeBodyEnd writes the node as the end of a body. -// Leading comments are written above the token across -// multiple lines, whereas the trailing comments are -// written in-line and preserve their format. -// -// Body end nodes are always indented according to the -// formatter's current level of indentation (e.g. nested -// messages). -// -// This is useful for writing a node that concludes a -// composite node: ']', '}', '>', etc. -// -// For example, -// -// message Foo { -// string bar = 1; -// // Leading comment on '}'. -// } // Trailing comment on '}. -func (f *formatter) writeBodyEnd(node ast.Node, leadingEndline bool) { - if _, ok := node.(ast.CompositeNode); ok { - // We only want to write comments for terminal nodes. - // Otherwise comments accessible from CompositeNodes - // will be written twice. - f.writeNode(node) - if f.lastWritten != '\n' { - f.P("") - } - return - } - defer f.SetPreviousNode(node) - info := f.fileNode.NodeInfo(node) - if leadingEndline { - if info.LeadingComments().Len() > 0 { - f.writeInlineComments(info.LeadingComments()) - if info.LeadingWhitespace() != "" { - f.Space() - } - } - } else { - f.writeMultilineComments(info.LeadingComments()) - f.Indent(node) - } - f.writeNode(node) - f.writeTrailingEndComments(info.TrailingComments()) -} - -func (f *formatter) writeLineElement(node ast.Node) { - f.writeBodyEnd(node, false) -} - -// writeBodyEndInline writes the node as the end of a body. -// Leading comments are written above the token across -// multiple lines, whereas the trailing comments are -// written in-line and adapt their comment style if they -// exist. -// -// Body end nodes are always indented according to the -// formatter's current level of indentation (e.g. nested -// messages). -// -// This is useful for writing a node that concludes either -// compact options or an array literal. -// -// This is behaviorally similar to f.writeStart, but it ignores -// the preceding newline logic because these body ends should -// always be compact. -// -// For example, -// -// message Foo { -// string bar = 1 [ -// deprecated = true -// -// // Leading comment on ']'. -// ] /* Trailing comment on ']' */ ; -// } -func (f *formatter) writeBodyEndInline(node ast.Node, leadingInline bool) { - if _, ok := node.(ast.CompositeNode); ok { - // We only want to write comments for terminal nodes. - // Otherwise comments accessible from CompositeNodes - // will be written twice. - f.writeNode(node) - return - } - defer f.SetPreviousNode(node) - info := f.fileNode.NodeInfo(node) - if leadingInline { - if info.LeadingComments().Len() > 0 { - f.writeInlineComments(info.LeadingComments()) - if info.LeadingWhitespace() != "" { - f.Space() - } - } - } else { - f.writeMultilineComments(info.LeadingComments()) - f.Indent(node) - } - f.writeNode(node) - if info.TrailingComments().Len() > 0 { - f.writeInlineComments(info.TrailingComments()) - } -} - -// writeLineEnd writes the node so that it ends a line. -// -// This is useful for writing individual nodes like ';' and other -// tokens that conclude the end of a single line. In this case, we -// don't want to transform the trailing comment's from '//' to C-style -// because it's not necessary. -// -// For example, -// -// // This is a leading comment on the syntax keyword. -// syntax = " proto3" /* This is a leading comment on the ';'; // This is a trailing comment on the ';'. -func (f *formatter) writeLineEnd(node ast.Node) { - if _, ok := node.(ast.CompositeNode); ok { - // We only want to write comments for terminal nodes. - // Otherwise comments accessible from CompositeNodes - // will be written twice. - f.writeNode(node) - if f.lastWritten != '\n' { - f.P("") - } - return - } - defer f.SetPreviousNode(node) - info := f.fileNode.NodeInfo(node) - if info.LeadingComments().Len() > 0 { - f.writeInlineComments(info.LeadingComments()) - if info.LeadingWhitespace() != "" { - f.Space() - } - } - f.writeNode(node) - f.Space() - f.writeTrailingEndComments(info.TrailingComments()) -} - -// writeMultilineComments writes the given comments as a newline-delimited block. -// This is useful for both the beginning of a type (e.g. message, field, etc), as -// well as the trailing comments attached to the beginning of a body block (e.g. -// '{', '[', '<', etc). -// -// For example, -// -// // This is a comment spread across -// // multiple lines. -// message Foo {} -func (f *formatter) writeMultilineComments(comments ast.Comments) { - f.writeMultilineCommentsMaybeCompact(comments, false) -} - -func (f *formatter) writeMultilineCommentsMaybeCompact(comments ast.Comments, forceCompact bool) { - compact := forceCompact || isOpenBrace(f.previousNode) - for i := 0; i < comments.Len(); i++ { - comment := comments.Index(i) - if !compact && newlineCount(comment.LeadingWhitespace()) > 1 { - // Newlines between blocks of comments should be preserved. - // - // For example, - // - // // This is a license header - // // spread across multiple lines. - // - // // Package pet.v1 defines a PetStore API. - // package pet.v1; - // - f.P("") - } - compact = false - f.writeComment(comment.RawText()) - f.WriteString("\n") - } -} - -// writeInlineComments writes the given comments in-line. Standard comments are -// transformed to C-style comments so that we can safely write the comment in-line. -// -// Nearly all of these comments will already be C-style comments. The only cases we're -// preventing are when the type is defined across multiple lines. -// -// For example, given the following: -// -// extend . google. // in-line comment -// protobuf . -// ExtensionRangeOptions { -// optional string label = 20000; -// } -// -// The formatted result is shown below: -// -// extend .google.protobuf./* in-line comment */ExtensionRangeOptions { -// optional string label = 20000; -// } -func (f *formatter) writeInlineComments(comments ast.Comments) { - for i := 0; i < comments.Len(); i++ { - if i > 0 || comments.Index(i).LeadingWhitespace() != "" || f.lastWritten == ';' || f.lastWritten == '}' { - f.Space() - } - text := comments.Index(i).RawText() - if strings.HasPrefix(text, "//") { - text = strings.TrimSpace(strings.TrimPrefix(text, "//")) - text = "/* " + text + " */" - } else { - // no multi-line comments - lines := strings.Split(text, "\n") - for i := range lines { - lines[i] = strings.TrimSpace(lines[i]) - } - text = strings.Join(lines, " ") - } - f.WriteString(text) - } -} - -// writeTrailingEndComments writes the given comments at the end of a line and -// preserves the comment style. This is useful or writing comments attached to -// things like ';' and other tokens that conclude a type definition on a single -// line. -// -// If there is a newline between this trailing comment and the previous node, the -// comments are written immediately underneath the node on a newline. -// -// For example, -// -// enum Type { -// TYPE_UNSPECIFIED = 0; -// } -// // This comment is attached to the '}' -// // So is this one. -func (f *formatter) writeTrailingEndComments(comments ast.Comments) { - for i := 0; i < comments.Len(); i++ { - comment := comments.Index(i) - if i > 0 || comment.LeadingWhitespace() != "" { - f.Space() - } - f.writeComment(comment.RawText()) - } - f.P("") -} - -func (f *formatter) writeComment(comment string) { - if strings.HasPrefix(comment, "/*") && newlineCount(comment) > 0 { - lines := strings.Split(comment, "\n") - // find minimum indent, so we can make all other lines relative to that - minIndent := -1 // sentinel that means unset - // start at 1 because line at index zero starts with "/*", not whitespace - var prefix string - for i := 1; i < len(lines); i++ { - indent, ok := computeIndent(lines[i]) - if ok && (minIndent == -1 || indent < minIndent) { - minIndent = indent - } - if i > 1 && len(prefix) == 0 { - // no shared prefix - continue - } - line := strings.TrimSpace(lines[i]) - if line == "*/" { - continue - } - var linePrefix string - if len(line) > 0 && isCommentPrefix(line[0]) { - linePrefix = line[:1] - } - if i == 1 { - prefix = linePrefix - } else if linePrefix != prefix { - // they do not share prefix - prefix = "" - } - } - if minIndent < 0 { - // This shouldn't be necessary. - // But we do it just in case, to avoid possible panic - minIndent = 0 - } - for i, line := range lines { - trimmedLine := strings.TrimSpace(line) - if trimmedLine == "" || trimmedLine == "*/" || len(prefix) > 0 { - line = trimmedLine - } else { - // we only trim space from the right; for the left, - // we unindent based on indentation found above. - line = unindent(line, minIndent) - line = strings.TrimRightFunc(line, unicode.IsSpace) - } - // If we have a block comment with no prefix, we'll format - // like so: - - /* - This is a multi-line comment example. - It has no comment prefix on each line. - */ - - // But if there IS a prefix, "|" for example, we'll left-align - // the prefix symbol under the asterisk of the comment start - // like this: - - /* - | This comment has a prefix before each line. - | Usually the prefix is asterisk, but it's a - | pipe in this example. - */ - - // Finally, if the comment prefix is an asterisk, we'll left-align - // the comment end so its asterisk also aligns, like so: - - /* - * This comment has a prefix before each line. - * Usually the prefix is asterisk, which is the - * case in this example. - */ - - if i > 0 && line != "*/" { - if len(prefix) == 0 { - line = " " + line - } else { - line = " " + line - } - } - if line == "*/" && prefix == "*" { - // align the comment end with the other asterisks - line = " " + line - } - - if i != len(lines)-1 { - f.P(line) - } else { - // for last line, we don't use P because we don't - // want to print a trailing newline - f.Indent(nil) - f.WriteString(line) - } - } - } else { - f.Indent(nil) - f.WriteString(strings.TrimSpace(comment)) - } -} - -func isCommentPrefix(ch byte) bool { - r := rune(ch) - // A multi-line comment prefix is *usually* an asterisk, like in the following - /* - * Foo - * Bar - * Baz - */ - // But we'll allow other prefixes. But if it's a letter or number, it's not a prefix. - return !unicode.IsLetter(r) && !unicode.IsNumber(r) -} - -func unindent(s string, unindent int) string { - pos := 0 - for i, r := range s { - if pos == unindent { - return s[i:] - } - if pos > unindent { - // removing tab-stop unindented too far, so we - // add back some spaces to compensate - return strings.Repeat(" ", pos-unindent) + s[i:] - } - - switch r { - case ' ': - pos++ - case '\t': - // jump to next tab stop - pos += 8 - (pos % 8) - default: - return s[i:] - } - } - // nothing but whitespace... - return "" -} - -func computeIndent(s string) (int, bool) { - if strings.TrimSpace(s) == "*/" { - return 0, false - } - indent := 0 - for _, r := range s { - switch r { - case ' ': - indent++ - case '\t': - // jump to next tab stop - indent += 8 - (indent % 8) - default: - return indent, true - } - } - // if we get here, line is nothing but whitespace - return 0, false -} - -func (f *formatter) leadingCommentsContainBlankLine(n ast.Node) bool { - info := f.fileNode.NodeInfo(n) - comments := info.LeadingComments() - for i := 0; i < comments.Len(); i++ { - if newlineCount(comments.Index(i).LeadingWhitespace()) > 1 { - return true - } - } - return newlineCount(info.LeadingWhitespace()) > 1 -} - -func (f *formatter) importHasComment(importNode *ast.ImportNode) bool { - if f.nodeHasComment(importNode) { - return true - } - if importNode == nil { - return false - } - - return f.nodeHasComment(importNode.Keyword) || - f.nodeHasComment(importNode.Name) || - f.nodeHasComment(importNode.Semicolon) || - f.nodeHasComment(importNode.Public) || - f.nodeHasComment(importNode.Weak) -} - -func (f *formatter) nodeHasComment(node ast.Node) bool { - // when node != nil, node's value could be nil, see: https://go.dev/doc/faq#nil_error - if node == nil || reflect.ValueOf(node).IsNil() { - return false - } - - nodeinfo := f.fileNode.NodeInfo(node) - return nodeinfo.LeadingComments().Len() > 0 || - nodeinfo.TrailingComments().Len() > 0 -} - -// importSortOrder maps import types to a sort order number, so it can be compared and sorted. -// `import`=3, `import public`=2, `import weak`=1 -func importSortOrder(node *ast.ImportNode) int { - switch { - case node.Public != nil: - return 2 - case node.Weak != nil: - return 1 - default: - return 3 - } -} - -// stringForOptionName returns the string representation of the given option name node. -// This is used for sorting file-level options. -func stringForOptionName(optionNameNode *ast.OptionNameNode) string { - var result string - for j, part := range optionNameNode.Parts { - if j > 0 { - // Add a dot between each of the parts. - result += "." - } - result += stringForFieldReference(part) - } - return result -} - -// stringForFieldReference returns the string representation of the given field reference. -// This is used for sorting file-level options. -func stringForFieldReference(fieldReference *ast.FieldReferenceNode) string { - var result string - if fieldReference.Open != nil { - result += "(" - } - result += string(fieldReference.Name.AsIdentifier()) - if fieldReference.Close != nil { - result += ")" - } - return result -} - -// isOpenBrace returns true if the given node represents one of the -// possible open brace tokens, namely '{', '[', or '<'. -func isOpenBrace(node ast.Node) bool { - if node == nil { - return false - } - runeNode, ok := node.(*ast.RuneNode) - if !ok { - return false - } - return runeNode.Rune == '{' || runeNode.Rune == '[' || runeNode.Rune == '<' -} - -// newlineCount returns the number of newlines in the given value. -// This is useful for determining whether or not we should preserve -// the newline between nodes. -// -// The newlines don't need to be adjacent to each other - all of the -// tokens between them are other whitespace characters, so we can -// safely ignore them. -func newlineCount(value string) int { - return strings.Count(value, "\n") -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufformat/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufformat/usage.gen.go deleted file mode 100644 index dd6a5e2916..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufformat/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufformat - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/bufgen.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/bufgen.go deleted file mode 100644 index c17157a900..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/bufgen.go +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufgen does configuration-based generation. -// -// It is used by the buf generate command. -package bufgen - -import ( - "context" - "encoding/json" - "fmt" - "strconv" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/bufpkg/bufremoteplugin" - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // ExternalConfigFilePath is the default external configuration file path. - ExternalConfigFilePath = "buf.gen.yaml" - // V1Version is the string used to identify the v1 version of the generate template. - V1Version = "v1" - // V1Beta1Version is the string used to identify the v1beta1 version of the generate template. - V1Beta1Version = "v1beta1" -) - -const ( - // StrategyDirectory is the strategy that says to generate per directory. - // - // This is the default value. - StrategyDirectory Strategy = 1 - // StrategyAll is the strategy that says to generate with all files at once. - StrategyAll Strategy = 2 -) - -// Strategy is a generation stategy. -type Strategy int - -// ParseStrategy parses the Strategy. -// -// If the empty string is provided, this is interpreted as StrategyDirectory. -func ParseStrategy(s string) (Strategy, error) { - switch s { - case "", "directory": - return StrategyDirectory, nil - case "all": - return StrategyAll, nil - default: - return 0, fmt.Errorf("unknown strategy: %s", s) - } -} - -// String implements fmt.Stringer. -func (s Strategy) String() string { - switch s { - case StrategyDirectory: - return "directory" - case StrategyAll: - return "all" - default: - return strconv.Itoa(int(s)) - } -} - -// Provider is a provider. -type Provider interface { - // GetConfig gets the Config for the YAML data at ExternalConfigFilePath. - // - // If the data is of length 0, returns the default config. - GetConfig(ctx context.Context, readBucket storage.ReadBucket) (*Config, error) -} - -// NewProvider returns a new Provider. -func NewProvider(logger *zap.Logger) Provider { - return newProvider(logger) -} - -// Generator generates Protobuf stubs based on configurations. -type Generator interface { - // Generate calls the generation logic. - // - // The config is assumed to be valid. If created by ReadConfig, it will - // always be valid. - Generate( - ctx context.Context, - container app.EnvStdioContainer, - config *Config, - image bufimage.Image, - options ...GenerateOption, - ) error -} - -// NewGenerator returns a new Generator. -func NewGenerator( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, - clientConfig *connectclient.Config, -) Generator { - return newGenerator( - logger, - storageosProvider, - runner, - wasmPluginExecutor, - clientConfig, - ) -} - -// GenerateOption is an option for Generate. -type GenerateOption func(*generateOptions) - -// GenerateWithBaseOutDirPath returns a new GenerateOption that uses the given -// base directory as the output directory. -// -// The default is to use the current directory. -func GenerateWithBaseOutDirPath(baseOutDirPath string) GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.baseOutDirPath = baseOutDirPath - } -} - -// GenerateWithIncludeImports says to also generate imports. -// -// Note that this does NOT result in the Well-Known Types being generated, use -// GenerateWithIncludeWellKnownTypes to include the Well-Known Types. -func GenerateWithIncludeImports() GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.includeImports = true - } -} - -// GenerateWithIncludeWellKnownTypes says to also generate well known types. -// -// This option has no effect if GenerateWithIncludeImports is not set. -func GenerateWithIncludeWellKnownTypes() GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.includeWellKnownTypes = true - } -} - -// GenerateWithWASMEnabled says to enable WASM support. -func GenerateWithWASMEnabled() GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.wasmEnabled = true - } -} - -// Config is a configuration. -type Config struct { - // Required - PluginConfigs []*PluginConfig - // Optional - ManagedConfig *ManagedConfig - // Optional - TypesConfig *TypesConfig -} - -// PluginConfig is a plugin configuration. -type PluginConfig struct { - // One of Plugin, Name or Remote is required - Plugin string - Name string - Remote string - // Optional, used with Plugin to pin a specific revision - Revision int - // Required - Out string - // Optional - Opt string - // Optional, exclusive with Remote - Path []string - // Required - Strategy Strategy - // Optional - ProtocPath string -} - -// PluginName returns this PluginConfig's plugin name. -// Only one of Plugin, Name or Remote will be set. -func (p *PluginConfig) PluginName() string { - if p == nil { - return "" - } - if p.Plugin != "" { - return p.Plugin - } - if p.Name != "" { - return p.Name - } - if p.Remote != "" { - return p.Remote - } - return "" -} - -// IsRemote returns true if the PluginConfig uses a remotely executed plugin. -func (p *PluginConfig) IsRemote() bool { - return p.GetRemoteHostname() != "" -} - -// GetRemoteHostname returns the hostname of the remote plugin. -func (p *PluginConfig) GetRemoteHostname() string { - if p == nil { - return "" - } - if identity, err := bufpluginref.PluginIdentityForString(p.Plugin); err == nil { - return identity.Remote() - } - if reference, err := bufpluginref.PluginReferenceForString(p.Plugin, 0); err == nil { - return reference.Remote() - } - if p.Remote == "" { - return "" - } - if remote, _, _, _, err := bufremoteplugin.ParsePluginVersionPath(p.Remote); err == nil { - return remote - } - return "" -} - -// ManagedConfig is the managed mode configuration. -type ManagedConfig struct { - CcEnableArenas *bool - JavaMultipleFiles *bool - JavaStringCheckUtf8 *bool - JavaPackagePrefixConfig *JavaPackagePrefixConfig - CsharpNameSpaceConfig *CsharpNameSpaceConfig - OptimizeForConfig *OptimizeForConfig - GoPackagePrefixConfig *GoPackagePrefixConfig - ObjcClassPrefixConfig *ObjcClassPrefixConfig - RubyPackageConfig *RubyPackageConfig - Override map[string]map[string]string -} - -// JavaPackagePrefixConfig is the java_package prefix configuration. -type JavaPackagePrefixConfig struct { - Default string - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> java_package prefix. - Override map[bufmoduleref.ModuleIdentity]string -} - -type OptimizeForConfig struct { - Default descriptorpb.FileOptions_OptimizeMode - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> optimize_for. - Override map[bufmoduleref.ModuleIdentity]descriptorpb.FileOptions_OptimizeMode -} - -// GoPackagePrefixConfig is the go_package prefix configuration. -type GoPackagePrefixConfig struct { - Default string - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> go_package prefix. - Override map[bufmoduleref.ModuleIdentity]string -} - -// ObjcClassPrefixConfig is the objc_class_prefix configuration. -type ObjcClassPrefixConfig struct { - Default string - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> objc_class_prefix. - Override map[bufmoduleref.ModuleIdentity]string -} - -// RubyPackgeConfig is the ruby_package configuration. -type RubyPackageConfig struct { - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> ruby_package. - Override map[bufmoduleref.ModuleIdentity]string -} - -// CsharpNameSpaceConfig is the csharp_namespace configuration. -type CsharpNameSpaceConfig struct { - Except []bufmoduleref.ModuleIdentity - // bufmoduleref.ModuleIdentity -> csharp_namespace prefix. - Override map[bufmoduleref.ModuleIdentity]string -} - -// TypesConfig is a types configuration -type TypesConfig struct { - Include []string -} - -// ReadConfig reads the configuration from the OS or an override, if any. -// -// Only use in CLI tools. -func ReadConfig( - ctx context.Context, - logger *zap.Logger, - provider Provider, - readBucket storage.ReadBucket, - options ...ReadConfigOption, -) (*Config, error) { - return readConfig( - ctx, - logger, - provider, - readBucket, - options..., - ) -} - -// ReadConfigOption is an option for ReadConfig. -type ReadConfigOption func(*readConfigOptions) - -// ReadConfigWithOverride sets the override. -// -// If override is set, this will first check if the override ends in .json or .yaml, if so, -// this reads the file at this path and uses it. Otherwise, this assumes this is configuration -// data in either JSON or YAML format, and unmarshals it. -// -// If no override is set, this reads ExternalConfigFilePath in the bucket. -func ReadConfigWithOverride(override string) ReadConfigOption { - return func(readConfigOptions *readConfigOptions) { - readConfigOptions.override = override - } -} - -// ConfigExists checks if a generation configuration file exists. -func ConfigExists(ctx context.Context, readBucket storage.ReadBucket) (bool, error) { - return storage.Exists(ctx, readBucket, ExternalConfigFilePath) -} - -// ExternalConfigV1 is an external configuration. -type ExternalConfigV1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Plugins []ExternalPluginConfigV1 `json:"plugins,omitempty" yaml:"plugins,omitempty"` - Managed ExternalManagedConfigV1 `json:"managed,omitempty" yaml:"managed,omitempty"` - Types ExternalTypesConfigV1 `json:"types,omitempty" yaml:"types,omitempty"` -} - -// ExternalPluginConfigV1 is an external plugin configuration. -type ExternalPluginConfigV1 struct { - Plugin string `json:"plugin,omitempty" yaml:"plugin,omitempty"` - Revision int `json:"revision,omitempty" yaml:"revision,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` - Out string `json:"out,omitempty" yaml:"out,omitempty"` - Opt interface{} `json:"opt,omitempty" yaml:"opt,omitempty"` - Path interface{} `json:"path,omitempty" yaml:"path,omitempty"` - ProtocPath string `json:"protoc_path,omitempty" yaml:"protoc_path,omitempty"` - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` -} - -// ExternalManagedConfigV1 is an external managed mode configuration. -// -// Only use outside of this package for testing. -type ExternalManagedConfigV1 struct { - Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` - CcEnableArenas *bool `json:"cc_enable_arenas,omitempty" yaml:"cc_enable_arenas,omitempty"` - JavaMultipleFiles *bool `json:"java_multiple_files,omitempty" yaml:"java_multiple_files,omitempty"` - JavaStringCheckUtf8 *bool `json:"java_string_check_utf8,omitempty" yaml:"java_string_check_utf8,omitempty"` - JavaPackagePrefix ExternalJavaPackagePrefixConfigV1 `json:"java_package_prefix,omitempty" yaml:"java_package_prefix,omitempty"` - CsharpNamespace ExternalCsharpNamespaceConfigV1 `json:"csharp_namespace,omitempty" yaml:"csharp_namespace,omitempty"` - OptimizeFor ExternalOptimizeForConfigV1 `json:"optimize_for,omitempty" yaml:"optimize_for,omitempty"` - GoPackagePrefix ExternalGoPackagePrefixConfigV1 `json:"go_package_prefix,omitempty" yaml:"go_package_prefix,omitempty"` - ObjcClassPrefix ExternalObjcClassPrefixConfigV1 `json:"objc_class_prefix,omitempty" yaml:"objc_class_prefix,omitempty"` - RubyPackage ExternalRubyPackageConfigV1 `json:"ruby_package,omitempty" yaml:"ruby_package,omitempty"` - Override map[string]map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true if the config is empty, excluding the 'Enabled' setting. -func (e ExternalManagedConfigV1) IsEmpty() bool { - return e.CcEnableArenas == nil && - e.JavaMultipleFiles == nil && - e.JavaStringCheckUtf8 == nil && - e.JavaPackagePrefix.IsEmpty() && - e.CsharpNamespace.IsEmpty() && - e.CsharpNamespace.IsEmpty() && - e.OptimizeFor.IsEmpty() && - e.GoPackagePrefix.IsEmpty() && - e.ObjcClassPrefix.IsEmpty() && - e.RubyPackage.IsEmpty() && - len(e.Override) == 0 -} - -// ExternalJavaPackagePrefixConfigV1 is the external java_package prefix configuration. -type ExternalJavaPackagePrefixConfigV1 struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true if the config is empty. -func (e ExternalJavaPackagePrefixConfigV1) IsEmpty() bool { - return e.Default == "" && - len(e.Except) == 0 && - len(e.Override) == 0 -} - -// UnmarshalYAML satisfies the yaml.Unmarshaler interface. This is done to maintain backward compatibility -// of accepting a plain string value for java_package_prefix. -func (e *ExternalJavaPackagePrefixConfigV1) UnmarshalYAML(unmarshal func(interface{}) error) error { - return e.unmarshalWith(unmarshal) -} - -// UnmarshalJSON satisfies the json.Unmarshaler interface. This is done to maintain backward compatibility -// of accepting a plain string value for java_package_prefix. -func (e *ExternalJavaPackagePrefixConfigV1) UnmarshalJSON(data []byte) error { - unmarshal := func(v interface{}) error { - return json.Unmarshal(data, v) - } - - return e.unmarshalWith(unmarshal) -} - -// unmarshalWith is used to unmarshal into json/yaml. See https://abhinavg.net/posts/flexible-yaml for details. -func (e *ExternalJavaPackagePrefixConfigV1) unmarshalWith(unmarshal func(interface{}) error) error { - var prefix string - if err := unmarshal(&prefix); err == nil { - e.Default = prefix - return nil - } - - type rawExternalJavaPackagePrefixConfigV1 ExternalJavaPackagePrefixConfigV1 - if err := unmarshal((*rawExternalJavaPackagePrefixConfigV1)(e)); err != nil { - return err - } - - return nil -} - -// ExternalOptimizeForConfigV1 is the external optimize_for configuration. -type ExternalOptimizeForConfigV1 struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true if the config is empty -func (e ExternalOptimizeForConfigV1) IsEmpty() bool { - return e.Default == "" && - len(e.Except) == 0 && - len(e.Override) == 0 -} - -// UnmarshalYAML satisfies the yaml.Unmarshaler interface. This is done to maintain backward compatibility -// of accepting a plain string value for optimize_for. -func (e *ExternalOptimizeForConfigV1) UnmarshalYAML(unmarshal func(interface{}) error) error { - return e.unmarshalWith(unmarshal) -} - -// UnmarshalJSON satisfies the json.Unmarshaler interface. This is done to maintain backward compatibility -// of accepting a plain string value for optimize_for. -func (e *ExternalOptimizeForConfigV1) UnmarshalJSON(data []byte) error { - unmarshal := func(v interface{}) error { - return json.Unmarshal(data, v) - } - - return e.unmarshalWith(unmarshal) -} - -// unmarshalWith is used to unmarshal into json/yaml. See https://abhinavg.net/posts/flexible-yaml for details. -func (e *ExternalOptimizeForConfigV1) unmarshalWith(unmarshal func(interface{}) error) error { - var optimizeFor string - if err := unmarshal(&optimizeFor); err == nil { - e.Default = optimizeFor - return nil - } - - type rawExternalOptimizeForConfigV1 ExternalOptimizeForConfigV1 - if err := unmarshal((*rawExternalOptimizeForConfigV1)(e)); err != nil { - return err - } - - return nil -} - -// ExternalGoPackagePrefixConfigV1 is the external go_package prefix configuration. -type ExternalGoPackagePrefixConfigV1 struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true if the config is empty. -func (e ExternalGoPackagePrefixConfigV1) IsEmpty() bool { - return e.Default == "" && - len(e.Except) == 0 && - len(e.Override) == 0 -} - -// ExternalCsharpNamespaceConfigV1 is the external csharp_namespace configuration. -type ExternalCsharpNamespaceConfigV1 struct { - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true if the config is empty. -func (e ExternalCsharpNamespaceConfigV1) IsEmpty() bool { - return len(e.Except) == 0 && - len(e.Override) == 0 -} - -// ExternalRubyPackageConfigV1 is the external ruby_package configuration -type ExternalRubyPackageConfigV1 struct { - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -// IsEmpty returns true is the config is empty -func (e ExternalRubyPackageConfigV1) IsEmpty() bool { - return len(e.Except) == 0 && len(e.Override) == 0 -} - -// ExternalObjcClassPrefixConfigV1 is the external objc_class_prefix configuration. -type ExternalObjcClassPrefixConfigV1 struct { - Default string `json:"default,omitempty" yaml:"default,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - Override map[string]string `json:"override,omitempty" yaml:"override,omitempty"` -} - -func (e ExternalObjcClassPrefixConfigV1) IsEmpty() bool { - return e.Default == "" && - len(e.Except) == 0 && - len(e.Override) == 0 -} - -// ExternalConfigV1Beta1 is an external configuration. -type ExternalConfigV1Beta1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Managed bool `json:"managed,omitempty" yaml:"managed,omitempty"` - Plugins []ExternalPluginConfigV1Beta1 `json:"plugins,omitempty" yaml:"plugins,omitempty"` - Options ExternalOptionsConfigV1Beta1 `json:"options,omitempty" yaml:"options,omitempty"` -} - -// ExternalPluginConfigV1Beta1 is an external plugin configuration. -type ExternalPluginConfigV1Beta1 struct { - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Out string `json:"out,omitempty" yaml:"out,omitempty"` - Opt interface{} `json:"opt,omitempty" yaml:"opt,omitempty"` - Path string `json:"path,omitempty" yaml:"path,omitempty"` - Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"` -} - -// ExternalOptionsConfigV1Beta1 is an external options configuration. -type ExternalOptionsConfigV1Beta1 struct { - CcEnableArenas *bool `json:"cc_enable_arenas,omitempty" yaml:"cc_enable_arenas,omitempty"` - JavaMultipleFiles *bool `json:"java_multiple_files,omitempty" yaml:"java_multiple_files,omitempty"` - OptimizeFor string `json:"optimize_for,omitempty" yaml:"optimize_for,omitempty"` -} - -// ExternalConfigVersion defines the subset of all config -// file versions that is used to determine the configuration version. -type ExternalConfigVersion struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -// ExternalTypesConfigV1 is an external types configuration. -type ExternalTypesConfigV1 struct { - Include []string `json:"include,omitempty" yaml:"include"` -} - -// IsEmpty returns true if e is empty. -func (e ExternalTypesConfigV1) IsEmpty() bool { - return len(e.Include) == 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/config.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/config.go deleted file mode 100644 index fda43b05f3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/config.go +++ /dev/null @@ -1,666 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgen - -import ( - "context" - "errors" - "fmt" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/bufpkg/bufremoteplugin" - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/zap" - "google.golang.org/protobuf/types/descriptorpb" -) - -func readConfig( - ctx context.Context, - logger *zap.Logger, - provider Provider, - readBucket storage.ReadBucket, - options ...ReadConfigOption, -) (*Config, error) { - readConfigOptions := newReadConfigOptions() - for _, option := range options { - option(readConfigOptions) - } - if override := readConfigOptions.override; override != "" { - switch filepath.Ext(override) { - case ".json": - return getConfigJSONFile(logger, override) - case ".yaml", ".yml": - return getConfigYAMLFile(logger, override) - default: - return getConfigJSONOrYAMLData(logger, override) - } - } - return provider.GetConfig(ctx, readBucket) -} - -func getConfigJSONFile(logger *zap.Logger, file string) (*Config, error) { - data, err := os.ReadFile(file) - if err != nil { - return nil, fmt.Errorf("could not read file %s: %v", file, err) - } - return getConfig( - logger, - encoding.UnmarshalJSONNonStrict, - encoding.UnmarshalJSONStrict, - data, - file, - ) -} - -func getConfigYAMLFile(logger *zap.Logger, file string) (*Config, error) { - data, err := os.ReadFile(file) - if err != nil { - return nil, fmt.Errorf("could not read file %s: %v", file, err) - } - return getConfig( - logger, - encoding.UnmarshalYAMLNonStrict, - encoding.UnmarshalYAMLStrict, - data, - file, - ) -} - -func getConfigJSONOrYAMLData(logger *zap.Logger, data string) (*Config, error) { - return getConfig( - logger, - encoding.UnmarshalJSONOrYAMLNonStrict, - encoding.UnmarshalJSONOrYAMLStrict, - []byte(data), - "Generate configuration data", - ) -} - -func getConfig( - logger *zap.Logger, - unmarshalNonStrict func([]byte, interface{}) error, - unmarshalStrict func([]byte, interface{}) error, - data []byte, - id string, -) (*Config, error) { - var externalConfigVersion ExternalConfigVersion - if err := unmarshalNonStrict(data, &externalConfigVersion); err != nil { - return nil, err - } - switch externalConfigVersion.Version { - case V1Beta1Version: - var externalConfigV1Beta1 ExternalConfigV1Beta1 - if err := unmarshalStrict(data, &externalConfigV1Beta1); err != nil { - return nil, err - } - if err := validateExternalConfigV1Beta1(externalConfigV1Beta1, id); err != nil { - return nil, err - } - return newConfigV1Beta1(externalConfigV1Beta1, id) - case V1Version: - var externalConfigV1 ExternalConfigV1 - if err := unmarshalStrict(data, &externalConfigV1); err != nil { - return nil, err - } - if err := validateExternalConfigV1(externalConfigV1, id); err != nil { - return nil, err - } - return newConfigV1(logger, externalConfigV1, id) - default: - return nil, fmt.Errorf(`%s has no version set. Please add "version: %s"`, id, V1Version) - } -} - -func newConfigV1(logger *zap.Logger, externalConfig ExternalConfigV1, id string) (*Config, error) { - managedConfig, err := newManagedConfigV1(logger, externalConfig.Managed) - if err != nil { - return nil, err - } - pluginConfigs := make([]*PluginConfig, 0, len(externalConfig.Plugins)) - for _, plugin := range externalConfig.Plugins { - strategy, err := ParseStrategy(plugin.Strategy) - if err != nil { - return nil, err - } - opt, err := encoding.InterfaceSliceOrStringToCommaSepString(plugin.Opt) - if err != nil { - return nil, err - } - path, err := encoding.InterfaceSliceOrStringToStringSlice(plugin.Path) - if err != nil { - return nil, err - } - pluginConfig := &PluginConfig{ - Plugin: plugin.Plugin, - Revision: plugin.Revision, - Name: plugin.Name, - Remote: plugin.Remote, - Out: plugin.Out, - Opt: opt, - Path: path, - ProtocPath: plugin.ProtocPath, - Strategy: strategy, - } - if pluginConfig.IsRemote() { - // Always use StrategyAll for remote plugins - pluginConfig.Strategy = StrategyAll - } - pluginConfigs = append(pluginConfigs, pluginConfig) - } - typesConfig := newTypesConfigV1(externalConfig.Types) - return &Config{ - PluginConfigs: pluginConfigs, - ManagedConfig: managedConfig, - TypesConfig: typesConfig, - }, nil -} - -func validateExternalConfigV1(externalConfig ExternalConfigV1, id string) error { - if len(externalConfig.Plugins) == 0 { - return fmt.Errorf("%s: no plugins set", id) - } - for _, plugin := range externalConfig.Plugins { - var numPluginIdentifiers int - var pluginIdentifier string - for _, possibleIdentifier := range []string{plugin.Plugin, plugin.Name, plugin.Remote} { - if possibleIdentifier != "" { - numPluginIdentifiers++ - // Doesn't matter if we reassign here - we only allow one to be set below - pluginIdentifier = possibleIdentifier - } - } - if numPluginIdentifiers == 0 { - return fmt.Errorf("%s: one of plugin, name or remote is required", id) - } - if numPluginIdentifiers > 1 { - return fmt.Errorf("%s: only one of plugin, name, or remote can be set", id) - } - if plugin.Out == "" { - return fmt.Errorf("%s: plugin %s out is required", id, pluginIdentifier) - } - switch { - case plugin.Plugin != "": - if bufpluginref.IsPluginReferenceOrIdentity(pluginIdentifier) { - // plugin.Plugin is a remote plugin - if err := checkPathAndStrategyUnset(id, plugin, pluginIdentifier); err != nil { - return err - } - } else { - // plugin.Plugin is a local plugin - verify it isn't using an alpha remote plugin path - if _, _, _, _, err := bufremoteplugin.ParsePluginVersionPath(pluginIdentifier); err == nil { - return fmt.Errorf("%s: invalid local plugin", id) - } - } - case plugin.Remote != "": - if _, _, _, _, err := bufremoteplugin.ParsePluginVersionPath(pluginIdentifier); err != nil { - return fmt.Errorf("%s: invalid remote plugin name: %w", id, err) - } - if err := checkPathAndStrategyUnset(id, plugin, pluginIdentifier); err != nil { - return err - } - case plugin.Name != "": - // Check that the plugin name doesn't look like a plugin reference - if bufpluginref.IsPluginReferenceOrIdentity(pluginIdentifier) { - return fmt.Errorf("%s: invalid local plugin name: %s", id, pluginIdentifier) - } - // Check that the plugin name doesn't look like an alpha remote plugin - if _, _, _, _, err := bufremoteplugin.ParsePluginVersionPath(pluginIdentifier); err == nil { - return fmt.Errorf("%s: invalid plugin name %s, did you mean to use a remote plugin?", id, pluginIdentifier) - } - default: - // unreachable - validated above - return errors.New("one of plugin, name, or remote is required") - } - } - return nil -} - -func checkPathAndStrategyUnset(id string, plugin ExternalPluginConfigV1, pluginIdentifier string) error { - if plugin.Path != nil { - return fmt.Errorf("%s: remote plugin %s cannot specify a path", id, pluginIdentifier) - } - if plugin.Strategy != "" { - return fmt.Errorf("%s: remote plugin %s cannot specify a strategy", id, pluginIdentifier) - } - if plugin.ProtocPath != "" { - return fmt.Errorf("%s: remote plugin %s cannot specify a protoc path", id, pluginIdentifier) - } - return nil -} - -func newManagedConfigV1(logger *zap.Logger, externalManagedConfig ExternalManagedConfigV1) (*ManagedConfig, error) { - if !externalManagedConfig.Enabled { - if !externalManagedConfig.IsEmpty() && logger != nil { - logger.Sugar().Warn("managed mode options are set but are not enabled") - } - return nil, nil - } - javaPackagePrefixConfig, err := newJavaPackagePrefixConfigV1(externalManagedConfig.JavaPackagePrefix) - if err != nil { - return nil, err - } - csharpNamespaceConfig, err := newCsharpNamespaceConfigV1(externalManagedConfig.CsharpNamespace) - if err != nil { - return nil, err - } - optimizeForConfig, err := newOptimizeForConfigV1(externalManagedConfig.OptimizeFor) - if err != nil { - return nil, err - } - goPackagePrefixConfig, err := newGoPackagePrefixConfigV1(externalManagedConfig.GoPackagePrefix) - if err != nil { - return nil, err - } - objcClassPrefixConfig, err := newObjcClassPrefixConfigV1(externalManagedConfig.ObjcClassPrefix) - if err != nil { - return nil, err - } - rubyPackageConfig, err := newRubyPackageConfigV1(externalManagedConfig.RubyPackage) - if err != nil { - return nil, err - } - override := externalManagedConfig.Override - for overrideID, overrideValue := range override { - for importPath := range overrideValue { - normalizedImportPath, err := normalpath.NormalizeAndValidate(importPath) - if err != nil { - return nil, fmt.Errorf( - "failed to normalize import path: %s provided for override: %s", - importPath, - overrideID, - ) - } - if importPath != normalizedImportPath { - return nil, fmt.Errorf( - "override can only take normalized import paths, invalid import path: %s provided for override: %s", - importPath, - overrideID, - ) - } - } - } - return &ManagedConfig{ - CcEnableArenas: externalManagedConfig.CcEnableArenas, - JavaMultipleFiles: externalManagedConfig.JavaMultipleFiles, - JavaStringCheckUtf8: externalManagedConfig.JavaStringCheckUtf8, - JavaPackagePrefixConfig: javaPackagePrefixConfig, - CsharpNameSpaceConfig: csharpNamespaceConfig, - OptimizeForConfig: optimizeForConfig, - GoPackagePrefixConfig: goPackagePrefixConfig, - ObjcClassPrefixConfig: objcClassPrefixConfig, - RubyPackageConfig: rubyPackageConfig, - Override: override, - }, nil -} - -func newJavaPackagePrefixConfigV1(externalJavaPackagePrefixConfig ExternalJavaPackagePrefixConfigV1) (*JavaPackagePrefixConfig, error) { - if externalJavaPackagePrefixConfig.IsEmpty() { - return nil, nil - } - if externalJavaPackagePrefixConfig.Default == "" { - return nil, errors.New("java_package_prefix setting requires a default value") - } - seenModuleIdentities := make(map[string]struct{}, len(externalJavaPackagePrefixConfig.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalJavaPackagePrefixConfig.Except)) - for _, moduleName := range externalJavaPackagePrefixConfig.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid java_package_prefix except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid java_package_prefix except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]string, len(externalJavaPackagePrefixConfig.Override)) - for moduleName, javaPackagePrefix := range externalJavaPackagePrefixConfig.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid java_package_prefix override key: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid java_package_prefix override: %q is already defined as an except", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = javaPackagePrefix - } - return &JavaPackagePrefixConfig{ - Default: externalJavaPackagePrefixConfig.Default, - Except: except, - Override: override, - }, nil -} - -func newOptimizeForConfigV1(externalOptimizeForConfigV1 ExternalOptimizeForConfigV1) (*OptimizeForConfig, error) { - if externalOptimizeForConfigV1.IsEmpty() { - return nil, nil - } - if externalOptimizeForConfigV1.Default == "" { - return nil, errors.New("optimize_for setting requires a default value") - } - value, ok := descriptorpb.FileOptions_OptimizeMode_value[externalOptimizeForConfigV1.Default] - if !ok { - return nil, fmt.Errorf( - "invalid optimize_for default value; expected one of %v", - enumMapToStringSlice(descriptorpb.FileOptions_OptimizeMode_value), - ) - } - defaultOptimizeFor := descriptorpb.FileOptions_OptimizeMode(value) - seenModuleIdentities := make(map[string]struct{}, len(externalOptimizeForConfigV1.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalOptimizeForConfigV1.Except)) - for _, moduleName := range externalOptimizeForConfigV1.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid optimize_for except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid optimize_for except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]descriptorpb.FileOptions_OptimizeMode, len(externalOptimizeForConfigV1.Override)) - for moduleName, optimizeFor := range externalOptimizeForConfigV1.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid optimize_for override key: %w", err) - } - value, ok := descriptorpb.FileOptions_OptimizeMode_value[optimizeFor] - if !ok { - return nil, fmt.Errorf( - "invalid optimize_for override value; expected one of %v", - enumMapToStringSlice(descriptorpb.FileOptions_OptimizeMode_value), - ) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf( - "invalid optimize_for override: %q is already defined as an except", - moduleIdentity.IdentityString(), - ) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = descriptorpb.FileOptions_OptimizeMode(value) - } - return &OptimizeForConfig{ - Default: defaultOptimizeFor, - Except: except, - Override: override, - }, nil -} - -func newGoPackagePrefixConfigV1(externalGoPackagePrefixConfig ExternalGoPackagePrefixConfigV1) (*GoPackagePrefixConfig, error) { - if externalGoPackagePrefixConfig.IsEmpty() { - return nil, nil - } - if externalGoPackagePrefixConfig.Default == "" { - return nil, errors.New("go_package_prefix setting requires a default value") - } - defaultGoPackagePrefix, err := normalpath.NormalizeAndValidate(externalGoPackagePrefixConfig.Default) - if err != nil { - return nil, fmt.Errorf("invalid go_package_prefix default: %w", err) - } - seenModuleIdentities := make(map[string]struct{}, len(externalGoPackagePrefixConfig.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalGoPackagePrefixConfig.Except)) - for _, moduleName := range externalGoPackagePrefixConfig.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid go_package_prefix except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid go_package_prefix except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]string, len(externalGoPackagePrefixConfig.Override)) - for moduleName, goPackagePrefix := range externalGoPackagePrefixConfig.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid go_package_prefix override key: %w", err) - } - normalizedGoPackagePrefix, err := normalpath.NormalizeAndValidate(goPackagePrefix) - if err != nil { - return nil, fmt.Errorf("invalid go_package_prefix override value: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid go_package_prefix override: %q is already defined as an except", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = normalizedGoPackagePrefix - } - return &GoPackagePrefixConfig{ - Default: defaultGoPackagePrefix, - Except: except, - Override: override, - }, nil -} - -func newRubyPackageConfigV1( - externalRubyPackageConfig ExternalRubyPackageConfigV1, -) (*RubyPackageConfig, error) { - if externalRubyPackageConfig.IsEmpty() { - return nil, nil - } - seenModuleIdentities := make(map[string]struct{}, len(externalRubyPackageConfig.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalRubyPackageConfig.Except)) - for _, moduleName := range externalRubyPackageConfig.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid ruby_package except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid ruby_package except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]string, len(externalRubyPackageConfig.Override)) - for moduleName, rubyPackage := range externalRubyPackageConfig.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid ruby_package override key: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid ruby_package override: %q is already defined as an except", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = rubyPackage - } - return &RubyPackageConfig{ - Except: except, - Override: override, - }, nil -} - -func newCsharpNamespaceConfigV1( - externalCsharpNamespaceConfig ExternalCsharpNamespaceConfigV1, -) (*CsharpNameSpaceConfig, error) { - if externalCsharpNamespaceConfig.IsEmpty() { - return nil, nil - } - seenModuleIdentities := make(map[string]struct{}, len(externalCsharpNamespaceConfig.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalCsharpNamespaceConfig.Except)) - for _, moduleName := range externalCsharpNamespaceConfig.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid csharp_namespace except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid csharp_namespace except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]string, len(externalCsharpNamespaceConfig.Override)) - for moduleName, csharpNamespace := range externalCsharpNamespaceConfig.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid csharp_namespace override key: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid csharp_namespace override: %q is already defined as an except", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = csharpNamespace - } - return &CsharpNameSpaceConfig{ - Except: except, - Override: override, - }, nil -} - -func newObjcClassPrefixConfigV1(externalObjcClassPrefixConfig ExternalObjcClassPrefixConfigV1) (*ObjcClassPrefixConfig, error) { - if externalObjcClassPrefixConfig.IsEmpty() { - return nil, nil - } - // It's ok to have an empty default, which will have the same effect as previously enabling managed mode. - defaultObjcClassPrefix := externalObjcClassPrefixConfig.Default - seenModuleIdentities := make(map[string]struct{}, len(externalObjcClassPrefixConfig.Except)) - except := make([]bufmoduleref.ModuleIdentity, 0, len(externalObjcClassPrefixConfig.Except)) - for _, moduleName := range externalObjcClassPrefixConfig.Except { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid objc_class_prefix except: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid objc_class_prefix except: %q is defined multiple times", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - except = append(except, moduleIdentity) - } - override := make(map[bufmoduleref.ModuleIdentity]string, len(externalObjcClassPrefixConfig.Override)) - for moduleName, objcClassPrefix := range externalObjcClassPrefixConfig.Override { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(moduleName) - if err != nil { - return nil, fmt.Errorf("invalid objc_class_prefix override key: %w", err) - } - if _, ok := seenModuleIdentities[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf("invalid objc_class_prefix override: %q is already defined as an except", moduleIdentity.IdentityString()) - } - seenModuleIdentities[moduleIdentity.IdentityString()] = struct{}{} - override[moduleIdentity] = objcClassPrefix - } - return &ObjcClassPrefixConfig{ - Default: defaultObjcClassPrefix, - Except: except, - Override: override, - }, nil -} - -func newConfigV1Beta1(externalConfig ExternalConfigV1Beta1, id string) (*Config, error) { - managedConfig, err := newManagedConfigV1Beta1(externalConfig.Options, externalConfig.Managed) - if err != nil { - return nil, err - } - pluginConfigs := make([]*PluginConfig, 0, len(externalConfig.Plugins)) - for _, plugin := range externalConfig.Plugins { - strategy, err := ParseStrategy(plugin.Strategy) - if err != nil { - return nil, err - } - opt, err := encoding.InterfaceSliceOrStringToCommaSepString(plugin.Opt) - if err != nil { - return nil, err - } - pluginConfig := &PluginConfig{ - Name: plugin.Name, - Out: plugin.Out, - Opt: opt, - Strategy: strategy, - } - if plugin.Path != "" { - pluginConfig.Path = []string{plugin.Path} - } - pluginConfigs = append(pluginConfigs, pluginConfig) - } - return &Config{ - PluginConfigs: pluginConfigs, - ManagedConfig: managedConfig, - }, nil -} - -func validateExternalConfigV1Beta1(externalConfig ExternalConfigV1Beta1, id string) error { - if len(externalConfig.Plugins) == 0 { - return fmt.Errorf("%s: no plugins set", id) - } - for _, plugin := range externalConfig.Plugins { - if plugin.Name == "" { - return fmt.Errorf("%s: plugin name is required", id) - } - if plugin.Out == "" { - return fmt.Errorf("%s: plugin %s out is required", id, plugin.Name) - } - } - return nil -} - -func newManagedConfigV1Beta1(externalOptionsConfig ExternalOptionsConfigV1Beta1, enabled bool) (*ManagedConfig, error) { - if !enabled || externalOptionsConfig == (ExternalOptionsConfigV1Beta1{}) { - return nil, nil - } - var optimizeForConfig *OptimizeForConfig - if externalOptionsConfig.OptimizeFor != "" { - value, ok := descriptorpb.FileOptions_OptimizeMode_value[externalOptionsConfig.OptimizeFor] - if !ok { - return nil, fmt.Errorf( - "invalid optimize_for value; expected one of %v", - enumMapToStringSlice(descriptorpb.FileOptions_OptimizeMode_value), - ) - } - optimizeForConfig = &OptimizeForConfig{ - Default: descriptorpb.FileOptions_OptimizeMode(value), - Except: make([]bufmoduleref.ModuleIdentity, 0), - Override: make(map[bufmoduleref.ModuleIdentity]descriptorpb.FileOptions_OptimizeMode), - } - } - return &ManagedConfig{ - CcEnableArenas: externalOptionsConfig.CcEnableArenas, - JavaMultipleFiles: externalOptionsConfig.JavaMultipleFiles, - OptimizeForConfig: optimizeForConfig, - }, nil -} - -// enumMapToStringSlice is a convenience function for mapping Protobuf enums -// into a slice of strings. -func enumMapToStringSlice(enums map[string]int32) []string { - slice := make([]string, 0, len(enums)) - for enum := range enums { - slice = append(slice, enum) - } - return slice -} - -type readConfigOptions struct { - override string -} - -func newReadConfigOptions() *readConfigOptions { - return &readConfigOptions{} -} - -func newTypesConfigV1(externalConfig ExternalTypesConfigV1) *TypesConfig { - if externalConfig.IsEmpty() { - return nil - } - return &TypesConfig{ - Include: externalConfig.Include, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/features.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/features.go deleted file mode 100644 index f5eb559285..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/features.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgen - -import ( - "fmt" - "sort" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -// requiredFeatures maps a feature to the set of files in an image that -// make use of that feature. -type requiredFeatures map[pluginpb.CodeGeneratorResponse_Feature][]string - -type featureChecker func(options *descriptorpb.FileDescriptorProto) bool - -// Map of all known features to functions that can check whether a given file -// uses said feature. -var allFeatures = map[pluginpb.CodeGeneratorResponse_Feature]featureChecker{ - pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL: fileHasProto3Optional, -} - -// computeRequiredFeatures returns a map of required features to the files in -// the image that require that feature. After plugins are invoked, the plugins' -// responses are checked to make sure any required features were supported. -func computeRequiredFeatures(image bufimage.Image) requiredFeatures { - features := requiredFeatures{} - for feature, checker := range allFeatures { - for _, file := range image.Files() { - if file.IsImport() { - // we only want to check the sources in the module, not their dependencies - continue - } - if checker(file.Proto()) { - features[feature] = append(features[feature], file.Path()) - } - } - } - return features -} - -func checkRequiredFeatures( - container app.StderrContainer, - required requiredFeatures, - responses []*pluginpb.CodeGeneratorResponse, - configs []*PluginConfig, -) { - for responseIndex, response := range responses { - if response == nil || response.GetError() != "" { - // plugin failed, nothing to check - continue - } - failed := requiredFeatures{} - var failedFeatures []pluginpb.CodeGeneratorResponse_Feature - supported := response.GetSupportedFeatures() // bit mask of features the plugin supports - for feature, files := range required { - featureMask := (uint64)(feature) - if supported&featureMask != featureMask { - // doh! Supported features don't include this one - failed[feature] = files - failedFeatures = append(failedFeatures, feature) - } - } - if len(failed) > 0 { - // TODO: plugin config to turn this into an error - _, _ = fmt.Fprintf(container.Stderr(), "Warning: plugin %q does not support required features.\n", - configs[responseIndex].PluginName()) - sort.Slice(failedFeatures, func(i, j int) bool { - return failedFeatures[i].Number() < failedFeatures[j].Number() - }) - for _, feature := range failedFeatures { - files := failed[feature] - _, _ = fmt.Fprintf(container.Stderr(), " Feature %q is required by %d file(s):\n", - featureName(feature), len(files)) - _, _ = fmt.Fprintf(container.Stderr(), " %s\n", strings.Join(files, ",")) - } - } - } -} - -func featureName(feature pluginpb.CodeGeneratorResponse_Feature) string { - // FEATURE_PROTO3_OPTIONAL -> "proto3 optional" - return strings.TrimSpace( - strings.ToLower( - strings.ReplaceAll( - strings.TrimPrefix(feature.String(), "FEATURE"), - "_", " "))) -} - -func fileHasProto3Optional(fileDescriptorProto *descriptorpb.FileDescriptorProto) bool { - if fileDescriptorProto.GetSyntax() != "proto3" { - // can't have proto3 optional unless syntax is proto3 - return false - } - for _, msg := range fileDescriptorProto.MessageType { - if messageHasProto3Optional(msg) { - return true - } - } - return false -} - -func messageHasProto3Optional(descriptorProto *descriptorpb.DescriptorProto) bool { - for _, fld := range descriptorProto.Field { - if fld.GetProto3Optional() { - return true - } - } - for _, nested := range descriptorProto.NestedType { - if messageHasProto3Optional(nested) { - return true - } - } - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/generator.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/generator.go deleted file mode 100644 index 7d2d866427..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/generator.go +++ /dev/null @@ -1,734 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgen - -import ( - "context" - "errors" - "fmt" - "path/filepath" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/bufpkg/bufpluginexec" - "github.com/bufbuild/buf/private/bufpkg/bufremoteplugin" - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/thread" - connect "github.com/bufbuild/connect-go" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -type generator struct { - logger *zap.Logger - storageosProvider storageos.Provider - pluginexecGenerator bufpluginexec.Generator - clientConfig *connectclient.Config -} - -func newGenerator( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, - clientConfig *connectclient.Config, -) *generator { - return &generator{ - logger: logger, - storageosProvider: storageosProvider, - pluginexecGenerator: bufpluginexec.NewGenerator(logger, storageosProvider, runner, wasmPluginExecutor), - clientConfig: clientConfig, - } -} - -// Generate executes all of the plugins specified by the given Config, and -// consolidates the results in the same order that the plugins are listed. -// Order is particularly important for insertion points, which are used to -// modify the generated output from other plugins executed earlier in the chain. -// -// Note that insertion points will only have access to files that are written -// in the same protoc invocation; plugins will not be able to insert code into -// other files that already exist on disk (just like protoc). -// -// All of the plugins, both local and remote, are called concurrently. Each -// plugin returns a single CodeGeneratorResponse, which are cached in-memory in -// the appprotoos.ResponseWriter. Once all of the CodeGeneratorResponses -// are written in-memory, we flush them to the OS filesystem by closing the -// appprotoos.ResponseWriter. -// -// This behavior is equivalent to protoc, which only writes out the content -// for each of the plugins if all of the plugins are successful. -func (g *generator) Generate( - ctx context.Context, - container app.EnvStdioContainer, - config *Config, - image bufimage.Image, - options ...GenerateOption, -) error { - generateOptions := newGenerateOptions() - for _, option := range options { - option(generateOptions) - } - return g.generate( - ctx, - container, - config, - image, - generateOptions.baseOutDirPath, - generateOptions.includeImports, - generateOptions.includeWellKnownTypes, - generateOptions.wasmEnabled, - ) -} - -func (g *generator) generate( - ctx context.Context, - container app.EnvStdioContainer, - config *Config, - image bufimage.Image, - baseOutDirPath string, - includeImports bool, - includeWellKnownTypes bool, - wasmEnabled bool, -) error { - if err := modifyImage(ctx, g.logger, config, image); err != nil { - return err - } - responses, err := g.execPlugins( - ctx, - container, - config, - image, - includeImports, - includeWellKnownTypes, - wasmEnabled, - ) - if err != nil { - return err - } - // Apply the CodeGeneratorResponses in the order they were specified. - responseWriter := appprotoos.NewResponseWriter( - g.logger, - g.storageosProvider, - appprotoos.ResponseWriterWithCreateOutDirIfNotExists(), - ) - for i, pluginConfig := range config.PluginConfigs { - out := pluginConfig.Out - if baseOutDirPath != "" && baseOutDirPath != "." { - out = filepath.Join(baseOutDirPath, out) - } - response := responses[i] - if response == nil { - return fmt.Errorf("failed to get plugin response for %s", pluginConfig.PluginName()) - } - if err := responseWriter.AddResponse( - ctx, - response, - out, - ); err != nil { - return fmt.Errorf("plugin %s: %v", pluginConfig.PluginName(), err) - } - } - if err := responseWriter.Close(); err != nil { - return err - } - return nil -} - -func (g *generator) execPlugins( - ctx context.Context, - container app.EnvStdioContainer, - config *Config, - image bufimage.Image, - includeImports bool, - includeWellKnownTypes bool, - wasmEnabled bool, -) ([]*pluginpb.CodeGeneratorResponse, error) { - imageProvider := newImageProvider(image) - // Collect all of the plugin jobs so that they can be executed in parallel. - jobs := make([]func(context.Context) error, 0, len(config.PluginConfigs)) - responses := make([]*pluginpb.CodeGeneratorResponse, len(config.PluginConfigs)) - requiredFeatures := computeRequiredFeatures(image) - remotePluginConfigTable := make(map[string][]*remotePluginExecArgs, len(config.PluginConfigs)) - for i, pluginConfig := range config.PluginConfigs { - index := i - currentPluginConfig := pluginConfig - remote := currentPluginConfig.GetRemoteHostname() - if remote != "" { - remotePluginConfigTable[remote] = append( - remotePluginConfigTable[remote], - &remotePluginExecArgs{ - Index: index, - PluginConfig: currentPluginConfig, - }, - ) - } else { - jobs = append(jobs, func(ctx context.Context) error { - response, err := g.execLocalPlugin( - ctx, - container, - imageProvider, - currentPluginConfig, - includeImports, - includeWellKnownTypes, - wasmEnabled, - ) - if err != nil { - return err - } - responses[index] = response - return nil - }) - } - } - // Batch for each remote. - for remote, indexedPluginConfigs := range remotePluginConfigTable { - remote := remote - indexedPluginConfigs := indexedPluginConfigs - v1Args := make([]*remotePluginExecArgs, 0, len(indexedPluginConfigs)) - v2Args := make([]*remotePluginExecArgs, 0, len(indexedPluginConfigs)) - for _, param := range indexedPluginConfigs { - if param.PluginConfig.Plugin == "" { - v1Args = append(v1Args, param) - } else { - v2Args = append(v2Args, param) - } - } - if len(v1Args) > 0 { - jobs = append(jobs, func(ctx context.Context) error { - results, err := g.executeRemotePlugins( - ctx, - container, - image, - remote, - v1Args, - includeImports, - includeWellKnownTypes, - ) - if err != nil { - return err - } - for _, result := range results { - responses[result.Index] = result.CodeGeneratorResponse - } - return nil - }) - } - if len(v2Args) > 0 { - jobs = append(jobs, func(ctx context.Context) error { - results, err := g.execRemotePluginsV2( - ctx, - container, - image, - remote, - v2Args, - includeImports, - includeWellKnownTypes, - ) - if err != nil { - return err - } - for _, result := range results { - responses[result.Index] = result.CodeGeneratorResponse - } - return nil - }) - } - } - // We execute all of the jobs in parallel, but apply them in order so that any - // insertion points are handled correctly. - // - // For example, - // - // # buf.gen.yaml - // version: v1 - // plugins: - // - plugin: buf.build/org/insertion-point-receiver - // out: gen/proto - // - name: insertion-point-writer - // out: gen/proto - ctx, cancel := context.WithCancel(ctx) - defer cancel() - if err := thread.Parallelize( - ctx, - jobs, - thread.ParallelizeWithCancel(cancel), - ); err != nil { - if errs := multierr.Errors(err); len(errs) > 0 { - return nil, errs[0] - } - return nil, err - } - if err := validateResponses(responses, config.PluginConfigs); err != nil { - return nil, err - } - checkRequiredFeatures(container, requiredFeatures, responses, config.PluginConfigs) - return responses, nil -} - -func (g *generator) execLocalPlugin( - ctx context.Context, - container app.EnvStdioContainer, - imageProvider *imageProvider, - pluginConfig *PluginConfig, - includeImports bool, - includeWellKnownTypes bool, - wasmEnabled bool, -) (*pluginpb.CodeGeneratorResponse, error) { - pluginImages, err := imageProvider.GetImages(pluginConfig.Strategy) - if err != nil { - return nil, err - } - generateOptions := []bufpluginexec.GenerateOption{ - bufpluginexec.GenerateWithPluginPath(pluginConfig.Path...), - bufpluginexec.GenerateWithProtocPath(pluginConfig.ProtocPath), - } - if wasmEnabled { - generateOptions = append( - generateOptions, - bufpluginexec.GenerateWithWASMEnabled(), - ) - } - response, err := g.pluginexecGenerator.Generate( - ctx, - container, - pluginConfig.PluginName(), - bufimage.ImagesToCodeGeneratorRequests( - pluginImages, - pluginConfig.Opt, - nil, - includeImports, - includeWellKnownTypes, - ), - generateOptions..., - ) - if err != nil { - return nil, fmt.Errorf("plugin %s: %v", pluginConfig.PluginName(), err) - } - return response, nil -} - -type remotePluginExecArgs struct { - Index int - PluginConfig *PluginConfig -} - -type remotePluginExecutionResult struct { - CodeGeneratorResponse *pluginpb.CodeGeneratorResponse - Index int -} - -func (g *generator) executeRemotePlugins( - ctx context.Context, - container app.EnvStdioContainer, - image bufimage.Image, - remote string, - pluginConfigs []*remotePluginExecArgs, - includeImports bool, - includeWellKnownTypes bool, -) ([]*remotePluginExecutionResult, error) { - pluginReferences := make([]*registryv1alpha1.PluginReference, len(pluginConfigs)) - for i, pluginConfig := range pluginConfigs { - pluginReference, err := getPluginReference(pluginConfig.PluginConfig) - if err != nil { - return nil, err - } - pluginReferences[i] = pluginReference - } - generateService := connectclient.Make(g.clientConfig, remote, registryv1alpha1connect.NewGenerateServiceClient) - response, err := generateService.GeneratePlugins( - ctx, - connect.NewRequest( - ®istryv1alpha1.GeneratePluginsRequest{ - Image: bufimage.ImageToProtoImage(image), - Plugins: pluginReferences, - IncludeImports: includeImports, - IncludeWellKnownTypes: includeWellKnownTypes, - }, - ), - ) - if err != nil { - return nil, err - } - responses := response.Msg.Responses - if len(responses) != len(pluginReferences) { - return nil, fmt.Errorf("unexpected number of responses, got %d, wanted: %d", len(responses), len(pluginReferences)) - } - pluginService := connectclient.Make(g.clientConfig, remote, registryv1alpha1connect.NewPluginServiceClient) - result := make([]*remotePluginExecutionResult, 0, len(pluginReferences)) - for i, pluginReference := range pluginReferences { - result = append(result, &remotePluginExecutionResult{ - Index: pluginConfigs[i].Index, - CodeGeneratorResponse: responses[i], - }) - resp, err := pluginService.GetPlugin( - ctx, - connect.NewRequest( - ®istryv1alpha1.GetPluginRequest{ - Owner: pluginReference.Owner, - Name: pluginReference.Name, - }, - ), - ) - if err != nil { - return nil, err - } - plugin := resp.Msg.Plugin - if plugin.Deprecated { - warnMsg := fmt.Sprintf(`Plugin "%s/%s/%s" is deprecated`, remote, pluginReference.Owner, pluginReference.Name) - if plugin.DeprecationMessage != "" { - warnMsg = fmt.Sprintf("%s: %s", warnMsg, plugin.DeprecationMessage) - } - g.logger.Sugar().Warn(warnMsg) - } - } - return result, nil -} - -func (g *generator) execRemotePluginsV2( - ctx context.Context, - container app.EnvStdioContainer, - image bufimage.Image, - remote string, - pluginConfigs []*remotePluginExecArgs, - includeImports bool, - includeWellKnownTypes bool, -) ([]*remotePluginExecutionResult, error) { - requests := make([]*registryv1alpha1.PluginGenerationRequest, len(pluginConfigs)) - for i, pluginConfig := range pluginConfigs { - request, err := getPluginGenerationRequest(pluginConfig.PluginConfig) - if err != nil { - return nil, err - } - requests[i] = request - } - codeGenerationService := connectclient.Make(g.clientConfig, remote, registryv1alpha1connect.NewCodeGenerationServiceClient) - response, err := codeGenerationService.GenerateCode( - ctx, - connect.NewRequest( - ®istryv1alpha1.GenerateCodeRequest{ - Image: bufimage.ImageToProtoImage(image), - Requests: requests, - IncludeImports: includeImports, - IncludeWellKnownTypes: includeWellKnownTypes, - }, - ), - ) - if err != nil { - return nil, err - } - responses := response.Msg.Responses - if len(responses) != len(requests) { - return nil, fmt.Errorf("unexpected number of responses received, got %d, wanted %d", len(responses), len(requests)) - } - result := make([]*remotePluginExecutionResult, 0, len(responses)) - for i := range requests { - codeGeneratorResponse := responses[i].GetResponse() - if codeGeneratorResponse == nil { - return nil, errors.New("expected code generator response") - } - result = append(result, &remotePluginExecutionResult{ - CodeGeneratorResponse: codeGeneratorResponse, - Index: pluginConfigs[i].Index, - }) - } - return result, nil -} - -func getPluginGenerationRequest( - pluginConfig *PluginConfig, -) (*registryv1alpha1.PluginGenerationRequest, error) { - var curatedPluginReference *registryv1alpha1.CuratedPluginReference - if reference, err := bufpluginref.PluginReferenceForString(pluginConfig.Plugin, pluginConfig.Revision); err == nil { - curatedPluginReference = bufplugin.PluginReferenceToProtoCuratedPluginReference(reference) - } else { - // Try parsing as a plugin identity (no version information) - identity, err := bufpluginref.PluginIdentityForString(pluginConfig.Plugin) - if err != nil { - return nil, fmt.Errorf("invalid remote plugin %q", pluginConfig.Plugin) - } - curatedPluginReference = bufplugin.PluginIdentityToProtoCuratedPluginReference(identity) - } - var options []string - if len(pluginConfig.Opt) > 0 { - // Only include parameters if they're not empty. - options = []string{pluginConfig.Opt} - } - return ®istryv1alpha1.PluginGenerationRequest{ - PluginReference: curatedPluginReference, - Options: options, - }, nil -} - -// getPluginReference returns the plugin reference and remote for the given plugin configuration. -func getPluginReference(pluginConfig *PluginConfig) (*registryv1alpha1.PluginReference, error) { - _, owner, name, version, err := bufremoteplugin.ParsePluginVersionPath(pluginConfig.Remote) - if err != nil { - return nil, fmt.Errorf("invalid plugin path: %w", err) - } - var parameters []string - if len(pluginConfig.Opt) > 0 { - // Only include parameters if they're not empty. - parameters = []string{pluginConfig.Opt} - } - return ®istryv1alpha1.PluginReference{ - Owner: owner, - Name: name, - Version: version, - Parameters: parameters, - }, nil -} - -// modifyImage modifies the image according to the given configuration (i.e. managed mode). -func modifyImage( - ctx context.Context, - logger *zap.Logger, - config *Config, - image bufimage.Image, -) error { - if config.ManagedConfig == nil { - // If the config is nil, it implies that the - // user has not enabled managed mode. - return nil - } - sweeper := bufimagemodify.NewFileOptionSweeper() - modifier, err := newModifier(logger, config.ManagedConfig, sweeper) - if err != nil { - return err - } - modifier = bufimagemodify.Merge(modifier, bufimagemodify.ModifierFunc(sweeper.Sweep)) - return modifier.Modify(ctx, image) -} - -func newModifier( - logger *zap.Logger, - managedConfig *ManagedConfig, - sweeper bufimagemodify.Sweeper, -) (bufimagemodify.Modifier, error) { - modifier := bufimagemodify.NewMultiModifier( - bufimagemodify.JavaOuterClassname( - logger, - sweeper, - managedConfig.Override[bufimagemodify.JavaOuterClassNameID], - false, // preserveExistingValue - ), - bufimagemodify.PhpNamespace(logger, sweeper, managedConfig.Override[bufimagemodify.PhpNamespaceID]), - bufimagemodify.PhpMetadataNamespace(logger, sweeper, managedConfig.Override[bufimagemodify.PhpMetadataNamespaceID]), - ) - javaPackagePrefix := &JavaPackagePrefixConfig{Default: bufimagemodify.DefaultJavaPackagePrefix} - if managedConfig.JavaPackagePrefixConfig != nil { - javaPackagePrefix = managedConfig.JavaPackagePrefixConfig - } - javaPackageModifier, err := bufimagemodify.JavaPackage( - logger, - sweeper, - javaPackagePrefix.Default, - javaPackagePrefix.Except, - javaPackagePrefix.Override, - managedConfig.Override[bufimagemodify.JavaPackageID], - ) - if err != nil { - return nil, fmt.Errorf("failed to construct java_package modifier: %w", err) - } - modifier = bufimagemodify.Merge( - modifier, - javaPackageModifier, - ) - javaMultipleFilesValue := bufimagemodify.DefaultJavaMultipleFilesValue - if managedConfig.JavaMultipleFiles != nil { - javaMultipleFilesValue = *managedConfig.JavaMultipleFiles - } - javaMultipleFilesModifier, err := bufimagemodify.JavaMultipleFiles( - logger, - sweeper, - javaMultipleFilesValue, - managedConfig.Override[bufimagemodify.JavaMultipleFilesID], - false, // preserveExistingValue - ) - if err != nil { - return nil, err - } - modifier = bufimagemodify.Merge(modifier, javaMultipleFilesModifier) - if managedConfig.CcEnableArenas != nil { - ccEnableArenasModifier, err := bufimagemodify.CcEnableArenas( - logger, - sweeper, - *managedConfig.CcEnableArenas, - managedConfig.Override[bufimagemodify.CcEnableArenasID], - ) - if err != nil { - return nil, err - } - modifier = bufimagemodify.Merge(modifier, ccEnableArenasModifier) - } - if managedConfig.JavaStringCheckUtf8 != nil { - javaStringCheckUtf8, err := bufimagemodify.JavaStringCheckUtf8( - logger, - sweeper, - *managedConfig.JavaStringCheckUtf8, - managedConfig.Override[bufimagemodify.JavaStringCheckUtf8ID], - ) - if err != nil { - return nil, err - } - modifier = bufimagemodify.Merge(modifier, javaStringCheckUtf8) - } - var ( - csharpNamespaceExcept []bufmoduleref.ModuleIdentity - csharpNamespaceOverride map[bufmoduleref.ModuleIdentity]string - ) - if csharpNameSpaceConfig := managedConfig.CsharpNameSpaceConfig; csharpNameSpaceConfig != nil { - csharpNamespaceExcept = csharpNameSpaceConfig.Except - csharpNamespaceOverride = csharpNameSpaceConfig.Override - } - csharpNamespaceModifier := bufimagemodify.CsharpNamespace( - logger, - sweeper, - csharpNamespaceExcept, - csharpNamespaceOverride, - managedConfig.Override[bufimagemodify.CsharpNamespaceID], - ) - modifier = bufimagemodify.Merge(modifier, csharpNamespaceModifier) - if managedConfig.OptimizeForConfig != nil { - optimizeFor, err := bufimagemodify.OptimizeFor( - logger, - sweeper, - managedConfig.OptimizeForConfig.Default, - managedConfig.OptimizeForConfig.Except, - managedConfig.OptimizeForConfig.Override, - managedConfig.Override[bufimagemodify.OptimizeForID], - ) - if err != nil { - return nil, err - } - modifier = bufimagemodify.Merge( - modifier, - optimizeFor, - ) - } - if managedConfig.GoPackagePrefixConfig != nil { - goPackageModifier, err := bufimagemodify.GoPackage( - logger, - sweeper, - managedConfig.GoPackagePrefixConfig.Default, - managedConfig.GoPackagePrefixConfig.Except, - managedConfig.GoPackagePrefixConfig.Override, - managedConfig.Override[bufimagemodify.GoPackageID], - ) - if err != nil { - return nil, fmt.Errorf("failed to construct go_package modifier: %w", err) - } - modifier = bufimagemodify.Merge( - modifier, - goPackageModifier, - ) - } - var ( - objcClassPrefixDefault string - objcClassPrefixExcept []bufmoduleref.ModuleIdentity - objcClassPrefixOverride map[bufmoduleref.ModuleIdentity]string - ) - if objcClassPrefixConfig := managedConfig.ObjcClassPrefixConfig; objcClassPrefixConfig != nil { - objcClassPrefixDefault = objcClassPrefixConfig.Default - objcClassPrefixExcept = objcClassPrefixConfig.Except - objcClassPrefixOverride = objcClassPrefixConfig.Override - } - objcClassPrefixModifier := bufimagemodify.ObjcClassPrefix( - logger, - sweeper, - objcClassPrefixDefault, - objcClassPrefixExcept, - objcClassPrefixOverride, - managedConfig.Override[bufimagemodify.ObjcClassPrefixID], - ) - modifier = bufimagemodify.Merge( - modifier, - objcClassPrefixModifier, - ) - var ( - rubyPackageExcept []bufmoduleref.ModuleIdentity - rubyPackageOverrides map[bufmoduleref.ModuleIdentity]string - ) - if rubyPackageConfig := managedConfig.RubyPackageConfig; rubyPackageConfig != nil { - rubyPackageExcept = rubyPackageConfig.Except - rubyPackageOverrides = rubyPackageConfig.Override - } - rubyPackageModifier := bufimagemodify.RubyPackage( - logger, - sweeper, - rubyPackageExcept, - rubyPackageOverrides, - managedConfig.Override[bufimagemodify.RubyPackageID], - ) - modifier = bufimagemodify.Merge( - modifier, - rubyPackageModifier, - ) - return modifier, nil -} - -// validateResponses verifies that a response is set for each of the -// pluginConfigs, and that each generated file is generated by a single -// plugin. -func validateResponses( - responses []*pluginpb.CodeGeneratorResponse, - pluginConfigs []*PluginConfig, -) error { - if len(responses) != len(pluginConfigs) { - return fmt.Errorf("unexpected number of responses: expected %d but got %d", len(pluginConfigs), len(responses)) - } - pluginResponses := make([]*appproto.PluginResponse, 0, len(responses)) - for i, response := range responses { - pluginConfig := pluginConfigs[i] - if response == nil { - return fmt.Errorf("failed to create a response for %q", pluginConfig.PluginName()) - } - pluginResponses = append( - pluginResponses, - appproto.NewPluginResponse( - response, - pluginConfig.PluginName(), - pluginConfig.Out, - ), - ) - } - if err := appproto.ValidatePluginResponses(pluginResponses); err != nil { - return err - } - return nil -} - -type generateOptions struct { - baseOutDirPath string - includeImports bool - includeWellKnownTypes bool - wasmEnabled bool -} - -func newGenerateOptions() *generateOptions { - return &generateOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/image_provider.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/image_provider.go deleted file mode 100644 index 5344475529..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/image_provider.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgen - -import ( - "fmt" - "sync" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" -) - -// imageProvider is used to provide the images used -// when generating with a local plugin. Each plugin is -// in control of its own Strategy - we cache the -// imagesByDir so that we only have to build it once for -// all of the plugins that configure the the Directory -// strategy. -type imageProvider struct { - image bufimage.Image - imagesByDir []bufimage.Image - lock sync.Mutex -} - -func newImageProvider(image bufimage.Image) *imageProvider { - return &imageProvider{ - image: image, - } -} - -func (p *imageProvider) GetImages(strategy Strategy) ([]bufimage.Image, error) { - switch strategy { - case StrategyAll: - return []bufimage.Image{p.image}, nil - case StrategyDirectory: - p.lock.Lock() - defer p.lock.Unlock() - if p.imagesByDir == nil { - var err error - p.imagesByDir, err = bufimage.ImageByDir(p.image) - if err != nil { - return nil, err - } - } - return p.imagesByDir, nil - default: - return nil, fmt.Errorf("unknown strategy: %v", strategy) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/provider.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/provider.go deleted file mode 100644 index 79698151d5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/provider.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgen - -import ( - "context" - "io" - - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/storage" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type provider struct { - logger *zap.Logger - tracer trace.Tracer -} - -func newProvider(logger *zap.Logger) *provider { - return &provider{ - logger: logger, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - } -} - -func (p *provider) GetConfig(ctx context.Context, readBucket storage.ReadBucket) (_ *Config, retErr error) { - ctx, span := p.tracer.Start(ctx, "get_config") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - - readObjectCloser, err := readBucket.Get(ctx, ExternalConfigFilePath) - if err != nil { - // There is no default generate template, so we propagate all errors, including - // storage.ErrNotExist. - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readObjectCloser.Close()) - }() - data, err := io.ReadAll(readObjectCloser) - if err != nil { - return nil, err - } - return getConfig( - p.logger, - encoding.UnmarshalYAMLNonStrict, - encoding.UnmarshalYAMLStrict, - data, - `File "`+readObjectCloser.ExternalPath()+`"`, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufgen/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufgen/usage.gen.go deleted file mode 100644 index a2cd110ebc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufgen/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufgen - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/bufmigrate.go b/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/bufmigrate.go deleted file mode 100644 index f0f27c46be..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/bufmigrate.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufmigrate contains logic for migrating between different -// configuration file versions. -package bufmigrate - -// Migrator describes the interface used to migrate -// a set of files in a directory from one version to another. -type Migrator interface { - Migrate(dirPath string) error -} - -// V1Beta1MigrateOption defines the type used -// to configure the v1beta1 migrator. -type V1Beta1MigrateOption func(*v1beta1Migrator) - -// NewV1Beta1Migrator creates a new migrator that migrates files -// between version v1beta1 and v1. -func NewV1Beta1Migrator(commandName string, options ...V1Beta1MigrateOption) Migrator { - return newV1Beta1Migrator(commandName, options...) -} - -// V1Beta1MigratorWithNotifier instruments the migrator with -// a callback to call whenever an event that should notify the -// user occurs during the migration. -func V1Beta1MigratorWithNotifier(notifier func(message string) error) V1Beta1MigrateOption { - return func(migrateOptions *v1beta1Migrator) { - migrateOptions.notifier = notifier - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/usage.gen.go deleted file mode 100644 index a27acc9b2a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmigrate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/v1beta1_migrator.go b/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/v1beta1_migrator.go deleted file mode 100644 index 8b62262419..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufmigrate/v1beta1_migrator.go +++ /dev/null @@ -1,553 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmigrate - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/bufbuild/buf/private/buf/bufgen" - "github.com/bufbuild/buf/private/buf/bufwork" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/buflock" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig" - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -const ( - bufModHeaderWithName = `# Generated by %q. Edit as necessary, and -# remove this comment when you're finished. -# -# This module represents the %q root found in -# the previous configuration file for the -# %q module. -` - bufModHeaderWithoutName = `# Generated by %q. Edit as necessary, and -# remove this comment when you're finished. -# -# This module represents the %q root found in -# the previous configuration. -` - bufGenHeader = `# Generated by %q. Edit as necessary, and -# remove this comment when you're finished. -` - bufWorkHeader = `# Generated by %q. Edit as necessary, and -# remove this comment when you're finished. -# -# This workspace file points to the roots found in your -# previous %q configuration. -` -) - -type v1beta1Migrator struct { - notifier func(string) error - commandName string -} - -func newV1Beta1Migrator(commandName string, options ...V1Beta1MigrateOption) *v1beta1Migrator { - migrator := v1beta1Migrator{ - commandName: commandName, - notifier: func(string) error { return nil }, - } - for _, option := range options { - option(&migrator) - } - return &migrator -} - -func (m *v1beta1Migrator) Migrate(dirPath string) error { - migratedConfig, err := m.maybeMigrateConfig(dirPath) - if err != nil { - return fmt.Errorf("failed to migrate config: %w", err) - } - migratedGenTemplate, err := m.maybeMigrateGenTemplate(dirPath) - if err != nil { - return fmt.Errorf("failed to migrate generation template: %w", err) - } - migratedLockFile, err := m.maybeMigrateLockFile(dirPath) - if err != nil { - return fmt.Errorf("failed to migrate lock file: %w", err) - } - if !migratedConfig && !migratedGenTemplate && !migratedLockFile { - return nil - } - var migratedFiles []string - if migratedConfig { - migratedFiles = append(migratedFiles, bufconfig.ExternalConfigV1Beta1FilePath) - } - if migratedGenTemplate { - migratedFiles = append(migratedFiles, bufgen.ExternalConfigFilePath) - } - if migratedLockFile { - migratedFiles = append(migratedFiles, buflock.ExternalConfigFilePath) - } - if err := m.notifier( - fmt.Sprintf("Successfully migrated your %s to v1.\n", stringutil.SliceToHumanString(migratedFiles)), - ); err != nil { - return fmt.Errorf("failed to write success message: %w", err) - } - return nil -} - -func (m *v1beta1Migrator) maybeMigrateConfig(dirPath string) (bool, error) { - oldConfigPath := filepath.Join(dirPath, bufconfig.ExternalConfigV1Beta1FilePath) - oldConfigBytes, err := os.ReadFile(oldConfigPath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - // OK, no old config file - return false, nil - } - return false, fmt.Errorf("failed to read file: %w", err) - } - var versionedConfig bufconfig.ExternalConfigVersion - if err := encoding.UnmarshalYAMLNonStrict(oldConfigBytes, &versionedConfig); err != nil { - return false, fmt.Errorf( - "failed to read %s version: %w", - oldConfigPath, - err, - ) - } - switch versionedConfig.Version { - case bufconfig.V1Version: - // OK, file was already v1 - return false, nil - case bufconfig.V1Beta1Version, "": - // Continue to migrate - default: - return false, fmt.Errorf("unknown config file version: %s", versionedConfig.Version) - } - var v1beta1Config bufconfig.ExternalConfigV1Beta1 - if err := encoding.UnmarshalYAMLStrict(oldConfigBytes, &v1beta1Config); err != nil { - return false, fmt.Errorf( - "failed to unmarshal %s as %s version v1beta1: %w", - oldConfigPath, - bufconfig.ExternalConfigV1Beta1FilePath, - err, - ) - } - buildConfig, err := bufmoduleconfig.NewConfigV1Beta1(v1beta1Config.Build, v1beta1Config.Deps...) - if err != nil { - return false, err - } - if excludes, ok := buildConfig.RootToExcludes["."]; len(buildConfig.RootToExcludes) == 1 && ok { - // Only "." root present, just recreate file - v1Config := bufconfig.ExternalConfigV1{ - Version: bufconfig.V1Version, - Name: v1beta1Config.Name, - Deps: v1beta1Config.Deps, - Build: bufmoduleconfig.ExternalConfigV1{ - Excludes: excludes, - }, - Breaking: bufbreakingconfig.ExternalConfigV1(v1beta1Config.Breaking), - Lint: buflintconfig.ExternalConfigV1(v1beta1Config.Lint), - } - newConfigPath := filepath.Join(dirPath, bufconfig.ExternalConfigV1FilePath) - if err := m.writeV1Config(newConfigPath, v1Config, ".", v1beta1Config.Name); err != nil { - return false, err - } - // Delete the old file once we've created the new one, - // unless it's the same file as before. - if newConfigPath != oldConfigPath { - if err := os.Remove(oldConfigPath); err != nil { - return false, fmt.Errorf("failed to delete old config file: %w", err) - } - } - return true, nil - } - // Check if we have a co-resident lock file, of any version - oldLockFilePath := filepath.Join(dirPath, buflock.ExternalConfigFilePath) - externalLockFileV1, hasLockFile, err := maybeReadLockFile(oldLockFilePath) - if err != nil { - return false, err - } - pathToProcessed := make(map[string]bool) - for root, excludes := range buildConfig.RootToExcludes { - // Convert universal settings - var name string - if v1beta1Config.Name != "" { - name = v1beta1Config.Name + "-" + strings.ReplaceAll(root, "/", "-") // Note: roots are normalized, "/" is universal - } - v1Config := bufconfig.ExternalConfigV1{ - Version: bufconfig.V1Version, - Name: name, - Deps: v1beta1Config.Deps, - Build: bufmoduleconfig.ExternalConfigV1{ - Excludes: excludes, - }, - Breaking: bufbreakingconfig.ExternalConfigV1{ - Use: v1beta1Config.Breaking.Use, - Except: v1beta1Config.Breaking.Except, - IgnoreUnstablePackages: v1beta1Config.Breaking.IgnoreUnstablePackages, - }, - Lint: buflintconfig.ExternalConfigV1{ - Use: v1beta1Config.Lint.Use, - Except: v1beta1Config.Lint.Except, - ServiceSuffix: v1beta1Config.Lint.ServiceSuffix, - EnumZeroValueSuffix: v1beta1Config.Lint.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: v1beta1Config.Lint.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: v1beta1Config.Lint.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: v1beta1Config.Lint.RPCAllowGoogleProtobufEmptyResponses, - AllowCommentIgnores: v1beta1Config.Lint.AllowCommentIgnores, - }, - } - - // Process Ignore's for those related to the root - v1Config.Breaking.Ignore, err = convertIgnoreSlice(v1beta1Config.Breaking.Ignore, dirPath, root, pathToProcessed) - if err != nil { - return false, err - } - v1Config.Breaking.IgnoreOnly, err = convertIgnoreMap(v1beta1Config.Breaking.IgnoreOnly, dirPath, root, pathToProcessed) - if err != nil { - return false, err - } - v1Config.Lint.Ignore, err = convertIgnoreSlice(v1beta1Config.Lint.Ignore, dirPath, root, pathToProcessed) - if err != nil { - return false, err - } - v1Config.Lint.IgnoreOnly, err = convertIgnoreMap(v1beta1Config.Lint.IgnoreOnly, dirPath, root, pathToProcessed) - if err != nil { - return false, err - } - if err := m.writeV1Config( - filepath.Join(dirPath, root, bufconfig.ExternalConfigV1FilePath), - v1Config, - root, - v1beta1Config.Name, - ); err != nil { - return false, err - } - if hasLockFile { - if err := m.writeV1LockFile( - filepath.Join(dirPath, root, buflock.ExternalConfigFilePath), - externalLockFileV1, - ); err != nil { - return false, err - } - } - } - for path, processed := range pathToProcessed { - if !processed { - if err := m.notifier( - fmt.Sprintf( - "The ignored file %q was not found in any roots and has been removed.\n", - path, - ), - ); err != nil { - return false, fmt.Errorf("failed to warn about ignored file: %w", err) - } - } - } - workConfig := bufwork.ExternalConfigV1{ - Version: bufwork.V1Version, - Directories: v1beta1Config.Build.Roots, - } - // Sort directories before marshalling for deterministic output - sort.Strings(workConfig.Directories) - workConfigBytes, err := encoding.MarshalYAML(&workConfig) - if err != nil { - return false, fmt.Errorf("failed to marshal workspace file: %w", err) - } - header := fmt.Sprintf(bufWorkHeader, m.commandName, bufconfig.ExternalConfigV1Beta1FilePath) - if err := os.WriteFile( - filepath.Join(dirPath, bufwork.ExternalConfigV1FilePath), - append([]byte(header), workConfigBytes...), - 0600, - ); err != nil { - return false, fmt.Errorf("failed to write workspace file: %w", err) - } - // Finally, delete the old `buf.yaml` and any `buf.lock`. This is safe to do unconditionally - // as we know that there can't be a new `buf.yaml` here, since the only case - // where that would be true is if the only root is ".", which is handled separately. - if err := os.Remove(oldConfigPath); err != nil { - return false, fmt.Errorf("failed to clean up old config file: %w", err) - } - if hasLockFile { - if err := os.Remove(oldLockFilePath); err != nil { - return false, fmt.Errorf("failed to clean up old lock file: %w", err) - } - } - return true, nil -} - -// writeV1Config atomically replaces the old configuration file by first writing -// the new config to a temporary file and then moving it to the old config file path. -// If we fail to marshal or write, the old config file is not touched. -func (m *v1beta1Migrator) writeV1Config( - configPath string, - config bufconfig.ExternalConfigV1, - originalRootName string, - originalModuleName string, -) (retErr error) { - v1ConfigData, err := encoding.MarshalYAML(&config) - if err != nil { - return fmt.Errorf("failed to marshal new config: %w", err) - } - header := fmt.Sprintf(bufModHeaderWithName, m.commandName, originalRootName, originalModuleName) - if originalModuleName == "" { - header = fmt.Sprintf(bufModHeaderWithoutName, m.commandName, originalRootName) - } - v1ConfigData = append([]byte(header), v1ConfigData...) - if err := os.MkdirAll(filepath.Dir(configPath), 0755); err != nil { - // This happens if the user has a root specified that doesn't have a corresponding - // directory on the filesystem. - return fmt.Errorf("failed to create new directories for writing config: %w", err) - } - return os.WriteFile(configPath, v1ConfigData, 0600) -} - -func (m *v1beta1Migrator) maybeMigrateGenTemplate(dirPath string) (bool, error) { - oldConfigPath := filepath.Join(dirPath, bufgen.ExternalConfigFilePath) - oldConfigBytes, err := os.ReadFile(oldConfigPath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - // OK, no old config file - return false, nil - } - return false, fmt.Errorf("failed to read file: %w", err) - } - var versionedConfig bufgen.ExternalConfigVersion - if err := encoding.UnmarshalYAMLNonStrict(oldConfigBytes, &versionedConfig); err != nil { - return false, fmt.Errorf( - "failed to read %s version: %w", - oldConfigPath, - err, - ) - } - switch versionedConfig.Version { - case bufgen.V1Version: - // OK, file was already v1 - return false, nil - case bufgen.V1Beta1Version, "": - // Continue to migrate - default: - return false, fmt.Errorf("unknown config file version: %s", versionedConfig.Version) - } - var v1beta1GenTemplate bufgen.ExternalConfigV1Beta1 - if err := encoding.UnmarshalYAMLStrict(oldConfigBytes, &v1beta1GenTemplate); err != nil { - return false, fmt.Errorf( - "failed to unmarshal %s as %s version v1beta1: %w", - oldConfigPath, - bufgen.ExternalConfigFilePath, - err, - ) - } - v1GenTemplate := bufgen.ExternalConfigV1{ - Version: bufgen.V1Version, - Managed: bufgen.ExternalManagedConfigV1{ - Enabled: v1beta1GenTemplate.Managed, - CcEnableArenas: v1beta1GenTemplate.Options.CcEnableArenas, - JavaMultipleFiles: v1beta1GenTemplate.Options.JavaMultipleFiles, - OptimizeFor: bufgen.ExternalOptimizeForConfigV1{Default: v1beta1GenTemplate.Options.OptimizeFor}, - }, - } - for _, plugin := range v1beta1GenTemplate.Plugins { - pluginConfig := bufgen.ExternalPluginConfigV1{ - Name: plugin.Name, - Out: plugin.Out, - Opt: plugin.Opt, - Strategy: plugin.Strategy, - } - if plugin.Path != "" { - pluginConfig.Path = plugin.Path - } - v1GenTemplate.Plugins = append(v1GenTemplate.Plugins, pluginConfig) - } - newConfigPath := filepath.Join(dirPath, bufgen.ExternalConfigFilePath) - if err := m.writeV1GenTemplate(newConfigPath, v1GenTemplate); err != nil { - return false, err - } - return true, nil -} - -// writeV1GenTemplate atomically replaces the old configuration file by first writing -// the new config to a temporary file and then moving it to the old config file path. -// If we fail to marshal or write, the old config file is not touched. -func (m *v1beta1Migrator) writeV1GenTemplate( - configPath string, - config bufgen.ExternalConfigV1, -) (retErr error) { - v1ConfigData, err := encoding.MarshalYAML(&config) - if err != nil { - return fmt.Errorf("failed to marshal new config: %w", err) - } - header := fmt.Sprintf(bufGenHeader, m.commandName) - v1ConfigData = append([]byte(header), v1ConfigData...) - return os.WriteFile(configPath, v1ConfigData, 0600) -} - -func (m *v1beta1Migrator) maybeMigrateLockFile(dirPath string) (bool, error) { - oldConfigPath := filepath.Join(dirPath, buflock.ExternalConfigFilePath) - oldConfigBytes, err := os.ReadFile(oldConfigPath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - // OK, no old config file - return false, nil - } - return false, fmt.Errorf("failed to read file: %w", err) - } - var versionedConfig buflock.ExternalConfigVersion - if err := encoding.UnmarshalYAMLNonStrict(oldConfigBytes, &versionedConfig); err != nil { - return false, fmt.Errorf( - "failed to read %s version: %w", - oldConfigPath, - err, - ) - } - switch versionedConfig.Version { - case buflock.V1Version: - // OK, file was already v1 - return false, nil - case buflock.V1Beta1Version, "": - // Continue to migrate - default: - return false, fmt.Errorf("unknown lock file version: %s", versionedConfig.Version) - } - var v1beta1LockFile buflock.ExternalConfigV1Beta1 - if err := encoding.UnmarshalYAMLStrict(oldConfigBytes, &v1beta1LockFile); err != nil { - return false, fmt.Errorf( - "failed to unmarshal %s as %s version v1beta1: %w", - oldConfigPath, - buflock.ExternalConfigFilePath, - err, - ) - } - v1LockFile := buflock.ExternalConfigV1{ - Version: buflock.V1Version, - } - for _, dependency := range v1beta1LockFile.Deps { - v1LockFile.Deps = append(v1LockFile.Deps, buflock.ExternalConfigDependencyV1(dependency)) - } - newConfigPath := filepath.Join(dirPath, buflock.ExternalConfigFilePath) - if err := m.writeV1LockFile(newConfigPath, v1LockFile); err != nil { - return false, err - } - return true, nil -} - -// writeV1LockFile atomically replaces the old lock file by first writing -// the new lock file to a temporary file and then moving it to the old lock file path. -// If we fail to marshal or write, the old lock file is not touched. -func (m *v1beta1Migrator) writeV1LockFile( - configPath string, - config buflock.ExternalConfigV1, -) (retErr error) { - v1ConfigData, err := encoding.MarshalYAML(&config) - if err != nil { - return fmt.Errorf("failed to marshal new lock file: %w", err) - } - v1ConfigData = append([]byte(buflock.Header), v1ConfigData...) - return os.WriteFile(configPath, v1ConfigData, 0600) -} - -func maybeReadLockFile(oldLockFilePath string) (buflock.ExternalConfigV1, bool, error) { - lockFileBytes, err := os.ReadFile(oldLockFilePath) - if err != nil { - if errors.Is(err, os.ErrNotExist) { - // OK, no old lock file - return buflock.ExternalConfigV1{}, false, nil - } - - return buflock.ExternalConfigV1{}, false, fmt.Errorf("failed to read lock file path: %w", err) - } - var versionedConfig buflock.ExternalConfigVersion - if err := encoding.UnmarshalYAMLNonStrict(lockFileBytes, &versionedConfig); err != nil { - return buflock.ExternalConfigV1{}, false, fmt.Errorf( - "failed to read %s version: %w", - oldLockFilePath, - err, - ) - } - switch versionedConfig.Version { - case "", buflock.V1Beta1Version: - var externalConfig buflock.ExternalConfigV1Beta1 - if err := encoding.UnmarshalYAMLStrict(lockFileBytes, &externalConfig); err != nil { - return buflock.ExternalConfigV1{}, false, fmt.Errorf( - "failed to unmarshal lock file at %s: %w", - buflock.V1Beta1Version, - err, - ) - } - externalLockFileV1 := buflock.ExternalConfigV1{ - Version: buflock.V1Version, - } - for _, dependency := range externalConfig.Deps { - externalLockFileV1.Deps = append(externalLockFileV1.Deps, buflock.ExternalConfigDependencyV1(dependency)) - } - return externalLockFileV1, true, nil - case buflock.V1Version: - externalLockFileV1 := buflock.ExternalConfigV1{} - if err := encoding.UnmarshalYAMLStrict(lockFileBytes, &externalLockFileV1); err != nil { - return buflock.ExternalConfigV1{}, false, fmt.Errorf("failed to unmarshal lock file at %s: %w", buflock.V1Version, err) - } - return externalLockFileV1, true, nil - default: - return buflock.ExternalConfigV1{}, false, fmt.Errorf("unknown lock file version: %s", versionedConfig.Version) - } -} - -func convertIgnoreSlice(paths []string, dirPath string, root string, pathToProcessed map[string]bool) ([]string, error) { - var ignoresForRoot []string - for _, ignoredFile := range paths { - if _, ok := pathToProcessed[ignoredFile]; !ok { - pathToProcessed[ignoredFile] = false - } - filePath := filepath.Join(dirPath, root, ignoredFile) - if _, err := os.Stat(filePath); err != nil { - if errors.Is(err, os.ErrNotExist) { - continue - } - return nil, fmt.Errorf("failed to check for presence of file %s: %w", filePath, err) - } - pathToProcessed[ignoredFile] = true - ignoresForRoot = append(ignoresForRoot, ignoredFile) - } - sort.Strings(ignoresForRoot) - return ignoresForRoot, nil -} - -func convertIgnoreMap(ruleToIgnores map[string][]string, dirPath string, root string, pathToProcessed map[string]bool) (map[string][]string, error) { - var ruleToIgnoresForRoot map[string][]string - for rule, ignores := range ruleToIgnores { - for _, ignoredFile := range ignores { - if _, ok := pathToProcessed[ignoredFile]; !ok { - pathToProcessed[ignoredFile] = false - } - filePath := filepath.Join(dirPath, root, ignoredFile) - if _, err := os.Stat(filePath); err != nil { - if errors.Is(err, os.ErrNotExist) { - continue - } - return nil, fmt.Errorf("failed to check for presence of file %s: %w", filePath, err) - } - if ruleToIgnoresForRoot == nil { - ruleToIgnoresForRoot = make(map[string][]string) - } - pathToProcessed[ignoredFile] = true - ruleToIgnoresForRoot[rule] = append( - ruleToIgnoresForRoot[rule], - ignoredFile, - ) - } - sort.Strings(ruleToIgnoresForRoot[rule]) - } - return ruleToIgnoresForRoot, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/bufprint.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/bufprint.go deleted file mode 100644 index f1e6ba0ed3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/bufprint.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "fmt" - "io" - "strconv" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/protostat" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/multierr" - "google.golang.org/protobuf/proto" -) - -const ( - // FormatText is the text format. - FormatText Format = 1 - // FormatJSON is the JSON format. - FormatJSON Format = 2 -) - -var ( - // AllFormatsString is the string representation of all Formats. - AllFormatsString = stringutil.SliceToString([]string{FormatText.String(), FormatJSON.String()}) -) - -// Format is a format to print. -type Format int - -// ParseFormat parses the format. -// -// If the empty string is provided, this is interpreted as FormatText. -func ParseFormat(s string) (Format, error) { - switch s { - case "", "text": - return FormatText, nil - case "json": - return FormatJSON, nil - default: - return 0, fmt.Errorf("unknown format: %s", s) - } -} - -// String implements fmt.Stringer. -func (f Format) String() string { - switch f { - case FormatText: - return "text" - case FormatJSON: - return "json" - default: - return strconv.Itoa(int(f)) - } -} - -// CuratedPluginPrinter is a printer for curated plugins. -type CuratedPluginPrinter interface { - PrintCuratedPlugin(ctx context.Context, format Format, plugin *registryv1alpha1.CuratedPlugin) error - PrintCuratedPlugins(ctx context.Context, format Format, nextPageToken string, plugins ...*registryv1alpha1.CuratedPlugin) error -} - -// NewCuratedPluginPrinter returns a new CuratedPluginPrinter. -func NewCuratedPluginPrinter(writer io.Writer) CuratedPluginPrinter { - return newCuratedPluginPrinter(writer) -} - -// OrganizationPrinter is an organization printer. -type OrganizationPrinter interface { - PrintOrganization(ctx context.Context, format Format, organization *registryv1alpha1.Organization) error -} - -// NewOrganizationPrinter returns a new OrganizationPrinter. -func NewOrganizationPrinter(address string, writer io.Writer) OrganizationPrinter { - return newOrganizationPrinter(address, writer) -} - -// RepositoryPrinter is a repository printer. -type RepositoryPrinter interface { - PrintRepository(ctx context.Context, format Format, repository *registryv1alpha1.Repository) error - PrintRepositories(ctx context.Context, format Format, nextPageToken string, repositories ...*registryv1alpha1.Repository) error -} - -// NewRepositoryPrinter returns a new RepositoryPrinter. -func NewRepositoryPrinter( - clientConfig *connectclient.Config, - address string, - writer io.Writer, -) RepositoryPrinter { - return newRepositoryPrinter(clientConfig, address, writer) -} - -// RepositoryTagPrinter is a repository tag printer. -type RepositoryTagPrinter interface { - PrintRepositoryTag(ctx context.Context, format Format, repositoryTag *registryv1alpha1.RepositoryTag) error - PrintRepositoryTags(ctx context.Context, format Format, nextPageToken string, repositoryTags ...*registryv1alpha1.RepositoryTag) error -} - -// NewRepositoryTagPrinter returns a new RepositoryTagPrinter. -func NewRepositoryTagPrinter(writer io.Writer) RepositoryTagPrinter { - return newRepositoryTagPrinter(writer) -} - -// RepositoryCommitPrinter is a repository commit printer. -type RepositoryCommitPrinter interface { - PrintRepositoryCommit(ctx context.Context, format Format, repositoryCommit *registryv1alpha1.RepositoryCommit) error - PrintRepositoryCommits(ctx context.Context, format Format, nextPageToken string, repositoryCommits ...*registryv1alpha1.RepositoryCommit) error -} - -// NewRepositoryCommitPrinter returns a new RepositoryCommitPrinter. -func NewRepositoryCommitPrinter(writer io.Writer) RepositoryCommitPrinter { - return newRepositoryCommitPrinter(writer) -} - -// RepositoryDraftPrinter is a repository draft printer. -type RepositoryDraftPrinter interface { - PrintRepositoryDraft(ctx context.Context, format Format, repositoryCommit *registryv1alpha1.RepositoryCommit) error - PrintRepositoryDrafts(ctx context.Context, format Format, nextPageToken string, repositoryCommits ...*registryv1alpha1.RepositoryCommit) error -} - -// NewRepositoryDraftPrinter returns a new RepositoryDraftPrinter. -func NewRepositoryDraftPrinter(writer io.Writer) RepositoryDraftPrinter { - return newRepositoryDraftPrinter(writer) -} - -// TokenPrinter is a token printer. -// -// TODO: update to same format as other printers. -type TokenPrinter interface { - PrintTokens(ctx context.Context, tokens ...*registryv1alpha1.Token) error -} - -// NewTokenPrinter returns a new TokenPrinter. -// -// TODO: update to same format as other printers. -func NewTokenPrinter(writer io.Writer, format Format) (TokenPrinter, error) { - switch format { - case FormatText: - return newTokenTextPrinter(writer), nil - case FormatJSON: - return newTokenJSONPrinter(writer), nil - default: - return nil, fmt.Errorf("unknown format: %v", format) - } -} - -// StatsPrinter is a printer of Stats. -type StatsPrinter interface { - PrintStats(ctx context.Context, format Format, stats *protostat.Stats) error -} - -// NewStatsPrinter returns a new StatsPrinter. -func NewStatsPrinter(writer io.Writer) StatsPrinter { - return newStatsPrinter(writer) -} - -// TabWriter is a tab writer. -type TabWriter interface { - Write(values ...string) error -} - -// WithTabWriter calls a function with a TabWriter. -// -// Shared with internal packages. -func WithTabWriter( - writer io.Writer, - header []string, - f func(TabWriter) error, -) (retErr error) { - tabWriter := newTabWriter(writer) - defer func() { - retErr = multierr.Append(retErr, tabWriter.Flush()) - }() - if err := tabWriter.Write(header...); err != nil { - return err - } - return f(tabWriter) -} - -// printProtoMessageJSON prints the Protobuf message as JSON. -func printProtoMessageJSON(writer io.Writer, message proto.Message) error { - data, err := protoencoding.NewJSONMarshaler(nil, protoencoding.JSONMarshalerWithIndent()).Marshal(message) - if err != nil { - return err - } - _, err = writer.Write(append(data, []byte("\n")...)) - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/curated_plugin_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/curated_plugin_printer.go deleted file mode 100644 index 302ba49dc5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/curated_plugin_printer.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type curatedPluginPrinter struct { - writer io.Writer -} - -func newCuratedPluginPrinter(writer io.Writer) *curatedPluginPrinter { - return &curatedPluginPrinter{ - writer: writer, - } -} - -func (p *curatedPluginPrinter) PrintCuratedPlugin(_ context.Context, format Format, plugin *registryv1alpha1.CuratedPlugin) error { - switch format { - case FormatText: - return p.printCuratedPluginsText(plugin) - case FormatJSON: - return json.NewEncoder(p.writer).Encode( - registryCuratedPluginToOutputCuratedPlugin(plugin), - ) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *curatedPluginPrinter) PrintCuratedPlugins(_ context.Context, format Format, nextPageToken string, plugins ...*registryv1alpha1.CuratedPlugin) error { - switch format { - case FormatText: - return p.printCuratedPluginsText(plugins...) - case FormatJSON: - outputPlugins := make([]outputCuratedPlugin, 0, len(plugins)) - for _, plugin := range plugins { - outputPlugins = append(outputPlugins, registryCuratedPluginToOutputCuratedPlugin(plugin)) - } - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputPlugins, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *curatedPluginPrinter) printCuratedPluginsText(plugins ...*registryv1alpha1.CuratedPlugin) error { - if len(plugins) == 0 { - return nil - } - return WithTabWriter( - p.writer, - []string{ - "Owner", - "Name", - "Version", - "Revision", - }, - func(tabWriter TabWriter) error { - for _, plugin := range plugins { - if err := tabWriter.Write( - plugin.Owner, - plugin.Name, - plugin.Version, - strconv.FormatInt(int64(plugin.Revision), 10), - ); err != nil { - return err - } - } - return nil - }, - ) -} - -type outputCuratedPlugin struct { - Owner string `json:"owner"` - Name string `json:"name"` - Version string `json:"version"` - Revision uint32 `json:"revision"` - ImageDigest string `json:"image_digest"` -} - -func registryCuratedPluginToOutputCuratedPlugin(plugin *registryv1alpha1.CuratedPlugin) outputCuratedPlugin { - return outputCuratedPlugin{ - Owner: plugin.Owner, - Name: plugin.Name, - Version: plugin.Version, - Revision: plugin.Revision, - ImageDigest: plugin.ContainerImageDigest, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/organization_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/organization_printer.go deleted file mode 100644 index a5271ad9dd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/organization_printer.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - "time" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type organizationPrinter struct { - address string - writer io.Writer -} - -func newOrganizationPrinter( - address string, - writer io.Writer, -) *organizationPrinter { - return &organizationPrinter{ - address: address, - writer: writer, - } -} - -func (p *organizationPrinter) PrintOrganization(ctx context.Context, format Format, message *registryv1alpha1.Organization) error { - outOrganization := registryOrganizationToOutputOrganization(p.address, message) - switch format { - case FormatText: - return p.printOrganizationsText([]outputOrganization{outOrganization}) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(outOrganization) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *organizationPrinter) PrintOrganizations(ctx context.Context, format Format, nextPageToken string, messages ...*registryv1alpha1.Organization) error { - if len(messages) == 0 { - return nil - } - var outputOrganizations []outputOrganization - for _, organization := range messages { - outputOrganization := registryOrganizationToOutputOrganization(p.address, organization) - outputOrganizations = append(outputOrganizations, outputOrganization) - } - switch format { - case FormatText: - return p.printOrganizationsText(outputOrganizations) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputOrganizations, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *organizationPrinter) printOrganizationsText(outputOrganizations []outputOrganization) error { - return WithTabWriter( - p.writer, - []string{ - "Full name", - "Created", - }, - func(tabWriter TabWriter) error { - for _, outputOrganization := range outputOrganizations { - if err := tabWriter.Write( - outputOrganization.Remote+"/"+outputOrganization.Name, - outputOrganization.CreateTime.Format(time.RFC3339), - ); err != nil { - return err - } - } - return nil - }, - ) -} - -type outputOrganization struct { - ID string `json:"id,omitempty"` - Remote string `json:"remote,omitempty"` - Name string `json:"name,omitempty"` - CreateTime time.Time `json:"create_time,omitempty"` -} - -func registryOrganizationToOutputOrganization(address string, organization *registryv1alpha1.Organization) outputOrganization { - return outputOrganization{ - ID: organization.Id, - Remote: address, - Name: organization.Name, - CreateTime: organization.CreateTime.AsTime(), - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/pagination_wrapper.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/pagination_wrapper.go deleted file mode 100644 index 6b62821762..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/pagination_wrapper.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -type paginationWrapper struct { - NextPage string `json:"next_page,omitempty"` - Results interface{} `json:"results"` -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_commit_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_commit_printer.go deleted file mode 100644 index d092a44220..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_commit_printer.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type repositoryCommitPrinter struct { - writer io.Writer -} - -func newRepositoryCommitPrinter( - writer io.Writer, -) *repositoryCommitPrinter { - return &repositoryCommitPrinter{ - writer: writer, - } -} - -func (p *repositoryCommitPrinter) PrintRepositoryCommit(ctx context.Context, format Format, message *registryv1alpha1.RepositoryCommit) error { - outCommit := registryCommitToOutputCommit(message) - switch format { - case FormatText: - return p.printRepositoryCommitsText([]outputRepositoryCommit{outCommit}) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(outCommit) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryCommitPrinter) PrintRepositoryCommits(ctx context.Context, format Format, nextPageToken string, messages ...*registryv1alpha1.RepositoryCommit) error { - if len(messages) == 0 { - return nil - } - var outputRepositoryCommits []outputRepositoryCommit - for _, repositoryCommit := range messages { - outputRepositoryCommit := registryCommitToOutputCommit(repositoryCommit) - outputRepositoryCommits = append(outputRepositoryCommits, outputRepositoryCommit) - } - switch format { - case FormatText: - return p.printRepositoryCommitsText(outputRepositoryCommits) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputRepositoryCommits, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryCommitPrinter) printRepositoryCommitsText(outputRepositoryCommits []outputRepositoryCommit) error { - return WithTabWriter( - p.writer, - []string{ - "Commit", - }, - func(tabWriter TabWriter) error { - for _, outputRepositoryCommit := range outputRepositoryCommits { - if err := tabWriter.Write( - outputRepositoryCommit.Commit, - ); err != nil { - return err - } - } - return nil - }, - ) -} - -type outputRepositoryCommit struct { - ID string `json:"id,omitempty"` - Commit string `json:"commit,omitempty"` - Tags []outputRepositoryTag `json:"tags,omitempty"` -} - -func registryCommitToOutputCommit(repositoryCommit *registryv1alpha1.RepositoryCommit) outputRepositoryCommit { - return outputRepositoryCommit{ - ID: repositoryCommit.Id, - Commit: repositoryCommit.Name, - Tags: registryTagsToOutputTags(repositoryCommit.Tags), - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_draft_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_draft_printer.go deleted file mode 100644 index 55a8a538ed..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_draft_printer.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type repositoryDraftPrinter struct { - writer io.Writer -} - -func newRepositoryDraftPrinter( - writer io.Writer, -) *repositoryDraftPrinter { - return &repositoryDraftPrinter{ - writer: writer, - } -} - -type outputRepositoryDraft struct { - Name string `json:"name,omitempty"` - Commit string `json:"commit,omitempty"` -} - -func (p *repositoryDraftPrinter) PrintRepositoryDraft(ctx context.Context, format Format, message *registryv1alpha1.RepositoryCommit) error { - outDraft := registryDraftToOutputDraft(message) - switch format { - case FormatText: - return p.printRepositoryDraftsText([]outputRepositoryDraft{outDraft}) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(outDraft) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryDraftPrinter) PrintRepositoryDrafts(ctx context.Context, format Format, nextPageToken string, messages ...*registryv1alpha1.RepositoryCommit) error { - if len(messages) == 0 { - return nil - } - var outputRepositoryDrafs []outputRepositoryDraft - for _, repositoryCommit := range messages { - outputDraft := registryDraftToOutputDraft(repositoryCommit) - outputRepositoryDrafs = append(outputRepositoryDrafs, outputDraft) - } - switch format { - case FormatText: - return p.printRepositoryDraftsText(outputRepositoryDrafs) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputRepositoryDrafs, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryDraftPrinter) printRepositoryDraftsText(outputRepositoryDrafts []outputRepositoryDraft) error { - return WithTabWriter( - p.writer, - []string{ - "Name", - "Commit", - }, - func(tabWriter TabWriter) error { - for _, draft := range outputRepositoryDrafts { - if err := tabWriter.Write( - draft.Name, - draft.Commit, - ); err != nil { - return err - } - } - return nil - }, - ) -} - -func registryDraftToOutputDraft(repositoryCommit *registryv1alpha1.RepositoryCommit) outputRepositoryDraft { - return outputRepositoryDraft{ - Name: repositoryCommit.DraftName, - Commit: repositoryCommit.Name, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_printer.go deleted file mode 100644 index 205196ca31..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_printer.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - "time" - - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" -) - -type repositoryPrinter struct { - clientConfig *connectclient.Config - address string - writer io.Writer -} - -func newRepositoryPrinter( - clientConfig *connectclient.Config, - address string, - writer io.Writer, -) *repositoryPrinter { - return &repositoryPrinter{ - clientConfig: clientConfig, - address: address, - writer: writer, - } -} - -func (p *repositoryPrinter) PrintRepository(ctx context.Context, format Format, message *registryv1alpha1.Repository) error { - outputRepositories, err := p.registryRepositoriesToOutRepositories(ctx, message) - if err != nil { - return err - } - if len(outputRepositories) != 1 { - return fmt.Errorf("error converting repositories: expected 1 got %d", len(outputRepositories)) - } - switch format { - case FormatText: - return p.printRepositoriesText(outputRepositories) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(outputRepositories[0]) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryPrinter) PrintRepositories(ctx context.Context, format Format, nextPageToken string, messages ...*registryv1alpha1.Repository) error { - if len(messages) == 0 { - return nil - } - outputRepositories, err := p.registryRepositoriesToOutRepositories(ctx, messages...) - if err != nil { - return err - } - switch format { - case FormatText: - return p.printRepositoriesText(outputRepositories) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputRepositories, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryPrinter) registryRepositoriesToOutRepositories(ctx context.Context, messages ...*registryv1alpha1.Repository) ([]outputRepository, error) { - var outputRepositories []outputRepository - for _, repository := range messages { - var ownerName string - switch owner := repository.Owner.(type) { - case *registryv1alpha1.Repository_OrganizationId: - organizationService := connectclient.Make(p.clientConfig, p.address, registryv1alpha1connect.NewOrganizationServiceClient) - resp, err := organizationService.GetOrganization( - ctx, - connect.NewRequest(®istryv1alpha1.GetOrganizationRequest{ - Id: owner.OrganizationId, - }), - ) - if err != nil { - return nil, err - } - ownerName = resp.Msg.Organization.Name - case *registryv1alpha1.Repository_UserId: - userService := connectclient.Make(p.clientConfig, p.address, registryv1alpha1connect.NewUserServiceClient) - resp, err := userService.GetUser( - ctx, - connect.NewRequest(®istryv1alpha1.GetUserRequest{ - Id: owner.UserId, - }), - ) - if err != nil { - return nil, err - } - ownerName = resp.Msg.User.Username - default: - return nil, fmt.Errorf("unknown owner: %T", owner) - } - outputRepository := outputRepository{ - ID: repository.Id, - Remote: p.address, - Owner: ownerName, - Name: repository.Name, - CreateTime: repository.CreateTime.AsTime(), - } - outputRepositories = append(outputRepositories, outputRepository) - } - return outputRepositories, nil -} - -func (p *repositoryPrinter) printRepositoriesText(outputRepositories []outputRepository) error { - return WithTabWriter( - p.writer, - []string{ - "Full name", - "Created", - }, - func(tabWriter TabWriter) error { - for _, outputRepository := range outputRepositories { - if err := tabWriter.Write( - outputRepository.Remote+"/"+outputRepository.Owner+"/"+outputRepository.Name, - outputRepository.CreateTime.Format(time.RFC3339), - ); err != nil { - return err - } - } - return nil - }, - ) -} - -type outputRepository struct { - ID string `json:"id,omitempty"` - Remote string `json:"remote,omitempty"` - Owner string `json:"owner,omitempty"` - Name string `json:"name,omitempty"` - CreateTime time.Time `json:"create_time,omitempty"` -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_tag_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_tag_printer.go deleted file mode 100644 index 0d8c3e7aeb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/repository_tag_printer.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - "time" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type repositoryTagPrinter struct { - writer io.Writer -} - -func newRepositoryTagPrinter( - writer io.Writer, -) *repositoryTagPrinter { - return &repositoryTagPrinter{ - writer: writer, - } -} - -func (p *repositoryTagPrinter) PrintRepositoryTag(ctx context.Context, format Format, message *registryv1alpha1.RepositoryTag) error { - outRepositoryTag := registryTagToOutputTag(message) - switch format { - case FormatText: - return p.printRepositoryTagsText([]outputRepositoryTag{outRepositoryTag}) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(outRepositoryTag) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryTagPrinter) PrintRepositoryTags(ctx context.Context, format Format, nextPageToken string, messages ...*registryv1alpha1.RepositoryTag) error { - if len(messages) == 0 { - return nil - } - outputRepositoryTags := registryTagsToOutputTags(messages) - switch format { - case FormatText: - return p.printRepositoryTagsText(outputRepositoryTags) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(paginationWrapper{ - NextPage: nextPageToken, - Results: outputRepositoryTags, - }) - default: - return fmt.Errorf("unknown format: %v", format) - } -} - -func (p *repositoryTagPrinter) printRepositoryTagsText(outputRepositoryTags []outputRepositoryTag) error { - return WithTabWriter( - p.writer, - []string{ - "Name", - "Commit", - "Created", - }, - func(tabWriter TabWriter) error { - for _, outputRepositoryTag := range outputRepositoryTags { - if err := tabWriter.Write( - outputRepositoryTag.Name, - outputRepositoryTag.Commit, - outputRepositoryTag.CreateTime.Format(time.RFC3339), - ); err != nil { - return err - } - } - return nil - }, - ) -} - -type outputRepositoryTag struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Commit string `json:"commit,omitempty"` - CreateTime time.Time `json:"create_time,omitempty"` -} - -func registryTagToOutputTag(repositoryTag *registryv1alpha1.RepositoryTag) outputRepositoryTag { - return outputRepositoryTag{ - Name: repositoryTag.Name, - Commit: repositoryTag.CommitName, - CreateTime: repositoryTag.CreateTime.AsTime(), - } -} - -func registryTagsToOutputTags(tags []*registryv1alpha1.RepositoryTag) []outputRepositoryTag { - outputRepositoryTags := make([]outputRepositoryTag, len(tags)) - for i, repositoryTag := range tags { - outputRepositoryTags[i] = registryTagToOutputTag(repositoryTag) - } - return outputRepositoryTags -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/stats_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/stats_printer.go deleted file mode 100644 index a2aaa19564..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/stats_printer.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "encoding/json" - "fmt" - "io" - "strconv" - - "github.com/bufbuild/buf/private/pkg/protostat" -) - -type statsPrinter struct { - writer io.Writer -} - -func newStatsPrinter(writer io.Writer) *statsPrinter { - return &statsPrinter{ - writer: writer, - } -} - -func (p *statsPrinter) PrintStats(ctx context.Context, format Format, stats *protostat.Stats) error { - switch format { - case FormatText: - return WithTabWriter( - p.writer, - []string{ - "Files", - "Packages", - "Messages", - "Fields", - "Enums", - "Enum Values", - "Extensions", - "Services", - "Methods", - "Files With Errors", - }, - func(tabWriter TabWriter) error { - return tabWriter.Write( - strconv.Itoa(stats.NumFiles), - strconv.Itoa(stats.NumPackages), - strconv.Itoa(stats.NumMessages), - strconv.Itoa(stats.NumFields), - strconv.Itoa(stats.NumEnums), - strconv.Itoa(stats.NumEnumValues), - strconv.Itoa(stats.NumExtensions), - strconv.Itoa(stats.NumServices), - strconv.Itoa(stats.NumMethods), - strconv.Itoa(stats.NumFilesWithSyntaxErrors), - ) - }, - ) - case FormatJSON: - return json.NewEncoder(p.writer).Encode(stats) - default: - return fmt.Errorf("unknown format: %v", format) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/tab_writer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/tab_writer.go deleted file mode 100644 index 70fd6dec63..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/tab_writer.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "io" - "strings" - "text/tabwriter" -) - -type tabWriter struct { - delegate *tabwriter.Writer -} - -func newTabWriter(writer io.Writer) *tabWriter { - return &tabWriter{ - delegate: tabwriter.NewWriter(writer, 0, 0, 2, ' ', 0), - } -} - -func (t *tabWriter) Write(values ...string) error { - if len(values) == 0 { - return nil - } - _, err := t.delegate.Write([]byte(strings.Join(values, "\t") + "\n")) - return err -} - -func (t *tabWriter) Flush() error { - return t.delegate.Flush() -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_json_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_json_printer.go deleted file mode 100644 index b0044e1eac..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_json_printer.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "io" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type tokenJSONPrinter struct { - writer io.Writer -} - -func newTokenJSONPrinter(writer io.Writer) *tokenJSONPrinter { - return &tokenJSONPrinter{ - writer: writer, - } -} - -func (p *tokenJSONPrinter) PrintTokens( - ctx context.Context, - tokens ...*registryv1alpha1.Token, -) error { - for _, token := range tokens { - if err := printProtoMessageJSON(p.writer, token); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_text_printer.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_text_printer.go deleted file mode 100644 index 8d3d24e86a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/token_text_printer.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufprint - -import ( - "context" - "io" - "time" - - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -type tokenTextPrinter struct { - writer io.Writer -} - -func newTokenTextPrinter(writer io.Writer) *tokenTextPrinter { - return &tokenTextPrinter{ - writer: writer, - } -} - -func (p *tokenTextPrinter) PrintTokens(ctx context.Context, tokens ...*registryv1alpha1.Token) error { - if len(tokens) == 0 { - return nil - } - return WithTabWriter( - p.writer, - []string{ - "ID", - "Note", - "Create time", - "Expire time", - }, - func(tabWriter TabWriter) error { - for _, token := range tokens { - if err := tabWriter.Write( - token.Id, - token.Note, - token.CreateTime.AsTime().Format(time.RFC3339), - token.ExpireTime.AsTime().Format(time.RFC3339), - ); err != nil { - return err - } - } - return nil - }, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufprint/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufprint/usage.gen.go deleted file mode 100644 index 64a02337bd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufprint/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufprint - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufref/bufref.go b/vendor/github.com/bufbuild/buf/private/buf/bufref/bufref.go deleted file mode 100644 index ee4e7aae53..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufref/bufref.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufref - -import ( - "strings" -) - -// GetRawPathAndOptions returns the raw path and options from the value provided, -// the rawPath will be non-empty when returning without error here. -func GetRawPathAndOptions(value string) (string, map[string]string, error) { - value = strings.TrimSpace(value) - if value == "" { - return "", nil, newValueEmptyError() - } - - switch splitValue := strings.Split(value, "#"); len(splitValue) { - case 1: - return value, nil, nil - case 2: - path := strings.TrimSpace(splitValue[0]) - optionsString := strings.TrimSpace(splitValue[1]) - if path == "" { - return "", nil, newValueStartsWithHashtagError(value) - } - if optionsString == "" { - return "", nil, newValueEndsWithHashtagError(value) - } - options := make(map[string]string) - for _, pair := range strings.Split(optionsString, ",") { - split := strings.Split(pair, "=") - if len(split) != 2 { - return "", nil, newOptionsInvalidError(optionsString) - } - key := strings.TrimSpace(split[0]) - value := strings.TrimSpace(split[1]) - if key == "" || value == "" { - return "", nil, newOptionsInvalidError(optionsString) - } - if _, ok := options[key]; ok { - return "", nil, newOptionsDuplicateKeyError(key) - } - options[key] = value - } - return path, options, nil - default: - return "", nil, newValueMultipleHashtagsError(value) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufref/errors.go b/vendor/github.com/bufbuild/buf/private/buf/bufref/errors.go deleted file mode 100644 index 6eabfc9fc2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufref/errors.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufref - -import ( - "errors" - "fmt" -) - -func newValueEmptyError() error { - return errors.New("required") -} - -func newValueMultipleHashtagsError(value string) error { - return fmt.Errorf("%q has multiple #s which is invalid", value) -} - -func newValueStartsWithHashtagError(value string) error { - return fmt.Errorf("%q starts with # which is invalid", value) -} - -func newValueEndsWithHashtagError(value string) error { - return fmt.Errorf("%q ends with # which is invalid", value) -} - -func newOptionsInvalidError(s string) error { - return fmt.Errorf("invalid options: %q", s) -} - -func newOptionsDuplicateKeyError(key string) error { - return fmt.Errorf("duplicate options key: %q", key) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufref/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufref/usage.gen.go deleted file mode 100644 index d5fbc2021b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufref/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufref - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufsync/bufsync.go b/vendor/github.com/bufbuild/buf/private/buf/bufsync/bufsync.go deleted file mode 100644 index 7734809fff..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufsync/bufsync.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufsync - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagegit" - "go.uber.org/zap" -) - -// ErrorHandler handles errors reported by the Syncer. If a non-nil -// error is returned by the handler, sync will abort in a partially-synced -// state. -type ErrorHandler interface { - // InvalidModuleConfig is invoked by Syncer upon encountering a module - // with an invalid module config. - // - // Returning an error will abort sync. - InvalidModuleConfig( - module Module, - commit git.Commit, - err error, - ) error - // BuildFailure is invoked by Syncer upon encountering a module that fails - // build. - // - // Returning an error will abort sync. - BuildFailure( - module Module, - commit git.Commit, - err error, - ) error - // InvalidSyncPoint is invoked by Syncer upon encountering a module's branch - // sync point that is invalid. A typical example is either a sync point that - // point to a commit that cannot be found anymore, or the commit itself has - // been corrupted. - // - // Returning an error will abort sync. - InvalidSyncPoint( - module Module, - branch string, - syncPoint git.Hash, - err error, - ) error - // SyncPointNotEncountered is invoked by Syncer upon syncing a module on a - // branch where a sync point was resolved and validated, but was not - // encountered during sync. - // - // Returning an error will abort sync. - SyncPointNotEncountered( - module Module, - branch string, - syncPoint git.Hash, - ) error -} - -// Module is a module that will be synced by Syncer. -type Module interface { - // Dir is the path to the module relative to the repository root. - Dir() string - // RemoteIdentity is the identity of the remote module that the - // local module is synced to. - RemoteIdentity() bufmoduleref.ModuleIdentity - // String is the string representation of this module. - String() string -} - -// NewModule constructs a new module that can be synced with a Syncer. -func NewModule(dir string, identityOverride bufmoduleref.ModuleIdentity) (Module, error) { - return newSyncableModule( - dir, - identityOverride, - ) -} - -// Syncer syncs a modules in a git.Repository. -type Syncer interface { - // Sync syncs the repository using the provided SyncFunc. It processes - // commits in reverse topological order, loads any configured named - // modules, extracts any Git metadata for that commit, and invokes - // SyncFunc with a ModuleCommit. - // - // Only commits/branches belonging to the remote named 'origin' are - // processed. All tags are processed. - Sync(context.Context, SyncFunc) error -} - -// NewSyncer creates a new Syncer. -func NewSyncer( - logger *zap.Logger, - repo git.Repository, - storageGitProvider storagegit.Provider, - errorHandler ErrorHandler, - options ...SyncerOption, -) (Syncer, error) { - return newSyncer( - logger, - repo, - storageGitProvider, - errorHandler, - options..., - ) -} - -// SyncerOption configures the creation of a new Syncer. -type SyncerOption func(*syncer) error - -// SyncerWithModule configures a Syncer to sync the specified module. -// -// This option can be provided multiple times to sync multiple distinct modules. -func SyncerWithModule(module Module) SyncerOption { - return func(s *syncer) error { - for _, existingModule := range s.modulesToSync { - if existingModule.String() == module.String() { - return fmt.Errorf("duplicate module %s", module) - } - } - s.modulesToSync = append(s.modulesToSync, module) - return nil - } -} - -// SyncerWithResumption configures a Syncer with a resumption using a SyncPointResolver. -func SyncerWithResumption(resolver SyncPointResolver) SyncerOption { - return func(s *syncer) error { - s.syncPointResolver = resolver - return nil - } -} - -// SyncFunc is invoked by Syncer to process a sync point. If an error is returned, -// sync will abort. -type SyncFunc func(ctx context.Context, commit ModuleCommit) error - -// SyncPointResolver is invoked by Syncer to resolve a syncpoint for a particular module -// at a particular branch. If no syncpoint is found, this function returns nil. If an error -// is returned, sync will abort. -type SyncPointResolver func( - ctx context.Context, - identity bufmoduleref.ModuleIdentity, - branch string, -) (git.Hash, error) - -// ModuleCommit is a module at a particular commit. -type ModuleCommit interface { - // Identity is the identity of the module, accounting for any configured override. - Identity() bufmoduleref.ModuleIdentity - // Bucket is the bucket for the module. - Bucket() storage.ReadBucket - // Commit is the commit that the module is sourced from. - Commit() git.Commit - // Branch is the git branch that this module is sourced from. - Branch() string - // Tags are the git tags associated with Commit. - Tags() []string -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufsync/module_commit.go b/vendor/github.com/bufbuild/buf/private/buf/bufsync/module_commit.go deleted file mode 100644 index dc353270f3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufsync/module_commit.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufsync - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type moduleCommit struct { - identity bufmoduleref.ModuleIdentity - bucket storage.ReadBucket - commit git.Commit - branch string - tags []string -} - -func newModuleCommit( - identity bufmoduleref.ModuleIdentity, - bucket storage.ReadBucket, - commit git.Commit, - branch string, - tags []string, -) ModuleCommit { - return &moduleCommit{ - identity: identity, - bucket: bucket, - commit: commit, - branch: branch, - tags: tags, - } -} - -func (m *moduleCommit) Identity() bufmoduleref.ModuleIdentity { - return m.identity -} - -func (m *moduleCommit) Bucket() storage.ReadBucket { - return m.bucket -} - -func (m *moduleCommit) Commit() git.Commit { - return m.commit -} - -func (m *moduleCommit) Branch() string { - return m.branch -} - -func (m *moduleCommit) Tags() []string { - return m.tags -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncable_module.go b/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncable_module.go deleted file mode 100644 index 270fa8e04c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncable_module.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufsync - -import ( - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -type syncableModule struct { - dir string - remoteIdentity bufmoduleref.ModuleIdentity - formatted string -} - -func newSyncableModule( - dir string, - remoteIdentity bufmoduleref.ModuleIdentity, -) (Module, error) { - normalized, err := normalpath.NormalizeAndValidate(dir) - if err != nil { - return nil, err - } - return &syncableModule{ - dir: normalized, - remoteIdentity: remoteIdentity, - formatted: fmt.Sprintf("%s:%s", dir, remoteIdentity.IdentityString()), - }, nil -} - -func (s *syncableModule) Dir() string { - return s.dir -} - -func (s *syncableModule) RemoteIdentity() bufmoduleref.ModuleIdentity { - return s.remoteIdentity -} - -func (s *syncableModule) String() string { - return s.formatted -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncer.go b/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncer.go deleted file mode 100644 index 1390e2b8f5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufsync/syncer.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufsync - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagegit" - "go.uber.org/zap" -) - -type syncer struct { - logger *zap.Logger - repo git.Repository - storageGitProvider storagegit.Provider - errorHandler ErrorHandler - modulesToSync []Module - syncPointResolver SyncPointResolver - - knownTagsByCommitHash map[string][]string -} - -func newSyncer( - logger *zap.Logger, - repo git.Repository, - storageGitProvider storagegit.Provider, - errorHandler ErrorHandler, - options ...SyncerOption, -) (Syncer, error) { - s := &syncer{ - logger: logger, - repo: repo, - storageGitProvider: storageGitProvider, - } - for _, opt := range options { - if err := opt(s); err != nil { - return nil, err - } - } - return s, nil -} - -// resolveSyncPoints resolves sync points for all known modules for the specified branch, -// returning all modules for which sync points were found, along with their sync points. -// -// If a SyncPointResolver is not configured, this returns an empty map immediately. -func (s *syncer) resolveSyncPoints(ctx context.Context, branch string) (map[Module]git.Hash, error) { - syncPoints := map[Module]git.Hash{} - // If resumption is not enabled, we can bail early. - if s.syncPointResolver == nil { - return syncPoints, nil - } - for _, module := range s.modulesToSync { - syncPoint, err := s.resolveSyncPoint(ctx, module, branch) - if err != nil { - return nil, err - } - if syncPoint != nil { - s.logger.Debug( - "resolved sync point, will sync after this commit", - zap.String("branch", branch), - zap.Stringer("module", module), - zap.Stringer("syncPoint", syncPoint), - ) - syncPoints[module] = syncPoint - } else { - s.logger.Debug( - "no sync point, syncing from the beginning", - zap.String("branch", branch), - zap.Stringer("module", module), - ) - } - } - return syncPoints, nil -} - -// resolveSyncPoint resolves a sync point for a particular module and branch. It assumes -// that a SyncPointResolver is configured. -func (s *syncer) resolveSyncPoint(ctx context.Context, module Module, branch string) (git.Hash, error) { - syncPoint, err := s.syncPointResolver(ctx, module.RemoteIdentity(), branch) - if err != nil { - return nil, fmt.Errorf("resolve syncPoint for module %s: %w", module.RemoteIdentity(), err) - } - if syncPoint == nil { - return nil, nil - } - // Validate that the commit pointed to by the sync point exists. - if _, err := s.repo.Objects().Commit(syncPoint); err != nil { - return nil, s.errorHandler.InvalidSyncPoint(module, branch, syncPoint, err) - } - return syncPoint, nil -} - -func (s *syncer) Sync(ctx context.Context, syncFunc SyncFunc) error { - s.knownTagsByCommitHash = map[string][]string{} - if err := s.repo.ForEachTag(func(tag string, commitHash git.Hash) error { - s.knownTagsByCommitHash[commitHash.Hex()] = append(s.knownTagsByCommitHash[commitHash.Hex()], tag) - return nil - }); err != nil { - return fmt.Errorf("load tags: %w", err) - } - // TODO: sync other branches - for _, branch := range []string{s.repo.BaseBranch()} { - syncPoints, err := s.resolveSyncPoints(ctx, branch) - if err != nil { - return err - } - // We sync all modules in a commit before advancing to the next commit so that - // inter-module dependencies across commits can be resolved. - if err := s.repo.ForEachCommit(branch, func(commit git.Commit) error { - for _, module := range s.modulesToSync { - if syncPoint := syncPoints[module]; syncPoint != nil { - // This module has a sync point. We need to check if we've encountered the sync point. - if syncPoint.Hex() == commit.Hash().Hex() { - // We have found the syncPoint! We can resume syncing _after_ this point. - delete(syncPoints, module) - s.logger.Debug( - "syncPoint encountered, skipping commit", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - zap.Stringer("syncPoint", syncPoint), - ) - } else { - // We have not encountered the syncPoint yet. Skip this commit and keep looking - // for the syncPoint. - s.logger.Debug( - "syncPoint not encountered, skipping commit", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - zap.Stringer("syncPoint", syncPoint), - ) - } - continue - } - if err := s.visitCommit(ctx, module, branch, commit, syncFunc); err != nil { - return fmt.Errorf("process commit %s (%s): %w", commit.Hash().Hex(), branch, err) - } - } - return nil - }); err != nil { - return fmt.Errorf("process commits: %w", err) - } - // If we have any sync points left, they were not encountered during sync, which is unexpected behavior. - for module, syncPoint := range syncPoints { - if err := s.errorHandler.SyncPointNotEncountered(module, branch, syncPoint); err != nil { - return err - } - } - } - return nil -} - -// visitCommit looks for the module in the commit, and if found tries to validate it. -// If it is valid, it invokes `syncFunc`. -// -// It does not return errors on invalid modules, but it will return any errors from -// `syncFunc` as those may be transient. -func (s *syncer) visitCommit( - ctx context.Context, - module Module, - branch string, - commit git.Commit, - syncFunc SyncFunc, -) error { - sourceBucket, err := s.storageGitProvider.NewReadBucket( - commit.Tree(), - storagegit.ReadBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - sourceBucket = storage.MapReadBucket(sourceBucket, storage.MapOnPrefix(module.Dir())) - foundModule, err := bufconfig.ExistingConfigFilePath(ctx, sourceBucket) - if err != nil { - return err - } - if foundModule == "" { - // We did not find a module. Carry on to the next commit. - s.logger.Debug( - "module not found, skipping commit", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - ) - return nil - } - sourceConfig, err := bufconfig.GetConfigForBucket(ctx, sourceBucket) - if err != nil { - return s.errorHandler.InvalidModuleConfig(module, commit, err) - } - if sourceConfig.ModuleIdentity == nil { - // Unnamed module. Carry on. - s.logger.Debug( - "unnamed module, skipping commit", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - ) - return nil - } - builtModule, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - sourceBucket, - sourceConfig.Build, - ) - if err != nil { - return s.errorHandler.BuildFailure(module, commit, err) - } - return syncFunc( - ctx, - newModuleCommit( - module.RemoteIdentity(), - builtModule.Bucket, - commit, - branch, - s.knownTagsByCommitHash[commit.Hash().Hex()], - ), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufsync/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufsync/usage.gen.go deleted file mode 100644 index c4e76bb5ed..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufsync/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufsync - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/bufwire.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/bufwire.go deleted file mode 100644 index 003d3a2c76..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/bufwire.go +++ /dev/null @@ -1,255 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufwire wires everything together. -// -// TODO: This package should be split up into individual functionality. -package bufwire - -import ( - "context" - - "github.com/bufbuild/buf/private/buf/bufconvert" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" -) - -// ImageConfig is an image and configuration. -type ImageConfig interface { - Image() bufimage.Image - Config() *bufconfig.Config -} - -// ImageConfigReader is an ImageConfig reader. -type ImageConfigReader interface { - // GetImageConfigs gets the ImageConfig for the fetch value. - // - // If externalDirOrFilePaths is empty, this builds all files under Buf control. - GetImageConfigs( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, - ) ([]ImageConfig, []bufanalysis.FileAnnotation, error) -} - -// NewImageConfigReader returns a new ImageConfigReader. -func NewImageConfigReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, - imageBuilder bufimagebuild.Builder, -) ImageConfigReader { - return newImageConfigReader( - logger, - storageosProvider, - fetchReader, - moduleBucketBuilder, - imageBuilder, - ) -} - -// ModuleConfig is a Module and configuration. -type ModuleConfig interface { - Module() bufmodule.Module - Config() *bufconfig.Config -} - -// ModuleConfigSet is a set of ModuleConfigs with a potentially associated Workspace. -type ModuleConfigSet interface { - ModuleConfigs() []ModuleConfig - // Optional. May be nil. - Workspace() bufmodule.Workspace -} - -// ModuleConfigReader is a ModuleConfig reader. -type ModuleConfigReader interface { - // GetModuleConfigSet gets the ModuleConfigSet for the fetch value. - // - // If externalDirOrFilePaths is empty, this builds all files under Buf control. - // - // Note that as opposed to ModuleReader, this will return Modules for either - // a source or module reference, not just a module reference. - GetModuleConfigSet( - ctx context.Context, - container app.EnvStdinContainer, - sourceOrModuleRef buffetch.SourceOrModuleRef, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - ) (ModuleConfigSet, error) -} - -// NewModuleConfigReader returns a new ModuleConfigReader -func NewModuleConfigReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, -) ModuleConfigReader { - return newModuleConfigReader( - logger, - storageosProvider, - fetchReader, - moduleBucketBuilder, - ) -} - -// FileLister lists files. -type FileLister interface { - // ListFiles lists the files. - // - // If includeImports is set, the ref is built, which can result in FileAnnotations. - // There is no defined returned sorting order. If you need the FileInfos to - // be sorted, do so with bufmoduleref.SortFileInfos or bufmoduleref.SortFileInfosByExternalPath. - ListFiles( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, - includeImports bool, - ) ([]bufmoduleref.FileInfo, []bufanalysis.FileAnnotation, error) -} - -// NewFileLister returns a new FileLister. -func NewFileLister( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, - imageBuilder bufimagebuild.Builder, -) FileLister { - return newFileLister( - logger, - storageosProvider, - fetchReader, - moduleBucketBuilder, - imageBuilder, - ) -} - -// ImageReader is an image reader. -type ImageReader interface { - // GetImage reads the image from the value. - GetImage( - ctx context.Context, - container app.EnvStdinContainer, - imageRef buffetch.ImageRef, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, - ) (bufimage.Image, error) -} - -// NewImageReader returns a new ImageReader. -func NewImageReader( - logger *zap.Logger, - fetchReader buffetch.ImageReader, -) ImageReader { - return newImageReader( - logger, - fetchReader, - ) -} - -// ImageWriter is an image writer. -type ImageWriter interface { - // PutImage writes the image to the value. - // - // The file must be an image format. - // This is a no-np if value is the equivalent of /dev/null. - PutImage( - ctx context.Context, - container app.EnvStdoutContainer, - imageRef buffetch.ImageRef, - image bufimage.Image, - asFileDescriptorSet bool, - excludeImports bool, - ) error -} - -// NewImageWriter returns a new ImageWriter. -func NewImageWriter( - logger *zap.Logger, - fetchWriter buffetch.Writer, -) ImageWriter { - return newImageWriter( - logger, - fetchWriter, - ) -} - -// ProtoEncodingReader is a reader that reads a protobuf message in different encoding. -type ProtoEncodingReader interface { - // GetMessage reads the message by the messageRef. - // - // Currently, this support bin and JSON format. - GetMessage( - ctx context.Context, - container app.EnvStdinContainer, - image bufimage.Image, - typeName string, - messageRef bufconvert.MessageEncodingRef, - ) (proto.Message, error) -} - -// NewProtoEncodingReader returns a new ProtoEncodingReader. -func NewProtoEncodingReader( - logger *zap.Logger, -) ProtoEncodingReader { - return newProtoEncodingReader( - logger, - ) -} - -// ProtoEncodingWriter is a writer that writes a protobuf message in different encoding. -type ProtoEncodingWriter interface { - // PutMessage writes the message to the path, which can be - // a path in file system, or stdout represented by "-". - // - // Currently, this support bin and JSON format. - PutMessage( - ctx context.Context, - container app.EnvStdoutContainer, - image bufimage.Image, - message proto.Message, - messageRef bufconvert.MessageEncodingRef, - ) error -} - -// NewProtoEncodingWriter returns a new ProtoEncodingWriter. -func NewProtoEncodingWriter( - logger *zap.Logger, -) ProtoEncodingWriter { - return newProtoEncodingWriter( - logger, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/file_lister.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/file_lister.go deleted file mode 100644 index 7e8cee376b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/file_lister.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufwork" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type fileLister struct { - logger *zap.Logger - fetchReader buffetch.Reader - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder - imageBuilder bufimagebuild.Builder - // imageReaders require ImageRefs, we only use this in the withoutImports flow - // the imageConfigReader is used when we need to build an image - imageReader *imageReader - imageConfigReader *imageConfigReader -} - -func newFileLister( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, - imageBuilder bufimagebuild.Builder, -) *fileLister { - return &fileLister{ - logger: logger.Named("bufwire"), - fetchReader: fetchReader, - moduleBucketBuilder: moduleBucketBuilder, - imageBuilder: imageBuilder, - imageReader: newImageReader( - logger, - fetchReader, - ), - imageConfigReader: newImageConfigReader( - logger, - storageosProvider, - fetchReader, - moduleBucketBuilder, - imageBuilder, - ), - } -} - -func (e *fileLister) ListFiles( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, - includeImports bool, -) ([]bufmoduleref.FileInfo, []bufanalysis.FileAnnotation, error) { - if includeImports { - // To get imports, we need to build an image so we keep this flow separate and - // re-use the logic in imageConfigReader. - return e.listFilesWithImports( - ctx, - container, - ref, - configOverride, - ) - } - // We don't need to build in the withoutImports flow, so we just completely separate the logic - // to make sure the common case is as quick as it can be. - return e.listFilesWithoutImports( - ctx, - container, - ref, - configOverride, - ) -} - -func (e *fileLister) listFilesWithImports( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, -) ([]bufmoduleref.FileInfo, []bufanalysis.FileAnnotation, error) { - imageConfigs, fileAnnotations, err := e.imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - configOverride, - nil, - nil, - false, - true, - ) - if err != nil { - return nil, nil, err - } - if len(fileAnnotations) > 0 { - return nil, fileAnnotations, nil - } - images := make([]bufimage.Image, len(imageConfigs)) - for i, imageConfig := range imageConfigs { - images[i] = imageConfig.Image() - } - image, err := bufimage.MergeImages(images...) - if err != nil { - return nil, nil, err - } - imageFiles := image.Files() - fileInfos := make([]bufmoduleref.FileInfo, len(imageFiles)) - for i, imageFile := range imageFiles { - fileInfos[i] = imageFile - } - return fileInfos, nil, nil -} - -func (e *fileLister) listFilesWithoutImports( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, -) (_ []bufmoduleref.FileInfo, _ []bufanalysis.FileAnnotation, retErr error) { - switch t := ref.(type) { - case buffetch.ProtoFileRef: - imageConfigs, fileAnnotations, err := e.imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - configOverride, - nil, - nil, - false, - true, - ) - if err != nil { - return nil, nil, err - } - if len(fileAnnotations) > 0 { - return nil, fileAnnotations, nil - } - var fileInfos []bufmoduleref.FileInfo - // There should only be a single imageConfig compiled based on the proto file reference - // and the `include_package_files` option if set. These are handled by the imageConfigReader, - // we only need to collect the fileInfos here. - for _, imageConfig := range imageConfigs { - for _, imageFile := range imageConfig.Image().Files() { - if !imageFile.IsImport() { - fileInfos = append(fileInfos, imageFile) - } - } - } - return fileInfos, nil, nil - case buffetch.ImageRef: - // if we have an image, list the files in the image - image, err := e.imageReader.GetImage( - ctx, - container, - t, - nil, - nil, - false, - true, - ) - if err != nil { - return nil, nil, err - } - var fileInfos []bufmoduleref.FileInfo - for _, file := range image.Files() { - if !file.IsImport() { - fileInfos = append(fileInfos, file) - } - } - return fileInfos, nil, nil - case buffetch.SourceRef: - readBucketCloser, err := e.fetchReader.GetSourceBucket(ctx, container, t) - if err != nil { - return nil, nil, err - } - defer func() { - retErr = multierr.Append(retErr, readBucketCloser.Close()) - }() - existingConfigFilePath, err := bufwork.ExistingConfigFilePath(ctx, readBucketCloser) - if err != nil { - return nil, nil, err - } - if subDirPath := readBucketCloser.SubDirPath(); existingConfigFilePath == "" || subDirPath != "." { - fileInfos, err := e.sourceFileInfosForDirectory(ctx, readBucketCloser, subDirPath, configOverride) - if err != nil { - return nil, nil, err - } - return fileInfos, nil, nil - } - workspaceConfig, err := bufwork.GetConfigForBucket(ctx, readBucketCloser, readBucketCloser.RelativeRootPath()) - if err != nil { - return nil, nil, err - } - var allSourceFileInfos []bufmoduleref.FileInfo - for _, directory := range workspaceConfig.Directories { - sourceFileInfos, err := e.sourceFileInfosForDirectory(ctx, readBucketCloser, directory, configOverride) - if err != nil { - return nil, nil, err - } - allSourceFileInfos = append(allSourceFileInfos, sourceFileInfos...) - } - return allSourceFileInfos, nil, nil - case buffetch.ModuleRef: - module, err := e.fetchReader.GetModule(ctx, container, t) - if err != nil { - return nil, nil, err - } - fileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return nil, nil, err - } - return fileInfos, nil, nil - default: - return nil, nil, fmt.Errorf("invalid ref: %T", ref) - } -} - -// sourceFileInfosForDirectory returns the source file infos -// for the module defined in the given diretory of the read bucket. -func (e *fileLister) sourceFileInfosForDirectory( - ctx context.Context, - readBucket storage.ReadBucket, - directory string, - configOverride string, -) ([]bufmoduleref.FileInfo, error) { - mappedReadBucket := storage.MapReadBucket(readBucket, storage.MapOnPrefix(directory)) - config, err := bufconfig.ReadConfigOS( - ctx, - mappedReadBucket, - bufconfig.ReadConfigOSWithOverride(configOverride), - ) - if err != nil { - return nil, err - } - module, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - mappedReadBucket, - config.Build, - ) - if err != nil { - return nil, err - } - return module.SourceFileInfos(ctx) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config.go deleted file mode 100644 index 0aaceb0cf1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" -) - -type imageConfig struct { - image bufimage.Image - config *bufconfig.Config -} - -func newImageConfig(image bufimage.Image, config *bufconfig.Config) *imageConfig { - return &imageConfig{ - image: image, - config: config, - } -} - -func (i *imageConfig) Image() bufimage.Image { - return i.image -} - -func (i *imageConfig) Config() *bufconfig.Config { - return i.config -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config_reader.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config_reader.go deleted file mode 100644 index 26e6248129..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_config_reader.go +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -type imageConfigReader struct { - logger *zap.Logger - storageosProvider storageos.Provider - fetchReader buffetch.Reader - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder - imageBuilder bufimagebuild.Builder - moduleConfigReader *moduleConfigReader - imageReader *imageReader -} - -func newImageConfigReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, - imageBuilder bufimagebuild.Builder, -) *imageConfigReader { - return &imageConfigReader{ - logger: logger.Named("bufwire"), - storageosProvider: storageosProvider, - fetchReader: fetchReader, - moduleBucketBuilder: moduleBucketBuilder, - imageBuilder: imageBuilder, - moduleConfigReader: newModuleConfigReader( - logger, - storageosProvider, - fetchReader, - moduleBucketBuilder, - ), - imageReader: newImageReader( - logger, - fetchReader, - ), - } -} - -func (i *imageConfigReader) GetImageConfigs( - ctx context.Context, - container app.EnvStdinContainer, - ref buffetch.Ref, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, -) ([]ImageConfig, []bufanalysis.FileAnnotation, error) { - switch t := ref.(type) { - case buffetch.ImageRef: - env, err := i.getImageImageConfig( - ctx, - container, - t, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - excludeSourceCodeInfo, - ) - return []ImageConfig{env}, nil, err - case buffetch.SourceRef: - return i.getSourceOrModuleImageConfigs( - ctx, - container, - t, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - excludeSourceCodeInfo, - ) - case buffetch.ModuleRef: - return i.getSourceOrModuleImageConfigs( - ctx, - container, - t, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - excludeSourceCodeInfo, - ) - default: - return nil, nil, fmt.Errorf("invalid ref: %T", ref) - } -} - -func (i *imageConfigReader) getSourceOrModuleImageConfigs( - ctx context.Context, - container app.EnvStdinContainer, - sourceOrModuleRef buffetch.SourceOrModuleRef, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, -) ([]ImageConfig, []bufanalysis.FileAnnotation, error) { - moduleConfigSet, err := i.moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, nil, err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - imageConfigs := make([]ImageConfig, 0, len(moduleConfigs)) - var allFileAnnotations []bufanalysis.FileAnnotation - for _, moduleConfig := range moduleConfigs { - targetFileInfos, err := moduleConfig.Module().TargetFileInfos(ctx) - if err != nil { - return nil, nil, err - } - if len(targetFileInfos) == 0 { - // This Module doesn't have any targets, so we shouldn't build - // an image for it. - continue - } - buildOpts := []bufimagebuild.BuildOption{ - bufimagebuild.WithExpectedDirectDependencies(moduleConfig.Module().DeclaredDirectDependencies()), - bufimagebuild.WithWorkspace(moduleConfigSet.Workspace()), - } - if excludeSourceCodeInfo { - buildOpts = append(buildOpts, bufimagebuild.WithExcludeSourceCodeInfo()) - } - imageConfig, fileAnnotations, err := i.buildModule( - ctx, - moduleConfig.Config(), - moduleConfig.Module(), - buildOpts..., - ) - if err != nil { - return nil, nil, err - } - if imageConfig != nil { - imageConfigs = append(imageConfigs, imageConfig) - } - allFileAnnotations = append(allFileAnnotations, fileAnnotations...) - } - if len(allFileAnnotations) > 0 { - // Deduplicate and sort the file annotations again now that we've - // consolidated them across multiple images. - return nil, bufanalysis.DeduplicateAndSortFileAnnotations(allFileAnnotations), nil - } - if len(imageConfigs) == 0 { - return nil, nil, errors.New("no .proto target files found") - } - if protoFileRef, ok := sourceOrModuleRef.(buffetch.ProtoFileRef); ok { - imageConfigs, err = filterImageConfigs(imageConfigs, protoFileRef) - if err != nil { - return nil, nil, err - } - } - return imageConfigs, nil, nil -} - -func (i *imageConfigReader) getImageImageConfig( - ctx context.Context, - container app.EnvStdinContainer, - imageRef buffetch.ImageRef, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, -) (_ ImageConfig, retErr error) { - image, err := i.imageReader.GetImage( - ctx, - container, - imageRef, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - excludeSourceCodeInfo, - ) - if err != nil { - return nil, err - } - readWriteBucket, err := i.storageosProvider.NewReadWriteBucket( - ".", - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return nil, err - } - config, err := bufconfig.ReadConfigOS( - ctx, - readWriteBucket, - bufconfig.ReadConfigOSWithOverride(configOverride), - ) - if err != nil { - return nil, err - } - return newImageConfig(image, config), nil -} - -func (i *imageConfigReader) buildModule( - ctx context.Context, - config *bufconfig.Config, - module bufmodule.Module, - buildOpts ...bufimagebuild.BuildOption, -) (ImageConfig, []bufanalysis.FileAnnotation, error) { - image, fileAnnotations, err := i.imageBuilder.Build( - ctx, - module, - buildOpts..., - ) - if err != nil { - return nil, nil, err - } - if len(fileAnnotations) > 0 { - return nil, fileAnnotations, nil - } - return newImageConfig(image, config), nil, nil -} - -// filterImageConfigs takes in image configs and filters them based on the proto file ref. -// First, we get the package, path, and config for the file ref. And then we merge the images -// across the ImageConfigs, then filter them based on the paths for the package. -// -// The image merge is needed because if the `include_package_files=true` option is set, we -// need to gather all the files for the package, including files spread out across workspace -// directories, which would result in multiple image configs. -// -// As a reminder, with ProtoFileRefs, we actually return an Image that contains all the files -// in the same package as the referenced file. filterImageConfigs deals with an edge case where -// files from the same package are split across multiple Images, i.e. in a workspace. Obviously, -// this is bad Protobuf design, but this is possible. -// -// TODO: Make a function such as bufimage.MergeImagesWithOnlyPaths([]bufimage.Image, options) that -// takes an option that includes files within the package. Even better, create functions such that -// you can do bufimage.ImageWithOnlyPackages, bufimage.ImageWithOnlyPaths, and then reuse bufimage.MergeImage? -func filterImageConfigs(imageConfigs []ImageConfig, protoFileRef buffetch.ProtoFileRef) ([]ImageConfig, error) { - var pkg string - var path string - var config *bufconfig.Config - var images []bufimage.Image - for _, imageConfig := range imageConfigs { - for _, imageFile := range imageConfig.Image().Files() { - // TODO: Ideally, we have the path returned from PathForExternalPath, however for a protoFileRef, - // PathForExternalPath returns only ".", when matched on the exact path of the proto file - // provided as the ref. This is expected since `PathForExternalPath` is meant to return the relative - // path based on the reference, which in this case will always be a specific file. - if _, err := protoFileRef.PathForExternalPath(imageFile.ExternalPath()); err == nil { - pkg = imageFile.Proto().GetPackage() - path = imageFile.Path() - config = imageConfig.Config() - break - } - } - images = append(images, imageConfig.Image()) - } - if path == "" { - return nil, errors.New("did not find a matching image file for the ProtoFileRef") - } - image, err := bufimage.MergeImages(images...) - if err != nil { - return nil, err - } - // If include_package_files is set, we then need to go get the rest of the files for the package, - // and see comment on Godoc. Otherwise, we just return an image that contains the given file. - var paths []string - if protoFileRef.IncludePackageFiles() { - for _, imageFile := range image.Files() { - if imageFile.Proto().GetPackage() == pkg { - paths = append(paths, imageFile.Path()) - } - } - } else { - paths = []string{path} - } - prunedImage, err := bufimage.ImageWithOnlyPaths(image, paths, nil) - if err != nil { - return nil, err - } - return []ImageConfig{newImageConfig(prunedImage, config)}, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_reader.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_reader.go deleted file mode 100644 index 326a99016b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_reader.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "fmt" - "io" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -const ( - loggerName = "bufwire" - tracerName = "bufbuild/buf" -) - -type imageReader struct { - logger *zap.Logger - fetchReader buffetch.ImageReader - tracer trace.Tracer -} - -func newImageReader( - logger *zap.Logger, - fetchReader buffetch.ImageReader, -) *imageReader { - return &imageReader{ - logger: logger.Named(loggerName), - fetchReader: fetchReader, - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func (i *imageReader) GetImage( - ctx context.Context, - container app.EnvStdinContainer, - imageRef buffetch.ImageRef, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - excludeSourceCodeInfo bool, -) (_ bufimage.Image, retErr error) { - ctx, span := i.tracer.Start(ctx, "get_image") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - readCloser, err := i.fetchReader.GetImageFile(ctx, container, imageRef) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readCloser.Close()) - }() - data, err := io.ReadAll(readCloser) - if err != nil { - return nil, err - } - protoImage := &imagev1.Image{} - var imageFromProtoOptions []bufimage.NewImageForProtoOption - switch imageEncoding := imageRef.ImageEncoding(); imageEncoding { - // we have to double parse due to custom options - // See https://github.com/golang/protobuf/issues/1123 - // TODO: revisit - case buffetch.ImageEncodingBin: - _, span := i.tracer.Start(ctx, "wire_unmarshal") - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(data, protoImage); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - span.End() - return nil, fmt.Errorf("could not unmarshal image: %v", err) - } - span.End() - case buffetch.ImageEncodingJSON: - firstProtoImage := &imagev1.Image{} - _, span := i.tracer.Start(ctx, "first_json_unmarshal") - if err := protoencoding.NewJSONUnmarshaler(nil).Unmarshal(data, firstProtoImage); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - span.End() - return nil, fmt.Errorf("could not unmarshal image: %v", err) - } - // TODO right now, NewResolver sets AllowUnresolvable to true all the time - // we want to make this into a check, and we verify if we need this for the individual command - span.End() - _, newResolverSpan := i.tracer.Start(ctx, "new_resolver") - resolver, err := protoencoding.NewResolver( - bufimage.ProtoImageToFileDescriptors( - firstProtoImage, - )..., - ) - if err != nil { - newResolverSpan.RecordError(err) - newResolverSpan.SetStatus(codes.Error, err.Error()) - newResolverSpan.End() - return nil, err - } - newResolverSpan.End() - _, jsonUnmarshalSpan := i.tracer.Start(ctx, "second_json_unmarshal") - if err := protoencoding.NewJSONUnmarshaler(resolver).Unmarshal(data, protoImage); err != nil { - jsonUnmarshalSpan.RecordError(err) - jsonUnmarshalSpan.SetStatus(codes.Error, err.Error()) - jsonUnmarshalSpan.End() - return nil, fmt.Errorf("could not unmarshal image: %v", err) - } - jsonUnmarshalSpan.End() - // we've already re-parsed, by unmarshalling 2x above - imageFromProtoOptions = append(imageFromProtoOptions, bufimage.WithNoReparse()) - default: - return nil, fmt.Errorf("unknown image encoding: %v", imageEncoding) - } - if excludeSourceCodeInfo { - for _, fileDescriptorProto := range protoImage.File { - fileDescriptorProto.SourceCodeInfo = nil - } - } - image, err := bufimage.NewImageForProto(protoImage, imageFromProtoOptions...) - if err != nil { - return nil, err - } - if len(externalDirOrFilePaths) == 0 && len(externalExcludeDirOrFilePaths) == 0 { - return image, nil - } - imagePaths := make([]string, len(externalDirOrFilePaths)) - for i, externalDirOrFilePath := range externalDirOrFilePaths { - imagePath, err := imageRef.PathForExternalPath(externalDirOrFilePath) - if err != nil { - return nil, err - } - imagePaths[i] = imagePath - } - excludePaths := make([]string, len(externalExcludeDirOrFilePaths)) - for i, excludeDirOrFilePath := range externalExcludeDirOrFilePaths { - excludePath, err := imageRef.PathForExternalPath(excludeDirOrFilePath) - if err != nil { - return nil, err - } - excludePaths[i] = excludePath - } - if externalDirOrFilePathsAllowNotExist { - // externalDirOrFilePaths have to be targetPaths - return bufimage.ImageWithOnlyPathsAllowNotExist(image, imagePaths, excludePaths) - } - return bufimage.ImageWithOnlyPaths(image, imagePaths, excludePaths) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_writer.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_writer.go deleted file mode 100644 index 3d92db6851..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/image_writer.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" -) - -type imageWriter struct { - logger *zap.Logger - fetchWriter buffetch.Writer -} - -func newImageWriter( - logger *zap.Logger, - fetchWriter buffetch.Writer, -) *imageWriter { - return &imageWriter{ - logger: logger, - fetchWriter: fetchWriter, - } -} - -func (i *imageWriter) PutImage( - ctx context.Context, - container app.EnvStdoutContainer, - imageRef buffetch.ImageRef, - image bufimage.Image, - asFileDescriptorSet bool, - excludeImports bool, -) (retErr error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "put_image") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - // stop short for performance - if imageRef.IsNull() { - return nil - } - writeImage := image - if excludeImports { - writeImage = bufimage.ImageWithoutImports(image) - } - var message proto.Message - if asFileDescriptorSet { - message = bufimage.ImageToFileDescriptorSet(writeImage) - } else { - message = bufimage.ImageToProtoImage(writeImage) - } - data, err := i.imageMarshal(ctx, message, image, imageRef.ImageEncoding()) - if err != nil { - return err - } - writeCloser, err := i.fetchWriter.PutImageFile(ctx, container, imageRef) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, writeCloser.Close()) - }() - _, err = writeCloser.Write(data) - return err -} - -func (i *imageWriter) imageMarshal( - ctx context.Context, - message proto.Message, - image bufimage.Image, - imageEncoding buffetch.ImageEncoding, -) (_ []byte, retErr error) { - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "image_marshal") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - switch imageEncoding { - case buffetch.ImageEncodingBin: - return protoencoding.NewWireMarshaler().Marshal(message) - case buffetch.ImageEncodingJSON: - // TODO: verify that image is complete - resolver, err := protoencoding.NewResolver( - bufimage.ImageToFileDescriptors( - image, - )..., - ) - if err != nil { - return nil, err - } - return protoencoding.NewJSONMarshaler(resolver).Marshal(message) - default: - return nil, fmt.Errorf("unknown image encoding: %v", imageEncoding) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config.go deleted file mode 100644 index 37cc355769..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" -) - -type moduleConfig struct { - module bufmodule.Module - config *bufconfig.Config -} - -func newModuleConfig(module bufmodule.Module, config *bufconfig.Config) *moduleConfig { - return &moduleConfig{ - module: module, - config: config, - } -} - -func (m *moduleConfig) Module() bufmodule.Module { - return m.module -} - -func (m *moduleConfig) Config() *bufconfig.Config { - return m.config -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_reader.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_reader.go deleted file mode 100644 index 014fbd80da..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_reader.go +++ /dev/null @@ -1,680 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufwork" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type moduleConfigReader struct { - logger *zap.Logger - storageosProvider storageos.Provider - fetchReader buffetch.Reader - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder - tracer trace.Tracer -} - -func newModuleConfigReader( - logger *zap.Logger, - storageosProvider storageos.Provider, - fetchReader buffetch.Reader, - moduleBucketBuilder bufmodulebuild.ModuleBucketBuilder, -) *moduleConfigReader { - return &moduleConfigReader{ - logger: logger, - storageosProvider: storageosProvider, - fetchReader: fetchReader, - moduleBucketBuilder: moduleBucketBuilder, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - } -} - -func (m *moduleConfigReader) GetModuleConfigSet( - ctx context.Context, - container app.EnvStdinContainer, - sourceOrModuleRef buffetch.SourceOrModuleRef, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (_ ModuleConfigSet, retErr error) { - ctx, span := m.tracer.Start(ctx, "get_module_config") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - // We construct a new WorkspaceBuilder here so that the cache is only used for a single call. - workspaceBuilder := bufwork.NewWorkspaceBuilder() - switch t := sourceOrModuleRef.(type) { - case buffetch.ProtoFileRef: - return m.getProtoFileModuleSourceConfigSet( - ctx, - container, - t, - workspaceBuilder, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - case buffetch.SourceRef: - return m.getSourceModuleConfigSet( - ctx, - container, - t, - workspaceBuilder, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - case buffetch.ModuleRef: - moduleConfig, err := m.getModuleModuleConfig( - ctx, - container, - t, - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - return newModuleConfigSet( - []ModuleConfig{ - moduleConfig, - }, - nil, - ), nil - default: - return nil, fmt.Errorf("invalid ref: %T", sourceOrModuleRef) - } -} - -func (m *moduleConfigReader) getSourceModuleConfigSet( - ctx context.Context, - container app.EnvStdinContainer, - sourceRef buffetch.SourceRef, - workspaceBuilder bufwork.WorkspaceBuilder, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (_ ModuleConfigSet, retErr error) { - readBucketCloser, err := m.fetchReader.GetSourceBucket(ctx, container, sourceRef) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readBucketCloser.Close()) - }() - existingConfigFilePath, err := bufwork.ExistingConfigFilePath(ctx, readBucketCloser) - if err != nil { - return nil, err - } - if existingConfigFilePath != "" { - return m.getWorkspaceModuleConfigSet( - ctx, - sourceRef, - workspaceBuilder, - readBucketCloser, - readBucketCloser.RelativeRootPath(), - readBucketCloser.SubDirPath(), - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - } - moduleConfig, err := m.getSourceModuleConfig( - ctx, - sourceRef, - readBucketCloser, - readBucketCloser.RelativeRootPath(), - readBucketCloser.SubDirPath(), - configOverride, - workspaceBuilder, - nil, - nil, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - return newModuleConfigSet( - []ModuleConfig{ - moduleConfig, - }, - nil, - ), nil -} - -func (m *moduleConfigReader) getModuleModuleConfig( - ctx context.Context, - container app.EnvStdinContainer, - moduleRef buffetch.ModuleRef, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (_ ModuleConfig, retErr error) { - module, err := m.fetchReader.GetModule(ctx, container, moduleRef) - if err != nil { - return nil, err - } - if len(externalDirOrFilePaths) > 0 { - targetPaths := make([]string, len(externalDirOrFilePaths)) - for i, externalDirOrFilePath := range externalDirOrFilePaths { - targetPath, err := moduleRef.PathForExternalPath(externalDirOrFilePath) - if err != nil { - return nil, err - } - targetPaths[i] = targetPath - } - excludePaths := make([]string, len(externalExcludeDirOrFilePaths)) - for i, excludeDirOrFilePath := range externalExcludeDirOrFilePaths { - excludePath, err := moduleRef.PathForExternalPath(excludeDirOrFilePath) - if err != nil { - return nil, err - } - excludePaths[i] = excludePath - } - if externalDirOrFilePathsAllowNotExist { - module, err = bufmodule.ModuleWithTargetPathsAllowNotExist(module, targetPaths, excludePaths) - if err != nil { - return nil, err - } - } else { - module, err = bufmodule.ModuleWithTargetPaths(module, targetPaths, excludePaths) - if err != nil { - return nil, err - } - } - } - // TODO: we should read the config from the module when configuration - // is added to modules - readWriteBucket, err := m.storageosProvider.NewReadWriteBucket( - ".", - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return nil, err - } - config, err := bufconfig.ReadConfigOS( - ctx, - readWriteBucket, - bufconfig.ReadConfigOSWithOverride(configOverride), - ) - if err != nil { - return nil, err - } - return newModuleConfig(module, config), nil -} - -func (m *moduleConfigReader) getProtoFileModuleSourceConfigSet( - ctx context.Context, - container app.EnvStdinContainer, - protoFileRef buffetch.ProtoFileRef, - workspaceBuilder bufwork.WorkspaceBuilder, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (_ ModuleConfigSet, retErr error) { - readBucketCloser, err := m.fetchReader.GetSourceBucket(ctx, container, protoFileRef) - if err != nil { - return nil, err - } - workspaceConfigs := stringutil.SliceToMap(bufwork.AllConfigFilePaths) - moduleConfigs := stringutil.SliceToMap(bufconfig.AllConfigFilePaths) - terminateFileProvider := readBucketCloser.TerminateFileProvider() - var workspaceConfigDirectory string - var moduleConfigDirectory string - for _, terminateFile := range terminateFileProvider.GetTerminateFiles() { - if _, ok := workspaceConfigs[terminateFile.Name()]; ok { - workspaceConfigDirectory = terminateFile.Path() - continue - } - if _, ok := moduleConfigs[terminateFile.Name()]; ok { - moduleConfigDirectory = terminateFile.Path() - } - } - // If a workspace and module are both found, then we need to check of the module is within - // the workspace. If it is, we use the workspace. Otherwise, we use the module. - if workspaceConfigDirectory != "" { - if moduleConfigDirectory != "" { - relativePath, err := normalpath.Rel(workspaceConfigDirectory, moduleConfigDirectory) - if err != nil { - return nil, err - } - readBucketCloser.SetSubDirPath(normalpath.Normalize(relativePath)) - } else { - // If there are no module configs in the path to the workspace, we need to check whether or not - // proto file ref is contained within one of the workspace directories. - // If yes, we can set the `SubDirPath` for the bucket to the directory, to ensure we build all the - // dependencies for the directory. If not, then we will keep the `SubDirPath` as the working directory. - workspaceConfig, err := bufwork.GetConfigForBucket(ctx, readBucketCloser, readBucketCloser.RelativeRootPath()) - if err != nil { - return nil, err - } - for _, directory := range workspaceConfig.Directories { - if normalpath.EqualsOrContainsPath(directory, readBucketCloser.SubDirPath(), normalpath.Relative) { - readBucketCloser.SetSubDirPath(normalpath.Normalize(directory)) - break - } - } - } - return m.getWorkspaceModuleConfigSet( - ctx, - protoFileRef, - workspaceBuilder, - readBucketCloser, - readBucketCloser.RelativeRootPath(), - readBucketCloser.SubDirPath(), - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - } - moduleConfig, err := m.getSourceModuleConfig( - ctx, - protoFileRef, - readBucketCloser, - readBucketCloser.RelativeRootPath(), - readBucketCloser.SubDirPath(), - configOverride, - workspaceBuilder, - nil, - nil, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - return newModuleConfigSet( - []ModuleConfig{ - moduleConfig, - }, - nil, - ), nil -} - -func (m *moduleConfigReader) getWorkspaceModuleConfigSet( - ctx context.Context, - sourceRef buffetch.SourceRef, - workspaceBuilder bufwork.WorkspaceBuilder, - readBucket storage.ReadBucket, - relativeRootPath string, - subDirPath string, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (ModuleConfigSet, error) { - workspaceConfig, err := bufwork.GetConfigForBucket(ctx, readBucket, relativeRootPath) - if err != nil { - return nil, err - } - workspace, err := workspaceBuilder.BuildWorkspace( - ctx, - workspaceConfig, - readBucket, - relativeRootPath, - subDirPath, // this is used to only apply the config override to this directory - configOverride, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - if subDirPath != "." { - moduleConfig, err := m.getSourceModuleConfig( - ctx, - sourceRef, - readBucket, - relativeRootPath, - subDirPath, - configOverride, - workspaceBuilder, - workspaceConfig, - workspace, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - return newModuleConfigSet( - []ModuleConfig{ - moduleConfig, - }, - workspace, - ), nil - } - if configOverride != "" { - return nil, errors.New("the --config flag is not compatible with workspaces") - } - // The target subDirPath points to the workspace configuration, - // so we construct a separate workspace for each of the configured - // directories. - var moduleConfigs []ModuleConfig - // We need to first get the map of externalDirOrFilePath to subDirRelPath and the map - // of excludeDirOrFilePath to subDirRelExcludePath so we can check that all paths that - // have been provided at the top level have been accounted for across the workspace. - externalPathToRelPaths := make(map[string]string) - externalExcludePathToRelPaths := make(map[string]string) - for _, directory := range workspaceConfig.Directories { - // We are unfortunately adding this logic in two difference places, once at the top level - // here, and when we build each workspace for the build options. We need to do the work - // at this level because we need to check across all workspaces once. - // We need the same logic again for each workspace build because a module can span across - // several workspaces. - // That being said, the work will be done once, since the module build may be cached as - // as a dependency via bufwork.BuildWorkspace, so the module will always be built once. - externalPathToSubDirRelPaths, err := bufwork.ExternalPathsToSubDirRelPaths( - relativeRootPath, - directory, - externalDirOrFilePaths, - ) - if err != nil { - return nil, err - } - externalExcludeToSubDirRelExcludePaths, err := bufwork.ExternalPathsToSubDirRelPaths( - relativeRootPath, - directory, - externalExcludeDirOrFilePaths, - ) - if err != nil { - return nil, err - } - for externalFileOrDirPath, subDirRelPath := range externalPathToSubDirRelPaths { - externalPathToRelPaths[externalFileOrDirPath] = subDirRelPath - } - for excludeFileOrDirPath, subDirRelExcludePath := range externalExcludeToSubDirRelExcludePaths { - externalExcludePathToRelPaths[excludeFileOrDirPath] = subDirRelExcludePath - } - moduleConfig, err := m.getSourceModuleConfig( - ctx, - sourceRef, - readBucket, - relativeRootPath, - directory, - configOverride, - workspaceBuilder, - workspaceConfig, - workspace, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - moduleConfigs = append(moduleConfigs, moduleConfig) - } - // This is only a requirement if we do not allow paths to not exist. - if !externalDirOrFilePathsAllowNotExist { - for _, externalDirOrFilePath := range externalDirOrFilePaths { - if _, ok := externalPathToRelPaths[externalDirOrFilePath]; !ok { - return nil, fmt.Errorf("path does not exist: %s", externalDirOrFilePath) - } - } - for _, excludeDirOrFilePath := range externalExcludeDirOrFilePaths { - if _, ok := externalExcludePathToRelPaths[excludeDirOrFilePath]; !ok { - return nil, fmt.Errorf("path does not exist: %s", excludeDirOrFilePath) - } - } - } - return newModuleConfigSet(moduleConfigs, workspace), nil -} - -func (m *moduleConfigReader) getSourceModuleConfig( - ctx context.Context, - sourceRef buffetch.SourceRef, - readBucket storage.ReadBucket, - relativeRootPath string, - subDirPath string, - configOverride string, - workspaceBuilder bufwork.WorkspaceBuilder, - workspaceConfig *bufwork.Config, - workspace bufmodule.Workspace, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (ModuleConfig, error) { - if module, moduleConfig, ok := workspaceBuilder.GetModuleConfig(subDirPath); ok { - // The module was already built while we were constructing the workspace. - // However, we still need to perform some additional validation based on - // the sourceRef. - if len(externalDirOrFilePaths) > 0 { - if workspaceDirectoryEqualsOrContainsSubDirPath(workspaceConfig, subDirPath) { - // We have to do this ahead of time as we are not using PathForExternalPath - // in this if branch. This is really bad. - for _, externalDirOrFilePath := range externalDirOrFilePaths { - if _, err := sourceRef.PathForExternalPath(externalDirOrFilePath); err != nil { - return nil, err - } - } - } - } - return newModuleConfig(module, moduleConfig), nil - } - mappedReadBucket := readBucket - if subDirPath != "." { - mappedReadBucket = storage.MapReadBucket(readBucket, storage.MapOnPrefix(subDirPath)) - } - moduleConfig, err := bufconfig.ReadConfigOS( - ctx, - mappedReadBucket, - bufconfig.ReadConfigOSWithOverride(configOverride), - ) - if err != nil { - return nil, err - } - var buildOptions []bufmodulebuild.BuildOption - if len(externalDirOrFilePaths) > 0 { - if workspaceDirectoryEqualsOrContainsSubDirPath(workspaceConfig, subDirPath) { - // We have to do this ahead of time as we are not using PathForExternalPath - // in this if branch. This is really bad. - for _, externalDirOrFilePath := range externalDirOrFilePaths { - if _, err := sourceRef.PathForExternalPath(externalDirOrFilePath); err != nil { - return nil, err - } - } - // The subDirPath is contained within one of the workspace directories, so - // we first need to reformat the externalDirOrFilePaths so that they accommodate - // for the relativeRootPath (the path to the directory containing the buf.work.yaml). - // - // For example, - // - // $ buf build ../../proto --path ../../proto/buf - // - // // buf.work.yaml - // version: v1 - // directories: - // - proto - // - enterprise/proto - // - // Note that we CANNOT simply use the sourceRef because we would not be able to - // determine which workspace directory the paths apply to afterwards. To be clear, - // if we determined the bucketRelPath from the sourceRef, the bucketRelPath would be equal - // to ./buf/... which is ambiguous to the workspace directories ('proto' and 'enterprise/proto' - // in this case). - externalPathToSubDirRelPaths, err := bufwork.ExternalPathsToSubDirRelPaths( - relativeRootPath, - subDirPath, - externalDirOrFilePaths, - ) - if err != nil { - return nil, err - } - externalExcludeToSubDirRelExcludePaths, err := bufwork.ExternalPathsToSubDirRelPaths( - relativeRootPath, - subDirPath, - externalExcludeDirOrFilePaths, - ) - if err != nil { - return nil, err - } - subDirRelPaths := make([]string, 0, len(externalPathToSubDirRelPaths)) - for _, subDirRelPath := range externalPathToSubDirRelPaths { - subDirRelPaths = append(subDirRelPaths, subDirRelPath) - } - subDirRelExcludePaths := make([]string, 0, len(externalExcludeToSubDirRelExcludePaths)) - for _, subDirRelExcludePath := range externalExcludeToSubDirRelExcludePaths { - subDirRelExcludePaths = append(subDirRelExcludePaths, subDirRelExcludePath) - } - buildOptions, err = bufwork.BuildOptionsForWorkspaceDirectory( - ctx, - workspaceConfig, - moduleConfig, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - subDirRelPaths, - subDirRelExcludePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - } else { - // The subDirPath isn't a workspace directory, so we can determine the bucketRelPaths - // from the sourceRef on its own. - buildOptions = []bufmodulebuild.BuildOption{ - // We can't determine the module's commit from the local file system. - // This also may be nil. - // - // This is particularly useful for the GoPackage modifier used in - // managed mode, which supports module-specific overrides. - bufmodulebuild.WithModuleIdentity(moduleConfig.ModuleIdentity), - } - bucketRelPaths := make([]string, len(externalDirOrFilePaths)) - for i, externalDirOrFilePath := range externalDirOrFilePaths { - bucketRelPath, err := sourceRef.PathForExternalPath(externalDirOrFilePath) - if err != nil { - return nil, err - } - bucketRelPaths[i] = bucketRelPath - } - if externalDirOrFilePathsAllowNotExist { - buildOptions = append(buildOptions, bufmodulebuild.WithPathsAllowNotExist(bucketRelPaths)) - } else { - buildOptions = append(buildOptions, bufmodulebuild.WithPaths(bucketRelPaths)) - } - } - } - if len(externalExcludeDirOrFilePaths) > 0 { - bucketRelPaths := make([]string, len(externalExcludeDirOrFilePaths)) - for i, excludeDirOrFilePath := range externalExcludeDirOrFilePaths { - bucketRelPath, err := sourceRef.PathForExternalPath(excludeDirOrFilePath) - if err != nil { - return nil, err - } - bucketRelPaths[i] = bucketRelPath - } - buildOptions = append(buildOptions, bufmodulebuild.WithExcludePaths(bucketRelPaths)) - } - module, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - mappedReadBucket, - moduleConfig.Build, - buildOptions..., - ) - if err != nil { - return nil, err - } - if missingReferences := detectMissingDependencies( - moduleConfig.Build.DependencyModuleReferences, - module.DependencyModulePins(), - workspace, - ); len(missingReferences) > 0 { - var builder strings.Builder - _, _ = builder.WriteString(`Specified deps are not covered in your buf.lock, run "buf mod update":`) - for _, moduleReference := range missingReferences { - _, _ = builder.WriteString("\n\t- " + moduleReference.IdentityString()) - } - m.logger.Warn(builder.String()) - } - return newModuleConfig(module, moduleConfig), nil -} - -func workspaceDirectoryEqualsOrContainsSubDirPath(workspaceConfig *bufwork.Config, subDirPath string) bool { - if workspaceConfig == nil { - return false - } - for _, directory := range workspaceConfig.Directories { - if normalpath.EqualsOrContainsPath(directory, subDirPath, normalpath.Relative) { - return true - } - } - return false -} - -func detectMissingDependencies( - references []bufmoduleref.ModuleReference, - pins []bufmoduleref.ModulePin, - workspace bufmodule.Workspace, -) []bufmoduleref.ModuleReference { - pinSet := make(map[string]struct{}) - for _, pin := range pins { - pinSet[pin.IdentityString()] = struct{}{} - } - - var missingReferences []bufmoduleref.ModuleReference - for _, reference := range references { - if _, ok := pinSet[reference.IdentityString()]; !ok { - if workspace != nil { - if _, ok := workspace.GetModule(reference); !ok { - missingReferences = append(missingReferences, reference) - } - } else { - missingReferences = append(missingReferences, reference) - } - } - } - return missingReferences -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_set.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_set.go deleted file mode 100644 index bc011348ae..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/module_config_set.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule" -) - -type moduleConfigSet struct { - moduleConfigs []ModuleConfig - workspace bufmodule.Workspace -} - -func newModuleConfigSet(moduleConfigs []ModuleConfig, workspace bufmodule.Workspace) *moduleConfigSet { - return &moduleConfigSet{ - moduleConfigs: moduleConfigs, - workspace: workspace, - } -} - -func (m *moduleConfigSet) ModuleConfigs() []ModuleConfig { - return m.moduleConfigs -} - -func (m *moduleConfigSet) Workspace() bufmodule.Workspace { - return m.workspace -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_reader.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_reader.go deleted file mode 100644 index c326a3ed9f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_reader.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "errors" - "fmt" - "io" - "os" - - "github.com/bufbuild/buf/private/buf/bufconvert" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufreflect" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" -) - -type protoEncodingReader struct { - logger *zap.Logger -} - -var _ ProtoEncodingReader = &protoEncodingReader{} - -func newProtoEncodingReader( - logger *zap.Logger, -) *protoEncodingReader { - return &protoEncodingReader{ - logger: logger, - } -} - -func (p *protoEncodingReader) GetMessage( - ctx context.Context, - container app.EnvStdinContainer, - image bufimage.Image, - typeName string, - messageRef bufconvert.MessageEncodingRef, -) (_ proto.Message, retErr error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_message") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - // Currently, this support binpb and JSON format. - resolver, err := protoencoding.NewResolver( - bufimage.ImageToFileDescriptors( - image, - )..., - ) - if err != nil { - return nil, err - } - var unmarshaler protoencoding.Unmarshaler - switch messageRef.MessageEncoding() { - case bufconvert.MessageEncodingBinpb: - unmarshaler = protoencoding.NewWireUnmarshaler(resolver) - case bufconvert.MessageEncodingJSON: - unmarshaler = protoencoding.NewJSONUnmarshaler(resolver) - default: - return nil, errors.New("unknown message encoding type") - } - readCloser := io.NopCloser(container.Stdin()) - if messageRef.Path() != "-" { - var err error - readCloser, err = os.Open(messageRef.Path()) - if err != nil { - return nil, err - } - } - defer func() { - retErr = multierr.Append(retErr, readCloser.Close()) - }() - data, err := io.ReadAll(readCloser) - if err != nil { - return nil, err - } - if len(data) == 0 { - return nil, errors.New("size of input message must not be zero") - } - message, err := bufreflect.NewMessage(ctx, image, typeName) - if err != nil { - return nil, err - } - if err := unmarshaler.Unmarshal(data, message); err != nil { - return nil, fmt.Errorf("unable to unmarshal the message: %v", err) - } - return message, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_writer.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_writer.go deleted file mode 100644 index 2bc08ff5cf..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/proto_encoding_writer.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwire - -import ( - "context" - "errors" - "os" - - "github.com/bufbuild/buf/private/buf/bufconvert" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" -) - -type protoEncodingWriter struct { - logger *zap.Logger -} - -var _ ProtoEncodingWriter = &protoEncodingWriter{} - -func newProtoEncodingWriter( - logger *zap.Logger, -) *protoEncodingWriter { - return &protoEncodingWriter{ - logger: logger, - } -} - -func (p *protoEncodingWriter) PutMessage( - ctx context.Context, - container app.EnvStdoutContainer, - image bufimage.Image, - message proto.Message, - messageRef bufconvert.MessageEncodingRef, -) (retErr error) { - // Currently, this support binpb and JSON format. - resolver, err := protoencoding.NewResolver( - bufimage.ImageToFileDescriptors( - image, - )..., - ) - if err != nil { - return err - } - var marshaler protoencoding.Marshaler - switch messageRef.MessageEncoding() { - case bufconvert.MessageEncodingBinpb: - marshaler = protoencoding.NewWireMarshaler() - case bufconvert.MessageEncodingJSON: - marshaler = protoencoding.NewJSONMarshaler(resolver) - default: - return errors.New("unknown message encoding type") - } - data, err := marshaler.Marshal(message) - if err != nil { - return err - } - writeCloser := ioextended.NopWriteCloser(container.Stdout()) - if messageRef.Path() != "-" { - writeCloser, err = os.Create(messageRef.Path()) - if err != nil { - return err - } - } - defer func() { - retErr = multierr.Append(retErr, writeCloser.Close()) - }() - _, err = writeCloser.Write(data) - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwire/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufwire/usage.gen.go deleted file mode 100644 index 218e3e9b95..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwire/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufwire - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwork/bufwork.go b/vendor/github.com/bufbuild/buf/private/buf/bufwork/bufwork.go deleted file mode 100644 index 2ee498aedb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwork/bufwork.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufwork defines the primitives used to enable workspaces. -// -// If a buf.work.yaml file exists in a parent directory (up to the root of -// the filesystem), the directory containing the file is used as the root of -// one or more modules. With this, modules can import from one another, and a -// variety of commands work on multiple modules rather than one. For example, if -// `buf lint` is run for an input that contains a buf.work.yaml, each of -// the modules contained within the workspace will be linted. Other commands, such -// as `buf build`, will merge workspace modules into one (i.e. a "supermodule") -// so that all of the files contained are consolidated into a single image. -// -// In the following example, the workspace consists of two modules: the module -// defined in the petapis directory can import definitions from the paymentapis -// module without vendoring the definitions under a common root. To be clear, -// `import "acme/payment/v2/payment.proto";` from the acme/pet/v1/pet.proto file -// will suffice as long as the buf.work.yaml file exists. -// -// // buf.work.yaml -// version: v1 -// directories: -// - paymentapis -// - petapis -// -// $ tree -// . -// ├── buf.work.yaml -// ├── paymentapis -// │   ├── acme -// │   │   └── payment -// │   │   └── v2 -// │   │   └── payment.proto -// │   └── buf.yaml -// └── petapis -// ├── acme -// │   └── pet -// │ └── v1 -// │   └── pet.proto -// └── buf.yaml -// -// Note that inputs MUST NOT overlap with any of the directories defined in the buf.work.yaml -// file. For example, it's not possible to build input "paymentapis/acme" since the image -// would otherwise include the content defined in paymentapis/acme/payment/v2/payment.proto as -// acme/payment/v2/payment.proto and payment/v2/payment.proto. -// -// EVERYTHING IN THIS PACKAGE SHOULD ONLY BE CALLED BY THE CLI AND CANNOT BE USED IN SERVICES. -package bufwork - -import ( - "context" - "fmt" - "path/filepath" - - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" -) - -const ( - // ExternalConfigV1FilePath is the default configuration file path for v1. - ExternalConfigV1FilePath = "buf.work.yaml" - // V1Version is the version string used to indicate the v1 version of the buf.work.yaml file. - V1Version = "v1" - - // BackupExternalConfigV1FilePath is another acceptable configuration file path for v1. - // - // Originally we thought we were going to use buf.work, and had this around for - // a while, but then moved to buf.work.yaml. We still need to support buf.work as - // we released with it, however. - BackupExternalConfigV1FilePath = "buf.work" -) - -var ( - // AllConfigFilePaths are all acceptable config file paths without overrides. - // - // These are in the order we should check. - AllConfigFilePaths = []string{ - ExternalConfigV1FilePath, - BackupExternalConfigV1FilePath, - } -) - -// WorkspaceBuilder builds workspaces. A single WorkspaceBuilder should NOT be persisted -// acorss calls because the WorkspaceBuilder caches the modules used in each workspace. -type WorkspaceBuilder interface { - // BuildWorkspace builds a bufmodule.Workspace. - // - // The given targetSubDirPath is the only path that will have the configOverride applied to it. - // TODO: delete targetSubDirPath entirely. We are building a Workspace, we don't necessarily - // have a specific target directory within it. This would mean doing the config override at - // a higher level for any specific modules within the Workspace. The only thing in the config - // we care about is the build.excludes, so in theory we should be able to figure out a way - // to say "exclude these files from these modules when you are building". Even better, the - // WorkspaceBuilder has nothing to do with building modules. - BuildWorkspace( - ctx context.Context, - workspaceConfig *Config, - readBucket storage.ReadBucket, - relativeRootPath string, - targetSubDirPath string, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, - ) (bufmodule.Workspace, error) - - // GetModuleConfig returns the bufmodule.Module and *bufconfig.Config, associated with the given - // targetSubDirPath, if it exists. - GetModuleConfig(targetSubDirPath string) (bufmodule.Module, *bufconfig.Config, bool) -} - -// NewWorkspaceBuilder returns a new WorkspaceBuilder. -func NewWorkspaceBuilder() WorkspaceBuilder { - return newWorkspaceBuilder() -} - -// BuildOptionsForWorkspaceDirectory returns the bufmodulebuild.BuildOptions required for -// the given subDirPath based on the workspace configuration. -// -// The subDirRelPaths are the relative paths of the externalDirOrFilePaths that map to the -// provided subDirPath. -// The subDirRelExcludePaths are the relative paths of the externalExcludeDirOrFilePaths that map to the -// provided subDirPath. -func BuildOptionsForWorkspaceDirectory( - ctx context.Context, - workspaceConfig *Config, - moduleConfig *bufconfig.Config, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - subDirRelPaths []string, - subDirRelExcludePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) ([]bufmodulebuild.BuildOption, error) { - buildOptions := []bufmodulebuild.BuildOption{ - // We can't determine the module's commit from the local file system. - // This also may be nil. - // - // This is particularly useful for the GoPackage modifier used in - // managed mode, which supports module-specific overrides. - bufmodulebuild.WithModuleIdentity(moduleConfig.ModuleIdentity), - } - if len(externalDirOrFilePaths) == 0 && len(externalExcludeDirOrFilePaths) == 0 { - return buildOptions, nil - } - if len(externalDirOrFilePaths) > 0 { - // Note that subDirRelPaths can be empty. If so, this represents - // the case where externalDirOrFilePaths were provided, but none - // matched. - if externalDirOrFilePathsAllowNotExist { - buildOptions = append(buildOptions, bufmodulebuild.WithPathsAllowNotExist(subDirRelPaths)) - } else { - buildOptions = append(buildOptions, bufmodulebuild.WithPaths(subDirRelPaths)) - } - } - if len(externalExcludeDirOrFilePaths) > 0 { - // Same as above, subDirRelExcludepaths can be empty. If so, this represents the case - // where excludes were provided by were not matched. - if externalDirOrFilePathsAllowNotExist { - buildOptions = append(buildOptions, bufmodulebuild.WithExcludePathsAllowNotExist(subDirRelExcludePaths)) - } else { - buildOptions = append(buildOptions, bufmodulebuild.WithExcludePaths(subDirRelExcludePaths)) - } - } - return buildOptions, nil -} - -// ExternalPathsToSubDirRelPaths returns a map of the external paths provided to their relative -// path to the provided subDirPath. -// -// Note not every external path provided may have a relative path mapped to the subDirPath. -func ExternalPathsToSubDirRelPaths( - relativeRootPath string, - subDirPath string, - externalDirOrFilePaths []string, -) (map[string]string, error) { - // We first need to reformat the externalDirOrFilePaths so that they accommodate - // for the relativeRootPath (the path to the directory containing the buf.work.yaml). - // - // For example, - // - // $ buf build ../../proto --path ../../proto/buf - // - // // buf.work.yaml - // version: v1 - // directories: - // - proto - // - enterprise/proto - // - // Note that we CANNOT simply use the sourceRef because we would not be able to - // determine which workspace directory the paths apply to afterwards. To be clear, - // if we determined the bucketRelPath from the sourceRef, the bucketRelPath would be equal - // to ./buf/... which is ambiguous to the workspace directories ('proto' and 'enterprise/proto' - // in this case). - // - // Also note that we need to use absolute paths because it's possible that the externalDirOrFilePath - // is not relative to the relativeRootPath. For example, supppose that the buf.work.yaml is found at ../../.., - // whereas the current working directory is nested within one of the workspace directories like so: - // - // $ buf build ../../.. --path ../proto/buf - // - // Although absolute paths don't apply to ArchiveRefs and GitRefs, this logic continues to work in - // these cases. Both ArchiveRefs and GitRefs might have a relativeRootPath nested within the bucket's - // root, e.g. an archive that defines a buf.work.yaml in a nested 'proto/buf.work.yaml' directory like so: - // - // $ buf build weather.zip#subdir=proto --path proto/acme/weather/v1/weather.proto - // - // $ zipinfo weather.zip - // Archive: weather.zip - // ... - // ... proto/ - // - // In this case, the relativeRootPath is equal to 'proto', so we still need to determine the relative path - // between 'proto' and 'proto/acme/weather/v1/weather.proto' and assign it to the correct workspace directory. - // So even though it's impossible for ArchiveRefs and GitRefs to jump context (i.e. '../..'), the transformation - // from [relative -> absolute -> relative] will always yield valid results. In the example above, we would have - // something along the lines: - // - // * '/Users/me/path/to/wd' is the current working directory - // - // absRelativeRootPath == '/Users/me/path/to/wd/proto' - // absExternalDirOrFilePath == '/Users/me/path/to/wd/proto/acme/weather/v1/weather.proto' - // - // ==> relativeRootRelPath == 'acme/weather/v1/weather.proto' - // - // The paths, such as '/Users/me/path/to/wd/proto/acme/weather/v1/weather.proto', might not exist on the local - // file system at all, but the [relative -> absolute -> relative] transformation works as expected. - // - // Alternatively, we could special-case this logic so that we only work with relative paths when we have an ArchiveRef - // or GitRef, but this would violate the abstraction boundary for buffetch. - externalToAbsExternalDirOrFilePaths := make(map[string]string) - // We know that if the file is actually buf.work for legacy reasons, this will be wrong, - // but we accept that as this shouldn't happen often anymore and this is just - // used for error messages. - workspaceID := filepath.Join(normalpath.Unnormalize(relativeRootPath), ExternalConfigV1FilePath) - for _, externalDirOrFilePath := range externalDirOrFilePaths { - absExternalDirOrFilePath, err := normalpath.NormalizeAndAbsolute(externalDirOrFilePath) - if err != nil { - return nil, fmt.Errorf( - `path "%s" could not be resolved`, - normalpath.Unnormalize(externalDirOrFilePath), - ) - } - externalToAbsExternalDirOrFilePaths[externalDirOrFilePath] = absExternalDirOrFilePath - } - absRelativeRootPath, err := normalpath.NormalizeAndAbsolute(relativeRootPath) - if err != nil { - return nil, err - } - externalToRelativeRootRelPaths := make(map[string]string) - for externalDirOrFilePath, absExternalDirOrFilePath := range externalToAbsExternalDirOrFilePaths { - if absRelativeRootPath == absExternalDirOrFilePath { - return nil, fmt.Errorf( - `path "%s" is equal to the workspace defined in "%s"`, - normalpath.Unnormalize(externalDirOrFilePath), - workspaceID, - ) - } - if normalpath.ContainsPath(absRelativeRootPath, absExternalDirOrFilePath, normalpath.Absolute) { - relativeRootRelPath, err := normalpath.Rel(absRelativeRootPath, absExternalDirOrFilePath) - if err != nil { - return nil, fmt.Errorf( - `a relative path could not be resolved between "%s" and "%s"`, - normalpath.Unnormalize(externalDirOrFilePath), - workspaceID, - ) - } - externalToRelativeRootRelPaths[externalDirOrFilePath] = relativeRootRelPath - } - } - // Now that the paths are relative to the relativeRootPath, the paths need to be scoped to - // the directory they belong to. - // - // For example, after the paths have been processed above, the arguments can be imagined like so: - // - // $ buf build proto --path proto/buf - // - // // buf.work.yaml - // version: v1 - // directories: - // - proto - // - enterprise/proto - // - // The 'proto' directory will receive the ./proto/buf/... files as ./buf/... whereas the - // 'enterprise/proto' directory will have no matching paths. - externalToSubDirRelPaths := make(map[string]string) - for externalDirOrFilePath, relativeRootRelPath := range externalToRelativeRootRelPaths { - if subDirPath == relativeRootRelPath { - return nil, fmt.Errorf( - `path "%s" is equal to workspace directory "%s" defined in "%s"`, - normalpath.Unnormalize(externalDirOrFilePath), - normalpath.Unnormalize(subDirPath), - workspaceID, - ) - } - if normalpath.ContainsPath(subDirPath, relativeRootRelPath, normalpath.Relative) { - subDirRelPath, err := normalpath.Rel(subDirPath, relativeRootRelPath) - if err != nil { - return nil, fmt.Errorf( - `a relative path could not be resolved between "%s" and "%s"`, - normalpath.Unnormalize(externalDirOrFilePath), - subDirPath, - ) - } - externalToSubDirRelPaths[externalDirOrFilePath] = subDirRelPath - } - } - return externalToSubDirRelPaths, nil -} - -// Config is the workspace config. -type Config struct { - // Directories are normalized and validated. - // - // Must be non-empty to be a valid configuration. - Directories []string -} - -// GetConfigForBucket gets the Config for the YAML data at ConfigFilePath. -// -// This function expects that there is a valid non-empty configuration in the bucket. Otherwise, this errors. -func GetConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, relativeRootPath string) (*Config, error) { - return getConfigForBucket(ctx, readBucket, relativeRootPath) -} - -// GetConfigForData gets the Config for the given JSON or YAML data. -// -// This function expects that there is a valid non-empty configuration. Otherwise, this errors. -func GetConfigForData(ctx context.Context, data []byte) (*Config, error) { - return getConfigForData(ctx, data) -} - -// ExistingConfigFilePath checks if a configuration file exists, and if so, returns the path -// within the ReadBucket of this configuration file. -// -// Returns empty string and no error if no configuration file exists. -func ExistingConfigFilePath(ctx context.Context, readBucket storage.ReadBucket) (string, error) { - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return "", err - } - if exists { - return configFilePath, nil - } - } - return "", nil -} - -// ExternalConfigV1 represents the on-disk representation -// of the workspace configuration at version v1. -type ExternalConfigV1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Directories []string `json:"directories,omitempty" yaml:"directories,omitempty"` -} - -type externalConfigVersion struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwork/config.go b/vendor/github.com/bufbuild/buf/private/buf/bufwork/config.go deleted file mode 100644 index da3c37d07c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwork/config.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwork - -import ( - "fmt" - "sort" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -func newConfigV1(externalConfig ExternalConfigV1, workspaceID string) (*Config, error) { - if len(externalConfig.Directories) == 0 { - return nil, fmt.Errorf( - `%s has no directories set. Please add "directories: [...]"`, - workspaceID, - ) - } - directorySet := make(map[string]struct{}, len(externalConfig.Directories)) - for _, directory := range externalConfig.Directories { - normalizedDirectory, err := normalpath.NormalizeAndValidate(directory) - if err != nil { - return nil, fmt.Errorf(`directory "%s" listed in %s is invalid: %w`, normalpath.Unnormalize(directory), workspaceID, err) - } - if _, ok := directorySet[normalizedDirectory]; ok { - return nil, fmt.Errorf( - `directory "%s" is listed more than once in %s`, - normalpath.Unnormalize(normalizedDirectory), - workspaceID, - ) - } - directorySet[normalizedDirectory] = struct{}{} - } - // It's very important that we sort the directories here so that the - // constructed modules and/or images are in a deterministic order. - directories := stringutil.MapToSlice(directorySet) - sort.Slice(directories, func(i int, j int) bool { - return directories[i] < directories[j] - }) - if err := validateConfigurationOverlap(directories, workspaceID); err != nil { - return nil, err - } - return &Config{ - Directories: directories, - }, nil -} - -// validateOverlap returns a non-nil error if any of the directories overlap -// with each other. The given directories are expected to be sorted. -func validateConfigurationOverlap(directories []string, workspaceID string) error { - for i := 0; i < len(directories); i++ { - for j := i + 1; j < len(directories); j++ { - left := directories[i] - right := directories[j] - if normalpath.ContainsPath(left, right, normalpath.Relative) { - return fmt.Errorf( - `directory "%s" contains directory "%s" in %s`, - normalpath.Unnormalize(left), - normalpath.Unnormalize(right), - workspaceID, - ) - } - if normalpath.ContainsPath(right, left, normalpath.Relative) { - return fmt.Errorf( - `directory "%s" contains directory "%s" in %s`, - normalpath.Unnormalize(right), - normalpath.Unnormalize(left), - workspaceID, - ) - } - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwork/get.go b/vendor/github.com/bufbuild/buf/private/buf/bufwork/get.go deleted file mode 100644 index c32ca2ab3d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwork/get.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwork - -import ( - "context" - "fmt" - "io" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/multierr" -) - -func getConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, relativeRootPath string) (_ *Config, retErr error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_workspace_config") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - - // This will be in the order of precedence. - var foundConfigFilePaths []string - // Go through all valid config file paths and see which ones are present. - // If none are present, return the default config. - // If multiple are present, error. - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return nil, err - } - if exists { - foundConfigFilePaths = append(foundConfigFilePaths, configFilePath) - } - } - switch len(foundConfigFilePaths) { - case 0: - // Did not find anything, return the default. - return newConfigV1(ExternalConfigV1{}, "default configuration") - case 1: - workspaceID := filepath.Join(normalpath.Unnormalize(relativeRootPath), foundConfigFilePaths[0]) - readObjectCloser, err := readBucket.Get(ctx, foundConfigFilePaths[0]) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readObjectCloser.Close()) - }() - data, err := io.ReadAll(readObjectCloser) - if err != nil { - return nil, err - } - return getConfigForDataInternal( - ctx, - encoding.UnmarshalYAMLNonStrict, - encoding.UnmarshalYAMLStrict, - workspaceID, - data, - readObjectCloser.ExternalPath(), - ) - default: - return nil, fmt.Errorf("only one workspace file can exist but found multiple workspace files: %s", stringutil.SliceToString(foundConfigFilePaths)) - } -} - -func getConfigForData(ctx context.Context, data []byte) (*Config, error) { - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_workspace_config_for_data") - defer span.End() - config, err := getConfigForDataInternal( - ctx, - encoding.UnmarshalJSONOrYAMLNonStrict, - encoding.UnmarshalJSONOrYAMLStrict, - "configuration data", - data, - "Configuration data", - ) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - } - return config, err -} - -func getConfigForDataInternal( - ctx context.Context, - unmarshalNonStrict func([]byte, interface{}) error, - unmarshalStrict func([]byte, interface{}) error, - workspaceID string, - data []byte, - id string, -) (*Config, error) { - var externalConfigVersion externalConfigVersion - if err := unmarshalNonStrict(data, &externalConfigVersion); err != nil { - return nil, err - } - if err := validateExternalConfigVersion(externalConfigVersion, id); err != nil { - return nil, err - } - var externalConfigV1 ExternalConfigV1 - if err := unmarshalStrict(data, &externalConfigV1); err != nil { - return nil, err - } - return newConfigV1(externalConfigV1, workspaceID) -} - -func validateExternalConfigVersion(externalConfigVersion externalConfigVersion, id string) error { - switch externalConfigVersion.Version { - case "": - return fmt.Errorf( - `%s has no version set. Please add "version: %s"`, - id, - V1Version, - ) - case V1Version: - return nil - default: - return fmt.Errorf( - `%s has an invalid "version: %s" set. Please add "version: %s"`, - id, - externalConfigVersion.Version, - V1Version, - ) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwork/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/bufwork/usage.gen.go deleted file mode 100644 index 1b6b270845..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwork/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufwork - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/bufwork/workspace_builder.go b/vendor/github.com/bufbuild/buf/private/buf/bufwork/workspace_builder.go deleted file mode 100644 index 2b0fcdf66f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/bufwork/workspace_builder.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwork - -import ( - "context" - "errors" - "fmt" - "path/filepath" - - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type workspaceBuilder struct { - moduleCache map[string]*cachedModule -} - -func newWorkspaceBuilder() *workspaceBuilder { - return &workspaceBuilder{ - moduleCache: make(map[string]*cachedModule), - } -} - -// BuildWorkspace builds a bufmodule.Workspace for the given targetSubDirPath. -func (w *workspaceBuilder) BuildWorkspace( - ctx context.Context, - workspaceConfig *Config, - readBucket storage.ReadBucket, - relativeRootPath string, - targetSubDirPath string, - configOverride string, - externalDirOrFilePaths []string, - externalExcludeDirOrFilePaths []string, - externalDirOrFilePathsAllowNotExist bool, -) (bufmodule.Workspace, error) { - if workspaceConfig == nil { - return nil, errors.New("received a nil workspace config") - } - // We know that if the file is actually buf.work for legacy reasons, this will be wrong, - // but we accept that as this shouldn't happen often anymore and this is just - // used for error messages. - workspaceID := filepath.Join(normalpath.Unnormalize(relativeRootPath), ExternalConfigV1FilePath) - namedModules := make(map[string]bufmodule.Module, len(workspaceConfig.Directories)) - allModules := make([]bufmodule.Module, 0, len(workspaceConfig.Directories)) - for _, directory := range workspaceConfig.Directories { - if cachedModule, ok := w.moduleCache[directory]; ok { - // We've already built this module, so we can use the cached-equivalent. - if moduleIdentity := cachedModule.moduleConfig.ModuleIdentity; moduleIdentity != nil { - if _, ok := namedModules[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf( - "module %q is provided by multiple workspace directories listed in %s", - moduleIdentity.IdentityString(), - workspaceID, - ) - } - namedModules[moduleIdentity.IdentityString()] = cachedModule.module - } - allModules = append(allModules, cachedModule.module) - continue - } - readBucketForDirectory := storage.MapReadBucket(readBucket, storage.MapOnPrefix(directory)) - if err := validateWorkspaceDirectoryNonEmpty(ctx, readBucketForDirectory, directory, workspaceID); err != nil { - return nil, err - } - if err := validateInputOverlap(directory, targetSubDirPath, workspaceID); err != nil { - return nil, err - } - // Ignore the configOverride for anything that isn't the target path - localConfigOverride := configOverride - if directory != targetSubDirPath { - localConfigOverride = "" - } - moduleConfig, err := bufconfig.ReadConfigOS( - ctx, - readBucketForDirectory, - bufconfig.ReadConfigOSWithOverride(localConfigOverride), - ) - if err != nil { - return nil, fmt.Errorf( - `failed to get module config for directory "%s" listed in %s: %w`, - normalpath.Unnormalize(directory), - workspaceID, - err, - ) - } - externalToSubDirRelPaths, err := ExternalPathsToSubDirRelPaths( - relativeRootPath, - directory, - externalDirOrFilePaths, - ) - if err != nil { - return nil, err - } - excludeToSubDirRelExcludePaths, err := ExternalPathsToSubDirRelPaths( - relativeRootPath, - directory, - externalExcludeDirOrFilePaths, - ) - if err != nil { - return nil, err - } - subDirRelPaths := make([]string, 0, len(externalToSubDirRelPaths)) - for _, subDirRelPath := range externalToSubDirRelPaths { - subDirRelPaths = append(subDirRelPaths, subDirRelPath) - } - subDirRelExcludePaths := make([]string, 0, len(excludeToSubDirRelExcludePaths)) - for _, subDirRelExcludePath := range excludeToSubDirRelExcludePaths { - subDirRelExcludePaths = append(subDirRelExcludePaths, subDirRelExcludePath) - } - buildOptions, err := BuildOptionsForWorkspaceDirectory( - ctx, - workspaceConfig, - moduleConfig, - externalDirOrFilePaths, - externalExcludeDirOrFilePaths, - subDirRelPaths, - subDirRelExcludePaths, - externalDirOrFilePathsAllowNotExist, - ) - if err != nil { - return nil, err - } - module, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - readBucketForDirectory, - moduleConfig.Build, - buildOptions..., - ) - if err != nil { - return nil, fmt.Errorf( - `failed to initialize module for directory "%s" listed in %s: %w`, - normalpath.Unnormalize(directory), - workspaceID, - err, - ) - } - w.moduleCache[directory] = newCachedModule( - module, - moduleConfig, - ) - if moduleIdentity := moduleConfig.ModuleIdentity; moduleIdentity != nil { - if _, ok := namedModules[moduleIdentity.IdentityString()]; ok { - return nil, fmt.Errorf( - "module %q is provided by multiple workspace directories listed in %s", - moduleIdentity.IdentityString(), - workspaceID, - ) - } - namedModules[moduleIdentity.IdentityString()] = module - } - allModules = append(allModules, module) - } - return bufmodule.NewWorkspace( - ctx, - namedModules, - allModules, - ) -} - -// GetModuleConfig returns the bufmodule.Module and *bufconfig.Config, associated with the given -// targetSubDirPath, if it exists. -func (w *workspaceBuilder) GetModuleConfig(targetSubDirPath string) (bufmodule.Module, *bufconfig.Config, bool) { - cachedModule, ok := w.moduleCache[targetSubDirPath] - if !ok { - return nil, nil, false - } - return cachedModule.module, cachedModule.moduleConfig, true -} - -func validateWorkspaceDirectoryNonEmpty( - ctx context.Context, - readBucket storage.ReadBucket, - workspaceDirectory string, - workspaceID string, -) error { - isEmpty, err := storage.IsEmpty( - ctx, - storage.MapReadBucket(readBucket, storage.MatchPathExt(".proto")), - "", - ) - if err != nil { - return err - } - if isEmpty { - return fmt.Errorf( - `directory "%s" listed in %s contains no .proto files`, - normalpath.Unnormalize(workspaceDirectory), - workspaceID, - ) - } - return nil -} - -// validateInputOverlap returns a non-nil error if the given directories -// overlap in either direction. The last argument is only used for -// error reporting. -// -// This verifies that ie we do not mistakenly target a directory input that is -// within a Workspace, but is not listed as a directory in the Workspace, which -// could cause issues. If we say "we have a workspace with directory proto, but -// we are targeting proto/a", then we will still detect the buf.work.yaml and -// bring in all the directories within it, making them available for import, -// but potentially in two ways. If there was proto/a/a.proto, we could theoretically -// import it as both a/a.proto, and a.proto. -// -// TODO: See if the above explanation is nonsense. It should be nonsense if we -// did our job right here. And regardless, this shouldn't need to be validated -// at this level. -// -// validateInputOverlap("foo", "bar", "buf.work.yaml") -> OK -// validateInputOverlap("foo/bar", "foo", "buf.work.yaml") -> NOT OK -// validateInputOverlap("foo", "foo/bar", "buf.work.yaml") -> NOT OK -func validateInputOverlap( - workspaceDirectory string, - targetSubDirPath string, - workspaceID string, -) error { - // If we are targeting the whole workspace and not a specific directory, - // we do not do this check. - // - // TODO: targetSubDirPath needs to be completely removed from WorkspaceBuilder - // and validateInputOverlap needs to be done somewhere else at a higher level, - // as the "target" is just a CLI argument concept, not a pure Workspace concept. - if targetSubDirPath == "." { - return nil - } - if normalpath.ContainsPath(workspaceDirectory, targetSubDirPath, normalpath.Relative) { - return fmt.Errorf( - `failed to build input "%s" because it is contained by directory "%s" listed in %s`, - normalpath.Unnormalize(targetSubDirPath), - normalpath.Unnormalize(workspaceDirectory), - workspaceID, - ) - } - - if normalpath.ContainsPath(targetSubDirPath, workspaceDirectory, normalpath.Relative) { - return fmt.Errorf( - `failed to build input "%s" because it contains directory "%s" listed in %s`, - normalpath.Unnormalize(targetSubDirPath), - normalpath.Unnormalize(workspaceDirectory), - workspaceID, - ) - } - return nil -} - -// cachedModule encapsulates a module and its configuration. -type cachedModule struct { - module bufmodule.Module - moduleConfig *bufconfig.Config -} - -func newCachedModule( - module bufmodule.Module, - moduleConfig *bufconfig.Config, -) *cachedModule { - return &cachedModule{ - module: module, - moduleConfig: moduleConfig, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/buf.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/buf.go deleted file mode 100644 index 59abc77963..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/buf.go +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buf - -import ( - "context" - "time" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/build" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/convert" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/curl" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/export" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/format" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/generate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/lint" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/push" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin" - "github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" -) - -// Main is the entrypoint to the buf CLI. -func Main(name string) { - appcmd.Main(context.Background(), NewRootCommand(name)) -} - -// NewRootCommand returns a new root command. -// -// This is public for use in testing. -func NewRootCommand(name string) *appcmd.Command { - builder := appflag.NewBuilder( - name, - appflag.BuilderWithTimeout(120*time.Second), - appflag.BuilderWithTracing(), - ) - return &appcmd.Command{ - Use: name, - Short: "The Buf CLI", - Long: "A tool for working with Protocol Buffers and managing resources on the Buf Schema Registry (BSR)", - Version: bufcli.Version, - BindPersistentFlags: builder.BindRoot, - SubCommands: []*appcmd.Command{ - build.NewCommand("build", builder), - export.NewCommand("export", builder), - format.NewCommand("format", builder), - lint.NewCommand("lint", builder), - breaking.NewCommand("breaking", builder), - generate.NewCommand("generate", builder), - lsfiles.NewCommand("ls-files", builder), - push.NewCommand("push", builder), - convert.NewCommand("convert", builder), - curl.NewCommand("curl", builder), - { - Use: "mod", - Short: "Manage Buf modules", - SubCommands: []*appcmd.Command{ - modinit.NewCommand("init", builder), - modprune.NewCommand("prune", builder), - modupdate.NewCommand("update", builder), - modopen.NewCommand("open", builder), - modclearcache.NewCommand("clear-cache", builder, "cc"), - modlslintrules.NewCommand("ls-lint-rules", builder), - modlsbreakingrules.NewCommand("ls-breaking-rules", builder), - }, - }, - { - Use: "registry", - Short: "Manage assets on the Buf Schema Registry", - SubCommands: []*appcmd.Command{ - registrylogin.NewCommand("login", builder), - registrylogout.NewCommand("logout", builder), - }, - }, - { - Use: "beta", - Short: "Beta commands. Unstable and likely to change", - SubCommands: []*appcmd.Command{ - graph.NewCommand("graph", builder), - price.NewCommand("price", builder), - stats.NewCommand("stats", builder), - migratev1beta1.NewCommand("migrate-v1beta1", builder), - studioagent.NewCommand("studio-agent", builder), - { - Use: "registry", - Short: "Manage assets on the Buf Schema Registry", - SubCommands: []*appcmd.Command{ - { - Use: "organization", - Short: "Manage organizations", - SubCommands: []*appcmd.Command{ - organizationcreate.NewCommand("create", builder), - organizationget.NewCommand("get", builder), - organizationdelete.NewCommand("delete", builder), - }, - }, - { - Use: "repository", - Short: "Manage repositories", - SubCommands: []*appcmd.Command{ - repositorycreate.NewCommand("create", builder), - repositoryget.NewCommand("get", builder), - repositorylist.NewCommand("list", builder), - repositorydelete.NewCommand("delete", builder), - repositorydeprecate.NewCommand("deprecate", builder), - repositoryundeprecate.NewCommand("undeprecate", builder), - repositoryupdate.NewCommand("update", builder), - }, - }, - { - Use: "tag", - Short: "Manage a repository's tags", - SubCommands: []*appcmd.Command{ - tagcreate.NewCommand("create", builder), - taglist.NewCommand("list", builder), - }, - }, - { - Use: "commit", - Short: "Manage a repository's commits", - SubCommands: []*appcmd.Command{ - commitget.NewCommand("get", builder), - commitlist.NewCommand("list", builder), - }, - }, - { - Use: "draft", - Short: "Manage a repository's drafts", - SubCommands: []*appcmd.Command{ - draftdelete.NewCommand("delete", builder), - draftlist.NewCommand("list", builder), - }, - }, - { - Use: "webhook", - Short: "Manage webhooks for a repository on the Buf Schema Registry", - SubCommands: []*appcmd.Command{ - webhookcreate.NewCommand("create", builder), - webhookdelete.NewCommand("delete", builder), - webhooklist.NewCommand("list", builder), - }, - }, - { - Use: "plugin", - Short: "Manage plugins on the Buf Schema Registry", - SubCommands: []*appcmd.Command{ - pluginpush.NewCommand("push", builder), - plugindelete.NewCommand("delete", builder), - }, - }, - }, - }, - }, - }, - { - Use: "alpha", - Short: "Alpha commands. Unstable and recommended only for experimentation. These may be deleted", - Hidden: true, - SubCommands: []*appcmd.Command{ - protoc.NewCommand("protoc", builder), - { - Use: "registry", - Short: "Manage assets on the Buf Schema Registry", - SubCommands: []*appcmd.Command{ - { - Use: "token", - Short: "Manage user tokens", - SubCommands: []*appcmd.Command{ - tokenget.NewCommand("get", builder), - tokenlist.NewCommand("list", builder), - tokendelete.NewCommand("delete", builder), - }, - }, - }, - }, - { - Use: "package", - Short: "Manage remote packages", - SubCommands: []*appcmd.Command{ - goversion.NewCommand("go-version", builder), - mavenversion.NewCommand("maven-version", builder), - npmversion.NewCommand("npm-version", builder), - swiftversion.NewCommand("swift-version", builder), - }, - }, - { - Use: "repo", - Short: "Manage Git repositories", - SubCommands: []*appcmd.Command{ - reposync.NewCommand("sync", builder), - }, - }, - { - Use: "workspace", - Short: "Manage workspaces", - SubCommands: []*appcmd.Command{ - workspacepush.NewCommand("push", builder), - }, - }, - }, - }, - }, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/goversion.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/goversion.go deleted file mode 100644 index 2d45bdb120..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/goversion.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package goversion - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pluginFlagName = "plugin" - moduleFlagName = "module" - registryName = "go" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " --module= --plugin=", - Short: bufcli.PackageVersionShortDescription(registryName), - Long: bufcli.PackageVersionLongDescription(registryName, name, "buf.build/bufbuild/connect-go"), - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Plugin string - Module string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar(&f.Module, moduleFlagName, "", "The module reference to resolve") - flagSet.StringVar(&f.Plugin, pluginFlagName, "", fmt.Sprintf("The %s plugin reference to resolve", registryName)) - _ = cobra.MarkFlagRequired(flagSet, moduleFlagName) - _ = cobra.MarkFlagRequired(flagSet, pluginFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReference, err := bufmoduleref.ModuleReferenceForString(flags.Module) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing module reference: %s", err.Error()) - } - pluginIdentity, pluginVersion, err := bufpluginref.ParsePluginIdentityOptionalVersion(flags.Plugin) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing plugin reference: %s", err.Error()) - } - if pluginIdentity.Remote() != moduleReference.Remote() { - return appcmd.NewInvalidArgumentError("module and plugin must be from the same remote") - } - resolver := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewResolveServiceClient, - ) - packageVersion, err := resolver.GetGoVersion(ctx, connect.NewRequest( - ®istryv1alpha1.GetGoVersionRequest{ - ModuleReference: ®istryv1alpha1.LocalModuleReference{ - Owner: moduleReference.Owner(), - Repository: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }, - PluginReference: ®istryv1alpha1.GetRemotePackageVersionPlugin{ - Owner: pluginIdentity.Owner(), - Name: pluginIdentity.Plugin(), - Version: pluginVersion, - }, - }, - )) - if err != nil { - return err - } - if _, err := container.Stdout().Write([]byte(packageVersion.Msg.Version)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/usage.gen.go deleted file mode 100644 index 52fe11c259..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/goversion/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package goversion - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/mavenversion.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/mavenversion.go deleted file mode 100644 index 60ef30085c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/mavenversion.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package mavenversion - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pluginFlagName = "plugin" - moduleFlagName = "module" - registryName = "maven" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " --module= --plugin=", - Short: bufcli.PackageVersionShortDescription(registryName), - Long: bufcli.PackageVersionLongDescription(registryName, name, "buf.build/bufbuild/connect-kotlin"), - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Plugin string - Module string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar(&f.Module, moduleFlagName, "", "The module reference to resolve") - flagSet.StringVar(&f.Plugin, pluginFlagName, "", fmt.Sprintf("The %s plugin reference to resolve", registryName)) - _ = cobra.MarkFlagRequired(flagSet, moduleFlagName) - _ = cobra.MarkFlagRequired(flagSet, pluginFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReference, err := bufmoduleref.ModuleReferenceForString(flags.Module) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing module reference: %s", err.Error()) - } - pluginIdentity, pluginVersion, err := bufpluginref.ParsePluginIdentityOptionalVersion(flags.Plugin) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing plugin reference: %s", err.Error()) - } - if pluginIdentity.Remote() != moduleReference.Remote() { - return appcmd.NewInvalidArgumentError("module and plugin must be from the same remote") - } - resolver := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewResolveServiceClient, - ) - packageVersion, err := resolver.GetMavenVersion(ctx, connect.NewRequest( - ®istryv1alpha1.GetMavenVersionRequest{ - ModuleReference: ®istryv1alpha1.LocalModuleReference{ - Owner: moduleReference.Owner(), - Repository: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }, - PluginReference: ®istryv1alpha1.GetRemotePackageVersionPlugin{ - Owner: pluginIdentity.Owner(), - Name: pluginIdentity.Plugin(), - Version: pluginVersion, - }, - }, - )) - if err != nil { - return err - } - if _, err := container.Stdout().Write([]byte(packageVersion.Msg.Version)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/usage.gen.go deleted file mode 100644 index 53bec36814..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/mavenversion/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package mavenversion - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/npmversion.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/npmversion.go deleted file mode 100644 index 0a8b4b1a22..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/npmversion.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package npmversion - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pluginFlagName = "plugin" - moduleFlagName = "module" - registryName = "npm" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " --module= --plugin=", - Short: bufcli.PackageVersionShortDescription(registryName), - Long: bufcli.PackageVersionLongDescription(registryName, name, "buf.build/bufbuild/connect-es"), - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Plugin string - Module string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar(&f.Module, moduleFlagName, "", "The module reference to resolve") - flagSet.StringVar(&f.Plugin, pluginFlagName, "", fmt.Sprintf("The %s plugin reference to resolve", registryName)) - _ = cobra.MarkFlagRequired(flagSet, moduleFlagName) - _ = cobra.MarkFlagRequired(flagSet, pluginFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReference, err := bufmoduleref.ModuleReferenceForString(flags.Module) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing module reference: %s", err.Error()) - } - pluginIdentity, pluginVersion, err := bufpluginref.ParsePluginIdentityOptionalVersion(flags.Plugin) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing plugin reference: %s", err.Error()) - } - if pluginIdentity.Remote() != moduleReference.Remote() { - return appcmd.NewInvalidArgumentError("module and plugin must be from the same remote") - } - resolver := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewResolveServiceClient, - ) - packageVersion, err := resolver.GetNPMVersion(ctx, connect.NewRequest( - ®istryv1alpha1.GetNPMVersionRequest{ - ModuleReference: ®istryv1alpha1.LocalModuleReference{ - Owner: moduleReference.Owner(), - Repository: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }, - PluginReference: ®istryv1alpha1.GetRemotePackageVersionPlugin{ - Owner: pluginIdentity.Owner(), - Name: pluginIdentity.Plugin(), - Version: pluginVersion, - }, - }, - )) - if err != nil { - return err - } - if _, err := container.Stdout().Write([]byte(packageVersion.Msg.Version)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/usage.gen.go deleted file mode 100644 index f7a8a71b24..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/npmversion/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package npmversion - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/swiftversion.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/swiftversion.go deleted file mode 100644 index dedbfada0a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/swiftversion.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package swiftversion - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pluginFlagName = "plugin" - moduleFlagName = "module" - registryName = "swift" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " --module= --plugin=", - Short: bufcli.PackageVersionShortDescription(registryName), - Long: bufcli.PackageVersionLongDescription(registryName, name, "buf.build/bufbuild/connect-swift"), - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Plugin string - Module string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar(&f.Module, moduleFlagName, "", "The module reference to resolve") - flagSet.StringVar(&f.Plugin, pluginFlagName, "", fmt.Sprintf("The %s plugin reference to resolve", registryName)) - _ = cobra.MarkFlagRequired(flagSet, moduleFlagName) - _ = cobra.MarkFlagRequired(flagSet, pluginFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReference, err := bufmoduleref.ModuleReferenceForString(flags.Module) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing module reference: %s", err.Error()) - } - pluginIdentity, pluginVersion, err := bufpluginref.ParsePluginIdentityOptionalVersion(flags.Plugin) - if err != nil { - return appcmd.NewInvalidArgumentErrorf("failed parsing plugin reference: %s", err.Error()) - } - if pluginIdentity.Remote() != moduleReference.Remote() { - return appcmd.NewInvalidArgumentError("module and plugin must be from the same remote") - } - resolver := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewResolveServiceClient, - ) - packageVersion, err := resolver.GetSwiftVersion(ctx, connect.NewRequest( - ®istryv1alpha1.GetSwiftVersionRequest{ - ModuleReference: ®istryv1alpha1.LocalModuleReference{ - Owner: moduleReference.Owner(), - Repository: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }, - PluginReference: ®istryv1alpha1.GetRemotePackageVersionPlugin{ - Owner: pluginIdentity.Owner(), - Name: pluginIdentity.Plugin(), - Version: pluginVersion, - }, - }, - )) - if err != nil { - return err - } - if _, err := container.Stdout().Write([]byte(packageVersion.Msg.Version)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/usage.gen.go deleted file mode 100644 index 0a10db60e0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/package/swiftversion/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package swiftversion - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_unix.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_unix.go deleted file mode 100644 index f5bbb98e81..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6 - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package protoc - -// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L892-L896 -// -// This will be ":" for all unix-like platforms including darwin. -// This will be ";" for windows. -const includeDirPathSeparator = ":" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_windows.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_windows.go deleted file mode 100644 index cb5ee20758..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/const_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package protoc - -// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L892-L896 -// -// This will be ":" for all unix-like platforms including darwin. -// This will be ";" for windows. -const includeDirPathSeparator = ";" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/errors.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/errors.go deleted file mode 100644 index 1acb825c03..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/errors.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoc - -import ( - "errors" - "fmt" -) - -var ( - errNoInputFiles = errors.New("no input files specified") - errArgEmpty = errors.New("empty argument specified") -) - -func newCannotSpecifyOptWithoutOutError(pluginName string) error { - return fmt.Errorf("cannot specify --%s_opt without --%s_out", pluginName, pluginName) -} - -func newCannotSpecifyPathWithoutOutError(pluginName string) error { - return fmt.Errorf("cannot specify --%s=protoc-gen-%s without --%s_out", pluginPathValuesFlagName, pluginName, pluginName) -} - -func newRecursiveReferenceError(flagFilePath string) error { - return fmt.Errorf("%s recursively referenced", flagFilePath) -} - -func newDuplicateOutError(pluginName string) error { - return fmt.Errorf("duplicate --%s_out", pluginName) -} - -func newEmptyOptError(pluginName string) error { - return fmt.Errorf("empty option value for %s", pluginName) -} - -func newPluginPathValueEmptyError() error { - return fmt.Errorf("--%s had an empty value", pluginPathValuesFlagName) -} - -func newPluginPathValueInvalidError(pluginPathValue string) error { - return fmt.Errorf("--%s value invalid: %s", pluginPathValuesFlagName, pluginPathValue) -} - -func newPluginPathNameInvalidPrefixError(pluginName string) error { - return fmt.Errorf(`--%s had name %q which must be prefixed by "protoc-gen-"`, pluginPathValuesFlagName, pluginName) -} - -func newDuplicatePluginPathError(pluginName string) error { - return fmt.Errorf("duplicate --%s for protoc-gen-%s", pluginPathValuesFlagName, pluginName) -} - -func newEncodeNotSupportedError() error { - return fmt.Errorf( - `--%s is not supported by buf. - -Buf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand. -Please email us at support@buf.build if this is a need for your organization.`, - encodeFlagName, - ) -} - -func newDecodeNotSupportedError() error { - return fmt.Errorf( - `--%s is not supported by buf. - -Buf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand. -Please email us at support@buf.build if this is a need for your organization.`, - decodeFlagName, - ) -} - -func newDecodeRawNotSupportedError() error { - return fmt.Errorf( - `--%s is not supported by buf. - -Buf only handles the binary and JSON formats for now, however we can support this flag if there is sufficient demand. -Please email us at support@buf.build if this is a need for your organization.`, - decodeRawFlagName, - ) -} - -func newDescriptorSetInNotSupportedError() error { - return fmt.Errorf( - `--%s is not supported by buf. - -Buf will work with cross-repository imports Buf Schema Registry, which will be based on source files, not pre-built Images. -We think this is a much safer option that leads to less errors and more consistent results. - -Please email us at support@buf.build if this is a need for your organization.`, - descriptorSetInFlagName, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags.go deleted file mode 100644 index ece86bb5c1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags.go +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoc - -import ( - "fmt" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/pflag" -) - -const ( - includeDirPathsFlagName = "proto_path" - includeImportsFlagName = "include_imports" - includeSourceInfoFlagName = "include_source_info" - printFreeFieldNumbersFlagName = "print_free_field_numbers" - outputFlagName = "descriptor_set_out" - pluginPathValuesFlagName = "plugin" - errorFormatFlagName = "error_format" - byDirFlagName = "by-dir" - - pluginFakeFlagName = "protoc_plugin_fake" - - encodeFlagName = "encode" - decodeFlagName = "decode" - decodeRawFlagName = "decode_raw" - descriptorSetInFlagName = "descriptor_set_in" -) - -var ( - defaultIncludeDirPaths = []string{"."} - defaultErrorFormat = "gcc" -) - -type flags struct { - IncludeDirPaths []string - IncludeImports bool - IncludeSourceInfo bool - PrintFreeFieldNumbers bool - Output string - ErrorFormat string - ByDir bool -} - -type env struct { - flags - - PluginNamesSortedByOutIndex []string - PluginNameToPluginInfo map[string]*pluginInfo - FilePaths []string -} - -type flagsBuilder struct { - flags - - PluginPathValues []string - - Encode string - Decode string - DecodeRaw bool - DescriptorSetIn []string - - pluginFake []string - pluginNameToValue map[string]*pluginValue -} - -func newFlagsBuilder() *flagsBuilder { - return &flagsBuilder{ - pluginNameToValue: make(map[string]*pluginValue), - } -} - -func (f *flagsBuilder) Bind(flagSet *pflag.FlagSet) { - flagSet.StringSliceVarP( - &f.IncludeDirPaths, - includeDirPathsFlagName, - "I", - // cannot set default due to recursive flag parsing - // no way to differentiate between default and set for now - // perhaps we could rework pflag usage somehow - nil, - `The directory paths to include.`, - ) - flagSet.BoolVar( - &f.IncludeImports, - includeImportsFlagName, - false, - `Include imports in the resulting FileDescriptorSet.`, - ) - flagSet.BoolVar( - &f.IncludeSourceInfo, - includeSourceInfoFlagName, - false, - `Include source info in the resulting FileDescriptorSet.`, - ) - flagSet.BoolVar( - &f.PrintFreeFieldNumbers, - printFreeFieldNumbersFlagName, - false, - `Print the free field numbers of all messages.`, - ) - flagSet.StringVarP( - &f.Output, - outputFlagName, - "o", - "", - fmt.Sprintf( - `The location to write the FileDescriptorSet. Must be one of format %s.`, - buffetch.ImageFormatsString, - ), - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - // cannot set default due to recursive flag parsing - // no way to differentiate between default and set for now - // perhaps we could rework pflag usage somehow - "", - fmt.Sprintf( - `The error format to use. Must be one of format %s.`, - stringutil.SliceToString(bufanalysis.AllFormatStringsWithAliases), - ), - ) - flagSet.StringSliceVar( - &f.PluginPathValues, - pluginPathValuesFlagName, - nil, - `The paths to the plugin executables to use, either in the form "path/to/protoc-gen-foo" or "protoc-gen-foo=path/to/binary".`, - ) - flagSet.BoolVar( - &f.ByDir, - byDirFlagName, - false, - `Execute parallel plugin calls for every directory containing .proto files.`, - ) - - // MUST be a StringArray instead of StringSlice so we do not split on commas - // Otherwise --go_out=foo=bar,baz=bat:out would be treated as --go_out=foo=bar --go_out=baz=bat:out - flagSet.StringArrayVar( - &f.pluginFake, - pluginFakeFlagName, - nil, - `If you are calling this, you should not be.`, - ) - _ = flagSet.MarkHidden(pluginFakeFlagName) - - flagSet.StringVar( - &f.Encode, - encodeFlagName, - "", - `Not supported by buf.`, - ) - _ = flagSet.MarkHidden(encodeFlagName) - flagSet.StringVar( - &f.Decode, - decodeFlagName, - "", - `Not supported by buf.`, - ) - _ = flagSet.MarkHidden(decodeFlagName) - flagSet.BoolVar( - &f.DecodeRaw, - decodeRawFlagName, - false, - `Not supported by buf.`, - ) - _ = flagSet.MarkHidden(decodeRawFlagName) - flagSet.StringSliceVar( - &f.DescriptorSetIn, - descriptorSetInFlagName, - nil, - `Not supported by buf.`, - ) - _ = flagSet.MarkHidden(descriptorSetInFlagName) -} - -func (f *flagsBuilder) Normalize(flagSet *pflag.FlagSet, name string) string { - if name != "descriptor_set_out" && strings.HasSuffix(name, "_out") { - f.pluginFakeParse(name, "_out", true) - return pluginFakeFlagName - } - if strings.HasSuffix(name, "_opt") { - f.pluginFakeParse(name, "_opt", false) - return pluginFakeFlagName - } - return strings.Replace(name, "-", "_", -1) -} - -func (f *flagsBuilder) Build(args []string) (*env, error) { - pluginNameToPluginInfo := make(map[string]*pluginInfo) - seenFlagFilePaths := make(map[string]struct{}) - filePaths, err := f.buildRec(args, pluginNameToPluginInfo, seenFlagFilePaths) - if err != nil { - return nil, err - } - if err := f.checkUnsupported(); err != nil { - return nil, err - } - for pluginName, pluginInfo := range pluginNameToPluginInfo { - if pluginInfo.Out == "" && len(pluginInfo.Opt) > 0 { - return nil, newCannotSpecifyOptWithoutOutError(pluginName) - } - if pluginInfo.Out == "" && pluginInfo.Path != "" { - return nil, newCannotSpecifyPathWithoutOutError(pluginName) - } - } - pluginNamesSortedByOutIndex, err := f.getPluginNamesSortedByOutIndex(pluginNameToPluginInfo) - if err != nil { - return nil, err - } - if len(f.IncludeDirPaths) == 0 { - f.IncludeDirPaths = defaultIncludeDirPaths - } else { - f.IncludeDirPaths = splitIncludeDirPaths(f.IncludeDirPaths) - } - if f.ErrorFormat == "" { - f.ErrorFormat = defaultErrorFormat - } - if len(filePaths) == 0 { - return nil, errNoInputFiles - } - return &env{ - flags: f.flags, - PluginNamesSortedByOutIndex: pluginNamesSortedByOutIndex, - PluginNameToPluginInfo: pluginNameToPluginInfo, - FilePaths: filePaths, - }, nil -} - -func (f *flagsBuilder) pluginFakeParse(name string, suffix string, isOut bool) { - pluginName := strings.TrimSuffix(name, suffix) - pluginValue, ok := f.pluginNameToValue[pluginName] - if !ok { - pluginValue = newPluginValue() - f.pluginNameToValue[pluginName] = pluginValue - } - index := len(f.pluginFake) - if isOut { - pluginValue.OutIndexes = append(pluginValue.OutIndexes, index) - } else { - pluginValue.OptIndexes = append(pluginValue.OptIndexes, index) - } -} - -func (f *flagsBuilder) buildRec( - args []string, - pluginNameToPluginInfo map[string]*pluginInfo, - seenFlagFilePaths map[string]struct{}, -) ([]string, error) { - if err := f.parsePluginNameToPluginInfo(pluginNameToPluginInfo); err != nil { - return nil, err - } - filePaths := make([]string, 0, len(args)) - for _, arg := range args { - if len(arg) == 0 { - return nil, errArgEmpty - } - if arg[0] != '@' { - filePaths = append(filePaths, arg) - } else { - flagFilePath := normalpath.Unnormalize(arg[1:]) - if _, ok := seenFlagFilePaths[flagFilePath]; ok { - return nil, newRecursiveReferenceError(flagFilePath) - } - seenFlagFilePaths[flagFilePath] = struct{}{} - data, err := os.ReadFile(flagFilePath) - if err != nil { - return nil, err - } - var flagFilePathArgs []string - for _, flagFilePathArg := range strings.Split(string(data), "\n") { - flagFilePathArg = strings.TrimSpace(flagFilePathArg) - if flagFilePathArg != "" { - flagFilePathArgs = append(flagFilePathArgs, flagFilePathArg) - } - } - subFlagsBuilder := newFlagsBuilder() - flagSet := pflag.NewFlagSet(flagFilePath, pflag.ContinueOnError) - subFlagsBuilder.Bind(flagSet) - flagSet.SetNormalizeFunc(normalizeFunc(subFlagsBuilder.Normalize)) - if err := flagSet.Parse(flagFilePathArgs); err != nil { - return nil, err - } - subFilePaths, err := subFlagsBuilder.buildRec( - flagSet.Args(), - pluginNameToPluginInfo, - seenFlagFilePaths, - ) - if err != nil { - return nil, err - } - if err := f.merge(subFlagsBuilder); err != nil { - return nil, err - } - filePaths = append(filePaths, subFilePaths...) - } - } - return filePaths, nil -} - -// we need to bind a separate flags as pflags overrides the values with defaults if you bind again -// note that pflags does not error on duplicates so we do not either -func (f *flagsBuilder) merge(subFlagsBuilder *flagsBuilder) error { - f.IncludeDirPaths = append(f.IncludeDirPaths, subFlagsBuilder.IncludeDirPaths...) - if subFlagsBuilder.IncludeImports { - f.IncludeImports = true - } - if subFlagsBuilder.IncludeSourceInfo { - f.IncludeSourceInfo = true - } - if subFlagsBuilder.PrintFreeFieldNumbers { - f.PrintFreeFieldNumbers = true - } - if subFlagsBuilder.Output != "" { - f.Output = subFlagsBuilder.Output - } - if subFlagsBuilder.ErrorFormat != "" { - f.ErrorFormat = subFlagsBuilder.ErrorFormat - } - if subFlagsBuilder.ByDir { - f.ByDir = true - } - f.PluginPathValues = append(f.PluginPathValues, subFlagsBuilder.PluginPathValues...) - if subFlagsBuilder.Encode != "" { - f.Encode = subFlagsBuilder.Encode - } - if subFlagsBuilder.Decode != "" { - f.Decode = subFlagsBuilder.Decode - } - if subFlagsBuilder.DecodeRaw { - f.DecodeRaw = true - } - f.DescriptorSetIn = append(f.DescriptorSetIn, subFlagsBuilder.DescriptorSetIn...) - return nil -} - -func (f *flagsBuilder) parsePluginNameToPluginInfo(pluginNameToPluginInfo map[string]*pluginInfo) error { - for pluginName, pluginValue := range f.pluginNameToValue { - switch len(pluginValue.OutIndexes) { - case 0: - case 1: - out := f.pluginFake[pluginValue.OutIndexes[0]] - var opt string - if isOutNotAFullPath(out) { - split := strings.SplitN(out, ":", 2) - switch len(split) { - case 1: - case 2: - out = split[1] - opt = split[0] - } - } - pluginInfo, ok := pluginNameToPluginInfo[pluginName] - if !ok { - pluginInfo = newPluginInfo() - pluginNameToPluginInfo[pluginName] = pluginInfo - } - pluginInfo.Out = out - if opt != "" { - for _, value := range strings.Split(opt, ",") { - if value := strings.TrimSpace(value); value != "" { - pluginInfo.Opt = append(pluginInfo.Opt, value) - } else { - return newEmptyOptError(pluginName) - } - } - } - default: - return newDuplicateOutError(pluginName) - } - if len(pluginValue.OptIndexes) > 0 { - pluginInfo, ok := pluginNameToPluginInfo[pluginName] - if !ok { - pluginInfo = newPluginInfo() - pluginNameToPluginInfo[pluginName] = pluginInfo - } - for _, optIndex := range pluginValue.OptIndexes { - for _, value := range strings.Split(f.pluginFake[optIndex], ",") { - if value := strings.TrimSpace(value); value != "" { - pluginInfo.Opt = append(pluginInfo.Opt, value) - } else { - return newEmptyOptError(pluginName) - } - } - } - } - } - for _, pluginPathValue := range f.PluginPathValues { - var pluginName string - var pluginPath string - switch split := strings.SplitN(pluginPathValue, "=", 2); len(split) { - case 0: - return newPluginPathValueEmptyError() - case 1: - pluginName = filepath.Base(split[0]) - pluginPath = split[0] - case 2: - pluginName = split[0] - pluginPath = split[1] - default: - return newPluginPathValueInvalidError(pluginPathValue) - } - if !strings.HasPrefix(pluginName, "protoc-gen-") { - return newPluginPathNameInvalidPrefixError(pluginName) - } - pluginName = strings.TrimPrefix(pluginName, "protoc-gen-") - pluginInfo, ok := pluginNameToPluginInfo[pluginName] - if !ok { - pluginInfo = newPluginInfo() - pluginNameToPluginInfo[pluginName] = pluginInfo - } - if pluginInfo.Path != "" { - return newDuplicatePluginPathError(pluginName) - } - pluginInfo.Path = pluginPath - } - return nil -} - -func (f *flagsBuilder) getPluginNamesSortedByOutIndex( - pluginNameToPluginInfo map[string]*pluginInfo, -) ([]string, error) { - pluginNames := make([]string, 0, len(pluginNameToPluginInfo)) - for pluginName := range pluginNameToPluginInfo { - pluginNames = append(pluginNames, pluginName) - } - var err error - sort.Slice( - pluginNames, - func(i int, j int) bool { - pluginName1 := pluginNames[i] - pluginName2 := pluginNames[j] - pluginValue1, ok := f.pluginNameToValue[pluginName1] - if !ok { - err = fmt.Errorf("no value for plugin name %q inside pluginNameToValue", pluginName1) - return false - } - pluginValue2, ok := f.pluginNameToValue[pluginName2] - if !ok { - err = fmt.Errorf("no value for plugin name %q inside pluginNameToValue", pluginName2) - return false - } - if len(pluginValue1.OutIndexes) != 1 { - err = fmt.Errorf("%d out indexes for plugin name %q", len(pluginValue1.OutIndexes), pluginName1) - return false - } - if len(pluginValue2.OutIndexes) != 1 { - err = fmt.Errorf("%d out indexes for plugin name %q", len(pluginValue2.OutIndexes), pluginName2) - return false - } - return pluginValue1.OutIndexes[0] < pluginValue2.OutIndexes[0] - }, - ) - if err != nil { - return nil, err - } - return pluginNames, nil -} - -func (f *flagsBuilder) checkUnsupported() error { - if f.Encode != "" { - return newEncodeNotSupportedError() - } - if f.Decode != "" { - return newDecodeNotSupportedError() - } - if f.DecodeRaw { - return newDecodeRawNotSupportedError() - } - if len(f.DescriptorSetIn) > 0 { - return newDescriptorSetInNotSupportedError() - } - return nil -} - -type pluginValue struct { - OutIndexes []int - OptIndexes []int -} - -func newPluginValue() *pluginValue { - return &pluginValue{} -} - -func normalizeFunc(f func(*pflag.FlagSet, string) string) func(*pflag.FlagSet, string) pflag.NormalizedName { - return func(flagSet *pflag.FlagSet, name string) pflag.NormalizedName { - return pflag.NormalizedName(f(flagSet, name)) - } -} - -// https://github.com/protocolbuffers/protobuf/blob/336ed1820a4f2649c9aa3953d5059b03b7a77100/src/google/protobuf/compiler/command_line_interface.cc#L1699-L1705 -// -// This roughly supports the equivalent of Java's -classpath flag. -// Note that for filenames such as "foo:bar" on unix, this breaks, but our goal is to match -// this flag from protoc. -func splitIncludeDirPaths(includeDirPaths []string) []string { - copyIncludeDirPaths := make([]string, 0, len(includeDirPaths)) - for _, includeDirPath := range includeDirPaths { - // protocolbuffers/protobuf has true for omit_empty - for _, splitIncludeDirPath := range strings.Split(includeDirPath, includeDirPathSeparator) { - if len(splitIncludeDirPath) > 0 { - copyIncludeDirPaths = append(copyIncludeDirPaths, splitIncludeDirPath) - } - } - } - return copyIncludeDirPaths -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_unix.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_unix.go deleted file mode 100644 index 86ccb0315f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_unix.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package protoc - -// isOutNotAFullPath checks if we need to consider the path to be a full path. -// -// This is always true in unix, and is true if the path is not absolute in windows. -// This is needed because i.e.: -// -// # unix -// --go_out=opt:foo/bar -// --go_out=foo/bar -// # windows -// --go_out=opt:C:\foo\bar -// --go_out=C:\foo\bar -// -// protoc uses : in both unix and windows to separate the opt and out, but in windows, -// if a full path is given, then we don't want it interpreted as something we should split. -func isOutNotAFullPath(path string) bool { - return true -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_windows.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_windows.go deleted file mode 100644 index c3b8b586ec..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/flags_windows.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package protoc - -import ( - "path/filepath" -) - -// isOutNotAFullPath checks if we need to consider the path to be a full path. -// -// This is always true in unix, and is true if the path is not absolute in windows. -// This is needed because i.e.: -// -// # unix -// --go_out=opt:foo/bar -// --go_out=foo/bar -// # windows -// --go_out=opt:C:\foo\bar -// --go_out=C:\foo\bar -// -// protoc uses : in both unix and windows to separate the opt and out, but in windows, -// if a full path is given, then we don't want it interpreted as something we should split. -func isOutNotAFullPath(path string) bool { - return !filepath.IsAbs(path) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/plugin.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/plugin.go deleted file mode 100644 index 93cdf1245d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/plugin.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoc - -import ( - "context" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufpluginexec" - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -type pluginInfo struct { - // Required - Out string - // optional - Opt []string - // optional - Path string -} - -func newPluginInfo() *pluginInfo { - return &pluginInfo{} -} - -func executePlugin( - ctx context.Context, - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, - container app.EnvStderrContainer, - images []bufimage.Image, - pluginName string, - pluginInfo *pluginInfo, -) (*pluginpb.CodeGeneratorResponse, error) { - generator := bufpluginexec.NewGenerator( - logger, - storageosProvider, - runner, - wasmPluginExecutor, - ) - var options []bufpluginexec.GenerateOption - if pluginInfo.Path != "" { - options = append(options, bufpluginexec.GenerateWithPluginPath(pluginInfo.Path)) - } - wasmEnabled, err := bufcli.IsAlphaWASMEnabled(container) - if err != nil { - return nil, err - } - if wasmEnabled { - options = append(options, bufpluginexec.GenerateWithWASMEnabled()) - } - response, err := generator.Generate( - ctx, - container, - pluginName, - bufimage.ImagesToCodeGeneratorRequests( - images, - strings.Join(pluginInfo.Opt, ","), - bufpluginexec.DefaultVersion, - false, - false, - ), - options..., - ) - if err != nil { - return nil, fmt.Errorf("--%s_out: %v", pluginName, err) - } - return response, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/protoc.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/protoc.go deleted file mode 100644 index 8c668dbea3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/protoc.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoc - -import ( - "context" - "fmt" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufpluginexec" - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flagsBuilder := newFlagsBuilder() - return &appcmd.Command{ - Use: name + " ...", - Short: "High-performance protoc replacement", - Long: `This command replaces protoc using Buf's internal compiler. - -The implementation is in progress. Although it outperforms mainline protoc, -it hasn't yet been optimized. - -This protoc replacement is currently stable but should be considered a preview. - -Additional flags: - - --(.*)_out: Run the named plugin. - --(.*)_opt: Options for the named plugin. - @filename: Parse arguments from the given filename.`, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - env, err := flagsBuilder.Build(app.Args(container)) - if err != nil { - return err - } - return run(ctx, container, env) - }, - ), - BindFlags: flagsBuilder.Bind, - NormalizeFlag: flagsBuilder.Normalize, - Version: fmt.Sprintf( - "%v.%v.%v-buf", - bufpluginexec.DefaultVersion.GetMajor(), - bufpluginexec.DefaultVersion.GetMinor(), - bufpluginexec.DefaultVersion.GetPatch(), - ), - } -} - -func run( - ctx context.Context, - container appflag.Container, - env *env, -) (retErr error) { - if env.PrintFreeFieldNumbers && len(env.PluginNameToPluginInfo) > 0 { - return fmt.Errorf("cannot call --%s and plugins at the same time", printFreeFieldNumbersFlagName) - } - if env.PrintFreeFieldNumbers && env.Output != "" { - return fmt.Errorf("cannot call --%s and --%s at the same time", printFreeFieldNumbersFlagName, outputFlagName) - } - if len(env.PluginNameToPluginInfo) > 0 && env.Output != "" { - return fmt.Errorf("cannot call --%s and plugins at the same time", outputFlagName) - } - - if checkedEntry := container.Logger().Check(zapcore.DebugLevel, "env"); checkedEntry != nil { - checkedEntry.Write( - zap.Any("flags", env.flags), - zap.Any("plugins", env.PluginNameToPluginInfo), - ) - } - - var buildOption bufmodulebuild.BuildOption - if len(env.FilePaths) > 0 { - buildOption = bufmodulebuild.WithPaths(env.FilePaths) - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - runner := command.NewRunner() - module, err := bufmodulebuild.NewModuleIncludeBuilder(container.Logger(), storageosProvider).BuildForIncludes( - ctx, - env.IncludeDirPaths, - buildOption, - ) - if err != nil { - return err - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - var buildOptions []bufimagebuild.BuildOption - // we always need source code info if we are doing generation - if len(env.PluginNameToPluginInfo) == 0 && !env.IncludeSourceInfo { - buildOptions = append(buildOptions, bufimagebuild.WithExcludeSourceCodeInfo()) - } - image, fileAnnotations, err := bufimagebuild.NewBuilder(container.Logger(), moduleReader).Build( - ctx, - module, - buildOptions..., - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - env.ErrorFormat, - ); err != nil { - return err - } - // we do this even though we're in protoc compatibility mode as we just need to do non-zero - // but this also makes us consistent with the rest of buf - return bufcli.ErrFileAnnotation - } - - if env.PrintFreeFieldNumbers { - fileInfos, err := module.TargetFileInfos(ctx) - if err != nil { - return err - } - var filePaths []string - for _, fileInfo := range fileInfos { - filePaths = append(filePaths, fileInfo.Path()) - } - s, err := bufimageutil.FreeMessageRangeStrings(ctx, filePaths, image) - if err != nil { - return err - } - if _, err := container.Stdout().Write([]byte(strings.Join(s, "\n") + "\n")); err != nil { - return err - } - return nil - } - if len(env.PluginNameToPluginInfo) > 0 { - images := []bufimage.Image{image} - if env.ByDir { - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "image_by_dir") - images, err = bufimage.ImageByDir(image) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - span.End() - return err - } - span.End() - } - wasmPluginExecutor, err := bufwasm.NewPluginExecutor( - filepath.Join(container.CacheDirPath(), bufcli.WASMCompilationCacheDir)) - if err != nil { - return err - } - pluginResponses := make([]*appproto.PluginResponse, 0, len(env.PluginNamesSortedByOutIndex)) - for _, pluginName := range env.PluginNamesSortedByOutIndex { - pluginInfo, ok := env.PluginNameToPluginInfo[pluginName] - if !ok { - return fmt.Errorf("no value in PluginNamesToPluginInfo for %q", pluginName) - } - response, err := executePlugin( - ctx, - container.Logger(), - storageosProvider, - runner, - wasmPluginExecutor, - container, - images, - pluginName, - pluginInfo, - ) - if err != nil { - return err - } - pluginResponses = append(pluginResponses, appproto.NewPluginResponse(response, pluginName, pluginInfo.Out)) - } - if err := appproto.ValidatePluginResponses(pluginResponses); err != nil { - return err - } - responseWriter := appprotoos.NewResponseWriter( - container.Logger(), - storageosProvider, - ) - for _, pluginResponse := range pluginResponses { - pluginInfo, ok := env.PluginNameToPluginInfo[pluginResponse.PluginName] - if !ok { - return fmt.Errorf("no value in PluginNamesToPluginInfo for %q", pluginResponse.PluginName) - } - if err := responseWriter.AddResponse( - ctx, - pluginResponse.Response, - pluginInfo.Out, - ); err != nil { - return err - } - } - if err := responseWriter.Close(); err != nil { - return err - } - return nil - } - if env.Output == "" { - return appcmd.NewInvalidArgumentErrorf("required flag %q not set", outputFlagName) - } - imageRef, err := buffetch.NewImageRefParser(container.Logger()).GetImageRef(ctx, env.Output) - if err != nil { - return fmt.Errorf("--%s: %v", outputFlagName, err) - } - return bufcli.NewWireImageWriter(container.Logger()).PutImage(ctx, - container, - imageRef, - image, - true, - !env.IncludeImports, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/usage.gen.go deleted file mode 100644 index f9dd209ecb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/protoc/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protoc - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/tokendelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/tokendelete.go deleted file mode 100644 index 08647dd423..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/tokendelete.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tokendelete - -import ( - "context" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - forceFlagName = "force" - tokenIDFlagName = "token-id" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Delete a token by ID", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Force bool - TokenID string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.BoolVar( - &f.Force, - forceFlagName, - false, - "Force deletion without confirming. Use with caution", - ) - flagSet.StringVar( - &f.TokenID, - tokenIDFlagName, - "", - "The ID of the token to delete", - ) - _ = cobra.MarkFlagRequired(flagSet, tokenIDFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - remote := container.Arg(0) - if err := bufmoduleref.ValidateRemoteNotEmpty(remote); err != nil { - return err - } - if err := bufmoduleref.ValidateRemoteHasNoPaths(remote); err != nil { - return err - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewTokenServiceClient) - if !flags.Force { - if err := bufcli.PromptUserForDelete(container, "token", flags.TokenID); err != nil { - return err - } - } - if _, err := service.DeleteToken( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteTokenRequest{ - TokenId: flags.TokenID, - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewTokenNotFoundError(flags.TokenID) - } - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/usage.gen.go deleted file mode 100644 index bd8cfc8008..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokendelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package tokendelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/tokenget.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/tokenget.go deleted file mode 100644 index 9d35bfc853..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/tokenget.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tokenget - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - formatFlagName = "format" - tokenIDFlagName = "token-id" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get a token by ID", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string - TokenID string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) - flagSet.StringVar( - &f.TokenID, - tokenIDFlagName, - "", - "The ID of the token to get", - ) - _ = cobra.MarkFlagRequired(flagSet, tokenIDFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnAlphaCommand(ctx, container) - remote := container.Arg(0) - if err := bufmoduleref.ValidateRemoteNotEmpty(remote); err != nil { - return err - } - if err := bufmoduleref.ValidateRemoteHasNoPaths(remote); err != nil { - return err - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewTokenServiceClient) - resp, err := service.GetToken( - ctx, - connect.NewRequest(®istryv1alpha1.GetTokenRequest{ - TokenId: flags.TokenID, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewTokenNotFoundError(flags.TokenID) - } - return err - } - printer, err := bufprint.NewTokenPrinter(container.Stdout(), format) - if err != nil { - return bufcli.NewInternalError(err) - } - return printer.PrintTokens(ctx, resp.Msg.Token) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/usage.gen.go deleted file mode 100644 index 9474c7dbad..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenget/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package tokenget - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/tokenlist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/tokenlist.go deleted file mode 100644 index f406aa62c4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/tokenlist.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tokenlist - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pageSizeFlagName = "page-size" - pageTokenFlagName = "page-token" - reverseFlagName = "reverse" - formatFlagName = "format" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List user tokens", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - PageSize uint32 - PageToken string - Reverse bool - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.Uint32Var(&f.PageSize, - pageSizeFlagName, - 10, - `The page size.`, - ) - flagSet.StringVar(&f.PageToken, - pageTokenFlagName, - "", - `The page token. If more results are available, a "next_page" key is present in the --format=json output.`, - ) - flagSet.BoolVar(&f.Reverse, - reverseFlagName, - false, - `Reverse the results.`, - ) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - bufcli.WarnAlphaCommand(ctx, container) - remote := container.Arg(0) - if err := bufmoduleref.ValidateRemoteNotEmpty(remote); err != nil { - return err - } - if err := bufmoduleref.ValidateRemoteHasNoPaths(remote); err != nil { - return err - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewTokenServiceClient) - resp, err := service.ListTokens( - ctx, - connect.NewRequest(®istryv1alpha1.ListTokensRequest{ - PageSize: flags.PageSize, - PageToken: flags.PageToken, - Reverse: flags.Reverse, - }), - ) - if err != nil { - return err - } - printer, err := bufprint.NewTokenPrinter(container.Stdout(), format) - if err != nil { - return bufcli.NewInternalError(err) - } - // TODO: flag docs say "next_token" field will be present in the output, - // for paging through results but we are actually ignoring that field now. - return printer.PrintTokens(ctx, resp.Msg.Tokens...) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/usage.gen.go deleted file mode 100644 index da03e4100c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/registry/token/tokenlist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package tokenlist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/reposync.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/reposync.go deleted file mode 100644 index e18d295583..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/reposync.go +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package reposync - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufsync" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmanifest" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagegit" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "go.uber.org/zap" - "google.golang.org/protobuf/types/known/timestamppb" -) - -const ( - errorFormatFlagName = "error-format" - moduleFlagName = "module" - createFlagName = "create" - createVisibilityFlagName = "create-visibility" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "Sync a Git repository to a registry", - Long: "Sync a Git repository's commits to a registry in topological order. " + - "Only commits belonging to the 'origin' remote are processed, which means that " + - "commits must be pushed to a remote. " + - "Only modules specified via '--module' are synced.", - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ErrorFormat string - Modules []string - Create bool - CreateVisibility string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - // TODO: before we take this to beta, and as part of mult-module support, re-evaluate the UX of this flag - flagSet.StringArrayVar( - &f.Modules, - moduleFlagName, - nil, - "The module(s) to sync to the BSR; this must be in the format :", - ) - bufcli.BindCreateVisibility(flagSet, &f.CreateVisibility, createVisibilityFlagName, createFlagName) - flagSet.BoolVar( - &f.Create, - createFlagName, - false, - fmt.Sprintf("Create the repository if it does not exist. Must set a visibility using --%s", createVisibilityFlagName), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - if flags.CreateVisibility != "" { - if !flags.Create { - return appcmd.NewInvalidArgumentErrorf("Cannot set --%s without --%s.", createVisibilityFlagName, createFlagName) - } - // We re-parse below as needed, but do not return an appcmd.NewInvalidArgumentError below as - // we expect validation to be handled here. - if _, err := bufcli.VisibilityFlagToVisibility(flags.CreateVisibility); err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - } else if flags.Create { - return appcmd.NewInvalidArgumentErrorf("--%s is required if --%s is set.", createVisibilityFlagName, createFlagName) - } - return sync( - ctx, - container, - flags.Modules, - // No need to pass `flags.Create`, this is not empty iff `flags.Create` - flags.CreateVisibility, - ) -} - -func sync( - ctx context.Context, - container appflag.Container, - modules []string, - createWithVisibility string, -) error { - // Assume that this command is run from the repository root. If not, `OpenRepository` will return - // a dir not found error. - repo, err := git.OpenRepository(git.DotGitDir, command.NewRunner()) - if err != nil { - return err - } - defer repo.Close() - storageProvider := storagegit.NewProvider( - repo.Objects(), - storagegit.ProviderWithSymlinks(), - ) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return fmt.Errorf("create connect client %w", err) - } - syncerOptions := []bufsync.SyncerOption{ - bufsync.SyncerWithResumption(syncPointResolver(clientConfig)), - } - for _, module := range modules { - var moduleIdentityOverride bufmoduleref.ModuleIdentity - colon := strings.IndexRune(module, ':') - if colon == -1 { - return appcmd.NewInvalidArgumentErrorf("module %s is missing an identity", module) - } - moduleIdentityOverride, err = bufmoduleref.ModuleIdentityForString(module[colon+1:]) - if err != nil { - return err - } - module = normalpath.Normalize(module[:colon]) - syncModule, err := bufsync.NewModule(module, moduleIdentityOverride) - if err != nil { - return err - } - syncerOptions = append(syncerOptions, bufsync.SyncerWithModule(syncModule)) - } - syncer, err := bufsync.NewSyncer( - container.Logger(), - repo, - storageProvider, - newErrorHandler(container.Logger()), - syncerOptions..., - ) - if err != nil { - return err - } - return syncer.Sync(ctx, func(ctx context.Context, commit bufsync.ModuleCommit) error { - syncPoint, err := pushOrCreate( - ctx, - clientConfig, - repo, - commit.Commit(), - commit.Branch(), - commit.Tags(), - commit.Identity(), - commit.Bucket(), - createWithVisibility, - ) - if err != nil { - // We failed to push. We fail hard on this because the error may be recoverable - // (i.e., the BSR may be down) and we should re-attempt this commit. - return fmt.Errorf( - "failed to push %s at %s: %w", - commit.Identity().IdentityString(), - commit.Commit().Hash(), - err, - ) - } - _, err = container.Stderr().Write([]byte( - fmt.Sprintf("%s:%s\n", commit.Identity().IdentityString(), syncPoint.BsrCommitName)), - ) - return err - }) -} - -func syncPointResolver(clientConfig *connectclient.Config) bufsync.SyncPointResolver { - return func(ctx context.Context, identity bufmoduleref.ModuleIdentity, branch string) (git.Hash, error) { - service := connectclient.Make(clientConfig, identity.Remote(), registryv1alpha1connect.NewSyncServiceClient) - syncPoint, err := service.GetGitSyncPoint(ctx, connect.NewRequest(®istryv1alpha1.GetGitSyncPointRequest{ - Owner: identity.Owner(), - Repository: identity.Repository(), - Branch: branch, - })) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - // No syncpoint - return nil, nil - } - return nil, err - } - hash, err := git.NewHashFromHex(syncPoint.Msg.GetSyncPoint().GitCommitHash) - if err != nil { - return nil, fmt.Errorf( - "invalid sync point from BSR %q: %w", - syncPoint.Msg.GetSyncPoint().GetGitCommitHash(), - err, - ) - } - return hash, nil - } -} - -type syncErrorHandler struct { - logger *zap.Logger -} - -func newErrorHandler(logger *zap.Logger) bufsync.ErrorHandler { - return &syncErrorHandler{logger: logger} -} - -func (s *syncErrorHandler) BuildFailure(module bufsync.Module, commit git.Commit, err error) error { - // We failed to build the module. We can warn on this and carry on. - // Note that because of resumption, Syncer will typically only come - // across this commit once, we will not log this warning again. - s.logger.Warn( - "invalid module", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - zap.Error(err), - ) - return nil -} - -func (s *syncErrorHandler) InvalidModuleConfig(module bufsync.Module, commit git.Commit, err error) error { - // We found a module but the module config is invalid. We can warn on this - // and carry on. Note that because of resumption, Syncer will typically only come - // across this commit once, we will not log this warning again. - s.logger.Warn( - "invalid module", - zap.Stringer("commit", commit.Hash()), - zap.Stringer("module", module), - zap.Error(err), - ) - return nil -} - -func (s *syncErrorHandler) InvalidSyncPoint( - module bufsync.Module, - branch string, - syncPoint git.Hash, - err error, -) error { - // The most likely culprit for an invalid sync point is a rebase, where the last known - // commit has been garbage collected. In this case, let's present a better error message. - // - // We may want to provide a flag for sync to continue despite this, accumulating the error, - // and error at the end, so that other branches can continue to sync, but this branch is - // out of date. This is not trivial if the branch that's been rebased is a long-lived - // branch (like main) whose artifacts are consumed by other branches, as we may fail to - // sync those commits if we continue. So we now we simply error. - if errors.Is(err, git.ErrObjectNotFound) { - return fmt.Errorf( - "last synced commit %s was not found for module %s; did you rebase?", - syncPoint, - module, - ) - } - // Otherwise, we still want this to fail sync, let's bubble this up. - return err -} - -func (s *syncErrorHandler) SyncPointNotEncountered( - module bufsync.Module, - branch string, - syncPoint git.Hash, -) error { - // This can happen if the user rebased, but Git has not garbage collected the old commits, - // so the sync point was considered valid. Maybe there are other cases in which this can happen... - // This is a hard failure for now, but similar to InvalidSyncPoint, we can maybe accumulate - // these and error at the end, so that other branches continue to sync. - return fmt.Errorf( - "sync point %s for %s on branch %s was not encountered; did you rebase? Try running `git gc` and running sync again", - syncPoint, - module, - branch, - ) -} - -func pushOrCreate( - ctx context.Context, - clientConfig *connectclient.Config, - repo git.Repository, - commit git.Commit, - branch string, - tags []string, - moduleIdentity bufmoduleref.ModuleIdentity, - moduleBucket storage.ReadBucket, - createWithVisibility string, -) (*registryv1alpha1.GitSyncPoint, error) { - modulePin, err := push( - ctx, - clientConfig, - repo, - commit, - branch, - tags, - moduleIdentity, - moduleBucket, - ) - if err != nil { - // We rely on Push* returning a NotFound error to denote the repository is not created. - // This technically could be a NotFound error for some other entity than the repository - // in question, however if it is, then this Create call will just fail as the repository - // is already created, and there is no side effect. The 99% case is that a NotFound - // error is because the repository does not exist, and we want to avoid having to do - // a GetRepository RPC call for every call to push --create. - if createWithVisibility != "" && connect.CodeOf(err) == connect.CodeNotFound { - if err := create(ctx, clientConfig, moduleIdentity, createWithVisibility); err != nil { - return nil, err - } - return push( - ctx, - clientConfig, - repo, - commit, - branch, - tags, - moduleIdentity, - moduleBucket, - ) - } - return nil, err - } - return modulePin, nil -} - -func push( - ctx context.Context, - clientConfig *connectclient.Config, - repo git.Repository, - commit git.Commit, - branch string, - tags []string, - moduleIdentity bufmoduleref.ModuleIdentity, - moduleBucket storage.ReadBucket, -) (*registryv1alpha1.GitSyncPoint, error) { - service := connectclient.Make(clientConfig, moduleIdentity.Remote(), registryv1alpha1connect.NewSyncServiceClient) - m, blobSet, err := manifest.NewFromBucket(ctx, moduleBucket) - if err != nil { - return nil, err - } - bucketManifest, blobs, err := bufmanifest.ToProtoManifestAndBlobs(ctx, m, blobSet) - if err != nil { - return nil, err - } - if repo.BaseBranch() == branch { - // We are pushing a commit on the base branch of this repository. - // The BSR represents the base track as "main", and this is not configurable - // per module. - branch = bufmoduleref.Main - } - resp, err := service.SyncGitCommit(ctx, connect.NewRequest(®istryv1alpha1.SyncGitCommitRequest{ - Owner: moduleIdentity.Owner(), - Repository: moduleIdentity.Repository(), - Manifest: bucketManifest, - Blobs: blobs, - Hash: commit.Hash().Hex(), - Branch: branch, - Tags: tags, - Author: ®istryv1alpha1.GitIdentity{ - Name: commit.Author().Name(), - Email: commit.Author().Email(), - Time: timestamppb.New(commit.Author().Timestamp()), - }, - Commiter: ®istryv1alpha1.GitIdentity{ - Name: commit.Committer().Name(), - Email: commit.Committer().Email(), - Time: timestamppb.New(commit.Committer().Timestamp()), - }, - })) - if err != nil { - return nil, err - } - return resp.Msg.SyncPoint, nil -} - -func create( - ctx context.Context, - clientConfig *connectclient.Config, - moduleIdentity bufmoduleref.ModuleIdentity, - visibility string, -) error { - service := connectclient.Make(clientConfig, moduleIdentity.Remote(), registryv1alpha1connect.NewRepositoryServiceClient) - visiblity, err := bufcli.VisibilityFlagToVisibility(visibility) - if err != nil { - return err - } - fullName := moduleIdentity.Owner() + "/" + moduleIdentity.Repository() - _, err = service.CreateRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.CreateRepositoryByFullNameRequest{ - FullName: fullName, - Visibility: visiblity, - }), - ) - if err != nil && connect.CodeOf(err) == connect.CodeAlreadyExists { - return connect.NewError(connect.CodeInternal, fmt.Errorf("expected repository %s to be missing but found the repository to already exist", fullName)) - } - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/usage.gen.go deleted file mode 100644 index 37f15e2784..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/repo/reposync/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package reposync - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/usage.gen.go deleted file mode 100644 index 755017e532..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package workspacepush - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/workspacepush.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/workspacepush.go deleted file mode 100644 index 98500c4bf7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/alpha/workspace/workspacepush/workspacepush.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package workspacepush - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - tagFlagName = "tag" - tagFlagShortName = "t" - errorFormatFlagName = "error-format" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "Push a workspace to a registry", - Long: "Push a workspace to a registry in topological order. After this command, " + - "buf.lock files may be updated and need to be committed and pushed.", - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Tags []string - ErrorFormat string - DisableSymlinks bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.StringSliceVarP( - &f.Tags, - tagFlagName, - tagFlagShortName, - nil, - "Create a tag for the pushed commit. Multiple tags are created if specified multiple times.", - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - - /* - TODO(smian): very roughly, we will want to: - 1. load the workspace - 2. foreach module in (get modules in topological order) - 1. `mod update` workspace-local dependencies from module - 2. push module (handle idential commit) - 3. print all pushed modules - */ - return errors.New("unimplemented") -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/graph.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/graph.go deleted file mode 100644 index 4bb34c5403..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/graph.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package graph - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufwire" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufapimodule" - "github.com/bufbuild/buf/private/bufpkg/bufgraph" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - errorFormatFlagName = "error-format" - configFlagName = "config" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Print the dependency graph in DOT format", - Long: bufcli.GetSourceOrModuleLong(`the source or module to print for`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ErrorFormat string - Config string - DisableSymlinks bool - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The file or data to use to use for configuration`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - sourceOrModuleRef, err := buffetch.NewRefParser(container.Logger()).GetSourceOrModuleRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleResolver := bufapimodule.NewModuleResolver( - container.Logger(), - bufapimodule.NewRepositoryCommitServiceClientFactory(clientConfig), - ) - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - moduleConfigReader := bufwire.NewModuleConfigReader( - container.Logger(), - storageosProvider, - bufcli.NewFetchReader(container.Logger(), storageosProvider, runner, moduleResolver, moduleReader), - bufmodulebuild.NewModuleBucketBuilder(), - ) - if err != nil { - return err - } - graphBuilder := bufgraph.NewBuilder( - container.Logger(), - moduleResolver, - moduleReader, - ) - moduleConfigSet, err := moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - flags.Config, - nil, - nil, - false, - ) - if err != nil { - return err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - modules := make([]bufmodule.Module, len(moduleConfigs)) - for i, moduleConfig := range moduleConfigs { - modules[i] = moduleConfig.Module() - } - graph, fileAnnotations, err := graphBuilder.Build( - ctx, - modules, - bufgraph.BuildWithWorkspace(moduleConfigSet.Workspace()), - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - // stderr since we do output to stdout potentially - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - flags.ErrorFormat, - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - dotString, err := graph.DOTString( - func(node bufgraph.Node) string { - return node.String() - }, - ) - if err != nil { - return err - } - _, err = fmt.Fprintln(container.Stdout(), dotString) - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/usage.gen.go deleted file mode 100644 index f674903503..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/graph/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package graph - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go deleted file mode 100644 index 26417560b1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/migratev1beta1.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package migratev1beta1 - -import ( - "context" - - "github.com/bufbuild/buf/private/buf/bufmigrate" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: `Migrate v1beta1 configuration to the latest version`, - Long: `Migrate any v1beta1 configuration files in the directory to the latest version. -Defaults to the current directory if not specified.`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - ), - BindFlags: flags.Bind, - } -} - -type flags struct{} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) {} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - dirPath, err := getDirPath(container) - if err != nil { - return err - } - return bufmigrate.NewV1Beta1Migrator( - "buf config migrate-v1beta1", - bufmigrate.V1Beta1MigratorWithNotifier(newWriteMessageFunc(container)), - ).Migrate(dirPath) -} - -func getDirPath(container app.Container) (string, error) { - switch numArgs := container.NumArgs(); numArgs { - case 0: - return ".", nil - case 1: - return container.Arg(0), nil - default: - return "", appcmd.NewInvalidArgumentErrorf("only 1 argument allowed but %d arguments specified", numArgs) - } -} - -func newWriteMessageFunc(container app.StderrContainer) func(string) error { - return func(message string) error { - _, err := container.Stderr().Write([]byte(message)) - return err - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go deleted file mode 100644 index a3de0ecf16..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/migratev1beta1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package migratev1beta1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/price.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/price.go deleted file mode 100644 index c8b469ceda..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/price.go +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package price - -import ( - "context" - "fmt" - "math" - "text/template" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/protostat" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - disableSymlinksFlagName = "disable-symlinks" - teamsDollarsPerType = float64(0.50) - proDollarsPerType = float64(1.50) - teamsDollarsPerTypeDiscounted = float64(0.40) - proDollarsPerTypeDiscounted = float64(1.20) - proDollarsMinimumSpend = float64(600) - tmplCopy = `Current BSR pricing: - - - Teams: $0.50 per type - - Pro: $1.50 per type, with a minimum spend of $600 per month - -If you sign up before October 15, 2023, we will give you a 20% discount for the first year: - - - Teams: $0.40 per type for the first year - - Pro: $1.20 per type for the first year, with a minimum spend of $600 per month - -Pricing data last updated on July 5, 2023. - -Make sure you are on the latest version of the Buf CLI to get the most updated pricing -information, and see buf.build/pricing if in doubt - this command runs completely locally -and does not interact with our servers. - -Your sources have: - - - {{.NumMessages}} messages - - {{.NumEnums}} enums - - {{.NumMethods}} methods - -This adds up to {{.NumTypes}} types. - -Based on this, these sources will cost: - -- ${{.TeamsDollarsPerMonth}}/month for Teams -- ${{.ProDollarsPerMonth}}/month for Pro - -If you sign up before October 15, 2023, for the first year, these sources will cost: - -- ${{.TeamsDollarsPerMonthDiscounted}}/month for Teams -- ${{.ProDollarsPerMonthDiscounted}}/month for Pro - -These values should be treated as an estimate - we price based on the average number -of private types you have on the BSR during your billing period. -` -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get the price for BSR paid plans for a given source or module", - Long: bufcli.GetSourceOrModuleLong(`the source or module to get a price for`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - DisableSymlinks bool - - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - sourceOrModuleRef, err := buffetch.NewRefParser(container.Logger()).GetSourceOrModuleRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - moduleConfigReader, err := bufcli.NewWireModuleConfigReaderForModuleReader( - container, - storageosProvider, - runner, - clientConfig, - moduleReader, - ) - if err != nil { - return err - } - moduleConfigSet, err := moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - "", - nil, - nil, - false, - ) - if err != nil { - return err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - statsSlice := make([]*protostat.Stats, len(moduleConfigs)) - for i, moduleConfig := range moduleConfigs { - stats, err := protostat.GetStats(ctx, bufmodulestat.NewFileWalker(moduleConfig.Module())) - if err != nil { - return err - } - statsSlice[i] = stats - } - tmpl, err := template.New("tmpl").Parse(tmplCopy) - if err != nil { - return err - } - return tmpl.Execute( - container.Stdout(), - newTmplData(protostat.MergeStats(statsSlice...)), - ) -} - -type tmplData struct { - *protostat.Stats - - NumTypes int - TeamsDollarsPerMonth string - ProDollarsPerMonth string - TeamsDollarsPerMonthDiscounted string - ProDollarsPerMonthDiscounted string -} - -func newTmplData(stats *protostat.Stats) *tmplData { - tmplData := &tmplData{ - Stats: stats, - NumTypes: stats.NumMessages + stats.NumEnums + stats.NumMethods, - } - tmplData.TeamsDollarsPerMonth = fmt.Sprintf("%.2f", float64(tmplData.NumTypes)*teamsDollarsPerType) - tmplData.ProDollarsPerMonth = fmt.Sprintf( - "%.2f", - math.Max(float64(tmplData.NumTypes)*proDollarsPerType, proDollarsMinimumSpend), - ) - tmplData.TeamsDollarsPerMonthDiscounted = fmt.Sprintf("%.2f", float64(tmplData.NumTypes)*teamsDollarsPerTypeDiscounted) - tmplData.ProDollarsPerMonthDiscounted = fmt.Sprintf( - "%.2f", - math.Max(float64(tmplData.NumTypes)*proDollarsPerTypeDiscounted, proDollarsMinimumSpend), - ) - return tmplData -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/usage.gen.go deleted file mode 100644 index 0460186684..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/price/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package price - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/commitget.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/commitget.go deleted file mode 100644 index 5266e93a86..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/commitget.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package commitget - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const formatFlagName = "format" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get commit details", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleReference, err := bufmoduleref.ModuleReferenceForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewRepositoryCommitServiceClient, - ) - resp, err := service.GetRepositoryCommitByReference( - ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryCommitByReferenceRequest{ - RepositoryOwner: moduleReference.Owner(), - RepositoryName: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewModuleReferenceNotFoundError(moduleReference) - } - return err - } - return bufprint.NewRepositoryCommitPrinter(container.Stdout()). - PrintRepositoryCommit(ctx, format, resp.Msg.RepositoryCommit) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/usage.gen.go deleted file mode 100644 index 607d04a7ca..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitget/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package commitget - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/commitlist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/commitlist.go deleted file mode 100644 index 98664e14f1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/commitlist.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package commitlist - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pageSizeFlagName = "page-size" - pageTokenFlagName = "page-token" - reverseFlagName = "reverse" - formatFlagName = "format" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List repository commits", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string - PageSize uint32 - PageToken string - Reverse bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.Uint32Var(&f.PageSize, - pageSizeFlagName, - 10, - `The page size`, - ) - flagSet.StringVar(&f.PageToken, - pageTokenFlagName, - "", - `The page token. If more results are available, a "next_page" key is present in the --format=json output`, - ) - flagSet.BoolVar(&f.Reverse, - reverseFlagName, - false, - `Reverse the results`, - ) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleReference, err := bufmoduleref.ModuleReferenceForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewRepositoryCommitServiceClient, - ) - - reference := moduleReference.Reference() - if reference == "" { - reference = bufmoduleref.Main - } - - resp, err := service.ListRepositoryCommitsByReference( - ctx, - connect.NewRequest(®istryv1alpha1.ListRepositoryCommitsByReferenceRequest{ - RepositoryOwner: moduleReference.Owner(), - RepositoryName: moduleReference.Repository(), - Reference: reference, - PageSize: flags.PageSize, - PageToken: flags.PageToken, - Reverse: flags.Reverse, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewModuleReferenceNotFoundError(moduleReference) - } - return err - } - return bufprint.NewRepositoryCommitPrinter(container.Stdout()). - PrintRepositoryCommits(ctx, format, resp.Msg.NextPageToken, resp.Msg.RepositoryCommits...) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/usage.gen.go deleted file mode 100644 index 56e138fce3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/commit/commitlist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package commitlist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/draftdelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/draftdelete.go deleted file mode 100644 index 719b23e86c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/draftdelete.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package draftdelete - -import ( - "context" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const forceFlagName = "force" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Delete a repository draft", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Force bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.BoolVar( - &f.Force, - forceFlagName, - false, - "Force deletion without confirming. Use with caution", - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleReference, err := bufmoduleref.ModuleReferenceForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - if moduleReference.Reference() == bufmoduleref.Main { - // bufmoduleref.ModuleReferenceForString will give a default reference when user did not specify one - // we need to check the origin input and return different errors for different cases. - if strings.HasSuffix(container.Arg(0), ":"+bufmoduleref.Main) { - return appcmd.NewInvalidArgumentErrorf("%q is not a valid draft name", bufmoduleref.Main) - } - return appcmd.NewInvalidArgumentError("a valid draft name need to be specified") - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewRepositoryCommitServiceClient, - ) - if !flags.Force { - if err := bufcli.PromptUserForDelete( - container, - "draft", - moduleReference.Reference(), - ); err != nil { - return err - } - } - if _, err := service.DeleteRepositoryDraftCommit( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteRepositoryDraftCommitRequest{ - RepositoryOwner: moduleReference.Owner(), - RepositoryName: moduleReference.Repository(), - DraftName: moduleReference.Reference(), - }), - ); err != nil { - // not explicitly handling error with connect.CodeNotFound as it can be repository not found or draft not found. - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Draft deleted."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/usage.gen.go deleted file mode 100644 index c873c9bca2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftdelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package draftdelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/draftlist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/draftlist.go deleted file mode 100644 index 9d4b6ca685..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/draftlist.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package draftlist - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pageSizeFlagName = "page-size" - pageTokenFlagName = "page-token" - reverseFlagName = "reverse" - formatFlagName = "format" -) - -// NewCommand returns a new Command -func NewCommand(name string, builder appflag.Builder) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List repository drafts", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - PageSize uint32 - PageToken string - Reverse bool - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.Uint32Var(&f.PageSize, - pageSizeFlagName, - 10, - `The page size`, - ) - flagSet.StringVar(&f.PageToken, - pageTokenFlagName, - "", - `The page token. If more results are available, a "next_page" key is present in the --format=json output`, - ) - flagSet.BoolVar(&f.Reverse, - reverseFlagName, - false, - `Reverse the results`, - ) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryCommitServiceClient, - ) - resp, err := service.ListRepositoryDraftCommits( - ctx, - connect.NewRequest(®istryv1alpha1.ListRepositoryDraftCommitsRequest{ - RepositoryOwner: moduleIdentity.Owner(), - RepositoryName: moduleIdentity.Repository(), - PageSize: flags.PageSize, - PageToken: flags.PageToken, - Reverse: flags.Reverse, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - return bufprint.NewRepositoryDraftPrinter(container.Stdout()). - PrintRepositoryDrafts(ctx, format, resp.Msg.NextPageToken, resp.Msg.RepositoryCommits...) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/usage.gen.go deleted file mode 100644 index b7c2bdc606..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/draft/draftlist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package draftlist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/organizationcreate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/organizationcreate.go deleted file mode 100644 index 30d1005803..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/organizationcreate.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package organizationcreate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const formatFlagName = "format" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Create a new BSR organization", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleOwner, err := bufmoduleref.ModuleOwnerForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleOwner.Remote(), - registryv1alpha1connect.NewOrganizationServiceClient, - ) - resp, err := service.CreateOrganization( - ctx, - connect.NewRequest(®istryv1alpha1.CreateOrganizationRequest{ - Name: moduleOwner.Owner(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeAlreadyExists { - return bufcli.NewOrganizationNameAlreadyExistsError(container.Arg(0)) - } - return err - } - return bufprint.NewOrganizationPrinter( - moduleOwner.Remote(), - container.Stdout(), - ).PrintOrganization(ctx, format, resp.Msg.Organization) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/usage.gen.go deleted file mode 100644 index c399db06dc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationcreate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package organizationcreate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/organizationdelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/organizationdelete.go deleted file mode 100644 index 8bd3d49a55..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/organizationdelete.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package organizationdelete - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const forceFlagName = "force" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Delete a BSR organization", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Force bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.BoolVar( - &f.Force, - forceFlagName, - false, - "Force deletion without confirming. Use with caution", - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleOwner, err := bufmoduleref.ModuleOwnerForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleOwner.Remote(), - registryv1alpha1connect.NewOrganizationServiceClient, - ) - if !flags.Force { - if err := bufcli.PromptUserForDelete(container, "organization", moduleOwner.Owner()); err != nil { - return err - } - } - if _, err := service.DeleteOrganizationByName( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteOrganizationByNameRequest{ - Name: moduleOwner.Owner(), - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewOrganizationNotFoundError(container.Arg(0)) - } - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Organization deleted."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/usage.gen.go deleted file mode 100644 index 93060c9261..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationdelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package organizationdelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/organizationget.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/organizationget.go deleted file mode 100644 index 2b0eeea54a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/organizationget.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package organizationget - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const formatFlagName = "format" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get a BSR organization", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleOwner, err := bufmoduleref.ModuleOwnerForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleOwner.Remote(), - registryv1alpha1connect.NewOrganizationServiceClient, - ) - resp, err := service.GetOrganizationByName( - ctx, - connect.NewRequest(®istryv1alpha1.GetOrganizationByNameRequest{ - Name: moduleOwner.Owner(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewOrganizationNotFoundError(container.Arg(0)) - } - return err - } - return bufprint.NewOrganizationPrinter( - moduleOwner.Remote(), - container.Stdout(), - ).PrintOrganization(ctx, format, resp.Msg.Organization) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/usage.gen.go deleted file mode 100644 index 9dc0ab71cf..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/organization/organizationget/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package organizationget - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/plugindelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/plugindelete.go deleted file mode 100644 index 2dd72294e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/plugindelete.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package plugindelete - -import ( - "context" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Delete a plugin from the registry", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct{} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) {} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - identity, version, _ := strings.Cut(container.Arg(0), ":") - pluginIdentity, err := bufpluginref.PluginIdentityForString(identity) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - if version != "" { - if err := bufpluginref.ValidatePluginVersion(version); err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - pluginIdentity.Remote(), - registryv1alpha1connect.NewPluginCurationServiceClient, - ) - if _, err := service.DeleteCuratedPlugin( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteCuratedPluginRequest{ - Owner: pluginIdentity.Owner(), - Name: pluginIdentity.Plugin(), - Version: version, - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return fmt.Errorf("the plugin %s does not exist", container.Arg(0)) - } - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/usage.gen.go deleted file mode 100644 index 6643dd4580..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/plugindelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package plugindelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/pluginpush.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/pluginpush.go deleted file mode 100644 index 20e33e0741..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/pluginpush.go +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package pluginpush - -import ( - "context" - "errors" - "fmt" - "net/http" - "os" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufplugin" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/netextended" - "github.com/bufbuild/buf/private/pkg/netrc" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagearchive" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/connect-go" - "github.com/google/go-containerregistry/pkg/authn" - "github.com/google/go-containerregistry/pkg/name" - "github.com/google/go-containerregistry/pkg/v1/remote" - "github.com/google/go-containerregistry/pkg/v1/remote/transport" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -const ( - formatFlagName = "format" - errorFormatFlagName = "error-format" - disableSymlinksFlagName = "disable-symlinks" - overrideRemoteFlagName = "override-remote" - imageFlagName = "image" - visibilityFlagName = "visibility" - - publicVisibility = "public" - privateVisibility = "private" -) - -var allVisibiltyStrings = []string{ - publicVisibility, - privateVisibility, -} - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Push a plugin to a registry", - Long: bufcli.GetSourceDirLong(`the source to push (directory containing buf.plugin.yaml or plugin release zip)`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string - ErrorFormat string - DisableSymlinks bool - OverrideRemote string - Image string - Visibility string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.StringVar( - &f.OverrideRemote, - overrideRemoteFlagName, - "", - "Override the default remote found in buf.plugin.yaml name and dependencies", - ) - flagSet.StringVar( - &f.Image, - imageFlagName, - "", - "Existing image to push", - ) - flagSet.StringVar( - &f.Visibility, - visibilityFlagName, - "", - fmt.Sprintf(`The plugin's visibility setting. Must be one of %s`, stringutil.SliceToString(allVisibiltyStrings)), - ) - _ = cobra.MarkFlagRequired(flagSet, visibilityFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - bufcli.WarnBetaCommand(ctx, container) - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - if len(flags.OverrideRemote) > 0 { - if _, err := netextended.ValidateHostname(flags.OverrideRemote); err != nil { - return fmt.Errorf("%s: %w", overrideRemoteFlagName, err) - } - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - source, err := bufcli.GetInputValue(container, "" /* The input hashtag is not supported here */, ".") - if err != nil { - return err - } - storageProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - sourceStat, err := os.Stat(source) - if err != nil { - return err - } - var sourceBucket storage.ReadWriteBucket - if !sourceStat.IsDir() && strings.HasSuffix(strings.ToLower(sourceStat.Name()), ".zip") { - // Unpack plugin release to temporary directory - tmpDir, err := os.MkdirTemp(os.TempDir(), "plugin-push") - if err != nil { - return err - } - defer func() { - if err := os.RemoveAll(tmpDir); !os.IsNotExist(err) { - retErr = multierr.Append(retErr, err) - } - }() - sourceBucket, err = storageProvider.NewReadWriteBucket(tmpDir) - if err != nil { - return err - } - if err := unzipPluginToSourceBucket(ctx, source, sourceStat.Size(), sourceBucket); err != nil { - return err - } - } else { - sourceBucket, err = storageProvider.NewReadWriteBucket(source) - if err != nil { - return err - } - } - existingConfigFilePath, err := bufpluginconfig.ExistingConfigFilePath(ctx, sourceBucket) - if err != nil { - return bufcli.NewInternalError(err) - } - if existingConfigFilePath == "" { - return fmt.Errorf("please define a %s configuration file in the target directory", bufpluginconfig.ExternalConfigFilePath) - } - var options []bufpluginconfig.ConfigOption - if len(flags.OverrideRemote) > 0 { - options = append(options, bufpluginconfig.WithOverrideRemote(flags.OverrideRemote)) - } - pluginConfig, err := bufpluginconfig.GetConfigForBucket(ctx, sourceBucket, options...) - if err != nil { - return err - } - client, err := bufplugindocker.NewClient(container.Logger(), bufcli.Version) - if err != nil { - return err - } - defer func() { - if err := client.Close(); err != nil { - retErr = multierr.Append(retErr, fmt.Errorf("docker client close error: %w", err)) - } - }() - var imageID string - if flags.Image != "" { - inspectResponse, err := client.Inspect(ctx, flags.Image) - if err != nil { - return err - } - imageID = inspectResponse.ImageID - } else { - image, err := loadDockerImage(ctx, sourceBucket) - if err != nil { - return err - } - loadResponse, err := client.Load(ctx, image) - if err != nil { - return err - } - defer func() { - if err := image.Close(); err != nil && !errors.Is(err, storage.ErrClosed) { - retErr = multierr.Append(retErr, fmt.Errorf("docker image close error: %w", err)) - } - }() - imageID = loadResponse.ImageID - } - visibility, err := visibilityFlagToVisibility(flags.Visibility) - if err != nil { - return err - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - pluginConfig.Name.Remote(), - registryv1alpha1connect.NewPluginCurationServiceClient, - ) - latestPluginResp, err := service.GetLatestCuratedPlugin( - ctx, - connect.NewRequest(®istryv1alpha1.GetLatestCuratedPluginRequest{ - Owner: pluginConfig.Name.Owner(), - Name: pluginConfig.Name.Plugin(), - Version: pluginConfig.PluginVersion, - Revision: 0, // get latest revision for the plugin version. - }), - ) - var currentImageDigest string - var nextRevision uint32 - if err != nil { - if connect.CodeOf(err) != connect.CodeNotFound { - return err - } - nextRevision = 1 - } else { - nextRevision = latestPluginResp.Msg.Plugin.Revision + 1 - currentImageDigest = latestPluginResp.Msg.Plugin.ContainerImageDigest - } - machine, err := netrc.GetMachineForName(container, pluginConfig.Name.Remote()) - if err != nil { - return err - } - authConfig := &bufplugindocker.RegistryAuthConfig{} - if machine != nil { - authConfig.ServerAddress = machine.Name() - authConfig.Username = machine.Login() - authConfig.Password = machine.Password() - } - imageDigest, err := findExistingDigestForImageID(ctx, pluginConfig, authConfig, imageID, currentImageDigest) - if err != nil { - return err - } - if imageDigest == "" { - imageDigest, err = pushImage(ctx, client, authConfig, pluginConfig, imageID) - if err != nil { - return err - } - } else { - container.Logger().Info("image found in registry - skipping push") - } - plugin, err := bufplugin.NewPlugin( - pluginConfig.PluginVersion, - pluginConfig.Dependencies, - pluginConfig.Registry, - imageDigest, - pluginConfig.SourceURL, - pluginConfig.Description, - ) - if err != nil { - return err - } - createRequest, err := createCuratedPluginRequest(pluginConfig, plugin, nextRevision, visibility) - if err != nil { - return err - } - var curatedPlugin *registryv1alpha1.CuratedPlugin - createPluginResp, err := service.CreateCuratedPlugin(ctx, connect.NewRequest(createRequest)) - if err != nil { - if connect.CodeOf(err) != connect.CodeAlreadyExists { - return err - } - // Plugin with the same image digest and metadata already exists - container.Logger().Info( - "plugin already exists", - zap.String("name", pluginConfig.Name.IdentityString()), - zap.String("digest", plugin.ContainerImageDigest()), - ) - curatedPlugin = latestPluginResp.Msg.Plugin - } else { - curatedPlugin = createPluginResp.Msg.Configuration - } - return bufprint.NewCuratedPluginPrinter(container.Stdout()).PrintCuratedPlugin(ctx, format, curatedPlugin) -} - -func createCuratedPluginRequest( - pluginConfig *bufpluginconfig.Config, - plugin bufplugin.Plugin, - nextRevision uint32, - visibility registryv1alpha1.CuratedPluginVisibility, -) (*registryv1alpha1.CreateCuratedPluginRequest, error) { - outputLanguages, err := bufplugin.OutputLanguagesToProtoLanguages(pluginConfig.OutputLanguages) - if err != nil { - return nil, err - } - protoRegistryConfig, err := bufplugin.PluginRegistryToProtoRegistryConfig(plugin.Registry()) - if err != nil { - return nil, err - } - return ®istryv1alpha1.CreateCuratedPluginRequest{ - Owner: pluginConfig.Name.Owner(), - Name: pluginConfig.Name.Plugin(), - RegistryType: bufplugin.PluginToProtoPluginRegistryType(plugin), - Version: plugin.Version(), - ContainerImageDigest: plugin.ContainerImageDigest(), - Dependencies: bufplugin.PluginReferencesToCuratedProtoPluginReferences(plugin.Dependencies()), - SourceUrl: plugin.SourceURL(), - Description: plugin.Description(), - RegistryConfig: protoRegistryConfig, - Revision: nextRevision, - OutputLanguages: outputLanguages, - SpdxLicenseId: pluginConfig.SPDXLicenseID, - LicenseUrl: pluginConfig.LicenseURL, - Visibility: visibility, - }, nil -} - -func pushImage( - ctx context.Context, - client bufplugindocker.Client, - authConfig *bufplugindocker.RegistryAuthConfig, - plugin *bufpluginconfig.Config, - image string, -) (_ string, retErr error) { - tagResponse, err := client.Tag(ctx, image, plugin) - if err != nil { - return "", err - } - createdImage := tagResponse.Image - // We tag a Docker image using a unique ID label each time. - // After we're done publishing the image, we delete it to not leave a lot of images left behind. - defer func() { - if _, err := client.Delete(ctx, createdImage); err != nil { - retErr = multierr.Append(retErr, fmt.Errorf("failed to delete image %q", createdImage)) - } - }() - pushResponse, err := client.Push(ctx, createdImage, authConfig) - if err != nil { - return "", err - } - return pushResponse.Digest, nil -} - -// findExistingDigestForImageID will query the OCI registry to see if the imageID already exists. -// If an image is found with the same imageID, its digest will be returned (and we'll skip pushing to OCI registry). -// -// It performs the following search: -// -// - GET /v2/{owner}/{plugin}/tags/list -// - For each tag: -// - Fetch image: GET /v2/{owner}/{plugin}/manifests/{tag} -// - If image manifest matches imageID, we can use the image digest for the image. -func findExistingDigestForImageID( - ctx context.Context, - plugin *bufpluginconfig.Config, - authConfig *bufplugindocker.RegistryAuthConfig, - imageID string, - currentImageDigest string, -) (string, error) { - repo, err := name.NewRepository(fmt.Sprintf("%s/%s/%s", plugin.Name.Remote(), plugin.Name.Owner(), plugin.Name.Plugin())) - if err != nil { - return "", err - } - auth := &authn.Basic{Username: authConfig.Username, Password: authConfig.Password} - remoteOpts := []remote.Option{remote.WithContext(ctx), remote.WithAuth(auth)} - // First attempt to see if the current image digest matches the image ID - if currentImageDigest != "" { - remoteImageID, _, err := getImageIDAndDigestFromReference(repo.Digest(currentImageDigest), remoteOpts...) - if err != nil { - return "", err - } - if remoteImageID == imageID { - return currentImageDigest, nil - } - } - // List all tags and check for a match - tags, err := remote.List(repo, remoteOpts...) - if err != nil { - structuredErr := new(transport.Error) - if errors.As(err, &structuredErr) { - if structuredErr.StatusCode == http.StatusUnauthorized { - return "", errors.New("you are not authenticated. For details, visit https://buf.build/docs/bsr/authentication") - } - if structuredErr.StatusCode == http.StatusNotFound { - return "", nil - } - } - return "", err - } - existingImageDigest := "" - for _, tag := range tags { - remoteImageID, imageDigest, err := getImageIDAndDigestFromReference(repo.Tag(tag), remoteOpts...) - if err != nil { - return "", err - } - if remoteImageID == imageID { - existingImageDigest = imageDigest - break - } - } - return existingImageDigest, nil -} - -func getImageIDAndDigestFromReference(ref name.Reference, options ...remote.Option) (string, string, error) { - image, err := remote.Image(ref, options...) - if err != nil { - return "", "", err - } - imageDigest, err := image.Digest() - if err != nil { - return "", "", err - } - manifest, err := image.Manifest() - if err != nil { - return "", "", err - } - return manifest.Config.Digest.String(), imageDigest.String(), nil -} - -func unzipPluginToSourceBucket(ctx context.Context, pluginZip string, size int64, bucket storage.ReadWriteBucket) (retErr error) { - f, err := os.Open(pluginZip) - if err != nil { - return err - } - defer func() { - if err := f.Close(); err != nil { - retErr = multierr.Append(retErr, fmt.Errorf("plugin zip close error: %w", err)) - } - }() - return storagearchive.Unzip(ctx, f, size, bucket, nil, 0) -} - -func loadDockerImage(ctx context.Context, bucket storage.ReadBucket) (storage.ReadObjectCloser, error) { - image, err := bucket.Get(ctx, bufplugindocker.ImagePath) - if storage.IsNotExist(err) { - return nil, fmt.Errorf("unable to find a %s plugin image: %w", bufplugindocker.ImagePath, err) - } - return image, nil -} - -func visibilityFlagToVisibility(visibility string) (registryv1alpha1.CuratedPluginVisibility, error) { - switch visibility { - case publicVisibility: - return registryv1alpha1.CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PUBLIC, nil - case privateVisibility: - return registryv1alpha1.CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PRIVATE, nil - default: - return 0, fmt.Errorf("invalid visibility: %s, expected one of %s", visibility, stringutil.SliceToString(allVisibiltyStrings)) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/usage.gen.go deleted file mode 100644 index 3445b7a047..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/plugin/pluginpush/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package pluginpush - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/repositorycreate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/repositorycreate.go deleted file mode 100644 index 78f3329b78..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/repositorycreate.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositorycreate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - formatFlagName = "format" - visibilityFlagName = "visibility" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Create a BSR repository", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string - Visibility string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName) - _ = cobra.MarkFlagRequired(flagSet, visibilityFlagName) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - visibility, err := bufcli.VisibilityFlagToVisibility(flags.Visibility) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - resp, err := service.CreateRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.CreateRepositoryByFullNameRequest{ - FullName: moduleIdentity.Owner() + "/" + moduleIdentity.Repository(), - Visibility: visibility, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeAlreadyExists { - return bufcli.NewRepositoryNameAlreadyExistsError(container.Arg(0)) - } - return err - } - repository := resp.Msg.Repository - return bufprint.NewRepositoryPrinter( - clientConfig, - moduleIdentity.Remote(), - container.Stdout(), - ).PrintRepository(ctx, format, repository) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/usage.gen.go deleted file mode 100644 index 566a7699b5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorycreate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositorycreate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/repositorydelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/repositorydelete.go deleted file mode 100644 index d6cf022225..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/repositorydelete.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositorydelete - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const forceFlagName = "force" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Delete a BSR repository", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Force bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.BoolVar( - &f.Force, - forceFlagName, - false, - "Force deletion without confirming. Use with caution", - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - if !flags.Force { - if err := bufcli.PromptUserForDelete(container, "repository", moduleIdentity.Repository()); err != nil { - return err - } - } - if _, err := service.DeleteRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteRepositoryByFullNameRequest{ - FullName: moduleIdentity.Owner() + "/" + moduleIdentity.Repository(), - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Repository deleted."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/usage.gen.go deleted file mode 100644 index 0d8a9cf921..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositorydelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/repositorydeprecate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/repositorydeprecate.go deleted file mode 100644 index 4745b61f59..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/repositorydeprecate.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositorydeprecate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - messageFlagName = "message" -) - -// NewCommand returns a new Command -func NewCommand(name string, builder appflag.Builder) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Deprecate a BSR repository", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Message string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Message, - messageFlagName, - "", - `The message to display with deprecation warnings`, - ) -} - -func run(ctx context.Context, container appflag.Container, flags *flags) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - if _, err := service.DeprecateRepositoryByName( - ctx, - connect.NewRequest(®istryv1alpha1.DeprecateRepositoryByNameRequest{ - OwnerName: moduleIdentity.Owner(), - RepositoryName: moduleIdentity.Repository(), - DeprecationMessage: flags.Message, - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Repository deprecated."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/usage.gen.go deleted file mode 100644 index 1d9f27346d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorydeprecate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositorydeprecate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/repositoryget.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/repositoryget.go deleted file mode 100644 index a7874ec21e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/repositoryget.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositoryget - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const formatFlagName = "format" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get a BSR repository", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - resp, err := service.GetRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryByFullNameRequest{ - FullName: moduleIdentity.Owner() + "/" + moduleIdentity.Repository(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - repository := resp.Msg.Repository - return bufprint.NewRepositoryPrinter( - clientConfig, - moduleIdentity.Remote(), - container.Stdout(), - ).PrintRepository(ctx, format, repository) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/usage.gen.go deleted file mode 100644 index 6d9dc3ba71..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryget/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositoryget - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/repositorylist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/repositorylist.go deleted file mode 100644 index c26c1f66d4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/repositorylist.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositorylist - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pageSizeFlagName = "page-size" - pageTokenFlagName = "page-token" - reverseFlagName = "reverse" - formatFlagName = "format" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List BSR repositories", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - PageSize uint32 - PageToken string - Reverse bool - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.Uint32Var(&f.PageSize, - pageSizeFlagName, - 10, - `The page size.`, - ) - flagSet.StringVar(&f.PageToken, - pageTokenFlagName, - "", - `The page token. If more results are available, a "next_page" key is present in the --format=json output`, - ) - flagSet.BoolVar(&f.Reverse, - reverseFlagName, - false, - `Reverse the results`, - ) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - remote := container.Arg(0) - if err := bufmoduleref.ValidateRemoteNotEmpty(remote); err != nil { - return err - } - if err := bufmoduleref.ValidateRemoteHasNoPaths(remote); err != nil { - return err - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - remote, - registryv1alpha1connect.NewRepositoryServiceClient, - ) - resp, err := service.ListRepositories( - ctx, - connect.NewRequest(®istryv1alpha1.ListRepositoriesRequest{ - PageSize: flags.PageSize, - PageToken: flags.PageToken, - Reverse: flags.Reverse, - }), - ) - if err != nil { - return err - } - repositories, nextPageToken := resp.Msg.Repositories, resp.Msg.NextPageToken - return bufprint.NewRepositoryPrinter( - clientConfig, - remote, - container.Stdout(), - ).PrintRepositories(ctx, format, nextPageToken, repositories...) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/usage.gen.go deleted file mode 100644 index 5d2cf24637..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositorylist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositorylist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/repositoryundeprecate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/repositoryundeprecate.go deleted file mode 100644 index 3f50027cd3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/repositoryundeprecate.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositoryundeprecate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" -) - -// NewCommand returns a new Command -func NewCommand(name string, builder appflag.Builder) *appcmd.Command { - return &appcmd.Command{ - Use: name + " ", - Short: "Undeprecate a BSR repository", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc(run, bufcli.NewErrorInterceptor()), - } -} - -func run(ctx context.Context, container appflag.Container) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - if _, err := service.UndeprecateRepositoryByName( - ctx, - connect.NewRequest(®istryv1alpha1.UndeprecateRepositoryByNameRequest{ - OwnerName: moduleIdentity.Owner(), - RepositoryName: moduleIdentity.Repository(), - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Repository undeprecated."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/usage.gen.go deleted file mode 100644 index 41660d1836..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryundeprecate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositoryundeprecate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/repositoryupdate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/repositoryupdate.go deleted file mode 100644 index 35e0eda7d0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/repositoryupdate.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package repositoryupdate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - visibilityFlagName = "visibility" -) - -// NewCommand returns a new Command -func NewCommand(name string, builder appflag.Builder) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Update BSR repository settings", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -// TODO: add Description and Url field if it's desired to udpate them from the CLI -type flags struct { - Visibility string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindVisibility(flagSet, &f.Visibility, visibilityFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - visibility, err := bufcli.VisibilityFlagToVisibilityAllowUnspecified(flags.Visibility) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - if _, err := service.UpdateRepositorySettingsByName( - ctx, - connect.NewRequest(®istryv1alpha1.UpdateRepositorySettingsByNameRequest{ - OwnerName: moduleIdentity.Owner(), - RepositoryName: moduleIdentity.Repository(), - Visibility: visibility, - // TODO: pass description and url - }), - ); err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - if _, err := fmt.Fprintln(container.Stdout(), "Settings Updated."); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/usage.gen.go deleted file mode 100644 index 31b7c1d927..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/repository/repositoryupdate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package repositoryupdate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/tagcreate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/tagcreate.go deleted file mode 100644 index 035b278c05..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/tagcreate.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package tagcreate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const formatFlagName = "format" - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Create a tag for a specified commit", - Args: cobra.ExactArgs(2), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - moduleReference, err := bufmoduleref.ModuleReferenceForString( - container.Arg(0), - ) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - if !bufmoduleref.IsCommitModuleReference(moduleReference) { - return fmt.Errorf("commit is required, but a tag was given: %q", container.Arg(0)) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - repositoryService := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - repositoryTagService := connectclient.Make( - clientConfig, - moduleReference.Remote(), - registryv1alpha1connect.NewRepositoryTagServiceClient, - ) - resp, err := repositoryService.GetRepositoryByFullName(ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryByFullNameRequest{ - FullName: moduleReference.Owner() + "/" + moduleReference.Repository(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(moduleReference.Remote() + "/" + moduleReference.Owner() + "/" + moduleReference.Repository()) - } - return err - } - tag := container.Arg(1) - commit := moduleReference.Reference() - tagResp, err := repositoryTagService.CreateRepositoryTag( - ctx, - connect.NewRequest(®istryv1alpha1.CreateRepositoryTagRequest{ - RepositoryId: resp.Msg.Repository.Id, - Name: tag, - CommitName: commit, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeAlreadyExists { - return bufcli.NewTagOrDraftNameAlreadyExistsError(tag) - } - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewModuleReferenceNotFoundError(moduleReference) - } - return err - } - return bufprint.NewRepositoryTagPrinter(container.Stdout()).PrintRepositoryTag(ctx, format, tagResp.Msg.RepositoryTag) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/usage.gen.go deleted file mode 100644 index 9340410f8f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/tagcreate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package tagcreate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/taglist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/taglist.go deleted file mode 100644 index b6b80972a6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/taglist.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package taglist - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - pageSizeFlagName = "page-size" - pageTokenFlagName = "page-token" - reverseFlagName = "reverse" - formatFlagName = "format" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List repository tags", - Args: cobra.ExactArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - PageSize uint32 - PageToken string - Reverse bool - Format string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.Uint32Var(&f.PageSize, - pageSizeFlagName, - 10, - `The page size.`, - ) - flagSet.StringVar(&f.PageToken, - pageTokenFlagName, - "", - `The page token. If more results are available, a "next_page" key is present in the --format=json output`, - ) - flagSet.BoolVar(&f.Reverse, - reverseFlagName, - false, - `Reverse the results`, - ) - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - if container.Arg(0) == "" { - return appcmd.NewInvalidArgumentError("repository is required") - } - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - repositoryService := connectclient.Make( - clientConfig, - moduleIdentity.Remote(), - registryv1alpha1connect.NewRepositoryServiceClient, - ) - resp, err := repositoryService.GetRepositoryByFullName(ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryByFullNameRequest{ - FullName: moduleIdentity.Owner() + "/" + moduleIdentity.Repository(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - return bufcli.NewRepositoryNotFoundError(container.Arg(0)) - } - return err - } - repositoryTagService := connectclient.Make(clientConfig, moduleIdentity.Remote(), registryv1alpha1connect.NewRepositoryTagServiceClient) - tagsResp, err := repositoryTagService.ListRepositoryTags( - ctx, - connect.NewRequest(®istryv1alpha1.ListRepositoryTagsRequest{ - RepositoryId: resp.Msg.Repository.Id, - PageSize: flags.PageSize, - PageToken: flags.PageToken, - Reverse: flags.Reverse, - }), - ) - if err != nil { - return err - } - return bufprint.NewRepositoryTagPrinter(container.Stdout()).PrintRepositoryTags(ctx, format, tagsResp.Msg.NextPageToken, tagsResp.Msg.RepositoryTags...) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/usage.gen.go deleted file mode 100644 index 03ddf49003..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/tag/taglist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package taglist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/usage.gen.go deleted file mode 100644 index 6d1e9a629b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package webhookcreate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/webhookcreate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/webhookcreate.go deleted file mode 100644 index 2ec27d966c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookcreate/webhookcreate.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package webhookcreate - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - ownerFlagName = "owner" - repositoryFlagName = "repository" - callbackURLFlagName = "callback-url" - webhookEventFlagName = "event" - remoteFlagName = "remote" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "Create a repository webhook", - Args: cobra.ExactArgs(0), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - WebhookEvent string - OwnerName string - RepositoryName string - CallbackURL string - Remote string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.WebhookEvent, - webhookEventFlagName, - "", - "The event type to create a webhook for. The proto enum string value is used for this input (e.g. 'WEBHOOK_EVENT_REPOSITORY_PUSH')", - ) - _ = cobra.MarkFlagRequired(flagSet, webhookEventFlagName) - flagSet.StringVar( - &f.OwnerName, - ownerFlagName, - "", - `The owner name of the repository to create a webhook for`, - ) - _ = cobra.MarkFlagRequired(flagSet, ownerFlagName) - flagSet.StringVar( - &f.RepositoryName, - repositoryFlagName, - "", - "The repository name to create a webhook for", - ) - _ = cobra.MarkFlagRequired(flagSet, repositoryFlagName) - flagSet.StringVar( - &f.CallbackURL, - callbackURLFlagName, - "", - "The url for the webhook to callback to on a given event", - ) - _ = cobra.MarkFlagRequired(flagSet, callbackURLFlagName) - flagSet.StringVar( - &f.Remote, - remoteFlagName, - "", - "The remote of the repository the created webhook will belong to", - ) - _ = cobra.MarkFlagRequired(flagSet, remoteFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient) - event, ok := registryv1alpha1.WebhookEvent_value[flags.WebhookEvent] - if !ok || event == int32(registryv1alpha1.WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED) { - return fmt.Errorf("webhook event must be specified") - } - resp, err := service.CreateWebhook( - ctx, - connect.NewRequest(®istryv1alpha1.CreateWebhookRequest{ - WebhookEvent: registryv1alpha1.WebhookEvent(event), - OwnerName: flags.OwnerName, - RepositoryName: flags.RepositoryName, - CallbackUrl: flags.CallbackURL, - }), - ) - if err != nil { - return err - } - webhookJSON, err := json.MarshalIndent(resp.Msg.Webhook, "", "\t") - if err != nil { - return err - } - // Ignore errors for writing to stdout. - _, _ = container.Stdout().Write(webhookJSON) - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/usage.gen.go deleted file mode 100644 index b985b87d89..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package webhookdelete - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/webhookdelete.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/webhookdelete.go deleted file mode 100644 index 2858775516..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhookdelete/webhookdelete.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package webhookdelete - -import ( - "context" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - webhookIDFlagName = "id" - remoteFlagName = "remote" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "Delete a repository webhook", - Args: cobra.ExactArgs(0), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - WebhookID string - Remote string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.WebhookID, - webhookIDFlagName, - "", - "The webhook ID to delete", - ) - _ = cobra.MarkFlagRequired(flagSet, webhookIDFlagName) - flagSet.StringVar( - &f.Remote, - remoteFlagName, - "", - "The remote of the repository the webhook ID belongs to", - ) - _ = cobra.MarkFlagRequired(flagSet, remoteFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient) - if _, err := service.DeleteWebhook( - ctx, - connect.NewRequest(®istryv1alpha1.DeleteWebhookRequest{ - WebhookId: flags.WebhookID, - }), - ); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/usage.gen.go deleted file mode 100644 index 664b4b2262..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package webhooklist - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/webhooklist.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/webhooklist.go deleted file mode 100644 index 5a8b465b2f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/registry/webhook/webhooklist/webhooklist.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package webhooklist - -import ( - "context" - "encoding/json" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - ownerFlagName = "owner" - repositoryFlagName = "repository" - remoteFlagName = "remote" -) - -// NewCommand returns a new Command -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "List repository webhooks", - Args: cobra.ExactArgs(0), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - OwnerName string - RepositoryName string - Remote string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.OwnerName, - ownerFlagName, - "", - `The owner name of the repository to list webhooks for`, - ) - _ = cobra.MarkFlagRequired(flagSet, ownerFlagName) - flagSet.StringVar( - &f.RepositoryName, - repositoryFlagName, - "", - "The repository name to list webhooks for.", - ) - _ = cobra.MarkFlagRequired(flagSet, repositoryFlagName) - flagSet.StringVar( - &f.Remote, - remoteFlagName, - "", - "The remote of the owner and repository to list webhooks for", - ) - _ = cobra.MarkFlagRequired(flagSet, remoteFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - bufcli.WarnBetaCommand(ctx, container) - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, flags.Remote, registryv1alpha1connect.NewWebhookServiceClient) - resp, err := service.ListWebhooks( - ctx, - connect.NewRequest(®istryv1alpha1.ListWebhooksRequest{ - RepositoryName: flags.RepositoryName, - OwnerName: flags.OwnerName, - // TODO: this should probably be in a loop so we can get page token from - // response and query for the next page - }), - ) - if err != nil { - return err - } - if resp.Msg.Webhooks == nil { - // Ignore errors for writing to stdout. - _, _ = container.Stdout().Write([]byte("[]")) - return nil - } - webhooksJSON, err := json.MarshalIndent(resp.Msg.Webhooks, "", "\t") - if err != nil { - return err - } - // Ignore errors for writing to stdout. - _, _ = container.Stdout().Write(webhooksJSON) - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/stats.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/stats.go deleted file mode 100644 index 8822c29605..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/stats.go +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package stats - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufprint" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/protostat" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - formatFlagName = "format" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Get statistics for a given source or module", - Long: bufcli.GetSourceOrModuleLong(`the source or module to get statistics for`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Format string - DisableSymlinks bool - - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Format, - formatFlagName, - bufprint.FormatText.String(), - fmt.Sprintf(`The output format to use. Must be one of %s`, bufprint.AllFormatsString), - ) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - format, err := bufprint.ParseFormat(flags.Format) - if err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - sourceOrModuleRef, err := buffetch.NewRefParser(container.Logger()).GetSourceOrModuleRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - moduleConfigReader, err := bufcli.NewWireModuleConfigReaderForModuleReader( - container, - storageosProvider, - runner, - clientConfig, - moduleReader, - ) - if err != nil { - return err - } - moduleConfigSet, err := moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - "", - nil, - nil, - false, - ) - if err != nil { - return err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - statsSlice := make([]*protostat.Stats, len(moduleConfigs)) - for i, moduleConfig := range moduleConfigs { - stats, err := protostat.GetStats(ctx, bufmodulestat.NewFileWalker(moduleConfig.Module())) - if err != nil { - return err - } - statsSlice[i] = stats - } - return bufprint.NewStatsPrinter(container.Stdout()). - PrintStats(ctx, format, protostat.MergeStats(statsSlice...)) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/usage.gen.go deleted file mode 100644 index fac531eab4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/stats/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package stats - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/studioagent.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/studioagent.go deleted file mode 100644 index 62cfd9cdd7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/studioagent.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package studioagent - -import ( - "context" - "crypto/tls" - "fmt" - "net" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufstudioagent" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/cert/certclient" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/buf/private/pkg/transport/http/httpserver" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - bindFlagName = "bind" - portFlagName = "port" - originFlagName = "origin" - disallowedHeadersFlagName = "disallowed-header" - forwardHeadersFlagName = "forward-header" - caCertFlagName = "ca-cert" - clientCertFlagName = "client-cert" - clientKeyFlagName = "client-key" - serverCertFlagName = "server-cert" - serverKeyFlagName = "server-key" - privateNetworkFlagName = "private-network" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "Run an HTTP(S) server as the Studio agent", - Args: cobra.ExactArgs(0), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - BindAddress string - Port string - Origin string - DisallowedHeaders []string - ForwardHeaders map[string]string - CACert string - ClientCert string - ClientKey string - ServerCert string - ServerKey string - PrivateNetwork bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.BindAddress, - bindFlagName, - "127.0.0.1", - "The address to be exposed to accept HTTP requests", - ) - flagSet.StringVar( - &f.Port, - portFlagName, - "8080", - "The port to be exposed to accept HTTP requests", - ) - flagSet.StringVar( - &f.Origin, - originFlagName, - "https://buf.build", - "The allowed origin for CORS options", - ) - flagSet.StringSliceVar( - &f.DisallowedHeaders, - disallowedHeadersFlagName, - nil, - `The header names that are disallowed by this agent. When the agent receives an enveloped request with these headers set, it will return an error rather than forward the request to the target server. Multiple headers are appended if specified multiple times`, - ) - flagSet.StringToStringVar( - &f.ForwardHeaders, - forwardHeadersFlagName, - nil, - `The headers to be forwarded via the agent to the target server. Must be an equals sign separated key-value pair (like --forward-header=fromHeader1=toHeader1). Multiple header pairs are appended if specified multiple times`, - ) - flagSet.StringVar( - &f.CACert, - caCertFlagName, - "", - "The CA cert to be used in the client and server TLS configuration", - ) - flagSet.StringVar( - &f.ClientCert, - clientCertFlagName, - "", - "The cert to be used in the client TLS configuration", - ) - flagSet.StringVar( - &f.ClientKey, - clientKeyFlagName, - "", - "The key to be used in the client TLS configuration", - ) - flagSet.StringVar( - &f.ServerCert, - serverCertFlagName, - "", - "The cert to be used in the server TLS configuration", - ) - flagSet.StringVar( - &f.ServerKey, - serverKeyFlagName, - "", - "The key to be used in the server TLS configuration", - ) - flagSet.BoolVar( - &f.PrivateNetwork, - privateNetworkFlagName, - false, - `Use the agent with private network CORS`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - // CA cert pool is optional. If it is nil, TLS uses the host's root CA set. - var rootCAConfig *tls.Config - var err error - if flags.CACert != "" { - rootCAConfig, err = certclient.NewClientTLSConfigFromRootCertFiles(flags.CACert) - if err != nil { - return err - } - } - // client TLS config is optional. If it is nil, it uses the default configuration from http2.Transport. - var clientTLSConfig *tls.Config - if flags.ClientCert != "" || flags.ClientKey != "" { - clientTLSConfig, err = newTLSConfig(rootCAConfig, flags.ClientCert, flags.ClientKey) - if err != nil { - return fmt.Errorf("cannot create new client TLS config: %w", err) - } - } - // server TLS config is optional. If it is nil, we serve with a h2c handler. - var serverTLSConfig *tls.Config - if flags.ServerCert != "" || flags.ServerKey != "" { - serverTLSConfig, err = newTLSConfig(rootCAConfig, flags.ServerCert, flags.ServerKey) - if err != nil { - return fmt.Errorf("cannot create new server TLS config: %w", err) - } - } - mux := bufstudioagent.NewHandler( - container.Logger(), - flags.Origin, - clientTLSConfig, - stringutil.SliceToMap(flags.DisallowedHeaders), - flags.ForwardHeaders, - flags.PrivateNetwork, - ) - var httpListenConfig net.ListenConfig - httpListener, err := httpListenConfig.Listen(ctx, "tcp", fmt.Sprintf("%s:%s", flags.BindAddress, flags.Port)) - if err != nil { - return err - } - - return httpserver.Run( - ctx, - container.Logger(), - httpListener, - mux, - httpserver.RunWithTLSConfig( - serverTLSConfig, - ), - ) -} - -func newTLSConfig(baseConfig *tls.Config, certFile, keyFile string) (*tls.Config, error) { - config := baseConfig.Clone() - if config == nil { - config = &tls.Config{ - MinVersion: tls.VersionTLS12, - } - } - cert, err := tls.LoadX509KeyPair(certFile, keyFile) - if err != nil { - return nil, fmt.Errorf("error creating x509 keypair from cert file %s and key file %s", certFile, keyFile) - } - config.Certificates = []tls.Certificate{cert} - return config, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/usage.gen.go deleted file mode 100644 index 85ab84299c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/beta/studioagent/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package studioagent - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/breaking.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/breaking.go deleted file mode 100644 index b4d2b44e37..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/breaking.go +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package breaking - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufwire" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - errorFormatFlagName = "error-format" - excludeImportsFlagName = "exclude-imports" - pathsFlagName = "path" - limitToInputFilesFlagName = "limit-to-input-files" - configFlagName = "config" - againstFlagName = "against" - againstConfigFlagName = "against-config" - excludePathsFlagName = "exclude-path" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " --against ", - Short: "Verify no breaking changes have been made", - Long: `buf breaking makes sure that the location has no breaking changes compared to the location. ` + - bufcli.GetInputLong(`the source, module, or image to check for breaking changes`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ErrorFormat string - ExcludeImports bool - LimitToInputFiles bool - Paths []string - Config string - Against string - AgainstConfig string - ExcludePaths []string - DisableSymlinks bool - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindPaths(flagSet, &f.Paths, pathsFlagName) - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors or check violations printed to stdout. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.BoolVar( - &f.ExcludeImports, - excludeImportsFlagName, - false, - "Exclude imports from breaking change detection.", - ) - flagSet.BoolVar( - &f.LimitToInputFiles, - limitToInputFilesFlagName, - false, - fmt.Sprintf( - `Only run breaking checks against the files in the input -When set, the against input contains only the files in the input -Overrides --%s`, - pathsFlagName, - ), - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml file or data to use for configuration`, - ) - flagSet.StringVar( - &f.Against, - againstFlagName, - "", - fmt.Sprintf( - `Required. The source, module, or image to check against. Must be one of format %s`, - buffetch.AllFormatsString, - ), - ) - flagSet.StringVar( - &f.AgainstConfig, - againstConfigFlagName, - "", - `The buf.yaml file or data to use to configure the against source, module, or image`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if flags.Against == "" { - return appcmd.NewInvalidArgumentErrorf("required flag %q not set", againstFlagName) - } - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - imageConfigReader, err := bufcli.NewWireImageConfigReader( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - flags.Config, - flags.Paths, // we filter checks for files - flags.ExcludePaths, // we exclude these paths - false, // files specified must exist on the main input - false, // we must include source info for this side of the check - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations( - container.Stdout(), - fileAnnotations, - flags.ErrorFormat, - ); err != nil { - return err - } - return errors.New("") - } - // TODO: this doesn't actually work because we're using the same file paths for both sides - // if the roots change, then we're torched - externalPaths := flags.Paths - if flags.LimitToInputFiles { - externalPaths, err = getExternalPathsForImages(imageConfigs, flags.ExcludeImports) - if err != nil { - return err - } - } - againstRef, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, flags.Against) - if err != nil { - return err - } - againstImageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - againstRef, - flags.AgainstConfig, - externalPaths, // we filter checks for files - flags.ExcludePaths, // we exclude these paths - true, // files are allowed to not exist on the against input - true, // no need to include source info for against - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations( - container.Stdout(), - fileAnnotations, - flags.ErrorFormat, - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - if len(imageConfigs) != len(againstImageConfigs) { - // If workspaces are being used as input, the number - // of images MUST match. Otherwise the results will - // be meaningless and yield false positives. - // - // And similar to the note above, if the roots change, - // we're torched. - return fmt.Errorf("input contained %d images, whereas against contained %d images", len(imageConfigs), len(againstImageConfigs)) - } - var allFileAnnotations []bufanalysis.FileAnnotation - for i, imageConfig := range imageConfigs { - fileAnnotations, err := breakingForImage( - ctx, - container, - imageConfig, - againstImageConfigs[i], - flags.ExcludeImports, - flags.ErrorFormat, - ) - if err != nil { - return err - } - allFileAnnotations = append(allFileAnnotations, fileAnnotations...) - } - if len(allFileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations( - container.Stdout(), - bufanalysis.DeduplicateAndSortFileAnnotations(allFileAnnotations), - flags.ErrorFormat, - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - return nil -} - -func breakingForImage( - ctx context.Context, - container appflag.Container, - imageConfig bufwire.ImageConfig, - againstImageConfig bufwire.ImageConfig, - excludeImports bool, - errorFormat string, -) ([]bufanalysis.FileAnnotation, error) { - image := imageConfig.Image() - if excludeImports { - image = bufimage.ImageWithoutImports(image) - } - againstImage := againstImageConfig.Image() - if excludeImports { - againstImage = bufimage.ImageWithoutImports(againstImage) - } - return bufbreaking.NewHandler(container.Logger()).Check( - ctx, - imageConfig.Config().Breaking, - againstImage, - image, - ) -} - -func getExternalPathsForImages(imageConfigs []bufwire.ImageConfig, excludeImports bool) ([]string, error) { - externalPaths := make(map[string]struct{}) - for _, imageConfig := range imageConfigs { - image := imageConfig.Image() - if excludeImports { - image = bufimage.ImageWithoutImports(image) - } - for _, imageFile := range image.Files() { - externalPaths[imageFile.ExternalPath()] = struct{}{} - } - } - return stringutil.MapToSlice(externalPaths), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/usage.gen.go deleted file mode 100644 index b4328918dd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/breaking/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package breaking - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/convert.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/convert.go deleted file mode 100644 index 52c9fa80d7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/convert.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package convert - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufconvert" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/gen/data/datawkt" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - errorFormatFlagName = "error-format" - typeFlagName = "type" - fromFlagName = "from" - outputFlagName = "to" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Convert a message from binary to JSON or vice versa", - Long: ` -Use an input proto to interpret a proto/json message and convert it to a different format. - -Examples: - - $ buf convert --type= --from= --to= - -The can be a local .proto file, binary output of "buf build", bsr module or local buf module: - - $ buf convert example.proto --type=Foo.proto --from=payload.json --to=output.binpb - -All of , "--from" and "to" accept formatting options: - - $ buf convert example.proto#format=binpb --type=buf.Foo --from=payload#format=json --to=out#format=json - -Both and "--from" accept stdin redirecting: - - $ buf convert <(buf build -o -)#format=binpb --type=foo.Bar --from=<(echo "{\"one\":\"55\"}")#format=json - -Redirect from stdin to --from: - - $ echo "{\"one\":\"55\"}" | buf convert buf.proto --type buf.Foo --from -#format=json - -Redirect from stdin to : - - $ buf build -o - | buf convert -#format=binpb --type buf.Foo --from=payload.json - -Use a module on the bsr: - - $ buf convert --type buf.Foo --from=payload.json -`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ErrorFormat string - Type string - From string - To string - - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.StringVar( - &f.Type, - typeFlagName, - "", - `The full type name of the message within the input (e.g. acme.weather.v1.Units)`, - ) - flagSet.StringVar( - &f.From, - fromFlagName, - "-", - fmt.Sprintf( - `The location of the payload to be converted. Supported formats are %s`, - bufconvert.MessageEncodingFormatsString, - ), - ) - flagSet.StringVar( - &f.To, - outputFlagName, - "-", - fmt.Sprintf( - `The output location of the conversion. Supported formats are %s`, - bufconvert.MessageEncodingFormatsString, - ), - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - image, inputErr := bufcli.NewImageForSource( - ctx, - container, - input, - flags.ErrorFormat, - false, // disableSymlinks - "", // configOverride - nil, // externalDirOrFilePaths - nil, // externalExcludeDirOrFilePaths - false, // externalDirOrFilePathsAllowNotExist - false, // excludeSourceCodeInfo - ) - var resolveWellKnownType bool - // only resolve wkts if input was not set. - if container.NumArgs() == 0 { - if inputErr != nil { - resolveWellKnownType = true - } - if image != nil { - _, filterErr := bufimageutil.ImageFilteredByTypes(image, flags.Type) - if errors.Is(filterErr, bufimageutil.ErrImageFilterTypeNotFound) { - resolveWellKnownType = true - } - } - } - if resolveWellKnownType { - if _, ok := datawkt.MessageFilePath(flags.Type); ok { - var wktErr error - image, wktErr = bufcli.WellKnownTypeImage(ctx, container.Logger(), flags.Type) - if wktErr != nil { - return wktErr - } - } - } - if inputErr != nil && image == nil { - return inputErr - } - fromMessageRef, err := bufconvert.NewMessageEncodingRef(ctx, flags.From, bufconvert.MessageEncodingBinpb) - if err != nil { - return fmt.Errorf("--%s: %v", outputFlagName, err) - } - message, err := bufcli.NewWireProtoEncodingReader( - container.Logger(), - ).GetMessage( - ctx, - container, - image, - flags.Type, - fromMessageRef, - ) - if err != nil { - return err - } - defaultToEncoding, err := inverseEncoding(fromMessageRef.MessageEncoding()) - if err != nil { - return err - } - outputMessageRef, err := bufconvert.NewMessageEncodingRef(ctx, flags.To, defaultToEncoding) - if err != nil { - return fmt.Errorf("--%s: %v", outputFlagName, err) - } - return bufcli.NewWireProtoEncodingWriter( - container.Logger(), - ).PutMessage( - ctx, - container, - image, - message, - outputMessageRef, - ) -} - -// inverseEncoding returns the opposite encoding of the provided encoding, -// which will be the default output encoding for a given payload encoding. -func inverseEncoding(encoding bufconvert.MessageEncoding) (bufconvert.MessageEncoding, error) { - switch encoding { - case bufconvert.MessageEncodingBinpb: - return bufconvert.MessageEncodingJSON, nil - case bufconvert.MessageEncodingJSON: - return bufconvert.MessageEncodingBinpb, nil - default: - return 0, fmt.Errorf("unknown message encoding %v", encoding) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/usage.gen.go deleted file mode 100644 index f3c00956c7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/convert/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package convert - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/curl.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/curl.go deleted file mode 100644 index e2ecece8ae..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/curl.go +++ /dev/null @@ -1,1026 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package curl - -import ( - "bytes" - "context" - "crypto/tls" - "encoding/base64" - "errors" - "fmt" - "io" - "net" - "net/http" - "net/url" - "os" - "path/filepath" - "strings" - "time" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/bufcurl" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/app/appverbose" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/netrc" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/buf/private/pkg/verbose" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "go.uber.org/multierr" - "golang.org/x/net/http2" -) - -const ( - // Input schema flags - schemaFlagName = "schema" - - // Reflection flags - reflectFlagName = "reflect" - reflectHeaderFlagName = "reflect-header" - reflectProtocolFlagName = "reflect-protocol" - - // Protocol/transport flags - protocolFlagName = "protocol" - unixSocketFlagName = "unix-socket" - http2PriorKnowledgeFlagName = "http2-prior-knowledge" - - // TLS flags - keyFlagName = "key" - certFlagName = "cert" - certFlagShortName = "E" - caCertFlagName = "cacert" - serverNameFlagName = "servername" - insecureFlagName = "insecure" - insecureFlagShortName = "k" - - // Timeout flags - noKeepAliveFlagName = "no-keepalive" - keepAliveFlagName = "keepalive-time" - connectTimeoutFlagName = "connect-timeout" - - // Header and request body flags - userAgentFlagName = "user-agent" - userAgentFlagShortName = "A" - userFlagName = "user" - userFlagShortName = "u" - netrcFlagName = "netrc" - netrcFlagShortName = "n" - netrcFileFlagName = "netrc-file" - headerFlagName = "header" - headerFlagShortName = "H" - dataFlagName = "data" - dataFlagShortName = "d" - - // Output flags - outputFlagName = "output" - outputFlagShortName = "o" - emitDefaultsFlagName = "emit-defaults" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Invoke an RPC endpoint, a la 'cURL'", - Long: `This command helps you invoke HTTP RPC endpoints on a server that uses gRPC or Connect. - -By default, server reflection is used, unless the --reflect flag is set to false. Without server -reflection, a --schema flag must be provided to indicate the Protobuf schema for the method being -invoked. - -The only positional argument is the URL of the RPC method to invoke. The name of the method to -invoke comes from the last two path components of the URL, which should be the fully-qualified -service name and method name, respectively. - -The URL can use either http or https as the scheme. If http is used then HTTP 1.1 will be used -unless the --http2-prior-knowledge flag is set. If https is used then HTTP/2 will be preferred -during protocol negotiation and HTTP 1.1 used only if the server does not support HTTP/2. - -The default RPC protocol used will be Connect. To use a different protocol (gRPC or gRPC-Web), -use the --protocol flag. Note that the gRPC protocol cannot be used with HTTP 1.1. - -The input request is specified via the -d or --data flag. If absent, an empty request is sent. If -the flag value starts with an at-sign (@), then the rest of the flag value is interpreted as a -filename from which to read the request body. If that filename is just a dash (-), then the request -body is read from stdin. The request body is a JSON document that contains the JSON formatted -request message. If the RPC method being invoked is a client-streaming method, the request body may -consist of multiple JSON values, appended to one another. Multiple JSON documents should usually be -separated by whitespace, though this is not strictly required unless the request message type has a -custom JSON representation that is not a JSON object. - -Request metadata (i.e. headers) are defined using -H or --header flags. The flag value is in -"name: value" format. But if it starts with an at-sign (@), the rest of the value is interpreted as -a filename from which headers are read, each on a separate line. If the filename is just a dash (-), -then the headers are read from stdin. - -If headers and the request body are both to be read from the same file (or both read from stdin), -the file must include headers first, then a blank line, and then the request body. - -Examples: - -Issue a unary RPC to a plain-text (i.e. "h2c") gRPC server, where the schema for the service is -in a Buf module in the current directory, using an empty request message: - - $ buf curl --schema . --protocol grpc --http2-prior-knowledge \ - http://localhost:20202/foo.bar.v1.FooService/DoSomething - -Issue an RPC to a Connect server, where the schema comes from the Buf Schema Registry, using -a request that is defined as a command-line argument: - - $ buf curl --schema buf.build/bufbuild/eliza \ - --data '{"name": "Bob Loblaw"}' \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Introduce - -Issue a unary RPC to a server that supports reflection, with verbose output: - - $ buf curl --data '{"sentence": "I am not feeling well."}' -v \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Say - -Issue a client-streaming RPC to a gRPC-web server that supports reflection, where custom -headers and request data are both in a heredoc: - - $ buf curl --data @- --header @- --protocol grpcweb \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Converse \ - < arguments to -other buf sub-commands such as build and generate. It can indicate a directory, a file, a -remote module in the Buf Schema Registry, or even standard in ("-") for feeding an image or -file descriptor set to the command in a shell pipeline. -Setting this flags implies --%s=false`, - reflectFlagName, - ), - ) - flagSet.BoolVar( - &f.Reflect, - reflectFlagName, - true, - `If true, use server reflection to determine the schema`, - ) - flagSet.StringSliceVar( - &f.ReflectHeaders, - reflectHeaderFlagName, - nil, - fmt.Sprintf(`Request headers to include with reflection requests. This flag may only be used -when --%s is also set. This flag may be specified more than once to indicate -multiple headers. Each flag value should have the form "name: value". But a special value -of '*' may be used to indicate that all normal request headers (from --%s and -%s -flags) should also be included with reflection requests. A special value of '@' -means to read headers from the file at . If the path is "-" then headers are -read from stdin. It is not allowed to indicate a file with the same path as used with -the request data flag (--%s or -%s). Furthermore, it is not allowed to indicate stdin -if the schema is expected to be provided via stdin as a file descriptor set or image`, - reflectFlagName, headerFlagName, headerFlagShortName, dataFlagName, dataFlagShortName, - ), - ) - flagSet.StringVar( - &f.ReflectProtocol, - reflectProtocolFlagName, - "", - `The reflection protocol to use for downloading information from the server. This flag -may only be used when server reflection is used. By default, this command will try all known -reflection protocols from newest to oldest. If this results in a "Not Implemented" error, -then older protocols will be used. In practice, this means that "grpc-v1" is tried first, -and "grpc-v1alpha" is used if it doesn't work. If newer reflection protocols are introduced, -they may be preferred in the absence of this flag being explicitly set to a specific protocol. -The valid values for this flag are "grpc-v1" and "grpc-v1alpha". These correspond to services -named "grpc.reflection.v1.ServerReflection" and "grpc.reflection.v1alpha.ServerReflection" -respectively`, - ) - - flagSet.StringVar( - &f.Protocol, - protocolFlagName, - connect.ProtocolConnect, - `The RPC protocol to use. This can be one of "grpc", "grpcweb", or "connect"`, - ) - flagSet.StringVar( - &f.UnixSocket, - unixSocketFlagName, - "", - `The path to a unix socket that will be used instead of opening a TCP socket to the host -and port indicated in the URL`, - ) - flagSet.BoolVar( - &f.HTTP2PriorKnowledge, - http2PriorKnowledgeFlagName, - false, - `This flag can be used with URLs that use the http scheme (as opposed to https) to indicate -that HTTP/2 should be used. Without this, HTTP 1.1 will be used with URLs with an http -scheme. For https scheme, HTTP/2 will be negotiate during the TLS handshake if the server -supports it (otherwise HTTP 1.1 is used)`, - ) - - flagSet.BoolVar( - &f.NoKeepAlive, - noKeepAliveFlagName, - false, - `By default, connections are created using TCP keepalive. If this flag is present, they -will be disabled`, - ) - flagSet.Float64Var( - &f.KeepAliveTimeSeconds, - keepAliveFlagName, - 60, - `The duration, in seconds, between TCP keepalive transmissions`, - ) - flagSet.Float64Var( - &f.ConnectTimeoutSeconds, - connectTimeoutFlagName, - 0, - `The time limit, in seconds, for a connection to be established with the server. There is -no limit if this flag is not present`, - ) - - flagSet.StringVar( - &f.Key, - keyFlagName, - "", - fmt.Sprintf(`Path to a PEM-encoded X509 private key file, for using client certificates with TLS. This -option is only valid when the URL uses the https scheme. A --%s or -%s flag must also be -present to provide tha certificate and public key that corresponds to the given -private key`, - certFlagName, certFlagShortName, - ), - ) - flagSet.StringVarP( - &f.Cert, - certFlagName, - certFlagShortName, - "", - fmt.Sprintf(`Path to a PEM-encoded X509 certificate file, for using client certificates with TLS. This -option is only valid when the URL uses the https scheme. A --%s flag must also be -present to provide tha private key that corresponds to the given certificate`, - keyFlagName, - ), - ) - flagSet.StringVar( - &f.CACert, - caCertFlagName, - "", - fmt.Sprintf(`Path to a PEM-encoded X509 certificate pool file that contains the set of trusted -certificate authorities/issuers. If omitted, the system's default set of trusted -certificates are used to verify the server's certificate. This option is only valid -when the URL uses the https scheme. It is not applicable if --%s or -%s flag is used`, - insecureFlagName, insecureFlagShortName, - ), - ) - flagSet.BoolVarP( - &f.Insecure, - insecureFlagName, - insecureFlagShortName, - false, - `If set, the TLS connection will be insecure and the server's certificate will NOT be -verified. This is generally discouraged. This option is only valid when the URL uses -the https scheme`, - ) - flagSet.StringVar( - &f.ServerName, - serverNameFlagName, - "", - `The server name to use in TLS handshakes (for SNI) if the URL scheme is https. If not -specified, the default is the origin host in the URL or the value in a "Host" header if -one is provided`, - ) - - flagSet.StringVarP( - &f.UserAgent, - userAgentFlagName, - userAgentFlagShortName, - "", - fmt.Sprintf(`The user agent string to send. This is ignored if a --%s or -%s flag is provided -that sets a header named 'User-Agent'.`, - headerFlagName, headerFlagShortName, - ), - ) - flagSet.StringVarP( - &f.User, - userFlagName, - userFlagShortName, - "", - fmt.Sprintf(`The user credentials to send, via a basic authorization header. The value should be -in the format "username:password". If the value has no colon, it is assumed to just be -the username, in which case you will be prompted to enter a password. This overrides -the use of a .netrc file. This is ignored if a --%s or -%s flag is provided that sets -a header named 'Authorization'.`, - headerFlagName, headerFlagShortName, - ), - ) - flagSet.BoolVarP( - &f.Netrc, - netrcFlagName, - netrcFlagShortName, - false, - fmt.Sprintf(`If true, a file named .netrc in the user's home directory will be examined to find -credentials for the request. The credentials will be sent via a basic authorization header. -The command will fail if the file does not have an entry for the hostname in the URL. This -flag is ignored if a --%s or -%s flag is present. This is ignored if a --%s or -%s flag -is provided that sets a header named 'Authorization'.`, - userFlagName, userFlagShortName, headerFlagName, headerFlagShortName, - ), - ) - flagSet.StringVar( - &f.NetrcFile, - netrcFileFlagName, - "", - fmt.Sprintf(`This is just like use --%s or -%s, except that the named file is used instead of -a file named .netrc in the user's home directory. This flag cannot be used with the --%s -or -%s flag. This is ignored if a --%s or -%s flag is provided that sets a header named -'Authorization'.`, - netrcFlagName, netrcFlagShortName, netrcFlagName, netrcFlagShortName, headerFlagName, headerFlagShortName, - ), - ) - flagSet.StringSliceVarP( - &f.Headers, - headerFlagName, - headerFlagShortName, - nil, - fmt.Sprintf(`Request headers to include with the RPC invocation. This flag may be specified more -than once to indicate multiple headers. Each flag value should have the form "name: value". -A special value of '@' means to read headers from the file at . If the path -is "-" then headers are read from stdin. If the same file is indicated as used with the -request data flag (--%s or -%s), the file must contain all headers, then a blank line, -and then the request body. It is not allowed to indicate stdin if the schema is expected -to be provided via stdin as a file descriptor set or image`, - dataFlagName, dataFlagShortName, - ), - ) - flagSet.StringVarP( - &f.Data, - dataFlagName, - dataFlagShortName, - "", - fmt.Sprintf(`Request data. This should be zero or more JSON documents, each indicating a request -message. For unary RPCs, there should be exactly one JSON document. A special value of -'@' means to read the data from the file at . If the path is "-" then the -request data is read from stdin. If the same file is indicated as used with the request -headers flags (--%s or -%s), the file must contain all headers, then a blank line, and -then the request body. It is not allowed to indicate stdin if the schema is expected to be -provided via stdin as a file descriptor set or image`, - headerFlagName, headerFlagShortName, - ), - ) - flagSet.StringVarP( - &f.Output, - outputFlagName, - outputFlagShortName, - "", - `Path to output file to create with response data. If absent, response is printed to stdout`, - ) - flagSet.BoolVar( - &f.EmitDefaults, - emitDefaultsFlagName, - false, - `Emit default values for JSON-encoded responses.`, - ) -} - -func (f *flags) validate(isSecure bool) error { - if (f.Key != "" || f.Cert != "" || f.CACert != "" || f.ServerName != "" || f.flagSet.Changed(insecureFlagName)) && - !isSecure { - return fmt.Errorf( - "TLS flags (--%s, --%s, --%s, --%s, --%s) should not be used unless URL is secure (https)", - keyFlagName, certFlagName, caCertFlagName, insecureFlagName, serverNameFlagName) - } - if (f.Key != "") != (f.Cert != "") { - return fmt.Errorf("if one of --%s or --%s flags is used, both should be used (mutual TLS with a client certificate requires both)", keyFlagName, certFlagName) - } - if f.Insecure && f.CACert != "" { - return fmt.Errorf("if --%s is set, --%s should not be set as it is unused", insecureFlagName, caCertFlagName) - } - - if f.HTTP2PriorKnowledge && isSecure { - return fmt.Errorf("--%s flag is not for use with secure URLs (https) since http/2 can be negotiated during TLS handshake", http2PriorKnowledgeFlagName) - } - if !isSecure && !f.HTTP2PriorKnowledge && f.Protocol == connect.ProtocolGRPC { - return fmt.Errorf("grpc protocol cannot be used with plain-text URLs (http) unless --%s flag is set", http2PriorKnowledgeFlagName) - } - - if f.Netrc && f.NetrcFile != "" { - return fmt.Errorf("--%s and --%s flags are mutually exclusive; they may not both be specified", netrcFlagName, netrcFileFlagName) - } - - if f.Schema != "" && f.Reflect { - if f.flagSet.Changed(reflectFlagName) { - // explicitly enabled both - return fmt.Errorf("cannot specify both --%s and --%s", schemaFlagName, reflectFlagName) - } - // Reflect just has default value; unset it since we're going to use --schema instead - f.Reflect = false - } - if !f.Reflect && f.Schema == "" { - return fmt.Errorf("must specify --%s if --%s is false", schemaFlagName, reflectFlagName) - } - schemaIsStdin := strings.HasPrefix(f.Schema, "-") - if (len(f.ReflectHeaders) > 0 || f.flagSet.Changed(reflectProtocolFlagName)) && !f.Reflect { - return fmt.Errorf( - "reflection flags (--%s, --%s) should not be used if --%s is false", - reflectHeaderFlagName, reflectProtocolFlagName, reflectFlagName) - } - if f.Reflect { - if !isSecure && !f.HTTP2PriorKnowledge { - return fmt.Errorf("--%s cannot be used with plain-text URLs (http) unless --%s flag is set", reflectFlagName, http2PriorKnowledgeFlagName) - } - if _, err := bufcurl.ParseReflectProtocol(f.ReflectProtocol); err != nil { - return fmt.Errorf( - "--%s value must be one of %s", - reflectProtocolFlagName, - stringutil.SliceToHumanStringOrQuoted(bufcurl.AllKnownReflectProtocolStrings), - ) - } - } - - switch f.Protocol { - case connect.ProtocolConnect, connect.ProtocolGRPC, connect.ProtocolGRPCWeb: - default: - return fmt.Errorf( - "--%s value must be one of %q, %q, or %q", - protocolFlagName, connect.ProtocolConnect, connect.ProtocolGRPC, connect.ProtocolGRPCWeb) - } - - if f.NoKeepAlive && f.flagSet.Changed(keepAliveFlagName) { - return fmt.Errorf("--%s should not be specified if keepalive is disabled", keepAliveFlagName) - } - if f.KeepAliveTimeSeconds <= 0 { - return fmt.Errorf("--%s value must be positive", keepAliveFlagName) - } - // these two default to zero (which means no timeout in effect) - if f.ConnectTimeoutSeconds < 0 || (f.ConnectTimeoutSeconds == 0 && f.flagSet.Changed(connectTimeoutFlagName)) { - return fmt.Errorf("--%s value must be positive", connectTimeoutFlagName) - } - - var dataFile string - if strings.HasPrefix(f.Data, "@") { - dataFile = strings.TrimPrefix(f.Data, "@") - if dataFile == "" { - return fmt.Errorf("--%s value starting with '@' must indicate '-' for stdin or a filename", dataFlagName) - } - if dataFile == "-" && schemaIsStdin { - return fmt.Errorf("--%s and --%s flags cannot both indicate reading from stdin", schemaFlagName, dataFlagName) - } - } - - headerFiles := map[string]struct{}{} - if err := validateHeaders(f.Headers, headerFlagName, schemaIsStdin, false, headerFiles); err != nil { - return err - } - reflectHeaderFiles := map[string]struct{}{} - if err := validateHeaders(f.ReflectHeaders, reflectHeaderFlagName, schemaIsStdin, true, reflectHeaderFiles); err != nil { - return err - } - for file := range reflectHeaderFiles { - if file == dataFile { - return fmt.Errorf("--%s and --%s flags cannot indicate the same source", dataFlagName, reflectHeaderFlagName) - } - } - - return nil -} - -func (f *flags) determineCredentials( - ctx context.Context, - container interface { - app.Container - appverbose.Container - }, - host string, -) (string, error) { - if f.User != "" { - // this flag overrides any netrc-related flags - parts := strings.SplitN(f.User, ":", 2) - username := parts[0] - var password string - if len(parts) < 2 { - var err error - password, err = promptForPassword(ctx, container, fmt.Sprintf("Enter host password for user %q:", username)) - if err != nil { - return "", fmt.Errorf("could not prompt for password: %w", err) - } - } else { - password = parts[1] - } - return basicAuth(username, password), nil - } - - // process netrc-related flags - netrcFile := f.NetrcFile - if netrcFile == "" { - if !f.Netrc { - // no netrc file usage, so no creds - return "", nil - } - var err error - netrcFile, err = netrc.GetFilePath(container) - if err != nil { - return "", fmt.Errorf("could not determine path to .netrc file: %w", err) - } - } - if _, err := os.Stat(netrcFile); err != nil { - if errors.Is(err, os.ErrNotExist) { - // This mirrors the behavior of curl when a netrc file does not exist ¯\_(ツ)_/¯ - container.VerbosePrinter().Printf("* Couldn't find host %s in the file %q; using no credentials", host, netrcFile) - return "", nil - } - if !strings.Contains(err.Error(), netrcFile) { - // make sure error message contains path to file - return "", fmt.Errorf("could not read file: %s: %w", netrcFile, err) - } - return "", fmt.Errorf("could not read file: %w", err) - } - machine, err := netrc.GetMachineForNameAndFilePath(host, netrcFile) - if err != nil { - return "", fmt.Errorf("could not read file: %s: %w", netrcFile, err) - } - if machine == nil { - // no creds found for this host - container.VerbosePrinter().Printf("* Couldn't find host %s in the file %q; using no credentials", host, netrcFile) - return "", nil - } - username := machine.Login() - if strings.ContainsRune(username, ':') { - return "", fmt.Errorf("invalid credentials found for %s in %s: username %s should not contain colon", host, netrcFile, username) - } - password := machine.Password() - return basicAuth(username, password), nil -} - -func promptForPassword(ctx context.Context, container app.Container, prompt string) (string, error) { - // NB: The comments below and the mechanism of handling I/O async was - // copied from the "registry login" command. - - // If a user sends a SIGINT to buf, the top-level application context is - // cancelled and signal masks are reset. However, during an interactive - // login the context is not respected; for example, it takes two SIGINTs - // to interrupt the process. - - // Ideally we could just trigger an I/O timeout by setting the deadline on - // stdin, but when stdin is connected to a terminal the underlying fd is in - // blocking mode making it ineligible. As changing the mode of stdin is - // dangerous, this change takes an alternate approach of simply returning - // early. - - // Note that this does not gracefully handle the case where the terminal is - // in no-echo mode, as is the case when prompting for a password - // interactively. - ch := make(chan struct{}) - var password string - var err error - go func() { - defer close(ch) - password, err = bufcli.PromptUserForPassword(container, prompt) - }() - select { - case <-ch: - return password, err - case <-ctx.Done(): - ctxErr := ctx.Err() - // Otherwise we will print "Failure: context canceled". - if errors.Is(ctxErr, context.Canceled) { - // Otherwise the next terminal line will be on the same line as the - // last output from buf. - if _, err := fmt.Fprintln(container.Stdout()); err != nil { - return "", err - } - return "", errors.New("interrupted") - } - return "", ctxErr - } -} - -func basicAuth(username, password string) string { - var buf bytes.Buffer - buf.WriteString(username) - buf.WriteByte(':') - buf.WriteString(password) - return "Basic " + base64.StdEncoding.EncodeToString(buf.Bytes()) -} - -func validateHeaders(flags []string, flagName string, schemaIsStdin bool, allowAsterisk bool, headerFiles map[string]struct{}) error { - var hasAsterisk bool - for _, header := range flags { - switch { - case strings.HasPrefix(header, "@"): - file := strings.TrimPrefix(header, "@") - if _, ok := headerFiles[file]; ok { - return fmt.Errorf("multiple --%s values refer to the same file %s", flagName, file) - } - if file == "" { - return fmt.Errorf("--%s value starting with '@' must indicate '-' for stdin or a filename", flagName) - } - if file == "-" && schemaIsStdin { - return fmt.Errorf("--%s and --%s flags cannot both indicate reading from stdin", schemaFlagName, flagName) - } - headerFiles[file] = struct{}{} - case header == "*": - if !allowAsterisk { - return fmt.Errorf("--%s value '*' is not valid", flagName) - } - if hasAsterisk { - return fmt.Errorf("multiple --%s values both indicate '*'", flagName) - } - hasAsterisk = true - case header == "": - return fmt.Errorf("--%s value cannot be blank", flagName) - case strings.ContainsRune(header, '\n'): - return fmt.Errorf("--%s value cannot contain a newline", flagName) - default: - parts := strings.SplitN(header, ":", 2) - if len(parts) < 2 { - return fmt.Errorf("--%s value is a malformed header: %q", flagName, header) - } - } - } - - return nil -} - -func verifyEndpointURL(urlArg string) (endpointURL *url.URL, service, method, baseURL string, err error) { - endpointURL, err = url.Parse(urlArg) - if err != nil { - return nil, "", "", "", fmt.Errorf("%q is not a valid endpoint URL: %w", urlArg, err) - } - if endpointURL.Scheme != "http" && endpointURL.Scheme != "https" { - return nil, "", "", "", fmt.Errorf("invalid endpoint URL: scheme %q is not supported", endpointURL.Scheme) - } - - if strings.HasSuffix(endpointURL.Path, "/") { - return nil, "", "", "", fmt.Errorf("invalid endpoint URL: path %q should not end with a slash (/)", endpointURL.Path) - } - parts := strings.Split(endpointURL.Path, "/") - if len(parts) < 2 || parts[len(parts)-1] == "" || parts[len(parts)-2] == "" { - return nil, "", "", "", fmt.Errorf("invalid endpoint URL: path %q should end with two non-empty components indicating service and method", endpointURL.Path) - } - service, method = parts[len(parts)-2], parts[len(parts)-1] - baseURL = strings.TrimSuffix(urlArg, service+"/"+method) - if baseURL == urlArg { - // should not be possible due to above checks - return nil, "", "", "", fmt.Errorf("failed to extract base URL from %q", urlArg) - } - return endpointURL, service, method, baseURL, nil -} - -func checkPositionalArgs(_ *cobra.Command, args []string) error { - if len(args) != 1 { - return errors.New("expecting exactly one positional argument: the URL of the endpoint to invoke") - } - _, _, _, _, err := verifyEndpointURL(args[0]) - return err -} - -func run(ctx context.Context, container appflag.Container, f *flags) (err error) { - endpointURL, service, method, baseURL, err := verifyEndpointURL(container.Arg(0)) - if err != nil { - return err - } - isSecure := endpointURL.Scheme == "https" - if err := f.validate(isSecure); err != nil { - return err - } - - var clientOptions []connect.ClientOption - switch f.Protocol { - case connect.ProtocolGRPC: - clientOptions = []connect.ClientOption{connect.WithGRPC()} - case connect.ProtocolGRPCWeb: - clientOptions = []connect.ClientOption{connect.WithGRPCWeb()} - } - if f.Protocol != connect.ProtocolGRPC { - // The transport will log trailers to the verbose printer. But if - // we're not using standard grpc protocol, trailers are actually encoded - // in an end-of-stream message for streaming calls. So this interceptor - // will print the trailers for streaming calls when the response stream - // is drained. - clientOptions = append(clientOptions, connect.WithInterceptors(bufcurl.TraceTrailersInterceptor(container.VerbosePrinter()))) - } - - dataSource := "(argument)" - var dataFileReference string - if strings.HasPrefix(f.Data, "@") { - dataFileReference = strings.TrimPrefix(f.Data, "@") - if dataFileReference == "-" { - dataSource = "(stdin)" - } else { - dataSource = dataFileReference - if absFile, err := filepath.Abs(dataFileReference); err == nil { - dataFileReference = absFile - } - } - } - requestHeaders, dataReader, err := bufcurl.LoadHeaders(f.Headers, dataFileReference, nil) - if err != nil { - return err - } - if len(requestHeaders.Values("user-agent")) == 0 { - userAgent := f.UserAgent - if userAgent == "" { - userAgent = bufcurl.DefaultUserAgent(f.Protocol, bufcli.Version) - } - requestHeaders.Set("user-agent", userAgent) - } - var basicCreds *string - if len(requestHeaders.Values("authorization")) == 0 { - creds, err := f.determineCredentials(ctx, container, endpointURL.Host) - if err != nil { - return err - } - if creds != "" { - requestHeaders.Set("authorization", creds) - } - // set this to non-nil so we know we've already determined credentials - basicCreds = &creds - } - if dataReader == nil { - if dataFileReference == "-" { - dataReader = os.Stdin - } else if dataFileReference != "" { - f, err := os.Open(dataFileReference) - if err != nil { - return bufcurl.ErrorHasFilename(err, dataFileReference) - } - dataReader = f - } else if f.Data != "" { - dataReader = io.NopCloser(strings.NewReader(f.Data)) - } - // dataReader is left nil when nothing specified on command-line - } - defer func() { - if dataReader != nil { - err = multierr.Append(err, dataReader.Close()) - } - }() - - transport, err := makeHTTPClient(f, isSecure, bufcurl.GetAuthority(endpointURL, requestHeaders), container.VerbosePrinter()) - if err != nil { - return err - } - - output := container.Stdout() - if f.Output != "" { - output, err = os.Create(f.Output) - if err != nil { - return bufcurl.ErrorHasFilename(err, f.Output) - } - } - - var res protoencoding.Resolver - if f.Reflect { - reflectHeaders, _, err := bufcurl.LoadHeaders(f.ReflectHeaders, "", requestHeaders) - if err != nil { - return err - } - if len(reflectHeaders.Values("authorization")) == 0 { - var creds string - if basicCreds != nil { - creds = *basicCreds - } else { - if creds, err = f.determineCredentials(ctx, container, endpointURL.Host); err != nil { - return err - } - } - if creds != "" { - reflectHeaders.Set("authorization", creds) - } - } - reflectProtocol, err := bufcurl.ParseReflectProtocol(f.ReflectProtocol) - if err != nil { - return err - } - var closeRes func() - res, closeRes = bufcurl.NewServerReflectionResolver(ctx, transport, clientOptions, baseURL, reflectProtocol, reflectHeaders, container.VerbosePrinter()) - defer closeRes() - } else { - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, f.Schema) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(false) - // TODO: Ideally, we'd use our verbose client for this Connect client, so we can see the same - // kind of output in verbose mode as we see for reflection requests. - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - imageConfigReader, err := bufcli.NewWireImageConfigReader( - container, - storageosProvider, - command.NewRunner(), - clientConfig, - ) - if err != nil { - return err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - "", - nil, - nil, - false, // input files must exist - false, // we must include source info for generation - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations(container.Stderr(), fileAnnotations, bufanalysis.FormatText.String()); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - images := make([]bufimage.Image, 0, len(imageConfigs)) - for _, imageConfig := range imageConfigs { - images = append(images, imageConfig.Image()) - } - image, err := bufimage.MergeImages(images...) - if err != nil { - return err - } - res, err = protoencoding.NewResolver(bufimage.ImageToFileDescriptors(image)...) - if err != nil { - return err - } - } - - methodDescriptor, err := bufcurl.ResolveMethodDescriptor(res, service, method) - if err != nil { - return err - } - - // Now we can finally issue the RPC - invoker := bufcurl.NewInvoker(container, methodDescriptor, res, f.EmitDefaults, transport, clientOptions, container.Arg(0), output) - return invoker.Invoke(ctx, dataSource, dataReader, requestHeaders) -} - -func makeHTTPClient(f *flags, isSecure bool, authority string, printer verbose.Printer) (connect.HTTPClient, error) { - var dialer net.Dialer - if f.ConnectTimeoutSeconds != 0 { - dialer.Timeout = secondsToDuration(f.ConnectTimeoutSeconds) - } - if f.NoKeepAlive { - dialer.KeepAlive = -1 - } else { - dialer.KeepAlive = secondsToDuration(f.KeepAliveTimeSeconds) - } - var dialFunc func(ctx context.Context, network, address string) (net.Conn, error) - if f.UnixSocket != "" { - dialFunc = func(ctx context.Context, network, addr string) (net.Conn, error) { - printer.Printf("* Dialing unix socket %s...", f.UnixSocket) - return dialer.DialContext(ctx, "unix", f.UnixSocket) - } - } else { - dialFunc = func(ctx context.Context, network, address string) (net.Conn, error) { - printer.Printf("* Dialing (%s) %s...", network, address) - conn, err := dialer.DialContext(ctx, network, address) - if err != nil { - return nil, err - } - printer.Printf("* Connected to %s", conn.RemoteAddr().String()) - return conn, err - } - } - - var transport http.RoundTripper - if !isSecure && f.HTTP2PriorKnowledge { - transport = &http2.Transport{ - AllowHTTP: true, - DialTLSContext: func(ctx context.Context, network, addr string, _ *tls.Config) (net.Conn, error) { - return dialFunc(ctx, network, addr) - }, - } - } else { - var tlsConfig *tls.Config - if isSecure { - var err error - tlsConfig, err = bufcurl.MakeVerboseTLSConfig(&bufcurl.TLSSettings{ - KeyFile: f.Key, - CertFile: f.Cert, - CACertFile: f.CACert, - ServerName: f.ServerName, - Insecure: f.Insecure, - }, authority, printer) - if err != nil { - return nil, err - } - } - transport = &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: dialFunc, - ForceAttemptHTTP2: true, - MaxIdleConns: 1, - TLSClientConfig: tlsConfig, - } - } - return bufcurl.NewVerboseHTTPClient(transport, printer), nil -} - -func secondsToDuration(secs float64) time.Duration { - return time.Duration(float64(time.Second) * secs) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/usage.gen.go deleted file mode 100644 index 889180cc17..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/curl/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package curl - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/export.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/export.go deleted file mode 100644 index c30f8b64a9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/export.go +++ /dev/null @@ -1,381 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package export - -import ( - "context" - "errors" - "os" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "go.uber.org/multierr" -) - -const ( - excludeImportsFlagName = "exclude-imports" - pathsFlagName = "path" - outputFlagName = "output" - outputFlagShortName = "o" - configFlagName = "config" - excludePathsFlagName = "exclude-path" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Export proto files from one location to another", - Long: bufcli.GetSourceOrModuleLong(`the source or module to export`) + ` - -Examples: - -Export proto files in to an output directory. - - $ buf export --output= - -Export current directory to another local directory. - - $ buf export . --output= - -Export the latest remote module to a local directory. - - $ buf export --output= - -Export a specific version of a remote module to a local directory. - - $ buf export --output= - -Export a git repo to a local directory. - - $ buf export https://github.com/owner/repository.git --output= -`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ExcludeImports bool - Paths []string - Output string - Config string - ExcludePaths []string - DisableSymlinks bool - - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindExcludeImports(flagSet, &f.ExcludeImports, excludeImportsFlagName) - bufcli.BindPaths(flagSet, &f.Paths, pathsFlagName) - bufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName) - flagSet.StringVarP( - &f.Output, - outputFlagName, - outputFlagShortName, - "", - `The output directory for exported files`, - ) - _ = cobra.MarkFlagRequired(flagSet, outputFlagName) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml file or data to use for configuration`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - sourceOrModuleRef, err := buffetch.NewRefParser(container.Logger()).GetSourceOrModuleRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - moduleConfigReader, err := bufcli.NewWireModuleConfigReaderForModuleReader( - container, - storageosProvider, - runner, - clientConfig, - moduleReader, - ) - if err != nil { - return err - } - moduleConfigSet, err := moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - flags.Config, - flags.Paths, - flags.ExcludePaths, - false, - ) - if err != nil { - return err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - moduleFileSetBuilder := bufmodulebuild.NewModuleFileSetBuilder( - container.Logger(), - moduleReader, - ) - // TODO: this is going to be a mess when we want to remove ModuleFileSet - moduleFileSets := make([]bufmodule.ModuleFileSet, len(moduleConfigs)) - for i, moduleConfig := range moduleConfigs { - moduleFileSet, err := moduleFileSetBuilder.Build( - ctx, - moduleConfig.Module(), - bufmodulebuild.WithWorkspace(moduleConfigSet.Workspace()), - ) - if err != nil { - return err - } - moduleFileSets[i] = moduleFileSet - } - // There are two cases where we need an image to filter the output: - // 1) the input is a proto file reference - // 2) ensuring that we are including the relevant imports - // - // In the first scenario, the imageConfigReader returns imageCongfigs that handle the filtering - // for the proto file ref. - // - // To handle imports for all other references, unless we are excluding imports, we only want - // to export those imports that are actually used. To figure this out, we build an image of images - // and use the fact that something is in an image to determine if it is actually used. - var images []bufimage.Image - _, isProtoFileRef := sourceOrModuleRef.(buffetch.ProtoFileRef) - // We gate on flags.ExcludeImports/buffetch.ProtoFileRef so that we don't waste time building if the - // result of the build is not relevant. - if !flags.ExcludeImports { - imageBuilder := bufimagebuild.NewBuilder(container.Logger(), moduleReader) - for _, moduleFileSet := range moduleFileSets { - targetFileInfos, err := moduleFileSet.TargetFileInfos(ctx) - if err != nil { - return err - } - if len(targetFileInfos) == 0 { - // This ModuleFileSet doesn't have any targets, so we shouldn't build - // an image for it. - continue - } - image, fileAnnotations, err := imageBuilder.Build( - ctx, - moduleFileSet, - bufimagebuild.WithExcludeSourceCodeInfo(), - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - // stderr since we do output to stdout potentially - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - bufanalysis.FormatText.String(), - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - images = append(images, image) - } - } else if isProtoFileRef { - // If the reference is a ProtoFileRef, we need to resolve the image for the reference, - // since the image config reader distills down the reference to the file and its dependencies, - // and also handles the #include_package_files option. - imageConfigReader, err := bufcli.NewWireImageConfigReader( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - sourceOrModuleRef, - flags.Config, - flags.Paths, - flags.ExcludePaths, - false, - true, // SourceCodeInfo is not needed here for outputting the source code - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - bufanalysis.FormatText.String(), - ); err != nil { - return err - } - } - for _, imageConfig := range imageConfigs { - images = append(images, imageConfig.Image()) - } - } - // images will only be non-empty if !flags.ExcludeImports || isProtoFileRef - // mergedImage will be nil if images is empty - // therefore, we must gate on mergedImage != nil below - mergedImage, err := bufimage.MergeImages(images...) - if err != nil { - return err - } - if err := os.MkdirAll(flags.Output, 0755); err != nil { - return err - } - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - flags.Output, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - fileInfosFunc := bufmodule.ModuleFileSet.AllFileInfos - // If we filtered on some paths, only use the targets. - // Otherwise, we want to print everything, including potentially imports. - // We can have duplicates across the ModuleFileSets and that's OK - they will - // only be written once via writtenPaths, and we aren't building here. - if len(flags.Paths) > 0 { - fileInfosFunc = func( - moduleFileSet bufmodule.ModuleFileSet, - ctx context.Context, - ) ([]bufmoduleref.FileInfo, error) { - return moduleFileSet.TargetFileInfos(ctx) - } - } - writtenPaths := make(map[string]struct{}) - for _, moduleFileSet := range moduleFileSets { - // If the reference was a proto file reference, we will use the image files as the basis - // for outputting source files. - // We do an extra mergedImage != nil check even though this must be true - if isProtoFileRef && mergedImage != nil { - for _, protoFileRefImageFile := range mergedImage.Files() { - path := protoFileRefImageFile.Path() - if _, ok := writtenPaths[path]; ok { - continue - } - if flags.ExcludeImports && protoFileRefImageFile.IsImport() { - continue - } - moduleFile, err := moduleFileSet.GetModuleFile(ctx, path) - if err != nil { - return err - } - if err := storage.CopyReadObject(ctx, readWriteBucket, moduleFile); err != nil { - return multierr.Append(err, moduleFile.Close()) - } - if err := moduleFile.Close(); err != nil { - return err - } - writtenPaths[path] = struct{}{} - } - if len(writtenPaths) == 0 { - return errors.New("no .proto target files found") - } - return nil - } - fileInfos, err := fileInfosFunc(moduleFileSet, ctx) - if err != nil { - return err - } - for _, fileInfo := range fileInfos { - path := fileInfo.Path() - if _, ok := writtenPaths[path]; ok { - continue - } - // If the file is not an import in some ModuleFileSet, it will - // eventually be written via the iteration over moduleFileSets. - if fileInfo.IsImport() { - if flags.ExcludeImports { - // Exclude imports, don't output here - continue - } else if mergedImage == nil || mergedImage.GetFile(path) == nil { - // We check the merged image to see if the path exists. If it does, - // we use this import, so we want to output the file. If it doesn't, - // continue. - continue - } - } - moduleFile, err := moduleFileSet.GetModuleFile(ctx, path) - if err != nil { - return err - } - if err := storage.CopyReadObject(ctx, readWriteBucket, moduleFile); err != nil { - return multierr.Append(err, moduleFile.Close()) - } - if err := moduleFile.Close(); err != nil { - return err - } - writtenPaths[path] = struct{}{} - } - } - if len(writtenPaths) == 0 { - return errors.New("no .proto target files found") - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/usage.gen.go deleted file mode 100644 index 77d4808e79..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/export/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package export - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/format.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/format.go deleted file mode 100644 index 92d0cfe65e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/format.go +++ /dev/null @@ -1,621 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package format - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufformat" - "github.com/bufbuild/buf/private/buf/bufwork" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "go.uber.org/multierr" -) - -const ( - configFlagName = "config" - diffFlagName = "diff" - diffFlagShortName = "d" - disableSymlinksFlagName = "disable-symlinks" - errorFormatFlagName = "error-format" - excludePathsFlagName = "exclude-path" - exitCodeFlagName = "exit-code" - outputFlagName = "output" - outputFlagShortName = "o" - pathsFlagName = "path" - writeFlagName = "write" - writeFlagShortName = "w" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Format Protobuf files", - Long: ` -By default, the source is the current directory and the formatted content is written to stdout. - -Examples: - -Write the current directory's formatted content to stdout: - - $ buf format - -Most people will want to rewrite the files defined in the current directory in-place with -w: - - $ buf format -w - -Display a diff between the original and formatted content with -d -Write a diff instead of the formatted file: - - $ buf format simple/simple.proto -d - - $ diff -u simple/simple.proto.orig simple/simple.proto - --- simple/simple.proto.orig 2022-03-24 09:44:10.000000000 -0700 - +++ simple/simple.proto 2022-03-24 09:44:10.000000000 -0700 - @@ -2,8 +2,7 @@ - - package simple; - - - - message Object { - - string key = 1; - - bytes value = 2; - + string key = 1; - + bytes value = 2; - } - -Use the --exit-code flag to exit with a non-zero exit code if there is a diff: - - $ buf format --exit-code - $ buf format -w --exit-code - $ buf format -d --exit-code - -Format a file, directory, or module reference by specifying a source e.g. -Write the formatted file to stdout: - - $ buf format simple/simple.proto - - syntax = "proto3"; - - package simple; - - message Object { - string key = 1; - bytes value = 2; - } - -Write the formatted directory to stdout: - - $ buf format simple - ... - -Write the formatted module reference to stdout: - - $ buf format buf.build/acme/petapis - ... - -Write the result to a specified output file or directory with -o e.g. - -Write the formatted file to another file: - - $ buf format simple/simple.proto -o simple/simple.formatted.proto - -Write the formatted directory to another directory, creating it if it doesn't exist: - - $ buf format proto -o formatted - -This also works with module references: - - $ buf format buf.build/acme/weather -o formatted - -Rewrite the file(s) in-place with -w. e.g. - -Rewrite a single file in-place: - - $ buf format simple.proto -w - -Rewrite an entire directory in-place: - - $ buf format proto -w - -Write a diff and rewrite the file(s) in-place: - - $ buf format simple -d -w - - $ diff -u simple/simple.proto.orig simple/simple.proto - ... - -The -w and -o flags cannot be used together in a single invocation. -`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Config string - Diff bool - DisableSymlinks bool - ErrorFormat string - ExcludePaths []string - ExitCode bool - Paths []string - Output string - Write bool - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindPaths(flagSet, &f.Paths, pathsFlagName) - bufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.BoolVarP( - &f.Diff, - diffFlagName, - diffFlagShortName, - false, - "Display diffs instead of rewriting files", - ) - flagSet.BoolVar( - &f.ExitCode, - exitCodeFlagName, - false, - "Exit with a non-zero exit code if files were not already formatted", - ) - flagSet.BoolVarP( - &f.Write, - writeFlagName, - writeFlagShortName, - false, - "Rewrite files in-place", - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.StringVarP( - &f.Output, - outputFlagName, - outputFlagShortName, - "-", - fmt.Sprintf( - `The output location for the formatted files. Must be one of format %s. If omitted, the result is written to stdout`, - buffetch.SourceFormatsString, - ), - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml file or data to use for configuration`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - if flags.Output != "-" && flags.Write { - return fmt.Errorf("--%s cannot be used with --%s", outputFlagName, writeFlagName) - } - source, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - refParser := buffetch.NewRefParser(container.Logger()) - sourceOrModuleRef, err := refParser.GetSourceOrModuleRef(ctx, source) - if err != nil { - return err - } - if _, ok := sourceOrModuleRef.(buffetch.ModuleRef); ok && flags.Write { - return fmt.Errorf("--%s cannot be used with module reference inputs", writeFlagName) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return err - } - runner := command.NewRunner() - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - moduleConfigReader, err := bufcli.NewWireModuleConfigReaderForModuleReader( - container, - storageosProvider, - runner, - clientConfig, - moduleReader, - ) - if err != nil { - return err - } - moduleConfigSet, err := moduleConfigReader.GetModuleConfigSet( - ctx, - container, - sourceOrModuleRef, - flags.Config, - flags.Paths, - flags.ExcludePaths, - false, - ) - if err != nil { - return err - } - moduleConfigs := moduleConfigSet.ModuleConfigs() - var outputDirectory string - var singleFileOutputFilename string - if flags.Output != "-" { - // The output file type is determined based on its extension, - // so it's possible to write a single file's formatted content - // to another single file. - // - // $ buf format simple.proto -o simple.formatted.proto - // - // In this case, it's also possible to write an entire directory's - // formatted content to a single file (like we see in the default - // behavior with stdout). - // - // $ buf format simple -o simple.formatted.proto - // - outputRef, err := refParser.GetSourceOrModuleRef(ctx, flags.Output) - if err != nil { - return err - } - if _, ok := outputRef.(buffetch.ProtoFileRef); ok { - if directory := filepath.Dir(flags.Output); directory != "." { - // The output is a single file, so we need to create - // the file's directory (if any). - // - // For example, - // - // $ buf format simple.proto -o formatted/simple.formatted.proto - // - outputDirectory = directory - } - // The outputDirectory will not be set for single file outputs - // in the current directory (e.g. simple.formatted.proto). - singleFileOutputFilename = flags.Output - } else { - // The output is a directory, so we can just create it as-is. - outputDirectory = flags.Output - } - } - if protoFileRef, ok := sourceOrModuleRef.(buffetch.ProtoFileRef); ok { - // If we have a single ProtoFileRef, we only want to format that file. - // The file will be available from the first module (i.e. it's - // the target source, or the first module in a workspace). - if len(moduleConfigs) == 0 { - // Unreachable - we should always have at least one module. - return fmt.Errorf("could not build module for %s", container.Arg(0)) - } - if protoFileRef.IncludePackageFiles() { - // TODO: We need to have a better answer here. Right now, it's - // possible that the other files in the same package are defined - // in a remote dependency, which makes it impossible to rewrite - // in-place. - // - // In the case that the user uses the -w flag, we'll either need - // to return an error, or omit the file that it can't rewrite in-place - // (potentially including a debug log). - return errors.New("this command does not support including package files") - } - module := moduleConfigs[0].Module() - fileInfos, err := module.TargetFileInfos(ctx) - if err != nil { - return err - } - var moduleFile bufmodule.ModuleFile - for _, fileInfo := range fileInfos { - if _, err := protoFileRef.PathForExternalPath(fileInfo.ExternalPath()); err != nil { - // The target file we're looking for is the only one that will not - // return an error. - continue - } - moduleFile, err = module.GetModuleFile( - ctx, - fileInfo.Path(), - ) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, moduleFile.Close()) - }() - break - } - if moduleFile == nil { - // This will only happen if a buf.work.yaml exists in a parent - // directory, but it does not contain the target file. - // - // This is also a problem for other commands that interact - // with buffetch.ProtoFileRef. - // - // TODO: Fix the buffetch.ProtoFileRef so that it works in - // these situtations. - return fmt.Errorf( - "source %s was not found - is the directory containing this file defined in your %s?", - container.Arg(0), - bufwork.ExternalConfigV1FilePath, - ) - } - module, err = bufmodule.ModuleWithTargetPaths( - module, - []string{ - moduleFile.Path(), - }, - nil, // Nothing to exclude. - ) - if err != nil { - return err - } - diffPresent, err := formatModule( - ctx, - container, - runner, - storageosProvider, - module, - outputDirectory, - singleFileOutputFilename, - flags.ErrorFormat, - flags.Diff, - flags.Write, - ) - if err != nil { - return err - } - if flags.ExitCode && diffPresent { - return bufcli.ErrFileAnnotation - } - return nil - } - for _, moduleConfig := range moduleConfigs { - diffPresent, err := formatModule( - ctx, - container, - runner, - storageosProvider, - moduleConfig.Module(), - outputDirectory, - singleFileOutputFilename, - flags.ErrorFormat, - flags.Diff, - flags.Write, - ) - if err != nil { - return err - } - if flags.ExitCode && diffPresent { - return bufcli.ErrFileAnnotation - } - } - return nil -} - -// formatModule formats the module's target files and writes them to the -// writeBucket, if any. If diff is true, the diff between the original and -// formatted files is written to stdout. -// -// Returns true if there was a diff and no other error. -func formatModule( - ctx context.Context, - container appflag.Container, - runner command.Runner, - storageosProvider storageos.Provider, - module bufmodule.Module, - outputDirectory string, - singleFileOutputFilename string, - errorFormat string, - diff bool, - rewrite bool, -) (_ bool, retErr error) { - originalReadWriteBucket := storagemem.NewReadWriteBucket() - if err := bufmodule.TargetModuleFilesToBucket( - ctx, - module, - originalReadWriteBucket, - ); err != nil { - return false, err - } - // Note that external paths are set properly for the files in this read bucket. - formattedReadBucket, err := bufformat.Format(ctx, module) - if err != nil { - return false, err - } - diffBuffer := bytes.NewBuffer(nil) - if err := storage.Diff( - ctx, - runner, - diffBuffer, - originalReadWriteBucket, - formattedReadBucket, - storage.DiffWithExternalPaths(), // No need to set prefixes as the buckets are from the same location. - ); err != nil { - return false, err - } - diffPresent := diffBuffer.Len() > 0 - if diff { - if _, err := io.Copy(container.Stdout(), diffBuffer); err != nil { - return false, err - } - if outputDirectory == "" && singleFileOutputFilename == "" && !rewrite { - // If the user specified --diff and has not explicitly overridden - // the --output or rewritten the sources in-place with --write, we - // can stop here. - return diffPresent, nil - } - } - if rewrite { - // Rewrite the sources in place. - if err := storage.WalkReadObjects( - ctx, - originalReadWriteBucket, - "", - func(readObject storage.ReadObject) error { - formattedReadObject, err := formattedReadBucket.Get(ctx, readObject.Path()) - if err != nil { - return err - } - // We use os.OpenFile here instead of storage.Copy for a few reasons. - // - // storage.Copy operates on normal paths, so the copied content is always placed - // relative to the bucket's root (as expected). The rewrite in-place behavior can - // be rephrased as writing to the same bucket as the input (e.g. buf format proto -o proto). - // - // Now, if the user asks to rewrite an entire workspace (i.e. a directory containing - // a buf.work.yaml), we would need to call storage.Copy for each of the directories - // defined in the workspace. This involves parsing the buf.work.yaml and creating - // a storage.Bucket for each of the directories. - // - // It's simpler to just copy the files in-place based on their external path since - // it's the same behavior for single files, directories, and workspaces. - file, err := os.OpenFile(readObject.ExternalPath(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, file.Close()) - }() - if _, err := file.ReadFrom(formattedReadObject); err != nil { - return err - } - return nil - }, - ); err != nil { - return false, err - } - return diffPresent, nil - } - var readWriteBucket storage.ReadWriteBucket - if outputDirectory != "" { - // OK to use os.Stat instead of os.LStat here as this is CLI-only - if _, err := os.Stat(outputDirectory); err != nil { - // We don't need to check fileInfo.IsDir() because it's - // already handled by the storageosProvider. - if os.IsNotExist(err) { - if err := os.MkdirAll(outputDirectory, 0755); err != nil { - return false, err - } - // Although unlikely, if an error occurs in the midst of - // writing the formatted files, we want to clean up the - // directory we just created because it didn't previously - // exist. - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, os.RemoveAll(outputDirectory)) - } - }() - } - } - readWriteBucket, err = storageosProvider.NewReadWriteBucket( - outputDirectory, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return false, err - } - } - if readWriteBucket == nil || singleFileOutputFilename != "" { - // If the readWriteBucket is nil, we write the output to stdout. - // - // If a single file output was used, we can't just copy the content - // between buckets - we need to write all of the bucket's content - // into the single file (exactly like we do for writing to stdout). - // - // We might want to order these, although the output is kind of useless - // if we're writing more than one file. - writer := container.Stdout() - if singleFileOutputFilename != "" { - file, err := os.OpenFile(singleFileOutputFilename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644) - if err != nil { - return false, err - } - defer func() { - retErr = multierr.Append(retErr, file.Close()) - }() - writer = file - } - if err := storage.WalkReadObjects( - ctx, - formattedReadBucket, - "", - func(readObject storage.ReadObject) error { - data, err := io.ReadAll(readObject) - if err != nil { - return err - } - if _, err := writer.Write(data); err != nil { - return err - } - return nil - }, - ); err != nil { - return false, err - } - return diffPresent, nil - } - // The user specified -o, so we copy the files into the output bucket. - if _, err := storage.Copy( - ctx, - formattedReadBucket, - readWriteBucket, - ); err != nil { - return false, err - } - return diffPresent, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/usage.gen.go deleted file mode 100644 index 48a6db7df1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/format/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package format - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/generate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/generate.go deleted file mode 100644 index 47a7549385..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/generate.go +++ /dev/null @@ -1,423 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package generate - -import ( - "context" - "fmt" - "path/filepath" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/buf/bufgen" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - templateFlagName = "template" - baseOutDirPathFlagName = "output" - baseOutDirPathFlagShortName = "o" - errorFormatFlagName = "error-format" - configFlagName = "config" - pathsFlagName = "path" - includeImportsFlagName = "include-imports" - includeWKTFlagName = "include-wkt" - excludePathsFlagName = "exclude-path" - disableSymlinksFlagName = "disable-symlinks" - typeFlagName = "type" - typeDeprecatedFlagName = "include-types" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Generate code with protoc plugins", - Long: `This command uses a template file of the shape: - - # buf.gen.yaml - # The version of the generation template. - # Required. - # The valid values are v1beta1, v1. - version: v1 - # The plugins to run. "plugin" is required. - plugins: - # The name of the plugin. - # By default, buf generate will look for a binary named protoc-gen-NAME on your $PATH. - # Alternatively, use a remote plugin: - # plugin: buf.build/protocolbuffers/go:v1.28.1 - - plugin: go - # The the relative output directory. - # Required. - out: gen/go - # Any options to provide to the plugin. - # This can be either a single string or a list of strings. - # Optional. - opt: paths=source_relative - # The custom path to the plugin binary, if not protoc-gen-NAME on your $PATH. - # Optional, and exclusive with "remote". - path: custom-gen-go - # The generation strategy to use. There are two options: - # - # 1. "directory" - # - # This will result in buf splitting the input files by directory, and making separate plugin - # invocations in parallel. This is roughly the concurrent equivalent of: - # - # for dir in $(find . -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq); do - # protoc -I . $(find "${dir}" -name '*.proto') - # done - # - # Almost every Protobuf plugin either requires this, or works with this, - # and this is the recommended and default value. - # - # 2. "all" - # - # This will result in buf making a single plugin invocation with all input files. - # This is roughly the equivalent of: - # - # protoc -I . $(find . -name '*.proto') - # - # This is needed for certain plugins that expect all files to be given at once. - # - # If omitted, "directory" is used. Most users should not need to set this option. - # Optional. - strategy: directory - - plugin: java - out: gen/java - # Use the plugin hosted at buf.build/protocolbuffers/python at version v21.9. - # If version is omitted, uses the latest version of the plugin. - - plugin: buf.build/protocolbuffers/python:v21.9 - out: gen/python - -As an example, here's a typical "buf.gen.yaml" go and grpc, assuming -"protoc-gen-go" and "protoc-gen-go-grpc" are on your "$PATH": - - # buf.gen.yaml - version: v1 - plugins: - - plugin: go - out: gen/go - opt: paths=source_relative - - plugin: go-grpc - out: gen/go - opt: paths=source_relative,require_unimplemented_servers=false - -By default, buf generate will look for a file of this shape named -"buf.gen.yaml" in your current directory. This can be thought of as a template -for the set of plugins you want to invoke. - -The first argument is the source, module, or image to generate from. -Defaults to "." if no argument is specified. - -Use buf.gen.yaml as template, current directory as input: - - $ buf generate - -Same as the defaults (template of "buf.gen.yaml", current directory as input): - - $ buf generate --template buf.gen.yaml . - -The --template flag also takes YAML or JSON data as input, so it can be used without a file: - - $ buf generate --template '{"version":"v1","plugins":[{"plugin":"go","out":"gen/go"}]}' - -Download the repository and generate code stubs per the bar.yaml template: - - $ buf generate --template bar.yaml https://github.com/foo/bar.git - -Generate to the bar/ directory, prepending bar/ to the out directives in the template: - - $ buf generate --template bar.yaml -o bar https://github.com/foo/bar.git - -The paths in the template and the -o flag will be interpreted as relative to the -current directory, so you can place your template files anywhere. - -If you only want to generate stubs for a subset of your input, you can do so via the --path. e.g. - -Only generate for the files in the directories proto/foo and proto/bar: - - $ buf generate --path proto/foo --path proto/bar - -Only generate for the files proto/foo/foo.proto and proto/foo/bar.proto: - - $ buf generate --path proto/foo/foo.proto --path proto/foo/bar.proto - -Only generate for the files in the directory proto/foo on your git repository: - - $ buf generate --template buf.gen.yaml https://github.com/foo/bar.git --path proto/foo - -Note that all paths must be contained within the same module. For example, if you have a -module in "proto", you cannot specify "--path proto", however "--path proto/foo" is allowed -as "proto/foo" is contained within "proto". - -Plugins are invoked in the order they are specified in the template, but each plugin -has a per-directory parallel invocation, with results from each invocation combined -before writing the result. - -Insertion points are processed in the order the plugins are specified in the template. -`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Template string - BaseOutDirPath string - ErrorFormat string - Files []string - Config string - Paths []string - IncludeImports bool - IncludeWKT bool - ExcludePaths []string - DisableSymlinks bool - // We may be able to bind two flags to one string slice but I don't - // want to find out what will break if we do. - Types []string - TypesDeprecated []string - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindPaths(flagSet, &f.Paths, pathsFlagName) - bufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName) - flagSet.BoolVar( - &f.IncludeImports, - includeImportsFlagName, - false, - "Also generate all imports except for Well-Known Types", - ) - flagSet.BoolVar( - &f.IncludeWKT, - includeWKTFlagName, - false, - fmt.Sprintf( - "Also generate Well-Known Types. Cannot be set without --%s", - includeImportsFlagName, - ), - ) - flagSet.StringVar( - &f.Template, - templateFlagName, - "", - `The generation template file or data to use. Must be in either YAML or JSON format`, - ) - flagSet.StringVarP( - &f.BaseOutDirPath, - baseOutDirPathFlagName, - baseOutDirPathFlagShortName, - ".", - `The base directory to generate to. This is prepended to the out directories in the generation template`, - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors, printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml file or data to use for configuration`, - ) - flagSet.StringSliceVar( - &f.Types, - typeFlagName, - nil, - "The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types. Flag usage overrides buf.gen.yaml", - ) - flagSet.StringSliceVar( - &f.TypesDeprecated, - typeDeprecatedFlagName, - nil, - "The types (package, message, enum, extension, service, method) that should be included in this image. When specified, the resulting image will only include descriptors to describe the requested types. Flag usage overrides buf.gen.yaml", - ) - _ = flagSet.MarkDeprecated(typeDeprecatedFlagName, fmt.Sprintf("Use --%s instead", typeFlagName)) - _ = flagSet.MarkHidden(typeDeprecatedFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - logger := container.Logger() - if flags.IncludeWKT && !flags.IncludeImports { - // You need to set --include-imports if you set --include-wkt, which isn’t great. The alternative is to have - // --include-wkt implicitly set --include-imports, but this could be surprising. Or we could rename - // --include-wkt to --include-imports-and/with-wkt. But the summary is that the flag only makes sense - // in the context of including imports. - return appcmd.NewInvalidArgumentErrorf("Cannot set --%s without --%s", includeWKTFlagName, includeImportsFlagName) - } - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - ".", - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - genConfig, err := bufgen.ReadConfig( - ctx, - logger, - bufgen.NewProvider(logger), - readWriteBucket, - bufgen.ReadConfigWithOverride(flags.Template), - ) - if err != nil { - return err - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - imageConfigReader, err := bufcli.NewWireImageConfigReader( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - flags.Config, - flags.Paths, // we filter on files - flags.ExcludePaths, // we exclude these paths - false, // input files must exist - false, // we must include source info for generation - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - if err := bufanalysis.PrintFileAnnotations(container.Stderr(), fileAnnotations, flags.ErrorFormat); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - images := make([]bufimage.Image, 0, len(imageConfigs)) - for _, imageConfig := range imageConfigs { - images = append(images, imageConfig.Image()) - } - image, err := bufimage.MergeImages(images...) - if err != nil { - return err - } - generateOptions := []bufgen.GenerateOption{ - bufgen.GenerateWithBaseOutDirPath(flags.BaseOutDirPath), - } - if flags.IncludeImports { - generateOptions = append( - generateOptions, - bufgen.GenerateWithIncludeImports(), - ) - } - if flags.IncludeWKT { - generateOptions = append( - generateOptions, - bufgen.GenerateWithIncludeWellKnownTypes(), - ) - } - wasmEnabled, err := bufcli.IsAlphaWASMEnabled(container) - if err != nil { - return err - } - if wasmEnabled { - generateOptions = append( - generateOptions, - bufgen.GenerateWithWASMEnabled(), - ) - } - var includedTypes []string - if len(flags.Types) > 0 || len(flags.TypesDeprecated) > 0 { - // command-line flags take precedence - includedTypes = append(flags.Types, flags.TypesDeprecated...) - } else if genConfig.TypesConfig != nil { - includedTypes = genConfig.TypesConfig.Include - } - if len(includedTypes) > 0 { - image, err = bufimageutil.ImageFilteredByTypes(image, includedTypes...) - if err != nil { - return err - } - } - wasmPluginExecutor, err := bufwasm.NewPluginExecutor( - filepath.Join(container.CacheDirPath(), bufcli.WASMCompilationCacheDir)) - if err != nil { - return err - } - return bufgen.NewGenerator( - logger, - storageosProvider, - runner, - wasmPluginExecutor, - clientConfig, - ).Generate( - ctx, - container, - genConfig, - image, - generateOptions..., - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/usage.gen.go deleted file mode 100644 index 6872e970ff..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/generate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package generate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/lint.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/lint.go deleted file mode 100644 index 1bdc9b91df..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/lint.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lint - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - errorFormatFlagName = "error-format" - configFlagName = "config" - pathsFlagName = "path" - excludePathsFlagName = "exclude-path" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Run linting on Protobuf files", - Long: bufcli.GetInputLong(`the source, module, or Image to lint`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - ErrorFormat string - Config string - Paths []string - ExcludePaths []string - DisableSymlinks bool - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindPaths(flagSet, &f.Paths, pathsFlagName) - bufcli.BindExcludePaths(flagSet, &f.ExcludePaths, excludePathsFlagName) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors or check violations printed to stdout. Must be one of %s", - stringutil.SliceToString(buflint.AllFormatStrings), - ), - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml file or data to use for configuration`, - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - if err := bufcli.ValidateErrorFormatFlagLint(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - imageConfigReader, err := bufcli.NewWireImageConfigReader( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return err - } - imageConfigs, fileAnnotations, err := imageConfigReader.GetImageConfigs( - ctx, - container, - ref, - flags.Config, - flags.Paths, // we filter checks for files - flags.ExcludePaths, // we exclude these paths - false, // input files must exist - false, // we must include source info for linting - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - formatString := flags.ErrorFormat - if formatString == "config-ignore-yaml" { - formatString = "text" - } - if err := bufanalysis.PrintFileAnnotations(container.Stdout(), fileAnnotations, formatString); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - var allFileAnnotations []bufanalysis.FileAnnotation - for _, imageConfig := range imageConfigs { - fileAnnotations, err := buflint.NewHandler(container.Logger()).Check( - ctx, - imageConfig.Config().Lint, - bufimage.ImageWithoutImports(imageConfig.Image()), - ) - if err != nil { - return err - } - allFileAnnotations = append(allFileAnnotations, fileAnnotations...) - } - if len(allFileAnnotations) > 0 { - if err := buflintconfig.PrintFileAnnotations( - container.Stdout(), - bufanalysis.DeduplicateAndSortFileAnnotations(allFileAnnotations), - flags.ErrorFormat, - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/usage.gen.go deleted file mode 100644 index 4186192b26..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lint/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package lint - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/lsfiles.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/lsfiles.go deleted file mode 100644 index 105191e15c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/lsfiles.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package lsfiles - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/buf/buffetch" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - asImportPathsFlagName = "as-import-paths" - configFlagName = "config" - errorFormatFlagName = "error-format" - includeImportsFlagName = "include-imports" - disableSymlinksFlagName = "disable-symlinks" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "List Protobuf files", - Long: bufcli.GetInputLong(`the source, module, or image to list from`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - AsImportPaths bool - Config string - ErrorFormat string - IncludeImports bool - DisableSymlinks bool - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - flagSet.BoolVar( - &f.AsImportPaths, - asImportPathsFlagName, - false, - "Strip local directory paths and print filepaths as they are imported", - ) - flagSet.StringVar( - &f.Config, - configFlagName, - "", - `The buf.yaml configuration file or data to use`, - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.BoolVar( - &f.IncludeImports, - includeImportsFlagName, - false, - "Include imports", - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - input, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - ref, err := buffetch.NewRefParser(container.Logger()).GetRef(ctx, input) - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - fileLister, err := bufcli.NewWireFileLister( - container, - storageosProvider, - runner, - clientConfig, - ) - if err != nil { - return err - } - fileRefs, fileAnnotations, err := fileLister.ListFiles( - ctx, - container, - ref, - flags.Config, - flags.IncludeImports, - ) - if err != nil { - return err - } - if len(fileAnnotations) > 0 { - // stderr since we do output to stdout potentially - if err := bufanalysis.PrintFileAnnotations( - container.Stderr(), - fileAnnotations, - flags.ErrorFormat, - ); err != nil { - return err - } - return bufcli.ErrFileAnnotation - } - if flags.AsImportPaths { - bufmoduleref.SortFileInfos(fileRefs) - for _, fileRef := range fileRefs { - if _, err := fmt.Fprintln(container.Stdout(), fileRef.Path()); err != nil { - return err - } - } - } else { - bufmoduleref.SortFileInfosByExternalPath(fileRefs) - for _, fileRef := range fileRefs { - if _, err := fmt.Fprintln(container.Stdout(), fileRef.ExternalPath()); err != nil { - return err - } - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/usage.gen.go deleted file mode 100644 index b78972c843..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/lsfiles/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package lsfiles - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/internal.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/internal.go deleted file mode 100644 index cce673b228..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/internal.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufcheck" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/spf13/pflag" -) - -// BindLSRulesAll binds the all flag for an ls rules command. -func BindLSRulesAll(flagSet *pflag.FlagSet, addr *bool, flagName string) { - flagSet.BoolVar( - addr, - flagName, - false, - "List all rules and not just those currently configured", - ) -} - -// BindLSRulesConfig binds the config flag for an ls rules command. -func BindLSRulesConfig(flagSet *pflag.FlagSet, addr *string, flagName string, allFlagName string, versionFlagName string) { - flagSet.StringVar( - addr, - flagName, - "", - fmt.Sprintf( - `The buf.yaml file or data to use for configuration. Ignored if --%s or --%s is specified`, - allFlagName, - versionFlagName, - ), - ) -} - -// BindLSRulesFormat binds the format flag for an ls rules command. -func BindLSRulesFormat(flagSet *pflag.FlagSet, addr *string, flagName string) { - flagSet.StringVar( - addr, - flagName, - "text", - fmt.Sprintf( - "The format to print rules as. Must be one of %s", - stringutil.SliceToString(bufcheck.AllRuleFormatStrings), - ), - ) -} - -// BindLSRulesVersion binds the version flag for an ls rules command. -func BindLSRulesVersion(flagSet *pflag.FlagSet, addr *string, flagName string, allFlagName string) { - flagSet.StringVar( - addr, - flagName, - "", // do not set a default as we need to know if this is unset - fmt.Sprintf( - "List all the rules for the given configuration version. Implies --%s. Must be one of %s", - allFlagName, - stringutil.SliceToString(bufconfig.AllVersions), - ), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/usage.gen.go deleted file mode 100644 index b94f5ee09d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package internal - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/modclearcache.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/modclearcache.go deleted file mode 100644 index cd5a522b44..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/modclearcache.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modclearcache - -import ( - "context" - "fmt" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, - aliases ...string, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Aliases: aliases, - Short: "Clear Buf module cache", - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - ), - BindFlags: flags.Bind, - } -} - -type flags struct{} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) {} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - for _, cacheModuleRelDirPath := range bufcli.AllCacheModuleRelDirPaths { - dirPath := filepath.Join(container.CacheDirPath(), normalpath.Unnormalize(cacheModuleRelDirPath)) - fileInfo, err := os.Stat(dirPath) - if err != nil { - if os.IsNotExist(err) { - continue - } - return err - } - if !fileInfo.IsDir() { - return fmt.Errorf("expected %q to be a directory", dirPath) - } - if err := os.RemoveAll(dirPath); err != nil { - return fmt.Errorf("could not remove %q: %w", dirPath, err) - } - if _, err := container.Stderr().Write([]byte("deleted " + dirPath + "\n")); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/usage.gen.go deleted file mode 100644 index 3aabaf3eca..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modclearcache/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modclearcache - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/modinit.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/modinit.go deleted file mode 100644 index d98255bdf4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/modinit.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modinit - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - documentationCommentsFlagName = "doc" - outDirPathFlagName = "output" - outDirPathFlagShortName = "o" - uncommentFlagName = "uncomment" -) - -// NewCommand returns a new init Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " [buf.build/owner/foobar]", - Short: fmt.Sprintf("Initializes and writes a new %s configuration file.", bufconfig.ExternalConfigV1FilePath), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - DocumentationComments bool - OutDirPath string - - // Hidden. - // Just used for generating docs.buf.build. - Uncomment bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.BoolVar( - &f.DocumentationComments, - documentationCommentsFlagName, - false, - "Write inline documentation in the form of comments in the resulting configuration file", - ) - flagSet.StringVarP( - &f.OutDirPath, - outDirPathFlagName, - outDirPathFlagShortName, - ".", - `The directory to write the configuration file to`, - ) - flagSet.BoolVar( - &f.Uncomment, - uncommentFlagName, - false, - "Uncomment examples in the resulting configuration file", - ) - _ = flagSet.MarkHidden(uncommentFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if flags.OutDirPath == "" { - return appcmd.NewInvalidArgumentErrorf("required flag %q not set", outDirPathFlagName) - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - flags.OutDirPath, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket) - if err != nil { - return err - } - if existingConfigFilePath != "" { - return fmt.Errorf("%s already exists, not overwriting", existingConfigFilePath) - } - var writeConfigOptions []bufconfig.WriteConfigOption - if container.NumArgs() > 0 { - moduleIdentity, err := bufmoduleref.ModuleIdentityForString(container.Arg(0)) - if err != nil { - return err - } - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithModuleIdentity(moduleIdentity), - ) - } - if flags.DocumentationComments { - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithDocumentationComments(), - ) - } - if flags.Uncomment { - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithUncomment(), - ) - } - // Need to include the default version (v1), lint config, and breaking config. - version := bufconfig.V1Version - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithVersion(version), - ) - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithBreakingConfig( - &bufbreakingconfig.Config{ - Version: version, - Use: []string{"FILE"}, - }, - ), - ) - writeConfigOptions = append( - writeConfigOptions, - bufconfig.WriteConfigWithLintConfig( - &buflintconfig.Config{ - Version: version, - Use: []string{"DEFAULT"}, - }, - ), - ) - return bufconfig.WriteConfig( - ctx, - readWriteBucket, - writeConfigOptions..., - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/usage.gen.go deleted file mode 100644 index 25ce054420..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modinit/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modinit - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go deleted file mode 100644 index b6a4cb0d22..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/modlsbreakingrules.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modlsbreakingrules - -import ( - "context" - "fmt" - - modinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal" - "github.com/bufbuild/buf/private/bufpkg/bufcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - allFlagName = "all" - configFlagName = "config" - formatFlagName = "format" - versionFlagName = "version" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "List breaking rules", - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - All bool - Config string - Format string - Version string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - modinternal.BindLSRulesAll(flagSet, &f.All, allFlagName) - modinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName) - modinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName) - modinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if flags.All { - // We explicitly document that if all is set, config is ignored. - // If a user wants to override the version while using all, they should use version. - flags.Config = "" - } - if flags.Version != "" { - // If version is set, all is implied, and we use the config override to specify the - // version that bufconfig.ReadConfig will return. - flags.All = true - // This also results in config being ignored per the documentation. - flags.Config = fmt.Sprintf(`{"version":"%s"}`, flags.Version) - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - ".", - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - config, err := bufconfig.ReadConfigOS( - ctx, - readWriteBucket, - bufconfig.ReadConfigOSWithOverride(flags.Config), - ) - if err != nil { - return err - } - var rules []bufcheck.Rule - if flags.All { - switch config.Version { - case bufconfig.V1Beta1Version: - rules, err = bufbreaking.GetAllRulesV1Beta1() - if err != nil { - return err - } - case bufconfig.V1Version: - rules, err = bufbreaking.GetAllRulesV1() - if err != nil { - return err - } - } - } else { - rules, err = bufbreaking.RulesForConfig(config.Breaking) - if err != nil { - return err - } - } - return bufcheck.PrintRules( - container.Stdout(), - rules, - flags.Format, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go deleted file mode 100644 index 7257171401..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlsbreakingrules/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modlsbreakingrules - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go deleted file mode 100644 index 6c76501bda..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/modlslintrules.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modlslintrules - -import ( - "context" - "fmt" - - modinternal "github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/internal" - "github.com/bufbuild/buf/private/bufpkg/bufcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - allFlagName = "all" - configFlagName = "config" - formatFlagName = "format" - versionFlagName = "version" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name, - Short: "List lint rules", - Args: cobra.NoArgs, - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - All bool - Config string - Format string - Version string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - modinternal.BindLSRulesAll(flagSet, &f.All, allFlagName) - modinternal.BindLSRulesConfig(flagSet, &f.Config, configFlagName, allFlagName, versionFlagName) - modinternal.BindLSRulesFormat(flagSet, &f.Format, formatFlagName) - modinternal.BindLSRulesVersion(flagSet, &f.Version, versionFlagName, allFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - if flags.All { - // We explicitly document that if all is set, config is ignored. - // If a user wants to override the version while using all, they should use version. - flags.Config = "" - } - if flags.Version != "" { - // If version is set, all is implied, and we use the config override to specify the - // version that bufconfig.ReadConfig will return. - flags.All = true - // This also results in config being ignored per the documentation. - flags.Config = fmt.Sprintf(`{"version":"%s"}`, flags.Version) - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - ".", - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - config, err := bufconfig.ReadConfigOS( - ctx, - readWriteBucket, - bufconfig.ReadConfigOSWithOverride(flags.Config), - ) - if err != nil { - return err - } - var rules []bufcheck.Rule - if flags.All { - switch config.Version { - case bufconfig.V1Beta1Version: - rules, err = buflint.GetAllRulesV1Beta1() - if err != nil { - return err - } - case bufconfig.V1Version: - rules, err = buflint.GetAllRulesV1() - if err != nil { - return err - } - } - } else { - rules, err = buflint.RulesForConfig(config.Lint) - if err != nil { - return err - } - } - return bufcheck.PrintRules( - container.Stdout(), - rules, - flags.Format, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go deleted file mode 100644 index 3102cc7a52..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modlslintrules/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modlslintrules - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/modopen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/modopen.go deleted file mode 100644 index ecb618ce99..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/modopen.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modopen - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/pkg/browser" - "github.com/spf13/cobra" -) - -// NewCommand returns a new open Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - return &appcmd.Command{ - Use: name + " ", - Short: "Open the module's homepage in a web browser", - Long: `The first argument is the directory of the local module to open. Defaults to "." if no argument is specified.`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container) - }, - bufcli.NewErrorInterceptor(), - ), - } -} - -// run tidy to trim the buf.lock file for a specific module. -func run( - ctx context.Context, - container appflag.Container, -) error { - directoryInput, err := bufcli.GetInputValue(container, "", ".") - if err != nil { - return err - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - directoryInput, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket) - if err != nil { - return err - } - if existingConfigFilePath == "" { - return bufcli.ErrNoConfigFile - } - config, err := bufconfig.GetConfigForBucket(ctx, readWriteBucket) - if err != nil { - return err - } - var moduleIdentityString string - if config.ModuleIdentity != nil { - moduleIdentityString = config.ModuleIdentity.IdentityString() - } - if moduleIdentityString == "" { - return fmt.Errorf("%s has no module name", existingConfigFilePath) - } - return browser.OpenURL("https://" + moduleIdentityString) -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/usage.gen.go deleted file mode 100644 index 6571f3d695..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modopen/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modopen - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/modprune.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/modprune.go deleted file mode 100644 index a0c72de17d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/modprune.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modprune - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/bufpkg/buflock" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" -) - -// NewCommand returns a new prune Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - return &appcmd.Command{ - Use: name + " ", - Short: fmt.Sprintf("Prune unused dependencies from the %s file", buflock.ExternalConfigFilePath), - Long: `The first argument is the directory of the local module to prune. Defaults to "." if no argument is specified.`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container) - }, - bufcli.NewErrorInterceptor(), - ), - } -} - -// run tidy to trim the buf.lock file for a specific module. -func run( - ctx context.Context, - container appflag.Container, -) error { - directoryInput, err := bufcli.GetInputValue(container, "", ".") - if err != nil { - return err - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - directoryInput, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket) - if err != nil { - return err - } - if existingConfigFilePath == "" { - return bufcli.ErrNoConfigFile - } - config, err := bufconfig.GetConfigForBucket(ctx, readWriteBucket) - if err != nil { - return err - } - - module, err := bufmodule.NewModuleForBucket(ctx, readWriteBucket) - if err != nil { - return fmt.Errorf("couldn't read current dependencies: %w", err) - } - - requestReferences, err := referencesPinnedByLock(config.Build.DependencyModuleReferences, module.DependencyModulePins()) - if err != nil { - return err - } - var dependencyModulePins []bufmoduleref.ModulePin - if len(requestReferences) > 0 { - var remote string - if config.ModuleIdentity != nil && config.ModuleIdentity.Remote() != "" { - remote = config.ModuleIdentity.Remote() - } else { - // At this point we know there's at least one dependency. If it's an unnamed module, select - // the right remote from the list of dependencies. - selectedRef := bufcli.SelectReferenceForRemote(config.Build.DependencyModuleReferences) - if selectedRef == nil { - return fmt.Errorf(`File %q has invalid "deps" references`, existingConfigFilePath) - } - remote = selectedRef.Remote() - container.Logger().Debug(fmt.Sprintf( - `File %q does not specify the "name" field. Based on the dependency %q, it appears that you are using a BSR instance at %q. Did you mean to specify "name: %s/..." within %q?`, - existingConfigFilePath, - selectedRef.IdentityString(), - remote, - remote, - existingConfigFilePath, - )) - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return err - } - service := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewResolveServiceClient) - resp, err := service.GetModulePins( - ctx, - connect.NewRequest(®istryv1alpha1.GetModulePinsRequest{ - ModuleReferences: bufmoduleref.NewProtoModuleReferencesForModuleReferences(requestReferences...), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeUnimplemented && remote != bufconnect.DefaultRemote { - return bufcli.NewUnimplementedRemoteError(err, remote, config.ModuleIdentity.IdentityString()) - } - return err - } - dependencyModulePins, err = bufmoduleref.NewModulePinsForProtos(resp.Msg.ModulePins...) - if err != nil { - return bufcli.NewInternalError(err) - } - } - if err := bufmoduleref.PutDependencyModulePinsToBucket(ctx, readWriteBucket, dependencyModulePins); err != nil { - return err - } - return nil -} - -// referencesPinnedByLock takes moduleReferences and a list of pins, then -// returns a new list of moduleReferences with the same identity, but their -// reference set to the commit of the pin with the corresponding identity. -func referencesPinnedByLock(moduleReferences []bufmoduleref.ModuleReference, modulePins []bufmoduleref.ModulePin) ([]bufmoduleref.ModuleReference, error) { - pinsByIdentity := make(map[string]bufmoduleref.ModulePin, len(modulePins)) - for _, modulePin := range modulePins { - pinsByIdentity[modulePin.IdentityString()] = modulePin - } - - var pinnedModuleReferences []bufmoduleref.ModuleReference - for _, moduleReference := range moduleReferences { - pin, ok := pinsByIdentity[moduleReference.IdentityString()] - if !ok { - return nil, fmt.Errorf(`can't tidy with dependency %q: no corresponding entry found in buf.lock. Use "mod update" first if this is a new dependency`, moduleReference.IdentityString()) - } - newModuleReference, err := bufmoduleref.NewModuleReference( - moduleReference.Remote(), - moduleReference.Owner(), - moduleReference.Repository(), - pin.Commit(), - ) - if err != nil { - return nil, err - } - pinnedModuleReferences = append(pinnedModuleReferences, newModuleReference) - } - return pinnedModuleReferences, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/usage.gen.go deleted file mode 100644 index 318a32b337..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modprune/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modprune - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/modupdate.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/modupdate.go deleted file mode 100644 index e51fe57d84..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/modupdate.go +++ /dev/null @@ -1,321 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package modupdate - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/bufpkg/buflock" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - onlyFlagName = "only" -) - -// NewCommand returns a new update Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Update a module's dependencies by updating the " + buflock.ExternalConfigFilePath + " file", - Long: "Fetch the latest digests for the specified references in the config file, " + - "and write them and their transitive dependencies to the " + - buflock.ExternalConfigFilePath + - ` file. The first argument is the directory of the local module to update. Defaults to "." if no argument is specified.`, - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Only []string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringSliceVar( - &f.Only, - onlyFlagName, - nil, - "The name of the dependency to update. When set, only this dependency is updated (along with any of its sub-dependencies). May be passed multiple times", - ) -} - -// run update the buf.lock file for a specific module. -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - directoryInput, err := bufcli.GetInputValue(container, "", ".") - if err != nil { - return err - } - storageosProvider := storageos.NewProvider(storageos.ProviderWithSymlinks()) - readWriteBucket, err := storageosProvider.NewReadWriteBucket( - directoryInput, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return bufcli.NewInternalError(err) - } - existingConfigFilePath, err := bufconfig.ExistingConfigFilePath(ctx, readWriteBucket) - if err != nil { - return bufcli.NewInternalError(err) - } - if existingConfigFilePath == "" { - return bufcli.ErrNoConfigFile - } - moduleConfig, err := bufconfig.GetConfigForBucket(ctx, readWriteBucket) - if err != nil { - return err - } - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return bufcli.NewInternalError(err) - } - pinnedRepositories, err := getDependencies( - ctx, - clientConfig, - container, - flags, - moduleConfig, - readWriteBucket, - existingConfigFilePath, - ) - if err != nil { - return err - } - - dependencyModulePins := make([]bufmoduleref.ModulePin, len(pinnedRepositories)) - for i := range pinnedRepositories { - dependencyModulePins[i] = pinnedRepositories[i].modulePin - modulePin := pinnedRepositories[i].modulePin - repository := pinnedRepositories[i].repository - if !repository.Deprecated { - continue - } - warnMsg := fmt.Sprintf( - `Repository "%s/%s/%s" is deprecated`, - modulePin.Remote(), - modulePin.Owner(), - modulePin.Repository(), - ) - if repository.DeprecationMessage != "" { - warnMsg = fmt.Sprintf("%s: %s", warnMsg, repository.DeprecationMessage) - } - container.Logger().Warn(warnMsg) - } - // Before updating buf.lock file, verify that existing dependency digests didn't change for the same commit. - if err := bufmoduleref.ValidateModulePinsConsistentDigests(ctx, readWriteBucket, dependencyModulePins); err != nil { - if bufmoduleref.IsDigestChanged(err) { - return err - } - return bufcli.NewInternalError(err) - } - // Before updating buf.lock file, verify that no file path exists in more than one module. - pathToModuleIdentityStrings := make(map[string][]string) - currentModule, err := bufmodule.NewModuleForBucket(ctx, readWriteBucket) - if err != nil { - return bufcli.NewInternalError(err) - } - currentModuleIdentityString := "the current module" - if currentModuleIdentity := currentModule.ModuleIdentity(); currentModuleIdentity != nil { - currentModuleIdentityString = currentModuleIdentity.IdentityString() - } - currentModuleSourceFileInfos, err := currentModule.SourceFileInfos(ctx) - if err != nil { - return bufcli.NewInternalError(err) - } - for _, sourceFileInfo := range currentModuleSourceFileInfos { - path := sourceFileInfo.Path() - pathToModuleIdentityStrings[path] = append(pathToModuleIdentityStrings[path], currentModuleIdentityString) - } - moduleReader, err := bufcli.NewModuleReaderAndCreateCacheDirs(container, clientConfig) - if err != nil { - return bufcli.NewInternalError(err) - } - for _, modulePin := range dependencyModulePins { - module, err := moduleReader.GetModule(ctx, modulePin) - if err != nil { - return bufcli.NewInternalError(err) - } - sourceFileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return bufcli.NewInternalError(err) - } - for _, sourceFileInfo := range sourceFileInfos { - path := sourceFileInfo.Path() - pathToModuleIdentityStrings[path] = append(pathToModuleIdentityStrings[path], modulePin.IdentityString()) - } - } - for path, moduleIdentityStrings := range pathToModuleIdentityStrings { - if len(moduleIdentityStrings) > 1 { - explanation := "Multiple files with the same path are not allowed because Protobuf files import each other by their paths, and each import path must uniquely identify a file." - return fmt.Errorf("%s is found in multiple modules: %s\n%s", path, stringutil.SliceToHumanString(moduleIdentityStrings), explanation) - } - } - if err := bufmoduleref.PutDependencyModulePinsToBucket(ctx, readWriteBucket, dependencyModulePins); err != nil { - return bufcli.NewInternalError(err) - } - return nil -} - -func getDependencies( - ctx context.Context, - clientConfig *connectclient.Config, - container appflag.Container, - flags *flags, - moduleConfig *bufconfig.Config, - readWriteBucket storage.ReadWriteBucket, - existingConfigFilePath string, -) ([]*pinnedRepository, error) { - if len(moduleConfig.Build.DependencyModuleReferences) == 0 { - return nil, nil - } - var remote string - if moduleConfig.ModuleIdentity != nil && moduleConfig.ModuleIdentity.Remote() != "" { - remote = moduleConfig.ModuleIdentity.Remote() - } else { - // At this point we know there's at least one dependency. If it's an unnamed module, select - // the right remote from the list of dependencies. - selectedRef := bufcli.SelectReferenceForRemote(moduleConfig.Build.DependencyModuleReferences) - if selectedRef == nil { - return nil, fmt.Errorf(`File %q has invalid "deps" references`, existingConfigFilePath) - } - remote = selectedRef.Remote() - container.Logger().Debug(fmt.Sprintf( - `File %q does not specify the "name" field. Based on the dependency %q, it appears that you are using a BSR instance at %q. Did you mean to specify "name: %s/..." within %q?`, - existingConfigFilePath, - selectedRef.IdentityString(), - remote, - remote, - existingConfigFilePath, - )) - } - service := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewResolveServiceClient) - var protoDependencyModuleReferences []*modulev1alpha1.ModuleReference - var currentProtoModulePins []*modulev1alpha1.ModulePin - if len(flags.Only) > 0 { - referencesByIdentity := map[string]bufmoduleref.ModuleReference{} - for _, reference := range moduleConfig.Build.DependencyModuleReferences { - referencesByIdentity[reference.IdentityString()] = reference - } - for _, only := range flags.Only { - moduleReference, ok := referencesByIdentity[only] - if !ok { - return nil, fmt.Errorf("%q is not a valid --only input: no such dependency in current module deps", only) - } - protoDependencyModuleReferences = append(protoDependencyModuleReferences, bufmoduleref.NewProtoModuleReferenceForModuleReference(moduleReference)) - } - currentModulePins, err := bufmoduleref.DependencyModulePinsForBucket(ctx, readWriteBucket) - if err != nil { - return nil, fmt.Errorf("couldn't read current dependencies: %w", err) - } - currentProtoModulePins = bufmoduleref.NewProtoModulePinsForModulePins(currentModulePins...) - } else { - protoDependencyModuleReferences = bufmoduleref.NewProtoModuleReferencesForModuleReferences( - moduleConfig.Build.DependencyModuleReferences..., - ) - } - resp, err := service.GetModulePins( - ctx, - connect.NewRequest(®istryv1alpha1.GetModulePinsRequest{ - ModuleReferences: protoDependencyModuleReferences, - CurrentModulePins: currentProtoModulePins, - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeUnimplemented && remote != bufconnect.DefaultRemote { - return nil, bufcli.NewUnimplementedRemoteError(err, remote, moduleConfig.ModuleIdentity.IdentityString()) - } - return nil, err - } - dependencyModulePins, err := bufmoduleref.NewModulePinsForProtos(resp.Msg.ModulePins...) - if err != nil { - return nil, bufcli.NewInternalError(err) - } - // We want to create one repository service per relevant remote. - remoteToRepositoryService := make(map[string]registryv1alpha1connect.RepositoryServiceClient) - remoteToDependencyModulePins := make(map[string][]bufmoduleref.ModulePin) - for _, pin := range dependencyModulePins { - if _, ok := remoteToRepositoryService[pin.Remote()]; !ok { - remoteToRepositoryService[pin.Remote()] = connectclient.Make(clientConfig, pin.Remote(), registryv1alpha1connect.NewRepositoryServiceClient) - } - remoteToDependencyModulePins[pin.Remote()] = append(remoteToDependencyModulePins[pin.Remote()], pin) - } - var allPinnedRepositories []*pinnedRepository - for dependencyRemote, dependencyModulePins := range remoteToDependencyModulePins { - repositoryService, ok := remoteToRepositoryService[dependencyRemote] - if !ok { - return nil, fmt.Errorf("a repository service is not available for %s", dependencyRemote) - } - dependencyFullNames := make([]string, len(dependencyModulePins)) - for i, pin := range dependencyModulePins { - dependencyFullNames[i] = fmt.Sprintf("%s/%s", pin.Owner(), pin.Repository()) - } - resp, err := repositoryService.GetRepositoriesByFullName(ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoriesByFullNameRequest{ - FullNames: dependencyFullNames, - })) - if err != nil { - return nil, err - } - pinnedRepositories := make([]*pinnedRepository, len(dependencyModulePins)) - for i, modulePin := range dependencyModulePins { - pinnedRepositories[i] = &pinnedRepository{ - modulePin: modulePin, - repository: resp.Msg.Repositories[i], - } - } - allPinnedRepositories = append(allPinnedRepositories, pinnedRepositories...) - } - return allPinnedRepositories, nil -} - -type pinnedRepository struct { - modulePin bufmoduleref.ModulePin - repository *registryv1alpha1.Repository -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/usage.gen.go deleted file mode 100644 index 52297f13b3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/mod/modupdate/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modupdate - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/push.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/push.go deleted file mode 100644 index 151102d540..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/push.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package push - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmanifest" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/stringutil" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - tagFlagName = "tag" - tagFlagShortName = "t" - draftFlagName = "draft" - errorFormatFlagName = "error-format" - disableSymlinksFlagName = "disable-symlinks" - createFlagName = "create" - createVisibilityFlagName = "create-visibility" - // deprecated - trackFlagName = "track" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: "Push a module to a registry", - Long: bufcli.GetSourceLong(`the source to push`), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Tags []string - Draft string - ErrorFormat string - DisableSymlinks bool - Create bool - CreateVisibility string - // Deprecated - Tracks []string - // special - InputHashtag string -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - bufcli.BindInputHashtag(flagSet, &f.InputHashtag) - bufcli.BindDisableSymlinks(flagSet, &f.DisableSymlinks, disableSymlinksFlagName) - bufcli.BindCreateVisibility(flagSet, &f.CreateVisibility, createVisibilityFlagName, createFlagName) - flagSet.StringSliceVarP( - &f.Tags, - tagFlagName, - tagFlagShortName, - nil, - fmt.Sprintf( - "Create a tag for the pushed commit. Multiple tags are created if specified multiple times. Cannot be used together with --%s", - draftFlagName, - ), - ) - flagSet.StringVar( - &f.Draft, - draftFlagName, - "", - fmt.Sprintf( - "Make the pushed commit a draft with the specified name. Cannot be used together with --%s (-%s)", - tagFlagName, - tagFlagShortName, - ), - ) - flagSet.StringVar( - &f.ErrorFormat, - errorFormatFlagName, - "text", - fmt.Sprintf( - "The format for build errors printed to stderr. Must be one of %s", - stringutil.SliceToString(bufanalysis.AllFormatStrings), - ), - ) - flagSet.BoolVar( - &f.Create, - createFlagName, - false, - fmt.Sprintf("Create the repository if it does not exist. Must set a visibility using --%s", createVisibilityFlagName), - ) - flagSet.StringSliceVar( - &f.Tracks, - trackFlagName, - nil, - "Do not use. This flag never had any effect", - ) - _ = flagSet.MarkHidden(trackFlagName) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) (retErr error) { - if len(flags.Tracks) > 0 { - return appcmd.NewInvalidArgumentErrorf("--%s has never had any effect, do not use.", trackFlagName) - } - if err := bufcli.ValidateErrorFormatFlag(flags.ErrorFormat, errorFormatFlagName); err != nil { - return err - } - if len(flags.Tags) > 0 && flags.Draft != "" { - return appcmd.NewInvalidArgumentErrorf("--%s (-%s) and --%s cannot be used together.", tagFlagName, tagFlagShortName, draftFlagName) - } - if flags.CreateVisibility != "" { - if !flags.Create { - return appcmd.NewInvalidArgumentErrorf("Cannot set --%s without --%s.", createVisibilityFlagName, createFlagName) - } - // We re-parse below as needed, but do not return an appcmd.NewInvalidArgumentError below as - // we expect validation to be handled here. - if _, err := bufcli.VisibilityFlagToVisibility(flags.CreateVisibility); err != nil { - return appcmd.NewInvalidArgumentError(err.Error()) - } - } else if flags.Create { - return appcmd.NewInvalidArgumentErrorf("--%s is required if --%s is set.", createVisibilityFlagName, createFlagName) - } - source, err := bufcli.GetInputValue(container, flags.InputHashtag, ".") - if err != nil { - return err - } - storageosProvider := bufcli.NewStorageosProvider(flags.DisableSymlinks) - runner := command.NewRunner() - // We are pushing to the BSR, this module has to be independently buildable - // given the configuration it has without any enclosing workspace. - sourceBucket, sourceConfig, err := bufcli.BucketAndConfigForSource( - ctx, - container.Logger(), - container, - storageosProvider, - runner, - source, - ) - if err != nil { - return err - } - moduleIdentity := sourceConfig.ModuleIdentity - builtModule, err := bufmodulebuild.NewModuleBucketBuilder().BuildForBucket( - ctx, - sourceBucket, - sourceConfig.Build, - ) - if err != nil { - return err - } - modulePin, err := pushOrCreate(ctx, container, moduleIdentity, builtModule, flags) - if err != nil { - if connect.CodeOf(err) == connect.CodeAlreadyExists { - if _, err := container.Stderr().Write( - []byte("The latest commit has the same content; not creating a new commit.\n"), - ); err != nil { - return err - } - return nil - } - return err - } - if modulePin == nil { - return errors.New("Missing local module pin in the registry's response.") - } - if _, err := container.Stdout().Write([]byte(modulePin.Commit + "\n")); err != nil { - return err - } - return nil -} - -func pushOrCreate( - ctx context.Context, - container appflag.Container, - moduleIdentity bufmoduleref.ModuleIdentity, - builtModule *bufmodulebuild.BuiltModule, - flags *flags, -) (*registryv1alpha1.LocalModulePin, error) { - clientConfig, err := bufcli.NewConnectClientConfig(container) - if err != nil { - return nil, err - } - modulePin, err := push(ctx, container, clientConfig, moduleIdentity, builtModule, flags) - if err != nil { - // We rely on Push* returning a NotFound error to denote the repository is not created. - // This technically could be a NotFound error for some other entity than the repository - // in question, however if it is, then this Create call will just fail as the repository - // is already created, and there is no side effect. The 99% case is that a NotFound - // error is because the repository does not exist, and we want to avoid having to do - // a GetRepository RPC call for every call to push --create. - if flags.Create && connect.CodeOf(err) == connect.CodeNotFound { - if err := create(ctx, container, clientConfig, moduleIdentity, flags); err != nil { - return nil, err - } - return push(ctx, container, clientConfig, moduleIdentity, builtModule, flags) - } - return nil, err - } - return modulePin, nil -} - -func push( - ctx context.Context, - container appflag.Container, - clientConfig *connectclient.Config, - moduleIdentity bufmoduleref.ModuleIdentity, - builtModule *bufmodulebuild.BuiltModule, - flags *flags, -) (*registryv1alpha1.LocalModulePin, error) { - service := connectclient.Make(clientConfig, moduleIdentity.Remote(), registryv1alpha1connect.NewPushServiceClient) - m, blobSet, err := manifest.NewFromBucket(ctx, builtModule.Bucket) - if err != nil { - return nil, err - } - bucketManifest, blobs, err := bufmanifest.ToProtoManifestAndBlobs(ctx, m, blobSet) - if err != nil { - return nil, err - } - resp, err := service.PushManifestAndBlobs( - ctx, - connect.NewRequest(®istryv1alpha1.PushManifestAndBlobsRequest{ - Owner: moduleIdentity.Owner(), - Repository: moduleIdentity.Repository(), - Manifest: bucketManifest, - Blobs: blobs, - Tags: flags.Tags, - DraftName: flags.Draft, - }), - ) - if err != nil { - return nil, err - } - return resp.Msg.LocalModulePin, nil -} - -func create( - ctx context.Context, - container appflag.Container, - clientConfig *connectclient.Config, - moduleIdentity bufmoduleref.ModuleIdentity, - flags *flags, -) error { - service := connectclient.Make(clientConfig, moduleIdentity.Remote(), registryv1alpha1connect.NewRepositoryServiceClient) - visiblity, err := bufcli.VisibilityFlagToVisibility(flags.CreateVisibility) - if err != nil { - return err - } - fullName := moduleIdentity.Owner() + "/" + moduleIdentity.Repository() - _, err = service.CreateRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.CreateRepositoryByFullNameRequest{ - FullName: fullName, - Visibility: visiblity, - }), - ) - if err != nil && connect.CodeOf(err) == connect.CodeAlreadyExists { - return connect.NewError(connect.CodeInternal, fmt.Errorf("Expected repository %s to be missing but found the repository to already exist", fullName)) - } - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/usage.gen.go deleted file mode 100644 index 8a869291ce..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/push/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package push - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/registrylogin.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/registrylogin.go deleted file mode 100644 index 6f9444b798..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/registrylogin.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package registrylogin - -import ( - "context" - "errors" - "fmt" - "io" - "strings" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/netrc" - "github.com/bufbuild/connect-go" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -const ( - usernameFlagName = "username" - tokenStdinFlagName = "token-stdin" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - Use: name + " ", - Short: `Log in to the Buf Schema Registry`, - Long: fmt.Sprintf(`This prompts for your BSR username and a BSR token and updates your %s file with these credentials. -The argument will default to buf.build if not specified.`, netrc.Filename), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - BindFlags: flags.Bind, - } -} - -type flags struct { - Username string - TokenStdin bool -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Username, - usernameFlagName, - "", - "The username to use. This command prompts for a username by default", - ) - flagSet.BoolVar( - &f.TokenStdin, - tokenStdinFlagName, - false, - "Read the token from stdin. This command prompts for a token by default", - ) -} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - // If a user sends a SIGINT to buf, the top-level application context is - // cancelled and signal masks are reset. However, during an interactive - // login the context is not respected; for example, it takes two SIGINTs - // to interrupt the process. - - // Ideally we could just trigger an I/O timeout by setting the deadline on - // stdin, but when stdin is connected to a terminal the underlying fd is in - // blocking mode making it ineligible. As changing the mode of stdin is - // dangerous, this change takes an alternate approach of simply returning - // early. - - // Note that this does not gracefully handle the case where the terminal is - // in no-echo mode, as is the case when prompting for a password - // interactively. - errC := make(chan error, 1) - go func() { - errC <- inner(ctx, container, flags) - close(errC) - }() - select { - case err := <-errC: - return err - case <-ctx.Done(): - ctxErr := ctx.Err() - // Otherwise we will print "Failure: context canceled". - if errors.Is(ctxErr, context.Canceled) { - // Otherwise the next terminal line will be on the same line as the - // last output from buf. - if _, err := fmt.Fprintln(container.Stdout()); err != nil { - return err - } - return nil - } - return ctxErr - } -} - -func inner( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - remote := bufconnect.DefaultRemote - if container.NumArgs() == 1 { - remote = container.Arg(0) - } - // Do not print unless we are prompting - if flags.Username == "" && !flags.TokenStdin { - if _, err := fmt.Fprintf( - container.Stdout(), - "Log in with your Buf Schema Registry username. If you don't have a username, create one at https://%s.\n\n", - remote, - ); err != nil { - return err - } - } - username := flags.Username - if username == "" { - var err error - username, err = bufcli.PromptUser(container, "Username: ") - if err != nil { - if errors.Is(err, bufcli.ErrNotATTY) { - return errors.New("cannot perform an interactive login from a non-TTY device") - } - return err - } - } - var token string - if flags.TokenStdin { - data, err := io.ReadAll(container.Stdin()) - if err != nil { - return err - } - token = string(data) - } else { - var err error - token, err = bufcli.PromptUserForPassword(container, "Token: ") - if err != nil { - if errors.Is(err, bufcli.ErrNotATTY) { - return errors.New("cannot perform an interactive login from a non-TTY device") - } - return err - } - } - // Remove leading and trailing spaces from user-supplied token to avoid - // common input errors such as trailing new lines, as-is the case of using - // echo vs echo -n. - token = strings.TrimSpace(token) - if token == "" { - return errors.New("token cannot be empty string") - } - clientConfig, err := bufcli.NewConnectClientConfigWithToken(container, token) - if err != nil { - return err - } - authnService := connectclient.Make(clientConfig, remote, registryv1alpha1connect.NewAuthnServiceClient) - resp, err := authnService.GetCurrentUser(ctx, connect.NewRequest(®istryv1alpha1.GetCurrentUserRequest{})) - if err != nil { - // We don't want to use the default error from wrapError here if the error - // an unauthenticated error. - return errors.New("invalid token provided") - } - user := resp.Msg.User - if user == nil { - return errors.New("no user found for provided token") - } - if user.Username != username { - return errors.New("the username associated with the provided token does not match the provided username") - } - if err := netrc.PutMachines( - container, - netrc.NewMachine( - remote, - username, - token, - ), - ); err != nil { - return err - } - if _, err := netrc.DeleteMachineForName(container, "go."+remote); err != nil { - return err - } - netrcFilePath, err := netrc.GetFilePath(container) - if err != nil { - return err - } - loggedInMessage := fmt.Sprintf("Credentials saved to %s.\n", netrcFilePath) - // Unless we did not prompt at all, print a newline first - if flags.Username == "" || !flags.TokenStdin { - loggedInMessage = "\n" + loggedInMessage - } - if _, err := container.Stdout().Write([]byte(loggedInMessage)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/usage.gen.go deleted file mode 100644 index 4e4fb06379..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogin/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package registrylogin - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/registrylogout.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/registrylogout.go deleted file mode 100644 index 1175343d7b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/registrylogout.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package registrylogout - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/buf/bufcli" - "github.com/bufbuild/buf/private/bufpkg/bufconnect" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/app/appflag" - "github.com/bufbuild/buf/private/pkg/netrc" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// NewCommand returns a new Command. -func NewCommand( - name string, - builder appflag.Builder, -) *appcmd.Command { - flags := newFlags() - return &appcmd.Command{ - // Not documenting the first arg (remote) as this is just for testing for now. - // TODO: Update when we have self-hosted. - Use: name, - Short: `Log out of the Buf Schema Registry`, - Long: fmt.Sprintf(`This command removes any BSR credentials from your %s file`, netrc.Filename), - Args: cobra.MaximumNArgs(1), - Run: builder.NewRunFunc( - func(ctx context.Context, container appflag.Container) error { - return run(ctx, container, flags) - }, - bufcli.NewErrorInterceptor(), - ), - } -} - -type flags struct { -} - -func newFlags() *flags { - return &flags{} -} - -func (f *flags) Bind(flagSet *pflag.FlagSet) {} - -func run( - ctx context.Context, - container appflag.Container, - flags *flags, -) error { - remote := bufconnect.DefaultRemote - if container.NumArgs() == 1 { - remote = container.Arg(0) - } - modified1, err := netrc.DeleteMachineForName(container, remote) - if err != nil { - return err - } - modified2, err := netrc.DeleteMachineForName(container, "go."+remote) - if err != nil { - return err - } - netrcFilePath, err := netrc.GetFilePath(container) - if err != nil { - return err - } - loggedOutMessage := fmt.Sprintf("All existing BSR credentials removed from %s\n", netrcFilePath) - if !modified1 && !modified2 { - loggedOutMessage = fmt.Sprintf("No BSR credentials found in %s; you are already logged out\n", netrcFilePath) - } - if _, err := container.Stdout().Write([]byte(loggedOutMessage)); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/usage.gen.go deleted file mode 100644 index 9cddede0ba..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/command/registry/registrylogout/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package registrylogout - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/usage.gen.go b/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/usage.gen.go deleted file mode 100644 index 0c5d83c913..0000000000 --- a/vendor/github.com/bufbuild/buf/private/buf/cmd/buf/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buf - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysis.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysis.go deleted file mode 100644 index ed6bae1e6e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/bufanalysis.go +++ /dev/null @@ -1,315 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufanalysis - -import ( - "crypto/sha256" - "fmt" - "io" - "sort" - "strconv" - "strings" -) - -const ( - // FormatText is the text format for FileAnnotations. - FormatText Format = iota + 1 - // FormatJSON is the JSON format for FileAnnotations. - FormatJSON - // FormatMSVS is the MSVS format for FileAnnotations. - FormatMSVS - // FormatJUnit is the JUnit format for FileAnnotations. - FormatJUnit - // FormatGithubActions is the Github Actions format for FileAnnotations. - // - // See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message. - FormatGithubActions -) - -var ( - // AllFormatStrings is all format strings without aliases. - // - // Sorted in the order we want to display them. - AllFormatStrings = []string{ - "text", - "json", - "msvs", - "junit", - "github-actions", - } - // AllFormatStringsWithAliases is all format strings with aliases. - // - // Sorted in the order we want to display them. - AllFormatStringsWithAliases = []string{ - "text", - "gcc", - "json", - "msvs", - "junit", - "github-actions", - } - - stringToFormat = map[string]Format{ - "text": FormatText, - // alias for text - "gcc": FormatText, - "json": FormatJSON, - "msvs": FormatMSVS, - "junit": FormatJUnit, - "github-actions": FormatGithubActions, - } - formatToString = map[Format]string{ - FormatText: "text", - FormatJSON: "json", - FormatMSVS: "msvs", - FormatJUnit: "junit", - FormatGithubActions: "github-actions", - } -) - -// Format is a FileAnnotation format. -type Format int - -// String implements fmt.Stringer. -func (f Format) String() string { - s, ok := formatToString[f] - if !ok { - return strconv.Itoa(int(f)) - } - return s -} - -// ParseFormat parses the Format. -// -// The empty strings defaults to FormatText. -func ParseFormat(s string) (Format, error) { - s = strings.ToLower(strings.TrimSpace(s)) - if s == "" { - return FormatText, nil - } - f, ok := stringToFormat[s] - if ok { - return f, nil - } - return 0, fmt.Errorf("unknown format: %q", s) -} - -// FileInfo is a minimal FileInfo interface. -type FileInfo interface { - Path() string - ExternalPath() string -} - -// FileAnnotation is a file annotation. -type FileAnnotation interface { - // Stringer returns the string representation of this annotation. - fmt.Stringer - - // FileInfo is the FileInfo for this annotation. - // - // This may be nil. - FileInfo() FileInfo - - // StartLine is the starting line. - // - // If the starting line is not known, this will be 0. - StartLine() int - // StartColumn is the starting column. - // - // If the starting column is not known, this will be 0. - StartColumn() int - // EndLine is the ending line. - // - // If the ending line is not known, this will be 0. - // If the ending line is the same as the starting line, this will be explicitly - // set to the same value as start_line. - EndLine() int - // EndColumn is the ending column. - // - // If the ending column is not known, this will be 0. - // If the ending column is the same as the starting column, this will be explicitly - // set to the same value as start_column. - EndColumn() int - // Type is the type of annotation, typically an ID representing a failure type. - Type() string - // Message is the message of the annotation. - Message() string -} - -// NewFileAnnotation returns a new FileAnnotation. -func NewFileAnnotation( - fileInfo FileInfo, - startLine int, - startColumn int, - endLine int, - endColumn int, - typeString string, - message string, -) FileAnnotation { - return newFileAnnotation( - fileInfo, - startLine, - startColumn, - endLine, - endColumn, - typeString, - message, - ) -} - -// SortFileAnnotations sorts the FileAnnotations. -// -// The order of sorting is: -// -// ExternalPath -// StartLine -// StartColumn -// Type -// Message -// EndLine -// EndColumn -func SortFileAnnotations(fileAnnotations []FileAnnotation) { - sort.Stable(sortFileAnnotations(fileAnnotations)) -} - -// DeduplicateAndSortFileAnnotations deduplicates the FileAnnotations based on their -// string representation and sorts them according to the order specified in SortFileAnnotations. -func DeduplicateAndSortFileAnnotations(fileAnnotations []FileAnnotation) []FileAnnotation { - deduplicated := make([]FileAnnotation, 0, len(fileAnnotations)) - seen := make(map[string]struct{}, len(fileAnnotations)) - for _, fileAnnotation := range fileAnnotations { - key := hash(fileAnnotation) - if _, ok := seen[key]; ok { - continue - } - seen[key] = struct{}{} - deduplicated = append(deduplicated, fileAnnotation) - } - SortFileAnnotations(deduplicated) - return deduplicated -} - -// PrintFileAnnotations prints the file annotations separated by newlines. -func PrintFileAnnotations(writer io.Writer, fileAnnotations []FileAnnotation, formatString string) error { - format, err := ParseFormat(formatString) - if err != nil { - return err - } - - switch format { - case FormatText: - return printAsText(writer, fileAnnotations) - case FormatJSON: - return printAsJSON(writer, fileAnnotations) - case FormatMSVS: - return printAsMSVS(writer, fileAnnotations) - case FormatJUnit: - return printAsJUnit(writer, fileAnnotations) - case FormatGithubActions: - return printAsGithubActions(writer, fileAnnotations) - default: - return fmt.Errorf("unknown FileAnnotation Format: %v", format) - } -} - -// hash returns a hash value that uniquely identifies the given FileAnnotation. -func hash(fileAnnotation FileAnnotation) string { - path := "" - if fileInfo := fileAnnotation.FileInfo(); fileInfo != nil { - path = fileInfo.ExternalPath() - } - hash := sha256.New() - _, _ = hash.Write([]byte(path)) - _, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.StartLine()))) - _, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.StartColumn()))) - _, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.EndLine()))) - _, _ = hash.Write([]byte(strconv.Itoa(fileAnnotation.EndColumn()))) - _, _ = hash.Write([]byte(fileAnnotation.Type())) - _, _ = hash.Write([]byte(fileAnnotation.Message())) - return string(hash.Sum(nil)) -} - -type sortFileAnnotations []FileAnnotation - -func (a sortFileAnnotations) Len() int { return len(a) } -func (a sortFileAnnotations) Swap(i int, j int) { a[i], a[j] = a[j], a[i] } -func (a sortFileAnnotations) Less(i int, j int) bool { return fileAnnotationCompareTo(a[i], a[j]) < 0 } - -// fileAnnotationCompareTo returns a value less than 0 if a < b, a value -// greater than 0 if a > b, and 0 if a == b. -func fileAnnotationCompareTo(a FileAnnotation, b FileAnnotation) int { - if a == nil && b == nil { - return 0 - } - if a == nil && b != nil { - return -1 - } - if a != nil && b == nil { - return 1 - } - aFileInfo := a.FileInfo() - bFileInfo := b.FileInfo() - if aFileInfo == nil && bFileInfo != nil { - return -1 - } - if aFileInfo != nil && bFileInfo == nil { - return 1 - } - if aFileInfo != nil && bFileInfo != nil { - if aFileInfo.ExternalPath() < bFileInfo.ExternalPath() { - return -1 - } - if aFileInfo.ExternalPath() > bFileInfo.ExternalPath() { - return 1 - } - } - if a.StartLine() < b.StartLine() { - return -1 - } - if a.StartLine() > b.StartLine() { - return 1 - } - if a.StartColumn() < b.StartColumn() { - return -1 - } - if a.StartColumn() > b.StartColumn() { - return 1 - } - if a.Type() < b.Type() { - return -1 - } - if a.Type() > b.Type() { - return 1 - } - if a.Message() < b.Message() { - return -1 - } - if a.Message() > b.Message() { - return 1 - } - if a.EndLine() < b.EndLine() { - return -1 - } - if a.EndLine() > b.EndLine() { - return 1 - } - if a.EndColumn() < b.EndColumn() { - return -1 - } - if a.EndColumn() > b.EndColumn() { - return 1 - } - return 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/file_annotation.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/file_annotation.go deleted file mode 100644 index 640f9ebef4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/file_annotation.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufanalysis - -import ( - "bytes" - "strconv" -) - -type fileAnnotation struct { - fileInfo FileInfo - startLine int - startColumn int - endLine int - endColumn int - typeString string - message string -} - -func newFileAnnotation( - fileInfo FileInfo, - startLine int, - startColumn int, - endLine int, - endColumn int, - typeString string, - message string, -) *fileAnnotation { - return &fileAnnotation{ - fileInfo: fileInfo, - startLine: startLine, - startColumn: startColumn, - endLine: endLine, - endColumn: endColumn, - typeString: typeString, - message: message, - } -} - -func (f *fileAnnotation) FileInfo() FileInfo { - return f.fileInfo -} - -func (f *fileAnnotation) StartLine() int { - return f.startLine -} - -func (f *fileAnnotation) StartColumn() int { - return f.startColumn -} - -func (f *fileAnnotation) EndLine() int { - return f.endLine -} - -func (f *fileAnnotation) EndColumn() int { - return f.endColumn -} - -func (f *fileAnnotation) Type() string { - return f.typeString -} - -func (f *fileAnnotation) Message() string { - return f.message -} - -func (f *fileAnnotation) String() string { - if f == nil { - return "" - } - path := "" - line := atLeast1(f.startLine) - column := atLeast1(f.startColumn) - message := f.message - if f.fileInfo != nil { - path = f.fileInfo.ExternalPath() - } - if message == "" { - message = f.typeString - // should never happen but just in case - if message == "" { - message = "FAILURE" - } - } - buffer := bytes.NewBuffer(nil) - _, _ = buffer.WriteString(path) - _, _ = buffer.WriteRune(':') - _, _ = buffer.WriteString(strconv.Itoa(line)) - _, _ = buffer.WriteRune(':') - _, _ = buffer.WriteString(strconv.Itoa(column)) - _, _ = buffer.WriteRune(':') - _, _ = buffer.WriteString(message) - return buffer.String() -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/print.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/print.go deleted file mode 100644 index 3f837fd860..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/print.go +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufanalysis - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "strconv" - "strings" -) - -func printAsText(writer io.Writer, fileAnnotations []FileAnnotation) error { - return printEachAnnotationOnNewLine( - writer, - fileAnnotations, - printFileAnnotationAsText, - ) -} - -func printAsMSVS(writer io.Writer, fileAnnotations []FileAnnotation) error { - return printEachAnnotationOnNewLine( - writer, - fileAnnotations, - printFileAnnotationAsMSVS, - ) -} - -func printAsJSON(writer io.Writer, fileAnnotations []FileAnnotation) error { - return printEachAnnotationOnNewLine( - writer, - fileAnnotations, - printFileAnnotationAsJSON, - ) -} - -func printAsGithubActions(writer io.Writer, fileAnnotations []FileAnnotation) error { - return printEachAnnotationOnNewLine( - writer, - fileAnnotations, - printFileAnnotationAsGithubActions, - ) -} - -func printAsJUnit(writer io.Writer, fileAnnotations []FileAnnotation) error { - encoder := xml.NewEncoder(writer) - encoder.Indent("", " ") - testsuites := xml.StartElement{Name: xml.Name{Local: "testsuites"}} - err := encoder.EncodeToken(testsuites) - if err != nil { - return err - } - annotationsByPath := groupAnnotationsByPath(fileAnnotations) - for _, annotations := range annotationsByPath { - path := "" - if fileInfo := annotations[0].FileInfo(); fileInfo != nil { - path = fileInfo.ExternalPath() - } - path = strings.TrimSuffix(path, ".proto") - testsuite := xml.StartElement{ - Name: xml.Name{Local: "testsuite"}, - Attr: []xml.Attr{ - {Name: xml.Name{Local: "name"}, Value: path}, - {Name: xml.Name{Local: "tests"}, Value: strconv.Itoa(len(annotations))}, - {Name: xml.Name{Local: "failures"}, Value: strconv.Itoa(len(annotations))}, - {Name: xml.Name{Local: "errors"}, Value: "0"}, - }, - } - if err := encoder.EncodeToken(testsuite); err != nil { - return err - } - for _, annotation := range annotations { - if err := printFileAnnotationAsJUnit(encoder, annotation); err != nil { - return err - } - } - if err := encoder.EncodeToken(xml.EndElement{Name: testsuite.Name}); err != nil { - return err - } - } - if err := encoder.EncodeToken(xml.EndElement{Name: testsuites.Name}); err != nil { - return err - } - if err := encoder.Flush(); err != nil { - return err - } - if _, err := writer.Write([]byte("\n")); err != nil { - return err - } - return nil -} - -func printFileAnnotationAsJUnit(encoder *xml.Encoder, annotation FileAnnotation) error { - testcase := xml.StartElement{Name: xml.Name{Local: "testcase"}} - name := annotation.Type() - if annotation.StartColumn() != 0 { - name += fmt.Sprintf("_%d_%d", annotation.StartLine(), annotation.StartColumn()) - } else if annotation.StartLine() != 0 { - name += fmt.Sprintf("_%d", annotation.StartLine()) - } - testcase.Attr = append(testcase.Attr, xml.Attr{Name: xml.Name{Local: "name"}, Value: name}) - if err := encoder.EncodeToken(testcase); err != nil { - return err - } - failure := xml.StartElement{ - Name: xml.Name{Local: "failure"}, - Attr: []xml.Attr{ - {Name: xml.Name{Local: "message"}, Value: annotation.String()}, - {Name: xml.Name{Local: "type"}, Value: annotation.Type()}, - }, - } - if err := encoder.EncodeToken(failure); err != nil { - return err - } - if err := encoder.EncodeToken(xml.EndElement{Name: failure.Name}); err != nil { - return err - } - if err := encoder.EncodeToken(xml.EndElement{Name: testcase.Name}); err != nil { - return err - } - return nil -} - -func groupAnnotationsByPath(annotations []FileAnnotation) [][]FileAnnotation { - pathToIndex := make(map[string]int) - annotationsByPath := make([][]FileAnnotation, 0) - for _, annotation := range annotations { - path := "" - if fileInfo := annotation.FileInfo(); fileInfo != nil { - path = fileInfo.ExternalPath() - } - index, ok := pathToIndex[path] - if !ok { - index = len(annotationsByPath) - pathToIndex[path] = index - annotationsByPath = append(annotationsByPath, nil) - } - annotationsByPath[index] = append(annotationsByPath[index], annotation) - } - return annotationsByPath -} - -func printFileAnnotationAsText(buffer *bytes.Buffer, f FileAnnotation) error { - _, _ = buffer.WriteString(f.String()) - return nil -} - -func printFileAnnotationAsMSVS(buffer *bytes.Buffer, f FileAnnotation) error { - // This will work as long as f != (*fileAnnotation)(nil) - if f == nil { - return nil - } - path := "" - line := atLeast1(f.StartLine()) - column := atLeast1(f.StartColumn()) - message := f.Message() - if f.FileInfo() != nil { - path = f.FileInfo().ExternalPath() - } - typeString := f.Type() - if typeString == "" { - // should never happen but just in case - typeString = "FAILURE" - } - if message == "" { - message = f.Type() - // should never happen but just in case - if message == "" { - message = "FAILURE" - } - } - _, _ = buffer.WriteString(path) - _, _ = buffer.WriteRune('(') - _, _ = buffer.WriteString(strconv.Itoa(line)) - if column != 0 { - _, _ = buffer.WriteRune(',') - _, _ = buffer.WriteString(strconv.Itoa(column)) - } - _, _ = buffer.WriteString(") : error ") - _, _ = buffer.WriteString(typeString) - _, _ = buffer.WriteString(" : ") - _, _ = buffer.WriteString(message) - return nil -} - -func printFileAnnotationAsJSON(buffer *bytes.Buffer, f FileAnnotation) error { - data, err := json.Marshal(newExternalFileAnnotation(f)) - if err != nil { - return err - } - _, _ = buffer.Write(data) - return nil -} - -func printFileAnnotationAsGithubActions(buffer *bytes.Buffer, f FileAnnotation) error { - if f == nil { - return nil - } - _, _ = buffer.WriteString("::error ") - - // file= is required for GitHub Actions, however it is possible to not have - // a path for a FileAnnotation. We still print something, however we need - // to test what happens in GitHub Actions if no valid path is printed out. - path := "" - if f.FileInfo() != nil { - path = f.FileInfo().ExternalPath() - } - _, _ = buffer.WriteString("file=") - _, _ = buffer.WriteString(path) - - // Everything else is optional. - if startLine := f.StartLine(); startLine > 0 { - _, _ = buffer.WriteString(",line=") - _, _ = buffer.WriteString(strconv.Itoa(startLine)) - // We only print column information if we have line information. - if startColumn := f.StartColumn(); startColumn > 0 { - _, _ = buffer.WriteString(",col=") - _, _ = buffer.WriteString(strconv.Itoa(startColumn)) - } - // We only do any ending line information if we have starting line information - if endLine := f.EndLine(); endLine > 0 { - _, _ = buffer.WriteString(",endLine=") - _, _ = buffer.WriteString(strconv.Itoa(endLine)) - // We only print column information if we have line information. - if endColumn := f.EndColumn(); endColumn > 0 { - // Yes, the spec has "col" for start and "endColumn" for end. - _, _ = buffer.WriteString(",endColumn=") - _, _ = buffer.WriteString(strconv.Itoa(endColumn)) - } - } - } - - _, _ = buffer.WriteString("::") - _, _ = buffer.WriteString(f.Message()) - return nil -} - -type externalFileAnnotation struct { - Path string `json:"path,omitempty" yaml:"path,omitempty"` - StartLine int `json:"start_line,omitempty" yaml:"start_line,omitempty"` - StartColumn int `json:"start_column,omitempty" yaml:"start_column,omitempty"` - EndLine int `json:"end_line,omitempty" yaml:"end_line,omitempty"` - EndColumn int `json:"end_column,omitempty" yaml:"end_column,omitempty"` - Type string `json:"type,omitempty" yaml:"type,omitempty"` - Message string `json:"message,omitempty" yaml:"message,omitempty"` -} - -func newExternalFileAnnotation(f FileAnnotation) externalFileAnnotation { - path := "" - if f.FileInfo() != nil { - path = f.FileInfo().ExternalPath() - } - return externalFileAnnotation{ - Path: path, - StartLine: atLeast1(f.StartLine()), - StartColumn: atLeast1(f.StartColumn()), - EndLine: atLeast1(f.EndLine()), - EndColumn: atLeast1(f.EndColumn()), - Type: f.Type(), - Message: f.Message(), - } -} - -func printEachAnnotationOnNewLine( - writer io.Writer, - fileAnnotations []FileAnnotation, - fileAnnotationPrinter func(writer *bytes.Buffer, fileAnnotation FileAnnotation) error, -) error { - buffer := bytes.NewBuffer(nil) - for _, fileAnnotation := range fileAnnotations { - buffer.Reset() - if err := fileAnnotationPrinter(buffer, fileAnnotation); err != nil { - return err - } - _, _ = buffer.WriteString("\n") - if _, err := writer.Write(buffer.Bytes()); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/usage.gen.go deleted file mode 100644 index 6046ddd751..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufanalysis - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/util.go deleted file mode 100644 index 6226dd7794..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufanalysis/util.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufanalysis - -func atLeast1(i int) int { - if i <= 0 { - return 1 - } - return i -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/bufapimodule.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/bufapimodule.go deleted file mode 100644 index 42c2c254ff..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/bufapimodule.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufapimodule provides bufmodule types based on bufapi types. -package bufapimodule - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - "github.com/bufbuild/buf/private/pkg/connectclient" - "go.uber.org/zap" -) - -type DownloadServiceClientFactory func(address string) registryv1alpha1connect.DownloadServiceClient -type RepositoryCommitServiceClientFactory func(address string) registryv1alpha1connect.RepositoryCommitServiceClient - -func NewDownloadServiceClientFactory(clientConfig *connectclient.Config) DownloadServiceClientFactory { - return func(address string) registryv1alpha1connect.DownloadServiceClient { - return connectclient.Make(clientConfig, address, registryv1alpha1connect.NewDownloadServiceClient) - } -} - -func NewRepositoryCommitServiceClientFactory(clientConfig *connectclient.Config) RepositoryCommitServiceClientFactory { - return func(address string) registryv1alpha1connect.RepositoryCommitServiceClient { - return connectclient.Make(clientConfig, address, registryv1alpha1connect.NewRepositoryCommitServiceClient) - } -} - -// NewModuleReader returns a new ModuleReader backed by the download service. -func NewModuleReader( - downloadClientFactory DownloadServiceClientFactory, - opts ...ModuleReaderOption, -) bufmodule.ModuleReader { - return newModuleReader( - downloadClientFactory, - opts..., - ) -} - -// ModuleReaderOption allows configuration of a module reader. -type ModuleReaderOption func(reader *moduleReader) - -// NewModuleResolver returns a new ModuleResolver backed by the resolve service. -func NewModuleResolver( - logger *zap.Logger, - repositoryCommitClientFactory RepositoryCommitServiceClientFactory, -) bufmodule.ModuleResolver { - return newModuleResolver(logger, repositoryCommitClientFactory) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_reader.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_reader.go deleted file mode 100644 index 34cd9359be..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_reader.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufapimodule - -import ( - "context" - "errors" - - "github.com/bufbuild/buf/private/bufpkg/bufmanifest" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/connect-go" -) - -type moduleReader struct { - downloadClientFactory DownloadServiceClientFactory -} - -func newModuleReader( - downloadClientFactory DownloadServiceClientFactory, - opts ...ModuleReaderOption, -) *moduleReader { - reader := &moduleReader{ - downloadClientFactory: downloadClientFactory, - } - for _, opt := range opts { - opt(reader) - } - return reader -} - -func (m *moduleReader) GetModule(ctx context.Context, modulePin bufmoduleref.ModulePin) (bufmodule.Module, error) { - moduleIdentity, err := bufmoduleref.NewModuleIdentity( - modulePin.Remote(), - modulePin.Owner(), - modulePin.Repository(), - ) - if err != nil { - // malformed pin - return nil, err - } - identityAndCommitOpt := bufmodule.ModuleWithModuleIdentityAndCommit( - moduleIdentity, - modulePin.Commit(), - ) - resp, err := m.downloadManifestAndBlobs(ctx, modulePin) - if err != nil { - return nil, err - } - if resp.Manifest == nil { - return nil, errors.New("expected non-nil manifest") - } - // use manifest and blobs - moduleManifest, err := bufmanifest.NewManifestFromProto(ctx, resp.Manifest) - if err != nil { - return nil, err - } - blobSet, err := bufmanifest.NewBlobSetFromProto(ctx, resp.Blobs) - if err != nil { - return nil, err - } - return bufmodule.NewModuleForManifestAndBlobSet(ctx, moduleManifest, blobSet, identityAndCommitOpt) -} - -func (m *moduleReader) downloadManifestAndBlobs( - ctx context.Context, - modulePin bufmoduleref.ModulePin, -) (*registryv1alpha1.DownloadManifestAndBlobsResponse, error) { - downloadService := m.downloadClientFactory(modulePin.Remote()) - resp, err := downloadService.DownloadManifestAndBlobs( - ctx, - connect.NewRequest(®istryv1alpha1.DownloadManifestAndBlobsRequest{ - Owner: modulePin.Owner(), - Repository: modulePin.Repository(), - Reference: modulePin.Commit(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - // Required by ModuleReader interface spec - return nil, storage.NewErrNotExist(modulePin.String()) - } - return nil, err - } - return resp.Msg, err -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_resolver.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_resolver.go deleted file mode 100644 index 311283265b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/module_resolver.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufapimodule - -import ( - "context" - "errors" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/connect-go" - "go.uber.org/zap" -) - -type moduleResolver struct { - logger *zap.Logger - repositoryCommitClientFactory RepositoryCommitServiceClientFactory -} - -func newModuleResolver( - logger *zap.Logger, - repositoryCommitClientFactory RepositoryCommitServiceClientFactory, -) *moduleResolver { - return &moduleResolver{ - logger: logger, - repositoryCommitClientFactory: repositoryCommitClientFactory, - } -} - -func (m *moduleResolver) GetModulePin(ctx context.Context, moduleReference bufmoduleref.ModuleReference) (bufmoduleref.ModulePin, error) { - repositoryCommitService := m.repositoryCommitClientFactory(moduleReference.Remote()) - resp, err := repositoryCommitService.GetRepositoryCommitByReference( - ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryCommitByReferenceRequest{ - RepositoryOwner: moduleReference.Owner(), - RepositoryName: moduleReference.Repository(), - Reference: moduleReference.Reference(), - }), - ) - if err != nil { - if connect.CodeOf(err) == connect.CodeNotFound { - // Required by ModuleResolver interface spec - return nil, storage.NewErrNotExist(moduleReference.String()) - } - return nil, err - } - if resp.Msg.RepositoryCommit == nil { - return nil, errors.New("empty response") - } - return bufmoduleref.NewModulePin( - moduleReference.Remote(), - moduleReference.Owner(), - moduleReference.Repository(), - "", // branch - resp.Msg.RepositoryCommit.Name, - resp.Msg.RepositoryCommit.ManifestDigest, - resp.Msg.RepositoryCommit.CreateTime.AsTime(), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/usage.gen.go deleted file mode 100644 index 17c9c3b043..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufapimodule/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufapimodule - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreaking.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreaking.go deleted file mode 100644 index 9621679ec3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreaking.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufbreaking contains the breaking change detection functionality. -// -// The primary entry point to this package is the Handler. -package bufbreaking - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" -) - -// Handler handles the main breaking functionality. -type Handler interface { - // Check runs the breaking checks. - // - // The image should have source code info for this to work properly. The previousImage - // does not need to have source code info. - // - // Images should be filtered with regards to imports before passing to this function. - Check( - ctx context.Context, - config *bufbreakingconfig.Config, - previousImage bufimage.Image, - image bufimage.Image, - ) ([]bufanalysis.FileAnnotation, error) -} - -// NewHandler returns a new Handler. -func NewHandler(logger *zap.Logger) Handler { - return newHandler(logger) -} - -// RulesForConfig returns the rules for a given config. -// -// Should only be used for printing. -func RulesForConfig(config *bufbreakingconfig.Config) ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig(config) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesV1Beta1 gets all known rules. -// -// Should only be used for printing. -func GetAllRulesV1Beta1() ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig( - &bufbreakingconfig.Config{ - Use: internal.AllIDsForVersionSpec(bufbreakingv1beta1.VersionSpec), - Version: bufconfig.V1Beta1Version, - }, - ) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesV1 gets all known rules. -// -// Should only be used for printing. -func GetAllRulesV1() ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig( - &bufbreakingconfig.Config{ - Use: internal.AllIDsForVersionSpec(bufbreakingv1.VersionSpec), - Version: bufconfig.V1Version, - }, - ) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesAndCategoriesV1Beta1 returns all rules and categories for v1beta1 as a string slice. -// -// This is used for validation purposes only. -func GetAllRulesAndCategoriesV1Beta1() []string { - return internal.AllCategoriesAndIDsForVersionSpec(bufbreakingv1beta1.VersionSpec) -} - -// GetAllRulesAndCategoriesV1 returns all rules and categories for v1 as a string slice. -// -// This is used for validation purposes only. -func GetAllRulesAndCategoriesV1() []string { - return internal.AllCategoriesAndIDsForVersionSpec(bufbreakingv1.VersionSpec) -} - -func internalConfigForConfig(config *bufbreakingconfig.Config) (*internal.Config, error) { - var versionSpec *internal.VersionSpec - switch config.Version { - case bufconfig.V1Beta1Version: - versionSpec = bufbreakingv1beta1.VersionSpec - case bufconfig.V1Version: - versionSpec = bufbreakingv1.VersionSpec - } - return internal.ConfigBuilder{ - Use: config.Use, - Except: config.Except, - IgnoreRootPaths: config.IgnoreRootPaths, - IgnoreIDOrCategoryToRootPaths: config.IgnoreIDOrCategoryToRootPaths, - IgnoreUnstablePackages: config.IgnoreUnstablePackages, - }.NewConfig( - versionSpec, - ) -} - -func rulesForInternalRules(rules []*internal.Rule) []bufcheck.Rule { - if rules == nil { - return nil - } - s := make([]bufcheck.Rule, len(rules)) - for i, e := range rules { - s[i] = e - } - return s -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/bufbreakingconfig.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/bufbreakingconfig.go deleted file mode 100644 index 9b19fd2382..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/bufbreakingconfig.go +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufbreakingconfig - -import ( - "encoding/json" - "sort" - - breakingv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1" -) - -const ( - // These versions match the versions in bufconfig. We cannot take an explicit dependency - // on bufconfig without creating a circular dependency. - v1Beta1Version = "v1beta1" - v1Version = "v1" -) - -// Config is the breaking check config. -type Config struct { - // Use is a list of the rule and/or category IDs that are included in the breaking change check. - Use []string - // Except is a list of the rule and/or category IDs that are excluded from the breaking change check. - Except []string - // IgnoreRootPaths is a list of the paths of directories and/or files that should be ignored by the breaking change check. - // All paths are relative to the root of the module. - IgnoreRootPaths []string - // IgnoreIDOrCategoryToRootPaths is a map of rule and/or category IDs to directory and/or file paths to exclude from the - // breaking change check. - IgnoreIDOrCategoryToRootPaths map[string][]string - // IgnoreUnstablePackages ignores packages with a last component that is one of the unstable forms recognised - // by the PACKAGE_VERSION_SUFFIX: - // v\d+test.* - // v\d+(alpha|beta)\d+ - // v\d+p\d+(alpha|beta)\d+ - IgnoreUnstablePackages bool - // Version represents the version of the breaking change rule and category IDs that should be used with this config. - Version string -} - -// NewConfigV1Beta1 returns a new Config. -func NewConfigV1Beta1(externalConfig ExternalConfigV1Beta1) *Config { - return &Config{ - Use: externalConfig.Use, - Except: externalConfig.Except, - IgnoreRootPaths: externalConfig.Ignore, - IgnoreIDOrCategoryToRootPaths: externalConfig.IgnoreOnly, - IgnoreUnstablePackages: externalConfig.IgnoreUnstablePackages, - Version: v1Beta1Version, - } -} - -// NewConfigV1 returns a new Config. -func NewConfigV1(externalConfig ExternalConfigV1) *Config { - return &Config{ - Use: externalConfig.Use, - Except: externalConfig.Except, - IgnoreRootPaths: externalConfig.Ignore, - IgnoreIDOrCategoryToRootPaths: externalConfig.IgnoreOnly, - IgnoreUnstablePackages: externalConfig.IgnoreUnstablePackages, - Version: v1Version, - } -} - -// ConfigForProto returns the Config given the proto. -func ConfigForProto(protoConfig *breakingv1.Config) *Config { - return &Config{ - Use: protoConfig.GetUseIds(), - Except: protoConfig.GetExceptIds(), - IgnoreRootPaths: protoConfig.GetIgnorePaths(), - IgnoreIDOrCategoryToRootPaths: ignoreIDOrCategoryToRootPathsForProto(protoConfig.GetIgnoreIdPaths()), - IgnoreUnstablePackages: protoConfig.GetIgnoreUnstablePackages(), - Version: protoConfig.GetVersion(), - } -} - -// ProtoForConfig takes a *Config and returns the proto representation. -func ProtoForConfig(config *Config) *breakingv1.Config { - return &breakingv1.Config{ - UseIds: config.Use, - ExceptIds: config.Except, - IgnorePaths: config.IgnoreRootPaths, - IgnoreIdPaths: protoForIgnoreIDOrCategoryToRootPaths(config.IgnoreIDOrCategoryToRootPaths), - IgnoreUnstablePackages: config.IgnoreUnstablePackages, - Version: config.Version, - } -} - -// ExternalConfigV1Beta1 is an external config. -type ExternalConfigV1Beta1 struct { - Use []string `json:"use,omitempty" yaml:"use,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - // IgnoreRootPaths - Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"` - // IgnoreIDOrCategoryToRootPaths - IgnoreOnly map[string][]string `json:"ignore_only,omitempty" yaml:"ignore_only,omitempty"` - IgnoreUnstablePackages bool `json:"ignore_unstable_packages,omitempty" yaml:"ignore_unstable_packages,omitempty"` -} - -// ExternalConfigV1 is an external config. -type ExternalConfigV1 struct { - Use []string `json:"use,omitempty" yaml:"use,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - // IgnoreRootPaths - Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"` - // IgnoreIDOrCategoryToRootPaths - IgnoreOnly map[string][]string `json:"ignore_only,omitempty" yaml:"ignore_only,omitempty"` - IgnoreUnstablePackages bool `json:"ignore_unstable_packages,omitempty" yaml:"ignore_unstable_packages,omitempty"` -} - -// ExternalConfigV1Beta1ForConfig takes a *Config and returns the v1beta1 external config representation. -func ExternalConfigV1Beta1ForConfig(config *Config) ExternalConfigV1Beta1 { - return ExternalConfigV1Beta1{ - Use: config.Use, - Except: config.Except, - Ignore: config.IgnoreRootPaths, - IgnoreOnly: config.IgnoreIDOrCategoryToRootPaths, - IgnoreUnstablePackages: config.IgnoreUnstablePackages, - } -} - -// ExternalConfigV1ForConfig takes a *Config and returns the v1 external config representation. -func ExternalConfigV1ForConfig(config *Config) ExternalConfigV1 { - return ExternalConfigV1{ - Use: config.Use, - Except: config.Except, - Ignore: config.IgnoreRootPaths, - IgnoreOnly: config.IgnoreIDOrCategoryToRootPaths, - IgnoreUnstablePackages: config.IgnoreUnstablePackages, - } -} - -// BytesForConfig takes a *Config and returns the deterministic []byte representation. -// We use an unexported intermediary JSON form and sort all fields to ensure that the bytes -// associated with the *Config are deterministic. -func BytesForConfig(config *Config) ([]byte, error) { - if config == nil { - return nil, nil - } - return json.Marshal(configToJSON(config)) -} - -type configJSON struct { - Use []string `json:"use,omitempty"` - Except []string `json:"except,omitempty"` - IgnoreRootPaths []string `json:"ignore_root_paths,omitempty"` - IgnoreIDOrCategoryToRootPaths []idPathsJSON `json:"ignore_id_to_root_paths,omitempty"` - IgnoreUnstablePackages bool `json:"ignore_unstable_packages,omitempty"` - Version string `json:"version,omitempty"` -} - -type idPathsJSON struct { - ID string `json:"id,omitempty"` - Paths []string `json:"paths,omitempty"` -} - -func configToJSON(config *Config) *configJSON { - ignoreIDPathsJSON := make([]idPathsJSON, 0, len(config.IgnoreIDOrCategoryToRootPaths)) - for ignoreID, rootPaths := range config.IgnoreIDOrCategoryToRootPaths { - rootPathsCopy := make([]string, len(rootPaths)) - copy(rootPathsCopy, rootPaths) - sort.Strings(rootPathsCopy) - ignoreIDPathsJSON = append(ignoreIDPathsJSON, idPathsJSON{ - ID: ignoreID, - Paths: rootPathsCopy, - }) - } - sort.Slice(ignoreIDPathsJSON, func(i, j int) bool { return ignoreIDPathsJSON[i].ID < ignoreIDPathsJSON[j].ID }) - // We should not be sorting in place for the config structure, since it will mutate the - // underlying config ordering. - use := make([]string, len(config.Use)) - copy(use, config.Use) - except := make([]string, len(config.Except)) - copy(except, config.Except) - ignoreRootPaths := make([]string, len(config.IgnoreRootPaths)) - copy(ignoreRootPaths, config.IgnoreRootPaths) - sort.Strings(use) - sort.Strings(except) - sort.Strings(ignoreRootPaths) - return &configJSON{ - Use: use, - Except: except, - IgnoreRootPaths: ignoreRootPaths, - IgnoreIDOrCategoryToRootPaths: ignoreIDPathsJSON, - IgnoreUnstablePackages: config.IgnoreUnstablePackages, - Version: config.Version, - } -} - -func ignoreIDOrCategoryToRootPathsForProto(protoIgnoreIDPaths []*breakingv1.IDPaths) map[string][]string { - if protoIgnoreIDPaths == nil { - return nil - } - ignoreIDOrCategoryToRootPaths := make(map[string][]string) - for _, protoIgnoreIDPath := range protoIgnoreIDPaths { - ignoreIDOrCategoryToRootPaths[protoIgnoreIDPath.GetId()] = protoIgnoreIDPath.GetPaths() - } - return ignoreIDOrCategoryToRootPaths -} - -func protoForIgnoreIDOrCategoryToRootPaths(ignoreIDOrCategoryToRootPaths map[string][]string) []*breakingv1.IDPaths { - if ignoreIDOrCategoryToRootPaths == nil { - return nil - } - idPathsProto := make([]*breakingv1.IDPaths, 0, len(ignoreIDOrCategoryToRootPaths)) - for id, paths := range ignoreIDOrCategoryToRootPaths { - idPathsProto = append(idPathsProto, &breakingv1.IDPaths{ - Id: id, - Paths: paths, - }) - } - return idPathsProto -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/usage.gen.go deleted file mode 100644 index 562511b3cd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreakingconfig - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/handler.go deleted file mode 100644 index f586e2dec8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/handler.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufbreaking - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/pkg/protosource" - "go.uber.org/zap" -) - -type handler struct { - logger *zap.Logger - runner *internal.Runner -} - -func newHandler( - logger *zap.Logger, -) *handler { - return &handler{ - logger: logger, - // comment ignores are not allowed for breaking changes - // so do not set the ignore prefix per the RunnerWithIgnorePrefix comments - runner: internal.NewRunner(logger), - } -} - -func (h *handler) Check( - ctx context.Context, - config *bufbreakingconfig.Config, - previousImage bufimage.Image, - image bufimage.Image, -) ([]bufanalysis.FileAnnotation, error) { - previousFiles, err := protosource.NewFilesUnstable(ctx, bufimageutil.NewInputFiles(previousImage.Files())...) - if err != nil { - return nil, err - } - files, err := protosource.NewFilesUnstable(ctx, bufimageutil.NewInputFiles(image.Files())...) - if err != nil { - return nil, err - } - internalConfig, err := internalConfigForConfig(config) - if err != nil { - return nil, err - } - return h.runner.Check(ctx, internalConfig, previousFiles, files) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/bufbreakingbuild.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/bufbreakingbuild.go deleted file mode 100644 index 5a3aea331d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/bufbreakingbuild.go +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufbreakingbuild contains the RuleBuilders used by bufbreakingv*. -// -// In the future, we can have multiple versions of a RuleBuilder here, and then -// include them separately in the bufbreakingv* packages. For example, FieldSameTypeRuleBuilder -// could be split into FieldSameTypeRuleBuilder/FieldSameTypeRuleBuilderV2 which handle -// primitives differently, and we could use the former in v1beta1, and the latter in v1. -package bufbreakingbuild - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" -) - -var ( - // EnumNoDeleteRuleBuilder is a rule builder. - EnumNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_NO_DELETE", - "enums are not deleted from a given file", - bufbreakingcheck.CheckEnumNoDelete, - ) - // EnumValueNoDeleteRuleBuilder is a rule builder. - EnumValueNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_NO_DELETE", - "enum values are not deleted from a given enum", - bufbreakingcheck.CheckEnumValueNoDelete, - ) - // EnumValueNoDeleteUnlessNameReservedRuleBuilder is a rule builder. - EnumValueNoDeleteUnlessNameReservedRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED", - "enum values are not deleted from a given enum unless the name is reserved", - bufbreakingcheck.CheckEnumValueNoDeleteUnlessNameReserved, - ) - // EnumValueNoDeleteUnlessNumberReservedRuleBuilder is a rule builder. - EnumValueNoDeleteUnlessNumberReservedRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED", - "enum values are not deleted from a given enum unless the number is reserved", - bufbreakingcheck.CheckEnumValueNoDeleteUnlessNumberReserved, - ) - // EnumValueSameNameRuleBuilder is a rule builder. - EnumValueSameNameRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_SAME_NAME", - "enum values have the same name", - bufbreakingcheck.CheckEnumValueSameName, - ) - // ExtensionMessageNoDeleteRuleBuilder is a rule builder. - ExtensionMessageNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "EXTENSION_MESSAGE_NO_DELETE", - "extension ranges are not deleted from a given message", - bufbreakingcheck.CheckExtensionMessageNoDelete, - ) - // FieldNoDeleteRuleBuilder is a rule builder. - FieldNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_NO_DELETE", - "fields are not deleted from a given message", - bufbreakingcheck.CheckFieldNoDelete, - ) - // FieldNoDeleteUnlessNameReservedRuleBuilder is a rule builder. - FieldNoDeleteUnlessNameReservedRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_NO_DELETE_UNLESS_NAME_RESERVED", - "fields are not deleted from a given message unless the name is reserved", - bufbreakingcheck.CheckFieldNoDeleteUnlessNameReserved, - ) - // FieldNoDeleteUnlessNumberReservedRuleBuilder is a rule builder. - FieldNoDeleteUnlessNumberReservedRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED", - "fields are not deleted from a given message unless the number is reserved", - bufbreakingcheck.CheckFieldNoDeleteUnlessNumberReserved, - ) - // FieldSameCTypeRuleBuilder is a rule builder. - FieldSameCTypeRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_CTYPE", - "fields have the same value for the ctype option", - bufbreakingcheck.CheckFieldSameCType, - ) - // FieldSameJSONNameRuleBuilder is a rule builder. - FieldSameJSONNameRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_JSON_NAME", - "fields have the same value for the json_name option", - bufbreakingcheck.CheckFieldSameJSONName, - ) - // FieldSameJSTypeRuleBuilder is a rule builder. - FieldSameJSTypeRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_JSTYPE", - "fields have the same value for the jstype option", - bufbreakingcheck.CheckFieldSameJSType, - ) - // FieldSameLabelRuleBuilder is a rule builder. - FieldSameLabelRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_LABEL", - "fields have the same labels in a given message", - bufbreakingcheck.CheckFieldSameLabel, - ) - // FieldSameNameRuleBuilder is a rule builder. - FieldSameNameRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_NAME", - "fields have the same names in a given message", - bufbreakingcheck.CheckFieldSameName, - ) - // FieldSameOneofRuleBuilder is a rule builder. - FieldSameOneofRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_ONEOF", - "fields have the same oneofs in a given message", - bufbreakingcheck.CheckFieldSameOneof, - ) - // FieldSameTypeRuleBuilder is a rule builder. - FieldSameTypeRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_SAME_TYPE", - "fields have the same types in a given message", - bufbreakingcheck.CheckFieldSameType, - ) - // FieldWireCompatibleTypeRuleBuilder is a rule builder. - FieldWireCompatibleTypeRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_WIRE_COMPATIBLE_TYPE", - "fields have wire-compatible types in a given message", - bufbreakingcheck.CheckFieldWireCompatibleType, - ) - // FieldWireJSONCompatibleTypeRuleBuilder is a rule builder. - FieldWireJSONCompatibleTypeRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_WIRE_JSON_COMPATIBLE_TYPE", - "fields have wire and JSON compatible types in a given message", - bufbreakingcheck.CheckFieldWireJSONCompatibleType, - ) - // FileNoDeleteRuleBuilder is a rule builder. - FileNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "FILE_NO_DELETE", - "files are not deleted", - bufbreakingcheck.CheckFileNoDelete, - ) - // FileSameCsharpNamespaceRuleBuilder is a rule builder. - FileSameCsharpNamespaceRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_CSHARP_NAMESPACE", - "files have the same value for the csharp_namespace option", - bufbreakingcheck.CheckFileSameCsharpNamespace, - ) - // FileSameGoPackageRuleBuilder is a rule builder. - FileSameGoPackageRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_GO_PACKAGE", - "files have the same value for the go_package option", - bufbreakingcheck.CheckFileSameGoPackage, - ) - // FileSameJavaMultipleFilesRuleBuilder is a rule builder. - FileSameJavaMultipleFilesRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_JAVA_MULTIPLE_FILES", - "files have the same value for the java_multiple_files option", - bufbreakingcheck.CheckFileSameJavaMultipleFiles, - ) - // FileSameJavaOuterClassnameRuleBuilder is a rule builder. - FileSameJavaOuterClassnameRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_JAVA_OUTER_CLASSNAME", - "files have the same value for the java_outer_classname option", - bufbreakingcheck.CheckFileSameJavaOuterClassname, - ) - // FileSameJavaPackageRuleBuilder is a rule builder. - FileSameJavaPackageRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_JAVA_PACKAGE", - "files have the same value for the java_package option", - bufbreakingcheck.CheckFileSameJavaPackage, - ) - // FileSameJavaStringCheckUtf8RuleBuilder is a rule builder. - FileSameJavaStringCheckUtf8RuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_JAVA_STRING_CHECK_UTF8", - "files have the same value for the java_string_check_utf8 option", - bufbreakingcheck.CheckFileSameJavaStringCheckUtf8, - ) - // FileSameObjcClassPrefixRuleBuilder is a rule builder. - FileSameObjcClassPrefixRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_OBJC_CLASS_PREFIX", - "files have the same value for the objc_class_prefix option", - bufbreakingcheck.CheckFileSameObjcClassPrefix, - ) - // FileSamePackageRuleBuilder is a rule builder. - FileSamePackageRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PACKAGE", - "files have the same package", - bufbreakingcheck.CheckFileSamePackage, - ) - // FileSamePhpClassPrefixRuleBuilder is a rule builder. - FileSamePhpClassPrefixRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PHP_CLASS_PREFIX", - "files have the same value for the php_class_prefix option", - bufbreakingcheck.CheckFileSamePhpClassPrefix, - ) - // FileSamePhpMetadataNamespaceRuleBuilder is a rule builder. - FileSamePhpMetadataNamespaceRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PHP_METADATA_NAMESPACE", - "files have the same value for the php_metadata_namespace option", - bufbreakingcheck.CheckFileSamePhpMetadataNamespace, - ) - // FileSamePhpNamespaceRuleBuilder is a rule builder. - FileSamePhpNamespaceRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PHP_NAMESPACE", - "files have the same value for the php_namespace option", - bufbreakingcheck.CheckFileSamePhpNamespace, - ) - // FileSameRubyPackageRuleBuilder is a rule builder. - FileSameRubyPackageRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_RUBY_PACKAGE", - "files have the same value for the ruby_package option", - bufbreakingcheck.CheckFileSameRubyPackage, - ) - // FileSameSwiftPrefixRuleBuilder is a rule builder. - FileSameSwiftPrefixRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_SWIFT_PREFIX", - "files have the same value for the swift_prefix option", - bufbreakingcheck.CheckFileSameSwiftPrefix, - ) - // FileSameOptimizeForRuleBuilder is a rule builder. - FileSameOptimizeForRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_OPTIMIZE_FOR", - "files have the same value for the optimize_for option", - bufbreakingcheck.CheckFileSameOptimizeFor, - ) - // FileSameCcGenericServicesRuleBuilder is a rule builder. - FileSameCcGenericServicesRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_CC_GENERIC_SERVICES", - "files have the same value for the cc_generic_services option", - bufbreakingcheck.CheckFileSameCcGenericServices, - ) - // FileSameJavaGenericServicesRuleBuilder is a rule builder. - FileSameJavaGenericServicesRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_JAVA_GENERIC_SERVICES", - "files have the same value for the java_generic_services option", - bufbreakingcheck.CheckFileSameJavaGenericServices, - ) - // FileSamePyGenericServicesRuleBuilder is a rule builder. - FileSamePyGenericServicesRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PY_GENERIC_SERVICES", - "files have the same value for the py_generic_services option", - bufbreakingcheck.CheckFileSamePyGenericServices, - ) - // FileSamePhpGenericServicesRuleBuilder is a rule builder. - FileSamePhpGenericServicesRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_PHP_GENERIC_SERVICES", - "files have the same value for the php_generic_services option", - bufbreakingcheck.CheckFileSamePhpGenericServices, - ) - // FileSameCcEnableArenasRuleBuilder is a rule builder. - FileSameCcEnableArenasRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_CC_ENABLE_ARENAS", - "files have the same value for the cc_enable_arenas option", - bufbreakingcheck.CheckFileSameCcEnableArenas, - ) - // FileSameSyntaxRuleBuilder is a rule builder. - FileSameSyntaxRuleBuilder = internal.NewNopRuleBuilder( - "FILE_SAME_SYNTAX", - "files have the same syntax", - bufbreakingcheck.CheckFileSameSyntax, - ) - // MessageNoDeleteRuleBuilder is a rule builder. - MessageNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "MESSAGE_NO_DELETE", - "messages are not deleted from a given file", - bufbreakingcheck.CheckMessageNoDelete, - ) - // MessageNoRemoveStandardDescriptorAccessorRuleBuilder is a rule builder. - MessageNoRemoveStandardDescriptorAccessorRuleBuilder = internal.NewNopRuleBuilder( - "MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR", - "messages do not change the no_standard_descriptor_accessor option from false or unset to true", - bufbreakingcheck.CheckMessageNoRemoveStandardDescriptorAccessor, - ) - // MessageSameMessageSetWireFormatRuleBuilder is a rule builder. - MessageSameMessageSetWireFormatRuleBuilder = internal.NewNopRuleBuilder( - "MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT", - "messages have the same value for the message_set_wire_format option", - bufbreakingcheck.CheckMessageSameMessageSetWireFormat, - ) - // MessageSameRequiredFieldsRuleBuilder is a rule builder. - MessageSameRequiredFieldsRuleBuilder = internal.NewNopRuleBuilder( - "MESSAGE_SAME_REQUIRED_FIELDS", - "messages have no added or deleted required fields", - bufbreakingcheck.CheckMessageSameRequiredFields, - ) - // OneofNoDeleteRuleBuilder is a rule builder. - OneofNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "ONEOF_NO_DELETE", - "oneofs are not deleted from a given message", - bufbreakingcheck.CheckOneofNoDelete, - ) - // PackageEnumNoDeleteRuleBuilder is a rule builder. - PackageEnumNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_ENUM_NO_DELETE", - "enums are not deleted from a given package", - bufbreakingcheck.CheckPackageEnumNoDelete, - ) - // PackageMessageNoDeleteRuleBuilder is a rule builder. - PackageMessageNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_MESSAGE_NO_DELETE", - "messages are not deleted from a given package", - bufbreakingcheck.CheckPackageMessageNoDelete, - ) - // PackageNoDeleteRuleBuilder is a rule builder. - PackageNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_NO_DELETE", - "packages are not deleted", - bufbreakingcheck.CheckPackageNoDelete, - ) - // PackageServiceNoDeleteRuleBuilder is a rule builder. - PackageServiceNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SERVICE_NO_DELETE", - "services are not deleted from a given package", - bufbreakingcheck.CheckPackageServiceNoDelete, - ) - // ReservedEnumNoDeleteRuleBuilder is a rule builder. - ReservedEnumNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "RESERVED_ENUM_NO_DELETE", - "reserved ranges and names are not deleted from a given enum", - bufbreakingcheck.CheckReservedEnumNoDelete, - ) - // ReservedMessageNoDeleteRuleBuilder is a rule builder. - ReservedMessageNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "RESERVED_MESSAGE_NO_DELETE", - "reserved ranges and names are not deleted from a given message", - bufbreakingcheck.CheckReservedMessageNoDelete, - ) - // RPCNoDeleteRuleBuilder is a rule builder. - RPCNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "RPC_NO_DELETE", - "rpcs are not deleted from a given service", - bufbreakingcheck.CheckRPCNoDelete, - ) - // RPCSameClientStreamingRuleBuilder is a rule builder. - RPCSameClientStreamingRuleBuilder = internal.NewNopRuleBuilder( - "RPC_SAME_CLIENT_STREAMING", - "rpcs have the same client streaming value", - bufbreakingcheck.CheckRPCSameClientStreaming, - ) - // RPCSameIdempotencyLevelRuleBuilder is a rule builder. - RPCSameIdempotencyLevelRuleBuilder = internal.NewNopRuleBuilder( - "RPC_SAME_IDEMPOTENCY_LEVEL", - "rpcs have the same value for the idempotency_level option", - bufbreakingcheck.CheckRPCSameIdempotencyLevel, - ) - // RPCSameRequestTypeRuleBuilder is a rule builder. - RPCSameRequestTypeRuleBuilder = internal.NewNopRuleBuilder( - "RPC_SAME_REQUEST_TYPE", - "rpcs are have the same request type", - bufbreakingcheck.CheckRPCSameRequestType, - ) - // RPCSameResponseTypeRuleBuilder is a rule builder. - RPCSameResponseTypeRuleBuilder = internal.NewNopRuleBuilder( - "RPC_SAME_RESPONSE_TYPE", - "rpcs are have the same response type", - bufbreakingcheck.CheckRPCSameResponseType, - ) - // RPCSameServerStreamingRuleBuilder is a rule builder. - RPCSameServerStreamingRuleBuilder = internal.NewNopRuleBuilder( - "RPC_SAME_SERVER_STREAMING", - "rpcs have the same server streaming value", - bufbreakingcheck.CheckRPCSameServerStreaming, - ) - // ServiceNoDeleteRuleBuilder is a rule builder. - ServiceNoDeleteRuleBuilder = internal.NewNopRuleBuilder( - "SERVICE_NO_DELETE", - "services are not deleted from a given file", - bufbreakingcheck.CheckServiceNoDelete, - ) -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/usage.gen.go deleted file mode 100644 index 2e27ba1d08..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreakingbuild - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/bufbreakingcheck.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/bufbreakingcheck.go deleted file mode 100644 index e950502465..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/bufbreakingcheck.go +++ /dev/null @@ -1,1105 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufbreakingcheck impelements the check functions. -// -// These are used by bufbreakingbuild to create RuleBuilders. -package bufbreakingcheck - -import ( - "errors" - "fmt" - "strconv" - "strings" - - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "github.com/bufbuild/buf/private/pkg/protosource" - "github.com/bufbuild/buf/private/pkg/stringutil" - "google.golang.org/protobuf/types/descriptorpb" -) - -// CheckEnumNoDelete is a check function. -var CheckEnumNoDelete = newFilePairCheckFunc(checkEnumNoDelete) - -func checkEnumNoDelete(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - previousNestedNameToEnum, err := protosource.NestedNameToEnum(previousFile) - if err != nil { - return err - } - nestedNameToEnum, err := protosource.NestedNameToEnum(file) - if err != nil { - return err - } - for previousNestedName := range previousNestedNameToEnum { - if _, ok := nestedNameToEnum[previousNestedName]; !ok { - // TODO: search for enum in other files and return that the enum was moved? - descriptor, location, err := getDescriptorAndLocationForDeletedEnum(file, previousNestedName) - if err != nil { - return err - } - add(descriptor, nil, location, `Previously present enum %q was deleted from file.`, previousNestedName) - } - } - return nil -} - -// CheckEnumValueNoDelete is a check function. -var CheckEnumValueNoDelete = newEnumPairCheckFunc(checkEnumValueNoDelete) - -func checkEnumValueNoDelete(add addFunc, corpus *corpus, previousEnum protosource.Enum, enum protosource.Enum) error { - return checkEnumValueNoDeleteWithRules(add, previousEnum, enum, false, false) -} - -// CheckEnumValueNoDeleteUnlessNumberReserved is a check function. -var CheckEnumValueNoDeleteUnlessNumberReserved = newEnumPairCheckFunc(checkEnumValueNoDeleteUnlessNumberReserved) - -func checkEnumValueNoDeleteUnlessNumberReserved(add addFunc, corpus *corpus, previousEnum protosource.Enum, enum protosource.Enum) error { - return checkEnumValueNoDeleteWithRules(add, previousEnum, enum, true, false) -} - -// CheckEnumValueNoDeleteUnlessNameReserved is a check function. -var CheckEnumValueNoDeleteUnlessNameReserved = newEnumPairCheckFunc(checkEnumValueNoDeleteUnlessNameReserved) - -func checkEnumValueNoDeleteUnlessNameReserved(add addFunc, corpus *corpus, previousEnum protosource.Enum, enum protosource.Enum) error { - return checkEnumValueNoDeleteWithRules(add, previousEnum, enum, false, true) -} - -func checkEnumValueNoDeleteWithRules(add addFunc, previousEnum protosource.Enum, enum protosource.Enum, allowIfNumberReserved bool, allowIfNameReserved bool) error { - previousNumberToNameToEnumValue, err := protosource.NumberToNameToEnumValue(previousEnum) - if err != nil { - return err - } - numberToNameToEnumValue, err := protosource.NumberToNameToEnumValue(enum) - if err != nil { - return err - } - for previousNumber, previousNameToEnumValue := range previousNumberToNameToEnumValue { - if _, ok := numberToNameToEnumValue[previousNumber]; !ok { - if !isDeletedEnumValueAllowedWithRules(previousNumber, previousNameToEnumValue, enum, allowIfNumberReserved, allowIfNameReserved) { - suffix := "" - if allowIfNumberReserved && allowIfNameReserved { - return errors.New("both allowIfNumberReserved and allowIfNameReserved set") - } - if allowIfNumberReserved { - suffix = fmt.Sprintf(` without reserving the number "%d"`, previousNumber) - } - if allowIfNameReserved { - nameSuffix := "" - if len(previousNameToEnumValue) > 1 { - nameSuffix = "s" - } - suffix = fmt.Sprintf(` without reserving the name%s %s`, nameSuffix, stringutil.JoinSliceQuoted(getSortedEnumValueNames(previousNameToEnumValue), ", ")) - } - add(enum, nil, enum.Location(), `Previously present enum value "%d" on enum %q was deleted%s.`, previousNumber, enum.Name(), suffix) - } - } - } - return nil -} - -func isDeletedEnumValueAllowedWithRules(previousNumber int, previousNameToEnumValue map[string]protosource.EnumValue, enum protosource.Enum, allowIfNumberReserved bool, allowIfNameReserved bool) bool { - if allowIfNumberReserved { - return protosource.NumberInReservedRanges(previousNumber, enum.ReservedTagRanges()...) - } - if allowIfNameReserved { - // if true for all names, then ok - for previousName := range previousNameToEnumValue { - if !protosource.NameInReservedNames(previousName, enum.ReservedNames()...) { - return false - } - } - return true - } - return false -} - -// CheckEnumValueSameName is a check function. -var CheckEnumValueSameName = newEnumValuePairCheckFunc(checkEnumValueSameName) - -func checkEnumValueSameName(add addFunc, corpus *corpus, previousNameToEnumValue map[string]protosource.EnumValue, nameToEnumValue map[string]protosource.EnumValue) error { - previousNames := getSortedEnumValueNames(previousNameToEnumValue) - names := getSortedEnumValueNames(nameToEnumValue) - // all current names for this number need to be in the previous set - // ie if you now have FOO=2, BAR=2, you need to have had FOO=2, BAR=2 previously - // FOO=2, BAR=2, BAZ=2 now would pass - // FOO=2, BAR=2, BAZ=2 previously would fail - if !stringutil.SliceElementsContained(names, previousNames) { - previousNamesString := stringutil.JoinSliceQuoted(previousNames, ", ") - namesString := stringutil.JoinSliceQuoted(names, ", ") - nameSuffix := "" - if len(previousNames) > 1 && len(names) > 1 { - nameSuffix = "s" - } - for _, enumValue := range nameToEnumValue { - add(enumValue, nil, enumValue.NumberLocation(), `Enum value "%d" on enum %q changed name%s from %s to %s.`, enumValue.Number(), enumValue.Enum().Name(), nameSuffix, previousNamesString, namesString) - } - } - return nil -} - -// CheckExtensionMessageNoDelete is a check function. -var CheckExtensionMessageNoDelete = newMessagePairCheckFunc(checkExtensionMessageNoDelete) - -func checkExtensionMessageNoDelete(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previousStringToExtensionRange := protosource.StringToExtensionMessageRange(previousMessage) - stringToExtensionRange := protosource.StringToExtensionMessageRange(message) - for previousString := range previousStringToExtensionRange { - if _, ok := stringToExtensionRange[previousString]; !ok { - add(message, nil, message.Location(), `Previously present extension range %q on message %q was deleted.`, previousString, message.Name()) - } - } - return nil -} - -// CheckFieldNoDelete is a check function. -var CheckFieldNoDelete = newMessagePairCheckFunc(checkFieldNoDelete) - -func checkFieldNoDelete(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - return checkFieldNoDeleteWithRules(add, previousMessage, message, false, false) -} - -// CheckFieldNoDeleteUnlessNumberReserved is a check function. -var CheckFieldNoDeleteUnlessNumberReserved = newMessagePairCheckFunc(checkFieldNoDeleteUnlessNumberReserved) - -func checkFieldNoDeleteUnlessNumberReserved(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - return checkFieldNoDeleteWithRules(add, previousMessage, message, true, false) -} - -// CheckFieldNoDeleteUnlessNameReserved is a check function. -var CheckFieldNoDeleteUnlessNameReserved = newMessagePairCheckFunc(checkFieldNoDeleteUnlessNameReserved) - -func checkFieldNoDeleteUnlessNameReserved(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - return checkFieldNoDeleteWithRules(add, previousMessage, message, false, true) -} - -func checkFieldNoDeleteWithRules(add addFunc, previousMessage protosource.Message, message protosource.Message, allowIfNumberReserved bool, allowIfNameReserved bool) error { - previousNumberToField, err := protosource.NumberToMessageField(previousMessage) - if err != nil { - return err - } - numberToField, err := protosource.NumberToMessageField(message) - if err != nil { - return err - } - for previousNumber, previousField := range previousNumberToField { - if _, ok := numberToField[previousNumber]; !ok { - if !isDeletedFieldAllowedWithRules(previousField, message, allowIfNumberReserved, allowIfNameReserved) { - // otherwise prints as hex - previousNumberString := strconv.FormatInt(int64(previousNumber), 10) - suffix := "" - if allowIfNumberReserved && allowIfNameReserved { - return errors.New("both allowIfNumberReserved and allowIfNameReserved set") - } - if allowIfNumberReserved { - suffix = fmt.Sprintf(` without reserving the number "%d"`, previousField.Number()) - } - if allowIfNameReserved { - suffix = fmt.Sprintf(` without reserving the name %q`, previousField.Name()) - } - add(message, nil, message.Location(), `Previously present field %q with name %q on message %q was deleted%s.`, previousNumberString, previousField.Name(), message.Name(), suffix) - } - } - } - return nil -} - -func isDeletedFieldAllowedWithRules(previousField protosource.Field, message protosource.Message, allowIfNumberReserved bool, allowIfNameReserved bool) bool { - return (allowIfNumberReserved && protosource.NumberInReservedRanges(previousField.Number(), message.ReservedTagRanges()...)) || - (allowIfNameReserved && protosource.NameInReservedNames(previousField.Name(), message.ReservedNames()...)) -} - -// CheckFieldSameCType is a check function. -var CheckFieldSameCType = newFieldPairCheckFunc(checkFieldSameCType) - -func checkFieldSameCType(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.CType() != field.CType() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, withBackupLocation(field.CTypeLocation(), field.Location()), `Field %q with name %q on message %q changed option "ctype" from %q to %q.`, numberString, field.Name(), field.Message().Name(), previousField.CType().String(), field.CType().String()) - } - return nil -} - -// CheckFieldSameJSONName is a check function. -var CheckFieldSameJSONName = newFieldPairCheckFunc(checkFieldSameJSONName) - -func checkFieldSameJSONName(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.JSONName() != field.JSONName() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, withBackupLocation(field.JSONNameLocation(), field.Location()), `Field %q with name %q on message %q changed option "json_name" from %q to %q.`, numberString, field.Name(), field.Message().Name(), previousField.JSONName(), field.JSONName()) - } - return nil -} - -// CheckFieldSameJSType is a check function. -var CheckFieldSameJSType = newFieldPairCheckFunc(checkFieldSameJSType) - -func checkFieldSameJSType(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.JSType() != field.JSType() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, withBackupLocation(field.JSTypeLocation(), field.Location()), `Field %q with name %q on message %q changed option "jstype" from %q to %q.`, numberString, field.Name(), field.Message().Name(), previousField.JSType().String(), field.JSType().String()) - } - return nil -} - -// CheckFieldSameLabel is a check function. -var CheckFieldSameLabel = newFieldPairCheckFunc(checkFieldSameLabel) - -func checkFieldSameLabel(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.Label() != field.Label() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - // TODO: specific label location - add(field, nil, field.Location(), `Field %q on message %q changed label from %q to %q.`, numberString, field.Message().Name(), protodescriptor.FieldDescriptorProtoLabelPrettyString(previousField.Label()), protodescriptor.FieldDescriptorProtoLabelPrettyString(field.Label())) - } - return nil -} - -// CheckFieldSameName is a check function. -var CheckFieldSameName = newFieldPairCheckFunc(checkFieldSameName) - -func checkFieldSameName(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.Name() != field.Name() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, field.NameLocation(), `Field %q on message %q changed name from %q to %q.`, numberString, field.Message().Name(), previousField.Name(), field.Name()) - } - return nil -} - -// CheckFieldSameOneof is a check function. -var CheckFieldSameOneof = newFieldPairCheckFunc(checkFieldSameOneof) - -func checkFieldSameOneof(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - previousOneof := previousField.Oneof() - oneof := field.Oneof() - previousInsideOneof := previousOneof != nil - insideOneof := oneof != nil - if !previousInsideOneof && !insideOneof { - return nil - } - if previousInsideOneof && insideOneof { - if previousOneof.Name() != oneof.Name() { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, field.Location(), `Field %q on message %q moved from oneof %q to oneof %q.`, numberString, field.Message().Name(), previousOneof.Name(), oneof.Name()) - } - return nil - } - - previous := "inside" - current := "outside" - if insideOneof { - previous = "outside" - current = "inside" - } - // otherwise prints as hex - numberString := strconv.FormatInt(int64(field.Number()), 10) - add(field, nil, field.Location(), `Field %q on message %q moved from %s to %s a oneof.`, numberString, field.Message().Name(), previous, current) - return nil -} - -// TODO: locations not working for map entries -// TODO: weird output for map entries: -// -// breaking_field_same_type/1.proto:1:1:Field "2" on message "SixEntry" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:1:1:Field "2" on message "SixEntry" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:1:1:Field "2" on message "SixEntry" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:8:3:Field "1" on message "Two" changed type from "int32" to "int64". -// breaking_field_same_type/1.proto:9:3:Field "2" on message "Two" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:11:3:Field "4" on message "Two" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:12:3:Field "5" on message "Two" changed type from ".a.Two.FiveEntry" to ".a.Two". -// breaking_field_same_type/1.proto:19:7:Field "1" on message "Five" changed type from "int32" to "int64". -// breaking_field_same_type/1.proto:20:7:Field "2" on message "Five" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:22:7:Field "4" on message "Five" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:23:7:Field "5" on message "Five" changed type from ".a.Three.Four.Five.FiveEntry" to ".a.Two". -// breaking_field_same_type/1.proto:36:5:Field "1" on message "Seven" changed type from "int32" to "int64". -// breaking_field_same_type/1.proto:37:5:Field "2" on message "Seven" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:39:5:Field "4" on message "Seven" changed type from ".a.One" to ".a.Two". -// breaking_field_same_type/1.proto:40:5:Field "5" on message "Seven" changed type from ".a.Three.Seven.FiveEntry" to ".a.Two". -// breaking_field_same_type/2.proto:64:5:Field "1" on message "Nine" changed type from "int32" to "int64". -// breaking_field_same_type/2.proto:65:5:Field "2" on message "Nine" changed type from ".a.One" to ".a.Nine". - -// CheckFieldSameType is a check function. -var CheckFieldSameType = newFieldPairCheckFunc(checkFieldSameType) - -func checkFieldSameType(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - if previousField.Type() != field.Type() { - addFieldChangedType(add, previousField, field) - return nil - } - - switch field.Type() { - case descriptorpb.FieldDescriptorProto_TYPE_ENUM, - descriptorpb.FieldDescriptorProto_TYPE_GROUP, - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: - if previousField.TypeName() != field.TypeName() { - addEnumGroupMessageFieldChangedTypeName(add, previousField, field) - } - } - return nil -} - -// CheckFieldWireCompatibleType is a check function. -var CheckFieldWireCompatibleType = newFieldPairCheckFunc(checkFieldWireCompatibleType) - -func checkFieldWireCompatibleType(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - previousWireCompatibilityGroup, ok := fieldDescriptorProtoTypeToWireCompatiblityGroup[previousField.Type()] - if !ok { - return fmt.Errorf("unknown FieldDescriptorProtoType: %v", previousField.Type()) - } - wireCompatibilityGroup, ok := fieldDescriptorProtoTypeToWireCompatiblityGroup[field.Type()] - if !ok { - return fmt.Errorf("unknown FieldDescriptorProtoType: %v", field.Type()) - } - if previousWireCompatibilityGroup != wireCompatibilityGroup { - extraMessages := []string{ - "See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules.", - } - switch { - case previousField.Type() == descriptorpb.FieldDescriptorProto_TYPE_STRING && field.Type() == descriptorpb.FieldDescriptorProto_TYPE_BYTES: - // It is OK to evolve from string to bytes - return nil - case previousField.Type() == descriptorpb.FieldDescriptorProto_TYPE_BYTES && field.Type() == descriptorpb.FieldDescriptorProto_TYPE_STRING: - extraMessages = append( - extraMessages, - "Note that while string and bytes are compatible if the data is valid UTF-8, there is no way to enforce that a field is UTF-8, so these fields may be incompatible.", - ) - } - addFieldChangedType(add, previousField, field, extraMessages...) - return nil - } - switch field.Type() { - case descriptorpb.FieldDescriptorProto_TYPE_ENUM: - if previousField.TypeName() != field.TypeName() { - return checkEnumWireCompatibleForField(add, corpus, previousField, field) - } - case descriptorpb.FieldDescriptorProto_TYPE_GROUP, - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: - if previousField.TypeName() != field.TypeName() { - addEnumGroupMessageFieldChangedTypeName(add, previousField, field) - return nil - } - } - return nil -} - -// CheckFieldWireJSONCompatibleType is a check function. -var CheckFieldWireJSONCompatibleType = newFieldPairCheckFunc(checkFieldWireJSONCompatibleType) - -func checkFieldWireJSONCompatibleType(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - previousWireJSONCompatibilityGroup, ok := fieldDescriptorProtoTypeToWireJSONCompatiblityGroup[previousField.Type()] - if !ok { - return fmt.Errorf("unknown FieldDescriptorProtoType: %v", previousField.Type()) - } - wireJSONCompatibilityGroup, ok := fieldDescriptorProtoTypeToWireJSONCompatiblityGroup[field.Type()] - if !ok { - return fmt.Errorf("unknown FieldDescriptorProtoType: %v", field.Type()) - } - if previousWireJSONCompatibilityGroup != wireJSONCompatibilityGroup { - addFieldChangedType( - add, - previousField, - field, - "See https://developers.google.com/protocol-buffers/docs/proto3#updating for wire compatibility rules and https://developers.google.com/protocol-buffers/docs/proto3#json for JSON compatibility rules.", - ) - return nil - } - switch field.Type() { - case descriptorpb.FieldDescriptorProto_TYPE_ENUM: - if previousField.TypeName() != field.TypeName() { - return checkEnumWireCompatibleForField(add, corpus, previousField, field) - } - case descriptorpb.FieldDescriptorProto_TYPE_GROUP, - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: - if previousField.TypeName() != field.TypeName() { - addEnumGroupMessageFieldChangedTypeName(add, previousField, field) - return nil - } - } - return nil -} - -func checkEnumWireCompatibleForField(add addFunc, corpus *corpus, previousField protosource.Field, field protosource.Field) error { - previousEnum, err := getEnumByFullName( - corpus.previousFiles, - strings.TrimPrefix(previousField.TypeName(), "."), - ) - if err != nil { - return err - } - enum, err := getEnumByFullName( - corpus.files, - strings.TrimPrefix(field.TypeName(), "."), - ) - if err != nil { - return err - } - if previousEnum.Name() != enum.Name() { - // If the short names are not equal, we say that this is a different enum. - addEnumGroupMessageFieldChangedTypeName(add, previousField, field) - return nil - } - isSubset, err := protosource.EnumIsSubset(enum, previousEnum) - if err != nil { - return err - } - if !isSubset { - // If the previous enum is not a subset of the new enum, we say that - // this is a different enum. - // We allow subsets so that enum values can be added within the - // same change. - addEnumGroupMessageFieldChangedTypeName(add, previousField, field) - return nil - } - return nil -} - -func addFieldChangedType(add addFunc, previousField protosource.Field, field protosource.Field, extraMessages ...string) { - combinedExtraMessage := "" - if len(extraMessages) > 0 { - // protect against mistakenly added empty extra messages - if joined := strings.TrimSpace(strings.Join(extraMessages, " ")); joined != "" { - combinedExtraMessage = " " + joined - } - } - var fieldLocation protosource.Location - switch field.Type() { - case descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, - descriptorpb.FieldDescriptorProto_TYPE_ENUM, - descriptorpb.FieldDescriptorProto_TYPE_GROUP: - fieldLocation = field.TypeNameLocation() - default: - fieldLocation = field.TypeLocation() - } - // otherwise prints as hex - previousNumberString := strconv.FormatInt(int64(previousField.Number()), 10) - add( - field, - nil, - fieldLocation, - `Field %q on message %q changed type from %q to %q.%s`, - previousNumberString, - field.Message().Name(), - protodescriptor.FieldDescriptorProtoTypePrettyString(previousField.Type()), - protodescriptor.FieldDescriptorProtoTypePrettyString(field.Type()), - combinedExtraMessage, - ) -} - -func addEnumGroupMessageFieldChangedTypeName(add addFunc, previousField protosource.Field, field protosource.Field) { - // otherwise prints as hex - numberString := strconv.FormatInt(int64(previousField.Number()), 10) - add( - field, - nil, - field.TypeNameLocation(), - `Field %q on message %q changed type from %q to %q.`, - numberString, - field.Message().Name(), - strings.TrimPrefix(previousField.TypeName(), "."), - strings.TrimPrefix(field.TypeName(), "."), - ) -} - -// CheckFileNoDelete is a check function. -var CheckFileNoDelete = newFilesCheckFunc(checkFileNoDelete) - -func checkFileNoDelete(add addFunc, corpus *corpus) error { - previousFilePathToFile, err := protosource.FilePathToFile(corpus.previousFiles...) - if err != nil { - return err - } - filePathToFile, err := protosource.FilePathToFile(corpus.files...) - if err != nil { - return err - } - for previousFilePath, previousFile := range previousFilePathToFile { - if _, ok := filePathToFile[previousFilePath]; !ok { - // Add previous descriptor to check for ignores. This will mean that if - // we have ignore_unstable_packages set, this file will cause the ignore - // to happen. - add(nil, []protosource.Descriptor{previousFile}, nil, `Previously present file %q was deleted.`, previousFilePath) - } - } - return nil -} - -// CheckFileSameCsharpNamespace is a check function. -var CheckFileSameCsharpNamespace = newFilePairCheckFunc(checkFileSameCsharpNamespace) - -func checkFileSameCsharpNamespace(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.CsharpNamespace(), file.CsharpNamespace(), file, file.CsharpNamespaceLocation(), `option "csharp_namespace"`) -} - -// CheckFileSameGoPackage is a check function. -var CheckFileSameGoPackage = newFilePairCheckFunc(checkFileSameGoPackage) - -func checkFileSameGoPackage(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.GoPackage(), file.GoPackage(), file, file.GoPackageLocation(), `option "go_package"`) -} - -// CheckFileSameJavaMultipleFiles is a check function. -var CheckFileSameJavaMultipleFiles = newFilePairCheckFunc(checkFileSameJavaMultipleFiles) - -func checkFileSameJavaMultipleFiles(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.JavaMultipleFiles()), strconv.FormatBool(file.JavaMultipleFiles()), file, file.JavaMultipleFilesLocation(), `option "java_multiple_files"`) -} - -// CheckFileSameJavaOuterClassname is a check function. -var CheckFileSameJavaOuterClassname = newFilePairCheckFunc(checkFileSameJavaOuterClassname) - -func checkFileSameJavaOuterClassname(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.JavaOuterClassname(), file.JavaOuterClassname(), file, file.JavaOuterClassnameLocation(), `option "java_outer_classname"`) -} - -// CheckFileSameJavaPackage is a check function. -var CheckFileSameJavaPackage = newFilePairCheckFunc(checkFileSameJavaPackage) - -func checkFileSameJavaPackage(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.JavaPackage(), file.JavaPackage(), file, file.JavaPackageLocation(), `option "java_package"`) -} - -// CheckFileSameJavaStringCheckUtf8 is a check function. -var CheckFileSameJavaStringCheckUtf8 = newFilePairCheckFunc(checkFileSameJavaStringCheckUtf8) - -func checkFileSameJavaStringCheckUtf8(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.JavaStringCheckUtf8()), strconv.FormatBool(file.JavaStringCheckUtf8()), file, file.JavaStringCheckUtf8Location(), `option "java_string_check_utf8"`) -} - -// CheckFileSameObjcClassPrefix is a check function. -var CheckFileSameObjcClassPrefix = newFilePairCheckFunc(checkFileSameObjcClassPrefix) - -func checkFileSameObjcClassPrefix(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.ObjcClassPrefix(), file.ObjcClassPrefix(), file, file.ObjcClassPrefixLocation(), `option "objc_class_prefix"`) -} - -// CheckFileSamePackage is a check function. -var CheckFileSamePackage = newFilePairCheckFunc(checkFileSamePackage) - -func checkFileSamePackage(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.Package(), file.Package(), file, file.PackageLocation(), `package`) -} - -// CheckFileSamePhpClassPrefix is a check function. -var CheckFileSamePhpClassPrefix = newFilePairCheckFunc(checkFileSamePhpClassPrefix) - -func checkFileSamePhpClassPrefix(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.PhpClassPrefix(), file.PhpClassPrefix(), file, file.PhpClassPrefixLocation(), `option "php_class_prefix"`) -} - -// CheckFileSamePhpNamespace is a check function. -var CheckFileSamePhpNamespace = newFilePairCheckFunc(checkFileSamePhpNamespace) - -func checkFileSamePhpNamespace(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.PhpNamespace(), file.PhpNamespace(), file, file.PhpNamespaceLocation(), `option "php_namespace"`) -} - -// CheckFileSamePhpMetadataNamespace is a check function. -var CheckFileSamePhpMetadataNamespace = newFilePairCheckFunc(checkFileSamePhpMetadataNamespace) - -func checkFileSamePhpMetadataNamespace(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.PhpMetadataNamespace(), file.PhpMetadataNamespace(), file, file.PhpMetadataNamespaceLocation(), `option "php_metadata_namespace"`) -} - -// CheckFileSameRubyPackage is a check function. -var CheckFileSameRubyPackage = newFilePairCheckFunc(checkFileSameRubyPackage) - -func checkFileSameRubyPackage(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.RubyPackage(), file.RubyPackage(), file, file.RubyPackageLocation(), `option "ruby_package"`) -} - -// CheckFileSameSwiftPrefix is a check function. -var CheckFileSameSwiftPrefix = newFilePairCheckFunc(checkFileSameSwiftPrefix) - -func checkFileSameSwiftPrefix(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.SwiftPrefix(), file.SwiftPrefix(), file, file.SwiftPrefixLocation(), `option "swift_prefix"`) -} - -// CheckFileSameOptimizeFor is a check function. -var CheckFileSameOptimizeFor = newFilePairCheckFunc(checkFileSameOptimizeFor) - -func checkFileSameOptimizeFor(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, previousFile.OptimizeFor().String(), file.OptimizeFor().String(), file, file.OptimizeForLocation(), `option "optimize_for"`) -} - -// CheckFileSameCcGenericServices is a check function. -var CheckFileSameCcGenericServices = newFilePairCheckFunc(checkFileSameCcGenericServices) - -func checkFileSameCcGenericServices(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.CcGenericServices()), strconv.FormatBool(file.CcGenericServices()), file, file.CcGenericServicesLocation(), `option "cc_generic_services"`) -} - -// CheckFileSameJavaGenericServices is a check function. -var CheckFileSameJavaGenericServices = newFilePairCheckFunc(checkFileSameJavaGenericServices) - -func checkFileSameJavaGenericServices(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.JavaGenericServices()), strconv.FormatBool(file.JavaGenericServices()), file, file.JavaGenericServicesLocation(), `option "java_generic_services"`) -} - -// CheckFileSamePyGenericServices is a check function. -var CheckFileSamePyGenericServices = newFilePairCheckFunc(checkFileSamePyGenericServices) - -func checkFileSamePyGenericServices(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.PyGenericServices()), strconv.FormatBool(file.PyGenericServices()), file, file.PyGenericServicesLocation(), `option "py_generic_services"`) -} - -// CheckFileSamePhpGenericServices is a check function. -var CheckFileSamePhpGenericServices = newFilePairCheckFunc(checkFileSamePhpGenericServices) - -func checkFileSamePhpGenericServices(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.PhpGenericServices()), strconv.FormatBool(file.PhpGenericServices()), file, file.PhpGenericServicesLocation(), `option "php_generic_services"`) -} - -// CheckFileSameCcEnableArenas is a check function. -var CheckFileSameCcEnableArenas = newFilePairCheckFunc(checkFileSameCcEnableArenas) - -func checkFileSameCcEnableArenas(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - return checkFileSameValue(add, strconv.FormatBool(previousFile.CcEnableArenas()), strconv.FormatBool(file.CcEnableArenas()), file, file.CcEnableArenasLocation(), `option "cc_enable_arenas"`) -} - -// CheckFileSameSyntax is a check function. -var CheckFileSameSyntax = newFilePairCheckFunc(checkFileSameSyntax) - -func checkFileSameSyntax(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - previousSyntax := previousFile.Syntax() - if previousSyntax == protosource.SyntaxUnspecified { - previousSyntax = protosource.SyntaxProto2 - } - syntax := file.Syntax() - if syntax == protosource.SyntaxUnspecified { - syntax = protosource.SyntaxProto2 - } - return checkFileSameValue(add, previousSyntax.String(), syntax.String(), file, file.SyntaxLocation(), `syntax`) -} - -func checkFileSameValue(add addFunc, previousValue interface{}, value interface{}, file protosource.File, location protosource.Location, name string) error { - if previousValue != value { - add(file, nil, location, `File %s changed from %q to %q.`, name, previousValue, value) - } - return nil -} - -// CheckMessageNoDelete is a check function. -var CheckMessageNoDelete = newFilePairCheckFunc(checkMessageNoDelete) - -func checkMessageNoDelete(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - previousNestedNameToMessage, err := protosource.NestedNameToMessage(previousFile) - if err != nil { - return err - } - nestedNameToMessage, err := protosource.NestedNameToMessage(file) - if err != nil { - return err - } - for previousNestedName := range previousNestedNameToMessage { - if _, ok := nestedNameToMessage[previousNestedName]; !ok { - descriptor, location := getDescriptorAndLocationForDeletedMessage(file, nestedNameToMessage, previousNestedName) - add(descriptor, nil, location, `Previously present message %q was deleted from file.`, previousNestedName) - } - } - return nil -} - -// CheckMessageNoRemoveStandardDescriptorAccessor is a check function. -var CheckMessageNoRemoveStandardDescriptorAccessor = newMessagePairCheckFunc(checkMessageNoRemoveStandardDescriptorAccessor) - -func checkMessageNoRemoveStandardDescriptorAccessor(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previous := strconv.FormatBool(previousMessage.NoStandardDescriptorAccessor()) - current := strconv.FormatBool(message.NoStandardDescriptorAccessor()) - if previous == "false" && current == "true" { - add(message, nil, message.NoStandardDescriptorAccessorLocation(), `Message option "no_standard_descriptor_accessor" changed from %q to %q.`, previous, current) - } - return nil -} - -// CheckMessageSameMessageSetWireFormat is a check function. -var CheckMessageSameMessageSetWireFormat = newMessagePairCheckFunc(checkMessageSameMessageSetWireFormat) - -func checkMessageSameMessageSetWireFormat(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previous := strconv.FormatBool(previousMessage.MessageSetWireFormat()) - current := strconv.FormatBool(message.MessageSetWireFormat()) - if previous != current { - add(message, nil, message.MessageSetWireFormatLocation(), `Message option "message_set_wire_format" changed from %q to %q.`, previous, current) - } - return nil -} - -// CheckMessageSameRequiredFields is a check function. -var CheckMessageSameRequiredFields = newMessagePairCheckFunc(checkMessageSameRequiredFields) - -func checkMessageSameRequiredFields(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previousNumberToRequiredField, err := protosource.NumberToMessageFieldForLabel( - previousMessage, - descriptorpb.FieldDescriptorProto_LABEL_REQUIRED, - ) - if err != nil { - return err - } - numberToRequiredField, err := protosource.NumberToMessageFieldForLabel( - message, - descriptorpb.FieldDescriptorProto_LABEL_REQUIRED, - ) - if err != nil { - return err - } - for previousNumber := range previousNumberToRequiredField { - if _, ok := numberToRequiredField[previousNumber]; !ok { - // we attach the error to the message as the field no longer exists - add(message, nil, message.Location(), `Message %q had required field "%d" deleted. Required fields must always be sent, so if one side does not know about the required field, this will result in a breakage.`, previousMessage.Name(), previousNumber) - } - } - for number, requiredField := range numberToRequiredField { - if _, ok := previousNumberToRequiredField[number]; !ok { - // we attach the error to the added required field - add(message, nil, requiredField.Location(), `Message %q had required field "%d" added. Required fields must always be sent, so if one side does not know about the required field, this will result in a breakage.`, message.Name(), number) - } - } - return nil -} - -// CheckOneofNoDelete is a check function. -var CheckOneofNoDelete = newMessagePairCheckFunc(checkOneofNoDelete) - -func checkOneofNoDelete(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previousNameToOneof, err := protosource.NameToMessageOneof(previousMessage) - if err != nil { - return err - } - nameToOneof, err := protosource.NameToMessageOneof(message) - if err != nil { - return err - } - for previousName := range previousNameToOneof { - if _, ok := nameToOneof[previousName]; !ok { - add(message, nil, message.Location(), `Previously present oneof %q on message %q was deleted.`, previousName, message.Name()) - } - } - return nil -} - -// CheckPackageEnumNoDelete is a check function. -var CheckPackageEnumNoDelete = newFilesCheckFunc(checkPackageEnumNoDelete) - -func checkPackageEnumNoDelete(add addFunc, corpus *corpus) error { - previousPackageToNestedNameToEnum, err := protosource.PackageToNestedNameToEnum(corpus.previousFiles...) - if err != nil { - return err - } - packageToNestedNameToEnum, err := protosource.PackageToNestedNameToEnum(corpus.files...) - if err != nil { - return err - } - // caching across loops - var filePathToFile map[string]protosource.File - for previousPackage, previousNestedNameToEnum := range previousPackageToNestedNameToEnum { - if nestedNameToEnum, ok := packageToNestedNameToEnum[previousPackage]; ok { - for previousNestedName, previousEnum := range previousNestedNameToEnum { - if _, ok := nestedNameToEnum[previousNestedName]; !ok { - // if cache not populated, populate it - if filePathToFile == nil { - filePathToFile, err = protosource.FilePathToFile(corpus.files...) - if err != nil { - return err - } - } - // Check if the file still exists. - file, ok := filePathToFile[previousEnum.File().Path()] - if ok { - // File exists, try to get a location to attach the error to. - descriptor, location, err := getDescriptorAndLocationForDeletedEnum(file, previousNestedName) - if err != nil { - return err - } - add(descriptor, nil, location, `Previously present enum %q was deleted from package %q.`, previousNestedName, previousPackage) - } else { - // File does not exist, we don't know where the enum was deleted from. - // Add the previous enum to check for ignores. This means that if - // ignore_unstable_packages is set, this will be triggered if the - // previous enum was in an unstable package. - add(nil, []protosource.Descriptor{previousEnum}, nil, `Previously present enum %q was deleted from package %q.`, previousNestedName, previousPackage) - } - } - } - } - } - return nil -} - -// CheckPackageMessageNoDelete is a check function. -var CheckPackageMessageNoDelete = newFilesCheckFunc(checkPackageMessageNoDelete) - -func checkPackageMessageNoDelete(add addFunc, corpus *corpus) error { - previousPackageToNestedNameToMessage, err := protosource.PackageToNestedNameToMessage(corpus.previousFiles...) - if err != nil { - return err - } - packageToNestedNameToMessage, err := protosource.PackageToNestedNameToMessage(corpus.files...) - if err != nil { - return err - } - // caching across loops - var filePathToFile map[string]protosource.File - for previousPackage, previousNestedNameToMessage := range previousPackageToNestedNameToMessage { - if nestedNameToMessage, ok := packageToNestedNameToMessage[previousPackage]; ok { - for previousNestedName, previousMessage := range previousNestedNameToMessage { - if _, ok := nestedNameToMessage[previousNestedName]; !ok { - // if cache not populated, populate it - if filePathToFile == nil { - filePathToFile, err = protosource.FilePathToFile(corpus.files...) - if err != nil { - return err - } - } - // Check if the file still exists. - file, ok := filePathToFile[previousMessage.File().Path()] - if ok { - // File exists, try to get a location to attach the error to. - descriptor, location := getDescriptorAndLocationForDeletedMessage(file, nestedNameToMessage, previousNestedName) - add(descriptor, nil, location, `Previously present message %q was deleted from package %q.`, previousNestedName, previousPackage) - } else { - // File does not exist, we don't know where the message was deleted from. - // Add the previous message to check for ignores. This means that if - // ignore_unstable_packages is set, this will be triggered if the - // previous message was in an unstable package. - add(nil, []protosource.Descriptor{previousMessage}, nil, `Previously present message %q was deleted from package %q.`, previousNestedName, previousPackage) - } - } - } - } - } - return nil -} - -// CheckPackageNoDelete is a check function. -var CheckPackageNoDelete = newFilesCheckFunc(checkPackageNoDelete) - -func checkPackageNoDelete(add addFunc, corpus *corpus) error { - previousPackageToFiles, err := protosource.PackageToFiles(corpus.previousFiles...) - if err != nil { - return err - } - packageToFiles, err := protosource.PackageToFiles(corpus.files...) - if err != nil { - return err - } - for previousPackage, previousFiles := range previousPackageToFiles { - if _, ok := packageToFiles[previousPackage]; !ok { - // Add previous descriptors in the same package as other descriptors to check - // for ignores. This will mean that if we have ignore_unstable_packages set, - // any one of these files will cause the ignore to happen. Note that we - // could probably just attach a single file, but we do this in case we - // have other ways to ignore in the future. - previousDescriptors := make([]protosource.Descriptor, len(previousFiles)) - for i, previousFile := range previousFiles { - previousDescriptors[i] = previousFile - } - add(nil, previousDescriptors, nil, `Previously present package %q was deleted.`, previousPackage) - } - } - return nil -} - -// CheckPackageServiceNoDelete is a check function. -var CheckPackageServiceNoDelete = newFilesCheckFunc(checkPackageServiceNoDelete) - -func checkPackageServiceNoDelete(add addFunc, corpus *corpus) error { - previousPackageToNameToService, err := protosource.PackageToNameToService(corpus.previousFiles...) - if err != nil { - return err - } - packageToNameToService, err := protosource.PackageToNameToService(corpus.files...) - if err != nil { - return err - } - // caching across loops - var filePathToFile map[string]protosource.File - for previousPackage, previousNameToService := range previousPackageToNameToService { - if nameToService, ok := packageToNameToService[previousPackage]; ok { - for previousName, previousService := range previousNameToService { - if _, ok := nameToService[previousName]; !ok { - // if cache not populated, populate it - if filePathToFile == nil { - filePathToFile, err = protosource.FilePathToFile(corpus.files...) - if err != nil { - return err - } - } - // Check if the file still exists. - file, ok := filePathToFile[previousService.File().Path()] - if ok { - // File exists. - add(file, nil, nil, `Previously present service %q was deleted from package %q.`, previousName, previousPackage) - } else { - // File does not exist, we don't know where the service was deleted from. - // Add the previous service to check for ignores. This means that if - // ignore_unstable_packages is set, this will be triggered if the - // previous service was in an unstable package. - // TODO: find the service and print that this moved? - add(nil, []protosource.Descriptor{previousService}, nil, `Previously present service %q was deleted from package %q.`, previousName, previousPackage) - } - } - } - } - } - return nil -} - -// CheckReservedEnumNoDelete is a check function. -var CheckReservedEnumNoDelete = newEnumPairCheckFunc(checkReservedEnumNoDelete) - -func checkReservedEnumNoDelete(add addFunc, corpus *corpus, previousEnum protosource.Enum, enum protosource.Enum) error { - previousRanges := previousEnum.ReservedTagRanges() - ranges := enum.ReservedTagRanges() - if isSubset, missing := protosource.CheckTagRangeIsSubset(ranges, previousRanges); !isSubset { - for _, tagRange := range missing { - add(enum, nil, enum.Location(), `Previously present reserved range %q on enum %q was deleted.`, protosource.TagRangeString(tagRange), enum.Name()) - } - } - previousValueToReservedName := protosource.ValueToReservedName(previousEnum) - valueToReservedName := protosource.ValueToReservedName(enum) - for previousValue := range previousValueToReservedName { - if _, ok := valueToReservedName[previousValue]; !ok { - add(enum, nil, enum.Location(), `Previously present reserved name %q on enum %q was deleted.`, previousValue, enum.Name()) - } - } - return nil -} - -// CheckReservedMessageNoDelete is a check function. -var CheckReservedMessageNoDelete = newMessagePairCheckFunc(checkReservedMessageNoDelete) - -func checkReservedMessageNoDelete(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previousRanges := previousMessage.ReservedTagRanges() - ranges := message.ReservedTagRanges() - if isSubset, missing := protosource.CheckTagRangeIsSubset(ranges, previousRanges); !isSubset { - for _, tagRange := range missing { - add(message, nil, message.Location(), `Previously present reserved range %q on message %q was deleted.`, protosource.TagRangeString(tagRange), message.Name()) - } - } - previousValueToReservedName := protosource.ValueToReservedName(previousMessage) - valueToReservedName := protosource.ValueToReservedName(message) - for previousValue := range previousValueToReservedName { - if _, ok := valueToReservedName[previousValue]; !ok { - add(message, nil, message.Location(), `Previously present reserved name %q on message %q was deleted.`, previousValue, message.Name()) - } - } - return nil -} - -// CheckRPCNoDelete is a check function. -var CheckRPCNoDelete = newServicePairCheckFunc(checkRPCNoDelete) - -func checkRPCNoDelete(add addFunc, corpus *corpus, previousService protosource.Service, service protosource.Service) error { - previousNameToMethod, err := protosource.NameToMethod(previousService) - if err != nil { - return err - } - nameToMethod, err := protosource.NameToMethod(service) - if err != nil { - return err - } - for previousName := range previousNameToMethod { - if _, ok := nameToMethod[previousName]; !ok { - add(service, nil, service.Location(), `Previously present RPC %q on service %q was deleted.`, previousName, service.Name()) - } - } - return nil -} - -// CheckRPCSameClientStreaming is a check function. -var CheckRPCSameClientStreaming = newMethodPairCheckFunc(checkRPCSameClientStreaming) - -func checkRPCSameClientStreaming(add addFunc, corpus *corpus, previousMethod protosource.Method, method protosource.Method) error { - if previousMethod.ClientStreaming() != method.ClientStreaming() { - previous := "streaming" - current := "unary" - if method.ClientStreaming() { - previous = "unary" - current = "streaming" - } - add(method, nil, method.Location(), `RPC %q on service %q changed from client %s to client %s.`, method.Name(), method.Service().Name(), previous, current) - } - return nil -} - -// CheckRPCSameIdempotencyLevel is a check function. -var CheckRPCSameIdempotencyLevel = newMethodPairCheckFunc(checkRPCSameIdempotencyLevel) - -func checkRPCSameIdempotencyLevel(add addFunc, corpus *corpus, previousMethod protosource.Method, method protosource.Method) error { - previous := previousMethod.IdempotencyLevel() - current := method.IdempotencyLevel() - if previous != current { - add(method, nil, method.IdempotencyLevelLocation(), `RPC %q on service %q changed option "idempotency_level" from %q to %q.`, method.Name(), method.Service().Name(), previous.String(), current.String()) - } - return nil -} - -// CheckRPCSameRequestType is a check function. -var CheckRPCSameRequestType = newMethodPairCheckFunc(checkRPCSameRequestType) - -func checkRPCSameRequestType(add addFunc, corpus *corpus, previousMethod protosource.Method, method protosource.Method) error { - if previousMethod.InputTypeName() != method.InputTypeName() { - add(method, nil, method.InputTypeLocation(), `RPC %q on service %q changed request type from %q to %q.`, method.Name(), method.Service().Name(), previousMethod.InputTypeName(), method.InputTypeName()) - } - return nil -} - -// CheckRPCSameResponseType is a check function. -var CheckRPCSameResponseType = newMethodPairCheckFunc(checkRPCSameResponseType) - -func checkRPCSameResponseType(add addFunc, corpus *corpus, previousMethod protosource.Method, method protosource.Method) error { - if previousMethod.OutputTypeName() != method.OutputTypeName() { - add(method, nil, method.OutputTypeLocation(), `RPC %q on service %q changed response type from %q to %q.`, method.Name(), method.Service().Name(), previousMethod.OutputTypeName(), method.OutputTypeName()) - } - return nil -} - -// CheckRPCSameServerStreaming is a check function. -var CheckRPCSameServerStreaming = newMethodPairCheckFunc(checkRPCSameServerStreaming) - -func checkRPCSameServerStreaming(add addFunc, corpus *corpus, previousMethod protosource.Method, method protosource.Method) error { - if previousMethod.ServerStreaming() != method.ServerStreaming() { - previous := "streaming" - current := "unary" - if method.ServerStreaming() { - previous = "unary" - current = "streaming" - } - add(method, nil, method.Location(), `RPC %q on service %q changed from server %s to server %s.`, method.Name(), method.Service().Name(), previous, current) - } - return nil -} - -// CheckServiceNoDelete is a check function. -var CheckServiceNoDelete = newFilePairCheckFunc(checkServiceNoDelete) - -func checkServiceNoDelete(add addFunc, corpus *corpus, previousFile protosource.File, file protosource.File) error { - previousNameToService, err := protosource.NameToService(previousFile) - if err != nil { - return err - } - nameToService, err := protosource.NameToService(file) - if err != nil { - return err - } - for previousName := range previousNameToService { - if _, ok := nameToService[previousName]; !ok { - add(file, nil, nil, `Previously present service %q was deleted from file.`, previousName) - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/usage.gen.go deleted file mode 100644 index 05f7c9c623..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreakingcheck - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/util.go deleted file mode 100644 index 48e5fcb567..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingcheck/util.go +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufbreakingcheck - -import ( - "fmt" - "sort" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/pkg/protosource" - "google.golang.org/protobuf/types/descriptorpb" -) - -var ( - // https://developers.google.com/protocol-buffers/docs/proto3#updating - fieldDescriptorProtoTypeToWireCompatiblityGroup = map[descriptorpb.FieldDescriptorProto_Type]int{ - descriptorpb.FieldDescriptorProto_TYPE_INT32: 1, - descriptorpb.FieldDescriptorProto_TYPE_INT64: 1, - descriptorpb.FieldDescriptorProto_TYPE_UINT32: 1, - descriptorpb.FieldDescriptorProto_TYPE_UINT64: 1, - descriptorpb.FieldDescriptorProto_TYPE_BOOL: 1, - descriptorpb.FieldDescriptorProto_TYPE_SINT32: 2, - descriptorpb.FieldDescriptorProto_TYPE_SINT64: 2, - // While string and bytes are compatible if the bytes are valid UTF-8, we cannot - // determine if a field will actually be valid UTF-8, as we are concerned with the - // definitions and not individual messages, so we have these in different - // compatibility groups. We allow string to evolve to bytes, but not bytes to - // string, but we need them to be in different compatibility groups so that - // we have to manually detect this. - descriptorpb.FieldDescriptorProto_TYPE_STRING: 3, - descriptorpb.FieldDescriptorProto_TYPE_BYTES: 4, - descriptorpb.FieldDescriptorProto_TYPE_FIXED32: 5, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: 5, - descriptorpb.FieldDescriptorProto_TYPE_FIXED64: 6, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: 6, - descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: 7, - descriptorpb.FieldDescriptorProto_TYPE_FLOAT: 8, - descriptorpb.FieldDescriptorProto_TYPE_GROUP: 9, - // Embedded messages are compatible with bytes if the bytes are serialized versions - // of the message, but we have no way of verifying this. - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: 10, - // Enum is compatible with int32, uint32, int64, uint64 if the values match - // an enum value, but we have no way of verifying this. - descriptorpb.FieldDescriptorProto_TYPE_ENUM: 11, - } - - // https://developers.google.com/protocol-buffers/docs/proto3#json - // this is not just JSON-compatible, but also wire-compatible, i.e. the intersection - fieldDescriptorProtoTypeToWireJSONCompatiblityGroup = map[descriptorpb.FieldDescriptorProto_Type]int{ - // fixed32 not compatible for wire so not included - descriptorpb.FieldDescriptorProto_TYPE_INT32: 1, - descriptorpb.FieldDescriptorProto_TYPE_UINT32: 1, - // fixed64 not compatible for wire so not included - descriptorpb.FieldDescriptorProto_TYPE_INT64: 2, - descriptorpb.FieldDescriptorProto_TYPE_UINT64: 2, - descriptorpb.FieldDescriptorProto_TYPE_FIXED32: 3, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: 3, - descriptorpb.FieldDescriptorProto_TYPE_FIXED64: 4, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: 4, - descriptorpb.FieldDescriptorProto_TYPE_BOOL: 5, - descriptorpb.FieldDescriptorProto_TYPE_SINT32: 6, - descriptorpb.FieldDescriptorProto_TYPE_SINT64: 7, - descriptorpb.FieldDescriptorProto_TYPE_STRING: 8, - descriptorpb.FieldDescriptorProto_TYPE_BYTES: 9, - descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: 10, - descriptorpb.FieldDescriptorProto_TYPE_FLOAT: 11, - descriptorpb.FieldDescriptorProto_TYPE_GROUP: 12, - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: 14, - descriptorpb.FieldDescriptorProto_TYPE_ENUM: 15, - } -) - -// addFunc adds a FileAnnotation. -// -// Both the Descriptor and Location can be nil. -type addFunc func(protosource.Descriptor, []protosource.Descriptor, protosource.Location, string, ...interface{}) - -// corpus is a store of the previous files and files given to a check function. -// -// this is passed down so that pair functions have access to the original inputs. -type corpus struct { - previousFiles []protosource.File - files []protosource.File -} - -func newCorpus( - previousFiles []protosource.File, - files []protosource.File, -) *corpus { - return &corpus{ - previousFiles: previousFiles, - files: files, - } -} - -func newFilesCheckFunc( - f func(addFunc, *corpus) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return func(id string, ignoreFunc internal.IgnoreFunc, previousFiles []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - helper := internal.NewHelper(id, ignoreFunc) - if err := f(helper.AddFileAnnotationWithExtraIgnoreDescriptorsf, newCorpus(previousFiles, files)); err != nil { - return nil, err - } - return helper.FileAnnotations(), nil - } -} - -func newFilePairCheckFunc( - f func(addFunc, *corpus, protosource.File, protosource.File) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, corpus *corpus) error { - previousFilePathToFile, err := protosource.FilePathToFile(corpus.previousFiles...) - if err != nil { - return err - } - filePathToFile, err := protosource.FilePathToFile(corpus.files...) - if err != nil { - return err - } - for previousFilePath, previousFile := range previousFilePathToFile { - if file, ok := filePathToFile[previousFilePath]; ok { - if err := f(add, corpus, previousFile, file); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func newEnumPairCheckFunc( - f func(addFunc, *corpus, protosource.Enum, protosource.Enum) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, corpus *corpus) error { - previousFullNameToEnum, err := protosource.FullNameToEnum(corpus.previousFiles...) - if err != nil { - return err - } - fullNameToEnum, err := protosource.FullNameToEnum(corpus.files...) - if err != nil { - return err - } - for previousFullName, previousEnum := range previousFullNameToEnum { - if enum, ok := fullNameToEnum[previousFullName]; ok { - if err := f(add, corpus, previousEnum, enum); err != nil { - return err - } - } - } - return nil - }, - ) -} - -// compares all the enums that are of the same number -// map is from name to EnumValue for the given number -func newEnumValuePairCheckFunc( - f func(addFunc, *corpus, map[string]protosource.EnumValue, map[string]protosource.EnumValue) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newEnumPairCheckFunc( - func(add addFunc, corpus *corpus, previousEnum protosource.Enum, enum protosource.Enum) error { - previousNumberToNameToEnumValue, err := protosource.NumberToNameToEnumValue(previousEnum) - if err != nil { - return err - } - numberToNameToEnumValue, err := protosource.NumberToNameToEnumValue(enum) - if err != nil { - return err - } - for previousNumber, previousNameToEnumValue := range previousNumberToNameToEnumValue { - if nameToEnumValue, ok := numberToNameToEnumValue[previousNumber]; ok { - if err := f(add, corpus, previousNameToEnumValue, nameToEnumValue); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func newMessagePairCheckFunc( - f func(addFunc, *corpus, protosource.Message, protosource.Message) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, corpus *corpus) error { - previousFullNameToMessage, err := protosource.FullNameToMessage(corpus.previousFiles...) - if err != nil { - return err - } - fullNameToMessage, err := protosource.FullNameToMessage(corpus.files...) - if err != nil { - return err - } - for previousFullName, previousMessage := range previousFullNameToMessage { - if message, ok := fullNameToMessage[previousFullName]; ok { - if err := f(add, corpus, previousMessage, message); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func newFieldPairCheckFunc( - f func(addFunc, *corpus, protosource.Field, protosource.Field) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newMessagePairCheckFunc( - func(add addFunc, corpus *corpus, previousMessage protosource.Message, message protosource.Message) error { - previousNumberToField, err := protosource.NumberToMessageField(previousMessage) - if err != nil { - return err - } - numberToField, err := protosource.NumberToMessageField(message) - if err != nil { - return err - } - for previousNumber, previousField := range previousNumberToField { - if field, ok := numberToField[previousNumber]; ok { - if err := f(add, corpus, previousField, field); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func newServicePairCheckFunc( - f func(addFunc, *corpus, protosource.Service, protosource.Service) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, corpus *corpus) error { - previousFullNameToService, err := protosource.FullNameToService(corpus.previousFiles...) - if err != nil { - return err - } - fullNameToService, err := protosource.FullNameToService(corpus.files...) - if err != nil { - return err - } - for previousFullName, previousService := range previousFullNameToService { - if service, ok := fullNameToService[previousFullName]; ok { - if err := f(add, corpus, previousService, service); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func newMethodPairCheckFunc( - f func(addFunc, *corpus, protosource.Method, protosource.Method) error, -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newServicePairCheckFunc( - func(add addFunc, corpus *corpus, previousService protosource.Service, service protosource.Service) error { - previousNameToMethod, err := protosource.NameToMethod(previousService) - if err != nil { - return err - } - nameToMethod, err := protosource.NameToMethod(service) - if err != nil { - return err - } - for previousName, previousMethod := range previousNameToMethod { - if method, ok := nameToMethod[previousName]; ok { - if err := f(add, corpus, previousMethod, method); err != nil { - return err - } - } - } - return nil - }, - ) -} - -func getDescriptorAndLocationForDeletedEnum(file protosource.File, previousNestedName string) (protosource.Descriptor, protosource.Location, error) { - if strings.Contains(previousNestedName, ".") { - nestedNameToMessage, err := protosource.NestedNameToMessage(file) - if err != nil { - return nil, nil, err - } - split := strings.Split(previousNestedName, ".") - for i := len(split) - 1; i > 0; i-- { - if message, ok := nestedNameToMessage[strings.Join(split[0:i], ".")]; ok { - return message, message.Location(), nil - } - } - } - return file, nil, nil -} - -func getDescriptorAndLocationForDeletedMessage(file protosource.File, nestedNameToMessage map[string]protosource.Message, previousNestedName string) (protosource.Descriptor, protosource.Location) { - if strings.Contains(previousNestedName, ".") { - split := strings.Split(previousNestedName, ".") - for i := len(split) - 1; i > 0; i-- { - if message, ok := nestedNameToMessage[strings.Join(split[0:i], ".")]; ok { - return message, message.Location() - } - } - } - return file, nil -} - -func getSortedEnumValueNames(nameToEnumValue map[string]protosource.EnumValue) []string { - names := make([]string, 0, len(nameToEnumValue)) - for name := range nameToEnumValue { - names = append(names, name) - } - sort.Strings(names) - return names -} - -func getEnumByFullName(files []protosource.File, enumFullName string) (protosource.Enum, error) { - fullNameToEnum, err := protosource.FullNameToEnum(files...) - if err != nil { - return nil, err - } - enum, ok := fullNameToEnum[enumFullName] - if !ok { - return nil, fmt.Errorf("expected enum %q to exist but was not found", enumFullName) - } - return enum, nil -} - -func withBackupLocation(primary protosource.Location, secondary protosource.Location) protosource.Location { - if primary != nil { - return primary - } - return secondary -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/bufbreakingv1.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/bufbreakingv1.go deleted file mode 100644 index c607898d38..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/bufbreakingv1.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufbreakingv1 contains the VersionSpec for v1. -// -// It uses bufbreakingcheck and bufbreakingbuild. -// -// There were no changes from v1beta1. -package bufbreakingv1 - -import "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - -// VersionSpec is the version specification for v1. -// -// Changes from v1beta1: -// -// Adds FILE_SAME_PACKAGE to PACKAGE, WIRE, and WIRE_JSON. -// -// Splits FIELD_SAME_TYPE into FIELD_SAME_TYPE for FILE AND PACKAGE, -// FIRE_WIRE_JSON_COMPATIBLE_TYPE for WIRE_JSON, and -// FIELD_WIRE_COMPATIBLE_TYPE for WIRE. -var VersionSpec = &internal.VersionSpec{ - RuleBuilders: v1RuleBuilders, - DefaultCategories: v1DefaultCategories, - IDToCategories: v1IDToCategories, -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/usage.gen.go deleted file mode 100644 index 9324899d31..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreakingv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/vars.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/vars.go deleted file mode 100644 index c09a74d11e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1/vars.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufbreakingv1 - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" -) - -var ( - // v1RuleBuilders are the rule builders. - v1RuleBuilders = []*internal.RuleBuilder{ - bufbreakingbuild.EnumNoDeleteRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteUnlessNameReservedRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteUnlessNumberReservedRuleBuilder, - bufbreakingbuild.EnumValueSameNameRuleBuilder, - bufbreakingbuild.ExtensionMessageNoDeleteRuleBuilder, - bufbreakingbuild.FieldNoDeleteRuleBuilder, - bufbreakingbuild.FieldNoDeleteUnlessNameReservedRuleBuilder, - bufbreakingbuild.FieldNoDeleteUnlessNumberReservedRuleBuilder, - bufbreakingbuild.FieldSameCTypeRuleBuilder, - bufbreakingbuild.FieldSameJSONNameRuleBuilder, - bufbreakingbuild.FieldSameJSTypeRuleBuilder, - bufbreakingbuild.FieldSameLabelRuleBuilder, - bufbreakingbuild.FieldSameNameRuleBuilder, - bufbreakingbuild.FieldSameOneofRuleBuilder, - bufbreakingbuild.FieldSameTypeRuleBuilder, - bufbreakingbuild.FieldWireCompatibleTypeRuleBuilder, - bufbreakingbuild.FieldWireJSONCompatibleTypeRuleBuilder, - bufbreakingbuild.FileNoDeleteRuleBuilder, - bufbreakingbuild.FileSameCsharpNamespaceRuleBuilder, - bufbreakingbuild.FileSameGoPackageRuleBuilder, - bufbreakingbuild.FileSameJavaMultipleFilesRuleBuilder, - bufbreakingbuild.FileSameJavaOuterClassnameRuleBuilder, - bufbreakingbuild.FileSameJavaPackageRuleBuilder, - bufbreakingbuild.FileSameJavaStringCheckUtf8RuleBuilder, - bufbreakingbuild.FileSameObjcClassPrefixRuleBuilder, - bufbreakingbuild.FileSamePackageRuleBuilder, - bufbreakingbuild.FileSamePhpClassPrefixRuleBuilder, - bufbreakingbuild.FileSamePhpMetadataNamespaceRuleBuilder, - bufbreakingbuild.FileSamePhpNamespaceRuleBuilder, - bufbreakingbuild.FileSameRubyPackageRuleBuilder, - bufbreakingbuild.FileSameSwiftPrefixRuleBuilder, - bufbreakingbuild.FileSameOptimizeForRuleBuilder, - bufbreakingbuild.FileSameCcGenericServicesRuleBuilder, - bufbreakingbuild.FileSameJavaGenericServicesRuleBuilder, - bufbreakingbuild.FileSamePyGenericServicesRuleBuilder, - bufbreakingbuild.FileSamePhpGenericServicesRuleBuilder, - bufbreakingbuild.FileSameCcEnableArenasRuleBuilder, - bufbreakingbuild.FileSameSyntaxRuleBuilder, - bufbreakingbuild.MessageNoDeleteRuleBuilder, - bufbreakingbuild.MessageNoRemoveStandardDescriptorAccessorRuleBuilder, - bufbreakingbuild.MessageSameMessageSetWireFormatRuleBuilder, - bufbreakingbuild.MessageSameRequiredFieldsRuleBuilder, - bufbreakingbuild.OneofNoDeleteRuleBuilder, - bufbreakingbuild.PackageEnumNoDeleteRuleBuilder, - bufbreakingbuild.PackageMessageNoDeleteRuleBuilder, - bufbreakingbuild.PackageNoDeleteRuleBuilder, - bufbreakingbuild.PackageServiceNoDeleteRuleBuilder, - bufbreakingbuild.ReservedEnumNoDeleteRuleBuilder, - bufbreakingbuild.ReservedMessageNoDeleteRuleBuilder, - bufbreakingbuild.RPCNoDeleteRuleBuilder, - bufbreakingbuild.RPCSameClientStreamingRuleBuilder, - bufbreakingbuild.RPCSameIdempotencyLevelRuleBuilder, - bufbreakingbuild.RPCSameRequestTypeRuleBuilder, - bufbreakingbuild.RPCSameResponseTypeRuleBuilder, - bufbreakingbuild.RPCSameServerStreamingRuleBuilder, - bufbreakingbuild.ServiceNoDeleteRuleBuilder, - } - - // v1DefaultCategories are the default categories. - v1DefaultCategories = []string{ - "FILE", - } - // v1IDToCategories associates IDs to categories. - v1IDToCategories = map[string][]string{ - "ENUM_NO_DELETE": { - "FILE", - }, - "ENUM_VALUE_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED": { - "WIRE_JSON", - }, - "ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED": { - "WIRE_JSON", - "WIRE", - }, - "ENUM_VALUE_SAME_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "EXTENSION_MESSAGE_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "FIELD_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "FIELD_NO_DELETE_UNLESS_NAME_RESERVED": { - "WIRE_JSON", - }, - "FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED": { - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_CTYPE": { - "FILE", - "PACKAGE", - }, - "FIELD_SAME_JSON_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "FIELD_SAME_JSTYPE": { - "FILE", - "PACKAGE", - }, - "FIELD_SAME_LABEL": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "FIELD_SAME_ONEOF": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_TYPE": { - "FILE", - "PACKAGE", - }, - "FIELD_WIRE_COMPATIBLE_TYPE": { - "WIRE", - }, - "FIELD_WIRE_JSON_COMPATIBLE_TYPE": { - "WIRE_JSON", - }, - "FILE_NO_DELETE": { - "FILE", - }, - "FILE_SAME_CSHARP_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_GO_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_MULTIPLE_FILES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_OUTER_CLASSNAME": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_STRING_CHECK_UTF8": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_OBJC_CLASS_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PACKAGE": { - "FILE", - "PACKAGE", - "WIRE", - "WIRE_JSON", - }, - "FILE_SAME_PHP_CLASS_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_METADATA_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_RUBY_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_SWIFT_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_OPTIMIZE_FOR": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_CC_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PY_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_CC_ENABLE_ARENAS": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_SYNTAX": { - "FILE", - "PACKAGE", - }, - "MESSAGE_NO_DELETE": { - "FILE", - }, - "MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR": { - "FILE", - "PACKAGE", - }, - "MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "MESSAGE_SAME_REQUIRED_FIELDS": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "ONEOF_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "PACKAGE_ENUM_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_MESSAGE_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_SERVICE_NO_DELETE": { - "PACKAGE", - }, - "RESERVED_ENUM_NO_DELETE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RESERVED_MESSAGE_NO_DELETE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "RPC_SAME_CLIENT_STREAMING": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_IDEMPOTENCY_LEVEL": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_REQUEST_TYPE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_RESPONSE_TYPE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_SERVER_STREAMING": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "SERVICE_NO_DELETE": { - "FILE", - }, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/bufbreakingv1beta1.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/bufbreakingv1beta1.go deleted file mode 100644 index bf280f1202..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/bufbreakingv1beta1.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufbreakingv1beta1 contains the VersionSpec for v1beta1. -// -// It uses bufbreakingcheck and bufbreakingbuild. -package bufbreakingv1beta1 - -import "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - -// VersionSpec is the version specification for v1beta1. -var VersionSpec = &internal.VersionSpec{ - RuleBuilders: v1beta1RuleBuilders, - DefaultCategories: v1beta1DefaultCategories, - IDToCategories: v1beta1IDToCategories, -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/usage.gen.go deleted file mode 100644 index a5e6879297..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreakingv1beta1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/vars.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/vars.go deleted file mode 100644 index 22188b608d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingv1beta1/vars.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufbreakingv1beta1 - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/internal/bufbreakingbuild" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" -) - -var ( - // v1beta1RuleBuilders are the rule builders. - v1beta1RuleBuilders = []*internal.RuleBuilder{ - bufbreakingbuild.EnumNoDeleteRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteUnlessNameReservedRuleBuilder, - bufbreakingbuild.EnumValueNoDeleteUnlessNumberReservedRuleBuilder, - bufbreakingbuild.EnumValueSameNameRuleBuilder, - bufbreakingbuild.ExtensionMessageNoDeleteRuleBuilder, - bufbreakingbuild.FieldNoDeleteRuleBuilder, - bufbreakingbuild.FieldNoDeleteUnlessNameReservedRuleBuilder, - bufbreakingbuild.FieldNoDeleteUnlessNumberReservedRuleBuilder, - bufbreakingbuild.FieldSameCTypeRuleBuilder, - bufbreakingbuild.FieldSameJSONNameRuleBuilder, - bufbreakingbuild.FieldSameJSTypeRuleBuilder, - bufbreakingbuild.FieldSameLabelRuleBuilder, - bufbreakingbuild.FieldSameNameRuleBuilder, - bufbreakingbuild.FieldSameOneofRuleBuilder, - bufbreakingbuild.FieldSameTypeRuleBuilder, - bufbreakingbuild.FileNoDeleteRuleBuilder, - bufbreakingbuild.FileSameCsharpNamespaceRuleBuilder, - bufbreakingbuild.FileSameGoPackageRuleBuilder, - bufbreakingbuild.FileSameJavaMultipleFilesRuleBuilder, - bufbreakingbuild.FileSameJavaOuterClassnameRuleBuilder, - bufbreakingbuild.FileSameJavaPackageRuleBuilder, - bufbreakingbuild.FileSameJavaStringCheckUtf8RuleBuilder, - bufbreakingbuild.FileSameObjcClassPrefixRuleBuilder, - bufbreakingbuild.FileSamePackageRuleBuilder, - bufbreakingbuild.FileSamePhpClassPrefixRuleBuilder, - bufbreakingbuild.FileSamePhpMetadataNamespaceRuleBuilder, - bufbreakingbuild.FileSamePhpNamespaceRuleBuilder, - bufbreakingbuild.FileSameRubyPackageRuleBuilder, - bufbreakingbuild.FileSameSwiftPrefixRuleBuilder, - bufbreakingbuild.FileSameOptimizeForRuleBuilder, - bufbreakingbuild.FileSameCcGenericServicesRuleBuilder, - bufbreakingbuild.FileSameJavaGenericServicesRuleBuilder, - bufbreakingbuild.FileSamePyGenericServicesRuleBuilder, - bufbreakingbuild.FileSamePhpGenericServicesRuleBuilder, - bufbreakingbuild.FileSameCcEnableArenasRuleBuilder, - bufbreakingbuild.FileSameSyntaxRuleBuilder, - bufbreakingbuild.MessageNoDeleteRuleBuilder, - bufbreakingbuild.MessageNoRemoveStandardDescriptorAccessorRuleBuilder, - bufbreakingbuild.MessageSameMessageSetWireFormatRuleBuilder, - bufbreakingbuild.MessageSameRequiredFieldsRuleBuilder, - bufbreakingbuild.OneofNoDeleteRuleBuilder, - bufbreakingbuild.PackageEnumNoDeleteRuleBuilder, - bufbreakingbuild.PackageMessageNoDeleteRuleBuilder, - bufbreakingbuild.PackageNoDeleteRuleBuilder, - bufbreakingbuild.PackageServiceNoDeleteRuleBuilder, - bufbreakingbuild.ReservedEnumNoDeleteRuleBuilder, - bufbreakingbuild.ReservedMessageNoDeleteRuleBuilder, - bufbreakingbuild.RPCNoDeleteRuleBuilder, - bufbreakingbuild.RPCSameClientStreamingRuleBuilder, - bufbreakingbuild.RPCSameIdempotencyLevelRuleBuilder, - bufbreakingbuild.RPCSameRequestTypeRuleBuilder, - bufbreakingbuild.RPCSameResponseTypeRuleBuilder, - bufbreakingbuild.RPCSameServerStreamingRuleBuilder, - bufbreakingbuild.ServiceNoDeleteRuleBuilder, - } - - // v1beta1DefaultCategories are the default categories. - v1beta1DefaultCategories = []string{ - "FILE", - } - // v1beta1IDToCategories associates IDs to categories. - v1beta1IDToCategories = map[string][]string{ - "ENUM_NO_DELETE": { - "FILE", - }, - "ENUM_VALUE_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "ENUM_VALUE_NO_DELETE_UNLESS_NAME_RESERVED": { - "WIRE_JSON", - }, - "ENUM_VALUE_NO_DELETE_UNLESS_NUMBER_RESERVED": { - "WIRE_JSON", - "WIRE", - }, - "ENUM_VALUE_SAME_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "EXTENSION_MESSAGE_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "FIELD_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "FIELD_NO_DELETE_UNLESS_NAME_RESERVED": { - "WIRE_JSON", - }, - "FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED": { - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_CTYPE": { - "FILE", - "PACKAGE", - }, - "FIELD_SAME_JSON_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "FIELD_SAME_JSTYPE": { - "FILE", - "PACKAGE", - }, - "FIELD_SAME_LABEL": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_NAME": { - "FILE", - "PACKAGE", - "WIRE_JSON", - }, - "FIELD_SAME_ONEOF": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "FIELD_SAME_TYPE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "FILE_NO_DELETE": { - "FILE", - }, - "FILE_SAME_CSHARP_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_GO_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_MULTIPLE_FILES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_OUTER_CLASSNAME": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_STRING_CHECK_UTF8": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_OBJC_CLASS_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PACKAGE": { - "FILE", - }, - "FILE_SAME_PHP_CLASS_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_METADATA_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_NAMESPACE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_RUBY_PACKAGE": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_SWIFT_PREFIX": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_OPTIMIZE_FOR": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_CC_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_JAVA_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PY_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_PHP_GENERIC_SERVICES": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_CC_ENABLE_ARENAS": { - "FILE", - "PACKAGE", - }, - "FILE_SAME_SYNTAX": { - "FILE", - "PACKAGE", - }, - "MESSAGE_NO_DELETE": { - "FILE", - }, - "MESSAGE_NO_REMOVE_STANDARD_DESCRIPTOR_ACCESSOR": { - "FILE", - "PACKAGE", - }, - "MESSAGE_SAME_MESSAGE_SET_WIRE_FORMAT": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "MESSAGE_SAME_REQUIRED_FIELDS": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "ONEOF_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "PACKAGE_ENUM_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_MESSAGE_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_NO_DELETE": { - "PACKAGE", - }, - "PACKAGE_SERVICE_NO_DELETE": { - "PACKAGE", - }, - "RESERVED_ENUM_NO_DELETE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RESERVED_MESSAGE_NO_DELETE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_NO_DELETE": { - "FILE", - "PACKAGE", - }, - "RPC_SAME_CLIENT_STREAMING": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_IDEMPOTENCY_LEVEL": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_REQUEST_TYPE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_RESPONSE_TYPE": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "RPC_SAME_SERVER_STREAMING": { - "FILE", - "PACKAGE", - "WIRE_JSON", - "WIRE", - }, - "SERVICE_NO_DELETE": { - "FILE", - }, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/usage.gen.go deleted file mode 100644 index bab7198898..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufbreaking - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheck.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheck.go deleted file mode 100644 index 87c0f9d4d3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/bufcheck.go +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufcheck contains the implementations of the lint and breaking change detection rules. -// -// There is a lot of shared logic between the two, and originally they were actually combined into -// one logical entity (where some checks happened to be linters, and some checks happen to be -// breaking change detectors), so some of this is historical. -package bufcheck - -import ( - "encoding/json" - "fmt" - "io" - "strings" - "text/tabwriter" - - "go.uber.org/multierr" -) - -// AllRuleFormatStrings is all rule format strings. -var AllRuleFormatStrings = []string{ - "text", - "json", -} - -// Rule is a rule. -type Rule interface { - json.Marshaler - - // ID returns the ID of the Rule. - // - // UPPER_SNAKE_CASE. - ID() string - // Categories returns the categories of the Rule. - // - // UPPER_SNAKE_CASE. - // Sorted. - // May be empty. - Categories() []string - // Purpose returns the purpose of the Rule. - // - // Full sentence. - Purpose() string -} - -// PrintRules prints the rules to the writer. -// -// The empty string defaults to text. -func PrintRules(writer io.Writer, rules []Rule, formatString string) (retErr error) { - if len(rules) == 0 { - return nil - } - var asJSON bool - switch s := strings.ToLower(strings.TrimSpace(formatString)); s { - case "", "text": - asJSON = false - case "json": - asJSON = true - default: - return fmt.Errorf("unknown format: %q", s) - } - if !asJSON { - tabWriter := tabwriter.NewWriter(writer, 0, 0, 2, ' ', 0) - defer func() { - retErr = multierr.Append(retErr, tabWriter.Flush()) - }() - writer = tabWriter - if _, err := fmt.Fprintln(writer, "ID\tCATEGORIES\tPURPOSE"); err != nil { - return err - } - } - for _, rule := range rules { - if err := printRule(writer, rule, asJSON); err != nil { - return err - } - } - return nil -} - -func printRule(writer io.Writer, rule Rule, asJSON bool) error { - if asJSON { - data, err := json.Marshal(rule) - if err != nil { - return err - } - if _, err := fmt.Fprintln(writer, string(data)); err != nil { - return err - } - return nil - } - if _, err := fmt.Fprintf(writer, "%s\t%s\t%s\n", rule.ID(), strings.Join(rule.Categories(), ", "), rule.Purpose()); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflint.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflint.go deleted file mode 100644 index 4c4c86b7fe..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflint.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflint contains the linting functionality. -// -// The primary entry point to this package is the Handler. -package buflint - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" -) - -// AllFormatStrings are all format strings. -var AllFormatStrings = append( - bufanalysis.AllFormatStrings, - "config-ignore-yaml", -) - -// Handler handles the main lint functionality. -type Handler interface { - // Check runs the lint checks. - // - // The image should have source code info for this to work properly. - // - // Images should be filtered with regards to imports before passing to this function. - Check( - ctx context.Context, - config *buflintconfig.Config, - image bufimage.Image, - ) ([]bufanalysis.FileAnnotation, error) -} - -// NewHandler returns a new Handler. -func NewHandler(logger *zap.Logger) Handler { - return newHandler(logger) -} - -// RulesForConfig returns the rules for a given config. -// -// Should only be used for printing. -func RulesForConfig(config *buflintconfig.Config) ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig(config) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesV1Beta1 gets all known rules. -// -// Should only be used for printing. -func GetAllRulesV1Beta1() ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig( - &buflintconfig.Config{ - Use: internal.AllIDsForVersionSpec(buflintv1beta1.VersionSpec), - Version: bufconfig.V1Beta1Version, - }, - ) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesV1 gets all known rules. -// -// Should only be used for printing. -func GetAllRulesV1() ([]bufcheck.Rule, error) { - internalConfig, err := internalConfigForConfig( - &buflintconfig.Config{ - Use: internal.AllIDsForVersionSpec(buflintv1.VersionSpec), - Version: bufconfig.V1Version, - }, - ) - if err != nil { - return nil, err - } - return rulesForInternalRules(internalConfig.Rules), nil -} - -// GetAllRulesAndCategoriesV1Beta1 returns all rules and categories for v1beta1 as a string slice. -// -// This is used for validation purposes only. -func GetAllRulesAndCategoriesV1Beta1() []string { - return internal.AllCategoriesAndIDsForVersionSpec(buflintv1beta1.VersionSpec) -} - -// GetAllRulesAndCategoriesV1 returns all rules and categories for v1 as a string slice. -// -// This is used for validation purposes only. -func GetAllRulesAndCategoriesV1() []string { - return internal.AllCategoriesAndIDsForVersionSpec(buflintv1.VersionSpec) -} - -func internalConfigForConfig(config *buflintconfig.Config) (*internal.Config, error) { - var versionSpec *internal.VersionSpec - switch config.Version { - case bufconfig.V1Beta1Version: - versionSpec = buflintv1beta1.VersionSpec - case bufconfig.V1Version: - versionSpec = buflintv1.VersionSpec - } - return internal.ConfigBuilder{ - Use: config.Use, - Except: config.Except, - IgnoreRootPaths: config.IgnoreRootPaths, - IgnoreIDOrCategoryToRootPaths: config.IgnoreIDOrCategoryToRootPaths, - AllowCommentIgnores: config.AllowCommentIgnores, - EnumZeroValueSuffix: config.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: config.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: config.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: config.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: config.ServiceSuffix, - }.NewConfig( - versionSpec, - ) -} - -func rulesForInternalRules(rules []*internal.Rule) []bufcheck.Rule { - if rules == nil { - return nil - } - s := make([]bufcheck.Rule, len(rules)) - for i, e := range rules { - s[i] = e - } - return s -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/buflintconfig.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/buflintconfig.go deleted file mode 100644 index 7cadf108b8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/buflintconfig.go +++ /dev/null @@ -1,360 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflintconfig - -import ( - "bytes" - "encoding/json" - "io" - "sort" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - lintv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1" -) - -const ( - // These versions match the versions in bufconfig. We cannot take an explicit dependency - // on bufconfig without creating a circular dependency. - v1Beta1Version = "v1beta1" - v1Version = "v1" -) - -// Config is the lint check config. -type Config struct { - // Use is a list of rule and/or category IDs that are included in the lint check. - Use []string - // Except is a list of the rule and/or category IDs that are excluded from the lint check. - Except []string - // IgnoreRootPaths is a list of paths of directories and/or files that should be ignored by the lint check. - // All paths are relative to the root of the module. - IgnoreRootPaths []string - // IgnoreIDOrCategoryToRootPaths is a map of rule and/or category IDs to directory and/or file paths to exclude from the - // lint check. - IgnoreIDOrCategoryToRootPaths map[string][]string - // EnumZeroValueSuffix controls the behavior of the ENUM_ZERO_VALUE lint rule ID. By default, this rule - // verifies that the zero value of all enums ends in _UNSPECIFIED. This config allows the user to override - // this value with the given string. - EnumZeroValueSuffix string - // RPCAllowSameRequestResponse allows the same message type for both the request and response of an RPC. - RPCAllowSameRequestResponse bool - // RPCAllowGoogleProtobufEmptyRequests allows the RPC requests to use the google.protobuf.Empty message. - RPCAllowGoogleProtobufEmptyRequests bool - // RPCAllowGoogleProtobufEmptyResponse allows the RPC responses to use the google.protobuf.Empty message. - RPCAllowGoogleProtobufEmptyResponses bool - // ServiceSuffix applies to the SERVICE_SUFFIX rule ID. By default, the rule verifies that all service names - // end with the suffix Service. This allows users to override the value with the given string. - ServiceSuffix string - // AllowCommentIgnores turns on comment-driven ignores. - AllowCommentIgnores bool - // Version represents the version of the lint rule and category IDs that should be used with this config. - Version string -} - -// NewConfigV1Beta1 returns a new Config. -func NewConfigV1Beta1(externalConfig ExternalConfigV1Beta1) *Config { - return &Config{ - Use: externalConfig.Use, - Except: externalConfig.Except, - IgnoreRootPaths: externalConfig.Ignore, - IgnoreIDOrCategoryToRootPaths: externalConfig.IgnoreOnly, - EnumZeroValueSuffix: externalConfig.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: externalConfig.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: externalConfig.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: externalConfig.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: externalConfig.ServiceSuffix, - AllowCommentIgnores: externalConfig.AllowCommentIgnores, - Version: v1Beta1Version, - } -} - -// NewConfigV1 returns a new Config. -func NewConfigV1(externalConfig ExternalConfigV1) *Config { - return &Config{ - Use: externalConfig.Use, - Except: externalConfig.Except, - IgnoreRootPaths: externalConfig.Ignore, - IgnoreIDOrCategoryToRootPaths: externalConfig.IgnoreOnly, - EnumZeroValueSuffix: externalConfig.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: externalConfig.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: externalConfig.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: externalConfig.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: externalConfig.ServiceSuffix, - AllowCommentIgnores: externalConfig.AllowCommentIgnores, - Version: v1Version, - } -} - -// ConfigForProto returns the Config given the proto. -func ConfigForProto(protoConfig *lintv1.Config) *Config { - return &Config{ - Use: protoConfig.GetUseIds(), - Except: protoConfig.GetExceptIds(), - IgnoreRootPaths: protoConfig.GetIgnorePaths(), - IgnoreIDOrCategoryToRootPaths: ignoreIDOrCategoryToRootPathsForProto(protoConfig.GetIgnoreIdPaths()), - EnumZeroValueSuffix: protoConfig.GetEnumZeroValueSuffix(), - RPCAllowSameRequestResponse: protoConfig.GetRpcAllowSameRequestResponse(), - RPCAllowGoogleProtobufEmptyRequests: protoConfig.GetRpcAllowGoogleProtobufEmptyRequests(), - RPCAllowGoogleProtobufEmptyResponses: protoConfig.GetRpcAllowGoogleProtobufEmptyResponses(), - ServiceSuffix: protoConfig.GetServiceSuffix(), - AllowCommentIgnores: protoConfig.GetAllowCommentIgnores(), - Version: protoConfig.GetVersion(), - } -} - -// ProtoForConfig takes a *Config and returns the proto representation. -func ProtoForConfig(config *Config) *lintv1.Config { - return &lintv1.Config{ - UseIds: config.Use, - ExceptIds: config.Except, - IgnorePaths: config.IgnoreRootPaths, - IgnoreIdPaths: protoForIgnoreIDOrCategoryToRootPaths(config.IgnoreIDOrCategoryToRootPaths), - EnumZeroValueSuffix: config.EnumZeroValueSuffix, - RpcAllowSameRequestResponse: config.RPCAllowSameRequestResponse, - RpcAllowGoogleProtobufEmptyRequests: config.RPCAllowGoogleProtobufEmptyRequests, - RpcAllowGoogleProtobufEmptyResponses: config.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: config.ServiceSuffix, - AllowCommentIgnores: config.AllowCommentIgnores, - Version: config.Version, - } -} - -// ExternalConfigV1Beta1 is an external config. -type ExternalConfigV1Beta1 struct { - Use []string `json:"use,omitempty" yaml:"use,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - // IgnoreRootPaths - Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"` - // IgnoreIDOrCategoryToRootPaths - IgnoreOnly map[string][]string `json:"ignore_only,omitempty" yaml:"ignore_only,omitempty"` - EnumZeroValueSuffix string `json:"enum_zero_value_suffix,omitempty" yaml:"enum_zero_value_suffix,omitempty"` - RPCAllowSameRequestResponse bool `json:"rpc_allow_same_request_response,omitempty" yaml:"rpc_allow_same_request_response,omitempty"` - RPCAllowGoogleProtobufEmptyRequests bool `json:"rpc_allow_google_protobuf_empty_requests,omitempty" yaml:"rpc_allow_google_protobuf_empty_requests,omitempty"` - RPCAllowGoogleProtobufEmptyResponses bool `json:"rpc_allow_google_protobuf_empty_responses,omitempty" yaml:"rpc_allow_google_protobuf_empty_responses,omitempty"` - ServiceSuffix string `json:"service_suffix,omitempty" yaml:"service_suffix,omitempty"` - AllowCommentIgnores bool `json:"allow_comment_ignores,omitempty" yaml:"allow_comment_ignores,omitempty"` -} - -// ExternalConfigV1 is an external config. -type ExternalConfigV1 struct { - Use []string `json:"use,omitempty" yaml:"use,omitempty"` - Except []string `json:"except,omitempty" yaml:"except,omitempty"` - // IgnoreRootPaths - Ignore []string `json:"ignore,omitempty" yaml:"ignore,omitempty"` - // IgnoreIDOrCategoryToRootPaths - IgnoreOnly map[string][]string `json:"ignore_only,omitempty" yaml:"ignore_only,omitempty"` - EnumZeroValueSuffix string `json:"enum_zero_value_suffix,omitempty" yaml:"enum_zero_value_suffix,omitempty"` - RPCAllowSameRequestResponse bool `json:"rpc_allow_same_request_response,omitempty" yaml:"rpc_allow_same_request_response,omitempty"` - RPCAllowGoogleProtobufEmptyRequests bool `json:"rpc_allow_google_protobuf_empty_requests,omitempty" yaml:"rpc_allow_google_protobuf_empty_requests,omitempty"` - RPCAllowGoogleProtobufEmptyResponses bool `json:"rpc_allow_google_protobuf_empty_responses,omitempty" yaml:"rpc_allow_google_protobuf_empty_responses,omitempty"` - ServiceSuffix string `json:"service_suffix,omitempty" yaml:"service_suffix,omitempty"` - AllowCommentIgnores bool `json:"allow_comment_ignores,omitempty" yaml:"allow_comment_ignores,omitempty"` -} - -// ExternalConfigV1Beta1ForConfig takes a *Config and returns the v1beta1 externalconfig representation. -func ExternalConfigV1Beta1ForConfig(config *Config) ExternalConfigV1Beta1 { - return ExternalConfigV1Beta1{ - Use: config.Use, - Except: config.Except, - Ignore: config.IgnoreRootPaths, - IgnoreOnly: config.IgnoreIDOrCategoryToRootPaths, - EnumZeroValueSuffix: config.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: config.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: config.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: config.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: config.ServiceSuffix, - AllowCommentIgnores: config.AllowCommentIgnores, - } -} - -// ExternalConfigV1ForConfig takes a *Config and returns the v1 externalconfig representation. -func ExternalConfigV1ForConfig(config *Config) ExternalConfigV1 { - return ExternalConfigV1{ - Use: config.Use, - Except: config.Except, - Ignore: config.IgnoreRootPaths, - IgnoreOnly: config.IgnoreIDOrCategoryToRootPaths, - EnumZeroValueSuffix: config.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: config.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: config.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: config.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: config.ServiceSuffix, - AllowCommentIgnores: config.AllowCommentIgnores, - } -} - -// BytesForConfig takes a *Config and returns the deterministic []byte representation. -// We use an unexported intermediary JSON form and sort all fields to ensure that the bytes -// associated with the *Config are deterministic. -func BytesForConfig(config *Config) ([]byte, error) { - if config == nil { - return nil, nil - } - return json.Marshal(configToJSON(config)) -} - -type configJSON struct { - Use []string `json:"use,omitempty"` - Except []string `json:"except,omitempty"` - IgnoreRootPaths []string `json:"ignore_root_paths,omitempty"` - IgnoreIDOrCategoryToRootPaths []idPathsJSON `json:"ignore_id_to_root_paths,omitempty"` - EnumZeroValueSuffix string `json:"enum_zero_value_suffix,omitempty"` - RPCAllowSameRequestResponse bool `json:"rpc_allow_same_request_response,omitempty"` - RPCAllowGoogleProtobufEmptyRequests bool `json:"rpc_allow_google_protobuf_empty_requests,omitempty"` - RPCAllowGoogleProtobufEmptyResponses bool `json:"rpc_allow_google_protobuf_empty_response,omitempty"` - ServiceSuffix string `json:"service_suffix,omitempty"` - AllowCommentIgnores bool `json:"allow_comment_ignores,omitempty"` - Version string `json:"version,omitempty"` -} - -type idPathsJSON struct { - ID string `json:"id,omitempty"` - Paths []string `json:"paths,omitempty"` -} - -func configToJSON(config *Config) *configJSON { - ignoreIDPathsJSON := make([]idPathsJSON, 0, len(config.IgnoreIDOrCategoryToRootPaths)) - for ignoreID, rootPaths := range config.IgnoreIDOrCategoryToRootPaths { - rootPathsCopy := make([]string, len(rootPaths)) - copy(rootPathsCopy, rootPaths) - sort.Strings(rootPathsCopy) - ignoreIDPathsJSON = append(ignoreIDPathsJSON, idPathsJSON{ - ID: ignoreID, - Paths: rootPathsCopy, - }) - } - sort.Slice(ignoreIDPathsJSON, func(i, j int) bool { return ignoreIDPathsJSON[i].ID < ignoreIDPathsJSON[j].ID }) - // We should not be sorting in place for the config structure, since it will mutate the - // underlying config ordering. - use := make([]string, len(config.Use)) - copy(use, config.Use) - except := make([]string, len(config.Except)) - copy(except, config.Except) - ignoreRootPaths := make([]string, len(config.IgnoreRootPaths)) - copy(ignoreRootPaths, config.IgnoreRootPaths) - sort.Strings(use) - sort.Strings(except) - sort.Strings(ignoreRootPaths) - return &configJSON{ - Use: use, - Except: except, - IgnoreRootPaths: ignoreRootPaths, - IgnoreIDOrCategoryToRootPaths: ignoreIDPathsJSON, - EnumZeroValueSuffix: config.EnumZeroValueSuffix, - RPCAllowSameRequestResponse: config.RPCAllowSameRequestResponse, - RPCAllowGoogleProtobufEmptyRequests: config.RPCAllowGoogleProtobufEmptyRequests, - RPCAllowGoogleProtobufEmptyResponses: config.RPCAllowGoogleProtobufEmptyResponses, - ServiceSuffix: config.ServiceSuffix, - AllowCommentIgnores: config.AllowCommentIgnores, - Version: config.Version, - } -} - -// PrintFileAnnotations prints the FileAnnotations to the Writer. -// -// Also accepts config-ignore-yaml. -func PrintFileAnnotations( - writer io.Writer, - fileAnnotations []bufanalysis.FileAnnotation, - formatString string, -) error { - switch s := strings.ToLower(strings.TrimSpace(formatString)); s { - case "config-ignore-yaml": - return printFileAnnotationsConfigIgnoreYAML(writer, fileAnnotations) - default: - return bufanalysis.PrintFileAnnotations(writer, fileAnnotations, s) - } -} - -func printFileAnnotationsConfigIgnoreYAML( - writer io.Writer, - fileAnnotations []bufanalysis.FileAnnotation, -) error { - if len(fileAnnotations) == 0 { - return nil - } - ignoreIDToRootPathMap := make(map[string]map[string]struct{}) - for _, fileAnnotation := range fileAnnotations { - fileInfo := fileAnnotation.FileInfo() - if fileInfo == nil || fileAnnotation.Type() == "" { - continue - } - rootPathMap, ok := ignoreIDToRootPathMap[fileAnnotation.Type()] - if !ok { - rootPathMap = make(map[string]struct{}) - ignoreIDToRootPathMap[fileAnnotation.Type()] = rootPathMap - } - rootPathMap[fileInfo.Path()] = struct{}{} - } - if len(ignoreIDToRootPathMap) == 0 { - return nil - } - - sortedIgnoreIDs := make([]string, 0, len(ignoreIDToRootPathMap)) - ignoreIDToSortedRootPaths := make(map[string][]string, len(ignoreIDToRootPathMap)) - for id, rootPathMap := range ignoreIDToRootPathMap { - sortedIgnoreIDs = append(sortedIgnoreIDs, id) - rootPaths := make([]string, 0, len(rootPathMap)) - for rootPath := range rootPathMap { - rootPaths = append(rootPaths, rootPath) - } - sort.Strings(rootPaths) - ignoreIDToSortedRootPaths[id] = rootPaths - } - sort.Strings(sortedIgnoreIDs) - - buffer := bytes.NewBuffer(nil) - _, _ = buffer.WriteString(`version: v1 -lint: - ignore_only: -`) - for _, id := range sortedIgnoreIDs { - _, _ = buffer.WriteString(" ") - _, _ = buffer.WriteString(id) - _, _ = buffer.WriteString(":\n") - for _, rootPath := range ignoreIDToSortedRootPaths[id] { - _, _ = buffer.WriteString(" - ") - _, _ = buffer.WriteString(rootPath) - _, _ = buffer.WriteString("\n") - } - } - _, err := writer.Write(buffer.Bytes()) - return err -} - -func ignoreIDOrCategoryToRootPathsForProto(protoIgnoreIDPaths []*lintv1.IDPaths) map[string][]string { - if protoIgnoreIDPaths == nil { - return nil - } - ignoreIDOrCategoryToRootPaths := make(map[string][]string) - for _, protoIgnoreIDPath := range protoIgnoreIDPaths { - ignoreIDOrCategoryToRootPaths[protoIgnoreIDPath.GetId()] = protoIgnoreIDPath.GetPaths() - } - return ignoreIDOrCategoryToRootPaths -} - -func protoForIgnoreIDOrCategoryToRootPaths(ignoreIDOrCategoryToRootPaths map[string][]string) []*lintv1.IDPaths { - if ignoreIDOrCategoryToRootPaths == nil { - return nil - } - idPathsProto := make([]*lintv1.IDPaths, 0, len(ignoreIDOrCategoryToRootPaths)) - for id, paths := range ignoreIDOrCategoryToRootPaths { - idPathsProto = append(idPathsProto, &lintv1.IDPaths{ - Id: id, - Paths: paths, - }) - } - return idPathsProto -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/usage.gen.go deleted file mode 100644 index f12b222cf4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflintconfig - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/handler.go deleted file mode 100644 index 5203dad98f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/handler.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflint - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil" - "github.com/bufbuild/buf/private/pkg/protosource" - "go.uber.org/zap" -) - -type handler struct { - logger *zap.Logger - runner *internal.Runner -} - -func newHandler(logger *zap.Logger) *handler { - return &handler{ - logger: logger, - // linting allows for comment ignores - // note that comment ignores still need to be enabled within the config - // for a given check, this just says that comment ignores are allowed - // in the first place - runner: internal.NewRunner( - logger, - internal.RunnerWithIgnorePrefix(buflintcheck.CommentIgnorePrefix), - ), - } -} - -func (h *handler) Check( - ctx context.Context, - config *buflintconfig.Config, - image bufimage.Image, -) ([]bufanalysis.FileAnnotation, error) { - files, err := protosource.NewFilesUnstable(ctx, bufimageutil.NewInputFiles(image.Files())...) - if err != nil { - return nil, err - } - internalConfig, err := internalConfigForConfig(config) - if err != nil { - return nil, err - } - return h.runner.Check(ctx, internalConfig, nil, files) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/buflintbuild.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/buflintbuild.go deleted file mode 100644 index e54fd45ec2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/buflintbuild.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflintbuild contains the RuleBuilders used by buflintv*. -package buflintbuild - -import ( - "errors" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/pkg/protosource" -) - -var ( - // CommentEnumRuleBuilder is a rule builder. - CommentEnumRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_ENUM", - "enums have non-empty comments", - newAdapter(buflintcheck.CheckCommentEnum), - ) - // CommentEnumValueRuleBuilder is a rule builder. - CommentEnumValueRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_ENUM_VALUE", - "enum values have non-empty comments", - newAdapter(buflintcheck.CheckCommentEnumValue), - ) - // CommentFieldRuleBuilder is a rule builder. - CommentFieldRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_FIELD", - "fields have non-empty comments", - newAdapter(buflintcheck.CheckCommentField), - ) - // CommentMessageRuleBuilder is a rule builder. - CommentMessageRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_MESSAGE", - "messages have non-empty comments", - newAdapter(buflintcheck.CheckCommentMessage), - ) - // CommentOneofRuleBuilder is a rule builder. - CommentOneofRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_ONEOF", - "oneof have non-empty comments", - newAdapter(buflintcheck.CheckCommentOneof), - ) - // CommentRPCRuleBuilder is a rule builder. - CommentRPCRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_RPC", - "RPCs have non-empty comments", - newAdapter(buflintcheck.CheckCommentRPC), - ) - // CommentServiceRuleBuilder is a rule builder. - CommentServiceRuleBuilder = internal.NewNopRuleBuilder( - "COMMENT_SERVICE", - "services have non-empty comments", - newAdapter(buflintcheck.CheckCommentService), - ) - // DirectorySamePackageRuleBuilder is a rule builder. - DirectorySamePackageRuleBuilder = internal.NewNopRuleBuilder( - "DIRECTORY_SAME_PACKAGE", - "all files in a given directory are in the same package", - newAdapter(buflintcheck.CheckDirectorySamePackage), - ) - // EnumFirstValueZeroRuleBuilder is a rule builder. - EnumFirstValueZeroRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_FIRST_VALUE_ZERO", - "all first values of enums have a numeric value of 0", - newAdapter(buflintcheck.CheckEnumFirstValueZero), - ) - // EnumNoAllowAliasRuleBuilder is a rule builder. - EnumNoAllowAliasRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_NO_ALLOW_ALIAS", - "enums do not have the allow_alias option set", - newAdapter(buflintcheck.CheckEnumNoAllowAlias), - ) - // EnumPascalCaseRuleBuilder is a rule builder. - EnumPascalCaseRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_PASCAL_CASE", - "enums are PascalCase", - newAdapter(buflintcheck.CheckEnumPascalCase), - ) - // EnumValuePrefixRuleBuilder is a rule builder. - EnumValuePrefixRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_PREFIX", - "enum values are prefixed with ENUM_NAME_UPPER_SNAKE_CASE", - newAdapter(buflintcheck.CheckEnumValuePrefix), - ) - // EnumValueUpperSnakeCaseRuleBuilder is a rule builder. - EnumValueUpperSnakeCaseRuleBuilder = internal.NewNopRuleBuilder( - "ENUM_VALUE_UPPER_SNAKE_CASE", - "enum values are UPPER_SNAKE_CASE", - newAdapter(buflintcheck.CheckEnumValueUpperSnakeCase), - ) - // EnumZeroValueSuffixRuleBuilder is a rule builder. - EnumZeroValueSuffixRuleBuilder = internal.NewRuleBuilder( - "ENUM_ZERO_VALUE_SUFFIX", - func(configBuilder internal.ConfigBuilder) (string, error) { - if configBuilder.EnumZeroValueSuffix == "" { - return "", errors.New("enum_zero_value_suffix is empty") - } - return "enum zero values are suffixed with " + configBuilder.EnumZeroValueSuffix + " (suffix is configurable)", nil - }, - func(configBuilder internal.ConfigBuilder) (internal.CheckFunc, error) { - if configBuilder.EnumZeroValueSuffix == "" { - return nil, errors.New("enum_zero_value_suffix is empty") - } - return internal.CheckFunc(func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return buflintcheck.CheckEnumZeroValueSuffix(id, ignoreFunc, files, configBuilder.EnumZeroValueSuffix) - }), nil - }, - ) - // FieldLowerSnakeCaseRuleBuilder is a rule builder. - FieldLowerSnakeCaseRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_LOWER_SNAKE_CASE", - "field names are lower_snake_case", - newAdapter(buflintcheck.CheckFieldLowerSnakeCase), - ) - // FieldNoDescriptorRuleBuilder is a rule builder. - FieldNoDescriptorRuleBuilder = internal.NewNopRuleBuilder( - "FIELD_NO_DESCRIPTOR", - `field names are not name capitalization of "descriptor" with any number of prefix or suffix underscores`, - newAdapter(buflintcheck.CheckFieldNoDescriptor), - ) - // FileLowerSnakeCaseRuleBuilder is a rule builder. - FileLowerSnakeCaseRuleBuilder = internal.NewNopRuleBuilder( - "FILE_LOWER_SNAKE_CASE", - "filenames are lower_snake_case", - newAdapter(buflintcheck.CheckFileLowerSnakeCase), - ) - // ImportNoPublicRuleBuilder is a rule builder. - ImportNoPublicRuleBuilder = internal.NewNopRuleBuilder( - "IMPORT_NO_PUBLIC", - "imports are not public", - newAdapter(buflintcheck.CheckImportNoPublic), - ) - // ImportNoWeakRuleBuilder is a rule builder. - ImportNoWeakRuleBuilder = internal.NewNopRuleBuilder( - "IMPORT_NO_WEAK", - "imports are not weak", - newAdapter(buflintcheck.CheckImportNoWeak), - ) - // ImportUsedRuleBuilder is a rule builder. - ImportUsedRuleBuilder = internal.NewNopRuleBuilder( - "IMPORT_USED", - "imports are used", - newAdapter(buflintcheck.CheckImportUsed), - ) - // MessagePascalCaseRuleBuilder is a rule builder. - MessagePascalCaseRuleBuilder = internal.NewNopRuleBuilder( - "MESSAGE_PASCAL_CASE", - "messages are PascalCase", - newAdapter(buflintcheck.CheckMessagePascalCase), - ) - // OneofLowerSnakeCaseRuleBuilder is a rule builder. - OneofLowerSnakeCaseRuleBuilder = internal.NewNopRuleBuilder( - "ONEOF_LOWER_SNAKE_CASE", - "oneof names are lower_snake_case", - newAdapter(buflintcheck.CheckOneofLowerSnakeCase), - ) - // PackageDefinedRuleBuilder is a rule builder. - PackageDefinedRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_DEFINED", - "all files have a package defined", - newAdapter(buflintcheck.CheckPackageDefined), - ) - // PackageDirectoryMatchRuleBuilder is a rule builder. - PackageDirectoryMatchRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_DIRECTORY_MATCH", - "all files are in a directory that matches their package name", - newAdapter(buflintcheck.CheckPackageDirectoryMatch), - ) - // PackageLowerSnakeCaseRuleBuilder is a rule builder. - PackageLowerSnakeCaseRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_LOWER_SNAKE_CASE", - "packages are lower_snake.case", - newAdapter(buflintcheck.CheckPackageLowerSnakeCase), - ) - // PackageNoImportCycleRuleBuilder is a rule builder. - PackageNoImportCycleRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_NO_IMPORT_CYCLE", - "packages do not have import cycles", - newAdapter(buflintcheck.CheckPackageNoImportCycle), - ) - // PackageSameCsharpNamespaceRuleBuilder is a rule builder. - PackageSameCsharpNamespaceRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_CSHARP_NAMESPACE", - "all files with a given package have the same value for the csharp_namespace option", - newAdapter(buflintcheck.CheckPackageSameCsharpNamespace), - ) - // PackageSameDirectoryRuleBuilder is a rule builder. - PackageSameDirectoryRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_DIRECTORY", - "all files with a given package are in the same directory", - newAdapter(buflintcheck.CheckPackageSameDirectory), - ) - // PackageSameGoPackageRuleBuilder is a rule builder. - PackageSameGoPackageRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_GO_PACKAGE", - "all files with a given package have the same value for the go_package option", - newAdapter(buflintcheck.CheckPackageSameGoPackage), - ) - // PackageSameJavaMultipleFilesRuleBuilder is a rule builder. - PackageSameJavaMultipleFilesRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_JAVA_MULTIPLE_FILES", - "all files with a given package have the same value for the java_multiple_files option", - newAdapter(buflintcheck.CheckPackageSameJavaMultipleFiles), - ) - // PackageSameJavaPackageRuleBuilder is a rule builder. - PackageSameJavaPackageRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_JAVA_PACKAGE", - "all files with a given package have the same value for the java_package option", - newAdapter(buflintcheck.CheckPackageSameJavaPackage), - ) - // PackageSamePhpNamespaceRuleBuilder is a rule builder. - PackageSamePhpNamespaceRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_PHP_NAMESPACE", - "all files with a given package have the same value for the php_namespace option", - newAdapter(buflintcheck.CheckPackageSamePhpNamespace), - ) - // PackageSameRubyPackageRuleBuilder is a rule builder. - PackageSameRubyPackageRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_RUBY_PACKAGE", - "all files with a given package have the same value for the ruby_package option", - newAdapter(buflintcheck.CheckPackageSameRubyPackage), - ) - // PackageSameSwiftPrefixRuleBuilder is a rule builder. - PackageSameSwiftPrefixRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_SAME_SWIFT_PREFIX", - "all files with a given package have the same value for the swift_prefix option", - newAdapter(buflintcheck.CheckPackageSameSwiftPrefix), - ) - // PackageVersionSuffixRuleBuilder is a rule builder. - PackageVersionSuffixRuleBuilder = internal.NewNopRuleBuilder( - "PACKAGE_VERSION_SUFFIX", - `the last component of all packages is a version of the form v\d+, v\d+test.*, v\d+(alpha|beta)\d+, or v\d+p\d+(alpha|beta)\d+, where numbers are >=1`, - newAdapter(buflintcheck.CheckPackageVersionSuffix), - ) - // RPCNoClientStreamingRuleBuilder is a rule builder. - RPCNoClientStreamingRuleBuilder = internal.NewNopRuleBuilder( - "RPC_NO_CLIENT_STREAMING", - "RPCs are not client streaming", - newAdapter(buflintcheck.CheckRPCNoClientStreaming), - ) - // RPCNoServerStreamingRuleBuilder is a rule builder. - RPCNoServerStreamingRuleBuilder = internal.NewNopRuleBuilder( - "RPC_NO_SERVER_STREAMING", - "RPCs are not server streaming", - newAdapter(buflintcheck.CheckRPCNoServerStreaming), - ) - // RPCPascalCaseRuleBuilder is a rule builder. - RPCPascalCaseRuleBuilder = internal.NewNopRuleBuilder( - "RPC_PASCAL_CASE", - "RPCs are PascalCase", - newAdapter(buflintcheck.CheckRPCPascalCase), - ) - // RPCRequestResponseUniqueRuleBuilder is a rule builder. - RPCRequestResponseUniqueRuleBuilder = internal.NewRuleBuilder( - "RPC_REQUEST_RESPONSE_UNIQUE", - func(configBuilder internal.ConfigBuilder) (string, error) { - return "RPC request and response types are only used in one RPC (configurable)", nil - }, - func(configBuilder internal.ConfigBuilder) (internal.CheckFunc, error) { - return internal.CheckFunc(func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return buflintcheck.CheckRPCRequestResponseUnique( - id, - ignoreFunc, - files, - configBuilder.RPCAllowSameRequestResponse, - configBuilder.RPCAllowGoogleProtobufEmptyRequests, - configBuilder.RPCAllowGoogleProtobufEmptyResponses, - ) - }), nil - }, - ) - // RPCRequestStandardNameRuleBuilder is a rule builder. - RPCRequestStandardNameRuleBuilder = internal.NewRuleBuilder( - "RPC_REQUEST_STANDARD_NAME", - func(configBuilder internal.ConfigBuilder) (string, error) { - return "RPC request type names are RPCNameRequest or ServiceNameRPCNameRequest (configurable)", nil - }, - func(configBuilder internal.ConfigBuilder) (internal.CheckFunc, error) { - return internal.CheckFunc(func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return buflintcheck.CheckRPCRequestStandardName( - id, - ignoreFunc, - files, - configBuilder.RPCAllowGoogleProtobufEmptyRequests, - ) - }), nil - }, - ) - // RPCResponseStandardNameRuleBuilder is a rule builder. - RPCResponseStandardNameRuleBuilder = internal.NewRuleBuilder( - "RPC_RESPONSE_STANDARD_NAME", - func(configBuilder internal.ConfigBuilder) (string, error) { - return "RPC response type names are RPCNameResponse or ServiceNameRPCNameResponse (configurable)", nil - }, - func(configBuilder internal.ConfigBuilder) (internal.CheckFunc, error) { - return internal.CheckFunc(func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return buflintcheck.CheckRPCResponseStandardName( - id, - ignoreFunc, - files, - configBuilder.RPCAllowGoogleProtobufEmptyResponses, - ) - }), nil - }, - ) - // ServicePascalCaseRuleBuilder is a rule builder. - ServicePascalCaseRuleBuilder = internal.NewNopRuleBuilder( - "SERVICE_PASCAL_CASE", - "services are PascalCase", - newAdapter(buflintcheck.CheckServicePascalCase), - ) - // ServiceSuffixRuleBuilder is a rule builder. - ServiceSuffixRuleBuilder = internal.NewRuleBuilder( - "SERVICE_SUFFIX", - func(configBuilder internal.ConfigBuilder) (string, error) { - if configBuilder.ServiceSuffix == "" { - return "", errors.New("service_suffix is empty") - } - return "services are suffixed with " + configBuilder.ServiceSuffix + " (suffix is configurable)", nil - }, - func(configBuilder internal.ConfigBuilder) (internal.CheckFunc, error) { - if configBuilder.ServiceSuffix == "" { - return nil, errors.New("service_suffix is empty") - } - return internal.CheckFunc(func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return buflintcheck.CheckServiceSuffix(id, ignoreFunc, files, configBuilder.ServiceSuffix) - }), nil - }, - ) - // SyntaxSpecifiedRuleBuilder is a rule builder. - SyntaxSpecifiedRuleBuilder = internal.NewNopRuleBuilder( - "SYNTAX_SPECIFIED", - "all files have a syntax specified", - newAdapter(buflintcheck.CheckSyntaxSpecified), - ) -) - -func newAdapter( - f func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error), -) func(string, internal.IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return func(id string, ignoreFunc internal.IgnoreFunc, _ []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return f(id, ignoreFunc, files) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/usage.gen.go deleted file mode 100644 index a34e24a114..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflintbuild - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/buflintcheck.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/buflintcheck.go deleted file mode 100644 index 1ad4271e9c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/buflintcheck.go +++ /dev/null @@ -1,965 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflintcheck impelements the check functions. -// -// These are used by buflintbuild to create RuleBuilders. -package buflintcheck - -import ( - "errors" - "fmt" - "strconv" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/protosource" - "github.com/bufbuild/buf/private/pkg/protoversion" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -const ( - // CommentIgnorePrefix is the comment ignore prefix. - // - // Comments with this prefix do not count towards valid comments in the comment checkers. - // This is also used in buflint when constructing a new Runner, and is passed to the - // RunnerWithIgnorePrefix option. - CommentIgnorePrefix = "buf:lint:ignore" -) - -var ( - // CheckCommentEnum is a check function. - CheckCommentEnum = newEnumCheckFunc(checkCommentEnum) - // CheckCommentEnumValue is a check function. - CheckCommentEnumValue = newEnumValueCheckFunc(checkCommentEnumValue) - // CheckCommentField is a check function. - CheckCommentField = newFieldCheckFunc(checkCommentField) - // CheckCommentMessage is a check function. - CheckCommentMessage = newMessageCheckFunc(checkCommentMessage) - // CheckCommentOneof is a check function. - CheckCommentOneof = newOneofCheckFunc(checkCommentOneof) - // CheckCommentService is a check function. - CheckCommentService = newServiceCheckFunc(checkCommentService) - // CheckCommentRPC is a check function. - CheckCommentRPC = newMethodCheckFunc(checkCommentRPC) -) - -func checkCommentEnum(add addFunc, value protosource.Enum) error { - return checkCommentNamedDescriptor(add, value, "Enum") -} - -func checkCommentEnumValue(add addFunc, value protosource.EnumValue) error { - return checkCommentNamedDescriptor(add, value, "Enum value") -} - -func checkCommentField(add addFunc, value protosource.Field) error { - return checkCommentNamedDescriptor(add, value, "Field") -} - -func checkCommentMessage(add addFunc, value protosource.Message) error { - return checkCommentNamedDescriptor(add, value, "Message") -} - -func checkCommentOneof(add addFunc, value protosource.Oneof) error { - return checkCommentNamedDescriptor(add, value, "Oneof") -} - -func checkCommentRPC(add addFunc, value protosource.Method) error { - return checkCommentNamedDescriptor(add, value, "RPC") -} - -func checkCommentService(add addFunc, value protosource.Service) error { - return checkCommentNamedDescriptor(add, value, "Service") -} - -func checkCommentNamedDescriptor( - add addFunc, - namedDescriptor protosource.NamedDescriptor, - typeName string, -) error { - location := namedDescriptor.Location() - if location == nil { - // this will magically skip map entry fields as well as a side-effect, although originally unintended - return nil - } - if !validLeadingComment(location.LeadingComments()) { - add(namedDescriptor, location, nil, "%s %q should have a non-empty comment for documentation.", typeName, namedDescriptor.Name()) - } - return nil -} - -// CheckDirectorySamePackage is a check function. -var CheckDirectorySamePackage = newDirToFilesCheckFunc(checkDirectorySamePackage) - -func checkDirectorySamePackage(add addFunc, dirPath string, files []protosource.File) error { - pkgMap := make(map[string]struct{}) - for _, file := range files { - // works for no package set as this will result in "" which is a valid map key - pkgMap[file.Package()] = struct{}{} - } - if len(pkgMap) > 1 { - var messagePrefix string - if _, ok := pkgMap[""]; ok { - delete(pkgMap, "") - if len(pkgMap) > 1 { - messagePrefix = fmt.Sprintf("Multiple packages %q and file with no package", strings.Join(stringutil.MapToSortedSlice(pkgMap), ",")) - } else { - // Join works with only one element as well by adding no comma - messagePrefix = fmt.Sprintf("Package %q and file with no package", strings.Join(stringutil.MapToSortedSlice(pkgMap), ",")) - } - } else { - messagePrefix = fmt.Sprintf("Multiple packages %q", strings.Join(stringutil.MapToSortedSlice(pkgMap), ",")) - } - for _, file := range files { - add(file, file.PackageLocation(), nil, "%s detected within directory %q.", messagePrefix, dirPath) - } - } - return nil -} - -// CheckEnumNoAllowAlias is a check function. -var CheckEnumNoAllowAlias = newEnumCheckFunc(checkEnumNoAllowAlias) - -func checkEnumNoAllowAlias(add addFunc, enum protosource.Enum) error { - if enum.AllowAlias() { - add(enum, enum.AllowAliasLocation(), nil, `Enum option "allow_alias" on enum %q must be false.`, enum.Name()) - } - return nil -} - -// CheckEnumPascalCase is a check function. -var CheckEnumPascalCase = newEnumCheckFunc(checkEnumPascalCase) - -func checkEnumPascalCase(add addFunc, enum protosource.Enum) error { - name := enum.Name() - expectedName := stringutil.ToPascalCase(name) - if name != expectedName { - add(enum, enum.NameLocation(), nil, "Enum name %q should be PascalCase, such as %q.", name, expectedName) - } - return nil -} - -// CheckEnumFirstValueZero is a check function. -var CheckEnumFirstValueZero = newEnumCheckFunc(checkEnumFirstValueZero) - -func checkEnumFirstValueZero(add addFunc, enum protosource.Enum) error { - if values := enum.Values(); len(values) > 0 { - if firstEnumValue := values[0]; firstEnumValue.Number() != 0 { - // proto3 compilation references the number - add( - firstEnumValue, - firstEnumValue.NumberLocation(), - // also check the name location for this comment ignore, as the number location might not have the comment - // see https://github.com/bufbuild/buf/issues/1186 - // also check the enum for this comment ignore - // this allows users to set this "globally" for an enum - // see https://github.com/bufbuild/buf/issues/161 - []protosource.Location{ - firstEnumValue.NameLocation(), - firstEnumValue.Enum().Location(), - }, - "First enum value %q should have a numeric value of 0", - firstEnumValue.Name(), - ) - } - } - return nil -} - -// CheckEnumValuePrefix is a check function. -var CheckEnumValuePrefix = newEnumValueCheckFunc(checkEnumValuePrefix) - -func checkEnumValuePrefix(add addFunc, enumValue protosource.EnumValue) error { - name := enumValue.Name() - expectedPrefix := fieldToUpperSnakeCase(enumValue.Enum().Name()) + "_" - if !strings.HasPrefix(name, expectedPrefix) { - add( - enumValue, - enumValue.NameLocation(), - // also check the enum for this comment ignore - // this allows users to set this "globally" for an enum - // this came up in https://github.com/bufbuild/buf/issues/161 - []protosource.Location{ - enumValue.Enum().Location(), - }, - "Enum value name %q should be prefixed with %q.", - name, - expectedPrefix, - ) - } - return nil -} - -// CheckEnumValueUpperSnakeCase is a check function. -var CheckEnumValueUpperSnakeCase = newEnumValueCheckFunc(checkEnumValueUpperSnakeCase) - -func checkEnumValueUpperSnakeCase(add addFunc, enumValue protosource.EnumValue) error { - name := enumValue.Name() - expectedName := fieldToUpperSnakeCase(name) - if name != expectedName { - add( - enumValue, - enumValue.NameLocation(), - // also check the enum for this comment ignore - // this allows users to set this "globally" for an enum - []protosource.Location{ - enumValue.Enum().Location(), - }, - "Enum value name %q should be UPPER_SNAKE_CASE, such as %q.", - name, - expectedName, - ) - } - return nil -} - -// CheckEnumZeroValueSuffix is a check function. -var CheckEnumZeroValueSuffix = func( - id string, - ignoreFunc internal.IgnoreFunc, - files []protosource.File, - suffix string, -) ([]bufanalysis.FileAnnotation, error) { - return newEnumValueCheckFunc( - func(add addFunc, enumValue protosource.EnumValue) error { - return checkEnumZeroValueSuffix(add, enumValue, suffix) - }, - )(id, ignoreFunc, files) -} - -func checkEnumZeroValueSuffix(add addFunc, enumValue protosource.EnumValue, suffix string) error { - if enumValue.Number() != 0 { - return nil - } - name := enumValue.Name() - if !strings.HasSuffix(name, suffix) { - add( - enumValue, - enumValue.NameLocation(), - // also check the enum for this comment ignore - // this allows users to set this "globally" for an enum - []protosource.Location{ - enumValue.Enum().Location(), - }, - "Enum zero value name %q should be suffixed with %q.", - name, - suffix, - ) - } - return nil -} - -// CheckFieldLowerSnakeCase is a check function. -var CheckFieldLowerSnakeCase = newFieldCheckFunc(checkFieldLowerSnakeCase) - -func checkFieldLowerSnakeCase(add addFunc, field protosource.Field) error { - message := field.Message() - if message == nil { - // just a sanity check - return errors.New("field.Message() was nil") - } - if message.IsMapEntry() { - // this check should always pass anyways but just in case - return nil - } - name := field.Name() - expectedName := fieldToLowerSnakeCase(name) - if name != expectedName { - add( - field, - field.NameLocation(), - // also check the message for this comment ignore - // this allows users to set this "globally" for a message - []protosource.Location{ - field.Message().Location(), - }, - "Field name %q should be lower_snake_case, such as %q.", - name, - expectedName, - ) - } - return nil -} - -// CheckFieldNoDescriptor is a check function. -var CheckFieldNoDescriptor = newFieldCheckFunc(checkFieldNoDescriptor) - -func checkFieldNoDescriptor(add addFunc, field protosource.Field) error { - name := field.Name() - if strings.ToLower(strings.Trim(name, "_")) == "descriptor" { - add( - field, - field.NameLocation(), - // also check the message for this comment ignore - // this allows users to set this "globally" for a message - []protosource.Location{ - field.Message().Location(), - }, - `Field name %q cannot be any capitalization of "descriptor" with any number of prefix or suffix underscores.`, - name, - ) - } - return nil -} - -// CheckFileLowerSnakeCase is a check function. -var CheckFileLowerSnakeCase = newFileCheckFunc(checkFileLowerSnakeCase) - -func checkFileLowerSnakeCase(add addFunc, file protosource.File) error { - filename := file.Path() - base := normalpath.Base(filename) - ext := normalpath.Ext(filename) - baseWithoutExt := strings.TrimSuffix(base, ext) - expectedBaseWithoutExt := stringutil.ToLowerSnakeCase(baseWithoutExt) - if baseWithoutExt != expectedBaseWithoutExt { - add(file, nil, nil, `Filename %q should be lower_snake_case%s, such as "%s%s".`, base, ext, expectedBaseWithoutExt, ext) - } - return nil -} - -var ( - // CheckImportNoPublic is a check function. - CheckImportNoPublic = newFileImportCheckFunc(checkImportNoPublic) - // CheckImportNoWeak is a check function. - CheckImportNoWeak = newFileImportCheckFunc(checkImportNoWeak) - // CheckImportUsed is a check function. - CheckImportUsed = newFileImportCheckFunc(checkImportUsed) -) - -func checkImportNoPublic(add addFunc, fileImport protosource.FileImport) error { - return checkImportNoPublicWeak(add, fileImport, fileImport.IsPublic(), "public") -} - -func checkImportNoWeak(add addFunc, fileImport protosource.FileImport) error { - return checkImportNoPublicWeak(add, fileImport, fileImport.IsWeak(), "weak") -} - -func checkImportNoPublicWeak(add addFunc, fileImport protosource.FileImport, value bool, name string) error { - if value { - add(fileImport, fileImport.Location(), nil, `Import %q must not be %s.`, fileImport.Import(), name) - } - return nil -} - -func checkImportUsed(add addFunc, fileImport protosource.FileImport) error { - if fileImport.IsUnused() { - add(fileImport, fileImport.Location(), nil, `Import %q is unused.`, fileImport.Import()) - } - return nil -} - -// CheckMessagePascalCase is a check function. -var CheckMessagePascalCase = newMessageCheckFunc(checkMessagePascalCase) - -func checkMessagePascalCase(add addFunc, message protosource.Message) error { - if message.IsMapEntry() { - // map entries should always be pascal case but we don't want to check them anyways - return nil - } - name := message.Name() - expectedName := stringutil.ToPascalCase(name) - if name != expectedName { - add(message, message.NameLocation(), nil, "Message name %q should be PascalCase, such as %q.", name, expectedName) - } - return nil -} - -// CheckOneofLowerSnakeCase is a check function. -var CheckOneofLowerSnakeCase = newOneofCheckFunc(checkOneofLowerSnakeCase) - -func checkOneofLowerSnakeCase(add addFunc, oneof protosource.Oneof) error { - name := oneof.Name() - expectedName := fieldToLowerSnakeCase(name) - if name != expectedName { - // if this is an implicit oneof for a proto3 optional field, do not error - // https://github.com/protocolbuffers/protobuf/blob/master/docs/implementing_proto3_presence.md - if fields := oneof.Fields(); len(fields) == 1 { - if fields[0].Proto3Optional() { - return nil - } - } - add( - oneof, - oneof.NameLocation(), - // also check the message for this comment ignore - // this allows users to set this "globally" for a message - []protosource.Location{ - oneof.Message().Location(), - }, - "Oneof name %q should be lower_snake_case, such as %q.", - name, - expectedName, - ) - } - return nil -} - -// CheckPackageDefined is a check function. -var CheckPackageDefined = newFileCheckFunc(checkPackageDefined) - -func checkPackageDefined(add addFunc, file protosource.File) error { - if file.Package() == "" { - add(file, nil, nil, "Files must have a package defined.") - } - return nil -} - -// CheckPackageDirectoryMatch is a check function. -var CheckPackageDirectoryMatch = newFileCheckFunc(checkPackageDirectoryMatch) - -func checkPackageDirectoryMatch(add addFunc, file protosource.File) error { - pkg := file.Package() - if pkg == "" { - return nil - } - expectedDirPath := strings.ReplaceAll(pkg, ".", "/") - dirPath := normalpath.Dir(file.Path()) - // need to check case where in root relative directory and no package defined - // this should be valid although if SENSIBLE is turned on this will be invalid - if dirPath != expectedDirPath { - add(file, file.PackageLocation(), nil, `Files with package %q must be within a directory "%s" relative to root but were in directory "%s".`, pkg, normalpath.Unnormalize(expectedDirPath), normalpath.Unnormalize(dirPath)) - } - return nil -} - -// CheckPackageLowerSnakeCase is a check function. -var CheckPackageLowerSnakeCase = newFileCheckFunc(checkPackageLowerSnakeCase) - -func checkPackageLowerSnakeCase(add addFunc, file protosource.File) error { - pkg := file.Package() - if pkg == "" { - return nil - } - split := strings.Split(pkg, ".") - for i, elem := range split { - split[i] = stringutil.ToLowerSnakeCase(elem) - } - expectedPkg := strings.Join(split, ".") - if pkg != expectedPkg { - add(file, file.PackageLocation(), nil, "Package name %q should be lower_snake.case, such as %q.", pkg, expectedPkg) - } - return nil -} - -// CheckPackageNoImportCycle is a check function. -var CheckPackageNoImportCycle = newFilesCheckFunc(checkPackageNoImportCycle) - -func checkPackageNoImportCycle(add addFunc, files []protosource.File) error { - packageToDirectlyImportedPackageToFileImports, err := protosource.PackageToDirectlyImportedPackageToFileImports(files...) - if err != nil { - return err - } - // This is way more algorithmically complex than it needs to be. - // - // We're doing a DFS starting at each package. What we should do is start from any package, - // do the DFS and keep track of the packages hit, and then don't ever do DFS from a given - // package twice. The problem is is that with the current janky package -> direct -> file imports - // setup, we would then end up with error messages like "import cycle: a -> b -> c -> b", and - // attach the error message to a file with package a, and we want to just print "b -> c -> b". - // So to get this to market, we just do a DFS from each package. - // - // This may prove to be too expensive but early testing say it is not so far. - for pkg := range packageToDirectlyImportedPackageToFileImports { - // Can equal "" per the function signature of PackageToDirectlyImportedPackageToFileImports - if pkg == "" { - continue - } - // Go one deep in the potential import cycle so that we can get the file imports - // we want to potentially attach errors to. - // - // We know that pkg is never equal to directlyImportedPackage due to the signature - // of PackageToDirectlyImportedPackageToFileImports. - for directlyImportedPackage, fileImports := range packageToDirectlyImportedPackageToFileImports[pkg] { - // Can equal "" per the function signature of PackageToDirectlyImportedPackageToFileImports - if directlyImportedPackage == "" { - continue - } - if importCycle := getImportCycleIfExists( - directlyImportedPackage, - packageToDirectlyImportedPackageToFileImports, - map[string]struct{}{ - pkg: {}, - }, - []string{ - pkg, - }, - ); len(importCycle) > 0 { - for _, fileImport := range fileImports { - add(fileImport, fileImport.Location(), nil, `Package import cycle: %s`, strings.Join(importCycle, ` -> `)) - } - } - } - } - return nil -} - -// CheckPackageSameDirectory is a check function. -var CheckPackageSameDirectory = newPackageToFilesCheckFunc(checkPackageSameDirectory) - -func checkPackageSameDirectory(add addFunc, pkg string, files []protosource.File) error { - dirMap := make(map[string]struct{}) - for _, file := range files { - dirMap[normalpath.Dir(file.Path())] = struct{}{} - } - if len(dirMap) > 1 { - dirs := stringutil.MapToSortedSlice(dirMap) - for _, file := range files { - add(file, file.PackageLocation(), nil, "Multiple directories %q contain files with package %q.", strings.Join(dirs, ","), pkg) - } - } - return nil -} - -var ( - // CheckPackageSameCsharpNamespace is a check function. - CheckPackageSameCsharpNamespace = newPackageToFilesCheckFunc(checkPackageSameCsharpNamespace) - // CheckPackageSameGoPackage is a check function. - CheckPackageSameGoPackage = newPackageToFilesCheckFunc(checkPackageSameGoPackage) - // CheckPackageSameJavaMultipleFiles is a check function. - CheckPackageSameJavaMultipleFiles = newPackageToFilesCheckFunc(checkPackageSameJavaMultipleFiles) - // CheckPackageSameJavaPackage is a check function. - CheckPackageSameJavaPackage = newPackageToFilesCheckFunc(checkPackageSameJavaPackage) - // CheckPackageSamePhpNamespace is a check function. - CheckPackageSamePhpNamespace = newPackageToFilesCheckFunc(checkPackageSamePhpNamespace) - // CheckPackageSameRubyPackage is a check function. - CheckPackageSameRubyPackage = newPackageToFilesCheckFunc(checkPackageSameRubyPackage) - // CheckPackageSameSwiftPrefix is a check function. - CheckPackageSameSwiftPrefix = newPackageToFilesCheckFunc(checkPackageSameSwiftPrefix) -) - -func checkPackageSameCsharpNamespace(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.CsharpNamespace, protosource.File.CsharpNamespaceLocation, "csharp_namespace") -} - -func checkPackageSameGoPackage(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.GoPackage, protosource.File.GoPackageLocation, "go_package") -} - -func checkPackageSameJavaMultipleFiles(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue( - add, - pkg, - files, - func(file protosource.File) string { - return strconv.FormatBool(file.JavaMultipleFiles()) - }, - protosource.File.JavaMultipleFilesLocation, - "java_multiple_files", - ) -} - -func checkPackageSameJavaPackage(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.JavaPackage, protosource.File.JavaPackageLocation, "java_package") -} - -func checkPackageSamePhpNamespace(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.PhpNamespace, protosource.File.PhpNamespaceLocation, "php_namespace") -} - -func checkPackageSameRubyPackage(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.RubyPackage, protosource.File.RubyPackageLocation, "ruby_package") -} - -func checkPackageSameSwiftPrefix(add addFunc, pkg string, files []protosource.File) error { - return checkPackageSameOptionValue(add, pkg, files, protosource.File.SwiftPrefix, protosource.File.SwiftPrefixLocation, "swift_prefix") -} - -func checkPackageSameOptionValue( - add addFunc, - pkg string, - files []protosource.File, - getOptionValue func(protosource.File) string, - getOptionLocation func(protosource.File) protosource.Location, - name string, -) error { - optionValueMap := make(map[string]struct{}) - for _, file := range files { - optionValueMap[getOptionValue(file)] = struct{}{} - } - if len(optionValueMap) > 1 { - _, noOptionValue := optionValueMap[""] - delete(optionValueMap, "") - optionValues := stringutil.MapToSortedSlice(optionValueMap) - for _, file := range files { - if noOptionValue { - add(file, getOptionLocation(file), nil, "Files in package %q have both values %q and no value for option %q and all values must be equal.", pkg, strings.Join(optionValues, ","), name) - } else { - add(file, getOptionLocation(file), nil, "Files in package %q have multiple values %q for option %q and all values must be equal.", pkg, strings.Join(optionValues, ","), name) - } - } - } - return nil -} - -// CheckPackageVersionSuffix is a check function. -var CheckPackageVersionSuffix = newFileCheckFunc(checkPackageVersionSuffix) - -func checkPackageVersionSuffix(add addFunc, file protosource.File) error { - pkg := file.Package() - if pkg == "" { - return nil - } - if _, ok := protoversion.NewPackageVersionForPackage(pkg); !ok { - add(file, file.PackageLocation(), nil, `Package name %q should be suffixed with a correctly formed version, such as %q.`, pkg, pkg+".v1") - } - return nil -} - -// CheckRPCNoClientStreaming is a check function. -var CheckRPCNoClientStreaming = newMethodCheckFunc(checkRPCNoClientStreaming) - -func checkRPCNoClientStreaming(add addFunc, method protosource.Method) error { - if method.ClientStreaming() { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "RPC %q is client streaming.", - method.Name(), - ) - } - return nil -} - -// CheckRPCNoServerStreaming is a check function. -var CheckRPCNoServerStreaming = newMethodCheckFunc(checkRPCNoServerStreaming) - -func checkRPCNoServerStreaming(add addFunc, method protosource.Method) error { - if method.ServerStreaming() { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "RPC %q is server streaming.", - method.Name(), - ) - } - return nil -} - -// CheckRPCPascalCase is a check function. -var CheckRPCPascalCase = newMethodCheckFunc(checkRPCPascalCase) - -func checkRPCPascalCase(add addFunc, method protosource.Method) error { - name := method.Name() - expectedName := stringutil.ToPascalCase(name) - if name != expectedName { - add( - method, - method.NameLocation(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "RPC name %q should be PascalCase, such as %q.", - name, - expectedName, - ) - } - return nil -} - -// CheckRPCRequestResponseUnique is a check function. -var CheckRPCRequestResponseUnique = func( - id string, - ignoreFunc internal.IgnoreFunc, - files []protosource.File, - allowSameRequestResponse bool, - allowGoogleProtobufEmptyRequests bool, - allowGoogleProtobufEmptyResponses bool, -) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, files []protosource.File) error { - return checkRPCRequestResponseUnique( - add, - files, - allowSameRequestResponse, - allowGoogleProtobufEmptyRequests, - allowGoogleProtobufEmptyResponses, - ) - }, - )(id, ignoreFunc, files) -} - -func checkRPCRequestResponseUnique( - add addFunc, - files []protosource.File, - allowSameRequestResponse bool, - allowGoogleProtobufEmptyRequests bool, - allowGoogleProtobufEmptyResponses bool, -) error { - allFullNameToMethod, err := protosource.FullNameToMethod(files...) - if err != nil { - return err - } - // first check if any requests or responses are the same - // if not, we can treat requests and responses equally for checking if more than - // one method uses a type - if !allowSameRequestResponse { - for _, method := range allFullNameToMethod { - if method.InputTypeName() == method.OutputTypeName() { - // if we allow both empty requests and responses, we do not want to add a FileAnnotation - if !(method.InputTypeName() == "google.protobuf.Empty" && allowGoogleProtobufEmptyRequests && allowGoogleProtobufEmptyResponses) { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "RPC %q has the same type %q for the request and response.", - method.Name(), - method.InputTypeName(), - ) - } - } - } - } - // we have now added errors for the same request and response type if applicable - // we can now check methods for unique usage of a given type - requestResponseTypeToFullNameToMethod := make(map[string]map[string]protosource.Method) - for fullName, method := range allFullNameToMethod { - for _, requestResponseType := range []string{method.InputTypeName(), method.OutputTypeName()} { - fullNameToMethod, ok := requestResponseTypeToFullNameToMethod[requestResponseType] - if !ok { - fullNameToMethod = make(map[string]protosource.Method) - requestResponseTypeToFullNameToMethod[requestResponseType] = fullNameToMethod - } - fullNameToMethod[fullName] = method - } - } - for requestResponseType, fullNameToMethod := range requestResponseTypeToFullNameToMethod { - // only this method uses this request or response type, no issue - if len(fullNameToMethod) == 1 { - continue - } - // if the request or response type is google.protobuf.Empty and we allow this for requests or responses, - // we have to do a harder check - if requestResponseType == "google.protobuf.Empty" && (allowGoogleProtobufEmptyRequests || allowGoogleProtobufEmptyResponses) { - // if both requests and responses can be google.protobuf.Empty, then do not add any error - // else, we check - if !(allowGoogleProtobufEmptyRequests && allowGoogleProtobufEmptyResponses) { - // inside this if statement, one of allowGoogleProtobufEmptyRequests or allowGoogleProtobufEmptyResponses is true - var requestMethods []protosource.Method - var responseMethods []protosource.Method - for _, method := range fullNameToMethod { - if method.InputTypeName() == "google.protobuf.Empty" { - requestMethods = append(requestMethods, method) - } - if method.OutputTypeName() == "google.protobuf.Empty" { - responseMethods = append(responseMethods, method) - } - } - if !allowGoogleProtobufEmptyRequests && len(requestMethods) > 1 { - for _, method := range requestMethods { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "%q is used as the request for multiple RPCs.", - requestResponseType, - ) - } - } - if !allowGoogleProtobufEmptyResponses && len(responseMethods) > 1 { - for _, method := range responseMethods { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "%q is used as the response for multiple RPCs.", - requestResponseType, - ) - } - } - } - } else { - // else, we have a duplicate usage of requestResponseType, add an FileAnnotation to each method - for _, method := range fullNameToMethod { - add( - method, - method.Location(), - // also check the service for this comment ignore - // this allows users to set this "globally" for a service - []protosource.Location{ - method.Service().Location(), - }, - "%q is used as the request or response type for multiple RPCs.", - requestResponseType, - ) - } - } - } - return nil -} - -// CheckRPCRequestStandardName is a check function. -var CheckRPCRequestStandardName = func( - id string, - ignoreFunc internal.IgnoreFunc, - files []protosource.File, - allowGoogleProtobufEmptyRequests bool, -) ([]bufanalysis.FileAnnotation, error) { - return newMethodCheckFunc( - func(add addFunc, method protosource.Method) error { - return checkRPCRequestStandardName(add, method, allowGoogleProtobufEmptyRequests) - }, - )(id, ignoreFunc, files) -} - -func checkRPCRequestStandardName(add addFunc, method protosource.Method, allowGoogleProtobufEmptyRequests bool) error { - service := method.Service() - if service == nil { - return errors.New("method.Service() is nil") - } - name := method.InputTypeName() - if allowGoogleProtobufEmptyRequests && name == "google.protobuf.Empty" { - return nil - } - if strings.Contains(name, ".") { - split := strings.Split(name, ".") - name = split[len(split)-1] - } - expectedName1 := stringutil.ToPascalCase(method.Name()) + "Request" - expectedName2 := stringutil.ToPascalCase(service.Name()) + expectedName1 - if name != expectedName1 && name != expectedName2 { - add( - method, - method.InputTypeLocation(), - // also check the method and service for this comment ignore - // this came up in https://github.com/bufbuild/buf/issues/242 - []protosource.Location{ - method.Location(), - method.Service().Location(), - }, - "RPC request type %q should be named %q or %q.", - name, - expectedName1, - expectedName2, - ) - } - return nil -} - -// CheckRPCResponseStandardName is a check function. -var CheckRPCResponseStandardName = func( - id string, - ignoreFunc internal.IgnoreFunc, - files []protosource.File, - allowGoogleProtobufEmptyResponses bool, -) ([]bufanalysis.FileAnnotation, error) { - return newMethodCheckFunc( - func(add addFunc, method protosource.Method) error { - return checkRPCResponseStandardName(add, method, allowGoogleProtobufEmptyResponses) - }, - )(id, ignoreFunc, files) -} - -func checkRPCResponseStandardName(add addFunc, method protosource.Method, allowGoogleProtobufEmptyResponses bool) error { - service := method.Service() - if service == nil { - return errors.New("method.Service() is nil") - } - name := method.OutputTypeName() - if allowGoogleProtobufEmptyResponses && name == "google.protobuf.Empty" { - return nil - } - if strings.Contains(name, ".") { - split := strings.Split(name, ".") - name = split[len(split)-1] - } - expectedName1 := stringutil.ToPascalCase(method.Name()) + "Response" - expectedName2 := stringutil.ToPascalCase(service.Name()) + expectedName1 - if name != expectedName1 && name != expectedName2 { - add( - method, - method.OutputTypeLocation(), - // also check the method and service for this comment ignore - // this came up in https://github.com/bufbuild/buf/issues/242 - []protosource.Location{ - method.Location(), - method.Service().Location(), - }, - "RPC response type %q should be named %q or %q.", - name, - expectedName1, - expectedName2, - ) - } - return nil -} - -// CheckServicePascalCase is a check function. -var CheckServicePascalCase = newServiceCheckFunc(checkServicePascalCase) - -func checkServicePascalCase(add addFunc, service protosource.Service) error { - name := service.Name() - expectedName := stringutil.ToPascalCase(name) - if name != expectedName { - add(service, service.NameLocation(), nil, "Service name %q should be PascalCase, such as %q.", name, expectedName) - } - return nil -} - -// CheckServiceSuffix is a check function. -var CheckServiceSuffix = func( - id string, - ignoreFunc internal.IgnoreFunc, - files []protosource.File, - suffix string, -) ([]bufanalysis.FileAnnotation, error) { - return newServiceCheckFunc( - func(add addFunc, service protosource.Service) error { - return checkServiceSuffix(add, service, suffix) - }, - )(id, ignoreFunc, files) -} - -func checkServiceSuffix(add addFunc, service protosource.Service, suffix string) error { - name := service.Name() - if !strings.HasSuffix(name, suffix) { - add(service, service.NameLocation(), nil, "Service name %q should be suffixed with %q.", name, suffix) - } - return nil -} - -// CheckSyntaxSpecified is a check function. -var CheckSyntaxSpecified = newFileCheckFunc(checkSyntaxSpecified) - -func checkSyntaxSpecified(add addFunc, file protosource.File) error { - if file.Syntax() == protosource.SyntaxUnspecified { - add(file, file.SyntaxLocation(), nil, `Files must have a syntax explicitly specified. If no syntax is specified, the file defaults to "proto2".`) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/usage.gen.go deleted file mode 100644 index 929707d7bf..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflintcheck - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/util.go deleted file mode 100644 index 7a4b61d28d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintcheck/util.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflintcheck - -import ( - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - "github.com/bufbuild/buf/private/pkg/protosource" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -// addFunc adds a FileAnnotation. -// -// Both the Descriptor and Locations can be nil. -type addFunc func(protosource.Descriptor, protosource.Location, []protosource.Location, string, ...interface{}) - -func fieldToLowerSnakeCase(s string) string { - // Try running this on googleapis and watch - // We allow both effectively by not passing the option - //return stringutil.ToLowerSnakeCase(s, stringutil.SnakeCaseWithNewWordOnDigits()) - return stringutil.ToLowerSnakeCase(s) -} - -func fieldToUpperSnakeCase(s string) string { - // Try running this on googleapis and watch - // We allow both effectively by not passing the option - //return stringutil.ToUpperSnakeCase(s, stringutil.SnakeCaseWithNewWordOnDigits()) - return stringutil.ToUpperSnakeCase(s) -} - -// validLeadingComment returns true if comment has at least one line that isn't empty -// and doesn't start with CommentIgnorePrefix. -func validLeadingComment(comment string) bool { - for _, line := range strings.Split(comment, "\n") { - line = strings.TrimSpace(line) - if line != "" && !strings.HasPrefix(line, CommentIgnorePrefix) { - return true - } - } - return false -} - -// Returns the usedPackageList if there is an import cycle. -// -// Note this stops on the first import cycle detected, it doesn't attempt to get all of them - not perfect. -func getImportCycleIfExists( - // Should never be "" - pkg string, - packageToDirectlyImportedPackageToFileImports map[string]map[string][]protosource.FileImport, - usedPackageMap map[string]struct{}, - usedPackageList []string, -) []string { - // Append before checking so that the returned import cycle is actually a cycle - usedPackageList = append(usedPackageList, pkg) - if _, ok := usedPackageMap[pkg]; ok { - // We have an import cycle, but if the first package in the list does not - // equal the last, do not return as an import cycle unless the first - // element equals the last - we do DFS from each package so this will - // be picked up separately - if usedPackageList[0] == usedPackageList[len(usedPackageList)-1] { - return usedPackageList - } - return nil - } - usedPackageMap[pkg] = struct{}{} - // Will never equal pkg - for directlyImportedPackage := range packageToDirectlyImportedPackageToFileImports[pkg] { - // Can equal "" per the function signature of PackageToDirectlyImportedPackageToFileImports - if directlyImportedPackage == "" { - continue - } - if importCycle := getImportCycleIfExists( - directlyImportedPackage, - packageToDirectlyImportedPackageToFileImports, - usedPackageMap, - usedPackageList, - ); len(importCycle) != 0 { - return importCycle - } - } - delete(usedPackageMap, pkg) - return nil -} - -func newFilesCheckFunc( - f func(addFunc, []protosource.File) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return func(id string, ignoreFunc internal.IgnoreFunc, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - helper := internal.NewHelper(id, ignoreFunc) - if err := f(helper.AddFileAnnotationWithExtraIgnoreLocationsf, files); err != nil { - return nil, err - } - return helper.FileAnnotations(), nil - } -} - -func newPackageToFilesCheckFunc( - f func(add addFunc, pkg string, files []protosource.File) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, files []protosource.File) error { - packageToFiles, err := protosource.PackageToFiles(files...) - if err != nil { - return err - } - for pkg, files := range packageToFiles { - if err := f(add, pkg, files); err != nil { - return err - } - } - return nil - }, - ) -} - -func newDirToFilesCheckFunc( - f func(add addFunc, dirPath string, files []protosource.File) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, files []protosource.File) error { - dirPathToFiles, err := protosource.DirPathToFiles(files...) - if err != nil { - return err - } - for dirPath, files := range dirPathToFiles { - if err := f(add, dirPath, files); err != nil { - return err - } - } - return nil - }, - ) -} - -func newFileCheckFunc( - f func(addFunc, protosource.File) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFilesCheckFunc( - func(add addFunc, files []protosource.File) error { - for _, file := range files { - if err := f(add, file); err != nil { - return err - } - } - return nil - }, - ) -} - -func newFileImportCheckFunc( - f func(addFunc, protosource.FileImport) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFileCheckFunc( - func(add addFunc, file protosource.File) error { - for _, fileImport := range file.FileImports() { - if err := f(add, fileImport); err != nil { - return err - } - } - return nil - }, - ) -} - -func newEnumCheckFunc( - f func(addFunc, protosource.Enum) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFileCheckFunc( - func(add addFunc, file protosource.File) error { - return protosource.ForEachEnum( - func(enum protosource.Enum) error { - return f(add, enum) - }, - file, - ) - }, - ) -} - -func newEnumValueCheckFunc( - f func(addFunc, protosource.EnumValue) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newEnumCheckFunc( - func(add addFunc, enum protosource.Enum) error { - for _, enumValue := range enum.Values() { - if err := f(add, enumValue); err != nil { - return err - } - } - return nil - }, - ) -} - -func newMessageCheckFunc( - f func(addFunc, protosource.Message) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFileCheckFunc( - func(add addFunc, file protosource.File) error { - return protosource.ForEachMessage( - func(message protosource.Message) error { - return f(add, message) - }, - file, - ) - }, - ) -} - -func newFieldCheckFunc( - f func(addFunc, protosource.Field) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newMessageCheckFunc( - func(add addFunc, message protosource.Message) error { - for _, field := range message.Fields() { - if err := f(add, field); err != nil { - return err - } - } - // TODO: is this right? - for _, field := range message.Extensions() { - if err := f(add, field); err != nil { - return err - } - } - return nil - }, - ) -} - -func newOneofCheckFunc( - f func(addFunc, protosource.Oneof) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newMessageCheckFunc( - func(add addFunc, message protosource.Message) error { - for _, oneof := range message.Oneofs() { - if err := f(add, oneof); err != nil { - return err - } - } - return nil - }, - ) -} - -func newServiceCheckFunc( - f func(addFunc, protosource.Service) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newFileCheckFunc( - func(add addFunc, file protosource.File) error { - for _, service := range file.Services() { - if err := f(add, service); err != nil { - return err - } - } - return nil - }, - ) -} - -func newMethodCheckFunc( - f func(addFunc, protosource.Method) error, -) func(string, internal.IgnoreFunc, []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return newServiceCheckFunc( - func(add addFunc, service protosource.Service) error { - for _, method := range service.Methods() { - if err := f(add, method); err != nil { - return err - } - } - return nil - }, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/buflintv1.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/buflintv1.go deleted file mode 100644 index 7dc31a7ce2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/buflintv1.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflintv1 contains the VersionSpec for v1. -// -// It uses buflintcheck and buflintbuild. -// -// The only changes from v1beta1 to v1 were that ENUM_FIRST_VALUE_ZERO was moved -// from OTHER to MINIMAL, and the OTHER category was deleted. -package buflintv1 - -import "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - -// VersionSpec is the version specification for v1. -// -// The SYNTAX_SPECIFIED rule was added to BASIC, DEFAULT. -// The IMPORT_USED rule was added to BASIC, DEFAULT. -// ENUM_FIRST_VALUE_ZERO was added to BASIC, DEFAULT. -// PACKAGE_NO_IMPORT_CYCLE was added as an uncategorized lint rule. -// The FIELD_NO_DESCRIPTOR rule was removed altogether. -// -// A number of categories were removed between v1beta1 and v1. The difference -// is shown below: -// -// Removed: -// - FILE_LAYOUT -// - PACKAGE_AFFINITY -// - SENSIBLE -// - STYLE_BASIC -// - STYLE_DEFAULT -// - OTHER -// -// Thus, the only remaining categories are: -// -// Categories: -// - MINIMAL -// - BASIC -// - DEFAULT -// - COMMENTS -// - UNARY_RPC -// -// The rules included in the MINIMAL lint category have also been adjusted. -// The difference is shown below: -// -// Removed: -// - ENUM_NO_ALLOW_ALIAS -// - FIELD_NO_DESCRIPTOR -// - IMPORT_NO_PUBLIC -// - IMPORT_NO_WEAK -// - PACKAGE_SAME_CSHARP_NAMESPACE -// - PACKAGE_SAME_GO_PACKAGE -// - PACKAGE_SAME_JAVA_MULTIPLE_FILES -// - PACKAGE_SAME_JAVA_PACKAGE -// - PACKAGE_SAME_PHP_NAMESPACE -// - PACKAGE_SAME_RUBY_PACKAGE -// - PACKAGE_SAME_SWIFT_PREFIX -// -// With these changes applied, the final result of MINIMAL is: -// -// MINIMAL: -// - DIRECTORY_SAME_PACKAGE -// - PACKAGE_DEFINED -// - PACKAGE_DIRECTORY_MATCH -// - PACKAGE_SAME_DIRECTORY -var VersionSpec = &internal.VersionSpec{ - RuleBuilders: v1RuleBuilders, - DefaultCategories: v1DefaultCategories, - IDToCategories: v1IDToCategories, -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/usage.gen.go deleted file mode 100644 index 553b41274a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflintv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/vars.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/vars.go deleted file mode 100644 index c510e1a1e4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1/vars.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflintv1 - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" -) - -var ( - // v1RuleBuilders are the rule builders. - v1RuleBuilders = []*internal.RuleBuilder{ - buflintbuild.CommentEnumRuleBuilder, - buflintbuild.CommentEnumValueRuleBuilder, - buflintbuild.CommentFieldRuleBuilder, - buflintbuild.CommentMessageRuleBuilder, - buflintbuild.CommentOneofRuleBuilder, - buflintbuild.CommentRPCRuleBuilder, - buflintbuild.CommentServiceRuleBuilder, - buflintbuild.DirectorySamePackageRuleBuilder, - buflintbuild.EnumFirstValueZeroRuleBuilder, - buflintbuild.EnumNoAllowAliasRuleBuilder, - buflintbuild.EnumPascalCaseRuleBuilder, - buflintbuild.EnumValuePrefixRuleBuilder, - buflintbuild.EnumValueUpperSnakeCaseRuleBuilder, - buflintbuild.EnumZeroValueSuffixRuleBuilder, - buflintbuild.FieldLowerSnakeCaseRuleBuilder, - buflintbuild.FileLowerSnakeCaseRuleBuilder, - buflintbuild.ImportNoPublicRuleBuilder, - buflintbuild.ImportNoWeakRuleBuilder, - buflintbuild.ImportUsedRuleBuilder, - buflintbuild.MessagePascalCaseRuleBuilder, - buflintbuild.OneofLowerSnakeCaseRuleBuilder, - buflintbuild.PackageDefinedRuleBuilder, - buflintbuild.PackageDirectoryMatchRuleBuilder, - buflintbuild.PackageLowerSnakeCaseRuleBuilder, - buflintbuild.PackageNoImportCycleRuleBuilder, - buflintbuild.PackageSameCsharpNamespaceRuleBuilder, - buflintbuild.PackageSameDirectoryRuleBuilder, - buflintbuild.PackageSameGoPackageRuleBuilder, - buflintbuild.PackageSameJavaMultipleFilesRuleBuilder, - buflintbuild.PackageSameJavaPackageRuleBuilder, - buflintbuild.PackageSamePhpNamespaceRuleBuilder, - buflintbuild.PackageSameRubyPackageRuleBuilder, - buflintbuild.PackageSameSwiftPrefixRuleBuilder, - buflintbuild.PackageVersionSuffixRuleBuilder, - buflintbuild.RPCNoClientStreamingRuleBuilder, - buflintbuild.RPCNoServerStreamingRuleBuilder, - buflintbuild.RPCPascalCaseRuleBuilder, - buflintbuild.RPCRequestResponseUniqueRuleBuilder, - buflintbuild.RPCRequestStandardNameRuleBuilder, - buflintbuild.RPCResponseStandardNameRuleBuilder, - buflintbuild.ServicePascalCaseRuleBuilder, - buflintbuild.ServiceSuffixRuleBuilder, - buflintbuild.SyntaxSpecifiedRuleBuilder, - } - - // v1DefaultCategories are the default categories. - v1DefaultCategories = []string{ - "DEFAULT", - } - // v1IDToCategories associates IDs to categories. - v1IDToCategories = map[string][]string{ - "COMMENT_ENUM": { - "COMMENTS", - }, - "COMMENT_ENUM_VALUE": { - "COMMENTS", - }, - "COMMENT_FIELD": { - "COMMENTS", - }, - "COMMENT_MESSAGE": { - "COMMENTS", - }, - "COMMENT_ONEOF": { - "COMMENTS", - }, - "COMMENT_RPC": { - "COMMENTS", - }, - "COMMENT_SERVICE": { - "COMMENTS", - }, - "DIRECTORY_SAME_PACKAGE": { - "MINIMAL", - "BASIC", - "DEFAULT", - }, - "ENUM_FIRST_VALUE_ZERO": { - "BASIC", - "DEFAULT", - }, - "ENUM_NO_ALLOW_ALIAS": { - "BASIC", - "DEFAULT", - }, - "ENUM_PASCAL_CASE": { - "BASIC", - "DEFAULT", - }, - "ENUM_VALUE_PREFIX": { - "DEFAULT", - }, - "ENUM_VALUE_UPPER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - }, - "ENUM_ZERO_VALUE_SUFFIX": { - "DEFAULT", - }, - "FIELD_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - }, - "FILE_LOWER_SNAKE_CASE": { - "DEFAULT", - }, - "IMPORT_NO_PUBLIC": { - "BASIC", - "DEFAULT", - }, - "IMPORT_NO_WEAK": { - "BASIC", - "DEFAULT", - }, - "IMPORT_USED": { - "BASIC", - "DEFAULT", - }, - "MESSAGE_PASCAL_CASE": { - "BASIC", - "DEFAULT", - }, - "ONEOF_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_DEFINED": { - "MINIMAL", - "BASIC", - "DEFAULT", - }, - "PACKAGE_DIRECTORY_MATCH": { - "MINIMAL", - "BASIC", - "DEFAULT", - }, - "PACKAGE_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_NO_IMPORT_CYCLE": {}, - "PACKAGE_SAME_CSHARP_NAMESPACE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_DIRECTORY": { - "MINIMAL", - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_GO_PACKAGE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_JAVA_MULTIPLE_FILES": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_JAVA_PACKAGE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_PHP_NAMESPACE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_RUBY_PACKAGE": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_SAME_SWIFT_PREFIX": { - "BASIC", - "DEFAULT", - }, - "PACKAGE_VERSION_SUFFIX": { - "DEFAULT", - }, - "RPC_NO_CLIENT_STREAMING": { - "UNARY_RPC", - }, - "RPC_NO_SERVER_STREAMING": { - "UNARY_RPC", - }, - "RPC_PASCAL_CASE": { - "BASIC", - "DEFAULT", - }, - "RPC_REQUEST_RESPONSE_UNIQUE": { - "DEFAULT", - }, - "RPC_REQUEST_STANDARD_NAME": { - "DEFAULT", - }, - "RPC_RESPONSE_STANDARD_NAME": { - "DEFAULT", - }, - "SERVICE_PASCAL_CASE": { - "BASIC", - "DEFAULT", - }, - "SERVICE_SUFFIX": { - "DEFAULT", - }, - "SYNTAX_SPECIFIED": { - "BASIC", - "DEFAULT", - }, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/buflintv1beta1.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/buflintv1beta1.go deleted file mode 100644 index d8cd0f3ba5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/buflintv1beta1.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflintv1beta1 contains the VersionSpec for v1beta1. -// -// It uses buflintcheck and buflintbuild. -package buflintv1beta1 - -import "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" - -// VersionSpec is the version specification for v1beta1. -var VersionSpec = &internal.VersionSpec{ - RuleBuilders: v1beta1RuleBuilders, - DefaultCategories: v1beta1DefaultCategories, - IDToCategories: v1beta1IDToCategories, -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/usage.gen.go deleted file mode 100644 index 33b090e60a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflintv1beta1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/vars.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/vars.go deleted file mode 100644 index 313125b7c2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintv1beta1/vars.go +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflintv1beta1 - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/internal/buflintbuild" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/internal" -) - -var ( - // v1beta1RuleBuilders are the rule builders. - v1beta1RuleBuilders = []*internal.RuleBuilder{ - buflintbuild.CommentEnumRuleBuilder, - buflintbuild.CommentEnumValueRuleBuilder, - buflintbuild.CommentFieldRuleBuilder, - buflintbuild.CommentMessageRuleBuilder, - buflintbuild.CommentOneofRuleBuilder, - buflintbuild.CommentRPCRuleBuilder, - buflintbuild.CommentServiceRuleBuilder, - buflintbuild.DirectorySamePackageRuleBuilder, - buflintbuild.EnumFirstValueZeroRuleBuilder, - buflintbuild.EnumNoAllowAliasRuleBuilder, - buflintbuild.EnumPascalCaseRuleBuilder, - buflintbuild.EnumValuePrefixRuleBuilder, - buflintbuild.EnumValueUpperSnakeCaseRuleBuilder, - buflintbuild.EnumZeroValueSuffixRuleBuilder, - buflintbuild.FieldLowerSnakeCaseRuleBuilder, - buflintbuild.FieldNoDescriptorRuleBuilder, - buflintbuild.FileLowerSnakeCaseRuleBuilder, - buflintbuild.ImportNoPublicRuleBuilder, - buflintbuild.ImportNoWeakRuleBuilder, - buflintbuild.MessagePascalCaseRuleBuilder, - buflintbuild.OneofLowerSnakeCaseRuleBuilder, - buflintbuild.PackageDefinedRuleBuilder, - buflintbuild.PackageDirectoryMatchRuleBuilder, - buflintbuild.PackageLowerSnakeCaseRuleBuilder, - buflintbuild.PackageSameCsharpNamespaceRuleBuilder, - buflintbuild.PackageSameDirectoryRuleBuilder, - buflintbuild.PackageSameGoPackageRuleBuilder, - buflintbuild.PackageSameJavaMultipleFilesRuleBuilder, - buflintbuild.PackageSameJavaPackageRuleBuilder, - buflintbuild.PackageSamePhpNamespaceRuleBuilder, - buflintbuild.PackageSameRubyPackageRuleBuilder, - buflintbuild.PackageSameSwiftPrefixRuleBuilder, - buflintbuild.PackageVersionSuffixRuleBuilder, - buflintbuild.RPCNoClientStreamingRuleBuilder, - buflintbuild.RPCNoServerStreamingRuleBuilder, - buflintbuild.RPCPascalCaseRuleBuilder, - buflintbuild.RPCRequestResponseUniqueRuleBuilder, - buflintbuild.RPCRequestStandardNameRuleBuilder, - buflintbuild.RPCResponseStandardNameRuleBuilder, - buflintbuild.ServicePascalCaseRuleBuilder, - buflintbuild.ServiceSuffixRuleBuilder, - } - - // v1beta1DefaultCategories are the default categories. - v1beta1DefaultCategories = []string{ - "DEFAULT", - } - // v1beta1IDToCategories associates IDs to categories. - v1beta1IDToCategories = map[string][]string{ - "COMMENT_ENUM": { - "COMMENTS", - }, - "COMMENT_ENUM_VALUE": { - "COMMENTS", - }, - "COMMENT_FIELD": { - "COMMENTS", - }, - "COMMENT_MESSAGE": { - "COMMENTS", - }, - "COMMENT_ONEOF": { - "COMMENTS", - }, - "COMMENT_RPC": { - "COMMENTS", - }, - "COMMENT_SERVICE": { - "COMMENTS", - }, - "DIRECTORY_SAME_PACKAGE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "FILE_LAYOUT", - }, - "ENUM_FIRST_VALUE_ZERO": { - "OTHER", - }, - "ENUM_NO_ALLOW_ALIAS": { - "MINIMAL", - "BASIC", - "DEFAULT", - "SENSIBLE", - }, - "ENUM_PASCAL_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "ENUM_VALUE_PREFIX": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "ENUM_VALUE_UPPER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "ENUM_ZERO_VALUE_SUFFIX": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "FIELD_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "FIELD_NO_DESCRIPTOR": { - "MINIMAL", - "BASIC", - "DEFAULT", - "SENSIBLE", - }, - "FILE_LOWER_SNAKE_CASE": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "IMPORT_NO_PUBLIC": { - "MINIMAL", - "BASIC", - "DEFAULT", - "SENSIBLE", - }, - "IMPORT_NO_WEAK": { - "MINIMAL", - "BASIC", - "DEFAULT", - "SENSIBLE", - }, - "MESSAGE_PASCAL_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "ONEOF_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "PACKAGE_DEFINED": { - "MINIMAL", - "BASIC", - "DEFAULT", - "SENSIBLE", - }, - "PACKAGE_DIRECTORY_MATCH": { - "MINIMAL", - "BASIC", - "DEFAULT", - "FILE_LAYOUT", - }, - "PACKAGE_LOWER_SNAKE_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "PACKAGE_SAME_CSHARP_NAMESPACE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_DIRECTORY": { - "MINIMAL", - "BASIC", - "DEFAULT", - "FILE_LAYOUT", - }, - "PACKAGE_SAME_GO_PACKAGE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_JAVA_MULTIPLE_FILES": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_JAVA_PACKAGE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_PHP_NAMESPACE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_RUBY_PACKAGE": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_SAME_SWIFT_PREFIX": { - "MINIMAL", - "BASIC", - "DEFAULT", - "PACKAGE_AFFINITY", - }, - "PACKAGE_VERSION_SUFFIX": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "RPC_NO_CLIENT_STREAMING": { - "UNARY_RPC", - }, - "RPC_NO_SERVER_STREAMING": { - "UNARY_RPC", - }, - "RPC_PASCAL_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "RPC_REQUEST_RESPONSE_UNIQUE": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "RPC_REQUEST_STANDARD_NAME": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "RPC_RESPONSE_STANDARD_NAME": { - "DEFAULT", - "STYLE_DEFAULT", - }, - "SERVICE_PASCAL_CASE": { - "BASIC", - "DEFAULT", - "STYLE_BASIC", - "STYLE_DEFAULT", - }, - "SERVICE_SUFFIX": { - "DEFAULT", - "STYLE_DEFAULT", - }, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/usage.gen.go deleted file mode 100644 index b6ba04fa8d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflint - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/config.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/config.go deleted file mode 100644 index fb1e44a0a3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/config.go +++ /dev/null @@ -1,323 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "fmt" - "sort" - "strings" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -const ( - defaultEnumZeroValueSuffix = "_UNSPECIFIED" - defaultServiceSuffix = "Service" -) - -// Config is the check config. -type Config struct { - // Rules are the rules to run. - // - // Rules will be sorted by first categories, then id when Configs are - // created from this package, i.e. created wth ConfigBuilder.NewConfig. - Rules []*Rule - - IgnoreRootPaths map[string]struct{} - IgnoreIDToRootPaths map[string]map[string]struct{} - - AllowCommentIgnores bool - IgnoreUnstablePackages bool -} - -// ConfigBuilder is a config builder. -type ConfigBuilder struct { - Use []string - Except []string - - IgnoreRootPaths []string - IgnoreIDOrCategoryToRootPaths map[string][]string - - AllowCommentIgnores bool - IgnoreUnstablePackages bool - - EnumZeroValueSuffix string - RPCAllowSameRequestResponse bool - RPCAllowGoogleProtobufEmptyRequests bool - RPCAllowGoogleProtobufEmptyResponses bool - ServiceSuffix string -} - -// NewConfig returns a new Config. -func (b ConfigBuilder) NewConfig(versionSpec *VersionSpec) (*Config, error) { - return newConfig(b, versionSpec) -} - -func newConfig(configBuilder ConfigBuilder, versionSpec *VersionSpec) (*Config, error) { - configBuilder.Use = stringutil.SliceToUniqueSortedSliceFilterEmptyStrings(configBuilder.Use) - configBuilder.Except = stringutil.SliceToUniqueSortedSliceFilterEmptyStrings(configBuilder.Except) - if len(configBuilder.Use) == 0 { - // default behavior - configBuilder.Use = versionSpec.DefaultCategories - } - if configBuilder.EnumZeroValueSuffix == "" { - configBuilder.EnumZeroValueSuffix = defaultEnumZeroValueSuffix - } - if configBuilder.ServiceSuffix == "" { - configBuilder.ServiceSuffix = defaultServiceSuffix - } - return newConfigForRuleBuilders( - configBuilder, - versionSpec.RuleBuilders, - versionSpec.IDToCategories, - ) -} - -func newConfigForRuleBuilders( - configBuilder ConfigBuilder, - ruleBuilders []*RuleBuilder, - idToCategories map[string][]string, -) (*Config, error) { - // this checks that there are not duplicate IDs for a given revision - // which would be a system error - idToRuleBuilder, err := getIDToRuleBuilder(ruleBuilders) - if err != nil { - return nil, err - } - categoryToIDs := getCategoryToIDs(idToCategories) - useIDMap, err := transformToIDMap(configBuilder.Use, idToCategories, categoryToIDs) - if err != nil { - return nil, err - } - exceptIDMap, err := transformToIDMap(configBuilder.Except, idToCategories, categoryToIDs) - if err != nil { - return nil, err - } - - // this removes duplicates - // we already know that a given rule with the same ID is equivalent - resultIDToRuleBuilder := make(map[string]*RuleBuilder) - - for id := range useIDMap { - ruleBuilder, ok := idToRuleBuilder[id] - if !ok { - return nil, fmt.Errorf("%q is not a known id after verification", id) - } - resultIDToRuleBuilder[ruleBuilder.id] = ruleBuilder - } - for id := range exceptIDMap { - if _, ok := idToRuleBuilder[id]; !ok { - return nil, fmt.Errorf("%q is not a known id after verification", id) - } - delete(resultIDToRuleBuilder, id) - } - - resultRuleBuilders := make([]*RuleBuilder, 0, len(resultIDToRuleBuilder)) - for _, ruleBuilder := range resultIDToRuleBuilder { - resultRuleBuilders = append(resultRuleBuilders, ruleBuilder) - } - resultRules := make([]*Rule, 0, len(resultRuleBuilders)) - for _, ruleBuilder := range resultRuleBuilders { - categories, err := getRuleBuilderCategories(ruleBuilder, idToCategories) - if err != nil { - return nil, err - } - rule, err := ruleBuilder.NewRule(configBuilder, categories) - if err != nil { - return nil, err - } - resultRules = append(resultRules, rule) - } - sortRules(resultRules) - - ignoreIDToRootPathsUnnormalized, err := transformToIDToListMap(configBuilder.IgnoreIDOrCategoryToRootPaths, idToCategories, categoryToIDs) - if err != nil { - return nil, err - } - ignoreIDToRootPaths := make(map[string]map[string]struct{}) - for id, rootPaths := range ignoreIDToRootPathsUnnormalized { - for rootPath := range rootPaths { - if rootPath == "" { - continue - } - rootPath, err := normalpath.NormalizeAndValidate(rootPath) - if err != nil { - return nil, err - } - if rootPath == "." { - return nil, fmt.Errorf("cannot specify %q as an ignore path", rootPath) - } - resultRootPathMap, ok := ignoreIDToRootPaths[id] - if !ok { - resultRootPathMap = make(map[string]struct{}) - ignoreIDToRootPaths[id] = resultRootPathMap - } - resultRootPathMap[rootPath] = struct{}{} - } - } - - ignoreRootPaths := make(map[string]struct{}, len(configBuilder.IgnoreRootPaths)) - for _, rootPath := range configBuilder.IgnoreRootPaths { - if rootPath == "" { - continue - } - rootPath, err := normalpath.NormalizeAndValidate(rootPath) - if err != nil { - return nil, err - } - if rootPath == "." { - return nil, fmt.Errorf("cannot specify %q as an ignore path", rootPath) - } - ignoreRootPaths[rootPath] = struct{}{} - } - - return &Config{ - Rules: resultRules, - IgnoreIDToRootPaths: ignoreIDToRootPaths, - IgnoreRootPaths: ignoreRootPaths, - AllowCommentIgnores: configBuilder.AllowCommentIgnores, - IgnoreUnstablePackages: configBuilder.IgnoreUnstablePackages, - }, nil -} - -func transformToIDMap(idsOrCategories []string, idToCategories map[string][]string, categoryToIDs map[string][]string) (map[string]struct{}, error) { - if len(idsOrCategories) == 0 { - return nil, nil - } - idMap := make(map[string]struct{}, len(idsOrCategories)) - for _, idOrCategory := range idsOrCategories { - if idOrCategory == "" { - continue - } - if _, ok := idToCategories[idOrCategory]; ok { - id := idOrCategory - idMap[id] = struct{}{} - } else if ids, ok := categoryToIDs[idOrCategory]; ok { - for _, id := range ids { - idMap[id] = struct{}{} - } - } else { - return nil, fmt.Errorf("%q is not a known id or category", idOrCategory) - } - } - return idMap, nil -} - -func transformToIDToListMap(idOrCategoryToList map[string][]string, idToCategories map[string][]string, categoryToIDs map[string][]string) (map[string]map[string]struct{}, error) { - if len(idOrCategoryToList) == 0 { - return nil, nil - } - idToListMap := make(map[string]map[string]struct{}, len(idOrCategoryToList)) - for idOrCategory, list := range idOrCategoryToList { - if idOrCategory == "" { - continue - } - if _, ok := idToCategories[idOrCategory]; ok { - id := idOrCategory - if _, ok := idToListMap[id]; !ok { - idToListMap[id] = make(map[string]struct{}) - } - for _, elem := range list { - idToListMap[id][elem] = struct{}{} - } - } else if ids, ok := categoryToIDs[idOrCategory]; ok { - for _, id := range ids { - if _, ok := idToListMap[id]; !ok { - idToListMap[id] = make(map[string]struct{}) - } - for _, elem := range list { - idToListMap[id][elem] = struct{}{} - } - } - } else { - return nil, fmt.Errorf("%q is not a known id or category", idOrCategory) - } - } - return idToListMap, nil -} - -func getCategoryToIDs(idToCategories map[string][]string) map[string][]string { - categoryToIDs := make(map[string][]string) - for id, categories := range idToCategories { - for _, category := range categories { - // handles empty category as well - categoryToIDs[category] = append(categoryToIDs[category], id) - } - } - return categoryToIDs -} - -func getIDToRuleBuilder(ruleBuilders []*RuleBuilder) (map[string]*RuleBuilder, error) { - m := make(map[string]*RuleBuilder) - for _, ruleBuilder := range ruleBuilders { - if _, ok := m[ruleBuilder.id]; ok { - return nil, fmt.Errorf("duplicate rule ID: %q", ruleBuilder.id) - } - m[ruleBuilder.id] = ruleBuilder - } - return m, nil -} - -func getRuleBuilderCategories( - ruleBuilder *RuleBuilder, - idToCategories map[string][]string, -) ([]string, error) { - categories, ok := idToCategories[ruleBuilder.id] - if !ok { - return nil, fmt.Errorf("%q is not configured for categories", ruleBuilder.id) - } - // it is ok for categories to be empty, however the map must contain an entry - // or otherwise this is a system error - return categories, nil -} - -func sortRules(rules []*Rule) { - sort.Slice( - rules, - func(i int, j int) bool { - // categories are sorted at this point - // so we know the first category is a top-level category if present - one := rules[i] - two := rules[j] - oneCategories := one.Categories() - twoCategories := two.Categories() - if len(oneCategories) == 0 && len(twoCategories) > 0 { - return false - } - if len(oneCategories) > 0 && len(twoCategories) == 0 { - return true - } - if len(oneCategories) > 0 && len(twoCategories) > 0 { - compare := categoryCompare(oneCategories[0], twoCategories[0]) - if compare < 0 { - return true - } - if compare > 0 { - return false - } - } - oneCategoriesString := strings.Join(oneCategories, ",") - twoCategoriesString := strings.Join(twoCategories, ",") - if oneCategoriesString < twoCategoriesString { - return true - } - if oneCategoriesString > twoCategoriesString { - return false - } - return one.ID() < two.ID() - }, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/helper.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/helper.go deleted file mode 100644 index ee52f43632..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/helper.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/protosource" -) - -// Helper is a helper for rules. -type Helper struct { - id string - ignoreFunc IgnoreFunc - fileAnnotations []bufanalysis.FileAnnotation -} - -// NewHelper returns a new Helper for the given id. -func NewHelper(id string, ignoreFunc IgnoreFunc) *Helper { - return &Helper{ - id: id, - ignoreFunc: ignoreFunc, - } -} - -// AddFileAnnotationf adds a FileAnnotation with the id as the Type. -// -// If descriptor is nil, no filename information is added. -// If location is nil, no line or column information will be added. -func (h *Helper) AddFileAnnotationf( - descriptor protosource.Descriptor, - location protosource.Location, - format string, - args ...interface{}, -) { - h.addFileAnnotationf( - descriptor, - nil, - location, - nil, - format, - args..., - ) -} - -// AddFileAnnotationWithExtraIgnoreDescriptorsf adds a FileAnnotation with the id as the Type. -// -// extraIgnoreDescriptors are extra desciptors to check for ignores. -// -// If descriptor is nil, no filename information is added. -// If location is nil, no line or column information will be added. -func (h *Helper) AddFileAnnotationWithExtraIgnoreDescriptorsf( - descriptor protosource.Descriptor, - extraIgnoreDescriptors []protosource.Descriptor, - location protosource.Location, - format string, - args ...interface{}, -) { - h.addFileAnnotationf( - descriptor, - extraIgnoreDescriptors, - location, - nil, - format, - args..., - ) -} - -// AddFileAnnotationWithExtraIgnoreLocationsf adds a FileAnnotation with the id as the Type. -// -// extraIgnoreLocations are extra locations to check for comment ignores. -// -// If descriptor is nil, no filename information is added. -// If location is nil, no line or column information will be added. -func (h *Helper) AddFileAnnotationWithExtraIgnoreLocationsf( - descriptor protosource.Descriptor, - location protosource.Location, - extraIgnoreLocations []protosource.Location, - format string, - args ...interface{}, -) { - h.addFileAnnotationf( - descriptor, - nil, - location, - extraIgnoreLocations, - format, - args..., - ) -} - -func (h *Helper) addFileAnnotationf( - descriptor protosource.Descriptor, - extraIgnoreDescriptors []protosource.Descriptor, - location protosource.Location, - extraIgnoreLocations []protosource.Location, - format string, - args ...interface{}, -) { - if h.ignoreFunc != nil && h.ignoreFunc( - h.id, - append([]protosource.Descriptor{descriptor}, extraIgnoreDescriptors...), - append([]protosource.Location{location}, extraIgnoreLocations...), - ) { - return - } - h.fileAnnotations = append( - h.fileAnnotations, - newFileAnnotationf( - h.id, - descriptor, - location, - format, - args..., - ), - ) -} - -// FileAnnotations returns the added FileAnnotations. -func (h *Helper) FileAnnotations() []bufanalysis.FileAnnotation { - return h.fileAnnotations -} - -// newFileAnnotationf adds a FileAnnotation with the id as the Type. -// -// If descriptor is nil, no filename information is added. -// If location is nil, no line or column information will be added. -func newFileAnnotationf( - id string, - descriptor protosource.Descriptor, - location protosource.Location, - format string, - args ...interface{}, -) bufanalysis.FileAnnotation { - startLine := 0 - startColumn := 0 - endLine := 0 - endColumn := 0 - if location != nil { - startLine = location.StartLine() - startColumn = location.StartColumn() - endLine = location.EndLine() - endColumn = location.EndColumn() - } - var fileInfo bufanalysis.FileInfo - if descriptor != nil { - fileInfo = descriptor.File() - } - return bufanalysis.NewFileAnnotation( - fileInfo, - startLine, - startColumn, - endLine, - endColumn, - id, - fmt.Sprintf(format, args...), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule.go deleted file mode 100644 index 4fe084cfa0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "encoding/json" - "sort" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/protosource" -) - -// IgnoreFunc is an ignore function. -// -// Descriptors are the descriptors to check for ignores. -// Sometimes we have multiple descriptors, such as when we want to check previous -// file descriptors, or if an entire package is deleted. -// -// Locations are the locations to check for comment ignores. -// Sometimes, we have multiple locations to check, for example with RPC_REQUEST_STANDARD_NAME -// and RPC_RESPONSE_STANDARD_NAME, we want to check both the input/output type, and the method. -// -// Any descriptor or location may be nil. -type IgnoreFunc func(id string, descriptors []protosource.Descriptor, locations []protosource.Location) bool - -// CheckFunc is a check function. -type CheckFunc func(id string, ignoreFunc IgnoreFunc, previousFiles []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) - -// Rule provides a base embeddable rule. -type Rule struct { - id string - categories []string - purpose string - checkFunc CheckFunc -} - -// newRule returns a new Rule. -// -// Categories will be sorted and purpose will have "Checks that " -// prepended and "." appended. -func newRule( - id string, - categories []string, - purpose string, - checkFunc CheckFunc, -) *Rule { - c := make([]string, len(categories)) - copy(c, categories) - sort.Slice( - c, - func(i int, j int) bool { - return categoryLess(c[i], c[j]) - }, - ) - return &Rule{ - id: id, - categories: c, - purpose: "Checks that " + purpose + ".", - checkFunc: checkFunc, - } -} - -// ID implements Rule. -func (c *Rule) ID() string { - return c.id -} - -// Categories implements Rule. -func (c *Rule) Categories() []string { - return c.categories -} - -// Purpose implements Rule. -func (c *Rule) Purpose() string { - return c.purpose -} - -// MarshalJSON implements Rule. -func (c *Rule) MarshalJSON() ([]byte, error) { - return json.Marshal(ruleJSON{ID: c.id, Categories: c.categories, Purpose: c.purpose}) -} - -func (c *Rule) check(ignoreFunc IgnoreFunc, previousFiles []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - return c.checkFunc(c.ID(), ignoreFunc, previousFiles, files) -} - -type ruleJSON struct { - ID string `json:"id" yaml:"id"` - Categories []string `json:"categories" yaml:"categories"` - Purpose string `json:"purpose" yaml:"purpose"` -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule_builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule_builder.go deleted file mode 100644 index 7ad03b9486..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/rule_builder.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/protosource" -) - -// RuleBuilder is a rule builder. -type RuleBuilder struct { - id string - newPurpose func(ConfigBuilder) (string, error) - newCheck func(ConfigBuilder) (CheckFunc, error) -} - -// NewRuleBuilder returns a new RuleBuilder. -func NewRuleBuilder( - id string, - newPurpose func(ConfigBuilder) (string, error), - newCheck func(ConfigBuilder) (CheckFunc, error), -) *RuleBuilder { - return &RuleBuilder{ - id: id, - newPurpose: newPurpose, - newCheck: newCheck, - } -} - -// NewNopRuleBuilder returns a new RuleBuilder for the direct -// purpose and CheckFunc. -func NewNopRuleBuilder( - id string, - purpose string, - checkFunc CheckFunc, -) *RuleBuilder { - return NewRuleBuilder( - id, - newNopPurpose(purpose), - newNopCheckFunc(checkFunc), - ) -} - -// NewRule returns a new Rule. -// -// Categories will be sorted and Purpose will be prepended with "Checks that " -// and appended with ".". -// -// Categories is an actual copy from the ruleBuilder. -func (c *RuleBuilder) NewRule(configBuilder ConfigBuilder, categories []string) (*Rule, error) { - purpose, err := c.newPurpose(configBuilder) - if err != nil { - return nil, err - } - check, err := c.newCheck(configBuilder) - if err != nil { - return nil, err - } - return newRule( - c.id, - categories, - purpose, - check, - ), nil -} - -// ID returns the id. -func (c *RuleBuilder) ID() string { - return c.id -} - -func newNopPurpose(purpose string) func(ConfigBuilder) (string, error) { - return func(ConfigBuilder) (string, error) { - return purpose, nil - } -} - -func newNopCheckFunc( - f func(string, IgnoreFunc, []protosource.File, []protosource.File) ([]bufanalysis.FileAnnotation, error), -) func(ConfigBuilder) (CheckFunc, error) { - return func(ConfigBuilder) (CheckFunc, error) { - return f, nil - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/runner.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/runner.go deleted file mode 100644 index 34c238c917..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/runner.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "context" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/protosource" - "github.com/bufbuild/buf/private/pkg/protoversion" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -const ( - tracerName = "bufbuild/buf" -) - -// Runner is a runner. -type Runner struct { - logger *zap.Logger - ignorePrefix string - tracer trace.Tracer -} - -// NewRunner returns a new Runner. -func NewRunner(logger *zap.Logger, options ...RunnerOption) *Runner { - runner := &Runner{ - logger: logger, - tracer: otel.GetTracerProvider().Tracer(tracerName), - } - for _, option := range options { - option(runner) - } - return runner -} - -// RunnerOption is an option for a new Runner. -type RunnerOption func(*Runner) - -// RunnerWithIgnorePrefix returns a new RunnerOption that sets the comment ignore prefix. -// -// This will result in failures where the location has "ignore_prefix id" in the leading -// comment being ignored. -// -// The default is to not enable comment ignores. -func RunnerWithIgnorePrefix(ignorePrefix string) RunnerOption { - return func(runner *Runner) { - runner.ignorePrefix = ignorePrefix - } -} - -// Check runs the Rules. -func (r *Runner) Check(ctx context.Context, config *Config, previousFiles []protosource.File, files []protosource.File) ([]bufanalysis.FileAnnotation, error) { - rules := config.Rules - if len(rules) == 0 { - return nil, nil - } - ctx, span := r.tracer.Start(ctx, "check", trace.WithAttributes( - attribute.Key("num_files").Int(len(files)), - attribute.Key("num_rules").Int(len(rules)), - )) - defer span.End() - - ignoreFunc := r.newIgnoreFunc(config) - var fileAnnotations []bufanalysis.FileAnnotation - resultC := make(chan *result, len(rules)) - for _, rule := range rules { - rule := rule - go func() { - iFileAnnotations, iErr := rule.check(ignoreFunc, previousFiles, files) - resultC <- newResult(iFileAnnotations, iErr) - }() - } - var err error - for i := 0; i < len(rules); i++ { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case result := <-resultC: - fileAnnotations = append(fileAnnotations, result.FileAnnotations...) - err = multierr.Append(err, result.Err) - } - } - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return nil, err - } - bufanalysis.SortFileAnnotations(fileAnnotations) - return fileAnnotations, nil -} - -func (r *Runner) newIgnoreFunc(config *Config) IgnoreFunc { - return func(id string, descriptors []protosource.Descriptor, locations []protosource.Location) bool { - if idIsIgnored(id, descriptors, config) { - return true - } - // if ignorePrefix is empty, comment ignores are not enabled for the runner - // this is the case with breaking changes - if r.ignorePrefix != "" && config.AllowCommentIgnores && - locationsAreIgnored(id, r.ignorePrefix, locations, config) { - return true - } - if config.IgnoreUnstablePackages { - for _, descriptor := range descriptors { - if descriptorPackageIsUnstable(descriptor) { - return true - } - } - } - return false - } -} - -func idIsIgnored(id string, descriptors []protosource.Descriptor, config *Config) bool { - for _, descriptor := range descriptors { - // OR of descriptors - if idIsIgnoredForDescriptor(id, descriptor, config) { - return true - } - } - return false -} - -func idIsIgnoredForDescriptor(id string, descriptor protosource.Descriptor, config *Config) bool { - if descriptor == nil { - return false - } - path := descriptor.File().Path() - if normalpath.MapHasEqualOrContainingPath(config.IgnoreRootPaths, path, normalpath.Relative) { - return true - } - if id == "" { - return false - } - ignoreRootPaths, ok := config.IgnoreIDToRootPaths[id] - if !ok { - return false - } - return normalpath.MapHasEqualOrContainingPath(ignoreRootPaths, path, normalpath.Relative) -} - -func locationsAreIgnored(id string, ignorePrefix string, locations []protosource.Location, config *Config) bool { - // we already check that ignorePrefix is non-empty, but just doing here for safety - if id == "" || ignorePrefix == "" { - return false - } - fullIgnorePrefix := ignorePrefix + " " + id - for _, location := range locations { - if location != nil { - if leadingComments := location.LeadingComments(); leadingComments != "" { - for _, line := range stringutil.SplitTrimLinesNoEmpty(leadingComments) { - if strings.HasPrefix(line, fullIgnorePrefix) { - return true - } - } - } - } - } - return false -} - -func descriptorPackageIsUnstable(descriptor protosource.Descriptor) bool { - if descriptor == nil { - return false - } - packageVersion, ok := protoversion.NewPackageVersionForPackage(descriptor.File().Package()) - if !ok { - return false - } - return packageVersion.StabilityLevel() != protoversion.StabilityLevelStable -} - -type result struct { - FileAnnotations []bufanalysis.FileAnnotation - Err error -} - -func newResult(fileAnnotations []bufanalysis.FileAnnotation, err error) *result { - return &result{ - FileAnnotations: fileAnnotations, - Err: err, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/usage.gen.go deleted file mode 100644 index b94f5ee09d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package internal - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/vars.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/vars.go deleted file mode 100644 index f53e367e83..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/vars.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -// priority 1 is higher than priority two -var topLevelCategoryToPriority = map[string]int{ - "MINIMAL": 1, - "BASIC": 2, - "DEFAULT": 3, - "COMMENTS": 4, - "UNARY_RPC": 5, - "OTHER": 6, - "FILE": 1, - "PACKAGE": 2, - "WIRE_JSON": 3, - "WIRE": 4, -} - -func categoryLess(one string, two string) bool { - return categoryCompare(one, two) < 0 -} - -func categoryCompare(one string, two string) int { - onePriority, oneIsTopLevel := topLevelCategoryToPriority[one] - twoPriority, twoIsTopLevel := topLevelCategoryToPriority[two] - if oneIsTopLevel && !twoIsTopLevel { - return -1 - } - if !oneIsTopLevel && twoIsTopLevel { - return 1 - } - if oneIsTopLevel && twoIsTopLevel { - if onePriority < twoPriority { - return -1 - } - if onePriority > twoPriority { - return 1 - } - } - if one < two { - return -1 - } - if one > two { - return 1 - } - return 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/version_spec.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/version_spec.go deleted file mode 100644 index d865ca4b46..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/internal/version_spec.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "sort" - - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -// VersionSpec specifies the rules, ids, and categories for a given version. -type VersionSpec struct { - RuleBuilders []*RuleBuilder - DefaultCategories []string - // May include IDs without any categories. - // To get all categories, use AllCategoriesForVersionSpec. - IDToCategories map[string][]string -} - -// AllCategoriesForVersionSpec returns all categories for the VersionSpec. -// -// Sorted by category priority. -func AllCategoriesForVersionSpec(versionSpec *VersionSpec) []string { - categoriesMap := make(map[string]struct{}) - for _, categories := range versionSpec.IDToCategories { - for _, category := range categories { - categoriesMap[category] = struct{}{} - } - } - categories := stringutil.MapToSlice(categoriesMap) - sort.Slice( - categories, - func(i int, j int) bool { - return categoryLess(categories[i], categories[j]) - }, - ) - return categories -} - -// AllIDsForVersionSpec returns all ids for the VersionSpec. -// -// Sorted lexographically. -func AllIDsForVersionSpec(versionSpec *VersionSpec) []string { - m := make(map[string]struct{}) - for id := range versionSpec.IDToCategories { - m[id] = struct{}{} - } - return stringutil.MapToSortedSlice(m) -} - -// AllCategoriesAndIDsForVersionSpec returns all categories and rules for the VersionSpec. -// -// Sorted lexographically. -func AllCategoriesAndIDsForVersionSpec(versionSpec *VersionSpec) []string { - m := make(map[string]struct{}) - for id, categories := range versionSpec.IDToCategories { - m[id] = struct{}{} - for _, category := range categories { - m[category] = struct{}{} - } - } - return stringutil.MapToSortedSlice(m) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/usage.gen.go deleted file mode 100644 index b701b1781f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufcheck/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufcheck - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/bufconfig.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/bufconfig.go deleted file mode 100644 index 2a6c4b3d51..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/bufconfig.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufconfig contains the configuration functionality. -package bufconfig - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -const ( - // ExternalConfigV1FilePath is the default configuration file path. - ExternalConfigV1FilePath = "buf.yaml" - - // ExternalConfigV1Beta1FilePath is the v1beta1 file path. - ExternalConfigV1Beta1FilePath = "buf.yaml" - - // V1Version is the v1 version. - V1Version = "v1" - - // V1Beta1Version is the v1beta1 version. - V1Beta1Version = "v1beta1" - - // backupExternalConfigV1FilePath is another acceptable configuration file path for v1. - // - // Originally we thought we were going to move to buf.mod, and had this around for - // a while, but then reverted back to buf.yaml. We still need to support buf.mod as - // we released with it, however. - backupExternalConfigV1FilePath = "buf.mod" -) - -var ( - // All versions are all the versions in order. - AllVersions = []string{ - V1Beta1Version, - V1Version, - } - - // AllConfigFilePaths are all acceptable config file paths without overrides. - // - // These are in the order we should check. - AllConfigFilePaths = []string{ - ExternalConfigV1FilePath, - backupExternalConfigV1FilePath, - } -) - -// Config is the user config. -type Config struct { - Version string - ModuleIdentity bufmoduleref.ModuleIdentity - Build *bufmoduleconfig.Config - Breaking *bufbreakingconfig.Config - Lint *buflintconfig.Config -} - -// GetConfigForBucket gets the Config for the YAML data at ConfigFilePath. -// -// If the data is of length 0, returns the default config. -func GetConfigForBucket(ctx context.Context, readBucket storage.ReadBucket) (*Config, error) { - return getConfigForBucket(ctx, readBucket) -} - -// GetConfigForData gets the Config for the given JSON or YAML data. -// -// If the data is of length 0, returns the default config. -func GetConfigForData(ctx context.Context, data []byte) (*Config, error) { - return getConfigForData(ctx, data) -} - -// WriteConfig writes an initial configuration file into the bucket. -func WriteConfig( - ctx context.Context, - writeBucket storage.WriteBucket, - options ...WriteConfigOption, -) error { - return writeConfig( - ctx, - writeBucket, - options..., - ) -} - -// WriteConfigOption is an option for WriteConfig. -type WriteConfigOption func(*writeConfigOptions) - -// WriteConfigWithDocumentationComments returns a new WriteConfigOption that documents the resulting configuration file. -func WriteConfigWithDocumentationComments() WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.documentationComments = true - } -} - -// WriteConfigWithUncomment returns a new WriteConfigOption that uncomments the resulting configuration file -// options that are commented out by default. -// -// If this option is used, WriteConfigWithDocumentationComments must also be used. -func WriteConfigWithUncomment() WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.uncomment = true - } -} - -// WriteConfigWithModuleIdentity returns a new WriteConfigOption that sets the name of the -// module to the given ModuleIdentity. -// -// The default is to not set the name. -// -// Only use in tests. -func WriteConfigWithModuleIdentity(moduleIdentity bufmoduleref.ModuleIdentity) WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.moduleIdentity = moduleIdentity - } -} - -// WriteConfigWithDependencyModuleReferences returns a new WriteConfigOption that sets the -// dependencies of the module. -// -// The default is to not have any dependencies. -// If this option is used, WriteConfigWithModuleIdentity must also be used. -// -// Only use in tests. -func WriteConfigWithDependencyModuleReferences(dependencyModuleReferences ...bufmoduleref.ModuleReference) WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.dependencyModuleReferences = dependencyModuleReferences - } -} - -// WriteConfigWithBreakingConfig returns a new WriteConfigOption that sets the breaking change -// config for the module. -// -// If this option is used then the version used must be consistent with the rest of the config. -func WriteConfigWithBreakingConfig(breakingConfig *bufbreakingconfig.Config) WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.breakingConfig = breakingConfig - } -} - -// WriteConfigWithLintConfig returns a new WriteConfigOption that sets the lint config for the module. -// -// If this option is used then the version used must be consistent with the rest of the config. -func WriteConfigWithLintConfig(lintConfig *buflintconfig.Config) WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.lintConfig = lintConfig - } -} - -// WriteConfigWithVersion returns a new WriteConfigOption that sets the version of the config -// being written. -// -// If this is not set, the default is v1beta1. -func WriteConfigWithVersion(version string) WriteConfigOption { - return func(writeConfigOptions *writeConfigOptions) { - writeConfigOptions.version = version - } -} - -// ReadConfigOS reads the configuration from the OS or an override, if any. -// -// ONLY USE IN CLI TOOLS. -func ReadConfigOS( - ctx context.Context, - readBucket storage.ReadBucket, - options ...ReadConfigOSOption, -) (*Config, error) { - return readConfigOS( - ctx, - readBucket, - options..., - ) -} - -// ReadConfigOSOption is an option for ReadConfig. -type ReadConfigOSOption func(*readConfigOSOptions) - -// ReadConfigOSWithOverride sets the override. -// -// If override is set, this will first check if the override ends in .json or .yaml, if so, -// this reads the file at this path and uses it. Otherwise, this assumes this is configuration -// data in either JSON or YAML format, and unmarshals it. -// -// If no override is set, this reads ExternalConfigFilePath in the bucket. -func ReadConfigOSWithOverride(override string) ReadConfigOSOption { - return func(readConfigOSOptions *readConfigOSOptions) { - readConfigOSOptions.override = override - } -} - -// ExistingConfigFilePath checks if a configuration file exists, and if so, returns the path -// within the ReadBucket of this configuration file. -// -// Returns empty string and no error if no configuration file exists. -func ExistingConfigFilePath(ctx context.Context, readBucket storage.ReadBucket) (string, error) { - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return "", err - } - if exists { - return configFilePath, nil - } - } - return "", nil -} - -// ValidateVersion checks that a given version string is valid. -func ValidateVersion(version string) error { - switch version { - case V1Version, V1Beta1Version: - return nil - default: - return fmt.Errorf("invalid config version %q provided", version) - } -} - -// ExternalConfigV1Beta1 represents the on-disk representation of the Config -// at version v1beta1. -type ExternalConfigV1Beta1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Deps []string `json:"deps,omitempty" yaml:"deps,omitempty"` - Build bufmoduleconfig.ExternalConfigV1Beta1 `json:"build,omitempty" yaml:"build,omitempty"` - Breaking bufbreakingconfig.ExternalConfigV1Beta1 `json:"breaking,omitempty" yaml:"breaking,omitempty"` - Lint buflintconfig.ExternalConfigV1Beta1 `json:"lint,omitempty" yaml:"lint,omitempty"` -} - -// ExternalConfigV1 represents the on-disk representation of the Config -// at version v1. -type ExternalConfigV1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - Deps []string `json:"deps,omitempty" yaml:"deps,omitempty"` - Build bufmoduleconfig.ExternalConfigV1 `json:"build,omitempty" yaml:"build,omitempty"` - Breaking bufbreakingconfig.ExternalConfigV1 `json:"breaking,omitempty" yaml:"breaking,omitempty"` - Lint buflintconfig.ExternalConfigV1 `json:"lint,omitempty" yaml:"lint,omitempty"` -} - -// ExternalConfigVersion defines the subset of all config -// file versions that is used to determine the configuration version. -type ExternalConfigVersion struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/config.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/config.go deleted file mode 100644 index aa7c3813a3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/config.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconfig - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" -) - -func newConfigV1Beta1(externalConfig ExternalConfigV1Beta1) (*Config, error) { - buildConfig, err := bufmoduleconfig.NewConfigV1Beta1(externalConfig.Build, externalConfig.Deps...) - if err != nil { - return nil, err - } - var moduleIdentity bufmoduleref.ModuleIdentity - if externalConfig.Name != "" { - moduleIdentity, err = bufmoduleref.ModuleIdentityForString(externalConfig.Name) - if err != nil { - return nil, err - } - } - return &Config{ - Version: V1Beta1Version, - ModuleIdentity: moduleIdentity, - Build: buildConfig, - Breaking: bufbreakingconfig.NewConfigV1Beta1(externalConfig.Breaking), - Lint: buflintconfig.NewConfigV1Beta1(externalConfig.Lint), - }, nil -} - -func newConfigV1(externalConfig ExternalConfigV1) (*Config, error) { - buildConfig, err := bufmoduleconfig.NewConfigV1(externalConfig.Build, externalConfig.Deps...) - if err != nil { - return nil, err - } - var moduleIdentity bufmoduleref.ModuleIdentity - if externalConfig.Name != "" { - moduleIdentity, err = bufmoduleref.ModuleIdentityForString(externalConfig.Name) - if err != nil { - return nil, err - } - } - return &Config{ - Version: V1Version, - ModuleIdentity: moduleIdentity, - Build: buildConfig, - Breaking: bufbreakingconfig.NewConfigV1(externalConfig.Breaking), - Lint: buflintconfig.NewConfigV1(externalConfig.Lint), - }, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/get.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/get.go deleted file mode 100644 index 38895251d0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/get.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconfig - -import ( - "context" - "fmt" - "io" - - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/multierr" -) - -func getConfigForBucket(ctx context.Context, readBucket storage.ReadBucket) (_ *Config, retErr error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_config") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - - // This will be in the order of precedence. - var foundConfigFilePaths []string - // Go through all valid config file paths and see which ones are present. - // If none are present, return the default config. - // If multiple are present, error. - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return nil, err - } - if exists { - foundConfigFilePaths = append(foundConfigFilePaths, configFilePath) - } - } - switch len(foundConfigFilePaths) { - case 0: - // Did not find anything, return the default. - return newConfigV1(ExternalConfigV1{}) - case 1: - readObjectCloser, err := readBucket.Get(ctx, foundConfigFilePaths[0]) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readObjectCloser.Close()) - }() - data, err := io.ReadAll(readObjectCloser) - if err != nil { - return nil, err - } - return getConfigForDataInternal( - ctx, - encoding.UnmarshalYAMLNonStrict, - encoding.UnmarshalYAMLStrict, - data, - readObjectCloser.ExternalPath(), - ) - default: - return nil, fmt.Errorf("only one configuration file can exist but found multiple configuration files: %s", stringutil.SliceToString(foundConfigFilePaths)) - } -} - -func getConfigForData(ctx context.Context, data []byte) (*Config, error) { - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_config_for_data") - defer span.End() - config, err := getConfigForDataInternal( - ctx, - encoding.UnmarshalJSONOrYAMLNonStrict, - encoding.UnmarshalJSONOrYAMLStrict, - data, - "Configuration data", - ) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - } - return config, err -} - -func getConfigForDataInternal( - ctx context.Context, - unmarshalNonStrict func([]byte, interface{}) error, - unmarshalStrict func([]byte, interface{}) error, - data []byte, - id string, -) (*Config, error) { - var externalConfigVersion ExternalConfigVersion - if err := unmarshalNonStrict(data, &externalConfigVersion); err != nil { - return nil, err - } - switch externalConfigVersion.Version { - case "": - return nil, fmt.Errorf(`%s has no version set. Please add "version: %s". See https://docs.buf.build/faq for more details`, id, V1Version) - case V1Beta1Version: - var externalConfigV1Beta1 ExternalConfigV1Beta1 - if err := unmarshalStrict(data, &externalConfigV1Beta1); err != nil { - return nil, err - } - return newConfigV1Beta1(externalConfigV1Beta1) - case V1Version: - var externalConfigV1 ExternalConfigV1 - if err := unmarshalStrict(data, &externalConfigV1); err != nil { - return nil, err - } - return newConfigV1(externalConfigV1) - default: - return nil, fmt.Errorf( - `%s has an invalid "version: %s" set. Please add "version: %s". See https://docs.buf.build/faq for more details`, - id, - externalConfigVersion.Version, - V1Version, - ) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/read.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/read.go deleted file mode 100644 index 704733f4ee..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/read.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconfig - -import ( - "context" - "fmt" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/storage" -) - -func readConfigOS( - ctx context.Context, - readBucket storage.ReadBucket, - options ...ReadConfigOSOption, -) (*Config, error) { - readConfigOSOptions := newReadConfigOSOptions() - for _, option := range options { - option(readConfigOSOptions) - } - if readConfigOSOptions.override != "" { - var data []byte - var err error - switch filepath.Ext(readConfigOSOptions.override) { - case ".json", ".yaml", ".yml": - data, err = os.ReadFile(readConfigOSOptions.override) - if err != nil { - return nil, fmt.Errorf("could not read file: %v", err) - } - default: - data = []byte(readConfigOSOptions.override) - } - return GetConfigForData(ctx, data) - } - return GetConfigForBucket(ctx, readBucket) -} - -type readConfigOSOptions struct { - override string -} - -func newReadConfigOSOptions() *readConfigOSOptions { - return &readConfigOSOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/usage.gen.go deleted file mode 100644 index a555bf237d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufconfig - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/write.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/write.go deleted file mode 100644 index 916dd98632..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconfig/write.go +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconfig - -import ( - "bytes" - "context" - "errors" - "fmt" - "text/template" - - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" - "gopkg.in/yaml.v3" -) - -// If this is updated, make sure to update docs.buf.build TODO automate this - -const ( - exampleName = "buf.build/acme/weather" - // This is only used for `buf mod init`. - tmplDocumentationCommentsData = `{{$top := .}}# This specifies the configuration file version. -# -# This controls the configuration file layout, defaults, and lint/breaking -# rules and rule categories. Buf takes breaking changes seriously in -# all aspects, and none of these will ever change for a given version. -# -# The only valid versions are "v1beta1", "v1". -# This key is required. -version: {{.Version}} - -# name is the module name. -{{if .NameUnset}}#{{end}}name: {{.Name}} - -# deps are the module dependencies -{{if .DepsUnset}}#{{end}}deps: -{{range $dep := .Deps}}{{if $top.DepsUnset}}#{{end}} - {{$dep}} -{{end}} -# build contains the options for builds. -# -# This affects the behavior of buf build, as well as the build behavior -# for source lint and breaking change rules. -# -# If you want to build all files in your repository, this section can be -# omitted. -build: - - # excludes is the list of directories to exclude. - # - # These directories will not be built or checked. If a directory is excluded, - # buf treats the directory as if it does not exist. - # - # All directory paths in exclude must be relative to the directory of - # your buf.yaml. Only directories can be specified, and all specified - # directories must within the root directory. - {{if not .Uncomment}}#{{end}}excludes: - {{if not .Uncomment}}#{{end}} - foo - {{if not .Uncomment}}#{{end}} - bar/baz - -# lint contains the options for lint rules. -lint: - - # use is the list of rule categories and ids to use for buf lint. - # - # Categories are sets of rule ids. - # Run buf config ls-lint-rules --all to get a list of all rules. - # - # The union of the categories and ids will be used. - # - # The default is [DEFAULT]. - use: -{{range $lint_id := .LintConfig.Use}} - {{$lint_id}} -{{end}} - # except is the list of rule ids or categories to remove from the use - # list. - # - # This allows removal of specific rules from the union of rules derived - # from the use list of categories and ids. - {{if not .Uncomment}}#{{end}}except: - {{if not .Uncomment}}#{{end}} - ENUM_VALUE_UPPER_SNAKE_CASE - - # ignore is the list of directories or files to ignore for all rules. - # - # All directories and file paths are specified relative to the root directory. - # The directory "." is not allowed - this is equivalent to ignoring - # everything. - {{if not .Uncomment}}#{{end}}ignore: - {{if not .Uncomment}}#{{end}} - bat - {{if not .Uncomment}}#{{end}} - ban/ban.proto - - # ignore_only is the map from rule id or category to file or directory to - # ignore. - # - # All directories and file paths are specified relative to the root directory. - # The directory "." is not allowed - this is equivalent to using the "except" - # option. - # - # Note you can generate this section using - # "buf lint --error-format=config-ignore-yaml". The result of this command - # can be copy/pasted here. - {{if not .Uncomment}}#{{end}}ignore_only: - {{if not .Uncomment}}#{{end}} ENUM_PASCAL_CASE: - {{if not .Uncomment}}#{{end}} - foo/foo.proto - {{if not .Uncomment}}#{{end}} - bar - {{if not .Uncomment}}#{{end}} FIELD_LOWER_SNAKE_CASE: - {{if not .Uncomment}}#{{end}} - foo - - # enum_zero_value_suffix affects the behavior of the ENUM_ZERO_VALUE_SUFFIX - # rule. - # - # This will result in this suffix being used instead of the default - # "_UNSPECIFIED" suffix. - {{if not .Uncomment}}#{{end}}enum_zero_value_suffix: _UNSPECIFIED - - # rpc_allow_same_request_response affects the behavior of the - # RPC_REQUEST_RESPONSE_UNIQUE rule. - # - # This will result in requests and responses being allowed to be the same - # type for a single RPC. - {{if not .Uncomment}}#{{end}}rpc_allow_same_request_response: false - - # rpc_allow_google_protobuf_empty_requests affects the behavior of the - # RPC_REQUEST_STANDARD_NAME and RPC_REQUEST_RESPONSE_UNIQUE rules. - # - # This will result in google.protobuf.Empty requests being ignored for - # RPC_REQUEST_STANDARD_NAME, and google.protobuf.Empty requests being allowed - # in multiple RPCs. - {{if not .Uncomment}}#{{end}}rpc_allow_google_protobuf_empty_requests: false - - # rpc_allow_google_protobuf_empty_responses affects the behavior of the - # RPC_RESPONSE_STANDARD_NAME and the RPC_REQUEST_RESPONSE_UNIQUE rules. - # - # This will result in google.protobuf.Empty responses being ignored for - # RPC_RESPONSE_STANDARD_NAME, and google.protobuf.Empty responses being - # allowed in multiple RPCs. - {{if not .Uncomment}}#{{end}}rpc_allow_google_protobuf_empty_responses: false - - # service_suffix affects the behavior of the SERVICE_SUFFIX rule. - # - # This will result in this suffix being used instead of the default "Service" - # suffix. - {{if not .Uncomment}}#{{end}}service_suffix: Service - - # allow_comment_ignores allows comment-driven ignores. - # - # If this option is set, leading comments can be added within Protobuf files - # to ignore lint errors for certain components. If any line in a leading - # comment starts with "buf:lint:ignore ID", then Buf will ignore lint errors - # for this id. For example: - # - # syntax = "proto3"; - # - # // buf:lint:ignore PACKAGE_LOWER_SNAKE_CASE - # // buf:lint:ignore PACKAGE_VERSION_SUFFIX - # package A; - # - # We do not recommend using this, as it allows individual engineers in a - # large organization to decide on their own lint rule exceptions. However, - # there are cases where this is necessarily, and we want users to be able to - # make informed decisions, so we provide this as an opt-in. - {{if not .Uncomment}}#{{end}}allow_comment_ignores: false - -# breaking contains the options for breaking rules. -breaking: - - # use is the list of rule categories and ids to use for - # buf breaking. - # - # Categories are sets of rule ids. - # Run buf config ls-breaking-rules --all to get a list of all rules. - # - # The union of the categories and ids will be used. - # - # As opposed to lint, where you may want to do more customization, with - # breaking is is generally better to only choose one of the following - # options: - # - # - [FILE] - # - [PACKAGE] - # - [WIRE] - # - [WIRE_JSON] - # - # The default is [FILE], as done below. - use: -{{range $breaking_id := .BreakingConfig.Use}} - {{$breaking_id}} -{{end}} - # except is the list of rule ids or categories to remove from the use - # list. - # - # This allows removal of specific rules from the union of rules derived - # from the use list of categories and ids. - # - # As opposed to lint, we generally recommend using one of the preconfigured - # options. Removing specific rules from breaking change detection is an - # advanced option. - {{if not .Uncomment}}#{{end}}except: - {{if not .Uncomment}}#{{end}} - FIELD_SAME_NAME - - # ignore is the list of directories or files to ignore for all rules. - # - # All directories and file paths are specified relative to the root directory. - # The directory "." is not allowed - this is equivalent to ignoring - # everything. - {{if not .Uncomment}}#{{end}}ignore: - {{if not .Uncomment}}#{{end}} - bat - {{if not .Uncomment}}#{{end}} - ban/ban.proto - - # ignore_only is the map from rule id or category to file or directory to - # ignore. - # - # All directories and file paths are specified relative to a root directory. - # The directory "." is not allowed - this is equivalent to using the "except" - # option. - {{if not .Uncomment}}#{{end}}ignore_only: - {{if not .Uncomment}}#{{end}} FIELD_NO_DELETE: - {{if not .Uncomment}}#{{end}} - foo/foo.proto - {{if not .Uncomment}}#{{end}} - bar - {{if not .Uncomment}}#{{end}} WIRE_JSON: - {{if not .Uncomment}}#{{end}} - foo - - # ignore_unstable_packages results in ignoring packages with a last component - # that is one of the unstable forms recognized by the "PACKAGE_VERSION_SUFFIX" - # lint rule. The following forms will be ignored: - # - # - v\d+test.* - # - v\d+(alpha|beta)\d+ - # - v\d+p\d+(alpha|beta)\d+ - # - # For example, if this option is set, the following packages will be ignored: - # - # - foo.bar.v1alpha1 - # - foo.bar.v1beta1 - # - foo.bar.v1test - {{if not .Uncomment}}#{{end}}ignore_unstable_packages: false` -) - -func writeConfig( - ctx context.Context, - writeBucket storage.WriteBucket, - options ...WriteConfigOption, -) error { - writeConfigOptions := newWriteConfigOptions() - for _, option := range options { - option(writeConfigOptions) - } - if err := validateWriteConfigOptions(writeConfigOptions); err != nil { - return err - } - // This is the same default as the bufconfig getters. - version := V1Version - if writeConfigOptions.version != "" { - if err := ValidateVersion(writeConfigOptions.version); err != nil { - return err - } - version = writeConfigOptions.version - } - config := &Config{ - Version: version, - ModuleIdentity: writeConfigOptions.moduleIdentity, - } - var breakingConfigVersion string - breakingConfig := writeConfigOptions.breakingConfig - if breakingConfig != nil { - breakingConfigVersion = breakingConfig.Version - if breakingConfigVersion != version { - return fmt.Errorf("version %q found for breaking config, does not match top level config version: %q", breakingConfigVersion, version) - } - config.Breaking = breakingConfig - } - var lintConfigVersion string - lintConfig := writeConfigOptions.lintConfig - if lintConfig != nil { - lintConfigVersion = lintConfig.Version - if lintConfigVersion != version { - return fmt.Errorf("version %q found for lint config, does not match top level config version: %q", lintConfigVersion, version) - } - config.Lint = lintConfig - } - // We should never hit this condition since we are already validating against `version`. - if breakingConfigVersion != lintConfigVersion { - return fmt.Errorf("breaking config version %q does not match lint config version %q", breakingConfigVersion, lintConfigVersion) - } - var dependencies []string - if len(writeConfigOptions.dependencyModuleReferences) > 0 { - dependencies = make([]string, len(writeConfigOptions.dependencyModuleReferences)) - for i, dependencyModuleReference := range writeConfigOptions.dependencyModuleReferences { - dependencies[i] = dependencyModuleReference.String() - } - } - if writeConfigOptions.documentationComments { - // Write out config using template with document comments. - return writeCommentedConfig(ctx, writeBucket, config, dependencies, writeConfigOptions.uncomment) - } - // Write out raw default config without comments using externalConfig{V1, V1Beta1} - return writeExternalConfig(ctx, writeBucket, version, config, dependencies) -} - -func writeExternalConfig( - ctx context.Context, - writeBucket storage.WriteBucket, - version string, - config *Config, - dependencies []string, -) error { - var name string - if config.ModuleIdentity != nil { - name = config.ModuleIdentity.IdentityString() - } - breakingConfig := config.Breaking - lintConfig := config.Lint - switch version { - case V1Beta1Version: - var externalBreakingConfig bufbreakingconfig.ExternalConfigV1Beta1 - if breakingConfig != nil { - externalBreakingConfig = bufbreakingconfig.ExternalConfigV1Beta1ForConfig(breakingConfig) - } - var externalLintConfig buflintconfig.ExternalConfigV1Beta1 - if lintConfig != nil { - externalLintConfig = buflintconfig.ExternalConfigV1Beta1ForConfig(lintConfig) - } - externalConfig := ExternalConfigV1Beta1{ - Name: name, - Version: config.Version, - Deps: dependencies, - Breaking: externalBreakingConfig, - Lint: externalLintConfig, - } - buffer := bytes.NewBuffer(nil) - encoder := yaml.NewEncoder(buffer) - encoder.SetIndent(2) - if err := encoder.Encode(externalConfig); err != nil { - return err - } - return storage.PutPath(ctx, writeBucket, ExternalConfigV1Beta1FilePath, buffer.Bytes()) - case V1Version: - var externalBreakingConfig bufbreakingconfig.ExternalConfigV1 - if breakingConfig != nil { - externalBreakingConfig = bufbreakingconfig.ExternalConfigV1ForConfig(breakingConfig) - } - var externalLintConfig buflintconfig.ExternalConfigV1 - if lintConfig != nil { - externalLintConfig = buflintconfig.ExternalConfigV1ForConfig(lintConfig) - } - externalConfig := ExternalConfigV1{ - Name: name, - Version: config.Version, - Deps: dependencies, - Breaking: externalBreakingConfig, - Lint: externalLintConfig, - } - buffer := bytes.NewBuffer(nil) - encoder := yaml.NewEncoder(buffer) - encoder.SetIndent(2) - if err := encoder.Encode(externalConfig); err != nil { - return err - } - return storage.PutPath(ctx, writeBucket, ExternalConfigV1FilePath, buffer.Bytes()) - default: - return fmt.Errorf(`%s has an invalid "version %s"`, name, version) - } -} - -type tmplParam struct { - Uncomment bool - Version string - Name string - NameUnset bool - Deps []string - DepsUnset bool - LintConfig *buflintconfig.Config - BreakingConfig *bufbreakingconfig.Config -} - -func newTmplParam(config *Config, dependencies []string, uncomment bool) *tmplParam { - var name string - var nameUnset bool - if config.ModuleIdentity != nil { - name = config.ModuleIdentity.IdentityString() - } - if name == "" { - name = exampleName - nameUnset = true - } - var dependenciesUnset bool - if len(dependencies) == 0 { - dependencies = []string{ - "buf.build/acme/petapis", - "buf.build/acme/pkg:alpha", - "buf.build/acme/paymentapis:7e8b594e68324329a7aefc6e750d18b9", - } - dependenciesUnset = true - } - return &tmplParam{ - Uncomment: uncomment, - Version: config.Version, - Name: name, - NameUnset: nameUnset, - Deps: dependencies, - DepsUnset: dependenciesUnset, - LintConfig: config.Lint, - BreakingConfig: config.Breaking, - } -} - -func writeCommentedConfig( - ctx context.Context, - writeBucket storage.WriteBucket, - config *Config, - dependencies []string, - uncomment bool, -) error { - tmplData := tmplDocumentationCommentsData - tmpl, err := template.New("tmpl").Parse(tmplData) - if err != nil { - return err - } - buffer := bytes.NewBuffer(nil) - if err := tmpl.Execute( - buffer, - newTmplParam( - config, - dependencies, - uncomment, - ), - ); err != nil { - return err - } - return storage.PutPath(ctx, writeBucket, ExternalConfigV1FilePath, buffer.Bytes()) -} - -type writeConfigOptions struct { - documentationComments bool - uncomment bool - moduleIdentity bufmoduleref.ModuleIdentity - dependencyModuleReferences []bufmoduleref.ModuleReference - breakingConfig *bufbreakingconfig.Config - lintConfig *buflintconfig.Config - version string -} - -func newWriteConfigOptions() *writeConfigOptions { - return &writeConfigOptions{} -} - -func validateWriteConfigOptions(writeConfigOptions *writeConfigOptions) error { - if !writeConfigOptions.documentationComments && writeConfigOptions.uncomment { - return errors.New("cannot set uncomment without documentationComments for WriteConfig") - } - if writeConfigOptions.moduleIdentity == nil && len(writeConfigOptions.dependencyModuleReferences) > 0 { - return errors.New("cannot set deps without a name for WriteConfig") - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/bufconnect.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/bufconnect.go deleted file mode 100644 index 3b2e994ff1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/bufconnect.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufconnect provides buf-specific Connect functionality. -package bufconnect - -const ( - // AuthenticationHeader is the standard OAuth header used for authenticating - // a user. Ignore the misnomer. - AuthenticationHeader = "Authorization" - // AuthenticationTokenPrefix is the standard OAuth token prefix. - // We use it for familiarity. - AuthenticationTokenPrefix = "Bearer " - // CliVersionHeaderName is the name of the header carrying the buf CLI version. - CliVersionHeaderName = "buf-version" - // CLIWarningHeaderName is the name of the header carrying a base64-encoded warning message - // from the server to the CLI. - CLIWarningHeaderName = "buf-warning-bin" - // DefaultRemote is the default remote if none can be inferred from a module name. - DefaultRemote = "buf.build" -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/errors.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/errors.go deleted file mode 100644 index 3ecbe37659..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/errors.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconnect - -import "errors" - -// AuthError wraps the error returned in the auth provider to add additional context. -type AuthError struct { - cause error - - tokenEnvKey string -} - -// Unwrap returns the underlying error. -func (e *AuthError) Unwrap() error { - return e.cause -} - -// Error implements the error interface and returns the error message. -func (e *AuthError) Error() string { - if e.cause == nil { - return "unknown error" - } - return e.cause.Error() -} - -// TokenEnvKey returns the environment variable used, if any, for authentication. -func (e *AuthError) TokenEnvKey() string { - return e.tokenEnvKey -} - -// AsAuthError uses errors.As to unwrap any error and look for an *AuthError. -func AsAuthError(err error) (*AuthError, bool) { - var authErr *AuthError - ok := errors.As(err, &authErr) - return authErr, ok -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/interceptors.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/interceptors.go deleted file mode 100644 index 5056300650..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/interceptors.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconnect - -import ( - "context" - "errors" - "fmt" - "net/http" - - "github.com/bufbuild/buf/private/pkg/app/applog" - "github.com/bufbuild/connect-go" -) - -const ( - // tokenEnvKey is the environment variable key for the auth token - tokenEnvKey = "BUF_TOKEN" -) - -// NewSetCLIVersionInterceptor returns a new Connect Interceptor that sets the Buf CLI version into all request headers -func NewSetCLIVersionInterceptor(version string) connect.UnaryInterceptorFunc { - interceptor := func(next connect.UnaryFunc) connect.UnaryFunc { - return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { - req.Header().Set(CliVersionHeaderName, version) - return next(ctx, req) - } - } - return interceptor -} - -// NewCLIWarningInterceptor returns a new Connect Interceptor that logs CLI warnings returned by server responses. -func NewCLIWarningInterceptor(container applog.Container) connect.UnaryInterceptorFunc { - interceptor := func(next connect.UnaryFunc) connect.UnaryFunc { - return func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { - resp, err := next(ctx, req) - if resp != nil { - logWarningFromHeader(container, resp.Header()) - } else if err != nil { - if connectErr := new(connect.Error); errors.As(err, &connectErr) { - logWarningFromHeader(container, connectErr.Meta()) - } - } - return resp, err - } - } - return interceptor -} - -func logWarningFromHeader(container applog.Container, header http.Header) { - encoded := header.Get(CLIWarningHeaderName) - if encoded != "" { - warning, err := connect.DecodeBinaryHeader(encoded) - if err != nil { - container.Logger().Debug(fmt.Errorf("failed to decode warning header: %w", err).Error()) - return - } - if len(warning) > 0 { - container.Logger().Warn(string(warning)) - } - } -} - -// TokenProvider finds the token for NewAuthorizationInterceptorProvider. -type TokenProvider interface { - // RemoteToken returns the remote token from the remote address. - RemoteToken(address string) string - // IsFromEnvVar returns true if the TokenProvider is generated from an environment variable. - IsFromEnvVar() bool -} - -// NewAuthorizationInterceptorProvider returns a new provider function which, when invoked, returns an interceptor -// which will set the auth token into the request header by the provided option. -// -// Note that the interceptor returned from this provider is always applied LAST in the series of interceptors added to -// a client. -func NewAuthorizationInterceptorProvider(tokenProviders ...TokenProvider) func(string) connect.UnaryInterceptorFunc { - return func(address string) connect.UnaryInterceptorFunc { - interceptor := func(next connect.UnaryFunc) connect.UnaryFunc { - return connect.UnaryFunc(func(ctx context.Context, req connect.AnyRequest) (connect.AnyResponse, error) { - usingTokenEnvKey := false - for _, tf := range tokenProviders { - if token := tf.RemoteToken(address); token != "" { - req.Header().Set(AuthenticationHeader, AuthenticationTokenPrefix+token) - usingTokenEnvKey = tf.IsFromEnvVar() - break - } - } - response, err := next(ctx, req) - if err != nil && usingTokenEnvKey { - err = &AuthError{cause: err, tokenEnvKey: tokenEnvKey} - } - return response, err - }) - } - return interceptor - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/netrc_token_provider.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/netrc_token_provider.go deleted file mode 100644 index 438882567c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/netrc_token_provider.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconnect - -import ( - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/netrc" -) - -// netrcTokenProvider is used to provide remote tokenToAuthKey from .netrc. -type netrcTokenProvider struct { - container app.EnvContainer - getMachineForName func(app.EnvContainer, string) (netrc.Machine, error) -} - -// NewNetrcTokenProvider returns a TokenProvider for a .netrc in a container. -func NewNetrcTokenProvider(container app.EnvContainer, getMachineForName func(app.EnvContainer, string) (netrc.Machine, error)) TokenProvider { - return &netrcTokenProvider{container: container, getMachineForName: getMachineForName} -} - -func (nt *netrcTokenProvider) RemoteToken(address string) string { - machine, err := nt.getMachineForName(nt.container, address) - if err != nil { - return "" - } - if machine != nil { - return machine.Password() - } - return "" -} - -func (nt *netrcTokenProvider) IsFromEnvVar() bool { - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/static_token_provider.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/static_token_provider.go deleted file mode 100644 index e391927209..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/static_token_provider.go +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufconnect - -import ( - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/pkg/app" -) - -// NewTokenProviderFromContainer creates a singleTokenProvider from the BUF_TOKEN environment variable -func NewTokenProviderFromContainer(container app.EnvContainer) (TokenProvider, error) { - return newTokenProviderFromString(container.Env(tokenEnvKey), true) -} - -// NewTokenProviderFromString creates a singleTokenProvider by the token provided -func NewTokenProviderFromString(token string) (TokenProvider, error) { - return newTokenProviderFromString(token, false) -} - -// newTokenProviderFromString returns a TokenProvider with auth keys from the provided token. The -// remote token is in the format: token1@remote1,token2@remote2. -// The special characters `@` and `,` are used as the splitters. The tokens and remote addresses -// do not contain these characters since they are enforced by the rules in BSR. -func newTokenProviderFromString(token string, isFromEnvVar bool) (TokenProvider, error) { - if token == "" { - return nopTokenProvider{}, nil - } - // Tokens for different remotes are separated by `,`. Using strings.Split to separate the string into remote tokens. - tokens := strings.Split(token, ",") - if len(tokens) == 1 { - if strings.Contains(tokens[0], "@") { - return newMultipleTokenProvider(tokens, isFromEnvVar) - } - return newSingleTokenProvider(tokens[0], isFromEnvVar) - } - return newMultipleTokenProvider(tokens, isFromEnvVar) -} - -// singleTokenProvider is used to provide set of authentication tokenToAuthKey. -type singleTokenProvider struct { - // true: the tokenSet is generated from environment variable tokenEnvKey - // false: otherwise - setBufTokenEnvVar bool - token string -} - -func newSingleTokenProvider(token string, isFromEnvVar bool) (*singleTokenProvider, error) { - if strings.Contains(token, "@") { - return nil, errors.New("token cannot contain special character `@`") - } - if strings.Contains(token, ",") { - return nil, errors.New("token cannot contain special character `,`") - } - if token == "" { - return nil, errors.New("single token cannot be empty") - } - return &singleTokenProvider{ - setBufTokenEnvVar: isFromEnvVar, - token: token, - }, nil -} - -// RemoteToken finds the token by the remote address -func (t *singleTokenProvider) RemoteToken(address string) string { - return t.token -} - -func (t *singleTokenProvider) IsFromEnvVar() bool { - return t.setBufTokenEnvVar -} - -type multipleTokenProvider struct { - addressToToken map[string]string - isFromEnvVar bool -} - -func newMultipleTokenProvider(tokens []string, isFromEnvVar bool) (*multipleTokenProvider, error) { - addressToToken := make(map[string]string) - for _, token := range tokens { - split := strings.Split(token, "@") - if len(split) != 2 { - return nil, fmt.Errorf("invalid token: %s", token) - } - if split[0] == "" || split[1] == "" { - return nil, fmt.Errorf("invalid token: %s", token) - } - if strings.Contains(split[0], ":") { - return nil, fmt.Errorf("invalid token: %s, token cannot contain special character `:`", token) - } - if strings.Contains(split[0], ",") { - return nil, fmt.Errorf("invalid token: %s, token cannot contain special character `,`", token) - } - if _, ok := addressToToken[split[1]]; ok { - return nil, fmt.Errorf("invalid token: %s, repeated remote adddress: %s", token, split[1]) - } - addressToToken[split[1]] = split[0] - } - return &multipleTokenProvider{ - addressToToken: addressToToken, - isFromEnvVar: isFromEnvVar, - }, nil -} - -func (m *multipleTokenProvider) RemoteToken(address string) string { - return m.addressToToken[address] -} - -func (m *multipleTokenProvider) IsFromEnvVar() bool { - return m.isFromEnvVar -} - -type nopTokenProvider struct{} - -func (nopTokenProvider) RemoteToken(string) string { - return "" -} - -func (nopTokenProvider) IsFromEnvVar() bool { - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/usage.gen.go deleted file mode 100644 index 18712823ef..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufconnect/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufconnect - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/bufgraph.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/bufgraph.go deleted file mode 100644 index 851134172b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/bufgraph.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgraph - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/dag" - "go.uber.org/zap" -) - -// Node is a node in a dependency graph. -// -// This is a struct because this needs to be comparable for the *dag.Graph. -// -// TODO: Don't have the duplication across Node and ImageModuleDependency. -type Node struct { - // Required, - Remote string - // Required. - Owner string - // Required. - Repository string - // Optional. Will not bet set for modules read from workspaces. - Commit string -} - -// IdentityString prints remote/owner/repository. -func (n *Node) IdentityString() string { - return n.Remote + "/" + n.Owner + "/" + n.Repository -} - -// String prints remote/owner/repository[:commit]. -func (n *Node) String() string { - s := n.IdentityString() - if n.Commit != "" { - return s + ":" + n.Commit - } - return s -} - -// Builder builds dependency graphs. -type Builder interface { - // Build builds the dependency graph. - Build( - ctx context.Context, - modules []bufmodule.Module, - options ...BuildOption, - ) (*dag.Graph[Node], []bufanalysis.FileAnnotation, error) -} - -// NewBuilder returns a new Builder. -func NewBuilder( - logger *zap.Logger, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) Builder { - return newBuilder( - logger, - moduleResolver, - moduleReader, - ) -} - -// BuildOption is an option for Build. -type BuildOption func(*buildOptions) - -// BuildWithWorkspace returns a new BuildOption that specifies a workspace -// that is being operated on. -func BuildWithWorkspace(workspace bufmodule.Workspace) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.workspace = workspace - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/builder.go deleted file mode 100644 index c5168102fd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/builder.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufgraph - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/dag" - "go.uber.org/zap" -) - -type builder struct { - logger *zap.Logger - moduleResolver bufmodule.ModuleResolver - moduleReader bufmodule.ModuleReader - imageBuilder bufimagebuild.Builder -} - -func newBuilder( - logger *zap.Logger, - moduleResolver bufmodule.ModuleResolver, - moduleReader bufmodule.ModuleReader, -) *builder { - return &builder{ - logger: logger, - moduleResolver: moduleResolver, - moduleReader: moduleReader, - imageBuilder: bufimagebuild.NewBuilder( - logger, - moduleReader, - ), - } -} - -func (b *builder) Build( - ctx context.Context, - modules []bufmodule.Module, - options ...BuildOption, -) (*dag.Graph[Node], []bufanalysis.FileAnnotation, error) { - buildOptions := newBuildOptions() - for _, option := range options { - option(buildOptions) - } - return b.build( - ctx, - modules, - buildOptions.workspace, - ) -} - -func (b *builder) build( - ctx context.Context, - modules []bufmodule.Module, - workspace bufmodule.Workspace, -) (*dag.Graph[Node], []bufanalysis.FileAnnotation, error) { - graph := dag.NewGraph[Node]() - alreadyProcessedNodes := make(map[Node]struct{}) - for _, module := range modules { - fileAnnotations, err := b.buildForModule( - ctx, - module, - newNodeForModule(module), - workspace, - graph, - alreadyProcessedNodes, - ) - if err != nil { - return nil, nil, err - } - if len(fileAnnotations) > 0 { - return nil, fileAnnotations, nil - } - } - return graph, nil, nil -} - -func (b *builder) buildForModule( - ctx context.Context, - module bufmodule.Module, - node Node, - workspace bufmodule.Workspace, - graph *dag.Graph[Node], - alreadyProcessedNodes map[Node]struct{}, -) ([]bufanalysis.FileAnnotation, error) { - // We can't rely on the existence of a node in the graph for this, as when we add an edge - // to the graph, the node is added, and we still need to process the node as a potential - // source node. - if _, ok := alreadyProcessedNodes[node]; ok { - return nil, nil - } - alreadyProcessedNodes[node] = struct{}{} - graph.AddNode(node) - image, fileAnnotations, err := b.imageBuilder.Build( - ctx, - module, - bufimagebuild.WithWorkspace(workspace), - bufimagebuild.WithExpectedDirectDependencies(module.DeclaredDirectDependencies()), - ) - if err != nil { - return nil, err - } - if len(fileAnnotations) > 0 { - return fileAnnotations, nil - } - for _, imageModuleDependency := range bufimage.ImageModuleDependencies(image) { - dependencyNode := newNodeForImageModuleDependency(imageModuleDependency) - if imageModuleDependency.IsDirect() { - graph.AddEdge(node, dependencyNode) - } - dependencyModule, err := b.getModuleForImageModuleDependency( - ctx, - imageModuleDependency, - workspace, - ) - if err != nil { - return nil, err - } - // TODO: deal with the case where there are differing commits for a given ModuleIdentity. - fileAnnotations, err := b.buildForModule( - ctx, - dependencyModule, - dependencyNode, - workspace, - graph, - alreadyProcessedNodes, - ) - if err != nil { - return nil, err - } - if len(fileAnnotations) > 0 { - return fileAnnotations, nil - } - } - return nil, nil -} - -func (b *builder) getModuleForImageModuleDependency( - ctx context.Context, - imageModuleDependency bufimage.ImageModuleDependency, - workspace bufmodule.Workspace, -) (bufmodule.Module, error) { - moduleIdentity := imageModuleDependency.ModuleIdentity() - commit := imageModuleDependency.Commit() - if workspace != nil { - module, ok := workspace.GetModule(moduleIdentity) - if ok { - return module, nil - } - } - if commit == "" { - // TODO: can we error here? The only - // case we should likely not have a commit is when we are using a workspace. - // There's no enforcement of this property, so erroring here is a bit weird, - // but it might be better to check our assumptions and figure out if there - // are exceptions after the fact, as opposed to resolving a ModulePin for - // main when we don't know if main is what we want. - return nil, fmt.Errorf("had ModuleIdentity %v with no associated commit, but did not have the module in a workspace", moduleIdentity) - } - moduleReference, err := bufmoduleref.NewModuleReference( - moduleIdentity.Remote(), - moduleIdentity.Owner(), - moduleIdentity.Repository(), - commit, - ) - if err != nil { - return nil, err - } - modulePin, err := b.moduleResolver.GetModulePin( - ctx, - moduleReference, - ) - if err != nil { - return nil, err - } - return b.moduleReader.GetModule( - ctx, - modulePin, - ) -} - -func newNodeForImageModuleDependency(imageModuleDependency bufimage.ImageModuleDependency) Node { - return Node{ - Remote: imageModuleDependency.ModuleIdentity().Remote(), - Owner: imageModuleDependency.ModuleIdentity().Owner(), - Repository: imageModuleDependency.ModuleIdentity().Repository(), - Commit: imageModuleDependency.Commit(), - } -} - -func newNodeForModule(module bufmodule.Module) Node { - // TODO: deal with unnamed Modules - var node Node - if moduleIdentity := module.ModuleIdentity(); moduleIdentity != nil { - node.Remote = moduleIdentity.Remote() - node.Owner = moduleIdentity.Owner() - node.Repository = moduleIdentity.Repository() - node.Commit = module.Commit() - } - return node -} - -type buildOptions struct { - workspace bufmodule.Workspace -} - -func newBuildOptions() *buildOptions { - return &buildOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/usage.gen.go deleted file mode 100644 index e9c1d1b315..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufgraph/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufgraph - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimage.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimage.go deleted file mode 100644 index f97085b080..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimage.go +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "fmt" - "sort" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -// ImageFile is a Protobuf file within an image. -type ImageFile interface { - bufmoduleref.FileInfo - // Proto is the backing *descriptorpb.FileDescriptorProto for this File. - // - // FileDescriptor should be preferred to Proto. We keep this method around - // because we have code that does modification to the ImageFile via this. - // - // This will never be nil. - // The value Path() is equal to Proto.GetName() . - Proto() *descriptorpb.FileDescriptorProto - // FileDescriptor is the backing FileDescriptor for this File. - // - // This will never be nil. - // The value Path() is equal to FileDescriptor.GetName() . - FileDescriptor() protodescriptor.FileDescriptor - // IsSyntaxUnspecified will be true if the syntax was not explicitly specified. - IsSyntaxUnspecified() bool - // UnusedDependencyIndexes returns the indexes of the unused dependencies within - // FileDescriptor.GetDependency(). - // - // All indexes will be valid. - // Will return nil if empty. - UnusedDependencyIndexes() []int32 - - withIsImport(isImport bool) ImageFile - isImageFile() -} - -// NewImageFile returns a new ImageFile. -// -// If externalPath is empty, path is used. -// -// TODO: moduleIdentity and commit should be options since they are optional. -func NewImageFile( - fileDescriptor protodescriptor.FileDescriptor, - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, - externalPath string, - isImport bool, - isSyntaxUnspecified bool, - unusedDependencyIndexes []int32, -) (ImageFile, error) { - return newImageFile( - fileDescriptor, - moduleIdentity, - commit, - externalPath, - isImport, - isSyntaxUnspecified, - unusedDependencyIndexes, - ) -} - -// Image is a buf image. -type Image interface { - // Files are the files that comprise the image. - // - // This contains all files, including imports if available. - // The returned files are in correct DAG order. - // - // All files that have the same ModuleIdentity will also have the same commit, or no commit. - // This is enforced at construction time. - Files() []ImageFile - // GetFile gets the file for the root relative file path. - // - // If the file does not exist, nil is returned. - // The path is expected to be normalized and validated. - // Note that all values of GetDependency() can be used here. - GetFile(path string) ImageFile - isImage() -} - -// NewImage returns a new Image for the given ImageFiles. -// -// The input ImageFiles are expected to be in correct DAG order! -// TODO: Consider checking the above, and if not, reordering the Files. -// If imageFiles is empty, returns error -func NewImage(imageFiles []ImageFile) (Image, error) { - return newImage(imageFiles, false) -} - -// MergeImages returns a new Image for the given Images. ImageFiles -// treated as non-imports in at least one of the given Images will -// be treated as non-imports in the returned Image. The first non-import -// version of a file will be used in the result. -// -// Reorders the ImageFiles to be in DAG order. -// Duplicates can exist across the Images, but only if duplicates are non-imports. -func MergeImages(images ...Image) (Image, error) { - switch len(images) { - case 0: - return nil, nil - case 1: - return images[0], nil - default: - var paths []string - imageFileSet := make(map[string]ImageFile) - for _, image := range images { - for _, currentImageFile := range image.Files() { - storedImageFile, ok := imageFileSet[currentImageFile.Path()] - if !ok { - imageFileSet[currentImageFile.Path()] = currentImageFile - paths = append(paths, currentImageFile.Path()) - continue - } - if !storedImageFile.IsImport() && !currentImageFile.IsImport() { - return nil, fmt.Errorf("%s is a non-import in multiple images", currentImageFile.Path()) - } - if storedImageFile.IsImport() && !currentImageFile.IsImport() { - imageFileSet[currentImageFile.Path()] = currentImageFile - } - } - } - // We need to preserve order for deterministic results, so we add - // the files in the order they're given, but base our selection - // on the imageFileSet. - imageFiles := make([]ImageFile, 0, len(imageFileSet)) - for _, path := range paths { - imageFiles = append(imageFiles, imageFileSet[path] /* Guaranteed to exist */) - } - return newImage(imageFiles, true) - } -} - -// NewImageForProto returns a new Image for the given proto Image. -// -// The input Files are expected to be in correct DAG order! -// TODO: Consider checking the above, and if not, reordering the Files. -// -// TODO: do we want to add the ability to do external path resolution here? -func NewImageForProto(protoImage *imagev1.Image, options ...NewImageForProtoOption) (Image, error) { - var newImageOptions newImageForProtoOptions - for _, option := range options { - option(&newImageOptions) - } - if newImageOptions.noReparse && newImageOptions.computeUnusedImports { - return nil, fmt.Errorf("cannot use both WithNoReparse and WithComputeUnusedImports options; they are mutually exclusive") - } - if !newImageOptions.noReparse { - if err := reparseImageProto(protoImage, newImageOptions.computeUnusedImports); err != nil { - return nil, err - } - } - if err := validateProtoImage(protoImage); err != nil { - return nil, err - } - imageFiles := make([]ImageFile, len(protoImage.File)) - for i, protoImageFile := range protoImage.File { - var isImport bool - var isSyntaxUnspecified bool - var unusedDependencyIndexes []int32 - var moduleIdentity bufmoduleref.ModuleIdentity - var commit string - var err error - if protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil { - isImport = protoImageFileExtension.GetIsImport() - isSyntaxUnspecified = protoImageFileExtension.GetIsSyntaxUnspecified() - unusedDependencyIndexes = protoImageFileExtension.GetUnusedDependency() - if protoModuleInfo := protoImageFileExtension.GetModuleInfo(); protoModuleInfo != nil { - if protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil { - moduleIdentity, err = bufmoduleref.NewModuleIdentity( - protoModuleName.GetRemote(), - protoModuleName.GetOwner(), - protoModuleName.GetRepository(), - ) - if err != nil { - return nil, err - } - // we only want to set this if there is a module name - commit = protoModuleInfo.GetCommit() - } - } - } - imageFile, err := NewImageFile( - protoImageFile, - moduleIdentity, - commit, - protoImageFile.GetName(), - isImport, - isSyntaxUnspecified, - unusedDependencyIndexes, - ) - if err != nil { - return nil, err - } - imageFiles[i] = imageFile - } - return NewImage(imageFiles) -} - -// NewImageForCodeGeneratorRequest returns a new Image from a given CodeGeneratorRequest. -// -// The input Files are expected to be in correct DAG order! -// TODO: Consider checking the above, and if not, reordering the Files. -func NewImageForCodeGeneratorRequest(request *pluginpb.CodeGeneratorRequest, options ...NewImageForProtoOption) (Image, error) { - if err := protodescriptor.ValidateCodeGeneratorRequestExceptFileDescriptorProtos(request); err != nil { - return nil, err - } - protoImageFiles := make([]*imagev1.ImageFile, len(request.GetProtoFile())) - for i, fileDescriptorProto := range request.GetProtoFile() { - // we filter whether something is an import or not in ImageWithOnlyPaths - // we cannot determine if the syntax was unset - protoImageFiles[i] = fileDescriptorProtoToProtoImageFile(fileDescriptorProto, false, false, nil, nil, "") - } - image, err := NewImageForProto( - &imagev1.Image{ - File: protoImageFiles, - }, - options..., - ) - if err != nil { - return nil, err - } - return ImageWithOnlyPaths( - image, - request.GetFileToGenerate(), - nil, - ) -} - -// NewImageForProtoOption is an option for use with NewImageForProto. -type NewImageForProtoOption func(*newImageForProtoOptions) - -// WithNoReparse instructs NewImageForProto to skip the reparse step. The reparse -// step is usually needed when unmarshalling the image from bytes. It reconstitutes -// custom options, from unrecognized bytes to known extension fields. -func WithNoReparse() NewImageForProtoOption { - return func(options *newImageForProtoOptions) { - options.noReparse = true - } -} - -// WithUnusedImportsComputation instructs NewImageForProto to compute unused imports -// for the files. These are usually computed by the compiler and stored in the image. -// But some sources of images may not include this information, so this option can be -// used to ensure that information is present in the image and accurate. -// -// This option is NOT compatible with WithNoReparse: the image must be re-parsed for -// there to be adequate information for computing unused imports. -func WithUnusedImportsComputation() NewImageForProtoOption { - return func(options *newImageForProtoOptions) { - options.computeUnusedImports = true - } -} - -// ImageWithoutImports returns a copy of the Image without imports. -// -// The backing Files are not copied. -func ImageWithoutImports(image Image) Image { - imageFiles := image.Files() - newImageFiles := make([]ImageFile, 0, len(imageFiles)) - for _, imageFile := range imageFiles { - if !imageFile.IsImport() { - newImageFiles = append(newImageFiles, imageFile) - } - } - return newImageNoValidate(newImageFiles) -} - -// ImageWithOnlyPaths returns a copy of the Image that only includes the files -// with the given root relative file paths or directories. -// -// Note that paths can be either files or directories - whether or not a path -// is included is a result of normalpath.EqualsOrContainsPath. -// -// If a root relative file path does not exist, this errors. -func ImageWithOnlyPaths( - image Image, - paths []string, - excludePaths []string, -) (Image, error) { - return imageWithOnlyPaths(image, paths, excludePaths, false) -} - -// ImageWithOnlyPathsAllowNotExist returns a copy of the Image that only includes the files -// with the given root relative file paths. -// -// Note that paths can be either files or directories - whether or not a path -// is included is a result of normalpath.EqualsOrContainsPath. -// -// If a root relative file path does not exist, this skips this path. -func ImageWithOnlyPathsAllowNotExist( - image Image, - paths []string, - excludePaths []string, -) (Image, error) { - return imageWithOnlyPaths(image, paths, excludePaths, true) -} - -// ImageByDir returns multiple images that have non-imports split -// by directory. -// -// That is, each Image will only contain a single directory's files -// as it's non-imports, along with all required imports for the -// files in that directory. -func ImageByDir(image Image) ([]Image, error) { - imageFiles := image.Files() - paths := make([]string, 0, len(imageFiles)) - for _, imageFile := range imageFiles { - if !imageFile.IsImport() { - paths = append(paths, imageFile.Path()) - } - } - dirToPaths := normalpath.ByDir(paths...) - // we need this to produce a deterministic order of the returned Images - dirs := make([]string, 0, len(dirToPaths)) - for dir := range dirToPaths { - dirs = append(dirs, dir) - } - sort.Strings(dirs) - newImages := make([]Image, 0, len(dirToPaths)) - for _, dir := range dirs { - paths, ok := dirToPaths[dir] - if !ok { - // this should never happen - return nil, fmt.Errorf("no dir for %q in dirToPaths", dir) - } - newImage, err := ImageWithOnlyPaths(image, paths, nil) - if err != nil { - return nil, err - } - newImages = append(newImages, newImage) - } - return newImages, nil -} - -// ImageToProtoImage returns a new ProtoImage for the Image. -func ImageToProtoImage(image Image) *imagev1.Image { - imageFiles := image.Files() - protoImage := &imagev1.Image{ - File: make([]*imagev1.ImageFile, len(imageFiles)), - } - for i, imageFile := range imageFiles { - protoImage.File[i] = imageFileToProtoImageFile(imageFile) - } - return protoImage -} - -// ImageToFileDescriptorSet returns a new FileDescriptorSet for the Image. -func ImageToFileDescriptorSet(image Image) *descriptorpb.FileDescriptorSet { - return protodescriptor.FileDescriptorSetForFileDescriptors(ImageToFileDescriptors(image)...) -} - -// ImageToFileDescriptors returns the FileDescriptors for the Image. -func ImageToFileDescriptors(image Image) []protodescriptor.FileDescriptor { - return imageFilesToFileDescriptors(image.Files()) -} - -// ImageToFileDescriptorProtos returns the FileDescriptorProtos for the Image. -func ImageToFileDescriptorProtos(image Image) []*descriptorpb.FileDescriptorProto { - return imageFilesToFileDescriptorProtos(image.Files()) -} - -// ImageToCodeGeneratorRequest returns a new CodeGeneratorRequest for the Image. -// -// All non-imports are added as files to generate. -// If includeImports is set, all non-well-known-type imports are also added as files to generate. -// If includeWellKnownTypes is set, well-known-type imports are also added as files to generate. -// includeWellKnownTypes has no effect if includeImports is not set. -func ImageToCodeGeneratorRequest( - image Image, - parameter string, - compilerVersion *pluginpb.Version, - includeImports bool, - includeWellKnownTypes bool, -) *pluginpb.CodeGeneratorRequest { - return imageToCodeGeneratorRequest( - image, - parameter, - compilerVersion, - includeImports, - includeWellKnownTypes, - nil, - nil, - ) -} - -// ImagesToCodeGeneratorRequests converts the Images to CodeGeneratorRequests. -// -// All non-imports are added as files to generate. -// If includeImports is set, all non-well-known-type imports are also added as files to generate. -// If includeImports is set, only one CodeGeneratorRequest will contain any given file as a FileToGenerate. -// If includeWellKnownTypes is set, well-known-type imports are also added as files to generate. -// includeWellKnownTypes has no effect if includeImports is not set. -func ImagesToCodeGeneratorRequests( - images []Image, - parameter string, - compilerVersion *pluginpb.Version, - includeImports bool, - includeWellKnownTypes bool, -) []*pluginpb.CodeGeneratorRequest { - requests := make([]*pluginpb.CodeGeneratorRequest, len(images)) - // alreadyUsedPaths is a map of paths that have already been added to an image. - // - // We track this if includeImports is set, so that when we find an import, we can - // see if the import was already added to a CodeGeneratorRequest via another Image - // in the Image slice. If the import was already added, we do not add duplicates - // across CodeGeneratorRequests. - var alreadyUsedPaths map[string]struct{} - // nonImportPaths is a map of non-import paths. - // - // We track this if includeImports is set. If we find a non-import file in Image A - // and this file is an import in Image B, the file will have already been added to - // a CodeGeneratorRequest via Image A, so do not add the duplicate to any other - // CodeGeneratorRequest. - var nonImportPaths map[string]struct{} - if includeImports { - // We don't need to track these if includeImports is false, so we only populate - // the maps if includeImports is true. If includeImports is false, only non-imports - // will be added to each CodeGeneratorRequest, so figuring out whether or not - // we should add a given import to a given CodeGeneratorRequest is unnecessary. - // - // imageToCodeGeneratorRequest checks if these maps are nil before every access. - alreadyUsedPaths = make(map[string]struct{}) - nonImportPaths = make(map[string]struct{}) - for _, image := range images { - for _, imageFile := range image.Files() { - if !imageFile.IsImport() { - nonImportPaths[imageFile.Path()] = struct{}{} - } - } - } - } - for i, image := range images { - requests[i] = imageToCodeGeneratorRequest( - image, - parameter, - compilerVersion, - includeImports, - includeWellKnownTypes, - alreadyUsedPaths, - nonImportPaths, - ) - } - return requests -} - -// ProtoImageToFileDescriptors returns the FileDescriptors for the proto Image. -func ProtoImageToFileDescriptors(protoImage *imagev1.Image) []protodescriptor.FileDescriptor { - return protoImageFilesToFileDescriptors(protoImage.File) -} - -// ImageDependency is a dependency of an image. -// -// This could conceivably be part of ImageFile or bufmoduleref.FileInfo. -// For ImageFile, this would be a field that is ignored when translated to proto, -// and is calculated on creation from proto. IsImport would become ImportType. -// You could go a step further and make this optionally part of the proto definition. -// -// You could even go down to bufmoduleref.FileInfo if you used the AST, but this -// could be error prone. -// -// However, for simplicity now (and to not rewrite the whole codebase), we make -// this a separate type that is calculated off of an Image after the fact. -// -// If this became part of ImageFile or bufmoduleref.FileInfo, you would get -// all the ImageDependencies from the ImageFiles, and then sort | uniq them -// to get the ImageDependencies for an Image. This would remove the requirement -// of this associated type to have a ModuleIdentity and commit, so in -// the IsDirect example below, d.proto would not be "ignored" - it would -// be an ImageFile like any other, with ImportType DIRECT. -// -// Note that if we ever do this, there is validation in newImage that enforces -// that all ImageFiles with the same ModuleIdentity have the same commit. This -// validation will likely have to be moved around. -type ImageModuleDependency interface { - // String() returns remote/owner/repository[:commit]. - fmt.Stringer - - // Required. Will never be nil. - ModuleIdentity() bufmoduleref.ModuleIdentity - // Optional. May be empty. - Commit() string - - // IsDirect returns true if the dependency is a direct dependency. - // - // A dependency is direct if it is only an import of non-imports in the image. - // - // Example: - // - // a.proto, module buf.build/foo/a, is non-import, imports b.proto - // b.proto, module buf.build/foo/b, is import, imports c.proto - // c.proto, module buf.build/foo/c, is import - // - // In this case, the list would contain only buf.build/foo/b, as buf.build/foo/a - // for a.proto is a non-import, and buf.build/foo/c for c.proto is only imported - // by an import - IsDirect() bool - - isImageModuleDependency() -} - -// ImageModuleDependency returns all ImageModuleDependencies for the Image. -// -// Does not return any ImageModuleDependencies for non-imports, that is the -// ModuleIdentities and commits represented by non-imports are not represented -// in this list. -func ImageModuleDependencies(image Image) []ImageModuleDependency { - importsOfNonImports := make(map[string]struct{}) - for _, imageFile := range image.Files() { - if !imageFile.IsImport() { - for _, dependency := range imageFile.FileDescriptor().GetDependency() { - importsOfNonImports[dependency] = struct{}{} - } - } - } - // We know that all ImageFiles with the same ModuleIdentity - // have the same commit or no commit, so using String() will properly identify - // unique dependencies. - stringToImageModuleDependency := make(map[string]ImageModuleDependency) - for _, imageFile := range image.Files() { - if imageFile.IsImport() { - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - _, isDirect := importsOfNonImports[imageFile.Path()] - imageModuleDependency := newImageModuleDependency( - moduleIdentity, - imageFile.Commit(), - isDirect, - ) - stringToImageModuleDependency[imageModuleDependency.String()] = imageModuleDependency - } - } - } - imageModuleDependencies := make([]ImageModuleDependency, 0, len(stringToImageModuleDependency)) - for _, imageModuleDependency := range stringToImageModuleDependency { - imageModuleDependencies = append( - imageModuleDependencies, - imageModuleDependency, - ) - } - sortImageModuleDependencies(imageModuleDependencies) - return imageModuleDependencies -} - -type newImageForProtoOptions struct { - noReparse bool - computeUnusedImports bool -} - -func reparseImageProto(protoImage *imagev1.Image, computeUnusedImports bool) error { - // TODO right now, NewResolver sets AllowUnresolvable to true all the time - // we want to make this into a check, and we verify if we need this for the individual command - resolver := protoencoding.NewLazyResolver( - ProtoImageToFileDescriptors( - protoImage, - )..., - ) - if err := protoencoding.ReparseUnrecognized(resolver, protoImage.ProtoReflect()); err != nil { - return fmt.Errorf("could not reparse image: %v", err) - } - if computeUnusedImports { - tracker := &importTracker{ - resolver: resolver, - used: map[string]map[string]struct{}{}, - } - tracker.findUsedImports(protoImage) - // Now we can populated list of unused dependencies - for _, file := range protoImage.File { - bufExt := file.BufExtension - if bufExt == nil { - bufExt = &imagev1.ImageFileExtension{} - file.BufExtension = bufExt - } - bufExt.UnusedDependency = nil // reset - usedImports := tracker.used[file.GetName()] - for i, dep := range file.Dependency { - if _, ok := usedImports[dep]; !ok { - // it's fine if it's public - isPublic := false - for _, publicDepIndex := range file.PublicDependency { - if i == int(publicDepIndex) { - isPublic = true - break - } - } - if !isPublic { - bufExt.UnusedDependency = append(bufExt.UnusedDependency, int32(i)) - } - } - } - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/bufimagebuild.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/bufimagebuild.go deleted file mode 100644 index 1d4ceb882a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/bufimagebuild.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagebuild - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "go.uber.org/zap" -) - -// Builder builds Protobuf files into Images. -type Builder interface { - // Build runs compilation. - // - // The FileRefs are assumed to have been created by a FileRefProvider, that is - // they are unique relative to the roots. - // - // If an error is returned, it is a system error. - // Only one of Image and FileAnnotations will be returned. - // - // FileAnnotations will use external file paths. - Build( - ctx context.Context, - module bufmodule.Module, - options ...BuildOption, - ) (bufimage.Image, []bufanalysis.FileAnnotation, error) -} - -// NewBuilder returns a new Builder. -func NewBuilder(logger *zap.Logger, moduleReader bufmodule.ModuleReader) Builder { - return newBuilder(logger, moduleReader) -} - -// BuildOption is an option for Build. -type BuildOption func(*buildOptions) - -// WithExcludeSourceCodeInfo returns a BuildOption that excludes sourceCodeInfo. -func WithExcludeSourceCodeInfo() BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.excludeSourceCodeInfo = true - } -} - -// WithExpectedDirectDependencies sets the module dependencies that are expected, usually because -// they are in a configuration file (buf.yaml). If the build detects that there are direct dependencies -// outside of this list, a warning will be printed. -func WithExpectedDirectDependencies(expectedDirectDependencies []bufmoduleref.ModuleReference) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.expectedDirectDependencies = expectedDirectDependencies - } -} - -// WithWorkspace sets the workspace to be read from instead of ModuleReader, and to not warn imports for. -// -// TODO: this can probably be dealt with by finding out if an ImageFile has a commit -// or not, although that is hacky, that's an implementation detail in practice, but perhaps -// we could justify it - transitive dependencies without commits don't make sense? -// -// TODO: shouldn't buf.yamls in workspaces have deps properly declared in them anyways? Why not warn? -func WithWorkspace(workspace bufmodule.Workspace) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.workspace = workspace - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/builder.go deleted file mode 100644 index 684bf3a3bb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/builder.go +++ /dev/null @@ -1,649 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagebuild - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/data/datawkt" - "github.com/bufbuild/buf/private/pkg/thread" - "github.com/bufbuild/protocompile" - "github.com/bufbuild/protocompile/linker" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/protoutil" - "github.com/bufbuild/protocompile/reporter" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" - "google.golang.org/protobuf/reflect/protoreflect" -) - -const ( - loggerName = "bufimagebuild" - tracerName = "bufbuild/buf" -) - -type builder struct { - logger *zap.Logger - moduleFileSetBuilder bufmodulebuild.ModuleFileSetBuilder - tracer trace.Tracer -} - -func newBuilder(logger *zap.Logger, moduleReader bufmodule.ModuleReader) *builder { - return &builder{ - logger: logger.Named(loggerName), - moduleFileSetBuilder: bufmodulebuild.NewModuleFileSetBuilder( - logger, - moduleReader, - ), - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func (b *builder) Build( - ctx context.Context, - module bufmodule.Module, - options ...BuildOption, -) (bufimage.Image, []bufanalysis.FileAnnotation, error) { - buildOptions := newBuildOptions() - for _, option := range options { - option(buildOptions) - } - return b.build( - ctx, - module, - buildOptions.excludeSourceCodeInfo, - buildOptions.expectedDirectDependencies, - buildOptions.workspace, - ) -} - -func (b *builder) build( - ctx context.Context, - module bufmodule.Module, - excludeSourceCodeInfo bool, - expectedDirectDeps []bufmoduleref.ModuleReference, - workspace bufmodule.Workspace, -) (_ bufimage.Image, _ []bufanalysis.FileAnnotation, retErr error) { - ctx, span := b.tracer.Start(ctx, "build") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - - // TODO: remove this once bufmodule.ModuleFileSet is deleted or no longer inherits from Module - // We still need to handle the ModuleFileSet case for buf export, as we actually need the - // ModuleFileSet there. - moduleFileSet, ok := module.(bufmodule.ModuleFileSet) - if !ok { - // If we just had a Module, convert it to a ModuleFileSet. - var err error - moduleFileSet, err = b.moduleFileSetBuilder.Build( - ctx, - module, - bufmodulebuild.WithWorkspace(workspace), - ) - if err != nil { - return nil, nil, err - } - } - - parserAccessorHandler := bufmoduleprotocompile.NewParserAccessorHandler(ctx, moduleFileSet) - targetFileInfos, err := moduleFileSet.TargetFileInfos(ctx) - if err != nil { - return nil, nil, err - } - if len(targetFileInfos) == 0 { - return nil, nil, errors.New("no input files specified") - } - paths := make([]string, len(targetFileInfos)) - for i, targetFileInfo := range targetFileInfos { - paths[i] = targetFileInfo.Path() - } - - buildResult := getBuildResult( - ctx, - parserAccessorHandler, - paths, - excludeSourceCodeInfo, - ) - if buildResult.Err != nil { - return nil, nil, buildResult.Err - } - if len(buildResult.FileAnnotations) > 0 { - return nil, bufanalysis.DeduplicateAndSortFileAnnotations(buildResult.FileAnnotations), nil - } - - fileDescriptors, err := checkAndSortFileDescriptors(buildResult.FileDescriptors, paths) - if err != nil { - return nil, nil, err - } - image, err := getImage( - ctx, - excludeSourceCodeInfo, - fileDescriptors, - parserAccessorHandler, - buildResult.SyntaxUnspecifiedFilenames, - buildResult.FilenameToUnusedDependencyFilenames, - b.tracer, - ) - if err != nil { - return nil, nil, err - } - if err := b.warnInvalidImports(ctx, image, expectedDirectDeps, workspace); err != nil { - b.logger.Error("warn_invalid_imports", zap.Error(err)) - } - return image, nil, nil -} - -// warnInvalidImports checks that all the target image files have valid imports statements that -// point to files in the local module, in a direct dependency, or in a workspace local unnamed -// module. It outputs WARN messages otherwise, one per invalid import statement. -// -// TODO: Understand this code before doing anything -// TODO: switch to use bufimage.ImageModuleDependencies -func (b *builder) warnInvalidImports( - ctx context.Context, - builtImage bufimage.Image, - expectedDirectDeps []bufmoduleref.ModuleReference, - localWorkspace bufmodule.Workspace, -) error { - if expectedDirectDeps == nil && localWorkspace == nil { - // Bail out early in case the caller didn't send explicitly send direct module dependencies nor - // workspace. TODO: We should always send direct deps, so this imports warning can always - // happen. - return nil - } - expectedDirectDepsIdentities := make(map[string]struct{}, len(expectedDirectDeps)) - for _, expectedDirectDep := range expectedDirectDeps { - expectedDirectDepsIdentities[expectedDirectDep.IdentityString()] = struct{}{} - } - workspaceIdentities := make(map[string]struct{}) - if localWorkspace != nil { - wsModules := localWorkspace.GetModules() - for _, mod := range wsModules { - if mod == nil { - b.logger.Debug("nil_module_in_workspace") - continue - } - targetFiles, err := mod.TargetFileInfos(ctx) - if err != nil { - return fmt.Errorf("workspace module target file infos: %w", err) - } - for _, file := range targetFiles { - if file.ModuleIdentity() != nil { - workspaceIdentities[file.ModuleIdentity().IdentityString()] = struct{}{} - break - } - } - } - } - b.logger.Debug( - "module_identities", - zap.Any("from_direct_dependencies", expectedDirectDepsIdentities), - zap.Any("from_workspace", workspaceIdentities), - ) - - // categorize image files into direct vs transitive dependencies - allImgFiles := make(map[string]map[string][]string) // for logging purposes only, modIdentity:filepath:imports - targetFiles := make(map[string]struct{}) // filepath - expectedDirectDepsFilesToModule := make(map[string]string) // filepath:modIdentity - workspaceFilesToModule := make(map[string]string) // filepath:modIdentity - transitiveDepsFilesToModule := make(map[string]string) // filepath:modIdentity - for _, file := range builtImage.Files() { - { // populate allImgFiles - modIdentity := "local" - if file.ModuleIdentity() != nil { - modIdentity = file.ModuleIdentity().IdentityString() - } - if _, ok := allImgFiles[modIdentity]; !ok { - allImgFiles[modIdentity] = make(map[string][]string) - } - allImgFiles[modIdentity][file.Path()] = file.FileDescriptor().GetDependency() - } - if !file.IsImport() { - targetFiles[file.Path()] = struct{}{} - continue - } - if file.ModuleIdentity() == nil { - workspaceFilesToModule[file.Path()] = "" // local workspace unnamed module - continue - } - // file is import and comes from a named module. It's either a direct dep, a workspace module, - // or a transitive dep. - modIdentity := file.ModuleIdentity().IdentityString() - if _, ok := expectedDirectDepsIdentities[modIdentity]; ok { - expectedDirectDepsFilesToModule[file.Path()] = modIdentity - } else if _, ok := workspaceIdentities[modIdentity]; ok { - workspaceFilesToModule[file.Path()] = modIdentity - } else { - transitiveDepsFilesToModule[file.Path()] = modIdentity - } - } - b.logger.Debug( - "image_files", - zap.Any("all_with_imports", allImgFiles), - zap.Any("local_target", targetFiles), - zap.Any("from_workspace", workspaceFilesToModule), - zap.Any("from_expected_direct_dependencies", expectedDirectDepsFilesToModule), - zap.Any("from_transitive_dependencies", transitiveDepsFilesToModule), - ) - - // validate import statements of target files against dependencies categorization above - for _, file := range builtImage.Files() { - if file.IsImport() { - continue // only check import statements in local files - } - // .GetDependency() returns an array of file path imports in the file descriptor - for _, importFilePath := range file.FileDescriptor().GetDependency() { - if _, ok := targetFiles[importFilePath]; ok { - continue // import comes from local - } - if _, ok := expectedDirectDepsFilesToModule[importFilePath]; ok { - continue // import comes from direct dep - } - if datawkt.Exists(importFilePath) { - continue // wkt files are shipped with protoc, and we ship them in datawkt, so it's always safe to import them - } - warnMsg := fmt.Sprintf( - "File %q imports %q, which is not found in your local files or direct dependencies", - file.Path(), importFilePath, - ) - if workspaceModule, ok := workspaceFilesToModule[importFilePath]; ok { - if workspaceModule == "" { - // If dependency comes from an unnamed module, that is probably a local dependency, and - // that module won't be pushed to the BSR. We can skip this warning. - continue - } - // If dependency comes from a named module, we _could_ skip this warning as it _might_ - // fail when pushing trying to build, but we better keep it in case it is a transitive - // dependency too, and both direct and transitive dependencies live in the same workspace. - warnMsg += fmt.Sprintf( - ", but is found in local workspace module %q. Declare dependency %q in the deps key in buf.yaml.", - workspaceModule, - workspaceModule, - ) - } else if transitiveDepModule, ok := transitiveDepsFilesToModule[importFilePath]; ok { - warnMsg += fmt.Sprintf( - ", but is found in the transitive dependency %q. Declare dependency %q in the deps key in buf.yaml.", - transitiveDepModule, - transitiveDepModule, - ) - } else { - warnMsg += ", or any of your workspace modules or transitive dependencies. Check that external imports are declared as dependencies in the deps key in buf.yaml." - } - b.logger.Warn(warnMsg) - } - } - return nil -} - -func getBuildResult( - ctx context.Context, - parserAccessorHandler bufmoduleprotocompile.ParserAccessorHandler, - paths []string, - excludeSourceCodeInfo bool, -) *buildResult { - var errorsWithPos []reporter.ErrorWithPos - var warningErrorsWithPos []reporter.ErrorWithPos - sourceInfoMode := protocompile.SourceInfoStandard - if excludeSourceCodeInfo { - sourceInfoMode = protocompile.SourceInfoNone - } - compiler := protocompile.Compiler{ - MaxParallelism: thread.Parallelism(), - SourceInfoMode: sourceInfoMode, - Resolver: &protocompile.SourceResolver{Accessor: parserAccessorHandler.Open}, - Reporter: reporter.NewReporter( - func(errorWithPos reporter.ErrorWithPos) error { - errorsWithPos = append(errorsWithPos, errorWithPos) - return nil - }, - func(errorWithPos reporter.ErrorWithPos) { - warningErrorsWithPos = append(warningErrorsWithPos, errorWithPos) - }, - ), - } - // fileDescriptors are in the same order as paths per the documentation - compiledFiles, err := compiler.Compile(ctx, paths...) - if err != nil { - if err == reporter.ErrInvalidSource { - if len(errorsWithPos) == 0 { - return newBuildResult( - nil, - nil, - nil, - nil, - errors.New("got invalid source error from parse but no errors reported"), - ) - } - fileAnnotations, err := bufmoduleprotocompile.GetFileAnnotations( - ctx, - parserAccessorHandler, - errorsWithPos, - ) - if err != nil { - return newBuildResult(nil, nil, nil, nil, err) - } - return newBuildResult(nil, nil, nil, fileAnnotations, nil) - } - if errorWithPos, ok := err.(reporter.ErrorWithPos); ok { - fileAnnotations, err := bufmoduleprotocompile.GetFileAnnotations( - ctx, - parserAccessorHandler, - []reporter.ErrorWithPos{errorWithPos}, - ) - if err != nil { - return newBuildResult(nil, nil, nil, nil, err) - } - return newBuildResult(nil, nil, nil, fileAnnotations, nil) - } - return newBuildResult(nil, nil, nil, nil, err) - } else if len(errorsWithPos) > 0 { - // https://github.com/jhump/protoreflect/pull/331 - return newBuildResult( - nil, - nil, - nil, - nil, - errors.New("got no error from parse but errors reported"), - ) - } - if len(compiledFiles) != len(paths) { - return newBuildResult( - nil, - nil, - nil, - nil, - fmt.Errorf("expected FileDescriptors to be of length %d but was %d", len(paths), len(compiledFiles)), - ) - } - for i, fileDescriptor := range compiledFiles { - path := paths[i] - filename := fileDescriptor.Path() - // doing another rough verification - // NO LONGER NEED TO DO SUFFIX SINCE WE KNOW THE ROOT FILE NAME - if path != filename { - return newBuildResult( - nil, - nil, - nil, - nil, - fmt.Errorf("expected fileDescriptor name %s to be a equal to %s", filename, path), - ) - } - } - syntaxUnspecifiedFilenames := make(map[string]struct{}) - filenameToUnusedDependencyFilenames := make(map[string]map[string]struct{}) - for _, warningErrorWithPos := range warningErrorsWithPos { - maybeAddSyntaxUnspecified(syntaxUnspecifiedFilenames, warningErrorWithPos) - maybeAddUnusedImport(filenameToUnusedDependencyFilenames, warningErrorWithPos) - } - fileDescriptors := make([]protoreflect.FileDescriptor, len(compiledFiles)) - for i := range compiledFiles { - fileDescriptors[i] = compiledFiles[i] - } - return newBuildResult( - fileDescriptors, - syntaxUnspecifiedFilenames, - filenameToUnusedDependencyFilenames, - nil, - nil, - ) -} - -// We need to sort the FileDescriptors as they may/probably are out of order -// relative to input order after concurrent builds. This mimics the output -// order of protoc. -func checkAndSortFileDescriptors( - fileDescriptors []protoreflect.FileDescriptor, - rootRelFilePaths []string, -) ([]protoreflect.FileDescriptor, error) { - if len(fileDescriptors) != len(rootRelFilePaths) { - return nil, fmt.Errorf("rootRelFilePath length was %d but FileDescriptor length was %d", len(rootRelFilePaths), len(fileDescriptors)) - } - nameToFileDescriptor := make(map[string]protoreflect.FileDescriptor, len(fileDescriptors)) - for _, fileDescriptor := range fileDescriptors { - name := fileDescriptor.Path() - if name == "" { - return nil, errors.New("no name on FileDescriptor") - } - if _, ok := nameToFileDescriptor[name]; ok { - return nil, fmt.Errorf("duplicate FileDescriptor: %s", name) - } - nameToFileDescriptor[name] = fileDescriptor - } - // We now know that all FileDescriptors had unique names and the number of FileDescriptors - // is equal to the number of rootRelFilePaths. We also verified earlier that rootRelFilePaths - // has only unique values. Now we can put them in order. - sortedFileDescriptors := make([]protoreflect.FileDescriptor, 0, len(fileDescriptors)) - for _, rootRelFilePath := range rootRelFilePaths { - fileDescriptor, ok := nameToFileDescriptor[rootRelFilePath] - if !ok { - return nil, fmt.Errorf("no FileDescriptor for rootRelFilePath: %q", rootRelFilePath) - } - sortedFileDescriptors = append(sortedFileDescriptors, fileDescriptor) - } - return sortedFileDescriptors, nil -} - -// getImage gets the Image for the protoreflect.FileDescriptors. -// -// This mimics protoc's output order. -// This assumes checkAndSortFileDescriptors was called. -func getImage( - ctx context.Context, - excludeSourceCodeInfo bool, - sortedFileDescriptors []protoreflect.FileDescriptor, - parserAccessorHandler bufmoduleprotocompile.ParserAccessorHandler, - syntaxUnspecifiedFilenames map[string]struct{}, - filenameToUnusedDependencyFilenames map[string]map[string]struct{}, - tracer trace.Tracer, -) (bufimage.Image, error) { - ctx, span := tracer.Start(ctx, "get_image") - defer span.End() - - // if we aren't including imports, then we need a set of file names that - // are included so we can create a topologically sorted list w/out - // including imports that should not be present. - // - // if we are including imports, then we need to know what filenames - // are imports are what filenames are not - // all input protoreflect.FileDescriptors are not imports, we derive the imports - // from GetDependencies. - nonImportFilenames := map[string]struct{}{} - for _, fileDescriptor := range sortedFileDescriptors { - nonImportFilenames[fileDescriptor.Path()] = struct{}{} - } - - var imageFiles []bufimage.ImageFile - var err error - alreadySeen := map[string]struct{}{} - for _, fileDescriptor := range sortedFileDescriptors { - imageFiles, err = getImageFilesRec( - ctx, - excludeSourceCodeInfo, - fileDescriptor, - parserAccessorHandler, - syntaxUnspecifiedFilenames, - filenameToUnusedDependencyFilenames, - alreadySeen, - nonImportFilenames, - imageFiles, - ) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return nil, err - } - } - image, err := bufimage.NewImage(imageFiles) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - } - return image, err -} - -func getImageFilesRec( - ctx context.Context, - excludeSourceCodeInfo bool, - fileDescriptor protoreflect.FileDescriptor, - parserAccessorHandler bufmoduleprotocompile.ParserAccessorHandler, - syntaxUnspecifiedFilenames map[string]struct{}, - filenameToUnusedDependencyFilenames map[string]map[string]struct{}, - alreadySeen map[string]struct{}, - nonImportFilenames map[string]struct{}, - imageFiles []bufimage.ImageFile, -) ([]bufimage.ImageFile, error) { - if fileDescriptor == nil { - return nil, errors.New("nil FileDescriptor") - } - path := fileDescriptor.Path() - if _, ok := alreadySeen[path]; ok { - return imageFiles, nil - } - alreadySeen[path] = struct{}{} - - unusedDependencyFilenames, ok := filenameToUnusedDependencyFilenames[path] - var unusedDependencyIndexes []int32 - if ok { - unusedDependencyIndexes = make([]int32, 0, len(unusedDependencyFilenames)) - } - var err error - for i := 0; i < fileDescriptor.Imports().Len(); i++ { - dependency := fileDescriptor.Imports().Get(i).FileDescriptor - if unusedDependencyFilenames != nil { - if _, ok := unusedDependencyFilenames[dependency.Path()]; ok { - unusedDependencyIndexes = append( - unusedDependencyIndexes, - int32(i), - ) - } - } - imageFiles, err = getImageFilesRec( - ctx, - excludeSourceCodeInfo, - dependency, - parserAccessorHandler, - syntaxUnspecifiedFilenames, - filenameToUnusedDependencyFilenames, - alreadySeen, - nonImportFilenames, - imageFiles, - ) - if err != nil { - return nil, err - } - } - - fileDescriptorProto := protoutil.ProtoFromFileDescriptor(fileDescriptor) - if fileDescriptorProto == nil { - return nil, errors.New("nil FileDescriptorProto") - } - if excludeSourceCodeInfo { - // need to do this anyways as Parser does not respect this for FileDescriptorProtos - fileDescriptorProto.SourceCodeInfo = nil - } - _, isNotImport := nonImportFilenames[path] - _, syntaxUnspecified := syntaxUnspecifiedFilenames[path] - imageFile, err := bufimage.NewImageFile( - fileDescriptorProto, - parserAccessorHandler.ModuleIdentity(path), - parserAccessorHandler.Commit(path), - // if empty, defaults to path - parserAccessorHandler.ExternalPath(path), - !isNotImport, - syntaxUnspecified, - unusedDependencyIndexes, - ) - if err != nil { - return nil, err - } - return append(imageFiles, imageFile), nil -} - -func maybeAddSyntaxUnspecified( - syntaxUnspecifiedFilenames map[string]struct{}, - errorWithPos reporter.ErrorWithPos, -) { - if errorWithPos.Unwrap() != parser.ErrNoSyntax { - return - } - syntaxUnspecifiedFilenames[errorWithPos.GetPosition().Filename] = struct{}{} -} - -func maybeAddUnusedImport( - filenameToUnusedImportFilenames map[string]map[string]struct{}, - errorWithPos reporter.ErrorWithPos, -) { - errorUnusedImport, ok := errorWithPos.Unwrap().(linker.ErrorUnusedImport) - if !ok { - return - } - pos := errorWithPos.GetPosition() - unusedImportFilenames, ok := filenameToUnusedImportFilenames[pos.Filename] - if !ok { - unusedImportFilenames = make(map[string]struct{}) - filenameToUnusedImportFilenames[pos.Filename] = unusedImportFilenames - } - unusedImportFilenames[errorUnusedImport.UnusedImport()] = struct{}{} -} - -type buildResult struct { - FileDescriptors []protoreflect.FileDescriptor - SyntaxUnspecifiedFilenames map[string]struct{} - FilenameToUnusedDependencyFilenames map[string]map[string]struct{} - FileAnnotations []bufanalysis.FileAnnotation - Err error -} - -func newBuildResult( - fileDescriptors []protoreflect.FileDescriptor, - syntaxUnspecifiedFilenames map[string]struct{}, - filenameToUnusedDependencyFilenames map[string]map[string]struct{}, - fileAnnotations []bufanalysis.FileAnnotation, - err error, -) *buildResult { - return &buildResult{ - FileDescriptors: fileDescriptors, - SyntaxUnspecifiedFilenames: syntaxUnspecifiedFilenames, - FilenameToUnusedDependencyFilenames: filenameToUnusedDependencyFilenames, - FileAnnotations: fileAnnotations, - Err: err, - } -} - -type buildOptions struct { - excludeSourceCodeInfo bool - expectedDirectDependencies []bufmoduleref.ModuleReference - workspace bufmodule.Workspace -} - -func newBuildOptions() *buildOptions { - return &buildOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/usage.gen.go deleted file mode 100644 index f940d582e2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagebuild/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufimagebuild - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/bufimagemodify.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/bufimagemodify.go deleted file mode 100644 index 1677394a97..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/bufimagemodify.go +++ /dev/null @@ -1,349 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "fmt" - "path" - "strconv" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/data/datawkt" - "github.com/bufbuild/buf/private/pkg/protoversion" - "go.uber.org/zap" - "google.golang.org/protobuf/types/descriptorpb" -) - -// Modifier modifies Images. -type Modifier interface { - // Modify modifies the Image. - Modify(context.Context, bufimage.Image) error -} - -// NewMultiModifier returns a new Modifier for the given Modifiers. -func NewMultiModifier(modifiers ...Modifier) Modifier { - switch len(modifiers) { - case 0: - return nil - case 1: - return modifiers[0] - default: - return newMultiModifier(modifiers) - } -} - -// ModifierFunc is a convenience type that implements the Modifier interface. -type ModifierFunc func(context.Context, bufimage.Image) error - -// Modify invokes the ModifierFunc with the given context and image. -func (m ModifierFunc) Modify(ctx context.Context, image bufimage.Image) error { - return m(ctx, image) -} - -// Sweeper is used to mark-and-sweep SourceCodeInfo_Locations from images. -type Sweeper interface { - // Sweep implements the ModifierFunc signature so that the Sweeper - // can be used as a Modifier. - Sweep(context.Context, bufimage.Image) error - - // mark is un-exported so that the Sweeper cannot be implemented - // outside of this package. - mark(string, []int32) -} - -// NewFileOptionSweeper constructs a new file option Sweeper that removes -// the SourceCodeInfo_Locations associated with the marks. -func NewFileOptionSweeper() Sweeper { - return newFileOptionSweeper() -} - -// Merge merges the given modifiers together so that they are run in the order -// they are provided. This is particularly useful for constructing a modifier -// from its initial 'nil' value. -// -// var modifier Modifier -// if config.JavaMultipleFiles { -// modifier = Merge(modifier, JavaMultipleFiles) -// } -func Merge(left Modifier, right Modifier) Modifier { - if left == nil { - return right - } - if right == nil { - return left - } - return NewMultiModifier(left, right) -} - -// CcEnableArenas returns a Modifier that sets the cc_enable_arenas -// file option to the given value in all of the files contained in -// the Image. -func CcEnableArenas( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]string, -) (Modifier, error) { - validatedOverrides, err := stringOverridesToBoolOverrides(overrides) - if err != nil { - return nil, fmt.Errorf("invalid override for %s: %w", CcEnableArenasID, err) - } - return ccEnableArenas(logger, sweeper, value, validatedOverrides), nil -} - -// GoPackage returns a Modifier that sets the go_package file option -// according to the given defaultImportPathPrefix, exceptions, and -// overrides. -func GoPackage( - logger *zap.Logger, - sweeper Sweeper, - defaultImportPathPrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) (Modifier, error) { - return goPackage( - logger, - sweeper, - defaultImportPathPrefix, - except, - moduleOverrides, - overrides, - ) -} - -// JavaMultipleFiles returns a Modifier that sets the java_multiple_files -// file option to the given value in all of the files contained in -// the Image. If the preserveExistingValue is set to true, then the -// java_multiple_files option will be preserved if set. -func JavaMultipleFiles( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]string, - preserveExistingValue bool, -) (Modifier, error) { - validatedOverrides, err := stringOverridesToBoolOverrides(overrides) - if err != nil { - return nil, fmt.Errorf("invalid override for %s: %w", JavaMultipleFilesID, err) - } - return javaMultipleFiles(logger, sweeper, value, validatedOverrides, preserveExistingValue), nil -} - -// JavaOuterClassname returns a Modifier that sets the java_outer_classname file option -// in all of the files contained in the Image based on the PascalCase of their filename. -// If the preserveExistingValue is set to true, then the java_outer_classname option will -// be preserved if set. -func JavaOuterClassname( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, - preserveExistingValue bool, -) Modifier { - return javaOuterClassname(logger, sweeper, overrides, preserveExistingValue) -} - -// JavaPackage returns a Modifier that sets the java_package file option -// according to the given packagePrefix. -func JavaPackage( - logger *zap.Logger, - sweeper Sweeper, - defaultPrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) (Modifier, error) { - return javaPackage( - logger, - sweeper, - defaultPrefix, - except, - moduleOverrides, - overrides, - ) -} - -// JavaStringCheckUtf8 returns a Modifier that sets the java_string_check_utf8 file option according -// to the given value. -func JavaStringCheckUtf8( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]string, -) (Modifier, error) { - validatedOverrides, err := stringOverridesToBoolOverrides(overrides) - if err != nil { - return nil, fmt.Errorf("invalid override for %s: %w", JavaStringCheckUtf8ID, err) - } - return javaStringCheckUtf8(logger, sweeper, value, validatedOverrides), nil -} - -// OptimizeFor returns a Modifier that sets the optimize_for file -// option to the given value in all of the files contained in -// the Image. -func OptimizeFor( - logger *zap.Logger, - sweeper Sweeper, - defaultOptimizeFor descriptorpb.FileOptions_OptimizeMode, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]descriptorpb.FileOptions_OptimizeMode, - overrides map[string]string, -) (Modifier, error) { - validatedOverrides, err := stringOverridesToOptimizeModeOverrides(overrides) - if err != nil { - return nil, fmt.Errorf("invalid override for %s: %w", OptimizeForID, err) - } - return optimizeFor(logger, sweeper, defaultOptimizeFor, except, moduleOverrides, validatedOverrides), nil -} - -// GoPackageImportPathForFile returns the go_package import path for the given -// ImageFile. If the package contains a version suffix, and if there are more -// than two components, concatenate the final two components. Otherwise, we -// exclude the ';' separator and adopt the default behavior from the import path. -// -// For example, an ImageFile with `package acme.weather.v1;` will include `;weatherv1` -// in the `go_package` declaration so that the generated package is named as such. -func GoPackageImportPathForFile(imageFile bufimage.ImageFile, importPathPrefix string) string { - goPackageImportPath := path.Join(importPathPrefix, path.Dir(imageFile.Path())) - packageName := imageFile.FileDescriptor().GetPackage() - if _, ok := protoversion.NewPackageVersionForPackage(packageName); ok { - parts := strings.Split(packageName, ".") - if len(parts) >= 2 { - goPackageImportPath += ";" + parts[len(parts)-2] + parts[len(parts)-1] - } - } - return goPackageImportPath -} - -// ObjcClassPrefix returns a Modifier that sets the objc_class_prefix file option -// according to the package name. It is set to the uppercase first letter of each package sub-name, -// not including the package version, with the following rules: -// - If the resulting abbreviation is 2 characters, add "X". -// - If the resulting abbreviation is 1 character, add "XX". -// - If the resulting abbreviation is "GPB", change it to "GPX". -// "GPB" is reserved by Google for the Protocol Buffers implementation. -func ObjcClassPrefix( - logger *zap.Logger, - sweeper Sweeper, - defaultPrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverride map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - return objcClassPrefix(logger, sweeper, defaultPrefix, except, moduleOverride, overrides) -} - -// CsharpNamespace returns a Modifier that sets the csharp_namespace file option -// according to the package name. It is set to the package name with each package sub-name capitalized. -func CsharpNamespace( - logger *zap.Logger, - sweeper Sweeper, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - return csharpNamespace( - logger, - sweeper, - except, - moduleOverrides, - overrides, - ) -} - -// PhpNamespace returns a Modifier that sets the php_namespace file option -// according to the package name. It is set to the package name with each package sub-name capitalized -// and each "." replaced with "\\". -func PhpNamespace( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, -) Modifier { - return phpNamespace(logger, sweeper, overrides) -} - -// PhpMetadataNamespace returns a Modifier that sets the php_metadata_namespace file option -// according to the package name. It appends "\\GPBMetadata" to the heuristic used by PhpNamespace. -func PhpMetadataNamespace( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, -) Modifier { - return phpMetadataNamespace(logger, sweeper, overrides) -} - -// RubyPackage returns a Modifier that sets the ruby_package file option -// according to the given packagePrefix. It is set to the package name with each package sub-name capitalized -// and each "." replaced with "::". -func RubyPackage( - logger *zap.Logger, - sweeper Sweeper, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - return rubyPackage( - logger, - sweeper, - except, - moduleOverrides, - overrides, - ) -} - -// isWellKnownType returns true if the given path is one of the well-known types. -func isWellKnownType(ctx context.Context, imageFile bufimage.ImageFile) bool { - return datawkt.Exists(imageFile.Path()) -} - -// int32SliceIsEqual returns true if x and y contain the same elements. -func int32SliceIsEqual(x []int32, y []int32) bool { - if len(x) != len(y) { - return false - } - for i, elem := range x { - if elem != y[i] { - return false - } - } - return true -} - -func stringOverridesToBoolOverrides(stringOverrides map[string]string) (map[string]bool, error) { - validatedOverrides := make(map[string]bool, len(stringOverrides)) - for fileImportPath, overrideString := range stringOverrides { - overrideBool, err := strconv.ParseBool(overrideString) - if err != nil { - return nil, fmt.Errorf("non-boolean override %s set for file %s", overrideString, fileImportPath) - } - validatedOverrides[fileImportPath] = overrideBool - } - return validatedOverrides, nil -} - -func stringOverridesToOptimizeModeOverrides(stringOverrides map[string]string) (map[string]descriptorpb.FileOptions_OptimizeMode, error) { - validatedOverrides := make(map[string]descriptorpb.FileOptions_OptimizeMode, len(stringOverrides)) - for fileImportPath, stringOverride := range stringOverrides { - optimizeMode, ok := descriptorpb.FileOptions_OptimizeMode_value[stringOverride] - if !ok { - return nil, fmt.Errorf("invalid optimize mode %s set for file %s", stringOverride, fileImportPath) - } - validatedOverrides[fileImportPath] = descriptorpb.FileOptions_OptimizeMode(optimizeMode) - } - return validatedOverrides, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/cc_enable_arenas.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/cc_enable_arenas.go deleted file mode 100644 index 1ceaa69238..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/cc_enable_arenas.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// CcEnableArenasID is the ID of the cc_enable_arenas modifier. -const CcEnableArenasID = "CC_ENABLE_ARENAS" - -// ccEnableArenas is the SourceCodeInfo path for the cc_enable_arenas option. -// https://github.com/protocolbuffers/protobuf/blob/29152fbc064921ca982d64a3a9eae1daa8f979bb/src/google/protobuf/descriptor.proto#L420 -var ccEnableArenasPath = []int32{8, 31} - -func ccEnableArenas( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]bool, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - modifierValue := value - if overrideValue, ok := overrides[imageFile.Path()]; ok { - modifierValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := ccEnableArenasForFile(ctx, sweeper, imageFile, modifierValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", CcEnableArenasID, overrideFile) - } - } - return nil - }, - ) -} - -func ccEnableArenasForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - value bool, -) error { - descriptor := imageFile.Proto() - options := descriptor.GetOptions() - switch { - case isWellKnownType(ctx, imageFile): - // The file is a well-known type, don't do anything. - return nil - case options != nil && options.GetCcEnableArenas() == value: - // The option is already set to the same value, don't do anything. - return nil - case options == nil && descriptorpb.Default_FileOptions_CcEnableArenas == value: - // The option is not set, but the value we want to set is the - // same as the default, don't do anything. - return nil - } - if options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.CcEnableArenas = proto.Bool(value) - if sweeper != nil { - sweeper.mark(imageFile.Path(), ccEnableArenasPath) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/csharp_namespace.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/csharp_namespace.go deleted file mode 100644 index 0af4dd23f1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/csharp_namespace.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// CsharpNamespaceID is the ID of the csharp_namespace modifier. -const CsharpNamespaceID = "CSHARP_NAMESPACE" - -// csharpNamespacePath is the SourceCodeInfo path for the csharp_namespace option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L428 -var csharpNamespacePath = []int32{8, 37} - -func csharpNamespace( - logger *zap.Logger, - sweeper Sweeper, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make(map[string]string, len(moduleOverrides)) - for moduleIdentity, csharpNamespace := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = csharpNamespace - } - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - csharpNamespaceValue := csharpNamespaceValue(imageFile) - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if moduleNamespaceOverride, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - csharpNamespaceValue = moduleNamespaceOverride - } - } - if overrideValue, ok := overrides[imageFile.Path()]; ok { - csharpNamespaceValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := csharpNamespaceForFile( - ctx, - sweeper, - imageFile, - csharpNamespaceValue, - exceptModuleIdentityStrings, - ); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("csharp_namespace_prefix override for %q was unused", moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", CsharpNamespaceID, overrideFile) - } - } - return nil - }, - ) -} - -func csharpNamespaceForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - csharpNamespaceValue string, - exceptModuleIdentityStrings map[string]struct{}, -) error { - if shouldSkipCsharpNamespaceForFile(ctx, imageFile, csharpNamespaceValue, exceptModuleIdentityStrings) { - // This is a well-known type or we could not resolve a non-empty csharp_namespace - // value, so this is a no-op. - return nil - } - descriptor := imageFile.Proto() - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.CsharpNamespace = proto.String(csharpNamespaceValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), csharpNamespacePath) - } - return nil -} - -func shouldSkipCsharpNamespaceForFile( - ctx context.Context, - imageFile bufimage.ImageFile, - csharpNamespaceValue string, - exceptModuleIdentityStrings map[string]struct{}, -) bool { - if isWellKnownType(ctx, imageFile) || csharpNamespaceValue == "" { - // This is a well-known type or we could not resolve a non-empty csharp_namespace - // value, so this is a no-op. - return true - } - - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return true - } - } - return false -} - -// csharpNamespaceValue returns the csharp_namespace for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func csharpNamespaceValue(imageFile bufimage.ImageFile) string { - pkg := imageFile.Proto().GetPackage() - if pkg == "" { - return "" - } - packageParts := strings.Split(pkg, ".") - for i, part := range packageParts { - packageParts[i] = stringutil.ToPascalCase(part) - } - return strings.Join(packageParts, ".") -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/file_option_sweeper.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/file_option_sweeper.go deleted file mode 100644 index 75eb2c7a3c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/file_option_sweeper.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "google.golang.org/protobuf/types/descriptorpb" -) - -// fileOptionPath is the path prefix used for FileOptions. -// All file option locations are preceded by a location -// with a path set to the fileOptionPath. -// https://github.com/protocolbuffers/protobuf/blob/053966b4959bdd21e4a24e657bcb97cb9de9e8a4/src/google/protobuf/descriptor.proto#L80 -var fileOptionPath = []int32{8} - -type fileOptionSweeper struct { - // Filepath -> SourceCodeInfo_Location.Path keys. - sourceCodeInfoPaths map[string]map[string]struct{} -} - -func newFileOptionSweeper() *fileOptionSweeper { - return &fileOptionSweeper{ - sourceCodeInfoPaths: make(map[string]map[string]struct{}), - } -} - -// mark is used to mark the given SourceCodeInfo_Location indices for -// deletion. This method should be called in each of the file option -// modifiers. -func (s *fileOptionSweeper) mark(imageFilePath string, path []int32) { - paths, ok := s.sourceCodeInfoPaths[imageFilePath] - if !ok { - paths = make(map[string]struct{}) - s.sourceCodeInfoPaths[imageFilePath] = paths - } - paths[getPathKey(path)] = struct{}{} -} - -// Sweep applies all of the marks and sweeps the file option SourceCodeInfo_Locations. -func (s *fileOptionSweeper) Sweep(ctx context.Context, image bufimage.Image) error { - for _, imageFile := range image.Files() { - descriptor := imageFile.Proto() - if descriptor.SourceCodeInfo == nil { - continue - } - paths, ok := s.sourceCodeInfoPaths[imageFile.Path()] - if !ok { - continue - } - // We can't just match on an exact path match because the target - // file option's parent path elements would remain (i.e [8]). - // Instead, we perform an initial pass to validate that the paths - // are structured as expect, and collect all of the indices that - // we need to delete. - indices := make(map[int]struct{}, len(paths)*2) - for i, location := range descriptor.SourceCodeInfo.Location { - if _, ok := paths[getPathKey(location.Path)]; !ok { - continue - } - if i == 0 { - return fmt.Errorf("path %v must have a preceding parent path", location.Path) - } - if !int32SliceIsEqual(descriptor.SourceCodeInfo.Location[i-1].Path, fileOptionPath) { - return fmt.Errorf("path %v must have a preceding parent path equal to %v", location.Path, fileOptionPath) - } - // Add the target path and its parent. - indices[i-1] = struct{}{} - indices[i] = struct{}{} - } - // Now that we know exactly which indices to exclude, we can - // filter the SourceCodeInfo_Locations as needed. - locations := make( - []*descriptorpb.SourceCodeInfo_Location, - 0, - len(descriptor.SourceCodeInfo.Location)-len(indices), - ) - for i, location := range descriptor.SourceCodeInfo.Location { - if _, ok := indices[i]; ok { - continue - } - locations = append(locations, location) - } - descriptor.SourceCodeInfo.Location = locations - } - return nil -} - -// getPathKey returns a unique key for the given path. -func getPathKey(path []int32) string { - key := make([]byte, len(path)*4) - j := 0 - for _, elem := range path { - key[j] = byte(elem) - key[j+1] = byte(elem >> 8) - key[j+2] = byte(elem >> 16) - key[j+3] = byte(elem >> 24) - j += 4 - } - return string(key) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/go_package.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/go_package.go deleted file mode 100644 index 21eb33272d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/go_package.go +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// GoPackageID is the ID of the go_package modifier. -const GoPackageID = "GO_PACKAGE" - -// goPackagePath is the SourceCodeInfo path for the go_package option. -// https://github.com/protocolbuffers/protobuf/blob/ee04809540c098718121e092107fbc0abc231725/src/google/protobuf/descriptor.proto#L392 -var goPackagePath = []int32{8, 11} - -func goPackage( - logger *zap.Logger, - sweeper Sweeper, - defaultImportPathPrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) (Modifier, error) { - if defaultImportPathPrefix == "" { - return nil, fmt.Errorf("a non-empty import path prefix is required") - } - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make(map[string]string, len(moduleOverrides)) - for moduleIdentity, goPackagePrefix := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = goPackagePrefix - } - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - for _, imageFile := range image.Files() { - importPathPrefix := defaultImportPathPrefix - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if modulePrefixOverride, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - importPathPrefix = modulePrefixOverride - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - } - } - goPackageValue := GoPackageImportPathForFile(imageFile, importPathPrefix) - if overrideValue, ok := overrides[imageFile.Path()]; ok { - goPackageValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := goPackageForFile( - ctx, - sweeper, - imageFile, - goPackageValue, - exceptModuleIdentityStrings, - ); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("go_package_prefix override for %q was unused", moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", GoPackageID, overrideFile) - } - } - return nil - }, - ), nil -} - -func goPackageForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - goPackageValue string, - exceptModuleIdentityStrings map[string]struct{}, -) error { - if shouldSkipGoPackageForFile(ctx, imageFile, exceptModuleIdentityStrings) { - return nil - } - descriptor := imageFile.Proto() - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.GoPackage = proto.String(goPackageValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), goPackagePath) - } - return nil -} - -func shouldSkipGoPackageForFile( - ctx context.Context, - imageFile bufimage.ImageFile, - exceptModuleIdentityStrings map[string]struct{}, -) bool { - if isWellKnownType(ctx, imageFile) && imageFile.Proto().GetOptions().GetGoPackage() != "" { - // The well-known type defines the go_package option, so this is a no-op. - // If a well-known type ever omits the go_package option, we make sure - // to include it. - return true - } - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return true - } - } - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_multiple_files.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_multiple_files.go deleted file mode 100644 index 738b7d2bbe..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_multiple_files.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // DefaultJavaMultipleFilesValue is the default value for the java_multiple_files modifier. - DefaultJavaMultipleFilesValue = true - - // JavaMultipleFilesID is the ID of the java_multiple_files modifier. - JavaMultipleFilesID = "JAVA_MULTIPLE_FILES" -) - -// javaMultipleFilesPath is the SourceCodeInfo path for the java_multiple_files option. -// https://github.com/protocolbuffers/protobuf/blob/ee04809540c098718121e092107fbc0abc231725/src/google/protobuf/descriptor.proto#L364 -var javaMultipleFilesPath = []int32{8, 10} - -func javaMultipleFiles( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]bool, - preserveExistingValue bool, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - modifierValue := value - if overrideValue, ok := overrides[imageFile.Path()]; ok { - modifierValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := javaMultipleFilesForFile(ctx, sweeper, imageFile, modifierValue, preserveExistingValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", JavaMultipleFilesID, overrideFile) - } - } - return nil - }, - ) -} - -func javaMultipleFilesForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - value bool, - preserveExistingValue bool, -) error { - descriptor := imageFile.Proto() - options := descriptor.GetOptions() - switch { - case isWellKnownType(ctx, imageFile): - // The file is a well-known type, don't do anything. - return nil - case options != nil: - if preserveExistingValue && options.JavaMultipleFiles != nil { - // This option is explicitly set to a value - preserve existing value. - return nil - } - if options.GetJavaMultipleFiles() == value { - // The option is already set to the same value, don't do anything. - return nil - } - case options == nil && descriptorpb.Default_FileOptions_JavaMultipleFiles == value: - // The option is not set, but the value we want to set is the - // same as the default, don't do anything. - return nil - } - if options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.JavaMultipleFiles = proto.Bool(value) - if sweeper != nil { - sweeper.mark(imageFile.Path(), javaMultipleFilesPath) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_outer_classname.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_outer_classname.go deleted file mode 100644 index d3e6817231..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_outer_classname.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// JavaOuterClassNameID is the ID for the java_outer_classname modifier. -const JavaOuterClassNameID = "JAVA_OUTER_CLASSNAME" - -// javaOuterClassnamePath is the SourceCodeInfo path for the java_outer_classname option. -// https://github.com/protocolbuffers/protobuf/blob/87d140f851131fb8a6e8a80449cf08e73e568259/src/google/protobuf/descriptor.proto#L356 -var javaOuterClassnamePath = []int32{8, 8} - -func javaOuterClassname( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, - preserveExistingValue bool, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - javaOuterClassnameValue := javaOuterClassnameValue(imageFile) - if overrideValue, ok := overrides[imageFile.Path()]; ok { - javaOuterClassnameValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := javaOuterClassnameForFile(ctx, sweeper, imageFile, javaOuterClassnameValue, preserveExistingValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", JavaOuterClassNameID, overrideFile) - } - } - return nil - }, - ) -} - -func javaOuterClassnameForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - javaOuterClassnameValue string, - preserveExistingValue bool, -) error { - if isWellKnownType(ctx, imageFile) { - // The file is a well-known type - don't override the value. - return nil - } - descriptor := imageFile.Proto() - options := descriptor.GetOptions() - if options != nil && options.JavaOuterClassname != nil && preserveExistingValue { - // The option is explicitly set in the file - don't override it if we want to preserve the existing value. - return nil - } - if options.GetJavaOuterClassname() == javaOuterClassnameValue { - // The file already defines the java_outer_classname option with the given value, so this is a no-op. - return nil - } - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.JavaOuterClassname = proto.String(javaOuterClassnameValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), javaOuterClassnamePath) - } - return nil -} - -func javaOuterClassnameValue(imageFile bufimage.ImageFile) string { - return stringutil.ToPascalCase(normalpath.Base(imageFile.Path())) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_package.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_package.go deleted file mode 100644 index 1a74bf91c6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_package.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // DefaultJavaPackagePrefix is the default java_package prefix used in the java_package modifier. - DefaultJavaPackagePrefix = "com" - - // JavaPackageID is the ID of the java_package modifier. - JavaPackageID = "JAVA_PACKAGE" -) - -// javaPackagePath is the SourceCodeInfo path for the java_package option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L348 -var javaPackagePath = []int32{8, 1} - -func javaPackage( - logger *zap.Logger, - sweeper Sweeper, - defaultPackagePrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) (Modifier, error) { - if defaultPackagePrefix == "" { - return nil, fmt.Errorf("a non-empty package prefix is required") - } - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make(map[string]string, len(moduleOverrides)) - for moduleIdentity, javaPackagePrefix := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = javaPackagePrefix - } - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - for _, imageFile := range image.Files() { - packagePrefix := defaultPackagePrefix - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if modulePrefixOverride, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - packagePrefix = modulePrefixOverride - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - } - } - javaPackageValue := javaPackageValue(imageFile, packagePrefix) - if overridePackagePrefix, ok := overrides[imageFile.Path()]; ok { - javaPackageValue = overridePackagePrefix - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := javaPackageForFile( - ctx, - sweeper, - imageFile, - javaPackageValue, - exceptModuleIdentityStrings, - ); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("java_package_prefix override for %q was unused", moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", JavaPackageID, overrideFile) - } - } - return nil - }, - ), nil -} - -func javaPackageForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - javaPackageValue string, - exceptModuleIdentityStrings map[string]struct{}, -) error { - if shouldSkipJavaPackageForFile(ctx, imageFile, javaPackageValue, exceptModuleIdentityStrings) { - return nil - } - descriptor := imageFile.Proto() - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.JavaPackage = proto.String(javaPackageValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), javaPackagePath) - } - return nil -} - -func shouldSkipJavaPackageForFile( - ctx context.Context, - imageFile bufimage.ImageFile, - javaPackageValue string, - exceptModuleIdentityStrings map[string]struct{}, -) bool { - if isWellKnownType(ctx, imageFile) || javaPackageValue == "" { - // This is a well-known type or we could not resolve a non-empty java_package - // value, so this is a no-op. - return true - } - - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return true - } - } - return false -} - -// javaPackageValue returns the java_package for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func javaPackageValue(imageFile bufimage.ImageFile, packagePrefix string) string { - if pkg := imageFile.Proto().GetPackage(); pkg != "" { - return packagePrefix + "." + pkg - } - return "" -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_string_check_utf8.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_string_check_utf8.go deleted file mode 100644 index ff4e940b0e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/java_string_check_utf8.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// JavaStringCheckUtf8ID is the ID of the java_string_check_utf8 modifier. -const JavaStringCheckUtf8ID = "JAVA_STRING_CHECK_UTF8" - -// javaStringCheckUtf8Path is the SourceCodeInfo path for the java_string_check_utf8 option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L375 -var javaStringCheckUtf8Path = []int32{8, 27} - -func javaStringCheckUtf8( - logger *zap.Logger, - sweeper Sweeper, - value bool, - overrides map[string]bool, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - modifierValue := value - if overrideValue, ok := overrides[imageFile.Path()]; ok { - modifierValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := javaStringCheckUtf8ForFile(ctx, sweeper, imageFile, modifierValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", JavaStringCheckUtf8ID, overrideFile) - } - } - return nil - }, - ) -} - -func javaStringCheckUtf8ForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - value bool, -) error { - descriptor := imageFile.Proto() - options := descriptor.GetOptions() - switch { - case isWellKnownType(ctx, imageFile): - // The file is a well-known type, don't do anything. - return nil - case options != nil && options.GetJavaStringCheckUtf8() == value: - // The option is already set to the same value, don't do anything. - return nil - case options == nil && descriptorpb.Default_FileOptions_JavaStringCheckUtf8 == value: - // The option is not set, but the value we want to set is the - // same as the default, don't do anything. - return nil - } - if options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.JavaStringCheckUtf8 = proto.Bool(value) - if sweeper != nil { - sweeper.mark(imageFile.Path(), javaStringCheckUtf8Path) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/multi_modifier.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/multi_modifier.go deleted file mode 100644 index 4d1064ab04..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/multi_modifier.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" -) - -type multiModifier struct { - delegates []Modifier -} - -func newMultiModifier( - delegates []Modifier, -) *multiModifier { - return &multiModifier{ - delegates: delegates, - } -} - -func (m *multiModifier) Modify( - ctx context.Context, - image bufimage.Image, -) error { - for _, delegate := range m.delegates { - if err := delegate.Modify(ctx, image); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/objc_class_prefix.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/objc_class_prefix.go deleted file mode 100644 index d92b4bfd84..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/objc_class_prefix.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "strings" - "unicode" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/protoversion" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// ObjcClassPrefixID is the ID of the objc_class_prefix modifier. -const ObjcClassPrefixID = "OBJC_CLASS_PREFIX" - -// objcClassPrefixPath is the SourceCodeInfo path for the objc_class_prefix option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L425 -var objcClassPrefixPath = []int32{8, 36} - -func objcClassPrefix( - logger *zap.Logger, - sweeper Sweeper, - defaultPrefix string, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make(map[string]string, len(moduleOverrides)) - for moduleIdentity, goPackagePrefix := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = goPackagePrefix - } - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - objcClassPrefixValue := objcClassPrefixValue(imageFile) - if defaultPrefix != "" { - objcClassPrefixValue = defaultPrefix - } - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if modulePrefixOverride, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - objcClassPrefixValue = modulePrefixOverride - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - } - } - if overrideValue, ok := overrides[imageFile.Path()]; ok { - objcClassPrefixValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := objcClassPrefixForFile(ctx, sweeper, imageFile, objcClassPrefixValue, exceptModuleIdentityStrings); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", ObjcClassPrefixID, moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", ObjcClassPrefixID, overrideFile) - } - } - return nil - }, - ) -} - -func objcClassPrefixForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - objcClassPrefixValue string, - exceptModuleIdentityStrings map[string]struct{}, -) error { - descriptor := imageFile.Proto() - if isWellKnownType(ctx, imageFile) || objcClassPrefixValue == "" { - // This is a well-known type or we could not resolve a non-empty objc_class_prefix - // value, so this is a no-op. - return nil - } - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return nil - } - } - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.ObjcClassPrefix = proto.String(objcClassPrefixValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), objcClassPrefixPath) - } - return nil -} - -// objcClassPrefixValue returns the objc_class_prefix for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func objcClassPrefixValue(imageFile bufimage.ImageFile) string { - pkg := imageFile.Proto().GetPackage() - if pkg == "" { - return "" - } - _, hasPackageVersion := protoversion.NewPackageVersionForPackage(pkg) - packageParts := strings.Split(pkg, ".") - var prefixParts []rune - for i, part := range packageParts { - // Check if last part is a version before appending. - if i == len(packageParts)-1 && hasPackageVersion { - continue - } - // Probably should never be a non-ASCII character, - // but why not support it just in case? - runeSlice := []rune(part) - prefixParts = append(prefixParts, unicode.ToUpper(runeSlice[0])) - } - for len(prefixParts) < 3 { - prefixParts = append(prefixParts, 'X') - } - prefix := string(prefixParts) - if prefix == "GPB" { - prefix = "GPX" - } - return prefix -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/optimize_for.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/optimize_for.go deleted file mode 100644 index 0150a4a38a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/optimize_for.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "go.uber.org/zap" - "google.golang.org/protobuf/types/descriptorpb" -) - -// OptimizeForID is the ID for the optimize_for modifier. -const OptimizeForID = "OPTIMIZE_FOR" - -// optimizeFor is the SourceCodeInfo path for the optimize_for option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L385 -var optimizeForPath = []int32{8, 9} - -func optimizeFor( - logger *zap.Logger, - sweeper Sweeper, - defaultOptimizeFor descriptorpb.FileOptions_OptimizeMode, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]descriptorpb.FileOptions_OptimizeMode, - overrides map[string]descriptorpb.FileOptions_OptimizeMode, -) Modifier { - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make( - map[string]descriptorpb.FileOptions_OptimizeMode, - len(moduleOverrides), - ) - for moduleIdentity, optimizeFor := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = optimizeFor - } - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - modifierValue := defaultOptimizeFor - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if optimizeForOverrdie, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - modifierValue = optimizeForOverrdie - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - } - } - if overrideValue, ok := overrides[imageFile.Path()]; ok { - modifierValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := optimizeForForFile( - ctx, - sweeper, - imageFile, - modifierValue, - exceptModuleIdentityStrings, - ); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("optimize_for override for %q was unused", moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", OptimizeForID, overrideFile) - } - } - return nil - }, - ) -} - -func optimizeForForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - value descriptorpb.FileOptions_OptimizeMode, - exceptModuleIdentityStrings map[string]struct{}, -) error { - descriptor := imageFile.Proto() - options := descriptor.GetOptions() - switch { - case isWellKnownType(ctx, imageFile): - // The file is a well-known type, don't do anything. - return nil - case options != nil && options.GetOptimizeFor() == value: - // The option is already set to the same value, don't do anything. - return nil - case options == nil && descriptorpb.Default_FileOptions_OptimizeFor == value: - // The option is not set, but the value we want to set is the - // same as the default, don't do anything. - return nil - } - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return nil - } - } - if options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.OptimizeFor = &value - if sweeper != nil { - sweeper.mark(imageFile.Path(), optimizeForPath) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_metadata_namespace.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_metadata_namespace.go deleted file mode 100644 index d5195fced8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_metadata_namespace.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// PhpMetadataNamespaceID is the ID of the php_metadata_namespace modifier. -const PhpMetadataNamespaceID = "PHP_METADATA_NAMESPACE" - -var ( - // phpMetadataNamespacePath is the SourceCodeInfo path for the php_metadata_namespace option. - // Ref: https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L448 - phpMetadataNamespacePath = []int32{8, 44} -) - -func phpMetadataNamespace( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - phpMetadataNamespaceValue := phpMetadataNamespaceValue(imageFile) - if overrideValue, ok := overrides[imageFile.Path()]; ok { - phpMetadataNamespaceValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := phpMetadataNamespaceForFile(ctx, sweeper, imageFile, phpMetadataNamespaceValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", PhpMetadataNamespaceID, overrideFile) - } - } - return nil - }, - ) -} - -func phpMetadataNamespaceForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - phpMetadataNamespaceValue string, -) error { - descriptor := imageFile.Proto() - if isWellKnownType(ctx, imageFile) || phpMetadataNamespaceValue == "" { - // This is a well-known type or we could not resolve a non-empty php_metadata_namespace - // value, so this is a no-op. - return nil - } - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.PhpMetadataNamespace = proto.String(phpMetadataNamespaceValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), phpMetadataNamespacePath) - } - return nil -} - -// phpMetadataNamespaceValue returns the php_metadata_namespace for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func phpMetadataNamespaceValue(imageFile bufimage.ImageFile) string { - phpNamespace := phpNamespaceValue(imageFile) - if phpNamespace == "" { - return "" - } - return phpNamespace + `\GPBMetadata` -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_namespace.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_namespace.go deleted file mode 100644 index 3b80780d32..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/php_namespace.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// PhpNamespaceID is the ID of the php_namespace modifier. -const PhpNamespaceID = "PHP_NAMESPACE" - -var ( - // phpNamespacePath is the SourceCodeInfo path for the php_namespace option. - // Ref: https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L443 - phpNamespacePath = []int32{8, 41} - - // Keywords and classes that could be produced by our heuristic. - // They must not be used in a php_namespace. - // Ref: https://www.php.net/manual/en/reserved.php - phpReservedKeywords = map[string]struct{}{ - // Reserved classes as per above. - "directory": {}, - "exception": {}, - "errorexception": {}, - "closure": {}, - "generator": {}, - "arithmeticerror": {}, - "assertionerror": {}, - "divisionbyzeroerror": {}, - "error": {}, - "throwable": {}, - "parseerror": {}, - "typeerror": {}, - // Keywords avoided by protoc. - // Ref: https://github.com/protocolbuffers/protobuf/blob/66d749188ff2a2e30e932110222d58da7c6a8d49/src/google/protobuf/compiler/php/php_generator.cc#L50-L66 - "abstract": {}, - "and": {}, - "array": {}, - "as": {}, - "break": {}, - "callable": {}, - "case": {}, - "catch": {}, - "class": {}, - "clone": {}, - "const": {}, - "continue": {}, - "declare": {}, - "default": {}, - "die": {}, - "do": {}, - "echo": {}, - "else": {}, - "elseif": {}, - "empty": {}, - "enddeclare": {}, - "endfor": {}, - "endforeach": {}, - "endif": {}, - "endswitch": {}, - "endwhile": {}, - "eval": {}, - "exit": {}, - "extends": {}, - "final": {}, - "finally": {}, - "fn": {}, - "for": {}, - "foreach": {}, - "function": {}, - "global": {}, - "goto": {}, - "if": {}, - "implements": {}, - "include": {}, - "include_once": {}, - "instanceof": {}, - "insteadof": {}, - "interface": {}, - "isset": {}, - "list": {}, - "match": {}, - "namespace": {}, - "new": {}, - "or": {}, - "print": {}, - "private": {}, - "protected": {}, - "public": {}, - "require": {}, - "require_once": {}, - "return": {}, - "static": {}, - "switch": {}, - "throw": {}, - "trait": {}, - "try": {}, - "unset": {}, - "use": {}, - "var": {}, - "while": {}, - "xor": {}, - "yield": {}, - "int": {}, - "float": {}, - "bool": {}, - "string": {}, - "true": {}, - "false": {}, - "null": {}, - "void": {}, - "iterable": {}, - } -) - -func phpNamespace( - logger *zap.Logger, - sweeper Sweeper, - overrides map[string]string, -) Modifier { - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - phpNamespaceValue := phpNamespaceValue(imageFile) - if overrideValue, ok := overrides[imageFile.Path()]; ok { - phpNamespaceValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := phpNamespaceForFile(ctx, sweeper, imageFile, phpNamespaceValue); err != nil { - return err - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", PhpNamespaceID, overrideFile) - } - } - return nil - }, - ) -} - -func phpNamespaceForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - phpNamespaceValue string, -) error { - descriptor := imageFile.Proto() - if isWellKnownType(ctx, imageFile) || phpNamespaceValue == "" { - // This is a well-known type or we could not resolve a non-empty php_namespace - // value, so this is a no-op. - return nil - } - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.PhpNamespace = proto.String(phpNamespaceValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), phpNamespacePath) - } - return nil -} - -// phpNamespaceValue returns the php_namespace for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func phpNamespaceValue(imageFile bufimage.ImageFile) string { - pkg := imageFile.Proto().GetPackage() - if pkg == "" { - return "" - } - packageParts := strings.Split(pkg, ".") - for i, part := range packageParts { - packagePart := stringutil.ToPascalCase(part) - if _, ok := phpReservedKeywords[strings.ToLower(part)]; ok { - // Append _ to the package part if it is a reserved keyword. - packagePart += "_" - } - packageParts[i] = packagePart - } - return strings.Join(packageParts, `\`) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/ruby_package.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/ruby_package.go deleted file mode 100644 index 3d8d6bdc3f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/ruby_package.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimagemodify - -import ( - "context" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.uber.org/zap" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" -) - -// RubyPackageID is the ID of the ruby_package modifier. -const RubyPackageID = "RUBY_PACKAGE" - -// rubyPackagePath is the SourceCodeInfo path for the ruby_package option. -// https://github.com/protocolbuffers/protobuf/blob/61689226c0e3ec88287eaed66164614d9c4f2bf7/src/google/protobuf/descriptor.proto#L453 -var rubyPackagePath = []int32{8, 45} - -func rubyPackage( - logger *zap.Logger, - sweeper Sweeper, - except []bufmoduleref.ModuleIdentity, - moduleOverrides map[bufmoduleref.ModuleIdentity]string, - overrides map[string]string, -) Modifier { - // Convert the bufmoduleref.ModuleIdentity types into - // strings so that they're comparable. - exceptModuleIdentityStrings := make(map[string]struct{}, len(except)) - for _, moduleIdentity := range except { - exceptModuleIdentityStrings[moduleIdentity.IdentityString()] = struct{}{} - } - overrideModuleIdentityStrings := make(map[string]string, len(moduleOverrides)) - for moduleIdentity, rubyPackage := range moduleOverrides { - overrideModuleIdentityStrings[moduleIdentity.IdentityString()] = rubyPackage - } - return ModifierFunc( - func(ctx context.Context, image bufimage.Image) error { - seenModuleIdentityStrings := make(map[string]struct{}, len(overrideModuleIdentityStrings)) - seenOverrideFiles := make(map[string]struct{}, len(overrides)) - for _, imageFile := range image.Files() { - rubyPackageValue := rubyPackageValue(imageFile) - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - moduleIdentityString := moduleIdentity.IdentityString() - if moduleNamespaceOverride, ok := overrideModuleIdentityStrings[moduleIdentityString]; ok { - seenModuleIdentityStrings[moduleIdentityString] = struct{}{} - rubyPackageValue = moduleNamespaceOverride - } - } - if overrideValue, ok := overrides[imageFile.Path()]; ok { - rubyPackageValue = overrideValue - seenOverrideFiles[imageFile.Path()] = struct{}{} - } - if err := rubyPackageForFile( - ctx, - sweeper, - imageFile, - rubyPackageValue, - exceptModuleIdentityStrings, - ); err != nil { - return err - } - } - for moduleIdentityString := range overrideModuleIdentityStrings { - if _, ok := seenModuleIdentityStrings[moduleIdentityString]; !ok { - logger.Sugar().Warnf("ruby_package override for %q was unused", moduleIdentityString) - } - } - for overrideFile := range overrides { - if _, ok := seenOverrideFiles[overrideFile]; !ok { - logger.Sugar().Warnf("%s override for %q was unused", RubyPackageID, overrideFile) - } - } - return nil - }, - ) -} - -func rubyPackageForFile( - ctx context.Context, - sweeper Sweeper, - imageFile bufimage.ImageFile, - rubyPackageValue string, - exceptModuleIdentityStrings map[string]struct{}, -) error { - descriptor := imageFile.Proto() - if isWellKnownType(ctx, imageFile) || rubyPackageValue == "" { - // This is a well-known type or we could not resolve a non-empty ruby_package - // value, so this is a no-op. - return nil - } - if moduleIdentity := imageFile.ModuleIdentity(); moduleIdentity != nil { - if _, ok := exceptModuleIdentityStrings[moduleIdentity.IdentityString()]; ok { - return nil - } - } - if descriptor.Options == nil { - descriptor.Options = &descriptorpb.FileOptions{} - } - descriptor.Options.RubyPackage = proto.String(rubyPackageValue) - if sweeper != nil { - sweeper.mark(imageFile.Path(), rubyPackagePath) - } - return nil -} - -// rubyPackageValue returns the ruby_package for the given ImageFile based on its -// package declaration. If the image file doesn't have a package declaration, an -// empty string is returned. -func rubyPackageValue(imageFile bufimage.ImageFile) string { - pkg := imageFile.Proto().GetPackage() - if pkg == "" { - return "" - } - packageParts := strings.Split(pkg, ".") - for i, part := range packageParts { - packageParts[i] = stringutil.ToPascalCase(part) - } - return strings.Join(packageParts, "::") -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/usage.gen.go deleted file mode 100644 index 396682e32c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimagemodify/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufimagemodify - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/bufimageutil.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/bufimageutil.go deleted file mode 100644 index db2d06d20c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/bufimageutil.go +++ /dev/null @@ -1,919 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimageutil - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/protosource" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - anyFullName = "google.protobuf.Any" -) - -var ( - // ErrImageFilterTypeNotFound is returned from ImageFilteredByTypes when - // a specified type cannot be found in an image. - ErrImageFilterTypeNotFound = errors.New("not found") - - // ErrImageFilterTypeIsImport is returned from ImageFilteredByTypes when - // a specified type name is declared in a module dependency. - ErrImageFilterTypeIsImport = errors.New("type declared in imported module") -) - -// NewInputFiles converts the ImageFiles to InputFiles. -// -// Since protosource is a pkg package, it cannot depend on bufmoduleref, which has the -// definition for bufmoduleref.ModuleIdentity, so we have our own interfaces for this -// in protosource. Given Go's type system, we need to do a conversion here. -func NewInputFiles(imageFiles []bufimage.ImageFile) []protosource.InputFile { - inputFiles := make([]protosource.InputFile, len(imageFiles)) - for i, imageFile := range imageFiles { - inputFiles[i] = newInputFile(imageFile) - } - return inputFiles -} - -// FreeMessageRangeStrings gets the free MessageRange strings for the target files. -// -// Recursive. -func FreeMessageRangeStrings( - ctx context.Context, - filePaths []string, - image bufimage.Image, -) ([]string, error) { - var s []string - for _, filePath := range filePaths { - imageFile := image.GetFile(filePath) - if imageFile == nil { - return nil, fmt.Errorf("unexpected nil image file: %q", filePath) - } - file, err := protosource.NewFile(newInputFile(imageFile)) - if err != nil { - return nil, err - } - for _, message := range file.Messages() { - s = freeMessageRangeStringsRec(s, message) - } - } - return s, nil -} - -// ImageFilterOption is an option that can be passed to ImageFilteredByTypesWithOptions. -type ImageFilterOption func(*imageFilterOptions) - -// WithExcludeCustomOptions returns an option that will cause an image filtered via -// ImageFilteredByTypesWithOptions to *not* include custom options unless they are -// explicitly named in the list of filter types. -func WithExcludeCustomOptions() ImageFilterOption { - return func(opts *imageFilterOptions) { - opts.includeCustomOptions = false - } -} - -// WithExcludeKnownExtensions returns an option that will cause an image filtered via -// ImageFilteredByTypesWithOptions to *not* include the known extensions for included -// extendable messages unless they are explicitly named in the list of filter types. -func WithExcludeKnownExtensions() ImageFilterOption { - return func(opts *imageFilterOptions) { - opts.includeKnownExtensions = false - } -} - -// WithAllowFilterByImportedType returns an option for ImageFilteredByTypesWithOptions -// that allows a named filter type to be in an imported file or module. Without this -// option, only types defined directly in the image to be filtered are allowed. -func WithAllowFilterByImportedType() ImageFilterOption { - return func(opts *imageFilterOptions) { - opts.allowImportedTypes = true - } -} - -// ImageFilteredByTypes returns a minimal image containing only the descriptors -// required to define those types. The resulting contains only files in which -// those descriptors and their transitive closure of required descriptors, with -// each file only contains the minimal required types and imports. -// -// Although this returns a new [bufimage.Image], it mutates the original image's -// underlying file's [descriptorpb.FileDescriptorProto]. So the old image should -// not continue to be used. -// -// A descriptor is said to require another descriptor if the dependent -// descriptor is needed to accurately and completely describe that descriptor. -// For the following types that includes: -// -// Messages -// - messages & enums referenced in fields -// - proto2 extension declarations for this field -// - custom options for the message, its fields, and the file in which the -// message is defined -// - the parent message if this message is a nested definition -// -// Enums -// - Custom options used in the enum, enum values, and the file -// in which the message is defined -// - the parent message if this message is a nested definition -// -// Services -// - request & response types referenced in methods -// - custom options for the service, its methods, and the file -// in which the message is defined -// -// As an example, consider the following proto structure: -// -// --- foo.proto --- -// package pkg; -// message Foo { -// optional Bar bar = 1; -// extensions 2 to 3; -// } -// message Bar { ... } -// message Baz { -// other.Qux qux = 1 [(other.my_option).field = "buf"]; -// } -// --- baz.proto --- -// package other; -// extend Foo { -// optional Qux baz = 2; -// } -// message Qux{ ... } -// message Quux{ ... } -// extend google.protobuf.FieldOptions { -// optional Quux my_option = 51234; -// } -// -// A filtered image for type `pkg.Foo` would include -// -// files: [foo.proto, bar.proto] -// messages: [pkg.Foo, pkg.Bar, other.Qux] -// extensions: [other.baz] -// -// A filtered image for type `pkg.Bar` would include -// -// files: [foo.proto] -// messages: [pkg.Bar] -// -// A filtered image for type `pkg.Baz` would include -// files: [foo.proto, bar.proto] -// messages: [pkg.Baz, other.Quux, other.Qux] -// extensions: [other.my_option] -func ImageFilteredByTypes(image bufimage.Image, types ...string) (bufimage.Image, error) { - return ImageFilteredByTypesWithOptions(image, types) -} - -// ImageFilteredByTypesWithOptions returns a minimal image containing only the descriptors -// required to define those types. See ImageFilteredByTypes for more details. This version -// allows for customizing the behavior with options. -func ImageFilteredByTypesWithOptions(image bufimage.Image, types []string, opts ...ImageFilterOption) (bufimage.Image, error) { - options := newImageFilterOptions() - for _, o := range opts { - o(options) - } - - imageIndex, err := newImageIndexForImage(image, options) - if err != nil { - return nil, err - } - // Check types exist - startingDescriptors := make([]namedDescriptor, 0, len(types)) - var startingPackages []*protoPackage - for _, typeName := range types { - // TODO: consider supporting a glob syntax of some kind, to do more advanced pattern - // matching, such as ability to get a package AND all of its sub-packages. - startingDescriptor, ok := imageIndex.ByName[typeName] - if ok { - // It's a type name - typeInfo := imageIndex.ByDescriptor[startingDescriptor] - if image.GetFile(typeInfo.file).IsImport() && !options.allowImportedTypes { - return nil, fmt.Errorf("filtering by type %q: %w", typeName, ErrImageFilterTypeIsImport) - } - startingDescriptors = append(startingDescriptors, startingDescriptor) - continue - } - // It could be a package name - pkg, ok := imageIndex.Packages[typeName] - if !ok { - // but it's not... - return nil, fmt.Errorf("filtering by type %q: %w", typeName, ErrImageFilterTypeNotFound) - } - if !options.allowImportedTypes { - // if package includes only imported files, then reject - onlyImported := true - for _, file := range pkg.files { - if !file.IsImport() { - onlyImported = false - break - } - } - if onlyImported { - return nil, fmt.Errorf("filtering by type %q: %w", typeName, ErrImageFilterTypeIsImport) - } - } - startingPackages = append(startingPackages, pkg) - } - // Find all types to include in filtered image. - closure := newTransitiveClosure() - for _, startingPackage := range startingPackages { - if err := closure.addPackage(startingPackage, imageIndex, options); err != nil { - return nil, err - } - } - for _, startingDescriptor := range startingDescriptors { - if err := closure.addElement(startingDescriptor, "", false, imageIndex, options); err != nil { - return nil, err - } - } - // After all types are added, add their known extensions - if err := closure.addExtensions(imageIndex, options); err != nil { - return nil, err - } - // Create a new image with only the required descriptors. - var includedFiles []bufimage.ImageFile - for _, imageFile := range image.Files() { - _, ok := closure.files[imageFile.Path()] - if !ok { - continue - } - includedFiles = append(includedFiles, imageFile) - imageFileDescriptor := imageFile.Proto() - - importsRequired := closure.imports[imageFile.Path()] - // If the file has source code info, we need to remap paths to correctly - // update this info for the elements retained after filtering. - var sourcePathRemapper *sourcePathsRemapTrie - if len(imageFileDescriptor.SourceCodeInfo.GetLocation()) > 0 { - sourcePathRemapper = &sourcePathsRemapTrie{} - } - // We track the source path as we go through the model, so that we can - // mark paths as moved or deleted. Whenever an element is deleted, any - // subsequent elements of the same type in the same scope have are "moved", - // because their index is shifted down. - basePath := make([]int32, 1, 16) - basePath[0] = fileDependencyTag - // While employing - // https://github.com/golang/go/wiki/SliceTricks#filter-in-place, - // also keep a record of which index moved where, so we can fixup - // the file's WeakDependency field. - indexFromTo := make(map[int32]int32) - indexTo := 0 - for indexFrom, importPath := range imageFileDescriptor.GetDependency() { - path := append(basePath, int32(indexFrom)) - if _, ok := importsRequired[importPath]; ok { - sourcePathRemapper.markMoved(path, int32(indexTo)) - indexFromTo[int32(indexFrom)] = int32(indexTo) - imageFileDescriptor.Dependency[indexTo] = importPath - indexTo++ - // markDeleted them as we go, so we know which ones weren't in the list - delete(importsRequired, importPath) - } else { - sourcePathRemapper.markDeleted(path) - } - } - imageFileDescriptor.Dependency = imageFileDescriptor.Dependency[:indexTo] - - // Add any other imports (which may not have been in the list because - // they were picked up via a public import). The filtered files will not - // use public imports. - for importPath := range importsRequired { - imageFileDescriptor.Dependency = append(imageFileDescriptor.Dependency, importPath) - } - imageFileDescriptor.PublicDependency = nil - sourcePathRemapper.markDeleted([]int32{filePublicDependencyTag}) - - basePath = basePath[:1] - basePath[0] = fileWeakDependencyTag - i := 0 - for _, indexFrom := range imageFileDescriptor.WeakDependency { - path := append(basePath, indexFrom) - if indexTo, ok := indexFromTo[indexFrom]; ok { - sourcePathRemapper.markMoved(path, indexTo) - imageFileDescriptor.WeakDependency[i] = indexTo - i++ - } else { - sourcePathRemapper.markDeleted(path) - } - } - imageFileDescriptor.WeakDependency = imageFileDescriptor.WeakDependency[:i] - - if _, ok := closure.completeFiles[imageFile.Path()]; !ok { - // if not keeping entire file, filter contents now - basePath = basePath[:0] - imageFileDescriptor.MessageType = trimMessageDescriptors(imageFileDescriptor.MessageType, closure.elements, sourcePathRemapper, append(basePath, fileMessagesTag)) - imageFileDescriptor.EnumType = trimSlice(imageFileDescriptor.EnumType, closure.elements, sourcePathRemapper, append(basePath, fileEnumsTag)) - // TODO: We could end up removing all extensions from a particular extend block - // but we then don't mark that extend block's source code info for deletion. This - // is because extend blocks don't have distinct paths -- we have to actually look - // at the span information to determine which extensions correspond to which blocks - // to decide which blocks to remove. That is possible, but non-trivial, and it's - // unclear if the "juice is worth the squeeze", so we leave it. The best we do is - // to remove comments for extend blocks when there are NO extensions. - extsPath := append(basePath, fileExtensionsTag) - imageFileDescriptor.Extension = trimSlice(imageFileDescriptor.Extension, closure.elements, sourcePathRemapper, extsPath) - if len(imageFileDescriptor.Extension) == 0 { - sourcePathRemapper.markDeleted(extsPath) - } - svcsPath := append(basePath, fileServicesTag) - // We must iterate through the services *before* we trim the slice. That way the - // index we see is for the "old path", which we need to know to mark elements as - // moved or deleted with the sourcePathRemapper. - for index, serviceDescriptor := range imageFileDescriptor.Service { - if _, ok := closure.elements[serviceDescriptor]; !ok { - continue - } - methodPath := append(svcsPath, int32(index), serviceMethodsTag) - serviceDescriptor.Method = trimSlice(serviceDescriptor.Method, closure.elements, sourcePathRemapper, methodPath) - } - imageFileDescriptor.Service = trimSlice(imageFileDescriptor.Service, closure.elements, sourcePathRemapper, svcsPath) - } - - if len(imageFileDescriptor.SourceCodeInfo.GetLocation()) > 0 { - // Now the sourcePathRemapper has been fully populated for all of the deletions - // and moves above. So we can use it to reconstruct the source code info slice - // of locations. - i := 0 - for _, location := range imageFileDescriptor.SourceCodeInfo.Location { - // This function returns newPath==nil if the element at the given path - // was marked for deletion (so this location should be omitted). - newPath, noComment := sourcePathRemapper.newPath(location.Path) - if newPath != nil { - imageFileDescriptor.SourceCodeInfo.Location[i] = location - location.Path = newPath - if noComment { - location.LeadingDetachedComments = nil - location.LeadingComments = nil - location.TrailingComments = nil - } - i++ - } - } - imageFileDescriptor.SourceCodeInfo.Location = imageFileDescriptor.SourceCodeInfo.Location[:i] - } - } - return bufimage.NewImage(includedFiles) -} - -// trimMessageDescriptors removes (nested) messages and nested enums from a slice -// of message descriptors if their type names are not found in the toKeep map. -func trimMessageDescriptors( - in []*descriptorpb.DescriptorProto, - toKeep map[namedDescriptor]closureInclusionMode, - sourcePathRemapper *sourcePathsRemapTrie, - pathSoFar []int32, -) []*descriptorpb.DescriptorProto { - // We must iterate through the messages *before* we trim the slice. That way the - // index we see is for the "old path", which we need to know to mark elements as - // moved or deleted with the sourcePathRemapper. - for index, messageDescriptor := range in { - path := append(pathSoFar, int32(index)) - mode, ok := toKeep[messageDescriptor] - if !ok { - continue - } - if mode == inclusionModeEnclosing { - // if this is just an enclosing element, we only care about it as a namespace for - // other types and don't care about the rest of its contents - messageDescriptor.Field = nil - messageDescriptor.OneofDecl = nil - messageDescriptor.ExtensionRange = nil - messageDescriptor.ReservedRange = nil - messageDescriptor.ReservedName = nil - sourcePathRemapper.markNoComment(path) - sourcePathRemapper.markDeleted(append(path, messageFieldsTag)) - sourcePathRemapper.markDeleted(append(path, messageOneofsTag)) - sourcePathRemapper.markDeleted(append(path, messageExtensionRangesTag)) - sourcePathRemapper.markDeleted(append(path, messageReservedRangesTag)) - sourcePathRemapper.markDeleted(append(path, messageReservedNamesTag)) - } - messageDescriptor.NestedType = trimMessageDescriptors(messageDescriptor.NestedType, toKeep, sourcePathRemapper, append(path, messageNestedMessagesTag)) - messageDescriptor.EnumType = trimSlice(messageDescriptor.EnumType, toKeep, sourcePathRemapper, append(path, messageEnumsTag)) - // TODO: We could end up removing all extensions from a particular extend block - // but we then don't mark that extend block's source code info for deletion. The - // best we do is to remove comments for extend blocks when there are NO extensions. - // See comment above for file extensions for more info. - extsPath := append(path, messageExtensionsTag) - messageDescriptor.Extension = trimSlice(messageDescriptor.Extension, toKeep, sourcePathRemapper, extsPath) - if len(messageDescriptor.Extension) == 0 { - sourcePathRemapper.markDeleted(extsPath) - } - } - return trimSlice(in, toKeep, sourcePathRemapper, pathSoFar) -} - -// trimSlice removes elements from a slice of descriptors if they are -// not present in the given map. -func trimSlice[T namedDescriptor]( - in []T, - toKeep map[namedDescriptor]closureInclusionMode, - sourcePathRemapper *sourcePathsRemapTrie, - pathSoFar []int32, -) []T { - i := 0 - for index, descriptor := range in { - path := append(pathSoFar, int32(index)) - if _, ok := toKeep[descriptor]; ok { - sourcePathRemapper.markMoved(path, int32(i)) - in[i] = descriptor - i++ - } else { - sourcePathRemapper.markDeleted(path) - } - } - return in[:i] -} - -// transitiveClosure accumulates the elements, files, and needed imports for a -// subset of an image. When an element is added to the closure, all of its -// dependencies are recursively added. -type transitiveClosure struct { - // The elements included in the transitive closure. - elements map[namedDescriptor]closureInclusionMode - // The set of files that contain all items in elements. - files map[string]struct{} - // Any files that are part of the closure in their entirety (due to an - // entire package being included). The above fields are used to filter the - // contents of files. But files named in this set will not be filtered. - completeFiles map[string]struct{} - // The set of imports for each file. This allows for re-writing imports - // for files whose contents have been pruned. - imports map[string]map[string]struct{} -} - -type closureInclusionMode int - -const ( - // Element is included in closure because it is directly reachable from a root. - inclusionModeExplicit = closureInclusionMode(iota) - // Element is included in closure because it is a message or service that - // *contains* an explicitly included element but is not itself directly - // reachable. - inclusionModeEnclosing - // Element is included in closure because it is implied by the presence of a - // custom option. For example, a field element with a custom option implies - // the presence of google.protobuf.FieldOptions. An option type could instead be - // explicitly included if it is also directly reachable (i.e. some type in the - // graph explicitly refers to the option type). - inclusionModeImplicit -) - -func newTransitiveClosure() *transitiveClosure { - return &transitiveClosure{ - elements: map[namedDescriptor]closureInclusionMode{}, - files: map[string]struct{}{}, - completeFiles: map[string]struct{}{}, - imports: map[string]map[string]struct{}{}, - } -} - -func (t *transitiveClosure) addImport(fromPath, toPath string) { - if fromPath == toPath { - return // no need for a file to import itself - } - imps := t.imports[fromPath] - if imps == nil { - imps = map[string]struct{}{} - t.imports[fromPath] = imps - } - imps[toPath] = struct{}{} -} - -func (t *transitiveClosure) addFile(file string, imageIndex *imageIndex, opts *imageFilterOptions) error { - if _, ok := t.files[file]; ok { - return nil // already added - } - t.files[file] = struct{}{} - return t.exploreCustomOptions(imageIndex.Files[file], file, imageIndex, opts) -} - -func (t *transitiveClosure) addPackage( - pkg *protoPackage, - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - for _, file := range pkg.files { - if err := t.addFile(file.Path(), imageIndex, opts); err != nil { - return err - } - t.completeFiles[file.Path()] = struct{}{} - } - for _, descriptor := range pkg.elements { - if err := t.addElement(descriptor, "", false, imageIndex, opts); err != nil { - return err - } - } - return nil -} - -func (t *transitiveClosure) addElement( - descriptor namedDescriptor, - referrerFile string, - impliedByCustomOption bool, - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - descriptorInfo := imageIndex.ByDescriptor[descriptor] - if err := t.addFile(descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - if referrerFile != "" { - t.addImport(referrerFile, descriptorInfo.file) - } - - if existingMode, ok := t.elements[descriptor]; ok && existingMode != inclusionModeEnclosing { - if existingMode == inclusionModeImplicit && !impliedByCustomOption { - // upgrade from implied to explicitly part of closure - t.elements[descriptor] = inclusionModeExplicit - } - return nil // already added this element - } - if impliedByCustomOption { - t.elements[descriptor] = inclusionModeImplicit - } else { - t.elements[descriptor] = inclusionModeExplicit - } - - // if this type is enclosed inside another, add enclosing types - if err := t.addEnclosing(descriptorInfo.parent, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - // add any custom options and their dependencies - if err := t.exploreCustomOptions(descriptor, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - - switch typedDescriptor := descriptor.(type) { - case *descriptorpb.DescriptorProto: - // Options and types for all fields - for _, field := range typedDescriptor.GetField() { - if err := t.addFieldType(field, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - if err := t.exploreCustomOptions(field, referrerFile, imageIndex, opts); err != nil { - return err - } - } - // Options for all oneofs in this message - for _, oneOfDescriptor := range typedDescriptor.GetOneofDecl() { - if err := t.exploreCustomOptions(oneOfDescriptor, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - } - // Options for all extension ranges in this message - for _, extRange := range typedDescriptor.GetExtensionRange() { - if err := t.exploreCustomOptions(extRange, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - } - - case *descriptorpb.EnumDescriptorProto: - for _, enumValue := range typedDescriptor.GetValue() { - if err := t.exploreCustomOptions(enumValue, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - } - - case *descriptorpb.ServiceDescriptorProto: - for _, method := range typedDescriptor.GetMethod() { - if err := t.addElement(method, "", false, imageIndex, opts); err != nil { - return err - } - } - - case *descriptorpb.MethodDescriptorProto: - inputName := strings.TrimPrefix(typedDescriptor.GetInputType(), ".") - inputDescriptor, ok := imageIndex.ByName[inputName] - if !ok { - return fmt.Errorf("missing %q", inputName) - } - if err := t.addElement(inputDescriptor, descriptorInfo.file, false, imageIndex, opts); err != nil { - return err - } - - outputName := strings.TrimPrefix(typedDescriptor.GetOutputType(), ".") - outputDescriptor, ok := imageIndex.ByName[outputName] - if !ok { - return fmt.Errorf("missing %q", outputName) - } - if err := t.addElement(outputDescriptor, descriptorInfo.file, false, imageIndex, opts); err != nil { - return err - } - - case *descriptorpb.FieldDescriptorProto: - // Regular fields are handled above in message descriptor case. - // We should only find our way here for extensions. - if typedDescriptor.Extendee == nil { - return errorUnsupportedFilterType(descriptor, descriptorInfo.fullName) - } - if typedDescriptor.GetExtendee() == "" { - return fmt.Errorf("expected extendee for field %q to not be empty", descriptorInfo.fullName) - } - extendeeName := strings.TrimPrefix(typedDescriptor.GetExtendee(), ".") - extendeeDescriptor, ok := imageIndex.ByName[extendeeName] - if !ok { - return fmt.Errorf("missing %q", extendeeName) - } - if err := t.addElement(extendeeDescriptor, descriptorInfo.file, impliedByCustomOption, imageIndex, opts); err != nil { - return err - } - if err := t.addFieldType(typedDescriptor, descriptorInfo.file, imageIndex, opts); err != nil { - return err - } - - default: - return errorUnsupportedFilterType(descriptor, descriptorInfo.fullName) - } - - return nil -} - -func errorUnsupportedFilterType(descriptor namedDescriptor, fullName string) error { - var descriptorType string - switch d := descriptor.(type) { - case *descriptorpb.FileDescriptorProto: - descriptorType = "file" - case *descriptorpb.DescriptorProto: - descriptorType = "message" - case *descriptorpb.FieldDescriptorProto: - if d.Extendee != nil { - descriptorType = "extension field" - } else { - descriptorType = "non-extension field" - } - case *descriptorpb.OneofDescriptorProto: - descriptorType = "oneof" - case *descriptorpb.EnumDescriptorProto: - descriptorType = "enum" - case *descriptorpb.EnumValueDescriptorProto: - descriptorType = "enum value" - case *descriptorpb.ServiceDescriptorProto: - descriptorType = "service" - case *descriptorpb.MethodDescriptorProto: - descriptorType = "method" - default: - descriptorType = fmt.Sprintf("%T", d) - } - return fmt.Errorf("%s is unsupported filter type: %s", fullName, descriptorType) -} - -func (t *transitiveClosure) addEnclosing(descriptor namedDescriptor, enclosingFile string, imageIndex *imageIndex, opts *imageFilterOptions) error { - // loop through all enclosing parents since nesting level - // could be arbitrarily deep - for descriptor != nil { - _, isMsg := descriptor.(*descriptorpb.DescriptorProto) - _, isSvc := descriptor.(*descriptorpb.ServiceDescriptorProto) - if !isMsg && !isSvc { - break // not an enclosing type - } - if _, ok := t.elements[descriptor]; ok { - break // already in closure - } - t.elements[descriptor] = inclusionModeEnclosing - if err := t.exploreCustomOptions(descriptor, enclosingFile, imageIndex, opts); err != nil { - return err - } - // now move into this element's parent - descriptor = imageIndex.ByDescriptor[descriptor].parent - } - return nil -} - -func (t *transitiveClosure) addFieldType(field *descriptorpb.FieldDescriptorProto, referrerFile string, imageIndex *imageIndex, opts *imageFilterOptions) error { - switch field.GetType() { - case descriptorpb.FieldDescriptorProto_TYPE_ENUM, - descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, - descriptorpb.FieldDescriptorProto_TYPE_GROUP: - typeName := strings.TrimPrefix(field.GetTypeName(), ".") - typeDescriptor, ok := imageIndex.ByName[typeName] - if !ok { - return fmt.Errorf("missing %q", typeName) - } - err := t.addElement(typeDescriptor, referrerFile, false, imageIndex, opts) - if err != nil { - return err - } - case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, - descriptorpb.FieldDescriptorProto_TYPE_FLOAT, - descriptorpb.FieldDescriptorProto_TYPE_INT64, - descriptorpb.FieldDescriptorProto_TYPE_UINT64, - descriptorpb.FieldDescriptorProto_TYPE_INT32, - descriptorpb.FieldDescriptorProto_TYPE_FIXED64, - descriptorpb.FieldDescriptorProto_TYPE_FIXED32, - descriptorpb.FieldDescriptorProto_TYPE_BOOL, - descriptorpb.FieldDescriptorProto_TYPE_STRING, - descriptorpb.FieldDescriptorProto_TYPE_BYTES, - descriptorpb.FieldDescriptorProto_TYPE_UINT32, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED32, - descriptorpb.FieldDescriptorProto_TYPE_SFIXED64, - descriptorpb.FieldDescriptorProto_TYPE_SINT32, - descriptorpb.FieldDescriptorProto_TYPE_SINT64: - // nothing to follow, custom options handled below. - default: - return fmt.Errorf("unknown field type %d", field.GetType()) - } - return nil -} - -func (t *transitiveClosure) addExtensions( - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - if !opts.includeKnownExtensions { - return nil // nothing to do - } - for e, mode := range t.elements { - if mode != inclusionModeExplicit { - // we only collect extensions for messages that are directly reachable/referenced. - continue - } - msgDescriptor, ok := e.(*descriptorpb.DescriptorProto) - if !ok { - // not a message, nothing to do - continue - } - descriptorInfo := imageIndex.ByDescriptor[msgDescriptor] - for _, extendsDescriptor := range imageIndex.NameToExtensions[descriptorInfo.fullName] { - if err := t.addElement(extendsDescriptor, "", false, imageIndex, opts); err != nil { - return err - } - } - } - return nil -} - -func (t *transitiveClosure) exploreCustomOptions( - descriptor proto.Message, - referrerFile string, - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - if !opts.includeCustomOptions { - return nil - } - - var options protoreflect.Message - switch descriptor := descriptor.(type) { - case *descriptorpb.FileDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.DescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.FieldDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.OneofDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.EnumDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.EnumValueDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.ServiceDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.MethodDescriptorProto: - options = descriptor.GetOptions().ProtoReflect() - case *descriptorpb.DescriptorProto_ExtensionRange: - options = descriptor.GetOptions().ProtoReflect() - default: - return fmt.Errorf("unexpected type for exploring options %T", descriptor) - } - - optionsName := string(options.Descriptor().FullName()) - var err error - options.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { - // If the value contains an Any message, we should add the message type - // therein to the closure. - if err = t.exploreOptionValueForAny(fd, val, referrerFile, imageIndex, opts); err != nil { - return false - } - - // Also include custom option definitions (e.g. extensions) - if !fd.IsExtension() { - return true - } - optionsByNumber := imageIndex.NameToOptions[optionsName] - field, ok := optionsByNumber[int32(fd.Number())] - if !ok { - err = fmt.Errorf("cannot find ext no %d on %s", fd.Number(), optionsName) - return false - } - err = t.addElement(field, referrerFile, true, imageIndex, opts) - return err == nil - }) - return err -} - -func isMessageKind(k protoreflect.Kind) bool { - return k == protoreflect.MessageKind || k == protoreflect.GroupKind -} - -func (t *transitiveClosure) exploreOptionValueForAny( - fd protoreflect.FieldDescriptor, - val protoreflect.Value, - referrerFile string, - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - switch { - case fd.IsMap(): - if isMessageKind(fd.MapValue().Kind()) { - var err error - val.Map().Range(func(_ protoreflect.MapKey, v protoreflect.Value) bool { - if err = t.exploreOptionSingularValueForAny(v.Message(), referrerFile, imageIndex, opts); err != nil { - return false - } - return true - }) - return err - } - case isMessageKind(fd.Kind()): - if fd.IsList() { - listVal := val.List() - for i := 0; i < listVal.Len(); i++ { - if err := t.exploreOptionSingularValueForAny(listVal.Get(i).Message(), referrerFile, imageIndex, opts); err != nil { - return err - } - } - } else { - return t.exploreOptionSingularValueForAny(val.Message(), referrerFile, imageIndex, opts) - } - } - return nil -} - -func (t *transitiveClosure) exploreOptionSingularValueForAny( - msg protoreflect.Message, - referrerFile string, - imageIndex *imageIndex, - opts *imageFilterOptions, -) error { - md := msg.Descriptor() - if md.FullName() == anyFullName { - // Found one! - typeURLFd := md.Fields().ByNumber(1) - if typeURLFd.Kind() != protoreflect.StringKind || typeURLFd.IsList() { - // should not be possible... - return nil - } - typeURL := msg.Get(typeURLFd).String() - pos := strings.LastIndexByte(typeURL, '/') - msgType := typeURL[pos+1:] - d, _ := imageIndex.ByName[msgType].(*descriptorpb.DescriptorProto) - if d != nil { - if err := t.addElement(d, referrerFile, false, imageIndex, opts); err != nil { - return err - } - } - // TODO: unmarshal the bytes to see if there are any nested Any messages - return nil - } - // keep digging - var err error - msg.Range(func(fd protoreflect.FieldDescriptor, val protoreflect.Value) bool { - err = t.exploreOptionValueForAny(fd, val, referrerFile, imageIndex, opts) - return err == nil - }) - return err -} - -func freeMessageRangeStringsRec( - s []string, - message protosource.Message, -) []string { - for _, nestedMessage := range message.Messages() { - s = freeMessageRangeStringsRec(s, nestedMessage) - } - if e := protosource.FreeMessageRangeString(message); e != "" { - return append(s, e) - } - return s -} - -type imageFilterOptions struct { - includeCustomOptions bool - includeKnownExtensions bool - allowImportedTypes bool -} - -func newImageFilterOptions() *imageFilterOptions { - return &imageFilterOptions{ - includeCustomOptions: true, - includeKnownExtensions: true, - allowImportedTypes: false, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/image_index.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/image_index.go deleted file mode 100644 index 984b20d4ee..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/image_index.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimageutil - -import ( - "fmt" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/protocompile/walk" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" -) - -// imageIndex holds an index that allows for easily navigating a descriptor -// hierarchy and its relationships. -type imageIndex struct { - // ByDescriptor maps descriptor proto pointers to information about the - // element. The info includes the actual descriptor proto, its parent - // element (if it has one), and the file in which it is defined. - ByDescriptor map[namedDescriptor]elementInfo - // ByName maps fully qualified type names to information about the named - // element. - ByName map[string]namedDescriptor - // Files maps fully qualified type names to the path of the file that - // declares the type. - Files map[string]*descriptorpb.FileDescriptorProto - - // NameToExtensions maps fully qualified type names to all known - // extension definitions for a type name. - NameToExtensions map[string][]*descriptorpb.FieldDescriptorProto - - // NameToOptions maps `google.protobuf.*Options` type names to their - // known extensions by field tag. - NameToOptions map[string]map[int32]*descriptorpb.FieldDescriptorProto - - // Packages maps package names to package contents. - Packages map[string]*protoPackage -} - -type namedDescriptor interface { - proto.Message - GetName() string -} - -var _ namedDescriptor = (*descriptorpb.FileDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.DescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.FieldDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.OneofDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.EnumDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.EnumValueDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.ServiceDescriptorProto)(nil) -var _ namedDescriptor = (*descriptorpb.MethodDescriptorProto)(nil) - -type elementInfo struct { - fullName, file string - parent namedDescriptor -} - -type protoPackage struct { - files []bufimage.ImageFile - elements []namedDescriptor - subPackages []*protoPackage -} - -// newImageIndexForImage builds an imageIndex for a given image. -func newImageIndexForImage(image bufimage.Image, opts *imageFilterOptions) (*imageIndex, error) { - index := &imageIndex{ - ByName: make(map[string]namedDescriptor), - ByDescriptor: make(map[namedDescriptor]elementInfo), - Files: make(map[string]*descriptorpb.FileDescriptorProto), - Packages: make(map[string]*protoPackage), - } - if opts.includeCustomOptions { - index.NameToOptions = make(map[string]map[int32]*descriptorpb.FieldDescriptorProto) - } - if opts.includeKnownExtensions { - index.NameToExtensions = make(map[string][]*descriptorpb.FieldDescriptorProto) - } - - for _, file := range image.Files() { - pkg := addPackageToIndex(file.FileDescriptor().GetPackage(), index) - pkg.files = append(pkg.files, file) - fileName := file.Path() - fileDescriptorProto := file.Proto() - index.Files[fileName] = fileDescriptorProto - err := walk.DescriptorProtos(fileDescriptorProto, func(name protoreflect.FullName, msg proto.Message) error { - if existing := index.ByName[string(name)]; existing != nil { - return fmt.Errorf("duplicate for %q", name) - } - descriptor, ok := msg.(namedDescriptor) - if !ok { - return fmt.Errorf("unexpected descriptor type %T", msg) - } - var parent namedDescriptor - if pos := strings.LastIndexByte(string(name), '.'); pos != -1 { - parent = index.ByName[string(name[:pos])] - if parent == nil { - // parent name was a package name, not an element name - parent = fileDescriptorProto - } - } - - // certain descriptor types don't need to be indexed: - // enum values, normal (non-extension) fields, and oneofs - var includeInIndex bool - switch d := descriptor.(type) { - case *descriptorpb.EnumValueDescriptorProto, *descriptorpb.OneofDescriptorProto: - // do not add to package elements; these elements are implicitly included by their enclosing type - case *descriptorpb.FieldDescriptorProto: - // only add to elements if an extension (regular fields implicitly included by containing message) - includeInIndex = d.Extendee != nil - default: - includeInIndex = true - } - - if includeInIndex { - index.ByName[string(name)] = descriptor - index.ByDescriptor[descriptor] = elementInfo{ - fullName: string(name), - parent: parent, - file: fileName, - } - pkg.elements = append(pkg.elements, descriptor) - } - - ext, ok := descriptor.(*descriptorpb.FieldDescriptorProto) - if !ok || ext.Extendee == nil { - // not an extension, so the rest does not apply - return nil - } - - extendeeName := strings.TrimPrefix(ext.GetExtendee(), ".") - if opts.includeCustomOptions && isOptionsTypeName(extendeeName) { - if _, ok := index.NameToOptions[extendeeName]; !ok { - index.NameToOptions[extendeeName] = make(map[int32]*descriptorpb.FieldDescriptorProto) - } - index.NameToOptions[extendeeName][ext.GetNumber()] = ext - } - if opts.includeKnownExtensions { - index.NameToExtensions[extendeeName] = append(index.NameToExtensions[extendeeName], ext) - } - - return nil - }) - if err != nil { - return nil, err - } - } - return index, nil -} - -func addPackageToIndex(pkgName string, index *imageIndex) *protoPackage { - pkg := index.Packages[pkgName] - if pkg != nil { - return pkg - } - pkg = &protoPackage{} - index.Packages[pkgName] = pkg - if pkgName == "" { - return pkg - } - var parentPkgName string - if pos := strings.LastIndexByte(pkgName, '.'); pos != -1 { - parentPkgName = pkgName[:pos] - } - parentPkg := addPackageToIndex(parentPkgName, index) - parentPkg.subPackages = append(parentPkg.subPackages, pkg) - return pkg -} - -func isOptionsTypeName(typeName string) bool { - switch typeName { - case "google.protobuf.FileOptions", - "google.protobuf.MessageOptions", - "google.protobuf.FieldOptions", - "google.protobuf.OneofOptions", - "google.protobuf.ExtensionRangeOptions", - "google.protobuf.EnumOptions", - "google.protobuf.EnumValueOptions", - "google.protobuf.ServiceOptions", - "google.protobuf.MethodOptions": - return true - default: - return false - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/input_file.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/input_file.go deleted file mode 100644 index 50bbfca511..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/input_file.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimageutil - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "github.com/bufbuild/buf/private/pkg/protosource" -) - -type inputFile struct { - bufimage.ImageFile -} - -func newInputFile(imageFile bufimage.ImageFile) *inputFile { - return &inputFile{ - ImageFile: imageFile, - } -} - -func (i *inputFile) ModuleIdentity() protosource.ModuleIdentity { - return i.ImageFile.ModuleIdentity() -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/source_paths_remap.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/source_paths_remap.go deleted file mode 100644 index 34e81fe2c6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/source_paths_remap.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimageutil - -import "sort" - -// sourcePathsRemapTrieNode is a node in a trie. Each node represents the -// path of a source code location. -type sourcePathsRemapTrieNode struct { - oldIndex int32 - // If == -1, the item at this path is being deleted. Otherwise, - // if != oldIndex, the item at this path is being moved, as well as - // all its descendents in the trie. - newIndex int32 - // If true, the item at this point has its comments omitted. This is - // used to omit comments for messages that, after filtering, are only - // present as a namespace (so the comments likely no longer apply). - noComment bool - // This node's children. These represent paths for which the current - // node is a path prefix (aka ancestor). - children sourcePathsRemapTrie -} - -// sourcePathsRemapTrie is a trie (aka prefix tree) whose children are a -// sorted slice (more efficient than a map, mainly due to not having to -// sort it with every addition, in practice, since source code info is -// mostly sorted). -// -// Each node in the trie represents some path of a source code location. -// This is used to track renumbering and deletions of paths. -type sourcePathsRemapTrie []*sourcePathsRemapTrieNode - -// markMoved inserts the given path into the trie and marks the last element -// of oldPath to be replaced with newIndex. -func (t *sourcePathsRemapTrie) markMoved(oldPath []int32, newIndex int32) { - t.doTrieInsert(oldPath, newIndex, false) -} - -// markDeleted marks the given path for deletion. -func (t *sourcePathsRemapTrie) markDeleted(oldPath []int32) { - t.doTrieInsert(oldPath, -1, false) -} - -// markNoComment inserts the given path into the trie and marks the element so -// its comments will be dropped. -func (t *sourcePathsRemapTrie) markNoComment(oldPath []int32) { - t.doTrieInsert(oldPath, oldPath[len(oldPath)-1], true) -} - -func (t *sourcePathsRemapTrie) doTrieInsert(oldPath []int32, newIndex int32, noComment bool) { - if t == nil { - return - } - items := *t - searchIndex := oldPath[0] - idx, found := sort.Find(len(items), func(i int) int { - return int(searchIndex - items[i].oldIndex) - }) - if !found { - // shouldn't usually need to sort because incoming items are often in order - needSort := len(items) > 0 && searchIndex < items[len(items)-1].oldIndex - idx = len(items) - items = append(items, &sourcePathsRemapTrieNode{ - oldIndex: searchIndex, - newIndex: searchIndex, - }) - if needSort { - sort.Slice(items, func(i, j int) bool { - return items[i].oldIndex < items[j].oldIndex - }) - // find the index of the thing we just added - idx, _ = sort.Find(len(items), func(i int) int { - return int(searchIndex - items[i].oldIndex) - }) - } - *t = items - } - if len(oldPath) > 1 { - items[idx].children.doTrieInsert(oldPath[1:], newIndex, noComment) - return - } - if noComment { - items[idx].noComment = noComment - } else { - items[idx].newIndex = newIndex - } -} - -// newPath returns the corrected path of oldPath, given any moves and -// deletions inserted into t. If the item at the given oldPath was deleted -// then nil is returned. Otherwise, the corrected path is returned. If the -// item at oldPath was not moved or deleted, the returned path has the -// same values as oldPath. -func (t *sourcePathsRemapTrie) newPath(oldPath []int32) (path []int32, noComment bool) { - if len(oldPath) == 0 { - // make sure return value is non-nil, so response doesn't - // get confused for "delete this entry" - return []int32{}, false - } - if t == nil { - return oldPath, false - } - newPath := make([]int32, len(oldPath)) - keep, noComment := t.fix(oldPath, newPath) - if !keep { - return nil, false - } - return newPath, noComment -} - -func (t *sourcePathsRemapTrie) fix(oldPath, newPath []int32) (keep, noComment bool) { - items := *t - searchIndex := oldPath[0] - idx, found := sort.Find(len(items), func(i int) int { - return int(searchIndex - items[i].oldIndex) - }) - if !found { - copy(newPath, oldPath) - return true, false - } - item := items[idx] - if item.newIndex == -1 { - return false, false - } - newPath[0] = item.newIndex - if len(oldPath) > 1 { - if item.newIndex == -1 { - newPath[0] = item.oldIndex - } - return item.children.fix(oldPath[1:], newPath[1:]) - } - return true, item.noComment -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/tags.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/tags.go deleted file mode 100644 index 79bbbb57b1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/tags.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimageutil - -const ( - // These constants are tag numbers for fields of messages in descriptor.proto. - // We use them to construct source code info paths, which must be re-written - // when we filter out elements of an image. - - fileDependencyTag = 3 - filePublicDependencyTag = 10 - fileWeakDependencyTag = 11 - fileMessagesTag = 4 - fileEnumsTag = 5 - fileServicesTag = 6 - fileExtensionsTag = 7 - messageFieldsTag = 2 - messageNestedMessagesTag = 3 - messageEnumsTag = 4 - messageExtensionsTag = 6 - messageOneofsTag = 8 - messageExtensionRangesTag = 5 - messageReservedRangesTag = 9 - messageReservedNamesTag = 10 - enumValuesTag = 2 - serviceMethodsTag = 2 -) diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/usage.gen.go deleted file mode 100644 index 2c11b71d66..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/bufimageutil/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufimageutil - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image.go deleted file mode 100644 index 5ed7f0a11d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "errors" - "fmt" -) - -var _ Image = &image{} - -type image struct { - files []ImageFile - pathToImageFile map[string]ImageFile -} - -func newImage(files []ImageFile, reorder bool) (*image, error) { - if len(files) == 0 { - return nil, errors.New("image contains no files") - } - pathToImageFile := make(map[string]ImageFile, len(files)) - identityStringToCommit := make(map[string]string) - for _, file := range files { - path := file.Path() - if _, ok := pathToImageFile[path]; ok { - return nil, fmt.Errorf("duplicate file: %s", path) - } - pathToImageFile[path] = file - if moduleIdentity := file.ModuleIdentity(); moduleIdentity != nil { - identityString := moduleIdentity.IdentityString() - existingCommit, ok := identityStringToCommit[identityString] - if ok { - if existingCommit != file.Commit() { - return nil, fmt.Errorf("image had two different commits for the same module: %q and %q", existingCommit, file.Commit()) - } - } else { - identityStringToCommit[identityString] = file.Commit() - } - } - } - if reorder { - files = orderImageFiles(files, pathToImageFile) - } - return &image{ - files: files, - pathToImageFile: pathToImageFile, - }, nil -} - -func newImageNoValidate(files []ImageFile) *image { - pathToImageFile := make(map[string]ImageFile, len(files)) - for _, file := range files { - path := file.Path() - pathToImageFile[path] = file - } - return &image{ - files: files, - pathToImageFile: pathToImageFile, - } -} - -func (i *image) Files() []ImageFile { - return i.files -} - -func (i *image) GetFile(path string) ImageFile { - return i.pathToImageFile[path] -} - -func (*image) isImage() {} - -// orderImageFiles re-orders the ImageFiles in DAG order. -func orderImageFiles( - inputImageFiles []ImageFile, - pathToImageFile map[string]ImageFile, -) []ImageFile { - outputImageFiles := make([]ImageFile, 0, len(inputImageFiles)) - alreadySeen := map[string]struct{}{} - for _, inputImageFile := range inputImageFiles { - outputImageFiles = orderImageFilesRec( - inputImageFile, - outputImageFiles, - pathToImageFile, - alreadySeen, - ) - } - return outputImageFiles -} - -func orderImageFilesRec( - inputImageFile ImageFile, - outputImageFiles []ImageFile, - pathToImageFile map[string]ImageFile, - alreadySeen map[string]struct{}, -) []ImageFile { - path := inputImageFile.Path() - if _, ok := alreadySeen[path]; ok { - return outputImageFiles - } - alreadySeen[path] = struct{}{} - for _, dependency := range inputImageFile.FileDescriptor().GetDependency() { - dependencyImageFile, ok := pathToImageFile[dependency] - if ok { - outputImageFiles = orderImageFilesRec( - dependencyImageFile, - outputImageFiles, - pathToImageFile, - alreadySeen, - ) - } - } - return append(outputImageFiles, inputImageFile) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_file.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_file.go deleted file mode 100644 index 95af8a2be7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_file.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "google.golang.org/protobuf/types/descriptorpb" -) - -var _ ImageFile = &imageFile{} - -type imageFile struct { - bufmoduleref.FileInfo - - fileDescriptorProto *descriptorpb.FileDescriptorProto - - isSyntaxUnspecified bool - storedUnusedDependencyIndexes []int32 -} - -func newImageFile( - fileDescriptor protodescriptor.FileDescriptor, - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, - externalPath string, - isImport bool, - isSyntaxUnspecified bool, - unusedDependencyIndexes []int32, -) (*imageFile, error) { - if err := protodescriptor.ValidateFileDescriptor(fileDescriptor); err != nil { - return nil, err - } - fileInfo, err := bufmoduleref.NewFileInfo( - fileDescriptor.GetName(), - externalPath, - isImport, - moduleIdentity, - commit, - ) - if err != nil { - return nil, err - } - // just to normalize in other places between empty and unset - if len(unusedDependencyIndexes) == 0 { - unusedDependencyIndexes = nil - } - return &imageFile{ - FileInfo: fileInfo, - // protodescriptor.FileDescriptorProtoForFileDescriptor is a no-op if fileDescriptor - // is already a *descriptorpb.FileDescriptorProto - fileDescriptorProto: protodescriptor.FileDescriptorProtoForFileDescriptor(fileDescriptor), - isSyntaxUnspecified: isSyntaxUnspecified, - storedUnusedDependencyIndexes: unusedDependencyIndexes, - }, nil -} - -func (f *imageFile) Proto() *descriptorpb.FileDescriptorProto { - return f.fileDescriptorProto -} - -func (f *imageFile) FileDescriptor() protodescriptor.FileDescriptor { - return f.fileDescriptorProto -} - -func (f *imageFile) IsSyntaxUnspecified() bool { - return f.isSyntaxUnspecified -} - -func (f *imageFile) UnusedDependencyIndexes() []int32 { - return f.storedUnusedDependencyIndexes -} - -func (f *imageFile) withIsImport(isImport bool) ImageFile { - if f.IsImport() == isImport { - return f - } - return &imageFile{ - FileInfo: f.FileInfo.WithIsImport(isImport), - fileDescriptorProto: f.fileDescriptorProto, - isSyntaxUnspecified: f.isSyntaxUnspecified, - storedUnusedDependencyIndexes: f.storedUnusedDependencyIndexes, - } -} - -func (*imageFile) isImageFile() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_module_dependency.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_module_dependency.go deleted file mode 100644 index 9451e15c46..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/image_module_dependency.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" -) - -var _ ImageModuleDependency = &imageModuleDependency{} - -type imageModuleDependency struct { - moduleIdentity bufmoduleref.ModuleIdentity - commit string - isDirect bool -} - -func newImageModuleDependency( - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, - isDirect bool, -) *imageModuleDependency { - return &imageModuleDependency{ - moduleIdentity: moduleIdentity, - commit: commit, - isDirect: isDirect, - } -} - -func (i *imageModuleDependency) ModuleIdentity() bufmoduleref.ModuleIdentity { - return i.moduleIdentity -} - -func (i *imageModuleDependency) Commit() string { - return i.commit -} - -func (i *imageModuleDependency) IsDirect() bool { - return i.isDirect -} - -func (i *imageModuleDependency) String() string { - moduleIdentityString := i.moduleIdentity.IdentityString() - if i.commit != "" { - return moduleIdentityString + ":" + i.commit - } - return moduleIdentityString -} - -func (*imageModuleDependency) isImageModuleDependency() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/import_tracker.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/import_tracker.go deleted file mode 100644 index 5d848c2fbe..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/import_tracker.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "strings" - - imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/known/anypb" -) - -var anyMessageName = (*anypb.Any)(nil).ProtoReflect().Descriptor().FullName() - -type importTracker struct { - resolver protoencoding.Resolver - used map[string]map[string]struct{} -} - -func (t *importTracker) markUsed(importer *imagev1.ImageFile, element string) { - desc, err := t.resolver.FindDescriptorByName(protoreflect.FullName(strings.TrimPrefix(element, "."))) - if err != nil { - // TODO: Shouldn't be possible. If this happens, element is not in - // the resolved files, so nothing to mark anyway... - return - } - importedFile := desc.ParentFile().Path() - - fileImports := t.used[importer.GetName()] - if fileImports == nil { - fileImports = map[string]struct{}{} - t.used[importer.GetName()] = fileImports - } - for _, depPath := range importer.Dependency { - if importedFile == depPath { - // Found it! - fileImports[depPath] = struct{}{} - return - } - } - // Not in any imports. So see if it is publicly imported. - for _, depPath := range importer.Dependency { - depFile, err := t.resolver.FindFileByPath(depPath) - if err != nil { - // Shouldn't be possible... bail. - continue - } - if t.publiclyImports(depFile, importedFile) { - // Found it! - fileImports[depPath] = struct{}{} - return - } - } -} - -func (t *importTracker) publiclyImports(file protoreflect.FileDescriptor, importedFile string) bool { - deps := file.Imports() - for i, depsLen := 0, deps.Len(); i < depsLen; i++ { - dep := deps.Get(i) - if !dep.IsPublic { - continue - } - if dep.Path() == importedFile { - return true - } - if t.publiclyImports(dep, importedFile) { - return true - } - } - return false -} - -func (t *importTracker) findUsedImports(protoImage *imagev1.Image) { - for _, file := range protoImage.File { - if len(file.Dependency) == 0 { - // no imports so nothing to do - continue - } - t.findUsedImportsInOptions(file, file.Options) - for _, msg := range file.MessageType { - t.findUsedImportsInMessage(file, msg) - } - for _, enum := range file.EnumType { - t.findUsedImportsInEnum(file, enum) - } - for _, ext := range file.Extension { - t.findUsedImportsInField(file, ext) - } - for _, svc := range file.Service { - t.findUsedImportsInOptions(file, svc.Options) - for _, method := range svc.Method { - t.findUsedImportsInOptions(file, method.Options) - t.markUsed(file, method.GetInputType()) - t.markUsed(file, method.GetOutputType()) - } - } - } -} - -func (t *importTracker) findUsedImportsInMessage(file *imagev1.ImageFile, msg *descriptorpb.DescriptorProto) { - t.findUsedImportsInOptions(file, msg.Options) - for _, field := range msg.Field { - t.findUsedImportsInField(file, field) - } - for _, oneof := range msg.OneofDecl { - t.findUsedImportsInOptions(file, oneof.Options) - } - for _, extRange := range msg.ExtensionRange { - t.findUsedImportsInOptions(file, extRange.Options) - } - - for _, nestedMsg := range msg.NestedType { - t.findUsedImportsInMessage(file, nestedMsg) - } - for _, enum := range msg.EnumType { - t.findUsedImportsInEnum(file, enum) - } - for _, ext := range msg.Extension { - t.findUsedImportsInField(file, ext) - } -} - -func (t *importTracker) findUsedImportsInEnum(file *imagev1.ImageFile, enum *descriptorpb.EnumDescriptorProto) { - t.findUsedImportsInOptions(file, enum.Options) - for _, value := range enum.Value { - t.findUsedImportsInOptions(file, value.Options) - } -} - -func (t *importTracker) findUsedImportsInField(file *imagev1.ImageFile, field *descriptorpb.FieldDescriptorProto) { - t.findUsedImportsInOptions(file, field.Options) - switch field.GetType() { - case descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, - descriptorpb.FieldDescriptorProto_TYPE_GROUP, - descriptorpb.FieldDescriptorProto_TYPE_ENUM: - t.markUsed(file, field.GetTypeName()) - } - extendee := field.GetExtendee() - if extendee != "" { - t.markUsed(file, extendee) - } -} - -func (t *importTracker) findUsedImportsInOptions(file *imagev1.ImageFile, optionMessage proto.Message) { - optionMessage.ProtoReflect().Range(func(field protoreflect.FieldDescriptor, val protoreflect.Value) bool { - t.findUsedImportsInOptionValue(file, field, val) - return true - }) -} - -func (t *importTracker) findUsedImportsInOptionValue(file *imagev1.ImageFile, optionField protoreflect.FieldDescriptor, val protoreflect.Value) { - if optionField.IsExtension() { - t.markUsed(file, string(optionField.FullName())) - } - switch { - case optionField.IsMap(): - if optionField.MapValue().Message() == nil { - return // no messages to examine - } - val.Map().Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - t.findUsedImportsInMessageValue(file, v.Message()) - return true - }) - case optionField.IsList(): - if optionField.Message() == nil { - return // no messages to examine - } - list := val.List() - for i, l := 0, list.Len(); i < l; i++ { - t.findUsedImportsInMessageValue(file, list.Get(i).Message()) - } - case optionField.Message() != nil: - t.findUsedImportsInMessageValue(file, val.Message()) - } -} - -func (t *importTracker) findUsedImportsInMessageValue(file *imagev1.ImageFile, msg protoreflect.Message) { - if msg.Descriptor().FullName() == anyMessageName { - typeURLField := msg.Descriptor().Fields().ByNumber(1) - if typeURLField == nil || typeURLField.Kind() != protoreflect.StringKind || typeURLField.IsList() { - // ruh-roh... this should not happen - return - } - valueField := msg.Descriptor().Fields().ByNumber(2) - if valueField == nil || valueField.Kind() != protoreflect.BytesKind || valueField.IsList() { - // oof, this should not happen - return - } - - typeURL := msg.Get(typeURLField).String() - msgType, err := t.resolver.FindMessageByURL(typeURL) - if err != nil { - // message is not present in the image - return - } - t.markUsed(file, string(msgType.Descriptor().FullName())) - // process Any messages that might be nested inside this one - value := msg.Get(valueField).Bytes() - nestedMessage := msgType.New() - err = proto.UnmarshalOptions{Resolver: t.resolver}.Unmarshal(value, nestedMessage.Interface()) - if err != nil { - // bytes are not valid; skip it - return - } - msg = nestedMessage // fall-through to recurse into this message - } - msg.Range(func(field protoreflect.FieldDescriptor, val protoreflect.Value) bool { - t.findUsedImportsInOptionValue(file, field, val) - return true - }) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/usage.gen.go deleted file mode 100644 index 0efb08485f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufimage - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/util.go deleted file mode 100644 index bea4309f98..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/util.go +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "errors" - "fmt" - "sort" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/data/datawkt" - imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "github.com/bufbuild/buf/private/pkg/stringutil" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -// Must match the tag number for ImageFile.buf_extensions defined in proto/buf/alpha/image/v1/image.proto. -const bufExtensionFieldNumber = 8042 - -// paths can be either files (ending in .proto) or directories -// paths must be normalized and validated, and not duplicated -// if a directory, all .proto files underneath will be included -func imageWithOnlyPaths(image Image, fileOrDirPaths []string, excludeFileOrDirPaths []string, allowNotExist bool) (Image, error) { - if err := normalpath.ValidatePathsNormalizedValidatedUnique(fileOrDirPaths); err != nil { - return nil, err - } - if err := normalpath.ValidatePathsNormalizedValidatedUnique(excludeFileOrDirPaths); err != nil { - return nil, err - } - excludeFileOrDirPathMap := stringutil.SliceToMap(excludeFileOrDirPaths) - // These are the files that fileOrDirPaths actually reference and will - // result in the non-imports in our resulting Image. The Image will also include - // the ImageFiles that the nonImportImageFiles import - nonImportPaths := make(map[string]struct{}) - var nonImportImageFiles []ImageFile - // We have only exclude paths, and therefore all other paths are target paths. - if len(fileOrDirPaths) == 0 && len(excludeFileOrDirPaths) > 0 { - for _, imageFile := range image.Files() { - if !imageFile.IsImport() { - if !normalpath.MapHasEqualOrContainingPath(excludeFileOrDirPathMap, imageFile.Path(), normalpath.Relative) { - nonImportPaths[imageFile.Path()] = struct{}{} - nonImportImageFiles = append(nonImportImageFiles, imageFile) - } - } - } - // Finally, before we construct the image, we need to validate that all exclude paths - // provided adhere to the allowNotExist flag. - if !allowNotExist { - if err := checkExcludePathsExistInImage(image, excludeFileOrDirPaths); err != nil { - return nil, err - } - } - return getImageWithImports(image, nonImportPaths, nonImportImageFiles) - } - // We do a check here to ensure that no paths are duplicated as a target and an exclude. - for _, fileOrDirPath := range fileOrDirPaths { - if _, ok := excludeFileOrDirPathMap[fileOrDirPath]; ok { - return nil, fmt.Errorf( - "cannot set the same path for both --path and --exclude-path flags: %s", - normalpath.Unnormalize(fileOrDirPath), - ) - } - } - // potentialDirPaths are paths that we need to check if they are directories - // these are any files that do not end in .proto, as well as files that - // end in .proto but do not have a corresponding ImageFile - if there - // is not an ImageFile, the path ending in .proto could be a directory - // that itself contains ImageFiles, i.e. a/b.proto/c.proto is valid if not dumb - var potentialDirPaths []string - for _, fileOrDirPath := range fileOrDirPaths { - // this is not allowed, this is the equivalent of a root - if fileOrDirPath == "." { - return nil, errors.New(`"." is not a valid path value`) - } - if normalpath.Ext(fileOrDirPath) != ".proto" { - // not a .proto file, therefore must be a directory - potentialDirPaths = append(potentialDirPaths, fileOrDirPath) - } else { - if imageFile := image.GetFile(fileOrDirPath); imageFile != nil { - // We do not need to check excludes here, since we already checked for duplicated - // paths, and target files that resolve to a specific image file are always a leaf, - // thus, we would always include it if it's specified. - // We have an ImageFile, therefore the fileOrDirPath was a file path - // add to the nonImportImageFiles if does not already exist - if _, ok := nonImportPaths[fileOrDirPath]; !ok { - nonImportPaths[fileOrDirPath] = struct{}{} - nonImportImageFiles = append(nonImportImageFiles, imageFile) - } - } else { - // we do not have an image file, so even though this path ends - // in .proto, this could be a directory - we need to check it - potentialDirPaths = append(potentialDirPaths, fileOrDirPath) - } - } - } - if len(potentialDirPaths) == 0 { - // We had no potential directory paths as we were able to get - // an ImageFile for all fileOrDirPaths, so we can return an Image now. - // This means we do not have to do the expensive O(image.Files()) operation - // to check to see if each file is within a potential directory path. - // - // We do not need to check the excluded paths for the allowNotExist flag because all target - // paths were image files, therefore the exclude paths would not apply in this case. - // - // Unfortunately, we need to do the expensive operation of checking to make sure the exclude - // paths exist in the case where `allowNotExist == false`. - if !allowNotExist { - if err := checkExcludePathsExistInImage(image, excludeFileOrDirPaths); err != nil { - return nil, err - } - } - return getImageWithImports(image, nonImportPaths, nonImportImageFiles) - } - // we have potential directory paths, do the expensive operation - // make a map of the directory paths - // note that we do not make this a map to begin with as maps are unordered, - // and we want to make sure we iterate over the paths in a deterministic order - potentialDirPathMap := stringutil.SliceToMap(potentialDirPaths) - - // map of all paths based on the imageFiles - // the map of paths within potentialDirPath that matches a file in image.Files() - // this needs to contain all paths in potentialDirPathMap at the end for us to - // have had matches for every inputted fileOrDirPath - matchingPotentialDirPathMap := make(map[string]struct{}) - // the same thing is done for exclude paths - matchingPotentialExcludePathMap := make(map[string]struct{}) - for _, imageFile := range image.Files() { - imageFilePath := imageFile.Path() - fileMatchingExcludePathMap := normalpath.MapAllEqualOrContainingPathMap( - excludeFileOrDirPathMap, - imageFilePath, - normalpath.Relative, - ) - if len(fileMatchingExcludePathMap) > 0 { - for key := range fileMatchingExcludePathMap { - matchingPotentialExcludePathMap[key] = struct{}{} - } - } - // get the paths in potentialDirPathMap that match this imageFilePath - fileMatchingPathMap := normalpath.MapAllEqualOrContainingPathMap( - potentialDirPathMap, - imageFilePath, - normalpath.Relative, - ) - if shouldExcludeFile(fileMatchingPathMap, fileMatchingExcludePathMap) { - continue - } - if len(fileMatchingPathMap) > 0 { - // we had a match, this means that some path in potentialDirPaths matched - // the imageFilePath, add all the paths in potentialDirPathMap that - // matched to matchingPotentialDirPathMap - for key := range fileMatchingPathMap { - matchingPotentialDirPathMap[key] = struct{}{} - } - // then, add the file to non-imports if it is not added - if _, ok := nonImportPaths[imageFilePath]; !ok { - nonImportPaths[imageFilePath] = struct{}{} - nonImportImageFiles = append(nonImportImageFiles, imageFile) - } - } - } - // if !allowNotExist, i.e. if all fileOrDirPaths must have a matching ImageFile, - // we check the matchingPotentialDirPathMap against the potentialDirPathMap - // to make sure that potentialDirPathMap is covered - if !allowNotExist { - for potentialDirPath := range potentialDirPathMap { - if _, ok := matchingPotentialDirPathMap[potentialDirPath]; !ok { - // no match, this is an error given that allowNotExist is false - return nil, fmt.Errorf("path %q has no matching file in the image", potentialDirPath) - } - } - for excludeFileOrDirPath := range excludeFileOrDirPathMap { - if _, ok := matchingPotentialExcludePathMap[excludeFileOrDirPath]; !ok { - // no match, this is an error given that allowNotExist is false - return nil, fmt.Errorf("path %q has no matching file in the image", excludeFileOrDirPath) - } - } - } - // we finally have all files that match fileOrDirPath that we can find, make the image - return getImageWithImports(image, nonImportPaths, nonImportImageFiles) -} - -// shouldExcludeFile takes the map of all the matching target paths and the map of all the matching -// exclude paths for an image file and takes the union of the two sets of matches to return -// a bool on whether or not we should exclude the file from the image. -func shouldExcludeFile( - fileMatchingPathMap map[string]struct{}, - fileMatchingExcludePathMap map[string]struct{}, -) bool { - for fileMatchingPath := range fileMatchingPathMap { - for fileMatchingExcludePath := range fileMatchingExcludePathMap { - if normalpath.EqualsOrContainsPath(fileMatchingPath, fileMatchingExcludePath, normalpath.Relative) { - delete(fileMatchingPathMap, fileMatchingPath) - continue - } - } - } - // If there are no potential paths remaining, - // then the file should be excluded. - return len(fileMatchingPathMap) == 0 -} - -func getImageWithImports( - image Image, - nonImportPaths map[string]struct{}, - nonImportImageFiles []ImageFile, -) (Image, error) { - var imageFiles []ImageFile - seenPaths := make(map[string]struct{}) - for _, nonImportImageFile := range nonImportImageFiles { - imageFiles = addFileWithImports( - imageFiles, - image, - nonImportPaths, - seenPaths, - nonImportImageFile, - ) - } - return NewImage(imageFiles) -} - -// returns accumulated files in correct order -func addFileWithImports( - accumulator []ImageFile, - image Image, - nonImportPaths map[string]struct{}, - seenPaths map[string]struct{}, - imageFile ImageFile, -) []ImageFile { - path := imageFile.Path() - // if seen already, skip - if _, ok := seenPaths[path]; ok { - return accumulator - } - seenPaths[path] = struct{}{} - - // then, add imports first, for proper ordering - for _, importPath := range imageFile.FileDescriptor().GetDependency() { - if importFile := image.GetFile(importPath); importFile != nil { - accumulator = addFileWithImports( - accumulator, - image, - nonImportPaths, - seenPaths, - importFile, - ) - } - } - - // finally, add this file - // check if this is an import or not - _, isNotImport := nonImportPaths[path] - accumulator = append( - accumulator, - imageFile.withIsImport(!isNotImport), - ) - return accumulator -} - -func checkExcludePathsExistInImage(image Image, excludeFileOrDirPaths []string) error { - for _, excludeFileOrDirPath := range excludeFileOrDirPaths { - var foundPath bool - for _, imageFile := range image.Files() { - if normalpath.EqualsOrContainsPath(excludeFileOrDirPath, imageFile.Path(), normalpath.Relative) { - foundPath = true - break - } - } - if !foundPath { - // no match, this is an error given that allowNotExist is false - return fmt.Errorf("path %q has no matching file in the image", excludeFileOrDirPath) - } - } - return nil -} - -func protoImageFilesToFileDescriptors(protoImageFiles []*imagev1.ImageFile) []protodescriptor.FileDescriptor { - fileDescriptors := make([]protodescriptor.FileDescriptor, len(protoImageFiles)) - for i, protoImageFile := range protoImageFiles { - fileDescriptors[i] = protoImageFile - } - return fileDescriptors -} - -func imageFilesToFileDescriptors(imageFiles []ImageFile) []protodescriptor.FileDescriptor { - fileDescriptors := make([]protodescriptor.FileDescriptor, len(imageFiles)) - for i, imageFile := range imageFiles { - fileDescriptors[i] = imageFile.FileDescriptor() - } - return fileDescriptors -} - -func imageFilesToFileDescriptorProtos(imageFiles []ImageFile) []*descriptorpb.FileDescriptorProto { - fileDescriptorProtos := make([]*descriptorpb.FileDescriptorProto, len(imageFiles)) - for i, imageFile := range imageFiles { - fileDescriptorProtos[i] = imageFile.Proto() - } - return fileDescriptorProtos -} - -func imageFileToProtoImageFile(imageFile ImageFile) *imagev1.ImageFile { - return fileDescriptorProtoToProtoImageFile( - imageFile.Proto(), - imageFile.IsImport(), - imageFile.IsSyntaxUnspecified(), - imageFile.UnusedDependencyIndexes(), - imageFile.ModuleIdentity(), - imageFile.Commit(), - ) -} - -func fileDescriptorProtoToProtoImageFile( - fileDescriptorProto *descriptorpb.FileDescriptorProto, - isImport bool, - isSyntaxUnspecified bool, - unusedDependencyIndexes []int32, - moduleIdentity bufmoduleref.ModuleIdentity, - moduleCommit string, -) *imagev1.ImageFile { - var protoModuleInfo *imagev1.ModuleInfo - if moduleIdentity != nil { - protoModuleInfo = &imagev1.ModuleInfo{ - Name: &imagev1.ModuleName{ - Remote: proto.String(moduleIdentity.Remote()), - Owner: proto.String(moduleIdentity.Owner()), - Repository: proto.String(moduleIdentity.Repository()), - }, - } - if moduleCommit != "" { - protoModuleInfo.Commit = proto.String(moduleCommit) - } - } - if len(unusedDependencyIndexes) == 0 { - unusedDependencyIndexes = nil - } - resultFile := &imagev1.ImageFile{ - Name: fileDescriptorProto.Name, - Package: fileDescriptorProto.Package, - Syntax: fileDescriptorProto.Syntax, - Dependency: fileDescriptorProto.GetDependency(), - PublicDependency: fileDescriptorProto.GetPublicDependency(), - WeakDependency: fileDescriptorProto.GetWeakDependency(), - MessageType: fileDescriptorProto.GetMessageType(), - EnumType: fileDescriptorProto.GetEnumType(), - Service: fileDescriptorProto.GetService(), - Extension: fileDescriptorProto.GetExtension(), - Options: fileDescriptorProto.GetOptions(), - SourceCodeInfo: fileDescriptorProto.GetSourceCodeInfo(), - Edition: fileDescriptorProto.Edition, - BufExtension: &imagev1.ImageFileExtension{ - // we might actually want to differentiate between unset and false - IsImport: proto.Bool(isImport), - // we might actually want to differentiate between unset and false - IsSyntaxUnspecified: proto.Bool(isSyntaxUnspecified), - UnusedDependency: unusedDependencyIndexes, - ModuleInfo: protoModuleInfo, - }, - } - resultFile.ProtoReflect().SetUnknown(stripBufExtensionField(fileDescriptorProto.ProtoReflect().GetUnknown())) - return resultFile -} - -func stripBufExtensionField(unknownFields protoreflect.RawFields) protoreflect.RawFields { - // We accumulate the new bytes in result. However, for efficiency, we don't do any - // allocation/copying until we have to (i.e. until we actually see the field we're - // trying to strip). So result will be left nil and initialized lazily if-and-only-if - // we actually need to strip data from unknownFields. - var result protoreflect.RawFields - bytesRemaining := unknownFields - for len(bytesRemaining) > 0 { - num, wireType, n := protowire.ConsumeTag(bytesRemaining) - if n < 0 { - // shouldn't be possible unless explicitly set to invalid bytes via reflection - return unknownFields - } - var skip bool - if num == bufExtensionFieldNumber { - // We need to strip this field. - skip = true - if result == nil { - // Lazily initialize result to the preface that we've already examined. - result = append( - make(protoreflect.RawFields, 0, len(unknownFields)), - unknownFields[:len(unknownFields)-len(bytesRemaining)]..., - ) - } - } else if result != nil { - // accumulate data in result as we go - result = append(result, bytesRemaining[:n]...) - } - bytesRemaining = bytesRemaining[n:] - n = protowire.ConsumeFieldValue(num, wireType, bytesRemaining) - if n < 0 { - return unknownFields - } - if !skip && result != nil { - result = append(result, bytesRemaining[:n]...) - } - bytesRemaining = bytesRemaining[n:] - } - if result == nil { - // we did not have to remove anything - return unknownFields - } - return result -} - -func imageToCodeGeneratorRequest( - image Image, - parameter string, - compilerVersion *pluginpb.Version, - includeImports bool, - includeWellKnownTypes bool, - alreadyUsedPaths map[string]struct{}, - nonImportPaths map[string]struct{}, -) *pluginpb.CodeGeneratorRequest { - imageFiles := image.Files() - request := &pluginpb.CodeGeneratorRequest{ - ProtoFile: make([]*descriptorpb.FileDescriptorProto, len(imageFiles)), - CompilerVersion: compilerVersion, - } - if parameter != "" { - request.Parameter = proto.String(parameter) - } - for i, imageFile := range imageFiles { - request.ProtoFile[i] = imageFile.Proto() - if isFileToGenerate( - imageFile, - alreadyUsedPaths, - nonImportPaths, - includeImports, - includeWellKnownTypes, - ) { - request.FileToGenerate = append(request.FileToGenerate, imageFile.Path()) - } - } - return request -} - -func isFileToGenerate( - imageFile ImageFile, - alreadyUsedPaths map[string]struct{}, - nonImportPaths map[string]struct{}, - includeImports bool, - includeWellKnownTypes bool, -) bool { - path := imageFile.Path() - if !imageFile.IsImport() { - if alreadyUsedPaths != nil { - // set as already used - alreadyUsedPaths[path] = struct{}{} - } - // this is a non-import in this image, we always want to generate - return true - } - if !includeImports { - // we don't want to include imports - return false - } - if !includeWellKnownTypes && datawkt.Exists(path) { - // we don't want to generate wkt even if includeImports is set unless - // includeWellKnownTypes is set - return false - } - if alreadyUsedPaths != nil { - if _, ok := alreadyUsedPaths[path]; ok { - // this was already added for generate to another image - return false - } - } - if nonImportPaths != nil { - if _, ok := nonImportPaths[path]; ok { - // this is a non-import in another image so it will be generated - // from another image - return false - } - } - // includeImports is set, this isn't a wkt, and it won't be generated in another image - if alreadyUsedPaths != nil { - // set as already used - alreadyUsedPaths[path] = struct{}{} - } - return true -} - -func sortImageModuleDependencies(imageModuleDependencies []ImageModuleDependency) { - sort.Slice(imageModuleDependencies, func(i, j int) bool { - return imageModuleDependencyLess(imageModuleDependencies[i], imageModuleDependencies[j]) - }) -} - -func imageModuleDependencyLess(a ImageModuleDependency, b ImageModuleDependency) bool { - return imageModuleDependencyCompareTo(a, b) < 0 -} - -// return -1 if less -// return 1 if greater -// return 0 if equal -func imageModuleDependencyCompareTo(a ImageModuleDependency, b ImageModuleDependency) int { - if a == nil && b == nil { - return 0 - } - if a == nil && b != nil { - return -1 - } - if a != nil && b == nil { - return 1 - } - aModuleIdentity := a.ModuleIdentity() - bModuleIdentity := b.ModuleIdentity() - if aModuleIdentity != nil || bModuleIdentity != nil { - if aModuleIdentity == nil && bModuleIdentity != nil { - return -1 - } - if aModuleIdentity != nil && bModuleIdentity == nil { - return 1 - } - if aModuleIdentity.Remote() < bModuleIdentity.Remote() { - return -1 - } - if aModuleIdentity.Remote() > bModuleIdentity.Remote() { - return 1 - } - if aModuleIdentity.Owner() < bModuleIdentity.Owner() { - return -1 - } - if aModuleIdentity.Owner() > bModuleIdentity.Owner() { - return 1 - } - if aModuleIdentity.Repository() < bModuleIdentity.Repository() { - return -1 - } - if aModuleIdentity.Repository() > bModuleIdentity.Repository() { - return 1 - } - } - if a.Commit() < b.Commit() { - return -1 - } - if a.Commit() > b.Commit() { - return 1 - } - if a.IsDirect() && !b.IsDirect() { - return -1 - } - if !a.IsDirect() && b.IsDirect() { - return 1 - } - return 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/validate.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/validate.go deleted file mode 100644 index 08cc510f3f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufimage/validate.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufimage - -import ( - "errors" - "fmt" - - imagev1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" -) - -// we validate the actual fields of the FileDescriptorProtos as part of newImageFile -func validateProtoImage(protoImage *imagev1.Image) error { - if protoImage == nil { - return errors.New("nil Image") - } - if len(protoImage.File) == 0 { - return errors.New("image contains no files") - } - for _, protoImageFile := range protoImage.File { - if err := validateProtoImageFile(protoImageFile); err != nil { - return err - } - } - return nil -} - -func validateProtoImageFile(protoImageFile *imagev1.ImageFile) error { - if protoImageFileExtension := protoImageFile.GetBufExtension(); protoImageFileExtension != nil { - lenDependencies := len(protoImageFile.GetDependency()) - for _, index := range protoImageFileExtension.GetUnusedDependency() { - if int(index) >= lenDependencies || int(index) < 0 { - return fmt.Errorf("unused dependency index %d is out of range", index) - } - } - if protoModuleInfo := protoImageFileExtension.GetModuleInfo(); protoModuleInfo != nil { - return validateProtoModuleInfo(protoModuleInfo) - } - } - return nil -} - -func validateProtoModuleInfo(protoModuleInfo *imagev1.ModuleInfo) error { - if protoModuleName := protoModuleInfo.GetName(); protoModuleName != nil { - return validateProtoModuleName(protoModuleInfo.Name) - } - return nil -} - -func validateProtoModuleName(protoModuleName *imagev1.ModuleName) error { - if protoModuleName.GetRemote() == "" { - return errors.New("empty ModuleName.Remote") - } - if protoModuleName.GetOwner() == "" { - return errors.New("empty ModuleName.Owner") - } - if protoModuleName.GetRepository() == "" { - return errors.New("empty ModuleName.Repository") - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/buflock.go b/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/buflock.go deleted file mode 100644 index 36467ea36a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/buflock.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package buflock manages the buf.lock lock file. -package buflock - -import ( - "context" - "strings" - "time" - - "github.com/bufbuild/buf/private/pkg/storage" -) - -const ( - // ExternalConfigFilePath defines the path to the lock file, relative to the root of the module. - ExternalConfigFilePath = "buf.lock" - // V1Version is the string used to identify the v1 version of the lock file. - V1Version = "v1" - // V1Beta1Version is the string used to identify the v1beta1 version of the lock file. - V1Beta1Version = "v1beta1" - // Header is the header prepended to any lock files. - Header = "# Generated by buf. DO NOT EDIT.\n" -) - -// Config holds the parsed lock file information. -type Config struct { - Dependencies []Dependency -} - -// Dependency describes a single pinned dependency. -type Dependency struct { - Remote string - Owner string - Repository string - Commit string - Digest string -} - -// ReadConfig reads the lock file at ExternalConfigFilePath relative -// to the root of the bucket. -func ReadConfig(ctx context.Context, readBucket storage.ReadBucket) (*Config, error) { - return readConfig(ctx, readBucket) -} - -// WriteConfig writes the lock file to the WriteBucket at ExternalConfigFilePath. -func WriteConfig(ctx context.Context, writeBucket storage.WriteBucket, config *Config) error { - return writeConfig(ctx, writeBucket, config) -} - -// ExternalConfigV1 represents the v1 lock file. -type ExternalConfigV1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Deps []ExternalConfigDependencyV1 `json:"deps,omitempty" yaml:"deps,omitempty"` -} - -// ExternalConfigV1Beta1 represents the v1beta1 lock file. -type ExternalConfigV1Beta1 struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Deps []ExternalConfigDependencyV1Beta1 `json:"deps,omitempty" yaml:"deps,omitempty"` -} - -// ExternalConfigDependencyV1 represents a single dependency within -// the v1 lock file. -type ExternalConfigDependencyV1 struct { - Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` - Owner string `json:"owner,omitempty" yaml:"owner,omitempty"` - Repository string `json:"repository,omitempty" yaml:"repository,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - CreateTime time.Time `json:"create_time,omitempty" yaml:"create_time,omitempty"` -} - -// DependencyForExternalConfigDependencyV1 returns the Dependency representation of a ExternalConfigDependencyV1. -func DependencyForExternalConfigDependencyV1(dep ExternalConfigDependencyV1) Dependency { - digest := dep.Digest - // Don't consume old b1/b3 buf digests. - if strings.HasPrefix(digest, "b1-") || strings.HasPrefix(digest, "b3-") { - digest = "" - } - return Dependency{ - Remote: dep.Remote, - Owner: dep.Owner, - Repository: dep.Repository, - Commit: dep.Commit, - Digest: digest, - } -} - -// ExternalConfigDependencyV1ForDependency returns the ExternalConfigDependencyV1 of a Dependency. -// -// Note, some fields will be their empty value since not all values are available on the Dependency. -func ExternalConfigDependencyV1ForDependency(dep Dependency) ExternalConfigDependencyV1 { - return ExternalConfigDependencyV1{ - Remote: dep.Remote, - Owner: dep.Owner, - Repository: dep.Repository, - Commit: dep.Commit, - Digest: dep.Digest, - } -} - -// ExternalConfigDependencyV1Beta1 represents a single dependency within -// the v1beta1 lock file. -type ExternalConfigDependencyV1Beta1 struct { - Remote string `json:"remote,omitempty" yaml:"remote,omitempty"` - Owner string `json:"owner,omitempty" yaml:"owner,omitempty"` - Repository string `json:"repository,omitempty" yaml:"repository,omitempty"` - Branch string `json:"branch,omitempty" yaml:"branch,omitempty"` - Commit string `json:"commit,omitempty" yaml:"commit,omitempty"` - Digest string `json:"digest,omitempty" yaml:"digest,omitempty"` - CreateTime time.Time `json:"create_time,omitempty" yaml:"create_time,omitempty"` -} - -// DependencyForExternalConfigDependencyV1Beta1 returns the Dependency representation of a ExternalConfigDependencyV1Beta1. -func DependencyForExternalConfigDependencyV1Beta1(dep ExternalConfigDependencyV1Beta1) Dependency { - return Dependency{ - Remote: dep.Remote, - Owner: dep.Owner, - Repository: dep.Repository, - Commit: dep.Commit, - Digest: "", // digests in v1Beta1 are not valid v1 digests - } -} - -// ExternalConfigDependencyV1Beta1ForDependency returns the ExternalConfigDependencyV1Beta1 of a Dependency. -// -// Note, some fields will be their empty value since not all values are available on the Dependency. -func ExternalConfigDependencyV1Beta1ForDependency(dep Dependency) ExternalConfigDependencyV1Beta1 { - return ExternalConfigDependencyV1Beta1{ - Remote: dep.Remote, - Owner: dep.Owner, - Repository: dep.Repository, - Commit: dep.Commit, - } -} - -// ExternalConfigVersion defines the subset of all lock -// file versions that is used to determine the version. -type ExternalConfigVersion struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/lock_file.go b/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/lock_file.go deleted file mode 100644 index acf99c7bb8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/lock_file.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buflock - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/storage" -) - -func readConfig(ctx context.Context, readBucket storage.ReadBucket) (_ *Config, retErr error) { - configBytes, err := storage.ReadPath(ctx, readBucket, ExternalConfigFilePath) - if err != nil { - if storage.IsNotExist(err) { - // If the lock file doesn't exist, just return no dependencies. - return &Config{}, nil - } - return nil, fmt.Errorf("failed to read lock file: %w", err) - } - var configVersion ExternalConfigVersion - if err := encoding.UnmarshalYAMLNonStrict(configBytes, &configVersion); err != nil { - return nil, fmt.Errorf("failed to decode lock file as YAML: %w", err) - } - switch configVersion.Version { - case "", V1Beta1Version: - var externalConfig ExternalConfigV1Beta1 - if err := encoding.UnmarshalYAMLStrict(configBytes, &externalConfig); err != nil { - return nil, fmt.Errorf("failed to unmarshal lock file at %s: %w", V1Beta1Version, err) - } - config := &Config{} - for _, dep := range externalConfig.Deps { - config.Dependencies = append(config.Dependencies, DependencyForExternalConfigDependencyV1Beta1(dep)) - } - return config, nil - case V1Version: - var externalConfig ExternalConfigV1 - if err := encoding.UnmarshalYAMLStrict(configBytes, &externalConfig); err != nil { - return nil, fmt.Errorf("failed to unmarshal lock file at %s: %w", V1Version, err) - } - config := &Config{} - for _, dep := range externalConfig.Deps { - config.Dependencies = append(config.Dependencies, DependencyForExternalConfigDependencyV1(dep)) - } - return config, nil - default: - return nil, fmt.Errorf("unknown lock file versions %q", configVersion.Version) - } -} - -func writeConfig(ctx context.Context, writeBucket storage.WriteBucket, config *Config) error { - externalConfig := ExternalConfigV1{ - Version: V1Version, - Deps: make([]ExternalConfigDependencyV1, 0, len(config.Dependencies)), - } - for _, dep := range config.Dependencies { - externalConfig.Deps = append(externalConfig.Deps, ExternalConfigDependencyV1ForDependency(dep)) - } - configBytes, err := encoding.MarshalYAML(&externalConfig) - if err != nil { - return fmt.Errorf("failed to marshal lock file: %w", err) - } - if err := storage.PutPath( - ctx, - writeBucket, - ExternalConfigFilePath, - append([]byte(Header), configBytes...), - ); err != nil { - return fmt.Errorf("failed to write lock file: %w", err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/usage.gen.go deleted file mode 100644 index 6b0a9316c7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/buflock/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buflock - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bucket.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bucket.go deleted file mode 100644 index 3d5fea5e43..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bucket.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmanifest - -import ( - "context" - - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemanifest" -) - -// NewReadBucketFromManifestBlobs builds a storage bucket from a manifest blob and a -// set of other blobs, provided in protobuf form. It makes sure that all blobs -// (including manifest) content match with their digest, and additionally checks -// that the blob set matches completely with the manifest paths (no missing nor -// extra blobs). This bucket is suitable for building or exporting. -func NewReadBucketFromManifestBlobs( - ctx context.Context, - manifestBlob *modulev1alpha1.Blob, - blobs []*modulev1alpha1.Blob, -) (storage.ReadBucket, error) { - parsedManifest, err := NewManifestFromProto(ctx, manifestBlob) - if err != nil { - return nil, err - } - blobSet, err := NewBlobSetFromProto(ctx, blobs) - if err != nil { - return nil, err - } - return storagemanifest.NewReadBucket( - parsedManifest, - blobSet, - storagemanifest.ReadBucketWithAllManifestBlobs(), - storagemanifest.ReadBucketWithNoExtraBlobs(), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bufmanifest.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bufmanifest.go deleted file mode 100644 index 8e9c296df8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/bufmanifest.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmanifest diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/mapper.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/mapper.go deleted file mode 100644 index f8d3685ec2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/mapper.go +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmanifest - -import ( - "context" - "fmt" - "io" - - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/manifest" - "go.uber.org/multierr" -) - -var ( - protoDigestTypeToDigestType = map[modulev1alpha1.DigestType]manifest.DigestType{ - modulev1alpha1.DigestType_DIGEST_TYPE_SHAKE256: manifest.DigestTypeShake256, - } - digestTypeToProtoDigestType = map[manifest.DigestType]modulev1alpha1.DigestType{ - manifest.DigestTypeShake256: modulev1alpha1.DigestType_DIGEST_TYPE_SHAKE256, - } -) - -// NewDigestFromProtoDigest maps a modulev1alpha1.Digest to a Digest. -func NewDigestFromProtoDigest(digest *modulev1alpha1.Digest) (*manifest.Digest, error) { - if digest == nil { - return nil, fmt.Errorf("nil digest") - } - dType, ok := protoDigestTypeToDigestType[digest.DigestType] - if !ok { - return nil, fmt.Errorf("unsupported digest kind: %s", digest.DigestType.String()) - } - return manifest.NewDigestFromBytes(dType, digest.Digest) -} - -// AsProtoBlob returns the passed blob as a proto module blob. -func AsProtoBlob(ctx context.Context, b manifest.Blob) (_ *modulev1alpha1.Blob, retErr error) { - digestType, ok := digestTypeToProtoDigestType[b.Digest().Type()] - if !ok { - return nil, fmt.Errorf("digest type %q not supported by module proto", b.Digest().Type()) - } - rc, err := b.Open(ctx) - if err != nil { - return nil, fmt.Errorf("cannot open blob: %w", err) - } - defer func() { - retErr = multierr.Append(retErr, rc.Close()) - }() - content, err := io.ReadAll(rc) - if err != nil { - return nil, fmt.Errorf("cannot read blob contents: %w", err) - } - return &modulev1alpha1.Blob{ - Digest: &modulev1alpha1.Digest{ - DigestType: digestType, - Digest: b.Digest().Bytes(), - }, - Content: content, - }, nil -} - -// NewManifestFromProto returns a Manifest from a proto module blob. It makes sure the -// digest and content matches. -func NewManifestFromProto(ctx context.Context, b *modulev1alpha1.Blob) (_ *manifest.Manifest, retErr error) { - blob, err := NewBlobFromProto(b) - if err != nil { - return nil, fmt.Errorf("invalid manifest: %w", err) - } - r, err := blob.Open(ctx) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, r.Close()) - }() - return manifest.NewFromReader(r) -} - -// NewBlobSetFromProto returns a BlobSet from a slice of proto module blobs. -// It makes sure the digest and content matches for each blob. -func NewBlobSetFromProto(ctx context.Context, blobs []*modulev1alpha1.Blob) (*manifest.BlobSet, error) { - var memBlobs []manifest.Blob - for i, modBlob := range blobs { - memBlob, err := NewBlobFromProto(modBlob) - if err != nil { - return nil, fmt.Errorf("invalid blob at index %d: %w", i, err) - } - memBlobs = append(memBlobs, memBlob) - } - return manifest.NewBlobSet(ctx, memBlobs) -} - -// NewBlobFromProto returns a Blob from a proto module blob. It makes sure the -// digest and content matches. -func NewBlobFromProto(b *modulev1alpha1.Blob) (manifest.Blob, error) { - if b == nil { - return nil, fmt.Errorf("nil blob") - } - digest, err := NewDigestFromProtoDigest(b.Digest) - if err != nil { - return nil, fmt.Errorf("digest from proto digest: %w", err) - } - memBlob, err := manifest.NewMemoryBlob( - *digest, - b.Content, - manifest.MemoryBlobWithDigestValidation(), - ) - if err != nil { - return nil, fmt.Errorf("new memory blob: %w", err) - } - return memBlob, nil -} - -// ToProtoManifestAndBlobs converts a Manifest and BlobSet to the protobuf types. -func ToProtoManifestAndBlobs(ctx context.Context, manifest *manifest.Manifest, blobs *manifest.BlobSet) (*modulev1alpha1.Blob, []*modulev1alpha1.Blob, error) { - manifestBlob, err := manifest.Blob() - if err != nil { - return nil, nil, err - } - manifestProtoBlob, err := AsProtoBlob(ctx, manifestBlob) - if err != nil { - return nil, nil, err - } - filesBlobs := blobs.Blobs() - filesProtoBlobs := make([]*modulev1alpha1.Blob, len(filesBlobs)) - for i, b := range filesBlobs { - pb, err := AsProtoBlob(ctx, b) - if err != nil { - return nil, nil, err - } - filesProtoBlobs[i] = pb - } - return manifestProtoBlob, filesProtoBlobs, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/usage.gen.go deleted file mode 100644 index 46b4e92eab..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmanifest/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmanifest - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodule.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodule.go deleted file mode 100644 index c7a0b5162d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodule.go +++ /dev/null @@ -1,566 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - "crypto/sha256" - "encoding/base64" - "fmt" - "io" - - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - breakingv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1" - lintv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" -) - -const ( - // DefaultDocumentationPath defines the default path to the documentation file, relative to the root of the module. - DefaultDocumentationPath = "buf.md" - // LicenseFilePath defines the path to the license file, relative to the root of the module. - LicenseFilePath = "LICENSE" - - // b3DigestPrefix is the digest prefix for the third version of the digest function. - // - // It is used by the CLI cache and intended to eventually replace b1 entirely. - b3DigestPrefix = "b3" -) - -var ( - // AllDocumentationPaths defines all possible paths to the documentation file, relative to the root of the module. - AllDocumentationPaths = []string{ - DefaultDocumentationPath, - "README.md", - "README.markdown", - } -) - -// ModuleFile is a module file. -type ModuleFile interface { - bufmoduleref.FileInfo - io.ReadCloser - - isModuleFile() -} - -// Module is a Protobuf module. -// -// It contains the files for the sources, and the dependency names. -// -// Terminology: -// -// Targets (Modules and ModuleFileSets): -// -// Just the files specified to build. This will either be sources, or will be specific files -// within sources, ie this is a subset of Sources. The difference between Targets and Sources happens -// when i.e. the --path flag is used. -// -// Sources (Modules and ModuleFileSets): -// -// The files with no dependencies. This is a superset of Targets and subset of All. -// -// All (ModuleFileSets only): -// -// All files including dependencies. This is a superset of Sources. -type Module interface { - // TargetFileInfos gets all FileInfos specified as target files. This is either - // all the FileInfos belonging to the module, or those specified by ModuleWithTargetPaths(). - // - // It does not include dependencies. - // - // The returned TargetFileInfos are sorted by path. - TargetFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) - // SourceFileInfos gets all FileInfos belonging to the module. - // - // It does not include dependencies. - // - // The returned SourceFileInfos are sorted by path. - SourceFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) - // GetModuleFile gets the source file for the given path. - // - // Returns storage.IsNotExist error if the file does not exist. - GetModuleFile(ctx context.Context, path string) (ModuleFile, error) - // DeclaredDirectDependencies returns the direct dependencies declared in the configuration file. - // - // The returned ModuleReferences are sorted by remote, owner, repository, and reference (if - // present). The returned ModulePins are unique by remote, owner, repository. - // - // This does not include any transitive dependencies, but if the declarations are correct, - // this should be a subset of the dependencies from DependencyModulePins. - // - // TODO: validate that this is a subset? This may mess up construction. - DeclaredDirectDependencies() []bufmoduleref.ModuleReference - // DependencyModulePins gets the dependency ModulePins. - // - // The returned ModulePins are sorted by remote, owner, repository, branch, commit, and then digest. - // The returned ModulePins are unique by remote, owner, repository. - // - // This includes all transitive dependencies. - DependencyModulePins() []bufmoduleref.ModulePin - // Documentation gets the contents of the module documentation file, buf.md and returns the string representation. - // This may return an empty string if the documentation file does not exist. - Documentation() string - // DocumentationPath returns the path to the documentation file for the module. - // Can be one of `buf.md`, `README.md` or `README.markdown` - DocumentationPath() string - // License gets the contents of the module license file, LICENSE and returns the string representation. - // This may return an empty string if the documentation file does not exist. - License() string - // BreakingConfig returns the breaking change check configuration set for the module. - // - // This may be nil, since older versions of the module would not have this stored. - BreakingConfig() *bufbreakingconfig.Config - // LintConfig returns the lint check configuration set for the module. - // - // This may be nil, since older versions of the module would not have this stored. - LintConfig() *buflintconfig.Config - // Manifest returns the manifest for the module (possibly nil). - // A manifest's contents contain a lexicographically sorted list of path names along - // with each path's digest. The manifest also stores a digest of its own contents which - // allows verification of the entire Buf module. In addition to the .proto files in - // the module, it also lists the buf.yaml, LICENSE, buf.md, and buf.lock files (if - // present). - Manifest() *manifest.Manifest - // BlobSet returns the raw data for the module (possibly nil). - // Each blob in the blob set is indexed by the digest of the blob's contents. For - // example, the buf.yaml file will be listed in the Manifest with a given digest, - // whose contents can be retrieved by looking up the corresponding digest in the - // blob set. This allows API consumers to get access to the original file contents - // of every file in the module, which is useful for caching or recreating a module's - // original files. - BlobSet() *manifest.BlobSet - - getSourceReadBucket() storage.ReadBucket - // ModuleIdentity returns the ModuleIdentity for the Module, if it was - // provided at construction time via ModuleWithModuleIdentity or ModuleWithModuleIdentityAndCommit. - // - // Note this *can* be nil if we did not build from a named module. - // All code must assume this can be nil. - // nil checking should work since the backing type is always a pointer. - ModuleIdentity() bufmoduleref.ModuleIdentity - // Commit returns the commit for the Module, if it was - // provided at construction time via ModuleWithModuleIdentityAndCommit. - - // Note this can be empty. - // This will only be set if ModuleIdentity is set. but may not be set - // even if ModuleIdentity is set, that is commit is optional information - // even if we know what module this file came from. - Commit() string - isModule() -} - -// ModuleOption is used to construct Modules. -type ModuleOption func(*module) - -// ModuleWithModuleIdentity is used to construct a Module with a ModuleIdentity. -func ModuleWithModuleIdentity(moduleIdentity bufmoduleref.ModuleIdentity) ModuleOption { - return func(module *module) { - module.moduleIdentity = moduleIdentity - } -} - -// ModuleWithModuleIdentityAndCommit is used to construct a Module with a ModuleIdentity and commit. -// -// If the moduleIdentity is nil, the commit must be empty, that is it is not valid to have -// a non-empty commit and a nil moduleIdentity. -func ModuleWithModuleIdentityAndCommit(moduleIdentity bufmoduleref.ModuleIdentity, commit string) ModuleOption { - return func(module *module) { - module.moduleIdentity = moduleIdentity - module.commit = commit - } -} - -// NewModuleForBucket returns a new Module. It attempts to read dependencies -// from a lock file in the read bucket. -func NewModuleForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - options ...ModuleOption, -) (Module, error) { - return newModuleForBucket(ctx, readBucket, options...) -} - -// NewModuleForProto returns a new Module for the given proto Module. -func NewModuleForProto( - ctx context.Context, - protoModule *modulev1alpha1.Module, - options ...ModuleOption, -) (Module, error) { - return newModuleForProto(ctx, protoModule, options...) -} - -// NewModuleForManifestAndBlobSet returns a new Module given the manifest and blob set. -func NewModuleForManifestAndBlobSet( - ctx context.Context, - manifest *manifest.Manifest, - blobSet *manifest.BlobSet, - options ...ModuleOption, -) (Module, error) { - return newModuleForManifestAndBlobSet(ctx, manifest, blobSet, options...) -} - -// ModuleWithTargetPaths returns a new Module that specifies specific file or directory paths to build. -// -// These paths must exist. -// These paths must be relative to the roots. -// These paths will be normalized and validated. -// These paths must be unique when normalized and validated. -// Multiple calls to this option will override previous calls. -// -// Note that this will result in TargetFileInfos containing only these paths, and not -// any imports. Imports, and non-targeted files, are still available via SourceFileInfos. -func ModuleWithTargetPaths( - module Module, - targetPaths []string, - excludePaths []string, -) (Module, error) { - return newTargetingModule(module, targetPaths, excludePaths, false) -} - -// ModuleWithTargetPathsAllowNotExist returns a new Module specifies specific file or directory paths to build, -// but allows the specified paths to not exist. -// -// Note that this will result in TargetFileInfos containing only these paths, and not -// any imports. Imports, and non-targeted files, are still available via SourceFileInfos. -func ModuleWithTargetPathsAllowNotExist( - module Module, - targetPaths []string, - excludePaths []string, -) (Module, error) { - return newTargetingModule(module, targetPaths, excludePaths, true) -} - -// ModuleWithExcludePaths returns a new Module that excludes specific file or directory -// paths to build. -// -// Note that this will result in TargetFileInfos containing only the paths that have not been -// excluded and any imports. Imports are still available via SourceFileInfos. -func ModuleWithExcludePaths( - module Module, - excludePaths []string, -) (Module, error) { - return newTargetingModule(module, nil, excludePaths, false) -} - -// ModuleWithExcludePathsAllowNotExist returns a new Module that excludes specific file or -// directory paths to build, but allows the specified paths to not exist. -// -// Note that this will result in TargetFileInfos containing only these paths, and not -// any imports. Imports, and non-targeted files, are still available via SourceFileInfos. -func ModuleWithExcludePathsAllowNotExist( - module Module, - excludePaths []string, -) (Module, error) { - return newTargetingModule(module, nil, excludePaths, true) -} - -// ModuleResolver resolves modules. -type ModuleResolver interface { - // GetModulePin resolves the provided ModuleReference to a ModulePin. - // - // Returns an error that fufills storage.IsNotExist if the named Module does not exist. - GetModulePin(ctx context.Context, moduleReference bufmoduleref.ModuleReference) (bufmoduleref.ModulePin, error) -} - -// NewNopModuleResolver returns a new ModuleResolver that always returns a storage.IsNotExist error. -func NewNopModuleResolver() ModuleResolver { - return newNopModuleResolver() -} - -// ModuleReader reads resolved modules. -type ModuleReader interface { - // GetModule gets the Module for the ModulePin. - // - // Returns an error that fulfills storage.IsNotExist if the Module does not exist. - GetModule(ctx context.Context, modulePin bufmoduleref.ModulePin) (Module, error) -} - -// NewNopModuleReader returns a new ModuleReader that always returns a storage.IsNotExist error. -func NewNopModuleReader() ModuleReader { - return newNopModuleReader() -} - -// ModuleFileSet is a Protobuf module file set. -// -// It contains the files for both targets, sources and dependencies. -// -// TODO: we should not have ModuleFileSet inherit from Module, this is confusing -type ModuleFileSet interface { - // Note that GetModuleFile will pull from All files instead of just Source Files! - Module - // AllFileInfos gets all FileInfos associated with the module, including dependencies. - // - // The returned FileInfos are sorted by path. - AllFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) - - isModuleFileSet() -} - -// NewModuleFileSet returns a new ModuleFileSet. -func NewModuleFileSet( - module Module, - dependencies []Module, -) ModuleFileSet { - return newModuleFileSet(module, dependencies) -} - -// Workspace represents a workspace. -// -// It is guaranteed that all Modules within this workspace have no overlapping file paths. -type Workspace interface { - // GetModule gets the module identified by the given ModuleIdentity. - // - GetModule(moduleIdentity bufmoduleref.ModuleIdentity) (Module, bool) - // GetModules returns all of the modules found in the workspace. - GetModules() []Module -} - -// NewWorkspace returns a new module workspace. -// -// The Context is not retained, and is only used for validation during construction. -func NewWorkspace( - ctx context.Context, - namedModules map[string]Module, - allModules []Module, -) (Workspace, error) { - return newWorkspace( - ctx, - namedModules, - allModules, - ) -} - -// ModuleToProtoModule converts the Module to a proto Module. -// -// This takes all Sources and puts them in the Module, not just Targets. -func ModuleToProtoModule(ctx context.Context, module Module) (*modulev1alpha1.Module, error) { - // these are returned sorted, so there is no need to sort - // the resulting protoModuleFiles afterwards - sourceFileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return nil, err - } - protoModuleFiles := make([]*modulev1alpha1.ModuleFile, len(sourceFileInfos)) - for i, sourceFileInfo := range sourceFileInfos { - protoModuleFile, err := moduleFileToProto(ctx, module, sourceFileInfo.Path()) - if err != nil { - return nil, err - } - protoModuleFiles[i] = protoModuleFile - } - // these are returned sorted, so there is no need to sort - // the resulting protoModuleNames afterwards - dependencyModulePins := module.DependencyModulePins() - protoModulePins := make([]*modulev1alpha1.ModulePin, len(dependencyModulePins)) - for i, dependencyModulePin := range dependencyModulePins { - protoModulePins[i] = bufmoduleref.NewProtoModulePinForModulePin(dependencyModulePin) - } - var protoBreakingConfig *breakingv1.Config - if module.BreakingConfig() != nil { - protoBreakingConfig = bufbreakingconfig.ProtoForConfig(module.BreakingConfig()) - } - var protoLintConfig *lintv1.Config - if module.LintConfig() != nil { - protoLintConfig = buflintconfig.ProtoForConfig(module.LintConfig()) - } - protoModule := &modulev1alpha1.Module{ - Files: protoModuleFiles, - Dependencies: protoModulePins, - Documentation: module.Documentation(), - DocumentationPath: module.DocumentationPath(), - BreakingConfig: protoBreakingConfig, - LintConfig: protoLintConfig, - License: module.License(), - } - if err := ValidateProtoModule(protoModule); err != nil { - return nil, err - } - return protoModule, nil -} - -// ModuleDigestB3 returns the b3 digest for the Module. -// -// To create the module digest (SHA256): -// 1. For every file in the module (sorted lexicographically by path): -// a. Add the file path -// b. Add the file contents -// 2. Add the dependency's module identity and commit ID (sorted lexicographically by commit ID) -// 3. Add the module identity if available. -// 4. Add the module documentation if available. -// 5. Add the module documentation path if available. -// 6. Add the module license if available. -// 7. Add the breaking and lint configurations if available. -// 8. Produce the final digest by URL-base64 encoding the summed bytes and prefixing it with the digest prefix -func ModuleDigestB3(ctx context.Context, module Module) (string, error) { - hash := sha256.New() - // We do not want to change the sort order as the rest of the codebase relies on it, - // but we only want to use commit as part of the sort order, so we make a copy of - // the slice and sort it by commit - for _, dependencyModulePin := range copyModulePinsSortedByOnlyCommit(module.DependencyModulePins()) { - if _, err := hash.Write([]byte(dependencyModulePin.IdentityString() + ":" + dependencyModulePin.Commit())); err != nil { - return "", err - } - } - sourceFileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return "", err - } - for _, sourceFileInfo := range sourceFileInfos { - if _, err := hash.Write([]byte(sourceFileInfo.Path())); err != nil { - return "", err - } - moduleFile, err := module.GetModuleFile(ctx, sourceFileInfo.Path()) - if err != nil { - return "", err - } - if _, err := io.Copy(hash, moduleFile); err != nil { - return "", multierr.Append(err, moduleFile.Close()) - } - if err := moduleFile.Close(); err != nil { - return "", err - } - } - if moduleIdentity := module.ModuleIdentity(); moduleIdentity != nil { - if _, err := hash.Write([]byte(moduleIdentity.IdentityString())); err != nil { - return "", err - } - } - if docs := module.Documentation(); docs != "" { - if _, err := hash.Write([]byte(docs)); err != nil { - return "", err - } - } - if docPath := module.DocumentationPath(); docPath != "" && docPath != DefaultDocumentationPath { - if _, err := hash.Write([]byte(docPath)); err != nil { - return "", err - } - } - if license := module.License(); license != "" { - if _, err := hash.Write([]byte(license)); err != nil { - return "", err - } - } - if breakingConfig := module.BreakingConfig(); breakingConfig != nil { - breakingConfigBytes, err := bufbreakingconfig.BytesForConfig(breakingConfig) - if err != nil { - return "", err - } - if _, err := hash.Write(breakingConfigBytes); err != nil { - return "", err - } - } - if lintConfig := module.LintConfig(); lintConfig != nil { - lintConfigBytes, err := buflintconfig.BytesForConfig(lintConfig) - if err != nil { - return "", err - } - if _, err := hash.Write(lintConfigBytes); err != nil { - return "", err - } - } - return fmt.Sprintf("%s-%s", b3DigestPrefix, base64.URLEncoding.EncodeToString(hash.Sum(nil))), nil -} - -// ModuleToBucket writes the given Module to the WriteBucket. -// -// This writes the sources and the buf.lock file. -// This copies external paths if the WriteBucket supports setting of external paths. -func ModuleToBucket( - ctx context.Context, - module Module, - writeBucket storage.WriteBucket, -) error { - fileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return err - } - for _, fileInfo := range fileInfos { - if err := putModuleFileToBucket(ctx, module, fileInfo.Path(), writeBucket); err != nil { - return err - } - } - if docs := module.Documentation(); docs != "" { - moduleDocPath := DefaultDocumentationPath - if docPath := module.DocumentationPath(); docPath != "" { - moduleDocPath = docPath - } - if err := storage.PutPath(ctx, writeBucket, moduleDocPath, []byte(docs)); err != nil { - return err - } - } - if license := module.License(); license != "" { - if err := storage.PutPath(ctx, writeBucket, LicenseFilePath, []byte(license)); err != nil { - return err - } - } - if err := bufmoduleref.PutDependencyModulePinsToBucket(ctx, writeBucket, module.DependencyModulePins()); err != nil { - return err - } - // This is the default version created by bufconfig getters. The versions should be the - // same across lint and breaking configs. - version := bufconfig.V1Version - var breakingConfigVersion string - if module.BreakingConfig() != nil { - breakingConfigVersion = module.BreakingConfig().Version - } - var lintConfigVersion string - if module.LintConfig() != nil { - lintConfigVersion = module.LintConfig().Version - } - // If one of either breaking or lint config is non-nil, then other config will also be non-nil, - // even if a module does not set both configurations. An empty with the correct version - // will be set by the configuration getters. - if breakingConfigVersion != lintConfigVersion { - return fmt.Errorf("breaking config version %q does not match lint config version %q", breakingConfigVersion, lintConfigVersion) - } - if breakingConfigVersion != "" || lintConfigVersion != "" { - version = breakingConfigVersion - } - writeConfigOptions := []bufconfig.WriteConfigOption{ - bufconfig.WriteConfigWithModuleIdentity(module.ModuleIdentity()), - bufconfig.WriteConfigWithBreakingConfig(module.BreakingConfig()), - bufconfig.WriteConfigWithLintConfig(module.LintConfig()), - bufconfig.WriteConfigWithVersion(version), - } - return bufconfig.WriteConfig(ctx, writeBucket, writeConfigOptions...) -} - -// TargetModuleFilesToBucket writes the target files of the given Module to the WriteBucket. -// -// This does not write the buf.lock file. -// This copies external paths if the WriteBucket supports setting of external paths. -func TargetModuleFilesToBucket( - ctx context.Context, - module Module, - writeBucket storage.WriteBucket, -) error { - fileInfos, err := module.TargetFileInfos(ctx) - if err != nil { - return err - } - for _, fileInfo := range fileInfos { - if err := putModuleFileToBucket(ctx, module, fileInfo.Path(), writeBucket); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/bufmodulebuild.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/bufmodulebuild.go deleted file mode 100644 index 88282d307f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/bufmodulebuild.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulebuild - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -// ModuleFileSetBuilder builds ModuleFileSets from Modules. -type ModuleFileSetBuilder interface { - Build( - ctx context.Context, - module bufmodule.Module, - options ...BuildModuleFileSetOption, - ) (bufmodule.ModuleFileSet, error) -} - -// NewModuleFileSetBuilder returns a new ModuleSetProvider. -func NewModuleFileSetBuilder( - logger *zap.Logger, - moduleReader bufmodule.ModuleReader, -) ModuleFileSetBuilder { - return newModuleFileSetBuilder(logger, moduleReader) -} - -// BuildModuleFileSetOption is an option for Build. -type BuildModuleFileSetOption func(*buildModuleFileSetOptions) - -// WithWorkspace returns a new BuildModuleFileSetOption that specifies a workspace. -func WithWorkspace(workspace bufmodule.Workspace) BuildModuleFileSetOption { - return func(buildModuleFileSetOptions *buildModuleFileSetOptions) { - buildModuleFileSetOptions.workspace = workspace - } -} - -// BuiltModule ties a bufmodule.Module with the configuration and a bucket -// containing just the files required to build it. -type BuiltModule struct { - bufmodule.Module - Bucket storage.ReadBucket -} - -// ModuleBucketBuilder builds modules for buckets. -type ModuleBucketBuilder interface { - // BuildForBucket constructs a minimal bucket from the passed readBucket and - // builds a module from it. - // - // config's value is used even if the bucket contains configuration (buf.yaml). - // This means the module is built differently than described in storage, which - // may cause building to fail or succeed when it shouldn't. For your own - // sanity, you should pass a config value read from the provided bucket. - // - // TODO: why do we pass a config here?! This parameter should be removed. - BuildForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - config *bufmoduleconfig.Config, - options ...BuildOption, - ) (*BuiltModule, error) -} - -// NewModuleBucketBuilder returns a new BucketBuilder. -func NewModuleBucketBuilder() ModuleBucketBuilder { - return newModuleBucketBuilder() -} - -// ModuleIncludeBuilder builds modules for includes. -// -// This is used for protoc. -type ModuleIncludeBuilder interface { - // BuildForIncludes builds a module for the given includes and file paths. - BuildForIncludes( - ctx context.Context, - includeDirPaths []string, - options ...BuildOption, - ) (bufmodule.Module, error) -} - -// NewModuleIncludeBuilder returns a new ModuleIncludeBuilder. -// -// TODO: we should parse includeDirPaths for modules as well in theory -// would be nice to be able to do buf alpha protoc -I path/to/dir -I buf.build/foo/bar/v1 -func NewModuleIncludeBuilder( - logger *zap.Logger, - storageosProvider storageos.Provider, -) ModuleIncludeBuilder { - return newModuleIncludeBuilder(logger, storageosProvider) -} - -// BuildOption is an option for BuildForBucket. -type BuildOption func(*buildOptions) - -// WithPaths returns a new BuildOption that specifies specific file or directory paths to build. -// -// These paths must exist. -// These paths must be relative to the bucket or include directory paths. -// These paths will be normalized. -// Multiple calls to this option and WithPathsAllowNotExist will override previous calls. -// -// This results in ModuleWithTargetPaths being used on the resulting build module. -// This is done within bufmodulebuild so we can resolve the paths relative to their roots. -func WithPaths(paths []string) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.paths = &paths - } -} - -// WithPathsAllowNotExist returns a new BuildOption that specifies specific file or directory paths to build, -// but allows the specified paths to not exist. -// -// These paths must exist. -// These paths must be relative to the bucket or include directory paths. -// These paths will be normalized. -// Multiple calls to this option and WithPaths will override previous calls. -// -// This results in ModuleWithPathsAllowNotExist being used on the resulting build module. -// This is done within bufmodulebuild so we can resolve the paths relative to their roots. -func WithPathsAllowNotExist(paths []string) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.paths = &paths - buildOptions.pathsAllowNotExist = true - } -} - -// WithModuleIdentity returns a new BuildOption that is used to construct a Module with a ModuleIdentity. -// -// TODO: this is never called -// TODO: we also have ModuleWithModuleIdentityAndCommit in bufmodule -// We need to disambiguate module building between bufmodule and bufmodulebuild -// bufimage and bufimagebuild work, but bufmodule and bufmodulebuild are a mess -func WithModuleIdentity(moduleIdentity bufmoduleref.ModuleIdentity) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.moduleIdentity = moduleIdentity - } -} - -// WithExcludePaths returns a new BuildOption that specifies files to be excluded from the build. -func WithExcludePaths(excludePaths []string) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.excludePaths = excludePaths - } -} - -// WithExcludePathsAllowNotExist returns a new BuildOption that specifies files to be excluded from the build, -// but allows the specified paths to not exist. -func WithExcludePathsAllowNotExist(excludePaths []string) BuildOption { - return func(buildOptions *buildOptions) { - buildOptions.excludePaths = excludePaths - buildOptions.pathsAllowNotExist = true - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_bucket_builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_bucket_builder.go deleted file mode 100644 index ee8a4812c9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_bucket_builder.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulebuild - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/buflock" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" -) - -type moduleBucketBuilder struct { -} - -func newModuleBucketBuilder() *moduleBucketBuilder { - return &moduleBucketBuilder{} -} - -func (b *moduleBucketBuilder) BuildForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - config *bufmoduleconfig.Config, - options ...BuildOption, -) (*BuiltModule, error) { - buildOptions := &buildOptions{} - for _, option := range options { - option(buildOptions) - } - return b.buildForBucket( - ctx, - readBucket, - config, - buildOptions, - ) -} - -func (b *moduleBucketBuilder) buildForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - config *bufmoduleconfig.Config, - buildOptions *buildOptions, -) (*BuiltModule, error) { - // proxy plain files - externalPaths := []string{ - buflock.ExternalConfigFilePath, - bufmodule.LicenseFilePath, - } - externalPaths = append(externalPaths, bufconfig.AllConfigFilePaths...) - rootBuckets := make([]storage.ReadBucket, 0, len(externalPaths)+1) - for _, docPath := range bufmodule.AllDocumentationPaths { - bucket, err := getFileReadBucket(ctx, readBucket, docPath) - if err != nil { - return nil, err - } - if bucket != nil { - rootBuckets = append(rootBuckets, bucket) - break - } - } - for _, path := range externalPaths { - bucket, err := getFileReadBucket(ctx, readBucket, path) - if err != nil { - return nil, err - } - if bucket != nil { - rootBuckets = append(rootBuckets, bucket) - } - } - - roots := make([]string, 0, len(config.RootToExcludes)) - for root, excludes := range config.RootToExcludes { - roots = append(roots, root) - mappers := []storage.Mapper{ - // need to do match extension here - // https://github.com/bufbuild/buf/issues/113 - storage.MatchPathExt(".proto"), - storage.MapOnPrefix(root), - } - if len(excludes) != 0 { - var notOrMatchers []storage.Matcher - for _, exclude := range excludes { - notOrMatchers = append( - notOrMatchers, - storage.MatchPathContained(exclude), - ) - } - mappers = append( - mappers, - storage.MatchNot( - storage.MatchOr( - notOrMatchers..., - ), - ), - ) - } - rootBuckets = append( - rootBuckets, - storage.MapReadBucket( - readBucket, - mappers..., - ), - ) - } - bucket := storage.MultiReadBucket(rootBuckets...) - module, err := bufmodule.NewModuleForBucket( - ctx, - bucket, - bufmodule.ModuleWithModuleIdentity( - buildOptions.moduleIdentity, // This may be nil - ), - ) - if err != nil { - return nil, err - } - appliedModule, err := applyModulePaths( - module, - roots, - buildOptions.paths, - buildOptions.excludePaths, - buildOptions.pathsAllowNotExist, - normalpath.Relative, - ) - if err != nil { - return nil, err - } - return &BuiltModule{ - Module: appliedModule, - Bucket: bucket, - }, nil -} - -// may return nil. -func getFileReadBucket( - ctx context.Context, - readBucket storage.ReadBucket, - filePath string, -) (storage.ReadBucket, error) { - fileData, err := storage.ReadPath(ctx, readBucket, filePath) - if err != nil { - if storage.IsNotExist(err) { - return nil, nil - } - return nil, err - } - if len(fileData) == 0 { - return nil, nil - } - return storagemem.NewReadBucket( - map[string][]byte{ - filePath: fileData, - }, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_file_set_builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_file_set_builder.go deleted file mode 100644 index 19bba2d110..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_file_set_builder.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulebuild - -import ( - "context" - "encoding/hex" - "errors" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "go.uber.org/zap" - "golang.org/x/crypto/sha3" -) - -type moduleFileSetBuilder struct { - logger *zap.Logger - moduleReader bufmodule.ModuleReader -} - -func newModuleFileSetBuilder( - logger *zap.Logger, - moduleReader bufmodule.ModuleReader, -) *moduleFileSetBuilder { - return &moduleFileSetBuilder{ - logger: logger, - moduleReader: moduleReader, - } -} -func (m *moduleFileSetBuilder) Build( - ctx context.Context, - module bufmodule.Module, - options ...BuildModuleFileSetOption, -) (bufmodule.ModuleFileSet, error) { - buildModuleFileSetOptions := &buildModuleFileSetOptions{} - for _, option := range options { - option(buildModuleFileSetOptions) - } - return m.build( - ctx, - module, - buildModuleFileSetOptions.workspace, - ) -} - -func (m *moduleFileSetBuilder) build( - ctx context.Context, - module bufmodule.Module, - workspace bufmodule.Workspace, -) (bufmodule.ModuleFileSet, error) { - var dependencyModules []bufmodule.Module - hashes := make(map[string]struct{}) - moduleHash, err := protoPathsHash(ctx, module) - if err != nil { - return nil, err - } - hashes[moduleHash] = struct{}{} - if workspace != nil { - // From the perspective of the ModuleFileSet, we include all of the files - // specified in the workspace. When we build the Image from the ModuleFileSet, - // we construct it based on the TargetFileInfos, and thus only include the files - // in the transitive closure. - // - // This is defensible as we're saying that everything in the workspace is a potential - // dependency, even if some are not actual dependencies of this specific module. In this - // case, the extra modules are no different than unused dependencies in a buf.yaml/buf.lock. - // - // By including all the Modules from the workspace, we are potentially including the input - // Module itself. This is bad, and will result in errors when using the result ModuleFileSet. - // The ModuleFileSet expects a Module, and its dependency Modules, but it is not OK for - // a Module to both be the input Module and a dependency Module. We have no concept - // of Module "ID" - a Module may have a ModuleIdentity and commit associated with it, - // but there is no guarantee of this. To get around this, we do a hash of the .proto file - // paths within a Module, and say that Modules are equivalent if they contain the exact - // same .proto file paths. If they have the same .proto file paths, then we do not - // add the Module as a dependency. - // - // We know from bufmodule.Workspace that no two Modules in a Workspace will have overlapping - // file paths, therefore if the Module is in the Workspace and has equivalent file paths, - // we know that it must be the same module. If the Module is not in the workspace...why - // did we provide a workspace? - // - // We could use other methods for equivalence or to say "do not add": - // - // - If there are any overlapping files: for example, one module has a.proto, one module - // has b.proto, and both have c.proto. We don't use this heuristic as what we are looking - // for here is a situation where based on our Module construction, we have two actually-equivalent - // Modules. The existence of any overlapping files will result in an error during build, which - // is what we want. This would also indicate this Module did not come from the Workspace, given - // the property of file uniqueness in Workspaces. - // - Golang object equivalence: for example, doing "module != potentialDependencyModule". This - // happens to work since we only construct Modules once, but it's error-prone: it's totally - // possible to create two Module objects from the same source, and if they represent the - // same Module on disk/in the BSR, we don't want to include these as duplicates. - // - Full module digest and/or proto file content: We could include buf.yaml, buf.lock, - // README.md, etc, and also hash the actual content of the .proto files, but we're saying - // that this doesn't help us any more than just comparing .proto files, and may lead to - // false negatives. However, this is the most likely candidate as an alternative, as you - // could argue that at the ModuleFileSetBuilder level, we should say "assume any difference - // is a real difference". - // - // We could also determine which modules could be omitted here, but it would incur - // the cost of parsing the target files and detecting exactly which imports are - // used. We already get this for free in Image construction, so it's simplest and - // most efficient to bundle all of the modules together like so. - for _, potentialDependencyModule := range workspace.GetModules() { - potentialDependencyModuleHash, err := protoPathsHash(ctx, potentialDependencyModule) - if err != nil { - return nil, err - } - if _, ok := hashes[potentialDependencyModuleHash]; !ok { - dependencyModules = append(dependencyModules, potentialDependencyModule) - } else { - hashes[potentialDependencyModuleHash] = struct{}{} - } - } - } - // We know these are unique by remote, owner, repository and - // contain all transitive dependencies. - for _, dependencyModulePin := range module.DependencyModulePins() { - if workspace != nil { - if _, ok := workspace.GetModule(dependencyModulePin); ok { - // This dependency is already provided by the workspace, so we don't - // need to consult the ModuleReader. - continue - } - } - dependencyModule, err := m.moduleReader.GetModule(ctx, dependencyModulePin) - if err != nil { - return nil, err - } - dependencyModuleHash, err := protoPathsHash(ctx, dependencyModule) - if err != nil { - return nil, err - } - // At this point, this is really just a safety check. - if _, ok := hashes[dependencyModuleHash]; ok { - return nil, errors.New("module declared in DependencyModulePins but not in workspace was already added to the dependency Module set, this is a system error") - } - dependencyModules = append(dependencyModules, dependencyModule) - hashes[dependencyModuleHash] = struct{}{} - } - return bufmodule.NewModuleFileSet(module, dependencyModules), nil -} - -// protoPathsHash returns a hash representing the paths of the .proto files within the Module. -func protoPathsHash(ctx context.Context, module bufmodule.Module) (string, error) { - fileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return "", err - } - shakeHash := sha3.NewShake256() - for _, fileInfo := range fileInfos { - _, err := shakeHash.Write([]byte(fileInfo.Path())) - if err != nil { - return "", err - } - } - data := make([]byte, 64) - if _, err := shakeHash.Read(data); err != nil { - return "", err - } - return hex.EncodeToString(data), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_include_builder.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_include_builder.go deleted file mode 100644 index d96c979c71..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/module_include_builder.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulebuild - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -type moduleIncludeBuilder struct { - logger *zap.Logger - storageosProvider storageos.Provider -} - -func newModuleIncludeBuilder( - logger *zap.Logger, - storageosProvider storageos.Provider, -) *moduleIncludeBuilder { - return &moduleIncludeBuilder{ - logger: logger, - storageosProvider: storageosProvider, - } -} - -func (b *moduleIncludeBuilder) BuildForIncludes( - ctx context.Context, - includeDirPaths []string, - options ...BuildOption, -) (bufmodule.Module, error) { - buildOptions := &buildOptions{} - for _, option := range options { - option(buildOptions) - } - return b.buildForIncludes( - ctx, - includeDirPaths, - buildOptions.paths, - buildOptions.pathsAllowNotExist, - ) -} - -func (b *moduleIncludeBuilder) buildForIncludes( - ctx context.Context, - includeDirPaths []string, - fileOrDirPaths *[]string, - fileOrDirPathsAllowNotExist bool, -) (bufmodule.Module, error) { - if len(includeDirPaths) == 0 { - includeDirPaths = []string{"."} - } - absIncludeDirPaths, err := internal.NormalizeAndCheckPaths( - includeDirPaths, - "include directory", - normalpath.Absolute, - true, - ) - if err != nil { - return nil, err - } - var absFileOrDirPaths *[]string - if fileOrDirPaths != nil { - normalizedAndCheckedFileOrDirPaths, err := internal.NormalizeAndCheckPaths( - *fileOrDirPaths, - "input file", - normalpath.Absolute, - false, - ) - if err != nil { - return nil, err - } - if len(normalizedAndCheckedFileOrDirPaths) > 0 { - absFileOrDirPaths = &normalizedAndCheckedFileOrDirPaths - } - } - var rootBuckets []storage.ReadBucket - for _, includeDirPath := range includeDirPaths { - rootBucket, err := b.storageosProvider.NewReadWriteBucket( - includeDirPath, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return nil, err - } - // need to do match extension here - // https://github.com/bufbuild/buf/issues/113 - rootBuckets = append(rootBuckets, storage.MapReadBucket(rootBucket, storage.MatchPathExt(".proto"))) - } - module, err := bufmodule.NewModuleForBucket(ctx, storage.MultiReadBucket(rootBuckets...)) - if err != nil { - return nil, err - } - return applyModulePaths( - module, - absIncludeDirPaths, - absFileOrDirPaths, - nil, // Excluding files isn't supported for the ModuleIncludeBuilder. - fileOrDirPathsAllowNotExist, - normalpath.Absolute, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/usage.gen.go deleted file mode 100644 index 4adc1336f5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmodulebuild - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/util.go deleted file mode 100644 index 42703c0e28..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulebuild/util.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulebuild - -import ( - "errors" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -func applyModulePaths( - module bufmodule.Module, - roots []string, - fileOrDirPaths *[]string, - excludeFileOrDirPaths []string, - fileOrDirPathsAllowNotExist bool, - pathType normalpath.PathType, -) (bufmodule.Module, error) { - if fileOrDirPaths == nil && excludeFileOrDirPaths == nil { - return module, nil - } - var excludePaths []string - if len(excludeFileOrDirPaths) != 0 { - var err error - excludePaths, err = pathsToTargetPaths(roots, excludeFileOrDirPaths, pathType) - if err != nil { - return nil, err - } - } - if fileOrDirPaths == nil { - if fileOrDirPathsAllowNotExist { - return bufmodule.ModuleWithExcludePathsAllowNotExist(module, excludePaths) - } - return bufmodule.ModuleWithExcludePaths(module, excludePaths) - } - targetPaths, err := pathsToTargetPaths(roots, *fileOrDirPaths, pathType) - if err != nil { - return nil, err - } - if fileOrDirPathsAllowNotExist { - return bufmodule.ModuleWithTargetPathsAllowNotExist(module, targetPaths, excludePaths) - } - return bufmodule.ModuleWithTargetPaths(module, targetPaths, excludePaths) -} - -func pathsToTargetPaths(roots []string, paths []string, pathType normalpath.PathType) ([]string, error) { - if len(roots) == 0 { - // this should never happen - return nil, errors.New("no roots on config") - } - - targetPaths := make([]string, len(paths)) - for i, path := range paths { - targetPath, err := pathToTargetPath(roots, path, pathType) - if err != nil { - return nil, err - } - targetPaths[i] = targetPath - } - return targetPaths, nil -} - -func pathToTargetPath(roots []string, path string, pathType normalpath.PathType) (string, error) { - var matchingRoots []string - for _, root := range roots { - if normalpath.ContainsPath(root, path, pathType) { - matchingRoots = append(matchingRoots, root) - } - } - switch len(matchingRoots) { - case 0: - // this is a user error and will likely happen often - return "", fmt.Errorf( - "path %q is not contained within any of roots %s - note that specified paths "+ - "cannot be roots, but must be contained within roots", - path, - stringutil.SliceToHumanStringQuoted(roots), - ) - case 1: - targetPath, err := normalpath.Rel(matchingRoots[0], path) - if err != nil { - return "", err - } - // just in case - return normalpath.NormalizeAndValidate(targetPath) - default: - // this should never happen - return "", fmt.Errorf("%q is contained in multiple roots %s", path, stringutil.SliceToHumanStringQuoted(roots)) - } -} - -type buildOptions struct { - moduleIdentity bufmoduleref.ModuleIdentity - // If nil, all files are considered targets. - // If empty (but non-nil), the module will have no target paths. - paths *[]string - pathsAllowNotExist bool - // Paths that will be excluded from the module build process. This is handled in conjunction - // with `paths`. - excludePaths []string -} - -type buildModuleFileSetOptions struct { - workspace bufmodule.Workspace -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/bufmodulecache.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/bufmodulecache.go deleted file mode 100644 index 1acc6cc561..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/bufmodulecache.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulecache - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/gen/proto/connect/buf/alpha/registry/v1alpha1/registryv1alpha1connect" - "github.com/bufbuild/buf/private/pkg/connectclient" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/verbose" - "go.uber.org/zap" -) - -type RepositoryServiceClientFactory func(address string) registryv1alpha1connect.RepositoryServiceClient - -func NewRepositoryServiceClientFactory(clientConfig *connectclient.Config) RepositoryServiceClientFactory { - return func(address string) registryv1alpha1connect.RepositoryServiceClient { - return connectclient.Make(clientConfig, address, registryv1alpha1connect.NewRepositoryServiceClient) - } -} - -// NewModuleReader creates a new module reader using content addressable storage. -func NewModuleReader( - logger *zap.Logger, - verbosePrinter verbose.Printer, - bucket storage.ReadWriteBucket, - delegate bufmodule.ModuleReader, - repositoryClientFactory RepositoryServiceClientFactory, -) bufmodule.ModuleReader { - return newCASModuleReader( - bucket, - delegate, - repositoryClientFactory, - logger, - verbosePrinter, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cache_stats.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cache_stats.go deleted file mode 100644 index 82ba23e636..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cache_stats.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulecache - -import "sync" - -type cacheStats struct { - lock sync.RWMutex - count int - hits int -} - -func (s *cacheStats) MarkHit() { - s.lock.Lock() - defer s.lock.Unlock() - s.count++ - s.hits++ -} - -func (s *cacheStats) MarkMiss() { - s.lock.Lock() - defer s.lock.Unlock() - s.count++ -} - -func (s *cacheStats) Count() int { - s.lock.RLock() - defer s.lock.RUnlock() - return s.count -} - -func (s *cacheStats) Hits() int { - s.lock.RLock() - defer s.lock.RUnlock() - return s.hits -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_cacher.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_cacher.go deleted file mode 100644 index 2051d98868..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_cacher.go +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulecache - -import ( - "context" - "errors" - "fmt" - "io" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -// subdirectories under ~/.cache/buf/v2/{remote}/{owner}/{repo} -const ( - blobsDir = "blobs" - commitsDir = "commits" -) - -type casModuleCacher struct { - logger *zap.Logger - bucket storage.ReadWriteBucket -} - -func (c *casModuleCacher) GetModule( - ctx context.Context, - modulePin bufmoduleref.ModulePin, -) (_ bufmodule.Module, retErr error) { - moduleBasedir := normalpath.Join(modulePin.Remote(), modulePin.Owner(), modulePin.Repository()) - manifestDigestStr := modulePin.Digest() - if manifestDigestStr == "" { - // Attempt to look up manifest digest from commit - commitPath := normalpath.Join(moduleBasedir, commitsDir, modulePin.Commit()) - manifestDigestBytes, err := c.loadPath(ctx, commitPath) - if err != nil { - return nil, err - } - manifestDigestStr = string(manifestDigestBytes) - } - manifestDigest, err := manifest.NewDigestFromString(manifestDigestStr) - if err != nil { - return nil, err - } - manifestFromCache, err := c.readManifest(ctx, moduleBasedir, *manifestDigest) - if err != nil { - return nil, err - } - digests := manifestFromCache.Digests() - blobs := make([]manifest.Blob, len(digests)) - for i, digest := range digests { - blob, err := c.readBlob(ctx, moduleBasedir, digest) - if err != nil { - return nil, err - } - blobs[i] = blob - } - blobSet, err := manifest.NewBlobSet(ctx, blobs) - if err != nil { - return nil, err - } - return bufmodule.NewModuleForManifestAndBlobSet( - ctx, - manifestFromCache, - blobSet, - bufmodule.ModuleWithModuleIdentityAndCommit( - modulePin, - modulePin.Commit(), - ), - ) -} - -func (c *casModuleCacher) PutModule( - ctx context.Context, - modulePin bufmoduleref.ModulePin, - module bufmodule.Module, -) (retErr error) { - moduleManifest := module.Manifest() - if moduleManifest == nil { - return fmt.Errorf("manifest must be non-nil") - } - manifestBlob, err := moduleManifest.Blob() - if err != nil { - return err - } - manifestDigest := manifestBlob.Digest() - if manifestDigest == nil { - return errors.New("empty manifest digest") - } - if modulePinDigestEncoded := modulePin.Digest(); modulePinDigestEncoded != "" { - modulePinDigest, err := manifest.NewDigestFromString(modulePinDigestEncoded) - if err != nil { - return fmt.Errorf("invalid module pin digest %q: %w", modulePinDigestEncoded, err) - } - if !manifestDigest.Equal(*modulePinDigest) { - return fmt.Errorf("manifest digest mismatch: pin=%q, module=%q", modulePinDigest.String(), manifestDigest.String()) - } - } - moduleBasedir := normalpath.Join(modulePin.Remote(), modulePin.Owner(), modulePin.Repository()) - // Write blobs - for _, digest := range moduleManifest.Digests() { - blobDigestStr := digest.String() - blob, found := module.BlobSet().BlobFor(blobDigestStr) - if !found { - paths, _ := moduleManifest.PathsFor(blobDigestStr) - return fmt.Errorf("blob not found for digest=%q (paths=%v)", blobDigestStr, paths) - } - if err := c.writeBlob(ctx, moduleBasedir, blob); err != nil { - return err - } - } - // Write manifest - if err := c.writeBlob(ctx, moduleBasedir, manifestBlob); err != nil { - return err - } - // Write commit - commitPath := normalpath.Join(moduleBasedir, commitsDir, modulePin.Commit()) - if err := c.atomicWrite(ctx, strings.NewReader(manifestBlob.Digest().String()), commitPath); err != nil { - return err - } - return nil -} - -func (c *casModuleCacher) readBlob( - ctx context.Context, - moduleBasedir string, - digest manifest.Digest, -) (_ manifest.Blob, retErr error) { - hexDigest := digest.Hex() - blobPath := normalpath.Join(moduleBasedir, blobsDir, hexDigest[:2], hexDigest[2:]) - contents, err := c.loadPath(ctx, blobPath) - if err != nil { - return nil, err - } - blob, err := manifest.NewMemoryBlob(digest, contents, manifest.MemoryBlobWithDigestValidation()) - if err != nil { - return nil, fmt.Errorf("failed to create blob from path %s: %w", blobPath, err) - } - return blob, nil -} - -func (c *casModuleCacher) validateBlob( - ctx context.Context, - moduleBasedir string, - digest *manifest.Digest, -) (bool, error) { - hexDigest := digest.Hex() - blobPath := normalpath.Join(moduleBasedir, blobsDir, hexDigest[:2], hexDigest[2:]) - f, err := c.bucket.Get(ctx, blobPath) - if err != nil { - return false, err - } - defer func() { - if err := f.Close(); err != nil { - c.logger.Debug("err closing blob", zap.Error(err)) - } - }() - digester, err := manifest.NewDigester(digest.Type()) - if err != nil { - return false, err - } - cacheDigest, err := digester.Digest(f) - if err != nil { - return false, err - } - return digest.Equal(*cacheDigest), nil -} - -func (c *casModuleCacher) readManifest( - ctx context.Context, - moduleBasedir string, - manifestDigest manifest.Digest, -) (_ *manifest.Manifest, retErr error) { - blob, err := c.readBlob(ctx, moduleBasedir, manifestDigest) - if err != nil { - return nil, err - } - f, err := blob.Open(ctx) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, f.Close()) - }() - moduleManifest, err := manifest.NewFromReader(f) - if err != nil { - return nil, fmt.Errorf("failed to read manifest %s: %w", manifestDigest.String(), err) - } - return moduleManifest, nil -} - -func (c *casModuleCacher) writeBlob( - ctx context.Context, - moduleBasedir string, - blob manifest.Blob, -) (retErr error) { - // Avoid unnecessary write if the blob is already written to disk - valid, err := c.validateBlob(ctx, moduleBasedir, blob.Digest()) - if err == nil && valid { - return nil - } - if !storage.IsNotExist(err) { - c.logger.Debug( - "repairing cache entry", - zap.String("basedir", moduleBasedir), - zap.String("digest", blob.Digest().String()), - ) - } - contents, err := blob.Open(ctx) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, contents.Close()) - }() - hexDigest := blob.Digest().Hex() - blobPath := normalpath.Join(moduleBasedir, blobsDir, hexDigest[:2], hexDigest[2:]) - return c.atomicWrite(ctx, contents, blobPath) -} - -func (c *casModuleCacher) atomicWrite(ctx context.Context, contents io.Reader, path string) (retErr error) { - f, err := c.bucket.Put(ctx, path, storage.PutWithAtomic()) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, f.Close()) - }() - if _, err := io.Copy(f, contents); err != nil { - return err - } - return nil -} - -func (c *casModuleCacher) loadPath( - ctx context.Context, - path string, -) (_ []byte, retErr error) { - f, err := c.bucket.Get(ctx, path) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, f.Close()) - }() - return io.ReadAll(f) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_reader.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_reader.go deleted file mode 100644 index e9ad49f1bb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/cas_module_reader.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulecache - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/verbose" - "go.uber.org/zap" -) - -type casModuleReader struct { - // required parameters - delegate bufmodule.ModuleReader - repositoryClientFactory RepositoryServiceClientFactory - logger *zap.Logger - verbosePrinter verbose.Printer - // initialized in newCASModuleReader - cache *casModuleCacher - stats *cacheStats -} - -var _ bufmodule.ModuleReader = (*casModuleReader)(nil) - -func newCASModuleReader( - bucket storage.ReadWriteBucket, - delegate bufmodule.ModuleReader, - repositoryClientFactory RepositoryServiceClientFactory, - logger *zap.Logger, - verbosePrinter verbose.Printer, -) *casModuleReader { - return &casModuleReader{ - delegate: delegate, - repositoryClientFactory: repositoryClientFactory, - logger: logger, - verbosePrinter: verbosePrinter, - cache: &casModuleCacher{ - logger: logger, - bucket: bucket, - }, - stats: &cacheStats{}, - } -} - -func (c *casModuleReader) GetModule( - ctx context.Context, - modulePin bufmoduleref.ModulePin, -) (bufmodule.Module, error) { - var modulePinDigest *manifest.Digest - if digest := modulePin.Digest(); digest != "" { - var err error - modulePinDigest, err = manifest.NewDigestFromString(digest) - // Fail fast if the buf.lock file contains a malformed digest - if err != nil { - return nil, fmt.Errorf("malformed module digest %q: %w", digest, err) - } - } - cachedModule, err := c.cache.GetModule(ctx, modulePin) - if err == nil { - c.stats.MarkHit() - return cachedModule, nil - } - c.logger.Debug("module cache miss", zap.Error(err)) - c.stats.MarkMiss() - remoteModule, err := c.delegate.GetModule(ctx, modulePin) - if err != nil { - return nil, err - } - // Manifest and BlobSet should always be set. - if remoteModule.Manifest() == nil || remoteModule.BlobSet() == nil { - return nil, fmt.Errorf("required manifest/blobSet not set on module") - } - if modulePinDigest != nil { - manifestBlob, err := remoteModule.Manifest().Blob() - if err != nil { - return nil, err - } - manifestDigest := manifestBlob.Digest() - if !modulePinDigest.Equal(*manifestDigest) { - // buf.lock module digest and BSR module don't match - fail without overwriting cache - return nil, fmt.Errorf("module digest mismatch - expected: %q, found: %q", modulePinDigest, manifestDigest) - } - } - if err := c.cache.PutModule(ctx, modulePin, remoteModule); err != nil { - return nil, err - } - if err := warnIfDeprecated(ctx, c.repositoryClientFactory, modulePin, c.logger); err != nil { - return nil, err - } - return remoteModule, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/usage.gen.go deleted file mode 100644 index 194ce3d9e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmodulecache - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/util.go deleted file mode 100644 index 9dc361fc47..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulecache/util.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulecache - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" - "github.com/bufbuild/connect-go" - "go.uber.org/zap" -) - -// warnIfDeprecated emits a warning message to logger if the repository -// is deprecated on the BSR. -func warnIfDeprecated( - ctx context.Context, - clientFactory RepositoryServiceClientFactory, - modulePin bufmoduleref.ModulePin, - logger *zap.Logger, -) error { - repositoryService := clientFactory(modulePin.Remote()) - resp, err := repositoryService.GetRepositoryByFullName( - ctx, - connect.NewRequest(®istryv1alpha1.GetRepositoryByFullNameRequest{ - FullName: fmt.Sprintf("%s/%s", modulePin.Owner(), modulePin.Repository()), - }), - ) - if err != nil { - return err - } - repository := resp.Msg.Repository - if repository.Deprecated { - warnMsg := fmt.Sprintf(`Repository "%s" is deprecated`, modulePin.IdentityString()) - if repository.DeprecationMessage != "" { - warnMsg = fmt.Sprintf("%s: %s", warnMsg, repository.DeprecationMessage) - } - logger.Sugar().Warn(warnMsg) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/bufmoduleconfig.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/bufmoduleconfig.go deleted file mode 100644 index d217a4865c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/bufmoduleconfig.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleconfig - -import "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - -// Config is a configuration for build. -type Config struct { - // RootToExcludes contains a map from root to the excludes for that root. - // - // Roots are the root directories within a bucket to search for Protobuf files. - // - // There will be no between the roots, ie foo/bar and foo are not allowed. - // All Protobuf files must be unique relative to the roots, ie if foo and bar - // are roots, then foo/baz.proto and bar/baz.proto are not allowed. - // - // All roots will be normalized and validated. - // - // Excludes are the directories within a bucket to exclude. - // - // There should be no overlap between the excludes, ie foo/bar and foo are not allowed. - // - // All excludes must reside within a root, but none will be equal to a root. - // All excludes will be normalized and validated. - // The excludes in this map will be relative to the root they map to! - // - // If RootToExcludes is empty, the default is "." with no excludes. - RootToExcludes map[string][]string - DependencyModuleReferences []bufmoduleref.ModuleReference -} - -// NewConfigV1Beta1 returns a new, validated Config for the ExternalConfig. -func NewConfigV1Beta1(externalConfig ExternalConfigV1Beta1, deps ...string) (*Config, error) { - return newConfigV1Beta1(externalConfig, deps...) -} - -// NewConfigV1 returns a new, validated Config for the ExternalConfig. -func NewConfigV1(externalConfig ExternalConfigV1, deps ...string) (*Config, error) { - return newConfigV1(externalConfig, deps...) -} - -// ExternalConfigV1Beta1 is an external config. -type ExternalConfigV1Beta1 struct { - Roots []string `json:"roots,omitempty" yaml:"roots,omitempty"` - Excludes []string `json:"excludes,omitempty" yaml:"excludes,omitempty"` -} - -// ExternalConfigV1 is an external config. -type ExternalConfigV1 struct { - Excludes []string `json:"excludes,omitempty" yaml:"excludes,omitempty"` -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/config.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/config.go deleted file mode 100644 index 501f08b305..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/config.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleconfig - -import ( - "fmt" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/internal" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -func newConfigV1Beta1(externalConfig ExternalConfigV1Beta1, deps ...string) (*Config, error) { - dependencyModuleReferences, err := parseDependencyModuleReferences(deps...) - if err != nil { - return nil, err - } - - rootToExcludes := make(map[string][]string) - - roots := externalConfig.Roots - // not yet relative to roots - fullExcludes := externalConfig.Excludes - - if len(roots) == 0 { - roots = []string{"."} - } - roots, err = internal.NormalizeAndCheckPaths(roots, "root", normalpath.Relative, true) - if err != nil { - return nil, err - } - for _, root := range roots { - // we already checked duplicates, but just in case - if _, ok := rootToExcludes[root]; ok { - return nil, fmt.Errorf("unexpected duplicate root: %q", root) - } - rootToExcludes[root] = make([]string, 0) - } - - if len(fullExcludes) == 0 { - return &Config{ - RootToExcludes: rootToExcludes, - DependencyModuleReferences: dependencyModuleReferences, - }, nil - } - - // this also verifies that fullExcludes is unique - fullExcludes, err = internal.NormalizeAndCheckPaths(fullExcludes, "exclude", normalpath.Relative, true) - if err != nil { - return nil, err - } - - // verify that no exclude equals a root directly and only directories are specified - for _, fullExclude := range fullExcludes { - if normalpath.Ext(fullExclude) == ".proto" { - return nil, fmt.Errorf("excludes can only be directories but file %s discovered", fullExclude) - } - if _, ok := rootToExcludes[fullExclude]; ok { - return nil, fmt.Errorf("%s is both a root and exclude, which means the entire root is excluded, which is not valid", fullExclude) - } - } - - // verify that all excludes are within a root - rootMap := stringutil.SliceToMap(roots) - for _, fullExclude := range fullExcludes { - switch matchingRoots := normalpath.MapAllEqualOrContainingPaths(rootMap, fullExclude, normalpath.Relative); len(matchingRoots) { - case 0: - return nil, fmt.Errorf("exclude %s is not contained in any root, which is not valid", fullExclude) - case 1: - root := matchingRoots[0] - exclude, err := normalpath.Rel(root, fullExclude) - if err != nil { - return nil, err - } - // just in case - exclude, err = normalpath.NormalizeAndValidate(exclude) - if err != nil { - return nil, err - } - rootToExcludes[root] = append(rootToExcludes[root], exclude) - default: - // this should never happen, but just in case - return nil, fmt.Errorf("exclude %q was in multiple roots %v (system error)", fullExclude, matchingRoots) - } - } - - for root, excludes := range rootToExcludes { - uniqueSortedExcludes := stringutil.SliceToUniqueSortedSliceFilterEmptyStrings(excludes) - if len(excludes) != len(uniqueSortedExcludes) { - // this should never happen, but just in case - return nil, fmt.Errorf("excludes %v are not unique (system error)", excludes) - } - rootToExcludes[root] = uniqueSortedExcludes - } - return &Config{ - RootToExcludes: rootToExcludes, - DependencyModuleReferences: dependencyModuleReferences, - }, nil -} - -func newConfigV1(externalConfig ExternalConfigV1, deps ...string) (*Config, error) { - dependencyModuleReferences, err := parseDependencyModuleReferences(deps...) - if err != nil { - return nil, err - } - // this also verifies that the excludes are unique, normalized, and validated - excludes, err := internal.NormalizeAndCheckPaths(externalConfig.Excludes, "exclude", normalpath.Relative, true) - if err != nil { - return nil, err - } - for _, exclude := range excludes { - if normalpath.Ext(exclude) == ".proto" { - return nil, fmt.Errorf("excludes can only be directories but file %s discovered", exclude) - } - } - uniqueSortedExcludes := stringutil.SliceToUniqueSortedSliceFilterEmptyStrings(excludes) - if len(excludes) != len(uniqueSortedExcludes) { - // this should never happen, but just in case - return nil, fmt.Errorf("excludes %v are not unique (system error)", excludes) - } - rootToExcludes := map[string][]string{ - ".": excludes, // all excludes are relative to the root - } - return &Config{ - RootToExcludes: rootToExcludes, - DependencyModuleReferences: dependencyModuleReferences, - }, nil -} - -func parseDependencyModuleReferences(deps ...string) ([]bufmoduleref.ModuleReference, error) { - if len(deps) == 0 { - return nil, nil - } - moduleReferences := make([]bufmoduleref.ModuleReference, 0, len(deps)) - for _, dep := range deps { - dep := strings.TrimSpace(dep) - moduleReference, err := bufmoduleref.ModuleReferenceForString(dep) - if err != nil { - return nil, err - } - moduleReferences = append(moduleReferences, moduleReference) - } - if err := bufmoduleref.ValidateModuleReferencesUniqueByIdentity(moduleReferences); err != nil { - return nil, err - } - return moduleReferences, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/usage.gen.go deleted file mode 100644 index 98ce2a1830..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleconfig/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmoduleconfig - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/bufmoduleprotocompile.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/bufmoduleprotocompile.go deleted file mode 100644 index dd77a6a9c5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/bufmoduleprotocompile.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleprotocompile - -import ( - "context" - "io" - - "github.com/bufbuild/buf/private/bufpkg/bufanalysis" - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/protocompile/reporter" -) - -// ParserAccessorHandler handles source file access operations for protocompile. -type ParserAccessorHandler interface { - // Open opens the given path, and tracks the external path and import status. - // - // This function can be used as the accessor function for a protocompile.SourceResolver. - Open(path string) (io.ReadCloser, error) - // ExternalPath returns the external path for the input path. - // - // Returns the input path if the external path is not known. - ExternalPath(path string) string - // IsImport returns true if the path is an import. - IsImport(path string) bool - // ModuleIdentity returns nil if not available. - ModuleIdentity(path string) bufmoduleref.ModuleIdentity - // Commit returns empty if not available. - Commit(path string) string -} - -// NewParserAccessorHandler returns a new ParserAccessorHandler. -// -// TODO: make this dependent on whatever derivative getter type we create to replace ModuleFileSet. -func NewParserAccessorHandler(ctx context.Context, moduleFileSet bufmodule.ModuleFileSet) ParserAccessorHandler { - return newParserAccessorHandler(ctx, moduleFileSet) -} - -// GetFileAnnotations gets the FileAnnotations for the ErrorWithPos errors. -func GetFileAnnotations( - ctx context.Context, - parserAccessorHandler ParserAccessorHandler, - errorsWithPos []reporter.ErrorWithPos, -) ([]bufanalysis.FileAnnotation, error) { - fileAnnotations := make([]bufanalysis.FileAnnotation, 0, len(errorsWithPos)) - for _, errorWithPos := range errorsWithPos { - fileAnnotation, err := GetFileAnnotation( - ctx, - parserAccessorHandler, - errorWithPos, - ) - if err != nil { - return nil, err - } - fileAnnotations = append(fileAnnotations, fileAnnotation) - } - return fileAnnotations, nil -} - -// GetFileAnnotation gets the FileAnnotation for the ErrorWithPos error. -func GetFileAnnotation( - ctx context.Context, - parserAccessorHandler ParserAccessorHandler, - errorWithPos reporter.ErrorWithPos, -) (bufanalysis.FileAnnotation, error) { - var fileInfo bufmoduleref.FileInfo - var startLine int - var startColumn int - var endLine int - var endColumn int - typeString := "COMPILE" - message := "Compile error." - // this should never happen - // maybe we should error - if errorWithPos.Unwrap() != nil { - message = errorWithPos.Unwrap().Error() - } - sourcePos := errorWithPos.GetPosition() - if sourcePos.Filename != "" { - path, err := normalpath.NormalizeAndValidate(sourcePos.Filename) - if err != nil { - return nil, err - } - fileInfo, err = bufmoduleref.NewFileInfo( - path, - parserAccessorHandler.ExternalPath(path), - parserAccessorHandler.IsImport(path), - nil, - "", - ) - if err != nil { - return nil, err - } - } - if sourcePos.Line > 0 { - startLine = sourcePos.Line - endLine = sourcePos.Line - } - if sourcePos.Col > 0 { - startColumn = sourcePos.Col - endColumn = sourcePos.Col - } - return bufanalysis.NewFileAnnotation( - fileInfo, - startLine, - startColumn, - endLine, - endColumn, - typeString, - message, - ), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/path_resolver.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/path_resolver.go deleted file mode 100644 index 1a5b28e139..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/path_resolver.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleprotocompile - -import ( - "context" - "fmt" - "io" - "sync" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/gen/data/datawkt" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" -) - -// TODO: remove when we remove ModuleFileSet -type moduleFileReader interface { - GetModuleFile(context.Context, string) (bufmodule.ModuleFile, error) -} - -type parserAccessorHandler struct { - ctx context.Context - moduleFileReader moduleFileReader - pathToExternalPath map[string]string - nonImportPaths map[string]struct{} - pathToModuleIdentity map[string]bufmoduleref.ModuleIdentity - pathToCommit map[string]string - lock sync.RWMutex -} - -func newParserAccessorHandler( - ctx context.Context, - moduleFileReader moduleFileReader, -) *parserAccessorHandler { - return &parserAccessorHandler{ - ctx: ctx, - moduleFileReader: moduleFileReader, - pathToExternalPath: make(map[string]string), - nonImportPaths: make(map[string]struct{}), - pathToModuleIdentity: make(map[string]bufmoduleref.ModuleIdentity), - pathToCommit: make(map[string]string), - } -} - -func (p *parserAccessorHandler) Open(path string) (_ io.ReadCloser, retErr error) { - moduleFile, moduleErr := p.moduleFileReader.GetModuleFile(p.ctx, path) - if moduleErr != nil { - if !storage.IsNotExist(moduleErr) { - return nil, moduleErr - } - if wktModuleFile, wktErr := datawkt.ReadBucket.Get(p.ctx, path); wktErr == nil { - if wktModuleFile.Path() != path { - // this should never happen, but just in case - return nil, fmt.Errorf("parser accessor requested path %q but got %q", path, wktModuleFile.Path()) - } - if err := p.addPath(path, path, true, nil, ""); err != nil { - return nil, err - } - return wktModuleFile, nil - } - return nil, moduleErr - } - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, moduleFile.Close()) - } - }() - if moduleFile.Path() != path { - // this should never happen, but just in case - return nil, fmt.Errorf("parser accessor requested path %q but got %q", path, moduleFile.Path()) - } - if err := p.addPath( - path, - moduleFile.ExternalPath(), - moduleFile.IsImport(), - moduleFile.ModuleIdentity(), - moduleFile.Commit(), - ); err != nil { - return nil, err - } - return moduleFile, nil -} - -func (p *parserAccessorHandler) ExternalPath(path string) string { - p.lock.RLock() - defer p.lock.RUnlock() - if externalPath := p.pathToExternalPath[path]; externalPath != "" { - return externalPath - } - return path -} - -func (p *parserAccessorHandler) IsImport(path string) bool { - p.lock.RLock() - defer p.lock.RUnlock() - _, isNotImport := p.nonImportPaths[path] - return !isNotImport -} - -func (p *parserAccessorHandler) ModuleIdentity(path string) bufmoduleref.ModuleIdentity { - p.lock.RLock() - defer p.lock.RUnlock() - return p.pathToModuleIdentity[path] // nil is a valid value. -} - -func (p *parserAccessorHandler) Commit(path string) string { - p.lock.RLock() - defer p.lock.RUnlock() - return p.pathToCommit[path] // empty is a valid value. -} - -func (p *parserAccessorHandler) addPath( - path string, - externalPath string, - isImport bool, - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, -) error { - p.lock.Lock() - defer p.lock.Unlock() - existingExternalPath, ok := p.pathToExternalPath[path] - if ok { - if existingExternalPath != externalPath { - return fmt.Errorf("parser accessor had external paths %q and %q for path %q", existingExternalPath, externalPath, path) - } - } else { - p.pathToExternalPath[path] = externalPath - } - if !isImport { - p.nonImportPaths[path] = struct{}{} - } - if moduleIdentity != nil { - p.pathToModuleIdentity[path] = moduleIdentity - } - if commit != "" { - p.pathToCommit[path] = commit - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/usage.gen.go deleted file mode 100644 index c85906d7e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleprotocompile/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmoduleprotocompile - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/bufmoduleref.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/bufmoduleref.go deleted file mode 100644 index 297a05c5cb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/bufmoduleref.go +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - "time" - - "github.com/bufbuild/buf/private/bufpkg/buflock" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/uuidutil" - "go.uber.org/multierr" -) - -const ( - // Main is the default reference used if no other reference is specified. - Main = "main" -) - -// FileInfo contains module file info. -type FileInfo interface { - // Path is the path of the file relative to the root it is contained within. - // This will be normalized, validated and never empty, - // This will be unique within a given Image. - Path() string - // ExternalPath returns the path that identifies this file externally. - // - // This will be unnormalized. - // Never empty. Falls back to Path if there is not an external path. - // - // Example: - // Assume we had the input path /foo/bar which is a local directory. - // Path: one/one.proto - // RootDirPath: proto - // ExternalPath: /foo/bar/proto/one/one.proto - ExternalPath() string - // IsImport returns true if this file is an import. - IsImport() bool - // ModuleIdentity is the module that this file came from. - // - // Note this *can* be nil if we did not build from a named module. - // All code must assume this can be nil. - // Note that nil checking should work since the backing type is always a pointer. - ModuleIdentity() ModuleIdentity - // Commit is the commit for the module that this file came from. - // - // This will only be set if ModuleIdentity is set, but may not be set - // even if ModuleIdentity is set, that is commit is optional information - // even if we know what module this file came from. - Commit() string - // WithIsImport returns this FileInfo with the given IsImport value. - WithIsImport(isImport bool) FileInfo - - isFileInfo() -} - -// NewFileInfo returns a new FileInfo. -// -// TODO: we should make moduleIdentity and commit options. -// TODO: we don't validate commit -func NewFileInfo( - path string, - externalPath string, - isImport bool, - moduleIdentity ModuleIdentity, - commit string, -) (FileInfo, error) { - return newFileInfo( - path, - externalPath, - isImport, - moduleIdentity, - commit, - ) -} - -// ModuleOwner is a module owner. -// -// It just contains remote, owner. -// -// This is shared by ModuleIdentity. -type ModuleOwner interface { - Remote() string - Owner() string - - isModuleOwner() -} - -// NewModuleOwner returns a new ModuleOwner. -func NewModuleOwner( - remote string, - owner string, -) (ModuleOwner, error) { - return newModuleOwner(remote, owner) -} - -// ModuleOwnerForString returns a new ModuleOwner for the given string. -// -// This parses the path in the form remote/owner. -func ModuleOwnerForString(path string) (ModuleOwner, error) { - slashSplit := strings.Split(path, "/") - if len(slashSplit) != 2 { - return nil, newInvalidModuleOwnerStringError(path) - } - remote := strings.TrimSpace(slashSplit[0]) - if remote == "" { - return nil, newInvalidModuleIdentityStringError(path) - } - owner := strings.TrimSpace(slashSplit[1]) - if owner == "" { - return nil, newInvalidModuleIdentityStringError(path) - } - return NewModuleOwner(remote, owner) -} - -// ModuleIdentity is a module identity. -// -// It just contains remote, owner, repository. -// -// This is shared by ModuleReference and ModulePin. -type ModuleIdentity interface { - ModuleOwner - - Repository() string - - // IdentityString is the string remote/owner/repository. - IdentityString() string - - isModuleIdentity() -} - -// NewModuleIdentity returns a new ModuleIdentity. -func NewModuleIdentity( - remote string, - owner string, - repository string, -) (ModuleIdentity, error) { - return newModuleIdentity(remote, owner, repository) -} - -// ModuleIdentityForString returns a new ModuleIdentity for the given string. -// -// This parses the path in the form remote/owner/repository -// -// TODO: we may want to add a special error if we detect / or @ as this may be a common mistake. -func ModuleIdentityForString(path string) (ModuleIdentity, error) { - remote, owner, repository, err := parseModuleIdentityComponents(path) - if err != nil { - return nil, err - } - return NewModuleIdentity(remote, owner, repository) -} - -// ModuleReference is a module reference. -// -// It references either a branch, tag, or a commit. -// Note that since commits belong to branches, we can deduce -// the branch from the commit when resolving. -type ModuleReference interface { - ModuleIdentity - - // Prints either remote/owner/repository:{branch,commit} - // If the reference is equal to MainBranch, prints remote/owner/repository. - fmt.Stringer - - // Either branch, tag, or commit - Reference() string - - isModuleReference() -} - -// NewModuleReference returns a new validated ModuleReference. -func NewModuleReference( - remote string, - owner string, - repository string, - reference string, -) (ModuleReference, error) { - return newModuleReference(remote, owner, repository, reference) -} - -// NewModuleReferenceForProto returns a new ModuleReference for the given proto ModuleReference. -func NewModuleReferenceForProto(protoModuleReference *modulev1alpha1.ModuleReference) (ModuleReference, error) { - return newModuleReferenceForProto(protoModuleReference) -} - -// NewModuleReferencesForProtos maps the Protobuf equivalent into the internal representation. -func NewModuleReferencesForProtos(protoModuleReferences ...*modulev1alpha1.ModuleReference) ([]ModuleReference, error) { - if len(protoModuleReferences) == 0 { - return nil, nil - } - moduleReferences := make([]ModuleReference, len(protoModuleReferences)) - for i, protoModuleReference := range protoModuleReferences { - moduleReference, err := NewModuleReferenceForProto(protoModuleReference) - if err != nil { - return nil, err - } - moduleReferences[i] = moduleReference - } - return moduleReferences, nil -} - -// NewProtoModuleReferenceForModuleReference returns a new proto ModuleReference for the given ModuleReference. -func NewProtoModuleReferenceForModuleReference(moduleReference ModuleReference) *modulev1alpha1.ModuleReference { - return newProtoModuleReferenceForModuleReference(moduleReference) -} - -// NewProtoModuleReferencesForModuleReferences maps the given module references into the protobuf representation. -func NewProtoModuleReferencesForModuleReferences(moduleReferences ...ModuleReference) []*modulev1alpha1.ModuleReference { - if len(moduleReferences) == 0 { - return nil - } - protoModuleReferences := make([]*modulev1alpha1.ModuleReference, len(moduleReferences)) - for i, moduleReference := range moduleReferences { - protoModuleReferences[i] = NewProtoModuleReferenceForModuleReference(moduleReference) - } - return protoModuleReferences -} - -// ModuleReferenceForString returns a new ModuleReference for the given string. -// If a branch, commit, draft, or tag is not provided, the "main" branch is used. -// -// This parses the path in the form remote/owner/repository{:branch,:commit,:draft,:tag}. -func ModuleReferenceForString(path string) (ModuleReference, error) { - remote, owner, repository, reference, err := parseModuleReferenceComponents(path) - if err != nil { - return nil, err - } - if reference == "" { - // Default to the main branch if a ':' separator was not specified. - reference = Main - } - return NewModuleReference(remote, owner, repository, reference) -} - -// IsCommitModuleReference returns true if the ModuleReference references a commit. -// -// If false, this means the ModuleReference references a branch or tag. -// Branch and tag disambiguation needs to be done server-side. -func IsCommitModuleReference(moduleReference ModuleReference) bool { - return IsCommitReference(moduleReference.Reference()) -} - -// IsCommitReference returns whether the provided reference is a commit. -func IsCommitReference(reference string) bool { - _, err := uuidutil.FromDashless(reference) - return err == nil -} - -// ModulePin is a module pin. -// -// It references a specific point in time of a Module. -// -// Note that a commit does this itself, but we want all this information. -// This is what is stored in a buf.lock file. -type ModulePin interface { - ModuleIdentity - - // Prints remote/owner/repository:commit, which matches ModuleReference - fmt.Stringer - - // all of these will be set - Branch() string - Commit() string - Digest() string - CreateTime() time.Time - - isModulePin() -} - -// NewModulePin returns a new validated ModulePin. -func NewModulePin( - remote string, - owner string, - repository string, - branch string, - commit string, - digest string, - createTime time.Time, -) (ModulePin, error) { - return newModulePin(remote, owner, repository, branch, commit, digest, createTime) -} - -// NewModulePinForProto returns a new ModulePin for the given proto ModulePin. -func NewModulePinForProto(protoModulePin *modulev1alpha1.ModulePin) (ModulePin, error) { - return newModulePinForProto(protoModulePin) -} - -// NewModulePinsForProtos maps the Protobuf equivalent into the internal representation. -func NewModulePinsForProtos(protoModulePins ...*modulev1alpha1.ModulePin) ([]ModulePin, error) { - if len(protoModulePins) == 0 { - return nil, nil - } - modulePins := make([]ModulePin, len(protoModulePins)) - for i, protoModulePin := range protoModulePins { - modulePin, err := NewModulePinForProto(protoModulePin) - if err != nil { - return nil, err - } - modulePins[i] = modulePin - } - return modulePins, nil -} - -// NewProtoModulePinForModulePin returns a new proto ModulePin for the given ModulePin. -func NewProtoModulePinForModulePin(modulePin ModulePin) *modulev1alpha1.ModulePin { - return newProtoModulePinForModulePin(modulePin) -} - -// NewProtoModulePinsForModulePins maps the given module pins into the protobuf representation. -func NewProtoModulePinsForModulePins(modulePins ...ModulePin) []*modulev1alpha1.ModulePin { - if len(modulePins) == 0 { - return nil - } - protoModulePins := make([]*modulev1alpha1.ModulePin, len(modulePins)) - for i, modulePin := range modulePins { - protoModulePins[i] = NewProtoModulePinForModulePin(modulePin) - } - return protoModulePins -} - -// ValidateModuleReferencesUniqueByIdentity returns an error if the module references contain any duplicates. -// -// This only checks remote, owner, repository. -func ValidateModuleReferencesUniqueByIdentity(moduleReferences []ModuleReference) error { - seenModuleReferences := make(map[string]struct{}) - for _, moduleReference := range moduleReferences { - moduleIdentityString := moduleReference.IdentityString() - if _, ok := seenModuleReferences[moduleIdentityString]; ok { - return fmt.Errorf("module %s appeared twice", moduleIdentityString) - } - seenModuleReferences[moduleIdentityString] = struct{}{} - } - return nil -} - -// ValidateModulePinsUniqueByIdentity returns an error if the module pins contain any duplicates. -// -// This only checks remote, owner, repository. -func ValidateModulePinsUniqueByIdentity(modulePins []ModulePin) error { - seenModulePins := make(map[string]struct{}) - for _, modulePin := range modulePins { - moduleIdentityString := modulePin.IdentityString() - if _, ok := seenModulePins[moduleIdentityString]; ok { - return fmt.Errorf("module %s appeared twice", moduleIdentityString) - } - seenModulePins[moduleIdentityString] = struct{}{} - } - return nil -} - -// ValidateModulePinsConsistentDigests verifies that module pins to the same commit don't change digests. -// This is important to avoid MITM issues, where the module digest stored in a buf.lock file doesn't match -// the module pin returned from the BSR. -// Returns an error that fulfills IsDigestChanged if any valid digest changed from the buf.lock file for -// the same dependency commit. -func ValidateModulePinsConsistentDigests( - ctx context.Context, - bucket storage.ReadBucket, - modulePins []ModulePin, -) error { - currentConfig, err := buflock.ReadConfig(ctx, bucket) - if err != nil { - if storage.IsNotExist(err) { - return nil - } - return err - } - if len(currentConfig.Dependencies) == 0 { - return nil - } - currentIdentityAndCommitToDigest := make(map[string]string, len(currentConfig.Dependencies)) - for _, dep := range currentConfig.Dependencies { - // Ignore dependencies with no digest - if dep.Digest == "" { - continue - } - // Ignore dependencies with an invalid digest. - // We want to replace these with a valid digest. - if _, err := manifest.NewDigestFromString(dep.Digest); err != nil { - continue - } - key := fmt.Sprintf("%s/%s/%s:%s", dep.Remote, dep.Owner, dep.Repository, dep.Commit) - currentIdentityAndCommitToDigest[key] = dep.Digest - } - var changedErrors error - for _, pin := range modulePins { - if pin.Digest() == "" { - continue - } - if currentDigest, ok := currentIdentityAndCommitToDigest[pin.String()]; ok && currentDigest != pin.Digest() { - changedErrors = multierr.Append(changedErrors, &digestChangedError{ - currentDigest: currentDigest, - updatedPin: pin, - }) - } - } - return changedErrors -} - -// ModuleReferenceEqual returns true if a equals b. -func ModuleReferenceEqual(a ModuleReference, b ModuleReference) bool { - if (a == nil) != (b == nil) { - return false - } - if a == nil { - return true - } - return a.Remote() == b.Remote() && - a.Owner() == b.Owner() && - a.Repository() == b.Repository() && - a.Reference() == b.Reference() -} - -// ModulePinEqual returns true if a equals b. -func ModulePinEqual(a ModulePin, b ModulePin) bool { - if (a == nil) != (b == nil) { - return false - } - if a == nil { - return true - } - return a.Remote() == b.Remote() && - a.Owner() == b.Owner() && - a.Repository() == b.Repository() && - a.Branch() == b.Branch() && - a.Commit() == b.Commit() && - a.Digest() == b.Digest() && - a.CreateTime().Equal(b.CreateTime()) -} - -// DependencyModulePinsForBucket reads the module dependencies from the lock file in the bucket. -func DependencyModulePinsForBucket( - ctx context.Context, - readBucket storage.ReadBucket, -) ([]ModulePin, error) { - lockFile, err := buflock.ReadConfig(ctx, readBucket) - if err != nil { - return nil, fmt.Errorf("failed to read lock file: %w", err) - } - modulePins := make([]ModulePin, 0, len(lockFile.Dependencies)) - for _, dep := range lockFile.Dependencies { - modulePin, err := NewModulePin( - dep.Remote, - dep.Owner, - dep.Repository, - "", - dep.Commit, - dep.Digest, - time.Time{}, - ) - if err != nil { - return nil, err - } - modulePins = append(modulePins, modulePin) - } - // just to be safe - SortModulePins(modulePins) - if err := ValidateModulePinsUniqueByIdentity(modulePins); err != nil { - return nil, err - } - return modulePins, nil -} - -// PutDependencyModulePinsToBucket writes the module dependencies to the write bucket in the form of a lock file. -func PutDependencyModulePinsToBucket( - ctx context.Context, - writeBucket storage.WriteBucket, - modulePins []ModulePin, -) error { - if err := ValidateModulePinsUniqueByIdentity(modulePins); err != nil { - return err - } - SortModulePins(modulePins) - lockFile := &buflock.Config{ - Dependencies: make([]buflock.Dependency, 0, len(modulePins)), - } - for _, pin := range modulePins { - lockFile.Dependencies = append( - lockFile.Dependencies, - buflock.Dependency{ - Remote: pin.Remote(), - Owner: pin.Owner(), - Repository: pin.Repository(), - Commit: pin.Commit(), - Digest: pin.Digest(), - }, - ) - } - return buflock.WriteConfig(ctx, writeBucket, lockFile) -} - -// SortFileInfos sorts the FileInfos by Path. -// -// This should be treated as the default sorting mechanism. -func SortFileInfos(fileInfos []FileInfo) { - if len(fileInfos) == 0 { - return - } - sort.Slice( - fileInfos, - func(i int, j int) bool { - return fileInfos[i].Path() < fileInfos[j].Path() - }, - ) -} - -// SortFileInfosByExternalPath sorts the FileInfos by ExternalPath. -func SortFileInfosByExternalPath(fileInfos []FileInfo) { - if len(fileInfos) == 0 { - return - } - sort.Slice( - fileInfos, - func(i int, j int) bool { - return fileInfos[i].ExternalPath() < fileInfos[j].ExternalPath() - }, - ) -} - -// SortModuleReferences sorts the ModuleReferences lexicographically by their identity. -func SortModuleReferences(references []ModuleReference) { - sort.Slice(references, func(i, j int) bool { - return references[i].IdentityString() < references[j].IdentityString() - }) -} - -// SortModulePins sorts the ModulePins. -func SortModulePins(modulePins []ModulePin) { - sort.Slice(modulePins, func(i, j int) bool { - return modulePinLess(modulePins[i], modulePins[j]) - }) -} - -// IsDigestChanged returns true if the error indicates an unexpected digest change. -func IsDigestChanged(err error) bool { - var errDigestChanged *digestChangedError - return errors.As(err, &errDigestChanged) -} - -// digestChangedError is returned if module pin digests have changed unexpectedly. -type digestChangedError struct { - // currentDigest is the digest found in the buf.lock file. - currentDigest string - // updatedPin is a module pin with a different digest than currentDigest for the same commit. - updatedPin ModulePin -} - -func (e *digestChangedError) Error() string { - return fmt.Sprintf( - "module %s commit %q returned an unexpected digest: local buf.lock=%q, remote=%q", - e.updatedPin.IdentityString(), - e.updatedPin.Commit(), - e.currentDigest, - e.updatedPin.Digest(), - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/file_info.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/file_info.go deleted file mode 100644 index 1c6fe497e2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/file_info.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - "github.com/bufbuild/buf/private/pkg/protodescriptor" -) - -var _ FileInfo = &fileInfo{} - -type fileInfo struct { - path string - externalPath string - isImport bool - moduleIdentity ModuleIdentity - commit string -} - -func newFileInfo( - path string, - externalPath string, - isImport bool, - moduleIdentity ModuleIdentity, - commit string, -) (*fileInfo, error) { - if err := protodescriptor.ValidateProtoPath("root relative file path", path); err != nil { - return nil, err - } - if externalPath == "" { - externalPath = path - } - return newFileInfoNoValidate( - path, - externalPath, - isImport, - moduleIdentity, - commit, - ), nil -} - -func newFileInfoNoValidate( - path string, - externalPath string, - isImport bool, - moduleIdentity ModuleIdentity, - commit string, -) *fileInfo { - return &fileInfo{ - path: path, - externalPath: externalPath, - isImport: isImport, - moduleIdentity: moduleIdentity, - commit: commit, - } -} - -func (f *fileInfo) Path() string { - return f.path -} - -func (f *fileInfo) ExternalPath() string { - return f.externalPath -} - -func (f *fileInfo) IsImport() bool { - return f.isImport -} - -func (f *fileInfo) ModuleIdentity() ModuleIdentity { - return f.moduleIdentity -} - -func (f *fileInfo) Commit() string { - return f.commit -} - -func (f *fileInfo) WithIsImport(isImport bool) FileInfo { - return newFileInfoNoValidate( - f.path, - f.externalPath, - isImport, - f.moduleIdentity, - f.commit, - ) -} - -func (*fileInfo) isFileInfo() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_identity.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_identity.go deleted file mode 100644 index 4d0605e84c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_identity.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -type moduleIdentity struct { - remote string - owner string - repository string -} - -func newModuleIdentity( - remote string, - owner string, - repository string, -) (*moduleIdentity, error) { - moduleIdentity := &moduleIdentity{ - remote: remote, - owner: owner, - repository: repository, - } - if err := validateModuleIdentity(moduleIdentity); err != nil { - return nil, err - } - return moduleIdentity, nil -} - -func (m *moduleIdentity) Remote() string { - return m.remote -} - -func (m *moduleIdentity) Owner() string { - return m.owner -} - -func (m *moduleIdentity) Repository() string { - return m.repository -} - -func (m *moduleIdentity) IdentityString() string { - return m.remote + "/" + m.owner + "/" + m.repository -} - -func (*moduleIdentity) isModuleOwner() {} -func (*moduleIdentity) isModuleIdentity() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_owner.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_owner.go deleted file mode 100644 index 6af897022c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_owner.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -type moduleOwner struct { - remote string - owner string -} - -func newModuleOwner( - remote string, - owner string, -) (*moduleOwner, error) { - moduleOwner := &moduleOwner{ - remote: remote, - owner: owner, - } - if err := validateModuleOwner(moduleOwner); err != nil { - return nil, err - } - return moduleOwner, nil -} - -func (m *moduleOwner) Remote() string { - return m.remote -} - -func (m *moduleOwner) Owner() string { - return m.owner -} - -func (*moduleOwner) isModuleOwner() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_pin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_pin.go deleted file mode 100644 index 21007c23aa..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_pin.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - "time" - - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/prototime" - "google.golang.org/protobuf/types/known/timestamppb" -) - -type modulePin struct { - remote string - owner string - repository string - branch string - commit string - digest string - createTime time.Time -} - -func newModulePin( - remote string, - owner string, - repository string, - branch string, - commit string, - digest string, - createTime time.Time, -) (*modulePin, error) { - protoCreateTime, err := prototime.NewTimestamp(createTime) - if err != nil { - return nil, err - } - return newModulePinForProto( - &modulev1alpha1.ModulePin{ - Remote: remote, - Owner: owner, - Repository: repository, - Branch: branch, - Commit: commit, - ManifestDigest: digest, - CreateTime: protoCreateTime, - }, - ) -} - -func newModulePinForProto( - protoModulePin *modulev1alpha1.ModulePin, -) (*modulePin, error) { - if err := ValidateProtoModulePin(protoModulePin); err != nil { - return nil, err - } - return &modulePin{ - remote: protoModulePin.Remote, - owner: protoModulePin.Owner, - repository: protoModulePin.Repository, - branch: protoModulePin.Branch, - commit: protoModulePin.Commit, - digest: protoModulePin.ManifestDigest, - createTime: protoModulePin.CreateTime.AsTime(), - }, nil -} - -func newProtoModulePinForModulePin( - modulePin ModulePin, -) *modulev1alpha1.ModulePin { - return &modulev1alpha1.ModulePin{ - Remote: modulePin.Remote(), - Owner: modulePin.Owner(), - Repository: modulePin.Repository(), - Branch: modulePin.Branch(), - Commit: modulePin.Commit(), - ManifestDigest: modulePin.Digest(), - // no need to validate as we already know this is valid - CreateTime: timestamppb.New(modulePin.CreateTime()), - } -} - -func (m *modulePin) Remote() string { - return m.remote -} - -func (m *modulePin) Owner() string { - return m.owner -} - -func (m *modulePin) Repository() string { - return m.repository -} - -func (m *modulePin) Branch() string { - return m.branch -} - -func (m *modulePin) Commit() string { - return m.commit -} - -func (m *modulePin) Digest() string { - return m.digest -} - -func (m *modulePin) CreateTime() time.Time { - return m.createTime -} - -func (m *modulePin) String() string { - return m.remote + "/" + m.owner + "/" + m.repository + ":" + m.commit -} - -func (m *modulePin) IdentityString() string { - return m.remote + "/" + m.owner + "/" + m.repository -} - -func (*modulePin) isModuleOwner() {} -func (*modulePin) isModuleIdentity() {} -func (*modulePin) isModulePin() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_reference.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_reference.go deleted file mode 100644 index 2872efd87b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/module_reference.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" -) - -type moduleReference struct { - remote string - owner string - repository string - reference string -} - -func newModuleReference( - remote string, - owner string, - repository string, - reference string, -) (*moduleReference, error) { - protoModuleReference := &modulev1alpha1.ModuleReference{ - Remote: remote, - Owner: owner, - Repository: repository, - Reference: reference, - } - return newModuleReferenceForProto(protoModuleReference) -} - -func newModuleReferenceForProto( - protoModuleReference *modulev1alpha1.ModuleReference, -) (*moduleReference, error) { - if err := ValidateProtoModuleReference(protoModuleReference); err != nil { - return nil, err - } - return &moduleReference{ - remote: protoModuleReference.Remote, - owner: protoModuleReference.Owner, - repository: protoModuleReference.Repository, - reference: protoModuleReference.Reference, - }, nil -} - -func newProtoModuleReferenceForModuleReference( - moduleReference ModuleReference, -) *modulev1alpha1.ModuleReference { - // no need to validate as we know we have a valid ModuleReference constructed - // by this package due to the private interface - return &modulev1alpha1.ModuleReference{ - Remote: moduleReference.Remote(), - Owner: moduleReference.Owner(), - Repository: moduleReference.Repository(), - Reference: moduleReference.Reference(), - } -} - -func (m *moduleReference) Remote() string { - return m.remote -} - -func (m *moduleReference) Owner() string { - return m.owner -} - -func (m *moduleReference) Repository() string { - return m.repository -} - -func (m *moduleReference) Reference() string { - return m.reference -} - -func (m *moduleReference) String() string { - if m.reference == Main { - return m.remote + "/" + m.owner + "/" + m.repository - } - return m.remote + "/" + m.owner + "/" + m.repository + ":" + m.reference -} - -func (m *moduleReference) IdentityString() string { - return m.remote + "/" + m.owner + "/" + m.repository -} - -func (*moduleReference) isModuleOwner() {} -func (*moduleReference) isModuleIdentity() {} -func (*moduleReference) isModuleReference() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/usage.gen.go deleted file mode 100644 index e78305857a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmoduleref - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/util.go deleted file mode 100644 index 07776b76dd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/util.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - "fmt" - "strings" -) - -// parseModuleReferenceComponents parses and returns the remote, owner, repository, -// and ref (branch, commit, draft, or tag) from the given path. -func parseModuleReferenceComponents(path string) (remote string, owner string, repository string, ref string, err error) { - // split by the first "/" to separate the remote and remaining part - slashSplit := strings.SplitN(path, "/", 2) - if len(slashSplit) != 2 { - return "", "", "", "", newInvalidModuleReferenceStringError(path) - } - remote, rest := slashSplit[0], slashSplit[1] - // split the remaining part by ":" to separate the reference - colonSplit := strings.Split(rest, ":") - switch len(colonSplit) { - case 1: - // path excluding remote has no colon, no need to handle its ref - case 2: - ref = strings.TrimSpace(colonSplit[1]) - if ref == "" { - return "", "", "", "", newInvalidModuleReferenceStringError(path) - } - default: - return "", "", "", "", newInvalidModuleReferenceStringError(path) - } - remote, owner, repository, err = parseModuleIdentityComponents(remote + "/" + colonSplit[0]) - if err != nil { - return "", "", "", "", newInvalidModuleReferenceStringError(path) - } - return remote, owner, repository, ref, nil -} - -func parseModuleIdentityComponents(path string) (remote string, owner string, repository string, err error) { - slashSplit := strings.Split(path, "/") - if len(slashSplit) != 3 { - return "", "", "", newInvalidModuleIdentityStringError(path) - } - remote = strings.TrimSpace(slashSplit[0]) - if remote == "" { - return "", "", "", newInvalidModuleIdentityStringError(path) - } - owner = strings.TrimSpace(slashSplit[1]) - if owner == "" { - return "", "", "", newInvalidModuleIdentityStringError(path) - } - repository = strings.TrimSpace(slashSplit[2]) - if repository == "" { - return "", "", "", newInvalidModuleIdentityStringError(path) - } - return remote, owner, repository, nil -} - -func modulePinLess(a ModulePin, b ModulePin) bool { - return modulePinCompareTo(a, b) < 0 -} - -// return -1 if less -// return 1 if greater -// return 0 if equal -func modulePinCompareTo(a ModulePin, b ModulePin) int { - if a == nil && b == nil { - return 0 - } - if a == nil && b != nil { - return -1 - } - if a != nil && b == nil { - return 1 - } - if a.Remote() < b.Remote() { - return -1 - } - if a.Remote() > b.Remote() { - return 1 - } - if a.Owner() < b.Owner() { - return -1 - } - if a.Owner() > b.Owner() { - return 1 - } - if a.Repository() < b.Repository() { - return -1 - } - if a.Repository() > b.Repository() { - return 1 - } - if a.Branch() < b.Branch() { - return -1 - } - if a.Branch() > b.Branch() { - return 1 - } - if a.Commit() < b.Commit() { - return -1 - } - if a.Commit() > b.Commit() { - return 1 - } - if a.Digest() < b.Digest() { - return -1 - } - if a.Digest() > b.Digest() { - return 1 - } - if a.CreateTime().Before(b.CreateTime()) { - return -1 - } - if a.CreateTime().After(b.CreateTime()) { - return 1 - } - return 0 -} - -func newInvalidModuleOwnerStringError(s string) error { - return fmt.Errorf("module owner %q is invalid: must be in the form remote/owner", s) -} - -func newInvalidModuleIdentityStringError(s string) error { - return fmt.Errorf("module identity %q is invalid: must be in the form remote/owner/repository", s) -} - -func newInvalidModuleReferenceStringError(s string) error { - return fmt.Errorf("module reference %q is invalid: must be in the form remote/owner/repository:reference", s) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/validate.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/validate.go deleted file mode 100644 index f64a67c4ed..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref/validate.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmoduleref - -import ( - "errors" - "fmt" - "strings" - - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/app/appcmd" - "github.com/bufbuild/buf/private/pkg/netextended" -) - -// ValidateProtoModuleReference verifies the given module reference is well-formed. -// It performs client-side validation only, and is limited to fields -// we do not think will change in the future. -func ValidateProtoModuleReference(protoModuleReference *modulev1alpha1.ModuleReference) error { - if protoModuleReference == nil { - return errors.New("module reference is required") - } - if err := validateRemote(protoModuleReference.Remote); err != nil { - return err - } - if err := ValidateOwner(protoModuleReference.Owner, "owner"); err != nil { - return err - } - if err := ValidateRepository(protoModuleReference.Repository); err != nil { - return err - } - return ValidateReference(protoModuleReference.Reference) -} - -// ValidateProtoModulePin verifies the given module pin is well-formed. -// It performs client-side validation only, and is limited to fields -// we do not think will change in the future. -func ValidateProtoModulePin(protoModulePin *modulev1alpha1.ModulePin) error { - if protoModulePin == nil { - return errors.New("module pin is required") - } - if err := validateRemote(protoModulePin.Remote); err != nil { - return err - } - if err := ValidateOwner(protoModulePin.Owner, "owner"); err != nil { - return err - } - if err := ValidateRepository(protoModulePin.Repository); err != nil { - return err - } - if err := ValidateCommit(protoModulePin.Commit); err != nil { - return err - } - return nil -} - -// ValidateUser verifies the given user name is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateUser(user string) error { - return ValidateOwner(user, "user") -} - -// ValidateOrganization verifies the given organization name is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateOrganization(organization string) error { - return ValidateOwner(organization, "organization") -} - -// ValidateOwner verifies the given owner name is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateOwner(owner string, ownerType string) error { - if owner == "" { - return fmt.Errorf("%s name is required", ownerType) - } - return nil -} - -// ValidateRepository verifies the given repository name is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateRepository(repository string) error { - if repository == "" { - return errors.New("repository name is required") - } - return nil -} - -// ValidateReference validates that the given ModuleReference reference is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateReference(reference string) error { - if reference == "" { - return errors.New("repository reference is required") - } - return nil -} - -// ValidateCommit verifies the given commit is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateCommit(commit string) error { - if commit == "" { - return errors.New("empty commit") - } - return nil -} - -// ValidateBranch verifies the given repository branch is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateBranch(branch string) error { - if branch != Main { - return fmt.Errorf("branch is not %s", Main) - } - //if branch == "" { - // return errors.New("repository branch is required") - //} - return nil -} - -// ValidateTag verifies the given tag is well-formed. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateTag(tag string) error { - if tag == "" { - return errors.New("repository tag is required") - } - return nil -} - -// ValidateModuleFilePath validates that the module file path is not empty. -// It performs client-side validation only, and is limited to properties -// we do not think will change in the future. -func ValidateModuleFilePath(path string) error { - if path == "" { - return errors.New("empty path") - } - return nil -} - -// ValidateRemoteNotEmpty validates that the given remote address is not an empty string -// It performs client-side validation only, and is limited to fields -// we do not think will change in the future. -func ValidateRemoteNotEmpty(remote string) error { - if remote == "" { - return appcmd.NewInvalidArgumentError("you must specify a remote module") - } - return nil -} - -// ValidateRemoteHasNoPaths validates that the given remote address contains no paths/subdirectories after the root -// It performs client-side validation only, and is limited to fields -// we do not think will change in the future. -func ValidateRemoteHasNoPaths(remote string) error { - _, path, ok := strings.Cut(remote, "/") - if ok && path != "" { - return appcmd.NewInvalidArgumentError(fmt.Sprintf(`invalid remote address, must not contain any paths. Try removing "/%s" from the address.`, path)) - } - return nil -} - -func validateModuleOwner(moduleOwner ModuleOwner) error { - if moduleOwner == nil { - return errors.New("module owner is required") - } - if err := validateRemote(moduleOwner.Remote()); err != nil { - return err - } - if err := ValidateOwner(moduleOwner.Owner(), "owner"); err != nil { - return err - } - return nil -} - -func validateModuleIdentity(moduleIdentity ModuleIdentity) error { - if moduleIdentity == nil { - return errors.New("module identity is required") - } - if err := validateRemote(moduleIdentity.Remote()); err != nil { - return err - } - if err := ValidateOwner(moduleIdentity.Owner(), "owner"); err != nil { - return err - } - if err := ValidateRepository(moduleIdentity.Repository()); err != nil { - return err - } - return nil -} - -func validateRemote(remote string) error { - if _, err := netextended.ValidateHostname(remote); err != nil { - return fmt.Errorf("invalid remote %q: %w", remote, err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/bufmodulestat.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/bufmodulestat.go deleted file mode 100644 index ae2d4a7ee1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/bufmodulestat.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulestat - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "github.com/bufbuild/buf/private/pkg/protostat" -) - -// NewFileWalker returns a new FileWalker for the given Module. -// -// This walks all target files from TargetFileInfos. -// -// We use TargetFileInfos instead of SourceFileInfos as this means -// that if someone sets up a filter at a higher level, this will respect it. -// In most cases, TargetFileInfos is the same as SourceFileInfos. -func NewFileWalker(module bufmodule.Module) protostat.FileWalker { - return newFileWalker(module) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/file_walker.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/file_walker.go deleted file mode 100644 index ccfca400ed..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/file_walker.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodulestat - -import ( - "context" - "io" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule" - "go.uber.org/multierr" -) - -type fileWalker struct { - module bufmodule.Module -} - -func newFileWalker(module bufmodule.Module) *fileWalker { - return &fileWalker{ - module: module, - } -} - -func (f *fileWalker) Walk(ctx context.Context, fu func(io.Reader) error) error { - fileInfos, err := f.module.TargetFileInfos(ctx) - if err != nil { - return err - } - for _, fileInfo := range fileInfos { - moduleFile, err := f.module.GetModuleFile(ctx, fileInfo.Path()) - if err != nil { - return err - } - if err := fu(moduleFile); err != nil { - return multierr.Append(err, moduleFile.Close()) - } - if err := moduleFile.Close(); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/usage.gen.go deleted file mode 100644 index ff81568509..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmodulestat/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmodulestat - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/internal.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/internal.go deleted file mode 100644 index 4c26a2868a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/internal.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "fmt" - "sort" - - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -// NormalizeAndCheckPaths verifies that: -// -// - No paths are empty. -// - All paths are normalized and validated if pathType is Relative. -// - All paths are normalized if pathType is Absolute. -// -// If sortAndCheckDuplicates is true: - -// - All paths are unique. -// - No path contains another path. -// -// Normalizes the paths. -// Sorts the paths if sortAndCheckDuplicates is true. -// Makes the paths absolute if pathType is Absolute. -func NormalizeAndCheckPaths( - paths []string, - name string, - pathType normalpath.PathType, - sortAndCheckDuplicates bool, -) ([]string, error) { - if len(paths) == 0 { - return paths, nil - } - outputs := make([]string, len(paths)) - for i, path := range paths { - if path == "" { - return nil, fmt.Errorf("%s contained an empty path", name) - } - output, err := normalpath.NormalizeAndTransformForPathType(path, pathType) - if err != nil { - // user error - return nil, err - } - outputs[i] = output - } - if sortAndCheckDuplicates { - return sortAndCheckDuplicatePaths(outputs, name, pathType) - } - return outputs, nil -} - -// TODO: refactor this -func sortAndCheckDuplicatePaths(outputs []string, name string, pathType normalpath.PathType) ([]string, error) { - sort.Strings(outputs) - for i := 0; i < len(outputs); i++ { - for j := i + 1; j < len(outputs); j++ { - output1 := outputs[i] - output2 := outputs[j] - - if output1 == output2 { - return nil, fmt.Errorf("duplicate %s %q", name, output1) - } - if normalpath.EqualsOrContainsPath(output2, output1, pathType) { - return nil, fmt.Errorf("%s %q is within %s %q which is not allowed", name, output1, name, output2) - } - if normalpath.EqualsOrContainsPath(output1, output2, pathType) { - return nil, fmt.Errorf("%s %q is within %s %q which is not allowed", name, output2, name, output1) - } - } - } - - return outputs, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/usage.gen.go deleted file mode 100644 index b94f5ee09d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/internal/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package internal - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module.go deleted file mode 100644 index 63ba9dc464..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module.go +++ /dev/null @@ -1,371 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufcheck/bufbreaking/bufbreakingconfig" - "github.com/bufbuild/buf/private/bufpkg/bufcheck/buflint/buflintconfig" - "github.com/bufbuild/buf/private/bufpkg/bufconfig" - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - breakingv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1" - lintv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemanifest" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" -) - -type module struct { - sourceReadBucket storage.ReadBucket - declaredDirectDependencies []bufmoduleref.ModuleReference - dependencyModulePins []bufmoduleref.ModulePin - moduleIdentity bufmoduleref.ModuleIdentity - commit string - documentation string - documentationPath string - license string - breakingConfig *bufbreakingconfig.Config - lintConfig *buflintconfig.Config - manifest *manifest.Manifest - blobSet *manifest.BlobSet -} - -func newModuleForProto( - ctx context.Context, - protoModule *modulev1alpha1.Module, - options ...ModuleOption, -) (*module, error) { - if err := ValidateProtoModule(protoModule); err != nil { - return nil, err - } - // We store this as a ReadBucket as this should never be modified outside of this function. - readWriteBucket := storagemem.NewReadWriteBucket() - for _, moduleFile := range protoModule.Files { - if normalpath.Ext(moduleFile.Path) != ".proto" { - return nil, fmt.Errorf("expected .proto file but got %q", moduleFile) - } - // we already know that paths are unique from validation - if err := storage.PutPath(ctx, readWriteBucket, moduleFile.Path, moduleFile.Content); err != nil { - return nil, err - } - } - dependencyModulePins, err := bufmoduleref.NewModulePinsForProtos(protoModule.Dependencies...) - if err != nil { - return nil, err - } - breakingConfig, lintConfig, err := configsForProto(protoModule.GetBreakingConfig(), protoModule.GetLintConfig()) - if err != nil { - return nil, err - } - allDependenciesRefs := make([]bufmoduleref.ModuleReference, len(dependencyModulePins)) - for i, dep := range dependencyModulePins { - allDependenciesRefs[i], err = bufmoduleref.NewModuleReference( - dep.Remote(), dep.Owner(), dep.Repository(), dep.Commit(), - ) - if err != nil { - return nil, fmt.Errorf("cannot build module reference from dependency pin %s: %w", dep.String(), err) - } - } - return newModule( - ctx, - readWriteBucket, - allDependenciesRefs, // Since proto has no distinction between direct/transitive dependencies, we'll need to set them all as direct, otherwise the build will fail. - dependencyModulePins, - nil, // The module identity is not stored on the proto. We rely on the layer above, (e.g. `ModuleReader`) to set this as needed. - protoModule.GetDocumentation(), - protoModule.GetDocumentationPath(), - protoModule.GetLicense(), - breakingConfig, - lintConfig, - options..., - ) -} - -func configsForProto( - protoBreakingConfig *breakingv1.Config, - protoLintConfig *lintv1.Config, -) (*bufbreakingconfig.Config, *buflintconfig.Config, error) { - var breakingConfig *bufbreakingconfig.Config - var breakingConfigVersion string - if protoBreakingConfig != nil { - breakingConfig = bufbreakingconfig.ConfigForProto(protoBreakingConfig) - breakingConfigVersion = breakingConfig.Version - } - var lintConfig *buflintconfig.Config - var lintConfigVersion string - if protoLintConfig != nil { - lintConfig = buflintconfig.ConfigForProto(protoLintConfig) - lintConfigVersion = lintConfig.Version - } - if lintConfigVersion != breakingConfigVersion { - return nil, nil, fmt.Errorf("mismatched breaking config version %q and lint config version %q found", breakingConfigVersion, lintConfigVersion) - } - // If there is no breaking and lint configs, we want to default to the v1 version. - if breakingConfig == nil && lintConfig == nil { - breakingConfig = &bufbreakingconfig.Config{ - Version: bufconfig.V1Version, - } - lintConfig = &buflintconfig.Config{ - Version: bufconfig.V1Version, - } - } else if breakingConfig == nil { - // In the case that only breaking config is nil, we'll use generated an empty default config - // using the lint config version. - breakingConfig = &bufbreakingconfig.Config{ - Version: lintConfigVersion, - } - } else if lintConfig == nil { - // In the case that only lint config is nil, we'll use generated an empty default config - // using the breaking config version. - lintConfig = &buflintconfig.Config{ - Version: breakingConfigVersion, - } - } - // Finally, validate the config versions are valid. This should always pass in the case of - // the default values. - if err := bufconfig.ValidateVersion(breakingConfig.Version); err != nil { - return nil, nil, err - } - if err := bufconfig.ValidateVersion(lintConfig.Version); err != nil { - return nil, nil, err - } - return breakingConfig, lintConfig, nil -} - -func newModuleForBucket( - ctx context.Context, - sourceReadBucket storage.ReadBucket, - options ...ModuleOption, -) (*module, error) { - dependencyModulePins, err := bufmoduleref.DependencyModulePinsForBucket(ctx, sourceReadBucket) - if err != nil { - return nil, err - } - var documentation string - var documentationPath string - for _, docPath := range AllDocumentationPaths { - documentation, err = getFileContentForBucket(ctx, sourceReadBucket, docPath) - if err != nil { - return nil, err - } - if documentation != "" { - documentationPath = docPath - break - } - } - license, err := getFileContentForBucket(ctx, sourceReadBucket, LicenseFilePath) - if err != nil { - return nil, err - } - moduleConfig, err := bufconfig.GetConfigForBucket(ctx, sourceReadBucket) - if err != nil { - return nil, err - } - var moduleIdentity bufmoduleref.ModuleIdentity - // if the module config has an identity, set the module identity - if moduleConfig.ModuleIdentity != nil { - moduleIdentity = moduleConfig.ModuleIdentity - } - return newModule( - ctx, - storage.MapReadBucket(sourceReadBucket, storage.MatchPathExt(".proto")), - moduleConfig.Build.DependencyModuleReferences, // straight copy from the buf.yaml file - dependencyModulePins, - moduleIdentity, - documentation, - documentationPath, - license, - moduleConfig.Breaking, - moduleConfig.Lint, - options..., - ) -} - -func newModuleForManifestAndBlobSet( - ctx context.Context, - moduleManifest *manifest.Manifest, - blobSet *manifest.BlobSet, - options ...ModuleOption, -) (*module, error) { - bucket, err := storagemanifest.NewReadBucket( - moduleManifest, - blobSet, - storagemanifest.ReadBucketWithAllManifestBlobs(), - storagemanifest.ReadBucketWithNoExtraBlobs(), - ) - if err != nil { - return nil, err - } - module, err := newModuleForBucket(ctx, bucket, options...) - if err != nil { - return nil, err - } - module.manifest = moduleManifest - module.blobSet = blobSet - return module, nil -} - -// this should only be called by other newModule constructors -func newModule( - ctx context.Context, - // must only contain .proto files - sourceReadBucket storage.ReadBucket, - declaredDirectDependencies []bufmoduleref.ModuleReference, - dependencyModulePins []bufmoduleref.ModulePin, - moduleIdentity bufmoduleref.ModuleIdentity, - documentation string, - documentationPath string, - license string, - breakingConfig *bufbreakingconfig.Config, - lintConfig *buflintconfig.Config, - options ...ModuleOption, -) (_ *module, retErr error) { - if err := bufmoduleref.ValidateModuleReferencesUniqueByIdentity(declaredDirectDependencies); err != nil { - return nil, err - } - if err := bufmoduleref.ValidateModulePinsUniqueByIdentity(dependencyModulePins); err != nil { - return nil, err - } - // we rely on this being sorted here - bufmoduleref.SortModuleReferences(declaredDirectDependencies) - bufmoduleref.SortModulePins(dependencyModulePins) - module := &module{ - sourceReadBucket: sourceReadBucket, - declaredDirectDependencies: declaredDirectDependencies, - dependencyModulePins: dependencyModulePins, - moduleIdentity: moduleIdentity, - documentation: documentation, - documentationPath: documentationPath, - license: license, - breakingConfig: breakingConfig, - lintConfig: lintConfig, - } - for _, option := range options { - option(module) - } - if module.moduleIdentity == nil && module.commit != "" { - return nil, fmt.Errorf("module was constructed with commit %q but no associated ModuleIdentity", module.commit) - } - return module, nil -} - -func (m *module) TargetFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) { - return m.SourceFileInfos(ctx) -} - -func (m *module) SourceFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) { - var fileInfos []bufmoduleref.FileInfo - if walkErr := m.sourceReadBucket.Walk(ctx, "", func(objectInfo storage.ObjectInfo) error { - // super overkill but ok - if err := bufmoduleref.ValidateModuleFilePath(objectInfo.Path()); err != nil { - return err - } - fileInfo, err := bufmoduleref.NewFileInfo( - objectInfo.Path(), - objectInfo.ExternalPath(), - false, - m.moduleIdentity, - m.commit, - ) - if err != nil { - return err - } - fileInfos = append(fileInfos, fileInfo) - return nil - }); walkErr != nil { - return nil, fmt.Errorf("failed to enumerate module files: %w", walkErr) - } - bufmoduleref.SortFileInfos(fileInfos) - return fileInfos, nil -} - -func (m *module) GetModuleFile(ctx context.Context, path string) (ModuleFile, error) { - // super overkill but ok - if err := bufmoduleref.ValidateModuleFilePath(path); err != nil { - return nil, err - } - readObjectCloser, err := m.sourceReadBucket.Get(ctx, path) - if err != nil { - return nil, err - } - fileInfo, err := bufmoduleref.NewFileInfo( - readObjectCloser.Path(), - readObjectCloser.ExternalPath(), - false, - m.moduleIdentity, - m.commit, - ) - if err != nil { - return nil, err - } - return newModuleFile(fileInfo, readObjectCloser), nil -} - -func (m *module) DeclaredDirectDependencies() []bufmoduleref.ModuleReference { - // already sorted in constructor - return m.declaredDirectDependencies -} - -func (m *module) DependencyModulePins() []bufmoduleref.ModulePin { - // already sorted in constructor - return m.dependencyModulePins -} - -func (m *module) Documentation() string { - return m.documentation -} - -func (m *module) DocumentationPath() string { - return m.documentationPath -} - -func (m *module) License() string { - return m.license -} - -func (m *module) BreakingConfig() *bufbreakingconfig.Config { - return m.breakingConfig -} - -func (m *module) LintConfig() *buflintconfig.Config { - return m.lintConfig -} - -func (m *module) Manifest() *manifest.Manifest { - return m.manifest -} - -func (m *module) BlobSet() *manifest.BlobSet { - return m.blobSet -} - -func (m *module) ModuleIdentity() bufmoduleref.ModuleIdentity { - return m.moduleIdentity -} - -func (m *module) Commit() string { - return m.commit -} - -func (m *module) getSourceReadBucket() storage.ReadBucket { - return m.sourceReadBucket -} - -func (m *module) isModule() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file.go deleted file mode 100644 index 5d9db4ac5e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "io" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" -) - -var _ ModuleFile = &moduleFile{} - -type moduleFile struct { - bufmoduleref.FileInfo - io.ReadCloser -} - -func newModuleFile(fileInfo bufmoduleref.FileInfo, readCloser io.ReadCloser) moduleFile { - return moduleFile{ - FileInfo: fileInfo, - ReadCloser: readCloser, - } -} - -func (moduleFile) isModuleFile() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file_set.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file_set.go deleted file mode 100644 index 22a5718646..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_file_set.go +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -var _ ModuleFileSet = &moduleFileSet{} - -type moduleFileSet struct { - Module - - allModuleReadBucket moduleReadBucket -} - -func newModuleFileSet( - module Module, - dependencies []Module, -) *moduleFileSet { - // TODO: We can remove the getModuleRef method on the - // Module type if we fetch FileInfos from the Module - // and plumb in the ModuleRef here. - // - // This approach assumes that all of the FileInfos returned - // from SourceFileInfos will have their ModuleRef - // set to the same value. That can be enforced here. - moduleReadBuckets := []moduleReadBucket{ - newSingleModuleReadBucket( - module.getSourceReadBucket(), - module.ModuleIdentity(), - module.Commit(), - ), - } - for _, dependency := range dependencies { - moduleReadBuckets = append( - moduleReadBuckets, - newSingleModuleReadBucket( - dependency.getSourceReadBucket(), - dependency.ModuleIdentity(), - dependency.Commit(), - ), - ) - } - return &moduleFileSet{ - Module: module, - allModuleReadBucket: newMultiModuleReadBucket(moduleReadBuckets...), - } -} - -func (m *moduleFileSet) AllFileInfos(ctx context.Context) ([]bufmoduleref.FileInfo, error) { - var fileInfos []bufmoduleref.FileInfo - if walkErr := m.allModuleReadBucket.WalkModuleFiles(ctx, "", func(moduleObjectInfo *moduleObjectInfo) error { - if err := bufmoduleref.ValidateModuleFilePath(moduleObjectInfo.Path()); err != nil { - return err - } - isNotImport, err := storage.Exists(ctx, m.Module.getSourceReadBucket(), moduleObjectInfo.Path()) - if err != nil { - return err - } - fileInfo, err := bufmoduleref.NewFileInfo( - moduleObjectInfo.Path(), - moduleObjectInfo.ExternalPath(), - !isNotImport, - moduleObjectInfo.ModuleIdentity(), - moduleObjectInfo.Commit(), - ) - if err != nil { - return err - } - fileInfos = append(fileInfos, fileInfo) - return nil - }); walkErr != nil { - return nil, walkErr - } - bufmoduleref.SortFileInfos(fileInfos) - return fileInfos, nil -} - -func (m *moduleFileSet) GetModuleFile(ctx context.Context, path string) (ModuleFile, error) { - if err := bufmoduleref.ValidateModuleFilePath(path); err != nil { - return nil, err - } - readObjectCloser, err := m.allModuleReadBucket.Get(ctx, path) - if err != nil { - return nil, err - } - isNotImport, err := storage.Exists(ctx, m.Module.getSourceReadBucket(), path) - if err != nil { - return nil, err - } - moduleObjectInfo, err := m.allModuleReadBucket.StatModuleFile(ctx, path) - if err != nil { - return nil, err - } - fileInfo, err := bufmoduleref.NewFileInfo( - readObjectCloser.Path(), - readObjectCloser.ExternalPath(), - !isNotImport, - moduleObjectInfo.ModuleIdentity(), - moduleObjectInfo.Commit(), - ) - if err != nil { - return nil, err - } - return newModuleFile(fileInfo, readObjectCloser), nil -} - -func (*moduleFileSet) isModuleFileSet() {} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_object_info.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_object_info.go deleted file mode 100644 index d212528cc4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_object_info.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -// moduleObjectInfo is used in moduleReadBucket. -type moduleObjectInfo struct { - storage.ObjectInfo - - moduleIdentity bufmoduleref.ModuleIdentity - commit string -} - -func newModuleObjectInfo( - storageObjectInfo storage.ObjectInfo, - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, -) *moduleObjectInfo { - return &moduleObjectInfo{ - ObjectInfo: storageObjectInfo, - moduleIdentity: moduleIdentity, - commit: commit, - } -} - -func (o *moduleObjectInfo) ModuleIdentity() bufmoduleref.ModuleIdentity { - return o.moduleIdentity -} - -func (o *moduleObjectInfo) Commit() string { - return o.commit -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_read_bucket.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_read_bucket.go deleted file mode 100644 index 6f2e312f99..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/module_read_bucket.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/pkg/storage" -) - -// moduleReadBucket is a ReadBucket that has associated module information. -// -// this is a helper type used in moduleFileSet. -type moduleReadBucket interface { - storage.ReadBucket - - // StatModuleFile gets info in the object, including info - // specific to the file's module. - StatModuleFile(ctx context.Context, path string) (*moduleObjectInfo, error) - // WalkModuleFiles walks the bucket with the prefix, calling f on - // each path. If the prefix doesn't exist, this is a no-op. - WalkModuleFiles(ctx context.Context, path string, f func(*moduleObjectInfo) error) error -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/multi_module_read_bucket.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/multi_module_read_bucket.go deleted file mode 100644 index 2f8507524f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/multi_module_read_bucket.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/pkg/storage" -) - -type multiModuleReadBucket struct { - storage.ReadBucket - - delegates []moduleReadBucket -} - -func newMultiModuleReadBucket( - delegates ...moduleReadBucket, -) *multiModuleReadBucket { - storageReadBuckets := make([]storage.ReadBucket, len(delegates)) - for i, delegate := range delegates { - storageReadBuckets[i] = delegate - } - return &multiModuleReadBucket{ - ReadBucket: storage.MultiReadBucket(storageReadBuckets...), - delegates: delegates, - } -} - -func (m *multiModuleReadBucket) StatModuleFile(ctx context.Context, path string) (*moduleObjectInfo, error) { - for _, delegate := range m.delegates { - objectInfo, err := delegate.StatModuleFile(ctx, path) - if err != nil { - if storage.IsNotExist(err) { - continue - } - return nil, err - } - return objectInfo, nil - } - return nil, storage.NewErrNotExist(path) -} - -func (m *multiModuleReadBucket) WalkModuleFiles(ctx context.Context, prefix string, f func(*moduleObjectInfo) error) error { - for _, delegate := range m.delegates { - if err := delegate.WalkModuleFiles(ctx, prefix, f); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_reader.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_reader.go deleted file mode 100644 index 036a62f86d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_reader.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type nopModuleReader struct{} - -func newNopModuleReader() *nopModuleReader { - return &nopModuleReader{} -} - -func (*nopModuleReader) GetModule(_ context.Context, modulePin bufmoduleref.ModulePin) (Module, error) { - return nil, storage.NewErrNotExist(modulePin.String()) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_resolver.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_resolver.go deleted file mode 100644 index 2b7d6c5cda..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/nop_module_resolver.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type nopModuleResolver struct{} - -func newNopModuleResolver() *nopModuleResolver { - return &nopModuleResolver{} -} - -func (*nopModuleResolver) GetModulePin(_ context.Context, moduleReference bufmoduleref.ModuleReference) (bufmoduleref.ModulePin, error) { - return nil, storage.NewErrNotExist(moduleReference.String()) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/single_module_read_bucket.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/single_module_read_bucket.go deleted file mode 100644 index 00ab80f6ca..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/single_module_read_bucket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type singleModuleReadBucket struct { - storage.ReadBucket - - moduleIdentity bufmoduleref.ModuleIdentity - commit string -} - -func newSingleModuleReadBucket( - sourceReadBucket storage.ReadBucket, - moduleIdentity bufmoduleref.ModuleIdentity, - commit string, -) *singleModuleReadBucket { - return &singleModuleReadBucket{ - ReadBucket: sourceReadBucket, - moduleIdentity: moduleIdentity, - commit: commit, - } -} - -func (r *singleModuleReadBucket) StatModuleFile(ctx context.Context, path string) (*moduleObjectInfo, error) { - objectInfo, err := r.ReadBucket.Stat(ctx, path) - if err != nil { - return nil, err - } - return newModuleObjectInfo(objectInfo, r.moduleIdentity, r.commit), nil -} - -func (r *singleModuleReadBucket) WalkModuleFiles(ctx context.Context, path string, f func(*moduleObjectInfo) error) error { - return r.ReadBucket.Walk( - ctx, - path, - func(objectInfo storage.ObjectInfo) error { - return f(newModuleObjectInfo(objectInfo, r.moduleIdentity, r.commit)) - }, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/targeting_module.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/targeting_module.go deleted file mode 100644 index 701518b859..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/targeting_module.go +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -type targetingModule struct { - Module - targetPaths []string - pathsAllowNotExistOnWalk bool - excludePaths []string -} - -func newTargetingModule( - delegate Module, - targetPaths []string, - excludePaths []string, - pathsAllowNotExistOnWalk bool, -) (*targetingModule, error) { - if err := normalpath.ValidatePathsNormalizedValidatedUnique(targetPaths); err != nil { - return nil, err - } - return &targetingModule{ - Module: delegate, - targetPaths: targetPaths, - pathsAllowNotExistOnWalk: pathsAllowNotExistOnWalk, - excludePaths: excludePaths, - }, nil -} - -func (m *targetingModule) TargetFileInfos(ctx context.Context) (fileInfos []bufmoduleref.FileInfo, retErr error) { - defer func() { - if retErr == nil { - bufmoduleref.SortFileInfos(fileInfos) - } - }() - excludePathMap := stringutil.SliceToMap(m.excludePaths) - // We start by ensuring that no paths have been duplicated between target and exclude pathes. - for _, targetPath := range m.targetPaths { - if _, ok := excludePathMap[targetPath]; ok { - return nil, fmt.Errorf( - "cannot set the same path for both --path and --exclude-path flags: %s", - normalpath.Unnormalize(targetPath), - ) - } - } - sourceReadBucket := m.getSourceReadBucket() - // potentialDirPaths are paths that we need to check if they are directories. - // These are any files that do not end in .proto, as well as files that end in .proto, but - // do not have a corresponding file in the source ReadBucket. - // If there is not an file the path ending in .proto could be a directory - // that itself contains files, i.e. a/b.proto/c.proto is valid. - var potentialDirPaths []string - // fileInfoPaths are the paths that are files, so we return them as a separate set. - fileInfoPaths := make(map[string]struct{}) - // If m.targetPaths == nil then we are accepting all paths and we only need to filter on - // the excluded paths. - // - // In the event that we do have target paths, we need first gather up all the target paths - // that are proto files. If all target paths proto files, we can return them first. - if m.targetPaths != nil { - for _, targetPath := range m.targetPaths { - if normalpath.Ext(targetPath) != ".proto" { - // not a .proto file, therefore must be a directory - potentialDirPaths = append(potentialDirPaths, targetPath) - } else { - objectInfo, err := sourceReadBucket.Stat(ctx, targetPath) - if err != nil { - if !storage.IsNotExist(err) { - return nil, err - } - // we do not have a file, so even though this path ends - // in .proto, this could be a directory - we need to check it - potentialDirPaths = append(potentialDirPaths, targetPath) - } else { - // Since all of these are specific files to include, and we've already checked - // for duplicated excludes, we know that this file is not excluded. - // We have a file, therefore the targetPath was a file path - // add to the nonImportImageFiles if does not already exist - if _, ok := fileInfoPaths[targetPath]; !ok { - fileInfoPaths[targetPath] = struct{}{} - fileInfo, err := bufmoduleref.NewFileInfo( - objectInfo.Path(), - objectInfo.ExternalPath(), - false, - m.Module.ModuleIdentity(), - m.Module.Commit(), - ) - if err != nil { - return nil, err - } - fileInfos = append(fileInfos, fileInfo) - } - } - } - } - if len(potentialDirPaths) == 0 { - // We had no potential directory paths as we were able to get - // an file for all targetPaths, so we can return the FileInfos now - // this means we do not have to do the expensive O(sourceReadBucketSize) operation - // to check to see if each file is within a potential directory path. - if !m.pathsAllowNotExistOnWalk { - foundPathSentinelError := errors.New("sentinel") - for _, excludePath := range m.excludePaths { - var foundPath bool - if walkErr := sourceReadBucket.Walk( - ctx, - "", - func(objectInfo storage.ObjectInfo) error { - if normalpath.EqualsOrContainsPath(excludePath, objectInfo.Path(), normalpath.Relative) { - foundPath = true - // We return early using the sentinel error here, since we don't need to do - // the rest of the walk if the path is found. - return foundPathSentinelError - } - return nil - }, - ); walkErr != nil && !errors.Is(walkErr, foundPathSentinelError) { - return nil, walkErr - } - if !foundPath { - return nil, fmt.Errorf("path %q has no matching file in the image", excludePath) - } - } - } - return fileInfos, nil - } - } - // We have potential directory paths, do the expensive operation to - // make a map of the directory paths. - potentialDirPathMap := stringutil.SliceToMap(potentialDirPaths) - // The map of paths within potentialDirPath that matches a file. - // This needs to contain all paths in potentialDirPathMap at the end for us to - // have had matches for every targetPath input. - matchingPotentialDirPathMap := make(map[string]struct{}) - // The map of exclude paths that have a match on the walk. This is used to check against - // pathsAllowNotExistOnWalk. - matchingExcludePaths := make(map[string]struct{}) - if walkErr := sourceReadBucket.Walk( - ctx, - "", - func(objectInfo storage.ObjectInfo) error { - path := objectInfo.Path() - fileMatchingExcludePathMap := normalpath.MapAllEqualOrContainingPathMap( - excludePathMap, - path, - normalpath.Relative, - ) - for excludeMatchingPath := range fileMatchingExcludePathMap { - if _, ok := matchingExcludePaths[excludeMatchingPath]; !ok { - matchingExcludePaths[excludeMatchingPath] = struct{}{} - } - } - // get the paths in potentialDirPathMap that match this path - fileMatchingPathMap := normalpath.MapAllEqualOrContainingPathMap( - potentialDirPathMap, - path, - normalpath.Relative, - ) - if shouldExcludeFile(fileMatchingPathMap, fileMatchingExcludePathMap) { - return nil - } - if m.targetPaths != nil { - // We had a match, this means that some path in potentialDirPaths matched - // the path, add all the paths in potentialDirPathMap that - // matched to matchingPotentialDirPathMap. - for key := range fileMatchingPathMap { - matchingPotentialDirPathMap[key] = struct{}{} - } - } - // then, add the file if it is not added - if _, ok := fileInfoPaths[path]; !ok { - fileInfoPaths[path] = struct{}{} - fileInfo, err := bufmoduleref.NewFileInfo( - objectInfo.Path(), - objectInfo.ExternalPath(), - false, - m.Module.ModuleIdentity(), - m.Module.Commit(), - ) - if err != nil { - return err - } - fileInfos = append(fileInfos, fileInfo) - } - return nil - }, - ); walkErr != nil { - return nil, walkErr - } - // if !allowNotExist, i.e. if all targetPaths must have a matching file, - // we check the matchingPotentialDirPathMap against the potentialDirPathMap - // to make sure that potentialDirPathMap is covered - if !m.pathsAllowNotExistOnWalk { - for potentialDirPath := range potentialDirPathMap { - if _, ok := matchingPotentialDirPathMap[potentialDirPath]; !ok { - // no match, this is an error given that allowNotExist is false - return nil, fmt.Errorf("path %q has no matching file in the module", potentialDirPath) - } - } - for excludePath := range excludePathMap { - if _, ok := matchingExcludePaths[excludePath]; !ok { - // no match, this is an error given that allowNotExist is false - return nil, fmt.Errorf("path %q has no matching file in the module", excludePath) - } - } - } - return fileInfos, nil -} - -func shouldExcludeFile( - fileMatchingPathMap map[string]struct{}, - fileMatchingExcludePathMap map[string]struct{}, -) bool { - if fileMatchingPathMap == nil { - return len(fileMatchingExcludePathMap) > 0 - } - for fileMatchingPath := range fileMatchingPathMap { - for fileMatchingExcludePath := range fileMatchingExcludePathMap { - if normalpath.EqualsOrContainsPath(fileMatchingPath, fileMatchingExcludePath, normalpath.Relative) { - delete(fileMatchingPathMap, fileMatchingPath) - continue - } - } - } - return len(fileMatchingPathMap) == 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/usage.gen.go deleted file mode 100644 index 74c98b9bb0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufmodule - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/util.go deleted file mode 100644 index d7e2e9fd0f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/util.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - "io" - "sort" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" -) - -func putModuleFileToBucket(ctx context.Context, module Module, path string, writeBucket storage.WriteBucket) (retErr error) { - moduleFile, err := module.GetModuleFile(ctx, path) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, moduleFile.Close()) - }() - var copyOptions []storage.CopyOption - if writeBucket.SetExternalPathSupported() { - copyOptions = append(copyOptions, storage.CopyWithExternalPaths()) - } - return storage.CopyReadObject(ctx, writeBucket, moduleFile, copyOptions...) -} - -func moduleFileToProto(ctx context.Context, module Module, path string) (_ *modulev1alpha1.ModuleFile, retErr error) { - protoModuleFile := &modulev1alpha1.ModuleFile{ - Path: path, - } - moduleFile, err := module.GetModuleFile(ctx, path) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, moduleFile.Close()) - }() - protoModuleFile.Content, err = io.ReadAll(moduleFile) - if err != nil { - return nil, err - } - return protoModuleFile, nil -} - -func getFileContentForBucket( - ctx context.Context, - readBucket storage.ReadBucket, - path string, -) (string, error) { - data, err := storage.ReadPath(ctx, readBucket, path) - if err != nil { - if storage.IsNotExist(err) { - return "", nil - } - return "", err - } - return string(data), nil -} - -func copyModulePinsSortedByOnlyCommit(modulePins []bufmoduleref.ModulePin) []bufmoduleref.ModulePin { - s := make([]bufmoduleref.ModulePin, len(modulePins)) - copy(s, modulePins) - sort.Slice(s, func(i, j int) bool { - return modulePinLessOnlyCommit(s[i], s[j]) - }) - return s -} - -func modulePinLessOnlyCommit(a bufmoduleref.ModulePin, b bufmoduleref.ModulePin) bool { - return modulePinCompareToOnlyCommit(a, b) < 0 -} - -// return -1 if less -// return 1 if greater -// return 0 if equal -func modulePinCompareToOnlyCommit(a bufmoduleref.ModulePin, b bufmoduleref.ModulePin) int { - if a == nil && b == nil { - return 0 - } - if a == nil && b != nil { - return -1 - } - if a != nil && b == nil { - return 1 - } - if a.Remote() < b.Remote() { - return -1 - } - if a.Remote() > b.Remote() { - return 1 - } - if a.Owner() < b.Owner() { - return -1 - } - if a.Owner() > b.Owner() { - return 1 - } - if a.Repository() < b.Repository() { - return -1 - } - if a.Repository() > b.Repository() { - return 1 - } - if a.Commit() < b.Commit() { - return -1 - } - if a.Commit() > b.Commit() { - return 1 - } - return 0 -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/validate.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/validate.go deleted file mode 100644 index 1a3ef7c7d1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/validate.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "errors" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - modulev1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" -) - -const ( - // 32MB - maxModuleTotalContentLength = 32 << 20 - protoFileMaxCount = 16384 -) - -// ValidateProtoModule verifies the given module is well-formed. -// It performs client-side validation only, and is limited to fields -// we do not think will change in the future. -func ValidateProtoModule(protoModule *modulev1alpha1.Module) error { - if protoModule == nil { - return errors.New("module is required") - } - if len(protoModule.Files) == 0 { - return errors.New("module has no files") - } - if len(protoModule.Files) > protoFileMaxCount { - return fmt.Errorf("module can contain at most %d files", protoFileMaxCount) - } - totalContentLength := 0 - filePathMap := make(map[string]struct{}, len(protoModule.Files)) - for _, protoModuleFile := range protoModule.Files { - if err := bufmoduleref.ValidateModuleFilePath(protoModuleFile.Path); err != nil { - return err - } - if _, ok := filePathMap[protoModuleFile.Path]; ok { - return fmt.Errorf("duplicate module file path: %s", protoModuleFile.Path) - } - filePathMap[protoModuleFile.Path] = struct{}{} - totalContentLength += len(protoModuleFile.Content) - } - if totalContentLength > maxModuleTotalContentLength { - return fmt.Errorf("total module content length is %d when max is %d", totalContentLength, maxModuleTotalContentLength) - } - for _, dependency := range protoModule.Dependencies { - if err := bufmoduleref.ValidateProtoModulePin(dependency); err != nil { - return fmt.Errorf("module had invalid dependency: %v", err) - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/workspace.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/workspace.go deleted file mode 100644 index e62d5722aa..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufmodule/workspace.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufmodule - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufmodule/bufmoduleref" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type workspace struct { - // bufmoduleref.ModuleIdentity -> bufmodule.Module - namedModules map[string]Module - allModules []Module -} - -func newWorkspace( - ctx context.Context, - namedModules map[string]Module, - allModules []Module, -) (*workspace, error) { - pathToExternalPaths := make(map[string][]string) - for _, module := range allModules { - fileInfos, err := module.SourceFileInfos(ctx) - if err != nil { - return nil, err - } - for _, fileInfo := range fileInfos { - pathToExternalPaths[fileInfo.Path()] = append(pathToExternalPaths[fileInfo.Path()], fileInfo.ExternalPath()) - } - } - for path, externalPaths := range pathToExternalPaths { - // Will be >1 even if the externalPaths are equal, we mostly care ab0out the count - if len(externalPaths) > 1 { - return nil, storage.NewErrExistsMultipleLocations(path, externalPaths...) - } - } - return &workspace{ - namedModules: namedModules, - allModules: allModules, - }, nil -} - -func (w *workspace) GetModule(moduleIdentity bufmoduleref.ModuleIdentity) (Module, bool) { - module, ok := w.namedModules[moduleIdentity.IdentityString()] - return module, ok -} - -func (w *workspace) GetModules() []Module { - return w.allModules -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugin.go deleted file mode 100644 index e741c89b27..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugin.go +++ /dev/null @@ -1,502 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufplugin - -import ( - "fmt" - "sort" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - registryv1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1" -) - -// Plugin represents a plugin defined by a buf.plugin.yaml. -type Plugin interface { - // Version is the version of the plugin's implementation - // (e.g. the protoc-gen-connect-go implementation is v0.2.0). - Version() string - // SourceURL is an optional attribute used to specify where the source - // for the plugin can be found. - SourceURL() string - // Description is an optional attribute to provide a more detailed - // description for the plugin. - Description() string - // Dependencies are the dependencies this plugin has on other plugins. - // - // An example of a dependency might be a 'protoc-gen-go-grpc' plugin - // which depends on the 'protoc-gen-go' generated code. - Dependencies() []bufpluginref.PluginReference - // Registry is the registry configuration, which lets the user specify - // registry dependencies, and other metadata that applies to a specific - // remote generation registry (e.g. the Go module proxy, NPM registry, - // etc). - Registry() *bufpluginconfig.RegistryConfig - // ContainerImageDigest returns the plugin's source image digest. - // - // For now, we only support docker image sources, but this - // might evolve to support others later on. - ContainerImageDigest() string -} - -// NewPlugin creates a new plugin from the given configuration and image digest. -func NewPlugin( - version string, - dependencies []bufpluginref.PluginReference, - registryConfig *bufpluginconfig.RegistryConfig, - imageDigest string, - sourceURL string, - description string, -) (Plugin, error) { - return newPlugin(version, dependencies, registryConfig, imageDigest, sourceURL, description) -} - -// PluginToProtoPluginRegistryType determines the appropriate registryv1alpha1.PluginRegistryType for the plugin. -func PluginToProtoPluginRegistryType(plugin Plugin) registryv1alpha1.PluginRegistryType { - registryType := registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED - if plugin.Registry() != nil { - if plugin.Registry().Go != nil { - registryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_GO - } else if plugin.Registry().NPM != nil { - registryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM - } else if plugin.Registry().Maven != nil { - registryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN - } else if plugin.Registry().Swift != nil { - registryType = registryv1alpha1.PluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT - } - } - return registryType -} - -// OutputLanguagesToProtoLanguages determines the appropriate registryv1alpha1.PluginRegistryType for the plugin. -func OutputLanguagesToProtoLanguages(languages []string) ([]registryv1alpha1.PluginLanguage, error) { - languageToEnum := make(map[string]registryv1alpha1.PluginLanguage) - var supportedLanguages []string - for pluginLanguageKey, pluginLanguage := range registryv1alpha1.PluginLanguage_value { - if pluginLanguage == 0 { - continue - } - pluginLanguageKey := strings.TrimPrefix(pluginLanguageKey, "PLUGIN_LANGUAGE_") - pluginLanguageKey = strings.ToLower(pluginLanguageKey) - // Example: - // { go: 1, javascript: 2 } - languageToEnum[pluginLanguageKey] = registryv1alpha1.PluginLanguage(pluginLanguage) - supportedLanguages = append(supportedLanguages, pluginLanguageKey) - } - sort.Strings(supportedLanguages) - var protoLanguages []registryv1alpha1.PluginLanguage - for _, language := range languages { - if pluginLanguage, ok := languageToEnum[language]; ok { - protoLanguages = append(protoLanguages, pluginLanguage) - continue - } - return nil, fmt.Errorf("invalid plugin output language: %q\nsupported languages: %s", language, strings.Join(supportedLanguages, ", ")) - } - sort.Slice(protoLanguages, func(i, j int) bool { - return protoLanguages[i] < protoLanguages[j] - }) - return protoLanguages, nil -} - -// PluginRegistryToProtoRegistryConfig converts a bufpluginconfig.RegistryConfig to a registryv1alpha1.RegistryConfig. -func PluginRegistryToProtoRegistryConfig(pluginRegistry *bufpluginconfig.RegistryConfig) (*registryv1alpha1.RegistryConfig, error) { - if pluginRegistry == nil { - return nil, nil - } - registryConfig := ®istryv1alpha1.RegistryConfig{ - Options: bufpluginconfig.PluginOptionsToOptionsSlice(pluginRegistry.Options), - } - if pluginRegistry.Go != nil { - goConfig := ®istryv1alpha1.GoConfig{} - goConfig.MinimumVersion = pluginRegistry.Go.MinVersion - if pluginRegistry.Go.Deps != nil { - goConfig.RuntimeLibraries = make([]*registryv1alpha1.GoConfig_RuntimeLibrary, 0, len(pluginRegistry.Go.Deps)) - for _, dependency := range pluginRegistry.Go.Deps { - goConfig.RuntimeLibraries = append(goConfig.RuntimeLibraries, goRuntimeDependencyToProtoGoRuntimeLibrary(dependency)) - } - } - registryConfig.RegistryConfig = ®istryv1alpha1.RegistryConfig_GoConfig{GoConfig: goConfig} - } else if pluginRegistry.NPM != nil { - importStyle, err := npmImportStyleToNPMProtoImportStyle(pluginRegistry.NPM.ImportStyle) - if err != nil { - return nil, err - } - npmConfig := ®istryv1alpha1.NPMConfig{ - RewriteImportPathSuffix: pluginRegistry.NPM.RewriteImportPathSuffix, - ImportStyle: importStyle, - } - if pluginRegistry.NPM.Deps != nil { - npmConfig.RuntimeLibraries = make([]*registryv1alpha1.NPMConfig_RuntimeLibrary, 0, len(pluginRegistry.NPM.Deps)) - for _, dependency := range pluginRegistry.NPM.Deps { - npmConfig.RuntimeLibraries = append(npmConfig.RuntimeLibraries, npmRuntimeDependencyToProtoNPMRuntimeLibrary(dependency)) - } - } - registryConfig.RegistryConfig = ®istryv1alpha1.RegistryConfig_NpmConfig{NpmConfig: npmConfig} - } else if pluginRegistry.Maven != nil { - mavenConfig := ®istryv1alpha1.MavenConfig{} - var javaCompilerConfig *registryv1alpha1.MavenConfig_CompilerJavaConfig - if compiler := pluginRegistry.Maven.Compiler.Java; compiler != (bufpluginconfig.MavenCompilerJavaConfig{}) { - javaCompilerConfig = ®istryv1alpha1.MavenConfig_CompilerJavaConfig{ - Encoding: compiler.Encoding, - Release: int32(compiler.Release), - Source: int32(compiler.Source), - Target: int32(compiler.Target), - } - } - var kotlinCompilerConfig *registryv1alpha1.MavenConfig_CompilerKotlinConfig - if compiler := pluginRegistry.Maven.Compiler.Kotlin; compiler != (bufpluginconfig.MavenCompilerKotlinConfig{}) { - kotlinCompilerConfig = ®istryv1alpha1.MavenConfig_CompilerKotlinConfig{ - Version: compiler.Version, - ApiVersion: compiler.APIVersion, - JvmTarget: compiler.JVMTarget, - LanguageVersion: compiler.LanguageVersion, - } - } - if javaCompilerConfig != nil || kotlinCompilerConfig != nil { - mavenConfig.Compiler = ®istryv1alpha1.MavenConfig_CompilerConfig{ - Java: javaCompilerConfig, - Kotlin: kotlinCompilerConfig, - } - } - if pluginRegistry.Maven.Deps != nil { - mavenConfig.RuntimeLibraries = make([]*registryv1alpha1.MavenConfig_RuntimeLibrary, len(pluginRegistry.Maven.Deps)) - for i, dependency := range pluginRegistry.Maven.Deps { - mavenConfig.RuntimeLibraries[i] = MavenDependencyConfigToProtoRuntimeLibrary(dependency) - } - } - if pluginRegistry.Maven.AdditionalRuntimes != nil { - mavenConfig.AdditionalRuntimes = make([]*registryv1alpha1.MavenConfig_RuntimeConfig, len(pluginRegistry.Maven.AdditionalRuntimes)) - for i, runtime := range pluginRegistry.Maven.AdditionalRuntimes { - mavenConfig.AdditionalRuntimes[i] = MavenRuntimeConfigToProtoRuntimeConfig(runtime) - } - } - registryConfig.RegistryConfig = ®istryv1alpha1.RegistryConfig_MavenConfig{MavenConfig: mavenConfig} - } else if pluginRegistry.Swift != nil { - swiftConfig := SwiftRegistryConfigToProtoSwiftConfig(pluginRegistry.Swift) - registryConfig.RegistryConfig = ®istryv1alpha1.RegistryConfig_SwiftConfig{SwiftConfig: swiftConfig} - } - return registryConfig, nil -} - -// MavenDependencyConfigToProtoRuntimeLibrary converts a bufpluginconfig.MavenDependencyConfig to an equivalent registryv1alpha1.MavenConfig_RuntimeLibrary. -func MavenDependencyConfigToProtoRuntimeLibrary(dependency bufpluginconfig.MavenDependencyConfig) *registryv1alpha1.MavenConfig_RuntimeLibrary { - return ®istryv1alpha1.MavenConfig_RuntimeLibrary{ - GroupId: dependency.GroupID, - ArtifactId: dependency.ArtifactID, - Version: dependency.Version, - Classifier: dependency.Classifier, - Extension: dependency.Extension, - } -} - -// ProtoRegistryConfigToPluginRegistry converts a registryv1alpha1.RegistryConfig to a bufpluginconfig.RegistryConfig . -func ProtoRegistryConfigToPluginRegistry(config *registryv1alpha1.RegistryConfig) (*bufpluginconfig.RegistryConfig, error) { - if config == nil { - return nil, nil - } - registryConfig := &bufpluginconfig.RegistryConfig{ - Options: bufpluginconfig.OptionsSliceToPluginOptions(config.Options), - } - if config.GetGoConfig() != nil { - goConfig := &bufpluginconfig.GoRegistryConfig{} - goConfig.MinVersion = config.GetGoConfig().GetMinimumVersion() - runtimeLibraries := config.GetGoConfig().GetRuntimeLibraries() - if runtimeLibraries != nil { - goConfig.Deps = make([]*bufpluginconfig.GoRegistryDependencyConfig, 0, len(runtimeLibraries)) - for _, library := range runtimeLibraries { - goConfig.Deps = append(goConfig.Deps, protoGoRuntimeLibraryToGoRuntimeDependency(library)) - } - } - registryConfig.Go = goConfig - } else if config.GetNpmConfig() != nil { - importStyle, err := npmProtoImportStyleToNPMImportStyle(config.GetNpmConfig().GetImportStyle()) - if err != nil { - return nil, err - } - npmConfig := &bufpluginconfig.NPMRegistryConfig{ - RewriteImportPathSuffix: config.GetNpmConfig().GetRewriteImportPathSuffix(), - ImportStyle: importStyle, - } - runtimeLibraries := config.GetNpmConfig().GetRuntimeLibraries() - if runtimeLibraries != nil { - npmConfig.Deps = make([]*bufpluginconfig.NPMRegistryDependencyConfig, 0, len(runtimeLibraries)) - for _, library := range runtimeLibraries { - npmConfig.Deps = append(npmConfig.Deps, protoNPMRuntimeLibraryToNPMRuntimeDependency(library)) - } - } - registryConfig.NPM = npmConfig - } else if protoMavenConfig := config.GetMavenConfig(); protoMavenConfig != nil { - mavenConfig, err := ProtoMavenConfigToMavenRegistryConfig(protoMavenConfig) - if err != nil { - return nil, err - } - registryConfig.Maven = mavenConfig - } else if protoSwiftConfig := config.GetSwiftConfig(); protoSwiftConfig != nil { - swiftConfig, err := ProtoSwiftConfigToSwiftRegistryConfig(protoSwiftConfig) - if err != nil { - return nil, err - } - registryConfig.Swift = swiftConfig - } - return registryConfig, nil -} - -func ProtoSwiftConfigToSwiftRegistryConfig(protoSwiftConfig *registryv1alpha1.SwiftConfig) (*bufpluginconfig.SwiftRegistryConfig, error) { - swiftConfig := &bufpluginconfig.SwiftRegistryConfig{} - runtimeLibs := protoSwiftConfig.GetRuntimeLibraries() - if runtimeLibs != nil { - swiftConfig.Dependencies = make([]bufpluginconfig.SwiftRegistryDependencyConfig, 0, len(runtimeLibs)) - for _, runtimeLib := range runtimeLibs { - dependencyConfig := bufpluginconfig.SwiftRegistryDependencyConfig{ - Source: runtimeLib.GetSource(), - Package: runtimeLib.GetPackage(), - Version: runtimeLib.GetVersion(), - Products: runtimeLib.GetProducts(), - SwiftVersions: runtimeLib.GetSwiftVersions(), - } - platforms := runtimeLib.GetPlatforms() - for _, platform := range platforms { - switch platform.GetName() { - case registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS: - dependencyConfig.Platforms.MacOS = platform.GetVersion() - case registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS: - dependencyConfig.Platforms.IOS = platform.GetVersion() - case registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS: - dependencyConfig.Platforms.TVOS = platform.GetVersion() - case registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS: - dependencyConfig.Platforms.WatchOS = platform.GetVersion() - default: - return nil, fmt.Errorf("unknown platform type: %v", platform.GetName()) - } - } - swiftConfig.Dependencies = append(swiftConfig.Dependencies, dependencyConfig) - } - } - return swiftConfig, nil -} - -func SwiftRegistryConfigToProtoSwiftConfig(swiftConfig *bufpluginconfig.SwiftRegistryConfig) *registryv1alpha1.SwiftConfig { - protoSwiftConfig := ®istryv1alpha1.SwiftConfig{} - if swiftConfig.Dependencies != nil { - protoSwiftConfig.RuntimeLibraries = make([]*registryv1alpha1.SwiftConfig_RuntimeLibrary, 0, len(swiftConfig.Dependencies)) - for _, dependency := range swiftConfig.Dependencies { - depConfig := ®istryv1alpha1.SwiftConfig_RuntimeLibrary{ - Source: dependency.Source, - Package: dependency.Package, - Version: dependency.Version, - Products: dependency.Products, - SwiftVersions: dependency.SwiftVersions, - } - if dependency.Platforms.MacOS != "" { - depConfig.Platforms = append(depConfig.Platforms, ®istryv1alpha1.SwiftConfig_RuntimeLibrary_Platform{ - Name: registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS, - Version: dependency.Platforms.MacOS, - }) - } - if dependency.Platforms.IOS != "" { - depConfig.Platforms = append(depConfig.Platforms, ®istryv1alpha1.SwiftConfig_RuntimeLibrary_Platform{ - Name: registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS, - Version: dependency.Platforms.IOS, - }) - } - if dependency.Platforms.TVOS != "" { - depConfig.Platforms = append(depConfig.Platforms, ®istryv1alpha1.SwiftConfig_RuntimeLibrary_Platform{ - Name: registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS, - Version: dependency.Platforms.TVOS, - }) - } - if dependency.Platforms.WatchOS != "" { - depConfig.Platforms = append(depConfig.Platforms, ®istryv1alpha1.SwiftConfig_RuntimeLibrary_Platform{ - Name: registryv1alpha1.SwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS, - Version: dependency.Platforms.WatchOS, - }) - } - protoSwiftConfig.RuntimeLibraries = append(protoSwiftConfig.RuntimeLibraries, depConfig) - } - } - return protoSwiftConfig -} - -// ProtoMavenConfigToMavenRegistryConfig converts a registryv1alpha1.MavenConfig to a bufpluginconfig.MavenRegistryConfig. -func ProtoMavenConfigToMavenRegistryConfig(protoMavenConfig *registryv1alpha1.MavenConfig) (*bufpluginconfig.MavenRegistryConfig, error) { - mavenConfig := &bufpluginconfig.MavenRegistryConfig{} - if protoCompiler := protoMavenConfig.GetCompiler(); protoCompiler != nil { - mavenConfig.Compiler = bufpluginconfig.MavenCompilerConfig{} - if protoJavaCompiler := protoCompiler.GetJava(); protoJavaCompiler != nil { - mavenConfig.Compiler.Java = bufpluginconfig.MavenCompilerJavaConfig{ - Encoding: protoJavaCompiler.GetEncoding(), - Release: int(protoJavaCompiler.GetRelease()), - Source: int(protoJavaCompiler.GetSource()), - Target: int(protoJavaCompiler.GetTarget()), - } - } - if protoKotlinCompiler := protoCompiler.GetKotlin(); protoKotlinCompiler != nil { - mavenConfig.Compiler.Kotlin = bufpluginconfig.MavenCompilerKotlinConfig{ - APIVersion: protoKotlinCompiler.GetApiVersion(), - JVMTarget: protoKotlinCompiler.GetJvmTarget(), - LanguageVersion: protoKotlinCompiler.GetLanguageVersion(), - Version: protoKotlinCompiler.GetVersion(), - } - } - } - runtimeLibraries := protoMavenConfig.GetRuntimeLibraries() - if runtimeLibraries != nil { - mavenConfig.Deps = make([]bufpluginconfig.MavenDependencyConfig, len(runtimeLibraries)) - for i, library := range runtimeLibraries { - mavenConfig.Deps[i] = ProtoMavenRuntimeLibraryToDependencyConfig(library) - } - } - additionalRuntimes := protoMavenConfig.GetAdditionalRuntimes() - if additionalRuntimes != nil { - mavenConfig.AdditionalRuntimes = make([]bufpluginconfig.MavenRuntimeConfig, len(additionalRuntimes)) - for i, additionalRuntime := range additionalRuntimes { - runtime, err := MavenProtoRuntimeConfigToRuntimeConfig(additionalRuntime) - if err != nil { - return nil, err - } - mavenConfig.AdditionalRuntimes[i] = runtime - } - } - return mavenConfig, nil -} - -// MavenProtoRuntimeConfigToRuntimeConfig converts a registryv1alpha1.MavenConfig_RuntimeConfig to a bufpluginconfig.MavenRuntimeConfig. -func MavenProtoRuntimeConfigToRuntimeConfig(proto *registryv1alpha1.MavenConfig_RuntimeConfig) (bufpluginconfig.MavenRuntimeConfig, error) { - libraries := proto.GetRuntimeLibraries() - var dependencies []bufpluginconfig.MavenDependencyConfig - for _, library := range libraries { - dependencies = append(dependencies, ProtoMavenRuntimeLibraryToDependencyConfig(library)) - } - return bufpluginconfig.MavenRuntimeConfig{ - Name: proto.GetName(), - Deps: dependencies, - Options: proto.GetOptions(), - }, nil -} - -// MavenRuntimeConfigToProtoRuntimeConfig converts a bufpluginconfig.MavenRuntimeConfig to a registryv1alpha1.MavenConfig_RuntimeLibrary. -func MavenRuntimeConfigToProtoRuntimeConfig(runtime bufpluginconfig.MavenRuntimeConfig) *registryv1alpha1.MavenConfig_RuntimeConfig { - var libraries []*registryv1alpha1.MavenConfig_RuntimeLibrary - for _, dependency := range runtime.Deps { - libraries = append(libraries, MavenDependencyConfigToProtoRuntimeLibrary(dependency)) - } - return ®istryv1alpha1.MavenConfig_RuntimeConfig{ - Name: runtime.Name, - RuntimeLibraries: libraries, - Options: runtime.Options, - } -} - -// ProtoMavenRuntimeLibraryToDependencyConfig converts a registryv1alpha1 to a bufpluginconfig.MavenDependencyConfig. -func ProtoMavenRuntimeLibraryToDependencyConfig(proto *registryv1alpha1.MavenConfig_RuntimeLibrary) bufpluginconfig.MavenDependencyConfig { - return bufpluginconfig.MavenDependencyConfig{ - GroupID: proto.GetGroupId(), - ArtifactID: proto.GetArtifactId(), - Version: proto.GetVersion(), - Classifier: proto.GetClassifier(), - Extension: proto.GetExtension(), - } -} - -func npmImportStyleToNPMProtoImportStyle(importStyle string) (registryv1alpha1.NPMImportStyle, error) { - switch importStyle { - case "commonjs": - return registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_COMMONJS, nil - case "module": - return registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_MODULE, nil - } - return 0, fmt.Errorf(`invalid import style %q: must be one of "module" or "commonjs"`, importStyle) -} - -func npmProtoImportStyleToNPMImportStyle(importStyle registryv1alpha1.NPMImportStyle) (string, error) { - switch importStyle { - case registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_COMMONJS: - return "commonjs", nil - case registryv1alpha1.NPMImportStyle_NPM_IMPORT_STYLE_MODULE: - return "module", nil - } - return "", fmt.Errorf("unknown import style: %v", importStyle) -} - -// goRuntimeDependencyToProtoGoRuntimeLibrary converts a bufpluginconfig.GoRegistryDependencyConfig to a registryv1alpha1.GoConfig_RuntimeLibrary. -func goRuntimeDependencyToProtoGoRuntimeLibrary(config *bufpluginconfig.GoRegistryDependencyConfig) *registryv1alpha1.GoConfig_RuntimeLibrary { - return ®istryv1alpha1.GoConfig_RuntimeLibrary{ - Module: config.Module, - Version: config.Version, - } -} - -// protoGoRuntimeLibraryToGoRuntimeDependency converts a registryv1alpha1.GoConfig_RuntimeLibrary to a bufpluginconfig.GoRegistryDependencyConfig. -func protoGoRuntimeLibraryToGoRuntimeDependency(config *registryv1alpha1.GoConfig_RuntimeLibrary) *bufpluginconfig.GoRegistryDependencyConfig { - return &bufpluginconfig.GoRegistryDependencyConfig{ - Module: config.Module, - Version: config.Version, - } -} - -// npmRuntimeDependencyToProtoNPMRuntimeLibrary converts a bufpluginconfig.NPMRegistryConfig to a registryv1alpha1.NPMConfig_RuntimeLibrary. -func npmRuntimeDependencyToProtoNPMRuntimeLibrary(config *bufpluginconfig.NPMRegistryDependencyConfig) *registryv1alpha1.NPMConfig_RuntimeLibrary { - return ®istryv1alpha1.NPMConfig_RuntimeLibrary{ - Package: config.Package, - Version: config.Version, - } -} - -// protoNPMRuntimeLibraryToNPMRuntimeDependency converts a registryv1alpha1.NPMConfig_RuntimeLibrary to a bufpluginconfig.NPMRegistryDependencyConfig. -func protoNPMRuntimeLibraryToNPMRuntimeDependency(config *registryv1alpha1.NPMConfig_RuntimeLibrary) *bufpluginconfig.NPMRegistryDependencyConfig { - return &bufpluginconfig.NPMRegistryDependencyConfig{ - Package: config.Package, - Version: config.Version, - } -} - -// PluginReferencesToCuratedProtoPluginReferences converts a slice of bufpluginref.PluginReference to a slice of registryv1alpha1.CuratedPluginReference. -func PluginReferencesToCuratedProtoPluginReferences(references []bufpluginref.PluginReference) []*registryv1alpha1.CuratedPluginReference { - if references == nil { - return nil - } - protoReferences := make([]*registryv1alpha1.CuratedPluginReference, 0, len(references)) - for _, reference := range references { - protoReferences = append(protoReferences, PluginReferenceToProtoCuratedPluginReference(reference)) - } - return protoReferences -} - -// PluginReferenceToProtoCuratedPluginReference converts a bufpluginref.PluginReference to a registryv1alpha1.CuratedPluginReference. -func PluginReferenceToProtoCuratedPluginReference(reference bufpluginref.PluginReference) *registryv1alpha1.CuratedPluginReference { - if reference == nil { - return nil - } - return ®istryv1alpha1.CuratedPluginReference{ - Owner: reference.Owner(), - Name: reference.Plugin(), - Version: reference.Version(), - Revision: uint32(reference.Revision()), - } -} - -// PluginIdentityToProtoCuratedPluginReference converts a bufpluginref.PluginIdentity to a registryv1alpha1.CuratedPluginReference. -// -// The returned CuratedPluginReference contains no Version/Revision information. -func PluginIdentityToProtoCuratedPluginReference(identity bufpluginref.PluginIdentity) *registryv1alpha1.CuratedPluginReference { - if identity == nil { - return nil - } - return ®istryv1alpha1.CuratedPluginReference{ - Owner: identity.Owner(), - Name: identity.Plugin(), - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/bufpluginconfig.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/bufpluginconfig.go deleted file mode 100644 index 217e3e6105..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/bufpluginconfig.go +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufpluginconfig defines the buf.plugin.yaml file. -package bufpluginconfig - -import ( - "context" - "fmt" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/storage" -) - -const ( - // ExternalConfigFilePath is the default configuration file path for v1. - ExternalConfigFilePath = "buf.plugin.yaml" - // V1Version is the version string used to indicate the v1 version of the buf.plugin.yaml file. - V1Version = "v1" -) - -var ( - // AllConfigFilePaths are all acceptable config file paths without overrides. - // - // These are in the order we should check. - AllConfigFilePaths = []string{ - ExternalConfigFilePath, - } -) - -// Config is the plugin config. -type Config struct { - // Name is the name of the plugin (e.g. 'buf.build/protocolbuffers/go'). - Name bufpluginref.PluginIdentity - // PluginVersion is the version of the plugin's implementation - // (e.g. the protoc-gen-connect-go implementation is v0.2.0). - // - // This excludes any other details found in the buf.plugin.yaml - // or plugin source (e.g. Dockerfile) that would otherwise influence - // the plugin's behavior. - PluginVersion string - // SourceURL is an optional attribute used to specify where the source - // for the plugin can be found. - SourceURL string - // Description is an optional attribute to provide a more detailed - // description for the plugin. - Description string - // Dependencies are the dependencies this plugin has on other plugins. - // - // An example of a dependency might be a 'protoc-gen-go-grpc' plugin - // which depends on the 'protoc-gen-go' generated code. - Dependencies []bufpluginref.PluginReference - // OutputLanguages is a list of output languages the plugin supports. - OutputLanguages []string - // Registry is the registry configuration, which lets the user specify - // dependencies and other metadata that applies to a specific - // remote generation registry (e.g. the Go module proxy, NPM registry, - // etc). - Registry *RegistryConfig - // SPDXLicenseID is the license of the plugin, which should be one of - // the identifiers defined in https://spdx.org/licenses - SPDXLicenseID string - // LicenseURL specifies where the plugin's license can be found. - LicenseURL string -} - -// RegistryConfig is the configuration for the registry of a plugin. -// -// Only one field will be set. -type RegistryConfig struct { - Go *GoRegistryConfig - NPM *NPMRegistryConfig - Maven *MavenRegistryConfig - Swift *SwiftRegistryConfig - // Options is the set of options passed into the plugin for the - // remote registry. - // - // For now, all options are string values. This could eventually - // support other types (like JSON Schema and Terraform variables), - // where strings are the default value unless otherwise specified. - // - // Note that some legacy plugins don't always express their options - // as key value pairs. For example, protoc-gen-java has an option - // that can be passed like so: - // - // java_opt=annotate_code - // - // In those cases, the option value in this map will be set to - // the empty string, and the option will be propagated to the - // compiler without the '=' delimiter. - Options map[string]string -} - -// GoRegistryConfig is the registry configuration for a Go plugin. -type GoRegistryConfig struct { - MinVersion string - Deps []*GoRegistryDependencyConfig -} - -// GoRegistryDependencyConfig is the go registry dependency configuration. -type GoRegistryDependencyConfig struct { - Module string - Version string -} - -// NPMRegistryConfig is the registry configuration for a JavaScript NPM plugin. -type NPMRegistryConfig struct { - RewriteImportPathSuffix string - Deps []*NPMRegistryDependencyConfig - ImportStyle string -} - -// NPMRegistryDependencyConfig is the npm registry dependency configuration. -type NPMRegistryDependencyConfig struct { - Package string - Version string -} - -// MavenRegistryConfig is the registry configuration for a Maven plugin. -type MavenRegistryConfig struct { - // Compiler specifies Java and/or Kotlin compiler settings for remote packages. - Compiler MavenCompilerConfig - // Deps are dependencies for the remote package. - Deps []MavenDependencyConfig - // AdditionalRuntimes tracks additional runtimes (like the 'lite' runtime). - // This is used to support multiple artifacts targeting different runtimes, plugin options, and dependencies. - AdditionalRuntimes []MavenRuntimeConfig -} - -// MavenCompilerConfig specifies compiler settings for Java and/or Kotlin. -type MavenCompilerConfig struct { - Java MavenCompilerJavaConfig - Kotlin MavenCompilerKotlinConfig -} - -// MavenCompilerJavaConfig specifies compiler settings for Java code. -type MavenCompilerJavaConfig struct { - // Encoding specifies the encoding of the source files (default: UTF-8). - Encoding string - // Release specifies the target Java release (default: 8). - Release int - // Source specifies the source bytecode level (default: 8). - Source int - // Target specifies the target bytecode level (default: 8). - Target int -} - -// MavenCompilerKotlinConfig specifies compiler settings for Kotlin code. -type MavenCompilerKotlinConfig struct { - // APIVersion specifies the Kotlin API version to target. - APIVersion string - // JVMTarget specifies the target version of the JVM bytecode (default: 1.8) - JVMTarget string - // LanguageVersion is used to provide source compatibility with the specified Kotlin version. - LanguageVersion string - // Version of the Kotlin compiler to use (required for Kotlin plugins). - Version string -} - -// MavenDependencyConfig defines a runtime dependency for a remote package artifact. -type MavenDependencyConfig struct { - GroupID string - ArtifactID string - Version string - Classifier string - // Extension is the file extension, also known as the Maven type. - Extension string -} - -// MavenRuntimeConfig is used to specify additional runtimes for a given plugin. -type MavenRuntimeConfig struct { - // Name is the required, unique name for the runtime in MavenRegistryConfig.AdditionalRuntimes. - Name string - // Deps contains the Maven dependencies for the runtime. Overrides MavenRegistryConfig.Deps. - Deps []MavenDependencyConfig - // Options contains the Maven plugin options for the runtime. Overrides RegistryConfig.Options. - Options []string -} - -// SwiftRegistryConfig is the registry configuration for a Swift plugin. -type SwiftRegistryConfig struct { - // Dependencies are dependencies for the remote package. - Dependencies []SwiftRegistryDependencyConfig -} - -// SwiftRegistryDependencyConfig is the swift registry dependency configuration. -type SwiftRegistryDependencyConfig struct { - // Source specifies the source of the dependency. - Source string - // Package is the name of the Swift package. - Package string - // Version is the version of the Swift package. - Version string - // Products are the names of the products available to import. - Products []string - // Platforms are the minimum versions for platforms the package supports. - Platforms SwiftRegistryDependencyPlatformConfig - // SwiftVersions are the versions of Swift the package supports. - SwiftVersions []string -} - -// SwiftRegistryDependencyPlatformConfig is the swift registry dependency platform configuration. -type SwiftRegistryDependencyPlatformConfig struct { - // macOS specifies the version of the macOS platform. - MacOS string - // iOS specifies the version of the iOS platform. - IOS string - // TVOS specifies the version of the tvOS platform. - TVOS string - // WatchOS specifies the version of the watchOS platform. - WatchOS string -} - -// ConfigOption is an optional option used when loading a Config. -type ConfigOption func(*configOptions) - -// WithOverrideRemote will update the remote found in the plugin name and dependencies. -func WithOverrideRemote(remote string) ConfigOption { - return func(options *configOptions) { - options.overrideRemote = remote - } -} - -// GetConfigForBucket gets the Config for the YAML data at ConfigFilePath. -// -// If the data is of length 0, returns the default config. -func GetConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, options ...ConfigOption) (*Config, error) { - return getConfigForBucket(ctx, readBucket, options) -} - -// GetConfigForData gets the Config for the given JSON or YAML data. -// -// If the data is of length 0, returns the default config. -func GetConfigForData(ctx context.Context, data []byte, options ...ConfigOption) (*Config, error) { - return getConfigForData(ctx, data, options) -} - -// ExistingConfigFilePath checks if a configuration file exists, and if so, returns the path -// within the ReadBucket of this configuration file. -// -// Returns empty string and no error if no configuration file exists. -func ExistingConfigFilePath(ctx context.Context, readBucket storage.ReadBucket) (string, error) { - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return "", err - } - if exists { - return configFilePath, nil - } - } - return "", nil -} - -// ParseConfig parses the file at the given path as a Config. -func ParseConfig(config string, options ...ConfigOption) (*Config, error) { - var data []byte - var err error - switch filepath.Ext(config) { - case ".json", ".yaml", ".yml": - data, err = os.ReadFile(config) - if err != nil { - return nil, fmt.Errorf("could not read file: %w", err) - } - default: - return nil, fmt.Errorf("invalid extension %s, must be .json, .yaml or .yml", filepath.Ext(config)) - } - var externalConfig ExternalConfig - if err := encoding.UnmarshalJSONOrYAMLStrict(data, &externalConfig); err != nil { - return nil, fmt.Errorf("failed to unmarshal plugin config: %w", err) - } - switch externalConfig.Version { - case V1Version: - return newConfig(externalConfig, options) - } - return nil, fmt.Errorf("invalid plugin configuration version: must be one of %v", AllConfigFilePaths) -} - -// PluginOptionsToOptionsSlice converts a map representation of plugin options to a slice of the form '=' or '' for empty values. -func PluginOptionsToOptionsSlice(pluginOptions map[string]string) []string { - if pluginOptions == nil { - return nil - } - options := make([]string, 0, len(pluginOptions)) - for key, value := range pluginOptions { - if len(value) > 0 { - options = append(options, key+"="+value) - } else { - options = append(options, key) - } - } - sort.Strings(options) - return options -} - -// OptionsSliceToPluginOptions converts a slice of plugin options to a map (using the first '=' as a delimiter between key and value). -// If no '=' is found, the option will be stored in the map with an empty string value. -func OptionsSliceToPluginOptions(options []string) map[string]string { - if options == nil { - return nil - } - pluginOptions := make(map[string]string, len(options)) - for _, option := range options { - fields := strings.SplitN(option, "=", 2) - if len(fields) == 2 { - pluginOptions[fields[0]] = fields[1] - } else { - pluginOptions[option] = "" - } - } - return pluginOptions -} - -// ExternalConfig represents the on-disk representation -// of the plugin configuration at version v1. -type ExternalConfig struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - PluginVersion string `json:"plugin_version,omitempty" yaml:"plugin_version,omitempty"` - SourceURL string `json:"source_url,omitempty" yaml:"source_url,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - Deps []ExternalDependency `json:"deps,omitempty" yaml:"deps,omitempty"` - OutputLanguages []string `json:"output_languages,omitempty" yaml:"output_languages,omitempty"` - Registry ExternalRegistryConfig `json:"registry,omitempty" yaml:"registry,omitempty"` - SPDXLicenseID string `json:"spdx_license_id,omitempty" yaml:"spdx_license_id,omitempty"` - LicenseURL string `json:"license_url,omitempty" yaml:"license_url,omitempty"` -} - -// ExternalDependency represents a dependency on another plugin. -type ExternalDependency struct { - Plugin string `json:"plugin,omitempty" yaml:"plugin,omitempty"` - Revision int `json:"revision,omitempty" yaml:"revision,omitempty"` -} - -// ExternalRegistryConfig is the external configuration for the registry -// of a plugin. -type ExternalRegistryConfig struct { - Go *ExternalGoRegistryConfig `json:"go,omitempty" yaml:"go,omitempty"` - NPM *ExternalNPMRegistryConfig `json:"npm,omitempty" yaml:"npm,omitempty"` - Maven *ExternalMavenRegistryConfig `json:"maven,omitempty" yaml:"maven,omitempty"` - Swift *ExternalSwiftRegistryConfig `json:"swift,omitempty" yaml:"swift,omitempty"` - Opts []string `json:"opts,omitempty" yaml:"opts,omitempty"` -} - -// ExternalGoRegistryConfig is the external registry configuration for a Go plugin. -type ExternalGoRegistryConfig struct { - // The minimum Go version required by the plugin. - MinVersion string `json:"min_version,omitempty" yaml:"min_version,omitempty"` - Deps []struct { - Module string `json:"module,omitempty" yaml:"module,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - } `json:"deps,omitempty" yaml:"deps,omitempty"` -} - -// ExternalNPMRegistryConfig is the external registry configuration for a JavaScript NPM plugin. -type ExternalNPMRegistryConfig struct { - RewriteImportPathSuffix string `json:"rewrite_import_path_suffix,omitempty" yaml:"rewrite_import_path_suffix,omitempty"` - Deps []struct { - Package string `json:"package,omitempty" yaml:"package,omitempty"` - Version string `json:"version,omitempty" yaml:"version,omitempty"` - } `json:"deps,omitempty" yaml:"deps,omitempty"` - // The import style used for the "type" field in the package.json file. - // Must be one of "module" or "commonjs". - ImportStyle string `json:"import_style,omitempty" yaml:"import_style,omitempty"` -} - -// ExternalMavenRegistryConfig is the external registry configuration for a Maven plugin. -type ExternalMavenRegistryConfig struct { - Compiler ExternalMavenCompilerConfig `json:"compiler" yaml:"compiler"` - Deps []string `json:"deps,omitempty" yaml:"deps,omitempty"` - AdditionalRuntimes []ExternalMavenRuntimeConfig `json:"additional_runtimes,omitempty" yaml:"additional_runtimes,omitempty"` -} - -// ExternalMavenCompilerConfig configures compiler settings for Maven remote packages. -type ExternalMavenCompilerConfig struct { - Java ExternalMavenCompilerJavaConfig `json:"java" yaml:"java"` - Kotlin ExternalMavenCompilerKotlinConfig `json:"kotlin" yaml:"kotlin"` -} - -// ExternalMavenCompilerJavaConfig configures the Java compiler settings for remote packages. -type ExternalMavenCompilerJavaConfig struct { - // Encoding specifies the encoding of the source files (default: UTF-8). - Encoding string `json:"encoding" yaml:"encoding"` - // Release specifies the target Java release (default: 8). - Release int `json:"release" yaml:"release"` - // Source specifies the source bytecode level (default: 8). - Source int `json:"source" yaml:"source"` - // Target specifies the target bytecode level (default: 8). - Target int `json:"target" yaml:"target"` -} - -// ExternalMavenCompilerKotlinConfig configures the Kotlin compiler settings for remote packages. -type ExternalMavenCompilerKotlinConfig struct { - // APIVersion specifies the Kotlin API version to target. - APIVersion string `json:"api_version" yaml:"api_version"` - // JVMTarget specifies the target version of the JVM bytecode (default: 1.8) - JVMTarget string `json:"jvm_target" yaml:"jvm_target"` - // LanguageVersion is used to provide source compatibility with the specified Kotlin version. - LanguageVersion string `json:"language_version" yaml:"language_version"` - // Version of the Kotlin compiler to use (required for Kotlin plugins). - Version string `json:"version" yaml:"version"` -} - -// ExternalMavenRuntimeConfig allows configuring additional runtimes for remote packages. -// These can specify different dependencies and compiler options than the default runtime. -// This is used to support a single plugin supporting both full and lite Protobuf runtimes. -type ExternalMavenRuntimeConfig struct { - // Name contains the Maven runtime name (e.g. 'lite'). - Name string `json:"name" yaml:"name"` - // Deps contains the Maven dependencies for the runtime. Overrides ExternalMavenRuntimeConfig.Deps. - Deps []string `json:"deps,omitempty" yaml:"deps,omitempty"` - // Opts contains the Maven plugin options for the runtime. Overrides ExternalRegistryConfig.Opts. - Opts []string `json:"opts,omitempty" yaml:"opts,omitempty"` -} - -// ExternalSwiftRegistryConfig is the registry configuration for a Swift plugin. -type ExternalSwiftRegistryConfig struct { - // Deps are dependencies for the remote package. - Deps []ExternalSwiftRegistryDependencyConfig `json:"deps,omitempty" yaml:"deps,omitempty"` -} - -// ExternalSwiftRegistryDependencyConfig is the swift registry dependency configuration. -type ExternalSwiftRegistryDependencyConfig struct { - // Source is the URL of the Swift package. - Source string `json:"source,omitempty" yaml:"source,omitempty"` - // Package is the name of the Swift package. - Package string `json:"package,omitempty" yaml:"package,omitempty"` - // Version is the version of the Swift package. - Version string `json:"version,omitempty" yaml:"version,omitempty"` - // Products are the names of the products available to import. - Products []string `json:"products,omitempty" yaml:"products,omitempty"` - // Platforms are the minimum versions for platforms the package supports. - Platforms ExternalSwiftRegistryDependencyPlatformConfig `json:"platforms,omitempty" yaml:"platforms,omitempty"` - // SwiftVersions are the versions of Swift the package supports. - SwiftVersions []string `json:"swift_versions,omitempty" yaml:"swift_versions,omitempty"` -} - -// ExternalSwiftRegistryDependencyPlatformConfig is the swift registry dependency platform configuration. -type ExternalSwiftRegistryDependencyPlatformConfig struct { - // macOS specifies the version of the macOS platform. - MacOS string `json:"macos,omitempty" yaml:"macos,omitempty"` - // iOS specifies the version of the iOS platform. - IOS string `json:"ios,omitempty" yaml:"ios,omitempty"` - // TVOS specifies the version of the tvOS platform. - TVOS string `json:"tvos,omitempty" yaml:"tvos,omitempty"` - // WatchOS specifies the version of the watchOS platform. - WatchOS string `json:"watchos,omitempty" yaml:"watchos,omitempty"` -} - -type externalConfigVersion struct { - Version string `json:"version,omitempty" yaml:"version,omitempty"` -} - -type configOptions struct { - overrideRemote string -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/config.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/config.go deleted file mode 100644 index 3a237c309a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/config.go +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginconfig - -import ( - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "github.com/bufbuild/buf/private/gen/data/dataspdx" - "golang.org/x/mod/modfile" - "golang.org/x/mod/semver" -) - -func newConfig(externalConfig ExternalConfig, options []ConfigOption) (*Config, error) { - opts := &configOptions{} - for _, option := range options { - option(opts) - } - pluginIdentity, err := pluginIdentityForStringWithOverrideRemote(externalConfig.Name, opts.overrideRemote) - if err != nil { - return nil, err - } - pluginVersion := externalConfig.PluginVersion - if pluginVersion == "" { - return nil, errors.New("a plugin_version is required") - } - if !semver.IsValid(pluginVersion) { - return nil, fmt.Errorf("plugin_version %q must be a valid semantic version", externalConfig.PluginVersion) - } - var dependencies []bufpluginref.PluginReference - if len(externalConfig.Deps) > 0 { - existingDeps := make(map[string]struct{}) - for _, dependency := range externalConfig.Deps { - reference, err := pluginReferenceForStringWithOverrideRemote(dependency.Plugin, dependency.Revision, opts.overrideRemote) - if err != nil { - return nil, err - } - if reference.Remote() != pluginIdentity.Remote() { - return nil, fmt.Errorf("plugin dependency %q must use same remote as plugin %q", dependency, pluginIdentity.Remote()) - } - if _, ok := existingDeps[reference.IdentityString()]; ok { - return nil, fmt.Errorf("plugin dependency %q was specified more than once", dependency) - } - existingDeps[reference.IdentityString()] = struct{}{} - dependencies = append(dependencies, reference) - } - } - registryConfig, err := newRegistryConfig(externalConfig.Registry) - if err != nil { - return nil, err - } - spdxLicenseID := externalConfig.SPDXLicenseID - if spdxLicenseID != "" { - if licenseInfo, ok := dataspdx.GetLicenseInfo(spdxLicenseID); ok { - spdxLicenseID = licenseInfo.ID() - } else { - return nil, fmt.Errorf("unknown SPDX License ID %q", spdxLicenseID) - } - } - return &Config{ - Name: pluginIdentity, - PluginVersion: pluginVersion, - Dependencies: dependencies, - Registry: registryConfig, - SourceURL: externalConfig.SourceURL, - Description: externalConfig.Description, - OutputLanguages: externalConfig.OutputLanguages, - SPDXLicenseID: spdxLicenseID, - LicenseURL: externalConfig.LicenseURL, - }, nil -} - -func newRegistryConfig(externalRegistryConfig ExternalRegistryConfig) (*RegistryConfig, error) { - var ( - isGoEmpty = externalRegistryConfig.Go == nil - isNPMEmpty = externalRegistryConfig.NPM == nil - isMavenEmpty = externalRegistryConfig.Maven == nil - isSwiftEmpty = externalRegistryConfig.Swift == nil - ) - var registryCount int - for _, isEmpty := range []bool{ - isGoEmpty, - isNPMEmpty, - isMavenEmpty, - isSwiftEmpty, - } { - if !isEmpty { - registryCount++ - } - if registryCount > 1 { - // We might eventually want to support multiple runtime configuration, - // but it's safe to start with an error for now. - return nil, fmt.Errorf("%s configuration contains multiple registry configurations", ExternalConfigFilePath) - } - } - if registryCount == 0 { - // It's possible that the plugin doesn't have any runtime dependencies. - return nil, nil - } - options := OptionsSliceToPluginOptions(externalRegistryConfig.Opts) - switch { - case !isGoEmpty: - goRegistryConfig, err := newGoRegistryConfig(externalRegistryConfig.Go) - if err != nil { - return nil, err - } - return &RegistryConfig{ - Go: goRegistryConfig, - Options: options, - }, nil - case !isNPMEmpty: - npmRegistryConfig, err := newNPMRegistryConfig(externalRegistryConfig.NPM) - if err != nil { - return nil, err - } - return &RegistryConfig{ - NPM: npmRegistryConfig, - Options: options, - }, nil - case !isMavenEmpty: - mavenRegistryConfig, err := newMavenRegistryConfig(externalRegistryConfig.Maven) - if err != nil { - return nil, err - } - return &RegistryConfig{ - Maven: mavenRegistryConfig, - Options: options, - }, nil - case !isSwiftEmpty: - swiftRegistryConfig, err := newSwiftRegistryConfig(externalRegistryConfig.Swift) - if err != nil { - return nil, err - } - return &RegistryConfig{ - Swift: swiftRegistryConfig, - Options: options, - }, nil - default: - return nil, errors.New("unknown registry configuration") - } -} - -func newNPMRegistryConfig(externalNPMRegistryConfig *ExternalNPMRegistryConfig) (*NPMRegistryConfig, error) { - if externalNPMRegistryConfig == nil { - return nil, nil - } - var dependencies []*NPMRegistryDependencyConfig - for _, dep := range externalNPMRegistryConfig.Deps { - if dep.Package == "" { - return nil, errors.New("npm runtime dependency requires a non-empty package name") - } - if dep.Version == "" { - return nil, errors.New("npm runtime dependency requires a non-empty version name") - } - // TODO: Note that we don't have NPM-specific validation yet - any - // non-empty string will work for the package and version. - // - // For a complete set of the version syntax we need to support, see - // https://docs.npmjs.com/cli/v6/using-npm/semver - // - // https://github.com/Masterminds/semver might be a good candidate for - // this, but it might not support all of the constraints supported - // by NPM. - dependencies = append( - dependencies, - &NPMRegistryDependencyConfig{ - Package: dep.Package, - Version: dep.Version, - }, - ) - } - switch externalNPMRegistryConfig.ImportStyle { - case "module", "commonjs": - default: - return nil, errors.New(`npm registry config import_style must be one of: "module" or "commonjs"`) - } - return &NPMRegistryConfig{ - RewriteImportPathSuffix: externalNPMRegistryConfig.RewriteImportPathSuffix, - Deps: dependencies, - ImportStyle: externalNPMRegistryConfig.ImportStyle, - }, nil -} - -func newGoRegistryConfig(externalGoRegistryConfig *ExternalGoRegistryConfig) (*GoRegistryConfig, error) { - if externalGoRegistryConfig == nil { - return nil, nil - } - if externalGoRegistryConfig.MinVersion != "" && !modfile.GoVersionRE.MatchString(externalGoRegistryConfig.MinVersion) { - return nil, fmt.Errorf("the go minimum version %q must be a valid semantic version in the form of .", externalGoRegistryConfig.MinVersion) - } - var dependencies []*GoRegistryDependencyConfig - for _, dep := range externalGoRegistryConfig.Deps { - if dep.Module == "" { - return nil, errors.New("go runtime dependency requires a non-empty module name") - } - if dep.Version == "" { - return nil, errors.New("go runtime dependency requires a non-empty version name") - } - if !semver.IsValid(dep.Version) { - return nil, fmt.Errorf("go runtime dependency %s:%s does not have a valid semantic version", dep.Module, dep.Version) - } - dependencies = append( - dependencies, - &GoRegistryDependencyConfig{ - Module: dep.Module, - Version: dep.Version, - }, - ) - } - return &GoRegistryConfig{ - MinVersion: externalGoRegistryConfig.MinVersion, - Deps: dependencies, - }, nil -} - -func newMavenRegistryConfig(externalMavenRegistryConfig *ExternalMavenRegistryConfig) (*MavenRegistryConfig, error) { - if externalMavenRegistryConfig == nil { - return nil, nil - } - var dependencies []MavenDependencyConfig - for _, externalDep := range externalMavenRegistryConfig.Deps { - dep, err := mavenExternalDependencyToDependencyConfig(externalDep) - if err != nil { - return nil, err - } - dependencies = append(dependencies, dep) - } - var additionalRuntimes []MavenRuntimeConfig - for _, runtime := range externalMavenRegistryConfig.AdditionalRuntimes { - var deps []MavenDependencyConfig - for _, externalDep := range runtime.Deps { - dep, err := mavenExternalDependencyToDependencyConfig(externalDep) - if err != nil { - return nil, err - } - deps = append(deps, dep) - } - config := MavenRuntimeConfig{ - Name: runtime.Name, - Deps: deps, - Options: runtime.Opts, - } - additionalRuntimes = append(additionalRuntimes, config) - } - return &MavenRegistryConfig{ - Compiler: MavenCompilerConfig{ - Java: MavenCompilerJavaConfig{ - Encoding: externalMavenRegistryConfig.Compiler.Java.Encoding, - Release: externalMavenRegistryConfig.Compiler.Java.Release, - Source: externalMavenRegistryConfig.Compiler.Java.Source, - Target: externalMavenRegistryConfig.Compiler.Java.Target, - }, - Kotlin: MavenCompilerKotlinConfig{ - APIVersion: externalMavenRegistryConfig.Compiler.Kotlin.APIVersion, - JVMTarget: externalMavenRegistryConfig.Compiler.Kotlin.JVMTarget, - LanguageVersion: externalMavenRegistryConfig.Compiler.Kotlin.LanguageVersion, - Version: externalMavenRegistryConfig.Compiler.Kotlin.Version, - }, - }, - Deps: dependencies, - AdditionalRuntimes: additionalRuntimes, - }, nil -} - -func newSwiftRegistryConfig(externalSwiftRegistryConfig *ExternalSwiftRegistryConfig) (*SwiftRegistryConfig, error) { - if externalSwiftRegistryConfig == nil { - return nil, nil - } - var dependencies []SwiftRegistryDependencyConfig - for _, externalDependency := range externalSwiftRegistryConfig.Deps { - dependency, err := swiftExternalDependencyToDependencyConfig(externalDependency) - if err != nil { - return nil, err - } - dependencies = append(dependencies, dependency) - } - return &SwiftRegistryConfig{ - Dependencies: dependencies, - }, nil -} - -func swiftExternalDependencyToDependencyConfig(externalDep ExternalSwiftRegistryDependencyConfig) (SwiftRegistryDependencyConfig, error) { - if externalDep.Source == "" { - return SwiftRegistryDependencyConfig{}, errors.New("swift runtime dependency requires a non-empty source") - } - if externalDep.Package == "" { - return SwiftRegistryDependencyConfig{}, errors.New("swift runtime dependency requires a non-empty package name") - } - if externalDep.Version == "" { - return SwiftRegistryDependencyConfig{}, errors.New("swift runtime dependency requires a non-empty version name") - } - // Swift SemVers are typically not prefixed with a "v". The Golang semver library requires a "v" prefix. - if !semver.IsValid(fmt.Sprintf("v%s", externalDep.Version)) { - return SwiftRegistryDependencyConfig{}, fmt.Errorf("swift runtime dependency %s:%s does not have a valid semantic version", externalDep.Package, externalDep.Version) - } - return SwiftRegistryDependencyConfig{ - Source: externalDep.Source, - Package: externalDep.Package, - Version: externalDep.Version, - Products: externalDep.Products, - SwiftVersions: externalDep.SwiftVersions, - Platforms: SwiftRegistryDependencyPlatformConfig{ - MacOS: externalDep.Platforms.MacOS, - IOS: externalDep.Platforms.IOS, - TVOS: externalDep.Platforms.TVOS, - WatchOS: externalDep.Platforms.WatchOS, - }, - }, nil -} - -func pluginIdentityForStringWithOverrideRemote(identityStr string, overrideRemote string) (bufpluginref.PluginIdentity, error) { - identity, err := bufpluginref.PluginIdentityForString(identityStr) - if err != nil { - return nil, err - } - if len(overrideRemote) == 0 { - return identity, nil - } - return bufpluginref.NewPluginIdentity(overrideRemote, identity.Owner(), identity.Plugin()) -} - -func pluginReferenceForStringWithOverrideRemote( - referenceStr string, - revision int, - overrideRemote string, -) (bufpluginref.PluginReference, error) { - reference, err := bufpluginref.PluginReferenceForString(referenceStr, revision) - if err != nil { - return nil, err - } - if len(overrideRemote) == 0 { - return reference, nil - } - overrideIdentity, err := pluginIdentityForStringWithOverrideRemote(reference.IdentityString(), overrideRemote) - if err != nil { - return nil, err - } - return bufpluginref.NewPluginReference(overrideIdentity, reference.Version(), reference.Revision()) -} - -func mavenExternalDependencyToDependencyConfig(dependency string) (MavenDependencyConfig, error) { - // ::[:][@] - dependencyWithoutExtension, extension, _ := strings.Cut(dependency, "@") - components := strings.Split(dependencyWithoutExtension, ":") - if len(components) < 3 { - return MavenDependencyConfig{}, fmt.Errorf("invalid dependency %q: missing required groupId:artifactId:version fields", dependency) - } - if len(components) > 4 { - return MavenDependencyConfig{}, fmt.Errorf("invalid dependency %q: maximum 4 fields before optional type", dependency) - } - config := MavenDependencyConfig{ - GroupID: components[0], - ArtifactID: components[1], - Version: components[2], - Extension: extension, - } - if len(components) == 4 { - config.Classifier = components[3] - } - return config, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/get.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/get.go deleted file mode 100644 index 61e2095c88..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/get.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginconfig - -import ( - "context" - "fmt" - "io" - - "github.com/bufbuild/buf/private/pkg/encoding" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/stringutil" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.uber.org/multierr" -) - -func getConfigForBucket(ctx context.Context, readBucket storage.ReadBucket, options []ConfigOption) (_ *Config, retErr error) { - ctx, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_plugin_config") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - // This will be in the order of precedence. - var foundConfigFilePaths []string - // Go through all valid config file paths and see which ones are present. - // If none are present, return the default config. - // If multiple are present, error. - for _, configFilePath := range AllConfigFilePaths { - exists, err := storage.Exists(ctx, readBucket, configFilePath) - if err != nil { - return nil, err - } - if exists { - foundConfigFilePaths = append(foundConfigFilePaths, configFilePath) - } - } - switch len(foundConfigFilePaths) { - case 0: - // Did not find anything, return the default. - return newConfig(ExternalConfig{}, options) - case 1: - readObjectCloser, err := readBucket.Get(ctx, foundConfigFilePaths[0]) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, readObjectCloser.Close()) - }() - data, err := io.ReadAll(readObjectCloser) - if err != nil { - return nil, err - } - return getConfigForDataInternal( - ctx, - encoding.UnmarshalYAMLNonStrict, - encoding.UnmarshalYAMLStrict, - data, - readObjectCloser.ExternalPath(), - options, - ) - default: - return nil, fmt.Errorf("only one plugin file can exist but found multiple plugin files: %s", stringutil.SliceToString(foundConfigFilePaths)) - } -} - -func getConfigForData(ctx context.Context, data []byte, options []ConfigOption) (*Config, error) { - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "get_plugin_config_for_data") - defer span.End() - config, err := getConfigForDataInternal( - ctx, - encoding.UnmarshalJSONOrYAMLNonStrict, - encoding.UnmarshalJSONOrYAMLStrict, - data, - "Plugin configuration data", - options, - ) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - } - return config, err -} - -func getConfigForDataInternal( - ctx context.Context, - unmarshalNonStrict func([]byte, interface{}) error, - unmarshalStrict func([]byte, interface{}) error, - data []byte, - id string, - options []ConfigOption, -) (*Config, error) { - var externalConfigVersion externalConfigVersion - if err := unmarshalNonStrict(data, &externalConfigVersion); err != nil { - return nil, err - } - if err := validateExternalConfigVersion(externalConfigVersion, id); err != nil { - return nil, err - } - var externalConfig ExternalConfig - if err := unmarshalStrict(data, &externalConfig); err != nil { - return nil, err - } - return newConfig(externalConfig, options) -} - -func validateExternalConfigVersion(externalConfigVersion externalConfigVersion, id string) error { - switch externalConfigVersion.Version { - case "": - return fmt.Errorf( - `%s has no version set. Please add "version: %s"`, - id, - V1Version, - ) - case V1Version: - return nil - default: - return fmt.Errorf( - `%s has an invalid "version: %s" set. Please add "version: %s"`, - id, - externalConfigVersion.Version, - V1Version, - ) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/usage.gen.go deleted file mode 100644 index bac299c42a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufpluginconfig - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/bufplugindocker.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/bufplugindocker.go deleted file mode 100644 index d4cf37b39d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/bufplugindocker.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufplugindocker contains utilities for building Buf plugins using the Docker API. -package bufplugindocker - -// ImagePath is the default location for the Docker image archive in a plugin zip file. -const ImagePath = "image.tar" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/docker.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/docker.go deleted file mode 100644 index 9568c6a040..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/docker.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufplugindocker - -import ( - "bufio" - "context" - "encoding/json" - "errors" - "fmt" - "io" - "strings" - "sync" - "time" - - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig" - "github.com/docker/docker/api/types" - "github.com/docker/docker/client" - "github.com/docker/docker/pkg/jsonmessage" - "github.com/docker/docker/pkg/stringid" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -const ( - // Setting this value on the buf docker client allows us to propagate a custom - // value to the OCI registry. This is a useful property that enables registries - // to differentiate between the buf cli vs other tools like docker cli. - // Note, this does not override the final User-Agent entirely, but instead adds - // the value to the final outgoing User-Agent value in the form: [docker client's UA] UpstreamClient(buf-cli-1.11.0) - // - // Example: User-Agent = [docker/20.10.21 go/go1.18.7 git-commit/3056208 kernel/5.15.49-linuxkit os/linux arch/arm64 UpstreamClient(buf-cli-1.11.0)] - BufUpstreamClientUserAgentPrefix = "buf-cli-" -) - -// Client is a small abstraction over a Docker API client, providing the basic APIs we need to build plugins. -// It ensures that we pass the appropriate parameters to build images (i.e. platform 'linux/amd64'). -type Client interface { - // Load imports a Docker image into the local Docker Engine. - Load(ctx context.Context, image io.Reader) (*LoadResponse, error) - // Push the Docker image to the remote registry. - Push(ctx context.Context, image string, auth *RegistryAuthConfig) (*PushResponse, error) - // Delete removes the Docker image from local Docker Engine. - Delete(ctx context.Context, image string) (*DeleteResponse, error) - // Tag creates a Docker image tag from an existing image and plugin config. - Tag(ctx context.Context, image string, config *bufpluginconfig.Config) (*TagResponse, error) - // Inspect inspects an image and returns the image id. - Inspect(ctx context.Context, image string) (*InspectResponse, error) - // Close releases any resources used by the underlying Docker client. - Close() error -} - -// LoadResponse returns details of a successful load image call. -type LoadResponse struct { - // ImageID specifies the Docker image id in the format :. - // Example: sha256:65001659f150f085e0b37b697a465a95cbfd885d9315b61960883b9ac588744e - ImageID string -} - -// PushResponse is a placeholder for data to be returned from a successful image push call. -type PushResponse struct { - // Digest specifies the Docker image digest in the format :. - // The digest returned from Client.Push differs from the image id returned in Client.Build. - Digest string -} - -// TagResponse returns details of a successful image tag call. -type TagResponse struct { - // Image contains the Docker image name in the local Docker engine including the tag. - // It is created from the bufpluginconfig.Config's Name.IdentityString() and a unique id. - Image string -} - -// DeleteResponse is a placeholder for data to be returned from a successful image delete call. -type DeleteResponse struct{} - -// InspectResponse returns the image id for a given image. -type InspectResponse struct { - // ImageID contains the Docker image's ID. - ImageID string -} - -type dockerAPIClient struct { - cli *client.Client - logger *zap.Logger - lock sync.RWMutex // protects negotiated - negotiated bool -} - -var _ Client = (*dockerAPIClient)(nil) - -func (d *dockerAPIClient) Load(ctx context.Context, image io.Reader) (_ *LoadResponse, retErr error) { - if err := d.negotiateVersion(ctx); err != nil { - return nil, err - } - response, err := d.cli.ImageLoad(ctx, image, true) - if err != nil { - return nil, err - } - defer func() { - if err := response.Body.Close(); err != nil { - retErr = multierr.Append(retErr, fmt.Errorf("docker load response body close error: %w", err)) - } - }() - imageID := "" - responseScanner := bufio.NewScanner(response.Body) - for responseScanner.Scan() { - var jsonMessage jsonmessage.JSONMessage - if err := json.Unmarshal(responseScanner.Bytes(), &jsonMessage); err == nil { - _, loadedImageID, found := strings.Cut(strings.TrimSpace(jsonMessage.Stream), "Loaded image ID: ") - if !found { - continue - } - if !strings.HasPrefix(loadedImageID, "sha256:") { - d.logger.Warn("Unsupported image digest", zap.String("imageID", loadedImageID)) - continue - } - if err := stringid.ValidateID(strings.TrimPrefix(loadedImageID, "sha256:")); err != nil { - d.logger.Warn("Invalid image id", zap.String("imageID", loadedImageID)) - continue - } - imageID = loadedImageID - } - } - if err := responseScanner.Err(); err != nil { - return nil, err - } - if imageID == "" { - return nil, fmt.Errorf("failed to determine image ID of loaded image") - } - return &LoadResponse{ImageID: imageID}, nil -} - -func (d *dockerAPIClient) Tag(ctx context.Context, image string, config *bufpluginconfig.Config) (*TagResponse, error) { - if err := d.negotiateVersion(ctx); err != nil { - return nil, err - } - buildID := stringid.GenerateRandomID() - imageName := config.Name.IdentityString() + ":" + buildID - if err := d.cli.ImageTag(ctx, image, imageName); err != nil { - return nil, err - } - return &TagResponse{Image: imageName}, nil -} - -func (d *dockerAPIClient) Push(ctx context.Context, image string, auth *RegistryAuthConfig) (response *PushResponse, retErr error) { - if err := d.negotiateVersion(ctx); err != nil { - return nil, err - } - registryAuth, err := auth.ToHeader() - if err != nil { - return nil, err - } - pushReader, err := d.cli.ImagePush(ctx, image, types.ImagePushOptions{ - RegistryAuth: registryAuth, - }) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, pushReader.Close()) - }() - var imageDigest string - pushScanner := bufio.NewScanner(pushReader) - for pushScanner.Scan() { - d.logger.Debug(pushScanner.Text()) - var message jsonmessage.JSONMessage - if err := json.Unmarshal([]byte(pushScanner.Text()), &message); err == nil { - if message.Error != nil { - return nil, message.Error - } - if message.Aux != nil { - var pushResult types.PushResult - if err := json.Unmarshal(*message.Aux, &pushResult); err == nil { - imageDigest = pushResult.Digest - } - } - } - } - if err := pushScanner.Err(); err != nil { - return nil, err - } - if len(imageDigest) == 0 { - return nil, fmt.Errorf("failed to determine image digest after push") - } - return &PushResponse{Digest: imageDigest}, nil -} - -func (d *dockerAPIClient) Delete(ctx context.Context, image string) (*DeleteResponse, error) { - if err := d.negotiateVersion(ctx); err != nil { - return nil, err - } - _, err := d.cli.ImageRemove(ctx, image, types.ImageRemoveOptions{}) - if err != nil { - return nil, err - } - return &DeleteResponse{}, nil -} - -func (d *dockerAPIClient) Inspect(ctx context.Context, image string) (*InspectResponse, error) { - if err := d.negotiateVersion(ctx); err != nil { - return nil, err - } - inspect, _, err := d.cli.ImageInspectWithRaw(ctx, image) - if err != nil { - return nil, err - } - return &InspectResponse{ImageID: inspect.ID}, nil -} - -func (d *dockerAPIClient) Close() error { - return d.cli.Close() -} - -func (d *dockerAPIClient) negotiateVersion(ctx context.Context) error { - d.lock.RLock() - negotiated := d.negotiated - d.lock.RUnlock() - if negotiated { - return nil - } - d.lock.Lock() - defer d.lock.Unlock() - if d.negotiated { - return nil - } - deadline := time.Now().Add(5 * time.Second) - if existingDeadline, ok := ctx.Deadline(); ok { - if existingDeadline.Before(deadline) { - deadline = existingDeadline - } - } - ctx, cancel := context.WithDeadline(context.Background(), deadline) - defer cancel() - ping, err := d.cli.Ping(ctx) - if err != nil { - return err - } - d.cli.NegotiateAPIVersionPing(ping) - d.negotiated = true - return nil -} - -// NewClient creates a new Client to use to build Docker plugins. -func NewClient(logger *zap.Logger, cliVersion string, options ...ClientOption) (Client, error) { - if logger == nil { - return nil, errors.New("logger required") - } - opts := &clientOptions{} - for _, option := range options { - option(opts) - } - dockerClientOpts := []client.Opt{ - client.FromEnv, - client.WithHTTPHeaders(map[string]string{ - "User-Agent": BufUpstreamClientUserAgentPrefix + cliVersion, - }), - } - if len(opts.host) > 0 { - dockerClientOpts = append(dockerClientOpts, client.WithHost(opts.host)) - } - if len(opts.version) > 0 { - dockerClientOpts = append(dockerClientOpts, client.WithVersion(opts.version)) - } - cli, err := client.NewClientWithOpts(dockerClientOpts...) - if err != nil { - return nil, err - } - return &dockerAPIClient{ - cli: cli, - logger: logger, - }, nil -} - -type clientOptions struct { - host string - version string -} - -// ClientOption defines options for the NewClient call to customize the underlying Docker client. -type ClientOption func(options *clientOptions) - -// WithHost allows specifying a Docker engine host to connect to (instead of the default lookup using DOCKER_HOST env var). -// This makes it suitable for use by parallel tests. -func WithHost(host string) ClientOption { - return func(options *clientOptions) { - options.host = host - } -} - -// WithVersion allows specifying a Docker API client version instead of using the default version negotiation algorithm. -// This allows tests to implement the Docker engine API using stable URLs. -func WithVersion(version string) ClientOption { - return func(options *clientOptions) { - options.version = version - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/registry_auth_config.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/registry_auth_config.go deleted file mode 100644 index d141607f74..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/registry_auth_config.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufplugindocker - -import ( - "encoding/base64" - "encoding/json" - "strings" -) - -// RegistryAuthConfig represents the fields required to authenticate with the Docker Engine API. -// Ref: https://docs.docker.com/engine/api/v1.41/#section/Authentication -type RegistryAuthConfig struct { - Username string `json:"username,omitempty"` - Password string `json:"password,omitempty"` - Email string `json:"email,omitempty"` - ServerAddress string `json:"serveraddress,omitempty"` // domain/ip without a protocol -} - -// ToHeader marshals the auth information as a base64 encoded JSON object. -// This is suitable for passing to the Docker API as the X-Registry-Auth header. -func (r *RegistryAuthConfig) ToHeader() (string, error) { - var buffer strings.Builder - writer := base64.NewEncoder(base64.URLEncoding, &buffer) - err := json.NewEncoder(writer).Encode(r) - if err != nil { - return "", err - } - if err := writer.Close(); err != nil { - return "", err - } - return buffer.String(), nil -} - -// fromHeader decodes auth information from a base64 encoded JSON object (see ToHeader). -func (r *RegistryAuthConfig) fromHeader(encoded string) error { - base64Reader := base64.NewDecoder(base64.URLEncoding, strings.NewReader(encoded)) - if err := json.NewDecoder(base64Reader).Decode(r); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/usage.gen.go deleted file mode 100644 index d11c30b919..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufplugindocker/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufplugindocker - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/bufpluginref.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/bufpluginref.go deleted file mode 100644 index 7f6a044b1c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/bufpluginref.go +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginref - -import ( - "fmt" - "strings" -) - -// PluginIdentity is a plugin identity. -// -// It just contains remote, owner, plugin. -type PluginIdentity interface { - Remote() string - Owner() string - Plugin() string - - // IdentityString is the string remote/owner/plugin. - IdentityString() string - - // Prevents this type from being implemented by - // another package. - isPluginIdentity() -} - -// NewPluginIdentity returns a new PluginIdentity. -func NewPluginIdentity( - remote string, - owner string, - plugin string, -) (PluginIdentity, error) { - return newPluginIdentity(remote, owner, plugin) -} - -// PluginIdentityForString returns a new PluginIdentity for the given string. -// -// This parses the path in the form remote/owner/plugin. -func PluginIdentityForString(path string) (PluginIdentity, error) { - remote, owner, plugin, err := parsePluginIdentityComponents(path) - if err != nil { - return nil, err - } - return NewPluginIdentity(remote, owner, plugin) -} - -// PluginReference uniquely references a plugin (including version and revision information). -// -// It can be used to identify dependencies on other plugins. -type PluginReference interface { - PluginIdentity - - // ReferenceString is the string representation of identity:version:revision. - ReferenceString() string - - // Version is the plugin's semantic version. - Version() string - - // Revision is the plugin's revision number. - // - // The accepted range for this value is 0 - math.MaxInt32. - Revision() int - - // Prevents this type from being implemented by - // another package. - isPluginReference() -} - -// NewPluginReference returns a new PluginReference. -func NewPluginReference( - identity PluginIdentity, - version string, - revision int, -) (PluginReference, error) { - return newPluginReference(identity, version, revision) -} - -// PluginReferenceForString returns a new PluginReference for the given string. -// -// This parses the path in the form remote/owner/plugin:version. -func PluginReferenceForString(reference string, revision int) (PluginReference, error) { - return parsePluginReference(reference, revision) -} - -// ParsePluginIdentityOptionalVersion returns the PluginIdentity and version for the given string. -// If the string does not contain a version, the version is assumed to be an empty string. -// This parses the path in the form remote/owner/plugin:version. -func ParsePluginIdentityOptionalVersion(rawReference string) (PluginIdentity, string, error) { - if reference, err := PluginReferenceForString(rawReference, 0); err == nil { - return reference, reference.Version(), nil - } - // Try parsing as a plugin identity (no version information) - identity, err := PluginIdentityForString(rawReference) - if err != nil { - return nil, "", fmt.Errorf("invalid remote plugin %s", rawReference) - } - return identity, "", nil -} - -// IsPluginReferenceOrIdentity returns true if the argument matches a plugin -// reference (with version) or a plugin identity (without version). -func IsPluginReferenceOrIdentity(plugin string) bool { - if _, err := PluginReferenceForString(plugin, 0); err == nil { - return true - } - if _, err := PluginIdentityForString(plugin); err == nil { - return true - } - return false -} - -func parsePluginIdentityComponents(path string) (remote string, owner string, plugin string, err error) { - slashSplit := strings.Split(path, "/") - if len(slashSplit) != 3 { - return "", "", "", newInvalidPluginIdentityStringError(path) - } - remote = strings.TrimSpace(slashSplit[0]) - if remote == "" { - return "", "", "", newInvalidPluginIdentityStringError(path) - } - owner = strings.TrimSpace(slashSplit[1]) - if owner == "" { - return "", "", "", newInvalidPluginIdentityStringError(path) - } - plugin = strings.TrimSpace(slashSplit[2]) - if plugin == "" || strings.ContainsRune(plugin, ':') { - return "", "", "", newInvalidPluginIdentityStringError(path) - } - return remote, owner, plugin, nil -} - -func newInvalidPluginIdentityStringError(s string) error { - return fmt.Errorf("plugin identity %q is invalid: must be in the form remote/owner/plugin", s) -} - -func parsePluginReference(reference string, revision int) (PluginReference, error) { - name, version, ok := strings.Cut(reference, ":") - if !ok { - return nil, fmt.Errorf("plugin references must be specified as \":\" strings") - } - identity, err := PluginIdentityForString(name) - if err != nil { - return nil, err - } - return NewPluginReference(identity, version, revision) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_identity.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_identity.go deleted file mode 100644 index 357089d256..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_identity.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginref - -import ( - "errors" - "fmt" - - "github.com/bufbuild/buf/private/pkg/netextended" -) - -type pluginIdentity struct { - remote string - owner string - plugin string -} - -func newPluginIdentity( - remote string, - owner string, - plugin string, -) (*pluginIdentity, error) { - pluginIdentity := &pluginIdentity{ - remote: remote, - owner: owner, - plugin: plugin, - } - if err := ValidatePluginIdentity(pluginIdentity); err != nil { - return nil, err - } - return pluginIdentity, nil -} - -func (m *pluginIdentity) Remote() string { - return m.remote -} - -func (m *pluginIdentity) Owner() string { - return m.owner -} - -func (m *pluginIdentity) Plugin() string { - return m.plugin -} - -func (m *pluginIdentity) IdentityString() string { - return m.remote + "/" + m.owner + "/" + m.plugin -} - -func (*pluginIdentity) isPluginIdentity() {} - -func ValidatePluginIdentity(pluginIdentity PluginIdentity) error { - if pluginIdentity == nil { - return errors.New("plugin identity is required") - } - if err := ValidateRemote(pluginIdentity.Remote()); err != nil { - return err - } - if pluginIdentity.Owner() == "" { - return errors.New("owner name is required") - } - if pluginIdentity.Plugin() == "" { - return errors.New("plugin name is required") - } - return nil -} - -func ValidateRemote(remote string) error { - if remote == "" { - return errors.New("remote name is required") - } - if _, err := netextended.ValidateHostname(remote); err != nil { - return fmt.Errorf("invalid remote %q: %w", remote, err) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_reference.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_reference.go deleted file mode 100644 index a456b68ff7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/plugin_reference.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginref - -import ( - "fmt" - "math" - "strconv" - - "golang.org/x/mod/semver" -) - -type pluginReference struct { - identity PluginIdentity - version string - revision int -} - -func (p *pluginReference) Remote() string { - return p.identity.Remote() -} - -func (p *pluginReference) Owner() string { - return p.identity.Owner() -} - -func (p *pluginReference) Plugin() string { - return p.identity.Plugin() -} - -func (p *pluginReference) IdentityString() string { - return p.identity.IdentityString() -} - -func (p *pluginReference) isPluginIdentity() {} - -func (p *pluginReference) ReferenceString() string { - return p.identity.IdentityString() + ":" + p.version + ":" + strconv.Itoa(p.revision) -} - -func (p *pluginReference) Version() string { - return p.version -} - -func (p *pluginReference) Revision() int { - return p.revision -} - -func (p *pluginReference) isPluginReference() {} - -func newPluginReference(identity PluginIdentity, version string, revision int) (*pluginReference, error) { - if err := ValidatePluginIdentity(identity); err != nil { - return nil, err - } - if err := ValidatePluginVersion(version); err != nil { - return nil, err - } - if err := validatePluginRevision(revision); err != nil { - return nil, err - } - return &pluginReference{ - identity: identity, - version: version, - revision: revision, - }, nil -} - -func ValidatePluginVersion(version string) error { - if !semver.IsValid(version) { - return fmt.Errorf("plugin version %q is not a valid semantic version", version) - } - return nil -} - -func validatePluginRevision(revision int) error { - if revision < 0 || revision > math.MaxInt32 { - return fmt.Errorf("revision %d is out of accepted range %d-%d", revision, 0, math.MaxInt32) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/usage.gen.go deleted file mode 100644 index 9c302a0412..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufpluginref - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/plugin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/plugin.go deleted file mode 100644 index 6f9d8bc9bf..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/plugin.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufplugin - -import ( - "errors" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginconfig" - "github.com/bufbuild/buf/private/bufpkg/bufplugin/bufpluginref" - "golang.org/x/mod/semver" -) - -type plugin struct { - version string - dependencies []bufpluginref.PluginReference - registry *bufpluginconfig.RegistryConfig - containerImageDigest string - sourceURL string - description string -} - -var _ Plugin = (*plugin)(nil) - -func newPlugin( - version string, - dependencies []bufpluginref.PluginReference, - registryConfig *bufpluginconfig.RegistryConfig, - containerImageDigest string, - sourceURL string, - description string, -) (*plugin, error) { - if version == "" { - return nil, errors.New("plugin version is required") - } - if !semver.IsValid(version) { - // This will probably already be validated in other call-sites - // (e.g. when we construct a *bufpluginconfig.Config or when we - // map from the Protobuf representation), but we may as well - // include it at the lowest common denominator, too. - return nil, fmt.Errorf("plugin version %q must be a valid semantic version", version) - } - if containerImageDigest == "" { - return nil, errors.New("plugin image digest is required") - } - return &plugin{ - version: version, - dependencies: dependencies, - registry: registryConfig, - containerImageDigest: containerImageDigest, - sourceURL: sourceURL, - description: description, - }, nil -} - -// Version returns the plugin's version. -func (p *plugin) Version() string { - return p.version -} - -// Dependencies returns the plugin's dependencies on other plugins. -func (p *plugin) Dependencies() []bufpluginref.PluginReference { - return p.dependencies -} - -// Registry returns the plugin's registry configuration. -func (p *plugin) Registry() *bufpluginconfig.RegistryConfig { - return p.registry -} - -// ContainerImageDigest returns the plugin's image digest. -func (p *plugin) ContainerImageDigest() string { - return p.containerImageDigest -} - -// SourceURL is an optional attribute used to specify where the source for the plugin can be found. -func (p *plugin) SourceURL() string { - return p.sourceURL -} - -// Description is an optional attribute to provide a more detailed description for the plugin. -func (p *plugin) Description() string { - return p.description -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/usage.gen.go deleted file mode 100644 index c8ace632ab..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufplugin/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufplugin - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/binary_handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/binary_handler.go deleted file mode 100644 index 1dc60e8393..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/binary_handler.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "bytes" - "context" - "io" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "google.golang.org/protobuf/types/pluginpb" -) - -type binaryHandler struct { - runner command.Runner - pluginPath string - tracer trace.Tracer - pluginArgs []string -} - -func newBinaryHandler( - runner command.Runner, - pluginPath string, - pluginArgs []string, -) *binaryHandler { - return &binaryHandler{ - runner: runner, - pluginPath: pluginPath, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - pluginArgs: pluginArgs, - } -} - -func (h *binaryHandler) Handle( - ctx context.Context, - container app.EnvStderrContainer, - responseWriter appproto.ResponseBuilder, - request *pluginpb.CodeGeneratorRequest, -) error { - ctx, span := h.tracer.Start(ctx, "plugin_proxy", trace.WithAttributes( - attribute.Key("plugin").String(filepath.Base(h.pluginPath)), - )) - defer span.End() - requestData, err := protoencoding.NewWireMarshaler().Marshal(request) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - responseBuffer := bytes.NewBuffer(nil) - stderrWriteCloser := newStderrWriteCloser(container.Stderr(), h.pluginPath) - runOptions := []command.RunOption{ - command.RunWithEnv(app.EnvironMap(container)), - command.RunWithStdin(bytes.NewReader(requestData)), - command.RunWithStdout(responseBuffer), - command.RunWithStderr(stderrWriteCloser), - } - if len(h.pluginArgs) > 0 { - runOptions = append(runOptions, command.RunWithArgs(h.pluginArgs...)) - } - if err := h.runner.Run( - ctx, - h.pluginPath, - runOptions..., - ); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - response := &pluginpb.CodeGeneratorResponse{} - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(responseBuffer.Bytes(), response); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - response, err = normalizeCodeGeneratorResponse(response) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - if response.GetSupportedFeatures()&uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) != 0 { - responseWriter.SetFeatureProto3Optional() - } - for _, file := range response.File { - if err := responseWriter.AddFile(file); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - } - // plugin.proto specifies that only non-empty errors are considered errors. - // This is also consistent with protoc's behavior. - // Ref: https://github.com/protocolbuffers/protobuf/blob/069f989b483e63005f87ab309de130677718bbec/src/google/protobuf/compiler/plugin.proto#L100-L108. - if response.GetError() != "" { - responseWriter.AddError(response.GetError()) - } - return nil -} - -func newStderrWriteCloser(delegate io.Writer, pluginPath string) io.WriteCloser { - switch filepath.Base(pluginPath) { - case "protoc-gen-swift": - // https://github.com/bufbuild/buf/issues/1736 - // Swallowing specific stderr message for protoc-gen-swift as protoc-gen-swift, see issue. - // This is all disgusting code but it's simple and it works. - // We did not document if pluginPath is normalized or not, so - return newProtocGenSwiftStderrWriteCloser(delegate) - default: - return ioextended.NopWriteCloser(delegate) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec.go deleted file mode 100644 index 9f1a775316..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package bufpluginexec provides protoc plugin handling and execution. -// -// Note this is currently implicitly tested through buf's protoc command. -// If this were split out into a separate package, testing would need to be moved to this package. -package bufpluginexec - -import ( - "context" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -const ( - // Note on versions: while Protobuf is on vX.0 where X >=21, and we - // download protoc vX.0, the version reported by protoc --version is 3.X.0. - // This is what we want to report here. - - // DefaultMajorVersion is the default major version. - defaultMajorVersion = 4 - // DefaultMinorVersion is the default minor version. - defaultMinorVersion = 22 - // DefaultPatchVersion is the default patch version. - defaultPatchVersion = 0 - // DefaultSuffixVersion is the default suffix version. - defaultSuffixVersion = "" -) - -var ( - // ProtocProxyPluginNames are the names of the plugins that should be proxied through protoc - // in the absence of a binary. - ProtocProxyPluginNames = map[string]struct{}{ - "cpp": {}, - "csharp": {}, - "java": {}, - "js": {}, - "objc": {}, - "php": {}, - "python": {}, - "pyi": {}, - "ruby": {}, - "kotlin": {}, - } - - // DefaultVersion represents the default version to use as compiler version for codegen requests. - DefaultVersion = newVersion( - defaultMajorVersion, - defaultMinorVersion, - defaultPatchVersion, - defaultSuffixVersion, - ) -) - -// Generator is used to generate code with plugins found on the local filesystem. -type Generator interface { - // Generate generates a CodeGeneratorResponse for the given pluginName. The - // pluginName must be available on the system's PATH or one of the plugins - // built-in to protoc. The plugin path can be overridden via the - // GenerateWithPluginPath option. - Generate( - ctx context.Context, - container app.EnvStderrContainer, - pluginName string, - requests []*pluginpb.CodeGeneratorRequest, - options ...GenerateOption, - ) (*pluginpb.CodeGeneratorResponse, error) -} - -// NewGenerator returns a new Generator. -func NewGenerator( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, -) Generator { - return newGenerator(logger, storageosProvider, runner, wasmPluginExecutor) -} - -// GenerateOption is an option for Generate. -type GenerateOption func(*generateOptions) - -// GenerateWithPluginPath returns a new GenerateOption that uses the given path to the plugin. -// If the path has more than one element, the first is the plugin binary and the others are -// optional additional arguments to pass to the binary. -func GenerateWithPluginPath(pluginPath ...string) GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.pluginPath = pluginPath - } -} - -// GenerateWithProtocPath returns a new GenerateOption that uses the given protoc -// path to the plugin. -func GenerateWithProtocPath(protocPath string) GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.protocPath = protocPath - } -} - -// GenerateWithWASMEnabled returns a new GenerateOption that sets wasmEnabled according to the env variable. -func GenerateWithWASMEnabled() GenerateOption { - return func(generateOptions *generateOptions) { - generateOptions.wasmEnabled = true - } -} - -// NewHandler returns a new Handler based on the plugin name and optional path. -// -// protocPath and pluginPath are optional. -// -// - If a WASM plugin path is specified as the plugin name, this returns a WASM handler. -// - If the plugin path is set, this returns a new binary handler for that path. -// - If the plugin path is unset, this does exec.LookPath for a binary named protoc-gen-pluginName, -// and if one is found, a new binary handler is returned for this. -// - Else, if the name is in ProtocProxyPluginNames, this returns a new protoc proxy handler. -// - Else, this returns error. -func NewHandler( - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, - pluginName string, - options ...HandlerOption, -) (appproto.Handler, error) { - handlerOptions := newHandlerOptions() - for _, option := range options { - option(handlerOptions) - } - - // Initialize WASM plugin handler. This is the quickest check we can do in order to - // branch here. A more stringent check is done inside the handler initialization. - // In a followup we should unify the following three checks into a strategy pattern. - if looksLikeWASM(pluginName) && handlerOptions.wasmEnabled { - return newWasmHandler(wasmPluginExecutor, pluginName) - } - - // Initialize binary plugin handler when path is specified with optional args. Return - // on error as something is wrong with the supplied pluginPath option. - if len(handlerOptions.pluginPath) > 0 { - return NewBinaryHandler(runner, handlerOptions.pluginPath[0], handlerOptions.pluginPath[1:]) - } - - // Initialize binary plugin handler based on plugin name. - if handler, err := NewBinaryHandler(runner, "protoc-gen-"+pluginName, nil); err == nil { - return handler, nil - } - - // Initialize builtin protoc plugin handler. We always look for protoc-gen-X first, - // but if not, check the builtins. - if _, ok := ProtocProxyPluginNames[pluginName]; ok { - if handlerOptions.protocPath == "" { - handlerOptions.protocPath = "protoc" - } - if protocPath, err := unsafeLookPath(handlerOptions.protocPath); err != nil { - return nil, err - } else { - return newProtocProxyHandler(storageosProvider, runner, protocPath, pluginName), nil - } - } - return nil, fmt.Errorf( - "could not find protoc plugin for name %s - please make sure protoc-gen-%s is installed and present on your $PATH", - pluginName, - pluginName, - ) -} - -// HandlerOption is an option for a new Handler. -type HandlerOption func(*handlerOptions) - -// HandlerWithProtocPath returns a new HandlerOption that sets the path to the protoc binary. -// -// The default is to do exec.LookPath on "protoc". -// protocPath is expected to be unnormalized. -func HandlerWithProtocPath(protocPath string) HandlerOption { - return func(handlerOptions *handlerOptions) { - handlerOptions.protocPath = protocPath - } -} - -// HandlerWithPluginPath returns a new HandlerOption that sets the path to the plugin binary. -// -// The default is to do exec.LookPath on "protoc-gen-" + pluginName. pluginPath is expected -// to be unnormalized. If the path has more than one element, the first is the plugin binary -// and the others are optional additional arguments to pass to the binary -func HandlerWithPluginPath(pluginPath ...string) HandlerOption { - return func(handlerOptions *handlerOptions) { - handlerOptions.pluginPath = pluginPath - } -} - -// HandlerWithWASMEnabled returns a new HandlerOption that sets wasmEnabled according to the env variable. -func HandlerWithWASMEnabled() HandlerOption { - return func(handlerOptions *handlerOptions) { - handlerOptions.wasmEnabled = true - } -} - -// NewBinaryHandler returns a new Handler that invokes the specific plugin -// specified by pluginPath. -// -// Used by other repositories. -func NewBinaryHandler(runner command.Runner, pluginPath string, pluginArgs []string) (appproto.Handler, error) { - pluginPath, err := unsafeLookPath(pluginPath) - if err != nil { - return nil, err - } - return newBinaryHandler(runner, pluginPath, pluginArgs), nil -} - -type handlerOptions struct { - protocPath string - pluginPath []string - wasmEnabled bool -} - -func newHandlerOptions() *handlerOptions { - return &handlerOptions{} -} - -// looksLikeWASM is a minimal check for WASM plugins. A more stringent validation -// of the file is done in the handlers Handle method. -func looksLikeWASM(pluginName string) bool { - return strings.HasSuffix(pluginName, ".wasm") -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go18.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go18.go deleted file mode 100644 index 8ccaae3e69..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go18.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !go1.19 - -package bufpluginexec - -import ( - "os/exec" -) - -// unsafeLookPath is a wrapper around exec.LookPath that restores the original -// pre-Go 1.19 behavior of resolving queries that would use relative PATH -// entries. We consider it acceptable for the use case of locating plugins. -// -// On Go 1.18 and below, this function is just a direct call to exec.LookPath. -// -// https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory -func unsafeLookPath(file string) (string, error) { - return exec.LookPath(file) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go19.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go19.go deleted file mode 100644 index d22274353b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/bufpluginexec_go19.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build go1.19 - -package bufpluginexec - -import ( - "errors" - "os/exec" -) - -// unsafeLookPath is a wrapper around exec.LookPath that restores the original -// pre-Go 1.19 behavior of resolving queries that would use relative PATH -// entries. We consider it acceptable for the use case of locating plugins. -// -// On Go 1.18 and below, this function is just a direct call to exec.LookPath. -// -// https://pkg.go.dev/os/exec#hdr-Executables_in_the_current_directory -func unsafeLookPath(file string) (string, error) { - path, err := exec.LookPath(file) - if errors.Is(err, exec.ErrDot) { - err = nil - } - return path, err -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/generator.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/generator.go deleted file mode 100644 index cdbd9201fd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/generator.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "context" - - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -type generator struct { - logger *zap.Logger - storageosProvider storageos.Provider - runner command.Runner - wasmPluginExecutor bufwasm.PluginExecutor -} - -func newGenerator( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - wasmPluginExecutor bufwasm.PluginExecutor, -) *generator { - return &generator{ - logger: logger, - storageosProvider: storageosProvider, - runner: runner, - wasmPluginExecutor: wasmPluginExecutor, - } -} - -func (g *generator) Generate( - ctx context.Context, - container app.EnvStderrContainer, - pluginName string, - requests []*pluginpb.CodeGeneratorRequest, - options ...GenerateOption, -) (_ *pluginpb.CodeGeneratorResponse, retErr error) { - generateOptions := newGenerateOptions() - for _, option := range options { - option(generateOptions) - } - handlerOptions := []HandlerOption{ - HandlerWithPluginPath(generateOptions.pluginPath...), - HandlerWithProtocPath(generateOptions.protocPath), - } - if generateOptions.wasmEnabled { - handlerOptions = append( - handlerOptions, - HandlerWithWASMEnabled(), - ) - } - handler, err := NewHandler( - g.storageosProvider, - g.runner, - g.wasmPluginExecutor, - pluginName, - handlerOptions..., - ) - if err != nil { - return nil, err - } - return appproto.NewGenerator( - g.logger, - handler, - ).Generate( - ctx, - container, - requests, - ) -} - -type generateOptions struct { - pluginPath []string - protocPath string - wasmEnabled bool -} - -func newGenerateOptions() *generateOptions { - return &generateOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/normalize.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/normalize.go deleted file mode 100644 index fdadcabfb4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/normalize.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "errors" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/pluginpb" -) - -func normalizeCodeGeneratorResponse( - response *pluginpb.CodeGeneratorResponse, -) (*pluginpb.CodeGeneratorResponse, error) { - // we do validation after this function returns - if response == nil || len(response.File) == 0 { - return response, nil - } - - prevFile := response.File[0] - if prevFile.GetName() == "" { - return nil, errors.New("first CodeGeneratorResponse.File had no name set") - } - // if we only have one file, just return so that we don't have to handle - // edge cases in our loop - if len(response.File) == 1 { - return response, nil - } - - var curFile *pluginpb.CodeGeneratorResponse_File - newFiles := make([]*pluginpb.CodeGeneratorResponse_File, 0, len(response.File)) - for i := 1; i < len(response.File); i++ { - curFile = response.File[i] - if curFile.GetName() != "" { - // if the name is non-empty, append the previous file to the slice - newFiles = append(newFiles, prevFile) - prevFile = curFile - } else { - // if the name is empty, append the content to the previous file - // after making sure that there is no insertion point on the current file - if curFile.GetInsertionPoint() != "" { - return nil, errors.New("empty name on CodeGeneratorResponse.File with non-empty insertion point") - } - if curFile.Content != nil { - if prevFile.Content == nil { - prevFile.Content = curFile.Content - } else { - prevFile.Content = proto.String( - prevFile.GetContent() + curFile.GetContent(), - ) - } - } - } - // if we are at the end of the loop, add the current file, as we - // will not hit the beginning of the loop again - if i == len(response.File)-1 { - newFiles = append(newFiles, prevFile) - } - } - - return &pluginpb.CodeGeneratorResponse{ - Error: response.Error, - SupportedFeatures: response.SupportedFeatures, - File: newFiles, - }, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_gen_swift_stderr_write_closer.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_gen_swift_stderr_write_closer.go deleted file mode 100644 index 96a6ed04bf..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_gen_swift_stderr_write_closer.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "bytes" - "errors" - "io" -) - -type protocGenSwiftStderrWriteCloser struct { - delegate io.Writer - buffer *bytes.Buffer -} - -func newProtocGenSwiftStderrWriteCloser(delegate io.Writer) io.WriteCloser { - return &protocGenSwiftStderrWriteCloser{ - delegate: delegate, - buffer: bytes.NewBuffer(nil), - } -} - -func (p *protocGenSwiftStderrWriteCloser) Write(data []byte) (int, error) { - // If protoc-gen-swift, we want to capture all the stderr so we can process it. - return p.buffer.Write(data) -} - -func (p *protocGenSwiftStderrWriteCloser) Close() error { - data := p.buffer.Bytes() - if len(data) == 0 { - return nil - } - newData := bytes.ReplaceAll( - data, - // If swift-protobuf changes their error message, this may not longer filter properly - // but this is OK - this filtering should be treated as non-critical. - // https://github.com/apple/swift-protobuf/blob/c3d060478fcf1f564be0a3876bde8c04247793ae/Sources/protoc-gen-swift/main.swift#L244 - // - // Note that our heuristic as to whether this is protoc-gen-swift or not for isProtocGenSwift - // is that the binary is named protoc-gen-swift, and protoc-gen-swift will print the binary name - // before any message to stderr, so given our protoc-gen-swift heuristic, this is the - // error message that will be printed. - // https://github.com/apple/swift-protobuf/blob/c3d060478fcf1f564be0a3876bde8c04247793ae/Sources/protoc-gen-swift/FileIo.swift#L19 - // - // Tested manually on Mac. - // TODO: Test manually on Windows. - []byte("protoc-gen-swift: WARNING: unknown version of protoc, use 3.2.x or later to ensure JSON support is correct.\n"), - nil, - ) - if len(newData) == 0 { - return nil - } - n, err := p.delegate.Write(newData) - if err != nil { - return err - } - if n != len(newData) { - return errors.New("incomplete write") - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_proxy_handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_proxy_handler.go deleted file mode 100644 index 730eec60ee..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/protoc_proxy_handler.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/tmp" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -type protocProxyHandler struct { - storageosProvider storageos.Provider - runner command.Runner - protocPath string - pluginName string - tracer trace.Tracer -} - -func newProtocProxyHandler( - storageosProvider storageos.Provider, - runner command.Runner, - protocPath string, - pluginName string, -) *protocProxyHandler { - return &protocProxyHandler{ - storageosProvider: storageosProvider, - runner: runner, - protocPath: protocPath, - pluginName: pluginName, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - } -} - -func (h *protocProxyHandler) Handle( - ctx context.Context, - container app.EnvStderrContainer, - responseWriter appproto.ResponseBuilder, - request *pluginpb.CodeGeneratorRequest, -) (retErr error) { - ctx, span := h.tracer.Start(ctx, "protoc_proxy", trace.WithAttributes( - attribute.Key("plugin").String(filepath.Base(h.pluginName)), - )) - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - protocVersion, err := h.getProtocVersion(ctx, container) - if err != nil { - return err - } - if h.pluginName == "kotlin" && !getKotlinSupportedAsBuiltin(protocVersion) { - return fmt.Errorf("kotlin is not supported for protoc version %s", versionString(protocVersion)) - } - // When we create protocProxyHandlers in NewHandler, we always prefer protoc-gen-.* plugins - // over builtin plugins, so we only get here if we did not find protoc-gen-js, so this - // is an error - if h.pluginName == "js" && !getJSSupportedAsBuiltin(protocVersion) { - return errors.New("js moved to a separate plugin hosted at https://github.com/protocolbuffers/protobuf-javascript in v21, you must install this plugin") - } - fileDescriptorSet := &descriptorpb.FileDescriptorSet{ - File: request.ProtoFile, - } - fileDescriptorSetData, err := protoencoding.NewWireMarshaler().Marshal(fileDescriptorSet) - if err != nil { - return err - } - descriptorFilePath := app.DevStdinFilePath - var tmpFile tmp.File - if descriptorFilePath == "" { - // since we have no stdin file (i.e. Windows), we're going to have to use a temporary file - tmpFile, err = tmp.NewFileWithData(fileDescriptorSetData) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, tmpFile.Close()) - }() - descriptorFilePath = tmpFile.AbsPath() - } - tmpDir, err := tmp.NewDir() - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, tmpDir.Close()) - }() - args := []string{ - fmt.Sprintf("--descriptor_set_in=%s", descriptorFilePath), - fmt.Sprintf("--%s_out=%s", h.pluginName, tmpDir.AbsPath()), - } - if getSetExperimentalAllowProto3OptionalFlag(protocVersion) { - args = append( - args, - "--experimental_allow_proto3_optional", - ) - } - if parameter := request.GetParameter(); parameter != "" { - args = append( - args, - fmt.Sprintf("--%s_opt=%s", h.pluginName, parameter), - ) - } - args = append( - args, - request.FileToGenerate..., - ) - stdin := ioextended.DiscardReader - if descriptorFilePath != "" && descriptorFilePath == app.DevStdinFilePath { - stdin = bytes.NewReader(fileDescriptorSetData) - } - if err := h.runner.Run( - ctx, - h.protocPath, - command.RunWithArgs(args...), - command.RunWithEnv(app.EnvironMap(container)), - command.RunWithStdin(stdin), - command.RunWithStderr(container.Stderr()), - ); err != nil { - // TODO: strip binary path as well? - // We don't know if this is a system error or plugin error, so we assume system error - return handlePotentialTooManyFilesError(err) - } - if getFeatureProto3OptionalSupported(protocVersion) { - responseWriter.SetFeatureProto3Optional() - } - // no need for symlinks here, and don't want to support - readWriteBucket, err := h.storageosProvider.NewReadWriteBucket(tmpDir.AbsPath()) - if err != nil { - return err - } - return storage.WalkReadObjects( - ctx, - readWriteBucket, - "", - func(readObject storage.ReadObject) error { - data, err := io.ReadAll(readObject) - if err != nil { - return err - } - return responseWriter.AddFile( - &pluginpb.CodeGeneratorResponse_File{ - Name: proto.String(readObject.Path()), - Content: proto.String(string(data)), - }, - ) - }, - ) -} - -func (h *protocProxyHandler) getProtocVersion( - ctx context.Context, - container app.EnvContainer, -) (*pluginpb.Version, error) { - stdoutBuffer := bytes.NewBuffer(nil) - if err := h.runner.Run( - ctx, - h.protocPath, - command.RunWithArgs("--version"), - command.RunWithEnv(app.EnvironMap(container)), - command.RunWithStdout(stdoutBuffer), - ); err != nil { - // TODO: strip binary path as well? - return nil, handlePotentialTooManyFilesError(err) - } - return parseVersionForCLIVersion(strings.TrimSpace(stdoutBuffer.String())) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/usage.gen.go deleted file mode 100644 index a8199c6a81..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufpluginexec - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util.go deleted file mode 100644 index 12e1c89523..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "errors" - "fmt" - "os" -) - -// handlePotentialTooManyFilesError checks if the error is a result of too many files -// being open, and if so, modifies the output error with a help message. -// -// This could potentially go in osextended, but we want to provide a specific help -// message referencing StrategyAll, so it is simplest to just put this here for now. -func handlePotentialTooManyFilesError(err error) error { - if isTooManyFilesError(err) { - return fmt.Errorf("%w: %s", err, tooManyFilesHelpMessage) - } - return err -} - -func isTooManyFilesError(err error) bool { - var syscallError *os.SyscallError - if errors.As(err, &syscallError) { - // This may not actually be correct on other platforms, however the worst case - // is that we just don't provide the additional help message. - // - // Note that syscallError.Syscall has both equalled "pipe" and "fork/exec" in testing, but - // we don't match on this as this could be particularly prone to being platform-specific. - return syscallError.Err != nil && syscallError.Err.Error() == "too many open files" - } - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_darwin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_darwin.go deleted file mode 100644 index 3c5058ee1b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_darwin.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build darwin -// +build darwin - -package bufpluginexec - -const tooManyFilesHelpMessage = `This is commonly caused by the maximum file limit being too low. On Mac, the default is 256, which is very low. Run "ulimit -n" to check your file limit. If this happened on generation, setting "strategy: all" for each configured plugin in your buf.gen.yaml can mitigate the issue if you are unable to change your file limit.` diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_undarwin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_undarwin.go deleted file mode 100644 index 85123c3488..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/util_undarwin.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !darwin -// +build !darwin - -package bufpluginexec - -const tooManyFilesHelpMessage = `This is commonly caused by the maximum file limit being too low. Run "ulimit -n" to check your file limit. If this happened on generation, setting "strategy: all" for each configured plugin in your buf.gen.yaml can mitigate the issue if you are unable to change your file limit.` diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/version.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/version.go deleted file mode 100644 index af9ec30417..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/version.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "errors" - "fmt" - "strconv" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/pluginpb" -) - -func newVersion(major int32, minor int32, patch int32, suffix string) *pluginpb.Version { - version := &pluginpb.Version{ - Major: proto.Int32(major), - Minor: proto.Int32(minor), - Patch: proto.Int32(patch), - } - if suffix != "" { - version.Suffix = proto.String(suffix) - } - return version -} - -func parseVersionForCLIVersion(value string) (_ *pluginpb.Version, retErr error) { - defer func() { - if retErr != nil { - retErr = fmt.Errorf("cannot parse protoc version %q: %w", value, retErr) - } - }() - - // protoc always starts with "libprotoc " - value = strings.TrimPrefix(value, "libprotoc ") - split := strings.Split(value, ".") - if n := len(split); n != 2 && n != 3 { - return nil, fmt.Errorf("%d components split by '.'", n) - } - major, err := strconv.ParseInt(split[0], 10, 32) - if err != nil { - return nil, err - } - var suffix string - restSplit := strings.SplitN(split[len(split)-1], "-", 2) - lastNumber, err := strconv.ParseInt(restSplit[0], 10, 32) - if err != nil { - return nil, err - } - switch len(restSplit) { - case 1: - case 2: - suffix = restSplit[1] - default: - return nil, errors.New("more than two patch components split by '-'") - } - var minor int64 - var patch int64 - switch len(split) { - case 2: - minor = lastNumber - case 3: - minor, err = strconv.ParseInt(split[1], 10, 32) - if err != nil { - return nil, err - } - patch = lastNumber - } - return newVersion(int32(major), int32(minor), int32(patch), suffix), nil -} - -func versionString(version *pluginpb.Version) string { - var value string - if version.GetMajor() <= 3 || version.GetPatch() != 0 { - value = fmt.Sprintf("%d.%d.%d", version.GetMajor(), version.GetMinor(), version.GetPatch()) - } else { - value = fmt.Sprintf("%d.%d", version.GetMajor(), version.GetMinor()) - } - if version.Suffix != nil { - value = value + "-" + version.GetSuffix() - } - return value -} - -// Should I set the --experimental_allow_proto3_optional flag? -func getSetExperimentalAllowProto3OptionalFlag(version *pluginpb.Version) bool { - if version.GetSuffix() == "buf" { - return false - } - if version.GetMajor() != 3 { - return false - } - return version.GetMinor() > 11 && version.GetMinor() < 15 -} - -// Should I notify that I am OK with the proto3 optional feature? -func getFeatureProto3OptionalSupported(version *pluginpb.Version) bool { - if version.GetSuffix() == "buf" { - return true - } - if version.GetMajor() < 3 { - return false - } - if version.GetMajor() == 3 { - return version.GetMinor() > 11 - } - // version.GetMajor() > 3 - return true -} - -// Is kotlin supported as a builtin plugin? -func getKotlinSupportedAsBuiltin(version *pluginpb.Version) bool { - if version.GetSuffix() == "buf" { - return true - } - if version.GetMajor() < 3 { - return false - } - if version.GetMajor() == 3 { - return version.GetMinor() > 16 - } - // version.GetMajor() > 3 - return true -} - -// Is js supported as a builtin plugin? -func getJSSupportedAsBuiltin(version *pluginpb.Version) bool { - if version.GetSuffix() == "buf" { - return true - } - if version.GetMajor() < 3 { - return false - } - if version.GetMajor() == 3 { - // v21 and above of protoc still returns "3.MAJOR.Z" for version - return version.GetMinor() < 21 - } - // version.GetMajor() > 3 - // This will catch if they ever change protoc's returned version - // to the proper major version - return false -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/wasm_handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/wasm_handler.go deleted file mode 100644 index 0a42423ff6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufpluginexec/wasm_handler.go +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufpluginexec - -import ( - "bytes" - "context" - "errors" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/bufpkg/bufwasm" - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "google.golang.org/protobuf/types/pluginpb" -) - -type wasmHandler struct { - wasmPluginExecutor bufwasm.PluginExecutor - pluginPath string - tracer trace.Tracer -} - -func newWasmHandler( - wasmPluginExecutor bufwasm.PluginExecutor, - pluginPath string, -) (*wasmHandler, error) { - if pluginAbsPath, err := validateWASMFilePath(pluginPath); err != nil { - return nil, err - } else { - return &wasmHandler{ - wasmPluginExecutor: wasmPluginExecutor, - pluginPath: pluginAbsPath, - tracer: otel.GetTracerProvider().Tracer("bufbuild/buf"), - }, nil - } -} - -func (h *wasmHandler) Handle( - ctx context.Context, - container app.EnvStderrContainer, - responseWriter appproto.ResponseBuilder, - request *pluginpb.CodeGeneratorRequest, -) (retErr error) { - ctx, span := h.tracer.Start(ctx, "plugin_proxy", trace.WithAttributes( - attribute.Key("plugin").String(filepath.Base(h.pluginPath)), - )) - defer span.End() - requestData, err := protoencoding.NewWireMarshaler().Marshal(request) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - pluginBytes, err := os.ReadFile(h.pluginPath) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - compiledPlugin, err := h.wasmPluginExecutor.CompilePlugin(ctx, pluginBytes) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - defer func() { - retErr = multierr.Append(retErr, compiledPlugin.Close()) - }() - - responseBuffer := bytes.NewBuffer(nil) - if err := h.wasmPluginExecutor.Run( - ctx, - compiledPlugin, - // command.RunWithEnv(app.EnvironMap(container)), // TODO, not exposed right now - bytes.NewReader(requestData), - responseBuffer, - ); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - if pluginErr := new(bufwasm.PluginExecutionError); errors.As(err, &pluginErr) { - _, _ = container.Stderr().Write([]byte(pluginErr.Stderr)) - } - return err - } - response := &pluginpb.CodeGeneratorResponse{} - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(responseBuffer.Bytes(), response); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - response, err = normalizeCodeGeneratorResponse(response) - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - if response.GetSupportedFeatures()&uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL) != 0 { - responseWriter.SetFeatureProto3Optional() - } - for _, file := range response.File { - if err := responseWriter.AddFile(file); err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - } - // plugin.proto specifies that only non-empty errors are considered errors. - // This is also consistent with protoc's behavior. - // Ref: https://github.com/protocolbuffers/protobuf/blob/069f989b483e63005f87ab309de130677718bbec/src/google/protobuf/compiler/plugin.proto#L100-L108. - if response.GetError() != "" { - responseWriter.AddError(response.GetError()) - } - return nil -} - -func validateWASMFilePath(path string) (string, error) { - path, err := filepath.Abs(path) - if err != nil { - return path, err - } - info, err := os.Stat(path) - if err != nil { - return path, err - } - if !info.Mode().IsRegular() || !strings.HasSuffix(path, ".wasm") { - return path, fmt.Errorf("invalid WASM file: %s", path) - } - return path, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/bufreflect.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/bufreflect.go deleted file mode 100644 index f6c0010ad4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/bufreflect.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufreflect - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/bufpkg/bufimage" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/dynamicpb" -) - -// NewMessage returns a new dynamic proto.Message for the fully qualified typeName -// in the bufimage.Image. -func NewMessage( - ctx context.Context, - image bufimage.Image, - typeName string, -) (proto.Message, error) { - if err := ValidateTypeName(typeName); err != nil { - return nil, err - } - files, err := protodesc.NewFiles(bufimage.ImageToFileDescriptorSet(image)) - if err != nil { - return nil, err - } - descriptor, err := files.FindDescriptorByName(protoreflect.FullName(typeName)) - if err != nil { - return nil, err - } - typedDescriptor, ok := descriptor.(protoreflect.MessageDescriptor) - if !ok { - return nil, fmt.Errorf("%q must be a message but is a %T", typeName, descriptor) - } - return dynamicpb.NewMessage(typedDescriptor), nil -} - -// ValidateTypeName validates that the typeName is well-formed, such that it has one or more -// '.'-delimited package components and no '/' elements. -func ValidateTypeName(typeName string) error { - if fullName := protoreflect.FullName(typeName); !fullName.IsValid() { - return fmt.Errorf("%q is not a valid fully qualified type name", fullName) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/usage.gen.go deleted file mode 100644 index 5ec6da2a5c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufreflect/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufreflect - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremoteplugin.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremoteplugin.go deleted file mode 100644 index a8f347be9c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/bufremoteplugin.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufremoteplugin - -import ( - "fmt" - "strings" - - "github.com/bufbuild/buf/private/pkg/app/appcmd" -) - -const ( - // PluginsPathName is the path prefix used to signify that - // a name belongs to a plugin. - PluginsPathName = "plugins" -) - -// ParsePluginPath parses a string in the format -// into remote, owner and name. -func ParsePluginPath(pluginPath string) (remote string, owner string, name string, _ error) { - if pluginPath == "" { - return "", "", "", appcmd.NewInvalidArgumentError("you must specify a plugin path") - } - components := strings.Split(pluginPath, "/") - if len(components) != 4 || components[2] != PluginsPathName { - return "", "", "", appcmd.NewInvalidArgumentErrorf("%s is not a valid plugin path", pluginPath) - } - return components[0], components[1], components[3], nil -} - -// ParsePluginVersionPath parses a string in the format -// into remote, owner, name and version. The version is empty if not specified. -func ParsePluginVersionPath(pluginVersionPath string) (remote string, owner string, name string, version string, _ error) { - remote, owner, name, err := ParsePluginPath(pluginVersionPath) - if err != nil { - return "", "", "", "", err - } - components := strings.Split(name, ":") - switch len(components) { - case 2: - return remote, owner, components[0], components[1], nil - case 1: - return remote, owner, name, "", nil - default: - return "", "", "", "", fmt.Errorf("invalid version: %q", name) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/usage.gen.go deleted file mode 100644 index d2dba0d5a3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufremoteplugin/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufremoteplugin - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/buffer_codec.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/buffer_codec.go deleted file mode 100644 index 174c9a6d70..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/buffer_codec.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufstudioagent - -import ( - "bytes" - "fmt" - "io" - - "github.com/bufbuild/buf/private/pkg/protoencoding" - connect "github.com/bufbuild/connect-go" - "google.golang.org/protobuf/proto" -) - -// bufferCodec is a connect.Codec for use with clients of type -// connect.Client[bytes.Buffer, bytes.Buffer] which does not attempt to parse -// messages but instead allows the application layer to work on the buffers -// directly. This is useful for creating proxies. -type bufferCodec struct { - name string -} - -var _ connect.Codec = (*bufferCodec)(nil) - -func (b *bufferCodec) Name() string { return b.name } - -func (b *bufferCodec) Marshal(src any) ([]byte, error) { - switch typedSrc := src.(type) { - case *bytes.Buffer: - return typedSrc.Bytes(), nil - case proto.Message: - // When the codec is named "proto", connect will assume that it - // may also be used to unmarshal the errors in the - // grpc-status-details-bin trailer. The type used is not - // exported so we match against the general proto.Message. - return protoencoding.NewWireMarshaler().Marshal(typedSrc) - default: - return nil, fmt.Errorf("marshal unexpected type %T", src) - } -} - -func (b *bufferCodec) Unmarshal(src []byte, dst any) error { - switch destination := dst.(type) { - case *bytes.Buffer: - destination.Reset() - _, err := io.Copy(destination, bytes.NewReader(src)) - return err - case proto.Message: - // When the codec is named "proto", connect will assume that it - // may also be used to unmarshal the errors in the - // grpc-status-details-bin trailer. The type used is not - // exported so we match against the general proto.Message. - return protoencoding.NewWireUnmarshaler(nil).Unmarshal(src, destination) - default: - return fmt.Errorf("unmarshal unexpected type %T", dst) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/bufstudioagent.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/bufstudioagent.go deleted file mode 100644 index 54a1d11fce..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/bufstudioagent.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufstudioagent - -import ( - "crypto/tls" - "net/http" - - "github.com/rs/cors" - "go.uber.org/zap" -) - -// NewHandler creates a new handler that serves the invoke endpoints for the -// agent. -func NewHandler( - logger *zap.Logger, - origin string, - tlsClientConfig *tls.Config, - disallowedHeaders map[string]struct{}, - forwardHeaders map[string]string, - privateNetwork bool, -) http.Handler { - corsHandlerOptions := cors.Options{ - AllowedOrigins: []string{origin}, - AllowedMethods: []string{http.MethodPost, http.MethodOptions}, - AllowCredentials: true, - } - if privateNetwork { - corsHandlerOptions.AllowPrivateNetwork = true - } - corsHandler := cors.New(corsHandlerOptions) - plainHandler := corsHandler.Handler(newPlainPostHandler(logger, disallowedHeaders, forwardHeaders, tlsClientConfig)) - mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { - switch r.Method { - case http.MethodGet: - // In the future we could check for an upgrade header here. - _, _ = w.Write([]byte("OK")) - case http.MethodPost: - plainHandler.ServeHTTP(w, r) - return - case http.MethodOptions: - if privateNetwork { - corsHandler.HandlerFunc(w, r) - return - } - // If the private network flag is not used, fall through to the default - fallthrough - default: - http.Error(w, "", http.StatusMethodNotAllowed) - return - } - }) - return mux -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/plain_post_handler.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/plain_post_handler.go deleted file mode 100644 index 48b0614e89..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/plain_post_handler.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufstudioagent - -import ( - "bytes" - "crypto/tls" - "encoding/base64" - "errors" - "fmt" - "io" - "net" - "net/http" - "net/textproto" - "net/url" - - studiov1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/connect-go" - "go.uber.org/zap" - "golang.org/x/net/http2" - "google.golang.org/protobuf/proto" -) - -// MaxMessageSizeBytesDefault determines the maximum number of bytes to read -// from the request body. -const MaxMessageSizeBytesDefault = 1024 * 1024 * 5 - -// plainPostHandler implements a POST handler for forwarding requests that can -// be called with simple CORS requests. -// -// Simple CORS requests are limited [1] to certain headers and content types, so -// this handler expects base64 encoded protobuf messages in the body and writes -// out base64 encoded protobuf messages to be able to use Content-Type: text/plain. -// -// Because of the content-type restriction we do not define a protobuf service -// that gets served by connect but instead use a plain post handler. -// -// [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests). -type plainPostHandler struct { - Logger *zap.Logger - MaxMessageSizeBytes int64 - B64Encoding *base64.Encoding - TLSClient *http.Client - H2CClient *http.Client - DisallowedHeaders map[string]struct{} - ForwardHeaders map[string]string -} - -func newPlainPostHandler( - logger *zap.Logger, - disallowedHeaders map[string]struct{}, - forwardHeaders map[string]string, - tlsClientConfig *tls.Config, -) *plainPostHandler { - canonicalDisallowedHeaders := make(map[string]struct{}, len(disallowedHeaders)) - for k := range disallowedHeaders { - canonicalDisallowedHeaders[textproto.CanonicalMIMEHeaderKey(k)] = struct{}{} - } - canonicalForwardHeaders := make(map[string]string, len(forwardHeaders)) - for k, v := range forwardHeaders { - canonicalForwardHeaders[textproto.CanonicalMIMEHeaderKey(k)] = v - } - return &plainPostHandler{ - B64Encoding: base64.StdEncoding, - DisallowedHeaders: canonicalDisallowedHeaders, - ForwardHeaders: canonicalForwardHeaders, - H2CClient: &http.Client{ - Transport: &http2.Transport{ - AllowHTTP: true, - DialTLS: func(netw, addr string, config *tls.Config) (net.Conn, error) { - return net.Dial(netw, addr) - }, - }, - }, - Logger: logger, - MaxMessageSizeBytes: MaxMessageSizeBytesDefault, - TLSClient: &http.Client{ - Transport: &http2.Transport{ - TLSClientConfig: tlsClientConfig, - }, - }, - } -} - -func (i *plainPostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - if r.Method != http.MethodPost { - http.Error(w, "", http.StatusMethodNotAllowed) - return - } - if r.Header.Get("content-type") != "text/plain" { - http.Error(w, "", http.StatusUnsupportedMediaType) - return - } - bodyBytes, err := io.ReadAll( - base64.NewDecoder( - i.B64Encoding, - http.MaxBytesReader(w, r.Body, i.MaxMessageSizeBytes), - ), - ) - if err != nil { - if b64Err := new(base64.CorruptInputError); errors.As(err, &b64Err) { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - http.Error(w, err.Error(), http.StatusRequestEntityTooLarge) - return - } - envelopeRequest := &studiov1alpha1.InvokeRequest{} - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(bodyBytes, envelopeRequest); err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - request := connect.NewRequest(bytes.NewBuffer(envelopeRequest.GetBody())) - for _, header := range envelopeRequest.Headers { - if _, ok := i.DisallowedHeaders[textproto.CanonicalMIMEHeaderKey(header.Key)]; ok { - http.Error(w, fmt.Sprintf("header %q disallowed by agent", header.Key), http.StatusBadRequest) - return - } - for _, value := range header.Value { - request.Header().Add(header.Key, value) - } - } - for fromHeader, toHeader := range i.ForwardHeaders { - headerValues := r.Header.Values(fromHeader) - if len(headerValues) > 0 { - request.Header().Del(toHeader) - for _, headerValue := range headerValues { - request.Header().Add(toHeader, headerValue) - } - } - } - targetURL, err := url.Parse(envelopeRequest.GetTarget()) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - var httpClient *http.Client - switch targetURL.Scheme { - case "http": - httpClient = i.H2CClient - case "https": - httpClient = i.TLSClient - default: - http.Error(w, fmt.Sprintf("must specify http or https url scheme, got %q", targetURL.Scheme), http.StatusBadRequest) - return - } - clientOptions, err := connectClientOptionsFromContentType(request.Header().Get("Content-Type")) - if err != nil { - http.Error(w, err.Error(), http.StatusBadRequest) - return - } - client := connect.NewClient[bytes.Buffer, bytes.Buffer]( - httpClient, - targetURL.String(), - clientOptions..., - ) - // TODO(rvanginkel) should this context be cloned to remove attached values (but keep timeout)? - response, err := client.CallUnary(r.Context(), request) - if err != nil { - // We need to differentiate client errors from server errors. In the former, - // trigger a `StatusBadGateway` result, and in the latter surface whatever - // error information came back from the server. - // - // Any error here is expected to be wrapped in a `connect.Error` struct. We - // need to check *first* if it's not a wire error, so we can assume the - // request never left the client, or a response never arrived from the - // server. In those scenarios we trigger a `StatusBadGateway` to signal - // that the upstream server is unreachable or in a bad status... - if !connect.IsWireError(err) { - http.Error(w, err.Error(), http.StatusBadGateway) - return - } - // ... but if a response was received from the server, we assume there's - // error information from the server we can surface to the user by including - // it in the headers response, unless it is a `CodeUnknown` error. Connect - // marks any issues connecting with the `CodeUnknown` error. - if connectErr := new(connect.Error); errors.As(err, &connectErr) { - if connectErr.Code() == connect.CodeUnknown { - http.Error(w, err.Error(), http.StatusBadGateway) - return - } - i.writeProtoMessage(w, &studiov1alpha1.InvokeResponse{ - // connectErr.Meta contains the trailers for the - // caller to find out the error details. - Headers: goHeadersToProtoHeaders(connectErr.Meta()), - }) - return - } - i.Logger.Warn( - "non_connect_unary_error", - zap.Error(err), - ) - http.Error(w, err.Error(), http.StatusBadGateway) - return - } - i.writeProtoMessage(w, &studiov1alpha1.InvokeResponse{ - Headers: goHeadersToProtoHeaders(response.Header()), - Body: response.Msg.Bytes(), - Trailers: goHeadersToProtoHeaders(response.Trailer()), - }) -} - -func connectClientOptionsFromContentType(contentType string) ([]connect.ClientOption, error) { - switch contentType { - case "application/grpc", "application/grpc+proto": - return []connect.ClientOption{ - connect.WithGRPC(), - connect.WithCodec(&bufferCodec{name: "proto"}), - }, nil - case "application/grpc+json": - return []connect.ClientOption{ - connect.WithGRPC(), - connect.WithCodec(&bufferCodec{name: "json"}), - }, nil - case "application/json": - return []connect.ClientOption{ - connect.WithCodec(&bufferCodec{name: "json"}), - }, nil - case "application/proto": - return []connect.ClientOption{ - connect.WithCodec(&bufferCodec{name: "proto"}), - }, nil - default: - return nil, fmt.Errorf("unknown Content-Type: %q", contentType) - } -} - -func (i *plainPostHandler) writeProtoMessage(w http.ResponseWriter, message proto.Message) { - responseProtoBytes, err := protoencoding.NewWireMarshaler().Marshal(message) - if err != nil { - http.Error(w, err.Error(), http.StatusInternalServerError) - return - } - responseB64Bytes := make([]byte, i.B64Encoding.EncodedLen(len(responseProtoBytes))) - i.B64Encoding.Encode(responseB64Bytes, responseProtoBytes) - w.Header().Set("Content-Type", "text/plain") - if n, err := w.Write(responseB64Bytes); n != len(responseB64Bytes) && err != nil { - i.Logger.Error( - "write_error", - zap.Int("expected_bytes", len(responseB64Bytes)), - zap.Int("actual_bytes", n), - zap.Error(err), - ) - } -} - -func goHeadersToProtoHeaders(in http.Header) []*studiov1alpha1.Headers { - var out []*studiov1alpha1.Headers - for k, v := range in { - out = append(out, &studiov1alpha1.Headers{ - Key: k, - Value: v, - }) - } - return out -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/usage.gen.go deleted file mode 100644 index 8e120fa0de..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufstudioagent/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package bufstudioagent - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/buftransport.go b/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/buftransport.go deleted file mode 100644 index 9c9978d9fe..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/buftransport.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package buftransport - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" -) - -// PrependHTTP prepends an http scheme to the given address -func PrependHTTP(address string) string { - return schemeHTTP + "://" + address -} - -// PrependHTTPS prepends an https scheme to the given address -func PrependHTTPS(address string) string { - return schemeHTTPS + "://" + address -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/usage.gen.go b/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/usage.gen.go deleted file mode 100644 index c7b3be836c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/buftransport/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package buftransport - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/bufwasm.go b/vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/bufwasm.go deleted file mode 100644 index 3d54b10864..0000000000 --- a/vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/bufwasm.go +++ /dev/null @@ -1,289 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package bufwasm - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "strconv" - "strings" - "testing/fstest" - - wasmpluginv1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/tetratelabs/wazero" - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/experimental/gojs" - "github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1" - "github.com/tetratelabs/wazero/sys" - "go.uber.org/multierr" - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" -) - -// CustomSectionName is the name of the custom wasm section we look into for buf -// extensions. -const CustomSectionName = ".bufplugin" - -// https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#sections%E2%91%A0 -const customSectionID = 0 - -// maxMemoryBytes wazero memory page limit -const maxMemoryBytes = 1 << 29 // 512MB - -// CompiledPlugin is the compiled representation of loading wasm bytes. -type CompiledPlugin struct { - cache wazero.CompilationCache - runtime wazero.Runtime - module wazero.CompiledModule - - // Metadata parsed from custom sections of the wasm file. May be nil if - // no buf specific sections were found. - ExecConfig *wasmpluginv1.ExecConfig -} - -func (c *CompiledPlugin) ABI() wasmpluginv1.WasmABI { - if c.ExecConfig.GetWasmAbi() != wasmpluginv1.WasmABI_WASM_ABI_UNSPECIFIED { - return c.ExecConfig.GetWasmAbi() - } - exportedFuncs := c.module.ExportedFunctions() - if _, ok := exportedFuncs["_start"]; ok { - return wasmpluginv1.WasmABI_WASM_ABI_WASI_SNAPSHOT_PREVIEW1 - } else if _, ok := exportedFuncs["run"]; ok { - return wasmpluginv1.WasmABI_WASM_ABI_GOJS - } - return wasmpluginv1.WasmABI_WASM_ABI_UNSPECIFIED -} - -// PluginExecutionError is a wrapper for WASM plugin execution errors. -type PluginExecutionError struct { - Stderr string - Exitcode uint32 -} - -// NewPluginExecutionError constructs a new execution error. -func NewPluginExecutionError(stderr string, exitcode uint32) *PluginExecutionError { - return &PluginExecutionError{Stderr: strings.ToValidUTF8(stderr, ""), Exitcode: exitcode} -} - -func (e *PluginExecutionError) Error() string { - return "plugin exited with code " + strconv.Itoa(int(e.Exitcode)) -} - -// EncodeBufSection encodes the ExecConfig message as a custom wasm section. -// The resulting bytes can be appended to any valid wasm file to add the new -// section to that file. -func EncodeBufSection(config *wasmpluginv1.ExecConfig) ([]byte, error) { - metadataBinary, err := protoencoding.NewWireMarshaler().Marshal(config) - if err != nil { - return nil, err - } - // Abusing the protowire package because the wasm file format is similar. - return protowire.AppendBytes( - []byte{customSectionID}, - append( - protowire.AppendString( - nil, - CustomSectionName, - ), - metadataBinary..., - ), - ), nil -} - -// PluginExecutor wraps a wazero end exposes functions to compile and run wasm plugins. -type PluginExecutor interface { - CompilePlugin(ctx context.Context, plugin []byte) (_ *CompiledPlugin, retErr error) - Run(ctx context.Context, plugin *CompiledPlugin, stdin io.Reader, stdout io.Writer) (retErr error) -} - -type WASMPluginExecutor struct { - compilationCacheDir string - runtimeConfig wazero.RuntimeConfig -} - -// NewPluginExecutor creates a new pluginExecutor with a compilation cache dir -// and other buf defaults. -func NewPluginExecutor(compilationCacheDir string, options ...PluginExecutorOption) (*WASMPluginExecutor, error) { - runtimeConfig := wazero.NewRuntimeConfig(). - WithCoreFeatures(api.CoreFeaturesV2). - WithMemoryLimitPages(maxMemoryBytes >> 16). // a page is 2^16 bytes - WithCustomSections(true). - WithCloseOnContextDone(true) - executor := &WASMPluginExecutor{ - compilationCacheDir: compilationCacheDir, - runtimeConfig: runtimeConfig, - } - for _, opt := range options { - opt(executor) - } - return executor, nil -} - -// PluginExecutorOption configuration options for the PluginExecutor. -type PluginExecutorOption func(*WASMPluginExecutor) - -// WithMemoryLimitPages provides a custom per memory limit for a plugin -// executor. The default is 8192 pages for 512MB. -func WithMemoryLimitPages(memoryLimitPages uint32) PluginExecutorOption { - return func(pluginExecutor *WASMPluginExecutor) { - pluginExecutor.runtimeConfig = pluginExecutor.runtimeConfig.WithMemoryLimitPages(memoryLimitPages) - } -} - -// CompilePlugin takes a byte slice with a valid wasm module, compiles it and -// optionally reads out buf plugin metadata. -func (e *WASMPluginExecutor) CompilePlugin(ctx context.Context, plugin []byte) (_ *CompiledPlugin, retErr error) { - // Configure the compilation cache, which must be closed after the runtime. - var cache wazero.CompilationCache - if e.compilationCacheDir == "" { - cache = wazero.NewCompilationCache() - } else { - var err error - cache, err = wazero.NewCompilationCacheWithDir(e.compilationCacheDir) - if err != nil { - return nil, err - } - } - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, cache.Close(ctx)) - } - }() - - // Create the shared runtime used for all plugin instantiations - runtime := wazero.NewRuntimeWithConfig(ctx, e.runtimeConfig.WithCompilationCache(cache)) - defer func() { - if retErr != nil { - retErr = multierr.Append(retErr, runtime.Close(ctx)) - } - }() - - // Note: before we start accepting user plugins, we should do more - // validation on the metadata here: file path cleaning etc. - compiledModule, err := runtime.CompileModule(ctx, plugin) - if err != nil { - return nil, fmt.Errorf("error compiling wasm: %w", err) - } - - compiledPlugin := &CompiledPlugin{cache: cache, runtime: runtime, module: compiledModule} - - // Try to load any exec configuration stored in the WebAssembly custom section. - var bufsectionBytes []byte - for _, section := range compiledModule.CustomSections() { - if section.Name() == CustomSectionName { - bufsectionBytes = append(bufsectionBytes, section.Data()...) - } - } - if len(bufsectionBytes) > 0 { - metadata := &wasmpluginv1.ExecConfig{} - if err := proto.Unmarshal(bufsectionBytes, metadata); err != nil { - return nil, fmt.Errorf("error unmarshalling custom section: %w", err) - } - compiledPlugin.ExecConfig = metadata - } - - // Instantiate host functions required by the plugin guest. - switch compiledPlugin.ABI() { - case wasmpluginv1.WasmABI_WASM_ABI_GOJS: - if _, err := gojs.Instantiate(ctx, runtime); err != nil { - return nil, fmt.Errorf("error instantiating gojs: %w", err) - } - case wasmpluginv1.WasmABI_WASM_ABI_WASI_SNAPSHOT_PREVIEW1: - if _, err := wasi_snapshot_preview1.Instantiate(ctx, runtime); err != nil { - return nil, fmt.Errorf("error instantiating wasi: %w", err) - } - default: - return nil, errors.New("unable to detect wasm abi") - } - return compiledPlugin, nil -} - -// Run executes a plugin. If the plugin exited with non-zero status, this -// returns a *PluginExecutionError. -func (e *WASMPluginExecutor) Run( - ctx context.Context, - plugin *CompiledPlugin, - stdin io.Reader, - stdout io.Writer, -) (retErr error) { - name := plugin.module.Name() - if name == "" { - // Some plugins will attempt to read argv[0], but don't have a - // name in the wasm file. Fallback to this. - name = "protoc-gen-wasm" - } - - stderr := bytes.NewBuffer(nil) - config := wazero.NewModuleConfig(). - WithName(""). // Remove the module name so that parallel runs cannot conflict - WithArgs(append([]string{name}, plugin.ExecConfig.GetArgs()...)...). - WithStdin(stdin). - WithStdout(stdout). - WithStderr(stderr) - if len(plugin.ExecConfig.GetFiles()) > 0 { - mapFS := make(fstest.MapFS, len(plugin.ExecConfig.GetFiles())) - for _, file := range plugin.ExecConfig.Files { - mapFS[strings.TrimPrefix(file.Path, "/")] = &fstest.MapFile{ - Data: file.Contents, - } - } - config = config.WithFS(mapFS) - } - - runtime := plugin.runtime - - var err error - switch plugin.ABI() { - case wasmpluginv1.WasmABI_WASM_ABI_GOJS: - err = gojs.Run(ctx, runtime, plugin.module, gojs.NewConfig(config)) - case wasmpluginv1.WasmABI_WASM_ABI_WASI_SNAPSHOT_PREVIEW1: - var module api.Module - module, err = runtime.InstantiateModule(ctx, plugin.module, config) - if err != nil { - if exitErr := new(sys.ExitError); errors.As(err, &exitErr) { - if exitErr.ExitCode() == 0 { - return nil - } - return NewPluginExecutionError( - fmt.Sprintf("error instantiating wasi module: %s", err.Error()), exitErr.ExitCode()) - } - return err - } - defer func() { - retErr = multierr.Append(retErr, module.Close(ctx)) - }() - default: - err = errors.New("unable to detect wasm abi") - } - if err != nil { - if exitErr := new(sys.ExitError); errors.As(err, &exitErr) { - if exitErr.ExitCode() == 0 { - return nil - } - return NewPluginExecutionError(stderr.String(), exitErr.ExitCode()) - } - return err - } - return nil -} - -func (c *CompiledPlugin) Close() error { - ctx := context.Background() - return multierr.Append(c.runtime.Close(ctx), c.cache.Close(ctx)) -} diff --git a/vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/testdata/echo.wasm b/vendor/github.com/bufbuild/buf/private/bufpkg/bufwasm/testdata/echo.wasm deleted file mode 100644 index 8f8e21cac228f05b76380a2746b07fb40f273172..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmZ{aK@Ng26b0Y^ML==U#KZ+xFfQDWaGduw`NC8*~hc^B buf.alpha.breaking.v1.IDPaths - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_buf_alpha_breaking_v1_config_proto_init() } -func file_buf_alpha_breaking_v1_config_proto_init() { - if File_buf_alpha_breaking_v1_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_breaking_v1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_breaking_v1_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IDPaths); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_breaking_v1_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_breaking_v1_config_proto_goTypes, - DependencyIndexes: file_buf_alpha_breaking_v1_config_proto_depIdxs, - MessageInfos: file_buf_alpha_breaking_v1_config_proto_msgTypes, - }.Build() - File_buf_alpha_breaking_v1_config_proto = out.File - file_buf_alpha_breaking_v1_config_proto_rawDesc = nil - file_buf_alpha_breaking_v1_config_proto_goTypes = nil - file_buf_alpha_breaking_v1_config_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1/usage.gen.go deleted file mode 100644 index 0e24c9df4f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package breakingv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/image.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/image.pb.go deleted file mode 100644 index 109f04f6d2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/image.pb.go +++ /dev/null @@ -1,717 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/image/v1/image.proto - -package imagev1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Image is an extended FileDescriptorSet. -// -// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto -type Image struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - File []*ImageFile `protobuf:"bytes,1,rep,name=file" json:"file,omitempty"` -} - -func (x *Image) Reset() { - *x = Image{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Image) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Image) ProtoMessage() {} - -func (x *Image) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Image.ProtoReflect.Descriptor instead. -func (*Image) Descriptor() ([]byte, []int) { - return file_buf_alpha_image_v1_image_proto_rawDescGZIP(), []int{0} -} - -func (x *Image) GetFile() []*ImageFile { - if x != nil { - return x.File - } - return nil -} - -// ImageFile is an extended FileDescriptorProto. -// -// Since FileDescriptorProto does not have extensions, we copy the fields from -// FileDescriptorProto, and then add our own extensions via the buf_extension -// field. This is compatible with a FileDescriptorProto. -// -// See https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/descriptor.proto -type ImageFile struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - Package *string `protobuf:"bytes,2,opt,name=package" json:"package,omitempty"` - Dependency []string `protobuf:"bytes,3,rep,name=dependency" json:"dependency,omitempty"` - PublicDependency []int32 `protobuf:"varint,10,rep,name=public_dependency,json=publicDependency" json:"public_dependency,omitempty"` - WeakDependency []int32 `protobuf:"varint,11,rep,name=weak_dependency,json=weakDependency" json:"weak_dependency,omitempty"` - MessageType []*descriptorpb.DescriptorProto `protobuf:"bytes,4,rep,name=message_type,json=messageType" json:"message_type,omitempty"` - EnumType []*descriptorpb.EnumDescriptorProto `protobuf:"bytes,5,rep,name=enum_type,json=enumType" json:"enum_type,omitempty"` - Service []*descriptorpb.ServiceDescriptorProto `protobuf:"bytes,6,rep,name=service" json:"service,omitempty"` - Extension []*descriptorpb.FieldDescriptorProto `protobuf:"bytes,7,rep,name=extension" json:"extension,omitempty"` - Options *descriptorpb.FileOptions `protobuf:"bytes,8,opt,name=options" json:"options,omitempty"` - SourceCodeInfo *descriptorpb.SourceCodeInfo `protobuf:"bytes,9,opt,name=source_code_info,json=sourceCodeInfo" json:"source_code_info,omitempty"` - Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - Edition *string `protobuf:"bytes,13,opt,name=edition" json:"edition,omitempty"` - // buf_extension contains buf-specific extensions to FileDescriptorProtos. - // - // The prefixed name and high tag value is used to all but guarantee there - // will never be any conflict with Google's FileDescriptorProto definition. - // The definition of a FileDescriptorProto has not changed in years, so - // we're not too worried about a conflict here. - BufExtension *ImageFileExtension `protobuf:"bytes,8042,opt,name=buf_extension,json=bufExtension" json:"buf_extension,omitempty"` -} - -func (x *ImageFile) Reset() { - *x = ImageFile{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageFile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageFile) ProtoMessage() {} - -func (x *ImageFile) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImageFile.ProtoReflect.Descriptor instead. -func (*ImageFile) Descriptor() ([]byte, []int) { - return file_buf_alpha_image_v1_image_proto_rawDescGZIP(), []int{1} -} - -func (x *ImageFile) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *ImageFile) GetPackage() string { - if x != nil && x.Package != nil { - return *x.Package - } - return "" -} - -func (x *ImageFile) GetDependency() []string { - if x != nil { - return x.Dependency - } - return nil -} - -func (x *ImageFile) GetPublicDependency() []int32 { - if x != nil { - return x.PublicDependency - } - return nil -} - -func (x *ImageFile) GetWeakDependency() []int32 { - if x != nil { - return x.WeakDependency - } - return nil -} - -func (x *ImageFile) GetMessageType() []*descriptorpb.DescriptorProto { - if x != nil { - return x.MessageType - } - return nil -} - -func (x *ImageFile) GetEnumType() []*descriptorpb.EnumDescriptorProto { - if x != nil { - return x.EnumType - } - return nil -} - -func (x *ImageFile) GetService() []*descriptorpb.ServiceDescriptorProto { - if x != nil { - return x.Service - } - return nil -} - -func (x *ImageFile) GetExtension() []*descriptorpb.FieldDescriptorProto { - if x != nil { - return x.Extension - } - return nil -} - -func (x *ImageFile) GetOptions() *descriptorpb.FileOptions { - if x != nil { - return x.Options - } - return nil -} - -func (x *ImageFile) GetSourceCodeInfo() *descriptorpb.SourceCodeInfo { - if x != nil { - return x.SourceCodeInfo - } - return nil -} - -func (x *ImageFile) GetSyntax() string { - if x != nil && x.Syntax != nil { - return *x.Syntax - } - return "" -} - -func (x *ImageFile) GetEdition() string { - if x != nil && x.Edition != nil { - return *x.Edition - } - return "" -} - -func (x *ImageFile) GetBufExtension() *ImageFileExtension { - if x != nil { - return x.BufExtension - } - return nil -} - -// ImageFileExtension contains extensions to ImageFiles. -// -// The fields are not included directly on the ImageFile so that we can both -// detect if extensions exist, which signifies this was created by buf and not -// by protoc, and so that we can add fields in a freeform manner without -// worrying about conflicts with FileDescriptorProto. -type ImageFileExtension struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // is_import denotes whether this file is considered an "import". - // - // An import is a file which was not derived from the local source files. - // There are two cases where this could be true: - // - // 1. A Well-Known Type included from the compiler. - // 2. A file that was included from a Buf module dependency. - // - // We use "import" as this matches with the protoc concept of - // --include_imports, however import is a bit of an overloaded term. - // - // This will always be set. - IsImport *bool `protobuf:"varint,1,opt,name=is_import,json=isImport" json:"is_import,omitempty"` - // ModuleInfo contains information about the Buf module this file belongs to. - // - // This field is optional and will not be set if the module is not known. - ModuleInfo *ModuleInfo `protobuf:"bytes,2,opt,name=module_info,json=moduleInfo" json:"module_info,omitempty"` - // is_syntax_unspecified denotes whether the file did not have a syntax - // explicitly specified. - // - // Per the FileDescriptorProto spec, it would be fine in this case to just - // leave the syntax field unset to denote this and to set the syntax field - // to "proto2" if it is specified. However, protoc does not set the syntax - // field if it was "proto2", and plugins may (incorrectly) depend on this. - // We also want to maintain consistency with protoc as much as possible. - // So instead, we have this field which will denote whether syntax was not - // specified. - // - // This will always be set. - IsSyntaxUnspecified *bool `protobuf:"varint,3,opt,name=is_syntax_unspecified,json=isSyntaxUnspecified" json:"is_syntax_unspecified,omitempty"` - // unused_dependency are the indexes within the dependency field on - // FileDescriptorProto for those dependencies that are not used. - // - // This matches the shape of the public_dependency and weak_dependency - // fields. - UnusedDependency []int32 `protobuf:"varint,4,rep,name=unused_dependency,json=unusedDependency" json:"unused_dependency,omitempty"` -} - -func (x *ImageFileExtension) Reset() { - *x = ImageFileExtension{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImageFileExtension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImageFileExtension) ProtoMessage() {} - -func (x *ImageFileExtension) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImageFileExtension.ProtoReflect.Descriptor instead. -func (*ImageFileExtension) Descriptor() ([]byte, []int) { - return file_buf_alpha_image_v1_image_proto_rawDescGZIP(), []int{2} -} - -func (x *ImageFileExtension) GetIsImport() bool { - if x != nil && x.IsImport != nil { - return *x.IsImport - } - return false -} - -func (x *ImageFileExtension) GetModuleInfo() *ModuleInfo { - if x != nil { - return x.ModuleInfo - } - return nil -} - -func (x *ImageFileExtension) GetIsSyntaxUnspecified() bool { - if x != nil && x.IsSyntaxUnspecified != nil { - return *x.IsSyntaxUnspecified - } - return false -} - -func (x *ImageFileExtension) GetUnusedDependency() []int32 { - if x != nil { - return x.UnusedDependency - } - return nil -} - -// ModuleInfo contains information about a Buf module that an ImageFile -// belongs to. -type ModuleInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // name is the name of the Buf module. - // - // This will always be set. - Name *ModuleName `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` - // commit is the repository commit. - // - // This field is optional and will not be set if the commit is not known. - Commit *string `protobuf:"bytes,2,opt,name=commit" json:"commit,omitempty"` -} - -func (x *ModuleInfo) Reset() { - *x = ModuleInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleInfo) ProtoMessage() {} - -func (x *ModuleInfo) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModuleInfo.ProtoReflect.Descriptor instead. -func (*ModuleInfo) Descriptor() ([]byte, []int) { - return file_buf_alpha_image_v1_image_proto_rawDescGZIP(), []int{3} -} - -func (x *ModuleInfo) GetName() *ModuleName { - if x != nil { - return x.Name - } - return nil -} - -func (x *ModuleInfo) GetCommit() string { - if x != nil && x.Commit != nil { - return *x.Commit - } - return "" -} - -// ModuleName is a module name. -// -// All fields will always be set. -type ModuleName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Remote *string `protobuf:"bytes,1,opt,name=remote" json:"remote,omitempty"` - Owner *string `protobuf:"bytes,2,opt,name=owner" json:"owner,omitempty"` - Repository *string `protobuf:"bytes,3,opt,name=repository" json:"repository,omitempty"` -} - -func (x *ModuleName) Reset() { - *x = ModuleName{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleName) ProtoMessage() {} - -func (x *ModuleName) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_image_v1_image_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModuleName.ProtoReflect.Descriptor instead. -func (*ModuleName) Descriptor() ([]byte, []int) { - return file_buf_alpha_image_v1_image_proto_rawDescGZIP(), []int{4} -} - -func (x *ModuleName) GetRemote() string { - if x != nil && x.Remote != nil { - return *x.Remote - } - return "" -} - -func (x *ModuleName) GetOwner() string { - if x != nil && x.Owner != nil { - return *x.Owner - } - return "" -} - -func (x *ModuleName) GetRepository() string { - if x != nil && x.Repository != nil { - return *x.Repository - } - return "" -} - -var File_buf_alpha_image_v1_image_proto protoreflect.FileDescriptor - -var file_buf_alpha_image_v1_image_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x12, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, - 0x31, 0x0a, 0x04, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x04, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0xc2, 0x05, 0x0a, 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x1e, - 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x2b, - 0x0a, 0x11, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x79, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x05, 0x52, 0x10, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x77, - 0x65, 0x61, 0x6b, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x0b, - 0x20, 0x03, 0x28, 0x05, 0x52, 0x0e, 0x77, 0x65, 0x61, 0x6b, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x79, 0x12, 0x43, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x0b, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x09, 0x65, 0x6e, 0x75, - 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x07, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x43, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x49, 0x0a, 0x10, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, - 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, - 0x18, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x0d, 0x62, 0x75, 0x66, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0xea, 0x3e, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6c, 0x65, - 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x62, 0x75, 0x66, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd3, 0x01, 0x0a, 0x12, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x08, 0x69, 0x73, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x3f, 0x0a, 0x0b, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x15, - 0x69, 0x73, 0x5f, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x5f, 0x75, 0x6e, 0x73, 0x70, 0x65, 0x63, - 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, 0x73, 0x53, - 0x79, 0x6e, 0x74, 0x61, 0x78, 0x55, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, - 0x12, 0x2b, 0x0a, 0x11, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x79, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x10, 0x75, 0x6e, 0x75, - 0x73, 0x65, 0x64, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x79, 0x22, 0x58, 0x0a, - 0x0a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0x5a, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x42, 0xdd, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0a, - 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x48, 0x01, 0x50, 0x01, 0x5a, 0x47, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x3b, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x76, 0x31, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x49, - 0xaa, 0x02, 0x12, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x5c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x15, 0x42, 0x75, - 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x3a, - 0x3a, 0x56, 0x31, -} - -var ( - file_buf_alpha_image_v1_image_proto_rawDescOnce sync.Once - file_buf_alpha_image_v1_image_proto_rawDescData = file_buf_alpha_image_v1_image_proto_rawDesc -) - -func file_buf_alpha_image_v1_image_proto_rawDescGZIP() []byte { - file_buf_alpha_image_v1_image_proto_rawDescOnce.Do(func() { - file_buf_alpha_image_v1_image_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_image_v1_image_proto_rawDescData) - }) - return file_buf_alpha_image_v1_image_proto_rawDescData -} - -var file_buf_alpha_image_v1_image_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_buf_alpha_image_v1_image_proto_goTypes = []interface{}{ - (*Image)(nil), // 0: buf.alpha.image.v1.Image - (*ImageFile)(nil), // 1: buf.alpha.image.v1.ImageFile - (*ImageFileExtension)(nil), // 2: buf.alpha.image.v1.ImageFileExtension - (*ModuleInfo)(nil), // 3: buf.alpha.image.v1.ModuleInfo - (*ModuleName)(nil), // 4: buf.alpha.image.v1.ModuleName - (*descriptorpb.DescriptorProto)(nil), // 5: google.protobuf.DescriptorProto - (*descriptorpb.EnumDescriptorProto)(nil), // 6: google.protobuf.EnumDescriptorProto - (*descriptorpb.ServiceDescriptorProto)(nil), // 7: google.protobuf.ServiceDescriptorProto - (*descriptorpb.FieldDescriptorProto)(nil), // 8: google.protobuf.FieldDescriptorProto - (*descriptorpb.FileOptions)(nil), // 9: google.protobuf.FileOptions - (*descriptorpb.SourceCodeInfo)(nil), // 10: google.protobuf.SourceCodeInfo -} -var file_buf_alpha_image_v1_image_proto_depIdxs = []int32{ - 1, // 0: buf.alpha.image.v1.Image.file:type_name -> buf.alpha.image.v1.ImageFile - 5, // 1: buf.alpha.image.v1.ImageFile.message_type:type_name -> google.protobuf.DescriptorProto - 6, // 2: buf.alpha.image.v1.ImageFile.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 7, // 3: buf.alpha.image.v1.ImageFile.service:type_name -> google.protobuf.ServiceDescriptorProto - 8, // 4: buf.alpha.image.v1.ImageFile.extension:type_name -> google.protobuf.FieldDescriptorProto - 9, // 5: buf.alpha.image.v1.ImageFile.options:type_name -> google.protobuf.FileOptions - 10, // 6: buf.alpha.image.v1.ImageFile.source_code_info:type_name -> google.protobuf.SourceCodeInfo - 2, // 7: buf.alpha.image.v1.ImageFile.buf_extension:type_name -> buf.alpha.image.v1.ImageFileExtension - 3, // 8: buf.alpha.image.v1.ImageFileExtension.module_info:type_name -> buf.alpha.image.v1.ModuleInfo - 4, // 9: buf.alpha.image.v1.ModuleInfo.name:type_name -> buf.alpha.image.v1.ModuleName - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name -} - -func init() { file_buf_alpha_image_v1_image_proto_init() } -func file_buf_alpha_image_v1_image_proto_init() { - if File_buf_alpha_image_v1_image_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_image_v1_image_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Image); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_image_v1_image_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageFile); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_image_v1_image_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImageFileExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_image_v1_image_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_image_v1_image_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_image_v1_image_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_image_v1_image_proto_goTypes, - DependencyIndexes: file_buf_alpha_image_v1_image_proto_depIdxs, - MessageInfos: file_buf_alpha_image_v1_image_proto_msgTypes, - }.Build() - File_buf_alpha_image_v1_image_proto = out.File - file_buf_alpha_image_v1_image_proto_rawDesc = nil - file_buf_alpha_image_v1_image_proto_goTypes = nil - file_buf_alpha_image_v1_image_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/usage.gen.go deleted file mode 100644 index cac2cd6efb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package imagev1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/config.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/config.pb.go deleted file mode 100644 index 0bbcebd15e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/config.pb.go +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/lint/v1/config.proto - -package lintv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Config represents the lint configuration for a module. The rule and category IDs are defined -// by the version and apply across the config. The version is independent of the version of -// the package. The package version refers to the config shape, the version encoded in the Config message -// indicates which rule and category IDs should be used. -// -// The rule and category IDs are not encoded as enums in this package because we may want to support custom rule -// and category IDs in the future. Callers will need to resolve the rule and category ID strings. -type Config struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version represents the version of the lint rule and category IDs that should be used with this config. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // use_ids lists the rule and/or category IDs that are included in the lint check. - UseIds []string `protobuf:"bytes,2,rep,name=use_ids,json=useIds,proto3" json:"use_ids,omitempty"` - // except_ids lists the rule and/or category IDs that are excluded from the lint check. - ExceptIds []string `protobuf:"bytes,3,rep,name=except_ids,json=exceptIds,proto3" json:"except_ids,omitempty"` - // ignore_paths lists the paths of directories and/or files that should be ignored by the lint check. - // All paths are relative to the root of the module. - IgnorePaths []string `protobuf:"bytes,4,rep,name=ignore_paths,json=ignorePaths,proto3" json:"ignore_paths,omitempty"` - // ignore_id_paths is a map of rule and/or category IDs to directory and/or file paths to exclude from the - // lint check. This corresponds with the ignore_only configuration key. - IgnoreIdPaths []*IDPaths `protobuf:"bytes,5,rep,name=ignore_id_paths,json=ignoreIdPaths,proto3" json:"ignore_id_paths,omitempty"` - // enum_zero_value_suffix controls the behavior of the ENUM_ZERO_VALUE lint rule ID. By default, this rule - // verifies that the zero value of all enums ends in _UNSPECIFIED. This config allows the user to override - // this value with the given string. - EnumZeroValueSuffix string `protobuf:"bytes,6,opt,name=enum_zero_value_suffix,json=enumZeroValueSuffix,proto3" json:"enum_zero_value_suffix,omitempty"` - // rpc_allow_same_request_response allows the same message type for both the request and response of an RPC. - RpcAllowSameRequestResponse bool `protobuf:"varint,7,opt,name=rpc_allow_same_request_response,json=rpcAllowSameRequestResponse,proto3" json:"rpc_allow_same_request_response,omitempty"` - // rpc_allow_google_protobuf_empty_requests allows the RPC requests to use the google.protobuf.Empty message. - RpcAllowGoogleProtobufEmptyRequests bool `protobuf:"varint,8,opt,name=rpc_allow_google_protobuf_empty_requests,json=rpcAllowGoogleProtobufEmptyRequests,proto3" json:"rpc_allow_google_protobuf_empty_requests,omitempty"` - // rpc_allow_google_protobuf_empty_responses allows the RPC responses to use the google.protobuf.Empty message. - RpcAllowGoogleProtobufEmptyResponses bool `protobuf:"varint,9,opt,name=rpc_allow_google_protobuf_empty_responses,json=rpcAllowGoogleProtobufEmptyResponses,proto3" json:"rpc_allow_google_protobuf_empty_responses,omitempty"` - // service_suffix applies to the SERVICE_SUFFIX rule ID. By default, the rule verifies that all service names - // end with the suffix Service. This allows users to override the value with the given string. - ServiceSuffix string `protobuf:"bytes,10,opt,name=service_suffix,json=serviceSuffix,proto3" json:"service_suffix,omitempty"` - // allow_comment_ignores turns on comment-driven ignores. - AllowCommentIgnores bool `protobuf:"varint,11,opt,name=allow_comment_ignores,json=allowCommentIgnores,proto3" json:"allow_comment_ignores,omitempty"` -} - -func (x *Config) Reset() { - *x = Config{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_lint_v1_config_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Config) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Config) ProtoMessage() {} - -func (x *Config) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_lint_v1_config_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Config.ProtoReflect.Descriptor instead. -func (*Config) Descriptor() ([]byte, []int) { - return file_buf_alpha_lint_v1_config_proto_rawDescGZIP(), []int{0} -} - -func (x *Config) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *Config) GetUseIds() []string { - if x != nil { - return x.UseIds - } - return nil -} - -func (x *Config) GetExceptIds() []string { - if x != nil { - return x.ExceptIds - } - return nil -} - -func (x *Config) GetIgnorePaths() []string { - if x != nil { - return x.IgnorePaths - } - return nil -} - -func (x *Config) GetIgnoreIdPaths() []*IDPaths { - if x != nil { - return x.IgnoreIdPaths - } - return nil -} - -func (x *Config) GetEnumZeroValueSuffix() string { - if x != nil { - return x.EnumZeroValueSuffix - } - return "" -} - -func (x *Config) GetRpcAllowSameRequestResponse() bool { - if x != nil { - return x.RpcAllowSameRequestResponse - } - return false -} - -func (x *Config) GetRpcAllowGoogleProtobufEmptyRequests() bool { - if x != nil { - return x.RpcAllowGoogleProtobufEmptyRequests - } - return false -} - -func (x *Config) GetRpcAllowGoogleProtobufEmptyResponses() bool { - if x != nil { - return x.RpcAllowGoogleProtobufEmptyResponses - } - return false -} - -func (x *Config) GetServiceSuffix() string { - if x != nil { - return x.ServiceSuffix - } - return "" -} - -func (x *Config) GetAllowCommentIgnores() bool { - if x != nil { - return x.AllowCommentIgnores - } - return false -} - -// IDPaths represents a rule or category ID and the file and/or directory paths that are ignored for the rule. -type IDPaths struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Paths []string `protobuf:"bytes,2,rep,name=paths,proto3" json:"paths,omitempty"` -} - -func (x *IDPaths) Reset() { - *x = IDPaths{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_lint_v1_config_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *IDPaths) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IDPaths) ProtoMessage() {} - -func (x *IDPaths) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_lint_v1_config_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use IDPaths.ProtoReflect.Descriptor instead. -func (*IDPaths) Descriptor() ([]byte, []int) { - return file_buf_alpha_lint_v1_config_proto_rawDescGZIP(), []int{1} -} - -func (x *IDPaths) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *IDPaths) GetPaths() []string { - if x != nil { - return x.Paths - } - return nil -} - -var File_buf_alpha_lint_v1_config_proto protoreflect.FileDescriptor - -var file_buf_alpha_lint_v1_config_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x6c, 0x69, 0x6e, 0x74, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x11, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6c, 0x69, 0x6e, 0x74, - 0x2e, 0x76, 0x31, 0x22, 0xc7, 0x04, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, - 0x69, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x49, 0x64, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x5f, 0x69, 0x64, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x49, 0x64, 0x73, - 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x50, 0x61, - 0x74, 0x68, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x69, 0x64, - 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x44, 0x50, 0x61, 0x74, 0x68, 0x73, 0x52, 0x0d, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, - 0x49, 0x64, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x33, 0x0a, 0x16, 0x65, 0x6e, 0x75, 0x6d, 0x5f, - 0x7a, 0x65, 0x72, 0x6f, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, - 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x75, 0x6d, 0x5a, 0x65, 0x72, - 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x44, 0x0a, 0x1f, - 0x72, 0x70, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x61, 0x6d, 0x65, 0x5f, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1b, 0x72, 0x70, 0x63, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x53, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x55, 0x0a, 0x28, 0x72, 0x70, 0x63, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, - 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x23, 0x72, 0x70, 0x63, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x47, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x29, 0x72, 0x70, 0x63, - 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x24, 0x72, 0x70, - 0x63, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x73, 0x75, - 0x66, 0x66, 0x69, 0x78, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x32, 0x0a, 0x15, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x67, 0x6e, 0x6f, 0x72, - 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x73, 0x22, 0x2f, 0x0a, - 0x07, 0x49, 0x44, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x42, 0xd2, - 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x6c, 0x69, 0x6e, 0x74, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x4c, 0xaa, 0x02, 0x11, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x4c, 0x69, 0x6e, 0x74, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x11, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x4c, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1d, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x4c, 0x69, 0x6e, 0x74, 0x5c, 0x56, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x42, - 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x4c, 0x69, 0x6e, 0x74, 0x3a, - 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_lint_v1_config_proto_rawDescOnce sync.Once - file_buf_alpha_lint_v1_config_proto_rawDescData = file_buf_alpha_lint_v1_config_proto_rawDesc -) - -func file_buf_alpha_lint_v1_config_proto_rawDescGZIP() []byte { - file_buf_alpha_lint_v1_config_proto_rawDescOnce.Do(func() { - file_buf_alpha_lint_v1_config_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_lint_v1_config_proto_rawDescData) - }) - return file_buf_alpha_lint_v1_config_proto_rawDescData -} - -var file_buf_alpha_lint_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_lint_v1_config_proto_goTypes = []interface{}{ - (*Config)(nil), // 0: buf.alpha.lint.v1.Config - (*IDPaths)(nil), // 1: buf.alpha.lint.v1.IDPaths -} -var file_buf_alpha_lint_v1_config_proto_depIdxs = []int32{ - 1, // 0: buf.alpha.lint.v1.Config.ignore_id_paths:type_name -> buf.alpha.lint.v1.IDPaths - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_buf_alpha_lint_v1_config_proto_init() } -func file_buf_alpha_lint_v1_config_proto_init() { - if File_buf_alpha_lint_v1_config_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_lint_v1_config_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Config); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_lint_v1_config_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*IDPaths); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_lint_v1_config_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_lint_v1_config_proto_goTypes, - DependencyIndexes: file_buf_alpha_lint_v1_config_proto_depIdxs, - MessageInfos: file_buf_alpha_lint_v1_config_proto_msgTypes, - }.Build() - File_buf_alpha_lint_v1_config_proto = out.File - file_buf_alpha_lint_v1_config_proto_rawDesc = nil - file_buf_alpha_lint_v1_config_proto_goTypes = nil - file_buf_alpha_lint_v1_config_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/usage.gen.go deleted file mode 100644 index eeda18de86..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package lintv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/module.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/module.pb.go deleted file mode 100644 index c6aeb29299..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/module.pb.go +++ /dev/null @@ -1,788 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/module/v1alpha1/module.proto - -package modulev1alpha1 - -import ( - v1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/breaking/v1" - v11 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/lint/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DigestType int32 - -const ( - DigestType_DIGEST_TYPE_UNSPECIFIED DigestType = 0 - DigestType_DIGEST_TYPE_SHAKE256 DigestType = 1 -) - -// Enum value maps for DigestType. -var ( - DigestType_name = map[int32]string{ - 0: "DIGEST_TYPE_UNSPECIFIED", - 1: "DIGEST_TYPE_SHAKE256", - } - DigestType_value = map[string]int32{ - "DIGEST_TYPE_UNSPECIFIED": 0, - "DIGEST_TYPE_SHAKE256": 1, - } -) - -func (x DigestType) Enum() *DigestType { - p := new(DigestType) - *p = x - return p -} - -func (x DigestType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (DigestType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_module_v1alpha1_module_proto_enumTypes[0].Descriptor() -} - -func (DigestType) Type() protoreflect.EnumType { - return &file_buf_alpha_module_v1alpha1_module_proto_enumTypes[0] -} - -func (x DigestType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use DigestType.Descriptor instead. -func (DigestType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{0} -} - -// Digest represents a hash function's value. -type Digest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // digest_type describes the hash algorithm. e.g. "SHAKE256" - DigestType DigestType `protobuf:"varint,1,opt,name=digest_type,json=digestType,proto3,enum=buf.alpha.module.v1alpha1.DigestType" json:"digest_type,omitempty"` - // digest is the hash's output without encoding. - Digest []byte `protobuf:"bytes,2,opt,name=digest,proto3" json:"digest,omitempty"` -} - -func (x *Digest) Reset() { - *x = Digest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Digest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Digest) ProtoMessage() {} - -func (x *Digest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Digest.ProtoReflect.Descriptor instead. -func (*Digest) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{0} -} - -func (x *Digest) GetDigestType() DigestType { - if x != nil { - return x.DigestType - } - return DigestType_DIGEST_TYPE_UNSPECIFIED -} - -func (x *Digest) GetDigest() []byte { - if x != nil { - return x.Digest - } - return nil -} - -// Blob represents some module content with an associated hash. -type Blob struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Digest of the content. - Digest *Digest `protobuf:"bytes,1,opt,name=digest,proto3" json:"digest,omitempty"` - // Content of the blob. Optional when Blob is used as a content pointer. - Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` -} - -func (x *Blob) Reset() { - *x = Blob{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Blob) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Blob) ProtoMessage() {} - -func (x *Blob) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Blob.ProtoReflect.Descriptor instead. -func (*Blob) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{1} -} - -func (x *Blob) GetDigest() *Digest { - if x != nil { - return x.Digest - } - return nil -} - -func (x *Blob) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -// Module is a module. -type Module struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // files are the files that make up the set. - // - // Sorted by path. - // Path must be unique. - // Only the target files. No imports. - // - // Maximum total size of all content: 32MB. - Files []*ModuleFile `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` - // dependencies are the dependencies. - Dependencies []*ModulePin `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - // documentation is the string representation of the contents of the file at documentation_path. - // - // string is used to enforce UTF-8 encoding or 7-bit ASCII text. - Documentation string `protobuf:"bytes,3,opt,name=documentation,proto3" json:"documentation,omitempty"` - // breaking_config is the breaking change detection configuration set for the module. - BreakingConfig *v1.Config `protobuf:"bytes,4,opt,name=breaking_config,json=breakingConfig,proto3" json:"breaking_config,omitempty"` - // lint_config is the lint configuration set for the module. - LintConfig *v11.Config `protobuf:"bytes,5,opt,name=lint_config,json=lintConfig,proto3" json:"lint_config,omitempty"` - // license is the string representation of the contents of the `LICENSE` file. - // - // string is used to enforce UTF-8 encoding or 7-bit ASCII text. - License string `protobuf:"bytes,6,opt,name=license,proto3" json:"license,omitempty"` - // documentation_path is the path of the file which contains the module documentation. - // - // either `buf.md`, `README.md` or `README.markdown`. - // if empty, assumes buf.md. - DocumentationPath string `protobuf:"bytes,7,opt,name=documentation_path,json=documentationPath,proto3" json:"documentation_path,omitempty"` -} - -func (x *Module) Reset() { - *x = Module{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Module) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Module) ProtoMessage() {} - -func (x *Module) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Module.ProtoReflect.Descriptor instead. -func (*Module) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{2} -} - -func (x *Module) GetFiles() []*ModuleFile { - if x != nil { - return x.Files - } - return nil -} - -func (x *Module) GetDependencies() []*ModulePin { - if x != nil { - return x.Dependencies - } - return nil -} - -func (x *Module) GetDocumentation() string { - if x != nil { - return x.Documentation - } - return "" -} - -func (x *Module) GetBreakingConfig() *v1.Config { - if x != nil { - return x.BreakingConfig - } - return nil -} - -func (x *Module) GetLintConfig() *v11.Config { - if x != nil { - return x.LintConfig - } - return nil -} - -func (x *Module) GetLicense() string { - if x != nil { - return x.License - } - return "" -} - -func (x *Module) GetDocumentationPath() string { - if x != nil { - return x.DocumentationPath - } - return "" -} - -// ModuleFile is a file within a FileSet. -type ModuleFile struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // path is the relative path of the file. - // Path can only use '/' as the separator character, and includes no ".." components. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // content is the content of the file. - Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` -} - -func (x *ModuleFile) Reset() { - *x = ModuleFile{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleFile) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleFile) ProtoMessage() {} - -func (x *ModuleFile) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModuleFile.ProtoReflect.Descriptor instead. -func (*ModuleFile) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{3} -} - -func (x *ModuleFile) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *ModuleFile) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -// ModuleReference is a module reference. -type ModuleReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Remote string `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,3,opt,name=repository,proto3" json:"repository,omitempty"` - // either tag, or commit - Reference string `protobuf:"bytes,4,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *ModuleReference) Reset() { - *x = ModuleReference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleReference) ProtoMessage() {} - -func (x *ModuleReference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModuleReference.ProtoReflect.Descriptor instead. -func (*ModuleReference) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{4} -} - -func (x *ModuleReference) GetRemote() string { - if x != nil { - return x.Remote - } - return "" -} - -func (x *ModuleReference) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ModuleReference) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *ModuleReference) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// ModulePin is a module pin. -type ModulePin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Remote string `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,3,opt,name=repository,proto3" json:"repository,omitempty"` - Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"` - Commit string `protobuf:"bytes,5,opt,name=commit,proto3" json:"commit,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // Module's manifest digest. Replacement for previous b1/b3 digests. - ManifestDigest string `protobuf:"bytes,8,opt,name=manifest_digest,json=manifestDigest,proto3" json:"manifest_digest,omitempty"` -} - -func (x *ModulePin) Reset() { - *x = ModulePin{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModulePin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModulePin) ProtoMessage() {} - -func (x *ModulePin) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_module_v1alpha1_module_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModulePin.ProtoReflect.Descriptor instead. -func (*ModulePin) Descriptor() ([]byte, []int) { - return file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP(), []int{5} -} - -func (x *ModulePin) GetRemote() string { - if x != nil { - return x.Remote - } - return "" -} - -func (x *ModulePin) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ModulePin) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *ModulePin) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *ModulePin) GetCommit() string { - if x != nil { - return x.Commit - } - return "" -} - -func (x *ModulePin) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *ModulePin) GetManifestDigest() string { - if x != nil { - return x.ManifestDigest - } - return "" -} - -var File_buf_alpha_module_v1alpha1_module_proto protoreflect.FileDescriptor - -var file_buf_alpha_module_v1alpha1_module_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x1a, 0x22, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x62, - 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2f, 0x6c, 0x69, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x68, 0x0a, 0x06, 0x44, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x12, 0x46, 0x0a, 0x0b, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0a, - 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, - 0x73, 0x74, 0x22, 0x5b, 0x0a, 0x04, 0x42, 0x6c, 0x6f, 0x62, 0x12, 0x39, 0x0a, 0x06, 0x64, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x52, 0x06, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, - 0x82, 0x03, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x66, 0x69, - 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, - 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x69, 0x6e, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, - 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x46, 0x0a, 0x0f, 0x62, 0x72, 0x65, 0x61, 0x6b, - 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x62, 0x72, 0x65, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0e, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, - 0x3a, 0x0a, 0x0b, 0x6c, 0x69, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x6c, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, - 0x0a, 0x6c, 0x69, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6c, - 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x69, - 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x61, 0x74, 0x68, 0x22, 0x3a, 0x0a, 0x0a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x46, 0x69, - 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x22, 0x7d, 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, - 0xfd, 0x01, 0x0a, 0x09, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x2a, - 0x43, 0x0a, 0x0a, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, - 0x17, 0x44, 0x49, 0x47, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x44, 0x49, - 0x47, 0x45, 0x53, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x4b, 0x45, 0x32, - 0x35, 0x36, 0x10, 0x01, 0x42, 0x8a, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, - 0x41, 0x4d, 0xaa, 0x02, 0x19, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, - 0x19, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x25, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1c, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, - 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_module_v1alpha1_module_proto_rawDescOnce sync.Once - file_buf_alpha_module_v1alpha1_module_proto_rawDescData = file_buf_alpha_module_v1alpha1_module_proto_rawDesc -) - -func file_buf_alpha_module_v1alpha1_module_proto_rawDescGZIP() []byte { - file_buf_alpha_module_v1alpha1_module_proto_rawDescOnce.Do(func() { - file_buf_alpha_module_v1alpha1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_module_v1alpha1_module_proto_rawDescData) - }) - return file_buf_alpha_module_v1alpha1_module_proto_rawDescData -} - -var file_buf_alpha_module_v1alpha1_module_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_module_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_buf_alpha_module_v1alpha1_module_proto_goTypes = []interface{}{ - (DigestType)(0), // 0: buf.alpha.module.v1alpha1.DigestType - (*Digest)(nil), // 1: buf.alpha.module.v1alpha1.Digest - (*Blob)(nil), // 2: buf.alpha.module.v1alpha1.Blob - (*Module)(nil), // 3: buf.alpha.module.v1alpha1.Module - (*ModuleFile)(nil), // 4: buf.alpha.module.v1alpha1.ModuleFile - (*ModuleReference)(nil), // 5: buf.alpha.module.v1alpha1.ModuleReference - (*ModulePin)(nil), // 6: buf.alpha.module.v1alpha1.ModulePin - (*v1.Config)(nil), // 7: buf.alpha.breaking.v1.Config - (*v11.Config)(nil), // 8: buf.alpha.lint.v1.Config - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp -} -var file_buf_alpha_module_v1alpha1_module_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.module.v1alpha1.Digest.digest_type:type_name -> buf.alpha.module.v1alpha1.DigestType - 1, // 1: buf.alpha.module.v1alpha1.Blob.digest:type_name -> buf.alpha.module.v1alpha1.Digest - 4, // 2: buf.alpha.module.v1alpha1.Module.files:type_name -> buf.alpha.module.v1alpha1.ModuleFile - 6, // 3: buf.alpha.module.v1alpha1.Module.dependencies:type_name -> buf.alpha.module.v1alpha1.ModulePin - 7, // 4: buf.alpha.module.v1alpha1.Module.breaking_config:type_name -> buf.alpha.breaking.v1.Config - 8, // 5: buf.alpha.module.v1alpha1.Module.lint_config:type_name -> buf.alpha.lint.v1.Config - 9, // 6: buf.alpha.module.v1alpha1.ModulePin.create_time:type_name -> google.protobuf.Timestamp - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_buf_alpha_module_v1alpha1_module_proto_init() } -func file_buf_alpha_module_v1alpha1_module_proto_init() { - if File_buf_alpha_module_v1alpha1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Digest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Blob); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Module); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleFile); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_module_v1alpha1_module_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModulePin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_module_v1alpha1_module_proto_rawDesc, - NumEnums: 1, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_module_v1alpha1_module_proto_goTypes, - DependencyIndexes: file_buf_alpha_module_v1alpha1_module_proto_depIdxs, - EnumInfos: file_buf_alpha_module_v1alpha1_module_proto_enumTypes, - MessageInfos: file_buf_alpha_module_v1alpha1_module_proto_msgTypes, - }.Build() - File_buf_alpha_module_v1alpha1_module_proto = out.File - file_buf_alpha_module_v1alpha1_module_proto_rawDesc = nil - file_buf_alpha_module_v1alpha1_module_proto_goTypes = nil - file_buf_alpha_module_v1alpha1_module_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/usage.gen.go deleted file mode 100644 index 09a6931d02..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package modulev1alpha1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/admin.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/admin.pb.go deleted file mode 100644 index 51f0bfd6fd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/admin.pb.go +++ /dev/null @@ -1,1979 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/admin.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// BreakingChangeCategory is the allowed list of categories for breaking rule settings. -type BreakingChangeCategory int32 - -const ( - BreakingChangeCategory_BREAKING_CHANGE_CATEGORY_UNSPECIFIED BreakingChangeCategory = 0 - BreakingChangeCategory_BREAKING_CHANGE_CATEGORY_FILE BreakingChangeCategory = 1 - BreakingChangeCategory_BREAKING_CHANGE_CATEGORY_WIRE_JSON BreakingChangeCategory = 2 -) - -// Enum value maps for BreakingChangeCategory. -var ( - BreakingChangeCategory_name = map[int32]string{ - 0: "BREAKING_CHANGE_CATEGORY_UNSPECIFIED", - 1: "BREAKING_CHANGE_CATEGORY_FILE", - 2: "BREAKING_CHANGE_CATEGORY_WIRE_JSON", - } - BreakingChangeCategory_value = map[string]int32{ - "BREAKING_CHANGE_CATEGORY_UNSPECIFIED": 0, - "BREAKING_CHANGE_CATEGORY_FILE": 1, - "BREAKING_CHANGE_CATEGORY_WIRE_JSON": 2, - } -) - -func (x BreakingChangeCategory) Enum() *BreakingChangeCategory { - p := new(BreakingChangeCategory) - *p = x - return p -} - -func (x BreakingChangeCategory) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (BreakingChangeCategory) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[0].Descriptor() -} - -func (BreakingChangeCategory) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[0] -} - -func (x BreakingChangeCategory) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use BreakingChangeCategory.Descriptor instead. -func (BreakingChangeCategory) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{0} -} - -// CollisionType is the type of collisions that can occur. -type CollisionType int32 - -const ( - // Unspecified collision type. - CollisionType_COLLISION_TYPE_UNSPECIFIED CollisionType = 0 - // A fully qualified proto name - CollisionType_COLLISION_TYPE_FULLY_QUALIFIED_NAME CollisionType = 1 - // A proto file path - CollisionType_COLLISION_TYPE_PATH CollisionType = 2 -) - -// Enum value maps for CollisionType. -var ( - CollisionType_name = map[int32]string{ - 0: "COLLISION_TYPE_UNSPECIFIED", - 1: "COLLISION_TYPE_FULLY_QUALIFIED_NAME", - 2: "COLLISION_TYPE_PATH", - } - CollisionType_value = map[string]int32{ - "COLLISION_TYPE_UNSPECIFIED": 0, - "COLLISION_TYPE_FULLY_QUALIFIED_NAME": 1, - "COLLISION_TYPE_PATH": 2, - } -) - -func (x CollisionType) Enum() *CollisionType { - p := new(CollisionType) - *p = x - return p -} - -func (x CollisionType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CollisionType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[1].Descriptor() -} - -func (CollisionType) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes[1] -} - -func (x CollisionType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CollisionType.Descriptor instead. -func (CollisionType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{1} -} - -type BreakingChangePolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Enabled *bool `protobuf:"varint,1,opt,name=enabled,proto3,oneof" json:"enabled,omitempty"` - IgnoreUnstablePackages *bool `protobuf:"varint,2,opt,name=ignore_unstable_packages,json=ignoreUnstablePackages,proto3,oneof" json:"ignore_unstable_packages,omitempty"` - Category BreakingChangeCategory `protobuf:"varint,3,opt,name=category,proto3,enum=buf.alpha.registry.v1alpha1.BreakingChangeCategory" json:"category,omitempty"` -} - -func (x *BreakingChangePolicy) Reset() { - *x = BreakingChangePolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BreakingChangePolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BreakingChangePolicy) ProtoMessage() {} - -func (x *BreakingChangePolicy) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BreakingChangePolicy.ProtoReflect.Descriptor instead. -func (*BreakingChangePolicy) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{0} -} - -func (x *BreakingChangePolicy) GetEnabled() bool { - if x != nil && x.Enabled != nil { - return *x.Enabled - } - return false -} - -func (x *BreakingChangePolicy) GetIgnoreUnstablePackages() bool { - if x != nil && x.IgnoreUnstablePackages != nil { - return *x.IgnoreUnstablePackages - } - return false -} - -func (x *BreakingChangePolicy) GetCategory() BreakingChangeCategory { - if x != nil { - return x.Category - } - return BreakingChangeCategory_BREAKING_CHANGE_CATEGORY_UNSPECIFIED -} - -// UniquenessPolicy is the policy for uniqueness on the server. -type UniquenessPolicy struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Whether uniqueness policy is enforced. - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` -} - -func (x *UniquenessPolicy) Reset() { - *x = UniquenessPolicy{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UniquenessPolicy) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UniquenessPolicy) ProtoMessage() {} - -func (x *UniquenessPolicy) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UniquenessPolicy.ProtoReflect.Descriptor instead. -func (*UniquenessPolicy) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{1} -} - -func (x *UniquenessPolicy) GetEnabled() bool { - if x != nil { - return x.Enabled - } - return false -} - -// Collision is a collision that has occurred. -type Collision struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The reference that has collisions. - Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` - // The type of collision. - Type CollisionType `protobuf:"varint,2,opt,name=type,proto3,enum=buf.alpha.registry.v1alpha1.CollisionType" json:"type,omitempty"` - // The sources of the collision that the user is authorized to see. - Sources []*CollisionSource `protobuf:"bytes,3,rep,name=sources,proto3" json:"sources,omitempty"` - // Whether there are other collision sources that the user is not authorized to see. - // The user should contact a server admin for more information about these collisions. - HasOtherCollisionSources bool `protobuf:"varint,4,opt,name=has_other_collision_sources,json=hasOtherCollisionSources,proto3" json:"has_other_collision_sources,omitempty"` -} - -func (x *Collision) Reset() { - *x = Collision{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Collision) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Collision) ProtoMessage() {} - -func (x *Collision) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Collision.ProtoReflect.Descriptor instead. -func (*Collision) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{2} -} - -func (x *Collision) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *Collision) GetType() CollisionType { - if x != nil { - return x.Type - } - return CollisionType_COLLISION_TYPE_UNSPECIFIED -} - -func (x *Collision) GetSources() []*CollisionSource { - if x != nil { - return x.Sources - } - return nil -} - -func (x *Collision) GetHasOtherCollisionSources() bool { - if x != nil { - return x.HasOtherCollisionSources - } - return false -} - -// CollisionSource is the source of a collision -type CollisionSource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the owner of the source. - OwnerName string `protobuf:"bytes,1,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // The name of the repository of the source. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The path of the file that is the source of the collision. - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *CollisionSource) Reset() { - *x = CollisionSource{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CollisionSource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CollisionSource) ProtoMessage() {} - -func (x *CollisionSource) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CollisionSource.ProtoReflect.Descriptor instead. -func (*CollisionSource) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{3} -} - -func (x *CollisionSource) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *CollisionSource) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *CollisionSource) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type ForceDeleteUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *ForceDeleteUserRequest) Reset() { - *x = ForceDeleteUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ForceDeleteUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ForceDeleteUserRequest) ProtoMessage() {} - -func (x *ForceDeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ForceDeleteUserRequest.ProtoReflect.Descriptor instead. -func (*ForceDeleteUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{4} -} - -func (x *ForceDeleteUserRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type ForceDeleteUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The deleted user. - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // The deleted organizations. - Organizations []*Organization `protobuf:"bytes,2,rep,name=organizations,proto3" json:"organizations,omitempty"` - // The deleted repositories. - Repositories []*Repository `protobuf:"bytes,3,rep,name=repositories,proto3" json:"repositories,omitempty"` - // The deleted plugins. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/admin.proto. - Plugins []*Plugin `protobuf:"bytes,4,rep,name=plugins,proto3" json:"plugins,omitempty"` - // The deleted templates. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/admin.proto. - Templates []*Template `protobuf:"bytes,5,rep,name=templates,proto3" json:"templates,omitempty"` -} - -func (x *ForceDeleteUserResponse) Reset() { - *x = ForceDeleteUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ForceDeleteUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ForceDeleteUserResponse) ProtoMessage() {} - -func (x *ForceDeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ForceDeleteUserResponse.ProtoReflect.Descriptor instead. -func (*ForceDeleteUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{5} -} - -func (x *ForceDeleteUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -func (x *ForceDeleteUserResponse) GetOrganizations() []*Organization { - if x != nil { - return x.Organizations - } - return nil -} - -func (x *ForceDeleteUserResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/admin.proto. -func (x *ForceDeleteUserResponse) GetPlugins() []*Plugin { - if x != nil { - return x.Plugins - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/admin.proto. -func (x *ForceDeleteUserResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -type UpdateUserVerificationStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - VerificationStatus VerificationStatus `protobuf:"varint,2,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus" json:"verification_status,omitempty"` -} - -func (x *UpdateUserVerificationStatusRequest) Reset() { - *x = UpdateUserVerificationStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserVerificationStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserVerificationStatusRequest) ProtoMessage() {} - -func (x *UpdateUserVerificationStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserVerificationStatusRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserVerificationStatusRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{6} -} - -func (x *UpdateUserVerificationStatusRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *UpdateUserVerificationStatusRequest) GetVerificationStatus() VerificationStatus { - if x != nil { - return x.VerificationStatus - } - return VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED -} - -type UpdateUserVerificationStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateUserVerificationStatusResponse) Reset() { - *x = UpdateUserVerificationStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserVerificationStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserVerificationStatusResponse) ProtoMessage() {} - -func (x *UpdateUserVerificationStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserVerificationStatusResponse.ProtoReflect.Descriptor instead. -func (*UpdateUserVerificationStatusResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{7} -} - -type UpdateOrganizationVerificationStatusRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - VerificationStatus VerificationStatus `protobuf:"varint,2,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus" json:"verification_status,omitempty"` -} - -func (x *UpdateOrganizationVerificationStatusRequest) Reset() { - *x = UpdateOrganizationVerificationStatusRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationVerificationStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationVerificationStatusRequest) ProtoMessage() {} - -func (x *UpdateOrganizationVerificationStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationVerificationStatusRequest.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationVerificationStatusRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateOrganizationVerificationStatusRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *UpdateOrganizationVerificationStatusRequest) GetVerificationStatus() VerificationStatus { - if x != nil { - return x.VerificationStatus - } - return VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED -} - -type UpdateOrganizationVerificationStatusResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateOrganizationVerificationStatusResponse) Reset() { - *x = UpdateOrganizationVerificationStatusResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationVerificationStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationVerificationStatusResponse) ProtoMessage() {} - -func (x *UpdateOrganizationVerificationStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationVerificationStatusResponse.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationVerificationStatusResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{9} -} - -type CreateMachineUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` -} - -func (x *CreateMachineUserRequest) Reset() { - *x = CreateMachineUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateMachineUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateMachineUserRequest) ProtoMessage() {} - -func (x *CreateMachineUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateMachineUserRequest.ProtoReflect.Descriptor instead. -func (*CreateMachineUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{10} -} - -func (x *CreateMachineUserRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -type CreateMachineUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *CreateMachineUserResponse) Reset() { - *x = CreateMachineUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateMachineUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateMachineUserResponse) ProtoMessage() {} - -func (x *CreateMachineUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateMachineUserResponse.ProtoReflect.Descriptor instead. -func (*CreateMachineUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{11} -} - -func (x *CreateMachineUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type GetBreakingChangePolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetBreakingChangePolicyRequest) Reset() { - *x = GetBreakingChangePolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBreakingChangePolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBreakingChangePolicyRequest) ProtoMessage() {} - -func (x *GetBreakingChangePolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBreakingChangePolicyRequest.ProtoReflect.Descriptor instead. -func (*GetBreakingChangePolicyRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{12} -} - -type GetBreakingChangePolicyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Policy *BreakingChangePolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (x *GetBreakingChangePolicyResponse) Reset() { - *x = GetBreakingChangePolicyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetBreakingChangePolicyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBreakingChangePolicyResponse) ProtoMessage() {} - -func (x *GetBreakingChangePolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetBreakingChangePolicyResponse.ProtoReflect.Descriptor instead. -func (*GetBreakingChangePolicyResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{13} -} - -func (x *GetBreakingChangePolicyResponse) GetPolicy() *BreakingChangePolicy { - if x != nil { - return x.Policy - } - return nil -} - -type UpdateBreakingChangePolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Policy *BreakingChangePolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (x *UpdateBreakingChangePolicyRequest) Reset() { - *x = UpdateBreakingChangePolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateBreakingChangePolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateBreakingChangePolicyRequest) ProtoMessage() {} - -func (x *UpdateBreakingChangePolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateBreakingChangePolicyRequest.ProtoReflect.Descriptor instead. -func (*UpdateBreakingChangePolicyRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{14} -} - -func (x *UpdateBreakingChangePolicyRequest) GetPolicy() *BreakingChangePolicy { - if x != nil { - return x.Policy - } - return nil -} - -type UpdateBreakingChangePolicyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateBreakingChangePolicyResponse) Reset() { - *x = UpdateBreakingChangePolicyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateBreakingChangePolicyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateBreakingChangePolicyResponse) ProtoMessage() {} - -func (x *UpdateBreakingChangePolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateBreakingChangePolicyResponse.ProtoReflect.Descriptor instead. -func (*UpdateBreakingChangePolicyResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{15} -} - -type GetUniquenessPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetUniquenessPolicyRequest) Reset() { - *x = GetUniquenessPolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUniquenessPolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUniquenessPolicyRequest) ProtoMessage() {} - -func (x *GetUniquenessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUniquenessPolicyRequest.ProtoReflect.Descriptor instead. -func (*GetUniquenessPolicyRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{16} -} - -type GetUniquenessPolicyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Policy *UniquenessPolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (x *GetUniquenessPolicyResponse) Reset() { - *x = GetUniquenessPolicyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUniquenessPolicyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUniquenessPolicyResponse) ProtoMessage() {} - -func (x *GetUniquenessPolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUniquenessPolicyResponse.ProtoReflect.Descriptor instead. -func (*GetUniquenessPolicyResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{17} -} - -func (x *GetUniquenessPolicyResponse) GetPolicy() *UniquenessPolicy { - if x != nil { - return x.Policy - } - return nil -} - -type UpdateUniquenessPolicyRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Policy *UniquenessPolicy `protobuf:"bytes,1,opt,name=policy,proto3" json:"policy,omitempty"` -} - -func (x *UpdateUniquenessPolicyRequest) Reset() { - *x = UpdateUniquenessPolicyRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUniquenessPolicyRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUniquenessPolicyRequest) ProtoMessage() {} - -func (x *UpdateUniquenessPolicyRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUniquenessPolicyRequest.ProtoReflect.Descriptor instead. -func (*UpdateUniquenessPolicyRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{18} -} - -func (x *UpdateUniquenessPolicyRequest) GetPolicy() *UniquenessPolicy { - if x != nil { - return x.Policy - } - return nil -} - -type UpdateUniquenessPolicyResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateUniquenessPolicyResponse) Reset() { - *x = UpdateUniquenessPolicyResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUniquenessPolicyResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUniquenessPolicyResponse) ProtoMessage() {} - -func (x *UpdateUniquenessPolicyResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUniquenessPolicyResponse.ProtoReflect.Descriptor instead. -func (*UpdateUniquenessPolicyResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{19} -} - -type ListServerUniquenessCollisionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Token of the page to retrieve. If not specified, the first page of - // results will be returned. Use the value obtained from `next_page_token` - // in the previous response in order to request the next page of results. - PageToken string `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Number of elements to retrieve in a single page. - // When too large a page is requested, the server may decide to further - // limit the number of returned resources. - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The desired collision type to filter by. - // This must be specified. Only collisions of the specified type will be returned, - // continue to page through results until no more collisions of the specified - // type are returned. - CollisionType CollisionType `protobuf:"varint,3,opt,name=collision_type,json=collisionType,proto3,enum=buf.alpha.registry.v1alpha1.CollisionType" json:"collision_type,omitempty"` -} - -func (x *ListServerUniquenessCollisionsRequest) Reset() { - *x = ListServerUniquenessCollisionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListServerUniquenessCollisionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServerUniquenessCollisionsRequest) ProtoMessage() {} - -func (x *ListServerUniquenessCollisionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListServerUniquenessCollisionsRequest.ProtoReflect.Descriptor instead. -func (*ListServerUniquenessCollisionsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{20} -} - -func (x *ListServerUniquenessCollisionsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListServerUniquenessCollisionsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListServerUniquenessCollisionsRequest) GetCollisionType() CollisionType { - if x != nil { - return x.CollisionType - } - return CollisionType_COLLISION_TYPE_UNSPECIFIED -} - -type ListServerUniquenessCollisionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The collisions. - Collisions []*Collision `protobuf:"bytes,1,rep,name=collisions,proto3" json:"collisions,omitempty"` - // Pagination token used to retrieve the next page of results. - // Pass the content of this string as the `page_token` attribute of - // the next request. `next_page_token` is not returned for the last - // page. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListServerUniquenessCollisionsResponse) Reset() { - *x = ListServerUniquenessCollisionsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListServerUniquenessCollisionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServerUniquenessCollisionsResponse) ProtoMessage() {} - -func (x *ListServerUniquenessCollisionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListServerUniquenessCollisionsResponse.ProtoReflect.Descriptor instead. -func (*ListServerUniquenessCollisionsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP(), []int{21} -} - -func (x *ListServerUniquenessCollisionsResponse) GetCollisions() []*Collision { - if x != nil { - return x.Collisions - } - return nil -} - -func (x *ListServerUniquenessCollisionsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_admin_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x64, - 0x6d, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x2e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x2c, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xee, 0x01, - 0x0a, 0x14, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x18, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, - 0x75, 0x6e, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x16, 0x69, 0x67, 0x6e, 0x6f, 0x72, - 0x65, 0x55, 0x6e, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x73, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, - 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x42, 0x1b, 0x0a, 0x19, 0x5f, 0x69, 0x67, 0x6e, 0x6f, 0x72, 0x65, 0x5f, 0x75, 0x6e, 0x73, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x2c, - 0x0a, 0x10, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xf0, 0x01, 0x0a, - 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x07, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x3d, 0x0a, 0x1b, 0x68, 0x61, 0x73, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x63, 0x6f, - 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x68, 0x61, 0x73, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x43, - 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, - 0x6d, 0x0a, 0x0f, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x22, 0x31, - 0x0a, 0x16, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, - 0x64, 0x22, 0xfa, 0x02, 0x0a, 0x17, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x12, 0x4f, 0x0a, 0x0d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x02, 0x18, 0x01, 0x52, 0x07, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x47, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x42, - 0x02, 0x18, 0x01, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x22, 0xa0, - 0x01, 0x0a, 0x23, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x60, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x26, 0x0a, 0x24, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x2b, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x60, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x22, 0x2e, 0x0a, 0x2c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x63, 0x68, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x19, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x22, 0x20, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x6c, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x22, 0x6e, 0x0a, 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, - 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x22, 0x24, 0x0a, 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, - 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x64, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, - 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x66, 0x0a, 0x1d, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x06, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x06, 0x70, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x22, 0x20, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xb6, 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, - 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x63, 0x6f, - 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0d, - 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x98, 0x01, - 0x0a, 0x26, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x71, - 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0x8d, 0x01, 0x0a, 0x16, 0x42, 0x72, 0x65, - 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, - 0x6f, 0x72, 0x79, 0x12, 0x28, 0x0a, 0x24, 0x42, 0x52, 0x45, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x5f, - 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, - 0x1d, 0x42, 0x52, 0x45, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, - 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, - 0x12, 0x26, 0x0a, 0x22, 0x42, 0x52, 0x45, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x48, 0x41, - 0x4e, 0x47, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x59, 0x5f, 0x57, 0x49, 0x52, - 0x45, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x2a, 0x71, 0x0a, 0x0d, 0x43, 0x6f, 0x6c, 0x6c, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4c, - 0x4c, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x4f, 0x4c, - 0x4c, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x55, 0x4c, 0x4c, - 0x59, 0x5f, 0x51, 0x55, 0x41, 0x4c, 0x49, 0x46, 0x49, 0x45, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, - 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4c, 0x4c, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x41, 0x54, 0x48, 0x10, 0x02, 0x32, 0x91, 0x0b, 0x0a, 0x0c, - 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x81, 0x01, 0x0a, - 0x0f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, - 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, - 0x12, 0xa3, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x56, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xbb, 0x01, 0x0a, 0x24, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x48, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x49, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x99, - 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3b, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x65, 0x61, - 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, - 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9d, 0x01, 0x0a, 0x1a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, - 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x72, - 0x65, 0x61, 0x6b, 0x69, 0x6e, 0x67, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x47, - 0x65, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x91, 0x01, 0x0a, 0x16, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x50, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x6e, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xae, - 0x01, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x69, - 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x42, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, - 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x6e, - 0x69, 0x71, 0x75, 0x65, 0x6e, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6c, 0x6c, 0x69, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, - 0x97, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x0a, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, - 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, - 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, - 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, - 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, - 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_admin_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_admin_proto_rawDescData = file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_admin_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_admin_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_admin_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_admin_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_admin_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes = make([]protoimpl.MessageInfo, 22) -var file_buf_alpha_registry_v1alpha1_admin_proto_goTypes = []interface{}{ - (BreakingChangeCategory)(0), // 0: buf.alpha.registry.v1alpha1.BreakingChangeCategory - (CollisionType)(0), // 1: buf.alpha.registry.v1alpha1.CollisionType - (*BreakingChangePolicy)(nil), // 2: buf.alpha.registry.v1alpha1.BreakingChangePolicy - (*UniquenessPolicy)(nil), // 3: buf.alpha.registry.v1alpha1.UniquenessPolicy - (*Collision)(nil), // 4: buf.alpha.registry.v1alpha1.Collision - (*CollisionSource)(nil), // 5: buf.alpha.registry.v1alpha1.CollisionSource - (*ForceDeleteUserRequest)(nil), // 6: buf.alpha.registry.v1alpha1.ForceDeleteUserRequest - (*ForceDeleteUserResponse)(nil), // 7: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse - (*UpdateUserVerificationStatusRequest)(nil), // 8: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest - (*UpdateUserVerificationStatusResponse)(nil), // 9: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusResponse - (*UpdateOrganizationVerificationStatusRequest)(nil), // 10: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest - (*UpdateOrganizationVerificationStatusResponse)(nil), // 11: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusResponse - (*CreateMachineUserRequest)(nil), // 12: buf.alpha.registry.v1alpha1.CreateMachineUserRequest - (*CreateMachineUserResponse)(nil), // 13: buf.alpha.registry.v1alpha1.CreateMachineUserResponse - (*GetBreakingChangePolicyRequest)(nil), // 14: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyRequest - (*GetBreakingChangePolicyResponse)(nil), // 15: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse - (*UpdateBreakingChangePolicyRequest)(nil), // 16: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest - (*UpdateBreakingChangePolicyResponse)(nil), // 17: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyResponse - (*GetUniquenessPolicyRequest)(nil), // 18: buf.alpha.registry.v1alpha1.GetUniquenessPolicyRequest - (*GetUniquenessPolicyResponse)(nil), // 19: buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse - (*UpdateUniquenessPolicyRequest)(nil), // 20: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest - (*UpdateUniquenessPolicyResponse)(nil), // 21: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyResponse - (*ListServerUniquenessCollisionsRequest)(nil), // 22: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest - (*ListServerUniquenessCollisionsResponse)(nil), // 23: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse - (*User)(nil), // 24: buf.alpha.registry.v1alpha1.User - (*Organization)(nil), // 25: buf.alpha.registry.v1alpha1.Organization - (*Repository)(nil), // 26: buf.alpha.registry.v1alpha1.Repository - (*Plugin)(nil), // 27: buf.alpha.registry.v1alpha1.Plugin - (*Template)(nil), // 28: buf.alpha.registry.v1alpha1.Template - (VerificationStatus)(0), // 29: buf.alpha.registry.v1alpha1.VerificationStatus -} -var file_buf_alpha_registry_v1alpha1_admin_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.BreakingChangePolicy.category:type_name -> buf.alpha.registry.v1alpha1.BreakingChangeCategory - 1, // 1: buf.alpha.registry.v1alpha1.Collision.type:type_name -> buf.alpha.registry.v1alpha1.CollisionType - 5, // 2: buf.alpha.registry.v1alpha1.Collision.sources:type_name -> buf.alpha.registry.v1alpha1.CollisionSource - 24, // 3: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 25, // 4: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.Organization - 26, // 5: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 27, // 6: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.Plugin - 28, // 7: buf.alpha.registry.v1alpha1.ForceDeleteUserResponse.templates:type_name -> buf.alpha.registry.v1alpha1.Template - 29, // 8: buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus - 29, // 9: buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus - 24, // 10: buf.alpha.registry.v1alpha1.CreateMachineUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 2, // 11: buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse.policy:type_name -> buf.alpha.registry.v1alpha1.BreakingChangePolicy - 2, // 12: buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest.policy:type_name -> buf.alpha.registry.v1alpha1.BreakingChangePolicy - 3, // 13: buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse.policy:type_name -> buf.alpha.registry.v1alpha1.UniquenessPolicy - 3, // 14: buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest.policy:type_name -> buf.alpha.registry.v1alpha1.UniquenessPolicy - 1, // 15: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest.collision_type:type_name -> buf.alpha.registry.v1alpha1.CollisionType - 4, // 16: buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse.collisions:type_name -> buf.alpha.registry.v1alpha1.Collision - 6, // 17: buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser:input_type -> buf.alpha.registry.v1alpha1.ForceDeleteUserRequest - 8, // 18: buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus:input_type -> buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusRequest - 10, // 19: buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusRequest - 12, // 20: buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser:input_type -> buf.alpha.registry.v1alpha1.CreateMachineUserRequest - 14, // 21: buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy:input_type -> buf.alpha.registry.v1alpha1.GetBreakingChangePolicyRequest - 16, // 22: buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy:input_type -> buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyRequest - 18, // 23: buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy:input_type -> buf.alpha.registry.v1alpha1.GetUniquenessPolicyRequest - 20, // 24: buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy:input_type -> buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyRequest - 22, // 25: buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions:input_type -> buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsRequest - 7, // 26: buf.alpha.registry.v1alpha1.AdminService.ForceDeleteUser:output_type -> buf.alpha.registry.v1alpha1.ForceDeleteUserResponse - 9, // 27: buf.alpha.registry.v1alpha1.AdminService.UpdateUserVerificationStatus:output_type -> buf.alpha.registry.v1alpha1.UpdateUserVerificationStatusResponse - 11, // 28: buf.alpha.registry.v1alpha1.AdminService.UpdateOrganizationVerificationStatus:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationVerificationStatusResponse - 13, // 29: buf.alpha.registry.v1alpha1.AdminService.CreateMachineUser:output_type -> buf.alpha.registry.v1alpha1.CreateMachineUserResponse - 15, // 30: buf.alpha.registry.v1alpha1.AdminService.GetBreakingChangePolicy:output_type -> buf.alpha.registry.v1alpha1.GetBreakingChangePolicyResponse - 17, // 31: buf.alpha.registry.v1alpha1.AdminService.UpdateBreakingChangePolicy:output_type -> buf.alpha.registry.v1alpha1.UpdateBreakingChangePolicyResponse - 19, // 32: buf.alpha.registry.v1alpha1.AdminService.GetUniquenessPolicy:output_type -> buf.alpha.registry.v1alpha1.GetUniquenessPolicyResponse - 21, // 33: buf.alpha.registry.v1alpha1.AdminService.UpdateUniquenessPolicy:output_type -> buf.alpha.registry.v1alpha1.UpdateUniquenessPolicyResponse - 23, // 34: buf.alpha.registry.v1alpha1.AdminService.ListServerUniquenessCollisions:output_type -> buf.alpha.registry.v1alpha1.ListServerUniquenessCollisionsResponse - 26, // [26:35] is the sub-list for method output_type - 17, // [17:26] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_admin_proto_init() } -func file_buf_alpha_registry_v1alpha1_admin_proto_init() { - if File_buf_alpha_registry_v1alpha1_admin_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_organization_proto_init() - file_buf_alpha_registry_v1alpha1_plugin_proto_init() - file_buf_alpha_registry_v1alpha1_repository_proto_init() - file_buf_alpha_registry_v1alpha1_user_proto_init() - file_buf_alpha_registry_v1alpha1_verification_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BreakingChangePolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UniquenessPolicy); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Collision); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CollisionSource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForceDeleteUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForceDeleteUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserVerificationStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserVerificationStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationVerificationStatusRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationVerificationStatusResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateMachineUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateMachineUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBreakingChangePolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetBreakingChangePolicyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateBreakingChangePolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateBreakingChangePolicyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUniquenessPolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUniquenessPolicyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUniquenessPolicyRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUniquenessPolicyResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListServerUniquenessCollisionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListServerUniquenessCollisionsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes[0].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc, - NumEnums: 2, - NumMessages: 22, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_admin_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_admin_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_admin_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_admin_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_admin_proto = out.File - file_buf_alpha_registry_v1alpha1_admin_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_admin_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_admin_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authn.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authn.pb.go deleted file mode 100644 index b7fcf5e0df..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authn.pb.go +++ /dev/null @@ -1,379 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/authn.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetCurrentUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetCurrentUserRequest) Reset() { - *x = GetCurrentUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentUserRequest) ProtoMessage() {} - -func (x *GetCurrentUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentUserRequest.ProtoReflect.Descriptor instead. -func (*GetCurrentUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authn_proto_rawDescGZIP(), []int{0} -} - -type GetCurrentUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetCurrentUserResponse) Reset() { - *x = GetCurrentUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentUserResponse) ProtoMessage() {} - -func (x *GetCurrentUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentUserResponse.ProtoReflect.Descriptor instead. -func (*GetCurrentUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authn_proto_rawDescGZIP(), []int{1} -} - -func (x *GetCurrentUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type GetCurrentUserSubjectRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetCurrentUserSubjectRequest) Reset() { - *x = GetCurrentUserSubjectRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentUserSubjectRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentUserSubjectRequest) ProtoMessage() {} - -func (x *GetCurrentUserSubjectRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentUserSubjectRequest.ProtoReflect.Descriptor instead. -func (*GetCurrentUserSubjectRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authn_proto_rawDescGZIP(), []int{2} -} - -type GetCurrentUserSubjectResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The user's subject for mapping to user in identity provider. - // Note: we do not want to make it part of the User response as - // it contains potentially sensitive information and the User - // response is shared with other users. - Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` -} - -func (x *GetCurrentUserSubjectResponse) Reset() { - *x = GetCurrentUserSubjectResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentUserSubjectResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentUserSubjectResponse) ProtoMessage() {} - -func (x *GetCurrentUserSubjectResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentUserSubjectResponse.ProtoReflect.Descriptor instead. -func (*GetCurrentUserSubjectResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authn_proto_rawDescGZIP(), []int{3} -} - -func (x *GetCurrentUserSubjectResponse) GetSubject() string { - if x != nil { - return x.Subject - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_authn_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x17, - 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x43, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x43, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x39, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x43, - 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x32, 0xa4, 0x02, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, - 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x39, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x97, 0x02, 0x0a, 0x1f, 0x63, - 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0a, - 0x41, 0x75, 0x74, 0x68, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, - 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, - 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_authn_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_authn_proto_rawDescData = file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_authn_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_authn_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_authn_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_authn_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_authn_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_buf_alpha_registry_v1alpha1_authn_proto_goTypes = []interface{}{ - (*GetCurrentUserRequest)(nil), // 0: buf.alpha.registry.v1alpha1.GetCurrentUserRequest - (*GetCurrentUserResponse)(nil), // 1: buf.alpha.registry.v1alpha1.GetCurrentUserResponse - (*GetCurrentUserSubjectRequest)(nil), // 2: buf.alpha.registry.v1alpha1.GetCurrentUserSubjectRequest - (*GetCurrentUserSubjectResponse)(nil), // 3: buf.alpha.registry.v1alpha1.GetCurrentUserSubjectResponse - (*User)(nil), // 4: buf.alpha.registry.v1alpha1.User -} -var file_buf_alpha_registry_v1alpha1_authn_proto_depIdxs = []int32{ - 4, // 0: buf.alpha.registry.v1alpha1.GetCurrentUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 0, // 1: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser:input_type -> buf.alpha.registry.v1alpha1.GetCurrentUserRequest - 2, // 2: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject:input_type -> buf.alpha.registry.v1alpha1.GetCurrentUserSubjectRequest - 1, // 3: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUser:output_type -> buf.alpha.registry.v1alpha1.GetCurrentUserResponse - 3, // 4: buf.alpha.registry.v1alpha1.AuthnService.GetCurrentUserSubject:output_type -> buf.alpha.registry.v1alpha1.GetCurrentUserSubjectResponse - 3, // [3:5] is the sub-list for method output_type - 1, // [1:3] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_authn_proto_init() } -func file_buf_alpha_registry_v1alpha1_authn_proto_init() { - if File_buf_alpha_registry_v1alpha1_authn_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_user_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentUserSubjectRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentUserSubjectResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_authn_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_authn_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_authn_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_authn_proto = out.File - file_buf_alpha_registry_v1alpha1_authn_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_authn_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_authn_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authz.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authz.pb.go deleted file mode 100644 index 87af334cfe..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/authz.pb.go +++ /dev/null @@ -1,3057 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/authz.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type UserCanCreateOrganizationRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanCreateOrganizationRepositoryRequest) Reset() { - *x = UserCanCreateOrganizationRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationRepositoryRequest) ProtoMessage() {} - -func (x *UserCanCreateOrganizationRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationRepositoryRequest.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationRepositoryRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{0} -} - -func (x *UserCanCreateOrganizationRepositoryRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanCreateOrganizationRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanCreateOrganizationRepositoryResponse) Reset() { - *x = UserCanCreateOrganizationRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationRepositoryResponse) ProtoMessage() {} - -func (x *UserCanCreateOrganizationRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationRepositoryResponse.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationRepositoryResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{1} -} - -func (x *UserCanCreateOrganizationRepositoryResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanSeeRepositorySettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // whether the user is authorized. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *UserCanSeeRepositorySettingsRequest) Reset() { - *x = UserCanSeeRepositorySettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeRepositorySettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeRepositorySettingsRequest) ProtoMessage() {} - -func (x *UserCanSeeRepositorySettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeRepositorySettingsRequest.ProtoReflect.Descriptor instead. -func (*UserCanSeeRepositorySettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{2} -} - -func (x *UserCanSeeRepositorySettingsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type UserCanSeeRepositorySettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanSeeRepositorySettingsResponse) Reset() { - *x = UserCanSeeRepositorySettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeRepositorySettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeRepositorySettingsResponse) ProtoMessage() {} - -func (x *UserCanSeeRepositorySettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeRepositorySettingsResponse.ProtoReflect.Descriptor instead. -func (*UserCanSeeRepositorySettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{3} -} - -func (x *UserCanSeeRepositorySettingsResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanSeeOrganizationSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanSeeOrganizationSettingsRequest) Reset() { - *x = UserCanSeeOrganizationSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeOrganizationSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeOrganizationSettingsRequest) ProtoMessage() {} - -func (x *UserCanSeeOrganizationSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeOrganizationSettingsRequest.ProtoReflect.Descriptor instead. -func (*UserCanSeeOrganizationSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{4} -} - -func (x *UserCanSeeOrganizationSettingsRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanSeeOrganizationSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanSeeOrganizationSettingsResponse) Reset() { - *x = UserCanSeeOrganizationSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeOrganizationSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeOrganizationSettingsResponse) ProtoMessage() {} - -func (x *UserCanSeeOrganizationSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeOrganizationSettingsResponse.ProtoReflect.Descriptor instead. -func (*UserCanSeeOrganizationSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{5} -} - -func (x *UserCanSeeOrganizationSettingsResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanReadPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *UserCanReadPluginRequest) Reset() { - *x = UserCanReadPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanReadPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanReadPluginRequest) ProtoMessage() {} - -func (x *UserCanReadPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanReadPluginRequest.ProtoReflect.Descriptor instead. -func (*UserCanReadPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{6} -} - -func (x *UserCanReadPluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *UserCanReadPluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanReadPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanReadPluginResponse) Reset() { - *x = UserCanReadPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanReadPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanReadPluginResponse) ProtoMessage() {} - -func (x *UserCanReadPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanReadPluginResponse.ProtoReflect.Descriptor instead. -func (*UserCanReadPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{7} -} - -func (x *UserCanReadPluginResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreatePluginVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *UserCanCreatePluginVersionRequest) Reset() { - *x = UserCanCreatePluginVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreatePluginVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreatePluginVersionRequest) ProtoMessage() {} - -func (x *UserCanCreatePluginVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreatePluginVersionRequest.ProtoReflect.Descriptor instead. -func (*UserCanCreatePluginVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{8} -} - -func (x *UserCanCreatePluginVersionRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *UserCanCreatePluginVersionRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreatePluginVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanCreatePluginVersionResponse) Reset() { - *x = UserCanCreatePluginVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreatePluginVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreatePluginVersionResponse) ProtoMessage() {} - -func (x *UserCanCreatePluginVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreatePluginVersionResponse.ProtoReflect.Descriptor instead. -func (*UserCanCreatePluginVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{9} -} - -func (x *UserCanCreatePluginVersionResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateTemplateVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *UserCanCreateTemplateVersionRequest) Reset() { - *x = UserCanCreateTemplateVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateTemplateVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateTemplateVersionRequest) ProtoMessage() {} - -func (x *UserCanCreateTemplateVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateTemplateVersionRequest.ProtoReflect.Descriptor instead. -func (*UserCanCreateTemplateVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{10} -} - -func (x *UserCanCreateTemplateVersionRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *UserCanCreateTemplateVersionRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateTemplateVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanCreateTemplateVersionResponse) Reset() { - *x = UserCanCreateTemplateVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateTemplateVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateTemplateVersionResponse) ProtoMessage() {} - -func (x *UserCanCreateTemplateVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateTemplateVersionResponse.ProtoReflect.Descriptor instead. -func (*UserCanCreateTemplateVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{11} -} - -func (x *UserCanCreateTemplateVersionResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateOrganizationPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanCreateOrganizationPluginRequest) Reset() { - *x = UserCanCreateOrganizationPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationPluginRequest) ProtoMessage() {} - -func (x *UserCanCreateOrganizationPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationPluginRequest.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{12} -} - -func (x *UserCanCreateOrganizationPluginRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateOrganizationPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanCreateOrganizationPluginResponse) Reset() { - *x = UserCanCreateOrganizationPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationPluginResponse) ProtoMessage() {} - -func (x *UserCanCreateOrganizationPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationPluginResponse.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{13} -} - -func (x *UserCanCreateOrganizationPluginResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateOrganizationTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanCreateOrganizationTemplateRequest) Reset() { - *x = UserCanCreateOrganizationTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationTemplateRequest) ProtoMessage() {} - -func (x *UserCanCreateOrganizationTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationTemplateRequest.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationTemplateRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{14} -} - -func (x *UserCanCreateOrganizationTemplateRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanCreateOrganizationTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanCreateOrganizationTemplateResponse) Reset() { - *x = UserCanCreateOrganizationTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanCreateOrganizationTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanCreateOrganizationTemplateResponse) ProtoMessage() {} - -func (x *UserCanCreateOrganizationTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanCreateOrganizationTemplateResponse.ProtoReflect.Descriptor instead. -func (*UserCanCreateOrganizationTemplateResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{15} -} - -func (x *UserCanCreateOrganizationTemplateResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanSeePluginSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *UserCanSeePluginSettingsRequest) Reset() { - *x = UserCanSeePluginSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeePluginSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeePluginSettingsRequest) ProtoMessage() {} - -func (x *UserCanSeePluginSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeePluginSettingsRequest.ProtoReflect.Descriptor instead. -func (*UserCanSeePluginSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{16} -} - -func (x *UserCanSeePluginSettingsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *UserCanSeePluginSettingsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanSeePluginSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanSeePluginSettingsResponse) Reset() { - *x = UserCanSeePluginSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeePluginSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeePluginSettingsResponse) ProtoMessage() {} - -func (x *UserCanSeePluginSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeePluginSettingsResponse.ProtoReflect.Descriptor instead. -func (*UserCanSeePluginSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{17} -} - -func (x *UserCanSeePluginSettingsResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanSeeTemplateSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *UserCanSeeTemplateSettingsRequest) Reset() { - *x = UserCanSeeTemplateSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeTemplateSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeTemplateSettingsRequest) ProtoMessage() {} - -func (x *UserCanSeeTemplateSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeTemplateSettingsRequest.ProtoReflect.Descriptor instead. -func (*UserCanSeeTemplateSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{18} -} - -func (x *UserCanSeeTemplateSettingsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *UserCanSeeTemplateSettingsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanSeeTemplateSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanSeeTemplateSettingsResponse) Reset() { - *x = UserCanSeeTemplateSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeTemplateSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeTemplateSettingsResponse) ProtoMessage() {} - -func (x *UserCanSeeTemplateSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeTemplateSettingsResponse.ProtoReflect.Descriptor instead. -func (*UserCanSeeTemplateSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{19} -} - -func (x *UserCanSeeTemplateSettingsResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanAddOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanAddOrganizationMemberRequest) Reset() { - *x = UserCanAddOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanAddOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanAddOrganizationMemberRequest) ProtoMessage() {} - -func (x *UserCanAddOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanAddOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*UserCanAddOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{20} -} - -func (x *UserCanAddOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanAddOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that the user is authorized to add, empty list means the user is - // not authorized to add any members. - AuthorizedRoles []OrganizationRole `protobuf:"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"authorized_roles,omitempty"` -} - -func (x *UserCanAddOrganizationMemberResponse) Reset() { - *x = UserCanAddOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanAddOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanAddOrganizationMemberResponse) ProtoMessage() {} - -func (x *UserCanAddOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanAddOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*UserCanAddOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{21} -} - -func (x *UserCanAddOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole { - if x != nil { - return x.AuthorizedRoles - } - return nil -} - -type UserCanUpdateOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanUpdateOrganizationMemberRequest) Reset() { - *x = UserCanUpdateOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanUpdateOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanUpdateOrganizationMemberRequest) ProtoMessage() {} - -func (x *UserCanUpdateOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanUpdateOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*UserCanUpdateOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{22} -} - -func (x *UserCanUpdateOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanUpdateOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that the user is authorized to update (from and to), empty list means the user is - // not authorized to update any members' role. - AuthorizedRoles []OrganizationRole `protobuf:"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"authorized_roles,omitempty"` -} - -func (x *UserCanUpdateOrganizationMemberResponse) Reset() { - *x = UserCanUpdateOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanUpdateOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanUpdateOrganizationMemberResponse) ProtoMessage() {} - -func (x *UserCanUpdateOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanUpdateOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*UserCanUpdateOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{23} -} - -func (x *UserCanUpdateOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole { - if x != nil { - return x.AuthorizedRoles - } - return nil -} - -type UserCanRemoveOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanRemoveOrganizationMemberRequest) Reset() { - *x = UserCanRemoveOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanRemoveOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanRemoveOrganizationMemberRequest) ProtoMessage() {} - -func (x *UserCanRemoveOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanRemoveOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*UserCanRemoveOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{24} -} - -func (x *UserCanRemoveOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanRemoveOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that the user is authorized to remove, empty list means the user is - // not authorized to remove any members. - AuthorizedRoles []OrganizationRole `protobuf:"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"authorized_roles,omitempty"` -} - -func (x *UserCanRemoveOrganizationMemberResponse) Reset() { - *x = UserCanRemoveOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanRemoveOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanRemoveOrganizationMemberResponse) ProtoMessage() {} - -func (x *UserCanRemoveOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanRemoveOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*UserCanRemoveOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{25} -} - -func (x *UserCanRemoveOrganizationMemberResponse) GetAuthorizedRoles() []OrganizationRole { - if x != nil { - return x.AuthorizedRoles - } - return nil -} - -type UserCanDeleteOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // whether the user is authorized. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *UserCanDeleteOrganizationRequest) Reset() { - *x = UserCanDeleteOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteOrganizationRequest) ProtoMessage() {} - -func (x *UserCanDeleteOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteOrganizationRequest.ProtoReflect.Descriptor instead. -func (*UserCanDeleteOrganizationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{26} -} - -func (x *UserCanDeleteOrganizationRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type UserCanDeleteOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanDeleteOrganizationResponse) Reset() { - *x = UserCanDeleteOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteOrganizationResponse) ProtoMessage() {} - -func (x *UserCanDeleteOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteOrganizationResponse.ProtoReflect.Descriptor instead. -func (*UserCanDeleteOrganizationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{27} -} - -func (x *UserCanDeleteOrganizationResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanDeleteRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // whether the user is authorized. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *UserCanDeleteRepositoryRequest) Reset() { - *x = UserCanDeleteRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteRepositoryRequest) ProtoMessage() {} - -func (x *UserCanDeleteRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteRepositoryRequest.ProtoReflect.Descriptor instead. -func (*UserCanDeleteRepositoryRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{28} -} - -func (x *UserCanDeleteRepositoryRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type UserCanDeleteRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanDeleteRepositoryResponse) Reset() { - *x = UserCanDeleteRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteRepositoryResponse) ProtoMessage() {} - -func (x *UserCanDeleteRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteRepositoryResponse.ProtoReflect.Descriptor instead. -func (*UserCanDeleteRepositoryResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{29} -} - -func (x *UserCanDeleteRepositoryResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanDeleteTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the template for which to check - // whether the user is authorized. - TemplateId string `protobuf:"bytes,1,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` -} - -func (x *UserCanDeleteTemplateRequest) Reset() { - *x = UserCanDeleteTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteTemplateRequest) ProtoMessage() {} - -func (x *UserCanDeleteTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteTemplateRequest.ProtoReflect.Descriptor instead. -func (*UserCanDeleteTemplateRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{30} -} - -func (x *UserCanDeleteTemplateRequest) GetTemplateId() string { - if x != nil { - return x.TemplateId - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanDeleteTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanDeleteTemplateResponse) Reset() { - *x = UserCanDeleteTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteTemplateResponse) ProtoMessage() {} - -func (x *UserCanDeleteTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteTemplateResponse.ProtoReflect.Descriptor instead. -func (*UserCanDeleteTemplateResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{31} -} - -func (x *UserCanDeleteTemplateResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanDeletePluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the plugin for which to check - // whether the user is authorized. - PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"plugin_id,omitempty"` -} - -func (x *UserCanDeletePluginRequest) Reset() { - *x = UserCanDeletePluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeletePluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeletePluginRequest) ProtoMessage() {} - -func (x *UserCanDeletePluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeletePluginRequest.ProtoReflect.Descriptor instead. -func (*UserCanDeletePluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{32} -} - -func (x *UserCanDeletePluginRequest) GetPluginId() string { - if x != nil { - return x.PluginId - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/authz.proto. -type UserCanDeletePluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanDeletePluginResponse) Reset() { - *x = UserCanDeletePluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeletePluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeletePluginResponse) ProtoMessage() {} - -func (x *UserCanDeletePluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeletePluginResponse.ProtoReflect.Descriptor instead. -func (*UserCanDeletePluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{33} -} - -func (x *UserCanDeletePluginResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanDeleteUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UserCanDeleteUserRequest) Reset() { - *x = UserCanDeleteUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteUserRequest) ProtoMessage() {} - -func (x *UserCanDeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteUserRequest.ProtoReflect.Descriptor instead. -func (*UserCanDeleteUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{34} -} - -type UserCanDeleteUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanDeleteUserResponse) Reset() { - *x = UserCanDeleteUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanDeleteUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanDeleteUserResponse) ProtoMessage() {} - -func (x *UserCanDeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanDeleteUserResponse.ProtoReflect.Descriptor instead. -func (*UserCanDeleteUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{35} -} - -func (x *UserCanDeleteUserResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanSeeServerAdminPanelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UserCanSeeServerAdminPanelRequest) Reset() { - *x = UserCanSeeServerAdminPanelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeServerAdminPanelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeServerAdminPanelRequest) ProtoMessage() {} - -func (x *UserCanSeeServerAdminPanelRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeServerAdminPanelRequest.ProtoReflect.Descriptor instead. -func (*UserCanSeeServerAdminPanelRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{36} -} - -type UserCanSeeServerAdminPanelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Authorized bool `protobuf:"varint,1,opt,name=authorized,proto3" json:"authorized,omitempty"` -} - -func (x *UserCanSeeServerAdminPanelResponse) Reset() { - *x = UserCanSeeServerAdminPanelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanSeeServerAdminPanelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanSeeServerAdminPanelResponse) ProtoMessage() {} - -func (x *UserCanSeeServerAdminPanelResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanSeeServerAdminPanelResponse.ProtoReflect.Descriptor instead. -func (*UserCanSeeServerAdminPanelResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{37} -} - -func (x *UserCanSeeServerAdminPanelResponse) GetAuthorized() bool { - if x != nil { - return x.Authorized - } - return false -} - -type UserCanManageRepositoryContributorsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // whether the user is authorized. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *UserCanManageRepositoryContributorsRequest) Reset() { - *x = UserCanManageRepositoryContributorsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanManageRepositoryContributorsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanManageRepositoryContributorsRequest) ProtoMessage() {} - -func (x *UserCanManageRepositoryContributorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanManageRepositoryContributorsRequest.ProtoReflect.Descriptor instead. -func (*UserCanManageRepositoryContributorsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{38} -} - -func (x *UserCanManageRepositoryContributorsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type UserCanManageRepositoryContributorsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that the user is authorized to manage, empty list means the user is - // not authorized to manage any contributors. - AuthorizedRoles []RepositoryRole `protobuf:"varint,1,rep,packed,name=authorized_roles,json=authorizedRoles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"authorized_roles,omitempty"` -} - -func (x *UserCanManageRepositoryContributorsResponse) Reset() { - *x = UserCanManageRepositoryContributorsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserCanManageRepositoryContributorsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserCanManageRepositoryContributorsResponse) ProtoMessage() {} - -func (x *UserCanManageRepositoryContributorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserCanManageRepositoryContributorsResponse.ProtoReflect.Descriptor instead. -func (*UserCanManageRepositoryContributorsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP(), []int{39} -} - -func (x *UserCanManageRepositoryContributorsResponse) GetAuthorizedRoles() []RepositoryRole { - if x != nil { - return x.AuthorizedRoles - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_authz_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x61, 0x75, - 0x74, 0x68, 0x7a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55, - 0x0a, 0x2a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x4d, 0x0a, 0x2b, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x22, 0x4a, 0x0a, 0x23, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, - 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, - 0x22, 0x46, 0x0a, 0x24, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x50, 0x0a, 0x25, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x48, 0x0a, 0x26, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x22, 0x48, 0x0a, 0x18, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, - 0x65, 0x61, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3f, - 0x0a, 0x19, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, - 0x51, 0x0a, 0x21, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x02, - 0x18, 0x01, 0x22, 0x48, 0x0a, 0x22, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x53, 0x0a, 0x23, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x4a, 0x0a, 0x24, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x55, 0x0a, - 0x26, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x3a, 0x02, 0x18, 0x01, 0x22, 0x4d, 0x0a, 0x27, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, - 0x02, 0x18, 0x01, 0x22, 0x57, 0x0a, 0x28, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x4f, 0x0a, 0x29, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x4f, 0x0a, - 0x1f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x46, - 0x0a, 0x20, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x51, 0x0a, 0x21, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, - 0x6e, 0x53, 0x65, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x48, 0x0a, 0x22, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, - 0x02, 0x18, 0x01, 0x22, 0x4e, 0x0a, 0x23, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x64, - 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x64, 0x22, 0x80, 0x01, 0x0a, 0x24, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, - 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x26, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, - 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x27, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x7a, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, - 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0f, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, - 0x51, 0x0a, 0x26, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x27, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, - 0x0a, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x7a, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x4b, 0x0a, 0x20, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x21, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x45, 0x0a, 0x1e, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, - 0x64, 0x22, 0x41, 0x0a, 0x1f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x22, 0x43, 0x0a, 0x1c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x43, 0x0a, 0x1d, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x3d, - 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x41, 0x0a, - 0x1b, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, - 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3b, 0x0a, 0x19, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x22, 0x23, 0x0a, 0x21, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x6d, - 0x69, 0x6e, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x44, - 0x0a, 0x22, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x65, 0x64, 0x22, 0x51, 0x0a, 0x2a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x85, 0x01, 0x0a, 0x2b, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x10, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0f, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x32, - 0xb7, 0x1a, 0x0a, 0x0c, 0x41, 0x75, 0x74, 0x68, 0x7a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0xbd, 0x01, 0x0a, 0x23, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x47, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x48, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0xa8, 0x01, 0x0a, 0x1c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xae, 0x01, 0x0a, 0x1e, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x42, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8a, 0x01, 0x0a, - 0x11, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x61, 0x64, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, - 0x65, 0x61, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0xa5, 0x01, 0x0a, 0x1a, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, - 0x01, 0x12, 0xab, 0x01, 0x0a, 0x1c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x12, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, - 0xb4, 0x01, 0x0a, 0x1f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x12, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x44, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, - 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0xba, 0x01, 0x0a, 0x21, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x45, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x46, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, - 0x90, 0x02, 0x01, 0x12, 0x9f, 0x01, 0x0a, 0x18, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, - 0x65, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, - 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, - 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0xa5, 0x01, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, - 0x6e, 0x53, 0x65, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0xa8, 0x01, - 0x0a, 0x1c, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x40, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xb1, 0x01, 0x0a, 0x1f, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x43, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x44, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xb1, 0x01, 0x0a, - 0x1f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x44, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x9f, 0x01, 0x0a, 0x19, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x3b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, - 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x96, - 0x01, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0x90, 0x01, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, - 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x06, 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0xa2, 0x01, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, - 0x53, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, - 0x6e, 0x65, 0x6c, 0x12, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x53, 0x65, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x41, 0x64, 0x6d, 0x69, 0x6e, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xbd, 0x01, 0x0a, 0x23, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, - 0x73, 0x12, 0x47, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x48, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x97, 0x02, 0x0a, 0x1f, 0x63, 0x6f, - 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0a, 0x41, - 0x75, 0x74, 0x68, 0x7a, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, - 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_authz_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_authz_proto_rawDescData = file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_authz_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_authz_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_authz_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_authz_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_authz_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes = make([]protoimpl.MessageInfo, 40) -var file_buf_alpha_registry_v1alpha1_authz_proto_goTypes = []interface{}{ - (*UserCanCreateOrganizationRepositoryRequest)(nil), // 0: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryRequest - (*UserCanCreateOrganizationRepositoryResponse)(nil), // 1: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryResponse - (*UserCanSeeRepositorySettingsRequest)(nil), // 2: buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsRequest - (*UserCanSeeRepositorySettingsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsResponse - (*UserCanSeeOrganizationSettingsRequest)(nil), // 4: buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsRequest - (*UserCanSeeOrganizationSettingsResponse)(nil), // 5: buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsResponse - (*UserCanReadPluginRequest)(nil), // 6: buf.alpha.registry.v1alpha1.UserCanReadPluginRequest - (*UserCanReadPluginResponse)(nil), // 7: buf.alpha.registry.v1alpha1.UserCanReadPluginResponse - (*UserCanCreatePluginVersionRequest)(nil), // 8: buf.alpha.registry.v1alpha1.UserCanCreatePluginVersionRequest - (*UserCanCreatePluginVersionResponse)(nil), // 9: buf.alpha.registry.v1alpha1.UserCanCreatePluginVersionResponse - (*UserCanCreateTemplateVersionRequest)(nil), // 10: buf.alpha.registry.v1alpha1.UserCanCreateTemplateVersionRequest - (*UserCanCreateTemplateVersionResponse)(nil), // 11: buf.alpha.registry.v1alpha1.UserCanCreateTemplateVersionResponse - (*UserCanCreateOrganizationPluginRequest)(nil), // 12: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationPluginRequest - (*UserCanCreateOrganizationPluginResponse)(nil), // 13: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationPluginResponse - (*UserCanCreateOrganizationTemplateRequest)(nil), // 14: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationTemplateRequest - (*UserCanCreateOrganizationTemplateResponse)(nil), // 15: buf.alpha.registry.v1alpha1.UserCanCreateOrganizationTemplateResponse - (*UserCanSeePluginSettingsRequest)(nil), // 16: buf.alpha.registry.v1alpha1.UserCanSeePluginSettingsRequest - (*UserCanSeePluginSettingsResponse)(nil), // 17: buf.alpha.registry.v1alpha1.UserCanSeePluginSettingsResponse - (*UserCanSeeTemplateSettingsRequest)(nil), // 18: buf.alpha.registry.v1alpha1.UserCanSeeTemplateSettingsRequest - (*UserCanSeeTemplateSettingsResponse)(nil), // 19: buf.alpha.registry.v1alpha1.UserCanSeeTemplateSettingsResponse - (*UserCanAddOrganizationMemberRequest)(nil), // 20: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberRequest - (*UserCanAddOrganizationMemberResponse)(nil), // 21: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse - (*UserCanUpdateOrganizationMemberRequest)(nil), // 22: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberRequest - (*UserCanUpdateOrganizationMemberResponse)(nil), // 23: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse - (*UserCanRemoveOrganizationMemberRequest)(nil), // 24: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberRequest - (*UserCanRemoveOrganizationMemberResponse)(nil), // 25: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse - (*UserCanDeleteOrganizationRequest)(nil), // 26: buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationRequest - (*UserCanDeleteOrganizationResponse)(nil), // 27: buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationResponse - (*UserCanDeleteRepositoryRequest)(nil), // 28: buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryRequest - (*UserCanDeleteRepositoryResponse)(nil), // 29: buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryResponse - (*UserCanDeleteTemplateRequest)(nil), // 30: buf.alpha.registry.v1alpha1.UserCanDeleteTemplateRequest - (*UserCanDeleteTemplateResponse)(nil), // 31: buf.alpha.registry.v1alpha1.UserCanDeleteTemplateResponse - (*UserCanDeletePluginRequest)(nil), // 32: buf.alpha.registry.v1alpha1.UserCanDeletePluginRequest - (*UserCanDeletePluginResponse)(nil), // 33: buf.alpha.registry.v1alpha1.UserCanDeletePluginResponse - (*UserCanDeleteUserRequest)(nil), // 34: buf.alpha.registry.v1alpha1.UserCanDeleteUserRequest - (*UserCanDeleteUserResponse)(nil), // 35: buf.alpha.registry.v1alpha1.UserCanDeleteUserResponse - (*UserCanSeeServerAdminPanelRequest)(nil), // 36: buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelRequest - (*UserCanSeeServerAdminPanelResponse)(nil), // 37: buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelResponse - (*UserCanManageRepositoryContributorsRequest)(nil), // 38: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsRequest - (*UserCanManageRepositoryContributorsResponse)(nil), // 39: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse - (OrganizationRole)(0), // 40: buf.alpha.registry.v1alpha1.OrganizationRole - (RepositoryRole)(0), // 41: buf.alpha.registry.v1alpha1.RepositoryRole -} -var file_buf_alpha_registry_v1alpha1_authz_proto_depIdxs = []int32{ - 40, // 0: buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 40, // 1: buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 40, // 2: buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 41, // 3: buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse.authorized_roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 0, // 4: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository:input_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryRequest - 2, // 5: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsRequest - 4, // 6: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsRequest - 6, // 7: buf.alpha.registry.v1alpha1.AuthzService.UserCanReadPlugin:input_type -> buf.alpha.registry.v1alpha1.UserCanReadPluginRequest - 8, // 8: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreatePluginVersion:input_type -> buf.alpha.registry.v1alpha1.UserCanCreatePluginVersionRequest - 10, // 9: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateTemplateVersion:input_type -> buf.alpha.registry.v1alpha1.UserCanCreateTemplateVersionRequest - 12, // 10: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationPlugin:input_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationPluginRequest - 14, // 11: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationTemplate:input_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationTemplateRequest - 16, // 12: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeePluginSettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeePluginSettingsRequest - 18, // 13: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeTemplateSettings:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeTemplateSettingsRequest - 20, // 14: buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberRequest - 22, // 15: buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberRequest - 24, // 16: buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberRequest - 26, // 17: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationRequest - 28, // 18: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryRequest - 30, // 19: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteTemplate:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteTemplateRequest - 32, // 20: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeletePlugin:input_type -> buf.alpha.registry.v1alpha1.UserCanDeletePluginRequest - 34, // 21: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser:input_type -> buf.alpha.registry.v1alpha1.UserCanDeleteUserRequest - 36, // 22: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel:input_type -> buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelRequest - 38, // 23: buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors:input_type -> buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsRequest - 1, // 24: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationRepository:output_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationRepositoryResponse - 3, // 25: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeRepositorySettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeRepositorySettingsResponse - 5, // 26: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeOrganizationSettingsResponse - 7, // 27: buf.alpha.registry.v1alpha1.AuthzService.UserCanReadPlugin:output_type -> buf.alpha.registry.v1alpha1.UserCanReadPluginResponse - 9, // 28: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreatePluginVersion:output_type -> buf.alpha.registry.v1alpha1.UserCanCreatePluginVersionResponse - 11, // 29: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateTemplateVersion:output_type -> buf.alpha.registry.v1alpha1.UserCanCreateTemplateVersionResponse - 13, // 30: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationPlugin:output_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationPluginResponse - 15, // 31: buf.alpha.registry.v1alpha1.AuthzService.UserCanCreateOrganizationTemplate:output_type -> buf.alpha.registry.v1alpha1.UserCanCreateOrganizationTemplateResponse - 17, // 32: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeePluginSettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeePluginSettingsResponse - 19, // 33: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeTemplateSettings:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeTemplateSettingsResponse - 21, // 34: buf.alpha.registry.v1alpha1.AuthzService.UserCanAddOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanAddOrganizationMemberResponse - 23, // 35: buf.alpha.registry.v1alpha1.AuthzService.UserCanUpdateOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanUpdateOrganizationMemberResponse - 25, // 36: buf.alpha.registry.v1alpha1.AuthzService.UserCanRemoveOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UserCanRemoveOrganizationMemberResponse - 27, // 37: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteOrganization:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteOrganizationResponse - 29, // 38: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteRepository:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteRepositoryResponse - 31, // 39: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteTemplate:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteTemplateResponse - 33, // 40: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeletePlugin:output_type -> buf.alpha.registry.v1alpha1.UserCanDeletePluginResponse - 35, // 41: buf.alpha.registry.v1alpha1.AuthzService.UserCanDeleteUser:output_type -> buf.alpha.registry.v1alpha1.UserCanDeleteUserResponse - 37, // 42: buf.alpha.registry.v1alpha1.AuthzService.UserCanSeeServerAdminPanel:output_type -> buf.alpha.registry.v1alpha1.UserCanSeeServerAdminPanelResponse - 39, // 43: buf.alpha.registry.v1alpha1.AuthzService.UserCanManageRepositoryContributors:output_type -> buf.alpha.registry.v1alpha1.UserCanManageRepositoryContributorsResponse - 24, // [24:44] is the sub-list for method output_type - 4, // [4:24] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_authz_proto_init() } -func file_buf_alpha_registry_v1alpha1_authz_proto_init() { - if File_buf_alpha_registry_v1alpha1_authz_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_role_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeRepositorySettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeRepositorySettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeOrganizationSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeOrganizationSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanReadPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanReadPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreatePluginVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreatePluginVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateTemplateVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateTemplateVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanCreateOrganizationTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeePluginSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeePluginSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeTemplateSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeTemplateSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanAddOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanAddOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanUpdateOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanUpdateOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanRemoveOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanRemoveOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeletePluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeletePluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanDeleteUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeServerAdminPanelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanSeeServerAdminPanelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanManageRepositoryContributorsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserCanManageRepositoryContributorsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc, - NumEnums: 0, - NumMessages: 40, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_authz_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_authz_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_authz_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_authz_proto = out.File - file_buf_alpha_registry_v1alpha1_authz_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_authz_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_authz_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/convert.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/convert.pb.go deleted file mode 100644 index 21c85bf845..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/convert.pb.go +++ /dev/null @@ -1,368 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/convert.proto - -package registryv1alpha1 - -import ( - v1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The supported formats for the serialized message conversion. -type ConvertFormat int32 - -const ( - ConvertFormat_CONVERT_FORMAT_UNSPECIFIED ConvertFormat = 0 - ConvertFormat_CONVERT_FORMAT_BIN ConvertFormat = 1 - ConvertFormat_CONVERT_FORMAT_JSON ConvertFormat = 2 -) - -// Enum value maps for ConvertFormat. -var ( - ConvertFormat_name = map[int32]string{ - 0: "CONVERT_FORMAT_UNSPECIFIED", - 1: "CONVERT_FORMAT_BIN", - 2: "CONVERT_FORMAT_JSON", - } - ConvertFormat_value = map[string]int32{ - "CONVERT_FORMAT_UNSPECIFIED": 0, - "CONVERT_FORMAT_BIN": 1, - "CONVERT_FORMAT_JSON": 2, - } -) - -func (x ConvertFormat) Enum() *ConvertFormat { - p := new(ConvertFormat) - *p = x - return p -} - -func (x ConvertFormat) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ConvertFormat) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes[0].Descriptor() -} - -func (ConvertFormat) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes[0] -} - -func (x ConvertFormat) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ConvertFormat.Descriptor instead. -func (ConvertFormat) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_convert_proto_rawDescGZIP(), []int{0} -} - -type ConvertRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // type_name is the full type name of the serialized message (like acme.weather.v1.Units). - TypeName string `protobuf:"bytes,1,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` - // image is the image source that defines the serialized message. - Image *v1.Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"` - // payload is the serialized Protobuf message. - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` - // request_format is the format of the payload. - RequestFormat ConvertFormat `protobuf:"varint,4,opt,name=request_format,json=requestFormat,proto3,enum=buf.alpha.registry.v1alpha1.ConvertFormat" json:"request_format,omitempty"` - // response_format is the desired format of the output result. - ResponseFormat ConvertFormat `protobuf:"varint,5,opt,name=response_format,json=responseFormat,proto3,enum=buf.alpha.registry.v1alpha1.ConvertFormat" json:"response_format,omitempty"` -} - -func (x *ConvertRequest) Reset() { - *x = ConvertRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConvertRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConvertRequest) ProtoMessage() {} - -func (x *ConvertRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConvertRequest.ProtoReflect.Descriptor instead. -func (*ConvertRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_convert_proto_rawDescGZIP(), []int{0} -} - -func (x *ConvertRequest) GetTypeName() string { - if x != nil { - return x.TypeName - } - return "" -} - -func (x *ConvertRequest) GetImage() *v1.Image { - if x != nil { - return x.Image - } - return nil -} - -func (x *ConvertRequest) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -func (x *ConvertRequest) GetRequestFormat() ConvertFormat { - if x != nil { - return x.RequestFormat - } - return ConvertFormat_CONVERT_FORMAT_UNSPECIFIED -} - -func (x *ConvertRequest) GetResponseFormat() ConvertFormat { - if x != nil { - return x.ResponseFormat - } - return ConvertFormat_CONVERT_FORMAT_UNSPECIFIED -} - -type ConvertResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // payload is the converted serialized message in one of the supported formats. - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` -} - -func (x *ConvertResponse) Reset() { - *x = ConvertResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConvertResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConvertResponse) ProtoMessage() {} - -func (x *ConvertResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConvertResponse.ProtoReflect.Descriptor instead. -func (*ConvertResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_convert_proto_rawDescGZIP(), []int{1} -} - -func (x *ConvertResponse) GetPayload() []byte { - if x != nil { - return x.Payload - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_convert_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x63, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x02, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, - 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, - 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, - 0x6f, 0x61, 0x64, 0x12, 0x51, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x53, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x2b, 0x0a, 0x0f, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x60, 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x76, - 0x65, 0x72, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1e, 0x0a, 0x1a, 0x43, 0x4f, 0x4e, - 0x56, 0x45, 0x52, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4e, - 0x56, 0x45, 0x52, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x10, - 0x01, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x56, 0x45, 0x52, 0x54, 0x5f, 0x46, 0x4f, 0x52, - 0x4d, 0x41, 0x54, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x32, 0x76, 0x0a, 0x0e, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x64, 0x0a, 0x07, - 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x12, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x42, 0x99, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, - 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_convert_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_convert_proto_rawDescData = file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_convert_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_convert_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_convert_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_convert_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_convert_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_registry_v1alpha1_convert_proto_goTypes = []interface{}{ - (ConvertFormat)(0), // 0: buf.alpha.registry.v1alpha1.ConvertFormat - (*ConvertRequest)(nil), // 1: buf.alpha.registry.v1alpha1.ConvertRequest - (*ConvertResponse)(nil), // 2: buf.alpha.registry.v1alpha1.ConvertResponse - (*v1.Image)(nil), // 3: buf.alpha.image.v1.Image -} -var file_buf_alpha_registry_v1alpha1_convert_proto_depIdxs = []int32{ - 3, // 0: buf.alpha.registry.v1alpha1.ConvertRequest.image:type_name -> buf.alpha.image.v1.Image - 0, // 1: buf.alpha.registry.v1alpha1.ConvertRequest.request_format:type_name -> buf.alpha.registry.v1alpha1.ConvertFormat - 0, // 2: buf.alpha.registry.v1alpha1.ConvertRequest.response_format:type_name -> buf.alpha.registry.v1alpha1.ConvertFormat - 1, // 3: buf.alpha.registry.v1alpha1.ConvertService.Convert:input_type -> buf.alpha.registry.v1alpha1.ConvertRequest - 2, // 4: buf.alpha.registry.v1alpha1.ConvertService.Convert:output_type -> buf.alpha.registry.v1alpha1.ConvertResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_convert_proto_init() } -func file_buf_alpha_registry_v1alpha1_convert_proto_init() { - if File_buf_alpha_registry_v1alpha1_convert_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConvertRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConvertResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_convert_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_convert_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_convert_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_convert_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_convert_proto = out.File - file_buf_alpha_registry_v1alpha1_convert_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_convert_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_convert_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/display.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/display.pb.go deleted file mode 100644 index ab3684090f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/display.pb.go +++ /dev/null @@ -1,1354 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/display.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type DisplayOrganizationElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to check - // which elements should be displayed. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *DisplayOrganizationElementsRequest) Reset() { - *x = DisplayOrganizationElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayOrganizationElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayOrganizationElementsRequest) ProtoMessage() {} - -func (x *DisplayOrganizationElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayOrganizationElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayOrganizationElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{0} -} - -func (x *DisplayOrganizationElementsRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type DisplayOrganizationElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display create organization repository element if true. - CreateRepository bool `protobuf:"varint,1,opt,name=create_repository,json=createRepository,proto3" json:"create_repository,omitempty"` - // Display create organization plugin element if true. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/display.proto. - CreatePlugin bool `protobuf:"varint,2,opt,name=create_plugin,json=createPlugin,proto3" json:"create_plugin,omitempty"` - // Display create organization template element if true. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/display.proto. - CreateTemplate bool `protobuf:"varint,3,opt,name=create_template,json=createTemplate,proto3" json:"create_template,omitempty"` - // Display organization settings element if true. - Settings bool `protobuf:"varint,4,opt,name=settings,proto3" json:"settings,omitempty"` - // Display update organization settings element if true. - UpdateSettings bool `protobuf:"varint,5,opt,name=update_settings,json=updateSettings,proto3" json:"update_settings,omitempty"` - // Display delete organization element if true. - Delete bool `protobuf:"varint,6,opt,name=delete,proto3" json:"delete,omitempty"` -} - -func (x *DisplayOrganizationElementsResponse) Reset() { - *x = DisplayOrganizationElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayOrganizationElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayOrganizationElementsResponse) ProtoMessage() {} - -func (x *DisplayOrganizationElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayOrganizationElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayOrganizationElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{1} -} - -func (x *DisplayOrganizationElementsResponse) GetCreateRepository() bool { - if x != nil { - return x.CreateRepository - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/display.proto. -func (x *DisplayOrganizationElementsResponse) GetCreatePlugin() bool { - if x != nil { - return x.CreatePlugin - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/display.proto. -func (x *DisplayOrganizationElementsResponse) GetCreateTemplate() bool { - if x != nil { - return x.CreateTemplate - } - return false -} - -func (x *DisplayOrganizationElementsResponse) GetSettings() bool { - if x != nil { - return x.Settings - } - return false -} - -func (x *DisplayOrganizationElementsResponse) GetUpdateSettings() bool { - if x != nil { - return x.UpdateSettings - } - return false -} - -func (x *DisplayOrganizationElementsResponse) GetDelete() bool { - if x != nil { - return x.Delete - } - return false -} - -type DisplayRepositoryElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // which elements should be displayed. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *DisplayRepositoryElementsRequest) Reset() { - *x = DisplayRepositoryElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayRepositoryElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayRepositoryElementsRequest) ProtoMessage() {} - -func (x *DisplayRepositoryElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayRepositoryElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayRepositoryElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{2} -} - -func (x *DisplayRepositoryElementsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type DisplayRepositoryElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display repository settings element if true. - Settings bool `protobuf:"varint,1,opt,name=settings,proto3" json:"settings,omitempty"` - // Display delete repository element if true. - Delete bool `protobuf:"varint,2,opt,name=delete,proto3" json:"delete,omitempty"` - // Display write repository element if true. - Write bool `protobuf:"varint,3,opt,name=write,proto3" json:"write,omitempty"` -} - -func (x *DisplayRepositoryElementsResponse) Reset() { - *x = DisplayRepositoryElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayRepositoryElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayRepositoryElementsResponse) ProtoMessage() {} - -func (x *DisplayRepositoryElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayRepositoryElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayRepositoryElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{3} -} - -func (x *DisplayRepositoryElementsResponse) GetSettings() bool { - if x != nil { - return x.Settings - } - return false -} - -func (x *DisplayRepositoryElementsResponse) GetDelete() bool { - if x != nil { - return x.Delete - } - return false -} - -func (x *DisplayRepositoryElementsResponse) GetWrite() bool { - if x != nil { - return x.Write - } - return false -} - -type DisplayUserElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisplayUserElementsRequest) Reset() { - *x = DisplayUserElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayUserElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayUserElementsRequest) ProtoMessage() {} - -func (x *DisplayUserElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayUserElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayUserElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{4} -} - -type DisplayUserElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display delete user element if true. - Delete bool `protobuf:"varint,1,opt,name=delete,proto3" json:"delete,omitempty"` -} - -func (x *DisplayUserElementsResponse) Reset() { - *x = DisplayUserElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayUserElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayUserElementsResponse) ProtoMessage() {} - -func (x *DisplayUserElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayUserElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayUserElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{5} -} - -func (x *DisplayUserElementsResponse) GetDelete() bool { - if x != nil { - return x.Delete - } - return false -} - -type DisplayServerElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DisplayServerElementsRequest) Reset() { - *x = DisplayServerElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayServerElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayServerElementsRequest) ProtoMessage() {} - -func (x *DisplayServerElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayServerElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayServerElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{6} -} - -type DisplayServerElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display server admin panel element if true. - AdminPanel bool `protobuf:"varint,1,opt,name=admin_panel,json=adminPanel,proto3" json:"admin_panel,omitempty"` -} - -func (x *DisplayServerElementsResponse) Reset() { - *x = DisplayServerElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayServerElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayServerElementsResponse) ProtoMessage() {} - -func (x *DisplayServerElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayServerElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayServerElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{7} -} - -func (x *DisplayServerElementsResponse) GetAdminPanel() bool { - if x != nil { - return x.AdminPanel - } - return false -} - -type DisplayOwnerEntitledElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the owner for which to check - // which elements are entitled to be displayed. - OwnerName string `protobuf:"bytes,1,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` -} - -func (x *DisplayOwnerEntitledElementsRequest) Reset() { - *x = DisplayOwnerEntitledElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayOwnerEntitledElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayOwnerEntitledElementsRequest) ProtoMessage() {} - -func (x *DisplayOwnerEntitledElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayOwnerEntitledElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayOwnerEntitledElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{8} -} - -func (x *DisplayOwnerEntitledElementsRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -type DisplayOwnerEntitledElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display create private repository element if true. - CreatePrivateRepository bool `protobuf:"varint,1,opt,name=create_private_repository,json=createPrivateRepository,proto3" json:"create_private_repository,omitempty"` -} - -func (x *DisplayOwnerEntitledElementsResponse) Reset() { - *x = DisplayOwnerEntitledElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayOwnerEntitledElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayOwnerEntitledElementsResponse) ProtoMessage() {} - -func (x *DisplayOwnerEntitledElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayOwnerEntitledElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayOwnerEntitledElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{9} -} - -func (x *DisplayOwnerEntitledElementsResponse) GetCreatePrivateRepository() bool { - if x != nil { - return x.CreatePrivateRepository - } - return false -} - -type DisplayRepositoryEntitledElementsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // which elements are entitled to be displayed. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *DisplayRepositoryEntitledElementsRequest) Reset() { - *x = DisplayRepositoryEntitledElementsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayRepositoryEntitledElementsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayRepositoryEntitledElementsRequest) ProtoMessage() {} - -func (x *DisplayRepositoryEntitledElementsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayRepositoryEntitledElementsRequest.ProtoReflect.Descriptor instead. -func (*DisplayRepositoryEntitledElementsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{10} -} - -func (x *DisplayRepositoryEntitledElementsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type DisplayRepositoryEntitledElementsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Display repository change to private setting element if true. - SetPrivate bool `protobuf:"varint,1,opt,name=set_private,json=setPrivate,proto3" json:"set_private,omitempty"` -} - -func (x *DisplayRepositoryEntitledElementsResponse) Reset() { - *x = DisplayRepositoryEntitledElementsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DisplayRepositoryEntitledElementsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DisplayRepositoryEntitledElementsResponse) ProtoMessage() {} - -func (x *DisplayRepositoryEntitledElementsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DisplayRepositoryEntitledElementsResponse.ProtoReflect.Descriptor instead. -func (*DisplayRepositoryEntitledElementsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{11} -} - -func (x *DisplayRepositoryEntitledElementsResponse) GetSetPrivate() bool { - if x != nil { - return x.SetPrivate - } - return false -} - -type ListManageableRepositoryRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // which roles should be displayed as manageable. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *ListManageableRepositoryRolesRequest) Reset() { - *x = ListManageableRepositoryRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListManageableRepositoryRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListManageableRepositoryRolesRequest) ProtoMessage() {} - -func (x *ListManageableRepositoryRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListManageableRepositoryRolesRequest.ProtoReflect.Descriptor instead. -func (*ListManageableRepositoryRolesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{12} -} - -func (x *ListManageableRepositoryRolesRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type ListManageableRepositoryRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that should be displayed - // to the user as manageable. - Roles []RepositoryRole `protobuf:"varint,1,rep,packed,name=roles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"roles,omitempty"` -} - -func (x *ListManageableRepositoryRolesResponse) Reset() { - *x = ListManageableRepositoryRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListManageableRepositoryRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListManageableRepositoryRolesResponse) ProtoMessage() {} - -func (x *ListManageableRepositoryRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListManageableRepositoryRolesResponse.ProtoReflect.Descriptor instead. -func (*ListManageableRepositoryRolesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{13} -} - -func (x *ListManageableRepositoryRolesResponse) GetRoles() []RepositoryRole { - if x != nil { - return x.Roles - } - return nil -} - -type ListManageableUserRepositoryRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to check - // which roles should be displayed as manageable. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The ID of the target user for which to check - // which roles are manageable. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *ListManageableUserRepositoryRolesRequest) Reset() { - *x = ListManageableUserRepositoryRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListManageableUserRepositoryRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListManageableUserRepositoryRolesRequest) ProtoMessage() {} - -func (x *ListManageableUserRepositoryRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListManageableUserRepositoryRolesRequest.ProtoReflect.Descriptor instead. -func (*ListManageableUserRepositoryRolesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{14} -} - -func (x *ListManageableUserRepositoryRolesRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *ListManageableUserRepositoryRolesRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type ListManageableUserRepositoryRolesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of roles that should be displayed - // to the user as manageable. - Roles []RepositoryRole `protobuf:"varint,1,rep,packed,name=roles,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"roles,omitempty"` -} - -func (x *ListManageableUserRepositoryRolesResponse) Reset() { - *x = ListManageableUserRepositoryRolesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListManageableUserRepositoryRolesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListManageableUserRepositoryRolesResponse) ProtoMessage() {} - -func (x *ListManageableUserRepositoryRolesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListManageableUserRepositoryRolesResponse.ProtoReflect.Descriptor instead. -func (*ListManageableUserRepositoryRolesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP(), []int{15} -} - -func (x *ListManageableUserRepositoryRolesResponse) GetRoles() []RepositoryRole { - if x != nil { - return x.Roles - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_display_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_display_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x69, - 0x73, 0x70, 0x6c, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x4d, 0x0a, 0x22, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, - 0x85, 0x02, 0x0a, 0x23, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x27, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, - 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, - 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x47, 0x0a, 0x20, 0x44, 0x69, 0x73, 0x70, 0x6c, - 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, - 0x22, 0x6d, 0x0a, 0x21, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x77, 0x72, 0x69, 0x74, 0x65, 0x22, - 0x1c, 0x0a, 0x1a, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x35, 0x0a, - 0x1b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x40, 0x0a, 0x1d, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x5f, 0x70, - 0x61, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x64, 0x6d, 0x69, - 0x6e, 0x50, 0x61, 0x6e, 0x65, 0x6c, 0x22, 0x44, 0x0a, 0x23, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, - 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x24, - 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, - 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x19, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x22, 0x4f, 0x0a, 0x28, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, - 0x64, 0x22, 0x4c, 0x0a, 0x29, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x73, 0x65, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x73, 0x65, 0x74, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x22, - 0x4b, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, - 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x6a, 0x0a, 0x25, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, - 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x68, 0x0a, 0x28, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x22, 0x6e, 0x0a, 0x29, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x41, 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, - 0x65, 0x73, 0x32, 0xcd, 0x0a, 0x0a, 0x0e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa5, 0x01, 0x0a, 0x1b, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9f, 0x01, - 0x0a, 0x19, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, - 0x8d, 0x01, 0x0a, 0x13, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x45, - 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x73, 0x65, - 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, - 0x93, 0x01, 0x0a, 0x15, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xa8, 0x01, 0x0a, 0x1c, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, - 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4f, 0x77, - 0x6e, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0xb7, 0x01, 0x0a, 0x21, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x45, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, - 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x46, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x69, 0x73, 0x70, - 0x6c, 0x61, 0x79, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x45, 0x6e, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x64, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xab, 0x01, 0x0a, 0x1d, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x41, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x42, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xb7, 0x01, 0x0a, 0x21, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x45, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x46, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x61, 0x62, - 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x42, 0x99, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, - 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_display_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_display_proto_rawDescData = file_buf_alpha_registry_v1alpha1_display_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_display_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_display_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_display_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_display_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_display_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_display_proto_msgTypes = make([]protoimpl.MessageInfo, 16) -var file_buf_alpha_registry_v1alpha1_display_proto_goTypes = []interface{}{ - (*DisplayOrganizationElementsRequest)(nil), // 0: buf.alpha.registry.v1alpha1.DisplayOrganizationElementsRequest - (*DisplayOrganizationElementsResponse)(nil), // 1: buf.alpha.registry.v1alpha1.DisplayOrganizationElementsResponse - (*DisplayRepositoryElementsRequest)(nil), // 2: buf.alpha.registry.v1alpha1.DisplayRepositoryElementsRequest - (*DisplayRepositoryElementsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.DisplayRepositoryElementsResponse - (*DisplayUserElementsRequest)(nil), // 4: buf.alpha.registry.v1alpha1.DisplayUserElementsRequest - (*DisplayUserElementsResponse)(nil), // 5: buf.alpha.registry.v1alpha1.DisplayUserElementsResponse - (*DisplayServerElementsRequest)(nil), // 6: buf.alpha.registry.v1alpha1.DisplayServerElementsRequest - (*DisplayServerElementsResponse)(nil), // 7: buf.alpha.registry.v1alpha1.DisplayServerElementsResponse - (*DisplayOwnerEntitledElementsRequest)(nil), // 8: buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsRequest - (*DisplayOwnerEntitledElementsResponse)(nil), // 9: buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsResponse - (*DisplayRepositoryEntitledElementsRequest)(nil), // 10: buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsRequest - (*DisplayRepositoryEntitledElementsResponse)(nil), // 11: buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsResponse - (*ListManageableRepositoryRolesRequest)(nil), // 12: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesRequest - (*ListManageableRepositoryRolesResponse)(nil), // 13: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse - (*ListManageableUserRepositoryRolesRequest)(nil), // 14: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesRequest - (*ListManageableUserRepositoryRolesResponse)(nil), // 15: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse - (RepositoryRole)(0), // 16: buf.alpha.registry.v1alpha1.RepositoryRole -} -var file_buf_alpha_registry_v1alpha1_display_proto_depIdxs = []int32{ - 16, // 0: buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse.roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 16, // 1: buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse.roles:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 0, // 2: buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements:input_type -> buf.alpha.registry.v1alpha1.DisplayOrganizationElementsRequest - 2, // 3: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements:input_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryElementsRequest - 4, // 4: buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements:input_type -> buf.alpha.registry.v1alpha1.DisplayUserElementsRequest - 6, // 5: buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements:input_type -> buf.alpha.registry.v1alpha1.DisplayServerElementsRequest - 8, // 6: buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements:input_type -> buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsRequest - 10, // 7: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements:input_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsRequest - 12, // 8: buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles:input_type -> buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesRequest - 14, // 9: buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles:input_type -> buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesRequest - 1, // 10: buf.alpha.registry.v1alpha1.DisplayService.DisplayOrganizationElements:output_type -> buf.alpha.registry.v1alpha1.DisplayOrganizationElementsResponse - 3, // 11: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryElements:output_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryElementsResponse - 5, // 12: buf.alpha.registry.v1alpha1.DisplayService.DisplayUserElements:output_type -> buf.alpha.registry.v1alpha1.DisplayUserElementsResponse - 7, // 13: buf.alpha.registry.v1alpha1.DisplayService.DisplayServerElements:output_type -> buf.alpha.registry.v1alpha1.DisplayServerElementsResponse - 9, // 14: buf.alpha.registry.v1alpha1.DisplayService.DisplayOwnerEntitledElements:output_type -> buf.alpha.registry.v1alpha1.DisplayOwnerEntitledElementsResponse - 11, // 15: buf.alpha.registry.v1alpha1.DisplayService.DisplayRepositoryEntitledElements:output_type -> buf.alpha.registry.v1alpha1.DisplayRepositoryEntitledElementsResponse - 13, // 16: buf.alpha.registry.v1alpha1.DisplayService.ListManageableRepositoryRoles:output_type -> buf.alpha.registry.v1alpha1.ListManageableRepositoryRolesResponse - 15, // 17: buf.alpha.registry.v1alpha1.DisplayService.ListManageableUserRepositoryRoles:output_type -> buf.alpha.registry.v1alpha1.ListManageableUserRepositoryRolesResponse - 10, // [10:18] is the sub-list for method output_type - 2, // [2:10] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_display_proto_init() } -func file_buf_alpha_registry_v1alpha1_display_proto_init() { - if File_buf_alpha_registry_v1alpha1_display_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_role_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayOrganizationElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayOrganizationElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayRepositoryElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayRepositoryElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayUserElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayUserElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayServerElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayServerElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayOwnerEntitledElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayOwnerEntitledElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayRepositoryEntitledElementsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DisplayRepositoryEntitledElementsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListManageableRepositoryRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListManageableRepositoryRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListManageableUserRepositoryRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_display_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListManageableUserRepositoryRolesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_display_proto_rawDesc, - NumEnums: 0, - NumMessages: 16, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_display_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_display_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_display_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_display_proto = out.File - file_buf_alpha_registry_v1alpha1_display_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_display_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_display_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/doc.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/doc.pb.go deleted file mode 100644 index c750795b7f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/doc.pb.go +++ /dev/null @@ -1,3468 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/doc.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GetSourceDirectoryInfoRequest takes an owner, repository, and reference. -type GetSourceDirectoryInfoRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *GetSourceDirectoryInfoRequest) Reset() { - *x = GetSourceDirectoryInfoRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSourceDirectoryInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSourceDirectoryInfoRequest) ProtoMessage() {} - -func (x *GetSourceDirectoryInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSourceDirectoryInfoRequest.ProtoReflect.Descriptor instead. -func (*GetSourceDirectoryInfoRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{0} -} - -func (x *GetSourceDirectoryInfoRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetSourceDirectoryInfoRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetSourceDirectoryInfoRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// GetSourceDirectoryInfoResponse returns the root FileInfo for the requested module. -type GetSourceDirectoryInfoResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Root *FileInfo `protobuf:"bytes,1,opt,name=root,proto3" json:"root,omitempty"` -} - -func (x *GetSourceDirectoryInfoResponse) Reset() { - *x = GetSourceDirectoryInfoResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSourceDirectoryInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSourceDirectoryInfoResponse) ProtoMessage() {} - -func (x *GetSourceDirectoryInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSourceDirectoryInfoResponse.ProtoReflect.Descriptor instead. -func (*GetSourceDirectoryInfoResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{1} -} - -func (x *GetSourceDirectoryInfoResponse) GetRoot() *FileInfo { - if x != nil { - return x.Root - } - return nil -} - -// FileInfo is a nested structure that contains the file path, whether or not it's a directory, -// and if so, the FileInfo children of that directory. -type FileInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // the normalized path of the directory, relative to the root of the module. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - IsDir bool `protobuf:"varint,2,opt,name=is_dir,json=isDir,proto3" json:"is_dir,omitempty"` - Children []*FileInfo `protobuf:"bytes,3,rep,name=children,proto3" json:"children,omitempty"` -} - -func (x *FileInfo) Reset() { - *x = FileInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileInfo) ProtoMessage() {} - -func (x *FileInfo) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileInfo.ProtoReflect.Descriptor instead. -func (*FileInfo) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{2} -} - -func (x *FileInfo) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *FileInfo) GetIsDir() bool { - if x != nil { - return x.IsDir - } - return false -} - -func (x *FileInfo) GetChildren() []*FileInfo { - if x != nil { - return x.Children - } - return nil -} - -// GetSourceFileRequest takes an owner, repository, reference, and normalized path. -type GetSourceFileRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` - // the normalized path to the requested file, relative to the root of the module. - Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *GetSourceFileRequest) Reset() { - *x = GetSourceFileRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSourceFileRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSourceFileRequest) ProtoMessage() {} - -func (x *GetSourceFileRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSourceFileRequest.ProtoReflect.Descriptor instead. -func (*GetSourceFileRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{3} -} - -func (x *GetSourceFileRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetSourceFileRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetSourceFileRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *GetSourceFileRequest) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// GetSourceFileResponse returns the source code contents of the requested file. -type GetSourceFileResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // content is the content of the file. - Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` -} - -func (x *GetSourceFileResponse) Reset() { - *x = GetSourceFileResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSourceFileResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSourceFileResponse) ProtoMessage() {} - -func (x *GetSourceFileResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSourceFileResponse.ProtoReflect.Descriptor instead. -func (*GetSourceFileResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{4} -} - -func (x *GetSourceFileResponse) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -// GetModulePackagesRequest takes an owner, repository, and reference. -type GetModulePackagesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *GetModulePackagesRequest) Reset() { - *x = GetModulePackagesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModulePackagesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModulePackagesRequest) ProtoMessage() {} - -func (x *GetModulePackagesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModulePackagesRequest.ProtoReflect.Descriptor instead. -func (*GetModulePackagesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{5} -} - -func (x *GetModulePackagesRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetModulePackagesRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetModulePackagesRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// GetModulePackagesResponse returns the list of ModulePackages for the requested module. -type GetModulePackagesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ModulePackages []*ModulePackage `protobuf:"bytes,2,rep,name=module_packages,json=modulePackages,proto3" json:"module_packages,omitempty"` -} - -func (x *GetModulePackagesResponse) Reset() { - *x = GetModulePackagesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModulePackagesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModulePackagesResponse) ProtoMessage() {} - -func (x *GetModulePackagesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModulePackagesResponse.ProtoReflect.Descriptor instead. -func (*GetModulePackagesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{6} -} - -func (x *GetModulePackagesResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetModulePackagesResponse) GetModulePackages() []*ModulePackage { - if x != nil { - return x.ModulePackages - } - return nil -} - -// ModulePackage provides the details about a module's associated package. -type ModulePackage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (x *ModulePackage) Reset() { - *x = ModulePackage{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModulePackage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModulePackage) ProtoMessage() {} - -func (x *ModulePackage) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModulePackage.ProtoReflect.Descriptor instead. -func (*ModulePackage) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{7} -} - -func (x *ModulePackage) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ModulePackage) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -// GetModuleDocumentationRequest takes an owner, repository, and reference. -type GetModuleDocumentationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *GetModuleDocumentationRequest) Reset() { - *x = GetModuleDocumentationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModuleDocumentationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModuleDocumentationRequest) ProtoMessage() {} - -func (x *GetModuleDocumentationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModuleDocumentationRequest.ProtoReflect.Descriptor instead. -func (*GetModuleDocumentationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{8} -} - -func (x *GetModuleDocumentationRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetModuleDocumentationRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetModuleDocumentationRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// GetModuleDocumentationResponse returns the ModuleDocumentation for the requested module. -type GetModuleDocumentationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ModuleDocumentation *ModuleDocumentation `protobuf:"bytes,1,opt,name=module_documentation,json=moduleDocumentation,proto3" json:"module_documentation,omitempty"` -} - -func (x *GetModuleDocumentationResponse) Reset() { - *x = GetModuleDocumentationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModuleDocumentationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModuleDocumentationResponse) ProtoMessage() {} - -func (x *GetModuleDocumentationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModuleDocumentationResponse.ProtoReflect.Descriptor instead. -func (*GetModuleDocumentationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{9} -} - -func (x *GetModuleDocumentationResponse) GetModuleDocumentation() *ModuleDocumentation { - if x != nil { - return x.ModuleDocumentation - } - return nil -} - -// ModuleDocumentation provides the name of the module and associated documentations. -type ModuleDocumentation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // This is the string representation of the contents of the buf.md file for module-level documentation. - // - // The buf.md file is a part of the module. - // string is used to enforce UTF-8 encoding or 7-bit ASCII text. - Documentation string `protobuf:"bytes,3,opt,name=documentation,proto3" json:"documentation,omitempty"` - // This is the string representation of the contents of the LICENSE file for module-level license. - // - // The LICENSE file is a part of the module. - // string is used to enforce UTF-8 encoding or 7-bit ASCII text. - License string `protobuf:"bytes,4,opt,name=license,proto3" json:"license,omitempty"` - // documentation_path is the path of the file which contains the module documentation. - // - // either `buf.md`, `README.md` or `README.markdown`. - // if empty, assumes buf.md. - DocumentationPath string `protobuf:"bytes,5,opt,name=documentation_path,json=documentationPath,proto3" json:"documentation_path,omitempty"` -} - -func (x *ModuleDocumentation) Reset() { - *x = ModuleDocumentation{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModuleDocumentation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModuleDocumentation) ProtoMessage() {} - -func (x *ModuleDocumentation) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModuleDocumentation.ProtoReflect.Descriptor instead. -func (*ModuleDocumentation) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{10} -} - -func (x *ModuleDocumentation) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ModuleDocumentation) GetDocumentation() string { - if x != nil { - return x.Documentation - } - return "" -} - -func (x *ModuleDocumentation) GetLicense() string { - if x != nil { - return x.License - } - return "" -} - -func (x *ModuleDocumentation) GetDocumentationPath() string { - if x != nil { - return x.DocumentationPath - } - return "" -} - -// GetPackageDocumentationRequest takes an owner, repository, reference, and package name. -type GetPackageDocumentationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` - // this is the fully qualified package name. - PackageName string `protobuf:"bytes,4,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"` -} - -func (x *GetPackageDocumentationRequest) Reset() { - *x = GetPackageDocumentationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPackageDocumentationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPackageDocumentationRequest) ProtoMessage() {} - -func (x *GetPackageDocumentationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPackageDocumentationRequest.ProtoReflect.Descriptor instead. -func (*GetPackageDocumentationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{11} -} - -func (x *GetPackageDocumentationRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetPackageDocumentationRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetPackageDocumentationRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *GetPackageDocumentationRequest) GetPackageName() string { - if x != nil { - return x.PackageName - } - return "" -} - -// GetPackageDocumentationReponse returns the documentation for the requested package. -type GetPackageDocumentationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PackageDocumentation *PackageDocumentation `protobuf:"bytes,1,opt,name=package_documentation,json=packageDocumentation,proto3" json:"package_documentation,omitempty"` -} - -func (x *GetPackageDocumentationResponse) Reset() { - *x = GetPackageDocumentationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPackageDocumentationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPackageDocumentationResponse) ProtoMessage() {} - -func (x *GetPackageDocumentationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPackageDocumentationResponse.ProtoReflect.Descriptor instead. -func (*GetPackageDocumentationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{12} -} - -func (x *GetPackageDocumentationResponse) GetPackageDocumentation() *PackageDocumentation { - if x != nil { - return x.PackageDocumentation - } - return nil -} - -// PackageDocumentation provides the name, description, and top level types defined in the package. -type PackageDocumentation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // description contains the package-level comment documentation. - // There is currently no convention for this. - // - // This is derived from the leading comments at the top level of the package. - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // services contains all the services defined in the package in alphabetical order. - Services []*Service `protobuf:"bytes,3,rep,name=services,proto3" json:"services,omitempty"` - // enums contains all the enums defined in the package in alphabetical order. - Enums []*Enum `protobuf:"bytes,4,rep,name=enums,proto3" json:"enums,omitempty"` - // messages contains all the messages defined in the package in alphabetical order. - Messages []*Message `protobuf:"bytes,5,rep,name=messages,proto3" json:"messages,omitempty"` - // extensions contains all the file level extensions in the package in alphabetical order. - FileExtensions []*FileExtension `protobuf:"bytes,6,rep,name=file_extensions,json=fileExtensions,proto3" json:"file_extensions,omitempty"` -} - -func (x *PackageDocumentation) Reset() { - *x = PackageDocumentation{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PackageDocumentation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PackageDocumentation) ProtoMessage() {} - -func (x *PackageDocumentation) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PackageDocumentation.ProtoReflect.Descriptor instead. -func (*PackageDocumentation) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{13} -} - -func (x *PackageDocumentation) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PackageDocumentation) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *PackageDocumentation) GetServices() []*Service { - if x != nil { - return x.Services - } - return nil -} - -func (x *PackageDocumentation) GetEnums() []*Enum { - if x != nil { - return x.Enums - } - return nil -} - -func (x *PackageDocumentation) GetMessages() []*Message { - if x != nil { - return x.Messages - } - return nil -} - -func (x *PackageDocumentation) GetFileExtensions() []*FileExtension { - if x != nil { - return x.FileExtensions - } - return nil -} - -// Location provides the location information for the source code. -// -// This does not provide the leading or trailing comments as these will -// be parsed into descriptions or dropped respectively. -type Location struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StartLine int32 `protobuf:"varint,1,opt,name=start_line,json=startLine,proto3" json:"start_line,omitempty"` - StartColumn int32 `protobuf:"varint,2,opt,name=start_column,json=startColumn,proto3" json:"start_column,omitempty"` - EndLine int32 `protobuf:"varint,3,opt,name=end_line,json=endLine,proto3" json:"end_line,omitempty"` - EndColumn int32 `protobuf:"varint,4,opt,name=end_column,json=endColumn,proto3" json:"end_column,omitempty"` -} - -func (x *Location) Reset() { - *x = Location{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Location) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Location) ProtoMessage() {} - -func (x *Location) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Location.ProtoReflect.Descriptor instead. -func (*Location) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{14} -} - -func (x *Location) GetStartLine() int32 { - if x != nil { - return x.StartLine - } - return 0 -} - -func (x *Location) GetStartColumn() int32 { - if x != nil { - return x.StartColumn - } - return 0 -} - -func (x *Location) GetEndLine() int32 { - if x != nil { - return x.EndLine - } - return 0 -} - -func (x *Location) GetEndColumn() int32 { - if x != nil { - return x.EndColumn - } - return 0 -} - -// Service provides information for the documentation for a given service type in a file. -type Service struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // nested_name includes the nested types for a given type definition. - NestedName string `protobuf:"bytes,2,opt,name=nested_name,json=nestedName,proto3" json:"nested_name,omitempty"` - // full_name includes the package name and nested types for a given type definition. - FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - // description is derived from the leading comments of a given service. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // file_path is the normalized path of the file containing the service. - // This is used for navigating to the source code for the service. - FilePath string `protobuf:"bytes,5,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` - Location *Location `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"` - Methods []*Method `protobuf:"bytes,7,rep,name=methods,proto3" json:"methods,omitempty"` - ServiceOptions *ServiceOptions `protobuf:"bytes,8,opt,name=service_options,json=serviceOptions,proto3" json:"service_options,omitempty"` - // implicitly_deprecated is true if its enclosing file is deprecated. - ImplicitlyDeprecated bool `protobuf:"varint,9,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3" json:"implicitly_deprecated,omitempty"` -} - -func (x *Service) Reset() { - *x = Service{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Service) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Service) ProtoMessage() {} - -func (x *Service) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Service.ProtoReflect.Descriptor instead. -func (*Service) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{15} -} - -func (x *Service) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Service) GetNestedName() string { - if x != nil { - return x.NestedName - } - return "" -} - -func (x *Service) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *Service) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Service) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -func (x *Service) GetLocation() *Location { - if x != nil { - return x.Location - } - return nil -} - -func (x *Service) GetMethods() []*Method { - if x != nil { - return x.Methods - } - return nil -} - -func (x *Service) GetServiceOptions() *ServiceOptions { - if x != nil { - return x.ServiceOptions - } - return nil -} - -func (x *Service) GetImplicitlyDeprecated() bool { - if x != nil { - return x.ImplicitlyDeprecated - } - return false -} - -// ServiceOptions provides information for the documentation of options for a given service. -type ServiceOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *ServiceOptions) Reset() { - *x = ServiceOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceOptions) ProtoMessage() {} - -func (x *ServiceOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceOptions.ProtoReflect.Descriptor instead. -func (*ServiceOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{16} -} - -func (x *ServiceOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// Method provides information for the documentation for a method of a given service. -type Method struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // description is derived from the leading comments of a given method. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Request *MethodRequestResponse `protobuf:"bytes,3,opt,name=request,proto3" json:"request,omitempty"` - Response *MethodRequestResponse `protobuf:"bytes,4,opt,name=response,proto3" json:"response,omitempty"` - MethodOptions *MethodOptions `protobuf:"bytes,5,opt,name=method_options,json=methodOptions,proto3" json:"method_options,omitempty"` - // implicitly_deprecated is true if its enclosing file or parent element is deprecated. - ImplicitlyDeprecated bool `protobuf:"varint,6,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3" json:"implicitly_deprecated,omitempty"` -} - -func (x *Method) Reset() { - *x = Method{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Method) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Method) ProtoMessage() {} - -func (x *Method) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Method.ProtoReflect.Descriptor instead. -func (*Method) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{17} -} - -func (x *Method) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Method) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Method) GetRequest() *MethodRequestResponse { - if x != nil { - return x.Request - } - return nil -} - -func (x *Method) GetResponse() *MethodRequestResponse { - if x != nil { - return x.Response - } - return nil -} - -func (x *Method) GetMethodOptions() *MethodOptions { - if x != nil { - return x.MethodOptions - } - return nil -} - -func (x *Method) GetImplicitlyDeprecated() bool { - if x != nil { - return x.ImplicitlyDeprecated - } - return false -} - -// MethodOptions provides information for the documentation of options for a method. -type MethodOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // idempotency_level holds a value of the enumeration `google.protobuf.MethodOptions.IdempotencyLevel. - IdempotencyLevel int32 `protobuf:"varint,2,opt,name=idempotency_level,json=idempotencyLevel,proto3" json:"idempotency_level,omitempty"` -} - -func (x *MethodOptions) Reset() { - *x = MethodOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodOptions) ProtoMessage() {} - -func (x *MethodOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MethodOptions.ProtoReflect.Descriptor instead. -func (*MethodOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{18} -} - -func (x *MethodOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *MethodOptions) GetIdempotencyLevel() int32 { - if x != nil { - return x.IdempotencyLevel - } - return 0 -} - -// MethodRequestResponse provides information for the documentation of a Method request or response message. -type MethodRequestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // nested_type is the nested name of the message of the request or response. This includes nested definitions. - NestedType string `protobuf:"bytes,1,opt,name=nested_type,json=nestedType,proto3" json:"nested_type,omitempty"` - // full_type is the fully qualified name of the message of the request or response. This includes package and nested definitions. - FullType string `protobuf:"bytes,2,opt,name=full_type,json=fullType,proto3" json:"full_type,omitempty"` - // boolean flag for whether the streaming label is set on an method request or response. - Streaming bool `protobuf:"varint,3,opt,name=streaming,proto3" json:"streaming,omitempty"` - Message *Message `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` - // import_module_ref is included if the request or response is an imported type. - // It contains all the metadata for the import. - ImportModuleRef *ImportModuleRef `protobuf:"bytes,5,opt,name=import_module_ref,json=importModuleRef,proto3" json:"import_module_ref,omitempty"` -} - -func (x *MethodRequestResponse) Reset() { - *x = MethodRequestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MethodRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MethodRequestResponse) ProtoMessage() {} - -func (x *MethodRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MethodRequestResponse.ProtoReflect.Descriptor instead. -func (*MethodRequestResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{19} -} - -func (x *MethodRequestResponse) GetNestedType() string { - if x != nil { - return x.NestedType - } - return "" -} - -func (x *MethodRequestResponse) GetFullType() string { - if x != nil { - return x.FullType - } - return "" -} - -func (x *MethodRequestResponse) GetStreaming() bool { - if x != nil { - return x.Streaming - } - return false -} - -func (x *MethodRequestResponse) GetMessage() *Message { - if x != nil { - return x.Message - } - return nil -} - -func (x *MethodRequestResponse) GetImportModuleRef() *ImportModuleRef { - if x != nil { - return x.ImportModuleRef - } - return nil -} - -// Enum provides information for the documentation of an enum. -type Enum struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // nested_name includes the nested types for a given type definition. - NestedName string `protobuf:"bytes,2,opt,name=nested_name,json=nestedName,proto3" json:"nested_name,omitempty"` - // full_name includes the package name and nested types for a given type definition. - FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - // description is derived from the leading comments of a given Enum. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // file_path is the normalized path of the file containing the enum. - FilePath string `protobuf:"bytes,5,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` - Location *Location `protobuf:"bytes,6,opt,name=location,proto3" json:"location,omitempty"` - Values []*EnumValue `protobuf:"bytes,7,rep,name=values,proto3" json:"values,omitempty"` - EnumOptions *EnumOptions `protobuf:"bytes,8,opt,name=enum_options,json=enumOptions,proto3" json:"enum_options,omitempty"` - // implicitly_deprecated is true if its enclosing file or parent element is deprecated. - ImplicitlyDeprecated bool `protobuf:"varint,9,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3" json:"implicitly_deprecated,omitempty"` -} - -func (x *Enum) Reset() { - *x = Enum{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Enum) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Enum) ProtoMessage() {} - -func (x *Enum) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Enum.ProtoReflect.Descriptor instead. -func (*Enum) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{20} -} - -func (x *Enum) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Enum) GetNestedName() string { - if x != nil { - return x.NestedName - } - return "" -} - -func (x *Enum) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *Enum) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Enum) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -func (x *Enum) GetLocation() *Location { - if x != nil { - return x.Location - } - return nil -} - -func (x *Enum) GetValues() []*EnumValue { - if x != nil { - return x.Values - } - return nil -} - -func (x *Enum) GetEnumOptions() *EnumOptions { - if x != nil { - return x.EnumOptions - } - return nil -} - -func (x *Enum) GetImplicitlyDeprecated() bool { - if x != nil { - return x.ImplicitlyDeprecated - } - return false -} - -// EnumOptions provides information for the documentation of options for an enum. -type EnumOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - AllowAlias bool `protobuf:"varint,2,opt,name=allow_alias,json=allowAlias,proto3" json:"allow_alias,omitempty"` -} - -func (x *EnumOptions) Reset() { - *x = EnumOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnumOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnumOptions) ProtoMessage() {} - -func (x *EnumOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnumOptions.ProtoReflect.Descriptor instead. -func (*EnumOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{21} -} - -func (x *EnumOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *EnumOptions) GetAllowAlias() bool { - if x != nil { - return x.AllowAlias - } - return false -} - -// EnumValue provides information for the documentation of an enum value. -type EnumValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Number int32 `protobuf:"varint,2,opt,name=number,proto3" json:"number,omitempty"` - // description is derived from the leading comments of a given enum value. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - EnumValueOptions *EnumValueOptions `protobuf:"bytes,4,opt,name=enum_value_options,json=enumValueOptions,proto3" json:"enum_value_options,omitempty"` -} - -func (x *EnumValue) Reset() { - *x = EnumValue{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnumValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnumValue) ProtoMessage() {} - -func (x *EnumValue) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnumValue.ProtoReflect.Descriptor instead. -func (*EnumValue) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{22} -} - -func (x *EnumValue) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *EnumValue) GetNumber() int32 { - if x != nil { - return x.Number - } - return 0 -} - -func (x *EnumValue) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *EnumValue) GetEnumValueOptions() *EnumValueOptions { - if x != nil { - return x.EnumValueOptions - } - return nil -} - -// EnumValueOptions provides information for the documentation of options for an enum value. -type EnumValueOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *EnumValueOptions) Reset() { - *x = EnumValueOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnumValueOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnumValueOptions) ProtoMessage() {} - -func (x *EnumValueOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EnumValueOptions.ProtoReflect.Descriptor instead. -func (*EnumValueOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{23} -} - -func (x *EnumValueOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// ImportRef provides the import metadata if a type is imported. -type ImportModuleRef struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Remote string `protobuf:"bytes,1,opt,name=remote,proto3" json:"remote,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,3,opt,name=repository,proto3" json:"repository,omitempty"` - // the commit is based on the module commit of the imported type provided - // by the image. - Commit string `protobuf:"bytes,4,opt,name=commit,proto3" json:"commit,omitempty"` - PackageName string `protobuf:"bytes,5,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"` -} - -func (x *ImportModuleRef) Reset() { - *x = ImportModuleRef{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ImportModuleRef) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ImportModuleRef) ProtoMessage() {} - -func (x *ImportModuleRef) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ImportModuleRef.ProtoReflect.Descriptor instead. -func (*ImportModuleRef) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{24} -} - -func (x *ImportModuleRef) GetRemote() string { - if x != nil { - return x.Remote - } - return "" -} - -func (x *ImportModuleRef) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ImportModuleRef) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *ImportModuleRef) GetCommit() string { - if x != nil { - return x.Commit - } - return "" -} - -func (x *ImportModuleRef) GetPackageName() string { - if x != nil { - return x.PackageName - } - return "" -} - -// Message provides information for the documentation of a protobuf message. -type Message struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // nested_name includes the nested types for a given type definition. - NestedName string `protobuf:"bytes,2,opt,name=nested_name,json=nestedName,proto3" json:"nested_name,omitempty"` - // full_name includes the package name and nested types for a given type definition. - FullName string `protobuf:"bytes,3,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - // description is derived from the leading comments of a given message. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - // file_path is the normalized path of the file containing the message. - FilePath string `protobuf:"bytes,5,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` - IsMapEntry bool `protobuf:"varint,6,opt,name=is_map_entry,json=isMapEntry,proto3" json:"is_map_entry,omitempty"` - Fields []*MessageField `protobuf:"bytes,7,rep,name=fields,proto3" json:"fields,omitempty"` - Location *Location `protobuf:"bytes,8,opt,name=location,proto3" json:"location,omitempty"` - MessageExtensions []*Field `protobuf:"bytes,9,rep,name=message_extensions,json=messageExtensions,proto3" json:"message_extensions,omitempty"` - MessageOptions *MessageOptions `protobuf:"bytes,10,opt,name=message_options,json=messageOptions,proto3" json:"message_options,omitempty"` - // implicitly_deprecated is true if its enclosing file or parent element is deprecated. - ImplicitlyDeprecated bool `protobuf:"varint,11,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3" json:"implicitly_deprecated,omitempty"` -} - -func (x *Message) Reset() { - *x = Message{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Message) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Message) ProtoMessage() {} - -func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Message.ProtoReflect.Descriptor instead. -func (*Message) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{25} -} - -func (x *Message) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Message) GetNestedName() string { - if x != nil { - return x.NestedName - } - return "" -} - -func (x *Message) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *Message) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Message) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -func (x *Message) GetIsMapEntry() bool { - if x != nil { - return x.IsMapEntry - } - return false -} - -func (x *Message) GetFields() []*MessageField { - if x != nil { - return x.Fields - } - return nil -} - -func (x *Message) GetLocation() *Location { - if x != nil { - return x.Location - } - return nil -} - -func (x *Message) GetMessageExtensions() []*Field { - if x != nil { - return x.MessageExtensions - } - return nil -} - -func (x *Message) GetMessageOptions() *MessageOptions { - if x != nil { - return x.MessageOptions - } - return nil -} - -func (x *Message) GetImplicitlyDeprecated() bool { - if x != nil { - return x.ImplicitlyDeprecated - } - return false -} - -// MessageField can be either a single field or a oneof set of fields. -type MessageField struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to MessageField: - // - // *MessageField_Field - // *MessageField_Oneof - MessageField isMessageField_MessageField `protobuf_oneof:"message_field"` -} - -func (x *MessageField) Reset() { - *x = MessageField{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageField) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageField) ProtoMessage() {} - -func (x *MessageField) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageField.ProtoReflect.Descriptor instead. -func (*MessageField) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{26} -} - -func (m *MessageField) GetMessageField() isMessageField_MessageField { - if m != nil { - return m.MessageField - } - return nil -} - -func (x *MessageField) GetField() *Field { - if x, ok := x.GetMessageField().(*MessageField_Field); ok { - return x.Field - } - return nil -} - -func (x *MessageField) GetOneof() *Oneof { - if x, ok := x.GetMessageField().(*MessageField_Oneof); ok { - return x.Oneof - } - return nil -} - -type isMessageField_MessageField interface { - isMessageField_MessageField() -} - -type MessageField_Field struct { - Field *Field `protobuf:"bytes,1,opt,name=field,proto3,oneof"` -} - -type MessageField_Oneof struct { - Oneof *Oneof `protobuf:"bytes,2,opt,name=oneof,proto3,oneof"` -} - -func (*MessageField_Field) isMessageField_MessageField() {} - -func (*MessageField_Oneof) isMessageField_MessageField() {} - -// MessageOptions provides information for the documentation of options for a message. -type MessageOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *MessageOptions) Reset() { - *x = MessageOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageOptions) ProtoMessage() {} - -func (x *MessageOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageOptions.ProtoReflect.Descriptor instead. -func (*MessageOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{27} -} - -func (x *MessageOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// Oneof represents a oneof set of fields. -type Oneof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Fields []*Field `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields,omitempty"` -} - -func (x *Oneof) Reset() { - *x = Oneof{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Oneof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Oneof) ProtoMessage() {} - -func (x *Oneof) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Oneof.ProtoReflect.Descriptor instead. -func (*Oneof) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{28} -} - -func (x *Oneof) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Oneof) GetFields() []*Field { - if x != nil { - return x.Fields - } - return nil -} - -// Field provides information for the documentation of a message field. -type Field struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // description is derived from the leading comments of a given message field. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` - // string representation of the nested name of the field type, which includes nested definitions. - NestedType string `protobuf:"bytes,4,opt,name=nested_type,json=nestedType,proto3" json:"nested_type,omitempty"` - // string representation of the full name of the field type, which includes package name - // and nested definitions. - FullType string `protobuf:"bytes,5,opt,name=full_type,json=fullType,proto3" json:"full_type,omitempty"` - Tag uint32 `protobuf:"varint,6,opt,name=tag,proto3" json:"tag,omitempty"` - // MapEntry is present if the field is a map type. - MapEntry *MapEntry `protobuf:"bytes,7,opt,name=map_entry,json=mapEntry,proto3" json:"map_entry,omitempty"` - // import_module_ref is included if the field is an imported type. - // It contains all the metadata for the import. - ImportModuleRef *ImportModuleRef `protobuf:"bytes,8,opt,name=import_module_ref,json=importModuleRef,proto3" json:"import_module_ref,omitempty"` - // Extendee is the name of the type that is being extended if the field is an extension. - // This is an empty string for fields that are not extenions. - Extendee string `protobuf:"bytes,9,opt,name=extendee,proto3" json:"extendee,omitempty"` - FieldOptions *FieldOptions `protobuf:"bytes,10,opt,name=field_options,json=fieldOptions,proto3" json:"field_options,omitempty"` -} - -func (x *Field) Reset() { - *x = Field{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Field) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Field) ProtoMessage() {} - -func (x *Field) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Field.ProtoReflect.Descriptor instead. -func (*Field) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{29} -} - -func (x *Field) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Field) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Field) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -func (x *Field) GetNestedType() string { - if x != nil { - return x.NestedType - } - return "" -} - -func (x *Field) GetFullType() string { - if x != nil { - return x.FullType - } - return "" -} - -func (x *Field) GetTag() uint32 { - if x != nil { - return x.Tag - } - return 0 -} - -func (x *Field) GetMapEntry() *MapEntry { - if x != nil { - return x.MapEntry - } - return nil -} - -func (x *Field) GetImportModuleRef() *ImportModuleRef { - if x != nil { - return x.ImportModuleRef - } - return nil -} - -func (x *Field) GetExtendee() string { - if x != nil { - return x.Extendee - } - return "" -} - -func (x *Field) GetFieldOptions() *FieldOptions { - if x != nil { - return x.FieldOptions - } - return nil -} - -// FieldOptions provides information for the documentation of options for a field. -type FieldOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Deprecated bool `protobuf:"varint,1,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - Packed *bool `protobuf:"varint,2,opt,name=packed,proto3,oneof" json:"packed,omitempty"` - // ctype holds a value of the enumeration `google.protobuf.FieldOptions.CType. - Ctype int32 `protobuf:"varint,3,opt,name=ctype,proto3" json:"ctype,omitempty"` - // jstype holds a value of the enumeration `google.protobuf.FieldOptions.JSType. - Jstype int32 `protobuf:"varint,4,opt,name=jstype,proto3" json:"jstype,omitempty"` -} - -func (x *FieldOptions) Reset() { - *x = FieldOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FieldOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FieldOptions) ProtoMessage() {} - -func (x *FieldOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FieldOptions.ProtoReflect.Descriptor instead. -func (*FieldOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{30} -} - -func (x *FieldOptions) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *FieldOptions) GetPacked() bool { - if x != nil && x.Packed != nil { - return *x.Packed - } - return false -} - -func (x *FieldOptions) GetCtype() int32 { - if x != nil { - return x.Ctype - } - return 0 -} - -func (x *FieldOptions) GetJstype() int32 { - if x != nil { - return x.Jstype - } - return 0 -} - -// MapEntry provides the key and value types for the MapEntry type for a map field. -type MapEntry struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // string representation of the full name of the type for the map key. keys can only be - // scalar types: https://developers.google.com/protocol-buffers/docs/overview#maps - KeyFullType string `protobuf:"bytes,1,opt,name=key_full_type,json=keyFullType,proto3" json:"key_full_type,omitempty"` - // string representation of the nested name of the type for the map value. - ValueNestedType string `protobuf:"bytes,2,opt,name=value_nested_type,json=valueNestedType,proto3" json:"value_nested_type,omitempty"` - // string representation of the full name of the type for the map value. - ValueFullType string `protobuf:"bytes,3,opt,name=value_full_type,json=valueFullType,proto3" json:"value_full_type,omitempty"` - // if the value is an imported type, this is the import module ref - ValueImportModuleRef *ImportModuleRef `protobuf:"bytes,4,opt,name=value_import_module_ref,json=valueImportModuleRef,proto3" json:"value_import_module_ref,omitempty"` -} - -func (x *MapEntry) Reset() { - *x = MapEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MapEntry) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MapEntry) ProtoMessage() {} - -func (x *MapEntry) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MapEntry.ProtoReflect.Descriptor instead. -func (*MapEntry) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{31} -} - -func (x *MapEntry) GetKeyFullType() string { - if x != nil { - return x.KeyFullType - } - return "" -} - -func (x *MapEntry) GetValueNestedType() string { - if x != nil { - return x.ValueNestedType - } - return "" -} - -func (x *MapEntry) GetValueFullType() string { - if x != nil { - return x.ValueFullType - } - return "" -} - -func (x *MapEntry) GetValueImportModuleRef() *ImportModuleRef { - if x != nil { - return x.ValueImportModuleRef - } - return nil -} - -// FileExtension provides the information for the documentation of a file extension. -type FileExtension struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // extension_type is the string representation of the type being extended. - ExtensionType string `protobuf:"bytes,1,opt,name=extension_type,json=extensionType,proto3" json:"extension_type,omitempty"` - // description is derived from the leading comments of a given message field. - // - // Paragraph newlines (double new lines) are respected, however single newlines are not. - // Note that any leading and trailing `//` or spaces within a `/* */` block will be stripped. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // file_path is the normalized path of the file containing the message. - FilePath string `protobuf:"bytes,3,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"` - Location *Location `protobuf:"bytes,4,opt,name=location,proto3" json:"location,omitempty"` - // fields are all the fields that are associated with the extension. - Fields []*Field `protobuf:"bytes,5,rep,name=fields,proto3" json:"fields,omitempty"` - // implicitly_deprecated is true if its enclosing file or parent element is deprecated. - ImplicitlyDeprecated bool `protobuf:"varint,6,opt,name=implicitly_deprecated,json=implicitlyDeprecated,proto3" json:"implicitly_deprecated,omitempty"` -} - -func (x *FileExtension) Reset() { - *x = FileExtension{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileExtension) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileExtension) ProtoMessage() {} - -func (x *FileExtension) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileExtension.ProtoReflect.Descriptor instead. -func (*FileExtension) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP(), []int{32} -} - -func (x *FileExtension) GetExtensionType() string { - if x != nil { - return x.ExtensionType - } - return "" -} - -func (x *FileExtension) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *FileExtension) GetFilePath() string { - if x != nil { - return x.FilePath - } - return "" -} - -func (x *FileExtension) GetLocation() *Location { - if x != nil { - return x.Location - } - return nil -} - -func (x *FileExtension) GetFields() []*Field { - if x != nil { - return x.Fields - } - return nil -} - -func (x *FileExtension) GetImplicitlyDeprecated() bool { - if x != nil { - return x.ImplicitlyDeprecated - } - return false -} - -var File_buf_alpha_registry_v1alpha1_doc_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc = []byte{ - 0x0a, 0x25, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x6f, - 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x22, 0x73, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x5b, 0x0a, 0x1e, 0x47, 0x65, 0x74, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x04, 0x72, - 0x6f, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x22, 0x78, 0x0a, 0x08, 0x46, 0x69, 0x6c, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x64, 0x69, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x69, 0x73, 0x44, 0x69, 0x72, 0x12, 0x41, 0x0a, - 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, - 0x22, 0x7e, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, - 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, - 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x22, 0x31, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x22, 0x6e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0x45, 0x0a, 0x0d, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x73, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x85, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x63, 0x0a, 0x14, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x98, - 0x01, 0x0a, 0x13, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x64, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, 0x22, 0x97, 0x01, 0x0a, 0x1e, 0x47, 0x65, - 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x15, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x5f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, - 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x14, 0x70, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, - 0xde, 0x02, 0x0a, 0x14, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, - 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, - 0x0a, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x08, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x12, 0x37, 0x0a, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, - 0x75, 0x6d, 0x52, 0x05, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x08, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x0f, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x86, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, - 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x12, - 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x6e, - 0x64, 0x5f, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x65, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x22, 0xa7, 0x03, 0x0a, 0x07, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, - 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, - 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x41, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x07, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, - 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x54, 0x0a, 0x0f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, - 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x5f, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, - 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x22, 0x30, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0xe4, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x07, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x69, - 0x63, 0x69, 0x74, 0x6c, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, - 0x6c, 0x79, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x5c, 0x0a, 0x0d, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2b, 0x0a, - 0x11, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, - 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x8d, 0x02, 0x0a, 0x15, 0x4d, - 0x65, 0x74, 0x68, 0x6f, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x12, 0x3e, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x58, 0x0a, 0x11, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x0f, 0x69, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x22, 0x9c, 0x03, 0x0a, 0x04, 0x45, - 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, - 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, - 0x50, 0x61, 0x74, 0x68, 0x12, 0x41, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x5f, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, - 0x6c, 0x79, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x14, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x44, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x4e, 0x0a, 0x0b, 0x45, 0x6e, 0x75, - 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, - 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, - 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x09, 0x45, 0x6e, - 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, 0x0a, 0x12, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x10, 0x65, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x22, 0x32, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0f, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, - 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0xa0, 0x04, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, - 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x41, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x41, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, - 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x12, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x11, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x54, 0x0a, 0x0f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x5f, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x14, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x44, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x97, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x3a, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x48, 0x00, 0x52, 0x05, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x12, 0x3a, 0x0a, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x48, 0x00, 0x52, 0x05, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x42, - 0x0f, 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x22, 0x30, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x22, 0x57, 0x0a, 0x05, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x3a, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0xad, 0x03, 0x0a, 0x05, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x10, 0x0a, 0x03, 0x74, 0x61, 0x67, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x74, 0x61, - 0x67, 0x12, 0x42, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x6d, 0x61, 0x70, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x58, 0x0a, 0x11, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, - 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x0f, - 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x12, - 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, 0x12, 0x4e, 0x0a, 0x0d, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x0c, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x0c, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1e, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x06, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x06, - 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x70, 0x61, 0x63, 0x6b, - 0x65, 0x64, 0x22, 0xe7, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x22, 0x0a, 0x0d, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6b, 0x65, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x6e, 0x65, 0x73, - 0x74, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x26, 0x0a, 0x0f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x46, - 0x75, 0x6c, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x63, 0x0a, 0x17, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x72, - 0x65, 0x66, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x52, 0x14, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x49, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x22, 0xa9, 0x02, 0x0a, - 0x0d, 0x46, 0x69, 0x6c, 0x65, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, - 0x0a, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, - 0x50, 0x61, 0x74, 0x68, 0x12, 0x41, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, 0x65, - 0x6c, 0x64, 0x73, 0x12, 0x33, 0x0a, 0x15, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, - 0x79, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x14, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x6c, 0x79, 0x44, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x32, 0xe1, 0x05, 0x0a, 0x0a, 0x44, 0x6f, 0x63, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x6e, - 0x66, 0x6f, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x7b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, - 0x65, 0x12, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x87, 0x01, - 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, - 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x99, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, - 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x61, - 0x67, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x95, 0x02, 0x0a, - 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x42, 0x08, 0x44, 0x6f, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, - 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, - 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_doc_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_doc_proto_rawDescData = file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_doc_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_doc_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_doc_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_doc_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_doc_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes = make([]protoimpl.MessageInfo, 33) -var file_buf_alpha_registry_v1alpha1_doc_proto_goTypes = []interface{}{ - (*GetSourceDirectoryInfoRequest)(nil), // 0: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoRequest - (*GetSourceDirectoryInfoResponse)(nil), // 1: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse - (*FileInfo)(nil), // 2: buf.alpha.registry.v1alpha1.FileInfo - (*GetSourceFileRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GetSourceFileRequest - (*GetSourceFileResponse)(nil), // 4: buf.alpha.registry.v1alpha1.GetSourceFileResponse - (*GetModulePackagesRequest)(nil), // 5: buf.alpha.registry.v1alpha1.GetModulePackagesRequest - (*GetModulePackagesResponse)(nil), // 6: buf.alpha.registry.v1alpha1.GetModulePackagesResponse - (*ModulePackage)(nil), // 7: buf.alpha.registry.v1alpha1.ModulePackage - (*GetModuleDocumentationRequest)(nil), // 8: buf.alpha.registry.v1alpha1.GetModuleDocumentationRequest - (*GetModuleDocumentationResponse)(nil), // 9: buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse - (*ModuleDocumentation)(nil), // 10: buf.alpha.registry.v1alpha1.ModuleDocumentation - (*GetPackageDocumentationRequest)(nil), // 11: buf.alpha.registry.v1alpha1.GetPackageDocumentationRequest - (*GetPackageDocumentationResponse)(nil), // 12: buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse - (*PackageDocumentation)(nil), // 13: buf.alpha.registry.v1alpha1.PackageDocumentation - (*Location)(nil), // 14: buf.alpha.registry.v1alpha1.Location - (*Service)(nil), // 15: buf.alpha.registry.v1alpha1.Service - (*ServiceOptions)(nil), // 16: buf.alpha.registry.v1alpha1.ServiceOptions - (*Method)(nil), // 17: buf.alpha.registry.v1alpha1.Method - (*MethodOptions)(nil), // 18: buf.alpha.registry.v1alpha1.MethodOptions - (*MethodRequestResponse)(nil), // 19: buf.alpha.registry.v1alpha1.MethodRequestResponse - (*Enum)(nil), // 20: buf.alpha.registry.v1alpha1.Enum - (*EnumOptions)(nil), // 21: buf.alpha.registry.v1alpha1.EnumOptions - (*EnumValue)(nil), // 22: buf.alpha.registry.v1alpha1.EnumValue - (*EnumValueOptions)(nil), // 23: buf.alpha.registry.v1alpha1.EnumValueOptions - (*ImportModuleRef)(nil), // 24: buf.alpha.registry.v1alpha1.ImportModuleRef - (*Message)(nil), // 25: buf.alpha.registry.v1alpha1.Message - (*MessageField)(nil), // 26: buf.alpha.registry.v1alpha1.MessageField - (*MessageOptions)(nil), // 27: buf.alpha.registry.v1alpha1.MessageOptions - (*Oneof)(nil), // 28: buf.alpha.registry.v1alpha1.Oneof - (*Field)(nil), // 29: buf.alpha.registry.v1alpha1.Field - (*FieldOptions)(nil), // 30: buf.alpha.registry.v1alpha1.FieldOptions - (*MapEntry)(nil), // 31: buf.alpha.registry.v1alpha1.MapEntry - (*FileExtension)(nil), // 32: buf.alpha.registry.v1alpha1.FileExtension -} -var file_buf_alpha_registry_v1alpha1_doc_proto_depIdxs = []int32{ - 2, // 0: buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse.root:type_name -> buf.alpha.registry.v1alpha1.FileInfo - 2, // 1: buf.alpha.registry.v1alpha1.FileInfo.children:type_name -> buf.alpha.registry.v1alpha1.FileInfo - 7, // 2: buf.alpha.registry.v1alpha1.GetModulePackagesResponse.module_packages:type_name -> buf.alpha.registry.v1alpha1.ModulePackage - 10, // 3: buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse.module_documentation:type_name -> buf.alpha.registry.v1alpha1.ModuleDocumentation - 13, // 4: buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse.package_documentation:type_name -> buf.alpha.registry.v1alpha1.PackageDocumentation - 15, // 5: buf.alpha.registry.v1alpha1.PackageDocumentation.services:type_name -> buf.alpha.registry.v1alpha1.Service - 20, // 6: buf.alpha.registry.v1alpha1.PackageDocumentation.enums:type_name -> buf.alpha.registry.v1alpha1.Enum - 25, // 7: buf.alpha.registry.v1alpha1.PackageDocumentation.messages:type_name -> buf.alpha.registry.v1alpha1.Message - 32, // 8: buf.alpha.registry.v1alpha1.PackageDocumentation.file_extensions:type_name -> buf.alpha.registry.v1alpha1.FileExtension - 14, // 9: buf.alpha.registry.v1alpha1.Service.location:type_name -> buf.alpha.registry.v1alpha1.Location - 17, // 10: buf.alpha.registry.v1alpha1.Service.methods:type_name -> buf.alpha.registry.v1alpha1.Method - 16, // 11: buf.alpha.registry.v1alpha1.Service.service_options:type_name -> buf.alpha.registry.v1alpha1.ServiceOptions - 19, // 12: buf.alpha.registry.v1alpha1.Method.request:type_name -> buf.alpha.registry.v1alpha1.MethodRequestResponse - 19, // 13: buf.alpha.registry.v1alpha1.Method.response:type_name -> buf.alpha.registry.v1alpha1.MethodRequestResponse - 18, // 14: buf.alpha.registry.v1alpha1.Method.method_options:type_name -> buf.alpha.registry.v1alpha1.MethodOptions - 25, // 15: buf.alpha.registry.v1alpha1.MethodRequestResponse.message:type_name -> buf.alpha.registry.v1alpha1.Message - 24, // 16: buf.alpha.registry.v1alpha1.MethodRequestResponse.import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef - 14, // 17: buf.alpha.registry.v1alpha1.Enum.location:type_name -> buf.alpha.registry.v1alpha1.Location - 22, // 18: buf.alpha.registry.v1alpha1.Enum.values:type_name -> buf.alpha.registry.v1alpha1.EnumValue - 21, // 19: buf.alpha.registry.v1alpha1.Enum.enum_options:type_name -> buf.alpha.registry.v1alpha1.EnumOptions - 23, // 20: buf.alpha.registry.v1alpha1.EnumValue.enum_value_options:type_name -> buf.alpha.registry.v1alpha1.EnumValueOptions - 26, // 21: buf.alpha.registry.v1alpha1.Message.fields:type_name -> buf.alpha.registry.v1alpha1.MessageField - 14, // 22: buf.alpha.registry.v1alpha1.Message.location:type_name -> buf.alpha.registry.v1alpha1.Location - 29, // 23: buf.alpha.registry.v1alpha1.Message.message_extensions:type_name -> buf.alpha.registry.v1alpha1.Field - 27, // 24: buf.alpha.registry.v1alpha1.Message.message_options:type_name -> buf.alpha.registry.v1alpha1.MessageOptions - 29, // 25: buf.alpha.registry.v1alpha1.MessageField.field:type_name -> buf.alpha.registry.v1alpha1.Field - 28, // 26: buf.alpha.registry.v1alpha1.MessageField.oneof:type_name -> buf.alpha.registry.v1alpha1.Oneof - 29, // 27: buf.alpha.registry.v1alpha1.Oneof.fields:type_name -> buf.alpha.registry.v1alpha1.Field - 31, // 28: buf.alpha.registry.v1alpha1.Field.map_entry:type_name -> buf.alpha.registry.v1alpha1.MapEntry - 24, // 29: buf.alpha.registry.v1alpha1.Field.import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef - 30, // 30: buf.alpha.registry.v1alpha1.Field.field_options:type_name -> buf.alpha.registry.v1alpha1.FieldOptions - 24, // 31: buf.alpha.registry.v1alpha1.MapEntry.value_import_module_ref:type_name -> buf.alpha.registry.v1alpha1.ImportModuleRef - 14, // 32: buf.alpha.registry.v1alpha1.FileExtension.location:type_name -> buf.alpha.registry.v1alpha1.Location - 29, // 33: buf.alpha.registry.v1alpha1.FileExtension.fields:type_name -> buf.alpha.registry.v1alpha1.Field - 0, // 34: buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo:input_type -> buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoRequest - 3, // 35: buf.alpha.registry.v1alpha1.DocService.GetSourceFile:input_type -> buf.alpha.registry.v1alpha1.GetSourceFileRequest - 5, // 36: buf.alpha.registry.v1alpha1.DocService.GetModulePackages:input_type -> buf.alpha.registry.v1alpha1.GetModulePackagesRequest - 8, // 37: buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation:input_type -> buf.alpha.registry.v1alpha1.GetModuleDocumentationRequest - 11, // 38: buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation:input_type -> buf.alpha.registry.v1alpha1.GetPackageDocumentationRequest - 1, // 39: buf.alpha.registry.v1alpha1.DocService.GetSourceDirectoryInfo:output_type -> buf.alpha.registry.v1alpha1.GetSourceDirectoryInfoResponse - 4, // 40: buf.alpha.registry.v1alpha1.DocService.GetSourceFile:output_type -> buf.alpha.registry.v1alpha1.GetSourceFileResponse - 6, // 41: buf.alpha.registry.v1alpha1.DocService.GetModulePackages:output_type -> buf.alpha.registry.v1alpha1.GetModulePackagesResponse - 9, // 42: buf.alpha.registry.v1alpha1.DocService.GetModuleDocumentation:output_type -> buf.alpha.registry.v1alpha1.GetModuleDocumentationResponse - 12, // 43: buf.alpha.registry.v1alpha1.DocService.GetPackageDocumentation:output_type -> buf.alpha.registry.v1alpha1.GetPackageDocumentationResponse - 39, // [39:44] is the sub-list for method output_type - 34, // [34:39] is the sub-list for method input_type - 34, // [34:34] is the sub-list for extension type_name - 34, // [34:34] is the sub-list for extension extendee - 0, // [0:34] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_doc_proto_init() } -func file_buf_alpha_registry_v1alpha1_doc_proto_init() { - if File_buf_alpha_registry_v1alpha1_doc_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSourceDirectoryInfoRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSourceDirectoryInfoResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSourceFileRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSourceFileResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModulePackagesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModulePackagesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModulePackage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModuleDocumentationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModuleDocumentationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModuleDocumentation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPackageDocumentationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPackageDocumentationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackageDocumentation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Location); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Service); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Method); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MethodRequestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Enum); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnumOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnumValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnumValueOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ImportModuleRef); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageField); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Oneof); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Field); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FieldOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MapEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileExtension); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[26].OneofWrappers = []interface{}{ - (*MessageField_Field)(nil), - (*MessageField_Oneof)(nil), - } - file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes[30].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc, - NumEnums: 0, - NumMessages: 33, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_doc_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_doc_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_doc_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_doc_proto = out.File - file_buf_alpha_registry_v1alpha1_doc_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_doc_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_doc_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/download.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/download.pb.go deleted file mode 100644 index 250eb7708b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/download.pb.go +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/download.proto - -package registryv1alpha1 - -import ( - v1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// DownloadRequest specifies the module to download. -type DownloadRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *DownloadRequest) Reset() { - *x = DownloadRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DownloadRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DownloadRequest) ProtoMessage() {} - -func (x *DownloadRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DownloadRequest.ProtoReflect.Descriptor instead. -func (*DownloadRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_download_proto_rawDescGZIP(), []int{0} -} - -func (x *DownloadRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *DownloadRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *DownloadRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// DownloadResponse contains the remote module. -type DownloadResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Module *v1alpha1.Module `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` -} - -func (x *DownloadResponse) Reset() { - *x = DownloadResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DownloadResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DownloadResponse) ProtoMessage() {} - -func (x *DownloadResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DownloadResponse.ProtoReflect.Descriptor instead. -func (*DownloadResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_download_proto_rawDescGZIP(), []int{1} -} - -func (x *DownloadResponse) GetModule() *v1alpha1.Module { - if x != nil { - return x.Module - } - return nil -} - -// DownloadManifestAndBlobsRequest specifies the module to download. -type DownloadManifestAndBlobsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *DownloadManifestAndBlobsRequest) Reset() { - *x = DownloadManifestAndBlobsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DownloadManifestAndBlobsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DownloadManifestAndBlobsRequest) ProtoMessage() {} - -func (x *DownloadManifestAndBlobsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DownloadManifestAndBlobsRequest.ProtoReflect.Descriptor instead. -func (*DownloadManifestAndBlobsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_download_proto_rawDescGZIP(), []int{2} -} - -func (x *DownloadManifestAndBlobsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *DownloadManifestAndBlobsRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *DownloadManifestAndBlobsRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// DownloadManifestAndBlobsResponse is the returned resolved remote module. -type DownloadManifestAndBlobsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // manifest is the manifest of the module's content. - Manifest *v1alpha1.Blob `protobuf:"bytes,1,opt,name=manifest,proto3" json:"manifest,omitempty"` - // blobs is a set of blobs that closes on the module's manifest to form the - // complete module's content. - Blobs []*v1alpha1.Blob `protobuf:"bytes,2,rep,name=blobs,proto3" json:"blobs,omitempty"` -} - -func (x *DownloadManifestAndBlobsResponse) Reset() { - *x = DownloadManifestAndBlobsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DownloadManifestAndBlobsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DownloadManifestAndBlobsResponse) ProtoMessage() {} - -func (x *DownloadManifestAndBlobsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DownloadManifestAndBlobsResponse.ProtoReflect.Descriptor instead. -func (*DownloadManifestAndBlobsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_download_proto_rawDescGZIP(), []int{3} -} - -func (x *DownloadManifestAndBlobsResponse) GetManifest() *v1alpha1.Blob { - if x != nil { - return x.Manifest - } - return nil -} - -func (x *DownloadManifestAndBlobsResponse) GetBlobs() []*v1alpha1.Blob { - if x != nil { - return x.Blobs - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_download_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_download_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x64, 0x6f, - 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0x65, 0x0a, 0x0f, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x4d, 0x0a, 0x10, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a, 0x06, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, - 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x22, 0x75, 0x0a, 0x1f, 0x44, 0x6f, 0x77, 0x6e, 0x6c, - 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, - 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x96, - 0x01, 0x0a, 0x20, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x12, 0x35, 0x0a, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, - 0x52, 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x32, 0x9e, 0x02, 0x0a, 0x0f, 0x44, 0x6f, 0x77, 0x6e, - 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x08, 0x44, - 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x44, 0x6f, - 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, - 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x6e, - 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x4d, 0x61, 0x6e, 0x69, 0x66, - 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x9a, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0d, 0x44, 0x6f, - 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_download_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_download_proto_rawDescData = file_buf_alpha_registry_v1alpha1_download_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_download_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_download_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_download_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_download_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_download_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_download_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_buf_alpha_registry_v1alpha1_download_proto_goTypes = []interface{}{ - (*DownloadRequest)(nil), // 0: buf.alpha.registry.v1alpha1.DownloadRequest - (*DownloadResponse)(nil), // 1: buf.alpha.registry.v1alpha1.DownloadResponse - (*DownloadManifestAndBlobsRequest)(nil), // 2: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsRequest - (*DownloadManifestAndBlobsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse - (*v1alpha1.Module)(nil), // 4: buf.alpha.module.v1alpha1.Module - (*v1alpha1.Blob)(nil), // 5: buf.alpha.module.v1alpha1.Blob -} -var file_buf_alpha_registry_v1alpha1_download_proto_depIdxs = []int32{ - 4, // 0: buf.alpha.registry.v1alpha1.DownloadResponse.module:type_name -> buf.alpha.module.v1alpha1.Module - 5, // 1: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse.manifest:type_name -> buf.alpha.module.v1alpha1.Blob - 5, // 2: buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse.blobs:type_name -> buf.alpha.module.v1alpha1.Blob - 0, // 3: buf.alpha.registry.v1alpha1.DownloadService.Download:input_type -> buf.alpha.registry.v1alpha1.DownloadRequest - 2, // 4: buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs:input_type -> buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsRequest - 1, // 5: buf.alpha.registry.v1alpha1.DownloadService.Download:output_type -> buf.alpha.registry.v1alpha1.DownloadResponse - 3, // 6: buf.alpha.registry.v1alpha1.DownloadService.DownloadManifestAndBlobs:output_type -> buf.alpha.registry.v1alpha1.DownloadManifestAndBlobsResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_download_proto_init() } -func file_buf_alpha_registry_v1alpha1_download_proto_init() { - if File_buf_alpha_registry_v1alpha1_download_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownloadRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownloadResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownloadManifestAndBlobsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_download_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DownloadManifestAndBlobsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_download_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_download_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_download_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_download_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_download_proto = out.File - file_buf_alpha_registry_v1alpha1_download_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_download_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_download_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/generate.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/generate.pb.go deleted file mode 100644 index 0c866e0e73..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/generate.pb.go +++ /dev/null @@ -1,897 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// buf/alpha/registry/v1alpha1/generate.proto is a deprecated file. - -package registryv1alpha1 - -import ( - v1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - pluginpb "google.golang.org/protobuf/types/pluginpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// File defines a file with a path and some content. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type File struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // path is the relative path of the file. - // Path can only use '/' as the separator character, and includes no ".." components. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - // content is the content of the file. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` -} - -func (x *File) Reset() { - *x = File{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*File) ProtoMessage() {} - -func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use File.ProtoReflect.Descriptor instead. -func (*File) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{0} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *File) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *File) GetContent() []byte { - if x != nil { - return x.Content - } - return nil -} - -// RuntimeLibrary describes a pinned runtime library dependency of the generated code. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type RuntimeLibrary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the runtime library dependency. The format should match the - // format used for dependencies in the dependency management tooling of the - // associated language ecosystem. This is set by the user using Dockerfile Labels. - // For example, for the plugin "protoc-gen-go", this might be "google.golang.org/protobuf". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The version of the runtime library dependency associated with the generated - // code. The format should match the format used for dependency versions in the - // dependency management tooling of the associated language ecosystem. - // This is set by the user using Dockerfile Labels. - // For example, for the plugin "protoc-gen-go", this might be "v1.26.0". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *RuntimeLibrary) Reset() { - *x = RuntimeLibrary{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RuntimeLibrary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RuntimeLibrary) ProtoMessage() {} - -func (x *RuntimeLibrary) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RuntimeLibrary.ProtoReflect.Descriptor instead. -func (*RuntimeLibrary) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{1} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *RuntimeLibrary) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *RuntimeLibrary) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type PluginReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin which identifies the - // plugins to use with this generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin which identifies the - // plugins to use with this generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The plugin version to use with this generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // The parameters to pass to the plugin. These will - // be merged into a single, comma-separated string. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Parameters []string `protobuf:"bytes,4,rep,name=parameters,proto3" json:"parameters,omitempty"` -} - -func (x *PluginReference) Reset() { - *x = PluginReference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginReference) ProtoMessage() {} - -func (x *PluginReference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginReference.ProtoReflect.Descriptor instead. -func (*PluginReference) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{2} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *PluginReference) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *PluginReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *PluginReference) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *PluginReference) GetParameters() []string { - if x != nil { - return x.Parameters - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type GeneratePluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The image to run plugins against to generate the desired file outputs. - // - // All image files that are not imports and not well-known types will be generated. - // If you want to filter what files are generated, modify the image. - // If you want to include imports, set include_imports. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Image *v1.Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - // The array of plugins to use. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Plugins []*PluginReference `protobuf:"bytes,2,rep,name=plugins,proto3" json:"plugins,omitempty"` - // Include imports from the Image in generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - IncludeImports bool `protobuf:"varint,3,opt,name=include_imports,json=includeImports,proto3" json:"include_imports,omitempty"` - // Include Well-Known Types from the Image in generation. - // - // include_imports must be set if include_well_known_types is set. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - IncludeWellKnownTypes bool `protobuf:"varint,4,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3" json:"include_well_known_types,omitempty"` -} - -func (x *GeneratePluginsRequest) Reset() { - *x = GeneratePluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeneratePluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeneratePluginsRequest) ProtoMessage() {} - -func (x *GeneratePluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeneratePluginsRequest.ProtoReflect.Descriptor instead. -func (*GeneratePluginsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{3} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsRequest) GetImage() *v1.Image { - if x != nil { - return x.Image - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsRequest) GetPlugins() []*PluginReference { - if x != nil { - return x.Plugins - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsRequest) GetIncludeImports() bool { - if x != nil { - return x.IncludeImports - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsRequest) GetIncludeWellKnownTypes() bool { - if x != nil { - return x.IncludeWellKnownTypes - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type GeneratePluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Contains all the responses from the generated plugins. The order - // is defined by the order of the plugins in the request. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Responses []*pluginpb.CodeGeneratorResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` - // An optional array defining runtime libraries that the generated code - // requires to run, as specified by the plugin author. This may contain - // duplicate entries as the generation can be the result of multiple plugins, - // each of which declares its own runtime library dependencies. The libraries - // returned are lexicographically ordered by their name, but not deduplicated. - // How to handle duplicate libraries is left to the user. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - RuntimeLibraries []*RuntimeLibrary `protobuf:"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` -} - -func (x *GeneratePluginsResponse) Reset() { - *x = GeneratePluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GeneratePluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GeneratePluginsResponse) ProtoMessage() {} - -func (x *GeneratePluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GeneratePluginsResponse.ProtoReflect.Descriptor instead. -func (*GeneratePluginsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{4} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsResponse) GetResponses() []*pluginpb.CodeGeneratorResponse { - if x != nil { - return x.Responses - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GeneratePluginsResponse) GetRuntimeLibraries() []*RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type GenerateTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The image to run plugins against to generate the desired file outputs. - // - // All image files that are not imports and not well-known types will be generated. - // If you want to filter what files are generated, modify the image. - // If you want to include imports, set include_imports. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Image *v1.Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - // The owner of the template which identifies the - // plugins to use with this generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - TemplateOwner string `protobuf:"bytes,2,opt,name=template_owner,json=templateOwner,proto3" json:"template_owner,omitempty"` - // The name of the template which identifies the - // plugins to use with this generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - TemplateName string `protobuf:"bytes,3,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` - // The template version to use to determine the - // plugin versions in the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - TemplateVersion string `protobuf:"bytes,4,opt,name=template_version,json=templateVersion,proto3" json:"template_version,omitempty"` - // Include imports from the Image in generation. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - IncludeImports bool `protobuf:"varint,5,opt,name=include_imports,json=includeImports,proto3" json:"include_imports,omitempty"` - // Include Well-Known Types from the Image in generation. - // - // include_imports must be set if include_well_known_types is set. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - IncludeWellKnownTypes bool `protobuf:"varint,6,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3" json:"include_well_known_types,omitempty"` -} - -func (x *GenerateTemplateRequest) Reset() { - *x = GenerateTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateTemplateRequest) ProtoMessage() {} - -func (x *GenerateTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateTemplateRequest.ProtoReflect.Descriptor instead. -func (*GenerateTemplateRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{5} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetImage() *v1.Image { - if x != nil { - return x.Image - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetTemplateOwner() string { - if x != nil { - return x.TemplateOwner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetTemplateName() string { - if x != nil { - return x.TemplateName - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetTemplateVersion() string { - if x != nil { - return x.TemplateVersion - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetIncludeImports() bool { - if x != nil { - return x.IncludeImports - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateRequest) GetIncludeWellKnownTypes() bool { - if x != nil { - return x.IncludeWellKnownTypes - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -type GenerateTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // files contains all the files output by the generation, - // in lexicographical order. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - Files []*File `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` - // An optional array defining runtime libraries that the generated code - // requires to run. This may contain duplicate entries as the generation - // can be the result of multiple plugins, each of which declares its own - // runtime library dependencies. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. - RuntimeLibraries []*RuntimeLibrary `protobuf:"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` -} - -func (x *GenerateTemplateResponse) Reset() { - *x = GenerateTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateTemplateResponse) ProtoMessage() {} - -func (x *GenerateTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateTemplateResponse.ProtoReflect.Descriptor instead. -func (*GenerateTemplateResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP(), []int{6} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateResponse) GetFiles() []*File { - if x != nil { - return x.Files - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/generate.proto is marked as deprecated. -func (x *GenerateTemplateResponse) GetRuntimeLibraries() []*RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_generate_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_generate_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, - 0x6c, 0x65, 0x72, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x34, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3e, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x75, 0x0a, 0x0f, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, - 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x22, 0xf3, 0x01, - 0x0a, 0x16, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, - 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, - 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x6e, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, - 0x70, 0x65, 0x73, 0x22, 0xc2, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4d, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, - 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x58, - 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0xa3, 0x02, 0x0a, 0x17, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0c, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x74, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x0a, 0x0f, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x5f, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0xad, - 0x01, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x05, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, - 0x69, 0x6c, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, - 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x32, 0x90, - 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x7f, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x12, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x42, 0x9d, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xb8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_generate_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_generate_proto_rawDescData = file_buf_alpha_registry_v1alpha1_generate_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_generate_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_generate_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_generate_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_generate_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_generate_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_buf_alpha_registry_v1alpha1_generate_proto_goTypes = []interface{}{ - (*File)(nil), // 0: buf.alpha.registry.v1alpha1.File - (*RuntimeLibrary)(nil), // 1: buf.alpha.registry.v1alpha1.RuntimeLibrary - (*PluginReference)(nil), // 2: buf.alpha.registry.v1alpha1.PluginReference - (*GeneratePluginsRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GeneratePluginsRequest - (*GeneratePluginsResponse)(nil), // 4: buf.alpha.registry.v1alpha1.GeneratePluginsResponse - (*GenerateTemplateRequest)(nil), // 5: buf.alpha.registry.v1alpha1.GenerateTemplateRequest - (*GenerateTemplateResponse)(nil), // 6: buf.alpha.registry.v1alpha1.GenerateTemplateResponse - (*v1.Image)(nil), // 7: buf.alpha.image.v1.Image - (*pluginpb.CodeGeneratorResponse)(nil), // 8: google.protobuf.compiler.CodeGeneratorResponse -} -var file_buf_alpha_registry_v1alpha1_generate_proto_depIdxs = []int32{ - 7, // 0: buf.alpha.registry.v1alpha1.GeneratePluginsRequest.image:type_name -> buf.alpha.image.v1.Image - 2, // 1: buf.alpha.registry.v1alpha1.GeneratePluginsRequest.plugins:type_name -> buf.alpha.registry.v1alpha1.PluginReference - 8, // 2: buf.alpha.registry.v1alpha1.GeneratePluginsResponse.responses:type_name -> google.protobuf.compiler.CodeGeneratorResponse - 1, // 3: buf.alpha.registry.v1alpha1.GeneratePluginsResponse.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.RuntimeLibrary - 7, // 4: buf.alpha.registry.v1alpha1.GenerateTemplateRequest.image:type_name -> buf.alpha.image.v1.Image - 0, // 5: buf.alpha.registry.v1alpha1.GenerateTemplateResponse.files:type_name -> buf.alpha.registry.v1alpha1.File - 1, // 6: buf.alpha.registry.v1alpha1.GenerateTemplateResponse.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.RuntimeLibrary - 3, // 7: buf.alpha.registry.v1alpha1.GenerateService.GeneratePlugins:input_type -> buf.alpha.registry.v1alpha1.GeneratePluginsRequest - 5, // 8: buf.alpha.registry.v1alpha1.GenerateService.GenerateTemplate:input_type -> buf.alpha.registry.v1alpha1.GenerateTemplateRequest - 4, // 9: buf.alpha.registry.v1alpha1.GenerateService.GeneratePlugins:output_type -> buf.alpha.registry.v1alpha1.GeneratePluginsResponse - 6, // 10: buf.alpha.registry.v1alpha1.GenerateService.GenerateTemplate:output_type -> buf.alpha.registry.v1alpha1.GenerateTemplateResponse - 9, // [9:11] is the sub-list for method output_type - 7, // [7:9] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_generate_proto_init() } -func file_buf_alpha_registry_v1alpha1_generate_proto_init() { - if File_buf_alpha_registry_v1alpha1_generate_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RuntimeLibrary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeneratePluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeneratePluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_generate_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_generate_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_generate_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_generate_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_generate_proto = out.File - file_buf_alpha_registry_v1alpha1_generate_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_generate_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_generate_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/git_metadata.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/git_metadata.pb.go deleted file mode 100644 index 35915dd46a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/git_metadata.pb.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/git_metadata.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GitIdentity is a Git user identity, typically either an author or a commiter. -type GitIdentity struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name is the name of the Git identity. This is not the BSR user's username. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Email is the email of the Git identity. This is not the BSR user's email. - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // Time is the time at which this identity was captured. - Time *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=time,proto3" json:"time,omitempty"` -} - -func (x *GitIdentity) Reset() { - *x = GitIdentity{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GitIdentity) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitIdentity) ProtoMessage() {} - -func (x *GitIdentity) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GitIdentity.ProtoReflect.Descriptor instead. -func (*GitIdentity) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescGZIP(), []int{0} -} - -func (x *GitIdentity) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GitIdentity) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *GitIdentity) GetTime() *timestamppb.Timestamp { - if x != nil { - return x.Time - } - return nil -} - -// GitCommitMetadata is Git metadata associated with a BSR commit. -type GitCommitMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Hash is the SHA1 has of the Git commit. - Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - // Author is the author of the Git commit. This is typically an end-user. - Author *GitIdentity `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` - // Commiter is the commiter of the Git commit. This typically a CI system. - Commiter *GitIdentity `protobuf:"bytes,3,opt,name=commiter,proto3" json:"commiter,omitempty"` - // Branch is the Git branch to which this Git commit belongs. - Branch string `protobuf:"bytes,4,opt,name=branch,proto3" json:"branch,omitempty"` - // Tags are the Git tags which point to this commit. - Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` -} - -func (x *GitCommitMetadata) Reset() { - *x = GitCommitMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GitCommitMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitCommitMetadata) ProtoMessage() {} - -func (x *GitCommitMetadata) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GitCommitMetadata.ProtoReflect.Descriptor instead. -func (*GitCommitMetadata) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescGZIP(), []int{1} -} - -func (x *GitCommitMetadata) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *GitCommitMetadata) GetAuthor() *GitIdentity { - if x != nil { - return x.Author - } - return nil -} - -func (x *GitCommitMetadata) GetCommiter() *GitIdentity { - if x != nil { - return x.Commiter - } - return nil -} - -func (x *GitCommitMetadata) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *GitCommitMetadata) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_git_metadata_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x69, - 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x67, - 0x0a, 0x0b, 0x47, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2e, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, - 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, - 0x68, 0x12, 0x40, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x06, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x12, 0x44, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, - 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x61, 0x67, 0x73, 0x42, 0x9d, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x47, 0x69, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescData = file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = []interface{}{ - (*GitIdentity)(nil), // 0: buf.alpha.registry.v1alpha1.GitIdentity - (*GitCommitMetadata)(nil), // 1: buf.alpha.registry.v1alpha1.GitCommitMetadata - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = []int32{ - 2, // 0: buf.alpha.registry.v1alpha1.GitIdentity.time:type_name -> google.protobuf.Timestamp - 0, // 1: buf.alpha.registry.v1alpha1.GitCommitMetadata.author:type_name -> buf.alpha.registry.v1alpha1.GitIdentity - 0, // 2: buf.alpha.registry.v1alpha1.GitCommitMetadata.commiter:type_name -> buf.alpha.registry.v1alpha1.GitIdentity - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() } -func file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() { - if File_buf_alpha_registry_v1alpha1_git_metadata_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitIdentity); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitCommitMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_git_metadata_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_git_metadata_proto = out.File - file_buf_alpha_registry_v1alpha1_git_metadata_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_git_metadata_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_git_metadata_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/github.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/github.pb.go deleted file mode 100644 index d77e7e74fd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/github.pb.go +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/github.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GithubAppConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppId string `protobuf:"bytes,1,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` -} - -func (x *GithubAppConfig) Reset() { - *x = GithubAppConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GithubAppConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GithubAppConfig) ProtoMessage() {} - -func (x *GithubAppConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GithubAppConfig.ProtoReflect.Descriptor instead. -func (*GithubAppConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_github_proto_rawDescGZIP(), []int{0} -} - -func (x *GithubAppConfig) GetAppId() string { - if x != nil { - return x.AppId - } - return "" -} - -type GetGithubAppConfigRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *GetGithubAppConfigRequest) Reset() { - *x = GetGithubAppConfigRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGithubAppConfigRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGithubAppConfigRequest) ProtoMessage() {} - -func (x *GetGithubAppConfigRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGithubAppConfigRequest.ProtoReflect.Descriptor instead. -func (*GetGithubAppConfigRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_github_proto_rawDescGZIP(), []int{1} -} - -type GetGithubAppConfigResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - AppConfig *GithubAppConfig `protobuf:"bytes,1,opt,name=app_config,json=appConfig,proto3" json:"app_config,omitempty"` -} - -func (x *GetGithubAppConfigResponse) Reset() { - *x = GetGithubAppConfigResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGithubAppConfigResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGithubAppConfigResponse) ProtoMessage() {} - -func (x *GetGithubAppConfigResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGithubAppConfigResponse.ProtoReflect.Descriptor instead. -func (*GetGithubAppConfigResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_github_proto_rawDescGZIP(), []int{2} -} - -func (x *GetGithubAppConfigResponse) GetAppConfig() *GithubAppConfig { - if x != nil { - return x.AppConfig - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_github_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_github_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x28, 0x0a, 0x0f, 0x47, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x70, - 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, - 0x64, 0x22, 0x1b, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, - 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x69, - 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0a, - 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, - 0x61, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x9c, 0x01, 0x0a, 0x0d, 0x47, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x41, 0x70, 0x70, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x47, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, - 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_github_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_github_proto_rawDescData = file_buf_alpha_registry_v1alpha1_github_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_github_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_github_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_github_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_github_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_github_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_github_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_buf_alpha_registry_v1alpha1_github_proto_goTypes = []interface{}{ - (*GithubAppConfig)(nil), // 0: buf.alpha.registry.v1alpha1.GithubAppConfig - (*GetGithubAppConfigRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetGithubAppConfigRequest - (*GetGithubAppConfigResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse -} -var file_buf_alpha_registry_v1alpha1_github_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse.app_config:type_name -> buf.alpha.registry.v1alpha1.GithubAppConfig - 1, // 1: buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig:input_type -> buf.alpha.registry.v1alpha1.GetGithubAppConfigRequest - 2, // 2: buf.alpha.registry.v1alpha1.GithubService.GetGithubAppConfig:output_type -> buf.alpha.registry.v1alpha1.GetGithubAppConfigResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_github_proto_init() } -func file_buf_alpha_registry_v1alpha1_github_proto_init() { - if File_buf_alpha_registry_v1alpha1_github_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GithubAppConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGithubAppConfigRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_github_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGithubAppConfigResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_github_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_github_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_github_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_github_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_github_proto = out.File - file_buf_alpha_registry_v1alpha1_github_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_github_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_github_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/image.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/image.pb.go deleted file mode 100644 index a2421cedef..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/image.pb.go +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/image.proto - -package registryv1alpha1 - -import ( - v1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ImageMask is used in GetImageRequest to specify which parts of an image -// should be masked in responses. -type ImageMask int32 - -const ( - ImageMask_IMAGE_MASK_UNSPECIFIED ImageMask = 0 - // IMAGE_MASK_MESSAGES refers to ImageFile's `google.protobuf.DescriptorProto - // message_type` field. - ImageMask_IMAGE_MASK_MESSAGES ImageMask = 1 - // IMAGE_MASK_ENUMS refers to ImageFile's `google.protobuf.EnumDescriptorProto - // enum_type` field. - ImageMask_IMAGE_MASK_ENUMS ImageMask = 2 - // IMAGE_MASK_SERVICES refers to ImageFile's - // `google.protobuf.ServiceDescriptorProto service` field. - ImageMask_IMAGE_MASK_SERVICES ImageMask = 3 -) - -// Enum value maps for ImageMask. -var ( - ImageMask_name = map[int32]string{ - 0: "IMAGE_MASK_UNSPECIFIED", - 1: "IMAGE_MASK_MESSAGES", - 2: "IMAGE_MASK_ENUMS", - 3: "IMAGE_MASK_SERVICES", - } - ImageMask_value = map[string]int32{ - "IMAGE_MASK_UNSPECIFIED": 0, - "IMAGE_MASK_MESSAGES": 1, - "IMAGE_MASK_ENUMS": 2, - "IMAGE_MASK_SERVICES": 3, - } -) - -func (x ImageMask) Enum() *ImageMask { - p := new(ImageMask) - *p = x - return p -} - -func (x ImageMask) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ImageMask) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_image_proto_enumTypes[0].Descriptor() -} - -func (ImageMask) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_image_proto_enumTypes[0] -} - -func (x ImageMask) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ImageMask.Descriptor instead. -func (ImageMask) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_image_proto_rawDescGZIP(), []int{0} -} - -type GetImageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` - // Exclude files from imported buf modules in this image. - ExcludeImports bool `protobuf:"varint,4,opt,name=exclude_imports,json=excludeImports,proto3" json:"exclude_imports,omitempty"` - // Exclude source_code_info fields from each ImageFile. - ExcludeSourceInfo bool `protobuf:"varint,5,opt,name=exclude_source_info,json=excludeSourceInfo,proto3" json:"exclude_source_info,omitempty"` - // When specified the returned image will only contain the necessary files and - // descriptors in those files to describe these types. Accepts messages, enums - // and services. All types must be defined in the buf module, types in - // dependencies are not accepted. - // - // At this time specifying `types` requires `exclude_source_info` to be set to - // true. - Types []string `protobuf:"bytes,6,rep,name=types,proto3" json:"types,omitempty"` - // When not empty, the returned image's files will only include - // *DescriptorProto fields for the elements specified here. The masks are - // applied without regard for dependencies between types. For example, if - // `IMAGE_MASK_MESSAGES` is specified without `IMAGE_MASK_ENUMS` the resulting - // image will NOT contain enum definitions even if they are referenced from - // message fields. - IncludeMask []ImageMask `protobuf:"varint,7,rep,packed,name=include_mask,json=includeMask,proto3,enum=buf.alpha.registry.v1alpha1.ImageMask" json:"include_mask,omitempty"` -} - -func (x *GetImageRequest) Reset() { - *x = GetImageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetImageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetImageRequest) ProtoMessage() {} - -func (x *GetImageRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetImageRequest.ProtoReflect.Descriptor instead. -func (*GetImageRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_image_proto_rawDescGZIP(), []int{0} -} - -func (x *GetImageRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetImageRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetImageRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *GetImageRequest) GetExcludeImports() bool { - if x != nil { - return x.ExcludeImports - } - return false -} - -func (x *GetImageRequest) GetExcludeSourceInfo() bool { - if x != nil { - return x.ExcludeSourceInfo - } - return false -} - -func (x *GetImageRequest) GetTypes() []string { - if x != nil { - return x.Types - } - return nil -} - -func (x *GetImageRequest) GetIncludeMask() []ImageMask { - if x != nil { - return x.IncludeMask - } - return nil -} - -type GetImageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Image *v1.Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` -} - -func (x *GetImageResponse) Reset() { - *x = GetImageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetImageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetImageResponse) ProtoMessage() {} - -func (x *GetImageResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetImageResponse.ProtoReflect.Descriptor instead. -func (*GetImageResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_image_proto_rawDescGZIP(), []int{1} -} - -func (x *GetImageResponse) GetImage() *v1.Image { - if x != nil { - return x.Image - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_image_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_image_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x69, 0x6d, - 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9f, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6d, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x27, - 0x0a, 0x0f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x12, 0x49, 0x0a, - 0x0c, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0b, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x43, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x49, - 0x6d, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2a, 0x6f, 0x0a, - 0x09, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x1a, 0x0a, 0x16, 0x49, 0x4d, - 0x41, 0x47, 0x45, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, - 0x4d, 0x41, 0x53, 0x4b, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x53, 0x10, 0x01, 0x12, - 0x14, 0x0a, 0x10, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x5f, 0x45, 0x4e, - 0x55, 0x4d, 0x53, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x4d, 0x41, 0x47, 0x45, 0x5f, 0x4d, - 0x41, 0x53, 0x4b, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x53, 0x10, 0x03, 0x32, 0x7c, - 0x0a, 0x0c, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, - 0x0a, 0x08, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x2c, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x97, 0x02, 0x0a, - 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x42, 0x0a, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, - 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, - 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, - 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_image_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_image_proto_rawDescData = file_buf_alpha_registry_v1alpha1_image_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_image_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_image_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_image_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_image_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_image_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_image_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_image_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_registry_v1alpha1_image_proto_goTypes = []interface{}{ - (ImageMask)(0), // 0: buf.alpha.registry.v1alpha1.ImageMask - (*GetImageRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetImageRequest - (*GetImageResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetImageResponse - (*v1.Image)(nil), // 3: buf.alpha.image.v1.Image -} -var file_buf_alpha_registry_v1alpha1_image_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.GetImageRequest.include_mask:type_name -> buf.alpha.registry.v1alpha1.ImageMask - 3, // 1: buf.alpha.registry.v1alpha1.GetImageResponse.image:type_name -> buf.alpha.image.v1.Image - 1, // 2: buf.alpha.registry.v1alpha1.ImageService.GetImage:input_type -> buf.alpha.registry.v1alpha1.GetImageRequest - 2, // 3: buf.alpha.registry.v1alpha1.ImageService.GetImage:output_type -> buf.alpha.registry.v1alpha1.GetImageResponse - 3, // [3:4] is the sub-list for method output_type - 2, // [2:3] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_image_proto_init() } -func file_buf_alpha_registry_v1alpha1_image_proto_init() { - if File_buf_alpha_registry_v1alpha1_image_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetImageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_image_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetImageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_image_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_image_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_image_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_image_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_image_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_image_proto = out.File - file_buf_alpha_registry_v1alpha1_image_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_image_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_image_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/jsonschema.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/jsonschema.pb.go deleted file mode 100644 index 73a24438da..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/jsonschema.pb.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/jsonschema.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type GetJSONSchemaRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` - // A fully qualified name of the type to generate a JSONSchema for, e.g. - // "pkg.foo.Bar". The type needs to resolve in the referenced module or any of - // its dependencies. Currently only messages types are supported. - TypeName string `protobuf:"bytes,4,opt,name=type_name,json=typeName,proto3" json:"type_name,omitempty"` -} - -func (x *GetJSONSchemaRequest) Reset() { - *x = GetJSONSchemaRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetJSONSchemaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetJSONSchemaRequest) ProtoMessage() {} - -func (x *GetJSONSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetJSONSchemaRequest.ProtoReflect.Descriptor instead. -func (*GetJSONSchemaRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescGZIP(), []int{0} -} - -func (x *GetJSONSchemaRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetJSONSchemaRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetJSONSchemaRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *GetJSONSchemaRequest) GetTypeName() string { - if x != nil { - return x.TypeName - } - return "" -} - -type GetJSONSchemaResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A json schema representing what the json encoded payload for type_name - // should conform to. This schema is an approximation to be used by editors - // for validation and autocompletion, not a lossless representation of the - // type's descriptor. - JsonSchema []byte `protobuf:"bytes,1,opt,name=json_schema,json=jsonSchema,proto3" json:"json_schema,omitempty"` -} - -func (x *GetJSONSchemaResponse) Reset() { - *x = GetJSONSchemaResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetJSONSchemaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetJSONSchemaResponse) ProtoMessage() {} - -func (x *GetJSONSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetJSONSchemaResponse.ProtoReflect.Descriptor instead. -func (*GetJSONSchemaResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescGZIP(), []int{1} -} - -func (x *GetJSONSchemaResponse) GetJsonSchema() []byte { - if x != nil { - return x.JsonSchema - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_jsonschema_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6a, 0x73, - 0x6f, 0x6e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x87, 0x01, 0x0a, 0x14, - 0x47, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, - 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x38, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, - 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x32, - 0x90, 0x01, 0x0a, 0x11, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x42, 0x9c, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0f, 0x4a, 0x73, 0x6f, 0x6e, 0x73, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescData = file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes = []interface{}{ - (*GetJSONSchemaRequest)(nil), // 0: buf.alpha.registry.v1alpha1.GetJSONSchemaRequest - (*GetJSONSchemaResponse)(nil), // 1: buf.alpha.registry.v1alpha1.GetJSONSchemaResponse -} -var file_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema:input_type -> buf.alpha.registry.v1alpha1.GetJSONSchemaRequest - 1, // 1: buf.alpha.registry.v1alpha1.JSONSchemaService.GetJSONSchema:output_type -> buf.alpha.registry.v1alpha1.GetJSONSchemaResponse - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_jsonschema_proto_init() } -func file_buf_alpha_registry_v1alpha1_jsonschema_proto_init() { - if File_buf_alpha_registry_v1alpha1_jsonschema_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJSONSchemaRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetJSONSchemaResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_jsonschema_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_jsonschema_proto = out.File - file_buf_alpha_registry_v1alpha1_jsonschema_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_jsonschema_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_jsonschema_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/labels.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/labels.pb.go deleted file mode 100644 index 1532557aee..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/labels.pb.go +++ /dev/null @@ -1,927 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/labels.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type LabelNamespace int32 - -const ( - LabelNamespace_LABEL_NAMESPACE_UNSPECIFIED LabelNamespace = 0 - LabelNamespace_LABEL_NAMESPACE_TAG LabelNamespace = 1 - LabelNamespace_LABEL_NAMESPACE_BRANCH LabelNamespace = 2 - LabelNamespace_LABEL_NAMESPACE_GIT_COMMIT LabelNamespace = 3 - LabelNamespace_LABEL_NAMESPACE_REVIEW LabelNamespace = 4 - LabelNamespace_LABEL_NAMESPACE_BSR_HEAD LabelNamespace = 5 -) - -// Enum value maps for LabelNamespace. -var ( - LabelNamespace_name = map[int32]string{ - 0: "LABEL_NAMESPACE_UNSPECIFIED", - 1: "LABEL_NAMESPACE_TAG", - 2: "LABEL_NAMESPACE_BRANCH", - 3: "LABEL_NAMESPACE_GIT_COMMIT", - 4: "LABEL_NAMESPACE_REVIEW", - 5: "LABEL_NAMESPACE_BSR_HEAD", - } - LabelNamespace_value = map[string]int32{ - "LABEL_NAMESPACE_UNSPECIFIED": 0, - "LABEL_NAMESPACE_TAG": 1, - "LABEL_NAMESPACE_BRANCH": 2, - "LABEL_NAMESPACE_GIT_COMMIT": 3, - "LABEL_NAMESPACE_REVIEW": 4, - "LABEL_NAMESPACE_BSR_HEAD": 5, - } -) - -func (x LabelNamespace) Enum() *LabelNamespace { - p := new(LabelNamespace) - *p = x - return p -} - -func (x LabelNamespace) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (LabelNamespace) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_labels_proto_enumTypes[0].Descriptor() -} - -func (LabelNamespace) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_labels_proto_enumTypes[0] -} - -func (x LabelNamespace) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use LabelNamespace.Descriptor instead. -func (LabelNamespace) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{0} -} - -type Label struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LabelName *LabelName `protobuf:"bytes,1,opt,name=label_name,json=labelName,proto3" json:"label_name,omitempty"` - LabelValue *LabelValue `protobuf:"bytes,2,opt,name=label_value,json=labelValue,proto3" json:"label_value,omitempty"` -} - -func (x *Label) Reset() { - *x = Label{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Label) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Label) ProtoMessage() {} - -func (x *Label) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Label.ProtoReflect.Descriptor instead. -func (*Label) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{0} -} - -func (x *Label) GetLabelName() *LabelName { - if x != nil { - return x.LabelName - } - return nil -} - -func (x *Label) GetLabelValue() *LabelValue { - if x != nil { - return x.LabelValue - } - return nil -} - -type LabelName struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Namespace LabelNamespace `protobuf:"varint,1,opt,name=namespace,proto3,enum=buf.alpha.registry.v1alpha1.LabelNamespace" json:"namespace,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *LabelName) Reset() { - *x = LabelName{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LabelName) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LabelName) ProtoMessage() {} - -func (x *LabelName) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LabelName.ProtoReflect.Descriptor instead. -func (*LabelName) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{1} -} - -func (x *LabelName) GetNamespace() LabelNamespace { - if x != nil { - return x.Namespace - } - return LabelNamespace_LABEL_NAMESPACE_UNSPECIFIED -} - -func (x *LabelName) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type LabelValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` -} - -func (x *LabelValue) Reset() { - *x = LabelValue{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LabelValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LabelValue) ProtoMessage() {} - -func (x *LabelValue) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LabelValue.ProtoReflect.Descriptor instead. -func (*LabelValue) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{2} -} - -func (x *LabelValue) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -type CreateLabelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LabelName *LabelName `protobuf:"bytes,1,opt,name=label_name,json=labelName,proto3" json:"label_name,omitempty"` - LabelValue *LabelValue `protobuf:"bytes,2,opt,name=label_value,json=labelValue,proto3" json:"label_value,omitempty"` - Author *string `protobuf:"bytes,3,opt,name=author,proto3,oneof" json:"author,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3,oneof" json:"create_time,omitempty"` -} - -func (x *CreateLabelRequest) Reset() { - *x = CreateLabelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateLabelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateLabelRequest) ProtoMessage() {} - -func (x *CreateLabelRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateLabelRequest.ProtoReflect.Descriptor instead. -func (*CreateLabelRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateLabelRequest) GetLabelName() *LabelName { - if x != nil { - return x.LabelName - } - return nil -} - -func (x *CreateLabelRequest) GetLabelValue() *LabelValue { - if x != nil { - return x.LabelValue - } - return nil -} - -func (x *CreateLabelRequest) GetAuthor() string { - if x != nil && x.Author != nil { - return *x.Author - } - return "" -} - -func (x *CreateLabelRequest) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -type CreateLabelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommitId *LabelValue `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` -} - -func (x *CreateLabelResponse) Reset() { - *x = CreateLabelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateLabelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateLabelResponse) ProtoMessage() {} - -func (x *CreateLabelResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateLabelResponse.ProtoReflect.Descriptor instead. -func (*CreateLabelResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{4} -} - -func (x *CreateLabelResponse) GetCommitId() *LabelValue { - if x != nil { - return x.CommitId - } - return nil -} - -type MoveLabelRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LabelName *LabelName `protobuf:"bytes,1,opt,name=label_name,json=labelName,proto3" json:"label_name,omitempty"` - From *LabelValue `protobuf:"bytes,2,opt,name=from,proto3,oneof" json:"from,omitempty"` - To *LabelValue `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *MoveLabelRequest) Reset() { - *x = MoveLabelRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MoveLabelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MoveLabelRequest) ProtoMessage() {} - -func (x *MoveLabelRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MoveLabelRequest.ProtoReflect.Descriptor instead. -func (*MoveLabelRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{5} -} - -func (x *MoveLabelRequest) GetLabelName() *LabelName { - if x != nil { - return x.LabelName - } - return nil -} - -func (x *MoveLabelRequest) GetFrom() *LabelValue { - if x != nil { - return x.From - } - return nil -} - -func (x *MoveLabelRequest) GetTo() *LabelValue { - if x != nil { - return x.To - } - return nil -} - -type MoveLabelResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *MoveLabelResponse) Reset() { - *x = MoveLabelResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MoveLabelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MoveLabelResponse) ProtoMessage() {} - -func (x *MoveLabelResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MoveLabelResponse.ProtoReflect.Descriptor instead. -func (*MoveLabelResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{6} -} - -type GetLabelsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - LabelName *LabelName `protobuf:"bytes,3,opt,name=label_name,json=labelName,proto3,oneof" json:"label_name,omitempty"` - LabelValue *LabelValue `protobuf:"bytes,4,opt,name=label_value,json=labelValue,proto3,oneof" json:"label_value,omitempty"` -} - -func (x *GetLabelsRequest) Reset() { - *x = GetLabelsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLabelsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLabelsRequest) ProtoMessage() {} - -func (x *GetLabelsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLabelsRequest.ProtoReflect.Descriptor instead. -func (*GetLabelsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{7} -} - -func (x *GetLabelsRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *GetLabelsRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *GetLabelsRequest) GetLabelName() *LabelName { - if x != nil { - return x.LabelName - } - return nil -} - -func (x *GetLabelsRequest) GetLabelValue() *LabelValue { - if x != nil { - return x.LabelValue - } - return nil -} - -type GetLabelsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` -} - -func (x *GetLabelsResponse) Reset() { - *x = GetLabelsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLabelsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLabelsResponse) ProtoMessage() {} - -func (x *GetLabelsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLabelsResponse.ProtoReflect.Descriptor instead. -func (*GetLabelsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP(), []int{8} -} - -func (x *GetLabelsResponse) GetLabels() []*Label { - if x != nil { - return x.Labels - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_labels_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_labels_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x01, 0x0a, 0x05, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x12, 0x45, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x6a, 0x0a, 0x09, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x49, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x29, 0x0a, 0x0a, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, - 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0x9f, 0x02, 0x0a, 0x12, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x45, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x00, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x88, 0x01, 0x01, 0x12, - 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x48, 0x01, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, - 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x5b, 0x0a, 0x13, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, - 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x22, 0xdd, 0x01, 0x0a, 0x10, 0x4d, 0x6f, - 0x76, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, - 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x88, 0x01, 0x01, 0x12, 0x37, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x02, 0x74, 0x6f, - 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x22, 0x13, 0x0a, 0x11, 0x4d, 0x6f, 0x76, - 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xa0, - 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, - 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x4a, 0x0a, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x48, 0x00, 0x52, 0x09, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x0b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x48, 0x01, 0x52, 0x0a, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, - 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x22, 0x4f, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x2a, 0xc0, 0x01, 0x0a, 0x0e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, - 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, - 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x01, 0x12, - 0x1a, 0x0a, 0x16, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, - 0x43, 0x45, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x47, - 0x49, 0x54, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x52, - 0x45, 0x56, 0x49, 0x45, 0x57, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x41, 0x42, 0x45, 0x4c, - 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x42, 0x53, 0x52, 0x5f, 0x48, - 0x45, 0x41, 0x44, 0x10, 0x05, 0x32, 0xe2, 0x02, 0x0a, 0x0c, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x6a, 0x0a, - 0x09, 0x4d, 0x6f, 0x76, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x2d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, - 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_labels_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_labels_proto_rawDescData = file_buf_alpha_registry_v1alpha1_labels_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_labels_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_labels_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_labels_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_labels_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_labels_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_labels_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_buf_alpha_registry_v1alpha1_labels_proto_goTypes = []interface{}{ - (LabelNamespace)(0), // 0: buf.alpha.registry.v1alpha1.LabelNamespace - (*Label)(nil), // 1: buf.alpha.registry.v1alpha1.Label - (*LabelName)(nil), // 2: buf.alpha.registry.v1alpha1.LabelName - (*LabelValue)(nil), // 3: buf.alpha.registry.v1alpha1.LabelValue - (*CreateLabelRequest)(nil), // 4: buf.alpha.registry.v1alpha1.CreateLabelRequest - (*CreateLabelResponse)(nil), // 5: buf.alpha.registry.v1alpha1.CreateLabelResponse - (*MoveLabelRequest)(nil), // 6: buf.alpha.registry.v1alpha1.MoveLabelRequest - (*MoveLabelResponse)(nil), // 7: buf.alpha.registry.v1alpha1.MoveLabelResponse - (*GetLabelsRequest)(nil), // 8: buf.alpha.registry.v1alpha1.GetLabelsRequest - (*GetLabelsResponse)(nil), // 9: buf.alpha.registry.v1alpha1.GetLabelsResponse - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_labels_proto_depIdxs = []int32{ - 2, // 0: buf.alpha.registry.v1alpha1.Label.label_name:type_name -> buf.alpha.registry.v1alpha1.LabelName - 3, // 1: buf.alpha.registry.v1alpha1.Label.label_value:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 0, // 2: buf.alpha.registry.v1alpha1.LabelName.namespace:type_name -> buf.alpha.registry.v1alpha1.LabelNamespace - 2, // 3: buf.alpha.registry.v1alpha1.CreateLabelRequest.label_name:type_name -> buf.alpha.registry.v1alpha1.LabelName - 3, // 4: buf.alpha.registry.v1alpha1.CreateLabelRequest.label_value:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 10, // 5: buf.alpha.registry.v1alpha1.CreateLabelRequest.create_time:type_name -> google.protobuf.Timestamp - 3, // 6: buf.alpha.registry.v1alpha1.CreateLabelResponse.commit_id:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 2, // 7: buf.alpha.registry.v1alpha1.MoveLabelRequest.label_name:type_name -> buf.alpha.registry.v1alpha1.LabelName - 3, // 8: buf.alpha.registry.v1alpha1.MoveLabelRequest.from:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 3, // 9: buf.alpha.registry.v1alpha1.MoveLabelRequest.to:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 2, // 10: buf.alpha.registry.v1alpha1.GetLabelsRequest.label_name:type_name -> buf.alpha.registry.v1alpha1.LabelName - 3, // 11: buf.alpha.registry.v1alpha1.GetLabelsRequest.label_value:type_name -> buf.alpha.registry.v1alpha1.LabelValue - 1, // 12: buf.alpha.registry.v1alpha1.GetLabelsResponse.labels:type_name -> buf.alpha.registry.v1alpha1.Label - 4, // 13: buf.alpha.registry.v1alpha1.LabelService.CreateLabel:input_type -> buf.alpha.registry.v1alpha1.CreateLabelRequest - 6, // 14: buf.alpha.registry.v1alpha1.LabelService.MoveLabel:input_type -> buf.alpha.registry.v1alpha1.MoveLabelRequest - 8, // 15: buf.alpha.registry.v1alpha1.LabelService.GetLabels:input_type -> buf.alpha.registry.v1alpha1.GetLabelsRequest - 5, // 16: buf.alpha.registry.v1alpha1.LabelService.CreateLabel:output_type -> buf.alpha.registry.v1alpha1.CreateLabelResponse - 7, // 17: buf.alpha.registry.v1alpha1.LabelService.MoveLabel:output_type -> buf.alpha.registry.v1alpha1.MoveLabelResponse - 9, // 18: buf.alpha.registry.v1alpha1.LabelService.GetLabels:output_type -> buf.alpha.registry.v1alpha1.GetLabelsResponse - 16, // [16:19] is the sub-list for method output_type - 13, // [13:16] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_labels_proto_init() } -func file_buf_alpha_registry_v1alpha1_labels_proto_init() { - if File_buf_alpha_registry_v1alpha1_labels_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Label); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelName); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateLabelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateLabelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoveLabelRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MoveLabelResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLabelsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLabelsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[3].OneofWrappers = []interface{}{} - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[5].OneofWrappers = []interface{}{} - file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes[7].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_labels_proto_rawDesc, - NumEnums: 1, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_labels_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_labels_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_labels_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_labels_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_labels_proto = out.File - file_buf_alpha_registry_v1alpha1_labels_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_labels_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_labels_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/module.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/module.pb.go deleted file mode 100644 index 1e36a18f2d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/module.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/module.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// LocalModuleReference is a local module reference. -// -// It does not include a remote. -type LocalModuleReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // either branch or commit - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *LocalModuleReference) Reset() { - *x = LocalModuleReference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalModuleReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalModuleReference) ProtoMessage() {} - -func (x *LocalModuleReference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalModuleReference.ProtoReflect.Descriptor instead. -func (*LocalModuleReference) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_module_proto_rawDescGZIP(), []int{0} -} - -func (x *LocalModuleReference) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *LocalModuleReference) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *LocalModuleReference) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -// LocalModulePin is a local module pin. -// -// It does not include a remote. -type LocalModulePin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"` - Commit string `protobuf:"bytes,4,opt,name=commit,proto3" json:"commit,omitempty"` - // Module's manifest digest. Replacement for previous b1/b3 digests. - ManifestDigest string `protobuf:"bytes,6,opt,name=manifest_digest,json=manifestDigest,proto3" json:"manifest_digest,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - DraftName string `protobuf:"bytes,8,opt,name=draft_name,json=draftName,proto3" json:"draft_name,omitempty"` -} - -func (x *LocalModulePin) Reset() { - *x = LocalModulePin{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalModulePin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalModulePin) ProtoMessage() {} - -func (x *LocalModulePin) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalModulePin.ProtoReflect.Descriptor instead. -func (*LocalModulePin) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_module_proto_rawDescGZIP(), []int{1} -} - -func (x *LocalModulePin) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *LocalModulePin) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *LocalModulePin) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *LocalModulePin) GetCommit() string { - if x != nil { - return x.Commit - } - return "" -} - -func (x *LocalModulePin) GetManifestDigest() string { - if x != nil { - return x.ManifestDigest - } - return "" -} - -func (x *LocalModulePin) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *LocalModulePin) GetDraftName() string { - if x != nil { - return x.DraftName - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_module_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_module_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x14, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x22, 0x89, 0x02, 0x0a, 0x0e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, - 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, - 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x72, 0x61, 0x66, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, - 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_module_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_module_proto_rawDescData = file_buf_alpha_registry_v1alpha1_module_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_module_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_module_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_module_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_module_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_registry_v1alpha1_module_proto_goTypes = []interface{}{ - (*LocalModuleReference)(nil), // 0: buf.alpha.registry.v1alpha1.LocalModuleReference - (*LocalModulePin)(nil), // 1: buf.alpha.registry.v1alpha1.LocalModulePin - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_module_proto_depIdxs = []int32{ - 2, // 0: buf.alpha.registry.v1alpha1.LocalModulePin.create_time:type_name -> google.protobuf.Timestamp - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_module_proto_init() } -func file_buf_alpha_registry_v1alpha1_module_proto_init() { - if File_buf_alpha_registry_v1alpha1_module_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalModuleReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_module_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalModulePin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_module_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_module_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_module_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_module_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_module_proto = out.File - file_buf_alpha_registry_v1alpha1_module_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_module_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_module_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/organization.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/organization.pb.go deleted file mode 100644 index ec1815e458..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/organization.pb.go +++ /dev/null @@ -1,2860 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/organization.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Organization struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique, immutable - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // immutable - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // mutable - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // unique, mutable - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // description is the user configurable description of the organization. - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - // url is the user configurable URL in the description of the organization, - // always included the scheme and will not have a #fragment suffix. - Url string `protobuf:"bytes,6,opt,name=url,proto3" json:"url,omitempty"` - // verification status of the organization, configurable by server admin. - VerificationStatus VerificationStatus `protobuf:"varint,7,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus" json:"verification_status,omitempty"` -} - -func (x *Organization) Reset() { - *x = Organization{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Organization) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Organization) ProtoMessage() {} - -func (x *Organization) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Organization.ProtoReflect.Descriptor instead. -func (*Organization) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{0} -} - -func (x *Organization) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Organization) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Organization) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *Organization) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Organization) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Organization) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *Organization) GetVerificationStatus() VerificationStatus { - if x != nil { - return x.VerificationStatus - } - return VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED -} - -// OrganizationMembership is a nested structure that contains -// the organization and user membership information on that organization. -type OrganizationMembership struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organization *Organization `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` - OrganizationRole OrganizationRole `protobuf:"varint,2,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"organization_role,omitempty"` -} - -func (x *OrganizationMembership) Reset() { - *x = OrganizationMembership{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrganizationMembership) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationMembership) ProtoMessage() {} - -func (x *OrganizationMembership) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OrganizationMembership.ProtoReflect.Descriptor instead. -func (*OrganizationMembership) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{1} -} - -func (x *OrganizationMembership) GetOrganization() *Organization { - if x != nil { - return x.Organization - } - return nil -} - -func (x *OrganizationMembership) GetOrganizationRole() OrganizationRole { - if x != nil { - return x.OrganizationRole - } - return OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED -} - -type GetOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetOrganizationRequest) Reset() { - *x = GetOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationRequest) ProtoMessage() {} - -func (x *GetOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationRequest.ProtoReflect.Descriptor instead. -func (*GetOrganizationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{2} -} - -func (x *GetOrganizationRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organization *Organization `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` -} - -func (x *GetOrganizationResponse) Reset() { - *x = GetOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationResponse) ProtoMessage() {} - -func (x *GetOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationResponse.ProtoReflect.Descriptor instead. -func (*GetOrganizationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{3} -} - -func (x *GetOrganizationResponse) GetOrganization() *Organization { - if x != nil { - return x.Organization - } - return nil -} - -type GetOrganizationByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetOrganizationByNameRequest) Reset() { - *x = GetOrganizationByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationByNameRequest) ProtoMessage() {} - -func (x *GetOrganizationByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationByNameRequest.ProtoReflect.Descriptor instead. -func (*GetOrganizationByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{4} -} - -func (x *GetOrganizationByNameRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetOrganizationByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organization *Organization `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` -} - -func (x *GetOrganizationByNameResponse) Reset() { - *x = GetOrganizationByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationByNameResponse) ProtoMessage() {} - -func (x *GetOrganizationByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationByNameResponse.ProtoReflect.Descriptor instead. -func (*GetOrganizationByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{5} -} - -func (x *GetOrganizationByNameResponse) GetOrganization() *Organization { - if x != nil { - return x.Organization - } - return nil -} - -type ListOrganizationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListOrganizationsRequest) Reset() { - *x = ListOrganizationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationsRequest) ProtoMessage() {} - -func (x *ListOrganizationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationsRequest.ProtoReflect.Descriptor instead. -func (*ListOrganizationsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{6} -} - -func (x *ListOrganizationsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListOrganizationsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListOrganizationsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListOrganizationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organizations []*Organization `protobuf:"bytes,1,rep,name=organizations,proto3" json:"organizations,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOrganizationsResponse) Reset() { - *x = ListOrganizationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationsResponse) ProtoMessage() {} - -func (x *ListOrganizationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationsResponse.ProtoReflect.Descriptor instead. -func (*ListOrganizationsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{7} -} - -func (x *ListOrganizationsResponse) GetOrganizations() []*Organization { - if x != nil { - return x.Organizations - } - return nil -} - -func (x *ListOrganizationsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListUserOrganizationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the user whose organizations should be listed. - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListUserOrganizationsRequest) Reset() { - *x = ListUserOrganizationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserOrganizationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserOrganizationsRequest) ProtoMessage() {} - -func (x *ListUserOrganizationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserOrganizationsRequest.ProtoReflect.Descriptor instead. -func (*ListUserOrganizationsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{8} -} - -func (x *ListUserOrganizationsRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *ListUserOrganizationsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListUserOrganizationsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListUserOrganizationsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListUserOrganizationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organizations []*OrganizationMembership `protobuf:"bytes,1,rep,name=organizations,proto3" json:"organizations,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListUserOrganizationsResponse) Reset() { - *x = ListUserOrganizationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserOrganizationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserOrganizationsResponse) ProtoMessage() {} - -func (x *ListUserOrganizationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserOrganizationsResponse.ProtoReflect.Descriptor instead. -func (*ListUserOrganizationsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{9} -} - -func (x *ListUserOrganizationsResponse) GetOrganizations() []*OrganizationMembership { - if x != nil { - return x.Organizations - } - return nil -} - -func (x *ListUserOrganizationsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type GetUserOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the user whose membership should be retrieved. - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The ID of the organization. - OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *GetUserOrganizationRequest) Reset() { - *x = GetUserOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserOrganizationRequest) ProtoMessage() {} - -func (x *GetUserOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserOrganizationRequest.ProtoReflect.Descriptor instead. -func (*GetUserOrganizationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{10} -} - -func (x *GetUserOrganizationRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *GetUserOrganizationRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type GetUserOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OrganizationMembership *OrganizationMembership `protobuf:"bytes,1,opt,name=organization_membership,json=organizationMembership,proto3" json:"organization_membership,omitempty"` -} - -func (x *GetUserOrganizationResponse) Reset() { - *x = GetUserOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserOrganizationResponse) ProtoMessage() {} - -func (x *GetUserOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserOrganizationResponse.ProtoReflect.Descriptor instead. -func (*GetUserOrganizationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{11} -} - -func (x *GetUserOrganizationResponse) GetOrganizationMembership() *OrganizationMembership { - if x != nil { - return x.OrganizationMembership - } - return nil -} - -type CreateOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Must be unique across organizations. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *CreateOrganizationRequest) Reset() { - *x = CreateOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationRequest) ProtoMessage() {} - -func (x *CreateOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationRequest.ProtoReflect.Descriptor instead. -func (*CreateOrganizationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{12} -} - -func (x *CreateOrganizationRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type CreateOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Organization *Organization `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` -} - -func (x *CreateOrganizationResponse) Reset() { - *x = CreateOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateOrganizationResponse) ProtoMessage() {} - -func (x *CreateOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateOrganizationResponse.ProtoReflect.Descriptor instead. -func (*CreateOrganizationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{13} -} - -func (x *CreateOrganizationResponse) GetOrganization() *Organization { - if x != nil { - return x.Organization - } - return nil -} - -type DeleteOrganizationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteOrganizationRequest) Reset() { - *x = DeleteOrganizationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationRequest) ProtoMessage() {} - -func (x *DeleteOrganizationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationRequest.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{14} -} - -func (x *DeleteOrganizationRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type DeleteOrganizationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteOrganizationResponse) Reset() { - *x = DeleteOrganizationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationResponse) ProtoMessage() {} - -func (x *DeleteOrganizationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationResponse.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{15} -} - -type DeleteOrganizationByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *DeleteOrganizationByNameRequest) Reset() { - *x = DeleteOrganizationByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationByNameRequest) ProtoMessage() {} - -func (x *DeleteOrganizationByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationByNameRequest.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{16} -} - -func (x *DeleteOrganizationByNameRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type DeleteOrganizationByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteOrganizationByNameResponse) Reset() { - *x = DeleteOrganizationByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteOrganizationByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteOrganizationByNameResponse) ProtoMessage() {} - -func (x *DeleteOrganizationByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteOrganizationByNameResponse.ProtoReflect.Descriptor instead. -func (*DeleteOrganizationByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{17} -} - -type AddOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which the user will be added to. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The ID of the user for which to be added to the organization. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The new role of the user in the organization. - OrganizationRole OrganizationRole `protobuf:"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"organization_role,omitempty"` -} - -func (x *AddOrganizationMemberRequest) Reset() { - *x = AddOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOrganizationMemberRequest) ProtoMessage() {} - -func (x *AddOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*AddOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{18} -} - -func (x *AddOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *AddOrganizationMemberRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *AddOrganizationMemberRequest) GetOrganizationRole() OrganizationRole { - if x != nil { - return x.OrganizationRole - } - return OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED -} - -type AddOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AddOrganizationMemberResponse) Reset() { - *x = AddOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOrganizationMemberResponse) ProtoMessage() {} - -func (x *AddOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*AddOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{19} -} - -type UpdateOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which the member belongs to. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The ID of the user for which to be updated the role. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The new role of the user in the organization. - OrganizationRole OrganizationRole `protobuf:"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"organization_role,omitempty"` -} - -func (x *UpdateOrganizationMemberRequest) Reset() { - *x = UpdateOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationMemberRequest) ProtoMessage() {} - -func (x *UpdateOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{20} -} - -func (x *UpdateOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *UpdateOrganizationMemberRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *UpdateOrganizationMemberRequest) GetOrganizationRole() OrganizationRole { - if x != nil { - return x.OrganizationRole - } - return OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED -} - -type UpdateOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateOrganizationMemberResponse) Reset() { - *x = UpdateOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationMemberResponse) ProtoMessage() {} - -func (x *UpdateOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{21} -} - -type RemoveOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which the member belongs to. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The ID of the user for which to be removed the role. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *RemoveOrganizationMemberRequest) Reset() { - *x = RemoveOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOrganizationMemberRequest) ProtoMessage() {} - -func (x *RemoveOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*RemoveOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{22} -} - -func (x *RemoveOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *RemoveOrganizationMemberRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type RemoveOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveOrganizationMemberResponse) Reset() { - *x = RemoveOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOrganizationMemberResponse) ProtoMessage() {} - -func (x *RemoveOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*RemoveOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{23} -} - -type SetOrganizationMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which the user's role will be set. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The ID of the user whose role will be set. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The role to assign to the user. - // Setting UNSPECIFIED means removing the user's role. - OrganizationRole OrganizationRole `protobuf:"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"organization_role,omitempty"` -} - -func (x *SetOrganizationMemberRequest) Reset() { - *x = SetOrganizationMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetOrganizationMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetOrganizationMemberRequest) ProtoMessage() {} - -func (x *SetOrganizationMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetOrganizationMemberRequest.ProtoReflect.Descriptor instead. -func (*SetOrganizationMemberRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{24} -} - -func (x *SetOrganizationMemberRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *SetOrganizationMemberRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *SetOrganizationMemberRequest) GetOrganizationRole() OrganizationRole { - if x != nil { - return x.OrganizationRole - } - return OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED -} - -type SetOrganizationMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetOrganizationMemberResponse) Reset() { - *x = SetOrganizationMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetOrganizationMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetOrganizationMemberResponse) ProtoMessage() {} - -func (x *SetOrganizationMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetOrganizationMemberResponse.ProtoReflect.Descriptor instead. -func (*SetOrganizationMemberResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{25} -} - -type GetOrganizationSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to get the settings. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` -} - -func (x *GetOrganizationSettingsRequest) Reset() { - *x = GetOrganizationSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationSettingsRequest) ProtoMessage() {} - -func (x *GetOrganizationSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationSettingsRequest.ProtoReflect.Descriptor instead. -func (*GetOrganizationSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{26} -} - -func (x *GetOrganizationSettingsRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -type GetOrganizationSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryBaseRole RepositoryRole `protobuf:"varint,1,opt,name=repository_base_role,json=repositoryBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"repository_base_role,omitempty"` - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. - PluginBaseRole PluginRole `protobuf:"varint,2,opt,name=plugin_base_role,json=pluginBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.PluginRole" json:"plugin_base_role,omitempty"` - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. - TemplateBaseRole TemplateRole `protobuf:"varint,3,opt,name=template_base_role,json=templateBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.TemplateRole" json:"template_base_role,omitempty"` - // The number of members in the organization. - MembersCount uint32 `protobuf:"varint,4,opt,name=members_count,json=membersCount,proto3" json:"members_count,omitempty"` - // The IdP groups associated with the organization. - IdpGroups []string `protobuf:"bytes,5,rep,name=idp_groups,json=idpGroups,proto3" json:"idp_groups,omitempty"` -} - -func (x *GetOrganizationSettingsResponse) Reset() { - *x = GetOrganizationSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOrganizationSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOrganizationSettingsResponse) ProtoMessage() {} - -func (x *GetOrganizationSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOrganizationSettingsResponse.ProtoReflect.Descriptor instead. -func (*GetOrganizationSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{27} -} - -func (x *GetOrganizationSettingsResponse) GetRepositoryBaseRole() RepositoryRole { - if x != nil { - return x.RepositoryBaseRole - } - return RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. -func (x *GetOrganizationSettingsResponse) GetPluginBaseRole() PluginRole { - if x != nil { - return x.PluginBaseRole - } - return PluginRole_PLUGIN_ROLE_UNSPECIFIED -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. -func (x *GetOrganizationSettingsResponse) GetTemplateBaseRole() TemplateRole { - if x != nil { - return x.TemplateBaseRole - } - return TemplateRole_TEMPLATE_ROLE_UNSPECIFIED -} - -func (x *GetOrganizationSettingsResponse) GetMembersCount() uint32 { - if x != nil { - return x.MembersCount - } - return 0 -} - -func (x *GetOrganizationSettingsResponse) GetIdpGroups() []string { - if x != nil { - return x.IdpGroups - } - return nil -} - -type UpdateOrganizationSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to update the base roles. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // optional, no update to this base role will be made if this is unspecified. - RepositoryBaseRole RepositoryRole `protobuf:"varint,2,opt,name=repository_base_role,json=repositoryBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"repository_base_role,omitempty"` - // optional, no update to this base role will be made if this is unspecified. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. - PluginBaseRole PluginRole `protobuf:"varint,3,opt,name=plugin_base_role,json=pluginBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.PluginRole" json:"plugin_base_role,omitempty"` - // optional, no update to this base role will be made if this is unspecified. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. - TemplateBaseRole TemplateRole `protobuf:"varint,4,opt,name=template_base_role,json=templateBaseRole,proto3,enum=buf.alpha.registry.v1alpha1.TemplateRole" json:"template_base_role,omitempty"` - // optional, update to description will only be made when this is present - Description *string `protobuf:"bytes,5,opt,name=description,proto3,oneof" json:"description,omitempty"` - // optional, update to url will only be made when this is present - Url *string `protobuf:"bytes,6,opt,name=url,proto3,oneof" json:"url,omitempty"` -} - -func (x *UpdateOrganizationSettingsRequest) Reset() { - *x = UpdateOrganizationSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationSettingsRequest) ProtoMessage() {} - -func (x *UpdateOrganizationSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationSettingsRequest.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{28} -} - -func (x *UpdateOrganizationSettingsRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *UpdateOrganizationSettingsRequest) GetRepositoryBaseRole() RepositoryRole { - if x != nil { - return x.RepositoryBaseRole - } - return RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. -func (x *UpdateOrganizationSettingsRequest) GetPluginBaseRole() PluginRole { - if x != nil { - return x.PluginBaseRole - } - return PluginRole_PLUGIN_ROLE_UNSPECIFIED -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/organization.proto. -func (x *UpdateOrganizationSettingsRequest) GetTemplateBaseRole() TemplateRole { - if x != nil { - return x.TemplateBaseRole - } - return TemplateRole_TEMPLATE_ROLE_UNSPECIFIED -} - -func (x *UpdateOrganizationSettingsRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *UpdateOrganizationSettingsRequest) GetUrl() string { - if x != nil && x.Url != nil { - return *x.Url - } - return "" -} - -type UpdateOrganizationSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateOrganizationSettingsResponse) Reset() { - *x = UpdateOrganizationSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateOrganizationSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateOrganizationSettingsResponse) ProtoMessage() {} - -func (x *UpdateOrganizationSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateOrganizationSettingsResponse.ProtoReflect.Descriptor instead. -func (*UpdateOrganizationSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{29} -} - -type AddOrganizationGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to add the group. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The name of the group to add. - GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` -} - -func (x *AddOrganizationGroupRequest) Reset() { - *x = AddOrganizationGroupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOrganizationGroupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOrganizationGroupRequest) ProtoMessage() {} - -func (x *AddOrganizationGroupRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOrganizationGroupRequest.ProtoReflect.Descriptor instead. -func (*AddOrganizationGroupRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{30} -} - -func (x *AddOrganizationGroupRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *AddOrganizationGroupRequest) GetGroupName() string { - if x != nil { - return x.GroupName - } - return "" -} - -type AddOrganizationGroupResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *AddOrganizationGroupResponse) Reset() { - *x = AddOrganizationGroupResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddOrganizationGroupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddOrganizationGroupResponse) ProtoMessage() {} - -func (x *AddOrganizationGroupResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddOrganizationGroupResponse.ProtoReflect.Descriptor instead. -func (*AddOrganizationGroupResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{31} -} - -type RemoveOrganizationGroupRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization for which to remove the group. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The name of the group to remove. - GroupName string `protobuf:"bytes,2,opt,name=group_name,json=groupName,proto3" json:"group_name,omitempty"` -} - -func (x *RemoveOrganizationGroupRequest) Reset() { - *x = RemoveOrganizationGroupRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOrganizationGroupRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOrganizationGroupRequest) ProtoMessage() {} - -func (x *RemoveOrganizationGroupRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOrganizationGroupRequest.ProtoReflect.Descriptor instead. -func (*RemoveOrganizationGroupRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{32} -} - -func (x *RemoveOrganizationGroupRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *RemoveOrganizationGroupRequest) GetGroupName() string { - if x != nil { - return x.GroupName - } - return "" -} - -type RemoveOrganizationGroupResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveOrganizationGroupResponse) Reset() { - *x = RemoveOrganizationGroupResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveOrganizationGroupResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveOrganizationGroupResponse) ProtoMessage() {} - -func (x *RemoveOrganizationGroupResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RemoveOrganizationGroupResponse.ProtoReflect.Descriptor instead. -func (*RemoveOrganizationGroupResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP(), []int{33} -} - -var File_buf_alpha_registry_v1alpha1_organization_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc = []byte{ - 0x0a, 0x2e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x02, - 0x0a, 0x0c, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, - 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x12, 0x60, 0x0a, 0x13, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0xc3, 0x01, 0x0a, 0x16, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x12, 0x4d, 0x0a, - 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5a, 0x0a, 0x11, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x28, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x22, 0x68, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, - 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x32, 0x0a, 0x1c, - 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x22, 0x6e, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0x70, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4f, 0x0a, 0x0d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x8d, 0x01, 0x0a, 0x1c, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xa2, 0x01, 0x0a, 0x1d, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x0d, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x52, 0x0d, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5e, - 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x8b, - 0x01, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, - 0x0a, 0x17, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x68, 0x69, 0x70, 0x52, 0x16, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x68, 0x69, 0x70, 0x22, 0x2f, 0x0a, 0x19, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x6b, 0x0a, - 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2b, 0x0a, 0x19, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x0a, 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x22, 0x0a, 0x20, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xbc, 0x01, 0x0a, 0x1c, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x5a, 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x10, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x22, - 0x1f, 0x0a, 0x1d, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0xbf, 0x01, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x5a, 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, - 0x6c, 0x65, 0x22, 0x22, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x0a, 0x1f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x22, 0x0a, 0x20, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xbc, 0x01, 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x5a, 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x10, 0x6f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x1f, - 0x0a, 0x1d, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x49, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xf8, 0x02, 0x0a, 0x1f, 0x47, - 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5d, - 0x0a, 0x14, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x61, 0x73, - 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x55, 0x0a, - 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x6f, 0x6c, 0x65, - 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x61, 0x73, 0x65, - 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x5b, 0x0a, 0x12, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, - 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x42, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x64, 0x70, 0x5f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x69, 0x64, 0x70, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xb5, 0x03, 0x0a, 0x21, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x5d, 0x0a, 0x14, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x61, 0x73, 0x65, 0x52, - 0x6f, 0x6c, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x62, 0x61, - 0x73, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x5b, 0x0a, 0x12, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x72, 0x6f, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, - 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x42, - 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, - 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x75, - 0x72, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x24, 0x0a, - 0x22, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x1b, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x41, 0x64, - 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x68, 0x0a, 0x1e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x21, 0x0a, 0x1f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xe3, 0x12, 0x0a, 0x13, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x39, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x02, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x02, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x39, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x97, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, - 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x02, 0x12, 0x8e, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x39, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9d, - 0x01, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3e, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x90, - 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x41, 0x64, 0x64, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x02, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x3b, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x9e, 0x02, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x11, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, - 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_organization_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_organization_proto_rawDescData = file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_organization_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_organization_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_organization_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_organization_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_organization_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes = make([]protoimpl.MessageInfo, 34) -var file_buf_alpha_registry_v1alpha1_organization_proto_goTypes = []interface{}{ - (*Organization)(nil), // 0: buf.alpha.registry.v1alpha1.Organization - (*OrganizationMembership)(nil), // 1: buf.alpha.registry.v1alpha1.OrganizationMembership - (*GetOrganizationRequest)(nil), // 2: buf.alpha.registry.v1alpha1.GetOrganizationRequest - (*GetOrganizationResponse)(nil), // 3: buf.alpha.registry.v1alpha1.GetOrganizationResponse - (*GetOrganizationByNameRequest)(nil), // 4: buf.alpha.registry.v1alpha1.GetOrganizationByNameRequest - (*GetOrganizationByNameResponse)(nil), // 5: buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse - (*ListOrganizationsRequest)(nil), // 6: buf.alpha.registry.v1alpha1.ListOrganizationsRequest - (*ListOrganizationsResponse)(nil), // 7: buf.alpha.registry.v1alpha1.ListOrganizationsResponse - (*ListUserOrganizationsRequest)(nil), // 8: buf.alpha.registry.v1alpha1.ListUserOrganizationsRequest - (*ListUserOrganizationsResponse)(nil), // 9: buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse - (*GetUserOrganizationRequest)(nil), // 10: buf.alpha.registry.v1alpha1.GetUserOrganizationRequest - (*GetUserOrganizationResponse)(nil), // 11: buf.alpha.registry.v1alpha1.GetUserOrganizationResponse - (*CreateOrganizationRequest)(nil), // 12: buf.alpha.registry.v1alpha1.CreateOrganizationRequest - (*CreateOrganizationResponse)(nil), // 13: buf.alpha.registry.v1alpha1.CreateOrganizationResponse - (*DeleteOrganizationRequest)(nil), // 14: buf.alpha.registry.v1alpha1.DeleteOrganizationRequest - (*DeleteOrganizationResponse)(nil), // 15: buf.alpha.registry.v1alpha1.DeleteOrganizationResponse - (*DeleteOrganizationByNameRequest)(nil), // 16: buf.alpha.registry.v1alpha1.DeleteOrganizationByNameRequest - (*DeleteOrganizationByNameResponse)(nil), // 17: buf.alpha.registry.v1alpha1.DeleteOrganizationByNameResponse - (*AddOrganizationMemberRequest)(nil), // 18: buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest - (*AddOrganizationMemberResponse)(nil), // 19: buf.alpha.registry.v1alpha1.AddOrganizationMemberResponse - (*UpdateOrganizationMemberRequest)(nil), // 20: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest - (*UpdateOrganizationMemberResponse)(nil), // 21: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberResponse - (*RemoveOrganizationMemberRequest)(nil), // 22: buf.alpha.registry.v1alpha1.RemoveOrganizationMemberRequest - (*RemoveOrganizationMemberResponse)(nil), // 23: buf.alpha.registry.v1alpha1.RemoveOrganizationMemberResponse - (*SetOrganizationMemberRequest)(nil), // 24: buf.alpha.registry.v1alpha1.SetOrganizationMemberRequest - (*SetOrganizationMemberResponse)(nil), // 25: buf.alpha.registry.v1alpha1.SetOrganizationMemberResponse - (*GetOrganizationSettingsRequest)(nil), // 26: buf.alpha.registry.v1alpha1.GetOrganizationSettingsRequest - (*GetOrganizationSettingsResponse)(nil), // 27: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse - (*UpdateOrganizationSettingsRequest)(nil), // 28: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest - (*UpdateOrganizationSettingsResponse)(nil), // 29: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsResponse - (*AddOrganizationGroupRequest)(nil), // 30: buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest - (*AddOrganizationGroupResponse)(nil), // 31: buf.alpha.registry.v1alpha1.AddOrganizationGroupResponse - (*RemoveOrganizationGroupRequest)(nil), // 32: buf.alpha.registry.v1alpha1.RemoveOrganizationGroupRequest - (*RemoveOrganizationGroupResponse)(nil), // 33: buf.alpha.registry.v1alpha1.RemoveOrganizationGroupResponse - (*timestamppb.Timestamp)(nil), // 34: google.protobuf.Timestamp - (VerificationStatus)(0), // 35: buf.alpha.registry.v1alpha1.VerificationStatus - (OrganizationRole)(0), // 36: buf.alpha.registry.v1alpha1.OrganizationRole - (RepositoryRole)(0), // 37: buf.alpha.registry.v1alpha1.RepositoryRole - (PluginRole)(0), // 38: buf.alpha.registry.v1alpha1.PluginRole - (TemplateRole)(0), // 39: buf.alpha.registry.v1alpha1.TemplateRole -} -var file_buf_alpha_registry_v1alpha1_organization_proto_depIdxs = []int32{ - 34, // 0: buf.alpha.registry.v1alpha1.Organization.create_time:type_name -> google.protobuf.Timestamp - 34, // 1: buf.alpha.registry.v1alpha1.Organization.update_time:type_name -> google.protobuf.Timestamp - 35, // 2: buf.alpha.registry.v1alpha1.Organization.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus - 0, // 3: buf.alpha.registry.v1alpha1.OrganizationMembership.organization:type_name -> buf.alpha.registry.v1alpha1.Organization - 36, // 4: buf.alpha.registry.v1alpha1.OrganizationMembership.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 0, // 5: buf.alpha.registry.v1alpha1.GetOrganizationResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization - 0, // 6: buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization - 0, // 7: buf.alpha.registry.v1alpha1.ListOrganizationsResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.Organization - 1, // 8: buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse.organizations:type_name -> buf.alpha.registry.v1alpha1.OrganizationMembership - 1, // 9: buf.alpha.registry.v1alpha1.GetUserOrganizationResponse.organization_membership:type_name -> buf.alpha.registry.v1alpha1.OrganizationMembership - 0, // 10: buf.alpha.registry.v1alpha1.CreateOrganizationResponse.organization:type_name -> buf.alpha.registry.v1alpha1.Organization - 36, // 11: buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 36, // 12: buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 36, // 13: buf.alpha.registry.v1alpha1.SetOrganizationMemberRequest.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 37, // 14: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.repository_base_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 38, // 15: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.plugin_base_role:type_name -> buf.alpha.registry.v1alpha1.PluginRole - 39, // 16: buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse.template_base_role:type_name -> buf.alpha.registry.v1alpha1.TemplateRole - 37, // 17: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest.repository_base_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 38, // 18: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest.plugin_base_role:type_name -> buf.alpha.registry.v1alpha1.PluginRole - 39, // 19: buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest.template_base_role:type_name -> buf.alpha.registry.v1alpha1.TemplateRole - 2, // 20: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationRequest - 4, // 21: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationByNameRequest - 6, // 22: buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationsRequest - 8, // 23: buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations:input_type -> buf.alpha.registry.v1alpha1.ListUserOrganizationsRequest - 10, // 24: buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization:input_type -> buf.alpha.registry.v1alpha1.GetUserOrganizationRequest - 12, // 25: buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization:input_type -> buf.alpha.registry.v1alpha1.CreateOrganizationRequest - 14, // 26: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization:input_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationRequest - 16, // 27: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName:input_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationByNameRequest - 18, // 28: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.AddOrganizationMemberRequest - 20, // 29: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationMemberRequest - 22, // 30: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationMemberRequest - 24, // 31: buf.alpha.registry.v1alpha1.OrganizationService.SetOrganizationMember:input_type -> buf.alpha.registry.v1alpha1.SetOrganizationMemberRequest - 26, // 32: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.GetOrganizationSettingsRequest - 28, // 33: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings:input_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsRequest - 30, // 34: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup:input_type -> buf.alpha.registry.v1alpha1.AddOrganizationGroupRequest - 32, // 35: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup:input_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationGroupRequest - 3, // 36: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganization:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationResponse - 5, // 37: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationByName:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationByNameResponse - 7, // 38: buf.alpha.registry.v1alpha1.OrganizationService.ListOrganizations:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationsResponse - 9, // 39: buf.alpha.registry.v1alpha1.OrganizationService.ListUserOrganizations:output_type -> buf.alpha.registry.v1alpha1.ListUserOrganizationsResponse - 11, // 40: buf.alpha.registry.v1alpha1.OrganizationService.GetUserOrganization:output_type -> buf.alpha.registry.v1alpha1.GetUserOrganizationResponse - 13, // 41: buf.alpha.registry.v1alpha1.OrganizationService.CreateOrganization:output_type -> buf.alpha.registry.v1alpha1.CreateOrganizationResponse - 15, // 42: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganization:output_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationResponse - 17, // 43: buf.alpha.registry.v1alpha1.OrganizationService.DeleteOrganizationByName:output_type -> buf.alpha.registry.v1alpha1.DeleteOrganizationByNameResponse - 19, // 44: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.AddOrganizationMemberResponse - 21, // 45: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationMemberResponse - 23, // 46: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationMemberResponse - 25, // 47: buf.alpha.registry.v1alpha1.OrganizationService.SetOrganizationMember:output_type -> buf.alpha.registry.v1alpha1.SetOrganizationMemberResponse - 27, // 48: buf.alpha.registry.v1alpha1.OrganizationService.GetOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.GetOrganizationSettingsResponse - 29, // 49: buf.alpha.registry.v1alpha1.OrganizationService.UpdateOrganizationSettings:output_type -> buf.alpha.registry.v1alpha1.UpdateOrganizationSettingsResponse - 31, // 50: buf.alpha.registry.v1alpha1.OrganizationService.AddOrganizationGroup:output_type -> buf.alpha.registry.v1alpha1.AddOrganizationGroupResponse - 33, // 51: buf.alpha.registry.v1alpha1.OrganizationService.RemoveOrganizationGroup:output_type -> buf.alpha.registry.v1alpha1.RemoveOrganizationGroupResponse - 36, // [36:52] is the sub-list for method output_type - 20, // [20:36] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_organization_proto_init() } -func file_buf_alpha_registry_v1alpha1_organization_proto_init() { - if File_buf_alpha_registry_v1alpha1_organization_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_role_proto_init() - file_buf_alpha_registry_v1alpha1_verification_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Organization); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrganizationMembership); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserOrganizationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserOrganizationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteOrganizationByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetOrganizationMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetOrganizationMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOrganizationSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateOrganizationSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOrganizationGroupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddOrganizationGroupResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOrganizationGroupRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveOrganizationGroupResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes[28].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc, - NumEnums: 0, - NumMessages: 34, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_organization_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_organization_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_organization_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_organization_proto = out.File - file_buf_alpha_registry_v1alpha1_organization_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_organization_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_organization_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/owner.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/owner.pb.go deleted file mode 100644 index ed99dae6bc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/owner.pb.go +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/owner.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Owner struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Owner: - // - // *Owner_User - // *Owner_Organization - Owner isOwner_Owner `protobuf_oneof:"owner"` -} - -func (x *Owner) Reset() { - *x = Owner{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Owner) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Owner) ProtoMessage() {} - -func (x *Owner) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Owner.ProtoReflect.Descriptor instead. -func (*Owner) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_owner_proto_rawDescGZIP(), []int{0} -} - -func (m *Owner) GetOwner() isOwner_Owner { - if m != nil { - return m.Owner - } - return nil -} - -func (x *Owner) GetUser() *User { - if x, ok := x.GetOwner().(*Owner_User); ok { - return x.User - } - return nil -} - -func (x *Owner) GetOrganization() *Organization { - if x, ok := x.GetOwner().(*Owner_Organization); ok { - return x.Organization - } - return nil -} - -type isOwner_Owner interface { - isOwner_Owner() -} - -type Owner_User struct { - // The requested owner is a `User`. - User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof"` -} - -type Owner_Organization struct { - // The requested owner is a `Organization`. - Organization *Organization `protobuf:"bytes,2,opt,name=organization,proto3,oneof"` -} - -func (*Owner_User) isOwner_Owner() {} - -func (*Owner_Organization) isOwner_Owner() {} - -type GetOwnerByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the requested owner. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetOwnerByNameRequest) Reset() { - *x = GetOwnerByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOwnerByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOwnerByNameRequest) ProtoMessage() {} - -func (x *GetOwnerByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOwnerByNameRequest.ProtoReflect.Descriptor instead. -func (*GetOwnerByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_owner_proto_rawDescGZIP(), []int{1} -} - -func (x *GetOwnerByNameRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetOwnerByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner *Owner `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (x *GetOwnerByNameResponse) Reset() { - *x = GetOwnerByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetOwnerByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetOwnerByNameResponse) ProtoMessage() {} - -func (x *GetOwnerByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetOwnerByNameResponse.ProtoReflect.Descriptor instead. -func (*GetOwnerByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_owner_proto_rawDescGZIP(), []int{2} -} - -func (x *GetOwnerByNameResponse) GetOwner() *Owner { - if x != nil { - return x.Owner - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_owner_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x2e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a, - 0x01, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x12, 0x4f, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x2b, 0x0a, 0x15, 0x47, - 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x38, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x32, 0x8e, 0x01, 0x0a, - 0x0c, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7e, 0x0a, - 0x0e, 0x47, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x97, 0x02, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0a, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, - 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, - 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, - 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_owner_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_owner_proto_rawDescData = file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_owner_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_owner_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_owner_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_owner_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_owner_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_buf_alpha_registry_v1alpha1_owner_proto_goTypes = []interface{}{ - (*Owner)(nil), // 0: buf.alpha.registry.v1alpha1.Owner - (*GetOwnerByNameRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetOwnerByNameRequest - (*GetOwnerByNameResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse - (*User)(nil), // 3: buf.alpha.registry.v1alpha1.User - (*Organization)(nil), // 4: buf.alpha.registry.v1alpha1.Organization -} -var file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = []int32{ - 3, // 0: buf.alpha.registry.v1alpha1.Owner.user:type_name -> buf.alpha.registry.v1alpha1.User - 4, // 1: buf.alpha.registry.v1alpha1.Owner.organization:type_name -> buf.alpha.registry.v1alpha1.Organization - 0, // 2: buf.alpha.registry.v1alpha1.GetOwnerByNameResponse.owner:type_name -> buf.alpha.registry.v1alpha1.Owner - 1, // 3: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:input_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameRequest - 2, // 4: buf.alpha.registry.v1alpha1.OwnerService.GetOwnerByName:output_type -> buf.alpha.registry.v1alpha1.GetOwnerByNameResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_owner_proto_init() } -func file_buf_alpha_registry_v1alpha1_owner_proto_init() { - if File_buf_alpha_registry_v1alpha1_owner_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_organization_proto_init() - file_buf_alpha_registry_v1alpha1_user_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Owner); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOwnerByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetOwnerByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Owner_User)(nil), - (*Owner_Organization)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_owner_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_owner_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_owner_proto = out.File - file_buf_alpha_registry_v1alpha1_owner_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_owner_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_owner_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin.pb.go deleted file mode 100644 index 40b78c8966..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin.pb.go +++ /dev/null @@ -1,3845 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// buf/alpha/registry/v1alpha1/plugin.proto is a deprecated file. - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// PluginVisibility defines the visibility options available -// for Plugins and Templates. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type PluginVisibility int32 - -const ( - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED PluginVisibility = 0 - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVisibility_PLUGIN_VISIBILITY_PUBLIC PluginVisibility = 1 - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVisibility_PLUGIN_VISIBILITY_PRIVATE PluginVisibility = 2 -) - -// Enum value maps for PluginVisibility. -var ( - PluginVisibility_name = map[int32]string{ - 0: "PLUGIN_VISIBILITY_UNSPECIFIED", - 1: "PLUGIN_VISIBILITY_PUBLIC", - 2: "PLUGIN_VISIBILITY_PRIVATE", - } - PluginVisibility_value = map[string]int32{ - "PLUGIN_VISIBILITY_UNSPECIFIED": 0, - "PLUGIN_VISIBILITY_PUBLIC": 1, - "PLUGIN_VISIBILITY_PRIVATE": 2, - } -) - -func (x PluginVisibility) Enum() *PluginVisibility { - p := new(PluginVisibility) - *p = x - return p -} - -func (x PluginVisibility) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PluginVisibility) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_proto_enumTypes[0].Descriptor() -} - -func (PluginVisibility) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_proto_enumTypes[0] -} - -func (x PluginVisibility) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PluginVisibility.Descriptor instead. -func (PluginVisibility) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{0} -} - -// Plugin represents a protoc plugin, such as protoc-gen-go. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type Plugin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the plugin, which uniquely identifies the plugin. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the plugin, i.e. "protoc-gen-go". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the owner of the plugin. Either a username or - // organization name. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - // The visibility of the plugin. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Visibility PluginVisibility `protobuf:"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.PluginVisibility" json:"visibility,omitempty"` - // deprecated means this plugin is deprecated. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Deprecated bool `protobuf:"varint,5,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // deprecation_message is the message shown if the plugin is deprecated. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - DeprecationMessage string `protobuf:"bytes,6,opt,name=deprecation_message,json=deprecationMessage,proto3" json:"deprecation_message,omitempty"` - // The creation time of the plugin. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The last update time of the plugin object. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` -} - -func (x *Plugin) Reset() { - *x = Plugin{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Plugin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Plugin) ProtoMessage() {} - -func (x *Plugin) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Plugin.ProtoReflect.Descriptor instead. -func (*Plugin) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{0} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetVisibility() PluginVisibility { - if x != nil { - return x.Visibility - } - return PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetDeprecationMessage() string { - if x != nil { - return x.DeprecationMessage - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Plugin) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -// PluginVersion represents a specific build of a plugin, -// such as protoc-gen-go v1.4.0. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type PluginVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the plugin version, which uniquely identifies the plugin version. - // Mostly used for pagination. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the version, i.e. "v1.4.0". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the plugin to which this version relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginName string `protobuf:"bytes,3,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"` - // The owner of the plugin to which this version relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginOwner string `protobuf:"bytes,4,opt,name=plugin_owner,json=pluginOwner,proto3" json:"plugin_owner,omitempty"` - // The full container image digest associated with this plugin version including - // the algorithm. - // Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - ContainerImageDigest string `protobuf:"bytes,5,opt,name=container_image_digest,json=containerImageDigest,proto3" json:"container_image_digest,omitempty"` - // Optionally define the runtime libraries. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - RuntimeLibraries []*RuntimeLibrary `protobuf:"bytes,6,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` -} - -func (x *PluginVersion) Reset() { - *x = PluginVersion{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginVersion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginVersion) ProtoMessage() {} - -func (x *PluginVersion) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginVersion.ProtoReflect.Descriptor instead. -func (*PluginVersion) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{1} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetPluginName() string { - if x != nil { - return x.PluginName - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetPluginOwner() string { - if x != nil { - return x.PluginOwner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetContainerImageDigest() string { - if x != nil { - return x.ContainerImageDigest - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersion) GetRuntimeLibraries() []*RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -// Template defines a set of plugins that should be used together -// i.e. "go-grpc" would include protoc-gen-go and protoc-gen-go-grpc. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type Template struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the template, which uniquely identifies the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the template, i.e. "grpc-go". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the owner of the template. Either a - // username or organization name. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - // Must not contain duplicate plugins. Order of plugin configs - // dictates insertion point order. Note that we're - // intentionally putting most of the plugin configuration - // in the template, so that template versions are - // less likely to cause breakages for users. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginConfigs []*PluginConfig `protobuf:"bytes,4,rep,name=plugin_configs,json=pluginConfigs,proto3" json:"plugin_configs,omitempty"` - // The visibility of the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Visibility PluginVisibility `protobuf:"varint,5,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.PluginVisibility" json:"visibility,omitempty"` - // deprecated means this template is deprecated. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Deprecated bool `protobuf:"varint,8,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // deprecation_message is the message shown if the template is deprecated. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - DeprecationMessage string `protobuf:"bytes,9,opt,name=deprecation_message,json=deprecationMessage,proto3" json:"deprecation_message,omitempty"` - // The creation time of the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The last update time of the template object. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` -} - -func (x *Template) Reset() { - *x = Template{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Template) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Template) ProtoMessage() {} - -func (x *Template) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Template.ProtoReflect.Descriptor instead. -func (*Template) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{2} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetPluginConfigs() []*PluginConfig { - if x != nil { - return x.PluginConfigs - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetVisibility() PluginVisibility { - if x != nil { - return x.Visibility - } - return PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetDeprecationMessage() string { - if x != nil { - return x.DeprecationMessage - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *Template) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -// PluginConfig defines a runtime configuration for a plugin. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type PluginConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin to which this config relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginOwner string `protobuf:"bytes,1,opt,name=plugin_owner,json=pluginOwner,proto3" json:"plugin_owner,omitempty"` - // The name of the plugin to which this config relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginName string `protobuf:"bytes,2,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"` - // Parameters that should be provided to the plugin. These are - // joined with a "," before being provided to the plugin at runtime. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Parameters []string `protobuf:"bytes,3,rep,name=parameters,proto3" json:"parameters,omitempty"` - // True if the source plugin is inaccessible by the user. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Inaccessible bool `protobuf:"varint,5,opt,name=inaccessible,proto3" json:"inaccessible,omitempty"` -} - -func (x *PluginConfig) Reset() { - *x = PluginConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginConfig) ProtoMessage() {} - -func (x *PluginConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginConfig.ProtoReflect.Descriptor instead. -func (*PluginConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{3} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginConfig) GetPluginOwner() string { - if x != nil { - return x.PluginOwner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginConfig) GetPluginName() string { - if x != nil { - return x.PluginName - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginConfig) GetParameters() []string { - if x != nil { - return x.Parameters - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginConfig) GetInaccessible() bool { - if x != nil { - return x.Inaccessible - } - return false -} - -// TemplateVersion defines a template at a -// specific set of versions for the contained plugins. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type TemplateVersion struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the template version, which uniquely identifies the template version. - // Mostly used for pagination. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the template version, i.e. "v1". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The owner of the template to which this version relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - TemplateOwner string `protobuf:"bytes,3,opt,name=template_owner,json=templateOwner,proto3" json:"template_owner,omitempty"` - // The name of the template to which this version relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - TemplateName string `protobuf:"bytes,4,opt,name=template_name,json=templateName,proto3" json:"template_name,omitempty"` - // A map from plugin owner and name to version for the plugins - // defined in the template. Every plugin in the template - // must have a corresponding version in this array. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVersions []*PluginVersionMapping `protobuf:"bytes,5,rep,name=plugin_versions,json=pluginVersions,proto3" json:"plugin_versions,omitempty"` -} - -func (x *TemplateVersion) Reset() { - *x = TemplateVersion{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TemplateVersion) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TemplateVersion) ProtoMessage() {} - -func (x *TemplateVersion) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TemplateVersion.ProtoReflect.Descriptor instead. -func (*TemplateVersion) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{4} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *TemplateVersion) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *TemplateVersion) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *TemplateVersion) GetTemplateOwner() string { - if x != nil { - return x.TemplateOwner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *TemplateVersion) GetTemplateName() string { - if x != nil { - return x.TemplateName - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *TemplateVersion) GetPluginVersions() []*PluginVersionMapping { - if x != nil { - return x.PluginVersions - } - return nil -} - -// PluginVersionMapping maps a plugin_id to a version. -// -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type PluginVersionMapping struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin to which this mapping relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginOwner string `protobuf:"bytes,1,opt,name=plugin_owner,json=pluginOwner,proto3" json:"plugin_owner,omitempty"` - // The name of the plugin to which this mapping relates. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginName string `protobuf:"bytes,2,opt,name=plugin_name,json=pluginName,proto3" json:"plugin_name,omitempty"` - // The version of the plugin to use, i.e. "v1.4.0". - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // True if the source plugin is inaccessible by the user. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Inaccessible bool `protobuf:"varint,5,opt,name=inaccessible,proto3" json:"inaccessible,omitempty"` -} - -func (x *PluginVersionMapping) Reset() { - *x = PluginVersionMapping{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginVersionMapping) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginVersionMapping) ProtoMessage() {} - -func (x *PluginVersionMapping) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginVersionMapping.ProtoReflect.Descriptor instead. -func (*PluginVersionMapping) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{5} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersionMapping) GetPluginOwner() string { - if x != nil { - return x.PluginOwner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersionMapping) GetPluginName() string { - if x != nil { - return x.PluginName - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersionMapping) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *PluginVersionMapping) GetInaccessible() bool { - if x != nil { - return x.Inaccessible - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListPluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListPluginsRequest) Reset() { - *x = ListPluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPluginsRequest) ProtoMessage() {} - -func (x *ListPluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPluginsRequest.ProtoReflect.Descriptor instead. -func (*ListPluginsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{6} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListPluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Plugins []*Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListPluginsResponse) Reset() { - *x = ListPluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPluginsResponse) ProtoMessage() {} - -func (x *ListPluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPluginsResponse.ProtoReflect.Descriptor instead. -func (*ListPluginsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{7} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginsResponse) GetPlugins() []*Plugin { - if x != nil { - return x.Plugins - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListUserPluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner to list plugins for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListUserPluginsRequest) Reset() { - *x = ListUserPluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserPluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserPluginsRequest) ProtoMessage() {} - -func (x *ListUserPluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserPluginsRequest.ProtoReflect.Descriptor instead. -func (*ListUserPluginsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{8} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListUserPluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Plugins []*Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListUserPluginsResponse) Reset() { - *x = ListUserPluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserPluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserPluginsResponse) ProtoMessage() {} - -func (x *ListUserPluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserPluginsResponse.ProtoReflect.Descriptor instead. -func (*ListUserPluginsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{9} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsResponse) GetPlugins() []*Plugin { - if x != nil { - return x.Plugins - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserPluginsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListOrganizationPluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The organization to list plugins for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListOrganizationPluginsRequest) Reset() { - *x = ListOrganizationPluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationPluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationPluginsRequest) ProtoMessage() {} - -func (x *ListOrganizationPluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationPluginsRequest.ProtoReflect.Descriptor instead. -func (*ListOrganizationPluginsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{10} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsRequest) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListOrganizationPluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Plugins []*Plugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOrganizationPluginsResponse) Reset() { - *x = ListOrganizationPluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationPluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationPluginsResponse) ProtoMessage() {} - -func (x *ListOrganizationPluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationPluginsResponse.ProtoReflect.Descriptor instead. -func (*ListOrganizationPluginsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{11} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsResponse) GetPlugins() []*Plugin { - if x != nil { - return x.Plugins - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationPluginsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetPluginVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin the version belongs to. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin the version belongs to. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the version. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetPluginVersionRequest) Reset() { - *x = GetPluginVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPluginVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPluginVersionRequest) ProtoMessage() {} - -func (x *GetPluginVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPluginVersionRequest.ProtoReflect.Descriptor instead. -func (*GetPluginVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{12} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginVersionRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginVersionRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginVersionRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetPluginVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVersion *PluginVersion `protobuf:"bytes,1,opt,name=plugin_version,json=pluginVersion,proto3" json:"plugin_version,omitempty"` -} - -func (x *GetPluginVersionResponse) Reset() { - *x = GetPluginVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPluginVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPluginVersionResponse) ProtoMessage() {} - -func (x *GetPluginVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPluginVersionResponse.ProtoReflect.Descriptor instead. -func (*GetPluginVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{13} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginVersionResponse) GetPluginVersion() *PluginVersion { - if x != nil { - return x.PluginVersion - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListPluginVersionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin to list versions for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin to list versions for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The number of items to return. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListPluginVersionsRequest) Reset() { - *x = ListPluginVersionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPluginVersionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPluginVersionsRequest) ProtoMessage() {} - -func (x *ListPluginVersionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPluginVersionsRequest.ProtoReflect.Descriptor instead. -func (*ListPluginVersionsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{14} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListPluginVersionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PluginVersions []*PluginVersion `protobuf:"bytes,1,rep,name=plugin_versions,json=pluginVersions,proto3" json:"plugin_versions,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListPluginVersionsResponse) Reset() { - *x = ListPluginVersionsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListPluginVersionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListPluginVersionsResponse) ProtoMessage() {} - -func (x *ListPluginVersionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListPluginVersionsResponse.ProtoReflect.Descriptor instead. -func (*ListPluginVersionsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{15} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsResponse) GetPluginVersions() []*PluginVersion { - if x != nil { - return x.PluginVersions - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListPluginVersionsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetPluginRequest) Reset() { - *x = GetPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPluginRequest) ProtoMessage() {} - -func (x *GetPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPluginRequest.ProtoReflect.Descriptor instead. -func (*GetPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{16} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Plugin *Plugin `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` -} - -func (x *GetPluginResponse) Reset() { - *x = GetPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPluginResponse) ProtoMessage() {} - -func (x *GetPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetPluginResponse.ProtoReflect.Descriptor instead. -func (*GetPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{17} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetPluginResponse) GetPlugin() *Plugin { - if x != nil { - return x.Plugin - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type DeletePluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin to delete. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin to delete. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *DeletePluginRequest) Reset() { - *x = DeletePluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeletePluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePluginRequest) ProtoMessage() {} - -func (x *DeletePluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeletePluginRequest.ProtoReflect.Descriptor instead. -func (*DeletePluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{18} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *DeletePluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *DeletePluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type DeletePluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeletePluginResponse) Reset() { - *x = DeletePluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeletePluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePluginResponse) ProtoMessage() {} - -func (x *DeletePluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeletePluginResponse.ProtoReflect.Descriptor instead. -func (*DeletePluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{19} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetTemplateRequest) Reset() { - *x = GetTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTemplateRequest) ProtoMessage() {} - -func (x *GetTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTemplateRequest.ProtoReflect.Descriptor instead. -func (*GetTemplateRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{20} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Template *Template `protobuf:"bytes,1,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *GetTemplateResponse) Reset() { - *x = GetTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTemplateResponse) ProtoMessage() {} - -func (x *GetTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTemplateResponse.ProtoReflect.Descriptor instead. -func (*GetTemplateResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{21} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateResponse) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplatesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListTemplatesRequest) Reset() { - *x = ListTemplatesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesRequest) ProtoMessage() {} - -func (x *ListTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesRequest.ProtoReflect.Descriptor instead. -func (*ListTemplatesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{22} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplatesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Templates []*Template `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListTemplatesResponse) Reset() { - *x = ListTemplatesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesResponse) ProtoMessage() {} - -func (x *ListTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesResponse.ProtoReflect.Descriptor instead. -func (*ListTemplatesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{23} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplatesUserCanAccessRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListTemplatesUserCanAccessRequest) Reset() { - *x = ListTemplatesUserCanAccessRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesUserCanAccessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesUserCanAccessRequest) ProtoMessage() {} - -func (x *ListTemplatesUserCanAccessRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesUserCanAccessRequest.ProtoReflect.Descriptor instead. -func (*ListTemplatesUserCanAccessRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{24} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesUserCanAccessRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesUserCanAccessRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesUserCanAccessRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplatesUserCanAccessResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Templates []*Template `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListTemplatesUserCanAccessResponse) Reset() { - *x = ListTemplatesUserCanAccessResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplatesUserCanAccessResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplatesUserCanAccessResponse) ProtoMessage() {} - -func (x *ListTemplatesUserCanAccessResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplatesUserCanAccessResponse.ProtoReflect.Descriptor instead. -func (*ListTemplatesUserCanAccessResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{25} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesUserCanAccessResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplatesUserCanAccessResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListUserTemplatesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the templates to list for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListUserTemplatesRequest) Reset() { - *x = ListUserTemplatesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserTemplatesRequest) ProtoMessage() {} - -func (x *ListUserTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserTemplatesRequest.ProtoReflect.Descriptor instead. -func (*ListUserTemplatesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{26} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListUserTemplatesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Templates []*Template `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListUserTemplatesResponse) Reset() { - *x = ListUserTemplatesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserTemplatesResponse) ProtoMessage() {} - -func (x *ListUserTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserTemplatesResponse.ProtoReflect.Descriptor instead. -func (*ListUserTemplatesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{27} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListUserTemplatesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetTemplateVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template the version belongs to. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template the version belongs to. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the version. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetTemplateVersionRequest) Reset() { - *x = GetTemplateVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTemplateVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTemplateVersionRequest) ProtoMessage() {} - -func (x *GetTemplateVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTemplateVersionRequest.ProtoReflect.Descriptor instead. -func (*GetTemplateVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{28} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateVersionRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateVersionRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateVersionRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type GetTemplateVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - TemplateVersion *TemplateVersion `protobuf:"bytes,1,opt,name=template_version,json=templateVersion,proto3" json:"template_version,omitempty"` -} - -func (x *GetTemplateVersionResponse) Reset() { - *x = GetTemplateVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTemplateVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTemplateVersionResponse) ProtoMessage() {} - -func (x *GetTemplateVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTemplateVersionResponse.ProtoReflect.Descriptor instead. -func (*GetTemplateVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{29} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *GetTemplateVersionResponse) GetTemplateVersion() *TemplateVersion { - if x != nil { - return x.TemplateVersion - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListOrganizationTemplatesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The organization of the templates to list for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Organization string `protobuf:"bytes,1,opt,name=organization,proto3" json:"organization,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListOrganizationTemplatesRequest) Reset() { - *x = ListOrganizationTemplatesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationTemplatesRequest) ProtoMessage() {} - -func (x *ListOrganizationTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationTemplatesRequest.ProtoReflect.Descriptor instead. -func (*ListOrganizationTemplatesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{30} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesRequest) GetOrganization() string { - if x != nil { - return x.Organization - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListOrganizationTemplatesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Templates []*Template `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOrganizationTemplatesResponse) Reset() { - *x = ListOrganizationTemplatesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationTemplatesResponse) ProtoMessage() {} - -func (x *ListOrganizationTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationTemplatesResponse.ProtoReflect.Descriptor instead. -func (*ListOrganizationTemplatesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{31} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesResponse) GetTemplates() []*Template { - if x != nil { - return x.Templates - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListOrganizationTemplatesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplateVersionsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template to list versions for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template to list versions for. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The number of items to return. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListTemplateVersionsRequest) Reset() { - *x = ListTemplateVersionsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplateVersionsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplateVersionsRequest) ProtoMessage() {} - -func (x *ListTemplateVersionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplateVersionsRequest.ProtoReflect.Descriptor instead. -func (*ListTemplateVersionsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{32} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type ListTemplateVersionsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - TemplateVersions []*TemplateVersion `protobuf:"bytes,1,rep,name=template_versions,json=templateVersions,proto3" json:"template_versions,omitempty"` - // There are no more pages if this is empty. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListTemplateVersionsResponse) Reset() { - *x = ListTemplateVersionsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTemplateVersionsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTemplateVersionsResponse) ProtoMessage() {} - -func (x *ListTemplateVersionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTemplateVersionsResponse.ProtoReflect.Descriptor instead. -func (*ListTemplateVersionsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{33} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsResponse) GetTemplateVersions() []*TemplateVersion { - if x != nil { - return x.TemplateVersions - } - return nil -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *ListTemplateVersionsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type DeleteTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the template to delete. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the template to delete. - // - // Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *DeleteTemplateRequest) Reset() { - *x = DeleteTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTemplateRequest) ProtoMessage() {} - -func (x *DeleteTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteTemplateRequest.ProtoReflect.Descriptor instead. -func (*DeleteTemplateRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{34} -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *DeleteTemplateRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -func (x *DeleteTemplateRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: The entire proto file buf/alpha/registry/v1alpha1/plugin.proto is marked as deprecated. -type DeleteTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteTemplateResponse) Reset() { - *x = DeleteTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTemplateResponse) ProtoMessage() {} - -func (x *DeleteTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteTemplateResponse.ProtoReflect.Descriptor instead. -func (*DeleteTemplateResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP(), []int{35} -} - -var File_buf_alpha_registry_v1alpha1_plugin_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_plugin_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x2a, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdc, 0x02, 0x0a, 0x06, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x0a, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, - 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0x87, 0x02, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x34, 0x0a, - 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x69, 0x67, - 0x65, 0x73, 0x74, 0x12, 0x58, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x22, 0xb0, 0x03, - 0x0a, 0x08, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x50, 0x0a, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x73, 0x12, 0x4d, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x22, 0xa5, 0x01, 0x0a, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, - 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x65, 0x74, 0x65, 0x72, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, - 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0xdd, 0x01, 0x0a, 0x0f, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x5a, 0x0a, 0x0f, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0e, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x14, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x22, 0x0a, 0x0c, 0x69, 0x6e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x69, 0x6e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x69, - 0x62, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x64, 0x22, 0x6a, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x7c, - 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x84, 0x01, 0x0a, - 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x3d, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x26, - 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9a, 0x01, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x0c, 0x6f, 0x72, 0x67, - 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x07, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5d, - 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x6d, 0x0a, - 0x18, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9b, 0x01, 0x0a, - 0x19, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x99, 0x01, 0x0a, 0x1a, 0x4c, - 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0e, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, - 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x3c, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x06, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x22, 0x3f, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x3e, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x58, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, - 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x6c, 0x0a, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, - 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, - 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, - 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x43, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, 0x74, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x79, - 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x55, - 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x91, 0x01, 0x0a, 0x22, 0x4c, 0x69, - 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x43, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x86, 0x01, - 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, - 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x22, 0x5f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0x75, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x57, 0x0a, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x01, 0x0a, 0x20, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, - 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, - 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x21, 0x4c, 0x69, 0x73, - 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, - 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, - 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9d, 0x01, 0x0a, 0x1b, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xa1, 0x01, 0x0a, 0x1c, - 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x11, - 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x10, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x41, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x72, 0x0a, 0x10, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, - 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x56, 0x49, - 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, - 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x56, 0x49, 0x53, 0x49, - 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, - 0x32, 0x8a, 0x10, 0x0a, 0x0d, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x75, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x73, 0x12, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x33, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x99, 0x01, - 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x84, 0x01, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x6f, 0x0a, - 0x09, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x2d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x78, - 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x30, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x75, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, - 0x7b, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x12, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xa2, 0x01, 0x0a, - 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x55, 0x73, - 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x87, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9f, 0x01, 0x0a, 0x19, - 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, - 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8a, 0x01, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x90, 0x01, 0x0a, 0x14, 0x4c, - 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x7e, 0x0a, - 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, - 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x9b, 0x02, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0b, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xb8, 0x01, 0x01, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, - 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescData = file_buf_alpha_registry_v1alpha1_plugin_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_plugin_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_plugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes = make([]protoimpl.MessageInfo, 36) -var file_buf_alpha_registry_v1alpha1_plugin_proto_goTypes = []interface{}{ - (PluginVisibility)(0), // 0: buf.alpha.registry.v1alpha1.PluginVisibility - (*Plugin)(nil), // 1: buf.alpha.registry.v1alpha1.Plugin - (*PluginVersion)(nil), // 2: buf.alpha.registry.v1alpha1.PluginVersion - (*Template)(nil), // 3: buf.alpha.registry.v1alpha1.Template - (*PluginConfig)(nil), // 4: buf.alpha.registry.v1alpha1.PluginConfig - (*TemplateVersion)(nil), // 5: buf.alpha.registry.v1alpha1.TemplateVersion - (*PluginVersionMapping)(nil), // 6: buf.alpha.registry.v1alpha1.PluginVersionMapping - (*ListPluginsRequest)(nil), // 7: buf.alpha.registry.v1alpha1.ListPluginsRequest - (*ListPluginsResponse)(nil), // 8: buf.alpha.registry.v1alpha1.ListPluginsResponse - (*ListUserPluginsRequest)(nil), // 9: buf.alpha.registry.v1alpha1.ListUserPluginsRequest - (*ListUserPluginsResponse)(nil), // 10: buf.alpha.registry.v1alpha1.ListUserPluginsResponse - (*ListOrganizationPluginsRequest)(nil), // 11: buf.alpha.registry.v1alpha1.ListOrganizationPluginsRequest - (*ListOrganizationPluginsResponse)(nil), // 12: buf.alpha.registry.v1alpha1.ListOrganizationPluginsResponse - (*GetPluginVersionRequest)(nil), // 13: buf.alpha.registry.v1alpha1.GetPluginVersionRequest - (*GetPluginVersionResponse)(nil), // 14: buf.alpha.registry.v1alpha1.GetPluginVersionResponse - (*ListPluginVersionsRequest)(nil), // 15: buf.alpha.registry.v1alpha1.ListPluginVersionsRequest - (*ListPluginVersionsResponse)(nil), // 16: buf.alpha.registry.v1alpha1.ListPluginVersionsResponse - (*GetPluginRequest)(nil), // 17: buf.alpha.registry.v1alpha1.GetPluginRequest - (*GetPluginResponse)(nil), // 18: buf.alpha.registry.v1alpha1.GetPluginResponse - (*DeletePluginRequest)(nil), // 19: buf.alpha.registry.v1alpha1.DeletePluginRequest - (*DeletePluginResponse)(nil), // 20: buf.alpha.registry.v1alpha1.DeletePluginResponse - (*GetTemplateRequest)(nil), // 21: buf.alpha.registry.v1alpha1.GetTemplateRequest - (*GetTemplateResponse)(nil), // 22: buf.alpha.registry.v1alpha1.GetTemplateResponse - (*ListTemplatesRequest)(nil), // 23: buf.alpha.registry.v1alpha1.ListTemplatesRequest - (*ListTemplatesResponse)(nil), // 24: buf.alpha.registry.v1alpha1.ListTemplatesResponse - (*ListTemplatesUserCanAccessRequest)(nil), // 25: buf.alpha.registry.v1alpha1.ListTemplatesUserCanAccessRequest - (*ListTemplatesUserCanAccessResponse)(nil), // 26: buf.alpha.registry.v1alpha1.ListTemplatesUserCanAccessResponse - (*ListUserTemplatesRequest)(nil), // 27: buf.alpha.registry.v1alpha1.ListUserTemplatesRequest - (*ListUserTemplatesResponse)(nil), // 28: buf.alpha.registry.v1alpha1.ListUserTemplatesResponse - (*GetTemplateVersionRequest)(nil), // 29: buf.alpha.registry.v1alpha1.GetTemplateVersionRequest - (*GetTemplateVersionResponse)(nil), // 30: buf.alpha.registry.v1alpha1.GetTemplateVersionResponse - (*ListOrganizationTemplatesRequest)(nil), // 31: buf.alpha.registry.v1alpha1.ListOrganizationTemplatesRequest - (*ListOrganizationTemplatesResponse)(nil), // 32: buf.alpha.registry.v1alpha1.ListOrganizationTemplatesResponse - (*ListTemplateVersionsRequest)(nil), // 33: buf.alpha.registry.v1alpha1.ListTemplateVersionsRequest - (*ListTemplateVersionsResponse)(nil), // 34: buf.alpha.registry.v1alpha1.ListTemplateVersionsResponse - (*DeleteTemplateRequest)(nil), // 35: buf.alpha.registry.v1alpha1.DeleteTemplateRequest - (*DeleteTemplateResponse)(nil), // 36: buf.alpha.registry.v1alpha1.DeleteTemplateResponse - (*timestamppb.Timestamp)(nil), // 37: google.protobuf.Timestamp - (*RuntimeLibrary)(nil), // 38: buf.alpha.registry.v1alpha1.RuntimeLibrary -} -var file_buf_alpha_registry_v1alpha1_plugin_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.Plugin.visibility:type_name -> buf.alpha.registry.v1alpha1.PluginVisibility - 37, // 1: buf.alpha.registry.v1alpha1.Plugin.create_time:type_name -> google.protobuf.Timestamp - 37, // 2: buf.alpha.registry.v1alpha1.Plugin.update_time:type_name -> google.protobuf.Timestamp - 38, // 3: buf.alpha.registry.v1alpha1.PluginVersion.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.RuntimeLibrary - 4, // 4: buf.alpha.registry.v1alpha1.Template.plugin_configs:type_name -> buf.alpha.registry.v1alpha1.PluginConfig - 0, // 5: buf.alpha.registry.v1alpha1.Template.visibility:type_name -> buf.alpha.registry.v1alpha1.PluginVisibility - 37, // 6: buf.alpha.registry.v1alpha1.Template.create_time:type_name -> google.protobuf.Timestamp - 37, // 7: buf.alpha.registry.v1alpha1.Template.update_time:type_name -> google.protobuf.Timestamp - 6, // 8: buf.alpha.registry.v1alpha1.TemplateVersion.plugin_versions:type_name -> buf.alpha.registry.v1alpha1.PluginVersionMapping - 1, // 9: buf.alpha.registry.v1alpha1.ListPluginsResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.Plugin - 1, // 10: buf.alpha.registry.v1alpha1.ListUserPluginsResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.Plugin - 1, // 11: buf.alpha.registry.v1alpha1.ListOrganizationPluginsResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.Plugin - 2, // 12: buf.alpha.registry.v1alpha1.GetPluginVersionResponse.plugin_version:type_name -> buf.alpha.registry.v1alpha1.PluginVersion - 2, // 13: buf.alpha.registry.v1alpha1.ListPluginVersionsResponse.plugin_versions:type_name -> buf.alpha.registry.v1alpha1.PluginVersion - 1, // 14: buf.alpha.registry.v1alpha1.GetPluginResponse.plugin:type_name -> buf.alpha.registry.v1alpha1.Plugin - 3, // 15: buf.alpha.registry.v1alpha1.GetTemplateResponse.template:type_name -> buf.alpha.registry.v1alpha1.Template - 3, // 16: buf.alpha.registry.v1alpha1.ListTemplatesResponse.templates:type_name -> buf.alpha.registry.v1alpha1.Template - 3, // 17: buf.alpha.registry.v1alpha1.ListTemplatesUserCanAccessResponse.templates:type_name -> buf.alpha.registry.v1alpha1.Template - 3, // 18: buf.alpha.registry.v1alpha1.ListUserTemplatesResponse.templates:type_name -> buf.alpha.registry.v1alpha1.Template - 5, // 19: buf.alpha.registry.v1alpha1.GetTemplateVersionResponse.template_version:type_name -> buf.alpha.registry.v1alpha1.TemplateVersion - 3, // 20: buf.alpha.registry.v1alpha1.ListOrganizationTemplatesResponse.templates:type_name -> buf.alpha.registry.v1alpha1.Template - 5, // 21: buf.alpha.registry.v1alpha1.ListTemplateVersionsResponse.template_versions:type_name -> buf.alpha.registry.v1alpha1.TemplateVersion - 7, // 22: buf.alpha.registry.v1alpha1.PluginService.ListPlugins:input_type -> buf.alpha.registry.v1alpha1.ListPluginsRequest - 9, // 23: buf.alpha.registry.v1alpha1.PluginService.ListUserPlugins:input_type -> buf.alpha.registry.v1alpha1.ListUserPluginsRequest - 11, // 24: buf.alpha.registry.v1alpha1.PluginService.ListOrganizationPlugins:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationPluginsRequest - 13, // 25: buf.alpha.registry.v1alpha1.PluginService.GetPluginVersion:input_type -> buf.alpha.registry.v1alpha1.GetPluginVersionRequest - 15, // 26: buf.alpha.registry.v1alpha1.PluginService.ListPluginVersions:input_type -> buf.alpha.registry.v1alpha1.ListPluginVersionsRequest - 17, // 27: buf.alpha.registry.v1alpha1.PluginService.GetPlugin:input_type -> buf.alpha.registry.v1alpha1.GetPluginRequest - 19, // 28: buf.alpha.registry.v1alpha1.PluginService.DeletePlugin:input_type -> buf.alpha.registry.v1alpha1.DeletePluginRequest - 21, // 29: buf.alpha.registry.v1alpha1.PluginService.GetTemplate:input_type -> buf.alpha.registry.v1alpha1.GetTemplateRequest - 23, // 30: buf.alpha.registry.v1alpha1.PluginService.ListTemplates:input_type -> buf.alpha.registry.v1alpha1.ListTemplatesRequest - 25, // 31: buf.alpha.registry.v1alpha1.PluginService.ListTemplatesUserCanAccess:input_type -> buf.alpha.registry.v1alpha1.ListTemplatesUserCanAccessRequest - 27, // 32: buf.alpha.registry.v1alpha1.PluginService.ListUserTemplates:input_type -> buf.alpha.registry.v1alpha1.ListUserTemplatesRequest - 31, // 33: buf.alpha.registry.v1alpha1.PluginService.ListOrganizationTemplates:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationTemplatesRequest - 29, // 34: buf.alpha.registry.v1alpha1.PluginService.GetTemplateVersion:input_type -> buf.alpha.registry.v1alpha1.GetTemplateVersionRequest - 33, // 35: buf.alpha.registry.v1alpha1.PluginService.ListTemplateVersions:input_type -> buf.alpha.registry.v1alpha1.ListTemplateVersionsRequest - 35, // 36: buf.alpha.registry.v1alpha1.PluginService.DeleteTemplate:input_type -> buf.alpha.registry.v1alpha1.DeleteTemplateRequest - 8, // 37: buf.alpha.registry.v1alpha1.PluginService.ListPlugins:output_type -> buf.alpha.registry.v1alpha1.ListPluginsResponse - 10, // 38: buf.alpha.registry.v1alpha1.PluginService.ListUserPlugins:output_type -> buf.alpha.registry.v1alpha1.ListUserPluginsResponse - 12, // 39: buf.alpha.registry.v1alpha1.PluginService.ListOrganizationPlugins:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationPluginsResponse - 14, // 40: buf.alpha.registry.v1alpha1.PluginService.GetPluginVersion:output_type -> buf.alpha.registry.v1alpha1.GetPluginVersionResponse - 16, // 41: buf.alpha.registry.v1alpha1.PluginService.ListPluginVersions:output_type -> buf.alpha.registry.v1alpha1.ListPluginVersionsResponse - 18, // 42: buf.alpha.registry.v1alpha1.PluginService.GetPlugin:output_type -> buf.alpha.registry.v1alpha1.GetPluginResponse - 20, // 43: buf.alpha.registry.v1alpha1.PluginService.DeletePlugin:output_type -> buf.alpha.registry.v1alpha1.DeletePluginResponse - 22, // 44: buf.alpha.registry.v1alpha1.PluginService.GetTemplate:output_type -> buf.alpha.registry.v1alpha1.GetTemplateResponse - 24, // 45: buf.alpha.registry.v1alpha1.PluginService.ListTemplates:output_type -> buf.alpha.registry.v1alpha1.ListTemplatesResponse - 26, // 46: buf.alpha.registry.v1alpha1.PluginService.ListTemplatesUserCanAccess:output_type -> buf.alpha.registry.v1alpha1.ListTemplatesUserCanAccessResponse - 28, // 47: buf.alpha.registry.v1alpha1.PluginService.ListUserTemplates:output_type -> buf.alpha.registry.v1alpha1.ListUserTemplatesResponse - 32, // 48: buf.alpha.registry.v1alpha1.PluginService.ListOrganizationTemplates:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationTemplatesResponse - 30, // 49: buf.alpha.registry.v1alpha1.PluginService.GetTemplateVersion:output_type -> buf.alpha.registry.v1alpha1.GetTemplateVersionResponse - 34, // 50: buf.alpha.registry.v1alpha1.PluginService.ListTemplateVersions:output_type -> buf.alpha.registry.v1alpha1.ListTemplateVersionsResponse - 36, // 51: buf.alpha.registry.v1alpha1.PluginService.DeleteTemplate:output_type -> buf.alpha.registry.v1alpha1.DeleteTemplateResponse - 37, // [37:52] is the sub-list for method output_type - 22, // [22:37] is the sub-list for method input_type - 22, // [22:22] is the sub-list for extension type_name - 22, // [22:22] is the sub-list for extension extendee - 0, // [0:22] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_plugin_proto_init() } -func file_buf_alpha_registry_v1alpha1_plugin_proto_init() { - if File_buf_alpha_registry_v1alpha1_plugin_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_generate_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Plugin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginVersion); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Template); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateVersion); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginVersionMapping); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserPluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserPluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationPluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationPluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPluginVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPluginVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPluginVersionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListPluginVersionsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeletePluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeletePluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesUserCanAccessRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplatesUserCanAccessResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserTemplatesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserTemplatesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTemplateVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTemplateVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationTemplatesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationTemplatesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplateVersionsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTemplateVersionsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_plugin_proto_rawDesc, - NumEnums: 1, - NumMessages: 36, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_plugin_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_plugin_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_plugin_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_plugin_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_plugin_proto = out.File - file_buf_alpha_registry_v1alpha1_plugin_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_plugin_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_plugin_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go deleted file mode 100644 index b0c76e024e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/plugin_curation.pb.go +++ /dev/null @@ -1,3564 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/plugin_curation.proto - -package registryv1alpha1 - -import ( - v1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/image/v1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - pluginpb "google.golang.org/protobuf/types/pluginpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// CuratedPluginVisibility defines the visibility options available -// for Curated Plugins. -type CuratedPluginVisibility int32 - -const ( - CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED CuratedPluginVisibility = 0 - CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PUBLIC CuratedPluginVisibility = 1 - CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_PRIVATE CuratedPluginVisibility = 2 -) - -// Enum value maps for CuratedPluginVisibility. -var ( - CuratedPluginVisibility_name = map[int32]string{ - 0: "CURATED_PLUGIN_VISIBILITY_UNSPECIFIED", - 1: "CURATED_PLUGIN_VISIBILITY_PUBLIC", - 2: "CURATED_PLUGIN_VISIBILITY_PRIVATE", - } - CuratedPluginVisibility_value = map[string]int32{ - "CURATED_PLUGIN_VISIBILITY_UNSPECIFIED": 0, - "CURATED_PLUGIN_VISIBILITY_PUBLIC": 1, - "CURATED_PLUGIN_VISIBILITY_PRIVATE": 2, - } -) - -func (x CuratedPluginVisibility) Enum() *CuratedPluginVisibility { - p := new(CuratedPluginVisibility) - *p = x - return p -} - -func (x CuratedPluginVisibility) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (CuratedPluginVisibility) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[0].Descriptor() -} - -func (CuratedPluginVisibility) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[0] -} - -func (x CuratedPluginVisibility) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use CuratedPluginVisibility.Descriptor instead. -func (CuratedPluginVisibility) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{0} -} - -// The supported plugin registries for curated plugins. -type PluginRegistryType int32 - -const ( - PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED PluginRegistryType = 0 - PluginRegistryType_PLUGIN_REGISTRY_TYPE_GO PluginRegistryType = 1 - PluginRegistryType_PLUGIN_REGISTRY_TYPE_NPM PluginRegistryType = 2 - PluginRegistryType_PLUGIN_REGISTRY_TYPE_MAVEN PluginRegistryType = 3 - PluginRegistryType_PLUGIN_REGISTRY_TYPE_SWIFT PluginRegistryType = 4 -) - -// Enum value maps for PluginRegistryType. -var ( - PluginRegistryType_name = map[int32]string{ - 0: "PLUGIN_REGISTRY_TYPE_UNSPECIFIED", - 1: "PLUGIN_REGISTRY_TYPE_GO", - 2: "PLUGIN_REGISTRY_TYPE_NPM", - 3: "PLUGIN_REGISTRY_TYPE_MAVEN", - 4: "PLUGIN_REGISTRY_TYPE_SWIFT", - } - PluginRegistryType_value = map[string]int32{ - "PLUGIN_REGISTRY_TYPE_UNSPECIFIED": 0, - "PLUGIN_REGISTRY_TYPE_GO": 1, - "PLUGIN_REGISTRY_TYPE_NPM": 2, - "PLUGIN_REGISTRY_TYPE_MAVEN": 3, - "PLUGIN_REGISTRY_TYPE_SWIFT": 4, - } -) - -func (x PluginRegistryType) Enum() *PluginRegistryType { - p := new(PluginRegistryType) - *p = x - return p -} - -func (x PluginRegistryType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PluginRegistryType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[1].Descriptor() -} - -func (PluginRegistryType) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[1] -} - -func (x PluginRegistryType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PluginRegistryType.Descriptor instead. -func (PluginRegistryType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{1} -} - -// PluginLanguage is used to specify the output languages a plugin supports. -type PluginLanguage int32 - -const ( - PluginLanguage_PLUGIN_LANGUAGE_UNSPECIFIED PluginLanguage = 0 - PluginLanguage_PLUGIN_LANGUAGE_GO PluginLanguage = 1 - PluginLanguage_PLUGIN_LANGUAGE_JAVASCRIPT PluginLanguage = 2 - PluginLanguage_PLUGIN_LANGUAGE_TYPESCRIPT PluginLanguage = 3 - PluginLanguage_PLUGIN_LANGUAGE_SWIFT PluginLanguage = 4 - PluginLanguage_PLUGIN_LANGUAGE_CPP PluginLanguage = 5 - PluginLanguage_PLUGIN_LANGUAGE_JAVA PluginLanguage = 6 - PluginLanguage_PLUGIN_LANGUAGE_DART PluginLanguage = 7 - PluginLanguage_PLUGIN_LANGUAGE_RUST PluginLanguage = 8 - PluginLanguage_PLUGIN_LANGUAGE_PYTHON PluginLanguage = 9 - PluginLanguage_PLUGIN_LANGUAGE_RUBY PluginLanguage = 10 - PluginLanguage_PLUGIN_LANGUAGE_KOTLIN PluginLanguage = 11 - PluginLanguage_PLUGIN_LANGUAGE_OBJECTIVE_C PluginLanguage = 12 - PluginLanguage_PLUGIN_LANGUAGE_PHP PluginLanguage = 13 - PluginLanguage_PLUGIN_LANGUAGE_CSHARP PluginLanguage = 14 - PluginLanguage_PLUGIN_LANGUAGE_SCALA PluginLanguage = 15 -) - -// Enum value maps for PluginLanguage. -var ( - PluginLanguage_name = map[int32]string{ - 0: "PLUGIN_LANGUAGE_UNSPECIFIED", - 1: "PLUGIN_LANGUAGE_GO", - 2: "PLUGIN_LANGUAGE_JAVASCRIPT", - 3: "PLUGIN_LANGUAGE_TYPESCRIPT", - 4: "PLUGIN_LANGUAGE_SWIFT", - 5: "PLUGIN_LANGUAGE_CPP", - 6: "PLUGIN_LANGUAGE_JAVA", - 7: "PLUGIN_LANGUAGE_DART", - 8: "PLUGIN_LANGUAGE_RUST", - 9: "PLUGIN_LANGUAGE_PYTHON", - 10: "PLUGIN_LANGUAGE_RUBY", - 11: "PLUGIN_LANGUAGE_KOTLIN", - 12: "PLUGIN_LANGUAGE_OBJECTIVE_C", - 13: "PLUGIN_LANGUAGE_PHP", - 14: "PLUGIN_LANGUAGE_CSHARP", - 15: "PLUGIN_LANGUAGE_SCALA", - } - PluginLanguage_value = map[string]int32{ - "PLUGIN_LANGUAGE_UNSPECIFIED": 0, - "PLUGIN_LANGUAGE_GO": 1, - "PLUGIN_LANGUAGE_JAVASCRIPT": 2, - "PLUGIN_LANGUAGE_TYPESCRIPT": 3, - "PLUGIN_LANGUAGE_SWIFT": 4, - "PLUGIN_LANGUAGE_CPP": 5, - "PLUGIN_LANGUAGE_JAVA": 6, - "PLUGIN_LANGUAGE_DART": 7, - "PLUGIN_LANGUAGE_RUST": 8, - "PLUGIN_LANGUAGE_PYTHON": 9, - "PLUGIN_LANGUAGE_RUBY": 10, - "PLUGIN_LANGUAGE_KOTLIN": 11, - "PLUGIN_LANGUAGE_OBJECTIVE_C": 12, - "PLUGIN_LANGUAGE_PHP": 13, - "PLUGIN_LANGUAGE_CSHARP": 14, - "PLUGIN_LANGUAGE_SCALA": 15, - } -) - -func (x PluginLanguage) Enum() *PluginLanguage { - p := new(PluginLanguage) - *p = x - return p -} - -func (x PluginLanguage) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PluginLanguage) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[2].Descriptor() -} - -func (PluginLanguage) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[2] -} - -func (x PluginLanguage) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PluginLanguage.Descriptor instead. -func (PluginLanguage) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2} -} - -// NPMImportStyle is used to specify the import style the plugin supports. -type NPMImportStyle int32 - -const ( - NPMImportStyle_NPM_IMPORT_STYLE_UNSPECIFIED NPMImportStyle = 0 - NPMImportStyle_NPM_IMPORT_STYLE_MODULE NPMImportStyle = 1 - NPMImportStyle_NPM_IMPORT_STYLE_COMMONJS NPMImportStyle = 2 -) - -// Enum value maps for NPMImportStyle. -var ( - NPMImportStyle_name = map[int32]string{ - 0: "NPM_IMPORT_STYLE_UNSPECIFIED", - 1: "NPM_IMPORT_STYLE_MODULE", - 2: "NPM_IMPORT_STYLE_COMMONJS", - } - NPMImportStyle_value = map[string]int32{ - "NPM_IMPORT_STYLE_UNSPECIFIED": 0, - "NPM_IMPORT_STYLE_MODULE": 1, - "NPM_IMPORT_STYLE_COMMONJS": 2, - } -) - -func (x NPMImportStyle) Enum() *NPMImportStyle { - p := new(NPMImportStyle) - *p = x - return p -} - -func (x NPMImportStyle) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (NPMImportStyle) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[3].Descriptor() -} - -func (NPMImportStyle) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[3] -} - -func (x NPMImportStyle) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use NPMImportStyle.Descriptor instead. -func (NPMImportStyle) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{3} -} - -// SwiftPlatformType is used to specify the platform type for a Swift plugins minimum compatible version. -type SwiftPlatformType int32 - -const ( - SwiftPlatformType_SWIFT_PLATFORM_TYPE_UNSPECIFIED SwiftPlatformType = 0 - SwiftPlatformType_SWIFT_PLATFORM_TYPE_MACOS SwiftPlatformType = 1 - SwiftPlatformType_SWIFT_PLATFORM_TYPE_IOS SwiftPlatformType = 2 - SwiftPlatformType_SWIFT_PLATFORM_TYPE_WATCHOS SwiftPlatformType = 3 - SwiftPlatformType_SWIFT_PLATFORM_TYPE_TVOS SwiftPlatformType = 4 -) - -// Enum value maps for SwiftPlatformType. -var ( - SwiftPlatformType_name = map[int32]string{ - 0: "SWIFT_PLATFORM_TYPE_UNSPECIFIED", - 1: "SWIFT_PLATFORM_TYPE_MACOS", - 2: "SWIFT_PLATFORM_TYPE_IOS", - 3: "SWIFT_PLATFORM_TYPE_WATCHOS", - 4: "SWIFT_PLATFORM_TYPE_TVOS", - } - SwiftPlatformType_value = map[string]int32{ - "SWIFT_PLATFORM_TYPE_UNSPECIFIED": 0, - "SWIFT_PLATFORM_TYPE_MACOS": 1, - "SWIFT_PLATFORM_TYPE_IOS": 2, - "SWIFT_PLATFORM_TYPE_WATCHOS": 3, - "SWIFT_PLATFORM_TYPE_TVOS": 4, - } -) - -func (x SwiftPlatformType) Enum() *SwiftPlatformType { - p := new(SwiftPlatformType) - *p = x - return p -} - -func (x SwiftPlatformType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SwiftPlatformType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[4].Descriptor() -} - -func (SwiftPlatformType) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes[4] -} - -func (x SwiftPlatformType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SwiftPlatformType.Descriptor instead. -func (SwiftPlatformType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{4} -} - -// GoConfig is the configuration for a Go plugin. -type GoConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optionally define the runtime libraries for the plugin. - RuntimeLibraries []*GoConfig_RuntimeLibrary `protobuf:"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` - // The minimum Go version required by the plugin. - MinimumVersion string `protobuf:"bytes,2,opt,name=minimum_version,json=minimumVersion,proto3" json:"minimum_version,omitempty"` -} - -func (x *GoConfig) Reset() { - *x = GoConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GoConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoConfig) ProtoMessage() {} - -func (x *GoConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GoConfig.ProtoReflect.Descriptor instead. -func (*GoConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{0} -} - -func (x *GoConfig) GetRuntimeLibraries() []*GoConfig_RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -func (x *GoConfig) GetMinimumVersion() string { - if x != nil { - return x.MinimumVersion - } - return "" -} - -// NPMConfig is the configuration for a JavaScript NPM plugin. -type NPMConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optionally define the runtime libraries for the plugin. - RuntimeLibraries []*NPMConfig_RuntimeLibrary `protobuf:"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` - // Optionally define a configuration for rewriting import paths, a feature mainly - // used for remote code generation in the BSR npm registry, which makes it possible - // to serve the output of a BSR module and a plugin in an individual package. - // - // All plugins based on @bufbuild/protoplugin support the option "rewrite_imports". - // Setting this value, i.e. "connectweb.js" or "pb.js", informs the BSR npm registry - // that the plugin supports import rewrites with the given import suffix. - RewriteImportPathSuffix string `protobuf:"bytes,2,opt,name=rewrite_import_path_suffix,json=rewriteImportPathSuffix,proto3" json:"rewrite_import_path_suffix,omitempty"` - // The import style used for the "type" field in the package.json file. - // This exists to support legacy plugins that require "commonjs" support. - ImportStyle NPMImportStyle `protobuf:"varint,3,opt,name=import_style,json=importStyle,proto3,enum=buf.alpha.registry.v1alpha1.NPMImportStyle" json:"import_style,omitempty"` -} - -func (x *NPMConfig) Reset() { - *x = NPMConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NPMConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NPMConfig) ProtoMessage() {} - -func (x *NPMConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NPMConfig.ProtoReflect.Descriptor instead. -func (*NPMConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{1} -} - -func (x *NPMConfig) GetRuntimeLibraries() []*NPMConfig_RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -func (x *NPMConfig) GetRewriteImportPathSuffix() string { - if x != nil { - return x.RewriteImportPathSuffix - } - return "" -} - -func (x *NPMConfig) GetImportStyle() NPMImportStyle { - if x != nil { - return x.ImportStyle - } - return NPMImportStyle_NPM_IMPORT_STYLE_UNSPECIFIED -} - -// MavenConfig is the configuration for a Maven plugin. -type MavenConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optionally define the runtime libraries for the plugin. - RuntimeLibraries []*MavenConfig_RuntimeLibrary `protobuf:"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` - // Settings for the Java/Kotlin compiler used to compile the generated code. - Compiler *MavenConfig_CompilerConfig `protobuf:"bytes,2,opt,name=compiler,proto3" json:"compiler,omitempty"` - // Optional additional runtimes supported by the plugin. - AdditionalRuntimes []*MavenConfig_RuntimeConfig `protobuf:"bytes,3,rep,name=additional_runtimes,json=additionalRuntimes,proto3" json:"additional_runtimes,omitempty"` -} - -func (x *MavenConfig) Reset() { - *x = MavenConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig) ProtoMessage() {} - -func (x *MavenConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig.ProtoReflect.Descriptor instead. -func (*MavenConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2} -} - -func (x *MavenConfig) GetRuntimeLibraries() []*MavenConfig_RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -func (x *MavenConfig) GetCompiler() *MavenConfig_CompilerConfig { - if x != nil { - return x.Compiler - } - return nil -} - -func (x *MavenConfig) GetAdditionalRuntimes() []*MavenConfig_RuntimeConfig { - if x != nil { - return x.AdditionalRuntimes - } - return nil -} - -type SwiftConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Optionally define the runtime libraries for the plugin. - RuntimeLibraries []*SwiftConfig_RuntimeLibrary `protobuf:"bytes,1,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` -} - -func (x *SwiftConfig) Reset() { - *x = SwiftConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SwiftConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SwiftConfig) ProtoMessage() {} - -func (x *SwiftConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SwiftConfig.ProtoReflect.Descriptor instead. -func (*SwiftConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{3} -} - -func (x *SwiftConfig) GetRuntimeLibraries() []*SwiftConfig_RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -// RegistryConfig is the configuration for the remote registry of a plugin. -type RegistryConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to RegistryConfig: - // - // *RegistryConfig_GoConfig - // *RegistryConfig_NpmConfig - // *RegistryConfig_MavenConfig - // *RegistryConfig_SwiftConfig - RegistryConfig isRegistryConfig_RegistryConfig `protobuf_oneof:"registry_config"` - // The options to pass to the plugin. These will - // be merged into a single, comma-separated string. - Options []string `protobuf:"bytes,10,rep,name=options,proto3" json:"options,omitempty"` -} - -func (x *RegistryConfig) Reset() { - *x = RegistryConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RegistryConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegistryConfig) ProtoMessage() {} - -func (x *RegistryConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RegistryConfig.ProtoReflect.Descriptor instead. -func (*RegistryConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{4} -} - -func (m *RegistryConfig) GetRegistryConfig() isRegistryConfig_RegistryConfig { - if m != nil { - return m.RegistryConfig - } - return nil -} - -func (x *RegistryConfig) GetGoConfig() *GoConfig { - if x, ok := x.GetRegistryConfig().(*RegistryConfig_GoConfig); ok { - return x.GoConfig - } - return nil -} - -func (x *RegistryConfig) GetNpmConfig() *NPMConfig { - if x, ok := x.GetRegistryConfig().(*RegistryConfig_NpmConfig); ok { - return x.NpmConfig - } - return nil -} - -func (x *RegistryConfig) GetMavenConfig() *MavenConfig { - if x, ok := x.GetRegistryConfig().(*RegistryConfig_MavenConfig); ok { - return x.MavenConfig - } - return nil -} - -func (x *RegistryConfig) GetSwiftConfig() *SwiftConfig { - if x, ok := x.GetRegistryConfig().(*RegistryConfig_SwiftConfig); ok { - return x.SwiftConfig - } - return nil -} - -func (x *RegistryConfig) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -type isRegistryConfig_RegistryConfig interface { - isRegistryConfig_RegistryConfig() -} - -type RegistryConfig_GoConfig struct { - GoConfig *GoConfig `protobuf:"bytes,1,opt,name=go_config,json=goConfig,proto3,oneof"` -} - -type RegistryConfig_NpmConfig struct { - NpmConfig *NPMConfig `protobuf:"bytes,2,opt,name=npm_config,json=npmConfig,proto3,oneof"` -} - -type RegistryConfig_MavenConfig struct { - MavenConfig *MavenConfig `protobuf:"bytes,3,opt,name=maven_config,json=mavenConfig,proto3,oneof"` -} - -type RegistryConfig_SwiftConfig struct { - SwiftConfig *SwiftConfig `protobuf:"bytes,4,opt,name=swift_config,json=swiftConfig,proto3,oneof"` -} - -func (*RegistryConfig_GoConfig) isRegistryConfig_RegistryConfig() {} - -func (*RegistryConfig_NpmConfig) isRegistryConfig_RegistryConfig() {} - -func (*RegistryConfig_MavenConfig) isRegistryConfig_RegistryConfig() {} - -func (*RegistryConfig_SwiftConfig) isRegistryConfig_RegistryConfig() {} - -type CuratedPluginReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin, i.e. "library". - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin, i.e. "connect-go". - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Semver-formatted plugin version. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // The revision for this plugin version. - Revision uint32 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` -} - -func (x *CuratedPluginReference) Reset() { - *x = CuratedPluginReference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CuratedPluginReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CuratedPluginReference) ProtoMessage() {} - -func (x *CuratedPluginReference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CuratedPluginReference.ProtoReflect.Descriptor instead. -func (*CuratedPluginReference) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{5} -} - -func (x *CuratedPluginReference) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *CuratedPluginReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CuratedPluginReference) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *CuratedPluginReference) GetRevision() uint32 { - if x != nil { - return x.Revision - } - return 0 -} - -// CuratedPlugin represents a protoc plugin curated by Buf, such as protoc-gen-go. -type CuratedPlugin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the plugin, which uniquely identifies the plugin. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The owner of the plugin, i.e. "library". - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin, i.e. "connect-go". - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // The optional registry type of the plugin. - RegistryType PluginRegistryType `protobuf:"varint,4,opt,name=registry_type,json=registryType,proto3,enum=buf.alpha.registry.v1alpha1.PluginRegistryType" json:"registry_type,omitempty"` - // Semver-formatted plugin version. - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - // The full container image digest associated with this plugin version including - // the algorithm. - // Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests - ContainerImageDigest string `protobuf:"bytes,6,opt,name=container_image_digest,json=containerImageDigest,proto3" json:"container_image_digest,omitempty"` - // The creation time of the plugin. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // List of plugin dependencies. - Dependencies []*CuratedPluginReference `protobuf:"bytes,9,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - // Optionally specify the URL leading to the source code of the plugin, if available. - SourceUrl string `protobuf:"bytes,10,opt,name=source_url,json=sourceUrl,proto3" json:"source_url,omitempty"` - // Optionally specify a brief description of the plugin functionality. - Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - // The configuration for the remote registry of the plugin. - RegistryConfig *RegistryConfig `protobuf:"bytes,12,opt,name=registry_config,json=registryConfig,proto3" json:"registry_config,omitempty"` - // The revision for this plugin version. - Revision uint32 `protobuf:"varint,13,opt,name=revision,proto3" json:"revision,omitempty"` - // The output languages supported by the plugin. - OutputLanguages []PluginLanguage `protobuf:"varint,14,rep,packed,name=output_languages,json=outputLanguages,proto3,enum=buf.alpha.registry.v1alpha1.PluginLanguage" json:"output_languages,omitempty"` - // spdx_license_id is the license of the plugin, which should be one of the identifiers - // defined in https://spdx.org/licenses - SpdxLicenseId string `protobuf:"bytes,15,opt,name=spdx_license_id,json=spdxLicenseId,proto3" json:"spdx_license_id,omitempty"` - // license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id). - LicenseUrl string `protobuf:"bytes,16,opt,name=license_url,json=licenseUrl,proto3" json:"license_url,omitempty"` - // verified indicates the plugin has been verified. Verification is a property - // of the BSR and cannot be set by end-users. - Verified bool `protobuf:"varint,17,opt,name=verified,proto3" json:"verified,omitempty"` - // Visibility indicates whether the plugin is public or private. - Visibility CuratedPluginVisibility `protobuf:"varint,18,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.CuratedPluginVisibility" json:"visibility,omitempty"` - // Deprecated indicates whether the plugin is deprecated. - Deprecated bool `protobuf:"varint,19,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // Optionally specify a message to be displayed when the plugin is deprecated. - DeprecationMessage string `protobuf:"bytes,20,opt,name=deprecation_message,json=deprecationMessage,proto3" json:"deprecation_message,omitempty"` -} - -func (x *CuratedPlugin) Reset() { - *x = CuratedPlugin{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CuratedPlugin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CuratedPlugin) ProtoMessage() {} - -func (x *CuratedPlugin) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CuratedPlugin.ProtoReflect.Descriptor instead. -func (*CuratedPlugin) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{6} -} - -func (x *CuratedPlugin) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *CuratedPlugin) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *CuratedPlugin) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CuratedPlugin) GetRegistryType() PluginRegistryType { - if x != nil { - return x.RegistryType - } - return PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED -} - -func (x *CuratedPlugin) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *CuratedPlugin) GetContainerImageDigest() string { - if x != nil { - return x.ContainerImageDigest - } - return "" -} - -func (x *CuratedPlugin) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *CuratedPlugin) GetDependencies() []*CuratedPluginReference { - if x != nil { - return x.Dependencies - } - return nil -} - -func (x *CuratedPlugin) GetSourceUrl() string { - if x != nil { - return x.SourceUrl - } - return "" -} - -func (x *CuratedPlugin) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CuratedPlugin) GetRegistryConfig() *RegistryConfig { - if x != nil { - return x.RegistryConfig - } - return nil -} - -func (x *CuratedPlugin) GetRevision() uint32 { - if x != nil { - return x.Revision - } - return 0 -} - -func (x *CuratedPlugin) GetOutputLanguages() []PluginLanguage { - if x != nil { - return x.OutputLanguages - } - return nil -} - -func (x *CuratedPlugin) GetSpdxLicenseId() string { - if x != nil { - return x.SpdxLicenseId - } - return "" -} - -func (x *CuratedPlugin) GetLicenseUrl() string { - if x != nil { - return x.LicenseUrl - } - return "" -} - -func (x *CuratedPlugin) GetVerified() bool { - if x != nil { - return x.Verified - } - return false -} - -func (x *CuratedPlugin) GetVisibility() CuratedPluginVisibility { - if x != nil { - return x.Visibility - } - return CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED -} - -func (x *CuratedPlugin) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *CuratedPlugin) GetDeprecationMessage() string { - if x != nil { - return x.DeprecationMessage - } - return "" -} - -type GenerateCodeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The image to run plugins against to generate the desired file outputs. - // - // All image files that are not imports and not well-known types will be generated. - // If you want to filter what files are generated, modify the image. - // If you want to include imports, set include_imports. - Image *v1.Image `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` - Requests []*PluginGenerationRequest `protobuf:"bytes,2,rep,name=requests,proto3" json:"requests,omitempty"` - // Include imports from the Image in generation. If include_imports is also set - // in one of requests, use the request's value for that plugin. - IncludeImports bool `protobuf:"varint,3,opt,name=include_imports,json=includeImports,proto3" json:"include_imports,omitempty"` - // Include Well-Known Types from the Image in generation. - // - // include_imports must be set if include_well_known_types is set. If include_well_known_types - // is also set in one of requests, use the request's value for that plugin. - IncludeWellKnownTypes bool `protobuf:"varint,4,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3" json:"include_well_known_types,omitempty"` -} - -func (x *GenerateCodeRequest) Reset() { - *x = GenerateCodeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateCodeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateCodeRequest) ProtoMessage() {} - -func (x *GenerateCodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateCodeRequest.ProtoReflect.Descriptor instead. -func (*GenerateCodeRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{7} -} - -func (x *GenerateCodeRequest) GetImage() *v1.Image { - if x != nil { - return x.Image - } - return nil -} - -func (x *GenerateCodeRequest) GetRequests() []*PluginGenerationRequest { - if x != nil { - return x.Requests - } - return nil -} - -func (x *GenerateCodeRequest) GetIncludeImports() bool { - if x != nil { - return x.IncludeImports - } - return false -} - -func (x *GenerateCodeRequest) GetIncludeWellKnownTypes() bool { - if x != nil { - return x.IncludeWellKnownTypes - } - return false -} - -type GenerateCodeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Responses from each plugin execution. - // The order of each response matches the order in the GenerateCodeRequest. - Responses []*PluginGenerationResponse `protobuf:"bytes,1,rep,name=responses,proto3" json:"responses,omitempty"` -} - -func (x *GenerateCodeResponse) Reset() { - *x = GenerateCodeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GenerateCodeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateCodeResponse) ProtoMessage() {} - -func (x *GenerateCodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GenerateCodeResponse.ProtoReflect.Descriptor instead. -func (*GenerateCodeResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{8} -} - -func (x *GenerateCodeResponse) GetResponses() []*PluginGenerationResponse { - if x != nil { - return x.Responses - } - return nil -} - -// Request for performing code generation using the specified plugin. -type PluginGenerationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plugin to execute. - PluginReference *CuratedPluginReference `protobuf:"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3" json:"plugin_reference,omitempty"` - // The options to pass to the plugin. These will - // be merged into a single, comma-separated string. - Options []string `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"` - // Include imports from the Image in generation. - IncludeImports *bool `protobuf:"varint,3,opt,name=include_imports,json=includeImports,proto3,oneof" json:"include_imports,omitempty"` - // Include Well-Known Types from the Image in generation. - // - // include_imports must be set if include_well_known_types is set. - IncludeWellKnownTypes *bool `protobuf:"varint,4,opt,name=include_well_known_types,json=includeWellKnownTypes,proto3,oneof" json:"include_well_known_types,omitempty"` -} - -func (x *PluginGenerationRequest) Reset() { - *x = PluginGenerationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginGenerationRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginGenerationRequest) ProtoMessage() {} - -func (x *PluginGenerationRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginGenerationRequest.ProtoReflect.Descriptor instead. -func (*PluginGenerationRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{9} -} - -func (x *PluginGenerationRequest) GetPluginReference() *CuratedPluginReference { - if x != nil { - return x.PluginReference - } - return nil -} - -func (x *PluginGenerationRequest) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -func (x *PluginGenerationRequest) GetIncludeImports() bool { - if x != nil && x.IncludeImports != nil { - return *x.IncludeImports - } - return false -} - -func (x *PluginGenerationRequest) GetIncludeWellKnownTypes() bool { - if x != nil && x.IncludeWellKnownTypes != nil { - return *x.IncludeWellKnownTypes - } - return false -} - -// Response from code generation for a given plugin. -type PluginGenerationResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Generated code from the plugin. - Response *pluginpb.CodeGeneratorResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` -} - -func (x *PluginGenerationResponse) Reset() { - *x = PluginGenerationResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginGenerationResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginGenerationResponse) ProtoMessage() {} - -func (x *PluginGenerationResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginGenerationResponse.ProtoReflect.Descriptor instead. -func (*PluginGenerationResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{10} -} - -func (x *PluginGenerationResponse) GetResponse() *pluginpb.CodeGeneratorResponse { - if x != nil { - return x.Response - } - return nil -} - -type DeleteCuratedPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin to delete. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin to delete. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Version is the plugin version and is optional. If this field is not set then delete all versions, - // otherwise delete only the specified version which includes all revisions. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *DeleteCuratedPluginRequest) Reset() { - *x = DeleteCuratedPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteCuratedPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteCuratedPluginRequest) ProtoMessage() {} - -func (x *DeleteCuratedPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteCuratedPluginRequest.ProtoReflect.Descriptor instead. -func (*DeleteCuratedPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteCuratedPluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *DeleteCuratedPluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *DeleteCuratedPluginRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type DeleteCuratedPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteCuratedPluginResponse) Reset() { - *x = DeleteCuratedPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteCuratedPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteCuratedPluginResponse) ProtoMessage() {} - -func (x *DeleteCuratedPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteCuratedPluginResponse.ProtoReflect.Descriptor instead. -func (*DeleteCuratedPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{12} -} - -type CreateCuratedPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin, i.e. "library". - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin, i.e. "connect-go". - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The optional registry type of the plugin. - RegistryType PluginRegistryType `protobuf:"varint,3,opt,name=registry_type,json=registryType,proto3,enum=buf.alpha.registry.v1alpha1.PluginRegistryType" json:"registry_type,omitempty"` - // Semver-formatted plugin version. - Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"` - // The full container image digest associated with this plugin version including - // the algorithm. - // Ref: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#digests - ContainerImageDigest string `protobuf:"bytes,5,opt,name=container_image_digest,json=containerImageDigest,proto3" json:"container_image_digest,omitempty"` - // List of plugin dependencies. - Dependencies []*CuratedPluginReference `protobuf:"bytes,7,rep,name=dependencies,proto3" json:"dependencies,omitempty"` - // The URL leading to the source code of the plugin, if available. - SourceUrl string `protobuf:"bytes,8,opt,name=source_url,json=sourceUrl,proto3" json:"source_url,omitempty"` - // A brief description of the plugin functionality. - Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` - // The configuration for the remote registry of the plugin. - RegistryConfig *RegistryConfig `protobuf:"bytes,12,opt,name=registry_config,json=registryConfig,proto3" json:"registry_config,omitempty"` - // The revision for this plugin version. - Revision uint32 `protobuf:"varint,13,opt,name=revision,proto3" json:"revision,omitempty"` - // The output languages supported by the plugin. - OutputLanguages []PluginLanguage `protobuf:"varint,14,rep,packed,name=output_languages,json=outputLanguages,proto3,enum=buf.alpha.registry.v1alpha1.PluginLanguage" json:"output_languages,omitempty"` - // spdx_license_id is the license of the plugin, which should be one of the identifiers - // defined in https://spdx.org/licenses - SpdxLicenseId string `protobuf:"bytes,15,opt,name=spdx_license_id,json=spdxLicenseId,proto3" json:"spdx_license_id,omitempty"` - // license_url specifies an optional URL for the plugin's license (if not using a standard spdx_license_id). - LicenseUrl string `protobuf:"bytes,16,opt,name=license_url,json=licenseUrl,proto3" json:"license_url,omitempty"` - // Visibility indicates whether the plugin is public or private. - Visibility CuratedPluginVisibility `protobuf:"varint,17,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.CuratedPluginVisibility" json:"visibility,omitempty"` -} - -func (x *CreateCuratedPluginRequest) Reset() { - *x = CreateCuratedPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateCuratedPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateCuratedPluginRequest) ProtoMessage() {} - -func (x *CreateCuratedPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateCuratedPluginRequest.ProtoReflect.Descriptor instead. -func (*CreateCuratedPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{13} -} - -func (x *CreateCuratedPluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetRegistryType() PluginRegistryType { - if x != nil { - return x.RegistryType - } - return PluginRegistryType_PLUGIN_REGISTRY_TYPE_UNSPECIFIED -} - -func (x *CreateCuratedPluginRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetContainerImageDigest() string { - if x != nil { - return x.ContainerImageDigest - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetDependencies() []*CuratedPluginReference { - if x != nil { - return x.Dependencies - } - return nil -} - -func (x *CreateCuratedPluginRequest) GetSourceUrl() string { - if x != nil { - return x.SourceUrl - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetRegistryConfig() *RegistryConfig { - if x != nil { - return x.RegistryConfig - } - return nil -} - -func (x *CreateCuratedPluginRequest) GetRevision() uint32 { - if x != nil { - return x.Revision - } - return 0 -} - -func (x *CreateCuratedPluginRequest) GetOutputLanguages() []PluginLanguage { - if x != nil { - return x.OutputLanguages - } - return nil -} - -func (x *CreateCuratedPluginRequest) GetSpdxLicenseId() string { - if x != nil { - return x.SpdxLicenseId - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetLicenseUrl() string { - if x != nil { - return x.LicenseUrl - } - return "" -} - -func (x *CreateCuratedPluginRequest) GetVisibility() CuratedPluginVisibility { - if x != nil { - return x.Visibility - } - return CuratedPluginVisibility_CURATED_PLUGIN_VISIBILITY_UNSPECIFIED -} - -type CreateCuratedPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The created plugin. - Configuration *CuratedPlugin `protobuf:"bytes,1,opt,name=configuration,proto3" json:"configuration,omitempty"` -} - -func (x *CreateCuratedPluginResponse) Reset() { - *x = CreateCuratedPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateCuratedPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateCuratedPluginResponse) ProtoMessage() {} - -func (x *CreateCuratedPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateCuratedPluginResponse.ProtoReflect.Descriptor instead. -func (*CreateCuratedPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{14} -} - -func (x *CreateCuratedPluginResponse) GetConfiguration() *CuratedPlugin { - if x != nil { - return x.Configuration - } - return nil -} - -type ListCuratedPluginsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // If true, will only return plugins which support remote packages (registry_type is set). - SupportsRemotePackages bool `protobuf:"varint,4,opt,name=supports_remote_packages,json=supportsRemotePackages,proto3" json:"supports_remote_packages,omitempty"` - // If true, will include deprecated plugins. - IncludeDeprecated bool `protobuf:"varint,5,opt,name=include_deprecated,json=includeDeprecated,proto3" json:"include_deprecated,omitempty"` -} - -func (x *ListCuratedPluginsRequest) Reset() { - *x = ListCuratedPluginsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCuratedPluginsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCuratedPluginsRequest) ProtoMessage() {} - -func (x *ListCuratedPluginsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListCuratedPluginsRequest.ProtoReflect.Descriptor instead. -func (*ListCuratedPluginsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{15} -} - -func (x *ListCuratedPluginsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListCuratedPluginsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListCuratedPluginsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -func (x *ListCuratedPluginsRequest) GetSupportsRemotePackages() bool { - if x != nil { - return x.SupportsRemotePackages - } - return false -} - -func (x *ListCuratedPluginsRequest) GetIncludeDeprecated() bool { - if x != nil { - return x.IncludeDeprecated - } - return false -} - -type ListCuratedPluginsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugins []*CuratedPlugin `protobuf:"bytes,1,rep,name=plugins,proto3" json:"plugins,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListCuratedPluginsResponse) Reset() { - *x = ListCuratedPluginsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListCuratedPluginsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListCuratedPluginsResponse) ProtoMessage() {} - -func (x *ListCuratedPluginsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListCuratedPluginsResponse.ProtoReflect.Descriptor instead. -func (*ListCuratedPluginsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{16} -} - -func (x *ListCuratedPluginsResponse) GetPlugins() []*CuratedPlugin { - if x != nil { - return x.Plugins - } - return nil -} - -func (x *ListCuratedPluginsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type GetLatestCuratedPluginRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin, i.e. "library". - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin, i.e. "connect-go". - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // Both version (semver-formatted) and revision are optional, which means - // return the latest plugin. - // If version is set, but revision is omitted, then return the latest - // revision for that version. - // If version and revision are both set, return specific plugin. - // It is an error to set a revision without a corresponding version. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Revision uint32 `protobuf:"varint,4,opt,name=revision,proto3" json:"revision,omitempty"` - // If true, will only return versions (and revisions) which support remote packages (registry_type is set). - SupportsRemotePackages bool `protobuf:"varint,5,opt,name=supports_remote_packages,json=supportsRemotePackages,proto3" json:"supports_remote_packages,omitempty"` -} - -func (x *GetLatestCuratedPluginRequest) Reset() { - *x = GetLatestCuratedPluginRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLatestCuratedPluginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestCuratedPluginRequest) ProtoMessage() {} - -func (x *GetLatestCuratedPluginRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestCuratedPluginRequest.ProtoReflect.Descriptor instead. -func (*GetLatestCuratedPluginRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{17} -} - -func (x *GetLatestCuratedPluginRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetLatestCuratedPluginRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetLatestCuratedPluginRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GetLatestCuratedPluginRequest) GetRevision() uint32 { - if x != nil { - return x.Revision - } - return 0 -} - -func (x *GetLatestCuratedPluginRequest) GetSupportsRemotePackages() bool { - if x != nil { - return x.SupportsRemotePackages - } - return false -} - -type GetLatestCuratedPluginResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin *CuratedPlugin `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - // versions is a semver-sorted list in descending order. - Versions []*CuratedPluginVersionRevisions `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"` -} - -func (x *GetLatestCuratedPluginResponse) Reset() { - *x = GetLatestCuratedPluginResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLatestCuratedPluginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestCuratedPluginResponse) ProtoMessage() {} - -func (x *GetLatestCuratedPluginResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestCuratedPluginResponse.ProtoReflect.Descriptor instead. -func (*GetLatestCuratedPluginResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{18} -} - -func (x *GetLatestCuratedPluginResponse) GetPlugin() *CuratedPlugin { - if x != nil { - return x.Plugin - } - return nil -} - -func (x *GetLatestCuratedPluginResponse) GetVersions() []*CuratedPluginVersionRevisions { - if x != nil { - return x.Versions - } - return nil -} - -type CuratedPluginVersionRevisions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // revisions is a sorted list in descending order. - Revisions []uint32 `protobuf:"varint,2,rep,packed,name=revisions,proto3" json:"revisions,omitempty"` -} - -func (x *CuratedPluginVersionRevisions) Reset() { - *x = CuratedPluginVersionRevisions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CuratedPluginVersionRevisions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CuratedPluginVersionRevisions) ProtoMessage() {} - -func (x *CuratedPluginVersionRevisions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CuratedPluginVersionRevisions.ProtoReflect.Descriptor instead. -func (*CuratedPluginVersionRevisions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{19} -} - -func (x *CuratedPluginVersionRevisions) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *CuratedPluginVersionRevisions) GetRevisions() []uint32 { - if x != nil { - return x.Revisions - } - return nil -} - -// RuntimeLibrary describes the runtime library dependency of the generated code. -type GoConfig_RuntimeLibrary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the runtime library module, i.e. "google.golang.org/protobuf". - Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module,omitempty"` - // The version of the runtime library, i.e. "v1.27.1". - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GoConfig_RuntimeLibrary) Reset() { - *x = GoConfig_RuntimeLibrary{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GoConfig_RuntimeLibrary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GoConfig_RuntimeLibrary) ProtoMessage() {} - -func (x *GoConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GoConfig_RuntimeLibrary.ProtoReflect.Descriptor instead. -func (*GoConfig_RuntimeLibrary) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{0, 0} -} - -func (x *GoConfig_RuntimeLibrary) GetModule() string { - if x != nil { - return x.Module - } - return "" -} - -func (x *GoConfig_RuntimeLibrary) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// RuntimeLibrary describes the runtime library dependency of the generated code. -type NPMConfig_RuntimeLibrary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the runtime library package, i.e. "@grpc/grpc-js". - Package string `protobuf:"bytes,1,opt,name=package,proto3" json:"package,omitempty"` - // The version of the runtime library, i.e. "^1.27.1". - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *NPMConfig_RuntimeLibrary) Reset() { - *x = NPMConfig_RuntimeLibrary{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *NPMConfig_RuntimeLibrary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*NPMConfig_RuntimeLibrary) ProtoMessage() {} - -func (x *NPMConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use NPMConfig_RuntimeLibrary.ProtoReflect.Descriptor instead. -func (*NPMConfig_RuntimeLibrary) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{1, 0} -} - -func (x *NPMConfig_RuntimeLibrary) GetPackage() string { - if x != nil { - return x.Package - } - return "" -} - -func (x *NPMConfig_RuntimeLibrary) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// RuntimeLibrary describes a runtime dependency of the generated code. -type MavenConfig_RuntimeLibrary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` - ArtifactId string `protobuf:"bytes,2,opt,name=artifact_id,json=artifactId,proto3" json:"artifact_id,omitempty"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - Classifier string `protobuf:"bytes,4,opt,name=classifier,proto3" json:"classifier,omitempty"` - Extension string `protobuf:"bytes,5,opt,name=extension,proto3" json:"extension,omitempty"` -} - -func (x *MavenConfig_RuntimeLibrary) Reset() { - *x = MavenConfig_RuntimeLibrary{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig_RuntimeLibrary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig_RuntimeLibrary) ProtoMessage() {} - -func (x *MavenConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig_RuntimeLibrary.ProtoReflect.Descriptor instead. -func (*MavenConfig_RuntimeLibrary) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *MavenConfig_RuntimeLibrary) GetGroupId() string { - if x != nil { - return x.GroupId - } - return "" -} - -func (x *MavenConfig_RuntimeLibrary) GetArtifactId() string { - if x != nil { - return x.ArtifactId - } - return "" -} - -func (x *MavenConfig_RuntimeLibrary) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *MavenConfig_RuntimeLibrary) GetClassifier() string { - if x != nil { - return x.Classifier - } - return "" -} - -func (x *MavenConfig_RuntimeLibrary) GetExtension() string { - if x != nil { - return x.Extension - } - return "" -} - -// CompilerConfig contains configuration for the Java and/or Kotlin compiler used when compiling the generated code. -type MavenConfig_CompilerConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Java *MavenConfig_CompilerJavaConfig `protobuf:"bytes,1,opt,name=java,proto3" json:"java,omitempty"` - Kotlin *MavenConfig_CompilerKotlinConfig `protobuf:"bytes,2,opt,name=kotlin,proto3" json:"kotlin,omitempty"` -} - -func (x *MavenConfig_CompilerConfig) Reset() { - *x = MavenConfig_CompilerConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig_CompilerConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig_CompilerConfig) ProtoMessage() {} - -func (x *MavenConfig_CompilerConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig_CompilerConfig.ProtoReflect.Descriptor instead. -func (*MavenConfig_CompilerConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *MavenConfig_CompilerConfig) GetJava() *MavenConfig_CompilerJavaConfig { - if x != nil { - return x.Java - } - return nil -} - -func (x *MavenConfig_CompilerConfig) GetKotlin() *MavenConfig_CompilerKotlinConfig { - if x != nil { - return x.Kotlin - } - return nil -} - -// CompilerJavaConfig contains settings for the Java compiler. -type MavenConfig_CompilerJavaConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // File encoding (default: UTF-8). - Encoding string `protobuf:"bytes,1,opt,name=encoding,proto3" json:"encoding,omitempty"` - // Release version (default: 8). - Release int32 `protobuf:"varint,2,opt,name=release,proto3" json:"release,omitempty"` - // Source version (default: 8). - Source int32 `protobuf:"varint,3,opt,name=source,proto3" json:"source,omitempty"` - // Target version (default: 8). - Target int32 `protobuf:"varint,4,opt,name=target,proto3" json:"target,omitempty"` -} - -func (x *MavenConfig_CompilerJavaConfig) Reset() { - *x = MavenConfig_CompilerJavaConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig_CompilerJavaConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig_CompilerJavaConfig) ProtoMessage() {} - -func (x *MavenConfig_CompilerJavaConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig_CompilerJavaConfig.ProtoReflect.Descriptor instead. -func (*MavenConfig_CompilerJavaConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2, 2} -} - -func (x *MavenConfig_CompilerJavaConfig) GetEncoding() string { - if x != nil { - return x.Encoding - } - return "" -} - -func (x *MavenConfig_CompilerJavaConfig) GetRelease() int32 { - if x != nil { - return x.Release - } - return 0 -} - -func (x *MavenConfig_CompilerJavaConfig) GetSource() int32 { - if x != nil { - return x.Source - } - return 0 -} - -func (x *MavenConfig_CompilerJavaConfig) GetTarget() int32 { - if x != nil { - return x.Target - } - return 0 -} - -// CompilerKotlinConfig contains settings for the Kotlin compiler. -type MavenConfig_CompilerKotlinConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Version of the Kotlin compiler used to compile the generated code. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - // Version of the Kotlin API to target. - ApiVersion string `protobuf:"bytes,2,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` - // Target version of the JVM bytecode (default: 1.8). - JvmTarget string `protobuf:"bytes,3,opt,name=jvm_target,json=jvmTarget,proto3" json:"jvm_target,omitempty"` - // Kotlin language version used for source compatibility. - LanguageVersion string `protobuf:"bytes,4,opt,name=language_version,json=languageVersion,proto3" json:"language_version,omitempty"` -} - -func (x *MavenConfig_CompilerKotlinConfig) Reset() { - *x = MavenConfig_CompilerKotlinConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig_CompilerKotlinConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig_CompilerKotlinConfig) ProtoMessage() {} - -func (x *MavenConfig_CompilerKotlinConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig_CompilerKotlinConfig.ProtoReflect.Descriptor instead. -func (*MavenConfig_CompilerKotlinConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2, 3} -} - -func (x *MavenConfig_CompilerKotlinConfig) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *MavenConfig_CompilerKotlinConfig) GetApiVersion() string { - if x != nil { - return x.ApiVersion - } - return "" -} - -func (x *MavenConfig_CompilerKotlinConfig) GetJvmTarget() string { - if x != nil { - return x.JvmTarget - } - return "" -} - -func (x *MavenConfig_CompilerKotlinConfig) GetLanguageVersion() string { - if x != nil { - return x.LanguageVersion - } - return "" -} - -// RuntimeConfig allows configuring additional runtimes (like the 'lite' runtime). -// They can use different runtime dependencies and plugin options. -type MavenConfig_RuntimeConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - RuntimeLibraries []*MavenConfig_RuntimeLibrary `protobuf:"bytes,2,rep,name=runtime_libraries,json=runtimeLibraries,proto3" json:"runtime_libraries,omitempty"` - // The options to pass to the plugin. These will - // be merged into a single, comma-separated string. - Options []string `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"` -} - -func (x *MavenConfig_RuntimeConfig) Reset() { - *x = MavenConfig_RuntimeConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MavenConfig_RuntimeConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MavenConfig_RuntimeConfig) ProtoMessage() {} - -func (x *MavenConfig_RuntimeConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MavenConfig_RuntimeConfig.ProtoReflect.Descriptor instead. -func (*MavenConfig_RuntimeConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{2, 4} -} - -func (x *MavenConfig_RuntimeConfig) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *MavenConfig_RuntimeConfig) GetRuntimeLibraries() []*MavenConfig_RuntimeLibrary { - if x != nil { - return x.RuntimeLibraries - } - return nil -} - -func (x *MavenConfig_RuntimeConfig) GetOptions() []string { - if x != nil { - return x.Options - } - return nil -} - -// RuntimeLibrary describes a runtime library dependency of the generated code. -type SwiftConfig_RuntimeLibrary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The source of the runtime library package, e.g. https://github.com/apple/swift-protobuf.git. - Source string `protobuf:"bytes,1,opt,name=source,proto3" json:"source,omitempty"` - // The name of the runtime library package, e.g. "swift-protobuf". - Package string `protobuf:"bytes,2,opt,name=package,proto3" json:"package,omitempty"` - // The version of the runtime library, e.g. "1.21.0". - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // The products exported by the runtime library, e.g. "SwiftProtobuf". - Products []string `protobuf:"bytes,4,rep,name=products,proto3" json:"products,omitempty"` - // The minimum compatible platform versions of the runtime library. - Platforms []*SwiftConfig_RuntimeLibrary_Platform `protobuf:"bytes,5,rep,name=platforms,proto3" json:"platforms,omitempty"` - // The supported Swift language versions of the runtime library, e.g. ".v5". - SwiftVersions []string `protobuf:"bytes,6,rep,name=swift_versions,json=swiftVersions,proto3" json:"swift_versions,omitempty"` -} - -func (x *SwiftConfig_RuntimeLibrary) Reset() { - *x = SwiftConfig_RuntimeLibrary{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SwiftConfig_RuntimeLibrary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SwiftConfig_RuntimeLibrary) ProtoMessage() {} - -func (x *SwiftConfig_RuntimeLibrary) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SwiftConfig_RuntimeLibrary.ProtoReflect.Descriptor instead. -func (*SwiftConfig_RuntimeLibrary) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *SwiftConfig_RuntimeLibrary) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - -func (x *SwiftConfig_RuntimeLibrary) GetPackage() string { - if x != nil { - return x.Package - } - return "" -} - -func (x *SwiftConfig_RuntimeLibrary) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *SwiftConfig_RuntimeLibrary) GetProducts() []string { - if x != nil { - return x.Products - } - return nil -} - -func (x *SwiftConfig_RuntimeLibrary) GetPlatforms() []*SwiftConfig_RuntimeLibrary_Platform { - if x != nil { - return x.Platforms - } - return nil -} - -func (x *SwiftConfig_RuntimeLibrary) GetSwiftVersions() []string { - if x != nil { - return x.SwiftVersions - } - return nil -} - -// The minimum compatible platform versions of the runtime library. -type SwiftConfig_RuntimeLibrary_Platform struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the platform. - Name SwiftPlatformType `protobuf:"varint,1,opt,name=name,proto3,enum=buf.alpha.registry.v1alpha1.SwiftPlatformType" json:"name,omitempty"` - // The minimum compatible version of the platform. - Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *SwiftConfig_RuntimeLibrary_Platform) Reset() { - *x = SwiftConfig_RuntimeLibrary_Platform{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SwiftConfig_RuntimeLibrary_Platform) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SwiftConfig_RuntimeLibrary_Platform) ProtoMessage() {} - -func (x *SwiftConfig_RuntimeLibrary_Platform) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SwiftConfig_RuntimeLibrary_Platform.ProtoReflect.Descriptor instead. -func (*SwiftConfig_RuntimeLibrary_Platform) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP(), []int{3, 0, 0} -} - -func (x *SwiftConfig_RuntimeLibrary_Platform) GetName() SwiftPlatformType { - if x != nil { - return x.Name - } - return SwiftPlatformType_SWIFT_PLATFORM_TYPE_UNSPECIFIED -} - -func (x *SwiftConfig_RuntimeLibrary_Platform) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_plugin_curation_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc = []byte{ - 0x0a, 0x31, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x63, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x1a, 0x1e, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x01, 0x0a, 0x08, 0x47, 0x6f, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x61, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x69, 0x6e, 0x69, - 0x6d, 0x75, 0x6d, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x1a, 0x42, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xc2, 0x02, 0x0a, 0x09, 0x4e, 0x50, 0x4d, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x62, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x50, 0x4d, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x1a, 0x72, 0x65, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x73, - 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x72, 0x65, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x50, 0x61, 0x74, 0x68, 0x53, 0x75, - 0x66, 0x66, 0x69, 0x78, 0x12, 0x4e, 0x0a, 0x0c, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x73, - 0x74, 0x79, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x50, 0x4d, 0x49, 0x6d, 0x70, 0x6f, - 0x72, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x52, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x53, - 0x74, 0x79, 0x6c, 0x65, 0x1a, 0x44, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xd3, 0x08, 0x0a, 0x0b, 0x4d, - 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x64, 0x0a, 0x11, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, - 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, - 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x53, 0x0a, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x08, 0x63, 0x6f, 0x6d, - 0x70, 0x69, 0x6c, 0x65, 0x72, 0x12, 0x67, 0x0a, 0x13, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x6c, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x75, 0x6e, - 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x12, 0x61, 0x64, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x1a, 0xa4, - 0x01, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, - 0x79, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, - 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x61, 0x72, 0x74, 0x69, 0x66, 0x61, 0x63, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xb8, 0x01, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, - 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4f, 0x0a, 0x04, 0x6a, 0x61, 0x76, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x52, 0x04, 0x6a, 0x61, 0x76, 0x61, 0x12, 0x55, 0x0a, 0x06, 0x6b, 0x6f, 0x74, - 0x6c, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x4b, 0x6f, 0x74, 0x6c, - 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x6b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, - 0x1a, 0x7a, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x1a, 0x9b, 0x01, 0x0a, - 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x4b, 0x6f, 0x74, 0x6c, 0x69, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, - 0x1f, 0x0a, 0x0b, 0x61, 0x70, 0x69, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x1d, 0x0a, 0x0a, 0x6a, 0x76, 0x6d, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6a, 0x76, 0x6d, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x61, 0x6e, 0x67, 0x75, - 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0xa3, 0x01, 0x0a, 0x0d, 0x52, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x64, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0xdf, 0x03, 0x0a, 0x0b, 0x53, 0x77, 0x69, 0x66, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x12, 0x64, 0x0a, 0x11, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x77, 0x69, 0x66, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x52, 0x10, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x69, 0x65, 0x73, 0x1a, 0xe9, 0x02, 0x0a, 0x0e, 0x52, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x73, 0x12, 0x5e, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x05, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x53, 0x77, 0x69, 0x66, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x52, - 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x2e, 0x50, 0x6c, - 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x77, 0x69, 0x66, 0x74, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x68, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x42, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x77, 0x69, 0x66, 0x74, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x22, 0xf0, 0x02, 0x0a, 0x0e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x09, 0x67, 0x6f, 0x5f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, - 0x00, 0x52, 0x08, 0x67, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x47, 0x0a, 0x0a, 0x6e, - 0x70, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4e, 0x50, - 0x4d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x70, 0x6d, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x4d, 0x0a, 0x0c, 0x6d, 0x61, 0x76, 0x65, 0x6e, 0x5f, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x6d, 0x61, 0x76, 0x65, 0x6e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x12, 0x4d, 0x0a, 0x0c, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x77, 0x69, 0x66, 0x74, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x66, 0x74, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x11, 0x0a, 0x0f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x4a, - 0x04, 0x08, 0x05, 0x10, 0x0a, 0x22, 0x78, 0x0a, 0x16, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x9c, 0x07, 0x0a, 0x0d, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x54, 0x0a, 0x0d, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, 0x0a, 0x16, 0x63, - 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x64, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x57, - 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, - 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x54, 0x0a, 0x0f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, - 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x10, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, - 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, - 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x70, 0x64, 0x78, 0x5f, 0x6c, 0x69, 0x63, 0x65, 0x6e, - 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x70, 0x64, - 0x78, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, - 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, - 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2f, 0x0a, - 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xfa, - 0x01, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, - 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x50, 0x0a, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, - 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, - 0x74, 0x73, 0x12, 0x37, 0x0a, 0x18, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x65, - 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x65, 0x6c, - 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x22, 0x6b, 0x0a, 0x14, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22, 0xb0, 0x02, 0x0a, 0x17, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x5e, 0x0a, 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x33, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2c, - 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x88, 0x01, 0x01, 0x12, 0x3c, 0x0a, 0x18, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x65, 0x6c, 0x6c, 0x5f, 0x6b, 0x6e, 0x6f, - 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, - 0x52, 0x15, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, - 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x42, 0x1b, - 0x0a, 0x19, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x77, 0x65, 0x6c, 0x6c, 0x5f, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x18, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x69, 0x6c, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x60, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x1d, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xef, 0x05, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x54, - 0x0a, 0x0d, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x34, - 0x0a, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x44, 0x69, - 0x67, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, - 0x63, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x0a, - 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x20, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x54, - 0x0a, 0x0f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x56, 0x0a, 0x10, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, - 0x61, 0x67, 0x65, 0x73, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x52, 0x0f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4c, - 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x70, 0x64, 0x78, - 0x5f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x73, 0x70, 0x64, 0x78, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x55, 0x72, - 0x6c, 0x12, 0x54, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x6f, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xda, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, - 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x18, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, - 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, - 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x61, - 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x5f, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x11, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x44, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0x8a, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x52, 0x07, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, - 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0xb9, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x18, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, - 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x22, 0xbc, - 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x42, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x06, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x56, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x57, 0x0a, - 0x1d, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0d, 0x52, 0x09, 0x72, 0x65, 0x76, - 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2a, 0x91, 0x01, 0x0a, 0x17, 0x43, 0x75, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, - 0x74, 0x79, 0x12, 0x29, 0x0a, 0x25, 0x43, 0x55, 0x52, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x4c, - 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x24, 0x0a, - 0x20, 0x43, 0x55, 0x52, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, - 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, - 0x43, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, 0x43, 0x55, 0x52, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x50, - 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, - 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, 0x2a, 0xb5, 0x01, 0x0a, 0x12, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x24, 0x0a, 0x20, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x49, - 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4c, 0x55, 0x47, 0x49, - 0x4e, 0x5f, 0x52, 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x47, 0x4f, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, - 0x45, 0x47, 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x50, 0x4d, - 0x10, 0x02, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x47, - 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x56, 0x45, 0x4e, - 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x45, 0x47, - 0x49, 0x53, 0x54, 0x52, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x57, 0x49, 0x46, 0x54, - 0x10, 0x04, 0x2a, 0xce, 0x03, 0x0a, 0x0e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4c, 0x61, 0x6e, - 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, - 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, - 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x47, 0x4f, 0x10, 0x01, 0x12, 0x1e, - 0x0a, 0x1a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, - 0x45, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x02, 0x12, 0x1e, - 0x0a, 0x1a, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x03, 0x12, 0x19, - 0x0a, 0x15, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, - 0x45, 0x5f, 0x53, 0x57, 0x49, 0x46, 0x54, 0x10, 0x04, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x4c, 0x55, - 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x43, 0x50, 0x50, - 0x10, 0x05, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, - 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x10, 0x06, 0x12, 0x18, 0x0a, 0x14, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, - 0x44, 0x41, 0x52, 0x54, 0x10, 0x07, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, - 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x52, 0x55, 0x53, 0x54, 0x10, 0x08, - 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, - 0x41, 0x47, 0x45, 0x5f, 0x50, 0x59, 0x54, 0x48, 0x4f, 0x4e, 0x10, 0x09, 0x12, 0x18, 0x0a, 0x14, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, - 0x52, 0x55, 0x42, 0x59, 0x10, 0x0a, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, - 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x4b, 0x4f, 0x54, 0x4c, 0x49, 0x4e, - 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, - 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x49, 0x56, 0x45, 0x5f, - 0x43, 0x10, 0x0c, 0x12, 0x17, 0x0a, 0x13, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, - 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x50, 0x48, 0x50, 0x10, 0x0d, 0x12, 0x1a, 0x0a, 0x16, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, - 0x43, 0x53, 0x48, 0x41, 0x52, 0x50, 0x10, 0x0e, 0x12, 0x19, 0x0a, 0x15, 0x50, 0x4c, 0x55, 0x47, - 0x49, 0x4e, 0x5f, 0x4c, 0x41, 0x4e, 0x47, 0x55, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x43, 0x41, 0x4c, - 0x41, 0x10, 0x0f, 0x2a, 0x6e, 0x0a, 0x0e, 0x4e, 0x50, 0x4d, 0x49, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x53, 0x74, 0x79, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x4e, 0x50, 0x4d, 0x5f, 0x49, 0x4d, 0x50, - 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x50, 0x4d, 0x5f, 0x49, - 0x4d, 0x50, 0x4f, 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x4d, 0x4f, 0x44, 0x55, - 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x4e, 0x50, 0x4d, 0x5f, 0x49, 0x4d, 0x50, 0x4f, - 0x52, 0x54, 0x5f, 0x53, 0x54, 0x59, 0x4c, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x4f, 0x4e, 0x4a, - 0x53, 0x10, 0x02, 0x2a, 0xb3, 0x01, 0x0a, 0x11, 0x53, 0x77, 0x69, 0x66, 0x74, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x53, 0x57, 0x49, - 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, - 0x0a, 0x19, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x4f, 0x53, 0x10, 0x01, 0x12, 0x1b, 0x0a, - 0x17, 0x53, 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4f, 0x53, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x57, - 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x57, 0x41, 0x54, 0x43, 0x48, 0x4f, 0x53, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x53, - 0x57, 0x49, 0x46, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x54, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x54, 0x56, 0x4f, 0x53, 0x10, 0x04, 0x32, 0xdd, 0x04, 0x0a, 0x15, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, - 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, - 0x12, 0x96, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x75, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x3a, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, - 0x65, 0x73, 0x74, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, - 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, - 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x32, 0x8c, 0x01, 0x0a, 0x15, 0x43, 0x6f, - 0x64, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x12, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa0, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x13, 0x50, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, - 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescData = file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes = make([]protoimpl.EnumInfo, 5) -var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes = make([]protoimpl.MessageInfo, 29) -var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes = []interface{}{ - (CuratedPluginVisibility)(0), // 0: buf.alpha.registry.v1alpha1.CuratedPluginVisibility - (PluginRegistryType)(0), // 1: buf.alpha.registry.v1alpha1.PluginRegistryType - (PluginLanguage)(0), // 2: buf.alpha.registry.v1alpha1.PluginLanguage - (NPMImportStyle)(0), // 3: buf.alpha.registry.v1alpha1.NPMImportStyle - (SwiftPlatformType)(0), // 4: buf.alpha.registry.v1alpha1.SwiftPlatformType - (*GoConfig)(nil), // 5: buf.alpha.registry.v1alpha1.GoConfig - (*NPMConfig)(nil), // 6: buf.alpha.registry.v1alpha1.NPMConfig - (*MavenConfig)(nil), // 7: buf.alpha.registry.v1alpha1.MavenConfig - (*SwiftConfig)(nil), // 8: buf.alpha.registry.v1alpha1.SwiftConfig - (*RegistryConfig)(nil), // 9: buf.alpha.registry.v1alpha1.RegistryConfig - (*CuratedPluginReference)(nil), // 10: buf.alpha.registry.v1alpha1.CuratedPluginReference - (*CuratedPlugin)(nil), // 11: buf.alpha.registry.v1alpha1.CuratedPlugin - (*GenerateCodeRequest)(nil), // 12: buf.alpha.registry.v1alpha1.GenerateCodeRequest - (*GenerateCodeResponse)(nil), // 13: buf.alpha.registry.v1alpha1.GenerateCodeResponse - (*PluginGenerationRequest)(nil), // 14: buf.alpha.registry.v1alpha1.PluginGenerationRequest - (*PluginGenerationResponse)(nil), // 15: buf.alpha.registry.v1alpha1.PluginGenerationResponse - (*DeleteCuratedPluginRequest)(nil), // 16: buf.alpha.registry.v1alpha1.DeleteCuratedPluginRequest - (*DeleteCuratedPluginResponse)(nil), // 17: buf.alpha.registry.v1alpha1.DeleteCuratedPluginResponse - (*CreateCuratedPluginRequest)(nil), // 18: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest - (*CreateCuratedPluginResponse)(nil), // 19: buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse - (*ListCuratedPluginsRequest)(nil), // 20: buf.alpha.registry.v1alpha1.ListCuratedPluginsRequest - (*ListCuratedPluginsResponse)(nil), // 21: buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse - (*GetLatestCuratedPluginRequest)(nil), // 22: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginRequest - (*GetLatestCuratedPluginResponse)(nil), // 23: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse - (*CuratedPluginVersionRevisions)(nil), // 24: buf.alpha.registry.v1alpha1.CuratedPluginVersionRevisions - (*GoConfig_RuntimeLibrary)(nil), // 25: buf.alpha.registry.v1alpha1.GoConfig.RuntimeLibrary - (*NPMConfig_RuntimeLibrary)(nil), // 26: buf.alpha.registry.v1alpha1.NPMConfig.RuntimeLibrary - (*MavenConfig_RuntimeLibrary)(nil), // 27: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary - (*MavenConfig_CompilerConfig)(nil), // 28: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig - (*MavenConfig_CompilerJavaConfig)(nil), // 29: buf.alpha.registry.v1alpha1.MavenConfig.CompilerJavaConfig - (*MavenConfig_CompilerKotlinConfig)(nil), // 30: buf.alpha.registry.v1alpha1.MavenConfig.CompilerKotlinConfig - (*MavenConfig_RuntimeConfig)(nil), // 31: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig - (*SwiftConfig_RuntimeLibrary)(nil), // 32: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary - (*SwiftConfig_RuntimeLibrary_Platform)(nil), // 33: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform - (*timestamppb.Timestamp)(nil), // 34: google.protobuf.Timestamp - (*v1.Image)(nil), // 35: buf.alpha.image.v1.Image - (*pluginpb.CodeGeneratorResponse)(nil), // 36: google.protobuf.compiler.CodeGeneratorResponse -} -var file_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs = []int32{ - 25, // 0: buf.alpha.registry.v1alpha1.GoConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.GoConfig.RuntimeLibrary - 26, // 1: buf.alpha.registry.v1alpha1.NPMConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.NPMConfig.RuntimeLibrary - 3, // 2: buf.alpha.registry.v1alpha1.NPMConfig.import_style:type_name -> buf.alpha.registry.v1alpha1.NPMImportStyle - 27, // 3: buf.alpha.registry.v1alpha1.MavenConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary - 28, // 4: buf.alpha.registry.v1alpha1.MavenConfig.compiler:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig - 31, // 5: buf.alpha.registry.v1alpha1.MavenConfig.additional_runtimes:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig - 32, // 6: buf.alpha.registry.v1alpha1.SwiftConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary - 5, // 7: buf.alpha.registry.v1alpha1.RegistryConfig.go_config:type_name -> buf.alpha.registry.v1alpha1.GoConfig - 6, // 8: buf.alpha.registry.v1alpha1.RegistryConfig.npm_config:type_name -> buf.alpha.registry.v1alpha1.NPMConfig - 7, // 9: buf.alpha.registry.v1alpha1.RegistryConfig.maven_config:type_name -> buf.alpha.registry.v1alpha1.MavenConfig - 8, // 10: buf.alpha.registry.v1alpha1.RegistryConfig.swift_config:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig - 1, // 11: buf.alpha.registry.v1alpha1.CuratedPlugin.registry_type:type_name -> buf.alpha.registry.v1alpha1.PluginRegistryType - 34, // 12: buf.alpha.registry.v1alpha1.CuratedPlugin.create_time:type_name -> google.protobuf.Timestamp - 10, // 13: buf.alpha.registry.v1alpha1.CuratedPlugin.dependencies:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference - 9, // 14: buf.alpha.registry.v1alpha1.CuratedPlugin.registry_config:type_name -> buf.alpha.registry.v1alpha1.RegistryConfig - 2, // 15: buf.alpha.registry.v1alpha1.CuratedPlugin.output_languages:type_name -> buf.alpha.registry.v1alpha1.PluginLanguage - 0, // 16: buf.alpha.registry.v1alpha1.CuratedPlugin.visibility:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVisibility - 35, // 17: buf.alpha.registry.v1alpha1.GenerateCodeRequest.image:type_name -> buf.alpha.image.v1.Image - 14, // 18: buf.alpha.registry.v1alpha1.GenerateCodeRequest.requests:type_name -> buf.alpha.registry.v1alpha1.PluginGenerationRequest - 15, // 19: buf.alpha.registry.v1alpha1.GenerateCodeResponse.responses:type_name -> buf.alpha.registry.v1alpha1.PluginGenerationResponse - 10, // 20: buf.alpha.registry.v1alpha1.PluginGenerationRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference - 36, // 21: buf.alpha.registry.v1alpha1.PluginGenerationResponse.response:type_name -> google.protobuf.compiler.CodeGeneratorResponse - 1, // 22: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.registry_type:type_name -> buf.alpha.registry.v1alpha1.PluginRegistryType - 10, // 23: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.dependencies:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginReference - 9, // 24: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.registry_config:type_name -> buf.alpha.registry.v1alpha1.RegistryConfig - 2, // 25: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.output_languages:type_name -> buf.alpha.registry.v1alpha1.PluginLanguage - 0, // 26: buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVisibility - 11, // 27: buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse.configuration:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin - 11, // 28: buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse.plugins:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin - 11, // 29: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse.plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin - 24, // 30: buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse.versions:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginVersionRevisions - 29, // 31: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig.java:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerJavaConfig - 30, // 32: buf.alpha.registry.v1alpha1.MavenConfig.CompilerConfig.kotlin:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.CompilerKotlinConfig - 27, // 33: buf.alpha.registry.v1alpha1.MavenConfig.RuntimeConfig.runtime_libraries:type_name -> buf.alpha.registry.v1alpha1.MavenConfig.RuntimeLibrary - 33, // 34: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.platforms:type_name -> buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform - 4, // 35: buf.alpha.registry.v1alpha1.SwiftConfig.RuntimeLibrary.Platform.name:type_name -> buf.alpha.registry.v1alpha1.SwiftPlatformType - 20, // 36: buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins:input_type -> buf.alpha.registry.v1alpha1.ListCuratedPluginsRequest - 18, // 37: buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.CreateCuratedPluginRequest - 22, // 38: buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.GetLatestCuratedPluginRequest - 16, // 39: buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin:input_type -> buf.alpha.registry.v1alpha1.DeleteCuratedPluginRequest - 12, // 40: buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode:input_type -> buf.alpha.registry.v1alpha1.GenerateCodeRequest - 21, // 41: buf.alpha.registry.v1alpha1.PluginCurationService.ListCuratedPlugins:output_type -> buf.alpha.registry.v1alpha1.ListCuratedPluginsResponse - 19, // 42: buf.alpha.registry.v1alpha1.PluginCurationService.CreateCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.CreateCuratedPluginResponse - 23, // 43: buf.alpha.registry.v1alpha1.PluginCurationService.GetLatestCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.GetLatestCuratedPluginResponse - 17, // 44: buf.alpha.registry.v1alpha1.PluginCurationService.DeleteCuratedPlugin:output_type -> buf.alpha.registry.v1alpha1.DeleteCuratedPluginResponse - 13, // 45: buf.alpha.registry.v1alpha1.CodeGenerationService.GenerateCode:output_type -> buf.alpha.registry.v1alpha1.GenerateCodeResponse - 41, // [41:46] is the sub-list for method output_type - 36, // [36:41] is the sub-list for method input_type - 36, // [36:36] is the sub-list for extension type_name - 36, // [36:36] is the sub-list for extension extendee - 0, // [0:36] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_plugin_curation_proto_init() } -func file_buf_alpha_registry_v1alpha1_plugin_curation_proto_init() { - if File_buf_alpha_registry_v1alpha1_plugin_curation_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GoConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NPMConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SwiftConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RegistryConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CuratedPluginReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CuratedPlugin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateCodeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GenerateCodeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginGenerationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginGenerationResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCuratedPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteCuratedPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCuratedPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateCuratedPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCuratedPluginsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListCuratedPluginsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestCuratedPluginRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestCuratedPluginResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CuratedPluginVersionRevisions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GoConfig_RuntimeLibrary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NPMConfig_RuntimeLibrary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig_RuntimeLibrary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig_CompilerConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig_CompilerJavaConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig_CompilerKotlinConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MavenConfig_RuntimeConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SwiftConfig_RuntimeLibrary); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SwiftConfig_RuntimeLibrary_Platform); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[4].OneofWrappers = []interface{}{ - (*RegistryConfig_GoConfig)(nil), - (*RegistryConfig_NpmConfig)(nil), - (*RegistryConfig_MavenConfig)(nil), - (*RegistryConfig_SwiftConfig)(nil), - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes[9].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc, - NumEnums: 5, - NumMessages: 29, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_plugin_curation_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_plugin_curation_proto = out.File - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/push.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/push.pb.go deleted file mode 100644 index 0da7554610..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/push.pb.go +++ /dev/null @@ -1,545 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/push.proto - -package registryv1alpha1 - -import ( - v1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// PushRequest specifies the module to push to the BSR. -type PushRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto. - Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"` - Module *v1alpha1.Module `protobuf:"bytes,4,opt,name=module,proto3" json:"module,omitempty"` - // Optional; if provided, the provided tags - // are created for the pushed commit. - Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` - // Optional; if provided, the pushed commit - // will be appended to these tracks. If the - // tracks do not exist, they will be created. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto. - Tracks []string `protobuf:"bytes,6,rep,name=tracks,proto3" json:"tracks,omitempty"` - // If non-empty, the push creates a draft commit with this name. - DraftName string `protobuf:"bytes,7,opt,name=draft_name,json=draftName,proto3" json:"draft_name,omitempty"` -} - -func (x *PushRequest) Reset() { - *x = PushRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PushRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PushRequest) ProtoMessage() {} - -func (x *PushRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PushRequest.ProtoReflect.Descriptor instead. -func (*PushRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_push_proto_rawDescGZIP(), []int{0} -} - -func (x *PushRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *PushRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto. -func (x *PushRequest) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *PushRequest) GetModule() *v1alpha1.Module { - if x != nil { - return x.Module - } - return nil -} - -func (x *PushRequest) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/push.proto. -func (x *PushRequest) GetTracks() []string { - if x != nil { - return x.Tracks - } - return nil -} - -func (x *PushRequest) GetDraftName() string { - if x != nil { - return x.DraftName - } - return "" -} - -// PushResponse is the pushed module pin, local to the used remote. -type PushResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalModulePin *LocalModulePin `protobuf:"bytes,5,opt,name=local_module_pin,json=localModulePin,proto3" json:"local_module_pin,omitempty"` -} - -func (x *PushResponse) Reset() { - *x = PushResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PushResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PushResponse) ProtoMessage() {} - -func (x *PushResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PushResponse.ProtoReflect.Descriptor instead. -func (*PushResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_push_proto_rawDescGZIP(), []int{1} -} - -func (x *PushResponse) GetLocalModulePin() *LocalModulePin { - if x != nil { - return x.LocalModulePin - } - return nil -} - -// PushManifestAndBlobsRequest holds the module to push in the manifest+blobs -// encoding format. -type PushManifestAndBlobsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Manifest with all the module files being pushed. - Manifest *v1alpha1.Blob `protobuf:"bytes,3,opt,name=manifest,proto3" json:"manifest,omitempty"` - // Referenced blobs in the manifest. Keep in mind there is not necessarily one - // blob per file, but one blob per digest, so for files with exactly the same - // content, you can send just one blob. - Blobs []*v1alpha1.Blob `protobuf:"bytes,4,rep,name=blobs,proto3" json:"blobs,omitempty"` - // Optional; if provided, the provided tags - // are created for the pushed commit. - Tags []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` - // If non-empty, the push creates a draft commit with this name. - DraftName string `protobuf:"bytes,6,opt,name=draft_name,json=draftName,proto3" json:"draft_name,omitempty"` -} - -func (x *PushManifestAndBlobsRequest) Reset() { - *x = PushManifestAndBlobsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PushManifestAndBlobsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PushManifestAndBlobsRequest) ProtoMessage() {} - -func (x *PushManifestAndBlobsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PushManifestAndBlobsRequest.ProtoReflect.Descriptor instead. -func (*PushManifestAndBlobsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_push_proto_rawDescGZIP(), []int{2} -} - -func (x *PushManifestAndBlobsRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *PushManifestAndBlobsRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *PushManifestAndBlobsRequest) GetManifest() *v1alpha1.Blob { - if x != nil { - return x.Manifest - } - return nil -} - -func (x *PushManifestAndBlobsRequest) GetBlobs() []*v1alpha1.Blob { - if x != nil { - return x.Blobs - } - return nil -} - -func (x *PushManifestAndBlobsRequest) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -func (x *PushManifestAndBlobsRequest) GetDraftName() string { - if x != nil { - return x.DraftName - } - return "" -} - -// PushManifestAndBlobsResponse is the pushed module pin, local to the used -// remote. -type PushManifestAndBlobsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalModulePin *LocalModulePin `protobuf:"bytes,1,opt,name=local_module_pin,json=localModulePin,proto3" json:"local_module_pin,omitempty"` -} - -func (x *PushManifestAndBlobsResponse) Reset() { - *x = PushManifestAndBlobsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PushManifestAndBlobsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PushManifestAndBlobsResponse) ProtoMessage() {} - -func (x *PushManifestAndBlobsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PushManifestAndBlobsResponse.ProtoReflect.Descriptor instead. -func (*PushManifestAndBlobsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_push_proto_rawDescGZIP(), []int{3} -} - -func (x *PushManifestAndBlobsResponse) GetLocalModulePin() *LocalModulePin { - if x != nil { - return x.LocalModulePin - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_push_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_push_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x75, - 0x73, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe9, 0x01, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1a, 0x0a, - 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x39, 0x0a, 0x06, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x06, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1a, 0x0a, 0x06, 0x74, 0x72, 0x61, 0x63, - 0x6b, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x74, 0x72, - 0x61, 0x63, 0x6b, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x72, 0x61, 0x66, 0x74, 0x4e, - 0x61, 0x6d, 0x65, 0x22, 0x65, 0x0a, 0x0c, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x70, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x52, 0x0e, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x22, 0xfa, 0x01, 0x0a, 0x1b, 0x50, - 0x75, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, - 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, - 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x66, - 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x72, - 0x61, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x75, 0x0a, 0x1c, 0x50, 0x75, 0x73, 0x68, 0x4d, - 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x6c, 0x6f, 0x63, 0x61, 0x6c, - 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x70, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x52, 0x0e, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x32, 0x82, - 0x02, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, - 0x0a, 0x04, 0x50, 0x75, 0x73, 0x68, 0x12, 0x28, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x75, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, - 0x12, 0x90, 0x01, 0x0a, 0x14, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, - 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, - 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x41, 0x6e, - 0x64, 0x42, 0x6c, 0x6f, 0x62, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x02, 0x42, 0x96, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x09, 0x50, 0x75, 0x73, 0x68, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, - 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_push_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_push_proto_rawDescData = file_buf_alpha_registry_v1alpha1_push_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_push_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_push_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_push_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_push_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_push_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_push_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_buf_alpha_registry_v1alpha1_push_proto_goTypes = []interface{}{ - (*PushRequest)(nil), // 0: buf.alpha.registry.v1alpha1.PushRequest - (*PushResponse)(nil), // 1: buf.alpha.registry.v1alpha1.PushResponse - (*PushManifestAndBlobsRequest)(nil), // 2: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest - (*PushManifestAndBlobsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse - (*v1alpha1.Module)(nil), // 4: buf.alpha.module.v1alpha1.Module - (*LocalModulePin)(nil), // 5: buf.alpha.registry.v1alpha1.LocalModulePin - (*v1alpha1.Blob)(nil), // 6: buf.alpha.module.v1alpha1.Blob -} -var file_buf_alpha_registry_v1alpha1_push_proto_depIdxs = []int32{ - 4, // 0: buf.alpha.registry.v1alpha1.PushRequest.module:type_name -> buf.alpha.module.v1alpha1.Module - 5, // 1: buf.alpha.registry.v1alpha1.PushResponse.local_module_pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin - 6, // 2: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest.manifest:type_name -> buf.alpha.module.v1alpha1.Blob - 6, // 3: buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest.blobs:type_name -> buf.alpha.module.v1alpha1.Blob - 5, // 4: buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse.local_module_pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin - 0, // 5: buf.alpha.registry.v1alpha1.PushService.Push:input_type -> buf.alpha.registry.v1alpha1.PushRequest - 2, // 6: buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs:input_type -> buf.alpha.registry.v1alpha1.PushManifestAndBlobsRequest - 1, // 7: buf.alpha.registry.v1alpha1.PushService.Push:output_type -> buf.alpha.registry.v1alpha1.PushResponse - 3, // 8: buf.alpha.registry.v1alpha1.PushService.PushManifestAndBlobs:output_type -> buf.alpha.registry.v1alpha1.PushManifestAndBlobsResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_push_proto_init() } -func file_buf_alpha_registry_v1alpha1_push_proto_init() { - if File_buf_alpha_registry_v1alpha1_push_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_module_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushManifestAndBlobsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_push_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushManifestAndBlobsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_push_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_push_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_push_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_push_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_push_proto = out.File - file_buf_alpha_registry_v1alpha1_push_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_push_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_push_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/recommendation.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/recommendation.pb.go deleted file mode 100644 index b3877ff2b9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/recommendation.pb.go +++ /dev/null @@ -1,936 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/recommendation.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// RecommendedRepository is the information about a repository needed to link to -// its owner page. -type RecommendedRepository struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` - RepositoryId string `protobuf:"bytes,5,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *RecommendedRepository) Reset() { - *x = RecommendedRepository{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedRepository) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedRepository) ProtoMessage() {} - -func (x *RecommendedRepository) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedRepository.ProtoReflect.Descriptor instead. -func (*RecommendedRepository) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{0} -} - -func (x *RecommendedRepository) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *RecommendedRepository) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RecommendedRepository) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *RecommendedRepository) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *RecommendedRepository) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -// RecommendedTemplate is the information needed to recommend a template and link -// to its owner page. -// -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/recommendation.proto. -type RecommendedTemplate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - TemplateId string `protobuf:"bytes,4,opt,name=template_id,json=templateId,proto3" json:"template_id,omitempty"` -} - -func (x *RecommendedTemplate) Reset() { - *x = RecommendedTemplate{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedTemplate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedTemplate) ProtoMessage() {} - -func (x *RecommendedTemplate) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedTemplate.ProtoReflect.Descriptor instead. -func (*RecommendedTemplate) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{1} -} - -func (x *RecommendedTemplate) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *RecommendedTemplate) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RecommendedTemplate) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *RecommendedTemplate) GetTemplateId() string { - if x != nil { - return x.TemplateId - } - return "" -} - -// SetRecommendedResource is the information needed to configure a resource recommendation -type SetRecommendedResource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *SetRecommendedResource) Reset() { - *x = SetRecommendedResource{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetRecommendedResource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRecommendedResource) ProtoMessage() {} - -func (x *SetRecommendedResource) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetRecommendedResource.ProtoReflect.Descriptor instead. -func (*SetRecommendedResource) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{2} -} - -func (x *SetRecommendedResource) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *SetRecommendedResource) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type RecommendedRepositoriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RecommendedRepositoriesRequest) Reset() { - *x = RecommendedRepositoriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedRepositoriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedRepositoriesRequest) ProtoMessage() {} - -func (x *RecommendedRepositoriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedRepositoriesRequest.ProtoReflect.Descriptor instead. -func (*RecommendedRepositoriesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{3} -} - -type RecommendedRepositoriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*RecommendedRepository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` -} - -func (x *RecommendedRepositoriesResponse) Reset() { - *x = RecommendedRepositoriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedRepositoriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedRepositoriesResponse) ProtoMessage() {} - -func (x *RecommendedRepositoriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedRepositoriesResponse.ProtoReflect.Descriptor instead. -func (*RecommendedRepositoriesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{4} -} - -func (x *RecommendedRepositoriesResponse) GetRepositories() []*RecommendedRepository { - if x != nil { - return x.Repositories - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/recommendation.proto. -type RecommendedTemplatesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RecommendedTemplatesRequest) Reset() { - *x = RecommendedTemplatesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedTemplatesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedTemplatesRequest) ProtoMessage() {} - -func (x *RecommendedTemplatesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedTemplatesRequest.ProtoReflect.Descriptor instead. -func (*RecommendedTemplatesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{5} -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/recommendation.proto. -type RecommendedTemplatesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Templates []*RecommendedTemplate `protobuf:"bytes,1,rep,name=templates,proto3" json:"templates,omitempty"` -} - -func (x *RecommendedTemplatesResponse) Reset() { - *x = RecommendedTemplatesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RecommendedTemplatesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecommendedTemplatesResponse) ProtoMessage() {} - -func (x *RecommendedTemplatesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RecommendedTemplatesResponse.ProtoReflect.Descriptor instead. -func (*RecommendedTemplatesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{6} -} - -func (x *RecommendedTemplatesResponse) GetTemplates() []*RecommendedTemplate { - if x != nil { - return x.Templates - } - return nil -} - -type ListRecommendedResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListRecommendedResourcesRequest) Reset() { - *x = ListRecommendedResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRecommendedResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRecommendedResourcesRequest) ProtoMessage() {} - -func (x *ListRecommendedResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRecommendedResourcesRequest.ProtoReflect.Descriptor instead. -func (*ListRecommendedResourcesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{7} -} - -type ListRecommendedResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` -} - -func (x *ListRecommendedResourcesResponse) Reset() { - *x = ListRecommendedResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRecommendedResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRecommendedResourcesResponse) ProtoMessage() {} - -func (x *ListRecommendedResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRecommendedResourcesResponse.ProtoReflect.Descriptor instead. -func (*ListRecommendedResourcesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{8} -} - -func (x *ListRecommendedResourcesResponse) GetResources() []*Resource { - if x != nil { - return x.Resources - } - return nil -} - -type SetRecommendedResourcesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resources []*SetRecommendedResource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` -} - -func (x *SetRecommendedResourcesRequest) Reset() { - *x = SetRecommendedResourcesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetRecommendedResourcesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRecommendedResourcesRequest) ProtoMessage() {} - -func (x *SetRecommendedResourcesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetRecommendedResourcesRequest.ProtoReflect.Descriptor instead. -func (*SetRecommendedResourcesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{9} -} - -func (x *SetRecommendedResourcesRequest) GetResources() []*SetRecommendedResource { - if x != nil { - return x.Resources - } - return nil -} - -type SetRecommendedResourcesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetRecommendedResourcesResponse) Reset() { - *x = SetRecommendedResourcesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetRecommendedResourcesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRecommendedResourcesResponse) ProtoMessage() {} - -func (x *SetRecommendedResourcesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetRecommendedResourcesResponse.ProtoReflect.Descriptor instead. -func (*SetRecommendedResourcesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP(), []int{10} -} - -var File_buf_alpha_registry_v1alpha1_recommendation_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, - 0x2a, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, - 0x15, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x49, 0x64, 0x22, 0x86, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x64, 0x65, 0x64, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x42, 0x0a, - 0x16, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x20, 0x0a, 0x1e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x22, 0x79, 0x0a, 0x1f, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, - 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x21, - 0x0a, 0x1b, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x65, 0x6d, - 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a, 0x02, 0x18, - 0x01, 0x22, 0x72, 0x0a, 0x1c, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, - 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x09, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, - 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x21, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x67, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x09, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x22, 0x73, 0x0a, 0x1e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x51, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x21, 0x0a, 0x1f, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x84, 0x05, 0x0a, 0x15, 0x52, 0x65, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x64, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, - 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, - 0x93, 0x01, 0x0a, 0x14, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x12, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, - 0x65, 0x64, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, 0x88, - 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x65, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x52, - 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, - 0x42, 0xa0, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x42, 0x13, 0x52, 0x65, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x64, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, - 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescData = file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_buf_alpha_registry_v1alpha1_recommendation_proto_goTypes = []interface{}{ - (*RecommendedRepository)(nil), // 0: buf.alpha.registry.v1alpha1.RecommendedRepository - (*RecommendedTemplate)(nil), // 1: buf.alpha.registry.v1alpha1.RecommendedTemplate - (*SetRecommendedResource)(nil), // 2: buf.alpha.registry.v1alpha1.SetRecommendedResource - (*RecommendedRepositoriesRequest)(nil), // 3: buf.alpha.registry.v1alpha1.RecommendedRepositoriesRequest - (*RecommendedRepositoriesResponse)(nil), // 4: buf.alpha.registry.v1alpha1.RecommendedRepositoriesResponse - (*RecommendedTemplatesRequest)(nil), // 5: buf.alpha.registry.v1alpha1.RecommendedTemplatesRequest - (*RecommendedTemplatesResponse)(nil), // 6: buf.alpha.registry.v1alpha1.RecommendedTemplatesResponse - (*ListRecommendedResourcesRequest)(nil), // 7: buf.alpha.registry.v1alpha1.ListRecommendedResourcesRequest - (*ListRecommendedResourcesResponse)(nil), // 8: buf.alpha.registry.v1alpha1.ListRecommendedResourcesResponse - (*SetRecommendedResourcesRequest)(nil), // 9: buf.alpha.registry.v1alpha1.SetRecommendedResourcesRequest - (*SetRecommendedResourcesResponse)(nil), // 10: buf.alpha.registry.v1alpha1.SetRecommendedResourcesResponse - (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp - (*Resource)(nil), // 12: buf.alpha.registry.v1alpha1.Resource -} -var file_buf_alpha_registry_v1alpha1_recommendation_proto_depIdxs = []int32{ - 11, // 0: buf.alpha.registry.v1alpha1.RecommendedRepository.create_time:type_name -> google.protobuf.Timestamp - 0, // 1: buf.alpha.registry.v1alpha1.RecommendedRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.RecommendedRepository - 1, // 2: buf.alpha.registry.v1alpha1.RecommendedTemplatesResponse.templates:type_name -> buf.alpha.registry.v1alpha1.RecommendedTemplate - 12, // 3: buf.alpha.registry.v1alpha1.ListRecommendedResourcesResponse.resources:type_name -> buf.alpha.registry.v1alpha1.Resource - 2, // 4: buf.alpha.registry.v1alpha1.SetRecommendedResourcesRequest.resources:type_name -> buf.alpha.registry.v1alpha1.SetRecommendedResource - 3, // 5: buf.alpha.registry.v1alpha1.RecommendationService.RecommendedRepositories:input_type -> buf.alpha.registry.v1alpha1.RecommendedRepositoriesRequest - 5, // 6: buf.alpha.registry.v1alpha1.RecommendationService.RecommendedTemplates:input_type -> buf.alpha.registry.v1alpha1.RecommendedTemplatesRequest - 7, // 7: buf.alpha.registry.v1alpha1.RecommendationService.ListRecommendedResources:input_type -> buf.alpha.registry.v1alpha1.ListRecommendedResourcesRequest - 9, // 8: buf.alpha.registry.v1alpha1.RecommendationService.SetRecommendedResources:input_type -> buf.alpha.registry.v1alpha1.SetRecommendedResourcesRequest - 4, // 9: buf.alpha.registry.v1alpha1.RecommendationService.RecommendedRepositories:output_type -> buf.alpha.registry.v1alpha1.RecommendedRepositoriesResponse - 6, // 10: buf.alpha.registry.v1alpha1.RecommendationService.RecommendedTemplates:output_type -> buf.alpha.registry.v1alpha1.RecommendedTemplatesResponse - 8, // 11: buf.alpha.registry.v1alpha1.RecommendationService.ListRecommendedResources:output_type -> buf.alpha.registry.v1alpha1.ListRecommendedResourcesResponse - 10, // 12: buf.alpha.registry.v1alpha1.RecommendationService.SetRecommendedResources:output_type -> buf.alpha.registry.v1alpha1.SetRecommendedResourcesResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_recommendation_proto_init() } -func file_buf_alpha_registry_v1alpha1_recommendation_proto_init() { - if File_buf_alpha_registry_v1alpha1_recommendation_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_resource_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedRepository); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedTemplate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetRecommendedResource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedRepositoriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedRepositoriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedTemplatesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecommendedTemplatesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRecommendedResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRecommendedResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetRecommendedResourcesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetRecommendedResourcesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_recommendation_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_recommendation_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_recommendation_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_recommendation_proto = out.File - file_buf_alpha_registry_v1alpha1_recommendation_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_recommendation_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_recommendation_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/reference.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/reference.pb.go deleted file mode 100644 index 101168ea8c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/reference.pb.go +++ /dev/null @@ -1,1044 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/reference.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Reference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Reference: - // - // *Reference_Tag - // *Reference_Commit - // *Reference_Main - // *Reference_Draft - Reference isReference_Reference `protobuf_oneof:"reference"` -} - -func (x *Reference) Reset() { - *x = Reference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Reference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reference) ProtoMessage() {} - -func (x *Reference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Reference.ProtoReflect.Descriptor instead. -func (*Reference) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{0} -} - -func (m *Reference) GetReference() isReference_Reference { - if m != nil { - return m.Reference - } - return nil -} - -func (x *Reference) GetTag() *RepositoryTag { - if x, ok := x.GetReference().(*Reference_Tag); ok { - return x.Tag - } - return nil -} - -func (x *Reference) GetCommit() *RepositoryCommit { - if x, ok := x.GetReference().(*Reference_Commit); ok { - return x.Commit - } - return nil -} - -func (x *Reference) GetMain() *RepositoryMainReference { - if x, ok := x.GetReference().(*Reference_Main); ok { - return x.Main - } - return nil -} - -func (x *Reference) GetDraft() *RepositoryDraft { - if x, ok := x.GetReference().(*Reference_Draft); ok { - return x.Draft - } - return nil -} - -type isReference_Reference interface { - isReference_Reference() -} - -type Reference_Tag struct { - // The requested reference is a tag. - Tag *RepositoryTag `protobuf:"bytes,2,opt,name=tag,proto3,oneof"` -} - -type Reference_Commit struct { - // The requested reference is a commit. - Commit *RepositoryCommit `protobuf:"bytes,3,opt,name=commit,proto3,oneof"` -} - -type Reference_Main struct { - // The requested reference is the default reference. - Main *RepositoryMainReference `protobuf:"bytes,5,opt,name=main,proto3,oneof"` -} - -type Reference_Draft struct { - // The requested reference is a draft commit. - Draft *RepositoryDraft `protobuf:"bytes,6,opt,name=draft,proto3,oneof"` -} - -func (*Reference_Tag) isReference_Reference() {} - -func (*Reference_Commit) isReference_Reference() {} - -func (*Reference_Main) isReference_Reference() {} - -func (*Reference_Draft) isReference_Reference() {} - -type RepositoryMainReference struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name is always 'main'. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The latest commit in this repository. If the repository has no commits, - // this will be empty. - Commit *RepositoryCommit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (x *RepositoryMainReference) Reset() { - *x = RepositoryMainReference{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryMainReference) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryMainReference) ProtoMessage() {} - -func (x *RepositoryMainReference) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryMainReference.ProtoReflect.Descriptor instead. -func (*RepositoryMainReference) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{1} -} - -func (x *RepositoryMainReference) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositoryMainReference) GetCommit() *RepositoryCommit { - if x != nil { - return x.Commit - } - return nil -} - -type RepositoryDraft struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The name of the draft - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The commit this draft points to. - Commit *RepositoryCommit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (x *RepositoryDraft) Reset() { - *x = RepositoryDraft{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryDraft) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryDraft) ProtoMessage() {} - -func (x *RepositoryDraft) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryDraft.ProtoReflect.Descriptor instead. -func (*RepositoryDraft) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{2} -} - -func (x *RepositoryDraft) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositoryDraft) GetCommit() *RepositoryCommit { - if x != nil { - return x.Commit - } - return nil -} - -type GetReferenceByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the requested reference. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Owner of the repository the reference belongs to. - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // Name of the repository the reference belongs to. - RepositoryName string `protobuf:"bytes,3,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` -} - -func (x *GetReferenceByNameRequest) Reset() { - *x = GetReferenceByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetReferenceByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReferenceByNameRequest) ProtoMessage() {} - -func (x *GetReferenceByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetReferenceByNameRequest.ProtoReflect.Descriptor instead. -func (*GetReferenceByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{3} -} - -func (x *GetReferenceByNameRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetReferenceByNameRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetReferenceByNameRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -type GetReferenceByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Reference *Reference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *GetReferenceByNameResponse) Reset() { - *x = GetReferenceByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetReferenceByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetReferenceByNameResponse) ProtoMessage() {} - -func (x *GetReferenceByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetReferenceByNameResponse.ProtoReflect.Descriptor instead. -func (*GetReferenceByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{4} -} - -func (x *GetReferenceByNameResponse) GetReference() *Reference { - if x != nil { - return x.Reference - } - return nil -} - -type ListGitCommitMetadataForReferenceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String that represents the name of the reference. - Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` - // Owner of the repository the reference belongs to. - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // Name of the repository the reference belongs to. - RepositoryName string `protobuf:"bytes,3,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` -} - -func (x *ListGitCommitMetadataForReferenceRequest) Reset() { - *x = ListGitCommitMetadataForReferenceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGitCommitMetadataForReferenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGitCommitMetadataForReferenceRequest) ProtoMessage() {} - -func (x *ListGitCommitMetadataForReferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListGitCommitMetadataForReferenceRequest.ProtoReflect.Descriptor instead. -func (*ListGitCommitMetadataForReferenceRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{5} -} - -func (x *ListGitCommitMetadataForReferenceRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *ListGitCommitMetadataForReferenceRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ListGitCommitMetadataForReferenceRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListGitCommitMetadataForReferenceRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListGitCommitMetadataForReferenceRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -type ListGitCommitMetadataForReferenceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the BSR commit the reference resolved to. - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - // List of git commits and metadata associated with the resolved reference. - GitCommitMetadatas []*GitCommitMetadata `protobuf:"bytes,2,rep,name=git_commit_metadatas,json=gitCommitMetadatas,proto3" json:"git_commit_metadatas,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListGitCommitMetadataForReferenceResponse) Reset() { - *x = ListGitCommitMetadataForReferenceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGitCommitMetadataForReferenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGitCommitMetadataForReferenceResponse) ProtoMessage() {} - -func (x *ListGitCommitMetadataForReferenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListGitCommitMetadataForReferenceResponse.ProtoReflect.Descriptor instead. -func (*ListGitCommitMetadataForReferenceResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{6} -} - -func (x *ListGitCommitMetadataForReferenceResponse) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *ListGitCommitMetadataForReferenceResponse) GetGitCommitMetadatas() []*GitCommitMetadata { - if x != nil { - return x.GitCommitMetadatas - } - return nil -} - -func (x *ListGitCommitMetadataForReferenceResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListGitCommitsNoMetadataForReferenceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // String that represents the name of the reference. - Reference string `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` - // Owner of the repository the reference belongs to. - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - // Name of the repository the reference belongs to. - RepositoryName string `protobuf:"bytes,3,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) Reset() { - *x = ListGitCommitsNoMetadataForReferenceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGitCommitsNoMetadataForReferenceRequest) ProtoMessage() {} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListGitCommitsNoMetadataForReferenceRequest.ProtoReflect.Descriptor instead. -func (*ListGitCommitsNoMetadataForReferenceRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{7} -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListGitCommitsNoMetadataForReferenceRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -type ListGitCommitsNoMetadataForReferenceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the BSR commit the reference resolved to. - CommitId string `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"` - // List of git commits labels without metadata associated with the resolved reference. - GitCommitLabels []*Label `protobuf:"bytes,2,rep,name=git_commit_labels,json=gitCommitLabels,proto3" json:"git_commit_labels,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) Reset() { - *x = ListGitCommitsNoMetadataForReferenceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListGitCommitsNoMetadataForReferenceResponse) ProtoMessage() {} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListGitCommitsNoMetadataForReferenceResponse.ProtoReflect.Descriptor instead. -func (*ListGitCommitsNoMetadataForReferenceResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP(), []int{8} -} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) GetCommitId() string { - if x != nil { - return x.CommitId - } - return "" -} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) GetGitCommitLabels() []*Label { - if x != nil { - return x.GitCommitLabels - } - return nil -} - -func (x *ListGitCommitsNoMetadataForReferenceResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_reference_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc = []byte{ - 0x0a, 0x2b, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x2e, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x69, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x28, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x33, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x5f, 0x74, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x02, 0x0a, 0x09, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x03, 0x74, 0x61, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, - 0x61, 0x67, 0x48, 0x00, 0x52, 0x03, 0x74, 0x61, 0x67, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x12, 0x4a, 0x0a, 0x04, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x44, - 0x0a, 0x05, 0x64, 0x72, 0x61, 0x66, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, 0x74, 0x48, 0x00, 0x52, 0x05, 0x64, - 0x72, 0x61, 0x66, 0x74, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x52, 0x06, 0x62, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x05, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x22, 0x74, 0x0a, 0x17, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x61, 0x69, 0x6e, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x22, 0x6c, 0x0a, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x44, 0x72, 0x61, 0x66, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x22, 0x6e, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x22, 0x62, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, - 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x22, 0xc3, 0x01, 0x0a, 0x28, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, - 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd2, 0x01, 0x0a, 0x29, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x60, 0x0a, 0x14, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x52, 0x12, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0xc6, 0x01, 0x0a, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x73, 0x4e, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xc3, 0x01, 0x0a, 0x2c, 0x4c, 0x69, 0x73, - 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x4e, 0x6f, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x4e, 0x0a, 0x11, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x52, 0x0f, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0x9c, - 0x04, 0x0a, 0x10, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0xb7, 0x01, 0x0a, 0x21, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x45, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x46, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xc0, 0x01, 0x0a, 0x24, 0x4c, - 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x4e, 0x6f, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x48, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x4e, 0x6f, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x49, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x4e, 0x6f, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x9b, 0x02, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x0e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, - 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_reference_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_reference_proto_rawDescData = file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_reference_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_reference_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_reference_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_reference_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_reference_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_buf_alpha_registry_v1alpha1_reference_proto_goTypes = []interface{}{ - (*Reference)(nil), // 0: buf.alpha.registry.v1alpha1.Reference - (*RepositoryMainReference)(nil), // 1: buf.alpha.registry.v1alpha1.RepositoryMainReference - (*RepositoryDraft)(nil), // 2: buf.alpha.registry.v1alpha1.RepositoryDraft - (*GetReferenceByNameRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GetReferenceByNameRequest - (*GetReferenceByNameResponse)(nil), // 4: buf.alpha.registry.v1alpha1.GetReferenceByNameResponse - (*ListGitCommitMetadataForReferenceRequest)(nil), // 5: buf.alpha.registry.v1alpha1.ListGitCommitMetadataForReferenceRequest - (*ListGitCommitMetadataForReferenceResponse)(nil), // 6: buf.alpha.registry.v1alpha1.ListGitCommitMetadataForReferenceResponse - (*ListGitCommitsNoMetadataForReferenceRequest)(nil), // 7: buf.alpha.registry.v1alpha1.ListGitCommitsNoMetadataForReferenceRequest - (*ListGitCommitsNoMetadataForReferenceResponse)(nil), // 8: buf.alpha.registry.v1alpha1.ListGitCommitsNoMetadataForReferenceResponse - (*RepositoryTag)(nil), // 9: buf.alpha.registry.v1alpha1.RepositoryTag - (*RepositoryCommit)(nil), // 10: buf.alpha.registry.v1alpha1.RepositoryCommit - (*GitCommitMetadata)(nil), // 11: buf.alpha.registry.v1alpha1.GitCommitMetadata - (*Label)(nil), // 12: buf.alpha.registry.v1alpha1.Label -} -var file_buf_alpha_registry_v1alpha1_reference_proto_depIdxs = []int32{ - 9, // 0: buf.alpha.registry.v1alpha1.Reference.tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 10, // 1: buf.alpha.registry.v1alpha1.Reference.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 1, // 2: buf.alpha.registry.v1alpha1.Reference.main:type_name -> buf.alpha.registry.v1alpha1.RepositoryMainReference - 2, // 3: buf.alpha.registry.v1alpha1.Reference.draft:type_name -> buf.alpha.registry.v1alpha1.RepositoryDraft - 10, // 4: buf.alpha.registry.v1alpha1.RepositoryMainReference.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 10, // 5: buf.alpha.registry.v1alpha1.RepositoryDraft.commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 0, // 6: buf.alpha.registry.v1alpha1.GetReferenceByNameResponse.reference:type_name -> buf.alpha.registry.v1alpha1.Reference - 11, // 7: buf.alpha.registry.v1alpha1.ListGitCommitMetadataForReferenceResponse.git_commit_metadatas:type_name -> buf.alpha.registry.v1alpha1.GitCommitMetadata - 12, // 8: buf.alpha.registry.v1alpha1.ListGitCommitsNoMetadataForReferenceResponse.git_commit_labels:type_name -> buf.alpha.registry.v1alpha1.Label - 3, // 9: buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName:input_type -> buf.alpha.registry.v1alpha1.GetReferenceByNameRequest - 5, // 10: buf.alpha.registry.v1alpha1.ReferenceService.ListGitCommitMetadataForReference:input_type -> buf.alpha.registry.v1alpha1.ListGitCommitMetadataForReferenceRequest - 7, // 11: buf.alpha.registry.v1alpha1.ReferenceService.ListGitCommitsNoMetadataForReference:input_type -> buf.alpha.registry.v1alpha1.ListGitCommitsNoMetadataForReferenceRequest - 4, // 12: buf.alpha.registry.v1alpha1.ReferenceService.GetReferenceByName:output_type -> buf.alpha.registry.v1alpha1.GetReferenceByNameResponse - 6, // 13: buf.alpha.registry.v1alpha1.ReferenceService.ListGitCommitMetadataForReference:output_type -> buf.alpha.registry.v1alpha1.ListGitCommitMetadataForReferenceResponse - 8, // 14: buf.alpha.registry.v1alpha1.ReferenceService.ListGitCommitsNoMetadataForReference:output_type -> buf.alpha.registry.v1alpha1.ListGitCommitsNoMetadataForReferenceResponse - 12, // [12:15] is the sub-list for method output_type - 9, // [9:12] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_reference_proto_init() } -func file_buf_alpha_registry_v1alpha1_reference_proto_init() { - if File_buf_alpha_registry_v1alpha1_reference_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() - file_buf_alpha_registry_v1alpha1_labels_proto_init() - file_buf_alpha_registry_v1alpha1_repository_commit_proto_init() - file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryMainReference); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryDraft); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReferenceByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReferenceByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListGitCommitMetadataForReferenceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListGitCommitMetadataForReferenceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListGitCommitsNoMetadataForReferenceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListGitCommitsNoMetadataForReferenceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Reference_Tag)(nil), - (*Reference_Commit)(nil), - (*Reference_Main)(nil), - (*Reference_Draft)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_reference_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_reference_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_reference_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_reference_proto = out.File - file_buf_alpha_registry_v1alpha1_reference_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_reference_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_reference_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository.pb.go deleted file mode 100644 index 344b0c8daa..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository.pb.go +++ /dev/null @@ -1,3616 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/repository.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Visibility int32 - -const ( - Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 - Visibility_VISIBILITY_PUBLIC Visibility = 1 - Visibility_VISIBILITY_PRIVATE Visibility = 2 -) - -// Enum value maps for Visibility. -var ( - Visibility_name = map[int32]string{ - 0: "VISIBILITY_UNSPECIFIED", - 1: "VISIBILITY_PUBLIC", - 2: "VISIBILITY_PRIVATE", - } - Visibility_value = map[string]int32{ - "VISIBILITY_UNSPECIFIED": 0, - "VISIBILITY_PUBLIC": 1, - "VISIBILITY_PRIVATE": 2, - } -) - -func (x Visibility) Enum() *Visibility { - p := new(Visibility) - *p = x - return p -} - -func (x Visibility) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes[0].Descriptor() -} - -func (Visibility) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes[0] -} - -func (x Visibility) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Visibility.Descriptor instead. -func (Visibility) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{0} -} - -type Repository struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique, immutable - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // immutable - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // mutable - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // unique, mutable - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // Types that are assignable to Owner: - // - // *Repository_UserId - // *Repository_OrganizationId - Owner isRepository_Owner `protobuf_oneof:"owner"` - Visibility Visibility `protobuf:"varint,7,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility" json:"visibility,omitempty"` - // deprecated means this repository is deprecated. - Deprecated bool `protobuf:"varint,8,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // deprecation_message is the message shown if the repository is deprecated. - DeprecationMessage string `protobuf:"bytes,9,opt,name=deprecation_message,json=deprecationMessage,proto3" json:"deprecation_message,omitempty"` - // owner_name is the name of the owner of the repository, - // either a username or organization name. - OwnerName string `protobuf:"bytes,10,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // description is the user configurable description of the repository. - Description string `protobuf:"bytes,11,opt,name=description,proto3" json:"description,omitempty"` - // url is the user configurable URL in the description of the repository, - // always included the scheme and will not have a #fragment suffix. - Url string `protobuf:"bytes,12,opt,name=url,proto3" json:"url,omitempty"` -} - -func (x *Repository) Reset() { - *x = Repository{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Repository) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Repository) ProtoMessage() {} - -func (x *Repository) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Repository.ProtoReflect.Descriptor instead. -func (*Repository) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{0} -} - -func (x *Repository) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Repository) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Repository) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *Repository) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (m *Repository) GetOwner() isRepository_Owner { - if m != nil { - return m.Owner - } - return nil -} - -func (x *Repository) GetUserId() string { - if x, ok := x.GetOwner().(*Repository_UserId); ok { - return x.UserId - } - return "" -} - -func (x *Repository) GetOrganizationId() string { - if x, ok := x.GetOwner().(*Repository_OrganizationId); ok { - return x.OrganizationId - } - return "" -} - -func (x *Repository) GetVisibility() Visibility { - if x != nil { - return x.Visibility - } - return Visibility_VISIBILITY_UNSPECIFIED -} - -func (x *Repository) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -func (x *Repository) GetDeprecationMessage() string { - if x != nil { - return x.DeprecationMessage - } - return "" -} - -func (x *Repository) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *Repository) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Repository) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -type isRepository_Owner interface { - isRepository_Owner() -} - -type Repository_UserId struct { - // foreign key, mutable - UserId string `protobuf:"bytes,5,opt,name=user_id,json=userId,proto3,oneof"` -} - -type Repository_OrganizationId struct { - // foreign key, mutable - OrganizationId string `protobuf:"bytes,6,opt,name=organization_id,json=organizationId,proto3,oneof"` -} - -func (*Repository_UserId) isRepository_Owner() {} - -func (*Repository_OrganizationId) isRepository_Owner() {} - -type RepositoryCounts struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TagsCount uint32 `protobuf:"varint,1,opt,name=tags_count,json=tagsCount,proto3" json:"tags_count,omitempty"` - DraftsCount uint32 `protobuf:"varint,3,opt,name=drafts_count,json=draftsCount,proto3" json:"drafts_count,omitempty"` -} - -func (x *RepositoryCounts) Reset() { - *x = RepositoryCounts{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryCounts) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryCounts) ProtoMessage() {} - -func (x *RepositoryCounts) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryCounts.ProtoReflect.Descriptor instead. -func (*RepositoryCounts) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{1} -} - -func (x *RepositoryCounts) GetTagsCount() uint32 { - if x != nil { - return x.TagsCount - } - return 0 -} - -func (x *RepositoryCounts) GetDraftsCount() uint32 { - if x != nil { - return x.DraftsCount - } - return 0 -} - -type RepositoryContributor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // The ID of the for which the role belongs to. - RepositoryId string `protobuf:"bytes,2,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The role that the user has been explicitly assigned against the repository. - ExplicitRole RepositoryRole `protobuf:"varint,3,opt,name=explicit_role,json=explicitRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"explicit_role,omitempty"` - // Optionally defines the role that the user has implicitly against the repository through the owning organization. - // If the repository does not belong to an organization or the user is not part of the owning organization, this is unset. - ImplicitRole RepositoryRole `protobuf:"varint,4,opt,name=implicit_role,json=implicitRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"implicit_role,omitempty"` -} - -func (x *RepositoryContributor) Reset() { - *x = RepositoryContributor{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryContributor) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryContributor) ProtoMessage() {} - -func (x *RepositoryContributor) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryContributor.ProtoReflect.Descriptor instead. -func (*RepositoryContributor) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{2} -} - -func (x *RepositoryContributor) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -func (x *RepositoryContributor) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *RepositoryContributor) GetExplicitRole() RepositoryRole { - if x != nil { - return x.ExplicitRole - } - return RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED -} - -func (x *RepositoryContributor) GetImplicitRole() RepositoryRole { - if x != nil { - return x.ImplicitRole - } - return RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED -} - -type RepositoryMetadata struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the repository. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The owner name of the repository. - OwnerName string `protobuf:"bytes,3,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // The verification status of the owner of the repository. - OwnerVerificationStatus VerificationStatus `protobuf:"varint,4,opt,name=owner_verification_status,json=ownerVerificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus" json:"owner_verification_status,omitempty"` - // The commit time of the latest main commit in the repository. - LatestCommitTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=latest_commit_time,json=latestCommitTime,proto3" json:"latest_commit_time,omitempty"` - // The SPDX license ID of the latest main commit in the repository. - LatestSpdxLicenseId string `protobuf:"bytes,6,opt,name=latest_spdx_license_id,json=latestSpdxLicenseId,proto3" json:"latest_spdx_license_id,omitempty"` -} - -func (x *RepositoryMetadata) Reset() { - *x = RepositoryMetadata{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryMetadata) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryMetadata) ProtoMessage() {} - -func (x *RepositoryMetadata) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryMetadata.ProtoReflect.Descriptor instead. -func (*RepositoryMetadata) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{3} -} - -func (x *RepositoryMetadata) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepositoryMetadata) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositoryMetadata) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *RepositoryMetadata) GetOwnerVerificationStatus() VerificationStatus { - if x != nil { - return x.OwnerVerificationStatus - } - return VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED -} - -func (x *RepositoryMetadata) GetLatestCommitTime() *timestamppb.Timestamp { - if x != nil { - return x.LatestCommitTime - } - return nil -} - -func (x *RepositoryMetadata) GetLatestSpdxLicenseId() string { - if x != nil { - return x.LatestSpdxLicenseId - } - return "" -} - -type GetRepositoriesByFullNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // minimum length is 1 - // maximum length is 250 - FullNames []string `protobuf:"bytes,1,rep,name=full_names,json=fullNames,proto3" json:"full_names,omitempty"` -} - -func (x *GetRepositoriesByFullNameRequest) Reset() { - *x = GetRepositoriesByFullNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoriesByFullNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoriesByFullNameRequest) ProtoMessage() {} - -func (x *GetRepositoriesByFullNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoriesByFullNameRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoriesByFullNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{4} -} - -func (x *GetRepositoriesByFullNameRequest) GetFullNames() []string { - if x != nil { - return x.FullNames - } - return nil -} - -type GetRepositoriesByFullNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` -} - -func (x *GetRepositoriesByFullNameResponse) Reset() { - *x = GetRepositoriesByFullNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoriesByFullNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoriesByFullNameResponse) ProtoMessage() {} - -func (x *GetRepositoriesByFullNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoriesByFullNameResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoriesByFullNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{5} -} - -func (x *GetRepositoriesByFullNameResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -type GetRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetRepositoryRequest) Reset() { - *x = GetRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryRequest) ProtoMessage() {} - -func (x *GetRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoryRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{6} -} - -func (x *GetRepositoryRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Counts *RepositoryCounts `protobuf:"bytes,2,opt,name=counts,proto3" json:"counts,omitempty"` -} - -func (x *GetRepositoryResponse) Reset() { - *x = GetRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryResponse) ProtoMessage() {} - -func (x *GetRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoryResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{7} -} - -func (x *GetRepositoryResponse) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *GetRepositoryResponse) GetCounts() *RepositoryCounts { - if x != nil { - return x.Counts - } - return nil -} - -type GetRepositoryByFullNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FullName string `protobuf:"bytes,1,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` -} - -func (x *GetRepositoryByFullNameRequest) Reset() { - *x = GetRepositoryByFullNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryByFullNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryByFullNameRequest) ProtoMessage() {} - -func (x *GetRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryByFullNameRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoryByFullNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{8} -} - -func (x *GetRepositoryByFullNameRequest) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -type GetRepositoryByFullNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` - Counts *RepositoryCounts `protobuf:"bytes,2,opt,name=counts,proto3" json:"counts,omitempty"` -} - -func (x *GetRepositoryByFullNameResponse) Reset() { - *x = GetRepositoryByFullNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryByFullNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryByFullNameResponse) ProtoMessage() {} - -func (x *GetRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryByFullNameResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoryByFullNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{9} -} - -func (x *GetRepositoryByFullNameResponse) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -func (x *GetRepositoryByFullNameResponse) GetCounts() *RepositoryCounts { - if x != nil { - return x.Counts - } - return nil -} - -type ListRepositoriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoriesRequest) Reset() { - *x = ListRepositoriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoriesRequest) ProtoMessage() {} - -func (x *ListRepositoriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoriesRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoriesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{10} -} - -func (x *ListRepositoriesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoriesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoriesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoriesResponse) Reset() { - *x = ListRepositoriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoriesResponse) ProtoMessage() {} - -func (x *ListRepositoriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoriesResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoriesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{11} -} - -func (x *ListRepositoriesResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -func (x *ListRepositoriesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListUserRepositoriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the user whose repositories should be listed. - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListUserRepositoriesRequest) Reset() { - *x = ListUserRepositoriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserRepositoriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserRepositoriesRequest) ProtoMessage() {} - -func (x *ListUserRepositoriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserRepositoriesRequest.ProtoReflect.Descriptor instead. -func (*ListUserRepositoriesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{12} -} - -func (x *ListUserRepositoriesRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *ListUserRepositoriesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListUserRepositoriesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListUserRepositoriesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListUserRepositoriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListUserRepositoriesResponse) Reset() { - *x = ListUserRepositoriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUserRepositoriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUserRepositoriesResponse) ProtoMessage() {} - -func (x *ListUserRepositoriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUserRepositoriesResponse.ProtoReflect.Descriptor instead. -func (*ListUserRepositoriesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{13} -} - -func (x *ListUserRepositoriesResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -func (x *ListUserRepositoriesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListRepositoriesUserCanAccessRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoriesUserCanAccessRequest) Reset() { - *x = ListRepositoriesUserCanAccessRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoriesUserCanAccessRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoriesUserCanAccessRequest) ProtoMessage() {} - -func (x *ListRepositoriesUserCanAccessRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoriesUserCanAccessRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoriesUserCanAccessRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{14} -} - -func (x *ListRepositoriesUserCanAccessRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoriesUserCanAccessRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoriesUserCanAccessRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoriesUserCanAccessResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoriesUserCanAccessResponse) Reset() { - *x = ListRepositoriesUserCanAccessResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoriesUserCanAccessResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoriesUserCanAccessResponse) ProtoMessage() {} - -func (x *ListRepositoriesUserCanAccessResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoriesUserCanAccessResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoriesUserCanAccessResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{15} -} - -func (x *ListRepositoriesUserCanAccessResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -func (x *ListRepositoriesUserCanAccessResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListOrganizationRepositoriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the organization whose repositories should be listed. - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListOrganizationRepositoriesRequest) Reset() { - *x = ListOrganizationRepositoriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationRepositoriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationRepositoriesRequest) ProtoMessage() {} - -func (x *ListOrganizationRepositoriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationRepositoriesRequest.ProtoReflect.Descriptor instead. -func (*ListOrganizationRepositoriesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{16} -} - -func (x *ListOrganizationRepositoriesRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *ListOrganizationRepositoriesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListOrganizationRepositoriesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListOrganizationRepositoriesRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListOrganizationRepositoriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repositories []*Repository `protobuf:"bytes,1,rep,name=repositories,proto3" json:"repositories,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOrganizationRepositoriesResponse) Reset() { - *x = ListOrganizationRepositoriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationRepositoriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationRepositoriesResponse) ProtoMessage() {} - -func (x *ListOrganizationRepositoriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationRepositoriesResponse.ProtoReflect.Descriptor instead. -func (*ListOrganizationRepositoriesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{17} -} - -func (x *ListOrganizationRepositoriesResponse) GetRepositories() []*Repository { - if x != nil { - return x.Repositories - } - return nil -} - -func (x *ListOrganizationRepositoriesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type CreateRepositoryByFullNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Must be unique across repositories. - FullName string `protobuf:"bytes,1,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` - Visibility Visibility `protobuf:"varint,2,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility" json:"visibility,omitempty"` -} - -func (x *CreateRepositoryByFullNameRequest) Reset() { - *x = CreateRepositoryByFullNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRepositoryByFullNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRepositoryByFullNameRequest) ProtoMessage() {} - -func (x *CreateRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRepositoryByFullNameRequest.ProtoReflect.Descriptor instead. -func (*CreateRepositoryByFullNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{18} -} - -func (x *CreateRepositoryByFullNameRequest) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -func (x *CreateRepositoryByFullNameRequest) GetVisibility() Visibility { - if x != nil { - return x.Visibility - } - return Visibility_VISIBILITY_UNSPECIFIED -} - -type CreateRepositoryByFullNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` -} - -func (x *CreateRepositoryByFullNameResponse) Reset() { - *x = CreateRepositoryByFullNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRepositoryByFullNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRepositoryByFullNameResponse) ProtoMessage() {} - -func (x *CreateRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRepositoryByFullNameResponse.ProtoReflect.Descriptor instead. -func (*CreateRepositoryByFullNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{19} -} - -func (x *CreateRepositoryByFullNameResponse) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -type DeleteRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteRepositoryRequest) Reset() { - *x = DeleteRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryRequest) ProtoMessage() {} - -func (x *DeleteRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryRequest.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{20} -} - -func (x *DeleteRepositoryRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type DeleteRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteRepositoryResponse) Reset() { - *x = DeleteRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryResponse) ProtoMessage() {} - -func (x *DeleteRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryResponse.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{21} -} - -type DeleteRepositoryByFullNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - FullName string `protobuf:"bytes,1,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` -} - -func (x *DeleteRepositoryByFullNameRequest) Reset() { - *x = DeleteRepositoryByFullNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryByFullNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryByFullNameRequest) ProtoMessage() {} - -func (x *DeleteRepositoryByFullNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryByFullNameRequest.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryByFullNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{22} -} - -func (x *DeleteRepositoryByFullNameRequest) GetFullName() string { - if x != nil { - return x.FullName - } - return "" -} - -type DeleteRepositoryByFullNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteRepositoryByFullNameResponse) Reset() { - *x = DeleteRepositoryByFullNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryByFullNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryByFullNameResponse) ProtoMessage() {} - -func (x *DeleteRepositoryByFullNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryByFullNameResponse.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryByFullNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{23} -} - -type DeprecateRepositoryByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OwnerName string `protobuf:"bytes,1,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // A message shown along with the deprecation warning for this repository. - // It must be a utf8 encoded string containing 256 or fewer characters. - DeprecationMessage string `protobuf:"bytes,3,opt,name=deprecation_message,json=deprecationMessage,proto3" json:"deprecation_message,omitempty"` -} - -func (x *DeprecateRepositoryByNameRequest) Reset() { - *x = DeprecateRepositoryByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeprecateRepositoryByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeprecateRepositoryByNameRequest) ProtoMessage() {} - -func (x *DeprecateRepositoryByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeprecateRepositoryByNameRequest.ProtoReflect.Descriptor instead. -func (*DeprecateRepositoryByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{24} -} - -func (x *DeprecateRepositoryByNameRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *DeprecateRepositoryByNameRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *DeprecateRepositoryByNameRequest) GetDeprecationMessage() string { - if x != nil { - return x.DeprecationMessage - } - return "" -} - -type DeprecateRepositoryByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` -} - -func (x *DeprecateRepositoryByNameResponse) Reset() { - *x = DeprecateRepositoryByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeprecateRepositoryByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeprecateRepositoryByNameResponse) ProtoMessage() {} - -func (x *DeprecateRepositoryByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeprecateRepositoryByNameResponse.ProtoReflect.Descriptor instead. -func (*DeprecateRepositoryByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{25} -} - -func (x *DeprecateRepositoryByNameResponse) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -type UndeprecateRepositoryByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OwnerName string `protobuf:"bytes,1,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` -} - -func (x *UndeprecateRepositoryByNameRequest) Reset() { - *x = UndeprecateRepositoryByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UndeprecateRepositoryByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UndeprecateRepositoryByNameRequest) ProtoMessage() {} - -func (x *UndeprecateRepositoryByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UndeprecateRepositoryByNameRequest.ProtoReflect.Descriptor instead. -func (*UndeprecateRepositoryByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{26} -} - -func (x *UndeprecateRepositoryByNameRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *UndeprecateRepositoryByNameRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -type UndeprecateRepositoryByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"` -} - -func (x *UndeprecateRepositoryByNameResponse) Reset() { - *x = UndeprecateRepositoryByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UndeprecateRepositoryByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UndeprecateRepositoryByNameResponse) ProtoMessage() {} - -func (x *UndeprecateRepositoryByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UndeprecateRepositoryByNameResponse.ProtoReflect.Descriptor instead. -func (*UndeprecateRepositoryByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{27} -} - -func (x *UndeprecateRepositoryByNameResponse) GetRepository() *Repository { - if x != nil { - return x.Repository - } - return nil -} - -type SetRepositoryContributorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which the user's role will be set. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The ID of the user whose role will be set. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The role to assign to the user. - // Setting UNSPECIFIED means removing the user's role. - RepositoryRole RepositoryRole `protobuf:"varint,3,opt,name=repository_role,json=repositoryRole,proto3,enum=buf.alpha.registry.v1alpha1.RepositoryRole" json:"repository_role,omitempty"` -} - -func (x *SetRepositoryContributorRequest) Reset() { - *x = SetRepositoryContributorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetRepositoryContributorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRepositoryContributorRequest) ProtoMessage() {} - -func (x *SetRepositoryContributorRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetRepositoryContributorRequest.ProtoReflect.Descriptor instead. -func (*SetRepositoryContributorRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{28} -} - -func (x *SetRepositoryContributorRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *SetRepositoryContributorRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *SetRepositoryContributorRequest) GetRepositoryRole() RepositoryRole { - if x != nil { - return x.RepositoryRole - } - return RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED -} - -type SetRepositoryContributorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetRepositoryContributorResponse) Reset() { - *x = SetRepositoryContributorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetRepositoryContributorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetRepositoryContributorResponse) ProtoMessage() {} - -func (x *SetRepositoryContributorResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetRepositoryContributorResponse.ProtoReflect.Descriptor instead. -func (*SetRepositoryContributorResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{29} -} - -type ListRepositoryContributorsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryContributorsRequest) Reset() { - *x = ListRepositoryContributorsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[30] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryContributorsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryContributorsRequest) ProtoMessage() {} - -func (x *ListRepositoryContributorsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[30] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryContributorsRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryContributorsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{30} -} - -func (x *ListRepositoryContributorsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *ListRepositoryContributorsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryContributorsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryContributorsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryContributorsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Users []*RepositoryContributor `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryContributorsResponse) Reset() { - *x = ListRepositoryContributorsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[31] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryContributorsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryContributorsResponse) ProtoMessage() {} - -func (x *ListRepositoryContributorsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[31] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryContributorsResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryContributorsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{31} -} - -func (x *ListRepositoryContributorsResponse) GetUsers() []*RepositoryContributor { - if x != nil { - return x.Users - } - return nil -} - -func (x *ListRepositoryContributorsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type GetRepositoryContributorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to get the contributor information. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The ID of the user for which to get the contributor information. - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *GetRepositoryContributorRequest) Reset() { - *x = GetRepositoryContributorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryContributorRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryContributorRequest) ProtoMessage() {} - -func (x *GetRepositoryContributorRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[32] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryContributorRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoryContributorRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{32} -} - -func (x *GetRepositoryContributorRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *GetRepositoryContributorRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type GetRepositoryContributorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The contributor information of the user in the repository. - User *RepositoryContributor `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetRepositoryContributorResponse) Reset() { - *x = GetRepositoryContributorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryContributorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryContributorResponse) ProtoMessage() {} - -func (x *GetRepositoryContributorResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[33] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryContributorResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoryContributorResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{33} -} - -func (x *GetRepositoryContributorResponse) GetUser() *RepositoryContributor { - if x != nil { - return x.User - } - return nil -} - -type GetRepositorySettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository for which to get the settings. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *GetRepositorySettingsRequest) Reset() { - *x = GetRepositorySettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositorySettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositorySettingsRequest) ProtoMessage() {} - -func (x *GetRepositorySettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositorySettingsRequest.ProtoReflect.Descriptor instead. -func (*GetRepositorySettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{34} -} - -func (x *GetRepositorySettingsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type GetRepositorySettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The number of outside contributors in the repository, - // excluding owning-organization's members that have an explicit role. - ContributorsCount uint32 `protobuf:"varint,1,opt,name=contributors_count,json=contributorsCount,proto3" json:"contributors_count,omitempty"` -} - -func (x *GetRepositorySettingsResponse) Reset() { - *x = GetRepositorySettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositorySettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositorySettingsResponse) ProtoMessage() {} - -func (x *GetRepositorySettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[35] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositorySettingsResponse.ProtoReflect.Descriptor instead. -func (*GetRepositorySettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{35} -} - -func (x *GetRepositorySettingsResponse) GetContributorsCount() uint32 { - if x != nil { - return x.ContributorsCount - } - return 0 -} - -type UpdateRepositorySettingsByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OwnerName string `protobuf:"bytes,1,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // optional, update to visibility will only be made if this is specified. - Visibility Visibility `protobuf:"varint,3,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility" json:"visibility,omitempty"` - // optional, update to description will only be made when this is present - Description *string `protobuf:"bytes,4,opt,name=description,proto3,oneof" json:"description,omitempty"` - // optional, update to url will only be made when this is present - Url *string `protobuf:"bytes,5,opt,name=url,proto3,oneof" json:"url,omitempty"` -} - -func (x *UpdateRepositorySettingsByNameRequest) Reset() { - *x = UpdateRepositorySettingsByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRepositorySettingsByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRepositorySettingsByNameRequest) ProtoMessage() {} - -func (x *UpdateRepositorySettingsByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRepositorySettingsByNameRequest.ProtoReflect.Descriptor instead. -func (*UpdateRepositorySettingsByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{36} -} - -func (x *UpdateRepositorySettingsByNameRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *UpdateRepositorySettingsByNameRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *UpdateRepositorySettingsByNameRequest) GetVisibility() Visibility { - if x != nil { - return x.Visibility - } - return Visibility_VISIBILITY_UNSPECIFIED -} - -func (x *UpdateRepositorySettingsByNameRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *UpdateRepositorySettingsByNameRequest) GetUrl() string { - if x != nil && x.Url != nil { - return *x.Url - } - return "" -} - -type UpdateRepositorySettingsByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateRepositorySettingsByNameResponse) Reset() { - *x = UpdateRepositorySettingsByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[37] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRepositorySettingsByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRepositorySettingsByNameResponse) ProtoMessage() {} - -func (x *UpdateRepositorySettingsByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[37] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRepositorySettingsByNameResponse.ProtoReflect.Descriptor instead. -func (*UpdateRepositorySettingsByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{37} -} - -type GetRepositoriesMetadataRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of repository IDs to request the metadata. - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` -} - -func (x *GetRepositoriesMetadataRequest) Reset() { - *x = GetRepositoriesMetadataRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoriesMetadataRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoriesMetadataRequest) ProtoMessage() {} - -func (x *GetRepositoriesMetadataRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[38] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoriesMetadataRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoriesMetadataRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{38} -} - -func (x *GetRepositoriesMetadataRequest) GetIds() []string { - if x != nil { - return x.Ids - } - return nil -} - -type GetRepositoriesMetadataResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Metadata []*RepositoryMetadata `protobuf:"bytes,1,rep,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (x *GetRepositoriesMetadataResponse) Reset() { - *x = GetRepositoriesMetadataResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[39] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoriesMetadataResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoriesMetadataResponse) ProtoMessage() {} - -func (x *GetRepositoriesMetadataResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[39] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoriesMetadataResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoriesMetadataResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP(), []int{39} -} - -func (x *GetRepositoriesMetadataResponse) GetMetadata() []*RepositoryMetadata { - if x != nil { - return x.Metadata - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_repository_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x62, 0x75, 0x66, - 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xe6, 0x03, 0x0a, 0x0a, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x19, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a, 0x0f, 0x6f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x47, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, - 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, - 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x72, 0x6c, 0x42, 0x07, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0x68, 0x0a, 0x10, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x67, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x61, 0x67, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x21, 0x0a, 0x0c, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x64, 0x72, 0x61, 0x66, 0x74, 0x73, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x73, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x97, 0x02, 0x0a, 0x15, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, - 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x0d, - 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, - 0x52, 0x0c, 0x65, 0x78, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x50, - 0x0a, 0x0d, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x6f, - 0x6c, 0x65, 0x52, 0x0c, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x63, 0x69, 0x74, 0x52, 0x6f, 0x6c, 0x65, - 0x22, 0xc3, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x6b, 0x0a, 0x19, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x17, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x12, 0x6c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x10, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x33, 0x0a, 0x16, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x70, 0x64, 0x78, - 0x5f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x13, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x70, 0x64, 0x78, 0x4c, 0x69, 0x63, - 0x65, 0x6e, 0x73, 0x65, 0x49, 0x64, 0x22, 0x41, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x75, - 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, - 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x22, 0x70, 0x0a, 0x21, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x46, 0x75, - 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, - 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x26, 0x0a, 0x14, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x22, 0xa7, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x45, 0x0a, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x22, 0x3d, 0x0a, - 0x1e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, - 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xb1, 0x01, 0x0a, - 0x1f, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, - 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x47, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x45, 0x0a, 0x06, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x52, 0x06, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x22, 0x6f, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, - 0x65, 0x22, 0x8f, 0x01, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, - 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, - 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0x8c, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, - 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0x22, 0x93, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x7c, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, - 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x26, 0x0a, - 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa4, 0x01, 0x0a, 0x23, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x9b, 0x01, 0x0a, - 0x24, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, - 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x89, 0x01, 0x0a, 0x21, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, - 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, - 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x6d, 0x0a, 0x22, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x29, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x1a, 0x0a, 0x18, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x40, 0x0a, 0x21, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x24, - 0x0a, 0x22, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x20, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x6c, 0x0a, 0x21, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x22, 0x6c, 0x0a, 0x22, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x6e, - 0x0a, 0x23, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0xb5, - 0x01, 0x0a, 0x1f, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x54, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x72, - 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x22, 0x0a, 0x20, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, - 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x21, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x96, 0x01, 0x0a, 0x22, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5f, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x6a, 0x0a, 0x20, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x43, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x4e, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, - 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8e, 0x02, 0x0a, 0x25, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x42, - 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x28, 0x0a, 0x26, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x32, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x69, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x6e, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x57, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, - 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x15, 0x0a, 0x11, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x55, - 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, - 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, 0x32, 0x8e, - 0x16, 0x0a, 0x11, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x84, 0x01, - 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, - 0x65, 0x73, 0x12, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0x90, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x38, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xab, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, - 0x43, 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, 0x61, 0x6e, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x55, 0x73, 0x65, 0x72, 0x43, - 0x61, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xa8, 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0xa2, 0x01, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, - 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, - 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x84, 0x01, 0x0a, 0x10, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x34, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0xa2, 0x01, 0x0a, - 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x02, 0x12, 0x9a, 0x01, 0x0a, 0x19, 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xa0, - 0x01, 0x0a, 0x1b, 0x55, 0x6e, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x6e, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x6e, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x3d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x46, - 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x42, 0x79, 0x46, 0x75, - 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x97, 0x01, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, - 0x12, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, - 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0xa2, 0x01, - 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x3e, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x12, 0x9c, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x12, - 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, - 0x75, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x39, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xa9, 0x01, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x42, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, - 0x9c, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x0f, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, - 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_repository_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_repository_proto_rawDescData = file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_repository_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_repository_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_repository_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_repository_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_repository_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes = make([]protoimpl.MessageInfo, 40) -var file_buf_alpha_registry_v1alpha1_repository_proto_goTypes = []interface{}{ - (Visibility)(0), // 0: buf.alpha.registry.v1alpha1.Visibility - (*Repository)(nil), // 1: buf.alpha.registry.v1alpha1.Repository - (*RepositoryCounts)(nil), // 2: buf.alpha.registry.v1alpha1.RepositoryCounts - (*RepositoryContributor)(nil), // 3: buf.alpha.registry.v1alpha1.RepositoryContributor - (*RepositoryMetadata)(nil), // 4: buf.alpha.registry.v1alpha1.RepositoryMetadata - (*GetRepositoriesByFullNameRequest)(nil), // 5: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameRequest - (*GetRepositoriesByFullNameResponse)(nil), // 6: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse - (*GetRepositoryRequest)(nil), // 7: buf.alpha.registry.v1alpha1.GetRepositoryRequest - (*GetRepositoryResponse)(nil), // 8: buf.alpha.registry.v1alpha1.GetRepositoryResponse - (*GetRepositoryByFullNameRequest)(nil), // 9: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameRequest - (*GetRepositoryByFullNameResponse)(nil), // 10: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse - (*ListRepositoriesRequest)(nil), // 11: buf.alpha.registry.v1alpha1.ListRepositoriesRequest - (*ListRepositoriesResponse)(nil), // 12: buf.alpha.registry.v1alpha1.ListRepositoriesResponse - (*ListUserRepositoriesRequest)(nil), // 13: buf.alpha.registry.v1alpha1.ListUserRepositoriesRequest - (*ListUserRepositoriesResponse)(nil), // 14: buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse - (*ListRepositoriesUserCanAccessRequest)(nil), // 15: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessRequest - (*ListRepositoriesUserCanAccessResponse)(nil), // 16: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse - (*ListOrganizationRepositoriesRequest)(nil), // 17: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesRequest - (*ListOrganizationRepositoriesResponse)(nil), // 18: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse - (*CreateRepositoryByFullNameRequest)(nil), // 19: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest - (*CreateRepositoryByFullNameResponse)(nil), // 20: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse - (*DeleteRepositoryRequest)(nil), // 21: buf.alpha.registry.v1alpha1.DeleteRepositoryRequest - (*DeleteRepositoryResponse)(nil), // 22: buf.alpha.registry.v1alpha1.DeleteRepositoryResponse - (*DeleteRepositoryByFullNameRequest)(nil), // 23: buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameRequest - (*DeleteRepositoryByFullNameResponse)(nil), // 24: buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameResponse - (*DeprecateRepositoryByNameRequest)(nil), // 25: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameRequest - (*DeprecateRepositoryByNameResponse)(nil), // 26: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse - (*UndeprecateRepositoryByNameRequest)(nil), // 27: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameRequest - (*UndeprecateRepositoryByNameResponse)(nil), // 28: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse - (*SetRepositoryContributorRequest)(nil), // 29: buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest - (*SetRepositoryContributorResponse)(nil), // 30: buf.alpha.registry.v1alpha1.SetRepositoryContributorResponse - (*ListRepositoryContributorsRequest)(nil), // 31: buf.alpha.registry.v1alpha1.ListRepositoryContributorsRequest - (*ListRepositoryContributorsResponse)(nil), // 32: buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse - (*GetRepositoryContributorRequest)(nil), // 33: buf.alpha.registry.v1alpha1.GetRepositoryContributorRequest - (*GetRepositoryContributorResponse)(nil), // 34: buf.alpha.registry.v1alpha1.GetRepositoryContributorResponse - (*GetRepositorySettingsRequest)(nil), // 35: buf.alpha.registry.v1alpha1.GetRepositorySettingsRequest - (*GetRepositorySettingsResponse)(nil), // 36: buf.alpha.registry.v1alpha1.GetRepositorySettingsResponse - (*UpdateRepositorySettingsByNameRequest)(nil), // 37: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest - (*UpdateRepositorySettingsByNameResponse)(nil), // 38: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameResponse - (*GetRepositoriesMetadataRequest)(nil), // 39: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataRequest - (*GetRepositoriesMetadataResponse)(nil), // 40: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse - (*timestamppb.Timestamp)(nil), // 41: google.protobuf.Timestamp - (*User)(nil), // 42: buf.alpha.registry.v1alpha1.User - (RepositoryRole)(0), // 43: buf.alpha.registry.v1alpha1.RepositoryRole - (VerificationStatus)(0), // 44: buf.alpha.registry.v1alpha1.VerificationStatus -} -var file_buf_alpha_registry_v1alpha1_repository_proto_depIdxs = []int32{ - 41, // 0: buf.alpha.registry.v1alpha1.Repository.create_time:type_name -> google.protobuf.Timestamp - 41, // 1: buf.alpha.registry.v1alpha1.Repository.update_time:type_name -> google.protobuf.Timestamp - 0, // 2: buf.alpha.registry.v1alpha1.Repository.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility - 42, // 3: buf.alpha.registry.v1alpha1.RepositoryContributor.user:type_name -> buf.alpha.registry.v1alpha1.User - 43, // 4: buf.alpha.registry.v1alpha1.RepositoryContributor.explicit_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 43, // 5: buf.alpha.registry.v1alpha1.RepositoryContributor.implicit_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 44, // 6: buf.alpha.registry.v1alpha1.RepositoryMetadata.owner_verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus - 41, // 7: buf.alpha.registry.v1alpha1.RepositoryMetadata.latest_commit_time:type_name -> google.protobuf.Timestamp - 1, // 8: buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 9: buf.alpha.registry.v1alpha1.GetRepositoryResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 2, // 10: buf.alpha.registry.v1alpha1.GetRepositoryResponse.counts:type_name -> buf.alpha.registry.v1alpha1.RepositoryCounts - 1, // 11: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 2, // 12: buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse.counts:type_name -> buf.alpha.registry.v1alpha1.RepositoryCounts - 1, // 13: buf.alpha.registry.v1alpha1.ListRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 14: buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 15: buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 16: buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse.repositories:type_name -> buf.alpha.registry.v1alpha1.Repository - 0, // 17: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility - 1, // 18: buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 19: buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 1, // 20: buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 43, // 21: buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest.repository_role:type_name -> buf.alpha.registry.v1alpha1.RepositoryRole - 3, // 22: buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse.users:type_name -> buf.alpha.registry.v1alpha1.RepositoryContributor - 3, // 23: buf.alpha.registry.v1alpha1.GetRepositoryContributorResponse.user:type_name -> buf.alpha.registry.v1alpha1.RepositoryContributor - 0, // 24: buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility - 4, // 25: buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse.metadata:type_name -> buf.alpha.registry.v1alpha1.RepositoryMetadata - 7, // 26: buf.alpha.registry.v1alpha1.RepositoryService.GetRepository:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryRequest - 9, // 27: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryByFullNameRequest - 11, // 28: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories:input_type -> buf.alpha.registry.v1alpha1.ListRepositoriesRequest - 13, // 29: buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories:input_type -> buf.alpha.registry.v1alpha1.ListUserRepositoriesRequest - 15, // 30: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess:input_type -> buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessRequest - 17, // 31: buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesRequest - 19, // 32: buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameRequest - 21, // 33: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryRequest - 23, // 34: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameRequest - 25, // 35: buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName:input_type -> buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameRequest - 27, // 36: buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName:input_type -> buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameRequest - 5, // 37: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName:input_type -> buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameRequest - 29, // 38: buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor:input_type -> buf.alpha.registry.v1alpha1.SetRepositoryContributorRequest - 31, // 39: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryContributorsRequest - 33, // 40: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryContributor:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryContributorRequest - 35, // 41: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings:input_type -> buf.alpha.registry.v1alpha1.GetRepositorySettingsRequest - 37, // 42: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName:input_type -> buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameRequest - 39, // 43: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata:input_type -> buf.alpha.registry.v1alpha1.GetRepositoriesMetadataRequest - 8, // 44: buf.alpha.registry.v1alpha1.RepositoryService.GetRepository:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryResponse - 10, // 45: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryByFullNameResponse - 12, // 46: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositories:output_type -> buf.alpha.registry.v1alpha1.ListRepositoriesResponse - 14, // 47: buf.alpha.registry.v1alpha1.RepositoryService.ListUserRepositories:output_type -> buf.alpha.registry.v1alpha1.ListUserRepositoriesResponse - 16, // 48: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoriesUserCanAccess:output_type -> buf.alpha.registry.v1alpha1.ListRepositoriesUserCanAccessResponse - 18, // 49: buf.alpha.registry.v1alpha1.RepositoryService.ListOrganizationRepositories:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationRepositoriesResponse - 20, // 50: buf.alpha.registry.v1alpha1.RepositoryService.CreateRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.CreateRepositoryByFullNameResponse - 22, // 51: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepository:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryResponse - 24, // 52: buf.alpha.registry.v1alpha1.RepositoryService.DeleteRepositoryByFullName:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryByFullNameResponse - 26, // 53: buf.alpha.registry.v1alpha1.RepositoryService.DeprecateRepositoryByName:output_type -> buf.alpha.registry.v1alpha1.DeprecateRepositoryByNameResponse - 28, // 54: buf.alpha.registry.v1alpha1.RepositoryService.UndeprecateRepositoryByName:output_type -> buf.alpha.registry.v1alpha1.UndeprecateRepositoryByNameResponse - 6, // 55: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesByFullName:output_type -> buf.alpha.registry.v1alpha1.GetRepositoriesByFullNameResponse - 30, // 56: buf.alpha.registry.v1alpha1.RepositoryService.SetRepositoryContributor:output_type -> buf.alpha.registry.v1alpha1.SetRepositoryContributorResponse - 32, // 57: buf.alpha.registry.v1alpha1.RepositoryService.ListRepositoryContributors:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryContributorsResponse - 34, // 58: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoryContributor:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryContributorResponse - 36, // 59: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositorySettings:output_type -> buf.alpha.registry.v1alpha1.GetRepositorySettingsResponse - 38, // 60: buf.alpha.registry.v1alpha1.RepositoryService.UpdateRepositorySettingsByName:output_type -> buf.alpha.registry.v1alpha1.UpdateRepositorySettingsByNameResponse - 40, // 61: buf.alpha.registry.v1alpha1.RepositoryService.GetRepositoriesMetadata:output_type -> buf.alpha.registry.v1alpha1.GetRepositoriesMetadataResponse - 44, // [44:62] is the sub-list for method output_type - 26, // [26:44] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_repository_proto_init() } -func file_buf_alpha_registry_v1alpha1_repository_proto_init() { - if File_buf_alpha_registry_v1alpha1_repository_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_role_proto_init() - file_buf_alpha_registry_v1alpha1_user_proto_init() - file_buf_alpha_registry_v1alpha1_verification_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Repository); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryCounts); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryContributor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryMetadata); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoriesByFullNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoriesByFullNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryByFullNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryByFullNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserRepositoriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserRepositoriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoriesUserCanAccessRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoriesUserCanAccessResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationRepositoriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationRepositoriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRepositoryByFullNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRepositoryByFullNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryByFullNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryByFullNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeprecateRepositoryByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeprecateRepositoryByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UndeprecateRepositoryByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UndeprecateRepositoryByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetRepositoryContributorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetRepositoryContributorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryContributorsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryContributorsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryContributorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryContributorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositorySettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositorySettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRepositorySettingsByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRepositorySettingsByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoriesMetadataRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoriesMetadataResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Repository_UserId)(nil), - (*Repository_OrganizationId)(nil), - } - file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes[36].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc, - NumEnums: 1, - NumMessages: 40, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_repository_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_repository_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_repository_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_repository_proto = out.File - file_buf_alpha_registry_v1alpha1_repository_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_repository_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_repository_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_branch.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_branch.pb.go deleted file mode 100644 index ef6d9326d1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_branch.pb.go +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/repository_branch.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RepositoryBranch struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique. - // branches are based on labels, so when a branch is pushed to, the ID will point to the - // updated entry in the labels table. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The name of the repository branch. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the latest commit on the branch. - LatestCommitName string `protobuf:"bytes,3,opt,name=latest_commit_name,json=latestCommitName,proto3" json:"latest_commit_name,omitempty"` - // is_main_branch denotes whether this branch is considered the main branch of the repository. - IsMainBranch bool `protobuf:"varint,4,opt,name=is_main_branch,json=isMainBranch,proto3" json:"is_main_branch,omitempty"` - // The last update time of the branch. - LastUpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_update_time,json=lastUpdateTime,proto3" json:"last_update_time,omitempty"` -} - -func (x *RepositoryBranch) Reset() { - *x = RepositoryBranch{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryBranch) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryBranch) ProtoMessage() {} - -func (x *RepositoryBranch) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryBranch.ProtoReflect.Descriptor instead. -func (*RepositoryBranch) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP(), []int{0} -} - -func (x *RepositoryBranch) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepositoryBranch) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositoryBranch) GetLatestCommitName() string { - if x != nil { - return x.LatestCommitName - } - return "" -} - -func (x *RepositoryBranch) GetIsMainBranch() bool { - if x != nil { - return x.IsMainBranch - } - return false -} - -func (x *RepositoryBranch) GetLastUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.LastUpdateTime - } - return nil -} - -type ListRepositoryBranchesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository whose branches should be listed. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` -} - -func (x *ListRepositoryBranchesRequest) Reset() { - *x = ListRepositoryBranchesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryBranchesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryBranchesRequest) ProtoMessage() {} - -func (x *ListRepositoryBranchesRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryBranchesRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryBranchesRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP(), []int{1} -} - -func (x *ListRepositoryBranchesRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *ListRepositoryBranchesRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryBranchesRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -type ListRepositoryBranchesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryBranches []*RepositoryBranch `protobuf:"bytes,1,rep,name=repository_branches,json=repositoryBranches,proto3" json:"repository_branches,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryBranchesResponse) Reset() { - *x = ListRepositoryBranchesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryBranchesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryBranchesResponse) ProtoMessage() {} - -func (x *ListRepositoryBranchesResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryBranchesResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryBranchesResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP(), []int{2} -} - -func (x *ListRepositoryBranchesResponse) GetRepositoryBranches() []*RepositoryBranch { - if x != nil { - return x.RepositoryBranches - } - return nil -} - -func (x *ListRepositoryBranchesResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type GetCurrentDefaultBranchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository whose current default branch is returned. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` -} - -func (x *GetCurrentDefaultBranchRequest) Reset() { - *x = GetCurrentDefaultBranchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentDefaultBranchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentDefaultBranchRequest) ProtoMessage() {} - -func (x *GetCurrentDefaultBranchRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentDefaultBranchRequest.ProtoReflect.Descriptor instead. -func (*GetCurrentDefaultBranchRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP(), []int{3} -} - -func (x *GetCurrentDefaultBranchRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -type GetCurrentDefaultBranchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CurrentDefaultBranch *RepositoryBranch `protobuf:"bytes,1,opt,name=current_default_branch,json=currentDefaultBranch,proto3" json:"current_default_branch,omitempty"` -} - -func (x *GetCurrentDefaultBranchResponse) Reset() { - *x = GetCurrentDefaultBranchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetCurrentDefaultBranchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCurrentDefaultBranchResponse) ProtoMessage() {} - -func (x *GetCurrentDefaultBranchResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetCurrentDefaultBranchResponse.ProtoReflect.Descriptor instead. -func (*GetCurrentDefaultBranchResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP(), []int{4} -} - -func (x *GetCurrentDefaultBranchResponse) GetCurrentDefaultBranch() *RepositoryBranch { - if x != nil { - return x.CurrentDefaultBranch - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_repository_branch_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xd0, 0x01, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x69, 0x73, - 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x69, 0x73, 0x4d, 0x61, 0x69, 0x6e, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x12, 0x44, 0x0a, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xa8, 0x01, 0x0a, 0x1e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5e, 0x0a, 0x13, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, - 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x45, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x86, 0x01, 0x0a, 0x1f, - 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, - 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x63, 0x0a, 0x16, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x14, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x32, 0xce, 0x02, 0x0a, 0x17, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x96, 0x01, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x12, 0x3a, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x17, 0x47, 0x65, - 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, - 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, - 0x66, 0x61, 0x75, 0x6c, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0xa2, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x15, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, - 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, - 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, - 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescData = file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes = []interface{}{ - (*RepositoryBranch)(nil), // 0: buf.alpha.registry.v1alpha1.RepositoryBranch - (*ListRepositoryBranchesRequest)(nil), // 1: buf.alpha.registry.v1alpha1.ListRepositoryBranchesRequest - (*ListRepositoryBranchesResponse)(nil), // 2: buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse - (*GetCurrentDefaultBranchRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchRequest - (*GetCurrentDefaultBranchResponse)(nil), // 4: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs = []int32{ - 5, // 0: buf.alpha.registry.v1alpha1.RepositoryBranch.last_update_time:type_name -> google.protobuf.Timestamp - 0, // 1: buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse.repository_branches:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch - 0, // 2: buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse.current_default_branch:type_name -> buf.alpha.registry.v1alpha1.RepositoryBranch - 1, // 3: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesRequest - 3, // 4: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch:input_type -> buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchRequest - 2, // 5: buf.alpha.registry.v1alpha1.RepositoryBranchService.ListRepositoryBranches:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryBranchesResponse - 4, // 6: buf.alpha.registry.v1alpha1.RepositoryBranchService.GetCurrentDefaultBranch:output_type -> buf.alpha.registry.v1alpha1.GetCurrentDefaultBranchResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_repository_branch_proto_init() } -func file_buf_alpha_registry_v1alpha1_repository_branch_proto_init() { - if File_buf_alpha_registry_v1alpha1_repository_branch_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryBranch); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryBranchesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryBranchesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentDefaultBranchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetCurrentDefaultBranchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_repository_branch_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_repository_branch_proto = out.File - file_buf_alpha_registry_v1alpha1_repository_branch_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_repository_branch_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_repository_branch_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_commit.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_commit.pb.go deleted file mode 100644 index 2b56656ac3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_commit.pb.go +++ /dev/null @@ -1,1492 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/repository_commit.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RepositoryCommit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique, immutable - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // immutable - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The digest of the commit. - Digest string `protobuf:"bytes,3,opt,name=digest,proto3" json:"digest,omitempty"` - // The name of the commit. - // This is what is referenced by users. - // Unique, immutable. - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // The branch on which this commit was created. - // - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/repository_commit.proto. - Branch string `protobuf:"bytes,5,opt,name=branch,proto3" json:"branch,omitempty"` - // The commit sequence ID for this commit. This - // is essentially what number commit this is on - // the branch. - CommitSequenceId int64 `protobuf:"varint,6,opt,name=commit_sequence_id,json=commitSequenceId,proto3" json:"commit_sequence_id,omitempty"` - // The username of the user who authored this commit. - Author string `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` - // The tags associated with this commit - Tags []*RepositoryTag `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags,omitempty"` - // The commit's draft name, if it is a draft commit. - DraftName string `protobuf:"bytes,9,opt,name=draft_name,json=draftName,proto3" json:"draft_name,omitempty"` - // spdx_license_id is the license of the commit, based on the - // license file pushed, which should be one of the identifier defined in - // https://spdx.org/licenses, and will be not set if the license file is not - // presented or cannot be classified into a known license. - SpdxLicenseId string `protobuf:"bytes,10,opt,name=spdx_license_id,json=spdxLicenseId,proto3" json:"spdx_license_id,omitempty"` - // The manifest digest of the commit. - ManifestDigest string `protobuf:"bytes,11,opt,name=manifest_digest,json=manifestDigest,proto3" json:"manifest_digest,omitempty"` - // Number of tags associated with the commit. - TagCount int64 `protobuf:"varint,12,opt,name=tag_count,json=tagCount,proto3" json:"tag_count,omitempty"` - // Number of git commits with metadata associated with the BSR commit. - GitCommitMetadataCount int64 `protobuf:"varint,13,opt,name=git_commit_metadata_count,json=gitCommitMetadataCount,proto3" json:"git_commit_metadata_count,omitempty"` - // Number of git commits without metadata associated with the BSR commit. - GitCommitNoMetadataCount int64 `protobuf:"varint,14,opt,name=git_commit_no_metadata_count,json=gitCommitNoMetadataCount,proto3" json:"git_commit_no_metadata_count,omitempty"` -} - -func (x *RepositoryCommit) Reset() { - *x = RepositoryCommit{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryCommit) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryCommit) ProtoMessage() {} - -func (x *RepositoryCommit) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryCommit.ProtoReflect.Descriptor instead. -func (*RepositoryCommit) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{0} -} - -func (x *RepositoryCommit) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepositoryCommit) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *RepositoryCommit) GetDigest() string { - if x != nil { - return x.Digest - } - return "" -} - -func (x *RepositoryCommit) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/repository_commit.proto. -func (x *RepositoryCommit) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *RepositoryCommit) GetCommitSequenceId() int64 { - if x != nil { - return x.CommitSequenceId - } - return 0 -} - -func (x *RepositoryCommit) GetAuthor() string { - if x != nil { - return x.Author - } - return "" -} - -func (x *RepositoryCommit) GetTags() []*RepositoryTag { - if x != nil { - return x.Tags - } - return nil -} - -func (x *RepositoryCommit) GetDraftName() string { - if x != nil { - return x.DraftName - } - return "" -} - -func (x *RepositoryCommit) GetSpdxLicenseId() string { - if x != nil { - return x.SpdxLicenseId - } - return "" -} - -func (x *RepositoryCommit) GetManifestDigest() string { - if x != nil { - return x.ManifestDigest - } - return "" -} - -func (x *RepositoryCommit) GetTagCount() int64 { - if x != nil { - return x.TagCount - } - return 0 -} - -func (x *RepositoryCommit) GetGitCommitMetadataCount() int64 { - if x != nil { - return x.GitCommitMetadataCount - } - return 0 -} - -func (x *RepositoryCommit) GetGitCommitNoMetadataCount() int64 { - if x != nil { - return x.GitCommitNoMetadataCount - } - return 0 -} - -type ListRepositoryCommitsByBranchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the repository branch belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the repository branch belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The name of the repository branch whose commits should be listed. - RepositoryBranchName string `protobuf:"bytes,3,opt,name=repository_branch_name,json=repositoryBranchName,proto3" json:"repository_branch_name,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // For now this is the id of he last commit returned in the previous page. - // This is directly set by the frontend when listing track history starting with a - // specific commit. If we page_token to be anything other than a commit id - // we need to change the frontend as well. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,6,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryCommitsByBranchRequest) Reset() { - *x = ListRepositoryCommitsByBranchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryCommitsByBranchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryCommitsByBranchRequest) ProtoMessage() {} - -func (x *ListRepositoryCommitsByBranchRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryCommitsByBranchRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryCommitsByBranchRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{1} -} - -func (x *ListRepositoryCommitsByBranchRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *ListRepositoryCommitsByBranchRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListRepositoryCommitsByBranchRequest) GetRepositoryBranchName() string { - if x != nil { - return x.RepositoryBranchName - } - return "" -} - -func (x *ListRepositoryCommitsByBranchRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryCommitsByBranchRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryCommitsByBranchRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryCommitsByBranchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryCommits []*RepositoryCommit `protobuf:"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3" json:"repository_commits,omitempty"` - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryCommitsByBranchResponse) Reset() { - *x = ListRepositoryCommitsByBranchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryCommitsByBranchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryCommitsByBranchResponse) ProtoMessage() {} - -func (x *ListRepositoryCommitsByBranchResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryCommitsByBranchResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryCommitsByBranchResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{2} -} - -func (x *ListRepositoryCommitsByBranchResponse) GetRepositoryCommits() []*RepositoryCommit { - if x != nil { - return x.RepositoryCommits - } - return nil -} - -func (x *ListRepositoryCommitsByBranchResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListRepositoryCommitsByReferenceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the repository reference belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the repository reference belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The reference used to resolve repository commits. Can be a tag or commit. - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,6,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryCommitsByReferenceRequest) Reset() { - *x = ListRepositoryCommitsByReferenceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryCommitsByReferenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryCommitsByReferenceRequest) ProtoMessage() {} - -func (x *ListRepositoryCommitsByReferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryCommitsByReferenceRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryCommitsByReferenceRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{3} -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryCommitsByReferenceRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryCommitsByReferenceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryCommits []*RepositoryCommit `protobuf:"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3" json:"repository_commits,omitempty"` - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryCommitsByReferenceResponse) Reset() { - *x = ListRepositoryCommitsByReferenceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryCommitsByReferenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryCommitsByReferenceResponse) ProtoMessage() {} - -func (x *ListRepositoryCommitsByReferenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryCommitsByReferenceResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryCommitsByReferenceResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{4} -} - -func (x *ListRepositoryCommitsByReferenceResponse) GetRepositoryCommits() []*RepositoryCommit { - if x != nil { - return x.RepositoryCommits - } - return nil -} - -func (x *ListRepositoryCommitsByReferenceResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type GetRepositoryCommitByReferenceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the reference belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the reference belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The reference that should be resolved to a commit. Can be a tag or commit. - Reference string `protobuf:"bytes,3,opt,name=reference,proto3" json:"reference,omitempty"` -} - -func (x *GetRepositoryCommitByReferenceRequest) Reset() { - *x = GetRepositoryCommitByReferenceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryCommitByReferenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryCommitByReferenceRequest) ProtoMessage() {} - -func (x *GetRepositoryCommitByReferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryCommitByReferenceRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoryCommitByReferenceRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{5} -} - -func (x *GetRepositoryCommitByReferenceRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *GetRepositoryCommitByReferenceRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *GetRepositoryCommitByReferenceRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -type GetRepositoryCommitByReferenceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryCommit *RepositoryCommit `protobuf:"bytes,1,opt,name=repository_commit,json=repositoryCommit,proto3" json:"repository_commit,omitempty"` -} - -func (x *GetRepositoryCommitByReferenceResponse) Reset() { - *x = GetRepositoryCommitByReferenceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryCommitByReferenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryCommitByReferenceResponse) ProtoMessage() {} - -func (x *GetRepositoryCommitByReferenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryCommitByReferenceResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoryCommitByReferenceResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{6} -} - -func (x *GetRepositoryCommitByReferenceResponse) GetRepositoryCommit() *RepositoryCommit { - if x != nil { - return x.RepositoryCommit - } - return nil -} - -type GetRepositoryCommitBySequenceIdRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the repository branch belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the repository branch belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The name of the repository branch which the sequence ID is relative to. - RepositoryBranchName string `protobuf:"bytes,3,opt,name=repository_branch_name,json=repositoryBranchName,proto3" json:"repository_branch_name,omitempty"` - // The sequence ID to look up. - CommitSequenceId int64 `protobuf:"varint,4,opt,name=commit_sequence_id,json=commitSequenceId,proto3" json:"commit_sequence_id,omitempty"` -} - -func (x *GetRepositoryCommitBySequenceIdRequest) Reset() { - *x = GetRepositoryCommitBySequenceIdRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryCommitBySequenceIdRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryCommitBySequenceIdRequest) ProtoMessage() {} - -func (x *GetRepositoryCommitBySequenceIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryCommitBySequenceIdRequest.ProtoReflect.Descriptor instead. -func (*GetRepositoryCommitBySequenceIdRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{7} -} - -func (x *GetRepositoryCommitBySequenceIdRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *GetRepositoryCommitBySequenceIdRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *GetRepositoryCommitBySequenceIdRequest) GetRepositoryBranchName() string { - if x != nil { - return x.RepositoryBranchName - } - return "" -} - -func (x *GetRepositoryCommitBySequenceIdRequest) GetCommitSequenceId() int64 { - if x != nil { - return x.CommitSequenceId - } - return 0 -} - -type GetRepositoryCommitBySequenceIdResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryCommit *RepositoryCommit `protobuf:"bytes,1,opt,name=repository_commit,json=repositoryCommit,proto3" json:"repository_commit,omitempty"` -} - -func (x *GetRepositoryCommitBySequenceIdResponse) Reset() { - *x = GetRepositoryCommitBySequenceIdResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRepositoryCommitBySequenceIdResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRepositoryCommitBySequenceIdResponse) ProtoMessage() {} - -func (x *GetRepositoryCommitBySequenceIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRepositoryCommitBySequenceIdResponse.ProtoReflect.Descriptor instead. -func (*GetRepositoryCommitBySequenceIdResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{8} -} - -func (x *GetRepositoryCommitBySequenceIdResponse) GetRepositoryCommit() *RepositoryCommit { - if x != nil { - return x.RepositoryCommit - } - return nil -} - -type ListRepositoryDraftCommitsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the repository branch belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the repository branch belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // By default, draft commits are ordered by last update time descending. - // Reverse orders them ascending. - Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryDraftCommitsRequest) Reset() { - *x = ListRepositoryDraftCommitsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryDraftCommitsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryDraftCommitsRequest) ProtoMessage() {} - -func (x *ListRepositoryDraftCommitsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryDraftCommitsRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryDraftCommitsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{9} -} - -func (x *ListRepositoryDraftCommitsRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *ListRepositoryDraftCommitsRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListRepositoryDraftCommitsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryDraftCommitsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryDraftCommitsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryDraftCommitsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Each commit will have draft_name set. - RepositoryCommits []*RepositoryCommit `protobuf:"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3" json:"repository_commits,omitempty"` - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryDraftCommitsResponse) Reset() { - *x = ListRepositoryDraftCommitsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryDraftCommitsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryDraftCommitsResponse) ProtoMessage() {} - -func (x *ListRepositoryDraftCommitsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryDraftCommitsResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryDraftCommitsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{10} -} - -func (x *ListRepositoryDraftCommitsResponse) GetRepositoryCommits() []*RepositoryCommit { - if x != nil { - return x.RepositoryCommits - } - return nil -} - -func (x *ListRepositoryDraftCommitsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type DeleteRepositoryDraftCommitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository which the repository branch belongs to. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository which the repository branch belongs to. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The name of the draft to delete. - DraftName string `protobuf:"bytes,3,opt,name=draft_name,json=draftName,proto3" json:"draft_name,omitempty"` -} - -func (x *DeleteRepositoryDraftCommitRequest) Reset() { - *x = DeleteRepositoryDraftCommitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryDraftCommitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryDraftCommitRequest) ProtoMessage() {} - -func (x *DeleteRepositoryDraftCommitRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryDraftCommitRequest.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryDraftCommitRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{11} -} - -func (x *DeleteRepositoryDraftCommitRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *DeleteRepositoryDraftCommitRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *DeleteRepositoryDraftCommitRequest) GetDraftName() string { - if x != nil { - return x.DraftName - } - return "" -} - -type DeleteRepositoryDraftCommitResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteRepositoryDraftCommitResponse) Reset() { - *x = DeleteRepositoryDraftCommitResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRepositoryDraftCommitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRepositoryDraftCommitResponse) ProtoMessage() {} - -func (x *DeleteRepositoryDraftCommitResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRepositoryDraftCommitResponse.ProtoReflect.Descriptor instead. -func (*DeleteRepositoryDraftCommitResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP(), []int{12} -} - -var File_buf_alpha_registry_v1alpha1_repository_commit_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc = []byte{ - 0x0a, 0x33, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x1a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x04, 0x0a, 0x10, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, - 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x63, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x08, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, - 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x72, 0x61, 0x66, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x70, 0x64, 0x78, 0x5f, 0x6c, 0x69, 0x63, - 0x65, 0x6e, 0x73, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, - 0x70, 0x64, 0x78, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0f, - 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x61, 0x67, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x61, 0x67, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x19, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x16, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3e, 0x0a, - 0x1c, 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x6f, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0e, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x18, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4e, 0x6f, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x86, 0x02, - 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, - 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, - 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, - 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xad, 0x01, 0x0a, 0x25, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x42, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5c, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x11, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x26, - 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xf1, 0x01, 0x0a, 0x27, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, - 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xb0, 0x01, 0x0a, 0x28, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x99, 0x01, - 0x0a, 0x25, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x84, 0x01, 0x0a, 0x26, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x10, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x22, 0xe0, 0x01, 0x0a, 0x26, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x34, 0x0a, 0x16, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x14, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, - 0x68, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, - 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, - 0x65, 0x49, 0x64, 0x22, 0x85, 0x01, 0x0a, 0x27, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x53, 0x65, 0x71, - 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5a, 0x0a, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x22, 0xcd, 0x01, 0x0a, 0x21, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, - 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x22, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, - 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x11, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, - 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x97, 0x01, 0x0a, 0x22, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, - 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x64, 0x72, 0x61, 0x66, 0x74, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x72, 0x61, 0x66, 0x74, 0x4e, 0x61, - 0x6d, 0x65, 0x22, 0x25, 0x0a, 0x23, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb3, 0x08, 0x0a, 0x17, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xae, 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, - 0x79, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x41, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x42, 0x72, 0x61, - 0x6e, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x42, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, - 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x06, - 0x88, 0x02, 0x01, 0x90, 0x02, 0x01, 0x12, 0xb4, 0x01, 0x0a, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, - 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x44, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, - 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x45, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xae, 0x01, - 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x42, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xb1, - 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x49, 0x64, 0x12, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x49, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x44, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x42, 0x79, 0x53, 0x65, 0x71, 0x75, 0x65, - 0x6e, 0x63, 0x65, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x12, 0xa2, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x73, 0x12, 0x3e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, - 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, - 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xa5, 0x01, 0x0a, 0x1b, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, - 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x3f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x44, 0x72, 0x61, 0x66, 0x74, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, - 0xa2, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x15, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, - 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, - 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescData = file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes = make([]protoimpl.MessageInfo, 13) -var file_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes = []interface{}{ - (*RepositoryCommit)(nil), // 0: buf.alpha.registry.v1alpha1.RepositoryCommit - (*ListRepositoryCommitsByBranchRequest)(nil), // 1: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchRequest - (*ListRepositoryCommitsByBranchResponse)(nil), // 2: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse - (*ListRepositoryCommitsByReferenceRequest)(nil), // 3: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceRequest - (*ListRepositoryCommitsByReferenceResponse)(nil), // 4: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse - (*GetRepositoryCommitByReferenceRequest)(nil), // 5: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceRequest - (*GetRepositoryCommitByReferenceResponse)(nil), // 6: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse - (*GetRepositoryCommitBySequenceIdRequest)(nil), // 7: buf.alpha.registry.v1alpha1.GetRepositoryCommitBySequenceIdRequest - (*GetRepositoryCommitBySequenceIdResponse)(nil), // 8: buf.alpha.registry.v1alpha1.GetRepositoryCommitBySequenceIdResponse - (*ListRepositoryDraftCommitsRequest)(nil), // 9: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsRequest - (*ListRepositoryDraftCommitsResponse)(nil), // 10: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse - (*DeleteRepositoryDraftCommitRequest)(nil), // 11: buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitRequest - (*DeleteRepositoryDraftCommitResponse)(nil), // 12: buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitResponse - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*RepositoryTag)(nil), // 14: buf.alpha.registry.v1alpha1.RepositoryTag -} -var file_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs = []int32{ - 13, // 0: buf.alpha.registry.v1alpha1.RepositoryCommit.create_time:type_name -> google.protobuf.Timestamp - 14, // 1: buf.alpha.registry.v1alpha1.RepositoryCommit.tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 0, // 2: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 0, // 3: buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 0, // 4: buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse.repository_commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 0, // 5: buf.alpha.registry.v1alpha1.GetRepositoryCommitBySequenceIdResponse.repository_commit:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 0, // 6: buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 1, // 7: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchRequest - 3, // 8: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceRequest - 5, // 9: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceRequest - 7, // 10: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitBySequenceId:input_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitBySequenceIdRequest - 9, // 11: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsRequest - 11, // 12: buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit:input_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitRequest - 2, // 13: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByBranch:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByBranchResponse - 4, // 14: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryCommitsByReference:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryCommitsByReferenceResponse - 6, // 15: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitByReference:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitByReferenceResponse - 8, // 16: buf.alpha.registry.v1alpha1.RepositoryCommitService.GetRepositoryCommitBySequenceId:output_type -> buf.alpha.registry.v1alpha1.GetRepositoryCommitBySequenceIdResponse - 10, // 17: buf.alpha.registry.v1alpha1.RepositoryCommitService.ListRepositoryDraftCommits:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryDraftCommitsResponse - 12, // 18: buf.alpha.registry.v1alpha1.RepositoryCommitService.DeleteRepositoryDraftCommit:output_type -> buf.alpha.registry.v1alpha1.DeleteRepositoryDraftCommitResponse - 13, // [13:19] is the sub-list for method output_type - 7, // [7:13] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_repository_commit_proto_init() } -func file_buf_alpha_registry_v1alpha1_repository_commit_proto_init() { - if File_buf_alpha_registry_v1alpha1_repository_commit_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryCommit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryCommitsByBranchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryCommitsByBranchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryCommitsByReferenceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryCommitsByReferenceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryCommitByReferenceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryCommitByReferenceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryCommitBySequenceIdRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRepositoryCommitBySequenceIdResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryDraftCommitsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryDraftCommitsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryDraftCommitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRepositoryDraftCommitResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc, - NumEnums: 0, - NumMessages: 13, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_repository_commit_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_repository_commit_proto = out.File - file_buf_alpha_registry_v1alpha1_repository_commit_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_repository_commit_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_repository_commit_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_tag.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_tag.pb.go deleted file mode 100644 index 5d6c4737e5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/repository_tag.pb.go +++ /dev/null @@ -1,785 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/repository_tag.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type RepositoryTag struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique. - // tags are based on labels, so if a label has been moved, the ID will point to the - // updated entry in the labels table. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // immutable - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // We reserve field number '3' for the update_time. - // google.protobuf.Timestamp update_time = 3; - // The name of the repository tag, e.g. "6e2e7f24718a76caa32a80d0e2b1841ef2c61403". - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // The name of the commit this tag belongs to. - CommitName string `protobuf:"bytes,5,opt,name=commit_name,json=commitName,proto3" json:"commit_name,omitempty"` - // The username of the author of the tag. - Author string `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` -} - -func (x *RepositoryTag) Reset() { - *x = RepositoryTag{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositoryTag) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositoryTag) ProtoMessage() {} - -func (x *RepositoryTag) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositoryTag.ProtoReflect.Descriptor instead. -func (*RepositoryTag) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{0} -} - -func (x *RepositoryTag) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepositoryTag) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *RepositoryTag) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositoryTag) GetCommitName() string { - if x != nil { - return x.CommitName - } - return "" -} - -func (x *RepositoryTag) GetAuthor() string { - if x != nil { - return x.Author - } - return "" -} - -type CreateRepositoryTagRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository this tag should be created on. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The name of the repository tag, e.g. "6e2e7f24718a76caa32a80d0e2b1841ef2c61403". - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the commit this tag should be created for. - CommitName string `protobuf:"bytes,3,opt,name=commit_name,json=commitName,proto3" json:"commit_name,omitempty"` -} - -func (x *CreateRepositoryTagRequest) Reset() { - *x = CreateRepositoryTagRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRepositoryTagRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRepositoryTagRequest) ProtoMessage() {} - -func (x *CreateRepositoryTagRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRepositoryTagRequest.ProtoReflect.Descriptor instead. -func (*CreateRepositoryTagRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateRepositoryTagRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *CreateRepositoryTagRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateRepositoryTagRequest) GetCommitName() string { - if x != nil { - return x.CommitName - } - return "" -} - -type CreateRepositoryTagResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryTag *RepositoryTag `protobuf:"bytes,1,opt,name=repository_tag,json=repositoryTag,proto3" json:"repository_tag,omitempty"` -} - -func (x *CreateRepositoryTagResponse) Reset() { - *x = CreateRepositoryTagResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRepositoryTagResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRepositoryTagResponse) ProtoMessage() {} - -func (x *CreateRepositoryTagResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRepositoryTagResponse.ProtoReflect.Descriptor instead. -func (*CreateRepositoryTagResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateRepositoryTagResponse) GetRepositoryTag() *RepositoryTag { - if x != nil { - return x.RepositoryTag - } - return nil -} - -type ListRepositoryTagsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository whose tags should be listed. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryTagsRequest) Reset() { - *x = ListRepositoryTagsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryTagsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryTagsRequest) ProtoMessage() {} - -func (x *ListRepositoryTagsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryTagsRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryTagsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{3} -} - -func (x *ListRepositoryTagsRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *ListRepositoryTagsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryTagsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryTagsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryTagsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryTags []*RepositoryTag `protobuf:"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3" json:"repository_tags,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryTagsResponse) Reset() { - *x = ListRepositoryTagsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryTagsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryTagsResponse) ProtoMessage() {} - -func (x *ListRepositoryTagsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryTagsResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryTagsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{4} -} - -func (x *ListRepositoryTagsResponse) GetRepositoryTags() []*RepositoryTag { - if x != nil { - return x.RepositoryTags - } - return nil -} - -func (x *ListRepositoryTagsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListRepositoryTagsForReferenceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the repository whose tags should be listed. - RepositoryId string `protobuf:"bytes,1,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The name of the reference. - Reference string `protobuf:"bytes,2,opt,name=reference,proto3" json:"reference,omitempty"` - PageSize uint32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,4,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListRepositoryTagsForReferenceRequest) Reset() { - *x = ListRepositoryTagsForReferenceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryTagsForReferenceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryTagsForReferenceRequest) ProtoMessage() {} - -func (x *ListRepositoryTagsForReferenceRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryTagsForReferenceRequest.ProtoReflect.Descriptor instead. -func (*ListRepositoryTagsForReferenceRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{5} -} - -func (x *ListRepositoryTagsForReferenceRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *ListRepositoryTagsForReferenceRequest) GetReference() string { - if x != nil { - return x.Reference - } - return "" -} - -func (x *ListRepositoryTagsForReferenceRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListRepositoryTagsForReferenceRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListRepositoryTagsForReferenceRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListRepositoryTagsForReferenceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryTags []*RepositoryTag `protobuf:"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3" json:"repository_tags,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListRepositoryTagsForReferenceResponse) Reset() { - *x = ListRepositoryTagsForReferenceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRepositoryTagsForReferenceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRepositoryTagsForReferenceResponse) ProtoMessage() {} - -func (x *ListRepositoryTagsForReferenceResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListRepositoryTagsForReferenceResponse.ProtoReflect.Descriptor instead. -func (*ListRepositoryTagsForReferenceResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP(), []int{6} -} - -func (x *ListRepositoryTagsForReferenceResponse) GetRepositoryTags() []*RepositoryTag { - if x != nil { - return x.RepositoryTags - } - return nil -} - -func (x *ListRepositoryTagsForReferenceResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_repository_tag_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0xa9, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, - 0x61, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x22, 0x76, 0x0a, 0x1a, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x70, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x5f, 0x74, 0x61, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x22, 0x96, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, - 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, - 0x99, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, - 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x54, 0x61, 0x67, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, - 0x61, 0x67, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, - 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xc0, 0x01, 0x0a, 0x25, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, - 0x67, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0xa5, - 0x01, 0x0a, 0x26, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x54, 0x61, 0x67, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, 0x0e, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x26, - 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xe4, 0x03, 0x0a, 0x14, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x8d, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, - 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, - 0x8a, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0xae, 0x01, 0x0a, - 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, - 0x61, 0x67, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, - 0x42, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, - 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x43, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x54, 0x61, 0x67, 0x73, 0x46, 0x6f, 0x72, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x9f, 0x02, - 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x42, 0x12, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescData = file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes = []interface{}{ - (*RepositoryTag)(nil), // 0: buf.alpha.registry.v1alpha1.RepositoryTag - (*CreateRepositoryTagRequest)(nil), // 1: buf.alpha.registry.v1alpha1.CreateRepositoryTagRequest - (*CreateRepositoryTagResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse - (*ListRepositoryTagsRequest)(nil), // 3: buf.alpha.registry.v1alpha1.ListRepositoryTagsRequest - (*ListRepositoryTagsResponse)(nil), // 4: buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse - (*ListRepositoryTagsForReferenceRequest)(nil), // 5: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceRequest - (*ListRepositoryTagsForReferenceResponse)(nil), // 6: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs = []int32{ - 7, // 0: buf.alpha.registry.v1alpha1.RepositoryTag.create_time:type_name -> google.protobuf.Timestamp - 0, // 1: buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse.repository_tag:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 0, // 2: buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 0, // 3: buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 1, // 4: buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag:input_type -> buf.alpha.registry.v1alpha1.CreateRepositoryTagRequest - 3, // 5: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsRequest - 5, // 6: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference:input_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceRequest - 2, // 7: buf.alpha.registry.v1alpha1.RepositoryTagService.CreateRepositoryTag:output_type -> buf.alpha.registry.v1alpha1.CreateRepositoryTagResponse - 4, // 8: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTags:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsResponse - 6, // 9: buf.alpha.registry.v1alpha1.RepositoryTagService.ListRepositoryTagsForReference:output_type -> buf.alpha.registry.v1alpha1.ListRepositoryTagsForReferenceResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() } -func file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() { - if File_buf_alpha_registry_v1alpha1_repository_tag_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositoryTag); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRepositoryTagRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRepositoryTagResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryTagsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryTagsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryTagsForReferenceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRepositoryTagsForReferenceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_repository_tag_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_repository_tag_proto = out.File - file_buf_alpha_registry_v1alpha1_repository_tag_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_repository_tag_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_repository_tag_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resolve.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resolve.pb.go deleted file mode 100644 index ae7d940970..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resolve.pb.go +++ /dev/null @@ -1,1366 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/resolve.proto - -package registryv1alpha1 - -import ( - v1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type ResolvedReferenceType int32 - -const ( - ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_UNSPECIFIED ResolvedReferenceType = 0 - ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_COMMIT ResolvedReferenceType = 1 - ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_TAG ResolvedReferenceType = 3 - ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_DRAFT ResolvedReferenceType = 5 -) - -// Enum value maps for ResolvedReferenceType. -var ( - ResolvedReferenceType_name = map[int32]string{ - 0: "RESOLVED_REFERENCE_TYPE_UNSPECIFIED", - 1: "RESOLVED_REFERENCE_TYPE_COMMIT", - 3: "RESOLVED_REFERENCE_TYPE_TAG", - 5: "RESOLVED_REFERENCE_TYPE_DRAFT", - } - ResolvedReferenceType_value = map[string]int32{ - "RESOLVED_REFERENCE_TYPE_UNSPECIFIED": 0, - "RESOLVED_REFERENCE_TYPE_COMMIT": 1, - "RESOLVED_REFERENCE_TYPE_TAG": 3, - "RESOLVED_REFERENCE_TYPE_DRAFT": 5, - } -) - -func (x ResolvedReferenceType) Enum() *ResolvedReferenceType { - p := new(ResolvedReferenceType) - *p = x - return p -} - -func (x ResolvedReferenceType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ResolvedReferenceType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes[0].Descriptor() -} - -func (ResolvedReferenceType) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes[0] -} - -func (x ResolvedReferenceType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ResolvedReferenceType.Descriptor instead. -func (ResolvedReferenceType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{0} -} - -type GetModulePinsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ModuleReferences []*v1alpha1.ModuleReference `protobuf:"bytes,1,rep,name=module_references,json=moduleReferences,proto3" json:"module_references,omitempty"` - // current_module_pins allows for partial dependency updates by letting clients - // send a request with the pins for their current module and only the - // identities of the dependencies they want to update in module_references. - // - // When resolving, if a client supplied module pin is: - // - in the transitive closure of pins resolved from the module_references, - // the client supplied module pin will be an extra candidate for tie - // breaking. - // - NOT in the in the transitive closure of pins resolved from the - // module_references, it will be returned as is. - CurrentModulePins []*v1alpha1.ModulePin `protobuf:"bytes,2,rep,name=current_module_pins,json=currentModulePins,proto3" json:"current_module_pins,omitempty"` -} - -func (x *GetModulePinsRequest) Reset() { - *x = GetModulePinsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModulePinsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModulePinsRequest) ProtoMessage() {} - -func (x *GetModulePinsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModulePinsRequest.ProtoReflect.Descriptor instead. -func (*GetModulePinsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{0} -} - -func (x *GetModulePinsRequest) GetModuleReferences() []*v1alpha1.ModuleReference { - if x != nil { - return x.ModuleReferences - } - return nil -} - -func (x *GetModulePinsRequest) GetCurrentModulePins() []*v1alpha1.ModulePin { - if x != nil { - return x.CurrentModulePins - } - return nil -} - -type GetModulePinsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ModulePins []*v1alpha1.ModulePin `protobuf:"bytes,1,rep,name=module_pins,json=modulePins,proto3" json:"module_pins,omitempty"` -} - -func (x *GetModulePinsResponse) Reset() { - *x = GetModulePinsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetModulePinsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetModulePinsResponse) ProtoMessage() {} - -func (x *GetModulePinsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetModulePinsResponse.ProtoReflect.Descriptor instead. -func (*GetModulePinsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{1} -} - -func (x *GetModulePinsResponse) GetModulePins() []*v1alpha1.ModulePin { - if x != nil { - return x.ModulePins - } - return nil -} - -type GetLocalModulePinsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalModuleReferences []*LocalModuleReference `protobuf:"bytes,1,rep,name=local_module_references,json=localModuleReferences,proto3" json:"local_module_references,omitempty"` -} - -func (x *GetLocalModulePinsRequest) Reset() { - *x = GetLocalModulePinsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLocalModulePinsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLocalModulePinsRequest) ProtoMessage() {} - -func (x *GetLocalModulePinsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLocalModulePinsRequest.ProtoReflect.Descriptor instead. -func (*GetLocalModulePinsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{2} -} - -func (x *GetLocalModulePinsRequest) GetLocalModuleReferences() []*LocalModuleReference { - if x != nil { - return x.LocalModuleReferences - } - return nil -} - -type LocalModuleResolveResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // A copy of the reference that was resolved. - Reference *LocalModuleReference `protobuf:"bytes,1,opt,name=reference,proto3" json:"reference,omitempty"` - // The pin the reference resolved to. - Pin *LocalModulePin `protobuf:"bytes,2,opt,name=pin,proto3" json:"pin,omitempty"` - // The type the reference resolved as. - ResolvedReferenceType ResolvedReferenceType `protobuf:"varint,3,opt,name=resolved_reference_type,json=resolvedReferenceType,proto3,enum=buf.alpha.registry.v1alpha1.ResolvedReferenceType" json:"resolved_reference_type,omitempty"` -} - -func (x *LocalModuleResolveResult) Reset() { - *x = LocalModuleResolveResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LocalModuleResolveResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LocalModuleResolveResult) ProtoMessage() {} - -func (x *LocalModuleResolveResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LocalModuleResolveResult.ProtoReflect.Descriptor instead. -func (*LocalModuleResolveResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{3} -} - -func (x *LocalModuleResolveResult) GetReference() *LocalModuleReference { - if x != nil { - return x.Reference - } - return nil -} - -func (x *LocalModuleResolveResult) GetPin() *LocalModulePin { - if x != nil { - return x.Pin - } - return nil -} - -func (x *LocalModuleResolveResult) GetResolvedReferenceType() ResolvedReferenceType { - if x != nil { - return x.ResolvedReferenceType - } - return ResolvedReferenceType_RESOLVED_REFERENCE_TYPE_UNSPECIFIED -} - -type GetLocalModulePinsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LocalModuleResolveResults []*LocalModuleResolveResult `protobuf:"bytes,1,rep,name=local_module_resolve_results,json=localModuleResolveResults,proto3" json:"local_module_resolve_results,omitempty"` - // dependencies are the dependencies of the LocalModulePins. - // - // This includes the transitive deps. - Dependencies []*v1alpha1.ModulePin `protobuf:"bytes,2,rep,name=dependencies,proto3" json:"dependencies,omitempty"` -} - -func (x *GetLocalModulePinsResponse) Reset() { - *x = GetLocalModulePinsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLocalModulePinsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLocalModulePinsResponse) ProtoMessage() {} - -func (x *GetLocalModulePinsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLocalModulePinsResponse.ProtoReflect.Descriptor instead. -func (*GetLocalModulePinsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{4} -} - -func (x *GetLocalModulePinsResponse) GetLocalModuleResolveResults() []*LocalModuleResolveResult { - if x != nil { - return x.LocalModuleResolveResults - } - return nil -} - -func (x *GetLocalModulePinsResponse) GetDependencies() []*v1alpha1.ModulePin { - if x != nil { - return x.Dependencies - } - return nil -} - -type GetGoVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plugin reference to resolve. - PluginReference *GetRemotePackageVersionPlugin `protobuf:"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3" json:"plugin_reference,omitempty"` - // The module reference to resolve. - ModuleReference *LocalModuleReference `protobuf:"bytes,2,opt,name=module_reference,json=moduleReference,proto3" json:"module_reference,omitempty"` -} - -func (x *GetGoVersionRequest) Reset() { - *x = GetGoVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGoVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGoVersionRequest) ProtoMessage() {} - -func (x *GetGoVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGoVersionRequest.ProtoReflect.Descriptor instead. -func (*GetGoVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{5} -} - -func (x *GetGoVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin { - if x != nil { - return x.PluginReference - } - return nil -} - -func (x *GetGoVersionRequest) GetModuleReference() *LocalModuleReference { - if x != nil { - return x.ModuleReference - } - return nil -} - -type GetGoVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version is the resolved version to be used with the go module proxy. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetGoVersionResponse) Reset() { - *x = GetGoVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGoVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGoVersionResponse) ProtoMessage() {} - -func (x *GetGoVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGoVersionResponse.ProtoReflect.Descriptor instead. -func (*GetGoVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{6} -} - -func (x *GetGoVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type GetMavenVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plugin reference to resolve. - PluginReference *GetRemotePackageVersionPlugin `protobuf:"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3" json:"plugin_reference,omitempty"` - // The module reference to resolve. - ModuleReference *LocalModuleReference `protobuf:"bytes,2,opt,name=module_reference,json=moduleReference,proto3" json:"module_reference,omitempty"` -} - -func (x *GetMavenVersionRequest) Reset() { - *x = GetMavenVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetMavenVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMavenVersionRequest) ProtoMessage() {} - -func (x *GetMavenVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetMavenVersionRequest.ProtoReflect.Descriptor instead. -func (*GetMavenVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{7} -} - -func (x *GetMavenVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin { - if x != nil { - return x.PluginReference - } - return nil -} - -func (x *GetMavenVersionRequest) GetModuleReference() *LocalModuleReference { - if x != nil { - return x.ModuleReference - } - return nil -} - -type GetMavenVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version is the resolved version to be used with the maven repository. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetMavenVersionResponse) Reset() { - *x = GetMavenVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetMavenVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMavenVersionResponse) ProtoMessage() {} - -func (x *GetMavenVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetMavenVersionResponse.ProtoReflect.Descriptor instead. -func (*GetMavenVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{8} -} - -func (x *GetMavenVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type GetNPMVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plugin reference to resolve. - PluginReference *GetRemotePackageVersionPlugin `protobuf:"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3" json:"plugin_reference,omitempty"` - // The module reference to resolve. - ModuleReference *LocalModuleReference `protobuf:"bytes,2,opt,name=module_reference,json=moduleReference,proto3" json:"module_reference,omitempty"` -} - -func (x *GetNPMVersionRequest) Reset() { - *x = GetNPMVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNPMVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNPMVersionRequest) ProtoMessage() {} - -func (x *GetNPMVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetNPMVersionRequest.ProtoReflect.Descriptor instead. -func (*GetNPMVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{9} -} - -func (x *GetNPMVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin { - if x != nil { - return x.PluginReference - } - return nil -} - -func (x *GetNPMVersionRequest) GetModuleReference() *LocalModuleReference { - if x != nil { - return x.ModuleReference - } - return nil -} - -type GetNPMVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version is the resolved version to be used with the npm registry. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetNPMVersionResponse) Reset() { - *x = GetNPMVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetNPMVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetNPMVersionResponse) ProtoMessage() {} - -func (x *GetNPMVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetNPMVersionResponse.ProtoReflect.Descriptor instead. -func (*GetNPMVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{10} -} - -func (x *GetNPMVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -type GetSwiftVersionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plugin reference to resolve. - PluginReference *GetRemotePackageVersionPlugin `protobuf:"bytes,1,opt,name=plugin_reference,json=pluginReference,proto3" json:"plugin_reference,omitempty"` - // The module reference to resolve. - ModuleReference *LocalModuleReference `protobuf:"bytes,2,opt,name=module_reference,json=moduleReference,proto3" json:"module_reference,omitempty"` -} - -func (x *GetSwiftVersionRequest) Reset() { - *x = GetSwiftVersionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSwiftVersionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSwiftVersionRequest) ProtoMessage() {} - -func (x *GetSwiftVersionRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSwiftVersionRequest.ProtoReflect.Descriptor instead. -func (*GetSwiftVersionRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{11} -} - -func (x *GetSwiftVersionRequest) GetPluginReference() *GetRemotePackageVersionPlugin { - if x != nil { - return x.PluginReference - } - return nil -} - -func (x *GetSwiftVersionRequest) GetModuleReference() *LocalModuleReference { - if x != nil { - return x.ModuleReference - } - return nil -} - -type GetSwiftVersionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // version is the resolved version to be used with the swift registry. - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetSwiftVersionResponse) Reset() { - *x = GetSwiftVersionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSwiftVersionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSwiftVersionResponse) ProtoMessage() {} - -func (x *GetSwiftVersionResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSwiftVersionResponse.ProtoReflect.Descriptor instead. -func (*GetSwiftVersionResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{12} -} - -func (x *GetSwiftVersionResponse) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -// GetRemotePackageVersionPlugin is a plugin reference. -// If the version is empty, this is a reference to the latest version. -type GetRemotePackageVersionPlugin struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the plugin. - // example: bufbuild - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the plugin. - // example: connect-go - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The version of the plugin. - // If empty, this is a reference to the latest version. - // example: v1.0.0 - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (x *GetRemotePackageVersionPlugin) Reset() { - *x = GetRemotePackageVersionPlugin{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRemotePackageVersionPlugin) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRemotePackageVersionPlugin) ProtoMessage() {} - -func (x *GetRemotePackageVersionPlugin) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRemotePackageVersionPlugin.ProtoReflect.Descriptor instead. -func (*GetRemotePackageVersionPlugin) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP(), []int{13} -} - -func (x *GetRemotePackageVersionPlugin) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetRemotePackageVersionPlugin) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetRemotePackageVersionPlugin) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_resolve_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x14, 0x47, - 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x11, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x10, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x13, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x70, - 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x52, - 0x11, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, - 0x6e, 0x73, 0x22, 0x5e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, - 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x70, 0x69, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x52, 0x0a, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, - 0x6e, 0x73, 0x22, 0x86, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x69, 0x0a, 0x17, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x52, 0x15, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0x96, 0x02, 0x0a, 0x18, - 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x4f, 0x0a, 0x09, 0x72, 0x65, 0x66, 0x65, - 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x09, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3d, 0x0a, 0x03, 0x70, 0x69, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x50, 0x69, 0x6e, 0x52, 0x03, 0x70, 0x69, 0x6e, 0x12, 0x6a, 0x0a, 0x17, 0x72, 0x65, 0x73, 0x6f, - 0x6c, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x15, 0x72, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x22, 0xde, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, - 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x76, 0x0a, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x52, 0x19, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x64, - 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x52, 0x0c, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x69, 0x65, 0x73, 0x22, 0xda, 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x47, 0x6f, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x65, 0x0a, - 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x0f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x72, - 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, - 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, - 0x63, 0x65, 0x22, 0x30, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xdd, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x76, 0x65, - 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x65, 0x0a, 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x0f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, - 0x65, 0x6e, 0x63, 0x65, 0x22, 0x33, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4d, 0x61, 0x76, 0x65, 0x6e, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xdb, 0x01, 0x0a, 0x14, 0x47, 0x65, - 0x74, 0x4e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x65, 0x0a, 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x0f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x10, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, 0x66, - 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x52, 0x65, - 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x31, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4e, 0x50, - 0x4d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xdd, 0x01, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x53, 0x77, 0x69, 0x66, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x65, 0x0a, 0x10, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, - 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x0f, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x10, - 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, - 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x33, 0x0a, 0x17, 0x47, 0x65, - 0x74, 0x53, 0x77, 0x69, 0x66, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, - 0x63, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x50, 0x61, 0x63, 0x6b, - 0x61, 0x67, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x2a, 0xf3, 0x01, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x64, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x27, - 0x0a, 0x23, 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, - 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x52, 0x45, 0x53, 0x4f, 0x4c, - 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x52, - 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x41, 0x47, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, - 0x52, 0x45, 0x53, 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, - 0x43, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x52, 0x41, 0x46, 0x54, 0x10, 0x05, 0x22, - 0x04, 0x08, 0x02, 0x10, 0x02, 0x22, 0x04, 0x08, 0x04, 0x10, 0x04, 0x2a, 0x1e, 0x52, 0x45, 0x53, - 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x2a, 0x1d, 0x52, 0x45, 0x53, - 0x4f, 0x4c, 0x56, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x43, 0x4b, 0x32, 0x8c, 0x05, 0x0a, 0x0e, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, - 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x12, 0x31, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x78, 0x0a, 0x0c, 0x47, 0x65, - 0x74, 0x47, 0x6f, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x30, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x6f, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x6f, - 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x66, - 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x77, 0x69, 0x66, 0x74, 0x56, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x77, 0x69, 0x66, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x61, - 0x76, 0x65, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x4d, 0x61, 0x76, 0x65, 0x6e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x7b, 0x0a, 0x0d, - 0x47, 0x65, 0x74, 0x4e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4e, - 0x50, 0x4d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4e, 0x50, 0x4d, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x32, 0xa2, 0x01, 0x0a, 0x13, 0x4c, 0x6f, - 0x63, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, - 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x69, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x99, - 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x42, 0x0c, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, - 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, - 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, - 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, - 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescData = file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_resolve_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_buf_alpha_registry_v1alpha1_resolve_proto_goTypes = []interface{}{ - (ResolvedReferenceType)(0), // 0: buf.alpha.registry.v1alpha1.ResolvedReferenceType - (*GetModulePinsRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetModulePinsRequest - (*GetModulePinsResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetModulePinsResponse - (*GetLocalModulePinsRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest - (*LocalModuleResolveResult)(nil), // 4: buf.alpha.registry.v1alpha1.LocalModuleResolveResult - (*GetLocalModulePinsResponse)(nil), // 5: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse - (*GetGoVersionRequest)(nil), // 6: buf.alpha.registry.v1alpha1.GetGoVersionRequest - (*GetGoVersionResponse)(nil), // 7: buf.alpha.registry.v1alpha1.GetGoVersionResponse - (*GetMavenVersionRequest)(nil), // 8: buf.alpha.registry.v1alpha1.GetMavenVersionRequest - (*GetMavenVersionResponse)(nil), // 9: buf.alpha.registry.v1alpha1.GetMavenVersionResponse - (*GetNPMVersionRequest)(nil), // 10: buf.alpha.registry.v1alpha1.GetNPMVersionRequest - (*GetNPMVersionResponse)(nil), // 11: buf.alpha.registry.v1alpha1.GetNPMVersionResponse - (*GetSwiftVersionRequest)(nil), // 12: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest - (*GetSwiftVersionResponse)(nil), // 13: buf.alpha.registry.v1alpha1.GetSwiftVersionResponse - (*GetRemotePackageVersionPlugin)(nil), // 14: buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin - (*v1alpha1.ModuleReference)(nil), // 15: buf.alpha.module.v1alpha1.ModuleReference - (*v1alpha1.ModulePin)(nil), // 16: buf.alpha.module.v1alpha1.ModulePin - (*LocalModuleReference)(nil), // 17: buf.alpha.registry.v1alpha1.LocalModuleReference - (*LocalModulePin)(nil), // 18: buf.alpha.registry.v1alpha1.LocalModulePin -} -var file_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs = []int32{ - 15, // 0: buf.alpha.registry.v1alpha1.GetModulePinsRequest.module_references:type_name -> buf.alpha.module.v1alpha1.ModuleReference - 16, // 1: buf.alpha.registry.v1alpha1.GetModulePinsRequest.current_module_pins:type_name -> buf.alpha.module.v1alpha1.ModulePin - 16, // 2: buf.alpha.registry.v1alpha1.GetModulePinsResponse.module_pins:type_name -> buf.alpha.module.v1alpha1.ModulePin - 17, // 3: buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest.local_module_references:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 17, // 4: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 18, // 5: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.pin:type_name -> buf.alpha.registry.v1alpha1.LocalModulePin - 0, // 6: buf.alpha.registry.v1alpha1.LocalModuleResolveResult.resolved_reference_type:type_name -> buf.alpha.registry.v1alpha1.ResolvedReferenceType - 4, // 7: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse.local_module_resolve_results:type_name -> buf.alpha.registry.v1alpha1.LocalModuleResolveResult - 16, // 8: buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse.dependencies:type_name -> buf.alpha.module.v1alpha1.ModulePin - 14, // 9: buf.alpha.registry.v1alpha1.GetGoVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin - 17, // 10: buf.alpha.registry.v1alpha1.GetGoVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 14, // 11: buf.alpha.registry.v1alpha1.GetMavenVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin - 17, // 12: buf.alpha.registry.v1alpha1.GetMavenVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 14, // 13: buf.alpha.registry.v1alpha1.GetNPMVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin - 17, // 14: buf.alpha.registry.v1alpha1.GetNPMVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 14, // 15: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest.plugin_reference:type_name -> buf.alpha.registry.v1alpha1.GetRemotePackageVersionPlugin - 17, // 16: buf.alpha.registry.v1alpha1.GetSwiftVersionRequest.module_reference:type_name -> buf.alpha.registry.v1alpha1.LocalModuleReference - 1, // 17: buf.alpha.registry.v1alpha1.ResolveService.GetModulePins:input_type -> buf.alpha.registry.v1alpha1.GetModulePinsRequest - 6, // 18: buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion:input_type -> buf.alpha.registry.v1alpha1.GetGoVersionRequest - 12, // 19: buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion:input_type -> buf.alpha.registry.v1alpha1.GetSwiftVersionRequest - 8, // 20: buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion:input_type -> buf.alpha.registry.v1alpha1.GetMavenVersionRequest - 10, // 21: buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion:input_type -> buf.alpha.registry.v1alpha1.GetNPMVersionRequest - 3, // 22: buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins:input_type -> buf.alpha.registry.v1alpha1.GetLocalModulePinsRequest - 2, // 23: buf.alpha.registry.v1alpha1.ResolveService.GetModulePins:output_type -> buf.alpha.registry.v1alpha1.GetModulePinsResponse - 7, // 24: buf.alpha.registry.v1alpha1.ResolveService.GetGoVersion:output_type -> buf.alpha.registry.v1alpha1.GetGoVersionResponse - 13, // 25: buf.alpha.registry.v1alpha1.ResolveService.GetSwiftVersion:output_type -> buf.alpha.registry.v1alpha1.GetSwiftVersionResponse - 9, // 26: buf.alpha.registry.v1alpha1.ResolveService.GetMavenVersion:output_type -> buf.alpha.registry.v1alpha1.GetMavenVersionResponse - 11, // 27: buf.alpha.registry.v1alpha1.ResolveService.GetNPMVersion:output_type -> buf.alpha.registry.v1alpha1.GetNPMVersionResponse - 5, // 28: buf.alpha.registry.v1alpha1.LocalResolveService.GetLocalModulePins:output_type -> buf.alpha.registry.v1alpha1.GetLocalModulePinsResponse - 23, // [23:29] is the sub-list for method output_type - 17, // [17:23] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_resolve_proto_init() } -func file_buf_alpha_registry_v1alpha1_resolve_proto_init() { - if File_buf_alpha_registry_v1alpha1_resolve_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_module_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModulePinsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetModulePinsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLocalModulePinsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalModuleResolveResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLocalModulePinsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGoVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGoVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMavenVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMavenVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNPMVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetNPMVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSwiftVersionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSwiftVersionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRemotePackageVersionPlugin); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc, - NumEnums: 1, - NumMessages: 14, - NumExtensions: 0, - NumServices: 2, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_resolve_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_resolve_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_resolve_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_resolve_proto = out.File - file_buf_alpha_registry_v1alpha1_resolve_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_resolve_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_resolve_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resource.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resource.pb.go deleted file mode 100644 index 2a1a8a1bce..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/resource.pb.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/resource.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Resource struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Resource: - // - // *Resource_Repository - // *Resource_Plugin - Resource isResource_Resource `protobuf_oneof:"resource"` -} - -func (x *Resource) Reset() { - *x = Resource{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Resource) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Resource) ProtoMessage() {} - -func (x *Resource) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Resource.ProtoReflect.Descriptor instead. -func (*Resource) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resource_proto_rawDescGZIP(), []int{0} -} - -func (m *Resource) GetResource() isResource_Resource { - if m != nil { - return m.Resource - } - return nil -} - -func (x *Resource) GetRepository() *Repository { - if x, ok := x.GetResource().(*Resource_Repository); ok { - return x.Repository - } - return nil -} - -func (x *Resource) GetPlugin() *CuratedPlugin { - if x, ok := x.GetResource().(*Resource_Plugin); ok { - return x.Plugin - } - return nil -} - -type isResource_Resource interface { - isResource_Resource() -} - -type Resource_Repository struct { - Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3,oneof"` -} - -type Resource_Plugin struct { - Plugin *CuratedPlugin `protobuf:"bytes,2,opt,name=plugin,proto3,oneof"` -} - -func (*Resource_Repository) isResource_Resource() {} - -func (*Resource_Plugin) isResource_Resource() {} - -type GetResourceByNameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Owner of the requested resource. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // Name of the requested resource. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *GetResourceByNameRequest) Reset() { - *x = GetResourceByNameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourceByNameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourceByNameRequest) ProtoMessage() {} - -func (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourceByNameRequest.ProtoReflect.Descriptor instead. -func (*GetResourceByNameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resource_proto_rawDescGZIP(), []int{1} -} - -func (x *GetResourceByNameRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetResourceByNameRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type GetResourceByNameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` -} - -func (x *GetResourceByNameResponse) Reset() { - *x = GetResourceByNameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetResourceByNameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetResourceByNameResponse) ProtoMessage() {} - -func (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetResourceByNameResponse.ProtoReflect.Descriptor instead. -func (*GetResourceByNameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_resource_proto_rawDescGZIP(), []int{2} -} - -func (x *GetResourceByNameResponse) GetResource() *Resource { - if x != nil { - return x.Resource - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_resource_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc = []byte{ - 0x0a, 0x2a, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x31, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5f, 0x63, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2c, 0x62, 0x75, - 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa7, 0x01, 0x0a, 0x08, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x49, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x44, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x48, 0x00, - 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x42, 0x0a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x22, 0x44, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x19, 0x47, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x9b, 0x01, 0x0a, 0x0f, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x87, - 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x9a, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0d, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_resource_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_resource_proto_rawDescData = file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_resource_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_resource_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_resource_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_resource_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_resource_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_buf_alpha_registry_v1alpha1_resource_proto_goTypes = []interface{}{ - (*Resource)(nil), // 0: buf.alpha.registry.v1alpha1.Resource - (*GetResourceByNameRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetResourceByNameRequest - (*GetResourceByNameResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetResourceByNameResponse - (*Repository)(nil), // 3: buf.alpha.registry.v1alpha1.Repository - (*CuratedPlugin)(nil), // 4: buf.alpha.registry.v1alpha1.CuratedPlugin -} -var file_buf_alpha_registry_v1alpha1_resource_proto_depIdxs = []int32{ - 3, // 0: buf.alpha.registry.v1alpha1.Resource.repository:type_name -> buf.alpha.registry.v1alpha1.Repository - 4, // 1: buf.alpha.registry.v1alpha1.Resource.plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPlugin - 0, // 2: buf.alpha.registry.v1alpha1.GetResourceByNameResponse.resource:type_name -> buf.alpha.registry.v1alpha1.Resource - 1, // 3: buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName:input_type -> buf.alpha.registry.v1alpha1.GetResourceByNameRequest - 2, // 4: buf.alpha.registry.v1alpha1.ResourceService.GetResourceByName:output_type -> buf.alpha.registry.v1alpha1.GetResourceByNameResponse - 4, // [4:5] is the sub-list for method output_type - 3, // [3:4] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_resource_proto_init() } -func file_buf_alpha_registry_v1alpha1_resource_proto_init() { - if File_buf_alpha_registry_v1alpha1_resource_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_plugin_curation_proto_init() - file_buf_alpha_registry_v1alpha1_repository_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Resource); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*Resource_Repository)(nil), - (*Resource_Plugin)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_resource_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_resource_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_resource_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_resource_proto = out.File - file_buf_alpha_registry_v1alpha1_resource_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_resource_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_resource_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/role.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/role.pb.go deleted file mode 100644 index 3f1a418c80..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/role.pb.go +++ /dev/null @@ -1,509 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/role.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The roles that users can have in a Server. -type ServerRole int32 - -const ( - ServerRole_SERVER_ROLE_UNSPECIFIED ServerRole = 0 - ServerRole_SERVER_ROLE_ADMIN ServerRole = 1 - ServerRole_SERVER_ROLE_MEMBER ServerRole = 2 -) - -// Enum value maps for ServerRole. -var ( - ServerRole_name = map[int32]string{ - 0: "SERVER_ROLE_UNSPECIFIED", - 1: "SERVER_ROLE_ADMIN", - 2: "SERVER_ROLE_MEMBER", - } - ServerRole_value = map[string]int32{ - "SERVER_ROLE_UNSPECIFIED": 0, - "SERVER_ROLE_ADMIN": 1, - "SERVER_ROLE_MEMBER": 2, - } -) - -func (x ServerRole) Enum() *ServerRole { - p := new(ServerRole) - *p = x - return p -} - -func (x ServerRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (ServerRole) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[0].Descriptor() -} - -func (ServerRole) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[0] -} - -func (x ServerRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use ServerRole.Descriptor instead. -func (ServerRole) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{0} -} - -// The roles that users can have in a Organization. -type OrganizationRole int32 - -const ( - OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED OrganizationRole = 0 - OrganizationRole_ORGANIZATION_ROLE_OWNER OrganizationRole = 1 - OrganizationRole_ORGANIZATION_ROLE_ADMIN OrganizationRole = 2 - OrganizationRole_ORGANIZATION_ROLE_MEMBER OrganizationRole = 3 - OrganizationRole_ORGANIZATION_ROLE_MACHINE OrganizationRole = 4 -) - -// Enum value maps for OrganizationRole. -var ( - OrganizationRole_name = map[int32]string{ - 0: "ORGANIZATION_ROLE_UNSPECIFIED", - 1: "ORGANIZATION_ROLE_OWNER", - 2: "ORGANIZATION_ROLE_ADMIN", - 3: "ORGANIZATION_ROLE_MEMBER", - 4: "ORGANIZATION_ROLE_MACHINE", - } - OrganizationRole_value = map[string]int32{ - "ORGANIZATION_ROLE_UNSPECIFIED": 0, - "ORGANIZATION_ROLE_OWNER": 1, - "ORGANIZATION_ROLE_ADMIN": 2, - "ORGANIZATION_ROLE_MEMBER": 3, - "ORGANIZATION_ROLE_MACHINE": 4, - } -) - -func (x OrganizationRole) Enum() *OrganizationRole { - p := new(OrganizationRole) - *p = x - return p -} - -func (x OrganizationRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OrganizationRole) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[1].Descriptor() -} - -func (OrganizationRole) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[1] -} - -func (x OrganizationRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OrganizationRole.Descriptor instead. -func (OrganizationRole) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{1} -} - -// The source of a user's role in an Organization. -type OrganizationRoleSource int32 - -const ( - OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_UNSPECIFIED OrganizationRoleSource = 0 - OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_DIRECT OrganizationRoleSource = 1 - OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_JIT OrganizationRoleSource = 2 - OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_IDP_GROUP OrganizationRoleSource = 3 -) - -// Enum value maps for OrganizationRoleSource. -var ( - OrganizationRoleSource_name = map[int32]string{ - 0: "ORGANIZATION_ROLE_SOURCE_UNSPECIFIED", - 1: "ORGANIZATION_ROLE_SOURCE_DIRECT", - 2: "ORGANIZATION_ROLE_SOURCE_JIT", - 3: "ORGANIZATION_ROLE_SOURCE_IDP_GROUP", - } - OrganizationRoleSource_value = map[string]int32{ - "ORGANIZATION_ROLE_SOURCE_UNSPECIFIED": 0, - "ORGANIZATION_ROLE_SOURCE_DIRECT": 1, - "ORGANIZATION_ROLE_SOURCE_JIT": 2, - "ORGANIZATION_ROLE_SOURCE_IDP_GROUP": 3, - } -) - -func (x OrganizationRoleSource) Enum() *OrganizationRoleSource { - p := new(OrganizationRoleSource) - *p = x - return p -} - -func (x OrganizationRoleSource) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OrganizationRoleSource) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[2].Descriptor() -} - -func (OrganizationRoleSource) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[2] -} - -func (x OrganizationRoleSource) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OrganizationRoleSource.Descriptor instead. -func (OrganizationRoleSource) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{2} -} - -// The roles that users can have for a Repository. -type RepositoryRole int32 - -const ( - RepositoryRole_REPOSITORY_ROLE_UNSPECIFIED RepositoryRole = 0 - RepositoryRole_REPOSITORY_ROLE_OWNER RepositoryRole = 1 - RepositoryRole_REPOSITORY_ROLE_ADMIN RepositoryRole = 2 - RepositoryRole_REPOSITORY_ROLE_WRITE RepositoryRole = 3 - RepositoryRole_REPOSITORY_ROLE_READ RepositoryRole = 4 - RepositoryRole_REPOSITORY_ROLE_LIMITED_WRITE RepositoryRole = 5 -) - -// Enum value maps for RepositoryRole. -var ( - RepositoryRole_name = map[int32]string{ - 0: "REPOSITORY_ROLE_UNSPECIFIED", - 1: "REPOSITORY_ROLE_OWNER", - 2: "REPOSITORY_ROLE_ADMIN", - 3: "REPOSITORY_ROLE_WRITE", - 4: "REPOSITORY_ROLE_READ", - 5: "REPOSITORY_ROLE_LIMITED_WRITE", - } - RepositoryRole_value = map[string]int32{ - "REPOSITORY_ROLE_UNSPECIFIED": 0, - "REPOSITORY_ROLE_OWNER": 1, - "REPOSITORY_ROLE_ADMIN": 2, - "REPOSITORY_ROLE_WRITE": 3, - "REPOSITORY_ROLE_READ": 4, - "REPOSITORY_ROLE_LIMITED_WRITE": 5, - } -) - -func (x RepositoryRole) Enum() *RepositoryRole { - p := new(RepositoryRole) - *p = x - return p -} - -func (x RepositoryRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (RepositoryRole) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[3].Descriptor() -} - -func (RepositoryRole) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[3] -} - -func (x RepositoryRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use RepositoryRole.Descriptor instead. -func (RepositoryRole) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{3} -} - -// The roles that users can have for a Template. -// -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/role.proto. -type TemplateRole int32 - -const ( - TemplateRole_TEMPLATE_ROLE_UNSPECIFIED TemplateRole = 0 - TemplateRole_TEMPLATE_ROLE_OWNER TemplateRole = 1 - TemplateRole_TEMPLATE_ROLE_ADMIN TemplateRole = 2 - TemplateRole_TEMPLATE_ROLE_WRITE TemplateRole = 3 - TemplateRole_TEMPLATE_ROLE_READ TemplateRole = 4 -) - -// Enum value maps for TemplateRole. -var ( - TemplateRole_name = map[int32]string{ - 0: "TEMPLATE_ROLE_UNSPECIFIED", - 1: "TEMPLATE_ROLE_OWNER", - 2: "TEMPLATE_ROLE_ADMIN", - 3: "TEMPLATE_ROLE_WRITE", - 4: "TEMPLATE_ROLE_READ", - } - TemplateRole_value = map[string]int32{ - "TEMPLATE_ROLE_UNSPECIFIED": 0, - "TEMPLATE_ROLE_OWNER": 1, - "TEMPLATE_ROLE_ADMIN": 2, - "TEMPLATE_ROLE_WRITE": 3, - "TEMPLATE_ROLE_READ": 4, - } -) - -func (x TemplateRole) Enum() *TemplateRole { - p := new(TemplateRole) - *p = x - return p -} - -func (x TemplateRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TemplateRole) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[4].Descriptor() -} - -func (TemplateRole) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[4] -} - -func (x TemplateRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TemplateRole.Descriptor instead. -func (TemplateRole) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{4} -} - -// The roles that users can have for a Plugin. -// -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/role.proto. -type PluginRole int32 - -const ( - PluginRole_PLUGIN_ROLE_UNSPECIFIED PluginRole = 0 - PluginRole_PLUGIN_ROLE_OWNER PluginRole = 1 - PluginRole_PLUGIN_ROLE_ADMIN PluginRole = 2 - PluginRole_PLUGIN_ROLE_WRITE PluginRole = 3 - PluginRole_PLUGIN_ROLE_READ PluginRole = 4 -) - -// Enum value maps for PluginRole. -var ( - PluginRole_name = map[int32]string{ - 0: "PLUGIN_ROLE_UNSPECIFIED", - 1: "PLUGIN_ROLE_OWNER", - 2: "PLUGIN_ROLE_ADMIN", - 3: "PLUGIN_ROLE_WRITE", - 4: "PLUGIN_ROLE_READ", - } - PluginRole_value = map[string]int32{ - "PLUGIN_ROLE_UNSPECIFIED": 0, - "PLUGIN_ROLE_OWNER": 1, - "PLUGIN_ROLE_ADMIN": 2, - "PLUGIN_ROLE_WRITE": 3, - "PLUGIN_ROLE_READ": 4, - } -) - -func (x PluginRole) Enum() *PluginRole { - p := new(PluginRole) - *p = x - return p -} - -func (x PluginRole) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (PluginRole) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[5].Descriptor() -} - -func (PluginRole) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_role_proto_enumTypes[5] -} - -func (x PluginRole) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use PluginRole.Descriptor instead. -func (PluginRole) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP(), []int{5} -} - -var File_buf_alpha_registry_v1alpha1_role_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_role_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x6f, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2a, 0x58, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x6f, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x52, 0x4f, - 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x15, 0x0a, 0x11, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, - 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x45, 0x52, 0x56, 0x45, - 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x2a, - 0xac, 0x01, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x21, 0x0a, 0x1d, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x52, 0x47, 0x41, 0x4e, - 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x57, 0x4e, - 0x45, 0x52, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, - 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x03, 0x12, - 0x1d, 0x0a, 0x19, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x48, 0x49, 0x4e, 0x45, 0x10, 0x04, 0x2a, 0xb1, - 0x01, 0x0a, 0x16, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x6f, 0x6c, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x24, 0x4f, 0x52, 0x47, - 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x53, - 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, - 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x4f, 0x52, 0x47, 0x41, - 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x53, 0x4f, - 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4a, 0x49, 0x54, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x4f, 0x52, - 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, - 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x49, 0x44, 0x50, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, - 0x10, 0x03, 0x2a, 0xbf, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, - 0x4f, 0x52, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, - 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, - 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, - 0x01, 0x12, 0x19, 0x0a, 0x15, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, - 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, - 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x18, 0x0a, 0x14, 0x52, 0x45, 0x50, 0x4f, 0x53, - 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, - 0x04, 0x12, 0x21, 0x0a, 0x1d, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, 0x59, 0x5f, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x5f, 0x57, 0x52, 0x49, - 0x54, 0x45, 0x10, 0x05, 0x2a, 0x94, 0x01, 0x0a, 0x0c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, - 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, - 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x17, 0x0a, - 0x13, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, - 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, - 0x54, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, - 0x16, 0x0a, 0x12, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x4f, 0x4c, 0x45, - 0x5f, 0x52, 0x45, 0x41, 0x44, 0x10, 0x04, 0x1a, 0x02, 0x18, 0x01, 0x2a, 0x88, 0x01, 0x0a, 0x0a, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x4c, - 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x4c, 0x55, 0x47, 0x49, - 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x15, - 0x0a, 0x11, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x44, - 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, - 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, - 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x52, 0x45, 0x41, 0x44, - 0x10, 0x04, 0x1a, 0x02, 0x18, 0x01, 0x42, 0x96, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x09, 0x52, 0x6f, 0x6c, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_role_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_role_proto_rawDescData = file_buf_alpha_registry_v1alpha1_role_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_role_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_role_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_role_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_role_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_role_proto_enumTypes = make([]protoimpl.EnumInfo, 6) -var file_buf_alpha_registry_v1alpha1_role_proto_goTypes = []interface{}{ - (ServerRole)(0), // 0: buf.alpha.registry.v1alpha1.ServerRole - (OrganizationRole)(0), // 1: buf.alpha.registry.v1alpha1.OrganizationRole - (OrganizationRoleSource)(0), // 2: buf.alpha.registry.v1alpha1.OrganizationRoleSource - (RepositoryRole)(0), // 3: buf.alpha.registry.v1alpha1.RepositoryRole - (TemplateRole)(0), // 4: buf.alpha.registry.v1alpha1.TemplateRole - (PluginRole)(0), // 5: buf.alpha.registry.v1alpha1.PluginRole -} -var file_buf_alpha_registry_v1alpha1_role_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_role_proto_init() } -func file_buf_alpha_registry_v1alpha1_role_proto_init() { - if File_buf_alpha_registry_v1alpha1_role_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_role_proto_rawDesc, - NumEnums: 6, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_role_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_role_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_role_proto_enumTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_role_proto = out.File - file_buf_alpha_registry_v1alpha1_role_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_role_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_role_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/schema.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/schema.pb.go deleted file mode 100644 index 041bb86d53..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/schema.pb.go +++ /dev/null @@ -1,945 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/schema.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Format int32 - -const ( - Format_FORMAT_UNSPECIFIED Format = 0 - Format_FORMAT_BINARY Format = 1 - Format_FORMAT_JSON Format = 2 - Format_FORMAT_TEXT Format = 3 -) - -// Enum value maps for Format. -var ( - Format_name = map[int32]string{ - 0: "FORMAT_UNSPECIFIED", - 1: "FORMAT_BINARY", - 2: "FORMAT_JSON", - 3: "FORMAT_TEXT", - } - Format_value = map[string]int32{ - "FORMAT_UNSPECIFIED": 0, - "FORMAT_BINARY": 1, - "FORMAT_JSON": 2, - "FORMAT_TEXT": 3, - } -) - -func (x Format) Enum() *Format { - p := new(Format) - *p = x - return p -} - -func (x Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Format) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes[0].Descriptor() -} - -func (Format) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes[0] -} - -func (x Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Format.Descriptor instead. -func (Format) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{0} -} - -type GetSchemaRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repo that contains the schema to retrieve (a user name or - // organization name). - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the repo that contains the schema to retrieve. - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Optional version of the repo. If unspecified, defaults to latest version on - // the repo's "main" branch. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // Zero or more types names. The names may refer to messages, enums, services, - // methods, or extensions. All names must be fully-qualified. If any name - // is unknown, the request will fail and no schema will be returned. - // - // If no names are provided, the full schema for the module is returned. - // Otherwise, the resulting schema contains only the named elements and all of - // their dependencies. This is enough information for the caller to construct - // a dynamic message for any requested message types or to dynamically invoke - // an RPC for any requested methods or services. - Types []string `protobuf:"bytes,4,rep,name=types,proto3" json:"types,omitempty"` - // If present, this is a commit that the client already has cached. So if the - // given module version resolves to this same commit, the server should not - // send back any descriptors since the client already has them. - // - // This allows a client to efficiently poll for updates: after the initial RPC - // to get a schema, the client can cache the descriptors and the resolved - // commit. It then includes that commit in subsequent requests in this field, - // and the server will only reply with a schema (and new commit) if/when the - // resolved commit changes. - IfNotCommit string `protobuf:"bytes,5,opt,name=if_not_commit,json=ifNotCommit,proto3" json:"if_not_commit,omitempty"` - // If true, the returned schema will not include extension definitions for custom - // options that appear on schema elements. When filtering the schema based on the - // given element names, options on all encountered elements are usually examined - // as well. But that is not the case if excluding custom options. - // - // This flag is ignored if element_names is empty as the entire schema is always - // returned in that case. - ExcludeCustomOptions bool `protobuf:"varint,6,opt,name=exclude_custom_options,json=excludeCustomOptions,proto3" json:"exclude_custom_options,omitempty"` - // If true, the returned schema will not include known extensions for extendable - // messages for schema elements. If exclude_custom_options is true, such extensions - // may still be returned if the applicable descriptor options type is part of the - // requested schema. - // - // This flag is ignored if element_names is empty as the entire schema is always - // returned in that case. - ExcludeKnownExtensions bool `protobuf:"varint,7,opt,name=exclude_known_extensions,json=excludeKnownExtensions,proto3" json:"exclude_known_extensions,omitempty"` -} - -func (x *GetSchemaRequest) Reset() { - *x = GetSchemaRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSchemaRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSchemaRequest) ProtoMessage() {} - -func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSchemaRequest.ProtoReflect.Descriptor instead. -func (*GetSchemaRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{0} -} - -func (x *GetSchemaRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetSchemaRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetSchemaRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *GetSchemaRequest) GetTypes() []string { - if x != nil { - return x.Types - } - return nil -} - -func (x *GetSchemaRequest) GetIfNotCommit() string { - if x != nil { - return x.IfNotCommit - } - return "" -} - -func (x *GetSchemaRequest) GetExcludeCustomOptions() bool { - if x != nil { - return x.ExcludeCustomOptions - } - return false -} - -func (x *GetSchemaRequest) GetExcludeKnownExtensions() bool { - if x != nil { - return x.ExcludeKnownExtensions - } - return false -} - -type GetSchemaResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resolved version of the schema. If the requested version was a commit, - // this value is the same as that. If the requested version referred to a tag - // or branch, this is the commit for that tag or latest commit for that - // branch. If the request did not include any version, this is the latest - // version for the module's main branch. - Commit string `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` - // The schema, which is a set of file descriptors that include the requested elements - // and their dependencies. - SchemaFiles *descriptorpb.FileDescriptorSet `protobuf:"bytes,2,opt,name=schema_files,json=schemaFiles,proto3" json:"schema_files,omitempty"` -} - -func (x *GetSchemaResponse) Reset() { - *x = GetSchemaResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetSchemaResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetSchemaResponse) ProtoMessage() {} - -func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetSchemaResponse.ProtoReflect.Descriptor instead. -func (*GetSchemaResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{1} -} - -func (x *GetSchemaResponse) GetCommit() string { - if x != nil { - return x.Commit - } - return "" -} - -func (x *GetSchemaResponse) GetSchemaFiles() *descriptorpb.FileDescriptorSet { - if x != nil { - return x.SchemaFiles - } - return nil -} - -type ConvertMessageRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repo that contains the schema to retrieve (a user name or - // organization name). - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // The name of the repo that contains the schema to retrieve. - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Optional version of the repo. This can be a tag or branch name or a commit. - // If unspecified, defaults to latest version on the repo's "main" branch. - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` - // The fully-qualified name of the message. Required. - MessageName string `protobuf:"bytes,4,opt,name=message_name,json=messageName,proto3" json:"message_name,omitempty"` - // The format of the input data. Required. - InputFormat Format `protobuf:"varint,5,opt,name=input_format,json=inputFormat,proto3,enum=buf.alpha.registry.v1alpha1.Format" json:"input_format,omitempty"` - // The input data that is to be converted. Required. This must be - // a valid encoding of type indicated by message_name in the format - // indicated by input_format. - InputData []byte `protobuf:"bytes,6,opt,name=input_data,json=inputData,proto3" json:"input_data,omitempty"` - // If true, any unresolvable fields in the input are discarded. For - // formats other than FORMAT_BINARY, this means that the operation - // will fail if the input contains unrecognized field names. For - // FORMAT_BINARY, unrecognized fields can be retained and possibly - // included in the reformatted output (depending on the requested - // output format). - DiscardUnknown bool `protobuf:"varint,7,opt,name=discard_unknown,json=discardUnknown,proto3" json:"discard_unknown,omitempty"` - // Types that are assignable to OutputFormat: - // - // *ConvertMessageRequest_OutputBinary - // *ConvertMessageRequest_OutputJson - // *ConvertMessageRequest_OutputText - OutputFormat isConvertMessageRequest_OutputFormat `protobuf_oneof:"output_format"` -} - -func (x *ConvertMessageRequest) Reset() { - *x = ConvertMessageRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConvertMessageRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConvertMessageRequest) ProtoMessage() {} - -func (x *ConvertMessageRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConvertMessageRequest.ProtoReflect.Descriptor instead. -func (*ConvertMessageRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{2} -} - -func (x *ConvertMessageRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *ConvertMessageRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *ConvertMessageRequest) GetVersion() string { - if x != nil { - return x.Version - } - return "" -} - -func (x *ConvertMessageRequest) GetMessageName() string { - if x != nil { - return x.MessageName - } - return "" -} - -func (x *ConvertMessageRequest) GetInputFormat() Format { - if x != nil { - return x.InputFormat - } - return Format_FORMAT_UNSPECIFIED -} - -func (x *ConvertMessageRequest) GetInputData() []byte { - if x != nil { - return x.InputData - } - return nil -} - -func (x *ConvertMessageRequest) GetDiscardUnknown() bool { - if x != nil { - return x.DiscardUnknown - } - return false -} - -func (m *ConvertMessageRequest) GetOutputFormat() isConvertMessageRequest_OutputFormat { - if m != nil { - return m.OutputFormat - } - return nil -} - -func (x *ConvertMessageRequest) GetOutputBinary() *BinaryOutputOptions { - if x, ok := x.GetOutputFormat().(*ConvertMessageRequest_OutputBinary); ok { - return x.OutputBinary - } - return nil -} - -func (x *ConvertMessageRequest) GetOutputJson() *JSONOutputOptions { - if x, ok := x.GetOutputFormat().(*ConvertMessageRequest_OutputJson); ok { - return x.OutputJson - } - return nil -} - -func (x *ConvertMessageRequest) GetOutputText() *TextOutputOptions { - if x, ok := x.GetOutputFormat().(*ConvertMessageRequest_OutputText); ok { - return x.OutputText - } - return nil -} - -type isConvertMessageRequest_OutputFormat interface { - isConvertMessageRequest_OutputFormat() -} - -type ConvertMessageRequest_OutputBinary struct { - OutputBinary *BinaryOutputOptions `protobuf:"bytes,8,opt,name=output_binary,json=outputBinary,proto3,oneof"` -} - -type ConvertMessageRequest_OutputJson struct { - OutputJson *JSONOutputOptions `protobuf:"bytes,9,opt,name=output_json,json=outputJson,proto3,oneof"` -} - -type ConvertMessageRequest_OutputText struct { - OutputText *TextOutputOptions `protobuf:"bytes,10,opt,name=output_text,json=outputText,proto3,oneof"` -} - -func (*ConvertMessageRequest_OutputBinary) isConvertMessageRequest_OutputFormat() {} - -func (*ConvertMessageRequest_OutputJson) isConvertMessageRequest_OutputFormat() {} - -func (*ConvertMessageRequest_OutputText) isConvertMessageRequest_OutputFormat() {} - -type BinaryOutputOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *BinaryOutputOptions) Reset() { - *x = BinaryOutputOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BinaryOutputOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BinaryOutputOptions) ProtoMessage() {} - -func (x *BinaryOutputOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BinaryOutputOptions.ProtoReflect.Descriptor instead. -func (*BinaryOutputOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{3} -} - -type JSONOutputOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Enum fields will be emitted as numeric values. If false (the dafault), enum - // fields are emitted as strings that are the enum values' names. - UseEnumNumbers bool `protobuf:"varint,3,opt,name=use_enum_numbers,json=useEnumNumbers,proto3" json:"use_enum_numbers,omitempty"` - // Includes fields that have their default values. This applies only to fields - // defined in proto3 syntax that have no explicit "optional" keyword. Other - // optional fields will be included if present in the input data. - IncludeDefaults bool `protobuf:"varint,4,opt,name=include_defaults,json=includeDefaults,proto3" json:"include_defaults,omitempty"` -} - -func (x *JSONOutputOptions) Reset() { - *x = JSONOutputOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *JSONOutputOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*JSONOutputOptions) ProtoMessage() {} - -func (x *JSONOutputOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use JSONOutputOptions.ProtoReflect.Descriptor instead. -func (*JSONOutputOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{4} -} - -func (x *JSONOutputOptions) GetUseEnumNumbers() bool { - if x != nil { - return x.UseEnumNumbers - } - return false -} - -func (x *JSONOutputOptions) GetIncludeDefaults() bool { - if x != nil { - return x.IncludeDefaults - } - return false -} - -type TextOutputOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // If true and the input data includes unrecognized fields, the unrecognized - // fields will be preserved in the text output (using field numbers and raw - // values). - IncludeUnrecognized bool `protobuf:"varint,2,opt,name=include_unrecognized,json=includeUnrecognized,proto3" json:"include_unrecognized,omitempty"` -} - -func (x *TextOutputOptions) Reset() { - *x = TextOutputOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TextOutputOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TextOutputOptions) ProtoMessage() {} - -func (x *TextOutputOptions) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TextOutputOptions.ProtoReflect.Descriptor instead. -func (*TextOutputOptions) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{5} -} - -func (x *TextOutputOptions) GetIncludeUnrecognized() bool { - if x != nil { - return x.IncludeUnrecognized - } - return false -} - -type ConvertMessageResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The resolved version of the schema. If the requested version was a commit, - // this value is the same as that. If the requested version referred to a tag - // or branch, this is the commit for that tag or latest commit for that - // branch. If the request did not include any version, this is the latest - // version for the module's main branch. - Commit string `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"` - // The reformatted data. - OutputData []byte `protobuf:"bytes,2,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` -} - -func (x *ConvertMessageResponse) Reset() { - *x = ConvertMessageResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ConvertMessageResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ConvertMessageResponse) ProtoMessage() {} - -func (x *ConvertMessageResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ConvertMessageResponse.ProtoReflect.Descriptor instead. -func (*ConvertMessageResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP(), []int{6} -} - -func (x *ConvertMessageResponse) GetCommit() string { - if x != nil { - return x.Commit - } - return "" -} - -func (x *ConvertMessageResponse) GetOutputData() []byte { - if x != nil { - return x.OutputData - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_schema_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8c, 0x02, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x79, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x66, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x66, 0x4e, - 0x6f, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x34, 0x0a, 0x16, 0x65, 0x78, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, - 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x38, - 0x0a, 0x18, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x16, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x72, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x45, 0x0a, 0x0c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, - 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x52, - 0x0b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x22, 0xaa, 0x04, 0x0a, - 0x15, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x0c, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x23, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x46, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x52, 0x0b, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x44, 0x61, 0x74, 0x61, - 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x5f, 0x75, 0x6e, 0x6b, 0x6e, - 0x6f, 0x77, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x63, 0x61, - 0x72, 0x64, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x12, 0x57, 0x0a, 0x0d, 0x6f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x5f, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x69, 0x6e, 0x61, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x42, 0x69, 0x6e, 0x61, - 0x72, 0x79, 0x12, 0x51, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x6a, 0x73, 0x6f, - 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x4a, 0x73, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, - 0x74, 0x65, 0x78, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x78, 0x74, 0x4f, 0x75, 0x74, - 0x70, 0x75, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x75, - 0x74, 0x70, 0x75, 0x74, 0x54, 0x65, 0x78, 0x74, 0x42, 0x0f, 0x0a, 0x0d, 0x6f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x42, 0x69, 0x6e, - 0x61, 0x72, 0x79, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0x68, 0x0a, 0x11, 0x4a, 0x53, 0x4f, 0x4e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x0a, 0x10, 0x75, 0x73, 0x65, 0x5f, 0x65, 0x6e, 0x75, - 0x6d, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0e, 0x75, 0x73, 0x65, 0x45, 0x6e, 0x75, 0x6d, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, - 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, - 0x64, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x46, 0x0a, 0x11, 0x54, 0x65, - 0x78, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x31, 0x0a, 0x14, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, - 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x55, 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, - 0x65, 0x64, 0x22, 0x51, 0x0a, 0x16, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x44, 0x61, 0x74, 0x61, 0x2a, 0x55, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x46, 0x4f, 0x52, 0x4d, 0x41, - 0x54, 0x5f, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x46, 0x4f, - 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x46, - 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x03, 0x32, 0xfb, 0x01, 0x0a, - 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6f, - 0x0a, 0x09, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x12, 0x2d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, - 0x79, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, - 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, - 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_schema_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_schema_proto_rawDescData = file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_schema_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_schema_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_schema_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_schema_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_schema_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_buf_alpha_registry_v1alpha1_schema_proto_goTypes = []interface{}{ - (Format)(0), // 0: buf.alpha.registry.v1alpha1.Format - (*GetSchemaRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetSchemaRequest - (*GetSchemaResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetSchemaResponse - (*ConvertMessageRequest)(nil), // 3: buf.alpha.registry.v1alpha1.ConvertMessageRequest - (*BinaryOutputOptions)(nil), // 4: buf.alpha.registry.v1alpha1.BinaryOutputOptions - (*JSONOutputOptions)(nil), // 5: buf.alpha.registry.v1alpha1.JSONOutputOptions - (*TextOutputOptions)(nil), // 6: buf.alpha.registry.v1alpha1.TextOutputOptions - (*ConvertMessageResponse)(nil), // 7: buf.alpha.registry.v1alpha1.ConvertMessageResponse - (*descriptorpb.FileDescriptorSet)(nil), // 8: google.protobuf.FileDescriptorSet -} -var file_buf_alpha_registry_v1alpha1_schema_proto_depIdxs = []int32{ - 8, // 0: buf.alpha.registry.v1alpha1.GetSchemaResponse.schema_files:type_name -> google.protobuf.FileDescriptorSet - 0, // 1: buf.alpha.registry.v1alpha1.ConvertMessageRequest.input_format:type_name -> buf.alpha.registry.v1alpha1.Format - 4, // 2: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_binary:type_name -> buf.alpha.registry.v1alpha1.BinaryOutputOptions - 5, // 3: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_json:type_name -> buf.alpha.registry.v1alpha1.JSONOutputOptions - 6, // 4: buf.alpha.registry.v1alpha1.ConvertMessageRequest.output_text:type_name -> buf.alpha.registry.v1alpha1.TextOutputOptions - 1, // 5: buf.alpha.registry.v1alpha1.SchemaService.GetSchema:input_type -> buf.alpha.registry.v1alpha1.GetSchemaRequest - 3, // 6: buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage:input_type -> buf.alpha.registry.v1alpha1.ConvertMessageRequest - 2, // 7: buf.alpha.registry.v1alpha1.SchemaService.GetSchema:output_type -> buf.alpha.registry.v1alpha1.GetSchemaResponse - 7, // 8: buf.alpha.registry.v1alpha1.SchemaService.ConvertMessage:output_type -> buf.alpha.registry.v1alpha1.ConvertMessageResponse - 7, // [7:9] is the sub-list for method output_type - 5, // [5:7] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_schema_proto_init() } -func file_buf_alpha_registry_v1alpha1_schema_proto_init() { - if File_buf_alpha_registry_v1alpha1_schema_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemaRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemaResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConvertMessageRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BinaryOutputOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JSONOutputOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TextOutputOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConvertMessageResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ConvertMessageRequest_OutputBinary)(nil), - (*ConvertMessageRequest_OutputJson)(nil), - (*ConvertMessageRequest_OutputText)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc, - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_schema_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_schema_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_schema_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_schema_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_schema_proto = out.File - file_buf_alpha_registry_v1alpha1_schema_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_schema_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_schema_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/scim_token.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/scim_token.pb.go deleted file mode 100644 index 938520f47a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/scim_token.pb.go +++ /dev/null @@ -1,647 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/scim_token.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SCIMToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - ExpireTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` -} - -func (x *SCIMToken) Reset() { - *x = SCIMToken{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SCIMToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SCIMToken) ProtoMessage() {} - -func (x *SCIMToken) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SCIMToken.ProtoReflect.Descriptor instead. -func (*SCIMToken) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{0} -} - -func (x *SCIMToken) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *SCIMToken) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *SCIMToken) GetExpireTime() *timestamppb.Timestamp { - if x != nil { - return x.ExpireTime - } - return nil -} - -type CreateSCIMTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The time until which the token should be valid. - // Must be in the future. May be null for no expiry. - ExpireTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` -} - -func (x *CreateSCIMTokenRequest) Reset() { - *x = CreateSCIMTokenRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSCIMTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSCIMTokenRequest) ProtoMessage() {} - -func (x *CreateSCIMTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateSCIMTokenRequest.ProtoReflect.Descriptor instead. -func (*CreateSCIMTokenRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateSCIMTokenRequest) GetExpireTime() *timestamppb.Timestamp { - if x != nil { - return x.ExpireTime - } - return nil -} - -type CreateSCIMTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plaintext token to use for authentication. - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *CreateSCIMTokenResponse) Reset() { - *x = CreateSCIMTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateSCIMTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateSCIMTokenResponse) ProtoMessage() {} - -func (x *CreateSCIMTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateSCIMTokenResponse.ProtoReflect.Descriptor instead. -func (*CreateSCIMTokenResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateSCIMTokenResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type ListSCIMTokensRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListSCIMTokensRequest) Reset() { - *x = ListSCIMTokensRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSCIMTokensRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSCIMTokensRequest) ProtoMessage() {} - -func (x *ListSCIMTokensRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSCIMTokensRequest.ProtoReflect.Descriptor instead. -func (*ListSCIMTokensRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{3} -} - -func (x *ListSCIMTokensRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListSCIMTokensRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListSCIMTokensRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListSCIMTokensResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tokens []*SCIMToken `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListSCIMTokensResponse) Reset() { - *x = ListSCIMTokensResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListSCIMTokensResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListSCIMTokensResponse) ProtoMessage() {} - -func (x *ListSCIMTokensResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListSCIMTokensResponse.ProtoReflect.Descriptor instead. -func (*ListSCIMTokensResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{4} -} - -func (x *ListSCIMTokensResponse) GetTokens() []*SCIMToken { - if x != nil { - return x.Tokens - } - return nil -} - -func (x *ListSCIMTokensResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type DeleteSCIMTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TokenId string `protobuf:"bytes,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` -} - -func (x *DeleteSCIMTokenRequest) Reset() { - *x = DeleteSCIMTokenRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSCIMTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSCIMTokenRequest) ProtoMessage() {} - -func (x *DeleteSCIMTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteSCIMTokenRequest.ProtoReflect.Descriptor instead. -func (*DeleteSCIMTokenRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteSCIMTokenRequest) GetTokenId() string { - if x != nil { - return x.TokenId - } - return "" -} - -type DeleteSCIMTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteSCIMTokenResponse) Reset() { - *x = DeleteSCIMTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteSCIMTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteSCIMTokenResponse) ProtoMessage() {} - -func (x *DeleteSCIMTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteSCIMTokenResponse.ProtoReflect.Descriptor instead. -func (*DeleteSCIMTokenResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP(), []int{6} -} - -var File_buf_alpha_registry_v1alpha1_scim_token_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc = []byte{ - 0x0a, 0x2c, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x63, - 0x69, 0x6d, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, - 0x09, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x43, - 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3b, - 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x17, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x6d, 0x0a, 0x15, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x16, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x33, - 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x49, 0x64, 0x22, 0x19, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x43, 0x49, - 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x94, - 0x03, 0x0a, 0x10, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x43, 0x49, - 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x43, 0x49, 0x4d, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x7e, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x12, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x43, 0x49, 0x4d, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x43, 0x49, 0x4d, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x43, 0x49, 0x4d, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x9b, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0e, 0x53, 0x63, 0x69, 0x6d, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, - 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, - 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescData = file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes = []interface{}{ - (*SCIMToken)(nil), // 0: buf.alpha.registry.v1alpha1.SCIMToken - (*CreateSCIMTokenRequest)(nil), // 1: buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest - (*CreateSCIMTokenResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateSCIMTokenResponse - (*ListSCIMTokensRequest)(nil), // 3: buf.alpha.registry.v1alpha1.ListSCIMTokensRequest - (*ListSCIMTokensResponse)(nil), // 4: buf.alpha.registry.v1alpha1.ListSCIMTokensResponse - (*DeleteSCIMTokenRequest)(nil), // 5: buf.alpha.registry.v1alpha1.DeleteSCIMTokenRequest - (*DeleteSCIMTokenResponse)(nil), // 6: buf.alpha.registry.v1alpha1.DeleteSCIMTokenResponse - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs = []int32{ - 7, // 0: buf.alpha.registry.v1alpha1.SCIMToken.create_time:type_name -> google.protobuf.Timestamp - 7, // 1: buf.alpha.registry.v1alpha1.SCIMToken.expire_time:type_name -> google.protobuf.Timestamp - 7, // 2: buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest.expire_time:type_name -> google.protobuf.Timestamp - 0, // 3: buf.alpha.registry.v1alpha1.ListSCIMTokensResponse.tokens:type_name -> buf.alpha.registry.v1alpha1.SCIMToken - 1, // 4: buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken:input_type -> buf.alpha.registry.v1alpha1.CreateSCIMTokenRequest - 3, // 5: buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens:input_type -> buf.alpha.registry.v1alpha1.ListSCIMTokensRequest - 5, // 6: buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken:input_type -> buf.alpha.registry.v1alpha1.DeleteSCIMTokenRequest - 2, // 7: buf.alpha.registry.v1alpha1.SCIMTokenService.CreateSCIMToken:output_type -> buf.alpha.registry.v1alpha1.CreateSCIMTokenResponse - 4, // 8: buf.alpha.registry.v1alpha1.SCIMTokenService.ListSCIMTokens:output_type -> buf.alpha.registry.v1alpha1.ListSCIMTokensResponse - 6, // 9: buf.alpha.registry.v1alpha1.SCIMTokenService.DeleteSCIMToken:output_type -> buf.alpha.registry.v1alpha1.DeleteSCIMTokenResponse - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_scim_token_proto_init() } -func file_buf_alpha_registry_v1alpha1_scim_token_proto_init() { - if File_buf_alpha_registry_v1alpha1_scim_token_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SCIMToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSCIMTokenRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateSCIMTokenResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSCIMTokensRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListSCIMTokensResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSCIMTokenRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteSCIMTokenResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_scim_token_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_scim_token_proto = out.File - file_buf_alpha_registry_v1alpha1_scim_token_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_scim_token_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_scim_token_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/search.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/search.pb.go deleted file mode 100644 index d702c1e897..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/search.pb.go +++ /dev/null @@ -1,1787 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/search.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SearchFilter int32 - -const ( - SearchFilter_SEARCH_FILTER_UNSPECIFIED SearchFilter = 0 - SearchFilter_SEARCH_FILTER_USER SearchFilter = 1 - SearchFilter_SEARCH_FILTER_ORGANIZATION SearchFilter = 2 - SearchFilter_SEARCH_FILTER_REPOSITORY SearchFilter = 3 - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. - SearchFilter_SEARCH_FILTER_PLUGIN SearchFilter = 4 - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. - SearchFilter_SEARCH_FILTER_TEMPLATE SearchFilter = 5 - SearchFilter_SEARCH_FILTER_TEAM SearchFilter = 6 - SearchFilter_SEARCH_FILTER_CURATED_PLUGIN SearchFilter = 7 -) - -// Enum value maps for SearchFilter. -var ( - SearchFilter_name = map[int32]string{ - 0: "SEARCH_FILTER_UNSPECIFIED", - 1: "SEARCH_FILTER_USER", - 2: "SEARCH_FILTER_ORGANIZATION", - 3: "SEARCH_FILTER_REPOSITORY", - 4: "SEARCH_FILTER_PLUGIN", - 5: "SEARCH_FILTER_TEMPLATE", - 6: "SEARCH_FILTER_TEAM", - 7: "SEARCH_FILTER_CURATED_PLUGIN", - } - SearchFilter_value = map[string]int32{ - "SEARCH_FILTER_UNSPECIFIED": 0, - "SEARCH_FILTER_USER": 1, - "SEARCH_FILTER_ORGANIZATION": 2, - "SEARCH_FILTER_REPOSITORY": 3, - "SEARCH_FILTER_PLUGIN": 4, - "SEARCH_FILTER_TEMPLATE": 5, - "SEARCH_FILTER_TEAM": 6, - "SEARCH_FILTER_CURATED_PLUGIN": 7, - } -) - -func (x SearchFilter) Enum() *SearchFilter { - p := new(SearchFilter) - *p = x - return p -} - -func (x SearchFilter) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SearchFilter) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[0].Descriptor() -} - -func (SearchFilter) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[0] -} - -func (x SearchFilter) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SearchFilter.Descriptor instead. -func (SearchFilter) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{0} -} - -type OrderBy int32 - -const ( - OrderBy_ORDER_BY_UNSPECIFIED OrderBy = 0 - OrderBy_ORDER_BY_CREATE_TIME OrderBy = 1 - OrderBy_ORDER_BY_UPDATE_TIME OrderBy = 2 - OrderBy_ORDER_BY_NAME OrderBy = 3 -) - -// Enum value maps for OrderBy. -var ( - OrderBy_name = map[int32]string{ - 0: "ORDER_BY_UNSPECIFIED", - 1: "ORDER_BY_CREATE_TIME", - 2: "ORDER_BY_UPDATE_TIME", - 3: "ORDER_BY_NAME", - } - OrderBy_value = map[string]int32{ - "ORDER_BY_UNSPECIFIED": 0, - "ORDER_BY_CREATE_TIME": 1, - "ORDER_BY_UPDATE_TIME": 2, - "ORDER_BY_NAME": 3, - } -) - -func (x OrderBy) Enum() *OrderBy { - p := new(OrderBy) - *p = x - return p -} - -func (x OrderBy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (OrderBy) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[1].Descriptor() -} - -func (OrderBy) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_search_proto_enumTypes[1] -} - -func (x OrderBy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use OrderBy.Descriptor instead. -func (OrderBy) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{1} -} - -type RepositorySearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the user or organization - // who is the owner of this repository. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - // The visibility of the repository. - Visibility Visibility `protobuf:"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.Visibility" json:"visibility,omitempty"` - Deprecated bool `protobuf:"varint,5,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *RepositorySearchResult) Reset() { - *x = RepositorySearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RepositorySearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RepositorySearchResult) ProtoMessage() {} - -func (x *RepositorySearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RepositorySearchResult.ProtoReflect.Descriptor instead. -func (*RepositorySearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{0} -} - -func (x *RepositorySearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RepositorySearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RepositorySearchResult) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *RepositorySearchResult) GetVisibility() Visibility { - if x != nil { - return x.Visibility - } - return Visibility_VISIBILITY_UNSPECIFIED -} - -func (x *RepositorySearchResult) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -type OrganizationSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *OrganizationSearchResult) Reset() { - *x = OrganizationSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrganizationSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationSearchResult) ProtoMessage() {} - -func (x *OrganizationSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OrganizationSearchResult.ProtoReflect.Descriptor instead. -func (*OrganizationSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{1} -} - -func (x *OrganizationSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *OrganizationSearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type UserSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - Deactivated bool `protobuf:"varint,3,opt,name=deactivated,proto3" json:"deactivated,omitempty"` -} - -func (x *UserSearchResult) Reset() { - *x = UserSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserSearchResult) ProtoMessage() {} - -func (x *UserSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserSearchResult.ProtoReflect.Descriptor instead. -func (*UserSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{2} -} - -func (x *UserSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UserSearchResult) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *UserSearchResult) GetDeactivated() bool { - if x != nil { - return x.Deactivated - } - return false -} - -type TeamSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - OrganizationName string `protobuf:"bytes,3,opt,name=organization_name,json=organizationName,proto3" json:"organization_name,omitempty"` -} - -func (x *TeamSearchResult) Reset() { - *x = TeamSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TeamSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TeamSearchResult) ProtoMessage() {} - -func (x *TeamSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TeamSearchResult.ProtoReflect.Descriptor instead. -func (*TeamSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{3} -} - -func (x *TeamSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *TeamSearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *TeamSearchResult) GetOrganizationName() string { - if x != nil { - return x.OrganizationName - } - return "" -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. -type PluginSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the user or organization - // who is the owner of this plugin. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - // The visibility of the plugin. - Visibility PluginVisibility `protobuf:"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.PluginVisibility" json:"visibility,omitempty"` - Deprecated bool `protobuf:"varint,5,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *PluginSearchResult) Reset() { - *x = PluginSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PluginSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PluginSearchResult) ProtoMessage() {} - -func (x *PluginSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PluginSearchResult.ProtoReflect.Descriptor instead. -func (*PluginSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{4} -} - -func (x *PluginSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *PluginSearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *PluginSearchResult) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *PluginSearchResult) GetVisibility() PluginVisibility { - if x != nil { - return x.Visibility - } - return PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED -} - -func (x *PluginSearchResult) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -type CuratedPluginSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the user or organization - // who is the owner of this plugin. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Deprecated bool `protobuf:"varint,4,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *CuratedPluginSearchResult) Reset() { - *x = CuratedPluginSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CuratedPluginSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CuratedPluginSearchResult) ProtoMessage() {} - -func (x *CuratedPluginSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CuratedPluginSearchResult.ProtoReflect.Descriptor instead. -func (*CuratedPluginSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{5} -} - -func (x *CuratedPluginSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *CuratedPluginSearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CuratedPluginSearchResult) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *CuratedPluginSearchResult) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. -type TemplateSearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // The name of the user or organization - // who is the owner of this template. - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - // The visibility of the template. - Visibility PluginVisibility `protobuf:"varint,4,opt,name=visibility,proto3,enum=buf.alpha.registry.v1alpha1.PluginVisibility" json:"visibility,omitempty"` - Deprecated bool `protobuf:"varint,5,opt,name=deprecated,proto3" json:"deprecated,omitempty"` -} - -func (x *TemplateSearchResult) Reset() { - *x = TemplateSearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TemplateSearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TemplateSearchResult) ProtoMessage() {} - -func (x *TemplateSearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use TemplateSearchResult.ProtoReflect.Descriptor instead. -func (*TemplateSearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{6} -} - -func (x *TemplateSearchResult) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *TemplateSearchResult) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *TemplateSearchResult) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *TemplateSearchResult) GetVisibility() PluginVisibility { - if x != nil { - return x.Visibility - } - return PluginVisibility_PLUGIN_VISIBILITY_UNSPECIFIED -} - -func (x *TemplateSearchResult) GetDeprecated() bool { - if x != nil { - return x.Deprecated - } - return false -} - -type SearchResult struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Item: - // - // *SearchResult_Repository - // *SearchResult_Organization - // *SearchResult_User - // *SearchResult_Team - // *SearchResult_Plugin - // *SearchResult_Template - // *SearchResult_CuratedPlugin - Item isSearchResult_Item `protobuf_oneof:"item"` -} - -func (x *SearchResult) Reset() { - *x = SearchResult{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchResult) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchResult) ProtoMessage() {} - -func (x *SearchResult) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchResult.ProtoReflect.Descriptor instead. -func (*SearchResult) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{7} -} - -func (m *SearchResult) GetItem() isSearchResult_Item { - if m != nil { - return m.Item - } - return nil -} - -func (x *SearchResult) GetRepository() *RepositorySearchResult { - if x, ok := x.GetItem().(*SearchResult_Repository); ok { - return x.Repository - } - return nil -} - -func (x *SearchResult) GetOrganization() *OrganizationSearchResult { - if x, ok := x.GetItem().(*SearchResult_Organization); ok { - return x.Organization - } - return nil -} - -func (x *SearchResult) GetUser() *UserSearchResult { - if x, ok := x.GetItem().(*SearchResult_User); ok { - return x.User - } - return nil -} - -func (x *SearchResult) GetTeam() *TeamSearchResult { - if x, ok := x.GetItem().(*SearchResult_Team); ok { - return x.Team - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. -func (x *SearchResult) GetPlugin() *PluginSearchResult { - if x, ok := x.GetItem().(*SearchResult_Plugin); ok { - return x.Plugin - } - return nil -} - -// Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. -func (x *SearchResult) GetTemplate() *TemplateSearchResult { - if x, ok := x.GetItem().(*SearchResult_Template); ok { - return x.Template - } - return nil -} - -func (x *SearchResult) GetCuratedPlugin() *CuratedPluginSearchResult { - if x, ok := x.GetItem().(*SearchResult_CuratedPlugin); ok { - return x.CuratedPlugin - } - return nil -} - -type isSearchResult_Item interface { - isSearchResult_Item() -} - -type SearchResult_Repository struct { - Repository *RepositorySearchResult `protobuf:"bytes,1,opt,name=repository,proto3,oneof"` -} - -type SearchResult_Organization struct { - Organization *OrganizationSearchResult `protobuf:"bytes,2,opt,name=organization,proto3,oneof"` -} - -type SearchResult_User struct { - User *UserSearchResult `protobuf:"bytes,3,opt,name=user,proto3,oneof"` -} - -type SearchResult_Team struct { - Team *TeamSearchResult `protobuf:"bytes,4,opt,name=team,proto3,oneof"` -} - -type SearchResult_Plugin struct { - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. - Plugin *PluginSearchResult `protobuf:"bytes,5,opt,name=plugin,proto3,oneof"` -} - -type SearchResult_Template struct { - // Deprecated: Marked as deprecated in buf/alpha/registry/v1alpha1/search.proto. - Template *TemplateSearchResult `protobuf:"bytes,6,opt,name=template,proto3,oneof"` -} - -type SearchResult_CuratedPlugin struct { - CuratedPlugin *CuratedPluginSearchResult `protobuf:"bytes,7,opt,name=curated_plugin,json=curatedPlugin,proto3,oneof"` -} - -func (*SearchResult_Repository) isSearchResult_Item() {} - -func (*SearchResult_Organization) isSearchResult_Item() {} - -func (*SearchResult_User) isSearchResult_Item() {} - -func (*SearchResult_Team) isSearchResult_Item() {} - -func (*SearchResult_Plugin) isSearchResult_Item() {} - -func (*SearchResult_Template) isSearchResult_Item() {} - -func (*SearchResult_CuratedPlugin) isSearchResult_Item() {} - -type SearchRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The search string. - Query string `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is 0. - PageToken uint32 `protobuf:"varint,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Empty list means show all. Supplying one or more enums will - // limit the search to only the requested resources. - // Supplying all possible enums is equivalent to empty list of filters. - Filters []SearchFilter `protobuf:"varint,4,rep,packed,name=filters,proto3,enum=buf.alpha.registry.v1alpha1.SearchFilter" json:"filters,omitempty"` -} - -func (x *SearchRequest) Reset() { - *x = SearchRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchRequest) ProtoMessage() {} - -func (x *SearchRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchRequest.ProtoReflect.Descriptor instead. -func (*SearchRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{8} -} - -func (x *SearchRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *SearchRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *SearchRequest) GetPageToken() uint32 { - if x != nil { - return x.PageToken - } - return 0 -} - -func (x *SearchRequest) GetFilters() []SearchFilter { - if x != nil { - return x.Filters - } - return nil -} - -type SearchResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SearchResults []*SearchResult `protobuf:"bytes,1,rep,name=search_results,json=searchResults,proto3" json:"search_results,omitempty"` - // There are no more pages if this is 0. - NextPageToken uint32 `protobuf:"varint,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *SearchResponse) Reset() { - *x = SearchResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchResponse) ProtoMessage() {} - -func (x *SearchResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchResponse.ProtoReflect.Descriptor instead. -func (*SearchResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{9} -} - -func (x *SearchResponse) GetSearchResults() []*SearchResult { - if x != nil { - return x.SearchResults - } - return nil -} - -func (x *SearchResponse) GetNextPageToken() uint32 { - if x != nil { - return x.NextPageToken - } - return 0 -} - -type SearchTagRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The search string. - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // The field to order results by. - OrderBy OrderBy `protobuf:"varint,6,opt,name=order_by,json=orderBy,proto3,enum=buf.alpha.registry.v1alpha1.OrderBy" json:"order_by,omitempty"` - // Reverse orders results in descending order. - Reverse bool `protobuf:"varint,7,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *SearchTagRequest) Reset() { - *x = SearchTagRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchTagRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchTagRequest) ProtoMessage() {} - -func (x *SearchTagRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchTagRequest.ProtoReflect.Descriptor instead. -func (*SearchTagRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{10} -} - -func (x *SearchTagRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *SearchTagRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *SearchTagRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *SearchTagRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *SearchTagRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *SearchTagRequest) GetOrderBy() OrderBy { - if x != nil { - return x.OrderBy - } - return OrderBy_ORDER_BY_UNSPECIFIED -} - -func (x *SearchTagRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type SearchTagResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryTags []*RepositoryTag `protobuf:"bytes,1,rep,name=repository_tags,json=repositoryTags,proto3" json:"repository_tags,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *SearchTagResponse) Reset() { - *x = SearchTagResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchTagResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchTagResponse) ProtoMessage() {} - -func (x *SearchTagResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchTagResponse.ProtoReflect.Descriptor instead. -func (*SearchTagResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{11} -} - -func (x *SearchTagResponse) GetRepositoryTags() []*RepositoryTag { - if x != nil { - return x.RepositoryTags - } - return nil -} - -func (x *SearchTagResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type SearchDraftRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The owner of the repository. - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The name of the repository. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The search string. - Query string `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"` - PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,5,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // The field to order results by. - OrderBy OrderBy `protobuf:"varint,6,opt,name=order_by,json=orderBy,proto3,enum=buf.alpha.registry.v1alpha1.OrderBy" json:"order_by,omitempty"` - // Reverse orders results in descending order. - Reverse bool `protobuf:"varint,7,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *SearchDraftRequest) Reset() { - *x = SearchDraftRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchDraftRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchDraftRequest) ProtoMessage() {} - -func (x *SearchDraftRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchDraftRequest.ProtoReflect.Descriptor instead. -func (*SearchDraftRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{12} -} - -func (x *SearchDraftRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *SearchDraftRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *SearchDraftRequest) GetQuery() string { - if x != nil { - return x.Query - } - return "" -} - -func (x *SearchDraftRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *SearchDraftRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *SearchDraftRequest) GetOrderBy() OrderBy { - if x != nil { - return x.OrderBy - } - return OrderBy_ORDER_BY_UNSPECIFIED -} - -func (x *SearchDraftRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type SearchDraftResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RepositoryCommits []*RepositoryCommit `protobuf:"bytes,1,rep,name=repository_commits,json=repositoryCommits,proto3" json:"repository_commits,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *SearchDraftResponse) Reset() { - *x = SearchDraftResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SearchDraftResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SearchDraftResponse) ProtoMessage() {} - -func (x *SearchDraftResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SearchDraftResponse.ProtoReflect.Descriptor instead. -func (*SearchDraftResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP(), []int{13} -} - -func (x *SearchDraftResponse) GetRepositoryCommits() []*RepositoryCommit { - if x != nil { - return x.RepositoryCommits - } - return nil -} - -func (x *SearchDraftResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_search_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_search_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x2c, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x33, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbb, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x47, 0x0a, 0x0a, 0x76, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x69, - 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x22, 0x3e, 0x0a, 0x18, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x60, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x22, 0x63, 0x0a, 0x10, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, - 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xc1, 0x01, 0x0a, 0x12, - 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x0a, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, - 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, - 0x75, 0x0a, 0x19, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x22, 0xc3, 0x01, 0x0a, 0x14, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x0a, 0x76, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, - 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, - 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xd9, 0x04, 0x0a, - 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x55, 0x0a, - 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x5b, 0x0a, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x48, 0x00, 0x52, 0x0c, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, 0x00, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x54, 0x65, 0x61, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x12, 0x4d, 0x0a, 0x06, 0x70, - 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, 0x02, 0x18, 0x01, - 0x48, 0x00, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x53, 0x0a, 0x08, 0x74, 0x65, - 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, - 0x61, 0x74, 0x65, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x42, - 0x02, 0x18, 0x01, 0x48, 0x00, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, - 0x5f, 0x0a, 0x0e, 0x63, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x48, - 0x00, 0x52, 0x0d, 0x63, 0x75, 0x72, 0x61, 0x74, 0x65, 0x64, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x42, 0x06, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x22, 0xa6, 0x01, 0x0a, 0x0d, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, - 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x43, 0x0a, 0x07, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x29, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x52, 0x07, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, - 0x73, 0x22, 0x8a, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0e, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x93, - 0x02, 0x0a, 0x10, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, - 0x79, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, - 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, 0x0a, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x72, 0x64, - 0x65, 0x72, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, - 0x79, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x22, 0x90, 0x01, 0x0a, 0x11, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, - 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x52, - 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x61, 0x67, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x95, 0x02, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3f, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x52, 0x07, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, - 0x9b, 0x01, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x12, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x11, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x43, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x2a, 0xfb, 0x01, - 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x1d, - 0x0a, 0x19, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, - 0x12, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x55, - 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, - 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x4f, 0x52, 0x47, 0x41, 0x4e, 0x49, 0x5a, 0x41, 0x54, - 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, - 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x4f, 0x52, - 0x59, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x14, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, - 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x04, 0x1a, 0x02, 0x08, - 0x01, 0x12, 0x1e, 0x0a, 0x16, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x4c, 0x54, - 0x45, 0x52, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x4c, 0x41, 0x54, 0x45, 0x10, 0x05, 0x1a, 0x02, 0x08, - 0x01, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x45, 0x41, 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x4c, 0x54, - 0x45, 0x52, 0x5f, 0x54, 0x45, 0x41, 0x4d, 0x10, 0x06, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x41, - 0x52, 0x43, 0x48, 0x5f, 0x46, 0x49, 0x4c, 0x54, 0x45, 0x52, 0x5f, 0x43, 0x55, 0x52, 0x41, 0x54, - 0x45, 0x44, 0x5f, 0x50, 0x4c, 0x55, 0x47, 0x49, 0x4e, 0x10, 0x07, 0x2a, 0x6a, 0x0a, 0x07, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, - 0x42, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x43, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, - 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x54, 0x49, - 0x4d, 0x45, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x42, 0x59, - 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x03, 0x32, 0xdf, 0x02, 0x0a, 0x0d, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x06, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x12, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, - 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x6f, 0x0a, 0x09, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x61, 0x67, 0x12, 0x2d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, - 0x72, 0x63, 0x68, 0x54, 0x61, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, - 0x63, 0x68, 0x54, 0x61, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x01, 0x12, 0x75, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, - 0x74, 0x12, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x44, 0x72, 0x61, 0x66, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, 0x6f, - 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x53, - 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, - 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, - 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, - 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_search_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_search_proto_rawDescData = file_buf_alpha_registry_v1alpha1_search_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_search_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_search_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_search_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_search_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_search_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_search_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_buf_alpha_registry_v1alpha1_search_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_buf_alpha_registry_v1alpha1_search_proto_goTypes = []interface{}{ - (SearchFilter)(0), // 0: buf.alpha.registry.v1alpha1.SearchFilter - (OrderBy)(0), // 1: buf.alpha.registry.v1alpha1.OrderBy - (*RepositorySearchResult)(nil), // 2: buf.alpha.registry.v1alpha1.RepositorySearchResult - (*OrganizationSearchResult)(nil), // 3: buf.alpha.registry.v1alpha1.OrganizationSearchResult - (*UserSearchResult)(nil), // 4: buf.alpha.registry.v1alpha1.UserSearchResult - (*TeamSearchResult)(nil), // 5: buf.alpha.registry.v1alpha1.TeamSearchResult - (*PluginSearchResult)(nil), // 6: buf.alpha.registry.v1alpha1.PluginSearchResult - (*CuratedPluginSearchResult)(nil), // 7: buf.alpha.registry.v1alpha1.CuratedPluginSearchResult - (*TemplateSearchResult)(nil), // 8: buf.alpha.registry.v1alpha1.TemplateSearchResult - (*SearchResult)(nil), // 9: buf.alpha.registry.v1alpha1.SearchResult - (*SearchRequest)(nil), // 10: buf.alpha.registry.v1alpha1.SearchRequest - (*SearchResponse)(nil), // 11: buf.alpha.registry.v1alpha1.SearchResponse - (*SearchTagRequest)(nil), // 12: buf.alpha.registry.v1alpha1.SearchTagRequest - (*SearchTagResponse)(nil), // 13: buf.alpha.registry.v1alpha1.SearchTagResponse - (*SearchDraftRequest)(nil), // 14: buf.alpha.registry.v1alpha1.SearchDraftRequest - (*SearchDraftResponse)(nil), // 15: buf.alpha.registry.v1alpha1.SearchDraftResponse - (Visibility)(0), // 16: buf.alpha.registry.v1alpha1.Visibility - (PluginVisibility)(0), // 17: buf.alpha.registry.v1alpha1.PluginVisibility - (*RepositoryTag)(nil), // 18: buf.alpha.registry.v1alpha1.RepositoryTag - (*RepositoryCommit)(nil), // 19: buf.alpha.registry.v1alpha1.RepositoryCommit -} -var file_buf_alpha_registry_v1alpha1_search_proto_depIdxs = []int32{ - 16, // 0: buf.alpha.registry.v1alpha1.RepositorySearchResult.visibility:type_name -> buf.alpha.registry.v1alpha1.Visibility - 17, // 1: buf.alpha.registry.v1alpha1.PluginSearchResult.visibility:type_name -> buf.alpha.registry.v1alpha1.PluginVisibility - 17, // 2: buf.alpha.registry.v1alpha1.TemplateSearchResult.visibility:type_name -> buf.alpha.registry.v1alpha1.PluginVisibility - 2, // 3: buf.alpha.registry.v1alpha1.SearchResult.repository:type_name -> buf.alpha.registry.v1alpha1.RepositorySearchResult - 3, // 4: buf.alpha.registry.v1alpha1.SearchResult.organization:type_name -> buf.alpha.registry.v1alpha1.OrganizationSearchResult - 4, // 5: buf.alpha.registry.v1alpha1.SearchResult.user:type_name -> buf.alpha.registry.v1alpha1.UserSearchResult - 5, // 6: buf.alpha.registry.v1alpha1.SearchResult.team:type_name -> buf.alpha.registry.v1alpha1.TeamSearchResult - 6, // 7: buf.alpha.registry.v1alpha1.SearchResult.plugin:type_name -> buf.alpha.registry.v1alpha1.PluginSearchResult - 8, // 8: buf.alpha.registry.v1alpha1.SearchResult.template:type_name -> buf.alpha.registry.v1alpha1.TemplateSearchResult - 7, // 9: buf.alpha.registry.v1alpha1.SearchResult.curated_plugin:type_name -> buf.alpha.registry.v1alpha1.CuratedPluginSearchResult - 0, // 10: buf.alpha.registry.v1alpha1.SearchRequest.filters:type_name -> buf.alpha.registry.v1alpha1.SearchFilter - 9, // 11: buf.alpha.registry.v1alpha1.SearchResponse.search_results:type_name -> buf.alpha.registry.v1alpha1.SearchResult - 1, // 12: buf.alpha.registry.v1alpha1.SearchTagRequest.order_by:type_name -> buf.alpha.registry.v1alpha1.OrderBy - 18, // 13: buf.alpha.registry.v1alpha1.SearchTagResponse.repository_tags:type_name -> buf.alpha.registry.v1alpha1.RepositoryTag - 1, // 14: buf.alpha.registry.v1alpha1.SearchDraftRequest.order_by:type_name -> buf.alpha.registry.v1alpha1.OrderBy - 19, // 15: buf.alpha.registry.v1alpha1.SearchDraftResponse.repository_commits:type_name -> buf.alpha.registry.v1alpha1.RepositoryCommit - 10, // 16: buf.alpha.registry.v1alpha1.SearchService.Search:input_type -> buf.alpha.registry.v1alpha1.SearchRequest - 12, // 17: buf.alpha.registry.v1alpha1.SearchService.SearchTag:input_type -> buf.alpha.registry.v1alpha1.SearchTagRequest - 14, // 18: buf.alpha.registry.v1alpha1.SearchService.SearchDraft:input_type -> buf.alpha.registry.v1alpha1.SearchDraftRequest - 11, // 19: buf.alpha.registry.v1alpha1.SearchService.Search:output_type -> buf.alpha.registry.v1alpha1.SearchResponse - 13, // 20: buf.alpha.registry.v1alpha1.SearchService.SearchTag:output_type -> buf.alpha.registry.v1alpha1.SearchTagResponse - 15, // 21: buf.alpha.registry.v1alpha1.SearchService.SearchDraft:output_type -> buf.alpha.registry.v1alpha1.SearchDraftResponse - 19, // [19:22] is the sub-list for method output_type - 16, // [16:19] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_search_proto_init() } -func file_buf_alpha_registry_v1alpha1_search_proto_init() { - if File_buf_alpha_registry_v1alpha1_search_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_plugin_proto_init() - file_buf_alpha_registry_v1alpha1_repository_proto_init() - file_buf_alpha_registry_v1alpha1_repository_commit_proto_init() - file_buf_alpha_registry_v1alpha1_repository_tag_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepositorySearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrganizationSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TeamSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PluginSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CuratedPluginSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateSearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResult); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchTagRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchTagResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchDraftRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SearchDraftResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_search_proto_msgTypes[7].OneofWrappers = []interface{}{ - (*SearchResult_Repository)(nil), - (*SearchResult_Organization)(nil), - (*SearchResult_User)(nil), - (*SearchResult_Team)(nil), - (*SearchResult_Plugin)(nil), - (*SearchResult_Template)(nil), - (*SearchResult_CuratedPlugin)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_search_proto_rawDesc, - NumEnums: 2, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_search_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_search_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_search_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_search_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_search_proto = out.File - file_buf_alpha_registry_v1alpha1_search_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_search_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_search_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio.pb.go deleted file mode 100644 index feb4d4dcef..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio.pb.go +++ /dev/null @@ -1,529 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/studio.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The protocols supported by Studio agent. -type StudioAgentProtocol int32 - -const ( - StudioAgentProtocol_STUDIO_AGENT_PROTOCOL_UNSPECIFIED StudioAgentProtocol = 0 - StudioAgentProtocol_STUDIO_AGENT_PROTOCOL_GRPC StudioAgentProtocol = 1 - StudioAgentProtocol_STUDIO_AGENT_PROTOCOL_CONNECT StudioAgentProtocol = 2 -) - -// Enum value maps for StudioAgentProtocol. -var ( - StudioAgentProtocol_name = map[int32]string{ - 0: "STUDIO_AGENT_PROTOCOL_UNSPECIFIED", - 1: "STUDIO_AGENT_PROTOCOL_GRPC", - 2: "STUDIO_AGENT_PROTOCOL_CONNECT", - } - StudioAgentProtocol_value = map[string]int32{ - "STUDIO_AGENT_PROTOCOL_UNSPECIFIED": 0, - "STUDIO_AGENT_PROTOCOL_GRPC": 1, - "STUDIO_AGENT_PROTOCOL_CONNECT": 2, - } -) - -func (x StudioAgentProtocol) Enum() *StudioAgentProtocol { - p := new(StudioAgentProtocol) - *p = x - return p -} - -func (x StudioAgentProtocol) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StudioAgentProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes[0].Descriptor() -} - -func (StudioAgentProtocol) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes[0] -} - -func (x StudioAgentProtocol) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StudioAgentProtocol.Descriptor instead. -func (StudioAgentProtocol) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{0} -} - -// StudioAgentPreset is the information about an agent preset in the Studio. -type StudioAgentPreset struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The target agent URL in the Studio. - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - // The optional alias of the agent URL. - Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"` - // The protocol the agent should use to forward requests. - Protocol StudioAgentProtocol `protobuf:"varint,3,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioAgentProtocol" json:"protocol,omitempty"` -} - -func (x *StudioAgentPreset) Reset() { - *x = StudioAgentPreset{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StudioAgentPreset) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StudioAgentPreset) ProtoMessage() {} - -func (x *StudioAgentPreset) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StudioAgentPreset.ProtoReflect.Descriptor instead. -func (*StudioAgentPreset) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{0} -} - -func (x *StudioAgentPreset) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *StudioAgentPreset) GetAlias() string { - if x != nil { - return x.Alias - } - return "" -} - -func (x *StudioAgentPreset) GetProtocol() StudioAgentProtocol { - if x != nil { - return x.Protocol - } - return StudioAgentProtocol_STUDIO_AGENT_PROTOCOL_UNSPECIFIED -} - -type ListStudioAgentPresetsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *ListStudioAgentPresetsRequest) Reset() { - *x = ListStudioAgentPresetsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStudioAgentPresetsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStudioAgentPresetsRequest) ProtoMessage() {} - -func (x *ListStudioAgentPresetsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStudioAgentPresetsRequest.ProtoReflect.Descriptor instead. -func (*ListStudioAgentPresetsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{1} -} - -type ListStudioAgentPresetsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Agents []*StudioAgentPreset `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` -} - -func (x *ListStudioAgentPresetsResponse) Reset() { - *x = ListStudioAgentPresetsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStudioAgentPresetsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStudioAgentPresetsResponse) ProtoMessage() {} - -func (x *ListStudioAgentPresetsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStudioAgentPresetsResponse.ProtoReflect.Descriptor instead. -func (*ListStudioAgentPresetsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{2} -} - -func (x *ListStudioAgentPresetsResponse) GetAgents() []*StudioAgentPreset { - if x != nil { - return x.Agents - } - return nil -} - -type SetStudioAgentPresetsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Agents []*StudioAgentPreset `protobuf:"bytes,1,rep,name=agents,proto3" json:"agents,omitempty"` -} - -func (x *SetStudioAgentPresetsRequest) Reset() { - *x = SetStudioAgentPresetsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetStudioAgentPresetsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStudioAgentPresetsRequest) ProtoMessage() {} - -func (x *SetStudioAgentPresetsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetStudioAgentPresetsRequest.ProtoReflect.Descriptor instead. -func (*SetStudioAgentPresetsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{3} -} - -func (x *SetStudioAgentPresetsRequest) GetAgents() []*StudioAgentPreset { - if x != nil { - return x.Agents - } - return nil -} - -type SetStudioAgentPresetsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetStudioAgentPresetsResponse) Reset() { - *x = SetStudioAgentPresetsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetStudioAgentPresetsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetStudioAgentPresetsResponse) ProtoMessage() {} - -func (x *SetStudioAgentPresetsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SetStudioAgentPresetsResponse.ProtoReflect.Descriptor instead. -func (*SetStudioAgentPresetsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP(), []int{4} -} - -var File_buf_alpha_registry_v1alpha1_studio_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x74, - 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x53, 0x74, 0x75, 0x64, - 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, - 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x4c, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, - 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x22, 0x1f, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, - 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x66, - 0x0a, 0x1c, 0x53, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, - 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x46, - 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x52, 0x06, - 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x1f, 0x0a, 0x1d, 0x53, 0x65, 0x74, 0x53, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x7f, 0x0a, 0x13, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x25, - 0x0a, 0x21, 0x53, 0x54, 0x55, 0x44, 0x49, 0x4f, 0x5f, 0x41, 0x47, 0x45, 0x4e, 0x54, 0x5f, 0x50, - 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x54, 0x55, 0x44, 0x49, 0x4f, 0x5f, - 0x41, 0x47, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x47, - 0x52, 0x50, 0x43, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x53, 0x54, 0x55, 0x44, 0x49, 0x4f, 0x5f, - 0x41, 0x47, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x43, - 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, 0x02, 0x32, 0xb9, 0x02, 0x0a, 0x0d, 0x53, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x16, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, - 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, - 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x3b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, - 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x8e, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x12, 0x39, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x53, - 0x74, 0x75, 0x64, 0x69, 0x6f, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, - 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x65, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x98, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_studio_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_studio_proto_rawDescData = file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_studio_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_studio_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_studio_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_studio_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_studio_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_buf_alpha_registry_v1alpha1_studio_proto_goTypes = []interface{}{ - (StudioAgentProtocol)(0), // 0: buf.alpha.registry.v1alpha1.StudioAgentProtocol - (*StudioAgentPreset)(nil), // 1: buf.alpha.registry.v1alpha1.StudioAgentPreset - (*ListStudioAgentPresetsRequest)(nil), // 2: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsRequest - (*ListStudioAgentPresetsResponse)(nil), // 3: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse - (*SetStudioAgentPresetsRequest)(nil), // 4: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest - (*SetStudioAgentPresetsResponse)(nil), // 5: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsResponse -} -var file_buf_alpha_registry_v1alpha1_studio_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.StudioAgentPreset.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioAgentProtocol - 1, // 1: buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse.agents:type_name -> buf.alpha.registry.v1alpha1.StudioAgentPreset - 1, // 2: buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest.agents:type_name -> buf.alpha.registry.v1alpha1.StudioAgentPreset - 2, // 3: buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets:input_type -> buf.alpha.registry.v1alpha1.ListStudioAgentPresetsRequest - 4, // 4: buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets:input_type -> buf.alpha.registry.v1alpha1.SetStudioAgentPresetsRequest - 3, // 5: buf.alpha.registry.v1alpha1.StudioService.ListStudioAgentPresets:output_type -> buf.alpha.registry.v1alpha1.ListStudioAgentPresetsResponse - 5, // 6: buf.alpha.registry.v1alpha1.StudioService.SetStudioAgentPresets:output_type -> buf.alpha.registry.v1alpha1.SetStudioAgentPresetsResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_studio_proto_init() } -func file_buf_alpha_registry_v1alpha1_studio_proto_init() { - if File_buf_alpha_registry_v1alpha1_studio_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StudioAgentPreset); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStudioAgentPresetsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStudioAgentPresetsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetStudioAgentPresetsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetStudioAgentPresetsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc, - NumEnums: 1, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_studio_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_studio_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_studio_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_studio_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_studio_proto = out.File - file_buf_alpha_registry_v1alpha1_studio_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_studio_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_studio_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio_request.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio_request.pb.go deleted file mode 100644 index 32c5c6fee1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/studio_request.pb.go +++ /dev/null @@ -1,1165 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/studio_request.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// StudioProtocol are the supported protocols for Studio Requests. -type StudioProtocol int32 - -const ( - // STUDIO_PROTOCOL_UNSPECIFIED is a safe default for requests with no protocol - // defined. - StudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED StudioProtocol = 0 - // STUDIO_PROTOCOL_CONNECT is the Connect protocol in Studio. - StudioProtocol_STUDIO_PROTOCOL_CONNECT StudioProtocol = 1 - // STUDIO_PROTOCOL_GRPC is the gRPC protocol in Studio. - StudioProtocol_STUDIO_PROTOCOL_GRPC StudioProtocol = 2 - // STUDIO_PROTOCOL_GRPC_WEB is the gRPC-web protocol in Studio. - StudioProtocol_STUDIO_PROTOCOL_GRPC_WEB StudioProtocol = 3 -) - -// Enum value maps for StudioProtocol. -var ( - StudioProtocol_name = map[int32]string{ - 0: "STUDIO_PROTOCOL_UNSPECIFIED", - 1: "STUDIO_PROTOCOL_CONNECT", - 2: "STUDIO_PROTOCOL_GRPC", - 3: "STUDIO_PROTOCOL_GRPC_WEB", - } - StudioProtocol_value = map[string]int32{ - "STUDIO_PROTOCOL_UNSPECIFIED": 0, - "STUDIO_PROTOCOL_CONNECT": 1, - "STUDIO_PROTOCOL_GRPC": 2, - "STUDIO_PROTOCOL_GRPC_WEB": 3, - } -) - -func (x StudioProtocol) Enum() *StudioProtocol { - p := new(StudioProtocol) - *p = x - return p -} - -func (x StudioProtocol) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (StudioProtocol) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes[0].Descriptor() -} - -func (StudioProtocol) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes[0] -} - -func (x StudioProtocol) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use StudioProtocol.Descriptor instead. -func (StudioProtocol) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{0} -} - -// CreateStudioRequestRequest is the proto request representation of the -// CreateStudioRequest method. -type CreateStudioRequestRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The linked BSR repository owner name (user or organization). - RepositoryOwner string `protobuf:"bytes,1,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The linked BSR repository name. - RepositoryName string `protobuf:"bytes,2,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The friendly name of this request. - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - // The target base URL of this request. - TargetBaseUrl string `protobuf:"bytes,4,opt,name=target_base_url,json=targetBaseUrl,proto3" json:"target_base_url,omitempty"` - // The target service name as defined in the BSR repository. - Service string `protobuf:"bytes,5,opt,name=service,proto3" json:"service,omitempty"` - // The target RPC method name as defined in the BSR repository. - Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` - // The request body as defined in Studio. - Body string `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"` - // The request headers as defined in Studio. - Headers map[string]string `protobuf:"bytes,8,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Should this request include cookies from the Studio current session? - IncludeCookies bool `protobuf:"varint,9,opt,name=include_cookies,json=includeCookies,proto3" json:"include_cookies,omitempty"` - // The protocol that Studio uses to send this request. - Protocol StudioProtocol `protobuf:"varint,10,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioProtocol" json:"protocol,omitempty"` - // The agent url (if any) used by Studio to send the request. See - // https://docs.buf.build/bsr/studio#via-buf-studio-agent for details. - AgentUrl string `protobuf:"bytes,11,opt,name=agent_url,json=agentUrl,proto3" json:"agent_url,omitempty"` -} - -func (x *CreateStudioRequestRequest) Reset() { - *x = CreateStudioRequestRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateStudioRequestRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateStudioRequestRequest) ProtoMessage() {} - -func (x *CreateStudioRequestRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateStudioRequestRequest.ProtoReflect.Descriptor instead. -func (*CreateStudioRequestRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateStudioRequestRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *CreateStudioRequestRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *CreateStudioRequestRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateStudioRequestRequest) GetTargetBaseUrl() string { - if x != nil { - return x.TargetBaseUrl - } - return "" -} - -func (x *CreateStudioRequestRequest) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -func (x *CreateStudioRequestRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *CreateStudioRequestRequest) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *CreateStudioRequestRequest) GetHeaders() map[string]string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *CreateStudioRequestRequest) GetIncludeCookies() bool { - if x != nil { - return x.IncludeCookies - } - return false -} - -func (x *CreateStudioRequestRequest) GetProtocol() StudioProtocol { - if x != nil { - return x.Protocol - } - return StudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED -} - -func (x *CreateStudioRequestRequest) GetAgentUrl() string { - if x != nil { - return x.AgentUrl - } - return "" -} - -// CreateStudioRequestResponse returns the created StudioRequest. -type CreateStudioRequestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Created Studio Request. - CreatedRequest *StudioRequest `protobuf:"bytes,1,opt,name=created_request,json=createdRequest,proto3" json:"created_request,omitempty"` -} - -func (x *CreateStudioRequestResponse) Reset() { - *x = CreateStudioRequestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateStudioRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateStudioRequestResponse) ProtoMessage() {} - -func (x *CreateStudioRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateStudioRequestResponse.ProtoReflect.Descriptor instead. -func (*CreateStudioRequestResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateStudioRequestResponse) GetCreatedRequest() *StudioRequest { - if x != nil { - return x.CreatedRequest - } - return nil -} - -// RenameStudioRequestRequest is the proto request representation of the -// RenameStudioRequest method. -type RenameStudioRequestRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The Studio Request ID that will be renamed. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The new name for the request. - NewName string `protobuf:"bytes,2,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"` -} - -func (x *RenameStudioRequestRequest) Reset() { - *x = RenameStudioRequestRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RenameStudioRequestRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RenameStudioRequestRequest) ProtoMessage() {} - -func (x *RenameStudioRequestRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RenameStudioRequestRequest.ProtoReflect.Descriptor instead. -func (*RenameStudioRequestRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{2} -} - -func (x *RenameStudioRequestRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *RenameStudioRequestRequest) GetNewName() string { - if x != nil { - return x.NewName - } - return "" -} - -// RenameStudioRequestResponse returns empty on successful renaming. -type RenameStudioRequestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RenameStudioRequestResponse) Reset() { - *x = RenameStudioRequestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RenameStudioRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RenameStudioRequestResponse) ProtoMessage() {} - -func (x *RenameStudioRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RenameStudioRequestResponse.ProtoReflect.Descriptor instead. -func (*RenameStudioRequestResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{3} -} - -// DeleteStudioRequestRequest is the proto request representation of the -// DeleteStudioRequest method. -type DeleteStudioRequestRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The Studio Request ID that will be deleted. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteStudioRequestRequest) Reset() { - *x = DeleteStudioRequestRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteStudioRequestRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteStudioRequestRequest) ProtoMessage() {} - -func (x *DeleteStudioRequestRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteStudioRequestRequest.ProtoReflect.Descriptor instead. -func (*DeleteStudioRequestRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{4} -} - -func (x *DeleteStudioRequestRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// DeleteStudioRequestResponse returns empty on successful deletions. -type DeleteStudioRequestResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteStudioRequestResponse) Reset() { - *x = DeleteStudioRequestResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteStudioRequestResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteStudioRequestResponse) ProtoMessage() {} - -func (x *DeleteStudioRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteStudioRequestResponse.ProtoReflect.Descriptor instead. -func (*DeleteStudioRequestResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{5} -} - -// ListStudioRequestsRequest is the proto request representation of the -// ListStudioRequests method. -type ListStudioRequestsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The page size for listing studio requests, values between 1-250. - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The page token for paginating. The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // The listed studio requests are order by created time in ascending order. - // You can reverse that order setting this value to true. - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListStudioRequestsRequest) Reset() { - *x = ListStudioRequestsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStudioRequestsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStudioRequestsRequest) ProtoMessage() {} - -func (x *ListStudioRequestsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStudioRequestsRequest.ProtoReflect.Descriptor instead. -func (*ListStudioRequestsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{6} -} - -func (x *ListStudioRequestsRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListStudioRequestsRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListStudioRequestsRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -// ListStudioRequestsResponse is the proto response representation of the -// ListStudioRequests method. -type ListStudioRequestsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of requests in the current page. - Requests []*StudioRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"` - // The requests' next page token. There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListStudioRequestsResponse) Reset() { - *x = ListStudioRequestsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListStudioRequestsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListStudioRequestsResponse) ProtoMessage() {} - -func (x *ListStudioRequestsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListStudioRequestsResponse.ProtoReflect.Descriptor instead. -func (*ListStudioRequestsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{7} -} - -func (x *ListStudioRequestsResponse) GetRequests() []*StudioRequest { - if x != nil { - return x.Requests - } - return nil -} - -func (x *ListStudioRequestsResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// StudioRequest represents a saved request in Studio, that is synced to a BSR -// user's profile. -type StudioRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of this Studio Request. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The request creation timestamp. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The request last updated timestamp. - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // User ID who created and saved this request. - AuthorUserId string `protobuf:"bytes,4,opt,name=author_user_id,json=authorUserId,proto3" json:"author_user_id,omitempty"` - // BSR repository ID this request is linked to. - RepositoryId string `protobuf:"bytes,5,opt,name=repository_id,json=repositoryId,proto3" json:"repository_id,omitempty"` - // The friendly name of this request. - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - // The target base URL of this request. - TargetBaseUrl string `protobuf:"bytes,7,opt,name=target_base_url,json=targetBaseUrl,proto3" json:"target_base_url,omitempty"` - // The BSR repository owner name (user or organization). - RepositoryOwner string `protobuf:"bytes,8,opt,name=repository_owner,json=repositoryOwner,proto3" json:"repository_owner,omitempty"` - // The BSR repository name. - RepositoryName string `protobuf:"bytes,9,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The target service name as defined in the BSR repository. - Service string `protobuf:"bytes,10,opt,name=service,proto3" json:"service,omitempty"` - // The target RPC method name as defined in the BSR repository. - Method string `protobuf:"bytes,11,opt,name=method,proto3" json:"method,omitempty"` - // The request body as defined in Studio. - Body string `protobuf:"bytes,12,opt,name=body,proto3" json:"body,omitempty"` - // The request headers as defined in Studio. - Headers map[string]string `protobuf:"bytes,13,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Should this request include cookies from the Studio current session? - IncludeCookies bool `protobuf:"varint,14,opt,name=include_cookies,json=includeCookies,proto3" json:"include_cookies,omitempty"` - // The protocol that Studio uses to send this request. - Protocol StudioProtocol `protobuf:"varint,15,opt,name=protocol,proto3,enum=buf.alpha.registry.v1alpha1.StudioProtocol" json:"protocol,omitempty"` - // The agent url (if any) used by Studio to send the request. See - // https://docs.buf.build/bsr/studio#via-buf-studio-agent for details. - AgentUrl string `protobuf:"bytes,16,opt,name=agent_url,json=agentUrl,proto3" json:"agent_url,omitempty"` -} - -func (x *StudioRequest) Reset() { - *x = StudioRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *StudioRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*StudioRequest) ProtoMessage() {} - -func (x *StudioRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use StudioRequest.ProtoReflect.Descriptor instead. -func (*StudioRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP(), []int{8} -} - -func (x *StudioRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *StudioRequest) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *StudioRequest) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *StudioRequest) GetAuthorUserId() string { - if x != nil { - return x.AuthorUserId - } - return "" -} - -func (x *StudioRequest) GetRepositoryId() string { - if x != nil { - return x.RepositoryId - } - return "" -} - -func (x *StudioRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *StudioRequest) GetTargetBaseUrl() string { - if x != nil { - return x.TargetBaseUrl - } - return "" -} - -func (x *StudioRequest) GetRepositoryOwner() string { - if x != nil { - return x.RepositoryOwner - } - return "" -} - -func (x *StudioRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *StudioRequest) GetService() string { - if x != nil { - return x.Service - } - return "" -} - -func (x *StudioRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -func (x *StudioRequest) GetBody() string { - if x != nil { - return x.Body - } - return "" -} - -func (x *StudioRequest) GetHeaders() map[string]string { - if x != nil { - return x.Headers - } - return nil -} - -func (x *StudioRequest) GetIncludeCookies() bool { - if x != nil { - return x.IncludeCookies - } - return false -} - -func (x *StudioRequest) GetProtocol() StudioProtocol { - if x != nil { - return x.Protocol - } - return StudioProtocol_STUDIO_PROTOCOL_UNSPECIFIED -} - -func (x *StudioRequest) GetAgentUrl() string { - if x != nil { - return x.AgentUrl - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_studio_request_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc = []byte{ - 0x0a, 0x30, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x74, - 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, - 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x9d, 0x04, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x29, 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, - 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x55, 0x72, 0x6c, 0x12, - 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x5e, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, - 0x5f, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x12, 0x47, - 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, - 0x74, 0x75, 0x64, 0x69, 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, - 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x67, 0x65, 0x6e, - 0x74, 0x55, 0x72, 0x6c, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x22, 0x72, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x53, 0x0a, 0x0f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x47, 0x0a, 0x1a, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x53, 0x74, - 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x65, 0x77, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x77, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x1d, 0x0a, - 0x1b, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x1a, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x71, 0x0a, 0x19, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x8c, 0x01, 0x0a, - 0x1a, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x08, 0x72, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, - 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x08, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, - 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xd8, 0x05, 0x0a, 0x0d, - 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, 0x0a, - 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x23, 0x0a, - 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x42, 0x61, 0x73, 0x65, 0x55, 0x72, 0x6c, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x51, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x69, - 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x0e, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x43, 0x6f, 0x6f, - 0x6b, 0x69, 0x65, 0x73, 0x12, 0x47, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x63, 0x6f, 0x6c, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1b, 0x0a, - 0x09, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x55, 0x72, 0x6c, 0x1a, 0x3a, 0x0a, 0x0c, 0x48, 0x65, - 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x86, 0x01, 0x0a, 0x0e, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x54, 0x55, - 0x44, 0x49, 0x4f, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x54, - 0x55, 0x44, 0x49, 0x4f, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x43, 0x4f, - 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x55, 0x44, 0x49, - 0x4f, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x10, - 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x54, 0x55, 0x44, 0x49, 0x4f, 0x5f, 0x50, 0x52, 0x4f, 0x54, - 0x4f, 0x43, 0x4f, 0x4c, 0x5f, 0x47, 0x52, 0x50, 0x43, 0x5f, 0x57, 0x45, 0x42, 0x10, 0x03, 0x32, - 0xcd, 0x04, 0x0a, 0x14, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8a, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x74, - 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8a, 0x01, 0x0a, 0x13, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6e, 0x61, - 0x6d, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x52, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x8d, 0x01, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x2e, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, - 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x38, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, - 0x02, 0x02, 0x12, 0x8a, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, - 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x36, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, - 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42, - 0x9f, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x12, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescData = file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes = []interface{}{ - (StudioProtocol)(0), // 0: buf.alpha.registry.v1alpha1.StudioProtocol - (*CreateStudioRequestRequest)(nil), // 1: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest - (*CreateStudioRequestResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateStudioRequestResponse - (*RenameStudioRequestRequest)(nil), // 3: buf.alpha.registry.v1alpha1.RenameStudioRequestRequest - (*RenameStudioRequestResponse)(nil), // 4: buf.alpha.registry.v1alpha1.RenameStudioRequestResponse - (*DeleteStudioRequestRequest)(nil), // 5: buf.alpha.registry.v1alpha1.DeleteStudioRequestRequest - (*DeleteStudioRequestResponse)(nil), // 6: buf.alpha.registry.v1alpha1.DeleteStudioRequestResponse - (*ListStudioRequestsRequest)(nil), // 7: buf.alpha.registry.v1alpha1.ListStudioRequestsRequest - (*ListStudioRequestsResponse)(nil), // 8: buf.alpha.registry.v1alpha1.ListStudioRequestsResponse - (*StudioRequest)(nil), // 9: buf.alpha.registry.v1alpha1.StudioRequest - nil, // 10: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.HeadersEntry - nil, // 11: buf.alpha.registry.v1alpha1.StudioRequest.HeadersEntry - (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs = []int32{ - 10, // 0: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.headers:type_name -> buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.HeadersEntry - 0, // 1: buf.alpha.registry.v1alpha1.CreateStudioRequestRequest.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioProtocol - 9, // 2: buf.alpha.registry.v1alpha1.CreateStudioRequestResponse.created_request:type_name -> buf.alpha.registry.v1alpha1.StudioRequest - 9, // 3: buf.alpha.registry.v1alpha1.ListStudioRequestsResponse.requests:type_name -> buf.alpha.registry.v1alpha1.StudioRequest - 12, // 4: buf.alpha.registry.v1alpha1.StudioRequest.create_time:type_name -> google.protobuf.Timestamp - 12, // 5: buf.alpha.registry.v1alpha1.StudioRequest.update_time:type_name -> google.protobuf.Timestamp - 11, // 6: buf.alpha.registry.v1alpha1.StudioRequest.headers:type_name -> buf.alpha.registry.v1alpha1.StudioRequest.HeadersEntry - 0, // 7: buf.alpha.registry.v1alpha1.StudioRequest.protocol:type_name -> buf.alpha.registry.v1alpha1.StudioProtocol - 1, // 8: buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest:input_type -> buf.alpha.registry.v1alpha1.CreateStudioRequestRequest - 3, // 9: buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest:input_type -> buf.alpha.registry.v1alpha1.RenameStudioRequestRequest - 5, // 10: buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest:input_type -> buf.alpha.registry.v1alpha1.DeleteStudioRequestRequest - 7, // 11: buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests:input_type -> buf.alpha.registry.v1alpha1.ListStudioRequestsRequest - 2, // 12: buf.alpha.registry.v1alpha1.StudioRequestService.CreateStudioRequest:output_type -> buf.alpha.registry.v1alpha1.CreateStudioRequestResponse - 4, // 13: buf.alpha.registry.v1alpha1.StudioRequestService.RenameStudioRequest:output_type -> buf.alpha.registry.v1alpha1.RenameStudioRequestResponse - 6, // 14: buf.alpha.registry.v1alpha1.StudioRequestService.DeleteStudioRequest:output_type -> buf.alpha.registry.v1alpha1.DeleteStudioRequestResponse - 8, // 15: buf.alpha.registry.v1alpha1.StudioRequestService.ListStudioRequests:output_type -> buf.alpha.registry.v1alpha1.ListStudioRequestsResponse - 12, // [12:16] is the sub-list for method output_type - 8, // [8:12] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_studio_request_proto_init() } -func file_buf_alpha_registry_v1alpha1_studio_request_proto_init() { - if File_buf_alpha_registry_v1alpha1_studio_request_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateStudioRequestRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateStudioRequestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RenameStudioRequestRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RenameStudioRequestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteStudioRequestRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteStudioRequestResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStudioRequestsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListStudioRequestsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StudioRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc, - NumEnums: 1, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_studio_request_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_studio_request_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_studio_request_proto = out.File - file_buf_alpha_registry_v1alpha1_studio_request_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_studio_request_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_studio_request_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/sync.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/sync.pb.go deleted file mode 100644 index 3f806c727b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/sync.pb.go +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/sync.proto - -package registryv1alpha1 - -import ( - v1alpha1 "github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/module/v1alpha1" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// GitSyncPoint is the sync point for a particular module contained in a Git repository. -type GitSyncPoint struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"` - GitCommitHash string `protobuf:"bytes,4,opt,name=git_commit_hash,json=gitCommitHash,proto3" json:"git_commit_hash,omitempty"` - BsrCommitName string `protobuf:"bytes,5,opt,name=bsr_commit_name,json=bsrCommitName,proto3" json:"bsr_commit_name,omitempty"` -} - -func (x *GitSyncPoint) Reset() { - *x = GitSyncPoint{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GitSyncPoint) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GitSyncPoint) ProtoMessage() {} - -func (x *GitSyncPoint) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GitSyncPoint.ProtoReflect.Descriptor instead. -func (*GitSyncPoint) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP(), []int{0} -} - -func (x *GitSyncPoint) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GitSyncPoint) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GitSyncPoint) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *GitSyncPoint) GetGitCommitHash() string { - if x != nil { - return x.GitCommitHash - } - return "" -} - -func (x *GitSyncPoint) GetBsrCommitName() string { - if x != nil { - return x.BsrCommitName - } - return "" -} - -type GetGitSyncPointRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Owner is the owner of the BSR repository. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // Repository is the name of the BSR repository. - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Branch is the Git branch for which to look up the commit. - Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"` -} - -func (x *GetGitSyncPointRequest) Reset() { - *x = GetGitSyncPointRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGitSyncPointRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGitSyncPointRequest) ProtoMessage() {} - -func (x *GetGitSyncPointRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGitSyncPointRequest.ProtoReflect.Descriptor instead. -func (*GetGitSyncPointRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP(), []int{1} -} - -func (x *GetGitSyncPointRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *GetGitSyncPointRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *GetGitSyncPointRequest) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -type GetGitSyncPointResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // SyncPoint is the latest syncpoint for the specified owner/repo/branch. - SyncPoint *GitSyncPoint `protobuf:"bytes,1,opt,name=sync_point,json=syncPoint,proto3" json:"sync_point,omitempty"` -} - -func (x *GetGitSyncPointResponse) Reset() { - *x = GetGitSyncPointResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetGitSyncPointResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetGitSyncPointResponse) ProtoMessage() {} - -func (x *GetGitSyncPointResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetGitSyncPointResponse.ProtoReflect.Descriptor instead. -func (*GetGitSyncPointResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP(), []int{2} -} - -func (x *GetGitSyncPointResponse) GetSyncPoint() *GitSyncPoint { - if x != nil { - return x.SyncPoint - } - return nil -} - -type SyncGitCommitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Owner is the owner of the BSR repository. - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - // Repository is the name of the BSR repository. - Repository string `protobuf:"bytes,2,opt,name=repository,proto3" json:"repository,omitempty"` - // Branch is the Git branch that this commit belongs to. - Branch string `protobuf:"bytes,3,opt,name=branch,proto3" json:"branch,omitempty"` - // Manifest with all the module files being pushed. - Manifest *v1alpha1.Blob `protobuf:"bytes,4,opt,name=manifest,proto3" json:"manifest,omitempty"` - // Referenced blobs in the manifest. Keep in mind there is not necessarily one - // blob per file, but one blob per digest, so for files with exactly the same - // content, you can send just one blob. - Blobs []*v1alpha1.Blob `protobuf:"bytes,5,rep,name=blobs,proto3" json:"blobs,omitempty"` - // Hash is the SHA1 hash of the Git commit. - Hash string `protobuf:"bytes,6,opt,name=hash,proto3" json:"hash,omitempty"` - // Author is the author of the Git commit. This is typically an end-user. - Author *GitIdentity `protobuf:"bytes,7,opt,name=author,proto3" json:"author,omitempty"` - // Commiter is the commiter of the Git commit. This typically a CI system. - Commiter *GitIdentity `protobuf:"bytes,8,opt,name=commiter,proto3" json:"commiter,omitempty"` - // Tags are the Git tags which point to this commit. - Tags []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"` -} - -func (x *SyncGitCommitRequest) Reset() { - *x = SyncGitCommitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncGitCommitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncGitCommitRequest) ProtoMessage() {} - -func (x *SyncGitCommitRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncGitCommitRequest.ProtoReflect.Descriptor instead. -func (*SyncGitCommitRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP(), []int{3} -} - -func (x *SyncGitCommitRequest) GetOwner() string { - if x != nil { - return x.Owner - } - return "" -} - -func (x *SyncGitCommitRequest) GetRepository() string { - if x != nil { - return x.Repository - } - return "" -} - -func (x *SyncGitCommitRequest) GetBranch() string { - if x != nil { - return x.Branch - } - return "" -} - -func (x *SyncGitCommitRequest) GetManifest() *v1alpha1.Blob { - if x != nil { - return x.Manifest - } - return nil -} - -func (x *SyncGitCommitRequest) GetBlobs() []*v1alpha1.Blob { - if x != nil { - return x.Blobs - } - return nil -} - -func (x *SyncGitCommitRequest) GetHash() string { - if x != nil { - return x.Hash - } - return "" -} - -func (x *SyncGitCommitRequest) GetAuthor() *GitIdentity { - if x != nil { - return x.Author - } - return nil -} - -func (x *SyncGitCommitRequest) GetCommiter() *GitIdentity { - if x != nil { - return x.Commiter - } - return nil -} - -func (x *SyncGitCommitRequest) GetTags() []string { - if x != nil { - return x.Tags - } - return nil -} - -type SyncGitCommitResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // SyncPoint is the latest syncpoint for the SyncGitCommit request. - SyncPoint *GitSyncPoint `protobuf:"bytes,1,opt,name=sync_point,json=syncPoint,proto3" json:"sync_point,omitempty"` -} - -func (x *SyncGitCommitResponse) Reset() { - *x = SyncGitCommitResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SyncGitCommitResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SyncGitCommitResponse) ProtoMessage() {} - -func (x *SyncGitCommitResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SyncGitCommitResponse.ProtoReflect.Descriptor instead. -func (*SyncGitCommitResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP(), []int{4} -} - -func (x *SyncGitCommitResponse) GetSyncPoint() *GitSyncPoint { - if x != nil { - return x.SyncPoint - } - return nil -} - -var File_buf_alpha_registry_v1alpha1_sync_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_sync_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x73, 0x79, - 0x6e, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x2e, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x67, 0x69, 0x74, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x01, - 0x0a, 0x0c, 0x47, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x12, 0x26, 0x0a, 0x0f, - 0x67, 0x69, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x67, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x48, 0x61, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0f, 0x62, 0x73, 0x72, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x62, - 0x73, 0x72, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x66, 0x0a, 0x16, - 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, - 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, - 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, - 0x61, 0x6e, 0x63, 0x68, 0x22, 0x63, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, 0x53, 0x79, - 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x48, 0x0a, 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, - 0x73, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x88, 0x03, 0x0a, 0x14, 0x53, 0x79, - 0x6e, 0x63, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x72, 0x61, 0x6e, - 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, - 0x12, 0x3b, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x62, 0x52, 0x08, 0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, - 0x05, 0x62, 0x6c, 0x6f, 0x62, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x62, 0x52, 0x05, 0x62, - 0x6c, 0x6f, 0x62, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x40, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, 0x44, 0x0a, 0x08, 0x63, 0x6f, - 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x49, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x52, 0x08, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x65, 0x72, - 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, - 0x74, 0x61, 0x67, 0x73, 0x22, 0x61, 0x0a, 0x15, 0x53, 0x79, 0x6e, 0x63, 0x47, 0x69, 0x74, 0x43, - 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, - 0x0a, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x79, - 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x32, 0x8e, 0x02, 0x0a, 0x0b, 0x53, 0x79, 0x6e, 0x63, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x81, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, - 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x33, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x69, 0x74, - 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x34, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x47, 0x69, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x7b, 0x0a, 0x0d, 0x53, - 0x79, 0x6e, 0x63, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, 0x31, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x47, - 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x79, - 0x6e, 0x63, 0x47, 0x69, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x96, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x09, 0x53, 0x79, - 0x6e, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, - 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_sync_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_sync_proto_rawDescData = file_buf_alpha_registry_v1alpha1_sync_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_sync_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_sync_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_sync_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_sync_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_sync_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_buf_alpha_registry_v1alpha1_sync_proto_goTypes = []interface{}{ - (*GitSyncPoint)(nil), // 0: buf.alpha.registry.v1alpha1.GitSyncPoint - (*GetGitSyncPointRequest)(nil), // 1: buf.alpha.registry.v1alpha1.GetGitSyncPointRequest - (*GetGitSyncPointResponse)(nil), // 2: buf.alpha.registry.v1alpha1.GetGitSyncPointResponse - (*SyncGitCommitRequest)(nil), // 3: buf.alpha.registry.v1alpha1.SyncGitCommitRequest - (*SyncGitCommitResponse)(nil), // 4: buf.alpha.registry.v1alpha1.SyncGitCommitResponse - (*v1alpha1.Blob)(nil), // 5: buf.alpha.module.v1alpha1.Blob - (*GitIdentity)(nil), // 6: buf.alpha.registry.v1alpha1.GitIdentity -} -var file_buf_alpha_registry_v1alpha1_sync_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.GetGitSyncPointResponse.sync_point:type_name -> buf.alpha.registry.v1alpha1.GitSyncPoint - 5, // 1: buf.alpha.registry.v1alpha1.SyncGitCommitRequest.manifest:type_name -> buf.alpha.module.v1alpha1.Blob - 5, // 2: buf.alpha.registry.v1alpha1.SyncGitCommitRequest.blobs:type_name -> buf.alpha.module.v1alpha1.Blob - 6, // 3: buf.alpha.registry.v1alpha1.SyncGitCommitRequest.author:type_name -> buf.alpha.registry.v1alpha1.GitIdentity - 6, // 4: buf.alpha.registry.v1alpha1.SyncGitCommitRequest.commiter:type_name -> buf.alpha.registry.v1alpha1.GitIdentity - 0, // 5: buf.alpha.registry.v1alpha1.SyncGitCommitResponse.sync_point:type_name -> buf.alpha.registry.v1alpha1.GitSyncPoint - 1, // 6: buf.alpha.registry.v1alpha1.SyncService.GetGitSyncPoint:input_type -> buf.alpha.registry.v1alpha1.GetGitSyncPointRequest - 3, // 7: buf.alpha.registry.v1alpha1.SyncService.SyncGitCommit:input_type -> buf.alpha.registry.v1alpha1.SyncGitCommitRequest - 2, // 8: buf.alpha.registry.v1alpha1.SyncService.GetGitSyncPoint:output_type -> buf.alpha.registry.v1alpha1.GetGitSyncPointResponse - 4, // 9: buf.alpha.registry.v1alpha1.SyncService.SyncGitCommit:output_type -> buf.alpha.registry.v1alpha1.SyncGitCommitResponse - 8, // [8:10] is the sub-list for method output_type - 6, // [6:8] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_sync_proto_init() } -func file_buf_alpha_registry_v1alpha1_sync_proto_init() { - if File_buf_alpha_registry_v1alpha1_sync_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_git_metadata_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GitSyncPoint); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGitSyncPointRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetGitSyncPointResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncGitCommitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncGitCommitResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_sync_proto_rawDesc, - NumEnums: 0, - NumMessages: 5, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_sync_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_sync_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_sync_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_sync_proto = out.File - file_buf_alpha_registry_v1alpha1_sync_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_sync_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_sync_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/token.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/token.pb.go deleted file mode 100644 index 80d764c540..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/token.pb.go +++ /dev/null @@ -1,823 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/token.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type Token struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - ExpireTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` - Note string `protobuf:"bytes,4,opt,name=note,proto3" json:"note,omitempty"` -} - -func (x *Token) Reset() { - *x = Token{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Token) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Token) ProtoMessage() {} - -func (x *Token) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Token.ProtoReflect.Descriptor instead. -func (*Token) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{0} -} - -func (x *Token) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Token) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Token) GetExpireTime() *timestamppb.Timestamp { - if x != nil { - return x.ExpireTime - } - return nil -} - -func (x *Token) GetNote() string { - if x != nil { - return x.Note - } - return "" -} - -type CreateTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Note string `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"` - // The time until which the token should be valid. - // Must be in the future. May be null for no expiry. - ExpireTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"` - // The ID of the user to create a new token, can only be - // the user who perform this action, or a machine user. - // Default to the user who perform this action if this is empty. - UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *CreateTokenRequest) Reset() { - *x = CreateTokenRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTokenRequest) ProtoMessage() {} - -func (x *CreateTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateTokenRequest.ProtoReflect.Descriptor instead. -func (*CreateTokenRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateTokenRequest) GetNote() string { - if x != nil { - return x.Note - } - return "" -} - -func (x *CreateTokenRequest) GetExpireTime() *timestamppb.Timestamp { - if x != nil { - return x.ExpireTime - } - return nil -} - -func (x *CreateTokenRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type CreateTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The plaintext token to use for authentication. - Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *CreateTokenResponse) Reset() { - *x = CreateTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTokenResponse) ProtoMessage() {} - -func (x *CreateTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateTokenResponse.ProtoReflect.Descriptor instead. -func (*CreateTokenResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateTokenResponse) GetToken() string { - if x != nil { - return x.Token - } - return "" -} - -type GetTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TokenId string `protobuf:"bytes,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` -} - -func (x *GetTokenRequest) Reset() { - *x = GetTokenRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTokenRequest) ProtoMessage() {} - -func (x *GetTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTokenRequest.ProtoReflect.Descriptor instead. -func (*GetTokenRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{3} -} - -func (x *GetTokenRequest) GetTokenId() string { - if x != nil { - return x.TokenId - } - return "" -} - -type GetTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Token *Token `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` -} - -func (x *GetTokenResponse) Reset() { - *x = GetTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTokenResponse) ProtoMessage() {} - -func (x *GetTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTokenResponse.ProtoReflect.Descriptor instead. -func (*GetTokenResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{4} -} - -func (x *GetTokenResponse) GetToken() *Token { - if x != nil { - return x.Token - } - return nil -} - -type ListTokensRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // The ID of the user to list tokens, can only be - // the user who perform this action, or a machine user. - // Default to the user who perform this action if this is empty. - UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` -} - -func (x *ListTokensRequest) Reset() { - *x = ListTokensRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTokensRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTokensRequest) ProtoMessage() {} - -func (x *ListTokensRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTokensRequest.ProtoReflect.Descriptor instead. -func (*ListTokensRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{5} -} - -func (x *ListTokensRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListTokensRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListTokensRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -func (x *ListTokensRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type ListTokensResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Tokens []*Token `protobuf:"bytes,1,rep,name=tokens,proto3" json:"tokens,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListTokensResponse) Reset() { - *x = ListTokensResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTokensResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTokensResponse) ProtoMessage() {} - -func (x *ListTokensResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTokensResponse.ProtoReflect.Descriptor instead. -func (*ListTokensResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{6} -} - -func (x *ListTokensResponse) GetTokens() []*Token { - if x != nil { - return x.Tokens - } - return nil -} - -func (x *ListTokensResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type DeleteTokenRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TokenId string `protobuf:"bytes,1,opt,name=token_id,json=tokenId,proto3" json:"token_id,omitempty"` -} - -func (x *DeleteTokenRequest) Reset() { - *x = DeleteTokenRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTokenRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTokenRequest) ProtoMessage() {} - -func (x *DeleteTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteTokenRequest.ProtoReflect.Descriptor instead. -func (*DeleteTokenRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{7} -} - -func (x *DeleteTokenRequest) GetTokenId() string { - if x != nil { - return x.TokenId - } - return "" -} - -type DeleteTokenResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteTokenResponse) Reset() { - *x = DeleteTokenResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTokenResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTokenResponse) ProtoMessage() {} - -func (x *DeleteTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteTokenResponse.ProtoReflect.Descriptor instead. -func (*DeleteTokenResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP(), []int{8} -} - -var File_buf_alpha_registry_v1alpha1_token_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_token_proto_rawDesc = []byte{ - 0x0a, 0x27, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x01, 0x0a, 0x05, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, - 0x0a, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x6f, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x22, - 0x7e, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x6f, 0x74, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x65, 0x78, 0x70, - 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, - 0x2b, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2c, 0x0a, 0x0f, - 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x22, 0x4c, 0x0a, 0x10, 0x47, 0x65, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, - 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, - 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, - 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, - 0x65, 0x72, 0x73, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x78, 0x0a, - 0x12, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x06, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2f, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, - 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x49, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, - 0xd9, 0x03, 0x0a, 0x0c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x70, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2c, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x72, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x2e, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x03, 0x90, 0x02, 0x01, 0x12, 0x75, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x42, 0x97, 0x02, 0x0a, 0x1f, - 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, - 0x0a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_token_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_token_proto_rawDescData = file_buf_alpha_registry_v1alpha1_token_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_token_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_token_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_token_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_token_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_token_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_token_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_buf_alpha_registry_v1alpha1_token_proto_goTypes = []interface{}{ - (*Token)(nil), // 0: buf.alpha.registry.v1alpha1.Token - (*CreateTokenRequest)(nil), // 1: buf.alpha.registry.v1alpha1.CreateTokenRequest - (*CreateTokenResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateTokenResponse - (*GetTokenRequest)(nil), // 3: buf.alpha.registry.v1alpha1.GetTokenRequest - (*GetTokenResponse)(nil), // 4: buf.alpha.registry.v1alpha1.GetTokenResponse - (*ListTokensRequest)(nil), // 5: buf.alpha.registry.v1alpha1.ListTokensRequest - (*ListTokensResponse)(nil), // 6: buf.alpha.registry.v1alpha1.ListTokensResponse - (*DeleteTokenRequest)(nil), // 7: buf.alpha.registry.v1alpha1.DeleteTokenRequest - (*DeleteTokenResponse)(nil), // 8: buf.alpha.registry.v1alpha1.DeleteTokenResponse - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_token_proto_depIdxs = []int32{ - 9, // 0: buf.alpha.registry.v1alpha1.Token.create_time:type_name -> google.protobuf.Timestamp - 9, // 1: buf.alpha.registry.v1alpha1.Token.expire_time:type_name -> google.protobuf.Timestamp - 9, // 2: buf.alpha.registry.v1alpha1.CreateTokenRequest.expire_time:type_name -> google.protobuf.Timestamp - 0, // 3: buf.alpha.registry.v1alpha1.GetTokenResponse.token:type_name -> buf.alpha.registry.v1alpha1.Token - 0, // 4: buf.alpha.registry.v1alpha1.ListTokensResponse.tokens:type_name -> buf.alpha.registry.v1alpha1.Token - 1, // 5: buf.alpha.registry.v1alpha1.TokenService.CreateToken:input_type -> buf.alpha.registry.v1alpha1.CreateTokenRequest - 3, // 6: buf.alpha.registry.v1alpha1.TokenService.GetToken:input_type -> buf.alpha.registry.v1alpha1.GetTokenRequest - 5, // 7: buf.alpha.registry.v1alpha1.TokenService.ListTokens:input_type -> buf.alpha.registry.v1alpha1.ListTokensRequest - 7, // 8: buf.alpha.registry.v1alpha1.TokenService.DeleteToken:input_type -> buf.alpha.registry.v1alpha1.DeleteTokenRequest - 2, // 9: buf.alpha.registry.v1alpha1.TokenService.CreateToken:output_type -> buf.alpha.registry.v1alpha1.CreateTokenResponse - 4, // 10: buf.alpha.registry.v1alpha1.TokenService.GetToken:output_type -> buf.alpha.registry.v1alpha1.GetTokenResponse - 6, // 11: buf.alpha.registry.v1alpha1.TokenService.ListTokens:output_type -> buf.alpha.registry.v1alpha1.ListTokensResponse - 8, // 12: buf.alpha.registry.v1alpha1.TokenService.DeleteToken:output_type -> buf.alpha.registry.v1alpha1.DeleteTokenResponse - 9, // [9:13] is the sub-list for method output_type - 5, // [5:9] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_token_proto_init() } -func file_buf_alpha_registry_v1alpha1_token_proto_init() { - if File_buf_alpha_registry_v1alpha1_token_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Token); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTokenRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTokenResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTokenRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTokenResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTokensRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTokensResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTokenRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_token_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTokenResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_token_proto_rawDesc, - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_token_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_token_proto_depIdxs, - MessageInfos: file_buf_alpha_registry_v1alpha1_token_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_token_proto = out.File - file_buf_alpha_registry_v1alpha1_token_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_token_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_token_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/usage.gen.go deleted file mode 100644 index c90b84e4d7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package registryv1alpha1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/user.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/user.pb.go deleted file mode 100644 index b295ead1b2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/user.pb.go +++ /dev/null @@ -1,1998 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/user.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type UserState int32 - -const ( - UserState_USER_STATE_UNSPECIFIED UserState = 0 - UserState_USER_STATE_ACTIVE UserState = 1 - UserState_USER_STATE_DEACTIVATED UserState = 2 -) - -// Enum value maps for UserState. -var ( - UserState_name = map[int32]string{ - 0: "USER_STATE_UNSPECIFIED", - 1: "USER_STATE_ACTIVE", - 2: "USER_STATE_DEACTIVATED", - } - UserState_value = map[string]int32{ - "USER_STATE_UNSPECIFIED": 0, - "USER_STATE_ACTIVE": 1, - "USER_STATE_DEACTIVATED": 2, - } -) - -func (x UserState) Enum() *UserState { - p := new(UserState) - *p = x - return p -} - -func (x UserState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UserState) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[0].Descriptor() -} - -func (UserState) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[0] -} - -func (x UserState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UserState.Descriptor instead. -func (UserState) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{0} -} - -type UserType int32 - -const ( - UserType_USER_TYPE_UNSPECIFIED UserType = 0 - UserType_USER_TYPE_PERSONAL UserType = 1 - UserType_USER_TYPE_MACHINE UserType = 2 - UserType_USER_TYPE_SYSTEM UserType = 3 -) - -// Enum value maps for UserType. -var ( - UserType_name = map[int32]string{ - 0: "USER_TYPE_UNSPECIFIED", - 1: "USER_TYPE_PERSONAL", - 2: "USER_TYPE_MACHINE", - 3: "USER_TYPE_SYSTEM", - } - UserType_value = map[string]int32{ - "USER_TYPE_UNSPECIFIED": 0, - "USER_TYPE_PERSONAL": 1, - "USER_TYPE_MACHINE": 2, - "USER_TYPE_SYSTEM": 3, - } -) - -func (x UserType) Enum() *UserType { - p := new(UserType) - *p = x - return p -} - -func (x UserType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UserType) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[1].Descriptor() -} - -func (UserType) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_user_proto_enumTypes[1] -} - -func (x UserType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UserType.Descriptor instead. -func (UserType) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{1} -} - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // primary key, unique, immutable - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // immutable - CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // mutable - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // unique, mutable - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - // mutable - Deactivated bool `protobuf:"varint,5,opt,name=deactivated,proto3" json:"deactivated,omitempty"` - // description is the user configurable description of the user. - Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` - // url is the user configurable URL in the description of the user, - // always included the scheme and will not have a #fragment suffix. - Url string `protobuf:"bytes,7,opt,name=url,proto3" json:"url,omitempty"` - // verification status of the user, configurable by server admin. - VerificationStatus VerificationStatus `protobuf:"varint,8,opt,name=verification_status,json=verificationStatus,proto3,enum=buf.alpha.registry.v1alpha1.VerificationStatus" json:"verification_status,omitempty"` - // user type of the user, depends on how the user was created. - UserType UserType `protobuf:"varint,9,opt,name=user_type,json=userType,proto3,enum=buf.alpha.registry.v1alpha1.UserType" json:"user_type,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{0} -} - -func (x *User) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *User) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *User) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *User) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -func (x *User) GetDeactivated() bool { - if x != nil { - return x.Deactivated - } - return false -} - -func (x *User) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *User) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -func (x *User) GetVerificationStatus() VerificationStatus { - if x != nil { - return x.VerificationStatus - } - return VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED -} - -func (x *User) GetUserType() UserType { - if x != nil { - return x.UserType - } - return UserType_USER_TYPE_UNSPECIFIED -} - -// TODO: #663 move this to organization service -type OrganizationUser struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - // The ID of the organization for which the role belongs to. - OrganizationId string `protobuf:"bytes,2,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - // The role that the user has in the organization above. - OrganizationRole OrganizationRole `protobuf:"varint,3,opt,name=organization_role,json=organizationRole,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRole" json:"organization_role,omitempty"` - // The source of the user's role in the organization above. - OrganizationRoleSource OrganizationRoleSource `protobuf:"varint,4,opt,name=organization_role_source,json=organizationRoleSource,proto3,enum=buf.alpha.registry.v1alpha1.OrganizationRoleSource" json:"organization_role_source,omitempty"` -} - -func (x *OrganizationUser) Reset() { - *x = OrganizationUser{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OrganizationUser) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OrganizationUser) ProtoMessage() {} - -func (x *OrganizationUser) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OrganizationUser.ProtoReflect.Descriptor instead. -func (*OrganizationUser) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{1} -} - -func (x *OrganizationUser) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -func (x *OrganizationUser) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *OrganizationUser) GetOrganizationRole() OrganizationRole { - if x != nil { - return x.OrganizationRole - } - return OrganizationRole_ORGANIZATION_ROLE_UNSPECIFIED -} - -func (x *OrganizationUser) GetOrganizationRoleSource() OrganizationRoleSource { - if x != nil { - return x.OrganizationRoleSource - } - return OrganizationRoleSource_ORGANIZATION_ROLE_SOURCE_UNSPECIFIED -} - -type CreateUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` -} - -func (x *CreateUserRequest) Reset() { - *x = CreateUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUserRequest) ProtoMessage() {} - -func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. -func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateUserRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -type CreateUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *CreateUserResponse) Reset() { - *x = CreateUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUserResponse) ProtoMessage() {} - -func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. -func (*CreateUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type GetUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetUserRequest) Reset() { - *x = GetUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserRequest) ProtoMessage() {} - -func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. -func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{4} -} - -func (x *GetUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetUserResponse) Reset() { - *x = GetUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserResponse) ProtoMessage() {} - -func (x *GetUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. -func (*GetUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{5} -} - -func (x *GetUserResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type GetUserByUsernameRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` -} - -func (x *GetUserByUsernameRequest) Reset() { - *x = GetUserByUsernameRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserByUsernameRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserByUsernameRequest) ProtoMessage() {} - -func (x *GetUserByUsernameRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserByUsernameRequest.ProtoReflect.Descriptor instead. -func (*GetUserByUsernameRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{6} -} - -func (x *GetUserByUsernameRequest) GetUsername() string { - if x != nil { - return x.Username - } - return "" -} - -type GetUserByUsernameResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetUserByUsernameResponse) Reset() { - *x = GetUserByUsernameResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserByUsernameResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserByUsernameResponse) ProtoMessage() {} - -func (x *GetUserByUsernameResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserByUsernameResponse.ProtoReflect.Descriptor instead. -func (*GetUserByUsernameResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{7} -} - -func (x *GetUserByUsernameResponse) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type ListUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - PageSize uint32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,3,opt,name=reverse,proto3" json:"reverse,omitempty"` - // If the user_state_filter is unspecified, users of all states are included. - UserStateFilter UserState `protobuf:"varint,4,opt,name=user_state_filter,json=userStateFilter,proto3,enum=buf.alpha.registry.v1alpha1.UserState" json:"user_state_filter,omitempty"` - // If the user_type_filters is empty, users of all types are included. - UserTypeFilters []UserType `protobuf:"varint,5,rep,packed,name=user_type_filters,json=userTypeFilters,proto3,enum=buf.alpha.registry.v1alpha1.UserType" json:"user_type_filters,omitempty"` -} - -func (x *ListUsersRequest) Reset() { - *x = ListUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersRequest) ProtoMessage() {} - -func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead. -func (*ListUsersRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{8} -} - -func (x *ListUsersRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListUsersRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListUsersRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -func (x *ListUsersRequest) GetUserStateFilter() UserState { - if x != nil { - return x.UserStateFilter - } - return UserState_USER_STATE_UNSPECIFIED -} - -func (x *ListUsersRequest) GetUserTypeFilters() []UserType { - if x != nil { - return x.UserTypeFilters - } - return nil -} - -type ListUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListUsersResponse) Reset() { - *x = ListUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersResponse) ProtoMessage() {} - -func (x *ListUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead. -func (*ListUsersResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{9} -} - -func (x *ListUsersResponse) GetUsers() []*User { - if x != nil { - return x.Users - } - return nil -} - -func (x *ListUsersResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type ListOrganizationUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OrganizationId string `protobuf:"bytes,1,opt,name=organization_id,json=organizationId,proto3" json:"organization_id,omitempty"` - PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // The first page is returned if this is empty. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - Reverse bool `protobuf:"varint,4,opt,name=reverse,proto3" json:"reverse,omitempty"` -} - -func (x *ListOrganizationUsersRequest) Reset() { - *x = ListOrganizationUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationUsersRequest) ProtoMessage() {} - -func (x *ListOrganizationUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationUsersRequest.ProtoReflect.Descriptor instead. -func (*ListOrganizationUsersRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{10} -} - -func (x *ListOrganizationUsersRequest) GetOrganizationId() string { - if x != nil { - return x.OrganizationId - } - return "" -} - -func (x *ListOrganizationUsersRequest) GetPageSize() uint32 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *ListOrganizationUsersRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -func (x *ListOrganizationUsersRequest) GetReverse() bool { - if x != nil { - return x.Reverse - } - return false -} - -type ListOrganizationUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Users []*OrganizationUser `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` - // There are no more pages if this is empty. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListOrganizationUsersResponse) Reset() { - *x = ListOrganizationUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListOrganizationUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListOrganizationUsersResponse) ProtoMessage() {} - -func (x *ListOrganizationUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListOrganizationUsersResponse.ProtoReflect.Descriptor instead. -func (*ListOrganizationUsersResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{11} -} - -func (x *ListOrganizationUsersResponse) GetUsers() []*OrganizationUser { - if x != nil { - return x.Users - } - return nil -} - -func (x *ListOrganizationUsersResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -type DeleteUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteUserRequest) Reset() { - *x = DeleteUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserRequest) ProtoMessage() {} - -func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. -func (*DeleteUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{12} -} - -type DeleteUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteUserResponse) Reset() { - *x = DeleteUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserResponse) ProtoMessage() {} - -func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. -func (*DeleteUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{13} -} - -type DeactivateUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeactivateUserRequest) Reset() { - *x = DeactivateUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeactivateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeactivateUserRequest) ProtoMessage() {} - -func (x *DeactivateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeactivateUserRequest.ProtoReflect.Descriptor instead. -func (*DeactivateUserRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{14} -} - -func (x *DeactivateUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type DeactivateUserResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeactivateUserResponse) Reset() { - *x = DeactivateUserResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeactivateUserResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeactivateUserResponse) ProtoMessage() {} - -func (x *DeactivateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeactivateUserResponse.ProtoReflect.Descriptor instead. -func (*DeactivateUserResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{15} -} - -type UpdateUserServerRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The ID of the user for which to be updated a role. - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // The new role of the user in the server. - ServerRole ServerRole `protobuf:"varint,2,opt,name=server_role,json=serverRole,proto3,enum=buf.alpha.registry.v1alpha1.ServerRole" json:"server_role,omitempty"` -} - -func (x *UpdateUserServerRoleRequest) Reset() { - *x = UpdateUserServerRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserServerRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserServerRoleRequest) ProtoMessage() {} - -func (x *UpdateUserServerRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserServerRoleRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserServerRoleRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{16} -} - -func (x *UpdateUserServerRoleRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *UpdateUserServerRoleRequest) GetServerRole() ServerRole { - if x != nil { - return x.ServerRole - } - return ServerRole_SERVER_ROLE_UNSPECIFIED -} - -type UpdateUserServerRoleResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateUserServerRoleResponse) Reset() { - *x = UpdateUserServerRoleResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserServerRoleResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserServerRoleResponse) ProtoMessage() {} - -func (x *UpdateUserServerRoleResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserServerRoleResponse.ProtoReflect.Descriptor instead. -func (*UpdateUserServerRoleResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{17} -} - -type CountUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // If the user_state_filter is unspecified, all users are included. - UserStateFilter UserState `protobuf:"varint,1,opt,name=user_state_filter,json=userStateFilter,proto3,enum=buf.alpha.registry.v1alpha1.UserState" json:"user_state_filter,omitempty"` -} - -func (x *CountUsersRequest) Reset() { - *x = CountUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountUsersRequest) ProtoMessage() {} - -func (x *CountUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CountUsersRequest.ProtoReflect.Descriptor instead. -func (*CountUsersRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{18} -} - -func (x *CountUsersRequest) GetUserStateFilter() UserState { - if x != nil { - return x.UserStateFilter - } - return UserState_USER_STATE_UNSPECIFIED -} - -type CountUsersResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TotalCount uint32 `protobuf:"varint,1,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` -} - -func (x *CountUsersResponse) Reset() { - *x = CountUsersResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CountUsersResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CountUsersResponse) ProtoMessage() {} - -func (x *CountUsersResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CountUsersResponse.ProtoReflect.Descriptor instead. -func (*CountUsersResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{19} -} - -func (x *CountUsersResponse) GetTotalCount() uint32 { - if x != nil { - return x.TotalCount - } - return 0 -} - -type UpdateUserSettingsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - // optional, update to description will only be made when this is present - Description *string `protobuf:"bytes,2,opt,name=description,proto3,oneof" json:"description,omitempty"` - // optional, update to url will only be made when this is present - Url *string `protobuf:"bytes,3,opt,name=url,proto3,oneof" json:"url,omitempty"` -} - -func (x *UpdateUserSettingsRequest) Reset() { - *x = UpdateUserSettingsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserSettingsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserSettingsRequest) ProtoMessage() {} - -func (x *UpdateUserSettingsRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserSettingsRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserSettingsRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{20} -} - -func (x *UpdateUserSettingsRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *UpdateUserSettingsRequest) GetDescription() string { - if x != nil && x.Description != nil { - return *x.Description - } - return "" -} - -func (x *UpdateUserSettingsRequest) GetUrl() string { - if x != nil && x.Url != nil { - return *x.Url - } - return "" -} - -type UpdateUserSettingsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *UpdateUserSettingsResponse) Reset() { - *x = UpdateUserSettingsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserSettingsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserSettingsResponse) ProtoMessage() {} - -func (x *UpdateUserSettingsResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserSettingsResponse.ProtoReflect.Descriptor instead. -func (*UpdateUserSettingsResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP(), []int{21} -} - -var File_buf_alpha_registry_v1alpha1_user_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_user_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x35, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa8, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3b, - 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, - 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x61, 0x74, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x60, 0x0a, 0x13, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x12, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x42, 0x0a, 0x09, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, - 0x22, 0xbd, 0x02, 0x0a, 0x10, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, - 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x5a, 0x0a, 0x11, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, - 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x10, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, - 0x65, 0x12, 0x6d, 0x0a, 0x18, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x33, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, - 0x6c, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x16, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x22, 0x2f, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x22, 0x4b, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x20, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x48, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x36, 0x0a, 0x18, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x22, 0x52, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x35, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x8f, 0x02, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, - 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, - 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, - 0x65, 0x12, 0x52, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, - 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x46, - 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x25, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x22, 0x74, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, - 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9d, - 0x01, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x27, 0x0a, 0x0f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x22, 0x8c, - 0x01, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x43, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4f, 0x72, - 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, - 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x13, 0x0a, - 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x61, 0x63, - 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x01, 0x0a, 0x1b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, - 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x48, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x72, - 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x6f, - 0x6c, 0x65, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x1e, - 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x67, - 0x0a, 0x11, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x12, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x8a, - 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, - 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x03, 0x75, 0x72, 0x6c, - 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x1c, 0x0a, 0x1a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x5a, 0x0a, 0x09, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, - 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, - 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x55, 0x53, 0x45, - 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, - 0x54, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x6a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, - 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x45, 0x52, 0x53, 0x4f, 0x4e, - 0x41, 0x4c, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x4d, 0x41, 0x43, 0x48, 0x49, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x55, - 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x10, - 0x03, 0x32, 0xfb, 0x09, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x72, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x69, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x2b, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x87, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x35, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, - 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x36, 0x2e, - 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x42, 0x79, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x6f, 0x0a, 0x09, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x2d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x15, - 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x3a, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x55, - 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x12, 0x72, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x7e, 0x0a, 0x0e, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, - 0x76, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x8b, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x38, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x6f, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x0a, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x12, 0x2e, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x85, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x36, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x37, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x96, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x42, 0x09, 0x55, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, - 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, - 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, - 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, - 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_user_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_user_proto_rawDescData = file_buf_alpha_registry_v1alpha1_user_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_user_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_user_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_user_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_user_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_buf_alpha_registry_v1alpha1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 22) -var file_buf_alpha_registry_v1alpha1_user_proto_goTypes = []interface{}{ - (UserState)(0), // 0: buf.alpha.registry.v1alpha1.UserState - (UserType)(0), // 1: buf.alpha.registry.v1alpha1.UserType - (*User)(nil), // 2: buf.alpha.registry.v1alpha1.User - (*OrganizationUser)(nil), // 3: buf.alpha.registry.v1alpha1.OrganizationUser - (*CreateUserRequest)(nil), // 4: buf.alpha.registry.v1alpha1.CreateUserRequest - (*CreateUserResponse)(nil), // 5: buf.alpha.registry.v1alpha1.CreateUserResponse - (*GetUserRequest)(nil), // 6: buf.alpha.registry.v1alpha1.GetUserRequest - (*GetUserResponse)(nil), // 7: buf.alpha.registry.v1alpha1.GetUserResponse - (*GetUserByUsernameRequest)(nil), // 8: buf.alpha.registry.v1alpha1.GetUserByUsernameRequest - (*GetUserByUsernameResponse)(nil), // 9: buf.alpha.registry.v1alpha1.GetUserByUsernameResponse - (*ListUsersRequest)(nil), // 10: buf.alpha.registry.v1alpha1.ListUsersRequest - (*ListUsersResponse)(nil), // 11: buf.alpha.registry.v1alpha1.ListUsersResponse - (*ListOrganizationUsersRequest)(nil), // 12: buf.alpha.registry.v1alpha1.ListOrganizationUsersRequest - (*ListOrganizationUsersResponse)(nil), // 13: buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse - (*DeleteUserRequest)(nil), // 14: buf.alpha.registry.v1alpha1.DeleteUserRequest - (*DeleteUserResponse)(nil), // 15: buf.alpha.registry.v1alpha1.DeleteUserResponse - (*DeactivateUserRequest)(nil), // 16: buf.alpha.registry.v1alpha1.DeactivateUserRequest - (*DeactivateUserResponse)(nil), // 17: buf.alpha.registry.v1alpha1.DeactivateUserResponse - (*UpdateUserServerRoleRequest)(nil), // 18: buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest - (*UpdateUserServerRoleResponse)(nil), // 19: buf.alpha.registry.v1alpha1.UpdateUserServerRoleResponse - (*CountUsersRequest)(nil), // 20: buf.alpha.registry.v1alpha1.CountUsersRequest - (*CountUsersResponse)(nil), // 21: buf.alpha.registry.v1alpha1.CountUsersResponse - (*UpdateUserSettingsRequest)(nil), // 22: buf.alpha.registry.v1alpha1.UpdateUserSettingsRequest - (*UpdateUserSettingsResponse)(nil), // 23: buf.alpha.registry.v1alpha1.UpdateUserSettingsResponse - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp - (VerificationStatus)(0), // 25: buf.alpha.registry.v1alpha1.VerificationStatus - (OrganizationRole)(0), // 26: buf.alpha.registry.v1alpha1.OrganizationRole - (OrganizationRoleSource)(0), // 27: buf.alpha.registry.v1alpha1.OrganizationRoleSource - (ServerRole)(0), // 28: buf.alpha.registry.v1alpha1.ServerRole -} -var file_buf_alpha_registry_v1alpha1_user_proto_depIdxs = []int32{ - 24, // 0: buf.alpha.registry.v1alpha1.User.create_time:type_name -> google.protobuf.Timestamp - 24, // 1: buf.alpha.registry.v1alpha1.User.update_time:type_name -> google.protobuf.Timestamp - 25, // 2: buf.alpha.registry.v1alpha1.User.verification_status:type_name -> buf.alpha.registry.v1alpha1.VerificationStatus - 1, // 3: buf.alpha.registry.v1alpha1.User.user_type:type_name -> buf.alpha.registry.v1alpha1.UserType - 2, // 4: buf.alpha.registry.v1alpha1.OrganizationUser.user:type_name -> buf.alpha.registry.v1alpha1.User - 26, // 5: buf.alpha.registry.v1alpha1.OrganizationUser.organization_role:type_name -> buf.alpha.registry.v1alpha1.OrganizationRole - 27, // 6: buf.alpha.registry.v1alpha1.OrganizationUser.organization_role_source:type_name -> buf.alpha.registry.v1alpha1.OrganizationRoleSource - 2, // 7: buf.alpha.registry.v1alpha1.CreateUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 2, // 8: buf.alpha.registry.v1alpha1.GetUserResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 2, // 9: buf.alpha.registry.v1alpha1.GetUserByUsernameResponse.user:type_name -> buf.alpha.registry.v1alpha1.User - 0, // 10: buf.alpha.registry.v1alpha1.ListUsersRequest.user_state_filter:type_name -> buf.alpha.registry.v1alpha1.UserState - 1, // 11: buf.alpha.registry.v1alpha1.ListUsersRequest.user_type_filters:type_name -> buf.alpha.registry.v1alpha1.UserType - 2, // 12: buf.alpha.registry.v1alpha1.ListUsersResponse.users:type_name -> buf.alpha.registry.v1alpha1.User - 3, // 13: buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse.users:type_name -> buf.alpha.registry.v1alpha1.OrganizationUser - 28, // 14: buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest.server_role:type_name -> buf.alpha.registry.v1alpha1.ServerRole - 0, // 15: buf.alpha.registry.v1alpha1.CountUsersRequest.user_state_filter:type_name -> buf.alpha.registry.v1alpha1.UserState - 4, // 16: buf.alpha.registry.v1alpha1.UserService.CreateUser:input_type -> buf.alpha.registry.v1alpha1.CreateUserRequest - 6, // 17: buf.alpha.registry.v1alpha1.UserService.GetUser:input_type -> buf.alpha.registry.v1alpha1.GetUserRequest - 8, // 18: buf.alpha.registry.v1alpha1.UserService.GetUserByUsername:input_type -> buf.alpha.registry.v1alpha1.GetUserByUsernameRequest - 10, // 19: buf.alpha.registry.v1alpha1.UserService.ListUsers:input_type -> buf.alpha.registry.v1alpha1.ListUsersRequest - 12, // 20: buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers:input_type -> buf.alpha.registry.v1alpha1.ListOrganizationUsersRequest - 14, // 21: buf.alpha.registry.v1alpha1.UserService.DeleteUser:input_type -> buf.alpha.registry.v1alpha1.DeleteUserRequest - 16, // 22: buf.alpha.registry.v1alpha1.UserService.DeactivateUser:input_type -> buf.alpha.registry.v1alpha1.DeactivateUserRequest - 18, // 23: buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole:input_type -> buf.alpha.registry.v1alpha1.UpdateUserServerRoleRequest - 20, // 24: buf.alpha.registry.v1alpha1.UserService.CountUsers:input_type -> buf.alpha.registry.v1alpha1.CountUsersRequest - 22, // 25: buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings:input_type -> buf.alpha.registry.v1alpha1.UpdateUserSettingsRequest - 5, // 26: buf.alpha.registry.v1alpha1.UserService.CreateUser:output_type -> buf.alpha.registry.v1alpha1.CreateUserResponse - 7, // 27: buf.alpha.registry.v1alpha1.UserService.GetUser:output_type -> buf.alpha.registry.v1alpha1.GetUserResponse - 9, // 28: buf.alpha.registry.v1alpha1.UserService.GetUserByUsername:output_type -> buf.alpha.registry.v1alpha1.GetUserByUsernameResponse - 11, // 29: buf.alpha.registry.v1alpha1.UserService.ListUsers:output_type -> buf.alpha.registry.v1alpha1.ListUsersResponse - 13, // 30: buf.alpha.registry.v1alpha1.UserService.ListOrganizationUsers:output_type -> buf.alpha.registry.v1alpha1.ListOrganizationUsersResponse - 15, // 31: buf.alpha.registry.v1alpha1.UserService.DeleteUser:output_type -> buf.alpha.registry.v1alpha1.DeleteUserResponse - 17, // 32: buf.alpha.registry.v1alpha1.UserService.DeactivateUser:output_type -> buf.alpha.registry.v1alpha1.DeactivateUserResponse - 19, // 33: buf.alpha.registry.v1alpha1.UserService.UpdateUserServerRole:output_type -> buf.alpha.registry.v1alpha1.UpdateUserServerRoleResponse - 21, // 34: buf.alpha.registry.v1alpha1.UserService.CountUsers:output_type -> buf.alpha.registry.v1alpha1.CountUsersResponse - 23, // 35: buf.alpha.registry.v1alpha1.UserService.UpdateUserSettings:output_type -> buf.alpha.registry.v1alpha1.UpdateUserSettingsResponse - 26, // [26:36] is the sub-list for method output_type - 16, // [16:26] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_user_proto_init() } -func file_buf_alpha_registry_v1alpha1_user_proto_init() { - if File_buf_alpha_registry_v1alpha1_user_proto != nil { - return - } - file_buf_alpha_registry_v1alpha1_role_proto_init() - file_buf_alpha_registry_v1alpha1_verification_status_proto_init() - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrganizationUser); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserByUsernameRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserByUsernameResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListOrganizationUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeactivateUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeactivateUserResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserServerRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserServerRoleResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CountUsersResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_buf_alpha_registry_v1alpha1_user_proto_msgTypes[20].OneofWrappers = []interface{}{} - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_user_proto_rawDesc, - NumEnums: 2, - NumMessages: 22, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_user_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_user_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_user_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_user_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_user_proto = out.File - file_buf_alpha_registry_v1alpha1_user_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_user_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_user_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/verification_status.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/verification_status.pb.go deleted file mode 100644 index 5d64a6f1bd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/verification_status.pb.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/verification_status.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// VerificationStatus is the verification status of an owner on if we recognize them, -// an owner can be either user or organization. -type VerificationStatus int32 - -const ( - VerificationStatus_VERIFICATION_STATUS_UNSPECIFIED VerificationStatus = 0 - // OFFICIAL indicates that the owner is maintained by Buf. - VerificationStatus_VERIFICATION_STATUS_OFFICIAL VerificationStatus = 1 - // VERIFIED_PUBLISHER indicates that the owner is a third-party that has been - // verified by Buf. - VerificationStatus_VERIFICATION_STATUS_VERIFIED_PUBLISHER VerificationStatus = 2 -) - -// Enum value maps for VerificationStatus. -var ( - VerificationStatus_name = map[int32]string{ - 0: "VERIFICATION_STATUS_UNSPECIFIED", - 1: "VERIFICATION_STATUS_OFFICIAL", - 2: "VERIFICATION_STATUS_VERIFIED_PUBLISHER", - } - VerificationStatus_value = map[string]int32{ - "VERIFICATION_STATUS_UNSPECIFIED": 0, - "VERIFICATION_STATUS_OFFICIAL": 1, - "VERIFICATION_STATUS_VERIFIED_PUBLISHER": 2, - } -) - -func (x VerificationStatus) Enum() *VerificationStatus { - p := new(VerificationStatus) - *p = x - return p -} - -func (x VerificationStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (VerificationStatus) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes[0].Descriptor() -} - -func (VerificationStatus) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes[0] -} - -func (x VerificationStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use VerificationStatus.Descriptor instead. -func (VerificationStatus) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescGZIP(), []int{0} -} - -var File_buf_alpha_registry_v1alpha1_verification_status_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc = []byte{ - 0x0a, 0x35, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2a, 0x87, 0x01, 0x0a, 0x12, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x1f, 0x56, - 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, - 0x12, 0x20, 0x0a, 0x1c, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4f, 0x46, 0x46, 0x49, 0x43, 0x49, 0x41, 0x4c, - 0x10, 0x01, 0x12, 0x2a, 0x0a, 0x26, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x53, 0x48, 0x45, 0x52, 0x10, 0x02, 0x42, 0xa4, - 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x42, 0x17, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, - 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, - 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, - 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescData = file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes = []interface{}{ - (VerificationStatus)(0), // 0: buf.alpha.registry.v1alpha1.VerificationStatus -} -var file_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_verification_status_proto_init() } -func file_buf_alpha_registry_v1alpha1_verification_status_proto_init() { - if File_buf_alpha_registry_v1alpha1_verification_status_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_verification_status_proto_enumTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_verification_status_proto = out.File - file_buf_alpha_registry_v1alpha1_verification_status_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_verification_status_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_verification_status_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/webhook.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/webhook.pb.go deleted file mode 100644 index 7094f4aa9b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/registry/v1alpha1/webhook.pb.go +++ /dev/null @@ -1,816 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/registry/v1alpha1/webhook.proto - -package registryv1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// WebhookEvent contains the currently supported webhook event types. -type WebhookEvent int32 - -const ( - // WEBHOOK_EVENT_UNSPECIFIED is a safe noop default for webhook events - // subscription. It will trigger an error if trying to register a webhook with - // this event. - WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED WebhookEvent = 0 - // WEBHOOK_EVENT_REPOSITORY_PUSH is emitted whenever a successful buf push is - // completed for a specific repository. - WebhookEvent_WEBHOOK_EVENT_REPOSITORY_PUSH WebhookEvent = 1 -) - -// Enum value maps for WebhookEvent. -var ( - WebhookEvent_name = map[int32]string{ - 0: "WEBHOOK_EVENT_UNSPECIFIED", - 1: "WEBHOOK_EVENT_REPOSITORY_PUSH", - } - WebhookEvent_value = map[string]int32{ - "WEBHOOK_EVENT_UNSPECIFIED": 0, - "WEBHOOK_EVENT_REPOSITORY_PUSH": 1, - } -) - -func (x WebhookEvent) Enum() *WebhookEvent { - p := new(WebhookEvent) - *p = x - return p -} - -func (x WebhookEvent) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WebhookEvent) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes[0].Descriptor() -} - -func (WebhookEvent) Type() protoreflect.EnumType { - return &file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes[0] -} - -func (x WebhookEvent) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WebhookEvent.Descriptor instead. -func (WebhookEvent) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{0} -} - -// CreateWebhookRequest is the proto request representation of a -// webhook request body. -type CreateWebhookRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The event to subscribe to for the given repository. - WebhookEvent WebhookEvent `protobuf:"varint,1,opt,name=webhook_event,json=webhookEvent,proto3,enum=buf.alpha.registry.v1alpha1.WebhookEvent" json:"webhook_event,omitempty"` - // The owner name of the repository in the corresponding subscription request. - OwnerName string `protobuf:"bytes,2,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // The repository name that the subscriber wishes create a subscription for. - RepositoryName string `protobuf:"bytes,3,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The subscriber's callback URL where notifications should be delivered. - CallbackUrl string `protobuf:"bytes,4,opt,name=callback_url,json=callbackUrl,proto3" json:"callback_url,omitempty"` -} - -func (x *CreateWebhookRequest) Reset() { - *x = CreateWebhookRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateWebhookRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateWebhookRequest) ProtoMessage() {} - -func (x *CreateWebhookRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateWebhookRequest.ProtoReflect.Descriptor instead. -func (*CreateWebhookRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateWebhookRequest) GetWebhookEvent() WebhookEvent { - if x != nil { - return x.WebhookEvent - } - return WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED -} - -func (x *CreateWebhookRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *CreateWebhookRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *CreateWebhookRequest) GetCallbackUrl() string { - if x != nil { - return x.CallbackUrl - } - return "" -} - -// CreateWebhookResponse is the proto response representation -// of a webhook request. -type CreateWebhookResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Created webhook subscription. - Webhook *Webhook `protobuf:"bytes,1,opt,name=webhook,proto3" json:"webhook,omitempty"` -} - -func (x *CreateWebhookResponse) Reset() { - *x = CreateWebhookResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateWebhookResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateWebhookResponse) ProtoMessage() {} - -func (x *CreateWebhookResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateWebhookResponse.ProtoReflect.Descriptor instead. -func (*CreateWebhookResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateWebhookResponse) GetWebhook() *Webhook { - if x != nil { - return x.Webhook - } - return nil -} - -// DeleteWebhookRequest is the request for unsubscribing to a webhook. -type DeleteWebhookRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The id of the webhook subscription to delete. - WebhookId string `protobuf:"bytes,1,opt,name=webhook_id,json=webhookId,proto3" json:"webhook_id,omitempty"` -} - -func (x *DeleteWebhookRequest) Reset() { - *x = DeleteWebhookRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteWebhookRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteWebhookRequest) ProtoMessage() {} - -func (x *DeleteWebhookRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteWebhookRequest.ProtoReflect.Descriptor instead. -func (*DeleteWebhookRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{2} -} - -func (x *DeleteWebhookRequest) GetWebhookId() string { - if x != nil { - return x.WebhookId - } - return "" -} - -// DeleteWebhookResponse is the response for unsubscribing -// from a webhook. -type DeleteWebhookResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteWebhookResponse) Reset() { - *x = DeleteWebhookResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteWebhookResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteWebhookResponse) ProtoMessage() {} - -func (x *DeleteWebhookResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteWebhookResponse.ProtoReflect.Descriptor instead. -func (*DeleteWebhookResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{3} -} - -// ListWebhooksRequest is the request to get the -// list of subscribed webhooks for a given repository. -type ListWebhooksRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The repository name given in the corresponding subscription request. - RepositoryName string `protobuf:"bytes,1,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The owner associated with the repository. - OwnerName string `protobuf:"bytes,2,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // The page token for paginating. - PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` -} - -func (x *ListWebhooksRequest) Reset() { - *x = ListWebhooksRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListWebhooksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWebhooksRequest) ProtoMessage() {} - -func (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWebhooksRequest.ProtoReflect.Descriptor instead. -func (*ListWebhooksRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{4} -} - -func (x *ListWebhooksRequest) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *ListWebhooksRequest) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *ListWebhooksRequest) GetPageToken() string { - if x != nil { - return x.PageToken - } - return "" -} - -// ListWebhooksResponse is the response for the list of -// subscribed webhooks for a given repository. -type ListWebhooksResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of subscribed webhooks for a given repository. - Webhooks []*Webhook `protobuf:"bytes,1,rep,name=webhooks,proto3" json:"webhooks,omitempty"` - // The next page token for paginating. - NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` -} - -func (x *ListWebhooksResponse) Reset() { - *x = ListWebhooksResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListWebhooksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWebhooksResponse) ProtoMessage() {} - -func (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListWebhooksResponse.ProtoReflect.Descriptor instead. -func (*ListWebhooksResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{5} -} - -func (x *ListWebhooksResponse) GetWebhooks() []*Webhook { - if x != nil { - return x.Webhooks - } - return nil -} - -func (x *ListWebhooksResponse) GetNextPageToken() string { - if x != nil { - return x.NextPageToken - } - return "" -} - -// Webhook is the representation of a webhook repository event subscription. -type Webhook struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The event associated with the subscription id. - Event WebhookEvent `protobuf:"varint,1,opt,name=event,proto3,enum=buf.alpha.registry.v1alpha1.WebhookEvent" json:"event,omitempty"` - // The id of the associated subscription. - WebhookId string `protobuf:"bytes,2,opt,name=webhook_id,json=webhookId,proto3" json:"webhook_id,omitempty"` - // The webhook creation timestamp. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The webhook last updated timestamp. - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // The webhook repository name. - RepositoryName string `protobuf:"bytes,5,opt,name=repository_name,json=repositoryName,proto3" json:"repository_name,omitempty"` - // The webhook repository owner name. - OwnerName string `protobuf:"bytes,6,opt,name=owner_name,json=ownerName,proto3" json:"owner_name,omitempty"` - // The subscriber's callback URL where notifications are delivered. Currently - // we only support Connect-powered backends with application/proto as the - // content type. Make sure that your URL ends with - // "/buf.alpha.webhook.v1alpha1.EventService/Event". For more information - // about Connect, see https://connect.build. - CallbackUrl string `protobuf:"bytes,7,opt,name=callback_url,json=callbackUrl,proto3" json:"callback_url,omitempty"` -} - -func (x *Webhook) Reset() { - *x = Webhook{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Webhook) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Webhook) ProtoMessage() {} - -func (x *Webhook) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Webhook.ProtoReflect.Descriptor instead. -func (*Webhook) Descriptor() ([]byte, []int) { - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP(), []int{6} -} - -func (x *Webhook) GetEvent() WebhookEvent { - if x != nil { - return x.Event - } - return WebhookEvent_WEBHOOK_EVENT_UNSPECIFIED -} - -func (x *Webhook) GetWebhookId() string { - if x != nil { - return x.WebhookId - } - return "" -} - -func (x *Webhook) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Webhook) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *Webhook) GetRepositoryName() string { - if x != nil { - return x.RepositoryName - } - return "" -} - -func (x *Webhook) GetOwnerName() string { - if x != nil { - return x.OwnerName - } - return "" -} - -func (x *Webhook) GetCallbackUrl() string { - if x != nil { - return x.CallbackUrl - } - return "" -} - -var File_buf_alpha_registry_v1alpha1_webhook_proto protoreflect.FileDescriptor - -var file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc = []byte{ - 0x0a, 0x29, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x77, 0x65, - 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1b, 0x62, 0x75, 0x66, - 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd1, 0x01, 0x0a, 0x14, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x0d, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x52, 0x0c, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, - 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, - 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x55, 0x72, 0x6c, 0x22, 0x57, 0x0a, - 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x07, 0x77, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x22, 0x35, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x64, 0x22, 0x17, 0x0a, - 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7c, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, - 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x80, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, - 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x57, 0x65, - 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x08, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, - 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, - 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xce, 0x02, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x12, 0x3f, 0x0a, 0x05, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, - 0x0f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x77, 0x6e, 0x65, - 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, - 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x61, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x55, 0x72, 0x6c, 0x2a, 0x50, 0x0a, 0x0c, 0x57, 0x65, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x19, 0x57, 0x45, 0x42, 0x48, - 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x57, 0x45, 0x42, 0x48, 0x4f, - 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, - 0x4f, 0x52, 0x59, 0x5f, 0x50, 0x55, 0x53, 0x48, 0x10, 0x01, 0x32, 0x84, 0x03, 0x0a, 0x0e, 0x57, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, - 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x31, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x32, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x7b, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x31, 0x2e, 0x62, 0x75, - 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, - 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x02, 0x12, 0x78, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x57, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x30, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, - 0x01, 0x42, 0x99, 0x02, 0x0a, 0x1f, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x59, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, - 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xa2, 0x02, 0x03, 0x42, 0x41, 0x52, 0xaa, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x1b, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x5c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xe2, 0x02, 0x27, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1e, 0x42, - 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x3a, 0x3a, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x72, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescOnce sync.Once - file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescData = file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc -) - -func file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescGZIP() []byte { - file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescOnce.Do(func() { - file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescData) - }) - return file_buf_alpha_registry_v1alpha1_webhook_proto_rawDescData -} - -var file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_buf_alpha_registry_v1alpha1_webhook_proto_goTypes = []interface{}{ - (WebhookEvent)(0), // 0: buf.alpha.registry.v1alpha1.WebhookEvent - (*CreateWebhookRequest)(nil), // 1: buf.alpha.registry.v1alpha1.CreateWebhookRequest - (*CreateWebhookResponse)(nil), // 2: buf.alpha.registry.v1alpha1.CreateWebhookResponse - (*DeleteWebhookRequest)(nil), // 3: buf.alpha.registry.v1alpha1.DeleteWebhookRequest - (*DeleteWebhookResponse)(nil), // 4: buf.alpha.registry.v1alpha1.DeleteWebhookResponse - (*ListWebhooksRequest)(nil), // 5: buf.alpha.registry.v1alpha1.ListWebhooksRequest - (*ListWebhooksResponse)(nil), // 6: buf.alpha.registry.v1alpha1.ListWebhooksResponse - (*Webhook)(nil), // 7: buf.alpha.registry.v1alpha1.Webhook - (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp -} -var file_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.registry.v1alpha1.CreateWebhookRequest.webhook_event:type_name -> buf.alpha.registry.v1alpha1.WebhookEvent - 7, // 1: buf.alpha.registry.v1alpha1.CreateWebhookResponse.webhook:type_name -> buf.alpha.registry.v1alpha1.Webhook - 7, // 2: buf.alpha.registry.v1alpha1.ListWebhooksResponse.webhooks:type_name -> buf.alpha.registry.v1alpha1.Webhook - 0, // 3: buf.alpha.registry.v1alpha1.Webhook.event:type_name -> buf.alpha.registry.v1alpha1.WebhookEvent - 8, // 4: buf.alpha.registry.v1alpha1.Webhook.create_time:type_name -> google.protobuf.Timestamp - 8, // 5: buf.alpha.registry.v1alpha1.Webhook.update_time:type_name -> google.protobuf.Timestamp - 1, // 6: buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook:input_type -> buf.alpha.registry.v1alpha1.CreateWebhookRequest - 3, // 7: buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook:input_type -> buf.alpha.registry.v1alpha1.DeleteWebhookRequest - 5, // 8: buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks:input_type -> buf.alpha.registry.v1alpha1.ListWebhooksRequest - 2, // 9: buf.alpha.registry.v1alpha1.WebhookService.CreateWebhook:output_type -> buf.alpha.registry.v1alpha1.CreateWebhookResponse - 4, // 10: buf.alpha.registry.v1alpha1.WebhookService.DeleteWebhook:output_type -> buf.alpha.registry.v1alpha1.DeleteWebhookResponse - 6, // 11: buf.alpha.registry.v1alpha1.WebhookService.ListWebhooks:output_type -> buf.alpha.registry.v1alpha1.ListWebhooksResponse - 9, // [9:12] is the sub-list for method output_type - 6, // [6:9] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_buf_alpha_registry_v1alpha1_webhook_proto_init() } -func file_buf_alpha_registry_v1alpha1_webhook_proto_init() { - if File_buf_alpha_registry_v1alpha1_webhook_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateWebhookRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateWebhookResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteWebhookRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteWebhookResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListWebhooksRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListWebhooksResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Webhook); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc, - NumEnums: 1, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_buf_alpha_registry_v1alpha1_webhook_proto_goTypes, - DependencyIndexes: file_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs, - EnumInfos: file_buf_alpha_registry_v1alpha1_webhook_proto_enumTypes, - MessageInfos: file_buf_alpha_registry_v1alpha1_webhook_proto_msgTypes, - }.Build() - File_buf_alpha_registry_v1alpha1_webhook_proto = out.File - file_buf_alpha_registry_v1alpha1_webhook_proto_rawDesc = nil - file_buf_alpha_registry_v1alpha1_webhook_proto_goTypes = nil - file_buf_alpha_registry_v1alpha1_webhook_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/invoke.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/invoke.pb.go deleted file mode 100644 index 9a9c09030c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/invoke.pb.go +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/studio/v1alpha1/invoke.proto - -// The buf.alpha.studio.v1alpha1 package contains types used by the buf studio -// agent. Because browsers are not capable of sending gRPC requests directly, -// users can run a studio agent to that receives enveloped requests from the -// browser and forwards them as gRPC requests. -// -// Ideally the agent would be simple protocol translating HTTP proxy without -// requiring any custom envelope. Unfortunately, js in the browser cannot set -// per request proxy configuration and we cannot specify that we want to open a -// connection to the request agent while specifying a different server in the -// request's Host header. The studio agent and UI could communicate this through -// a custom header instead, but reading custom headers requires a CORS-preflight -// request. -// -// To facilitate easier deployment it in environments with complicated edge -// configuration, it is a goal for the agent and UI to communicate without the -// need for a CORS-preflight requests. This limits our ability to use custom -// headers and restricts allowed values for the Content-Type header. Due to this -// we cannot simply use gRPC-Web with an additional header, but instead rely on -// enveloping the request and responses in a base64 encoded binary proto message -// sent over a POST endpoint with text/plain as Content-Type. -// -// We may explore other transports such as WebSockets or WebTransport, at which -// point we should define proper proto services and methods here as well. - -package studiov1alpha1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// Headers encode HTTP headers. -type Headers struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` -} - -func (x *Headers) Reset() { - *x = Headers{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Headers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Headers) ProtoMessage() {} - -func (x *Headers) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Headers.ProtoReflect.Descriptor instead. -func (*Headers) Descriptor() ([]byte, []int) { - return file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescGZIP(), []int{0} -} - -func (x *Headers) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Headers) GetValue() []string { - if x != nil { - return x.Value - } - return nil -} - -// InvokeRequest encodes an enveloped RPC request. See the package documentation -// for more information. -type InvokeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Target server the agent should forward this request to, e.g. - // "https://api.acme.corp/pkg.Service/Method". Using the "http" scheme will - // cause the request to be forwarded as h2c, whereas "https" forwards the - // request with regular h2. - Target string `protobuf:"bytes,1,opt,name=target,proto3" json:"target,omitempty"` - // Headers to send with the request. If body is set, a Content-Type header - // must be specified. - Headers []*Headers `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"` - // The message to be sent in the request (without any protocol specific framing). - Body []byte `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` -} - -func (x *InvokeRequest) Reset() { - *x = InvokeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InvokeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvokeRequest) ProtoMessage() {} - -func (x *InvokeRequest) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvokeRequest.ProtoReflect.Descriptor instead. -func (*InvokeRequest) Descriptor() ([]byte, []int) { - return file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescGZIP(), []int{1} -} - -func (x *InvokeRequest) GetTarget() string { - if x != nil { - return x.Target - } - return "" -} - -func (x *InvokeRequest) GetHeaders() []*Headers { - if x != nil { - return x.Headers - } - return nil -} - -func (x *InvokeRequest) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -// InvokeResponse encodes an enveloped RPC response. See the package documentation -// for more information. -type InvokeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Headers received in the response. - Headers []*Headers `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` - // The encoded message received in the response (without protocol specific framing). - Body []byte `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"` - // Trailers received in the response. - Trailers []*Headers `protobuf:"bytes,3,rep,name=trailers,proto3" json:"trailers,omitempty"` -} - -func (x *InvokeResponse) Reset() { - *x = InvokeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InvokeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InvokeResponse) ProtoMessage() {} - -func (x *InvokeResponse) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InvokeResponse.ProtoReflect.Descriptor instead. -func (*InvokeResponse) Descriptor() ([]byte, []int) { - return file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescGZIP(), []int{2} -} - -func (x *InvokeResponse) GetHeaders() []*Headers { - if x != nil { - return x.Headers - } - return nil -} - -func (x *InvokeResponse) GetBody() []byte { - if x != nil { - return x.Body - } - return nil -} - -func (x *InvokeResponse) GetTrailers() []*Headers { - if x != nil { - return x.Trailers - } - return nil -} - -var File_buf_alpha_studio_v1alpha1_invoke_proto protoreflect.FileDescriptor - -var file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x73, 0x74, 0x75, 0x64, - 0x69, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x6f, - 0x6b, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x19, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x22, 0x31, 0x0a, 0x07, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x79, 0x0a, 0x0d, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x3c, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x73, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x62, 0x6f, 0x64, - 0x79, 0x22, 0xa2, 0x01, 0x0a, 0x0e, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x3e, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x65, - 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x52, 0x08, 0x74, 0x72, - 0x61, 0x69, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x8a, 0x02, 0x0a, 0x1d, 0x63, 0x6f, 0x6d, 0x2e, 0x62, - 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0b, 0x49, 0x6e, 0x76, 0x6f, 0x6b, 0x65, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, - 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, - 0x73, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, - 0x03, 0x42, 0x41, 0x53, 0xaa, 0x02, 0x19, 0x42, 0x75, 0x66, 0x2e, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0xca, 0x02, 0x19, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x53, 0x74, 0x75, - 0x64, 0x69, 0x6f, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x25, 0x42, - 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x5c, - 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, - 0x61, 0x3a, 0x3a, 0x53, 0x74, 0x75, 0x64, 0x69, 0x6f, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescOnce sync.Once - file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescData = file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc -) - -func file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescGZIP() []byte { - file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescOnce.Do(func() { - file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescData) - }) - return file_buf_alpha_studio_v1alpha1_invoke_proto_rawDescData -} - -var file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_buf_alpha_studio_v1alpha1_invoke_proto_goTypes = []interface{}{ - (*Headers)(nil), // 0: buf.alpha.studio.v1alpha1.Headers - (*InvokeRequest)(nil), // 1: buf.alpha.studio.v1alpha1.InvokeRequest - (*InvokeResponse)(nil), // 2: buf.alpha.studio.v1alpha1.InvokeResponse -} -var file_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.studio.v1alpha1.InvokeRequest.headers:type_name -> buf.alpha.studio.v1alpha1.Headers - 0, // 1: buf.alpha.studio.v1alpha1.InvokeResponse.headers:type_name -> buf.alpha.studio.v1alpha1.Headers - 0, // 2: buf.alpha.studio.v1alpha1.InvokeResponse.trailers:type_name -> buf.alpha.studio.v1alpha1.Headers - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_buf_alpha_studio_v1alpha1_invoke_proto_init() } -func file_buf_alpha_studio_v1alpha1_invoke_proto_init() { - if File_buf_alpha_studio_v1alpha1_invoke_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Headers); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvokeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_studio_v1alpha1_invoke_proto_goTypes, - DependencyIndexes: file_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs, - MessageInfos: file_buf_alpha_studio_v1alpha1_invoke_proto_msgTypes, - }.Build() - File_buf_alpha_studio_v1alpha1_invoke_proto = out.File - file_buf_alpha_studio_v1alpha1_invoke_proto_rawDesc = nil - file_buf_alpha_studio_v1alpha1_invoke_proto_goTypes = nil - file_buf_alpha_studio_v1alpha1_invoke_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/usage.gen.go deleted file mode 100644 index e51917568f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/studio/v1alpha1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package studiov1alpha1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/usage.gen.go deleted file mode 100644 index 1d0ae986be..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package wasmpluginv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/wasmplugin.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/wasmplugin.pb.go deleted file mode 100644 index 1ed1aad41f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/buf/alpha/wasmplugin/v1/wasmplugin.pb.go +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: buf/alpha/wasmplugin/v1/wasmplugin.proto - -package wasmpluginv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// WASM_ABI specifies the abi this module expects buf to provide. -type WasmABI int32 - -const ( - WasmABI_WASM_ABI_UNSPECIFIED WasmABI = 0 - // Plugins compiled against - // https://github.com/WebAssembly/WASI/releases/tag/snapshot-01. - WasmABI_WASM_ABI_WASI_SNAPSHOT_PREVIEW1 WasmABI = 1 - // Plugins compiled with `GOOS=js` and `GOARCH=wasm`. - WasmABI_WASM_ABI_GOJS WasmABI = 2 -) - -// Enum value maps for WasmABI. -var ( - WasmABI_name = map[int32]string{ - 0: "WASM_ABI_UNSPECIFIED", - 1: "WASM_ABI_WASI_SNAPSHOT_PREVIEW1", - 2: "WASM_ABI_GOJS", - } - WasmABI_value = map[string]int32{ - "WASM_ABI_UNSPECIFIED": 0, - "WASM_ABI_WASI_SNAPSHOT_PREVIEW1": 1, - "WASM_ABI_GOJS": 2, - } -) - -func (x WasmABI) Enum() *WasmABI { - p := new(WasmABI) - *p = x - return p -} - -func (x WasmABI) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WasmABI) Descriptor() protoreflect.EnumDescriptor { - return file_buf_alpha_wasmplugin_v1_wasmplugin_proto_enumTypes[0].Descriptor() -} - -func (WasmABI) Type() protoreflect.EnumType { - return &file_buf_alpha_wasmplugin_v1_wasmplugin_proto_enumTypes[0] -} - -func (x WasmABI) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WasmABI.Descriptor instead. -func (WasmABI) EnumDescriptor() ([]byte, []int) { - return file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescGZIP(), []int{0} -} - -// ExecConfig describes buf specific extensions for a wasm plugin. A ExecConfig may -// be encoded in a custom WASM section named ".bufplugin", see -// (https://webassembly.github.io/spec/core/binary/modules.html#binary-customsec) -// for more info. -type ExecConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // When no ABI is provided, buf will make a best effort guess based on - // the functions the wasm module exports. - WasmAbi WasmABI `protobuf:"varint,1,opt,name=wasm_abi,json=wasmAbi,proto3,enum=buf.alpha.wasmplugin.v1.WasmABI" json:"wasm_abi,omitempty"` - // The arguments that should be passed when running this plugin. Useful - // for interpreted languages where the main wasm bundle is only the - // interpreter. - Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"` - // Files that should be made available to the WASI fs when running this - // plugin. Useful for interpreted languages where the main wasm bundle - // is only the interpreter. - Files []*File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"` -} - -func (x *ExecConfig) Reset() { - *x = ExecConfig{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExecConfig) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExecConfig) ProtoMessage() {} - -func (x *ExecConfig) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExecConfig.ProtoReflect.Descriptor instead. -func (*ExecConfig) Descriptor() ([]byte, []int) { - return file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescGZIP(), []int{0} -} - -func (x *ExecConfig) GetWasmAbi() WasmABI { - if x != nil { - return x.WasmAbi - } - return WasmABI_WASM_ABI_UNSPECIFIED -} - -func (x *ExecConfig) GetArgs() []string { - if x != nil { - return x.Args - } - return nil -} - -func (x *ExecConfig) GetFiles() []*File { - if x != nil { - return x.Files - } - return nil -} - -// File represents a file that must be made available to the wasi plugin. -type File struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Normalized path with `/` as directory separator. - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Contents []byte `protobuf:"bytes,2,opt,name=contents,proto3" json:"contents,omitempty"` -} - -func (x *File) Reset() { - *x = File{} - if protoimpl.UnsafeEnabled { - mi := &file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *File) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*File) ProtoMessage() {} - -func (x *File) ProtoReflect() protoreflect.Message { - mi := &file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use File.ProtoReflect.Descriptor instead. -func (*File) Descriptor() ([]byte, []int) { - return file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescGZIP(), []int{1} -} - -func (x *File) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *File) GetContents() []byte { - if x != nil { - return x.Contents - } - return nil -} - -var File_buf_alpha_wasmplugin_v1_wasmplugin_proto protoreflect.FileDescriptor - -var file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDesc = []byte{ - 0x0a, 0x28, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x77, 0x61, 0x73, 0x6d, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x62, 0x75, 0x66, 0x2e, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x76, 0x31, 0x22, 0x92, 0x01, 0x0a, 0x0a, 0x45, 0x78, 0x65, 0x63, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x12, 0x3b, 0x0a, 0x08, 0x77, 0x61, 0x73, 0x6d, 0x5f, 0x61, 0x62, 0x69, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, - 0x61, 0x73, 0x6d, 0x41, 0x42, 0x49, 0x52, 0x07, 0x77, 0x61, 0x73, 0x6d, 0x41, 0x62, 0x69, 0x12, - 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, - 0x72, 0x67, 0x73, 0x12, 0x33, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x77, - 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x22, 0x36, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, - 0x2a, 0x5b, 0x0a, 0x07, 0x57, 0x61, 0x73, 0x6d, 0x41, 0x42, 0x49, 0x12, 0x18, 0x0a, 0x14, 0x57, - 0x41, 0x53, 0x4d, 0x5f, 0x41, 0x42, 0x49, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, - 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x57, 0x41, 0x53, 0x4d, 0x5f, 0x41, 0x42, - 0x49, 0x5f, 0x57, 0x41, 0x53, 0x49, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x5f, - 0x50, 0x52, 0x45, 0x56, 0x49, 0x45, 0x57, 0x31, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x57, 0x41, - 0x53, 0x4d, 0x5f, 0x41, 0x42, 0x49, 0x5f, 0x47, 0x4f, 0x4a, 0x53, 0x10, 0x02, 0x42, 0x80, 0x02, - 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x62, 0x75, 0x66, 0x2e, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x57, - 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x51, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, - 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, - 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x62, - 0x75, 0x66, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, - 0x67, 0x69, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x77, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x42, 0x41, 0x57, 0xaa, 0x02, 0x17, 0x42, 0x75, 0x66, 0x2e, - 0x41, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x57, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x2e, 0x56, 0x31, 0xca, 0x02, 0x17, 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, - 0x57, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x23, - 0x42, 0x75, 0x66, 0x5c, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x57, 0x61, 0x73, 0x6d, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x1a, 0x42, 0x75, 0x66, 0x3a, 0x3a, 0x41, 0x6c, 0x70, 0x68, 0x61, - 0x3a, 0x3a, 0x57, 0x61, 0x73, 0x6d, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescOnce sync.Once - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescData = file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDesc -) - -func file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescGZIP() []byte { - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescOnce.Do(func() { - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescData = protoimpl.X.CompressGZIP(file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescData) - }) - return file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDescData -} - -var file_buf_alpha_wasmplugin_v1_wasmplugin_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_buf_alpha_wasmplugin_v1_wasmplugin_proto_goTypes = []interface{}{ - (WasmABI)(0), // 0: buf.alpha.wasmplugin.v1.WasmABI - (*ExecConfig)(nil), // 1: buf.alpha.wasmplugin.v1.ExecConfig - (*File)(nil), // 2: buf.alpha.wasmplugin.v1.File -} -var file_buf_alpha_wasmplugin_v1_wasmplugin_proto_depIdxs = []int32{ - 0, // 0: buf.alpha.wasmplugin.v1.ExecConfig.wasm_abi:type_name -> buf.alpha.wasmplugin.v1.WasmABI - 2, // 1: buf.alpha.wasmplugin.v1.ExecConfig.files:type_name -> buf.alpha.wasmplugin.v1.File - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_buf_alpha_wasmplugin_v1_wasmplugin_proto_init() } -func file_buf_alpha_wasmplugin_v1_wasmplugin_proto_init() { - if File_buf_alpha_wasmplugin_v1_wasmplugin_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecConfig); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDesc, - NumEnums: 1, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_buf_alpha_wasmplugin_v1_wasmplugin_proto_goTypes, - DependencyIndexes: file_buf_alpha_wasmplugin_v1_wasmplugin_proto_depIdxs, - EnumInfos: file_buf_alpha_wasmplugin_v1_wasmplugin_proto_enumTypes, - MessageInfos: file_buf_alpha_wasmplugin_v1_wasmplugin_proto_msgTypes, - }.Build() - File_buf_alpha_wasmplugin_v1_wasmplugin_proto = out.File - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_rawDesc = nil - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_goTypes = nil - file_buf_alpha_wasmplugin_v1_wasmplugin_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/reflection.pb.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/reflection.pb.go deleted file mode 100644 index fdb4a67ab4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/reflection.pb.go +++ /dev/null @@ -1,961 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Service exported by server reflection. A more complete description of how -// server reflection works can be found at -// https://github.com/grpc/grpc/blob/master/doc/server-reflection.md -// -// The canonical version of this proto can be found at -// https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: grpc/reflection/v1/reflection.proto - -package reflectionv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// The message sent by the client when calling ServerReflectionInfo method. -type ServerReflectionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` - // To use reflection service, the client should set one of the following - // fields in message_request. The server distinguishes requests by their - // defined field and then handles them using corresponding methods. - // - // Types that are assignable to MessageRequest: - // - // *ServerReflectionRequest_FileByFilename - // *ServerReflectionRequest_FileContainingSymbol - // *ServerReflectionRequest_FileContainingExtension - // *ServerReflectionRequest_AllExtensionNumbersOfType - // *ServerReflectionRequest_ListServices - MessageRequest isServerReflectionRequest_MessageRequest `protobuf_oneof:"message_request"` -} - -func (x *ServerReflectionRequest) Reset() { - *x = ServerReflectionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerReflectionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerReflectionRequest) ProtoMessage() {} - -func (x *ServerReflectionRequest) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerReflectionRequest.ProtoReflect.Descriptor instead. -func (*ServerReflectionRequest) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{0} -} - -func (x *ServerReflectionRequest) GetHost() string { - if x != nil { - return x.Host - } - return "" -} - -func (m *ServerReflectionRequest) GetMessageRequest() isServerReflectionRequest_MessageRequest { - if m != nil { - return m.MessageRequest - } - return nil -} - -func (x *ServerReflectionRequest) GetFileByFilename() string { - if x, ok := x.GetMessageRequest().(*ServerReflectionRequest_FileByFilename); ok { - return x.FileByFilename - } - return "" -} - -func (x *ServerReflectionRequest) GetFileContainingSymbol() string { - if x, ok := x.GetMessageRequest().(*ServerReflectionRequest_FileContainingSymbol); ok { - return x.FileContainingSymbol - } - return "" -} - -func (x *ServerReflectionRequest) GetFileContainingExtension() *ExtensionRequest { - if x, ok := x.GetMessageRequest().(*ServerReflectionRequest_FileContainingExtension); ok { - return x.FileContainingExtension - } - return nil -} - -func (x *ServerReflectionRequest) GetAllExtensionNumbersOfType() string { - if x, ok := x.GetMessageRequest().(*ServerReflectionRequest_AllExtensionNumbersOfType); ok { - return x.AllExtensionNumbersOfType - } - return "" -} - -func (x *ServerReflectionRequest) GetListServices() string { - if x, ok := x.GetMessageRequest().(*ServerReflectionRequest_ListServices); ok { - return x.ListServices - } - return "" -} - -type isServerReflectionRequest_MessageRequest interface { - isServerReflectionRequest_MessageRequest() -} - -type ServerReflectionRequest_FileByFilename struct { - // Find a proto file by the file name. - FileByFilename string `protobuf:"bytes,3,opt,name=file_by_filename,json=fileByFilename,proto3,oneof"` -} - -type ServerReflectionRequest_FileContainingSymbol struct { - // Find the proto file that declares the given fully-qualified symbol name. - // This field should be a fully-qualified symbol name - // (e.g. .[.] or .). - FileContainingSymbol string `protobuf:"bytes,4,opt,name=file_containing_symbol,json=fileContainingSymbol,proto3,oneof"` -} - -type ServerReflectionRequest_FileContainingExtension struct { - // Find the proto file which defines an extension extending the given - // message type with the given field number. - FileContainingExtension *ExtensionRequest `protobuf:"bytes,5,opt,name=file_containing_extension,json=fileContainingExtension,proto3,oneof"` -} - -type ServerReflectionRequest_AllExtensionNumbersOfType struct { - // Finds the tag numbers used by all known extensions of the given message - // type, and appends them to ExtensionNumberResponse in an undefined order. - // Its corresponding method is best-effort: it's not guaranteed that the - // reflection service will implement this method, and it's not guaranteed - // that this method will provide all extensions. Returns - // StatusCode::UNIMPLEMENTED if it's not implemented. - // This field should be a fully-qualified type name. The format is - // . - AllExtensionNumbersOfType string `protobuf:"bytes,6,opt,name=all_extension_numbers_of_type,json=allExtensionNumbersOfType,proto3,oneof"` -} - -type ServerReflectionRequest_ListServices struct { - // List the full names of registered services. The content will not be - // checked. - ListServices string `protobuf:"bytes,7,opt,name=list_services,json=listServices,proto3,oneof"` -} - -func (*ServerReflectionRequest_FileByFilename) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_FileContainingSymbol) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_FileContainingExtension) isServerReflectionRequest_MessageRequest() {} - -func (*ServerReflectionRequest_AllExtensionNumbersOfType) isServerReflectionRequest_MessageRequest() { -} - -func (*ServerReflectionRequest_ListServices) isServerReflectionRequest_MessageRequest() {} - -// The type name and extension number sent by the client when requesting -// file_containing_extension. -type ExtensionRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Fully-qualified type name. The format should be . - ContainingType string `protobuf:"bytes,1,opt,name=containing_type,json=containingType,proto3" json:"containing_type,omitempty"` - ExtensionNumber int32 `protobuf:"varint,2,opt,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"` -} - -func (x *ExtensionRequest) Reset() { - *x = ExtensionRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtensionRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtensionRequest) ProtoMessage() {} - -func (x *ExtensionRequest) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExtensionRequest.ProtoReflect.Descriptor instead. -func (*ExtensionRequest) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{1} -} - -func (x *ExtensionRequest) GetContainingType() string { - if x != nil { - return x.ContainingType - } - return "" -} - -func (x *ExtensionRequest) GetExtensionNumber() int32 { - if x != nil { - return x.ExtensionNumber - } - return 0 -} - -// The message sent by the server to answer ServerReflectionInfo method. -type ServerReflectionResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ValidHost string `protobuf:"bytes,1,opt,name=valid_host,json=validHost,proto3" json:"valid_host,omitempty"` - OriginalRequest *ServerReflectionRequest `protobuf:"bytes,2,opt,name=original_request,json=originalRequest,proto3" json:"original_request,omitempty"` - // The server sets one of the following fields according to the message_request - // in the request. - // - // Types that are assignable to MessageResponse: - // - // *ServerReflectionResponse_FileDescriptorResponse - // *ServerReflectionResponse_AllExtensionNumbersResponse - // *ServerReflectionResponse_ListServicesResponse - // *ServerReflectionResponse_ErrorResponse - MessageResponse isServerReflectionResponse_MessageResponse `protobuf_oneof:"message_response"` -} - -func (x *ServerReflectionResponse) Reset() { - *x = ServerReflectionResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServerReflectionResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServerReflectionResponse) ProtoMessage() {} - -func (x *ServerReflectionResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServerReflectionResponse.ProtoReflect.Descriptor instead. -func (*ServerReflectionResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{2} -} - -func (x *ServerReflectionResponse) GetValidHost() string { - if x != nil { - return x.ValidHost - } - return "" -} - -func (x *ServerReflectionResponse) GetOriginalRequest() *ServerReflectionRequest { - if x != nil { - return x.OriginalRequest - } - return nil -} - -func (m *ServerReflectionResponse) GetMessageResponse() isServerReflectionResponse_MessageResponse { - if m != nil { - return m.MessageResponse - } - return nil -} - -func (x *ServerReflectionResponse) GetFileDescriptorResponse() *FileDescriptorResponse { - if x, ok := x.GetMessageResponse().(*ServerReflectionResponse_FileDescriptorResponse); ok { - return x.FileDescriptorResponse - } - return nil -} - -func (x *ServerReflectionResponse) GetAllExtensionNumbersResponse() *ExtensionNumberResponse { - if x, ok := x.GetMessageResponse().(*ServerReflectionResponse_AllExtensionNumbersResponse); ok { - return x.AllExtensionNumbersResponse - } - return nil -} - -func (x *ServerReflectionResponse) GetListServicesResponse() *ListServiceResponse { - if x, ok := x.GetMessageResponse().(*ServerReflectionResponse_ListServicesResponse); ok { - return x.ListServicesResponse - } - return nil -} - -func (x *ServerReflectionResponse) GetErrorResponse() *ErrorResponse { - if x, ok := x.GetMessageResponse().(*ServerReflectionResponse_ErrorResponse); ok { - return x.ErrorResponse - } - return nil -} - -type isServerReflectionResponse_MessageResponse interface { - isServerReflectionResponse_MessageResponse() -} - -type ServerReflectionResponse_FileDescriptorResponse struct { - // This message is used to answer file_by_filename, file_containing_symbol, - // file_containing_extension requests with transitive dependencies. - // As the repeated label is not allowed in oneof fields, we use a - // FileDescriptorResponse message to encapsulate the repeated fields. - // The reflection service is allowed to avoid sending FileDescriptorProtos - // that were previously sent in response to earlier requests in the stream. - FileDescriptorResponse *FileDescriptorResponse `protobuf:"bytes,4,opt,name=file_descriptor_response,json=fileDescriptorResponse,proto3,oneof"` -} - -type ServerReflectionResponse_AllExtensionNumbersResponse struct { - // This message is used to answer all_extension_numbers_of_type requests. - AllExtensionNumbersResponse *ExtensionNumberResponse `protobuf:"bytes,5,opt,name=all_extension_numbers_response,json=allExtensionNumbersResponse,proto3,oneof"` -} - -type ServerReflectionResponse_ListServicesResponse struct { - // This message is used to answer list_services requests. - ListServicesResponse *ListServiceResponse `protobuf:"bytes,6,opt,name=list_services_response,json=listServicesResponse,proto3,oneof"` -} - -type ServerReflectionResponse_ErrorResponse struct { - // This message is used when an error occurs. - ErrorResponse *ErrorResponse `protobuf:"bytes,7,opt,name=error_response,json=errorResponse,proto3,oneof"` -} - -func (*ServerReflectionResponse_FileDescriptorResponse) isServerReflectionResponse_MessageResponse() { -} - -func (*ServerReflectionResponse_AllExtensionNumbersResponse) isServerReflectionResponse_MessageResponse() { -} - -func (*ServerReflectionResponse_ListServicesResponse) isServerReflectionResponse_MessageResponse() {} - -func (*ServerReflectionResponse_ErrorResponse) isServerReflectionResponse_MessageResponse() {} - -// Serialized FileDescriptorProto messages sent by the server answering -// a file_by_filename, file_containing_symbol, or file_containing_extension -// request. -type FileDescriptorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Serialized FileDescriptorProto messages. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. - FileDescriptorProto [][]byte `protobuf:"bytes,1,rep,name=file_descriptor_proto,json=fileDescriptorProto,proto3" json:"file_descriptor_proto,omitempty"` -} - -func (x *FileDescriptorResponse) Reset() { - *x = FileDescriptorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FileDescriptorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FileDescriptorResponse) ProtoMessage() {} - -func (x *FileDescriptorResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FileDescriptorResponse.ProtoReflect.Descriptor instead. -func (*FileDescriptorResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{3} -} - -func (x *FileDescriptorResponse) GetFileDescriptorProto() [][]byte { - if x != nil { - return x.FileDescriptorProto - } - return nil -} - -// A list of extension numbers sent by the server answering -// all_extension_numbers_of_type request. -type ExtensionNumberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Full name of the base type, including the package name. The format - // is . - BaseTypeName string `protobuf:"bytes,1,opt,name=base_type_name,json=baseTypeName,proto3" json:"base_type_name,omitempty"` - ExtensionNumber []int32 `protobuf:"varint,2,rep,packed,name=extension_number,json=extensionNumber,proto3" json:"extension_number,omitempty"` -} - -func (x *ExtensionNumberResponse) Reset() { - *x = ExtensionNumberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ExtensionNumberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExtensionNumberResponse) ProtoMessage() {} - -func (x *ExtensionNumberResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ExtensionNumberResponse.ProtoReflect.Descriptor instead. -func (*ExtensionNumberResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{4} -} - -func (x *ExtensionNumberResponse) GetBaseTypeName() string { - if x != nil { - return x.BaseTypeName - } - return "" -} - -func (x *ExtensionNumberResponse) GetExtensionNumber() []int32 { - if x != nil { - return x.ExtensionNumber - } - return nil -} - -// A list of ServiceResponse sent by the server answering list_services request. -type ListServiceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The information of each service may be expanded in the future, so we use - // ServiceResponse message to encapsulate it. - Service []*ServiceResponse `protobuf:"bytes,1,rep,name=service,proto3" json:"service,omitempty"` -} - -func (x *ListServiceResponse) Reset() { - *x = ListServiceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListServiceResponse) ProtoMessage() {} - -func (x *ListServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListServiceResponse.ProtoReflect.Descriptor instead. -func (*ListServiceResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{5} -} - -func (x *ListServiceResponse) GetService() []*ServiceResponse { - if x != nil { - return x.Service - } - return nil -} - -// The information of a single service used by ListServiceResponse to answer -// list_services request. -type ServiceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Full name of a registered service, including its package name. The format - // is . - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *ServiceResponse) Reset() { - *x = ServiceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ServiceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ServiceResponse) ProtoMessage() {} - -func (x *ServiceResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ServiceResponse.ProtoReflect.Descriptor instead. -func (*ServiceResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{6} -} - -func (x *ServiceResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -// The error code and error message sent by the server when an error occurs. -type ErrorResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // This field uses the error codes defined in grpc::StatusCode. - ErrorCode int32 `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3" json:"error_code,omitempty"` - ErrorMessage string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage,proto3" json:"error_message,omitempty"` -} - -func (x *ErrorResponse) Reset() { - *x = ErrorResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ErrorResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ErrorResponse) ProtoMessage() {} - -func (x *ErrorResponse) ProtoReflect() protoreflect.Message { - mi := &file_grpc_reflection_v1_reflection_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ErrorResponse.ProtoReflect.Descriptor instead. -func (*ErrorResponse) Descriptor() ([]byte, []int) { - return file_grpc_reflection_v1_reflection_proto_rawDescGZIP(), []int{7} -} - -func (x *ErrorResponse) GetErrorCode() int32 { - if x != nil { - return x.ErrorCode - } - return 0 -} - -func (x *ErrorResponse) GetErrorMessage() string { - if x != nil { - return x.ErrorMessage - } - return "" -} - -var File_grpc_reflection_v1_reflection_proto protoreflect.FileDescriptor - -var file_grpc_reflection_v1_reflection_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, - 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0xf3, 0x02, 0x0a, 0x17, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x66, 0x69, 0x6c, - 0x65, 0x5f, 0x62, 0x79, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x66, 0x69, 0x6c, 0x65, 0x42, 0x79, 0x46, 0x69, 0x6c, - 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x16, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x5f, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x62, 0x0a, - 0x19, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x24, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x17, 0x66, 0x69, 0x6c, 0x65, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x42, 0x0a, 0x1d, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x6f, 0x66, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x19, 0x61, 0x6c, 0x6c, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x4f, - 0x66, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, - 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x42, 0x11, 0x0a, 0x0f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x66, 0x0a, 0x10, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xae, 0x04, 0x0a, 0x18, 0x53, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x68, 0x6f, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x48, - 0x6f, 0x73, 0x74, 0x12, 0x56, 0x0a, 0x10, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0f, 0x6f, 0x72, 0x69, 0x67, - 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x66, 0x0a, 0x18, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x76, 0x31, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x16, 0x66, 0x69, 0x6c, - 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x1e, 0x61, 0x6c, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x67, 0x72, - 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x1b, 0x61, 0x6c, 0x6c, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x16, 0x6c, 0x69, 0x73, 0x74, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x48, 0x00, 0x52, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0e, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x12, 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4c, 0x0a, 0x16, 0x46, 0x69, 0x6c, 0x65, - 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0c, 0x52, 0x13, 0x66, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, - 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x6a, 0x0a, 0x17, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x61, 0x73, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x05, 0x52, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x22, 0x54, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x07, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x72, 0x70, - 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x53, 0x0a, 0x0d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x32, 0x89, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x75, 0x0a, 0x14, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x2b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, - 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, - 0x42, 0xe1, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x72, 0x65, - 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0f, 0x52, 0x65, 0x66, - 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4c, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, 0x66, 0x62, 0x75, - 0x69, 0x6c, 0x64, 0x2f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, - 0x72, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x47, - 0x52, 0x58, 0xaa, 0x02, 0x12, 0x47, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x47, 0x72, 0x70, 0x63, 0x5c, 0x52, - 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x47, - 0x72, 0x70, 0x63, 0x5c, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, - 0x47, 0x72, 0x70, 0x63, 0x3a, 0x3a, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_grpc_reflection_v1_reflection_proto_rawDescOnce sync.Once - file_grpc_reflection_v1_reflection_proto_rawDescData = file_grpc_reflection_v1_reflection_proto_rawDesc -) - -func file_grpc_reflection_v1_reflection_proto_rawDescGZIP() []byte { - file_grpc_reflection_v1_reflection_proto_rawDescOnce.Do(func() { - file_grpc_reflection_v1_reflection_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_reflection_v1_reflection_proto_rawDescData) - }) - return file_grpc_reflection_v1_reflection_proto_rawDescData -} - -var file_grpc_reflection_v1_reflection_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_grpc_reflection_v1_reflection_proto_goTypes = []interface{}{ - (*ServerReflectionRequest)(nil), // 0: grpc.reflection.v1.ServerReflectionRequest - (*ExtensionRequest)(nil), // 1: grpc.reflection.v1.ExtensionRequest - (*ServerReflectionResponse)(nil), // 2: grpc.reflection.v1.ServerReflectionResponse - (*FileDescriptorResponse)(nil), // 3: grpc.reflection.v1.FileDescriptorResponse - (*ExtensionNumberResponse)(nil), // 4: grpc.reflection.v1.ExtensionNumberResponse - (*ListServiceResponse)(nil), // 5: grpc.reflection.v1.ListServiceResponse - (*ServiceResponse)(nil), // 6: grpc.reflection.v1.ServiceResponse - (*ErrorResponse)(nil), // 7: grpc.reflection.v1.ErrorResponse -} -var file_grpc_reflection_v1_reflection_proto_depIdxs = []int32{ - 1, // 0: grpc.reflection.v1.ServerReflectionRequest.file_containing_extension:type_name -> grpc.reflection.v1.ExtensionRequest - 0, // 1: grpc.reflection.v1.ServerReflectionResponse.original_request:type_name -> grpc.reflection.v1.ServerReflectionRequest - 3, // 2: grpc.reflection.v1.ServerReflectionResponse.file_descriptor_response:type_name -> grpc.reflection.v1.FileDescriptorResponse - 4, // 3: grpc.reflection.v1.ServerReflectionResponse.all_extension_numbers_response:type_name -> grpc.reflection.v1.ExtensionNumberResponse - 5, // 4: grpc.reflection.v1.ServerReflectionResponse.list_services_response:type_name -> grpc.reflection.v1.ListServiceResponse - 7, // 5: grpc.reflection.v1.ServerReflectionResponse.error_response:type_name -> grpc.reflection.v1.ErrorResponse - 6, // 6: grpc.reflection.v1.ListServiceResponse.service:type_name -> grpc.reflection.v1.ServiceResponse - 0, // 7: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:input_type -> grpc.reflection.v1.ServerReflectionRequest - 2, // 8: grpc.reflection.v1.ServerReflection.ServerReflectionInfo:output_type -> grpc.reflection.v1.ServerReflectionResponse - 8, // [8:9] is the sub-list for method output_type - 7, // [7:8] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_grpc_reflection_v1_reflection_proto_init() } -func file_grpc_reflection_v1_reflection_proto_init() { - if File_grpc_reflection_v1_reflection_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_grpc_reflection_v1_reflection_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerReflectionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerReflectionResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FileDescriptorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionNumberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListServiceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServiceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ErrorResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_grpc_reflection_v1_reflection_proto_msgTypes[0].OneofWrappers = []interface{}{ - (*ServerReflectionRequest_FileByFilename)(nil), - (*ServerReflectionRequest_FileContainingSymbol)(nil), - (*ServerReflectionRequest_FileContainingExtension)(nil), - (*ServerReflectionRequest_AllExtensionNumbersOfType)(nil), - (*ServerReflectionRequest_ListServices)(nil), - } - file_grpc_reflection_v1_reflection_proto_msgTypes[2].OneofWrappers = []interface{}{ - (*ServerReflectionResponse_FileDescriptorResponse)(nil), - (*ServerReflectionResponse_AllExtensionNumbersResponse)(nil), - (*ServerReflectionResponse_ListServicesResponse)(nil), - (*ServerReflectionResponse_ErrorResponse)(nil), - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_grpc_reflection_v1_reflection_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_grpc_reflection_v1_reflection_proto_goTypes, - DependencyIndexes: file_grpc_reflection_v1_reflection_proto_depIdxs, - MessageInfos: file_grpc_reflection_v1_reflection_proto_msgTypes, - }.Build() - File_grpc_reflection_v1_reflection_proto = out.File - file_grpc_reflection_v1_reflection_proto_rawDesc = nil - file_grpc_reflection_v1_reflection_proto_goTypes = nil - file_grpc_reflection_v1_reflection_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/usage.gen.go b/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/usage.gen.go deleted file mode 100644 index d0aad7299f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/gen/proto/go/grpc/reflection/v1/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package reflectionv1 - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/app.go b/vendor/github.com/bufbuild/buf/private/pkg/app/app.go deleted file mode 100644 index e0e842e19f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/app.go +++ /dev/null @@ -1,352 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package app provides application primitives. -package app - -import ( - "context" - "errors" - "fmt" - "io" - "os" - "sort" - "strconv" - - "github.com/bufbuild/buf/private/pkg/interrupt" -) - -// EnvContainer provides environment variables. -type EnvContainer interface { - // Env gets the environment variable raw string value for the key. - // - // Returns empty string if the key is not set or the value is empty. - Env(key string) string - // ForEachEnv iterates over all non-empty environment variables and calls the function. - // - // The value will never be empty. - ForEachEnv(func(string, string)) -} - -// NewEnvContainer returns a new EnvContainer. -// -// Empty values are effectively ignored. -func NewEnvContainer(m map[string]string) EnvContainer { - return newEnvContainer(m) -} - -// NewEnvContainerForOS returns a new EnvContainer for the operating system. -func NewEnvContainerForOS() (EnvContainer, error) { - return newEnvContainerForEnviron(os.Environ()) -} - -// NewEnvContainerWithOverrides returns a new EnvContainer with the values of the input -// EnvContainer, overridden by the values in overrides. -// -// Empty values are effectively ignored. To unset a key, set the value to "" in overrides. -func NewEnvContainerWithOverrides(envContainer EnvContainer, overrides map[string]string) EnvContainer { - m := EnvironMap(envContainer) - for key, value := range overrides { - m[key] = value - } - return newEnvContainer(m) -} - -// StdinContainer provides stdin. -type StdinContainer interface { - // Stdin provides stdin. - // - // If no value was passed when Stdio was created, this will return io.EOF on any call. - Stdin() io.Reader -} - -// NewStdinContainer returns a new StdinContainer. -func NewStdinContainer(reader io.Reader) StdinContainer { - return newStdinContainer(reader) -} - -// NewStdinContainerForOS returns a new StdinContainer for the operating system. -func NewStdinContainerForOS() StdinContainer { - return newStdinContainer(os.Stdin) -} - -// StdoutContainer provides stdout. -type StdoutContainer interface { - // Stdout provides stdout. - // - // If no value was passed when Stdio was created, this will return io.EOF on any call. - Stdout() io.Writer -} - -// NewStdoutContainer returns a new StdoutContainer. -func NewStdoutContainer(writer io.Writer) StdoutContainer { - return newStdoutContainer(writer) -} - -// NewStdoutContainerForOS returns a new StdoutContainer for the operatoutg system. -func NewStdoutContainerForOS() StdoutContainer { - return newStdoutContainer(os.Stdout) -} - -// StderrContainer provides stderr. -type StderrContainer interface { - // Stderr provides stderr. - // - // If no value was passed when Stdio was created, this will return io.EOF on any call. - Stderr() io.Writer -} - -// NewStderrContainer returns a new StderrContainer. -func NewStderrContainer(writer io.Writer) StderrContainer { - return newStderrContainer(writer) -} - -// NewStderrContainerForOS returns a new StderrContainer for the operaterrg system. -func NewStderrContainerForOS() StderrContainer { - return newStderrContainer(os.Stderr) -} - -// ArgContainer provides the arguments. -type ArgContainer interface { - // NumArgs gets the number of arguments. - NumArgs() int - // Arg gets the ith argument. - // - // Panics if i < 0 || i >= Len(). - Arg(i int) string -} - -// NewArgContainer returns a new ArgContainer. -func NewArgContainer(args ...string) ArgContainer { - return newArgContainer(args) -} - -// NewArgContainerForOS returns a new ArgContainer for the operating system. -func NewArgContainerForOS() ArgContainer { - return newArgContainer(os.Args) -} - -// Container contains environment variables, args, and stdio. -type Container interface { - EnvContainer - StdinContainer - StdoutContainer - StderrContainer - ArgContainer -} - -// NewContainer returns a new Container. -func NewContainer( - env map[string]string, - stdin io.Reader, - stdout io.Writer, - stderr io.Writer, - args ...string, -) Container { - return newContainer( - NewEnvContainer(env), - NewStdinContainer(stdin), - NewStdoutContainer(stdout), - NewStderrContainer(stderr), - NewArgContainer(args...), - ) -} - -// NewContainerForOS returns a new Container for the operating system. -func NewContainerForOS() (Container, error) { - envContainer, err := NewEnvContainerForOS() - if err != nil { - return nil, err - } - return newContainer( - envContainer, - NewStdinContainerForOS(), - NewStdoutContainerForOS(), - NewStderrContainerForOS(), - NewArgContainerForOS(), - ), nil -} - -// NewContainerForArgs returns a new Container with the replacement args. -func NewContainerForArgs(container Container, newArgs ...string) Container { - return newContainer( - container, - container, - container, - container, - NewArgContainer(newArgs...), - ) -} - -// StdioContainer is a stdio container. -type StdioContainer interface { - StdinContainer - StdoutContainer - StderrContainer -} - -// EnvStdinContainer is an environment and stdin container. -type EnvStdinContainer interface { - EnvContainer - StdinContainer -} - -// EnvStdoutContainer is an environment and stdout container. -type EnvStdoutContainer interface { - EnvContainer - StdoutContainer -} - -// EnvStderrContainer is an environment and stderr container. -type EnvStderrContainer interface { - EnvContainer - StderrContainer -} - -// EnvStdioContainer is an environment and stdio container. -type EnvStdioContainer interface { - EnvContainer - StdioContainer -} - -// Environ returns all environment variables in the form "KEY=VALUE". -// -// Equivalent to os.Environ. -// -// Sorted. -func Environ(envContainer EnvContainer) []string { - var environ []string - envContainer.ForEachEnv(func(key string, value string) { - environ = append(environ, key+"="+value) - }) - sort.Strings(environ) - return environ -} - -// EnvironMap returns all environment variables in a map. -// -// No key will have an empty value. -func EnvironMap(envContainer EnvContainer) map[string]string { - m := make(map[string]string) - envContainer.ForEachEnv(func(key string, value string) { - // This should be done anyways per the EnvContainer documentation but just to make sure - if value != "" { - m[key] = value - } - }) - return m -} - -// Args returns all arguments. -// -// Equivalent to os.Args. -func Args(argList ArgContainer) []string { - numArgs := argList.NumArgs() - args := make([]string, numArgs) - for i := 0; i < numArgs; i++ { - args[i] = argList.Arg(i) - } - return args -} - -// EnvBool EnvBoolValue gets and parses the environment variable bool value for the key. -// -// Returns error on parsing error. -func EnvBool(container EnvContainer, key string, defaultValue bool) (bool, error) { - value := container.Env(key) - if value == "" { - return defaultValue, nil - } - return strconv.ParseBool(value) -} - -// IsDevStdin returns true if the path is the equivalent of /dev/stdin. -func IsDevStdin(path string) bool { - return path != "" && path == DevStdinFilePath -} - -// IsDevStdout returns true if the path is the equivalent of /dev/stdout. -func IsDevStdout(path string) bool { - return path != "" && path == DevStdoutFilePath -} - -// IsDevStderr returns true if the path is the equivalent of /dev/stderr. -func IsDevStderr(path string) bool { - return path != "" && path == DevStderrFilePath -} - -// IsDevNull returns true if the path is the equivalent of /dev/null. -func IsDevNull(path string) bool { - return path != "" && path == DevNullFilePath -} - -// IsDevPath returns true if the path is the equivalent of /dev/stdin, /dev/stdout, -// /dev/stderr, or /dev/null. -func IsDevPath(path string) bool { - return IsDevStdin(path) || IsDevStdout(path) || IsDevStderr(path) || IsDevNull(path) -} - -// Main runs the application using the OS Container and calling os.Exit on the return value of Run. -func Main(ctx context.Context, f func(context.Context, Container) error) { - container, err := NewContainerForOS() - if err != nil { - printError(container, err) - os.Exit(GetExitCode(err)) - } - os.Exit(GetExitCode(Run(ctx, container, f))) -} - -// Run runs the application using the container. -// -// The run will be stopped on interrupt signal. -// The exit code can be determined using GetExitCode. -func Run(ctx context.Context, container Container, f func(context.Context, Container) error) error { - ctx, cancel := interrupt.WithCancel(ctx) - defer cancel() - if err := f(ctx, container); err != nil { - printError(container, err) - return err - } - return nil -} - -// NewError returns a new Error that contains an exit code. -// -// The exit code cannot be 0. -func NewError(exitCode int, message string) error { - return newAppError(exitCode, message) -} - -// NewErrorf returns a new error that contains an exit code. -// -// The exit code cannot be 0. -func NewErrorf(exitCode int, format string, args ...interface{}) error { - return newAppError(exitCode, fmt.Sprintf(format, args...)) -} - -// GetExitCode gets the exit code. -// -// If err == nil, this returns 0. -// If err was created by this package, this returns the exit code from the error. -// Otherwise, this returns 1. -func GetExitCode(err error) int { - if err == nil { - return 0 - } - appErr := &appError{} - if errors.As(err, &appErr) { - return appErr.exitCode - } - return 1 -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/app_error.go b/vendor/github.com/bufbuild/buf/private/pkg/app/app_error.go deleted file mode 100644 index 8e104912ef..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/app_error.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "fmt" -) - -type appError struct { - exitCode int - message string -} - -func newAppError(exitCode int, message string) *appError { - if exitCode == 0 { - message = fmt.Sprintf( - "got invalid exit code %d when constructing error (original message was %q)", - exitCode, - message, - ) - exitCode = 1 - } - return &appError{ - exitCode: exitCode, - message: message, - } -} - -func (e *appError) Error() string { - return e.message -} - -func printError(container StderrContainer, err error) { - if errString := err.Error(); errString != "" { - _, _ = fmt.Fprintln(container.Stderr(), errString) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/app_unix.go b/vendor/github.com/bufbuild/buf/private/pkg/app/app_unix.go deleted file mode 100644 index 37b1b2f78c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/app_unix.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6 -// -// We expanded this to all unix-like platforms, including those we don't support, as most -// of this should work without issue, and there are bigger problems with supporting i.e. js,wasm -// that are outside the scope of these build tags. Being able to build buf on i.e. openbsd -// was a blocker, see https://github.com/bufbuild/buf/issues/362 and the linked discussions. -// We still only officially support linux and darwin for buf as a whole. - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package app - -import ( - "errors" - "fmt" - "path/filepath" -) - -const ( - // DevStdinFilePath is the equivalent of /dev/stdin. - // - // This will be /dev/stdin for darwin and linux. - // This does not exist for windows. - DevStdinFilePath = "/dev/stdin" - // DevStdoutFilePath is the equivalent of /dev/stdout. - // - // This will be /dev/stdout for darwin and linux. - // This does not exist for windows. - DevStdoutFilePath = "/dev/stdout" - // DevStderrFilePath is the equivalent of /dev/stderr. - // - // This will be /dev/stderr for darwin and linux. - // This does not exist for windows. - DevStderrFilePath = "/dev/stderr" - // DevNullFilePath is the equivalent of /dev/null. - // - // This will be /dev/null for darwin and linux. - // This will be nul for windows. - DevNullFilePath = "/dev/null" -) - -// HomeDirPath returns the home directory path. -// -// This will be $HOME for darwin and linux. -// This will be %USERPROFILE% for windows. -func HomeDirPath(envContainer EnvContainer) (string, error) { - if home := envContainer.Env("HOME"); home != "" { - return home, nil - } - return "", errors.New("$HOME is not set") -} - -// CacheDirPath returns the cache directory path. -// -// This will be $XDG_CACHE_HOME for darwin and linux, falling back to $HOME/.cache. -// This will be %LocalAppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func CacheDirPath(envContainer EnvContainer) (string, error) { - return xdgDirPath(envContainer, "XDG_CACHE_HOME", ".cache") -} - -// ConfigDirPath returns the config directory path. -// -// This will be $XDG_CONFIG_HOME for darwin and linux, falling back to $HOME/.config. -// This will be %AppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func ConfigDirPath(envContainer EnvContainer) (string, error) { - return xdgDirPath(envContainer, "XDG_CONFIG_HOME", ".config") -} - -// DataDirPath returns the data directory path. -// -// This will be $XDG_DATA_HOME for darwin and linux, falling back to $HOME/.local/share. -// This will be %LocalAppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func DataDirPath(envContainer EnvContainer) (string, error) { - return xdgDirPath(envContainer, "XDG_DATA_HOME", filepath.Join(".local", "share")) -} - -func xdgDirPath(envContainer EnvContainer, key string, fallbackRelHomeDirPath string) (string, error) { - if value := envContainer.Env(key); value != "" { - return value, nil - } - if home := envContainer.Env("HOME"); home != "" { - return filepath.Join(home, fallbackRelHomeDirPath), nil - } - return "", fmt.Errorf("$%s and $HOME are not set", key) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/app_windows.go b/vendor/github.com/bufbuild/buf/private/pkg/app/app_windows.go deleted file mode 100644 index 7e7e62f1e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/app_windows.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package app - -import ( - "errors" -) - -const ( - // DevStdinFilePath is the equivalent of /dev/stdin. - // - // This will be /dev/stdin for darwin and linux. - // This does not exist for windows. - DevStdinFilePath = "" - // DevStdoutFilePath is the equivalent of /dev/stdout. - // - // This will be /dev/stdout for darwin and linux. - // This does not exist for windows. - DevStdoutFilePath = "" - // DevStderrFilePath is the equivalent of /dev/stderr. - // - // This will be /dev/stderr for darwin and linux. - // This does not exist for windows. - DevStderrFilePath = "" - // DevNullFilePath is the equivalent of /dev/null. - // - // This will be /dev/null for darwin and linux. - // This will be nul for windows. - DevNullFilePath = "nul" -) - -// HomeDirPath returns the home directory path. -// -// This will be $HOME for darwin and linux. -// This will be %USERPROFILE% for windows. -func HomeDirPath(envContainer EnvContainer) (string, error) { - if value := envContainer.Env("USERPROFILE"); value != "" { - return value, nil - } - return "", errors.New("%USERPROFILE% is not set") -} - -// CacheDirPath returns the cache directory path. -// -// This will be $XDG_CACHE_HOME for darwin and linux, falling back to $HOME/.cache. -// This will be %LocalAppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func CacheDirPath(envContainer EnvContainer) (string, error) { - if value := envContainer.Env("LOCALAPPDATA"); value != "" { - return value, nil - } - return "", errors.New("%LocalAppData% is not set") -} - -// ConfigDirPath returns the config directory path. -// -// This will be $XDG_CONFIG_HOME for darwin and linux, falling back to $HOME/.config. -// This will be %AppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func ConfigDirPath(envContainer EnvContainer) (string, error) { - if value := envContainer.Env("APPDATA"); value != "" { - return value, nil - } - return "", errors.New("%AppData% is not set") -} - -// DataDirPath returns the data directory path. -// -// This will be $XDG_DATA_HOME for darwin and linux, falling back to $HOME/.local/share. -// This will be %LocalAppData% for windows. -// -// See https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -// for darwin and linux. Note that we use the same for darwin and linux as this is -// what developers expect, as opposed to ~/Library/Preferences etc as the stdlib -// does for Go. -// -// Users cannot assume that CacheDirPath, ConfigDirPath, and DataDirPath are unique. -func DataDirPath(envContainer EnvContainer) (string, error) { - if value := envContainer.Env("LOCALAPPDATA"); value != "" { - return value, nil - } - return "", errors.New("%LocalAppData% is not set") -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/appcmd.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/appcmd.go deleted file mode 100644 index cdcfb6e9b5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/appcmd.go +++ /dev/null @@ -1,378 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package appcmd contains helper functionality for applications using commands. -package appcmd - -import ( - "context" - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" - "github.com/spf13/pflag" -) - -// Command is a command. -type Command struct { - // Use is the one-line usage message. - // Required. - Use string - // Aliases are aliases that can be used instead of the first word in Use. - Aliases []string - // Short is the short message shown in the 'help' output. - // Required if Long is set. - Short string - // Long is the long message shown in the 'help ' output. - // The Short field will be prepended to the Long field with two newlines. - // Must be unset if short is unset. - Long string - // Args are the expected arguments. - // - // TODO: make specific types for appcmd to limit what can be done. - Args cobra.PositionalArgs - // Deprecated says to print this deprecation string. - Deprecated string - // Hidden says to hide this command. - Hidden bool - // BindFlags allows binding of flags on build. - BindFlags func(*pflag.FlagSet) - // BindPersistentFlags allows binding of flags on build. - BindPersistentFlags func(*pflag.FlagSet) - // NormalizeFlag allows for normalization of flag names. - NormalizeFlag func(*pflag.FlagSet, string) string - // NormalizePersistentFlag allows for normalization of flag names. - NormalizePersistentFlag func(*pflag.FlagSet, string) string - // Run is the command to run. - // Required if there are no sub-commands. - // Must be unset if there are sub-commands. - Run func(context.Context, app.Container) error - // SubCommands are the sub-commands. Optional. - // Must be unset if there is a run function. - SubCommands []*Command - // Version the version of the command. - // - // If this is specified, a flag --version will be added to the command - // that precedes all other functionality, and which prints the version - // to stdout. - Version string -} - -// NewInvalidArgumentError creates a new invalidArgumentError, indicating that -// the error was caused by argument validation. This causes us to print the usage -// help text for the command that it is returned from. -func NewInvalidArgumentError(message string) error { - return newInvalidArgumentError(message) -} - -// NewInvalidArgumentErrorf creates a new InvalidArgumentError, indicating that -// the error was caused by argument validation. This causes us to print the usage -// help text for the command that it is returned from. -func NewInvalidArgumentErrorf(format string, args ...interface{}) error { - return NewInvalidArgumentError(fmt.Sprintf(format, args...)) -} - -// Main runs the application using the OS container and calling os.Exit on the return value of Run. -func Main(ctx context.Context, command *Command) { - app.Main(ctx, newRunFunc(command)) -} - -// Run runs the application using the container. -func Run(ctx context.Context, container app.Container, command *Command) error { - return app.Run(ctx, container, newRunFunc(command)) -} - -// BindMultiple is a convenience function for binding multiple flag functions. -func BindMultiple(bindFuncs ...func(*pflag.FlagSet)) func(*pflag.FlagSet) { - return func(flagSet *pflag.FlagSet) { - for _, bindFunc := range bindFuncs { - bindFunc(flagSet) - } - } -} - -func newRunFunc(command *Command) func(context.Context, app.Container) error { - return func(ctx context.Context, container app.Container) error { - return run(ctx, container, command) - } -} - -func run( - ctx context.Context, - container app.Container, - command *Command, -) error { - var runErr error - - cobraCommand, err := commandToCobra(ctx, container, command, &runErr) - if err != nil { - return err - } - - // Cobra 1.2.0 introduced default completion commands under - // " completion "". Since we have - // our own completion commands, disable the generation of the default - // commands. - cobraCommand.CompletionOptions.DisableDefaultCmd = true - - // If the root command is not the only command, add a hidden manpages command - // and a visible completion command. - if len(command.SubCommands) > 0 { - shellCobraCommand, err := commandToCobra( - ctx, - container, - &Command{ - Use: "completion", - Short: "Generate auto-completion scripts for commonly used shells", - SubCommands: []*Command{ - { - Use: "bash", - Short: "Generate auto-completion scripts for bash", - Args: cobra.NoArgs, - Run: func(ctx context.Context, container app.Container) error { - return cobraCommand.GenBashCompletion(container.Stdout()) - }, - }, - { - Use: "fish", - Short: "Generate auto-completion scripts for fish", - Args: cobra.NoArgs, - Run: func(ctx context.Context, container app.Container) error { - return cobraCommand.GenFishCompletion(container.Stdout(), true) - }, - }, - { - Use: "powershell", - Short: "Generate auto-completion scripts for powershell", - Args: cobra.NoArgs, - Run: func(ctx context.Context, container app.Container) error { - return cobraCommand.GenPowerShellCompletion(container.Stdout()) - }, - }, - { - Use: "zsh", - Short: "Generate auto-completion scripts for zsh", - Args: cobra.NoArgs, - Run: func(ctx context.Context, container app.Container) error { - return cobraCommand.GenZshCompletion(container.Stdout()) - }, - }, - }, - }, - &runErr, - ) - if err != nil { - return err - } - cobraCommand.AddCommand(shellCobraCommand) - manpagesCobraCommand, err := commandToCobra( - ctx, - container, - &Command{ - Use: "manpages", - Args: cobra.ExactArgs(1), - Hidden: true, - Run: func(ctx context.Context, container app.Container) error { - return doc.GenManTree( - cobraCommand, - &doc.GenManHeader{ - Title: "Buf", - Section: "1", - }, - container.Arg(0), - ) - }, - }, - &runErr, - ) - if err != nil { - return err - } - cobraCommand.AddCommand(manpagesCobraCommand) - webpagesCobraCommand, err := commandToCobra( - ctx, - container, - newWebpagesCommand(cobraCommand), - &runErr, - ) - if err != nil { - return err - } - cobraCommand.AddCommand(webpagesCobraCommand) - } - - cobraCommand.SetOut(container.Stderr()) - args := app.Args(container)[1:] - // cobra will implicitly create __complete and __completeNoDesc subcommands - // https://github.com/spf13/cobra/blob/4590150168e93f4b017c6e33469e26590ba839df/completions.go#L14-L17 - // at the very last possible point, to enable them to be overridden. Unfortunately - // the creation of the subcommands uses hidden helper methods (unlike the automatic help command support). - // See https://github.com/spf13/cobra/blob/4590150168e93f4b017c6e33469e26590ba839df/completions.go#L134. - // - // Additionally, the automatically generated commands inherit the output of the root command, - // which we are ensuring is always stderr. - // https://github.com/spf13/cobra/blob/4590150168e93f4b017c6e33469e26590ba839df/completions.go#L175 - // - // bash completion has much more detailed code generation and doesn't rely on the __completion command - // in most cases, the zsh and fish completion implementation however exclusively rely on these commands. - // Those completion implementations send stderr to /dev/null - // https://github.com/spf13/cobra/blob/4590150168e93f4b017c6e33469e26590ba839df/zsh_completions.go#L135 - // and the automatically generated __complete command sends extra data to /dev/null so we cannot - // work around this by minimally changing the code generation commands, we would have to rewrite the - // __completion command which is much more complicated. - // - // Instead of all that, we can peek at the positionals and if the sub command starts with __complete - // we sets its output to stdout. This would mean that we cannot add a "real" sub-command that starts with - // __complete _and_ has its output set to stderr. This shouldn't ever be a problem. - // - // SetOut sets the output location for usage, help, and version messages by default. - if len(args) > 0 && strings.HasPrefix(args[0], "__complete") { - cobraCommand.SetOut(container.Stdout()) - } - cobraCommand.SetArgs(args) - // SetErr sets the output location for error messages. - cobraCommand.SetErr(container.Stderr()) - cobraCommand.SetIn(container.Stdin()) - - if err := cobraCommand.Execute(); err != nil { - return err - } - return runErr -} - -func commandToCobra( - ctx context.Context, - container app.Container, - command *Command, - runErrAddr *error, -) (*cobra.Command, error) { - if err := commandValidate(command); err != nil { - return nil, err - } - cobraCommand := &cobra.Command{ - Use: command.Use, - Aliases: command.Aliases, - Args: command.Args, - Deprecated: command.Deprecated, - Hidden: command.Hidden, - Short: strings.TrimSpace(command.Short), - } - cobraCommand.SetHelpTemplate(`{{.Short}} - -{{with .Long}}{{. | trimTrailingWhitespaces}} - -{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`) - cobraCommand.SetHelpFunc( - func(c *cobra.Command, _ []string) { - if err := tmpl(container.Stdout(), c.HelpTemplate(), c); err != nil { - c.PrintErrln(err) - } - }, - ) - if command.Long != "" { - cobraCommand.Long = strings.TrimSpace(command.Long) - } - if command.BindFlags != nil { - command.BindFlags(cobraCommand.Flags()) - } - if command.BindPersistentFlags != nil { - command.BindPersistentFlags(cobraCommand.PersistentFlags()) - } - if command.NormalizeFlag != nil { - cobraCommand.Flags().SetNormalizeFunc(normalizeFunc(command.NormalizeFlag)) - } - if command.NormalizePersistentFlag != nil { - cobraCommand.PersistentFlags().SetNormalizeFunc(normalizeFunc(command.NormalizePersistentFlag)) - } - if command.Run != nil { - cobraCommand.Run = func(_ *cobra.Command, args []string) { - runErr := command.Run(ctx, app.NewContainerForArgs(container, args...)) - if asErr := (&invalidArgumentError{}); errors.As(runErr, &asErr) { - // Print usage for failing command if an args error is returned. - // This has to be done at this level since the usage must relate - // to the command executed. - printUsage(container, cobraCommand.UsageString()) - } - *runErrAddr = runErr - } - } - if len(command.SubCommands) > 0 { - // command.Run will not be set per validation - cobraCommand.Run = func(cmd *cobra.Command, args []string) { - printUsage(container, cobraCommand.UsageString()) - if len(args) == 0 { - *runErrAddr = errors.New("Sub-command required.") - } else { - *runErrAddr = fmt.Errorf("Unknown sub-command: %s", strings.Join(args, " ")) - } - } - for _, subCommand := range command.SubCommands { - subCobraCommand, err := commandToCobra(ctx, container, subCommand, runErrAddr) - if err != nil { - return nil, err - } - cobraCommand.AddCommand(subCobraCommand) - } - } - if command.Version != "" { - doVersion := false - oldRun := cobraCommand.Run - cobraCommand.Flags().BoolVar( - &doVersion, - "version", - false, - "Print the version", - ) - cobraCommand.Run = func(cmd *cobra.Command, args []string) { - if doVersion { - _, err := container.Stdout().Write([]byte(command.Version + "\n")) - *runErrAddr = err - return - } - oldRun(cmd, args) - } - } - // appcommand prints errors, disable to prevent duplicates. - cobraCommand.SilenceErrors = true - return cobraCommand, nil -} - -func commandValidate(command *Command) error { - if command.Use == "" { - return errors.New("must set Command.Use") - } - if command.Long != "" && command.Short == "" { - return errors.New("must set Command.Short if Command.Long is set") - } - if command.Run != nil && len(command.SubCommands) > 0 { - return errors.New("cannot set both Command.Run and Command.SubCommands") - } - if command.Run == nil && len(command.SubCommands) == 0 { - return errors.New("must set one of Command.Run and Command.SubCommands") - } - return nil -} - -func normalizeFunc(f func(*pflag.FlagSet, string) string) func(*pflag.FlagSet, string) pflag.NormalizedName { - return func(flagSet *pflag.FlagSet, name string) pflag.NormalizedName { - return pflag.NormalizedName(f(flagSet, name)) - } -} - -func printUsage(container app.StderrContainer, usage string) { - _, _ = container.Stderr().Write([]byte(usage + "\n")) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/cobra.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/cobra.go deleted file mode 100644 index f8be548a6d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/cobra.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appcmd - -import ( - "fmt" - "io" - "strings" - "text/template" - "unicode" - - "github.com/spf13/cobra" -) - -// The functions in this file are mostly copied from github.com/spf13/cobra. -// https://github.com/spf13/cobra/blob/master/LICENSE.txt - -var templateFuncs = template.FuncMap{ - "trim": strings.TrimSpace, - "trimRightSpace": trimRightSpace, - "trimTrailingWhitespaces": trimRightSpace, - "rpad": rpad, - "gt": cobra.Gt, - "eq": cobra.Eq, -} - -func trimRightSpace(s string) string { - return strings.TrimRightFunc(s, unicode.IsSpace) -} - -// rpad adds padding to the right of a string. -func rpad(s string, padding int) string { - template := fmt.Sprintf("%%-%ds", padding) - return fmt.Sprintf(template, s) -} - -// tmpl executes the given template text on data, writing the result to w. -func tmpl(w io.Writer, text string, data interface{}) error { - t := template.New("top") - t.Funcs(templateFuncs) - t, err := t.Parse(text) - if err != nil { - return err - } - return t.Execute(w, data) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/error.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/error.go deleted file mode 100644 index d4927e3140..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/error.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appcmd - -// invalidArgumentError is used to indicate that an error was -// caused by argument validation. -type invalidArgumentError struct { - message string -} - -func newInvalidArgumentError(message string) *invalidArgumentError { - return &invalidArgumentError{message: message} -} - -func (a *invalidArgumentError) Error() string { - return a.message -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/usage.gen.go deleted file mode 100644 index 87a0e5887f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appcmd - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/webpages.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/webpages.go deleted file mode 100644 index b8f020abd6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appcmd/webpages.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appcmd - -import ( - "bufio" - "bytes" - "context" - "fmt" - "html" - "io" - "os" - "path" - "path/filepath" - "regexp" - "sort" - "strings" - "unicode" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "gopkg.in/yaml.v3" -) - -const ( - webpagesConfigFlag = "config" -) - -var codeBlockRegex = regexp.MustCompile(`(^\s\s\s\s)|(^\t)`) - -type webpagesFlags struct { - Config string -} - -// webpagesConfig configures the doc generator, example config: -// exclude_commands: -// - buf completion -// - buf ls-files -// weight_commands: -// buf beta: 1 -// slug_prefix: /reference/cli/ -// output_dir: output/docs -type webpagesConfig struct { - // ExcludeCommands will filter out these command paths from generation. - ExcludeCommands []string `yaml:"exclude_commands,omitempty"` - // WeightCommands will weight the command paths and show higher weighted commands later on the sidebar. - WeightCommands map[string]int `yaml:"weight_commands,omitempty"` - SlugPrefix string `yaml:"slug_prefix,omitempty"` - OutputDir string `yaml:"output_dir,omitempty"` - // SidebarPathThreshold will dictate if the sidebar label is the full path or just the name. - // if the command path is longer than this then the `cobra.Command.Name()` is used, - // otherwise `cobra.Command.CommandPath() is used. - SidebarPathThreshold int `yaml:"sidebar_path_threshold,omitempty"` -} - -func newWebpagesFlags() *webpagesFlags { - return &webpagesFlags{} -} - -func (f *webpagesFlags) Bind(flagSet *pflag.FlagSet) { - flagSet.StringVar( - &f.Config, - webpagesConfigFlag, - "", - "Config file to use", - ) -} - -// newWebpagesCommand returns a "webpages" command that generates docusaurus markdown for cobra commands. -// In the future this will need to be adapted to accept a Command when cobra.Command is removed. -func newWebpagesCommand( - command *cobra.Command, -) *Command { - flags := newWebpagesFlags() - return &Command{ - Use: "webpages", - Hidden: true, - Run: func(ctx context.Context, container app.Container) error { - cfg, err := readConfig(flags.Config) - if err != nil { - return err - } - excludes := make(map[string]bool) - for _, exclude := range cfg.ExcludeCommands { - excludes[exclude] = true - } - for _, cmd := range command.Commands() { - if excludes[cmd.CommandPath()] { - cmd.Hidden = true - } - } - return generateMarkdownTree( - command, - cfg, - cfg.OutputDir, - ) - }, - BindFlags: flags.Bind, - } -} - -// generateMarkdownTree generates markdown for a whole command tree. -func generateMarkdownTree(cmd *cobra.Command, config webpagesConfig, parentDirPath string) error { - if !cmd.IsAvailableCommand() { - return nil - } - dirPath := parentDirPath - fileName := cmd.Name() + ".md" - if cmd.HasSubCommands() { - dirPath = filepath.Join(parentDirPath, cmd.Name()) - if err := os.MkdirAll(dirPath, os.ModePerm); err != nil { - return err - } - fileName = "index.md" - } - filePath := filepath.Join(dirPath, fileName) - f, err := os.Create(filePath) - if err != nil { - return err - } - defer f.Close() - if err := generateMarkdownPage(cmd, config, f); err != nil { - return err - } - if cmd.HasSubCommands() { - commands := cmd.Commands() - orderCommands(config.WeightCommands, commands) - for _, command := range commands { - if err := generateMarkdownTree(command, config, dirPath); err != nil { - return err - } - } - } - return nil -} - -// generateMarkdownPage creates custom markdown output. -func generateMarkdownPage(cmd *cobra.Command, config webpagesConfig, w io.Writer) error { - var err error - p := func(format string, a ...any) { - _, err = w.Write([]byte(fmt.Sprintf(format, a...))) - } - p("---\n") - p("id: %s\n", websitePageID(cmd)) - p("title: %s\n", cmd.CommandPath()) - p("sidebar_label: %s\n", sidebarLabel(cmd, config.SidebarPathThreshold)) - p("sidebar_position: %d\n", websiteSidebarPosition(cmd, config.WeightCommands)) - p("slug: /%s\n", path.Join(config.SlugPrefix, websiteSlug(cmd))) - p("---\n") - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - if cmd.Version != "" { - p("version `%s`\n\n", cmd.Version) - } - p(cmd.Short) - p("\n\n") - if cmd.Runnable() { - p("### Usage\n") - p("```terminal\n$ %s\n```\n\n", cmd.UseLine()) - } - if len(cmd.Long) > 0 { - p("### Description\n\n") - p("%s \n\n", escapeDescription(cmd.Long)) - } - if len(cmd.Example) > 0 { - p("### Examples\n\n") - p("```\n%s\n```\n\n", escapeDescription(cmd.Example)) - } - commandFlags := cmd.NonInheritedFlags() - if commandFlags.HasAvailableFlags() { - p("### Flags {#flags}\n\n") - if err := printFlags(commandFlags, w); err != nil { - return err - } - } - inheritedFlags := cmd.InheritedFlags() - if inheritedFlags.HasAvailableFlags() { - p("### Flags inherited from parent commands {#persistent-flags}\n") - if err := printFlags(inheritedFlags, w); err != nil { - return err - } - } - if hasSubCommands(cmd) { - p("### Subcommands\n\n") - children := cmd.Commands() - orderCommands(config.WeightCommands, children) - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - childRelPath := child.Name() + ".md" - if child.HasSubCommands() { - childRelPath = filepath.Join(child.Name(), "index.md") - } - p("* [%s](./%s)\t - %s\n", child.CommandPath(), childRelPath, child.Short) - } - p("\n") - } - if cmd.HasParent() { - p("### Parent Command\n\n") - parent := cmd.Parent() - parentName := parent.CommandPath() - if hasSubCommands(cmd) { - p("* [%s](../index.md)\t - %s\n", parentName, parent.Short) - } else { - p("* [%s](./index.md)\t - %s\n", parentName, parent.Short) - } - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - return err -} - -func websitePageID(cmd *cobra.Command) string { - return strings.ReplaceAll(cmd.CommandPath(), " ", "-") -} - -func hasSubCommands(cmd *cobra.Command) bool { - for _, command := range cmd.Commands() { - if !command.IsAvailableCommand() || command.IsAdditionalHelpTopicCommand() { - continue - } - return true - } - return false -} - -// escapeDescription is a bit of a hack because docusaurus markdown rendering is a bit weird. -// If the code block is indented then escaping html characters is skipped, otherwise it will -// html.Escape the string. -func escapeDescription(s string) string { - out := &bytes.Buffer{} - read := bufio.NewReader(strings.NewReader(s)) - var inCodeBlock bool - for { - line, _, err := read.ReadLine() - if err == io.EOF { - break - } - text := string(line) - // convert indented code blocks into terminal code blocks so the - // $ isn't copied when using the copy button - if codeBlockRegex.MatchString(text) { - if !inCodeBlock { - out.WriteString("```terminal\n") - inCodeBlock = true - } - // remove the indentation level from the indented code block - text = codeBlockRegex.ReplaceAllString(text, "") - out.WriteString(text) - out.WriteString("\n") - continue - } - // indented code blocks can have blank lines in them so - // if the next line is a whitespace then we don't want to - // terminate the code block - if inCodeBlock && text == "" { - if b, err := read.Peek(1); err == nil && unicode.IsSpace(rune(b[0])) { - out.WriteString(text) - out.WriteString("\n") - continue - } - } - // terminate the fenced code block with ``` - if inCodeBlock { - out.WriteString("```\n") - inCodeBlock = false - } - out.WriteString(html.EscapeString(text)) - out.WriteString("\n") - } - if inCodeBlock { - out.WriteString("```\n") - } - return out.String() -} - -func readConfig(filename string) (webpagesConfig, error) { - if filename == "" { - return webpagesConfig{}, nil - } - file, err := os.Open(filename) - if err != nil { - return webpagesConfig{}, err - } - yamlBytes, err := io.ReadAll(file) - if err != nil { - return webpagesConfig{}, err - } - var cfg webpagesConfig - if err := yaml.Unmarshal(yamlBytes, &cfg); err != nil { - return webpagesConfig{}, err - } - return cfg, err -} - -func orderCommands(weights map[string]int, commands []*cobra.Command) { - sort.SliceStable(commands, func(i, j int) bool { - return weights[commands[i].CommandPath()] < weights[commands[j].CommandPath()] - }) -} - -func printFlags(f *pflag.FlagSet, w io.Writer) error { - var err error - p := func(format string, a ...any) { - _, err = w.Write([]byte(fmt.Sprintf(format, a...))) - } - f.VisitAll(func(flag *pflag.Flag) { - if flag.Hidden { - return - } - if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { - p("#### -%s, --%s", flag.Shorthand, flag.Name) - } else { - p("#### --%s", flag.Name) - } - varname, usage := pflag.UnquoteUsage(flag) - if varname != "" { - p(" *%s*", varname) - } - p(" {#%s}", flag.Name) - p("\n") - p(usage) - if flag.NoOptDefVal != "" { - switch flag.Value.Type() { - case "string": - p("[=\"%s\"]", flag.NoOptDefVal) - case "bool": - if flag.NoOptDefVal != "true" { - p("[=%s]", flag.NoOptDefVal) - } - case "count": - if flag.NoOptDefVal != "+1" { - p("[=%s]", flag.NoOptDefVal) - } - default: - p("[=%s]", flag.NoOptDefVal) - } - } - if len(flag.Deprecated) != 0 { - p(" (DEPRECATED: %s)", flag.Deprecated) - } - p("\n\n") - }) - return err -} - -// websiteSidebarPosition calculates the position of the given command in the website sidebar. -func websiteSidebarPosition(cmd *cobra.Command, weights map[string]int) int { - // Return 0 if the command has no parent - if !cmd.HasParent() { - return 0 - } - siblings := cmd.Parent().Commands() - orderCommands(weights, siblings) - position := 0 - for _, sibling := range siblings { - if isCommandVisible(sibling) { - position++ - if sibling.CommandPath() == cmd.CommandPath() { - return position - } - } - } - return -1 -} - -// isCommandVisible checks if a command is visible (available, not an additional help topic, and not hidden). -func isCommandVisible(cmd *cobra.Command) bool { - return cmd.IsAvailableCommand() && !cmd.IsAdditionalHelpTopicCommand() && !cmd.Hidden -} - -func websiteSlug(cmd *cobra.Command) string { - return strings.ReplaceAll(cmd.CommandPath(), " ", "/") -} - -func sidebarLabel(cmd *cobra.Command, maxSidebarLen int) string { - if len(strings.Split(cmd.CommandPath(), " ")) > maxSidebarLen { - return cmd.Name() - } - return cmd.CommandPath() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/appflag.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/appflag.go deleted file mode 100644 index 267f79c207..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/appflag.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package appflag contains functionality to work with flags. -package appflag - -import ( - "context" - "time" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/applog" - "github.com/bufbuild/buf/private/pkg/app/appname" - "github.com/bufbuild/buf/private/pkg/app/appverbose" - "github.com/spf13/pflag" -) - -// Container is a container. -type Container interface { - app.Container - appname.Container - applog.Container - appverbose.Container -} - -// Interceptor intercepts and adapts the request or response of run functions. -type Interceptor func(func(context.Context, Container) error) func(context.Context, Container) error - -// Builder builds run functions. -type Builder interface { - BindRoot(flagSet *pflag.FlagSet) - NewRunFunc(func(context.Context, Container) error, ...Interceptor) func(context.Context, app.Container) error -} - -// NewBuilder returns a new Builder. -func NewBuilder(appName string, options ...BuilderOption) Builder { - return newBuilder(appName, options...) -} - -// BuilderOption is an option for a new Builder -type BuilderOption func(*builder) - -// BuilderWithTimeout returns a new BuilderOption that adds a timeout flag and the default timeout. -func BuilderWithTimeout(defaultTimeout time.Duration) BuilderOption { - return func(builder *builder) { - builder.defaultTimeout = defaultTimeout - } -} - -// BuilderWithTracing enables zap tracing for the builder. -func BuilderWithTracing() BuilderOption { - return func(builder *builder) { - builder.tracing = true - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/builder.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/builder.go deleted file mode 100644 index 90d259b0f4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/builder.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appflag - -import ( - "context" - "fmt" - "os" - "time" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/applog" - "github.com/bufbuild/buf/private/pkg/app/appverbose" - "github.com/bufbuild/buf/private/pkg/observabilityzap" - "github.com/pkg/profile" - "github.com/spf13/pflag" - "go.opentelemetry.io/otel" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -type builder struct { - appName string - - verbose bool - debug bool - noWarn bool - logFormat string - - profile bool - profilePath string - profileLoops int - profileType string - profileAllowError bool - - timeout time.Duration - - defaultTimeout time.Duration - - tracing bool -} - -func newBuilder(appName string, options ...BuilderOption) *builder { - builder := &builder{ - appName: appName, - } - for _, option := range options { - option(builder) - } - return builder -} - -func (b *builder) BindRoot(flagSet *pflag.FlagSet) { - flagSet.BoolVarP(&b.verbose, "verbose", "v", false, "Turn on verbose mode") - flagSet.BoolVar(&b.debug, "debug", false, "Turn on debug logging") - flagSet.StringVar(&b.logFormat, "log-format", "color", "The log format [text,color,json]") - if b.defaultTimeout > 0 { - flagSet.DurationVar(&b.timeout, "timeout", b.defaultTimeout, `The duration until timing out, setting it to zero means no timeout`) - } - - flagSet.BoolVar(&b.profile, "profile", false, "Run profiling") - _ = flagSet.MarkHidden("profile") - flagSet.StringVar(&b.profilePath, "profile-path", "", "The profile base directory path") - _ = flagSet.MarkHidden("profile-path") - flagSet.IntVar(&b.profileLoops, "profile-loops", 1, "The number of loops to run") - _ = flagSet.MarkHidden("profile-loops") - flagSet.StringVar(&b.profileType, "profile-type", "cpu", "The profile type [cpu,mem,block,mutex]") - _ = flagSet.MarkHidden("profile-type") - flagSet.BoolVar(&b.profileAllowError, "profile-allow-error", false, "Allow errors for profiled commands") - _ = flagSet.MarkHidden("profile-allow-error") - - // We do not officially support this flag, this is for testing, where we need warnings turned off. - flagSet.BoolVar(&b.noWarn, "no-warn", false, "Turn off warn logging") - _ = flagSet.MarkHidden("no-warn") -} - -func (b *builder) NewRunFunc( - f func(context.Context, Container) error, - interceptors ...Interceptor, -) func(context.Context, app.Container) error { - interceptor := chainInterceptors(interceptors...) - return func(ctx context.Context, appContainer app.Container) error { - if interceptor != nil { - return b.run(ctx, appContainer, interceptor(f)) - } - return b.run(ctx, appContainer, f) - } -} - -func (b *builder) run( - ctx context.Context, - appContainer app.Container, - f func(context.Context, Container) error, -) (retErr error) { - logLevel, err := getLogLevel(b.debug, b.noWarn) - if err != nil { - return err - } - logger, err := applog.NewLogger(appContainer.Stderr(), logLevel, b.logFormat) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, logger.Sync()) - }() - verbosePrinter := appverbose.NewVerbosePrinter(appContainer.Stderr(), b.appName, b.verbose) - container, err := newContainer(appContainer, b.appName, logger, verbosePrinter) - if err != nil { - return err - } - - var cancel context.CancelFunc - if !b.profile && b.timeout != 0 { - ctx, cancel = context.WithTimeout(ctx, b.timeout) - defer cancel() - } - - if b.tracing { - closer := observabilityzap.Start(logger) - defer func() { - retErr = multierr.Append(retErr, closer.Close()) - }() - _, span := otel.GetTracerProvider().Tracer("bufbuild/buf").Start(ctx, "command") - defer span.End() - } - if !b.profile { - return f(ctx, container) - } - return runProfile( - logger, - b.profilePath, - b.profileType, - b.profileLoops, - b.profileAllowError, - func() error { - return f(ctx, container) - }, - ) -} - -// runProfile profiles the function. -func runProfile( - logger *zap.Logger, - profilePath string, - profileType string, - profileLoops int, - profileAllowError bool, - f func() error, -) error { - var err error - if profilePath == "" { - profilePath, err = os.MkdirTemp("", "") - if err != nil { - return err - } - } - logger.Debug("profile", zap.String("path", profilePath)) - if profileType == "" { - profileType = "cpu" - } - if profileLoops == 0 { - profileLoops = 10 - } - var profileFunc func(*profile.Profile) - switch profileType { - case "cpu": - profileFunc = profile.CPUProfile - case "mem": - profileFunc = profile.MemProfile - case "block": - profileFunc = profile.BlockProfile - case "mutex": - profileFunc = profile.MutexProfile - default: - return fmt.Errorf("unknown profile type: %q", profileType) - } - stop := profile.Start( - profile.Quiet, - profile.ProfilePath(profilePath), - profileFunc, - ) - for i := 0; i < profileLoops; i++ { - if err := f(); err != nil { - if !profileAllowError { - return err - } - } - } - stop.Stop() - return nil -} - -func getLogLevel(debugFlag bool, noWarnFlag bool) (string, error) { - if debugFlag && noWarnFlag { - return "", fmt.Errorf("cannot set both --debug and --no-warn") - } - if noWarnFlag { - return "error", nil - } - if debugFlag { - return "debug", nil - } - return "info", nil -} - -// chainInterceptors consolidates the given interceptors into one. -// The interceptors are applied in the order they are declared. -func chainInterceptors(interceptors ...Interceptor) Interceptor { - filtered := make([]Interceptor, 0, len(interceptors)) - for _, interceptor := range interceptors { - if interceptor != nil { - filtered = append(filtered, interceptor) - } - } - switch n := len(filtered); n { - case 0: - return nil - case 1: - return filtered[0] - default: - first := filtered[0] - return func(next func(context.Context, Container) error) func(context.Context, Container) error { - for i := len(filtered) - 1; i > 0; i-- { - next = filtered[i](next) - } - return first(next) - } - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/container.go deleted file mode 100644 index 36b290c728..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/container.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appflag - -import ( - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/app/applog" - "github.com/bufbuild/buf/private/pkg/app/appname" - "github.com/bufbuild/buf/private/pkg/app/appverbose" - "github.com/bufbuild/buf/private/pkg/verbose" - "go.uber.org/zap" -) - -type container struct { - app.Container - nameContainer appname.Container - logContainer applog.Container - verboseContainer appverbose.Container -} - -func newContainer( - baseContainer app.Container, - appName string, - logger *zap.Logger, - verbosePrinter verbose.Printer, -) (*container, error) { - nameContainer, err := appname.NewContainer(baseContainer, appName) - if err != nil { - return nil, err - } - return &container{ - Container: baseContainer, - nameContainer: nameContainer, - logContainer: applog.NewContainer(logger), - verboseContainer: appverbose.NewContainer(verbosePrinter), - }, nil -} - -func (c *container) AppName() string { - return c.nameContainer.AppName() -} - -func (c *container) ConfigDirPath() string { - return c.nameContainer.ConfigDirPath() -} - -func (c *container) CacheDirPath() string { - return c.nameContainer.CacheDirPath() -} - -func (c *container) DataDirPath() string { - return c.nameContainer.DataDirPath() -} - -func (c *container) Port() (uint16, error) { - return c.nameContainer.Port() -} - -func (c *container) Logger() *zap.Logger { - return c.logContainer.Logger() -} - -func (c *container) VerbosePrinter() verbose.Printer { - return c.verboseContainer.VerbosePrinter() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/usage.gen.go deleted file mode 100644 index 1e52187b43..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appflag/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appflag - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/applog.go b/vendor/github.com/bufbuild/buf/private/pkg/app/applog/applog.go deleted file mode 100644 index ba6959cb3b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/applog.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package applog contains utilities to work with logging. -package applog - -import ( - "fmt" - "io" - "strings" - - "github.com/bufbuild/buf/private/pkg/zaputil" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// Container is a container. -type Container interface { - Logger() *zap.Logger -} - -// NewContainer returns a new Container. -func NewContainer(logger *zap.Logger) Container { - return newContainer(logger) -} - -// NewLogger returns a new Logger. -// -// The level can be [debug,info,warn,error]. The default is info. -// The format can be [text,color,json]. The default is color. -func NewLogger(writer io.Writer, levelString string, format string) (*zap.Logger, error) { - level, err := getZapLevel(levelString) - if err != nil { - return nil, err - } - encoder, err := getZapEncoder(format) - if err != nil { - return nil, err - } - return zaputil.NewLogger(writer, level, encoder), nil -} - -func getZapLevel(level string) (zapcore.Level, error) { - level = strings.TrimSpace(strings.ToLower(level)) - switch level { - case "debug": - return zapcore.DebugLevel, nil - case "info", "": - return zapcore.InfoLevel, nil - case "warn": - return zapcore.WarnLevel, nil - case "error": - return zapcore.ErrorLevel, nil - default: - return 0, fmt.Errorf("unknown log level [debug,info,warn,error]: %q", level) - } -} - -func getZapEncoder(format string) (zapcore.Encoder, error) { - format = strings.TrimSpace(strings.ToLower(format)) - switch format { - case "text": - return zaputil.NewTextEncoder(), nil - case "color", "": - return zaputil.NewColortextEncoder(), nil - case "json": - return zaputil.NewJSONEncoder(), nil - default: - return nil, fmt.Errorf("unknown log format [text,color,json]: %q", format) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/applog/container.go deleted file mode 100644 index b4ba3bc65e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/container.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package applog - -import ( - "go.uber.org/zap" -) - -type container struct { - logger *zap.Logger -} - -func newContainer(logger *zap.Logger) *container { - return &container{ - logger: logger, - } -} - -func (c *container) Logger() *zap.Logger { - return c.logger -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/applog/usage.gen.go deleted file mode 100644 index 62956470cc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/applog/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package applog - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/appname.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appname/appname.go deleted file mode 100644 index 704c964c3c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/appname.go +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package appname provides containers for named applications. -// -// Application name foo-bar translate to environment variable prefix FOO_BAR_. -package appname - -import ( - "context" - "errors" - "fmt" - "net" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/encoding" -) - -const ( - configFileName = "config.yaml" - secretRelDirPath = "secrets" -) - -// Container is a container. -type Container interface { - // AppName is the application name. - // - // The name must be in [a-zA-Z0-9-_]. - AppName() string - // ConfigDirPath is the config directory path for the named application. - // - // First checks for $APP_NAME_CONFIG_DIR. - // If this is not set, uses app.ConfigDirPath()/app-name. - // Unnormalized. - ConfigDirPath() string - // CacheDirPath is the cache directory path for the named application. - // - // First checks for $APP_NAME_CACHE_DIR. - // If this is not set, uses app.CacheDirPath()/app-name. - // Unnormalized. - CacheDirPath() string - // DataDirPath is the data directory path for the named application. - // - // First checks for $APP_NAME_DATA_DIR. - // If this is not set, uses app.DataDirPath()/app-name. - // Unnormalized. - DataDirPath() string - // Port is the port to use for serving. - // - // First checks for $APP_NAME_PORT. - // If this is not set, checks for $PORT. - // If this is not set, returns 0, which means no port is known. - // Returns error on parse. - Port() (uint16, error) -} - -// NewContainer returns a new Container. -// -// The name must be in [a-zA-Z0-9-_]. -func NewContainer(envContainer app.EnvContainer, name string) (Container, error) { - return newContainer(envContainer, name) -} - -// ReadConfig reads the configuration from the YAML configuration file config.yaml -// in the configuration directory. -// -// If the file does not exist, this is a no-op. -// The value should be a pointer to unmarshal into. -func ReadConfig(container Container, value interface{}) error { - configFilePath := filepath.Join(container.ConfigDirPath(), configFileName) - data, err := os.ReadFile(configFilePath) - if !errors.Is(err, os.ErrNotExist) { - if err != nil { - return fmt.Errorf("could not read %s configuration file at %s: %w", container.AppName(), configFilePath, err) - } - if err := encoding.UnmarshalYAMLStrict(data, value); err != nil { - return fmt.Errorf("invalid %s configuration file: %w", container.AppName(), err) - } - } - return nil -} - -// ReadSecret returns the contents of the file at path -// filepath.Join(container.ConfigDirPath(), secretRelDirPath, name). -func ReadSecret(container Container, name string) (string, error) { - secretFilePath := filepath.Join(container.ConfigDirPath(), secretRelDirPath, name) - data, err := os.ReadFile(secretFilePath) - if err != nil { - return "", fmt.Errorf("failed to read secret at %s: %w", secretFilePath, err) - } - return string(data), nil -} - -// WriteConfig writes the configuration to the YAML configuration file config.yaml -// in the configuration directory. -// -// The directory is created if it does not exist. -// The value should be a pointer to marshal. -func WriteConfig(container Container, value interface{}) error { - data, err := encoding.MarshalYAML(value) - if err != nil { - return err - } - if err := os.MkdirAll(container.ConfigDirPath(), 0755); err != nil { - return err - } - configFilePath := filepath.Join(container.ConfigDirPath(), configFileName) - fileMode := os.FileMode(0644) - // OK to use os.Stat instead of os.Lstat here - if fileInfo, err := os.Stat(configFilePath); err == nil { - fileMode = fileInfo.Mode() - } - return os.WriteFile(configFilePath, data, fileMode) -} - -// Listen listens on the container's port, falling back to defaultPort. -func Listen(ctx context.Context, container Container, defaultPort uint16) (net.Listener, error) { - port, err := container.Port() - if err != nil { - return nil, err - } - if port == 0 { - port = defaultPort - } - // Must be 0.0.0.0 - var listenConfig net.ListenConfig - return listenConfig.Listen(ctx, "tcp", fmt.Sprintf("0.0.0.0:%d", port)) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appname/container.go deleted file mode 100644 index 3aca41b35e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/container.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appname - -import ( - "errors" - "fmt" - "path/filepath" - "strconv" - "strings" - "sync" - - "github.com/bufbuild/buf/private/pkg/app" -) - -type container struct { - envContainer app.EnvContainer - appName string - - configDirPath string - configDirPathOnce sync.Once - cacheDirPath string - cacheDirPathOnce sync.Once - dataDirPath string - dataDirPathOnce sync.Once - port uint16 - portErr error - portOnce sync.Once -} - -func newContainer(envContainer app.EnvContainer, appName string) (*container, error) { - if err := validateAppName(appName); err != nil { - return nil, err - } - return &container{ - envContainer: envContainer, - appName: appName, - }, nil -} - -func (c *container) AppName() string { - return c.appName -} - -func (c *container) ConfigDirPath() string { - c.configDirPathOnce.Do(c.setConfigDirPath) - return c.configDirPath -} - -func (c *container) CacheDirPath() string { - c.cacheDirPathOnce.Do(c.setCacheDirPath) - return c.cacheDirPath -} - -func (c *container) DataDirPath() string { - c.dataDirPathOnce.Do(c.setDataDirPath) - return c.dataDirPath -} - -func (c *container) Port() (uint16, error) { - c.portOnce.Do(c.setPort) - return c.port, c.portErr -} - -func (c *container) setConfigDirPath() { - c.configDirPath = c.getDirPath("CONFIG_DIR", app.ConfigDirPath) -} - -func (c *container) setCacheDirPath() { - c.cacheDirPath = c.getDirPath("CACHE_DIR", app.CacheDirPath) -} - -func (c *container) setDataDirPath() { - c.dataDirPath = c.getDirPath("DATA_DIR", app.DataDirPath) -} - -func (c *container) setPort() { - c.port, c.portErr = c.getPort() -} - -func (c *container) getDirPath(envSuffix string, getBaseDirPath func(app.EnvContainer) (string, error)) string { - dirPath := c.envContainer.Env(getEnvPrefix(c.appName) + envSuffix) - if dirPath == "" { - baseDirPath, err := getBaseDirPath(c.envContainer) - if err == nil { - dirPath = filepath.Join(baseDirPath, c.appName) - } - } - return dirPath -} - -func (c *container) getPort() (uint16, error) { - portString := c.envContainer.Env(getEnvPrefix(c.appName) + "PORT") - if portString == "" { - portString = c.envContainer.Env("PORT") - if portString == "" { - return 0, nil - } - } - port, err := strconv.ParseUint(portString, 10, 16) - if err != nil { - return 0, fmt.Errorf("could not parse port %q to uint16: %v", portString, err) - } - return uint16(port), nil -} - -func getEnvPrefix(appName string) string { - return strings.ToUpper(strings.ReplaceAll(appName, "-", "_")) + "_" -} -func validateAppName(appName string) error { - if appName == "" { - return errors.New("empty application name") - } - for _, c := range appName { - if !((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '-' || c == '_') { - return fmt.Errorf("invalid application name: %s", appName) - } - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appname/usage.gen.go deleted file mode 100644 index 772dac04b3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appname/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appname - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appproto.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appproto.go deleted file mode 100644 index ef1435dd2c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appproto.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package appproto contains helper functionality for protoc plugins. -// -// Note this is currently implicitly tested through buf's protoc command. -// If this were split out into a separate package, testing would need to be -// moved to this package. -package appproto - -import ( - "bufio" - "bytes" - "context" - "fmt" - "io" - "path/filepath" - "unicode" - "unicode/utf8" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "github.com/bufbuild/buf/private/pkg/protoencoding" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -const ( - // Our generated files in `private/gen/proto` are on average 15KB which isn't - // an unreasonable amount of memory to reserve each time we process an insertion - // point and will save a significant number of allocations. - averageGeneratedFileSize = 15 * 1024 - // We don't use insertion points internally, but assume they are smaller than - // entire generated files. - averageInsertionPointSize = 1024 -) - -// ResponseBuilder builds CodeGeneratorResponses. -type ResponseBuilder interface { - // AddFile adds the file to the response. - // - // Returns error if nil or the name is empty. - // Warns to stderr if the name is already added or the name is not normalized. - AddFile(*pluginpb.CodeGeneratorResponse_File) error - // AddError adds the error message to the response. - // - // If there is an existing error message, this will be concatenated with a newline. - // If message is empty, a message "error" will be added. - AddError(message string) - // SetFeatureProto3Optional sets the proto3 optional feature. - SetFeatureProto3Optional() - // toResponse returns the resulting CodeGeneratorResponse. This must - // only be called after all writing has been completed. - toResponse() *pluginpb.CodeGeneratorResponse -} - -// Handler is a protoc plugin handler. -type Handler interface { - // Handle handles the plugin. - // - // This function can assume the request is valid. - // This should only return error on system error. - // Plugin generation errors should be added with AddError. - // See https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L100 - Handle( - ctx context.Context, - container app.EnvStderrContainer, - responseWriter ResponseBuilder, - request *pluginpb.CodeGeneratorRequest, - ) error -} - -// HandlerFunc is a handler function. -type HandlerFunc func( - context.Context, - app.EnvStderrContainer, - ResponseBuilder, - *pluginpb.CodeGeneratorRequest, -) error - -// Handle implements Handler. -func (h HandlerFunc) Handle( - ctx context.Context, - container app.EnvStderrContainer, - responseWriter ResponseBuilder, - request *pluginpb.CodeGeneratorRequest, -) error { - return h(ctx, container, responseWriter, request) -} - -// Main runs the plugin using app.Main and the Handler. -func Main(ctx context.Context, handler Handler) { - app.Main(ctx, newRunFunc(handler)) -} - -// Run runs the plugin using app.Main and the Handler. -// -// The exit code can be determined using app.GetExitCode. -func Run(ctx context.Context, container app.Container, handler Handler) error { - return app.Run(ctx, container, newRunFunc(handler)) -} - -// Generator executes the Handler using protoc's plugin execution logic. -// -// If multiple requests are specified, these are executed in parallel and the -// result is combined into one response that is written. -type Generator interface { - // Generate generates a CodeGeneratorResponse for the given CodeGeneratorRequests. - // - // A new ResponseBuilder is constructed for every invocation of Generate and is - // used to consolidate all of the CodeGeneratorResponse_Files returned from a single - // plugin into a single CodeGeneratorResponse. - Generate( - ctx context.Context, - container app.EnvStderrContainer, - requests []*pluginpb.CodeGeneratorRequest, - ) (*pluginpb.CodeGeneratorResponse, error) -} - -// NewGenerator returns a new Generator. -func NewGenerator( - logger *zap.Logger, - handler Handler, -) Generator { - return newGenerator(logger, handler) -} - -// ResponseWriter handles the response and writes it to the given storage.WriteBucket -// without executing any plugins and handles insertion points as needed. -type ResponseWriter interface { - // WriteResponse writes to the bucket with the given response. In practice, the - // WriteBucket is most often an in-memory bucket. - // - // CodeGeneratorResponses are consolidated into the bucket, and insertion points - // are applied in-place so that they can only access the files created in a single - // generation invocation (just like protoc). - WriteResponse( - ctx context.Context, - writeBucket storage.WriteBucket, - response *pluginpb.CodeGeneratorResponse, - options ...WriteResponseOption, - ) error -} - -// NewResponseWriter returns a new ResponseWriter. -func NewResponseWriter(logger *zap.Logger) ResponseWriter { - return newResponseWriter(logger) -} - -// WriteResponseOption is an option for WriteResponse. -type WriteResponseOption func(*writeResponseOptions) - -// WriteResponseWithInsertionPointReadBucket returns a new WriteResponseOption that uses the given -// ReadBucket to read from for insertion points. -// -// If this is not specified, insertion points are not supported. -func WriteResponseWithInsertionPointReadBucket( - insertionPointReadBucket storage.ReadBucket, -) WriteResponseOption { - return func(writeResponseOptions *writeResponseOptions) { - writeResponseOptions.insertionPointReadBucket = insertionPointReadBucket - } -} - -// PluginResponse encapsulates a CodeGeneratorResponse, -// along with the name of the plugin that created it. -type PluginResponse struct { - Response *pluginpb.CodeGeneratorResponse - PluginName string - PluginOut string -} - -// NewPluginResponse retruns a new *PluginResponse. -func NewPluginResponse( - response *pluginpb.CodeGeneratorResponse, - pluginName string, - pluginOut string, -) *PluginResponse { - return &PluginResponse{ - Response: response, - PluginName: pluginName, - PluginOut: pluginOut, - } -} - -// ValidatePluginResponses validates that each file is only defined by a single *PluginResponse. -func ValidatePluginResponses(pluginResponses []*PluginResponse) error { - seen := make(map[string]string) - for _, pluginResponse := range pluginResponses { - for _, file := range pluginResponse.Response.File { - if file.GetInsertionPoint() != "" { - // We expect insertion points to write - // to files that already exist. - continue - } - fileName := filepath.Join(pluginResponse.PluginOut, file.GetName()) - if pluginName, ok := seen[fileName]; ok { - return fmt.Errorf( - "file %q was generated multiple times: once by plugin %q and again by plugin %q", - fileName, - pluginName, - pluginResponse.PluginName, - ) - } - seen[fileName] = pluginResponse.PluginName - } - } - return nil -} - -// newRunFunc returns a new RunFunc for app.Main and app.Run. -func newRunFunc(handler Handler) func(context.Context, app.Container) error { - return func(ctx context.Context, container app.Container) error { - input, err := io.ReadAll(container.Stdin()) - if err != nil { - return err - } - request := &pluginpb.CodeGeneratorRequest{} - // We do not know the FileDescriptorSet before unmarshaling this - if err := protoencoding.NewWireUnmarshaler(nil).Unmarshal(input, request); err != nil { - return err - } - if err := protodescriptor.ValidateCodeGeneratorRequest(request); err != nil { - return err - } - responseWriter := newResponseBuilder(container) - if err := handler.Handle(ctx, container, responseWriter, request); err != nil { - return err - } - response := responseWriter.toResponse() - if err := protodescriptor.ValidateCodeGeneratorResponse(response); err != nil { - return err - } - data, err := protoencoding.NewWireMarshaler().Marshal(response) - if err != nil { - return err - } - _, err = container.Stdout().Write(data) - return err - } -} - -// NewResponseBuilder returns a new ResponseBuilder. -func NewResponseBuilder(container app.StderrContainer) ResponseBuilder { - return newResponseBuilder(container) -} - -// leadingWhitespace iterates through the given string, -// and returns the leading whitespace substring, if any, -// respecting utf-8 encoding. -// -// leadingWhitespace("\u205F foo ") -> "\u205F " -func leadingWhitespace(buf []byte) []byte { - leadingSize := 0 - iterBuf := buf - for len(iterBuf) > 0 { - r, size := utf8.DecodeRune(iterBuf) - // protobuf strings must always be valid UTF8 - // https://developers.google.com/protocol-buffers/docs/proto3#scalar - // Additionally, utf8.RuneError is not a space so we'll terminate - // and return the leading, valid, UTF8 whitespace sequence. - if !unicode.IsSpace(r) { - out := make([]byte, leadingSize) - copy(out, buf) - return out - } - leadingSize += size - iterBuf = iterBuf[size:] - } - return buf -} - -// scanWithPrefixAndLineEnding iterates over each of the given scanner's lines -// prepends prefix, and appends the newline sequence. -func scanWithPrefixAndLineEnding(scanner *bufio.Scanner, prefix []byte, newline []byte) []byte { - result := bytes.NewBuffer(nil) - result.Grow(averageInsertionPointSize) - for scanner.Scan() { - // These writes cannot fail, they will panic if they cannot - // allocate - _, _ = result.Write(prefix) - _, _ = result.Write(scanner.Bytes()) - _, _ = result.Write(newline) - } - return result.Bytes() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/appprotoos.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/appprotoos.go deleted file mode 100644 index 8cd9ce4248..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/appprotoos.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package appprotoos does OS-specific generation. -package appprotoos - -import ( - "context" - "io" - - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -// ResponseWriter writes CodeGeneratorResponses to the OS filesystem. -type ResponseWriter interface { - // Close writes all of the responses to disk. No further calls can be - // made to the ResponseWriter after this call. - io.Closer - - // AddResponse adds the response to the writer, switching on the file extension. - // If there is a .jar extension, this generates a jar. If there is a .zip - // extension, this generates a zip. If there is no extension, this outputs - // to the directory. - // - // pluginOut will be unnormalized within this function. - AddResponse( - ctx context.Context, - response *pluginpb.CodeGeneratorResponse, - pluginOut string, - ) error -} - -// NewResponseWriter returns a new ResponseWriter. -func NewResponseWriter( - logger *zap.Logger, - storageosProvider storageos.Provider, - options ...ResponseWriterOption, -) ResponseWriter { - return newResponseWriter( - logger, - storageosProvider, - options..., - ) -} - -// ResponseWriterOption is an option for the ResponseWriter. -type ResponseWriterOption func(*responseWriterOptions) - -// ResponseWriterWithCreateOutDirIfNotExists returns a new ResponseWriterOption that creates -// the directory if it does not exist. -func ResponseWriterWithCreateOutDirIfNotExists() ResponseWriterOption { - return func(responseWriterOptions *responseWriterOptions) { - responseWriterOptions.createOutDirIfNotExists = true - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/response_writer.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/response_writer.go deleted file mode 100644 index 86b25aef57..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/response_writer.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appprotoos - -import ( - "context" - "fmt" - "os" - "path/filepath" - "sync" - - "github.com/bufbuild/buf/private/pkg/app/appproto" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagearchive" - "github.com/bufbuild/buf/private/pkg/storage/storagemem" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -// Constants used to create .jar files. -var ( - manifestPath = normalpath.Join("META-INF", "MANIFEST.MF") - manifestContent = []byte(`Manifest-Version: 1.0 -Created-By: 1.6.0 (protoc) - -`) -) - -type responseWriter struct { - logger *zap.Logger - storageosProvider storageos.Provider - responseWriter appproto.ResponseWriter - // If set, create directories if they don't already exist. - createOutDirIfNotExists bool - // Cache the readWriteBuckets by their respective output paths. - // These builders are transformed to storage.ReadBuckets and written - // to disk once the responseWriter is flushed. - // - // Note that output paths are used as-is with respect to the - // caller's configuration. It's possible that a single invocation - // will specify the same filepath in multiple ways, e.g. "." and - // "$(pwd)". However, we intentionally treat these as distinct paths - // to mirror protoc's insertion point behavior. - // - // For example, the following command will fail because protoc treats - // "." and "$(pwd)" as distinct paths: - // - // $ protoc example.proto --insertion-point-receiver_out=. --insertion-point-writer_out=$(pwd) - // - readWriteBuckets map[string]storage.ReadWriteBucket - // Cache the functions used to flush all of the responses to disk. - // This holds all of the buckets in-memory so that we only write - // the results to disk if all of the responses are successful. - closers []func() error - lock sync.RWMutex -} - -func newResponseWriter( - logger *zap.Logger, - storageosProvider storageos.Provider, - options ...ResponseWriterOption, -) *responseWriter { - responseWriterOptions := newResponseWriterOptions() - for _, option := range options { - option(responseWriterOptions) - } - return &responseWriter{ - logger: logger, - storageosProvider: storageosProvider, - responseWriter: appproto.NewResponseWriter(logger), - createOutDirIfNotExists: responseWriterOptions.createOutDirIfNotExists, - readWriteBuckets: make(map[string]storage.ReadWriteBucket), - } -} - -func (w *responseWriter) AddResponse( - ctx context.Context, - response *pluginpb.CodeGeneratorResponse, - pluginOut string, -) error { - // It's important that we get a consistent output path - // so that we use the same in-memory bucket for paths - // set to the same directory. - // - // filepath.Abs calls filepath.Clean. - // - // For example: - // - // --insertion-point-receiver_out=insertion --insertion-point-writer_out=./insertion/ --insertion-point_writer_out=/foo/insertion - absPluginOut, err := filepath.Abs(normalpath.Unnormalize(pluginOut)) - if err != nil { - return err - } - w.lock.Lock() - defer w.lock.Unlock() - return w.addResponse( - ctx, - response, - absPluginOut, - w.createOutDirIfNotExists, - ) -} - -func (w *responseWriter) Close() error { - w.lock.Lock() - defer w.lock.Unlock() - for _, closeFunc := range w.closers { - if err := closeFunc(); err != nil { - // Although unlikely, if an error happens here, - // some generated files could be written to disk, - // whereas others aren't. - // - // Regardless, we stop at the first error so that - // we don't unncessarily write more results. - return err - } - } - // Re-initialize the cached values to be safe. - w.readWriteBuckets = make(map[string]storage.ReadWriteBucket) - w.closers = nil - return nil -} - -func (w *responseWriter) addResponse( - ctx context.Context, - response *pluginpb.CodeGeneratorResponse, - pluginOut string, - createOutDirIfNotExists bool, -) error { - switch filepath.Ext(pluginOut) { - case ".jar": - return w.writeZip( - ctx, - response, - pluginOut, - true, - createOutDirIfNotExists, - ) - case ".zip": - return w.writeZip( - ctx, - response, - pluginOut, - false, - createOutDirIfNotExists, - ) - default: - return w.writeDirectory( - ctx, - response, - pluginOut, - createOutDirIfNotExists, - ) - } -} - -func (w *responseWriter) writeZip( - ctx context.Context, - response *pluginpb.CodeGeneratorResponse, - outFilePath string, - includeManifest bool, - createOutDirIfNotExists bool, -) (retErr error) { - outDirPath := filepath.Dir(outFilePath) - if readWriteBucket, ok := w.readWriteBuckets[outFilePath]; ok { - // We already have a readWriteBucket for this outFilePath, so - // we can write to the same bucket. - if err := w.responseWriter.WriteResponse( - ctx, - readWriteBucket, - response, - appproto.WriteResponseWithInsertionPointReadBucket(readWriteBucket), - ); err != nil { - return err - } - return nil - } - // OK to use os.Stat instead of os.Lstat here. - fileInfo, err := os.Stat(outDirPath) - if err != nil { - if os.IsNotExist(err) { - if createOutDirIfNotExists { - if err := os.MkdirAll(outDirPath, 0755); err != nil { - return err - } - } else { - return err - } - } - return err - } else if !fileInfo.IsDir() { - return fmt.Errorf("not a directory: %s", outDirPath) - } - readWriteBucket := storagemem.NewReadWriteBucket() - if includeManifest { - if err := storage.PutPath(ctx, readWriteBucket, manifestPath, manifestContent); err != nil { - return err - } - } - if err := w.responseWriter.WriteResponse( - ctx, - readWriteBucket, - response, - appproto.WriteResponseWithInsertionPointReadBucket(readWriteBucket), - ); err != nil { - return err - } - // Add this readWriteBucket to the set so that other plugins - // can write to the same files (re: insertion points). - w.readWriteBuckets[outFilePath] = readWriteBucket - w.closers = append(w.closers, func() (retErr error) { - // We're done writing all of the content into this - // readWriteBucket, so we zip it when we flush. - file, err := os.Create(outFilePath) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, file.Close()) - }() - // protoc does not compress. - return storagearchive.Zip(ctx, readWriteBucket, file, false) - }) - return nil -} - -func (w *responseWriter) writeDirectory( - ctx context.Context, - response *pluginpb.CodeGeneratorResponse, - outDirPath string, - createOutDirIfNotExists bool, -) error { - if readWriteBucket, ok := w.readWriteBuckets[outDirPath]; ok { - // We already have a readWriteBucket for this outDirPath, so - // we can write to the same bucket. - if err := w.responseWriter.WriteResponse( - ctx, - readWriteBucket, - response, - appproto.WriteResponseWithInsertionPointReadBucket(readWriteBucket), - ); err != nil { - return err - } - return nil - } - readWriteBucket := storagemem.NewReadWriteBucket() - if err := w.responseWriter.WriteResponse( - ctx, - readWriteBucket, - response, - appproto.WriteResponseWithInsertionPointReadBucket(readWriteBucket), - ); err != nil { - return err - } - // Add this readWriteBucket to the set so that other plugins - // can write to the same files (re: insertion points). - w.readWriteBuckets[outDirPath] = readWriteBucket - w.closers = append(w.closers, func() error { - if createOutDirIfNotExists { - if err := os.MkdirAll(outDirPath, 0755); err != nil { - return err - } - } - // This checks that the directory exists. - osReadWriteBucket, err := w.storageosProvider.NewReadWriteBucket( - outDirPath, - storageos.ReadWriteBucketWithSymlinksIfSupported(), - ) - if err != nil { - return err - } - if _, err := storage.Copy(ctx, readWriteBucket, osReadWriteBucket); err != nil { - return err - } - return nil - }) - return nil -} - -type responseWriterOptions struct { - createOutDirIfNotExists bool -} - -func newResponseWriterOptions() *responseWriterOptions { - return &responseWriterOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/usage.gen.go deleted file mode 100644 index 1d20f233e5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/appprotoos/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appprotoos - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/generator.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/generator.go deleted file mode 100644 index 8e569ed28d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/generator.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appproto - -import ( - "context" - "errors" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "github.com/bufbuild/buf/private/pkg/thread" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -type generator struct { - logger *zap.Logger - handler Handler -} - -func newGenerator( - logger *zap.Logger, - handler Handler, -) *generator { - return &generator{ - logger: logger, - handler: handler, - } -} - -func (g *generator) Generate( - ctx context.Context, - container app.EnvStderrContainer, - requests []*pluginpb.CodeGeneratorRequest, -) (*pluginpb.CodeGeneratorResponse, error) { - responseBuilder := newResponseBuilder(container) - jobs := make([]func(context.Context) error, len(requests)) - for i, request := range requests { - request := request - jobs[i] = func(ctx context.Context) error { - if err := protodescriptor.ValidateCodeGeneratorRequest(request); err != nil { - return err - } - return g.handler.Handle(ctx, container, responseBuilder, request) - } - } - ctx, cancel := context.WithCancel(ctx) - defer cancel() - if err := thread.Parallelize(ctx, jobs, thread.ParallelizeWithCancel(cancel)); err != nil { - return nil, err - } - response := responseBuilder.toResponse() - if err := protodescriptor.ValidateCodeGeneratorResponse(response); err != nil { - return nil, err - } - if errString := response.GetError(); errString != "" { - return nil, errors.New(errString) - } - return response, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_builder.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_builder.go deleted file mode 100644 index 7aec152e73..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_builder.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appproto - -import ( - "errors" - "fmt" - "strings" - "sync" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/normalpath" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/pluginpb" -) - -type responseBuilder struct { - container app.StderrContainer - fileNames map[string]struct{} - files []*pluginpb.CodeGeneratorResponse_File - errorMessages []string - featureProto3Optional bool - lock sync.RWMutex -} - -func newResponseBuilder(container app.StderrContainer) *responseBuilder { - return &responseBuilder{ - container: container, - fileNames: make(map[string]struct{}), - } -} - -func (r *responseBuilder) AddFile(file *pluginpb.CodeGeneratorResponse_File) error { - r.lock.Lock() - defer r.lock.Unlock() - if file == nil { - return errors.New("add CodeGeneratorResponse.File is nil") - } - name := file.GetName() - if name == "" { - return errors.New("add CodeGeneratorResponse.File.Name is empty") - } - // name must be relative, to-slashed, and not contain "." or ".." per the documentation - // this is what normalize does - normalizedName, err := normalpath.NormalizeAndValidate(name) - if err != nil { - // we need names to be normalized for the appproto.Generator to properly put them in buckets - // so we have to error here if it is not validated - return newUnvalidatedNameError(name) - } - if normalizedName != name { - if err := r.warnUnnormalizedName(name); err != nil { - return err - } - // we need names to be normalized for the appproto.Generator to properly put - // them in buckets, so we will coerce this into a normalized name if it is - // validated, ie if it does not container ".." and is absolute, we can still - // continue, assuming we validate here - name = normalizedName - file.Name = proto.String(name) - } - if r.isDuplicate(file) { - if err := r.warnDuplicateName(name); err != nil { - return err - } - } else { - // we drop the file if it is duplicated, and only put in the map and files slice - // if it does not exist - r.fileNames[name] = struct{}{} - r.files = append(r.files, file) - } - return nil -} - -func (r *responseBuilder) AddError(message string) { - r.lock.Lock() - defer r.lock.Unlock() - if message == "" { - // default to an error message to make sure we pass an error - // if this function was called - message = "error" - } - r.errorMessages = append(r.errorMessages, message) -} - -func (r *responseBuilder) SetFeatureProto3Optional() { - r.lock.Lock() - defer r.lock.Unlock() - r.featureProto3Optional = true -} - -// toResponse turns the response writer into a Protobuf CodeGeneratorResponse. -// It should be run after all writing to the response has finished. -func (r *responseBuilder) toResponse() *pluginpb.CodeGeneratorResponse { - r.lock.RLock() - defer r.lock.RUnlock() - response := &pluginpb.CodeGeneratorResponse{ - File: r.files, - } - if len(r.errorMessages) > 0 { - response.Error = proto.String(strings.Join(r.errorMessages, "\n")) - } - if r.featureProto3Optional { - response.SupportedFeatures = proto.Uint64(uint64(pluginpb.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)) - } - return response -} - -// isDuplicate determines if the given file is a duplicate file. -// Insertion points are intentionally ignored because they must -// always reference duplicate files in order to take effect. -// -// Note that we do not acquire the lock here because this helper -// is only called within the context of r.AddFile. -func (r *responseBuilder) isDuplicate(file *pluginpb.CodeGeneratorResponse_File) bool { - if file.GetInsertionPoint() != "" { - return false - } - _, ok := r.fileNames[file.GetName()] - return ok -} - -func (r *responseBuilder) warnUnnormalizedName(name string) error { - _, err := r.container.Stderr().Write([]byte(fmt.Sprintf( - `Warning: Generated file name %q does not conform to the Protobuf generation specification. Note that the file name must be relative, use "/" instead of "\", and not use "." or ".." as part of the file name. Buf will continue without error here, but please raise an issue with the maintainer of the plugin and reference https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L122 -`, - name, - ))) - return err -} - -func (r *responseBuilder) warnDuplicateName(name string) error { - _, err := r.container.Stderr().Write([]byte(fmt.Sprintf( - `Warning: Duplicate generated file name %q. Buf will continue without error here and drop the second occurrence of this file, but please raise an issue with the maintainer of the plugin. -`, - name, - ))) - return err -} - -func newUnvalidatedNameError(name string) error { - return fmt.Errorf( - `Generated file name %q does not conform to the Protobuf generation specification. Note that the file name must be relative, and not use "..". Please raise an issue with the maintainer of the plugin and reference https://github.com/protocolbuffers/protobuf/blob/95e6c5b4746dd7474d540ce4fb375e3f79a086f8/src/google/protobuf/compiler/plugin.proto#L122 -`, - name, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_writer.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_writer.go deleted file mode 100644 index 72a3aa04d1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/response_writer.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appproto - -import ( - "bufio" - "bytes" - "context" - "io" - - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" - "go.uber.org/zap" - "google.golang.org/protobuf/types/pluginpb" -) - -type responseWriter struct { - logger *zap.Logger -} - -func newResponseWriter( - logger *zap.Logger, -) *responseWriter { - return &responseWriter{ - logger: logger, - } -} - -func (h *responseWriter) WriteResponse( - ctx context.Context, - writeBucket storage.WriteBucket, - response *pluginpb.CodeGeneratorResponse, - options ...WriteResponseOption, -) error { - writeResponseOptions := newWriteResponseOptions() - for _, option := range options { - option(writeResponseOptions) - } - for _, file := range response.File { - if file.GetInsertionPoint() != "" { - if writeResponseOptions.insertionPointReadBucket == nil { - return storage.NewErrNotExist(file.GetName()) - } - if err := applyInsertionPoint(ctx, file, writeResponseOptions.insertionPointReadBucket, writeBucket); err != nil { - return err - } - } else if err := storage.PutPath(ctx, writeBucket, file.GetName(), []byte(file.GetContent())); err != nil { - return err - } - } - return nil -} - -// applyInsertionPoint inserts the content of the given file at the insertion point that it specfiies. -// For more details on insertion points, see the following: -// -// https://github.com/protocolbuffers/protobuf/blob/f5bdd7cd56aa86612e166706ed8ef139db06edf2/src/google/protobuf/compiler/plugin.proto#L135-L171 -func applyInsertionPoint( - ctx context.Context, - file *pluginpb.CodeGeneratorResponse_File, - readBucket storage.ReadBucket, - writeBucket storage.WriteBucket, -) (retErr error) { - targetReadObjectCloser, err := readBucket.Get(ctx, file.GetName()) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, targetReadObjectCloser.Close()) - }() - resultData, err := writeInsertionPoint(ctx, file, targetReadObjectCloser) - if err != nil { - return err - } - // This relies on storageos buckets maintaining existing file permissions - return storage.PutPath(ctx, writeBucket, file.GetName(), resultData) -} - -// writeInsertionPoint writes the insertion point defined in insertionPointFile -// to the targetFile and returns the result as []byte. The caller must ensure the -// provided targetFile matches the file requested in insertionPointFile.Name. -func writeInsertionPoint( - ctx context.Context, - insertionPointFile *pluginpb.CodeGeneratorResponse_File, - targetFile io.Reader, -) (_ []byte, retErr error) { - targetScanner := bufio.NewScanner(targetFile) - match := []byte("@@protoc_insertion_point(" + insertionPointFile.GetInsertionPoint() + ")") - postInsertionContent := bytes.NewBuffer(nil) - postInsertionContent.Grow(averageGeneratedFileSize) - // TODO: We should respect the line endings in the generated file. This would - // require either targetFile being an io.ReadSeeker and in the worst case - // doing 2 full scans of the file (if it is a single line), or implementing - // bufio.Scanner.Scan() inline - newline := []byte{'\n'} - for targetScanner.Scan() { - targetLine := targetScanner.Bytes() - if !bytes.Contains(targetLine, match) { - // these writes cannot fail, they will panic if they cannot - // allocate - _, _ = postInsertionContent.Write(targetLine) - _, _ = postInsertionContent.Write(newline) - continue - } - // For each line in then new content, apply the - // same amount of whitespace. This is important - // for specific languages, e.g. Python. - whitespace := leadingWhitespace(targetLine) - - // Create another scanner so that we can seamlessly handle - // newlines in a platform-agnostic manner. - insertedContentScanner := bufio.NewScanner(bytes.NewBufferString(insertionPointFile.GetContent())) - insertedContent := scanWithPrefixAndLineEnding(insertedContentScanner, whitespace, newline) - // This write cannot fail, it will panic if it cannot - // allocate - _, _ = postInsertionContent.Write(insertedContent) - - // Code inserted at this point is placed immediately - // above the line containing the insertion point, so - // we include it last. - // These writes cannot fail, they will panic if they cannot - // allocate - _, _ = postInsertionContent.Write(targetLine) - _, _ = postInsertionContent.Write(newline) - } - - if err := targetScanner.Err(); err != nil { - return nil, err - } - - // trim the trailing newline - postInsertionBytes := postInsertionContent.Bytes() - return postInsertionBytes[:len(postInsertionBytes)-1], nil -} - -type writeResponseOptions struct { - insertionPointReadBucket storage.ReadBucket -} - -func newWriteResponseOptions() *writeResponseOptions { - return &writeResponseOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/usage.gen.go deleted file mode 100644 index 292fcec9f5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appproto/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appproto - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/appverbose.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/appverbose.go deleted file mode 100644 index bef4c2273d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/appverbose.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appverbose - -import ( - "io" - - "github.com/bufbuild/buf/private/pkg/verbose" -) - -// Container is a container. -type Container interface { - VerbosePrinter() verbose.Printer -} - -// NewContainer returns a new Container. -func NewContainer(verbosePrinter verbose.Printer) Container { - return newContainer(verbosePrinter) -} - -// NewVerbosePrinter returns a new verbose.Printer depending on the value of verboseValue. -func NewVerbosePrinter(writer io.Writer, prefix string, verboseValue bool) verbose.Printer { - if verboseValue { - return verbose.NewWritePrinter(writer, prefix) - } - return verbose.NopPrinter -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/container.go deleted file mode 100644 index 0db3d83890..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/container.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package appverbose - -import "github.com/bufbuild/buf/private/pkg/verbose" - -type container struct { - verbosePrinter verbose.Printer -} - -func newContainer(verbosePrinter verbose.Printer) *container { - return &container{ - verbosePrinter: verbosePrinter, - } -} - -func (c *container) VerbosePrinter() verbose.Printer { - return c.verbosePrinter -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/usage.gen.go deleted file mode 100644 index dfab814d8f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/appverbose/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package appverbose - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/arg_container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/arg_container.go deleted file mode 100644 index 93fb30bd6a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/arg_container.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -type argContainer struct { - values []string -} - -func newArgContainer(s []string) *argContainer { - values := make([]string, len(s)) - copy(values, s) - return &argContainer{ - values: values, - } -} - -func (a *argContainer) NumArgs() int { - return len(a.values) -} - -func (a *argContainer) Arg(i int) string { - return a.values[i] -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/container.go deleted file mode 100644 index 425f917531..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/container.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -type container struct { - EnvContainer - StdinContainer - StdoutContainer - StderrContainer - ArgContainer -} - -func newContainer( - envContainer EnvContainer, - stdinContainer StdinContainer, - stdoutContainer StdoutContainer, - stderrContainer StderrContainer, - argContainer ArgContainer, -) *container { - return &container{ - EnvContainer: envContainer, - StdinContainer: stdinContainer, - StdoutContainer: stdoutContainer, - StderrContainer: stderrContainer, - ArgContainer: argContainer, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/env_container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/env_container.go deleted file mode 100644 index db4f796019..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/env_container.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "errors" - "strings" -) - -type envContainer struct { - variables map[string]string -} - -func newEnvContainer(m map[string]string) *envContainer { - variables := make(map[string]string) - for key, value := range m { - if value != "" { - variables[key] = value - } - } - return &envContainer{ - variables: variables, - } -} - -func newEnvContainerForEnviron(environ []string) (*envContainer, error) { - variables := make(map[string]string, len(environ)) - for _, elem := range environ { - if !strings.ContainsRune(elem, '=') { - // Do not print out as we don't want to mistakenly leak a secure environment variable - return nil, errors.New("environment variable does not contain =") - } - split := strings.SplitN(elem, "=", 2) - if len(split) != 2 { - // Do not print out as we don't want to mistakenly leak a secure environment variable - return nil, errors.New("unknown environment split") - } - if split[1] != "" { - variables[split[0]] = split[1] - } - } - return &envContainer{ - variables: variables, - }, nil -} - -func (e *envContainer) Env(key string) string { - return e.variables[key] -} - -func (e *envContainer) ForEachEnv(f func(string, string)) { - for key, value := range e.variables { - // This should be done anyways but just to make sure - if value != "" { - f(key, value) - } - } -} - -func (e *envContainer) Size() int { - return len(e.variables) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/stderr_container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/stderr_container.go deleted file mode 100644 index e763bd2c0c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/stderr_container.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "io" - - "github.com/bufbuild/buf/private/pkg/ioextended" -) - -type stderrContainer struct { - writer io.Writer -} - -func newStderrContainer(writer io.Writer) *stderrContainer { - if writer == nil { - writer = io.Discard - } - return &stderrContainer{ - writer: ioextended.LockedWriter(writer), - } -} - -func (s *stderrContainer) Stderr() io.Writer { - return s.writer -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/stdin_container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/stdin_container.go deleted file mode 100644 index be05606ba2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/stdin_container.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "io" - - "github.com/bufbuild/buf/private/pkg/ioextended" -) - -type stdinContainer struct { - reader io.Reader -} - -func newStdinContainer(reader io.Reader) *stdinContainer { - if reader == nil { - reader = ioextended.DiscardReader - } - return &stdinContainer{ - reader: reader, - } -} - -func (s *stdinContainer) Stdin() io.Reader { - return s.reader -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/stdout_container.go b/vendor/github.com/bufbuild/buf/private/pkg/app/stdout_container.go deleted file mode 100644 index 69609ebc64..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/stdout_container.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package app - -import ( - "io" - - "github.com/bufbuild/buf/private/pkg/ioextended" -) - -type stdoutContainer struct { - writer io.Writer -} - -func newStdoutContainer(writer io.Writer) *stdoutContainer { - if writer == nil { - writer = io.Discard - } - return &stdoutContainer{ - writer: ioextended.LockedWriter(writer), - } -} - -func (s *stdoutContainer) Stdout() io.Writer { - return s.writer -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/app/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/app/usage.gen.go deleted file mode 100644 index 6139fedf8b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/app/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package app - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/certclient.go b/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/certclient.go deleted file mode 100644 index a534a52215..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/certclient.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package certclient - -import ( - "crypto/tls" - "fmt" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/pkg/app/appname" -) - -// ExternalClientTLSConfig allows users to configure TLS on the client side. -type ExternalClientTLSConfig struct { - Use string `json:"use,omitempty" yaml:"use,omitempty"` - RootCertFilePaths []string `json:"root_cert_file_paths,omitempty" yaml:"root_cert_file_paths,omitempty"` -} - -// IsEmpty returns true if the ExternalClientTLSConfig is empty. -func (e ExternalClientTLSConfig) IsEmpty() bool { - return e.Use == "" && len(e.RootCertFilePaths) == 0 -} - -// NewClientTLSConfig creates a new *tls.Config from the ExternalTLSConfig -// -// The default is to use the system TLS config. -func NewClientTLSConfig( - container appname.Container, - externalClientTLSConfig ExternalClientTLSConfig, -) (*tls.Config, error) { - switch t := strings.ToLower(strings.TrimSpace(externalClientTLSConfig.Use)); t { - case "local": - rootCertFilePaths := externalClientTLSConfig.RootCertFilePaths - if len(rootCertFilePaths) == 0 { - rootCertFilePaths = []string{ - filepath.Join( - container.ConfigDirPath(), - "tls", - "root.pem", - ), - } - } - return NewClientTLSConfigFromRootCertFiles(rootCertFilePaths...) - case "", "system": - return newClientSystemTLSConfig(), nil - case "false": - return nil, nil - default: - return nil, fmt.Errorf("unknown tls.use: %q", t) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/usage.gen.go deleted file mode 100644 index ccb5a2af6f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package certclient - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/util.go b/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/util.go deleted file mode 100644 index 1147aacc76..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/cert/certclient/util.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package certclient - -import ( - "crypto/tls" - "crypto/x509" - "errors" - "os" -) - -// NewClientTLSConfigFromRootCertFiles creates a new tls.Config from a root certificate files. -func NewClientTLSConfigFromRootCertFiles(rootCertFilePaths ...string) (*tls.Config, error) { - rootCertDatas := make([][]byte, len(rootCertFilePaths)) - for i, rootCertFilePath := range rootCertFilePaths { - rootCertData, err := os.ReadFile(rootCertFilePath) - if err != nil { - return nil, err - } - rootCertDatas[i] = rootCertData - } - return newClientTLSConfigFromRootCertDatas(rootCertDatas...) -} - -// newClientTLSConfigFromRootCertDatas creates a new tls.Config from root certificate datas. -func newClientTLSConfigFromRootCertDatas(rootCertDatas ...[]byte) (*tls.Config, error) { - certPool := x509.NewCertPool() - for _, rootCertData := range rootCertDatas { - if !certPool.AppendCertsFromPEM(rootCertData) { - return nil, errors.New("failed to append root certificate") - } - } - return newClientTLSConfigFromRootCertPool(certPool), nil -} - -// newClientTLSConfigFromRootCertPool creates a new tls.Config from a root certificate pool. -func newClientTLSConfigFromRootCertPool(certPool *x509.CertPool) *tls.Config { - return &tls.Config{ - MinVersion: tls.VersionTLS12, - RootCAs: certPool, - } -} - -// newClientSystemTLSConfig creates a new tls.Config that uses the system cert pool for verifying -// server certificates. -func newClientSystemTLSConfig() *tls.Config { - return &tls.Config{ - MinVersion: tls.VersionTLS12, - // An empty TLS config will use the system certificate pool - // when verifying the servers certificate. This is because - // not setting any RootCAs will set `x509.VerifyOptions.Roots` - // to nil, which triggers the loading of system certs (including - // on Windows somehow) within (*x509.Certificate).Verify. - RootCAs: nil, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/command/command.go b/vendor/github.com/bufbuild/buf/private/pkg/command/command.go deleted file mode 100644 index abc06205cd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/command/command.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package command - -import ( - "bytes" - "context" - "io" - - "github.com/bufbuild/buf/private/pkg/app" -) - -// Process represents a background process. -type Process interface { - // Wait blocks to wait for the process to exit. It will attempt to kill the - // process if the passed context expires. - Wait(ctx context.Context) error -} - -// Runner runs external commands. -// -// A Runner will limit the number of concurrent commands, as well as explicitly -// set stdin, stdout, stderr, and env to nil/empty values if not set with options. -// -// All external commands in buf MUST use command.Runner instead of -// exec.Command, exec.CommandContext. -type Runner interface { - // Run runs the external command. It blocks until the command exits. - // - // This should be used instead of exec.CommandContext(...).Run(). - Run(ctx context.Context, name string, options ...RunOption) error - - // Start runs the external command, returning a [Process] handle to track - // its progress. - // - // This should be used instead of exec.Command(...).Start(). - Start(name string, options ...StartOption) (Process, error) -} - -// RunOption is an option for Run. -type RunOption func(*execOptions) - -// RunWithArgs returns a new RunOption that sets the arguments other -// than the name. -// -// The default is no arguments. -func RunWithArgs(args ...string) RunOption { - return func(execOptions *execOptions) { - execOptions.args = args - } -} - -// RunWithEnv returns a new RunOption that sets the environment variables. -// -// The default is to use the single environment variable __EMPTY_ENV__=1 as we -// cannot explicitly set an empty environment with the exec package. -func RunWithEnv(env map[string]string) RunOption { - return func(execOptions *execOptions) { - execOptions.env = env - } -} - -// RunWithStdin returns a new RunOption that sets the stdin. -// -// The default is ioextended.DiscardReader. -func RunWithStdin(stdin io.Reader) RunOption { - return func(execOptions *execOptions) { - execOptions.stdin = stdin - } -} - -// RunWithStdout returns a new RunOption that sets the stdout. -// -// The default is the null device (os.DevNull). -func RunWithStdout(stdout io.Writer) RunOption { - return func(execOptions *execOptions) { - execOptions.stdout = stdout - } -} - -// RunWithStderr returns a new RunOption that sets the stderr. -// -// The default is the null device (os.DevNull). -func RunWithStderr(stderr io.Writer) RunOption { - return func(execOptions *execOptions) { - execOptions.stderr = stderr - } -} - -// RunWithDir returns a new RunOption that sets the working directory. -// -// The default is the current working directory. -func RunWithDir(dir string) RunOption { - return func(execOptions *execOptions) { - execOptions.dir = dir - } -} - -// StartOption is an option for Start. -type StartOption func(*execOptions) - -// StartWithArgs returns a new RunOption that sets the arguments other -// than the name. -// -// The default is no arguments. -func StartWithArgs(args ...string) StartOption { - return func(execOptions *execOptions) { - execOptions.args = args - } -} - -// StartWithEnv returns a new RunOption that sets the environment variables. -// -// The default is to use the single environment variable __EMPTY_ENV__=1 as we -// cannot explicitly set an empty environment with the exec package. -func StartWithEnv(env map[string]string) StartOption { - return func(execOptions *execOptions) { - execOptions.env = env - } -} - -// StartWithStdin returns a new RunOption that sets the stdin. -// -// The default is ioextended.DiscardReader. -func StartWithStdin(stdin io.Reader) StartOption { - return func(execOptions *execOptions) { - execOptions.stdin = stdin - } -} - -// StartWithStdout returns a new RunOption that sets the stdout. -// -// The default is the null device (os.DevNull). -func StartWithStdout(stdout io.Writer) StartOption { - return func(execOptions *execOptions) { - execOptions.stdout = stdout - } -} - -// StartWithStderr returns a new RunOption that sets the stderr. -// -// The default is the null device (os.DevNull). -func StartWithStderr(stderr io.Writer) StartOption { - return func(execOptions *execOptions) { - execOptions.stderr = stderr - } -} - -// StartWithDir returns a new RunOption that sets the working directory. -// -// The default is the current working directory. -func StartWithDir(dir string) StartOption { - return func(execOptions *execOptions) { - execOptions.dir = dir - } -} - -// NewRunner returns a new Runner. -func NewRunner(options ...RunnerOption) Runner { - return newRunner(options...) -} - -// RunnerOption is an option for a new Runner. -type RunnerOption func(*runner) - -// RunnerWithParallelism returns a new Runner that sets the number of -// external commands that can be run concurrently. -// -// The default is thread.Parallelism(). -func RunnerWithParallelism(parallelism int) RunnerOption { - if parallelism < 1 { - parallelism = 1 - } - return func(runner *runner) { - runner.parallelism = parallelism - } -} - -// RunStdout is a convenience function that attaches the container environment, -// stdin, and stderr, and returns the stdout as a byte slice. -func RunStdout( - ctx context.Context, - container app.EnvStdioContainer, - runner Runner, - name string, - args ...string, -) ([]byte, error) { - buffer := bytes.NewBuffer(nil) - if err := runner.Run( - ctx, - name, - RunWithArgs(args...), - RunWithEnv(app.EnvironMap(container)), - RunWithStdin(container.Stdin()), - RunWithStdout(buffer), - RunWithStderr(container.Stderr()), - ); err != nil { - return nil, err - } - return buffer.Bytes(), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/command/process.go b/vendor/github.com/bufbuild/buf/private/pkg/command/process.go deleted file mode 100644 index 352dc5989d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/command/process.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package command - -import ( - "context" - "errors" - "os/exec" - - "go.uber.org/multierr" -) - -var errWaitAlreadyCalled = errors.New("wait already called on process") - -type process struct { - cmd *exec.Cmd - done func() - waitC chan error -} - -// newProcess wraps an *exec.Cmd and monitors it for exiting. -// When the process exits, done will be called. -// -// This implements the Process interface. -// -// The process is expected to have been started by the caller. -func newProcess(cmd *exec.Cmd, done func()) *process { - return &process{ - cmd: cmd, - done: done, - waitC: make(chan error, 1), - } -} - -// Monitor starts monitoring of the *exec.Cmd. -func (p *process) Monitor() { - go func() { - p.waitC <- p.cmd.Wait() - close(p.waitC) - p.done() - }() -} - -// Wait waits for the process to exit. -func (p *process) Wait(ctx context.Context) error { - select { - case err, ok := <-p.waitC: - // Process exited - if ok { - return err - } - return errWaitAlreadyCalled - case <-ctx.Done(): - // Timed out. Send a kill signal and release our handle to it. - return multierr.Combine(ctx.Err(), p.cmd.Process.Kill()) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/command/runner.go b/vendor/github.com/bufbuild/buf/private/pkg/command/runner.go deleted file mode 100644 index 023c17a9c9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/command/runner.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package command - -import ( - "context" - "io" - "os/exec" - "sort" - - "github.com/bufbuild/buf/private/pkg/ioextended" - "github.com/bufbuild/buf/private/pkg/thread" -) - -var emptyEnv = envSlice( - map[string]string{ - "__EMPTY_ENV": "1", - }, -) - -type runner struct { - parallelism int - - semaphoreC chan struct{} -} - -func newRunner(options ...RunnerOption) *runner { - runner := &runner{ - parallelism: thread.Parallelism(), - } - for _, option := range options { - option(runner) - } - runner.semaphoreC = make(chan struct{}, runner.parallelism) - return runner -} - -func (r *runner) Run(ctx context.Context, name string, options ...RunOption) error { - execOptions := newExecOptions() - for _, option := range options { - option(execOptions) - } - cmd := exec.CommandContext(ctx, name, execOptions.args...) - execOptions.ApplyToCmd(cmd) - r.increment() - err := cmd.Run() - r.decrement() - return err -} - -func (r *runner) Start(name string, options ...StartOption) (Process, error) { - execOptions := newExecOptions() - for _, option := range options { - option(execOptions) - } - cmd := exec.Command(name, execOptions.args...) - execOptions.ApplyToCmd(cmd) - r.increment() - if err := cmd.Start(); err != nil { - return nil, err - } - process := newProcess(cmd, r.decrement) - process.Monitor() - return process, nil -} - -func (r *runner) increment() { - r.semaphoreC <- struct{}{} -} - -func (r *runner) decrement() { - <-r.semaphoreC -} - -type execOptions struct { - args []string - env map[string]string - stdin io.Reader - stdout io.Writer - stderr io.Writer - dir string -} - -func newExecOptions() *execOptions { - return &execOptions{} -} - -func (e *execOptions) ApplyToCmd(cmd *exec.Cmd) { - // If the user did not specify env vars, we want to make sure - // the command has access to none, as the default is the current env. - if len(e.env) == 0 { - cmd.Env = emptyEnv - } else { - cmd.Env = envSlice(e.env) - } - // If the user did not specify any stdin, we want to make sure - // the command has access to none, as the default is the default stdin. - if e.stdin == nil { - cmd.Stdin = ioextended.DiscardReader - } else { - cmd.Stdin = e.stdin - } - // If Stdout or Stderr are nil, os/exec connects the process output directly - // to the null device. - cmd.Stdout = e.stdout - cmd.Stderr = e.stderr - // The default behavior for dir is what we want already, i.e. the current - // working directory. - cmd.Dir = e.dir -} - -func envSlice(env map[string]string) []string { - var environ []string - for key, value := range env { - environ = append(environ, key+"="+value) - } - sort.Strings(environ) - return environ -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/command/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/command/usage.gen.go deleted file mode 100644 index afc04680b7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/command/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package command - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/connectclient/connectclient.go b/vendor/github.com/bufbuild/buf/private/pkg/connectclient/connectclient.go deleted file mode 100644 index 1eb2da2e2b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/connectclient/connectclient.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connectclient - -import ( - "github.com/bufbuild/connect-go" -) - -// Config holds configuration for creating Connect RPC clients. -type Config struct { - httpClient connect.HTTPClient - addressMapper func(string) string - interceptors []connect.Interceptor - authInterceptorProvider func(string) connect.UnaryInterceptorFunc -} - -// NewConfig creates a new client configuration with the given HTTP client -// and options. -func NewConfig(httpClient connect.HTTPClient, options ...ConfigOption) *Config { - cfg := &Config{ - httpClient: httpClient, - } - for _, opt := range options { - opt(cfg) - } - return cfg -} - -// ConfigOption is an option for customizing a new Config. -type ConfigOption func(*Config) - -// WithAddressMapper maps the address with the given function. -func WithAddressMapper(addressMapper func(string) string) ConfigOption { - return func(cfg *Config) { - cfg.addressMapper = addressMapper - } -} - -// WithInterceptors adds the slice of interceptors to all clients returned from this provider. -func WithInterceptors(interceptors []connect.Interceptor) ConfigOption { - return func(cfg *Config) { - cfg.interceptors = interceptors - } -} - -// WithAuthInterceptorProvider configures a provider that, when invoked, returns an interceptor that can be added -// to a client for setting the auth token -func WithAuthInterceptorProvider(authInterceptorProvider func(string) connect.UnaryInterceptorFunc) ConfigOption { - return func(cfg *Config) { - cfg.authInterceptorProvider = authInterceptorProvider - } -} - -// StubFactory is the type of a generated factory function, for creating Connect client stubs. -type StubFactory[T any] func(connect.HTTPClient, string, ...connect.ClientOption) T - -// Make uses the given generated factory function to create a new connect client. -func Make[T any](cfg *Config, address string, factory StubFactory[T]) T { - interceptors := append([]connect.Interceptor{}, cfg.interceptors...) - if cfg.authInterceptorProvider != nil { - interceptor := cfg.authInterceptorProvider(address) - interceptors = append(interceptors, interceptor) - } - if cfg.addressMapper != nil { - address = cfg.addressMapper(address) - } - return factory(cfg.httpClient, address, connect.WithInterceptors(interceptors...)) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/connectclient/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/connectclient/usage.gen.go deleted file mode 100644 index afeaa42280..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/connectclient/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package connectclient - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/dag/dag.go b/vendor/github.com/bufbuild/buf/private/pkg/dag/dag.go deleted file mode 100644 index b0a4777010..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/dag/dag.go +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dag - -import ( - "bytes" - "errors" - "fmt" - "strings" -) - -// Largely adopted from https://github.com/stevenle/topsort, with modifications. -// -// Copyright 2013 Steven Le. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// See https://github.com/stevenle/topsort/blob/master/LICENSE. - -// CycleError is an error if the Graph had a cycle. -type CycleError[Key comparable] struct { - Keys []Key -} - -// Error implements error. -func (c *CycleError[Key]) Error() string { - strs := make([]string, len(c.Keys)) - for i, key := range c.Keys { - strs[i] = fmt.Sprintf("%v", key) - } - return fmt.Sprintf("cycle error: %s", strings.Join(strs, " -> ")) -} - -// Graph is a directed acyclic graph structure with comparable keys. -type Graph[Key comparable] struct { - keyToNode map[Key]*node[Key] - // need to store order so that we can create a deterministic CycleError - // in the case of Walk where we have no source nodes, so that we can Walk - // deterministically and find the cycle. - keys []Key -} - -// NewGraph returns a new Graph. -// -// Graphs can also safely be instantiated with &Graph{}. -func NewGraph[Key comparable]() *Graph[Key] { - graph := &Graph[Key]{} - graph.init() - return graph -} - -// AddNode adds a node. -func (g *Graph[Key]) AddNode(key Key) { - g.init() - g.getOrAddNode(key) -} - -// AddEdge adds an edge. -func (g *Graph[Key]) AddEdge(from Key, to Key) { - g.init() - fromNode := g.getOrAddNode(from) - toNode := g.getOrAddNode(to) - fromNode.addOutboundEdge(to) - toNode.addInboundEdge(from) -} - -// ContainsNode returns true if the graph contains the given node. -func (g *Graph[Key]) ContainsNode(key Key) bool { - g.init() - _, ok := g.keyToNode[key] - return ok -} - -// NumNodes returns the number of nodes in the graph. -func (g *Graph[Key]) NumNodes() int { - g.init() - return len(g.keys) -} - -// NumNodes returns the number of edges in the graph. -func (g *Graph[Key]) NumEdges() int { - g.init() - var numEdges int - for _, node := range g.keyToNode { - numEdges += len(node.outboundEdges) - } - return numEdges -} - -// WalkNodes visited each node in the Graph based on insertion order. -// -// f is called for each node. The first argument is the key for the node, -// the second argument is all inbound edges, the third argument -// is all outbound edges. -func (g *Graph[Key]) WalkNodes(f func(Key, []Key, []Key) error) error { - g.init() - for _, key := range g.keys { - node, ok := g.keyToNode[key] - if !ok { - return fmt.Errorf("key not present: %v", key) - } - inboundEdges := make([]Key, len(node.inboundEdges)) - copy(inboundEdges, node.inboundEdges) - outboundEdges := make([]Key, len(node.outboundEdges)) - copy(outboundEdges, node.outboundEdges) - if err := f(key, inboundEdges, outboundEdges); err != nil { - return err - } - } - return nil -} - -// WalkEdges visits each edge in the Graph starting at the source keys. -// -// f is called for each directed edge. The first argument is the source -// node, the second is the destination node. -// -// Returns a *CycleError if there is a cycle in the graph. -func (g *Graph[Key]) WalkEdges(f func(Key, Key) error) error { - g.init() - if g.NumEdges() == 0 { - // No edges, do not walk. - return nil - } - sourceKeys, err := g.getSourceKeys() - if err != nil { - return err - } - switch len(sourceKeys) { - case 0: - // If we have no source nodes, we have a cycle in the graph. To print the cycle, - // we walk starting at all keys We will hit a cycle in this process, however just to check our - // assumptions, we also verify the the walk returns a CycleError, and if not, - // return a system error. - allVisited := make(map[Key]struct{}) - for _, key := range g.keys { - if err := g.edgeVisit( - key, - func(Key, Key) error { return nil }, - newOrderedSet[Key](), - allVisited, - ); err != nil { - return err - } - } - return errors.New("graph had cycle based on source node count being zero, but this was not detected during edge walking") - case 1: - return g.edgeVisit( - sourceKeys[0], - f, - newOrderedSet[Key](), - make(map[Key]struct{}), - ) - default: - allVisited := make(map[Key]struct{}) - for _, key := range sourceKeys { - if err := g.edgeVisit( - key, - f, - newOrderedSet[Key](), - allVisited, - ); err != nil { - return err - } - } - return nil - } -} - -// TopoSort topologically sorts the nodes in the Graph starting at the given key. -// -// Returns a *CycleError if there is a cycle in the graph. -func (g *Graph[Key]) TopoSort(start Key) ([]Key, error) { - g.init() - results := newOrderedSet[Key]() - if err := g.topoVisit(start, results, newOrderedSet[Key]()); err != nil { - return nil, err - } - return results.keys, nil -} - -// DOTString returns a DOT representation of the graph. -// -// keyToString is used to print out the label for each node. -// https://graphviz.org/doc/info/lang.html -func (g *Graph[Key]) DOTString(keyToString func(Key) string) (string, error) { - keyToIndex := make(map[Key]int) - nextIndex := 1 - var nodeStrings []string - var edgeStrings []string - if err := g.WalkEdges( - func(from Key, to Key) error { - fromIndex, ok := keyToIndex[from] - if !ok { - fromIndex = nextIndex - nextIndex++ - keyToIndex[from] = fromIndex - nodeStrings = append( - nodeStrings, - fmt.Sprintf("%d [label=%q]", fromIndex, keyToString(from)), - ) - } - toIndex, ok := keyToIndex[to] - if !ok { - toIndex = nextIndex - nextIndex++ - keyToIndex[to] = toIndex - nodeStrings = append( - nodeStrings, - fmt.Sprintf("%d [label=%q]", toIndex, keyToString(to)), - ) - } - edgeStrings = append( - edgeStrings, - fmt.Sprintf("%d -> %d", fromIndex, toIndex), - ) - return nil - }, - ); err != nil { - return "", err - } - // We also want to pick up any nodes that do not have edges, and display them. - if err := g.WalkNodes( - func(key Key, inboundEdges []Key, outboundEdges []Key) error { - if _, ok := keyToIndex[key]; ok { - return nil - } - if len(inboundEdges) == 0 && len(outboundEdges) == 0 { - nodeStrings = append( - nodeStrings, - fmt.Sprintf("%d [label=%q]", nextIndex, keyToString(key)), - ) - edgeStrings = append( - edgeStrings, - fmt.Sprintf("%d", nextIndex), - ) - nextIndex++ - return nil - } - // This is a system error. - return fmt.Errorf("got node %v with %d inbound edges and %d outbound edges, but this was not processed during WalkEdges", key, len(inboundEdges), len(outboundEdges)) - }, - ); err != nil { - return "", err - } - if len(nodeStrings) == 0 { - return "digraph {}", nil - } - buffer := bytes.NewBuffer(nil) - _, _ = buffer.WriteString("digraph {\n\n") - for _, nodeString := range nodeStrings { - _, _ = buffer.WriteString(" ") - _, _ = buffer.WriteString(nodeString) - _, _ = buffer.WriteString("\n") - } - _, _ = buffer.WriteString("\n") - for _, edgeString := range edgeStrings { - _, _ = buffer.WriteString(" ") - _, _ = buffer.WriteString(edgeString) - _, _ = buffer.WriteString("\n") - } - _, _ = buffer.WriteString("\n}") - return buffer.String(), nil -} - -func (g *Graph[Key]) init() { - if g.keyToNode == nil { - g.keyToNode = make(map[Key]*node[Key]) - } -} - -func (g *Graph[Key]) getOrAddNode(key Key) *node[Key] { - node, ok := g.keyToNode[key] - if !ok { - node = newNode[Key]() - g.keyToNode[key] = node - g.keys = append(g.keys, key) - } - return node -} - -func (g *Graph[Key]) getSourceKeys() ([]Key, error) { - var sourceKeys []Key - // need to get in deterministic order - for _, key := range g.keys { - node, ok := g.keyToNode[key] - if !ok { - return nil, fmt.Errorf("key not present in keyToNode: %v", key) - } - if len(node.inboundEdgeMap) == 0 { - sourceKeys = append(sourceKeys, key) - } - } - return sourceKeys, nil -} - -func (g *Graph[Key]) edgeVisit( - from Key, - f func(Key, Key) error, - thisSourceVisited *orderedSet[Key], - allSourcesVisited map[Key]struct{}, -) error { - // this is based on this source. we want to make sure we don't - // have any cycles based on starting at a single source. - if !thisSourceVisited.add(from) { - index := thisSourceVisited.index(from) - cycle := append(thisSourceVisited.keys[index:], from) - return &CycleError[Key]{Keys: cycle} - } - // If we visited this from all edge visiting from other - // sources, do nothing, we've evaluated all cycles and visited this - // node properly. It's OK to return here, as we've already checked - // for cycles with thisSourceVisited. - if _, ok := allSourcesVisited[from]; ok { - return nil - } - // Add to the map. We'll be needing this for future iterations. - allSourcesVisited[from] = struct{}{} - - fromNode, ok := g.keyToNode[from] - if !ok { - return fmt.Errorf("key not present: %v", from) - } - for _, to := range fromNode.outboundEdges { - if err := f(from, to); err != nil { - return err - } - if err := g.edgeVisit(to, f, thisSourceVisited.copy(), allSourcesVisited); err != nil { - return err - } - } - - return nil -} - -func (g *Graph[Key]) topoVisit( - from Key, - results *orderedSet[Key], - visited *orderedSet[Key], -) error { - if !visited.add(from) { - index := visited.index(from) - cycle := append(visited.keys[index:], from) - return &CycleError[Key]{Keys: cycle} - } - - fromNode, ok := g.keyToNode[from] - if !ok { - return fmt.Errorf("key not present: %v", from) - } - for _, to := range fromNode.outboundEdges { - if err := g.topoVisit(to, results, visited.copy()); err != nil { - return err - } - } - - results.add(from) - return nil -} - -type node[Key comparable] struct { - outboundEdgeMap map[Key]struct{} - // need to store order for deterministic visits - outboundEdges []Key - inboundEdgeMap map[Key]struct{} - // need to store order for deterministic visits - inboundEdges []Key -} - -func newNode[Key comparable]() *node[Key] { - return &node[Key]{ - outboundEdgeMap: make(map[Key]struct{}), - inboundEdgeMap: make(map[Key]struct{}), - } -} - -func (n *node[Key]) addOutboundEdge(key Key) { - if _, ok := n.outboundEdgeMap[key]; !ok { - n.outboundEdgeMap[key] = struct{}{} - n.outboundEdges = append(n.outboundEdges, key) - } -} - -func (n *node[Key]) addInboundEdge(key Key) { - if _, ok := n.inboundEdgeMap[key]; !ok { - n.inboundEdgeMap[key] = struct{}{} - n.inboundEdges = append(n.inboundEdges, key) - } -} - -type orderedSet[Key comparable] struct { - keyToIndex map[Key]int - keys []Key - length int -} - -func newOrderedSet[Key comparable]() *orderedSet[Key] { - return &orderedSet[Key]{ - keyToIndex: make(map[Key]int), - } -} - -// returns false if already added -func (s *orderedSet[Key]) add(key Key) bool { - if _, ok := s.keyToIndex[key]; !ok { - s.keyToIndex[key] = s.length - s.keys = append(s.keys, key) - s.length++ - return true - } - return false -} - -func (s *orderedSet[Key]) copy() *orderedSet[Key] { - clone := newOrderedSet[Key]() - for _, item := range s.keys { - clone.add(item) - } - return clone -} - -func (s *orderedSet[Key]) index(item Key) int { - index, ok := s.keyToIndex[item] - if ok { - return index - } - return -1 -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/dag/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/dag/usage.gen.go deleted file mode 100644 index f90329fe81..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/dag/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package dag - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/diff/diff.go b/vendor/github.com/bufbuild/buf/private/pkg/diff/diff.go deleted file mode 100644 index ba1d1d171c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/diff/diff.go +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package diff implements diffing. -// -// Should primarily be used for testing. -package diff - -// Largely copied from https://github.com/golang/go/blob/master/src/cmd/gofmt/gofmt.go -// -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// https://github.com/golang/go/blob/master/LICENSE - -import ( - "bytes" - "context" - "fmt" - "os" - "path/filepath" - "runtime" - - "github.com/bufbuild/buf/private/pkg/command" -) - -// Diff does a diff. -// -// Returns nil if no diff. -func Diff( - ctx context.Context, - runner command.Runner, - b1 []byte, - b2 []byte, - filename1 string, - filename2 string, - options ...DiffOption, -) ([]byte, error) { - diffOptions := newDiffOptions() - for _, option := range options { - option(diffOptions) - } - return doDiff( - ctx, - runner, - b1, - b2, - filename1, - filename2, - diffOptions.suppressCommands, - diffOptions.suppressTimestamps, - ) -} - -// DiffOption is an option for Diff. -type DiffOption func(*diffOptions) - -// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of commands. -func DiffWithSuppressCommands() DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.suppressCommands = true - } -} - -// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of timestamps. -func DiffWithSuppressTimestamps() DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.suppressTimestamps = true - } -} - -func doDiff( - ctx context.Context, - runner command.Runner, - b1 []byte, - b2 []byte, - filename1 string, - filename2 string, - suppressCommands bool, - suppressTimestamps bool, -) ([]byte, error) { - if bytes.Equal(b1, b2) { - return nil, nil - } - - f1, err := writeTempFile("", "", b1) - if err != nil { - return nil, err - } - defer func() { - _ = os.Remove(f1) - }() - - f2, err := writeTempFile("", "", b2) - if err != nil { - return nil, err - } - defer func() { - _ = os.Remove(f2) - }() - - binaryPath := "diff" - if runtime.GOOS == "plan9" { - binaryPath = "/bin/ape/diff" - } - - buffer := bytes.NewBuffer(nil) - err = runner.Run( - ctx, - binaryPath, - command.RunWithArgs("-u", f1, f2), - command.RunWithStdout(buffer), - command.RunWithStderr(buffer), - ) - data := buffer.Bytes() - if len(data) > 0 { - // diff exits with a non-zero status when the files don't match. - // Ignore that failure as long as we get output. - return tryModifyHeader(data, filename1, filename2, suppressCommands, suppressTimestamps), nil - } - return nil, err -} - -func writeTempFile(dir string, prefix string, data []byte) (string, error) { - file, err := os.CreateTemp(dir, prefix) - if err != nil { - return "", err - } - if len(data) > 0 { - _, err = file.Write(data) - } - if err1 := file.Close(); err == nil { - err = err1 - } - if err != nil { - _ = os.Remove(file.Name()) - return "", err - } - return file.Name(), nil -} - -func tryModifyHeader( - diff []byte, - filename1 string, - filename2 string, - suppressCommands bool, - suppressTimestamps bool, -) []byte { - bs := bytes.SplitN(diff, []byte{'\n'}, 3) - if len(bs) < 3 { - return diff - } - // Preserve timestamps. - var t0, t1 []byte - if !suppressTimestamps { - if i := bytes.LastIndexByte(bs[0], '\t'); i != -1 { - t0 = bs[0][i:] - } - if i := bytes.LastIndexByte(bs[1], '\t'); i != -1 { - t1 = bs[1][i:] - } - } - // Always print filepath with slash separator. - filename1 = filepath.ToSlash(filename1) - filename2 = filepath.ToSlash(filename2) - if filename1 == filename2 { - filename1 = filename1 + ".orig" - } - bs[0] = []byte(fmt.Sprintf("--- %s%s", filename1, t0)) - bs[1] = []byte(fmt.Sprintf("+++ %s%s", filename2, t1)) - if !suppressCommands { - bs = append( - [][]byte{ - []byte(fmt.Sprintf("diff -u %s %s", filename1, filename2)), - }, - bs..., - ) - } - return bytes.Join(bs, []byte{'\n'}) -} - -type diffOptions struct { - suppressCommands bool - suppressTimestamps bool -} - -func newDiffOptions() *diffOptions { - return &diffOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/diff/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/diff/usage.gen.go deleted file mode 100644 index bf3af12163..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/diff/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package diff - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/encoding/encoding.go b/vendor/github.com/bufbuild/buf/private/pkg/encoding/encoding.go deleted file mode 100644 index c09a8368c2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/encoding/encoding.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package encoding provides encoding utilities. -package encoding - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "strings" - - "go.uber.org/multierr" - "gopkg.in/yaml.v3" -) - -// UnmarshalJSONStrict unmarshals the data as JSON, returning a user error on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalJSONStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - jsonDecoder := json.NewDecoder(bytes.NewReader(data)) - jsonDecoder.DisallowUnknownFields() - if err := jsonDecoder.Decode(v); err != nil { - return fmt.Errorf("could not unmarshal as JSON: %v", err) - } - return nil -} - -// UnmarshalYAMLStrict unmarshals the data as YAML, returning a user error on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalYAMLStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - yamlDecoder := NewYAMLDecoderStrict(bytes.NewReader(data)) - if err := yamlDecoder.Decode(v); err != nil { - return fmt.Errorf("could not unmarshal as YAML: %v", err) - } - return nil -} - -// UnmarshalJSONOrYAMLStrict unmarshals the data as JSON or YAML in order, returning -// a user error with both errors on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalJSONOrYAMLStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - if jsonErr := UnmarshalJSONStrict(data, v); jsonErr != nil { - if yamlErr := UnmarshalYAMLStrict(data, v); yamlErr != nil { - return errors.New(jsonErr.Error() + "\n" + yamlErr.Error()) - } - } - return nil -} - -// UnmarshalJSONNonStrict unmarshals the data as JSON, returning a user error on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalJSONNonStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - jsonDecoder := json.NewDecoder(bytes.NewReader(data)) - if err := jsonDecoder.Decode(v); err != nil { - return fmt.Errorf("could not unmarshal as JSON: %v", err) - } - return nil -} - -// UnmarshalYAMLNonStrict unmarshals the data as YAML, returning a user error on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalYAMLNonStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - yamlDecoder := NewYAMLDecoderNonStrict(bytes.NewReader(data)) - if err := yamlDecoder.Decode(v); err != nil { - return fmt.Errorf("could not unmarshal as YAML: %v", err) - } - return nil -} - -// UnmarshalJSONOrYAMLNonStrict unmarshals the data as JSON or YAML in order, returning -// a user error with both errors on failure. -// -// If the data length is 0, this is a no-op. -func UnmarshalJSONOrYAMLNonStrict(data []byte, v interface{}) error { - if len(data) == 0 { - return nil - } - if jsonErr := UnmarshalJSONNonStrict(data, v); jsonErr != nil { - if yamlErr := UnmarshalYAMLNonStrict(data, v); yamlErr != nil { - return multierr.Append(jsonErr, yamlErr) - } - } - return nil -} - -// GetJSONStringOrStringValue returns the JSON string for the RawMessage if the -// RawMessage is a string, and the raw value as a string otherwise. -// -// If the RawMessage is empty, this returns "". -func GetJSONStringOrStringValue(rawMessage json.RawMessage) string { - if len(rawMessage) == 0 { - return "" - } - var s string - if err := json.Unmarshal(rawMessage, &s); err == nil { - return s - } - return string(rawMessage) -} - -// MarshalYAML marshals the given value into YAML. -func MarshalYAML(v interface{}) (_ []byte, retErr error) { - buffer := bytes.NewBuffer(nil) - yamlEncoder := NewYAMLEncoder(buffer) - defer func() { - retErr = multierr.Append(retErr, yamlEncoder.Close()) - }() - if err := yamlEncoder.Encode(v); err != nil { - return nil, err - } - return buffer.Bytes(), nil -} - -// NewYAMLEncoder creates a new YAML encoder reader from the Writer. -// The encoder must be closed after use. -func NewYAMLEncoder(writer io.Writer) *yaml.Encoder { - yamlEncoder := yaml.NewEncoder(writer) - yamlEncoder.SetIndent(2) - return yamlEncoder -} - -// NewYAMLDecoderStrict creates a new YAML decoder from the reader. -func NewYAMLDecoderStrict(reader io.Reader) *yaml.Decoder { - yamlDecoder := yaml.NewDecoder(reader) - yamlDecoder.KnownFields(true) - return yamlDecoder -} - -// NewYAMLDecoderNonStrict creates a new YAML decoder from the reader. -func NewYAMLDecoderNonStrict(reader io.Reader) *yaml.Decoder { - return yaml.NewDecoder(reader) -} - -// InterfaceSliceOrStringToCommaSepString parses the input as a -// slice or string into a comma separated string. This is commonly -// used with JSON or YAML fields that need to support both string slices -// and string literals. -func InterfaceSliceOrStringToCommaSepString(in interface{}) (string, error) { - values, err := InterfaceSliceOrStringToStringSlice(in) - if err != nil { - return "", err - } - return strings.Join(values, ","), nil -} - -func InterfaceSliceOrStringToStringSlice(in interface{}) ([]string, error) { - if in == nil { - return nil, nil - } - switch t := in.(type) { - case string: - return []string{t}, nil - case []interface{}: - if len(t) == 0 { - return nil, nil - } - res := make([]string, len(t)) - for i, elem := range t { - s, ok := elem.(string) - if !ok { - return nil, fmt.Errorf("could not convert element %T to a string", elem) - } - res[i] = s - } - return res, nil - default: - return nil, fmt.Errorf("could not interpret %T as string or string slice", in) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/encoding/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/encoding/usage.gen.go deleted file mode 100644 index edc1d23bda..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/encoding/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package encoding - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/filepathextended.go b/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/filepathextended.go deleted file mode 100644 index 759e79b5db..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/filepathextended.go +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package filepathextended provides filepath utilities. -package filepathextended - -// Walking largely copied from https://github.com/golang/go/blob/master/src/path/filepath/path.go -// -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// https://github.com/golang/go/blob/master/LICENSE - -import ( - "os" - "path/filepath" - "sort" - - "github.com/bufbuild/buf/private/pkg/osextended" - "go.uber.org/multierr" -) - -// RealClean does filepath.Clean and filepath.FromSlash, -// but also handles ..'s in relative paths relative to the -// current working directory. -// -// As an example, if we are in proto, and we pass in -// ../proto/foo, RealClean will return foo. -func RealClean(path string) (string, error) { - path = filepath.Clean(filepath.FromSlash(path)) - if !filepath.IsAbs(path) { - absPath, err := filepath.Abs(path) - if err != nil { - return "", err - } - pwd, err := osextended.Getwd() - if err != nil { - return "", err - } - if relPath, err := filepath.Rel(pwd, absPath); err == nil { - return relPath, nil - } - } - return path, nil -} - -// Walk walks the walkPath. -// -// This is analogous to filepath.Walk, but optionally follows symlinks. -func Walk(walkPath string, walkFunc filepath.WalkFunc, options ...WalkOption) (retErr error) { - defer func() { - // If we end up with a SkipDir, this isn't an error. - if retErr == filepath.SkipDir { - retErr = nil - } - }() - walkOptions := newWalkOptions() - for _, option := range options { - option(walkOptions) - } - // os.Lstat does not follow symlinks, while os.Stat does. - fileInfo, err := os.Lstat(walkPath) - if err != nil { - // If we have an error, then we still walk to call walkFunc with the error. - return walkFunc(walkPath, nil, err) - } - resolvedPath, fileInfo, err := optionallyEvaluateSymlink(walkPath, fileInfo, walkOptions.symlinks) - if err != nil { - // If we have an error, then we still walk to call walkFunc with the error. - return walkFunc(walkPath, nil, err) - } - return walk(walkPath, resolvedPath, fileInfo, walkFunc, make(map[string]struct{}), walkOptions.symlinks) -} - -// WalkOption is an option for Walk. -type WalkOption func(*walkOptions) - -// WalkWithSymlinks returns a WalkOption that results in Walk following symlinks. -func WalkWithSymlinks() WalkOption { - return func(walkOptions *walkOptions) { - walkOptions.symlinks = true - } -} - -// walkPath is the path we give to the WalkFunc -// resolvedPath is the potentially-resolved path that we actually read from. -func walk( - walkPath string, - resolvedPath string, - fileInfo os.FileInfo, - walkFunc filepath.WalkFunc, - resolvedPathMap map[string]struct{}, - symlinks bool, -) error { - if symlinks { - if _, ok := resolvedPathMap[resolvedPath]; ok { - // Do not walk down this path. - // We could later make it optional to error in this case. - return nil - } - resolvedPathMap[resolvedPath] = struct{}{} - } - - // If this is not a directory, just call walkFunc on it and we're done. - if !fileInfo.IsDir() { - return walkFunc(walkPath, fileInfo, nil) - } - - // This is a directory, read it. - subNames, readDirErr := readDirNames(resolvedPath) - walkErr := walkFunc(walkPath, fileInfo, readDirErr) - // If readDirErr != nil, walk can't walk into this directory. - // walkErr != nil means walkFunc want walk to skip this directory or stop walking. - // Therefore, if one of readDirErr and walkErr isn't nil, walk will return. - if readDirErr != nil || walkErr != nil { - // The caller's behavior is controlled by the return value, which is decided - // by walkFunc. walkFunc may ignore readDirErr and return nil. - // If walkFunc returns SkipDir, it will be handled by the caller. - // So walk should return whatever walkFunc returns. - return walkErr - } - - for _, subName := range subNames { - // The path we want to pass to walk is the directory walk path plus the name. - subWalkPath := filepath.Join(walkPath, subName) - // The path we want to actually used is the directory resolved path plus the name. - // This is potentially a symlink-evaluated path. - subResolvedPath := filepath.Join(resolvedPath, subName) - subFileInfo, err := os.Lstat(subResolvedPath) - if err != nil { - // If we have an error, still call walkFunc and match filepath.Walk. - if walkErr := walkFunc(subWalkPath, subFileInfo, err); walkErr != nil && walkErr != filepath.SkipDir { - return walkErr - } - // No error, just continue the for loop. - // Note that filepath.Walk does an else block instead, but we want to match - // the same code as in the symlink if statement below. - continue - } - subResolvedPath, subFileInfo, err = optionallyEvaluateSymlink(subResolvedPath, subFileInfo, symlinks) - if err != nil { - // If we have an error, still call walkFunc and match filepath.Walk. - if walkErr := walkFunc(subWalkPath, subFileInfo, err); walkErr != nil && walkErr != filepath.SkipDir { - return walkErr - } - // No error, just continue the for loop. - continue - } - if err := walk(subWalkPath, subResolvedPath, subFileInfo, walkFunc, resolvedPathMap, symlinks); err != nil { - // If not a directory, return the error. - // Else, if the error is filepath.SkipDir, return the error. - // Else, this is a directory and we have filepath.SkipDir, do not return the error and continue. - if !subFileInfo.IsDir() || err != filepath.SkipDir { - return err - } - } - } - - return nil -} - -// readDirNames reads the directory named by dirname and returns -// a sorted list of directory entries. -// -// We need to use this instead of os.ReadDir because we want to do the os.Lstat ourselves -// separately to completely match filepath.Walk. -func readDirNames(dirPath string) (_ []string, retErr error) { - file, err := os.Open(dirPath) - if err != nil { - return nil, err - } - defer func() { - retErr = multierr.Append(retErr, file.Close()) - }() - dirNames, err := file.Readdirnames(-1) - if err != nil { - return nil, err - } - sort.Strings(dirNames) - return dirNames, nil -} - -type walkOptions struct { - symlinks bool -} - -func newWalkOptions() *walkOptions { - return &walkOptions{} -} - -// returns optionally-resolved path, optionally-resolved os.FileInfo -func optionallyEvaluateSymlink(filePath string, fileInfo os.FileInfo, symlinks bool) (string, os.FileInfo, error) { - if !symlinks { - return filePath, fileInfo, nil - } - if fileInfo.Mode()&os.ModeSymlink != os.ModeSymlink { - return filePath, fileInfo, nil - } - resolvedFilePath, err := filepath.EvalSymlinks(filePath) - if err != nil { - return filePath, fileInfo, err - } - resolvedFileInfo, err := os.Lstat(resolvedFilePath) - if err != nil { - return filePath, fileInfo, err - } - return resolvedFilePath, resolvedFileInfo, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/usage.gen.go deleted file mode 100644 index 8baff5365d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/filepathextended/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package filepathextended - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/annotated_tag.go b/vendor/github.com/bufbuild/buf/private/pkg/git/annotated_tag.go deleted file mode 100644 index 1bb477639c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/annotated_tag.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "io" - "strings" -) - -type annotatedTag struct { - hash Hash - commit Hash - name string - tagger Ident - message string -} - -func (t *annotatedTag) Hash() Hash { - return t.hash -} -func (t *annotatedTag) Commit() Hash { - return t.commit -} -func (t *annotatedTag) Name() string { - return t.name -} -func (t *annotatedTag) Tagger() Ident { - return t.tagger -} -func (t *annotatedTag) Message() string { - return t.message -} - -func parseAnnotatedTag(hash Hash, data []byte) (*annotatedTag, error) { - t := &annotatedTag{ - hash: hash, - } - buffer := bytes.NewBuffer(data) - line, err := buffer.ReadString('\n') - for err != io.EOF && line != "\n" { - header, value, _ := strings.Cut(line, " ") - value = strings.TrimRight(value, "\n") - switch header { - case "object": - if t.commit, err = parseHashFromHex(value); err != nil { - return nil, err - } - case "tagger": - if t.tagger, err = parseIdent([]byte(value)); err != nil { - return nil, err - } - case "tag": - t.name = value - default: - // We do not parse the remaining headers. - } - line, err = buffer.ReadString('\n') - } - t.message = buffer.String() - t.message = strings.TrimRight(t.message, "\n") - return t, err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/branch.go b/vendor/github.com/bufbuild/buf/private/pkg/git/branch.go deleted file mode 100644 index 6426105e56..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/branch.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -type branch struct { - branch string -} - -func newBranch(name string) *branch { - return &branch{ - branch: name, - } -} - -func (r *branch) cloneBranch() string { - if r == nil { - return "" - } - return r.branch -} - -func (r branch) checkout() string { - return "" -} - -// Used for logging -func (r *branch) MarshalJSON() ([]byte, error) { - return []byte(`"` + r.cloneBranch() + `"`), nil -} - -func (r *branch) String() string { - return r.cloneBranch() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/cloner.go b/vendor/github.com/bufbuild/buf/private/pkg/git/cloner.go deleted file mode 100644 index ae279540df..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/cloner.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "context" - "errors" - "fmt" - "strconv" - "strings" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "github.com/bufbuild/buf/private/pkg/tmp" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/trace" - "go.uber.org/multierr" - "go.uber.org/zap" -) - -const ( - // bufCloneOrigin is the name for the remote. It helps distinguish the origin of - // the repo we're cloning from the "origin" of our clone (which is the repo - // being cloned). - // We can fetch directly from an origin URL, but without any remote set git LFS - // will fail to fetch so we need to pick something. - bufCloneOrigin = "bufCloneOrigin" - tracerName = "bufbuild/buf/cloner" -) - -type cloner struct { - logger *zap.Logger - storageosProvider storageos.Provider - runner command.Runner - options ClonerOptions - tracer trace.Tracer -} - -func newCloner( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - options ClonerOptions, -) *cloner { - return &cloner{ - logger: logger, - storageosProvider: storageosProvider, - runner: runner, - options: options, - tracer: otel.GetTracerProvider().Tracer(tracerName), - } -} - -func (c *cloner) CloneToBucket( - ctx context.Context, - envContainer app.EnvContainer, - url string, - depth uint32, - writeBucket storage.WriteBucket, - options CloneToBucketOptions, -) (retErr error) { - ctx, span := c.tracer.Start(ctx, "git_clone_to_bucket") - defer span.End() - defer func() { - if retErr != nil { - span.RecordError(retErr) - span.SetStatus(codes.Error, retErr.Error()) - } - }() - - var err error - switch { - case strings.HasPrefix(url, "http://"), - strings.HasPrefix(url, "https://"), - strings.HasPrefix(url, "ssh://"), - strings.HasPrefix(url, "git://"), - strings.HasPrefix(url, "file://"): - default: - return fmt.Errorf("invalid git url: %q", url) - } - - if depth == 0 { - err := errors.New("depth must be > 0") - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - - depthArg := strconv.Itoa(int(depth)) - - bareDir, err := tmp.NewDir() - if err != nil { - span.RecordError(err) - span.SetStatus(codes.Error, err.Error()) - return err - } - defer func() { - retErr = multierr.Append(retErr, bareDir.Close()) - }() - worktreeDir, err := tmp.NewDir() - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, worktreeDir.Close()) - }() - - buffer := bytes.NewBuffer(nil) - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs("init", "--bare"), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - command.RunWithDir(bareDir.AbsPath()), - ); err != nil { - return newGitCommandError(err, buffer, bareDir) - } - - buffer.Reset() - remoteArgs := []string{ - "--git-dir=" + bareDir.AbsPath(), - "remote", - "add", - bufCloneOrigin, - url, - } - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs(remoteArgs...), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - ); err != nil { - return newGitCommandError(err, buffer, bareDir) - } - - var gitConfigAuthArgs []string - if strings.HasPrefix(url, "https://") { - // These extraArgs MUST be first, as the -c flag potentially produced - // is only a flag on the parent git command, not on git fetch. - extraArgs, err := c.getArgsForHTTPSCommand(envContainer) - if err != nil { - return err - } - gitConfigAuthArgs = append(gitConfigAuthArgs, extraArgs...) - } - fetchRef, worktreeRef, checkoutRef := getRefspecsForName(options.Name) - fetchArgs := append( - gitConfigAuthArgs, - "--git-dir="+bareDir.AbsPath(), - "fetch", - "--depth", depthArg, - bufCloneOrigin, - fetchRef, - ) - - if strings.HasPrefix(url, "ssh://") { - envContainer, err = c.getEnvContainerWithGitSSHCommand(envContainer) - if err != nil { - return err - } - } - buffer.Reset() - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs(fetchArgs...), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - ); err != nil { - return newGitCommandError(err, buffer, bareDir) - } - - buffer.Reset() - args := append( - gitConfigAuthArgs, - "--git-dir="+bareDir.AbsPath(), - "worktree", - "add", - worktreeDir.AbsPath(), - worktreeRef, - ) - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs(args...), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - ); err != nil { - return newGitCommandError(err, buffer, worktreeDir) - } - - if checkoutRef != "" { - buffer.Reset() - args := append( - gitConfigAuthArgs, - "checkout", - checkoutRef, - ) - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs(args...), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - command.RunWithDir(worktreeDir.AbsPath()), - ); err != nil { - return newGitCommandError(err, buffer, worktreeDir) - } - } - - if options.RecurseSubmodules { - submoduleArgs := append( - gitConfigAuthArgs, - "submodule", - "update", - "--init", - "--recursive", - "--depth", - depthArg, - ) - buffer.Reset() - if err := c.runner.Run( - ctx, - "git", - command.RunWithArgs(submoduleArgs...), - command.RunWithEnv(app.EnvironMap(envContainer)), - command.RunWithStderr(buffer), - command.RunWithDir(worktreeDir.AbsPath()), - ); err != nil { - // Suppress printing of temp path - return fmt.Errorf("%v\n%v", err, strings.Replace(buffer.String(), worktreeDir.AbsPath(), "", -1)) - } - } - - // we do NOT want to read in symlinks - tmpReadWriteBucket, err := c.storageosProvider.NewReadWriteBucket(worktreeDir.AbsPath()) - if err != nil { - return err - } - var readBucket storage.ReadBucket = tmpReadWriteBucket - if options.Mapper != nil { - readBucket = storage.MapReadBucket(readBucket, options.Mapper) - } - ctx, span2 := c.tracer.Start(ctx, "git_clone_to_bucket_copy") - defer span2.End() - // do NOT copy external paths - _, err = storage.Copy(ctx, readBucket, writeBucket) - if err != nil { - span2.RecordError(err) - span2.SetStatus(codes.Error, err.Error()) - } - return err -} - -func (c *cloner) getArgsForHTTPSCommand(envContainer app.EnvContainer) ([]string, error) { - if c.options.HTTPSUsernameEnvKey == "" || c.options.HTTPSPasswordEnvKey == "" { - return nil, nil - } - httpsUsernameSet := envContainer.Env(c.options.HTTPSUsernameEnvKey) != "" - httpsPasswordSet := envContainer.Env(c.options.HTTPSPasswordEnvKey) != "" - if !httpsUsernameSet { - if httpsPasswordSet { - return nil, fmt.Errorf("%s set but %s not set", c.options.HTTPSPasswordEnvKey, c.options.HTTPSUsernameEnvKey) - } - return nil, nil - } - c.logger.Debug("git_credential_helper_override") - return []string{ - "-c", - fmt.Sprintf( - // TODO: is this OK for windows/other platforms? - // we might need an alternate flow where the binary has a sub-command to do this, and calls itself - // - // putting the variable name in this script, NOT the actual variable value - // we do not want to store the variable on disk, ever - // this is especially important if the program dies - // note that this means i.e. HTTPS_PASSWORD=foo invoke_program does not work as - // this variable needs to be in the actual global environment - // TODO this is a mess - "credential.helper=!f(){ echo username=${%s}; echo password=${%s}; };f", - c.options.HTTPSUsernameEnvKey, - c.options.HTTPSPasswordEnvKey, - ), - }, nil -} - -func (c *cloner) getEnvContainerWithGitSSHCommand(envContainer app.EnvContainer) (app.EnvContainer, error) { - gitSSHCommand, err := c.getGitSSHCommand(envContainer) - if err != nil { - return nil, err - } - if gitSSHCommand != "" { - c.logger.Debug("git_ssh_command_override") - return app.NewEnvContainerWithOverrides( - envContainer, - map[string]string{ - "GIT_SSH_COMMAND": gitSSHCommand, - }, - ), nil - } - return envContainer, nil -} - -func (c *cloner) getGitSSHCommand(envContainer app.EnvContainer) (string, error) { - sshKeyFilePath := envContainer.Env(c.options.SSHKeyFileEnvKey) - sshKnownHostsFiles := envContainer.Env(c.options.SSHKnownHostsFilesEnvKey) - if sshKeyFilePath == "" { - if sshKnownHostsFiles != "" { - return "", fmt.Errorf("%s set but %s not set", c.options.SSHKnownHostsFilesEnvKey, c.options.SSHKeyFileEnvKey) - } - return "", nil - } - if sshKnownHostsFilePaths := getSSHKnownHostsFilePaths(sshKnownHostsFiles); len(sshKnownHostsFilePaths) > 0 { - return fmt.Sprintf( - `ssh -q -i "%s" -o "IdentitiesOnly=yes" -o "UserKnownHostsFile=%s"`, - sshKeyFilePath, - strings.Join(sshKnownHostsFilePaths, " "), - ), nil - } - // we want to set StrictHostKeyChecking=no because the SSH key file variable was set, so - // there is an ask to override the default ssh settings here - return fmt.Sprintf( - `ssh -q -i "%s" -o "IdentitiesOnly=yes" -o "UserKnownHostsFile=%s" -o "StrictHostKeyChecking=no"`, - sshKeyFilePath, - app.DevNullFilePath, - ), nil -} - -func getSSHKnownHostsFilePaths(sshKnownHostsFiles string) []string { - if sshKnownHostsFiles == "" { - return nil - } - var filePaths []string - for _, filePath := range strings.Split(sshKnownHostsFiles, ":") { - filePath = strings.TrimSpace(filePath) - if filePath != "" { - filePaths = append(filePaths, filePath) - } - } - return filePaths -} - -// getRefspecsForName decides the refspecs to use in the subsequent git fetch, -// git worktree add and git checkout. When checkoutRefspec is empty, Name -// explicitly refer to a named ref and the checkout isn't a necessary step. -func getRefspecsForName(gitName Name) (fetchRefSpec string, worktreeRefSpec string, checkoutRefspec string) { - if gitName == nil { - return "HEAD", "FETCH_HEAD", "" - } - if gitName.cloneBranch() != "" && gitName.checkout() != "" { - // When doing branch/tag clones, make sure we use a - // refspec that creates a local referece in `refs/` even if the ref - // is remote tracking, so that the checkoutRefs may reference it, - // for example: - // branch=origin/main,ref=origin/main~1 - fetchRefSpec := gitName.cloneBranch() + ":" + gitName.cloneBranch() - return fetchRefSpec, "FETCH_HEAD", gitName.checkout() - } else if gitName.cloneBranch() != "" { - return gitName.cloneBranch(), "FETCH_HEAD", "" - } else if gitName.checkout() != "" { - // After fetch we won't have checked out any refs. This - // will cause `refs=` containing "HEAD" to fail, as HEAD - // is a special case that is not fetched into a ref but - // instead refers to the current commit checked out. By - // checking out "FETCH_HEAD" before checking out the - // user supplied ref, we behave similarly to git clone. - return "HEAD", "FETCH_HEAD", gitName.checkout() - } else { - return "HEAD", "FETCH_HEAD", "" - } -} - -func newGitCommandError( - err error, - buffer *bytes.Buffer, - tmpDir tmp.Dir, -) error { - // Suppress printing of temp path - return fmt.Errorf("%v\n%v", err, strings.TrimSpace(strings.Replace(buffer.String(), tmpDir.AbsPath(), "", -1))) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/commit.go b/vendor/github.com/bufbuild/buf/private/pkg/git/commit.go deleted file mode 100644 index 3eca0c731e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/commit.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "errors" - "io" - "strings" -) - -type commit struct { - hash Hash - tree Hash - parents []Hash - author Ident - committer Ident - message string -} - -func (c *commit) Hash() Hash { - return c.hash -} -func (c *commit) Tree() Hash { - return c.tree -} -func (c *commit) Parents() []Hash { - return c.parents -} -func (c *commit) Author() Ident { - return c.author -} -func (c *commit) Committer() Ident { - return c.committer -} -func (c *commit) Message() string { - return c.message -} - -func parseCommit(hash Hash, data []byte) (*commit, error) { - c := &commit{ - hash: hash, - } - buffer := bytes.NewBuffer(data) - line, err := buffer.ReadString('\n') - for err != io.EOF && line != "\n" { - header, value, _ := strings.Cut(line, " ") - value = strings.TrimRight(value, "\n") - switch header { - case "tree": - if c.tree != nil { - return nil, errors.New("too many tree headers") - } - if c.tree, err = parseHashFromHex(value); err != nil { - return nil, err - } - case "parent": - if parent, err := parseHashFromHex(value); err != nil { - return nil, err - } else { - c.parents = append(c.parents, parent) - } - case "author": - if c.author, err = parseIdent([]byte(value)); err != nil { - return nil, err - } - case "committer": - if c.committer, err = parseIdent([]byte(value)); err != nil { - return nil, err - } - default: - // We do not parse the remaining headers. - } - line, err = buffer.ReadString('\n') - } - c.message = buffer.String() - c.message = strings.TrimRight(c.message, "\n") - return c, err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/git.go b/vendor/github.com/bufbuild/buf/private/pkg/git/git.go deleted file mode 100644 index 11ffcf4faa..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/git.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "context" - "errors" - "regexp" - "time" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageos" - "go.uber.org/zap" -) - -const ( - // DotGitDir is a relative path to the `.git` directory. - DotGitDir = ".git" - - // ModeUnknown is a mode's zero value. - ModeUnknown ObjectMode = 0 - // ModeFile is a blob that should be written as a plain file. - ModeFile ObjectMode = 010_0644 - // ModeExec is a blob that should be written with the executable bit set. - ModeExe ObjectMode = 010_0755 - // ModeDir is a tree to be unpacked as a subdirectory in the current - // directory. - ModeDir ObjectMode = 004_0000 - // ModeSymlink is a blob with its content being the path linked to. - ModeSymlink ObjectMode = 012_0000 - // ModeSubmodule is a commit that the submodule is checked out at. - ModeSubmodule ObjectMode = 016_0000 -) - -var ( - // ErrTreeNodeNotFound is an error found in the error chain when - // Tree#Descendant is unable to find the target tree node. - ErrTreeNodeNotFound = errors.New("node not found") - // ErrTreeNodeNotFound is an error found in the error chain when - // ObjectReader is unable to find the target object. - ErrObjectNotFound = errors.New("object not found") -) - -// ObjectMode is how to interpret a tree node's object. See the Mode* constants -// for how to interpret each mode value. -type ObjectMode uint32 - -// Name is a name identifiable by git. -type Name interface { - // If cloneBranch returns a non-empty string, any clones will be performed with --branch set to the value. - cloneBranch() string - // If checkout returns a non-empty string, a checkout of the value will be performed after cloning. - checkout() string -} - -// NewBranchName returns a new Name for the branch. -func NewBranchName(branch string) Name { - return newBranch(branch) -} - -// NewTagName returns a new Name for the tag. -func NewTagName(tag string) Name { - return newBranch(tag) -} - -// NewRefName returns a new Name for the ref. -func NewRefName(ref string) Name { - return newRef(ref) -} - -// NewRefNameWithBranch returns a new Name for the ref while setting branch as the clone target. -func NewRefNameWithBranch(ref string, branch string) Name { - return newRefWithBranch(ref, branch) -} - -// Cloner clones git repositories to buckets. -type Cloner interface { - // CloneToBucket clones the repository to the bucket. - // - // The url must contain the scheme, including file:// if necessary. - // depth must be > 0. - CloneToBucket( - ctx context.Context, - envContainer app.EnvContainer, - url string, - depth uint32, - writeBucket storage.WriteBucket, - options CloneToBucketOptions, - ) error -} - -// CloneToBucketOptions are options for Clone. -type CloneToBucketOptions struct { - Mapper storage.Mapper - Name Name - RecurseSubmodules bool -} - -// NewCloner returns a new Cloner. -func NewCloner( - logger *zap.Logger, - storageosProvider storageos.Provider, - runner command.Runner, - options ClonerOptions, -) Cloner { - return newCloner(logger, storageosProvider, runner, options) -} - -// ClonerOptions are options for a new Cloner. -type ClonerOptions struct { - HTTPSUsernameEnvKey string - HTTPSPasswordEnvKey string - SSHKeyFileEnvKey string - SSHKnownHostsFilesEnvKey string -} - -// Lister lists files in git repositories. -type Lister interface { - // ListFilesAndUnstagedFiles lists all files checked into git except those that - // were deleted, and also lists unstaged files. - // - // This does not list unstaged deleted files - // This does not list unignored files that were not added. - // This ignores regular files. - // - // This is used for situations like license headers where we want all the - // potential git files during development. - // - // The returned paths will be unnormalized. - // - // This is the equivalent of doing: - // - // comm -23 \ - // <(git ls-files --cached --modified --others --no-empty-directory --exclude-standard | sort -u | grep -v -e IGNORE_PATH1 -e IGNORE_PATH2) \ - // <(git ls-files --deleted | sort -u) - ListFilesAndUnstagedFiles( - ctx context.Context, - envContainer app.EnvStdioContainer, - options ListFilesAndUnstagedFilesOptions, - ) ([]string, error) -} - -// NewLister returns a new Lister. -func NewLister(runner command.Runner) Lister { - return newLister(runner) -} - -// ListFilesAndUnstagedFilesOptions are options for ListFilesAndUnstagedFiles. -type ListFilesAndUnstagedFilesOptions struct { - // IgnorePathRegexps are regexes of paths to ignore. - // - // These must be unnormalized in the manner of the local OS that the Lister - // is being applied to. - IgnorePathRegexps []*regexp.Regexp -} - -// Hash represents the hash of a Git object (tree, blob, or commit). -type Hash interface { - // Hex is the hexadecimal representation of this ID. - Hex() string - // String returns the hexadecimal representation of this ID. - String() string -} - -// NewHashFromHex creates a new hash that is validated. -func NewHashFromHex(value string) (Hash, error) { - return parseHashFromHex(value) -} - -// Ident is a git user identifier. These typically represent authors and committers. -type Ident interface { - // Name is the name of the user. - Name() string - // Email is the email of the user. - Email() string - // Timestamp is the time at which this identity was created. For authors it's the - // commit's author time, and for committers it's the commit's commit time. - Timestamp() time.Time -} - -// Commit represents a commit object. -// -// All commits will have a non-nil Tree. All but the root commit will contain >0 parents. -type Commit interface { - // Hash is the Hash for this commit. - Hash() Hash - // Tree is the ID to the git tree for this commit. - Tree() Hash - // Parents is the set of parents for this commit. It may be empty. - // - // By convention, the first parent in a multi-parent commit is the merge target. - Parents() []Hash - // Author is the user who authored the commit. - Author() Ident - // Committer is the user who created the commit. - Committer() Ident - // Message is the commit message. - Message() string -} - -// AnnotatedTag represents an annotated tag object. -type AnnotatedTag interface { - // Hash is the Hash for this tag. - Hash() Hash - // Commit is the ID to the git commit that this tag points to. - Commit() Hash - // Tagger is the user who tagged the commit. - Tagger() Ident - // Name is the value of the tag. - Name() string - // Message is the commit message. - Message() string -} - -// ObjectReader reads objects (commits, trees, blobs, tags) from a `.git` directory. -type ObjectReader interface { - // Blob reads the blob identified by the hash. - Blob(id Hash) ([]byte, error) - // Commit reads the commit identified by the hash. - Commit(id Hash) (Commit, error) - // Tree reads the tree identified by the hash. - Tree(id Hash) (Tree, error) - // Tag reads the tag identified by the hash. - Tag(id Hash) (AnnotatedTag, error) -} - -// Tree is a git tree, which are a manifest of other git objects, including other trees. -type Tree interface { - // Hash is the Hash for this Tree. - Hash() Hash - // Nodes is the set of nodes in this Tree. - Nodes() []TreeNode - // Descendant walks down a tree, following the path specified, - // and returns the terminal Node. If no node is found, it returns - // ErrTreeNodeNotFound. - Descendant(path string, objectReader ObjectReader) (TreeNode, error) -} - -// TreeNode is a reference to an object contained in a tree. These objects have -// a file mode associated with them, which hints at the type of object located -// at ID (tree or blob). -type TreeNode interface { - // Hash is the Hash of the object referenced by this Node. - Hash() Hash - // Name is the name of the object referenced by this Node. - Name() string - // Mode is the file mode of the object referenced by this Node. - Mode() ObjectMode -} - -// Repository is a git repository that is backed by a `.git` directory. -type Repository interface { - // BaseBranch is the base branch of the repository. This is either configured - // via the `OpenRepositoryWithBaseBranch` option, or discovered via the remote - // named `origin`. Therefore, discovery requires that the repository is pushed - // to the remote. - BaseBranch() string - // ForEachBranch ranges over branches in the repository in an undefined order. - // - // Only pushed (i.e., remote) branches are visited. - ForEachBranch(func(branch string, headHash Hash) error) error - // ForEachCommit ranges over commits for the target branch in reverse topological order. - // - // Only commits pushed to the 'origin' remote are visited. - // - // Parents are visited before children, and only left parents are visited (i.e., - // commits from branches merged into the target branch are not visited). - ForEachCommit(branch string, f func(commit Commit) error) error - // ForEachTag ranges over tags in the repository in an undefined order. - // - // All tags are ranged, including local (unpushed) tags. - ForEachTag(func(tag string, commitHash Hash) error) error - // Objects exposes the underlying object reader to read objects directly from the - // `.git` directory. - Objects() ObjectReader - // Close closes the repository. - Close() error -} - -// OpenRepository opens a new Repository from a `.git` directory. The provided path to the -// `.git` dir need not be normalized or cleaned. -// -// Internally, OpenRepository will spawns a new process to communicate with `git-cat-file`, -// so the caller must close the repository to clean up resources. -// -// By default, OpenRepository will attempt to detect the base branch if the repository -// has been pushed. This may fail if the repository is not pushed. In this case, use the -// `OpenRepositoryWithBaseBranch` option. -func OpenRepository(gitDirPath string, runner command.Runner, options ...OpenRepositoryOption) (Repository, error) { - return openGitRepository(gitDirPath, runner, options...) -} - -// OpenRepositoryOption configures the opening of a repository. -type OpenRepositoryOption func(*openRepositoryOpts) error - -// CommitIteratorWithBaseBranch configures the base branch for this iterator. -func OpenRepositoryWithBaseBranch(name string) OpenRepositoryOption { - return func(r *openRepositoryOpts) error { - if name == "" { - return errors.New("base branch cannot be empty") - } - r.baseBranch = name - return nil - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/hash.go b/vendor/github.com/bufbuild/buf/private/pkg/git/hash.go deleted file mode 100644 index 1ddb2f606d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/hash.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "encoding/hex" - "fmt" -) - -// hashLength is the length, in bytes, of digests/hashes in object format SHA1 -const hashLength = 20 - -// hashHexLength is the length, in hexadecimal characters, of digests/hashes in object format SHA1 -var hashHexLength = hex.EncodedLen(hashLength) - -type hash struct { - raw []byte - hex string -} - -func (i *hash) Raw() []byte { - return i.raw -} - -func (i *hash) Hex() string { - return i.hex -} - -func (i *hash) String() string { - return i.hex -} - -func newHashFromBytes(data []byte) (*hash, error) { - if len(data) != hashLength { - return nil, fmt.Errorf("hash is not %d bytes", hashLength) - } - dst := make([]byte, hex.EncodedLen(len(data))) - hex.Encode(dst, data) - return &hash{ - raw: data, - hex: string(dst), - }, nil -} - -func parseHashFromHex(data string) (*hash, error) { - if len(data) != hashHexLength { - return nil, fmt.Errorf("hash is not %d characters", hashHexLength) - } - raw, err := hex.DecodeString(data) - return &hash{ - raw: raw, - hex: data, - }, err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/ident.go b/vendor/github.com/bufbuild/buf/private/pkg/git/ident.go deleted file mode 100644 index 35bcffabca..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/ident.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "errors" - "fmt" - "strconv" - "strings" - "time" -) - -type ident struct { - name string - email string - timestamp time.Time -} - -func (i *ident) Name() string { - return i.name -} -func (i *ident) Email() string { - return i.email -} -func (i *ident) Timestamp() time.Time { - return i.timestamp -} - -func parseIdent(data []byte) (*ident, error) { - var i ident - // Name (optional) - // Many spaces between name and email are allowed. - name, emailAndTime, found := strings.Cut(string(data), "<") - if !found { - // Mail is required. - return nil, errors.New("ident: no email component") - } - i.name = strings.TrimRight(name, " ") - - // Email (required) - idx := strings.LastIndex(emailAndTime, ">") - if idx == -1 { - return nil, errors.New("ident: malformed email component") - } - i.email = emailAndTime[:idx] - - // Timestamp (optional) - // The stamp is in Unix Epoc and the user's UTC offset in [+-]HHMM when the - // time was taken. - timestr := strings.TrimLeft(emailAndTime[idx+1:], " ") - if timestr != "" { - timesecstr, timezonestr, found := strings.Cut(timestr, " ") - if !found { - return nil, errors.New("ident: malformed timestamp: missing UTC offset") - } - timesec, err := strconv.ParseInt(timesecstr, 10, 64) - if err != nil { - return nil, fmt.Errorf("ident: malformed timestamp: %w", err) - } - tzHourStr := timezonestr[:len(timezonestr)-2] - tzHour, err := strconv.ParseInt(tzHourStr, 10, 32) - if err != nil { - return nil, fmt.Errorf("ident: malformed timestamp: %w", err) - } - tzMinStr := timezonestr[len(timezonestr)-2:] - tzMin, err := strconv.ParseInt(tzMinStr, 10, 32) - if err != nil { - return nil, fmt.Errorf("ident: malformed timestamp: %w", err) - } - tzOffset := int(tzHour)*60*60 + int(tzMin)*60 - location := time.FixedZone("UTC"+timezonestr, tzOffset) - i.timestamp = time.Unix(timesec, 0).In(location) - } - return &i, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/lister.go b/vendor/github.com/bufbuild/buf/private/pkg/git/lister.go deleted file mode 100644 index bdcc02d82a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/lister.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "context" - "os" - "regexp" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -type lister struct { - runner command.Runner -} - -func newLister(runner command.Runner) *lister { - return &lister{ - runner: runner, - } -} - -func (l *lister) ListFilesAndUnstagedFiles( - ctx context.Context, - container app.EnvStdioContainer, - options ListFilesAndUnstagedFilesOptions, -) ([]string, error) { - allFilesOutput, err := command.RunStdout( - ctx, - container, - l.runner, - "git", - "ls-files", - "--cached", - "--modified", - "--others", - "--exclude-standard", - ) - if err != nil { - return nil, err - } - deletedFilesOutput, err := command.RunStdout( - ctx, - container, - l.runner, - "git", - "ls-files", - "--deleted", - ) - if err != nil { - return nil, err - } - return stringutil.SliceToUniqueSortedSlice( - filterNonRegularFiles( - stringSliceExceptMatches( - stringSliceExcept( - // This may not work in all Windows scenarios as we only split on "\n" but - // this is no worse than we previously had. - stringutil.SplitTrimLinesNoEmpty(string(allFilesOutput)), - stringutil.SplitTrimLinesNoEmpty(string(deletedFilesOutput)), - ), - options.IgnorePathRegexps, - ), - ), - ), nil -} - -// stringSliceExcept returns all elements in source that are not in except. -func stringSliceExcept(source []string, except []string) []string { - exceptMap := stringutil.SliceToMap(except) - result := make([]string, 0, len(source)) - for _, s := range source { - if _, ok := exceptMap[s]; !ok { - result = append(result, s) - } - } - return result -} - -// stringSliceExceptMatches returns all elements in source that do not match -// any of the regexps. -func stringSliceExceptMatches(source []string, regexps []*regexp.Regexp) []string { - if len(regexps) == 0 { - return source - } - result := make([]string, 0, len(source)) - for _, s := range source { - if !matchesAny(s, regexps) { - result = append(result, s) - } - } - return result -} - -// matchesAny returns true if any of regexps match. -func matchesAny(s string, regexps []*regexp.Regexp) bool { - for _, regexp := range regexps { - if regexp.MatchString(s) { - return true - } - } - return false -} - -// filterNonRegularFiles returns all regular files. -// -// This does an os.Stat call, so the files must exist for this to work. -// Given our usage here, this is true by the time this function is called. -func filterNonRegularFiles(files []string) []string { - filteredFiles := make([]string, 0, len(files)) - for _, file := range files { - if fileInfo, err := os.Stat(file); err == nil && fileInfo.Mode().IsRegular() { - filteredFiles = append(filteredFiles, file) - } - } - return filteredFiles -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/object_reader.go b/vendor/github.com/bufbuild/buf/private/pkg/git/object_reader.go deleted file mode 100644 index 9ef6516f67..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/object_reader.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bufio" - "context" - "errors" - "fmt" - "io" - "strconv" - "strings" - "time" - - "github.com/bufbuild/buf/private/pkg/command" - "go.uber.org/multierr" -) - -const ( - objectTypeBlob = "blob" - objectTypeCommit = "commit" - objectTypeTree = "tree" - objectTypeTag = "tag" -) - -// exitTime is the amount of time we'll wait for git-cat-file(1) to exit. -var exitTime = 5 * time.Second -var errObjectTypeMismatch = errors.New("object type mismatch") - -type objectReader struct { - rx *bufio.Reader - tx io.WriteCloser - process command.Process -} - -func newObjectReader(gitDirPath string, runner command.Runner) (*objectReader, error) { - rx, stdout := io.Pipe() - stdin, tx := io.Pipe() - process, err := runner.Start( - "git", - command.StartWithArgs("cat-file", "--batch"), - command.StartWithStdin(stdin), - command.StartWithStdout(stdout), - command.StartWithEnv(map[string]string{ - "GIT_DIR": gitDirPath, - }), - ) - if err != nil { - return nil, err - } - return &objectReader{ - rx: bufio.NewReader(rx), - tx: tx, - process: process, - }, nil -} - -func (o *objectReader) close() error { - ctx, cancel := context.WithDeadline( - context.Background(), - time.Now().Add(exitTime), - ) - defer cancel() - return multierr.Combine( - o.tx.Close(), - o.process.Wait(ctx), - ) -} - -func (o *objectReader) Blob(hash Hash) ([]byte, error) { - return o.read(objectTypeBlob, hash) -} - -func (o *objectReader) Commit(hash Hash) (Commit, error) { - data, err := o.read(objectTypeCommit, hash) - if err != nil { - return nil, err - } - return parseCommit(hash, data) -} - -func (o *objectReader) Tree(hash Hash) (Tree, error) { - data, err := o.read(objectTypeTree, hash) - if err != nil { - return nil, err - } - return parseTree(hash, data) -} - -func (o *objectReader) Tag(hash Hash) (AnnotatedTag, error) { - data, err := o.read(objectTypeTag, hash) - if err != nil { - return nil, err - } - return parseAnnotatedTag(hash, data) -} - -func (o *objectReader) read(objectType string, id Hash) ([]byte, error) { - // request - if _, err := fmt.Fprintf(o.tx, "%s\n", id.Hex()); err != nil { - return nil, err - } - // response - header, err := o.rx.ReadBytes('\n') - if err != nil { - return nil, err - } - headerStr := strings.TrimRight(string(header), "\n") - parts := strings.Split(headerStr, " ") - if len(parts) == 2 && parts[1] == "missing" { - return nil, fmt.Errorf( - "git-cat-file: %s: %w", - parts[0], - ErrObjectNotFound, - ) - } - if len(parts) != 3 { - return nil, fmt.Errorf("git-cat-file: malformed header: %q", headerStr) - } - objID, err := parseHashFromHex(parts[0]) - if err != nil { - return nil, err - } - if id.Hex() != objID.Hex() { - return nil, fmt.Errorf("git-cat-file: mismatched object ID: %s, %s", id.Hex(), objID.Hex()) - } - objType := parts[1] - objLenStr := parts[2] - objLen, err := strconv.ParseInt(objLenStr, 10, 64) - if err != nil { - return nil, err - } - objContent := make([]byte, objLen) - if _, err := io.ReadAtLeast(o.rx, objContent, int(objLen)); err != nil { - return nil, err - } - // TODO: We can verify the object content if we move from opaque object IDs - // to ones that know about being hardened SHA1 or SHA256. - trailer, err := o.rx.ReadBytes('\n') - if err != nil { - return nil, err - } - if len(trailer) != 1 { - return nil, errors.New("git-cat-file: unexpected trailer") - } - // Check the response type. It's check here to consume the complete request - // first. - if objType != objectType { - return nil, fmt.Errorf( - "git-cat-file: object %q is a %s, not a %s: %w", - id, - objType, - objectType, - errObjectTypeMismatch, - ) - } - return objContent, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/packed_refs.go b/vendor/github.com/bufbuild/buf/private/pkg/git/packed_refs.go deleted file mode 100644 index 0aa1b4f3ad..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/packed_refs.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "strings" -) - -const ( - // packedRefsHeader is the head for the `packed-refs` file - // based on https://github.com/git/git/blob/master/refs/packed-backend.c#LL1084C41-L1084C41 - packedRefsHeader = "# pack-refs with: peeled fully-peeled sorted " - tagRefPrefix = "refs/tags/" - originBranchRefPrefix = "refs/remotes/origin/" - unpeeledRefPrefix = '^' -) - -// parsePackedRefs reads a `packed-refs` file, returning the packed branches and tags -func parsePackedRefs(data []byte) ( - map[string]Hash, // branches - map[string]Hash, // tags - error, -) { - var ( - packedBranches = map[string]Hash{} - packedTags = map[string]Hash{} - ) - /* - data is in the format - \n - repeated: - \n - (optional for tags if unpeeled)^\n - - for branches, the hash is the commit object - for tags, the hash is the tag object; the following line is the commit hash - */ - var lines []string - scanner := bufio.NewScanner(bytes.NewReader(data)) - for scanner.Scan() { - lines = append(lines, scanner.Text()) - } - if scanner.Err() != nil { - return nil, nil, scanner.Err() - } - for i := 0; i < len(lines); i++ { - line := lines[i] - if strings.HasPrefix(line, "#") { - // Git tells us the way that these refs are packed. In theory the refs - // may be packed in different ways, but as of today's writing, they are - // always packed fully-peeled. - // - // The comment should match `packedRefsHeader`. We can safely skip this comment if so. - if line != packedRefsHeader { - return nil, nil, fmt.Errorf("unknown packed-refs header: %q", line) - } - continue - } - hashHex, ref, found := strings.Cut(line, " ") - if !found { - return nil, nil, errors.New("invalid packed-refs file") - } - hash, err := parseHashFromHex(hashHex) - if err != nil { - return nil, nil, err - } - if strings.HasPrefix(ref, originBranchRefPrefix) { - branchName := strings.TrimPrefix(ref, originBranchRefPrefix) - packedBranches[branchName] = hash - } else if strings.HasPrefix(ref, tagRefPrefix) { - tagName := strings.TrimPrefix(ref, tagRefPrefix) - // We're looking at a tag. If the tag is annotated, the next line is our actual - // commit hash, prefixed with '^'. If not, the already read hash is our commit hash. - // We need to look ahead to see the next line. - if len(lines) > i+1 && lines[i+1][0] == unpeeledRefPrefix { - // We have an annotated tag that's been peeled. Let's read it. - i++ - nextLine := lines[i] - nextLine = strings.TrimPrefix(nextLine, string(unpeeledRefPrefix)) - hash, err = parseHashFromHex(nextLine) - if err != nil { - return nil, nil, err - } - } - packedTags[tagName] = hash - } - // We ignore all kinds of refs. - } - return packedBranches, packedTags, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/ref.go b/vendor/github.com/bufbuild/buf/private/pkg/git/ref.go deleted file mode 100644 index 4de932ae27..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/ref.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -type ref struct { - ref string -} - -func newRef(name string) *ref { - return &ref{ - ref: name, - } -} - -func (r *ref) cloneBranch() string { - return "" -} - -func (r *ref) checkout() string { - if r == nil { - return "" - } - return r.ref -} - -// Used for logging -func (r *ref) MarshalJSON() ([]byte, error) { - return []byte(`"` + r.checkout() + `"`), nil -} - -func (r *ref) String() string { - return r.checkout() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/ref_branch.go b/vendor/github.com/bufbuild/buf/private/pkg/git/ref_branch.go deleted file mode 100644 index 91f61be5ae..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/ref_branch.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import "encoding/json" - -type refWithBranch struct { - ref string - branch string -} - -func newRefWithBranch(ref string, branch string) *refWithBranch { - return &refWithBranch{ - ref: ref, - branch: branch, - } -} - -func (r *refWithBranch) cloneBranch() string { - if r == nil { - return "" - } - return r.branch -} - -func (r *refWithBranch) checkout() string { - if r == nil { - return "" - } - return r.ref -} - -// Used for logging -func (r *refWithBranch) MarshalJSON() ([]byte, error) { - return json.Marshal(struct { - Ref string - Branch string - }{ - Ref: r.checkout(), - Branch: r.cloneBranch(), - }) -} - -func (r *refWithBranch) String() string { - return r.checkout() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/repository.go b/vendor/github.com/bufbuild/buf/private/pkg/git/repository.go deleted file mode 100644 index 20007ba406..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/repository.go +++ /dev/null @@ -1,325 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "errors" - "fmt" - "io/fs" - "os" - "path" - "path/filepath" - "sync" - - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/filepathextended" - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -const defaultRemoteName = "origin" - -var baseBranchRefPrefix = []byte("ref: refs/remotes/" + defaultRemoteName + "/") - -type openRepositoryOpts struct { - baseBranch string -} - -type repository struct { - gitDirPath string - baseBranch string - objectReader *objectReader - - // packedOnce controls the fields below related to reading the `packed-refs` file - packedOnce sync.Once - packedReadError error - packedBranches map[string]Hash - packedTags map[string]Hash -} - -func openGitRepository( - gitDirPath string, - runner command.Runner, - options ...OpenRepositoryOption, -) (Repository, error) { - opts := &openRepositoryOpts{} - for _, opt := range options { - if err := opt(opts); err != nil { - return nil, err - } - } - gitDirPath = normalpath.Unnormalize(gitDirPath) - if err := validateDirPathExists(gitDirPath); err != nil { - return nil, err - } - gitDirPath, err := filepath.Abs(gitDirPath) - if err != nil { - return nil, err - } - reader, err := newObjectReader(gitDirPath, runner) - if err != nil { - return nil, err - } - if opts.baseBranch == "" { - opts.baseBranch, err = detectBaseBranch(gitDirPath) - if err != nil { - return nil, fmt.Errorf("automatically determine base branch: %w", err) - } - } - return &repository{ - gitDirPath: gitDirPath, - baseBranch: opts.baseBranch, - objectReader: reader, - }, nil -} - -func (r *repository) Close() error { - return r.objectReader.close() -} - -func (r *repository) Objects() ObjectReader { - return r.objectReader -} - -func (r *repository) ForEachBranch(f func(string, Hash) error) error { - seen := map[string]struct{}{} - // Read unpacked branch refs. - dir := path.Join(r.gitDirPath, "refs", "remotes", defaultRemoteName) - if err := filepathextended.Walk(dir, func(path string, info fs.FileInfo, err error) error { - if err != nil { - return err - } - if info.Name() == "HEAD" || info.IsDir() { - return nil - } - branchName, err := filepath.Rel(dir, path) - if err != nil { - return err - } - branchName = normalpath.Normalize(branchName) - hashBytes, err := os.ReadFile(path) - if err != nil { - return err - } - hashBytes = bytes.TrimSuffix(hashBytes, []byte{'\n'}) - hash, err := parseHashFromHex(string(hashBytes)) - if err != nil { - return err - } - seen[branchName] = struct{}{} - return f(branchName, hash) - }); err != nil { - return err - } - // Read packed branch refs that haven't been seen yet. - if err := r.readPackedRefs(); err != nil { - return err - } - for branchName, hash := range r.packedBranches { - if _, found := seen[branchName]; !found { - if err := f(branchName, hash); err != nil { - return err - } - } - } - return nil -} -func (r *repository) BaseBranch() string { - return r.baseBranch -} - -func (r *repository) ForEachCommit(branch string, f func(Commit) error) error { - branch = normalpath.Unnormalize(branch) - commit, err := r.resolveBranch(branch) - if err != nil { - return err - } - var commits []Commit - // TODO: this only works for the base branch; for non-base branches, - // we have to be much more careful about not ranging over commits belonging - // to other branches (i.e., running past the origin of our branch). - // In order to do this, we will want to preload the HEADs of all known branches, - // and halt iteration for a given branch when we encounter the head of another branch. - for { - commits = append(commits, commit) - if len(commit.Parents()) == 0 { - // We've reach the root of the graph. - break - } - // When traversing a commit graph, follow only the first parent commit upon seeing a - // merge commit. This allows us to ignore the individual commits brought in to a branch's - // history by such a merge, as those commits are usually updating the state of the target - // branch. - commit, err = r.objectReader.Commit(commit.Parents()[0]) - if err != nil { - return err - } - } - // Visit in reverse order, starting with the root of the graph first. - for i := len(commits) - 1; i >= 0; i-- { - if err := f(commits[i]); err != nil { - return err - } - } - return nil -} - -func (r *repository) ForEachTag(f func(string, Hash) error) error { - seen := map[string]struct{}{} - // Read unpacked tag refs. - dir := path.Join(r.gitDirPath, "refs", "tags") - if err := filepathextended.Walk(dir, func(path string, info fs.FileInfo, err error) error { - if err != nil { - return err - } - if !info.Mode().IsRegular() { - return nil - } - tagName, err := filepath.Rel(dir, path) - if err != nil { - return err - } - tagName = normalpath.Normalize(tagName) - hashBytes, err := os.ReadFile(path) - if err != nil { - return err - } - hashBytes = bytes.TrimSuffix(hashBytes, []byte{'\n'}) - hash, err := parseHashFromHex(string(hashBytes)) - if err != nil { - return err - } - // Tags are either annotated or lightweight. Depending on the type, - // they are stored differently. First, we try to load the tag - // as an annnotated tag. If this fails, we try a commit. - // Finally, we fail. - tag, err := r.objectReader.Tag(hash) - if err == nil { - seen[tagName] = struct{}{} - return f(tagName, tag.Commit()) - } - if !errors.Is(err, errObjectTypeMismatch) { - return err - } - _, err = r.objectReader.Commit(hash) - if err == nil { - seen[tagName] = struct{}{} - return f(tagName, hash) - } - if !errors.Is(err, errObjectTypeMismatch) { - return err - } - return fmt.Errorf( - "failed to determine target of tag %q; it is neither a tag nor a commit", - tagName, - ) - }); err != nil { - return err - } - // Read packed tag refs that haven't been seen yet. - if err := r.readPackedRefs(); err != nil { - return err - } - for tagName, commit := range r.packedTags { - if _, found := seen[tagName]; !found { - if err := f(tagName, commit); err != nil { - return err - } - } - } - return nil -} - -func (r *repository) resolveBranch(branch string) (Commit, error) { - commitBytes, err := os.ReadFile(path.Join(r.gitDirPath, "refs", "remotes", defaultRemoteName, branch)) - if errors.Is(err, fs.ErrNotExist) { - // it may be that the branch ref is packed; let's read the packed refs - if err := r.readPackedRefs(); err != nil { - return nil, err - } - if commitID, ok := r.packedBranches[branch]; ok { - commit, err := r.objectReader.Commit(commitID) - if err != nil { - return nil, err - } - return commit, nil - } - return nil, fmt.Errorf("branch %q not found", branch) - } - if err != nil { - return nil, err - } - commitBytes = bytes.TrimRight(commitBytes, "\n") - commitID, err := NewHashFromHex(string(commitBytes)) - if err != nil { - return nil, err - } - commit, err := r.objectReader.Commit(commitID) - if err != nil { - return nil, err - } - return commit, nil -} - -func (r *repository) readPackedRefs() error { - r.packedOnce.Do(func() { - packedRefsPath := path.Join(r.gitDirPath, "packed-refs") - if _, err := os.Stat(packedRefsPath); err != nil { - if errors.Is(err, os.ErrNotExist) { - r.packedBranches = map[string]Hash{} - r.packedTags = map[string]Hash{} - return - } - r.packedReadError = err - return - } - allBytes, err := os.ReadFile(packedRefsPath) - if err != nil { - r.packedReadError = err - return - } - r.packedBranches, r.packedTags, r.packedReadError = parsePackedRefs(allBytes) - }) - return r.packedReadError -} - -func detectBaseBranch(gitDirPath string) (string, error) { - path := path.Join(gitDirPath, "refs", "remotes", defaultRemoteName, "HEAD") - data, err := os.ReadFile(path) - if err != nil { - return "", err - } - if !bytes.HasPrefix(data, baseBranchRefPrefix) { - return "", errors.New("invalid contents in " + path) - } - data = bytes.TrimPrefix(data, baseBranchRefPrefix) - data = bytes.TrimSuffix(data, []byte("\n")) - return string(data), nil -} - -// validateDirPathExists returns a non-nil error if the given dirPath -// is not a valid directory path. -func validateDirPathExists(dirPath string) error { - var fileInfo os.FileInfo - // We do not follow symlinks - fileInfo, err := os.Lstat(dirPath) - if err != nil { - return err - } - if !fileInfo.IsDir() { - return normalpath.NewError(dirPath, errors.New("not a directory")) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/tree.go b/vendor/github.com/bufbuild/buf/private/pkg/git/tree.go deleted file mode 100644 index 400caa4052..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/tree.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -type tree struct { - hash Hash - nodes []TreeNode -} - -func parseTree(hash Hash, data []byte) (*tree, error) { - t := &tree{ - hash: hash, - } - /* - data is in the format - \0 - repeated - */ - for len(data) > 0 { - // We can find the \0 character before the - // and slice to the index of \0 + the length of a hash. - // That gives us a single node. - i := bytes.Index(data, []byte{0}) - if i == -1 { - return nil, errors.New("parse tree") - } - length := i + 1 + hashLength - node, err := parseTreeNode(data[:length]) - if err != nil { - return nil, fmt.Errorf("parse tree: %w", err) - } - t.nodes = append(t.nodes, node) - data = data[length:] - } - return t, nil -} - -func (t *tree) Hash() Hash { - return t.hash -} - -func (t *tree) Nodes() []TreeNode { - return t.nodes -} - -func (t *tree) Descendant(path string, objectReader ObjectReader) (TreeNode, error) { - if path == "" { - return nil, errors.New("empty path") - } - return descendant(objectReader, t, normalpath.Components(path)) -} - -func descendant( - objectReader ObjectReader, - root Tree, - names []string, -) (TreeNode, error) { - // split by the name of the next node we're looking for - // and the names of the descendant nodes - name := names[0] - if len(names) >= 2 { - names = names[1:] - } else { - names = nil - } - // Find node with that name in this tree. - var found TreeNode - for _, node := range root.Nodes() { - if node.Name() == name { - found = node - break - } - } - if found == nil { - // No node with that name in this tree. - return nil, ErrTreeNodeNotFound - } - if len(names) == 0 { - // No more descendants, we've found our terminal node. - return found, nil - } - if found.Mode() != ModeDir { - // This is an intermediate (non-terminal) node, which are expected to be - // directories. This is node is not a directory, so we fail with a non-found - // errror. - return nil, ErrTreeNodeNotFound - } - // TODO: support symlinks (on intermediate dirs) with descendant option - // Descend down and traverse. - tree, err := objectReader.Tree(found.Hash()) - if err != nil { - return nil, err - } - return descendant(objectReader, tree, names) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/tree_node.go b/vendor/github.com/bufbuild/buf/private/pkg/git/tree_node.go deleted file mode 100644 index bc376631e3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/tree_node.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package git - -import ( - "bytes" - "errors" - "fmt" - "strconv" -) - -type treeNode struct { - name string - mode ObjectMode - hash Hash -} - -func parseTreeNode(data []byte) (*treeNode, error) { - /* - data is in the format - \0 - */ - modeAndName, hash, found := bytes.Cut(data, []byte{0}) - if !found { - return nil, errors.New("parse tree node") - } - parsedHash, err := newHashFromBytes(hash) - if err != nil { - return nil, fmt.Errorf("parse tree node hash: %w", err) - } - mode, name, found := bytes.Cut(modeAndName, []byte{' '}) - if !found { - return nil, errors.New("parse tree node") - } - parsedFileMode, err := parseObjectMode(mode) - if err != nil { - return nil, fmt.Errorf("parse tree node object mode: %w", err) - } - return &treeNode{ - hash: parsedHash, - name: string(name), - mode: parsedFileMode, - }, nil -} - -func (e *treeNode) Name() string { - return e.name -} - -func (e *treeNode) Mode() ObjectMode { - return e.mode -} - -func (e *treeNode) Hash() Hash { - return e.hash -} - -// decodes the octal form of a object mode into one of the valid Mode* values. -func parseObjectMode(data []byte) (ObjectMode, error) { - mode, err := strconv.ParseUint(string(data), 8, 32) - if err != nil { - return 0, err - } - switch ObjectMode(mode) { - case ModeFile: - case ModeExe: - case ModeDir: - case ModeSymlink: - case ModeSubmodule: - default: - return 0, fmt.Errorf("unknown object mode: %o", mode) - } - return ObjectMode(mode), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/git/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/git/usage.gen.go deleted file mode 100644 index 9c7e3882f3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/git/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package git - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/env_authenticator.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/env_authenticator.go deleted file mode 100644 index 800d8b56c2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/env_authenticator.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "net/http" - - "github.com/bufbuild/buf/private/pkg/app" -) - -type envAuthenticator struct { - usernameKey string - passwordKey string -} - -func newEnvAuthenticator( - usernameKey string, - passwordKey string, -) *envAuthenticator { - return &envAuthenticator{ - usernameKey: usernameKey, - passwordKey: passwordKey, - } -} - -func (a *envAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) { - return setBasicAuth( - request, - envContainer.Env(a.usernameKey), - envContainer.Env(a.passwordKey), - a.usernameKey, - a.passwordKey, - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/httpauth.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/httpauth.go deleted file mode 100644 index 1b8122b590..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/httpauth.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "net/http" - - "github.com/bufbuild/buf/private/pkg/app" -) - -// Authenticator adds authentication to request. -// -// This could be instead replaced with a http.RoundTripper workflow, however -// this means we have to use the same http.Client, and we generally pass EnvContainers -// to functions right now, and not building objects with EnvContainers, so this would -// not fit in with the rest of this codebase. This should be re-evaluated though. -type Authenticator interface { - // SetAuth sets authentication on the request. - // - // Returns true if authentication successfully set. - // Does nothing and returns false if no authentication available for the given request. - // Does nothing and returns false if the request scheme is not https. - SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) -} - -// NewEnvAuthenticator returns a new env Authenticator for the environment. -func NewEnvAuthenticator(usernameKey string, passwordKey string) Authenticator { - return newEnvAuthenticator( - usernameKey, - passwordKey, - ) -} - -// NewNetrcAuthenticator returns a new netrc Authenticator. -func NewNetrcAuthenticator() Authenticator { - return newNetrcAuthenticator() -} - -// NewNopAuthenticator returns a new nop Authenticator. -// -// Always returns false and nil. -func NewNopAuthenticator() Authenticator { - return newNopAuthenticator() -} - -// NewMultiAuthenticator returns a new multi Authenticator. -// -// Stops on first matching SetAuth request. -func NewMultiAuthenticator(authenticators ...Authenticator) Authenticator { - return newMultiAuthenticator(authenticators...) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/multi_authenticator.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/multi_authenticator.go deleted file mode 100644 index 8ac6ae3ce1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/multi_authenticator.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "net/http" - - "github.com/bufbuild/buf/private/pkg/app" -) - -type multiAuthenticator struct { - authenticators []Authenticator -} - -func newMultiAuthenticator(authenticators ...Authenticator) *multiAuthenticator { - return &multiAuthenticator{ - authenticators: authenticators, - } -} - -func (a *multiAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) { - switch len(a.authenticators) { - case 0: - return false, nil - case 1: - return a.authenticators[0].SetAuth(envContainer, request) - default: - for _, authenticator := range a.authenticators { - ok, err := authenticator.SetAuth(envContainer, request) - if err != nil { - return false, err - } - if ok { - return true, nil - } - } - return false, nil - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/netrc_authenticator.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/netrc_authenticator.go deleted file mode 100644 index 6fd8b23221..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/netrc_authenticator.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "errors" - "net/http" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/bufbuild/buf/private/pkg/netrc" -) - -type netrcAuthenticator struct{} - -func newNetrcAuthenticator() *netrcAuthenticator { - return &netrcAuthenticator{} -} - -func (a *netrcAuthenticator) SetAuth(envContainer app.EnvContainer, request *http.Request) (bool, error) { - if request.URL == nil { - return false, errors.New("malformed request: no url") - } - if request.URL.Host == "" { - return false, errors.New("malformed request: no url host") - } - machine, err := netrc.GetMachineForName(envContainer, request.URL.Host) - if err != nil { - return false, err - } - if machine == nil { - return false, nil - } - return setBasicAuth( - request, - machine.Login(), - machine.Password(), - "netrc login for host", - "netrc password for host", - ) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/nop_authenticator.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/nop_authenticator.go deleted file mode 100644 index 31c9da579d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/nop_authenticator.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "net/http" - - "github.com/bufbuild/buf/private/pkg/app" -) - -type nopAuthenticator struct{} - -func newNopAuthenticator() *nopAuthenticator { - return &nopAuthenticator{} -} - -func (*nopAuthenticator) SetAuth(app.EnvContainer, *http.Request) (bool, error) { - return false, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/usage.gen.go deleted file mode 100644 index 6ed6ff1b0a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package httpauth - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/util.go b/vendor/github.com/bufbuild/buf/private/pkg/httpauth/util.go deleted file mode 100644 index 5346a99412..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/httpauth/util.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpauth - -import ( - "errors" - "fmt" - "net/http" -) - -func setBasicAuth( - request *http.Request, - username string, - password string, - usernameKey string, - passwordKey string, -) (bool, error) { - if request.URL == nil { - return false, errors.New("malformed request: no url") - } - if request.URL.Scheme == "" { - return false, errors.New("malformed request: no url scheme") - } - if request.URL.Scheme != "https" { - return false, nil - } - if username != "" && password != "" { - request.SetBasicAuth(username, password) - return true, nil - } - if username == "" && password == "" { - return false, nil - } - if password == "" { - return false, fmt.Errorf("%s set but %s not set", usernameKey, passwordKey) - } - return false, fmt.Errorf("%s set but %s not set", passwordKey, usernameKey) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt.go b/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt.go deleted file mode 100644 index f1759e7c2d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package interrupt - -import ( - "context" - "os" - "os/signal" -) - -var signals = append( - []os.Signal{ - os.Interrupt, - }, - extraSignals..., -) - -// WithCancel returns a context that is cancelled if interrupt signals are sent. -func WithCancel(ctx context.Context) (context.Context, context.CancelFunc) { - signalC, closer := NewSignalChannel() - ctx, cancel := context.WithCancel(ctx) - go func() { - <-signalC - closer() - cancel() - }() - return ctx, cancel -} - -// NewSignalChannel returns a new channel for interrupt signals. -// -// Call the returned function to cancel sending to this channel. -func NewSignalChannel() (<-chan os.Signal, func()) { - signalC := make(chan os.Signal, 1) - signal.Notify(signalC, signals...) - return signalC, func() { - signal.Stop(signalC) - close(signalC) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_unix.go b/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_unix.go deleted file mode 100644 index e9e9bea235..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_unix.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6 - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package interrupt - -import ( - "os" - "syscall" -) - -// extraSignals are signals beyond os.Interrupt that we want to be handled -// as interrupts. -// -// For unix-like platforms, this adds syscall.SIGTERM, although this is only -// tested on darwin and linux, which buf officially supports. Other unix-like -// platforms should have this as well, however. -var extraSignals = []os.Signal{ - syscall.SIGTERM, -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_windows.go b/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_windows.go deleted file mode 100644 index 93a6e45baa..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/interrupt_windows.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package interrupt - -import "os" - -// extraSignals are signals beyond os.Interrupt that we want to be handled -// as interrupts. -// -// For unix-like platforms, this adds syscall.SIGTERM, although this is only -// tested on darwin and linux, which buf officially supports. Other unix-like -// platforms should have this as well, however. -var extraSignals = []os.Signal{} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/interrupt/usage.gen.go deleted file mode 100644 index a66c228ec9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/interrupt/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package interrupt - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/ioextended/ioextended.go b/vendor/github.com/bufbuild/buf/private/pkg/ioextended/ioextended.go deleted file mode 100644 index 210db4705d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/ioextended/ioextended.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ioextended provides io utilities. -package ioextended - -import ( - "bytes" - "io" - "sync" - - "go.uber.org/multierr" -) - -var ( - // DiscardReader is an io.Reader in which all calls return 0 and io.EOF. - DiscardReader io.Reader = discardReader{} - // DiscardReadCloser is an io.ReadCloser in which all calls return 0 and io.EOF. - DiscardReadCloser io.ReadCloser = io.NopCloser(DiscardReader) - // DiscardWriteCloser is a discard io.WriteCloser. - DiscardWriteCloser io.WriteCloser = NopWriteCloser(io.Discard) - // NopCloser is a no-op closer. - NopCloser = nopCloser{} -) - -// NopWriteCloser returns an io.WriteCloser with a no-op Close method wrapping the provided io.Writer. -func NopWriteCloser(writer io.Writer) io.WriteCloser { - return nopWriteCloser{Writer: writer} -} - -// LockedWriter creates a locked Writer. -func LockedWriter(writer io.Writer) io.Writer { - return &lockedWriter{writer: writer} -} - -// CompositeReadCloser returns a io.ReadCloser that is a composite of the Reader and Closer. -func CompositeReadCloser(reader io.Reader, closer io.Closer) io.ReadCloser { - return compositeReadCloser{Reader: reader, Closer: closer} -} - -// CompositeWriteCloser returns a io.WriteCloser that is a composite of the Writer and Closer. -func CompositeWriteCloser(writer io.Writer, closer io.Closer) io.WriteCloser { - return compositeWriteCloser{Writer: writer, Closer: closer} -} - -// ChainCloser chains the closers by calling them in order. -func ChainCloser(closers ...io.Closer) io.Closer { - return chainCloser{closers: closers} -} - -// ReaderAtForReader converts an io.Reader to an io.ReaderAt. -func ReaderAtForReader(reader io.Reader) (io.ReaderAt, error) { - if readerAt, ok := reader.(io.ReaderAt); ok { - return readerAt, nil - } - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return bytes.NewReader(data), nil -} - -type discardReader struct{} - -func (discardReader) Read([]byte) (int, error) { - return 0, io.EOF -} - -type nopWriteCloser struct { - io.Writer -} - -func (nopWriteCloser) Close() error { - return nil -} - -type nopCloser struct{} - -func (nopCloser) Close() error { - return nil -} - -type lockedWriter struct { - writer io.Writer - lock sync.Mutex -} - -func (l *lockedWriter) Write(p []byte) (int, error) { - l.lock.Lock() - n, err := l.writer.Write(p) - l.lock.Unlock() - return n, err -} - -type compositeReadCloser struct { - io.Reader - io.Closer -} - -type compositeWriteCloser struct { - io.Writer - io.Closer -} - -type chainCloser struct { - closers []io.Closer -} - -func (c chainCloser) Close() error { - var err error - for _, closer := range c.closers { - err = multierr.Append(err, closer.Close()) - } - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/ioextended/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/ioextended/usage.gen.go deleted file mode 100644 index d1e873e19f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/ioextended/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package ioextended - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/manifest/blob.go b/vendor/github.com/bufbuild/buf/private/pkg/manifest/blob.go deleted file mode 100644 index 75c6d7cb38..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/manifest/blob.go +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package manifest - -import ( - "bytes" - "context" - "fmt" - "io" - "os" - - "go.uber.org/multierr" -) - -// Blob is an anonymous file associated with a digest. -type Blob interface { - Digest() *Digest - Open(context.Context) (io.ReadCloser, error) -} - -type memoryBlob struct { - digest Digest - content []byte -} - -var _ Blob = (*memoryBlob)(nil) - -type memoryBlobOptions struct { - validateDigest bool -} - -// MemoryBlobOption are options passed when creating a new memory blob. -type MemoryBlobOption func(*memoryBlobOptions) - -// MemoryBlobWithDigestValidation checks that the passed content and digest match. -func MemoryBlobWithDigestValidation() MemoryBlobOption { - return func(opts *memoryBlobOptions) { - opts.validateDigest = true - } -} - -// NewMemoryBlob takes a digest and a content, and turns it into an in-memory -// representation of a blob, which returns the digest and an io.ReadCloser for -// its content. -func NewMemoryBlob(digest Digest, content []byte, opts ...MemoryBlobOption) (Blob, error) { - var config memoryBlobOptions - for _, option := range opts { - option(&config) - } - if config.validateDigest { - digester, err := NewDigester(digest.Type()) - if err != nil { - return nil, err - } - contentDigest, err := digester.Digest(bytes.NewReader(content)) - if err != nil { - return nil, err - } - if !digest.Equal(*contentDigest) { - return nil, fmt.Errorf("digest and content mismatch") - } - } - return &memoryBlob{ - digest: digest, - content: content, - }, nil -} - -func (b *memoryBlob) Digest() *Digest { - if b == nil { - return nil - } - return &b.digest -} - -func (b *memoryBlob) Open(context.Context) (io.ReadCloser, error) { - if b == nil { - return nil, os.ErrNotExist - } - return io.NopCloser(bytes.NewReader(b.content)), nil -} - -// BlobSet represents a set of deduplicated blobs by their digests. -type BlobSet struct { - digestToBlob map[string]Blob -} - -type blobSetOptions struct { - validateContent bool - skipNilBlobs bool -} - -// BlobSetOption are options passed when creating a new blob set. -type BlobSetOption func(*blobSetOptions) - -// BlobSetWithContentValidation turns on content validation for all the blobs -// when creating a new BlobSet. If this option is on, blobs with the same digest -// must have the same content (in case blobs with the same digest are sent). If -// this option is not passed, then the latest duplicated blob digest content -// will prevail in the set. -func BlobSetWithContentValidation() BlobSetOption { - return func(opts *blobSetOptions) { - opts.validateContent = true - } -} - -// BlobSetWithSkipNilBlobs allows passing nil blobs in the slice of blobs. The default behavior is -// that if you pass a nil blob in the slice, you'll get an error from the `NewBlobSet` constructor. -// If you pass this option, any nil blob will be skipped and the blob set will be built only from -// the non-nil ones. -func BlobSetWithSkipNilBlobs() BlobSetOption { - return func(opts *blobSetOptions) { - opts.skipNilBlobs = true - } -} - -// NewBlobSet receives a slice of blobs, and de-duplicates them into a BlobSet. -func NewBlobSet(ctx context.Context, blobs []Blob, opts ...BlobSetOption) (*BlobSet, error) { - var config blobSetOptions - for _, option := range opts { - option(&config) - } - digestToBlobs := make(map[string]Blob, len(blobs)) - for i, b := range blobs { - if b == nil { - if config.skipNilBlobs { - continue - } - return nil, fmt.Errorf("blobs[%d]: nil blob", i) - } - digestStr := b.Digest().String() - if config.validateContent { - existingBlob, alreadyPresent := digestToBlobs[digestStr] - if alreadyPresent { - equalContent, err := BlobEqual(ctx, b, existingBlob) - if err != nil { - return nil, fmt.Errorf("compare duplicated blobs with digest %q: %w", digestStr, err) - } - if !equalContent { - return nil, fmt.Errorf("duplicated blobs with digest %q have different contents", digestStr) - } - } - } - digestToBlobs[digestStr] = b - } - return &BlobSet{digestToBlob: digestToBlobs}, nil -} - -// BlobFor returns the blob for the passed digest string, or nil, ok=false if -// the digest has no blob in the set. -func (s *BlobSet) BlobFor(digest string) (Blob, bool) { - blob, ok := s.digestToBlob[digest] - if !ok { - return nil, false - } - return blob, true -} - -// Blobs returns a slice of the blobs in the set. -func (s *BlobSet) Blobs() []Blob { - blobs := make([]Blob, 0, len(s.digestToBlob)) - for _, b := range s.digestToBlob { - blobs = append(blobs, b) - } - return blobs -} - -// NewMemoryBlobFromReader creates a memory blob from content, which is read -// until completion. The returned blob contains all bytes read. If you are using -// this in a loop, you might better use NewMemoryBlobFromReaderWithDigester so -// you can reuse your digester. -func NewMemoryBlobFromReader(content io.Reader) (Blob, error) { - digester, err := NewDigester(DigestTypeShake256) - if err != nil { - return nil, err - } - return NewMemoryBlobFromReaderWithDigester(content, digester) -} - -// NewMemoryBlobFromReaderWithDigester creates a memory blob from content with -// the passed digester. The content is read until completion. The returned blob -// contains all bytes read. -func NewMemoryBlobFromReaderWithDigester(content io.Reader, digester Digester) (Blob, error) { - var contentInMemory bytes.Buffer - tee := io.TeeReader(content, &contentInMemory) - digest, err := digester.Digest(tee) - if err != nil { - return nil, err - } - return &memoryBlob{ - digest: *digest, - content: contentInMemory.Bytes(), - }, nil -} - -// BlobEqual returns true if blob a is the same as blob b. The digest is -// checked for equality and the content bytes compared. -// -// An error is returned if an unexpected I/O error occurred when opening, -// reading, or closing either blob. -func BlobEqual(ctx context.Context, a, b Blob) (_ bool, retErr error) { - const blockSize = 4096 - if !a.Digest().Equal(*b.Digest()) { - // digests don't match - return false, nil - } - aFile, err := a.Open(ctx) - if err != nil { - return false, err - } - defer func() { retErr = multierr.Append(retErr, aFile.Close()) }() - bFile, err := b.Open(ctx) - if err != nil { - return false, err - } - defer func() { retErr = multierr.Append(retErr, bFile.Close()) }() - // Read blockSize from a, then from b, and compare. - aBlock := make([]byte, blockSize) - bBlock := make([]byte, blockSize) - for { - aN, aErr := aFile.Read(aBlock) - bN, bErr := io.ReadAtLeast(bFile, bBlock[:aN], aN) // exactly aN bytes - // We're running unexpected error processing (not EOF) before comparing - // bytes because it doesn't matter if the returned bytes match if an - // error occurred before an expected EOF. - if bErr == io.ErrUnexpectedEOF { - // b is shorter; we can error early - return false, nil - } - if aErr != nil && aErr != io.EOF { - // unexpected read error - return false, aErr - } - if bErr != nil && bErr != io.EOF { - // unexpected read error - return false, bErr - } - if !bytes.Equal(aBlock[:aN], bBlock[:bN]) { - // Read content doesn't match. - return false, nil - } - if aErr == io.EOF || bErr == io.EOF { - // EOF - break - } - } - aN, aErr := aFile.Read(aBlock[:1]) - bN, bErr := bFile.Read(bBlock[:1]) - if aN == 0 && bN == 0 && aErr == io.EOF && bErr == io.EOF { - // a and b are at EOF with no more data for us - return true, nil - } - // either a or b are longer - return false, multierr.Append(nilEOF(aErr), nilEOF(bErr)) -} - -// nilEOF maps io.EOF to nil -func nilEOF(err error) error { - if err == io.EOF { - return nil - } - return err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/manifest/digest.go b/vendor/github.com/bufbuild/buf/private/pkg/manifest/digest.go deleted file mode 100644 index 25522d543e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/manifest/digest.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package manifest - -import ( - "bytes" - "encoding/hex" - "errors" - "fmt" - "io" - "strings" - - "golang.org/x/crypto/sha3" -) - -// DigestType is the type for digests in this package. -type DigestType string - -const ( - DigestTypeShake256 DigestType = "shake256" - - shake256Length = 64 -) - -// Digest represents a hash function's value. -type Digest struct { - dtype DigestType - digest []byte - hexstr string -} - -// NewDigestFromBytes builds a digest from a type and the digest bytes. -func NewDigestFromBytes(dtype DigestType, digest []byte) (*Digest, error) { - if dtype == "" { - return nil, errors.New("digest type cannot be empty") - } - if dtype != DigestTypeShake256 { - return nil, fmt.Errorf("unsupported digest type: %q", dtype) - } - if len(digest) != shake256Length { - return nil, fmt.Errorf( - "invalid digest: got %d bytes, expected %d bytes for type %q", - len(digest), shake256Length, dtype, - ) - } - return &Digest{ - dtype: dtype, - digest: digest, - hexstr: hex.EncodeToString(digest), - }, nil -} - -// NewDigestFromHex builds a digest from a type and the hexadecimal string of -// the bytes. It returns an error if the received string is not a valid hex. -func NewDigestFromHex(dtype DigestType, hexstr string) (*Digest, error) { - digest, err := hex.DecodeString(hexstr) - if err != nil { - return nil, err - } - return NewDigestFromBytes(dtype, digest) -} - -// NewDigestFromString build a digest from a string representation of it. -func NewDigestFromString(typedDigest string) (*Digest, error) { - dtype, hexstr, found := strings.Cut(typedDigest, ":") - if !found { - return nil, errors.New("malformed digest string") - } - return NewDigestFromHex(DigestType(dtype), hexstr) -} - -// String returns the hash in a manifest's string format: ":". -func (d *Digest) String() string { - return string(d.dtype) + ":" + d.hexstr -} - -// Type returns the digest type. -func (d *Digest) Type() DigestType { - return d.dtype -} - -// Bytes returns the digest bytes. -func (d *Digest) Bytes() []byte { - return d.digest -} - -// Hex returns the digest bytes in its hexadecimal string representation. -func (d *Digest) Hex() string { - return d.hexstr -} - -// Equal compares the digest type and bytes with other digest. -func (d *Digest) Equal(other Digest) bool { - return d.dtype == other.dtype && bytes.Equal(d.digest, other.digest) -} - -// Digester is something that can digest a content into a digest. -type Digester interface { - Digest(content io.Reader) (*Digest, error) -} - -type shake256Digester struct { - hash sha3.ShakeHash -} - -// NewDigester returns a digester of the requested type. -func NewDigester(dtype DigestType) (Digester, error) { - if dtype != DigestTypeShake256 { - return nil, fmt.Errorf("not supported digest type %q", dtype) - } - return &shake256Digester{hash: sha3.NewShake256()}, nil -} - -func (d *shake256Digester) Digest(content io.Reader) (*Digest, error) { - d.hash.Reset() - if _, err := io.Copy(d.hash, content); err != nil { - return nil, err - } - digest := make([]byte, shake256Length) - if _, err := d.hash.Read(digest); err != nil { - // sha3.ShakeHash never errors or short reads. Something horribly wrong - // happened if your computer ended up here. - return nil, err - } - return NewDigestFromBytes(DigestTypeShake256, digest) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/manifest/manifest.go b/vendor/github.com/bufbuild/buf/private/pkg/manifest/manifest.go deleted file mode 100644 index 33081f74a0..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/manifest/manifest.go +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// A manifest is a file containing a list of paths and their hash digests, -// canonically ordered by path in increasing lexicographical order. Manifests -// are encoded as: -// -// :[SP][SP][LF] -// -// "shake256" is the only supported digest type. The digest is 64 bytes of hex -// encoded output of SHAKE256. See golang.org/x/crypto/sha3 and FIPS 202 for -// details on the SHAKE hash. -// -// [Manifest] can read and write manifest files. Canonical form is produced -// when serialized ([Manifest.MarshalText]). Non-canonical form is a valid -// manifest and will not produce errors when deserializing. -// -// Interacting with a manifest is typically by path ([Manifest.Paths], -// [Manifest.DigestFor]) or by a [Digest] ([Manifest.PathsFor]). -// -// [Blob] represents file content and its digest. [BlobSet] collects related -// blobs together into a set. [NewMemoryBlob] provides an in-memory -// implementation. A manifest, being a file, is also a blob ([Manifest.Blob]). -// -// Blobs are anonymous files and a manifest gives names to anonymous files. -// It's possible to view a manifest and its associated blobs as a file system. -// [NewBucket] creates a storage bucket from a manifest and blob set. -// [NewFromBucket] does the inverse: the creation of a manifest and blob set -// from a storage bucket. -package manifest - -import ( - "bufio" - "bytes" - "context" - "encoding" - "errors" - "fmt" - "io" - "sort" - "strings" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "go.uber.org/multierr" -) - -var errNoFinalNewline = errors.New("partial record: missing newline") - -func newError(lineno int, msg string) error { - return fmt.Errorf("invalid manifest: %d: %s", lineno, msg) -} - -func newErrorWrapped(lineno int, err error) error { - return fmt.Errorf("invalid manifest: %d: %w", lineno, err) -} - -// Manifest represents a list of paths and their digests. -type Manifest struct { - // needed for ordering - paths []string - pathToDigest map[string]Digest - digestToPaths map[string][]string -} - -var _ encoding.TextMarshaler = (*Manifest)(nil) -var _ encoding.TextUnmarshaler = (*Manifest)(nil) - -// NewFromReader builds a manifest from an encoded manifest, like one produced -// by [Manifest.MarshalText]. -func NewFromReader(manifest io.Reader) (*Manifest, error) { - var m Manifest - scanner := bufio.NewScanner(manifest) - scanner.Split(splitManifest) - lineno := 0 - for scanner.Scan() { - lineno++ - encodedDigest, path, found := strings.Cut(scanner.Text(), " ") - if !found { - return nil, newError(lineno, "invalid entry") - } - digest, err := NewDigestFromString(encodedDigest) - if err != nil { - return nil, newErrorWrapped(lineno, err) - } - if err := m.AddEntry(path, *digest); err != nil { - return nil, newErrorWrapped(lineno, err) - } - } - if err := scanner.Err(); err != nil { - if err == errNoFinalNewline { - return nil, newError(lineno, "partial record") - } - return nil, err - } - return &m, nil -} - -// NewFromBucket creates a manifest and blob set from the bucket's files. Blobs -// in the blob set use the [DigestTypeShake256] digest. -func NewFromBucket( - ctx context.Context, - bucket storage.ReadBucket, -) (*Manifest, *BlobSet, error) { - var m Manifest - digester, err := NewDigester(DigestTypeShake256) - if err != nil { - return nil, nil, err - } - var blobs []Blob - if walkErr := bucket.Walk(ctx, "", func(info storage.ObjectInfo) (retErr error) { - path := info.Path() - obj, err := bucket.Get(ctx, path) - if err != nil { - return err - } - defer func() { retErr = multierr.Append(retErr, obj.Close()) }() - blob, err := NewMemoryBlobFromReaderWithDigester(obj, digester) - if err != nil { - return err - } - blobs = append(blobs, blob) - return m.AddEntry(path, *blob.Digest()) - }); walkErr != nil { - return nil, nil, walkErr - } - blobSet, err := NewBlobSet(ctx, blobs) // no need to pass validation options, we're building and digesting the blobs - if err != nil { - return nil, nil, err - } - return &m, blobSet, nil -} - -// AddEntry adds an entry to the manifest with a path and its digest. It fails -// if the path already exists in the manifest with a different digest. -func (m *Manifest) AddEntry(path string, digest Digest) error { - if path == "" { - return errors.New("empty path") - } - path, err := normalpath.NormalizeAndValidate(path) - if err != nil { - return fmt.Errorf("invalid path: %w", err) - } - if digest.Type() == "" || digest.Hex() == "" { - return errors.New("invalid digest") - } - if existingDigest, exists := m.pathToDigest[path]; exists { - if existingDigest.Equal(digest) { - return nil // same entry already in the manifest, nothing to do - } - return fmt.Errorf( - "cannot add digest %q for path %q (already associated to digest %q)", - digest.String(), path, existingDigest.String(), - ) - } - // Already guaranteed that the path is not in the slice due to above check - m.paths = append(m.paths, path) - if m.pathToDigest == nil { - m.pathToDigest = make(map[string]Digest) - } - m.pathToDigest[path] = digest - key := digest.String() - if m.digestToPaths == nil { - m.digestToPaths = make(map[string][]string) - } - m.digestToPaths[key] = append(m.digestToPaths[key], path) - return nil -} - -// Paths returns all unique paths in the manifest by insertion order. -func (m *Manifest) Paths() []string { - pathsCopy := make([]string, len(m.paths)) - copy(pathsCopy, m.paths) - return pathsCopy -} - -// Digests returns all unique digests in the manifest. -// Order is by insertion order. -func (m *Manifest) Digests() []Digest { - digests := make([]Digest, 0, len(m.digestToPaths)) - addedDigests := make(map[string]struct{}, len(m.digestToPaths)) - // Iterating over paths to guarantee ordering. - for _, path := range m.paths { - digest, ok := m.pathToDigest[path] - if !ok { - // This should be an error in the style of the rest of the codebase but - // this was refactored and we didn't want to change the function signature. - panic(fmt.Sprintf("path %q not present in pathToDigest", path)) - } - if _, alreadyAdded := addedDigests[digest.String()]; alreadyAdded { - continue - } - addedDigests[digest.String()] = struct{}{} - digests = append(digests, digest) - } - return digests -} - -// Range invokes a function for all the paths in the manifest, passing the path and its digest. -// Paths are invoked by insertion order. -// This func will stop iterating if an error is returned. -func (m *Manifest) Range(f func(path string, digest Digest) error) error { - // Iterating over paths to guarantee ordering. - for _, path := range m.paths { - digest, ok := m.pathToDigest[path] - if !ok { - // This should be an error in the style of the rest of the codebase but - // this was refactored and we didn't want to change the function signature. - panic(fmt.Sprintf("path %q not present in pathToDigest", path)) - } - if err := f(path, digest); err != nil { - return err - } - } - return nil -} - -// PathsFor returns one or more matching path for a given digest. The digest is -// expected to be a lower-case hex encoded value. Returned paths are ordered by insertion time. -// Paths is nil and ok is false if no paths are found. -func (m *Manifest) PathsFor(digest string) ([]string, bool) { - paths, ok := m.digestToPaths[digest] - if !ok || len(paths) == 0 { - return nil, false - } - return paths, true -} - -// DigestFor returns the matching digest for the given path. The path must be an -// exact match. Digest is nil and ok is false if no digest is found. -func (m *Manifest) DigestFor(path string) (*Digest, bool) { - digest, ok := m.pathToDigest[path] - if !ok { - return nil, false - } - return &digest, true -} - -// MarshalText encodes the manifest into its canonical form. -func (m *Manifest) MarshalText() ([]byte, error) { - var coded bytes.Buffer - paths := m.Paths() - sort.Strings(paths) - for _, path := range paths { - digest := m.pathToDigest[path] - if _, err := fmt.Fprintf(&coded, "%s %s\n", &digest, path); err != nil { - return nil, err - } - } - return coded.Bytes(), nil -} - -// UnmarshalText decodes a manifest from text. -// -// See [NewFromReader] if your manifest is available in an io.Reader. -func (m *Manifest) UnmarshalText(text []byte) error { - newm, err := NewFromReader(bytes.NewReader(text)) - if err != nil { - return err - } - m.paths = newm.paths - m.pathToDigest = newm.pathToDigest - m.digestToPaths = newm.digestToPaths - return nil -} - -// Blob returns the manifest as a blob. -func (m *Manifest) Blob() (Blob, error) { - manifestText, err := m.MarshalText() - if err != nil { - return nil, err - } - return NewMemoryBlobFromReader(bytes.NewReader(manifestText)) -} - -// Empty returns true if the manifest has no entries. -func (m *Manifest) Empty() bool { - return len(m.paths) == 0 && len(m.pathToDigest) == 0 && len(m.digestToPaths) == 0 -} - -func splitManifest(data []byte, atEOF bool) (int, []byte, error) { - // Return a line without LF. - if i := bytes.IndexByte(data, '\n'); i >= 0 { - return i + 1, data[0:i], nil - } - - // EOF occurred with a partial line. - if atEOF && len(data) != 0 { - return 0, nil, errNoFinalNewline - } - - return 0, nil, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/manifest/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/manifest/usage.gen.go deleted file mode 100644 index fe3b997004..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/manifest/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package manifest - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netextended/netextended.go b/vendor/github.com/bufbuild/buf/private/pkg/netextended/netextended.go deleted file mode 100644 index 4f0c7f85e8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netextended/netextended.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netextended - -import ( - "errors" - "fmt" - "net" -) - -const ( - domainNameMinLength = 2 - domainNameMaxLength = 254 - maxSegmentLength = 63 -) - -// ValidateHostname verifies the given hostname is a well-formed IP address -// or domain name, optionally including a port, and returns the hostname part. -func ValidateHostname(hostname string) (string, error) { - if len(hostname) == 0 { - return "", errors.New("must not be empty") - } - if len(hostname) < domainNameMinLength || len(hostname) > domainNameMaxLength { - return "", fmt.Errorf("must be at least %d and at most %d characters", domainNameMinLength, domainNameMaxLength) - } - - parsedHost := hostname - if host, _, err := net.SplitHostPort(hostname); err == nil { - parsedHost = host - } - if net.ParseIP(parsedHost) != nil { - // hostname is a valid IP address - return hostname, nil - } - if err := isValidDomainName(parsedHost); err != nil { - return "", fmt.Errorf("must either be a valid IP address or domain name: invalid domain name %q, %w", hostname, err) - } - return hostname, nil -} - -// isValidDomainName validates a hostname according to the requirements set for -// domain names internally in the Go standard library's net package, see -// golang.org/issue/12421. -// -// Adapted from https://github.com/golang/go/blob/f4e7a6b905ce60448e506a3f6578d01b60602cdd/src/net/dnsclient.go#L73-L128 -// See https://github.com/golang/go/blob/f4e7a6b905ce60448e506a3f6578d01b60602cdd/LICENSE for the license. -func isValidDomainName(hostname string) error { - previous := rune('.') - nonNumeric := false - segmentLen := 0 - for _, char := range hostname { - switch { - case '0' <= char && char <= '9': - segmentLen++ - case 'a' <= char && char <= 'z' || 'A' <= char && char <= 'Z' || char == '_': - nonNumeric = true - segmentLen++ - case char == '-': - if previous == '.' { - return fmt.Errorf("cannot begin a segment after a period (.) with a hyphen (-)") - } - nonNumeric = true - segmentLen++ - case char == '.': - if previous == '.' { - return fmt.Errorf("cannot contain two periods (.) in a row") - } - if previous == '-' { - return fmt.Errorf("cannot have a hyphen (-) immediately before a period (.)") - } - if segmentLen > maxSegmentLength { - return fmt.Errorf("cannot have segments greater than %v characters between periods (.)", maxSegmentLength) - } - segmentLen = 0 - default: - return fmt.Errorf("included invalid character %q, must only contain letters, digits, periods (.), hyphens (-), or underscores (_)", char) - } - previous = char - } - - if previous == '-' { - return fmt.Errorf("cannot have a hyphen (-) as the final character") - } - if segmentLen > maxSegmentLength { - return fmt.Errorf("cannot have segments greater than %v characters between periods (.)", maxSegmentLength) - } - if !nonNumeric { - return errors.New("must have at least one non-numeric character") - } - - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netextended/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/netextended/usage.gen.go deleted file mode 100644 index 976e877324..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netextended/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package netextended - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netrc/machine.go b/vendor/github.com/bufbuild/buf/private/pkg/netrc/machine.go deleted file mode 100644 index b857f0057e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netrc/machine.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netrc - -type machine struct { - name string - login string - password string -} - -func newMachine( - name string, - login string, - password string, -) *machine { - return &machine{ - name: name, - login: login, - password: password, - } -} - -func (m *machine) Name() string { - return m.name -} - -func (m *machine) Login() string { - return m.login -} - -func (m *machine) Password() string { - return m.password -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc.go b/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc.go deleted file mode 100644 index a920d26586..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package netrc contains functionality to work with netrc. -package netrc - -import ( - "io/fs" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/app" - "github.com/jdxcode/netrc" -) - -// Filename exposes the netrc filename based on the current operating system. -const Filename = netrcFilename - -// Machine is a machine. -type Machine interface { - // Empty for default machine. - Name() string - Login() string - Password() string -} - -// NewMachine creates a new Machine. -func NewMachine( - name string, - login string, - password string, -) Machine { - return newMachine(name, login, password) -} - -// GetMachineForName returns the Machine for the given name. -// -// Returns nil if no such Machine. -func GetMachineForName(envContainer app.EnvContainer, name string) (_ Machine, retErr error) { - filePath, err := GetFilePath(envContainer) - if err != nil { - return nil, err - } - return GetMachineForNameAndFilePath(name, filePath) -} - -// PutMachines adds the given Machines to the configured netrc file. -func PutMachines(envContainer app.EnvContainer, machines ...Machine) error { - filePath, err := GetFilePath(envContainer) - if err != nil { - return err - } - return putMachinesForFilePath(machines, filePath) -} - -// DeleteMachineForName deletes the Machine for the given name, if set. -// -// Returns false if there was no Machine for the given name. -func DeleteMachineForName(envContainer app.EnvContainer, name string) (bool, error) { - filePath, err := GetFilePath(envContainer) - if err != nil { - return false, err - } - return deleteMachineForFilePath(name, filePath) -} - -// GetFilePath gets the netrc file path for the given environment. -func GetFilePath(envContainer app.EnvContainer) (string, error) { - if netrcFilePath := envContainer.Env("NETRC"); netrcFilePath != "" { - return netrcFilePath, nil - } - homeDirPath, err := app.HomeDirPath(envContainer) - if err != nil { - return "", err - } - return filepath.Join(homeDirPath, netrcFilename), nil -} - -// GetMachineForNameAndFilePath returns the Machine for the given name from the -// file at the given path. -// -// Returns nil if no such Machine or no such file. -func GetMachineForNameAndFilePath(name string, filePath string) (_ Machine, retErr error) { - if _, err := os.Stat(filePath); err != nil { - if os.IsNotExist(err) { - return nil, nil - } - return nil, err - } - netrcStruct, err := netrc.Parse(filePath) - if err != nil { - return nil, err - } - netrcMachine := netrcStruct.Machine(name) - if netrcMachine == nil { - netrcMachine = netrcStruct.Machine("default") - if netrcMachine == nil { - return nil, nil - } - } - // We take the name from the read Machine just in case there's some case-insensitivity weirdness - machineName := netrcMachine.Name - if machineName == "default" { - machineName = "" - } - return newMachine( - machineName, - netrcMachine.Get("login"), - netrcMachine.Get("password"), - ), nil -} - -func putMachinesForFilePath(machines []Machine, filePath string) (retErr error) { - var netrcStruct *netrc.Netrc - fileInfo, err := os.Stat(filePath) - var fileMode fs.FileMode - if err != nil { - if os.IsNotExist(err) { - netrcStruct = &netrc.Netrc{} - fileMode = 0600 - } else { - return err - } - } else { - netrcStruct, err = netrc.Parse(filePath) - if err != nil { - return err - } - fileMode = fileInfo.Mode() - } - for _, machine := range machines { - if foundMachine := netrcStruct.Machine(machine.Name()); foundMachine != nil { - netrcStruct.RemoveMachine(machine.Name()) - } - netrcStruct.AddMachine( - machine.Name(), - machine.Login(), - machine.Password(), - ) - } - return os.WriteFile(filePath, []byte(netrcStruct.Render()), fileMode) -} - -func deleteMachineForFilePath(name string, filePath string) (_ bool, retErr error) { - fileInfo, err := os.Stat(filePath) - if err != nil { - if os.IsNotExist(err) { - // If a netrc file does not already exist, there's nothing to be done. - return false, nil - } - return false, err - } - netrcStruct, err := netrc.Parse(filePath) - if err != nil { - return false, err - } - if netrcStruct.Machine(name) == nil { - // Machine is not set, there is nothing to be done. - return false, nil - } - netrcStruct.RemoveMachine(name) - if err := os.WriteFile(filePath, []byte(netrcStruct.Render()), fileInfo.Mode()); err != nil { - return false, err - } - return true, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_unix.go b/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_unix.go deleted file mode 100644 index 84a5507ec1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_unix.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matching the unix-like build tags in the Golang source i.e. https://github.com/golang/go/blob/912f0750472dd4f674b69ca1616bfaf377af1805/src/os/file_unix.go#L6 - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package netrc - -// netrcFilename is the netrc filename. -// -// This will be .netrc for unix-like platforms including darwin. -// This will be _netrc for windows. -const netrcFilename = ".netrc" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_windows.go b/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_windows.go deleted file mode 100644 index f004a2de32..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netrc/netrc_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package netrc - -// netrcFilename is the netrc filename. -// -// This will be .netrc for darwin and linux. -// This will be _netrc for windows. -const netrcFilename = "_netrc" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/netrc/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/netrc/usage.gen.go deleted file mode 100644 index a09c86b34c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/netrc/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package netrc - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath.go b/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath.go deleted file mode 100644 index b763a34f7f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package normalpath provides functions similar to filepath. -// -// A normalized path is a cleaned and to-slash'ed path. -// A validated path validates that a path is relative and does not jump context. -package normalpath - -import ( - "errors" - "fmt" - "net/url" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/bufbuild/buf/private/pkg/stringutil" -) - -const ( - // Relative is the PathType for normalized and validated paths. - Relative PathType = 1 - // Absolute is the PathType for normalized and absolute paths. - Absolute PathType = 2 - - stringOSPathSeparator = string(os.PathSeparator) - // This has to be with "/" instead of os.PathSeparator as we use this on normalized paths - normalizedRelPathJumpContextPrefix = "../" -) - -var ( - // errNotRelative is the error returned if the path is not relative. - errNotRelative = errors.New("expected to be relative") - // errOutsideContextDir is the error returned if the path is outside the context directory. - errOutsideContextDir = errors.New("is outside the context directory") -) - -// PathType is a terminate type for path comparisons. -type PathType int - -// Separator gets the string value of the separator. -// -// TODO: rename to Terminator if we keep this -// TODO: we should probably refactor so we never need to use absolute paths at all -// this could be accomplished if we could for ExternalPathToRelPath on buckets -func (t PathType) Separator() string { - switch t { - case Relative: - return "." - case Absolute: - return "/" - default: - return "" - } -} - -// Error is a path error. -type Error struct { - Path string - Err error -} - -// NewError returns a new Error. -func NewError(path string, err error) *Error { - return &Error{ - Path: path, - Err: err, - } -} - -// Error implements error. -func (e *Error) Error() string { - errString := "" - if e.Err != nil { - errString = e.Err.Error() - } - if errString == "" { - errString = "error" - } - return e.Path + ": " + errString -} - -// Unwrap implements errors.Unwrap for Error. -func (e *Error) Unwrap() error { - if e == nil { - return nil - } - return e.Err -} - -// Normalize normalizes the given path. -// -// This calls filepath.Clean and filepath.ToSlash on the path. -// If the path is "" or ".", this returns ".". -func Normalize(path string) string { - return filepath.ToSlash(filepath.Clean(path)) -} - -// NormalizeAndAbsolute normalizes the path and makes it absolute. -func NormalizeAndAbsolute(path string) (string, error) { - absPath, err := filepath.Abs(Unnormalize(path)) - if err != nil { - return "", err - } - return Normalize(absPath), nil -} - -// NormalizeAndTransformForPathType calls NormalizeAndValidate for relative -// paths, and NormalizeAndAbsolute for absolute paths. -func NormalizeAndTransformForPathType(path string, pathType PathType) (string, error) { - switch pathType { - case Relative: - return NormalizeAndValidate(path) - case Absolute: - return NormalizeAndAbsolute(path) - default: - return "", fmt.Errorf("unknown PathType: %v", pathType) - } -} - -// Unnormalize unnormalizes the given path. -// -// This calls filepath.FromSlash on the path. -// If the path is "", this returns "". -func Unnormalize(path string) string { - return filepath.FromSlash(path) -} - -// Base is equivalent to filepath.Base. -// -// Normalizes before returning. -func Base(path string) string { - return Normalize(filepath.Base(Unnormalize(path))) -} - -// Dir is equivalent to filepath.Dir. -// -// Normalizes before returning. -func Dir(path string) string { - return Normalize(filepath.Dir(Unnormalize(path))) -} - -// Ext is equivalent to filepath.Ext. -// -// Can return empty string. -func Ext(path string) string { - return filepath.Ext(Unnormalize(path)) -} - -// Join is equivalent to filepath.Join. -// -// Empty strings are ignored, -// Can return empty string. -// -// Normalizes before returning otherwise. -func Join(paths ...string) string { - unnormalized := make([]string, len(paths)) - for i, path := range paths { - unnormalized[i] = Unnormalize(path) - } - value := filepath.Join(unnormalized...) - if value == "" { - return "" - } - return Normalize(value) -} - -// Rel is equivalent to filepath.Rel. -// -// Can return empty string, especially on error. -// -// Normalizes before returning otherwise. -func Rel(basepath string, targpath string) (string, error) { - path, err := filepath.Rel(Unnormalize(basepath), Unnormalize(targpath)) - if path == "" { - return "", err - } - return Normalize(path), err -} - -// ByDir maps the paths into a map from directory via Dir to the original paths. -// -// The paths for each value slice will be sorted. -// -// The path is expected to be normalized. -func ByDir(paths ...string) map[string][]string { - m := make(map[string][]string) - for _, path := range paths { - path = Normalize(path) - dir := filepath.Dir(path) - m[dir] = append(m[dir], path) - } - for _, dirPaths := range m { - sort.Strings(dirPaths) - } - return m -} - -// ChunkByDir splits paths into chunks of around the suggestedChunkSize while keeping -// directory affinity, i.e. paths in the same directory will be in the same chunk. -// -// Paths are expected to be normalized. -// If paths is nil or empty, returns empty. -// If suggestedChunkSize is <=0, returns [][]string{paths}. -func ChunkByDir(paths []string, suggestedChunkSize int) [][]string { - var chunks [][]string - if len(paths) == 0 { - return chunks - } - if suggestedChunkSize <= 0 { - return [][]string{paths} - } - - dirToPaths := ByDir(paths...) - // Get the keys and sort them to keep the output of this stable - dirs := make([]string, 0, len(dirToPaths)) - for dir := range dirToPaths { - dirs = append(dirs, dir) - } - sort.Strings(dirs) - // Create a slice of the per-directory path slices - pathsByDir := make([][]string, 0, len(dirToPaths)) - for _, dir := range dirs { - pathsByDir = append(pathsByDir, dirToPaths[dir]) - } - // Sort the per-directory path slices by length, from greatest to smallest - // We do greatest to smallest because we pop the greatest off first, and - // This will approximate keeping things in alphabetical order given that - // pathsByDir is in alphabetical order of directories. - sort.SliceStable( - pathsByDir, - func(i int, j int) bool { - return len(pathsByDir[i]) > len(pathsByDir[j]) - }, - ) - - for len(pathsByDir) > 0 { - // Take the largest set of paths and remove from pathsByDir - chunk := pathsByDir[0] - pathsByDir = pathsByDir[1:] - // While our current chunk is less than the suggestedChunkSize, take the smallest - // set of paths and append them to the chunk, and then remove them from pathsByDir - // - // This will mean that sometimes we have chunks larger than suggestedChunkSize, but - // this is best effort. We could likely use more-complicated algorithms here that - // smartly combine per-directory path sets that minimize the distance from - // suggestedChunkSize, as there are adversary cases to this algorithm, but we - // are not diving into that at the moment unless there is a need. - for len(chunk) < suggestedChunkSize && len(pathsByDir) > 0 { - chunk = append(chunk, pathsByDir[len(pathsByDir)-1]...) - pathsByDir = pathsByDir[:len(pathsByDir)-1] - } - // Append the chunk to the list of chunks - chunks = append(chunks, chunk) - } - - return chunks -} - -// ContainsPath returns true if the dirPath contains the path. -// -// The path and value are expected to be normalized and validated if Relative is used. -// The path and value are expected to be normalized and absolute if Absolute is used. -// -// For a given dirPath: -// -// - If path == PathType, dirPath does not contain the path. -// - If dirPath == PathType, the dirPath contains the path. -// - If dirPath is a directory that contains path, this returns true. -func ContainsPath(dirPath string, path string, pathType PathType) bool { - if dirPath == path { - return false - } - return EqualsOrContainsPath(dirPath, Dir(path), pathType) -} - -// MapAllEqualOrContainingPaths returns the matching paths in the map in a sorted slice. -// -// The path and keys in m are expected to be normalized and validated if Relative is used. -// The path and keys in m are expected to be normalized and absolute if Absolute is used. -// -// If the map is empty, returns nil. -func MapAllEqualOrContainingPaths(m map[string]struct{}, path string, pathType PathType) []string { - if len(m) == 0 { - return nil - } - return stringutil.MapToSortedSlice(MapAllEqualOrContainingPathMap(m, path, pathType)) -} - -// StripComponents strips the specified number of components. -// -// Path expected to be normalized. -// Returns false if the path does not have more than the specified number of components. -func StripComponents(path string, countUint32 uint32) (string, bool) { - count := int(countUint32) - if count == 0 { - return path, true - } - components := Components(path) - if len(components) <= count { - return "", false - } - return Join(components[count:]...), true -} - -// ValidatePathComponent validates that the string is a valid -// component of a path, e.g. it can be Joined and form a valid path. -func ValidatePathComponent(component string) error { - if component == "" { - return errors.New("path component must not be empty") - } - if strings.ContainsRune(component, '/') { - return errors.New(`path component must not contain "/" `) - } - if strings.Contains(component, "..") { - return errors.New(`path component must not contain ".."`) - } - if url.PathEscape(component) != component { - return fmt.Errorf( - "path component must match its URL escaped version: %q did not match %q", - component, - url.PathEscape(component), - ) - } - return nil -} - -// ValidatePathComponents validates that all the strings are valid -// components of a path, e.g. they can be Joined and form a valid path. -func ValidatePathComponents(components ...string) error { - for _, component := range components { - if err := ValidatePathComponent(component); err != nil { - return err - } - } - return nil -} - -// ValidatePathsNormalizedValidatedUnique validates the file or diretory paths are normalized -// and validated, and not duplicated. -func ValidatePathsNormalizedValidatedUnique(paths []string) error { - pathMap := make(map[string]struct{}, len(paths)) - for _, path := range paths { - if path == "" { - return errors.New("path is empty") - } - normalized, err := NormalizeAndValidate(path) - if err != nil { - return fmt.Errorf("path had normalization error: %w", err) - } - if path != normalized { - return fmt.Errorf("path %s was not normalized to %s", path, normalized) - } - if _, ok := pathMap[path]; ok { - return fmt.Errorf("duplicate path: %s", path) - } - pathMap[path] = struct{}{} - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_unix.go b/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_unix.go deleted file mode 100644 index faa344e374..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_unix.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Matching the unix-like build tags in the Golang standard library based on the dependency -// on "path/filepath", i.e. https://cs.opensource.google/go/go/+/refs/tags/go1.17:src/path/filepath/path_unix.go;l=5-6 - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package normalpath - -import ( - "path/filepath" - "strings" -) - -// NormalizeAndValidate normalizes and validates the given path. -// -// This calls Normalize on the path. -// Returns Error if the path is not relative or jumps context. -// This can be used to validate that paths are valid to use with Buckets. -// The error message is safe to pass to users. -func NormalizeAndValidate(path string) (string, error) { - normalizedPath := Normalize(path) - if filepath.IsAbs(normalizedPath) { - return "", NewError(path, errNotRelative) - } - // https://github.com/bufbuild/buf/issues/51 - if strings.HasPrefix(normalizedPath, normalizedRelPathJumpContextPrefix) { - return "", NewError(path, errOutsideContextDir) - } - return normalizedPath, nil -} - -// EqualsOrContainsPath returns true if the value is equal to or contains the path. -// -// The path and value are expected to be normalized and validated if Relative is used. -// The path and value are expected to be normalized and absolute if Absolute is used. -func EqualsOrContainsPath(value string, path string, pathType PathType) bool { - pathRoot := stringOSPathSeparator - if pathType == Relative { - pathRoot = "." - } - - if value == pathRoot { - return true - } - - // Walk up the path and compare at each directory level until there is a - // match or the path reaches its root (either `/` or `.`). - for curPath := path; curPath != pathRoot; curPath = Dir(curPath) { - if value == curPath { - return true - } - } - return false -} - -// MapHasEqualOrContainingPath returns true if the path matches any file or directory in the map. -// -// The path and keys in m are expected to be normalized and validated if Relative is used. -// The path and keys in m are expected to be normalized and absolute if Absolute is used. -// -// If the map is empty, returns false. -func MapHasEqualOrContainingPath(m map[string]struct{}, path string, pathType PathType) bool { - if len(m) == 0 { - return false - } - - pathRoot := stringOSPathSeparator - if pathType == Relative { - pathRoot = "." - } - - if _, ok := m[pathRoot]; ok { - return true - } - for curPath := path; curPath != pathRoot; curPath = Dir(curPath) { - if _, ok := m[curPath]; ok { - return true - } - } - return false -} - -// MapAllEqualOrContainingPathMap returns the paths in m that are equal to, or contain -// path, in a new map. -// -// The path and keys in m are expected to be normalized and validated if Relative is used. -// The path and keys in m are expected to be normalized and absolute if Absolute is used. -// -// If the map is empty, returns nil. -func MapAllEqualOrContainingPathMap(m map[string]struct{}, path string, pathType PathType) map[string]struct{} { - if len(m) == 0 { - return nil - } - - pathRoot := stringOSPathSeparator - if pathType == Relative { - pathRoot = "." - } - - n := make(map[string]struct{}) - if _, ok := m[pathRoot]; ok { - // also covers if path == separator. - n[pathRoot] = struct{}{} - } - for potentialMatch := range m { - for curPath := path; curPath != pathRoot; curPath = Dir(curPath) { - if potentialMatch == curPath { - n[potentialMatch] = struct{}{} - break - } - } - } - return n -} - -// Components splits the path into it's components. -// -// This calls filepath.Split repeatedly. -// -// The path is expected to be normalized. -func Components(path string) []string { - var components []string - dir := Unnormalize(path) - for { - var file string - dir, file = filepath.Split(dir) - // puts in reverse - components = append(components, file) - if dir == stringOSPathSeparator { - components = append(components, dir) - break - } - dir = strings.TrimSuffix(dir, stringOSPathSeparator) - if dir == "" { - break - } - } - // https://github.com/golang/go/wiki/SliceTricks#reversing - for i := len(components)/2 - 1; i >= 0; i-- { - opp := len(components) - 1 - i - components[i], components[opp] = components[opp], components[i] - } - for i, component := range components { - components[i] = Normalize(component) - } - return components -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_windows.go b/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_windows.go deleted file mode 100644 index 668146434b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/normalpath_windows.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package normalpath - -import ( - "os" - "path/filepath" - "strings" -) - -// NormalizeAndValidate normalizes and validates the given path. -// -// This calls Normalize on the path. -// Returns Error if the path is not relative or jumps context. -// This can be used to validate that paths are valid to use with Buckets. -// The error message is safe to pass to users. -func NormalizeAndValidate(path string) (string, error) { - normalizedPath := Normalize(path) - if filepath.IsAbs(normalizedPath) || (len(normalizedPath) > 0 && normalizedPath[0] == '/') { - // the stdlib implementation of `IsAbs` assumes that a volume name is required for a path to - // be absolute, however Windows treats a `/` (normalized) rooted path as absolute _within_ the current volume. - // In the context of validating that a path is _not_ relative, we need to reject a path that begins - // with `/`. - return "", NewError(path, errNotRelative) - } - // https://github.com/bufbuild/buf/issues/51 - if strings.HasPrefix(normalizedPath, normalizedRelPathJumpContextPrefix) { - return "", NewError(path, errOutsideContextDir) - } - return normalizedPath, nil -} - -// EqualsOrContainsPath returns true if the value is equal to or contains the path. -// path is compared at each directory level to value for equivalency under simple unicode -// codepoint folding. This means it is context and locale independent. This matching -// will not support the few rare cases, primarily in Turkish and Lithuanian, noted -// in the caseless matching section of Unicode 13.0 https://www.unicode.org/versions/Unicode13.0.0/ch05.pdf#page=47. -// -// The path and value are expected to be normalized and validated if Relative is used. -// The path and value are expected to be normalized and absolute if Absolute is used. -func EqualsOrContainsPath(value string, path string, pathType PathType) bool { - curPath := path - var lastSeen string - for { - if strings.EqualFold(value, curPath) { - return true - } - curPath = Dir(curPath) - if lastSeen == curPath { - break - } - lastSeen = curPath - } - return false -} - -// MapHasEqualOrContainingPath returns true if the path matches any file or directory in the map. -// -// The path and keys in m are expected to be normalized and validated if Relative is used. -// The path and keys in m are expected to be normalized and absolute if Absolute is used. -// -// If the map is empty, returns false. -func MapHasEqualOrContainingPath(m map[string]struct{}, path string, pathType PathType) bool { - if len(m) == 0 { - return false - } - - for value := range m { - if EqualsOrContainsPath(value, path, pathType) { - return true - } - } - - return false -} - -// MapAllEqualOrContainingPathMap returns the paths in m that are equal to, or contain -// path, in a new map. -// -// The path and keys in m are expected to be normalized and validated if Relative is used. -// The path and keys in m are expected to be normalized and absolute if Absolute is used. -// -// If the map is empty, returns nil. -func MapAllEqualOrContainingPathMap(m map[string]struct{}, path string, pathType PathType) map[string]struct{} { - if len(m) == 0 { - return nil - } - - n := make(map[string]struct{}) - - for potentialMatch := range m { - if EqualsOrContainsPath(potentialMatch, path, pathType) { - n[potentialMatch] = struct{}{} - } - } - return n -} - -// Components splits the path into its components. -// -// This calls filepath.Split repeatedly. -// -// The path is expected to be normalized. -func Components(path string) []string { - var components []string - - if len(path) < 1 { - return []string{"."} - } - - dir := Unnormalize(path) - - volumeComponent := filepath.VolumeName(dir) - if len(volumeComponent) > 0 { - // On Windows the volume of an absolute path could be one of the following 3 forms - // c.f. https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#fully-qualified-vs-relative-paths - // * A disk designator: `C:\` - // * A UNC Path: `\\servername\share\` - // c.f. https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dfsc/149a3039-98ce-491a-9268-2f5ddef08192 - // * A "current volume absolute path" `\` - // This refers to the root of the current volume - // - // We do not support paths with string parsing disabled such as - // `\\?\path` - // - // If we did extract a volume name, we need to add a path separator to turn it into - // a path component. Volume Names without path separators have an implied "current directory" - // when performing a join operation, or using them as a path directly, which is not the - // intention of `Split` so we ensure they always mean "the root of this volume". - volumeComponent = volumeComponent + stringOSPathSeparator - } - if len(volumeComponent) < 1 && dir[0] == os.PathSeparator { - // If we didn't extract a volume name then the path is either - // absolute and starts with an os.PathSeparator (it must be exactly 1 - // otherwise its a UNC path and we would have found a volume above) or it is relative. - // If it is absolute, we set the expected volume component to os.PathSeparator. - // otherwise we leave it as an empty string. - volumeComponent = stringOSPathSeparator - } - for { - var file string - dir, file = filepath.Split(dir) - // puts in reverse - components = append(components, file) - - if dir == volumeComponent { - if volumeComponent != "" { - components = append(components, dir) - } - break - } - - dir = strings.TrimSuffix(dir, stringOSPathSeparator) - } - - // https://github.com/golang/go/wiki/SliceTricks#reversing - for i := len(components)/2 - 1; i >= 0; i-- { - opp := len(components) - 1 - i - components[i], components[opp] = components[opp], components[i] - } - for i, component := range components { - components[i] = Normalize(component) - } - - return components -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/normalpath/usage.gen.go deleted file mode 100644 index 70de38ae13..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/normalpath/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package normalpath - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/observabilityzap.go b/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/observabilityzap.go deleted file mode 100644 index e372390b86..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/observabilityzap.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observabilityzap - -import ( - "io" - - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/propagation" - sdktrace "go.opentelemetry.io/otel/sdk/trace" - "go.opentelemetry.io/otel/trace" - "go.uber.org/zap" -) - -// TracerProviderCloser is used to wrap a trace.TracerProvider with an io.Closer to use on shutdown. -type TracerProviderCloser interface { - trace.TracerProvider - io.Closer -} - -// Start creates a Zap logging exporter for Opentelemetry traces and returns -// the exporter. The exporter implements io.Closer for clean-up. -func Start(logger *zap.Logger) TracerProviderCloser { - exporter := newZapExporter(logger) - tracerProviderOptions := []sdktrace.TracerProviderOption{ - sdktrace.WithSampler(sdktrace.AlwaysSample()), - sdktrace.WithSpanProcessor(sdktrace.NewBatchSpanProcessor(exporter)), - } - tracerProvider := newTracerProviderCloser(sdktrace.NewTracerProvider(tracerProviderOptions...)) - otel.SetTracerProvider(tracerProvider) - otel.SetTextMapPropagator(propagation.TraceContext{}) - return tracerProvider -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/tracer_provider_closer.go b/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/tracer_provider_closer.go deleted file mode 100644 index d5045cb7e5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/tracer_provider_closer.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observabilityzap - -import ( - "context" - "io" - - sdktrace "go.opentelemetry.io/otel/sdk/trace" - "go.opentelemetry.io/otel/trace" -) - -var _ trace.TracerProvider = &tracerProviderCloser{} -var _ io.Closer = &tracerProviderCloser{} - -type tracerProviderCloser struct { - tracerProvider *sdktrace.TracerProvider -} - -func newTracerProviderCloser(tracerProvider *sdktrace.TracerProvider) *tracerProviderCloser { - return &tracerProviderCloser{ - tracerProvider: tracerProvider, - } -} - -func (t *tracerProviderCloser) Tracer(name string, opts ...trace.TracerOption) trace.Tracer { - return t.tracerProvider.Tracer(name, opts...) -} - -func (t *tracerProviderCloser) Close() error { - return t.tracerProvider.Shutdown(context.Background()) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/usage.gen.go deleted file mode 100644 index f856a4104a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package observabilityzap - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/zapexporter.go b/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/zapexporter.go deleted file mode 100644 index 85ba2e6fd2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/observabilityzap/zapexporter.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package observabilityzap - -import ( - "context" - - "go.opentelemetry.io/otel/sdk/trace" - "go.uber.org/zap" -) - -var _ trace.SpanExporter = &zapExporter{} - -type zapExporter struct { - logger *zap.Logger -} - -func newZapExporter(logger *zap.Logger) *zapExporter { - return &zapExporter{ - logger: logger, - } -} - -func (z *zapExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnlySpan) error { - for _, span := range spans { - if !span.SpanContext().IsSampled() { - continue - } - if checkedEntry := z.logger.Check(zap.DebugLevel, span.Name()); checkedEntry != nil { - fields := []zap.Field{ - zap.Duration("duration", span.EndTime().Sub(span.StartTime())), - } - for _, attribute := range span.Attributes() { - fields = append(fields, zap.Any(string(attribute.Key), attribute.Value.AsInterface())) - } - checkedEntry.Write(fields...) - } - } - return nil -} - -func (z *zapExporter) Shutdown(ctx context.Context) error { - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/osextended/osextended.go b/vendor/github.com/bufbuild/buf/private/pkg/osextended/osextended.go deleted file mode 100644 index 5a8d8b557d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/osextended/osextended.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package osextended provides os utilities. -package osextended - -import ( - "errors" - "os" - "sync" -) - -var ( - workDirPath string - workDirPathErr error - once sync.Once - - errOSGetwdEmpty = errors.New("os.Getwd returned empty and no error") -) - -// Getwd replaces os.Getwd and caches the result. -func Getwd() (string, error) { - once.Do(func() { - workDirPath, workDirPathErr = getwdUncached() - }) - return workDirPath, workDirPathErr -} - -func getwdUncached() (string, error) { - currentWorkDirPath, currentWorkDirPathErr := os.Getwd() - if currentWorkDirPath == "" && currentWorkDirPathErr == nil { - return "", errOSGetwdEmpty - } - return currentWorkDirPath, currentWorkDirPathErr -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/osextended/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/osextended/usage.gen.go deleted file mode 100644 index 0b06905896..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/osextended/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package osextended - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/protodescriptor.go b/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/protodescriptor.go deleted file mode 100644 index 491c5c2677..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/protodescriptor.go +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protodescriptor - -import ( - "errors" - "fmt" - "strconv" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/pluginpb" -) - -// FileDescriptor is an interface that matches the methods on a *descriptorpb.FileDescriptorProto. -// -// Note that a FileDescriptor is not necessarily validated, unlike other interfaces in buf. -type FileDescriptor interface { - proto.Message - GetName() string - GetPackage() string - GetDependency() []string - GetPublicDependency() []int32 - GetWeakDependency() []int32 - GetMessageType() []*descriptorpb.DescriptorProto - GetEnumType() []*descriptorpb.EnumDescriptorProto - GetService() []*descriptorpb.ServiceDescriptorProto - GetExtension() []*descriptorpb.FieldDescriptorProto - GetOptions() *descriptorpb.FileOptions - GetSourceCodeInfo() *descriptorpb.SourceCodeInfo - GetSyntax() string - GetEdition() string -} - -// FileDescriptorsForFileDescriptorProtos is a convenience function since Go does not have generics. -func FileDescriptorsForFileDescriptorProtos(fileDescriptorProtos ...*descriptorpb.FileDescriptorProto) []FileDescriptor { - fileDescriptors := make([]FileDescriptor, len(fileDescriptorProtos)) - for i, fileDescriptorProto := range fileDescriptorProtos { - fileDescriptors[i] = fileDescriptorProto - } - return fileDescriptors -} - -// FileDescriptorsForFileDescriptorSet is a convenience function since Go does not have generics. -func FileDescriptorsForFileDescriptorSet(fileDescriptorSet *descriptorpb.FileDescriptorSet) []FileDescriptor { - return FileDescriptorsForFileDescriptorProtos(fileDescriptorSet.File...) -} - -// FileDescriptorProtoForFileDescriptor creates a new *descriptorpb.FileDescriptorProto for the fileDescriptor. -// -// If the FileDescriptor is already a *descriptorpb.FileDescriptorProto, this returns the input value. -// -// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another -// object that is a FileDescriptor, and then passed to this function, the return value will not be equal -// if name, package, or syntax are set but empty. Instead, the return value will have these values unset. -// For our/most purposes, this is fine. -func FileDescriptorProtoForFileDescriptor(fileDescriptor FileDescriptor) *descriptorpb.FileDescriptorProto { - if fileDescriptorProto, ok := fileDescriptor.(*descriptorpb.FileDescriptorProto); ok { - return fileDescriptorProto - } - fileDescriptorProto := &descriptorpb.FileDescriptorProto{ - Dependency: fileDescriptor.GetDependency(), - PublicDependency: fileDescriptor.GetPublicDependency(), - WeakDependency: fileDescriptor.GetWeakDependency(), - MessageType: fileDescriptor.GetMessageType(), - EnumType: fileDescriptor.GetEnumType(), - Service: fileDescriptor.GetService(), - Extension: fileDescriptor.GetExtension(), - Options: fileDescriptor.GetOptions(), - SourceCodeInfo: fileDescriptor.GetSourceCodeInfo(), - } - // Note that if a *descriptorpb.FileDescriptorProto has a set but empty name, package, - // or syntax, this won't be an exact round trip. But for our use, we say this is fine. - if name := fileDescriptor.GetName(); name != "" { - fileDescriptorProto.Name = proto.String(name) - } - if pkg := fileDescriptor.GetPackage(); pkg != "" { - fileDescriptorProto.Package = proto.String(pkg) - } - if syntax := fileDescriptor.GetSyntax(); syntax != "" { - fileDescriptorProto.Syntax = proto.String(syntax) - } - if edition := fileDescriptor.GetEdition(); edition != "" { - fileDescriptorProto.Edition = proto.String(edition) - } - fileDescriptorProto.ProtoReflect().SetUnknown(fileDescriptor.ProtoReflect().GetUnknown()) - return fileDescriptorProto -} - -// FileDescriptorProtosForFileDescriptors is a convenience function since Go does not have generics. -// -// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another -// object that is a FileDescriptor, and then passed to this function, the return value will not be equal -// if name, package, or syntax are set but empty. Instead, the return value will have these values unset. -// For our/most purposes, this is fine. -func FileDescriptorProtosForFileDescriptors(fileDescriptors ...FileDescriptor) []*descriptorpb.FileDescriptorProto { - fileDescriptorProtos := make([]*descriptorpb.FileDescriptorProto, len(fileDescriptors)) - for i, fileDescriptor := range fileDescriptors { - fileDescriptorProtos[i] = FileDescriptorProtoForFileDescriptor(fileDescriptor) - } - return fileDescriptorProtos -} - -// FileDescriptorSetForFileDescriptors returns a new *descriptorpb.FileDescriptorSet for the given FileDescriptors. -// -// Note that this will not round trip exactly. If a *descriptorpb.FileDescriptorProto is turned into another -// object that is a FileDescriptor, and then passed to this function, the return value will not be equal -// if name, package, or syntax are set but empty. Instead, the return value will have these values unset. -// For our/most purposes, this is fine. -func FileDescriptorSetForFileDescriptors(fileDescriptors ...FileDescriptor) *descriptorpb.FileDescriptorSet { - return &descriptorpb.FileDescriptorSet{ - File: FileDescriptorProtosForFileDescriptors(fileDescriptors...), - } -} - -// ValidateFileDescriptor validates the FileDescriptor. -// -// A *descriptorpb.FileDescriptorProto can be passed to this. -func ValidateFileDescriptor(fileDescriptor FileDescriptor) error { - if fileDescriptor == nil { - return errors.New("nil FileDescriptor") - } - if err := ValidateProtoPath("FileDescriptor.Name", fileDescriptor.GetName()); err != nil { - return err - } - if err := ValidateProtoPaths("FileDescriptor.Dependency", fileDescriptor.GetDependency()); err != nil { - return err - } - return nil -} - -// ValidateCodeGeneratorRequest validates the CodeGeneratorRequest. -func ValidateCodeGeneratorRequest(request *pluginpb.CodeGeneratorRequest) error { - if err := ValidateCodeGeneratorRequestExceptFileDescriptorProtos(request); err != nil { - return err - } - for _, fileDescriptorProto := range request.ProtoFile { - if err := ValidateFileDescriptor(fileDescriptorProto); err != nil { - return err - } - } - return nil -} - -// ValidateCodeGeneratorRequestExceptFileDescriptorProtos validates the CodeGeneratorRequest -// minus the FileDescriptorProtos. -func ValidateCodeGeneratorRequestExceptFileDescriptorProtos(request *pluginpb.CodeGeneratorRequest) error { - if request == nil { - return errors.New("nil CodeGeneratorRequest") - } - if len(request.ProtoFile) == 0 { - return errors.New("empty CodeGeneratorRequest.ProtoFile") - } - if len(request.FileToGenerate) == 0 { - return errors.New("empty CodeGeneratorRequest.FileToGenerate") - } - if err := ValidateProtoPaths("CodeGeneratorRequest.FileToGenerate", request.FileToGenerate); err != nil { - return err - } - return nil -} - -// ValidateCodeGeneratorResponse validates the CodeGeneratorResponse. -// -// This validates that names are set. -// -// It is actually OK per the plugin.proto specs to not have the name set, and -// if this is empty, the content should be combined with the previous file. -// However, for our handlers, we do not support this, and for our -// binary handlers, we combine CodeGeneratorResponse.File contents. -// -// https://github.com/protocolbuffers/protobuf/blob/b99994d994e399174fe688a5efbcb6d91f36952a/src/google/protobuf/compiler/plugin.proto#L127 -func ValidateCodeGeneratorResponse(response *pluginpb.CodeGeneratorResponse) error { - if response == nil { - return errors.New("nil CodeGeneratorResponse") - } - for _, file := range response.File { - if file.GetName() == "" { - return errors.New("empty CodeGeneratorResponse.File.Name") - } - } - return nil -} - -// ValidateProtoPath validates the proto path. -// -// This checks that the path is normalized and ends in .proto. -func ValidateProtoPath(name string, path string) error { - if path == "" { - return fmt.Errorf("%s is empty", name) - } - normalized, err := normalpath.NormalizeAndValidate(path) - if err != nil { - return fmt.Errorf("%s had normalization error: %w", name, err) - } - if path != normalized { - return fmt.Errorf("%s %s was not normalized to %s", name, path, normalized) - } - if normalpath.Ext(path) != ".proto" { - return fmt.Errorf("%s %s does not have a .proto extension", name, path) - } - return nil -} - -// ValidateProtoPaths validates the proto paths. -// -// This checks that the paths are normalized and end in .proto. -func ValidateProtoPaths(name string, paths []string) error { - for _, path := range paths { - if err := ValidateProtoPath(name, path); err != nil { - return err - } - } - return nil -} - -// FieldDescriptorProtoTypePrettyString prints a pretty string -// representation of the FieldDescriptorProto_Type. -func FieldDescriptorProtoTypePrettyString(t descriptorpb.FieldDescriptorProto_Type) string { - switch t { - case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: - return "double" - case descriptorpb.FieldDescriptorProto_TYPE_FLOAT: - return "float" - case descriptorpb.FieldDescriptorProto_TYPE_INT64: - return "int64" - case descriptorpb.FieldDescriptorProto_TYPE_UINT64: - return "uint64" - case descriptorpb.FieldDescriptorProto_TYPE_INT32: - return "int32" - case descriptorpb.FieldDescriptorProto_TYPE_FIXED64: - return "fixed64" - case descriptorpb.FieldDescriptorProto_TYPE_FIXED32: - return "fixed32" - case descriptorpb.FieldDescriptorProto_TYPE_BOOL: - return "bool" - case descriptorpb.FieldDescriptorProto_TYPE_STRING: - return "string" - case descriptorpb.FieldDescriptorProto_TYPE_GROUP: - return "group" - case descriptorpb.FieldDescriptorProto_TYPE_MESSAGE: - return "message" - case descriptorpb.FieldDescriptorProto_TYPE_BYTES: - return "bytes" - case descriptorpb.FieldDescriptorProto_TYPE_UINT32: - return "uint32" - case descriptorpb.FieldDescriptorProto_TYPE_ENUM: - return "enum" - case descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: - return "sfixed32" - case descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: - return "sfixed64" - case descriptorpb.FieldDescriptorProto_TYPE_SINT32: - return "sint32" - case descriptorpb.FieldDescriptorProto_TYPE_SINT64: - return "sint64" - default: - return strconv.Itoa(int(t)) - } -} - -// FieldDescriptorProtoLabelPrettyString prints a pretty string -// representation of the FieldDescriptorProto_Label. -func FieldDescriptorProtoLabelPrettyString(l descriptorpb.FieldDescriptorProto_Label) string { - switch l { - case descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL: - return "optional" - case descriptorpb.FieldDescriptorProto_LABEL_REQUIRED: - return "required" - case descriptorpb.FieldDescriptorProto_LABEL_REPEATED: - return "repeated" - default: - return strconv.Itoa(int(l)) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/usage.gen.go deleted file mode 100644 index 791e8458d6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protodescriptor/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protodescriptor - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_marshaler.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_marshaler.go deleted file mode 100644 index 22cba9cd9e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_marshaler.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "bytes" - "encoding/json" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -type jsonMarshaler struct { - resolver Resolver - indent string - useProtoNames bool - emitUnpopulated bool -} - -func newJSONMarshaler(resolver Resolver, options ...JSONMarshalerOption) Marshaler { - jsonMarshaler := &jsonMarshaler{ - resolver: resolver, - } - for _, option := range options { - option(jsonMarshaler) - } - return jsonMarshaler -} - -func (m *jsonMarshaler) Marshal(message proto.Message) ([]byte, error) { - if err := ReparseUnrecognized(m.resolver, message.ProtoReflect()); err != nil { - return nil, err - } - options := protojson.MarshalOptions{ - Resolver: m.resolver, - UseProtoNames: m.useProtoNames, - EmitUnpopulated: m.emitUnpopulated, - } - data, err := options.Marshal(message) - if err != nil { - return nil, err - } - // This is needed due to the instability of protojson output. - // - // https://github.com/golang/protobuf/issues/1121 - // https://go-review.googlesource.com/c/protobuf/+/151340 - // https://developers.google.com/protocol-buffers/docs/reference/go/faq#unstable-json - // - // We may need to do a full encoding/json encode/decode in the future if protojson - // produces non-deterministic output. - buffer := bytes.NewBuffer(nil) - if m.indent != "" { - if err := json.Indent(buffer, data, "", m.indent); err != nil { - return nil, err - } - } else { - if err := json.Compact(buffer, data); err != nil { - return nil, err - } - } - return buffer.Bytes(), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_unmarshaler.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_unmarshaler.go deleted file mode 100644 index 75feedef2c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/json_unmarshaler.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" -) - -type jsonUnmarshaler struct { - resolver Resolver -} - -func newJSONUnmarshaler(resolver Resolver) Unmarshaler { - return &jsonUnmarshaler{ - resolver: resolver, - } -} - -func (m *jsonUnmarshaler) Unmarshal(data []byte, message proto.Message) error { - options := protojson.UnmarshalOptions{ - Resolver: m.resolver, - // TODO: make this an option - DiscardUnknown: true, - } - return options.Unmarshal(data, message) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/protoencoding.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/protoencoding.go deleted file mode 100644 index 20b8119d74..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/protoencoding.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" -) - -// Resolver can resolve files, messages, enums, and extensions. -type Resolver interface { - protodesc.Resolver - protoregistry.ExtensionTypeResolver - protoregistry.MessageTypeResolver - FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) -} - -// NewResolver creates a new Resolver. -// -// If the input slice is empty, this returns nil -// The given FileDescriptors must be self-contained, that is they must contain all imports. -// This can NOT be guaranteed for FileDescriptorSets given over the wire, and can only be guaranteed from builds. -func NewResolver(fileDescriptors ...protodescriptor.FileDescriptor) (Resolver, error) { - return newResolver(fileDescriptors...) -} - -// NewLazyResolver creates a new Resolver that is constructed from the given -// descriptors only as needed, if invoked. -// -// If there is an error when constructing the resolver, it will be returned by all -// method calls of the returned resolver. -func NewLazyResolver(fileDescriptors ...protodescriptor.FileDescriptor) Resolver { - return &lazyResolver{fn: func() (Resolver, error) { - return newResolver(fileDescriptors...) - }} -} - -// Marshaler marshals Messages. -type Marshaler interface { - Marshal(message proto.Message) ([]byte, error) -} - -// NewWireMarshaler returns a new Marshaler for wire. -// -// See https://godoc.org/google.golang.org/protobuf/proto#MarshalOptions for a discussion on stability. -// This has the potential to be unstable over time. -func NewWireMarshaler() Marshaler { - return newWireMarshaler() -} - -// NewJSONMarshaler returns a new Marshaler for JSON. -// -// This has the potential to be unstable over time. -// resolver can be nil if unknown and are only needed for extensions. -func NewJSONMarshaler(resolver Resolver, options ...JSONMarshalerOption) Marshaler { - return newJSONMarshaler(resolver, options...) -} - -// JSONMarshalerOption is an option for a new JSONMarshaler. -type JSONMarshalerOption func(*jsonMarshaler) - -// JSONMarshalerWithIndent says to use an indent of two spaces. -func JSONMarshalerWithIndent() JSONMarshalerOption { - return func(jsonMarshaler *jsonMarshaler) { - jsonMarshaler.indent = " " - } -} - -// JSONMarshalerWithUseProtoNames says to use an use proto names. -func JSONMarshalerWithUseProtoNames() JSONMarshalerOption { - return func(jsonMarshaler *jsonMarshaler) { - jsonMarshaler.useProtoNames = true - } -} - -// JSONMarshalerWithEmitUnpopulated says to emit unpopulated values -func JSONMarshalerWithEmitUnpopulated() JSONMarshalerOption { - return func(jsonMarshaler *jsonMarshaler) { - jsonMarshaler.emitUnpopulated = true - } -} - -// Unmarshaler unmarshals Messages. -type Unmarshaler interface { - Unmarshal(data []byte, message proto.Message) error -} - -// NewWireUnmarshaler returns a new Unmarshaler for wire. -// -// resolver can be nil if unknown and are only needed for extensions. -func NewWireUnmarshaler(resolver Resolver) Unmarshaler { - return newWireUnmarshaler(resolver) -} - -// NewJSONUnmarshaler returns a new Unmarshaler for json. -// -// resolver can be nil if unknown and are only needed for extensions. -func NewJSONUnmarshaler(resolver Resolver) Unmarshaler { - return newJSONUnmarshaler(resolver) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/reparse_unrecognized.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/reparse_unrecognized.go deleted file mode 100644 index c78dd53545..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/reparse_unrecognized.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" -) - -// ReparseUnrecognized uses the given resolver to parse any unrecognized fields in the -// given reflectMessage. It does so recursively, resolving any unrecognized fields in -// nested messages. -func ReparseUnrecognized(resolver Resolver, reflectMessage protoreflect.Message) error { - if resolver == nil { - return nil - } - unknown := reflectMessage.GetUnknown() - if len(unknown) > 0 { - reflectMessage.SetUnknown(nil) - options := proto.UnmarshalOptions{ - Resolver: resolver, - Merge: true, - } - if err := options.Unmarshal(unknown, reflectMessage.Interface()); err != nil { - return err - } - } - var err error - reflectMessage.Range(func(fieldDescriptor protoreflect.FieldDescriptor, value protoreflect.Value) bool { - err = reparseUnrecognizedInField(resolver, fieldDescriptor, value) - return err == nil - }) - return err -} - -func reparseUnrecognizedInField(resolver Resolver, fieldDescriptor protoreflect.FieldDescriptor, value protoreflect.Value) error { - if fieldDescriptor.IsMap() { - valDesc := fieldDescriptor.MapValue() - if valDesc.Kind() != protoreflect.MessageKind && valDesc.Kind() != protoreflect.GroupKind { - // nothing to reparse - return nil - } - var err error - value.Map().Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - err = ReparseUnrecognized(resolver, v.Message()) - return err == nil - }) - return err - } - if fieldDescriptor.Kind() != protoreflect.MessageKind && fieldDescriptor.Kind() != protoreflect.GroupKind { - // nothing to reparse - return nil - } - if fieldDescriptor.IsList() { - list := value.List() - for i := 0; i < list.Len(); i++ { - if err := ReparseUnrecognized(resolver, list.Get(i).Message()); err != nil { - return err - } - } - return nil - } - return ReparseUnrecognized(resolver, value.Message()) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/resolver.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/resolver.go deleted file mode 100644 index 39984b8b21..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/resolver.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "sync" - - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/dynamicpb" -) - -func newResolver(fileDescriptors ...protodescriptor.FileDescriptor) (Resolver, error) { - if len(fileDescriptors) == 0 { - return nil, nil - } - // TODO: handle if resolvable - files, err := protodesc.FileOptions{ - AllowUnresolvable: true, - }.NewFiles( - protodescriptor.FileDescriptorSetForFileDescriptors(fileDescriptors...), - ) - if err != nil { - return nil, err - } - types := &protoregistry.Types{} - var rangeErr error - files.RangeFiles(func(fileDescriptor protoreflect.FileDescriptor) bool { - if err := registerDescriptors(types, fileDescriptor); err != nil { - rangeErr = err - return false - } - return true - }) - if rangeErr != nil { - return nil, rangeErr - } - return &resolver{Files: files, Types: types}, nil -} - -type resolver struct { - *protoregistry.Files - *protoregistry.Types -} - -type descriptorContainer interface { - Messages() protoreflect.MessageDescriptors - Enums() protoreflect.EnumDescriptors - Extensions() protoreflect.ExtensionDescriptors -} - -func registerDescriptors(types *protoregistry.Types, container descriptorContainer) error { - messageDescriptors := container.Messages() - for i, messagesLen := 0, messageDescriptors.Len(); i < messagesLen; i++ { - messageDescriptor := messageDescriptors.Get(i) - if err := types.RegisterMessage(dynamicpb.NewMessageType(messageDescriptor)); err != nil { - return err - } - // nested types, too - if err := registerDescriptors(types, messageDescriptor); err != nil { - return err - } - } - - enumDescriptors := container.Enums() - for i, enumsLen := 0, enumDescriptors.Len(); i < enumsLen; i++ { - enumDescriptor := enumDescriptors.Get(i) - if err := types.RegisterEnum(dynamicpb.NewEnumType(enumDescriptor)); err != nil { - return err - } - } - - extensionDescriptors := container.Extensions() - for i, extensionsLen := 0, extensionDescriptors.Len(); i < extensionsLen; i++ { - extensionDescriptor := extensionDescriptors.Get(i) - if err := types.RegisterExtension(dynamicpb.NewExtensionType(extensionDescriptor)); err != nil { - return err - } - } - - return nil -} - -type lazyResolver struct { - fn func() (Resolver, error) - init sync.Once - resolver Resolver - err error -} - -func (l *lazyResolver) maybeInit() error { - l.init.Do(func() { - l.resolver, l.err = l.fn() - }) - return l.err -} - -func (l *lazyResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindFileByPath(path) -} - -func (l *lazyResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindDescriptorByName(name) -} - -func (l *lazyResolver) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindEnumByName(enum) -} - -func (l *lazyResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindExtensionByName(field) -} - -func (l *lazyResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindExtensionByNumber(message, field) -} - -func (l *lazyResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindMessageByName(message) -} - -func (l *lazyResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - if err := l.maybeInit(); err != nil { - return nil, err - } - return l.resolver.FindMessageByURL(url) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/usage.gen.go deleted file mode 100644 index e11ec26cde..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protoencoding - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_marshaler.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_marshaler.go deleted file mode 100644 index adc9a3ebed..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_marshaler.go +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "google.golang.org/protobuf/proto" -) - -type wireMarshaler struct{} - -func newWireMarshaler() Marshaler { - return &wireMarshaler{} -} - -func (m *wireMarshaler) Marshal(message proto.Message) ([]byte, error) { - options := proto.MarshalOptions{ - Deterministic: true, - } - return options.Marshal(message) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_unmarshaler.go b/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_unmarshaler.go deleted file mode 100644 index f1eddfe306..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoencoding/wire_unmarshaler.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoencoding - -import ( - "google.golang.org/protobuf/proto" -) - -type wireUnmarshaler struct { - resolver Resolver -} - -func newWireUnmarshaler(resolver Resolver) Unmarshaler { - return &wireUnmarshaler{ - resolver: resolver, - } -} - -func (m *wireUnmarshaler) Unmarshal(data []byte, message proto.Message) error { - options := proto.UnmarshalOptions{ - Resolver: m.resolver, - } - return options.Unmarshal(data, message) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/descriptor.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/descriptor.go deleted file mode 100644 index 162c08783f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/descriptor.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type descriptor struct { - file File - locationStore *locationStore -} - -func newDescriptor( - file File, - locationStore *locationStore, -) descriptor { - return descriptor{ - file: file, - locationStore: locationStore, - } -} - -func (d *descriptor) File() File { - return d.file -} - -func (d *descriptor) getLocation(path []int32) Location { - if d.locationStore == nil || len(path) == 0 { - return nil - } - return d.locationStore.getLocation(path) -} - -func (d *descriptor) getLocationByPathKey(pathKey string) Location { - if d.locationStore == nil || pathKey == "" { - return nil - } - return d.locationStore.getLocationByPathKey(pathKey) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum.go deleted file mode 100644 index a871793943..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type enum struct { - namedDescriptor - optionExtensionDescriptor - - values []EnumValue - allowAlias bool - deprecatedLegacyJSONFieldConflicts bool - deprecated bool - allowAliasPath []int32 - reservedEnumRanges []EnumRange - reservedNames []ReservedName - parent Message -} - -func newEnum( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - allowAlias bool, - deprecatedLegacyJSONFieldConflicts bool, - deprecated bool, - allowAliasPath []int32, - parent Message, -) *enum { - return &enum{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - allowAlias: allowAlias, - deprecatedLegacyJSONFieldConflicts: deprecatedLegacyJSONFieldConflicts, - deprecated: deprecated, - allowAliasPath: allowAliasPath, - parent: parent, - } -} - -func (e *enum) Values() []EnumValue { - return e.values -} - -func (e *enum) AllowAlias() bool { - return e.allowAlias -} - -func (e *enum) DeprecatedLegacyJSONFieldConflicts() bool { - return e.deprecatedLegacyJSONFieldConflicts -} - -func (e *enum) Deprecated() bool { - return e.deprecated -} - -func (e *enum) AllowAliasLocation() Location { - return e.getLocation(e.allowAliasPath) -} - -func (e *enum) ReservedEnumRanges() []EnumRange { - return e.reservedEnumRanges -} - -func (e *enum) ReservedTagRanges() []TagRange { - tagRanges := make([]TagRange, len(e.reservedEnumRanges)) - for i, reservedEnumRange := range e.reservedEnumRanges { - tagRanges[i] = reservedEnumRange - } - return tagRanges -} - -func (e *enum) ReservedNames() []ReservedName { - return e.reservedNames -} - -func (e *enum) Parent() Message { - return e.parent -} - -func (e *enum) addValue(value EnumValue) { - e.values = append(e.values, value) -} - -func (e *enum) addReservedEnumRange(reservedEnumRange EnumRange) { - e.reservedEnumRanges = append(e.reservedEnumRanges, reservedEnumRange) -} - -func (e *enum) addReservedName(reservedName ReservedName) { - e.reservedNames = append(e.reservedNames, reservedName) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_range.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_range.go deleted file mode 100644 index a03ca85c07..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_range.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -const ( - enumRangeInclusiveMax = 2147483647 -) - -type enumRange struct { - locationDescriptor - - enum Enum - start int - end int -} - -func newEnumRange( - locationDescriptor locationDescriptor, - enum Enum, - start int, - // end is inclusive for enums - end int, -) *enumRange { - return &enumRange{ - locationDescriptor: locationDescriptor, - enum: enum, - start: start, - end: end, - } -} - -func (r *enumRange) Enum() Enum { - return r.enum -} - -func (r *enumRange) Start() int { - return r.start -} - -func (r *enumRange) End() int { - return r.end -} - -func (r *enumRange) Max() bool { - return r.end == enumRangeInclusiveMax -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_value.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_value.go deleted file mode 100644 index 28c3013760..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/enum_value.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type enumValue struct { - namedDescriptor - optionExtensionDescriptor - - enum Enum - number int - deprecated bool - numberPath []int32 -} - -func newEnumValue( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - enum Enum, - number int, - deprecated bool, - numberPath []int32, -) *enumValue { - return &enumValue{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - enum: enum, - number: number, - deprecated: deprecated, - numberPath: numberPath, - } -} - -func (e *enumValue) Enum() Enum { - return e.enum -} - -func (e *enumValue) Number() int { - return e.number -} - -func (e *enumValue) Deprecated() bool { - return e.deprecated -} - -func (e *enumValue) NumberLocation() Location { - return e.getLocation(e.numberPath) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/field.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/field.go deleted file mode 100644 index adc2c76af3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/field.go +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import "google.golang.org/protobuf/types/descriptorpb" - -type field struct { - namedDescriptor - optionExtensionDescriptor - - message Message - number int - label descriptorpb.FieldDescriptorProto_Label - typ descriptorpb.FieldDescriptorProto_Type - typeName string - // if the field is an extension, this is the type being extended - extendee string - // this has to be the pointer to the private struct or you have the bug where the - // interface is nil but value == nil is false - oneof *oneof - proto3Optional bool - jsonName string - jsType descriptorpb.FieldOptions_JSType - cType descriptorpb.FieldOptions_CType - retention descriptorpb.FieldOptions_OptionRetention - targets []descriptorpb.FieldOptions_OptionTargetType - debugRedact bool - packed *bool - deprecated bool - numberPath []int32 - typePath []int32 - typeNamePath []int32 - jsonNamePath []int32 - jsTypePath []int32 - cTypePath []int32 - packedPath []int32 - extendeePath []int32 -} - -func newField( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - message Message, - number int, - label descriptorpb.FieldDescriptorProto_Label, - typ descriptorpb.FieldDescriptorProto_Type, - typeName string, - extendee string, - oneof *oneof, - proto3Optional bool, - jsonName string, - jsType descriptorpb.FieldOptions_JSType, - cType descriptorpb.FieldOptions_CType, - retention descriptorpb.FieldOptions_OptionRetention, - targets []descriptorpb.FieldOptions_OptionTargetType, - debugRedact bool, - packed *bool, - deprecated bool, - numberPath []int32, - typePath []int32, - typeNamePath []int32, - jsonNamePath []int32, - jsTypePath []int32, - cTypePath []int32, - packedPath []int32, - extendeePath []int32, -) *field { - return &field{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - message: message, - number: number, - label: label, - typ: typ, - typeName: typeName, - extendee: extendee, - oneof: oneof, - proto3Optional: proto3Optional, - jsonName: jsonName, - jsType: jsType, - cType: cType, - retention: retention, - targets: targets, - debugRedact: debugRedact, - packed: packed, - deprecated: deprecated, - numberPath: numberPath, - typePath: typePath, - typeNamePath: typeNamePath, - jsonNamePath: jsonNamePath, - jsTypePath: jsTypePath, - cTypePath: cTypePath, - packedPath: packedPath, - extendeePath: extendeePath, - } -} - -func (f *field) Message() Message { - return f.message -} - -func (f *field) Number() int { - return f.number -} - -func (f *field) Label() descriptorpb.FieldDescriptorProto_Label { - return f.label -} - -func (f *field) Type() descriptorpb.FieldDescriptorProto_Type { - return f.typ -} - -func (f *field) TypeName() string { - return f.typeName -} - -func (f *field) Extendee() string { - return f.extendee -} - -func (f *field) Oneof() Oneof { - // this has to be done or you have the bug where the interface is nil - // but value == nil is false - if f.oneof == nil { - return nil - } - return f.oneof -} - -func (f *field) Proto3Optional() bool { - return f.proto3Optional -} - -func (f *field) JSONName() string { - return f.jsonName -} - -func (f *field) JSType() descriptorpb.FieldOptions_JSType { - return f.jsType -} - -func (f *field) CType() descriptorpb.FieldOptions_CType { - return f.cType -} - -func (f *field) Retention() descriptorpb.FieldOptions_OptionRetention { - return f.retention -} - -func (f *field) Targets() []descriptorpb.FieldOptions_OptionTargetType { - return f.targets -} - -func (f *field) DebugRedact() bool { - return f.debugRedact -} - -func (f *field) Packed() *bool { - return f.packed -} - -func (f *field) Deprecated() bool { - return f.deprecated -} - -func (f *field) NumberLocation() Location { - return f.getLocation(f.numberPath) -} - -func (f *field) TypeLocation() Location { - return f.getLocation(f.typePath) -} - -func (f *field) TypeNameLocation() Location { - return f.getLocation(f.typeNamePath) -} - -func (f *field) JSONNameLocation() Location { - return f.getLocation(f.jsonNamePath) -} - -func (f *field) JSTypeLocation() Location { - return f.getLocation(f.jsTypePath) -} - -func (f *field) CTypeLocation() Location { - return f.getLocation(f.cTypePath) -} - -func (f *field) PackedLocation() Location { - return f.getLocation(f.packedPath) -} - -func (f *field) ExtendeeLocation() Location { - return f.getLocation(f.extendeePath) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/file.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/file.go deleted file mode 100644 index f50e3878c3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/file.go +++ /dev/null @@ -1,837 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "fmt" - "strings" - - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "google.golang.org/protobuf/types/descriptorpb" -) - -type file struct { - FileInfo - descriptor - optionExtensionDescriptor - - fileDescriptor protodescriptor.FileDescriptor - syntax Syntax - fileImports []FileImport - messages []Message - enums []Enum - services []Service - extensions []Field - edition string - optimizeMode descriptorpb.FileOptions_OptimizeMode -} - -func (f *file) Syntax() Syntax { - return f.syntax -} - -func (f *file) Package() string { - return f.fileDescriptor.GetPackage() -} - -func (f *file) FileImports() []FileImport { - return f.fileImports -} - -func (f *file) Messages() []Message { - return f.messages -} - -func (f *file) Enums() []Enum { - return f.enums -} - -func (f *file) Services() []Service { - return f.services -} - -func (f *file) Extensions() []Field { - return f.extensions -} - -func (f *file) Edition() string { - return f.edition -} - -func (f *file) CsharpNamespace() string { - return f.fileDescriptor.GetOptions().GetCsharpNamespace() -} - -func (f *file) Deprecated() bool { - return f.fileDescriptor.GetOptions().GetDeprecated() -} - -func (f *file) GoPackage() string { - return f.fileDescriptor.GetOptions().GetGoPackage() -} - -func (f *file) JavaMultipleFiles() bool { - return f.fileDescriptor.GetOptions().GetJavaMultipleFiles() -} - -func (f *file) JavaOuterClassname() string { - return f.fileDescriptor.GetOptions().GetJavaOuterClassname() -} - -func (f *file) JavaPackage() string { - return f.fileDescriptor.GetOptions().GetJavaPackage() -} - -func (f *file) JavaStringCheckUtf8() bool { - return f.fileDescriptor.GetOptions().GetJavaStringCheckUtf8() -} - -func (f *file) ObjcClassPrefix() string { - return f.fileDescriptor.GetOptions().GetObjcClassPrefix() -} - -func (f *file) PhpClassPrefix() string { - return f.fileDescriptor.GetOptions().GetPhpClassPrefix() -} - -func (f *file) PhpNamespace() string { - return f.fileDescriptor.GetOptions().GetPhpNamespace() -} - -func (f *file) PhpMetadataNamespace() string { - return f.fileDescriptor.GetOptions().GetPhpMetadataNamespace() -} - -func (f *file) RubyPackage() string { - return f.fileDescriptor.GetOptions().GetRubyPackage() -} - -func (f *file) SwiftPrefix() string { - return f.fileDescriptor.GetOptions().GetSwiftPrefix() -} - -func (f *file) OptimizeFor() descriptorpb.FileOptions_OptimizeMode { - return f.optimizeMode -} - -func (f *file) CcGenericServices() bool { - return f.fileDescriptor.GetOptions().GetCcGenericServices() -} - -func (f *file) JavaGenericServices() bool { - return f.fileDescriptor.GetOptions().GetJavaGenericServices() -} - -func (f *file) PyGenericServices() bool { - return f.fileDescriptor.GetOptions().GetPyGenericServices() -} - -func (f *file) PhpGenericServices() bool { - return f.fileDescriptor.GetOptions().GetPhpGenericServices() -} - -func (f *file) CcEnableArenas() bool { - return f.fileDescriptor.GetOptions().GetCcEnableArenas() -} - -func (f *file) PackageLocation() Location { - return f.getLocationByPathKey(packagePathKey) -} - -func (f *file) CsharpNamespaceLocation() Location { - return f.getLocationByPathKey(csharpNamespacePathKey) -} - -func (f *file) GoPackageLocation() Location { - return f.getLocationByPathKey(goPackagePathKey) -} - -func (f *file) JavaMultipleFilesLocation() Location { - return f.getLocationByPathKey(javaMultipleFilesPathKey) -} - -func (f *file) JavaOuterClassnameLocation() Location { - return f.getLocationByPathKey(javaOuterClassnamePathKey) -} - -func (f *file) JavaPackageLocation() Location { - return f.getLocationByPathKey(javaPackagePathKey) -} - -func (f *file) JavaStringCheckUtf8Location() Location { - return f.getLocationByPathKey(javaStringCheckUtf8PathKey) -} - -func (f *file) ObjcClassPrefixLocation() Location { - return f.getLocationByPathKey(objcClassPrefixPathKey) -} - -func (f *file) PhpClassPrefixLocation() Location { - return f.getLocationByPathKey(phpClassPrefixPathKey) -} - -func (f *file) PhpNamespaceLocation() Location { - return f.getLocationByPathKey(phpNamespacePathKey) -} - -func (f *file) PhpMetadataNamespaceLocation() Location { - return f.getLocationByPathKey(phpMetadataNamespacePathKey) -} - -func (f *file) RubyPackageLocation() Location { - return f.getLocationByPathKey(rubyPackagePathKey) -} - -func (f *file) SwiftPrefixLocation() Location { - return f.getLocationByPathKey(swiftPrefixPathKey) -} - -func (f *file) OptimizeForLocation() Location { - return f.getLocationByPathKey(optimizeForPathKey) -} - -func (f *file) CcGenericServicesLocation() Location { - return f.getLocationByPathKey(ccGenericServicesPathKey) -} - -func (f *file) JavaGenericServicesLocation() Location { - return f.getLocationByPathKey(javaGenericServicesPathKey) -} - -func (f *file) PyGenericServicesLocation() Location { - return f.getLocationByPathKey(pyGenericServicesPathKey) -} - -func (f *file) PhpGenericServicesLocation() Location { - return f.getLocationByPathKey(phpGenericServicesPathKey) -} - -func (f *file) CcEnableArenasLocation() Location { - return f.getLocationByPathKey(ccEnableArenasPathKey) -} - -func (f *file) SyntaxLocation() Location { - return f.getLocationByPathKey(syntaxPathKey) -} - -// does not validation of the fileDescriptorProto - this is assumed to be done elsewhere -// does no duplicate checking by name - could just have maps ie importToFileImport, enumNameToEnum, etc -func newFile(inputFile InputFile) (*file, error) { - locationStore := newLocationStore(inputFile.FileDescriptor().GetSourceCodeInfo().GetLocation()) - f := &file{ - FileInfo: inputFile, - fileDescriptor: inputFile.FileDescriptor(), - optionExtensionDescriptor: newOptionExtensionDescriptor( - inputFile.FileDescriptor().GetOptions(), - []int32{8}, - locationStore, - ), - edition: inputFile.FileDescriptor().GetEdition(), - } - descriptor := newDescriptor( - f, - locationStore, - ) - f.descriptor = descriptor - - if inputFile.IsSyntaxUnspecified() { - // if the syntax is "proto2", protoc and buf will not set the syntax - // field even if it was explicitly set, this is why we have - // IsSyntaxUnspecified - f.syntax = SyntaxUnspecified - } else { - switch syntaxString := f.fileDescriptor.GetSyntax(); syntaxString { - case "", "proto2": - f.syntax = SyntaxProto2 - case "proto3": - f.syntax = SyntaxProto3 - case "editions": - f.syntax = SyntaxEditions - default: - return nil, fmt.Errorf("unknown syntax: %q", syntaxString) - } - } - - for dependencyIndex, dependency := range f.fileDescriptor.GetDependency() { - fileImport, err := newFileImport( - f.descriptor, - dependency, - getDependencyPath(dependencyIndex), - ) - if err != nil { - return nil, err - } - f.fileImports = append(f.fileImports, fileImport) - } - for _, dependencyIndex := range f.fileDescriptor.GetPublicDependency() { - if int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) { - return nil, fmt.Errorf("got dependency index of %d but length of imports is %d", dependencyIndex, len(f.fileImports)) - } - fileImport, ok := f.fileImports[dependencyIndex].(*fileImport) - if !ok { - return nil, fmt.Errorf("could not cast %T to a *fileImport", f.fileImports[dependencyIndex]) - } - fileImport.setIsPublic() - } - for _, dependencyIndex := range f.fileDescriptor.GetWeakDependency() { - if int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) { - return nil, fmt.Errorf("got dependency index of %d but length of imports is %d", dependencyIndex, len(f.fileImports)) - } - fileImport, ok := f.fileImports[dependencyIndex].(*fileImport) - if !ok { - return nil, fmt.Errorf("could not cast %T to a *fileImport", f.fileImports[dependencyIndex]) - } - fileImport.setIsWeak() - } - for _, dependencyIndex := range inputFile.UnusedDependencyIndexes() { - if int(dependencyIndex) < 0 || len(f.fileImports) <= int(dependencyIndex) { - return nil, fmt.Errorf("got dependency index of %d but length of imports is %d", dependencyIndex, len(f.fileImports)) - } - fileImport, ok := f.fileImports[dependencyIndex].(*fileImport) - if !ok { - return nil, fmt.Errorf("could not cast %T to a *fileImport", f.fileImports[dependencyIndex]) - } - fileImport.setIsUnused() - } - for enumIndex, enumDescriptorProto := range f.fileDescriptor.GetEnumType() { - enum, err := f.populateEnum( - enumDescriptorProto, - enumIndex, - nil, - nil, - nil, - ) - if err != nil { - return nil, err - } - f.enums = append(f.enums, enum) - } - for messageIndex, descriptorProto := range f.fileDescriptor.GetMessageType() { - message, err := f.populateMessage( - descriptorProto, - messageIndex, - nil, - nil, - nil, - ) - if err != nil { - return nil, err - } - f.messages = append(f.messages, message) - } - for serviceIndex, serviceDescriptorProto := range f.fileDescriptor.GetService() { - service, err := f.populateService( - serviceDescriptorProto, - serviceIndex, - ) - if err != nil { - return nil, err - } - f.services = append(f.services, service) - } - for extensionIndex, extensionDescriptorProto := range f.fileDescriptor.GetExtension() { - extension, err := f.populateExtension( - extensionDescriptorProto, - extensionIndex, - ) - if err != nil { - return nil, err - } - f.extensions = append(f.extensions, extension) - } - f.optimizeMode = f.fileDescriptor.GetOptions().GetOptimizeFor() - return f, nil -} - -func (f *file) populateEnum( - enumDescriptorProto *descriptorpb.EnumDescriptorProto, - enumIndex int, - // all message indexes leading to this enum - nestedMessageIndexes []int, - // all message names leading to this enum - nestedMessageNames []string, - parent Message, -) (Enum, error) { - enumNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getEnumPath(enumIndex, nestedMessageIndexes...), - ), - enumDescriptorProto.GetName(), - getEnumNamePath(enumIndex, nestedMessageIndexes...), - nestedMessageNames, - ) - if err != nil { - return nil, err - } - enum := newEnum( - enumNamedDescriptor, - newOptionExtensionDescriptor( - enumDescriptorProto.GetOptions(), - getEnumOptionsPath(enumIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - enumDescriptorProto.GetOptions().GetAllowAlias(), - enumDescriptorProto.GetOptions().GetDeprecatedLegacyJsonFieldConflicts(), - enumDescriptorProto.GetOptions().GetDeprecated(), - getEnumAllowAliasPath(enumIndex, nestedMessageIndexes...), - parent, - ) - - for enumValueIndex, enumValueDescriptorProto := range enumDescriptorProto.GetValue() { - enumValueNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), - ), - enumValueDescriptorProto.GetName(), - getEnumValueNamePath(enumIndex, enumValueIndex, nestedMessageIndexes...), - append(nestedMessageNames, enum.Name()), - ) - if err != nil { - return nil, err - } - enumValue := newEnumValue( - enumValueNamedDescriptor, - newOptionExtensionDescriptor( - enumValueDescriptorProto.GetOptions(), - getEnumValueOptionsPath(enumIndex, enumValueIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - enum, - int(enumValueDescriptorProto.GetNumber()), - enumValueDescriptorProto.GetOptions().GetDeprecated(), - getEnumValueNumberPath(enumIndex, enumValueIndex, nestedMessageIndexes...), - ) - enum.addValue(enumValue) - } - - for reservedRangeIndex, reservedRangeDescriptorProto := range enumDescriptorProto.GetReservedRange() { - reservedRangeLocationDescriptor := newLocationDescriptor( - f.descriptor, - getEnumReservedRangePath(enumIndex, reservedRangeIndex, nestedMessageIndexes...), - ) - reservedEnumRange := newEnumRange( - reservedRangeLocationDescriptor, - enum, - int(reservedRangeDescriptorProto.GetStart()), - int(reservedRangeDescriptorProto.GetEnd()), - ) - enum.addReservedEnumRange(reservedEnumRange) - } - for reservedNameIndex, reservedNameValue := range enumDescriptorProto.GetReservedName() { - reservedNameLocationDescriptor := newLocationDescriptor( - f.descriptor, - getEnumReservedNamePath(enumIndex, reservedNameIndex, nestedMessageIndexes...), - ) - reservedName, err := newReservedName( - reservedNameLocationDescriptor, - reservedNameValue, - ) - if err != nil { - return nil, err - } - enum.addReservedName(reservedName) - } - return enum, nil -} - -func (f *file) populateMessage( - descriptorProto *descriptorpb.DescriptorProto, - // always stays the same on every recursive call - topLevelMessageIndex int, - // includes descriptorProto index - nestedMessageIndexes []int, - // does NOT include descriptorProto.GetName() - nestedMessageNames []string, - parent Message, -) (Message, error) { - messageNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), - ), - descriptorProto.GetName(), - getMessageNamePath(topLevelMessageIndex, nestedMessageIndexes...), - nestedMessageNames, - ) - if err != nil { - return nil, err - } - message := newMessage( - messageNamedDescriptor, - newOptionExtensionDescriptor( - descriptorProto.GetOptions(), - getMessageOptionsPath(topLevelMessageIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - parent, - descriptorProto.GetOptions().GetMapEntry(), - descriptorProto.GetOptions().GetMessageSetWireFormat(), - descriptorProto.GetOptions().GetNoStandardDescriptorAccessor(), - descriptorProto.GetOptions().GetDeprecatedLegacyJsonFieldConflicts(), - descriptorProto.GetOptions().GetDeprecated(), - getMessageMessageSetWireFormatPath(topLevelMessageIndex, nestedMessageIndexes...), - getMessageNoStandardDescriptorAccessorPath(topLevelMessageIndex, nestedMessageIndexes...), - ) - oneofIndexToOneof := make(map[int]*oneof) - for oneofIndex, oneofDescriptorProto := range descriptorProto.GetOneofDecl() { - oneofNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), - ), - oneofDescriptorProto.GetName(), - getMessageOneofNamePath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), - append(nestedMessageNames, message.Name()), - ) - if err != nil { - return nil, err - } - oneof := newOneof( - oneofNamedDescriptor, - newOptionExtensionDescriptor( - oneofDescriptorProto.GetOptions(), - getMessageOneofOptionsPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - message, - ) - message.addOneof(oneof) - oneofIndexToOneof[oneofIndex] = oneof - } - for fieldIndex, fieldDescriptorProto := range descriptorProto.GetField() { - // TODO: not working for map entries - fieldNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - ), - fieldDescriptorProto.GetName(), - getMessageFieldNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - append(nestedMessageNames, message.Name()), - ) - if err != nil { - return nil, err - } - var packed *bool - if fieldDescriptorProto.Options != nil { - packed = fieldDescriptorProto.GetOptions().Packed - } - var oneof *oneof - var ok bool - if fieldDescriptorProto.OneofIndex != nil { - oneofIndex := int(*fieldDescriptorProto.OneofIndex) - oneof, ok = oneofIndexToOneof[oneofIndex] - if !ok { - return nil, fmt.Errorf("no oneof for index %d", oneofIndex) - } - } - field := newField( - fieldNamedDescriptor, - newOptionExtensionDescriptor( - fieldDescriptorProto.GetOptions(), - getMessageFieldOptionsPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - message, - int(fieldDescriptorProto.GetNumber()), - fieldDescriptorProto.GetLabel(), - fieldDescriptorProto.GetType(), - strings.TrimPrefix(fieldDescriptorProto.GetTypeName(), "."), - strings.TrimPrefix(fieldDescriptorProto.GetExtendee(), "."), - oneof, - fieldDescriptorProto.GetProto3Optional(), - fieldDescriptorProto.GetJsonName(), - fieldDescriptorProto.GetOptions().GetJstype(), - fieldDescriptorProto.GetOptions().GetCtype(), - fieldDescriptorProto.GetOptions().GetRetention(), - fieldDescriptorProto.GetOptions().GetTargets(), - fieldDescriptorProto.GetOptions().GetDebugRedact(), - packed, - fieldDescriptorProto.GetOptions().GetDeprecated(), - getMessageFieldNumberPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldTypeNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldJSONNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldJSTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldCTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldPackedPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageFieldExtendeePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - ) - message.addField(field) - if oneof != nil { - oneof.addField(field) - } - } - for fieldIndex, fieldDescriptorProto := range descriptorProto.GetExtension() { - fieldNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getMessageExtensionPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - ), - fieldDescriptorProto.GetName(), - getMessageExtensionNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - append(nestedMessageNames, message.Name()), - ) - if err != nil { - return nil, err - } - var packed *bool - if fieldDescriptorProto.Options != nil { - packed = fieldDescriptorProto.GetOptions().Packed - } - var oneof *oneof - var ok bool - if fieldDescriptorProto.OneofIndex != nil { - oneofIndex := int(*fieldDescriptorProto.OneofIndex) - oneof, ok = oneofIndexToOneof[oneofIndex] - if !ok { - return nil, fmt.Errorf("no oneof for index %d", oneofIndex) - } - } - field := newField( - fieldNamedDescriptor, - newOptionExtensionDescriptor( - fieldDescriptorProto.GetOptions(), - getMessageExtensionOptionsPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - message, - int(fieldDescriptorProto.GetNumber()), - fieldDescriptorProto.GetLabel(), - fieldDescriptorProto.GetType(), - strings.TrimPrefix(fieldDescriptorProto.GetTypeName(), "."), - strings.TrimPrefix(fieldDescriptorProto.GetExtendee(), "."), - oneof, - fieldDescriptorProto.GetProto3Optional(), - fieldDescriptorProto.GetJsonName(), - fieldDescriptorProto.GetOptions().GetJstype(), - fieldDescriptorProto.GetOptions().GetCtype(), - fieldDescriptorProto.GetOptions().GetRetention(), - fieldDescriptorProto.GetOptions().GetTargets(), - fieldDescriptorProto.GetOptions().GetDebugRedact(), - packed, - fieldDescriptorProto.GetOptions().GetDeprecated(), - getMessageExtensionNumberPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionTypeNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionJSONNamePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionJSTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionCTypePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionPackedPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - getMessageExtensionExtendeePath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), - ) - if err != nil { - return nil, err - } - message.addExtension(field) - if oneof != nil { - oneof.addField(field) - } - } - for reservedRangeIndex, reservedRangeDescriptorProto := range descriptorProto.GetReservedRange() { - reservedRangeLocationDescriptor := newLocationDescriptor( - f.descriptor, - getMessageReservedRangePath(reservedRangeIndex, topLevelMessageIndex, nestedMessageIndexes...), - ) - reservedMessageRange := newMessageRange( - reservedRangeLocationDescriptor, - message, - int(reservedRangeDescriptorProto.GetStart()), - int(reservedRangeDescriptorProto.GetEnd()), - ) - message.addReservedMessageRange(reservedMessageRange) - } - for reservedNameIndex, reservedNameValue := range descriptorProto.GetReservedName() { - reservedNameLocationDescriptor := newLocationDescriptor( - f.descriptor, - getMessageReservedNamePath(reservedNameIndex, topLevelMessageIndex, nestedMessageIndexes...), - ) - reservedName, err := newReservedName( - reservedNameLocationDescriptor, - reservedNameValue, - ) - if err != nil { - return nil, err - } - message.addReservedName(reservedName) - } - for extensionRangeIndex, extensionRangeDescriptorProto := range descriptorProto.GetExtensionRange() { - extensionRangeLocationDescriptor := newLocationDescriptor( - f.descriptor, - getMessageExtensionRangePath(extensionRangeIndex, topLevelMessageIndex, nestedMessageIndexes...), - ) - extensionMessageRange := newExtensionRange( - extensionRangeLocationDescriptor, - message, - int(extensionRangeDescriptorProto.GetStart()), - int(extensionRangeDescriptorProto.GetEnd()), - newOptionExtensionDescriptor( - extensionRangeDescriptorProto.GetOptions(), - getMessageExtensionRangeOptionsPath(extensionRangeIndex, topLevelMessageIndex, nestedMessageIndexes...), - f.descriptor.locationStore, - ), - ) - message.addExtensionRange(extensionMessageRange) - } - for enumIndex, enumDescriptorProto := range descriptorProto.GetEnumType() { - nestedEnum, err := f.populateEnum( - enumDescriptorProto, - enumIndex, - // this is all of the message indexes including this one - // TODO we should refactor get.*Path messages to be more consistent - append([]int{topLevelMessageIndex}, nestedMessageIndexes...), - append(nestedMessageNames, message.Name()), - message, - ) - if err != nil { - return nil, err - } - message.addNestedEnum(nestedEnum) - } - for nestedMessageIndex, nestedMessageDescriptorProto := range descriptorProto.GetNestedType() { - nestedMessage, err := f.populateMessage( - nestedMessageDescriptorProto, - topLevelMessageIndex, - append(nestedMessageIndexes, nestedMessageIndex), - append(nestedMessageNames, message.Name()), - message, - ) - if err != nil { - return nil, err - } - message.addNestedMessage(nestedMessage) - } - return message, nil -} - -func (f *file) populateService( - serviceDescriptorProto *descriptorpb.ServiceDescriptorProto, - serviceIndex int, -) (Service, error) { - serviceNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getServicePath(serviceIndex), - ), - serviceDescriptorProto.GetName(), - getServiceNamePath(serviceIndex), - nil, - ) - if err != nil { - return nil, err - } - service := newService( - serviceNamedDescriptor, - newOptionExtensionDescriptor( - serviceDescriptorProto.GetOptions(), - getServiceOptionsPath(serviceIndex), - f.descriptor.locationStore, - ), - serviceDescriptorProto.GetOptions().GetDeprecated(), - ) - for methodIndex, methodDescriptorProto := range serviceDescriptorProto.GetMethod() { - methodNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getMethodPath(serviceIndex, methodIndex), - ), - methodDescriptorProto.GetName(), - getMethodNamePath(serviceIndex, methodIndex), - []string{service.Name()}, - ) - if err != nil { - return nil, err - } - method, err := newMethod( - methodNamedDescriptor, - newOptionExtensionDescriptor( - methodDescriptorProto.GetOptions(), - getMethodOptionsPath(serviceIndex, methodIndex), - f.descriptor.locationStore, - ), - service, - strings.TrimPrefix(methodDescriptorProto.GetInputType(), "."), - strings.TrimPrefix(methodDescriptorProto.GetOutputType(), "."), - methodDescriptorProto.GetClientStreaming(), - methodDescriptorProto.GetServerStreaming(), - methodDescriptorProto.GetOptions().GetDeprecated(), - getMethodInputTypePath(serviceIndex, methodIndex), - getMethodOutputTypePath(serviceIndex, methodIndex), - methodDescriptorProto.GetOptions().GetIdempotencyLevel(), - getMethodIdempotencyLevelPath(serviceIndex, methodIndex), - ) - if err != nil { - return nil, err - } - service.addMethod(method) - } - return service, nil -} - -func (f *file) populateExtension( - fieldDescriptorProto *descriptorpb.FieldDescriptorProto, - fieldIndex int, -) (Field, error) { - fieldNamedDescriptor, err := newNamedDescriptor( - newLocationDescriptor( - f.descriptor, - getFileExtensionPath(fieldIndex), - ), - fieldDescriptorProto.GetName(), - getFileExtensionNamePath(fieldIndex), - nil, - ) - if err != nil { - return nil, err - } - var packed *bool - if fieldDescriptorProto.Options != nil { - packed = fieldDescriptorProto.GetOptions().Packed - } - return newField( - fieldNamedDescriptor, - newOptionExtensionDescriptor( - fieldDescriptorProto.GetOptions(), - getFileExtensionOptionsPath(fieldIndex), - f.descriptor.locationStore, - ), - nil, - int(fieldDescriptorProto.GetNumber()), - fieldDescriptorProto.GetLabel(), - fieldDescriptorProto.GetType(), - strings.TrimPrefix(fieldDescriptorProto.GetTypeName(), "."), - strings.TrimPrefix(fieldDescriptorProto.GetExtendee(), "."), - nil, - fieldDescriptorProto.GetProto3Optional(), - fieldDescriptorProto.GetJsonName(), - fieldDescriptorProto.GetOptions().GetJstype(), - fieldDescriptorProto.GetOptions().GetCtype(), - fieldDescriptorProto.GetOptions().GetRetention(), - fieldDescriptorProto.GetOptions().GetTargets(), - fieldDescriptorProto.GetOptions().GetDebugRedact(), - packed, - fieldDescriptorProto.GetOptions().GetDeprecated(), - getFileExtensionNumberPath(fieldIndex), - getFileExtensionTypePath(fieldIndex), - getFileExtensionTypeNamePath(fieldIndex), - getFileExtensionJSONNamePath(fieldIndex), - getFileExtensionJSTypePath(fieldIndex), - getFileExtensionCTypePath(fieldIndex), - getFileExtensionPackedPath(fieldIndex), - getFileExtensionExtendeePath(fieldIndex), - ), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/file_import.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/file_import.go deleted file mode 100644 index d4240e1568..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/file_import.go +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import "fmt" - -type fileImport struct { - descriptor - - imp string - isPublic bool - isWeak bool - isUnused bool - path []int32 -} - -func newFileImport( - descriptor descriptor, - imp string, - path []int32, -) (*fileImport, error) { - if imp == "" { - return nil, fmt.Errorf("no dependency value in %q", descriptor.File().Path()) - } - return &fileImport{ - descriptor: descriptor, - imp: imp, - path: path, - }, nil -} - -func (f *fileImport) Import() string { - return f.imp -} - -func (f *fileImport) IsPublic() bool { - return f.isPublic -} - -func (f *fileImport) IsWeak() bool { - return f.isWeak -} - -func (f *fileImport) IsUnused() bool { - return f.isUnused -} - -func (f *fileImport) Location() Location { - return f.getLocation(f.path) -} - -func (f *fileImport) setIsPublic() { - f.isPublic = true -} - -func (f *fileImport) setIsWeak() { - f.isWeak = true -} - -func (f *fileImport) setIsUnused() { - f.isUnused = true -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/files.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/files.go deleted file mode 100644 index 04d986c37c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/files.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "context" - - "github.com/bufbuild/buf/private/pkg/thread" - "go.uber.org/multierr" -) - -const defaultChunkSizeThreshold = 8 - -func newFilesUnstable(ctx context.Context, inputFiles ...InputFile) ([]File, error) { - if len(inputFiles) == 0 { - return nil, nil - } - - chunkSize := len(inputFiles) / thread.Parallelism() - if defaultChunkSizeThreshold != 0 && chunkSize < defaultChunkSizeThreshold { - files := make([]File, 0, len(inputFiles)) - for _, inputFile := range inputFiles { - file, err := NewFile(inputFile) - if err != nil { - return nil, err - } - files = append(files, file) - } - return files, nil - } - - chunks := inputFilesToChunks(inputFiles, chunkSize) - resultC := make(chan *result, len(chunks)) - for _, inputFileChunk := range chunks { - inputFileChunk := inputFileChunk - go func() { - files := make([]File, 0, len(inputFileChunk)) - for _, inputFile := range inputFileChunk { - file, err := NewFile(inputFile) - if err != nil { - resultC <- newResult(nil, err) - return - } - files = append(files, file) - } - resultC <- newResult(files, nil) - }() - } - files := make([]File, 0, len(inputFiles)) - var err error - for i := 0; i < len(chunks); i++ { - select { - case <-ctx.Done(): - return nil, ctx.Err() - case result := <-resultC: - files = append(files, result.Files...) - err = multierr.Append(err, result.Err) - } - } - if err != nil { - return nil, err - } - return files, nil -} - -func inputFilesToChunks(s []InputFile, chunkSize int) [][]InputFile { - var chunks [][]InputFile - if len(s) == 0 { - return chunks - } - if chunkSize <= 0 { - return [][]InputFile{s} - } - c := make([]InputFile, len(s)) - copy(c, s) - // https://github.com/golang/go/wiki/SliceTricks#batching-with-minimal-allocation - for chunkSize < len(c) { - c, chunks = c[chunkSize:], append(chunks, c[0:chunkSize:chunkSize]) - } - return append(chunks, c) -} - -type result struct { - Files []File - Err error -} - -func newResult(files []File, err error) *result { - return &result{ - Files: files, - Err: err, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/location.go deleted file mode 100644 index 46273cff52..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import "google.golang.org/protobuf/types/descriptorpb" - -type location struct { - sourceCodeInfoLocation *descriptorpb.SourceCodeInfo_Location -} - -func newLocation(sourceCodeInfoLocation *descriptorpb.SourceCodeInfo_Location) *location { - return &location{ - sourceCodeInfoLocation: sourceCodeInfoLocation, - } -} - -func (l *location) StartLine() int { - switch len(l.sourceCodeInfoLocation.Span) { - case 3, 4: - return int(l.sourceCodeInfoLocation.Span[0]) + 1 - default: - // since we are not erroring, making this and others 1 so that other code isn't messed up by assuming - // this is >= 1 - return 1 - } -} - -func (l *location) StartColumn() int { - switch len(l.sourceCodeInfoLocation.Span) { - case 3, 4: - return int(l.sourceCodeInfoLocation.Span[1]) + 1 - default: - // since we are not erroring, making this and others 1 so that other code isn't messed up by assuming - // this is >= 1 - return 1 - } -} - -func (l *location) EndLine() int { - switch len(l.sourceCodeInfoLocation.Span) { - case 3: - return int(l.sourceCodeInfoLocation.Span[0]) + 1 - case 4: - return int(l.sourceCodeInfoLocation.Span[2]) + 1 - default: - // since we are not erroring, making this and others 1 so that other code isn't messed up by assuming - // this is >= 1 - return 1 - } -} - -func (l *location) EndColumn() int { - switch len(l.sourceCodeInfoLocation.Span) { - case 3: - return int(l.sourceCodeInfoLocation.Span[2]) + 1 - case 4: - return int(l.sourceCodeInfoLocation.Span[3]) + 1 - default: - // since we are not erroring, making this and others 1 so that other code isn't messed up by assuming - // this is >= 1 - return 1 - } -} - -func (l *location) LeadingComments() string { - if l.sourceCodeInfoLocation.LeadingComments == nil { - return "" - } - return *l.sourceCodeInfoLocation.LeadingComments -} - -func (l *location) TrailingComments() string { - if l.sourceCodeInfoLocation.TrailingComments == nil { - return "" - } - return *l.sourceCodeInfoLocation.TrailingComments -} - -func (l *location) LeadingDetachedComments() []string { - return l.sourceCodeInfoLocation.LeadingDetachedComments -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_descriptor.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_descriptor.go deleted file mode 100644 index 1f792097b1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_descriptor.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type locationDescriptor struct { - descriptor - - path []int32 -} - -func newLocationDescriptor( - descriptor descriptor, - path []int32, -) locationDescriptor { - return locationDescriptor{ - descriptor: descriptor, - path: path, - } -} - -func (l *locationDescriptor) Location() Location { - return l.getLocation(l.path) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_store.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_store.go deleted file mode 100644 index e05931a59e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/location_store.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "sync" - - "google.golang.org/protobuf/types/descriptorpb" -) - -type locationStore struct { - sourceCodeInfoLocations []*descriptorpb.SourceCodeInfo_Location - - initLocations sync.Once - pathToLocation map[string]Location -} - -func newLocationStore(sourceCodeInfoLocations []*descriptorpb.SourceCodeInfo_Location) *locationStore { - return &locationStore{ - sourceCodeInfoLocations: sourceCodeInfoLocations, - pathToLocation: make(map[string]Location), - } -} - -func (l *locationStore) getLocation(path []int32) Location { - return l.getLocationByPathKey(getPathKey(path)) -} - -func (l *locationStore) getLocationByPathKey(pathKey string) Location { - l.initLocations.Do(func() { - pathToLocation := make(map[string]Location) - for _, sourceCodeInfoLocation := range l.sourceCodeInfoLocations { - pathKey := getPathKey(sourceCodeInfoLocation.Path) - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - if _, ok := pathToLocation[pathKey]; !ok { - pathToLocation[pathKey] = newLocation(sourceCodeInfoLocation) - } - } - l.pathToLocation = pathToLocation - }) - - return l.pathToLocation[pathKey] -} - -func getPathKey(path []int32) string { - key := make([]byte, len(path)*4) - j := 0 - for _, elem := range path { - key[j] = byte(elem) - key[j+1] = byte(elem >> 8) - key[j+2] = byte(elem >> 16) - key[j+3] = byte(elem >> 24) - j += 4 - } - return string(key) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/merge_comment_location.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/merge_comment_location.go deleted file mode 100644 index 92cd7da140..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/merge_comment_location.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type mergeCommentLocation struct { - base Location - delegate Location - baseHasComments bool -} - -func newMergeCommentLocation(base Location, delegate Location) *mergeCommentLocation { - return &mergeCommentLocation{ - base: base, - delegate: delegate, - baseHasComments: base.LeadingComments() != "" || base.TrailingComments() != "" || len(base.LeadingDetachedComments()) > 0, - } -} - -func (l *mergeCommentLocation) StartLine() int { - return l.base.StartLine() -} - -func (l *mergeCommentLocation) StartColumn() int { - return l.base.StartColumn() -} - -func (l *mergeCommentLocation) EndLine() int { - return l.base.EndLine() -} - -func (l *mergeCommentLocation) EndColumn() int { - return l.base.EndColumn() -} - -func (l *mergeCommentLocation) LeadingComments() string { - if l.baseHasComments { - return l.base.LeadingComments() - } - return l.delegate.LeadingComments() -} - -func (l *mergeCommentLocation) TrailingComments() string { - if l.baseHasComments { - return l.base.TrailingComments() - } - return l.delegate.TrailingComments() -} - -func (l *mergeCommentLocation) LeadingDetachedComments() []string { - if l.baseHasComments { - return l.base.LeadingDetachedComments() - } - return l.delegate.LeadingDetachedComments() -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/message.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/message.go deleted file mode 100644 index 1c2054df5e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/message.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type message struct { - namedDescriptor - optionExtensionDescriptor - - fields []Field - extensions []Field - nestedMessages []Message - nestedEnums []Enum - oneofs []Oneof - reservedMessageRanges []MessageRange - reservedNames []ReservedName - extensionRanges []ExtensionRange - parent Message - isMapEntry bool - messageSetWireFormat bool - noStandardDescriptorAccessor bool - deprecatedLegacyJSONFieldConflicts bool - deprecated bool - messageSetWireFormatPath []int32 - noStandardDescriptorAccessorPath []int32 -} - -func newMessage( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - parent Message, - isMapEntry bool, - messageSetWireFormat bool, - noStandardDescriptorAccessor bool, - deprecatedLegacyJSONFieldConflicts bool, - deprecated bool, - messageSetWireFormatPath []int32, - noStandardDescriptorAccessorPath []int32, -) *message { - return &message{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - parent: parent, - isMapEntry: isMapEntry, - messageSetWireFormat: messageSetWireFormat, - noStandardDescriptorAccessor: noStandardDescriptorAccessor, - deprecatedLegacyJSONFieldConflicts: deprecatedLegacyJSONFieldConflicts, - deprecated: deprecated, - messageSetWireFormatPath: messageSetWireFormatPath, - noStandardDescriptorAccessorPath: noStandardDescriptorAccessorPath, - } -} - -func (m *message) Fields() []Field { - return m.fields -} - -func (m *message) Extensions() []Field { - return m.extensions -} - -func (m *message) Messages() []Message { - return m.nestedMessages -} - -func (m *message) Enums() []Enum { - return m.nestedEnums -} - -func (m *message) Oneofs() []Oneof { - return m.oneofs -} - -func (m *message) ReservedMessageRanges() []MessageRange { - return m.reservedMessageRanges -} - -func (m *message) ReservedTagRanges() []TagRange { - tagRanges := make([]TagRange, len(m.reservedMessageRanges)) - for i, reservedMessageRange := range m.reservedMessageRanges { - tagRanges[i] = reservedMessageRange - } - return tagRanges -} - -func (m *message) ReservedNames() []ReservedName { - return m.reservedNames -} - -func (m *message) ExtensionRanges() []ExtensionRange { - return m.extensionRanges -} - -func (m *message) ExtensionMessageRanges() []MessageRange { - extMsgRanges := make([]MessageRange, len(m.extensionRanges)) - for i, extensionRange := range m.extensionRanges { - extMsgRanges[i] = extensionRange - } - return extMsgRanges -} - -func (m *message) Parent() Message { - return m.parent -} - -func (m *message) IsMapEntry() bool { - return m.isMapEntry -} - -func (m *message) MessageSetWireFormat() bool { - return m.messageSetWireFormat -} - -func (m *message) NoStandardDescriptorAccessor() bool { - return m.noStandardDescriptorAccessor -} - -func (m *message) DeprecatedLegacyJSONFieldConflicts() bool { - return m.deprecatedLegacyJSONFieldConflicts -} - -func (m *message) Deprecated() bool { - return m.deprecated -} - -func (m *message) MessageSetWireFormatLocation() Location { - return m.getLocation(m.messageSetWireFormatPath) -} - -func (m *message) NoStandardDescriptorAccessorLocation() Location { - return m.getLocation(m.noStandardDescriptorAccessorPath) -} - -func (m *message) addField(field Field) { - m.fields = append(m.fields, field) -} - -func (m *message) addExtension(extension Field) { - m.extensions = append(m.extensions, extension) -} - -func (m *message) addNestedMessage(nestedMessage Message) { - m.nestedMessages = append(m.nestedMessages, nestedMessage) -} - -func (m *message) addNestedEnum(nestedEnum Enum) { - m.nestedEnums = append(m.nestedEnums, nestedEnum) -} - -func (m *message) addOneof(oneof Oneof) { - m.oneofs = append(m.oneofs, oneof) -} - -func (m *message) addReservedMessageRange(reservedMessageRange MessageRange) { - m.reservedMessageRanges = append(m.reservedMessageRanges, reservedMessageRange) -} - -func (m *message) addReservedName(reservedName ReservedName) { - m.reservedNames = append(m.reservedNames, reservedName) -} - -func (m *message) addExtensionRange(extensionRange ExtensionRange) { - m.extensionRanges = append(m.extensionRanges, extensionRange) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/message_range.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/message_range.go deleted file mode 100644 index 4279d7fa3c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/message_range.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -const ( - messageRangeInclusiveMax = 536870911 -) - -type messageRange struct { - locationDescriptor - - message Message - start int - end int -} - -func newMessageRange( - locationDescriptor locationDescriptor, - message Message, - start int, - end int, -) *messageRange { - return &messageRange{ - locationDescriptor: locationDescriptor, - message: message, - start: start, - // end is exclusive for messages - end: end - 1, - } -} - -func newFreeMessageRange(message Message, start int, endInclusive int) MessageRange { - return newMessageRange( - newLocationDescriptor( - newDescriptor( - message.File(), - nil, - ), - nil, - ), - message, - start, - // we expect exclusive for newMessageRange - endInclusive+1, - ) -} - -func (r *messageRange) Message() Message { - return r.message -} - -func (r *messageRange) Start() int { - return r.start -} - -func (r *messageRange) End() int { - return r.end -} - -func (r *messageRange) Max() bool { - return r.end == messageRangeInclusiveMax -} - -type extensionRange struct { - *messageRange - optionExtensionDescriptor -} - -func newExtensionRange( - locationDescriptor locationDescriptor, - message Message, - start int, - end int, - opts optionExtensionDescriptor, -) *extensionRange { - return &extensionRange{ - messageRange: newMessageRange( - locationDescriptor, message, start, end, - ), - optionExtensionDescriptor: opts, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/method.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/method.go deleted file mode 100644 index ac3f2a6882..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/method.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "fmt" - - "google.golang.org/protobuf/types/descriptorpb" -) - -type method struct { - namedDescriptor - optionExtensionDescriptor - - service Service - inputTypeName string - outputTypeName string - clientStreaming bool - serverStreaming bool - deprecated bool - inputTypePath []int32 - outputTypePath []int32 - idempotencyLevel descriptorpb.MethodOptions_IdempotencyLevel - idempotencyLevelPath []int32 -} - -func newMethod( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - service Service, - inputTypeName string, - outputTypeName string, - clientStreaming bool, - serverStreaming bool, - deprecated bool, - inputTypePath []int32, - outputTypePath []int32, - idempotencyLevel descriptorpb.MethodOptions_IdempotencyLevel, - idempotencyLevelPath []int32, -) (*method, error) { - if inputTypeName == "" { - return nil, fmt.Errorf("no inputTypeName on %q", namedDescriptor.name) - } - if outputTypeName == "" { - return nil, fmt.Errorf("no outputTypeName on %q", namedDescriptor.name) - } - return &method{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - service: service, - inputTypeName: inputTypeName, - outputTypeName: outputTypeName, - clientStreaming: clientStreaming, - serverStreaming: serverStreaming, - deprecated: deprecated, - inputTypePath: inputTypePath, - outputTypePath: outputTypePath, - idempotencyLevel: idempotencyLevel, - idempotencyLevelPath: idempotencyLevelPath, - }, nil -} - -func (m *method) Service() Service { - return m.service -} - -func (m *method) InputTypeName() string { - return m.inputTypeName -} - -func (m *method) OutputTypeName() string { - return m.outputTypeName -} - -func (m *method) ClientStreaming() bool { - return m.clientStreaming -} - -func (m *method) ServerStreaming() bool { - return m.serverStreaming -} - -func (m *method) Deprecated() bool { - return m.deprecated -} - -func (m *method) InputTypeLocation() Location { - return m.getLocation(m.inputTypePath) -} - -func (m *method) OutputTypeLocation() Location { - return m.getLocation(m.outputTypePath) -} - -func (m *method) IdempotencyLevel() descriptorpb.MethodOptions_IdempotencyLevel { - return m.idempotencyLevel -} - -func (m *method) IdempotencyLevelLocation() Location { - return m.getLocation(m.idempotencyLevelPath) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/named_descriptor.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/named_descriptor.go deleted file mode 100644 index d1e28d9821..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/named_descriptor.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "fmt" - "strings" -) - -type namedDescriptor struct { - locationDescriptor - - name string - namePath []int32 - nestedNames []string -} - -func newNamedDescriptor( - locationDescriptor locationDescriptor, - name string, - namePath []int32, - nestedNames []string, -) (namedDescriptor, error) { - if name == "" { - return namedDescriptor{}, fmt.Errorf("no name in %q", locationDescriptor.File().Path()) - } - return namedDescriptor{ - locationDescriptor: locationDescriptor, - name: name, - namePath: namePath, - nestedNames: nestedNames, - }, nil -} - -func (n *namedDescriptor) FullName() string { - if n.File().Package() != "" { - return n.File().Package() + "." + n.NestedName() - } - return n.NestedName() -} - -func (n *namedDescriptor) NestedName() string { - if len(n.nestedNames) == 0 { - return n.Name() - } - return strings.Join(n.nestedNames, ".") + "." + n.Name() -} - -func (n *namedDescriptor) Name() string { - return n.name -} - -func (n *namedDescriptor) NameLocation() Location { - nameLocation := n.getLocation(n.namePath) - location := n.getLocation(n.path) - if nameLocation != nil { - if location != nil { - return newMergeCommentLocation(nameLocation, location) - } - return nameLocation - } - return location -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/oneof.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/oneof.go deleted file mode 100644 index 1cf00fd605..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/oneof.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type oneof struct { - namedDescriptor - optionExtensionDescriptor - - message Message - fields []Field -} - -func newOneof( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - message Message, -) *oneof { - return &oneof{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - message: message, - } -} - -func (o *oneof) Message() Message { - return o.message -} - -func (o *oneof) Fields() []Field { - return o.fields -} - -func (o *oneof) addField(field Field) { - o.fields = append(o.fields, field) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/option_extension_descriptor.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/option_extension_descriptor.go deleted file mode 100644 index 97c5b86cf6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/option_extension_descriptor.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import ( - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" -) - -type optionExtensionDescriptor struct { - message proto.Message - optionsPath []int32 - locationStore *locationStore -} - -func newOptionExtensionDescriptor(message proto.Message, optionsPath []int32, locationStore *locationStore) optionExtensionDescriptor { - return optionExtensionDescriptor{ - message: message, - optionsPath: optionsPath, - locationStore: locationStore, - } -} - -func (o *optionExtensionDescriptor) OptionExtension(extensionType protoreflect.ExtensionType) (interface{}, bool) { - if extensionType.TypeDescriptor().ContainingMessage().FullName() != o.message.ProtoReflect().Descriptor().FullName() { - return nil, false - } - if !proto.HasExtension(o.message, extensionType) { - return nil, false - } - return proto.GetExtension(o.message, extensionType), true -} - -func (o *optionExtensionDescriptor) OptionExtensionLocation(extensionType protoreflect.ExtensionType, extraPath ...int32) Location { - if extensionType.TypeDescriptor().ContainingMessage().FullName() != o.message.ProtoReflect().Descriptor().FullName() { - return nil - } - if o.locationStore == nil { - return nil - } - path := make([]int32, len(o.optionsPath), len(o.optionsPath)+1+len(extraPath)) - copy(path, o.optionsPath) - path = append(path, int32(extensionType.TypeDescriptor().Number())) - extensionPathLen := len(path) // length of path to extension (without extraPath) - path = append(path, extraPath...) - loc := o.locationStore.getLocation(path) - if loc != nil { - // Found an exact match! - return loc - } - // "Fuzzy" search: find a location whose path is at least extensionPathLen long, - // preferring the longest matching ancestor path (i.e. as many extraPath elements - // as can be found). If we find a *sub*path (a descendant path, that points INTO - // the path we are trying to find), use the first such one encountered. - var bestMatch *descriptorpb.SourceCodeInfo_Location - var bestMatchPathLen int - for _, loc := range o.locationStore.sourceCodeInfoLocations { - if len(loc.Path) >= extensionPathLen && isDescendantPath(path, loc.Path) && len(loc.Path) > bestMatchPathLen { - bestMatch = loc - bestMatchPathLen = len(loc.Path) - } else if isDescendantPath(loc.Path, path) { - return newLocation(loc) - } - } - if bestMatch != nil { - return newLocation(bestMatch) - } - return nil -} - -func (o *optionExtensionDescriptor) PresentExtensionNumbers() []int32 { - fieldNumbersSet := map[int32]struct{}{} - var fieldNumbers []int32 - addFieldNumber := func(fieldNo int32) { - if _, ok := fieldNumbersSet[fieldNo]; !ok { - fieldNumbersSet[fieldNo] = struct{}{} - fieldNumbers = append(fieldNumbers, fieldNo) - } - } - msg := o.message.ProtoReflect() - extensionRanges := msg.Descriptor().ExtensionRanges() - for b := msg.GetUnknown(); len(b) > 0; { - fieldNo, _, n := protowire.ConsumeField(b) - if extensionRanges.Has(fieldNo) { - addFieldNumber(int32(fieldNo)) - } - b = b[n:] - } - // Extensions for google.protobuf.*Options are a bit of a special case - // as the extensions in a FileDescriptorSet message may differ with - // the extensions defined in the proto with which buf is compiled. - // - // Also loop through known extensions here to get extension numbers. - msg.Range(func(fieldDescriptor protoreflect.FieldDescriptor, _ protoreflect.Value) bool { - if fieldDescriptor.IsExtension() { - addFieldNumber(int32(fieldDescriptor.Number())) - } - return true - }) - - return fieldNumbers -} - -func isDescendantPath(descendant, ancestor []int32) bool { - if len(descendant) < len(ancestor) { - return false - } - for i := range ancestor { - if descendant[i] != ancestor[i] { - return false - } - } - return true -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/paths.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/paths.go deleted file mode 100644 index aa6e2aa7e2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/paths.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -var ( - csharpNamespacePathKey = getPathKey([]int32{8, 37}) - goPackagePathKey = getPathKey([]int32{8, 11}) - javaMultipleFilesPathKey = getPathKey([]int32{8, 10}) - javaOuterClassnamePathKey = getPathKey([]int32{8, 8}) - javaPackagePathKey = getPathKey([]int32{8, 1}) - javaStringCheckUtf8PathKey = getPathKey([]int32{8, 27}) - objcClassPrefixPathKey = getPathKey([]int32{8, 36}) - packagePathKey = getPathKey([]int32{2}) - phpClassPrefixPathKey = getPathKey([]int32{8, 40}) - phpNamespacePathKey = getPathKey([]int32{8, 41}) - phpMetadataNamespacePathKey = getPathKey([]int32{8, 44}) - rubyPackagePathKey = getPathKey([]int32{8, 45}) - swiftPrefixPathKey = getPathKey([]int32{8, 39}) - optimizeForPathKey = getPathKey([]int32{8, 9}) - ccGenericServicesPathKey = getPathKey([]int32{8, 16}) - javaGenericServicesPathKey = getPathKey([]int32{8, 17}) - pyGenericServicesPathKey = getPathKey([]int32{8, 18}) - phpGenericServicesPathKey = getPathKey([]int32{8, 42}) - ccEnableArenasPathKey = getPathKey([]int32{8, 31}) - syntaxPathKey = getPathKey([]int32{12}) -) - -func getDependencyPath(dependencyIndex int) []int32 { - return []int32{3, int32(dependencyIndex)} -} - -func getMessagePath(topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - path := []int32{4, int32(topLevelMessageIndex)} - for _, nestedMessageIndex := range nestedMessageIndexes { - path = append(path, 3, int32(nestedMessageIndex)) - } - return path -} - -func getMessageNamePath(messageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(messageIndex, nestedMessageIndexes...), 1) -} - -func getMessageOptionsPath(messageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(messageIndex, nestedMessageIndexes...), 7) -} - -func getMessageMessageSetWireFormatPath(messageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(messageIndex, nestedMessageIndexes...), 7, 1) -} - -func getMessageNoStandardDescriptorAccessorPath(messageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(messageIndex, nestedMessageIndexes...), 7, 2) -} - -func getMessageFieldPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 2, int32(fieldIndex)) -} - -func getMessageFieldNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 1) -} - -func getMessageFieldNumberPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 3) -} - -func getMessageFieldTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 5) -} - -func getMessageFieldTypeNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 6) -} - -func getMessageFieldJSONNamePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 10) -} - -func getMessageFieldOptionsPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8) -} - -func getMessageFieldJSTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 6) -} - -func getMessageFieldCTypePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 1) -} - -func getMessageFieldPackedPath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 2) -} - -func getMessageFieldExtendeePath(fieldIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageFieldPath(fieldIndex, topLevelMessageIndex, nestedMessageIndexes...), 2) -} - -func getMessageExtensionPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 6, int32(extensionIndex)) -} - -func getMessageExtensionNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 1) -} - -func getMessageExtensionNumberPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 3) -} - -func getMessageExtensionTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 5) -} - -func getMessageExtensionTypeNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 6) -} - -func getMessageExtensionJSONNamePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 10) -} - -func getMessageExtensionOptionsPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8) -} - -func getMessageExtensionJSTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 6) -} - -func getMessageExtensionCTypePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 1) -} - -func getMessageExtensionPackedPath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 8, 2) -} - -func getMessageExtensionExtendeePath(extensionIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageExtensionPath(extensionIndex, topLevelMessageIndex, nestedMessageIndexes...), 2) -} - -func getMessageOneofPath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 8, int32(oneofIndex)) -} - -func getMessageOneofNamePath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), 1) -} - -func getMessageOneofOptionsPath(oneofIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessageOneofPath(oneofIndex, topLevelMessageIndex, nestedMessageIndexes...), 2) -} - -func getMessageReservedRangePath(reservedRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 9, int32(reservedRangeIndex)) -} - -func getMessageReservedNamePath(reservedNameIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 10, int32(reservedNameIndex)) -} - -func getMessageExtensionRangePath(extensionRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 5, int32(extensionRangeIndex)) -} - -func getMessageExtensionRangeOptionsPath(extensionRangeIndex int, topLevelMessageIndex int, nestedMessageIndexes ...int) []int32 { - return append(getMessagePath(topLevelMessageIndex, nestedMessageIndexes...), 5, int32(extensionRangeIndex), 3) -} - -func getEnumPath(enumIndex int, nestedMessageIndexes ...int) []int32 { - if len(nestedMessageIndexes) == 0 { - return []int32{5, int32(enumIndex)} - } - path := []int32{4, int32(nestedMessageIndexes[0])} - for _, nestedMessageIndex := range nestedMessageIndexes[1:] { - path = append(path, 3, int32(nestedMessageIndex)) - } - return append(path, 4, int32(enumIndex)) -} - -func getEnumNamePath(enumIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 1) -} - -func getEnumOptionsPath(enumIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 3) -} - -func getEnumAllowAliasPath(enumIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 3, 2) -} - -func getEnumValuePath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 2, int32(enumValueIndex)) -} - -func getEnumValueNamePath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 1) -} - -func getEnumValueNumberPath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 2) -} - -func getEnumValueOptionsPath(enumIndex int, enumValueIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumValuePath(enumIndex, enumValueIndex, nestedMessageIndexes...), 3) -} - -func getEnumReservedRangePath(enumIndex int, reservedRangeIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 4, int32(reservedRangeIndex)) -} - -func getEnumReservedNamePath(enumIndex int, reservedNameIndex int, nestedMessageIndexes ...int) []int32 { - return append(getEnumPath(enumIndex, nestedMessageIndexes...), 5, int32(reservedNameIndex)) -} - -func getServicePath(serviceIndex int) []int32 { - return []int32{6, int32(serviceIndex)} -} - -func getServiceNamePath(serviceIndex int) []int32 { - return append(getServicePath(serviceIndex), 1) -} - -func getServiceOptionsPath(serviceIndex int) []int32 { - return append(getServicePath(serviceIndex), 3) -} - -func getMethodPath(serviceIndex int, methodIndex int) []int32 { - return []int32{6, int32(serviceIndex), 2, int32(methodIndex)} -} - -func getMethodNamePath(serviceIndex int, methodIndex int) []int32 { - return append(getMethodPath(serviceIndex, methodIndex), 1) -} - -func getMethodInputTypePath(serviceIndex int, methodIndex int) []int32 { - return append(getMethodPath(serviceIndex, methodIndex), 2) -} - -func getMethodOutputTypePath(serviceIndex int, methodIndex int) []int32 { - return append(getMethodPath(serviceIndex, methodIndex), 3) -} - -func getMethodOptionsPath(serviceIndex int, methodIndex int) []int32 { - return append(getMethodPath(serviceIndex, methodIndex), 4) -} - -func getMethodIdempotencyLevelPath(serviceIndex int, methodIndex int) []int32 { - return append(getMethodPath(serviceIndex, methodIndex), 4, 34) -} - -func getFileExtensionPath(fieldIndex int) []int32 { - return []int32{7, int32(fieldIndex)} -} - -func getFileExtensionNamePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 1) -} - -func getFileExtensionNumberPath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 3) -} - -func getFileExtensionTypePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 5) -} - -func getFileExtensionTypeNamePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 6) -} - -func getFileExtensionJSONNamePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 10) -} - -func getFileExtensionOptionsPath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 8) -} - -func getFileExtensionJSTypePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 8, 6) -} - -func getFileExtensionCTypePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 8, 1) -} - -func getFileExtensionPackedPath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 8, 2) -} - -func getFileExtensionExtendeePath(fieldIndex int) []int32 { - return append(getFileExtensionPath(fieldIndex), 2) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/protosource.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/protosource.go deleted file mode 100644 index a281e0b640..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/protosource.go +++ /dev/null @@ -1,1252 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package protosource defines minimal interfaces for Protobuf descriptor types. -// -// This is done so that the backing package can be swapped out easily. -// -// All values that return SourceLocation can be nil. -// -// Testing is currently implicitly done through the bufcheck packages, however -// if this were to be split out into a separate library, it would need a separate -// testing suite. -package protosource - -import ( - "context" - "fmt" - "sort" - "strconv" - "strings" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/protodescriptor" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" -) - -const ( - // SyntaxUnspecified represents no syntax being specified. - // - // This is functionally equivalent to SyntaxProto2. - SyntaxUnspecified Syntax = iota + 1 - // SyntaxProto2 represents the proto2 syntax. - SyntaxProto2 - // SyntaxProto3 represents the proto3 syntax. - SyntaxProto3 - // SyntaxEditions represents the editions syntax. - SyntaxEditions -) - -// Syntax is the syntax of a file. -type Syntax int - -// String returns the string representation of s -func (s Syntax) String() string { - switch s { - case SyntaxUnspecified: - return "unspecified" - case SyntaxProto2: - return "proto2" - case SyntaxProto3: - return "proto3" - case SyntaxEditions: - return "editions" - default: - return strconv.Itoa(int(s)) - } -} - -// Descriptor is the base interface for a descriptor type. -type Descriptor interface { - // File returns the associated File. - // - // Always non-nil. - File() File -} - -// LocationDescriptor is the base interface for a descriptor type with a location. -type LocationDescriptor interface { - Descriptor - - // Location returns the location of the entire descriptor. - // - // Can return nil, although will generally not be nil. - Location() Location -} - -// NamedDescriptor is the base interface for a named descriptor type. -type NamedDescriptor interface { - LocationDescriptor - - // FullName returns the fully-qualified name, i.e. some.pkg.Nested.Message.FooEnum.ENUM_VALUE. - // - // Always non-empty. - FullName() string - // NestedName returns the full nested name without the package, i.e. Nested.Message.FooEnum - // or Nested.Message.FooEnum.ENUM_VALUE. - // - // Always non-empty. - NestedName() string - // Name returns the short name, or the name of a value or field, i.e. FooEnum or ENUM_VALUE. - // - // Always non-empty. - Name() string - // NameLocation returns the location of the name of the descriptor. - // - // If the backing descriptor does not have name-level resolution, this will - // attempt to return a location of the entire descriptor. - // - // If the backing descriptor has comments for the entire descriptor, these - // will be added to the named location. - // - // Can return nil. - NameLocation() Location -} - -// ContainerDescriptor contains Enums and Messages. -type ContainerDescriptor interface { - Enums() []Enum - Messages() []Message -} - -// OptionExtensionDescriptor contains option extensions. -type OptionExtensionDescriptor interface { - // OptionExtension returns the value for an options extension field. - // - // Returns false if the extension is not set. - // - // See https://pkg.go.dev/google.golang.org/protobuf/proto#HasExtension - // See https://pkg.go.dev/google.golang.org/protobuf/proto#GetExtension - OptionExtension(extensionType protoreflect.ExtensionType) (interface{}, bool) - - // OptionExtensionLocation returns the source location where the given extension - // field value is defined. The extra path can be additional path elements, for - // getting the location of specific elements inside the extension, for message - // and repeated values. - // - // If a precise location cannot be found, but a general one can be, the general - // location will be returned. For example, if a specific field inside a message - // extension is requested but the source code info only includes information - // about the message itself (and not that particular field), the location of the - // message value is returned. Conversely, if a message location is requested but - // the source code info only has information about specific fields inside that - // message, the first such location is returned. Similarly, if multiple locations - // are in source code info for the requested value, the first one is returned. - // - // If no relevant location is found in source code info, this returns nil. - OptionExtensionLocation(extensionType protoreflect.ExtensionType, extraPath ...int32) Location - - // PresentExtensionNumbers returns field numbers for all options that - // have a set value on this descriptor. - PresentExtensionNumbers() []int32 -} - -// Location defines source code info location information. -// -// May be extended in the future to include comments. -// -// Note that unlike SourceCodeInfo_Location, these are not zero-indexed. -type Location interface { - StartLine() int - StartColumn() int - EndLine() int - EndColumn() int - LeadingComments() string - TrailingComments() string - // NOT a copy. Do not modify. - LeadingDetachedComments() []string -} - -// ModuleIdentity is a module identity. -type ModuleIdentity interface { - Remote() string - Owner() string - Repository() string -} - -// FileInfo contains Protobuf file info. -type FileInfo interface { - // Path is the path of the file relative to the root it is contained within. - // This will be normalized, validated and never empty, - // This will be unique within a given Image. - Path() string - // ExternalPath returns the path that identifies this file externally. - // - // This will be unnormalized. - // Never empty. Falls back to Path if there is not an external path. - // - // Example: - // Assume we had the input path /foo/bar which is a local directory. - - // Path: one/one.proto - // RootDirPath: proto - // ExternalPath: /foo/bar/proto/one/one.proto - ExternalPath() string - // ModuleIdentity is the module that this file came from. - // - // Note this *can* be nil if we did not build from a named module. - // All code must assume this can be nil. - // Note that nil checking should work since the backing type is always a pointer. - ModuleIdentity() ModuleIdentity - // Commit is the commit for the module that this file came from. - // - // This will only be set if ModuleIdentity is set, but may not be set - // even if ModuleIdentity is set, that is commit is optional information - // even if we know what module this file came from. - Commit() string -} - -// File is a file descriptor. -type File interface { - Descriptor - FileInfo - - // Top-level only. - ContainerDescriptor - OptionExtensionDescriptor - - Syntax() Syntax - Package() string - FileImports() []FileImport - Services() []Service - Extensions() []Field - Edition() string - - CsharpNamespace() string - GoPackage() string - JavaMultipleFiles() bool - JavaOuterClassname() string - JavaPackage() string - JavaStringCheckUtf8() bool - ObjcClassPrefix() string - PhpClassPrefix() string - PhpNamespace() string - PhpMetadataNamespace() string - RubyPackage() string - SwiftPrefix() string - Deprecated() bool - - OptimizeFor() descriptorpb.FileOptions_OptimizeMode - CcGenericServices() bool - JavaGenericServices() bool - PyGenericServices() bool - PhpGenericServices() bool - CcEnableArenas() bool - - SyntaxLocation() Location - PackageLocation() Location - CsharpNamespaceLocation() Location - GoPackageLocation() Location - JavaMultipleFilesLocation() Location - JavaOuterClassnameLocation() Location - JavaPackageLocation() Location - JavaStringCheckUtf8Location() Location - ObjcClassPrefixLocation() Location - PhpClassPrefixLocation() Location - PhpNamespaceLocation() Location - PhpMetadataNamespaceLocation() Location - RubyPackageLocation() Location - SwiftPrefixLocation() Location - - OptimizeForLocation() Location - CcGenericServicesLocation() Location - JavaGenericServicesLocation() Location - PyGenericServicesLocation() Location - PhpGenericServicesLocation() Location - CcEnableArenasLocation() Location -} - -// FileImport is a file import descriptor. -type FileImport interface { - LocationDescriptor - - Import() string - IsPublic() bool - IsWeak() bool - IsUnused() bool -} - -// TagRange is a tag range from start to end. -type TagRange interface { - LocationDescriptor - - // Start is the start of the range. - Start() int - // End is the end of the range. - // Inclusive. - End() int - // Max says that the End is the max. - Max() bool -} - -// ReservedName is a reserved name for an enum or message. -type ReservedName interface { - LocationDescriptor - - Value() string -} - -// ReservedDescriptor has reserved ranges and names. -type ReservedDescriptor interface { - ReservedTagRanges() []TagRange - ReservedNames() []ReservedName -} - -// EnumRange is a TagRange for Enums. -type EnumRange interface { - TagRange - - Enum() Enum -} - -// MessageRange is a TagRange for Messages. -type MessageRange interface { - TagRange - - Message() Message -} - -// ExtensionRange represents an extension range in Messages. -type ExtensionRange interface { - MessageRange - OptionExtensionDescriptor -} - -// Enum is an enum descriptor. -type Enum interface { - NamedDescriptor - ReservedDescriptor - OptionExtensionDescriptor - - Values() []EnumValue - ReservedEnumRanges() []EnumRange - - AllowAlias() bool - DeprecatedLegacyJSONFieldConflicts() bool - Deprecated() bool - AllowAliasLocation() Location - - // Will return nil if this is a top-level Enum - Parent() Message -} - -// EnumValue is an enum value descriptor. -type EnumValue interface { - NamedDescriptor - OptionExtensionDescriptor - - Enum() Enum - Number() int - - Deprecated() bool - NumberLocation() Location -} - -// Message is a message descriptor. -type Message interface { - NamedDescriptor - // Only those directly nested under this message. - ContainerDescriptor - ReservedDescriptor - OptionExtensionDescriptor - - // Includes fields in oneofs. - Fields() []Field - Extensions() []Field - Oneofs() []Oneof - ExtensionRanges() []ExtensionRange - ExtensionMessageRanges() []MessageRange - ReservedMessageRanges() []MessageRange - - // Will return nil if this is a top-level message - Parent() Message - IsMapEntry() bool - - MessageSetWireFormat() bool - NoStandardDescriptorAccessor() bool - DeprecatedLegacyJSONFieldConflicts() bool - Deprecated() bool - MessageSetWireFormatLocation() Location - NoStandardDescriptorAccessorLocation() Location -} - -// Field is a field descriptor. -type Field interface { - NamedDescriptor - OptionExtensionDescriptor - - // May be nil if this is attached to a file. - Message() Message - Number() int - Label() descriptorpb.FieldDescriptorProto_Label - Type() descriptorpb.FieldDescriptorProto_Type - TypeName() string - // may be nil - Oneof() Oneof - Proto3Optional() bool - JSONName() string - JSType() descriptorpb.FieldOptions_JSType - CType() descriptorpb.FieldOptions_CType - Retention() descriptorpb.FieldOptions_OptionRetention - Targets() []descriptorpb.FieldOptions_OptionTargetType - DebugRedact() bool - // Set vs unset matters for packed - // See the comments on descriptor.proto - Packed() *bool - Deprecated() bool - // Empty string unless the field is part of an extension - Extendee() string - - NumberLocation() Location - TypeLocation() Location - TypeNameLocation() Location - JSONNameLocation() Location - JSTypeLocation() Location - CTypeLocation() Location - PackedLocation() Location - ExtendeeLocation() Location -} - -// Oneof is a oneof descriptor. -type Oneof interface { - NamedDescriptor - OptionExtensionDescriptor - - Message() Message - Fields() []Field -} - -// Service is a service descriptor. -type Service interface { - NamedDescriptor - OptionExtensionDescriptor - - Methods() []Method - Deprecated() bool -} - -// Method is a method descriptor. -type Method interface { - NamedDescriptor - OptionExtensionDescriptor - - Service() Service - InputTypeName() string - OutputTypeName() string - ClientStreaming() bool - ServerStreaming() bool - InputTypeLocation() Location - OutputTypeLocation() Location - - Deprecated() bool - IdempotencyLevel() descriptorpb.MethodOptions_IdempotencyLevel - IdempotencyLevelLocation() Location -} - -// InputFile is an input file for NewFile. -type InputFile interface { - FileInfo - // FileDescriptor is the backing FileDescriptor for this File. - // - // This will never be nil. - // The value Path() is equal to FileDescriptor().GetName() . - FileDescriptor() protodescriptor.FileDescriptor - // IsSyntaxUnspecified will be true if the syntax was not explicitly specified. - IsSyntaxUnspecified() bool - // UnusedDependencyIndexes returns the indexes of the unused dependencies within - // FileDescriptor.GetDependency(). - // - // All indexes will be valid. - // Will return nil if empty. - UnusedDependencyIndexes() []int32 -} - -// NewFile returns a new File. -func NewFile(inputFile InputFile) (File, error) { - return newFile(inputFile) -} - -// NewFilesUnstable converts the input Files into Files. -// -// This may be done concurrently and the returned Files may not be in the same -// order as the input FileDescriptors. If ordering matters, use NewFile. -func NewFilesUnstable(ctx context.Context, inputFiles ...InputFile) ([]File, error) { - return newFilesUnstable(ctx, inputFiles...) -} - -// SortFiles sorts the Files by FilePath. -func SortFiles(files []File) { - sort.Slice(files, func(i int, j int) bool { return files[i].Path() < files[j].Path() }) -} - -// FilePathToFile maps the Files to a map from Path() to File. -// -// Returns error if file paths are not unique. -func FilePathToFile(files ...File) (map[string]File, error) { - filePathToFile := make(map[string]File, len(files)) - for _, file := range files { - filePath := file.Path() - if _, ok := filePathToFile[filePath]; ok { - return nil, fmt.Errorf("duplicate filePath: %q", filePath) - } - filePathToFile[filePath] = file - } - return filePathToFile, nil -} - -// DirPathToFiles maps the Files to a map from directory -// to the slice of Files in that directory. -// -// Returns error if file paths are not unique. -// Directories are normalized. -// -// Files will be sorted by FilePath. -func DirPathToFiles(files ...File) (map[string][]File, error) { - return mapFiles(files, func(file File) string { return normalpath.Dir(file.Path()) }) -} - -// PackageToFiles maps the Files to a map from Protobuf package -// to the slice of Files in that package. -// -// Returns error if file paths are not unique. -// -// Files will be sorted by Path. -func PackageToFiles(files ...File) (map[string][]File, error) { - // works for no package since "" is a valid map key - return mapFiles(files, File.Package) -} - -// ForEachEnum calls f on each Enum in the given ContainerDescriptor, including nested Enums. -// -// Returns error and stops iterating if f returns error -// Never returns error unless f returns error. -func ForEachEnum(f func(Enum) error, containerDescriptor ContainerDescriptor) error { - for _, enum := range containerDescriptor.Enums() { - if err := f(enum); err != nil { - return err - } - } - for _, message := range containerDescriptor.Messages() { - if err := ForEachEnum(f, message); err != nil { - return err - } - } - return nil -} - -// ForEachMessage calls f on each Message in the given ContainerDescriptor, including nested Messages. -// -// Returns error and stops iterating if f returns error -// Never returns error unless f returns error. -func ForEachMessage(f func(Message) error, containerDescriptor ContainerDescriptor) error { - for _, message := range containerDescriptor.Messages() { - if err := f(message); err != nil { - return err - } - if err := ForEachMessage(f, message); err != nil { - return err - } - } - return nil -} - -// NestedNameToEnum maps the Enums in the ContainerDescriptor to a map from -// nested name to Enum. -// -// Returns error if Enums do not have unique nested names within the ContainerDescriptor, -// which should generally never happen for properly-formed ContainerDescriptors. -func NestedNameToEnum(containerDescriptor ContainerDescriptor) (map[string]Enum, error) { - nestedNameToEnum := make(map[string]Enum) - if err := ForEachEnum( - func(enum Enum) error { - nestedName := enum.NestedName() - if _, ok := nestedNameToEnum[nestedName]; ok { - return fmt.Errorf("duplicate enum: %q", nestedName) - } - nestedNameToEnum[nestedName] = enum - return nil - }, - containerDescriptor, - ); err != nil { - return nil, err - } - return nestedNameToEnum, nil -} - -// FullNameToEnum maps the Enums in the Files to a map from full name to enum. -// -// Returns error if the Enums do not have unique full names within the Files, -// which should generally never happen for properly-formed Files. -func FullNameToEnum(files ...File) (map[string]Enum, error) { - fullNameToEnum := make(map[string]Enum) - for _, file := range files { - if err := ForEachEnum( - func(enum Enum) error { - fullName := enum.FullName() - if _, ok := fullNameToEnum[fullName]; ok { - return fmt.Errorf("duplicate enum: %q", fullName) - } - fullNameToEnum[fullName] = enum - return nil - }, - file, - ); err != nil { - return nil, err - } - } - return fullNameToEnum, nil -} - -// PackageToNestedNameToEnum maps the Enums in the Files to a map from -// package to nested name to Enum. -// -// Returns error if the Enums do not have unique nested names within the packages, -// which should generally never happen for properly-formed Files. -func PackageToNestedNameToEnum(files ...File) (map[string]map[string]Enum, error) { - packageToNestedNameToEnum := make(map[string]map[string]Enum) - for _, file := range files { - if err := ForEachEnum( - func(enum Enum) error { - pkg := enum.File().Package() - nestedName := enum.NestedName() - nestedNameToEnum, ok := packageToNestedNameToEnum[pkg] - if !ok { - nestedNameToEnum = make(map[string]Enum) - packageToNestedNameToEnum[pkg] = nestedNameToEnum - } - if _, ok := nestedNameToEnum[nestedName]; ok { - return fmt.Errorf("duplicate enum in package %q: %q", pkg, nestedName) - } - nestedNameToEnum[nestedName] = enum - return nil - }, - file, - ); err != nil { - return nil, err - } - } - return packageToNestedNameToEnum, nil -} - -// NameToEnumValue maps the EnumValues in the Enum to a map from name to EnumValue. -// -// Returns error if the EnumValues do not have unique names within the Enum, -// which should generally never happen for properly-formed Enums. -func NameToEnumValue(enum Enum) (map[string]EnumValue, error) { - nameToEnumValue := make(map[string]EnumValue) - for _, enumValue := range enum.Values() { - name := enumValue.Name() - if _, ok := nameToEnumValue[name]; ok { - return nil, fmt.Errorf("duplicate enum value name for enum %q: %q", enum.NestedName(), name) - } - nameToEnumValue[name] = enumValue - } - return nameToEnumValue, nil -} - -// NumberToNameToEnumValue maps the EnumValues in the Enum to a map from number to name to EnumValue. -// -// Duplicates by number may occur if allow_alias = true. -// -// Returns error if the EnumValues do not have unique names within the Enum for a given number, -// which should generally never happen for properly-formed Enums. -func NumberToNameToEnumValue(enum Enum) (map[int]map[string]EnumValue, error) { - numberToNameToEnumValue := make(map[int]map[string]EnumValue) - for _, enumValue := range enum.Values() { - number := enumValue.Number() - nameToEnumValue, ok := numberToNameToEnumValue[number] - if !ok { - nameToEnumValue = make(map[string]EnumValue) - numberToNameToEnumValue[number] = nameToEnumValue - } - name := enumValue.Name() - if _, ok := nameToEnumValue[name]; ok { - return nil, fmt.Errorf("duplicate enum value name for enum %q: %q", enum.NestedName(), name) - } - nameToEnumValue[name] = enumValue - } - return numberToNameToEnumValue, nil -} - -// NestedNameToMessage maps the Messages in the ContainerDescriptor to a map from -// nested name to Message. -// -// Returns error if Messages do not have unique nested names within the ContainerDescriptor, -// which should generally never happen for properly-formed files. -func NestedNameToMessage(containerDescriptor ContainerDescriptor) (map[string]Message, error) { - nestedNameToMessage := make(map[string]Message) - if err := ForEachMessage( - func(message Message) error { - nestedName := message.NestedName() - if _, ok := nestedNameToMessage[nestedName]; ok { - return fmt.Errorf("duplicate message: %q", nestedName) - } - nestedNameToMessage[nestedName] = message - return nil - }, - containerDescriptor, - ); err != nil { - return nil, err - } - return nestedNameToMessage, nil -} - -// FullNameToMessage maps the Messages in the Files to a map from full name to message. -// -// Returns error if the Messages do not have unique full names within the Files, -// which should generally never happen for properly-formed Files. -func FullNameToMessage(files ...File) (map[string]Message, error) { - fullNameToMessage := make(map[string]Message) - for _, file := range files { - if err := ForEachMessage( - func(message Message) error { - fullName := message.FullName() - if _, ok := fullNameToMessage[fullName]; ok { - return fmt.Errorf("duplicate message: %q", fullName) - } - fullNameToMessage[fullName] = message - return nil - }, - file, - ); err != nil { - return nil, err - } - } - return fullNameToMessage, nil -} - -// PackageToNestedNameToMessage maps the Messages in the Files to a map from -// package to nested name to Message. -// -// Returns error if the Messages do not have unique nested names within the packages, -// which should generally never happen for properly-formed Files. -func PackageToNestedNameToMessage(files ...File) (map[string]map[string]Message, error) { - packageToNestedNameToMessage := make(map[string]map[string]Message) - for _, file := range files { - if err := ForEachMessage( - func(message Message) error { - pkg := message.File().Package() - nestedName := message.NestedName() - nestedNameToMessage, ok := packageToNestedNameToMessage[pkg] - if !ok { - nestedNameToMessage = make(map[string]Message) - packageToNestedNameToMessage[pkg] = nestedNameToMessage - } - if _, ok := nestedNameToMessage[nestedName]; ok { - return fmt.Errorf("duplicate message in package %q: %q", pkg, nestedName) - } - nestedNameToMessage[nestedName] = message - return nil - }, - file, - ); err != nil { - return nil, err - } - } - return packageToNestedNameToMessage, nil -} - -// NumberToMessageField maps the Fields in the Message to a map from number to Field. -// -// TODO: is this right? -// Includes extensions. -// -// Returns error if the Fields do not have unique numbers within the Message, -// which should generally never happen for properly-formed Messages. -func NumberToMessageField(message Message) (map[int]Field, error) { - numberToMessageField := make(map[int]Field) - for _, messageField := range message.Fields() { - number := messageField.Number() - if _, ok := numberToMessageField[number]; ok { - return nil, fmt.Errorf("duplicate message field: %d", number) - } - numberToMessageField[number] = messageField - } - for _, messageField := range message.Extensions() { - if messageField.Extendee() != message.FullName() { - // TODO: ideally we want this field to be returned when - // the Extendee message is passed into some function, - // need to investigate what index is necessary for that. - continue - } - number := messageField.Number() - if _, ok := numberToMessageField[number]; ok { - return nil, fmt.Errorf("duplicate message field: %d", number) - } - numberToMessageField[number] = messageField - } - return numberToMessageField, nil -} - -// NumberToMessageFieldForLabel maps the Fields with the given label in the message -// to a map from number to Field. -// -// TODO: is this right? -// Includes extensions. -// -// Returns error if the Fields do not have unique numbers within the Message, -// which should generally never happen for properly-formed Messages. -func NumberToMessageFieldForLabel(message Message, label descriptorpb.FieldDescriptorProto_Label) (map[int]Field, error) { - numberToField, err := NumberToMessageField(message) - if err != nil { - return nil, err - } - for number, field := range numberToField { - if field.Label() != label { - delete(numberToField, number) - } - } - return numberToField, nil -} - -// NameToMessageOneof maps the Oneofs in the Message to a map from name to Oneof. -// -// Returns error if the Oneofs do not have unique names within the Message, -// which should generally never happen for properly-formed Messages. -func NameToMessageOneof(message Message) (map[string]Oneof, error) { - nameToMessageOneof := make(map[string]Oneof) - for _, messageOneof := range message.Oneofs() { - name := messageOneof.Name() - if _, ok := nameToMessageOneof[name]; ok { - return nil, fmt.Errorf("duplicate message oneof: %q", name) - } - nameToMessageOneof[name] = messageOneof - } - return nameToMessageOneof, nil -} - -// NameToService maps the Services in the File to a map from name to Service. -// -// Returns error if Services do not have unique names within the File, which should -// generally never happen for properly-formed Files. -func NameToService(file File) (map[string]Service, error) { - nameToService := make(map[string]Service) - for _, service := range file.Services() { - name := service.Name() - if _, ok := nameToService[name]; ok { - return nil, fmt.Errorf("duplicate service: %q", name) - } - nameToService[name] = service - } - return nameToService, nil -} - -// FullNameToService maps the Services in the Files to a map from full name to Service. -// -// Returns error if Services do not have unique full names within the Files, which should -// generally never happen for properly-formed Files. -func FullNameToService(files ...File) (map[string]Service, error) { - fullNameToService := make(map[string]Service) - for _, file := range files { - for _, service := range file.Services() { - fullName := service.FullName() - if _, ok := fullNameToService[fullName]; ok { - return nil, fmt.Errorf("duplicate service: %q", fullName) - } - fullNameToService[fullName] = service - } - } - return fullNameToService, nil -} - -// PackageToNameToService maps the Services in the Files to a map from -// package to name to Service. -// -// Returns error if the Services do not have unique names within the packages, -// which should generally never happen for properly-formed Files. -func PackageToNameToService(files ...File) (map[string]map[string]Service, error) { - packageToNameToService := make(map[string]map[string]Service) - for _, file := range files { - pkg := file.Package() - nameToService, ok := packageToNameToService[pkg] - if !ok { - nameToService = make(map[string]Service) - packageToNameToService[pkg] = nameToService - } - for _, service := range file.Services() { - name := service.Name() - if _, ok := nameToService[name]; ok { - return nil, fmt.Errorf("duplicate service in package %q: %q", pkg, name) - } - nameToService[name] = service - } - } - return packageToNameToService, nil -} - -// PackageToDirectlyImportedPackageToFileImports maps packages to directly imported packages -// to the FileImports that import this package. -// -// For example, if package a imports package b via c/d.proto and c/e.proto, this will have -// a -> b -> [c/d.proto, c/e.proto]. -// -// A directly imported package will not be equal to the package, i.e. there will be no a -> a. -// -// Files with no packages are included with key "" to be consistent with other functions. -func PackageToDirectlyImportedPackageToFileImports(files ...File) (map[string]map[string][]FileImport, error) { - filePathToFile, err := FilePathToFile(files...) - if err != nil { - return nil, err - } - packageToDirectlyImportedPackageToFileImports := make(map[string]map[string][]FileImport) - for _, file := range files { - pkg := file.Package() - directlyImportedPackageToFileImports, ok := packageToDirectlyImportedPackageToFileImports[pkg] - if !ok { - directlyImportedPackageToFileImports = make(map[string][]FileImport) - packageToDirectlyImportedPackageToFileImports[pkg] = directlyImportedPackageToFileImports - } - for _, fileImport := range file.FileImports() { - if importedFile, ok := filePathToFile[fileImport.Import()]; ok { - importedPkg := importedFile.Package() - if importedPkg != pkg { - directlyImportedPackageToFileImports[importedFile.Package()] = append( - directlyImportedPackageToFileImports[importedPkg], - fileImport, - ) - } - } - } - } - return packageToDirectlyImportedPackageToFileImports, nil -} - -// NameToMethod maps the Methods in the Service to a map from name to Method. -// -// Returns error if Methods do not have unique names within the Service, which should -// generally never happen for properly-formed Services. -func NameToMethod(service Service) (map[string]Method, error) { - nameToMethod := make(map[string]Method) - for _, method := range service.Methods() { - name := method.Name() - if _, ok := nameToMethod[name]; ok { - return nil, fmt.Errorf("duplicate method: %q", name) - } - nameToMethod[name] = method - } - return nameToMethod, nil -} - -// FullNameToMethod maps the Methods in the Files to a map from full name to Method. -// -// Returns error if Methods do not have unique full names within the Files, which should -// generally never happen for properly-formed Files. -func FullNameToMethod(files ...File) (map[string]Method, error) { - fullNameToMethod := make(map[string]Method) - for _, file := range files { - for _, service := range file.Services() { - for _, method := range service.Methods() { - fullName := method.FullName() - if _, ok := fullNameToMethod[fullName]; ok { - return nil, fmt.Errorf("duplicate method: %q", fullName) - } - fullNameToMethod[fullName] = method - } - } - } - return fullNameToMethod, nil -} - -// StringToReservedTagRange maps the ReservedTagRanges in the ReservedDescriptor to a map -// from string string to reserved TagRange. -// -// Ignores duplicates. -func StringToReservedTagRange(reservedDescriptor ReservedDescriptor) map[string]TagRange { - stringToReservedTagRange := make(map[string]TagRange) - for _, reservedTagRange := range reservedDescriptor.ReservedTagRanges() { - stringToReservedTagRange[TagRangeString(reservedTagRange)] = reservedTagRange - } - return stringToReservedTagRange -} - -// ValueToReservedName maps the ReservedNames in the ReservedDescriptor to a map -// from string value to ReservedName. -// -// Ignores duplicates. -func ValueToReservedName(reservedDescriptor ReservedDescriptor) map[string]ReservedName { - valueToReservedName := make(map[string]ReservedName) - for _, reservedName := range reservedDescriptor.ReservedNames() { - valueToReservedName[reservedName.Value()] = reservedName - } - return valueToReservedName -} - -// StringToExtensionMessageRange maps the ExtensionMessageRanges in the Message to a map -// from string string to ExtensionMessageRange. -// -// Ignores duplicates. -func StringToExtensionMessageRange(message Message) map[string]MessageRange { - stringToExtensionMessageRange := make(map[string]MessageRange) - for _, extensionMessageRange := range message.ExtensionMessageRanges() { - stringToExtensionMessageRange[TagRangeString(extensionMessageRange)] = extensionMessageRange - } - return stringToExtensionMessageRange -} - -// NumberInReservedRanges returns true if the number is in one of the Ranges. -func NumberInReservedRanges(number int, reservedRanges ...TagRange) bool { - for _, reservedRange := range reservedRanges { - start := reservedRange.Start() - end := reservedRange.End() - if number >= start && number <= end { - return true - } - } - return false -} - -// NameInReservedNames returns true if the name is in one of the ReservedNames. -func NameInReservedNames(name string, reservedNames ...ReservedName) bool { - for _, reservedName := range reservedNames { - if name == reservedName.Value() { - return true - } - } - return false -} - -// EnumIsSubset checks if subsetEnum is a subset of supersetEnum. -func EnumIsSubset(supersetEnum Enum, subsetEnum Enum) (bool, error) { - supersetNameToEnumValue, err := NameToEnumValue(supersetEnum) - if err != nil { - return false, err - } - subsetNameToEnumValue, err := NameToEnumValue(subsetEnum) - if err != nil { - return false, err - } - for subsetName, subsetEnumValue := range subsetNameToEnumValue { - supersetEnumValue, ok := supersetNameToEnumValue[subsetName] - if !ok { - // The enum value does not exist by name, this is not a superset. - return false, nil - } - if subsetEnumValue.Number() != supersetEnumValue.Number() { - // The enum values are not equal, this is not a superset. - return false, nil - } - } - // All enum values by name exist in the superset and have the same number, - // subsetEnum is a subset of supersetEnum. - return true, nil -} - -// TagRangeString returns the string representation of the range. -func TagRangeString(tagRange TagRange) string { - start := tagRange.Start() - end := tagRange.End() - if start == end { - return fmt.Sprintf("[%d]", start) - } - if tagRange.Max() { - return fmt.Sprintf("[%d,max]", start) - } - return fmt.Sprintf("[%d,%d]", start, end) -} - -// FreeMessageRangeString returns the string representation of the free ranges for the message. -func FreeMessageRangeString(message Message) string { - freeRanges := FreeMessageRanges(message) - if len(freeRanges) == 0 { - return "" - } - suffixes := make([]string, len(freeRanges)) - for i, freeRange := range freeRanges { - suffixes[i] = freeMessageRangeStringSuffix(freeRange) - } - return fmt.Sprintf( - "%- 35s free: %s", - freeRanges[0].Message().FullName(), - strings.Join(suffixes, " "), - ) -} - -// FreeMessageRanges returns the free message ranges for the given message. -// -// Not recursive. -func FreeMessageRanges(message Message) []MessageRange { - used := append( - message.ReservedMessageRanges(), - message.ExtensionMessageRanges()..., - ) - for _, field := range message.Fields() { - used = append( - used, - newFreeMessageRange(message, field.Number(), field.Number()), - ) - } - sort.Slice(used, func(i, j int) bool { - return used[i].Start() < used[j].Start() - }) - // now compute the inverse (unused ranges) - unused := make([]MessageRange, 0, len(used)+1) - last := 0 - for _, r := range used { - if r.Start() <= last+1 { - last = r.End() - continue - } - unused = append( - unused, - newFreeMessageRange(message, last+1, r.Start()-1), - ) - last = r.End() - } - if last < messageRangeInclusiveMax { - unused = append( - unused, - newFreeMessageRange(message, last+1, messageRangeInclusiveMax), - ) - } - return unused -} - -// CheckTagRangeIsSubset checks if supersetRanges is a superset of subsetRanges. -// If so, it returns true and nil. If not, it returns false with a slice of failing ranges from subsetRanges. -func CheckTagRangeIsSubset(supersetRanges []TagRange, subsetRanges []TagRange) (bool, []TagRange) { - if len(subsetRanges) == 0 { - return true, nil - } - - if len(supersetRanges) == 0 { - return false, subsetRanges - } - - supersetTagRangeGroups := groupAdjacentTagRanges(supersetRanges) - subsetTagRanges := sortTagRanges(subsetRanges) - missingTagRanges := []TagRange{} - - for i, j := 0, 0; j < len(subsetTagRanges); j++ { - for supersetTagRangeGroups[i].end < subsetTagRanges[j].Start() { - if i++; i == len(supersetTagRangeGroups) { - missingTagRanges = append(missingTagRanges, subsetTagRanges[j:]...) - return false, missingTagRanges - } - } - if supersetTagRangeGroups[i].start > subsetTagRanges[j].Start() || - supersetTagRangeGroups[i].end < subsetTagRanges[j].End() { - missingTagRanges = append(missingTagRanges, subsetTagRanges[j]) - } - } - - if len(missingTagRanges) != 0 { - return false, missingTagRanges - } - - return true, nil -} - -// groupAdjacentTagRanges sorts and groups adjacent tag ranges. -func groupAdjacentTagRanges(ranges []TagRange) []tagRangeGroup { - if len(ranges) == 0 { - return []tagRangeGroup{} - } - - sortedTagRanges := sortTagRanges(ranges) - - j := 0 - groupedTagRanges := make([]tagRangeGroup, 1, len(ranges)) - groupedTagRanges[j] = tagRangeGroup{ - ranges: sortedTagRanges[0:1], - start: sortedTagRanges[0].Start(), - end: sortedTagRanges[0].End(), - } - - for i := 1; i < len(sortedTagRanges); i++ { - if sortedTagRanges[i].Start() <= sortedTagRanges[i-1].End()+1 { - if sortedTagRanges[i].End() > groupedTagRanges[j].end { - groupedTagRanges[j].end = sortedTagRanges[i].End() - } - groupedTagRanges[j].ranges = groupedTagRanges[j].ranges[0 : len(groupedTagRanges[j].ranges)+1] - } else { - groupedTagRanges = append(groupedTagRanges, tagRangeGroup{ - ranges: sortedTagRanges[i : i+1], - start: sortedTagRanges[i].Start(), - end: sortedTagRanges[i].End(), - }) - j++ - } - } - - return groupedTagRanges -} - -// sortTagRanges sorts tag ranges by their start, end components. -func sortTagRanges(ranges []TagRange) []TagRange { - rangesCopy := make([]TagRange, len(ranges)) - copy(rangesCopy, ranges) - - sort.Slice(rangesCopy, func(i, j int) bool { - return rangesCopy[i].Start() < rangesCopy[j].Start() || - (rangesCopy[i].Start() == rangesCopy[j].Start() && - rangesCopy[i].End() < rangesCopy[j].End()) - }) - - return rangesCopy -} - -func freeMessageRangeStringSuffix(freeRange MessageRange) string { - start := freeRange.Start() - end := freeRange.End() - if start == end { - return fmt.Sprintf("%d", start) - } - if freeRange.Max() { - return fmt.Sprintf("%d-INF", start) - } - return fmt.Sprintf("%d-%d", start, end) -} - -func mapFiles(files []File, getKey func(File) string) (map[string][]File, error) { - keyToFilePathToFile := make(map[string]map[string]File) - for _, file := range files { - if err := addUniqueFileToMap(keyToFilePathToFile, getKey(file), file); err != nil { - return nil, err - } - } - return mapToSortedFiles(keyToFilePathToFile), nil -} - -func addUniqueFileToMap(keyToFilePathToFile map[string]map[string]File, key string, file File) error { - filePathToFile, ok := keyToFilePathToFile[key] - if !ok { - filePathToFile = make(map[string]File) - keyToFilePathToFile[key] = filePathToFile - } - if _, ok := filePathToFile[file.Path()]; ok { - return fmt.Errorf("duplicate file: %s", file.Path()) - } - filePathToFile[file.Path()] = file - return nil -} - -func mapToSortedFiles(keyToFileMap map[string]map[string]File) map[string][]File { - keyToSortedFiles := make(map[string][]File, len(keyToFileMap)) - for key, fileMap := range keyToFileMap { - files := make([]File, 0, len(fileMap)) - for _, file := range fileMap { - files = append(files, file) - } - SortFiles(files) - keyToSortedFiles[key] = files - } - return keyToSortedFiles -} - -type tagRangeGroup struct { - ranges []TagRange - start int - end int -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/reserved_name.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/reserved_name.go deleted file mode 100644 index e3b03a840b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/reserved_name.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -import "fmt" - -type reservedName struct { - locationDescriptor - - value string -} - -func newReservedName( - locationDescriptor locationDescriptor, - value string, -) (*reservedName, error) { - if value == "" { - return nil, fmt.Errorf("no value for reserved name in %q", locationDescriptor.File().Path()) - } - return &reservedName{ - locationDescriptor: locationDescriptor, - value: value, - }, nil -} - -func (r *reservedName) Value() string { - return r.value -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/service.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/service.go deleted file mode 100644 index b8cd5ec60c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/service.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protosource - -type service struct { - namedDescriptor - optionExtensionDescriptor - - methods []Method - deprecated bool -} - -func newService( - namedDescriptor namedDescriptor, - optionExtensionDescriptor optionExtensionDescriptor, - deprecated bool, -) *service { - return &service{ - namedDescriptor: namedDescriptor, - optionExtensionDescriptor: optionExtensionDescriptor, - deprecated: deprecated, - } -} - -func (m *service) Methods() []Method { - return m.methods -} - -func (m *service) addMethod(method Method) { - m.methods = append(m.methods, method) -} - -func (m *service) Deprecated() bool { - return m.deprecated -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protosource/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/protosource/usage.gen.go deleted file mode 100644 index 53e51f7a5f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protosource/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protosource - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protostat/protostat.go b/vendor/github.com/bufbuild/buf/private/pkg/protostat/protostat.go deleted file mode 100644 index 39ebb366eb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protostat/protostat.go +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protostat - -import ( - "context" - "io" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/reporter" -) - -// Stats represents some statistics about one or more Protobuf files. -// -// Note that as opposed to most structs in this codebase, we do not omitempty for -// the fields for JSON or YAML. -type Stats struct { - NumFiles int `json:"num_files" yaml:"num_files"` - NumPackages int `json:"num_packages" yaml:"num_packages"` - NumFilesWithSyntaxErrors int `json:"num_files_with_syntax_errors" yaml:"num_files_with_syntax_errors"` - NumMessages int `json:"num_messages" yaml:"num_messages"` - NumFields int `json:"num_fields" yaml:"num_fields"` - NumEnums int `json:"num_enums" yaml:"num_enums"` - NumEnumValues int `json:"num_enum_values" yaml:"num_enum_values"` - NumExtensions int `json:"num_extensions" yaml:"num_extensions"` - NumServices int `json:"num_services" yaml:"num_services"` - NumMethods int `json:"num_methods" yaml:"num_methods"` -} - -// FileWalker goes through all .proto files for GetStats. -type FileWalker interface { - // Walk will invoke f for all .proto files for GetStats. - Walk(ctx context.Context, f func(io.Reader) error) error -} - -// GetStats gathers some simple statistics about a set of Protobuf files. -// -// See the packages protostatos and protostatstorage for helpers for the -// os and storage packages. -func GetStats(ctx context.Context, fileWalker FileWalker) (*Stats, error) { - handler := reporter.NewHandler( - reporter.NewReporter( - func(reporter.ErrorWithPos) error { - // never aborts - return nil - }, - nil, - ), - ) - statsBuilder := newStatsBuilder() - if err := fileWalker.Walk( - ctx, - func(file io.Reader) error { - // This can return an error and non-nil AST. - // We do not need the filePath because we do not report errors. - astRoot, err := parser.Parse("", file, handler) - if astRoot == nil { - // No AST implies an I/O error trying to read the - // file contents. No stats to collect. - return err - } - if err != nil { - // There was a syntax error, but we still have a partial - // AST we can examine. - statsBuilder.NumFilesWithSyntaxErrors++ - } - examineFile(statsBuilder, astRoot) - return nil - }, - ); err != nil { - return nil, err - } - statsBuilder.NumPackages = len(statsBuilder.packages) - return statsBuilder.Stats, nil -} - -// MergeStats merged multiple stats objects into one single Stats object. -// -// A new object is returned. -func MergeStats(statsSlice ...*Stats) *Stats { - resultStats := &Stats{} - for _, stats := range statsSlice { - resultStats.NumFiles += stats.NumFiles - resultStats.NumPackages += stats.NumPackages - resultStats.NumFilesWithSyntaxErrors += stats.NumFilesWithSyntaxErrors - resultStats.NumMessages += stats.NumMessages - resultStats.NumFields += stats.NumFields - resultStats.NumEnums += stats.NumEnums - resultStats.NumEnumValues += stats.NumEnumValues - resultStats.NumExtensions += stats.NumExtensions - resultStats.NumServices += stats.NumServices - resultStats.NumMethods += stats.NumMethods - } - return resultStats -} - -type statsBuilder struct { - *Stats - - packages map[ast.Identifier]struct{} -} - -func newStatsBuilder() *statsBuilder { - return &statsBuilder{ - Stats: &Stats{}, - packages: make(map[ast.Identifier]struct{}), - } -} - -func examineFile(statsBuilder *statsBuilder, fileNode *ast.FileNode) { - statsBuilder.NumFiles++ - for _, decl := range fileNode.Decls { - switch decl := decl.(type) { - case *ast.PackageNode: - statsBuilder.packages[decl.Name.AsIdentifier()] = struct{}{} - case *ast.MessageNode: - examineMessage(statsBuilder, &decl.MessageBody) - case *ast.EnumNode: - examineEnum(statsBuilder, decl) - case *ast.ExtendNode: - examineExtend(statsBuilder, decl) - case *ast.ServiceNode: - statsBuilder.NumServices++ - for _, decl := range decl.Decls { - _, ok := decl.(*ast.RPCNode) - if ok { - statsBuilder.NumMethods++ - } - } - } - } -} - -func examineMessage(statsBuilder *statsBuilder, messageBody *ast.MessageBody) { - statsBuilder.NumMessages++ - for _, decl := range messageBody.Decls { - switch decl := decl.(type) { - case *ast.FieldNode, *ast.MapFieldNode: - statsBuilder.NumFields++ - case *ast.GroupNode: - statsBuilder.NumFields++ - examineMessage(statsBuilder, &decl.MessageBody) - case *ast.OneOfNode: - for _, ooDecl := range decl.Decls { - switch ooDecl := ooDecl.(type) { - case *ast.FieldNode: - statsBuilder.NumFields++ - case *ast.GroupNode: - statsBuilder.NumFields++ - examineMessage(statsBuilder, &ooDecl.MessageBody) - } - } - case *ast.MessageNode: - examineMessage(statsBuilder, &decl.MessageBody) - case *ast.EnumNode: - examineEnum(statsBuilder, decl) - case *ast.ExtendNode: - examineExtend(statsBuilder, decl) - } - } -} - -func examineEnum(statsBuilder *statsBuilder, enumNode *ast.EnumNode) { - statsBuilder.NumEnums++ - for _, decl := range enumNode.Decls { - _, ok := decl.(*ast.EnumValueNode) - if ok { - statsBuilder.NumEnumValues++ - } - } -} - -func examineExtend(statsBuilder *statsBuilder, extendNode *ast.ExtendNode) { - for _, decl := range extendNode.Decls { - switch decl := decl.(type) { - case *ast.FieldNode: - statsBuilder.NumExtensions++ - case *ast.GroupNode: - statsBuilder.NumExtensions++ - examineMessage(statsBuilder, &decl.MessageBody) - } - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protostat/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/protostat/usage.gen.go deleted file mode 100644 index 1f41c25873..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protostat/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protostat - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/prototime/prototime.go b/vendor/github.com/bufbuild/buf/private/pkg/prototime/prototime.go deleted file mode 100644 index 6c26b8e7b2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/prototime/prototime.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package prototime - -import ( - "time" - - "google.golang.org/protobuf/types/known/timestamppb" -) - -// NewTimestamp creates a new proto WKT timestamp from a time.Time. -// It runs CheckValid() on the timestamp before returning. -func NewTimestamp(t time.Time) (*timestamppb.Timestamp, error) { - timestamp := timestamppb.New(t) - if err := timestamp.CheckValid(); err != nil { - return nil, err - } - return timestamp, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/prototime/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/prototime/usage.gen.go deleted file mode 100644 index 2dd672edb6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/prototime/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package prototime - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/package_version.go b/vendor/github.com/bufbuild/buf/private/pkg/protoversion/package_version.go deleted file mode 100644 index 169af40913..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/package_version.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoversion - -import ( - "strconv" - "strings" -) - -var _ PackageVersion = &packageVersion{} - -type packageVersion struct { - major int - stabilityLevel StabilityLevel - minor int - patch int - suffix string -} - -func newPackageVersionForPackage(pkg string) (*packageVersion, bool) { - if pkg == "" { - return nil, false - } - parts := strings.Split(pkg, ".") - if len(parts) < 2 { - return nil, false - } - lastPart := parts[len(parts)-1] - // must at least contain 'v' and a number - if len(lastPart) < 2 { - return nil, false - } - if lastPart[0] != 'v' { - return nil, false - } - - // v1beta1 -> 1beta1 - // v1testfoo -> 1testfoo - // v1p1alpha1 -> p1alpha1 - version := lastPart[1:] - - if strings.Contains(version, "test") { - // 1testfoo -> [1, foo] - split := strings.SplitN(version, "test", 2) - if len(split) != 2 { - return nil, false - } - major, ok := positiveNumber(split[0]) - if !ok { - return nil, false - } - return newPackageVersion(major, StabilityLevelTest, 0, 0, split[1]), true - } - - var stabilityLevel StabilityLevel - containsAlpha := strings.Contains(version, "alpha") - containsBeta := strings.Contains(version, "beta") - switch { - case !containsAlpha && !containsBeta: - stabilityLevel = StabilityLevelStable - case containsAlpha && !containsBeta: - stabilityLevel = StabilityLevelAlpha - case !containsAlpha && containsBeta: - stabilityLevel = StabilityLevelBeta - case containsAlpha && containsBeta: - return nil, false - } - if stabilityLevel != StabilityLevelStable { - // 1alpha1 -> [1, 1] - // 1p1alpha1 ->[1p1, 1] - // 1alpha -> [1, ""] - split := strings.SplitN(version, stabilityLevel.String(), 2) - if len(split) != 2 { - return nil, false - } - minor := 0 - var ok bool - if split[1] != "" { - minor, ok = positiveNumber(split[1]) - if !ok { - return nil, false - } - } - major, patch, ok := getAlphaBetaMajorPatch(split[0]) - if !ok { - return nil, false - } - return newPackageVersion(major, stabilityLevel, minor, patch, ""), true - } - - // no suffix that is valid, make sure we just have a number - major, ok := positiveNumber(version) - if !ok { - return nil, false - } - return newPackageVersion(major, StabilityLevelStable, 0, 0, ""), true -} - -func newPackageVersion( - major int, - stabilityLevel StabilityLevel, - minor int, - patch int, - suffix string, -) *packageVersion { - return &packageVersion{ - major: major, - stabilityLevel: stabilityLevel, - minor: minor, - patch: patch, - suffix: suffix, - } -} - -func (p *packageVersion) Major() int { - return p.major -} - -func (p *packageVersion) StabilityLevel() StabilityLevel { - return p.stabilityLevel -} - -func (p *packageVersion) Minor() int { - return p.minor -} - -func (p *packageVersion) Patch() int { - return p.patch -} - -func (p *packageVersion) Suffix() string { - return p.suffix -} - -func (p *packageVersion) String() string { - var builder strings.Builder - builder.WriteRune('v') - builder.WriteString(strconv.Itoa(p.major)) - if p.patch > 0 { - builder.WriteRune('p') - builder.WriteString(strconv.Itoa(p.patch)) - } - builder.WriteString(p.stabilityLevel.String()) - if p.minor > 0 { - builder.WriteString(strconv.Itoa(p.minor)) - } - if p.suffix != "" { - builder.WriteString(p.suffix) - } - return builder.String() -} - -func (p *packageVersion) isPackageVersion() {} - -func getAlphaBetaMajorPatch(remainder string) (int, int, bool) { - if strings.Contains(remainder, "p") { - // 1p1 -> [1, 1] - patchSplit := strings.SplitN(remainder, "p", 2) - if len(patchSplit) != 2 { - return 0, 0, false - } - major, ok := positiveNumber(patchSplit[0]) - if !ok { - return 0, 0, false - } - patch, ok := positiveNumber(patchSplit[1]) - if !ok { - return 0, 0, false - } - return major, patch, true - } - // no patch, make sure just a number - major, ok := positiveNumber(remainder) - if !ok { - return 0, 0, false - } - return major, 0, true -} - -func positiveNumber(s string) (int, bool) { - if s == "" { - return 0, false - } - value, err := strconv.ParseInt(s, 10, 32) - if err != nil { - return 0, false - } - if value < 1 { - return 0, false - } - return int(value), true -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/protoversion.go b/vendor/github.com/bufbuild/buf/private/pkg/protoversion/protoversion.go deleted file mode 100644 index 2786db0817..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/protoversion.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protoversion - -import ( - "fmt" - "strconv" -) - -const ( - // StabilityLevelStable is stable. - StabilityLevelStable StabilityLevel = iota + 1 - // StabilityLevelAlpha is alpha stability. - StabilityLevelAlpha - // StabilityLevelBeta is beta stability. - StabilityLevelBeta - // StabilityLevelTest is test stability. - StabilityLevelTest -) - -var ( - stabilityLevelToString = map[StabilityLevel]string{ - StabilityLevelStable: "", - StabilityLevelAlpha: "alpha", - StabilityLevelBeta: "beta", - StabilityLevelTest: "test", - } -) - -// StabilityLevel is the stability level. -type StabilityLevel int - -// String implements fmt.Stringer. -func (s StabilityLevel) String() string { - value, ok := stabilityLevelToString[s] - if ok { - return value - } - return strconv.Itoa(int(s)) -} - -// PackageVersion is a package version. -// -// A package has a version if the last component is a version of the form -// v\d+, v\d+test.*, v\d+(alpha|beta)\d*, or v\d+p\d+(alpha|beta)\d* -// where numbers are >=1. -// -// See https://cloud.google.com/apis/design/versioning#channel-based_versioning -// See https://cloud.google.com/apis/design/versioning#release-based_versioning -type PackageVersion interface { - fmt.Stringer - - // Required. - // Will always be >=1. - Major() int - // Required. - StabilityLevel() StabilityLevel - // Optional. - // Only potentially set if the stability level is alpha or beta. - // Will always be >=1. - Minor() int - // Optional. - // Only potentially set if the stability level is alpha or beta. - // Will always be >=1. - Patch() int - // Optional. - // Only potentially set if the stability level is test. - Suffix() string - - isPackageVersion() -} - -// NewPackageVersionForPackage returns the PackageVersion for the package. -// -// Returns false if the package has no package version per the specifications. -func NewPackageVersionForPackage(pkg string) (PackageVersion, bool) { - return newPackageVersionForPackage(pkg) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/protoversion/usage.gen.go deleted file mode 100644 index 8b8a47892f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/protoversion/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package protoversion - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/bucket.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/bucket.go deleted file mode 100644 index e2cb173818..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/bucket.go +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - "io" -) - -// ReadBucket is a simple read-only bucket. -// -// All paths are regular files - Buckets do not handle directories. -// All paths must be relative. -// All paths are cleaned and ToSlash'ed by each function. -// Paths must not jump the bucket context, that is after clean, they -// cannot contain "..". -type ReadBucket interface { - // Get gets the path. - // - // The behavior of concurrently Getting and Putting an object is undefined. - // The returned ReadObjectCloser is not thread-safe. - // - // Returns ErrNotExist if the path does not exist, other error - // if there is a system error. - Get(ctx context.Context, path string) (ReadObjectCloser, error) - // Stat gets info in the object. - // - // Returns ErrNotExist if the path does not exist, other error - // if there is a system error. - Stat(ctx context.Context, path string) (ObjectInfo, error) - // Walk walks the bucket with the prefix, calling f on each path. - // If the prefix doesn't exist, this is a no-op. - // - // Note that foo/barbaz will not be called for foo/bar, but will - // be called for foo/bar/baz. - // - // All paths given to f are normalized and validated. - // If f returns error, Walk will stop short and return this error. - // Returns other error on system error. - Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error -} - -// PutOptions are the possible options that can be passed to a Put operation. -type PutOptions struct { - CustomChunkSize bool - ChunkSize int64 // measured in bytes - Atomic bool -} - -// PutOption are options passed when putting an object in a bucket. -type PutOption func(*PutOptions) - -// PutWithChunkSize sets the passed size in bytes to `ChunkSize` and -// `CustomChunkSize` to true. Some implementations of `storage.WriteBucket.Put` -// allow multi-part upload, and allow customizing the chunk size of each part -// upload, or even disabling multi-part upload. This is a suggested chunk size, -// implementations may choose to ignore this option. -func PutWithChunkSize(sizeInBytes int64) PutOption { - return func(opts *PutOptions) { - opts.CustomChunkSize = true - opts.ChunkSize = sizeInBytes - } -} - -// PutWithAtomic ensures that the Put fully writes the file before making it -// available to readers. This happens by default for some implementations, -// while others may need to perform a sequence of operations to ensure -// atomic writes. -// -// The Put operation is complete and the path will be readable once the -// returned WriteObjectCloser is written and closed (without an error). -// Any errors will cause the Put to be skipped (no path will be created). -func PutWithAtomic() PutOption { - return func(opts *PutOptions) { - opts.Atomic = true - } -} - -// WriteBucket is a write-only bucket. -type WriteBucket interface { - // Put returns a WriteObjectCloser to write to the path. - // - // The path is truncated on close. - // The behavior of concurrently Getting and Putting an object is undefined. - // The returned WriteObjectCloser is not thread-safe. - // - // Returns error on system error. - Put(ctx context.Context, path string, opts ...PutOption) (WriteObjectCloser, error) - // Delete deletes the object at the path. - // - // Returns ErrNotExist if the path does not exist, other error - // if there is a system error. - Delete(ctx context.Context, path string) error - // DeleteAll deletes all objects with the prefix. - // If the prefix doesn't exist, this is a no-op. - // - // Note that the prefix is used as a filepath prefix, and - // NOT a string prefix. For example, the prefix "foo/bar" - // will delete "foo/bar/baz", but NOT "foo/barbaz". - DeleteAll(ctx context.Context, prefix string) error - // SetExternalPathSupported returns true if SetExternalPath is supported. - // - // For example, in-memory buckets may choose to return true so that object sources - // are preserved, but filesystem buckets may choose to return false as they have - // their own external paths. - SetExternalPathSupported() bool -} - -// ReadWriteBucket is a simple read/write bucket. -type ReadWriteBucket interface { - ReadBucket - WriteBucket -} - -// ReadBucketCloser is a read-only bucket that must be closed. -type ReadBucketCloser interface { - io.Closer - ReadBucket -} - -// NopReadBucketCloser returns a ReadBucketCloser for the ReadBucket. -func NopReadBucketCloser(readBucket ReadBucket) ReadBucketCloser { - return nopReadBucketCloser{readBucket} -} - -// WriteBucketCloser is a write-only bucket that must be closed. -type WriteBucketCloser interface { - io.Closer - WriteBucket -} - -// NopWriteBucketCloser returns a WriteBucketCloser for the WriteBucket. -func NopWriteBucketCloser(writeBucket WriteBucket) WriteBucketCloser { - return nopWriteBucketCloser{writeBucket} -} - -// ReadWriteBucketCloser is a read/write bucket that must be closed. -type ReadWriteBucketCloser interface { - io.Closer - ReadWriteBucket -} - -// NopReadWriteBucketCloser returns a ReadWriteBucketCloser for the ReadWriteBucket. -func NopReadWriteBucketCloser(readWriteBucket ReadWriteBucket) ReadWriteBucketCloser { - return nopReadWriteBucketCloser{readWriteBucket} -} - -// ObjectInfo contains object info. -type ObjectInfo interface { - // Path is the path of the object. - // - // This will always correspond to a path within the Bucket. For sub-buckets, this is the sub-path, but the - // external path will include the sub-bucket path. - // - // This path will always be normalized, validated, and non-empty. - Path() string - // ExternalPath is the path that identifies the object externally. - // - // This path is not necessarily a file path, and should only be used to - // uniquely identify this file as compared to other assets, to for display - // to users. - // - // The path will be unnormalized, if it is a file path. - // The path will never be empty. If a given implementation has no external path, this falls back to path. - // - // Example: - // Directory: /foo/bar - // Path: baz/bat.proto - // ExternalPath: /foo/bar/baz/bat.proto - // - // Example: - // Directory: . - // Path: baz/bat.proto - // ExternalPath: baz/bat.proto - // - // Example: - // S3 Bucket: https://s3.amazonaws.com/foo - // Path: baz/bat.proto - // ExternalPath: s3://foo/baz/bat.proto - ExternalPath() string -} - -// ReadObject is an object read from a bucket. -type ReadObject interface { - ObjectInfo - io.Reader -} - -// ReadObjectCloser is a ReadObject with a closer. -// -// It must be closed when done. -type ReadObjectCloser interface { - ReadObject - io.Closer -} - -// WriteObject object written to a bucket. -type WriteObject interface { - io.Writer - - // ExternalPath attempts to explicitly set the external path for the new object. - // - // If SetExternalPathSupported returns false, this returns error. - SetExternalPath(externalPath string) error -} - -// WriteObjectCloser is a WriteObject with a closer. -// -// It must be closed when done. -type WriteObjectCloser interface { - WriteObject - io.Closer -} - -type nopReadBucketCloser struct { - ReadBucket -} - -func (nopReadBucketCloser) Close() error { - return nil -} - -type nopWriteBucketCloser struct { - WriteBucket -} - -func (nopWriteBucketCloser) Close() error { - return nil -} - -type nopReadWriteBucketCloser struct { - ReadWriteBucket -} - -func (nopReadWriteBucketCloser) Close() error { - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/copy.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/copy.go deleted file mode 100644 index fa412078b3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/copy.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - "io" - "sync" - - "github.com/bufbuild/buf/private/pkg/thread" - "go.uber.org/multierr" -) - -// Copy copies the bucket at from to the bucket at to. -// -// Copies done concurrently. -// Returns the number of files copied. -func Copy( - ctx context.Context, - from ReadBucket, - to WriteBucket, - options ...CopyOption, -) (int, error) { - copyOptions := newCopyOptions() - for _, option := range options { - option(copyOptions) - } - return copyPaths( - ctx, - from, - to, - copyOptions.externalPaths, - ) -} - -// CopyReadObject copies the contents of the ReadObject into the WriteBucket at the path. -func CopyReadObject( - ctx context.Context, - writeBucket WriteBucket, - readObject ReadObject, - options ...CopyOption, -) (retErr error) { - copyOptions := newCopyOptions() - for _, option := range options { - option(copyOptions) - } - return copyReadObject( - ctx, - writeBucket, - readObject, - copyOptions.externalPaths, - ) -} - -// CopyReader copies the contents of the Reader into the WriteBucket at the path. -func CopyReader( - ctx context.Context, - writeBucket WriteBucket, - reader io.Reader, - path string, -) (retErr error) { - writeObjectCloser, err := writeBucket.Put(ctx, path) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, writeObjectCloser.Close()) - }() - _, err = io.Copy(writeObjectCloser, reader) - return err -} - -// CopyOption is an option for Copy. -type CopyOption func(*copyOptions) - -// CopyWithExternalPaths returns a new CopyOption that says to copy external paths. -// -// The to WriteBucket must support setting external paths. -func CopyWithExternalPaths() CopyOption { - return func(copyOptions *copyOptions) { - copyOptions.externalPaths = true - } -} - -func copyPaths( - ctx context.Context, - from ReadBucket, - to WriteBucket, - copyExternalPaths bool, -) (int, error) { - paths, err := AllPaths(ctx, from, "") - if err != nil { - return 0, err - } - var count int - var lock sync.Mutex - jobs := make([]func(context.Context) error, len(paths)) - for i, path := range paths { - path := path - jobs[i] = func(ctx context.Context) error { - if err := copyPath(ctx, from, to, path, copyExternalPaths); err != nil { - return err - } - lock.Lock() - count++ - lock.Unlock() - return nil - } - } - err = thread.Parallelize(ctx, jobs) - return count, err -} - -// copyPath copies the path from the bucket at from to the bucket at to using the given paths. -// -// Paths will be normalized within this function. -func copyPath( - ctx context.Context, - from ReadBucket, - to WriteBucket, - path string, - copyExternalPaths bool, -) (retErr error) { - readObjectCloser, err := from.Get(ctx, path) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(err, readObjectCloser.Close()) - }() - return copyReadObject(ctx, to, readObjectCloser, copyExternalPaths) -} - -func copyReadObject( - ctx context.Context, - writeBucket WriteBucket, - readObject ReadObject, - copyExternalPaths bool, -) (retErr error) { - writeObjectCloser, err := writeBucket.Put(ctx, readObject.Path()) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, writeObjectCloser.Close()) - }() - if copyExternalPaths { - if err := writeObjectCloser.SetExternalPath(readObject.ExternalPath()); err != nil { - return err - } - } - _, err = io.Copy(writeObjectCloser, readObject) - return err -} - -type copyOptions struct { - externalPaths bool -} - -func newCopyOptions() *copyOptions { - return ©Options{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/diff.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/diff.go deleted file mode 100644 index a70df50886..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/diff.go +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "bytes" - "context" - "fmt" - "io" - "strings" - - "github.com/bufbuild/buf/private/pkg/command" - "github.com/bufbuild/buf/private/pkg/diff" -) - -// DiffOption is an option for Diff. -type DiffOption func(*diffOptions) - -// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of commands. -func DiffWithSuppressCommands() DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.suppressCommands = true - } -} - -// DiffWithSuppressCommands returns a new DiffOption that suppresses printing of timestamps. -func DiffWithSuppressTimestamps() DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.suppressTimestamps = true - } -} - -// DiffWithExternalPaths returns a new DiffOption that prints diffs with external paths -// instead of paths. -func DiffWithExternalPaths() DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.externalPaths = true - } -} - -// DiffWithExternalPathPrefixes returns a new DiffOption that sets the external path prefixes for the buckets. -// -// If a file is in one bucket but not the other, it will be assumed that the file begins -// with the given prefix, and this prefix should be substituted for the other prefix. -// -// For example, if diffing the directories "test/a" and "test/b", use "test/a/" and "test/b/", -// and a file that is in one with path "test/a/foo.txt" will be shown as not -// existing as "test/b/foo.txt" in two. -// -// Note that the prefixes are directly concatenated, so "/" should be included generally. -// -// This option has no effect if DiffWithExternalPaths is not set. -// This option is not required if the prefixes are equal. -func DiffWithExternalPathPrefixes( - oneExternalPathPrefix string, - twoExternalPathPrefix string, -) DiffOption { - return func(diffOptions *diffOptions) { - if oneExternalPathPrefix != twoExternalPathPrefix { - // we don't know if external paths are file paths or not - // so we just operate on pure string-prefix paths - // this comes up with for example s3:// - diffOptions.oneExternalPathPrefix = oneExternalPathPrefix - diffOptions.twoExternalPathPrefix = twoExternalPathPrefix - } - } -} - -// DiffWithTransform returns a DiffOption that adds a transform function. The transform function will be run on each -// file being compared before it is diffed. transform takes the arguments: -// -// side: one or two whether it is the first or second item in the diff -// filename: the filename including path -// content: the file content. -// -// transform returns a string that is the transformed content of filename. -// -// TODO: this needs to be refactored or removed, especially the implicit side enum. -// Perhaps provide a transform function for a given bucket and apply it there. -func DiffWithTransform( - transform func(side string, filename string, content []byte) []byte, -) DiffOption { - return func(diffOptions *diffOptions) { - diffOptions.transforms = append(diffOptions.transforms, transform) - } -} - -// DiffBytes does a diff of the ReadBuckets. -func DiffBytes( - ctx context.Context, - runner command.Runner, - one ReadBucket, - two ReadBucket, - options ...DiffOption, -) ([]byte, error) { - buffer := bytes.NewBuffer(nil) - if err := Diff(ctx, runner, buffer, one, two, options...); err != nil { - return nil, err - } - return buffer.Bytes(), nil -} - -// Diff writes a diff of the ReadBuckets to the Writer. -func Diff( - ctx context.Context, - runner command.Runner, - writer io.Writer, - one ReadBucket, - two ReadBucket, - options ...DiffOption, -) error { - diffOptions := newDiffOptions() - for _, option := range options { - option(diffOptions) - } - externalPaths := diffOptions.externalPaths - oneExternalPathPrefix := diffOptions.oneExternalPathPrefix - twoExternalPathPrefix := diffOptions.twoExternalPathPrefix - - oneObjectInfos, err := allObjectInfos(ctx, one, "") - if err != nil { - return err - } - twoObjectInfos, err := allObjectInfos(ctx, two, "") - if err != nil { - return err - } - sortObjectInfos(oneObjectInfos) - sortObjectInfos(twoObjectInfos) - onePathToObjectInfo := pathToObjectInfo(oneObjectInfos) - twoPathToObjectInfo := pathToObjectInfo(twoObjectInfos) - - for _, oneObjectInfo := range oneObjectInfos { - path := oneObjectInfo.Path() - oneDiffPath, err := getDiffPathForObjectInfo( - oneObjectInfo, - externalPaths, - oneExternalPathPrefix, - ) - if err != nil { - return err - } - oneData, err := ReadPath(ctx, one, path) - if err != nil { - return err - } - var twoData []byte - var twoDiffPath string - if twoObjectInfo, ok := twoPathToObjectInfo[path]; ok { - twoData, err = ReadPath(ctx, two, path) - if err != nil { - return err - } - twoDiffPath, err = getDiffPathForObjectInfo( - twoObjectInfo, - externalPaths, - twoExternalPathPrefix, - ) - if err != nil { - return err - } - } else { - twoDiffPath, err = getDiffPathForNotFound( - oneObjectInfo, - externalPaths, - oneExternalPathPrefix, - twoExternalPathPrefix, - ) - if err != nil { - return err - } - } - for _, transform := range diffOptions.transforms { - oneData = transform("one", oneDiffPath, oneData) - twoData = transform("two", twoDiffPath, twoData) - } - diffData, err := diff.Diff( - ctx, - runner, - oneData, - twoData, - oneDiffPath, - twoDiffPath, - diffOptions.toDiffPackageOptions()..., - ) - if err != nil { - return err - } - if len(diffData) > 0 { - if _, err := writer.Write(diffData); err != nil { - return err - } - } - } - for _, twoObjectInfo := range twoObjectInfos { - path := twoObjectInfo.Path() - if _, ok := onePathToObjectInfo[path]; !ok { - twoData, err := ReadPath(ctx, two, path) - if err != nil { - return err - } - oneDiffPath, err := getDiffPathForNotFound( - twoObjectInfo, - externalPaths, - twoExternalPathPrefix, - oneExternalPathPrefix, - ) - if err != nil { - return err - } - twoDiffPath, err := getDiffPathForObjectInfo( - twoObjectInfo, - externalPaths, - twoExternalPathPrefix, - ) - if err != nil { - return err - } - diffData, err := diff.Diff( - ctx, - runner, - nil, - twoData, - oneDiffPath, - twoDiffPath, - diffOptions.toDiffPackageOptions()..., - ) - if err != nil { - return err - } - if len(diffData) > 0 { - if _, err := writer.Write(diffData); err != nil { - return err - } - } - } - } - return nil -} - -func getDiffPathForObjectInfo( - objectInfo ObjectInfo, - externalPaths bool, - externalPathPrefix string, -) (string, error) { - if !externalPaths { - return objectInfo.Path(), nil - } - externalPath := objectInfo.ExternalPath() - if externalPathPrefix == "" { - return externalPath, nil - } - if !strings.HasPrefix(externalPath, externalPathPrefix) { - return "", fmt.Errorf("diff: expected %s to have prefix %s", externalPath, externalPathPrefix) - } - return externalPath, nil -} - -func getDiffPathForNotFound( - foundObjectInfo ObjectInfo, - externalPaths bool, - foundExternalPathPrefix string, - notFoundExternalPathPrefix string, -) (string, error) { - if !externalPaths { - return foundObjectInfo.Path(), nil - } - externalPath := foundObjectInfo.ExternalPath() - switch { - case foundExternalPathPrefix == "" && notFoundExternalPathPrefix == "": - // no prefix, just return external path - return externalPath, nil - case foundExternalPathPrefix == "" && notFoundExternalPathPrefix != "": - // the not-found side has a prefix, append the external path to this prefix, and we're done - return notFoundExternalPathPrefix + externalPath, nil - default: - //foundExternalPathPrefix != "" && notFoundExternalPathPrefix == "" - //foundExternalPathPrefix != "" && notFoundExternalPathPrefix != "" - if !strings.HasPrefix(externalPath, foundExternalPathPrefix) { - return "", fmt.Errorf("diff: expected %s to have prefix %s", externalPath, foundExternalPathPrefix) - } - return notFoundExternalPathPrefix + strings.TrimPrefix(externalPath, foundExternalPathPrefix), nil - } -} - -type diffOptions struct { - suppressCommands bool - suppressTimestamps bool - externalPaths bool - oneExternalPathPrefix string - twoExternalPathPrefix string - transforms []func(side string, filename string, content []byte) []byte -} - -func newDiffOptions() *diffOptions { - return &diffOptions{} -} - -func (d *diffOptions) toDiffPackageOptions() []diff.DiffOption { - var diffPackageOptions []diff.DiffOption - if d.suppressCommands { - diffPackageOptions = append(diffPackageOptions, diff.DiffWithSuppressCommands()) - } - if d.suppressTimestamps { - diffPackageOptions = append(diffPackageOptions, diff.DiffWithSuppressTimestamps()) - } - return diffPackageOptions -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/errors.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/errors.go deleted file mode 100644 index d753fc2492..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/errors.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "errors" - "fmt" - "strings" - - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -var ( - // ErrClosed is the error returned if a bucket or object is already closed. - ErrClosed = errors.New("already closed") - // ErrSetExternalPathUnsupported is the error returned if a bucket does not support SetExternalPath. - ErrSetExternalPathUnsupported = errors.New("setting the external path is unsupported for this bucket") - - // errNotExist is the error returned if a path does not exist. - errNotExist = errors.New("does not exist") -) - -// NewErrNotExist returns a new error for a path not existing. -func NewErrNotExist(path string) error { - return normalpath.NewError(path, errNotExist) -} - -// IsNotExist returns true for a error that is for a path not existing. -func IsNotExist(err error) bool { - return errors.Is(err, errNotExist) -} - -// NewErrExistsMultipleLocations returns a new error if a path exists in multiple locations. -func NewErrExistsMultipleLocations(path string, externalPaths ...string) error { - return &errorExistsMultipleLocations{ - Path: path, - ExternalPaths: externalPaths, - } -} - -// IsExistsMultipleLocations returns true if the error is for a path existing in multiple locations. -func IsExistsMultipleLocations(err error) bool { - if err == nil { - return false - } - asErr := &errorExistsMultipleLocations{} - return errors.As(err, &asErr) -} - -// IsWriteLimitReached returns true if the error is of writes exceeding the limit of the bucket. -func IsWriteLimitReached(err error) bool { - if err == nil { - return false - } - asErr := &errWriteLimitReached{} - return errors.As(err, &asErr) -} - -// errorExistsMultipleLocations is the error returned if a path exists in multiple locations. -type errorExistsMultipleLocations struct { - Path string - ExternalPaths []string -} - -// Error implements error. -func (e *errorExistsMultipleLocations) Error() string { - return e.Path + " exists in multiple locations: " + strings.Join(e.ExternalPaths, " ") -} - -// errWriteLimitReached is the error returned if the write limit is reached. -// -// See [LimitWriteBucket]. -type errWriteLimitReached struct { - Limit int64 - ExceedingBy int64 -} - -// Error implements error. -func (e *errWriteLimitReached) Error() string { - return fmt.Sprintf("write limit reached: limit: %d, exceeding by: %d", e.Limit, e.ExceedingBy) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/limit.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/limit.go deleted file mode 100644 index 9de2e9f2f7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/limit.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - - "go.uber.org/atomic" -) - -// LimitWriteBucket returns a [WriteBucket] that writes to [writeBucket] -// but stops with an error after [limit] bytes are written. -// -// The error can be checked using [IsWriteLimitReached]. -// -// A negative [limit] is same as 0 limit. -func LimitWriteBucket(writeBucket WriteBucket, limit int) WriteBucket { - if limit < 0 { - limit = 0 - } - return newLimitedWriteBucket(writeBucket, int64(limit)) -} - -type limitedWriteBucket struct { - WriteBucket - currentSize *atomic.Int64 - limit int64 -} - -func newLimitedWriteBucket(bucket WriteBucket, limit int64) *limitedWriteBucket { - return &limitedWriteBucket{ - WriteBucket: bucket, - currentSize: atomic.NewInt64(0), - limit: limit, - } -} - -func (w *limitedWriteBucket) Put(ctx context.Context, path string, opts ...PutOption) (WriteObjectCloser, error) { - writeObjectCloser, err := w.WriteBucket.Put(ctx, path, opts...) - if err != nil { - return nil, err - } - return newLimitedWriteObjectCloser(writeObjectCloser, w.currentSize, w.limit), nil -} - -type limitedWriteObjectCloser struct { - WriteObjectCloser - - bucketSize *atomic.Int64 - limit int64 -} - -func newLimitedWriteObjectCloser( - writeObjectCloser WriteObjectCloser, - bucketSize *atomic.Int64, - limit int64, -) *limitedWriteObjectCloser { - return &limitedWriteObjectCloser{ - WriteObjectCloser: writeObjectCloser, - bucketSize: bucketSize, - limit: limit, - } -} - -func (o *limitedWriteObjectCloser) Write(p []byte) (int, error) { - writeSize := int64(len(p)) - newBucketSize := o.bucketSize.Add(writeSize) - if newBucketSize > o.limit { - o.bucketSize.Sub(writeSize) - return 0, &errWriteLimitReached{ - Limit: o.limit, - ExceedingBy: newBucketSize - o.limit, - } - } - writtenSize, err := o.WriteObjectCloser.Write(p) - if int64(writtenSize) < writeSize { - o.bucketSize.Sub(writeSize - int64(writtenSize)) - } - return writtenSize, err -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/map.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/map.go deleted file mode 100644 index f924a84143..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/map.go +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - "errors" - "fmt" - "io" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -// MapReadBucket maps the ReadBucket. -// -// If the Mappers are empty, the original ReadBucket is returned. -// If there is more than one Mapper, the Mappers are called in order -// for UnmapFullPath, with the order reversed for MapPath and MapPrefix. -// -// That is, order these assuming you are starting with a full path and -// working to a path. -func MapReadBucket(readBucket ReadBucket, mappers ...Mapper) ReadBucket { - if len(mappers) == 0 { - return readBucket - } - return newMapReadBucket(readBucket, MapChain(mappers...)) -} - -// MapWriteBucket maps the WriteBucket. -// -// If the Mappers are empty, the original WriteBucket is returned. -// If there is more than one Mapper, the Mappers are called in order -// for UnmapFullPath, with the order reversed for MapPath and MapPrefix. -// -// That is, order these assuming you are starting with a full path and -// working to a path. -// -// If a path that does not match is called for Put, an error is returned. -func MapWriteBucket(writeBucket WriteBucket, mappers ...Mapper) WriteBucket { - if len(mappers) == 0 { - return writeBucket - } - return newMapWriteBucket(writeBucket, MapChain(mappers...)) -} - -// MapReadWriteBucket maps the ReadWriteBucket. -// -// If the Mappers are empty, the original ReadWriteBucket is returned. -// If there is more than one Mapper, the Mappers are called in order -// for UnmapFullPath, with the order reversed for MapPath and MapPrefix. -// -// That is, order these assuming you are starting with a full path and -// working to a path. -func MapReadWriteBucket(readWriteBucket ReadWriteBucket, mappers ...Mapper) ReadWriteBucket { - if len(mappers) == 0 { - return readWriteBucket - } - mapper := MapChain(mappers...) - return compositeReadWriteBucket{ - newMapReadBucket(readWriteBucket, mapper), - newMapWriteBucket(readWriteBucket, mapper), - } -} - -type mapReadBucket struct { - delegate ReadBucket - mapper Mapper -} - -func newMapReadBucket( - delegate ReadBucket, - mapper Mapper, -) *mapReadBucket { - return &mapReadBucket{ - delegate: delegate, - mapper: mapper, - } -} - -func (r *mapReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) { - fullPath, err := r.getFullPath(path) - if err != nil { - return nil, err - } - readObjectCloser, err := r.delegate.Get(ctx, fullPath) - // TODO: if this is a path error, we should replace the path - if err != nil { - return nil, err - } - return replaceReadObjectCloserPath(readObjectCloser, path), nil -} - -func (r *mapReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) { - fullPath, err := r.getFullPath(path) - if err != nil { - return nil, err - } - objectInfo, err := r.delegate.Stat(ctx, fullPath) - // TODO: if this is a path error, we should replace the path - if err != nil { - return nil, err - } - return replaceObjectInfoPath(objectInfo, path), nil -} - -func (r *mapReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error { - prefix, err := normalpath.NormalizeAndValidate(prefix) - if err != nil { - return err - } - fullPrefix, matches := r.mapper.MapPrefix(prefix) - if !matches { - return nil - } - return r.delegate.Walk( - ctx, - fullPrefix, - func(objectInfo ObjectInfo) error { - path, matches, err := r.mapper.UnmapFullPath(objectInfo.Path()) - if err != nil { - return err - } - if !matches { - return nil - } - return f(replaceObjectInfoPath(objectInfo, path)) - }, - ) -} - -func (r *mapReadBucket) getFullPath(path string) (string, error) { - path, err := normalpath.NormalizeAndValidate(path) - if err != nil { - return "", err - } - if path == "." { - return "", errors.New("cannot get root") - } - fullPath, matches := r.mapper.MapPath(path) - if !matches { - return "", NewErrNotExist(path) - } - return fullPath, nil -} - -type mapWriteBucket struct { - delegate WriteBucket - mapper Mapper -} - -func newMapWriteBucket( - delegate WriteBucket, - mapper Mapper, -) *mapWriteBucket { - return &mapWriteBucket{ - delegate: delegate, - mapper: mapper, - } -} - -func (w *mapWriteBucket) Put(ctx context.Context, path string, opts ...PutOption) (WriteObjectCloser, error) { - fullPath, err := w.getFullPath(path) - if err != nil { - return nil, err - } - writeObjectCloser, err := w.delegate.Put(ctx, fullPath, opts...) - // TODO: if this is a path error, we should replace the path - if err != nil { - return nil, err - } - return replaceWriteObjectCloserExternalPathNotSupported(writeObjectCloser), nil -} - -func (w *mapWriteBucket) Delete(ctx context.Context, path string) error { - fullPath, err := w.getFullPath(path) - if err != nil { - return err - } - return w.delegate.Delete(ctx, fullPath) -} - -func (w *mapWriteBucket) DeleteAll(ctx context.Context, prefix string) error { - prefix, err := normalpath.NormalizeAndValidate(prefix) - if err != nil { - return err - } - fullPrefix, matches := w.mapper.MapPrefix(prefix) - if !matches { - return nil - } - return w.delegate.DeleteAll(ctx, fullPrefix) -} - -func (*mapWriteBucket) SetExternalPathSupported() bool { - return false -} - -func (w *mapWriteBucket) getFullPath(path string) (string, error) { - path, err := normalpath.NormalizeAndValidate(path) - if err != nil { - return "", err - } - if path == "." { - return "", errors.New("cannot get root") - } - fullPath, matches := w.mapper.MapPath(path) - if !matches { - return "", fmt.Errorf("path does not match: %s", path) - } - return fullPath, nil -} - -func replaceObjectInfoPath(objectInfo ObjectInfo, path string) ObjectInfo { - if objectInfo.Path() == path { - return objectInfo - } - return storageutil.NewObjectInfo( - path, - objectInfo.ExternalPath(), - ) -} - -func replaceReadObjectCloserPath(readObjectCloser ReadObjectCloser, path string) ReadObjectCloser { - if readObjectCloser.Path() == path { - return readObjectCloser - } - return compositeReadObjectCloser{replaceObjectInfoPath(readObjectCloser, path), readObjectCloser} -} - -func replaceWriteObjectCloserExternalPathNotSupported(writeObjectCloser WriteObjectCloser) WriteObjectCloser { - return writeObjectCloserExternalPathNotSuppoted{writeObjectCloser} -} - -type writeObjectCloserExternalPathNotSuppoted struct { - io.WriteCloser -} - -func (writeObjectCloserExternalPathNotSuppoted) SetExternalPath(string) error { - return ErrSetExternalPathUnsupported -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/mapper.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/mapper.go deleted file mode 100644 index e8b6a612d5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/mapper.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -// Mapper is a path mapper. -// -// This will cause a Bucket to operate as if the Mapper has all paths mapped. -type Mapper interface { - // Map maps the path to the full path. - // - // The path is expected to be normalized and validated. - // The returned path is expected to be normalized and validated. - // If the path cannot be mapped, this returns false. - MapPath(path string) (string, bool) - // Map maps the prefix to the full prefix. - // - // The path is expected to be normalized and validated. - // The returned path is expected to be normalized and validated. - // If the path cannot be mapped, this returns false. - MapPrefix(prefix string) (string, bool) - // UnmapFullPath maps the full path to the path. - // - // Returns false if the full path does not apply. - // The path is expected to be normalized and validated. - // The returned path is expected to be normalized and validated. - UnmapFullPath(fullPath string) (string, bool, error) - isMapper() -} - -// MapOnPrefix returns a Mapper that will map the Bucket as if it was created on the given prefix. -// -// The prefix is expected to be normalized and validated. -func MapOnPrefix(prefix string) Mapper { - return prefixMapper{prefix} -} - -// MapChain chains the mappers. -// -// If any mapper does not match, this stops checking Mappers and returns -// an empty path and false. This is as opposed to MatchAnd, that runs -// every Matcher and returns the path regardless. -// -// If the Mappers are empty, a no-op Mapper is returned. -// If there is more than one Mapper, the Mappers are called in order -// for UnmapFullPath, with the order reversed for MapPath and MapPrefix. -// -// That is, order these assuming you are starting with a full path and -// working to a path. -func MapChain(mappers ...Mapper) Mapper { - switch len(mappers) { - case 0: - return nopMapper{} - case 1: - return mappers[0] - default: - return chainMapper{mappers} - } -} - -// ***** private ***** - -type prefixMapper struct { - prefix string -} - -func (p prefixMapper) MapPath(path string) (string, bool) { - return normalpath.Join(p.prefix, path), true -} - -func (p prefixMapper) MapPrefix(prefix string) (string, bool) { - return normalpath.Join(p.prefix, prefix), true -} - -func (p prefixMapper) UnmapFullPath(fullPath string) (string, bool, error) { - if !normalpath.EqualsOrContainsPath(p.prefix, fullPath, normalpath.Relative) { - return "", false, nil - } - path, err := normalpath.Rel(p.prefix, fullPath) - if err != nil { - return "", false, err - } - return path, true, nil -} - -func (prefixMapper) isMapper() {} - -type chainMapper struct { - mappers []Mapper -} - -func (c chainMapper) MapPath(path string) (string, bool) { - return c.mapFunc(path, Mapper.MapPath) -} - -func (c chainMapper) MapPrefix(prefix string) (string, bool) { - return c.mapFunc(prefix, Mapper.MapPrefix) -} - -func (c chainMapper) UnmapFullPath(fullPath string) (string, bool, error) { - path := fullPath - var matches bool - var err error - for _, mapper := range c.mappers { - path, matches, err = mapper.UnmapFullPath(path) - if err != nil { - return "", false, err - } - if !matches { - return "", false, nil - } - } - return path, true, nil -} - -func (c chainMapper) mapFunc( - pathOrPrefix string, - f func(Mapper, string) (string, bool), -) (string, bool) { - fullPathOrPrefix := pathOrPrefix - var matches bool - for i := len(c.mappers) - 1; i >= 0; i-- { - mapper := c.mappers[i] - fullPathOrPrefix, matches = f(mapper, fullPathOrPrefix) - if !matches { - return "", false - } - } - return fullPathOrPrefix, true -} - -func (chainMapper) isMapper() {} - -type nopMapper struct{} - -func (n nopMapper) MapPath(path string) (string, bool) { - return path, true -} - -func (n nopMapper) MapPrefix(prefix string) (string, bool) { - return prefix, true -} - -func (nopMapper) UnmapFullPath(fullPath string) (string, bool, error) { - return fullPath, true, nil -} - -func (nopMapper) isMapper() {} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/matcher.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/matcher.go deleted file mode 100644 index 05f7d31e70..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/matcher.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -// Matcher is a path matcher. -// -// This will cause a Bucket to operate as if it only contains matching paths. -type Matcher interface { - Mapper - isMatcher() -} - -// MatchPathExt returns a Matcher for the extension. -func MatchPathExt(ext string) Matcher { - return pathMatcherFunc(func(path string) bool { - return normalpath.Ext(path) == ext - }) -} - -// MatchPathBase returns a Matcher for the base. -func MatchPathBase(base string) Matcher { - return pathMatcherFunc(func(path string) bool { - return normalpath.Base(path) == base - }) -} - -// MatchPathEqual returns a Matcher for the path. -func MatchPathEqual(equalPath string) Matcher { - return pathMatcherFunc(func(path string) bool { - return path == equalPath - }) -} - -// MatchPathEqualOrContained returns a Matcher for the path that matches -// on paths equal or contained by equalOrContainingPath. -func MatchPathEqualOrContained(equalOrContainingPath string) Matcher { - return pathMatcherFunc(func(path string) bool { - return normalpath.EqualsOrContainsPath(equalOrContainingPath, path, normalpath.Relative) - }) -} - -// MatchPathContained returns a Matcher for the directory that matches -// on paths by contained by containingDir. -func MatchPathContained(containingDir string) Matcher { - return pathMatcherFunc(func(path string) bool { - return normalpath.ContainsPath(containingDir, path, normalpath.Relative) - }) -} - -// MatchOr returns an Or of the Matchers. -func MatchOr(matchers ...Matcher) Matcher { - return orMatcher(matchers) -} - -// MatchAnd returns an And of the Matchers. -func MatchAnd(matchers ...Matcher) Matcher { - return andMatcher(matchers) -} - -// MatchNot returns an Not of the Matcher. -func MatchNot(matcher Matcher) Matcher { - return notMatcher{matcher} -} - -// ***** private ***** - -// We limit or/and/not to Matchers as composite logic must assume -// the the input path is not modified, so that we can always return it -// -// We might want to just remove Matcher implementing Mapper for simplification, -// and just have a Matches function, then handle chaining them separately. - -type pathMatcherFunc func(string) bool - -func (f pathMatcherFunc) MapPath(path string) (string, bool) { - matches := f(path) - return path, matches -} - -func (f pathMatcherFunc) MapPrefix(prefix string) (string, bool) { - // always returns true, path matchers do not check prefixes - return prefix, true -} - -func (f pathMatcherFunc) UnmapFullPath(fullPath string) (string, bool, error) { - matches := f(fullPath) - return fullPath, matches, nil -} - -func (pathMatcherFunc) isMatcher() {} -func (pathMatcherFunc) isMapper() {} - -type orMatcher []Matcher - -func (o orMatcher) MapPath(path string) (string, bool) { - for _, matcher := range o { - if _, matches := matcher.MapPath(path); matches { - return path, true - } - } - return "", false -} - -func (o orMatcher) MapPrefix(prefix string) (string, bool) { - for _, matcher := range o { - if _, matches := matcher.MapPrefix(prefix); matches { - return prefix, true - } - } - return "", false -} - -func (o orMatcher) UnmapFullPath(fullPath string) (string, bool, error) { - for _, matcher := range o { - _, matches, err := matcher.UnmapFullPath(fullPath) - if err != nil { - return "", false, err - } - if matches { - return fullPath, true, nil - } - } - return fullPath, false, nil -} - -func (orMatcher) isMatcher() {} -func (orMatcher) isMapper() {} - -type andMatcher []Matcher - -func (a andMatcher) MapPath(path string) (string, bool) { - for _, matcher := range a { - if _, matches := matcher.MapPath(path); !matches { - return path, false - } - } - return path, true -} - -func (a andMatcher) MapPrefix(prefix string) (string, bool) { - for _, matcher := range a { - if _, matches := matcher.MapPrefix(prefix); !matches { - return prefix, false - } - } - return prefix, true -} - -func (a andMatcher) UnmapFullPath(fullPath string) (string, bool, error) { - for _, matcher := range a { - _, matches, err := matcher.UnmapFullPath(fullPath) - if err != nil { - return "", false, err - } - if !matches { - return fullPath, false, nil - } - } - return fullPath, true, nil -} - -func (andMatcher) isMatcher() {} -func (andMatcher) isMapper() {} - -type notMatcher struct { - delegate Matcher -} - -func (n notMatcher) MapPath(path string) (string, bool) { - _, matches := n.delegate.MapPath(path) - return path, !matches -} - -func (n notMatcher) MapPrefix(prefix string) (string, bool) { - _, matches := n.delegate.MapPath(prefix) - return prefix, !matches -} - -func (n notMatcher) UnmapFullPath(fullPath string) (string, bool, error) { - _, matches, err := n.delegate.UnmapFullPath(fullPath) - if err != nil { - return "", false, err - } - return fullPath, !matches, nil -} - -func (notMatcher) isMatcher() {} -func (notMatcher) isMapper() {} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/multi.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/multi.go deleted file mode 100644 index 9899eca3d8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/multi.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -// MultiReadBucket takes the union of the ReadBuckets. -// -// If no readBuckets are given, this returns a no-op ReadBucket. -// If one readBucket is given, this returns the original ReadBucket. -// Otherwise, this returns a ReadBucket that will get from all buckets. -// -// This expects and validates that no paths overlap between the ReadBuckets. -// This assumes that buckets are logically unique. -func MultiReadBucket(readBuckets ...ReadBucket) ReadBucket { - switch len(readBuckets) { - case 0: - return nopReadBucket{} - case 1: - return readBuckets[0] - default: - return newMultiReadBucket(readBuckets) - } -} - -type multiReadBucket struct { - delegates []ReadBucket -} - -func newMultiReadBucket( - delegates []ReadBucket, -) *multiReadBucket { - return &multiReadBucket{ - delegates: delegates, - } -} - -func (m *multiReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) { - _, delegateIndex, err := m.getObjectInfoAndDelegateIndex(ctx, path) - if err != nil { - return nil, err - } - return m.delegates[delegateIndex].Get(ctx, path) -} - -func (m *multiReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) { - objectInfo, _, err := m.getObjectInfoAndDelegateIndex(ctx, path) - return objectInfo, err -} - -func (m *multiReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error { - seenPathToExternalPath := make(map[string]string) - for _, delegate := range m.delegates { - if err := delegate.Walk( - ctx, - prefix, - func(objectInfo ObjectInfo) error { - path := objectInfo.Path() - externalPath := objectInfo.ExternalPath() - if existingExternalPath, ok := seenPathToExternalPath[path]; ok { - // this does not return all paths that are matching, unlike Get and Stat - // we do not want to continue iterating, as calling Walk on the same path could cause errors downstream - // as callers expect a single call per path. - return NewErrExistsMultipleLocations(path, existingExternalPath, externalPath) - } - seenPathToExternalPath[path] = externalPath - return f(objectInfo) - }, - ); err != nil { - return err - } - } - return nil -} - -func (m *multiReadBucket) getObjectInfoAndDelegateIndex( - ctx context.Context, - path string, -) (ObjectInfo, int, error) { - var objectInfos []ObjectInfo - var delegateIndices []int - for i, delegate := range m.delegates { - objectInfo, err := delegate.Stat(ctx, path) - if err != nil { - if IsNotExist(err) { - continue - } - return nil, 0, err - } - objectInfos = append(objectInfos, objectInfo) - delegateIndices = append(delegateIndices, i) - } - switch len(objectInfos) { - case 0: - return nil, 0, NewErrNotExist(path) - case 1: - return objectInfos[0], delegateIndices[0], nil - default: - externalPaths := make([]string, len(objectInfos)) - for i, objectInfo := range objectInfos { - externalPaths[i] = objectInfo.ExternalPath() - } - return nil, 0, NewErrExistsMultipleLocations(path, externalPaths...) - } -} - -type nopReadBucket struct{} - -func (nopReadBucket) Get(ctx context.Context, path string) (ReadObjectCloser, error) { - return nil, nopGetStat(path) -} - -func (nopReadBucket) Stat(ctx context.Context, path string) (ObjectInfo, error) { - return nil, nopGetStat(path) -} - -func (nopReadBucket) Walk(ctx context.Context, prefix string, f func(ObjectInfo) error) error { - _, err := storageutil.ValidatePrefix(prefix) - return err -} - -func nopGetStat(path string) error { - path, err := storageutil.ValidatePath(path) - if err != nil { - return err - } - return NewErrNotExist(path) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storage.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storage.go deleted file mode 100644 index c93653b7dd..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storage.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storage implements a simple storage abstraction. -// -// This is meant to abstract filesystem calls, as well as be a wrapper -// for in-memory or remote storage. It also provides a smaller attack -// vector as implementations can do verifications as to what is accessed -// and what is not. -package storage diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/storagearchive.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/storagearchive.go deleted file mode 100644 index 3f78a2b1d5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/storagearchive.go +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storagearchive implements archive utilities. -package storagearchive - -import ( - "archive/tar" - "context" - "errors" - "fmt" - "io" - "math" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" - "github.com/klauspost/compress/zip" - "go.uber.org/multierr" -) - -var ( - // ErrFileSizeLimit is returned when file read limit is reached. - // - // See [WithMaxFileSizeUntarOption] - ErrFileSizeLimit = errors.New("file size exceeded read limit") -) - -// Tar tars the given bucket to the writer. -// -// Only regular files are added to the writer. -// All files are written as 0644. -func Tar( - ctx context.Context, - readBucket storage.ReadBucket, - writer io.Writer, -) (retErr error) { - tarWriter := tar.NewWriter(writer) - defer func() { - retErr = multierr.Append(retErr, tarWriter.Close()) - }() - return storage.WalkReadObjects( - ctx, - readBucket, - "", - func(readObject storage.ReadObject) error { - data, err := io.ReadAll(readObject) - if err != nil { - return err - } - if err := tarWriter.WriteHeader( - &tar.Header{ - Typeflag: tar.TypeReg, - Name: readObject.Path(), - Size: int64(len(data)), - // If we ever use this outside of testing, we will want to do something about this - Mode: 0644, - }, - ); err != nil { - return err - } - _, err = tarWriter.Write(data) - return err - }, - ) -} - -// Untar untars the given tar archive from the reader into the bucket. -// -// Only regular files are added to the bucket. -// -// Paths from the tar archive will be mapped before adding to the bucket. -// Mapper can be nil. -// StripComponents happens before the mapper. -func Untar( - ctx context.Context, - reader io.Reader, - writeBucket storage.WriteBucket, - mapper storage.Mapper, - stripComponentCount uint32, - opts ...UntarOption, -) error { - options := &untarOptions{ - maxFileSize: math.MaxInt64, - } - for _, opt := range opts { - opt.applyUntar(options) - } - tarReader := tar.NewReader(reader) - walkChecker := storageutil.NewWalkChecker() - for tarHeader, err := tarReader.Next(); err != io.EOF; tarHeader, err = tarReader.Next() { - if err != nil { - return err - } - if err := walkChecker.Check(ctx); err != nil { - return err - } - if tarHeader.Size < 0 { - return fmt.Errorf("invalid size for tar file %s: %d", tarHeader.Name, tarHeader.Size) - } - path, ok, err := unmapArchivePath(tarHeader.Name, mapper, stripComponentCount) - if err != nil { - return err - } - if !ok || !tarHeader.FileInfo().Mode().IsRegular() { - continue - } - if tarHeader.Size > options.maxFileSize { - return fmt.Errorf("%w %s:%d", ErrFileSizeLimit, tarHeader.Name, tarHeader.Size) - } - if err := storage.CopyReader(ctx, writeBucket, tarReader, path); err != nil { - return err - } - } - return nil -} - -// UntarOption is an option for [Untar]. -type UntarOption interface { - applyUntar(*untarOptions) -} - -// WithMaxFileSizeUntarOption returns an option that limits the maximum size -func WithMaxFileSizeUntarOption(size int) UntarOption { - return &withMaxFileSizeUntarOption{maxFileSize: int64(size)} -} - -// Zip zips the given bucket to the writer. -// -// Only regular files are added to the writer. -func Zip( - ctx context.Context, - readBucket storage.ReadBucket, - writer io.Writer, - compressed bool, -) (retErr error) { - zipWriter := zip.NewWriter(writer) - defer func() { - retErr = multierr.Append(retErr, zipWriter.Close()) - }() - return storage.WalkReadObjects( - ctx, - readBucket, - "", - func(readObject storage.ReadObject) error { - method := zip.Store - if compressed { - method = zip.Deflate - } - header := &zip.FileHeader{ - Name: readObject.Path(), - Method: method, - } - writer, err := zipWriter.CreateHeader(header) - if err != nil { - return err - } - _, err = io.Copy(writer, readObject) - return err - }, - ) -} - -// Unzip unzips the given zip archive from the reader into the bucket. -// -// Only regular files are added to the bucket. -// -// Paths from the zip archive will be mapped before adding to the bucket. -// Mapper can be nil. -// StripComponents happens before the mapper. -func Unzip( - ctx context.Context, - readerAt io.ReaderAt, - size int64, - writeBucket storage.WriteBucket, - mapper storage.Mapper, - stripComponentCount uint32, -) error { - if size < 0 { - return fmt.Errorf("unknown size to unzip: %d", int(size)) - } - if size == 0 { - return nil - } - zipReader, err := zip.NewReader(readerAt, size) - if err != nil { - return err - } - walkChecker := storageutil.NewWalkChecker() - // reads can be done concurrently in the future - for _, zipFile := range zipReader.File { - if err := walkChecker.Check(ctx); err != nil { - return err - } - path, ok, err := unmapArchivePath(zipFile.Name, mapper, stripComponentCount) - if err != nil { - return err - } - if !ok { - continue - } - if zipFile.FileInfo().Mode().IsRegular() { - if err := copyZipFile(ctx, writeBucket, zipFile, path); err != nil { - return err - } - } - } - return nil -} - -func copyZipFile( - ctx context.Context, - writeBucket storage.WriteBucket, - zipFile *zip.File, - path string, -) (retErr error) { - readCloser, err := zipFile.Open() - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, readCloser.Close()) - }() - return storage.CopyReader(ctx, writeBucket, readCloser, path) -} - -func unmapArchivePath( - archivePath string, - mapper storage.Mapper, - stripComponentCount uint32, -) (string, bool, error) { - if archivePath == "" { - return "", false, errors.New("empty archive file name") - } - fullPath, err := normalpath.NormalizeAndValidate(archivePath) - if err != nil { - return "", false, err - } - if fullPath == "." { - return "", false, nil - } - fullPath, ok := normalpath.StripComponents(fullPath, stripComponentCount) - if !ok { - return "", false, nil - } - if mapper != nil { - return mapper.UnmapFullPath(fullPath) - } - return fullPath, true, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/untar_options.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/untar_options.go deleted file mode 100644 index 7319a3620c..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/untar_options.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagearchive - -type untarOptions struct { - maxFileSize int64 -} - -type withMaxFileSizeUntarOption struct { - maxFileSize int64 -} - -func (o *withMaxFileSizeUntarOption) applyUntar(options *untarOptions) { - options.maxFileSize = o.maxFileSize -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/usage.gen.go deleted file mode 100644 index b42b1ccfee..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagearchive/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storagearchive - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/bucket.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/bucket.go deleted file mode 100644 index 7dc03589b9..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/bucket.go +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagegit - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -type bucket struct { - objectReader git.ObjectReader - symlinks bool - root git.Tree -} - -func newBucket( - objectReader git.ObjectReader, - symlinksIfSupported bool, - root git.Tree, -) (storage.ReadBucket, error) { - return &bucket{ - objectReader: objectReader, - symlinks: symlinksIfSupported, - root: root, - }, nil -} - -func (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) { - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - node, err := b.root.Descendant(path, b.objectReader) - if err != nil { - if errors.Is(err, git.ErrTreeNodeNotFound) { - return nil, storage.NewErrNotExist(path) - } - return nil, err - } - switch node.Mode() { - case git.ModeFile, git.ModeExe: - data, err := b.objectReader.Blob(node.Hash()) - if err != nil { - return nil, err - } - return &namedReader{ - info: b.newObjectInfo(path), - reader: bytes.NewReader(data), - }, nil - case git.ModeSymlink: - if !b.symlinks { - return nil, storage.NewErrNotExist(path) - } - // Symlinks are stored as blobs that reference the target path as a relative - // path. We can follow this symlink trivially. - data, err := b.objectReader.Blob(node.Hash()) - if err != nil { - return nil, err - } - path, err := normalpath.NormalizeAndValidate( - normalpath.Join( - normalpath.Base(path), - string(data), - ), - ) - if err != nil { - return nil, fmt.Errorf("invalid path %q: %w", path, err) - } - return b.Get(ctx, path) - default: - return nil, storage.NewErrNotExist(path) - } -} - -func (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) { - node, err := b.root.Descendant(path, b.objectReader) - if err != nil { - if errors.Is(err, git.ErrTreeNodeNotFound) { - return nil, storage.NewErrNotExist(path) - } - return nil, err - } - switch node.Mode() { - case git.ModeFile, git.ModeExe: - return b.newObjectInfo(path), nil - case git.ModeSymlink: - if !b.symlinks { - return nil, storage.NewErrNotExist(path) - } - return b.newObjectInfo(path), nil - default: - return nil, storage.NewErrNotExist(path) - } -} - -func (b *bucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error { - prefix, err := storageutil.ValidatePrefix(prefix) - if err != nil { - return err - } - walkChecker := storageutil.NewWalkChecker() - return b.walk(b.root, b.objectReader, prefix, func(path string) error { - if err := walkChecker.Check(ctx); err != nil { - return err - } - return f(b.newObjectInfo(path)) - }) -} - -func (b *bucket) walk( - parent git.Tree, - objectReader git.ObjectReader, - prefix string, - walkFn func(string) error, -) error { - if prefix != "." { - node, err := parent.Descendant(prefix, b.objectReader) - if err != nil { - if errors.Is(err, git.ErrTreeNodeNotFound) { - return storage.NewErrNotExist(prefix) - } - return err - } - if node.Mode() != git.ModeDir { - return errors.New("prefix is not a directory") - } - subTree, err := b.objectReader.Tree(node.Hash()) - if err != nil { - return err - } - parent = subTree - } - return b.walkTree(parent, objectReader, prefix, walkFn) -} - -func (b *bucket) walkTree( - parent git.Tree, - objectReader git.ObjectReader, - prefix string, - walkFn func(string) error, -) error { - for _, node := range parent.Nodes() { - path := normalpath.Join(prefix, node.Name()) - switch node.Mode() { - case git.ModeFile, git.ModeExe: - if err := walkFn(path); err != nil { - return err - } - case git.ModeSymlink: - if b.symlinks { - if err := walkFn(path); err != nil { - return err - } - } - case git.ModeDir: - subTree, err := objectReader.Tree(node.Hash()) - if err != nil { - return err - } - if err := b.walkTree(subTree, objectReader, path, walkFn); err != nil { - return err - } - default: - // ignored - } - } - return nil -} - -// path is expected to be normalized by calling functions -func (b *bucket) newObjectInfo(path string) storage.ObjectInfo { - return storageutil.NewObjectInfo( - path, - path, - ) -} - -type namedReader struct { - info storage.ObjectInfo - reader io.Reader -} - -var _ storage.ReadObjectCloser = (*namedReader)(nil) - -func (br *namedReader) Path() string { - return br.info.Path() -} -func (br *namedReader) ExternalPath() string { - return br.info.ExternalPath() -} - -func (br *namedReader) Read(p []byte) (n int, err error) { - return br.reader.Read(p) -} - -func (br *namedReader) Close() error { - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/doc.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/doc.go deleted file mode 100644 index 25f8661685..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storagegit implements a storage abstraction for Git repositories. -package storagegit diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/provider.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/provider.go deleted file mode 100644 index cf37697fec..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/provider.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagegit - -import ( - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/storage" -) - -type provider struct { - objectReader git.ObjectReader - symlinks bool -} - -func newProvider(objectReader git.ObjectReader, opts ...ProviderOption) *provider { - p := &provider{ - objectReader: objectReader, - } - for _, opt := range opts { - opt(p) - } - return p -} - -func (p *provider) NewReadBucket(treeHash git.Hash, options ...ReadBucketOption) (storage.ReadBucket, error) { - var opts readBucketOptions - for _, opt := range options { - opt(&opts) - } - tree, err := p.objectReader.Tree(treeHash) - if err != nil { - return nil, err - } - return newBucket( - p.objectReader, - p.symlinks && opts.symlinksIfSupported, - tree, - ) -} - -// doing this as a separate struct so that it's clear this is resolved -// as a combination of the provider options and read write bucket options -// so there's no potential issues in newBucket -type readBucketOptions struct { - symlinksIfSupported bool -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/storagegit.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/storagegit.go deleted file mode 100644 index a9bc67cbf1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/storagegit.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagegit - -import ( - "github.com/bufbuild/buf/private/pkg/git" - "github.com/bufbuild/buf/private/pkg/storage" -) - -// Provider provides storage buckets for a git repository. -type Provider interface { - // NewReadBucket returns a new ReadBucket that represents - // the state of the working tree at the particular tree. - // - // Typically, callers will want to source the tree from a commit, but - // they can also use a subtree of another tree. - NewReadBucket(hash git.Hash, options ...ReadBucketOption) (storage.ReadBucket, error) -} - -// ProviderOption is an option for a new Provider. -type ProviderOption func(*provider) - -// ProviderWithSymlinks returns a ProviderOption that results in symlink support. -// -// Note that ReadBucketWithSymlinksIfSupported still needs to be passed for a given -// ReadBucket to have symlinks followed. -func ProviderWithSymlinks() ProviderOption { - return func(provider *provider) { - provider.symlinks = true - } -} - -// ReadBucketOption is an option for a new ReadBucket. -type ReadBucketOption func(*readBucketOptions) - -// ReadBucketWithSymlinksIfSupported returns a ReadBucketOption that results -// in symlink support being enabled for this bucket. If the Provider did not have symlink -// support, this is a no-op. -func ReadBucketWithSymlinksIfSupported() ReadBucketOption { - return func(b *readBucketOptions) { - b.symlinksIfSupported = true - } -} - -// NewProvider creates a new Provider for a git repository. -func NewProvider(objectReader git.ObjectReader, options ...ProviderOption) Provider { - return newProvider(objectReader, options...) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/usage.gen.go deleted file mode 100644 index 7b7ce36c22..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagegit/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storagegit - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/bucket.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/bucket.go deleted file mode 100644 index 45975801fb..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/bucket.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemanifest - -import ( - "context" - "fmt" - - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -type bucket struct { - manifest *manifest.Manifest - blobSet *manifest.BlobSet -} - -func newBucket( - m *manifest.Manifest, - blobSet *manifest.BlobSet, - options ...ReadBucketOption, -) (*bucket, error) { - readBucketOptions := newReadBucketOptions() - for _, option := range options { - option(readBucketOptions) - } - // TODO: why is this validation in newBucket, why is this not somewhere else? - // This should not be in storagemanifest. - if readBucketOptions.allManifestBlobs { - if err := m.Range(func(path string, digest manifest.Digest) error { - if _, ok := blobSet.BlobFor(digest.String()); !ok { - return fmt.Errorf("manifest path %q with digest %q has no associated blob", path, digest.String()) - } - return nil - }); err != nil { - return nil, err - } - } - if readBucketOptions.noExtraBlobs { - for _, blob := range blobSet.Blobs() { - digestString := blob.Digest().String() - if _, ok := m.PathsFor(digestString); !ok { - return nil, fmt.Errorf("blob with digest %q is not present in the manifest", digestString) - } - } - } - return &bucket{ - manifest: m, - blobSet: blobSet, - }, nil -} - -func (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) { - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - blob, ok := b.blobFor(path) - if !ok { - return nil, storage.NewErrNotExist(path) - } - file, err := blob.Open(ctx) - if err != nil { - return nil, err - } - return newReadObjectCloser(path, file), nil -} - -func (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) { - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - if _, ok := b.blobFor(path); !ok { - return nil, storage.NewErrNotExist(path) - } - return storageutil.NewObjectInfo(path, path), nil -} - -func (b *bucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error { - prefix, err := storageutil.ValidatePrefix(prefix) - if err != nil { - return err - } - walkChecker := storageutil.NewWalkChecker() - for _, path := range b.manifest.Paths() { - if !normalpath.EqualsOrContainsPath(prefix, path, normalpath.Relative) { - continue - } - if err := walkChecker.Check(ctx); err != nil { - return err - } - if _, ok := b.blobFor(path); !ok { - // this could happen if the bucket was built with partial blobs - continue - } - if err := f(storageutil.NewObjectInfo(path, path)); err != nil { - return err - } - } - return nil -} - -// blobFor returns a blob for a given path. It returns the blob if found, or nil -// and ok=false if the path has no digest in the manifest, or if the blob for -// that digest is not present. -func (b *bucket) blobFor(path string) (_ manifest.Blob, ok bool) { - digest, ok := b.manifest.DigestFor(path) - if !ok { - return nil, false - } - blob, ok := b.blobSet.BlobFor(digest.String()) - if !ok { - return nil, false - } - return blob, true -} - -type readBucketOptions struct { - allManifestBlobs bool - noExtraBlobs bool -} - -func newReadBucketOptions() *readBucketOptions { - return &readBucketOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/read_object_closer.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/read_object_closer.go deleted file mode 100644 index 54d0109b21..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/read_object_closer.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemanifest - -import ( - "io" - - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -type readObjectCloser struct { - storageutil.ObjectInfo - io.ReadCloser -} - -func newReadObjectCloser(path string, readCloser io.ReadCloser) *readObjectCloser { - return &readObjectCloser{ - ObjectInfo: storageutil.NewObjectInfo(path, path), - ReadCloser: readCloser, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/storagemanifest.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/storagemanifest.go deleted file mode 100644 index 48e5d35d32..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/storagemanifest.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemanifest - -import ( - "github.com/bufbuild/buf/private/pkg/manifest" - "github.com/bufbuild/buf/private/pkg/storage" -) - -// NewReadBucket takes a Manifest and BlobSet and builds a ReadBucket -// that contains the files in the Manifest. -func NewReadBucket( - m *manifest.Manifest, - blobSet *manifest.BlobSet, - options ...ReadBucketOption, -) (storage.ReadBucket, error) { - return newBucket(m, blobSet, options...) -} - -// ReadBucketOption is an option for a passed when creating a new manifest bucket. -type ReadBucketOption func(*readBucketOptions) - -// ReadBucketWithAllManifestBlobs validates that all manifest digests -// have a corresponding blob in the blob set. If this option is not passed, then -// buckets with partial/incomplete blobs are allowed. -func ReadBucketWithAllManifestBlobs() ReadBucketOption { - return func(readBucketOptions *readBucketOptions) { - readBucketOptions.allManifestBlobs = true - } -} - -// ReadBucketWithNoExtraBlobs validates that the passed blob set has no -// additional blobs beyond the ones in the manifest. -func ReadBucketWithNoExtraBlobs() ReadBucketOption { - return func(readBucketOptions *readBucketOptions) { - readBucketOptions.noExtraBlobs = true - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/usage.gen.go deleted file mode 100644 index 3fc2a2901b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemanifest/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storagemanifest - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/bucket.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/bucket.go deleted file mode 100644 index 8afeb0db5d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/bucket.go +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemem - -import ( - "context" - "fmt" - "sort" - "sync" - - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem/internal" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -type bucket struct { - pathToImmutableObject map[string]*internal.ImmutableObject - lock sync.RWMutex -} - -func newBucket(pathToImmutableObject map[string]*internal.ImmutableObject) *bucket { - if pathToImmutableObject == nil { - pathToImmutableObject = make(map[string]*internal.ImmutableObject) - } - return &bucket{ - pathToImmutableObject: pathToImmutableObject, - } -} - -func (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) { - immutableObject, err := b.readLockAndGetImmutableObject(ctx, path) - if err != nil { - return nil, err - } - return newReadObjectCloser(immutableObject), nil -} - -func (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) { - return b.readLockAndGetImmutableObject(ctx, path) -} - -func (b *bucket) Walk(ctx context.Context, prefix string, f func(storage.ObjectInfo) error) error { - prefix, err := storageutil.ValidatePrefix(prefix) - if err != nil { - return err - } - walkChecker := storageutil.NewWalkChecker() - b.lock.RLock() - defer b.lock.RUnlock() - // To ensure same iteration order. - // We could create this in-place during puts with an insertion sort if this - // gets to be time prohibitive. - paths := make([]string, 0, len(b.pathToImmutableObject)) - for path := range b.pathToImmutableObject { - paths = append(paths, path) - } - sort.Strings(paths) - for _, path := range paths { - immutableObject, ok := b.pathToImmutableObject[path] - if !ok { - // this is a system error - return fmt.Errorf("path %q not in pathToObject", path) - } - if err := walkChecker.Check(ctx); err != nil { - return err - } - if !normalpath.EqualsOrContainsPath(prefix, path, normalpath.Relative) { - continue - } - if err := f(immutableObject); err != nil { - return err - } - } - return nil -} - -func (b *bucket) Put(ctx context.Context, path string, _ ...storage.PutOption) (storage.WriteObjectCloser, error) { - // No need to lock as we do no modifications until close - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - // storagemem writes are already atomic - don't need special handling for PutWithAtomic. - return newWriteObjectCloser(b, path), nil -} - -func (b *bucket) Delete(ctx context.Context, path string) error { - path, err := storageutil.ValidatePath(path) - if err != nil { - return err - } - b.lock.Lock() - defer b.lock.Unlock() - if _, ok := b.pathToImmutableObject[path]; !ok { - return storage.NewErrNotExist(path) - } - // Note that if there is an existing reader for an object of the same path, - // that reader will continue to read the original file, but we accept this - // as no less consistent than os mechanics. - delete(b.pathToImmutableObject, path) - return nil -} - -func (b *bucket) DeleteAll(ctx context.Context, prefix string) error { - prefix, err := storageutil.ValidatePrefix(prefix) - if err != nil { - return err - } - b.lock.Lock() - defer b.lock.Unlock() - for path := range b.pathToImmutableObject { - if normalpath.EqualsOrContainsPath(prefix, path, normalpath.Relative) { - // Note that if there is an existing reader for an object of the same path, - // that reader will continue to read the original file, but we accept this - // as no less consistent than os mechanics. - delete(b.pathToImmutableObject, path) - } - } - return nil -} - -func (*bucket) SetExternalPathSupported() bool { - return true -} - -func (b *bucket) ToReadBucket() (storage.ReadBucket, error) { - return b, nil -} - -func (b *bucket) readLockAndGetImmutableObject(ctx context.Context, path string) (*internal.ImmutableObject, error) { - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - b.lock.RLock() - defer b.lock.RUnlock() - immutableObject, ok := b.pathToImmutableObject[path] - if !ok { - // it would be nice if this was external path for every bucket - // the issue is here: we don't know the external path for memory buckets - // because we store external paths individually, so if we do not have - // an object, we do not have an external path - return nil, storage.NewErrNotExist(path) - } - return immutableObject, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/immutable_object.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/immutable_object.go deleted file mode 100644 index e2815e48a6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/immutable_object.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package internal splits out ImmutableObject into a separate package from storagemem -// to make it impossible to modify ImmutableObject via direct field access. -package internal - -import ( - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -// ImmutableObject is an object that contains a path, external path, -// and data that is never modified. -// -// We make this a struct so there is no weirdness with returning a nil interface. -type ImmutableObject struct { - storageutil.ObjectInfo - - data []byte -} - -// NewImmutableObject returns a new ImmutableObject. -// -// path is expected to always be non-empty. -// If externalPath is empty, normalpath.Unnormalize(path) is used. -func NewImmutableObject( - path string, - externalPath string, - data []byte, -) *ImmutableObject { - if externalPath == "" { - externalPath = normalpath.Unnormalize(path) - } - return &ImmutableObject{ - ObjectInfo: storageutil.NewObjectInfo(path, externalPath), - data: data, - } -} - -// Data returns the data. -// -// DO NOT MODIFY. -func (i *ImmutableObject) Data() []byte { - return i.data -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/usage.gen.go deleted file mode 100644 index b94f5ee09d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/internal/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package internal - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/read_object_closer.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/read_object_closer.go deleted file mode 100644 index ae7b497e13..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/read_object_closer.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemem - -import ( - "bytes" - - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem/internal" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -type readObjectCloser struct { - storageutil.ObjectInfo - - reader *bytes.Reader - closed bool -} - -func newReadObjectCloser(immutableObject *internal.ImmutableObject) *readObjectCloser { - return &readObjectCloser{ - ObjectInfo: immutableObject.ObjectInfo, - reader: bytes.NewReader(immutableObject.Data()), - } -} - -func (r *readObjectCloser) Read(p []byte) (int, error) { - if r.closed { - return 0, storage.ErrClosed - } - return r.reader.Read(p) -} - -func (r *readObjectCloser) Close() error { - if r.closed { - return storage.ErrClosed - } - r.closed = true - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/storagemem.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/storagemem.go deleted file mode 100644 index c937fa50a1..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/storagemem.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storagemem implements an in-memory storage Bucket. -package storagemem - -import ( - "errors" - - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem/internal" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" -) - -var errDuplicatePath = errors.New("duplicate path") - -// NewReadWriteBucket returns a new in-memory ReadWriteBucket. -func NewReadWriteBucket() storage.ReadWriteBucket { - return newBucket(nil) -} - -// NewReadBucket returns a new ReadBucket. -func NewReadBucket(pathToData map[string][]byte) (storage.ReadBucket, error) { - pathToImmutableObject := make(map[string]*internal.ImmutableObject, len(pathToData)) - for path, data := range pathToData { - path, err := storageutil.ValidatePath(path) - if err != nil { - return nil, err - } - // This could happen if two paths normalize to the same path. - if _, ok := pathToImmutableObject[path]; ok { - return nil, errDuplicatePath - } - pathToImmutableObject[path] = internal.NewImmutableObject(path, "", data) - } - return newBucket(pathToImmutableObject), nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/usage.gen.go deleted file mode 100644 index 8a2a264d2d..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storagemem - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/write_object_closer.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/write_object_closer.go deleted file mode 100644 index df48b3276b..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storagemem/write_object_closer.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storagemem - -import ( - "bytes" - "fmt" - - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storagemem/internal" -) - -type writeObjectCloser struct { - bucket *bucket - path string - externalPath string - buffer *bytes.Buffer - closed bool -} - -func newWriteObjectCloser( - bucket *bucket, - path string, -) *writeObjectCloser { - return &writeObjectCloser{ - bucket: bucket, - path: path, - buffer: bytes.NewBuffer(nil), - } -} - -func (w *writeObjectCloser) Write(p []byte) (int, error) { - if w.closed { - return 0, storage.ErrClosed - } - return w.buffer.Write(p) -} - -func (w *writeObjectCloser) SetExternalPath(externalPath string) error { - if w.externalPath != "" { - return fmt.Errorf("external path already set: %q", w.externalPath) - } - w.externalPath = externalPath - return nil -} - -func (w *writeObjectCloser) Close() error { - if w.closed { - return storage.ErrClosed - } - w.closed = true - // overwrites anything existing - // this is the same behavior as storageos - w.bucket.lock.Lock() - defer w.bucket.lock.Unlock() - // Note that if there is an existing reader for an object of the same path, - // that reader will continue to read the original file, but we accept this - // as no less consistent than os mechanics. - w.bucket.pathToImmutableObject[w.path] = internal.NewImmutableObject( - w.path, - w.externalPath, - w.buffer.Bytes(), - ) - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/bucket.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/bucket.go deleted file mode 100644 index c07d7446e8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/bucket.go +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storageos - -import ( - "context" - "errors" - "os" - "path/filepath" - "strings" - - "github.com/bufbuild/buf/private/pkg/filepathextended" - "github.com/bufbuild/buf/private/pkg/normalpath" - "github.com/bufbuild/buf/private/pkg/storage" - "github.com/bufbuild/buf/private/pkg/storage/storageutil" - "go.uber.org/atomic" - "go.uber.org/multierr" -) - -// errNotDir is the error returned if a path is not a directory. -var errNotDir = errors.New("not a directory") - -type bucket struct { - rootPath string - absoluteRootPath string - symlinks bool -} - -func newBucket(rootPath string, symlinks bool) (*bucket, error) { - rootPath = normalpath.Unnormalize(rootPath) - if err := validateDirPathExists(rootPath, symlinks); err != nil { - return nil, err - } - absoluteRootPath, err := filepath.Abs(rootPath) - if err != nil { - return nil, err - } - // do not validate - allow anything with OS buckets including - // absolute paths and jumping context - rootPath = normalpath.Normalize(rootPath) - return &bucket{ - rootPath: rootPath, - absoluteRootPath: absoluteRootPath, - symlinks: symlinks, - }, nil -} - -func (b *bucket) Get(ctx context.Context, path string) (storage.ReadObjectCloser, error) { - externalPath, err := b.getExternalPath(path) - if err != nil { - return nil, err - } - if err := b.validateExternalPath(path, externalPath); err != nil { - return nil, err - } - resolvedPath := externalPath - if b.symlinks { - resolvedPath, err = filepath.EvalSymlinks(externalPath) - if err != nil { - return nil, err - } - } - file, err := os.Open(resolvedPath) - if err != nil { - return nil, err - } - // we could use fileInfo.Name() however we might as well use the externalPath - return newReadObjectCloser( - path, - externalPath, - file, - ), nil -} - -func (b *bucket) Stat(ctx context.Context, path string) (storage.ObjectInfo, error) { - externalPath, err := b.getExternalPath(path) - if err != nil { - return nil, err - } - if err := b.validateExternalPath(path, externalPath); err != nil { - return nil, err - } - // we could use fileInfo.Name() however we might as well use the externalPath - return storageutil.NewObjectInfo( - path, - externalPath, - ), nil -} - -func (b *bucket) Walk( - ctx context.Context, - prefix string, - f func(storage.ObjectInfo) error, -) error { - externalPrefix, err := b.getExternalPrefix(prefix) - if err != nil { - return err - } - walkChecker := storageutil.NewWalkChecker() - var walkOptions []filepathextended.WalkOption - if b.symlinks { - walkOptions = append(walkOptions, filepathextended.WalkWithSymlinks()) - } - if err := filepathextended.Walk( - externalPrefix, - func(externalPath string, fileInfo os.FileInfo, err error) error { - if err != nil { - // this can happen if a symlink is broken - // in this case, we just want to continue the walk - if b.symlinks && os.IsNotExist(err) { - return nil - } - return err - } - if err := walkChecker.Check(ctx); err != nil { - return err - } - absoluteExternalPath, err := filepath.Abs(externalPath) - if err != nil { - return err - } - if fileInfo.Mode().IsRegular() { - path, err := normalpath.Rel(b.absoluteRootPath, absoluteExternalPath) - if err != nil { - return err - } - // just in case - path, err = normalpath.NormalizeAndValidate(path) - if err != nil { - return err - } - if err := f( - storageutil.NewObjectInfo( - path, - externalPath, - ), - ); err != nil { - return err - } - } - return nil - }, - walkOptions..., - ); err != nil { - if os.IsNotExist(err) { - // Should be a no-op according to the spec. - return nil - } - return err - } - return nil -} - -func (b *bucket) Put(ctx context.Context, path string, opts ...storage.PutOption) (storage.WriteObjectCloser, error) { - var putOptions storage.PutOptions - for _, opt := range opts { - opt(&putOptions) - } - externalPath, err := b.getExternalPath(path) - if err != nil { - return nil, err - } - externalDir := filepath.Dir(externalPath) - var fileInfo os.FileInfo - if b.symlinks { - fileInfo, err = os.Stat(externalDir) - } else { - fileInfo, err = os.Lstat(externalDir) - } - if err != nil { - if os.IsNotExist(err) { - if err := os.MkdirAll(externalDir, 0755); err != nil { - return nil, err - } - } else { - return nil, err - } - } else if !fileInfo.IsDir() { - return nil, newErrNotDir(externalDir) - } - var file *os.File - var finalPath string - if putOptions.Atomic { - file, err = os.CreateTemp(externalDir, ".tmp"+filepath.Base(externalPath)+"*") - finalPath = externalPath - } else { - file, err = os.Create(externalPath) - } - if err != nil { - return nil, err - } - return newWriteObjectCloser( - file, - finalPath, - ), nil -} - -func (b *bucket) Delete(ctx context.Context, path string) error { - externalPath, err := b.getExternalPath(path) - if err != nil { - return err - } - // Note: this deletes the file at the path, but it may - // leave orphan parent directories around that were - // created by the MkdirAll in Put. - if err := os.Remove(externalPath); err != nil { - if os.IsNotExist(err) { - return storage.NewErrNotExist(path) - } - return err - } - return nil -} - -func (b *bucket) DeleteAll(ctx context.Context, prefix string) error { - externalPrefix, err := b.getExternalPrefix(prefix) - if err != nil { - return err - } - if err := os.RemoveAll(externalPrefix); err != nil { - // this is a no-nop per the documentation - if os.IsNotExist(err) { - return nil - } - return err - } - return nil -} - -func (*bucket) SetExternalPathSupported() bool { - return false -} - -func (b *bucket) getExternalPath(path string) (string, error) { - path, err := storageutil.ValidatePath(path) - if err != nil { - return "", err - } - realClean, err := filepathextended.RealClean(normalpath.Join(b.rootPath, path)) - if err != nil { - return "", err - } - return normalpath.Unnormalize(realClean), nil -} - -func (b *bucket) validateExternalPath(path string, externalPath string) error { - // this is potentially introducing two calls to a file - // instead of one, ie we do both Stat and Open as opposed to just Open - // we do this to make sure we are only reading regular files - var fileInfo os.FileInfo - var err error - if b.symlinks { - fileInfo, err = os.Stat(externalPath) - } else { - fileInfo, err = os.Lstat(externalPath) - } - if err != nil { - if os.IsNotExist(err) { - return storage.NewErrNotExist(path) - } - // The path might have a regular file in one of its - // elements (e.g. 'foo/bar/baz.proto' where 'bar' is a - // regular file). - // - // In this case, the standard library will return an - // os.PathError, but there isn't an exported error value - // to check against (i.e. os.Is*). But we can still discover - // whether or not this is the case by checking if any of the - // path components represents a regular file (e.g. 'foo/bar'). - // - // It's important that we detect these cases so that - // multi buckets don't unnecessarily fail when one of - // its delegates actually defines the path. - elements := strings.Split(normalpath.Normalize(externalPath), "/") - if len(elements) == 1 { - // The path is a single element, so there aren't - // any other files to check. - return err - } - for i := len(elements) - 1; i >= 0; i-- { - parentFileInfo, err := os.Stat(filepath.Join(elements[:i]...)) - if err != nil { - continue - } - if parentFileInfo.Mode().IsRegular() { - // This error primarily serves as a sentinel error, - // but we preserve the original path argument so that - // the error still makes sense to the user. - return storage.NewErrNotExist(path) - } - } - return err - } - if !fileInfo.Mode().IsRegular() { - // making this a user error as any access means this was generally requested - // by the user, since we only call the function for Walk on regular files - return storage.NewErrNotExist(path) - } - return nil -} - -func (b *bucket) getExternalPrefix(prefix string) (string, error) { - prefix, err := storageutil.ValidatePrefix(prefix) - if err != nil { - return "", err - } - realClean, err := filepathextended.RealClean(normalpath.Join(b.rootPath, prefix)) - if err != nil { - return "", err - } - return normalpath.Unnormalize(realClean), nil -} - -type readObjectCloser struct { - // we use ObjectInfo for Path, ExternalPath, etc to make sure this is static - // we put ObjectInfos in maps in other places so we do not want this to change - // this could be a problem if the underlying file is concurrently moved or resized however - storageutil.ObjectInfo - - file *os.File -} - -func newReadObjectCloser( - path string, - externalPath string, - file *os.File, -) *readObjectCloser { - return &readObjectCloser{ - ObjectInfo: storageutil.NewObjectInfo( - path, - externalPath, - ), - file: file, - } -} - -func (r *readObjectCloser) Read(p []byte) (int, error) { - n, err := r.file.Read(p) - return n, toStorageError(err) -} - -func (r *readObjectCloser) Close() error { - return toStorageError(r.file.Close()) -} - -type writeObjectCloser struct { - file *os.File - // path is set during atomic writes to the final path where the file should be created. - // If set, the file is a temp file that needs to be renamed to this path if Write/Close are successful. - path string - // writeErr contains the first non-nil error caught by a call to Write. - // This is returned in Close for atomic writes to prevent writing an incomplete file. - writeErr atomic.Error -} - -func newWriteObjectCloser( - file *os.File, - path string, -) *writeObjectCloser { - return &writeObjectCloser{ - file: file, - path: path, - } -} - -func (w *writeObjectCloser) Write(p []byte) (int, error) { - n, err := w.file.Write(p) - if err != nil { - w.writeErr.CompareAndSwap(nil, err) - } - return n, toStorageError(err) -} - -func (w *writeObjectCloser) SetExternalPath(string) error { - return storage.ErrSetExternalPathUnsupported -} - -func (w *writeObjectCloser) Close() error { - err := toStorageError(w.file.Close()) - // This is an atomic write operation - we need to rename to the final path - if w.path != "" { - atomicWriteErr := multierr.Append(w.writeErr.Load(), err) - // Failed during Write or Close - remove temporary file without rename - if atomicWriteErr != nil { - return toStorageError(multierr.Append(atomicWriteErr, os.Remove(w.file.Name()))) - } - if err := os.Rename(w.file.Name(), w.path); err != nil { - return toStorageError(multierr.Append(err, os.Remove(w.file.Name()))) - } - } - return err -} - -// newErrNotDir returns a new Error for a path not being a directory. -func newErrNotDir(path string) *normalpath.Error { - return normalpath.NewError(path, errNotDir) -} - -func toStorageError(err error) error { - if errors.Is(err, os.ErrClosed) { - return storage.ErrClosed - } - return err -} - -// validateDirPathExists returns a non-nil error if the given dirPath -// is not a valid directory path. -func validateDirPathExists(dirPath string, symlinks bool) error { - var fileInfo os.FileInfo - var err error - if symlinks { - fileInfo, err = os.Stat(dirPath) - } else { - fileInfo, err = os.Lstat(dirPath) - } - if err != nil { - if os.IsNotExist(err) { - return storage.NewErrNotExist(dirPath) - } - return err - } - if !fileInfo.IsDir() { - return newErrNotDir(dirPath) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/provider.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/provider.go deleted file mode 100644 index a62d66fa0f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/provider.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storageos - -import "github.com/bufbuild/buf/private/pkg/storage" - -type provider struct { - symlinks bool -} - -func newProvider(options ...ProviderOption) *provider { - provider := &provider{} - for _, option := range options { - option(provider) - } - return provider -} - -func (p *provider) NewReadWriteBucket(rootPath string, options ...ReadWriteBucketOption) (storage.ReadWriteBucket, error) { - readWriteBucketOptions := newReadWriteBucketOptions() - for _, option := range options { - option(readWriteBucketOptions) - } - // need both options for symlinks to be enabled - return newBucket( - rootPath, - p.symlinks && readWriteBucketOptions.symlinksIfSupported, - ) -} - -// doing this as a separate struct so that it's clear this is resolved -// as a combination of the provider options and read write bucket options -// so there's no potential issues in newBucket -type readWriteBucketOptions struct { - symlinksIfSupported bool -} - -func newReadWriteBucketOptions() *readWriteBucketOptions { - return &readWriteBucketOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/storageos.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/storageos.go deleted file mode 100644 index 4798ad9cff..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/storageos.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storageos implements an os-backed storage Bucket. -package storageos - -import ( - "github.com/bufbuild/buf/private/pkg/storage" -) - -// Provider provides new ReadWriteBuckets. -type Provider interface { - // NewReadWriteBucket returns a new OS bucket. - // - // Only regular files are handled, that is Exists should only be called - // for regular files, Get and Put only work for regular files, Put - // automatically calls Mkdir, and Walk only calls f on regular files. - // - // The root path is expected to be normalized, however the root path - // can be absolute or jump context. - // - // Not thread-safe. - NewReadWriteBucket(rootPath string, options ...ReadWriteBucketOption) (storage.ReadWriteBucket, error) -} - -// NewProvider returns a new Provider. -func NewProvider(options ...ProviderOption) Provider { - return newProvider(options...) -} - -// ProviderOption is an option for a new Provider. -type ProviderOption func(*provider) - -// ReadWriteBucketOption is an option for a new ReadWriteBucket. -type ReadWriteBucketOption func(*readWriteBucketOptions) - -// ReadWriteBucketWithSymlinksIfSupported returns a ReadWriteBucketOption that results -// in symlink support being enabled for this bucket. If the Provider did not have symlink -// support, this is a no-op. -func ReadWriteBucketWithSymlinksIfSupported() ReadWriteBucketOption { - return func(readWriteBucketOptions *readWriteBucketOptions) { - readWriteBucketOptions.symlinksIfSupported = true - } -} - -// ProviderWithSymlinks returns a ProviderOption that results in symlink support. -// -// Note that ReadWriteBucketWithSymlinksIfSupported still needs to be passed for a given -// ReadWriteBucket to have symlinks followed. -func ProviderWithSymlinks() ProviderOption { - return func(provider *provider) { - provider.symlinks = true - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/usage.gen.go deleted file mode 100644 index 4575c6e01e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageos/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storageos - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/storageutil.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/storageutil.go deleted file mode 100644 index db0fb2e10f..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/storageutil.go +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package storageutil provides helpers for storage implementations. -package storageutil - -import ( - "context" - "errors" - "fmt" - - "github.com/bufbuild/buf/private/pkg/normalpath" -) - -// ObjectInfo is an embeddable ObjectInfo. -// -// This is intentially static and should not be modifiable. -// If constructing an object, do not use an ObjectInfo to build it. -type ObjectInfo struct { - path string - externalPath string -} - -// NewObjectInfo returns a new ObjectInfo. -func NewObjectInfo( - path string, - externalPath string, -) ObjectInfo { - return ObjectInfo{ - path: path, - externalPath: externalPath, - } -} - -// Path implements ObjectInfo. -func (o ObjectInfo) Path() string { - return o.path -} - -// ExternalPath implements ObjectInfo. -func (o ObjectInfo) ExternalPath() string { - return o.externalPath -} - -// ValidatePath validates a path. -func ValidatePath(path string) (string, error) { - path, err := normalpath.NormalizeAndValidate(path) - if err != nil { - return "", err - } - if path == "." { - return "", errors.New("cannot use root") - } - return path, nil -} - -// ValidatePrefix validates a prefix. -func ValidatePrefix(prefix string) (string, error) { - return normalpath.NormalizeAndValidate(prefix) -} - -// WalkChecker does validation for every step of a walk. -type WalkChecker interface { - Check(ctx context.Context) error -} - -// NewWalkChecker returns a new WalkChecker. -func NewWalkChecker() WalkChecker { - return &walkChecker{} -} - -type walkChecker struct { - count int -} - -func (w *walkChecker) Check(ctx context.Context) error { - w.count++ - select { - case <-ctx.Done(): - err := ctx.Err() - if err == context.DeadlineExceeded { - return fmt.Errorf("timed out after %d files: %v", w.count, err) - } - return err - default: - return nil - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/usage.gen.go deleted file mode 100644 index 9c535d81d7..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/storageutil/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storageutil - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/usage.gen.go deleted file mode 100644 index 105657cdbc..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package storage - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/storage/util.go b/vendor/github.com/bufbuild/buf/private/pkg/storage/util.go deleted file mode 100644 index 1a55b93bc2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/storage/util.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package storage - -import ( - "context" - "errors" - "io" - "sort" - - "go.uber.org/multierr" -) - -// errIsNotEmpty is used to break out of the Walk function early in IsEmpty. -// -// If errors.Is(err, errIsNotEmpty), the Walk function found a file. -var errIsNotEmpty = errors.New("__is_not_empty__") - -// ReadPath is analogous to os.ReadFile. -// -// Returns an error that fufills IsNotExist if the path does not exist. -func ReadPath(ctx context.Context, readBucket ReadBucket, path string) (_ []byte, retErr error) { - readObject, err := readBucket.Get(ctx, path) - if err != nil { - return nil, err - } - defer func() { - if err := readObject.Close(); err != nil && retErr == nil { - retErr = err - } - }() - return io.ReadAll(readObject) -} - -// PutPath puts the data at the path. -func PutPath(ctx context.Context, writeBucket WriteBucket, path string, data []byte) (retErr error) { - writeObject, err := writeBucket.Put(ctx, path) - if err != nil { - return err - } - defer func() { - retErr = multierr.Append(retErr, writeObject.Close()) - }() - _, err = writeObject.Write(data) - return err -} - -// WalkReadObjects walks the bucket and calls get on each, closing the resulting ReadObjectCloser -// when done. -func WalkReadObjects( - ctx context.Context, - readBucket ReadBucket, - prefix string, - f func(ReadObject) error, -) error { - return readBucket.Walk( - ctx, - prefix, - func(objectInfo ObjectInfo) error { - readObjectCloser, err := readBucket.Get(ctx, objectInfo.Path()) - if err != nil { - return err - } - return multierr.Append(f(readObjectCloser), readObjectCloser.Close()) - }, - ) -} - -// AllPaths walks the bucket and gets all the paths. -func AllPaths(ctx context.Context, readBucket ReadBucket, prefix string) ([]string, error) { - var allPaths []string - if err := readBucket.Walk( - ctx, - prefix, - func(objectInfo ObjectInfo) error { - allPaths = append(allPaths, objectInfo.Path()) - return nil - }, - ); err != nil { - return nil, err - } - return allPaths, nil -} - -// Exists returns true if the path exists, false otherwise. -// -// Returns error on system error. -func Exists(ctx context.Context, readBucket ReadBucket, path string) (bool, error) { - _, err := readBucket.Stat(ctx, path) - if err != nil { - if IsNotExist(err) { - return false, nil - } - return false, err - } - return true, nil -} - -// IsEmpty returns true if the bucket is empty under the prefix. -// -// A prefix of "" or "." will check if the entire bucket is empty. -func IsEmpty(ctx context.Context, readBucket ReadBucket, prefix string) (bool, error) { - if err := readBucket.Walk( - ctx, - prefix, - func(ObjectInfo) error { - return errIsNotEmpty - }, - ); err != nil { - if errors.Is(err, errIsNotEmpty) { - return false, nil - } - return false, err - } - return true, nil -} - -// allObjectInfos walks the bucket and gets all the ObjectInfos. -func allObjectInfos(ctx context.Context, readBucket ReadBucket, prefix string) ([]ObjectInfo, error) { - var allObjectInfos []ObjectInfo - if err := readBucket.Walk( - ctx, - prefix, - func(objectInfo ObjectInfo) error { - allObjectInfos = append(allObjectInfos, objectInfo) - return nil - }, - ); err != nil { - return nil, err - } - return allObjectInfos, nil -} - -func pathToObjectInfo(objectInfos []ObjectInfo) map[string]ObjectInfo { - m := make(map[string]ObjectInfo, len(objectInfos)) - for _, objectInfo := range objectInfos { - m[objectInfo.Path()] = objectInfo - } - return m -} - -func sortObjectInfos(objectInfos []ObjectInfo) { - sort.Slice( - objectInfos, - func(i int, j int) bool { - return objectInfos[i].Path() < objectInfos[j].Path() - }, - ) -} - -type compositeReadObjectCloser struct { - ObjectInfo - io.ReadCloser -} - -type compositeReadWriteBucket struct { - ReadBucket - WriteBucket -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/stringutil/stringutil.go b/vendor/github.com/bufbuild/buf/private/pkg/stringutil/stringutil.go deleted file mode 100644 index 160cf10249..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/stringutil/stringutil.go +++ /dev/null @@ -1,332 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package stringutil implements string utilities. -package stringutil - -import ( - "sort" - "strings" - "unicode" -) - -// TrimLines splits the output into individual lines and trims the spaces from each line. -// -// This also trims the start and end spaces from the original output. -func TrimLines(output string) string { - return strings.TrimSpace(strings.Join(SplitTrimLines(output), "\n")) -} - -// SplitTrimLines splits the output into individual lines and trims the spaces from each line. -func SplitTrimLines(output string) []string { - // this should work for windows as well as \r will be trimmed - split := strings.Split(output, "\n") - lines := make([]string, len(split)) - for i, line := range split { - lines[i] = strings.TrimSpace(line) - } - return lines -} - -// SplitTrimLinesNoEmpty splits the output into individual lines and trims the spaces from each line. -// -// This removes any empty lines. -func SplitTrimLinesNoEmpty(output string) []string { - // this should work for windows as well as \r will be trimmed - split := strings.Split(output, "\n") - lines := make([]string, 0, len(split)) - for _, line := range split { - line = strings.TrimSpace(line) - if line != "" { - lines = append(lines, line) - } - } - return lines -} - -// MapToSortedSlice transforms m to a sorted slice. -func MapToSortedSlice(m map[string]struct{}) []string { - s := MapToSlice(m) - sort.Strings(s) - return s -} - -// MapToSlice transforms m to a slice. -func MapToSlice(m map[string]struct{}) []string { - s := make([]string, 0, len(m)) - for e := range m { - s = append(s, e) - } - return s -} - -// SliceToMap transforms s to a map. -func SliceToMap(s []string) map[string]struct{} { - m := make(map[string]struct{}, len(s)) - for _, e := range s { - m[e] = struct{}{} - } - return m -} - -// SliceToUniqueSortedSlice returns a sorted copy of s with no duplicates. -func SliceToUniqueSortedSlice(s []string) []string { - return MapToSortedSlice(SliceToMap(s)) -} - -// SliceToUniqueSortedSliceFilterEmptyStrings returns a sorted copy of s with no duplicates and no empty strings. -// -// Strings with only spaces are considered empty. -func SliceToUniqueSortedSliceFilterEmptyStrings(s []string) []string { - m := SliceToMap(s) - for key := range m { - if strings.TrimSpace(key) == "" { - delete(m, key) - } - } - return MapToSortedSlice(m) -} - -// SliceToChunks splits s into chunks of the given chunk size. -// -// If s is nil or empty, returns empty. -// If chunkSize is <=0, returns [][]string{s}. -func SliceToChunks(s []string, chunkSize int) [][]string { - var chunks [][]string - if len(s) == 0 { - return chunks - } - if chunkSize <= 0 { - return [][]string{s} - } - c := make([]string, len(s)) - copy(c, s) - // https://github.com/golang/go/wiki/SliceTricks#batching-with-minimal-allocation - for chunkSize < len(c) { - c, chunks = c[chunkSize:], append(chunks, c[0:chunkSize:chunkSize]) - } - return append(chunks, c) -} - -// SliceElementsEqual returns true if the two slices have equal elements. -// -// Nil and empty slices are treated as equals. -func SliceElementsEqual(one []string, two []string) bool { - if len(one) != len(two) { - return false - } - for i, elem := range one { - if two[i] != elem { - return false - } - } - return true -} - -// SliceElementsContained returns true if superset contains subset. -// -// Nil and empty slices are treated as equals. -func SliceElementsContained(superset []string, subset []string) bool { - m := SliceToMap(superset) - for _, elem := range subset { - if _, ok := m[elem]; !ok { - return false - } - } - return true -} - -// JoinSliceQuoted joins the slice with quotes. -func JoinSliceQuoted(s []string, sep string) string { - if len(s) == 0 { - return "" - } - return `"` + strings.Join(s, `"`+sep+`"`) + `"` -} - -// SliceToString prints the slice as [e1,e2]. -func SliceToString(s []string) string { - if len(s) == 0 { - return "" - } - return "[" + strings.Join(s, ",") + "]" -} - -// SliceToHumanString prints the slice as "e1, e2, and e3". -func SliceToHumanString(s []string) string { - switch len(s) { - case 0: - return "" - case 1: - return s[0] - case 2: - return s[0] + " and " + s[1] - default: - return strings.Join(s[:len(s)-1], ", ") + ", and " + s[len(s)-1] - } -} - -// SliceToHumanStringQuoted prints the slice as `"e1", "e2", and "e3"`. -func SliceToHumanStringQuoted(s []string) string { - switch len(s) { - case 0: - return "" - case 1: - return `"` + s[0] + `"` - case 2: - return `"` + s[0] + `" and "` + s[1] + `"` - default: - return `"` + strings.Join(s[:len(s)-1], `", "`) + `", and "` + s[len(s)-1] + `"` - } -} - -// SliceToHumanStringOr prints the slice as "e1, e2, or e3". -func SliceToHumanStringOr(s []string) string { - switch len(s) { - case 0: - return "" - case 1: - return s[0] - case 2: - return s[0] + " or " + s[1] - default: - return strings.Join(s[:len(s)-1], ", ") + ", or " + s[len(s)-1] - } -} - -// SliceToHumanStringOrQuoted prints the slice as `"e1", "e2", or "e3"`. -func SliceToHumanStringOrQuoted(s []string) string { - switch len(s) { - case 0: - return "" - case 1: - return `"` + s[0] + `"` - case 2: - return `"` + s[0] + `" or "` + s[1] + `"` - default: - return `"` + strings.Join(s[:len(s)-1], `", "`) + `", or "` + s[len(s)-1] + `"` - } -} - -// SnakeCaseOption is an option for snake_case conversions. -type SnakeCaseOption func(*snakeCaseOptions) - -// SnakeCaseWithNewWordOnDigits is a SnakeCaseOption that signifies -// to split on digits, ie foo_bar_1 instead of foo_bar1. -func SnakeCaseWithNewWordOnDigits() SnakeCaseOption { - return func(snakeCaseOptions *snakeCaseOptions) { - snakeCaseOptions.newWordOnDigits = true - } -} - -// ToLowerSnakeCase transforms s to lower_snake_case. -func ToLowerSnakeCase(s string, options ...SnakeCaseOption) string { - return strings.ToLower(toSnakeCase(s, options...)) -} - -// ToUpperSnakeCase transforms s to UPPER_SNAKE_CASE. -func ToUpperSnakeCase(s string, options ...SnakeCaseOption) string { - return strings.ToUpper(toSnakeCase(s, options...)) -} - -// ToPascalCase converts s to PascalCase. -// -// Splits on '-', '_', ' ', '\t', '\n', '\r'. -// Uppercase letters will stay uppercase, -func ToPascalCase(s string) string { - output := "" - var previous rune - for i, c := range strings.TrimSpace(s) { - if !isDelimiter(c) { - if i == 0 || isDelimiter(previous) || unicode.IsUpper(c) { - output += string(unicode.ToUpper(c)) - } else { - output += string(unicode.ToLower(c)) - } - } - previous = c - } - return output -} - -// IsAlphanumeric returns true for [0-9a-zA-Z]. -func IsAlphanumeric(r rune) bool { - return IsNumeric(r) || IsAlpha(r) -} - -// IsAlpha returns true for [a-zA-Z]. -func IsAlpha(r rune) bool { - return IsLowerAlpha(r) || IsUpperAlpha(r) -} - -// IsLowerAlpha returns true for [a-z]. -func IsLowerAlpha(r rune) bool { - return 'a' <= r && r <= 'z' -} - -// IsUpperAlpha returns true for [A-Z]. -func IsUpperAlpha(r rune) bool { - return 'A' <= r && r <= 'Z' -} - -// IsNumeric returns true for [0-9]. -func IsNumeric(r rune) bool { - return '0' <= r && r <= '9' -} - -// IsLowerAlphanumeric returns true for [0-9a-z]. -func IsLowerAlphanumeric(r rune) bool { - return IsNumeric(r) || IsLowerAlpha(r) -} - -func toSnakeCase(s string, options ...SnakeCaseOption) string { - snakeCaseOptions := &snakeCaseOptions{} - for _, option := range options { - option(snakeCaseOptions) - } - output := "" - s = strings.TrimFunc(s, isDelimiter) - for i, c := range s { - if isDelimiter(c) { - c = '_' - } - if i == 0 { - output += string(c) - } else if isSnakeCaseNewWord(c, snakeCaseOptions.newWordOnDigits) && - output[len(output)-1] != '_' && - ((i < len(s)-1 && !isSnakeCaseNewWord(rune(s[i+1]), true) && !isDelimiter(rune(s[i+1]))) || - (snakeCaseOptions.newWordOnDigits && unicode.IsDigit(c)) || - (unicode.IsLower(rune(s[i-1])))) { - output += "_" + string(c) - } else if !(isDelimiter(c) && output[len(output)-1] == '_') { - output += string(c) - } - } - return output -} - -func isSnakeCaseNewWord(r rune, newWordOnDigits bool) bool { - if newWordOnDigits { - return unicode.IsUpper(r) || unicode.IsDigit(r) - } - return unicode.IsUpper(r) -} - -func isDelimiter(r rune) bool { - return r == '.' || r == '-' || r == '_' || r == ' ' || r == '\t' || r == '\n' || r == '\r' -} - -type snakeCaseOptions struct { - newWordOnDigits bool -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/stringutil/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/stringutil/usage.gen.go deleted file mode 100644 index f0a2b79e0a..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/stringutil/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package stringutil - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/thread/thread.go b/vendor/github.com/bufbuild/buf/private/pkg/thread/thread.go deleted file mode 100644 index ed781dd987..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/thread/thread.go +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package thread - -import ( - "context" - "runtime" - "sync" - - "go.uber.org/multierr" -) - -var ( - globalParallelism = runtime.GOMAXPROCS(0) - globalLock sync.RWMutex -) - -// Parallelism returns the current parellism. -// -// This defaults to the number of CPUs. -func Parallelism() int { - globalLock.RLock() - parallelism := globalParallelism - globalLock.RUnlock() - return parallelism -} - -// SetParallelism sets the parallelism. -// -// If parallelism < 1, this sets the parallelism to 1. -func SetParallelism(parallelism int) { - if parallelism < 1 { - parallelism = 1 - } - globalLock.Lock() - globalParallelism = parallelism - globalLock.Unlock() -} - -// Parallelize runs the jobs in parallel. -// -// A max of Parallelism jobs will be run at once. -// Returns the combined error from the jobs. -func Parallelize(ctx context.Context, jobs []func(context.Context) error, options ...ParallelizeOption) error { - parallelizeOptions := newParallelizeOptions() - for _, option := range options { - option(parallelizeOptions) - } - switch len(jobs) { - case 0: - return nil - case 1: - return jobs[0](ctx) - } - multiplier := parallelizeOptions.multiplier - if multiplier < 1 { - multiplier = 1 - } - semaphoreC := make(chan struct{}, Parallelism()*multiplier) - var retErr error - var wg sync.WaitGroup - var lock sync.Mutex - var stop bool - for _, job := range jobs { - if stop { - break - } - // We always want context cancellation/deadline expiration to take - // precedence over the semaphore unblocking, but select statements choose - // among the unblocked non-default cases pseudorandomly. To correctly - // enforce precedence, use a similar pattern to the check-lock-check - // pattern common with sync.RWMutex: check the context twice, and only do - // the semaphore-protected work in the innermost default case. - select { - case <-ctx.Done(): - stop = true - retErr = multierr.Append(retErr, ctx.Err()) - case semaphoreC <- struct{}{}: - select { - case <-ctx.Done(): - stop = true - retErr = multierr.Append(retErr, ctx.Err()) - default: - job := job - wg.Add(1) - go func() { - if err := job(ctx); err != nil { - lock.Lock() - retErr = multierr.Append(retErr, err) - lock.Unlock() - if parallelizeOptions.cancel != nil { - parallelizeOptions.cancel() - } - } - // This will never block. - <-semaphoreC - wg.Done() - }() - } - } - } - wg.Wait() - return retErr -} - -// ParallelizeOption is an option to Parallelize. -type ParallelizeOption func(*parallelizeOptions) - -// ParallelizeWithMultiplier returns a new ParallelizeOption that will use a multiple -// of Parallelism() for the number of jobs that can be run at once. -// -// The default is to only do Parallelism() number of jobs. -// A multiplier of <1 has no meaning. -func ParallelizeWithMultiplier(multiplier int) ParallelizeOption { - return func(parallelizeOptions *parallelizeOptions) { - parallelizeOptions.multiplier = multiplier - } -} - -// ParallelizeWithCancel returns a new ParallelizeOption that will call the -// given context.CancelFunc if any job fails. -func ParallelizeWithCancel(cancel context.CancelFunc) ParallelizeOption { - return func(parallelizeOptions *parallelizeOptions) { - parallelizeOptions.cancel = cancel - } -} - -type parallelizeOptions struct { - multiplier int - cancel context.CancelFunc -} - -func newParallelizeOptions() *parallelizeOptions { - return ¶llelizeOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/thread/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/thread/usage.gen.go deleted file mode 100644 index ddae2160f3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/thread/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package thread - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/tmp/tmp.go b/vendor/github.com/bufbuild/buf/private/pkg/tmp/tmp.go deleted file mode 100644 index 5aad2f7eb6..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/tmp/tmp.go +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package tmp provides temporary files and directories. -// -// Usage of this package requires eng approval - ask before using. -package tmp - -import ( - "io" - "os" - "path/filepath" - - "github.com/bufbuild/buf/private/pkg/interrupt" - "github.com/bufbuild/buf/private/pkg/uuidutil" - "go.uber.org/multierr" -) - -// File is a temporary file -// -// It must be closed when done. -type File interface { - io.Closer - - AbsPath() string -} - -// NewFileWithData returns a new temporary file with the given data. -// -// It must be closed when done. -// This file will be deleted on interrupt signals. -// -// Usage of this function requires eng approval - ask before using. -func NewFileWithData(data []byte) (File, error) { - id, err := uuidutil.New() - if err != nil { - return nil, err - } - file, err := os.CreateTemp("", id.String()) - if err != nil { - return nil, err - } - path := file.Name() - // just in case - absPath, err := filepath.Abs(filepath.Clean(path)) - if err != nil { - return nil, err - } - signalC, closer := interrupt.NewSignalChannel() - go func() { - <-signalC - _ = os.Remove(absPath) - }() - _, err = file.Write(data) - err = multierr.Append(err, file.Close()) - if err != nil { - err = multierr.Append(err, os.Remove(absPath)) - closer() - return nil, err - } - return newFile(absPath, closer), nil -} - -// Dir is a temporary directory. -// -// It must be closed when done. -type Dir interface { - io.Closer - - AbsPath() string -} - -// NewDir returns a new temporary directory. -// -// It must be closed when done. -// This file will be deleted on interrupt signals. -// -// Usage of this function requires eng approval - ask before using. -func NewDir(options ...DirOption) (Dir, error) { - dirOptions := newDirOptions() - for _, option := range options { - option(dirOptions) - } - id, err := uuidutil.New() - if err != nil { - return nil, err - } - path, err := os.MkdirTemp(dirOptions.basePath, id.String()) - if err != nil { - return nil, err - } - // just in case - absPath, err := filepath.Abs(filepath.Clean(path)) - if err != nil { - return nil, err - } - signalC, closer := interrupt.NewSignalChannel() - go func() { - <-signalC - _ = os.RemoveAll(absPath) - }() - return newDir(absPath, closer), nil -} - -// DirOption is an option for NewDir. -type DirOption func(*dirOptions) - -// DirWithBasePath returns a new DirOption that sets the base path to create -// the temporary directory in. -// -// The default is to use os.TempDir(). -func DirWithBasePath(basePath string) DirOption { - return func(dirOptions *dirOptions) { - dirOptions.basePath = basePath - } -} - -type file struct { - absPath string - closer func() -} - -func newFile(absPath string, closer func()) *file { - return &file{ - absPath: absPath, - closer: closer, - } -} - -func (f *file) AbsPath() string { - return f.absPath -} - -func (f *file) Close() error { - err := os.Remove(f.absPath) - f.closer() - return err -} - -type dir struct { - absPath string - closer func() -} - -func newDir(absPath string, closer func()) *dir { - return &dir{ - absPath: absPath, - closer: closer, - } -} - -func (d *dir) AbsPath() string { - return d.absPath -} - -func (d *dir) Close() error { - err := os.RemoveAll(d.absPath) - d.closer() - return err -} - -type dirOptions struct { - basePath string -} - -func newDirOptions() *dirOptions { - return &dirOptions{} -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/tmp/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/tmp/usage.gen.go deleted file mode 100644 index 885e1b16b2..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/tmp/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package tmp - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/client.go b/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/client.go deleted file mode 100644 index f575031ae5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/client.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpclient - -import ( - "crypto/tls" - "net/http" -) - -func newClient(clientTLSConfig *tls.Config) *http.Client { - return &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: clientTLSConfig, - Proxy: http.ProxyFromEnvironment, - }, - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/httpclient.go b/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/httpclient.go deleted file mode 100644 index 69d461e3d3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/httpclient.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpclient - -import ( - "crypto/tls" - "net/http" -) - -// NewClient returns a new Client. -func NewClient(clientTLSConfig *tls.Config) *http.Client { - return newClient(clientTLSConfig) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/usage.gen.go deleted file mode 100644 index 0f760f61a4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpclient/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package httpclient - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/httpserver.go b/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/httpserver.go deleted file mode 100644 index ab5a3094b3..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/httpserver.go +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package httpserver - -import ( - "context" - "crypto/tls" - "net" - "net/http" - "time" - - "github.com/go-chi/chi/v5" - "go.uber.org/zap" - "golang.org/x/net/http2" - "golang.org/x/net/http2/h2c" - "golang.org/x/sync/errgroup" -) - -const ( - // DefaultShutdownTimeout is the default shutdown timeout. - DefaultShutdownTimeout = 10 * time.Second - // DefaultReadHeaderTimeout is the default read header timeout. - DefaultReadHeaderTimeout = 30 * time.Second - // DefaultIdleTimeout is the amount of time an HTTP/2 connection can be idle. - DefaultIdleTimeout = 3 * time.Minute -) - -type runner struct { - shutdownTimeout time.Duration - readHeaderTimeout time.Duration - tlsConfig *tls.Config - walkFunc chi.WalkFunc - disableH2C bool -} - -// RunOption is an option for a new Run. -type RunOption func(*runner) - -// RunWithShutdownTimeout returns a new RunOption that uses the given shutdown timeout. -// -// The default is to use DefaultShutdownTimeout. -// If shutdownTimeout is 0, no graceful shutdown will be performed. -func RunWithShutdownTimeout(shutdownTimeout time.Duration) RunOption { - return func(runner *runner) { - runner.shutdownTimeout = shutdownTimeout - } -} - -// RunWithReadHeaderTimeout returns a new RunOption that uses the given read header timeout. -// -// The default is to use DefaultReadHeaderTimeout. -// If readHeaderTimeout is 0, no read header timeout will be used. -func RunWithReadHeaderTimeout(readHeaderTimeout time.Duration) RunOption { - return func(runner *runner) { - runner.readHeaderTimeout = readHeaderTimeout - } -} - -// RunWithTLSConfig returns a new RunOption that uses the given tls.Config. -// -// The default is to use no TLS. -func RunWithTLSConfig(tlsConfig *tls.Config) RunOption { - return func(runner *runner) { - runner.tlsConfig = tlsConfig - } -} - -// RunWithWalkFunc returns a new RunOption that runs chi.Walk to walk the -// handler after all middlewares and routes have been mounted, but before the -// server is started. -// The walkFunc will only be called if the handler passed to Run is a -// chi.Routes. -func RunWithWalkFunc(walkFunc chi.WalkFunc) RunOption { - return func(runner *runner) { - runner.walkFunc = walkFunc - } -} - -// RunWithoutH2C disables use of H2C (used when RunWithTLSConfig is not called). -func RunWithoutH2C() RunOption { - return func(runner *runner) { - runner.disableH2C = true - } -} - -// Run will start a HTTP server listening on the provided listener and -// serving the provided handler. This call is blocking and the run -// is cancelled when the input context is cancelled, the listener is -// closed upon return. -// -// The Run function can be configured further by passing a variety of options. -func Run( - ctx context.Context, - logger *zap.Logger, - listener net.Listener, - handler http.Handler, - options ...RunOption, -) error { - s := &runner{ - shutdownTimeout: DefaultShutdownTimeout, - readHeaderTimeout: DefaultReadHeaderTimeout, - } - for _, option := range options { - option(s) - } - stdLogger, err := zap.NewStdLogAt(logger.Named("httpserver"), zap.ErrorLevel) - if err != nil { - return err - } - httpServer := &http.Server{ - Handler: handler, - ReadHeaderTimeout: s.readHeaderTimeout, - ErrorLog: stdLogger, - TLSConfig: s.tlsConfig, - } - if s.tlsConfig == nil && !s.disableH2C { - httpServer.Handler = h2c.NewHandler(handler, &http2.Server{ - IdleTimeout: DefaultIdleTimeout, - }) - } - if s.walkFunc != nil { - routes, ok := handler.(chi.Routes) - if ok { - if err := chi.Walk(routes, s.walkFunc); err != nil { - return err - } - } - } - - eg, ctx := errgroup.WithContext(ctx) - eg.Go(func() error { - return httpServe(httpServer, listener) - }) - eg.Go(func() error { - <-ctx.Done() - start := time.Now() - logger.Info("shutdown_starting", zap.Duration("shutdown_timeout", s.shutdownTimeout)) - defer logger.Info("shutdown_finished", zap.Duration("duration", time.Since(start))) - if s.shutdownTimeout != 0 { - ctx, cancel := context.WithTimeout(context.Background(), s.shutdownTimeout) - defer cancel() - return httpServer.Shutdown(ctx) - } - return httpServer.Close() - }) - - logger.Info( - "starting", - zap.String("address", listener.Addr().String()), - zap.Duration("shutdown_timeout", s.shutdownTimeout), - zap.Bool("tls", s.tlsConfig != nil), - ) - if err := eg.Wait(); err != http.ErrServerClosed { - return err - } - return nil -} - -func httpServe(httpServer *http.Server, listener net.Listener) error { - if httpServer.TLSConfig != nil { - return httpServer.ServeTLS(listener, "", "") - } - return httpServer.Serve(listener) -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/usage.gen.go deleted file mode 100644 index b7666a4e61..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/transport/http/httpserver/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package httpserver - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/usage.gen.go deleted file mode 100644 index 8366a6426e..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package uuidutil - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/uuidutil.go b/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/uuidutil.go deleted file mode 100644 index 80d742de90..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/uuidutil/uuidutil.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package uuidutil - -import ( - "fmt" - - "github.com/gofrs/uuid/v5" -) - -// New returns a new random UUIDv4. -func New() (uuid.UUID, error) { - id, err := uuid.NewV4() - if err != nil { - return uuid.Nil, err - } - return id, nil -} - -// ToDashless returns the uuid without dashes. -func ToDashless(id uuid.UUID) (string, error) { - s := id.String() - if s[8] != '-' { - return "", fmt.Errorf("expected - at char 9: %q", s) - } - if s[13] != '-' { - return "", fmt.Errorf("expected - at char 14: %q", s) - } - if s[18] != '-' { - return "", fmt.Errorf("expected - at char 19: %q", s) - } - if s[23] != '-' { - return "", fmt.Errorf("expected - at char 24: %q", s) - } - return s[0:8] + s[9:13] + s[14:18] + s[19:23] + s[24:], nil -} - -// FromString returns the uuid from the string. -// -// As opposed to uuid.FromString, this only accepts uuids with dashes. -// Always use this instead of uuid.FromString. -func FromString(s string) (uuid.UUID, error) { - if len(s) != 36 { - return uuid.Nil, fmt.Errorf("expected uuid to be of length 36 but was %d: %s", len(s), s) - } - return uuid.FromString(s) -} - -// FromDashless returns the dashless uuid with dashes. -func FromDashless(dashless string) (uuid.UUID, error) { - if len(dashless) != 32 { - return uuid.Nil, fmt.Errorf("expected dashless uuid to be of length 32 but was %d: %s", len(dashless), dashless) - } - // FromString accepts both dashless and regular, we do this because we need to add our own FromString that does not accept dashless - return FromString(dashless[0:8] + "-" + dashless[8:12] + "-" + dashless[12:16] + "-" + dashless[16:20] + "-" + dashless[20:]) -} - -// Validate determines if the given UUID string is valid. -func Validate(s string) error { - _, err := FromString(s) - return err -} - -// ValidateDashless validates the dashless uuid is valid. -func ValidateDashless(dashless string) error { - _, err := FromDashless(dashless) - return err -} - -// FromStringSlice returns a slice of uuids from the string slice. -// -// This only accepts uuids with dashes. -func FromStringSlice(s []string) ([]uuid.UUID, error) { - var parsedUUIDS []uuid.UUID - for _, stringID := range s { - parsed, err := FromString(stringID) - if err != nil { - return nil, err - } - parsedUUIDS = append(parsedUUIDS, parsed) - } - return parsedUUIDS, nil -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/verbose/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/verbose/usage.gen.go deleted file mode 100644 index ab203b1527..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/verbose/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package verbose - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/verbose/verbose.go b/vendor/github.com/bufbuild/buf/private/pkg/verbose/verbose.go deleted file mode 100644 index ec16847118..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/verbose/verbose.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package verbose - -import ( - "fmt" - "io" - "strings" -) - -var ( - // NopPrinter is a no-op printer. - // - // This generally aligns with the --verbose flag not being set. - NopPrinter = nopPrinter{} -) - -// Printer prints verbose messages. -type Printer interface { - // Printf prints a new verbose message. - // - // Leading and trailing newlines are not respected. - // - // Callers should not rely on the print calls being reliable, i.e. errors to - // a backing Writer will be ignored. - Printf(format string, args ...interface{}) -} - -// NewWritePrinter returns a new Printer using the given Writer. -// -// The trimmed prefix is printed with a : before each line. -// -// This generally aligns with the --verbose flag being set and writer being stderr. -func NewWritePrinter(writer io.Writer, prefix string) Printer { - return newWritePrinter(writer, prefix) -} - -type nopPrinter struct{} - -func (nopPrinter) Printf(string, ...interface{}) {} - -type writePrinter struct { - writer io.Writer - prefix string -} - -func newWritePrinter(writer io.Writer, prefix string) *writePrinter { - prefix = strings.TrimSpace(prefix) - if prefix != "" { - prefix = prefix + ": " - } - return &writePrinter{ - writer: writer, - prefix: prefix, - } -} - -func (w *writePrinter) Printf(format string, args ...interface{}) { - if value := strings.TrimSpace(fmt.Sprintf(format, args...)); value != "" { - // Errors are ignored per the interface spec. - _, _ = w.writer.Write([]byte(w.prefix + value + "\n")) - } -} diff --git a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/usage.gen.go b/vendor/github.com/bufbuild/buf/private/pkg/zaputil/usage.gen.go deleted file mode 100644 index e4d5f4caa8..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/usage.gen.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Generated. DO NOT EDIT. - -package zaputil - -import _ "github.com/bufbuild/buf/private/usage" diff --git a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/vars.go b/vendor/github.com/bufbuild/buf/private/pkg/zaputil/vars.go deleted file mode 100644 index a160c0faf5..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/vars.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package zaputil - -import ( - "go.uber.org/zap/zapcore" -) - -var ( - textEncoderConfig = zapcore.EncoderConfig{ - MessageKey: "M", - LevelKey: "L", - //TimeKey: "T", - NameKey: "N", - CallerKey: "C", - StacktraceKey: "S", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.CapitalLevelEncoder, - //EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - EncodeName: zapcore.FullNameEncoder, - } - - colortextEncoderConfig = zapcore.EncoderConfig{ - MessageKey: "M", - LevelKey: "L", - //TimeKey: "T", - NameKey: "N", - CallerKey: "C", - StacktraceKey: "S", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.CapitalColorLevelEncoder, - //EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.StringDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - EncodeName: zapcore.FullNameEncoder, - } - - jsonEncoderConfig = zapcore.EncoderConfig{ - MessageKey: "message", - LevelKey: "level", - TimeKey: "time", - NameKey: "logger", - CallerKey: "caller", - StacktraceKey: "stacktrace", - LineEnding: zapcore.DefaultLineEnding, - EncodeLevel: zapcore.LowercaseLevelEncoder, - EncodeTime: zapcore.ISO8601TimeEncoder, - EncodeDuration: zapcore.SecondsDurationEncoder, - EncodeCaller: zapcore.ShortCallerEncoder, - EncodeName: zapcore.FullNameEncoder, - } -) diff --git a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/zaputil.go b/vendor/github.com/bufbuild/buf/private/pkg/zaputil/zaputil.go deleted file mode 100644 index f1a5eccad4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/pkg/zaputil/zaputil.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package zaputil implements utilities for zap. -package zaputil - -import ( - "io" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -// NewLogger returns a new Logger. -func NewLogger( - writer io.Writer, - level zapcore.Level, - encoder zapcore.Encoder, -) *zap.Logger { - return zap.New( - zapcore.NewCore( - encoder, - zapcore.Lock(zapcore.AddSync(writer)), - zap.NewAtomicLevelAt(level), - ), - ) -} - -// NewTextEncoder returns a new text Encoder. -func NewTextEncoder() zapcore.Encoder { - return zapcore.NewConsoleEncoder(textEncoderConfig) -} - -// NewColortextEncoder returns a new colortext Encoder. -func NewColortextEncoder() zapcore.Encoder { - return zapcore.NewConsoleEncoder(colortextEncoderConfig) -} - -// NewJSONEncoder returns a new JSON encoder. -func NewJSONEncoder() zapcore.Encoder { - return zapcore.NewJSONEncoder(jsonEncoderConfig) -} diff --git a/vendor/github.com/bufbuild/buf/private/usage/usage.go b/vendor/github.com/bufbuild/buf/private/usage/usage.go deleted file mode 100644 index 9005219450..0000000000 --- a/vendor/github.com/bufbuild/buf/private/usage/usage.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package usage - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "runtime/debug" - "strings" -) - -const debugBinPrefix = "__debug_bin" - -func init() { - if err := check(); err != nil { - panic(err.Error()) - } -} - -func check() error { - buildInfo, ok := debug.ReadBuildInfo() - if !ok || buildInfo.Main.Path == "" { - // Detect and allow *.test and __debug_bin* files. - if !strings.HasSuffix(os.Args[0], testSuffix) && !strings.HasPrefix(filepath.Base(os.Args[0]), debugBinPrefix) { - return errors.New("github.com/bufbuild/buf/private code must only be imported by github.com/bufbuild projects") - } - return nil - } - if !strings.HasPrefix(buildInfo.Main.Path, "github.com/bufbuild") { - return fmt.Errorf("github.com/bufbuild/buf/private code must only be imported by github.com/bufbuild projects but was used in %s", buildInfo.Main.Path) - } - return nil -} diff --git a/vendor/github.com/bufbuild/buf/private/usage/usage_unix.go b/vendor/github.com/bufbuild/buf/private/usage/usage_unix.go deleted file mode 100644 index f6603b2ab4..0000000000 --- a/vendor/github.com/bufbuild/buf/private/usage/usage_unix.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris - -package usage - -const testSuffix = ".test" diff --git a/vendor/github.com/bufbuild/buf/private/usage/usage_windows.go b/vendor/github.com/bufbuild/buf/private/usage/usage_windows.go deleted file mode 100644 index 134109dd41..0000000000 --- a/vendor/github.com/bufbuild/buf/private/usage/usage_windows.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2020-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build windows -// +build windows - -package usage - -const testSuffix = ".test.exe" diff --git a/vendor/github.com/bufbuild/connect-go/.gitignore b/vendor/github.com/bufbuild/connect-go/.gitignore deleted file mode 100644 index b300197a28..0000000000 --- a/vendor/github.com/bufbuild/connect-go/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Autogenerated by makego. DO NOT EDIT. -/.tmp/ -*.pprof -*.svg -cover.out diff --git a/vendor/github.com/bufbuild/connect-go/.golangci.yml b/vendor/github.com/bufbuild/connect-go/.golangci.yml deleted file mode 100644 index d974ed79a0..0000000000 --- a/vendor/github.com/bufbuild/connect-go/.golangci.yml +++ /dev/null @@ -1,124 +0,0 @@ -run: - skip-dirs-use-default: false -linters-settings: - errcheck: - check-type-assertions: true - exhaustruct: - include: - # No zero values for param structs. - - 'github\.com/bufbuild/connect-go\..*[pP]arams' - # No zero values for ClientStream, ServerStream, and friends. - - 'github\.com/bufbuild/connect-go\.ClientStream.*' - - 'github\.com/bufbuild/connect-go\.ServerStream.*' - - 'github\.com/bufbuild/connect-go\.BidiStream.*' - forbidigo: - forbid: - - '^fmt\.Print' - - '^log\.' - - '^print$' - - '^println$' - - '^panic$' - godox: - # TODO, OPT, etc. comments are fine to commit. Use FIXME comments for - # temporary hacks, and use godox to prevent committing them. - keywords: [FIXME] - importas: - no-unaliased: true - alias: - - pkg: github.com/bufbuild/connect-go - alias: connect - - pkg: github.com/bufbuild/connect-go/internal/gen/connect/ping/v1 - alias: pingv1 - varnamelen: - ignore-decls: - - T any - - i int - - wg sync.WaitGroup -linters: - enable-all: true - disable: - - cyclop # covered by gocyclo - - deadcode # abandoned - - exhaustivestruct # replaced by exhaustruct - - funlen # rely on code review to limit function length - - gocognit # dubious "cognitive overhead" quantification - - gofumpt # prefer standard gofmt - - goimports # rely on gci instead - - golint # deprecated by Go team - - gomnd # some unnamed constants are okay - - ifshort # deprecated by author - - interfacer # deprecated by author - - ireturn # "accept interfaces, return structs" isn't ironclad - - lll # don't want hard limits for line length - - maintidx # covered by gocyclo - - maligned # readability trumps efficient struct packing - - nlreturn # generous whitespace violates house style - - nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065 - - scopelint # deprecated by author - - structcheck # abandoned - - testpackage # internal tests are fine - - varcheck # abandoned - - wrapcheck # don't _always_ need to wrap errors - - wsl # generous whitespace violates house style -issues: - exclude: - # Don't ban use of fmt.Errorf to create new errors, but the remaining - # checks from err113 are useful. - - "err113: do not define dynamic errors.*" - - exclude-rules: - # If future reflect.Kinds are nil-able, we'll find out when a test fails. - - linters: [exhaustive] - path: internal/assert/assert.go - # We need our duplex HTTP call to have access to the context. - - linters: [containedctx] - path: duplex_http_call.go - # We need to init a global in-mem HTTP server for testable examples. - - linters: [gochecknoinits, gochecknoglobals] - path: example_init_test.go - # We need to initialize a global map from a slice. - - linters: [gochecknoinits, gochecknoglobals] - path: protocol_grpc.go - # We purposefully do an ineffectual assignment for an example. - - linters: [ineffassign] - path: client_example_test.go - # The generated file is effectively a global receiver. - - linters: [varnamelen] - path: cmd/protoc-gen-connect-go - text: "parameter name 'g' is too short" - # Thorough error logging and timeout config make this example unreadably long. - - linters: [errcheck, gosec] - path: error_writer_example_test.go - # It should be crystal clear that Connect uses plain *http.Clients. - - linters: [revive, stylecheck] - path: client_example_test.go - # Don't complain about timeout management or lack of output assertions in examples. - - linters: [gosec, testableexamples] - path: handler_example_test.go - # No output assertions needed for these examples. - - linters: [testableexamples] - path: error_writer_example_test.go - - linters: [testableexamples] - path: error_not_modified_example_test.go - - linters: [testableexamples] - path: error_example_test.go - # In examples, it's okay to use http.ListenAndServe. - - linters: [gosec] - path: error_not_modified_example_test.go - # There are many instances where we want to keep unused parameters - # as a matter of style or convention, for example when a context.Context - # is the first parameter, we choose to just globally ignore this. - - linters: [revive] - text: "^unused-parameter: " - # We want to return explicit nils in protocol_grpc.go - - linters: [revive] - text: "^if-return: " - path: protocol_grpc.go - # We want to return explicit nils in protocol_connect.go - - linters: [revive] - text: "^if-return: " - path: protocol_connect.go - # We want to return explicit nils in error_writer.go - - linters: [revive] - text: "^if-return: " - path: error_writer.go diff --git a/vendor/github.com/bufbuild/connect-go/LICENSE b/vendor/github.com/bufbuild/connect-go/LICENSE deleted file mode 100644 index a037229e20..0000000000 --- a/vendor/github.com/bufbuild/connect-go/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2021-2022 Buf Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/bufbuild/connect-go/Makefile b/vendor/github.com/bufbuild/connect-go/Makefile deleted file mode 100644 index e26694a60d..0000000000 --- a/vendor/github.com/bufbuild/connect-go/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# See https://tech.davis-hansson.com/p/make/ -SHELL := bash -.DELETE_ON_ERROR: -.SHELLFLAGS := -eu -o pipefail -c -.DEFAULT_GOAL := all -MAKEFLAGS += --warn-undefined-variables -MAKEFLAGS += --no-builtin-rules -MAKEFLAGS += --no-print-directory -BIN := .tmp/bin -COPYRIGHT_YEARS := 2021-2023 -LICENSE_IGNORE := --ignore /testdata/ -# Set to use a different compiler. For example, `GO=go1.18rc1 make test`. -GO ?= go - -.PHONY: help -help: ## Describe useful make targets - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' - -.PHONY: all -all: ## Build, test, and lint (default) - $(MAKE) test - $(MAKE) lint - -.PHONY: clean -clean: ## Delete intermediate build artifacts - @# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs - git clean -Xdf - -.PHONY: test -test: build ## Run unit tests - $(GO) test -vet=off -race -cover ./... - -.PHONY: build -build: generate ## Build all packages - $(GO) build ./... - -.PHONY: install -install: ## Install all binaries - $(GO) install ./... - -.PHONY: lint -lint: $(BIN)/golangci-lint $(BIN)/buf ## Lint Go and protobuf - test -z "$$($(BIN)/buf format -d . | tee /dev/stderr)" - $(GO) vet ./... - $(BIN)/golangci-lint run - $(BIN)/buf lint - $(BIN)/buf format -d --exit-code - -.PHONY: lintfix -lintfix: $(BIN)/golangci-lint $(BIN)/buf ## Automatically fix some lint errors - $(BIN)/golangci-lint run --fix - $(BIN)/buf format -w - -.PHONY: generate -generate: $(BIN)/buf $(BIN)/protoc-gen-go $(BIN)/protoc-gen-connect-go $(BIN)/license-header ## Regenerate code and licenses - rm -rf internal/gen - PATH="$(abspath $(BIN))" $(BIN)/buf generate - $(BIN)/license-header \ - --license-type apache \ - --copyright-holder "Buf Technologies, Inc." \ - --year-range "$(COPYRIGHT_YEARS)" $(LICENSE_IGNORE) - -.PHONY: upgrade -upgrade: ## Upgrade dependencies - go get -u -t ./... && go mod tidy -v - -.PHONY: checkgenerate -checkgenerate: - @# Used in CI to verify that `make generate` doesn't produce a diff. - test -z "$$(git status --porcelain | tee /dev/stderr)" - -.PHONY: $(BIN)/protoc-gen-connect-go -$(BIN)/protoc-gen-connect-go: - @mkdir -p $(@D) - $(GO) build -o $(@) ./cmd/protoc-gen-connect-go - -$(BIN)/buf: Makefile - @mkdir -p $(@D) - GOBIN="$(abspath $(@D))" $(GO) install github.com/bufbuild/buf/cmd/buf@v1.18.0 - -$(BIN)/license-header: Makefile - @mkdir -p $(@D) - GOBIN="$(abspath $(@D))" $(GO) install \ - github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v1.18.0 - -$(BIN)/golangci-lint: Makefile - @mkdir -p $(@D) - GOBIN="$(abspath $(@D))" $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 - -$(BIN)/protoc-gen-go: Makefile go.mod - @mkdir -p $(@D) - @# The version of protoc-gen-go is determined by the version in go.mod - GOBIN="$(abspath $(@D))" $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go - diff --git a/vendor/github.com/bufbuild/connect-go/README.md b/vendor/github.com/bufbuild/connect-go/README.md deleted file mode 100644 index c551084afa..0000000000 --- a/vendor/github.com/bufbuild/connect-go/README.md +++ /dev/null @@ -1,185 +0,0 @@ -Connect -======= - -[![Build](https://github.com/bufbuild/connect-go/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bufbuild/connect-go/actions/workflows/ci.yaml) -[![Report Card](https://goreportcard.com/badge/github.com/bufbuild/connect-go)](https://goreportcard.com/report/github.com/bufbuild/connect-go) -[![GoDoc](https://pkg.go.dev/badge/github.com/bufbuild/connect-go.svg)](https://pkg.go.dev/github.com/bufbuild/connect-go) - -Connect is a slim library for building browser and gRPC-compatible HTTP APIs. -You write a short [Protocol Buffer][protobuf] schema and implement your -application logic, and Connect generates code to handle marshaling, routing, -compression, and content type negotiation. It also generates an idiomatic, -type-safe client. Handlers and clients support three protocols: gRPC, gRPC-Web, -and Connect's own protocol. - -The [Connect protocol][protocol] is a simple protocol that works over HTTP/1.1 -or HTTP/2. It takes the best portions of gRPC and gRPC-Web, including -streaming, and packages them into a protocol that works equally well in -browsers, monoliths, and microservices. Calling a Connect API is as easy as -using `curl`. Try it with our live demo: - -``` -curl \ - --header "Content-Type: application/json" \ - --data '{"sentence": "I feel happy."}' \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Say -``` - -Handlers and clients also support the gRPC and gRPC-Web protocols, including -streaming, headers, trailers, and error details. gRPC-compatible [server -reflection][] and [health checks][] are available as standalone packages. -Instead of cURL, we could call our API with `buf curl`: - -``` -go install github.com/bufbuild/buf/cmd/buf@latest -buf curl --protocol grpc \ - --data '{"sentence": "I feel happy."}' \ - https://demo.connect.build/buf.connect.demo.eliza.v1.ElizaService/Say -``` - -Under the hood, Connect is just [Protocol Buffers][protobuf] and the standard -library: no custom HTTP implementation, no new name resolution or load -balancing APIs, and no surprises. Everything you already know about `net/http` -still applies, and any package that works with an `http.Server`, `http.Client`, -or `http.Handler` also works with Connect. - -For more on Connect, see the [announcement blog post][blog], the documentation -on [connect.build][docs] (especially the [Getting Started] guide for Go), the -[demo service][demo], or the [protocol specification][protocol]. - -## A small example - -Curious what all this looks like in practice? From a [Protobuf -schema](internal/proto/connect/ping/v1/ping.proto), we generate [a small RPC -package](internal/gen/connect/ping/v1/pingv1connect/ping.connect.go). Using that -package, we can build a server: - -```go -package main - -import ( - "context" - "log" - "net/http" - - "github.com/bufbuild/connect-go" - pingv1 "github.com/bufbuild/connect-go/internal/gen/connect/ping/v1" - "github.com/bufbuild/connect-go/internal/gen/connect/ping/v1/pingv1connect" - "golang.org/x/net/http2" - "golang.org/x/net/http2/h2c" -) - -type PingServer struct { - pingv1connect.UnimplementedPingServiceHandler // returns errors from all methods -} - -func (ps *PingServer) Ping( - ctx context.Context, - req *connect.Request[pingv1.PingRequest], -) (*connect.Response[pingv1.PingResponse], error) { - // connect.Request and connect.Response give you direct access to headers and - // trailers. No context-based nonsense! - log.Println(req.Header().Get("Some-Header")) - res := connect.NewResponse(&pingv1.PingResponse{ - // req.Msg is a strongly-typed *pingv1.PingRequest, so we can access its - // fields without type assertions. - Number: req.Msg.Number, - }) - res.Header().Set("Some-Other-Header", "hello!") - return res, nil -} - -func main() { - mux := http.NewServeMux() - // The generated constructors return a path and a plain net/http - // handler. - mux.Handle(pingv1connect.NewPingServiceHandler(&PingServer{})) - err := http.ListenAndServe( - "localhost:8080", - // For gRPC clients, it's convenient to support HTTP/2 without TLS. You can - // avoid x/net/http2 by using http.ListenAndServeTLS. - h2c.NewHandler(mux, &http2.Server{}), - ) - log.Fatalf("listen failed: %v", err) -} -``` - -With that server running, you can make requests with any gRPC or Connect -client. To write a client using `connect-go`, - -```go -package main - -import ( - "context" - "log" - "net/http" - - "github.com/bufbuild/connect-go" - pingv1 "github.com/bufbuild/connect-go/internal/gen/connect/ping/v1" - "github.com/bufbuild/connect-go/internal/gen/connect/ping/v1/pingv1connect" -) - -func main() { - client := pingv1connect.NewPingServiceClient( - http.DefaultClient, - "http://localhost:8080/", - ) - req := connect.NewRequest(&pingv1.PingRequest{ - Number: 42, - }) - req.Header().Set("Some-Header", "hello from connect") - res, err := client.Ping(context.Background(), req) - if err != nil { - log.Fatalln(err) - } - log.Println(res.Msg) - log.Println(res.Header().Get("Some-Other-Header")) -} -``` - -Of course, `http.ListenAndServe` and `http.DefaultClient` aren't fit for -production use! See Connect's [deployment docs][docs-deployment] for a guide to -configuring timeouts, connection pools, observability, and h2c. - -## Ecosystem - -* [connect-grpchealth-go]: gRPC-compatible health checks -* [connect-grpcreflect-go]: gRPC-compatible server reflection -* [connect-demo]: service powering demo.connect.build, including bidi streaming -* [connect-web]: TypeScript clients for web browsers -* [Buf Studio]: web UI for ad-hoc RPCs -* [connect-crosstest]: gRPC and gRPC-Web interoperability tests - -## Status: Stable - -This module is stable. It supports: - -* The [two most recent major releases][go-support-policy] of Go. -* [APIv2] of Protocol Buffers in Go (`google.golang.org/protobuf`). - -Within those parameters, `connect-go` follows semantic versioning. We will -_not_ make breaking changes in the 1.x series of releases. - -## Legal - -Offered under the [Apache 2 license][license]. - -[APIv2]: https://blog.golang.org/protobuf-apiv2 -[Buf Studio]: https://studio.buf.build/ -[Getting Started]: https://connect.build/docs/go/getting-started -[blog]: https://buf.build/blog/connect-a-better-grpc -[connect-crosstest]: https://github.com/bufbuild/connect-crosstest -[connect-demo]: https://github.com/bufbuild/connect-demo -[connect-grpchealth-go]: https://github.com/bufbuild/connect-grpchealth-go -[connect-grpcreflect-go]: https://github.com/bufbuild/connect-grpcreflect-go -[connect-web]: https://www.npmjs.com/package/@bufbuild/connect-web -[demo]: https://github.com/bufbuild/connect-demo -[docs-deployment]: https://connect.build/docs/go/deployment -[docs]: https://connect.build -[go-support-policy]: https://golang.org/doc/devel/release#policy -[health checks]: https://github.com/bufbuild/connect-grpchealth-go -[license]: https://github.com/bufbuild/connect-go/blob/main/LICENSE -[protobuf]: https://developers.google.com/protocol-buffers -[protocol]: https://connect.build/docs/protocol -[server reflection]: https://github.com/bufbuild/connect-grpcreflect-go diff --git a/vendor/github.com/bufbuild/connect-go/buf.gen.yaml b/vendor/github.com/bufbuild/connect-go/buf.gen.yaml deleted file mode 100644 index 757746fa9f..0000000000 --- a/vendor/github.com/bufbuild/connect-go/buf.gen.yaml +++ /dev/null @@ -1,12 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: github.com/bufbuild/connect-go/internal/gen -plugins: - - name: go - out: internal/gen - opt: paths=source_relative - - name: connect-go - out: internal/gen - opt: paths=source_relative diff --git a/vendor/github.com/bufbuild/connect-go/buf.work.yaml b/vendor/github.com/bufbuild/connect-go/buf.work.yaml deleted file mode 100644 index 30f1e1ff0c..0000000000 --- a/vendor/github.com/bufbuild/connect-go/buf.work.yaml +++ /dev/null @@ -1,3 +0,0 @@ -version: v1 -directories: - - internal/proto diff --git a/vendor/github.com/bufbuild/connect-go/buffer_pool.go b/vendor/github.com/bufbuild/connect-go/buffer_pool.go deleted file mode 100644 index 262bc7a472..0000000000 --- a/vendor/github.com/bufbuild/connect-go/buffer_pool.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bytes" - "sync" -) - -const ( - initialBufferSize = 512 - maxRecycleBufferSize = 8 * 1024 * 1024 // if >8MiB, don't hold onto a buffer -) - -type bufferPool struct { - sync.Pool -} - -func newBufferPool() *bufferPool { - return &bufferPool{ - Pool: sync.Pool{ - New: func() any { - return bytes.NewBuffer(make([]byte, 0, initialBufferSize)) - }, - }, - } -} - -func (b *bufferPool) Get() *bytes.Buffer { - if buf, ok := b.Pool.Get().(*bytes.Buffer); ok { - return buf - } - return bytes.NewBuffer(make([]byte, 0, initialBufferSize)) -} - -func (b *bufferPool) Put(buffer *bytes.Buffer) { - if buffer.Cap() > maxRecycleBufferSize { - return - } - buffer.Reset() - b.Pool.Put(buffer) -} diff --git a/vendor/github.com/bufbuild/connect-go/client.go b/vendor/github.com/bufbuild/connect-go/client.go deleted file mode 100644 index c1179e44ab..0000000000 --- a/vendor/github.com/bufbuild/connect-go/client.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "strings" -) - -// Client is a reusable, concurrency-safe client for a single procedure. -// Depending on the procedure's type, use the CallUnary, CallClientStream, -// CallServerStream, or CallBidiStream method. -// -// By default, clients use the Connect protocol with the binary Protobuf Codec, -// ask for gzipped responses, and send uncompressed requests. To use the gRPC -// or gRPC-Web protocols, use the [WithGRPC] or [WithGRPCWeb] options. -type Client[Req, Res any] struct { - config *clientConfig - callUnary func(context.Context, *Request[Req]) (*Response[Res], error) - protocolClient protocolClient - err error -} - -// NewClient constructs a new Client. -func NewClient[Req, Res any](httpClient HTTPClient, url string, options ...ClientOption) *Client[Req, Res] { - client := &Client[Req, Res]{} - config, err := newClientConfig(url, options) - if err != nil { - client.err = err - return client - } - client.config = config - protocolClient, protocolErr := client.config.Protocol.NewClient( - &protocolClientParams{ - CompressionName: config.RequestCompressionName, - CompressionPools: newReadOnlyCompressionPools( - config.CompressionPools, - config.CompressionNames, - ), - Codec: config.Codec, - Protobuf: config.protobuf(), - CompressMinBytes: config.CompressMinBytes, - HTTPClient: httpClient, - URL: config.URL, - BufferPool: config.BufferPool, - ReadMaxBytes: config.ReadMaxBytes, - SendMaxBytes: config.SendMaxBytes, - EnableGet: config.EnableGet, - GetURLMaxBytes: config.GetURLMaxBytes, - GetUseFallback: config.GetUseFallback, - }, - ) - if protocolErr != nil { - client.err = protocolErr - return client - } - client.protocolClient = protocolClient - // Rather than applying unary interceptors along the hot path, we can do it - // once at client creation. - unarySpec := config.newSpec(StreamTypeUnary) - unaryFunc := UnaryFunc(func(ctx context.Context, request AnyRequest) (AnyResponse, error) { - conn := client.protocolClient.NewConn(ctx, unarySpec, request.Header()) - conn.onRequestSend(func(r *http.Request) { - request.setRequestMethod(r.Method) - }) - // Send always returns an io.EOF unless the error is from the client-side. - // We want the user to continue to call Receive in those cases to get the - // full error from the server-side. - if err := conn.Send(request.Any()); err != nil && !errors.Is(err, io.EOF) { - _ = conn.CloseRequest() - _ = conn.CloseResponse() - return nil, err - } - if err := conn.CloseRequest(); err != nil { - _ = conn.CloseResponse() - return nil, err - } - response, err := receiveUnaryResponse[Res](conn) - if err != nil { - _ = conn.CloseResponse() - return nil, err - } - return response, conn.CloseResponse() - }) - if interceptor := config.Interceptor; interceptor != nil { - unaryFunc = interceptor.WrapUnary(unaryFunc) - } - client.callUnary = func(ctx context.Context, request *Request[Req]) (*Response[Res], error) { - // To make the specification, peer, and RPC headers visible to the full - // interceptor chain (as though they were supplied by the caller), we'll - // add them here. - request.spec = unarySpec - request.peer = client.protocolClient.Peer() - protocolClient.WriteRequestHeader(StreamTypeUnary, request.Header()) - response, err := unaryFunc(ctx, request) - if err != nil { - return nil, err - } - typed, ok := response.(*Response[Res]) - if !ok { - return nil, errorf(CodeInternal, "unexpected client response type %T", response) - } - return typed, nil - } - return client -} - -// CallUnary calls a request-response procedure. -func (c *Client[Req, Res]) CallUnary(ctx context.Context, request *Request[Req]) (*Response[Res], error) { - if c.err != nil { - return nil, c.err - } - return c.callUnary(ctx, request) -} - -// CallClientStream calls a client streaming procedure. -func (c *Client[Req, Res]) CallClientStream(ctx context.Context) *ClientStreamForClient[Req, Res] { - if c.err != nil { - return &ClientStreamForClient[Req, Res]{err: c.err} - } - return &ClientStreamForClient[Req, Res]{conn: c.newConn(ctx, StreamTypeClient, nil)} -} - -// CallServerStream calls a server streaming procedure. -func (c *Client[Req, Res]) CallServerStream(ctx context.Context, request *Request[Req]) (*ServerStreamForClient[Res], error) { - if c.err != nil { - return nil, c.err - } - conn := c.newConn(ctx, StreamTypeServer, func(r *http.Request) { - request.method = r.Method - }) - request.spec = conn.Spec() - request.peer = conn.Peer() - mergeHeaders(conn.RequestHeader(), request.header) - // Send always returns an io.EOF unless the error is from the client-side. - // We want the user to continue to call Receive in those cases to get the - // full error from the server-side. - if err := conn.Send(request.Msg); err != nil && !errors.Is(err, io.EOF) { - _ = conn.CloseRequest() - _ = conn.CloseResponse() - return nil, err - } - if err := conn.CloseRequest(); err != nil { - return nil, err - } - return &ServerStreamForClient[Res]{conn: conn}, nil -} - -// CallBidiStream calls a bidirectional streaming procedure. -func (c *Client[Req, Res]) CallBidiStream(ctx context.Context) *BidiStreamForClient[Req, Res] { - if c.err != nil { - return &BidiStreamForClient[Req, Res]{err: c.err} - } - return &BidiStreamForClient[Req, Res]{conn: c.newConn(ctx, StreamTypeBidi, nil)} -} - -func (c *Client[Req, Res]) newConn(ctx context.Context, streamType StreamType, onRequestSend func(r *http.Request)) StreamingClientConn { - newConn := func(ctx context.Context, spec Spec) StreamingClientConn { - header := make(http.Header, 8) // arbitrary power of two, prevent immediate resizing - c.protocolClient.WriteRequestHeader(streamType, header) - conn := c.protocolClient.NewConn(ctx, spec, header) - conn.onRequestSend(onRequestSend) - return conn - } - if interceptor := c.config.Interceptor; interceptor != nil { - newConn = interceptor.WrapStreamingClient(newConn) - } - return newConn(ctx, c.config.newSpec(streamType)) -} - -type clientConfig struct { - URL *url.URL - Protocol protocol - Procedure string - CompressMinBytes int - Interceptor Interceptor - CompressionPools map[string]*compressionPool - CompressionNames []string - Codec Codec - RequestCompressionName string - BufferPool *bufferPool - ReadMaxBytes int - SendMaxBytes int - EnableGet bool - GetURLMaxBytes int - GetUseFallback bool - IdempotencyLevel IdempotencyLevel -} - -func newClientConfig(rawURL string, options []ClientOption) (*clientConfig, *Error) { - url, err := parseRequestURL(rawURL) - if err != nil { - return nil, err - } - protoPath := extractProtoPath(url.Path) - config := clientConfig{ - URL: url, - Protocol: &protocolConnect{}, - Procedure: protoPath, - CompressionPools: make(map[string]*compressionPool), - BufferPool: newBufferPool(), - } - withProtoBinaryCodec().applyToClient(&config) - withGzip().applyToClient(&config) - for _, opt := range options { - opt.applyToClient(&config) - } - if err := config.validate(); err != nil { - return nil, err - } - return &config, nil -} - -func (c *clientConfig) validate() *Error { - if c.Codec == nil || c.Codec.Name() == "" { - return errorf(CodeUnknown, "no codec configured") - } - if c.RequestCompressionName != "" && c.RequestCompressionName != compressionIdentity { - if _, ok := c.CompressionPools[c.RequestCompressionName]; !ok { - return errorf(CodeUnknown, "unknown compression %q", c.RequestCompressionName) - } - } - return nil -} - -func (c *clientConfig) protobuf() Codec { - if c.Codec.Name() == codecNameProto { - return c.Codec - } - return &protoBinaryCodec{} -} - -func (c *clientConfig) newSpec(t StreamType) Spec { - return Spec{ - StreamType: t, - Procedure: c.Procedure, - IsClient: true, - IdempotencyLevel: c.IdempotencyLevel, - } -} - -func parseRequestURL(rawURL string) (*url.URL, *Error) { - url, err := url.ParseRequestURI(rawURL) - if err == nil { - return url, nil - } - if !strings.Contains(rawURL, "://") { - // URL doesn't have a scheme, so the user is likely accustomed to - // grpc-go's APIs. - err = fmt.Errorf( - "URL %q missing scheme: use http:// or https:// (unlike grpc-go)", - rawURL, - ) - } - return nil, NewError(CodeUnavailable, err) -} diff --git a/vendor/github.com/bufbuild/connect-go/client_stream.go b/vendor/github.com/bufbuild/connect-go/client_stream.go deleted file mode 100644 index 8f81b33b55..0000000000 --- a/vendor/github.com/bufbuild/connect-go/client_stream.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "errors" - "io" - "net/http" -) - -// ClientStreamForClient is the client's view of a client streaming RPC. -// -// It's returned from [Client].CallClientStream, but doesn't currently have an -// exported constructor function. -type ClientStreamForClient[Req, Res any] struct { - conn StreamingClientConn - // Error from client construction. If non-nil, return for all calls. - err error -} - -// Spec returns the specification for the RPC. -func (c *ClientStreamForClient[_, _]) Spec() Spec { - return c.conn.Spec() -} - -// Peer describes the server for the RPC. -func (c *ClientStreamForClient[_, _]) Peer() Peer { - return c.conn.Peer() -} - -// RequestHeader returns the request headers. Headers are sent to the server with the -// first call to Send. -// -// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (c *ClientStreamForClient[Req, Res]) RequestHeader() http.Header { - if c.err != nil { - return http.Header{} - } - return c.conn.RequestHeader() -} - -// Send a message to the server. The first call to Send also sends the request -// headers. -// -// If the server returns an error, Send returns an error that wraps [io.EOF]. -// Clients should check for case using the standard library's [errors.Is] and -// unmarshal the error using CloseAndReceive. -func (c *ClientStreamForClient[Req, Res]) Send(request *Req) error { - if c.err != nil { - return c.err - } - if request == nil { - return c.conn.Send(nil) - } - return c.conn.Send(request) -} - -// CloseAndReceive closes the send side of the stream and waits for the -// response. -func (c *ClientStreamForClient[Req, Res]) CloseAndReceive() (*Response[Res], error) { - if c.err != nil { - return nil, c.err - } - if err := c.conn.CloseRequest(); err != nil { - _ = c.conn.CloseResponse() - return nil, err - } - response, err := receiveUnaryResponse[Res](c.conn) - if err != nil { - _ = c.conn.CloseResponse() - return nil, err - } - return response, c.conn.CloseResponse() -} - -// Conn exposes the underlying StreamingClientConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (c *ClientStreamForClient[Req, Res]) Conn() (StreamingClientConn, error) { - return c.conn, c.err -} - -// ServerStreamForClient is the client's view of a server streaming RPC. -// -// It's returned from [Client].CallServerStream, but doesn't currently have an -// exported constructor function. -type ServerStreamForClient[Res any] struct { - conn StreamingClientConn - msg *Res - // Error from client construction. If non-nil, return for all calls. - constructErr error - // Error from conn.Receive(). - receiveErr error -} - -// Receive advances the stream to the next message, which will then be -// available through the Msg method. It returns false when the stream stops, -// either by reaching the end or by encountering an unexpected error. After -// Receive returns false, the Err method will return any unexpected error -// encountered. -func (s *ServerStreamForClient[Res]) Receive() bool { - if s.constructErr != nil || s.receiveErr != nil { - return false - } - s.msg = new(Res) - s.receiveErr = s.conn.Receive(s.msg) - return s.receiveErr == nil -} - -// Msg returns the most recent message unmarshaled by a call to Receive. -func (s *ServerStreamForClient[Res]) Msg() *Res { - if s.msg == nil { - s.msg = new(Res) - } - return s.msg -} - -// Err returns the first non-EOF error that was encountered by Receive. -func (s *ServerStreamForClient[Res]) Err() error { - if s.constructErr != nil { - return s.constructErr - } - if s.receiveErr != nil && !errors.Is(s.receiveErr, io.EOF) { - return s.receiveErr - } - return nil -} - -// ResponseHeader returns the headers received from the server. It blocks until -// the first call to Receive returns. -func (s *ServerStreamForClient[Res]) ResponseHeader() http.Header { - if s.constructErr != nil { - return http.Header{} - } - return s.conn.ResponseHeader() -} - -// ResponseTrailer returns the trailers received from the server. Trailers -// aren't fully populated until Receive() returns an error wrapping io.EOF. -func (s *ServerStreamForClient[Res]) ResponseTrailer() http.Header { - if s.constructErr != nil { - return http.Header{} - } - return s.conn.ResponseTrailer() -} - -// Close the receive side of the stream. -func (s *ServerStreamForClient[Res]) Close() error { - if s.constructErr != nil { - return s.constructErr - } - return s.conn.CloseResponse() -} - -// Conn exposes the underlying StreamingClientConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (s *ServerStreamForClient[Res]) Conn() (StreamingClientConn, error) { - return s.conn, s.constructErr -} - -// BidiStreamForClient is the client's view of a bidirectional streaming RPC. -// -// It's returned from [Client].CallBidiStream, but doesn't currently have an -// exported constructor function. -type BidiStreamForClient[Req, Res any] struct { - conn StreamingClientConn - // Error from client construction. If non-nil, return for all calls. - err error -} - -// Spec returns the specification for the RPC. -func (b *BidiStreamForClient[_, _]) Spec() Spec { - return b.conn.Spec() -} - -// Peer describes the server for the RPC. -func (b *BidiStreamForClient[_, _]) Peer() Peer { - return b.conn.Peer() -} - -// RequestHeader returns the request headers. Headers are sent with the first -// call to Send. -// -// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (b *BidiStreamForClient[Req, Res]) RequestHeader() http.Header { - if b.err != nil { - return http.Header{} - } - return b.conn.RequestHeader() -} - -// Send a message to the server. The first call to Send also sends the request -// headers. To send just the request headers, without a body, call Send with a -// nil pointer. -// -// If the server returns an error, Send returns an error that wraps [io.EOF]. -// Clients should check for EOF using the standard library's [errors.Is] and -// call Receive to retrieve the error. -func (b *BidiStreamForClient[Req, Res]) Send(msg *Req) error { - if b.err != nil { - return b.err - } - if msg == nil { - return b.conn.Send(nil) - } - return b.conn.Send(msg) -} - -// CloseRequest closes the send side of the stream. -func (b *BidiStreamForClient[Req, Res]) CloseRequest() error { - if b.err != nil { - return b.err - } - return b.conn.CloseRequest() -} - -// Receive a message. When the server is done sending messages and no other -// errors have occurred, Receive will return an error that wraps [io.EOF]. -func (b *BidiStreamForClient[Req, Res]) Receive() (*Res, error) { - if b.err != nil { - return nil, b.err - } - var msg Res - if err := b.conn.Receive(&msg); err != nil { - return nil, err - } - return &msg, nil -} - -// CloseResponse closes the receive side of the stream. -func (b *BidiStreamForClient[Req, Res]) CloseResponse() error { - if b.err != nil { - return b.err - } - return b.conn.CloseResponse() -} - -// ResponseHeader returns the headers received from the server. It blocks until -// the first call to Receive returns. -func (b *BidiStreamForClient[Req, Res]) ResponseHeader() http.Header { - if b.err != nil { - return http.Header{} - } - return b.conn.ResponseHeader() -} - -// ResponseTrailer returns the trailers received from the server. Trailers -// aren't fully populated until Receive() returns an error wrapping [io.EOF]. -func (b *BidiStreamForClient[Req, Res]) ResponseTrailer() http.Header { - if b.err != nil { - return http.Header{} - } - return b.conn.ResponseTrailer() -} - -// Conn exposes the underlying StreamingClientConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (b *BidiStreamForClient[Req, Res]) Conn() (StreamingClientConn, error) { - return b.conn, b.err -} diff --git a/vendor/github.com/bufbuild/connect-go/code.go b/vendor/github.com/bufbuild/connect-go/code.go deleted file mode 100644 index a2110f7c28..0000000000 --- a/vendor/github.com/bufbuild/connect-go/code.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "fmt" - "strconv" - "strings" -) - -// A Code is one of the Connect protocol's error codes. There are no user-defined -// codes, so only the codes enumerated below are valid. In both name and -// semantics, these codes match the gRPC status codes. -// -// The descriptions below are optimized for brevity rather than completeness. -// See the [Connect protocol specification] for detailed descriptions of each -// code and example usage. -// -// [Connect protocol specification]: https://connect.build/docs/protocol -type Code uint32 - -const ( - // The zero code in gRPC is OK, which indicates that the operation was a - // success. We don't define a constant for it because it overlaps awkwardly - // with Go's error semantics: what does it mean to have a non-nil error with - // an OK status? (Also, the Connect protocol doesn't use a code for - // successes.) - - // CodeCanceled indicates that the operation was canceled, typically by the - // caller. - CodeCanceled Code = 1 - - // CodeUnknown indicates that the operation failed for an unknown reason. - CodeUnknown Code = 2 - - // CodeInvalidArgument indicates that client supplied an invalid argument. - CodeInvalidArgument Code = 3 - - // CodeDeadlineExceeded indicates that deadline expired before the operation - // could complete. - CodeDeadlineExceeded Code = 4 - - // CodeNotFound indicates that some requested entity (for example, a file or - // directory) was not found. - CodeNotFound Code = 5 - - // CodeAlreadyExists indicates that client attempted to create an entity (for - // example, a file or directory) that already exists. - CodeAlreadyExists Code = 6 - - // CodePermissionDenied indicates that the caller doesn't have permission to - // execute the specified operation. - CodePermissionDenied Code = 7 - - // CodeResourceExhausted indicates that some resource has been exhausted. For - // example, a per-user quota may be exhausted or the entire file system may - // be full. - CodeResourceExhausted Code = 8 - - // CodeFailedPrecondition indicates that the system is not in a state - // required for the operation's execution. - CodeFailedPrecondition Code = 9 - - // CodeAborted indicates that operation was aborted by the system, usually - // because of a concurrency issue such as a sequencer check failure or - // transaction abort. - CodeAborted Code = 10 - - // CodeOutOfRange indicates that the operation was attempted past the valid - // range (for example, seeking past end-of-file). - CodeOutOfRange Code = 11 - - // CodeUnimplemented indicates that the operation isn't implemented, - // supported, or enabled in this service. - CodeUnimplemented Code = 12 - - // CodeInternal indicates that some invariants expected by the underlying - // system have been broken. This code is reserved for serious errors. - CodeInternal Code = 13 - - // CodeUnavailable indicates that the service is currently unavailable. This - // is usually temporary, so clients can back off and retry idempotent - // operations. - CodeUnavailable Code = 14 - - // CodeDataLoss indicates that the operation has resulted in unrecoverable - // data loss or corruption. - CodeDataLoss Code = 15 - - // CodeUnauthenticated indicates that the request does not have valid - // authentication credentials for the operation. - CodeUnauthenticated Code = 16 - - minCode = CodeCanceled - maxCode = CodeUnauthenticated -) - -func (c Code) String() string { - switch c { - case CodeCanceled: - return "canceled" - case CodeUnknown: - return "unknown" - case CodeInvalidArgument: - return "invalid_argument" - case CodeDeadlineExceeded: - return "deadline_exceeded" - case CodeNotFound: - return "not_found" - case CodeAlreadyExists: - return "already_exists" - case CodePermissionDenied: - return "permission_denied" - case CodeResourceExhausted: - return "resource_exhausted" - case CodeFailedPrecondition: - return "failed_precondition" - case CodeAborted: - return "aborted" - case CodeOutOfRange: - return "out_of_range" - case CodeUnimplemented: - return "unimplemented" - case CodeInternal: - return "internal" - case CodeUnavailable: - return "unavailable" - case CodeDataLoss: - return "data_loss" - case CodeUnauthenticated: - return "unauthenticated" - } - return fmt.Sprintf("code_%d", c) -} - -// MarshalText implements [encoding.TextMarshaler]. -func (c Code) MarshalText() ([]byte, error) { - return []byte(c.String()), nil -} - -// UnmarshalText implements [encoding.TextUnmarshaler]. -func (c *Code) UnmarshalText(data []byte) error { - dataStr := string(data) - switch dataStr { - case "canceled": - *c = CodeCanceled - return nil - case "unknown": - *c = CodeUnknown - return nil - case "invalid_argument": - *c = CodeInvalidArgument - return nil - case "deadline_exceeded": - *c = CodeDeadlineExceeded - return nil - case "not_found": - *c = CodeNotFound - return nil - case "already_exists": - *c = CodeAlreadyExists - return nil - case "permission_denied": - *c = CodePermissionDenied - return nil - case "resource_exhausted": - *c = CodeResourceExhausted - return nil - case "failed_precondition": - *c = CodeFailedPrecondition - return nil - case "aborted": - *c = CodeAborted - return nil - case "out_of_range": - *c = CodeOutOfRange - return nil - case "unimplemented": - *c = CodeUnimplemented - return nil - case "internal": - *c = CodeInternal - return nil - case "unavailable": - *c = CodeUnavailable - return nil - case "data_loss": - *c = CodeDataLoss - return nil - case "unauthenticated": - *c = CodeUnauthenticated - return nil - } - // Ensure that non-canonical codes round-trip through MarshalText and - // UnmarshalText. - if strings.HasPrefix(dataStr, "code_") { - dataStr = strings.TrimPrefix(dataStr, "code_") - code, err := strconv.ParseInt(dataStr, 10 /* base */, 64 /* bitsize */) - if err == nil && (code < int64(minCode) || code > int64(maxCode)) { - *c = Code(code) - return nil - } - } - return fmt.Errorf("invalid code %q", dataStr) -} - -// CodeOf returns the error's status code if it is or wraps an [*Error] and -// [CodeUnknown] otherwise. -func CodeOf(err error) Code { - if connectErr, ok := asError(err); ok { - return connectErr.Code() - } - return CodeUnknown -} diff --git a/vendor/github.com/bufbuild/connect-go/codec.go b/vendor/github.com/bufbuild/connect-go/codec.go deleted file mode 100644 index 4a624c5960..0000000000 --- a/vendor/github.com/bufbuild/connect-go/codec.go +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/runtime/protoiface" -) - -const ( - codecNameProto = "proto" - codecNameJSON = "json" - codecNameJSONCharsetUTF8 = codecNameJSON + "; charset=utf-8" -) - -// Codec marshals structs (typically generated from a schema) to and from bytes. -type Codec interface { - // Name returns the name of the Codec. - // - // This may be used as part of the Content-Type within HTTP. For example, - // with gRPC this is the content subtype, so "application/grpc+proto" will - // map to the Codec with name "proto". - // - // Names must not be empty. - Name() string - // Marshal marshals the given message. - // - // Marshal may expect a specific type of message, and will error if this type - // is not given. - Marshal(any) ([]byte, error) - // Unmarshal unmarshals the given message. - // - // Unmarshal may expect a specific type of message, and will error if this - // type is not given. - Unmarshal([]byte, any) error -} - -// marshalAppender is an extension to Codec for appending to a byte slice. -type marshalAppender interface { - Codec - - // MarshalAppend marshals the given message and appends it to the given - // byte slice. - // - // MarshalAppend may expect a specific type of message, and will error if - // this type is not given. - MarshalAppend([]byte, any) ([]byte, error) -} - -// stableCodec is an extension to Codec for serializing with stable output. -type stableCodec interface { - Codec - - // MarshalStable marshals the given message with stable field ordering. - // - // MarshalStable should return the same output for a given input. Although - // it is not guaranteed to be canonicalized, the marshalling routine for - // MarshalStable will opt for the most normalized output available for a - // given serialization. - // - // For practical reasons, it is possible for MarshalStable to return two - // different results for two inputs considered to be "equal" in their own - // domain, and it may change in the future with codec updates, but for - // any given concrete value and any given version, it should return the - // same output. - MarshalStable(any) ([]byte, error) - - // IsBinary returns true if the marshalled data is binary for this codec. - // - // If this function returns false, the data returned from Marshal and - // MarshalStable are considered valid text and may be used in contexts - // where text is expected. - IsBinary() bool -} - -type protoBinaryCodec struct{} - -var _ Codec = (*protoBinaryCodec)(nil) - -func (c *protoBinaryCodec) Name() string { return codecNameProto } - -func (c *protoBinaryCodec) Marshal(message any) ([]byte, error) { - protoMessage, ok := message.(proto.Message) - if !ok { - return nil, errNotProto(message) - } - return proto.Marshal(protoMessage) -} - -func (c *protoBinaryCodec) MarshalAppend(dst []byte, message any) ([]byte, error) { - protoMessage, ok := message.(proto.Message) - if !ok { - return nil, errNotProto(message) - } - return proto.MarshalOptions{}.MarshalAppend(dst, protoMessage) -} - -func (c *protoBinaryCodec) Unmarshal(data []byte, message any) error { - protoMessage, ok := message.(proto.Message) - if !ok { - return errNotProto(message) - } - return proto.Unmarshal(data, protoMessage) -} - -func (c *protoBinaryCodec) MarshalStable(message any) ([]byte, error) { - protoMessage, ok := message.(proto.Message) - if !ok { - return nil, errNotProto(message) - } - // protobuf does not offer a canonical output today, so this format is not - // guaranteed to match deterministic output from other protobuf libraries. - // In addition, unknown fields may cause inconsistent output for otherwise - // equal messages. - // https://github.com/golang/protobuf/issues/1121 - options := proto.MarshalOptions{Deterministic: true} - return options.Marshal(protoMessage) -} - -func (c *protoBinaryCodec) IsBinary() bool { - return true -} - -type protoJSONCodec struct { - name string -} - -var _ Codec = (*protoJSONCodec)(nil) - -func (c *protoJSONCodec) Name() string { return c.name } - -func (c *protoJSONCodec) Marshal(message any) ([]byte, error) { - protoMessage, ok := message.(proto.Message) - if !ok { - return nil, errNotProto(message) - } - return protojson.MarshalOptions{}.Marshal(protoMessage) -} - -func (c *protoJSONCodec) MarshalAppend(dst []byte, message any) ([]byte, error) { - protoMessage, ok := message.(proto.Message) - if !ok { - return nil, errNotProto(message) - } - return protojson.MarshalOptions{}.MarshalAppend(dst, protoMessage) -} - -func (c *protoJSONCodec) Unmarshal(binary []byte, message any) error { - protoMessage, ok := message.(proto.Message) - if !ok { - return errNotProto(message) - } - if len(binary) == 0 { - return errors.New("zero-length payload is not a valid JSON object") - } - // Discard unknown fields so clients and servers aren't forced to always use - // exactly the same version of the schema. - options := protojson.UnmarshalOptions{DiscardUnknown: true} - return options.Unmarshal(binary, protoMessage) -} - -func (c *protoJSONCodec) MarshalStable(message any) ([]byte, error) { - // protojson does not offer a "deterministic" field ordering, but fields - // are still ordered consistently by their index. However, protojson can - // output inconsistent whitespace for some reason, therefore it is - // suggested to use a formatter to ensure consistent formatting. - // https://github.com/golang/protobuf/issues/1373 - messageJSON, err := c.Marshal(message) - if err != nil { - return nil, err - } - compactedJSON := bytes.NewBuffer(messageJSON[:0]) - if err = json.Compact(compactedJSON, messageJSON); err != nil { - return nil, err - } - return compactedJSON.Bytes(), nil -} - -func (c *protoJSONCodec) IsBinary() bool { - return false -} - -// readOnlyCodecs is a read-only interface to a map of named codecs. -type readOnlyCodecs interface { - // Get gets the Codec with the given name. - Get(string) Codec - // Protobuf gets the user-supplied protobuf codec, falling back to the default - // implementation if necessary. - // - // This is helpful in the gRPC protocol, where the wire protocol requires - // marshaling protobuf structs to binary even if the RPC procedures were - // generated from a different IDL. - Protobuf() Codec - // Names returns a copy of the registered codec names. The returned slice is - // safe for the caller to mutate. - Names() []string -} - -func newReadOnlyCodecs(nameToCodec map[string]Codec) readOnlyCodecs { - return &codecMap{ - nameToCodec: nameToCodec, - } -} - -type codecMap struct { - nameToCodec map[string]Codec -} - -func (m *codecMap) Get(name string) Codec { - return m.nameToCodec[name] -} - -func (m *codecMap) Protobuf() Codec { - if pb, ok := m.nameToCodec[codecNameProto]; ok { - return pb - } - return &protoBinaryCodec{} -} - -func (m *codecMap) Names() []string { - names := make([]string, 0, len(m.nameToCodec)) - for name := range m.nameToCodec { - names = append(names, name) - } - return names -} - -func errNotProto(message any) error { - if _, ok := message.(protoiface.MessageV1); ok { - return fmt.Errorf("%T uses github.com/golang/protobuf, but connect-go only supports google.golang.org/protobuf: see https://go.dev/blog/protobuf-apiv2", message) - } - return fmt.Errorf("%T doesn't implement proto.Message", message) -} diff --git a/vendor/github.com/bufbuild/connect-go/compression.go b/vendor/github.com/bufbuild/connect-go/compression.go deleted file mode 100644 index 3f3a881272..0000000000 --- a/vendor/github.com/bufbuild/connect-go/compression.go +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bytes" - "errors" - "io" - "math" - "strings" - "sync" -) - -const ( - compressionGzip = "gzip" - compressionIdentity = "identity" -) - -// A Decompressor is a reusable wrapper that decompresses an underlying data -// source. The standard library's [*gzip.Reader] implements Decompressor. -type Decompressor interface { - io.Reader - - // Close closes the Decompressor, but not the underlying data source. It may - // return an error if the Decompressor wasn't read to EOF. - Close() error - - // Reset discards the Decompressor's internal state, if any, and prepares it - // to read from a new source of compressed data. - Reset(io.Reader) error -} - -// A Compressor is a reusable wrapper that compresses data written to an -// underlying sink. The standard library's [*gzip.Writer] implements Compressor. -type Compressor interface { - io.Writer - - // Close flushes any buffered data to the underlying sink, then closes the - // Compressor. It must not close the underlying sink. - Close() error - - // Reset discards the Compressor's internal state, if any, and prepares it to - // write compressed data to a new sink. - Reset(io.Writer) -} - -type compressionPool struct { - decompressors sync.Pool - compressors sync.Pool -} - -func newCompressionPool( - newDecompressor func() Decompressor, - newCompressor func() Compressor, -) *compressionPool { - if newDecompressor == nil && newCompressor == nil { - return nil - } - return &compressionPool{ - decompressors: sync.Pool{ - New: func() any { return newDecompressor() }, - }, - compressors: sync.Pool{ - New: func() any { return newCompressor() }, - }, - } -} - -func (c *compressionPool) Decompress(dst *bytes.Buffer, src *bytes.Buffer, readMaxBytes int64) *Error { - decompressor, err := c.getDecompressor(src) - if err != nil { - return errorf(CodeInvalidArgument, "get decompressor: %w", err) - } - reader := io.Reader(decompressor) - if readMaxBytes > 0 && readMaxBytes < math.MaxInt64 { - reader = io.LimitReader(decompressor, readMaxBytes+1) - } - bytesRead, err := dst.ReadFrom(reader) - if err != nil { - _ = c.putDecompressor(decompressor) - return errorf(CodeInvalidArgument, "decompress: %w", err) - } - if readMaxBytes > 0 && bytesRead > readMaxBytes { - discardedBytes, err := io.Copy(io.Discard, decompressor) - _ = c.putDecompressor(decompressor) - if err != nil { - return errorf(CodeResourceExhausted, "message is larger than configured max %d - unable to determine message size: %w", readMaxBytes, err) - } - return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", bytesRead+discardedBytes, readMaxBytes) - } - if err := c.putDecompressor(decompressor); err != nil { - return errorf(CodeUnknown, "recycle decompressor: %w", err) - } - return nil -} - -func (c *compressionPool) Compress(dst *bytes.Buffer, src *bytes.Buffer) *Error { - compressor, err := c.getCompressor(dst) - if err != nil { - return errorf(CodeUnknown, "get compressor: %w", err) - } - if _, err := io.Copy(compressor, src); err != nil { - _ = c.putCompressor(compressor) - return errorf(CodeInternal, "compress: %w", err) - } - if err := c.putCompressor(compressor); err != nil { - return errorf(CodeInternal, "recycle compressor: %w", err) - } - return nil -} - -func (c *compressionPool) getDecompressor(reader io.Reader) (Decompressor, error) { - decompressor, ok := c.decompressors.Get().(Decompressor) - if !ok { - return nil, errors.New("expected Decompressor, got incorrect type from pool") - } - return decompressor, decompressor.Reset(reader) -} - -func (c *compressionPool) putDecompressor(decompressor Decompressor) error { - if err := decompressor.Close(); err != nil { - return err - } - // While it's in the pool, we don't want the decompressor to retain a - // reference to the underlying reader. However, most decompressors attempt to - // read some header data from the new data source when Reset; since we don't - // know the compression format, we can't provide a valid header. Since we - // also reset the decompressor when it's pulled out of the pool, we can - // ignore errors here. - _ = decompressor.Reset(strings.NewReader("")) - c.decompressors.Put(decompressor) - return nil -} - -func (c *compressionPool) getCompressor(writer io.Writer) (Compressor, error) { - compressor, ok := c.compressors.Get().(Compressor) - if !ok { - return nil, errors.New("expected Compressor, got incorrect type from pool") - } - compressor.Reset(writer) - return compressor, nil -} - -func (c *compressionPool) putCompressor(compressor Compressor) error { - if err := compressor.Close(); err != nil { - return err - } - compressor.Reset(io.Discard) // don't keep references - c.compressors.Put(compressor) - return nil -} - -// readOnlyCompressionPools is a read-only interface to a map of named -// compressionPools. -type readOnlyCompressionPools interface { - Get(string) *compressionPool - Contains(string) bool - // Wordy, but clarifies how this is different from readOnlyCodecs.Names(). - CommaSeparatedNames() string -} - -func newReadOnlyCompressionPools( - nameToPool map[string]*compressionPool, - reversedNames []string, -) readOnlyCompressionPools { - // Client and handler configs keep compression names in registration order, - // but we want the last registered to be the most preferred. - names := make([]string, 0, len(reversedNames)) - seen := make(map[string]struct{}, len(reversedNames)) - for i := len(reversedNames) - 1; i >= 0; i-- { - name := reversedNames[i] - if _, ok := seen[name]; ok { - continue - } - seen[name] = struct{}{} - names = append(names, name) - } - return &namedCompressionPools{ - nameToPool: nameToPool, - commaSeparatedNames: strings.Join(names, ","), - } -} - -type namedCompressionPools struct { - nameToPool map[string]*compressionPool - commaSeparatedNames string -} - -func (m *namedCompressionPools) Get(name string) *compressionPool { - if name == "" || name == compressionIdentity { - return nil - } - return m.nameToPool[name] -} - -func (m *namedCompressionPools) Contains(name string) bool { - _, ok := m.nameToPool[name] - return ok -} - -func (m *namedCompressionPools) CommaSeparatedNames() string { - return m.commaSeparatedNames -} diff --git a/vendor/github.com/bufbuild/connect-go/connect.go b/vendor/github.com/bufbuild/connect-go/connect.go deleted file mode 100644 index f210ff6fe5..0000000000 --- a/vendor/github.com/bufbuild/connect-go/connect.go +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package connect is a slim RPC framework built on Protocol Buffers and -// [net/http]. In addition to supporting its own protocol, Connect handlers and -// clients are wire-compatible with gRPC and gRPC-Web, including streaming. -// -// This documentation is intended to explain each type and function in -// isolation. Walkthroughs, FAQs, and other narrative docs are available on the -// [Connect website], and there's a working [demonstration service] on Github. -// -// [Connect website]: https://connect.build -// [demonstration service]: https://github.com/bufbuild/connect-demo -package connect - -import ( - "errors" - "fmt" - "io" - "net/http" - "net/url" -) - -// Version is the semantic version of the connect module. -const Version = "1.9.0" - -// These constants are used in compile-time handshakes with connect's generated -// code. -const ( - IsAtLeastVersion0_0_1 = true - IsAtLeastVersion0_1_0 = true - IsAtLeastVersion1_7_0 = true -) - -// StreamType describes whether the client, server, neither, or both is -// streaming. -type StreamType uint8 - -const ( - StreamTypeUnary StreamType = 0b00 - StreamTypeClient StreamType = 0b01 - StreamTypeServer StreamType = 0b10 - StreamTypeBidi = StreamTypeClient | StreamTypeServer -) - -func (s StreamType) String() string { - switch s { - case StreamTypeUnary: - return "unary" - case StreamTypeClient: - return "client" - case StreamTypeServer: - return "server" - case StreamTypeBidi: - return "bidi" - } - return fmt.Sprintf("stream_%d", s) -} - -// StreamingHandlerConn is the server's view of a bidirectional message -// exchange. Interceptors for streaming RPCs may wrap StreamingHandlerConns. -// -// Like the standard library's [http.ResponseWriter], StreamingHandlerConns write -// response headers to the network with the first call to Send. Any subsequent -// mutations are effectively no-ops. Handlers may mutate response trailers at -// any time before returning. When the client has finished sending data, -// Receive returns an error wrapping [io.EOF]. Handlers should check for this -// using the standard library's [errors.Is]. -// -// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for -// use by the gRPC and Connect protocols: applications may read them but -// shouldn't write them. -// -// StreamingHandlerConn implementations provided by this module guarantee that -// all returned errors can be cast to [*Error] using the standard library's -// [errors.As]. -// -// StreamingHandlerConn implementations do not need to be safe for concurrent use. -type StreamingHandlerConn interface { - Spec() Spec - Peer() Peer - - Receive(any) error - RequestHeader() http.Header - - Send(any) error - ResponseHeader() http.Header - ResponseTrailer() http.Header -} - -// StreamingClientConn is the client's view of a bidirectional message exchange. -// Interceptors for streaming RPCs may wrap StreamingClientConns. -// -// StreamingClientConns write request headers to the network with the first -// call to Send. Any subsequent mutations are effectively no-ops. When the -// server is done sending data, the StreamingClientConn's Receive method -// returns an error wrapping [io.EOF]. Clients should check for this using the -// standard library's [errors.Is]. If the server encounters an error during -// processing, subsequent calls to the StreamingClientConn's Send method will -// return an error wrapping [io.EOF]; clients may then call Receive to unmarshal -// the error. -// -// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for -// use by the gRPC and Connect protocols: applications may read them but -// shouldn't write them. -// -// StreamingClientConn implementations provided by this module guarantee that -// all returned errors can be cast to [*Error] using the standard library's -// [errors.As]. -// -// In order to support bidirectional streaming RPCs, all StreamingClientConn -// implementations must support limited concurrent use. See the comments on -// each group of methods for details. -type StreamingClientConn interface { - // Spec and Peer must be safe to call concurrently with all other methods. - Spec() Spec - Peer() Peer - - // Send, RequestHeader, and CloseRequest may race with each other, but must - // be safe to call concurrently with all other methods. - Send(any) error - RequestHeader() http.Header - CloseRequest() error - - // Receive, ResponseHeader, ResponseTrailer, and CloseResponse may race with - // each other, but must be safe to call concurrently with all other methods. - Receive(any) error - ResponseHeader() http.Header - ResponseTrailer() http.Header - CloseResponse() error -} - -// Request is a wrapper around a generated request message. It provides -// access to metadata like headers and the RPC specification, as well as -// strongly-typed access to the message itself. -type Request[T any] struct { - Msg *T - - spec Spec - peer Peer - header http.Header - method string -} - -// NewRequest wraps a generated request message. -func NewRequest[T any](message *T) *Request[T] { - return &Request[T]{ - Msg: message, - // Initialized lazily so we don't allocate unnecessarily. - header: nil, - } -} - -// Any returns the concrete request message as an empty interface, so that -// *Request implements the [AnyRequest] interface. -func (r *Request[_]) Any() any { - return r.Msg -} - -// Spec returns a description of this RPC. -func (r *Request[_]) Spec() Spec { - return r.spec -} - -// Peer describes the other party for this RPC. -func (r *Request[_]) Peer() Peer { - return r.peer -} - -// Header returns the HTTP headers for this request. Headers beginning with -// "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC -// protocols: applications may read them but shouldn't write them. -func (r *Request[_]) Header() http.Header { - if r.header == nil { - r.header = make(http.Header) - } - return r.header -} - -// HTTPMethod returns the HTTP method for this request. This is nearly always -// POST, but side-effect-free unary RPCs could be made via a GET. -// -// On a newly created request, via NewRequest, this will return the empty -// string until the actual request is actually sent and the HTTP method -// determined. This means that client interceptor functions will see the -// empty string until *after* they delegate to the handler they wrapped. It -// is even possible for this to return the empty string after such delegation, -// if the request was never actually sent to the server (and thus no -// determination ever made about the HTTP method). -func (r *Request[_]) HTTPMethod() string { - return r.method -} - -// internalOnly implements AnyRequest. -func (r *Request[_]) internalOnly() {} - -// setRequestMethod sets the request method to the given value. -func (r *Request[_]) setRequestMethod(method string) { - r.method = method -} - -// AnyRequest is the common method set of every [Request], regardless of type -// parameter. It's used in unary interceptors. -// -// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for -// use by the gRPC and Connect protocols: applications may read them but -// shouldn't write them. -// -// To preserve our ability to add methods to this interface without breaking -// backward compatibility, only types defined in this package can implement -// AnyRequest. -type AnyRequest interface { - Any() any - Spec() Spec - Peer() Peer - Header() http.Header - HTTPMethod() string - - internalOnly() - setRequestMethod(string) -} - -// Response is a wrapper around a generated response message. It provides -// access to metadata like headers and trailers, as well as strongly-typed -// access to the message itself. -type Response[T any] struct { - Msg *T - - header http.Header - trailer http.Header -} - -// NewResponse wraps a generated response message. -func NewResponse[T any](message *T) *Response[T] { - return &Response[T]{ - Msg: message, - // Initialized lazily so we don't allocate unnecessarily. - header: nil, - trailer: nil, - } -} - -// Any returns the concrete response message as an empty interface, so that -// *Response implements the [AnyResponse] interface. -func (r *Response[_]) Any() any { - return r.Msg -} - -// Header returns the HTTP headers for this response. Headers beginning with -// "Connect-" and "Grpc-" are reserved for use by the Connect and gRPC -// protocols: applications may read them but shouldn't write them. -func (r *Response[_]) Header() http.Header { - if r.header == nil { - r.header = make(http.Header) - } - return r.header -} - -// Trailer returns the trailers for this response. Depending on the underlying -// RPC protocol, trailers may be sent as HTTP trailers or a protocol-specific -// block of in-body metadata. -// -// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols: applications may read them but shouldn't write -// them. -func (r *Response[_]) Trailer() http.Header { - if r.trailer == nil { - r.trailer = make(http.Header) - } - return r.trailer -} - -// internalOnly implements AnyResponse. -func (r *Response[_]) internalOnly() {} - -// AnyResponse is the common method set of every [Response], regardless of type -// parameter. It's used in unary interceptors. -// -// Headers and trailers beginning with "Connect-" and "Grpc-" are reserved for -// use by the gRPC and Connect protocols: applications may read them but -// shouldn't write them. -// -// To preserve our ability to add methods to this interface without breaking -// backward compatibility, only types defined in this package can implement -// AnyResponse. -type AnyResponse interface { - Any() any - Header() http.Header - Trailer() http.Header - - internalOnly() -} - -// HTTPClient is the interface connect expects HTTP clients to implement. The -// standard library's *http.Client implements HTTPClient. -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -// Spec is a description of a client call or a handler invocation. -// -// If you're using Protobuf, protoc-gen-connect-go generates a constant for the -// fully-qualified Procedure corresponding to each RPC in your schema. -type Spec struct { - StreamType StreamType - Procedure string // for example, "/acme.foo.v1.FooService/Bar" - IsClient bool // otherwise we're in a handler - IdempotencyLevel IdempotencyLevel -} - -// Peer describes the other party to an RPC. -// -// When accessed client-side, Addr contains the host or host:port from the -// server's URL. When accessed server-side, Addr contains the client's address -// in IP:port format. -// -// On both the client and the server, Protocol is the RPC protocol in use. -// Currently, it's either [ProtocolConnect], [ProtocolGRPC], or -// [ProtocolGRPCWeb], but additional protocols may be added in the future. -// -// Query contains the query parameters for the request. For the server, this -// will reflect the actual query parameters sent. For the client, it is unset. -type Peer struct { - Addr string - Protocol string - Query url.Values // server-only -} - -func newPeerFromURL(url *url.URL, protocol string) Peer { - return Peer{ - Addr: url.Host, - Protocol: protocol, - } -} - -// handlerConnCloser extends StreamingHandlerConn with a method for handlers to -// terminate the message exchange (and optionally send an error to the client). -type handlerConnCloser interface { - StreamingHandlerConn - - Close(error) error -} - -// receiveUnaryResponse unmarshals a message from a StreamingClientConn, then -// envelopes the message and attaches headers and trailers. It attempts to -// consume the response stream and isn't appropriate when receiving multiple -// messages. -func receiveUnaryResponse[T any](conn StreamingClientConn) (*Response[T], error) { - var msg T - if err := conn.Receive(&msg); err != nil { - return nil, err - } - // In a well-formed stream, the response message may be followed by a block - // of in-stream trailers or HTTP trailers. To ensure that we receive the - // trailers, try to read another message from the stream. - if err := conn.Receive(new(T)); err == nil { - return nil, NewError(CodeUnknown, errors.New("unary stream has multiple messages")) - } else if err != nil && !errors.Is(err, io.EOF) { - return nil, NewError(CodeUnknown, err) - } - return &Response[T]{ - Msg: &msg, - header: conn.ResponseHeader(), - trailer: conn.ResponseTrailer(), - }, nil -} diff --git a/vendor/github.com/bufbuild/connect-go/duplex_http_call.go b/vendor/github.com/bufbuild/connect-go/duplex_http_call.go deleted file mode 100644 index 4dac00921d..0000000000 --- a/vendor/github.com/bufbuild/connect-go/duplex_http_call.go +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "errors" - "fmt" - "io" - "net/http" - "net/url" - "sync" -) - -// duplexHTTPCall is a full-duplex stream between the client and server. The -// request body is the stream from client to server, and the response body is -// the reverse. -// -// Be warned: we need to use some lesser-known APIs to do this with net/http. -type duplexHTTPCall struct { - ctx context.Context - httpClient HTTPClient - streamType StreamType - onRequestSend func(*http.Request) - validateResponse func(*http.Response) *Error - - // We'll use a pipe as the request body. We hand the read side of the pipe to - // net/http, and we write to the write side (naturally). The two ends are - // safe to use concurrently. - requestBodyReader *io.PipeReader - requestBodyWriter *io.PipeWriter - - sendRequestOnce sync.Once - responseReady chan struct{} - request *http.Request - response *http.Response - - errMu sync.Mutex - err error -} - -func newDuplexHTTPCall( - ctx context.Context, - httpClient HTTPClient, - url *url.URL, - spec Spec, - header http.Header, -) *duplexHTTPCall { - // ensure we make a copy of the url before we pass along to the - // Request. This ensures if a transport out of our control wants - // to mutate the req.URL, we don't feel the effects of it. - url = cloneURL(url) - pipeReader, pipeWriter := io.Pipe() - - // This is mirroring what http.NewRequestContext did, but - // using an already parsed url.URL object, rather than a string - // and parsing it again. This is a bit funny with HTTP/1.1 - // explicitly, but this is logic copied over from - // NewRequestContext and doesn't effect the actual version - // being transmitted. - request := (&http.Request{ - Method: http.MethodPost, - URL: url, - Header: header, - Proto: "HTTP/1.1", - ProtoMajor: 1, - ProtoMinor: 1, - Body: pipeReader, - Host: url.Host, - }).WithContext(ctx) - return &duplexHTTPCall{ - ctx: ctx, - httpClient: httpClient, - streamType: spec.StreamType, - requestBodyReader: pipeReader, - requestBodyWriter: pipeWriter, - request: request, - responseReady: make(chan struct{}), - } -} - -// Write to the request body. Returns an error wrapping io.EOF after SetError -// is called. -func (d *duplexHTTPCall) Write(data []byte) (int, error) { - d.ensureRequestMade() - // Before we send any data, check if the context has been canceled. - if err := d.ctx.Err(); err != nil { - d.SetError(err) - return 0, wrapIfContextError(err) - } - // It's safe to write to this side of the pipe while net/http concurrently - // reads from the other side. - bytesWritten, err := d.requestBodyWriter.Write(data) - if err != nil && errors.Is(err, io.ErrClosedPipe) { - // Signal that the stream is closed with the more-typical io.EOF instead of - // io.ErrClosedPipe. This makes it easier for protocol-specific wrappers to - // match grpc-go's behavior. - return bytesWritten, io.EOF - } - return bytesWritten, err -} - -// Close the request body. Callers *must* call CloseWrite before Read when -// using HTTP/1.x. -func (d *duplexHTTPCall) CloseWrite() error { - // Even if Write was never called, we need to make an HTTP request. This - // ensures that we've sent any headers to the server and that we have an HTTP - // response to read from. - d.ensureRequestMade() - // The user calls CloseWrite to indicate that they're done sending data. It's - // safe to close the write side of the pipe while net/http is reading from - // it. - // - // Because connect also supports some RPC types over HTTP/1.1, we need to be - // careful how we expose this method to users. HTTP/1.1 doesn't support - // bidirectional streaming - the write side of the stream (aka request body) - // must be closed before we start reading the response or we'll just block - // forever. To make sure users don't have to worry about this, the generated - // code for unary, client streaming, and server streaming RPCs must call - // CloseWrite automatically rather than requiring the user to do it. - return d.requestBodyWriter.Close() -} - -// Header returns the HTTP request headers. -func (d *duplexHTTPCall) Header() http.Header { - return d.request.Header -} - -// Trailer returns the HTTP request trailers. -func (d *duplexHTTPCall) Trailer() http.Header { - return d.request.Trailer -} - -// URL returns the URL for the request. -func (d *duplexHTTPCall) URL() *url.URL { - return d.request.URL -} - -// SetMethod changes the method of the request before it is sent. -func (d *duplexHTTPCall) SetMethod(method string) { - d.request.Method = method -} - -// Read from the response body. Returns the first error passed to SetError. -func (d *duplexHTTPCall) Read(data []byte) (int, error) { - // First, we wait until we've gotten the response headers and established the - // server-to-client side of the stream. - d.BlockUntilResponseReady() - if err := d.getError(); err != nil { - // The stream is already closed or corrupted. - return 0, err - } - // Before we read, check if the context has been canceled. - if err := d.ctx.Err(); err != nil { - d.SetError(err) - return 0, wrapIfContextError(err) - } - if d.response == nil { - return 0, fmt.Errorf("nil response from %v", d.request.URL) - } - n, err := d.response.Body.Read(data) - return n, wrapIfRSTError(err) -} - -func (d *duplexHTTPCall) CloseRead() error { - d.BlockUntilResponseReady() - if d.response == nil { - return nil - } - if err := discard(d.response.Body); err != nil { - _ = d.response.Body.Close() - return wrapIfRSTError(err) - } - return wrapIfRSTError(d.response.Body.Close()) -} - -// ResponseStatusCode is the response's HTTP status code. -func (d *duplexHTTPCall) ResponseStatusCode() (int, error) { - d.BlockUntilResponseReady() - if d.response == nil { - return 0, fmt.Errorf("nil response from %v", d.request.URL) - } - return d.response.StatusCode, nil -} - -// ResponseHeader returns the response HTTP headers. -func (d *duplexHTTPCall) ResponseHeader() http.Header { - d.BlockUntilResponseReady() - if d.response != nil { - return d.response.Header - } - return make(http.Header) -} - -// ResponseTrailer returns the response HTTP trailers. -func (d *duplexHTTPCall) ResponseTrailer() http.Header { - d.BlockUntilResponseReady() - if d.response != nil { - return d.response.Trailer - } - return make(http.Header) -} - -// SetError stores any error encountered processing the response. All -// subsequent calls to Read return this error, and all subsequent calls to -// Write return an error wrapping io.EOF. It's safe to call concurrently with -// any other method. -func (d *duplexHTTPCall) SetError(err error) { - d.errMu.Lock() - if d.err == nil { - d.err = wrapIfContextError(err) - } - // Closing the read side of the request body pipe acquires an internal lock, - // so we want to scope errMu's usage narrowly and avoid defer. - d.errMu.Unlock() - - // We've already hit an error, so we should stop writing to the request body. - // It's safe to call Close more than once and/or concurrently (calls after - // the first are no-ops), so it's okay for us to call this even though - // net/http sometimes closes the reader too. - // - // It's safe to ignore the returned error here. Under the hood, Close calls - // CloseWithError, which is documented to always return nil. - _ = d.requestBodyReader.Close() -} - -// SetValidateResponse sets the response validation function. The function runs -// in a background goroutine. -func (d *duplexHTTPCall) SetValidateResponse(validate func(*http.Response) *Error) { - d.validateResponse = validate -} - -func (d *duplexHTTPCall) BlockUntilResponseReady() { - <-d.responseReady -} - -func (d *duplexHTTPCall) ensureRequestMade() { - d.sendRequestOnce.Do(func() { - go d.makeRequest() - }) -} - -func (d *duplexHTTPCall) makeRequest() { - // This runs concurrently with Write and CloseWrite. Read and CloseRead wait - // on d.responseReady, so we can't race with them. - defer close(d.responseReady) - - // Promote the header Host to the request object. - if host := d.request.Header.Get(headerHost); len(host) > 0 { - d.request.Host = host - } - - if d.onRequestSend != nil { - d.onRequestSend(d.request) - } - // Once we send a message to the server, they send a message back and - // establish the receive side of the stream. - response, err := d.httpClient.Do(d.request) //nolint:bodyclose - if err != nil { - err = wrapIfContextError(err) - err = wrapIfLikelyH2CNotConfiguredError(d.request, err) - err = wrapIfLikelyWithGRPCNotUsedError(err) - err = wrapIfRSTError(err) - if _, ok := asError(err); !ok { - err = NewError(CodeUnavailable, err) - } - d.SetError(err) - return - } - d.response = response - if err := d.validateResponse(response); err != nil { - d.SetError(err) - return - } - if (d.streamType&StreamTypeBidi) == StreamTypeBidi && response.ProtoMajor < 2 { - // If we somehow dialed an HTTP/1.x server, fail with an explicit message - // rather than returning a more cryptic error later on. - d.SetError(errorf( - CodeUnimplemented, - "response from %v is HTTP/%d.%d: bidi streams require at least HTTP/2", - d.request.URL, - response.ProtoMajor, - response.ProtoMinor, - )) - } -} - -func (d *duplexHTTPCall) getError() error { - d.errMu.Lock() - defer d.errMu.Unlock() - return d.err -} - -// See: https://cs.opensource.google/go/go/+/refs/tags/go1.20.1:src/net/http/clone.go;l=22-33 -func cloneURL(oldURL *url.URL) *url.URL { - if oldURL == nil { - return nil - } - newURL := new(url.URL) - *newURL = *oldURL - if oldURL.User != nil { - newURL.User = new(url.Userinfo) - *newURL.User = *oldURL.User - } - return newURL -} diff --git a/vendor/github.com/bufbuild/connect-go/envelope.go b/vendor/github.com/bufbuild/connect-go/envelope.go deleted file mode 100644 index 936495d1d2..0000000000 --- a/vendor/github.com/bufbuild/connect-go/envelope.go +++ /dev/null @@ -1,302 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bytes" - "encoding/binary" - "errors" - "io" -) - -// flagEnvelopeCompressed indicates that the data is compressed. It has the -// same meaning in the gRPC-Web, gRPC-HTTP2, and Connect protocols. -const flagEnvelopeCompressed = 0b00000001 - -var errSpecialEnvelope = errorf( - CodeUnknown, - "final message has protocol-specific flags: %w", - // User code checks for end of stream with errors.Is(err, io.EOF). - io.EOF, -) - -// envelope is a block of arbitrary bytes wrapped in gRPC and Connect's framing -// protocol. -// -// Each message is preceded by a 5-byte prefix. The first byte is a uint8 used -// as a set of bitwise flags, and the remainder is a uint32 indicating the -// message length. gRPC and Connect interpret the bitwise flags differently, so -// envelope leaves their interpretation up to the caller. -type envelope struct { - Data *bytes.Buffer - Flags uint8 -} - -func (e *envelope) IsSet(flag uint8) bool { - return e.Flags&flag == flag -} - -type envelopeWriter struct { - writer io.Writer - codec Codec - compressMinBytes int - compressionPool *compressionPool - bufferPool *bufferPool - sendMaxBytes int -} - -func (w *envelopeWriter) Marshal(message any) *Error { - if message == nil { - if _, err := w.writer.Write(nil); err != nil { - if connectErr, ok := asError(err); ok { - return connectErr - } - return NewError(CodeUnknown, err) - } - return nil - } - if appender, ok := w.codec.(marshalAppender); ok { - return w.marshalAppend(message, appender) - } - return w.marshal(message) -} - -// Write writes the enveloped message, compressing as necessary. It doesn't -// retain any references to the supplied envelope or its underlying data. -func (w *envelopeWriter) Write(env *envelope) *Error { - if env.IsSet(flagEnvelopeCompressed) || - w.compressionPool == nil || - env.Data.Len() < w.compressMinBytes { - if w.sendMaxBytes > 0 && env.Data.Len() > w.sendMaxBytes { - return errorf(CodeResourceExhausted, "message size %d exceeds sendMaxBytes %d", env.Data.Len(), w.sendMaxBytes) - } - return w.write(env) - } - data := w.bufferPool.Get() - defer w.bufferPool.Put(data) - if err := w.compressionPool.Compress(data, env.Data); err != nil { - return err - } - if w.sendMaxBytes > 0 && data.Len() > w.sendMaxBytes { - return errorf(CodeResourceExhausted, "compressed message size %d exceeds sendMaxBytes %d", data.Len(), w.sendMaxBytes) - } - return w.write(&envelope{ - Data: data, - Flags: env.Flags | flagEnvelopeCompressed, - }) -} - -func (w *envelopeWriter) marshalAppend(message any, codec marshalAppender) *Error { - // Codec supports MarshalAppend; try to re-use a []byte from the pool. - buffer := w.bufferPool.Get() - defer w.bufferPool.Put(buffer) - raw, err := codec.MarshalAppend(buffer.Bytes(), message) - if err != nil { - return errorf(CodeInternal, "marshal message: %w", err) - } - if cap(raw) > buffer.Cap() { - // The buffer from the pool was too small, so MarshalAppend grew the slice. - // Pessimistically assume that the too-small buffer is insufficient for the - // application workload, so there's no point in keeping it in the pool. - // Instead, replace it with the larger, newly-allocated slice. This - // allocates, but it's a small, constant-size allocation. - *buffer = *bytes.NewBuffer(raw) - } else { - // MarshalAppend didn't allocate, but we need to fix the internal state of - // the buffer. Compared to replacing the buffer (as above), buffer.Write - // copies but avoids allocating. - buffer.Write(raw) - } - envelope := &envelope{Data: buffer} - return w.Write(envelope) -} - -func (w *envelopeWriter) marshal(message any) *Error { - // Codec doesn't support MarshalAppend; let Marshal allocate a []byte. - raw, err := w.codec.Marshal(message) - if err != nil { - return errorf(CodeInternal, "marshal message: %w", err) - } - buffer := bytes.NewBuffer(raw) - // Put our new []byte into the pool for later reuse. - defer w.bufferPool.Put(buffer) - envelope := &envelope{Data: buffer} - return w.Write(envelope) -} - -func (w *envelopeWriter) write(env *envelope) *Error { - prefix := [5]byte{} - prefix[0] = env.Flags - binary.BigEndian.PutUint32(prefix[1:5], uint32(env.Data.Len())) - if _, err := w.writer.Write(prefix[:]); err != nil { - if connectErr, ok := asError(err); ok { - return connectErr - } - return errorf(CodeUnknown, "write envelope: %w", err) - } - if _, err := io.Copy(w.writer, env.Data); err != nil { - return errorf(CodeUnknown, "write message: %w", err) - } - return nil -} - -type envelopeReader struct { - reader io.Reader - codec Codec - last envelope - compressionPool *compressionPool - bufferPool *bufferPool - readMaxBytes int -} - -func (r *envelopeReader) Unmarshal(message any) *Error { - buffer := r.bufferPool.Get() - defer r.bufferPool.Put(buffer) - - env := &envelope{Data: buffer} - err := r.Read(env) - switch { - case err == nil && - (env.Flags == 0 || env.Flags == flagEnvelopeCompressed) && - env.Data.Len() == 0: - // This is a standard message (because none of the top 7 bits are set) and - // there's no data, so the zero value of the message is correct. - return nil - case err != nil && errors.Is(err, io.EOF): - // The stream has ended. Propagate the EOF to the caller. - return err - case err != nil: - // Something's wrong. - return err - } - - data := env.Data - if data.Len() > 0 && env.IsSet(flagEnvelopeCompressed) { - if r.compressionPool == nil { - return errorf( - CodeInvalidArgument, - "gRPC protocol error: sent compressed message without Grpc-Encoding header", - ) - } - decompressed := r.bufferPool.Get() - defer r.bufferPool.Put(decompressed) - if err := r.compressionPool.Decompress(decompressed, data, int64(r.readMaxBytes)); err != nil { - return err - } - data = decompressed - } - - if env.Flags != 0 && env.Flags != flagEnvelopeCompressed { - // One of the protocol-specific flags are set, so this is the end of the - // stream. Save the message for protocol-specific code to process and - // return a sentinel error. Since we've deferred functions to return env's - // underlying buffer to a pool, we need to keep a copy. - copiedData := make([]byte, data.Len()) - copy(copiedData, data.Bytes()) - r.last = envelope{ - Data: bytes.NewBuffer(copiedData), - Flags: env.Flags, - } - return errSpecialEnvelope - } - - if err := r.codec.Unmarshal(data.Bytes(), message); err != nil { - return errorf(CodeInvalidArgument, "unmarshal into %T: %w", message, err) - } - return nil -} - -func (r *envelopeReader) Read(env *envelope) *Error { - prefixes := [5]byte{} - prefixBytesRead, err := r.reader.Read(prefixes[:]) - - switch { - case (err == nil || errors.Is(err, io.EOF)) && - prefixBytesRead == 5 && - isSizeZeroPrefix(prefixes): - // Successfully read prefix and expect no additional data. - env.Flags = prefixes[0] - return nil - case err != nil && errors.Is(err, io.EOF) && prefixBytesRead == 0: - // The stream ended cleanly. That's expected, but we need to propagate them - // to the user so that they know that the stream has ended. We shouldn't - // add any alarming text about protocol errors, though. - return NewError(CodeUnknown, err) - case err != nil || prefixBytesRead < 5: - // Something else has gone wrong - the stream didn't end cleanly. - if connectErr, ok := asError(err); ok { - return connectErr - } - if maxBytesErr := asMaxBytesError(err, "read 5 byte message prefix"); maxBytesErr != nil { - // We're reading from an http.MaxBytesHandler, and we've exceeded the read limit. - return maxBytesErr - } - return errorf( - CodeInvalidArgument, - "protocol error: incomplete envelope: %w", err, - ) - } - size := int(binary.BigEndian.Uint32(prefixes[1:5])) - if size < 0 { - return errorf(CodeInvalidArgument, "message size %d overflowed uint32", size) - } - if r.readMaxBytes > 0 && size > r.readMaxBytes { - _, err := io.CopyN(io.Discard, r.reader, int64(size)) - if err != nil && !errors.Is(err, io.EOF) { - return errorf(CodeUnknown, "read enveloped message: %w", err) - } - return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", size, r.readMaxBytes) - } - if size > 0 { - env.Data.Grow(size) - // At layer 7, we don't know exactly what's happening down in L4. Large - // length-prefixed messages may arrive in chunks, so we may need to read - // the request body past EOF. We also need to take care that we don't retry - // forever if the message is malformed. - remaining := int64(size) - for remaining > 0 { - bytesRead, err := io.CopyN(env.Data, r.reader, remaining) - if err != nil && !errors.Is(err, io.EOF) { - if maxBytesErr := asMaxBytesError(err, "read %d byte message", size); maxBytesErr != nil { - // We're reading from an http.MaxBytesHandler, and we've exceeded the read limit. - return maxBytesErr - } - return errorf(CodeUnknown, "read enveloped message: %w", err) - } - if errors.Is(err, io.EOF) && bytesRead == 0 { - // We've gotten zero-length chunk of data. Message is likely malformed, - // don't wait for additional chunks. - return errorf( - CodeInvalidArgument, - "protocol error: promised %d bytes in enveloped message, got %d bytes", - size, - int64(size)-remaining, - ) - } - remaining -= bytesRead - } - } - env.Flags = prefixes[0] - return nil -} - -func isSizeZeroPrefix(prefix [5]byte) bool { - for i := 1; i < 5; i++ { - if prefix[i] != 0 { - return false - } - } - return true -} diff --git a/vendor/github.com/bufbuild/connect-go/error.go b/vendor/github.com/bufbuild/connect-go/error.go deleted file mode 100644 index 16de28da59..0000000000 --- a/vendor/github.com/bufbuild/connect-go/error.go +++ /dev/null @@ -1,411 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "errors" - "fmt" - "net/http" - "net/url" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" -) - -const ( - commonErrorsURL = "https://connect.build/docs/go/common-errors" - defaultAnyResolverPrefix = "type.googleapis.com/" -) - -var ( - // errNotModified signals Connect-protocol responses to GET requests to use the - // 304 Not Modified HTTP error code. - errNotModified = errors.New("not modified") - // errNotModifiedClient wraps ErrNotModified for use client-side. - errNotModifiedClient = fmt.Errorf("HTTP 304: %w", errNotModified) -) - -// An ErrorDetail is a self-describing Protobuf message attached to an [*Error]. -// Error details are sent over the network to clients, which can then work with -// strongly-typed data rather than trying to parse a complex error message. For -// example, you might use details to send a localized error message or retry -// parameters to the client. -// -// The [google.golang.org/genproto/googleapis/rpc/errdetails] package contains a -// variety of Protobuf messages commonly used as error details. -type ErrorDetail struct { - pb *anypb.Any - wireJSON string // preserve human-readable JSON -} - -// NewErrorDetail constructs a new error detail. If msg is an *[anypb.Any] then -// it is used as is. Otherwise, it is first marshalled into an *[anypb.Any] -// value. This returns an error if msg cannot be marshalled. -func NewErrorDetail(msg proto.Message) (*ErrorDetail, error) { - // If it's already an Any, don't wrap it inside another. - if pb, ok := msg.(*anypb.Any); ok { - return &ErrorDetail{pb: pb}, nil - } - pb, err := anypb.New(msg) - if err != nil { - return nil, err - } - return &ErrorDetail{pb: pb}, nil -} - -// Type is the fully-qualified name of the detail's Protobuf message (for -// example, acme.foo.v1.FooDetail). -func (d *ErrorDetail) Type() string { - // proto.Any tries to make messages self-describing by using type URLs rather - // than plain type names, but there aren't any descriptor registries - // deployed. With the current state of the `Any` code, it's not possible to - // build a useful type registry either. To hide this from users, we should - // trim the static hostname that `Any` adds to the type name. - // - // If we ever want to support remote registries, we can add an explicit - // `TypeURL` method. - return strings.TrimPrefix(d.pb.TypeUrl, defaultAnyResolverPrefix) -} - -// Bytes returns a copy of the Protobuf-serialized detail. -func (d *ErrorDetail) Bytes() []byte { - out := make([]byte, len(d.pb.Value)) - copy(out, d.pb.Value) - return out -} - -// Value uses the Protobuf runtime's package-global registry to unmarshal the -// Detail into a strongly-typed message. Typically, clients use Go type -// assertions to cast from the proto.Message interface to concrete types. -func (d *ErrorDetail) Value() (proto.Message, error) { - return d.pb.UnmarshalNew() -} - -// An Error captures four key pieces of information: a [Code], an underlying Go -// error, a map of metadata, and an optional collection of arbitrary Protobuf -// messages called "details" (more on those below). Servers send the code, the -// underlying error's Error() output, the metadata, and details over the wire -// to clients. Remember that the underlying error's message will be sent to -// clients - take care not to leak sensitive information from public APIs! -// -// Service implementations and interceptors should return errors that can be -// cast to an [*Error] (using the standard library's [errors.As]). If the returned -// error can't be cast to an [*Error], connect will use [CodeUnknown] and the -// returned error's message. -// -// Error details are an optional mechanism for servers, interceptors, and -// proxies to attach arbitrary Protobuf messages to the error code and message. -// They're a clearer and more performant alternative to HTTP header -// microformats. See [the documentation on errors] for more details. -// -// [the documentation on errors]: https://connect.build/docs/go/errors -type Error struct { - code Code - err error - details []*ErrorDetail - meta http.Header - wireErr bool -} - -// NewError annotates any Go error with a status code. -func NewError(c Code, underlying error) *Error { - return &Error{code: c, err: underlying} -} - -// NewWireError is similar to [NewError], but the resulting *Error returns true -// when tested with [IsWireError]. -// -// This is useful for clients trying to propagate partial failures from -// streaming RPCs. Often, these RPCs include error information in their -// response messages (for example, [gRPC server reflection] and -// OpenTelemtetry's [OTLP]). Clients propagating these errors up the stack -// should use NewWireError to clarify that the error code, message, and details -// (if any) were explicitly sent by the server rather than inferred from a -// lower-level networking error or timeout. -// -// [gRPC server reflection]: https://github.com/grpc/grpc/blob/v1.49.2/src/proto/grpc/reflection/v1alpha/reflection.proto#L132-L136 -// [OTLP]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#partial-success -func NewWireError(c Code, underlying error) *Error { - err := NewError(c, underlying) - err.wireErr = true - return err -} - -// IsWireError checks whether the error was returned by the server, as opposed -// to being synthesized by the client. -// -// Clients may find this useful when deciding how to propagate errors. For -// example, an RPC-to-HTTP proxy might expose a server-sent CodeUnknown as an -// HTTP 500 but a client-synthesized CodeUnknown as a 503. -func IsWireError(err error) bool { - se := new(Error) - if !errors.As(err, &se) { - return false - } - return se.wireErr -} - -// NewNotModifiedError indicates that the requested resource hasn't changed. It -// should be used only when handlers wish to respond to conditional HTTP GET -// requests with a 304 Not Modified. In all other circumstances, including all -// RPCs using the gRPC or gRPC-Web protocols, it's equivalent to sending an -// error with [CodeUnknown]. The supplied headers should include Etag, -// Cache-Control, or any other headers required by [RFC 9110 § 15.4.5]. -// -// Clients should check for this error using [IsNotModifiedError]. -// -// [RFC 9110 § 15.4.5]: https://httpwg.org/specs/rfc9110.html#status.304 -func NewNotModifiedError(headers http.Header) *Error { - err := NewError(CodeUnknown, errNotModified) - if headers != nil { - err.meta = headers - } - return err -} - -func (e *Error) Error() string { - message := e.Message() - if message == "" { - return e.code.String() - } - return e.code.String() + ": " + message -} - -// Message returns the underlying error message. It may be empty if the -// original error was created with a status code and a nil error. -func (e *Error) Message() string { - if e.err != nil { - return e.err.Error() - } - return "" -} - -// Unwrap allows [errors.Is] and [errors.As] access to the underlying error. -func (e *Error) Unwrap() error { - return e.err -} - -// Code returns the error's status code. -func (e *Error) Code() Code { - return e.code -} - -// Details returns the error's details. -func (e *Error) Details() []*ErrorDetail { - return e.details -} - -// AddDetail appends to the error's details. -func (e *Error) AddDetail(d *ErrorDetail) { - e.details = append(e.details, d) -} - -// Meta allows the error to carry additional information as key-value pairs. -// -// Metadata attached to errors returned by unary handlers is always sent as -// HTTP headers, regardless of the protocol. Metadata attached to errors -// returned by streaming handlers may be sent as HTTP headers, HTTP trailers, -// or a block of in-body metadata, depending on the protocol in use and whether -// or not the handler has already written messages to the stream. -// -// When clients receive errors, the metadata contains the union of the HTTP -// headers and the protocol-specific trailers (either HTTP trailers or in-body -// metadata). -func (e *Error) Meta() http.Header { - if e.meta == nil { - e.meta = make(http.Header) - } - return e.meta -} - -func (e *Error) detailsAsAny() []*anypb.Any { - anys := make([]*anypb.Any, 0, len(e.details)) - for _, detail := range e.details { - anys = append(anys, detail.pb) - } - return anys -} - -// IsNotModifiedError checks whether the supplied error indicates that the -// requested resource hasn't changed. It only returns true if the server used -// [NewNotModifiedError] in response to a Connect-protocol RPC made with an -// HTTP GET. -func IsNotModifiedError(err error) bool { - return errors.Is(err, errNotModified) -} - -// errorf calls fmt.Errorf with the supplied template and arguments, then wraps -// the resulting error. -func errorf(c Code, template string, args ...any) *Error { - return NewError(c, fmt.Errorf(template, args...)) -} - -// asError uses errors.As to unwrap any error and look for a connect *Error. -func asError(err error) (*Error, bool) { - var connectErr *Error - ok := errors.As(err, &connectErr) - return connectErr, ok -} - -// wrapIfUncoded ensures that all errors are wrapped. It leaves already-wrapped -// errors unchanged, uses wrapIfContextError to apply codes to context.Canceled -// and context.DeadlineExceeded, and falls back to wrapping other errors with -// CodeUnknown. -func wrapIfUncoded(err error) error { - if err == nil { - return nil - } - maybeCodedErr := wrapIfContextError(err) - if _, ok := asError(maybeCodedErr); ok { - return maybeCodedErr - } - return NewError(CodeUnknown, maybeCodedErr) -} - -// wrapIfContextError applies CodeCanceled or CodeDeadlineExceeded to Go's -// context.Canceled and context.DeadlineExceeded errors, but only if they -// haven't already been wrapped. -func wrapIfContextError(err error) error { - if err == nil { - return nil - } - if _, ok := asError(err); ok { - return err - } - if errors.Is(err, context.Canceled) { - return NewError(CodeCanceled, err) - } - if errors.Is(err, context.DeadlineExceeded) { - return NewError(CodeDeadlineExceeded, err) - } - return err -} - -// wrapIfLikelyH2CNotConfiguredError adds a wrapping error that has a message -// telling the caller that they likely need to use h2c but are using a raw http.Client{}. -// -// This happens when running a gRPC-only server. -// This is fragile and may break over time, and this should be considered a best-effort. -func wrapIfLikelyH2CNotConfiguredError(request *http.Request, err error) error { - if err == nil { - return nil - } - if _, ok := asError(err); ok { - return err - } - if url := request.URL; url != nil && url.Scheme != "http" { - // If the scheme is not http, we definitely do not have an h2c error, so just return. - return err - } - // net/http code has been investigated and there is no typing of any of these errors - // they are all created with fmt.Errorf - // grpc-go returns the first error 2/3-3/4 of the time, and the second error 1/4-1/3 of the time - if errString := err.Error(); strings.HasPrefix(errString, `Post "`) && - (strings.Contains(errString, `net/http: HTTP/1.x transport connection broken: malformed HTTP response`) || - strings.HasSuffix(errString, `write: broken pipe`)) { - return fmt.Errorf("possible h2c configuration issue when talking to gRPC server, see %s: %w", commonErrorsURL, err) - } - return err -} - -// wrapIfLikelyWithGRPCNotUsedError adds a wrapping error that has a message -// telling the caller that they likely forgot to use connect.WithGRPC(). -// -// This happens when running a gRPC-only server. -// This is fragile and may break over time, and this should be considered a best-effort. -func wrapIfLikelyWithGRPCNotUsedError(err error) error { - if err == nil { - return nil - } - if _, ok := asError(err); ok { - return err - } - // golang.org/x/net code has been investigated and there is no typing of this error - // it is created with fmt.Errorf - // http2/transport.go:573: return nil, fmt.Errorf("http2: Transport: cannot retry err [%v] after Request.Body was written; define Request.GetBody to avoid this error", err) - if errString := err.Error(); strings.HasPrefix(errString, `Post "`) && - strings.Contains(errString, `http2: Transport: cannot retry err`) && - strings.HasSuffix(errString, `after Request.Body was written; define Request.GetBody to avoid this error`) { - return fmt.Errorf("possible missing connect.WithGPRC() client option when talking to gRPC server, see %s: %w", commonErrorsURL, err) - } - return err -} - -// HTTP/2 has its own set of error codes, which it sends in RST_STREAM frames. -// When the server sends one of these errors, we should map it back into our -// RPC error codes following -// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#http2-transport-mapping. -// -// This would be vastly simpler if we were using x/net/http2 directly, since -// the StreamError type is exported. When x/net/http2 gets vendored into -// net/http, though, all these types become unexported...so we're left with -// string munging. -func wrapIfRSTError(err error) error { - const ( - streamErrPrefix = "stream error: " - fromPeerSuffix = "; received from peer" - ) - if err == nil { - return nil - } - if _, ok := asError(err); ok { - return err - } - if urlErr := new(url.Error); errors.As(err, &urlErr) { - // If we get an RST_STREAM error from http.Client.Do, it's wrapped in a - // *url.Error. - err = urlErr.Unwrap() - } - msg := err.Error() - if !strings.HasPrefix(msg, streamErrPrefix) { - return err - } - if !strings.HasSuffix(msg, fromPeerSuffix) { - return err - } - msg = strings.TrimSuffix(msg, fromPeerSuffix) - i := strings.LastIndex(msg, ";") - if i < 0 || i >= len(msg)-1 { - return err - } - msg = msg[i+1:] - msg = strings.TrimSpace(msg) - switch msg { - case "NO_ERROR", "PROTOCOL_ERROR", "INTERNAL_ERROR", "FLOW_CONTROL_ERROR", - "SETTINGS_TIMEOUT", "FRAME_SIZE_ERROR", "COMPRESSION_ERROR", "CONNECT_ERROR": - return NewError(CodeInternal, err) - case "REFUSED_STREAM": - return NewError(CodeUnavailable, err) - case "CANCEL": - return NewError(CodeCanceled, err) - case "ENHANCE_YOUR_CALM": - return NewError(CodeResourceExhausted, fmt.Errorf("bandwidth exhausted: %w", err)) - case "INADEQUATE_SECURITY": - return NewError(CodePermissionDenied, fmt.Errorf("transport protocol insecure: %w", err)) - default: - return err - } -} - -func asMaxBytesError(err error, tmpl string, args ...any) *Error { - var maxBytesErr *http.MaxBytesError - if ok := errors.As(err, &maxBytesErr); !ok { - return nil - } - prefix := fmt.Sprintf(tmpl, args...) - return errorf(CodeResourceExhausted, "%s: exceeded %d byte http.MaxBytesReader limit", prefix, maxBytesErr.Limit) -} diff --git a/vendor/github.com/bufbuild/connect-go/error_writer.go b/vendor/github.com/bufbuild/connect-go/error_writer.go deleted file mode 100644 index 3ce7f34e88..0000000000 --- a/vendor/github.com/bufbuild/connect-go/error_writer.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "encoding/json" - "fmt" - "net/http" - "strings" -) - -// An ErrorWriter writes errors to an [http.ResponseWriter] in the format -// expected by an RPC client. This is especially useful in server-side net/http -// middleware, where you may wish to handle requests from RPC and non-RPC -// clients with the same code. -// -// ErrorWriters are safe to use concurrently. -type ErrorWriter struct { - bufferPool *bufferPool - protobuf Codec - allContentTypes map[string]struct{} - grpcContentTypes map[string]struct{} - grpcWebContentTypes map[string]struct{} - unaryConnectContentTypes map[string]struct{} - streamingConnectContentTypes map[string]struct{} -} - -// NewErrorWriter constructs an ErrorWriter. To properly recognize supported -// RPC Content-Types in net/http middleware, you must pass the same -// HandlerOptions to NewErrorWriter and any wrapped Connect handlers. -func NewErrorWriter(opts ...HandlerOption) *ErrorWriter { - config := newHandlerConfig("", opts) - writer := &ErrorWriter{ - bufferPool: config.BufferPool, - protobuf: newReadOnlyCodecs(config.Codecs).Protobuf(), - allContentTypes: make(map[string]struct{}), - grpcContentTypes: make(map[string]struct{}), - grpcWebContentTypes: make(map[string]struct{}), - unaryConnectContentTypes: make(map[string]struct{}), - streamingConnectContentTypes: make(map[string]struct{}), - } - for name := range config.Codecs { - unary := connectContentTypeFromCodecName(StreamTypeUnary, name) - writer.allContentTypes[unary] = struct{}{} - writer.unaryConnectContentTypes[unary] = struct{}{} - streaming := connectContentTypeFromCodecName(StreamTypeBidi, name) - writer.streamingConnectContentTypes[streaming] = struct{}{} - writer.allContentTypes[streaming] = struct{}{} - } - if config.HandleGRPC { - writer.grpcContentTypes[grpcContentTypeDefault] = struct{}{} - writer.allContentTypes[grpcContentTypeDefault] = struct{}{} - for name := range config.Codecs { - ct := grpcContentTypeFromCodecName(false /* web */, name) - writer.grpcContentTypes[ct] = struct{}{} - writer.allContentTypes[ct] = struct{}{} - } - } - if config.HandleGRPCWeb { - writer.grpcWebContentTypes[grpcWebContentTypeDefault] = struct{}{} - writer.allContentTypes[grpcWebContentTypeDefault] = struct{}{} - for name := range config.Codecs { - ct := grpcContentTypeFromCodecName(true /* web */, name) - writer.grpcWebContentTypes[ct] = struct{}{} - writer.allContentTypes[ct] = struct{}{} - } - } - return writer -} - -// IsSupported checks whether a request is using one of the ErrorWriter's -// supported RPC protocols. -func (w *ErrorWriter) IsSupported(request *http.Request) bool { - ctype := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) - _, ok := w.allContentTypes[ctype] - return ok -} - -// Write an error, using the format appropriate for the RPC protocol in use. -// Callers should first use IsSupported to verify that the request is using one -// of the ErrorWriter's supported RPC protocols. -// -// Write does not read or close the request body. -func (w *ErrorWriter) Write(response http.ResponseWriter, request *http.Request, err error) error { - ctype := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) - if _, ok := w.unaryConnectContentTypes[ctype]; ok { - // Unary errors are always JSON. - setHeaderCanonical(response.Header(), headerContentType, connectUnaryContentTypeJSON) - return w.writeConnectUnary(response, err) - } - if _, ok := w.streamingConnectContentTypes[ctype]; ok { - setHeaderCanonical(response.Header(), headerContentType, ctype) - return w.writeConnectStreaming(response, err) - } - if _, ok := w.grpcContentTypes[ctype]; ok { - setHeaderCanonical(response.Header(), headerContentType, ctype) - return w.writeGRPC(response, err) - } - if _, ok := w.grpcWebContentTypes[ctype]; ok { - setHeaderCanonical(response.Header(), headerContentType, ctype) - return w.writeGRPCWeb(response, err) - } - return fmt.Errorf("unsupported Content-Type %q", ctype) -} - -func (w *ErrorWriter) writeConnectUnary(response http.ResponseWriter, err error) error { - if connectErr, ok := asError(err); ok { - mergeHeaders(response.Header(), connectErr.meta) - } - response.WriteHeader(connectCodeToHTTP(CodeOf(err))) - data, marshalErr := json.Marshal(newConnectWireError(err)) - if marshalErr != nil { - return fmt.Errorf("marshal error: %w", marshalErr) - } - _, writeErr := response.Write(data) - return writeErr -} - -func (w *ErrorWriter) writeConnectStreaming(response http.ResponseWriter, err error) error { - response.WriteHeader(http.StatusOK) - marshaler := &connectStreamingMarshaler{ - envelopeWriter: envelopeWriter{ - writer: response, - bufferPool: w.bufferPool, - }, - } - // MarshalEndStream returns *Error: check return value to avoid typed nils. - if marshalErr := marshaler.MarshalEndStream(err, make(http.Header)); marshalErr != nil { - return marshalErr - } - return nil -} - -func (w *ErrorWriter) writeGRPC(response http.ResponseWriter, err error) error { - trailers := make(http.Header, 2) // need space for at least code & message - grpcErrorToTrailer(trailers, w.protobuf, err) - // To make net/http reliably send trailers without a body, we must set the - // Trailers header rather than using http.TrailerPrefix. See - // https://github.com/golang/go/issues/54723. - keys := make([]string, 0, len(trailers)) - for k := range trailers { - keys = append(keys, k) - } - setHeaderCanonical(response.Header(), headerTrailer, strings.Join(keys, ",")) - response.WriteHeader(http.StatusOK) - mergeHeaders(response.Header(), trailers) - return nil -} - -func (w *ErrorWriter) writeGRPCWeb(response http.ResponseWriter, err error) error { - // This is a trailers-only response. To match the behavior of Envoy and - // protocol_grpc.go, put the trailers in the HTTP headers. - grpcErrorToTrailer(response.Header(), w.protobuf, err) - response.WriteHeader(http.StatusOK) - return nil -} diff --git a/vendor/github.com/bufbuild/connect-go/handler.go b/vendor/github.com/bufbuild/connect-go/handler.go deleted file mode 100644 index 870bdb0753..0000000000 --- a/vendor/github.com/bufbuild/connect-go/handler.go +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "fmt" - "net/http" -) - -// A Handler is the server-side implementation of a single RPC defined by a -// service schema. -// -// By default, Handlers support the Connect, gRPC, and gRPC-Web protocols with -// the binary Protobuf and JSON codecs. They support gzip compression using the -// standard library's [compress/gzip]. -type Handler struct { - spec Spec - implementation StreamingHandlerFunc - protocolHandlers map[string][]protocolHandler // Method to protocol handlers - allowMethod string // Allow header - acceptPost string // Accept-Post header -} - -// NewUnaryHandler constructs a [Handler] for a request-response procedure. -func NewUnaryHandler[Req, Res any]( - procedure string, - unary func(context.Context, *Request[Req]) (*Response[Res], error), - options ...HandlerOption, -) *Handler { - // Wrap the strongly-typed implementation so we can apply interceptors. - untyped := UnaryFunc(func(ctx context.Context, request AnyRequest) (AnyResponse, error) { - if err := ctx.Err(); err != nil { - return nil, err - } - typed, ok := request.(*Request[Req]) - if !ok { - return nil, errorf(CodeInternal, "unexpected handler request type %T", request) - } - res, err := unary(ctx, typed) - if res == nil && err == nil { - // This is going to panic during serialization. Debugging is much easier - // if we panic here instead, so we can include the procedure name. - panic(fmt.Sprintf("%s returned nil *connect.Response and nil error", procedure)) //nolint: forbidigo - } - return res, err - }) - config := newHandlerConfig(procedure, options) - if interceptor := config.Interceptor; interceptor != nil { - untyped = interceptor.WrapUnary(untyped) - } - // Given a stream, how should we call the unary function? - implementation := func(ctx context.Context, conn StreamingHandlerConn) error { - var msg Req - if err := conn.Receive(&msg); err != nil { - return err - } - method := http.MethodPost - if hasRequestMethod, ok := conn.(interface{ getHTTPMethod() string }); ok { - method = hasRequestMethod.getHTTPMethod() - } - request := &Request[Req]{ - Msg: &msg, - spec: conn.Spec(), - peer: conn.Peer(), - header: conn.RequestHeader(), - method: method, - } - response, err := untyped(ctx, request) - if err != nil { - return err - } - mergeHeaders(conn.ResponseHeader(), response.Header()) - mergeHeaders(conn.ResponseTrailer(), response.Trailer()) - return conn.Send(response.Any()) - } - - protocolHandlers := config.newProtocolHandlers(StreamTypeUnary) - return &Handler{ - spec: config.newSpec(StreamTypeUnary), - implementation: implementation, - protocolHandlers: mappedMethodHandlers(protocolHandlers), - allowMethod: sortedAllowMethodValue(protocolHandlers), - acceptPost: sortedAcceptPostValue(protocolHandlers), - } -} - -// NewClientStreamHandler constructs a [Handler] for a client streaming procedure. -func NewClientStreamHandler[Req, Res any]( - procedure string, - implementation func(context.Context, *ClientStream[Req]) (*Response[Res], error), - options ...HandlerOption, -) *Handler { - return newStreamHandler( - procedure, - StreamTypeClient, - func(ctx context.Context, conn StreamingHandlerConn) error { - stream := &ClientStream[Req]{conn: conn} - res, err := implementation(ctx, stream) - if err != nil { - return err - } - if res == nil { - // This is going to panic during serialization. Debugging is much easier - // if we panic here instead, so we can include the procedure name. - panic(fmt.Sprintf("%s returned nil *connect.Response and nil error", procedure)) //nolint: forbidigo - } - mergeHeaders(conn.ResponseHeader(), res.header) - mergeHeaders(conn.ResponseTrailer(), res.trailer) - return conn.Send(res.Msg) - }, - options..., - ) -} - -// NewServerStreamHandler constructs a [Handler] for a server streaming procedure. -func NewServerStreamHandler[Req, Res any]( - procedure string, - implementation func(context.Context, *Request[Req], *ServerStream[Res]) error, - options ...HandlerOption, -) *Handler { - return newStreamHandler( - procedure, - StreamTypeServer, - func(ctx context.Context, conn StreamingHandlerConn) error { - var msg Req - if err := conn.Receive(&msg); err != nil { - return err - } - return implementation( - ctx, - &Request[Req]{ - Msg: &msg, - spec: conn.Spec(), - peer: conn.Peer(), - header: conn.RequestHeader(), - method: http.MethodPost, - }, - &ServerStream[Res]{conn: conn}, - ) - }, - options..., - ) -} - -// NewBidiStreamHandler constructs a [Handler] for a bidirectional streaming procedure. -func NewBidiStreamHandler[Req, Res any]( - procedure string, - implementation func(context.Context, *BidiStream[Req, Res]) error, - options ...HandlerOption, -) *Handler { - return newStreamHandler( - procedure, - StreamTypeBidi, - func(ctx context.Context, conn StreamingHandlerConn) error { - return implementation( - ctx, - &BidiStream[Req, Res]{conn: conn}, - ) - }, - options..., - ) -} - -// ServeHTTP implements [http.Handler]. -func (h *Handler) ServeHTTP(responseWriter http.ResponseWriter, request *http.Request) { - // We don't need to defer functions to close the request body or read to - // EOF: the stream we construct later on already does that, and we only - // return early when dealing with misbehaving clients. In those cases, it's - // okay if we can't re-use the connection. - isBidi := (h.spec.StreamType & StreamTypeBidi) == StreamTypeBidi - if isBidi && request.ProtoMajor < 2 { - // Clients coded to expect full-duplex connections may hang if they've - // mistakenly negotiated HTTP/1.1. To unblock them, we must close the - // underlying TCP connection. - responseWriter.Header().Set("Connection", "close") - responseWriter.WriteHeader(http.StatusHTTPVersionNotSupported) - return - } - - protocolHandlers := h.protocolHandlers[request.Method] - if len(protocolHandlers) == 0 { - responseWriter.Header().Set("Allow", h.allowMethod) - responseWriter.WriteHeader(http.StatusMethodNotAllowed) - return - } - - contentType := canonicalizeContentType(getHeaderCanonical(request.Header, headerContentType)) - - // Find our implementation of the RPC protocol in use. - var protocolHandler protocolHandler - for _, handler := range protocolHandlers { - if handler.CanHandlePayload(request, contentType) { - protocolHandler = handler - break - } - } - if protocolHandler == nil { - responseWriter.Header().Set("Accept-Post", h.acceptPost) - responseWriter.WriteHeader(http.StatusUnsupportedMediaType) - return - } - - // Establish a stream and serve the RPC. - setHeaderCanonical(request.Header, headerContentType, contentType) - setHeaderCanonical(request.Header, headerHost, request.Host) - ctx, cancel, timeoutErr := protocolHandler.SetTimeout(request) //nolint: contextcheck - if timeoutErr != nil { - ctx = request.Context() - } - if cancel != nil { - defer cancel() - } - connCloser, ok := protocolHandler.NewConn( - responseWriter, - request.WithContext(ctx), - ) - if !ok { - // Failed to create stream, usually because client used an unknown - // compression algorithm. Nothing further to do. - return - } - if timeoutErr != nil { - _ = connCloser.Close(timeoutErr) - return - } - _ = connCloser.Close(h.implementation(ctx, connCloser)) -} - -type handlerConfig struct { - CompressionPools map[string]*compressionPool - CompressionNames []string - Codecs map[string]Codec - CompressMinBytes int - Interceptor Interceptor - Procedure string - HandleGRPC bool - HandleGRPCWeb bool - RequireConnectProtocolHeader bool - IdempotencyLevel IdempotencyLevel - BufferPool *bufferPool - ReadMaxBytes int - SendMaxBytes int -} - -func newHandlerConfig(procedure string, options []HandlerOption) *handlerConfig { - protoPath := extractProtoPath(procedure) - config := handlerConfig{ - Procedure: protoPath, - CompressionPools: make(map[string]*compressionPool), - Codecs: make(map[string]Codec), - HandleGRPC: true, - HandleGRPCWeb: true, - BufferPool: newBufferPool(), - } - withProtoBinaryCodec().applyToHandler(&config) - withProtoJSONCodecs().applyToHandler(&config) - withGzip().applyToHandler(&config) - for _, opt := range options { - opt.applyToHandler(&config) - } - return &config -} - -func (c *handlerConfig) newSpec(streamType StreamType) Spec { - return Spec{ - Procedure: c.Procedure, - StreamType: streamType, - IdempotencyLevel: c.IdempotencyLevel, - } -} - -func (c *handlerConfig) newProtocolHandlers(streamType StreamType) []protocolHandler { - protocols := []protocol{&protocolConnect{}} - if c.HandleGRPC { - protocols = append(protocols, &protocolGRPC{web: false}) - } - if c.HandleGRPCWeb { - protocols = append(protocols, &protocolGRPC{web: true}) - } - handlers := make([]protocolHandler, 0, len(protocols)) - codecs := newReadOnlyCodecs(c.Codecs) - compressors := newReadOnlyCompressionPools( - c.CompressionPools, - c.CompressionNames, - ) - for _, protocol := range protocols { - handlers = append(handlers, protocol.NewHandler(&protocolHandlerParams{ - Spec: c.newSpec(streamType), - Codecs: codecs, - CompressionPools: compressors, - CompressMinBytes: c.CompressMinBytes, - BufferPool: c.BufferPool, - ReadMaxBytes: c.ReadMaxBytes, - SendMaxBytes: c.SendMaxBytes, - RequireConnectProtocolHeader: c.RequireConnectProtocolHeader, - IdempotencyLevel: c.IdempotencyLevel, - })) - } - return handlers -} - -func newStreamHandler( - procedure string, - streamType StreamType, - implementation StreamingHandlerFunc, - options ...HandlerOption, -) *Handler { - config := newHandlerConfig(procedure, options) - if ic := config.Interceptor; ic != nil { - implementation = ic.WrapStreamingHandler(implementation) - } - protocolHandlers := config.newProtocolHandlers(streamType) - return &Handler{ - spec: config.newSpec(streamType), - implementation: implementation, - protocolHandlers: mappedMethodHandlers(protocolHandlers), - allowMethod: sortedAllowMethodValue(protocolHandlers), - acceptPost: sortedAcceptPostValue(protocolHandlers), - } -} diff --git a/vendor/github.com/bufbuild/connect-go/handler_stream.go b/vendor/github.com/bufbuild/connect-go/handler_stream.go deleted file mode 100644 index 00e2833535..0000000000 --- a/vendor/github.com/bufbuild/connect-go/handler_stream.go +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "errors" - "io" - "net/http" -) - -// ClientStream is the handler's view of a client streaming RPC. -// -// It's constructed as part of [Handler] invocation, but doesn't currently have -// an exported constructor. -type ClientStream[Req any] struct { - conn StreamingHandlerConn - msg *Req - err error -} - -// Spec returns the specification for the RPC. -func (c *ClientStream[_]) Spec() Spec { - return c.conn.Spec() -} - -// Peer describes the client for this RPC. -func (c *ClientStream[_]) Peer() Peer { - return c.conn.Peer() -} - -// RequestHeader returns the headers received from the client. -func (c *ClientStream[Req]) RequestHeader() http.Header { - return c.conn.RequestHeader() -} - -// Receive advances the stream to the next message, which will then be -// available through the Msg method. It returns false when the stream stops, -// either by reaching the end or by encountering an unexpected error. After -// Receive returns false, the Err method will return any unexpected error -// encountered. -func (c *ClientStream[Req]) Receive() bool { - if c.err != nil { - return false - } - c.msg = new(Req) - c.err = c.conn.Receive(c.msg) - return c.err == nil -} - -// Msg returns the most recent message unmarshaled by a call to Receive. -func (c *ClientStream[Req]) Msg() *Req { - if c.msg == nil { - c.msg = new(Req) - } - return c.msg -} - -// Err returns the first non-EOF error that was encountered by Receive. -func (c *ClientStream[Req]) Err() error { - if c.err == nil || errors.Is(c.err, io.EOF) { - return nil - } - return c.err -} - -// Conn exposes the underlying StreamingHandlerConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (c *ClientStream[Req]) Conn() StreamingHandlerConn { - return c.conn -} - -// ServerStream is the handler's view of a server streaming RPC. -// -// It's constructed as part of [Handler] invocation, but doesn't currently have -// an exported constructor. -type ServerStream[Res any] struct { - conn StreamingHandlerConn -} - -// ResponseHeader returns the response headers. Headers are sent with the first -// call to Send. -// -// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (s *ServerStream[Res]) ResponseHeader() http.Header { - return s.conn.ResponseHeader() -} - -// ResponseTrailer returns the response trailers. Handlers may write to the -// response trailers at any time before returning. -// -// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (s *ServerStream[Res]) ResponseTrailer() http.Header { - return s.conn.ResponseTrailer() -} - -// Send a message to the client. The first call to Send also sends the response -// headers. -func (s *ServerStream[Res]) Send(msg *Res) error { - if msg == nil { - return s.conn.Send(nil) - } - return s.conn.Send(msg) -} - -// Conn exposes the underlying StreamingHandlerConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (s *ServerStream[Res]) Conn() StreamingHandlerConn { - return s.conn -} - -// BidiStream is the handler's view of a bidirectional streaming RPC. -// -// It's constructed as part of [Handler] invocation, but doesn't currently have -// an exported constructor. -type BidiStream[Req, Res any] struct { - conn StreamingHandlerConn -} - -// Spec returns the specification for the RPC. -func (b *BidiStream[_, _]) Spec() Spec { - return b.conn.Spec() -} - -// Peer describes the client for this RPC. -func (b *BidiStream[_, _]) Peer() Peer { - return b.conn.Peer() -} - -// RequestHeader returns the headers received from the client. -func (b *BidiStream[Req, Res]) RequestHeader() http.Header { - return b.conn.RequestHeader() -} - -// Receive a message. When the client is done sending messages, Receive will -// return an error that wraps [io.EOF]. -func (b *BidiStream[Req, Res]) Receive() (*Req, error) { - var req Req - if err := b.conn.Receive(&req); err != nil { - return nil, err - } - return &req, nil -} - -// ResponseHeader returns the response headers. Headers are sent with the first -// call to Send. -// -// Headers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (b *BidiStream[Req, Res]) ResponseHeader() http.Header { - return b.conn.ResponseHeader() -} - -// ResponseTrailer returns the response trailers. Handlers may write to the -// response trailers at any time before returning. -// -// Trailers beginning with "Connect-" and "Grpc-" are reserved for use by the -// Connect and gRPC protocols. Applications shouldn't write them. -func (b *BidiStream[Req, Res]) ResponseTrailer() http.Header { - return b.conn.ResponseTrailer() -} - -// Send a message to the client. The first call to Send also sends the response -// headers. -func (b *BidiStream[Req, Res]) Send(msg *Res) error { - if msg == nil { - return b.conn.Send(nil) - } - return b.conn.Send(msg) -} - -// Conn exposes the underlying StreamingHandlerConn. This may be useful if -// you'd prefer to wrap the connection in a different high-level API. -func (b *BidiStream[Req, Res]) Conn() StreamingHandlerConn { - return b.conn -} diff --git a/vendor/github.com/bufbuild/connect-go/header.go b/vendor/github.com/bufbuild/connect-go/header.go deleted file mode 100644 index f827aba296..0000000000 --- a/vendor/github.com/bufbuild/connect-go/header.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "encoding/base64" - "net/http" -) - -// EncodeBinaryHeader base64-encodes the data. It always emits unpadded values. -// -// In the Connect, gRPC, and gRPC-Web protocols, binary headers must have keys -// ending in "-Bin". -func EncodeBinaryHeader(data []byte) string { - // gRPC specification says that implementations should emit unpadded values. - return base64.RawStdEncoding.EncodeToString(data) -} - -// DecodeBinaryHeader base64-decodes the data. It can decode padded or unpadded -// values. Following usual HTTP semantics, multiple base64-encoded values may -// be joined with a comma. When receiving such comma-separated values, split -// them with [strings.Split] before calling DecodeBinaryHeader. -// -// Binary headers sent using the Connect, gRPC, and gRPC-Web protocols have -// keys ending in "-Bin". -func DecodeBinaryHeader(data string) ([]byte, error) { - if len(data)%4 != 0 { - // Data definitely isn't padded. - return base64.RawStdEncoding.DecodeString(data) - } - // Either the data was padded, or padding wasn't necessary. In both cases, - // the padding-aware decoder works. - return base64.StdEncoding.DecodeString(data) -} - -func mergeHeaders(into, from http.Header) { - for k, vals := range from { - into[k] = append(into[k], vals...) - } -} - -// getHeaderCanonical is a shortcut for Header.Get() which -// bypasses the CanonicalMIMEHeaderKey operation when we -// know the key is already in canonical form. -func getHeaderCanonical(h http.Header, key string) string { - if h == nil { - return "" - } - v := h[key] - if len(v) == 0 { - return "" - } - return v[0] -} - -// setHeaderCanonical is a shortcut for Header.Set() which -// bypasses the CanonicalMIMEHeaderKey operation when we -// know the key is already in canonical form. -func setHeaderCanonical(h http.Header, key, value string) { - h[key] = []string{value} -} - -// delHeaderCanonical is a shortcut for Header.Del() which -// bypasses the CanonicalMIMEHeaderKey operation when we -// know the key is already in canonical form. -func delHeaderCanonical(h http.Header, key string) { - delete(h, key) -} - -// addHeaderCanonical is a shortcut for Header.Add() which -// bypasses the CanonicalMIMEHeaderKey operation when we -// know the key is already in canonical form. -func addHeaderCanonical(h http.Header, key, value string) { - h[key] = append(h[key], value) -} diff --git a/vendor/github.com/bufbuild/connect-go/idempotency_level.go b/vendor/github.com/bufbuild/connect-go/idempotency_level.go deleted file mode 100644 index 6428d67e31..0000000000 --- a/vendor/github.com/bufbuild/connect-go/idempotency_level.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import "fmt" - -// An IdempotencyLevel is a value that declares how "idempotent" an RPC is. This -// value can affect RPC behaviors, such as determining whether it is safe to -// retry a request, or what kinds of request modalities are allowed for a given -// procedure. -type IdempotencyLevel int - -// NOTE: For simplicity, these should be kept in sync with the values of the -// google.protobuf.MethodOptions.IdempotencyLevel enumeration. - -const ( - // IdempotencyUnknown is the default idempotency level. A procedure with - // this idempotency level may not be idempotent. This is appropriate for - // any kind of procedure. - IdempotencyUnknown IdempotencyLevel = 0 - - // IdempotencyNoSideEffects is the idempotency level that specifies that a - // given call has no side-effects. This is equivalent to [RFC 9110 § 9.2.1] - // "safe" methods in terms of semantics. This procedure should not mutate - // any state. This idempotency level is appropriate for queries, or anything - // that would be suitable for an HTTP GET request. In addition, due to the - // lack of side-effects, such a procedure would be suitable to retry and - // expect that the results will not be altered by preceding attempts. - // - // [RFC 9110 § 9.2.1]: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.1 - IdempotencyNoSideEffects IdempotencyLevel = 1 - - // IdempotencyIdempotent is the idempotency level that specifies that a - // given call is "idempotent", such that multiple instances of the same - // request to this procedure would have the same side-effects as a single - // request. This is equivalent to [RFC 9110 § 9.2.2] "idempotent" methods. - // This level is a subset of the previous level. This idempotency level is - // appropriate for any procedure that is safe to retry multiple times - // and be guaranteed that the response and side-effects will not be altered - // as a result of multiple attempts, for example, entity deletion requests. - // - // [RFC 9110 § 9.2.2]: https://www.rfc-editor.org/rfc/rfc9110.html#section-9.2.2 - IdempotencyIdempotent IdempotencyLevel = 2 -) - -func (i IdempotencyLevel) String() string { - switch i { - case IdempotencyUnknown: - return "idempotency_unknown" - case IdempotencyNoSideEffects: - return "no_side_effects" - case IdempotencyIdempotent: - return "idempotent" - } - return fmt.Sprintf("idempotency_%d", i) -} diff --git a/vendor/github.com/bufbuild/connect-go/interceptor.go b/vendor/github.com/bufbuild/connect-go/interceptor.go deleted file mode 100644 index 7ffe19d505..0000000000 --- a/vendor/github.com/bufbuild/connect-go/interceptor.go +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" -) - -// UnaryFunc is the generic signature of a unary RPC. Interceptors may wrap -// Funcs. -// -// The type of the request and response structs depend on the codec being used. -// When using Protobuf, request.Any() and response.Any() will always be -// [proto.Message] implementations. -type UnaryFunc func(context.Context, AnyRequest) (AnyResponse, error) - -// StreamingClientFunc is the generic signature of a streaming RPC from the client's -// perspective. Interceptors may wrap StreamingClientFuncs. -type StreamingClientFunc func(context.Context, Spec) StreamingClientConn - -// StreamingHandlerFunc is the generic signature of a streaming RPC from the -// handler's perspective. Interceptors may wrap StreamingHandlerFuncs. -type StreamingHandlerFunc func(context.Context, StreamingHandlerConn) error - -// An Interceptor adds logic to a generated handler or client, like the -// decorators or middleware you may have seen in other libraries. Interceptors -// may replace the context, mutate requests and responses, handle errors, -// retry, recover from panics, emit logs and metrics, or do nearly anything -// else. -// -// The returned functions must be safe to call concurrently. -type Interceptor interface { - WrapUnary(UnaryFunc) UnaryFunc - WrapStreamingClient(StreamingClientFunc) StreamingClientFunc - WrapStreamingHandler(StreamingHandlerFunc) StreamingHandlerFunc -} - -// UnaryInterceptorFunc is a simple Interceptor implementation that only -// wraps unary RPCs. It has no effect on streaming RPCs. -type UnaryInterceptorFunc func(UnaryFunc) UnaryFunc - -// WrapUnary implements [Interceptor] by applying the interceptor function. -func (f UnaryInterceptorFunc) WrapUnary(next UnaryFunc) UnaryFunc { return f(next) } - -// WrapStreamingClient implements [Interceptor] with a no-op. -func (f UnaryInterceptorFunc) WrapStreamingClient(next StreamingClientFunc) StreamingClientFunc { - return next -} - -// WrapStreamingHandler implements [Interceptor] with a no-op. -func (f UnaryInterceptorFunc) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { - return next -} - -// A chain composes multiple interceptors into one. -type chain struct { - interceptors []Interceptor -} - -// newChain composes multiple interceptors into one. -func newChain(interceptors []Interceptor) *chain { - // We usually wrap in reverse order to have the first interceptor from - // the slice act first. Rather than doing this dance repeatedly, reverse the - // interceptor order now. - var chain chain - for i := len(interceptors) - 1; i >= 0; i-- { - if interceptor := interceptors[i]; interceptor != nil { - chain.interceptors = append(chain.interceptors, interceptor) - } - } - return &chain -} - -func (c *chain) WrapUnary(next UnaryFunc) UnaryFunc { - for _, interceptor := range c.interceptors { - next = interceptor.WrapUnary(next) - } - return next -} - -func (c *chain) WrapStreamingClient(next StreamingClientFunc) StreamingClientFunc { - for _, interceptor := range c.interceptors { - next = interceptor.WrapStreamingClient(next) - } - return next -} - -func (c *chain) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { - for _, interceptor := range c.interceptors { - next = interceptor.WrapStreamingHandler(next) - } - return next -} diff --git a/vendor/github.com/bufbuild/connect-go/internal/gen/connectext/grpc/status/v1/status.pb.go b/vendor/github.com/bufbuild/connect-go/internal/gen/connectext/grpc/status/v1/status.pb.go deleted file mode 100644 index 5b52c4f3b4..0000000000 --- a/vendor/github.com/bufbuild/connect-go/internal/gen/connectext/grpc/status/v1/status.pb.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc (unknown) -// source: connectext/grpc/status/v1/status.proto - -// This package is for internal use by Connect, and provides no backward -// compatibility guarantees whatsoever. - -package statusv1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// See https://cloud.google.com/apis/design/errors. -// -// This struct must remain binary-compatible with -// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto. -type Status struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // a google.rpc.Code - Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // developer-facing, English (localize in details or client-side) - Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` -} - -func (x *Status) Reset() { - *x = Status{} - if protoimpl.UnsafeEnabled { - mi := &file_connectext_grpc_status_v1_status_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Status) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Status) ProtoMessage() {} - -func (x *Status) ProtoReflect() protoreflect.Message { - mi := &file_connectext_grpc_status_v1_status_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Status.ProtoReflect.Descriptor instead. -func (*Status) Descriptor() ([]byte, []int) { - return file_connectext_grpc_status_v1_status_proto_rawDescGZIP(), []int{0} -} - -func (x *Status) GetCode() int32 { - if x != nil { - return x.Code - } - return 0 -} - -func (x *Status) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *Status) GetDetails() []*anypb.Any { - if x != nil { - return x.Details - } - return nil -} - -var File_connectext_grpc_status_v1_status_proto protoreflect.FileDescriptor - -var file_connectext_grpc_status_v1_status_proto_rawDesc = []byte{ - 0x0a, 0x26, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x64, - 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0xcb, 0x01, 0x0a, 0x12, - 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, - 0x76, 0x31, 0x42, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, - 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x75, - 0x66, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x2d, 0x67, - 0x6f, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, - 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x47, 0x53, 0x58, 0xaa, 0x02, 0x0e, 0x47, 0x72, 0x70, 0x63, 0x2e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x47, 0x72, 0x70, 0x63, 0x5c, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x47, 0x72, 0x70, 0x63, - 0x5c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x47, 0x72, 0x70, 0x63, 0x3a, 0x3a, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_connectext_grpc_status_v1_status_proto_rawDescOnce sync.Once - file_connectext_grpc_status_v1_status_proto_rawDescData = file_connectext_grpc_status_v1_status_proto_rawDesc -) - -func file_connectext_grpc_status_v1_status_proto_rawDescGZIP() []byte { - file_connectext_grpc_status_v1_status_proto_rawDescOnce.Do(func() { - file_connectext_grpc_status_v1_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_connectext_grpc_status_v1_status_proto_rawDescData) - }) - return file_connectext_grpc_status_v1_status_proto_rawDescData -} - -var file_connectext_grpc_status_v1_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_connectext_grpc_status_v1_status_proto_goTypes = []interface{}{ - (*Status)(nil), // 0: grpc.status.v1.Status - (*anypb.Any)(nil), // 1: google.protobuf.Any -} -var file_connectext_grpc_status_v1_status_proto_depIdxs = []int32{ - 1, // 0: grpc.status.v1.Status.details:type_name -> google.protobuf.Any - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_connectext_grpc_status_v1_status_proto_init() } -func file_connectext_grpc_status_v1_status_proto_init() { - if File_connectext_grpc_status_v1_status_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_connectext_grpc_status_v1_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Status); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_connectext_grpc_status_v1_status_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_connectext_grpc_status_v1_status_proto_goTypes, - DependencyIndexes: file_connectext_grpc_status_v1_status_proto_depIdxs, - MessageInfos: file_connectext_grpc_status_v1_status_proto_msgTypes, - }.Build() - File_connectext_grpc_status_v1_status_proto = out.File - file_connectext_grpc_status_v1_status_proto_rawDesc = nil - file_connectext_grpc_status_v1_status_proto_goTypes = nil - file_connectext_grpc_status_v1_status_proto_depIdxs = nil -} diff --git a/vendor/github.com/bufbuild/connect-go/option.go b/vendor/github.com/bufbuild/connect-go/option.go deleted file mode 100644 index b7d73e25a4..0000000000 --- a/vendor/github.com/bufbuild/connect-go/option.go +++ /dev/null @@ -1,559 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "compress/gzip" - "context" - "io" - "net/http" -) - -// A ClientOption configures a [Client]. -// -// In addition to any options grouped in the documentation below, remember that -// any [Option] is also a valid ClientOption. -type ClientOption interface { - applyToClient(*clientConfig) -} - -// WithAcceptCompression makes a compression algorithm available to a client. -// Clients ask servers to compress responses using any of the registered -// algorithms. The first registered algorithm is treated as the least -// preferred, and the last registered algorithm is the most preferred. -// -// It's safe to use this option liberally: servers will ignore any -// compression algorithms they don't support. To compress requests, pair this -// option with [WithSendCompression]. To remove support for a -// previously-registered compression algorithm, use WithAcceptCompression with -// nil decompressor and compressor constructors. -// -// Clients accept gzipped responses by default, using a compressor backed by the -// standard library's [gzip] package with the default compression level. Use -// [WithSendGzip] to compress requests with gzip. -// -// Calling WithAcceptCompression with an empty name is a no-op. -func WithAcceptCompression( - name string, - newDecompressor func() Decompressor, - newCompressor func() Compressor, -) ClientOption { - return &compressionOption{ - Name: name, - CompressionPool: newCompressionPool(newDecompressor, newCompressor), - } -} - -// WithClientOptions composes multiple ClientOptions into one. -func WithClientOptions(options ...ClientOption) ClientOption { - return &clientOptionsOption{options} -} - -// WithGRPC configures clients to use the HTTP/2 gRPC protocol. -func WithGRPC() ClientOption { - return &grpcOption{web: false} -} - -// WithGRPCWeb configures clients to use the gRPC-Web protocol. -func WithGRPCWeb() ClientOption { - return &grpcOption{web: true} -} - -// WithProtoJSON configures a client to send JSON-encoded data instead of -// binary Protobuf. It uses the standard Protobuf JSON mapping as implemented -// by [google.golang.org/protobuf/encoding/protojson]: fields are named using -// lowerCamelCase, zero values are omitted, missing required fields are errors, -// enums are emitted as strings, etc. -func WithProtoJSON() ClientOption { - return WithCodec(&protoJSONCodec{codecNameJSON}) -} - -// WithSendCompression configures the client to use the specified algorithm to -// compress request messages. If the algorithm has not been registered using -// [WithAcceptCompression], the client will return errors at runtime. -// -// Because some servers don't support compression, clients default to sending -// uncompressed requests. -func WithSendCompression(name string) ClientOption { - return &sendCompressionOption{Name: name} -} - -// WithSendGzip configures the client to gzip requests. Since clients have -// access to a gzip compressor by default, WithSendGzip doesn't require -// [WithSendCompression]. -// -// Some servers don't support gzip, so clients default to sending uncompressed -// requests. -func WithSendGzip() ClientOption { - return WithSendCompression(compressionGzip) -} - -// A HandlerOption configures a [Handler]. -// -// In addition to any options grouped in the documentation below, remember that -// any [Option] is also a HandlerOption. -type HandlerOption interface { - applyToHandler(*handlerConfig) -} - -// WithCompression configures handlers to support a compression algorithm. -// Clients may send messages compressed with that algorithm and/or request -// compressed responses. The [Compressor] and [Decompressor] produced by the -// supplied constructors must use the same algorithm. Internally, Connect pools -// compressors and decompressors. -// -// By default, handlers support gzip using the standard library's -// [compress/gzip] package at the default compression level. To remove support for -// a previously-registered compression algorithm, use WithCompression with nil -// decompressor and compressor constructors. -// -// Calling WithCompression with an empty name is a no-op. -func WithCompression( - name string, - newDecompressor func() Decompressor, - newCompressor func() Compressor, -) HandlerOption { - return &compressionOption{ - Name: name, - CompressionPool: newCompressionPool(newDecompressor, newCompressor), - } -} - -// WithHandlerOptions composes multiple HandlerOptions into one. -func WithHandlerOptions(options ...HandlerOption) HandlerOption { - return &handlerOptionsOption{options} -} - -// WithRecover adds an interceptor that recovers from panics. The supplied -// function receives the context, [Spec], request headers, and the recovered -// value (which may be nil). It must return an error to send back to the -// client. It may also log the panic, emit metrics, or execute other -// error-handling logic. Handler functions must be safe to call concurrently. -// -// To preserve compatibility with [net/http]'s semantics, this interceptor -// doesn't handle panics with [http.ErrAbortHandler]. -// -// By default, handlers don't recover from panics. Because the standard -// library's [http.Server] recovers from panics by default, this option isn't -// usually necessary to prevent crashes. Instead, it helps servers collect -// RPC-specific data during panics and send a more detailed error to -// clients. -func WithRecover(handle func(context.Context, Spec, http.Header, any) error) HandlerOption { - return WithInterceptors(&recoverHandlerInterceptor{handle: handle}) -} - -// WithRequireConnectProtocolHeader configures the Handler to require requests -// using the Connect RPC protocol to include the Connect-Protocol-Version -// header. This ensures that HTTP proxies and net/http middleware can easily -// identify valid Connect requests, even if they use a common Content-Type like -// application/json. However, it makes ad-hoc requests with tools like cURL -// more laborious. -// -// This option has no effect if the client uses the gRPC or gRPC-Web protocols. -func WithRequireConnectProtocolHeader() HandlerOption { - return &requireConnectProtocolHeaderOption{} -} - -// Option implements both [ClientOption] and [HandlerOption], so it can be -// applied both client-side and server-side. -type Option interface { - ClientOption - HandlerOption -} - -// WithCodec registers a serialization method with a client or handler. -// Handlers may have multiple codecs registered, and use whichever the client -// chooses. Clients may only have a single codec. -// -// By default, handlers and clients support binary Protocol Buffer data using -// [google.golang.org/protobuf/proto]. Handlers also support JSON by default, -// using the standard Protobuf JSON mapping. Users with more specialized needs -// may override the default codecs by registering a new codec under the "proto" -// or "json" names. When supplying a custom "proto" codec, keep in mind that -// some unexported, protocol-specific messages are serialized using Protobuf - -// take care to fall back to the standard Protobuf implementation if -// necessary. -// -// Registering a codec with an empty name is a no-op. -func WithCodec(codec Codec) Option { - return &codecOption{Codec: codec} -} - -// WithCompressMinBytes sets a minimum size threshold for compression: -// regardless of compressor configuration, messages smaller than the configured -// minimum are sent uncompressed. -// -// The default minimum is zero. Setting a minimum compression threshold may -// improve overall performance, because the CPU cost of compressing very small -// messages usually isn't worth the small reduction in network I/O. -func WithCompressMinBytes(min int) Option { - return &compressMinBytesOption{Min: min} -} - -// WithReadMaxBytes limits the performance impact of pathologically large -// messages sent by the other party. For handlers, WithReadMaxBytes limits the size -// of a message that the client can send. For clients, WithReadMaxBytes limits the -// size of a message that the server can respond with. Limits apply to each Protobuf -// message, not to the stream as a whole. -// -// Setting WithReadMaxBytes to zero allows any message size. Both clients and -// handlers default to allowing any request size. -// -// Handlers may also use [http.MaxBytesHandler] to limit the total size of the -// HTTP request stream (rather than the per-message size). Connect handles -// [http.MaxBytesError] specially, so clients still receive errors with the -// appropriate error code and informative messages. -func WithReadMaxBytes(max int) Option { - return &readMaxBytesOption{Max: max} -} - -// WithSendMaxBytes prevents sending messages too large for the client/handler -// to handle without significant performance overhead. For handlers, WithSendMaxBytes -// limits the size of a message that the handler can respond with. For clients, -// WithSendMaxBytes limits the size of a message that the client can send. Limits -// apply to each message, not to the stream as a whole. -// -// Setting WithSendMaxBytes to zero allows any message size. Both clients and -// handlers default to allowing any message size. -func WithSendMaxBytes(max int) Option { - return &sendMaxBytesOption{Max: max} -} - -// WithIdempotency declares the idempotency of the procedure. This can determine -// whether a procedure call can safely be retried, and may affect which request -// modalities are allowed for a given procedure call. -// -// In most cases, you should not need to manually set this. It is normally set -// by the code generator for your schema. For protobuf schemas, it can be set like this: -// -// rpc Ping(PingRequest) returns (PingResponse) { -// option idempotency_level = NO_SIDE_EFFECTS; -// } -func WithIdempotency(idempotencyLevel IdempotencyLevel) Option { - return &idempotencyOption{idempotencyLevel: idempotencyLevel} -} - -// WithHTTPGet allows Connect-protocol clients to use HTTP GET requests for -// side-effect free unary RPC calls. Typically, the service schema indicates -// which procedures are idempotent (see [WithIdempotency] for an example -// protobuf schema). The gRPC and gRPC-Web protocols are POST-only, so this -// option has no effect when combined with [WithGRPC] or [WithGRPCWeb]. -// -// Using HTTP GET requests makes it easier to take advantage of CDNs, caching -// reverse proxies, and browsers' built-in caching. Note, however, that servers -// don't automatically set any cache headers; you can set cache headers using -// interceptors or by adding headers in individual procedure implementations. -// -// By default, all requests are made as HTTP POSTs. -func WithHTTPGet() ClientOption { - return &enableGet{} -} - -// WithInterceptors configures a client or handler's interceptor stack. Repeated -// WithInterceptors options are applied in order, so -// -// WithInterceptors(A) + WithInterceptors(B, C) == WithInterceptors(A, B, C) -// -// Unary interceptors compose like an onion. The first interceptor provided is -// the outermost layer of the onion: it acts first on the context and request, -// and last on the response and error. -// -// Stream interceptors also behave like an onion: the first interceptor -// provided is the outermost wrapper for the [StreamingClientConn] or -// [StreamingHandlerConn]. It's the first to see sent messages and the last to -// see received messages. -// -// Applied to client and handler, WithInterceptors(A, B, ..., Y, Z) produces: -// -// client.Send() client.Receive() -// | ^ -// v | -// A --- --- A -// B --- --- B -// : ... ... : -// Y --- --- Y -// Z --- --- Z -// | ^ -// v | -// = = = = = = = = = = = = = = = = -// network -// = = = = = = = = = = = = = = = = -// | ^ -// v | -// A --- --- A -// B --- --- B -// : ... ... : -// Y --- --- Y -// Z --- --- Z -// | ^ -// v | -// handler.Receive() handler.Send() -// | ^ -// | | -// '-> handler logic >-' -// -// Note that in clients, Send handles the request message(s) and Receive -// handles the response message(s). For handlers, it's the reverse. Depending -// on your interceptor's logic, you may need to wrap one method in clients and -// the other in handlers. -func WithInterceptors(interceptors ...Interceptor) Option { - return &interceptorsOption{interceptors} -} - -// WithOptions composes multiple Options into one. -func WithOptions(options ...Option) Option { - return &optionsOption{options} -} - -type clientOptionsOption struct { - options []ClientOption -} - -func (o *clientOptionsOption) applyToClient(config *clientConfig) { - for _, option := range o.options { - option.applyToClient(config) - } -} - -type codecOption struct { - Codec Codec -} - -func (o *codecOption) applyToClient(config *clientConfig) { - if o.Codec == nil || o.Codec.Name() == "" { - return - } - config.Codec = o.Codec -} - -func (o *codecOption) applyToHandler(config *handlerConfig) { - if o.Codec == nil || o.Codec.Name() == "" { - return - } - config.Codecs[o.Codec.Name()] = o.Codec -} - -type compressionOption struct { - Name string - CompressionPool *compressionPool -} - -func (o *compressionOption) applyToClient(config *clientConfig) { - o.apply(&config.CompressionNames, config.CompressionPools) -} - -func (o *compressionOption) applyToHandler(config *handlerConfig) { - o.apply(&config.CompressionNames, config.CompressionPools) -} - -func (o *compressionOption) apply(configuredNames *[]string, configuredPools map[string]*compressionPool) { - if o.Name == "" { - return - } - if o.CompressionPool == nil { - delete(configuredPools, o.Name) - var names []string - for _, name := range *configuredNames { - if name == o.Name { - continue - } - names = append(names, name) - } - *configuredNames = names - return - } - configuredPools[o.Name] = o.CompressionPool - *configuredNames = append(*configuredNames, o.Name) -} - -type compressMinBytesOption struct { - Min int -} - -func (o *compressMinBytesOption) applyToClient(config *clientConfig) { - config.CompressMinBytes = o.Min -} - -func (o *compressMinBytesOption) applyToHandler(config *handlerConfig) { - config.CompressMinBytes = o.Min -} - -type readMaxBytesOption struct { - Max int -} - -func (o *readMaxBytesOption) applyToClient(config *clientConfig) { - config.ReadMaxBytes = o.Max -} - -func (o *readMaxBytesOption) applyToHandler(config *handlerConfig) { - config.ReadMaxBytes = o.Max -} - -type sendMaxBytesOption struct { - Max int -} - -func (o *sendMaxBytesOption) applyToClient(config *clientConfig) { - config.SendMaxBytes = o.Max -} - -func (o *sendMaxBytesOption) applyToHandler(config *handlerConfig) { - config.SendMaxBytes = o.Max -} - -type handlerOptionsOption struct { - options []HandlerOption -} - -func (o *handlerOptionsOption) applyToHandler(config *handlerConfig) { - for _, option := range o.options { - option.applyToHandler(config) - } -} - -type requireConnectProtocolHeaderOption struct{} - -func (o *requireConnectProtocolHeaderOption) applyToHandler(config *handlerConfig) { - config.RequireConnectProtocolHeader = true -} - -type idempotencyOption struct { - idempotencyLevel IdempotencyLevel -} - -func (o *idempotencyOption) applyToClient(config *clientConfig) { - config.IdempotencyLevel = o.idempotencyLevel -} - -func (o *idempotencyOption) applyToHandler(config *handlerConfig) { - config.IdempotencyLevel = o.idempotencyLevel -} - -type grpcOption struct { - web bool -} - -func (o *grpcOption) applyToClient(config *clientConfig) { - config.Protocol = &protocolGRPC{web: o.web} -} - -type enableGet struct{} - -func (o *enableGet) applyToClient(config *clientConfig) { - config.EnableGet = true -} - -// WithHTTPGetMaxURLSize sets the maximum allowable URL length for GET requests -// made using the Connect protocol. It has no effect on gRPC or gRPC-Web -// clients, since those protocols are POST-only. -// -// Limiting the URL size is useful as most user agents, proxies, and servers -// have limits on the allowable length of a URL. For example, Apache and Nginx -// limit the size of a request line to around 8 KiB, meaning that maximum -// length of a URL is a bit smaller than this. If you run into URL size -// limitations imposed by your network infrastructure and don't know the -// maximum allowable size, or if you'd prefer to be cautious from the start, a -// 4096 byte (4 KiB) limit works with most common proxies and CDNs. -// -// If fallback is set to true and the URL would be longer than the configured -// maximum value, the request will be sent as an HTTP POST instead. If fallback -// is set to false, the request will fail with [CodeResourceExhausted]. -// -// By default, Connect-protocol clients with GET requests enabled may send a -// URL of any size. -func WithHTTPGetMaxURLSize(bytes int, fallback bool) ClientOption { - return &getURLMaxBytes{Max: bytes, Fallback: fallback} -} - -type getURLMaxBytes struct { - Max int - Fallback bool -} - -func (o *getURLMaxBytes) applyToClient(config *clientConfig) { - config.GetURLMaxBytes = o.Max - config.GetUseFallback = o.Fallback -} - -type interceptorsOption struct { - Interceptors []Interceptor -} - -func (o *interceptorsOption) applyToClient(config *clientConfig) { - config.Interceptor = o.chainWith(config.Interceptor) -} - -func (o *interceptorsOption) applyToHandler(config *handlerConfig) { - config.Interceptor = o.chainWith(config.Interceptor) -} - -func (o *interceptorsOption) chainWith(current Interceptor) Interceptor { - if len(o.Interceptors) == 0 { - return current - } - if current == nil && len(o.Interceptors) == 1 { - return o.Interceptors[0] - } - if current == nil && len(o.Interceptors) > 1 { - return newChain(o.Interceptors) - } - return newChain(append([]Interceptor{current}, o.Interceptors...)) -} - -type optionsOption struct { - options []Option -} - -func (o *optionsOption) applyToClient(config *clientConfig) { - for _, option := range o.options { - option.applyToClient(config) - } -} - -func (o *optionsOption) applyToHandler(config *handlerConfig) { - for _, option := range o.options { - option.applyToHandler(config) - } -} - -type sendCompressionOption struct { - Name string -} - -func (o *sendCompressionOption) applyToClient(config *clientConfig) { - config.RequestCompressionName = o.Name -} - -func withGzip() Option { - return &compressionOption{ - Name: compressionGzip, - CompressionPool: newCompressionPool( - func() Decompressor { return &gzip.Reader{} }, - func() Compressor { return gzip.NewWriter(io.Discard) }, - ), - } -} - -func withProtoBinaryCodec() Option { - return WithCodec(&protoBinaryCodec{}) -} - -func withProtoJSONCodecs() HandlerOption { - return WithHandlerOptions( - WithCodec(&protoJSONCodec{codecNameJSON}), - WithCodec(&protoJSONCodec{codecNameJSONCharsetUTF8}), - ) -} diff --git a/vendor/github.com/bufbuild/connect-go/protobuf_util.go b/vendor/github.com/bufbuild/connect-go/protobuf_util.go deleted file mode 100644 index 839a40f047..0000000000 --- a/vendor/github.com/bufbuild/connect-go/protobuf_util.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "strings" -) - -// extractProtoPath returns the trailing portion of the URL's path, -// corresponding to the Protobuf package, service, and method. It always starts -// with a slash. Within connect, we use this as (1) Spec.Procedure and (2) the -// path when mounting handlers on muxes. -func extractProtoPath(path string) string { - segments := strings.Split(path, "/") - var pkg, method string - if len(segments) > 0 { - pkg = segments[0] - } - if len(segments) > 1 { - pkg = segments[len(segments)-2] - method = segments[len(segments)-1] - } - if pkg == "" { - return "/" - } - if method == "" { - return "/" + pkg - } - return "/" + pkg + "/" + method -} diff --git a/vendor/github.com/bufbuild/connect-go/protocol.go b/vendor/github.com/bufbuild/connect-go/protocol.go deleted file mode 100644 index 8486ca96a3..0000000000 --- a/vendor/github.com/bufbuild/connect-go/protocol.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "errors" - "fmt" - "io" - "mime" - "net/http" - "net/url" - "sort" - "strings" -) - -// The names of the Connect, gRPC, and gRPC-Web protocols (as exposed by -// [Peer.Protocol]). Additional protocols may be added in the future. -const ( - ProtocolConnect = "connect" - ProtocolGRPC = "grpc" - ProtocolGRPCWeb = "grpcweb" -) - -const ( - headerContentType = "Content-Type" - headerHost = "Host" - headerUserAgent = "User-Agent" - headerTrailer = "Trailer" - - discardLimit = 1024 * 1024 * 4 // 4MiB -) - -var errNoTimeout = errors.New("no timeout") - -// A Protocol defines the HTTP semantics to use when sending and receiving -// messages. It ties together codecs, compressors, and net/http to produce -// Senders and Receivers. -// -// For example, connect supports the gRPC protocol using this abstraction. Among -// many other things, the protocol implementation is responsible for -// translating timeouts from Go contexts to HTTP and vice versa. For gRPC, it -// converts timeouts to and from strings (for example, 10*time.Second <-> -// "10S"), and puts those strings into the "Grpc-Timeout" HTTP header. Other -// protocols might encode durations differently, put them into a different HTTP -// header, or ignore them entirely. -// -// We don't have any short-term plans to export this interface; it's just here -// to separate the protocol-specific portions of connect from the -// protocol-agnostic plumbing. -type protocol interface { - NewHandler(*protocolHandlerParams) protocolHandler - NewClient(*protocolClientParams) (protocolClient, error) -} - -// HandlerParams are the arguments provided to a Protocol's NewHandler -// method, bundled into a struct to allow backward-compatible argument -// additions. Protocol implementations should take care to use the supplied -// Spec rather than constructing their own, since new fields may have been -// added. -type protocolHandlerParams struct { - Spec Spec - Codecs readOnlyCodecs - CompressionPools readOnlyCompressionPools - CompressMinBytes int - BufferPool *bufferPool - ReadMaxBytes int - SendMaxBytes int - RequireConnectProtocolHeader bool - IdempotencyLevel IdempotencyLevel -} - -// Handler is the server side of a protocol. HTTP handlers typically support -// multiple protocols, codecs, and compressors. -type protocolHandler interface { - // Methods is the set of HTTP methods the protocol can handle. - Methods() map[string]struct{} - - // ContentTypes is the set of HTTP Content-Types that the protocol can - // handle. - ContentTypes() map[string]struct{} - - // SetTimeout runs before NewStream. Implementations may inspect the HTTP - // request, parse any timeout set by the client, and return a modified - // context and cancellation function. - // - // If the client didn't send a timeout, SetTimeout should return the - // request's context, a nil cancellation function, and a nil error. - SetTimeout(*http.Request) (context.Context, context.CancelFunc, error) - - // CanHandlePayload returns true if the protocol can handle an HTTP request. - // This is called after the request method is validated, so we only need to - // be concerned with the content type/payload specifically. - CanHandlePayload(*http.Request, string) bool - - // NewConn constructs a HandlerConn for the message exchange. - NewConn(http.ResponseWriter, *http.Request) (handlerConnCloser, bool) -} - -// ClientParams are the arguments provided to a Protocol's NewClient method, -// bundled into a struct to allow backward-compatible argument additions. -// Protocol implementations should take care to use the supplied Spec rather -// than constructing their own, since new fields may have been added. -type protocolClientParams struct { - CompressionName string - CompressionPools readOnlyCompressionPools - Codec Codec - CompressMinBytes int - HTTPClient HTTPClient - URL *url.URL - BufferPool *bufferPool - ReadMaxBytes int - SendMaxBytes int - EnableGet bool - GetURLMaxBytes int - GetUseFallback bool - // The gRPC family of protocols always needs access to a Protobuf codec to - // marshal and unmarshal errors. - Protobuf Codec -} - -// Client is the client side of a protocol. HTTP clients typically use a single -// protocol, codec, and compressor to send requests. -type protocolClient interface { - // Peer describes the server for the RPC. - Peer() Peer - - // WriteRequestHeader writes any protocol-specific request headers. - WriteRequestHeader(StreamType, http.Header) - - // NewConn constructs a StreamingClientConn for the message exchange. - // - // Implementations should assume that the supplied HTTP headers have already - // been populated by WriteRequestHeader. When constructing a stream for a - // unary call, implementations may assume that the Sender's Send and Close - // methods return before the Receiver's Receive or Close methods are called. - NewConn(context.Context, Spec, http.Header) streamingClientConn -} - -// streamingClientConn extends StreamingClientConn with a method for registering -// a hook when the HTTP request is actually sent. -type streamingClientConn interface { - StreamingClientConn - - onRequestSend(fn func(*http.Request)) -} - -// errorTranslatingHandlerConnCloser wraps a handlerConnCloser to ensure that -// we always return coded errors to users and write coded errors to the -// network. -// -// It's used in protocol implementations. -type errorTranslatingHandlerConnCloser struct { - handlerConnCloser - - toWire func(error) error - fromWire func(error) error -} - -func (hc *errorTranslatingHandlerConnCloser) Send(msg any) error { - return hc.fromWire(hc.handlerConnCloser.Send(msg)) -} - -func (hc *errorTranslatingHandlerConnCloser) Receive(msg any) error { - return hc.fromWire(hc.handlerConnCloser.Receive(msg)) -} - -func (hc *errorTranslatingHandlerConnCloser) Close(err error) error { - closeErr := hc.handlerConnCloser.Close(hc.toWire(err)) - return hc.fromWire(closeErr) -} - -func (hc *errorTranslatingHandlerConnCloser) getHTTPMethod() string { - if methoder, ok := hc.handlerConnCloser.(interface{ getHTTPMethod() string }); ok { - return methoder.getHTTPMethod() - } - return http.MethodPost -} - -// errorTranslatingClientConn wraps a StreamingClientConn to make sure that we always -// return coded errors from clients. -// -// It's used in protocol implementations. -type errorTranslatingClientConn struct { - streamingClientConn - - fromWire func(error) error -} - -func (cc *errorTranslatingClientConn) Send(msg any) error { - return cc.fromWire(cc.streamingClientConn.Send(msg)) -} - -func (cc *errorTranslatingClientConn) Receive(msg any) error { - return cc.fromWire(cc.streamingClientConn.Receive(msg)) -} - -func (cc *errorTranslatingClientConn) CloseRequest() error { - return cc.fromWire(cc.streamingClientConn.CloseRequest()) -} - -func (cc *errorTranslatingClientConn) CloseResponse() error { - return cc.fromWire(cc.streamingClientConn.CloseResponse()) -} - -func (cc *errorTranslatingClientConn) onRequestSend(fn func(*http.Request)) { - cc.streamingClientConn.onRequestSend(fn) -} - -// wrapHandlerConnWithCodedErrors ensures that we (1) automatically code -// context-related errors correctly when writing them to the network, and (2) -// return *Errors from all exported APIs. -func wrapHandlerConnWithCodedErrors(conn handlerConnCloser) handlerConnCloser { - return &errorTranslatingHandlerConnCloser{ - handlerConnCloser: conn, - toWire: wrapIfContextError, - fromWire: wrapIfUncoded, - } -} - -// wrapClientConnWithCodedErrors ensures that we always return *Errors from -// public APIs. -func wrapClientConnWithCodedErrors(conn streamingClientConn) streamingClientConn { - return &errorTranslatingClientConn{ - streamingClientConn: conn, - fromWire: wrapIfUncoded, - } -} - -func mappedMethodHandlers(handlers []protocolHandler) map[string][]protocolHandler { - methodHandlers := make(map[string][]protocolHandler) - for _, handler := range handlers { - for method := range handler.Methods() { - methodHandlers[method] = append(methodHandlers[method], handler) - } - } - return methodHandlers -} - -func sortedAcceptPostValue(handlers []protocolHandler) string { - contentTypes := make(map[string]struct{}) - for _, handler := range handlers { - for contentType := range handler.ContentTypes() { - contentTypes[contentType] = struct{}{} - } - } - accept := make([]string, 0, len(contentTypes)) - for ct := range contentTypes { - accept = append(accept, ct) - } - sort.Strings(accept) - return strings.Join(accept, ", ") -} - -func sortedAllowMethodValue(handlers []protocolHandler) string { - methods := make(map[string]struct{}) - for _, handler := range handlers { - for method := range handler.Methods() { - methods[method] = struct{}{} - } - } - allow := make([]string, 0, len(methods)) - for ct := range methods { - allow = append(allow, ct) - } - sort.Strings(allow) - return strings.Join(allow, ", ") -} - -func isCommaOrSpace(c rune) bool { - return c == ',' || c == ' ' -} - -func discard(reader io.Reader) error { - if lr, ok := reader.(*io.LimitedReader); ok { - _, err := io.Copy(io.Discard, lr) - return err - } - // We don't want to get stuck throwing data away forever, so limit how much - // we're willing to do here. - lr := &io.LimitedReader{R: reader, N: discardLimit} - _, err := io.Copy(io.Discard, lr) - return err -} - -// negotiateCompression determines and validates the request compression and -// response compression using the available compressors and protocol-specific -// Content-Encoding and Accept-Encoding headers. -func negotiateCompression( //nolint:nonamedreturns - availableCompressors readOnlyCompressionPools, - sent, accept string, -) (requestCompression, responseCompression string, clientVisibleErr *Error) { - requestCompression = compressionIdentity - if sent != "" && sent != compressionIdentity { - // We default to identity, so we only care if the client sends something - // other than the empty string or compressIdentity. - if availableCompressors.Contains(sent) { - requestCompression = sent - } else { - // To comply with - // https://github.com/grpc/grpc/blob/master/doc/compression.md and the - // Connect protocol, we should return CodeUnimplemented and specify - // acceptable compression(s) (in addition to setting the a - // protocol-specific accept-encoding header). - return "", "", errorf( - CodeUnimplemented, - "unknown compression %q: supported encodings are %v", - sent, availableCompressors.CommaSeparatedNames(), - ) - } - } - // Support asymmetric compression. This logic follows - // https://github.com/grpc/grpc/blob/master/doc/compression.md and common - // sense. - responseCompression = requestCompression - // If we're not already planning to compress the response, check whether the - // client requested a compression algorithm we support. - if responseCompression == compressionIdentity && accept != "" { - for _, name := range strings.FieldsFunc(accept, isCommaOrSpace) { - if availableCompressors.Contains(name) { - // We found a mutually supported compression algorithm. Unlike standard - // HTTP, there's no preference weighting, so can bail out immediately. - responseCompression = name - break - } - } - } - return requestCompression, responseCompression, nil -} - -// checkServerStreamsCanFlush ensures that bidi and server streaming handlers -// have received an http.ResponseWriter that implements http.Flusher, since -// they must flush data after sending each message. -func checkServerStreamsCanFlush(spec Spec, responseWriter http.ResponseWriter) *Error { - requiresFlusher := (spec.StreamType & StreamTypeServer) == StreamTypeServer - if _, flushable := responseWriter.(http.Flusher); requiresFlusher && !flushable { - return NewError(CodeInternal, fmt.Errorf("%T does not implement http.Flusher", responseWriter)) - } - return nil -} - -func flushResponseWriter(w http.ResponseWriter) { - if f, ok := w.(http.Flusher); ok { - f.Flush() - } -} - -func canonicalizeContentType(contentType string) string { - // Typically, clients send Content-Type in canonical form, without - // parameters. In those cases, we'd like to avoid parsing and - // canonicalization overhead. - // - // See https://www.rfc-editor.org/rfc/rfc2045.html#section-5.1 for a full - // grammar. - var slashes int - for _, r := range contentType { - switch { - case r >= 'a' && r <= 'z': - case r == '.' || r == '+' || r == '-': - case r == '/': - slashes++ - default: - return canonicalizeContentTypeSlow(contentType) - } - } - if slashes == 1 { - return contentType - } - return canonicalizeContentTypeSlow(contentType) -} - -func canonicalizeContentTypeSlow(contentType string) string { - base, params, err := mime.ParseMediaType(contentType) - if err != nil { - return contentType - } - // According to RFC 9110 Section 8.3.2, the charset parameter value should be treated as case-insensitive. - // mime.FormatMediaType canonicalizes parameter names, but not parameter values, - // because the case sensitivity of a parameter value depends on its semantics. - // Therefore, the charset parameter value should be canonicalized here. - // ref.) https://httpwg.org/specs/rfc9110.html#rfc.section.8.3.2 - if charset, ok := params["charset"]; ok { - params["charset"] = strings.ToLower(charset) - } - return mime.FormatMediaType(base, params) -} diff --git a/vendor/github.com/bufbuild/connect-go/protocol_connect.go b/vendor/github.com/bufbuild/connect-go/protocol_connect.go deleted file mode 100644 index 699440fea2..0000000000 --- a/vendor/github.com/bufbuild/connect-go/protocol_connect.go +++ /dev/null @@ -1,1303 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bytes" - "context" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "math" - "net/http" - "net/url" - "runtime" - "strconv" - "strings" - "time" - - "google.golang.org/protobuf/types/known/anypb" -) - -const ( - connectUnaryHeaderCompression = "Content-Encoding" - connectUnaryHeaderAcceptCompression = "Accept-Encoding" - connectUnaryTrailerPrefix = "Trailer-" - connectStreamingHeaderCompression = "Connect-Content-Encoding" - connectStreamingHeaderAcceptCompression = "Connect-Accept-Encoding" - connectHeaderTimeout = "Connect-Timeout-Ms" - connectHeaderProtocolVersion = "Connect-Protocol-Version" - connectProtocolVersion = "1" - headerVary = "Vary" - - connectFlagEnvelopeEndStream = 0b00000010 - - connectUnaryContentTypePrefix = "application/" - connectUnaryContentTypeJSON = connectUnaryContentTypePrefix + "json" - connectStreamingContentTypePrefix = "application/connect+" - - connectUnaryEncodingQueryParameter = "encoding" - connectUnaryMessageQueryParameter = "message" - connectUnaryBase64QueryParameter = "base64" - connectUnaryCompressionQueryParameter = "compression" - connectUnaryConnectQueryParameter = "connect" - connectUnaryConnectQueryValue = "v" + connectProtocolVersion -) - -// defaultConnectUserAgent returns a User-Agent string similar to those used in gRPC. -// -//nolint:gochecknoglobals -var defaultConnectUserAgent = fmt.Sprintf("connect-go/%s (%s)", Version, runtime.Version()) - -type protocolConnect struct{} - -// NewHandler implements protocol, so it must return an interface. -func (*protocolConnect) NewHandler(params *protocolHandlerParams) protocolHandler { - methods := make(map[string]struct{}) - methods[http.MethodPost] = struct{}{} - - if params.Spec.StreamType == StreamTypeUnary && params.IdempotencyLevel == IdempotencyNoSideEffects { - methods[http.MethodGet] = struct{}{} - } - - contentTypes := make(map[string]struct{}) - for _, name := range params.Codecs.Names() { - if params.Spec.StreamType == StreamTypeUnary { - contentTypes[canonicalizeContentType(connectUnaryContentTypePrefix+name)] = struct{}{} - continue - } - contentTypes[canonicalizeContentType(connectStreamingContentTypePrefix+name)] = struct{}{} - } - - return &connectHandler{ - protocolHandlerParams: *params, - methods: methods, - accept: contentTypes, - } -} - -// NewClient implements protocol, so it must return an interface. -func (*protocolConnect) NewClient(params *protocolClientParams) (protocolClient, error) { - return &connectClient{ - protocolClientParams: *params, - peer: newPeerFromURL(params.URL, ProtocolConnect), - }, nil -} - -type connectHandler struct { - protocolHandlerParams - - methods map[string]struct{} - accept map[string]struct{} -} - -func (h *connectHandler) Methods() map[string]struct{} { - return h.methods -} - -func (h *connectHandler) ContentTypes() map[string]struct{} { - return h.accept -} - -func (*connectHandler) SetTimeout(request *http.Request) (context.Context, context.CancelFunc, error) { - timeout := getHeaderCanonical(request.Header, connectHeaderTimeout) - if timeout == "" { - return request.Context(), nil, nil - } - if len(timeout) > 10 { - return nil, nil, errorf(CodeInvalidArgument, "parse timeout: %q has >10 digits", timeout) - } - millis, err := strconv.ParseInt(timeout, 10 /* base */, 64 /* bitsize */) - if err != nil { - return nil, nil, errorf(CodeInvalidArgument, "parse timeout: %w", err) - } - ctx, cancel := context.WithTimeout( - request.Context(), - time.Duration(millis)*time.Millisecond, - ) - return ctx, cancel, nil -} - -func (h *connectHandler) CanHandlePayload(request *http.Request, contentType string) bool { - if request.Method == http.MethodGet { - query := request.URL.Query() - codecName := query.Get(connectUnaryEncodingQueryParameter) - contentType = connectContentTypeFromCodecName( - h.Spec.StreamType, - codecName, - ) - } - _, ok := h.accept[contentType] - return ok -} - -func (h *connectHandler) NewConn( - responseWriter http.ResponseWriter, - request *http.Request, -) (handlerConnCloser, bool) { - query := request.URL.Query() - // We need to parse metadata before entering the interceptor stack; we'll - // send the error to the client later on. - var contentEncoding, acceptEncoding string - if h.Spec.StreamType == StreamTypeUnary { - if request.Method == http.MethodGet { - contentEncoding = query.Get(connectUnaryCompressionQueryParameter) - } else { - contentEncoding = getHeaderCanonical(request.Header, connectUnaryHeaderCompression) - } - acceptEncoding = getHeaderCanonical(request.Header, connectUnaryHeaderAcceptCompression) - } else { - contentEncoding = getHeaderCanonical(request.Header, connectStreamingHeaderCompression) - acceptEncoding = getHeaderCanonical(request.Header, connectStreamingHeaderAcceptCompression) - } - requestCompression, responseCompression, failed := negotiateCompression( - h.CompressionPools, - contentEncoding, - acceptEncoding, - ) - if failed == nil { - failed = checkServerStreamsCanFlush(h.Spec, responseWriter) - } - if failed == nil && request.Method == http.MethodGet { - version := query.Get(connectUnaryConnectQueryParameter) - if version == "" && h.RequireConnectProtocolHeader { - failed = errorf(CodeInvalidArgument, "missing required query parameter: set %s to %q", connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue) - } else if version != "" && version != connectUnaryConnectQueryValue { - failed = errorf(CodeInvalidArgument, "%s must be %q: got %q", connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue, version) - } - } - if failed == nil && request.Method == http.MethodPost { - version := getHeaderCanonical(request.Header, connectHeaderProtocolVersion) - if version == "" && h.RequireConnectProtocolHeader { - failed = errorf(CodeInvalidArgument, "missing required header: set %s to %q", connectHeaderProtocolVersion, connectProtocolVersion) - } else if version != "" && version != connectProtocolVersion { - failed = errorf(CodeInvalidArgument, "%s must be %q: got %q", connectHeaderProtocolVersion, connectProtocolVersion, version) - } - } - - var requestBody io.ReadCloser - var contentType, codecName string - if request.Method == http.MethodGet { - if failed == nil && !query.Has(connectUnaryEncodingQueryParameter) { - failed = errorf(CodeInvalidArgument, "missing %s parameter", connectUnaryEncodingQueryParameter) - } else if failed == nil && !query.Has(connectUnaryMessageQueryParameter) { - failed = errorf(CodeInvalidArgument, "missing %s parameter", connectUnaryMessageQueryParameter) - } - msg := query.Get(connectUnaryMessageQueryParameter) - msgReader := queryValueReader(msg, query.Get(connectUnaryBase64QueryParameter) == "1") - requestBody = io.NopCloser(msgReader) - codecName = query.Get(connectUnaryEncodingQueryParameter) - contentType = connectContentTypeFromCodecName( - h.Spec.StreamType, - codecName, - ) - } else { - requestBody = request.Body - contentType = getHeaderCanonical(request.Header, headerContentType) - codecName = connectCodecFromContentType( - h.Spec.StreamType, - contentType, - ) - } - - codec := h.Codecs.Get(codecName) - // The codec can be nil in the GET request case; that's okay: when failed - // is non-nil, codec is never used. - if failed == nil && codec == nil { - failed = errorf(CodeInvalidArgument, "invalid message encoding: %q", codecName) - } - - // Write any remaining headers here: - // (1) any writes to the stream will implicitly send the headers, so we - // should get all of gRPC's required response headers ready. - // (2) interceptors should be able to see these headers. - // - // Since we know that these header keys are already in canonical form, we can - // skip the normalization in Header.Set. - header := responseWriter.Header() - header[headerContentType] = []string{contentType} - acceptCompressionHeader := connectUnaryHeaderAcceptCompression - if h.Spec.StreamType != StreamTypeUnary { - acceptCompressionHeader = connectStreamingHeaderAcceptCompression - // We only write the request encoding header here for streaming calls, - // since the streaming envelope lets us choose whether to compress each - // message individually. For unary, we won't know whether we're compressing - // the request until we see how large the payload is. - if responseCompression != compressionIdentity { - header[connectStreamingHeaderCompression] = []string{responseCompression} - } - } - header[acceptCompressionHeader] = []string{h.CompressionPools.CommaSeparatedNames()} - - var conn handlerConnCloser - peer := Peer{ - Addr: request.RemoteAddr, - Protocol: ProtocolConnect, - Query: query, - } - if h.Spec.StreamType == StreamTypeUnary { - conn = &connectUnaryHandlerConn{ - spec: h.Spec, - peer: peer, - request: request, - responseWriter: responseWriter, - marshaler: connectUnaryMarshaler{ - writer: responseWriter, - codec: codec, - compressMinBytes: h.CompressMinBytes, - compressionName: responseCompression, - compressionPool: h.CompressionPools.Get(responseCompression), - bufferPool: h.BufferPool, - header: responseWriter.Header(), - sendMaxBytes: h.SendMaxBytes, - }, - unmarshaler: connectUnaryUnmarshaler{ - reader: requestBody, - codec: codec, - compressionPool: h.CompressionPools.Get(requestCompression), - bufferPool: h.BufferPool, - readMaxBytes: h.ReadMaxBytes, - }, - responseTrailer: make(http.Header), - } - } else { - conn = &connectStreamingHandlerConn{ - spec: h.Spec, - peer: peer, - request: request, - responseWriter: responseWriter, - marshaler: connectStreamingMarshaler{ - envelopeWriter: envelopeWriter{ - writer: responseWriter, - codec: codec, - compressMinBytes: h.CompressMinBytes, - compressionPool: h.CompressionPools.Get(responseCompression), - bufferPool: h.BufferPool, - sendMaxBytes: h.SendMaxBytes, - }, - }, - unmarshaler: connectStreamingUnmarshaler{ - envelopeReader: envelopeReader{ - reader: requestBody, - codec: codec, - compressionPool: h.CompressionPools.Get(requestCompression), - bufferPool: h.BufferPool, - readMaxBytes: h.ReadMaxBytes, - }, - }, - responseTrailer: make(http.Header), - } - } - conn = wrapHandlerConnWithCodedErrors(conn) - - if failed != nil { - // Negotiation failed, so we can't establish a stream. - _ = conn.Close(failed) - return nil, false - } - return conn, true -} - -type connectClient struct { - protocolClientParams - - peer Peer -} - -func (c *connectClient) Peer() Peer { - return c.peer -} - -func (c *connectClient) WriteRequestHeader(streamType StreamType, header http.Header) { - // We know these header keys are in canonical form, so we can bypass all the - // checks in Header.Set. - if getHeaderCanonical(header, headerUserAgent) == "" { - header[headerUserAgent] = []string{defaultConnectUserAgent} - } - header[connectHeaderProtocolVersion] = []string{connectProtocolVersion} - header[headerContentType] = []string{ - connectContentTypeFromCodecName(streamType, c.Codec.Name()), - } - acceptCompressionHeader := connectUnaryHeaderAcceptCompression - if streamType != StreamTypeUnary { - // If we don't set Accept-Encoding, by default http.Client will ask the - // server to compress the whole stream. Since we're already compressing - // each message, this is a waste. - header[connectUnaryHeaderAcceptCompression] = []string{compressionIdentity} - acceptCompressionHeader = connectStreamingHeaderAcceptCompression - // We only write the request encoding header here for streaming calls, - // since the streaming envelope lets us choose whether to compress each - // message individually. For unary, we won't know whether we're compressing - // the request until we see how large the payload is. - if c.CompressionName != "" && c.CompressionName != compressionIdentity { - header[connectStreamingHeaderCompression] = []string{c.CompressionName} - } - } - if acceptCompression := c.CompressionPools.CommaSeparatedNames(); acceptCompression != "" { - header[acceptCompressionHeader] = []string{acceptCompression} - } -} - -func (c *connectClient) NewConn( - ctx context.Context, - spec Spec, - header http.Header, -) streamingClientConn { - if deadline, ok := ctx.Deadline(); ok { - millis := int64(time.Until(deadline) / time.Millisecond) - if millis > 0 { - encoded := strconv.FormatInt(millis, 10 /* base */) - if len(encoded) <= 10 { - header[connectHeaderTimeout] = []string{encoded} - } // else effectively unbounded - } - } - duplexCall := newDuplexHTTPCall(ctx, c.HTTPClient, c.URL, spec, header) - var conn streamingClientConn - if spec.StreamType == StreamTypeUnary { - unaryConn := &connectUnaryClientConn{ - spec: spec, - peer: c.Peer(), - duplexCall: duplexCall, - compressionPools: c.CompressionPools, - bufferPool: c.BufferPool, - marshaler: connectUnaryRequestMarshaler{ - connectUnaryMarshaler: connectUnaryMarshaler{ - writer: duplexCall, - codec: c.Codec, - compressMinBytes: c.CompressMinBytes, - compressionName: c.CompressionName, - compressionPool: c.CompressionPools.Get(c.CompressionName), - bufferPool: c.BufferPool, - header: duplexCall.Header(), - sendMaxBytes: c.SendMaxBytes, - }, - }, - unmarshaler: connectUnaryUnmarshaler{ - reader: duplexCall, - codec: c.Codec, - bufferPool: c.BufferPool, - readMaxBytes: c.ReadMaxBytes, - }, - responseHeader: make(http.Header), - responseTrailer: make(http.Header), - } - if spec.IdempotencyLevel == IdempotencyNoSideEffects { - unaryConn.marshaler.enableGet = c.EnableGet - unaryConn.marshaler.getURLMaxBytes = c.GetURLMaxBytes - unaryConn.marshaler.getUseFallback = c.GetUseFallback - unaryConn.marshaler.duplexCall = duplexCall - if stableCodec, ok := c.Codec.(stableCodec); ok { - unaryConn.marshaler.stableCodec = stableCodec - } - } - conn = unaryConn - duplexCall.SetValidateResponse(unaryConn.validateResponse) - } else { - streamingConn := &connectStreamingClientConn{ - spec: spec, - peer: c.Peer(), - duplexCall: duplexCall, - compressionPools: c.CompressionPools, - bufferPool: c.BufferPool, - codec: c.Codec, - marshaler: connectStreamingMarshaler{ - envelopeWriter: envelopeWriter{ - writer: duplexCall, - codec: c.Codec, - compressMinBytes: c.CompressMinBytes, - compressionPool: c.CompressionPools.Get(c.CompressionName), - bufferPool: c.BufferPool, - sendMaxBytes: c.SendMaxBytes, - }, - }, - unmarshaler: connectStreamingUnmarshaler{ - envelopeReader: envelopeReader{ - reader: duplexCall, - codec: c.Codec, - bufferPool: c.BufferPool, - readMaxBytes: c.ReadMaxBytes, - }, - }, - responseHeader: make(http.Header), - responseTrailer: make(http.Header), - } - conn = streamingConn - duplexCall.SetValidateResponse(streamingConn.validateResponse) - } - return wrapClientConnWithCodedErrors(conn) -} - -type connectUnaryClientConn struct { - spec Spec - peer Peer - duplexCall *duplexHTTPCall - compressionPools readOnlyCompressionPools - bufferPool *bufferPool - marshaler connectUnaryRequestMarshaler - unmarshaler connectUnaryUnmarshaler - responseHeader http.Header - responseTrailer http.Header -} - -func (cc *connectUnaryClientConn) Spec() Spec { - return cc.spec -} - -func (cc *connectUnaryClientConn) Peer() Peer { - return cc.peer -} - -func (cc *connectUnaryClientConn) Send(msg any) error { - if err := cc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (cc *connectUnaryClientConn) RequestHeader() http.Header { - return cc.duplexCall.Header() -} - -func (cc *connectUnaryClientConn) CloseRequest() error { - return cc.duplexCall.CloseWrite() -} - -func (cc *connectUnaryClientConn) Receive(msg any) error { - cc.duplexCall.BlockUntilResponseReady() - if err := cc.unmarshaler.Unmarshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (cc *connectUnaryClientConn) ResponseHeader() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseHeader -} - -func (cc *connectUnaryClientConn) ResponseTrailer() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseTrailer -} - -func (cc *connectUnaryClientConn) CloseResponse() error { - return cc.duplexCall.CloseRead() -} - -func (cc *connectUnaryClientConn) onRequestSend(fn func(*http.Request)) { - cc.duplexCall.onRequestSend = fn -} - -func (cc *connectUnaryClientConn) validateResponse(response *http.Response) *Error { - for k, v := range response.Header { - if !strings.HasPrefix(k, connectUnaryTrailerPrefix) { - cc.responseHeader[k] = v - continue - } - cc.responseTrailer[strings.TrimPrefix(k, connectUnaryTrailerPrefix)] = v - } - compression := getHeaderCanonical(response.Header, connectUnaryHeaderCompression) - if compression != "" && - compression != compressionIdentity && - !cc.compressionPools.Contains(compression) { - return errorf( - CodeInternal, - "unknown encoding %q: accepted encodings are %v", - compression, - cc.compressionPools.CommaSeparatedNames(), - ) - } - if response.StatusCode == http.StatusNotModified && cc.Spec().IdempotencyLevel == IdempotencyNoSideEffects { - serverErr := NewWireError(CodeUnknown, errNotModifiedClient) - // RFC 9110 doesn't allow trailers on 304s, so we only need to include headers. - serverErr.meta = cc.responseHeader.Clone() - return serverErr - } else if response.StatusCode != http.StatusOK { - unmarshaler := connectUnaryUnmarshaler{ - reader: response.Body, - compressionPool: cc.compressionPools.Get(compression), - bufferPool: cc.bufferPool, - } - var wireErr connectWireError - if err := unmarshaler.UnmarshalFunc(&wireErr, json.Unmarshal); err != nil { - return NewError( - connectHTTPToCode(response.StatusCode), - errors.New(response.Status), - ) - } - serverErr := wireErr.asError() - if serverErr == nil { - return nil - } - serverErr.meta = cc.responseHeader.Clone() - mergeHeaders(serverErr.meta, cc.responseTrailer) - return serverErr - } - cc.unmarshaler.compressionPool = cc.compressionPools.Get(compression) - return nil -} - -type connectStreamingClientConn struct { - spec Spec - peer Peer - duplexCall *duplexHTTPCall - compressionPools readOnlyCompressionPools - bufferPool *bufferPool - codec Codec - marshaler connectStreamingMarshaler - unmarshaler connectStreamingUnmarshaler - responseHeader http.Header - responseTrailer http.Header -} - -func (cc *connectStreamingClientConn) Spec() Spec { - return cc.spec -} - -func (cc *connectStreamingClientConn) Peer() Peer { - return cc.peer -} - -func (cc *connectStreamingClientConn) Send(msg any) error { - if err := cc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (cc *connectStreamingClientConn) RequestHeader() http.Header { - return cc.duplexCall.Header() -} - -func (cc *connectStreamingClientConn) CloseRequest() error { - return cc.duplexCall.CloseWrite() -} - -func (cc *connectStreamingClientConn) Receive(msg any) error { - cc.duplexCall.BlockUntilResponseReady() - err := cc.unmarshaler.Unmarshal(msg) - if err == nil { - return nil - } - // See if the server sent an explicit error in the end-of-stream message. - mergeHeaders(cc.responseTrailer, cc.unmarshaler.Trailer()) - if serverErr := cc.unmarshaler.EndStreamError(); serverErr != nil { - // This is expected from a protocol perspective, but receiving an - // end-of-stream message means that we're _not_ getting a regular message. - // For users to realize that the stream has ended, Receive must return an - // error. - serverErr.meta = cc.responseHeader.Clone() - mergeHeaders(serverErr.meta, cc.responseTrailer) - cc.duplexCall.SetError(serverErr) - return serverErr - } - // There's no error in the trailers, so this was probably an error - // converting the bytes to a message, an error reading from the network, or - // just an EOF. We're going to return it to the user, but we also want to - // setResponseError so Send errors out. - cc.duplexCall.SetError(err) - return err -} - -func (cc *connectStreamingClientConn) ResponseHeader() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseHeader -} - -func (cc *connectStreamingClientConn) ResponseTrailer() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseTrailer -} - -func (cc *connectStreamingClientConn) CloseResponse() error { - return cc.duplexCall.CloseRead() -} - -func (cc *connectStreamingClientConn) onRequestSend(fn func(*http.Request)) { - cc.duplexCall.onRequestSend = fn -} - -func (cc *connectStreamingClientConn) validateResponse(response *http.Response) *Error { - if response.StatusCode != http.StatusOK { - return errorf(connectHTTPToCode(response.StatusCode), "HTTP status %v", response.Status) - } - compression := getHeaderCanonical(response.Header, connectStreamingHeaderCompression) - if compression != "" && - compression != compressionIdentity && - !cc.compressionPools.Contains(compression) { - return errorf( - CodeInternal, - "unknown encoding %q: accepted encodings are %v", - compression, - cc.compressionPools.CommaSeparatedNames(), - ) - } - cc.unmarshaler.compressionPool = cc.compressionPools.Get(compression) - mergeHeaders(cc.responseHeader, response.Header) - return nil -} - -type connectUnaryHandlerConn struct { - spec Spec - peer Peer - request *http.Request - responseWriter http.ResponseWriter - marshaler connectUnaryMarshaler - unmarshaler connectUnaryUnmarshaler - responseTrailer http.Header - wroteBody bool -} - -func (hc *connectUnaryHandlerConn) Spec() Spec { - return hc.spec -} - -func (hc *connectUnaryHandlerConn) Peer() Peer { - return hc.peer -} - -func (hc *connectUnaryHandlerConn) Receive(msg any) error { - if err := hc.unmarshaler.Unmarshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *connectUnaryHandlerConn) RequestHeader() http.Header { - return hc.request.Header -} - -func (hc *connectUnaryHandlerConn) Send(msg any) error { - hc.wroteBody = true - hc.writeResponseHeader(nil /* error */) - if err := hc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *connectUnaryHandlerConn) ResponseHeader() http.Header { - return hc.responseWriter.Header() -} - -func (hc *connectUnaryHandlerConn) ResponseTrailer() http.Header { - return hc.responseTrailer -} - -func (hc *connectUnaryHandlerConn) Close(err error) error { - if !hc.wroteBody { - hc.writeResponseHeader(err) - // If the handler received a GET request and the resource hasn't changed, - // return a 304. - if len(hc.peer.Query) > 0 && IsNotModifiedError(err) { - hc.responseWriter.WriteHeader(http.StatusNotModified) - return hc.request.Body.Close() - } - } - if err == nil { - return hc.request.Body.Close() - } - // In unary Connect, errors always use application/json. - setHeaderCanonical(hc.responseWriter.Header(), headerContentType, connectUnaryContentTypeJSON) - hc.responseWriter.WriteHeader(connectCodeToHTTP(CodeOf(err))) - data, marshalErr := json.Marshal(newConnectWireError(err)) - if marshalErr != nil { - _ = hc.request.Body.Close() - return errorf(CodeInternal, "marshal error: %w", err) - } - if _, writeErr := hc.responseWriter.Write(data); writeErr != nil { - _ = hc.request.Body.Close() - return writeErr - } - return hc.request.Body.Close() -} - -func (hc *connectUnaryHandlerConn) getHTTPMethod() string { - return hc.request.Method -} - -func (hc *connectUnaryHandlerConn) writeResponseHeader(err error) { - header := hc.responseWriter.Header() - if hc.request.Method == http.MethodGet { - // The response content varies depending on the compression that the client - // requested (if any). GETs are potentially cacheable, so we should ensure - // that the Vary header includes at least Accept-Encoding (and not overwrite any values already set). - header[headerVary] = append(header[headerVary], connectUnaryHeaderAcceptCompression) - } - if err != nil { - if connectErr, ok := asError(err); ok { - mergeHeaders(header, connectErr.meta) - } - } - for k, v := range hc.responseTrailer { - header[connectUnaryTrailerPrefix+k] = v - } -} - -type connectStreamingHandlerConn struct { - spec Spec - peer Peer - request *http.Request - responseWriter http.ResponseWriter - marshaler connectStreamingMarshaler - unmarshaler connectStreamingUnmarshaler - responseTrailer http.Header -} - -func (hc *connectStreamingHandlerConn) Spec() Spec { - return hc.spec -} - -func (hc *connectStreamingHandlerConn) Peer() Peer { - return hc.peer -} - -func (hc *connectStreamingHandlerConn) Receive(msg any) error { - if err := hc.unmarshaler.Unmarshal(msg); err != nil { - // Clients may not send end-of-stream metadata, so we don't need to handle - // errSpecialEnvelope. - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *connectStreamingHandlerConn) RequestHeader() http.Header { - return hc.request.Header -} - -func (hc *connectStreamingHandlerConn) Send(msg any) error { - defer flushResponseWriter(hc.responseWriter) - if err := hc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *connectStreamingHandlerConn) ResponseHeader() http.Header { - return hc.responseWriter.Header() -} - -func (hc *connectStreamingHandlerConn) ResponseTrailer() http.Header { - return hc.responseTrailer -} - -func (hc *connectStreamingHandlerConn) Close(err error) error { - defer flushResponseWriter(hc.responseWriter) - if err := hc.marshaler.MarshalEndStream(err, hc.responseTrailer); err != nil { - _ = hc.request.Body.Close() - return err - } - // We don't want to copy unread portions of the body to /dev/null here: if - // the client hasn't closed the request body, we'll block until the server - // timeout kicks in. This could happen because the client is malicious, but - // a well-intentioned client may just not expect the server to be returning - // an error for a streaming RPC. Better to accept that we can't always reuse - // TCP connections. - if err := hc.request.Body.Close(); err != nil { - if connectErr, ok := asError(err); ok { - return connectErr - } - return NewError(CodeUnknown, err) - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -type connectStreamingMarshaler struct { - envelopeWriter -} - -func (m *connectStreamingMarshaler) MarshalEndStream(err error, trailer http.Header) *Error { - end := &connectEndStreamMessage{Trailer: trailer} - if err != nil { - end.Error = newConnectWireError(err) - if connectErr, ok := asError(err); ok { - mergeHeaders(end.Trailer, connectErr.meta) - } - } - data, marshalErr := json.Marshal(end) - if marshalErr != nil { - return errorf(CodeInternal, "marshal end stream: %w", marshalErr) - } - raw := bytes.NewBuffer(data) - defer m.envelopeWriter.bufferPool.Put(raw) - return m.Write(&envelope{ - Data: raw, - Flags: connectFlagEnvelopeEndStream, - }) -} - -type connectStreamingUnmarshaler struct { - envelopeReader - - endStreamErr *Error - trailer http.Header -} - -func (u *connectStreamingUnmarshaler) Unmarshal(message any) *Error { - err := u.envelopeReader.Unmarshal(message) - if err == nil { - return nil - } - if !errors.Is(err, errSpecialEnvelope) { - return err - } - env := u.envelopeReader.last - if !env.IsSet(connectFlagEnvelopeEndStream) { - return errorf(CodeInternal, "protocol error: invalid envelope flags %d", env.Flags) - } - var end connectEndStreamMessage - if err := json.Unmarshal(env.Data.Bytes(), &end); err != nil { - return errorf(CodeInternal, "unmarshal end stream message: %w", err) - } - for name, value := range end.Trailer { - canonical := http.CanonicalHeaderKey(name) - if name != canonical { - delete(end.Trailer, name) - end.Trailer[canonical] = append(end.Trailer[canonical], value...) - } - } - u.trailer = end.Trailer - u.endStreamErr = end.Error.asError() - return errSpecialEnvelope -} - -func (u *connectStreamingUnmarshaler) Trailer() http.Header { - return u.trailer -} - -func (u *connectStreamingUnmarshaler) EndStreamError() *Error { - return u.endStreamErr -} - -type connectUnaryMarshaler struct { - writer io.Writer - codec Codec - compressMinBytes int - compressionName string - compressionPool *compressionPool - bufferPool *bufferPool - header http.Header - sendMaxBytes int -} - -func (m *connectUnaryMarshaler) Marshal(message any) *Error { - if message == nil { - return m.write(nil) - } - data, err := m.codec.Marshal(message) - if err != nil { - return errorf(CodeInternal, "marshal message: %w", err) - } - // Can't avoid allocating the slice, but we can reuse it. - uncompressed := bytes.NewBuffer(data) - defer m.bufferPool.Put(uncompressed) - if len(data) < m.compressMinBytes || m.compressionPool == nil { - if m.sendMaxBytes > 0 && len(data) > m.sendMaxBytes { - return NewError(CodeResourceExhausted, fmt.Errorf("message size %d exceeds sendMaxBytes %d", len(data), m.sendMaxBytes)) - } - return m.write(data) - } - compressed := m.bufferPool.Get() - defer m.bufferPool.Put(compressed) - if err := m.compressionPool.Compress(compressed, uncompressed); err != nil { - return err - } - if m.sendMaxBytes > 0 && compressed.Len() > m.sendMaxBytes { - return NewError(CodeResourceExhausted, fmt.Errorf("compressed message size %d exceeds sendMaxBytes %d", compressed.Len(), m.sendMaxBytes)) - } - setHeaderCanonical(m.header, connectUnaryHeaderCompression, m.compressionName) - return m.write(compressed.Bytes()) -} - -func (m *connectUnaryMarshaler) write(data []byte) *Error { - if _, err := m.writer.Write(data); err != nil { - if connectErr, ok := asError(err); ok { - return connectErr - } - return errorf(CodeUnknown, "write message: %w", err) - } - return nil -} - -type connectUnaryRequestMarshaler struct { - connectUnaryMarshaler - - enableGet bool - getURLMaxBytes int - getUseFallback bool - stableCodec stableCodec - duplexCall *duplexHTTPCall -} - -func (m *connectUnaryRequestMarshaler) Marshal(message any) *Error { - if m.enableGet { - if m.stableCodec == nil && !m.getUseFallback { - return errorf(CodeInternal, "codec %s doesn't support stable marshal; can't use get", m.codec.Name()) - } - if m.stableCodec != nil { - return m.marshalWithGet(message) - } - } - return m.connectUnaryMarshaler.Marshal(message) -} - -func (m *connectUnaryRequestMarshaler) marshalWithGet(message any) *Error { - // TODO(jchadwick-buf): This function is mostly a superset of - // connectUnaryMarshaler.Marshal. This should be reconciled at some point. - var data []byte - var err error - if message != nil { - data, err = m.stableCodec.MarshalStable(message) - if err != nil { - return errorf(CodeInternal, "marshal message stable: %w", err) - } - } - isTooBig := m.sendMaxBytes > 0 && len(data) > m.sendMaxBytes - if isTooBig && m.compressionPool == nil { - return NewError(CodeResourceExhausted, fmt.Errorf( - "message size %d exceeds sendMaxBytes %d: enabling request compression may help", - len(data), - m.sendMaxBytes, - )) - } - if !isTooBig { - url := m.buildGetURL(data, false /* compressed */) - if m.getURLMaxBytes <= 0 || len(url.String()) < m.getURLMaxBytes { - return m.writeWithGet(url) - } - if m.compressionPool == nil { - if m.getUseFallback { - return m.write(data) - } - return NewError(CodeResourceExhausted, fmt.Errorf( - "url size %d exceeds getURLMaxBytes %d: enabling request compression may help", - len(url.String()), - m.getURLMaxBytes, - )) - } - } - // Compress message to try to make it fit in the URL. - uncompressed := bytes.NewBuffer(data) - defer m.bufferPool.Put(uncompressed) - compressed := m.bufferPool.Get() - defer m.bufferPool.Put(compressed) - if err := m.compressionPool.Compress(compressed, uncompressed); err != nil { - return err - } - if m.sendMaxBytes > 0 && compressed.Len() > m.sendMaxBytes { - return NewError(CodeResourceExhausted, fmt.Errorf("compressed message size %d exceeds sendMaxBytes %d", compressed.Len(), m.sendMaxBytes)) - } - url := m.buildGetURL(compressed.Bytes(), true /* compressed */) - if m.getURLMaxBytes <= 0 || len(url.String()) < m.getURLMaxBytes { - return m.writeWithGet(url) - } - if m.getUseFallback { - setHeaderCanonical(m.header, connectUnaryHeaderCompression, m.compressionName) - return m.write(compressed.Bytes()) - } - return NewError(CodeResourceExhausted, fmt.Errorf("compressed url size %d exceeds getURLMaxBytes %d", len(url.String()), m.getURLMaxBytes)) -} - -func (m *connectUnaryRequestMarshaler) buildGetURL(data []byte, compressed bool) *url.URL { - url := *m.duplexCall.URL() - query := url.Query() - query.Set(connectUnaryConnectQueryParameter, connectUnaryConnectQueryValue) - query.Set(connectUnaryEncodingQueryParameter, m.codec.Name()) - if m.stableCodec.IsBinary() || compressed { - query.Set(connectUnaryMessageQueryParameter, encodeBinaryQueryValue(data)) - query.Set(connectUnaryBase64QueryParameter, "1") - } else { - query.Set(connectUnaryMessageQueryParameter, string(data)) - } - if compressed { - query.Set(connectUnaryCompressionQueryParameter, m.compressionName) - } - url.RawQuery = query.Encode() - return &url -} - -func (m *connectUnaryRequestMarshaler) writeWithGet(url *url.URL) *Error { - delete(m.header, connectHeaderProtocolVersion) - m.duplexCall.SetMethod(http.MethodGet) - *m.duplexCall.URL() = *url - return nil -} - -type connectUnaryUnmarshaler struct { - reader io.Reader - codec Codec - compressionPool *compressionPool - bufferPool *bufferPool - alreadyRead bool - readMaxBytes int -} - -func (u *connectUnaryUnmarshaler) Unmarshal(message any) *Error { - return u.UnmarshalFunc(message, u.codec.Unmarshal) -} - -func (u *connectUnaryUnmarshaler) UnmarshalFunc(message any, unmarshal func([]byte, any) error) *Error { - if u.alreadyRead { - return NewError(CodeInternal, io.EOF) - } - u.alreadyRead = true - data := u.bufferPool.Get() - defer u.bufferPool.Put(data) - reader := u.reader - if u.readMaxBytes > 0 && int64(u.readMaxBytes) < math.MaxInt64 { - reader = io.LimitReader(u.reader, int64(u.readMaxBytes)+1) - } - // ReadFrom ignores io.EOF, so any error here is real. - bytesRead, err := data.ReadFrom(reader) - if err != nil { - if connectErr, ok := asError(err); ok { - return connectErr - } - if readMaxBytesErr := asMaxBytesError(err, "read first %d bytes of message", bytesRead); readMaxBytesErr != nil { - return readMaxBytesErr - } - return errorf(CodeUnknown, "read message: %w", err) - } - if u.readMaxBytes > 0 && bytesRead > int64(u.readMaxBytes) { - // Attempt to read to end in order to allow connection re-use - discardedBytes, err := io.Copy(io.Discard, u.reader) - if err != nil { - return errorf(CodeResourceExhausted, "message is larger than configured max %d - unable to determine message size: %w", u.readMaxBytes, err) - } - return errorf(CodeResourceExhausted, "message size %d is larger than configured max %d", bytesRead+discardedBytes, u.readMaxBytes) - } - if data.Len() > 0 && u.compressionPool != nil { - decompressed := u.bufferPool.Get() - defer u.bufferPool.Put(decompressed) - if err := u.compressionPool.Decompress(decompressed, data, int64(u.readMaxBytes)); err != nil { - return err - } - data = decompressed - } - if err := unmarshal(data.Bytes(), message); err != nil { - return errorf(CodeInvalidArgument, "unmarshal into %T: %w", message, err) - } - return nil -} - -type connectWireDetail ErrorDetail - -func (d *connectWireDetail) MarshalJSON() ([]byte, error) { - if d.wireJSON != "" { - // If we unmarshaled this detail from JSON, return the original data. This - // lets proxies w/o protobuf descriptors preserve human-readable details. - return []byte(d.wireJSON), nil - } - wire := struct { - Type string `json:"type"` - Value string `json:"value"` - Debug json.RawMessage `json:"debug,omitempty"` - }{ - Type: strings.TrimPrefix(d.pb.TypeUrl, defaultAnyResolverPrefix), - Value: base64.RawStdEncoding.EncodeToString(d.pb.Value), - } - // Try to produce debug info, but expect failure when we don't have - // descriptors. - var codec protoJSONCodec - debug, err := codec.Marshal(d.pb) - if err == nil && len(debug) > 2 { // don't bother sending `{}` - wire.Debug = json.RawMessage(debug) - } - return json.Marshal(wire) -} - -func (d *connectWireDetail) UnmarshalJSON(data []byte) error { - var wire struct { - Type string `json:"type"` - Value string `json:"value"` - } - if err := json.Unmarshal(data, &wire); err != nil { - return err - } - if !strings.Contains(wire.Type, "/") { - wire.Type = defaultAnyResolverPrefix + wire.Type - } - decoded, err := DecodeBinaryHeader(wire.Value) - if err != nil { - return fmt.Errorf("decode base64: %w", err) - } - *d = connectWireDetail{ - pb: &anypb.Any{ - TypeUrl: wire.Type, - Value: decoded, - }, - wireJSON: string(data), - } - return nil -} - -type connectWireError struct { - Code Code `json:"code"` - Message string `json:"message,omitempty"` - Details []*connectWireDetail `json:"details,omitempty"` -} - -func newConnectWireError(err error) *connectWireError { - wire := &connectWireError{ - Code: CodeUnknown, - Message: err.Error(), - } - if connectErr, ok := asError(err); ok { - wire.Code = connectErr.Code() - wire.Message = connectErr.Message() - if len(connectErr.details) > 0 { - wire.Details = make([]*connectWireDetail, len(connectErr.details)) - for i, detail := range connectErr.details { - wire.Details[i] = (*connectWireDetail)(detail) - } - } - } - return wire -} - -func (e *connectWireError) asError() *Error { - if e == nil { - return nil - } - if e.Code < minCode || e.Code > maxCode { - e.Code = CodeUnknown - } - err := NewWireError(e.Code, errors.New(e.Message)) - if len(e.Details) > 0 { - err.details = make([]*ErrorDetail, len(e.Details)) - for i, detail := range e.Details { - err.details[i] = (*ErrorDetail)(detail) - } - } - return err -} - -type connectEndStreamMessage struct { - Error *connectWireError `json:"error,omitempty"` - Trailer http.Header `json:"metadata,omitempty"` -} - -func connectCodeToHTTP(code Code) int { - // Return literals rather than named constants from the HTTP package to make - // it easier to compare this function to the Connect specification. - switch code { - case CodeCanceled: - return 408 - case CodeUnknown: - return 500 - case CodeInvalidArgument: - return 400 - case CodeDeadlineExceeded: - return 408 - case CodeNotFound: - return 404 - case CodeAlreadyExists: - return 409 - case CodePermissionDenied: - return 403 - case CodeResourceExhausted: - return 429 - case CodeFailedPrecondition: - return 412 - case CodeAborted: - return 409 - case CodeOutOfRange: - return 400 - case CodeUnimplemented: - return 404 - case CodeInternal: - return 500 - case CodeUnavailable: - return 503 - case CodeDataLoss: - return 500 - case CodeUnauthenticated: - return 401 - default: - return 500 // same as CodeUnknown - } -} - -func connectHTTPToCode(httpCode int) Code { - // As above, literals are easier to compare to the specificaton (vs named - // constants). - switch httpCode { - case 400: - return CodeInvalidArgument - case 401: - return CodeUnauthenticated - case 403: - return CodePermissionDenied - case 404: - return CodeUnimplemented - case 408: - return CodeDeadlineExceeded - case 412: - return CodeFailedPrecondition - case 413: - return CodeResourceExhausted - case 429: - return CodeUnavailable - case 431: - return CodeResourceExhausted - case 502, 503, 504: - return CodeUnavailable - default: - return CodeUnknown - } -} - -func connectCodecFromContentType(streamType StreamType, contentType string) string { - if streamType == StreamTypeUnary { - return strings.TrimPrefix(contentType, connectUnaryContentTypePrefix) - } - return strings.TrimPrefix(contentType, connectStreamingContentTypePrefix) -} - -func connectContentTypeFromCodecName(streamType StreamType, name string) string { - if streamType == StreamTypeUnary { - return connectUnaryContentTypePrefix + name - } - return connectStreamingContentTypePrefix + name -} - -// encodeBinaryQueryValue URL-safe base64-encodes data, without padding. -func encodeBinaryQueryValue(data []byte) string { - return base64.RawURLEncoding.EncodeToString(data) -} - -// binaryQueryValueReader creates a reader that can read either padded or -// unpadded URL-safe base64 from a string. -func binaryQueryValueReader(data string) io.Reader { - stringReader := strings.NewReader(data) - if len(data)%4 != 0 { - // Data definitely isn't padded. - return base64.NewDecoder(base64.RawURLEncoding, stringReader) - } - // Data is padded, or no padding was necessary. - return base64.NewDecoder(base64.URLEncoding, stringReader) -} - -// queryValueReader creates a reader for a string that may be URL-safe base64 -// encoded. -func queryValueReader(data string, base64Encoded bool) io.Reader { - if base64Encoded { - return binaryQueryValueReader(data) - } - return strings.NewReader(data) -} diff --git a/vendor/github.com/bufbuild/connect-go/protocol_grpc.go b/vendor/github.com/bufbuild/connect-go/protocol_grpc.go deleted file mode 100644 index 62e3355e10..0000000000 --- a/vendor/github.com/bufbuild/connect-go/protocol_grpc.go +++ /dev/null @@ -1,938 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "bufio" - "context" - "errors" - "fmt" - "io" - "math" - "net/http" - "net/textproto" - "runtime" - "strconv" - "strings" - "time" - "unicode/utf8" - - statusv1 "github.com/bufbuild/connect-go/internal/gen/connectext/grpc/status/v1" -) - -const ( - grpcHeaderCompression = "Grpc-Encoding" - grpcHeaderAcceptCompression = "Grpc-Accept-Encoding" - grpcHeaderTimeout = "Grpc-Timeout" - grpcHeaderStatus = "Grpc-Status" - grpcHeaderMessage = "Grpc-Message" - grpcHeaderDetails = "Grpc-Status-Details-Bin" - - grpcFlagEnvelopeTrailer = 0b10000000 - - grpcTimeoutMaxHours = math.MaxInt64 / int64(time.Hour) // how many hours fit into a time.Duration? - grpcMaxTimeoutChars = 8 // from gRPC protocol - - grpcContentTypeDefault = "application/grpc" - grpcWebContentTypeDefault = "application/grpc-web" - grpcContentTypePrefix = grpcContentTypeDefault + "+" - grpcWebContentTypePrefix = grpcWebContentTypeDefault + "+" -) - -var ( - grpcTimeoutUnits = []struct { - size time.Duration - char byte - }{ - {time.Nanosecond, 'n'}, - {time.Microsecond, 'u'}, - {time.Millisecond, 'm'}, - {time.Second, 'S'}, - {time.Minute, 'M'}, - {time.Hour, 'H'}, - } - grpcTimeoutUnitLookup = make(map[byte]time.Duration) - grpcAllowedMethods = map[string]struct{}{ - http.MethodPost: {}, - } - errTrailersWithoutGRPCStatus = fmt.Errorf("gRPC protocol error: no %s trailer", grpcHeaderStatus) - - // defaultGrpcUserAgent follows - // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#user-agents: - // - // While the protocol does not require a user-agent to function it is recommended - // that clients provide a structured user-agent string that provides a basic - // description of the calling library, version & platform to facilitate issue diagnosis - // in heterogeneous environments. The following structure is recommended to library developers: - // - // User-Agent → "grpc-" Language ?("-" Variant) "/" Version ?( " (" *(AdditionalProperty ";") ")" ) - defaultGrpcUserAgent = fmt.Sprintf("grpc-go-connect/%s (%s)", Version, runtime.Version()) -) - -func init() { - for _, pair := range grpcTimeoutUnits { - grpcTimeoutUnitLookup[pair.char] = pair.size - } -} - -type protocolGRPC struct { - web bool -} - -// NewHandler implements protocol, so it must return an interface. -func (g *protocolGRPC) NewHandler(params *protocolHandlerParams) protocolHandler { - bare, prefix := grpcContentTypeDefault, grpcContentTypePrefix - if g.web { - bare, prefix = grpcWebContentTypeDefault, grpcWebContentTypePrefix - } - contentTypes := make(map[string]struct{}) - for _, name := range params.Codecs.Names() { - contentTypes[canonicalizeContentType(prefix+name)] = struct{}{} - } - if params.Codecs.Get(codecNameProto) != nil { - contentTypes[bare] = struct{}{} - } - return &grpcHandler{ - protocolHandlerParams: *params, - web: g.web, - accept: contentTypes, - } -} - -// NewClient implements protocol, so it must return an interface. -func (g *protocolGRPC) NewClient(params *protocolClientParams) (protocolClient, error) { - peer := newPeerFromURL(params.URL, ProtocolGRPC) - if g.web { - peer = newPeerFromURL(params.URL, ProtocolGRPCWeb) - } - return &grpcClient{ - protocolClientParams: *params, - web: g.web, - peer: peer, - }, nil -} - -type grpcHandler struct { - protocolHandlerParams - - web bool - accept map[string]struct{} -} - -func (g *grpcHandler) Methods() map[string]struct{} { - return grpcAllowedMethods -} - -func (g *grpcHandler) ContentTypes() map[string]struct{} { - return g.accept -} - -func (*grpcHandler) SetTimeout(request *http.Request) (context.Context, context.CancelFunc, error) { - timeout, err := grpcParseTimeout(getHeaderCanonical(request.Header, grpcHeaderTimeout)) - if err != nil && !errors.Is(err, errNoTimeout) { - // Errors here indicate that the client sent an invalid timeout header, so - // the error text is safe to send back. - return nil, nil, NewError(CodeInvalidArgument, err) - } else if err != nil { - // err wraps errNoTimeout, nothing to do. - return request.Context(), nil, nil //nolint:nilerr - } - ctx, cancel := context.WithTimeout(request.Context(), timeout) - return ctx, cancel, nil -} - -func (g *grpcHandler) CanHandlePayload(request *http.Request, contentType string) bool { - _, ok := g.accept[contentType] - return ok -} - -func (g *grpcHandler) NewConn( - responseWriter http.ResponseWriter, - request *http.Request, -) (handlerConnCloser, bool) { - // We need to parse metadata before entering the interceptor stack; we'll - // send the error to the client later on. - requestCompression, responseCompression, failed := negotiateCompression( - g.CompressionPools, - getHeaderCanonical(request.Header, grpcHeaderCompression), - getHeaderCanonical(request.Header, grpcHeaderAcceptCompression), - ) - if failed == nil { - failed = checkServerStreamsCanFlush(g.Spec, responseWriter) - } - - // Write any remaining headers here: - // (1) any writes to the stream will implicitly send the headers, so we - // should get all of gRPC's required response headers ready. - // (2) interceptors should be able to see these headers. - // - // Since we know that these header keys are already in canonical form, we can - // skip the normalization in Header.Set. - header := responseWriter.Header() - header[headerContentType] = []string{getHeaderCanonical(request.Header, headerContentType)} - header[grpcHeaderAcceptCompression] = []string{g.CompressionPools.CommaSeparatedNames()} - if responseCompression != compressionIdentity { - header[grpcHeaderCompression] = []string{responseCompression} - } - - codecName := grpcCodecFromContentType(g.web, getHeaderCanonical(request.Header, headerContentType)) - codec := g.Codecs.Get(codecName) // handler.go guarantees this is not nil - protocolName := ProtocolGRPC - if g.web { - protocolName = ProtocolGRPCWeb - } - conn := wrapHandlerConnWithCodedErrors(&grpcHandlerConn{ - spec: g.Spec, - peer: Peer{ - Addr: request.RemoteAddr, - Protocol: protocolName, - }, - web: g.web, - bufferPool: g.BufferPool, - protobuf: g.Codecs.Protobuf(), // for errors - marshaler: grpcMarshaler{ - envelopeWriter: envelopeWriter{ - writer: responseWriter, - compressionPool: g.CompressionPools.Get(responseCompression), - codec: codec, - compressMinBytes: g.CompressMinBytes, - bufferPool: g.BufferPool, - sendMaxBytes: g.SendMaxBytes, - }, - }, - responseWriter: responseWriter, - responseHeader: make(http.Header), - responseTrailer: make(http.Header), - request: request, - unmarshaler: grpcUnmarshaler{ - envelopeReader: envelopeReader{ - reader: request.Body, - codec: codec, - compressionPool: g.CompressionPools.Get(requestCompression), - bufferPool: g.BufferPool, - readMaxBytes: g.ReadMaxBytes, - }, - web: g.web, - }, - }) - if failed != nil { - // Negotiation failed, so we can't establish a stream. - _ = conn.Close(failed) - return nil, false - } - return conn, true -} - -type grpcClient struct { - protocolClientParams - - web bool - peer Peer -} - -func (g *grpcClient) Peer() Peer { - return g.peer -} - -func (g *grpcClient) WriteRequestHeader(_ StreamType, header http.Header) { - // We know these header keys are in canonical form, so we can bypass all the - // checks in Header.Set. - if getHeaderCanonical(header, headerUserAgent) == "" { - header[headerUserAgent] = []string{defaultGrpcUserAgent} - } - header[headerContentType] = []string{grpcContentTypeFromCodecName(g.web, g.Codec.Name())} - // gRPC handles compression on a per-message basis, so we don't want to - // compress the whole stream. By default, http.Client will ask the server - // to gzip the stream if we don't set Accept-Encoding. - header["Accept-Encoding"] = []string{compressionIdentity} - if g.CompressionName != "" && g.CompressionName != compressionIdentity { - header[grpcHeaderCompression] = []string{g.CompressionName} - } - if acceptCompression := g.CompressionPools.CommaSeparatedNames(); acceptCompression != "" { - header[grpcHeaderAcceptCompression] = []string{acceptCompression} - } - if !g.web { - // The gRPC-HTTP2 specification requires this - it flushes out proxies that - // don't support HTTP trailers. - header["Te"] = []string{"trailers"} - } -} - -func (g *grpcClient) NewConn( - ctx context.Context, - spec Spec, - header http.Header, -) streamingClientConn { - if deadline, ok := ctx.Deadline(); ok { - if encodedDeadline, err := grpcEncodeTimeout(time.Until(deadline)); err == nil { - // Tests verify that the error in encodeTimeout is unreachable, so we - // don't need to handle the error case. - header[grpcHeaderTimeout] = []string{encodedDeadline} - } - } - duplexCall := newDuplexHTTPCall( - ctx, - g.HTTPClient, - g.URL, - spec, - header, - ) - conn := &grpcClientConn{ - spec: spec, - peer: g.Peer(), - duplexCall: duplexCall, - compressionPools: g.CompressionPools, - bufferPool: g.BufferPool, - protobuf: g.Protobuf, - marshaler: grpcMarshaler{ - envelopeWriter: envelopeWriter{ - writer: duplexCall, - compressionPool: g.CompressionPools.Get(g.CompressionName), - codec: g.Codec, - compressMinBytes: g.CompressMinBytes, - bufferPool: g.BufferPool, - sendMaxBytes: g.SendMaxBytes, - }, - }, - unmarshaler: grpcUnmarshaler{ - envelopeReader: envelopeReader{ - reader: duplexCall, - codec: g.Codec, - bufferPool: g.BufferPool, - readMaxBytes: g.ReadMaxBytes, - }, - }, - responseHeader: make(http.Header), - responseTrailer: make(http.Header), - } - duplexCall.SetValidateResponse(conn.validateResponse) - if g.web { - conn.unmarshaler.web = true - conn.readTrailers = func(unmarshaler *grpcUnmarshaler, _ *duplexHTTPCall) http.Header { - return unmarshaler.WebTrailer() - } - } else { - conn.readTrailers = func(_ *grpcUnmarshaler, call *duplexHTTPCall) http.Header { - // To access HTTP trailers, we need to read the body to EOF. - _ = discard(call) - return call.ResponseTrailer() - } - } - return wrapClientConnWithCodedErrors(conn) -} - -// grpcClientConn works for both gRPC and gRPC-Web. -type grpcClientConn struct { - spec Spec - peer Peer - duplexCall *duplexHTTPCall - compressionPools readOnlyCompressionPools - bufferPool *bufferPool - protobuf Codec // for errors - marshaler grpcMarshaler - unmarshaler grpcUnmarshaler - responseHeader http.Header - responseTrailer http.Header - readTrailers func(*grpcUnmarshaler, *duplexHTTPCall) http.Header -} - -func (cc *grpcClientConn) Spec() Spec { - return cc.spec -} - -func (cc *grpcClientConn) Peer() Peer { - return cc.peer -} - -func (cc *grpcClientConn) Send(msg any) error { - if err := cc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (cc *grpcClientConn) RequestHeader() http.Header { - return cc.duplexCall.Header() -} - -func (cc *grpcClientConn) CloseRequest() error { - return cc.duplexCall.CloseWrite() -} - -func (cc *grpcClientConn) Receive(msg any) error { - cc.duplexCall.BlockUntilResponseReady() - err := cc.unmarshaler.Unmarshal(msg) - if err == nil { - return nil - } - if getHeaderCanonical(cc.responseHeader, grpcHeaderStatus) != "" { - // We got what gRPC calls a trailers-only response, which puts the trailing - // metadata (including errors) into HTTP headers. validateResponse has - // already extracted the error. - return err - } - // See if the server sent an explicit error in the HTTP or gRPC-Web trailers. - mergeHeaders( - cc.responseTrailer, - cc.readTrailers(&cc.unmarshaler, cc.duplexCall), - ) - serverErr := grpcErrorFromTrailer(cc.protobuf, cc.responseTrailer) - if serverErr != nil && (errors.Is(err, io.EOF) || !errors.Is(serverErr, errTrailersWithoutGRPCStatus)) { - // We've either: - // - Cleanly read until the end of the response body and *not* received - // gRPC status trailers, which is a protocol error, or - // - Received an explicit error from the server. - // - // This is expected from a protocol perspective, but receiving trailers - // means that we're _not_ getting a message. For users to realize that - // the stream has ended, Receive must return an error. - serverErr.meta = cc.responseHeader.Clone() - mergeHeaders(serverErr.meta, cc.responseTrailer) - cc.duplexCall.SetError(serverErr) - return serverErr - } - // This was probably an error converting the bytes to a message or an error - // reading from the network. We're going to return it to the - // user, but we also want to setResponseError so Send errors out. - cc.duplexCall.SetError(err) - return err -} - -func (cc *grpcClientConn) ResponseHeader() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseHeader -} - -func (cc *grpcClientConn) ResponseTrailer() http.Header { - cc.duplexCall.BlockUntilResponseReady() - return cc.responseTrailer -} - -func (cc *grpcClientConn) CloseResponse() error { - return cc.duplexCall.CloseRead() -} - -func (cc *grpcClientConn) onRequestSend(fn func(*http.Request)) { - cc.duplexCall.onRequestSend = fn -} - -func (cc *grpcClientConn) validateResponse(response *http.Response) *Error { - if err := grpcValidateResponse( - response, - cc.responseHeader, - cc.responseTrailer, - cc.compressionPools, - cc.protobuf, - ); err != nil { - return err - } - compression := getHeaderCanonical(response.Header, grpcHeaderCompression) - cc.unmarshaler.envelopeReader.compressionPool = cc.compressionPools.Get(compression) - return nil -} - -type grpcHandlerConn struct { - spec Spec - peer Peer - web bool - bufferPool *bufferPool - protobuf Codec // for errors - marshaler grpcMarshaler - responseWriter http.ResponseWriter - responseHeader http.Header - responseTrailer http.Header - wroteToBody bool - request *http.Request - unmarshaler grpcUnmarshaler -} - -func (hc *grpcHandlerConn) Spec() Spec { - return hc.spec -} - -func (hc *grpcHandlerConn) Peer() Peer { - return hc.peer -} - -func (hc *grpcHandlerConn) Receive(msg any) error { - if err := hc.unmarshaler.Unmarshal(msg); err != nil { - return err // already coded - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *grpcHandlerConn) RequestHeader() http.Header { - return hc.request.Header -} - -func (hc *grpcHandlerConn) Send(msg any) error { - defer flushResponseWriter(hc.responseWriter) - if !hc.wroteToBody { - mergeHeaders(hc.responseWriter.Header(), hc.responseHeader) - hc.wroteToBody = true - } - if err := hc.marshaler.Marshal(msg); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error -} - -func (hc *grpcHandlerConn) ResponseHeader() http.Header { - return hc.responseHeader -} - -func (hc *grpcHandlerConn) ResponseTrailer() http.Header { - return hc.responseTrailer -} - -func (hc *grpcHandlerConn) Close(err error) (retErr error) { - defer func() { - // We don't want to copy unread portions of the body to /dev/null here: if - // the client hasn't closed the request body, we'll block until the server - // timeout kicks in. This could happen because the client is malicious, but - // a well-intentioned client may just not expect the server to be returning - // an error for a streaming RPC. Better to accept that we can't always reuse - // TCP connections. - closeErr := hc.request.Body.Close() - if retErr == nil { - retErr = closeErr - } - }() - defer flushResponseWriter(hc.responseWriter) - // If we haven't written the headers yet, do so. - if !hc.wroteToBody { - mergeHeaders(hc.responseWriter.Header(), hc.responseHeader) - } - // gRPC always sends the error's code, message, details, and metadata as - // trailing metadata. The Connect protocol doesn't do this, so we don't want - // to mutate the trailers map that the user sees. - mergedTrailers := make( - http.Header, - len(hc.responseTrailer)+2, // always make space for status & message - ) - mergeHeaders(mergedTrailers, hc.responseTrailer) - grpcErrorToTrailer(mergedTrailers, hc.protobuf, err) - if hc.web && !hc.wroteToBody { - // We're using gRPC-Web and we haven't yet written to the body. Since we're - // not sending any response messages, the gRPC specification calls this a - // "trailers-only" response. Under those circumstances, the gRPC-Web spec - // says that implementations _may_ send trailing metadata as HTTP headers - // instead. Envoy is the canonical implementation of the gRPC-Web protocol, - // so we emulate Envoy's behavior and put the trailing metadata in the HTTP - // headers. - mergeHeaders(hc.responseWriter.Header(), mergedTrailers) - return nil - } - if hc.web { - // We're using gRPC-Web and we've already sent the headers, so we write - // trailing metadata to the HTTP body. - if err := hc.marshaler.MarshalWebTrailers(mergedTrailers); err != nil { - return err - } - return nil // must be a literal nil: nil *Error is a non-nil error - } - // We're using standard gRPC. Even if we haven't written to the body and - // we're sending a "trailers-only" response, we must send trailing metadata - // as HTTP trailers. (If we had frame-level control of the HTTP/2 layer, we - // could send trailers-only responses as a single HEADER frame and no DATA - // frames, but net/http doesn't expose APIs that low-level.) - if !hc.wroteToBody { - // This block works around a bug in x/net/http2. Until Go 1.20, trailers - // written using http.TrailerPrefix were only sent if either (1) there's - // data in the body, or (2) the innermost http.ResponseWriter is flushed. - // To ensure that we always send a valid gRPC response, even if the user - // has wrapped the response writer in net/http middleware that doesn't - // implement http.Flusher, we must pre-declare our HTTP trailers. We can - // remove this when Go 1.21 ships and we drop support for Go 1.19. - for key := range mergedTrailers { - addHeaderCanonical(hc.responseWriter.Header(), headerTrailer, key) - } - hc.responseWriter.WriteHeader(http.StatusOK) - for key, values := range mergedTrailers { - for _, value := range values { - // These are potentially user-supplied, so we can't assume they're in - // canonical form. Don't use addHeaderCanonical. - hc.responseWriter.Header().Add(key, value) - } - } - return nil - } - // In net/http's ResponseWriter API, we send HTTP trailers by writing to the - // headers map with a special prefix. This prefixing is an implementation - // detail, so we should hide it and _not_ mutate the user-visible headers. - // - // Note that this is _very_ finicky and difficult to test with net/http, - // since correctness depends on low-level framing details. Breaking this - // logic breaks Envoy's gRPC-Web translation. - for key, values := range mergedTrailers { - for _, value := range values { - // These are potentially user-supplied, so we can't assume they're in - // canonical form. Don't use addHeaderCanonical. - hc.responseWriter.Header().Add(http.TrailerPrefix+key, value) - } - } - return nil -} - -type grpcMarshaler struct { - envelopeWriter -} - -func (m *grpcMarshaler) MarshalWebTrailers(trailer http.Header) *Error { - raw := m.envelopeWriter.bufferPool.Get() - defer m.envelopeWriter.bufferPool.Put(raw) - for key, values := range trailer { - // Per the Go specification, keys inserted during iteration may be produced - // later in the iteration or may be skipped. For safety, avoid mutating the - // map if the key is already lower-cased. - lower := strings.ToLower(key) - if key == lower { - continue - } - delete(trailer, key) - trailer[lower] = values - } - if err := trailer.Write(raw); err != nil { - return errorf(CodeInternal, "format trailers: %w", err) - } - return m.Write(&envelope{ - Data: raw, - Flags: grpcFlagEnvelopeTrailer, - }) -} - -type grpcUnmarshaler struct { - envelopeReader envelopeReader - web bool - webTrailer http.Header -} - -func (u *grpcUnmarshaler) Unmarshal(message any) *Error { - err := u.envelopeReader.Unmarshal(message) - if err == nil { - return nil - } - if !errors.Is(err, errSpecialEnvelope) { - return err - } - env := u.envelopeReader.last - if !u.web || !env.IsSet(grpcFlagEnvelopeTrailer) { - return errorf(CodeInternal, "protocol error: invalid envelope flags %d", env.Flags) - } - - // Per the gRPC-Web specification, trailers should be encoded as an HTTP/1 - // headers block _without_ the terminating newline. To make the headers - // parseable by net/textproto, we need to add the newline. - if err := env.Data.WriteByte('\n'); err != nil { - return errorf(CodeInternal, "unmarshal web trailers: %w", err) - } - bufferedReader := bufio.NewReader(env.Data) - mimeReader := textproto.NewReader(bufferedReader) - mimeHeader, mimeErr := mimeReader.ReadMIMEHeader() - if mimeErr != nil { - return errorf( - CodeInternal, - "gRPC-Web protocol error: trailers invalid: %w", - mimeErr, - ) - } - u.webTrailer = http.Header(mimeHeader) - return errSpecialEnvelope -} - -func (u *grpcUnmarshaler) WebTrailer() http.Header { - return u.webTrailer -} - -func grpcValidateResponse( - response *http.Response, - header, trailer http.Header, - availableCompressors readOnlyCompressionPools, - protobuf Codec, -) *Error { - if response.StatusCode != http.StatusOK { - return errorf(grpcHTTPToCode(response.StatusCode), "HTTP status %v", response.Status) - } - if compression := getHeaderCanonical(response.Header, grpcHeaderCompression); compression != "" && - compression != compressionIdentity && - !availableCompressors.Contains(compression) { - // Per https://github.com/grpc/grpc/blob/master/doc/compression.md, we - // should return CodeInternal and specify acceptable compression(s) (in - // addition to setting the Grpc-Accept-Encoding header). - return errorf( - CodeInternal, - "unknown encoding %q: accepted encodings are %v", - compression, - availableCompressors.CommaSeparatedNames(), - ) - } - // When there's no body, gRPC and gRPC-Web servers may send error information - // in the HTTP headers. - if err := grpcErrorFromTrailer( - protobuf, - response.Header, - ); err != nil && !errors.Is(err, errTrailersWithoutGRPCStatus) { - // Per the specification, only the HTTP status code and Content-Type should - // be treated as headers. The rest should be treated as trailing metadata. - if contentType := getHeaderCanonical(response.Header, headerContentType); contentType != "" { - setHeaderCanonical(header, headerContentType, contentType) - } - mergeHeaders(trailer, response.Header) - delHeaderCanonical(trailer, headerContentType) - // Also set the error metadata - err.meta = header.Clone() - mergeHeaders(err.meta, trailer) - return err - } - // The response is valid, so we should expose the headers. - mergeHeaders(header, response.Header) - return nil -} - -func grpcHTTPToCode(httpCode int) Code { - // https://github.com/grpc/grpc/blob/master/doc/http-grpc-status-mapping.md - // Note that this is not just the inverse of the gRPC-to-HTTP mapping. - switch httpCode { - case 400: - return CodeInternal - case 401: - return CodeUnauthenticated - case 403: - return CodePermissionDenied - case 404: - return CodeUnimplemented - case 429: - return CodeUnavailable - case 502, 503, 504: - return CodeUnavailable - default: - return CodeUnknown - } -} - -// The gRPC wire protocol specifies that errors should be serialized using the -// binary Protobuf format, even if the messages in the request/response stream -// use a different codec. Consequently, this function needs a Protobuf codec to -// unmarshal error information in the headers. -func grpcErrorFromTrailer(protobuf Codec, trailer http.Header) *Error { - codeHeader := getHeaderCanonical(trailer, grpcHeaderStatus) - if codeHeader == "" { - return NewError(CodeInternal, errTrailersWithoutGRPCStatus) - } - if codeHeader == "0" { - return nil - } - - code, err := strconv.ParseUint(codeHeader, 10 /* base */, 32 /* bitsize */) - if err != nil { - return errorf(CodeInternal, "gRPC protocol error: invalid error code %q", codeHeader) - } - message := grpcPercentDecode(getHeaderCanonical(trailer, grpcHeaderMessage)) - retErr := NewWireError(Code(code), errors.New(message)) - - detailsBinaryEncoded := getHeaderCanonical(trailer, grpcHeaderDetails) - if len(detailsBinaryEncoded) > 0 { - detailsBinary, err := DecodeBinaryHeader(detailsBinaryEncoded) - if err != nil { - return errorf(CodeInternal, "server returned invalid grpc-status-details-bin trailer: %w", err) - } - var status statusv1.Status - if err := protobuf.Unmarshal(detailsBinary, &status); err != nil { - return errorf(CodeInternal, "server returned invalid protobuf for error details: %w", err) - } - for _, d := range status.Details { - retErr.details = append(retErr.details, &ErrorDetail{pb: d}) - } - // Prefer the Protobuf-encoded data to the headers (grpc-go does this too). - retErr.code = Code(status.Code) - retErr.err = errors.New(status.Message) - } - - return retErr -} - -func grpcParseTimeout(timeout string) (time.Duration, error) { - if timeout == "" { - return 0, errNoTimeout - } - unit, ok := grpcTimeoutUnitLookup[timeout[len(timeout)-1]] - if !ok { - return 0, fmt.Errorf("gRPC protocol error: timeout %q has invalid unit", timeout) - } - num, err := strconv.ParseInt(timeout[:len(timeout)-1], 10 /* base */, 64 /* bitsize */) - if err != nil || num < 0 { - return 0, fmt.Errorf("gRPC protocol error: invalid timeout %q", timeout) - } - if num > 99999999 { // timeout must be ASCII string of at most 8 digits - return 0, fmt.Errorf("gRPC protocol error: timeout %q is too long", timeout) - } - if unit == time.Hour && num > grpcTimeoutMaxHours { - // Timeout is effectively unbounded, so ignore it. The grpc-go - // implementation does the same thing. - return 0, errNoTimeout - } - return time.Duration(num) * unit, nil -} - -func grpcEncodeTimeout(timeout time.Duration) (string, error) { - if timeout <= 0 { - return "0n", nil - } - for _, pair := range grpcTimeoutUnits { - digits := strconv.FormatInt(int64(timeout/pair.size), 10 /* base */) - if len(digits) < grpcMaxTimeoutChars { - return digits + string(pair.char), nil - } - } - // The max time.Duration is smaller than the maximum expressible gRPC - // timeout, so we can't reach this case. - return "", errNoTimeout -} - -func grpcCodecFromContentType(web bool, contentType string) string { - if (!web && contentType == grpcContentTypeDefault) || (web && contentType == grpcWebContentTypeDefault) { - // implicitly protobuf - return codecNameProto - } - prefix := grpcContentTypePrefix - if web { - prefix = grpcWebContentTypePrefix - } - return strings.TrimPrefix(contentType, prefix) -} - -func grpcContentTypeFromCodecName(web bool, name string) string { - if web { - return grpcWebContentTypePrefix + name - } - return grpcContentTypePrefix + name -} - -func grpcErrorToTrailer(trailer http.Header, protobuf Codec, err error) { - if err == nil { - setHeaderCanonical(trailer, grpcHeaderStatus, "0") // zero is the gRPC OK status - setHeaderCanonical(trailer, grpcHeaderMessage, "") - return - } - status := grpcStatusFromError(err) - code := strconv.Itoa(int(status.Code)) - bin, binErr := protobuf.Marshal(status) - if binErr != nil { - setHeaderCanonical( - trailer, - grpcHeaderStatus, - strconv.FormatInt(int64(CodeInternal), 10 /* base */), - ) - setHeaderCanonical( - trailer, - grpcHeaderMessage, - grpcPercentEncode( - fmt.Sprintf("marshal protobuf status: %v", binErr), - ), - ) - return - } - if connectErr, ok := asError(err); ok { - mergeHeaders(trailer, connectErr.meta) - } - setHeaderCanonical(trailer, grpcHeaderStatus, code) - setHeaderCanonical(trailer, grpcHeaderMessage, grpcPercentEncode(status.Message)) - setHeaderCanonical(trailer, grpcHeaderDetails, EncodeBinaryHeader(bin)) -} - -func grpcStatusFromError(err error) *statusv1.Status { - status := &statusv1.Status{ - Code: int32(CodeUnknown), - Message: err.Error(), - } - if connectErr, ok := asError(err); ok { - status.Code = int32(connectErr.Code()) - status.Message = connectErr.Message() - status.Details = connectErr.detailsAsAny() - } - return status -} - -// grpcPercentEncode follows RFC 3986 Section 2.1 and the gRPC HTTP/2 spec. -// It's a variant of URL-encoding with fewer reserved characters. It's intended -// to take UTF-8 encoded text and escape non-ASCII bytes so that they're valid -// HTTP/1 headers, while still maximizing readability of the data on the wire. -// -// The grpc-message trailer (used for human-readable error messages) should be -// percent-encoded. -// -// References: -// -// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#responses -// https://datatracker.ietf.org/doc/html/rfc3986#section-2.1 -func grpcPercentEncode(msg string) string { - for i := 0; i < len(msg); i++ { - // Characters that need to be escaped are defined in gRPC's HTTP/2 spec. - // They're different from the generic set defined in RFC 3986. - if c := msg[i]; c < ' ' || c > '~' || c == '%' { - return grpcPercentEncodeSlow(msg, i) - } - } - return msg -} - -// msg needs some percent-escaping. Bytes before offset don't require -// percent-encoding, so they can be copied to the output as-is. -func grpcPercentEncodeSlow(msg string, offset int) string { - var out strings.Builder - out.Grow(2 * len(msg)) - out.WriteString(msg[:offset]) - for i := offset; i < len(msg); i++ { - c := msg[i] - if c < ' ' || c > '~' || c == '%' { - fmt.Fprintf(&out, "%%%02X", c) - continue - } - out.WriteByte(c) - } - return out.String() -} - -func grpcPercentDecode(encoded string) string { - for i := 0; i < len(encoded); i++ { - if c := encoded[i]; c == '%' && i+2 < len(encoded) { - return grpcPercentDecodeSlow(encoded, i) - } - } - return encoded -} - -// Similar to percentEncodeSlow: encoded is percent-encoded, and needs to be -// decoded byte-by-byte starting at offset. -func grpcPercentDecodeSlow(encoded string, offset int) string { - var out strings.Builder - out.Grow(len(encoded)) - out.WriteString(encoded[:offset]) - for i := offset; i < len(encoded); i++ { - c := encoded[i] - if c != '%' || i+2 >= len(encoded) { - out.WriteByte(c) - continue - } - parsed, err := strconv.ParseUint(encoded[i+1:i+3], 16 /* hex */, 8 /* bitsize */) - if err != nil { - out.WriteRune(utf8.RuneError) - } else { - out.WriteByte(byte(parsed)) - } - i += 2 - } - return out.String() -} diff --git a/vendor/github.com/bufbuild/connect-go/recover.go b/vendor/github.com/bufbuild/connect-go/recover.go deleted file mode 100644 index 5cda08a9ac..0000000000 --- a/vendor/github.com/bufbuild/connect-go/recover.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2021-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package connect - -import ( - "context" - "net/http" -) - -// recoverHandlerInterceptor lets handlers trap panics, perform side effects -// (like emitting logs or metrics), and present a friendlier error message to -// clients. -// -// This interceptor uses a somewhat unusual strategy to recover from panics. -// The standard recovery idiom: -// -// if r := recover(); r != nil { ... } -// -// isn't robust in the face of user error, because it doesn't handle -// panic(nil). This occasionally happens by mistake, and it's a beast to debug -// without a more robust idiom. See https://github.com/golang/go/issues/25448 -// for details. -type recoverHandlerInterceptor struct { - Interceptor - - handle func(context.Context, Spec, http.Header, any) error -} - -func (i *recoverHandlerInterceptor) WrapUnary(next UnaryFunc) UnaryFunc { - return func(ctx context.Context, req AnyRequest) (_ AnyResponse, retErr error) { - if req.Spec().IsClient { - return next(ctx, req) - } - panicked := true - defer func() { - if panicked { - r := recover() - // net/http checks for ErrAbortHandler with ==, so we should too. - if r == http.ErrAbortHandler { //nolint:errorlint,goerr113 - panic(r) //nolint:forbidigo - } - retErr = i.handle(ctx, req.Spec(), req.Header(), r) - } - }() - res, err := next(ctx, req) - panicked = false - return res, err - } -} - -func (i *recoverHandlerInterceptor) WrapStreamingHandler(next StreamingHandlerFunc) StreamingHandlerFunc { - return func(ctx context.Context, conn StreamingHandlerConn) (retErr error) { - panicked := true - defer func() { - if panicked { - r := recover() - // net/http checks for ErrAbortHandler with ==, so we should too. - if r == http.ErrAbortHandler { //nolint:errorlint,goerr113 - panic(r) //nolint:forbidigo - } - retErr = i.handle(ctx, Spec{}, nil, r) - } - }() - err := next(ctx, conn) - panicked = false - return err - } -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/.gitignore b/vendor/github.com/bufbuild/connect-opentelemetry-go/.gitignore deleted file mode 100644 index 987d6a1c8e..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/.tmp/ -*.pprof -*.svg -cover.out diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/.golangci.yml b/vendor/github.com/bufbuild/connect-opentelemetry-go/.golangci.yml deleted file mode 100644 index 991bcecd69..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/.golangci.yml +++ /dev/null @@ -1,74 +0,0 @@ -run: - skip-dirs-use-default: false -linters-settings: - dupl: - threshold: 200 - errcheck: - check-type-assertions: true - exhaustruct: - include: - # No zero values for param structs. - - 'github\.com/bufbuild/connect-opentelemetry-go\..*[pP]arams' - forbidigo: - forbid: - - '^fmt\.Print' - - '^log\.' - - '^print$' - - '^println$' - - '^panic$' - importas: - no-unaliased: true - alias: - - pkg: github.com/bufbuild/connect-go - alias: connect - - pkg: github.com/bufbuild/connect-opentelemetry-go/internal/gen/observability/ping/v1 - alias: pingv1 - godox: - # TODO, OPT, etc. comments are fine to commit. Use FIXME comments for - # temporary hacks, and use godox to prevent committing them. - keywords: [FIXME] - varnamelen: - ignore-decls: - - T any - - i int - - wg sync.WaitGroup -linters: - enable-all: true - disable: - - cyclop # covered by gocyclo - - deadcode # abandoned - - exhaustivestruct # replaced by exhaustruct - - funlen # rely on code review to limit function length - - gocognit # dubious "cognitive overhead" quantification - - gofumpt # prefer standard gofmt - - goimports # rely on gci instead - - golint # deprecated by Go team - - gomnd # some unnamed constants are okay - - ifshort # deprecated by author - - interfacer # deprecated by author - - ireturn # "accept interfaces, return structs" isn't ironclad - - lll # don't want hard limits for line length - - maintidx # covered by gocyclo - - maligned # readability trumps efficient struct packing - - nlreturn # generous whitespace violates house style - - nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065 - - scopelint # deprecated by author - - structcheck # abandoned - - testpackage # internal tests are fine - - varcheck # abandoned - - wrapcheck # don't _always_ need to wrap errors - - wsl # generous whitespace violates house style -issues: - exclude: - # Don't ban use of fmt.Errorf to create new errors, but the remaining - # checks from err113 are useful. - - "err113: do not define dynamic errors.*" - - exclude-rules: - # If-else is clearer than switch here. - - linters: [gocritic] - path: trace.go - # interceptor_test tests a lot of data structure equality so naturally there are - # a lot of duplications - - path: interceptor_test.go - linters: [dupl] diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/LICENSE b/vendor/github.com/bufbuild/connect-opentelemetry-go/LICENSE deleted file mode 100644 index 55f1dcc150..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2022-2023 Buf Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/Makefile b/vendor/github.com/bufbuild/connect-opentelemetry-go/Makefile deleted file mode 100644 index 81ec31627d..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# See https://tech.davis-hansson.com/p/make/ -SHELL := bash -.DELETE_ON_ERROR: -.SHELLFLAGS := -eu -o pipefail -c -.DEFAULT_GOAL := all -MAKEFLAGS += --warn-undefined-variables -MAKEFLAGS += --no-builtin-rules -MAKEFLAGS += --no-print-directory -BIN := $(abspath .tmp/bin) -COPYRIGHT_YEARS := 2022-2023 -LICENSE_IGNORE := -e /gen/ -# Set to use a different compiler. For example, `GO=go1.18rc1 make test`. -GO ?= go - -.PHONY: help -help: ## Describe useful make targets - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' - -.PHONY: all -all: ## Build, test, and lint (default) - $(MAKE) test - $(MAKE) lint - -.PHONY: clean -clean: ## Delete intermediate build artifacts - @# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs - git clean -Xdf - -.PHONY: test -test: build ## Run unit tests - $(GO) test -vet=off -race -cover ./... - -.PHONY: build -build: generate ## Build all packages - $(GO) build ./... - -.PHONY: lint -lint: $(BIN)/golangci-lint $(BIN)/buf ## Lint Go and protobuf - test -z "$$($(BIN)/buf format -d . | tee /dev/stderr)" - $(GO) vet ./... - $(BIN)/golangci-lint run - $(BIN)/buf lint - -.PHONY: lintfix -lintfix: $(BIN)/golangci-lint $(BIN)/buf ## Automatically fix some lint errors - $(BIN)/golangci-lint run --fix - $(BIN)/buf format -w . - -.PHONY: generate -generate: $(BIN)/buf $(BIN)/protoc-gen-go $(BIN)/protoc-gen-connect-go $(BIN)/license-header ## Regenerate code and licenses - rm -rf internal/gen - PATH=$(BIN) $(BIN)/buf generate - @# We want to operate on a list of modified and new files, excluding - @# deleted and ignored files. git-ls-files can't do this alone. comm -23 takes - @# two files and prints the union, dropping lines common to both (-3) and - @# those only in the second file (-2). We make one git-ls-files call for - @# the modified, cached, and new (--others) files, and a second for the - @# deleted files. - comm -23 \ - <(git ls-files --cached --modified --others --no-empty-directory --exclude-standard | sort -u | grep -v $(LICENSE_IGNORE) ) \ - <(git ls-files --deleted | sort -u) | \ - xargs $(BIN)/license-header \ - --license-type apache \ - --copyright-holder "Buf Technologies, Inc." \ - --year-range "$(COPYRIGHT_YEARS)" - -.PHONY: upgrade -upgrade: ## Upgrade dependencies - go get -u -t ./... && go mod tidy -v - -.PHONY: checkgenerate -checkgenerate: - @# Used in CI to verify that `make generate` doesn't produce a diff. - test -z "$$(git status --porcelain | tee /dev/stderr)" - -$(BIN)/protoc-gen-connect-go: go.mod - @mkdir -p $(@D) - @# The version of protoc-gen-connect-go is determined by the version in go.mod - GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/connect-go/cmd/protoc-gen-connect-go - -$(BIN)/buf: Makefile - @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install github.com/bufbuild/buf/cmd/buf@v1.9.0 - -$(BIN)/license-header: Makefile - @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install \ - github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v1.9.0 - -$(BIN)/golangci-lint: Makefile - @mkdir -p $(@D) - GOBIN=$(abspath $(@D)) $(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0 - -$(BIN)/protoc-gen-go: Makefile - @mkdir -p $(@D) - @# The version of protoc-gen-go is determined by the version in go.mod - GOBIN=$(abspath $(@D)) $(GO) install google.golang.org/protobuf/cmd/protoc-gen-go - diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/README.md b/vendor/github.com/bufbuild/connect-opentelemetry-go/README.md deleted file mode 100644 index eb640c6b3f..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/README.md +++ /dev/null @@ -1,139 +0,0 @@ -connect-opentelemetry-go -======================== - -[![Build](https://github.com/bufbuild/connect-opentelemetry-go/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bufbuild/connect-opentelemetry-go/actions/workflows/ci.yaml) -[![Report Card](https://goreportcard.com/badge/github.com/bufbuild/connect-opentelemetry-go)](https://goreportcard.com/report/github.com/bufbuild/connect-opentelemetry-go) -[![GoDoc](https://pkg.go.dev/badge/github.com/bufbuild/connect-opentelemetry-go.svg)][godoc] - -`connect-opentelemetry-go` adds support for [OpenTelemetry][opentelemetry.io] -tracing and metrics collection to [connect-go] servers and clients. - -For more on Connect, OpenTelemetry, and `otelconnect`, see the [Connect -announcement blog post][blog] and the observability documentation on -[connect.build](https://connect.build/docs/go/observability/). - -## An example - -```go -package main - -import ( - "context" - "fmt" - "log" - "net/http" - - connect "github.com/bufbuild/connect-go" - otelconnect "github.com/bufbuild/connect-opentelemetry-go" - // Generated from your protobuf schema by protoc-gen-go and - // protoc-gen-connect-go. - pingv1 "github.com/bufbuild/connect-opentelemetry-go/internal/gen/observability/ping/v1" - "github.com/bufbuild/connect-opentelemetry-go/internal/gen/observability/ping/v1/pingv1connect" -) - -func main() { - mux := http.NewServeMux() - - // otelconnect.NewInterceptor provides an interceptor that adds tracing and - // metrics to both clients and handlers. By default, it uses OpenTelemetry's - // global TracerProvider and MeterProvider, which you can configure by - // following the OpenTelemetry documentation. If you'd prefer to avoid - // globals, use otelconnect.WithTracerProvider and - // otelconnect.WithMeterProvider. - mux.Handle(pingv1connect.NewPingServiceHandler( - &pingv1connect.UnimplementedPingServiceHandler{}, - connect.WithInterceptors(otelconnect.NewInterceptor()), - )) - - http.ListenAndServe("localhost:8080", mux) -} - -func makeRequest() { - client := pingv1connect.NewPingServiceClient( - http.DefaultClient, - "http://localhost:8080", - connect.WithInterceptors(otelconnect.NewInterceptor()), - ) - resp, err := client.Ping( - context.Background(), - connect.NewRequest(&pingv1.PingRequest{}), - ) - if err != nil { - log.Fatal(err) - } - fmt.Println(resp) -} - -``` - -## Configuration for internal services - -By default, instrumented servers are conservative and behave as though they're -internet-facing. They don't trust any tracing information sent by the client, -and will create new trace spans for each request. The new spans are linked to -the remote span for reference (using OpenTelemetry's -[`trace.Link`](https://pkg.go.dev/go.opentelemetry.io/otel/trace#Link)), but -tracing UIs will display the request as a new top-level transaction. - -If your server is deployed as an internal service, configure `otelconnect` to -trust the client's tracing information using -[`otelconnect.WithTrustRemote`][WithTrustRemote]. With this option, servers -will create child spans for each request. - -## Reducing metrics and tracing cardinality - -By default, the [OpenTelemetry RPC conventions][otel-rpc-conventions] produce -high-cardinality server-side metric and tracing output. In particular, servers -tag all metrics and trace data with the server's IP address and the remote port -number. To drop these attributes, use -[`otelconnect.WithoutServerPeerAttributes`][WithoutServerPeerAttributes]. For -more customizable attribute filtering, use -[otelconnect.WithFilter][WithFilter]. - -## Status - -| | Unary | Streaming Client | Streaming Handler | -|---------|:-----:|:----------------:|:-----------------:| -| Metrics | ✅ | ✅ | ✅ | -| Tracing | ✅ | ✅ | ✅ | - -## Ecosystem - -* [connect-go]: Service handlers and clients for GoLang -* [connect-swift]: Swift clients for idiomatic gRPC & Connect RPC -* [connect-kotlin]: Kotlin clients for idiomatic gRPC & Connect RPC -* [connect-web]: TypeScript clients for web browsers -* [Buf Studio]: web UI for ad-hoc RPCs -* [connect-crosstest]: gRPC and gRPC-Web interoperability tests - -## Support and Versioning - -`connect-opentelemetry-go` supports: - -* The [two most recent major releases][go-support-policy] of Go. -* v1 of the `go.opentelemetry.io/otel` tracing and metrics SDK. - -## Legal - -Offered under the [Apache 2 license][license]. - -[Buf Studio]: https://buf.build/studio -[Getting Started]: https://connect.build/docs/go/getting-started -[WithFilter]: https://pkg.go.dev/github.com/bufbuild/connect-opentelemetry-go#WithFilter -[WithTrustRemote]: https://pkg.go.dev/github.com/bufbuild/connect-opentelemetry-go#WithTrustRemote -[WithoutServerPeerAttributes]: https://pkg.go.dev/github.com/bufbuild/connect-opentelemetry-go#WithoutServerPeerAttributes -[blog]: https://buf.build/blog/connect-a-better-grpc -[connect-crosstest]: https://github.com/bufbuild/connect-crosstest -[connect-go]: https://github.com/bufbuild/connect-go -[connect-kotlin]: https://github.com/bufbuild/connect-kotlin -[connect-swift]: https://github.com/bufbuild/connect-swift -[connect-web]: https://www.npmjs.com/package/@bufbuild/connect-web -[demo]: https://github.com/bufbuild/connect-demo -[docs]: https://connect.build -[go-support-policy]: https://golang.org/doc/devel/release#policy -[godoc]: https://pkg.go.dev/github.com/bufbuild/connect-opentelemetry-go -[license]: https://github.com/bufbuild/connect-opentelemetry-go/blob/main/LICENSE -[opentelemetry.io]: https://opentelemetry.io/ -[otel-go-quickstart]: https://opentelemetry.io/docs/instrumentation/go/getting-started/ -[otel-go]: https://github.com/open-telemetry/opentelemetry-go -[otel-rpc-conventions]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/attributes.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/attributes.go deleted file mode 100644 index 7987074977..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/attributes.go +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "fmt" - "net" - "net/http" - "strconv" - "strings" - - connect "github.com/bufbuild/connect-go" - "go.opentelemetry.io/otel/attribute" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" -) - -// AttributeFilter is used to filter attributes out based on the [Request] and [attribute.KeyValue]. -// If the filter returns true the attribute will be kept else it will be removed. -// AttributeFilter must be safe to call concurrently. -type AttributeFilter func(*Request, attribute.KeyValue) bool - -func (filter AttributeFilter) filter(request *Request, values ...attribute.KeyValue) []attribute.KeyValue { - if filter == nil { - return values - } - // Assign a new slice of zero length with the same underlying - // array as the values slice. This avoids unnecessary memory allocations. - filteredValues := values[:0] - for _, attr := range values { - if filter(request, attr) { - filteredValues = append(filteredValues, attr) - } - } - for i := len(filteredValues); i < len(values); i++ { - values[i] = attribute.KeyValue{} - } - return filteredValues -} - -func procedureAttributes(procedure string) []attribute.KeyValue { - parts := strings.SplitN(procedure, "/", 2) - var attrs []attribute.KeyValue - switch len(parts) { - case 0: - return attrs // invalid - case 1: - // fall back to treating the whole string as the method - if method := parts[0]; method != "" { - attrs = append(attrs, semconv.RPCMethodKey.String(method)) - } - default: - if svc := parts[0]; svc != "" { - attrs = append(attrs, semconv.RPCServiceKey.String(svc)) - } - if method := parts[1]; method != "" { - attrs = append(attrs, semconv.RPCMethodKey.String(method)) - } - } - return attrs -} - -func requestAttributes(req *Request) []attribute.KeyValue { - var attrs []attribute.KeyValue - if addr := req.Peer.Addr; addr != "" { - attrs = append(attrs, addressAttributes(addr)...) - } - name := strings.TrimLeft(req.Spec.Procedure, "/") - protocol := protocolToSemConv(req.Peer.Protocol) - attrs = append(attrs, semconv.RPCSystemKey.String(protocol)) - attrs = append(attrs, procedureAttributes(name)...) - return attrs -} - -func addressAttributes(address string) []attribute.KeyValue { - if host, port, err := net.SplitHostPort(address); err == nil { - portInt, err := strconv.Atoi(port) - if err == nil { - return []attribute.KeyValue{ - semconv.NetPeerNameKey.String(host), - semconv.NetPeerPortKey.Int(portInt), - } - } - } - return []attribute.KeyValue{semconv.NetPeerNameKey.String(address)} -} - -func statusCodeAttribute(protocol string, serverErr error) (attribute.KeyValue, bool) { - // Following the respective specifications, use integers and "status_code" for - // gRPC codes in contrast to strings and "error_code" for Connect codes. - switch protocol { - case grpcProtocol, grpcwebProtocol: - codeKey := attribute.Key("rpc." + protocol + ".status_code") - if serverErr != nil { - return codeKey.Int64(int64(connect.CodeOf(serverErr))), true - } - return codeKey.Int64(0), true // gRPC uses 0 for success - case connectProtocol: - if connect.IsNotModifiedError(serverErr) { - // A "not modified" error is special: it's code is technically "unknown" but - // it would be misleading to label it as an unknown error since it's not really - // an error, but rather a sentinel to trigger a "304 Not Modified" HTTP status. - return semconv.HTTPStatusCodeKey.Int(http.StatusNotModified), true - } - codeKey := attribute.Key("rpc." + protocol + ".error_code") - if serverErr != nil { - return codeKey.String(connect.CodeOf(serverErr).String()), true - } - } - return attribute.KeyValue{}, false -} - -func headerAttributes(protocol, eventType string, metadata http.Header, allowedKeys []string) []attribute.KeyValue { - attributes := make([]attribute.KeyValue, 0, len(allowedKeys)) - for _, allowedKey := range allowedKeys { - if val, ok := metadata[allowedKey]; ok { - keyValue := attribute.StringSlice( - formatHeaderAttributeKey(protocol, eventType, allowedKey), - val, - ) - attributes = append(attributes, keyValue) - } - } - return attributes -} - -// formatHeaderAttributeKey formats header attributes as suggested by the OpenTelemetry specification: -// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md#grpc-request-and-response-metadata -func formatHeaderAttributeKey(protocol, eventType, key string) string { - key = strings.ReplaceAll(strings.ToLower(key), "-", "_") - return fmt.Sprintf("rpc.%s.%s.metadata.%s", protocol, eventType, key) -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.gen.yaml b/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.gen.yaml deleted file mode 100644 index 4f7f856d85..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.gen.yaml +++ /dev/null @@ -1,12 +0,0 @@ -version: v1 -managed: - enabled: true - go_package_prefix: - default: github.com/bufbuild/connect-opentelemetry-go/internal/gen -plugins: - - name: go - out: internal/gen - opt: paths=source_relative - - name: connect-go - out: internal/gen - opt: paths=source_relative diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.work.yaml b/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.work.yaml deleted file mode 100644 index 30f1e1ff0c..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/buf.work.yaml +++ /dev/null @@ -1,3 +0,0 @@ -version: v1 -directories: - - internal/proto diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/doc.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/doc.go deleted file mode 100644 index 5ae5d5939f..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package otelconnect provides OpenTelemetry tracing and metrics for -// [github.com/bufbuild/connect-go] servers and clients. -// The specification followed was the [OpenTelemetry specification] with both the [rpc metrics specification] and [rpc trace specification] implemented. -// -// [OpenTelemetry specification]: https://github.com/open-telemetry/opentelemetry-specification -// [rpc metrics specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/semantic_conventions/rpc-metrics.md -// [rpc trace specification]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/rpc.md -package otelconnect diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/instruments.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/instruments.go deleted file mode 100644 index 665f95f4ea..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/instruments.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "fmt" - "sync" - - "go.opentelemetry.io/otel/metric" -) - -const ( - metricKeyFormat = "rpc.%s.%s" - durationKey = "duration" - requestSizeKey = "request.size" - responseSizeKey = "response.size" - requestsPerRPCKey = "requests_per_rpc" - responsesPerRPCKey = "responses_per_rpc" - messageKey = "message" - serverKey = "server" - clientKey = "client" - requestKey = "request" - responseKey = "response" - unitDimensionless = "1" - unitBytes = "By" - unitMilliseconds = "ms" -) - -type instruments struct { - initOnce sync.Once - initErr error - duration metric.Int64Histogram - requestSize metric.Int64Histogram - responseSize metric.Int64Histogram - requestsPerRPC metric.Int64Histogram - responsesPerRPC metric.Int64Histogram -} - -func (i *instruments) init(meter metric.Meter, isClient bool) { - i.initOnce.Do(func() { - interceptorType := serverKey - if isClient { - interceptorType = clientKey - } - i.duration, i.initErr = meter.Int64Histogram( - formatkeys(interceptorType, durationKey), - metric.WithUnit(unitMilliseconds), - ) - if i.initErr != nil { - return - } - i.requestSize, i.initErr = meter.Int64Histogram( - formatkeys(interceptorType, requestSizeKey), - metric.WithUnit(unitBytes), - ) - if i.initErr != nil { - return - } - i.responseSize, i.initErr = meter.Int64Histogram( - formatkeys(interceptorType, responseSizeKey), - metric.WithUnit(unitBytes), - ) - if i.initErr != nil { - return - } - i.requestsPerRPC, i.initErr = meter.Int64Histogram( - formatkeys(interceptorType, requestsPerRPCKey), - metric.WithUnit(unitDimensionless), - ) - if i.initErr != nil { - return - } - i.responsesPerRPC, i.initErr = meter.Int64Histogram( - formatkeys(interceptorType, responsesPerRPCKey), - metric.WithUnit(unitDimensionless), - ) - }) -} - -func formatkeys(interceptorType string, metricName string) string { - return fmt.Sprintf(metricKeyFormat, interceptorType, metricName) -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/interceptor.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/interceptor.go deleted file mode 100644 index 9d6620cf42..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/interceptor.go +++ /dev/null @@ -1,356 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "context" - "errors" - "strings" - "sync" - "time" - - connect "github.com/bufbuild/connect-go" - "go.opentelemetry.io/otel" - "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.20.0" - "go.opentelemetry.io/otel/trace" - "google.golang.org/protobuf/proto" -) - -// Interceptor implements [connect.Interceptor] that adds -// OpenTelemetry metrics and tracing to connect handlers and clients. -type Interceptor struct { - config config - clientInstruments instruments - handlerInstruments instruments -} - -var _ connect.Interceptor = &Interceptor{} - -// NewInterceptor constructs and returns an Interceptor which implements [connect.Interceptor] -// that adds OpenTelemetry metrics and tracing to Connect handlers and clients. -func NewInterceptor(options ...Option) *Interceptor { - cfg := config{ - now: time.Now, - tracer: otel.GetTracerProvider().Tracer( - instrumentationName, - trace.WithInstrumentationVersion(semanticVersion), - ), - propagator: otel.GetTextMapPropagator(), - meter: otel.GetMeterProvider().Meter( - instrumentationName, - metric.WithInstrumentationVersion(semanticVersion)), - } - for _, opt := range options { - opt.apply(&cfg) - } - return &Interceptor{ - config: cfg, - } -} - -func (i *Interceptor) getAndInitInstrument(isClient bool) (*instruments, error) { - if isClient { - i.clientInstruments.init(i.config.meter, isClient) - return &i.clientInstruments, i.clientInstruments.initErr - } - i.handlerInstruments.init(i.config.meter, isClient) - return &i.handlerInstruments, i.handlerInstruments.initErr -} - -// WrapUnary implements otel tracing and metrics for unary handlers. -func (i *Interceptor) WrapUnary(next connect.UnaryFunc) connect.UnaryFunc { - return func(ctx context.Context, request connect.AnyRequest) (connect.AnyResponse, error) { - requestStartTime := i.config.now() - req := &Request{ - Spec: request.Spec(), - Peer: request.Peer(), - Header: request.Header(), - } - if i.config.filter != nil { - if !i.config.filter(ctx, req) { - return next(ctx, request) - } - } - attributeFilter := i.config.filterAttribute.filter - isClient := request.Spec().IsClient - name := strings.TrimLeft(request.Spec().Procedure, "/") - protocol := protocolToSemConv(request.Peer().Protocol) - attributes := attributeFilter(req, requestAttributes(req)...) - instrumentation, err := i.getAndInitInstrument(isClient) - if err != nil { - return nil, connect.NewError(connect.CodeInternal, err) - } - carrier := propagation.HeaderCarrier(request.Header()) - spanKind := trace.SpanKindClient - requestSpan, responseSpan := semconv.MessageTypeSent, semconv.MessageTypeReceived - traceOpts := []trace.SpanStartOption{ - trace.WithAttributes(attributes...), - trace.WithAttributes(headerAttributes(protocol, requestKey, req.Header, i.config.requestHeaderKeys)...), - } - if !isClient { - spanKind = trace.SpanKindServer - requestSpan, responseSpan = semconv.MessageTypeReceived, semconv.MessageTypeSent - // if a span already exists in ctx then there must have already been another interceptor - // that set it, so don't extract from carrier. - if !trace.SpanContextFromContext(ctx).IsValid() { - ctx = i.config.propagator.Extract(ctx, carrier) - if !i.config.trustRemote { - traceOpts = append(traceOpts, - trace.WithNewRoot(), - trace.WithLinks(trace.LinkFromContext(ctx)), - ) - } - } - } - traceOpts = append(traceOpts, trace.WithSpanKind(spanKind)) - ctx, span := i.config.tracer.Start( - ctx, - name, - traceOpts..., - ) - defer span.End() - if isClient { - i.config.propagator.Inject(ctx, carrier) - } - var requestSize int - if request != nil { - if msg, ok := request.Any().(proto.Message); ok { - requestSize = proto.Size(msg) - } - } - if !i.config.omitTraceEvents { - span.AddEvent(messageKey, - trace.WithAttributes( - requestSpan, - semconv.MessageIDKey.Int(1), - semconv.MessageUncompressedSizeKey.Int(requestSize), - ), - ) - } - response, err := next(ctx, request) - if statusCode, ok := statusCodeAttribute(protocol, err); ok { - attributes = append(attributes, statusCode) - } - var responseSize int - if err == nil { - if msg, ok := response.Any().(proto.Message); ok { - responseSize = proto.Size(msg) - } - span.SetAttributes(headerAttributes(protocol, responseKey, response.Header(), i.config.responseHeaderKeys)...) - } - if !i.config.omitTraceEvents { - span.AddEvent(messageKey, - trace.WithAttributes( - responseSpan, - semconv.MessageIDKey.Int(1), - semconv.MessageUncompressedSizeKey.Int(responseSize), - ), - ) - } - attributes = attributeFilter(req, attributes...) - span.SetStatus(spanStatus(protocol, err)) - span.SetAttributes(attributes...) - instrumentation.duration.Record(ctx, i.config.now().Sub(requestStartTime).Milliseconds(), metric.WithAttributes(attributes...)) - instrumentation.requestSize.Record(ctx, int64(requestSize), metric.WithAttributes(attributes...)) - instrumentation.requestsPerRPC.Record(ctx, 1, metric.WithAttributes(attributes...)) - instrumentation.responseSize.Record(ctx, int64(responseSize), metric.WithAttributes(attributes...)) - instrumentation.responsesPerRPC.Record(ctx, 1, metric.WithAttributes(attributes...)) - return response, err - } -} - -// WrapStreamingClient implements otel tracing and metrics for streaming connect clients. -func (i *Interceptor) WrapStreamingClient(next connect.StreamingClientFunc) connect.StreamingClientFunc { - return func(ctx context.Context, spec connect.Spec) connect.StreamingClientConn { - requestStartTime := i.config.now() - conn := next(ctx, spec) - instrumentation, err := i.getAndInitInstrument(spec.IsClient) - if err != nil { - return &errorStreamingClientInterceptor{ - StreamingClientConn: conn, - err: connect.NewError(connect.CodeInternal, err), - } - } - req := &Request{ - Spec: conn.Spec(), - Peer: conn.Peer(), - Header: conn.RequestHeader(), - } - if i.config.filter != nil { - if !i.config.filter(ctx, req) { - return conn - } - } - name := strings.TrimLeft(conn.Spec().Procedure, "/") - protocol := protocolToSemConv(conn.Peer().Protocol) - state := newStreamingState( - req, - i.config.filterAttribute, - i.config.omitTraceEvents, - requestAttributes(req), - instrumentation.responseSize, - instrumentation.responsesPerRPC, - instrumentation.requestSize, - instrumentation.requestsPerRPC, - ) - var span trace.Span - var createSpanOnce sync.Once - createSpan := func() { - ctx, span = i.config.tracer.Start( - ctx, - name, - trace.WithSpanKind(trace.SpanKindClient), - trace.WithAttributes(state.attributes...), - trace.WithAttributes(headerAttributes( - protocol, - requestKey, - conn.RequestHeader(), - i.config.requestHeaderKeys)...), - ) - // inject the newly created span into the carrier - carrier := propagation.HeaderCarrier(conn.RequestHeader()) - i.config.propagator.Inject(ctx, carrier) - } - return &streamingClientInterceptor{ - StreamingClientConn: conn, - onClose: func() { - createSpanOnce.Do(createSpan) - // state.attributes is updated with the final error that was recorded. - // If error is nil a "success" is recorded on the span and on the final duration - // metric. The "rpc..status_code" is not defined for any other metrics for - // streams because the error only exists when finishing the stream. - if statusCode, ok := statusCodeAttribute(protocol, state.error); ok { - state.addAttributes(statusCode) - } - span.SetAttributes(state.attributes...) - span.SetAttributes(headerAttributes(protocol, responseKey, conn.ResponseHeader(), i.config.responseHeaderKeys)...) - span.SetStatus(spanStatus(protocol, state.error)) - span.End() - instrumentation.duration.Record(ctx, i.config.now().Sub(requestStartTime).Milliseconds(), metric.WithAttributes(state.attributes...)) - }, - receive: func(msg any, conn connect.StreamingClientConn) error { - return state.receive(ctx, msg, conn) - }, - send: func(msg any, conn connect.StreamingClientConn) error { - createSpanOnce.Do(createSpan) - return state.send(ctx, msg, conn) - }, - } - } -} - -// WrapStreamingHandler implements otel tracing and metrics for streaming connect handlers. -func (i *Interceptor) WrapStreamingHandler(next connect.StreamingHandlerFunc) connect.StreamingHandlerFunc { - return func(ctx context.Context, conn connect.StreamingHandlerConn) error { - requestStartTime := i.config.now() - isClient := conn.Spec().IsClient - instrumentation, err := i.getAndInitInstrument(isClient) - if err != nil { - return err - } - req := &Request{ - Spec: conn.Spec(), - Peer: conn.Peer(), - Header: conn.RequestHeader(), - } - if i.config.filter != nil { - if !i.config.filter(ctx, req) { - return next(ctx, conn) - } - } - protocol := protocolToSemConv(req.Peer.Protocol) - name := strings.TrimLeft(conn.Spec().Procedure, "/") - state := newStreamingState( - req, - i.config.filterAttribute, - i.config.omitTraceEvents, - requestAttributes(req), - instrumentation.requestSize, - instrumentation.requestsPerRPC, - instrumentation.responseSize, - instrumentation.responsesPerRPC, - ) - // extract any request headers into the context - carrier := propagation.HeaderCarrier(conn.RequestHeader()) - traceOpts := []trace.SpanStartOption{ - trace.WithSpanKind(trace.SpanKindServer), - trace.WithAttributes(state.attributes...), - trace.WithAttributes(headerAttributes(protocol, requestKey, req.Header, i.config.requestHeaderKeys)...), - } - if !trace.SpanContextFromContext(ctx).IsValid() { - ctx = i.config.propagator.Extract(ctx, carrier) - if !i.config.trustRemote { - traceOpts = append(traceOpts, - trace.WithNewRoot(), - trace.WithLinks(trace.LinkFromContext(ctx)), - ) - } - } - // start a new span with any trace that is in the context - ctx, span := i.config.tracer.Start( - ctx, - name, - traceOpts..., - ) - defer span.End() - streamingHandler := &streamingHandlerInterceptor{ - StreamingHandlerConn: conn, - receive: func(msg any, conn connect.StreamingHandlerConn) error { - return state.receive(ctx, msg, conn) - }, - send: func(msg any, conn connect.StreamingHandlerConn) error { - return state.send(ctx, msg, conn) - }, - } - err = next(ctx, streamingHandler) - if statusCode, ok := statusCodeAttribute(protocol, err); ok { - state.addAttributes(statusCode) - } - span.SetAttributes(state.attributes...) - span.SetAttributes(headerAttributes(protocol, responseKey, conn.ResponseHeader(), i.config.responseHeaderKeys)...) - span.SetStatus(spanStatus(protocol, err)) - instrumentation.duration.Record(ctx, i.config.now().Sub(requestStartTime).Milliseconds(), metric.WithAttributes(state.attributes...)) - return err - } -} - -func protocolToSemConv(protocol string) string { - switch protocol { - case grpcwebString: - return grpcwebProtocol - case grpcProtocol: - return grpcProtocol - case connectString: - return connectProtocol - default: - return protocol - } -} - -func spanStatus(protocol string, err error) (codes.Code, string) { - if err == nil { - return codes.Unset, "" - } - if protocol == connectProtocol && connect.IsNotModifiedError(err) { - return codes.Unset, "" - } - if connectErr := new(connect.Error); errors.As(err, &connectErr) { - return codes.Error, connectErr.Message() - } - return codes.Error, err.Error() -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/option.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/option.go deleted file mode 100644 index fa7977bd8a..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/option.go +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "context" - "net/http" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/noop" - "go.opentelemetry.io/otel/propagation" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" - "go.opentelemetry.io/otel/trace" -) - -// An Option configures the OpenTelemetry instrumentation. -type Option interface { - apply(*config) -} - -// WithPropagator configures the instrumentation to use the supplied propagator -// when extracting and injecting trace context. By default, the instrumentation -// uses otel.GetTextMapPropagator(). -func WithPropagator(propagator propagation.TextMapPropagator) Option { - return &propagatorOption{propagator} -} - -// WithMeterProvider configures the instrumentation to use the supplied [metric.MeterProvider] -// when extracting and injecting trace context. By default, the instrumentation -// uses global.MeterProvider(). -func WithMeterProvider(provider metric.MeterProvider) Option { - return &meterProviderOption{provider: provider} -} - -// WithTracerProvider configures the instrumentation to use the supplied -// provider when creating a tracer. By default, the instrumentation -// uses otel.GetTracerProvider(). -func WithTracerProvider(provider trace.TracerProvider) Option { - return &tracerProviderOption{provider} -} - -// WithFilter configures the instrumentation to emit traces and metrics only -// when the filter function returns true. Filter functions must be safe to call concurrently. -func WithFilter(filter func(context.Context, *Request) bool) Option { - return &filterOption{filter} -} - -// WithoutTracing disables tracing. -func WithoutTracing() Option { - return WithTracerProvider(trace.NewNoopTracerProvider()) -} - -// WithoutMetrics disables metrics. -func WithoutMetrics() Option { - return WithMeterProvider(noop.NewMeterProvider()) -} - -// WithAttributeFilter sets the attribute filter for all metrics and trace attributes. -func WithAttributeFilter(filter AttributeFilter) Option { - return &attributeFilterOption{filterAttribute: filter} -} - -// WithoutServerPeerAttributes removes net.peer.port and net.peer.name -// attributes from server trace and span attributes. The default behavior -// follows the OpenTelemetry semantic conventions for RPC, but produces very -// high-cardinality data; this option significantly reduces cardinality in most -// environments. -func WithoutServerPeerAttributes() Option { - return WithAttributeFilter(func(request *Request, value attribute.KeyValue) bool { - if request.Spec.IsClient { - return true - } - if value.Key == semconv.NetPeerPortKey { - return false - } - if value.Key == semconv.NetPeerNameKey { - return false - } - return true - }) -} - -// WithTrustRemote sets the Interceptor to trust remote spans. -// By default, all incoming server spans are untrusted and will be linked -// with a [trace.Link] and will not be a child span. -// By default, all client spans are trusted and no change occurs when WithTrustRemote is used. -func WithTrustRemote() Option { - return &trustRemoteOption{} -} - -// WithTraceRequestHeader enables header attributes for the request header keys provided. -// Attributes will be added as Trace attributes only. -func WithTraceRequestHeader(keys ...string) Option { - return &traceRequestHeaderOption{ - keys: keys, - } -} - -// WithTraceResponseHeader enables header attributes for the response header keys provided. -// Attributes will be added as Trace attributes only. -func WithTraceResponseHeader(keys ...string) Option { - return &traceResponseHeaderOption{ - keys: keys, - } -} - -// WithoutTraceEvents disables trace events for both unary and streaming -// interceptors. This reduces the quantity of data sent to your tracing system -// by omitting per-message information like message size. -func WithoutTraceEvents() Option { - return &omitTraceEventsOption{} -} - -type attributeFilterOption struct { - filterAttribute AttributeFilter -} - -func (o *attributeFilterOption) apply(c *config) { - if o.filterAttribute != nil { - c.filterAttribute = o.filterAttribute - } -} - -type propagatorOption struct { - propagator propagation.TextMapPropagator -} - -func (o *propagatorOption) apply(c *config) { - if o.propagator != nil { - c.propagator = o.propagator - } -} - -type tracerProviderOption struct { - provider trace.TracerProvider -} - -func (o *tracerProviderOption) apply(c *config) { - if o.provider != nil { - c.tracer = o.provider.Tracer( - instrumentationName, - trace.WithInstrumentationVersion(semanticVersion), - ) - } -} - -type filterOption struct { - filter func(context.Context, *Request) bool -} - -func (o *filterOption) apply(c *config) { - if o.filter != nil { - c.filter = o.filter - } -} - -type meterProviderOption struct { - provider metric.MeterProvider -} - -func (m meterProviderOption) apply(c *config) { - c.meter = m.provider.Meter( - instrumentationName, - metric.WithInstrumentationVersion(semanticVersion), - ) -} - -type trustRemoteOption struct{} - -func (o *trustRemoteOption) apply(c *config) { - c.trustRemote = true -} - -type traceRequestHeaderOption struct { - keys []string -} - -func (o *traceRequestHeaderOption) apply(c *config) { - for _, key := range o.keys { - c.requestHeaderKeys = append(c.requestHeaderKeys, http.CanonicalHeaderKey(key)) - } -} - -type traceResponseHeaderOption struct { - keys []string -} - -func (o *traceResponseHeaderOption) apply(c *config) { - for _, key := range o.keys { - c.responseHeaderKeys = append(c.responseHeaderKeys, http.CanonicalHeaderKey(key)) - } -} - -type omitTraceEventsOption struct{} - -func (o *omitTraceEventsOption) apply(c *config) { - c.omitTraceEvents = true -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/otelconnect.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/otelconnect.go deleted file mode 100644 index 412bd52ab7..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/otelconnect.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "context" - "net/http" - "time" - - connect "github.com/bufbuild/connect-go" - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/propagation" - "go.opentelemetry.io/otel/trace" -) - -const ( - version = "0.0.1-dev" - semanticVersion = "semver:" + version - instrumentationName = "github.com/bufbuild/connect-opentelemetry-go" - grpcProtocol = "grpc" - grpcwebString = "grpcweb" - grpcwebProtocol = "grpc_web" - connectString = "connect" - connectProtocol = "connect_rpc" -) - -// Request is the information about each RPC available to filter functions. It -// contains the common subset of [connect.AnyRequest], -// [connect.StreamingClientConn], and [connect.StreamingHandlerConn]. -type Request struct { - Spec connect.Spec - Peer connect.Peer - Header http.Header -} - -type config struct { - filter func(context.Context, *Request) bool - filterAttribute AttributeFilter - meter metric.Meter - tracer trace.Tracer - propagator propagation.TextMapPropagator - now func() time.Time - trustRemote bool - requestHeaderKeys []string - responseHeaderKeys []string - omitTraceEvents bool -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/payloadinterceptor.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/payloadinterceptor.go deleted file mode 100644 index b002823da3..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/payloadinterceptor.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "fmt" - "sync" - - connect "github.com/bufbuild/connect-go" -) - -type streamingClientInterceptor struct { - connect.StreamingClientConn - - receive func(any, connect.StreamingClientConn) error - send func(any, connect.StreamingClientConn) error - onClose func() - - mu sync.Mutex - requestClosed bool - responseClosed bool - onCloseCalled bool -} - -func (s *streamingClientInterceptor) Receive(msg any) error { - return s.receive(msg, s.StreamingClientConn) -} - -func (s *streamingClientInterceptor) Send(msg any) error { - return s.send(msg, s.StreamingClientConn) -} - -func (s *streamingClientInterceptor) CloseRequest() error { - err := s.StreamingClientConn.CloseRequest() - s.mu.Lock() - s.requestClosed = true - shouldCall := s.responseClosed && !s.onCloseCalled - if shouldCall { - s.onCloseCalled = true - } - s.mu.Unlock() - if shouldCall { - s.onClose() - } - return err -} - -func (s *streamingClientInterceptor) CloseResponse() error { - err := s.StreamingClientConn.CloseResponse() - s.mu.Lock() - s.responseClosed = true - shouldCall := s.requestClosed && !s.onCloseCalled - if shouldCall { - s.onCloseCalled = true - } - s.mu.Unlock() - if shouldCall { - s.onClose() - } - return err -} - -type errorStreamingClientInterceptor struct { - connect.StreamingClientConn - - err error -} - -func (e *errorStreamingClientInterceptor) Send(any) error { - return e.err -} - -func (e *errorStreamingClientInterceptor) CloseRequest() error { - if err := e.StreamingClientConn.CloseRequest(); err != nil { - return fmt.Errorf("%w %s", err, e.err.Error()) - } - return e.err -} - -func (e *errorStreamingClientInterceptor) Receive(any) error { - return e.err -} - -func (e *errorStreamingClientInterceptor) CloseResponse() error { - if err := e.StreamingClientConn.CloseResponse(); err != nil { - return fmt.Errorf("%w %s", err, e.err.Error()) - } - return e.err -} - -type streamingHandlerInterceptor struct { - connect.StreamingHandlerConn - - receive func(any, connect.StreamingHandlerConn) error - send func(any, connect.StreamingHandlerConn) error -} - -func (p *streamingHandlerInterceptor) Receive(msg any) error { - return p.receive(msg, p.StreamingHandlerConn) -} - -func (p *streamingHandlerInterceptor) Send(msg any) error { - return p.send(msg, p.StreamingHandlerConn) -} diff --git a/vendor/github.com/bufbuild/connect-opentelemetry-go/streaming.go b/vendor/github.com/bufbuild/connect-opentelemetry-go/streaming.go deleted file mode 100644 index 49cfee2b30..0000000000 --- a/vendor/github.com/bufbuild/connect-opentelemetry-go/streaming.go +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2022-2023 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelconnect - -import ( - "context" - "errors" - "io" - "sync" - - "go.opentelemetry.io/otel/attribute" - "go.opentelemetry.io/otel/metric" - semconv "go.opentelemetry.io/otel/semconv/v1.12.0" - "go.opentelemetry.io/otel/trace" - "google.golang.org/protobuf/proto" -) - -type streamingState struct { - mu sync.Mutex - protocol string - req *Request - attributeFilter AttributeFilter - omitTraceEvents bool - attributes []attribute.KeyValue - error error - sentCounter int - receivedCounter int - receiveSize metric.Int64Histogram - receivesPerRPC metric.Int64Histogram - sendSize metric.Int64Histogram - sendsPerRPC metric.Int64Histogram -} - -func newStreamingState( - req *Request, - attributeFilter AttributeFilter, - omitTraceEvents bool, - attributes []attribute.KeyValue, - receiveSize, receivesPerRPC, sendSize, sendsPerRPC metric.Int64Histogram, -) *streamingState { - attributes = attributeFilter.filter(req, attributes...) - return &streamingState{ - protocol: protocolToSemConv(req.Peer.Protocol), - attributeFilter: attributeFilter, - omitTraceEvents: omitTraceEvents, - req: req, - attributes: attributes, - receiveSize: receiveSize, - receivesPerRPC: receivesPerRPC, - sendSize: sendSize, - sendsPerRPC: sendsPerRPC, - } -} - -type sendReceiver interface { - Receive(any) error - Send(any) error -} - -func (s *streamingState) addAttributes(attributes ...attribute.KeyValue) { - s.attributes = append(s.attributes, s.attributeFilter.filter(s.req, attributes...)...) -} - -func (s *streamingState) receive(ctx context.Context, msg any, conn sendReceiver) error { - err := conn.Receive(msg) - s.mu.Lock() - defer s.mu.Unlock() - if errors.Is(err, io.EOF) { - return err - } - if err != nil { - s.error = err - // If error add it to the attributes because the stream is about to terminate. - // If no error don't add anything because status only exists at end of stream. - if statusCode, ok := statusCodeAttribute(s.protocol, err); ok { - s.addAttributes(statusCode) - } - } - protomsg, ok := msg.(proto.Message) - size := proto.Size(protomsg) - if !s.omitTraceEvents { - s.receivedCounter++ - s.event(ctx, semconv.MessageTypeReceived, s.receivedCounter, ok, size) - } - s.receiveSize.Record(ctx, int64(size), metric.WithAttributes(s.attributes...)) - s.receivesPerRPC.Record(ctx, 1, metric.WithAttributes(s.attributes...)) - return err -} - -func (s *streamingState) send(ctx context.Context, msg any, conn sendReceiver) error { - err := conn.Send(msg) - s.mu.Lock() - defer s.mu.Unlock() - if errors.Is(err, io.EOF) { - return err - } - if err != nil { - s.error = err - // If error add it to the attributes because the stream is about to terminate. - // If no error don't add anything because status only exists at end of stream. - if statusCode, ok := statusCodeAttribute(s.protocol, err); ok { - s.addAttributes(statusCode) - } - } - protomsg, ok := msg.(proto.Message) - size := proto.Size(protomsg) - if !s.omitTraceEvents { - s.sentCounter++ - s.event(ctx, semconv.MessageTypeSent, s.sentCounter, ok, size) - } - s.sendSize.Record(ctx, int64(size), metric.WithAttributes(s.attributes...)) - s.sendsPerRPC.Record(ctx, 1, metric.WithAttributes(s.attributes...)) - return err -} - -func (s *streamingState) event(ctx context.Context, messageType attribute.KeyValue, messageID int, msgOk bool, size int) { - span := trace.SpanFromContext(ctx) - if msgOk { - span.AddEvent("message", trace.WithAttributes(s.attributeFilter.filter( - s.req, - messageType, - semconv.MessageUncompressedSizeKey.Int(size), - semconv.MessageIDKey.Int(messageID), - )...)) - } else { - span.AddEvent("message", trace.WithAttributes(s.attributeFilter.filter( - s.req, - messageType, - semconv.MessageIDKey.Int(messageID), - )...)) - } -} diff --git a/vendor/github.com/bufbuild/protocompile/.gitignore b/vendor/github.com/bufbuild/protocompile/.gitignore deleted file mode 100644 index 65b3b16c3c..0000000000 --- a/vendor/github.com/bufbuild/protocompile/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.iml -.idea/ -/.tmp/ diff --git a/vendor/github.com/bufbuild/protocompile/.golangci.yml b/vendor/github.com/bufbuild/protocompile/.golangci.yml deleted file mode 100644 index 37a369a635..0000000000 --- a/vendor/github.com/bufbuild/protocompile/.golangci.yml +++ /dev/null @@ -1,99 +0,0 @@ -run: - skip-dirs-use-default: false - skip-files: - - ".*\\.y\\.go$" -linters-settings: - errcheck: - check-type-assertions: true - forbidigo: - forbid: - - '^fmt\.Print' - - '^log\.' - - '^print$' - - '^println$' - - '^panic$' - gci: - # Section configuration to compare against. - # Section names are case-insensitive and may contain parameters in (). - # The default order of sections is `standard > default > custom > blank > dot`, - # If `custom-order` is `true`, it follows the order of `sections` option. - # Default: ["standard", "default"] - sections: - - standard # Standard section: captures all standard packages. - - default # Default section: contains all imports that could not be matched to another section type. - - prefix(github.com/bufbuild/protocompile) # Custom section: groups all imports with the specified Prefix. - godox: - # TODO, OPT, etc. comments are fine to commit. Use FIXME comments for - # temporary hacks, and use godox to prevent committing them. - keywords: [FIXME] - varnamelen: - ignore-decls: - - T any - - i int - - wg sync.WaitGroup -linters: - enable-all: true - disable: - # TODO: TCN-350 - initial exclusions for failing linters. - # Should enable all of these. - - dupl - - errname - - errorlint - - exhaustive - - exhaustruct - - forbidigo - - forcetypeassert - - gochecknoglobals - - gochecknoinits - - goconst - - gocyclo - - goerr113 - - interfacebloat - - nestif - - nilerr - - nilnil - - nonamedreturns - - thelper - - varnamelen - # Other disabled linters - - cyclop # covered by gocyclo - - deadcode # deprecated by author - - exhaustivestruct # replaced by exhaustruct - - funlen # rely on code review to limit function length - - gocognit # dubious "cognitive overhead" quantification - - gofumpt # prefer standard gofmt - - golint # deprecated by Go team - - gomnd # some unnamed constants are okay - - ifshort # deprecated by author - - interfacer # deprecated by author - - ireturn # "accept interfaces, return structs" isn't ironclad - - lll # don't want hard limits for line length - - maintidx # covered by gocyclo - - maligned # readability trumps efficient struct packing - - nlreturn # generous whitespace violates house style - - nosnakecase # deprecated in https://github.com/golangci/golangci-lint/pull/3065 - - rowserrcheck # no SQL code in protocompile - - scopelint # deprecated by author - - sqlclosecheck # no SQL code in protocompile - - structcheck # deprecated by author - - testpackage # internal tests are fine - - varcheck # deprecated by author - - wastedassign # not supported with generics - - wrapcheck # don't _always_ need to wrap errors - - wsl # generous whitespace violates house style -issues: - exclude: - # Don't ban use of fmt.Errorf to create new errors, but the remaining - # checks from err113 are useful. - - "err113: do not define dynamic errors.*" - exclude-rules: - # Benchmarks can't be run in parallel - - path: benchmark_test\.go - linters: - - paralleltest - # dupword reports several errors in .proto test fixtures - # gosec reports a few minor issues in tests - - path: _test\.go - linters: - - dupword - - gosec diff --git a/vendor/github.com/bufbuild/protocompile/LICENSE b/vendor/github.com/bufbuild/protocompile/LICENSE deleted file mode 100644 index 04cf1e316a..0000000000 --- a/vendor/github.com/bufbuild/protocompile/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020-2022 Buf Technologies, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/bufbuild/protocompile/Makefile b/vendor/github.com/bufbuild/protocompile/Makefile deleted file mode 100644 index afca92ccb8..0000000000 --- a/vendor/github.com/bufbuild/protocompile/Makefile +++ /dev/null @@ -1,159 +0,0 @@ -# See https://tech.davis-hansson.com/p/make/ -SHELL := bash -.DELETE_ON_ERROR: -.SHELLFLAGS := -eu -o pipefail -c -.DEFAULT_GOAL := all -MAKEFLAGS += --warn-undefined-variables -MAKEFLAGS += --no-builtin-rules -MAKEFLAGS += --no-print-directory -BIN := $(abspath .tmp/bin) -COPYRIGHT_YEARS := 2020-2022 -LICENSE_IGNORE := -e /testdata/ -# Set to use a different compiler. For example, `GO=go1.18rc1 make test`. -GO ?= go -TOOLS_MOD_DIR := ./internal/tools -UNAME_OS := $(shell uname -s) -UNAME_ARCH := $(shell uname -m) - -# NB: this must be kept in sync with constant in internal/benchmarks. -PROTOC_VERSION ?= 22.0 -PROTOC_DIR := $(abspath ./internal/testdata/protoc/$(PROTOC_VERSION)) -PROTOC := $(PROTOC_DIR)/bin/protoc - -ifeq ($(UNAME_OS),Darwin) -PROTOC_OS := osx -ifeq ($(UNAME_ARCH),arm64) -PROTOC_ARCH := aarch_64 -else -PROTOC_ARCH := x86_64 -endif -endif -ifeq ($(UNAME_OS),Linux) -PROTOC_OS := linux -PROTOC_ARCH := $(UNAME_ARCH) -endif - -.PHONY: help -help: ## Describe useful make targets - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-30s %s\n", $$1, $$2}' - -.PHONY: all -all: ## Build, test, and lint (default) - $(MAKE) test - $(MAKE) lint - -.PHONY: clean -clean: ## Delete intermediate build artifacts - @# -X only removes untracked files, -d recurses into directories, -f actually removes files/dirs - git clean -Xdf - -.PHONY: test -test: build ## Run unit tests - $(GO) test -vet=off -race -cover ./... - -.PHONY: benchmarks -benchmarks: build ## Run benchmarks - cd internal/benchmarks && $(GO) test -bench=. -benchmem -v ./... - -.PHONY: build -build: generate ## Build all packages - $(GO) build ./... - -.PHONY: install -install: ## Install all binaries - $(GO) install ./... - -.PHONY: lint -lint: $(BIN)/golangci-lint ## Lint Go - $(GO) vet ./... ./internal/benchmarks/... - $(BIN)/golangci-lint run - cd internal/benchmarks && $(BIN)/golangci-lint run - -.PHONY: lintfix -lintfix: $(BIN)/golangci-lint ## Automatically fix some lint errors - $(BIN)/golangci-lint run --fix - cd internal/benchmarks && $(BIN)/golangci-lint run --fix - -.PHONY: generate -generate: $(BIN)/license-header $(BIN)/goyacc test-descriptors ## Regenerate code and licenses - PATH="$(BIN):$(PATH)" $(GO) generate ./... - @# We want to operate on a list of modified and new files, excluding - @# deleted and ignored files. git-ls-files can't do this alone. comm -23 takes - @# two files and prints the union, dropping lines common to both (-3) and - @# those only in the second file (-2). We make one git-ls-files call for - @# the modified, cached, and new (--others) files, and a second for the - @# deleted files. - comm -23 \ - <(git ls-files --cached --modified --others --no-empty-directory --exclude-standard | sort -u | grep -v $(LICENSE_IGNORE) ) \ - <(git ls-files --deleted | sort -u) | \ - xargs $(BIN)/license-header \ - --license-type apache \ - --copyright-holder "Buf Technologies, Inc." \ - --year-range "$(COPYRIGHT_YEARS)" - -.PHONY: upgrade -upgrade: ## Upgrade dependencies - go get -u -t ./... && go mod tidy -v - -.PHONY: checkgenerate -checkgenerate: - @# Used in CI to verify that `make generate` doesn't produce a diff. - test -z "$$(git status --porcelain | tee /dev/stderr)" - -$(BIN)/license-header: internal/tools/go.mod internal/tools/go.sum - @mkdir -p $(@D) - cd $(TOOLS_MOD_DIR) && \ - $(GO) build -o $@ github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header - -$(BIN)/golangci-lint: internal/tools/go.mod internal/tools/go.sum - @mkdir -p $(@D) - cd $(TOOLS_MOD_DIR) && \ - $(GO) build -o $@ github.com/golangci/golangci-lint/cmd/golangci-lint - -$(BIN)/goyacc: internal/tools/go.mod internal/tools/go.sum - @mkdir -p $(@D) - cd $(TOOLS_MOD_DIR) && \ - $(GO) build -o $@ golang.org/x/tools/cmd/goyacc - -internal/testdata/protoc/cache/protoc-$(PROTOC_VERSION).zip: - @mkdir -p $(@D) - curl -o $@ -fsSL https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-$(PROTOC_OS)-$(PROTOC_ARCH).zip - -$(PROTOC): internal/testdata/protoc/cache/protoc-$(PROTOC_VERSION).zip - @mkdir -p $(@D) - unzip -o -q $< -d $(PROTOC_DIR) && \ - touch $@ - -internal/testdata/all.protoset: $(PROTOC) $(sort $(wildcard internal/testdata/*.proto)) - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_imports -I. $(filter-out protoc,$(^F)) - -internal/testdata/desc_test_complex.protoset: $(PROTOC) internal/testdata/desc_test_complex.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_imports -I. $(filter-out protoc,$(^F)) - -internal/testdata/desc_test_defaults.protoset: $(PROTOC) internal/testdata/desc_test_defaults.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_imports -I. $(filter-out protoc,$(^F)) - -internal/testdata/desc_test_proto3_optional.protoset: $(PROTOC) internal/testdata/desc_test_proto3_optional.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_imports -I. $(filter-out protoc,$(^F)) - -internal/testdata/descriptor_impl_tests.protoset: $(PROTOC) internal/testdata/desc_test2.proto internal/testdata/desc_test_defaults.proto internal/testdata/desc_test_proto3.proto internal/testdata/desc_test_proto3_optional.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_imports -I. $(filter-out protoc,$(^F)) - -internal/testdata/source_info.protoset: $(PROTOC) internal/testdata/desc_test_options.proto internal/testdata/desc_test_comments.proto internal/testdata/desc_test_complex.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) --include_source_info -I. $(filter-out protoc,$(^F)) - -internal/testdata/options/test.protoset: $(PROTOC) internal/testdata/options/test.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) -I. $(filter-out protoc,$(^F)) - -internal/testdata/options/test_proto3.protoset: $(PROTOC) internal/testdata/options/test_proto3.proto - cd $(@D) && $(PROTOC) --descriptor_set_out=$(@F) -I. $(filter-out protoc,$(^F)) - -.PHONY: test-descriptors -test-descriptors: internal/testdata/all.protoset -test-descriptors: internal/testdata/desc_test_complex.protoset -test-descriptors: internal/testdata/desc_test_defaults.protoset -test-descriptors: internal/testdata/desc_test_proto3_optional.protoset -test-descriptors: internal/testdata/descriptor_impl_tests.protoset -test-descriptors: internal/testdata/source_info.protoset -test-descriptors: internal/testdata/options/test.protoset -test-descriptors: internal/testdata/options/test_proto3.protoset diff --git a/vendor/github.com/bufbuild/protocompile/README.md b/vendor/github.com/bufbuild/protocompile/README.md deleted file mode 100644 index 9d87333001..0000000000 --- a/vendor/github.com/bufbuild/protocompile/README.md +++ /dev/null @@ -1,91 +0,0 @@ -![The Buf logo](./.github/buf-logo.svg) - -# Protocompile - -[![Build](https://github.com/bufbuild/protocompile/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/bufbuild/protocompile/actions/workflows/ci.yaml) -[![Report Card](https://goreportcard.com/badge/github.com/bufbuild/protocompile)](https://goreportcard.com/report/github.com/bufbuild/protocompile) -[![GoDoc](https://pkg.go.dev/badge/github.com/bufbuild/protocompile.svg)](https://pkg.go.dev/github.com/bufbuild/protocompile) - -This repo contains a parsing/linking engine for Protocol Buffers, written in pure Go. It is suitable as an alternative -to `protoc` (Google's official reference compiler for Protocol Buffers). This is the compiler that powers [Buf](https://buf.build) -and its bevy of tools. - -This repo is also the spiritual successor to the [`github.com/jhump/protoreflect/desc/protoparse`](https://godoc.org/github.com/jhump/protoreflect/desc/protoparse) -package. If you are looking for a newer version of `protoparse` that natively works with the newer Protobuf runtime -API for Go (`google.golang.org/protobuf`), you have found it! - -## Protocol Buffers - -If you've come across this repo but don't know what Protocol Buffers are, you might acquaint yourself with the [official -documentation](https://developers.google.com/protocol-buffers). Protocol Buffers, or Protobuf for short, is an IDL for -describing APIs and data structures and also a binary encoding format for efficiently transmitting and storing that -data. - -If you want to know more about the language itself, which is what this repo implements, take a look at Buf's -[Protobuf Guide](https://protobuf.com), which includes a very detailed language specification. - -### Descriptors - -Descriptors are the "lingua franca" for describing Protobuf data schemas. They are the basis of runtime features like -reflection and dynamic messages. They are also the output of a Protobuf compiler: a compiler can produce them and write -them to a file (whose contents are the binary-encoded form of a [`FileDescriptorSet`](https://github.com/protocolbuffers/protobuf/blob/v21.7/src/google/protobuf/descriptor.proto#L55-L59)) -or send them to a [plugin](https://docs.buf.build/reference/images#plugins) to generate code for a particular -programming language. - -Descriptors are similar to nodes in a syntax tree: the contents of a file descriptor correspond closely to the elements -in the source file from which it was generated. Also, the descriptor model's data structures are themselves defined in -[Protobuf](https://github.com/protocolbuffers/protobuf/blob/v21.7/src/google/protobuf/descriptor.proto). - -## Using This Repo - -The primary API of this repo is in this root package: `github.com/bufbuild/protocompile`. This is the suggested entry -point and provides a type named `Compiler`, for compiling Protobuf source files into descriptors. There are also -numerous sub-packages, most of which implement various stages of the compiler. Here's an overview (_not_ in alphabetical -order): - - * [`protocompile`](https://pkg.go.dev/github.com/bufbuild/protocompile): - This is the entry point, used to configure and initiate a compilation operation. - * [`parser`](https://pkg.go.dev/github.com/bufbuild/protocompile/parser): - This is the first stage of the compiler. It parses Protobuf source code and produces an AST. This package can also - generate a file descriptor proto from an AST. - * [`ast`](https://pkg.go.dev/github.com/bufbuild/protocompile/ast): - This package models an Abstract Syntax Tree (AST) for the Protobuf language. - * [`linker`](https://pkg.go.dev/github.com/bufbuild/protocompile/linker): - This is the second stage of the compiler. The descriptor proto (generated from an AST) is linked, producing a more - useful data structure than simple descriptor protos. This step also performs numerous validations on the source, - like making sure that all type references are correct and that sources don't try to define two elements with the same - name. - * [`options`](https://pkg.go.dev/github.com/bufbuild/protocompile/options): - This is the next stage of the compiler: interpreting options. The linked data structures that come from the previous - stage are used to validate and interpret all options. - * [`sourceinfo`](https://pkg.go.dev/github.com/bufbuild/protocompile/sourceinfo): - This is the last stage of the compiler: generating source code info. Source code info contains metadata that maps - elements in the descriptor to the location in the original source file from which it came. This includes access to - comments. In order to provide correct source info for options, it must happen last, after options have been - interpreted. - * [`reporter`](https://pkg.go.dev/github.com/bufbuild/protocompile/reporter): This package provides error types - generated by the compiler and interfaces used by the compiler to report errors and warnings to the calling code. - * [`walk`](https://pkg.go.dev/github.com/bufbuild/protocompile/walk): - This package provides functions for walking through all of the elements in a descriptor (or descriptor proto) - hierarchy. - * [`protoutil`](https://pkg.go.dev/github.com/bufbuild/protocompile/protoutil): - This package contains some other useful functions for interacting with Protobuf descriptors. - -### Migrating from `protoparse` - -There are a few differences between this repo and its predecessor, `github.com/jhump/protoreflect/desc/protoparse`. - -* If you want to include "standard imports", for the well-known files that are included with `protoc`, you have to do - so explicitly. To do this, wrap your resolver using `protocompile.WithStandardImports`. -* If you used `protoparse.FileContentsFromMap`, in this new repo you'll use a `protocompile.SourceResolver` and then use - `protocompile.SourceAccessorFromMap` as its accessor function. -* If you used `Parser.ParseToAST`, you won't use the `protocompile` package but instead directly use `parser.Parse` in - this repo's `parser` sub-package. This returns an AST for the given file contents. -* If you used `Parser.ParseFilesButDoNotLink`, that is still possible in this repo, but not provided directly via a - single function. Instead, you need to take a few steps: - 1. Parse the source using `parser.Parse`. Then use `parser.ResultFromAST` to construct a result that contains a file - descriptor proto. - 2. Interpret whatever options can be interpreted without linking using `options.InterpretUnlinkedOptions`. This may - leave some options in the descriptor proto uninterpreted (including all custom options). - 3. If you want source code info for the file, finally call `sourceinfo.GenerateSourceInfo` using the index returned - from the previous step and store that in the file descriptor proto. diff --git a/vendor/github.com/bufbuild/protocompile/ast/doc.go b/vendor/github.com/bufbuild/protocompile/ast/doc.go deleted file mode 100644 index fac65c420f..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/doc.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package ast defines types for modeling the AST (Abstract Syntax -// Tree) for the Protocol Buffers interface definition language. -// -// # Nodes -// -// All nodes of the tree implement the [Node] interface. Leaf nodes in the -// tree implement [TerminalNode], and all others implement [CompositeNode]. -// The root of the tree for a proto source file is a *[FileNode]. -// -// A [TerminalNode] represents a single lexical element, or [Token]. A -// [CompositeNode] represents a sub-tree of the AST and range of tokens. -// -// Position information is tracked using a *[FileInfo]. The lexer invokes its -// various Add* methods to add details as the file is tokenized. Storing -// the position information in the *[FileInfo], instead of in each AST node, -// allows the AST to have a much more compact representation. To extract -// detailed position information, you must use the NodeInfo method, available -// on either the *[FileInfo] which produced the node's items or the *[FileNode] -// root of the tree that contains the node. -// -// # Items, Tokens, and Comments -// -// An [Item] represents a lexical item, excluding whitespace. This can be -// either a [Token] or a [Comment]. -// -// Comments are not represented as nodes in the tree. Instead, they are -// attributed to terminal nodes in the tree. So, when lexing, comments -// are accumulated until the next non-comment token is found. The AST -// model in this package thus provides access to all comments in the -// file, regardless of location (unlike the SourceCodeInfo present in -// descriptor protos, which is lossy). The comments associated with a -// non-leaf/non-token node (i.e. a CompositeNode) come from the first -// and last nodes in its sub-tree, for leading and trailing comments -// respectively. -// -// A [Comment] value corresponds to a line ("//") or block ("/*") style -// comment in the source. These have no bearing on the grammar and are -// effectively ignored as the parser is determining the shape of the -// syntax tree. -// -// A [Token] value corresponds to a component of the grammar, that is -// used to produce an AST. They correspond to leaves in the AST (i.e. -// [TerminalNode]). -// -// The *[FileInfo] and *[FileNode] types provide methods for querying -// and iterating through all the items or tokens in the file. They also -// include a method for resolving an [Item] into a [Token] or [Comment]. -// -// # Factory Functions -// -// Creation of AST nodes should use the factory functions in this -// package instead of struct literals. Some factory functions accept -// optional arguments, which means the arguments can be nil. If nil -// values are provided for other (non-optional) arguments, the resulting -// node may be invalid and cause panics later in the program. -// -// This package defines numerous interfaces. However, user code should -// not attempt to implement any of them. Most consumers of an AST will -// not work correctly if they encounter concrete implementations other -// than the ones defined in this package. -package ast diff --git a/vendor/github.com/bufbuild/protocompile/ast/enum.go b/vendor/github.com/bufbuild/protocompile/ast/enum.go deleted file mode 100644 index 93edbcbdce..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/enum.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// EnumNode represents an enum declaration. Example: -// -// enum Foo { BAR = 0; BAZ = 1 } -type EnumNode struct { - compositeNode - Keyword *KeywordNode - Name *IdentNode - OpenBrace *RuneNode - Decls []EnumElement - CloseBrace *RuneNode -} - -func (*EnumNode) fileElement() {} -func (*EnumNode) msgElement() {} - -// NewEnumNode creates a new *EnumNode. All arguments must be non-nil. While -// it is technically allowed for decls to be nil or empty, the resulting node -// will not be a valid enum, which must have at least one value. -// - keyword: The token corresponding to the "enum" keyword. -// - name: The token corresponding to the enum's name. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the enum body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewEnumNode(keyword *KeywordNode, name *IdentNode, openBrace *RuneNode, decls []EnumElement, closeBrace *RuneNode) *EnumNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 4+len(decls)) - children = append(children, keyword, name, openBrace) - for _, decl := range decls { - switch decl.(type) { - case *OptionNode, *EnumValueNode, *ReservedNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid EnumElement type: %T", decl)) - } - children = append(children, decl) - } - children = append(children, closeBrace) - - return &EnumNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - OpenBrace: openBrace, - CloseBrace: closeBrace, - Decls: decls, - } -} - -// EnumElement is an interface implemented by all AST nodes that can -// appear in the body of an enum declaration. -type EnumElement interface { - Node - enumElement() -} - -var _ EnumElement = (*OptionNode)(nil) -var _ EnumElement = (*EnumValueNode)(nil) -var _ EnumElement = (*ReservedNode)(nil) -var _ EnumElement = (*EmptyDeclNode)(nil) - -// EnumValueDeclNode is a placeholder interface for AST nodes that represent -// enum values. This allows NoSourceNode to be used in place of *EnumValueNode -// for some usages. -type EnumValueDeclNode interface { - Node - GetName() Node - GetNumber() Node -} - -var _ EnumValueDeclNode = (*EnumValueNode)(nil) -var _ EnumValueDeclNode = NoSourceNode{} - -// EnumNode represents an enum declaration. Example: -// -// UNSET = 0 [deprecated = true]; -type EnumValueNode struct { - compositeNode - Name *IdentNode - Equals *RuneNode - Number IntValueNode - Options *CompactOptionsNode - Semicolon *RuneNode -} - -func (*EnumValueNode) enumElement() {} - -// NewEnumValueNode creates a new *EnumValueNode. All arguments must be non-nil -// except opts which is only non-nil if the declaration included options. -// - name: The token corresponding to the enum value's name. -// - equals: The token corresponding to the '=' rune after the name. -// - number: The token corresponding to the enum value's number. -// - opts: Optional set of enum value options. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewEnumValueNode(name *IdentNode, equals *RuneNode, number IntValueNode, opts *CompactOptionsNode, semicolon *RuneNode) *EnumValueNode { - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if number == nil { - panic("number is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - numChildren := 4 - if opts != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - children = append(children, name, equals, number) - if opts != nil { - children = append(children, opts) - } - children = append(children, semicolon) - return &EnumValueNode{ - compositeNode: compositeNode{ - children: children, - }, - Name: name, - Equals: equals, - Number: number, - Options: opts, - Semicolon: semicolon, - } -} - -func (e *EnumValueNode) GetName() Node { - return e.Name -} - -func (e *EnumValueNode) GetNumber() Node { - return e.Number -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/field.go b/vendor/github.com/bufbuild/protocompile/ast/field.go deleted file mode 100644 index d4d3e3924c..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/field.go +++ /dev/null @@ -1,672 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// FieldDeclNode is a node in the AST that defines a field. This includes -// normal message fields as well as extensions. There are multiple types -// of AST nodes that declare fields: -// - *FieldNode -// - *GroupNode -// - *MapFieldNode -// - *SyntheticMapField -// -// This also allows NoSourceNode and SyntheticMapField to be used in place of -// one of the above for some usages. -type FieldDeclNode interface { - Node - FieldLabel() Node - FieldName() Node - FieldType() Node - FieldTag() Node - FieldExtendee() Node - GetGroupKeyword() Node - GetOptions() *CompactOptionsNode -} - -var _ FieldDeclNode = (*FieldNode)(nil) -var _ FieldDeclNode = (*GroupNode)(nil) -var _ FieldDeclNode = (*MapFieldNode)(nil) -var _ FieldDeclNode = (*SyntheticMapField)(nil) -var _ FieldDeclNode = NoSourceNode{} - -// FieldNode represents a normal field declaration (not groups or maps). It -// can represent extension fields as well as non-extension fields (both inside -// of messages and inside of one-ofs). Example: -// -// optional string foo = 1; -type FieldNode struct { - compositeNode - Label FieldLabel - FldType IdentValueNode - Name *IdentNode - Equals *RuneNode - Tag *UintLiteralNode - Options *CompactOptionsNode - Semicolon *RuneNode - - // This is an up-link to the containing *ExtendNode for fields - // that are defined inside of "extend" blocks. - Extendee *ExtendNode -} - -func (*FieldNode) msgElement() {} -func (*FieldNode) oneOfElement() {} -func (*FieldNode) extendElement() {} - -// NewFieldNode creates a new *FieldNode. The label and options arguments may be -// nil but the others must be non-nil. -// - label: The token corresponding to the label keyword if present ("optional", -// "required", or "repeated"). -// - fieldType: The token corresponding to the field's type. -// - name: The token corresponding to the field's name. -// - equals: The token corresponding to the '=' rune after the name. -// - tag: The token corresponding to the field's tag number. -// - opts: Optional set of field options. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewFieldNode(label *KeywordNode, fieldType IdentValueNode, name *IdentNode, equals *RuneNode, tag *UintLiteralNode, opts *CompactOptionsNode, semicolon *RuneNode) *FieldNode { - if fieldType == nil { - panic("fieldType is nil") - } - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if tag == nil { - panic("tag is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - numChildren := 5 - if label != nil { - numChildren++ - } - if opts != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - if label != nil { - children = append(children, label) - } - children = append(children, fieldType, name, equals, tag) - if opts != nil { - children = append(children, opts) - } - children = append(children, semicolon) - - return &FieldNode{ - compositeNode: compositeNode{ - children: children, - }, - Label: newFieldLabel(label), - FldType: fieldType, - Name: name, - Equals: equals, - Tag: tag, - Options: opts, - Semicolon: semicolon, - } -} - -func (n *FieldNode) FieldLabel() Node { - // proto3 fields and fields inside one-ofs will not have a label and we need - // this check in order to return a nil node -- otherwise we'd return a - // non-nil node that has a nil pointer value in it :/ - if n.Label.KeywordNode == nil { - return nil - } - return n.Label.KeywordNode -} - -func (n *FieldNode) FieldName() Node { - return n.Name -} - -func (n *FieldNode) FieldType() Node { - return n.FldType -} - -func (n *FieldNode) FieldTag() Node { - return n.Tag -} - -func (n *FieldNode) FieldExtendee() Node { - if n.Extendee != nil { - return n.Extendee.Extendee - } - return nil -} - -func (n *FieldNode) GetGroupKeyword() Node { - return nil -} - -func (n *FieldNode) GetOptions() *CompactOptionsNode { - return n.Options -} - -// FieldLabel represents the label of a field, which indicates its cardinality -// (i.e. whether it is optional, required, or repeated). -type FieldLabel struct { - *KeywordNode - Repeated bool - Required bool -} - -func newFieldLabel(lbl *KeywordNode) FieldLabel { - repeated, required := false, false - if lbl != nil { - repeated = lbl.Val == "repeated" - required = lbl.Val == "required" - } - return FieldLabel{ - KeywordNode: lbl, - Repeated: repeated, - Required: required, - } -} - -// IsPresent returns true if a label keyword was present in the declaration -// and false if it was absent. -func (f *FieldLabel) IsPresent() bool { - return f.KeywordNode != nil -} - -// GroupNode represents a group declaration, which doubles as a field and inline -// message declaration. It can represent extension fields as well as -// non-extension fields (both inside of messages and inside of one-ofs). -// Example: -// -// optional group Key = 4 { -// optional uint64 id = 1; -// optional string name = 2; -// } -type GroupNode struct { - compositeNode - Label FieldLabel - Keyword *KeywordNode - Name *IdentNode - Equals *RuneNode - Tag *UintLiteralNode - Options *CompactOptionsNode - MessageBody - - // This is an up-link to the containing *ExtendNode for groups - // that are defined inside of "extend" blocks. - Extendee *ExtendNode -} - -func (*GroupNode) msgElement() {} -func (*GroupNode) oneOfElement() {} -func (*GroupNode) extendElement() {} - -// NewGroupNode creates a new *GroupNode. The label and options arguments may be -// nil but the others must be non-nil. -// - label: The token corresponding to the label keyword if present ("optional", -// "required", or "repeated"). -// - keyword: The token corresponding to the "group" keyword. -// - name: The token corresponding to the field's name. -// - equals: The token corresponding to the '=' rune after the name. -// - tag: The token corresponding to the field's tag number. -// - opts: Optional set of field options. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the group body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewGroupNode(label *KeywordNode, keyword *KeywordNode, name *IdentNode, equals *RuneNode, tag *UintLiteralNode, opts *CompactOptionsNode, openBrace *RuneNode, decls []MessageElement, closeBrace *RuneNode) *GroupNode { - if keyword == nil { - panic("fieldType is nil") - } - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if tag == nil { - panic("tag is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - numChildren := 6 + len(decls) - if label != nil { - numChildren++ - } - if opts != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - if label != nil { - children = append(children, label) - } - children = append(children, keyword, name, equals, tag) - if opts != nil { - children = append(children, opts) - } - children = append(children, openBrace) - for _, decl := range decls { - children = append(children, decl) - } - children = append(children, closeBrace) - - ret := &GroupNode{ - compositeNode: compositeNode{ - children: children, - }, - Label: newFieldLabel(label), - Keyword: keyword, - Name: name, - Equals: equals, - Tag: tag, - Options: opts, - } - populateMessageBody(&ret.MessageBody, openBrace, decls, closeBrace) - return ret -} - -func (n *GroupNode) FieldLabel() Node { - if n.Label.KeywordNode == nil { - // return nil interface to indicate absence, not a typed nil - return nil - } - return n.Label.KeywordNode -} - -func (n *GroupNode) FieldName() Node { - return n.Name -} - -func (n *GroupNode) FieldType() Node { - return n.Keyword -} - -func (n *GroupNode) FieldTag() Node { - return n.Tag -} - -func (n *GroupNode) FieldExtendee() Node { - if n.Extendee != nil { - return n.Extendee.Extendee - } - return nil -} - -func (n *GroupNode) GetGroupKeyword() Node { - return n.Keyword -} - -func (n *GroupNode) GetOptions() *CompactOptionsNode { - return n.Options -} - -func (n *GroupNode) MessageName() Node { - return n.Name -} - -// OneOfDeclNode is a node in the AST that defines a oneof. There are -// multiple types of AST nodes that declare oneofs: -// - *OneOfNode -// - *SyntheticOneOf -// -// This also allows NoSourceNode to be used in place of one of the above -// for some usages. -type OneOfDeclNode interface { - Node - OneOfName() Node -} - -// OneOfNode represents a one-of declaration. Example: -// -// oneof query { -// string by_name = 2; -// Type by_type = 3; -// Address by_address = 4; -// Labels by_label = 5; -// } -type OneOfNode struct { - compositeNode - Keyword *KeywordNode - Name *IdentNode - OpenBrace *RuneNode - Decls []OneOfElement - CloseBrace *RuneNode -} - -func (*OneOfNode) msgElement() {} - -// NewOneOfNode creates a new *OneOfNode. All arguments must be non-nil. While -// it is technically allowed for decls to be nil or empty, the resulting node -// will not be a valid oneof, which must have at least one field. -// - keyword: The token corresponding to the "oneof" keyword. -// - name: The token corresponding to the oneof's name. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the oneof body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewOneOfNode(keyword *KeywordNode, name *IdentNode, openBrace *RuneNode, decls []OneOfElement, closeBrace *RuneNode) *OneOfNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 4+len(decls)) - children = append(children, keyword, name, openBrace) - for _, decl := range decls { - children = append(children, decl) - } - children = append(children, closeBrace) - - for _, decl := range decls { - switch decl := decl.(type) { - case *OptionNode, *FieldNode, *GroupNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid OneOfElement type: %T", decl)) - } - } - - return &OneOfNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - OpenBrace: openBrace, - Decls: decls, - CloseBrace: closeBrace, - } -} - -func (n *OneOfNode) OneOfName() Node { - return n.Name -} - -// OneOfElement is an interface implemented by all AST nodes that can -// appear in the body of a oneof declaration. -type OneOfElement interface { - Node - oneOfElement() -} - -var _ OneOfElement = (*OptionNode)(nil) -var _ OneOfElement = (*FieldNode)(nil) -var _ OneOfElement = (*GroupNode)(nil) -var _ OneOfElement = (*EmptyDeclNode)(nil) - -// SyntheticOneOf is not an actual node in the AST but a synthetic node -// that represents the oneof implied by a proto3 optional field. -type SyntheticOneOf struct { - Field *FieldNode -} - -var _ Node = (*SyntheticOneOf)(nil) - -// NewSyntheticOneOf creates a new *SyntheticOneOf that corresponds to the -// given proto3 optional field. -func NewSyntheticOneOf(field *FieldNode) *SyntheticOneOf { - return &SyntheticOneOf{Field: field} -} - -func (n *SyntheticOneOf) Start() Token { - return n.Field.Start() -} - -func (n *SyntheticOneOf) End() Token { - return n.Field.End() -} - -func (n *SyntheticOneOf) LeadingComments() []Comment { - return nil -} - -func (n *SyntheticOneOf) TrailingComments() []Comment { - return nil -} - -func (n *SyntheticOneOf) OneOfName() Node { - return n.Field.FieldName() -} - -// MapTypeNode represents the type declaration for a map field. It defines -// both the key and value types for the map. Example: -// -// map -type MapTypeNode struct { - compositeNode - Keyword *KeywordNode - OpenAngle *RuneNode - KeyType *IdentNode - Comma *RuneNode - ValueType IdentValueNode - CloseAngle *RuneNode -} - -// NewMapTypeNode creates a new *MapTypeNode. All arguments must be non-nil. -// - keyword: The token corresponding to the "map" keyword. -// - openAngle: The token corresponding to the "<" rune after the keyword. -// - keyType: The token corresponding to the key type for the map. -// - comma: The token corresponding to the "," rune between key and value types. -// - valType: The token corresponding to the value type for the map. -// - closeAngle: The token corresponding to the ">" rune that ends the declaration. -func NewMapTypeNode(keyword *KeywordNode, openAngle *RuneNode, keyType *IdentNode, comma *RuneNode, valType IdentValueNode, closeAngle *RuneNode) *MapTypeNode { - if keyword == nil { - panic("keyword is nil") - } - if openAngle == nil { - panic("openAngle is nil") - } - if keyType == nil { - panic("keyType is nil") - } - if comma == nil { - panic("comma is nil") - } - if valType == nil { - panic("valType is nil") - } - if closeAngle == nil { - panic("closeAngle is nil") - } - children := []Node{keyword, openAngle, keyType, comma, valType, closeAngle} - return &MapTypeNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - OpenAngle: openAngle, - KeyType: keyType, - Comma: comma, - ValueType: valType, - CloseAngle: closeAngle, - } -} - -// MapFieldNode represents a map field declaration. Example: -// -// map replacements = 3 [deprecated = true]; -type MapFieldNode struct { - compositeNode - MapType *MapTypeNode - Name *IdentNode - Equals *RuneNode - Tag *UintLiteralNode - Options *CompactOptionsNode - Semicolon *RuneNode -} - -func (*MapFieldNode) msgElement() {} - -// NewMapFieldNode creates a new *MapFieldNode. All arguments must be non-nil -// except opts, which may be nil. -// - mapType: The token corresponding to the map type. -// - name: The token corresponding to the field's name. -// - equals: The token corresponding to the '=' rune after the name. -// - tag: The token corresponding to the field's tag number. -// - opts: Optional set of field options. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewMapFieldNode(mapType *MapTypeNode, name *IdentNode, equals *RuneNode, tag *UintLiteralNode, opts *CompactOptionsNode, semicolon *RuneNode) *MapFieldNode { - if mapType == nil { - panic("mapType is nil") - } - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if tag == nil { - panic("tag is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - numChildren := 5 - if opts != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - children = append(children, mapType, name, equals, tag) - if opts != nil { - children = append(children, opts) - } - children = append(children, semicolon) - - return &MapFieldNode{ - compositeNode: compositeNode{ - children: children, - }, - MapType: mapType, - Name: name, - Equals: equals, - Tag: tag, - Options: opts, - Semicolon: semicolon, - } -} - -func (n *MapFieldNode) FieldLabel() Node { - return nil -} - -func (n *MapFieldNode) FieldName() Node { - return n.Name -} - -func (n *MapFieldNode) FieldType() Node { - return n.MapType -} - -func (n *MapFieldNode) FieldTag() Node { - return n.Tag -} - -func (n *MapFieldNode) FieldExtendee() Node { - return nil -} - -func (n *MapFieldNode) GetGroupKeyword() Node { - return nil -} - -func (n *MapFieldNode) GetOptions() *CompactOptionsNode { - return n.Options -} - -func (n *MapFieldNode) MessageName() Node { - return n.Name -} - -func (n *MapFieldNode) KeyField() *SyntheticMapField { - return NewSyntheticMapField(n.MapType.KeyType, 1) -} - -func (n *MapFieldNode) ValueField() *SyntheticMapField { - return NewSyntheticMapField(n.MapType.ValueType, 2) -} - -// SyntheticMapField is not an actual node in the AST but a synthetic node -// that implements FieldDeclNode. These are used to represent the implicit -// field declarations of the "key" and "value" fields in a map entry. -type SyntheticMapField struct { - Ident IdentValueNode - Tag *UintLiteralNode -} - -// NewSyntheticMapField creates a new *SyntheticMapField for the given -// identifier (either a key or value type in a map declaration) and tag -// number (1 for key, 2 for value). -func NewSyntheticMapField(ident IdentValueNode, tagNum uint64) *SyntheticMapField { - tag := &UintLiteralNode{ - terminalNode: ident.Start().asTerminalNode(), - Val: tagNum, - } - return &SyntheticMapField{Ident: ident, Tag: tag} -} - -func (n *SyntheticMapField) Start() Token { - return n.Ident.Start() -} - -func (n *SyntheticMapField) End() Token { - return n.Ident.End() -} - -func (n *SyntheticMapField) LeadingComments() []Comment { - return nil -} - -func (n *SyntheticMapField) TrailingComments() []Comment { - return nil -} - -func (n *SyntheticMapField) FieldLabel() Node { - return n.Ident -} - -func (n *SyntheticMapField) FieldName() Node { - return n.Ident -} - -func (n *SyntheticMapField) FieldType() Node { - return n.Ident -} - -func (n *SyntheticMapField) FieldTag() Node { - return n.Tag -} - -func (n *SyntheticMapField) FieldExtendee() Node { - return nil -} - -func (n *SyntheticMapField) GetGroupKeyword() Node { - return nil -} - -func (n *SyntheticMapField) GetOptions() *CompactOptionsNode { - return nil -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/file.go b/vendor/github.com/bufbuild/protocompile/ast/file.go deleted file mode 100644 index f12cca09e2..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/file.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// FileDeclNode is a placeholder interface for AST nodes that represent files. -// This allows NoSourceNode to be used in place of *FileNode for some usages. -type FileDeclNode interface { - Node - Name() string - GetSyntax() Node - NodeInfo(n Node) NodeInfo -} - -var _ FileDeclNode = (*FileNode)(nil) -var _ FileDeclNode = NoSourceNode{} - -// FileNode is the root of the AST hierarchy. It represents an entire -// protobuf source file. -type FileNode struct { - compositeNode - fileInfo *FileInfo - - Syntax *SyntaxNode // nil if file has no syntax declaration - Decls []FileElement - - // This synthetic node allows access to final comments and whitespace - EOF *RuneNode -} - -// NewFileNode creates a new *FileNode. The syntax parameter is optional. If it -// is absent, it means the file had no syntax declaration. -// -// This function panics if the concrete type of any element of decls is not -// from this package. -func NewFileNode(info *FileInfo, syntax *SyntaxNode, decls []FileElement, eof Token) *FileNode { - numChildren := len(decls) + 1 - if syntax != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - if syntax != nil { - children = append(children, syntax) - } - for _, decl := range decls { - switch decl := decl.(type) { - case *PackageNode, *ImportNode, *OptionNode, *MessageNode, - *EnumNode, *ExtendNode, *ServiceNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid FileElement type: %T", decl)) - } - children = append(children, decl) - } - - eofNode := NewRuneNode(0, eof) - children = append(children, eofNode) - - return &FileNode{ - compositeNode: compositeNode{ - children: children, - }, - fileInfo: info, - Syntax: syntax, - Decls: decls, - EOF: eofNode, - } -} - -// NewEmptyFileNode returns an empty AST for a file with the given name. -func NewEmptyFileNode(filename string) *FileNode { - fileInfo := NewFileInfo(filename, []byte{}) - return NewFileNode(fileInfo, nil, nil, fileInfo.AddToken(0, 0)) -} - -func (f *FileNode) GetSyntax() Node { - return f.Syntax -} - -func (f *FileNode) Name() string { - return f.fileInfo.Name() -} - -func (f *FileNode) NodeInfo(n Node) NodeInfo { - return f.fileInfo.NodeInfo(n) -} - -func (f *FileNode) TokenInfo(t Token) NodeInfo { - return f.fileInfo.TokenInfo(t) -} - -func (f *FileNode) ItemInfo(i Item) ItemInfo { - return f.fileInfo.ItemInfo(i) -} - -func (f *FileNode) GetItem(i Item) (Token, Comment) { - return f.fileInfo.GetItem(i) -} - -func (f *FileNode) Items() Sequence[Item] { - return f.fileInfo.Items() -} - -func (f *FileNode) Tokens() Sequence[Token] { - return f.fileInfo.Tokens() -} - -// FileElement is an interface implemented by all AST nodes that are -// allowed as top-level declarations in the file. -type FileElement interface { - Node - fileElement() -} - -var _ FileElement = (*ImportNode)(nil) -var _ FileElement = (*PackageNode)(nil) -var _ FileElement = (*OptionNode)(nil) -var _ FileElement = (*MessageNode)(nil) -var _ FileElement = (*EnumNode)(nil) -var _ FileElement = (*ExtendNode)(nil) -var _ FileElement = (*ServiceNode)(nil) -var _ FileElement = (*EmptyDeclNode)(nil) - -// SyntaxNode represents a syntax declaration, which if present must be -// the first non-comment content. Example: -// -// syntax = "proto2"; -// -// Files that don't have a syntax node are assumed to use proto2 syntax. -type SyntaxNode struct { - compositeNode - Keyword *KeywordNode - Equals *RuneNode - Syntax StringValueNode - Semicolon *RuneNode -} - -// NewSyntaxNode creates a new *SyntaxNode. All four arguments must be non-nil: -// - keyword: The token corresponding to the "syntax" keyword. -// - equals: The token corresponding to the "=" rune. -// - syntax: The actual syntax value, e.g. "proto2" or "proto3". -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewSyntaxNode(keyword *KeywordNode, equals *RuneNode, syntax StringValueNode, semicolon *RuneNode) *SyntaxNode { - if keyword == nil { - panic("keyword is nil") - } - if equals == nil { - panic("equals is nil") - } - if syntax == nil { - panic("syntax is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - children := []Node{keyword, equals, syntax, semicolon} - return &SyntaxNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Equals: equals, - Syntax: syntax, - Semicolon: semicolon, - } -} - -// ImportNode represents an import statement. Example: -// -// import "google/protobuf/empty.proto"; -type ImportNode struct { - compositeNode - Keyword *KeywordNode - // Optional; if present indicates this is a public import - Public *KeywordNode - // Optional; if present indicates this is a weak import - Weak *KeywordNode - Name StringValueNode - Semicolon *RuneNode -} - -// NewImportNode creates a new *ImportNode. The public and weak arguments are optional -// and only one or the other (or neither) may be specified, not both. When public is -// non-nil, it indicates the "public" keyword in the import statement and means this is -// a public import. When weak is non-nil, it indicates the "weak" keyword in the import -// statement and means this is a weak import. When both are nil, this is a normal import. -// The other arguments must be non-nil: -// - keyword: The token corresponding to the "import" keyword. -// - public: The token corresponding to the optional "public" keyword. -// - weak: The token corresponding to the optional "weak" keyword. -// - name: The actual imported file name. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewImportNode(keyword *KeywordNode, public *KeywordNode, weak *KeywordNode, name StringValueNode, semicolon *RuneNode) *ImportNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - numChildren := 3 - if public != nil || weak != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - children = append(children, keyword) - if public != nil { - children = append(children, public) - } else if weak != nil { - children = append(children, weak) - } - children = append(children, name, semicolon) - - return &ImportNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Public: public, - Weak: weak, - Name: name, - Semicolon: semicolon, - } -} - -func (*ImportNode) fileElement() {} - -// PackageNode represents a package declaration. Example: -// -// package foobar.com; -type PackageNode struct { - compositeNode - Keyword *KeywordNode - Name IdentValueNode - Semicolon *RuneNode -} - -func (*PackageNode) fileElement() {} - -// NewPackageNode creates a new *PackageNode. All three arguments must be non-nil: -// - keyword: The token corresponding to the "package" keyword. -// - name: The package name declared for the file. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewPackageNode(keyword *KeywordNode, name IdentValueNode, semicolon *RuneNode) *PackageNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - children := []Node{keyword, name, semicolon} - return &PackageNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - Semicolon: semicolon, - } -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/file_info.go b/vendor/github.com/bufbuild/protocompile/ast/file_info.go deleted file mode 100644 index 1de9345773..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/file_info.go +++ /dev/null @@ -1,676 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "fmt" - "sort" - "unicode/utf8" -) - -// FileInfo contains information about the contents of a source file, including -// details about comments and items. A lexer accumulates these details as it -// scans the file contents. This allows efficient representation of things like -// source positions. -type FileInfo struct { - // The name of the source file. - name string - // The raw contents of the source file. - data []byte - // The offsets for each line in the file. The value is the zero-based byte - // offset for a given line. The line is given by its index. So the value at - // index 0 is the offset for the first line (which is always zero). The - // value at index 1 is the offset at which the second line begins. Etc. - lines []int - // The info for every comment in the file. This is empty if the file has no - // comments. The first entry corresponds to the first comment in the file, - // and so on. - comments []commentInfo - // The info for every lexed item in the file. The last item in the slice - // corresponds to the EOF, so every file (even an empty one) should have at - // least one entry. This includes all terminal symbols (tokens) in the AST - // as well as all comments. - items []itemSpan -} - -type commentInfo struct { - // the index of the item, in the file's items slice, that represents this - // comment - index int - // the index of the token to which this comment is attributed. - attributedToIndex int -} - -type itemSpan struct { - // the offset into the file of the first character of an item. - offset int - // the length of the item - length int -} - -// NewFileInfo creates a new instance for the given file. -func NewFileInfo(filename string, contents []byte) *FileInfo { - return &FileInfo{ - name: filename, - data: contents, - lines: []int{0}, - } -} - -func (f *FileInfo) Name() string { - return f.name -} - -// AddLine adds the offset representing the beginning of the "next" line in the file. -// The first line always starts at offset 0, the second line starts at offset-of-newline-char+1. -func (f *FileInfo) AddLine(offset int) { - if offset < 0 { - panic(fmt.Sprintf("invalid offset: %d must not be negative", offset)) - } - if offset > len(f.data) { - panic(fmt.Sprintf("invalid offset: %d is greater than file size %d", offset, len(f.data))) - } - - if len(f.lines) > 0 { - lastOffset := f.lines[len(f.lines)-1] - if offset <= lastOffset { - panic(fmt.Sprintf("invalid offset: %d is not greater than previously observed line offset %d", offset, lastOffset)) - } - } - - f.lines = append(f.lines, offset) -} - -// AddToken adds info about a token at the given location to this file. It -// returns a value that allows access to all of the token's details. -func (f *FileInfo) AddToken(offset, length int) Token { - if offset < 0 { - panic(fmt.Sprintf("invalid offset: %d must not be negative", offset)) - } - if length < 0 { - panic(fmt.Sprintf("invalid length: %d must not be negative", length)) - } - if offset+length > len(f.data) { - panic(fmt.Sprintf("invalid offset+length: %d is greater than file size %d", offset+length, len(f.data))) - } - - tokenID := len(f.items) - if len(f.items) > 0 { - lastToken := f.items[tokenID-1] - lastEnd := lastToken.offset + lastToken.length - 1 - if offset <= lastEnd { - panic(fmt.Sprintf("invalid offset: %d is not greater than previously observed token end %d", offset, lastEnd)) - } - } - - f.items = append(f.items, itemSpan{offset: offset, length: length}) - return Token(tokenID) -} - -// AddComment adds info about a comment to this file. Comments must first be -// added as items via f.AddToken(). The given comment argument is the Token -// from that step. The given attributedTo argument indicates another token in the -// file with which the comment is associated. If comment's offset is before that -// of attributedTo, then this is a leading comment. Otherwise, it is a trailing -// comment. -func (f *FileInfo) AddComment(comment, attributedTo Token) Comment { - if len(f.comments) > 0 { - lastComment := f.comments[len(f.comments)-1] - if int(comment) <= lastComment.index { - panic(fmt.Sprintf("invalid index: %d is not greater than previously observed comment index %d", comment, lastComment.index)) - } - if int(attributedTo) < lastComment.attributedToIndex { - panic(fmt.Sprintf("invalid attribution: %d is not greater than previously observed comment attribution index %d", attributedTo, lastComment.attributedToIndex)) - } - } - - f.comments = append(f.comments, commentInfo{index: int(comment), attributedToIndex: int(attributedTo)}) - return Comment{ - fileInfo: f, - index: len(f.comments) - 1, - } -} - -// NodeInfo returns details from the original source for the given AST node. -// -// If the given n is out of range, this returns an invalid NodeInfo (i.e. -// nodeInfo.IsValid() returns false). If the given n is not out of range but -// also from a different file than f, then the result is undefined. -func (f *FileInfo) NodeInfo(n Node) NodeInfo { - return f.nodeInfo(int(n.Start()), int(n.End())) -} - -// TokenInfo returns details from the original source for the given token. -// -// If the given t is out of range, this returns an invalid NodeInfo (i.e. -// nodeInfo.IsValid() returns false). If the given t is not out of range but -// also from a different file than f, then the result is undefined. -func (f *FileInfo) TokenInfo(t Token) NodeInfo { - return f.nodeInfo(int(t), int(t)) -} - -func (f *FileInfo) nodeInfo(start, end int) NodeInfo { - if start < 0 || start >= len(f.items) { - return NodeInfo{} - } - if end < 0 || end >= len(f.items) { - return NodeInfo{} - } - return NodeInfo{fileInfo: f, startIndex: start, endIndex: end} -} - -// ItemInfo returns details from the original source for the given item. -// -// If the given i is out of range, this returns nil. If the given i is not -// out of range but also from a different file than f, then the result is -// undefined. -func (f *FileInfo) ItemInfo(i Item) ItemInfo { - tok, cmt := f.GetItem(i) - if tok != TokenError { - return f.TokenInfo(tok) - } - if cmt.IsValid() { - return cmt - } - return nil -} - -// GetItem returns the token or comment represented by the given item. Only one -// of the return values will be valid. If the item is a token then the returned -// comment will be a zero value and thus invalid (i.e. comment.IsValid() returns -// false). If the item is a comment then the returned token will be TokenError. -// -// If the given i is out of range, this returns (TokenError, Comment{}). If the -// given i is not out of range but also from a different file than f, then -// the result is undefined. -func (f *FileInfo) GetItem(i Item) (Token, Comment) { - if i < 0 || int(i) >= len(f.items) { - return TokenError, Comment{} - } - if !f.isComment(i) { - return Token(i), Comment{} - } - // It's a comment, so find its location in f.comments - c := sort.Search(len(f.comments), func(c int) bool { - return f.comments[c].index >= int(i) - }) - if c < len(f.comments) && f.comments[c].index == int(i) { - return TokenError, Comment{fileInfo: f, index: c} - } - // f.isComment(i) returned true, but we couldn't find it - // in f.comments? Uh oh... that shouldn't be possible. - return TokenError, Comment{} -} - -func (f *FileInfo) isDummyFile() bool { - return f == nil || f.lines == nil -} - -// Sequence represents a navigable sequence of elements. -type Sequence[T any] interface { - // First returns the first element in the sequence. The bool return - // is false if this sequence contains no elements. For example, an - // empty file has no items or tokens. - First() (T, bool) - // Next returns the next element in the sequence that comes after - // the given element. The bool returns is false if there is no next - // item (i.e. the given element is the last one). It also returns - // false if the given element is invalid. - Next(T) (T, bool) - // Last returns the last element in the sequence. The bool return - // is false if this sequence contains no elements. For example, an - // empty file has no items or tokens. - Last() (T, bool) - // Previous returns the previous element in the sequence that comes - // before the given element. The bool returns is false if there is no - // previous item (i.e. the given element is the first one). It also - // returns false if the given element is invalid. - Previous(T) (T, bool) -} - -func (f *FileInfo) Items() Sequence[Item] { - return items{fileInfo: f} -} - -func (f *FileInfo) Tokens() Sequence[Token] { - return tokens{fileInfo: f} -} - -type items struct { - fileInfo *FileInfo -} - -func (i items) First() (Item, bool) { - if len(i.fileInfo.items) == 0 { - return 0, false - } - return 0, true -} - -func (i items) Next(item Item) (Item, bool) { - if item < 0 || int(item) >= len(i.fileInfo.items)-1 { - return 0, false - } - return i.fileInfo.itemForward(item+1, true) -} - -func (i items) Last() (Item, bool) { - if len(i.fileInfo.items) == 0 { - return 0, false - } - return Item(len(i.fileInfo.items) - 1), true -} - -func (i items) Previous(item Item) (Item, bool) { - if item <= 0 || int(item) >= len(i.fileInfo.items) { - return 0, false - } - return i.fileInfo.itemBackward(item-1, true) -} - -type tokens struct { - fileInfo *FileInfo -} - -func (t tokens) First() (Token, bool) { - i, ok := t.fileInfo.itemForward(0, false) - return Token(i), ok -} - -func (t tokens) Next(tok Token) (Token, bool) { - if tok < 0 || int(tok) >= len(t.fileInfo.items)-1 { - return 0, false - } - i, ok := t.fileInfo.itemForward(Item(tok+1), false) - return Token(i), ok -} - -func (t tokens) Last() (Token, bool) { - i, ok := t.fileInfo.itemBackward(Item(len(t.fileInfo.items))-1, false) - return Token(i), ok -} - -func (t tokens) Previous(tok Token) (Token, bool) { - if tok <= 0 || int(tok) >= len(t.fileInfo.items) { - return 0, false - } - i, ok := t.fileInfo.itemBackward(Item(tok-1), false) - return Token(i), ok -} - -func (f *FileInfo) itemForward(i Item, allowComment bool) (Item, bool) { - end := Item(len(f.items)) - for i < end { - if allowComment || !f.isComment(i) { - return i, true - } - i++ - } - return 0, false -} - -func (f *FileInfo) itemBackward(i Item, allowComment bool) (Item, bool) { - for i >= 0 { - if allowComment || !f.isComment(i) { - return i, true - } - i-- - } - return 0, false -} - -// isComment is comment returns true if i refers to a comment. -// (If it returns false, i refers to a token.) -func (f *FileInfo) isComment(i Item) bool { - item := f.items[i] - if item.length < 2 { - return false - } - // see if item text starts with "//" or "/*" - if f.data[item.offset] != '/' { - return false - } - c := f.data[item.offset+1] - return c == '/' || c == '*' -} - -func (f *FileInfo) SourcePos(offset int) SourcePos { - lineNumber := sort.Search(len(f.lines), func(n int) bool { - return f.lines[n] > offset - }) - - // If it weren't for tabs and multi-byte unicode characters, we - // could trivially compute the column just based on offset and the - // starting offset of lineNumber :( - // Wish this were more efficient... that would require also storing - // computed line+column information, which would triple the size of - // f's items slice... - col := 0 - for i := f.lines[lineNumber-1]; i < offset; i++ { - if f.data[i] == '\t' { - nextTabStop := 8 - (col % 8) - col += nextTabStop - } else if utf8.RuneStart(f.data[i]) { - col++ - } - } - - return SourcePos{ - Filename: f.name, - Offset: offset, - Line: lineNumber, - // Columns are 1-indexed in this AST - Col: col + 1, - } -} - -// Token represents a single lexed token. -type Token int - -// TokenError indicates an invalid token. It is returned from query -// functions when no valid token satisfies the request. -const TokenError = Token(-1) - -// AsItem returns the Item that corresponds to t. -func (t Token) AsItem() Item { - return Item(t) -} - -func (t Token) asTerminalNode() terminalNode { - return terminalNode(t) -} - -// Item represents an item lexed from source. It represents either -// a Token or a Comment. -type Item int - -// ItemInfo provides details about an item's location in the source file and -// its contents. -type ItemInfo interface { - Start() SourcePos - End() SourcePos - LeadingWhitespace() string - RawText() string -} - -// NodeInfo represents the details for a node or token in the source file's AST. -// It provides access to information about the node's location in the source -// file. It also provides access to the original text in the source file (with -// all the original formatting intact) and also provides access to surrounding -// comments. -type NodeInfo struct { - fileInfo *FileInfo - startIndex, endIndex int -} - -var _ ItemInfo = NodeInfo{} - -// IsValid returns true if this node info is valid. If n is a zero-value struct, -// it is not valid. -func (n NodeInfo) IsValid() bool { - return n.fileInfo != nil -} - -// Start returns the starting position of the element. This is the first -// character of the node or token. -func (n NodeInfo) Start() SourcePos { - if n.fileInfo.isDummyFile() { - return UnknownPos(n.fileInfo.name) - } - - tok := n.fileInfo.items[n.startIndex] - return n.fileInfo.SourcePos(tok.offset) -} - -// End returns the ending position of the element, exclusive. This is the -// location after the last character of the node or token. If n returns -// the same position for Start() and End(), the element in source had a -// length of zero (which should only happen for the special EOF token -// that designates the end of the file). -func (n NodeInfo) End() SourcePos { - if n.fileInfo.isDummyFile() { - return UnknownPos(n.fileInfo.name) - } - - tok := n.fileInfo.items[n.endIndex] - // find offset of last character in the span - offset := tok.offset - if tok.length > 0 { - offset += tok.length - 1 - } - pos := n.fileInfo.SourcePos(offset) - if tok.length > 0 { - // We return "open range", so end is the position *after* the - // last character in the span. So we adjust - pos.Col++ - } - return pos -} - -// LeadingWhitespace returns any whitespace prior to the element. If there -// were comments in between this element and the previous one, this will -// return the whitespace between the last such comment in the element. If -// there were no such comments, this returns the whitespace between the -// previous element and the current one. -func (n NodeInfo) LeadingWhitespace() string { - if n.fileInfo.isDummyFile() { - return "" - } - - tok := n.fileInfo.items[n.startIndex] - var prevEnd int - if n.startIndex > 0 { - prevTok := n.fileInfo.items[n.startIndex-1] - prevEnd = prevTok.offset + prevTok.length - } - return string(n.fileInfo.data[prevEnd:tok.offset]) -} - -// LeadingComments returns all comments in the source that exist between the -// element and the previous element, except for any trailing comment on the -// previous element. -func (n NodeInfo) LeadingComments() Comments { - if n.fileInfo.isDummyFile() { - return EmptyComments - } - - start := sort.Search(len(n.fileInfo.comments), func(i int) bool { - return n.fileInfo.comments[i].attributedToIndex >= n.startIndex - }) - - if start == len(n.fileInfo.comments) || n.fileInfo.comments[start].attributedToIndex != n.startIndex { - // no comments associated with this token - return EmptyComments - } - - numComments := 0 - for i := start; i < len(n.fileInfo.comments); i++ { - comment := n.fileInfo.comments[i] - if comment.attributedToIndex == n.startIndex && - comment.index < n.startIndex { - numComments++ - } else { - break - } - } - - return Comments{ - fileInfo: n.fileInfo, - first: start, - num: numComments, - } -} - -// TrailingComments returns the trailing comment for the element, if any. -// An element will have a trailing comment only if it is the last token -// on a line and is followed by a comment on the same line. Typically, the -// following comment is a line-style comment (starting with "//"). -// -// If the following comment is a block-style comment that spans multiple -// lines, and the next token is on the same line as the end of the comment, -// the comment is NOT considered a trailing comment. -// -// Examples: -// -// foo // this is a trailing comment for foo -// -// bar /* this is a trailing comment for bar */ -// -// baz /* this is a trailing -// comment for baz */ -// -// fizz /* this is NOT a trailing -// comment for fizz because -// its on the same line as the -// following token buzz */ buzz -func (n NodeInfo) TrailingComments() Comments { - if n.fileInfo.isDummyFile() { - return EmptyComments - } - - start := sort.Search(len(n.fileInfo.comments), func(i int) bool { - comment := n.fileInfo.comments[i] - return comment.attributedToIndex >= n.endIndex && - comment.index > n.endIndex - }) - - if start == len(n.fileInfo.comments) || n.fileInfo.comments[start].attributedToIndex != n.endIndex { - // no comments associated with this token - return EmptyComments - } - - numComments := 0 - for i := start; i < len(n.fileInfo.comments); i++ { - comment := n.fileInfo.comments[i] - if comment.attributedToIndex == n.endIndex { - numComments++ - } else { - break - } - } - - return Comments{ - fileInfo: n.fileInfo, - first: start, - num: numComments, - } -} - -// RawText returns the actual text in the source file that corresponds to the -// element. If the element is a node in the AST that encompasses multiple -// items (like an entire declaration), the full text of all items is returned -// including any interior whitespace and comments. -func (n NodeInfo) RawText() string { - startTok := n.fileInfo.items[n.startIndex] - endTok := n.fileInfo.items[n.endIndex] - return string(n.fileInfo.data[startTok.offset : endTok.offset+endTok.length]) -} - -// SourcePos identifies a location in a proto source file. -type SourcePos struct { - Filename string - // The line and column numbers for this position. These are - // one-based, so the first line and column is 1 (not zero). If - // either is zero, then the line and column are unknown and - // only the file name is known. - Line, Col int - // The offset, in bytes, from the beginning of the file. This - // is zero-based: the first character in the file is offset zero. - Offset int -} - -func (pos SourcePos) String() string { - if pos.Line <= 0 || pos.Col <= 0 { - return pos.Filename - } - return fmt.Sprintf("%s:%d:%d", pos.Filename, pos.Line, pos.Col) -} - -// Comments represents a range of sequential comments in a source file -// (e.g. no interleaving items or AST nodes). -type Comments struct { - fileInfo *FileInfo - first, num int -} - -// EmptyComments is an empty set of comments. -var EmptyComments = Comments{} - -// Len returns the number of comments in c. -func (c Comments) Len() int { - return c.num -} - -func (c Comments) Index(i int) Comment { - if i < 0 || i >= c.num { - panic(fmt.Sprintf("index %d out of range (len = %d)", i, c.num)) - } - return Comment{ - fileInfo: c.fileInfo, - index: c.first + i, - } -} - -// Comment represents a single comment in a source file. It indicates -// the position of the comment and its contents. A single comment means -// one line-style comment ("//" to end of line) or one block comment -// ("/*" through "*/"). If a longer comment uses multiple line comments, -// each line is considered to be a separate comment. For example: -// -// // This is a single comment, and -// // this is a separate comment. -type Comment struct { - fileInfo *FileInfo - index int -} - -var _ ItemInfo = Comment{} - -// IsValid returns true if this comment is valid. If this comment is -// a zero-value struct, it is not valid. -func (c Comment) IsValid() bool { - return c.fileInfo != nil && c.index >= 0 -} - -// AsItem returns the Item that corresponds to c. -func (c Comment) AsItem() Item { - return Item(c.fileInfo.comments[c.index].index) -} - -func (c Comment) Start() SourcePos { - span := c.fileInfo.items[c.AsItem()] - return c.fileInfo.SourcePos(span.offset) -} - -func (c Comment) End() SourcePos { - span := c.fileInfo.items[c.AsItem()] - return c.fileInfo.SourcePos(span.offset + span.length - 1) -} - -func (c Comment) LeadingWhitespace() string { - item := c.AsItem() - span := c.fileInfo.items[item] - var prevEnd int - if item > 0 { - prevItem := c.fileInfo.items[item-1] - prevEnd = prevItem.offset + prevItem.length - } - return string(c.fileInfo.data[prevEnd:span.offset]) -} - -func (c Comment) RawText() string { - span := c.fileInfo.items[c.AsItem()] - return string(c.fileInfo.data[span.offset : span.offset+span.length]) -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/identifiers.go b/vendor/github.com/bufbuild/protocompile/ast/identifiers.go deleted file mode 100644 index 275999291f..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/identifiers.go +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "fmt" - "strings" -) - -// Identifier is a possibly-qualified name. This is used to distinguish -// ValueNode values that are references/identifiers vs. those that are -// string literals. -type Identifier string - -// IdentValueNode is an AST node that represents an identifier. -type IdentValueNode interface { - ValueNode - AsIdentifier() Identifier -} - -var _ IdentValueNode = (*IdentNode)(nil) -var _ IdentValueNode = (*CompoundIdentNode)(nil) - -// IdentNode represents a simple, unqualified identifier. These are used to name -// elements declared in a protobuf file or to refer to elements. Example: -// -// foobar -type IdentNode struct { - terminalNode - Val string -} - -// NewIdentNode creates a new *IdentNode. The given val is the identifier text. -func NewIdentNode(val string, tok Token) *IdentNode { - return &IdentNode{ - terminalNode: tok.asTerminalNode(), - Val: val, - } -} - -func (n *IdentNode) Value() interface{} { - return n.AsIdentifier() -} - -func (n *IdentNode) AsIdentifier() Identifier { - return Identifier(n.Val) -} - -// ToKeyword is used to convert identifiers to keywords. Since keywords are not -// reserved in the protobuf language, they are initially lexed as identifiers -// and then converted to keywords based on context. -func (n *IdentNode) ToKeyword() *KeywordNode { - return (*KeywordNode)(n) -} - -// CompoundIdentNode represents a qualified identifier. A qualified identifier -// has at least one dot and possibly multiple identifier names (all separated by -// dots). If the identifier has a leading dot, then it is a *fully* qualified -// identifier. Example: -// -// .com.foobar.Baz -type CompoundIdentNode struct { - compositeNode - // Optional leading dot, indicating that the identifier is fully qualified. - LeadingDot *RuneNode - Components []*IdentNode - // Dots[0] is the dot after Components[0]. The length of Dots is always - // one less than the length of Components. - Dots []*RuneNode - // The text value of the identifier, with all components and dots - // concatenated. - Val string -} - -// NewCompoundIdentNode creates a *CompoundIdentNode. The leadingDot may be nil. -// The dots arg must have a length that is one less than the length of -// components. The components arg must not be empty. -func NewCompoundIdentNode(leadingDot *RuneNode, components []*IdentNode, dots []*RuneNode) *CompoundIdentNode { - if len(components) == 0 { - panic("must have at least one component") - } - if len(dots) != len(components)-1 { - panic(fmt.Sprintf("%d components requires %d dots, not %d", len(components), len(components)-1, len(dots))) - } - numChildren := len(components)*2 - 1 - if leadingDot != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - var b strings.Builder - if leadingDot != nil { - children = append(children, leadingDot) - b.WriteRune(leadingDot.Rune) - } - for i, comp := range components { - if i > 0 { - dot := dots[i-1] - children = append(children, dot) - b.WriteRune(dot.Rune) - } - children = append(children, comp) - b.WriteString(comp.Val) - } - return &CompoundIdentNode{ - compositeNode: compositeNode{ - children: children, - }, - LeadingDot: leadingDot, - Components: components, - Dots: dots, - Val: b.String(), - } -} - -func (n *CompoundIdentNode) Value() interface{} { - return n.AsIdentifier() -} - -func (n *CompoundIdentNode) AsIdentifier() Identifier { - return Identifier(n.Val) -} - -// KeywordNode is an AST node that represents a keyword. Keywords are -// like identifiers, but they have special meaning in particular contexts. -// Example: -// -// message -type KeywordNode IdentNode - -// NewKeywordNode creates a new *KeywordNode. The given val is the keyword. -func NewKeywordNode(val string, tok Token) *KeywordNode { - return &KeywordNode{ - terminalNode: tok.asTerminalNode(), - Val: val, - } -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/message.go b/vendor/github.com/bufbuild/protocompile/ast/message.go deleted file mode 100644 index 00dfe45f89..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/message.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// MessageDeclNode is a node in the AST that defines a message type. This -// includes normal message fields as well as implicit messages: -// - *MessageNode -// - *GroupNode (the group is a field and inline message type) -// - *MapFieldNode (map fields implicitly define a MapEntry message type) -// -// This also allows NoSourceNode to be used in place of one of the above -// for some usages. -type MessageDeclNode interface { - Node - MessageName() Node -} - -var _ MessageDeclNode = (*MessageNode)(nil) -var _ MessageDeclNode = (*GroupNode)(nil) -var _ MessageDeclNode = (*MapFieldNode)(nil) -var _ MessageDeclNode = NoSourceNode{} - -// MessageNode represents a message declaration. Example: -// -// message Foo { -// string name = 1; -// repeated string labels = 2; -// bytes extra = 3; -// } -type MessageNode struct { - compositeNode - Keyword *KeywordNode - Name *IdentNode - MessageBody -} - -func (*MessageNode) fileElement() {} -func (*MessageNode) msgElement() {} - -// NewMessageNode creates a new *MessageNode. All arguments must be non-nil. -// - keyword: The token corresponding to the "message" keyword. -// - name: The token corresponding to the field's name. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the message body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewMessageNode(keyword *KeywordNode, name *IdentNode, openBrace *RuneNode, decls []MessageElement, closeBrace *RuneNode) *MessageNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 4+len(decls)) - children = append(children, keyword, name, openBrace) - for _, decl := range decls { - children = append(children, decl) - } - children = append(children, closeBrace) - - ret := &MessageNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - } - populateMessageBody(&ret.MessageBody, openBrace, decls, closeBrace) - return ret -} - -func (n *MessageNode) MessageName() Node { - return n.Name -} - -// MessageBody represents the body of a message. It is used by both -// MessageNodes and GroupNodes. -type MessageBody struct { - OpenBrace *RuneNode - Decls []MessageElement - CloseBrace *RuneNode -} - -func populateMessageBody(m *MessageBody, openBrace *RuneNode, decls []MessageElement, closeBrace *RuneNode) { - m.OpenBrace = openBrace - m.Decls = decls - for _, decl := range decls { - switch decl.(type) { - case *OptionNode, *FieldNode, *MapFieldNode, *GroupNode, *OneOfNode, - *MessageNode, *EnumNode, *ExtendNode, *ExtensionRangeNode, - *ReservedNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid MessageElement type: %T", decl)) - } - } - m.CloseBrace = closeBrace -} - -// MessageElement is an interface implemented by all AST nodes that can -// appear in a message body. -type MessageElement interface { - Node - msgElement() -} - -var _ MessageElement = (*OptionNode)(nil) -var _ MessageElement = (*FieldNode)(nil) -var _ MessageElement = (*MapFieldNode)(nil) -var _ MessageElement = (*OneOfNode)(nil) -var _ MessageElement = (*GroupNode)(nil) -var _ MessageElement = (*MessageNode)(nil) -var _ MessageElement = (*EnumNode)(nil) -var _ MessageElement = (*ExtendNode)(nil) -var _ MessageElement = (*ExtensionRangeNode)(nil) -var _ MessageElement = (*ReservedNode)(nil) -var _ MessageElement = (*EmptyDeclNode)(nil) - -// ExtendNode represents a declaration of extension fields. Example: -// -// extend google.protobuf.FieldOptions { -// bool redacted = 33333; -// } -type ExtendNode struct { - compositeNode - Keyword *KeywordNode - Extendee IdentValueNode - OpenBrace *RuneNode - Decls []ExtendElement - CloseBrace *RuneNode -} - -func (*ExtendNode) fileElement() {} -func (*ExtendNode) msgElement() {} - -// NewExtendNode creates a new *ExtendNode. All arguments must be non-nil. -// - keyword: The token corresponding to the "extend" keyword. -// - extendee: The token corresponding to the name of the extended message. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the message body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewExtendNode(keyword *KeywordNode, extendee IdentValueNode, openBrace *RuneNode, decls []ExtendElement, closeBrace *RuneNode) *ExtendNode { - if keyword == nil { - panic("keyword is nil") - } - if extendee == nil { - panic("extendee is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 4+len(decls)) - children = append(children, keyword, extendee, openBrace) - for _, decl := range decls { - children = append(children, decl) - } - children = append(children, closeBrace) - - ret := &ExtendNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Extendee: extendee, - OpenBrace: openBrace, - Decls: decls, - CloseBrace: closeBrace, - } - for _, decl := range decls { - switch decl := decl.(type) { - case *FieldNode: - decl.Extendee = ret - case *GroupNode: - decl.Extendee = ret - case *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid ExtendElement type: %T", decl)) - } - } - return ret -} - -// ExtendElement is an interface implemented by all AST nodes that can -// appear in the body of an extends declaration. -type ExtendElement interface { - Node - extendElement() -} - -var _ ExtendElement = (*FieldNode)(nil) -var _ ExtendElement = (*GroupNode)(nil) -var _ ExtendElement = (*EmptyDeclNode)(nil) diff --git a/vendor/github.com/bufbuild/protocompile/ast/no_source.go b/vendor/github.com/bufbuild/protocompile/ast/no_source.go deleted file mode 100644 index d66d939575..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/no_source.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -// UnknownPos is a placeholder position when only the source file -// name is known. -func UnknownPos(filename string) SourcePos { - return SourcePos{Filename: filename} -} - -// NoSourceNode is a placeholder AST node that implements numerous -// interfaces in this package. It can be used to represent an AST -// element for a file whose source is not available. -type NoSourceNode struct { - filename string -} - -// NewNoSourceNode creates a new NoSourceNode for the given filename. -func NewNoSourceNode(filename string) NoSourceNode { - return NoSourceNode{filename: filename} -} - -func (n NoSourceNode) Name() string { - return n.filename -} - -func (n NoSourceNode) Start() Token { - return 0 -} - -func (n NoSourceNode) End() Token { - return 0 -} - -func (n NoSourceNode) NodeInfo(Node) NodeInfo { - return NodeInfo{ - fileInfo: &FileInfo{name: n.filename}, - } -} - -func (n NoSourceNode) GetSyntax() Node { - return n -} - -func (n NoSourceNode) GetName() Node { - return n -} - -func (n NoSourceNode) GetValue() ValueNode { - return n -} - -func (n NoSourceNode) FieldLabel() Node { - return n -} - -func (n NoSourceNode) FieldName() Node { - return n -} - -func (n NoSourceNode) FieldType() Node { - return n -} - -func (n NoSourceNode) FieldTag() Node { - return n -} - -func (n NoSourceNode) FieldExtendee() Node { - return n -} - -func (n NoSourceNode) GetGroupKeyword() Node { - return n -} - -func (n NoSourceNode) GetOptions() *CompactOptionsNode { - return nil -} - -func (n NoSourceNode) RangeStart() Node { - return n -} - -func (n NoSourceNode) RangeEnd() Node { - return n -} - -func (n NoSourceNode) GetNumber() Node { - return n -} - -func (n NoSourceNode) MessageName() Node { - return n -} - -func (n NoSourceNode) GetInputType() Node { - return n -} - -func (n NoSourceNode) GetOutputType() Node { - return n -} - -func (n NoSourceNode) Value() interface{} { - return nil -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/node.go b/vendor/github.com/bufbuild/protocompile/ast/node.go deleted file mode 100644 index 63a76c7988..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/node.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -// Node is the interface implemented by all nodes in the AST. It -// provides information about the span of this AST node in terms -// of location in the source file. It also provides information -// about all prior comments (attached as leading comments) and -// optional subsequent comments (attached as trailing comments). -type Node interface { - Start() Token - End() Token -} - -// TerminalNode represents a leaf in the AST. These represent -// the items/lexemes in the protobuf language. Comments and -// whitespace are accumulated by the lexer and associated with -// the following lexed token. -type TerminalNode interface { - Node - Token() Token -} - -var _ TerminalNode = (*StringLiteralNode)(nil) -var _ TerminalNode = (*UintLiteralNode)(nil) -var _ TerminalNode = (*FloatLiteralNode)(nil) -var _ TerminalNode = (*IdentNode)(nil) -var _ TerminalNode = (*SpecialFloatLiteralNode)(nil) -var _ TerminalNode = (*KeywordNode)(nil) -var _ TerminalNode = (*RuneNode)(nil) - -// CompositeNode represents any non-terminal node in the tree. These -// are interior or root nodes and have child nodes. -type CompositeNode interface { - Node - // Children contains all AST nodes that are immediate children of this one. - Children() []Node -} - -// terminalNode contains bookkeeping shared by all TerminalNode -// implementations. It is embedded in all such node types in this -// package. It provides the implementation of the TerminalNode -// interface. -type terminalNode Token - -func (n terminalNode) Start() Token { - return Token(n) -} - -func (n terminalNode) End() Token { - return Token(n) -} - -func (n terminalNode) Token() Token { - return Token(n) -} - -// compositeNode contains bookkeeping shared by all CompositeNode -// implementations. It is embedded in all such node types in this -// package. It provides the implementation of the CompositeNode -// interface. -type compositeNode struct { - children []Node -} - -func (n *compositeNode) Children() []Node { - return n.children -} - -func (n *compositeNode) Start() Token { - return n.children[0].Start() -} - -func (n *compositeNode) End() Token { - return n.children[len(n.children)-1].End() -} - -// RuneNode represents a single rune in protobuf source. Runes -// are typically collected into items, but some runes stand on -// their own, such as punctuation/symbols like commas, semicolons, -// equals signs, open and close symbols (braces, brackets, angles, -// and parentheses), and periods/dots. -// TODO: make this more compact; if runes don't have attributed comments -// then we don't need a Token to represent them and only need an offset -// into the file's contents. -type RuneNode struct { - terminalNode - Rune rune -} - -// NewRuneNode creates a new *RuneNode with the given properties. -func NewRuneNode(r rune, tok Token) *RuneNode { - return &RuneNode{ - terminalNode: tok.asTerminalNode(), - Rune: r, - } -} - -// EmptyDeclNode represents an empty declaration in protobuf source. -// These amount to extra semicolons, with no actual content preceding -// the semicolon. -type EmptyDeclNode struct { - compositeNode - Semicolon *RuneNode -} - -// NewEmptyDeclNode creates a new *EmptyDeclNode. The one argument must -// be non-nil. -func NewEmptyDeclNode(semicolon *RuneNode) *EmptyDeclNode { - if semicolon == nil { - panic("semicolon is nil") - } - return &EmptyDeclNode{ - compositeNode: compositeNode{ - children: []Node{semicolon}, - }, - Semicolon: semicolon, - } -} - -func (e *EmptyDeclNode) fileElement() {} -func (e *EmptyDeclNode) msgElement() {} -func (e *EmptyDeclNode) extendElement() {} -func (e *EmptyDeclNode) oneOfElement() {} -func (e *EmptyDeclNode) enumElement() {} -func (e *EmptyDeclNode) serviceElement() {} -func (e *EmptyDeclNode) methodElement() {} diff --git a/vendor/github.com/bufbuild/protocompile/ast/options.go b/vendor/github.com/bufbuild/protocompile/ast/options.go deleted file mode 100644 index 497ad44b5b..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/options.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// OptionDeclNode is a placeholder interface for AST nodes that represent -// options. This allows NoSourceNode to be used in place of *OptionNode -// for some usages. -type OptionDeclNode interface { - Node - GetName() Node - GetValue() ValueNode -} - -var _ OptionDeclNode = (*OptionNode)(nil) -var _ OptionDeclNode = NoSourceNode{} - -// OptionNode represents the declaration of a single option for an element. -// It is used both for normal option declarations (start with "option" keyword -// and end with semicolon) and for compact options found in fields, enum values, -// and extension ranges. Example: -// -// option (custom.option) = "foo"; -type OptionNode struct { - compositeNode - Keyword *KeywordNode // absent for compact options - Name *OptionNameNode - Equals *RuneNode - Val ValueNode - Semicolon *RuneNode // absent for compact options -} - -func (n *OptionNode) fileElement() {} -func (n *OptionNode) msgElement() {} -func (n *OptionNode) oneOfElement() {} -func (n *OptionNode) enumElement() {} -func (n *OptionNode) serviceElement() {} -func (n *OptionNode) methodElement() {} - -// NewOptionNode creates a new *OptionNode for a full option declaration (as -// used in files, messages, oneofs, enums, services, and methods). All arguments -// must be non-nil. (Also see NewCompactOptionNode.) -// - keyword: The token corresponding to the "option" keyword. -// - name: The token corresponding to the name of the option. -// - equals: The token corresponding to the "=" rune after the name. -// - val: The token corresponding to the option value. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewOptionNode(keyword *KeywordNode, name *OptionNameNode, equals *RuneNode, val ValueNode, semicolon *RuneNode) *OptionNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if val == nil { - panic("val is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - children := []Node{keyword, name, equals, val, semicolon} - return &OptionNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - Equals: equals, - Val: val, - Semicolon: semicolon, - } -} - -// NewCompactOptionNode creates a new *OptionNode for a full compact declaration -// (as used in fields, enum values, and extension ranges). All arguments must be -// non-nil. -// - name: The token corresponding to the name of the option. -// - equals: The token corresponding to the "=" rune after the name. -// - val: The token corresponding to the option value. -func NewCompactOptionNode(name *OptionNameNode, equals *RuneNode, val ValueNode) *OptionNode { - if name == nil { - panic("name is nil") - } - if equals == nil { - panic("equals is nil") - } - if val == nil { - panic("val is nil") - } - children := []Node{name, equals, val} - return &OptionNode{ - compositeNode: compositeNode{ - children: children, - }, - Name: name, - Equals: equals, - Val: val, - } -} - -func (n *OptionNode) GetName() Node { - return n.Name -} - -func (n *OptionNode) GetValue() ValueNode { - return n.Val -} - -// OptionNameNode represents an option name or even a traversal through message -// types to name a nested option field. Example: -// -// (foo.bar).baz.(bob) -type OptionNameNode struct { - compositeNode - Parts []*FieldReferenceNode - // Dots represent the separating '.' characters between name parts. The - // length of this slice must be exactly len(Parts)-1, each item in Parts - // having a corresponding item in this slice *except the last* (since a - // trailing dot is not allowed). - // - // These do *not* include dots that are inside of an extension name. For - // example: (foo.bar).baz.(bob) has three parts: - // 1. (foo.bar) - an extension name - // 2. baz - a regular field in foo.bar - // 3. (bob) - an extension field in baz - // Note that the dot in foo.bar will thus not be present in Dots but is - // instead in Parts[0]. - Dots []*RuneNode -} - -// NewOptionNameNode creates a new *OptionNameNode. The dots arg must have a -// length that is one less than the length of parts. The parts arg must not be -// empty. -func NewOptionNameNode(parts []*FieldReferenceNode, dots []*RuneNode) *OptionNameNode { - if len(parts) == 0 { - panic("must have at least one part") - } - if len(dots) != len(parts)-1 { - panic(fmt.Sprintf("%d parts requires %d dots, not %d", len(parts), len(parts)-1, len(dots))) - } - children := make([]Node, 0, len(parts)*2-1) - for i, part := range parts { - if part == nil { - panic(fmt.Sprintf("parts[%d] is nil", i)) - } - if i > 0 { - if dots[i-1] == nil { - panic(fmt.Sprintf("dots[%d] is nil", i-1)) - } - children = append(children, dots[i-1]) - } - children = append(children, part) - } - return &OptionNameNode{ - compositeNode: compositeNode{ - children: children, - }, - Parts: parts, - Dots: dots, - } -} - -// FieldReferenceNode is a reference to a field name. It can indicate a regular -// field (simple unqualified name), an extension field (possibly-qualified name -// that is enclosed either in brackets or parentheses), or an "any" type -// reference (a type URL in the form "server.host/fully.qualified.Name" that is -// enclosed in brackets). -// -// Extension names are used in options to refer to custom options (which are -// actually extensions), in which case the name is enclosed in parentheses "(" -// and ")". They can also be used to refer to extension fields of options. -// -// Extension names are also used in message literals to set extension fields, -// in which case the name is enclosed in square brackets "[" and "]". -// -// "Any" type references can only be used in message literals, and are not -// allowed in option names. They are always enclosed in square brackets. An -// "any" type reference is distinguished from an extension name by the presence -// of a slash, which must be present in an "any" type reference and must be -// absent in an extension name. -// -// Examples: -// -// foobar -// (foo.bar) -// [foo.bar] -// [type.googleapis.com/foo.bar] -type FieldReferenceNode struct { - compositeNode - Open *RuneNode // only present for extension names and "any" type references - - // only present for "any" type references - URLPrefix IdentValueNode - Slash *RuneNode - - Name IdentValueNode - - Close *RuneNode // only present for extension names and "any" type references -} - -// NewFieldReferenceNode creates a new *FieldReferenceNode for a regular field. -// The name arg must not be nil. -func NewFieldReferenceNode(name *IdentNode) *FieldReferenceNode { - if name == nil { - panic("name is nil") - } - children := []Node{name} - return &FieldReferenceNode{ - compositeNode: compositeNode{ - children: children, - }, - Name: name, - } -} - -// NewExtensionFieldReferenceNode creates a new *FieldReferenceNode for an -// extension field. All args must be non-nil. The openSym and closeSym runes -// should be "(" and ")" or "[" and "]". -func NewExtensionFieldReferenceNode(openSym *RuneNode, name IdentValueNode, closeSym *RuneNode) *FieldReferenceNode { - if name == nil { - panic("name is nil") - } - if openSym == nil { - panic("openSym is nil") - } - if closeSym == nil { - panic("closeSym is nil") - } - children := []Node{openSym, name, closeSym} - return &FieldReferenceNode{ - compositeNode: compositeNode{ - children: children, - }, - Open: openSym, - Name: name, - Close: closeSym, - } -} - -// NewAnyTypeReferenceNode creates a new *FieldReferenceNode for an "any" -// type reference. All args must be non-nil. The openSym and closeSym runes -// should be "[" and "]". The slashSym run should be "/". -func NewAnyTypeReferenceNode(openSym *RuneNode, urlPrefix IdentValueNode, slashSym *RuneNode, name IdentValueNode, closeSym *RuneNode) *FieldReferenceNode { - if name == nil { - panic("name is nil") - } - if openSym == nil { - panic("openSym is nil") - } - if closeSym == nil { - panic("closeSym is nil") - } - if urlPrefix == nil { - panic("urlPrefix is nil") - } - if slashSym == nil { - panic("slashSym is nil") - } - children := []Node{openSym, urlPrefix, slashSym, name, closeSym} - return &FieldReferenceNode{ - compositeNode: compositeNode{ - children: children, - }, - Open: openSym, - URLPrefix: urlPrefix, - Slash: slashSym, - Name: name, - Close: closeSym, - } -} - -// IsExtension reports if this is an extension name or not (e.g. enclosed in -// punctuation, such as parentheses or brackets). -func (a *FieldReferenceNode) IsExtension() bool { - return a.Open != nil && a.Slash == nil -} - -// IsAnyTypeReference reports if this is an Any type reference. -func (a *FieldReferenceNode) IsAnyTypeReference() bool { - return a.Slash != nil -} - -func (a *FieldReferenceNode) Value() string { - if a.Open != nil { - if a.Slash != nil { - return string(a.Open.Rune) + string(a.URLPrefix.AsIdentifier()) + string(a.Slash.Rune) + string(a.Name.AsIdentifier()) + string(a.Close.Rune) - } - return string(a.Open.Rune) + string(a.Name.AsIdentifier()) + string(a.Close.Rune) - } - return string(a.Name.AsIdentifier()) -} - -// CompactOptionsNode represents a compact options declaration, as used with -// fields, enum values, and extension ranges. Example: -// -// [deprecated = true, json_name = "foo_bar"] -type CompactOptionsNode struct { - compositeNode - OpenBracket *RuneNode - Options []*OptionNode - // Commas represent the separating ',' characters between options. The - // length of this slice must be exactly len(Options)-1, with each item - // in Options having a corresponding item in this slice *except the last* - // (since a trailing comma is not allowed). - Commas []*RuneNode - CloseBracket *RuneNode -} - -// NewCompactOptionsNode creates a *CompactOptionsNode. All args must be -// non-nil. The commas arg must have a length that is one less than the -// length of opts. The opts arg must not be empty. -func NewCompactOptionsNode(openBracket *RuneNode, opts []*OptionNode, commas []*RuneNode, closeBracket *RuneNode) *CompactOptionsNode { - if openBracket == nil { - panic("openBracket is nil") - } - if closeBracket == nil { - panic("closeBracket is nil") - } - if len(opts) == 0 { - panic("must have at least one part") - } - if len(commas) != len(opts)-1 { - panic(fmt.Sprintf("%d opts requires %d commas, not %d", len(opts), len(opts)-1, len(commas))) - } - children := make([]Node, 0, len(opts)*2+1) - children = append(children, openBracket) - for i, opt := range opts { - if i > 0 { - if commas[i-1] == nil { - panic(fmt.Sprintf("commas[%d] is nil", i-1)) - } - children = append(children, commas[i-1]) - } - if opt == nil { - panic(fmt.Sprintf("opts[%d] is nil", i)) - } - children = append(children, opt) - } - children = append(children, closeBracket) - - return &CompactOptionsNode{ - compositeNode: compositeNode{ - children: children, - }, - OpenBracket: openBracket, - Options: opts, - Commas: commas, - CloseBracket: closeBracket, - } -} - -func (e *CompactOptionsNode) GetElements() []*OptionNode { - if e == nil { - return nil - } - return e.Options -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/ranges.go b/vendor/github.com/bufbuild/protocompile/ast/ranges.go deleted file mode 100644 index 453e5a0696..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/ranges.go +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// ExtensionRangeNode represents an extension range declaration in an extendable -// message. Example: -// -// extensions 100 to max; -type ExtensionRangeNode struct { - compositeNode - Keyword *KeywordNode - Ranges []*RangeNode - // Commas represent the separating ',' characters between ranges. The - // length of this slice must be exactly len(Ranges)-1, each item in Ranges - // having a corresponding item in this slice *except the last* (since a - // trailing comma is not allowed). - Commas []*RuneNode - Options *CompactOptionsNode - Semicolon *RuneNode -} - -func (e *ExtensionRangeNode) msgElement() {} - -// NewExtensionRangeNode creates a new *ExtensionRangeNode. All args must be -// non-nil except opts, which may be nil. -// - keyword: The token corresponding to the "extends" keyword. -// - ranges: One or more range expressions. -// - commas: Tokens that represent the "," runes that delimit the range expressions. -// The length of commas must be one less than the length of ranges. -// - opts: The node corresponding to options that apply to each of the ranges. -// - semicolon The token corresponding to the ";" rune that ends the declaration. -func NewExtensionRangeNode(keyword *KeywordNode, ranges []*RangeNode, commas []*RuneNode, opts *CompactOptionsNode, semicolon *RuneNode) *ExtensionRangeNode { - if keyword == nil { - panic("keyword is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - if len(ranges) == 0 { - panic("must have at least one range") - } - if len(commas) != len(ranges)-1 { - panic(fmt.Sprintf("%d ranges requires %d commas, not %d", len(ranges), len(ranges)-1, len(commas))) - } - numChildren := len(ranges)*2 + 1 - if opts != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - children = append(children, keyword) - for i, rng := range ranges { - if i > 0 { - if commas[i-1] == nil { - panic(fmt.Sprintf("commas[%d] is nil", i-1)) - } - children = append(children, commas[i-1]) - } - if rng == nil { - panic(fmt.Sprintf("ranges[%d] is nil", i)) - } - children = append(children, rng) - } - if opts != nil { - children = append(children, opts) - } - children = append(children, semicolon) - return &ExtensionRangeNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Ranges: ranges, - Commas: commas, - Options: opts, - Semicolon: semicolon, - } -} - -// RangeDeclNode is a placeholder interface for AST nodes that represent -// numeric values. This allows NoSourceNode to be used in place of *RangeNode -// for some usages. -type RangeDeclNode interface { - Node - RangeStart() Node - RangeEnd() Node -} - -var _ RangeDeclNode = (*RangeNode)(nil) -var _ RangeDeclNode = NoSourceNode{} - -// RangeNode represents a range expression, used in both extension ranges and -// reserved ranges. Example: -// -// 1000 to max -type RangeNode struct { - compositeNode - StartVal IntValueNode - // if To is non-nil, then exactly one of EndVal or Max must also be non-nil - To *KeywordNode - // EndVal and Max are mutually exclusive - EndVal IntValueNode - Max *KeywordNode -} - -// NewRangeNode creates a new *RangeNode. The start argument must be non-nil. -// The to argument represents the "to" keyword. If present (i.e. if it is non-nil), -// then so must be exactly one of end or max. If max is non-nil, it indicates a -// "100 to max" style range. But if end is non-nil, the end of the range is a -// literal, such as "100 to 200". -func NewRangeNode(start IntValueNode, to *KeywordNode, end IntValueNode, max *KeywordNode) *RangeNode { - if start == nil { - panic("start is nil") - } - numChildren := 1 - if to != nil { - if end == nil && max == nil { - panic("to is not nil, but end and max both are") - } - if end != nil && max != nil { - panic("end and max cannot be both non-nil") - } - numChildren = 3 - } else { - if end != nil { - panic("to is nil, but end is not") - } - if max != nil { - panic("to is nil, but max is not") - } - } - children := make([]Node, 0, numChildren) - children = append(children, start) - if to != nil { - children = append(children, to) - if end != nil { - children = append(children, end) - } else { - children = append(children, max) - } - } - return &RangeNode{ - compositeNode: compositeNode{ - children: children, - }, - StartVal: start, - To: to, - EndVal: end, - Max: max, - } -} - -func (n *RangeNode) RangeStart() Node { - return n.StartVal -} - -func (n *RangeNode) RangeEnd() Node { - if n.Max != nil { - return n.Max - } - if n.EndVal != nil { - return n.EndVal - } - return n.StartVal -} - -func (n *RangeNode) StartValue() interface{} { - return n.StartVal.Value() -} - -func (n *RangeNode) StartValueAsInt32(min, max int32) (int32, bool) { - return AsInt32(n.StartVal, min, max) -} - -func (n *RangeNode) EndValue() interface{} { - if n.EndVal == nil { - return nil - } - return n.EndVal.Value() -} - -func (n *RangeNode) EndValueAsInt32(min, max int32) (int32, bool) { - if n.Max != nil { - return max, true - } - if n.EndVal == nil { - return n.StartValueAsInt32(min, max) - } - return AsInt32(n.EndVal, min, max) -} - -// ReservedNode represents reserved declaration, which can be used to reserve -// either names or numbers. Examples: -// -// reserved 1, 10-12, 15; -// reserved "foo", "bar", "baz"; -type ReservedNode struct { - compositeNode - Keyword *KeywordNode - // If non-empty, this node represents reserved ranges and Names will be empty. - Ranges []*RangeNode - // If non-empty, this node represents reserved names and Ranges will be empty. - Names []StringValueNode - // Commas represent the separating ',' characters between options. The - // length of this slice must be exactly len(Ranges)-1 or len(Names)-1, depending - // on whether this node represents reserved ranges or reserved names. Each item - // in Ranges or Names has a corresponding item in this slice *except the last* - // (since a trailing comma is not allowed). - Commas []*RuneNode - Semicolon *RuneNode -} - -func (*ReservedNode) msgElement() {} -func (*ReservedNode) enumElement() {} - -// NewReservedRangesNode creates a new *ReservedNode that represents reserved -// numeric ranges. All args must be non-nil. -// - keyword: The token corresponding to the "reserved" keyword. -// - ranges: One or more range expressions. -// - commas: Tokens that represent the "," runes that delimit the range expressions. -// The length of commas must be one less than the length of ranges. -// - semicolon The token corresponding to the ";" rune that ends the declaration. -func NewReservedRangesNode(keyword *KeywordNode, ranges []*RangeNode, commas []*RuneNode, semicolon *RuneNode) *ReservedNode { - if keyword == nil { - panic("keyword is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - if len(ranges) == 0 { - panic("must have at least one range") - } - if len(commas) != len(ranges)-1 { - panic(fmt.Sprintf("%d ranges requires %d commas, not %d", len(ranges), len(ranges)-1, len(commas))) - } - children := make([]Node, 0, len(ranges)*2+1) - children = append(children, keyword) - for i, rng := range ranges { - if i > 0 { - if commas[i-1] == nil { - panic(fmt.Sprintf("commas[%d] is nil", i-1)) - } - children = append(children, commas[i-1]) - } - if rng == nil { - panic(fmt.Sprintf("ranges[%d] is nil", i)) - } - children = append(children, rng) - } - children = append(children, semicolon) - return &ReservedNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Ranges: ranges, - Commas: commas, - Semicolon: semicolon, - } -} - -// NewReservedNamesNode creates a new *ReservedNode that represents reserved -// names. All args must be non-nil. -// - keyword: The token corresponding to the "reserved" keyword. -// - names: One or more names. -// - commas: Tokens that represent the "," runes that delimit the names. -// The length of commas must be one less than the length of names. -// - semicolon The token corresponding to the ";" rune that ends the declaration. -func NewReservedNamesNode(keyword *KeywordNode, names []StringValueNode, commas []*RuneNode, semicolon *RuneNode) *ReservedNode { - if keyword == nil { - panic("keyword is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - if len(names) == 0 { - panic("must have at least one name") - } - if len(commas) != len(names)-1 { - panic(fmt.Sprintf("%d names requires %d commas, not %d", len(names), len(names)-1, len(commas))) - } - children := make([]Node, 0, len(names)*2+1) - children = append(children, keyword) - for i, name := range names { - if i > 0 { - if commas[i-1] == nil { - panic(fmt.Sprintf("commas[%d] is nil", i-1)) - } - children = append(children, commas[i-1]) - } - if name == nil { - panic(fmt.Sprintf("names[%d] is nil", i)) - } - children = append(children, name) - } - children = append(children, semicolon) - return &ReservedNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Names: names, - Commas: commas, - Semicolon: semicolon, - } -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/service.go b/vendor/github.com/bufbuild/protocompile/ast/service.go deleted file mode 100644 index c1807488c0..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/service.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// ServiceNode represents a service declaration. Example: -// -// service Foo { -// rpc Bar (Baz) returns (Bob); -// rpc Frobnitz (stream Parts) returns (Gyzmeaux); -// } -type ServiceNode struct { - compositeNode - Keyword *KeywordNode - Name *IdentNode - OpenBrace *RuneNode - Decls []ServiceElement - CloseBrace *RuneNode -} - -func (*ServiceNode) fileElement() {} - -// NewServiceNode creates a new *ServiceNode. All arguments must be non-nil. -// - keyword: The token corresponding to the "service" keyword. -// - name: The token corresponding to the service's name. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the service body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewServiceNode(keyword *KeywordNode, name *IdentNode, openBrace *RuneNode, decls []ServiceElement, closeBrace *RuneNode) *ServiceNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 4+len(decls)) - children = append(children, keyword, name, openBrace) - for _, decl := range decls { - switch decl := decl.(type) { - case *OptionNode, *RPCNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid ServiceElement type: %T", decl)) - } - children = append(children, decl) - } - children = append(children, closeBrace) - - return &ServiceNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - OpenBrace: openBrace, - Decls: decls, - CloseBrace: closeBrace, - } -} - -// ServiceElement is an interface implemented by all AST nodes that can -// appear in the body of a service declaration. -type ServiceElement interface { - Node - serviceElement() -} - -var _ ServiceElement = (*OptionNode)(nil) -var _ ServiceElement = (*RPCNode)(nil) -var _ ServiceElement = (*EmptyDeclNode)(nil) - -// RPCDeclNode is a placeholder interface for AST nodes that represent RPC -// declarations. This allows NoSourceNode to be used in place of *RPCNode -// for some usages. -type RPCDeclNode interface { - Node - GetName() Node - GetInputType() Node - GetOutputType() Node -} - -var _ RPCDeclNode = (*RPCNode)(nil) -var _ RPCDeclNode = NoSourceNode{} - -// RPCNode represents an RPC declaration. Example: -// -// rpc Foo (Bar) returns (Baz); -type RPCNode struct { - compositeNode - Keyword *KeywordNode - Name *IdentNode - Input *RPCTypeNode - Returns *KeywordNode - Output *RPCTypeNode - Semicolon *RuneNode - OpenBrace *RuneNode - Decls []RPCElement - CloseBrace *RuneNode -} - -func (n *RPCNode) serviceElement() {} - -// NewRPCNode creates a new *RPCNode with no body. All arguments must be non-nil. -// - keyword: The token corresponding to the "rpc" keyword. -// - name: The token corresponding to the RPC's name. -// - input: The token corresponding to the RPC input message type. -// - returns: The token corresponding to the "returns" keyword that precedes the output type. -// - output: The token corresponding to the RPC output message type. -// - semicolon: The token corresponding to the ";" rune that ends the declaration. -func NewRPCNode(keyword *KeywordNode, name *IdentNode, input *RPCTypeNode, returns *KeywordNode, output *RPCTypeNode, semicolon *RuneNode) *RPCNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if input == nil { - panic("input is nil") - } - if returns == nil { - panic("returns is nil") - } - if output == nil { - panic("output is nil") - } - if semicolon == nil { - panic("semicolon is nil") - } - children := []Node{keyword, name, input, returns, output, semicolon} - return &RPCNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - Input: input, - Returns: returns, - Output: output, - Semicolon: semicolon, - } -} - -// NewRPCNodeWithBody creates a new *RPCNode that includes a body (and possibly -// options). All arguments must be non-nil. -// - keyword: The token corresponding to the "rpc" keyword. -// - name: The token corresponding to the RPC's name. -// - input: The token corresponding to the RPC input message type. -// - returns: The token corresponding to the "returns" keyword that precedes the output type. -// - output: The token corresponding to the RPC output message type. -// - openBrace: The token corresponding to the "{" rune that starts the body. -// - decls: All declarations inside the RPC body. -// - closeBrace: The token corresponding to the "}" rune that ends the body. -func NewRPCNodeWithBody(keyword *KeywordNode, name *IdentNode, input *RPCTypeNode, returns *KeywordNode, output *RPCTypeNode, openBrace *RuneNode, decls []RPCElement, closeBrace *RuneNode) *RPCNode { - if keyword == nil { - panic("keyword is nil") - } - if name == nil { - panic("name is nil") - } - if input == nil { - panic("input is nil") - } - if returns == nil { - panic("returns is nil") - } - if output == nil { - panic("output is nil") - } - if openBrace == nil { - panic("openBrace is nil") - } - if closeBrace == nil { - panic("closeBrace is nil") - } - children := make([]Node, 0, 7+len(decls)) - children = append(children, keyword, name, input, returns, output, openBrace) - for _, decl := range decls { - switch decl := decl.(type) { - case *OptionNode, *EmptyDeclNode: - default: - panic(fmt.Sprintf("invalid RPCElement type: %T", decl)) - } - children = append(children, decl) - } - children = append(children, closeBrace) - - return &RPCNode{ - compositeNode: compositeNode{ - children: children, - }, - Keyword: keyword, - Name: name, - Input: input, - Returns: returns, - Output: output, - OpenBrace: openBrace, - Decls: decls, - CloseBrace: closeBrace, - } -} - -func (n *RPCNode) GetName() Node { - return n.Name -} - -func (n *RPCNode) GetInputType() Node { - return n.Input.MessageType -} - -func (n *RPCNode) GetOutputType() Node { - return n.Output.MessageType -} - -// RPCElement is an interface implemented by all AST nodes that can -// appear in the body of an rpc declaration (aka method). -type RPCElement interface { - Node - methodElement() -} - -var _ RPCElement = (*OptionNode)(nil) -var _ RPCElement = (*EmptyDeclNode)(nil) - -// RPCTypeNode represents the declaration of a request or response type for an -// RPC. Example: -// -// (stream foo.Bar) -type RPCTypeNode struct { - compositeNode - OpenParen *RuneNode - Stream *KeywordNode - MessageType IdentValueNode - CloseParen *RuneNode -} - -// NewRPCTypeNode creates a new *RPCTypeNode. All arguments must be non-nil -// except stream, which may be nil. -// - openParen: The token corresponding to the "(" rune that starts the declaration. -// - stream: The token corresponding to the "stream" keyword or nil if not present. -// - msgType: The token corresponding to the message type's name. -// - closeParen: The token corresponding to the ")" rune that ends the declaration. -func NewRPCTypeNode(openParen *RuneNode, stream *KeywordNode, msgType IdentValueNode, closeParen *RuneNode) *RPCTypeNode { - if openParen == nil { - panic("openParen is nil") - } - if msgType == nil { - panic("msgType is nil") - } - if closeParen == nil { - panic("closeParen is nil") - } - var children []Node - if stream != nil { - children = []Node{openParen, stream, msgType, closeParen} - } else { - children = []Node{openParen, msgType, closeParen} - } - - return &RPCTypeNode{ - compositeNode: compositeNode{ - children: children, - }, - OpenParen: openParen, - Stream: stream, - MessageType: msgType, - CloseParen: closeParen, - } -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/values.go b/vendor/github.com/bufbuild/protocompile/ast/values.go deleted file mode 100644 index b9f050aa5d..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/values.go +++ /dev/null @@ -1,558 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import ( - "fmt" - "math" - "strings" -) - -// ValueNode is an AST node that represents a literal value. -// -// It also includes references (e.g. IdentifierValueNode), which can be -// used as values in some contexts, such as describing the default value -// for a field, which can refer to an enum value. -// -// This also allows NoSourceNode to be used in place of a real value node -// for some usages. -type ValueNode interface { - Node - // Value returns a Go representation of the value. For scalars, this - // will be a string, int64, uint64, float64, or bool. This could also - // be an Identifier (e.g. IdentValueNodes). It can also be a composite - // literal: - // * For array literals, the type returned will be []ValueNode - // * For message literals, the type returned will be []*MessageFieldNode - Value() interface{} -} - -var _ ValueNode = (*IdentNode)(nil) -var _ ValueNode = (*CompoundIdentNode)(nil) -var _ ValueNode = (*StringLiteralNode)(nil) -var _ ValueNode = (*CompoundStringLiteralNode)(nil) -var _ ValueNode = (*UintLiteralNode)(nil) -var _ ValueNode = (*PositiveUintLiteralNode)(nil) -var _ ValueNode = (*NegativeIntLiteralNode)(nil) -var _ ValueNode = (*FloatLiteralNode)(nil) -var _ ValueNode = (*SpecialFloatLiteralNode)(nil) -var _ ValueNode = (*SignedFloatLiteralNode)(nil) -var _ ValueNode = (*ArrayLiteralNode)(nil) -var _ ValueNode = (*MessageLiteralNode)(nil) -var _ ValueNode = NoSourceNode{} - -// StringValueNode is an AST node that represents a string literal. -// Such a node can be a single literal (*StringLiteralNode) or a -// concatenation of multiple literals (*CompoundStringLiteralNode). -type StringValueNode interface { - ValueNode - AsString() string -} - -var _ StringValueNode = (*StringLiteralNode)(nil) -var _ StringValueNode = (*CompoundStringLiteralNode)(nil) - -// StringLiteralNode represents a simple string literal. Example: -// -// "proto2" -type StringLiteralNode struct { - terminalNode - // Val is the actual string value that the literal indicates. - Val string -} - -// NewStringLiteralNode creates a new *StringLiteralNode with the given val. -func NewStringLiteralNode(val string, tok Token) *StringLiteralNode { - return &StringLiteralNode{ - terminalNode: tok.asTerminalNode(), - Val: val, - } -} - -func (n *StringLiteralNode) Value() interface{} { - return n.AsString() -} - -func (n *StringLiteralNode) AsString() string { - return n.Val -} - -// CompoundStringLiteralNode represents a compound string literal, which is -// the concatenaton of adjacent string literals. Example: -// -// "this " "is" " all one " "string" -type CompoundStringLiteralNode struct { - compositeNode - Val string -} - -// NewCompoundLiteralStringNode creates a new *CompoundStringLiteralNode that -// consists of the given string components. The components argument may not be -// empty. -func NewCompoundLiteralStringNode(components ...*StringLiteralNode) *CompoundStringLiteralNode { - if len(components) == 0 { - panic("must have at least one component") - } - children := make([]Node, len(components)) - var b strings.Builder - for i, comp := range components { - children[i] = comp - b.WriteString(comp.Val) - } - return &CompoundStringLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - Val: b.String(), - } -} - -func (n *CompoundStringLiteralNode) Value() interface{} { - return n.AsString() -} - -func (n *CompoundStringLiteralNode) AsString() string { - return n.Val -} - -// IntValueNode is an AST node that represents an integer literal. If -// an integer literal is too large for an int64 (or uint64 for -// positive literals), it is represented instead by a FloatValueNode. -type IntValueNode interface { - ValueNode - AsInt64() (int64, bool) - AsUint64() (uint64, bool) -} - -// AsInt32 range checks the given int value and returns its value is -// in the range or 0, false if it is outside the range. -func AsInt32(n IntValueNode, min, max int32) (int32, bool) { - i, ok := n.AsInt64() - if !ok { - return 0, false - } - if i < int64(min) || i > int64(max) { - return 0, false - } - return int32(i), true -} - -var _ IntValueNode = (*UintLiteralNode)(nil) -var _ IntValueNode = (*PositiveUintLiteralNode)(nil) -var _ IntValueNode = (*NegativeIntLiteralNode)(nil) - -// UintLiteralNode represents a simple integer literal with no sign character. -type UintLiteralNode struct { - terminalNode - // Val is the numeric value indicated by the literal - Val uint64 -} - -// NewUintLiteralNode creates a new *UintLiteralNode with the given val. -func NewUintLiteralNode(val uint64, tok Token) *UintLiteralNode { - return &UintLiteralNode{ - terminalNode: tok.asTerminalNode(), - Val: val, - } -} - -func (n *UintLiteralNode) Value() interface{} { - return n.Val -} - -func (n *UintLiteralNode) AsInt64() (int64, bool) { - if n.Val > math.MaxInt64 { - return 0, false - } - return int64(n.Val), true -} - -func (n *UintLiteralNode) AsUint64() (uint64, bool) { - return n.Val, true -} - -func (n *UintLiteralNode) AsFloat() float64 { - return float64(n.Val) -} - -// PositiveUintLiteralNode represents an integer literal with a positive (+) sign. -type PositiveUintLiteralNode struct { - compositeNode - Plus *RuneNode - Uint *UintLiteralNode - Val uint64 -} - -// NewPositiveUintLiteralNode creates a new *PositiveUintLiteralNode. Both -// arguments must be non-nil. -func NewPositiveUintLiteralNode(sign *RuneNode, i *UintLiteralNode) *PositiveUintLiteralNode { - if sign == nil { - panic("sign is nil") - } - if i == nil { - panic("i is nil") - } - children := []Node{sign, i} - return &PositiveUintLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - Plus: sign, - Uint: i, - Val: i.Val, - } -} - -func (n *PositiveUintLiteralNode) Value() interface{} { - return n.Val -} - -func (n *PositiveUintLiteralNode) AsInt64() (int64, bool) { - if n.Val > math.MaxInt64 { - return 0, false - } - return int64(n.Val), true -} - -func (n *PositiveUintLiteralNode) AsUint64() (uint64, bool) { - return n.Val, true -} - -// NegativeIntLiteralNode represents an integer literal with a negative (-) sign. -type NegativeIntLiteralNode struct { - compositeNode - Minus *RuneNode - Uint *UintLiteralNode - Val int64 -} - -// NewNegativeIntLiteralNode creates a new *NegativeIntLiteralNode. Both -// arguments must be non-nil. -func NewNegativeIntLiteralNode(sign *RuneNode, i *UintLiteralNode) *NegativeIntLiteralNode { - if sign == nil { - panic("sign is nil") - } - if i == nil { - panic("i is nil") - } - children := []Node{sign, i} - return &NegativeIntLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - Minus: sign, - Uint: i, - Val: -int64(i.Val), - } -} - -func (n *NegativeIntLiteralNode) Value() interface{} { - return n.Val -} - -func (n *NegativeIntLiteralNode) AsInt64() (int64, bool) { - return n.Val, true -} - -func (n *NegativeIntLiteralNode) AsUint64() (uint64, bool) { - if n.Val < 0 { - return 0, false - } - return uint64(n.Val), true -} - -// FloatValueNode is an AST node that represents a numeric literal with -// a floating point, in scientific notation, or too large to fit in an -// int64 or uint64. -type FloatValueNode interface { - ValueNode - AsFloat() float64 -} - -var _ FloatValueNode = (*FloatLiteralNode)(nil) -var _ FloatValueNode = (*SpecialFloatLiteralNode)(nil) -var _ FloatValueNode = (*UintLiteralNode)(nil) - -// FloatLiteralNode represents a floating point numeric literal. -type FloatLiteralNode struct { - terminalNode - // Val is the numeric value indicated by the literal - Val float64 -} - -// NewFloatLiteralNode creates a new *FloatLiteralNode with the given val. -func NewFloatLiteralNode(val float64, tok Token) *FloatLiteralNode { - return &FloatLiteralNode{ - terminalNode: tok.asTerminalNode(), - Val: val, - } -} - -func (n *FloatLiteralNode) Value() interface{} { - return n.AsFloat() -} - -func (n *FloatLiteralNode) AsFloat() float64 { - return n.Val -} - -// SpecialFloatLiteralNode represents a special floating point numeric literal -// for "inf" and "nan" values. -type SpecialFloatLiteralNode struct { - *KeywordNode - Val float64 -} - -// NewSpecialFloatLiteralNode returns a new *SpecialFloatLiteralNode for the -// given keyword, which must be "inf" or "nan". -func NewSpecialFloatLiteralNode(name *KeywordNode) *SpecialFloatLiteralNode { - var f float64 - if name.Val == "inf" { - f = math.Inf(1) - } else { - f = math.NaN() - } - return &SpecialFloatLiteralNode{ - KeywordNode: name, - Val: f, - } -} - -func (n *SpecialFloatLiteralNode) Value() interface{} { - return n.AsFloat() -} - -func (n *SpecialFloatLiteralNode) AsFloat() float64 { - return n.Val -} - -// SignedFloatLiteralNode represents a signed floating point number. -type SignedFloatLiteralNode struct { - compositeNode - Sign *RuneNode - Float FloatValueNode - Val float64 -} - -// NewSignedFloatLiteralNode creates a new *SignedFloatLiteralNode. Both -// arguments must be non-nil. -func NewSignedFloatLiteralNode(sign *RuneNode, f FloatValueNode) *SignedFloatLiteralNode { - if sign == nil { - panic("sign is nil") - } - if f == nil { - panic("f is nil") - } - children := []Node{sign, f} - val := f.AsFloat() - if sign.Rune == '-' { - val = -val - } - return &SignedFloatLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - Sign: sign, - Float: f, - Val: val, - } -} - -func (n *SignedFloatLiteralNode) Value() interface{} { - return n.Val -} - -func (n *SignedFloatLiteralNode) AsFloat() float64 { - return n.Val -} - -// ArrayLiteralNode represents an array literal, which is only allowed inside of -// a MessageLiteralNode, to indicate values for a repeated field. Example: -// -// ["foo", "bar", "baz"] -type ArrayLiteralNode struct { - compositeNode - OpenBracket *RuneNode - Elements []ValueNode - // Commas represent the separating ',' characters between elements. The - // length of this slice must be exactly len(Elements)-1, with each item - // in Elements having a corresponding item in this slice *except the last* - // (since a trailing comma is not allowed). - Commas []*RuneNode - CloseBracket *RuneNode -} - -// NewArrayLiteralNode creates a new *ArrayLiteralNode. The openBracket and -// closeBracket args must be non-nil and represent the "[" and "]" runes that -// surround the array values. The given commas arg must have a length that is -// one less than the length of the vals arg. However, vals may be empty, in -// which case commas must also be empty. -func NewArrayLiteralNode(openBracket *RuneNode, vals []ValueNode, commas []*RuneNode, closeBracket *RuneNode) *ArrayLiteralNode { - if openBracket == nil { - panic("openBracket is nil") - } - if closeBracket == nil { - panic("closeBracket is nil") - } - if len(vals) == 0 && len(commas) != 0 { - panic("vals is empty but commas is not") - } - if len(vals) > 0 && len(commas) != len(vals)-1 { - panic(fmt.Sprintf("%d vals requires %d commas, not %d", len(vals), len(vals)-1, len(commas))) - } - children := make([]Node, 0, len(vals)*2+1) - children = append(children, openBracket) - for i, val := range vals { - if i > 0 { - if commas[i-1] == nil { - panic(fmt.Sprintf("commas[%d] is nil", i-1)) - } - children = append(children, commas[i-1]) - } - if val == nil { - panic(fmt.Sprintf("vals[%d] is nil", i)) - } - children = append(children, val) - } - children = append(children, closeBracket) - - return &ArrayLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - OpenBracket: openBracket, - Elements: vals, - Commas: commas, - CloseBracket: closeBracket, - } -} - -func (n *ArrayLiteralNode) Value() interface{} { - return n.Elements -} - -// MessageLiteralNode represents a message literal, which is compatible with the -// protobuf text format and can be used for custom options with message types. -// Example: -// -// { foo:1 foo:2 foo:3 bar: } -type MessageLiteralNode struct { - compositeNode - Open *RuneNode // should be '{' or '<' - Elements []*MessageFieldNode - // Separator characters between elements, which can be either ',' - // or ';' if present. This slice must be exactly len(Elements) in - // length, with each item in Elements having one corresponding item - // in Seps. Separators in message literals are optional, so a given - // item in this slice may be nil to indicate absence of a separator. - Seps []*RuneNode - Close *RuneNode // should be '}' or '>', depending on Open -} - -// NewMessageLiteralNode creates a new *MessageLiteralNode. The openSym and -// closeSym runes must not be nil and should be "{" and "}" or "<" and ">". -// -// Unlike separators (dots and commas) used for other AST nodes that represent -// a list of elements, the seps arg must be the SAME length as vals, and it may -// contain nil values to indicate absence of a separator (in fact, it could be -// all nils). -func NewMessageLiteralNode(openSym *RuneNode, vals []*MessageFieldNode, seps []*RuneNode, closeSym *RuneNode) *MessageLiteralNode { - if openSym == nil { - panic("openSym is nil") - } - if closeSym == nil { - panic("closeSym is nil") - } - if len(seps) != len(vals) { - panic(fmt.Sprintf("%d vals requires %d commas, not %d", len(vals), len(vals), len(seps))) - } - numChildren := len(vals) + 2 - for _, sep := range seps { - if sep != nil { - numChildren++ - } - } - children := make([]Node, 0, numChildren) - children = append(children, openSym) - for i, val := range vals { - if val == nil { - panic(fmt.Sprintf("vals[%d] is nil", i)) - } - children = append(children, val) - if seps[i] != nil { - children = append(children, seps[i]) - } - } - children = append(children, closeSym) - - return &MessageLiteralNode{ - compositeNode: compositeNode{ - children: children, - }, - Open: openSym, - Elements: vals, - Seps: seps, - Close: closeSym, - } -} - -func (n *MessageLiteralNode) Value() interface{} { - return n.Elements -} - -// MessageFieldNode represents a single field (name and value) inside of a -// message literal. Example: -// -// foo:"bar" -type MessageFieldNode struct { - compositeNode - Name *FieldReferenceNode - // Sep represents the ':' separator between the name and value. If - // the value is a message or list literal (and thus starts with '<', - // '{', or '['), then the separator may be omitted and this field may - // be nil. - Sep *RuneNode - Val ValueNode -} - -// NewMessageFieldNode creates a new *MessageFieldNode. All args except sep -// must be non-nil. -func NewMessageFieldNode(name *FieldReferenceNode, sep *RuneNode, val ValueNode) *MessageFieldNode { - if name == nil { - panic("name is nil") - } - if val == nil { - panic("val is nil") - } - numChildren := 2 - if sep != nil { - numChildren++ - } - children := make([]Node, 0, numChildren) - children = append(children, name) - if sep != nil { - children = append(children, sep) - } - children = append(children, val) - - return &MessageFieldNode{ - compositeNode: compositeNode{ - children: children, - }, - Name: name, - Sep: sep, - Val: val, - } -} diff --git a/vendor/github.com/bufbuild/protocompile/ast/walk.go b/vendor/github.com/bufbuild/protocompile/ast/walk.go deleted file mode 100644 index a969ed46fb..0000000000 --- a/vendor/github.com/bufbuild/protocompile/ast/walk.go +++ /dev/null @@ -1,910 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ast - -import "fmt" - -// Walk conducts a walk of the AST rooted at the given root using the -// given visitor. It performs a "pre-order traversal", visiting a -// given AST node before it visits that node's descendants. -// -// If a visitor returns an error while walking the tree, the entire -// operation is aborted and that error is returned. -func Walk(root Node, v Visitor, opts ...WalkOption) error { - var wOpts walkOptions - for _, opt := range opts { - opt(&wOpts) - } - return walk(root, v, wOpts) -} - -// WalkOption represents an option used with the Walk function. These -// allow optional before and after hooks to be invoked as each node in -// the tree is visited. -type WalkOption func(*walkOptions) - -type walkOptions struct { - before, after func(Node) error -} - -// WithBefore returns a WalkOption that will cause the given function to be -// invoked before a node is visited during a walk operation. If this hook -// returns an error, the node is not visited and the walk operation is aborted. -func WithBefore(fn func(Node) error) WalkOption { - return func(options *walkOptions) { - options.before = fn - } -} - -// WithAfter returns a WalkOption that will cause the given function to be -// invoked after a node (as well as any descendants) is visited during a walk -// operation. If this hook returns an error, the node is not visited and the -// walk operation is aborted. -// -// If the walk is aborted due to some other visitor or before hook returning an -// error, the after hook is still called for all nodes that have been visited. -// However, the walk operation fails with the first error it encountered, so any -// error returned from an after hook is effectively ignored. -func WithAfter(fn func(Node) error) WalkOption { - return func(options *walkOptions) { - options.after = fn - } -} - -func walk(root Node, v Visitor, opts walkOptions) (err error) { - if opts.before != nil { - if err := opts.before(root); err != nil { - return err - } - } - if opts.after != nil { - defer func() { - if afterErr := opts.after(root); afterErr != nil { - // if another call already returned an error then we - // have to ignore the error from the after hook - if err == nil { - err = afterErr - } - } - }() - } - - if err := Visit(root, v); err != nil { - return err - } - - if comp, ok := root.(CompositeNode); ok { - for _, child := range comp.Children() { - if err := walk(child, v, opts); err != nil { - return err - } - } - } - return nil -} - -// Visit implements the double-dispatch idiom and visits the given node by -// calling the appropriate method of the given visitor. -func Visit(n Node, v Visitor) error { - switch n := n.(type) { - case *FileNode: - return v.VisitFileNode(n) - case *SyntaxNode: - return v.VisitSyntaxNode(n) - case *PackageNode: - return v.VisitPackageNode(n) - case *ImportNode: - return v.VisitImportNode(n) - case *OptionNode: - return v.VisitOptionNode(n) - case *OptionNameNode: - return v.VisitOptionNameNode(n) - case *FieldReferenceNode: - return v.VisitFieldReferenceNode(n) - case *CompactOptionsNode: - return v.VisitCompactOptionsNode(n) - case *MessageNode: - return v.VisitMessageNode(n) - case *ExtendNode: - return v.VisitExtendNode(n) - case *ExtensionRangeNode: - return v.VisitExtensionRangeNode(n) - case *ReservedNode: - return v.VisitReservedNode(n) - case *RangeNode: - return v.VisitRangeNode(n) - case *FieldNode: - return v.VisitFieldNode(n) - case *GroupNode: - return v.VisitGroupNode(n) - case *MapFieldNode: - return v.VisitMapFieldNode(n) - case *MapTypeNode: - return v.VisitMapTypeNode(n) - case *OneOfNode: - return v.VisitOneOfNode(n) - case *EnumNode: - return v.VisitEnumNode(n) - case *EnumValueNode: - return v.VisitEnumValueNode(n) - case *ServiceNode: - return v.VisitServiceNode(n) - case *RPCNode: - return v.VisitRPCNode(n) - case *RPCTypeNode: - return v.VisitRPCTypeNode(n) - case *IdentNode: - return v.VisitIdentNode(n) - case *CompoundIdentNode: - return v.VisitCompoundIdentNode(n) - case *StringLiteralNode: - return v.VisitStringLiteralNode(n) - case *CompoundStringLiteralNode: - return v.VisitCompoundStringLiteralNode(n) - case *UintLiteralNode: - return v.VisitUintLiteralNode(n) - case *PositiveUintLiteralNode: - return v.VisitPositiveUintLiteralNode(n) - case *NegativeIntLiteralNode: - return v.VisitNegativeIntLiteralNode(n) - case *FloatLiteralNode: - return v.VisitFloatLiteralNode(n) - case *SpecialFloatLiteralNode: - return v.VisitSpecialFloatLiteralNode(n) - case *SignedFloatLiteralNode: - return v.VisitSignedFloatLiteralNode(n) - case *ArrayLiteralNode: - return v.VisitArrayLiteralNode(n) - case *MessageLiteralNode: - return v.VisitMessageLiteralNode(n) - case *MessageFieldNode: - return v.VisitMessageFieldNode(n) - case *KeywordNode: - return v.VisitKeywordNode(n) - case *RuneNode: - return v.VisitRuneNode(n) - case *EmptyDeclNode: - return v.VisitEmptyDeclNode(n) - default: - panic(fmt.Sprintf("unexpected type of node: %T", n)) - } -} - -// AncestorTracker is used to track the path of nodes during a walk operation. -// By passing AsWalkOptions to a call to Walk, a visitor can inspect the path to -// the node being visited using this tracker. -type AncestorTracker struct { - ancestors []Node -} - -// AsWalkOptions returns WalkOption values that will cause this ancestor tracker -// to track the path through the AST during the walk operation. -func (t *AncestorTracker) AsWalkOptions() []WalkOption { - return []WalkOption{ - WithBefore(func(n Node) error { - t.ancestors = append(t.ancestors, n) - return nil - }), - WithAfter(func(n Node) error { - t.ancestors = t.ancestors[:len(t.ancestors)-1] - return nil - }), - } -} - -// Path returns a slice of nodes that represents the path from the root of the -// walk operaiton to the currently visited node. The first element in the path -// is the root supplied to Walk. The last element in the path is the currently -// visited node. -// -// The returned slice is not a defensive copy; so callers should NOT mutate it. -func (t *AncestorTracker) Path() []Node { - return t.ancestors -} - -// Parent returns the parent node of the currently visited node. If the node -// currently being visited is the root supplied to Walk then nil is returned. -func (t *AncestorTracker) Parent() Node { - if len(t.ancestors) <= 1 { - return nil - } - return t.ancestors[len(t.ancestors)-2] -} - -// VisitChildren visits all direct children of the given node using the given -// visitor. If visiting a child returns an error, that error is immediately -// returned, and other children will not be visited. -func VisitChildren(n CompositeNode, v Visitor) error { - for _, ch := range n.Children() { - if err := Visit(ch, v); err != nil { - return err - } - } - return nil -} - -// Visitor provides a technique for walking the AST that allows for -// dynamic dispatch, where a particular function is invoked based on -// the runtime type of the argument. -// -// It consists of a number of functions, each of which matches a -// concrete Node type. -// -// Most visitor implementations will either embed NoOpVisitor (so as -// not to have to implement *all* of the methods) or will be instances -// of SimpleVisitor. -// -// Visitors can be supplied to a Walk operation or passed to a call -// to Visit or VisitChildren. -type Visitor interface { - // VisitFileNode is invoked when visiting a *FileNode in the AST. - VisitFileNode(*FileNode) error - // VisitSyntaxNode is invoked when visiting a *SyntaxNode in the AST. - VisitSyntaxNode(*SyntaxNode) error - // VisitPackageNode is invoked when visiting a *PackageNode in the AST. - VisitPackageNode(*PackageNode) error - // VisitImportNode is invoked when visiting an *ImportNode in the AST. - VisitImportNode(*ImportNode) error - // VisitOptionNode is invoked when visiting an *OptionNode in the AST. - VisitOptionNode(*OptionNode) error - // VisitOptionNameNode is invoked when visiting an *OptionNameNode in the AST. - VisitOptionNameNode(*OptionNameNode) error - // VisitFieldReferenceNode is invoked when visiting a *FieldReferenceNode in the AST. - VisitFieldReferenceNode(*FieldReferenceNode) error - // VisitCompactOptionsNode is invoked when visiting a *CompactOptionsNode in the AST. - VisitCompactOptionsNode(*CompactOptionsNode) error - // VisitMessageNode is invoked when visiting a *MessageNode in the AST. - VisitMessageNode(*MessageNode) error - // VisitExtendNode is invoked when visiting an *ExtendNode in the AST. - VisitExtendNode(*ExtendNode) error - // VisitExtensionRangeNode is invoked when visiting an *ExtensionRangeNode in the AST. - VisitExtensionRangeNode(*ExtensionRangeNode) error - // VisitReservedNode is invoked when visiting a *ReservedNode in the AST. - VisitReservedNode(*ReservedNode) error - // VisitRangeNode is invoked when visiting a *RangeNode in the AST. - VisitRangeNode(*RangeNode) error - // VisitFieldNode is invoked when visiting a *FieldNode in the AST. - VisitFieldNode(*FieldNode) error - // VisitGroupNode is invoked when visiting a *GroupNode in the AST. - VisitGroupNode(*GroupNode) error - // VisitMapFieldNode is invoked when visiting a *MapFieldNode in the AST. - VisitMapFieldNode(*MapFieldNode) error - // VisitMapTypeNode is invoked when visiting a *MapTypeNode in the AST. - VisitMapTypeNode(*MapTypeNode) error - // VisitOneOfNode is invoked when visiting a *OneOfNode in the AST. - VisitOneOfNode(*OneOfNode) error - // VisitEnumNode is invoked when visiting an *EnumNode in the AST. - VisitEnumNode(*EnumNode) error - // VisitEnumValueNode is invoked when visiting an *EnumValueNode in the AST. - VisitEnumValueNode(*EnumValueNode) error - // VisitServiceNode is invoked when visiting a *ServiceNode in the AST. - VisitServiceNode(*ServiceNode) error - // VisitRPCNode is invoked when visiting an *RPCNode in the AST. - VisitRPCNode(*RPCNode) error - // VisitRPCTypeNode is invoked when visiting an *RPCTypeNode in the AST. - VisitRPCTypeNode(*RPCTypeNode) error - // VisitIdentNode is invoked when visiting an *IdentNode in the AST. - VisitIdentNode(*IdentNode) error - // VisitCompoundIdentNode is invoked when visiting a *CompoundIdentNode in the AST. - VisitCompoundIdentNode(*CompoundIdentNode) error - // VisitStringLiteralNode is invoked when visiting a *StringLiteralNode in the AST. - VisitStringLiteralNode(*StringLiteralNode) error - // VisitCompoundStringLiteralNode is invoked when visiting a *CompoundStringLiteralNode in the AST. - VisitCompoundStringLiteralNode(*CompoundStringLiteralNode) error - // VisitUintLiteralNode is invoked when visiting a *UintLiteralNode in the AST. - VisitUintLiteralNode(*UintLiteralNode) error - // VisitPositiveUintLiteralNode is invoked when visiting a *PositiveUintLiteralNode in the AST. - VisitPositiveUintLiteralNode(*PositiveUintLiteralNode) error - // VisitNegativeIntLiteralNode is invoked when visiting a *NegativeIntLiteralNode in the AST. - VisitNegativeIntLiteralNode(*NegativeIntLiteralNode) error - // VisitFloatLiteralNode is invoked when visiting a *FloatLiteralNode in the AST. - VisitFloatLiteralNode(*FloatLiteralNode) error - // VisitSpecialFloatLiteralNode is invoked when visiting a *SpecialFloatLiteralNode in the AST. - VisitSpecialFloatLiteralNode(*SpecialFloatLiteralNode) error - // VisitSignedFloatLiteralNode is invoked when visiting a *SignedFloatLiteralNode in the AST. - VisitSignedFloatLiteralNode(*SignedFloatLiteralNode) error - // VisitArrayLiteralNode is invoked when visiting an *ArrayLiteralNode in the AST. - VisitArrayLiteralNode(*ArrayLiteralNode) error - // VisitMessageLiteralNode is invoked when visiting a *MessageLiteralNode in the AST. - VisitMessageLiteralNode(*MessageLiteralNode) error - // VisitMessageFieldNode is invoked when visiting a *MessageFieldNode in the AST. - VisitMessageFieldNode(*MessageFieldNode) error - // VisitKeywordNode is invoked when visiting a *KeywordNode in the AST. - VisitKeywordNode(*KeywordNode) error - // VisitRuneNode is invoked when visiting a *RuneNode in the AST. - VisitRuneNode(*RuneNode) error - // VisitEmptyDeclNode is invoked when visiting a *EmptyDeclNode in the AST. - VisitEmptyDeclNode(*EmptyDeclNode) error -} - -// NoOpVisitor is a visitor implementation that does nothing. All methods -// unconditionally return nil. This can be embedded into a struct to make that -// struct implement the Visitor interface, and only the relevant visit methods -// then need to be implemented on the struct. -type NoOpVisitor struct{} - -var _ Visitor = NoOpVisitor{} - -func (n NoOpVisitor) VisitFileNode(_ *FileNode) error { - return nil -} - -func (n NoOpVisitor) VisitSyntaxNode(_ *SyntaxNode) error { - return nil -} - -func (n NoOpVisitor) VisitPackageNode(_ *PackageNode) error { - return nil -} - -func (n NoOpVisitor) VisitImportNode(_ *ImportNode) error { - return nil -} - -func (n NoOpVisitor) VisitOptionNode(_ *OptionNode) error { - return nil -} - -func (n NoOpVisitor) VisitOptionNameNode(_ *OptionNameNode) error { - return nil -} - -func (n NoOpVisitor) VisitFieldReferenceNode(_ *FieldReferenceNode) error { - return nil -} - -func (n NoOpVisitor) VisitCompactOptionsNode(_ *CompactOptionsNode) error { - return nil -} - -func (n NoOpVisitor) VisitMessageNode(_ *MessageNode) error { - return nil -} - -func (n NoOpVisitor) VisitExtendNode(_ *ExtendNode) error { - return nil -} - -func (n NoOpVisitor) VisitExtensionRangeNode(_ *ExtensionRangeNode) error { - return nil -} - -func (n NoOpVisitor) VisitReservedNode(_ *ReservedNode) error { - return nil -} - -func (n NoOpVisitor) VisitRangeNode(_ *RangeNode) error { - return nil -} - -func (n NoOpVisitor) VisitFieldNode(_ *FieldNode) error { - return nil -} - -func (n NoOpVisitor) VisitGroupNode(_ *GroupNode) error { - return nil -} - -func (n NoOpVisitor) VisitMapFieldNode(_ *MapFieldNode) error { - return nil -} - -func (n NoOpVisitor) VisitMapTypeNode(_ *MapTypeNode) error { - return nil -} - -func (n NoOpVisitor) VisitOneOfNode(_ *OneOfNode) error { - return nil -} - -func (n NoOpVisitor) VisitEnumNode(_ *EnumNode) error { - return nil -} - -func (n NoOpVisitor) VisitEnumValueNode(_ *EnumValueNode) error { - return nil -} - -func (n NoOpVisitor) VisitServiceNode(_ *ServiceNode) error { - return nil -} - -func (n NoOpVisitor) VisitRPCNode(_ *RPCNode) error { - return nil -} - -func (n NoOpVisitor) VisitRPCTypeNode(_ *RPCTypeNode) error { - return nil -} - -func (n NoOpVisitor) VisitIdentNode(_ *IdentNode) error { - return nil -} - -func (n NoOpVisitor) VisitCompoundIdentNode(_ *CompoundIdentNode) error { - return nil -} - -func (n NoOpVisitor) VisitStringLiteralNode(_ *StringLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitCompoundStringLiteralNode(_ *CompoundStringLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitUintLiteralNode(_ *UintLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitPositiveUintLiteralNode(_ *PositiveUintLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitNegativeIntLiteralNode(_ *NegativeIntLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitFloatLiteralNode(_ *FloatLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitSpecialFloatLiteralNode(_ *SpecialFloatLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitSignedFloatLiteralNode(_ *SignedFloatLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitArrayLiteralNode(_ *ArrayLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitMessageLiteralNode(_ *MessageLiteralNode) error { - return nil -} - -func (n NoOpVisitor) VisitMessageFieldNode(_ *MessageFieldNode) error { - return nil -} - -func (n NoOpVisitor) VisitKeywordNode(_ *KeywordNode) error { - return nil -} - -func (n NoOpVisitor) VisitRuneNode(_ *RuneNode) error { - return nil -} - -func (n NoOpVisitor) VisitEmptyDeclNode(_ *EmptyDeclNode) error { - return nil -} - -// SimpleVisitor is a visitor implementation that uses numerous function fields. -// If a relevant function field is not nil, then it will be invoked when a node -// is visited. -// -// In addition to a function for each concrete node type (and thus for each -// Visit* method of the Visitor interface), it also has function fields that -// accept interface types. So a visitor can, for example, easily treat all -// ValueNodes uniformly by providing a non-nil value for DoVisitValueNode -// instead of having to supply values for the various DoVisit*Node methods -// corresponding to all types that implement ValueNode. -// -// The most specific function provided that matches a given node is the one that -// will be invoked. For example, DoVisitStringValueNode will be called if -// present and applicable before DoVisitValueNode. Similarly, DoVisitValueNode -// would be called before DoVisitTerminalNode or DoVisitCompositeNode. The -// DoVisitNode is the most generic function and is called only if no more -// specific function is present for a given node type. -// -// The *UintLiteralNode type implements both IntValueNode and FloatValueNode. -// In this case, the DoVisitIntValueNode function is considered more specific -// than DoVisitFloatValueNode, so will be preferred if present. -// -// Similarly, *MapFieldNode and *GroupNode implement both FieldDeclNode and -// MessageDeclNode. In this case, the DoVisitFieldDeclNode function is -// treated as more specific than DoVisitMessageDeclNode, so will be preferred -// if both are present. -type SimpleVisitor struct { - DoVisitFileNode func(*FileNode) error - DoVisitSyntaxNode func(*SyntaxNode) error - DoVisitPackageNode func(*PackageNode) error - DoVisitImportNode func(*ImportNode) error - DoVisitOptionNode func(*OptionNode) error - DoVisitOptionNameNode func(*OptionNameNode) error - DoVisitFieldReferenceNode func(*FieldReferenceNode) error - DoVisitCompactOptionsNode func(*CompactOptionsNode) error - DoVisitMessageNode func(*MessageNode) error - DoVisitExtendNode func(*ExtendNode) error - DoVisitExtensionRangeNode func(*ExtensionRangeNode) error - DoVisitReservedNode func(*ReservedNode) error - DoVisitRangeNode func(*RangeNode) error - DoVisitFieldNode func(*FieldNode) error - DoVisitGroupNode func(*GroupNode) error - DoVisitMapFieldNode func(*MapFieldNode) error - DoVisitMapTypeNode func(*MapTypeNode) error - DoVisitOneOfNode func(*OneOfNode) error - DoVisitEnumNode func(*EnumNode) error - DoVisitEnumValueNode func(*EnumValueNode) error - DoVisitServiceNode func(*ServiceNode) error - DoVisitRPCNode func(*RPCNode) error - DoVisitRPCTypeNode func(*RPCTypeNode) error - DoVisitIdentNode func(*IdentNode) error - DoVisitCompoundIdentNode func(*CompoundIdentNode) error - DoVisitStringLiteralNode func(*StringLiteralNode) error - DoVisitCompoundStringLiteralNode func(*CompoundStringLiteralNode) error - DoVisitUintLiteralNode func(*UintLiteralNode) error - DoVisitPositiveUintLiteralNode func(*PositiveUintLiteralNode) error - DoVisitNegativeIntLiteralNode func(*NegativeIntLiteralNode) error - DoVisitFloatLiteralNode func(*FloatLiteralNode) error - DoVisitSpecialFloatLiteralNode func(*SpecialFloatLiteralNode) error - DoVisitSignedFloatLiteralNode func(*SignedFloatLiteralNode) error - DoVisitArrayLiteralNode func(*ArrayLiteralNode) error - DoVisitMessageLiteralNode func(*MessageLiteralNode) error - DoVisitMessageFieldNode func(*MessageFieldNode) error - DoVisitKeywordNode func(*KeywordNode) error - DoVisitRuneNode func(*RuneNode) error - DoVisitEmptyDeclNode func(*EmptyDeclNode) error - - DoVisitFieldDeclNode func(FieldDeclNode) error - DoVisitMessageDeclNode func(MessageDeclNode) error - - DoVisitIdentValueNode func(IdentValueNode) error - DoVisitStringValueNode func(StringValueNode) error - DoVisitIntValueNode func(IntValueNode) error - DoVisitFloatValueNode func(FloatValueNode) error - DoVisitValueNode func(ValueNode) error - - DoVisitTerminalNode func(TerminalNode) error - DoVisitCompositeNode func(CompositeNode) error - DoVisitNode func(Node) error -} - -var _ Visitor = (*SimpleVisitor)(nil) - -func (b *SimpleVisitor) visitInterface(node Node) error { - switch n := node.(type) { - case FieldDeclNode: - if b.DoVisitFieldDeclNode != nil { - return b.DoVisitFieldDeclNode(n) - } - // *MapFieldNode and *GroupNode both implement both FieldDeclNode and - // MessageDeclNode, so handle other case here - if fn, ok := n.(MessageDeclNode); ok && b.DoVisitMessageDeclNode != nil { - return b.DoVisitMessageDeclNode(fn) - } - case MessageDeclNode: - if b.DoVisitMessageDeclNode != nil { - return b.DoVisitMessageDeclNode(n) - } - case IdentValueNode: - if b.DoVisitIdentValueNode != nil { - return b.DoVisitIdentValueNode(n) - } - case StringValueNode: - if b.DoVisitStringValueNode != nil { - return b.DoVisitStringValueNode(n) - } - case IntValueNode: - if b.DoVisitIntValueNode != nil { - return b.DoVisitIntValueNode(n) - } - // *UintLiteralNode implements both IntValueNode and FloatValueNode, - // so handle other case here - if fn, ok := n.(FloatValueNode); ok && b.DoVisitFloatValueNode != nil { - return b.DoVisitFloatValueNode(fn) - } - case FloatValueNode: - if b.DoVisitFloatValueNode != nil { - return b.DoVisitFloatValueNode(n) - } - } - - if n, ok := node.(ValueNode); ok && b.DoVisitValueNode != nil { - return b.DoVisitValueNode(n) - } - - switch n := node.(type) { - case TerminalNode: - if b.DoVisitTerminalNode != nil { - return b.DoVisitTerminalNode(n) - } - case CompositeNode: - if b.DoVisitCompositeNode != nil { - return b.DoVisitCompositeNode(n) - } - } - - if b.DoVisitNode != nil { - return b.DoVisitNode(node) - } - - return nil -} - -func (b *SimpleVisitor) VisitFileNode(node *FileNode) error { - if b.DoVisitFileNode != nil { - return b.DoVisitFileNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitSyntaxNode(node *SyntaxNode) error { - if b.DoVisitSyntaxNode != nil { - return b.DoVisitSyntaxNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitPackageNode(node *PackageNode) error { - if b.DoVisitPackageNode != nil { - return b.DoVisitPackageNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitImportNode(node *ImportNode) error { - if b.DoVisitImportNode != nil { - return b.DoVisitImportNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitOptionNode(node *OptionNode) error { - if b.DoVisitOptionNode != nil { - return b.DoVisitOptionNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitOptionNameNode(node *OptionNameNode) error { - if b.DoVisitOptionNameNode != nil { - return b.DoVisitOptionNameNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitFieldReferenceNode(node *FieldReferenceNode) error { - if b.DoVisitFieldReferenceNode != nil { - return b.DoVisitFieldReferenceNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitCompactOptionsNode(node *CompactOptionsNode) error { - if b.DoVisitCompactOptionsNode != nil { - return b.DoVisitCompactOptionsNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitMessageNode(node *MessageNode) error { - if b.DoVisitMessageNode != nil { - return b.DoVisitMessageNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitExtendNode(node *ExtendNode) error { - if b.DoVisitExtendNode != nil { - return b.DoVisitExtendNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitExtensionRangeNode(node *ExtensionRangeNode) error { - if b.DoVisitExtensionRangeNode != nil { - return b.DoVisitExtensionRangeNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitReservedNode(node *ReservedNode) error { - if b.DoVisitReservedNode != nil { - return b.DoVisitReservedNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitRangeNode(node *RangeNode) error { - if b.DoVisitRangeNode != nil { - return b.DoVisitRangeNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitFieldNode(node *FieldNode) error { - if b.DoVisitFieldNode != nil { - return b.DoVisitFieldNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitGroupNode(node *GroupNode) error { - if b.DoVisitGroupNode != nil { - return b.DoVisitGroupNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitMapFieldNode(node *MapFieldNode) error { - if b.DoVisitMapFieldNode != nil { - return b.DoVisitMapFieldNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitMapTypeNode(node *MapTypeNode) error { - if b.DoVisitMapTypeNode != nil { - return b.DoVisitMapTypeNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitOneOfNode(node *OneOfNode) error { - if b.DoVisitOneOfNode != nil { - return b.DoVisitOneOfNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitEnumNode(node *EnumNode) error { - if b.DoVisitEnumNode != nil { - return b.DoVisitEnumNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitEnumValueNode(node *EnumValueNode) error { - if b.DoVisitEnumValueNode != nil { - return b.DoVisitEnumValueNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitServiceNode(node *ServiceNode) error { - if b.DoVisitServiceNode != nil { - return b.DoVisitServiceNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitRPCNode(node *RPCNode) error { - if b.DoVisitRPCNode != nil { - return b.DoVisitRPCNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitRPCTypeNode(node *RPCTypeNode) error { - if b.DoVisitRPCTypeNode != nil { - return b.DoVisitRPCTypeNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitIdentNode(node *IdentNode) error { - if b.DoVisitIdentNode != nil { - return b.DoVisitIdentNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitCompoundIdentNode(node *CompoundIdentNode) error { - if b.DoVisitCompoundIdentNode != nil { - return b.DoVisitCompoundIdentNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitStringLiteralNode(node *StringLiteralNode) error { - if b.DoVisitStringLiteralNode != nil { - return b.DoVisitStringLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitCompoundStringLiteralNode(node *CompoundStringLiteralNode) error { - if b.DoVisitCompoundStringLiteralNode != nil { - return b.DoVisitCompoundStringLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitUintLiteralNode(node *UintLiteralNode) error { - if b.DoVisitUintLiteralNode != nil { - return b.DoVisitUintLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitPositiveUintLiteralNode(node *PositiveUintLiteralNode) error { - if b.DoVisitPositiveUintLiteralNode != nil { - return b.DoVisitPositiveUintLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitNegativeIntLiteralNode(node *NegativeIntLiteralNode) error { - if b.DoVisitNegativeIntLiteralNode != nil { - return b.DoVisitNegativeIntLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitFloatLiteralNode(node *FloatLiteralNode) error { - if b.DoVisitFloatLiteralNode != nil { - return b.DoVisitFloatLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitSpecialFloatLiteralNode(node *SpecialFloatLiteralNode) error { - if b.DoVisitSpecialFloatLiteralNode != nil { - return b.DoVisitSpecialFloatLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitSignedFloatLiteralNode(node *SignedFloatLiteralNode) error { - if b.DoVisitSignedFloatLiteralNode != nil { - return b.DoVisitSignedFloatLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitArrayLiteralNode(node *ArrayLiteralNode) error { - if b.DoVisitArrayLiteralNode != nil { - return b.DoVisitArrayLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitMessageLiteralNode(node *MessageLiteralNode) error { - if b.DoVisitMessageLiteralNode != nil { - return b.DoVisitMessageLiteralNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitMessageFieldNode(node *MessageFieldNode) error { - if b.DoVisitMessageFieldNode != nil { - return b.DoVisitMessageFieldNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitKeywordNode(node *KeywordNode) error { - if b.DoVisitKeywordNode != nil { - return b.DoVisitKeywordNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitRuneNode(node *RuneNode) error { - if b.DoVisitRuneNode != nil { - return b.DoVisitRuneNode(node) - } - return b.visitInterface(node) -} - -func (b *SimpleVisitor) VisitEmptyDeclNode(node *EmptyDeclNode) error { - if b.DoVisitEmptyDeclNode != nil { - return b.DoVisitEmptyDeclNode(node) - } - return b.visitInterface(node) -} diff --git a/vendor/github.com/bufbuild/protocompile/compiler.go b/vendor/github.com/bufbuild/protocompile/compiler.go deleted file mode 100644 index d301186228..0000000000 --- a/vendor/github.com/bufbuild/protocompile/compiler.go +++ /dev/null @@ -1,650 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protocompile - -import ( - "bytes" - "context" - "fmt" - "io" - "runtime" - "runtime/debug" - "strings" - "sync" - - "golang.org/x/sync/semaphore" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/linker" - "github.com/bufbuild/protocompile/options" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/reporter" - "github.com/bufbuild/protocompile/sourceinfo" -) - -// Compiler handles compilation tasks, to turn protobuf source files, or other -// intermediate representations, into fully linked descriptors. -// -// The compilation process involves five steps for each protobuf source file: -// 1. Parsing the source into an AST (abstract syntax tree). -// 2. Converting the AST into descriptor protos. -// 3. Linking descriptor protos into fully linked descriptors. -// 4. Interpreting options. -// 5. Computing source code information. -// -// With fully linked descriptors, code generators and protoc plugins could be -// invoked (though that step is not implemented by this package and not a -// responsibility of this type). -type Compiler struct { - // Resolves path/file names into source code or intermediate representations - // for protobuf source files. This is how the compiler loads the files to - // be compiled as well as all dependencies. This field is the only required - // field. - Resolver Resolver - // The maximum parallelism to use when compiling. If unspecified or set to - // a non-positive value, then min(runtime.NumCPU(), runtime.GOMAXPROCS(-1)) - // will be used. - MaxParallelism int - // A custom error and warning reporter. If unspecified a default reporter - // is used. A default reporter fails the compilation after encountering any - // errors and ignores all warnings. - Reporter reporter.Reporter - - // If unspecified or set to SourceInfoNone, source code information will not - // be included in the resulting descriptors. Source code information is - // metadata in the file descriptor that provides position information (i.e. - // the line and column where file elements were defined) as well as comments. - // - // If set to SourceInfoStandard, normal source code information will be - // included in the resulting descriptors. This matches the output of protoc - // (the reference compiler for Protocol Buffers). If set to - // SourceInfoMoreComments, the resulting descriptor will attempt to preserve - // as many comments as possible, for all elements in the file, not just for - // complete declarations. - // - // If Resolver returns descriptors or descriptor protos for a file, then - // those descriptors will not be modified. If they do not already include - // source code info, they will be left that way when the compile operation - // concludes. Similarly, if they already have source code info but this flag - // is false, existing info will be left in place. - SourceInfoMode SourceInfoMode - - // If true, ASTs are retained in compilation results for which an AST was - // constructed. So any linker.Result value in the resulting compiled files - // will have an AST, in addition to descriptors. If left false, the AST - // will be removed as soon as it's no longer needed. This can help reduce - // total memory usage for operations involving a large number of files. - RetainASTs bool -} - -// SourceInfoMode indicates how source code info is generated by a Compiler. -type SourceInfoMode int - -const ( - // SourceInfoNone indicates that no source code info is generated. - SourceInfoNone = SourceInfoMode(iota) - // SourceInfoStandard indicates that the standard source code info is - // generated, which includes comments only for complete declarations. - SourceInfoStandard - // SourceInfoExtraComments indicates that source code info is generated - // and will include comments for all elements (more comments than would - // be found in a descriptor produced by protoc). - SourceInfoExtraComments -) - -// Compile compiles the given file names into fully-linked descriptors. The -// compiler's resolver is used to locate source code (or intermediate artifacts -// such as parsed ASTs or descriptor protos) and then do what is necessary to -// transform that into descriptors (parsing, linking, etc). -// -// Elements in the given returned files will implement [linker.Result] if the -// compiler had to link it (i.e. the resolver provided either a descriptor proto -// or source code). That result will contain a full AST for the file if the -// compiler had to parse it (i.e. the resolver provided source code for that -// file). -func (c *Compiler) Compile(ctx context.Context, files ...string) (linker.Files, error) { - if len(files) == 0 { - return nil, nil - } - - ctx, cancel := context.WithCancel(ctx) - defer cancel() - - par := c.MaxParallelism - if par <= 0 { - par = runtime.GOMAXPROCS(-1) - cpus := runtime.NumCPU() - if par > cpus { - par = cpus - } - } - - h := reporter.NewHandler(c.Reporter) - - e := executor{ - c: c, - h: h, - s: semaphore.NewWeighted(int64(par)), - cancel: cancel, - sym: &linker.Symbols{}, - results: map[string]*result{}, - } - - // We lock now and create all tasks under lock to make sure that no - // async task can create a duplicate result. For example, if files - // contains both "foo.proto" and "bar.proto", then there is a race - // after we start compiling "foo.proto" between this loop and the - // async compilation task to create the result for "bar.proto". But - // we need to know if the file is directly requested for compilation, - // so we need this loop to define the result. So this loop holds the - // lock the whole time so async tasks can't create a result first. - results := make([]*result, len(files)) - func() { - e.mu.Lock() - defer e.mu.Unlock() - for i, f := range files { - results[i] = e.compileLocked(ctx, f, true) - } - }() - - descs := make([]linker.File, len(files)) - var firstError error - for i, r := range results { - select { - case <-r.ready: - case <-ctx.Done(): - return nil, ctx.Err() - } - if r.err != nil { - if firstError == nil { - firstError = r.err - } - } - descs[i] = r.res - } - - if err := h.Error(); err != nil { - return descs, err - } - // this should probably never happen; if any task returned an - // error, h.Error() should be non-nil - return descs, firstError -} - -type result struct { - name string - ready chan struct{} - - // true if this file was explicitly provided to the compiler; otherwise - // this file is an import that is implicitly included - explicitFile bool - - // produces a linker.File or error, only available when ready is closed - res linker.File - err error - - mu sync.Mutex - // the results that are dependencies of this result; this result is - // blocked, waiting on these dependencies to complete - blockedOn []string -} - -func (r *result) fail(err error) { - r.err = err - close(r.ready) -} - -func (r *result) complete(f linker.File) { - r.res = f - close(r.ready) -} - -func (r *result) setBlockedOn(deps []string) { - r.mu.Lock() - defer r.mu.Unlock() - r.blockedOn = deps -} - -func (r *result) getBlockedOn() []string { - r.mu.Lock() - defer r.mu.Unlock() - return r.blockedOn -} - -type executor struct { - c *Compiler - h *reporter.Handler - s *semaphore.Weighted - cancel context.CancelFunc - sym *linker.Symbols - - descriptorProtoCheck sync.Once - descriptorProtoIsCustom bool - - mu sync.Mutex - results map[string]*result -} - -func (e *executor) compile(ctx context.Context, file string) *result { - e.mu.Lock() - defer e.mu.Unlock() - - return e.compileLocked(ctx, file, false) -} - -func (e *executor) compileLocked(ctx context.Context, file string, explicitFile bool) *result { - r := e.results[file] - if r != nil { - return r - } - - r = &result{ - name: file, - ready: make(chan struct{}), - explicitFile: explicitFile, - } - e.results[file] = r - go func() { - defer func() { - if p := recover(); p != nil { - if r.err == nil { - // TODO: strip top frames from stack trace so that the panic is - // the top of the trace? - panicErr := PanicError{File: file, Value: p, Stack: string(debug.Stack())} - r.fail(panicErr) - } - // TODO: if r.err != nil, then this task has already - // failed and there's nothing we can really do to - // communicate this panic to parent goroutine. This - // means the panic must have happened *after* the - // failure was already recorded (or during?) - // It would be nice to do something else here, like - // send the compiler an out-of-band error? Or log? - } - }() - e.doCompile(ctx, file, r) - }() - return r -} - -// PanicError is an error value that represents a recovered panic. It includes -// the value returned by recover() as well as the stack trace. -// -// This should generally only be seen if a Resolver implementation panics. -// -// An error returned by a Compiler may wrap a PanicError, so you may need to -// use errors.As(...) to access panic details. -type PanicError struct { - // The file that was being processed when the panic occurred - File string - // The value returned by recover() - Value interface{} - // A formatted stack trace - Stack string -} - -// Error implements the error interface. It does NOT include the stack trace. -// Use a type assertion and query the Stack field directly to access that. -func (p PanicError) Error() string { - return fmt.Sprintf("panic handling %q: %v", p.File, p.Value) -} - -type errFailedToResolve struct { - err error - path string -} - -func (e errFailedToResolve) Error() string { - errMsg := e.err.Error() - if strings.Contains(errMsg, e.path) { - // underlying error already refers to path in question, so we don't need to add more context - return errMsg - } - return fmt.Sprintf("could not resolve path %q: %s", e.path, e.err.Error()) -} - -func (e errFailedToResolve) Unwrap() error { - return e.err -} - -func (e *executor) hasOverrideDescriptorProto() bool { - e.descriptorProtoCheck.Do(func() { - defer func() { - // ignore a panic here; just assume no custom descriptor.proto - _ = recover() - }() - res, err := e.c.Resolver.FindFileByPath(descriptorProtoPath) - e.descriptorProtoIsCustom = err == nil && res.Desc != standardImports[descriptorProtoPath] - }) - return e.descriptorProtoIsCustom -} - -func (e *executor) doCompile(ctx context.Context, file string, r *result) { - t := task{e: e, h: e.h.SubHandler(), r: r} - if err := e.s.Acquire(ctx, 1); err != nil { - r.fail(err) - return - } - defer t.release() - - sr, err := e.c.Resolver.FindFileByPath(file) - if err != nil { - r.fail(errFailedToResolve{err: err, path: file}) - return - } - - defer func() { - // if results included a result, don't leave it open if it can be closed - if sr.Source == nil { - return - } - if c, ok := sr.Source.(io.Closer); ok { - _ = c.Close() - } - }() - - desc, err := t.asFile(ctx, file, sr) - if err != nil { - r.fail(err) - return - } - r.complete(desc) -} - -// A compilation task. The executor has a semaphore that limits the number -// of concurrent, running tasks. -type task struct { - e *executor - - // handler for this task - h *reporter.Handler - - // If true, this task needs to acquire a semaphore permit before running. - // If false, this task needs to release its semaphore permit on completion. - released bool - - // the result that is populated by this task - r *result -} - -func (t *task) release() { - if !t.released { - t.e.s.Release(1) - t.released = true - } -} - -const descriptorProtoPath = "google/protobuf/descriptor.proto" - -func (t *task) asFile(ctx context.Context, name string, r SearchResult) (linker.File, error) { - if r.Desc != nil { - if r.Desc.Path() != name { - return nil, fmt.Errorf("search result for %q returned descriptor for %q", name, r.Desc.Path()) - } - return linker.NewFileRecursive(r.Desc) - } - - parseRes, err := t.asParseResult(name, r) - if err != nil { - return nil, err - } - if linkRes, ok := parseRes.(linker.Result); ok { - // if resolver returned a parse result that was actually a link result, - // use the link result directly (no other steps needed) - return linkRes, nil - } - - var deps []linker.File - fileDescriptorProto := parseRes.FileDescriptorProto() - var wantsDescriptorProto bool - imports := fileDescriptorProto.Dependency - - if t.e.hasOverrideDescriptorProto() { - // we only consider implicitly including descriptor.proto if it's overridden - if name != descriptorProtoPath { - var includesDescriptorProto bool - for _, dep := range fileDescriptorProto.Dependency { - if dep == descriptorProtoPath { - includesDescriptorProto = true - break - } - } - if !includesDescriptorProto { - wantsDescriptorProto = true - // make a defensive copy so we don't inadvertently mutate - // slice's backing array when adding this implicit dep - importsCopy := make([]string, len(imports)+1) - copy(importsCopy, imports) - importsCopy[len(imports)] = descriptorProtoPath - imports = importsCopy - } - } - } - - var overrideDescriptorProto linker.File - if len(imports) > 0 { - t.r.setBlockedOn(imports) - - results := make([]*result, len(fileDescriptorProto.Dependency)) - checked := map[string]struct{}{} - for i, dep := range fileDescriptorProto.Dependency { - pos := findImportPos(parseRes, dep) - if name == dep { - // doh! file imports itself - handleImportCycle(t.h, pos, []string{name}, dep) - return nil, t.h.Error() - } - - res := t.e.compile(ctx, dep) - // check for dependency cycle to prevent deadlock - if err := t.e.checkForDependencyCycle(res, []string{name, dep}, pos, checked); err != nil { - return nil, err - } - results[i] = res - } - deps = make([]linker.File, len(results)) - var descriptorProtoRes *result - if wantsDescriptorProto { - descriptorProtoRes = t.e.compile(ctx, descriptorProtoPath) - } - - // release our semaphore so dependencies can be processed w/out risk of deadlock - t.e.s.Release(1) - t.released = true - - // now we wait for them all to be computed - for i, res := range results { - select { - case <-res.ready: - if res.err != nil { - if rerr, ok := res.err.(errFailedToResolve); ok { - // We don't report errors to get file from resolver to handler since - // it's usually considered immediately fatal. However, if the reason - // we were resolving is due to an import, turn this into an error with - // source position that pinpoints the import statement and report it. - return nil, reporter.Error(findImportPos(parseRes, res.name), rerr) - } - return nil, res.err - } - deps[i] = res.res - case <-ctx.Done(): - return nil, ctx.Err() - } - } - if descriptorProtoRes != nil { - select { - case <-descriptorProtoRes.ready: - // descriptor.proto wasn't explicitly imported, so we can ignore a failure - if descriptorProtoRes.err == nil { - overrideDescriptorProto = descriptorProtoRes.res - } - case <-ctx.Done(): - return nil, ctx.Err() - } - } - // all deps resolved - t.r.setBlockedOn(nil) - // reacquire semaphore so we can proceed - if err := t.e.s.Acquire(ctx, 1); err != nil { - return nil, err - } - t.released = false - } - - return t.link(parseRes, deps, overrideDescriptorProto) -} - -func (e *executor) checkForDependencyCycle(res *result, sequence []string, pos ast.SourcePos, checked map[string]struct{}) error { - if _, ok := checked[res.name]; ok { - // already checked this one - return nil - } - checked[res.name] = struct{}{} - deps := res.getBlockedOn() - for _, dep := range deps { - // is this a cycle? - for _, file := range sequence { - if file == dep { - handleImportCycle(e.h, pos, sequence, dep) - return e.h.Error() - } - } - - e.mu.Lock() - depRes := e.results[dep] - e.mu.Unlock() - if depRes == nil { - continue - } - if err := e.checkForDependencyCycle(depRes, append(sequence, dep), pos, checked); err != nil { - return err - } - } - return nil -} - -func handleImportCycle(h *reporter.Handler, pos ast.SourcePos, importSequence []string, dep string) { - var buf bytes.Buffer - buf.WriteString("cycle found in imports: ") - for _, imp := range importSequence { - fmt.Fprintf(&buf, "%q -> ", imp) - } - fmt.Fprintf(&buf, "%q", dep) - // error is saved and returned in caller - h.HandleErrorf(pos, buf.String()) //nolint:errcheck -} - -func findImportPos(res parser.Result, dep string) ast.SourcePos { - root := res.AST() - if root == nil { - return ast.UnknownPos(res.FileNode().Name()) - } - for _, decl := range root.Decls { - if imp, ok := decl.(*ast.ImportNode); ok { - if imp.Name.AsString() == dep { - return root.NodeInfo(imp.Name).Start() - } - } - } - // this should never happen... - return ast.UnknownPos(res.FileNode().Name()) -} - -func (t *task) link(parseRes parser.Result, deps linker.Files, overrideDescriptorProtoRes linker.File) (linker.File, error) { - file, err := linker.Link(parseRes, deps, t.e.sym, t.h) - if err != nil { - return nil, err - } - - var interpretOpts []options.InterpreterOption - if overrideDescriptorProtoRes != nil { - interpretOpts = []options.InterpreterOption{options.WithOverrideDescriptorProto(overrideDescriptorProtoRes)} - } - - optsIndex, err := options.InterpretOptions(file, t.h, interpretOpts...) - if err != nil { - return nil, err - } - // now that options are interpreted, we can do some additional checks - if err := file.ValidateOptions(t.h); err != nil { - return nil, err - } - if t.r.explicitFile { - file.CheckForUnusedImports(t.h) - } - - if needsSourceInfo(parseRes, t.e.c.SourceInfoMode) { - switch t.e.c.SourceInfoMode { - case SourceInfoStandard: - parseRes.FileDescriptorProto().SourceCodeInfo = sourceinfo.GenerateSourceInfo(parseRes.AST(), optsIndex) - case SourceInfoExtraComments: - parseRes.FileDescriptorProto().SourceCodeInfo = sourceinfo.GenerateSourceInfoWithExtraComments(parseRes.AST(), optsIndex) - } - file.PopulateSourceCodeInfo() - } - - if !t.e.c.RetainASTs { - file.RemoveAST() - } - return file, nil -} - -func needsSourceInfo(parseRes parser.Result, mode SourceInfoMode) bool { - return mode != SourceInfoNone && parseRes.AST() != nil && parseRes.FileDescriptorProto().SourceCodeInfo == nil -} - -func (t *task) asParseResult(name string, r SearchResult) (parser.Result, error) { - if r.ParseResult != nil { - if r.ParseResult.FileDescriptorProto().GetName() != name { - return nil, fmt.Errorf("search result for %q returned descriptor for %q", name, r.ParseResult.FileDescriptorProto().GetName()) - } - // If the file descriptor needs linking, it will be mutated during the - // next stage. So to make anu mutations thread-safe, we must make a - // defensive copy. - res := parser.Clone(r.ParseResult) - return res, nil - } - - if r.Proto != nil { - if r.Proto.GetName() != name { - return nil, fmt.Errorf("search result for %q returned descriptor for %q", name, r.Proto.GetName()) - } - // If the file descriptor needs linking, it will be mutated during the - // next stage. So to make any mutations thread-safe, we must make a - // defensive copy. - descProto := proto.Clone(r.Proto).(*descriptorpb.FileDescriptorProto) //nolint:errcheck - return parser.ResultWithoutAST(descProto), nil - } - - file, err := t.asAST(name, r) - if err != nil { - return nil, err - } - - return parser.ResultFromAST(file, true, t.h) -} - -func (t *task) asAST(name string, r SearchResult) (*ast.FileNode, error) { - if r.AST != nil { - if r.AST.Name() != name { - return nil, fmt.Errorf("search result for %q returned descriptor for %q", name, r.AST.Name()) - } - return r.AST, nil - } - - return parser.Parse(name, r.Source, t.h) -} diff --git a/vendor/github.com/bufbuild/protocompile/doc.go b/vendor/github.com/bufbuild/protocompile/doc.go deleted file mode 100644 index 661ccc45fe..0000000000 --- a/vendor/github.com/bufbuild/protocompile/doc.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package protocompile provides the entry point for a high performance -// native Go protobuf compiler. "Compile" in this case just means parsing -// and validating source and generating fully-linked descriptors in the end. -// Unlike the protoc command-line tool, this package does not try to use the -// descriptors to perform code generation. -// -// The various sub-packages represent the various compile phases and contain -// models for the intermediate results. Those phases follow: -// 1. Parse into AST. -// Also see: parser.Parse -// 2. Convert AST to unlinked descriptor protos. -// Also see: parser.ResultFromAST -// 3. Link descriptor protos into "rich" descriptors. -// Also see: linker.Link -// 4. Interpret custom options. -// Also see: options.InterpretOptions -// 5. Generate source code info. -// Also see: sourceinfo.GenerateSourceInfo -// -// This package provides an easy-to-use interface that does all the relevant -// phases, based on the inputs given. If an input is provided as source, all -// phases apply. If an input is provided as a descriptor proto, only phases -// 3 to 5 apply. Nothing is necessary if provided a linked descriptor (which -// is usually only the case for select system dependencies). -// -// This package is also capable of taking advantage of multiple CPU cores, so -// a compilation involving thousands of files can be done very quickly by -// compiling things in parallel. -// -// # Resolvers -// -// A Resolver is how the compiler locates artifacts that are inputs to the -// compilation. For example, it can load protobuf source code that must be -// processed. A Resolver could also supply some already-compiled dependencies -// as fully-linked descriptors, alleviating the need to re-compile them. -// -// A Resolver can provide any of the following in response to a query for an -// input. -// - Source code: If a resolver answers a query with protobuf source, the -// compiler will parse and compile it. -// - AST: If a resolver answers a query with an AST, the parsing step can be -// skipped, and the rest of the compilation steps will be applied. -// - Descriptor proto: If a resolver answers a query with an unlinked proto, -// only the other compilation steps, including linking, need to be applied. -// - Descriptor: If a resolver answers a query with a fully-linked descriptor, -// nothing further needs to be done. The descriptor is used as-is. -// -// Compilation will use the Resolver to load the files that are to be compiled -// and also to load all dependencies (i.e. other files imported by those being -// compiled). -// -// # Compiler -// -// A Compiler accepts a list of file names and produces the list of descriptors. -// A Compiler has several fields that control how it works but only the Resolver -// field is required. A minimal Compiler, that resolves files by loading them -// from the file system based on the current working directory, can be had with -// the following simple snippet: -// -// compiler := protocompile.Compiler{ -// Resolver: &protocompile.SourceResolver{}, -// } -// -// This minimal Compiler will use default parallelism, equal to the number of -// CPU cores detected; it will not generate source code info in the resulting -// descriptors; and it will fail fast at the first sign of any error. All of -// these aspects can be customized by setting other fields. -package protocompile diff --git a/vendor/github.com/bufbuild/protocompile/go.work b/vendor/github.com/bufbuild/protocompile/go.work deleted file mode 100644 index de1c41a8fa..0000000000 --- a/vendor/github.com/bufbuild/protocompile/go.work +++ /dev/null @@ -1,7 +0,0 @@ -go 1.19 - -use ( - . - ./internal/benchmarks - ./internal/tools -) diff --git a/vendor/github.com/bufbuild/protocompile/go.work.sum b/vendor/github.com/bufbuild/protocompile/go.work.sum deleted file mode 100644 index d373c5959a..0000000000 --- a/vendor/github.com/bufbuild/protocompile/go.work.sum +++ /dev/null @@ -1,410 +0,0 @@ -cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= -cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= -cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= -cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= -cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= -cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= -cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= -cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= -cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= -cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= -cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= -cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A= -cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= -cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= -cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.105.0/go.mod h1:PrLgOJNe5nfE9UMxKxgXj4mD3voiP+YQ6gdt6KMFOKM= -cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= -cloud.google.com/go/accesscontextmanager v1.3.0/go.mod h1:TgCBehyr5gNMz7ZaH9xubp+CE8dkrszb4oK9CWyvD4o= -cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= -cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4= -cloud.google.com/go/apigateway v1.3.0/go.mod h1:89Z8Bhpmxu6AmUxuVRg/ECRGReEdiP3vQtk4Z1J9rJk= -cloud.google.com/go/apigeeconnect v1.3.0/go.mod h1:G/AwXFAKo0gIXkPTVfZDd2qA1TxBXJ3MgMRBQkIi9jc= -cloud.google.com/go/appengine v1.4.0/go.mod h1:CS2NhuBuDXM9f+qscZ6V86m1MIIqPj3WC/UoEuR1Sno= -cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0= -cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk= -cloud.google.com/go/artifactregistry v1.8.0/go.mod h1:w3GQXkJX8hiKN0v+at4b0qotwijQbYUqF2GWkZzAhC0= -cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s= -cloud.google.com/go/asset v1.9.0/go.mod h1:83MOE6jEJBMqFKadM9NLRcs80Gdw76qGuHn8m3h8oHQ= -cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw= -cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEarXQk6WEKkxYfL6kGIo= -cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8= -cloud.google.com/go/automl v1.7.0/go.mod h1:RL9MYCCsJEOmt0Wf3z9uzG0a7adTT1fe+aObgSpkCt8= -cloud.google.com/go/baremetalsolution v0.3.0/go.mod h1:XOrocE+pvK1xFfleEnShBlNAXf+j5blPPxrhjKgnIFc= -cloud.google.com/go/batch v0.3.0/go.mod h1:TR18ZoAekj1GuirsUsR1ZTKN3FC/4UDnScjT8NXImFE= -cloud.google.com/go/beyondcorp v0.2.0/go.mod h1:TB7Bd+EEtcw9PCPQhCJtJGjk/7TC6ckmnSFS+xwTfm4= -cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA= -cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s= -cloud.google.com/go/billing v1.6.0/go.mod h1:WoXzguj+BeHXPbKfNWkqVtDdzORazmCjraY+vrxcyvI= -cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI= -cloud.google.com/go/binaryauthorization v1.3.0/go.mod h1:lRZbKgjDIIQvzYQS1p99A7/U1JqvqeZg0wiI5tp6tg0= -cloud.google.com/go/certificatemanager v1.3.0/go.mod h1:n6twGDvcUBFu9uBgt4eYvvf3sQ6My8jADcOVwHmzadg= -cloud.google.com/go/channel v1.8.0/go.mod h1:W5SwCXDJsq/rg3tn3oG0LOxpAo6IMxNa09ngphpSlnk= -cloud.google.com/go/cloudbuild v1.3.0/go.mod h1:WequR4ULxlqvMsjDEEEFnOG5ZSRSgWOywXYDb1vPE6U= -cloud.google.com/go/clouddms v1.3.0/go.mod h1:oK6XsCDdW4Ib3jCCBugx+gVjevp2TMXFtgxvPSee3OM= -cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI= -cloud.google.com/go/cloudtasks v1.7.0/go.mod h1:ImsfdYWwlWNJbdgPIIGJWC+gemEGTBK/SunNQQNCAb4= -cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow= -cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM= -cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M= -cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s= -cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= -cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= -cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= -cloud.google.com/go/container v1.6.0/go.mod h1:Xazp7GjJSeUYo688S+6J5V+n/t+G5sKBTFkKNudGRxg= -cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4= -cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc= -cloud.google.com/go/datacatalog v1.7.0/go.mod h1:9mEl4AuDYWw81UGc41HonIHH7/sn52H0/tc8f8ZbZIE= -cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ= -cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE= -cloud.google.com/go/datafusion v1.4.0/go.mod h1:1Zb6VN+W6ALo85cXnM1IKiPw+yQMKMhB9TsTSRDo/38= -cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ= -cloud.google.com/go/dataplex v1.3.0/go.mod h1:hQuRtDg+fCiFgC8j0zV222HvzFQdRd+SVX8gdmFcZzA= -cloud.google.com/go/dataproc v1.7.0/go.mod h1:CKAlMjII9H90RXaMpSxQ8EU6dQx6iAYNPcYPOkSbi8s= -cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA= -cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ= -cloud.google.com/go/datastream v1.4.0/go.mod h1:h9dpzScPhDTs5noEMQVWP8Wx8AFBRyS0s8KWPx/9r0g= -cloud.google.com/go/deploy v1.4.0/go.mod h1:5Xghikd4VrmMLNaF6FiRFDlHb59VM59YoDQnOUdsH/c= -cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0= -cloud.google.com/go/dialogflow v1.18.0/go.mod h1:trO7Zu5YdyEuR+BhSNOqJezyFQ3aUzz0njv7sMx/iek= -cloud.google.com/go/dlp v1.6.0/go.mod h1:9eyB2xIhpU0sVwUixfBubDoRwP+GjeUoxxeueZmqvmM= -cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU= -cloud.google.com/go/documentai v1.9.0/go.mod h1:FS5485S8R00U10GhgBC0aNGrJxBP8ZVpEeJ7PQDZd6k= -cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg= -cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk= -cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w= -cloud.google.com/go/essentialcontacts v1.3.0/go.mod h1:r+OnHa5jfj90qIfZDO/VztSFqbQan7HV75p8sA+mdGI= -cloud.google.com/go/eventarc v1.7.0/go.mod h1:6ctpF3zTnaQCxUjHUdcfgcA1A2T309+omHZth7gDfmc= -cloud.google.com/go/filestore v1.3.0/go.mod h1:+qbvHGvXU1HaKX2nD0WEPo92TP/8AQuCVEBXNY9z0+w= -cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg= -cloud.google.com/go/functions v1.8.0/go.mod h1:RTZ4/HsQjIqIYP9a9YPbU+QFoQsAlYgrwOXJWHn1POY= -cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA= -cloud.google.com/go/gaming v1.7.0/go.mod h1:LrB8U7MHdGgFG851iHAfqUdLcKBdQ55hzXy9xBJz0+w= -cloud.google.com/go/gkebackup v0.2.0/go.mod h1:XKvv/4LfG829/B8B7xRkk8zRrOEbKtEam6yNfuQNH60= -cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A= -cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0= -cloud.google.com/go/gkemulticloud v0.3.0/go.mod h1:7orzy7O0S+5kq95e4Hpn7RysVA7dPs8W/GgfUtsPbrA= -cloud.google.com/go/gsuiteaddons v1.3.0/go.mod h1:EUNK/J1lZEZO8yPtykKxLXI6JSVN2rg9bN8SXOa0bgM= -cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= -cloud.google.com/go/iam v0.6.0/go.mod h1:+1AH33ueBne5MzYccyMHtEKqLE4/kJOibtffMHDMFMc= -cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= -cloud.google.com/go/ids v1.1.0/go.mod h1:WIuwCaYVOzHIj2OhN9HAwvW+DBdmUAdcWlFxRl+KubM= -cloud.google.com/go/iot v1.3.0/go.mod h1:r7RGh2B61+B8oz0AGE+J72AhA0G7tdXItODWsaA2oLs= -cloud.google.com/go/kms v1.5.0/go.mod h1:QJS2YY0eJGBg3mnDfuaCyLauWwBJiHRboYxJ++1xJNg= -cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= -cloud.google.com/go/language v1.7.0/go.mod h1:DJ6dYN/W+SQOjF8e1hLQXMF21AkH2w9wiPzPCJa2MIE= -cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.1.1/go.mod h1:UUFxuDWkv22EuY93jjmDMFT5GPQKeFVJBIF6QlTqdsE= -cloud.google.com/go/managedidentities v1.3.0/go.mod h1:UzlW3cBOiPrzucO5qWkNkh0w33KFtBJU281hacNvsdE= -cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= -cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM= -cloud.google.com/go/memcache v1.6.0/go.mod h1:XS5xB0eQZdHtTuTF9Hf8eJkKtR3pVRCcvJwtm68T3rA= -cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s= -cloud.google.com/go/metastore v1.7.0/go.mod h1:s45D0B4IlsINu87/AsWiEVYbLaIMeUSoxlKKDqBGFS8= -cloud.google.com/go/monitoring v1.7.0/go.mod h1:HpYse6kkGo//7p6sT0wsIC6IBDET0RhIsnmlA53dvEk= -cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o= -cloud.google.com/go/networkconnectivity v1.6.0/go.mod h1:OJOoEXW+0LAxHh89nXd64uGG+FbQoeH8DtxCHVOMlaM= -cloud.google.com/go/networkmanagement v1.4.0/go.mod h1:Q9mdLLRn60AsOrPc8rs8iNV6OHXaGcDdsIQe1ohekq8= -cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU= -cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34= -cloud.google.com/go/notebooks v1.4.0/go.mod h1:4QPMngcwmgb6uw7Po99B2xv5ufVoIQ7nOGDyL4P8AgA= -cloud.google.com/go/optimization v1.1.0/go.mod h1:5po+wfvX5AQlPznyVEZjGJTMr4+CAkJf2XSTQOOl9l4= -cloud.google.com/go/orchestration v1.3.0/go.mod h1:Sj5tq/JpWiB//X/q3Ngwdl5K7B7Y0KZ7bfv0wL6fqVA= -cloud.google.com/go/orgpolicy v1.4.0/go.mod h1:xrSLIV4RePWmP9P3tBl8S93lTmlAxjm06NSm2UTmKvE= -cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg= -cloud.google.com/go/osconfig v1.9.0/go.mod h1:Yx+IeIZJ3bdWmzbQU4fxNl8xsZ4amB+dygAwFPlvnNo= -cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU= -cloud.google.com/go/oslogin v1.6.0/go.mod h1:zOJ1O3+dTU8WPlGEkFSh7qeHPPSoxrcMbbK1Nm2iX70= -cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA= -cloud.google.com/go/policytroubleshooter v1.3.0/go.mod h1:qy0+VwANja+kKrjlQuOzmlvscn4RNsAc0e15GGqfMxg= -cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI= -cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk= -cloud.google.com/go/recaptchaenterprise/v2 v2.4.0/go.mod h1:Am3LHfOuBstrLrNCBrlI5sbwx9LBg3te2N6hGvHn2mE= -cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4= -cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c= -cloud.google.com/go/recommender v1.7.0/go.mod h1:XLHs/W+T8olwlGOgfQenXBTbIseGclClff6lhFVe9Bs= -cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A= -cloud.google.com/go/redis v1.9.0/go.mod h1:HMYQuajvb2D0LvMgZmLDZW8V5aOC/WxstZHiy4g8OiA= -cloud.google.com/go/resourcemanager v1.3.0/go.mod h1:bAtrTjZQFJkiWTPDb1WBjzvc6/kifjj4QBYuKCCoqKA= -cloud.google.com/go/resourcesettings v1.3.0/go.mod h1:lzew8VfESA5DQ8gdlHwMrqZs1S9V87v3oCnKCWoOuQU= -cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY= -cloud.google.com/go/retail v1.10.0/go.mod h1:2gDk9HsL4HMS4oZwz6daui2/jmKvqShXKQuB2RZ+cCc= -cloud.google.com/go/run v0.2.0/go.mod h1:CNtKsTA1sDcnqqIFR3Pb5Tq0usWxJJvsWOCPldRU3Do= -cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI= -cloud.google.com/go/scheduler v1.6.0/go.mod h1:SgeKVM7MIwPn3BqtcBntpLyrIJftQISRrYB5ZtT+KOk= -cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA= -cloud.google.com/go/secretmanager v1.8.0/go.mod h1:hnVgi/bN5MYHd3Gt0SPuTPPp5ENina1/LxM+2W9U9J4= -cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU= -cloud.google.com/go/security v1.9.0/go.mod h1:6Ta1bO8LXI89nZnmnsZGp9lVoVWXqsVbIq/t9dzI+2Q= -cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc= -cloud.google.com/go/securitycenter v1.15.0/go.mod h1:PeKJ0t8MoFmmXLXWm41JidyzI3PJjd8sXWaVqg43WWk= -cloud.google.com/go/servicecontrol v1.4.0/go.mod h1:o0hUSJ1TXJAmi/7fLJAedOovnujSEvjKCAFNXPQ1RaU= -cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg= -cloud.google.com/go/servicedirectory v1.6.0/go.mod h1:pUlbnWsLH9c13yGkxCmfumWEPjsRs1RlmJ4pqiNjVL4= -cloud.google.com/go/servicemanagement v1.4.0/go.mod h1:d8t8MDbezI7Z2R1O/wu8oTggo3BI2GKYbdG4y/SJTco= -cloud.google.com/go/serviceusage v1.3.0/go.mod h1:Hya1cozXM4SeSKTAgGXgj97GlqUvF5JaoXacR1JTP/E= -cloud.google.com/go/shell v1.3.0/go.mod h1:VZ9HmRjZBsjLGXusm7K5Q5lzzByZmJHf1d0IWHEN5X4= -cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ= -cloud.google.com/go/speech v1.8.0/go.mod h1:9bYIl1/tjsAnMgKGHKmBZzXKEkGgtU+MpdDPTE9f7y0= -cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= -cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= -cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= -cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= -cloud.google.com/go/talent v1.3.0/go.mod h1:CmcxwJ/PKfRgd1pBjQgU6W3YBwiewmUzQYH5HHmSCmM= -cloud.google.com/go/texttospeech v1.4.0/go.mod h1:FX8HQHA6sEpJ7rCMSfXuzBcysDAuWusNNNvN9FELDd8= -cloud.google.com/go/tpu v1.3.0/go.mod h1:aJIManG0o20tfDQlRIej44FcwGGl/cD0oiRyMKG19IQ= -cloud.google.com/go/trace v1.3.0/go.mod h1:FFUE83d9Ca57C+K8rDl/Ih8LwOzWIV1krKgxg6N0G28= -cloud.google.com/go/translate v1.3.0/go.mod h1:gzMUwRjvOqj5i69y/LYLd8RrNQk+hOmIXTi9+nb3Djs= -cloud.google.com/go/video v1.8.0/go.mod h1:sTzKFc0bUSByE8Yoh8X0mn8bMymItVGPfTuUBUyRgxk= -cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4= -cloud.google.com/go/videointelligence v1.8.0/go.mod h1:dIcCn4gVDdS7yte/w+koiXn5dWVplOZkE+xwG9FgK+M= -cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo= -cloud.google.com/go/vision/v2 v2.4.0/go.mod h1:VtI579ll9RpVTrdKdkMzckdnwMyX2JILb+MhPqRbPsY= -cloud.google.com/go/vmmigration v1.2.0/go.mod h1:IRf0o7myyWFSmVR1ItrBSFLFD/rJkfDCUTO4vLlJvsE= -cloud.google.com/go/vpcaccess v1.4.0/go.mod h1:aQHVbTWDYUR1EbTApSVvMq1EnT57ppDmQzZ3imqIk4w= -cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= -cloud.google.com/go/webrisk v1.6.0/go.mod h1:65sW9V9rOosnc9ZY7A7jsy1zoHS5W9IAXv6dGqhMQMc= -cloud.google.com/go/websecurityscanner v1.3.0/go.mod h1:uImdKm2wyeXQevQJXeh8Uun/Ym1VqworNDlBXQevGMo= -cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cloud.google.com/go/workflows v1.8.0/go.mod h1:ysGhmEajwZxGn1OhGOGKsTXc5PyxOc0vfKf5Af+to4M= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f/go.mod h1:tleDrpPTlLUVmgnEoN6qBliKWqJaZFJXqZdFjTd+ocU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= -github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= -github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= -github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= -github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= -github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= -github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= -github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM= -github.com/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.14.0 h1:MBbQK392K3u8NTLbKOCIi3XdI+y+c6yt5oMq0X3xviw= -github.com/jhump/protoreflect v1.14.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.14.1 h1:N88q7JkxTHWFEqReuTsYH1dPIwXxA0ITNQp7avLY10s= -github.com/jhump/protoreflect v1.14.1/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= -github.com/jhump/protoreflect v1.15.0 h1:U5T5/2LF0AZQFP9T4W5GfBjBaTruomrKobiR4E+oA/Q= -github.com/jhump/protoreflect v1.15.0/go.mod h1:qww51KYjD2hoCl/ohxw5cK2LSssFczrbO1t8Ld2TENs= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= -golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= -golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= -google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= -google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= -google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= -google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= -google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= -google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= -google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= -google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= -google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA= -google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8= -google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= -google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA= -google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= -google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= -google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= -google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= -google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= -google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= -google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI= -google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo= -google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd h1:e0TwkXOdbnH/1x5rc5MZ/VYyiZ4v+RdVfrGMqEwT68I= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE= -google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a h1:GH6UPn3ixhWcKDhpnEC55S75cerLPdpp3hrhfKYjZgw= -google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= -google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c h1:QgY/XxIAIeccR+Ca/rDdKubLIU9rcJ3xfy1DC/Wd2Oo= -google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c/go.mod h1:CGI5F/G+E5bKwmfYo09AXuVN4dD894kIKUFmVbP2/Fo= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= -google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/bufbuild/protocompile/internal/message_context.go b/vendor/github.com/bufbuild/protocompile/internal/message_context.go deleted file mode 100644 index 134a05d002..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/message_context.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "bytes" - "fmt" - - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" -) - -// ParsedFile wraps an optional AST and required FileDescriptorProto. -// This is used so types like parser.Result can be passed to this internal package avoiding circular imports. -// Additionally, it makes it less likely that users might specify one or the other. -type ParsedFile interface { - // AST returns the parsed abstract syntax tree. This returns nil if the - // Result was created without an AST. - AST() *ast.FileNode - // FileDescriptorProto returns the file descriptor proto. - FileDescriptorProto() *descriptorpb.FileDescriptorProto -} - -// MessageContext provides information about the location in a descriptor -// hierarchy, for adding context to warnings and error messages. -type MessageContext struct { - // The relevant file - File ParsedFile - - // The type and fully-qualified name of the element within the file. - ElementType string - ElementName string - - // If the element being processed is an option (or *in* an option) - // on the named element above, this will be non-nil. - Option *descriptorpb.UninterpretedOption - // If the element being processed is inside a message literal in an - // option value, this will be non-empty and represent a traversal - // to the element in question. - OptAggPath string -} - -func (c *MessageContext) String() string { - var ctx bytes.Buffer - if c.ElementType != "file" { - _, _ = fmt.Fprintf(&ctx, "%s %s: ", c.ElementType, c.ElementName) - } - if c.Option != nil && c.Option.Name != nil { - ctx.WriteString("option ") - writeOptionName(&ctx, c.Option.Name) - if c.File.AST() == nil { - // if we have no source position info, try to provide as much context - // as possible (if nodes != nil, we don't need this because any errors - // will actually have file and line numbers) - if c.OptAggPath != "" { - _, _ = fmt.Fprintf(&ctx, " at %s", c.OptAggPath) - } - } - ctx.WriteString(": ") - } - return ctx.String() -} - -func writeOptionName(buf *bytes.Buffer, parts []*descriptorpb.UninterpretedOption_NamePart) { - first := true - for _, p := range parts { - if first { - first = false - } else { - buf.WriteByte('.') - } - nm := p.GetNamePart() - if nm[0] == '.' { - // skip leading dot - nm = nm[1:] - } - if p.GetIsExtension() { - buf.WriteByte('(') - buf.WriteString(nm) - buf.WriteByte(')') - } else { - buf.WriteString(nm) - } - } -} diff --git a/vendor/github.com/bufbuild/protocompile/internal/norace.go b/vendor/github.com/bufbuild/protocompile/internal/norace.go deleted file mode 100644 index ada2f5cbb3..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/norace.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !race - -package internal - -const IsRace = false diff --git a/vendor/github.com/bufbuild/protocompile/internal/options.go b/vendor/github.com/bufbuild/protocompile/internal/options.go deleted file mode 100644 index 5586802b24..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/options.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/reporter" -) - -type hasOptionNode interface { - OptionNode(part *descriptorpb.UninterpretedOption) ast.OptionDeclNode - FileNode() ast.FileDeclNode // needed in order to query for NodeInfo -} - -func FindOption(res hasOptionNode, handler *reporter.Handler, scope string, opts []*descriptorpb.UninterpretedOption, name string) (int, error) { - found := -1 - for i, opt := range opts { - if len(opt.Name) != 1 { - continue - } - if opt.Name[0].GetIsExtension() || opt.Name[0].GetNamePart() != name { - continue - } - if found >= 0 { - optNode := res.OptionNode(opt) - fn := res.FileNode() - node := optNode.GetName() - nodeInfo := fn.NodeInfo(node) - return -1, handler.HandleErrorf(nodeInfo.Start(), "%s: option %s cannot be defined more than once", scope, name) - } - found = i - } - return found, nil -} - -func RemoveOption(uo []*descriptorpb.UninterpretedOption, indexToRemove int) []*descriptorpb.UninterpretedOption { - switch { - case indexToRemove == 0: - return uo[1:] - case indexToRemove == len(uo)-1: - return uo[:len(uo)-1] - default: - return append(uo[:indexToRemove], uo[indexToRemove+1:]...) - } -} diff --git a/vendor/github.com/bufbuild/protocompile/internal/race.go b/vendor/github.com/bufbuild/protocompile/internal/race.go deleted file mode 100644 index 4a458a3fe1..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/race.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build race - -package internal - -const IsRace = true diff --git a/vendor/github.com/bufbuild/protocompile/internal/tags.go b/vendor/github.com/bufbuild/protocompile/internal/tags.go deleted file mode 100644 index 7e674c176c..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/tags.go +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "math" - -const ( - // MaxNormalTag is the maximum allowed tag number for a field in a normal message. - MaxNormalTag = 536870911 // 2^29 - 1 - - // MaxMessageSetTag is the maximum allowed tag number of a field in a message that - // uses the message set wire format. - MaxMessageSetTag = math.MaxInt32 - 1 - - // MaxTag is the maximum allowed tag number. (It is the same as MaxMessageSetTag - // since that is the absolute highest allowed.) - MaxTag = MaxMessageSetTag - - // SpecialReservedStart is the first tag in a range that is reserved and not - // allowed for use in message definitions. - SpecialReservedStart = 19000 - // SpecialReservedEnd is the last tag in a range that is reserved and not - // allowed for use in message definitions. - SpecialReservedEnd = 19999 - - // NB: It would be nice to use constants from generated code instead of - // hard-coding these here. But code-gen does not emit these as constants - // anywhere. The only places they appear in generated code are struct tags - // on fields of the generated descriptor protos. - - // FilePackageTag is the tag number of the package element in a file - // descriptor proto. - FilePackageTag = 2 - // FileDependencyTag is the tag number of the dependencies element in a - // file descriptor proto. - FileDependencyTag = 3 - // FileMessagesTag is the tag number of the messages element in a file - // descriptor proto. - FileMessagesTag = 4 - // FileEnumsTag is the tag number of the enums element in a file descriptor - // proto. - FileEnumsTag = 5 - // FileServicesTag is the tag number of the services element in a file - // descriptor proto. - FileServicesTag = 6 - // FileExtensionsTag is the tag number of the extensions element in a file - // descriptor proto. - FileExtensionsTag = 7 - // FileOptionsTag is the tag number of the options element in a file - // descriptor proto. - FileOptionsTag = 8 - // FileSourceCodeInfoTag is the tag number of the source code info element - // in a file descriptor proto. - FileSourceCodeInfoTag = 9 - // FilePublicDependencyTag is the tag number of the public dependency element - // in a file descriptor proto. - FilePublicDependencyTag = 10 - // FileWeakDependencyTag is the tag number of the weak dependency element - // in a file descriptor proto. - FileWeakDependencyTag = 11 - // FileSyntaxTag is the tag number of the syntax element in a file - // descriptor proto. - FileSyntaxTag = 12 - // MessageNameTag is the tag number of the name element in a message - // descriptor proto. - MessageNameTag = 1 - // MessageFieldsTag is the tag number of the fields element in a message - // descriptor proto. - MessageFieldsTag = 2 - // MessageNestedMessagesTag is the tag number of the nested messages - // element in a message descriptor proto. - MessageNestedMessagesTag = 3 - // MessageEnumsTag is the tag number of the enums element in a message - // descriptor proto. - MessageEnumsTag = 4 - // MessageExtensionRangesTag is the tag number of the extension ranges - // element in a message descriptor proto. - MessageExtensionRangesTag = 5 - // MessageExtensionsTag is the tag number of the extensions element in a - // message descriptor proto. - MessageExtensionsTag = 6 - // MessageOptionsTag is the tag number of the options element in a message - // descriptor proto. - MessageOptionsTag = 7 - // MessageOneOfsTag is the tag number of the one-ofs element in a message - // descriptor proto. - MessageOneOfsTag = 8 - // MessageReservedRangesTag is the tag number of the reserved ranges element - // in a message descriptor proto. - MessageReservedRangesTag = 9 - // MessageReservedNamesTag is the tag number of the reserved names element - // in a message descriptor proto. - MessageReservedNamesTag = 10 - // ExtensionRangeStartTag is the tag number of the start index in an - // extension range proto. - ExtensionRangeStartTag = 1 - // ExtensionRangeEndTag is the tag number of the end index in an - // extension range proto. - ExtensionRangeEndTag = 2 - // ExtensionRangeOptionsTag is the tag number of the options element in an - // extension range proto. - ExtensionRangeOptionsTag = 3 - // ReservedRangeStartTag is the tag number of the start index in a reserved - // range proto. This field number is the same for both "flavors" of reserved - // ranges: DescriptorProto.ReservedRange and EnumDescriptorProto.EnumReservedRange. - ReservedRangeStartTag = 1 - // ReservedRangeEndTag is the tag number of the end index in a reserved - // range proto. This field number is the same for both "flavors" of reserved - // ranges: DescriptorProto.ReservedRange and EnumDescriptorProto.EnumReservedRange. - ReservedRangeEndTag = 2 - // FieldNameTag is the tag number of the name element in a field descriptor - // proto. - FieldNameTag = 1 - // FieldExtendeeTag is the tag number of the extendee element in a field - // descriptor proto. - FieldExtendeeTag = 2 - // FieldNumberTag is the tag number of the number element in a field - // descriptor proto. - FieldNumberTag = 3 - // FieldLabelTag is the tag number of the label element in a field - // descriptor proto. - FieldLabelTag = 4 - // FieldTypeTag is the tag number of the type element in a field descriptor - // proto. - FieldTypeTag = 5 - // FieldTypeNameTag is the tag number of the type name element in a field - // descriptor proto. - FieldTypeNameTag = 6 - // FieldDefaultTag is the tag number of the default value element in a - // field descriptor proto. - FieldDefaultTag = 7 - // FieldOptionsTag is the tag number of the options element in a field - // descriptor proto. - FieldOptionsTag = 8 - // FieldOneofIndexTag is the tag number of the oneof index element in a - // field descriptor proto. - FieldOneofIndexTag = 9 - // FieldJSONNameTag is the tag number of the JSON name element in a field - // descriptor proto. - FieldJSONNameTag = 10 - // FieldProto3OptionalTag is the tag number of the proto3_optional element - // in a descriptor proto. - FieldProto3OptionalTag = 17 - // OneOfNameTag is the tag number of the name element in a one-of - // descriptor proto. - OneOfNameTag = 1 - // OneOfOptionsTag is the tag number of the options element in a one-of - // descriptor proto. - OneOfOptionsTag = 2 - // EnumNameTag is the tag number of the name element in an enum descriptor - // proto. - EnumNameTag = 1 - // EnumValuesTag is the tag number of the values element in an enum - // descriptor proto. - EnumValuesTag = 2 - // EnumOptionsTag is the tag number of the options element in an enum - // descriptor proto. - EnumOptionsTag = 3 - // EnumReservedRangesTag is the tag number of the reserved ranges element in - // an enum descriptor proto. - EnumReservedRangesTag = 4 - // EnumReservedNamesTag is the tag number of the reserved names element in - // an enum descriptor proto. - EnumReservedNamesTag = 5 - // EnumValNameTag is the tag number of the name element in an enum value - // descriptor proto. - EnumValNameTag = 1 - // EnumValNumberTag is the tag number of the number element in an enum - // value descriptor proto. - EnumValNumberTag = 2 - // EnumValOptionsTag is the tag number of the options element in an enum - // value descriptor proto. - EnumValOptionsTag = 3 - // ServiceNameTag is the tag number of the name element in a service - // descriptor proto. - ServiceNameTag = 1 - // ServiceMethodsTag is the tag number of the methods element in a service - // descriptor proto. - ServiceMethodsTag = 2 - // ServiceOptionsTag is the tag number of the options element in a service - // descriptor proto. - ServiceOptionsTag = 3 - // MethodNameTag is the tag number of the name element in a method - // descriptor proto. - MethodNameTag = 1 - // MethodInputTag is the tag number of the input type element in a method - // descriptor proto. - MethodInputTag = 2 - // MethodOutputTag is the tag number of the output type element in a method - // descriptor proto. - MethodOutputTag = 3 - // MethodOptionsTag is the tag number of the options element in a method - // descriptor proto. - MethodOptionsTag = 4 - // MethodInputStreamTag is the tag number of the input stream flag in a - // method descriptor proto. - MethodInputStreamTag = 5 - // MethodOutputStreamTag is the tag number of the output stream flag in a - // method descriptor proto. - MethodOutputStreamTag = 6 - - // UninterpretedOptionsTag is the tag number of the uninterpreted options - // element. All *Options messages use the same tag for the field that stores - // uninterpreted options. - UninterpretedOptionsTag = 999 - - // UninterpretedNameTag is the tag number of the name element in an - // uninterpreted options proto. - UninterpretedNameTag = 2 - // UninterpretedIdentTag is the tag number of the identifier value in an - // uninterpreted options proto. - UninterpretedIdentTag = 3 - // UninterpretedPosIntTag is the tag number of the positive int value in an - // uninterpreted options proto. - UninterpretedPosIntTag = 4 - // UninterpretedNegIntTag is the tag number of the negative int value in an - // uninterpreted options proto. - UninterpretedNegIntTag = 5 - // UninterpretedDoubleTag is the tag number of the double value in an - // uninterpreted options proto. - UninterpretedDoubleTag = 6 - // UninterpretedStringTag is the tag number of the string value in an - // uninterpreted options proto. - UninterpretedStringTag = 7 - // UninterpretedAggregateTag is the tag number of the aggregate value in an - // uninterpreted options proto. - UninterpretedAggregateTag = 8 - // UninterpretedNameNameTag is the tag number of the name element in an - // uninterpreted option name proto. - UninterpretedNameNameTag = 1 -) diff --git a/vendor/github.com/bufbuild/protocompile/internal/types.go b/vendor/github.com/bufbuild/protocompile/internal/types.go deleted file mode 100644 index 5e54e4af54..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/types.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import "google.golang.org/protobuf/types/descriptorpb" - -var FieldTypes = map[string]descriptorpb.FieldDescriptorProto_Type{ - "double": descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, - "float": descriptorpb.FieldDescriptorProto_TYPE_FLOAT, - "int32": descriptorpb.FieldDescriptorProto_TYPE_INT32, - "int64": descriptorpb.FieldDescriptorProto_TYPE_INT64, - "uint32": descriptorpb.FieldDescriptorProto_TYPE_UINT32, - "uint64": descriptorpb.FieldDescriptorProto_TYPE_UINT64, - "sint32": descriptorpb.FieldDescriptorProto_TYPE_SINT32, - "sint64": descriptorpb.FieldDescriptorProto_TYPE_SINT64, - "fixed32": descriptorpb.FieldDescriptorProto_TYPE_FIXED32, - "fixed64": descriptorpb.FieldDescriptorProto_TYPE_FIXED64, - "sfixed32": descriptorpb.FieldDescriptorProto_TYPE_SFIXED32, - "sfixed64": descriptorpb.FieldDescriptorProto_TYPE_SFIXED64, - "bool": descriptorpb.FieldDescriptorProto_TYPE_BOOL, - "string": descriptorpb.FieldDescriptorProto_TYPE_STRING, - "bytes": descriptorpb.FieldDescriptorProto_TYPE_BYTES, -} diff --git a/vendor/github.com/bufbuild/protocompile/internal/util.go b/vendor/github.com/bufbuild/protocompile/internal/util.go deleted file mode 100644 index f01513ea08..0000000000 --- a/vendor/github.com/bufbuild/protocompile/internal/util.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( - "bytes" - "unicode" - "unicode/utf8" -) - -// JSONName returns the default JSON name for a field with the given name. -// This mirrors the algorithm in protoc: -// -// https://github.com/protocolbuffers/protobuf/blob/v21.3/src/google/protobuf/descriptor.cc#L95 -func JSONName(name string) string { - var js []rune - nextUpper := false - for _, r := range name { - if r == '_' { - nextUpper = true - continue - } - if nextUpper { - nextUpper = false - js = append(js, unicode.ToUpper(r)) - } else { - js = append(js, r) - } - } - return string(js) -} - -// InitCap returns the given field name, but with the first letter capitalized. -func InitCap(name string) string { - r, sz := utf8.DecodeRuneInString(name) - return string(unicode.ToUpper(r)) + name[sz:] -} - -// CreatePrefixList returns a list of package prefixes to search when resolving -// a symbol name. If the given package is blank, it returns only the empty -// string. If the given package contains only one token, e.g. "foo", it returns -// that token and the empty string, e.g. ["foo", ""]. Otherwise, it returns -// successively shorter prefixes of the package and then the empty string. For -// example, for a package named "foo.bar.baz" it will return the following list: -// -// ["foo.bar.baz", "foo.bar", "foo", ""] -func CreatePrefixList(pkg string) []string { - if pkg == "" { - return []string{""} - } - - numDots := 0 - // one pass to pre-allocate the returned slice - for i := 0; i < len(pkg); i++ { - if pkg[i] == '.' { - numDots++ - } - } - if numDots == 0 { - return []string{pkg, ""} - } - - prefixes := make([]string, numDots+2) - // second pass to fill in returned slice - for i := 0; i < len(pkg); i++ { - if pkg[i] == '.' { - prefixes[numDots] = pkg[:i] - numDots-- - } - } - prefixes[0] = pkg - - return prefixes -} - -func WriteEscapedBytes(buf *bytes.Buffer, b []byte) { - // This uses the same algorithm as the protoc C++ code for escaping strings. - // The protoc C++ code in turn uses the abseil C++ library's CEscape function: - // https://github.com/abseil/abseil-cpp/blob/934f613818ffcb26c942dff4a80be9a4031c662c/absl/strings/escaping.cc#L406 - for _, c := range b { - switch c { - case '\n': - buf.WriteString("\\n") - case '\r': - buf.WriteString("\\r") - case '\t': - buf.WriteString("\\t") - case '"': - buf.WriteString("\\\"") - case '\'': - buf.WriteString("\\'") - case '\\': - buf.WriteString("\\\\") - default: - if c >= 0x20 && c < 0x7f { - // simple printable characters - buf.WriteByte(c) - } else { - // use octal escape for all other values - buf.WriteRune('\\') - buf.WriteByte('0' + ((c >> 6) & 0x7)) - buf.WriteByte('0' + ((c >> 3) & 0x7)) - buf.WriteByte('0' + (c & 0x7)) - } - } - } -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/descriptors.go b/vendor/github.com/bufbuild/protocompile/linker/descriptors.go deleted file mode 100644 index fe19bf3ce6..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/descriptors.go +++ /dev/null @@ -1,1876 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "bytes" - "fmt" - "strconv" - "strings" - "unicode/utf8" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/dynamicpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/protoutil" -) - -// This file contains implementations of protoreflect.Descriptor. Note that -// this is a hack since those interfaces have a "doNotImplement" tag -// interface therein. We do just enough to make dynamicpb happy; constructing -// a regular descriptor would fail because we haven't yet interpreted options -// at the point we need these, and some validations will fail if the options -// aren't present. - -type result struct { - protoreflect.FileDescriptor - parser.Result - prefix string - deps Files - - // A map of all descriptors keyed by their fully-qualified name (without - // any leading dot). - descriptors map[string]protoreflect.Descriptor - - // A set of imports that have been used in the course of linking and - // interpreting options. - usedImports map[string]struct{} - - // A map of descriptor options messages to their pre-serialized bytes (using - // a canonical serialization format based on how protoc renders options to - // bytes). - optionBytes map[proto.Message][]byte - - // A map of AST nodes that represent identifiers in ast.FieldReferenceNodes - // to their fully-qualified name. The identifiers are for field names in - // message literals (in option values) that are extension fields. These names - // are resolved during linking and stored here, to be used to interpret options. - optionQualifiedNames map[ast.IdentValueNode]string - - imports fileImports - messages msgDescriptors - enums enumDescriptors - extensions extDescriptors - services svcDescriptors - srcLocations srcLocs -} - -var _ protoreflect.FileDescriptor = (*result)(nil) -var _ Result = (*result)(nil) -var _ protoutil.DescriptorProtoWrapper = (*result)(nil) - -func (r *result) RemoveAST() { - r.Result = parser.ResultWithoutAST(r.FileDescriptorProto()) - r.optionQualifiedNames = nil -} - -func (r *result) AsProto() proto.Message { - return r.FileDescriptorProto() -} - -func (r *result) ParentFile() protoreflect.FileDescriptor { - return r -} - -func (r *result) Parent() protoreflect.Descriptor { - return nil -} - -func (r *result) Index() int { - return 0 -} - -func (r *result) Syntax() protoreflect.Syntax { - switch r.FileDescriptorProto().GetSyntax() { - case "proto2", "": - return protoreflect.Proto2 - case "proto3": - return protoreflect.Proto3 - default: - return 0 // ??? - } -} - -func (r *result) Name() protoreflect.Name { - return "" -} - -func (r *result) FullName() protoreflect.FullName { - return r.Package() -} - -func (r *result) IsPlaceholder() bool { - return false -} - -func (r *result) Options() protoreflect.ProtoMessage { - return r.FileDescriptorProto().Options -} - -func (r *result) Path() string { - return r.FileDescriptorProto().GetName() -} - -func (r *result) Package() protoreflect.FullName { - return protoreflect.FullName(r.FileDescriptorProto().GetPackage()) -} - -func (r *result) Imports() protoreflect.FileImports { - return &r.imports -} - -func (r *result) Enums() protoreflect.EnumDescriptors { - return &r.enums -} - -func (r *result) Messages() protoreflect.MessageDescriptors { - return &r.messages -} - -func (r *result) Extensions() protoreflect.ExtensionDescriptors { - return &r.extensions -} - -func (r *result) Services() protoreflect.ServiceDescriptors { - return &r.services -} - -func (r *result) PopulateSourceCodeInfo() { - srcLocProtos := asSourceLocations(r.FileDescriptorProto().GetSourceCodeInfo().GetLocation()) - srcLocIndex := computeSourceLocIndex(srcLocProtos) - r.srcLocations = srcLocs{file: r, locs: srcLocProtos, index: srcLocIndex} -} - -func (r *result) SourceLocations() protoreflect.SourceLocations { - return &r.srcLocations -} - -func computeSourceLocIndex(locs []protoreflect.SourceLocation) map[interface{}]int { - index := map[interface{}]int{} - for i, loc := range locs { - if loc.Next == 0 { - index[pathKey(loc.Path)] = i - } - } - return index -} - -func asSourceLocations(srcInfoProtos []*descriptorpb.SourceCodeInfo_Location) []protoreflect.SourceLocation { - locs := make([]protoreflect.SourceLocation, len(srcInfoProtos)) - prev := map[string]*protoreflect.SourceLocation{} - for i, loc := range srcInfoProtos { - var stLin, stCol, enLin, enCol int - if len(loc.Span) == 3 { - stLin, stCol, enCol = int(loc.Span[0]), int(loc.Span[1]), int(loc.Span[2]) - enLin = stLin - } else { - stLin, stCol, enLin, enCol = int(loc.Span[0]), int(loc.Span[1]), int(loc.Span[2]), int(loc.Span[3]) - } - locs[i] = protoreflect.SourceLocation{ - Path: loc.Path, - LeadingComments: loc.GetLeadingComments(), - LeadingDetachedComments: loc.GetLeadingDetachedComments(), - TrailingComments: loc.GetTrailingComments(), - StartLine: stLin, - StartColumn: stCol, - EndLine: enLin, - EndColumn: enCol, - } - str := pathStr(loc.Path) - pr := prev[str] - if pr != nil { - pr.Next = i - } - prev[str] = &locs[i] - } - return locs -} - -func pathStr(p protoreflect.SourcePath) string { - var buf bytes.Buffer - for _, v := range p { - _, _ = fmt.Fprintf(&buf, "%x:", v) - } - return buf.String() -} - -// AddOptionBytes associates the given opts (an options message encoded in the -// binary format) with the given options protobuf message. The protobuf message -// should exist in the hierarchy of this result's FileDescriptorProto. This -// allows the FileDescriptorProto to be marshaled to bytes in a way that -// preserves the way options are defined in source (just as is done by protoc, -// but not possible when only using the generated Go types and standard -// marshaling APIs in the protobuf runtime). -func (r *result) AddOptionBytes(pm proto.Message, opts []byte) { - if r.optionBytes == nil { - r.optionBytes = map[proto.Message][]byte{} - } - r.optionBytes[pm] = append(r.optionBytes[pm], opts...) -} - -func (r *result) CanonicalProto() *descriptorpb.FileDescriptorProto { - origFd := r.FileDescriptorProto() - // make a copy that we can mutate - fd := proto.Clone(origFd).(*descriptorpb.FileDescriptorProto) //nolint:errcheck - - r.storeOptionBytesInFile(fd, origFd) - - return fd -} - -func (r *result) storeOptionBytesInFile(fd, origFd *descriptorpb.FileDescriptorProto) { - if fd.Options != nil { - fd.Options.Reset() - fd.Options.ProtoReflect().SetUnknown(r.optionBytes[origFd.Options]) - } - - for i, md := range fd.MessageType { - origMd := origFd.MessageType[i] - r.storeOptionBytesInMessage(md, origMd) - } - - for i, ed := range fd.EnumType { - origEd := origFd.EnumType[i] - r.storeOptionBytesInEnum(ed, origEd) - } - - for i, exd := range fd.Extension { - origExd := origFd.Extension[i] - r.storeOptionBytesInField(exd, origExd) - } - - for i, sd := range fd.Service { - origSd := origFd.Service[i] - if sd.Options != nil { - sd.Options.Reset() - sd.Options.ProtoReflect().SetUnknown(r.optionBytes[origSd.Options]) - } - - for j, mtd := range sd.Method { - origMtd := origSd.Method[j] - if mtd.Options != nil { - mtd.Options.Reset() - mtd.Options.ProtoReflect().SetUnknown(r.optionBytes[origMtd.Options]) - } - } - } -} - -func (r *result) storeOptionBytesInMessage(md, origMd *descriptorpb.DescriptorProto) { - if md.GetOptions().GetMapEntry() { - // Map entry messages are synthesized. They won't have any option bytes - // since they don't actually appear in the source and thus have any option - // declarations in the source. - return - } - - if md.Options != nil { - md.Options.Reset() - md.Options.ProtoReflect().SetUnknown(r.optionBytes[origMd.Options]) - } - - for i, fld := range md.Field { - origFld := origMd.Field[i] - r.storeOptionBytesInField(fld, origFld) - } - - for i, ood := range md.OneofDecl { - origOod := origMd.OneofDecl[i] - if ood.Options != nil { - ood.Options.Reset() - ood.Options.ProtoReflect().SetUnknown(r.optionBytes[origOod.Options]) - } - } - - for i, exr := range md.ExtensionRange { - origExr := origMd.ExtensionRange[i] - if exr.Options != nil { - exr.Options.Reset() - exr.Options.ProtoReflect().SetUnknown(r.optionBytes[origExr.Options]) - } - } - - for i, nmd := range md.NestedType { - origNmd := origMd.NestedType[i] - r.storeOptionBytesInMessage(nmd, origNmd) - } - - for i, ed := range md.EnumType { - origEd := origMd.EnumType[i] - r.storeOptionBytesInEnum(ed, origEd) - } - - for i, exd := range md.Extension { - origExd := origMd.Extension[i] - r.storeOptionBytesInField(exd, origExd) - } -} - -func (r *result) storeOptionBytesInEnum(ed, origEd *descriptorpb.EnumDescriptorProto) { - if ed.Options != nil { - ed.Options.Reset() - ed.Options.ProtoReflect().SetUnknown(r.optionBytes[origEd.Options]) - } - - for i, evd := range ed.Value { - origEvd := origEd.Value[i] - if evd.Options != nil { - evd.Options.Reset() - evd.Options.ProtoReflect().SetUnknown(r.optionBytes[origEvd.Options]) - } - } -} - -func (r *result) storeOptionBytesInField(fld, origFld *descriptorpb.FieldDescriptorProto) { - if fld.Options != nil { - fld.Options.Reset() - fld.Options.ProtoReflect().SetUnknown(r.optionBytes[origFld.Options]) - } -} - -type fileImports struct { - protoreflect.FileImports - files []protoreflect.FileImport -} - -func (r *result) createImports() fileImports { - fd := r.FileDescriptorProto() - imps := make([]protoreflect.FileImport, len(fd.Dependency)) - for i, dep := range fd.Dependency { - desc := r.deps.FindFileByPath(dep) - imps[i] = protoreflect.FileImport{FileDescriptor: desc} - } - for _, publicIndex := range fd.PublicDependency { - imps[int(publicIndex)].IsPublic = true - } - for _, weakIndex := range fd.WeakDependency { - imps[int(weakIndex)].IsWeak = true - } - return fileImports{files: imps} -} - -func (f *fileImports) Len() int { - return len(f.files) -} - -func (f *fileImports) Get(i int) protoreflect.FileImport { - return f.files[i] -} - -type srcLocs struct { - protoreflect.SourceLocations - file *result - locs []protoreflect.SourceLocation - index map[interface{}]int -} - -func (s *srcLocs) Len() int { - return len(s.locs) -} - -func (s *srcLocs) Get(i int) protoreflect.SourceLocation { - return s.locs[i] -} - -func (s *srcLocs) ByPath(p protoreflect.SourcePath) protoreflect.SourceLocation { - index, ok := s.index[pathKey(p)] - if !ok { - return protoreflect.SourceLocation{} - } - return s.locs[index] -} - -func (s *srcLocs) ByDescriptor(d protoreflect.Descriptor) protoreflect.SourceLocation { - if d.ParentFile() != s.file { - return protoreflect.SourceLocation{} - } - path, ok := computePath(d) - if !ok { - return protoreflect.SourceLocation{} - } - return s.ByPath(path) -} - -func computePath(d protoreflect.Descriptor) (protoreflect.SourcePath, bool) { - _, ok := d.(protoreflect.FileDescriptor) - if ok { - return nil, true - } - var path protoreflect.SourcePath - for { - p := d.Parent() - switch d := d.(type) { - case protoreflect.FileDescriptor: - return reverse(path), true - case protoreflect.MessageDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - path = append(path, internal.FileMessagesTag) - case protoreflect.MessageDescriptor: - path = append(path, internal.MessageNestedMessagesTag) - default: - return nil, false - } - case protoreflect.FieldDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - if d.IsExtension() { - path = append(path, internal.FileExtensionsTag) - } else { - return nil, false - } - case protoreflect.MessageDescriptor: - if d.IsExtension() { - path = append(path, internal.MessageExtensionsTag) - } else { - path = append(path, internal.MessageFieldsTag) - } - default: - return nil, false - } - case protoreflect.OneofDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.MessageDescriptor); ok { - path = append(path, internal.MessageOneOfsTag) - } else { - return nil, false - } - case protoreflect.EnumDescriptor: - path = append(path, int32(d.Index())) - switch p.(type) { - case protoreflect.FileDescriptor: - path = append(path, internal.FileEnumsTag) - case protoreflect.MessageDescriptor: - path = append(path, internal.MessageEnumsTag) - default: - return nil, false - } - case protoreflect.EnumValueDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.EnumDescriptor); ok { - path = append(path, internal.EnumValuesTag) - } else { - return nil, false - } - case protoreflect.ServiceDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.FileDescriptor); ok { - path = append(path, internal.FileServicesTag) - } else { - return nil, false - } - case protoreflect.MethodDescriptor: - path = append(path, int32(d.Index())) - if _, ok := p.(protoreflect.ServiceDescriptor); ok { - path = append(path, internal.ServiceMethodsTag) - } else { - return nil, false - } - } - d = p - } -} - -func reverse(p protoreflect.SourcePath) protoreflect.SourcePath { - for i, j := 0, len(p)-1; i < j; i, j = i+1, j-1 { - p[i], p[j] = p[j], p[i] - } - return p -} - -type msgDescriptors struct { - protoreflect.MessageDescriptors - msgs []*msgDescriptor -} - -func (r *result) createMessages(prefix string, parent protoreflect.Descriptor, msgProtos []*descriptorpb.DescriptorProto) msgDescriptors { - msgs := make([]*msgDescriptor, len(msgProtos)) - for i, msgProto := range msgProtos { - msgs[i] = r.createMessageDescriptor(msgProto, parent, i, prefix+msgProto.GetName()) - } - return msgDescriptors{msgs: msgs} -} - -func (m *msgDescriptors) Len() int { - return len(m.msgs) -} - -func (m *msgDescriptors) Get(i int) protoreflect.MessageDescriptor { - return m.msgs[i] -} - -func (m *msgDescriptors) ByName(s protoreflect.Name) protoreflect.MessageDescriptor { - for _, msg := range m.msgs { - if msg.Name() == s { - return msg - } - } - return nil -} - -type msgDescriptor struct { - protoreflect.MessageDescriptor - file *result - parent protoreflect.Descriptor - index int - proto *descriptorpb.DescriptorProto - fqn string - - fields fldDescriptors - oneofs oneofDescriptors - nestedMessages msgDescriptors - nestedEnums enumDescriptors - nestedExtensions extDescriptors - - extRanges fieldRanges - rsvdRanges fieldRanges - rsvdNames names -} - -var _ protoreflect.MessageDescriptor = (*msgDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*msgDescriptor)(nil) - -func (r *result) createMessageDescriptor(md *descriptorpb.DescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *msgDescriptor { - ret := &msgDescriptor{file: r, parent: parent, index: index, proto: md, fqn: fqn} - r.descriptors[fqn] = ret - - prefix := fqn + "." - // NB: We MUST create fields before oneofs so that we can populate the - // set of fields that belong to the oneof - ret.fields = r.createFields(prefix, ret, md.Field) - ret.oneofs = r.createOneOfs(prefix, ret, md.OneofDecl) - ret.nestedMessages = r.createMessages(prefix, ret, md.NestedType) - ret.nestedEnums = r.createEnums(prefix, ret, md.EnumType) - ret.nestedExtensions = r.createExtensions(prefix, ret, md.Extension) - ret.extRanges = createFieldRanges(md.ExtensionRange) - ret.rsvdRanges = createFieldRanges(md.ReservedRange) - ret.rsvdNames = names{s: md.ReservedName} - - return ret -} - -func (m *msgDescriptor) MessageDescriptorProto() *descriptorpb.DescriptorProto { - return m.proto -} - -func (m *msgDescriptor) AsProto() proto.Message { - return m.proto -} - -func (m *msgDescriptor) ParentFile() protoreflect.FileDescriptor { - return m.file -} - -func (m *msgDescriptor) Parent() protoreflect.Descriptor { - return m.parent -} - -func (m *msgDescriptor) Index() int { - return m.index -} - -func (m *msgDescriptor) Syntax() protoreflect.Syntax { - return m.file.Syntax() -} - -func (m *msgDescriptor) Name() protoreflect.Name { - return protoreflect.Name(m.proto.GetName()) -} - -func (m *msgDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(m.fqn) -} - -func (m *msgDescriptor) IsPlaceholder() bool { - return false -} - -func (m *msgDescriptor) Options() protoreflect.ProtoMessage { - return m.proto.Options -} - -func (m *msgDescriptor) IsMapEntry() bool { - return m.proto.Options.GetMapEntry() -} - -func (m *msgDescriptor) Fields() protoreflect.FieldDescriptors { - return &m.fields -} - -func (m *msgDescriptor) Oneofs() protoreflect.OneofDescriptors { - return &m.oneofs -} - -func (m *msgDescriptor) ReservedNames() protoreflect.Names { - return m.rsvdNames -} - -func (m *msgDescriptor) ReservedRanges() protoreflect.FieldRanges { - return m.rsvdRanges -} - -func (m *msgDescriptor) RequiredNumbers() protoreflect.FieldNumbers { - var indexes fieldNums - for _, fld := range m.proto.Field { - if fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { - indexes.s = append(indexes.s, fld.GetNumber()) - } - } - return indexes -} - -func (m *msgDescriptor) ExtensionRanges() protoreflect.FieldRanges { - return m.extRanges -} - -func (m *msgDescriptor) ExtensionRangeOptions(i int) protoreflect.ProtoMessage { - return m.proto.ExtensionRange[i].Options -} - -func (m *msgDescriptor) Enums() protoreflect.EnumDescriptors { - return &m.nestedEnums -} - -func (m *msgDescriptor) Messages() protoreflect.MessageDescriptors { - return &m.nestedMessages -} - -func (m *msgDescriptor) Extensions() protoreflect.ExtensionDescriptors { - return &m.nestedExtensions -} - -type names struct { - protoreflect.Names - s []string -} - -func (n names) Len() int { - return len(n.s) -} - -func (n names) Get(i int) protoreflect.Name { - return protoreflect.Name(n.s[i]) -} - -func (n names) Has(s protoreflect.Name) bool { - for _, name := range n.s { - if name == string(s) { - return true - } - } - return false -} - -type fieldNums struct { - protoreflect.FieldNumbers - s []int32 -} - -func (n fieldNums) Len() int { - return len(n.s) -} - -func (n fieldNums) Get(i int) protoreflect.FieldNumber { - return protoreflect.FieldNumber(n.s[i]) -} - -func (n fieldNums) Has(s protoreflect.FieldNumber) bool { - for _, num := range n.s { - if num == int32(s) { - return true - } - } - return false -} - -type fieldRanges struct { - protoreflect.FieldRanges - ranges [][2]protoreflect.FieldNumber -} - -type fieldRange interface { - GetStart() int32 - GetEnd() int32 -} - -func createFieldRanges[T fieldRange](rangeProtos []T) fieldRanges { - ranges := make([][2]protoreflect.FieldNumber, len(rangeProtos)) - for i, r := range rangeProtos { - ranges[i] = [2]protoreflect.FieldNumber{ - protoreflect.FieldNumber(r.GetStart()), - protoreflect.FieldNumber(r.GetEnd()), - } - } - return fieldRanges{ranges: ranges} -} - -func (f fieldRanges) Len() int { - return len(f.ranges) -} - -func (f fieldRanges) Get(i int) [2]protoreflect.FieldNumber { - return f.ranges[i] -} - -func (f fieldRanges) Has(n protoreflect.FieldNumber) bool { - for _, r := range f.ranges { - if r[0] <= n && r[1] > n { - return true - } - } - return false -} - -type enumDescriptors struct { - protoreflect.EnumDescriptors - enums []*enumDescriptor -} - -func (r *result) createEnums(prefix string, parent protoreflect.Descriptor, enumProtos []*descriptorpb.EnumDescriptorProto) enumDescriptors { - enums := make([]*enumDescriptor, len(enumProtos)) - for i, enumProto := range enumProtos { - enums[i] = r.createEnumDescriptor(enumProto, parent, i, prefix+enumProto.GetName()) - } - return enumDescriptors{enums: enums} -} - -func (e *enumDescriptors) Len() int { - return len(e.enums) -} - -func (e *enumDescriptors) Get(i int) protoreflect.EnumDescriptor { - return e.enums[i] -} - -func (e *enumDescriptors) ByName(s protoreflect.Name) protoreflect.EnumDescriptor { - for _, en := range e.enums { - if en.Name() == s { - return en - } - } - return nil -} - -type enumDescriptor struct { - protoreflect.EnumDescriptor - file *result - parent protoreflect.Descriptor - index int - proto *descriptorpb.EnumDescriptorProto - fqn string - - values enValDescriptors - - rsvdRanges enumRanges - rsvdNames names -} - -var _ protoreflect.EnumDescriptor = (*enumDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*enumDescriptor)(nil) - -func (r *result) createEnumDescriptor(ed *descriptorpb.EnumDescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *enumDescriptor { - ret := &enumDescriptor{file: r, parent: parent, index: index, proto: ed, fqn: fqn} - r.descriptors[fqn] = ret - - // Unlike all other elements, the fully-qualified name of enum values - // is NOT scoped to their parent element (the enum), but rather to - // the enum's parent element. This follows C++ scoping rules for - // enum values. - prefix := strings.TrimSuffix(fqn, ed.GetName()) - ret.values = r.createEnumValues(prefix, ret, ed.Value) - ret.rsvdRanges = createEnumRanges(ed.ReservedRange) - ret.rsvdNames = names{s: ed.ReservedName} - return ret -} - -func (e *enumDescriptor) EnumDescriptorProto() *descriptorpb.EnumDescriptorProto { - return e.proto -} - -func (e *enumDescriptor) AsProto() proto.Message { - return e.proto -} - -func (e *enumDescriptor) ParentFile() protoreflect.FileDescriptor { - return e.file -} - -func (e *enumDescriptor) Parent() protoreflect.Descriptor { - return e.parent -} - -func (e *enumDescriptor) Index() int { - return e.index -} - -func (e *enumDescriptor) Syntax() protoreflect.Syntax { - return e.file.Syntax() -} - -func (e *enumDescriptor) Name() protoreflect.Name { - return protoreflect.Name(e.proto.GetName()) -} - -func (e *enumDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(e.fqn) -} - -func (e *enumDescriptor) IsPlaceholder() bool { - return false -} - -func (e *enumDescriptor) Options() protoreflect.ProtoMessage { - return e.proto.Options -} - -func (e *enumDescriptor) Values() protoreflect.EnumValueDescriptors { - return &e.values -} - -func (e *enumDescriptor) ReservedNames() protoreflect.Names { - return e.rsvdNames -} - -func (e *enumDescriptor) ReservedRanges() protoreflect.EnumRanges { - return e.rsvdRanges -} - -type enumRanges struct { - protoreflect.EnumRanges - ranges [][2]protoreflect.EnumNumber -} - -func createEnumRanges(rangeProtos []*descriptorpb.EnumDescriptorProto_EnumReservedRange) enumRanges { - ranges := make([][2]protoreflect.EnumNumber, len(rangeProtos)) - for i, r := range rangeProtos { - ranges[i] = [2]protoreflect.EnumNumber{ - protoreflect.EnumNumber(r.GetStart()), - protoreflect.EnumNumber(r.GetEnd()), - } - } - return enumRanges{ranges: ranges} -} - -func (e enumRanges) Len() int { - return len(e.ranges) -} - -func (e enumRanges) Get(i int) [2]protoreflect.EnumNumber { - return e.ranges[i] -} - -func (e enumRanges) Has(n protoreflect.EnumNumber) bool { - for _, r := range e.ranges { - if r[0] <= n && r[1] >= n { - return true - } - } - return false -} - -type enValDescriptors struct { - protoreflect.EnumValueDescriptors - vals []*enValDescriptor -} - -func (r *result) createEnumValues(prefix string, parent *enumDescriptor, enValProtos []*descriptorpb.EnumValueDescriptorProto) enValDescriptors { - vals := make([]*enValDescriptor, len(enValProtos)) - for i, enValProto := range enValProtos { - vals[i] = r.createEnumValueDescriptor(enValProto, parent, i, prefix+enValProto.GetName()) - } - return enValDescriptors{vals: vals} -} - -func (e *enValDescriptors) Len() int { - return len(e.vals) -} - -func (e *enValDescriptors) Get(i int) protoreflect.EnumValueDescriptor { - return e.vals[i] -} - -func (e *enValDescriptors) ByName(s protoreflect.Name) protoreflect.EnumValueDescriptor { - for _, val := range e.vals { - if val.Name() == s { - return val - } - } - return nil -} - -func (e *enValDescriptors) ByNumber(n protoreflect.EnumNumber) protoreflect.EnumValueDescriptor { - for _, val := range e.vals { - if val.Number() == n { - return val - } - } - return nil -} - -type enValDescriptor struct { - protoreflect.EnumValueDescriptor - file *result - parent *enumDescriptor - index int - proto *descriptorpb.EnumValueDescriptorProto - fqn string -} - -var _ protoreflect.EnumValueDescriptor = (*enValDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*enValDescriptor)(nil) - -func (r *result) createEnumValueDescriptor(ed *descriptorpb.EnumValueDescriptorProto, parent *enumDescriptor, index int, fqn string) *enValDescriptor { - ret := &enValDescriptor{file: r, parent: parent, index: index, proto: ed, fqn: fqn} - r.descriptors[fqn] = ret - return ret -} - -func (e *enValDescriptor) EnumValueDescriptorProto() *descriptorpb.EnumValueDescriptorProto { - return e.proto -} - -func (e *enValDescriptor) AsProto() proto.Message { - return e.proto -} - -func (e *enValDescriptor) ParentFile() protoreflect.FileDescriptor { - return e.file -} - -func (e *enValDescriptor) Parent() protoreflect.Descriptor { - return e.parent -} - -func (e *enValDescriptor) Index() int { - return e.index -} - -func (e *enValDescriptor) Syntax() protoreflect.Syntax { - return e.file.Syntax() -} - -func (e *enValDescriptor) Name() protoreflect.Name { - return protoreflect.Name(e.proto.GetName()) -} - -func (e *enValDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(e.fqn) -} - -func (e *enValDescriptor) IsPlaceholder() bool { - return false -} - -func (e *enValDescriptor) Options() protoreflect.ProtoMessage { - return e.proto.Options -} - -func (e *enValDescriptor) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(e.proto.GetNumber()) -} - -type extDescriptors struct { - protoreflect.ExtensionDescriptors - exts []*extTypeDescriptor -} - -func (r *result) createExtensions(prefix string, parent protoreflect.Descriptor, extProtos []*descriptorpb.FieldDescriptorProto) extDescriptors { - exts := make([]*extTypeDescriptor, len(extProtos)) - for i, extProto := range extProtos { - exts[i] = r.createExtTypeDescriptor(extProto, parent, i, prefix+extProto.GetName()) - } - return extDescriptors{exts: exts} -} - -func (e *extDescriptors) Len() int { - return len(e.exts) -} - -func (e *extDescriptors) Get(i int) protoreflect.ExtensionDescriptor { - return e.exts[i] -} - -func (e *extDescriptors) ByName(s protoreflect.Name) protoreflect.ExtensionDescriptor { - for _, ext := range e.exts { - if ext.Name() == s { - return ext - } - } - return nil -} - -type extTypeDescriptor struct { - protoreflect.ExtensionTypeDescriptor - field *fldDescriptor -} - -var _ protoutil.DescriptorProtoWrapper = &extTypeDescriptor{} - -func (r *result) createExtTypeDescriptor(fd *descriptorpb.FieldDescriptorProto, parent protoreflect.Descriptor, index int, fqn string) *extTypeDescriptor { - ret := &fldDescriptor{file: r, parent: parent, index: index, proto: fd, fqn: fqn} - r.descriptors[fqn] = ret - return &extTypeDescriptor{ExtensionTypeDescriptor: dynamicpb.NewExtensionType(ret).TypeDescriptor(), field: ret} -} - -func (e *extTypeDescriptor) FieldDescriptorProto() *descriptorpb.FieldDescriptorProto { - return e.field.proto -} - -func (e *extTypeDescriptor) AsProto() proto.Message { - return e.field.proto -} - -type fldDescriptors struct { - protoreflect.FieldDescriptors - fields []*fldDescriptor -} - -func (r *result) createFields(prefix string, parent *msgDescriptor, fldProtos []*descriptorpb.FieldDescriptorProto) fldDescriptors { - fields := make([]*fldDescriptor, len(fldProtos)) - for i, fldProto := range fldProtos { - fields[i] = r.createFieldDescriptor(fldProto, parent, i, prefix+fldProto.GetName()) - } - return fldDescriptors{fields: fields} -} - -func (f *fldDescriptors) Len() int { - return len(f.fields) -} - -func (f *fldDescriptors) Get(i int) protoreflect.FieldDescriptor { - return f.fields[i] -} - -func (f *fldDescriptors) ByName(s protoreflect.Name) protoreflect.FieldDescriptor { - for _, fld := range f.fields { - if fld.Name() == s { - return fld - } - } - return nil -} - -func (f *fldDescriptors) ByJSONName(s string) protoreflect.FieldDescriptor { - for _, fld := range f.fields { - if fld.JSONName() == s { - return fld - } - } - return nil -} - -func (f *fldDescriptors) ByTextName(s string) protoreflect.FieldDescriptor { - return f.ByName(protoreflect.Name(s)) -} - -func (f *fldDescriptors) ByNumber(n protoreflect.FieldNumber) protoreflect.FieldDescriptor { - for _, fld := range f.fields { - if fld.Number() == n { - return fld - } - } - return nil -} - -type fldDescriptor struct { - protoreflect.FieldDescriptor - file *result - parent protoreflect.Descriptor - index int - proto *descriptorpb.FieldDescriptorProto - fqn string - - msgType protoreflect.MessageDescriptor - extendee protoreflect.MessageDescriptor - enumType protoreflect.EnumDescriptor - oneof protoreflect.OneofDescriptor -} - -var _ protoreflect.FieldDescriptor = (*fldDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*fldDescriptor)(nil) - -func (r *result) createFieldDescriptor(fd *descriptorpb.FieldDescriptorProto, parent *msgDescriptor, index int, fqn string) *fldDescriptor { - ret := &fldDescriptor{file: r, parent: parent, index: index, proto: fd, fqn: fqn} - r.descriptors[fqn] = ret - return ret -} - -func (f *fldDescriptor) FieldDescriptorProto() *descriptorpb.FieldDescriptorProto { - return f.proto -} - -func (f *fldDescriptor) AsProto() proto.Message { - return f.proto -} - -func (f *fldDescriptor) ParentFile() protoreflect.FileDescriptor { - return f.file -} - -func (f *fldDescriptor) Parent() protoreflect.Descriptor { - return f.parent -} - -func (f *fldDescriptor) Index() int { - return f.index -} - -func (f *fldDescriptor) Syntax() protoreflect.Syntax { - return f.file.Syntax() -} - -func (f *fldDescriptor) Name() protoreflect.Name { - return protoreflect.Name(f.proto.GetName()) -} - -func (f *fldDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(f.fqn) -} - -func (f *fldDescriptor) IsPlaceholder() bool { - return false -} - -func (f *fldDescriptor) Options() protoreflect.ProtoMessage { - return f.proto.Options -} - -func (f *fldDescriptor) Number() protoreflect.FieldNumber { - return protoreflect.FieldNumber(f.proto.GetNumber()) -} - -func (f *fldDescriptor) Cardinality() protoreflect.Cardinality { - switch f.proto.GetLabel() { - case descriptorpb.FieldDescriptorProto_LABEL_REPEATED: - return protoreflect.Repeated - case descriptorpb.FieldDescriptorProto_LABEL_REQUIRED: - return protoreflect.Required - case descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL: - return protoreflect.Optional - default: - return 0 - } -} - -func (f *fldDescriptor) Kind() protoreflect.Kind { - return protoreflect.Kind(f.proto.GetType()) -} - -func (f *fldDescriptor) HasJSONName() bool { - return f.proto.JsonName != nil -} - -func (f *fldDescriptor) JSONName() string { - if f.IsExtension() { - return f.TextName() - } - return f.proto.GetJsonName() -} - -func (f *fldDescriptor) TextName() string { - if f.IsExtension() { - return fmt.Sprintf("[%s]", f.FullName()) - } - return string(f.Name()) -} - -func (f *fldDescriptor) HasPresence() bool { - if f.proto.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return false - } - return f.IsExtension() || - f.Syntax() == protoreflect.Proto2 || - f.Kind() == protoreflect.MessageKind || f.Kind() == protoreflect.GroupKind || - f.proto.OneofIndex != nil -} - -func (f *fldDescriptor) IsExtension() bool { - return f.proto.GetExtendee() != "" -} - -func (f *fldDescriptor) HasOptionalKeyword() bool { - if f.proto.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL { - return false - } - if f.proto.GetProto3Optional() { - // NB: This smells weird to return false here. If the proto3_optional field - // is set, it's because the keyword WAS present. However, the Go runtime - // returns false for this case, so we mirror that behavior. - return !f.IsExtension() - } - // If it's optional, but not a proto3 optional, then the keyword is only - // present for proto2 files, for fields that are not part of a oneof. - return f.file.Syntax() == protoreflect.Proto2 && f.proto.OneofIndex == nil -} - -func (f *fldDescriptor) IsWeak() bool { - return f.proto.Options.GetWeak() -} - -func (f *fldDescriptor) IsPacked() bool { - opts := f.proto.GetOptions() - if opts.GetPacked() { - return true - } - if opts != nil && opts.Packed != nil { - // explicitly not packed - return false - } - - // proto3 defaults to packed for repeated scalar numeric fields - if f.file.Syntax() != protoreflect.Proto3 { - return false - } - if f.proto.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return false - } - switch f.proto.GetType() { - case descriptorpb.FieldDescriptorProto_TYPE_GROUP, descriptorpb.FieldDescriptorProto_TYPE_MESSAGE, - descriptorpb.FieldDescriptorProto_TYPE_BYTES, descriptorpb.FieldDescriptorProto_TYPE_STRING: - return false - default: - // all others can be packed - return true - } -} - -func (f *fldDescriptor) IsList() bool { - if f.proto.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return false - } - return !f.isMapEntry() -} - -func (f *fldDescriptor) IsMap() bool { - if f.proto.GetLabel() != descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return false - } - if f.IsExtension() { - return false - } - return f.isMapEntry() -} - -func (f *fldDescriptor) isMapEntry() bool { - if f.proto.GetType() != descriptorpb.FieldDescriptorProto_TYPE_MESSAGE { - return false - } - return f.Message().IsMapEntry() -} - -func (f *fldDescriptor) MapKey() protoreflect.FieldDescriptor { - if !f.IsMap() { - return nil - } - return f.Message().Fields().ByNumber(1) -} - -func (f *fldDescriptor) MapValue() protoreflect.FieldDescriptor { - if !f.IsMap() { - return nil - } - return f.Message().Fields().ByNumber(2) -} - -func (f *fldDescriptor) HasDefault() bool { - return f.proto.DefaultValue != nil -} - -func (f *fldDescriptor) Default() protoreflect.Value { - // We only return a valid value for scalar fields - if f.proto.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED || - f.Kind() == protoreflect.GroupKind || f.Kind() == protoreflect.MessageKind { - return protoreflect.Value{} - } - - if f.proto.DefaultValue != nil { - defVal := f.parseDefaultValue(f.proto.GetDefaultValue()) - if defVal.IsValid() { - return defVal - } - // if we cannot parse a valid value, fall back to zero value below - } - - // No custom default value, so return the zero value for the type - switch f.Kind() { - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - return protoreflect.ValueOfInt32(0) - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - return protoreflect.ValueOfInt64(0) - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - return protoreflect.ValueOfUint32(0) - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - return protoreflect.ValueOfUint64(0) - case protoreflect.FloatKind: - return protoreflect.ValueOfFloat32(0) - case protoreflect.DoubleKind: - return protoreflect.ValueOfFloat64(0) - case protoreflect.BoolKind: - return protoreflect.ValueOfBool(false) - case protoreflect.BytesKind: - return protoreflect.ValueOfBytes(nil) - case protoreflect.StringKind: - return protoreflect.ValueOfString("") - case protoreflect.EnumKind: - return protoreflect.ValueOfEnum(f.Enum().Values().Get(0).Number()) - case protoreflect.GroupKind, protoreflect.MessageKind: - return protoreflect.ValueOfMessage(dynamicpb.NewMessage(f.Message())) - default: - panic(fmt.Sprintf("unknown kind: %v", f.Kind())) - } -} - -func (f *fldDescriptor) parseDefaultValue(val string) protoreflect.Value { - switch f.Kind() { - case protoreflect.EnumKind: - vd := f.Enum().Values().ByName(protoreflect.Name(val)) - if vd != nil { - return protoreflect.ValueOfEnum(vd.Number()) - } - return protoreflect.Value{} - case protoreflect.BoolKind: - switch val { - case "true": - return protoreflect.ValueOfBool(true) - case "false": - return protoreflect.ValueOfBool(false) - default: - return protoreflect.Value{} - } - case protoreflect.BytesKind: - return protoreflect.ValueOfBytes([]byte(unescape(val))) - case protoreflect.StringKind: - return protoreflect.ValueOfString(val) - case protoreflect.FloatKind: - if f, err := strconv.ParseFloat(val, 32); err == nil { - return protoreflect.ValueOfFloat32(float32(f)) - } - return protoreflect.Value{} - case protoreflect.DoubleKind: - if f, err := strconv.ParseFloat(val, 64); err == nil { - return protoreflect.ValueOfFloat64(f) - } - return protoreflect.Value{} - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - if i, err := strconv.ParseInt(val, 10, 32); err == nil { - return protoreflect.ValueOfInt32(int32(i)) - } - return protoreflect.Value{} - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - if i, err := strconv.ParseUint(val, 10, 32); err == nil { - return protoreflect.ValueOfUint32(uint32(i)) - } - return protoreflect.Value{} - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - if i, err := strconv.ParseInt(val, 10, 64); err == nil { - return protoreflect.ValueOfInt64(i) - } - return protoreflect.Value{} - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - if i, err := strconv.ParseUint(val, 10, 64); err == nil { - return protoreflect.ValueOfUint64(i) - } - return protoreflect.Value{} - default: - return protoreflect.Value{} - } -} - -func unescape(s string) string { - // protoc encodes default values for 'bytes' fields using C escaping, - // so this function reverses that escaping - out := make([]byte, 0, len(s)) - var buf [4]byte - for len(s) > 0 { - if s[0] != '\\' || len(s) < 2 { - // not escape sequence, or too short to be well-formed escape - out = append(out, s[0]) - s = s[1:] - continue - } - nextIndex := 2 // by default, skip '\' + escaped character - switch s[1] { - case 'x', 'X': - n := matchPrefix(s[2:], 2, isHex) - if n == 0 { - // bad escape - out = append(out, s[:2]...) - } else { - c, err := strconv.ParseUint(s[2:2+n], 16, 8) - if err != nil { - // shouldn't really happen... - out = append(out, s[:2+n]...) - } else { - out = append(out, byte(c)) - } - nextIndex = 2 + n - } - case '0', '1', '2', '3', '4', '5', '6', '7': - n := 1 + matchPrefix(s[2:], 2, isOctal) - c, err := strconv.ParseUint(s[1:1+n], 8, 8) - if err != nil || c > 0xff { - out = append(out, s[:1+n]...) - } else { - out = append(out, byte(c)) - } - nextIndex = 1 + n - case 'u': - if len(s) < 6 { - // bad escape - out = append(out, s...) - nextIndex = len(s) - } else { - c, err := strconv.ParseUint(s[2:6], 16, 16) - if err != nil { - // bad escape - out = append(out, s[:6]...) - } else { - w := utf8.EncodeRune(buf[:], rune(c)) - out = append(out, buf[:w]...) - } - nextIndex = 6 - } - case 'U': - if len(s) < 10 { - // bad escape - out = append(out, s...) - nextIndex = len(s) - } else { - c, err := strconv.ParseUint(s[2:10], 16, 32) - if err != nil || c > 0x10ffff { - // bad escape - out = append(out, s[:10]...) - } else { - w := utf8.EncodeRune(buf[:], rune(c)) - out = append(out, buf[:w]...) - } - nextIndex = 10 - } - case 'a': - out = append(out, '\a') - case 'b': - out = append(out, '\b') - case 'f': - out = append(out, '\f') - case 'n': - out = append(out, '\n') - case 'r': - out = append(out, '\r') - case 't': - out = append(out, '\t') - case 'v': - out = append(out, '\v') - case '\\', '\'', '"', '?': - out = append(out, s[1]) - default: - // invalid escape, just copy it as-is - out = append(out, s[:2]...) - } - s = s[nextIndex:] - } - return string(out) -} - -func isOctal(b byte) bool { return b >= '0' && b <= '7' } -func isHex(b byte) bool { - return (b >= '0' && b <= '9') || (b >= 'a' && b <= 'f') || (b >= 'A' && b <= 'F') -} -func matchPrefix(s string, limit int, fn func(byte) bool) int { - l := len(s) - if l > limit { - l = limit - } - i := 0 - for ; i < l; i++ { - if !fn(s[i]) { - return i - } - } - return i -} - -func (f *fldDescriptor) DefaultEnumValue() protoreflect.EnumValueDescriptor { - ed := f.Enum() - if ed == nil { - return nil - } - if f.proto.DefaultValue != nil { - if val := ed.Values().ByName(protoreflect.Name(f.proto.GetDefaultValue())); val != nil { - return val - } - } - // if no default specified in source, return nil - return nil -} - -func (f *fldDescriptor) ContainingOneof() protoreflect.OneofDescriptor { - return f.oneof -} - -func (f *fldDescriptor) ContainingMessage() protoreflect.MessageDescriptor { - if f.extendee != nil { - return f.extendee - } - return f.parent.(protoreflect.MessageDescriptor) -} - -func (f *fldDescriptor) Enum() protoreflect.EnumDescriptor { - return f.enumType -} - -func (f *fldDescriptor) Message() protoreflect.MessageDescriptor { - return f.msgType -} - -type oneofDescriptors struct { - protoreflect.OneofDescriptors - oneofs []*oneofDescriptor -} - -func (r *result) createOneOfs(prefix string, parent *msgDescriptor, ooProtos []*descriptorpb.OneofDescriptorProto) oneofDescriptors { - oos := make([]*oneofDescriptor, len(ooProtos)) - for i, fldProto := range ooProtos { - oos[i] = r.createOneOfDescriptor(fldProto, parent, i, prefix+fldProto.GetName()) - } - return oneofDescriptors{oneofs: oos} -} - -func (o *oneofDescriptors) Len() int { - return len(o.oneofs) -} - -func (o *oneofDescriptors) Get(i int) protoreflect.OneofDescriptor { - return o.oneofs[i] -} - -func (o *oneofDescriptors) ByName(s protoreflect.Name) protoreflect.OneofDescriptor { - for _, oo := range o.oneofs { - if oo.Name() == s { - return oo - } - } - return nil -} - -type oneofDescriptor struct { - protoreflect.OneofDescriptor - file *result - parent *msgDescriptor - index int - proto *descriptorpb.OneofDescriptorProto - fqn string - - fields fldDescriptors -} - -var _ protoreflect.OneofDescriptor = (*oneofDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*oneofDescriptor)(nil) - -func (r *result) createOneOfDescriptor(ood *descriptorpb.OneofDescriptorProto, parent *msgDescriptor, index int, fqn string) *oneofDescriptor { - ret := &oneofDescriptor{file: r, parent: parent, index: index, proto: ood, fqn: fqn} - r.descriptors[fqn] = ret - - var fields []*fldDescriptor - for _, fld := range parent.fields.fields { - if fld.proto.OneofIndex != nil && int(fld.proto.GetOneofIndex()) == index { - fields = append(fields, fld) - } - } - ret.fields = fldDescriptors{fields: fields} - - return ret -} - -func (o *oneofDescriptor) OneOfDescriptorProto() *descriptorpb.OneofDescriptorProto { - return o.proto -} - -func (o *oneofDescriptor) AsProto() proto.Message { - return o.proto -} - -func (o *oneofDescriptor) ParentFile() protoreflect.FileDescriptor { - return o.file -} - -func (o *oneofDescriptor) Parent() protoreflect.Descriptor { - return o.parent -} - -func (o *oneofDescriptor) Index() int { - return o.index -} - -func (o *oneofDescriptor) Syntax() protoreflect.Syntax { - return o.file.Syntax() -} - -func (o *oneofDescriptor) Name() protoreflect.Name { - return protoreflect.Name(o.proto.GetName()) -} - -func (o *oneofDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(o.fqn) -} - -func (o *oneofDescriptor) IsPlaceholder() bool { - return false -} - -func (o *oneofDescriptor) Options() protoreflect.ProtoMessage { - return o.proto.Options -} - -func (o *oneofDescriptor) IsSynthetic() bool { - for _, fld := range o.parent.proto.GetField() { - if fld.OneofIndex != nil && int(fld.GetOneofIndex()) == o.index { - return fld.GetProto3Optional() - } - } - return false // NB: we should never get here -} - -func (o *oneofDescriptor) Fields() protoreflect.FieldDescriptors { - return &o.fields -} - -type svcDescriptors struct { - protoreflect.ServiceDescriptors - svcs []*svcDescriptor -} - -func (r *result) createServices(prefix string, svcProtos []*descriptorpb.ServiceDescriptorProto) svcDescriptors { - svcs := make([]*svcDescriptor, len(svcProtos)) - for i, svcProto := range svcProtos { - svcs[i] = r.createServiceDescriptor(svcProto, i, prefix+svcProto.GetName()) - } - return svcDescriptors{svcs: svcs} -} - -func (s *svcDescriptors) Len() int { - return len(s.svcs) -} - -func (s *svcDescriptors) Get(i int) protoreflect.ServiceDescriptor { - return s.svcs[i] -} - -func (s *svcDescriptors) ByName(n protoreflect.Name) protoreflect.ServiceDescriptor { - for _, svc := range s.svcs { - if svc.Name() == n { - return svc - } - } - return nil -} - -type svcDescriptor struct { - protoreflect.ServiceDescriptor - file *result - index int - proto *descriptorpb.ServiceDescriptorProto - fqn string - - methods mtdDescriptors -} - -var _ protoreflect.ServiceDescriptor = (*svcDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*svcDescriptor)(nil) - -func (r *result) createServiceDescriptor(sd *descriptorpb.ServiceDescriptorProto, index int, fqn string) *svcDescriptor { - ret := &svcDescriptor{file: r, index: index, proto: sd, fqn: fqn} - r.descriptors[fqn] = ret - - prefix := fqn + "." - ret.methods = r.createMethods(prefix, ret, sd.Method) - - return ret -} - -func (s *svcDescriptor) ServiceDescriptorProto() *descriptorpb.ServiceDescriptorProto { - return s.proto -} - -func (s *svcDescriptor) AsProto() proto.Message { - return s.proto -} - -func (s *svcDescriptor) ParentFile() protoreflect.FileDescriptor { - return s.file -} - -func (s *svcDescriptor) Parent() protoreflect.Descriptor { - return s.file -} - -func (s *svcDescriptor) Index() int { - return s.index -} - -func (s *svcDescriptor) Syntax() protoreflect.Syntax { - return s.file.Syntax() -} - -func (s *svcDescriptor) Name() protoreflect.Name { - return protoreflect.Name(s.proto.GetName()) -} - -func (s *svcDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(s.fqn) -} - -func (s *svcDescriptor) IsPlaceholder() bool { - return false -} - -func (s *svcDescriptor) Options() protoreflect.ProtoMessage { - return s.proto.Options -} - -func (s *svcDescriptor) Methods() protoreflect.MethodDescriptors { - return &s.methods -} - -type mtdDescriptors struct { - protoreflect.MethodDescriptors - mtds []*mtdDescriptor -} - -func (r *result) createMethods(prefix string, parent *svcDescriptor, mtdProtos []*descriptorpb.MethodDescriptorProto) mtdDescriptors { - mtds := make([]*mtdDescriptor, len(mtdProtos)) - for i, mtdProto := range mtdProtos { - mtds[i] = r.createMethodDescriptor(mtdProto, parent, i, prefix+mtdProto.GetName()) - } - return mtdDescriptors{mtds: mtds} -} - -func (m *mtdDescriptors) Len() int { - return len(m.mtds) -} - -func (m *mtdDescriptors) Get(i int) protoreflect.MethodDescriptor { - return m.mtds[i] -} - -func (m *mtdDescriptors) ByName(n protoreflect.Name) protoreflect.MethodDescriptor { - for _, mtd := range m.mtds { - if mtd.Name() == n { - return mtd - } - } - return nil -} - -type mtdDescriptor struct { - protoreflect.MethodDescriptor - file *result - parent *svcDescriptor - index int - proto *descriptorpb.MethodDescriptorProto - fqn string - - inputType, outputType protoreflect.MessageDescriptor -} - -var _ protoreflect.MethodDescriptor = (*mtdDescriptor)(nil) -var _ protoutil.DescriptorProtoWrapper = (*mtdDescriptor)(nil) - -func (r *result) createMethodDescriptor(mtd *descriptorpb.MethodDescriptorProto, parent *svcDescriptor, index int, fqn string) *mtdDescriptor { - ret := &mtdDescriptor{file: r, parent: parent, index: index, proto: mtd, fqn: fqn} - r.descriptors[fqn] = ret - return ret -} - -func (m *mtdDescriptor) MethodDescriptorProto() *descriptorpb.MethodDescriptorProto { - return m.proto -} - -func (m *mtdDescriptor) AsProto() proto.Message { - return m.proto -} - -func (m *mtdDescriptor) ParentFile() protoreflect.FileDescriptor { - return m.file -} - -func (m *mtdDescriptor) Parent() protoreflect.Descriptor { - return m.parent -} - -func (m *mtdDescriptor) Index() int { - return m.index -} - -func (m *mtdDescriptor) Syntax() protoreflect.Syntax { - return m.file.Syntax() -} - -func (m *mtdDescriptor) Name() protoreflect.Name { - return protoreflect.Name(m.proto.GetName()) -} - -func (m *mtdDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(m.fqn) -} - -func (m *mtdDescriptor) IsPlaceholder() bool { - return false -} - -func (m *mtdDescriptor) Options() protoreflect.ProtoMessage { - return m.proto.Options -} - -func (m *mtdDescriptor) Input() protoreflect.MessageDescriptor { - return m.inputType -} - -func (m *mtdDescriptor) Output() protoreflect.MessageDescriptor { - return m.outputType -} - -func (m *mtdDescriptor) IsStreamingClient() bool { - return m.proto.GetClientStreaming() -} - -func (m *mtdDescriptor) IsStreamingServer() bool { - return m.proto.GetServerStreaming() -} - -func (r *result) FindImportByPath(path string) File { - return r.deps.FindFileByPath(path) -} - -func (r *result) FindExtensionByNumber(msg protoreflect.FullName, tag protoreflect.FieldNumber) protoreflect.ExtensionTypeDescriptor { - return findExtension(r, msg, tag) -} - -func (r *result) FindDescriptorByName(name protoreflect.FullName) protoreflect.Descriptor { - fqn := strings.TrimPrefix(string(name), ".") - return r.descriptors[fqn] -} - -func (r *result) hasSource() bool { - n := r.FileNode() - _, ok := n.(*ast.FileNode) - return ok -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/doc.go b/vendor/github.com/bufbuild/protocompile/linker/doc.go deleted file mode 100644 index 455c2ef689..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/doc.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package linker contains logic and APIs related to linking a protobuf file. -// The process of linking involves resolving all symbol references to the -// referenced descriptor. The result of linking is a "rich" descriptor that -// is more useful than just a descriptor proto since the links allow easy -// traversal of a protobuf type schema and the relationships between elements. -// -// # Files -// -// This package uses an augmentation to protoreflect.FileDescriptor instances -// in the form of the File interface. There are also factory functions for -// promoting a FileDescriptor into a linker.File. This new interface provides -// additional methods for resolving symbols in the file. -// -// This interface is both the result of linking but also an input to the linking -// process, as all dependencies of a file to be linked must be provided in this -// form. The actual result of the Link function, a Result, is an even broader -// interface than File: The linker.Result interface provides even more functions, -// which are needed for subsequent compilation steps: interpreting options and -// generating source code info. -// -// # Symbols -// -// This package has a type named Symbols which represents a symbol table. This -// is usually an internal detail when linking, but callers can provide an -// instance so that symbols across multiple compile/link operations all have -// access to the same table. This allows for detection of cases where multiple -// files try to declare elements with conflicting fully-qualified names or -// declare extensions for a particular extendable message that have conflicting -// tag numbers. -// -// The calling code simply uses the same Symbols instance across all compile -// operations and if any files processed have such conflicts, they can be -// reported. -package linker diff --git a/vendor/github.com/bufbuild/protocompile/linker/files.go b/vendor/github.com/bufbuild/protocompile/linker/files.go deleted file mode 100644 index 06c13491a2..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/files.go +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "fmt" - "strings" - - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/dynamicpb" - - "github.com/bufbuild/protocompile/walk" -) - -// File is like a super-powered protoreflect.FileDescriptor. It includes helpful -// methods for looking up elements in the descriptor and can be used to create a -// resolver for all the file's transitive closure of dependencies. (See -// ResolverFromFile.) -type File interface { - protoreflect.FileDescriptor - // FindDescriptorByName returns the given named element that is defined in - // this file. If no such element exists, nil is returned. - FindDescriptorByName(name protoreflect.FullName) protoreflect.Descriptor - // FindImportByPath returns the File corresponding to the given import path. - // If this file does not import the given path, nil is returned. - FindImportByPath(path string) File - // FindExtensionByNumber returns the extension descriptor for the given tag - // that extends the given message name. If no such extension is defined in this - // file, nil is returned. - FindExtensionByNumber(message protoreflect.FullName, tag protoreflect.FieldNumber) protoreflect.ExtensionTypeDescriptor -} - -// NewFile converts a protoreflect.FileDescriptor to a File. The given deps must -// contain all dependencies/imports of f. Also see NewFileRecursive. -func NewFile(f protoreflect.FileDescriptor, deps Files) (File, error) { - if asFile, ok := f.(File); ok { - return asFile, nil - } - checkedDeps := make(Files, f.Imports().Len()) - for i := 0; i < f.Imports().Len(); i++ { - imprt := f.Imports().Get(i) - dep := deps.FindFileByPath(imprt.Path()) - if dep == nil { - return nil, fmt.Errorf("cannot create File for %q: missing dependency for %q", f.Path(), imprt.Path()) - } - checkedDeps[i] = dep - } - return newFile(f, checkedDeps) -} - -func newFile(f protoreflect.FileDescriptor, deps Files) (File, error) { - descs := map[protoreflect.FullName]protoreflect.Descriptor{} - err := walk.Descriptors(f, func(d protoreflect.Descriptor) error { - if _, ok := descs[d.FullName()]; ok { - return fmt.Errorf("file %q contains multiple elements with the name %s", f.Path(), d.FullName()) - } - descs[d.FullName()] = d - return nil - }) - if err != nil { - return nil, err - } - return &file{ - FileDescriptor: f, - descs: descs, - deps: deps, - }, nil -} - -// NewFileRecursive recursively converts a protoreflect.FileDescriptor to a File. -// If f has any dependencies/imports, they are converted, too, including any and -// all transitive dependencies. -// -// If f already implements File, it is returned unchanged. -func NewFileRecursive(f protoreflect.FileDescriptor) (File, error) { - if asFile, ok := f.(File); ok { - return asFile, nil - } - return newFileRecursive(f, map[protoreflect.FileDescriptor]File{}) -} - -func newFileRecursive(fd protoreflect.FileDescriptor, seen map[protoreflect.FileDescriptor]File) (File, error) { - if res, ok := seen[fd]; ok { - if res == nil { - return nil, fmt.Errorf("import cycle encountered: file %s transitively imports itself", fd.Path()) - } - return res, nil - } - - if f, ok := fd.(File); ok { - seen[fd] = f - return f, nil - } - - seen[fd] = nil - deps := make([]File, fd.Imports().Len()) - for i := 0; i < fd.Imports().Len(); i++ { - imprt := fd.Imports().Get(i) - dep, err := newFileRecursive(imprt, seen) - if err != nil { - return nil, err - } - deps[i] = dep - } - - f, err := newFile(fd, deps) - if err != nil { - return nil, err - } - seen[fd] = f - return f, nil -} - -type file struct { - protoreflect.FileDescriptor - descs map[protoreflect.FullName]protoreflect.Descriptor - deps Files -} - -func (f *file) FindDescriptorByName(name protoreflect.FullName) protoreflect.Descriptor { - return f.descs[name] -} - -func (f *file) FindImportByPath(path string) File { - return f.deps.FindFileByPath(path) -} - -func (f *file) FindExtensionByNumber(msg protoreflect.FullName, tag protoreflect.FieldNumber) protoreflect.ExtensionTypeDescriptor { - return findExtension(f, msg, tag) -} - -var _ File = (*file)(nil) - -// Files represents a set of protobuf files. It is a slice of File values, but -// also provides a method for easily looking up files by path and name. -type Files []File - -// FindFileByPath finds a file in f that has the given path and name. If f -// contains no such file, nil is returned. -func (f Files) FindFileByPath(path string) File { - for _, file := range f { - if file.Path() == path { - return file - } - } - return nil -} - -// AsResolver returns a Resolver that uses f as the source of descriptors. If -// a given query cannot be answered with the files in f, the query will fail -// with a protoregistry.NotFound error. The implementation just delegates calls -// to each file until a result is found. -// -// Also see ResolverFromFile. -func (f Files) AsResolver() Resolver { - return filesResolver(f) -} - -// Resolver is an interface that can resolve various kinds of queries about -// descriptors. It satisfies the resolver interfaces defined in protodesc -// and protoregistry packages. -type Resolver interface { - protodesc.Resolver - protoregistry.MessageTypeResolver - protoregistry.ExtensionTypeResolver -} - -// ResolverFromFile returns a Resolver that can resolve any element that is -// visible to the given file. It will search the given file, its imports, and -// any transitive public imports. -// -// Note that this function does not compute any additional indexes for efficient -// search, so queries generally take linear time, O(n) where n is the number of -// files whose elements are visible to the given file. Queries for an extension -// by number are linear with the number of messages and extensions defined across -// those files. -func ResolverFromFile(f File) Resolver { - return fileResolver{f: f} -} - -type fileResolver struct { - f File -} - -func (r fileResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { - return resolveInFile(r.f, false, nil, func(f File) (protoreflect.FileDescriptor, error) { - if f.Path() == path { - return f, nil - } - return nil, protoregistry.NotFound - }) -} - -func (r fileResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { - return resolveInFile(r.f, false, nil, func(f File) (protoreflect.Descriptor, error) { - if d := f.FindDescriptorByName(name); d != nil { - return d, nil - } - return nil, protoregistry.NotFound - }) -} - -func (r fileResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - return resolveInFile(r.f, false, nil, func(f File) (protoreflect.MessageType, error) { - d := f.FindDescriptorByName(message) - if d != nil { - md, ok := d.(protoreflect.MessageDescriptor) - if !ok { - return nil, fmt.Errorf("%q is %s, not a message", message, descriptorTypeWithArticle(d)) - } - return dynamicpb.NewMessageType(md), nil - } - return nil, protoregistry.NotFound - }) -} - -func (r fileResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - fullName := messageNameFromURL(url) - return r.FindMessageByName(protoreflect.FullName(fullName)) -} - -func messageNameFromURL(url string) string { - lastSlash := strings.LastIndexByte(url, '/') - return url[lastSlash+1:] -} - -func (r fileResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - return resolveInFile(r.f, false, nil, func(f File) (protoreflect.ExtensionType, error) { - d := f.FindDescriptorByName(field) - if d != nil { - fld, ok := d.(protoreflect.FieldDescriptor) - if !ok || !fld.IsExtension() { - return nil, fmt.Errorf("%q is %s, not an extension", field, descriptorTypeWithArticle(d)) - } - if extd, ok := fld.(protoreflect.ExtensionTypeDescriptor); ok { - return extd.Type(), nil - } - return dynamicpb.NewExtensionType(fld), nil - } - return nil, protoregistry.NotFound - }) -} - -func (r fileResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - return resolveInFile(r.f, false, nil, func(f File) (protoreflect.ExtensionType, error) { - ext := findExtension(f, message, field) - if ext != nil { - return ext.Type(), nil - } - return nil, protoregistry.NotFound - }) -} - -type filesResolver []File - -func (r filesResolver) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { - for _, f := range r { - if f.Path() == path { - return f, nil - } - } - return nil, protoregistry.NotFound -} - -func (r filesResolver) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { - for _, f := range r { - result := f.FindDescriptorByName(name) - if result != nil { - return result, nil - } - } - return nil, protoregistry.NotFound -} - -func (r filesResolver) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { - for _, f := range r { - d := f.FindDescriptorByName(message) - if d != nil { - if md, ok := d.(protoreflect.MessageDescriptor); ok { - return dynamicpb.NewMessageType(md), nil - } - return nil, protoregistry.NotFound - } - } - return nil, protoregistry.NotFound -} - -func (r filesResolver) FindMessageByURL(url string) (protoreflect.MessageType, error) { - name := messageNameFromURL(url) - return r.FindMessageByName(protoreflect.FullName(name)) -} - -func (r filesResolver) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { - for _, f := range r { - d := f.FindDescriptorByName(field) - if d != nil { - if extd, ok := d.(protoreflect.ExtensionTypeDescriptor); ok { - return extd.Type(), nil - } - if fld, ok := d.(protoreflect.FieldDescriptor); ok && fld.IsExtension() { - return dynamicpb.NewExtensionType(fld), nil - } - return nil, protoregistry.NotFound - } - } - return nil, protoregistry.NotFound -} - -func (r filesResolver) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { - for _, f := range r { - ext := findExtension(f, message, field) - if ext != nil { - return ext.Type(), nil - } - } - return nil, protoregistry.NotFound -} - -type hasExtensionsAndMessages interface { - Messages() protoreflect.MessageDescriptors - Extensions() protoreflect.ExtensionDescriptors -} - -func findExtension(d hasExtensionsAndMessages, message protoreflect.FullName, field protoreflect.FieldNumber) protoreflect.ExtensionTypeDescriptor { - for i := 0; i < d.Extensions().Len(); i++ { - if extType := isExtensionMatch(d.Extensions().Get(i), message, field); extType != nil { - return extType - } - } - - for i := 0; i < d.Messages().Len(); i++ { - if extType := findExtension(d.Messages().Get(i), message, field); extType != nil { - return extType - } - } - - return nil // could not be found -} - -func isExtensionMatch(ext protoreflect.ExtensionDescriptor, message protoreflect.FullName, field protoreflect.FieldNumber) protoreflect.ExtensionTypeDescriptor { - if ext.Number() != field || ext.ContainingMessage().FullName() != message { - return nil - } - if extType, ok := ext.(protoreflect.ExtensionTypeDescriptor); ok { - return extType - } - return dynamicpb.NewExtensionType(ext).TypeDescriptor() -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/linker.go b/vendor/github.com/bufbuild/protocompile/linker/linker.go deleted file mode 100644 index 345c9bcf48..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/linker.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "fmt" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/reporter" -) - -// Link handles linking a parsed descriptor proto into a fully-linked descriptor. -// If the given parser.Result has imports, they must all be present in the given -// dependencies. -// -// The symbols value is optional and may be nil. If it is not nil, it must be the -// same instance used to create and link all of the given result's dependencies -// (or otherwise already have all dependencies imported). Otherwise, linking may -// fail with spurious errors resolving symbols. -// -// The handler value is used to report any link errors. If any such errors are -// reported, this function returns a non-nil error. The Result value returned -// also implements protoreflect.FileDescriptor. -// -// Note that linking does NOT interpret options. So options messages in the -// returned value have all values stored in UninterpretedOptions fields. -func Link(parsed parser.Result, dependencies Files, symbols *Symbols, handler *reporter.Handler) (Result, error) { - if symbols == nil { - symbols = &Symbols{} - } - prefix := parsed.FileDescriptorProto().GetPackage() - if prefix != "" { - prefix += "." - } - - for _, imp := range parsed.FileDescriptorProto().Dependency { - dep := dependencies.FindFileByPath(imp) - if dep == nil { - return nil, fmt.Errorf("dependencies is missing import %q", imp) - } - if err := symbols.Import(dep, handler); err != nil { - return nil, err - } - } - - r := &result{ - Result: parsed, - deps: dependencies, - descriptors: map[string]protoreflect.Descriptor{}, - usedImports: map[string]struct{}{}, - prefix: prefix, - optionQualifiedNames: map[ast.IdentValueNode]string{}, - } - - // First, we put all symbols into a single pool, which lets us ensure there - // are no duplicate symbols and will also let us resolve and revise all type - // references in next step. - if err := symbols.importResult(r, handler); err != nil { - return nil, err - } - - // After we've populated the pool, we can now try to resolve all type - // references. All references must be checked for correct type, any fields - // with enum types must be corrected (since we parse them as if they are - // message references since we don't actually know message or enum until - // link time), and references will be re-written to be fully-qualified - // references (e.g. start with a dot "."). - if err := r.resolveReferences(handler, symbols); err != nil { - return nil, err - } - - return r, handler.Error() -} - -// Result is the result of linking. This is a protoreflect.FileDescriptor, but -// with some additional methods for exposing additional information, such as the -// for accessing the input AST or file descriptor. -// -// It also provides Resolve* methods, for looking up enums, messages, and -// extensions that are available to the protobuf source file this result -// represents. An element is "available" if it meets any of the following -// criteria: -// 1. The element is defined in this file itself. -// 2. The element is defined in a file that is directly imported by this file. -// 3. The element is "available" to a file that is directly imported by this -// file as a public import. -// -// Other elements, even if in the transitive closure of this file, are not -// available and thus won't be returned by these methods. -type Result interface { - File - parser.Result - - // ResolveMessageLiteralExtensionName returns the fully qualified name for - // an identifier for extension field names in message literals. - ResolveMessageLiteralExtensionName(ast.IdentValueNode) string - // ValidateOptions runs some validation checks on the descriptor that can only - // be done after options are interpreted. Any errors or warnings encountered - // will be reported via the given handler. If any error is reported, this - // function returns a non-nil error. - ValidateOptions(handler *reporter.Handler) error - // CheckForUnusedImports is used to report warnings for unused imports. This - // should be called after options have been interpreted. Otherwise, the logic - // could incorrectly report imports as unused if the only symbol used were a - // custom option. - CheckForUnusedImports(handler *reporter.Handler) - // PopulateSourceCodeInfo is used to populate source code info for the file - // descriptor. This step requires that the underlying descriptor proto have - // its `source_code_info` field populated. This is typically a post-process - // step separate from linking, because computing source code info requires - // interpreting options (which is done after linking). - PopulateSourceCodeInfo() - - // CanonicalProto returns the file descriptor proto in a form that - // will be serialized in a canonical way. The "canonical" way matches - // the way that "protoc" emits option values, which is a way that - // mostly matches the way options are defined in source, including - // ordering and de-structuring. Unlike the FileDescriptorProto() method, this - // method is more expensive and results in a new descriptor proto - // being constructed with each call. - // - // The returned value will have all options (fields of the various - // descriptorpb.*Options message types) represented via unrecognized - // fields. So the returned value will serialize as desired, but it - // is otherwise not useful since all option values are treated as - // unknown. - CanonicalProto() *descriptorpb.FileDescriptorProto - - // RemoveAST drops the AST information from this result. - RemoveAST() -} - -// ErrorUnusedImport may be passed to a warning reporter when an unused -// import is detected. The error the reporter receives will be wrapped -// with source position that indicates the file and line where the import -// statement appeared. -type ErrorUnusedImport interface { - error - UnusedImport() string -} - -type errUnusedImport string - -func (e errUnusedImport) Error() string { - return fmt.Sprintf("import %q not used", string(e)) -} - -func (e errUnusedImport) UnusedImport() string { - return string(e) -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/pathkey_no_unsafe.go b/vendor/github.com/bufbuild/protocompile/linker/pathkey_no_unsafe.go deleted file mode 100644 index 89475e6931..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/pathkey_no_unsafe.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build appengine || gopherjs || purego -// +build appengine gopherjs purego - -// NB: other environments where unsafe is inappropriate should use "purego" build tag -// https://github.com/golang/go/issues/23172 - -package linker - -import ( - "reflect" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -func pathKey(p protoreflect.SourcePath) interface{} { - rv := reflect.ValueOf(p) - arrayType := reflect.ArrayOf(rv.Len(), rv.Type().Elem()) - array := reflect.New(arrayType).Elem() - reflect.Copy(array, rv) - return array.Interface() -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go b/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go deleted file mode 100644 index cf0d0c2662..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/pathkey_unsafe.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build !appengine && !gopherjs && !purego -// +build !appengine,!gopherjs,!purego - -// NB: other environments where unsafe is inappropriate should use "purego" build tag -// https://github.com/golang/go/issues/23172 - -package linker - -import ( - "reflect" - "unsafe" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -var pathElementType = reflect.TypeOf(protoreflect.SourcePath{}).Elem() - -func pathKey(p protoreflect.SourcePath) interface{} { - hdr := (*reflect.SliceHeader)(unsafe.Pointer(reflect.ValueOf(&p).Pointer())) - array := reflect.NewAt(reflect.ArrayOf(hdr.Len, pathElementType), unsafe.Pointer(hdr.Data)) - return array.Elem().Interface() -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/resolve.go b/vendor/github.com/bufbuild/protocompile/linker/resolve.go deleted file mode 100644 index f79d1a533f..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/resolve.go +++ /dev/null @@ -1,801 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "errors" - "fmt" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/reporter" - "github.com/bufbuild/protocompile/walk" -) - -func (r *result) ResolveMessageLiteralExtensionName(node ast.IdentValueNode) string { - return r.optionQualifiedNames[node] -} - -func (r *result) resolveElement(name protoreflect.FullName) protoreflect.Descriptor { - if len(name) > 0 && name[0] == '.' { - name = name[1:] - } - res, _ := resolveInFile(r, false, nil, func(f File) (protoreflect.Descriptor, error) { - d := resolveElementInFile(name, f) - if d != nil { - return d, nil - } - return nil, protoregistry.NotFound - }) - return res -} - -func resolveInFile[T any](f File, publicImportsOnly bool, checked []string, fn func(File) (T, error)) (T, error) { - var zero T - path := f.Path() - for _, str := range checked { - if str == path { - // already checked - return zero, protoregistry.NotFound - } - } - checked = append(checked, path) - - res, err := fn(f) - if err == nil { - // found it - return res, nil - } - if !errors.Is(err, protoregistry.NotFound) { - return zero, err - } - - imports := f.Imports() - for i, l := 0, imports.Len(); i < l; i++ { - imp := imports.Get(i) - if publicImportsOnly && !imp.IsPublic { - continue - } - res, err := resolveInFile(f.FindImportByPath(imp.Path()), true, checked, fn) - if errors.Is(err, protoregistry.NotFound) { - continue - } - if err != nil { - return zero, err - } - if !imp.IsPublic { - if r, ok := f.(*result); ok { - r.markUsed(imp.Path()) - } - } - return res, nil - } - return zero, err -} - -func (r *result) markUsed(importPath string) { - r.usedImports[importPath] = struct{}{} -} - -func (r *result) CheckForUnusedImports(handler *reporter.Handler) { - fd := r.FileDescriptorProto() - file, _ := r.FileNode().(*ast.FileNode) - for i, dep := range fd.Dependency { - if _, ok := r.usedImports[dep]; !ok { - isPublic := false - // it's fine if it's a public import - for _, j := range fd.PublicDependency { - if i == int(j) { - isPublic = true - break - } - } - if isPublic { - continue - } - pos := ast.UnknownPos(fd.GetName()) - if file != nil { - for _, decl := range file.Decls { - imp, ok := decl.(*ast.ImportNode) - if ok && imp.Name.AsString() == dep { - pos = file.NodeInfo(imp).Start() - } - } - } - handler.HandleWarningWithPos(pos, errUnusedImport(dep)) - } - } -} - -func descriptorTypeWithArticle(d protoreflect.Descriptor) string { - switch d := d.(type) { - case protoreflect.MessageDescriptor: - return "a message" - case protoreflect.FieldDescriptor: - if d.IsExtension() { - return "an extension" - } - return "a field" - case protoreflect.OneofDescriptor: - return "a oneof" - case protoreflect.EnumDescriptor: - return "an enum" - case protoreflect.EnumValueDescriptor: - return "an enum value" - case protoreflect.ServiceDescriptor: - return "a service" - case protoreflect.MethodDescriptor: - return "a method" - case protoreflect.FileDescriptor: - return "a file" - default: - // shouldn't be possible - return fmt.Sprintf("a %T", d) - } -} - -func (r *result) resolveReferences(handler *reporter.Handler, s *Symbols) error { - // first create the full descriptor hierarchy - fd := r.FileDescriptorProto() - prefix := "" - if fd.GetPackage() != "" { - prefix = fd.GetPackage() + "." - } - r.imports = r.createImports() - r.messages = r.createMessages(prefix, r, fd.MessageType) - r.enums = r.createEnums(prefix, r, fd.EnumType) - r.extensions = r.createExtensions(prefix, r, fd.Extension) - r.services = r.createServices(prefix, fd.Service) - - // then resolve symbol references - scopes := []scope{fileScope(r)} - if fd.Options != nil { - if err := r.resolveOptions(handler, "file", protoreflect.FullName(fd.GetName()), fd.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - - return walk.DescriptorsEnterAndExit(r, - func(d protoreflect.Descriptor) error { - fqn := d.FullName() - switch d := d.(type) { - case *msgDescriptor: - // Strangely, when protoc resolves extension names, it uses the *enclosing* scope - // instead of the message's scope. So if the message contains an extension named "i", - // an option cannot refer to it as simply "i" but must qualify it (at a minimum "Msg.i"). - // So we don't add this messages scope to our scopes slice until *after* we do options. - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "message", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - scopes = append(scopes, messageScope(r, fqn)) // push new scope on entry - // walk only visits descriptors, so we need to loop over extension ranges ourselves - for _, er := range d.proto.ExtensionRange { - if er.Options != nil { - erName := protoreflect.FullName(fmt.Sprintf("%s:%d-%d", fqn, er.GetStart(), er.GetEnd()-1)) - if err := r.resolveOptions(handler, "extension range", erName, er.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - } - case *extTypeDescriptor: - if d.field.proto.Options != nil { - if err := r.resolveOptions(handler, "extension", fqn, d.field.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - if err := resolveFieldTypes(d.field, handler, s, scopes); err != nil { - return err - } - if r.Syntax() == protoreflect.Proto3 && !allowedProto3Extendee(d.field.proto.GetExtendee()) { - file := r.FileNode() - node := r.FieldNode(d.field.proto).FieldExtendee() - if err := handler.HandleErrorf(file.NodeInfo(node).Start(), "extend blocks in proto3 can only be used to define custom options"); err != nil { - return err - } - } - case *fldDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "field", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - if err := resolveFieldTypes(d, handler, s, scopes); err != nil { - return err - } - case *oneofDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "oneof", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - case *enumDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "enum", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - case *enValDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "enum value", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - case *svcDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "service", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - // not a message, but same scoping rules for nested elements as if it were - scopes = append(scopes, messageScope(r, fqn)) // push new scope on entry - case *mtdDescriptor: - if d.proto.Options != nil { - if err := r.resolveOptions(handler, "method", fqn, d.proto.Options.UninterpretedOption, scopes); err != nil { - return err - } - } - if err := resolveMethodTypes(d, handler, scopes); err != nil { - return err - } - } - return nil - }, - func(d protoreflect.Descriptor) error { - switch d.(type) { - case protoreflect.MessageDescriptor, protoreflect.ServiceDescriptor: - // pop message scope on exit - scopes = scopes[:len(scopes)-1] - } - return nil - }) -} - -var allowedProto3Extendees = map[string]struct{}{ - ".google.protobuf.FileOptions": {}, - ".google.protobuf.MessageOptions": {}, - ".google.protobuf.FieldOptions": {}, - ".google.protobuf.OneofOptions": {}, - ".google.protobuf.ExtensionRangeOptions": {}, - ".google.protobuf.EnumOptions": {}, - ".google.protobuf.EnumValueOptions": {}, - ".google.protobuf.ServiceOptions": {}, - ".google.protobuf.MethodOptions": {}, -} - -func allowedProto3Extendee(n string) bool { - if n == "" { - // not an extension, allowed - return true - } - _, ok := allowedProto3Extendees[n] - return ok -} - -func resolveFieldTypes(f *fldDescriptor, handler *reporter.Handler, s *Symbols, scopes []scope) error { - r := f.file - fld := f.proto - file := r.FileNode() - node := r.FieldNode(fld) - scope := fmt.Sprintf("field %s", f.fqn) - if fld.GetExtendee() != "" { - scope := fmt.Sprintf("extension %s", f.fqn) - dsc := r.resolve(fld.GetExtendee(), false, scopes) - if dsc == nil { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "unknown extendee type %s", fld.GetExtendee()) - } - if isSentinelDescriptor(dsc) { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "unknown extendee type %s; resolved to %s which is not defined; consider using a leading dot", fld.GetExtendee(), dsc.FullName()) - } - extd, ok := dsc.(protoreflect.MessageDescriptor) - if !ok { - return handler.HandleErrorf(file.NodeInfo(node.FieldExtendee()).Start(), "extendee is invalid: %s is %s, not a message", dsc.FullName(), descriptorTypeWithArticle(dsc)) - } - f.extendee = extd - extendeeName := "." + string(dsc.FullName()) - if fld.GetExtendee() != extendeeName { - fld.Extendee = proto.String(extendeeName) - } - // make sure the tag number is in range - found := false - tag := protoreflect.FieldNumber(fld.GetNumber()) - for i := 0; i < extd.ExtensionRanges().Len(); i++ { - rng := extd.ExtensionRanges().Get(i) - if tag >= rng[0] && tag < rng[1] { - found = true - break - } - } - if !found { - if err := handler.HandleErrorf(file.NodeInfo(node.FieldTag()).Start(), "%s: tag %d is not in valid range for extended type %s", scope, tag, dsc.FullName()); err != nil { - return err - } - } else { - // make sure tag is not a duplicate - if err := s.AddExtension(packageFor(dsc), dsc.FullName(), tag, file.NodeInfo(node.FieldTag()).Start(), handler); err != nil { - return err - } - } - } else if f.proto.OneofIndex != nil { - parent := f.parent.(protoreflect.MessageDescriptor) //nolint:errcheck - index := int(f.proto.GetOneofIndex()) - f.oneof = parent.Oneofs().Get(index) - } - - if fld.GetTypeName() == "" { - // scalar type; no further resolution required - return nil - } - - dsc := r.resolve(fld.GetTypeName(), true, scopes) - if dsc == nil { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: unknown type %s", scope, fld.GetTypeName()) - } - if isSentinelDescriptor(dsc) { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: unknown type %s; resolved to %s which is not defined; consider using a leading dot", scope, fld.GetTypeName(), dsc.FullName()) - } - switch dsc := dsc.(type) { - case protoreflect.MessageDescriptor: - if dsc.IsMapEntry() { - isValid := false - switch node.(type) { - case *ast.MapFieldNode: - // We have an AST for this file and can see this field is from a map declaration - isValid = true - case ast.NoSourceNode: - // We don't have an AST for the file (it came from a provided descriptor). So we - // need to validate that it's not an illegal reference. To be valid, the field - // must be repeated and the entry type must be nested in the same enclosing - // message as the field. - isValid = isValidMap(f, dsc) - if isValid && f.index > 0 { - // also make sure there are no earlier fields that are valid for this map entry - flds := f.Parent().(protoreflect.MessageDescriptor).Fields() - for i := 0; i < f.index; i++ { - if isValidMap(flds.Get(i), dsc) { - isValid = false - break - } - } - } - } - if !isValid { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: %s is a synthetic map entry and may not be referenced explicitly", scope, dsc.FullName()) - } - } - typeName := "." + string(dsc.FullName()) - if fld.GetTypeName() != typeName { - fld.TypeName = proto.String(typeName) - } - if fld.Type == nil { - // if type was tentatively unset, we now know it's actually a message - fld.Type = descriptorpb.FieldDescriptorProto_TYPE_MESSAGE.Enum() - } else if fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_MESSAGE && fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_GROUP { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_MESSAGE) - } - f.msgType = dsc - case protoreflect.EnumDescriptor: - proto3 := r.Syntax() == protoreflect.Proto3 - enumIsProto3 := dsc.Syntax() == protoreflect.Proto3 - if fld.GetExtendee() == "" && proto3 && !enumIsProto3 { - // fields in a proto3 message cannot refer to proto2 enums - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: cannot use proto2 enum %s in a proto3 message", scope, fld.GetTypeName()) - } - typeName := "." + string(dsc.FullName()) - if fld.GetTypeName() != typeName { - fld.TypeName = proto.String(typeName) - } - if fld.Type == nil { - // the type was tentatively unset, but now we know it's actually an enum - fld.Type = descriptorpb.FieldDescriptorProto_TYPE_ENUM.Enum() - } else if fld.GetType() != descriptorpb.FieldDescriptorProto_TYPE_ENUM { - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: descriptor proto indicates type %v but should be %v", scope, fld.GetType(), descriptorpb.FieldDescriptorProto_TYPE_ENUM) - } - f.enumType = dsc - default: - return handler.HandleErrorf(file.NodeInfo(node.FieldType()).Start(), "%s: invalid type: %s is %s, not a message or enum", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)) - } - return nil -} - -func packageFor(dsc protoreflect.Descriptor) protoreflect.FullName { - if dsc.ParentFile() != nil { - return dsc.ParentFile().Package() - } - // Can't access package? Make a best effort guess. - return dsc.FullName().Parent() -} - -func isValidMap(mapField protoreflect.FieldDescriptor, mapEntry protoreflect.MessageDescriptor) bool { - return !mapField.IsExtension() && - mapEntry.Parent() == mapField.ContainingMessage() && - mapField.Cardinality() == protoreflect.Repeated && - string(mapEntry.Name()) == internal.InitCap(internal.JSONName(string(mapField.Name())))+"Entry" -} - -func resolveMethodTypes(m *mtdDescriptor, handler *reporter.Handler, scopes []scope) error { - scope := fmt.Sprintf("method %s", m.fqn) - r := m.file - mtd := m.proto - file := r.FileNode() - node := r.MethodNode(mtd) - dsc := r.resolve(mtd.GetInputType(), false, scopes) - if dsc == nil { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: unknown request type %s", scope, mtd.GetInputType()); err != nil { - return err - } - } else if isSentinelDescriptor(dsc) { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: unknown request type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetInputType(), dsc.FullName()); err != nil { - return err - } - } else if msg, ok := dsc.(protoreflect.MessageDescriptor); !ok { - if err := handler.HandleErrorf(file.NodeInfo(node.GetInputType()).Start(), "%s: invalid request type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { - return err - } - } else { - typeName := "." + string(dsc.FullName()) - if mtd.GetInputType() != typeName { - mtd.InputType = proto.String(typeName) - } - m.inputType = msg - } - - // TODO: make input and output type resolution more DRY - dsc = r.resolve(mtd.GetOutputType(), false, scopes) - if dsc == nil { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: unknown response type %s", scope, mtd.GetOutputType()); err != nil { - return err - } - } else if isSentinelDescriptor(dsc) { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: unknown response type %s; resolved to %s which is not defined; consider using a leading dot", scope, mtd.GetOutputType(), dsc.FullName()); err != nil { - return err - } - } else if msg, ok := dsc.(protoreflect.MessageDescriptor); !ok { - if err := handler.HandleErrorf(file.NodeInfo(node.GetOutputType()).Start(), "%s: invalid response type: %s is %s, not a message", scope, dsc.FullName(), descriptorTypeWithArticle(dsc)); err != nil { - return err - } - } else { - typeName := "." + string(dsc.FullName()) - if mtd.GetOutputType() != typeName { - mtd.OutputType = proto.String(typeName) - } - m.outputType = msg - } - - return nil -} - -func (r *result) resolveOptions(handler *reporter.Handler, elemType string, elemName protoreflect.FullName, opts []*descriptorpb.UninterpretedOption, scopes []scope) error { - mc := &internal.MessageContext{ - File: r, - ElementName: string(elemName), - ElementType: elemType, - } - file := r.FileNode() -opts: - for _, opt := range opts { - // resolve any extension names found in option names - for _, nm := range opt.Name { - if nm.GetIsExtension() { - node := r.OptionNamePartNode(nm) - fqn, err := r.resolveExtensionName(nm.GetNamePart(), scopes) - if err != nil { - if err := handler.HandleErrorf(file.NodeInfo(node).Start(), "%v%v", mc, err); err != nil { - return err - } - continue opts - } - nm.NamePart = proto.String(fqn) - } - } - // also resolve any extension names found inside message literals in option values - mc.Option = opt - optVal := r.OptionNode(opt).GetValue() - if err := r.resolveOptionValue(handler, mc, optVal, scopes); err != nil { - return err - } - mc.Option = nil - } - return nil -} - -func (r *result) resolveOptionValue(handler *reporter.Handler, mc *internal.MessageContext, val ast.ValueNode, scopes []scope) error { - optVal := val.Value() - switch optVal := optVal.(type) { - case []ast.ValueNode: - origPath := mc.OptAggPath - defer func() { - mc.OptAggPath = origPath - }() - for i, v := range optVal { - mc.OptAggPath = fmt.Sprintf("%s[%d]", origPath, i) - if err := r.resolveOptionValue(handler, mc, v, scopes); err != nil { - return err - } - } - case []*ast.MessageFieldNode: - origPath := mc.OptAggPath - defer func() { - mc.OptAggPath = origPath - }() - for _, fld := range optVal { - // check for extension name - if fld.Name.IsExtension() { - // Confusingly, an extension reference inside a message literal cannot refer to - // elements in the same enclosing message without a qualifier. Basically, we - // treat this as if there were no message scopes, so only the package name is - // used for resolving relative references. (Inconsistent protoc behavior, but - // likely due to how it re-uses C++ text format implementation, and normal text - // format doesn't expect that kind of relative reference.) - scopes := scopes[:1] // first scope is file, the rest are enclosing messages - fqn, err := r.resolveExtensionName(string(fld.Name.Name.AsIdentifier()), scopes) - if err != nil { - if err := handler.HandleErrorf(r.FileNode().NodeInfo(fld.Name.Name).Start(), "%v%v", mc, err); err != nil { - return err - } - } else { - r.optionQualifiedNames[fld.Name.Name] = fqn - } - } - - // recurse into value - mc.OptAggPath = origPath - if origPath != "" { - mc.OptAggPath += "." - } - if fld.Name.IsExtension() { - mc.OptAggPath = fmt.Sprintf("%s[%s]", mc.OptAggPath, string(fld.Name.Name.AsIdentifier())) - } else { - mc.OptAggPath = fmt.Sprintf("%s%s", mc.OptAggPath, string(fld.Name.Name.AsIdentifier())) - } - - if err := r.resolveOptionValue(handler, mc, fld.Val, scopes); err != nil { - return err - } - } - } - return nil -} - -func (r *result) resolveExtensionName(name string, scopes []scope) (string, error) { - dsc := r.resolve(name, false, scopes) - if dsc == nil { - return "", fmt.Errorf("unknown extension %s", name) - } - if isSentinelDescriptor(dsc) { - return "", fmt.Errorf("unknown extension %s; resolved to %s which is not defined; consider using a leading dot", name, dsc.FullName()) - } - if ext, ok := dsc.(protoreflect.FieldDescriptor); !ok { - return "", fmt.Errorf("invalid extension: %s is %s, not an extension", name, descriptorTypeWithArticle(dsc)) - } else if !ext.IsExtension() { - return "", fmt.Errorf("invalid extension: %s is a field but not an extension", name) - } - return string("." + dsc.FullName()), nil -} - -func (r *result) resolve(name string, onlyTypes bool, scopes []scope) protoreflect.Descriptor { - if strings.HasPrefix(name, ".") { - // already fully-qualified - return r.resolveElement(protoreflect.FullName(name[1:])) - } - // unqualified, so we look in the enclosing (last) scope first and move - // towards outermost (first) scope, trying to resolve the symbol - pos := strings.IndexByte(name, '.') - firstName := name - if pos > 0 { - firstName = name[:pos] - } - var bestGuess protoreflect.Descriptor - for i := len(scopes) - 1; i >= 0; i-- { - d := scopes[i](firstName, name) - if d != nil { - // In `protoc`, it will skip a match of the wrong type and move on - // to the next scope, but only if the reference is unqualified. So - // we mirror that behavior here. When we skip and move on, we go - // ahead and save the match of the wrong type so we can at least use - // it to construct a better error in the event that we don't find - // any match of the right type. - if !onlyTypes || isType(d) || firstName != name { - return d - } - if bestGuess == nil { - bestGuess = d - } - } - } - // we return best guess, even though it was not an allowed kind of - // descriptor, so caller can print a better error message (e.g. - // indicating that the name was found but that it's the wrong type) - return bestGuess -} - -func isType(d protoreflect.Descriptor) bool { - switch d.(type) { - case protoreflect.MessageDescriptor, protoreflect.EnumDescriptor: - return true - } - return false -} - -// scope represents a lexical scope in a proto file in which messages and enums -// can be declared. -type scope func(firstName, fullName string) protoreflect.Descriptor - -func fileScope(r *result) scope { - // we search symbols in this file, but also symbols in other files that have - // the same package as this file or a "parent" package (in protobuf, - // packages are a hierarchy like C++ namespaces) - prefixes := internal.CreatePrefixList(r.FileDescriptorProto().GetPackage()) - querySymbol := func(n string) protoreflect.Descriptor { - return r.resolveElement(protoreflect.FullName(n)) - } - return func(firstName, fullName string) protoreflect.Descriptor { - for _, prefix := range prefixes { - var n1, n string - if prefix == "" { - // exhausted all prefixes, so it must be in this one - n1, n = fullName, fullName - } else { - n = prefix + "." + fullName - n1 = prefix + "." + firstName - } - d := resolveElementRelative(n1, n, querySymbol) - if d != nil { - return d - } - } - return nil - } -} - -func messageScope(r *result, messageName protoreflect.FullName) scope { - querySymbol := func(n string) protoreflect.Descriptor { - return resolveElementInFile(protoreflect.FullName(n), r) - } - return func(firstName, fullName string) protoreflect.Descriptor { - n1 := string(messageName) + "." + firstName - n := string(messageName) + "." + fullName - return resolveElementRelative(n1, n, querySymbol) - } -} - -func resolveElementRelative(firstName, fullName string, query func(name string) protoreflect.Descriptor) protoreflect.Descriptor { - d := query(firstName) - if d == nil { - return nil - } - if firstName == fullName { - return d - } - if !isAggregateDescriptor(d) { - // can't possibly find the rest of full name if - // the first name indicated a leaf descriptor - return nil - } - d = query(fullName) - if d == nil { - return newSentinelDescriptor(fullName) - } - return d -} - -func resolveElementInFile(name protoreflect.FullName, f File) protoreflect.Descriptor { - d := f.FindDescriptorByName(name) - if d != nil { - return d - } - - if matchesPkgNamespace(name, f.Package()) { - // this sentinel means the name is a valid namespace but - // does not refer to a descriptor - return newSentinelDescriptor(string(name)) - } - return nil -} - -func matchesPkgNamespace(fqn, pkg protoreflect.FullName) bool { - if pkg == "" { - return false - } - if fqn == pkg { - return true - } - if len(pkg) > len(fqn) && strings.HasPrefix(string(pkg), string(fqn)) { - // if char after fqn is a dot, then fqn is a namespace - if pkg[len(fqn)] == '.' { - return true - } - } - return false -} - -func isAggregateDescriptor(d protoreflect.Descriptor) bool { - if isSentinelDescriptor(d) { - // this indicates the name matched a package, not a - // descriptor, but a package is an aggregate, so - // we return true - return true - } - switch d.(type) { - case protoreflect.MessageDescriptor, protoreflect.EnumDescriptor, protoreflect.ServiceDescriptor: - return true - default: - return false - } -} - -func isSentinelDescriptor(d protoreflect.Descriptor) bool { - _, ok := d.(*sentinelDescriptor) - return ok -} - -func newSentinelDescriptor(name string) protoreflect.Descriptor { - return &sentinelDescriptor{name: name} -} - -// sentinelDescriptor is a placeholder descriptor. It is used instead of nil to -// distinguish between two situations: -// 1. The given name could not be found. -// 2. The given name *cannot* be a valid result so stop searching. -// -// In these cases, attempts to resolve an element name will return nil for the -// first case and will return a sentinelDescriptor in the second. The sentinel -// contains the fully-qualified name which caused the search to stop (which may -// be a prefix of the actual name being resolved). -type sentinelDescriptor struct { - protoreflect.Descriptor - name string -} - -func (p *sentinelDescriptor) ParentFile() protoreflect.FileDescriptor { - return nil -} - -func (p *sentinelDescriptor) Parent() protoreflect.Descriptor { - return nil -} - -func (p *sentinelDescriptor) Index() int { - return 0 -} - -func (p *sentinelDescriptor) Syntax() protoreflect.Syntax { - return 0 -} - -func (p *sentinelDescriptor) Name() protoreflect.Name { - return protoreflect.Name(p.name) -} - -func (p *sentinelDescriptor) FullName() protoreflect.FullName { - return protoreflect.FullName(p.name) -} - -func (p *sentinelDescriptor) IsPlaceholder() bool { - return false -} - -func (p *sentinelDescriptor) Options() protoreflect.ProtoMessage { - return nil -} - -var _ protoreflect.Descriptor = (*sentinelDescriptor)(nil) diff --git a/vendor/github.com/bufbuild/protocompile/linker/symbols.go b/vendor/github.com/bufbuild/protocompile/linker/symbols.go deleted file mode 100644 index 5492321833..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/symbols.go +++ /dev/null @@ -1,567 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "strings" - "sync" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/reporter" - "github.com/bufbuild/protocompile/walk" -) - -const unknownFilePath = "" - -// Symbols is a symbol table that maps names for all program elements to their -// location in source. It also tracks extension tag numbers. This can be used -// to enforce uniqueness for symbol names and tag numbers across many files and -// many link operations. -// -// This type is thread-safe. -type Symbols struct { - pkgTrie packageSymbols -} - -type packageSymbols struct { - mu sync.RWMutex - children map[protoreflect.FullName]*packageSymbols - files map[protoreflect.FileDescriptor]struct{} - symbols map[protoreflect.FullName]symbolEntry - exts map[extNumber]ast.SourcePos -} - -type extNumber struct { - extendee protoreflect.FullName - tag protoreflect.FieldNumber -} - -type symbolEntry struct { - pos ast.SourcePos - isEnumValue bool - isPackage bool -} - -// Import populates the symbol table with all symbols/elements and extension -// tags present in the given file descriptor. If s is nil or if fd has already -// been imported into s, this returns immediately without doing anything. If any -// collisions in symbol names or extension tags are identified, an error will be -// returned and the symbol table will not be updated. -func (s *Symbols) Import(fd protoreflect.FileDescriptor, handler *reporter.Handler) error { - if s == nil { - return nil - } - - if f, ok := fd.(*file); ok { - // unwrap any file instance - fd = f.FileDescriptor - } - - var pkgPos ast.SourcePos - if res, ok := fd.(*result); ok { - pkgPos = packageNameStart(res) - } else { - pkgPos = sourcePositionForPackage(fd) - } - pkg, err := s.importPackages(pkgPos, fd.Package(), handler) - if err != nil || pkg == nil { - return err - } - - pkg.mu.RLock() - _, alreadyImported := pkg.files[fd] - pkg.mu.RUnlock() - - if alreadyImported { - return nil - } - - for i := 0; i < fd.Imports().Len(); i++ { - if err := s.Import(fd.Imports().Get(i).FileDescriptor, handler); err != nil { - return err - } - } - - if res, ok := fd.(*result); ok && res.hasSource() { - return s.importResultWithExtensions(pkg, res, handler) - } - - return s.importFileWithExtensions(pkg, fd, handler) -} - -func (s *Symbols) importFileWithExtensions(pkg *packageSymbols, fd protoreflect.FileDescriptor, handler *reporter.Handler) error { - imported, err := pkg.importFile(fd, handler) - if err != nil { - return err - } - if !imported { - // nothing else to do - return nil - } - - return walk.Descriptors(fd, func(d protoreflect.Descriptor) error { - fld, ok := d.(protoreflect.FieldDescriptor) - if !ok || !fld.IsExtension() { - return nil - } - pos := sourcePositionForNumber(fld) - extendee := fld.ContainingMessage() - if err := s.AddExtension(packageFor(extendee), extendee.FullName(), fld.Number(), pos, handler); err != nil { - return err - } - return nil - }) -} - -func (s *packageSymbols) importFile(fd protoreflect.FileDescriptor, handler *reporter.Handler) (bool, error) { - s.mu.Lock() - defer s.mu.Unlock() - - if _, ok := s.files[fd]; ok { - // have to double-check if it's already imported, in case - // it was added after above read-locked check - return false, nil - } - - // first pass: check for conflicts - if err := s.checkFileLocked(fd, handler); err != nil { - return false, err - } - if err := handler.Error(); err != nil { - return false, err - } - - // second pass: commit all symbols - s.commitFileLocked(fd) - - return true, nil -} - -func (s *Symbols) importPackages(pkgPos ast.SourcePos, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { - if pkg == "" { - return &s.pkgTrie, nil - } - - parts := strings.Split(string(pkg), ".") - for i := 1; i < len(parts); i++ { - parts[i] = parts[i-1] + "." + parts[i] - } - - cur := &s.pkgTrie - for _, p := range parts { - var err error - cur, err = cur.importPackage(pkgPos, protoreflect.FullName(p), handler) - if err != nil { - return nil, err - } - if cur == nil { - return nil, nil - } - } - - return cur, nil -} - -func (s *packageSymbols) importPackage(pkgPos ast.SourcePos, pkg protoreflect.FullName, handler *reporter.Handler) (*packageSymbols, error) { - s.mu.RLock() - existing, ok := s.symbols[pkg] - var child *packageSymbols - if ok && existing.isPackage { - child = s.children[pkg] - } - s.mu.RUnlock() - - if ok && existing.isPackage { - // package already exists - return child, nil - } else if ok { - return nil, reportSymbolCollision(pkgPos, pkg, false, existing, handler) - } - - s.mu.Lock() - defer s.mu.Unlock() - // have to double-check in case it was added while upgrading to write lock - existing, ok = s.symbols[pkg] - if ok && existing.isPackage { - // package already exists - return s.children[pkg], nil - } else if ok { - return nil, reportSymbolCollision(pkgPos, pkg, false, existing, handler) - } - if s.symbols == nil { - s.symbols = map[protoreflect.FullName]symbolEntry{} - } - s.symbols[pkg] = symbolEntry{pos: pkgPos, isPackage: true} - child = &packageSymbols{} - if s.children == nil { - s.children = map[protoreflect.FullName]*packageSymbols{} - } - s.children[pkg] = child - return child, nil -} - -func (s *Symbols) getPackage(pkg protoreflect.FullName) *packageSymbols { - if pkg == "" { - return &s.pkgTrie - } - - parts := strings.Split(string(pkg), ".") - for i := 1; i < len(parts); i++ { - parts[i] = parts[i-1] + "." + parts[i] - } - - cur := &s.pkgTrie - for _, p := range parts { - cur.mu.RLock() - next := cur.children[protoreflect.FullName(p)] - cur.mu.RUnlock() - - if next == nil { - return nil - } - cur = next - } - - return cur -} - -func reportSymbolCollision(pos ast.SourcePos, fqn protoreflect.FullName, additionIsEnumVal bool, existing symbolEntry, handler *reporter.Handler) error { - // because of weird scoping for enum values, provide more context in error message - // if this conflict is with an enum value - var isPkg, suffix string - if additionIsEnumVal || existing.isEnumValue { - suffix = "; protobuf uses C++ scoping rules for enum values, so they exist in the scope enclosing the enum" - } - if existing.isPackage { - isPkg = " as a package" - } - orig := existing.pos - conflict := pos - if posLess(conflict, orig) { - orig, conflict = conflict, orig - } - return handler.HandleErrorf(conflict, "symbol %q already defined%s at %v%s", fqn, isPkg, orig, suffix) -} - -func posLess(a, b ast.SourcePos) bool { - if a.Filename == b.Filename { - if a.Line == b.Line { - return a.Col < b.Col - } - return a.Line < b.Line - } - return false -} - -func (s *packageSymbols) checkFileLocked(f protoreflect.FileDescriptor, handler *reporter.Handler) error { - return walk.Descriptors(f, func(d protoreflect.Descriptor) error { - pos := sourcePositionFor(d) - if existing, ok := s.symbols[d.FullName()]; ok { - _, isEnumVal := d.(protoreflect.EnumValueDescriptor) - if err := reportSymbolCollision(pos, d.FullName(), isEnumVal, existing, handler); err != nil { - return err - } - } - return nil - }) -} - -func sourcePositionForPackage(fd protoreflect.FileDescriptor) ast.SourcePos { - loc := fd.SourceLocations().ByPath([]int32{internal.FilePackageTag}) - if isZeroLoc(loc) { - return ast.UnknownPos(fd.Path()) - } - return ast.SourcePos{ - Filename: fd.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } -} - -func sourcePositionFor(d protoreflect.Descriptor) ast.SourcePos { - file := d.ParentFile() - if file == nil { - return ast.UnknownPos(unknownFilePath) - } - path, ok := computePath(d) - if !ok { - return ast.UnknownPos(file.Path()) - } - namePath := path - switch d.(type) { - case protoreflect.FieldDescriptor: - namePath = append(namePath, internal.FieldNameTag) - case protoreflect.MessageDescriptor: - namePath = append(namePath, internal.MessageNameTag) - case protoreflect.OneofDescriptor: - namePath = append(namePath, internal.OneOfNameTag) - case protoreflect.EnumDescriptor: - namePath = append(namePath, internal.EnumNameTag) - case protoreflect.EnumValueDescriptor: - namePath = append(namePath, internal.EnumValNameTag) - case protoreflect.ServiceDescriptor: - namePath = append(namePath, internal.ServiceNameTag) - case protoreflect.MethodDescriptor: - namePath = append(namePath, internal.MethodNameTag) - default: - // NB: shouldn't really happen, but just in case fall back to path to - // descriptor, sans name field - } - loc := file.SourceLocations().ByPath(namePath) - if isZeroLoc(loc) { - loc = file.SourceLocations().ByPath(path) - if isZeroLoc(loc) { - return ast.UnknownPos(file.Path()) - } - } - return ast.SourcePos{ - Filename: file.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } -} - -func sourcePositionForNumber(fd protoreflect.FieldDescriptor) ast.SourcePos { - file := fd.ParentFile() - if file == nil { - return ast.UnknownPos(unknownFilePath) - } - path, ok := computePath(fd) - if !ok { - return ast.UnknownPos(file.Path()) - } - numberPath := path - numberPath = append(numberPath, internal.FieldNumberTag) - loc := file.SourceLocations().ByPath(numberPath) - if isZeroLoc(loc) { - loc = file.SourceLocations().ByPath(path) - if isZeroLoc(loc) { - return ast.UnknownPos(file.Path()) - } - } - return ast.SourcePos{ - Filename: file.Path(), - Line: loc.StartLine, - Col: loc.StartColumn, - } -} - -func isZeroLoc(loc protoreflect.SourceLocation) bool { - return loc.Path == nil && - loc.StartLine == 0 && - loc.StartColumn == 0 && - loc.EndLine == 0 && - loc.EndColumn == 0 -} - -func (s *packageSymbols) commitFileLocked(f protoreflect.FileDescriptor) { - if s.symbols == nil { - s.symbols = map[protoreflect.FullName]symbolEntry{} - } - if s.exts == nil { - s.exts = map[extNumber]ast.SourcePos{} - } - _ = walk.Descriptors(f, func(d protoreflect.Descriptor) error { - pos := sourcePositionFor(d) - name := d.FullName() - _, isEnumValue := d.(protoreflect.EnumValueDescriptor) - s.symbols[name] = symbolEntry{pos: pos, isEnumValue: isEnumValue} - return nil - }) - - if s.files == nil { - s.files = map[protoreflect.FileDescriptor]struct{}{} - } - s.files[f] = struct{}{} -} - -func (s *Symbols) importResultWithExtensions(pkg *packageSymbols, r *result, handler *reporter.Handler) error { - imported, err := pkg.importResult(r, handler) - if err != nil { - return err - } - if !imported { - // nothing else to do - return nil - } - - return walk.Descriptors(r, func(d protoreflect.Descriptor) error { - fd, ok := d.(*extTypeDescriptor) - if !ok { - return nil - } - file := r.FileNode() - node := r.FieldNode(fd.FieldDescriptorProto()) - pos := file.NodeInfo(node.FieldTag()).Start() - extendee := fd.ContainingMessage() - if err := s.AddExtension(packageFor(extendee), extendee.FullName(), fd.Number(), pos, handler); err != nil { - return err - } - - return nil - }) -} - -func (s *Symbols) importResult(r *result, handler *reporter.Handler) error { - pkg, err := s.importPackages(packageNameStart(r), r.Package(), handler) - if err != nil || pkg == nil { - return err - } - _, err = pkg.importResult(r, handler) - return err -} - -func (s *packageSymbols) importResult(r *result, handler *reporter.Handler) (bool, error) { - s.mu.Lock() - defer s.mu.Unlock() - - if _, ok := s.files[r]; ok { - // already imported - return false, nil - } - - // first pass: check for conflicts - if err := s.checkResultLocked(r, handler); err != nil { - return false, err - } - if err := handler.Error(); err != nil { - return false, err - } - - // second pass: commit all symbols - s.commitResultLocked(r) - - return true, nil -} - -func (s *packageSymbols) checkResultLocked(r *result, handler *reporter.Handler) error { - resultSyms := map[protoreflect.FullName]symbolEntry{} - return walk.DescriptorProtos(r.FileDescriptorProto(), func(fqn protoreflect.FullName, d proto.Message) error { - _, isEnumVal := d.(*descriptorpb.EnumValueDescriptorProto) - file := r.FileNode() - node := r.Node(d) - pos := nameStart(file, node) - // check symbols already in this symbol table - if existing, ok := s.symbols[fqn]; ok { - if err := reportSymbolCollision(pos, fqn, isEnumVal, existing, handler); err != nil { - return err - } - } - - // also check symbols from this result (that are not yet in symbol table) - if existing, ok := resultSyms[fqn]; ok { - if err := reportSymbolCollision(pos, fqn, isEnumVal, existing, handler); err != nil { - return err - } - } - resultSyms[fqn] = symbolEntry{ - pos: pos, - isEnumValue: isEnumVal, - } - - return nil - }) -} - -func packageNameStart(r *result) ast.SourcePos { - if node, ok := r.FileNode().(*ast.FileNode); ok { - for _, decl := range node.Decls { - if pkgNode, ok := decl.(*ast.PackageNode); ok { - return r.FileNode().NodeInfo(pkgNode.Name).Start() - } - } - } - return ast.UnknownPos(r.Path()) -} - -func nameStart(file ast.FileDeclNode, n ast.Node) ast.SourcePos { - // TODO: maybe ast package needs a NamedNode interface to simplify this? - switch n := n.(type) { - case ast.FieldDeclNode: - return file.NodeInfo(n.FieldName()).Start() - case ast.MessageDeclNode: - return file.NodeInfo(n.MessageName()).Start() - case ast.OneOfDeclNode: - return file.NodeInfo(n.OneOfName()).Start() - case ast.EnumValueDeclNode: - return file.NodeInfo(n.GetName()).Start() - case *ast.EnumNode: - return file.NodeInfo(n.Name).Start() - case *ast.ServiceNode: - return file.NodeInfo(n.Name).Start() - case ast.RPCDeclNode: - return file.NodeInfo(n.GetName()).Start() - default: - return file.NodeInfo(n).Start() - } -} - -func (s *packageSymbols) commitResultLocked(r *result) { - if s.symbols == nil { - s.symbols = map[protoreflect.FullName]symbolEntry{} - } - if s.exts == nil { - s.exts = map[extNumber]ast.SourcePos{} - } - _ = walk.DescriptorProtos(r.FileDescriptorProto(), func(fqn protoreflect.FullName, d proto.Message) error { - pos := nameStart(r.FileNode(), r.Node(d)) - _, isEnumValue := d.(protoreflect.EnumValueDescriptor) - s.symbols[fqn] = symbolEntry{pos: pos, isEnumValue: isEnumValue} - return nil - }) - - if s.files == nil { - s.files = map[protoreflect.FileDescriptor]struct{}{} - } - s.files[r] = struct{}{} -} - -func (s *Symbols) AddExtension(pkg, extendee protoreflect.FullName, tag protoreflect.FieldNumber, pos ast.SourcePos, handler *reporter.Handler) error { - if pkg != "" { - if !strings.HasPrefix(string(extendee), string(pkg)+".") { - return handler.HandleErrorf(pos, "could not register extension: extendee %q does not match package %q", extendee, pkg) - } - } - pkgSyms := s.getPackage(pkg) - if pkgSyms == nil { - // should never happen - return handler.HandleErrorf(pos, "could not register extension: missing package symbols for %q", pkg) - } - return pkgSyms.addExtension(extendee, tag, pos, handler) -} - -func (s *packageSymbols) addExtension(extendee protoreflect.FullName, tag protoreflect.FieldNumber, pos ast.SourcePos, handler *reporter.Handler) error { - s.mu.Lock() - defer s.mu.Unlock() - - if s.exts == nil { - s.exts = map[extNumber]ast.SourcePos{} - } - - extNum := extNumber{extendee: extendee, tag: tag} - if existing, ok := s.exts[extNum]; ok { - if err := handler.HandleErrorf(pos, "extension with tag %d for message %s already defined at %v", tag, extendee, existing); err != nil { - return err - } - } else { - s.exts[extNum] = pos - } - return nil -} diff --git a/vendor/github.com/bufbuild/protocompile/linker/validate.go b/vendor/github.com/bufbuild/protocompile/linker/validate.go deleted file mode 100644 index f30c571865..0000000000 --- a/vendor/github.com/bufbuild/protocompile/linker/validate.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package linker - -import ( - "fmt" - "strings" - "unicode" - "unicode/utf8" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/reporter" -) - -// ValidateOptions runs some validation checks on the result that can only -// be done after options are interpreted. -func (r *result) ValidateOptions(handler *reporter.Handler) error { - if err := r.validateExtensions(r, handler); err != nil { - return err - } - return r.validateJSONNamesInFile(handler) -} - -func (r *result) validateExtensions(d hasExtensionsAndMessages, handler *reporter.Handler) error { - for i := 0; i < d.Extensions().Len(); i++ { - if err := r.validateExtension(d.Extensions().Get(i), handler); err != nil { - return err - } - } - for i := 0; i < d.Messages().Len(); i++ { - if err := r.validateExtensions(d.Messages().Get(i), handler); err != nil { - return err - } - } - return nil -} - -func (r *result) validateExtension(fld protoreflect.FieldDescriptor, handler *reporter.Handler) error { - // NB: It's a little gross that we don't enforce these in validateBasic(). - // But it requires linking to resolve the extendee, so we can interrogate - // its descriptor. - if xtd, ok := fld.(protoreflect.ExtensionTypeDescriptor); ok { - fld = xtd.Descriptor() - } - fd := fld.(*fldDescriptor) //nolint:errcheck - if fld.ContainingMessage().Options().(*descriptorpb.MessageOptions).GetMessageSetWireFormat() { - // Message set wire format requires that all extensions be messages - // themselves (no scalar extensions) - if fld.Kind() != protoreflect.MessageKind { - file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldType()).Start() - return handler.HandleErrorf(pos, "messages with message-set wire format cannot contain scalar extensions, only messages") - } - if fld.Cardinality() == protoreflect.Repeated { - file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldLabel()).Start() - return handler.HandleErrorf(pos, "messages with message-set wire format cannot contain repeated extensions, only optional") - } - } else if fld.Number() > internal.MaxNormalTag { - // In validateBasic() we just made sure these were within bounds for any message. But - // now that things are linked, we can check if the extendee is messageset wire format - // and, if not, enforce tighter limit. - file := r.FileNode() - pos := file.NodeInfo(r.FieldNode(fd.proto).FieldTag()).Start() - return handler.HandleErrorf(pos, "tag number %d is higher than max allowed tag number (%d)", fld.Number(), internal.MaxNormalTag) - } - - return nil -} - -func (r *result) validateJSONNamesInFile(handler *reporter.Handler) error { - for _, md := range r.FileDescriptorProto().GetMessageType() { - if err := r.validateJSONNamesInMessage(md, handler); err != nil { - return err - } - } - for _, ed := range r.FileDescriptorProto().GetEnumType() { - if err := r.validateJSONNamesInEnum(ed, handler); err != nil { - return err - } - } - return nil -} - -func (r *result) validateJSONNamesInMessage(md *descriptorpb.DescriptorProto, handler *reporter.Handler) error { - if err := r.validateFieldJSONNames(md, false, handler); err != nil { - return err - } - if err := r.validateFieldJSONNames(md, true, handler); err != nil { - return err - } - - for _, nmd := range md.GetNestedType() { - if err := r.validateJSONNamesInMessage(nmd, handler); err != nil { - return err - } - } - for _, ed := range md.GetEnumType() { - if err := r.validateJSONNamesInEnum(ed, handler); err != nil { - return err - } - } - return nil -} - -func (r *result) validateJSONNamesInEnum(ed *descriptorpb.EnumDescriptorProto, handler *reporter.Handler) error { - seen := map[string]*descriptorpb.EnumValueDescriptorProto{} - for _, evd := range ed.GetValue() { - scope := "enum value " + ed.GetName() + "." + evd.GetName() - - name := canonicalEnumValueName(evd.GetName(), ed.GetName()) - if existing, ok := seen[name]; ok && evd.GetNumber() != existing.GetNumber() { - fldNode := r.EnumValueNode(evd) - existingNode := r.EnumValueNode(existing) - conflictErr := fmt.Errorf("%s: camel-case name (with optional enum name prefix removed) %q conflicts with camel-case name of enum value %s, defined at %v", - scope, name, existing.GetName(), r.FileNode().NodeInfo(existingNode).Start()) - - // Since proto2 did not originally have a JSON format, we report conflicts as just warnings - if r.Syntax() != protoreflect.Proto3 { - handler.HandleWarningWithPos(r.FileNode().NodeInfo(fldNode).Start(), conflictErr) - } else if err := handler.HandleErrorf(r.FileNode().NodeInfo(fldNode).Start(), conflictErr.Error()); err != nil { - return err - } - } else { - seen[name] = evd - } - } - return nil -} - -func (r *result) validateFieldJSONNames(md *descriptorpb.DescriptorProto, useCustom bool, handler *reporter.Handler) error { - type jsonName struct { - source *descriptorpb.FieldDescriptorProto - // true if orig is a custom JSON name (vs. the field's default JSON name) - custom bool - } - seen := map[string]jsonName{} - - for _, fd := range md.GetField() { - scope := "field " + md.GetName() + "." + fd.GetName() - defaultName := internal.JSONName(fd.GetName()) - name := defaultName - custom := false - if useCustom { - n := fd.GetJsonName() - if n != defaultName || r.hasCustomJSONName(fd) { - name = n - custom = true - } - } - if existing, ok := seen[name]; ok { - // When useCustom is true, we'll only report an issue when a conflict is - // due to a custom name. That way, we don't double report conflicts on - // non-custom names. - if !useCustom || custom || existing.custom { - fldNode := r.FieldNode(fd) - customStr, srcCustomStr := "custom", "custom" - if !custom { - customStr = "default" - } - if !existing.custom { - srcCustomStr = "default" - } - pos := r.FileNode().NodeInfo(fldNode).Start() - conflictErr := reporter.Errorf(pos, "%s: %s JSON name %q conflicts with %s JSON name of field %s, defined at %v", - scope, customStr, name, srcCustomStr, existing.source.GetName(), r.FileNode().NodeInfo(r.FieldNode(existing.source)).Start()) - - // Since proto2 did not originally have default JSON names, we report conflicts - // between default names (neither is a custom name) as just warnings. - if r.Syntax() != protoreflect.Proto3 && !custom && !existing.custom { - handler.HandleWarning(conflictErr) - } else if err := handler.HandleError(conflictErr); err != nil { - return err - } - } - } else { - seen[name] = jsonName{source: fd, custom: custom} - } - } - return nil -} - -func (r *result) hasCustomJSONName(fdProto *descriptorpb.FieldDescriptorProto) bool { - // if we have the AST, we can more precisely determine if there was a custom - // JSON named defined, even if it is explicitly configured to tbe the same - // as the default JSON name for the field. - opts := r.FieldNode(fdProto).GetOptions() - if opts == nil { - return false - } - for _, opt := range opts.Options { - if len(opt.Name.Parts) == 1 && - opt.Name.Parts[0].Name.AsIdentifier() == "json_name" && - !opt.Name.Parts[0].IsExtension() { - return true - } - } - return false -} - -func canonicalEnumValueName(enumValueName, enumName string) string { - return enumValCamelCase(removePrefix(enumValueName, enumName)) -} - -// removePrefix is used to remove the given prefix from the given str. It does not require -// an exact match and ignores case and underscores. If the all non-underscore characters -// would be removed from str, str is returned unchanged. If str does not have the given -// prefix (even with the very lenient matching, in regard to case and underscores), then -// str is returned unchanged. -// -// The algorithm is adapted from the protoc source: -// -// https://github.com/protocolbuffers/protobuf/blob/v21.3/src/google/protobuf/descriptor.cc#L922 -func removePrefix(str, prefix string) string { - j := 0 - for i, r := range str { - if r == '_' { - // skip underscores in the input - continue - } - - p, sz := utf8.DecodeRuneInString(prefix[j:]) - for p == '_' { - j += sz // consume/skip underscore - p, sz = utf8.DecodeRuneInString(prefix[j:]) - } - - if j == len(prefix) { - // matched entire prefix; return rest of str - // but skipping any leading underscores - result := strings.TrimLeft(str[i:], "_") - if len(result) == 0 { - // result can't be empty string - return str - } - return result - } - if unicode.ToLower(r) != unicode.ToLower(p) { - // does not match prefix - return str - } - j += sz // consume matched rune of prefix - } - return str -} - -// enumValCamelCase converts the given string to upper-camel-case. -// -// The algorithm is adapted from the protoc source: -// -// https://github.com/protocolbuffers/protobuf/blob/v21.3/src/google/protobuf/descriptor.cc#L887 -func enumValCamelCase(name string) string { - var js []rune - nextUpper := true - for _, r := range name { - if r == '_' { - nextUpper = true - continue - } - if nextUpper { - nextUpper = false - js = append(js, unicode.ToUpper(r)) - } else { - js = append(js, unicode.ToLower(r)) - } - } - return string(js) -} diff --git a/vendor/github.com/bufbuild/protocompile/options/options.go b/vendor/github.com/bufbuild/protocompile/options/options.go deleted file mode 100644 index a01d059a45..0000000000 --- a/vendor/github.com/bufbuild/protocompile/options/options.go +++ /dev/null @@ -1,1667 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package options contains the logic for interpreting options. The parse step -// of compilation stores the options in uninterpreted form, which contains raw -// identifiers and literal values. -// -// The process of interpreting an option is to resolve identifiers, by examining -// descriptors for the google.protobuf.*Options types and their available -// extensions (custom options). As field names are resolved, the values can be -// type-checked against the types indicated in field descriptors. -// -// On success, the various fields and extensions of the options message are -// populated and the field holding the uninterpreted form is cleared. -package options - -import ( - "bytes" - "errors" - "fmt" - "math" - "sort" - "strings" - - "google.golang.org/protobuf/encoding/protowire" - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" - "google.golang.org/protobuf/types/dynamicpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/linker" - "github.com/bufbuild/protocompile/parser" - "github.com/bufbuild/protocompile/reporter" -) - -// Index is a mapping of AST nodes that define options to a corresponding path -// into the containing file descriptor. The path is a sequence of field tags -// and indexes that define a traversal path from the root (the file descriptor) -// to the resolved option field. -type Index map[*ast.OptionNode][]int32 - -type interpreter struct { - file file - resolver linker.Resolver - container optionsContainer - overrideDescriptorProto linker.File - lenient bool - reporter *reporter.Handler - index Index -} - -type file interface { - parser.Result - ResolveMessageLiteralExtensionName(ast.IdentValueNode) string -} - -type noResolveFile struct { - parser.Result -} - -func (n noResolveFile) ResolveMessageLiteralExtensionName(ast.IdentValueNode) string { - return "" -} - -// InterpreterOption is an option that can be passed to InterpretOptions and -// its variants. -type InterpreterOption func(*interpreter) - -// WithOverrideDescriptorProto returns an option that indicates that the given file -// should be consulted when looking up a definition for an option type. The given -// file should usually have the path "google/protobuf/descriptor.proto". The given -// file will only be consulted if the option type is otherwise not visible to the -// file whose options are being interpreted. -func WithOverrideDescriptorProto(f linker.File) InterpreterOption { - return func(interp *interpreter) { - interp.overrideDescriptorProto = f - } -} - -// InterpretOptions interprets options in the given linked result, returning -// an index that can be used to generate source code info. This step mutates -// the linked result's underlying proto to move option elements out of the -// "uninterpreted_option" fields and into proper option fields and extensions. -// -// The given handler is used to report errors and warnings. If any errors are -// reported, this function returns a non-nil error. -func InterpretOptions(linked linker.Result, handler *reporter.Handler, opts ...InterpreterOption) (Index, error) { - return interpretOptions(false, linked, linker.ResolverFromFile(linked), handler, opts) -} - -// InterpretOptionsLenient interprets options in a lenient/best-effort way in -// the given linked result, returning an index that can be used to generate -// source code info. This step mutates the linked result's underlying proto to -// move option elements out of the "uninterpreted_option" fields and into proper -// option fields and extensions. -// -// In lenient more, errors resolving option names and type errors are ignored. -// Any options that are uninterpretable (due to such errors) will remain in the -// "uninterpreted_option" fields. -func InterpretOptionsLenient(linked linker.Result, opts ...InterpreterOption) (Index, error) { - return interpretOptions(true, linked, linker.ResolverFromFile(linked), reporter.NewHandler(nil), opts) -} - -// InterpretUnlinkedOptions does a best-effort attempt to interpret options in -// the given parsed result, returning an index that can be used to generate -// source code info. This step mutates the parsed result's underlying proto to -// move option elements out of the "uninterpreted_option" fields and into proper -// option fields and extensions. -// -// This is the same as InterpretOptionsLenient except that it accepts an -// unlinked result. Because the file is unlinked, custom options cannot be -// interpreted. Other errors resolving option names or type errors will be -// effectively ignored. Any options that are uninterpretable (due to such -// errors) will remain in the "uninterpreted_option" fields. -func InterpretUnlinkedOptions(parsed parser.Result, opts ...InterpreterOption) (Index, error) { - return interpretOptions(true, noResolveFile{parsed}, nil, reporter.NewHandler(nil), opts) -} - -func interpretOptions(lenient bool, file file, res linker.Resolver, handler *reporter.Handler, interpOpts []InterpreterOption) (Index, error) { - interp := interpreter{ - file: file, - resolver: res, - lenient: lenient, - reporter: handler, - index: Index{}, - } - interp.container, _ = file.(optionsContainer) - for _, opt := range interpOpts { - opt(&interp) - } - - fd := file.FileDescriptorProto() - prefix := fd.GetPackage() - if prefix != "" { - prefix += "." - } - opts := fd.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fd.GetName(), fd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain - } - } - for _, md := range fd.GetMessageType() { - fqn := prefix + md.GetName() - if err := interp.interpretMessageOptions(fqn, md); err != nil { - return nil, err - } - } - for _, fld := range fd.GetExtension() { - fqn := prefix + fld.GetName() - if err := interp.interpretFieldOptions(fqn, fld); err != nil { - return nil, err - } - } - for _, ed := range fd.GetEnumType() { - fqn := prefix + ed.GetName() - if err := interp.interpretEnumOptions(fqn, ed); err != nil { - return nil, err - } - } - for _, sd := range fd.GetService() { - fqn := prefix + sd.GetName() - opts := sd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(fqn, sd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain - } - for _, mtd := range sd.GetMethod() { - mtdFqn := fqn + "." + mtd.GetName() - opts := mtd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(mtdFqn, mtd, opts, opts.UninterpretedOption) - if err != nil { - return nil, err - } - opts.UninterpretedOption = remain - } - } - } - return interp.index, nil -} - -func resolveDescriptor[T protoreflect.Descriptor](res linker.Resolver, name string) T { - var zero T - if res == nil { - return zero - } - if len(name) > 0 && name[0] == '.' { - name = name[1:] - } - desc, _ := res.FindDescriptorByName(protoreflect.FullName(name)) - typedDesc, ok := desc.(T) - if ok { - return typedDesc - } - return zero -} - -func (interp *interpreter) resolveExtensionType(name string) (protoreflect.ExtensionTypeDescriptor, error) { - if interp.resolver == nil { - return nil, protoregistry.NotFound - } - if len(name) > 0 && name[0] == '.' { - name = name[1:] - } - ext, err := interp.resolver.FindExtensionByName(protoreflect.FullName(name)) - if err != nil { - return nil, err - } - return ext.TypeDescriptor(), nil -} - -func (interp *interpreter) resolveOptionsType(name string) protoreflect.MessageDescriptor { - md := resolveDescriptor[protoreflect.MessageDescriptor](interp.resolver, name) - if md != nil { - return md - } - if interp.overrideDescriptorProto == nil { - return nil - } - if len(name) > 0 && name[0] == '.' { - name = name[1:] - } - desc := interp.overrideDescriptorProto.FindDescriptorByName(protoreflect.FullName(name)) - if md, ok := desc.(protoreflect.MessageDescriptor); ok { - return md - } - return nil -} - -func (interp *interpreter) nodeInfo(n ast.Node) ast.NodeInfo { - return interp.file.FileNode().NodeInfo(n) -} - -func (interp *interpreter) interpretMessageOptions(fqn string, md *descriptorpb.DescriptorProto) error { - opts := md.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fqn, md, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } - } - for _, fld := range md.GetField() { - fldFqn := fqn + "." + fld.GetName() - if err := interp.interpretFieldOptions(fldFqn, fld); err != nil { - return err - } - } - for _, ood := range md.GetOneofDecl() { - oodFqn := fqn + "." + ood.GetName() - opts := ood.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(oodFqn, ood, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } - } - for _, fld := range md.GetExtension() { - fldFqn := fqn + "." + fld.GetName() - if err := interp.interpretFieldOptions(fldFqn, fld); err != nil { - return err - } - } - for _, er := range md.GetExtensionRange() { - erFqn := fmt.Sprintf("%s.%d-%d", fqn, er.GetStart(), er.GetEnd()) - opts := er.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(erFqn, er, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } - } - for _, nmd := range md.GetNestedType() { - nmdFqn := fqn + "." + nmd.GetName() - if err := interp.interpretMessageOptions(nmdFqn, nmd); err != nil { - return err - } - } - for _, ed := range md.GetEnumType() { - edFqn := fqn + "." + ed.GetName() - if err := interp.interpretEnumOptions(edFqn, ed); err != nil { - return err - } - } - return nil -} - -func (interp *interpreter) interpretFieldOptions(fqn string, fld *descriptorpb.FieldDescriptorProto) error { - opts := fld.GetOptions() - if len(opts.GetUninterpretedOption()) == 0 { - return nil - } - uo := opts.UninterpretedOption - scope := fmt.Sprintf("field %s", fqn) - - // process json_name pseudo-option - index, err := internal.FindOption(interp.file, interp.reporter, scope, uo, "json_name") - if err != nil && !interp.lenient { - return err - } - if index >= 0 { - opt := uo[index] - optNode := interp.file.OptionNode(opt) - if fld.GetExtendee() != "" { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: option json_name is not allowed on extensions", scope) - } - // attribute source code info - if on, ok := optNode.(*ast.OptionNode); ok { - interp.index[on] = []int32{-1, internal.FieldJSONNameTag} - } - uo = internal.RemoveOption(uo, index) - if opt.StringValue == nil { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()).Start(), "%s: expecting string value for json_name option", scope) - } - name := string(opt.StringValue) - if strings.HasPrefix(name, "[") && strings.HasSuffix(name, "]") { - return interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetValue()).Start(), "%s: option json_name value cannot start with '[' and end with ']'; that is reserved for representing extensions", scope) - } - fld.JsonName = proto.String(name) - } - - // and process default pseudo-option - if index, err := interp.processDefaultOption(scope, fqn, fld, uo); err != nil && !interp.lenient { - return err - } else if index >= 0 { - // attribute source code info - optNode := interp.file.OptionNode(uo[index]) - if on, ok := optNode.(*ast.OptionNode); ok { - interp.index[on] = []int32{-1, internal.FieldDefaultTag} - } - uo = internal.RemoveOption(uo, index) - } - - if len(uo) == 0 { - // no real options, only pseudo-options above? clear out options - fld.Options = nil - } else if remain, err := interp.interpretOptions(fqn, fld, opts, uo); err != nil { - return err - } else { - opts.UninterpretedOption = remain - } - return nil -} - -func (interp *interpreter) processDefaultOption(scope string, fqn string, fld *descriptorpb.FieldDescriptorProto, uos []*descriptorpb.UninterpretedOption) (defaultIndex int, err error) { - found, err := internal.FindOption(interp.file, interp.reporter, scope, uos, "default") - if err != nil || found == -1 { - return -1, err - } - opt := uos[found] - optNode := interp.file.OptionNode(opt) - if fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED { - return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: default value cannot be set because field is repeated", scope) - } - if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP || fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_MESSAGE { - return -1, interp.reporter.HandleErrorf(interp.nodeInfo(optNode.GetName()).Start(), "%s: default value cannot be set because field is a message", scope) - } - val := optNode.GetValue() - if _, ok := val.(*ast.MessageLiteralNode); ok { - return -1, interp.reporter.HandleErrorf(interp.nodeInfo(val).Start(), "%s: default value cannot be a message", scope) - } - mc := &internal.MessageContext{ - File: interp.file, - ElementName: fqn, - ElementType: descriptorType(fld), - Option: opt, - } - var v interface{} - if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_ENUM { - ed := resolveDescriptor[protoreflect.EnumDescriptor](interp.resolver, fld.GetTypeName()) - _, name, err := interp.enumFieldValue(mc, ed, val, false) - if err != nil { - return -1, interp.reporter.HandleError(err) - } - v = string(name) - } else { - v, err = interp.scalarFieldValue(mc, fld.GetType(), val, false) - if err != nil { - return -1, interp.reporter.HandleError(err) - } - } - if str, ok := v.(string); ok { - fld.DefaultValue = proto.String(str) - } else if b, ok := v.([]byte); ok { - fld.DefaultValue = proto.String(encodeDefaultBytes(b)) - } else { - var flt float64 - var ok bool - if flt, ok = v.(float64); !ok { - var flt32 float32 - if flt32, ok = v.(float32); ok { - flt = float64(flt32) - } - } - if ok { - switch { - case math.IsInf(flt, 1): - fld.DefaultValue = proto.String("inf") - case math.IsInf(flt, -1): - fld.DefaultValue = proto.String("-inf") - case math.IsNaN(flt): - fld.DefaultValue = proto.String("nan") - default: - fld.DefaultValue = proto.String(fmt.Sprintf("%v", v)) - } - } else { - fld.DefaultValue = proto.String(fmt.Sprintf("%v", v)) - } - } - return found, nil -} - -func encodeDefaultBytes(b []byte) string { - var buf bytes.Buffer - internal.WriteEscapedBytes(&buf, b) - return buf.String() -} - -func (interp *interpreter) interpretEnumOptions(fqn string, ed *descriptorpb.EnumDescriptorProto) error { - opts := ed.GetOptions() - if opts != nil { - if len(opts.UninterpretedOption) > 0 { - remain, err := interp.interpretOptions(fqn, ed, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } - } - for _, evd := range ed.GetValue() { - evdFqn := fqn + "." + evd.GetName() - opts := evd.GetOptions() - if len(opts.GetUninterpretedOption()) > 0 { - remain, err := interp.interpretOptions(evdFqn, evd, opts, opts.UninterpretedOption) - if err != nil { - return err - } - opts.UninterpretedOption = remain - } - } - return nil -} - -// interpretedOption represents the result of interpreting an option. -// This includes metadata that allows the option to be serialized to -// bytes in a way that is deterministic and can preserve the structure -// of the source (the way the options are de-structured and the order in -// which options appear). -type interpretedOption struct { - unknown bool - pathPrefix []int32 - interpretedField -} - -func (o *interpretedOption) path() []int32 { - path := o.pathPrefix - path = append(path, o.number) - if o.repeated { - path = append(path, o.index) - } - return path -} - -func (o *interpretedOption) appendOptionBytes(b []byte) ([]byte, error) { - return o.appendOptionBytesWithPath(b, o.pathPrefix) -} - -func (o *interpretedOption) appendOptionBytesWithPath(b []byte, path []int32) ([]byte, error) { - if len(path) == 0 { - return appendOptionBytesSingle(b, &o.interpretedField) - } - // NB: if we add functions to compute sizes of the options first, we could - // allocate precisely sized slice up front, which would be more efficient than - // repeated creation/growing/concatenation. - enclosed, err := o.appendOptionBytesWithPath(nil, path[1:]) - if err != nil { - return nil, err - } - b = protowire.AppendTag(b, protowire.Number(path[0]), protowire.BytesType) - return protowire.AppendBytes(b, enclosed), nil -} - -// interpretedField represents a field in an options message that is the -// result of interpreting an option. This is used for the option value -// itself as well as for subfields when an option value is a message -// literal. -type interpretedField struct { - // field number - number int32 - // index of this element inside a repeated field; only set if repeated == true - index int32 - // true if this is a repeated field - repeated bool - // true if this is a repeated field that stores scalar values in packed form - packed bool - // the field's kind - kind protoreflect.Kind - - value interpretedFieldValue -} - -// interpretedFieldValue is a wrapper around protoreflect.Value that -// includes extra metadata. -type interpretedFieldValue struct { - // the field value - val protoreflect.Value - // if true, this value is a list of values, not a singular value - isList bool - // non-nil for singular message values - msgVal []*interpretedField - // non-nil for non-empty lists of message values - msgListVal [][]*interpretedField -} - -func appendOptionBytes(b []byte, flds []*interpretedField) ([]byte, error) { - // protoc emits messages sorted by field number - if len(flds) > 1 { - sort.SliceStable(flds, func(i, j int) bool { - return flds[i].number < flds[j].number - }) - } - - for i := 0; i < len(flds); i++ { - f := flds[i] - switch { - case f.packed && canPack(f.kind): - // for packed repeated numeric fields, all runs of values are merged into one packed list - num := f.number - j := i - for j < len(flds) && flds[j].number == num { - j++ - } - // now flds[i:j] is the range of contiguous fields for the same field number - enclosed, err := appendOptionBytesPacked(nil, f.kind, flds[i:j]) - if err != nil { - return nil, err - } - b = protowire.AppendTag(b, protowire.Number(f.number), protowire.BytesType) - b = protowire.AppendBytes(b, enclosed) - // skip over the other subsequent fields we just serialized - i = j - 1 - case f.value.isList: - // if not packed, then emit one value at a time - single := *f - single.value.isList = false - single.value.msgListVal = nil - l := f.value.val.List() - for i := 0; i < l.Len(); i++ { - single.value.val = l.Get(i) - if f.kind == protoreflect.MessageKind || f.kind == protoreflect.GroupKind { - single.value.msgVal = f.value.msgListVal[i] - } - var err error - b, err = appendOptionBytesSingle(b, &single) - if err != nil { - return nil, err - } - } - default: - // simple singular value - var err error - b, err = appendOptionBytesSingle(b, f) - if err != nil { - return nil, err - } - } - } - - return b, nil -} - -func canPack(k protoreflect.Kind) bool { - switch k { - case protoreflect.MessageKind, protoreflect.GroupKind, protoreflect.StringKind, protoreflect.BytesKind: - return false - default: - return true - } -} - -func appendOptionBytesPacked(b []byte, k protoreflect.Kind, flds []*interpretedField) ([]byte, error) { - for i := range flds { - val := flds[i].value - if val.isList { - l := val.val.List() - var err error - b, err = appendNumericValueBytesPacked(b, k, l) - if err != nil { - return nil, err - } - } else { - var err error - b, err = appendNumericValueBytes(b, k, val.val) - if err != nil { - return nil, err - } - } - } - return b, nil -} - -func appendOptionBytesSingle(b []byte, f *interpretedField) ([]byte, error) { - num := protowire.Number(f.number) - switch f.kind { - case protoreflect.MessageKind: - enclosed, err := appendOptionBytes(nil, f.value.msgVal) - if err != nil { - return nil, err - } - b = protowire.AppendTag(b, num, protowire.BytesType) - return protowire.AppendBytes(b, enclosed), nil - - case protoreflect.GroupKind: - b = protowire.AppendTag(b, num, protowire.StartGroupType) - var err error - b, err = appendOptionBytes(b, f.value.msgVal) - if err != nil { - return nil, err - } - return protowire.AppendTag(b, num, protowire.EndGroupType), nil - - case protoreflect.StringKind: - b = protowire.AppendTag(b, num, protowire.BytesType) - return protowire.AppendString(b, f.value.val.String()), nil - - case protoreflect.BytesKind: - b = protowire.AppendTag(b, num, protowire.BytesType) - return protowire.AppendBytes(b, f.value.val.Bytes()), nil - - case protoreflect.Int32Kind, protoreflect.Int64Kind, protoreflect.Uint32Kind, protoreflect.Uint64Kind, - protoreflect.Sint32Kind, protoreflect.Sint64Kind, protoreflect.EnumKind, protoreflect.BoolKind: - b = protowire.AppendTag(b, num, protowire.VarintType) - return appendNumericValueBytes(b, f.kind, f.value.val) - - case protoreflect.Fixed32Kind, protoreflect.Sfixed32Kind, protoreflect.FloatKind: - b = protowire.AppendTag(b, num, protowire.Fixed32Type) - return appendNumericValueBytes(b, f.kind, f.value.val) - - case protoreflect.Fixed64Kind, protoreflect.Sfixed64Kind, protoreflect.DoubleKind: - b = protowire.AppendTag(b, num, protowire.Fixed64Type) - return appendNumericValueBytes(b, f.kind, f.value.val) - - default: - return nil, fmt.Errorf("unknown field kind: %v", f.kind) - } -} - -func appendNumericValueBytesPacked(b []byte, k protoreflect.Kind, l protoreflect.List) ([]byte, error) { - for i := 0; i < l.Len(); i++ { - var err error - b, err = appendNumericValueBytes(b, k, l.Get(i)) - if err != nil { - return nil, err - } - } - return b, nil -} - -func appendNumericValueBytes(b []byte, k protoreflect.Kind, v protoreflect.Value) ([]byte, error) { - switch k { - case protoreflect.Int32Kind, protoreflect.Int64Kind: - return protowire.AppendVarint(b, uint64(v.Int())), nil - case protoreflect.Uint32Kind, protoreflect.Uint64Kind: - return protowire.AppendVarint(b, v.Uint()), nil - case protoreflect.Sint32Kind, protoreflect.Sint64Kind: - return protowire.AppendVarint(b, protowire.EncodeZigZag(v.Int())), nil - case protoreflect.Fixed32Kind: - return protowire.AppendFixed32(b, uint32(v.Uint())), nil - case protoreflect.Fixed64Kind: - return protowire.AppendFixed64(b, v.Uint()), nil - case protoreflect.Sfixed32Kind: - return protowire.AppendFixed32(b, uint32(v.Int())), nil - case protoreflect.Sfixed64Kind: - return protowire.AppendFixed64(b, uint64(v.Int())), nil - case protoreflect.FloatKind: - return protowire.AppendFixed32(b, math.Float32bits(float32(v.Float()))), nil - case protoreflect.DoubleKind: - return protowire.AppendFixed64(b, math.Float64bits(v.Float())), nil - case protoreflect.BoolKind: - return protowire.AppendVarint(b, protowire.EncodeBool(v.Bool())), nil - case protoreflect.EnumKind: - return protowire.AppendVarint(b, uint64(v.Enum())), nil - default: - return nil, fmt.Errorf("unknown field kind: %v", k) - } -} - -// optionsContainer may be optionally implemented by a linker.Result. It is -// not part of the linker.Result interface as it is meant only for internal use. -// This allows the option interpreter step to store extra metadata about the -// serialized structure of options. -type optionsContainer interface { - // AddOptionBytes adds the given pre-serialized option bytes to a file, - // associated with the given options message. The type of the given message - // should be an options message, for example *descriptorpb.MessageOptions. - // This value should be part of the message hierarchy whose root is the - // *descriptorpb.FileDescriptorProto that corresponds to this result. - AddOptionBytes(pm proto.Message, opts []byte) -} - -// interpretOptions processes the options in uninterpreted, which are interpreted as fields -// of the given opts message. On success, it will usually return nil, nil. But if the current -// operation is lenient, it may return a non-nil slice of uninterpreted options on success. -// In such a case, the returned value is the remaining slice of options which could not be -// interpreted. -func (interp *interpreter) interpretOptions(fqn string, element, opts proto.Message, uninterpreted []*descriptorpb.UninterpretedOption) ([]*descriptorpb.UninterpretedOption, error) { - optsDesc := opts.ProtoReflect().Descriptor() - optsFqn := string(optsDesc.FullName()) - var msg protoreflect.Message - // see if the parse included an override copy for these options - if md := interp.resolveOptionsType(optsFqn); md != nil { - dm := dynamicpb.NewMessage(md) - if err := cloneInto(dm, opts, nil); err != nil { - node := interp.file.Node(element) - return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node).Start(), err)) - } - msg = dm - } else { - msg = proto.Clone(opts).ProtoReflect() - } - - mc := &internal.MessageContext{ - File: interp.file, - ElementName: fqn, - ElementType: descriptorType(element), - } - var remain []*descriptorpb.UninterpretedOption - results := make([]*interpretedOption, 0, len(uninterpreted)) - for _, uo := range uninterpreted { - node := interp.file.OptionNode(uo) - if !uo.Name[0].GetIsExtension() && uo.Name[0].GetNamePart() == "uninterpreted_option" { - if interp.lenient { - remain = append(remain, uo) - continue - } - // uninterpreted_option might be found reflectively, but is not actually valid for use - if err := interp.reporter.HandleErrorf(interp.nodeInfo(node.GetName()).Start(), "%vinvalid option 'uninterpreted_option'", mc); err != nil { - return nil, err - } - } - mc.Option = uo - res, err := interp.interpretField(mc, msg, uo, 0, nil) - if err != nil { - if interp.lenient { - remain = append(remain, uo) - continue - } - return nil, err - } - res.unknown = !isKnownField(optsDesc, res) - results = append(results, res) - if optn, ok := node.(*ast.OptionNode); ok { - interp.index[optn] = res.path() - } - } - - if interp.lenient { - // If we're lenient, then we don't want to clobber the passed in message - // and leave it partially populated. So we convert into a copy first - optsClone := opts.ProtoReflect().New().Interface() - if err := cloneInto(optsClone, msg.Interface(), interp.resolver); err != nil { - // TODO: do this in a more granular way, so we can convert individual - // fields and leave bad ones uninterpreted instead of skipping all of - // the work we've done so far. - return uninterpreted, nil - } - // conversion from dynamic message above worked, so now - // it is safe to overwrite the passed in message - proto.Reset(opts) - proto.Merge(opts, optsClone) - - if interp.container != nil { - b, err := interp.toOptionBytes(mc, results) - if err != nil { - return nil, err - } - interp.container.AddOptionBytes(opts, b) - } - - return remain, nil - } - - if err := validateRecursive(msg, ""); err != nil { - node := interp.file.Node(element) - if err := interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), "error in %s options: %v", descriptorType(element), err); err != nil { - return nil, err - } - } - - // now try to convert into the passed in message and fail if not successful - if err := cloneInto(opts, msg.Interface(), interp.resolver); err != nil { - node := interp.file.Node(element) - return nil, interp.reporter.HandleError(reporter.Error(interp.nodeInfo(node).Start(), err)) - } - if interp.container != nil { - b, err := interp.toOptionBytes(mc, results) - if err != nil { - return nil, err - } - interp.container.AddOptionBytes(opts, b) - } - - return nil, nil -} - -// isKnownField returns true if the given option is for a known field of the -// given options message descriptor and will be serialized using the expected -// wire type for that known field. -func isKnownField(desc protoreflect.MessageDescriptor, opt *interpretedOption) bool { - var num int32 - if len(opt.pathPrefix) > 0 { - num = opt.pathPrefix[0] - } else { - num = opt.number - } - fd := desc.Fields().ByNumber(protoreflect.FieldNumber(num)) - if fd == nil { - return false - } - - // Before the full wire type check, we do a quick check that will usually pass - // and allow us to short-circuit the logic below. - if fd.IsList() == opt.repeated && fd.Kind() == opt.kind { - return true - } - - // We figure out the wire type this interpreted field will use when serialized. - var wireType protowire.Type - switch { - case len(opt.pathPrefix) > 0: - // If path prefix exists, this field is nested inside a message. - // And messages use bytes wire type. - wireType = protowire.BytesType - case opt.repeated && opt.packed && canPack(opt.kind): - // Packed repeated numeric scalars use bytes wire type. - wireType = protowire.BytesType - default: - wireType = wireTypeForKind(opt.kind) - } - - // And then we see if the wire type we just determined is compatible with - // the field descriptor we found. - if fd.IsList() && canPack(fd.Kind()) && wireType == protowire.BytesType { - // Even if fd.IsPacked() is false, bytes type is still accepted for - // repeated scalar numerics, so that changing a repeated field from - // packed to not-packed (or vice versa) is a compatible change. - return true - } - return wireType == wireTypeForKind(fd.Kind()) -} - -func wireTypeForKind(kind protoreflect.Kind) protowire.Type { - switch kind { - case protoreflect.StringKind, protoreflect.BytesKind, protoreflect.MessageKind: - return protowire.BytesType - case protoreflect.GroupKind: - return protowire.StartGroupType - case protoreflect.Fixed32Kind, protoreflect.Sfixed32Kind, protoreflect.FloatKind: - return protowire.Fixed32Type - case protoreflect.Fixed64Kind, protoreflect.Sfixed64Kind, protoreflect.DoubleKind: - return protowire.Fixed64Type - default: - // everything else uses varint - return protowire.VarintType - } -} - -func cloneInto(dest proto.Message, src proto.Message, res linker.Resolver) error { - if dest.ProtoReflect().Descriptor() == src.ProtoReflect().Descriptor() { - proto.Reset(dest) - proto.Merge(dest, src) - if err := proto.CheckInitialized(dest); err != nil { - return err - } - return nil - } - - // If descriptors are not the same, we could have field descriptors in src that - // don't match the ones in dest. There's no easy/sane way to handle that. So we - // just marshal to bytes and back to do this - data, err := proto.Marshal(src) - if err != nil { - return err - } - return proto.UnmarshalOptions{Resolver: res}.Unmarshal(data, dest) -} - -func (interp *interpreter) toOptionBytes(mc *internal.MessageContext, results []*interpretedOption) ([]byte, error) { - // protoc emits non-custom options in tag order and then - // the rest are emitted in the order they are defined in source - sort.SliceStable(results, func(i, j int) bool { - if !results[i].unknown && results[j].unknown { - return true - } - if !results[i].unknown && !results[j].unknown { - return results[i].number < results[j].number - } - return false - }) - var b []byte - for _, res := range results { - var err error - b, err = res.appendOptionBytes(b) - if err != nil { - if _, ok := err.(reporter.ErrorWithPos); !ok { - pos := ast.SourcePos{Filename: interp.file.AST().Name()} - err = reporter.Errorf(pos, "%sfailed to encode options: %w", mc, err) - } - if err := interp.reporter.HandleError(err); err != nil { - return nil, err - } - } - } - return b, nil -} - -func validateRecursive(msg protoreflect.Message, prefix string) error { - flds := msg.Descriptor().Fields() - var missingFields []string - for i := 0; i < flds.Len(); i++ { - fld := flds.Get(i) - if fld.Cardinality() == protoreflect.Required && !msg.Has(fld) { - missingFields = append(missingFields, fmt.Sprintf("%s%s", prefix, fld.Name())) - } - } - if len(missingFields) > 0 { - return fmt.Errorf("some required fields missing: %v", strings.Join(missingFields, ", ")) - } - - var err error - msg.Range(func(fld protoreflect.FieldDescriptor, val protoreflect.Value) bool { - if fld.IsMap() { - md := fld.MapValue().Message() - if md != nil { - val.Map().Range(func(k protoreflect.MapKey, v protoreflect.Value) bool { - chprefix := fmt.Sprintf("%s%s[%v].", prefix, fieldName(fld), k) - err = validateRecursive(v.Message(), chprefix) - return err == nil - }) - if err != nil { - return false - } - } - } else { - md := fld.Message() - if md != nil { - if fld.IsList() { - sl := val.List() - for i := 0; i < sl.Len(); i++ { - v := sl.Get(i) - chprefix := fmt.Sprintf("%s%s[%d].", prefix, fieldName(fld), i) - err = validateRecursive(v.Message(), chprefix) - if err != nil { - return false - } - } - } else { - chprefix := fmt.Sprintf("%s%s.", prefix, fieldName(fld)) - err = validateRecursive(val.Message(), chprefix) - if err != nil { - return false - } - } - } - } - return true - }) - return err -} - -// interpretField interprets the option described by opt, as a field inside the given msg. This -// interprets components of the option name starting at nameIndex. When nameIndex == 0, then -// msg must be an options message. For nameIndex > 0, msg is a nested message inside of the -// options message. The given pathPrefix is the path (sequence of field numbers and indices -// with a FileDescriptorProto as the start) up to but not including the given nameIndex. -func (interp *interpreter) interpretField(mc *internal.MessageContext, msg protoreflect.Message, opt *descriptorpb.UninterpretedOption, nameIndex int, pathPrefix []int32) (*interpretedOption, error) { - var fld protoreflect.FieldDescriptor - nm := opt.GetName()[nameIndex] - node := interp.file.OptionNamePartNode(nm) - if nm.GetIsExtension() { - extName := nm.GetNamePart() - if extName[0] == '.' { - extName = extName[1:] /* skip leading dot */ - } - var err error - fld, err = interp.resolveExtensionType(extName) - if errors.Is(err, protoregistry.NotFound) { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), - "%vunrecognized extension %s of %s", - mc, extName, msg.Descriptor().FullName()) - } else if err != nil { - return nil, interp.reporter.HandleErrorWithPos(interp.nodeInfo(node).Start(), err) - } - if fld.ContainingMessage().FullName() != msg.Descriptor().FullName() { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), - "%vextension %s should extend %s but instead extends %s", - mc, extName, msg.Descriptor().FullName(), fld.ContainingMessage().FullName()) - } - } else { - fld = msg.Descriptor().Fields().ByName(protoreflect.Name(nm.GetNamePart())) - if fld == nil { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), - "%vfield %s of %s does not exist", - mc, nm.GetNamePart(), msg.Descriptor().FullName()) - } - } - - if len(opt.GetName()) > nameIndex+1 { - nextnm := opt.GetName()[nameIndex+1] - nextnode := interp.file.OptionNamePartNode(nextnm) - k := fld.Kind() - if k != protoreflect.MessageKind && k != protoreflect.GroupKind { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode).Start(), - "%vcannot set field %s because %s is not a message", - mc, nextnm.GetNamePart(), nm.GetNamePart()) - } - if fld.Cardinality() == protoreflect.Repeated { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(nextnode).Start(), - "%vcannot set field %s because %s is repeated (must use an aggregate)", - mc, nextnm.GetNamePart(), nm.GetNamePart()) - } - var fdm protoreflect.Message - if msg.Has(fld) { - v := msg.Mutable(fld) - fdm = v.Message() - } else { - if ood := fld.ContainingOneof(); ood != nil { - existingFld := msg.WhichOneof(ood) - if existingFld != nil && existingFld.Number() != fld.Number() { - return nil, interp.reporter.HandleErrorf(interp.nodeInfo(node).Start(), - "%voneof %q already has field %q set", - mc, ood.Name(), fieldName(existingFld)) - } - } - fdm = dynamicpb.NewMessage(fld.Message()) - msg.Set(fld, protoreflect.ValueOfMessage(fdm)) - } - // recurse to set next part of name - return interp.interpretField(mc, fdm, opt, nameIndex+1, append(pathPrefix, int32(fld.Number()))) - } - - optNode := interp.file.OptionNode(opt) - val, err := interp.setOptionField(mc, msg, fld, node, optNode.GetValue(), false) - if err != nil { - return nil, interp.reporter.HandleError(err) - } - var index int32 - if fld.IsMap() { - index = int32(msg.Get(fld).Map().Len()) - 1 - } else if fld.IsList() { - index = int32(msg.Get(fld).List().Len()) - 1 - } - return &interpretedOption{ - pathPrefix: pathPrefix, - interpretedField: interpretedField{ - number: int32(fld.Number()), - index: index, - kind: fld.Kind(), - repeated: fld.Cardinality() == protoreflect.Repeated, - value: val, - // NB: don't set packed here in a top-level option - // (only values in message literals will be serialized - // in packed format) - }, - }, nil -} - -// setOptionField sets the value for field fld in the given message msg to the value represented -// by val. The given name is the AST node that corresponds to the name of fld. On success, it -// returns additional metadata about the field that was set. -func (interp *interpreter) setOptionField(mc *internal.MessageContext, msg protoreflect.Message, fld protoreflect.FieldDescriptor, name ast.Node, val ast.ValueNode, insideMsgLiteral bool) (interpretedFieldValue, error) { - v := val.Value() - if sl, ok := v.([]ast.ValueNode); ok { - // handle slices a little differently than the others - if fld.Cardinality() != protoreflect.Repeated { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue is an array but field is not repeated", mc) - } - origPath := mc.OptAggPath - defer func() { - mc.OptAggPath = origPath - }() - var resVal listValue - var resMsgVals [][]*interpretedField - for index, item := range sl { - mc.OptAggPath = fmt.Sprintf("%s[%d]", origPath, index) - value, err := interp.fieldValue(mc, fld, item, insideMsgLiteral) - if err != nil { - return interpretedFieldValue{}, err - } - if fld.IsMap() { - setMapEntry(msg, fld, &value) - } else { - msg.Mutable(fld).List().Append(value.val) - } - resVal = append(resVal, value.val) - if value.msgVal != nil { - resMsgVals = append(resMsgVals, value.msgVal) - } - } - return interpretedFieldValue{ - isList: true, - val: protoreflect.ValueOfList(&resVal), - msgListVal: resMsgVals, - }, nil - } - - value, err := interp.fieldValue(mc, fld, val, insideMsgLiteral) - if err != nil { - return interpretedFieldValue{}, err - } - - if ood := fld.ContainingOneof(); ood != nil { - existingFld := msg.WhichOneof(ood) - if existingFld != nil && existingFld.Number() != fld.Number() { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%voneof %q already has field %q set", mc, ood.Name(), fieldName(existingFld)) - } - } - - switch { - case fld.IsMap(): - setMapEntry(msg, fld, &value) - case fld.IsList(): - msg.Mutable(fld).List().Append(value.val) - default: - if msg.Has(fld) { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(name).Start(), "%vnon-repeated option field %s already set", mc, fieldName(fld)) - } - msg.Set(fld, value.val) - } - return value, nil -} - -func setMapEntry(msg protoreflect.Message, fld protoreflect.FieldDescriptor, value *interpretedFieldValue) { - entry := value.val.Message() - keyFld, valFld := fld.MapKey(), fld.MapValue() - // if an entry is missing a key or value, we add in an explicit - // zero value to msgVals to match protoc (which also odds these - // in even if not present in source) - if !entry.Has(keyFld) { - // put key before value - value.msgVal = append(append(([]*interpretedField)(nil), zeroValue(keyFld)), value.msgVal...) - } - if !entry.Has(valFld) { - value.msgVal = append(value.msgVal, zeroValue(valFld)) - } - key := entry.Get(keyFld) - val := entry.Get(valFld) - if dm, ok := val.Interface().(*dynamicpb.Message); ok && (dm == nil || !dm.IsValid()) { - val = protoreflect.ValueOfMessage(dynamicpb.NewMessage(valFld.Message())) - } - m := msg.Mutable(fld).Map() - // TODO: error if key is already present - m.Set(key.MapKey(), val) -} - -// zeroValue returns the zero value for the field types as a *interpretedField. -// The given fld must NOT be a repeated field. -func zeroValue(fld protoreflect.FieldDescriptor) *interpretedField { - var val protoreflect.Value - var msgVal []*interpretedField - switch fld.Kind() { - case protoreflect.MessageKind, protoreflect.GroupKind: - // needs to be non-nil, but empty - msgVal = []*interpretedField{} - msg := dynamicpb.NewMessage(fld.Message()) - val = protoreflect.ValueOfMessage(msg) - case protoreflect.EnumKind: - val = protoreflect.ValueOfEnum(0) - case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: - val = protoreflect.ValueOfInt32(0) - case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: - val = protoreflect.ValueOfUint32(0) - case protoreflect.Int64Kind, protoreflect.Sint64Kind, protoreflect.Sfixed64Kind: - val = protoreflect.ValueOfInt64(0) - case protoreflect.Uint64Kind, protoreflect.Fixed64Kind: - val = protoreflect.ValueOfUint64(0) - case protoreflect.BoolKind: - val = protoreflect.ValueOfBool(false) - case protoreflect.FloatKind: - val = protoreflect.ValueOfFloat32(0) - case protoreflect.DoubleKind: - val = protoreflect.ValueOfFloat64(0) - case protoreflect.BytesKind: - val = protoreflect.ValueOfBytes(nil) - case protoreflect.StringKind: - val = protoreflect.ValueOfString("") - } - return &interpretedField{ - number: int32(fld.Number()), - kind: fld.Kind(), - value: interpretedFieldValue{ - val: val, - msgVal: msgVal, - }, - } -} - -type listValue []protoreflect.Value - -var _ protoreflect.List = (*listValue)(nil) - -func (l listValue) Len() int { - return len(l) -} - -func (l listValue) Get(i int) protoreflect.Value { - return l[i] -} - -func (l listValue) Set(i int, value protoreflect.Value) { - l[i] = value -} - -func (l *listValue) Append(value protoreflect.Value) { - *l = append(*l, value) -} - -func (l listValue) AppendMutable() protoreflect.Value { - panic("AppendMutable not supported") -} - -func (l *listValue) Truncate(i int) { - *l = (*l)[:i] -} - -func (l listValue) NewElement() protoreflect.Value { - panic("NewElement not supported") -} - -func (l listValue) IsValid() bool { - return true -} - -func fieldName(fld protoreflect.FieldDescriptor) string { - if fld.IsExtension() { - return fmt.Sprintf("(%s)", fld.FullName()) - } - return string(fld.Name()) -} - -func valueKind(val interface{}) string { - switch val := val.(type) { - case ast.Identifier: - return "identifier" - case bool: - return "bool" - case int64: - if val < 0 { - return "negative integer" - } - return "integer" - case uint64: - return "integer" - case float64: - return "double" - case string, []byte: - return "string" - case []*ast.MessageFieldNode: - return "message" - case []ast.ValueNode: - return "array" - default: - return fmt.Sprintf("%T", val) - } -} - -// fieldValue computes a compile-time value (constant or list or message literal) for the given -// AST node val. The value in val must be assignable to the field fld. -func (interp *interpreter) fieldValue(mc *internal.MessageContext, fld protoreflect.FieldDescriptor, val ast.ValueNode, insideMsgLiteral bool) (interpretedFieldValue, error) { - k := fld.Kind() - switch k { - case protoreflect.EnumKind: - num, _, err := interp.enumFieldValue(mc, fld.Enum(), val, insideMsgLiteral) - if err != nil { - return interpretedFieldValue{}, err - } - return interpretedFieldValue{val: protoreflect.ValueOfEnum(num)}, nil - - case protoreflect.MessageKind, protoreflect.GroupKind: - v := val.Value() - if aggs, ok := v.([]*ast.MessageFieldNode); ok { - fmd := fld.Message() - return interp.messageLiteralValue(mc, aggs, fmd) - } - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting message, got %s", mc, valueKind(v)) - - default: - v, err := interp.scalarFieldValue(mc, descriptorpb.FieldDescriptorProto_Type(k), val, insideMsgLiteral) - if err != nil { - return interpretedFieldValue{}, err - } - return interpretedFieldValue{val: protoreflect.ValueOf(v)}, nil - } -} - -// enumFieldValue resolves the given AST node val as an enum value descriptor. If the given -// value is not a valid identifier, an error is returned instead. -func (interp *interpreter) enumFieldValue(mc *internal.MessageContext, ed protoreflect.EnumDescriptor, val ast.ValueNode, allowNumber bool) (protoreflect.EnumNumber, protoreflect.Name, error) { - v := val.Value() - var num protoreflect.EnumNumber - switch v := v.(type) { - case ast.Identifier: - name := protoreflect.Name(v) - ev := ed.Values().ByName(name) - if ev == nil { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%venum %s has no value named %s", mc, ed.FullName(), v) - } - return ev.Number(), name, nil - case int64: - if !allowNumber { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum name, got %s", mc, valueKind(v)) - } - if v > math.MaxInt32 || v < math.MinInt32 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for an enum", mc, v) - } - num = protoreflect.EnumNumber(v) - case uint64: - if !allowNumber { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum name, got %s", mc, valueKind(v)) - } - if v > math.MaxInt32 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for an enum", mc, v) - } - num = protoreflect.EnumNumber(v) - default: - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting enum, got %s", mc, valueKind(v)) - } - ev := ed.Values().ByNumber(num) - if ev != nil { - return num, ev.Name(), nil - } - if ed.Syntax() != protoreflect.Proto3 { - return 0, "", reporter.Errorf(interp.nodeInfo(val).Start(), "%vclosed enum %s has no value with number %d", mc, ed.FullName(), num) - } - // unknown value, but enum is open, so we allow it and return blank name - return num, "", nil -} - -// scalarFieldValue resolves the given AST node val as a value whose type is assignable to a -// field with the given fldType. -func (interp *interpreter) scalarFieldValue(mc *internal.MessageContext, fldType descriptorpb.FieldDescriptorProto_Type, val ast.ValueNode, insideMsgLiteral bool) (interface{}, error) { - v := val.Value() - switch fldType { - case descriptorpb.FieldDescriptorProto_TYPE_BOOL: - if b, ok := v.(bool); ok { - return b, nil - } - if id, ok := v.(ast.Identifier); ok { - if insideMsgLiteral { - // inside a message literal, values use the protobuf text format, - // which is lenient in that it accepts "t" and "f" or "True" and "False" - switch id { - case "t", "true", "True": - return true, nil - case "f", "false", "False": - return false, nil - } - } else { - // options with simple scalar values (no message literal) are stricter - switch id { - case "true": - return true, nil - case "false": - return false, nil - } - } - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting bool, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_BYTES: - if str, ok := v.(string); ok { - return []byte(str), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting bytes, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_STRING: - if str, ok := v.(string); ok { - return str, nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting string, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_INT32, descriptorpb.FieldDescriptorProto_TYPE_SINT32, descriptorpb.FieldDescriptorProto_TYPE_SFIXED32: - if i, ok := v.(int64); ok { - if i > math.MaxInt32 || i < math.MinInt32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int32", mc, i) - } - return int32(i), nil - } - if ui, ok := v.(uint64); ok { - if ui > math.MaxInt32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int32", mc, ui) - } - return int32(ui), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting int32, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_UINT32, descriptorpb.FieldDescriptorProto_TYPE_FIXED32: - if i, ok := v.(int64); ok { - if i > math.MaxUint32 || i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint32", mc, i) - } - return uint32(i), nil - } - if ui, ok := v.(uint64); ok { - if ui > math.MaxUint32 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint32", mc, ui) - } - return uint32(ui), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting uint32, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_INT64, descriptorpb.FieldDescriptorProto_TYPE_SINT64, descriptorpb.FieldDescriptorProto_TYPE_SFIXED64: - if i, ok := v.(int64); ok { - return i, nil - } - if ui, ok := v.(uint64); ok { - if ui > math.MaxInt64 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for int64", mc, ui) - } - return int64(ui), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting int64, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_UINT64, descriptorpb.FieldDescriptorProto_TYPE_FIXED64: - if i, ok := v.(int64); ok { - if i < 0 { - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vvalue %d is out of range for uint64", mc, i) - } - return uint64(i), nil - } - if ui, ok := v.(uint64); ok { - return ui, nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting uint64, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_DOUBLE: - if id, ok := v.(ast.Identifier); ok { - switch id { - case "inf": - return math.Inf(1), nil - case "nan": - return math.NaN(), nil - } - } - if d, ok := v.(float64); ok { - return d, nil - } - if i, ok := v.(int64); ok { - return float64(i), nil - } - if u, ok := v.(uint64); ok { - return float64(u), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting double, got %s", mc, valueKind(v)) - case descriptorpb.FieldDescriptorProto_TYPE_FLOAT: - if id, ok := v.(ast.Identifier); ok { - switch id { - case "inf": - return float32(math.Inf(1)), nil - case "nan": - return float32(math.NaN()), nil - } - } - if d, ok := v.(float64); ok { - return float32(d), nil - } - if i, ok := v.(int64); ok { - return float32(i), nil - } - if u, ok := v.(uint64); ok { - return float32(u), nil - } - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vexpecting float, got %s", mc, valueKind(v)) - default: - return nil, reporter.Errorf(interp.nodeInfo(val).Start(), "%vunrecognized field type: %s", mc, fldType) - } -} - -func descriptorType(m proto.Message) string { - switch m := m.(type) { - case *descriptorpb.DescriptorProto: - return "message" - case *descriptorpb.DescriptorProto_ExtensionRange: - return "extension range" - case *descriptorpb.FieldDescriptorProto: - if m.GetExtendee() == "" { - return "field" - } - return "extension" - case *descriptorpb.EnumDescriptorProto: - return "enum" - case *descriptorpb.EnumValueDescriptorProto: - return "enum value" - case *descriptorpb.ServiceDescriptorProto: - return "service" - case *descriptorpb.MethodDescriptorProto: - return "method" - case *descriptorpb.FileDescriptorProto: - return "file" - default: - // shouldn't be possible - return fmt.Sprintf("%T", m) - } -} - -func (interp *interpreter) messageLiteralValue(mc *internal.MessageContext, fieldNodes []*ast.MessageFieldNode, fmd protoreflect.MessageDescriptor) (interpretedFieldValue, error) { - fdm := dynamicpb.NewMessage(fmd) - origPath := mc.OptAggPath - defer func() { - mc.OptAggPath = origPath - }() - // NB: we don't want to leave this nil, even if the - // message is empty, because that indicates to - // caller that the result is not a message - flds := make([]*interpretedField, 0, len(fieldNodes)) - var foundAnyNode bool - for _, fieldNode := range fieldNodes { - if origPath == "" { - mc.OptAggPath = fieldNode.Name.Value() - } else { - mc.OptAggPath = origPath + "." + fieldNode.Name.Value() - } - if fieldNode.Name.IsAnyTypeReference() { - if fmd.FullName() != "google.protobuf.Any" { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vtype references are only allowed for google.protobuf.Any, but this type is %s", mc, fmd.FullName()) - } - if foundAnyNode { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vmultiple any type references are not allowed", mc) - } - foundAnyNode = true - urlPrefix := fieldNode.Name.URLPrefix.AsIdentifier() - msgName := fieldNode.Name.Name.AsIdentifier() - fullURL := fmt.Sprintf("%s/%s", urlPrefix, msgName) - // TODO: Support other URLs dynamically -- the caller of protoparse - // should be able to provide a fldNode custom resolver that can resolve type - // URLs into message descriptors. The default resolver would be - // implemented as below, only accepting "type.googleapis.com" and - // "type.googleprod.com" as hosts/prefixes and using the compiled - // file's transitive closure to find the named message. - if urlPrefix != "type.googleapis.com" && urlPrefix != "type.googleprod.com" { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vcould not resolve type reference %s", mc, fullURL) - } - anyFields, ok := fieldNode.Val.Value().([]*ast.MessageFieldNode) - if !ok { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "%vtype references for google.protobuf.Any must have message literal value", mc) - } - anyMd := resolveDescriptor[protoreflect.MessageDescriptor](interp.resolver, string(msgName)) - if anyMd == nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name.URLPrefix).Start(), "%vcould not resolve type reference %s", mc, fullURL) - } - // parse the message value - msgVal, err := interp.messageLiteralValue(mc, anyFields, anyMd) - if err != nil { - return interpretedFieldValue{}, err - } - - // Any is defined with two fields: - // string type_url = 1 - // bytes value = 2 - typeURLDescriptor := fmd.Fields().ByNumber(1) - if typeURLDescriptor == nil || typeURLDescriptor.Kind() != protoreflect.StringKind { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfailed to set type_url string field on Any: %w", mc, err) - } - fdm.Set(typeURLDescriptor, protoreflect.ValueOfString(fullURL)) - valueDescriptor := fmd.Fields().ByNumber(2) - if valueDescriptor == nil || valueDescriptor.Kind() != protoreflect.BytesKind { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfailed to set value bytes field on Any: %w", mc, err) - } - b, err := proto.MarshalOptions{Deterministic: true}.Marshal(msgVal.val.Message().Interface()) - if err != nil { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "%vfailed to serialize message value: %w", mc, err) - } - fdm.Set(valueDescriptor, protoreflect.ValueOfBytes(b)) - } else { - var ffld protoreflect.FieldDescriptor - var err error - if fieldNode.Name.IsExtension() { - n := interp.file.ResolveMessageLiteralExtensionName(fieldNode.Name.Name) - if n == "" { - // this should not be possible! - n = string(fieldNode.Name.Name.AsIdentifier()) - } - ffld, err = interp.resolveExtensionType(n) - if errors.Is(err, protoregistry.NotFound) { - // may need to qualify with package name - // (this should not be necessary!) - pkg := mc.File.FileDescriptorProto().GetPackage() - if pkg != "" { - ffld, err = interp.resolveExtensionType(pkg + "." + n) - } - } - } else { - ffld = fmd.Fields().ByName(protoreflect.Name(fieldNode.Name.Value())) - // Groups are indicated in the text format by the group name (which is - // camel-case), NOT the field name (which is lower-case). - // ...but only regular fields, not extensions that are groups... - if ffld != nil && ffld.Kind() == protoreflect.GroupKind && ffld.Message().Name() != protoreflect.Name(fieldNode.Name.Value()) { - // this is kind of silly to fail here, but this mimics protoc behavior - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), "%vfield %s not found (did you mean the group named %s?)", mc, fieldNode.Name.Value(), ffld.Message().Name()) - } - if ffld == nil { - err = protoregistry.NotFound - // could be a group name - for i := 0; i < fmd.Fields().Len(); i++ { - fd := fmd.Fields().Get(i) - if fd.Kind() == protoreflect.GroupKind && fd.Message().Name() == protoreflect.Name(fieldNode.Name.Value()) { - // found it! - ffld = fd - err = nil - break - } - } - } - } - if errors.Is(err, protoregistry.NotFound) { - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Name).Start(), - "%vfield %s not found", mc, string(fieldNode.Name.Name.AsIdentifier())) - } else if err != nil { - return interpretedFieldValue{}, reporter.Error(interp.nodeInfo(fieldNode.Name).Start(), err) - } - if fieldNode.Sep == nil && ffld.Message() == nil { - // If there is no separator, the field type should be a message. - // Otherwise it is an error in the text format. - return interpretedFieldValue{}, reporter.Errorf(interp.nodeInfo(fieldNode.Val).Start(), "syntax error: unexpected value, expecting ':'") - } - res, err := interp.setOptionField(mc, fdm, ffld, fieldNode.Name, fieldNode.Val, true) - if err != nil { - return interpretedFieldValue{}, err - } - flds = append(flds, &interpretedField{ - number: int32(ffld.Number()), - kind: ffld.Kind(), - repeated: ffld.Cardinality() == protoreflect.Repeated, - packed: ffld.IsPacked(), - value: res, - // NB: no need to set index here, inside message literal - // (it is only used for top-level options, for emitting - // source code info) - }) - } - } - return interpretedFieldValue{ - val: protoreflect.ValueOfMessage(fdm), - msgVal: flds, - }, nil -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/.gitignore b/vendor/github.com/bufbuild/protocompile/parser/.gitignore deleted file mode 100644 index 26520536f9..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/.gitignore +++ /dev/null @@ -1 +0,0 @@ -y.output diff --git a/vendor/github.com/bufbuild/protocompile/parser/ast.go b/vendor/github.com/bufbuild/protocompile/parser/ast.go deleted file mode 100644 index 105502d406..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/ast.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import "github.com/bufbuild/protocompile/ast" - -// the types below are accumulator types: linked lists that are -// constructed during parsing and then converted to slices of AST nodes -// once the whole list has been parsed -// TODO: change grammar to use slices of nodes instead of these constructions - -type compactOptionList struct { - option *ast.OptionNode - comma *ast.RuneNode - next *compactOptionList -} - -func (list *compactOptionList) toNodes() ([]*ast.OptionNode, []*ast.RuneNode) { - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - opts := make([]*ast.OptionNode, l) - commas := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - opts[i] = cur.option - if cur.comma != nil { - commas[i] = cur.comma - } - } - return opts, commas -} - -type stringList struct { - str *ast.StringLiteralNode - next *stringList -} - -func (list *stringList) toStringValueNode() ast.StringValueNode { - if list.next == nil { - // single name - return list.str - } - - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - strs := make([]*ast.StringLiteralNode, l) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - strs[i] = cur.str - } - return ast.NewCompoundLiteralStringNode(strs...) -} - -type nameList struct { - name ast.StringValueNode - comma *ast.RuneNode - next *nameList -} - -func (list *nameList) toNodes() ([]ast.StringValueNode, []*ast.RuneNode) { - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - names := make([]ast.StringValueNode, l) - commas := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - names[i] = cur.name - if cur.comma != nil { - commas[i] = cur.comma - } - } - return names, commas -} - -type rangeList struct { - rng *ast.RangeNode - comma *ast.RuneNode - next *rangeList -} - -func (list *rangeList) toNodes() ([]*ast.RangeNode, []*ast.RuneNode) { - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - ranges := make([]*ast.RangeNode, l) - commas := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - ranges[i] = cur.rng - if cur.comma != nil { - commas[i] = cur.comma - } - } - return ranges, commas -} - -type valueList struct { - val ast.ValueNode - comma *ast.RuneNode - next *valueList -} - -func (list *valueList) toNodes() ([]ast.ValueNode, []*ast.RuneNode) { - if list == nil { - return nil, nil - } - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - vals := make([]ast.ValueNode, l) - commas := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - vals[i] = cur.val - if cur.comma != nil { - commas[i] = cur.comma - } - } - return vals, commas -} - -type fieldRefList struct { - ref *ast.FieldReferenceNode - dot *ast.RuneNode - next *fieldRefList -} - -func (list *fieldRefList) toNodes() ([]*ast.FieldReferenceNode, []*ast.RuneNode) { - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - refs := make([]*ast.FieldReferenceNode, l) - dots := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - refs[i] = cur.ref - if cur.dot != nil { - dots[i] = cur.dot - } - } - - return refs, dots -} - -type identList struct { - ident *ast.IdentNode - dot *ast.RuneNode - next *identList -} - -func (list *identList) toIdentValueNode(leadingDot *ast.RuneNode) ast.IdentValueNode { - if list.next == nil && leadingDot == nil { - // single name - return list.ident - } - - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - idents := make([]*ast.IdentNode, l) - dots := make([]*ast.RuneNode, l-1) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - idents[i] = cur.ident - if cur.dot != nil { - dots[i] = cur.dot - } - } - - return ast.NewCompoundIdentNode(leadingDot, idents, dots) -} - -type messageFieldEntry struct { - field *ast.MessageFieldNode - delimiter *ast.RuneNode -} - -type messageFieldList struct { - field *messageFieldEntry - next *messageFieldList -} - -func (list *messageFieldList) toNodes() ([]*ast.MessageFieldNode, []*ast.RuneNode) { - if list == nil { - return nil, nil - } - l := 0 - for cur := list; cur != nil; cur = cur.next { - l++ - } - fields := make([]*ast.MessageFieldNode, l) - delimiters := make([]*ast.RuneNode, l) - for cur, i := list, 0; cur != nil; cur, i = cur.next, i+1 { - fields[i] = cur.field.field - if cur.field.delimiter != nil { - delimiters[i] = cur.field.delimiter - } - } - - return fields, delimiters -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/clone.go b/vendor/github.com/bufbuild/protocompile/parser/clone.go deleted file mode 100644 index 7c5505f256..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/clone.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/reporter" -) - -// Clone returns a copy of the given result. Since descriptor protos may be -// mutated during linking, this can return a defensive copy so that mutations -// don't impact concurrent operations in an unsafe way. This is called if the -// parse result could be re-used across concurrent operations and has unresolved -// references and options which will require mutation by the linker. -// -// If the given value has a method with the following signature, it will be -// called to perform the operation: -// -// Clone() Result -// -// If the given value does not provide a Clone method and is not the implementation -// provided by this package, it is possible for an error to occur in creating the -// copy, which may result in a panic. This can happen if the AST of the given result -// is not actually valid and a file descriptor proto cannot be successfully derived -// from it. -func Clone(r Result) Result { - if cl, ok := r.(interface{ Clone() Result }); ok { - return cl.Clone() - } - if res, ok := r.(*result); ok { - newProto := proto.Clone(res.proto).(*descriptorpb.FileDescriptorProto) //nolint:errcheck - newNodes := make(map[proto.Message]ast.Node, len(res.nodes)) - newResult := &result{ - file: res.file, - proto: newProto, - nodes: newNodes, - } - recreateNodeIndexForFile(res, newResult, res.proto, newProto) - return newResult - } - - // Can't do the deep-copy we know how to do. So we have to take a - // different tactic. - if r.AST() == nil { - // no AST? all we have to do is copy the proto - fileProto := proto.Clone(r.FileDescriptorProto()).(*descriptorpb.FileDescriptorProto) //nolint:errcheck - return ResultWithoutAST(fileProto) - } - // Otherwise, we have an AST, but no way to clone the result's - // internals. So just re-create them from scratch. - res, err := ResultFromAST(r.AST(), false, reporter.NewHandler(nil)) - if err != nil { - panic(err) - } - return res -} - -func recreateNodeIndexForFile(orig, clone *result, origProto, cloneProto *descriptorpb.FileDescriptorProto) { - updateNodeIndexWithOptions[*descriptorpb.FileOptions](orig, clone, origProto, cloneProto) - for i, origMd := range origProto.MessageType { - cloneMd := cloneProto.MessageType[i] - recreateNodeIndexForMessage(orig, clone, origMd, cloneMd) - } - for i, origEd := range origProto.EnumType { - cloneEd := cloneProto.EnumType[i] - recreateNodeIndexForEnum(orig, clone, origEd, cloneEd) - } - for i, origExtd := range origProto.Extension { - cloneExtd := cloneProto.Extension[i] - updateNodeIndexWithOptions[*descriptorpb.FieldOptions](orig, clone, origExtd, cloneExtd) - } - for i, origSd := range origProto.Service { - cloneSd := cloneProto.Service[i] - updateNodeIndexWithOptions[*descriptorpb.ServiceOptions](orig, clone, origSd, cloneSd) - for j, origMtd := range origSd.Method { - cloneMtd := cloneSd.Method[j] - updateNodeIndexWithOptions[*descriptorpb.MethodOptions](orig, clone, origMtd, cloneMtd) - } - } -} - -func recreateNodeIndexForMessage(orig, clone *result, origProto, cloneProto *descriptorpb.DescriptorProto) { - updateNodeIndexWithOptions[*descriptorpb.MessageOptions](orig, clone, origProto, cloneProto) - for i, origFld := range origProto.Field { - cloneFld := cloneProto.Field[i] - updateNodeIndexWithOptions[*descriptorpb.FieldOptions](orig, clone, origFld, cloneFld) - } - for i, origOod := range origProto.OneofDecl { - cloneOod := cloneProto.OneofDecl[i] - updateNodeIndexWithOptions[*descriptorpb.OneofOptions](orig, clone, origOod, cloneOod) - } - for i, origExtr := range origProto.ExtensionRange { - cloneExtr := cloneProto.ExtensionRange[i] - updateNodeIndexWithOptions[*descriptorpb.ExtensionRangeOptions](orig, clone, origExtr, cloneExtr) - } - for i, origRr := range origProto.ReservedRange { - cloneRr := cloneProto.ReservedRange[i] - updateNodeIndex(orig, clone, origRr, cloneRr) - } - for i, origNmd := range origProto.NestedType { - cloneNmd := cloneProto.NestedType[i] - recreateNodeIndexForMessage(orig, clone, origNmd, cloneNmd) - } - for i, origEd := range origProto.EnumType { - cloneEd := cloneProto.EnumType[i] - recreateNodeIndexForEnum(orig, clone, origEd, cloneEd) - } - for i, origExtd := range origProto.Extension { - cloneExtd := cloneProto.Extension[i] - updateNodeIndexWithOptions[*descriptorpb.FieldOptions](orig, clone, origExtd, cloneExtd) - } -} - -func recreateNodeIndexForEnum(orig, clone *result, origProto, cloneProto *descriptorpb.EnumDescriptorProto) { - updateNodeIndexWithOptions[*descriptorpb.EnumOptions](orig, clone, origProto, cloneProto) - for i, origEvd := range origProto.Value { - cloneEvd := cloneProto.Value[i] - updateNodeIndexWithOptions[*descriptorpb.EnumValueOptions](orig, clone, origEvd, cloneEvd) - } - for i, origRr := range origProto.ReservedRange { - cloneRr := cloneProto.ReservedRange[i] - updateNodeIndex(orig, clone, origRr, cloneRr) - } -} - -func recreateNodeIndexForOptions(orig, clone *result, origProtos, cloneProtos []*descriptorpb.UninterpretedOption) { - for i, origOpt := range origProtos { - cloneOpt := cloneProtos[i] - updateNodeIndex(orig, clone, origOpt, cloneOpt) - for j, origName := range origOpt.Name { - cloneName := cloneOpt.Name[j] - updateNodeIndex(orig, clone, origName, cloneName) - } - } -} - -func updateNodeIndex[M proto.Message](orig, clone *result, origProto, cloneProto M) { - node := orig.nodes[origProto] - if node != nil { - clone.nodes[cloneProto] = node - } -} - -type pointerMessage[T any] interface { - *T - proto.Message -} - -type options[T any] interface { - // need this type instead of just proto.Message so we can check for nil pointer - pointerMessage[T] - GetUninterpretedOption() []*descriptorpb.UninterpretedOption -} - -type withOptions[O options[T], T any] interface { - proto.Message - GetOptions() O -} - -func updateNodeIndexWithOptions[O options[T], M withOptions[O, T], T any](orig, clone *result, origProto, cloneProto M) { - updateNodeIndex(orig, clone, origProto, cloneProto) - origOpts := origProto.GetOptions() - cloneOpts := cloneProto.GetOptions() - if origOpts != nil { - recreateNodeIndexForOptions(orig, clone, origOpts.GetUninterpretedOption(), cloneOpts.GetUninterpretedOption()) - } -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/doc.go b/vendor/github.com/bufbuild/protocompile/parser/doc.go deleted file mode 100644 index d4e2c75aa1..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package parser contains the logic for parsing protobuf source code into an -// AST (abstract syntax tree) and also for converting an AST into a descriptor -// proto. -// -// A FileDescriptorProto is very similar to an AST, but the AST this package -// uses is more useful because it contains more information about the source -// code, including details about whitespace and comments, that cannot be -// represented by a descriptor proto. This makes it ideal for things like -// code formatters, which may want to preserve things like whitespace and -// comment format. -package parser diff --git a/vendor/github.com/bufbuild/protocompile/parser/errors.go b/vendor/github.com/bufbuild/protocompile/parser/errors.go deleted file mode 100644 index 6e34bb8cff..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/errors.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import "errors" - -// ErrNoSyntax is a sentinel error that may be passed to a warning reporter. -// The error the reporter receives will be wrapped with source position that -// indicates the file that had no syntax statement. -var ErrNoSyntax = errors.New("no syntax specified; defaulting to proto2 syntax") diff --git a/vendor/github.com/bufbuild/protocompile/parser/lexer.go b/vendor/github.com/bufbuild/protocompile/parser/lexer.go deleted file mode 100644 index e4701faa4e..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/lexer.go +++ /dev/null @@ -1,760 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "math" - "strconv" - "strings" - "unicode/utf8" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/reporter" -) - -type runeReader struct { - data []byte - pos int - err error - mark int - // Enable this check to make input required to be valid UTF-8. - // For now, since protoc allows invalid UTF-8, default to false. - utf8Strict bool -} - -func (rr *runeReader) readRune() (r rune, size int, err error) { - if rr.err != nil { - return 0, 0, rr.err - } - if rr.pos == len(rr.data) { - rr.err = io.EOF - return 0, 0, rr.err - } - r, sz := utf8.DecodeRune(rr.data[rr.pos:]) - if rr.utf8Strict && r == utf8.RuneError { - rr.err = fmt.Errorf("invalid UTF8 at offset %d: %x", rr.pos, rr.data[rr.pos]) - return 0, 0, rr.err - } - rr.pos += sz - return r, sz, nil -} - -func (rr *runeReader) offset() int { - return rr.pos -} - -func (rr *runeReader) unreadRune(sz int) { - newPos := rr.pos - sz - if newPos < rr.mark { - panic("unread past mark") - } - rr.pos = newPos -} - -func (rr *runeReader) setMark() { - rr.mark = rr.pos -} - -func (rr *runeReader) getMark() string { - return string(rr.data[rr.mark:rr.pos]) -} - -type protoLex struct { - input *runeReader - info *ast.FileInfo - handler *reporter.Handler - res *ast.FileNode - - prevSym ast.TerminalNode - prevOffset int - eof ast.Token - - comments []ast.Token -} - -var utf8Bom = []byte{0xEF, 0xBB, 0xBF} - -func newLexer(in io.Reader, filename string, handler *reporter.Handler) (*protoLex, error) { - br := bufio.NewReader(in) - - // if file has UTF8 byte order marker preface, consume it - marker, err := br.Peek(3) - if err == nil && bytes.Equal(marker, utf8Bom) { - _, _ = br.Discard(3) - } - - contents, err := io.ReadAll(br) - if err != nil { - return nil, err - } - return &protoLex{ - input: &runeReader{data: contents}, - info: ast.NewFileInfo(filename, contents), - handler: handler, - }, nil -} - -var keywords = map[string]int{ - "syntax": _SYNTAX, - "import": _IMPORT, - "weak": _WEAK, - "public": _PUBLIC, - "package": _PACKAGE, - "option": _OPTION, - "true": _TRUE, - "false": _FALSE, - "inf": _INF, - "nan": _NAN, - "repeated": _REPEATED, - "optional": _OPTIONAL, - "required": _REQUIRED, - "double": _DOUBLE, - "float": _FLOAT, - "int32": _INT32, - "int64": _INT64, - "uint32": _UINT32, - "uint64": _UINT64, - "sint32": _SINT32, - "sint64": _SINT64, - "fixed32": _FIXED32, - "fixed64": _FIXED64, - "sfixed32": _SFIXED32, - "sfixed64": _SFIXED64, - "bool": _BOOL, - "string": _STRING, - "bytes": _BYTES, - "group": _GROUP, - "oneof": _ONEOF, - "map": _MAP, - "extensions": _EXTENSIONS, - "to": _TO, - "max": _MAX, - "reserved": _RESERVED, - "enum": _ENUM, - "message": _MESSAGE, - "extend": _EXTEND, - "service": _SERVICE, - "rpc": _RPC, - "stream": _STREAM, - "returns": _RETURNS, -} - -func (l *protoLex) maybeNewLine(r rune) { - if r == '\n' { - l.info.AddLine(l.input.offset()) - } -} - -func (l *protoLex) prev() ast.SourcePos { - return l.info.SourcePos(l.prevOffset) -} - -func (l *protoLex) Lex(lval *protoSymType) int { - if l.handler.ReporterError() != nil { - // if error reporter already returned non-nil error, - // we can skip the rest of the input - return 0 - } - - l.comments = nil - - for { - l.input.setMark() - - l.prevOffset = l.input.offset() - c, _, err := l.input.readRune() - if err == io.EOF { - // we're not actually returning a rune, but this will associate - // accumulated comments as a trailing comment on last symbol - // (if appropriate) - l.setRune(lval, 0) - l.eof = lval.b.Token() - return 0 - } - if err != nil { - l.setError(lval, err) - return _ERROR - } - - if strings.ContainsRune("\n\r\t\f\v ", c) { - // skip whitespace - l.maybeNewLine(c) - continue - } - - if c == '.' { - // decimal literals could start with a dot - cn, szn, err := l.input.readRune() - if err != nil { - l.setRune(lval, c) - return int(c) - } - if cn >= '0' && cn <= '9' { - l.readNumber() - token := l.input.getMark() - f, err := parseFloat(token) - if err != nil { - l.setError(lval, numError(err, "float", token)) - return _ERROR - } - l.setFloat(lval, f) - return _FLOAT_LIT - } - l.input.unreadRune(szn) - l.setRune(lval, c) - return int(c) - } - - if c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') { - // identifier - l.readIdentifier() - str := l.input.getMark() - if t, ok := keywords[str]; ok { - l.setIdent(lval, str) - return t - } - l.setIdent(lval, str) - return _NAME - } - - if c >= '0' && c <= '9' { - // integer or float literal - l.readNumber() - token := l.input.getMark() - if strings.HasPrefix(token, "0x") || strings.HasPrefix(token, "0X") { - // hexadecimal - ui, err := strconv.ParseUint(token[2:], 16, 64) - if err != nil { - l.setError(lval, numError(err, "hexadecimal integer", token[2:])) - return _ERROR - } - l.setInt(lval, ui) - return _INT_LIT - } - if strings.ContainsAny(token, ".eE") { - // floating point! - f, err := parseFloat(token) - if err != nil { - l.setError(lval, numError(err, "float", token)) - return _ERROR - } - l.setFloat(lval, f) - return _FLOAT_LIT - } - // integer! (decimal or octal) - base := 10 - if token[0] == '0' { - base = 8 - } - ui, err := strconv.ParseUint(token, base, 64) - if err != nil { - kind := "integer" - if base == 8 { - kind = "octal integer" - } else if numErr, ok := err.(*strconv.NumError); ok && numErr.Err == strconv.ErrRange { - // if it's too big to be an int, parse it as a float - var f float64 - kind = "float" - f, err = parseFloat(token) - if err == nil { - l.setFloat(lval, f) - return _FLOAT_LIT - } - } - l.setError(lval, numError(err, kind, token)) - return _ERROR - } - l.setInt(lval, ui) - return _INT_LIT - } - - if c == '\'' || c == '"' { - // string literal - str, err := l.readStringLiteral(c) - if err != nil { - l.setError(lval, err) - return _ERROR - } - l.setString(lval, str) - return _STRING_LIT - } - - if c == '/' { - // comment - cn, szn, err := l.input.readRune() - if err != nil { - l.setRune(lval, '/') - return int(c) - } - if cn == '/' { - if hasErr := l.skipToEndOfLineComment(lval); hasErr { - return _ERROR - } - l.comments = append(l.comments, l.newToken()) - continue - } - if cn == '*' { - ok, hasErr := l.skipToEndOfBlockComment(lval) - if hasErr { - return _ERROR - } - if !ok { - l.setError(lval, errors.New("block comment never terminates, unexpected EOF")) - return _ERROR - } - l.comments = append(l.comments, l.newToken()) - continue - } - l.input.unreadRune(szn) - } - - if c < 32 || c == 127 { - l.setError(lval, errors.New("invalid control character")) - return _ERROR - } - if !strings.ContainsRune(";,.:=-+(){}[]<>/", c) { - l.setError(lval, errors.New("invalid character")) - return _ERROR - } - l.setRune(lval, c) - return int(c) - } -} - -func parseFloat(token string) (float64, error) { - // strconv.ParseFloat allows _ to separate digits, but protobuf does not - if strings.ContainsRune(token, '_') { - return 0, &strconv.NumError{ - Func: "parseFloat", - Num: token, - Err: strconv.ErrSyntax, - } - } - f, err := strconv.ParseFloat(token, 64) - if err == nil { - return f, nil - } - if numErr, ok := err.(*strconv.NumError); ok && numErr.Err == strconv.ErrRange && math.IsInf(f, 1) { - // protoc doesn't complain about float overflow and instead just uses "infinity" - // so we mirror that behavior by just returning infinity and ignoring the error - return f, nil - } - return f, err -} - -func (l *protoLex) newToken() ast.Token { - offset := l.input.mark - length := l.input.pos - l.input.mark - return l.info.AddToken(offset, length) -} - -func (l *protoLex) setPrevAndAddComments(n ast.TerminalNode) { - comments := l.comments - l.comments = nil - var prevTrailingComments []ast.Token - if l.prevSym != nil && len(comments) > 0 { - prevEnd := l.info.NodeInfo(l.prevSym).End().Line - info := l.info.NodeInfo(n) - nStart := info.Start().Line - if nStart == prevEnd { - if rn, ok := n.(*ast.RuneNode); ok && rn.Rune == 0 { - // if current token is EOF, pretend its on separate line - // so that the logic below can attribute a final trailing - // comment to the previous token - nStart++ - } - } - c := comments[0] - commentInfo := l.info.TokenInfo(c) - commentStart := commentInfo.Start().Line - if nStart > prevEnd && commentStart == prevEnd { - // Comment starts right after the previous token. If it's a - // line comment, we record that as a trailing comment. - // - // But if it's a block comment, it is only a trailing comment - // if there are multiple comments or if the block comment ends - // on a line before n. - canDonate := strings.HasPrefix(commentInfo.RawText(), "//") || - len(comments) > 1 || commentInfo.End().Line < nStart - - if canDonate { - prevTrailingComments = comments[:1] - comments = comments[1:] - } - } - } - - // now we can associate comments - for _, c := range prevTrailingComments { - l.info.AddComment(c, l.prevSym.Token()) - } - for _, c := range comments { - l.info.AddComment(c, n.Token()) - } - - l.prevSym = n -} - -func (l *protoLex) setString(lval *protoSymType, val string) { - lval.s = ast.NewStringLiteralNode(val, l.newToken()) - l.setPrevAndAddComments(lval.s) -} - -func (l *protoLex) setIdent(lval *protoSymType, val string) { - lval.id = ast.NewIdentNode(val, l.newToken()) - l.setPrevAndAddComments(lval.id) -} - -func (l *protoLex) setInt(lval *protoSymType, val uint64) { - lval.i = ast.NewUintLiteralNode(val, l.newToken()) - l.setPrevAndAddComments(lval.i) -} - -func (l *protoLex) setFloat(lval *protoSymType, val float64) { - lval.f = ast.NewFloatLiteralNode(val, l.newToken()) - l.setPrevAndAddComments(lval.f) -} - -func (l *protoLex) setRune(lval *protoSymType, val rune) { - lval.b = ast.NewRuneNode(val, l.newToken()) - l.setPrevAndAddComments(lval.b) -} - -func (l *protoLex) setError(lval *protoSymType, err error) { - lval.err, _ = l.addSourceError(err) -} - -func (l *protoLex) readNumber() { - allowExpSign := false - for { - c, sz, err := l.input.readRune() - if err != nil { - break - } - if (c == '-' || c == '+') && !allowExpSign { - l.input.unreadRune(sz) - break - } - allowExpSign = false - if c != '.' && c != '_' && (c < '0' || c > '9') && - (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && - c != '-' && c != '+' { - // no more chars in the number token - l.input.unreadRune(sz) - break - } - if c == 'e' || c == 'E' { - // scientific notation char can be followed by - // an exponent sign - allowExpSign = true - } - } -} - -func numError(err error, kind, s string) error { - ne, ok := err.(*strconv.NumError) - if !ok { - return err - } - if ne.Err == strconv.ErrRange { - return fmt.Errorf("value out of range for %s: %s", kind, s) - } - // syntax error - return fmt.Errorf("invalid syntax in %s value: %s", kind, s) -} - -func (l *protoLex) readIdentifier() { - for { - c, sz, err := l.input.readRune() - if err != nil { - break - } - if c != '_' && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && (c < '0' || c > '9') { - l.input.unreadRune(sz) - break - } - } -} - -func (l *protoLex) readStringLiteral(quote rune) (string, error) { - var buf bytes.Buffer - var escapeError reporter.ErrorWithPos - var noMoreErrors bool - reportErr := func(msg, badEscape string) { - if noMoreErrors { - return - } - if escapeError != nil { - // report previous one - _, ok := l.addSourceError(escapeError) - if !ok { - noMoreErrors = true - } - } - var err error - if strings.HasSuffix(msg, "%s") { - err = fmt.Errorf(msg, badEscape) - } else { - err = errors.New(msg) - } - // we've now consumed the bad escape and lexer position is after it, so we need - // to back up to the beginning of the escape to report the correct position - escapeError = l.errWithCurrentPos(err, -len(badEscape)) - } - for { - c, _, err := l.input.readRune() - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return "", err - } - if c == '\n' { - return "", errors.New("encountered end-of-line before end of string literal") - } - if c == quote { - break - } - if c == 0 { - reportErr("null character ('\\0') not allowed in string literal", string(rune(0))) - continue - } - if c == '\\' { - // escape sequence - c, _, err = l.input.readRune() - if err != nil { - return "", err - } - switch { - case c == 'x' || c == 'X': - // hex escape - c1, sz1, err := l.input.readRune() - if err != nil { - return "", err - } - if c1 == quote || c1 == '\\' { - l.input.unreadRune(sz1) - reportErr("invalid hex escape: %s", "\\"+string(c)) - continue - } - c2, sz2, err := l.input.readRune() - if err != nil { - return "", err - } - var hex string - if (c2 < '0' || c2 > '9') && (c2 < 'a' || c2 > 'f') && (c2 < 'A' || c2 > 'F') { - l.input.unreadRune(sz2) - hex = string(c1) - } else { - hex = string([]rune{c1, c2}) - } - i, err := strconv.ParseInt(hex, 16, 32) - if err != nil { - reportErr("invalid hex escape: %s", "\\"+string(c)+hex) - continue - } - buf.WriteByte(byte(i)) - case c >= '0' && c <= '7': - // octal escape - c2, sz2, err := l.input.readRune() - if err != nil { - return "", err - } - var octal string - if c2 < '0' || c2 > '7' { - l.input.unreadRune(sz2) - octal = string(c) - } else { - c3, sz3, err := l.input.readRune() - if err != nil { - return "", err - } - if c3 < '0' || c3 > '7' { - l.input.unreadRune(sz3) - octal = string([]rune{c, c2}) - } else { - octal = string([]rune{c, c2, c3}) - } - } - i, err := strconv.ParseInt(octal, 8, 32) - if err != nil { - reportErr("invalid octal escape: %s", "\\"+octal) - continue - } - if i > 0xff { - reportErr("octal escape is out range, must be between 0 and 377: %s", "\\"+octal) - continue - } - buf.WriteByte(byte(i)) - case c == 'u': - // short unicode escape - u := make([]rune, 4) - for i := range u { - c2, sz2, err := l.input.readRune() - if err != nil { - return "", err - } - if c2 == quote || c2 == '\\' { - l.input.unreadRune(sz2) - u = u[:i] - break - } - u[i] = c2 - } - codepointStr := string(u) - if len(u) < 4 { - reportErr("invalid unicode escape: %s", "\\u"+codepointStr) - continue - } - i, err := strconv.ParseInt(codepointStr, 16, 32) - if err != nil { - reportErr("invalid unicode escape: %s", "\\u"+codepointStr) - continue - } - buf.WriteRune(rune(i)) - case c == 'U': - // long unicode escape - u := make([]rune, 8) - for i := range u { - c2, sz2, err := l.input.readRune() - if err != nil { - return "", err - } - if c2 == quote || c2 == '\\' { - l.input.unreadRune(sz2) - u = u[:i] - break - } - u[i] = c2 - } - codepointStr := string(u) - if len(u) < 8 { - reportErr("invalid unicode escape: %s", "\\U"+codepointStr) - continue - } - i, err := strconv.ParseInt(string(u), 16, 32) - if err != nil { - reportErr("invalid unicode escape: %s", "\\U"+codepointStr) - continue - } - if i > 0x10ffff || i < 0 { - reportErr("unicode escape is out of range, must be between 0 and 0x10ffff: %s", "\\U"+codepointStr) - continue - } - buf.WriteRune(rune(i)) - case c == 'a': - buf.WriteByte('\a') - case c == 'b': - buf.WriteByte('\b') - case c == 'f': - buf.WriteByte('\f') - case c == 'n': - buf.WriteByte('\n') - case c == 'r': - buf.WriteByte('\r') - case c == 't': - buf.WriteByte('\t') - case c == 'v': - buf.WriteByte('\v') - case c == '\\': - buf.WriteByte('\\') - case c == '\'': - buf.WriteByte('\'') - case c == '"': - buf.WriteByte('"') - case c == '?': - buf.WriteByte('?') - default: - reportErr("invalid escape sequence: %s", "\\"+string(c)) - continue - } - } else { - buf.WriteRune(c) - } - } - if escapeError != nil { - return "", escapeError - } - return buf.String(), nil -} - -func (l *protoLex) skipToEndOfLineComment(lval *protoSymType) (hasErr bool) { - for { - c, sz, err := l.input.readRune() - if err != nil { - // eof - return false - } - switch c { - case '\n': - // don't include newline in the comment - l.input.unreadRune(sz) - return false - case 0: - l.setError(lval, errors.New("invalid control character")) - return true - } - } -} - -func (l *protoLex) skipToEndOfBlockComment(lval *protoSymType) (ok, hasErr bool) { - for { - c, _, err := l.input.readRune() - if err != nil { - return false, false - } - if c == 0 { - l.setError(lval, errors.New("invalid control character")) - return false, true - } - l.maybeNewLine(c) - if c == '*' { - c, sz, err := l.input.readRune() - if err != nil { - return false, false - } - if c == '/' { - return true, false - } - l.input.unreadRune(sz) - } - } -} - -func (l *protoLex) addSourceError(err error) (reporter.ErrorWithPos, bool) { - ewp, ok := err.(reporter.ErrorWithPos) - if !ok { - ewp = reporter.Error(l.prev(), err) - } - handlerErr := l.handler.HandleError(ewp) - return ewp, handlerErr == nil -} - -func (l *protoLex) Error(s string) { - _, _ = l.addSourceError(errors.New(s)) -} - -func (l *protoLex) errWithCurrentPos(err error, offset int) reporter.ErrorWithPos { - if ewp, ok := err.(reporter.ErrorWithPos); ok { - return ewp - } - pos := l.info.SourcePos(l.input.offset() + offset) - return reporter.Error(pos, err) -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/parser.go b/vendor/github.com/bufbuild/protocompile/parser/parser.go deleted file mode 100644 index c68186376d..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/parser.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "fmt" - "io" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/reporter" -) - -//go:generate goyacc -o proto.y.go -l -p proto proto.y - -func init() { - protoErrorVerbose = true - - // fix up the generated "token name" array so that error messages are nicer - setTokenName(_STRING_LIT, "string literal") - setTokenName(_INT_LIT, "int literal") - setTokenName(_FLOAT_LIT, "float literal") - setTokenName(_NAME, "identifier") - setTokenName(_ERROR, "error") - // for keywords, just show the keyword itself wrapped in quotes - for str, i := range keywords { - setTokenName(i, fmt.Sprintf(`"%s"`, str)) - } -} - -func setTokenName(token int, text string) { - // NB: this is based on logic in generated parse code that translates the - // int returned from the lexer into an internal token number. - var intern int8 - if token < len(protoTok1) { - intern = protoTok1[token] - } else { - if token >= protoPrivate { - if token < protoPrivate+len(protoTok2) { - intern = protoTok2[token-protoPrivate] - } - } - if intern == 0 { - for i := 0; i+1 < len(protoTok3); i += 2 { - if int(protoTok3[i]) == token { - intern = protoTok3[i+1] - break - } - } - } - } - - if intern >= 1 && int(intern-1) < len(protoToknames) { - protoToknames[intern-1] = text - return - } - - panic(fmt.Sprintf("Unknown token value: %d", token)) -} - -// Parse parses the given source code info and returns an AST. The given filename -// is used to construct error messages and position information. The given reader -// supplies the source code. The given handler is used to report errors and -// warnings encountered while parsing. If any errors are reported, this function -// returns a non-nil error. -// -// If the error returned is due to a syntax error in the source, then a non-nil -// AST is also returned. If the handler chooses to not abort the parse (e.g. the -// underlying error reporter returns nil instead of an error), the parser will -// attempt to recover and keep going. This allows multiple syntax errors to be -// reported in a single pass. And it also means that more of the AST can be -// populated (erroneous productions around the syntax error will of course be -// absent). -// -// The degree to which the parser can recover from errors and populate the AST -// depends on the nature of the syntax error and if there are any tokens after the -// syntax error that can help the parser recover. This error recovery and partial -// AST production is best effort. -func Parse(filename string, r io.Reader, handler *reporter.Handler) (*ast.FileNode, error) { - lx, err := newLexer(r, filename, handler) - if err != nil { - return nil, err - } - protoParse(lx) - if lx.res == nil { - // nil AST means there was an error that prevented any parsing - // or the file was empty; synthesize empty non-nil AST - lx.res = ast.NewEmptyFileNode(filename) - } - return lx.res, handler.Error() -} - -// Result is the result of constructing a descriptor proto from a parsed AST. -// From this result, the AST and the file descriptor proto can be had. This -// also contains numerous lookup functions, for looking up AST nodes that -// correspond to various elements of the descriptor hierarchy. -// -// Results can be created without AST information, using the ResultWithoutAST() -// function. All functions other than AST() will still return non-nil values, -// allowing compile operations to work with files that have only intermediate -// descriptor protos and no source code. For such results, the function that -// return AST nodes will return placeholder nodes. The position information for -// placeholder nodes contains only the filename. -type Result interface { - // AST returns the parsed abstract syntax tree. This returns nil if the - // Result was created without an AST. - AST() *ast.FileNode - // FileDescriptorProto returns the file descriptor proto. - FileDescriptorProto() *descriptorpb.FileDescriptorProto - - // FileNode returns the root of the AST. If this result has no AST then a - // placeholder node is returned. - FileNode() ast.FileDeclNode - // Node returns the AST node from which the given message was created. This - // can return nil, such as if the given message is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - Node(proto.Message) ast.Node - // OptionNode returns the AST node corresponding to the given uninterpreted - // option. This can return nil, such as if the given option is not part of - // the FileDescriptorProto hierarchy. If this result has no AST, this - // returns a placeholder node. - OptionNode(*descriptorpb.UninterpretedOption) ast.OptionDeclNode - // OptionNamePartNode returns the AST node corresponding to the given name - // part for an uninterpreted option. This can return nil, such as if the - // given name part is not part of the FileDescriptorProto hierarchy. If this - // result has no AST, this returns a placeholder node. - OptionNamePartNode(*descriptorpb.UninterpretedOption_NamePart) ast.Node - // MessageNode returns the AST node corresponding to the given message. This - // can return nil, such as if the given message is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - MessageNode(*descriptorpb.DescriptorProto) ast.MessageDeclNode - // FieldNode returns the AST node corresponding to the given field. This can - // return nil, such as if the given field is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - FieldNode(*descriptorpb.FieldDescriptorProto) ast.FieldDeclNode - // OneOfNode returns the AST node corresponding to the given oneof. This can - // return nil, such as if the given oneof is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - OneOfNode(*descriptorpb.OneofDescriptorProto) ast.Node - // ExtensionRangeNode returns the AST node corresponding to the given - // extension range. This can return nil, such as if the given range is not - // part of the FileDescriptorProto hierarchy. If this result has no AST, - // this returns a placeholder node. - ExtensionRangeNode(*descriptorpb.DescriptorProto_ExtensionRange) ast.RangeDeclNode - // MessageReservedRangeNode returns the AST node corresponding to the given - // reserved range. This can return nil, such as if the given range is not - // part of the FileDescriptorProto hierarchy. If this result has no AST, - // this returns a placeholder node. - MessageReservedRangeNode(*descriptorpb.DescriptorProto_ReservedRange) ast.RangeDeclNode - // EnumNode returns the AST node corresponding to the given enum. This can - // return nil, such as if the given enum is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - EnumNode(*descriptorpb.EnumDescriptorProto) ast.Node - // EnumValueNode returns the AST node corresponding to the given enum. This - // can return nil, such as if the given enum value is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - EnumValueNode(*descriptorpb.EnumValueDescriptorProto) ast.EnumValueDeclNode - // EnumReservedRangeNode returns the AST node corresponding to the given - // reserved range. This can return nil, such as if the given range is not - // part of the FileDescriptorProto hierarchy. If this result has no AST, - // this returns a placeholder node. - EnumReservedRangeNode(*descriptorpb.EnumDescriptorProto_EnumReservedRange) ast.RangeDeclNode - // ServiceNode returns the AST node corresponding to the given service. This - // can return nil, such as if the given service is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - ServiceNode(*descriptorpb.ServiceDescriptorProto) ast.Node - // MethodNode returns the AST node corresponding to the given method. This - // can return nil, such as if the given method is not part of the - // FileDescriptorProto hierarchy. If this result has no AST, this returns a - // placeholder node. - MethodNode(*descriptorpb.MethodDescriptorProto) ast.RPCDeclNode -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/proto.y b/vendor/github.com/bufbuild/protocompile/parser/proto.y deleted file mode 100644 index 78a6c80695..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/proto.y +++ /dev/null @@ -1,1219 +0,0 @@ -%{ -package parser - -//lint:file-ignore SA4006 generated parser has unused values - -import ( - "math" - - "github.com/bufbuild/protocompile/ast" -) - -%} - -// fields inside this union end up as the fields in a structure known -// as ${PREFIX}SymType, of which a reference is passed to the lexer. -%union{ - file *ast.FileNode - syn *ast.SyntaxNode - fileDecl ast.FileElement - fileDecls []ast.FileElement - pkg *ast.PackageNode - imprt *ast.ImportNode - msg *ast.MessageNode - msgDecl ast.MessageElement - msgDecls []ast.MessageElement - fld *ast.FieldNode - mapFld *ast.MapFieldNode - mapType *ast.MapTypeNode - grp *ast.GroupNode - oo *ast.OneOfNode - ooDecl ast.OneOfElement - ooDecls []ast.OneOfElement - ext *ast.ExtensionRangeNode - resvd *ast.ReservedNode - en *ast.EnumNode - enDecl ast.EnumElement - enDecls []ast.EnumElement - env *ast.EnumValueNode - extend *ast.ExtendNode - extDecl ast.ExtendElement - extDecls []ast.ExtendElement - svc *ast.ServiceNode - svcDecl ast.ServiceElement - svcDecls []ast.ServiceElement - mtd *ast.RPCNode - rpcType *ast.RPCTypeNode - rpcDecl ast.RPCElement - rpcDecls []ast.RPCElement - opt *ast.OptionNode - opts *compactOptionList - ref *ast.FieldReferenceNode - optNms *fieldRefList - cmpctOpts *ast.CompactOptionsNode - rng *ast.RangeNode - rngs *rangeList - names *nameList - cid *identList - tid ast.IdentValueNode - sl *valueList - msgField *ast.MessageFieldNode - msgEntry *messageFieldEntry - msgLit *messageFieldList - v ast.ValueNode - il ast.IntValueNode - str *stringList - s *ast.StringLiteralNode - i *ast.UintLiteralNode - f *ast.FloatLiteralNode - id *ast.IdentNode - b *ast.RuneNode - err error -} - -// any non-terminal which returns a value needs a type, which is -// really a field name in the above union struct -%type file -%type syntax -%type fileDecl -%type fileDecls -%type import -%type package -%type option compactOption -%type compactOptionDecls -%type rpcDecl -%type rpcDecls -%type optionNameComponent aggName -%type optionName -%type compactOptions -%type constant scalarConstant aggregate msgLit numLit -%type intLit -%type name keyType msgElementName extElementName oneofElementName enumElementName -%type ident msgElementIdent extElementIdent oneofElementIdent -%type typeIdent msgElementTypeIdent extElementTypeIdent oneofElementTypeIdent -%type constantList msgList -%type aggFieldEntry -%type aggField -%type aggFields -%type msgField oneofField extField -%type oneof -%type group oneofGroup -%type mapField -%type mapType -%type message -%type messageDecl -%type messageDecls -%type ooDecl -%type ooDecls -%type fieldNames -%type msgReserved enumReserved reservedNames -%type tagRange enumRange -%type tagRanges enumRanges -%type extensions -%type enum -%type enumDecl -%type enumDecls -%type enumValue -%type extend -%type extendDecl -%type extendDecls -%type stringLit -%type service -%type serviceDecl -%type serviceDecls -%type rpc -%type rpcType - -// same for terminals -%token _STRING_LIT -%token _INT_LIT -%token _FLOAT_LIT -%token _NAME -%token _SYNTAX _IMPORT _WEAK _PUBLIC _PACKAGE _OPTION _TRUE _FALSE _INF _NAN _REPEATED _OPTIONAL _REQUIRED -%token _DOUBLE _FLOAT _INT32 _INT64 _UINT32 _UINT64 _SINT32 _SINT64 _FIXED32 _FIXED64 _SFIXED32 _SFIXED64 -%token _BOOL _STRING _BYTES _GROUP _ONEOF _MAP _EXTENSIONS _TO _MAX _RESERVED _ENUM _MESSAGE _EXTEND -%token _SERVICE _RPC _STREAM _RETURNS -%token _ERROR -// we define all of these, even ones that aren't used, to improve error messages -// so it shows the unexpected symbol instead of showing "$unk" -%token '=' ';' ':' '{' '}' '\\' '/' '?' '.' ',' '>' '<' '+' '-' '(' ')' '[' ']' '*' '&' '^' '%' '$' '#' '@' '!' '~' '`' - -%% - -file : syntax { - lex := protolex.(*protoLex) - $$ = ast.NewFileNode(lex.info, $1, nil, lex.eof) - lex.res = $$ - } - | fileDecls { - lex := protolex.(*protoLex) - $$ = ast.NewFileNode(lex.info, nil, $1, lex.eof) - lex.res = $$ - } - | syntax fileDecls { - lex := protolex.(*protoLex) - $$ = ast.NewFileNode(lex.info, $1, $2, lex.eof) - lex.res = $$ - } - | { - lex := protolex.(*protoLex) - $$ = ast.NewFileNode(lex.info, nil, nil, lex.eof) - lex.res = $$ - } - -fileDecls : fileDecls fileDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | fileDecl { - if $1 != nil { - $$ = []ast.FileElement{$1} - } else { - $$ = nil - } - } - -fileDecl : import { - $$ = $1 - } - | package { - $$ = $1 - } - | option { - $$ = $1 - } - | message { - $$ = $1 - } - | enum { - $$ = $1 - } - | extend { - $$ = $1 - } - | service { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -syntax : _SYNTAX '=' stringLit ';' { - $$ = ast.NewSyntaxNode($1.ToKeyword(), $2, $3.toStringValueNode(), $4) - } - -import : _IMPORT stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), nil, nil, $2.toStringValueNode(), $3) - } - | _IMPORT _WEAK stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), nil, $2.ToKeyword(), $3.toStringValueNode(), $4) - } - | _IMPORT _PUBLIC stringLit ';' { - $$ = ast.NewImportNode($1.ToKeyword(), $2.ToKeyword(), nil, $3.toStringValueNode(), $4) - } - -package : _PACKAGE ident ';' { - $$ = ast.NewPackageNode($1.ToKeyword(), $2.toIdentValueNode(nil), $3) - } - -ident : name { - $$ = &identList{$1, nil, nil} - } - | name '.' ident { - $$ = &identList{$1, $2, $3} - } - -// to mimic limitations of protoc recursive-descent parser, -// we don't allowed message statement keywords as identifiers -// (or oneof statement keywords [e.g. "option"] below) - -msgElementIdent : msgElementName { - $$ = &identList{$1, nil, nil} - } - | msgElementName '.' ident { - $$ = &identList{$1, $2, $3} - } - -extElementIdent : extElementName { - $$ = &identList{$1, nil, nil} - } - | extElementName '.' ident { - $$ = &identList{$1, $2, $3} - } - -oneofElementIdent : oneofElementName { - $$ = &identList{$1, nil, nil} - } - | oneofElementName '.' ident { - $$ = &identList{$1, $2, $3} - } - -option : _OPTION optionName '=' constant ';' { - refs, dots := $2.toNodes() - optName := ast.NewOptionNameNode(refs, dots) - $$ = ast.NewOptionNode($1.ToKeyword(), optName, $3, $4, $5) - } - -optionName : optionNameComponent { - $$ = &fieldRefList{$1, nil, nil} - } - | optionNameComponent '.' optionName { - $$ = &fieldRefList{$1, $2, $3} - } - -optionNameComponent : name { - $$ = ast.NewFieldReferenceNode($1) - } - | '(' typeIdent ')' { - $$ = ast.NewExtensionFieldReferenceNode($1, $2, $3) - } - -constant : scalarConstant - | aggregate - -scalarConstant : stringLit { - $$ = $1.toStringValueNode() - } - | numLit - | name { - $$ = $1 - } - -numLit : _FLOAT_LIT { - $$ = $1 - } - | '-' _FLOAT_LIT { - $$ = ast.NewSignedFloatLiteralNode($1, $2) - } - | '+' _FLOAT_LIT { - $$ = ast.NewSignedFloatLiteralNode($1, $2) - } - | '+' _INF { - f := ast.NewSpecialFloatLiteralNode($2.ToKeyword()) - $$ = ast.NewSignedFloatLiteralNode($1, f) - } - | '-' _INF { - f := ast.NewSpecialFloatLiteralNode($2.ToKeyword()) - $$ = ast.NewSignedFloatLiteralNode($1, f) - } - | _INT_LIT { - $$ = $1 - } - | '+' _INT_LIT { - $$ = ast.NewPositiveUintLiteralNode($1, $2) - } - | '-' _INT_LIT { - if $2.Val > math.MaxInt64 + 1 { - // can't represent as int so treat as float literal - $$ = ast.NewSignedFloatLiteralNode($1, $2) - } else { - $$ = ast.NewNegativeIntLiteralNode($1, $2) - } - } - -stringLit : _STRING_LIT { - $$ = &stringList{$1, nil} - } - | _STRING_LIT stringLit { - $$ = &stringList{$1, $2} - } - -aggregate : '{' aggFields '}' { - fields, delims := $2.toNodes() - $$ = ast.NewMessageLiteralNode($1, fields, delims, $3) - } - | '{' error '}' { - $$ = nil - } - -aggFields : aggField { - if $1 != nil { - $$ = &messageFieldList{$1, nil} - } else { - $$ = nil - } - } - | aggField aggFields { - if $1 != nil { - $$ = &messageFieldList{$1, $2} - } else { - $$ = $2 - } - } - | { - $$ = nil - } - -aggField : aggFieldEntry { - if $1 != nil { - $$ = &messageFieldEntry{$1, nil} - } else { - $$ = nil - } - } - | aggFieldEntry ',' { - if $1 != nil { - $$ = &messageFieldEntry{$1, $2} - } else { - $$ = nil - } - } - | aggFieldEntry ';' { - if $1 != nil { - $$ = &messageFieldEntry{$1, $2} - } else { - $$ = nil - } - } - | error ',' { - $$ = nil - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -aggFieldEntry : aggName ':' scalarConstant { - if $1 != nil { - $$ = ast.NewMessageFieldNode($1, $2, $3) - } else { - $$ = nil - } - } - | aggName '[' ']' { - if $1 != nil { - val := ast.NewArrayLiteralNode($2, nil, nil, $3) - $$ = ast.NewMessageFieldNode($1, nil, val) - } else { - $$ = nil - } - } - | aggName ':' '[' ']' { - if $1 != nil { - val := ast.NewArrayLiteralNode($3, nil, nil, $4) - $$ = ast.NewMessageFieldNode($1, $2, val) - } else { - $$ = nil - } - } - | aggName '[' msgList ']' { - if $1 != nil { - vals, commas := $3.toNodes() - val := ast.NewArrayLiteralNode($2, vals, commas, $4) - $$ = ast.NewMessageFieldNode($1, nil, val) - } else { - $$ = nil - } - } - | aggName ':' '[' constantList ']' { - if $1 != nil { - vals, commas := $4.toNodes() - val := ast.NewArrayLiteralNode($3, vals, commas, $5) - $$ = ast.NewMessageFieldNode($1, $2, val) - } else { - $$ = nil - } - } - | aggName ':' '[' error ']' { - $$ = nil - } - | aggName '[' error ']' { - $$ = nil - } - | aggName ':' msgLit { - if $1 != nil && $3 != nil { - $$ = ast.NewMessageFieldNode($1, $2, $3) - } else { - $$ = nil - } - } - | aggName msgLit { - if $1 != nil && $2 != nil { - $$ = ast.NewMessageFieldNode($1, nil, $2) - } else { - $$ = nil - } - } - | aggName ':' '<' error '>' { - $$ = nil - } - | aggName '<' error '>' { - $$ = nil - } - -aggName : name { - $$ = ast.NewFieldReferenceNode($1) - } - | '[' ident ']' { - $$ = ast.NewExtensionFieldReferenceNode($1, $2.toIdentValueNode(nil), $3) - } - | '[' ident '/' ident ']' { - $$ = ast.NewAnyTypeReferenceNode($1, $2.toIdentValueNode(nil), $3, $4.toIdentValueNode(nil), $5) - } - | '[' error ']' { - $$ = nil - } - -msgList : msgLit { - if $1 == nil { - $$ = nil - } else { - $$ = &valueList{$1, nil, nil} - } - } - | msgLit ',' msgList { - if $1 == nil { - $$ = nil - } else { - $$ = &valueList{$1, $2, $3} - } - } - -msgLit : aggregate { - $$ = $1 - } - | '<' aggFields '>' { - fields, delims := $2.toNodes() - $$ = ast.NewMessageLiteralNode($1, fields, delims, $3) - } - | '<' error '>' { - $$ = nil - } - -constantList : constant { - $$ = &valueList{$1, nil, nil} - } - | constant ',' constantList { - $$ = &valueList{$1, $2, $3} - } - | '<' aggFields '>' { - fields, delims := $2.toNodes() - msg := ast.NewMessageLiteralNode($1, fields, delims, $3) - $$ = &valueList{msg, nil, nil} - } - | '<' aggFields '>' ',' constantList { - fields, delims := $2.toNodes() - msg := ast.NewMessageLiteralNode($1, fields, delims, $3) - $$ = &valueList{msg, $4, $5} - } - | '<' error '>' { - $$ = nil - } - | '<' error '>' ',' constantList { - $$ = $5 - } - -typeIdent : ident { - $$ = $1.toIdentValueNode(nil) - } - | '.' ident { - $$ = $2.toIdentValueNode($1) - } - -msgElementTypeIdent : msgElementIdent { - $$ = $1.toIdentValueNode(nil) - } - | '.' ident { - $$ = $2.toIdentValueNode($1) - } - -extElementTypeIdent : extElementIdent { - $$ = $1.toIdentValueNode(nil) - } - | '.' ident { - $$ = $2.toIdentValueNode($1) - } - -oneofElementTypeIdent : oneofElementIdent { - $$ = $1.toIdentValueNode(nil) - } - | '.' ident { - $$ = $2.toIdentValueNode($1) - } - -msgField : _REQUIRED typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _OPTIONAL typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _REPEATED typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _REQUIRED typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | _OPTIONAL typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | _REPEATED typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | msgElementTypeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) - } - | msgElementTypeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) - } - -extField : _REQUIRED typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _OPTIONAL typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _REPEATED typeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, nil, $6) - } - | _REQUIRED typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | _OPTIONAL typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | _REPEATED typeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode($1.ToKeyword(), $2, $3, $4, $5, $6, $7) - } - | extElementTypeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) - } - | extElementTypeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) - } - -compactOptions: '[' compactOptionDecls ']' { - opts, commas := $2.toNodes() - $$ = ast.NewCompactOptionsNode($1, opts, commas, $3) - } - -compactOptionDecls : compactOption { - $$ = &compactOptionList{$1, nil, nil} - } - | compactOption ',' compactOptionDecls { - $$ = &compactOptionList{$1, $2, $3} - } - -compactOption: optionName '=' constant { - refs, dots := $1.toNodes() - optName := ast.NewOptionNameNode(refs, dots) - $$ = ast.NewCompactOptionNode(optName, $2, $3) - } - -group : _REQUIRED _GROUP name '=' _INT_LIT '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, nil, $6, $7, $8) - } - | _OPTIONAL _GROUP name '=' _INT_LIT '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, nil, $6, $7, $8) - } - | _REPEATED _GROUP name '=' _INT_LIT '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, nil, $6, $7, $8) - } - | _REQUIRED _GROUP name '=' _INT_LIT compactOptions '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, $6, $7, $8, $9) - } - | _OPTIONAL _GROUP name '=' _INT_LIT compactOptions '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, $6, $7, $8, $9) - } - | _REPEATED _GROUP name '=' _INT_LIT compactOptions '{' messageDecls '}' { - $$ = ast.NewGroupNode($1.ToKeyword(), $2.ToKeyword(), $3, $4, $5, $6, $7, $8, $9) - } - -oneof : _ONEOF name '{' ooDecls '}' { - $$ = ast.NewOneOfNode($1.ToKeyword(), $2, $3, $4, $5) - } - -ooDecls : ooDecls ooDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | ooDecl { - if $1 != nil { - $$ = []ast.OneOfElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -ooDecl : option { - $$ = $1 - } - | oneofField { - $$ = $1 - } - | oneofGroup { - $$ = $1 - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -oneofField : oneofElementTypeIdent name '=' _INT_LIT ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, nil, $5) - } - | oneofElementTypeIdent name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewFieldNode(nil, $1, $2, $3, $4, $5, $6) - } - -oneofGroup : _GROUP name '=' _INT_LIT '{' messageDecls '}' { - $$ = ast.NewGroupNode(nil, $1.ToKeyword(), $2, $3, $4, nil, $5, $6, $7) - } - | _GROUP name '=' _INT_LIT compactOptions '{' messageDecls '}' { - $$ = ast.NewGroupNode(nil, $1.ToKeyword(), $2, $3, $4, $5, $6, $7, $8) - } - -mapField : mapType name '=' _INT_LIT ';' { - $$ = ast.NewMapFieldNode($1, $2, $3, $4, nil, $5) - } - | mapType name '=' _INT_LIT compactOptions ';' { - $$ = ast.NewMapFieldNode($1, $2, $3, $4, $5, $6) - } - -mapType : _MAP '<' keyType ',' typeIdent '>' { - $$ = ast.NewMapTypeNode($1.ToKeyword(), $2, $3, $4, $5, $6) - } - -keyType : _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - -extensions : _EXTENSIONS tagRanges ';' { - ranges, commas := $2.toNodes() - $$ = ast.NewExtensionRangeNode($1.ToKeyword(), ranges, commas, nil, $3) - } - | _EXTENSIONS tagRanges compactOptions ';' { - ranges, commas := $2.toNodes() - $$ = ast.NewExtensionRangeNode($1.ToKeyword(), ranges, commas, $3, $4) - } - -tagRanges : tagRange { - $$ = &rangeList{$1, nil, nil} - } - | tagRange ',' tagRanges { - $$ = &rangeList{$1, $2, $3} - } - -tagRange : _INT_LIT { - $$ = ast.NewRangeNode($1, nil, nil, nil) - } - | _INT_LIT _TO _INT_LIT { - $$ = ast.NewRangeNode($1, $2.ToKeyword(), $3, nil) - } - | _INT_LIT _TO _MAX { - $$ = ast.NewRangeNode($1, $2.ToKeyword(), nil, $3.ToKeyword()) - } - -enumRanges : enumRange { - $$ = &rangeList{$1, nil, nil} - } - | enumRange ',' enumRanges { - $$ = &rangeList{$1, $2, $3} - } - -enumRange : intLit { - $$ = ast.NewRangeNode($1, nil, nil, nil) - } - | intLit _TO intLit { - $$ = ast.NewRangeNode($1, $2.ToKeyword(), $3, nil) - } - | intLit _TO _MAX { - $$ = ast.NewRangeNode($1, $2.ToKeyword(), nil, $3.ToKeyword()) - } - -intLit : _INT_LIT { - $$ = $1 - } - | '-' _INT_LIT { - $$ = ast.NewNegativeIntLiteralNode($1, $2) - } - -msgReserved : _RESERVED tagRanges ';' { - ranges, commas := $2.toNodes() - $$ = ast.NewReservedRangesNode($1.ToKeyword(), ranges, commas, $3) - } - | reservedNames - -enumReserved : _RESERVED enumRanges ';' { - ranges, commas := $2.toNodes() - $$ = ast.NewReservedRangesNode($1.ToKeyword(), ranges, commas, $3) - } - | reservedNames - -reservedNames : _RESERVED fieldNames ';' { - names, commas := $2.toNodes() - $$ = ast.NewReservedNamesNode($1.ToKeyword(), names, commas, $3) - } - -fieldNames : stringLit { - $$ = &nameList{$1.toStringValueNode(), nil, nil} - } - | stringLit ',' fieldNames { - $$ = &nameList{$1.toStringValueNode(), $2, $3} - } - -enum : _ENUM name '{' enumDecls '}' { - $$ = ast.NewEnumNode($1.ToKeyword(), $2, $3, $4, $5) - } - -enumDecls : enumDecls enumDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | enumDecl { - if $1 != nil { - $$ = []ast.EnumElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -enumDecl : option { - $$ = $1 - } - | enumValue { - $$ = $1 - } - | enumReserved { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -enumValue : enumElementName '=' intLit ';' { - $$ = ast.NewEnumValueNode($1, $2, $3, nil, $4) - } - | enumElementName '=' intLit compactOptions ';' { - $$ = ast.NewEnumValueNode($1, $2, $3, $4, $5) - } - -message : _MESSAGE name '{' messageDecls '}' { - $$ = ast.NewMessageNode($1.ToKeyword(), $2, $3, $4, $5) - } - -messageDecls : messageDecls messageDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | messageDecl { - if $1 != nil { - $$ = []ast.MessageElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -messageDecl : msgField { - $$ = $1 - } - | enum { - $$ = $1 - } - | message { - $$ = $1 - } - | extend { - $$ = $1 - } - | extensions { - $$ = $1 - } - | group { - $$ = $1 - } - | option { - $$ = $1 - } - | oneof { - $$ = $1 - } - | mapField { - $$ = $1 - } - | msgReserved { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -extend : _EXTEND typeIdent '{' extendDecls '}' { - $$ = ast.NewExtendNode($1.ToKeyword(), $2, $3, $4, $5) - } - -extendDecls : extendDecls extendDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | extendDecl { - if $1 != nil { - $$ = []ast.ExtendElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -extendDecl : extField { - $$ = $1 - } - | group { - $$ = $1 - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -service : _SERVICE name '{' serviceDecls '}' { - $$ = ast.NewServiceNode($1.ToKeyword(), $2, $3, $4, $5) - } - -serviceDecls : serviceDecls serviceDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | serviceDecl { - if $1 != nil { - $$ = []ast.ServiceElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -// NB: doc suggests support for "stream" declaration, separate from "rpc", but -// it does not appear to be supported in protoc (doc is likely from grammar for -// Google-internal version of protoc, with support for streaming stubby) -serviceDecl : option { - $$ = $1 - } - | rpc { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -rpc : _RPC name rpcType _RETURNS rpcType ';' { - $$ = ast.NewRPCNode($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, $6) - } - | _RPC name rpcType _RETURNS rpcType '{' rpcDecls '}' { - $$ = ast.NewRPCNodeWithBody($1.ToKeyword(), $2, $3, $4.ToKeyword(), $5, $6, $7, $8) - } - -rpcType : '(' _STREAM typeIdent ')' { - $$ = ast.NewRPCTypeNode($1, $2.ToKeyword(), $3, $4) - } - | '(' typeIdent ')' { - $$ = ast.NewRPCTypeNode($1, nil, $2, $3) - } - -rpcDecls : rpcDecls rpcDecl { - if $2 != nil { - $$ = append($1, $2) - } else { - $$ = $1 - } - } - | rpcDecl { - if $1 != nil { - $$ = []ast.RPCElement{$1} - } else { - $$ = nil - } - } - | { - $$ = nil - } - -rpcDecl : option { - $$ = $1 - } - | ';' { - $$ = ast.NewEmptyDeclNode($1) - } - | error ';' { - $$ = nil - } - | error { - $$ = nil - } - -// excludes message, enum, oneof, extensions, reserved, extend, -// option, optional, required, and repeated -msgElementName : _NAME - | _SYNTAX - | _IMPORT - | _WEAK - | _PUBLIC - | _PACKAGE - | _TRUE - | _FALSE - | _INF - | _NAN - | _DOUBLE - | _FLOAT - | _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - | _BYTES - | _GROUP - | _MAP - | _TO - | _MAX - | _SERVICE - | _RPC - | _STREAM - | _RETURNS - -// excludes optional, required, and repeated -extElementName : _NAME - | _SYNTAX - | _IMPORT - | _WEAK - | _PUBLIC - | _PACKAGE - | _OPTION - | _TRUE - | _FALSE - | _INF - | _NAN - | _DOUBLE - | _FLOAT - | _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - | _BYTES - | _GROUP - | _ONEOF - | _MAP - | _EXTENSIONS - | _TO - | _MAX - | _RESERVED - | _ENUM - | _MESSAGE - | _EXTEND - | _SERVICE - | _RPC - | _STREAM - | _RETURNS - -// excludes reserved, option -enumElementName : _NAME - | _SYNTAX - | _IMPORT - | _WEAK - | _PUBLIC - | _PACKAGE - | _TRUE - | _FALSE - | _INF - | _NAN - | _REPEATED - | _OPTIONAL - | _REQUIRED - | _DOUBLE - | _FLOAT - | _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - | _BYTES - | _GROUP - | _ONEOF - | _MAP - | _EXTENSIONS - | _TO - | _MAX - | _ENUM - | _MESSAGE - | _EXTEND - | _SERVICE - | _RPC - | _STREAM - | _RETURNS - -// excludes option, optional, required, and repeated -oneofElementName : _NAME - | _SYNTAX - | _IMPORT - | _WEAK - | _PUBLIC - | _PACKAGE - | _TRUE - | _FALSE - | _INF - | _NAN - | _DOUBLE - | _FLOAT - | _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - | _BYTES - | _GROUP - | _ONEOF - | _MAP - | _EXTENSIONS - | _TO - | _MAX - | _RESERVED - | _ENUM - | _MESSAGE - | _EXTEND - | _SERVICE - | _RPC - | _STREAM - | _RETURNS - -name : _NAME - | _SYNTAX - | _IMPORT - | _WEAK - | _PUBLIC - | _PACKAGE - | _OPTION - | _TRUE - | _FALSE - | _INF - | _NAN - | _REPEATED - | _OPTIONAL - | _REQUIRED - | _DOUBLE - | _FLOAT - | _INT32 - | _INT64 - | _UINT32 - | _UINT64 - | _SINT32 - | _SINT64 - | _FIXED32 - | _FIXED64 - | _SFIXED32 - | _SFIXED64 - | _BOOL - | _STRING - | _BYTES - | _GROUP - | _ONEOF - | _MAP - | _EXTENSIONS - | _TO - | _MAX - | _RESERVED - | _ENUM - | _MESSAGE - | _EXTEND - | _SERVICE - | _RPC - | _STREAM - | _RETURNS - -%% diff --git a/vendor/github.com/bufbuild/protocompile/parser/proto.y.go b/vendor/github.com/bufbuild/protocompile/parser/proto.y.go deleted file mode 100644 index 5a7e953f43..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/proto.y.go +++ /dev/null @@ -1,2408 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by goyacc -o proto.y.go -l -p proto proto.y. DO NOT EDIT. -package parser - -import __yyfmt__ "fmt" - -//lint:file-ignore SA4006 generated parser has unused values - -import ( - "math" - - "github.com/bufbuild/protocompile/ast" -) - -type protoSymType struct { - yys int - file *ast.FileNode - syn *ast.SyntaxNode - fileDecl ast.FileElement - fileDecls []ast.FileElement - pkg *ast.PackageNode - imprt *ast.ImportNode - msg *ast.MessageNode - msgDecl ast.MessageElement - msgDecls []ast.MessageElement - fld *ast.FieldNode - mapFld *ast.MapFieldNode - mapType *ast.MapTypeNode - grp *ast.GroupNode - oo *ast.OneOfNode - ooDecl ast.OneOfElement - ooDecls []ast.OneOfElement - ext *ast.ExtensionRangeNode - resvd *ast.ReservedNode - en *ast.EnumNode - enDecl ast.EnumElement - enDecls []ast.EnumElement - env *ast.EnumValueNode - extend *ast.ExtendNode - extDecl ast.ExtendElement - extDecls []ast.ExtendElement - svc *ast.ServiceNode - svcDecl ast.ServiceElement - svcDecls []ast.ServiceElement - mtd *ast.RPCNode - rpcType *ast.RPCTypeNode - rpcDecl ast.RPCElement - rpcDecls []ast.RPCElement - opt *ast.OptionNode - opts *compactOptionList - ref *ast.FieldReferenceNode - optNms *fieldRefList - cmpctOpts *ast.CompactOptionsNode - rng *ast.RangeNode - rngs *rangeList - names *nameList - cid *identList - tid ast.IdentValueNode - sl *valueList - msgField *ast.MessageFieldNode - msgEntry *messageFieldEntry - msgLit *messageFieldList - v ast.ValueNode - il ast.IntValueNode - str *stringList - s *ast.StringLiteralNode - i *ast.UintLiteralNode - f *ast.FloatLiteralNode - id *ast.IdentNode - b *ast.RuneNode - err error -} - -const _STRING_LIT = 57346 -const _INT_LIT = 57347 -const _FLOAT_LIT = 57348 -const _NAME = 57349 -const _SYNTAX = 57350 -const _IMPORT = 57351 -const _WEAK = 57352 -const _PUBLIC = 57353 -const _PACKAGE = 57354 -const _OPTION = 57355 -const _TRUE = 57356 -const _FALSE = 57357 -const _INF = 57358 -const _NAN = 57359 -const _REPEATED = 57360 -const _OPTIONAL = 57361 -const _REQUIRED = 57362 -const _DOUBLE = 57363 -const _FLOAT = 57364 -const _INT32 = 57365 -const _INT64 = 57366 -const _UINT32 = 57367 -const _UINT64 = 57368 -const _SINT32 = 57369 -const _SINT64 = 57370 -const _FIXED32 = 57371 -const _FIXED64 = 57372 -const _SFIXED32 = 57373 -const _SFIXED64 = 57374 -const _BOOL = 57375 -const _STRING = 57376 -const _BYTES = 57377 -const _GROUP = 57378 -const _ONEOF = 57379 -const _MAP = 57380 -const _EXTENSIONS = 57381 -const _TO = 57382 -const _MAX = 57383 -const _RESERVED = 57384 -const _ENUM = 57385 -const _MESSAGE = 57386 -const _EXTEND = 57387 -const _SERVICE = 57388 -const _RPC = 57389 -const _STREAM = 57390 -const _RETURNS = 57391 -const _ERROR = 57392 - -var protoToknames = [...]string{ - "$end", - "error", - "$unk", - "_STRING_LIT", - "_INT_LIT", - "_FLOAT_LIT", - "_NAME", - "_SYNTAX", - "_IMPORT", - "_WEAK", - "_PUBLIC", - "_PACKAGE", - "_OPTION", - "_TRUE", - "_FALSE", - "_INF", - "_NAN", - "_REPEATED", - "_OPTIONAL", - "_REQUIRED", - "_DOUBLE", - "_FLOAT", - "_INT32", - "_INT64", - "_UINT32", - "_UINT64", - "_SINT32", - "_SINT64", - "_FIXED32", - "_FIXED64", - "_SFIXED32", - "_SFIXED64", - "_BOOL", - "_STRING", - "_BYTES", - "_GROUP", - "_ONEOF", - "_MAP", - "_EXTENSIONS", - "_TO", - "_MAX", - "_RESERVED", - "_ENUM", - "_MESSAGE", - "_EXTEND", - "_SERVICE", - "_RPC", - "_STREAM", - "_RETURNS", - "_ERROR", - "'='", - "';'", - "':'", - "'{'", - "'}'", - "'\\\\'", - "'/'", - "'?'", - "'.'", - "','", - "'>'", - "'<'", - "'+'", - "'-'", - "'('", - "')'", - "'['", - "']'", - "'*'", - "'&'", - "'^'", - "'%'", - "'$'", - "'#'", - "'@'", - "'!'", - "'~'", - "'`'", -} - -var protoStatenames = [...]string{} - -const protoEofCode = 1 -const protoErrCode = 2 -const protoInitialStackSize = 16 - -var protoExca = [...]int16{ - -1, 0, - 1, 4, - -2, 0, - -1, 1, - 1, -1, - -2, 0, - -1, 2, - 1, 1, - -2, 0, - -1, 3, - 1, 2, - -2, 0, - -1, 22, - 1, 3, - -2, 0, - -1, 95, - 55, 185, - -2, 0, - -1, 96, - 55, 173, - -2, 0, - -1, 97, - 55, 202, - -2, 0, - -1, 99, - 55, 210, - -2, 0, - -1, 110, - 55, 54, - -2, 0, - -1, 289, - 55, 52, - 61, 52, - -2, 0, - -1, 354, - 61, 54, - -2, 0, - -1, 370, - 55, 124, - -2, 0, - -1, 404, - 61, 54, - -2, 0, - -1, 409, - 61, 54, - -2, 0, - -1, 497, - 61, 54, - -2, 0, - -1, 547, - 55, 185, - -2, 0, - -1, 551, - 55, 185, - -2, 0, - -1, 555, - 55, 185, - -2, 0, - -1, 573, - 55, 222, - -2, 0, - -1, 580, - 55, 185, - -2, 0, - -1, 583, - 55, 185, - -2, 0, - -1, 586, - 55, 185, - -2, 0, - -1, 607, - 55, 185, - -2, 0, - -1, 619, - 55, 185, - -2, 0, -} - -const protoPrivate = 57344 - -const protoLast = 2396 - -var protoAct = [...]int16{ - 31, 118, 117, 125, 8, 106, 8, 8, 496, 494, - 593, 423, 366, 406, 399, 430, 81, 325, 77, 79, - 80, 82, 84, 327, 316, 107, 8, 310, 411, 408, - 105, 280, 124, 228, 139, 177, 407, 413, 30, 425, - 544, 26, 351, 110, 605, 607, 569, 567, 412, 565, - 85, 354, 555, 87, 88, 89, 352, 75, 367, 367, - 553, 367, 367, 551, 367, 367, 549, 547, 545, 537, - 536, 531, 524, 514, 512, 367, 367, 481, 500, 499, - 367, 367, 365, 367, 574, 414, 367, 367, 110, 367, - 535, 400, 367, 109, 77, 94, 409, 367, 328, 116, - 178, 104, 405, 281, 110, 98, 328, 346, 319, 346, - 576, 292, 409, 103, 346, 345, 577, 345, 543, 301, - 346, 564, 345, 541, 346, 504, 598, 344, 345, 503, - 230, 185, 345, 115, 485, 309, 346, 313, 314, 287, - 597, 538, 515, 350, 345, 501, 480, 391, 303, 305, - 307, 349, 374, 29, 328, 368, 523, 329, 338, 320, - 343, 93, 434, 318, 317, 329, 315, 440, 441, 442, - 443, 444, 445, 17, 446, 447, 448, 449, 91, 619, - 178, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 436, 465, 466, 467, - 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 317, 185, 322, 329, 14, 517, 572, 586, 573, 438, - 4, 15, 284, 583, 16, 17, 580, 14, 596, 284, - 596, 370, 99, 17, 15, 97, 336, 16, 17, 17, - 17, 17, 96, 95, 617, 611, 591, 590, 589, 333, - 334, 335, 584, 581, 578, 19, 18, 20, 21, 337, - 230, 331, 571, 563, 13, 557, 527, 285, 19, 18, - 20, 21, 283, 519, 285, 339, 422, 13, 595, 283, - 595, 609, 390, 281, 373, 372, 342, 341, 332, 323, - 292, 302, 286, 102, 101, 100, 90, 355, 86, 25, - 561, 560, 516, 488, 358, 359, 360, 361, 362, 363, - 487, 340, 486, 420, 419, 356, 418, 417, 347, 416, - 415, 353, 397, 371, 364, 324, 92, 24, 490, 427, - 392, 369, 29, 5, 394, 395, 396, 23, 27, 28, - 122, 11, 388, 11, 11, 588, 120, 10, 389, 10, - 10, 587, 109, 299, 297, 292, 23, 355, 355, 530, - 398, 29, 312, 11, 298, 428, 296, 294, 77, 10, - 529, 528, 121, 9, 431, 9, 9, 295, 511, 510, - 509, 403, 401, 376, 377, 378, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 9, 426, 508, 507, 479, - 317, 506, 482, 109, 489, 292, 478, 312, 421, 483, - 292, 393, 29, 282, 279, 3, 484, 492, 22, 12, - 227, 179, 176, 123, 326, 311, 180, 128, 429, 137, - 127, 433, 126, 431, 513, 505, 520, 521, 229, 432, - 119, 289, 434, 290, 435, 518, 235, 440, 441, 442, - 443, 444, 445, 17, 446, 447, 448, 449, 134, 437, - 522, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 436, 465, 466, 467, - 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 236, 525, 140, 183, 439, 238, 143, 526, 292, 438, - 375, 108, 532, 291, 76, 533, 592, 355, 534, 424, - 7, 6, 2, 1, 0, 542, 77, 109, 0, 546, - 548, 550, 552, 554, 556, 559, 539, 558, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, - 0, 566, 568, 570, 0, 562, 0, 0, 575, 0, - 579, 0, 0, 0, 582, 0, 0, 0, 585, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 594, 0, 0, - 0, 301, 0, 600, 301, 0, 602, 301, 0, 604, - 0, 0, 0, 0, 0, 0, 594, 0, 109, 109, - 606, 608, 301, 610, 301, 0, 301, 612, 613, 0, - 618, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 301, 0, 621, 301, 495, 0, 29, 114, 111, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 0, 0, 0, 0, 110, 0, 0, 0, - 0, 0, 0, 0, 497, 113, 112, 0, 0, 0, - 493, 29, 114, 111, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 0, 0, 0, - 0, 110, 0, 0, 0, 0, 0, 0, 0, 404, - 113, 112, 0, 0, 402, 29, 114, 111, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 0, 0, 0, 0, 110, 0, 0, 0, 0, - 0, 0, 0, 497, 113, 112, 29, 114, 111, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 0, 0, 0, 0, 110, 0, 0, 0, - 0, 0, 540, 0, 0, 113, 112, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 502, 0, 0, 0, 293, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 498, 0, 0, 0, 293, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 410, 0, 0, 0, 293, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 348, 0, 0, 0, - 293, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 288, 0, 0, - 0, 293, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 293, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 130, 0, 0, - 0, 78, 144, 145, 146, 147, 148, 149, 17, 150, - 151, 152, 153, 133, 132, 131, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 136, 142, 135, 170, 171, 138, 19, 18, - 20, 172, 173, 174, 175, 0, 0, 129, 0, 0, - 622, 130, 0, 0, 141, 0, 144, 145, 146, 147, - 148, 149, 17, 150, 151, 152, 153, 133, 132, 131, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 136, 142, 135, 170, - 171, 138, 19, 18, 20, 172, 173, 174, 175, 0, - 0, 129, 0, 0, 620, 130, 0, 0, 141, 0, - 144, 145, 146, 147, 148, 149, 17, 150, 151, 152, - 153, 133, 132, 131, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 136, 142, 135, 170, 171, 138, 19, 18, 20, 172, - 173, 174, 175, 0, 0, 129, 0, 0, 616, 130, - 0, 0, 141, 0, 144, 145, 146, 147, 148, 149, - 17, 150, 151, 152, 153, 133, 132, 131, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 136, 142, 135, 170, 171, 138, - 19, 18, 20, 172, 173, 174, 175, 0, 0, 129, - 0, 0, 615, 130, 0, 0, 141, 0, 144, 145, - 146, 147, 148, 149, 17, 150, 151, 152, 153, 133, - 132, 131, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 136, 142, - 135, 170, 171, 138, 19, 18, 20, 172, 173, 174, - 175, 0, 0, 129, 0, 0, 614, 130, 0, 0, - 141, 0, 144, 145, 146, 147, 148, 149, 17, 150, - 151, 152, 153, 133, 132, 131, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 136, 142, 135, 170, 171, 138, 19, 18, - 20, 172, 173, 174, 175, 0, 0, 129, 0, 0, - 603, 130, 0, 0, 141, 0, 144, 145, 146, 147, - 148, 149, 17, 150, 151, 152, 153, 133, 132, 131, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 136, 142, 135, 170, - 171, 138, 19, 18, 20, 172, 173, 174, 175, 0, - 0, 129, 0, 0, 601, 130, 0, 0, 141, 0, - 144, 145, 146, 147, 148, 149, 17, 150, 151, 152, - 153, 133, 132, 131, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 136, 142, 135, 170, 171, 138, 19, 18, 20, 172, - 173, 174, 175, 0, 0, 129, 0, 0, 599, 130, - 0, 0, 141, 0, 144, 145, 146, 147, 148, 149, - 17, 150, 151, 152, 153, 133, 132, 131, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 136, 142, 135, 170, 171, 138, - 19, 18, 20, 172, 173, 174, 175, 0, 0, 129, - 0, 0, 300, 130, 0, 0, 141, 0, 144, 145, - 146, 147, 148, 149, 17, 150, 151, 152, 153, 133, - 132, 131, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 136, 142, - 135, 170, 171, 138, 19, 18, 20, 172, 173, 174, - 175, 0, 0, 129, 0, 0, 231, 0, 0, 0, - 141, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 234, 233, 232, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 0, 0, 0, 0, 0, 330, - 231, 0, 0, 237, 0, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 234, 233, 232, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 237, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 83, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 491, 74, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 83, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 308, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 83, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 306, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 304, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 0, 0, 0, 0, 0, 182, 0, - 0, 0, 83, 186, 187, 188, 189, 190, 191, 17, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 184, 220, - 221, 222, 223, 224, 225, 226, 0, 182, 181, 0, - 0, 321, 186, 187, 188, 189, 190, 191, 17, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 184, 220, 221, - 222, 223, 224, 225, 226, 357, 0, 181, 0, 0, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, -} - -var protoPact = [...]int16{ - 212, -1000, 225, 225, 276, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, 247, 328, 2346, 1236, 2346, 2346, - 1941, 2346, 225, -1000, 408, -1000, 246, 408, 408, 408, - 244, 119, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, 275, 102, -1000, 1941, 189, - 188, 181, -1000, 2346, 178, 243, -1000, 242, 241, -1000, - -1000, 2346, 812, 1236, 33, 1781, 2255, 1888, -1000, 227, - -1000, -1000, -1000, -1000, 240, -1000, -1000, -1000, -1000, -1000, - 1175, -1000, 361, 348, -1000, -1000, -1000, 1727, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - 239, 2153, 2100, 2047, 2346, 402, 2346, 2346, 357, -1000, - -1000, 2346, 46, 100, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, 2206, -1000, -1000, -1000, - -1000, -1000, 237, 274, 149, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 1834, -1000, -1000, - -1000, 236, 2153, 2100, 2047, 2346, -1000, 2346, 99, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 220, - -1000, -1000, -1000, -1000, 235, 2346, -1000, 105, 72, 1114, - 91, -11, -1000, 2303, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, 2346, 2346, 2346, 2346, 2346, 2346, 273, - 30, 95, 291, 177, 272, 233, 232, 92, -1000, 360, - 2346, -1000, -1000, -1000, 101, 230, 87, 290, -1000, 406, - -1000, -1000, -1000, 2346, 2346, 2346, 271, -1000, 2346, -1000, - -1000, -1000, 26, -1000, -1000, -1000, -1000, -1000, 84, -1000, - -1000, 687, 34, -1000, 1053, -1000, -20, 17, 269, 268, - 266, 265, 263, 262, 403, -1000, 224, 1236, 402, 324, - 440, 401, -1000, -1000, 408, 86, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 25, - -1000, 101, 93, -1000, 261, 259, 252, 399, -1000, 279, - 1994, -1000, 622, -1000, 992, -1000, 11, 10, 85, 931, - 68, 64, -1000, 2346, -1000, 396, 393, 392, 375, 374, - 373, 22, -1000, 5, 82, 251, -1000, -1000, -1000, 160, - -1000, -1000, -1000, -1000, 221, 2346, 2346, -1000, 2346, 97, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 20, -1000, - 1941, -1000, 214, -1000, -1000, -1000, 366, 365, 354, 19, - 26, 1941, 24, -1000, 2, 1, 81, 870, 62, -1000, - -1000, 50, 57, -1000, -1000, -28, 16, 13, 14, 9, - 8, -2, -1000, 213, -1000, 1236, 812, -1000, -1000, -1000, - 250, 249, -1000, 2346, -1000, 211, 60, -1000, -3, -5, - -6, -1000, 210, 164, 18, -1000, -1000, -1000, 751, 49, - 55, -1000, -1000, -1000, -1000, -1000, 202, 1781, 172, -1000, - 201, 1781, 169, -1000, 200, 1781, 163, -1000, -1000, -1000, - 346, 340, -1000, -1000, -1000, -1000, 196, -1000, 195, -1000, - 194, -1000, -1000, 228, -1000, -1000, 80, 66, -1000, 1673, - 1781, -1000, 1619, 1781, -1000, 1565, 1781, -8, -9, -1000, - -1000, -1000, 226, -1000, -1000, -1000, 193, 751, 751, -1000, - 1511, -1000, 1457, -1000, 1403, -1000, 192, 1781, 125, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 1349, 1781, - -1000, 1295, -1000, -} - -var protoPgo = [...]int16{ - 0, 513, 512, 333, 415, 511, 510, 3, 509, 11, - 10, 506, 504, 503, 39, 12, 8, 30, 5, 29, - 501, 23, 0, 500, 496, 495, 494, 493, 21, 492, - 490, 459, 16, 458, 446, 444, 9, 13, 443, 441, - 28, 440, 439, 438, 432, 32, 431, 430, 429, 372, - 1, 2, 15, 428, 24, 427, 426, 34, 425, 424, - 27, 17, 423, 346, 35, 422, 421, 340, 33, 420, - 25, 419, 31, 414, 413, 14, -} - -var protoR1 = [...]int8{ - 0, 1, 1, 1, 1, 4, 4, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 2, 5, 5, - 5, 6, 28, 28, 29, 29, 30, 30, 31, 31, - 7, 14, 14, 12, 12, 16, 16, 17, 17, 17, - 20, 20, 20, 20, 20, 20, 20, 20, 70, 70, - 18, 18, 40, 40, 40, 39, 39, 39, 39, 39, - 39, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 13, 13, 13, 13, 37, 37, 19, 19, - 19, 36, 36, 36, 36, 36, 36, 32, 32, 33, - 33, 34, 34, 35, 35, 41, 41, 41, 41, 41, - 41, 41, 41, 43, 43, 43, 43, 43, 43, 43, - 43, 15, 9, 9, 8, 45, 45, 45, 45, 45, - 45, 44, 53, 53, 53, 52, 52, 52, 52, 52, - 42, 42, 46, 46, 47, 47, 48, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 62, - 62, 60, 60, 58, 58, 58, 61, 61, 59, 59, - 59, 21, 21, 55, 55, 56, 56, 57, 54, 54, - 63, 65, 65, 65, 64, 64, 64, 64, 64, 64, - 66, 66, 49, 51, 51, 51, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 67, - 69, 69, 69, 68, 68, 68, 68, 71, 73, 73, - 73, 72, 72, 72, 72, 72, 74, 74, 75, 75, - 11, 11, 11, 10, 10, 10, 10, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, -} - -var protoR2 = [...]int8{ - 0, 1, 1, 2, 0, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 2, 1, 4, 3, 4, - 4, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, - 1, 2, 2, 2, 2, 1, 2, 2, 1, 2, - 3, 3, 1, 2, 0, 1, 2, 2, 2, 2, - 1, 3, 3, 4, 4, 5, 5, 4, 3, 2, - 5, 4, 1, 3, 5, 3, 1, 3, 1, 3, - 3, 1, 3, 3, 5, 3, 5, 1, 2, 1, - 2, 1, 2, 1, 2, 6, 6, 6, 7, 7, - 7, 5, 6, 6, 6, 6, 7, 7, 7, 5, - 6, 3, 1, 3, 3, 8, 8, 8, 9, 9, - 9, 5, 2, 1, 0, 1, 1, 1, 2, 1, - 5, 6, 7, 8, 5, 6, 6, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 4, 1, 3, 1, 3, 3, 1, 3, 1, 3, - 3, 1, 2, 3, 1, 3, 1, 3, 1, 3, - 5, 2, 1, 0, 1, 1, 1, 1, 2, 1, - 4, 5, 5, 2, 1, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, - 2, 1, 0, 1, 1, 2, 1, 5, 2, 1, - 0, 1, 1, 1, 2, 1, 6, 8, 4, 3, - 2, 1, 0, 1, 1, 2, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, -} - -var protoChk = [...]int16{ - -1000, -1, -2, -4, 8, -3, -5, -6, -7, -49, - -63, -67, -71, 52, 2, 9, 12, 13, 44, 43, - 45, 46, -4, -3, 51, 52, -70, 10, 11, 4, - -28, -22, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, -14, -12, -22, 65, -22, - -22, -32, -28, 59, -22, -70, 52, -70, -70, -70, - 52, 59, 51, 59, -32, 54, 54, 54, -28, 54, - 52, 52, 52, -28, -16, -17, -18, -70, -20, -22, - 54, 6, 64, 63, 5, -14, 66, -51, -50, -41, - -63, -49, -67, -62, -45, -7, -44, -47, -55, 52, - 2, 20, 19, 18, -33, 39, 37, -48, 42, -57, - -29, 59, 38, -24, 7, 8, 9, 10, 11, 12, - 14, 15, 16, 17, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 40, 41, 46, 47, 48, 49, -65, -64, -7, -66, - -56, 52, 2, -27, 42, -57, 7, 8, 9, 10, - 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 43, 44, 45, 46, 47, 48, 49, -69, -68, -43, - -45, 2, 20, 19, 18, -34, -30, 59, -25, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, -73, - -72, -7, -74, 52, 2, 47, 52, -40, 2, -39, - -38, -13, -22, 67, 6, 16, 5, 6, 16, 5, - 55, -50, 52, -32, 36, -32, 36, -32, 36, -22, - -60, -58, 5, -22, -22, -60, -54, -70, -28, 62, - 59, 55, -64, 52, 51, -61, -59, -21, 5, 64, - 55, -68, 52, -32, -32, -32, -22, -28, 59, 55, - -72, 52, -22, 55, 55, 60, 52, -40, 2, 60, - 52, 53, 67, -19, 62, -18, -28, 2, -22, -22, - -22, -22, -22, -22, 51, 52, -15, 67, 60, 40, - 54, 51, 52, 52, 60, -23, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, -28, -21, - 52, 60, 40, 5, -22, -22, -22, 51, -28, -75, - 65, -17, 67, -19, 62, 68, -37, 2, -19, 62, - 2, -40, 68, 57, 68, 51, 51, 51, 51, 51, - 51, 5, 52, -9, -8, -14, -60, 5, 41, -53, - -52, -7, -42, -46, 2, -35, 36, -31, 59, -26, - 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 5, -54, - 60, 52, -15, -61, -21, 41, 51, 51, 51, 5, - 49, 48, -32, 68, -36, 2, -16, 62, 2, 68, - 68, 60, 2, 61, 61, -28, 5, 5, 5, 5, - 5, 5, 52, -15, 68, 60, 51, 55, -52, 52, - -22, -22, -28, 59, 52, -15, -32, 52, 5, 5, - 5, 52, -15, -75, -32, 66, 68, 68, 60, -40, - 2, 61, -37, 61, 68, 52, -15, 54, -15, 52, - -15, 54, -15, 52, -15, 54, -15, 52, -9, -16, - 51, 51, -28, 52, 61, 52, -15, 52, -15, 52, - -15, 52, 52, 54, 66, -36, 61, 61, 52, -51, - 54, 52, -51, 54, 52, -51, 54, 5, 5, 52, - 52, 52, -11, -10, -7, 52, 2, 60, 60, 55, - -51, 55, -51, 55, -51, 52, -15, 54, -15, 55, - -10, 52, -36, -36, 55, 55, 55, 52, -51, 54, - 55, -51, 55, -} - -var protoDef = [...]int16{ - -2, -2, -2, -2, 0, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 16, 0, 0, 0, 0, 0, - 0, 0, -2, 5, 0, 15, 0, 0, 0, 48, - 0, 22, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, - 418, 419, 420, 421, 422, 0, 31, 33, 0, 0, - 0, 0, 87, 0, 0, 0, 18, 0, 0, 49, - 21, 0, 0, 0, 0, -2, -2, -2, 88, -2, - 17, 19, 20, 23, 0, 35, 36, 37, 38, 39, - -2, 40, 0, 0, 45, 32, 34, 0, 184, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 198, 0, 0, 0, 0, 0, 0, 0, 0, 164, - 89, 0, 253, 24, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 254, 255, 256, 257, 258, 259, 0, 172, 174, 175, - 176, 177, 179, 0, 0, 166, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, - 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 0, 201, 203, - 204, 206, 0, 0, 0, 0, 91, 0, 26, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 0, - 209, 211, 212, 213, 215, 0, 30, 0, 60, -2, - 55, 0, 72, 0, 41, 44, 47, 42, 43, 46, - 182, 183, 197, 0, 409, 0, 409, 0, 409, 0, - 0, 151, 153, 0, 0, 0, 0, 168, 90, 0, - 0, 170, 171, 178, 0, 0, 156, 158, 161, 0, - 199, 200, 205, 0, 0, 0, 0, 92, 0, 207, - 208, 214, 0, 50, 51, 58, 59, 53, 60, 56, - 57, 0, 0, 69, -2, 78, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 149, 0, 0, 0, 0, - -2, 0, 163, 167, 0, 0, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 25, 0, - 165, 0, 0, 162, 0, 0, 0, 0, 27, 0, - 0, 61, 0, 68, -2, 62, 0, 0, 76, -2, - 60, 0, 73, 0, 75, 0, 0, 0, 0, 0, - 0, 0, 150, 0, 112, 0, 152, 154, 155, 0, - 123, 125, 126, 127, 129, 0, 366, 93, 0, 28, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 0, 169, - 0, 180, 0, 157, 159, 160, 0, 0, 0, 0, - 0, 421, 0, 63, 0, 0, 81, -2, 60, 64, - 67, 0, 60, 71, 79, 0, 0, 0, 0, 0, - 0, 0, 101, 0, 111, 0, 0, 121, 122, 128, - 0, 0, 94, 0, 134, 0, 0, 181, 0, 0, - 0, 109, 0, 0, 0, 219, 65, 66, 0, 0, - 60, 70, 77, 80, 74, 95, 0, -2, 0, 96, - 0, -2, 0, 97, 0, -2, 0, 102, 113, 114, - 0, 0, 29, 135, 136, 103, 0, 104, 0, 105, - 0, 110, 216, -2, 218, 82, 83, 85, 98, 0, - -2, 99, 0, -2, 100, 0, -2, 0, 0, 106, - 107, 108, 0, 221, 223, 224, 226, 0, 0, 115, - 0, 116, 0, 117, 0, 130, 0, -2, 0, 217, - 220, 225, 84, 86, 118, 119, 120, 131, 0, -2, - 132, 0, 133, -} - -var protoTok1 = [...]int8{ - 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 76, 3, 74, 73, 72, 70, 3, - 65, 66, 69, 63, 60, 64, 59, 57, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 53, 52, - 62, 51, 61, 58, 75, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 67, 56, 68, 71, 3, 78, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 54, 3, 55, 77, -} - -var protoTok2 = [...]int8{ - 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, -} - -var protoTok3 = [...]int8{ - 0, -} - -var protoErrorMessages = [...]struct { - state int - token int - msg string -}{} - -/* parser for yacc output */ - -var ( - protoDebug = 0 - protoErrorVerbose = false -) - -type protoLexer interface { - Lex(lval *protoSymType) int - Error(s string) -} - -type protoParser interface { - Parse(protoLexer) int - Lookahead() int -} - -type protoParserImpl struct { - lval protoSymType - stack [protoInitialStackSize]protoSymType - char int -} - -func (p *protoParserImpl) Lookahead() int { - return p.char -} - -func protoNewParser() protoParser { - return &protoParserImpl{} -} - -const protoFlag = -1000 - -func protoTokname(c int) string { - if c >= 1 && c-1 < len(protoToknames) { - if protoToknames[c-1] != "" { - return protoToknames[c-1] - } - } - return __yyfmt__.Sprintf("tok-%v", c) -} - -func protoStatname(s int) string { - if s >= 0 && s < len(protoStatenames) { - if protoStatenames[s] != "" { - return protoStatenames[s] - } - } - return __yyfmt__.Sprintf("state-%v", s) -} - -func protoErrorMessage(state, lookAhead int) string { - const TOKSTART = 4 - - if !protoErrorVerbose { - return "syntax error" - } - - for _, e := range protoErrorMessages { - if e.state == state && e.token == lookAhead { - return "syntax error: " + e.msg - } - } - - res := "syntax error: unexpected " + protoTokname(lookAhead) - - // To match Bison, suggest at most four expected tokens. - expected := make([]int, 0, 4) - - // Look for shiftable tokens. - base := int(protoPact[state]) - for tok := TOKSTART; tok-1 < len(protoToknames); tok++ { - if n := base + tok; n >= 0 && n < protoLast && int(protoChk[int(protoAct[n])]) == tok { - if len(expected) == cap(expected) { - return res - } - expected = append(expected, tok) - } - } - - if protoDef[state] == -2 { - i := 0 - for protoExca[i] != -1 || int(protoExca[i+1]) != state { - i += 2 - } - - // Look for tokens that we accept or reduce. - for i += 2; protoExca[i] >= 0; i += 2 { - tok := int(protoExca[i]) - if tok < TOKSTART || protoExca[i+1] == 0 { - continue - } - if len(expected) == cap(expected) { - return res - } - expected = append(expected, tok) - } - - // If the default action is to accept or reduce, give up. - if protoExca[i+1] != 0 { - return res - } - } - - for i, tok := range expected { - if i == 0 { - res += ", expecting " - } else { - res += " or " - } - res += protoTokname(tok) - } - return res -} - -func protolex1(lex protoLexer, lval *protoSymType) (char, token int) { - token = 0 - char = lex.Lex(lval) - if char <= 0 { - token = int(protoTok1[0]) - goto out - } - if char < len(protoTok1) { - token = int(protoTok1[char]) - goto out - } - if char >= protoPrivate { - if char < protoPrivate+len(protoTok2) { - token = int(protoTok2[char-protoPrivate]) - goto out - } - } - for i := 0; i < len(protoTok3); i += 2 { - token = int(protoTok3[i+0]) - if token == char { - token = int(protoTok3[i+1]) - goto out - } - } - -out: - if token == 0 { - token = int(protoTok2[1]) /* unknown char */ - } - if protoDebug >= 3 { - __yyfmt__.Printf("lex %s(%d)\n", protoTokname(token), uint(char)) - } - return char, token -} - -func protoParse(protolex protoLexer) int { - return protoNewParser().Parse(protolex) -} - -func (protorcvr *protoParserImpl) Parse(protolex protoLexer) int { - var proton int - var protoVAL protoSymType - var protoDollar []protoSymType - _ = protoDollar // silence set and not used - protoS := protorcvr.stack[:] - - Nerrs := 0 /* number of errors */ - Errflag := 0 /* error recovery flag */ - protostate := 0 - protorcvr.char = -1 - prototoken := -1 // protorcvr.char translated into internal numbering - defer func() { - // Make sure we report no lookahead when not parsing. - protostate = -1 - protorcvr.char = -1 - prototoken = -1 - }() - protop := -1 - goto protostack - -ret0: - return 0 - -ret1: - return 1 - -protostack: - /* put a state and value onto the stack */ - if protoDebug >= 4 { - __yyfmt__.Printf("char %v in %v\n", protoTokname(prototoken), protoStatname(protostate)) - } - - protop++ - if protop >= len(protoS) { - nyys := make([]protoSymType, len(protoS)*2) - copy(nyys, protoS) - protoS = nyys - } - protoS[protop] = protoVAL - protoS[protop].yys = protostate - -protonewstate: - proton = int(protoPact[protostate]) - if proton <= protoFlag { - goto protodefault /* simple state */ - } - if protorcvr.char < 0 { - protorcvr.char, prototoken = protolex1(protolex, &protorcvr.lval) - } - proton += prototoken - if proton < 0 || proton >= protoLast { - goto protodefault - } - proton = int(protoAct[proton]) - if int(protoChk[proton]) == prototoken { /* valid shift */ - protorcvr.char = -1 - prototoken = -1 - protoVAL = protorcvr.lval - protostate = proton - if Errflag > 0 { - Errflag-- - } - goto protostack - } - -protodefault: - /* default state action */ - proton = int(protoDef[protostate]) - if proton == -2 { - if protorcvr.char < 0 { - protorcvr.char, prototoken = protolex1(protolex, &protorcvr.lval) - } - - /* look through exception table */ - xi := 0 - for { - if protoExca[xi+0] == -1 && int(protoExca[xi+1]) == protostate { - break - } - xi += 2 - } - for xi += 2; ; xi += 2 { - proton = int(protoExca[xi+0]) - if proton < 0 || proton == prototoken { - break - } - } - proton = int(protoExca[xi+1]) - if proton < 0 { - goto ret0 - } - } - if proton == 0 { - /* error ... attempt to resume parsing */ - switch Errflag { - case 0: /* brand new error */ - protolex.Error(protoErrorMessage(protostate, prototoken)) - Nerrs++ - if protoDebug >= 1 { - __yyfmt__.Printf("%s", protoStatname(protostate)) - __yyfmt__.Printf(" saw %s\n", protoTokname(prototoken)) - } - fallthrough - - case 1, 2: /* incompletely recovered error ... try again */ - Errflag = 3 - - /* find a state where "error" is a legal shift action */ - for protop >= 0 { - proton = int(protoPact[protoS[protop].yys]) + protoErrCode - if proton >= 0 && proton < protoLast { - protostate = int(protoAct[proton]) /* simulate a shift of "error" */ - if int(protoChk[protostate]) == protoErrCode { - goto protostack - } - } - - /* the current p has no shift on "error", pop stack */ - if protoDebug >= 2 { - __yyfmt__.Printf("error recovery pops state %d\n", protoS[protop].yys) - } - protop-- - } - /* there is no state on the stack with an error shift ... abort */ - goto ret1 - - case 3: /* no shift yet; clobber input char */ - if protoDebug >= 2 { - __yyfmt__.Printf("error recovery discards %s\n", protoTokname(prototoken)) - } - if prototoken == protoEofCode { - goto ret1 - } - protorcvr.char = -1 - prototoken = -1 - goto protonewstate /* try again in the same state */ - } - } - - /* reduction by production proton */ - if protoDebug >= 2 { - __yyfmt__.Printf("reduce %v in:\n\t%v\n", proton, protoStatname(protostate)) - } - - protont := proton - protopt := protop - _ = protopt // guard against "declared and not used" - - protop -= int(protoR2[proton]) - // protop is now the index of $0. Perform the default action. Iff the - // reduced production is ε, $1 is possibly out of range. - if protop+1 >= len(protoS) { - nyys := make([]protoSymType, len(protoS)*2) - copy(nyys, protoS) - protoS = nyys - } - protoVAL = protoS[protop+1] - - /* consult goto table to find next state */ - proton = int(protoR1[proton]) - protog := int(protoPgo[proton]) - protoj := protog + protoS[protop].yys + 1 - - if protoj >= protoLast { - protostate = int(protoAct[protog]) - } else { - protostate = int(protoAct[protoj]) - if int(protoChk[protostate]) != -proton { - protostate = int(protoAct[protog]) - } - } - // dummy call; replaced with literal code - switch protont { - - case 1: - protoDollar = protoS[protopt-1 : protopt+1] - { - lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, protoDollar[1].syn, nil, lex.eof) - lex.res = protoVAL.file - } - case 2: - protoDollar = protoS[protopt-1 : protopt+1] - { - lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, nil, protoDollar[1].fileDecls, lex.eof) - lex.res = protoVAL.file - } - case 3: - protoDollar = protoS[protopt-2 : protopt+1] - { - lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, protoDollar[1].syn, protoDollar[2].fileDecls, lex.eof) - lex.res = protoVAL.file - } - case 4: - protoDollar = protoS[protopt-0 : protopt+1] - { - lex := protolex.(*protoLex) - protoVAL.file = ast.NewFileNode(lex.info, nil, nil, lex.eof) - lex.res = protoVAL.file - } - case 5: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].fileDecl != nil { - protoVAL.fileDecls = append(protoDollar[1].fileDecls, protoDollar[2].fileDecl) - } else { - protoVAL.fileDecls = protoDollar[1].fileDecls - } - } - case 6: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].fileDecl != nil { - protoVAL.fileDecls = []ast.FileElement{protoDollar[1].fileDecl} - } else { - protoVAL.fileDecls = nil - } - } - case 7: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].imprt - } - case 8: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].pkg - } - case 9: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].opt - } - case 10: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].msg - } - case 11: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].en - } - case 12: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].extend - } - case 13: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = protoDollar[1].svc - } - case 14: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = ast.NewEmptyDeclNode(protoDollar[1].b) - } - case 15: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.fileDecl = nil - } - case 16: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.fileDecl = nil - } - case 17: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.syn = ast.NewSyntaxNode(protoDollar[1].id.ToKeyword(), protoDollar[2].b, protoDollar[3].str.toStringValueNode(), protoDollar[4].b) - } - case 18: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, nil, protoDollar[2].str.toStringValueNode(), protoDollar[3].b) - } - case 19: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), nil, protoDollar[2].id.ToKeyword(), protoDollar[3].str.toStringValueNode(), protoDollar[4].b) - } - case 20: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.imprt = ast.NewImportNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), nil, protoDollar[3].str.toStringValueNode(), protoDollar[4].b) - } - case 21: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.pkg = ast.NewPackageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b) - } - case 22: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, nil, nil} - } - case 23: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, protoDollar[2].b, protoDollar[3].cid} - } - case 24: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, nil, nil} - } - case 25: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, protoDollar[2].b, protoDollar[3].cid} - } - case 26: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, nil, nil} - } - case 27: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, protoDollar[2].b, protoDollar[3].cid} - } - case 28: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, nil, nil} - } - case 29: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.cid = &identList{protoDollar[1].id, protoDollar[2].b, protoDollar[3].cid} - } - case 30: - protoDollar = protoS[protopt-5 : protopt+1] - { - refs, dots := protoDollar[2].optNms.toNodes() - optName := ast.NewOptionNameNode(refs, dots) - protoVAL.opt = ast.NewOptionNode(protoDollar[1].id.ToKeyword(), optName, protoDollar[3].b, protoDollar[4].v, protoDollar[5].b) - } - case 31: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.optNms = &fieldRefList{protoDollar[1].ref, nil, nil} - } - case 32: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.optNms = &fieldRefList{protoDollar[1].ref, protoDollar[2].b, protoDollar[3].optNms} - } - case 33: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ref = ast.NewFieldReferenceNode(protoDollar[1].id) - } - case 34: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.ref = ast.NewExtensionFieldReferenceNode(protoDollar[1].b, protoDollar[2].tid, protoDollar[3].b) - } - case 37: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.v = protoDollar[1].str.toStringValueNode() - } - case 39: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.v = protoDollar[1].id - } - case 40: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.v = protoDollar[1].f - } - case 41: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, protoDollar[2].f) - } - case 42: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, protoDollar[2].f) - } - case 43: - protoDollar = protoS[protopt-2 : protopt+1] - { - f := ast.NewSpecialFloatLiteralNode(protoDollar[2].id.ToKeyword()) - protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, f) - } - case 44: - protoDollar = protoS[protopt-2 : protopt+1] - { - f := ast.NewSpecialFloatLiteralNode(protoDollar[2].id.ToKeyword()) - protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, f) - } - case 45: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.v = protoDollar[1].i - } - case 46: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.v = ast.NewPositiveUintLiteralNode(protoDollar[1].b, protoDollar[2].i) - } - case 47: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].i.Val > math.MaxInt64+1 { - // can't represent as int so treat as float literal - protoVAL.v = ast.NewSignedFloatLiteralNode(protoDollar[1].b, protoDollar[2].i) - } else { - protoVAL.v = ast.NewNegativeIntLiteralNode(protoDollar[1].b, protoDollar[2].i) - } - } - case 48: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.str = &stringList{protoDollar[1].s, nil} - } - case 49: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.str = &stringList{protoDollar[1].s, protoDollar[2].str} - } - case 50: - protoDollar = protoS[protopt-3 : protopt+1] - { - fields, delims := protoDollar[2].msgLit.toNodes() - protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, fields, delims, protoDollar[3].b) - } - case 51: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.v = nil - } - case 52: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].msgEntry != nil { - protoVAL.msgLit = &messageFieldList{protoDollar[1].msgEntry, nil} - } else { - protoVAL.msgLit = nil - } - } - case 53: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[1].msgEntry != nil { - protoVAL.msgLit = &messageFieldList{protoDollar[1].msgEntry, protoDollar[2].msgLit} - } else { - protoVAL.msgLit = protoDollar[2].msgLit - } - } - case 54: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.msgLit = nil - } - case 55: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].msgField != nil { - protoVAL.msgEntry = &messageFieldEntry{protoDollar[1].msgField, nil} - } else { - protoVAL.msgEntry = nil - } - } - case 56: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[1].msgField != nil { - protoVAL.msgEntry = &messageFieldEntry{protoDollar[1].msgField, protoDollar[2].b} - } else { - protoVAL.msgEntry = nil - } - } - case 57: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[1].msgField != nil { - protoVAL.msgEntry = &messageFieldEntry{protoDollar[1].msgField, protoDollar[2].b} - } else { - protoVAL.msgEntry = nil - } - } - case 58: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.msgEntry = nil - } - case 59: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.msgEntry = nil - } - case 60: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgEntry = nil - } - case 61: - protoDollar = protoS[protopt-3 : protopt+1] - { - if protoDollar[1].ref != nil { - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, protoDollar[2].b, protoDollar[3].v) - } else { - protoVAL.msgField = nil - } - } - case 62: - protoDollar = protoS[protopt-3 : protopt+1] - { - if protoDollar[1].ref != nil { - val := ast.NewArrayLiteralNode(protoDollar[2].b, nil, nil, protoDollar[3].b) - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, nil, val) - } else { - protoVAL.msgField = nil - } - } - case 63: - protoDollar = protoS[protopt-4 : protopt+1] - { - if protoDollar[1].ref != nil { - val := ast.NewArrayLiteralNode(protoDollar[3].b, nil, nil, protoDollar[4].b) - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, protoDollar[2].b, val) - } else { - protoVAL.msgField = nil - } - } - case 64: - protoDollar = protoS[protopt-4 : protopt+1] - { - if protoDollar[1].ref != nil { - vals, commas := protoDollar[3].sl.toNodes() - val := ast.NewArrayLiteralNode(protoDollar[2].b, vals, commas, protoDollar[4].b) - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, nil, val) - } else { - protoVAL.msgField = nil - } - } - case 65: - protoDollar = protoS[protopt-5 : protopt+1] - { - if protoDollar[1].ref != nil { - vals, commas := protoDollar[4].sl.toNodes() - val := ast.NewArrayLiteralNode(protoDollar[3].b, vals, commas, protoDollar[5].b) - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, protoDollar[2].b, val) - } else { - protoVAL.msgField = nil - } - } - case 66: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.msgField = nil - } - case 67: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.msgField = nil - } - case 68: - protoDollar = protoS[protopt-3 : protopt+1] - { - if protoDollar[1].ref != nil && protoDollar[3].v != nil { - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, protoDollar[2].b, protoDollar[3].v) - } else { - protoVAL.msgField = nil - } - } - case 69: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[1].ref != nil && protoDollar[2].v != nil { - protoVAL.msgField = ast.NewMessageFieldNode(protoDollar[1].ref, nil, protoDollar[2].v) - } else { - protoVAL.msgField = nil - } - } - case 70: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.msgField = nil - } - case 71: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.msgField = nil - } - case 72: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ref = ast.NewFieldReferenceNode(protoDollar[1].id) - } - case 73: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.ref = ast.NewExtensionFieldReferenceNode(protoDollar[1].b, protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b) - } - case 74: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.ref = ast.NewAnyTypeReferenceNode(protoDollar[1].b, protoDollar[2].cid.toIdentValueNode(nil), protoDollar[3].b, protoDollar[4].cid.toIdentValueNode(nil), protoDollar[5].b) - } - case 75: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.ref = nil - } - case 76: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].v == nil { - protoVAL.sl = nil - } else { - protoVAL.sl = &valueList{protoDollar[1].v, nil, nil} - } - } - case 77: - protoDollar = protoS[protopt-3 : protopt+1] - { - if protoDollar[1].v == nil { - protoVAL.sl = nil - } else { - protoVAL.sl = &valueList{protoDollar[1].v, protoDollar[2].b, protoDollar[3].sl} - } - } - case 78: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.v = protoDollar[1].v - } - case 79: - protoDollar = protoS[protopt-3 : protopt+1] - { - fields, delims := protoDollar[2].msgLit.toNodes() - protoVAL.v = ast.NewMessageLiteralNode(protoDollar[1].b, fields, delims, protoDollar[3].b) - } - case 80: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.v = nil - } - case 81: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.sl = &valueList{protoDollar[1].v, nil, nil} - } - case 82: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.sl = &valueList{protoDollar[1].v, protoDollar[2].b, protoDollar[3].sl} - } - case 83: - protoDollar = protoS[protopt-3 : protopt+1] - { - fields, delims := protoDollar[2].msgLit.toNodes() - msg := ast.NewMessageLiteralNode(protoDollar[1].b, fields, delims, protoDollar[3].b) - protoVAL.sl = &valueList{msg, nil, nil} - } - case 84: - protoDollar = protoS[protopt-5 : protopt+1] - { - fields, delims := protoDollar[2].msgLit.toNodes() - msg := ast.NewMessageLiteralNode(protoDollar[1].b, fields, delims, protoDollar[3].b) - protoVAL.sl = &valueList{msg, protoDollar[4].b, protoDollar[5].sl} - } - case 85: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.sl = nil - } - case 86: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.sl = protoDollar[5].sl - } - case 87: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) - } - case 88: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) - } - case 89: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) - } - case 90: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) - } - case 91: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) - } - case 92: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) - } - case 93: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.tid = protoDollar[1].cid.toIdentValueNode(nil) - } - case 94: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.tid = protoDollar[2].cid.toIdentValueNode(protoDollar[1].b) - } - case 95: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 96: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 97: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 98: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 99: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 100: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 101: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) - } - case 102: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) - } - case 103: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 104: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 105: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b) - } - case 106: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 107: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 108: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b) - } - case 109: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) - } - case 110: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) - } - case 111: - protoDollar = protoS[protopt-3 : protopt+1] - { - opts, commas := protoDollar[2].opts.toNodes() - protoVAL.cmpctOpts = ast.NewCompactOptionsNode(protoDollar[1].b, opts, commas, protoDollar[3].b) - } - case 112: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.opts = &compactOptionList{protoDollar[1].opt, nil, nil} - } - case 113: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.opts = &compactOptionList{protoDollar[1].opt, protoDollar[2].b, protoDollar[3].opts} - } - case 114: - protoDollar = protoS[protopt-3 : protopt+1] - { - refs, dots := protoDollar[1].optNms.toNodes() - optName := ast.NewOptionNameNode(refs, dots) - protoVAL.opt = ast.NewCompactOptionNode(optName, protoDollar[2].b, protoDollar[3].v) - } - case 115: - protoDollar = protoS[protopt-8 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b, protoDollar[7].msgDecls, protoDollar[8].b) - } - case 116: - protoDollar = protoS[protopt-8 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b, protoDollar[7].msgDecls, protoDollar[8].b) - } - case 117: - protoDollar = protoS[protopt-8 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, nil, protoDollar[6].b, protoDollar[7].msgDecls, protoDollar[8].b) - } - case 118: - protoDollar = protoS[protopt-9 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b, protoDollar[8].msgDecls, protoDollar[9].b) - } - case 119: - protoDollar = protoS[protopt-9 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b, protoDollar[8].msgDecls, protoDollar[9].b) - } - case 120: - protoDollar = protoS[protopt-9 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id.ToKeyword(), protoDollar[3].id, protoDollar[4].b, protoDollar[5].i, protoDollar[6].cmpctOpts, protoDollar[7].b, protoDollar[8].msgDecls, protoDollar[9].b) - } - case 121: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.oo = ast.NewOneOfNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].ooDecls, protoDollar[5].b) - } - case 122: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].ooDecl != nil { - protoVAL.ooDecls = append(protoDollar[1].ooDecls, protoDollar[2].ooDecl) - } else { - protoVAL.ooDecls = protoDollar[1].ooDecls - } - } - case 123: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].ooDecl != nil { - protoVAL.ooDecls = []ast.OneOfElement{protoDollar[1].ooDecl} - } else { - protoVAL.ooDecls = nil - } - } - case 124: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.ooDecls = nil - } - case 125: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ooDecl = protoDollar[1].opt - } - case 126: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ooDecl = protoDollar[1].fld - } - case 127: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ooDecl = protoDollar[1].grp - } - case 128: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.ooDecl = nil - } - case 129: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.ooDecl = nil - } - case 130: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) - } - case 131: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.fld = ast.NewFieldNode(nil, protoDollar[1].tid, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) - } - case 132: - protoDollar = protoS[protopt-7 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(nil, protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b, protoDollar[6].msgDecls, protoDollar[7].b) - } - case 133: - protoDollar = protoS[protopt-8 : protopt+1] - { - protoVAL.grp = ast.NewGroupNode(nil, protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b, protoDollar[7].msgDecls, protoDollar[8].b) - } - case 134: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.mapFld = ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, nil, protoDollar[5].b) - } - case 135: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.mapFld = ast.NewMapFieldNode(protoDollar[1].mapType, protoDollar[2].id, protoDollar[3].b, protoDollar[4].i, protoDollar[5].cmpctOpts, protoDollar[6].b) - } - case 136: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.mapType = ast.NewMapTypeNode(protoDollar[1].id.ToKeyword(), protoDollar[2].b, protoDollar[3].id, protoDollar[4].b, protoDollar[5].tid, protoDollar[6].b) - } - case 149: - protoDollar = protoS[protopt-3 : protopt+1] - { - ranges, commas := protoDollar[2].rngs.toNodes() - protoVAL.ext = ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), ranges, commas, nil, protoDollar[3].b) - } - case 150: - protoDollar = protoS[protopt-4 : protopt+1] - { - ranges, commas := protoDollar[2].rngs.toNodes() - protoVAL.ext = ast.NewExtensionRangeNode(protoDollar[1].id.ToKeyword(), ranges, commas, protoDollar[3].cmpctOpts, protoDollar[4].b) - } - case 151: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rngs = &rangeList{protoDollar[1].rng, nil, nil} - } - case 152: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rngs = &rangeList{protoDollar[1].rng, protoDollar[2].b, protoDollar[3].rngs} - } - case 153: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, nil, nil, nil) - } - case 154: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, protoDollar[2].id.ToKeyword(), protoDollar[3].i, nil) - } - case 155: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].i, protoDollar[2].id.ToKeyword(), nil, protoDollar[3].id.ToKeyword()) - } - case 156: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rngs = &rangeList{protoDollar[1].rng, nil, nil} - } - case 157: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rngs = &rangeList{protoDollar[1].rng, protoDollar[2].b, protoDollar[3].rngs} - } - case 158: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, nil, nil, nil) - } - case 159: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, protoDollar[2].id.ToKeyword(), protoDollar[3].il, nil) - } - case 160: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rng = ast.NewRangeNode(protoDollar[1].il, protoDollar[2].id.ToKeyword(), nil, protoDollar[3].id.ToKeyword()) - } - case 161: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.il = protoDollar[1].i - } - case 162: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.il = ast.NewNegativeIntLiteralNode(protoDollar[1].b, protoDollar[2].i) - } - case 163: - protoDollar = protoS[protopt-3 : protopt+1] - { - ranges, commas := protoDollar[2].rngs.toNodes() - protoVAL.resvd = ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), ranges, commas, protoDollar[3].b) - } - case 165: - protoDollar = protoS[protopt-3 : protopt+1] - { - ranges, commas := protoDollar[2].rngs.toNodes() - protoVAL.resvd = ast.NewReservedRangesNode(protoDollar[1].id.ToKeyword(), ranges, commas, protoDollar[3].b) - } - case 167: - protoDollar = protoS[protopt-3 : protopt+1] - { - names, commas := protoDollar[2].names.toNodes() - protoVAL.resvd = ast.NewReservedNamesNode(protoDollar[1].id.ToKeyword(), names, commas, protoDollar[3].b) - } - case 168: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.names = &nameList{protoDollar[1].str.toStringValueNode(), nil, nil} - } - case 169: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.names = &nameList{protoDollar[1].str.toStringValueNode(), protoDollar[2].b, protoDollar[3].names} - } - case 170: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.en = ast.NewEnumNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].enDecls, protoDollar[5].b) - } - case 171: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].enDecl != nil { - protoVAL.enDecls = append(protoDollar[1].enDecls, protoDollar[2].enDecl) - } else { - protoVAL.enDecls = protoDollar[1].enDecls - } - } - case 172: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].enDecl != nil { - protoVAL.enDecls = []ast.EnumElement{protoDollar[1].enDecl} - } else { - protoVAL.enDecls = nil - } - } - case 173: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.enDecls = nil - } - case 174: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.enDecl = protoDollar[1].opt - } - case 175: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.enDecl = protoDollar[1].env - } - case 176: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.enDecl = protoDollar[1].resvd - } - case 177: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.enDecl = ast.NewEmptyDeclNode(protoDollar[1].b) - } - case 178: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.enDecl = nil - } - case 179: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.enDecl = nil - } - case 180: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.env = ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, nil, protoDollar[4].b) - } - case 181: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.env = ast.NewEnumValueNode(protoDollar[1].id, protoDollar[2].b, protoDollar[3].il, protoDollar[4].cmpctOpts, protoDollar[5].b) - } - case 182: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.msg = ast.NewMessageNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].msgDecls, protoDollar[5].b) - } - case 183: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].msgDecl != nil { - protoVAL.msgDecls = append(protoDollar[1].msgDecls, protoDollar[2].msgDecl) - } else { - protoVAL.msgDecls = protoDollar[1].msgDecls - } - } - case 184: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].msgDecl != nil { - protoVAL.msgDecls = []ast.MessageElement{protoDollar[1].msgDecl} - } else { - protoVAL.msgDecls = nil - } - } - case 185: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.msgDecls = nil - } - case 186: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].fld - } - case 187: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].en - } - case 188: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].msg - } - case 189: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].extend - } - case 190: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].ext - } - case 191: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].grp - } - case 192: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].opt - } - case 193: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].oo - } - case 194: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].mapFld - } - case 195: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = protoDollar[1].resvd - } - case 196: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = ast.NewEmptyDeclNode(protoDollar[1].b) - } - case 197: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.msgDecl = nil - } - case 198: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.msgDecl = nil - } - case 199: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.extend = ast.NewExtendNode(protoDollar[1].id.ToKeyword(), protoDollar[2].tid, protoDollar[3].b, protoDollar[4].extDecls, protoDollar[5].b) - } - case 200: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].extDecl != nil { - protoVAL.extDecls = append(protoDollar[1].extDecls, protoDollar[2].extDecl) - } else { - protoVAL.extDecls = protoDollar[1].extDecls - } - } - case 201: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].extDecl != nil { - protoVAL.extDecls = []ast.ExtendElement{protoDollar[1].extDecl} - } else { - protoVAL.extDecls = nil - } - } - case 202: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.extDecls = nil - } - case 203: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.extDecl = protoDollar[1].fld - } - case 204: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.extDecl = protoDollar[1].grp - } - case 205: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.extDecl = nil - } - case 206: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.extDecl = nil - } - case 207: - protoDollar = protoS[protopt-5 : protopt+1] - { - protoVAL.svc = ast.NewServiceNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].b, protoDollar[4].svcDecls, protoDollar[5].b) - } - case 208: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].svcDecl != nil { - protoVAL.svcDecls = append(protoDollar[1].svcDecls, protoDollar[2].svcDecl) - } else { - protoVAL.svcDecls = protoDollar[1].svcDecls - } - } - case 209: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].svcDecl != nil { - protoVAL.svcDecls = []ast.ServiceElement{protoDollar[1].svcDecl} - } else { - protoVAL.svcDecls = nil - } - } - case 210: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.svcDecls = nil - } - case 211: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.svcDecl = protoDollar[1].opt - } - case 212: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.svcDecl = protoDollar[1].mtd - } - case 213: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.svcDecl = ast.NewEmptyDeclNode(protoDollar[1].b) - } - case 214: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.svcDecl = nil - } - case 215: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.svcDecl = nil - } - case 216: - protoDollar = protoS[protopt-6 : protopt+1] - { - protoVAL.mtd = ast.NewRPCNode(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].rpcType, protoDollar[4].id.ToKeyword(), protoDollar[5].rpcType, protoDollar[6].b) - } - case 217: - protoDollar = protoS[protopt-8 : protopt+1] - { - protoVAL.mtd = ast.NewRPCNodeWithBody(protoDollar[1].id.ToKeyword(), protoDollar[2].id, protoDollar[3].rpcType, protoDollar[4].id.ToKeyword(), protoDollar[5].rpcType, protoDollar[6].b, protoDollar[7].rpcDecls, protoDollar[8].b) - } - case 218: - protoDollar = protoS[protopt-4 : protopt+1] - { - protoVAL.rpcType = ast.NewRPCTypeNode(protoDollar[1].b, protoDollar[2].id.ToKeyword(), protoDollar[3].tid, protoDollar[4].b) - } - case 219: - protoDollar = protoS[protopt-3 : protopt+1] - { - protoVAL.rpcType = ast.NewRPCTypeNode(protoDollar[1].b, nil, protoDollar[2].tid, protoDollar[3].b) - } - case 220: - protoDollar = protoS[protopt-2 : protopt+1] - { - if protoDollar[2].rpcDecl != nil { - protoVAL.rpcDecls = append(protoDollar[1].rpcDecls, protoDollar[2].rpcDecl) - } else { - protoVAL.rpcDecls = protoDollar[1].rpcDecls - } - } - case 221: - protoDollar = protoS[protopt-1 : protopt+1] - { - if protoDollar[1].rpcDecl != nil { - protoVAL.rpcDecls = []ast.RPCElement{protoDollar[1].rpcDecl} - } else { - protoVAL.rpcDecls = nil - } - } - case 222: - protoDollar = protoS[protopt-0 : protopt+1] - { - protoVAL.rpcDecls = nil - } - case 223: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rpcDecl = protoDollar[1].opt - } - case 224: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rpcDecl = ast.NewEmptyDeclNode(protoDollar[1].b) - } - case 225: - protoDollar = protoS[protopt-2 : protopt+1] - { - protoVAL.rpcDecl = nil - } - case 226: - protoDollar = protoS[protopt-1 : protopt+1] - { - protoVAL.rpcDecl = nil - } - } - goto protostack /* stack new state and value */ -} diff --git a/vendor/github.com/bufbuild/protocompile/parser/result.go b/vendor/github.com/bufbuild/protocompile/parser/result.go deleted file mode 100644 index 89afa2a11c..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/result.go +++ /dev/null @@ -1,928 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "bytes" - "math" - "strings" - "unicode" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/reporter" -) - -type result struct { - file *ast.FileNode - proto *descriptorpb.FileDescriptorProto - - nodes map[proto.Message]ast.Node -} - -// ResultWithoutAST returns a parse result that has no AST. All methods for -// looking up AST nodes return a placeholder node that contains only the filename -// in position information. -func ResultWithoutAST(proto *descriptorpb.FileDescriptorProto) Result { - return &result{proto: proto} -} - -// ResultFromAST constructs a descriptor proto from the given AST. The returned -// result includes the descriptor proto and also contains an index that can be -// used to lookup AST node information for elements in the descriptor proto -// hierarchy. -// -// If validate is true, some basic validation is performed, to make sure the -// resulting descriptor proto is valid per protobuf rules and semantics. Only -// some language elements can be validated since some rules and semantics can -// only be checked after all symbols are all resolved, which happens in the -// linking step. -// -// The given handler is used to report any errors or warnings encountered. If any -// errors are reported, this function returns a non-nil error. -func ResultFromAST(file *ast.FileNode, validate bool, handler *reporter.Handler) (Result, error) { - filename := file.Name() - r := &result{file: file, nodes: map[proto.Message]ast.Node{}} - r.createFileDescriptor(filename, file, handler) - if validate { - validateBasic(r, handler) - } - // Now that we're done validating, we can set any missing labels to optional - // (we leave them absent in first pass if label was missing in source, so we - // can do validation on presence of label, but final descriptors are expected - // to always have them present). - fillInMissingLabels(r.proto) - return r, handler.Error() -} - -func (r *result) AST() *ast.FileNode { - return r.file -} - -func (r *result) FileDescriptorProto() *descriptorpb.FileDescriptorProto { - return r.proto -} - -func (r *result) createFileDescriptor(filename string, file *ast.FileNode, handler *reporter.Handler) { - fd := &descriptorpb.FileDescriptorProto{Name: proto.String(filename)} - r.proto = fd - - r.putFileNode(fd, file) - - isProto3 := false - if file.Syntax != nil { - if file.Syntax.Syntax.AsString() == "proto3" { - isProto3 = true - } else if file.Syntax.Syntax.AsString() != "proto2" { - nodeInfo := file.NodeInfo(file.Syntax.Syntax) - if handler.HandleErrorf(nodeInfo.Start(), `syntax value must be "proto2" or "proto3"`) != nil { - return - } - } - - // proto2 is the default, so no need to set unless proto3 - if isProto3 { - fd.Syntax = proto.String(file.Syntax.Syntax.AsString()) - } - } else { - nodeInfo := file.NodeInfo(file) - handler.HandleWarningWithPos(nodeInfo.Start(), ErrNoSyntax) - } - - for _, decl := range file.Decls { - if handler.ReporterError() != nil { - return - } - switch decl := decl.(type) { - case *ast.EnumNode: - fd.EnumType = append(fd.EnumType, r.asEnumDescriptor(decl, handler)) - case *ast.ExtendNode: - r.addExtensions(decl, &fd.Extension, &fd.MessageType, isProto3, handler, 0) - case *ast.ImportNode: - index := len(fd.Dependency) - fd.Dependency = append(fd.Dependency, decl.Name.AsString()) - if decl.Public != nil { - fd.PublicDependency = append(fd.PublicDependency, int32(index)) - } else if decl.Weak != nil { - fd.WeakDependency = append(fd.WeakDependency, int32(index)) - } - case *ast.MessageNode: - fd.MessageType = append(fd.MessageType, r.asMessageDescriptor(decl, isProto3, handler, 1)) - case *ast.OptionNode: - if fd.Options == nil { - fd.Options = &descriptorpb.FileOptions{} - } - fd.Options.UninterpretedOption = append(fd.Options.UninterpretedOption, r.asUninterpretedOption(decl)) - case *ast.ServiceNode: - fd.Service = append(fd.Service, r.asServiceDescriptor(decl)) - case *ast.PackageNode: - if fd.Package != nil { - nodeInfo := file.NodeInfo(decl) - if handler.HandleErrorf(nodeInfo.Start(), "files should have only one package declaration") != nil { - return - } - } - pkgName := string(decl.Name.AsIdentifier()) - if len(pkgName) >= 512 { - nodeInfo := file.NodeInfo(decl.Name) - if handler.HandleErrorf(nodeInfo.Start(), "package name (with whitespace removed) must be less than 512 characters long") != nil { - return - } - } - if strings.Count(pkgName, ".") > 100 { - nodeInfo := file.NodeInfo(decl.Name) - if handler.HandleErrorf(nodeInfo.Start(), "package name may not contain more than 100 periods") != nil { - return - } - } - fd.Package = proto.String(string(decl.Name.AsIdentifier())) - } - } -} - -func (r *result) asUninterpretedOptions(nodes []*ast.OptionNode) []*descriptorpb.UninterpretedOption { - if len(nodes) == 0 { - return nil - } - opts := make([]*descriptorpb.UninterpretedOption, len(nodes)) - for i, n := range nodes { - opts[i] = r.asUninterpretedOption(n) - } - return opts -} - -func (r *result) asUninterpretedOption(node *ast.OptionNode) *descriptorpb.UninterpretedOption { - opt := &descriptorpb.UninterpretedOption{Name: r.asUninterpretedOptionName(node.Name.Parts)} - r.putOptionNode(opt, node) - - switch val := node.Val.Value().(type) { - case bool: - if val { - opt.IdentifierValue = proto.String("true") - } else { - opt.IdentifierValue = proto.String("false") - } - case int64: - opt.NegativeIntValue = proto.Int64(val) - case uint64: - opt.PositiveIntValue = proto.Uint64(val) - case float64: - opt.DoubleValue = proto.Float64(val) - case string: - opt.StringValue = []byte(val) - case ast.Identifier: - opt.IdentifierValue = proto.String(string(val)) - default: - // the grammar does not allow arrays here, so the only possible case - // left should be []*ast.MessageFieldNode, which corresponds to an - // *ast.MessageLiteralNode - if n, ok := node.Val.(*ast.MessageLiteralNode); ok { - var buf bytes.Buffer - for i, el := range n.Elements { - flattenNode(r.file, el, &buf) - if len(n.Seps) > i && n.Seps[i] != nil { - buf.WriteRune(' ') - buf.WriteRune(n.Seps[i].Rune) - } - } - aggStr := buf.String() - opt.AggregateValue = proto.String(aggStr) - } - // TODO: else that reports an error or panics?? - } - return opt -} - -func flattenNode(f *ast.FileNode, n ast.Node, buf *bytes.Buffer) { - if cn, ok := n.(ast.CompositeNode); ok { - for _, ch := range cn.Children() { - flattenNode(f, ch, buf) - } - return - } - - if buf.Len() > 0 { - buf.WriteRune(' ') - } - buf.WriteString(f.NodeInfo(n).RawText()) -} - -func (r *result) asUninterpretedOptionName(parts []*ast.FieldReferenceNode) []*descriptorpb.UninterpretedOption_NamePart { - ret := make([]*descriptorpb.UninterpretedOption_NamePart, len(parts)) - for i, part := range parts { - np := &descriptorpb.UninterpretedOption_NamePart{ - NamePart: proto.String(string(part.Name.AsIdentifier())), - IsExtension: proto.Bool(part.IsExtension()), - } - r.putOptionNamePartNode(np, part) - ret[i] = np - } - return ret -} - -func (r *result) addExtensions(ext *ast.ExtendNode, flds *[]*descriptorpb.FieldDescriptorProto, msgs *[]*descriptorpb.DescriptorProto, isProto3 bool, handler *reporter.Handler, depth int) { - extendee := string(ext.Extendee.AsIdentifier()) - count := 0 - for _, decl := range ext.Decls { - switch decl := decl.(type) { - case *ast.FieldNode: - count++ - // use higher limit since we don't know yet whether extendee is messageset wire format - fd := r.asFieldDescriptor(decl, internal.MaxTag, isProto3, handler) - fd.Extendee = proto.String(extendee) - *flds = append(*flds, fd) - case *ast.GroupNode: - count++ - // ditto: use higher limit right now - fd, md := r.asGroupDescriptors(decl, isProto3, internal.MaxTag, handler, depth+1) - fd.Extendee = proto.String(extendee) - *flds = append(*flds, fd) - *msgs = append(*msgs, md) - } - } - if count == 0 { - nodeInfo := r.file.NodeInfo(ext) - _ = handler.HandleErrorf(nodeInfo.Start(), "extend sections must define at least one extension") - } -} - -func asLabel(lbl *ast.FieldLabel) *descriptorpb.FieldDescriptorProto_Label { - if !lbl.IsPresent() { - return nil - } - switch { - case lbl.Repeated: - return descriptorpb.FieldDescriptorProto_LABEL_REPEATED.Enum() - case lbl.Required: - return descriptorpb.FieldDescriptorProto_LABEL_REQUIRED.Enum() - default: - return descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() - } -} - -func (r *result) asFieldDescriptor(node *ast.FieldNode, maxTag int32, isProto3 bool, handler *reporter.Handler) *descriptorpb.FieldDescriptorProto { - tag := node.Tag.Val - if err := r.checkTag(node.Tag, tag, maxTag); err != nil { - _ = handler.HandleError(err) - } - fd := newFieldDescriptor(node.Name.Val, string(node.FldType.AsIdentifier()), int32(tag), asLabel(&node.Label)) - r.putFieldNode(fd, node) - if opts := node.Options.GetElements(); len(opts) > 0 { - fd.Options = &descriptorpb.FieldOptions{UninterpretedOption: r.asUninterpretedOptions(opts)} - } - if isProto3 && fd.Label != nil && fd.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL { - fd.Proto3Optional = proto.Bool(true) - } - return fd -} - -var fieldTypes = map[string]descriptorpb.FieldDescriptorProto_Type{ - "double": descriptorpb.FieldDescriptorProto_TYPE_DOUBLE, - "float": descriptorpb.FieldDescriptorProto_TYPE_FLOAT, - "int32": descriptorpb.FieldDescriptorProto_TYPE_INT32, - "int64": descriptorpb.FieldDescriptorProto_TYPE_INT64, - "uint32": descriptorpb.FieldDescriptorProto_TYPE_UINT32, - "uint64": descriptorpb.FieldDescriptorProto_TYPE_UINT64, - "sint32": descriptorpb.FieldDescriptorProto_TYPE_SINT32, - "sint64": descriptorpb.FieldDescriptorProto_TYPE_SINT64, - "fixed32": descriptorpb.FieldDescriptorProto_TYPE_FIXED32, - "fixed64": descriptorpb.FieldDescriptorProto_TYPE_FIXED64, - "sfixed32": descriptorpb.FieldDescriptorProto_TYPE_SFIXED32, - "sfixed64": descriptorpb.FieldDescriptorProto_TYPE_SFIXED64, - "bool": descriptorpb.FieldDescriptorProto_TYPE_BOOL, - "string": descriptorpb.FieldDescriptorProto_TYPE_STRING, - "bytes": descriptorpb.FieldDescriptorProto_TYPE_BYTES, -} - -func newFieldDescriptor(name string, fieldType string, tag int32, lbl *descriptorpb.FieldDescriptorProto_Label) *descriptorpb.FieldDescriptorProto { - fd := &descriptorpb.FieldDescriptorProto{ - Name: proto.String(name), - JsonName: proto.String(internal.JSONName(name)), - Number: proto.Int32(tag), - Label: lbl, - } - t, ok := fieldTypes[fieldType] - if ok { - fd.Type = t.Enum() - } else { - // NB: we don't have enough info to determine whether this is an enum - // or a message type, so we'll leave Type nil and set it later - // (during linking) - fd.TypeName = proto.String(fieldType) - } - return fd -} - -func (r *result) asGroupDescriptors(group *ast.GroupNode, isProto3 bool, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { - tag := group.Tag.Val - if err := r.checkTag(group.Tag, tag, maxTag); err != nil { - _ = handler.HandleError(err) - } - if !unicode.IsUpper(rune(group.Name.Val[0])) { - nameNodeInfo := r.file.NodeInfo(group.Name) - _ = handler.HandleErrorf(nameNodeInfo.Start(), "group %s should have a name that starts with a capital letter", group.Name.Val) - } - fieldName := strings.ToLower(group.Name.Val) - fd := &descriptorpb.FieldDescriptorProto{ - Name: proto.String(fieldName), - JsonName: proto.String(internal.JSONName(fieldName)), - Number: proto.Int32(int32(tag)), - Label: asLabel(&group.Label), - Type: descriptorpb.FieldDescriptorProto_TYPE_GROUP.Enum(), - TypeName: proto.String(group.Name.Val), - } - r.putFieldNode(fd, group) - if opts := group.Options.GetElements(); len(opts) > 0 { - fd.Options = &descriptorpb.FieldOptions{UninterpretedOption: r.asUninterpretedOptions(opts)} - } - md := &descriptorpb.DescriptorProto{Name: proto.String(group.Name.Val)} - r.putMessageNode(md, group) - // don't bother processing body if we've exceeded depth - if r.checkDepth(depth, group, handler) { - r.addMessageBody(md, &group.MessageBody, isProto3, handler, depth) - } - return fd, md -} - -func (r *result) asMapDescriptors(mapField *ast.MapFieldNode, isProto3 bool, maxTag int32, handler *reporter.Handler, depth int) (*descriptorpb.FieldDescriptorProto, *descriptorpb.DescriptorProto) { - tag := mapField.Tag.Val - if err := r.checkTag(mapField.Tag, tag, maxTag); err != nil { - _ = handler.HandleError(err) - } - r.checkDepth(depth, mapField, handler) - var lbl *descriptorpb.FieldDescriptorProto_Label - if !isProto3 { - lbl = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() - } - keyFd := newFieldDescriptor("key", mapField.MapType.KeyType.Val, 1, lbl) - r.putFieldNode(keyFd, mapField.KeyField()) - valFd := newFieldDescriptor("value", string(mapField.MapType.ValueType.AsIdentifier()), 2, lbl) - r.putFieldNode(valFd, mapField.ValueField()) - entryName := internal.InitCap(internal.JSONName(mapField.Name.Val)) + "Entry" - fd := newFieldDescriptor(mapField.Name.Val, entryName, int32(tag), descriptorpb.FieldDescriptorProto_LABEL_REPEATED.Enum()) - if opts := mapField.Options.GetElements(); len(opts) > 0 { - fd.Options = &descriptorpb.FieldOptions{UninterpretedOption: r.asUninterpretedOptions(opts)} - } - r.putFieldNode(fd, mapField) - md := &descriptorpb.DescriptorProto{ - Name: proto.String(entryName), - Options: &descriptorpb.MessageOptions{MapEntry: proto.Bool(true)}, - Field: []*descriptorpb.FieldDescriptorProto{keyFd, valFd}, - } - r.putMessageNode(md, mapField) - return fd, md -} - -func (r *result) asExtensionRanges(node *ast.ExtensionRangeNode, maxTag int32, handler *reporter.Handler) []*descriptorpb.DescriptorProto_ExtensionRange { - opts := r.asUninterpretedOptions(node.Options.GetElements()) - ers := make([]*descriptorpb.DescriptorProto_ExtensionRange, len(node.Ranges)) - for i, rng := range node.Ranges { - start, end := r.getRangeBounds(rng, 1, maxTag, handler) - er := &descriptorpb.DescriptorProto_ExtensionRange{ - Start: proto.Int32(start), - End: proto.Int32(end + 1), - } - if len(opts) > 0 { - er.Options = &descriptorpb.ExtensionRangeOptions{UninterpretedOption: opts} - } - r.putExtensionRangeNode(er, rng) - ers[i] = er - } - return ers -} - -func (r *result) asEnumValue(ev *ast.EnumValueNode, handler *reporter.Handler) *descriptorpb.EnumValueDescriptorProto { - num, ok := ast.AsInt32(ev.Number, math.MinInt32, math.MaxInt32) - if !ok { - numberNodeInfo := r.file.NodeInfo(ev.Number) - _ = handler.HandleErrorf(numberNodeInfo.Start(), "value %d is out of range: should be between %d and %d", ev.Number.Value(), math.MinInt32, math.MaxInt32) - } - evd := &descriptorpb.EnumValueDescriptorProto{Name: proto.String(ev.Name.Val), Number: proto.Int32(num)} - r.putEnumValueNode(evd, ev) - if opts := ev.Options.GetElements(); len(opts) > 0 { - evd.Options = &descriptorpb.EnumValueOptions{UninterpretedOption: r.asUninterpretedOptions(opts)} - } - return evd -} - -func (r *result) asMethodDescriptor(node *ast.RPCNode) *descriptorpb.MethodDescriptorProto { - md := &descriptorpb.MethodDescriptorProto{ - Name: proto.String(node.Name.Val), - InputType: proto.String(string(node.Input.MessageType.AsIdentifier())), - OutputType: proto.String(string(node.Output.MessageType.AsIdentifier())), - } - r.putMethodNode(md, node) - if node.Input.Stream != nil { - md.ClientStreaming = proto.Bool(true) - } - if node.Output.Stream != nil { - md.ServerStreaming = proto.Bool(true) - } - // protoc always adds a MethodOptions if there are brackets - // We do the same to match protoc as closely as possible - // https://github.com/protocolbuffers/protobuf/blob/0c3f43a6190b77f1f68b7425d1b7e1a8257a8d0c/src/google/protobuf/compiler/parser.cc#L2152 - if node.OpenBrace != nil { - md.Options = &descriptorpb.MethodOptions{} - for _, decl := range node.Decls { - if option, ok := decl.(*ast.OptionNode); ok { - md.Options.UninterpretedOption = append(md.Options.UninterpretedOption, r.asUninterpretedOption(option)) - } - } - } - return md -} - -func (r *result) asEnumDescriptor(en *ast.EnumNode, handler *reporter.Handler) *descriptorpb.EnumDescriptorProto { - ed := &descriptorpb.EnumDescriptorProto{Name: proto.String(en.Name.Val)} - r.putEnumNode(ed, en) - for _, decl := range en.Decls { - switch decl := decl.(type) { - case *ast.OptionNode: - if ed.Options == nil { - ed.Options = &descriptorpb.EnumOptions{} - } - ed.Options.UninterpretedOption = append(ed.Options.UninterpretedOption, r.asUninterpretedOption(decl)) - case *ast.EnumValueNode: - ed.Value = append(ed.Value, r.asEnumValue(decl, handler)) - case *ast.ReservedNode: - for _, n := range decl.Names { - ed.ReservedName = append(ed.ReservedName, n.AsString()) - } - for _, rng := range decl.Ranges { - ed.ReservedRange = append(ed.ReservedRange, r.asEnumReservedRange(rng, handler)) - } - } - } - return ed -} - -func (r *result) asEnumReservedRange(rng *ast.RangeNode, handler *reporter.Handler) *descriptorpb.EnumDescriptorProto_EnumReservedRange { - start, end := r.getRangeBounds(rng, math.MinInt32, math.MaxInt32, handler) - rr := &descriptorpb.EnumDescriptorProto_EnumReservedRange{ - Start: proto.Int32(start), - End: proto.Int32(end), - } - r.putEnumReservedRangeNode(rr, rng) - return rr -} - -func (r *result) asMessageDescriptor(node *ast.MessageNode, isProto3 bool, handler *reporter.Handler, depth int) *descriptorpb.DescriptorProto { - msgd := &descriptorpb.DescriptorProto{Name: proto.String(node.Name.Val)} - r.putMessageNode(msgd, node) - // don't bother processing body if we've exceeded depth - if r.checkDepth(depth, node, handler) { - r.addMessageBody(msgd, &node.MessageBody, isProto3, handler, depth) - } - return msgd -} - -func (r *result) checkDepth(depth int, node ast.MessageDeclNode, handler *reporter.Handler) bool { - if depth < 32 { - return true - } - n := ast.Node(node) - if grp, ok := n.(*ast.GroupNode); ok { - // pinpoint the group keyword if the source is a group - n = grp.Keyword - } - _ = handler.HandleErrorf(r.file.NodeInfo(n).Start(), "message nesting depth must be less than 32") - return false -} - -func (r *result) addMessageBody(msgd *descriptorpb.DescriptorProto, body *ast.MessageBody, isProto3 bool, handler *reporter.Handler, depth int) { - // first process any options - for _, decl := range body.Decls { - if opt, ok := decl.(*ast.OptionNode); ok { - if msgd.Options == nil { - msgd.Options = &descriptorpb.MessageOptions{} - } - msgd.Options.UninterpretedOption = append(msgd.Options.UninterpretedOption, r.asUninterpretedOption(opt)) - } - } - - // now that we have options, we can see if this uses messageset wire format, which - // impacts how we validate tag numbers in any fields in the message - maxTag := int32(internal.MaxNormalTag) - messageSetOpt, err := r.isMessageSetWireFormat("message "+msgd.GetName(), msgd, handler) - if err != nil { - return - } else if messageSetOpt != nil { - if isProto3 { - node := r.OptionNode(messageSetOpt) - nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format are not allowed with proto3 syntax") - } - maxTag = internal.MaxTag // higher limit for messageset wire format - } - - rsvdNames := map[string]int{} - - // now we can process the rest - for _, decl := range body.Decls { - switch decl := decl.(type) { - case *ast.EnumNode: - msgd.EnumType = append(msgd.EnumType, r.asEnumDescriptor(decl, handler)) - case *ast.ExtendNode: - r.addExtensions(decl, &msgd.Extension, &msgd.NestedType, isProto3, handler, depth) - case *ast.ExtensionRangeNode: - msgd.ExtensionRange = append(msgd.ExtensionRange, r.asExtensionRanges(decl, maxTag, handler)...) - case *ast.FieldNode: - fd := r.asFieldDescriptor(decl, maxTag, isProto3, handler) - msgd.Field = append(msgd.Field, fd) - case *ast.MapFieldNode: - fd, md := r.asMapDescriptors(decl, isProto3, maxTag, handler, depth+1) - msgd.Field = append(msgd.Field, fd) - msgd.NestedType = append(msgd.NestedType, md) - case *ast.GroupNode: - fd, md := r.asGroupDescriptors(decl, isProto3, maxTag, handler, depth+1) - msgd.Field = append(msgd.Field, fd) - msgd.NestedType = append(msgd.NestedType, md) - case *ast.OneOfNode: - oodIndex := len(msgd.OneofDecl) - ood := &descriptorpb.OneofDescriptorProto{Name: proto.String(decl.Name.Val)} - r.putOneOfNode(ood, decl) - msgd.OneofDecl = append(msgd.OneofDecl, ood) - ooFields := 0 - for _, oodecl := range decl.Decls { - switch oodecl := oodecl.(type) { - case *ast.OptionNode: - if ood.Options == nil { - ood.Options = &descriptorpb.OneofOptions{} - } - ood.Options.UninterpretedOption = append(ood.Options.UninterpretedOption, r.asUninterpretedOption(oodecl)) - case *ast.FieldNode: - fd := r.asFieldDescriptor(oodecl, maxTag, isProto3, handler) - fd.OneofIndex = proto.Int32(int32(oodIndex)) - msgd.Field = append(msgd.Field, fd) - ooFields++ - case *ast.GroupNode: - fd, md := r.asGroupDescriptors(oodecl, isProto3, maxTag, handler, depth+1) - fd.OneofIndex = proto.Int32(int32(oodIndex)) - msgd.Field = append(msgd.Field, fd) - msgd.NestedType = append(msgd.NestedType, md) - ooFields++ - } - } - if ooFields == 0 { - declNodeInfo := r.file.NodeInfo(decl) - _ = handler.HandleErrorf(declNodeInfo.Start(), "oneof must contain at least one field") - } - case *ast.MessageNode: - msgd.NestedType = append(msgd.NestedType, r.asMessageDescriptor(decl, isProto3, handler, depth+1)) - case *ast.ReservedNode: - for _, n := range decl.Names { - count := rsvdNames[n.AsString()] - if count == 1 { // already seen - nameNodeInfo := r.file.NodeInfo(n) - _ = handler.HandleErrorf(nameNodeInfo.Start(), "name %q is reserved multiple times", n.AsString()) - } - rsvdNames[n.AsString()] = count + 1 - msgd.ReservedName = append(msgd.ReservedName, n.AsString()) - } - for _, rng := range decl.Ranges { - msgd.ReservedRange = append(msgd.ReservedRange, r.asMessageReservedRange(rng, maxTag, handler)) - } - } - } - - if messageSetOpt != nil { - if len(msgd.Field) > 0 { - node := r.FieldNode(msgd.Field[0]) - nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format cannot contain non-extension fields") - } - if len(msgd.ExtensionRange) == 0 { - node := r.OptionNode(messageSetOpt) - nodeInfo := r.file.NodeInfo(node) - _ = handler.HandleErrorf(nodeInfo.Start(), "messages with message-set wire format must contain at least one extension range") - } - } - - // process any proto3_optional fields - if isProto3 { - r.processProto3OptionalFields(msgd) - } -} - -func (r *result) isMessageSetWireFormat(scope string, md *descriptorpb.DescriptorProto, handler *reporter.Handler) (*descriptorpb.UninterpretedOption, error) { - uo := md.GetOptions().GetUninterpretedOption() - index, err := internal.FindOption(r, handler, scope, uo, "message_set_wire_format") - if err != nil { - return nil, err - } - if index == -1 { - // no such option - return nil, nil - } - - opt := uo[index] - - switch opt.GetIdentifierValue() { - case "true": - return opt, nil - case "false": - return nil, nil - default: - optNode := r.OptionNode(opt) - optNodeInfo := r.file.NodeInfo(optNode.GetValue()) - return nil, handler.HandleErrorf(optNodeInfo.Start(), "%s: expecting bool value for message_set_wire_format option", scope) - } -} - -func (r *result) asMessageReservedRange(rng *ast.RangeNode, maxTag int32, handler *reporter.Handler) *descriptorpb.DescriptorProto_ReservedRange { - start, end := r.getRangeBounds(rng, 1, maxTag, handler) - rr := &descriptorpb.DescriptorProto_ReservedRange{ - Start: proto.Int32(start), - End: proto.Int32(end + 1), - } - r.putMessageReservedRangeNode(rr, rng) - return rr -} - -func (r *result) getRangeBounds(rng *ast.RangeNode, minVal, maxVal int32, handler *reporter.Handler) (int32, int32) { - checkOrder := true - start, ok := rng.StartValueAsInt32(minVal, maxVal) - if !ok { - checkOrder = false - startValNodeInfo := r.file.NodeInfo(rng.StartVal) - _ = handler.HandleErrorf(startValNodeInfo.Start(), "range start %d is out of range: should be between %d and %d", rng.StartValue(), minVal, maxVal) - } - - end, ok := rng.EndValueAsInt32(minVal, maxVal) - if !ok { - checkOrder = false - if rng.EndVal != nil { - endValNodeInfo := r.file.NodeInfo(rng.EndVal) - _ = handler.HandleErrorf(endValNodeInfo.Start(), "range end %d is out of range: should be between %d and %d", rng.EndValue(), minVal, maxVal) - } - } - - if checkOrder && start > end { - rangeStartNodeInfo := r.file.NodeInfo(rng.RangeStart()) - _ = handler.HandleErrorf(rangeStartNodeInfo.Start(), "range, %d to %d, is invalid: start must be <= end", start, end) - } - - return start, end -} - -func (r *result) asServiceDescriptor(svc *ast.ServiceNode) *descriptorpb.ServiceDescriptorProto { - sd := &descriptorpb.ServiceDescriptorProto{Name: proto.String(svc.Name.Val)} - r.putServiceNode(sd, svc) - for _, decl := range svc.Decls { - switch decl := decl.(type) { - case *ast.OptionNode: - if sd.Options == nil { - sd.Options = &descriptorpb.ServiceOptions{} - } - sd.Options.UninterpretedOption = append(sd.Options.UninterpretedOption, r.asUninterpretedOption(decl)) - case *ast.RPCNode: - sd.Method = append(sd.Method, r.asMethodDescriptor(decl)) - } - } - return sd -} - -func (r *result) checkTag(n ast.Node, v uint64, maxTag int32) error { - switch { - case v < 1: - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d must be greater than zero", v) - case v > uint64(maxTag): - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d is higher than max allowed tag number (%d)", v, maxTag) - case v >= internal.SpecialReservedStart && v <= internal.SpecialReservedEnd: - return reporter.Errorf(r.file.NodeInfo(n).Start(), "tag number %d is in disallowed reserved range %d-%d", v, internal.SpecialReservedStart, internal.SpecialReservedEnd) - default: - return nil - } -} - -// processProto3OptionalFields adds synthetic oneofs to the given message descriptor -// for each proto3 optional field. It also updates the fields to have the correct -// oneof index reference. -func (r *result) processProto3OptionalFields(msgd *descriptorpb.DescriptorProto) { - // add synthetic oneofs to the given message descriptor for each proto3 - // optional field, and update each field to have correct oneof index - var allNames map[string]struct{} - for _, fd := range msgd.Field { - if fd.GetProto3Optional() { - // lazy init the set of all names - if allNames == nil { - allNames = map[string]struct{}{} - for _, fd := range msgd.Field { - allNames[fd.GetName()] = struct{}{} - } - for _, od := range msgd.OneofDecl { - allNames[od.GetName()] = struct{}{} - } - // NB: protoc only considers names of other fields and oneofs - // when computing the synthetic oneof name. But that feels like - // a bug, since it means it could generate a name that conflicts - // with some other symbol defined in the message. If it's decided - // that's NOT a bug and is desirable, then we should remove the - // following four loops to mimic protoc's behavior. - for _, fd := range msgd.Extension { - allNames[fd.GetName()] = struct{}{} - } - for _, ed := range msgd.EnumType { - allNames[ed.GetName()] = struct{}{} - for _, evd := range ed.Value { - allNames[evd.GetName()] = struct{}{} - } - } - for _, fd := range msgd.NestedType { - allNames[fd.GetName()] = struct{}{} - } - } - - // Compute a name for the synthetic oneof. This uses the same - // algorithm as used in protoc: - // https://github.com/protocolbuffers/protobuf/blob/74ad62759e0a9b5a21094f3fb9bb4ebfaa0d1ab8/src/google/protobuf/compiler/parser.cc#L785-L803 - ooName := fd.GetName() - if !strings.HasPrefix(ooName, "_") { - ooName = "_" + ooName - } - for { - _, ok := allNames[ooName] - if !ok { - // found a unique name - allNames[ooName] = struct{}{} - break - } - ooName = "X" + ooName - } - - fd.OneofIndex = proto.Int32(int32(len(msgd.OneofDecl))) - ood := &descriptorpb.OneofDescriptorProto{Name: proto.String(ooName)} - msgd.OneofDecl = append(msgd.OneofDecl, ood) - ooident := r.FieldNode(fd).(*ast.FieldNode) //nolint:errcheck - r.putOneOfNode(ood, ast.NewSyntheticOneOf(ooident)) - } - } -} - -func (r *result) Node(m proto.Message) ast.Node { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[m] -} - -func (r *result) FileNode() ast.FileDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[r.proto].(ast.FileDeclNode) -} - -func (r *result) OptionNode(o *descriptorpb.UninterpretedOption) ast.OptionDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[o].(ast.OptionDeclNode) -} - -func (r *result) OptionNamePartNode(o *descriptorpb.UninterpretedOption_NamePart) ast.Node { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[o] -} - -func (r *result) MessageNode(m *descriptorpb.DescriptorProto) ast.MessageDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[m].(ast.MessageDeclNode) -} - -func (r *result) FieldNode(f *descriptorpb.FieldDescriptorProto) ast.FieldDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[f].(ast.FieldDeclNode) -} - -func (r *result) OneOfNode(o *descriptorpb.OneofDescriptorProto) ast.Node { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[o] -} - -func (r *result) ExtensionRangeNode(e *descriptorpb.DescriptorProto_ExtensionRange) ast.RangeDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[e].(ast.RangeDeclNode) -} - -func (r *result) MessageReservedRangeNode(rr *descriptorpb.DescriptorProto_ReservedRange) ast.RangeDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[rr].(ast.RangeDeclNode) -} - -func (r *result) EnumNode(e *descriptorpb.EnumDescriptorProto) ast.Node { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[e] -} - -func (r *result) EnumValueNode(e *descriptorpb.EnumValueDescriptorProto) ast.EnumValueDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[e].(ast.EnumValueDeclNode) -} - -func (r *result) EnumReservedRangeNode(rr *descriptorpb.EnumDescriptorProto_EnumReservedRange) ast.RangeDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[rr].(ast.RangeDeclNode) -} - -func (r *result) ServiceNode(s *descriptorpb.ServiceDescriptorProto) ast.Node { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[s] -} - -func (r *result) MethodNode(m *descriptorpb.MethodDescriptorProto) ast.RPCDeclNode { - if r.nodes == nil { - return ast.NewNoSourceNode(r.proto.GetName()) - } - return r.nodes[m].(ast.RPCDeclNode) -} - -func (r *result) putFileNode(f *descriptorpb.FileDescriptorProto, n *ast.FileNode) { - r.nodes[f] = n -} - -func (r *result) putOptionNode(o *descriptorpb.UninterpretedOption, n *ast.OptionNode) { - r.nodes[o] = n -} - -func (r *result) putOptionNamePartNode(o *descriptorpb.UninterpretedOption_NamePart, n *ast.FieldReferenceNode) { - r.nodes[o] = n -} - -func (r *result) putMessageNode(m *descriptorpb.DescriptorProto, n ast.MessageDeclNode) { - r.nodes[m] = n -} - -func (r *result) putFieldNode(f *descriptorpb.FieldDescriptorProto, n ast.FieldDeclNode) { - r.nodes[f] = n -} - -func (r *result) putOneOfNode(o *descriptorpb.OneofDescriptorProto, n ast.OneOfDeclNode) { - r.nodes[o] = n -} - -func (r *result) putExtensionRangeNode(e *descriptorpb.DescriptorProto_ExtensionRange, n *ast.RangeNode) { - r.nodes[e] = n -} - -func (r *result) putMessageReservedRangeNode(rr *descriptorpb.DescriptorProto_ReservedRange, n *ast.RangeNode) { - r.nodes[rr] = n -} - -func (r *result) putEnumNode(e *descriptorpb.EnumDescriptorProto, n *ast.EnumNode) { - r.nodes[e] = n -} - -func (r *result) putEnumValueNode(e *descriptorpb.EnumValueDescriptorProto, n *ast.EnumValueNode) { - r.nodes[e] = n -} - -func (r *result) putEnumReservedRangeNode(rr *descriptorpb.EnumDescriptorProto_EnumReservedRange, n *ast.RangeNode) { - r.nodes[rr] = n -} - -func (r *result) putServiceNode(s *descriptorpb.ServiceDescriptorProto, n *ast.ServiceNode) { - r.nodes[s] = n -} - -func (r *result) putMethodNode(m *descriptorpb.MethodDescriptorProto, n *ast.RPCNode) { - r.nodes[m] = n -} - -// NB: If we ever add other put*Node methods, to index other kinds of elements in the descriptor -// proto hierarchy, we need to update the index recreation logic in clone.go, too. diff --git a/vendor/github.com/bufbuild/protocompile/parser/validate.go b/vendor/github.com/bufbuild/protocompile/parser/validate.go deleted file mode 100644 index 494a00ef5e..0000000000 --- a/vendor/github.com/bufbuild/protocompile/parser/validate.go +++ /dev/null @@ -1,499 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package parser - -import ( - "fmt" - "sort" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/reporter" - "github.com/bufbuild/protocompile/walk" -) - -func validateBasic(res *result, handler *reporter.Handler) { - fd := res.proto - isProto3 := fd.GetSyntax() == "proto3" - - if err := validateImports(res, handler); err != nil { - return - } - - _ = walk.DescriptorProtos(fd, - func(name protoreflect.FullName, d proto.Message) error { - switch d := d.(type) { - case *descriptorpb.DescriptorProto: - if err := validateMessage(res, isProto3, name, d, handler); err != nil { - // exit func is not called when enter returns error - return err - } - case *descriptorpb.EnumDescriptorProto: - if err := validateEnum(res, isProto3, name, d, handler); err != nil { - return err - } - case *descriptorpb.FieldDescriptorProto: - if err := validateField(res, isProto3, name, d, handler); err != nil { - return err - } - } - return nil - }) -} - -func validateImports(res *result, handler *reporter.Handler) error { - fileNode := res.file - if fileNode == nil { - return nil - } - imports := make(map[string]ast.SourcePos) - for _, decl := range fileNode.Decls { - imp, ok := decl.(*ast.ImportNode) - if !ok { - continue - } - startPos := fileNode.NodeInfo(decl).Start() - name := imp.Name.AsString() - if prev, ok := imports[name]; ok { - return handler.HandleErrorf(startPos, "%q was already imported at %v", name, prev) - } - imports[name] = startPos - } - return nil -} - -func validateMessage(res *result, isProto3 bool, name protoreflect.FullName, md *descriptorpb.DescriptorProto, handler *reporter.Handler) error { - scope := fmt.Sprintf("message %s", name) - - if isProto3 && len(md.ExtensionRange) > 0 { - n := res.ExtensionRangeNode(md.ExtensionRange[0]) - nInfo := res.file.NodeInfo(n) - if err := handler.HandleErrorf(nInfo.Start(), "%s: extension ranges are not allowed in proto3", scope); err != nil { - return err - } - } - - if index, err := internal.FindOption(res, handler, scope, md.Options.GetUninterpretedOption(), "map_entry"); err != nil { - return err - } else if index >= 0 { - opt := md.Options.UninterpretedOption[index] - optn := res.OptionNode(opt) - md.Options.UninterpretedOption = internal.RemoveOption(md.Options.UninterpretedOption, index) - valid := false - if opt.IdentifierValue != nil { - if opt.GetIdentifierValue() == "true" { - valid = true - optionNodeInfo := res.file.NodeInfo(optn.GetValue()) - if err := handler.HandleErrorf(optionNodeInfo.Start(), "%s: map_entry option should not be set explicitly; use map type instead", scope); err != nil { - return err - } - } else if opt.GetIdentifierValue() == "false" { - valid = true - md.Options.MapEntry = proto.Bool(false) - } - } - if !valid { - optionNodeInfo := res.file.NodeInfo(optn.GetValue()) - if err := handler.HandleErrorf(optionNodeInfo.Start(), "%s: expecting bool value for map_entry option", scope); err != nil { - return err - } - } - } - - // reserved ranges should not overlap - rsvd := make(tagRanges, len(md.ReservedRange)) - for i, r := range md.ReservedRange { - n := res.MessageReservedRangeNode(r) - rsvd[i] = tagRange{start: r.GetStart(), end: r.GetEnd(), node: n} - } - sort.Sort(rsvd) - for i := 1; i < len(rsvd); i++ { - if rsvd[i].start < rsvd[i-1].end { - rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { - return err - } - } - } - - // extensions ranges should not overlap - exts := make(tagRanges, len(md.ExtensionRange)) - for i, r := range md.ExtensionRange { - n := res.ExtensionRangeNode(r) - exts[i] = tagRange{start: r.GetStart(), end: r.GetEnd(), node: n} - } - sort.Sort(exts) - for i := 1; i < len(exts); i++ { - if exts[i].start < exts[i-1].end { - rangeNodeInfo := res.file.NodeInfo(exts[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: extension ranges overlap: %d to %d and %d to %d", scope, exts[i-1].start, exts[i-1].end-1, exts[i].start, exts[i].end-1); err != nil { - return err - } - } - } - - // see if any extension range overlaps any reserved range - var i, j int // i indexes rsvd; j indexes exts - for i < len(rsvd) && j < len(exts) { - if rsvd[i].start >= exts[j].start && rsvd[i].start < exts[j].end || - exts[j].start >= rsvd[i].start && exts[j].start < rsvd[i].end { - var pos ast.SourcePos - if rsvd[i].start >= exts[j].start && rsvd[i].start < exts[j].end { - rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - pos = rangeNodeInfo.Start() - } else { - rangeNodeInfo := res.file.NodeInfo(exts[j].node) - pos = rangeNodeInfo.Start() - } - // ranges overlap - if err := handler.HandleErrorf(pos, "%s: extension range %d to %d overlaps reserved range %d to %d", scope, exts[j].start, exts[j].end-1, rsvd[i].start, rsvd[i].end-1); err != nil { - return err - } - } - if rsvd[i].start < exts[j].start { - i++ - } else { - j++ - } - } - - // now, check that fields don't re-use tags and don't try to use extension - // or reserved ranges or reserved names - rsvdNames := map[string]struct{}{} - for _, n := range md.ReservedName { - // validate reserved name while we're here - if !isIdentifier(n) { - node := findMessageReservedNameNode(res.MessageNode(md), n) - nodeInfo := res.file.NodeInfo(node) - if err := handler.HandleErrorf(nodeInfo.Start(), "%s: reserved name %q is not a valid identifier", scope, n); err != nil { - return err - } - } - rsvdNames[n] = struct{}{} - } - fieldTags := map[int32]string{} - for _, fld := range md.Field { - fn := res.FieldNode(fld) - if _, ok := rsvdNames[fld.GetName()]; ok { - fieldNameNodeInfo := res.file.NodeInfo(fn.FieldName()) - if err := handler.HandleErrorf(fieldNameNodeInfo.Start(), "%s: field %s is using a reserved name", scope, fld.GetName()); err != nil { - return err - } - } - if existing := fieldTags[fld.GetNumber()]; existing != "" { - fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: fields %s and %s both have the same tag %d", scope, existing, fld.GetName(), fld.GetNumber()); err != nil { - return err - } - } - fieldTags[fld.GetNumber()] = fld.GetName() - // check reserved ranges - r := sort.Search(len(rsvd), func(index int) bool { return rsvd[index].end > fld.GetNumber() }) - if r < len(rsvd) && rsvd[r].start <= fld.GetNumber() { - fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: field %s is using tag %d which is in reserved range %d to %d", scope, fld.GetName(), fld.GetNumber(), rsvd[r].start, rsvd[r].end-1); err != nil { - return err - } - } - // and check extension ranges - e := sort.Search(len(exts), func(index int) bool { return exts[index].end > fld.GetNumber() }) - if e < len(exts) && exts[e].start <= fld.GetNumber() { - fieldTagNodeInfo := res.file.NodeInfo(fn.FieldTag()) - if err := handler.HandleErrorf(fieldTagNodeInfo.Start(), "%s: field %s is using tag %d which is in extension range %d to %d", scope, fld.GetName(), fld.GetNumber(), exts[e].start, exts[e].end-1); err != nil { - return err - } - } - } - - return nil -} - -func isIdentifier(s string) bool { - if len(s) == 0 { - return false - } - for i, r := range s { - if i == 0 && r >= '0' && r <= '9' { - // can't start with number - return false - } - // alphanumeric and underscore ok; everything else bad - switch { - case r >= '0' && r <= '9': - case r >= 'a' && r <= 'z': - case r >= 'A' && r <= 'Z': - case r == '_': - default: - return false - } - } - return true -} - -func findMessageReservedNameNode(msgNode ast.MessageDeclNode, name string) ast.Node { - var decls []ast.MessageElement - switch msgNode := msgNode.(type) { - case *ast.MessageNode: - decls = msgNode.Decls - case *ast.GroupNode: - decls = msgNode.Decls - default: - // leave decls empty - } - return findReservedNameNode(msgNode, decls, name) -} - -func findReservedNameNode[T ast.Node](parent ast.Node, decls []T, name string) ast.Node { - for _, decl := range decls { - // NB: We have to convert to empty interface first, before we can do a type - // assertion because type assertions on type parameters aren't allowed. (The - // compiler cannot yet know whether T is an interface type or not.) - rsvd, ok := any(decl).(*ast.ReservedNode) - if !ok { - continue - } - for _, rsvdName := range rsvd.Names { - if rsvdName.AsString() == name { - return rsvdName - } - } - } - // couldn't find it? Instead of puking, report position of the parent. - return parent -} - -func validateEnum(res *result, isProto3 bool, name protoreflect.FullName, ed *descriptorpb.EnumDescriptorProto, handler *reporter.Handler) error { - scope := fmt.Sprintf("enum %s", name) - - if len(ed.Value) == 0 { - enNode := res.EnumNode(ed) - enNodeInfo := res.file.NodeInfo(enNode) - if err := handler.HandleErrorf(enNodeInfo.Start(), "%s: enums must define at least one value", scope); err != nil { - return err - } - } - - allowAlias := false - var allowAliasOpt *descriptorpb.UninterpretedOption - if index, err := internal.FindOption(res, handler, scope, ed.Options.GetUninterpretedOption(), "allow_alias"); err != nil { - return err - } else if index >= 0 { - allowAliasOpt = ed.Options.UninterpretedOption[index] - valid := false - if allowAliasOpt.IdentifierValue != nil { - if allowAliasOpt.GetIdentifierValue() == "true" { - allowAlias = true - valid = true - } else if allowAliasOpt.GetIdentifierValue() == "false" { - valid = true - } - } - if !valid { - optNode := res.OptionNode(allowAliasOpt) - optNodeInfo := res.file.NodeInfo(optNode.GetValue()) - if err := handler.HandleErrorf(optNodeInfo.Start(), "%s: expecting bool value for allow_alias option", scope); err != nil { - return err - } - } - } - - if isProto3 && len(ed.Value) > 0 && ed.Value[0].GetNumber() != 0 { - evNode := res.EnumValueNode(ed.Value[0]) - evNodeInfo := res.file.NodeInfo(evNode.GetNumber()) - if err := handler.HandleErrorf(evNodeInfo.Start(), "%s: proto3 requires that first value in enum have numeric value of 0", scope); err != nil { - return err - } - } - - // check for aliases - vals := map[int32]string{} - hasAlias := false - for _, evd := range ed.Value { - existing := vals[evd.GetNumber()] - if existing != "" { - if allowAlias { - hasAlias = true - } else { - evNode := res.EnumValueNode(evd) - evNodeInfo := res.file.NodeInfo(evNode.GetNumber()) - if err := handler.HandleErrorf(evNodeInfo.Start(), "%s: values %s and %s both have the same numeric value %d; use allow_alias option if intentional", scope, existing, evd.GetName(), evd.GetNumber()); err != nil { - return err - } - } - } - vals[evd.GetNumber()] = evd.GetName() - } - if allowAlias && !hasAlias { - optNode := res.OptionNode(allowAliasOpt) - optNodeInfo := res.file.NodeInfo(optNode.GetValue()) - if err := handler.HandleErrorf(optNodeInfo.Start(), "%s: allow_alias is true but no values are aliases", scope); err != nil { - return err - } - } - - // reserved ranges should not overlap - rsvd := make(tagRanges, len(ed.ReservedRange)) - for i, r := range ed.ReservedRange { - n := res.EnumReservedRangeNode(r) - rsvd[i] = tagRange{start: r.GetStart(), end: r.GetEnd(), node: n} - } - sort.Sort(rsvd) - for i := 1; i < len(rsvd); i++ { - if rsvd[i].start <= rsvd[i-1].end { - rangeNodeInfo := res.file.NodeInfo(rsvd[i].node) - if err := handler.HandleErrorf(rangeNodeInfo.Start(), "%s: reserved ranges overlap: %d to %d and %d to %d", scope, rsvd[i-1].start, rsvd[i-1].end, rsvd[i].start, rsvd[i].end); err != nil { - return err - } - } - } - - // now, check that fields don't re-use tags and don't try to use extension - // or reserved ranges or reserved names - rsvdNames := map[string]struct{}{} - for _, n := range ed.ReservedName { - // validate reserved name while we're here - if !isIdentifier(n) { - node := findEnumReservedNameNode(res.EnumNode(ed), n) - nodeInfo := res.file.NodeInfo(node) - if err := handler.HandleErrorf(nodeInfo.Start(), "%s: reserved name %q is not a valid identifier", scope, n); err != nil { - return err - } - } - rsvdNames[n] = struct{}{} - } - for _, ev := range ed.Value { - evn := res.EnumValueNode(ev) - if _, ok := rsvdNames[ev.GetName()]; ok { - enumValNodeInfo := res.file.NodeInfo(evn.GetName()) - if err := handler.HandleErrorf(enumValNodeInfo.Start(), "%s: value %s is using a reserved name", scope, ev.GetName()); err != nil { - return err - } - } - // check reserved ranges - r := sort.Search(len(rsvd), func(index int) bool { return rsvd[index].end >= ev.GetNumber() }) - if r < len(rsvd) && rsvd[r].start <= ev.GetNumber() { - enumValNodeInfo := res.file.NodeInfo(evn.GetNumber()) - if err := handler.HandleErrorf(enumValNodeInfo.Start(), "%s: value %s is using number %d which is in reserved range %d to %d", scope, ev.GetName(), ev.GetNumber(), rsvd[r].start, rsvd[r].end); err != nil { - return err - } - } - } - - return nil -} - -func findEnumReservedNameNode(enumNode ast.Node, name string) ast.Node { - var decls []ast.EnumElement - if enumNode, ok := enumNode.(*ast.EnumNode); ok { - decls = enumNode.Decls - // if not the right type, we leave decls empty - } - return findReservedNameNode(enumNode, decls, name) -} - -func validateField(res *result, isProto3 bool, name protoreflect.FullName, fld *descriptorpb.FieldDescriptorProto, handler *reporter.Handler) error { - scope := fmt.Sprintf("field %s", name) - - node := res.FieldNode(fld) - if isProto3 { - if fld.GetType() == descriptorpb.FieldDescriptorProto_TYPE_GROUP { - groupNodeInfo := res.file.NodeInfo(node.GetGroupKeyword()) - if err := handler.HandleErrorf(groupNodeInfo.Start(), "%s: groups are not allowed in proto3", scope); err != nil { - return err - } - } else if fld.Label != nil && fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { - fieldLabelNodeInfo := res.file.NodeInfo(node.FieldLabel()) - if err := handler.HandleErrorf(fieldLabelNodeInfo.Start(), "%s: label 'required' is not allowed in proto3", scope); err != nil { - return err - } - } - if index, err := internal.FindOption(res, handler, scope, fld.Options.GetUninterpretedOption(), "default"); err != nil { - return err - } else if index >= 0 { - optNode := res.OptionNode(fld.Options.GetUninterpretedOption()[index]) - optNameNodeInfo := res.file.NodeInfo(optNode.GetName()) - if err := handler.HandleErrorf(optNameNodeInfo.Start(), "%s: default values are not allowed in proto3", scope); err != nil { - return err - } - } - } else { - if fld.Label == nil && fld.OneofIndex == nil { - fieldNameNodeInfo := res.file.NodeInfo(node.FieldName()) - if err := handler.HandleErrorf(fieldNameNodeInfo.Start(), "%s: field has no label; proto2 requires explicit 'optional' label", scope); err != nil { - return err - } - } - if fld.GetExtendee() != "" && fld.Label != nil && fld.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REQUIRED { - fieldLabelNodeInfo := res.file.NodeInfo(node.FieldLabel()) - if err := handler.HandleErrorf(fieldLabelNodeInfo.Start(), "%s: extension fields cannot be 'required'", scope); err != nil { - return err - } - } - } - - return nil -} - -type tagRange struct { - start int32 - end int32 - node ast.RangeDeclNode -} - -type tagRanges []tagRange - -func (r tagRanges) Len() int { - return len(r) -} - -func (r tagRanges) Less(i, j int) bool { - return r[i].start < r[j].start || - (r[i].start == r[j].start && r[i].end < r[j].end) -} - -func (r tagRanges) Swap(i, j int) { - r[i], r[j] = r[j], r[i] -} - -func fillInMissingLabels(fd *descriptorpb.FileDescriptorProto) { - for _, md := range fd.MessageType { - fillInMissingLabelsInMsg(md) - } - for _, extd := range fd.Extension { - fillInMissingLabel(extd) - } -} - -func fillInMissingLabelsInMsg(md *descriptorpb.DescriptorProto) { - for _, fld := range md.Field { - fillInMissingLabel(fld) - } - for _, nmd := range md.NestedType { - fillInMissingLabelsInMsg(nmd) - } - for _, extd := range md.Extension { - fillInMissingLabel(extd) - } -} - -func fillInMissingLabel(fld *descriptorpb.FieldDescriptorProto) { - if fld.Label == nil { - fld.Label = descriptorpb.FieldDescriptorProto_LABEL_OPTIONAL.Enum() - } -} diff --git a/vendor/github.com/bufbuild/protocompile/protoutil/protos.go b/vendor/github.com/bufbuild/protocompile/protoutil/protos.go deleted file mode 100644 index ad8044260d..0000000000 --- a/vendor/github.com/bufbuild/protocompile/protoutil/protos.go +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package protoutil contains useful functions for interacting with descriptors. -// For now these include only functions for efficiently converting descriptors -// produced by the compiler to descriptor protos. -// -// Despite the fact that descriptor protos are mutable, calling code should NOT -// mutate any of the protos returned from this package. For efficiency, some -// protos returned from this package may be part of internal state of a compiler -// result, and mutating the proto could corrupt or invalidate parts of that -// result. -package protoutil - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protodesc" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" -) - -// DescriptorProtoWrapper is a protoreflect.Descriptor that wraps an -// underlying descriptor proto. It provides the same interface as -// Descriptor but with one extra operation, to efficiently query for -// the underlying descriptor proto. -// -// Descriptors that implement this will also implement another method -// whose specified return type is the concrete type returned by the -// AsProto method. The name of this method varies by the type of this -// descriptor: -// -// Descriptor Type Other Method Name -// ---------------------+------------------------------------ -// FileDescriptor | FileDescriptorProto() -// MessageDescriptor | MessageDescriptorProto() -// FieldDescriptor | FieldDescriptorProto() -// OneofDescriptor | OneOfDescriptorProto() -// EnumDescriptor | EnumDescriptorProto() -// EnumValueDescriptor | EnumValueDescriptorProto() -// ServiceDescriptor | ServiceDescriptorProto() -// MethodDescriptor | MethodDescriptorProto() -// -// For example, a DescriptorProtoWrapper that implements FileDescriptor -// returns a *descriptorpb.FileDescriptorProto value from its AsProto -// method and also provides a method with the following signature: -// -// FileDescriptorProto() *descriptorpb.FileDescriptorProto -type DescriptorProtoWrapper interface { - protoreflect.Descriptor - // AsProto returns the underlying descriptor proto. The concrete - // type of the proto message depends on the type of this - // descriptor: - // Descriptor Type Proto Message Type - // ---------------------+------------------------------------ - // FileDescriptor | *descriptorpb.FileDescriptorProto - // MessageDescriptor | *descriptorpb.DescriptorProto - // FieldDescriptor | *descriptorpb.FieldDescriptorProto - // OneofDescriptor | *descriptorpb.OneofDescriptorProto - // EnumDescriptor | *descriptorpb.EnumDescriptorProto - // EnumValueDescriptor | *descriptorpb.EnumValueDescriptorProto - // ServiceDescriptor | *descriptorpb.ServiceDescriptorProto - // MethodDescriptor | *descriptorpb.MethodDescriptorProto - AsProto() proto.Message -} - -// ProtoFromDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromDescriptor(d protoreflect.Descriptor) proto.Message { - switch d := d.(type) { - case protoreflect.FileDescriptor: - return ProtoFromFileDescriptor(d) - case protoreflect.MessageDescriptor: - return ProtoFromMessageDescriptor(d) - case protoreflect.FieldDescriptor: - return ProtoFromFieldDescriptor(d) - case protoreflect.OneofDescriptor: - return ProtoFromOneofDescriptor(d) - case protoreflect.EnumDescriptor: - return ProtoFromEnumDescriptor(d) - case protoreflect.EnumValueDescriptor: - return ProtoFromEnumValueDescriptor(d) - case protoreflect.ServiceDescriptor: - return ProtoFromServiceDescriptor(d) - case protoreflect.MethodDescriptor: - return ProtoFromMethodDescriptor(d) - default: - // WTF?? - if res, ok := d.(DescriptorProtoWrapper); ok { - return res.AsProto() - } - return nil - } -} - -// ProtoFromFileDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For file descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. File descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromFileDescriptor(d protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { - if imp, ok := d.(protoreflect.FileImport); ok { - d = imp.FileDescriptor - } - type canProto interface { - FileDescriptorProto() *descriptorpb.FileDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.FileDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if fd, ok := res.AsProto().(*descriptorpb.FileDescriptorProto); ok { - return fd - } - } - return protodesc.ToFileDescriptorProto(d) -} - -// ProtoFromMessageDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For message descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Message descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromMessageDescriptor(d protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { - type canProto interface { - MessageDescriptorProto() *descriptorpb.DescriptorProto - } - if res, ok := d.(canProto); ok { - return res.MessageDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if md, ok := res.AsProto().(*descriptorpb.DescriptorProto); ok { - return md - } - } - return protodesc.ToDescriptorProto(d) -} - -// ProtoFromFieldDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For field descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Field descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromFieldDescriptor(d protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { - type canProto interface { - FieldDescriptorProto() *descriptorpb.FieldDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.FieldDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if fd, ok := res.AsProto().(*descriptorpb.FieldDescriptorProto); ok { - return fd - } - } - return protodesc.ToFieldDescriptorProto(d) -} - -// ProtoFromOneofDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For oneof descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Oneof descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromOneofDescriptor(d protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { - type canProto interface { - OneofDescriptorProto() *descriptorpb.OneofDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.OneofDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if ood, ok := res.AsProto().(*descriptorpb.OneofDescriptorProto); ok { - return ood - } - } - return protodesc.ToOneofDescriptorProto(d) -} - -// ProtoFromEnumDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For enum descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Enum descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromEnumDescriptor(d protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { - type canProto interface { - EnumDescriptorProto() *descriptorpb.EnumDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.EnumDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if ed, ok := res.AsProto().(*descriptorpb.EnumDescriptorProto); ok { - return ed - } - } - return protodesc.ToEnumDescriptorProto(d) -} - -// ProtoFromEnumValueDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For enum value descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Enum value descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromEnumValueDescriptor(d protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { - type canProto interface { - EnumValueDescriptorProto() *descriptorpb.EnumValueDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.EnumValueDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if ed, ok := res.AsProto().(*descriptorpb.EnumValueDescriptorProto); ok { - return ed - } - } - return protodesc.ToEnumValueDescriptorProto(d) -} - -// ProtoFromServiceDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For service descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Service descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromServiceDescriptor(d protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { - type canProto interface { - ServiceDescriptorProto() *descriptorpb.ServiceDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.ServiceDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if sd, ok := res.AsProto().(*descriptorpb.ServiceDescriptorProto); ok { - return sd - } - } - return protodesc.ToServiceDescriptorProto(d) -} - -// ProtoFromMethodDescriptor extracts a descriptor proto from the given "rich" -// descriptor. For method descriptors generated by the compiler, this is an -// inexpensive and non-lossy operation. Method descriptors from other sources -// however may be expensive (to re-create a proto) and even lossy. -func ProtoFromMethodDescriptor(d protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { - type canProto interface { - MethodDescriptorProto() *descriptorpb.MethodDescriptorProto - } - if res, ok := d.(canProto); ok { - return res.MethodDescriptorProto() - } - if res, ok := d.(DescriptorProtoWrapper); ok { - if md, ok := res.AsProto().(*descriptorpb.MethodDescriptorProto); ok { - return md - } - } - return protodesc.ToMethodDescriptorProto(d) -} diff --git a/vendor/github.com/bufbuild/protocompile/reporter/errors.go b/vendor/github.com/bufbuild/protocompile/reporter/errors.go deleted file mode 100644 index 2932c79fb2..0000000000 --- a/vendor/github.com/bufbuild/protocompile/reporter/errors.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package reporter - -import ( - "errors" - "fmt" - - "github.com/bufbuild/protocompile/ast" -) - -// ErrInvalidSource is a sentinel error that is returned by compilation and -// stand-alone compilation steps (such as parsing, linking) when one or more -// errors is reported but the configured ErrorReporter always returns nil. -var ErrInvalidSource = errors.New("parse failed: invalid proto source") - -// ErrorWithPos is an error about a proto source file that adds information -// about the location in the file that caused the error. -type ErrorWithPos interface { - error - // GetPosition returns the source position that caused the underlying error. - GetPosition() ast.SourcePos - // Unwrap returns the underlying error. - Unwrap() error -} - -// Error creates a new ErrorWithPos from the given error and source position. -func Error(pos ast.SourcePos, err error) ErrorWithPos { - return errorWithSourcePos{pos: pos, underlying: err} -} - -// Errorf creates a new ErrorWithPos whose underlying error is created using the -// given message format and arguments (via fmt.Errorf). -func Errorf(pos ast.SourcePos, format string, args ...interface{}) ErrorWithPos { - return errorWithSourcePos{pos: pos, underlying: fmt.Errorf(format, args...)} -} - -type errorWithSourcePos struct { - underlying error - pos ast.SourcePos -} - -func (e errorWithSourcePos) Error() string { - sourcePos := e.GetPosition() - return fmt.Sprintf("%s: %v", sourcePos, e.underlying) -} - -func (e errorWithSourcePos) GetPosition() ast.SourcePos { - return e.pos -} - -func (e errorWithSourcePos) Unwrap() error { - return e.underlying -} - -var _ ErrorWithPos = errorWithSourcePos{} diff --git a/vendor/github.com/bufbuild/protocompile/reporter/reporter.go b/vendor/github.com/bufbuild/protocompile/reporter/reporter.go deleted file mode 100644 index d3a3168698..0000000000 --- a/vendor/github.com/bufbuild/protocompile/reporter/reporter.go +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package reporter contains the types used for reporting errors from -// protocompile operations. It contains error types as well as interfaces -// for reporting and handling errors and warnings. -package reporter - -import ( - "sync" - - "github.com/bufbuild/protocompile/ast" -) - -// ErrorReporter is responsible for reporting the given error. If the reporter -// returns a non-nil error, parsing/linking will abort with that error. If the -// reporter returns nil, parsing will continue, allowing the parser to try to -// report as many syntax and/or link errors as it can find. -type ErrorReporter func(err ErrorWithPos) error - -// WarningReporter is responsible for reporting the given warning. This is used -// for indicating non-error messages to the calling program for things that do -// not cause the parse to fail but are considered bad practice. Though they are -// just warnings, the details are supplied to the reporter via an error type. -type WarningReporter func(ErrorWithPos) - -// Reporter is a type that handles reporting both errors and warnings. -// A reporter does not need to be thread-safe. Safe concurrent access is -// managed by a Handler. -type Reporter interface { - // Error is called when the given error is encountered and needs to be - // reported to the calling program. This signature matches ErrorReporter - // because it has the same semantics. If this function returns non-nil - // then the operation will abort immediately with the given error. But - // if it returns nil, the operation will continue, reporting more errors - // as they are encountered. If the reporter never returns non-nil then - // the operation will eventually fail with ErrInvalidSource. - Error(ErrorWithPos) error - // Warning is called when the given warnings is encountered and needs to be - // reported to the calling program. Despite the argument being an error - // type, a warning will never cause the operation to abort or fail (unless - // the reporter's implementation of this method panics). - Warning(ErrorWithPos) -} - -// NewReporter creates a new reporter that invokes the given functions on error -// or warning. -func NewReporter(errs ErrorReporter, warnings WarningReporter) Reporter { - return reporterFuncs{errs: errs, warnings: warnings} -} - -type reporterFuncs struct { - errs ErrorReporter - warnings WarningReporter -} - -func (r reporterFuncs) Error(err ErrorWithPos) error { - if r.errs == nil { - return err - } - return r.errs(err) -} - -func (r reporterFuncs) Warning(err ErrorWithPos) { - if r.warnings != nil { - r.warnings(err) - } -} - -// Handler is used by protocompile operations for handling errors and warnings. -// This type is thread-safe. It uses a mutex to serialize calls to its reporter -// so that reporter instances do not have to be thread-safe (unless re-used -// across multiple handlers). -type Handler struct { - parent *Handler - mu sync.Mutex - reporter Reporter - errsReported bool - err error -} - -// NewHandler creates a new Handler that reports errors and warnings using the -// given reporter. -func NewHandler(rep Reporter) *Handler { - if rep == nil { - rep = NewReporter(nil, nil) - } - return &Handler{reporter: rep} -} - -// SubHandler returns a "child" of h. Use of a child handler is the same as use -// of the parent, except that the Error() and ReporterError() functions only -// report non-nil for errors that were reported using the child handler. So -// errors reported directly to the parent or to a different child handler won't -// be returned. This is useful for making concurrent access to the handler more -// deterministic: if a child handler is only used from one goroutine, its view -// of reported errors is consistent and unimpacted by concurrent operations. -func (h *Handler) SubHandler() *Handler { - return &Handler{parent: h} -} - -// HandleError handles the given error. If the given err is an ErrorWithPos, it -// is reported, and this function returns the error returned by the reporter. If -// the given err is NOT an ErrorWithPos, the current operation will abort -// immediately. -// -// If the handler has already aborted (by returning a non-nil error from a prior -// call to HandleError or HandleErrorf), that same error is returned and the -// given error is not reported. -func (h *Handler) HandleError(err error) error { - if h.parent != nil { - _, isErrWithPos := err.(ErrorWithPos) - err = h.parent.HandleError(err) - - // update child state - h.mu.Lock() - defer h.mu.Unlock() - if isErrWithPos { - h.errsReported = true - } - h.err = err - return err - } - - h.mu.Lock() - defer h.mu.Unlock() - - if h.err != nil { - return h.err - } - if ewp, ok := err.(ErrorWithPos); ok { - h.errsReported = true - err = h.reporter.Error(ewp) - } - h.err = err - return err -} - -// HandleErrorWithPos handles an error with the given source position. -// -// If the handler has already aborted (by returning a non-nil error from a prior -// call to HandleError or HandleErrorf), that same error is returned and the -// given error is not reported. -func (h *Handler) HandleErrorWithPos(pos ast.SourcePos, err error) error { - if ewp, ok := err.(ErrorWithPos); ok { - // replace existing position with given one - err = errorWithSourcePos{pos: pos, underlying: ewp.Unwrap()} - } else { - err = errorWithSourcePos{pos: pos, underlying: err} - } - return h.HandleError(err) -} - -// HandleErrorf handles an error with the given source position, creating the -// error using the given message format and arguments. -// -// If the handler has already aborted (by returning a non-nil error from a call -// to HandleError or HandleErrorf), that same error is returned and the given -// error is not reported. -func (h *Handler) HandleErrorf(pos ast.SourcePos, format string, args ...interface{}) error { - return h.HandleError(Errorf(pos, format, args...)) -} - -// HandleWarning handles the given warning. This will delegate to the handler's -// configured reporter. -func (h *Handler) HandleWarning(err ErrorWithPos) { - if h.parent != nil { - h.parent.HandleWarning(err) - return - } - - // even though we aren't touching mutable fields, we acquire lock anyway so - // that underlying reporter does not have to be thread-safe - h.mu.Lock() - defer h.mu.Unlock() - - h.reporter.Warning(err) -} - -// HandleWarningWithPos handles a warning with the given source position. This will -// delegate to the handler's configured reporter. -func (h *Handler) HandleWarningWithPos(pos ast.SourcePos, err error) { - ewp, ok := err.(ErrorWithPos) - if ok { - // replace existing position with given one - ewp = errorWithSourcePos{pos: pos, underlying: ewp.Unwrap()} - } else { - ewp = errorWithSourcePos{pos: pos, underlying: err} - } - h.HandleWarning(ewp) -} - -// HandleWarningf handles a warning with the given source position, creating the -// actual error value using the given message format and arguments. -func (h *Handler) HandleWarningf(pos ast.SourcePos, format string, args ...interface{}) { - h.HandleWarning(Errorf(pos, format, args...)) -} - -// Error returns the handler result. If any errors have been reported then this -// returns a non-nil error. If the reporter never returned a non-nil error then -// ErrInvalidSource is returned. Otherwise, this returns the error returned by -// the handler's reporter (the same value returned by ReporterError). -func (h *Handler) Error() error { - h.mu.Lock() - defer h.mu.Unlock() - - if h.errsReported && h.err == nil { - return ErrInvalidSource - } - return h.err -} - -// ReporterError returns the error returned by the handler's reporter. If -// the reporter has either not been invoked (no errors handled) or has not -// returned any non-nil value, then this returns nil. -func (h *Handler) ReporterError() error { - h.mu.Lock() - defer h.mu.Unlock() - - return h.err -} diff --git a/vendor/github.com/bufbuild/protocompile/resolver.go b/vendor/github.com/bufbuild/protocompile/resolver.go deleted file mode 100644 index 6838ef0fd1..0000000000 --- a/vendor/github.com/bufbuild/protocompile/resolver.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protocompile - -import ( - "errors" - "io" - "io/fs" - "os" - "path/filepath" - "strings" - - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/parser" -) - -// Resolver is used by the compiler to resolve a proto source file name -// into some unit that is usable by the compiler. The result could be source -// for a proto file or it could be an already-parsed AST or descriptor. -// -// Resolver implementations must be thread-safe as a single compilation -// operation could invoke FindFileByPath from multiple goroutines. -type Resolver interface { - // FindFileByPath searches for information for the given file path. If no - // result is available, it should return a non-nil error, such as - // protoregistry.NotFound. - FindFileByPath(path string) (SearchResult, error) -} - -// SearchResult represents information about a proto source file. Only one of -// the various fields must be set, based on what is available for a file. If -// multiple fields are set, the compiler prefers them in opposite order listed: -// so it uses a descriptor if present and only falls back to source if nothing -// else is available. -type SearchResult struct { - // Represents source code for the file. This should be nil if source code - // is not available. If no field below is set, then the compiler will parse - // the source code into an AST. - Source io.Reader - // Represents the abstract syntax tree for the file. If no field below is - // set, then the compiler will convert the AST into a descriptor proto. - AST *ast.FileNode - // A descriptor proto that represents the file. If the field below is not - // set, then the compiler will link this proto with its dependencies to - // produce a linked descriptor. - Proto *descriptorpb.FileDescriptorProto - // A parse result for the file. This packages both an AST and a descriptor - // proto in one. When a parser result is available, it is more efficient - // than using an AST search result, since the descriptor proto need not be - // re-created. And it provides better error messages than a descriptor proto - // search result, since the AST has greater fidelity with regard to source - // positions (even if the descriptor proto includes source code info). - ParseResult parser.Result - // A fully linked descriptor that represents the file. If this field is set, - // then the compiler has little or no additional work to do for this file as - // it is already compiled. If this value implements linker.File, there is no - // additional work. Otherwise, the additional work is to compute an index of - // symbols in the file, for efficient lookup. - Desc protoreflect.FileDescriptor -} - -// ResolverFunc is a simple function type that implements Resolver. -type ResolverFunc func(string) (SearchResult, error) - -var _ Resolver = ResolverFunc(nil) - -func (f ResolverFunc) FindFileByPath(path string) (SearchResult, error) { - return f(path) -} - -// CompositeResolver is a slice of resolvers, which are consulted in order -// until one can supply a result. If none of the constituent resolvers can -// supply a result, the error returned by the first resolver is returned. If -// the slice of resolvers is empty, all operations return -// protoregistry.NotFound. -type CompositeResolver []Resolver - -var _ Resolver = CompositeResolver(nil) - -func (f CompositeResolver) FindFileByPath(path string) (SearchResult, error) { - if len(f) == 0 { - return SearchResult{}, protoregistry.NotFound - } - var firstErr error - for _, res := range f { - r, err := res.FindFileByPath(path) - if err == nil { - return r, nil - } - if firstErr == nil { - firstErr = err - } - } - return SearchResult{}, firstErr -} - -// SourceResolver can resolve file names by returning source code. It uses -// an optional list of import paths to search. By default, it searches the -// file system. -type SourceResolver struct { - // Optional list of import paths. If present and not empty, then all - // file paths to find are assumed to be relative to one of these paths. - // If nil or empty, all file paths to find are assumed to be relative to - // the current working directory. - ImportPaths []string - // Optional function for returning a file's contents. If nil, then - // os.Open is used to open files on the file system. - // - // This function must be thread-safe as a single compilation operation - // could result in concurrent invocations of this function from - // multiple goroutines. - Accessor func(path string) (io.ReadCloser, error) -} - -var _ Resolver = (*SourceResolver)(nil) - -func (r *SourceResolver) FindFileByPath(path string) (SearchResult, error) { - if len(r.ImportPaths) == 0 { - reader, err := r.accessFile(path) - if err != nil { - return SearchResult{}, err - } - return SearchResult{Source: reader}, nil - } - - var e error - for _, importPath := range r.ImportPaths { - reader, err := r.accessFile(filepath.Join(importPath, path)) - if err != nil { - if errors.Is(err, fs.ErrNotExist) { - e = err - continue - } - return SearchResult{}, err - } - return SearchResult{Source: reader}, nil - } - return SearchResult{}, e -} - -func (r *SourceResolver) accessFile(path string) (io.ReadCloser, error) { - if r.Accessor != nil { - return r.Accessor(path) - } - return os.Open(path) -} - -// SourceAccessorFromMap returns a function that can be used as the Accessor -// field of a SourceResolver that uses the given map to load source. The map -// keys are file names and the values are the corresponding file contents. -// -// The given map is used directly and not copied. Since accessor functions -// must be thread-safe, this means that the provided map must not be mutated -// once this accessor is provided to a compile operation. -func SourceAccessorFromMap(srcs map[string]string) func(string) (io.ReadCloser, error) { - return func(path string) (io.ReadCloser, error) { - src, ok := srcs[path] - if !ok { - return nil, os.ErrNotExist - } - return io.NopCloser(strings.NewReader(src)), nil - } -} - -// WithStandardImports returns a new resolver that knows about the same standard -// imports that are included with protoc. -func WithStandardImports(r Resolver) Resolver { - return ResolverFunc(func(name string) (SearchResult, error) { - res, err := r.FindFileByPath(name) - if err != nil { - // error from given resolver? see if it's a known standard file - if d, ok := standardImports[name]; ok { - return SearchResult{Desc: d}, nil - } - } - return res, err - }) -} diff --git a/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go b/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go deleted file mode 100644 index 6f32f28d7d..0000000000 --- a/vendor/github.com/bufbuild/protocompile/sourceinfo/source_code_info.go +++ /dev/null @@ -1,814 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package sourceinfo contains the logic for computing source code info for a -// file descriptor. -// -// The inputs to the computation are an AST for a file as well as the index of -// interpreted options for that file. -package sourceinfo - -import ( - "bytes" - "fmt" - "strings" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/ast" - "github.com/bufbuild/protocompile/internal" - "github.com/bufbuild/protocompile/options" -) - -// GenerateSourceInfo generates source code info for the given AST. If the given -// opts is present, it can generate source code info for interpreted options. -// Otherwise, any options in the AST will get source code info as uninterpreted -// options. -// -// This includes comments only for locations that represent complete declarations. -// This is the same behavior as protoc, the reference compiler for Protocol Buffers. -func GenerateSourceInfo(file *ast.FileNode, opts options.Index) *descriptorpb.SourceCodeInfo { - return generateSourceInfo(file, opts, false) -} - -// GenerateSourceInfoWithExtraComments generates source code info for the given -// AST. If the given opts is present, it can generate source code info for -// interpreted options. Otherwise, any options in the AST will get source code -// info as uninterpreted options. -// -// This includes comments for all locations. This is still lossy, but less so as -// it preserves far more comments from the source file. -func GenerateSourceInfoWithExtraComments(file *ast.FileNode, opts options.Index) *descriptorpb.SourceCodeInfo { - return generateSourceInfo(file, opts, true) -} - -func generateSourceInfo(file *ast.FileNode, opts options.Index, extraComments bool) *descriptorpb.SourceCodeInfo { - if file == nil { - return nil - } - - sci := sourceCodeInfo{file: file, commentsUsed: map[ast.SourcePos]struct{}{}, extraComments: extraComments} - path := make([]int32, 0, 10) - - sci.newLocWithoutComments(file, nil) - - if file.Syntax != nil { - sci.newLocWithComments(file.Syntax, append(path, internal.FileSyntaxTag)) - } - - var depIndex, pubDepIndex, weakDepIndex, optIndex, msgIndex, enumIndex, extendIndex, svcIndex int32 - - for _, child := range file.Decls { - switch child := child.(type) { - case *ast.ImportNode: - sci.newLocWithComments(child, append(path, internal.FileDependencyTag, depIndex)) - depIndex++ - if child.Public != nil { - sci.newLoc(child.Public, append(path, internal.FilePublicDependencyTag, pubDepIndex)) - pubDepIndex++ - } else if child.Weak != nil { - sci.newLoc(child.Weak, append(path, internal.FileWeakDependencyTag, weakDepIndex)) - weakDepIndex++ - } - case *ast.PackageNode: - sci.newLocWithComments(child, append(path, internal.FilePackageTag)) - case *ast.OptionNode: - generateSourceCodeInfoForOption(opts, &sci, child, false, &optIndex, append(path, internal.FileOptionsTag)) - case *ast.MessageNode: - generateSourceCodeInfoForMessage(opts, &sci, child, nil, append(path, internal.FileMessagesTag, msgIndex)) - msgIndex++ - case *ast.EnumNode: - generateSourceCodeInfoForEnum(opts, &sci, child, append(path, internal.FileEnumsTag, enumIndex)) - enumIndex++ - case *ast.ExtendNode: - generateSourceCodeInfoForExtensions(opts, &sci, child, &extendIndex, &msgIndex, append(path, internal.FileExtensionsTag), append(dup(path), internal.FileMessagesTag)) - case *ast.ServiceNode: - generateSourceCodeInfoForService(opts, &sci, child, append(path, internal.FileServicesTag, svcIndex)) - svcIndex++ - } - } - - return &descriptorpb.SourceCodeInfo{Location: sci.locs} -} - -func generateSourceCodeInfoForOption(opts options.Index, sci *sourceCodeInfo, n *ast.OptionNode, compact bool, uninterpIndex *int32, path []int32) { - if !compact { - sci.newLocWithoutComments(n, path) - } - subPath := opts[n] - if len(subPath) > 0 { - p := make([]int32, len(path), len(path)+len(subPath)) - copy(p, path) - if subPath[0] == -1 { - // used by "default" and "json_name" field pseudo-options - // to attribute path to parent element (since those are - // stored directly on the descriptor, not its options) - subPath = subPath[1:] - p = p[:len(path)-1] - } - p = append(p, subPath...) - if compact { - sci.newLoc(n, p) - } else { - sci.newLocWithComments(n, p) - } - return - } - - // it's an uninterpreted option - optPath := path - optPath = append(optPath, internal.UninterpretedOptionsTag, *uninterpIndex) - *uninterpIndex++ - sci.newLoc(n, optPath) - var valTag int32 - switch n.Val.(type) { - case ast.IdentValueNode: - valTag = internal.UninterpretedIdentTag - case *ast.NegativeIntLiteralNode: - valTag = internal.UninterpretedNegIntTag - case ast.IntValueNode: - valTag = internal.UninterpretedPosIntTag - case ast.FloatValueNode: - valTag = internal.UninterpretedDoubleTag - case ast.StringValueNode: - valTag = internal.UninterpretedStringTag - case *ast.MessageLiteralNode: - valTag = internal.UninterpretedAggregateTag - } - if valTag != 0 { - sci.newLoc(n.Val, append(optPath, valTag)) - } - for j, nn := range n.Name.Parts { - optNmPath := optPath - optNmPath = append(optNmPath, internal.UninterpretedNameTag, int32(j)) - sci.newLoc(nn, optNmPath) - sci.newLoc(nn.Name, append(optNmPath, internal.UninterpretedNameNameTag)) - } -} - -func generateSourceCodeInfoForMessage(opts options.Index, sci *sourceCodeInfo, n ast.MessageDeclNode, fieldPath []int32, path []int32) { - var openBrace ast.Node - - var decls []ast.MessageElement - switch n := n.(type) { - case *ast.MessageNode: - openBrace = n.OpenBrace - decls = n.Decls - case *ast.GroupNode: - openBrace = n.OpenBrace - decls = n.Decls - case *ast.MapFieldNode: - sci.newLoc(n, path) - // map entry so nothing else to do - return - } - sci.newBlockLocWithComments(n, openBrace, path) - - sci.newLoc(n.MessageName(), append(path, internal.MessageNameTag)) - // matching protoc, which emits the corresponding field type name (for group fields) - // right after the source location for the group message name - if fieldPath != nil { - sci.newLoc(n.MessageName(), append(fieldPath, internal.FieldTypeNameTag)) - } - - var optIndex, fieldIndex, oneOfIndex, extendIndex, nestedMsgIndex int32 - var nestedEnumIndex, extRangeIndex, reservedRangeIndex, reservedNameIndex int32 - for _, child := range decls { - switch child := child.(type) { - case *ast.OptionNode: - generateSourceCodeInfoForOption(opts, sci, child, false, &optIndex, append(path, internal.MessageOptionsTag)) - case *ast.FieldNode: - generateSourceCodeInfoForField(opts, sci, child, append(path, internal.MessageFieldsTag, fieldIndex)) - fieldIndex++ - case *ast.GroupNode: - fldPath := path - fldPath = append(fldPath, internal.MessageFieldsTag, fieldIndex) - generateSourceCodeInfoForField(opts, sci, child, fldPath) - fieldIndex++ - generateSourceCodeInfoForMessage(opts, sci, child, fldPath, append(dup(path), internal.MessageNestedMessagesTag, nestedMsgIndex)) - nestedMsgIndex++ - case *ast.MapFieldNode: - generateSourceCodeInfoForField(opts, sci, child, append(path, internal.MessageFieldsTag, fieldIndex)) - fieldIndex++ - nestedMsgIndex++ - case *ast.OneOfNode: - generateSourceCodeInfoForOneOf(opts, sci, child, &fieldIndex, &nestedMsgIndex, append(path, internal.MessageFieldsTag), append(dup(path), internal.MessageNestedMessagesTag), append(dup(path), internal.MessageOneOfsTag, oneOfIndex)) - oneOfIndex++ - case *ast.MessageNode: - generateSourceCodeInfoForMessage(opts, sci, child, nil, append(path, internal.MessageNestedMessagesTag, nestedMsgIndex)) - nestedMsgIndex++ - case *ast.EnumNode: - generateSourceCodeInfoForEnum(opts, sci, child, append(path, internal.MessageEnumsTag, nestedEnumIndex)) - nestedEnumIndex++ - case *ast.ExtendNode: - generateSourceCodeInfoForExtensions(opts, sci, child, &extendIndex, &nestedMsgIndex, append(path, internal.MessageExtensionsTag), append(dup(path), internal.MessageNestedMessagesTag)) - case *ast.ExtensionRangeNode: - generateSourceCodeInfoForExtensionRanges(opts, sci, child, &extRangeIndex, append(path, internal.MessageExtensionRangesTag)) - case *ast.ReservedNode: - if len(child.Names) > 0 { - resPath := path - resPath = append(resPath, internal.MessageReservedNamesTag) - sci.newLocWithComments(child, resPath) - for _, rn := range child.Names { - sci.newLoc(rn, append(resPath, reservedNameIndex)) - reservedNameIndex++ - } - } - if len(child.Ranges) > 0 { - resPath := path - resPath = append(resPath, internal.MessageReservedRangesTag) - sci.newLocWithComments(child, resPath) - for _, rr := range child.Ranges { - generateSourceCodeInfoForReservedRange(sci, rr, append(resPath, reservedRangeIndex)) - reservedRangeIndex++ - } - } - } - } -} - -func generateSourceCodeInfoForEnum(opts options.Index, sci *sourceCodeInfo, n *ast.EnumNode, path []int32) { - sci.newBlockLocWithComments(n, n.OpenBrace, path) - sci.newLoc(n.Name, append(path, internal.EnumNameTag)) - - var optIndex, valIndex, reservedNameIndex, reservedRangeIndex int32 - for _, child := range n.Decls { - switch child := child.(type) { - case *ast.OptionNode: - generateSourceCodeInfoForOption(opts, sci, child, false, &optIndex, append(path, internal.EnumOptionsTag)) - case *ast.EnumValueNode: - generateSourceCodeInfoForEnumValue(opts, sci, child, append(path, internal.EnumValuesTag, valIndex)) - valIndex++ - case *ast.ReservedNode: - if len(child.Names) > 0 { - resPath := path - resPath = append(resPath, internal.EnumReservedNamesTag) - sci.newLocWithComments(child, resPath) - for _, rn := range child.Names { - sci.newLoc(rn, append(resPath, reservedNameIndex)) - reservedNameIndex++ - } - } - if len(child.Ranges) > 0 { - resPath := path - resPath = append(resPath, internal.EnumReservedRangesTag) - sci.newLocWithComments(child, resPath) - for _, rr := range child.Ranges { - generateSourceCodeInfoForReservedRange(sci, rr, append(resPath, reservedRangeIndex)) - reservedRangeIndex++ - } - } - } - } -} - -func generateSourceCodeInfoForEnumValue(opts options.Index, sci *sourceCodeInfo, n *ast.EnumValueNode, path []int32) { - sci.newLocWithComments(n, path) - sci.newLoc(n.Name, append(path, internal.EnumValNameTag)) - sci.newLoc(n.Number, append(path, internal.EnumValNumberTag)) - - // enum value options - if n.Options != nil { - optsPath := path - optsPath = append(optsPath, internal.EnumValOptionsTag) - sci.newLoc(n.Options, optsPath) - var optIndex int32 - for _, opt := range n.Options.GetElements() { - generateSourceCodeInfoForOption(opts, sci, opt, true, &optIndex, optsPath) - } - } -} - -func generateSourceCodeInfoForReservedRange(sci *sourceCodeInfo, n *ast.RangeNode, path []int32) { - sci.newLoc(n, path) - sci.newLoc(n.StartVal, append(path, internal.ReservedRangeStartTag)) - switch { - case n.EndVal != nil: - sci.newLoc(n.EndVal, append(path, internal.ReservedRangeEndTag)) - case n.Max != nil: - sci.newLoc(n.Max, append(path, internal.ReservedRangeEndTag)) - default: - sci.newLoc(n.StartVal, append(path, internal.ReservedRangeEndTag)) - } -} - -func generateSourceCodeInfoForExtensions(opts options.Index, sci *sourceCodeInfo, n *ast.ExtendNode, extendIndex, msgIndex *int32, extendPath, msgPath []int32) { - sci.newBlockLocWithComments(n, n.OpenBrace, extendPath) - for _, decl := range n.Decls { - switch decl := decl.(type) { - case *ast.FieldNode: - generateSourceCodeInfoForField(opts, sci, decl, append(extendPath, *extendIndex)) - *extendIndex++ - case *ast.GroupNode: - fldPath := extendPath - fldPath = append(fldPath, *extendIndex) - generateSourceCodeInfoForField(opts, sci, decl, fldPath) - *extendIndex++ - generateSourceCodeInfoForMessage(opts, sci, decl, fldPath, append(msgPath, *msgIndex)) - *msgIndex++ - } - } -} - -func generateSourceCodeInfoForOneOf(opts options.Index, sci *sourceCodeInfo, n *ast.OneOfNode, fieldIndex, nestedMsgIndex *int32, fieldPath, nestedMsgPath, oneOfPath []int32) { - sci.newBlockLocWithComments(n, n.OpenBrace, oneOfPath) - sci.newLoc(n.Name, append(oneOfPath, internal.OneOfNameTag)) - - var optIndex int32 - for _, child := range n.Decls { - switch child := child.(type) { - case *ast.OptionNode: - generateSourceCodeInfoForOption(opts, sci, child, false, &optIndex, append(oneOfPath, internal.OneOfOptionsTag)) - case *ast.FieldNode: - generateSourceCodeInfoForField(opts, sci, child, append(fieldPath, *fieldIndex)) - *fieldIndex++ - case *ast.GroupNode: - fldPath := fieldPath - fldPath = append(fldPath, *fieldIndex) - generateSourceCodeInfoForField(opts, sci, child, fldPath) - *fieldIndex++ - generateSourceCodeInfoForMessage(opts, sci, child, fldPath, append(nestedMsgPath, *nestedMsgIndex)) - *nestedMsgIndex++ - } - } -} - -func generateSourceCodeInfoForField(opts options.Index, sci *sourceCodeInfo, n ast.FieldDeclNode, path []int32) { - var fieldType string - if f, ok := n.(*ast.FieldNode); ok { - fieldType = string(f.FldType.AsIdentifier()) - } - - if n.GetGroupKeyword() != nil { - // comments will appear on group message - sci.newLocWithoutComments(n, path) - if n.FieldExtendee() != nil { - sci.newLoc(n.FieldExtendee(), append(path, internal.FieldExtendeeTag)) - } - if n.FieldLabel() != nil { - // no comments here either (label is first token for group, so we want - // to leave the comments to be associated with the group message instead) - sci.newLocWithoutComments(n.FieldLabel(), append(path, internal.FieldLabelTag)) - } - sci.newLoc(n.FieldType(), append(path, internal.FieldTypeTag)) - // let the name comments be attributed to the group name - sci.newLocWithoutComments(n.FieldName(), append(path, internal.FieldNameTag)) - } else { - sci.newLocWithComments(n, path) - if n.FieldExtendee() != nil { - sci.newLoc(n.FieldExtendee(), append(path, internal.FieldExtendeeTag)) - } - if n.FieldLabel() != nil { - sci.newLoc(n.FieldLabel(), append(path, internal.FieldLabelTag)) - } - var tag int32 - if _, isScalar := internal.FieldTypes[fieldType]; isScalar { - tag = internal.FieldTypeTag - } else { - // this is a message or an enum, so attribute type location - // to the type name field - tag = internal.FieldTypeNameTag - } - sci.newLoc(n.FieldType(), append(path, tag)) - sci.newLoc(n.FieldName(), append(path, internal.FieldNameTag)) - } - sci.newLoc(n.FieldTag(), append(path, internal.FieldNumberTag)) - - if n.GetOptions() != nil { - optsPath := path - optsPath = append(optsPath, internal.FieldOptionsTag) - sci.newLoc(n.GetOptions(), optsPath) - var optIndex int32 - for _, opt := range n.GetOptions().GetElements() { - generateSourceCodeInfoForOption(opts, sci, opt, true, &optIndex, optsPath) - } - } -} - -func generateSourceCodeInfoForExtensionRanges(opts options.Index, sci *sourceCodeInfo, n *ast.ExtensionRangeNode, extRangeIndex *int32, path []int32) { - sci.newLocWithComments(n, path) - startExtRangeIndex := *extRangeIndex - for _, child := range n.Ranges { - path := append(path, *extRangeIndex) - *extRangeIndex++ - sci.newLoc(child, path) - sci.newLoc(child.StartVal, append(path, internal.ExtensionRangeStartTag)) - switch { - case child.EndVal != nil: - sci.newLoc(child.EndVal, append(path, internal.ExtensionRangeEndTag)) - case child.Max != nil: - sci.newLoc(child.Max, append(path, internal.ExtensionRangeEndTag)) - default: - sci.newLoc(child.StartVal, append(path, internal.ExtensionRangeEndTag)) - } - } - // options for all ranges go after the start+end values - for range n.Ranges { - path := append(path, startExtRangeIndex) - startExtRangeIndex++ - if n.Options != nil { - optsPath := path - optsPath = append(optsPath, internal.ExtensionRangeOptionsTag) - sci.newLoc(n.Options, optsPath) - var optIndex int32 - for _, opt := range n.Options.GetElements() { - generateSourceCodeInfoForOption(opts, sci, opt, true, &optIndex, optsPath) - } - } - } -} - -func generateSourceCodeInfoForService(opts options.Index, sci *sourceCodeInfo, n *ast.ServiceNode, path []int32) { - sci.newBlockLocWithComments(n, n.OpenBrace, path) - sci.newLoc(n.Name, append(path, internal.ServiceNameTag)) - var optIndex, rpcIndex int32 - for _, child := range n.Decls { - switch child := child.(type) { - case *ast.OptionNode: - generateSourceCodeInfoForOption(opts, sci, child, false, &optIndex, append(path, internal.ServiceOptionsTag)) - case *ast.RPCNode: - generateSourceCodeInfoForMethod(opts, sci, child, append(path, internal.ServiceMethodsTag, rpcIndex)) - rpcIndex++ - } - } -} - -func generateSourceCodeInfoForMethod(opts options.Index, sci *sourceCodeInfo, n *ast.RPCNode, path []int32) { - if n.OpenBrace != nil { - sci.newBlockLocWithComments(n, n.OpenBrace, path) - } else { - sci.newLocWithComments(n, path) - } - sci.newLoc(n.Name, append(path, internal.MethodNameTag)) - if n.Input.Stream != nil { - sci.newLoc(n.Input.Stream, append(path, internal.MethodInputStreamTag)) - } - sci.newLoc(n.Input.MessageType, append(path, internal.MethodInputTag)) - if n.Output.Stream != nil { - sci.newLoc(n.Output.Stream, append(path, internal.MethodOutputStreamTag)) - } - sci.newLoc(n.Output.MessageType, append(path, internal.MethodOutputTag)) - - optsPath := path - optsPath = append(optsPath, internal.MethodOptionsTag) - var optIndex int32 - for _, decl := range n.Decls { - if opt, ok := decl.(*ast.OptionNode); ok { - generateSourceCodeInfoForOption(opts, sci, opt, false, &optIndex, optsPath) - } - } -} - -type sourceCodeInfo struct { - file *ast.FileNode - extraComments bool - locs []*descriptorpb.SourceCodeInfo_Location - commentsUsed map[ast.SourcePos]struct{} -} - -func (sci *sourceCodeInfo) newLocWithoutComments(n ast.Node, path []int32) { - dup := make([]int32, len(path)) - copy(dup, path) - var start, end ast.SourcePos - if n == sci.file { - // For files, we don't want to consider trailing EOF token - // as part of the span. We want the span to only include - // actual lexical elements in the file (which also excludes - // whitespace and comments). - children := sci.file.Children() - if len(children) > 0 && isEOF(children[len(children)-1]) { - children = children[:len(children)-1] - } - if len(children) == 0 { - start = ast.SourcePos{Filename: sci.file.Name(), Line: 1, Col: 1} - end = start - } else { - start = sci.file.TokenInfo(n.Start()).Start() - end = sci.file.TokenInfo(children[len(children)-1].End()).End() - } - } else { - info := sci.file.NodeInfo(n) - start, end = info.Start(), info.End() - } - sci.locs = append(sci.locs, &descriptorpb.SourceCodeInfo_Location{ - Path: dup, - Span: makeSpan(start, end), - }) -} - -func (sci *sourceCodeInfo) newLoc(n ast.Node, path []int32) { - info := sci.file.NodeInfo(n) - if !sci.extraComments { - dup := make([]int32, len(path)) - copy(dup, path) - start, end := info.Start(), info.End() - sci.locs = append(sci.locs, &descriptorpb.SourceCodeInfo_Location{ - Path: dup, - Span: makeSpan(start, end), - }) - } else { - detachedComments, leadingComments := sci.getLeadingComments(n) - trailingComments := sci.getTrailingComments(n) - sci.newLocWithGivenComments(info, detachedComments, leadingComments, trailingComments, path) - } -} - -func isEOF(n ast.Node) bool { - r, ok := n.(*ast.RuneNode) - return ok && r.Rune == 0 -} - -func (sci *sourceCodeInfo) newBlockLocWithComments(n, openBrace ast.Node, path []int32) { - // Block definitions use trailing comments after the open brace "{" as the - // element's trailing comments. For example: - // - // message Foo { // this is a trailing comment for a message - // - // } // not this - // - nodeInfo := sci.file.NodeInfo(n) - detachedComments, leadingComments := sci.getLeadingComments(n) - trailingComments := sci.getTrailingComments(openBrace) - sci.newLocWithGivenComments(nodeInfo, detachedComments, leadingComments, trailingComments, path) -} - -func (sci *sourceCodeInfo) newLocWithComments(n ast.Node, path []int32) { - nodeInfo := sci.file.NodeInfo(n) - detachedComments, leadingComments := sci.getLeadingComments(n) - trailingComments := sci.getTrailingComments(n) - sci.newLocWithGivenComments(nodeInfo, detachedComments, leadingComments, trailingComments, path) -} - -func (sci *sourceCodeInfo) newLocWithGivenComments(nodeInfo ast.NodeInfo, detachedComments []comments, leadingComments comments, trailingComments comments, path []int32) { - if (len(detachedComments) > 0 && sci.commentUsed(detachedComments[0])) || - (len(detachedComments) == 0 && sci.commentUsed(leadingComments)) { - detachedComments = nil - leadingComments = ast.EmptyComments - } - if sci.commentUsed(trailingComments) { - trailingComments = ast.EmptyComments - } - - var trail *string - if trailingComments.Len() > 0 { - trail = proto.String(sci.combineComments(trailingComments)) - } - - var lead *string - if leadingComments.Len() > 0 { - lead = proto.String(sci.combineComments(leadingComments)) - } - - detached := make([]string, len(detachedComments)) - for i, cmts := range detachedComments { - detached[i] = sci.combineComments(cmts) - } - - dup := make([]int32, len(path)) - copy(dup, path) - sci.locs = append(sci.locs, &descriptorpb.SourceCodeInfo_Location{ - LeadingDetachedComments: detached, - LeadingComments: lead, - TrailingComments: trail, - Path: dup, - Span: makeSpan(nodeInfo.Start(), nodeInfo.End()), - }) -} - -type comments interface { - Len() int - Index(int) ast.Comment -} - -type subComments struct { - offs, n int - c ast.Comments -} - -func (s subComments) Len() int { - return s.n -} - -func (s subComments) Index(i int) ast.Comment { - if i < 0 || i >= s.n { - panic(fmt.Errorf("runtime error: index out of range [%d] with length %d", i, s.n)) - } - return s.c.Index(i + s.offs) -} - -func (sci *sourceCodeInfo) getLeadingComments(n ast.Node) ([]comments, comments) { - s := n.Start() - info := sci.file.TokenInfo(s) - var prevInfo ast.NodeInfo - if prev, ok := sci.file.Tokens().Previous(s); ok { - prevInfo = sci.file.TokenInfo(prev) - } - _, d, l := sci.attributeComments(prevInfo, info) - return d, l -} - -func (sci *sourceCodeInfo) getTrailingComments(n ast.Node) comments { - e := n.End() - next, ok := sci.file.Tokens().Next(e) - if !ok { - return ast.EmptyComments - } - info := sci.file.TokenInfo(e) - nextInfo := sci.file.TokenInfo(next) - t, _, _ := sci.attributeComments(info, nextInfo) - return t -} - -func (sci *sourceCodeInfo) attributeComments(prevInfo, info ast.NodeInfo) (t comments, d []comments, l comments) { - detached := groupComments(info.LeadingComments()) - var trail comments - if prevInfo.IsValid() { - trail = comments(prevInfo.TrailingComments()) - if trail.Len() == 0 { - trail, detached = sci.maybeDonate(prevInfo, info, detached) - } - } else { - trail = ast.EmptyComments - } - detached, lead := sci.maybeAttach(prevInfo, info, trail.Len() > 0, detached) - return trail, detached, lead -} - -func (sci *sourceCodeInfo) maybeDonate(prevInfo ast.NodeInfo, info ast.NodeInfo, lead []comments) (t comments, l []comments) { - if len(lead) == 0 { - // nothing to donate - return ast.EmptyComments, nil - } - firstCommentPos := lead[0].Index(0) - if firstCommentPos.Start().Line > prevInfo.End().Line+1 { - // first comment is detached from previous token, so can't be a trailing comment - return ast.EmptyComments, lead - } - if len(lead) > 1 { - // multiple groups? then donate first comment to previous token - return lead[0], lead[1:] - } - // there is only one element in lead - comment := lead[0] - lastCommentPos := comment.Index(comment.Len() - 1) - if lastCommentPos.End().Line < info.Start().Line-1 { - // there is a blank line between the comments and subsequent token, so - // we can donate the comment to previous token - return comment, nil - } - if txt := info.RawText(); txt == "" || (len(txt) == 1 && strings.ContainsAny(txt, "}]),;")) { - // token is a symbol for the end of a scope or EOF, which doesn't need a leading comment - if !sci.extraComments && txt != "" && - firstCommentPos.Start().Line == prevInfo.End().Line && - lastCommentPos.End().Line == info.Start().Line { - // protoc does not donate if prev and next token are on the same line since it's - // ambiguous which one should get the comment; so we mirror that here - return ast.EmptyComments, lead - } - // But with extra comments, we always donate in this situation in order to capture - // more comments. Because otherwise, these comments are lost since these symbols - // don't map to a location in source code info. - return comment, nil - } - // cannot donate - return ast.EmptyComments, lead -} - -func (sci *sourceCodeInfo) maybeAttach(prevInfo ast.NodeInfo, info ast.NodeInfo, hasTrail bool, lead []comments) (d []comments, l comments) { - if len(lead) == 0 { - return nil, ast.EmptyComments - } - - if len(lead) == 1 && !hasTrail && prevInfo.IsValid() { - // If the one comment appears attached to both previous and next tokens, - // don't attach to either. - comment := lead[0] - attachedToPrevious := comment.Index(0).Start().Line == prevInfo.End().Line - attachedToNext := comment.Index(comment.Len()-1).End().Line == info.Start().Line - if attachedToPrevious && attachedToNext { - // Since attachment is ambiguous, leave it detached. - return lead, ast.EmptyComments - } - } - - lastComment := lead[len(lead)-1] - if lastComment.Index(lastComment.Len()-1).End().Line >= info.Start().Line-1 { - return lead[:len(lead)-1], lastComment - } - - return lead, ast.EmptyComments -} - -func makeSpan(start, end ast.SourcePos) []int32 { - if start.Line == end.Line { - return []int32{int32(start.Line) - 1, int32(start.Col) - 1, int32(end.Col) - 1} - } - return []int32{int32(start.Line) - 1, int32(start.Col) - 1, int32(end.Line) - 1, int32(end.Col) - 1} -} - -func (sci *sourceCodeInfo) commentUsed(c comments) bool { - if c.Len() == 0 { - return false - } - pos := c.Index(0).Start() - if _, ok := sci.commentsUsed[pos]; ok { - return true - } - - sci.commentsUsed[pos] = struct{}{} - return false -} - -func groupComments(cmts ast.Comments) []comments { - if cmts.Len() == 0 { - return nil - } - var groups []comments - singleLineStyle := cmts.Index(0).RawText()[:2] == "//" - line := cmts.Index(0).End().Line - start := 0 - for i := 1; i < cmts.Len(); i++ { - c := cmts.Index(i) - prevSingleLine := singleLineStyle - singleLineStyle = strings.HasPrefix(c.RawText(), "//") - if !singleLineStyle || prevSingleLine != singleLineStyle || c.Start().Line > line+1 { - // new group! - groups = append(groups, subComments{offs: start, n: i - start, c: cmts}) - start = i - } - line = c.End().Line - } - // don't forget last group - groups = append(groups, subComments{offs: start, n: cmts.Len() - start, c: cmts}) - return groups -} - -func (sci *sourceCodeInfo) combineComments(comments comments) string { - if comments.Len() == 0 { - return "" - } - var buf bytes.Buffer - for i, l := 0, comments.Len(); i < l; i++ { - c := comments.Index(i) - txt := c.RawText() - if txt[:2] == "//" { - buf.WriteString(txt[2:]) - // protoc includes trailing newline for line comments, - // but it's not present in the AST comment. So we need - // to add it if present. - if i, ok := sci.file.Items().Next(c.AsItem()); ok { - info := sci.file.ItemInfo(i) - if strings.HasPrefix(info.LeadingWhitespace(), "\n") { - buf.WriteRune('\n') - } - } - } else { - lines := strings.Split(txt[2:len(txt)-2], "\n") - first := true - for _, l := range lines { - if first { - first = false - buf.WriteString(l) - continue - } - buf.WriteByte('\n') - - // strip a prefix of whitespace followed by '*' - j := 0 - for j < len(l) { - if l[j] != ' ' && l[j] != '\t' { - break - } - j++ - } - switch { - case j == len(l): - l = "" - case l[j] == '*': - l = l[j+1:] - case j > 0: - l = l[j:] - } - - buf.WriteString(l) - } - } - } - return buf.String() -} - -func dup(p []int32) []int32 { - return append(([]int32)(nil), p...) -} diff --git a/vendor/github.com/bufbuild/protocompile/std_imports.go b/vendor/github.com/bufbuild/protocompile/std_imports.go deleted file mode 100644 index dcf8553a74..0000000000 --- a/vendor/github.com/bufbuild/protocompile/std_imports.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package protocompile - -import ( - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/reflect/protoregistry" - _ "google.golang.org/protobuf/types/known/anypb" // link in packages that include the standard protos included with protoc. - _ "google.golang.org/protobuf/types/known/apipb" - _ "google.golang.org/protobuf/types/known/durationpb" - _ "google.golang.org/protobuf/types/known/emptypb" - _ "google.golang.org/protobuf/types/known/fieldmaskpb" - _ "google.golang.org/protobuf/types/known/sourcecontextpb" - _ "google.golang.org/protobuf/types/known/structpb" - _ "google.golang.org/protobuf/types/known/timestamppb" - _ "google.golang.org/protobuf/types/known/typepb" - _ "google.golang.org/protobuf/types/known/wrapperspb" - _ "google.golang.org/protobuf/types/pluginpb" -) - -// All files that are included with protoc are also included with this package -// so that clients do not need to explicitly supply a copy of these protos (just -// like callers of protoc do not need to supply them). -var standardImports map[string]protoreflect.FileDescriptor - -func init() { - standardFilenames := []string{ - "google/protobuf/any.proto", - "google/protobuf/api.proto", - "google/protobuf/compiler/plugin.proto", - "google/protobuf/descriptor.proto", - "google/protobuf/duration.proto", - "google/protobuf/empty.proto", - "google/protobuf/field_mask.proto", - "google/protobuf/source_context.proto", - "google/protobuf/struct.proto", - "google/protobuf/timestamp.proto", - "google/protobuf/type.proto", - "google/protobuf/wrappers.proto", - } - - standardImports = map[string]protoreflect.FileDescriptor{} - for _, fn := range standardFilenames { - fd, err := protoregistry.GlobalFiles.FindFileByPath(fn) - if err != nil { - panic(err.Error()) - } - standardImports[fn] = fd - } -} diff --git a/vendor/github.com/bufbuild/protocompile/walk/walk.go b/vendor/github.com/bufbuild/protocompile/walk/walk.go deleted file mode 100644 index e7a1ab3b1a..0000000000 --- a/vendor/github.com/bufbuild/protocompile/walk/walk.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright 2020-2022 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package walk provides helper functions for traversing all elements in a -// protobuf file descriptor. There are versions both for traversing "rich" -// descriptors (protoreflect.Descriptor) and for traversing the underlying -// "raw" descriptor protos. -// -// # Enter And Exit -// -// This package includes variants of the functions that accept two callback -// functions. These variants have names ending with "EnterAndExit". One function -// is called as each element is visited ("enter") and the other is called after -// the element and all of its descendants have been visited ("exit"). This -// can be useful when you need to track state that is scoped to the visitation -// of a single element. -// -// # Source Path -// -// When traversing raw descriptor protos, this package include variants whose -// callback accepts a protoreflect.SourcePath. These variants have names that -// include "WithPath". This path can be used to locate corresponding data in the -// file's source code info (if present). -package walk - -import ( - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/reflect/protoreflect" - "google.golang.org/protobuf/types/descriptorpb" - - "github.com/bufbuild/protocompile/internal" -) - -// Descriptors walks all descriptors in the given file using a depth-first -// traversal, calling the given function for each descriptor in the hierarchy. -// The walk ends when traversal is complete or when the function returns an -// error. If the function returns an error, that is returned as the result of the -// walk operation. -// -// Descriptors are visited using a pre-order traversal, where the function is -// called for a descriptor before it is called for any of its descendants. -func Descriptors(file protoreflect.FileDescriptor, fn func(protoreflect.Descriptor) error) error { - return DescriptorsEnterAndExit(file, fn, nil) -} - -// DescriptorsEnterAndExit walks all descriptors in the given file using a -// depth-first traversal, calling the given functions on entry and on exit -// for each descriptor in the hierarchy. The walk ends when traversal is -// complete or when a function returns an error. If a function returns an error, -// that is returned as the result of the walk operation. -// -// The enter function is called using a pre-order traversal, where the function -// is called for a descriptor before it is called for any of its descendants. -// The exit function is called using a post-order traversal, where the function -// is called for a descriptor only after it is called for any descendants. -func DescriptorsEnterAndExit(file protoreflect.FileDescriptor, enter, exit func(protoreflect.Descriptor) error) error { - for i := 0; i < file.Messages().Len(); i++ { - msg := file.Messages().Get(i) - if err := messageDescriptor(msg, enter, exit); err != nil { - return err - } - } - for i := 0; i < file.Enums().Len(); i++ { - en := file.Enums().Get(i) - if err := enumDescriptor(en, enter, exit); err != nil { - return err - } - } - for i := 0; i < file.Extensions().Len(); i++ { - ext := file.Extensions().Get(i) - if err := enter(ext); err != nil { - return err - } - if exit != nil { - if err := exit(ext); err != nil { - return err - } - } - } - for i := 0; i < file.Services().Len(); i++ { - svc := file.Services().Get(i) - if err := enter(svc); err != nil { - return err - } - for i := 0; i < svc.Methods().Len(); i++ { - mtd := svc.Methods().Get(i) - if err := enter(mtd); err != nil { - return err - } - if exit != nil { - if err := exit(mtd); err != nil { - return err - } - } - } - if exit != nil { - if err := exit(svc); err != nil { - return err - } - } - } - return nil -} - -func messageDescriptor(msg protoreflect.MessageDescriptor, enter, exit func(protoreflect.Descriptor) error) error { - if err := enter(msg); err != nil { - return err - } - for i := 0; i < msg.Fields().Len(); i++ { - fld := msg.Fields().Get(i) - if err := enter(fld); err != nil { - return err - } - if exit != nil { - if err := exit(fld); err != nil { - return err - } - } - } - for i := 0; i < msg.Oneofs().Len(); i++ { - oo := msg.Oneofs().Get(i) - if err := enter(oo); err != nil { - return err - } - if exit != nil { - if err := exit(oo); err != nil { - return err - } - } - } - for i := 0; i < msg.Messages().Len(); i++ { - nested := msg.Messages().Get(i) - if err := messageDescriptor(nested, enter, exit); err != nil { - return err - } - } - for i := 0; i < msg.Enums().Len(); i++ { - en := msg.Enums().Get(i) - if err := enumDescriptor(en, enter, exit); err != nil { - return err - } - } - for i := 0; i < msg.Extensions().Len(); i++ { - ext := msg.Extensions().Get(i) - if err := enter(ext); err != nil { - return err - } - if exit != nil { - if err := exit(ext); err != nil { - return err - } - } - } - if exit != nil { - if err := exit(msg); err != nil { - return err - } - } - return nil -} - -func enumDescriptor(en protoreflect.EnumDescriptor, enter, exit func(protoreflect.Descriptor) error) error { - if err := enter(en); err != nil { - return err - } - for i := 0; i < en.Values().Len(); i++ { - enVal := en.Values().Get(i) - if err := enter(enVal); err != nil { - return err - } - if exit != nil { - if err := exit(enVal); err != nil { - return err - } - } - } - if exit != nil { - if err := exit(en); err != nil { - return err - } - } - return nil -} - -// DescriptorProtosWithPath walks all descriptor protos in the given file using -// a depth-first traversal. This is the same as DescriptorProtos except that the -// callback function, fn, receives a protoreflect.SourcePath, that indicates the -// path for the element in the file's source code info. -func DescriptorProtosWithPath(file *descriptorpb.FileDescriptorProto, fn func(protoreflect.FullName, protoreflect.SourcePath, proto.Message) error) error { - return DescriptorProtosWithPathEnterAndExit(file, fn, nil) -} - -// DescriptorProtosWithPathEnterAndExit walks all descriptor protos in the given -// file using a depth-first traversal. This is the same as -// DescriptorProtosEnterAndExit except that the callback function, fn, receives -// a protoreflect.SourcePath, that indicates the path for the element in the -// file's source code info. -func DescriptorProtosWithPathEnterAndExit(file *descriptorpb.FileDescriptorProto, enter, exit func(protoreflect.FullName, protoreflect.SourcePath, proto.Message) error) error { - w := &protoWalker{usePath: true, enter: enter, exit: exit} - return w.walkDescriptorProtos(file) -} - -// DescriptorProtos walks all descriptor protos in the given file using a -// depth-first traversal, calling the given function for each descriptor proto -// in the hierarchy. The walk ends when traversal is complete or when the -// function returns an error. If the function returns an error, that is -// returned as the result of the walk operation. -// -// Descriptor protos are visited using a pre-order traversal, where the function -// is called for a descriptor before it is called for any of its descendants. -func DescriptorProtos(file *descriptorpb.FileDescriptorProto, fn func(protoreflect.FullName, proto.Message) error) error { - return DescriptorProtosEnterAndExit(file, fn, nil) -} - -// DescriptorProtosEnterAndExit walks all descriptor protos in the given file -// using a depth-first traversal, calling the given functions on entry and on -// exit for each descriptor in the hierarchy. The walk ends when traversal is -// complete or when a function returns an error. If a function returns an error, -// that is returned as the result of the walk operation. -// -// The enter function is called using a pre-order traversal, where the function -// is called for a descriptor proto before it is called for any of its -// descendants. The exit function is called using a post-order traversal, where -// the function is called for a descriptor proto only after it is called for any -// descendants. -func DescriptorProtosEnterAndExit(file *descriptorpb.FileDescriptorProto, enter, exit func(protoreflect.FullName, proto.Message) error) error { - enterWithPath := func(n protoreflect.FullName, p protoreflect.SourcePath, m proto.Message) error { - return enter(n, m) - } - var exitWithPath func(n protoreflect.FullName, p protoreflect.SourcePath, m proto.Message) error - if exit != nil { - exitWithPath = func(n protoreflect.FullName, p protoreflect.SourcePath, m proto.Message) error { - return exit(n, m) - } - } - w := &protoWalker{ - enter: enterWithPath, - exit: exitWithPath, - } - return w.walkDescriptorProtos(file) -} - -type protoWalker struct { - usePath bool - enter, exit func(protoreflect.FullName, protoreflect.SourcePath, proto.Message) error -} - -func (w *protoWalker) walkDescriptorProtos(file *descriptorpb.FileDescriptorProto) error { - prefix := file.GetPackage() - if prefix != "" { - prefix += "." - } - var path protoreflect.SourcePath - for i, msg := range file.MessageType { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.FileMessagesTag, int32(i)) - } - if err := w.walkDescriptorProto(prefix, p, msg); err != nil { - return err - } - } - for i, en := range file.EnumType { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.FileEnumsTag, int32(i)) - } - if err := w.walkEnumDescriptorProto(prefix, p, en); err != nil { - return err - } - } - for i, ext := range file.Extension { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.FileExtensionsTag, int32(i)) - } - fqn := prefix + ext.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, ext); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, ext); err != nil { - return err - } - } - } - for i, svc := range file.Service { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.FileServicesTag, int32(i)) - } - fqn := prefix + svc.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, svc); err != nil { - return err - } - for j, mtd := range svc.Method { - var mp protoreflect.SourcePath - if w.usePath { - mp = p - mp = append(mp, internal.ServiceMethodsTag, int32(j)) - } - mtdFqn := fqn + "." + mtd.GetName() - if err := w.enter(protoreflect.FullName(mtdFqn), mp, mtd); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(mtdFqn), mp, mtd); err != nil { - return err - } - } - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, svc); err != nil { - return err - } - } - } - return nil -} - -func (w *protoWalker) walkDescriptorProto(prefix string, path protoreflect.SourcePath, msg *descriptorpb.DescriptorProto) error { - fqn := prefix + msg.GetName() - if err := w.enter(protoreflect.FullName(fqn), path, msg); err != nil { - return err - } - prefix = fqn + "." - for i, fld := range msg.Field { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.MessageFieldsTag, int32(i)) - } - fqn := prefix + fld.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, fld); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, fld); err != nil { - return err - } - } - } - for i, oo := range msg.OneofDecl { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.MessageOneOfsTag, int32(i)) - } - fqn := prefix + oo.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, oo); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, oo); err != nil { - return err - } - } - } - for i, nested := range msg.NestedType { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.MessageNestedMessagesTag, int32(i)) - } - if err := w.walkDescriptorProto(prefix, p, nested); err != nil { - return err - } - } - for i, en := range msg.EnumType { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.MessageEnumsTag, int32(i)) - } - if err := w.walkEnumDescriptorProto(prefix, p, en); err != nil { - return err - } - } - for i, ext := range msg.Extension { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.MessageExtensionsTag, int32(i)) - } - fqn := prefix + ext.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, ext); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, ext); err != nil { - return err - } - } - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), path, msg); err != nil { - return err - } - } - return nil -} - -func (w *protoWalker) walkEnumDescriptorProto(prefix string, path protoreflect.SourcePath, en *descriptorpb.EnumDescriptorProto) error { - fqn := prefix + en.GetName() - if err := w.enter(protoreflect.FullName(fqn), path, en); err != nil { - return err - } - for i, val := range en.Value { - var p protoreflect.SourcePath - if w.usePath { - p = path - p = append(p, internal.EnumValuesTag, int32(i)) - } - fqn := prefix + val.GetName() - if err := w.enter(protoreflect.FullName(fqn), p, val); err != nil { - return err - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), p, val); err != nil { - return err - } - } - } - if w.exit != nil { - if err := w.exit(protoreflect.FullName(fqn), path, en); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/butuzov/ireturn/LICENSE b/vendor/github.com/butuzov/ireturn/LICENSE deleted file mode 100644 index a9752e9726..0000000000 --- a/vendor/github.com/butuzov/ireturn/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Oleg Butuzov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/butuzov/ireturn/analyzer/analyzer.go b/vendor/github.com/butuzov/ireturn/analyzer/analyzer.go deleted file mode 100644 index 21e5897b26..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/analyzer.go +++ /dev/null @@ -1,242 +0,0 @@ -package analyzer - -import ( - "flag" - "go/ast" - gotypes "go/types" - "strings" - "sync" - - "github.com/butuzov/ireturn/analyzer/internal/config" - "github.com/butuzov/ireturn/analyzer/internal/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const name string = "ireturn" // linter name - -type validator interface { - IsValid(types.IFace) bool -} - -type analyzer struct { - once sync.Once - mu sync.RWMutex - handler validator - err error - - found []analysis.Diagnostic -} - -func (a *analyzer) run(pass *analysis.Pass) (interface{}, error) { - // 00. Part 1. Handling Configuration Only Once. - a.once.Do(func() { a.readConfiguration(&pass.Analyzer.Flags) }) - - // 00. Part 2. Handling Errors - if a.err != nil { - return nil, a.err - } - - ins, _ := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - // 00. does file have dot-imported standard packages? - dotImportedStd := make(map[string]struct{}) - ins.Preorder([]ast.Node{(*ast.ImportSpec)(nil)}, func(node ast.Node) { - i, _ := node.(*ast.ImportSpec) - if i.Name != nil && i.Name.Name == "." { - dotImportedStd[strings.Trim(i.Path.Value, `"`)] = struct{}{} - } - }) - - // 01. Running Inspection. - ins.Preorder([]ast.Node{(*ast.FuncDecl)(nil)}, func(node ast.Node) { - // 001. Casting to funcdecl - f, _ := node.(*ast.FuncDecl) - - // 002. Does it return any results ? - if f.Type == nil || f.Type.Results == nil { - return - } - - // 003. Is it allowed to be checked? - // TODO(butuzov): add inline comment - if hasDisallowDirective(f.Doc) { - return - } - - seen := make(map[string]bool, 4) - - // 004. Filtering Results. - for _, issue := range filterInterfaces(pass, f.Type, dotImportedStd) { - - if a.handler.IsValid(issue) { - continue - } - - issue.Enrich(f) - - key := issue.HashString() - - if ok := seen[key]; ok { - continue - } - seen[key] = true - - a.addDiagnostic(issue.ExportDiagnostic()) - } - }) - - // 02. Printing reports. - a.mu.RLock() - defer a.mu.RUnlock() - for i := range a.found { - pass.Report(a.found[i]) - } - - return nil, nil -} - -func (a *analyzer) addDiagnostic(d analysis.Diagnostic) { - a.mu.Lock() - defer a.mu.Unlock() - - a.found = append(a.found, d) -} - -func (a *analyzer) readConfiguration(fs *flag.FlagSet) { - cnf, err := config.New(fs) - if err != nil { - a.err = err - return - } - - if validatorImpl, ok := cnf.(validator); ok { - a.handler = validatorImpl - return - } - - a.handler = config.DefaultValidatorConfig() -} - -func NewAnalyzer() *analysis.Analyzer { - a := analyzer{} //nolint: exhaustivestruct - - return &analysis.Analyzer{ - Name: name, - Doc: "Accept Interfaces, Return Concrete Types", - Run: a.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - Flags: flags(), - } -} - -func flags() flag.FlagSet { - set := flag.NewFlagSet("", flag.PanicOnError) - set.String("allow", "", "accept-list of the comma-separated interfaces") - set.String("reject", "", "reject-list of the comma-separated interfaces") - return *set -} - -func filterInterfaces(p *analysis.Pass, ft *ast.FuncType, di map[string]struct{}) []types.IFace { - var results []types.IFace - - if ft.Results == nil { // this can't happen, but double checking. - return results - } - - tp := newTypeParams(ft.TypeParams) - - for _, el := range ft.Results.List { - switch v := el.Type.(type) { - // ----- empty or anonymous interfaces - case *ast.InterfaceType: - - if len(v.Methods.List) == 0 { - results = append(results, types.NewIssue("interface{}", types.EmptyInterface)) - continue - } - - results = append(results, types.NewIssue("anonymous interface", types.AnonInterface)) - - // ------ Errors and interfaces from same package - case *ast.Ident: - - t1 := p.TypesInfo.TypeOf(el.Type) - if !gotypes.IsInterface(t1.Underlying()) { - continue - } - - word := t1.String() - // only build in interface is error - if obj := gotypes.Universe.Lookup(word); obj != nil { - results = append(results, types.NewIssue(obj.Name(), types.ErrorInterface)) - continue - } - - // found in type params - if tp.In(word) { - results = append(results, types.NewIssue(word, types.Generic)) - continue - } - - // is it dot-imported package? - // handling cases when stdlib package imported via "." dot-import - if len(di) > 0 { - name := stdPkgInterface(word) - if _, ok := di[name]; ok { - results = append(results, types.NewIssue(word, types.NamedStdInterface)) - - continue - } - } - - results = append(results, types.NewIssue(word, types.NamedInterface)) - - // ------- standard library and 3rd party interfaces - case *ast.SelectorExpr: - - t1 := p.TypesInfo.TypeOf(el.Type) - if !gotypes.IsInterface(t1.Underlying()) { - continue - } - - word := t1.String() - if isStdPkgInterface(word) { - results = append(results, types.NewIssue(word, types.NamedStdInterface)) - continue - } - - results = append(results, types.NewIssue(word, types.NamedInterface)) - } - } - - return results -} - -// stdPkgInterface will return package name if tis std lib package -// or empty string on fail. -func stdPkgInterface(named string) string { - // find last "." index. - idx := strings.LastIndex(named, ".") - if idx == -1 { - return "" - } - - return stdPkg(named[0:idx]) -} - -// isStdPkgInterface will run small checks against pkg to find out if named -// interface we looking on - comes from a standard library or not. -func isStdPkgInterface(namedInterface string) bool { - return stdPkgInterface(namedInterface) != "" -} - -func stdPkg(pkg string) string { - if _, ok := std[pkg]; ok { - return pkg - } - - return "" -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/disallow.go b/vendor/github.com/butuzov/ireturn/analyzer/disallow.go deleted file mode 100644 index 36b6fcb4f3..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/disallow.go +++ /dev/null @@ -1,45 +0,0 @@ -package analyzer - -import ( - "go/ast" - "strings" -) - -const nolintPrefix = "//nolint" - -func hasDisallowDirective(cg *ast.CommentGroup) bool { - if cg == nil { - return false - } - - return directiveFound(cg) -} - -func directiveFound(cg *ast.CommentGroup) bool { - for i := len(cg.List) - 1; i >= 0; i-- { - comment := cg.List[i] - if !strings.HasPrefix(comment.Text, nolintPrefix) { - continue - } - - startingIdx := len(nolintPrefix) - for { - idx := strings.Index(comment.Text[startingIdx:], name) - if idx == -1 { - break - } - - if len(comment.Text[startingIdx+idx:]) == len(name) { - return true - } - - c := comment.Text[startingIdx+idx+len(name)] - if c == '.' || c == ',' || c == ' ' || c == ' ' { - return true - } - startingIdx += idx + 1 - } - } - - return false -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/allow.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/config/allow.go deleted file mode 100644 index 6a294ca35f..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/allow.go +++ /dev/null @@ -1,17 +0,0 @@ -package config - -import "github.com/butuzov/ireturn/analyzer/internal/types" - -// allowConfig specifies a list of interfaces (keywords, patters and regular expressions) -// that are allowed by ireturn as valid to return, any non listed interface are rejected. -type allowConfig struct { - *defaultConfig -} - -func allowAll(patterns []string) *allowConfig { - return &allowConfig{&defaultConfig{List: patterns}} -} - -func (ac *allowConfig) IsValid(i types.IFace) bool { - return ac.Has(i) -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/config.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/config/config.go deleted file mode 100644 index 46c73170ae..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/config.go +++ /dev/null @@ -1,66 +0,0 @@ -package config - -import ( - "regexp" - "sync" - - "github.com/butuzov/ireturn/analyzer/internal/types" -) - -// defaultConfig is core of the validation, ... -// todo(butuzov): write proper intro... - -type defaultConfig struct { - List []string - - // private fields (for search optimization look ups) - once sync.Once - quick uint8 - list []*regexp.Regexp -} - -func (config *defaultConfig) Has(i types.IFace) bool { - config.once.Do(config.compileList) - - if config.quick&uint8(i.Type) > 0 { - return true - } - - // not a named interface (because error, interface{}, anon interface has keywords.) - if i.Type&types.NamedInterface == 0 && i.Type&types.NamedStdInterface == 0 { - return false - } - - for _, re := range config.list { - if re.MatchString(i.Name) { - return true - } - } - - return false -} - -// compileList will transform text list into a bitmask for quick searches and -// slice of regular expressions for quick searches. -func (config *defaultConfig) compileList() { - for _, str := range config.List { - switch str { - case types.NameError: - config.quick |= uint8(types.ErrorInterface) - case types.NameEmpty: - config.quick |= uint8(types.EmptyInterface) - case types.NameAnon: - config.quick |= uint8(types.AnonInterface) - case types.NameStdLib: - config.quick |= uint8(types.NamedStdInterface) - case types.NameGeneric: - config.quick |= uint8(types.Generic) - } - - // allow to parse regular expressions - // todo(butuzov): how can we log error in golangci-lint? - if re, err := regexp.Compile(str); err == nil { - config.list = append(config.list, re) - } - } -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/new.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/config/new.go deleted file mode 100644 index 6aa04e52e8..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/new.go +++ /dev/null @@ -1,74 +0,0 @@ -package config - -import ( - "errors" - "flag" - "strings" - - "github.com/butuzov/ireturn/analyzer/internal/types" -) - -var ErrCollisionOfInterests = errors.New("can't have both `-accept` and `-reject` specified at same time") - -// nolint: exhaustivestruct -func DefaultValidatorConfig() *allowConfig { - return allowAll([]string{ - types.NameEmpty, // "empty": empty interfaces (interface{}) - types.NameError, // "error": for all error's - types.NameAnon, // "anon": for all empty interfaces with methods (interface {Method()}) - types.NameStdLib, // "std": for all standard library packages - }) -} - -// New is factory function that return allowConfig or rejectConfig depending -// on provided arguments. -func New(fs *flag.FlagSet) (interface{}, error) { - var ( - allowList = toSlice(getFlagVal(fs, "allow")) - rejectList = toSlice(getFlagVal(fs, "reject")) - ) - - // can't have both at same time. - if len(allowList) != 0 && len(rejectList) != 0 { - return nil, ErrCollisionOfInterests - } - - switch { - case len(allowList) > 0: - return allowAll(allowList), nil - case len(rejectList) > 0: - return rejectAll(rejectList), nil - } - - // can have none (defaults are used) at same time. - return nil, nil -} - -// both constants used to cleanup items provided in comma separated list. -const ( - SepTab string = " " - SepSpace string = " " -) - -func toSlice(s string) []string { - var results []string - - for _, pattern := range strings.Split(s, ",") { - pattern = strings.Trim(pattern, SepTab+SepSpace) - if pattern != "" { - results = append(results, pattern) - } - } - - return results -} - -func getFlagVal(fs *flag.FlagSet, name string) string { - flg := fs.Lookup(name) - - if flg == nil { - return "" - } - - return flg.Value.String() -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/reject.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/config/reject.go deleted file mode 100644 index bef6913bb8..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/config/reject.go +++ /dev/null @@ -1,17 +0,0 @@ -package config - -import "github.com/butuzov/ireturn/analyzer/internal/types" - -// rejectConfig specifies a list of interfaces (keywords, patters and regular expressions) -// that are rejected by ireturn as valid to return, any non listed interface are allowed. -type rejectConfig struct { - *defaultConfig -} - -func rejectAll(patterns []string) *rejectConfig { - return &rejectConfig{&defaultConfig{List: patterns}} -} - -func (rc *rejectConfig) IsValid(i types.IFace) bool { - return !rc.Has(i) -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/iface.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/types/iface.go deleted file mode 100644 index 13f19a3e25..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/iface.go +++ /dev/null @@ -1,49 +0,0 @@ -package types - -import ( - "fmt" - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" -) - -type IFace struct { - Name string // Interface name - Type IType // Type of the interface - - Pos token.Pos // Token Position - FuncName string // -} - -func NewIssue(name string, interfaceType IType) IFace { - return IFace{ - Name: name, - // Pos: pos, - Type: interfaceType, - } -} - -func (i *IFace) Enrich(f *ast.FuncDecl) { - i.FuncName = f.Name.Name - i.Pos = f.Pos() -} - -func (i IFace) String() string { - if i.Type == Generic { - return fmt.Sprintf("%s returns generic interface (%s)", i.FuncName, i.Name) - } - - return fmt.Sprintf("%s returns interface (%s)", i.FuncName, i.Name) -} - -func (i IFace) HashString() string { - return fmt.Sprintf("%v-%s", i.Pos, i.String()) -} - -func (i IFace) ExportDiagnostic() analysis.Diagnostic { - return analysis.Diagnostic{ //nolint: exhaustivestruct - Pos: i.Pos, - Message: i.String(), - } -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/names.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/types/names.go deleted file mode 100644 index 1092c9667c..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/names.go +++ /dev/null @@ -1,9 +0,0 @@ -package types - -const ( - NameEmpty = "empty" - NameAnon = "anon" - NameError = "error" - NameStdLib = "stdlib" - NameGeneric = "generic" -) diff --git a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/types.go b/vendor/github.com/butuzov/ireturn/analyzer/internal/types/types.go deleted file mode 100644 index 5c0bd74077..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/internal/types/types.go +++ /dev/null @@ -1,12 +0,0 @@ -package types - -type IType uint8 - -const ( - EmptyInterface IType = 1 << iota // ref as empty - AnonInterface // ref as anon - ErrorInterface // ref as error - NamedInterface // ref as named - NamedStdInterface // ref as named stdlib - Generic // ref as generic type parameter -) diff --git a/vendor/github.com/butuzov/ireturn/analyzer/std.go b/vendor/github.com/butuzov/ireturn/analyzer/std.go deleted file mode 100644 index 4c6c4e4204..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/std.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated using std.sh; DO NOT EDIT. - -// We will ignore that fact that some of packages -// were removed from stdlib. - -package analyzer - -var std = map[string]struct{}{ - // added in Go v1.2 in compare to v1.1 (docker image) - "archive/tar": {}, - "archive/zip": {}, - "bufio": {}, - "bytes": {}, - "cmd/cgo": {}, - "cmd/fix": {}, - "cmd/go": {}, - "cmd/gofmt": {}, - "cmd/yacc": {}, - "compress/bzip2": {}, - "compress/flate": {}, - "compress/gzip": {}, - "compress/lzw": {}, - "compress/zlib": {}, - "container/heap": {}, - "container/list": {}, - "container/ring": {}, - "crypto": {}, - "crypto/aes": {}, - "crypto/cipher": {}, - "crypto/des": {}, - "crypto/dsa": {}, - "crypto/ecdsa": {}, - "crypto/elliptic": {}, - "crypto/hmac": {}, - "crypto/md5": {}, - "crypto/rand": {}, - "crypto/rc4": {}, - "crypto/rsa": {}, - "crypto/sha1": {}, - "crypto/sha256": {}, - "crypto/sha512": {}, - "crypto/subtle": {}, - "crypto/tls": {}, - "crypto/x509": {}, - "crypto/x509/pkix": {}, - "database/sql": {}, - "database/sql/driver": {}, - "debug/dwarf": {}, - "debug/elf": {}, - "debug/gosym": {}, - "debug/macho": {}, - "debug/pe": {}, - "encoding": {}, - "encoding/ascii85": {}, - "encoding/asn1": {}, - "encoding/base32": {}, - "encoding/base64": {}, - "encoding/binary": {}, - "encoding/csv": {}, - "encoding/gob": {}, - "encoding/hex": {}, - "encoding/json": {}, - "encoding/pem": {}, - "encoding/xml": {}, - "errors": {}, - "expvar": {}, - "flag": {}, - "fmt": {}, - "go/ast": {}, - "go/build": {}, - "go/doc": {}, - "go/format": {}, - "go/parser": {}, - "go/printer": {}, - "go/scanner": {}, - "go/token": {}, - "hash": {}, - "hash/adler32": {}, - "hash/crc32": {}, - "hash/crc64": {}, - "hash/fnv": {}, - "html": {}, - "html/template": {}, - "image": {}, - "image/color": {}, - "image/color/palette": {}, - "image/draw": {}, - "image/gif": {}, - "image/jpeg": {}, - "image/png": {}, - "index/suffixarray": {}, - "io": {}, - "io/ioutil": {}, - "log": {}, - "log/syslog": {}, - "math": {}, - "math/big": {}, - "math/cmplx": {}, - "math/rand": {}, - "mime": {}, - "mime/multipart": {}, - "net": {}, - "net/http": {}, - "net/http/cgi": {}, - "net/http/cookiejar": {}, - "net/http/fcgi": {}, - "net/http/httptest": {}, - "net/http/httputil": {}, - "net/http/pprof": {}, - "net/mail": {}, - "net/rpc": {}, - "net/rpc/jsonrpc": {}, - "net/smtp": {}, - "net/textproto": {}, - "net/url": {}, - "os": {}, - "os/exec": {}, - "os/signal": {}, - "os/user": {}, - "path": {}, - "path/filepath": {}, - "reflect": {}, - "regexp": {}, - "regexp/syntax": {}, - "runtime": {}, - "runtime/cgo": {}, - "runtime/debug": {}, - "runtime/pprof": {}, - "runtime/race": {}, - "sort": {}, - "strconv": {}, - "strings": {}, - "sync": {}, - "sync/atomic": {}, - "syscall": {}, - "testing": {}, - "testing/iotest": {}, - "testing/quick": {}, - "text/scanner": {}, - "text/tabwriter": {}, - "text/template": {}, - "text/template/parse": {}, - "time": {}, - "unicode": {}, - "unicode/utf16": {}, - "unicode/utf8": {}, - "unsafe": {}, - // added in Go v1.3 in compare to v1.2 (docker image) - "cmd/addr2line": {}, - "cmd/nm": {}, - "cmd/objdump": {}, - "cmd/pack": {}, - "debug/plan9obj": {}, - // added in Go v1.4 in compare to v1.3 (docker image) - "cmd/pprof": {}, - // added in Go v1.5 in compare to v1.4 (docker image) - "go/constant": {}, - "go/importer": {}, - "go/types": {}, - "mime/quotedprintable": {}, - "runtime/trace": {}, - // added in Go v1.6 in compare to v1.5 (docker image) - // added in Go v1.7 in compare to v1.6 (docker image) - "context": {}, - "net/http/httptrace": {}, - // added in Go v1.8 in compare to v1.7 (docker image) - "plugin": {}, - // added in Go v1.9 in compare to v1.8 (docker image) - "math/bits": {}, - // added in Go v1.10 in compare to v1.9 (docker image) - // added in Go v1.11 in compare to v1.10 (docker image) - // added in Go v1.12 in compare to v1.11 (docker image) - // added in Go v1.13 in compare to v1.12 (docker image) - "crypto/ed25519": {}, - // added in Go v1.14 in compare to v1.13 (docker image) - "hash/maphash": {}, - // added in Go v1.15 in compare to v1.14 (docker image) - "time/tzdata": {}, - // added in Go v1.16 in compare to v1.15 (docker image) - "embed": {}, - "go/build/constraint": {}, - "io/fs": {}, - "runtime/metrics": {}, - "testing/fstest": {}, - // added in Go v1.17 in compare to v1.16 (docker image) - // added in Go v1.18 in compare to v1.17 (docker image) - "debug/buildinfo": {}, - "net/netip": {}, - // added in Go v1.19 in compare to v1.18 (docker image) - "go/doc/comment": {}, - // added in Go v1.20 in compare to v1.19 (docker image) - "crypto/ecdh": {}, - "runtime/coverage": {}, - // added in Go v1.21 in compare to v1.20 (docker image) - "cmp": {}, - "log/slog": {}, - "maps": {}, - "slices": {}, - "testing/slogtest": {}, -} diff --git a/vendor/github.com/butuzov/ireturn/analyzer/typeparams.go b/vendor/github.com/butuzov/ireturn/analyzer/typeparams.go deleted file mode 100644 index 14193c355b..0000000000 --- a/vendor/github.com/butuzov/ireturn/analyzer/typeparams.go +++ /dev/null @@ -1,38 +0,0 @@ -package analyzer - -import ( - "go/ast" -) - -type typeParams struct { - found []string -} - -func newTypeParams(fl *ast.FieldList) typeParams { - tp := typeParams{} - - if fl == nil { - return tp - } - - for _, el := range fl.List { - if el == nil { - continue - } - - for _, name := range el.Names { - tp.found = append(tp.found, name.Name) - } - } - - return tp -} - -func (tp typeParams) In(t string) bool { - for _, i := range tp.found { - if i == t { - return true - } - } - return false -} diff --git a/vendor/github.com/butuzov/mirror/.act b/vendor/github.com/butuzov/mirror/.act deleted file mode 100644 index 8182d703ae..0000000000 --- a/vendor/github.com/butuzov/mirror/.act +++ /dev/null @@ -1,2 +0,0 @@ ---platform ubuntu-latest=butuzov/act-go:latest ---env DRY_RUN=1 diff --git a/vendor/github.com/butuzov/mirror/.editorconfig b/vendor/github.com/butuzov/mirror/.editorconfig deleted file mode 100644 index 4d9c20d8d9..0000000000 --- a/vendor/github.com/butuzov/mirror/.editorconfig +++ /dev/null @@ -1,28 +0,0 @@ -# top-most EditorConfig file -root = true - - -[*] -end_of_line = lf # Unix-style newlines -charset = utf-8 - -indent_style = space # default identation - spaces -indent_size = 4 # default identation - size - -insert_final_newline = true # new line at the end of file -trim_trailing_whitespace = true # no extra sapces at the end of lines - -[*.{go,gohtml,gotpl}] # Go -indent_style = tab -indent_size = 2 - -[{Makefile,makefile}] # CMake -indent_style = tab - -[*.md] # Markdown -trim_trailing_whitespace = true -max_line_length = 100 -insert_final_newline = true -indent_size = 2 - - diff --git a/vendor/github.com/butuzov/mirror/.gitignore b/vendor/github.com/butuzov/mirror/.gitignore deleted file mode 100644 index 109f33b98e..0000000000 --- a/vendor/github.com/butuzov/mirror/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# artifacts -coverage.cov -bin/* -dist/* -tmp/* -out* -sandbox* -demo* -.task* -.ipynb* -.jupyter* diff --git a/vendor/github.com/butuzov/mirror/.goreleaser.yaml b/vendor/github.com/butuzov/mirror/.goreleaser.yaml deleted file mode 100644 index 11749ed2b3..0000000000 --- a/vendor/github.com/butuzov/mirror/.goreleaser.yaml +++ /dev/null @@ -1,61 +0,0 @@ ---- -project_name: mirror - -builds: - - binary: mirror - env: - - CGO_ENABLED=0 - goos: - - darwin - - linux - - windows - goarch: - - amd64 - - 386 - - arm64 - - arm - goarm: - - 6 - ignore: - - goos: windows - goarm: 6 - - goos: windows - goarch: arm64 - - goos: linux - goarm: 6 - - goos: darwin - goarch: 386 - main: ./cmd/mirror/ - flags: - - -trimpath - ldflags: -s -w - -checksum: - name_template: 'checksums.txt' - -changelog: - sort: asc - filters: - exclude: - - '(?i)^docs?:' - - '(?i)^docs\([^:]+\):' - - '(?i)^docs\[[^:]+\]:' - - '^tests?:' - - '(?i)^dev:' - - Merge pull request - - Merge branch - -archives: - - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' - replacements: - darwin: darwin - linux: linux - windows: windows - 386: i386 - amd64: x86_64 - format_overrides: - - goos: windows - format: zip - files: - - LICENSE - - readme.md diff --git a/vendor/github.com/butuzov/mirror/LICENSE b/vendor/github.com/butuzov/mirror/LICENSE deleted file mode 100644 index a9752e9726..0000000000 --- a/vendor/github.com/butuzov/mirror/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Oleg Butuzov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/butuzov/mirror/MIRROR_FUNCS.md b/vendor/github.com/butuzov/mirror/MIRROR_FUNCS.md deleted file mode 100644 index 776816e514..0000000000 --- a/vendor/github.com/butuzov/mirror/MIRROR_FUNCS.md +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
func (b *bufio.Writer) WriteString(s string) (int, error) - func (b *bufio.Writer) Write(p []byte) (int, error) - func (b *bufio.Writer) WriteRune(r rune) (int, error) -
func (b *bytes.Buffer) WriteString(s string) (int, error) - func (b *bytes.Buffer) Write(p []byte) (int, error) - func (b *bytes.Buffer) WriteRune(r rune) (int, error) -
func strings.Compare(a, b string) intfunc bytes.Compare(a, b []byte) int
func strings.Contains(s, substr string) boolfunc bytes.Contains(b, subslice []byte) bool
func strings.ContainsAny(s, chars string) boolfunc bytes.ContainsAny(b []byte, chars string) bool
func strings.ContainsRune(s string, r rune) boolfunc bytes.ContainsRune(b []byte, r rune) bool
func strings.Count(s, substr string) intfunc bytes.Count(s, sep []byte) int
func strings.EqualFold(s, t string) boolfunc bytes.EqualFold(s, t []byte) bool
func strings.HasPrefix(s, prefix string) boolfunc bytes.HasPrefix(s, prefix []byte) bool
func strings.HasSuffix(s, suffix string) boolfunc bytes.HasSuffix(s, suffix []byte) bool
func strings.Index(s, substr string) intfunc bytes.Index(s, sep []byte) int
func strings.IndexAny(s, chars string) intfunc bytes.IndexAny(s []byte, chars string) int
func strings.IndexByte(s string, c byte) intfunc bytes.IndexByte(b []byte, c byte) int
func strings.IndexFunc(s string, f func(rune) bool) intfunc bytes.IndexFunc(s []byte, f func(r rune) bool) int
func strings.IndexRune(s string, r rune) intfunc bytes.IndexRune(s []byte, r rune) int
func strings.LastIndex(s, sep string) intfunc bytes.LastIndex(s, sep []byte) int
func strings.LastIndexAny(s, chars string) intfunc bytes.LastIndexAny(s []byte, chars string) int
func strings.LastIndexByte(s string, c byte) intfunc bytes.LastIndexByte(s []byte, c byte) int
func strings.LastIndexFunc(s string, f func(rune) bool) intfunc bytes.LastIndexFunc(s []byte, f func(r rune) bool) int
func bytes.NewBufferString(s string) *bytes.Bufferfunc bytes.NewBuffer(buf []byte *bytes.Buffer
func (h *hash/maphash.Hash) WriteString(s string) (int, error)func (h *hash/maphash.Hash) Write(b []byte) (int, error)
func (rw *net/http/httptest.ResponseRecorder) WriteString(str string) (int, error)func (rw *net/http/httptest.ResponseRecorder) Write(buf []byte) (int, error)
func (f *os.File) WriteString(s string) (n int, err error)func (f *os.File) Write(b []byte) (n int, err error)
func regexp.MatchString(pattern string, s string) (bool, error)func regexp.Match(pattern string, b []byte) (bool, error)
func (re *regexp.Regexp) FindAllStringIndex(s string, n int) [][]intfunc (re *regexp.Regexp) FindAllIndex(b []byte, n int) [][]int
func (re *regexp.Regexp) FindAllStringSubmatch(s string, n int) [][]stringfunc (re *regexp.Regexp) FindAllSubmatch(b []byte, n int) [][][]byte
func (re *regexp.Regexp) FindStringIndex(s string) (loc []int)func (re *regexp.Regexp) FindIndex(b []byte) (loc []int)
func (re *regexp.Regexp) FindStringSubmatchIndex(s string) []intfunc (re *regexp.Regexp) FindSubmatchIndex(b []byte) []int
func (re *regexp.Regexp) MatchString(s string) boolfunc (re *regexp.Regexp) Match(b []byte) bool
func (b *strings.Builder) WriteString(s string) error - func (b *strings.Builder) Write(p []byte) (int, error) - func (b *strings.Builder) WriteRune(r rune) (int, error) -
func utf8.ValidString(s string) boolfunc utf8.Valid(p []byte) bool
func utf8.FullRuneInString(s string) boolfunc utf8.FullRune(p []byte) bool
func utf8.RuneCountInString(s string) (n int)func utf8.RuneCount(p []byte) int
func utf8.DecodeLastRuneInString(s string) (rune, int)func utf8.DecodeLastRune(p []byte) (rune, int)
func utf8.DecodeRuneInString(s string) (une, int)func utf8.DecodeRune(p []byte) (rune, int)
diff --git a/vendor/github.com/butuzov/mirror/Makefile b/vendor/github.com/butuzov/mirror/Makefile deleted file mode 100644 index b4b952b012..0000000000 --- a/vendor/github.com/butuzov/mirror/Makefile +++ /dev/null @@ -1,58 +0,0 @@ -# --- Required ---------------------------------------------------------------- -export PATH := $(PWD)/bin:$(PATH) # ./bin to $PATH -export SHELL := bash # Default Shell - -GOPKGS := $(shell go list ./... | grep -vE "(cmd|sandbox|testdata)" | tr -s '\n' ',' | sed 's/.\{1\}$$//' ) - - -build: - @ go build -trimpath -ldflags="-w -s" \ - -o bin/mirror ./cmd/mirror/ - -build-race: - @ go build -race -trimpath -ldflags="-w -s" \ - -o bin/mirror ./cmd/mirror/ - -tests: - go test -v -count=1 -race \ - -failfast \ - -parallel=2 \ - -timeout=1m \ - -covermode=atomic \ - -coverpkg=$(GOPKGS) -coverprofile=coverage.cov ./... - -tests-summary: - go test -v -count=1 -race \ - -failfast \ - -parallel=2 \ - -timeout=1m \ - -covermode=atomic \ - -coverpkg=$(GOPKGS) -coverprofile=coverage.cov --json ./... | tparse -all - -test-generate: - go run ./cmd/internal/generate-tests/ "$(PWD)/testdata" - -lints: - golangci-lint run --no-config ./... -D deadcode --skip-dirs "^(cmd|sandbox|testdata)" - - -cover: - go tool cover -html=coverage.cov - -install: - go install -trimpath -v -ldflags="-w -s" \ - ./cmd/mirror - -funcs: - echo "" > "out/results.txt" - go list std | grep -v "vendor" | grep -v "internal" | \ - xargs -I {} sh -c 'go doc -all {} > out/$(basename {}).txt' - -bin/goreleaser: - @curl -Ls https://github.com/goreleaser/goreleaser/releases/download/v1.17.2/goreleaser_Darwin_all.tar.gz | tar -zOxf - goreleaser > ./bin/goreleaser - chmod 0755 ./bin/goreleaser - -test-release: bin/goreleaser - goreleaser release --help - goreleaser release -f .goreleaser.yaml \ - --skip-validate --skip-publish --clean diff --git a/vendor/github.com/butuzov/mirror/Taskfile.yml b/vendor/github.com/butuzov/mirror/Taskfile.yml deleted file mode 100644 index 26c9ba2571..0000000000 --- a/vendor/github.com/butuzov/mirror/Taskfile.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3' - -tasks: - default: - sources: - - "./**/*.go" - method: timestamp - cmds: - - clear - - make build - - make build-race - - task: lints - # - make test-generate - - task: tests - - cmd: go run ./cmd/mirror/ --with-tests --with-debug ./sandbox - ignore_error: true - - testcase: go test -v -failfast -count=1 -run "TestAll/{{ .Case }}" ./... - - tests: - cmds: - - cmd: make tests - ignore_error: true - - lints: - cmds: - - cmd: make lints - ignore_error: true diff --git a/vendor/github.com/butuzov/mirror/analyzer.go b/vendor/github.com/butuzov/mirror/analyzer.go deleted file mode 100644 index 13ded46c6d..0000000000 --- a/vendor/github.com/butuzov/mirror/analyzer.go +++ /dev/null @@ -1,144 +0,0 @@ -package mirror - -import ( - "flag" - "go/ast" - "strings" - - "github.com/butuzov/mirror/internal/checker" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -func NewAnalyzer() *analysis.Analyzer { - flags := flags() - - return &analysis.Analyzer{ - Name: "mirror", - Doc: "reports wrong mirror patterns of bytes/strings usage", - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Flags: flags, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - withTests := pass.Analyzer.Flags.Lookup("with-tests").Value.String() == "true" - // --- Reporting violations via issues --------------------------------------- - for _, violation := range Run(pass, withTests) { - pass.Report(violation.Diagnostic(pass.Fset)) - } - - return nil, nil -} - -func Run(pass *analysis.Pass, withTests bool) []*checker.Violation { - violations := []*checker.Violation{} - // --- Setup ----------------------------------------------------------------- - - check := checker.New( - BytesFunctions, BytesBufferMethods, - RegexpFunctions, RegexpRegexpMethods, - StringFunctions, StringsBuilderMethods, - BufioMethods, HTTPTestMethods, - OsFileMethods, MaphashMethods, - UTF8Functions, - ) - - check.Type = checker.WrapType(pass.TypesInfo) - check.Print = checker.WrapPrint(pass.Fset) - - ins, _ := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - imports := checker.Load(pass.Fset, ins) - - // --- Preorder Checker ------------------------------------------------------ - ins.Preorder([]ast.Node{(*ast.CallExpr)(nil)}, func(n ast.Node) { - callExpr := n.(*ast.CallExpr) - fileName := pass.Fset.Position(callExpr.Pos()).Filename - - if !withTests && strings.HasSuffix(fileName, "_test.go") { - return - } - - // ------------------------------------------------------------------------- - switch expr := callExpr.Fun.(type) { - // NOTE(butuzov): Regular calls (`*ast.SelectorExpr`) like strings.HasPrefix - // or re.Match are handled by this check - case *ast.SelectorExpr: - - x, ok := expr.X.(*ast.Ident) - if !ok { - return - } - - // TODO(butuzov): Add check for the ast.ParenExpr in e.Fun so we can - // target the constructions like this (and other calls) - // ----------------------------------------------------------------------- - // Example: - // (&maphash.Hash{}).Write([]byte("foobar")) - // ----------------------------------------------------------------------- - - // Case 1: Is this is a function call? - pkgName, name := x.Name, expr.Sel.Name - if pkg, ok := imports.Lookup(fileName, pkgName); ok { - if v := check.Match(pkg, name); v != nil { - if args, found := check.Handle(v, callExpr); found { - violations = append(violations, v.With(check.Print(expr.X), callExpr, args)) - } - return - } - } - - // Case 2: Is this is a method call? - tv := pass.TypesInfo.Types[expr.X] - if !tv.IsValue() || tv.Type == nil { - return - } - - pkgStruct, name := cleanAsterisk(tv.Type.String()), expr.Sel.Name - for _, v := range check.Matches(pkgStruct, name) { - if v == nil { - continue - } - - if args, found := check.Handle(v, callExpr); found { - violations = append(violations, v.With(check.Print(expr.X), callExpr, args)) - return - } - } - - case *ast.Ident: - // NOTE(butuzov): Special case of "." imported packages, only functions. - - if pkg, ok := imports.Lookup(fileName, "."); ok { - if v := check.Match(pkg, expr.Name); v != nil { - if args, found := check.Handle(v, callExpr); found { - violations = append(violations, v.With(nil, callExpr, args)) - } - return - } - } - } - }) - - return violations -} - -func flags() flag.FlagSet { - set := flag.NewFlagSet("", flag.PanicOnError) - set.Bool("with-tests", false, "do not skip tests in reports") - set.Bool("with-debug", false, "debug linter run (development only)") - return *set -} - -func cleanAsterisk(s string) string { - if strings.HasPrefix(s, "*") { - return s[1:] - } - - return s -} diff --git a/vendor/github.com/butuzov/mirror/checkers_bufio.go b/vendor/github.com/butuzov/mirror/checkers_bufio.go deleted file mode 100644 index 292ed269aa..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_bufio.go +++ /dev/null @@ -1,56 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var BufioMethods = []checker.Violation{ - { // (*bufio.Writer).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "bufio", - Struct: "Writer", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `b := bufio.Writer{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*bufio.Writer).WriteString - Type: checker.Method, - Targets: checker.Strings, - Package: "bufio", - Struct: "Writer", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `b := bufio.Writer{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, - { // (*bufio.Writer).WriteString -> (*bufio.Writer).WriteRune - Targets: checker.Strings, - Type: checker.Method, - Package: "bufio", - Struct: "Writer", - Caller: "WriteString", - Args: []int{0}, - ArgsType: checker.Rune, - AltCaller: "WriteRune", - }, - // { // (*bufio.Writer).WriteString -> (*bufio.Writer).WriteByte - // Targets: checker.Strings, - // Type: checker.Method, - // Package: "strings", - // Struct: "Builder", - // Caller: "WriteString", - // Args: []int{0}, - // ArgsType: checker.Byte, - // AltCaller: "WriteByte", // byte - // }, -} diff --git a/vendor/github.com/butuzov/mirror/checkers_bytes.go b/vendor/github.com/butuzov/mirror/checkers_bytes.go deleted file mode 100644 index c490a3784e..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_bytes.go +++ /dev/null @@ -1,326 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var ( - BytesFunctions = []checker.Violation{ - { // bytes.NewBuffer - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "NewBuffer", - Args: []int{0}, - AltCaller: "NewBufferString", - - Generate: &checker.Generate{ - Pattern: `NewBuffer($0)`, - Returns: 1, - }, - }, - { // bytes.NewBufferString - Targets: checker.Strings, - Type: checker.Function, - Package: "bytes", - Caller: "NewBufferString", - Args: []int{0}, - AltCaller: "NewBuffer", - - Generate: &checker.Generate{ - Pattern: `NewBufferString($0)`, - Returns: 1, - }, - }, - { // bytes.Compare: - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "Compare", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "Compare", - - Generate: &checker.Generate{ - Pattern: `Compare($0, $1)`, - Returns: 1, - }, - }, - { // bytes.Contains: - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "Contains", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "Contains", - - Generate: &checker.Generate{ - Pattern: `Contains($0, $1)`, - Returns: 1, - }, - }, - { // bytes.ContainsAny - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "ContainsAny", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "ContainsAny", - - Generate: &checker.Generate{ - Pattern: `ContainsAny($0, "f")`, - Returns: 1, - }, - }, - { // bytes.ContainsRune - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "ContainsRune", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "ContainsRune", - - Generate: &checker.Generate{ - Pattern: `ContainsRune($0, 'ф')`, - Returns: 1, - }, - }, - { // bytes.Count - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "Count", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "Count", - - Generate: &checker.Generate{ - Pattern: `Count($0, $1)`, - Returns: 1, - }, - }, - { // bytes.EqualFold - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "EqualFold", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "EqualFold", - - Generate: &checker.Generate{ - Pattern: `EqualFold($0, $1)`, - Returns: 1, - }, - }, - - { // bytes.HasPrefix - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "HasPrefix", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "HasPrefix", - - Generate: &checker.Generate{ - Pattern: `HasPrefix($0, $1)`, - Returns: 1, - }, - }, - { // bytes.HasSuffix - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "HasSuffix", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "HasSuffix", - - Generate: &checker.Generate{ - Pattern: `HasSuffix($0, $1)`, - Returns: 1, - }, - }, - { // bytes.Index - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "Index", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "Index", - - Generate: &checker.Generate{ - Pattern: `Index($0, $1)`, - Returns: 1, - }, - }, - { // bytes.IndexAny - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "IndexAny", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "IndexAny", - - Generate: &checker.Generate{ - Pattern: `IndexAny($0, "f")`, - Returns: 1, - }, - }, - { // bytes.IndexByte - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "IndexByte", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "IndexByte", - - Generate: &checker.Generate{ - Pattern: `IndexByte($0, 'f')`, - Returns: 1, - }, - }, - { // bytes.IndexFunc - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "IndexFunc", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "IndexFunc", - - Generate: &checker.Generate{ - Pattern: `IndexFunc($0, func(rune) bool {return true })`, - Returns: 1, - }, - }, - { // bytes.IndexRune - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "IndexRune", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "IndexRune", - - Generate: &checker.Generate{ - Pattern: `IndexRune($0, rune('ф'))`, - Returns: 1, - }, - }, - { // bytes.LastIndex - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "LastIndex", - Args: []int{0, 1}, - AltPackage: "strings", - AltCaller: "LastIndex", - - Generate: &checker.Generate{ - Pattern: `LastIndex($0, $1)`, - Returns: 1, - }, - }, - { // bytes.LastIndexAny - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "LastIndexAny", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "LastIndexAny", - - Generate: &checker.Generate{ - Pattern: `LastIndexAny($0, "ф")`, - Returns: 1, - }, - }, - { // bytes.LastIndexByte - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "LastIndexByte", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "LastIndexByte", - - Generate: &checker.Generate{ - Pattern: `LastIndexByte($0, 'f')`, - Returns: 1, - }, - }, - { // bytes.LastIndexFunc - Targets: checker.Bytes, - Type: checker.Function, - Package: "bytes", - Caller: "LastIndexFunc", - Args: []int{0}, - AltPackage: "strings", - AltCaller: "LastIndexFunc", - - Generate: &checker.Generate{ - Pattern: `LastIndexFunc($0, func(rune) bool {return true })`, - Returns: 1, - }, - }, - } - - BytesBufferMethods = []checker.Violation{ - { // (*bytes.Buffer).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "bytes", - Struct: "Buffer", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `bb := bytes.Buffer{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*bytes.Buffer).WriteString - Targets: checker.Strings, - Type: checker.Method, - Package: "bytes", - Struct: "Buffer", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `bb := bytes.Buffer{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, - { // (*bytes.Buffer).WriteString -> (*bytes.Buffer).WriteRune - Targets: checker.Strings, - Type: checker.Method, - Package: "bytes", - Struct: "Buffer", - Caller: "WriteString", - Args: []int{0}, - ArgsType: checker.Rune, - AltCaller: "WriteRune", - }, - // { // (*bytes.Buffer).WriteString -> (*bytes.Buffer).WriteByte - // Targets: checker.Strings, - // Type: checker.Method, - // Package: "bytes", - // Struct: "Buffer", - // Caller: "WriteString", - // Args: []int{0}, - // ArgsType: checker.Byte, - // AltCaller: "WriteByte", - // }, - } -) diff --git a/vendor/github.com/butuzov/mirror/checkers_httptest.go b/vendor/github.com/butuzov/mirror/checkers_httptest.go deleted file mode 100644 index ae67509300..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_httptest.go +++ /dev/null @@ -1,36 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var HTTPTestMethods = []checker.Violation{ - { // (*net/http/httptest.ResponseRecorder).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "net/http/httptest", - Struct: "ResponseRecorder", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `h := httptest.ResponseRecorder{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*net/http/httptest.ResponseRecorder).WriteString - Targets: checker.Strings, - Type: checker.Method, - Package: "net/http/httptest", - Struct: "ResponseRecorder", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `h := httptest.ResponseRecorder{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, -} diff --git a/vendor/github.com/butuzov/mirror/checkers_maphash.go b/vendor/github.com/butuzov/mirror/checkers_maphash.go deleted file mode 100644 index 4d184d2a95..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_maphash.go +++ /dev/null @@ -1,36 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var MaphashMethods = []checker.Violation{ - { // (*hash/maphash).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "hash/maphash", - Struct: "Hash", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `h := maphash.Hash{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*hash/maphash).WriteString - Targets: checker.Strings, - Type: checker.Method, - Package: "hash/maphash", - Struct: "Hash", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `h := maphash.Hash{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, -} diff --git a/vendor/github.com/butuzov/mirror/checkers_os.go b/vendor/github.com/butuzov/mirror/checkers_os.go deleted file mode 100644 index 09f5a18e58..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_os.go +++ /dev/null @@ -1,36 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var OsFileMethods = []checker.Violation{ - { // (*os.File).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "os", - Struct: "File", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `f := &os.File{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*os.File).WriteString - Targets: checker.Strings, - Type: checker.Method, - Package: "os", - Struct: "File", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `f := &os.File{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, -} diff --git a/vendor/github.com/butuzov/mirror/checkers_regexp.go b/vendor/github.com/butuzov/mirror/checkers_regexp.go deleted file mode 100644 index 17175e0286..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_regexp.go +++ /dev/null @@ -1,187 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var ( - RegexpFunctions = []checker.Violation{ - { // regexp.Match - Targets: checker.Bytes, - Type: checker.Function, - Package: "regexp", - Caller: "Match", - Args: []int{1}, - AltCaller: "MatchString", - - Generate: &checker.Generate{ - Pattern: `Match("foo", $0)`, - Returns: 2, - }, - }, - { // regexp.MatchString - Targets: checker.Strings, - Type: checker.Function, - Package: "regexp", - Caller: "MatchString", - Args: []int{1}, - AltCaller: "Match", - - Generate: &checker.Generate{ - Pattern: `MatchString("foo", $0)`, - Returns: 2, - }, - }, - } - - RegexpRegexpMethods = []checker.Violation{ - { // (*regexp.Regexp).Match - Targets: checker.Bytes, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "Match", - Args: []int{0}, - AltCaller: "MatchString", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `Match($0)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).MatchString - Targets: checker.Strings, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "MatchString", - Args: []int{0}, - AltCaller: "Match", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `MatchString($0)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindAllIndex - Targets: checker.Bytes, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindAllIndex", - Args: []int{0}, - AltCaller: "FindAllStringIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindAllIndex($0, 1)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindAllStringIndex - Targets: checker.Strings, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindAllStringIndex", - Args: []int{0}, - AltCaller: "FindAllIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindAllStringIndex($0, 1)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindAllSubmatchIndex - Targets: checker.Bytes, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindAllSubmatchIndex", - Args: []int{0}, - AltCaller: "FindAllStringSubmatchIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindAllSubmatchIndex($0, 1)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindAllStringSubmatchIndex - Targets: checker.Strings, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindAllStringSubmatchIndex", - Args: []int{0}, - AltCaller: "FindAllSubmatchIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindAllStringSubmatchIndex($0, 1)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindIndex - Targets: checker.Bytes, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindIndex", - Args: []int{0}, - AltCaller: "FindStringIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindIndex($0)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindStringIndex - Targets: checker.Strings, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindStringIndex", - Args: []int{0}, - AltCaller: "FindIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindStringIndex($0)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindSubmatchIndex - Targets: checker.Bytes, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindSubmatchIndex", - Args: []int{0}, - AltCaller: "FindStringSubmatchIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindSubmatchIndex($0)`, - Returns: 1, - }, - }, - { // (*regexp.Regexp).FindStringSubmatchIndex - Targets: checker.Strings, - Type: checker.Method, - Package: "regexp", - Struct: "Regexp", - Caller: "FindStringSubmatchIndex", - Args: []int{0}, - AltCaller: "FindSubmatchIndex", - - Generate: &checker.Generate{ - PreCondition: `re := regexp.MustCompile(".*")`, - Pattern: `FindStringSubmatchIndex($0)`, - Returns: 1, - }, - }, - } -) diff --git a/vendor/github.com/butuzov/mirror/checkers_strings.go b/vendor/github.com/butuzov/mirror/checkers_strings.go deleted file mode 100644 index ead7e9cc7e..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_strings.go +++ /dev/null @@ -1,299 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var ( - StringFunctions = []checker.Violation{ - { // strings.Compare - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "Compare", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "Compare", - - Generate: &checker.Generate{ - Pattern: `Compare($0,$1)`, - Returns: 1, - }, - }, - { // strings.Contains - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "Contains", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "Contains", - - Generate: &checker.Generate{ - Pattern: `Contains($0,$1)`, - Returns: 1, - }, - }, - { // strings.ContainsAny - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "ContainsAny", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "ContainsAny", - - Generate: &checker.Generate{ - Pattern: `ContainsAny($0,"foobar")`, - Returns: 1, - }, - }, - { // strings.ContainsRune - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "ContainsRune", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "ContainsRune", - - Generate: &checker.Generate{ - Pattern: `ContainsRune($0,'ф')`, - Returns: 1, - }, - }, - { // strings.Count - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "Count", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "Count", - - Generate: &checker.Generate{ - Pattern: `Count($0, $1)`, - Returns: 1, - }, - }, - { // strings.EqualFold - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "EqualFold", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "EqualFold", - - Generate: &checker.Generate{ - Pattern: `EqualFold($0,$1)`, - Returns: 1, - }, - }, - { // strings.HasPrefix - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "HasPrefix", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "HasPrefix", - - Generate: &checker.Generate{ - Pattern: `HasPrefix($0,$1)`, - Returns: 1, - }, - }, - { // strings.HasSuffix - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "HasSuffix", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "HasSuffix", - - Generate: &checker.Generate{ - Pattern: `HasSuffix($0,$1)`, - Returns: 1, - }, - }, - { // strings.Index - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "Index", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "Index", - - Generate: &checker.Generate{ - Pattern: `Index($0,$1)`, - Returns: 1, - }, - }, - { // strings.IndexAny - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "IndexAny", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "IndexAny", - - Generate: &checker.Generate{ - Pattern: `IndexAny($0, "f")`, - Returns: 1, - }, - }, - { // strings.IndexByte - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "IndexByte", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "IndexByte", - - Generate: &checker.Generate{ - Pattern: `IndexByte($0, byte('f'))`, - Returns: 1, - }, - }, - { // strings.IndexFunc - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "IndexFunc", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "IndexFunc", - - Generate: &checker.Generate{ - Pattern: `IndexFunc($0,func(r rune) bool { return true })`, - Returns: 1, - }, - }, - { // strings.IndexRune - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "IndexRune", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "IndexRune", - - Generate: &checker.Generate{ - Pattern: `IndexRune($0, rune('ф'))`, - Returns: 1, - }, - }, - { // strings.LastIndex - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "LastIndex", - Args: []int{0, 1}, - AltPackage: "bytes", - AltCaller: "LastIndex", - - Generate: &checker.Generate{ - Pattern: `LastIndex($0,$1)`, - Returns: 1, - }, - }, - { // strings.LastIndexAny - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "LastIndexAny", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "LastIndexAny", - - Generate: &checker.Generate{ - Pattern: `LastIndexAny($0,"f")`, - Returns: 1, - }, - }, - { // strings.LastIndexByte - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "LastIndexByte", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "LastIndexByte", - - Generate: &checker.Generate{ - Pattern: `LastIndexByte($0, byte('f'))`, - Returns: 1, - }, - }, - { // strings.LastIndexFunc - Targets: checker.Strings, - Type: checker.Function, - Package: "strings", - Caller: "LastIndexFunc", - Args: []int{0}, - AltPackage: "bytes", - AltCaller: "LastIndexFunc", - - Generate: &checker.Generate{ - Pattern: `LastIndexFunc($0, func(r rune) bool { return true })`, - Returns: 1, - }, - }, - } - - StringsBuilderMethods = []checker.Violation{ - { // (*strings.Builder).Write - Targets: checker.Bytes, - Type: checker.Method, - Package: "strings", - Struct: "Builder", - Caller: "Write", - Args: []int{0}, - AltCaller: "WriteString", - - Generate: &checker.Generate{ - PreCondition: `builder := strings.Builder{}`, - Pattern: `Write($0)`, - Returns: 2, - }, - }, - { // (*strings.Builder).WriteString - Targets: checker.Strings, - Type: checker.Method, - Package: "strings", - Struct: "Builder", - Caller: "WriteString", - Args: []int{0}, - AltCaller: "Write", - - Generate: &checker.Generate{ - PreCondition: `builder := strings.Builder{}`, - Pattern: `WriteString($0)`, - Returns: 2, - }, - }, - { // (*strings.Builder).WriteString -> (*strings.Builder).WriteRune - Targets: checker.Strings, - Type: checker.Method, - Package: "strings", - Struct: "Builder", - Caller: "WriteString", - Args: []int{0}, - ArgsType: checker.Rune, - AltCaller: "WriteRune", - }, - // { // (*strings.Builder).WriteString -> (*strings.Builder).WriteByte - // Targets: checker.Strings, - // Type: checker.Method, - // Package: "strings", - // Struct: "Builder", - // Caller: "WriteString", - // Args: []int{0}, - // ArgsType: checker.Byte, - // AltCaller: "WriteByte", // byte - // }, - } -) diff --git a/vendor/github.com/butuzov/mirror/checkers_utf8.go b/vendor/github.com/butuzov/mirror/checkers_utf8.go deleted file mode 100644 index e7c4d5ba4d..0000000000 --- a/vendor/github.com/butuzov/mirror/checkers_utf8.go +++ /dev/null @@ -1,138 +0,0 @@ -package mirror - -import "github.com/butuzov/mirror/internal/checker" - -var UTF8Functions = []checker.Violation{ - { // utf8.Valid - Type: checker.Function, - Targets: checker.Bytes, - Package: "unicode/utf8", - Caller: "Valid", - Args: []int{0}, - AltCaller: "ValidString", - - Generate: &checker.Generate{ - Pattern: `Valid($0)`, - Returns: 1, - }, - }, - { // utf8.ValidString - Targets: checker.Strings, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "ValidString", - Args: []int{0}, - AltCaller: "Valid", - - Generate: &checker.Generate{ - Pattern: `ValidString($0)`, - Returns: 1, - }, - }, - { // utf8.FullRune - Targets: checker.Bytes, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "FullRune", - Args: []int{0}, - AltCaller: "FullRuneInString", - - Generate: &checker.Generate{ - Pattern: `FullRune($0)`, - Returns: 1, - }, - }, - { // utf8.FullRuneInString - Targets: checker.Strings, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "FullRuneInString", - Args: []int{0}, - AltCaller: "FullRune", - - Generate: &checker.Generate{ - Pattern: `FullRuneInString($0)`, - Returns: 1, - }, - }, - - { // bytes.RuneCount - Targets: checker.Bytes, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "RuneCount", - Args: []int{0}, - AltCaller: "RuneCountInString", - - Generate: &checker.Generate{ - Pattern: `RuneCount($0)`, - Returns: 1, - }, - }, - { // bytes.RuneCountInString - Targets: checker.Strings, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "RuneCountInString", - Args: []int{0}, - AltCaller: "RuneCount", - - Generate: &checker.Generate{ - Pattern: `RuneCountInString($0)`, - Returns: 1, - }, - }, - - { // bytes.DecodeLastRune - Targets: checker.Bytes, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "DecodeLastRune", - Args: []int{0}, - AltCaller: "DecodeLastRuneInString", - - Generate: &checker.Generate{ - Pattern: `DecodeLastRune($0)`, - Returns: 2, - }, - }, - { // utf8.DecodeLastRuneInString - Targets: checker.Strings, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "DecodeLastRuneInString", - Args: []int{0}, - AltCaller: "DecodeLastRune", - - Generate: &checker.Generate{ - Pattern: `DecodeLastRuneInString($0)`, - Returns: 2, - }, - }, - { // utf8.DecodeRune - Targets: checker.Bytes, - Type: checker.Function, - Package: "unicode/utf8", - Caller: "DecodeRune", - Args: []int{0}, - AltCaller: "DecodeRuneInString", - - Generate: &checker.Generate{ - Pattern: `DecodeRune($0)`, - Returns: 2, - }, - }, - { // utf8.DecodeRuneInString - Targets: checker.Strings, - Type: checker.Function, - Package: "unicode/utf8", - Args: []int{0}, - Caller: "DecodeRuneInString", - AltCaller: "DecodeRune", - - Generate: &checker.Generate{ - Pattern: `DecodeRuneInString($0)`, - Returns: 2, - }, - }, -} diff --git a/vendor/github.com/butuzov/mirror/internal/checker/checker.go b/vendor/github.com/butuzov/mirror/internal/checker/checker.go deleted file mode 100644 index c1a9416314..0000000000 --- a/vendor/github.com/butuzov/mirror/internal/checker/checker.go +++ /dev/null @@ -1,147 +0,0 @@ -package checker - -import ( - "bytes" - "go/ast" - "go/printer" - "go/token" - "go/types" - "strings" -) - -// Checker will perform standart check on package and its methods. -type Checker struct { - Violations []Violation // List of available violations - Packages map[string][]int // Storing indexes of Violations per pkg/kg.Struct - Type func(ast.Expr) string // Type Checker closure. - Print func(ast.Node) []byte // String representation of the expresion. -} - -func New(violations ...[]Violation) Checker { - c := Checker{ - Packages: make(map[string][]int), - } - - for i := range violations { - c.register(violations[i]) - } - - return c -} - -// Match will check the available violations we got from checks against -// the `name` caller from package `pkgName`. -func (c *Checker) Match(pkgName, name string) *Violation { - for _, v := range c.Matches(pkgName, name) { - return v - } - - return nil -} - -// Matches do same thing as Match but return a slice of violations -// as only things that require this are bytes.Buffer and strings.Builder -// it only be used in matching methods in analyzer. -func (c *Checker) Matches(pkgName, name string) []*Violation { - var matches []*Violation - checkStruct := strings.Contains(pkgName, ".") - - for _, idx := range c.Packages[pkgName] { - if c.Violations[idx].Caller == name { - if checkStruct == (len(c.Violations[idx].Struct) == 0) { - continue - } - - // copy violation - v := c.Violations[idx] - matches = append(matches, &v) - } - } - - return matches -} - -func (c *Checker) Handle(v *Violation, ce *ast.CallExpr) (map[int]ast.Expr, bool) { - m := map[int]ast.Expr{} - - // We going to check each of elements we mark for checking, in order to find, - // a call that violates our rules. - for _, i := range v.Args { - if i >= len(ce.Args) { - continue - } - - call, ok := ce.Args[i].(*ast.CallExpr) - if !ok { - continue - } - - // is it convertsion call - if !c.callConverts(call) { - continue - } - - // somehow no argument of call - if len(call.Args) == 0 { - continue - } - - // wrong argument type - if normalType(c.Type(call.Args[0])) != v.getArgType() { - continue - } - - m[i] = call.Args[0] - } - - return m, len(m) == len(v.Args) -} - -func (c *Checker) callConverts(ce *ast.CallExpr) bool { - switch ce.Fun.(type) { - case *ast.ArrayType, *ast.Ident: - res := c.Type(ce.Fun) - return res == "[]byte" || res == "string" - } - - return false -} - -// register violations. -func (c *Checker) register(violations []Violation) { - for _, v := range violations { // nolint: gocritic - c.Violations = append(c.Violations, v) - if len(v.Struct) > 0 { - c.registerIdxPer(v.Package + "." + v.Struct) - } - c.registerIdxPer(v.Package) - } -} - -// registerIdxPer will register last added violation element -// under pkg string. -func (c *Checker) registerIdxPer(pkg string) { - c.Packages[pkg] = append(c.Packages[pkg], len(c.Violations)-1) -} - -func WrapType(info *types.Info) func(node ast.Expr) string { - return func(node ast.Expr) string { - if t := info.TypeOf(node); t != nil { - return t.String() - } - - if tv, ok := info.Types[node]; ok { - return tv.Type.Underlying().String() - } - - return "" - } -} - -func WrapPrint(fSet *token.FileSet) func(ast.Node) []byte { - return func(node ast.Node) []byte { - var buf bytes.Buffer - printer.Fprint(&buf, fSet, node) - return buf.Bytes() - } -} diff --git a/vendor/github.com/butuzov/mirror/internal/checker/imports.go b/vendor/github.com/butuzov/mirror/internal/checker/imports.go deleted file mode 100644 index 4015de5970..0000000000 --- a/vendor/github.com/butuzov/mirror/internal/checker/imports.go +++ /dev/null @@ -1,89 +0,0 @@ -package checker - -import ( - "go/ast" - "go/token" - "path" - "sort" - "strings" - "sync" - - "golang.org/x/tools/go/ast/inspector" -) - -// Imports represents an imported package in a nice for lookup way... -// -// examples: -// import . "bytes" -> checker.Import{Pkg:"bytes", Val:"."} -// import name "bytes" -> checker.Import{Pkg:"bytes", Val:"name"} -type Import struct { - Pkg string // package name - Name string // alias -} - -type Imports map[string][]Import - -// we are going to have Imports entries to be sorted, but if it has less then -// `sortLowerLimit` elements we are skipping this step as its not going to -// be worth of effort. -const sortLowerLimit int = 13 - -// Package level lock is to prevent import map corruption -var lock sync.RWMutex - -func Load(fs *token.FileSet, ins *inspector.Inspector) Imports { - lock.Lock() - defer lock.Unlock() - - imports := make(Imports) - - // Populate imports map - ins.Preorder([]ast.Node{(*ast.ImportSpec)(nil)}, func(node ast.Node) { - importSpec, _ := node.(*ast.ImportSpec) - - var ( - key = fs.Position(node.Pos()).Filename - pkg = strings.Trim(importSpec.Path.Value, `"`) - name = importSpec.Name.String() - ) - - if importSpec.Name == nil { - name = path.Base(pkg) // note: we need only basename of the package - } - - imports[key] = append(imports[key], Import{ - Pkg: pkg, - Name: name, - }) - }) - - imports.sort() - - return imports -} - -// sort will sort imports for each of the checking files. -func (i *Imports) sort() { - for k := range *i { - if len((*i)[k]) < sortLowerLimit { - continue - } - - k := k - sort.Slice((*i)[k], func(left, right int) bool { - return (*i)[k][left].Name < (*i)[k][right].Name - }) - } -} - -func (i Imports) Lookup(file, pkg string) (string, bool) { - if _, ok := i[file]; ok { - for idx := range i[file] { - if i[file][idx].Name == pkg { - return i[file][idx].Pkg, true - } - } - } - - return "", false -} diff --git a/vendor/github.com/butuzov/mirror/internal/checker/violation.go b/vendor/github.com/butuzov/mirror/internal/checker/violation.go deleted file mode 100644 index 375d3c8e65..0000000000 --- a/vendor/github.com/butuzov/mirror/internal/checker/violation.go +++ /dev/null @@ -1,208 +0,0 @@ -package checker - -import ( - "bytes" - "fmt" - "go/ast" - "go/printer" - "go/token" - "path" - "strings" - - "golang.org/x/tools/go/analysis" -) - -// Type of violation: can be method or function -type ViolationType int - -const ( - Function ViolationType = iota + 1 - Method -) - -const ( - Strings string = "string" - Bytes string = "[]byte" - Byte string = "byte" - Rune string = "rune" - UntypedRune string = "untyped rune" -) - -// Violation describs what message we going to give to a particular code violation -type Violation struct { - Type ViolationType // - Args []int // Indexes of the arguments needs to be checked - ArgsType string - - Targets string - Package string - AltPackage string - Struct string - Caller string - AltCaller string - - // --- tests generation information - Generate *Generate - - // --- suggestions related info about violation of rules. - base []byte // receiver of the method or pkg name - callExpr *ast.CallExpr // actual call expression, to extract arguments - arguments map[int]ast.Expr // fixed arguments -} - -// Tests (generation) related struct. -type Generate struct { - PreCondition string // Precondition we want to be generated - Pattern string // Generate pattern (for the `want` message) - Returns int // Expected to return n elements -} - -func (v *Violation) With(base []byte, e *ast.CallExpr, args map[int]ast.Expr) *Violation { - v.base = base - v.callExpr = e - v.arguments = args - - return v -} - -func (v *Violation) getArgType() string { - if v.ArgsType != "" { - return v.ArgsType - } - - if v.Targets == Strings { - return Bytes - } - - return Strings -} - -func (v *Violation) Message() string { - if v.Type == Method { - return fmt.Sprintf("avoid allocations with (*%s.%s).%s", - path.Base(v.Package), v.Struct, v.AltCaller) - } - - pkg := v.Package - if len(v.AltPackage) > 0 { - pkg = v.AltPackage - } - - return fmt.Sprintf("avoid allocations with %s.%s", path.Base(pkg), v.AltCaller) -} - -func (v *Violation) suggest(fSet *token.FileSet) []byte { - var buf bytes.Buffer - - if len(v.base) > 0 { - buf.Write(v.base) - buf.WriteString(".") - } - - buf.WriteString(v.AltCaller) - buf.WriteByte('(') - for idx := range v.callExpr.Args { - if arg, ok := v.arguments[idx]; ok { - printer.Fprint(&buf, fSet, arg) - } else { - printer.Fprint(&buf, fSet, v.callExpr.Args[idx]) - } - - if idx != len(v.callExpr.Args)-1 { - buf.WriteString(", ") - } - } - buf.WriteByte(')') - - return buf.Bytes() -} - -func (v *Violation) Diagnostic(fSet *token.FileSet) analysis.Diagnostic { - diagnostic := analysis.Diagnostic{ - Pos: v.callExpr.Pos(), - End: v.callExpr.Pos(), - Message: v.Message(), - } - - var buf bytes.Buffer - printer.Fprint(&buf, fSet, v.callExpr) - noNl := bytes.IndexByte(buf.Bytes(), '\n') < 0 - - // Struct based fix. - if v.Type == Method && noNl { - diagnostic.SuggestedFixes = []analysis.SuggestedFix{{ - Message: "Fix Issue With", - TextEdits: []analysis.TextEdit{{ - Pos: v.callExpr.Pos(), End: v.callExpr.End(), NewText: v.suggest(fSet), - }}, - }} - } - - if v.AltPackage == "" { - v.AltPackage = v.Package - } - - // Hooray! we dont need to change package and redo imports. - if v.Type == Function && v.AltPackage == v.Package && noNl { - diagnostic.SuggestedFixes = []analysis.SuggestedFix{{ - Message: "Fix Issue With", - TextEdits: []analysis.TextEdit{{ - Pos: v.callExpr.Pos(), End: v.callExpr.End(), NewText: v.suggest(fSet), - }}, - }} - } - - // do not change - - return diagnostic -} - -type GolangIssue struct { - Start token.Position - End token.Position - Message string - InlineFix string - Original string -} - -// Issue inteanded to be used only with golangci-lint, bu you can use use it -// alongside Diagnostic if you wish. -func (v *Violation) Issue(fSet *token.FileSet) GolangIssue { - issue := GolangIssue{ - Start: fSet.Position(v.callExpr.Pos()), - End: fSet.Position(v.callExpr.End()), - Message: v.Message(), - } - - // original expression (useful for debug & requied for replace) - var buf bytes.Buffer - printer.Fprint(&buf, fSet, v.callExpr) - issue.Original = buf.String() - - noNl := strings.IndexByte(issue.Original, '\n') < 0 - - if v.Type == Method && noNl { - fix := v.suggest(fSet) - issue.InlineFix = string(fix) - } - - if v.AltPackage == "" { - v.AltPackage = v.Package - } - - // Hooray! we don't need to change package and redo imports. - if v.Type == Function && v.AltPackage == v.Package && noNl { - fix := v.suggest(fSet) - issue.InlineFix = string(fix) - } - - return issue -} - -// ofType normalize input types (mostly typed and untyped runes). -func normalType(s string) string { - if s == UntypedRune { - return Rune - } - return s -} diff --git a/vendor/github.com/butuzov/mirror/readme.md b/vendor/github.com/butuzov/mirror/readme.md deleted file mode 100644 index fcfd1de11a..0000000000 --- a/vendor/github.com/butuzov/mirror/readme.md +++ /dev/null @@ -1,60 +0,0 @@ -# `mirror` [![Code Coverage](https://coveralls.io/repos/github/butuzov/mirror/badge.svg?branch=main)](https://coveralls.io/github/butuzov/mirror?branch=main) [![build status](https://github.com/butuzov/mirror/actions/workflows/main.yaml/badge.svg?branch=main)]() - -`mirror` suggests use of alternative functions/methods in order to gain performance boosts by avoiding unnecessary `[]byte/string` conversion calls. See [MIRROR_FUNCS.md](MIRROR_FUNCS.md) list of mirror functions you can use in go's stdlib. - -## 🇺🇦 PLEASE HELP ME 🇺🇦 -Fundrise for scout drone **DJI Matrice 30T** for my squad (Ukrainian Forces). See more details at [butuzov/README.md](https://github.com/butuzov/butuzov/) - -## Linter Use Cases - -### `github.com/argoproj/argo-cd` - -```go -// Before -func IsValidHostname(hostname string, fqdn bool) bool { - if !fqdn { - return validHostNameRegexp.Match([]byte(hostname)) || validIPv6Regexp.Match([]byte(hostname)) - } else { - return validFQDNRegexp.Match([]byte(hostname)) - } -} - -// After: With alternative method (and lost `else` case) -func IsValidHostname(hostname string, fqdn bool) bool { - if !fqdn { - return validHostNameRegexp.MatchString(hostname) || validIPv6Regexp.MatchString(hostname) - } - - return validFQDNRegexp.MatchString(hostname) -} -``` - -## Install - -``` -go install github.com/butuzov/mirror/cmd/mirror@latest -``` - -## How to use - -You run `mirror` with [`go vet`](https://pkg.go.dev/cmd/vet): - -``` -go vet -vettool=$(which mirror) ./... -# github.com/jcmoraisjr/haproxy-ingress/pkg/common/net/ssl -pkg/common/net/ssl/ssl.go:64:11: avoid allocations with (*os.File).WriteString -pkg/common/net/ssl/ssl.go:161:12: avoid allocations with (*os.File).WriteString -pkg/common/net/ssl/ssl.go:166:3: avoid allocations with (*os.File).WriteString -``` - -Can be called directly: -``` -mirror ./... -# https://github.com/cosmtrek/air -/air/runner/util.go:149:6: avoid allocations with (*regexp.Regexp).MatchString -/air/runner/util.go:173:14: avoid allocations with (*os.File).WriteString -``` - -## Command line - -- You can add checks for `_test.go` files with cli option `--with-tests` diff --git a/vendor/github.com/caarlos0/go-version/.gitignore b/vendor/github.com/caarlos0/go-version/.gitignore deleted file mode 100644 index 6fad1a4aac..0000000000 --- a/vendor/github.com/caarlos0/go-version/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -coverage.txt -dist diff --git a/vendor/github.com/caarlos0/go-version/.goreleaser.yml b/vendor/github.com/caarlos0/go-version/.goreleaser.yml deleted file mode 100644 index 4688983c27..0000000000 --- a/vendor/github.com/caarlos0/go-version/.goreleaser.yml +++ /dev/null @@ -1,3 +0,0 @@ -includes: - - from_url: - url: https://raw.githubusercontent.com/caarlos0/.goreleaserfiles/main/lib.yml diff --git a/vendor/github.com/caarlos0/go-version/LICENSE.md b/vendor/github.com/caarlos0/go-version/LICENSE.md deleted file mode 100644 index ca875aa877..0000000000 --- a/vendor/github.com/caarlos0/go-version/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/github.com/caarlos0/go-version/README.md b/vendor/github.com/caarlos0/go-version/README.md deleted file mode 100644 index 389bfff984..0000000000 --- a/vendor/github.com/caarlos0/go-version/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# go-version - -This package is extracted from -[`sigs.k8s.io/release-utils`](https://github.com/kubernetes-sigs/release-utils). - -There were a couple of subtle changes made, so it has 0 dependencies and can be -used with anything. - -Credits goes to the Kubernetes Authors. - -## Changes - -Full list of changes from the original library: - -- drop all dependencies: - - use std testing only - - allow to pass a previously generated ASCII art instead of generating it - at runtime -- optional overrides: - - caller can pass one or more functions that change the version info, so - callers are free to use whatever methods they want to provide some options - - a range of functions are provided by the library -- added more fields: - - `URL` - - `BuiltBy` -- testing - - added more tests, hopefully preventing breaking changes in the future diff --git a/vendor/github.com/caarlos0/go-version/version.go b/vendor/github.com/caarlos0/go-version/version.go deleted file mode 100644 index eb22eac242..0000000000 --- a/vendor/github.com/caarlos0/go-version/version.go +++ /dev/null @@ -1,206 +0,0 @@ -/* -Copyright 2022 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package goversion - -import ( - "encoding/json" - "fmt" - "runtime" - "runtime/debug" - "strings" - "text/tabwriter" - "time" -) - -const unknown = "unknown" - -// Info provides the version info. -type Info struct { - GitVersion string `json:"gitVersion"` - ModuleSum string `json:"moduleCheksum"` - GitCommit string `json:"gitCommit"` - GitTreeState string `json:"gitTreeState"` - BuildDate string `json:"buildDate"` - BuiltBy string `json:"builtBy"` - GoVersion string `json:"goVersion"` - Compiler string `json:"compiler"` - Platform string `json:"platform"` - - ASCIIName string `json:"-"` - Name string `json:"-"` - Description string `json:"-"` - URL string `json:"-"` -} - -func getBuildInfo() *debug.BuildInfo { - bi, ok := debug.ReadBuildInfo() - if !ok { - return nil - } - return bi -} - -func getGitVersion(bi *debug.BuildInfo) string { - if bi == nil { - return "" - } - - // TODO: remove this when the issue https://github.com/golang/go/issues/29228 is fixed - if bi.Main.Version == "(devel)" || bi.Main.Version == "" { - return "" - } - - return bi.Main.Version -} - -func getCommit(bi *debug.BuildInfo) string { - return getKey(bi, "vcs.revision") -} - -func getDirty(bi *debug.BuildInfo) string { - modified := getKey(bi, "vcs.modified") - if modified == "true" { - return "dirty" - } - if modified == "false" { - return "clean" - } - return "" -} - -func getBuildDate(bi *debug.BuildInfo) string { - buildTime := getKey(bi, "vcs.time") - t, err := time.Parse("2006-01-02T15:04:05Z", buildTime) - if err != nil { - return "" - } - return t.Format("2006-01-02T15:04:05") -} - -func getKey(bi *debug.BuildInfo, key string) string { - if bi == nil { - return "" - } - for _, iter := range bi.Settings { - if iter.Key == key { - return iter.Value - } - } - return "" -} - -func firstNonEmpty(ss ...string) string { - for _, s := range ss { - if s != "" { - return s - } - } - return "" -} - -// Option can be used to customize the version after its gathered from the -// environment. -type Option func(i *Info) - -// WithAppDetails allows to set the app name and description. -func WithAppDetails(name, description, url string) Option { - return func(i *Info) { - i.Name = name - i.Description = description - i.URL = url - } -} - -// WithASCIIName allows you to add an ASCII art of the name. -func WithASCIIName(name string) Option { - return func(i *Info) { - i.ASCIIName = name - } -} - -// WithBuiltBy allows to set the builder name/builder system name. -func WithBuiltBy(name string) Option { - return func(i *Info) { - i.BuiltBy = name - } -} - -// TODO: write more WithXXX functions? - -// GetVersionInfo represents known information on how this binary was built. -func GetVersionInfo(options ...Option) Info { - buildInfo := getBuildInfo() - i := Info{ - GitVersion: firstNonEmpty(getGitVersion(buildInfo), "devel"), - ModuleSum: firstNonEmpty(buildInfo.Main.Sum, unknown), - GitCommit: firstNonEmpty(getCommit(buildInfo), unknown), - GitTreeState: firstNonEmpty(getDirty(buildInfo), unknown), - BuildDate: firstNonEmpty(getBuildDate(buildInfo), unknown), - BuiltBy: unknown, - GoVersion: runtime.Version(), - Compiler: runtime.Compiler, - Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), - } - for _, opt := range options { - opt(&i) - } - return i -} - -// String returns the string representation of the version info -func (i Info) String() string { - b := strings.Builder{} - w := tabwriter.NewWriter(&b, 0, 0, 2, ' ', 0) - - // name and description are optional. - if i.Name != "" { - if i.ASCIIName != "" { - _, _ = fmt.Fprint(w, i.ASCIIName) - } - _, _ = fmt.Fprint(w, i.Name) - if i.Description != "" { - _, _ = fmt.Fprintf(w, ": %s", i.Description) - } - if i.URL != "" { - _, _ = fmt.Fprintf(w, "\n%s", i.URL) - } - _, _ = fmt.Fprint(w, "\n\n") - } - - _, _ = fmt.Fprintf(w, "GitVersion:\t%s\n", i.GitVersion) - _, _ = fmt.Fprintf(w, "GitCommit:\t%s\n", i.GitCommit) - _, _ = fmt.Fprintf(w, "GitTreeState:\t%s\n", i.GitTreeState) - _, _ = fmt.Fprintf(w, "BuildDate:\t%s\n", i.BuildDate) - _, _ = fmt.Fprintf(w, "BuiltBy:\t%s\n", i.BuiltBy) - _, _ = fmt.Fprintf(w, "GoVersion:\t%s\n", i.GoVersion) - _, _ = fmt.Fprintf(w, "Compiler:\t%s\n", i.Compiler) - _, _ = fmt.Fprintf(w, "ModuleSum:\t%s\n", i.ModuleSum) - _, _ = fmt.Fprintf(w, "Platform:\t%s\n", i.Platform) - - _ = w.Flush() - return b.String() -} - -// JSONString returns the JSON representation of the version info -func (i *Info) JSONString() (string, error) { - b, err := json.MarshalIndent(i, "", " ") - if err != nil { - return "", err - } - - return string(b), nil -} diff --git a/vendor/github.com/catenacyber/perfsprint/LICENSE b/vendor/github.com/catenacyber/perfsprint/LICENSE deleted file mode 100644 index 14c2b9e737..0000000000 --- a/vendor/github.com/catenacyber/perfsprint/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Catena cyber - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go b/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go deleted file mode 100644 index 2e93d04be3..0000000000 --- a/vendor/github.com/catenacyber/perfsprint/analyzer/analyzer.go +++ /dev/null @@ -1,594 +0,0 @@ -package analyzer - -import ( - "bytes" - "go/ast" - "go/format" - "go/token" - "go/types" - "sort" - "strconv" - "strings" - - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "golang.org/x/tools/go/analysis" -) - -type perfSprint struct { - intConv bool - errError bool - errorf bool - sprintf1 bool -} - -func newPerfSprint() *perfSprint { - return &perfSprint{ - intConv: true, - errError: false, - errorf: true, - sprintf1: true, - } -} - -func New() *analysis.Analyzer { - n := newPerfSprint() - r := &analysis.Analyzer{ - Name: "perfsprint", - Doc: "Checks that fmt.Sprintf can be replaced with a faster alternative.", - Run: n.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } - r.Flags.BoolVar(&n.intConv, "int-conversion", true, "optimizes even if it requires an int or uint type cast") - r.Flags.BoolVar(&n.errError, "err-error", false, "optimizes into err.Error() even if it is only equivalent for non-nil errors") - r.Flags.BoolVar(&n.errorf, "errorf", true, "optimizes fmt.Errorf") - r.Flags.BoolVar(&n.sprintf1, "sprintf1", true, "optimizes fmt.Sprintf with only one argument") - return r -} - -// true if verb is a format string that could be replaced with concatenation. -func isConcatable(verb string) bool { - hasPrefix := - (strings.HasPrefix(verb, "%s") && !strings.Contains(verb, "%[1]s")) || - (strings.HasPrefix(verb, "%[1]s") && !strings.Contains(verb, "%s")) - hasSuffix := - (strings.HasSuffix(verb, "%s") && !strings.Contains(verb, "%[1]s")) || - (strings.HasSuffix(verb, "%[1]s") && !strings.Contains(verb, "%s")) - - return (hasPrefix || hasSuffix) && !(hasPrefix && hasSuffix) -} - -func (n *perfSprint) run(pass *analysis.Pass) (interface{}, error) { - var fmtSprintObj, fmtSprintfObj, fmtErrorfObj types.Object - for _, pkg := range pass.Pkg.Imports() { - if pkg.Path() == "fmt" { - fmtSprintObj = pkg.Scope().Lookup("Sprint") - fmtSprintfObj = pkg.Scope().Lookup("Sprintf") - fmtErrorfObj = pkg.Scope().Lookup("Errorf") - } - } - if fmtSprintfObj == nil && fmtSprintObj == nil && fmtErrorfObj == nil { - return nil, nil - } - removedFmtUsages := make(map[string]int) - neededPackages := make(map[string]map[string]bool) - - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CallExpr)(nil), - } - insp.Preorder(nodeFilter, func(node ast.Node) { - call := node.(*ast.CallExpr) - called, ok := call.Fun.(*ast.SelectorExpr) - if !ok { - return - } - calledObj := pass.TypesInfo.ObjectOf(called.Sel) - - var ( - fn string - verb string - value ast.Expr - err error - ) - switch { - case calledObj == fmtErrorfObj && len(call.Args) == 1: - if n.errorf { - fn = "fmt.Errorf" - verb = "%s" - value = call.Args[0] - } else { - return - } - - case calledObj == fmtSprintObj && len(call.Args) == 1: - fn = "fmt.Sprint" - verb = "%v" - value = call.Args[0] - - case calledObj == fmtSprintfObj && len(call.Args) == 1: - if n.sprintf1 { - fn = "fmt.Sprintf" - verb = "%s" - value = call.Args[0] - } else { - return - } - - case calledObj == fmtSprintfObj && len(call.Args) == 2: - verbLit, ok := call.Args[0].(*ast.BasicLit) - if !ok { - return - } - verb, err = strconv.Unquote(verbLit.Value) - if err != nil { - // Probably unreachable. - return - } - // one single explicit arg is simplified - if strings.HasPrefix(verb, "%[1]") { - verb = "%" + verb[4:] - } - - fn = "fmt.Sprintf" - value = call.Args[1] - - default: - return - } - - switch verb { - default: - if fn == "fmt.Sprintf" && isConcatable(verb) { - break - } - return - case "%d", "%v", "%x", "%t", "%s": - } - - valueType := pass.TypesInfo.TypeOf(value) - a, isArray := valueType.(*types.Array) - s, isSlice := valueType.(*types.Slice) - - var d *analysis.Diagnostic - switch { - case isBasicType(valueType, types.String) && oneOf(verb, "%v", "%s"): - fname := pass.Fset.File(call.Pos()).Name() - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - if fn == "fmt.Errorf" { - neededPackages[fname]["errors"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with errors.New", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use errors.New", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("errors.New("), - }}, - }, - }, - } - } else { - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with just using the string", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Just use string value", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: call.End(), - NewText: []byte(formatNode(pass.Fset, value)), - }}, - }, - }, - } - } - case types.Implements(valueType, errIface) && oneOf(verb, "%v", "%s") && n.errError: - // known false positive if this error is nil - // fmt.Sprint(nil) does not panic like nil.Error() does - errMethodCall := formatNode(pass.Fset, value) + ".Error()" - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with " + errMethodCall, - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use " + errMethodCall, - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: call.End(), - NewText: []byte(errMethodCall), - }}, - }, - }, - } - - case isBasicType(valueType, types.Bool) && oneOf(verb, "%v", "%t"): - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.FormatBool", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.FormatBool", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.FormatBool("), - }}, - }, - }, - } - - case isArray && isBasicType(a.Elem(), types.Uint8) && oneOf(verb, "%x"): - if _, ok := value.(*ast.Ident); !ok { - // Doesn't support array literals. - return - } - - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["encoding/hex"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster hex.EncodeToString", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use hex.EncodeToString", - TextEdits: []analysis.TextEdit{ - { - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("hex.EncodeToString("), - }, - { - Pos: value.End(), - End: value.End(), - NewText: []byte("[:]"), - }, - }, - }, - }, - } - case isSlice && isBasicType(s.Elem(), types.Uint8) && oneOf(verb, "%x"): - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["encoding/hex"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster hex.EncodeToString", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use hex.EncodeToString", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("hex.EncodeToString("), - }}, - }, - }, - } - - case isBasicType(valueType, types.Int8, types.Int16, types.Int32) && oneOf(verb, "%v", "%d") && n.intConv: - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.Itoa", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.Itoa", - TextEdits: []analysis.TextEdit{ - { - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.Itoa(int("), - }, - { - Pos: value.End(), - End: value.End(), - NewText: []byte(")"), - }, - }, - }, - }, - } - case isBasicType(valueType, types.Int) && oneOf(verb, "%v", "%d"): - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.Itoa", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.Itoa", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.Itoa("), - }}, - }, - }, - } - case isBasicType(valueType, types.Int64) && oneOf(verb, "%v", "%d"): - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.FormatInt", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.FormatInt", - TextEdits: []analysis.TextEdit{ - { - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.FormatInt("), - }, - { - Pos: value.End(), - End: value.End(), - NewText: []byte(", 10"), - }, - }, - }, - }, - } - - case isBasicType(valueType, types.Uint8, types.Uint16, types.Uint32, types.Uint) && oneOf(verb, "%v", "%d", "%x") && n.intConv: - base := []byte("), 10") - if verb == "%x" { - base = []byte("), 16") - } - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.FormatUint", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.FormatUint", - TextEdits: []analysis.TextEdit{ - { - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.FormatUint(uint64("), - }, - { - Pos: value.End(), - End: value.End(), - NewText: base, - }, - }, - }, - }, - } - case isBasicType(valueType, types.Uint64) && oneOf(verb, "%v", "%d", "%x"): - base := []byte(", 10") - if verb == "%x" { - base = []byte(", 16") - } - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - _, ok := neededPackages[fname] - if !ok { - neededPackages[fname] = make(map[string]bool) - } - neededPackages[fname]["strconv"] = true - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with faster strconv.FormatUint", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use strconv.FormatUint", - TextEdits: []analysis.TextEdit{ - { - Pos: call.Pos(), - End: value.Pos(), - NewText: []byte("strconv.FormatUint("), - }, - { - Pos: value.End(), - End: value.End(), - NewText: base, - }, - }, - }, - }, - } - case isBasicType(valueType, types.String) && fn == "fmt.Sprintf" && isConcatable(verb): - var fix string - if strings.HasSuffix(verb, "%s") { - fix = strconv.Quote(verb[:len(verb)-2]) + "+" + formatNode(pass.Fset, value) - } else if strings.HasSuffix(verb, "%[1]s") { - fix = strconv.Quote(verb[:len(verb)-5]) + "+" + formatNode(pass.Fset, value) - } else if strings.HasPrefix(verb, "%s") { - fix = formatNode(pass.Fset, value) + "+" + strconv.Quote(verb[2:]) - } else { - fix = formatNode(pass.Fset, value) + "+" + strconv.Quote(verb[5:]) - } - fname := pass.Fset.File(call.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] + 1 - d = &analysis.Diagnostic{ - Pos: call.Pos(), - End: call.End(), - Message: fn + " can be replaced with string addition", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Use string addition", - TextEdits: []analysis.TextEdit{{ - Pos: call.Pos(), - End: call.End(), - NewText: []byte(fix), - }}, - }, - }, - } - } - - if d != nil { - pass.Report(*d) - } - }) - - if len(removedFmtUsages) > 0 { - for _, pkg := range pass.Pkg.Imports() { - if pkg.Path() == "fmt" { - insp = pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter = []ast.Node{ - (*ast.SelectorExpr)(nil), - } - insp.Preorder(nodeFilter, func(node ast.Node) { - selec := node.(*ast.SelectorExpr) - selecok, ok := selec.X.(*ast.Ident) - if ok { - pkgname, ok := pass.TypesInfo.ObjectOf(selecok).(*types.PkgName) - if ok && pkgname.Name() == pkg.Name() { - fname := pass.Fset.File(pkgname.Pos()).Name() - removedFmtUsages[fname] = removedFmtUsages[fname] - 1 - } - } - }) - } else if pkg.Path() == "errors" || pkg.Path() == "strconv" || pkg.Path() == "encoding/hex" { - insp = pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter = []ast.Node{ - (*ast.ImportSpec)(nil), - } - insp.Preorder(nodeFilter, func(node ast.Node) { - gd := node.(*ast.ImportSpec) - if gd.Path.Value == strconv.Quote(pkg.Path()) { - fname := pass.Fset.File(gd.Pos()).Name() - _, ok := neededPackages[fname] - if ok { - delete(neededPackages[fname], pkg.Path()) - } - } - }) - } - } - insp = pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter = []ast.Node{ - (*ast.ImportSpec)(nil), - } - insp.Preorder(nodeFilter, func(node ast.Node) { - gd := node.(*ast.ImportSpec) - if gd.Path.Value == `"fmt"` { - fix := "" - fname := pass.Fset.File(gd.Pos()).Name() - if removedFmtUsages[fname] < 0 { - fix = fix + `"fmt"` - if len(neededPackages[fname]) == 0 { - return - } - } - keys := make([]string, 0, len(neededPackages[fname])) - for k := range neededPackages[fname] { - keys = append(keys, k) - } - sort.Strings(keys) - for _, k := range keys { - fix = fix + "\n\t\"" + k + `"` - } - pass.Report(analysis.Diagnostic{ - Pos: gd.Pos(), - End: gd.End(), - Message: "Fix imports", - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: "Fix imports", - TextEdits: []analysis.TextEdit{{ - Pos: gd.Pos(), - End: gd.End(), - NewText: []byte(fix), - }}, - }, - }}) - } - }) - } - - return nil, nil -} - -var errIface = types.Universe.Lookup("error").Type().Underlying().(*types.Interface) - -func isBasicType(lhs types.Type, expected ...types.BasicKind) bool { - for _, rhs := range expected { - if types.Identical(lhs, types.Typ[rhs]) { - return true - } - } - return false -} - -func formatNode(fset *token.FileSet, node ast.Node) string { - buf := new(bytes.Buffer) - if err := format.Node(buf, fset, node); err != nil { - return "" - } - return buf.String() -} - -func oneOf[T comparable](v T, expected ...T) bool { - for _, rhs := range expected { - if v == rhs { - return true - } - } - return false -} diff --git a/vendor/github.com/cavaliergopher/cpio/.travis.yml b/vendor/github.com/cavaliergopher/cpio/.travis.yml deleted file mode 100644 index 7189a09ad1..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: go - -go: -- 1.17 -- 1.16 -- 1.15 -- 1.14 -- 1.13 -- 1.12 -- 1.11 diff --git a/vendor/github.com/cavaliergopher/cpio/LICENSE b/vendor/github.com/cavaliergopher/cpio/LICENSE deleted file mode 100644 index 7f377a1b68..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2017 Ryan Armstrong. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors - may be used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/cavaliergopher/cpio/README.md b/vendor/github.com/cavaliergopher/cpio/README.md deleted file mode 100644 index 6613d23197..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# cpio -[![Go Reference](https://pkg.go.dev/badge/github.com/cavaliergopher/cpio.svg)](https://pkg.go.dev/github.com/cavaliergopher/cpio) [![Build Status](https://app.travis-ci.com/cavaliergopher/cpio.svg?branch=main)](https://app.travis-ci.com/cavaliergopher/cpio) [![Go Report Card](https://goreportcard.com/badge/github.com/cavaliergopher/cpio)](https://goreportcard.com/report/github.com/cavaliergopher/cpio) - -Package cpio provides readers and writers for the CPIO archive file format. - -Currently, only the SVR4 (New ASCII) format is supported, both with and without -checksums. - -Copyright 2021, Ryan Armstrong diff --git a/vendor/github.com/cavaliergopher/cpio/doc.go b/vendor/github.com/cavaliergopher/cpio/doc.go deleted file mode 100644 index 293170bb41..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -/* -Package cpio providers readers and writers for CPIO archives. Currently, only -the SVR4 (New ASCII) format is supported, both with and without checksums. - -This package aims to be feel like Go's archive/tar package. - -See the CPIO man page: https://www.freebsd.org/cgi/man.cgi?query=cpio&sektion=5 -*/ -package cpio diff --git a/vendor/github.com/cavaliergopher/cpio/fileinfo.go b/vendor/github.com/cavaliergopher/cpio/fileinfo.go deleted file mode 100644 index 7035801550..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/fileinfo.go +++ /dev/null @@ -1,58 +0,0 @@ -package cpio - -import ( - "os" - "path" - "time" -) - -// fileInfo implements fs.FileInfo. -type fileInfo struct { - h *Header -} - -// Name returns the base name of the file. -func (fi fileInfo) Name() string { - if fi.IsDir() { - return path.Base(path.Clean(fi.h.Name)) - } - return path.Base(fi.h.Name) -} - -func (fi fileInfo) Size() int64 { return fi.h.Size } -func (fi fileInfo) IsDir() bool { return fi.Mode().IsDir() } -func (fi fileInfo) ModTime() time.Time { return fi.h.ModTime } -func (fi fileInfo) Sys() interface{} { return fi.h } - -func (fi fileInfo) Mode() (mode os.FileMode) { - mode = os.FileMode(fi.h.Mode).Perm() - if fi.h.Mode&ModeSetuid != 0 { - mode |= os.ModeSetuid - } - if fi.h.Mode&ModeSetgid != 0 { - mode |= os.ModeSetgid - } - if fi.h.Mode&ModeSticky != 0 { - mode |= os.ModeSticky - } - m := os.FileMode(fi.h.Mode) & ModeType - if m == TypeDir { - mode |= os.ModeDir - } - if m == TypeFifo { - mode |= os.ModeNamedPipe - } - if m == TypeSymlink { - mode |= os.ModeSymlink - } - if m == TypeBlock { - mode |= os.ModeDevice - } - if m == TypeChar { - mode |= os.ModeDevice | os.ModeCharDevice - } - if m == TypeSocket { - mode |= os.ModeSocket - } - return mode -} diff --git a/vendor/github.com/cavaliergopher/cpio/hash.go b/vendor/github.com/cavaliergopher/cpio/hash.go deleted file mode 100644 index 0af86d99ea..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/hash.go +++ /dev/null @@ -1,45 +0,0 @@ -package cpio - -import ( - "encoding/binary" - "hash" -) - -type digest struct { - sum uint32 -} - -// NewHash returns a new hash.Hash32 for computing SVR4 checksums. -func NewHash() hash.Hash32 { - return &digest{} -} - -func (d *digest) Write(p []byte) (n int, err error) { - for _, b := range p { - d.sum += uint32(b & 0xFF) - } - - return len(p), nil -} - -func (d *digest) Sum(b []byte) []byte { - out := [4]byte{} - binary.LittleEndian.PutUint32(out[:], d.sum) - return append(b, out[:]...) -} - -func (d *digest) Sum32() uint32 { - return d.sum -} - -func (d *digest) Reset() { - d.sum = 0 -} - -func (d *digest) Size() int { - return 4 -} - -func (d *digest) BlockSize() int { - return 1 -} diff --git a/vendor/github.com/cavaliergopher/cpio/header.go b/vendor/github.com/cavaliergopher/cpio/header.go deleted file mode 100644 index d24e301e27..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/header.go +++ /dev/null @@ -1,156 +0,0 @@ -package cpio - -import ( - "errors" - "fmt" - "os" - "time" -) - -const ( - // TypeReg indicates a regular file - TypeReg = 0100000 - - // The following are header-only flags and may not have a data body. - TypeSocket = 0140000 // Socket - TypeSymlink = 0120000 // Symbolic link - TypeBlock = 060000 // Block device node - TypeDir = 040000 // Directory - TypeChar = 020000 // Character device node - TypeFifo = 010000 // FIFO node -) - -const ( - ModeSetuid = 04000 // Set uid - ModeSetgid = 02000 // Set gid - ModeSticky = 01000 // Save text (sticky bit) - - ModeType = 0170000 // Mask for the type bits - ModePerm = 0777 // Unix permission bits -) - -const ( - // headerEOF is the value of the filename of the last header in a CPIO archive. - headerEOF = "TRAILER!!!" -) - -var ( - // ErrHeader indicates there was an error decoding a CPIO header entry. - ErrHeader = errors.New("cpio: invalid cpio header") -) - -// A FileMode represents a file's mode and permission bits. -type FileMode uint32 - -func (m FileMode) String() string { - return fmt.Sprintf("%#o", m) -} - -// IsDir reports whether m describes a directory. That is, it tests for the -// TypeDir bit being set in m. -func (m FileMode) IsDir() bool { - return m&TypeDir != 0 -} - -// IsRegular reports whether m describes a regular file. That is, it tests for -// the TypeReg bit being set in m. -func (m FileMode) IsRegular() bool { - return m&^ModePerm == TypeReg -} - -// Perm returns the Unix permission bits in m. -func (m FileMode) Perm() FileMode { - return m & ModePerm -} - -// A Header represents a single header in a CPIO archive. Some fields may not be -// populated. -// -// For forward compatibility, users that retrieve a Header from Reader.Next, -// mutate it in some ways, and then pass it back to Writer.WriteHeader should do -// so by creating a new Header and copying the fields that they are interested -// in preserving. -type Header struct { - Name string // Name of the file entry - Linkname string // Target name of link (valid for TypeLink or TypeSymlink) - Links int // Number of inbound links - - Size int64 // Size in bytes - Mode FileMode // Permission and mode bits - Uid int // User id of the owner - Guid int // Group id of the owner - - ModTime time.Time // Modification time - - Checksum uint32 // Computed checksum - - DeviceID int - Inode int64 // Inode number - - pad int64 // bytes to pad before next header -} - -// FileInfo returns an fs.FileInfo for the Header. -func (h *Header) FileInfo() os.FileInfo { - return fileInfo{h} -} - -// FileInfoHeader creates a partially-populated Header from fi. If fi describes -// a symlink, FileInfoHeader records link as the link target. If fi describes a -// directory, a slash is appended to the name. -// -// Since fs.FileInfo's Name method returns only the base name of the file it -// describes, it may be necessary to modify Header.Name to provide the full path -// name of the file. -func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { - if fi == nil { - return nil, errors.New("cpio: FileInfo is nil") - } - if sys, ok := fi.Sys().(*Header); ok { - // This FileInfo came from a Header (not the OS). Return a copy of the - // original Header. - h := &Header{} - *h = *sys - return h, nil - } - fm := fi.Mode() - h := &Header{ - Name: fi.Name(), - Mode: FileMode(fi.Mode().Perm()), // or'd with Mode* constants later - ModTime: fi.ModTime(), - Size: fi.Size(), - } - switch { - case fm.IsRegular(): - h.Mode |= TypeReg - case fi.IsDir(): - h.Mode |= TypeDir - h.Name += "/" - h.Size = 0 - case fm&os.ModeSymlink != 0: - h.Mode |= TypeSymlink - h.Linkname = link - case fm&os.ModeDevice != 0: - if fm&os.ModeCharDevice != 0 { - h.Mode |= TypeChar - } else { - h.Mode |= TypeBlock - } - case fm&os.ModeNamedPipe != 0: - h.Mode |= TypeFifo - case fm&os.ModeSocket != 0: - h.Mode |= TypeSocket - default: - return nil, fmt.Errorf("cpio: unknown file mode %v", fm) - } - if fm&os.ModeSetuid != 0 { - h.Mode |= ModeSetuid - } - if fm&os.ModeSetgid != 0 { - h.Mode |= ModeSetgid - } - if fm&os.ModeSticky != 0 { - h.Mode |= ModeSticky - } - return h, nil -} diff --git a/vendor/github.com/cavaliergopher/cpio/reader.go b/vendor/github.com/cavaliergopher/cpio/reader.go deleted file mode 100644 index f2e5bec49c..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/reader.go +++ /dev/null @@ -1,72 +0,0 @@ -package cpio - -import ( - "io" - "io/ioutil" -) - -// Reader provides sequential access to the contents of a CPIO archive. -// Reader.Next advances to the next file in the archive (including the first), -// and then Reader can be treated as an io.Reader to access the file's data. -type Reader struct { - r io.Reader // underlying file reader - hdr *Header // current Header - eof int64 // bytes until the end of the current file -} - -// NewReader creates a new Reader reading from r. -func NewReader(r io.Reader) *Reader { - return &Reader{ - r: r, - } -} - -// Read reads from the current file in the CPIO archive. It returns (0, io.EOF) -// when it reaches the end of that file, until Next is called to advance to the -// next file. -// -// Calling Read on special types like TypeLink, TypeSymlink, TypeChar, -// TypeBlock, TypeDir, and TypeFifo returns (0, io.EOF) regardless of what the -// Header.Size claims. -func (r *Reader) Read(p []byte) (n int, err error) { - if r.hdr == nil || r.eof == 0 { - return 0, io.EOF - } - rn := len(p) - if r.eof < int64(rn) { - rn = int(r.eof) - } - n, err = r.r.Read(p[0:rn]) - r.eof -= int64(n) - return -} - -// Next advances to the next entry in the CPIO archive. The Header.Size -// determines how many bytes can be read for the next file. Any remaining data -// in the current file is automatically discarded. -// -// io.EOF is returned at the end of the input. -func (r *Reader) Next() (*Header, error) { - if r.hdr == nil { - return r.next() - } - skp := r.eof + r.hdr.pad - if skp > 0 { - _, err := io.CopyN(ioutil.Discard, r.r, skp) - if err != nil { - return nil, err - } - } - return r.next() -} - -func (r *Reader) next() (*Header, error) { - r.eof = 0 - hdr, err := readSVR4Header(r.r) - if err != nil { - return nil, err - } - r.hdr = hdr - r.eof = hdr.Size - return hdr, nil -} diff --git a/vendor/github.com/cavaliergopher/cpio/svr4.go b/vendor/github.com/cavaliergopher/cpio/svr4.go deleted file mode 100644 index 29866bf5fd..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/svr4.go +++ /dev/null @@ -1,152 +0,0 @@ -package cpio - -import ( - "bytes" - "fmt" - "io" - "strconv" - "time" -) - -const ( - svr4MaxNameSize = 4096 // MAX_PATH - svr4MaxFileSize = 4294967295 -) - -var svr4Magic = []byte{0x30, 0x37, 0x30, 0x37, 0x30, 0x31} // 070701 - -func readHex(s string) int64 { - // errors are ignored and 0 returned - i, _ := strconv.ParseInt(s, 16, 64) - return i -} - -func writeHex(b []byte, i int64) { - // i needs to be in range of uint32 - copy(b, fmt.Sprintf("%08X", i)) -} - -func readSVR4Header(r io.Reader) (*Header, error) { - var buf [110]byte - if _, err := io.ReadFull(r, buf[:]); err != nil { - return nil, err - } - - // TODO: check endianness - - // check magic - hasCRC := false - if !bytes.HasPrefix(buf[:], svr4Magic[:5]) { - return nil, ErrHeader - } - if buf[5] == '2' { - hasCRC = true - } else if buf[5] != '1' { - return nil, ErrHeader - } - - asc := string(buf[:]) - hdr := &Header{ - Inode: readHex(asc[6:14]), - Mode: FileMode(readHex(asc[14:22])), - Uid: int(readHex(asc[22:30])), - Guid: int(readHex(asc[30:38])), - Links: int(readHex(asc[38:46])), - ModTime: time.Unix(readHex(asc[46:54]), 0), - Size: readHex(asc[54:62]), - } - if hdr.Size > svr4MaxFileSize { - return nil, ErrHeader - } - nameSize := readHex(asc[94:102]) - if nameSize < 1 || nameSize > svr4MaxNameSize { - return nil, ErrHeader - } - hdr.Checksum = uint32(readHex(asc[102:110])) - if !hasCRC && hdr.Checksum != 0 { - return nil, ErrHeader - } - - name := make([]byte, nameSize) - if _, err := io.ReadFull(r, name); err != nil { - return nil, err - } - hdr.Name = string(name[:nameSize-1]) - if hdr.Name == headerEOF { - return nil, io.EOF - } - - // store padding between end of file and next header - hdr.pad = (4 - (hdr.Size % 4)) % 4 - - // skip to end of header/start of file - pad := (4 - (len(buf)+len(name))%4) % 4 - if pad > 0 { - if _, err := io.ReadFull(r, buf[:pad]); err != nil { - return nil, err - } - } - - // read link name - if hdr.Mode&^ModePerm == TypeSymlink { - if hdr.Size < 1 || hdr.Size > svr4MaxNameSize { - return nil, ErrHeader - } - b := make([]byte, hdr.Size) - if _, err := io.ReadFull(r, b); err != nil { - return nil, err - } - hdr.Linkname = string(b) - hdr.Size = 0 - } - - return hdr, nil -} - -func writeSVR4Header(w io.Writer, hdr *Header) (pad int64, err error) { - var hdrBuf [110]byte - for i := 0; i < len(hdrBuf); i++ { - hdrBuf[i] = '0' - } - magic := svr4Magic - if hdr.Checksum != 0 { - magic[5] = 0x32 - } - copy(hdrBuf[:], magic) - writeHex(hdrBuf[6:14], hdr.Inode) - writeHex(hdrBuf[14:22], int64(hdr.Mode)) - writeHex(hdrBuf[22:30], int64(hdr.Uid)) - writeHex(hdrBuf[30:38], int64(hdr.Guid)) - writeHex(hdrBuf[38:46], int64(hdr.Links)) - if !hdr.ModTime.IsZero() { - writeHex(hdrBuf[46:54], hdr.ModTime.Unix()) - } - writeHex(hdrBuf[54:62], hdr.Size) - writeHex(hdrBuf[94:102], int64(len(hdr.Name)+1)) - if hdr.Checksum != 0 { - writeHex(hdrBuf[102:110], int64(hdr.Checksum)) - } - - // write header - _, err = w.Write(hdrBuf[:]) - if err != nil { - return - } - - // write filename - _, err = io.WriteString(w, hdr.Name+"\x00") - if err != nil { - return - } - - // pad to end of filename - npad := (4 - ((len(hdrBuf) + len(hdr.Name) + 1) % 4)) % 4 - _, err = w.Write(zeroBlock[:npad]) - if err != nil { - return - } - - // compute padding to end of file - pad = (4 - (hdr.Size % 4)) % 4 - return -} diff --git a/vendor/github.com/cavaliergopher/cpio/writer.go b/vendor/github.com/cavaliergopher/cpio/writer.go deleted file mode 100644 index 7f2bdad841..0000000000 --- a/vendor/github.com/cavaliergopher/cpio/writer.go +++ /dev/null @@ -1,140 +0,0 @@ -package cpio - -import ( - "errors" - "fmt" - "io" -) - -var ( - // ErrWriteTooLong indicates that an attempt was made to write more than - // Header.Size bytes to the current file. - ErrWriteTooLong = errors.New("cpio: write too long") - - // ErrWriteAfterClose indicates that an attempt was made to write to the - // CPIO archive after it was closed. - ErrWriteAfterClose = errors.New("cpio: write after close") -) - -var trailer = &Header{ - Name: headerEOF, - Links: 1, -} - -var zeroBlock [4]byte - -// Writer provides sequential writing of a CPIO archive. Write.WriteHeader -// begins a new file with the provided Header, and then Writer can be treated as -// an io.Writer to supply that file's data. -type Writer struct { - w io.Writer - nb int64 // number of unwritten bytes for current file entry - pad int64 // amount of padding to write after current file entry - inode int64 - err error - closed bool -} - -// NewWriter creates a new Writer writing to w. -func NewWriter(w io.Writer) *Writer { - return &Writer{w: w} -} - -// Flush finishes writing the current file's block padding. The current file -// must be fully written before Flush can be called. -// -// This is unnecessary as the next call to WriteHeader or Close will implicitly -// flush out the file's padding. -func (w *Writer) Flush() error { - if w.nb > 0 { - w.err = fmt.Errorf("cpio: missed writing %d bytes", w.nb) - return w.err - } - _, w.err = w.w.Write(zeroBlock[:w.pad]) - if w.err != nil { - return w.err - } - w.nb = 0 - w.pad = 0 - return w.err -} - -// WriteHeader writes hdr and prepares to accept the file's contents. The -// Header.Size determines how many bytes can be written for the next file. If -// the current file is not fully written, then this returns an error. This -// implicitly flushes any padding necessary before writing the header. -func (w *Writer) WriteHeader(hdr *Header) (err error) { - if w.closed { - return ErrWriteAfterClose - } - if w.err == nil { - w.Flush() - } - if w.err != nil { - return w.err - } - if hdr.Name != headerEOF { - // TODO: should we be mutating hdr here? - // ensure all inodes are unique - w.inode++ - if hdr.Inode == 0 { - hdr.Inode = w.inode - } - - // ensure file type is set - if hdr.Mode&^ModePerm == 0 { - hdr.Mode |= TypeReg - } - - // ensure regular files have at least 1 inbound link - if hdr.Links < 1 && hdr.Mode.IsRegular() { - hdr.Links = 1 - } - } - - w.nb = hdr.Size - w.pad, w.err = writeSVR4Header(w.w, hdr) - return -} - -// Write writes to the current file in the CPIO archive. Write returns the error -// ErrWriteTooLong if more than Header.Size bytes are written after WriteHeader. -// -// Calling Write on special types like TypeLink, TypeSymlink, TypeChar, -// TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless of -// what the Header.Size claims. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.closed { - err = ErrWriteAfterClose - return - } - overwrite := false - if int64(len(p)) > w.nb { - p = p[0:w.nb] - overwrite = true - } - n, err = w.w.Write(p) - w.nb -= int64(n) - if err == nil && overwrite { - err = ErrWriteTooLong - return - } - w.err = err - return -} - -// Close closes the CPIO archive by flushing the padding, and writing the -// footer. If the current file (from a prior call to WriteHeader) is not fully -// written, then this returns an error. -func (w *Writer) Close() error { - if w.err != nil || w.closed { - return w.err - } - w.err = w.WriteHeader(trailer) - if w.err != nil { - return w.err - } - w.Flush() - w.closed = true - return w.err -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/.gitignore b/vendor/github.com/ccojocar/zxcvbn-go/.gitignore deleted file mode 100644 index e032cc2fcb..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -zxcvbn -debug.test - -# SBOMs generated during CI -/bom.json diff --git a/vendor/github.com/ccojocar/zxcvbn-go/.golangci.yml b/vendor/github.com/ccojocar/zxcvbn-go/.golangci.yml deleted file mode 100644 index b54f70092e..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/.golangci.yml +++ /dev/null @@ -1,39 +0,0 @@ -linters: - enable: - - asciicheck - - bodyclose - - dogsled - - durationcheck - - errcheck - - errorlint - - exportloopref - - gci - - ginkgolinter - - gofmt - - gofumpt - - goimports - - gosimple - - govet - - importas - - ineffassign - - megacheck - - misspell - - nakedret - - nolintlint - - revive - - staticcheck - - typecheck - - unconvert - - unparam - - unused - - wastedassign - -linters-settings: - gci: - sections: - - standard - - default - - prefix(github.com/ccojocar) - -run: - timeout: 5m diff --git a/vendor/github.com/ccojocar/zxcvbn-go/.goreleaser.yml b/vendor/github.com/ccojocar/zxcvbn-go/.goreleaser.yml deleted file mode 100644 index 2386aeee52..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/.goreleaser.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -project_name: zxcvbn-go - -release: - extra_files: - - glob: ./bom.json - github: - owner: ccojocar - name: zxcvbn-go - -builds: - - main: ./testapp/ - binary: zxcvbn-go - goos: - - darwin - - linux - - windows - goarch: - - amd64 - - arm64 - - s390x - ldflags: -X main.Version={{.Version}} -X main.GitTag={{.Tag}} -X main.BuildDate={{.Date}} - env: - - CGO_ENABLED=0 - -gomod: - proxy: true diff --git a/vendor/github.com/ccojocar/zxcvbn-go/LICENSE.txt b/vendor/github.com/ccojocar/zxcvbn-go/LICENSE.txt deleted file mode 100644 index e8f59e06d2..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) Nathan Button - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/ccojocar/zxcvbn-go/Makefile b/vendor/github.com/ccojocar/zxcvbn-go/Makefile deleted file mode 100644 index 0690f37538..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/Makefile +++ /dev/null @@ -1,61 +0,0 @@ -GIT_TAG?= $(shell git describe --always --tags) -BIN = zxcvbn-go -FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr) -IMAGE_REPO = ccojocar -DATE_FMT=+%Y-%m-%d -ifdef SOURCE_DATE_EPOCH - BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") -else - BUILD_DATE ?= $(shell date "$(DATE_FMT)") -endif -BUILDFLAGS := "-w -s -X 'main.Version=$(GIT_TAG)' -X 'main.GitTag=$(GIT_TAG)' -X 'main.BuildDate=$(BUILD_DATE)'" -CGO_ENABLED = 0 -GO := GO111MODULE=on go -GO_NOMOD :=GO111MODULE=off go -GOPATH ?= $(shell $(GO) env GOPATH) -GOBIN ?= $(GOPATH)/bin -GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) -GOVULN_MIN_VERSION = 17 -GO_VERSION = 1.20 - -default: - $(MAKE) test - -install-govulncheck: - @if [ $(GO_MINOR_VERSION) -gt $(GOVULN_MIN_VERSION) ]; then \ - go install golang.org/x/vuln/cmd/govulncheck@latest; \ - fi - -test-all: fmt vet lint sec govulncheck test - -test: - go test -v ./... - -fmt: - @echo "FORMATTING" - @FORMATTED=`$(GO) fmt ./...` - @([ ! -z "$(FORMATTED)" ] && printf "Fixed unformatted files:\n$(FORMATTED)") || true - -vet: - @echo "VETTING" - $(GO) vet ./... - -lint: - @echo "LINTING: golangci-lint" - golangci-lint run - -sec: - @echo "SECURITY SCANNING" - gosec ./... - -govulncheck: install-govulncheck - @echo "CHECKING VULNERABILITIES" - @if [ $(GO_MINOR_VERSION) -gt $(GOVULN_MIN_VERSION) ]; then \ - govulncheck ./...; \ - fi - -clean: - rm -rf build vendor dist coverage.txt - rm -f release image $(BIN) - -.PHONY: test test-all fmt vet govulncheck clean diff --git a/vendor/github.com/ccojocar/zxcvbn-go/README.md b/vendor/github.com/ccojocar/zxcvbn-go/README.md deleted file mode 100644 index 3f742a9da6..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/README.md +++ /dev/null @@ -1,78 +0,0 @@ -This is a goLang port of python-zxcvbn and [zxcvbn](https://github.com/dropbox/zxcvbn), which are python and JavaScript password strength -generators. zxcvbn attempts to give sound password advice through pattern -matching and conservative entropy calculations. It finds 10k common passwords, -common American names and surnames, common English words, and common patterns -like dates, repeats (aaa), sequences (abcd), and QWERTY patterns. - -Please refer to https://dropbox.tech/security/zxcvbn-realistic-password-strength-estimation for the full details and -motivation behind zxcbvn. The source code for the original JavaScript (well, -actually CoffeeScript) implementation can be found at: - -https://github.com/lowe/zxcvbn - -Python at: - -https://github.com/dropbox/python-zxcvbn - -For full motivation, see: - -https://dropbox.tech/security/zxcvbn-realistic-password-strength-estimation - ------------------------------------------------------------------------- -Use ------------------------------------------------------------------------- - -The zxcvbn module has the public method PasswordStrength() function. Import zxcvbn, and -call PasswordStrength(password string, userInputs []string). The function will return a -result dictionary with the following keys: - -Entropy # bits - -CrackTime # estimation of actual crack time, in seconds. - -CrackTimeDisplay # same crack time, as a friendlier string: - # "instant", "6 minutes", "centuries", etc. - -Score # [0,1,2,3,4] if crack time is less than - # [10^2, 10^4, 10^6, 10^8, Infinity]. - # (useful for implementing a strength bar.) - -MatchSequence # the list of patterns that zxcvbn based the - # entropy calculation on. - -CalcTime # how long it took to calculate an answer, - # in milliseconds. usually only a few ms. - -The userInputs argument is an splice of strings that zxcvbn -will add to its internal dictionary. This can be whatever list of -strings you like, but is meant for user inputs from other fields of the -form, like name and email. That way a password that includes the user's -personal info can be heavily penalized. This list is also good for -site-specific vocabulary. - -Bug reports and pull requests welcome! - ------------------------------------------------------------------------- -Project Status ------------------------------------------------------------------------- - -Use zxcvbn_test.go to check how close to feature parity the project is. - ------------------------------------------------------------------------- -Acknowledgment ------------------------------------------------------------------------- - -Thanks to Dan Wheeler (https://github.com/lowe) for the CoffeeScript implementation -(see above.) To repeat his outside acknowledgements (which remain useful, as always): - -Many thanks to Mark Burnett for releasing his 10k top passwords list: -https://xato.net/passwords/more-top-worst-passwords -and for his 2006 book, -"Perfect Passwords: Selection, Protection, Authentication" - -Huge thanks to Wiktionary contributors for building a frequency list -of English as used in television and movies: -https://en.wiktionary.org/wiki/Wiktionary:Frequency_lists - -Last but not least, big thanks to xkcd :) -https://xkcd.com/936/ diff --git a/vendor/github.com/ccojocar/zxcvbn-go/adjacency/adjcmartix.go b/vendor/github.com/ccojocar/zxcvbn-go/adjacency/adjcmartix.go deleted file mode 100644 index 34526685cc..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/adjacency/adjcmartix.go +++ /dev/null @@ -1,105 +0,0 @@ -package adjacency - -import ( - "encoding/json" - "log" - - "github.com/ccojocar/zxcvbn-go/data" -) - -// Graph holds information about different graphs -type Graph struct { - Graph map[string][]string - averageDegree float64 - Name string -} - -// GraphMap is a map of all graphs -var GraphMap = make(map[string]Graph) - -func init() { - GraphMap["qwerty"] = BuildQwerty() - GraphMap["dvorak"] = BuildDvorak() - GraphMap["keypad"] = BuildKeypad() - GraphMap["macKeypad"] = BuildMacKeypad() - GraphMap["l33t"] = BuildLeet() -} - -// BuildQwerty builds the Qwerty Graph -func BuildQwerty() Graph { - data, err := data.Asset("data/Qwerty.json") - if err != nil { - panic("Can't find asset") - } - return getAdjancencyGraphFromFile(data, "qwerty") -} - -// BuildDvorak builds the Dvorak Graph -func BuildDvorak() Graph { - data, err := data.Asset("data/Dvorak.json") - if err != nil { - panic("Can't find asset") - } - return getAdjancencyGraphFromFile(data, "dvorak") -} - -// BuildKeypad builds the Keypad Graph -func BuildKeypad() Graph { - data, err := data.Asset("data/Keypad.json") - if err != nil { - panic("Can't find asset") - } - return getAdjancencyGraphFromFile(data, "keypad") -} - -// BuildMacKeypad builds the Mac Keypad Graph -func BuildMacKeypad() Graph { - data, err := data.Asset("data/MacKeypad.json") - if err != nil { - panic("Can't find asset") - } - return getAdjancencyGraphFromFile(data, "mac_keypad") -} - -// BuildLeet builds the L33T Graph -func BuildLeet() Graph { - data, err := data.Asset("data/L33t.json") - if err != nil { - panic("Can't find asset") - } - return getAdjancencyGraphFromFile(data, "keypad") -} - -func getAdjancencyGraphFromFile(data []byte, name string) Graph { - var graph Graph - err := json.Unmarshal(data, &graph) - if err != nil { - log.Fatal(err) - } - graph.Name = name - return graph -} - -// CalculateAvgDegree calclates the average degree between nodes in the graph -// on qwerty, 'g' has degree 6, being adjacent to 'ftyhbv'. '\' has degree 1. -// this calculates the average over all keys. -// TODO double check that i ported this correctly scoring.coffee ln 5 -func (adjGrp Graph) CalculateAvgDegree() float64 { - if adjGrp.averageDegree != float64(0) { - return adjGrp.averageDegree - } - var avg float64 - var count float64 - for _, value := range adjGrp.Graph { - for _, char := range value { - if len(char) != 0 || char != " " { - avg += float64(len(char)) - count++ - } - } - } - - adjGrp.averageDegree = avg / count - - return adjGrp.averageDegree -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/data/bindata.go b/vendor/github.com/ccojocar/zxcvbn-go/data/bindata.go deleted file mode 100644 index 3db0f1b100..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/data/bindata.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by go-bindata. -// sources: -// data/Dvorak.json -// data/English.json -// data/FemaleNames.json -// data/Keypad.json -// data/L33t.json -// data/MacKeypad.json -// data/MaleNames.json -// data/Passwords.json -// data/Qwerty.json -// data/Surnames.json -// DO NOT EDIT! - -package data - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) // #nosec - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _dataDvorakJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x98\x57\x57\x1b\x41\x0c\x85\xdf\xf9\x15\xb0\x74\x30\xbd\xf7\xde\x7b\x6f\xa6\x77\x30\xbd\x17\xf3\xdb\x33\x26\x39\x99\xef\x9e\x78\x96\x7d\x88\x5e\x72\xc6\x61\xf9\xa4\x95\xae\x34\xd7\x7c\x14\x14\x16\x46\x63\xf7\xfb\xb7\x67\x51\x67\x61\xee\x83\xfb\x58\xef\x8e\x5b\xdf\x47\xf7\xa1\xa3\x22\x4a\xfd\x39\x5f\x3f\x65\x32\xf9\xce\xd1\xd6\xc7\xdf\x67\xa2\xcc\xb4\x3f\xdf\x2f\x46\xdf\xc7\xed\xdf\xff\x13\x35\x10\xbc\xf7\xf5\x33\xb8\xb1\xdf\xc3\xca\xd3\x91\xfc\x82\x90\x1b\x49\x6e\x28\xfa\x99\xdc\x54\xec\xc9\xa9\x6e\x8d\x22\xe4\x26\x92\x91\x4f\x90\xdc\x5c\xe2\x69\xb5\xbd\x12\x45\xc0\xcd\x04\x23\x9d\x20\xb8\xa5\xd4\xc3\x6e\xe7\x25\x88\x80\x5b\x08\x46\x36\x41\x70\xeb\x8e\x87\xbd\x6d\x48\x10\x01\xb7\x12\x8c\x6c\x82\xe0\xb6\x32\x0f\x3b\x19\x95\x20\x02\x6e\x23\x18\xd9\x04\xc1\xed\x55\x1e\x76\x3a\x26\x41\x04\xdc\x4e\x30\xb2\x09\x82\xa1\xf6\xe8\x70\x48\x82\x08\xb8\x83\x60\x64\x13\x04\xd7\x57\xca\x58\x30\x88\x80\x8b\xcc\x46\xc4\xfd\xcc\xa3\x05\x81\x79\x11\x1c\xe7\x62\x7f\x20\x4c\x2e\xb6\x1a\x91\x12\xab\x11\x29\xb5\x1a\x91\x32\x2b\x25\x97\x5b\x35\xaf\xc2\x4a\xc9\x95\x56\xb7\x48\x95\xd5\x50\x57\x13\x5c\xd7\xe7\x1f\xdc\xce\xe6\x0d\x12\xa5\xd3\x9f\xf9\x7f\x50\xb3\xab\xe4\x14\xc9\x9c\x52\x69\x19\xef\x24\x8e\xc5\xcd\x9c\xb4\x52\xc8\x35\x24\x3f\x2c\xf9\x07\x99\x7f\x4f\xf5\xcf\x45\x7a\xdf\x54\x70\x2d\xc1\x14\x13\xb3\xe4\x20\x73\xde\x8e\x47\x24\x7b\x01\xd7\x11\xcc\x3e\xb3\xff\xa8\x38\xb3\xcf\x15\x36\x85\xb7\x15\x70\x67\x68\x44\x20\x7f\xa9\xe5\xdd\x42\xb0\x2c\x02\xee\xb2\x02\x77\x9b\xc9\xa2\xc7\x4c\xca\xbd\x56\xba\xe8\xb3\xd2\x45\xbf\x99\x37\x1c\x08\x09\x43\x7a\x49\x04\x7b\xd6\xd5\x19\xde\xca\x83\xcc\xf9\x75\xdd\xff\xd2\xd1\xb0\x3f\x9f\x8d\xfb\xf3\xd5\x4c\x32\xc9\x0d\x11\xcc\x0b\x87\x17\x11\x17\x26\x57\xfc\xe3\xb2\x04\x17\xf0\x30\xc1\xe7\x13\xf9\x8d\x1f\x03\x32\xfb\x83\x41\x7f\x76\x6f\x2b\xe0\x11\x82\x59\x3f\xce\x02\x45\xf6\xb4\xe2\xcf\x17\x93\x32\x95\x02\x1e\x25\x98\x97\x3a\x2f\x7b\x5a\x58\x66\xcf\x3e\xb8\xb7\x15\xf0\x18\xc1\x7c\x7d\xc2\x58\x6f\x5e\x4a\x2c\x8b\x0b\x22\xe0\x71\x82\x99\x01\x33\x23\x8c\x0d\x83\x42\x72\xf5\x16\xf0\x04\xc1\xac\x1f\xcb\xc2\x37\x61\x70\xca\xf3\x72\x4a\xc1\x93\x04\x63\x2d\xca\x26\x60\x40\x07\x48\xa4\xe3\x29\x82\xd9\x65\xc2\x28\x43\x64\x19\x0b\x9e\x26\x98\xe2\xa7\xef\xe1\x4a\xe2\x76\xe5\x05\x7c\x3d\xab\xa5\x98\x21\x98\x82\x67\xc7\xd9\xb0\x97\xb5\x64\x19\xcf\x12\x4c\x00\xb3\xe7\x42\x65\x96\xcf\xab\x12\x50\xc0\x73\x04\xf3\xae\xe3\x46\xe3\x14\xb2\xa9\x6c\xb6\xdb\x74\x02\x9e\x27\x98\x00\xde\x1b\xf4\xf2\x94\x21\x1b\xec\x02\x0a\x78\x81\x60\xec\x57\xd9\x1b\xcc\x12\xca\x89\xad\xf1\x22\xc1\x9c\x30\xae\x4a\x2a\x84\xf5\x76\x4a\x60\x83\x05\xbc\x44\x30\x1f\x24\x80\x12\xe3\x4d\xe7\x3c\x1b\x1b\x29\xe0\x65\x82\x29\x31\x66\x4f\x85\x30\x38\xa4\x97\xdb\x1b\x02\x5e\x21\x98\xb5\xe4\x0e\x66\xc3\x38\x85\x18\xef\x5c\xed\x05\xbc\x4a\x30\x33\x60\x66\xd4\x2e\x5e\x3f\xb6\x79\x6b\x04\x73\x0d\x72\x58\x18\x04\x43\x11\x0b\x5e\x27\x98\xaf\xc6\x57\xe6\xaa\xc4\xd8\xc7\x82\x37\x08\x66\x5d\x39\x14\xbc\xa6\xb8\x9b\x19\xdc\x0d\x8b\x80\x37\x09\xe6\xec\xb3\xae\x90\x58\xc8\x23\xfd\x93\xf1\x16\xc1\x18\x84\xa0\xc9\xa2\x93\xa3\xbe\x9d\xee\x05\x9c\x4e\x93\x9c\xe0\x9b\x4c\xe2\x94\xb7\x09\xc6\x46\x4f\x02\x13\xf3\xe9\xd2\x17\xf0\x8e\xd5\xdf\xc9\x76\xad\xbe\xec\xed\x05\x8c\x6c\x10\x10\x63\xa3\x05\xbc\x6f\xe6\x90\x0f\xac\x1c\xf2\xa1\x95\x43\x3e\xb2\x72\xc8\xc7\x56\x0e\xf9\xc4\xca\x21\x9f\x5a\x39\xe4\x33\x2b\x87\x7c\x6e\xe5\x90\x2f\xac\x1c\xf2\xa5\x95\x43\xce\x58\x39\xe4\x2b\x2b\x87\x7c\x6d\xe5\x90\x6f\xac\x1c\xf2\xad\x95\x43\xbe\xb3\x72\xc8\xf7\x56\x0e\xf9\xc1\xca\x21\x3f\x5a\x39\xe4\x27\x2b\x87\xfc\x6c\xe5\x90\x5f\xac\x1c\xf2\xab\x95\x43\x7e\xb3\x72\xc8\xef\x56\x0e\xf9\xc3\xca\x21\x7f\x5a\x19\xe4\xac\x95\x41\xfe\xfa\xef\x76\xd3\xfd\x9b\x2d\xc8\x16\xfc\x0a\x00\x00\xff\xff\xd5\xc4\xca\x21\xce\x20\x00\x00") - -func dataDvorakJsonBytes() ([]byte, error) { - return bindataRead( - _dataDvorakJson, - "data/Dvorak.json", - ) -} - -func dataDvorakJson() (*asset, error) { - bytes, err := dataDvorakJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/Dvorak.json", size: 8398, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataEnglishJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\xbd\x4b\x9a\xe3\xca\x0e\x34\xb6\x15\x7f\x9a\xf4\xe4\xae\xc0\x6b\xf0\x0e\x3c\x4a\x92\x29\x31\x4b\x24\x93\x87\x0f\xa9\xd4\xde\xbc\x81\x88\x40\x52\xfd\x0f\xee\xed\xea\x3e\x55\x2a\x32\x1f\x78\x04\x02\x81\xff\xef\xf6\xff\x94\xfd\xb8\xfd\xdf\xff\xef\xff\x75\xfb\xd4\xf3\xf6\xbf\x5b\xb1\xff\x1d\xd5\xff\x6f\xcc\xf6\xff\xc9\xff\xb7\x0c\xf8\x7b\x3a\xfc\xbf\xfb\xff\xd5\xbb\xfd\xdf\xec\xff\xfd\xad\x7f\xdd\xfd\xff\x16\x7c\x1b\xbe\x7e\x2e\xf5\xed\xff\xf4\x67\xb6\xff\xbf\xd7\xcd\xfe\x7f\xf1\x4f\x1d\xd3\xcb\x7f\x6c\xfe\xd8\xff\x0d\x75\xf9\xe3\x3f\xfc\x73\xee\x07\xfe\xfb\x81\x7f\xb4\xff\xeb\xfc\x7b\xaa\x7f\x9c\x3d\x94\xff\xec\x3b\xf9\x87\xbe\x33\x1e\xe0\x0f\xbe\x2e\xc7\x68\x7f\xec\xf8\xf6\xd3\x7f\x32\x4d\x13\xbe\x07\x7f\xa4\xcd\xbf\x17\xaf\x50\xfd\xfb\x52\x57\xf1\x4d\x5b\x79\x8c\x07\x3f\xf7\x0f\xbe\xe5\x91\x0f\x7c\x23\xfe\xc2\xef\x79\xd4\xb2\x3c\xec\xcf\xa9\x3c\xfd\x1f\x3f\x39\xf9\x27\x94\x3b\xbf\xcf\x7f\x29\x3e\xb7\x4f\xfe\x80\xe7\x8a\xc7\x5b\x0e\xbe\xfb\xf2\xd4\x52\xe1\x21\xb9\x08\x0f\xbc\x78\xf1\x95\xc0\x62\x8d\xfa\x57\xfe\x88\x7e\xf3\xe2\xff\x3f\x94\x01\x6b\xea\xab\xb3\x67\xfc\x92\x8a\x65\x7e\xd4\xca\x3d\xc8\xfe\x9f\xb6\x6c\xef\xea\x5f\x70\x55\xea\x39\xf9\x7f\x9c\x6a\x7d\xe2\xa7\x33\xf6\xa1\x70\x7f\x0a\x96\xa3\x3e\x93\x7f\x7f\x97\xfa\x27\x9f\x1c\x0b\x3f\x67\xbc\xc2\xc1\x25\x2b\x7f\xf0\xc7\x7d\xab\x33\xde\xf4\x83\xd5\xd4\x3a\xe2\x75\x7a\xfd\x26\x7b\x4c\x7e\xc0\x27\xef\x78\xb5\x1d\x7b\x86\xdf\x8b\xad\xde\xed\xa9\x7d\x31\x1e\x78\x1e\xee\x68\x9f\xce\x3d\xeb\xbf\xe1\x20\xe8\x85\xfc\x87\x76\x3c\x1d\x1e\xff\x48\x58\x74\x3c\xd8\x1b\xff\x7c\xee\xd8\x8b\xe3\x98\x70\x72\xf8\xdf\x97\x9c\x07\xac\xcb\xb2\x24\xfc\xf5\x85\x9d\x79\x67\xee\xea\x51\x2b\xf7\x09\xcf\x5d\xfe\xe0\xd0\xed\x27\xff\xdb\x98\xfd\x05\xe7\xca\x85\xe7\x0f\xf2\x98\xed\x75\xdb\x3e\x5c\xc3\x2d\x4e\x37\x3e\x61\xca\xb1\xbf\xfe\x4a\x09\x3f\x9f\x3e\x38\xa6\x43\x7d\x2f\xf8\xeb\x82\xb7\xf2\xef\x3e\xfd\xbc\xd8\xe7\x62\xc9\x3f\xb1\xcb\xf8\xa0\x7d\xd4\x1a\xa6\xe5\x13\x1f\xb7\x27\x6c\xfb\x7c\xf6\x23\xff\x03\xde\xf7\xee\x1f\x6e\xaf\x85\x45\xbd\xdf\xf1\x9b\xf8\xfd\x76\xbc\x70\xcc\x1e\xe5\xc5\xa3\x33\xf1\x77\xd4\x93\x67\x7b\xcc\x93\x1f\xca\xe3\x8d\x6b\x9c\x26\xff\xde\x35\xd7\x75\xe2\x49\xf2\xdf\xb5\x1f\x3c\x17\xef\x84\xfb\x5c\x16\x5c\xf9\x7b\xc1\x4d\xb7\x8b\x18\x2f\xfa\x48\x71\xa9\x97\x87\xd6\x01\xaf\x31\xd4\xbc\xf3\x08\xf4\xbc\x76\x47\xc5\x5b\x3d\xec\x68\x1e\xd8\xee\x3b\x97\xb7\xcb\xc7\x81\x05\xd6\x06\x2d\xba\x7f\xfe\x0e\xfe\x0b\xb8\xc5\xf7\xb2\xed\xfc\xb1\xa9\x64\xbe\xd4\xc1\xab\x76\xcf\x79\xd2\x4f\xb7\xf5\x7a\xd7\xcd\x5f\xc9\xaf\x30\xbe\xd7\x1e\x1b\x27\x8a\x07\x2b\xdd\xf9\x0b\xa7\xb4\xeb\x82\xe1\xd8\x0d\xf8\x45\xcf\x9c\x57\x3d\xbe\x2f\x0a\xed\xc6\x56\xcf\x85\x8b\x52\x57\x5d\x32\x9e\xa2\xf2\x07\xef\x74\xfa\x4f\x16\xbd\x6f\x9a\xec\x91\x79\x22\xf7\x23\xf3\x94\x2e\x07\x0e\xe3\xbc\xf1\xbb\x71\x27\x70\x06\x6c\x4f\xf0\xcb\xbb\x02\x7b\x82\x1b\x3f\xa6\x75\xcd\x4b\x1e\x62\x23\x79\x85\xf9\xe1\xc7\xf6\xe1\x2b\x3e\xb9\x13\xef\xad\x6a\xc7\x37\xdf\x5c\x6d\x27\xbf\x65\x4e\x03\x2f\xc2\x1b\x0b\xc7\x7f\x7c\x9c\x79\xe7\x95\xc4\xd6\x70\x0b\x70\xd3\x66\xdc\xea\x2d\xcf\x79\xee\xb0\x3e\x66\xf8\x0e\xad\x67\xfe\xa3\x3d\xb4\x7f\xe3\xb2\x0f\xf8\x99\x29\xd3\x5a\xaf\x53\xea\xfd\x4f\x5b\xa6\x6c\x1b\x45\x7f\x00\xb3\xa3\x35\xe9\x8f\x53\x16\x69\xcc\x69\xc3\xef\xc4\xb9\x5f\x0a\x7e\xee\x9e\xf4\xb1\x79\xa2\x09\x38\x92\xec\x3f\x2e\x59\xd2\xd2\xda\x37\x15\xff\x2e\x33\x33\x1b\xbe\x6f\xd6\x61\x99\xb9\x1a\x59\x57\x2a\x2f\xb1\x18\x1b\x7f\x25\x9e\xbe\x4f\x73\x98\x17\x7e\xae\x9f\x0f\x1a\x3f\x5c\xd0\x7b\x9a\xcb\xc4\xcb\x5d\x27\x9a\x98\x38\x64\x76\x73\x76\xfd\x84\xfd\xe2\xc9\xef\x5a\x19\x32\x5c\xdf\xfe\xc4\xea\xe2\x28\xcd\xf4\x53\x66\x92\xb9\x6e\xb5\x99\xdd\x38\x97\x34\x02\xef\xb1\xe0\x26\x9b\xe3\xd8\x7c\x33\xb6\x8a\xb5\x9f\xf2\xdd\x7f\xfc\xc9\x1d\x3b\x6a\x5c\x05\xb7\xe6\x78\x70\x18\x90\xba\x62\x57\xf5\x32\xfc\xe3\x9d\xe1\x5e\x4e\xd8\xe5\x79\xd6\x21\xf2\x77\x59\x37\xdb\x45\x78\x8b\x04\x9f\x52\x36\x7c\x54\xa1\x97\x82\x9f\xb9\x6f\x25\x63\xf9\xd2\x64\xbf\x69\xe0\x37\xeb\x98\x2d\xf9\x97\x0b\xbf\xc1\xd9\xfc\xd4\x0e\x9f\x59\xbb\x89\x26\xb2\x2c\xe7\x81\x0d\xd4\x0d\xb1\x9b\x37\xf1\xe0\x9a\xa3\xe3\x47\xb8\x43\xe7\xf6\xf9\xd6\x0f\x78\x85\x05\xbe\x63\x4e\xba\xfa\xf3\x47\x8b\xda\x5f\x47\x26\xff\xda\xa1\xe1\x89\x49\x2f\x19\x9b\x51\xbf\x3c\x75\xfa\x0f\x7e\x51\x78\x3e\x71\x0c\xc7\x73\x83\x91\xa8\xb0\xab\x15\xfe\xdf\xd6\x1a\x9b\x69\xdb\x45\x7f\x70\x1c\xd8\xb7\x89\x67\x60\x2f\x0b\x4e\x60\xfe\xed\xcf\x38\x7a\xf8\x90\x27\xed\xdf\xc8\x47\xf6\xa3\x82\xf7\xaa\x34\x13\x3d\x0e\x71\x2c\xd7\xb9\x98\xb5\xbc\x31\xe4\x60\x84\xe0\x57\x1e\xd7\x8c\x47\xc0\xfe\x0a\x2f\xf4\x81\x97\xd8\xe9\x08\x07\x6e\xeb\x41\xaf\x5c\xf9\x1c\x0f\x3e\x96\x1b\x4d\x9a\x8c\xba\x2d\x72\x02\xe7\xba\x9a\xb1\x18\xda\x8e\xed\x5c\x52\x1a\xa6\x13\x0e\x60\xae\x38\x80\x27\xbf\xed\x2d\x67\xb5\xe7\xbe\x62\x77\x56\xbe\xda\x44\xb7\x70\x6c\x27\x23\xa4\x7e\xac\x15\x8e\x9d\x97\xd8\x0c\x33\x63\x1e\xfb\x06\x98\x87\xd3\x16\x89\x56\x23\x27\x9c\xdb\xcb\x53\xe3\x48\x7a\x28\xe7\xff\xf5\xce\x73\x6b\xb7\x4d\xc7\x9d\x2e\xca\xae\x13\x5c\x02\x7f\xa6\x37\x93\x86\x5f\xb3\x9d\xf0\x8a\xf5\xc5\xab\xf6\xe1\x8b\xaf\x66\x3f\xf0\xa1\xdd\x27\x2e\x6b\x57\xb1\xc8\xc3\xa6\x23\x84\x25\xa4\x2b\x9c\x0b\x1e\x6b\x4e\x9b\xad\x08\xde\xd0\x3c\x20\x5e\x31\xe9\x64\xa5\x30\x86\x19\xaf\x64\xbf\x87\x0e\x65\xa6\x17\x5d\x47\xfe\x5a\xdb\x49\xfe\xda\x21\xcd\x0b\xee\x2c\x16\xd2\xaf\x2e\x42\x97\x8d\x9f\xd2\x27\xbc\xc3\x71\x6e\x38\x76\x65\x87\x91\xa9\xb6\x49\x1b\xae\xd2\xb3\x60\x57\x6c\xe1\x68\x08\xc6\xcc\x70\xca\xde\xf9\x81\x53\x86\x6d\xf0\x87\xe3\xb3\x28\xc4\xb8\x73\x43\xcc\x9a\xd2\x23\xd1\x1e\x99\x71\xd6\xbd\x49\xdc\x4c\xbd\xca\x87\x16\xd4\xe3\x1c\xfc\xb2\xeb\x15\xd3\xc2\x87\x0d\xb3\x65\x66\x99\xf7\x84\xbf\x0f\x61\xe6\x4e\xe7\xd4\xe5\x74\x1e\xe5\x7e\xfa\xbe\x3f\x68\xc4\x6d\xfb\xf1\xd0\x5b\xfa\xfb\xd1\x61\xc1\xe9\x61\x40\xcf\x9b\x96\xee\x1b\x63\x11\x73\xdb\x6f\x1e\xe3\x32\xaf\x75\x3b\x18\xdf\x6e\xb4\x83\x77\x6c\xed\xb3\xe8\x10\xf2\x06\x1c\xd8\xb1\xc7\x94\x9a\xa5\x56\x48\xcb\x07\xda\xdd\x5b\xe2\xbd\x60\x53\xf6\xf8\x26\xed\x7e\x57\x68\x59\x4f\x06\x29\x76\xa6\x7c\x51\x72\xd1\x9b\xce\x1b\x0f\x60\xd6\xd1\x1b\x92\x87\x3a\x8c\xf8\x18\x4c\x67\xdc\x47\x33\xd7\x38\x27\x70\x54\x58\xab\x9c\x10\xfd\x58\x4c\x5b\x18\x06\x54\x06\xa8\x38\x2e\xfd\x44\xf7\x3c\xd2\xa3\xd9\xfe\xf8\xb3\xfc\x67\x3e\xf4\x28\x38\x2e\x87\xce\xdd\x3d\x31\x09\x41\x28\xe5\xa1\xe7\xce\x37\x61\x38\x19\xde\xc8\x22\x6e\xc4\x46\xe5\x7e\xb7\x70\x6f\x09\x33\x93\x69\x14\xf7\xb5\x98\xf3\xe6\xc1\xd0\x5b\x9b\x45\x96\x0f\x78\xe7\x61\x90\x1d\x18\x19\x94\x74\x34\x6b\x45\xb7\xe6\x9e\xb1\x7b\xe1\x7c\x3d\x2d\xa0\x9f\xe7\xbf\x56\x58\x82\x8f\x2f\x1a\xfc\x83\xc7\x75\x5a\xaa\xb2\x2c\x58\x0b\xc4\x72\xb1\x7f\xb8\x1d\xe3\xb9\x77\x49\xae\x41\xa6\x65\xc5\x89\xb2\x83\xf6\x66\xf4\xc5\xb0\xd8\xc2\x4f\x3a\xf2\xcc\x80\xdf\x3c\x18\xd2\x01\xb3\xbd\x30\x4f\xe3\x65\xd7\xc7\x04\x4b\xbf\x97\xa1\x39\xd4\x1b\x82\x0f\xae\xc7\x3e\x31\x00\xdb\x68\xd8\xde\x57\x5c\xec\x76\x99\x26\x91\x19\x81\x7b\x1c\xfc\x87\xca\x87\x5d\x0b\xee\x1a\x32\x0b\x2d\x34\x7c\x54\x97\xf9\x02\x48\x04\x07\x5e\x85\x89\x3b\x63\xf7\x83\x2e\x95\x0f\xf1\xb5\xd9\xf8\xe0\xbc\x95\x7a\xf2\xb2\x8c\x0c\x30\x6c\x7d\xf8\xdc\x63\xc1\x8e\x26\xd9\x5f\xbb\x0a\xc8\xac\xaa\x1f\x2b\x5e\xaa\xbb\x36\x6e\xe5\x9d\xee\xb1\x69\xff\x9d\x05\xbf\x7f\x39\x15\x63\x8d\x8a\xac\x76\x3e\xbc\xa5\xae\x13\x6f\x24\xdc\x3a\x43\xe5\xa5\xea\x34\x3c\x18\x94\xba\xeb\x62\x56\xc0\xa4\x25\xe7\x19\x87\xbf\x2c\x0a\xb1\xdc\xbe\x33\x68\x0c\xb3\x78\xae\x3a\xcf\x69\xc3\x77\xcc\x99\x7e\x12\x9e\xa7\xdb\x22\x2f\xf0\x8f\xc2\x12\xd2\xc6\xa6\x3b\xd7\x4a\xee\x17\xbb\xb9\xc9\xe1\x86\x6d\xf2\x08\x90\xff\xd9\xd2\x42\xee\xe0\x58\x69\x3a\x5f\x5c\xf8\x5d\xe6\xc9\xec\xbd\x3c\x59\x3f\xd1\x82\xd9\x12\x31\xe1\xe2\x4f\xdc\xf3\x84\x9f\x2f\xbf\x58\x36\xbf\x20\xb8\x2d\x1b\x73\xe6\xd4\xed\x75\x32\xcb\x40\xd7\x5f\xdf\x4c\x33\xd2\xa0\x8b\x52\xb4\x18\x0b\x03\xc3\x4c\x83\xc4\x10\x01\xbb\xb9\xe6\xbe\xe0\x7a\x75\x7c\xf9\x89\x19\xb3\x9d\xf9\x3f\xbc\x88\x71\xc1\x26\x5c\x29\xdb\xc5\xe9\x46\xbf\xa1\x7b\xc2\x87\xb6\x35\xd2\x3d\x54\xc8\x73\x4f\xe7\x44\x97\x4f\x7b\xa3\x98\xbf\xf2\x98\x76\xc8\x0d\x66\x5b\x9a\x71\xd7\x51\xe3\xc3\xc0\xec\x4c\x8c\x1f\x7e\x72\xe4\x50\x4f\x5e\x9b\xcd\x8c\xe1\x8c\x4c\x51\x5b\x6f\x46\x54\x59\xe8\x11\x27\x30\xe1\x29\x2c\x24\xd8\x0b\x4d\x81\x6d\xf7\x2e\x44\x60\xa5\x77\x33\x93\xa6\x6c\xb9\x02\xe3\xf0\x93\x8d\x6f\xb5\xdf\x4f\xc8\xa6\x1e\x3a\x33\x8f\xb6\xcb\xf6\xa8\x1b\xc2\x81\x76\xf5\xe0\x5e\xd3\x43\x7e\x72\x2a\x7f\x71\x77\xcc\xd6\xdb\x93\x30\xee\x5c\x26\xc6\x07\x7b\xfe\xe5\x26\x20\x4b\x34\x33\xc8\x2c\xc6\x9e\x01\xbe\x95\x87\x71\xf7\xb4\x63\xe0\x8d\x3d\x94\x71\x9b\xe1\xd4\x69\x61\x6e\xb4\x0c\xfc\x16\x7a\x4e\x19\x34\x33\xfd\xda\xfe\xfc\x6b\x57\x17\x89\xa7\xbb\x38\x3d\x78\x36\x2f\x54\x98\xea\xee\xe5\x81\xc5\xaf\x70\x2d\x5b\x36\x8f\x6b\xf6\x7a\x1f\xcb\xaa\x93\x89\xdf\x92\x10\x05\x4f\xf1\xf3\x63\xa5\x0d\xf3\x18\x41\xe9\xfd\xfd\xd4\x03\xbe\x2d\xf1\x80\xeb\x3e\x69\x64\xe2\xde\x7a\x24\x80\xc7\xf3\x18\x08\x9b\x58\x19\x99\x3c\x19\x99\x98\x33\x85\xa5\x09\x97\xe1\xff\x56\xbb\x97\xdb\x15\xa6\x1a\x55\x8e\x68\xe5\xeb\x78\xdc\x17\xc7\x6b\xce\xf1\x18\x9e\xdd\xb9\x13\xdb\x0f\xf3\xbe\xbc\xaa\x3d\x03\xcb\x3b\xad\x8b\x3b\x59\xd8\x00\x9e\xe9\x45\x9e\x75\xe3\xa5\x90\x5b\x44\xb0\xe0\xa9\x2b\x13\x7b\x8b\x27\x68\x4e\x13\xa3\xc4\x49\x9f\x3c\x6c\x48\x72\x7b\x0b\x59\x2b\x8d\x02\xf6\xb8\x2f\x07\xa3\xb0\x0c\x70\xc3\x1c\xe6\x41\x8f\x73\x78\xf2\x81\x98\x78\xe2\xee\xed\xe7\xb6\x6e\x74\xa6\x05\x37\xd8\x7c\x85\xa7\x8d\x8c\xdc\x56\xfa\x57\x8f\xac\xf4\xeb\xe1\x59\x7f\xfb\xbc\x02\x5a\x43\xe8\xf0\xf9\x23\x78\x70\x50\xb0\x78\x28\xd8\xb1\xeb\xbc\xf9\x3d\x86\x15\xcd\xba\xd3\xda\x72\x4b\x31\xe5\x95\x3b\x1c\x4d\x26\xf0\x8c\xe2\xcb\xac\x0c\x63\x8c\x5c\x92\xc1\x8e\xad\x02\x63\x60\x5b\xe9\x32\x10\x71\x98\xd3\x5f\xc1\x28\x58\x08\x07\x51\x16\x9e\x39\xbe\xf0\x16\xc9\x6a\x59\x5e\x75\xa2\x95\xb3\x57\x84\x75\x58\x4b\xee\x15\x33\x63\x4d\x91\x74\x0d\xf6\x94\xbc\x09\x34\x47\x0a\xd7\xea\xab\xf0\x68\x21\xb3\xe8\x15\x20\x59\x88\xb3\x30\x6d\xd5\x9d\x32\xdf\x6e\x3f\x46\x17\x08\xd7\x78\x17\x8e\xe9\x3f\x20\x30\x80\x6b\x37\x98\x75\x97\xad\xaa\x8c\xbf\xf1\x3e\x85\x19\xec\x82\x75\x67\x7c\x9d\x26\x3d\x00\xdf\x93\xa9\x4e\x1a\x66\x04\x0b\x4a\xef\x70\xf3\x4f\xd9\x9d\x91\x0f\x99\x5f\xc8\x73\x86\x6c\xce\xa6\xe8\x2e\xfa\xe9\x22\xb8\x6b\x89\xc3\x1c\x5b\xe0\x71\x35\x8e\x66\x46\x1c\x6f\x3e\xe6\xc9\x84\x7d\x67\x6e\xe2\x3e\x8c\x40\x42\x9d\x26\x66\xc1\x47\xe1\x9d\x77\x48\x4b\xa9\xe3\xc9\x7c\x19\xbe\x5f\x5e\x84\xdf\xb2\xf8\x37\xdf\x10\x7f\xe1\xb0\x4e\xa7\x27\xa6\x8b\xa5\x7a\x3c\x81\x48\x95\x78\x9f\xfc\xb4\x96\x39\x3d\xe8\xf2\xef\x5c\x8e\x3e\xc9\xe5\x75\x93\x12\xe9\x63\x63\x86\x60\xe7\x48\xbf\xea\x9e\x5e\x58\xb2\xe4\x91\xb0\xc2\x13\x47\x1e\x70\xe8\xb3\x99\x44\x9a\x5d\xf7\x66\x48\x19\xec\x04\x2c\xba\x58\xb8\x8b\x5b\xda\x4b\x66\x9a\x38\xa5\x5f\xbc\xbc\x5d\x6e\xac\x4e\xea\xfb\xb0\x9d\x6f\x1a\x68\x5b\x74\x3a\xb0\x99\xd7\xc4\x02\x98\x9d\x26\xd7\x97\x4c\x0f\x64\x89\x59\x15\x1a\x97\x3d\xd4\x96\x75\xe5\x73\x2c\xdd\xbe\xe2\xec\x0b\x11\x9e\x2b\xd3\x3b\xbb\x30\x8f\x85\xde\x70\x36\x1f\x87\xef\x6d\xe9\xcc\x96\x19\xad\xec\xa3\x50\x3a\xde\xee\x8d\x3e\x86\x0e\x9a\x01\x4e\x12\x62\x40\x9b\x70\x30\x5e\xb9\xdb\xe6\xe1\x9e\x9a\x95\xc6\x99\xf5\x00\x52\x21\xd1\xc6\x50\xc7\x31\xb3\x95\x9b\xa6\xe0\x63\x13\x74\xbb\xdd\x14\xae\x5e\x6f\x47\x7b\xf5\x93\x98\x4d\xdb\x0f\x5c\x60\x97\x47\xae\xd3\xb9\xf0\x8e\xb8\x7f\x2c\xf8\x98\x2c\xab\xf5\xb0\xed\x33\x2f\xc4\x14\xfa\xa0\x0f\x1e\xeb\xca\x9f\xb7\x2c\x2f\x77\x11\x8a\xef\x8c\x68\xed\x15\xb1\xbc\x6b\x5a\xe9\xb6\x1b\x7e\xb6\x0a\x06\x38\x72\x5c\xc7\x1b\x5c\x49\xc3\x49\x6c\xaf\x4e\x38\xab\x07\x51\x91\xae\x98\x11\x21\x2e\xb0\x0b\x8f\x85\x9d\x25\x26\x51\x22\xf8\xb6\x35\x26\xa0\xec\xd1\x3f\x4e\x37\x0d\xef\x9d\x07\x8f\xae\x20\x62\x8d\xbe\xec\xb2\x65\xa7\x45\x5d\x82\x93\x96\xac\x40\x8f\x89\xe7\x4b\x0e\xcb\xac\x91\xac\x1b\x20\x37\xfe\x5e\x47\x1f\x75\x8e\xf0\x81\x16\xcd\xbe\x08\x18\xfb\xc9\xc3\xcf\xf5\xc4\x6e\xcc\xa4\xef\xfb\xd7\xa9\xd2\xdd\x33\xfb\xee\xbb\x60\x21\x2b\x43\x47\x07\x28\xe4\xec\xb6\x2a\xd4\x21\x7c\x6f\xc7\x48\x15\x86\xbe\x30\xfe\x5a\x64\x08\x2c\x85\x72\x84\xb5\x3d\x37\xd3\x25\x22\x72\xcb\x95\xbf\x21\x29\xb9\x23\xf4\xdb\x60\xd7\xf1\x79\x2b\xef\x88\xbb\x13\xde\x1b\xdf\xd9\x66\x61\x62\x5d\xdc\x69\x32\xeb\xe0\x99\x92\xff\x41\x9a\x8a\x7f\x71\x50\x57\xf0\x67\xb9\x33\x2c\x54\x36\xb2\x9e\x71\xdb\xcd\x78\xc2\xb3\x73\x21\x2b\x2a\x49\xa7\x2e\x5e\x2c\xf3\xa4\x4f\x59\xdc\xd0\xc1\x64\x9e\x42\x1b\xde\x9f\xdc\x4c\xc5\xad\xc5\x22\x37\xa6\x18\x3b\xce\xf4\xef\x8d\xf0\x5b\x3b\x46\xf7\x89\xae\xd0\xbc\x7c\xa0\x9f\x0d\xc4\x46\xdc\xe5\x21\x16\x17\xc0\x7d\xe7\x88\x53\xf8\x8b\xad\x20\x54\xfe\x73\xf2\x08\x5b\x74\x6f\xbf\x0d\x36\x74\xa7\x35\xb1\x74\x0a\x05\x34\x45\x87\x8c\x34\x88\xa0\xfb\xc1\x0e\x23\xa4\x57\x37\x6b\x44\x07\xd2\x4d\x2d\xcc\x20\x5e\xe1\x29\x06\x83\xaf\xc5\x7e\xe5\x1e\x3f\xe9\x2f\x85\x5f\x63\xbe\xf2\x86\x22\x8f\x9d\x1c\x5e\x80\x89\x31\x9e\x9d\x9a\x9e\x01\xae\xbc\xc4\x7e\x30\x72\xda\xf2\xca\xec\x22\x92\x60\x62\x41\x45\xf0\x3a\x2e\xc8\x2e\x6f\xd3\x25\x9c\xad\xc8\x4e\x86\x7a\x76\xc7\x2d\x70\x75\x41\x4c\x0d\xed\xee\xeb\xca\x83\x4e\xfc\xde\x5f\x60\x53\xf6\x76\xde\xef\x78\x84\xa9\x1d\x83\x7e\x9c\x2a\x7e\x2f\x53\x9c\x7d\x1c\xf1\x68\x3d\xb1\x8a\x89\x7f\xcc\xca\x60\x7e\xaa\x42\x33\xfc\xab\xd9\x1e\x16\xdc\x6c\x67\xcc\x4b\x32\xd8\x2f\x17\xe4\xb5\x0c\x58\xc3\x2d\x07\x48\x14\xa1\xed\xc3\x2e\xf2\xc1\x25\x7a\xea\x3e\xd8\x7b\x45\x0e\xee\x09\x34\xf3\x08\xcb\x2b\x26\xfc\xd6\x27\xfd\x95\x39\x21\x5a\x52\x33\x7e\x93\x5c\xc5\xac\xe3\xbd\x9e\xdd\x54\xfa\x1b\xc1\x4e\xc6\x24\xfb\x44\xfb\xa6\xec\x15\x8b\xdf\xf3\xba\x4d\xb4\xcc\x1e\x5a\xe9\xda\xba\x57\xc6\x51\x18\x5e\x3c\xe3\x1e\x75\x12\x15\x5e\x89\xf3\x58\x4e\x2c\x1b\x7a\xc2\xe6\xf8\x25\x60\xc0\xdb\xde\xf9\xdc\x03\xdb\x77\x0b\x4f\x97\xd7\xd5\x9d\x89\xb3\xb9\xdd\xe5\x2a\x96\x32\x87\x5e\x6a\xcf\x63\x3d\x54\x7f\xf6\xed\xa4\xd7\xee\x11\x6e\xc1\x8d\xaa\xf8\x51\x88\x40\xd9\x65\xc6\x59\x6a\xf5\x08\xa4\x4f\xb2\x89\x40\x1e\x36\x9e\x21\x5f\x42\xee\x39\x22\x00\x9c\x33\x54\x7b\x16\x02\x95\x5d\xc5\x96\xa4\xb5\x4e\xf5\xc1\x34\x66\x57\x8e\x6d\xd6\x91\x3f\x99\xfa\x8d\xcf\xbe\x57\x1d\x95\xb4\xc9\x51\x98\x69\x93\x2f\x88\x2a\x2d\x8e\xe9\x48\x67\x39\x64\x0f\x88\x4b\xd4\x43\xe2\xb5\x17\xd5\x9e\xce\x07\xe3\x20\x7b\x72\x05\xed\x63\x6d\x31\x04\x3d\x7d\x7a\xd3\x19\xaf\x0e\x04\x32\xef\xf0\x10\x3e\x60\xf4\xe5\xa1\x9d\xb0\xab\xc5\xa0\x93\xdb\xea\xa0\x02\xde\x8a\x39\x33\x76\x62\x08\xfc\xbe\x1e\xdc\x58\xbb\xc1\x0f\x0b\x5c\x4f\x65\x42\x78\xb1\x92\x61\xea\x16\x65\x79\x9e\xa3\xda\x9f\xaf\xb2\x07\xd6\x16\xbe\xa4\xff\x33\xd7\x45\x3b\xc0\xa0\x0d\x11\xad\xee\x24\x33\xca\x44\xcf\x48\x57\x62\xbe\xfc\xcd\xeb\x72\x27\xb4\xec\xa5\x06\x3e\xf3\xcc\x87\x76\xa8\x81\xff\xb0\x66\x25\xda\x33\xdd\xa4\xb2\x42\x6c\x81\xec\x11\xf0\x6b\x25\x86\x8c\x33\x6c\x0b\x36\xe2\xbd\xf6\xb0\xf2\x07\x2d\x5c\xd8\xea\x5f\x1c\x50\x8b\x8f\x33\x2b\xaf\x7f\x92\x58\x06\x04\xb8\xb9\x44\xe7\x16\xa7\x89\xb8\x37\x51\x2a\xbe\xb1\xf2\x5c\xa6\x26\x16\x20\x14\x19\xaa\x27\xcd\x1a\x6e\x9b\x3f\x90\xad\x69\x87\xb5\xf3\x7f\x20\x22\x51\xf6\xfe\xdc\x77\x9d\x5f\x45\xf6\xb8\xed\x77\x1e\x66\xf3\x6e\xb6\x01\xda\xf8\x7b\x52\x81\x47\xae\xcc\xce\x70\x65\xdd\x7c\xc5\x29\x1e\xcc\x57\xb3\x90\xff\xd0\x95\x31\x5b\xbb\xb1\xbe\x61\x06\x95\x60\x73\x52\x4e\x4a\x78\x68\xb7\xcb\x45\x4c\x90\xaf\x95\xb6\x99\x86\x51\x7b\x88\x25\x9d\xca\x8b\xd9\x47\x5f\x01\x69\x31\x05\x5d\xf9\x52\xb6\x31\xc5\x7c\x2a\xee\x6a\x6f\xf1\x5f\xe0\x0b\x85\x19\xca\xb0\x9d\x04\x64\x0e\xb3\xd7\xac\xe4\x38\xe6\x2f\x52\x07\x9e\x45\x15\xd0\x87\x80\xa8\x21\x7f\x85\xd0\x0b\x23\xf3\xfd\xf9\x09\x28\x1d\x3f\x69\xb6\x19\x7e\xd2\x16\x9e\x17\xd1\x7e\x0d\xf3\xe0\x4a\x78\xd2\x83\xd5\x9d\xb7\x83\xf9\x66\xfe\xb5\x57\xc7\x2f\x27\x3e\xae\x00\x81\xab\xf1\x88\x9a\xed\x5b\x15\x56\x8b\x86\x51\xf8\x71\xa8\x8e\xfe\x97\xe5\x27\x00\x65\x9e\xcc\xfa\x27\x7d\x56\x6d\x4a\xec\xe6\xa3\xc2\xea\x55\x58\x93\x73\x61\x0e\xec\x88\x77\x43\x5d\x3a\x95\x08\xde\x76\xa9\x85\x8b\x1c\xc2\x3f\x12\x4f\xf8\xcf\x39\xfb\x66\x9a\xa1\xd1\xfd\xdd\x6a\x65\xb1\x8b\x88\x06\x0e\x3a\x1d\xb0\xbf\x23\x03\x89\x4d\x50\xba\x1b\x0c\x12\x6d\x84\xf1\xd2\x99\xdb\xa6\xde\x98\xdd\xd2\x54\xbe\x05\xbf\x46\xca\xf1\xa0\xcf\x1a\xe2\x77\xee\xb4\x11\x9b\x17\x20\x0f\x78\x0c\x5f\x5e\x5a\xdd\xf9\xee\xf8\xbd\xce\x63\xe1\x45\x43\xe5\x82\xa1\x5a\xa1\xb7\x7e\xe9\xf2\xc0\xa4\x63\x3d\x3d\xe8\xe4\xfe\x02\x26\x87\x0d\x3e\x99\x72\x4e\x0d\xf3\xde\x67\x96\xdf\xa6\x14\x15\x59\x1a\xdc\x47\x1d\xfe\x10\xb2\x27\x72\xee\x3c\x0a\xd5\xd2\xf1\xef\xb8\x50\x6f\xa2\x08\xf9\xb7\x2f\x82\x7e\x99\x19\x98\xc5\x0d\xa7\xaf\x98\x86\x05\x5b\xbf\xc8\xa8\x2a\xc3\xea\xf1\xe9\x95\x30\xfe\xba\x0f\xe4\x01\x74\xa8\x10\xe1\x85\xdf\x7f\x6d\x09\x5c\x8f\x39\xd1\x03\x85\xd8\x85\xc7\x81\xd7\xcf\xff\x43\x72\x04\x06\xff\xe9\x1e\x30\x09\x13\x5c\x41\x0f\x4a\x60\x70\x75\x1d\xbb\x25\xea\xa4\xaa\x74\x47\x32\x06\x1d\x89\x98\x49\xaa\xa7\xf9\x72\xeb\x09\xbc\x82\xce\xeb\x9c\x59\x15\x21\x32\x6a\x66\x4e\xe4\x8d\x24\x6c\x38\xc2\x74\xbc\xb7\x2a\xc3\x85\xfe\xd7\xb1\x3b\xe2\x1a\x87\x2a\x75\x66\x14\x56\x7c\xfa\xc9\xbd\xf6\xaa\x27\x39\x3c\x99\xb5\xab\xad\xe8\xa2\xbf\xb4\xc4\x5b\xc5\x6f\xd9\xcc\x22\x55\xbc\x05\x3f\x68\xcc\x48\xbc\x2c\xff\xe3\x96\xcc\xd9\x5e\x66\xe9\x09\x09\x45\x86\x07\x63\x81\x6a\x11\x21\x2e\xfc\x13\x42\x9e\xaa\xd3\x34\x05\xe6\x40\xc3\xfd\x22\x18\xce\xd2\x8c\x67\x53\x74\x22\x27\xd3\xb8\x3a\xb0\x08\xe8\xd6\x3f\xac\xfc\xe3\x94\x5f\x31\xeb\x87\xb3\xf6\x20\x34\xd6\x47\xe0\x0b\x00\x6c\x48\x3c\x5d\xc0\x37\xf1\x14\x69\xe5\xc3\x44\xbe\x22\x0c\x9d\x05\x32\xb7\x4e\x34\x32\xb6\x1e\x3d\xeb\x41\xb6\x41\x74\xc1\x15\xc1\x21\x2f\x1c\x52\x25\xbe\x2a\x68\x5d\x16\xed\x30\xc2\x64\x21\x8e\x16\x60\xc9\x2a\x44\xa8\xbc\x1a\x54\x27\x12\xbe\xc4\x5c\xd8\x12\xcf\xb6\x65\x47\x3b\x2f\x3e\x16\xca\xcd\x16\xf8\x62\x66\xcc\x19\xe4\x03\xfe\x0e\x5a\x8f\x25\x95\x83\x8c\x82\xfe\xed\xae\xeb\x25\xbb\xcb\x60\x03\xf7\x31\x92\xf0\x70\x72\x55\xe5\x1b\xfd\xfd\x38\x09\x9c\xdb\x6b\x92\x15\x13\x95\x17\xb3\x10\x5c\xbb\x33\x2a\xcf\x53\x7e\x60\x15\x5f\xe5\x59\xb0\x78\x83\x2e\x03\xbc\x3a\x49\x3b\xcf\x3a\x25\xbe\x88\x9d\x8c\xc4\x07\x9b\x6e\x51\x58\x55\x4c\x70\xb0\x92\xf7\x20\xf2\xb3\x90\xc9\x40\x0b\x77\x43\x34\x68\x0e\x05\x26\x5e\xd5\xf3\xc9\xd6\x20\x90\x2a\x2c\xf4\x23\xd3\xa3\xc1\xe2\xdf\xeb\x04\xcb\x4b\xc3\xe2\x67\xbf\x2c\x38\x39\xf7\xda\x9f\xbc\x67\xe4\x22\x58\x80\x89\x73\x9a\x11\x46\x7a\x2e\xa3\xa2\x7f\x3f\x29\xa2\x73\x7e\xc3\x9b\x57\x15\x11\xdd\xb9\x1d\xaa\x19\xc4\xfd\x4c\x02\x3a\xcc\xe1\xb3\x20\x86\x0a\x18\xbe\xc9\xc3\x54\xde\x6f\x40\x4b\xf8\x4e\x5d\x25\x3e\xda\x40\x63\x6c\x21\x0f\x5d\x8a\x6d\xec\x22\x67\x18\xb9\x4d\x9e\x57\x46\x07\xf2\x5a\x24\x4d\xbe\x69\x40\x7c\x99\x71\x43\xde\x34\x0a\x4e\x1c\xd0\x2d\xa2\xb3\xf3\x6a\x47\x20\x66\x01\x94\x09\xec\xde\xcf\xee\x87\xc9\xb4\x33\x7f\x80\x08\xd4\x99\xd9\x25\xf6\x74\x16\xec\x48\x87\xc3\x88\x2c\x91\xdc\x61\x0b\x75\x17\x93\xc0\xae\xc2\x43\xd4\x1a\xa0\xa0\xad\x22\xd2\xe3\x52\x9e\x0e\xfd\x99\x7b\x8c\x64\xcf\x8c\x7b\xd4\xd1\x11\x1e\xad\x49\xb7\xc6\x2d\x2c\xbd\x66\xfe\x54\xb9\xe7\x1c\xd4\xbc\x95\xa1\xa2\x83\x36\x11\xd1\x4d\x42\xfe\x19\xba\x00\x06\x64\x90\xa0\x5c\xdd\x0c\x0e\xfe\xe1\xde\x60\x73\xaf\x07\x64\x56\x1f\x7a\x87\xd0\x18\x2d\xda\xba\xf1\x08\xa4\xa5\xd7\x42\x65\x77\x52\xbe\xf5\xf6\xda\xca\x3e\x68\x42\x3d\xe9\xbf\x29\x84\xc7\x27\x0d\xf8\x8c\x44\x52\xe0\xf1\x76\xa7\xe7\xbf\xdc\xa2\x00\x5a\x66\x95\x3e\x68\x8e\xea\x9d\xd8\x93\x87\x7b\xac\x8f\xdb\x21\xca\x58\xe2\x45\x8e\xa1\xd8\x95\x83\x61\x71\x6c\x15\x36\x01\xc4\x16\xd4\xef\x70\x63\x76\x4b\x04\xf9\x48\x03\xd7\x0a\x9c\xb7\x56\x04\xb1\xd8\x8c\x1b\x75\xce\x64\x6c\x59\x0e\xb3\xf1\x37\xd4\xa8\x18\xe4\xbd\x27\x8e\x85\xdb\xb6\x47\x6d\x3e\x9d\x1b\x91\x40\xcf\x05\x04\xfd\x21\x7d\xf3\xef\x64\xbe\x9a\x86\xc0\x83\x9c\xcd\xc2\x83\x6b\x16\x2c\x18\x5e\x7b\xcf\x9b\x02\xa8\xa2\xd5\x27\x36\x82\x1d\x76\xe7\xf9\x44\x66\xca\xe9\xe4\xeb\x20\x4f\xa7\x52\x14\xa3\xc1\xc3\xdc\x38\x5d\xa4\x62\xe1\x32\x31\xb2\xda\xcf\x80\x7e\x7a\x0f\x2d\x89\x3c\x6f\x28\xdc\x9e\x73\x77\x13\xee\x7a\x47\x00\x73\xb7\xa3\xce\x9c\xf7\x41\x96\xeb\x08\x4a\xa7\xb8\x5b\x48\x27\x68\x34\xea\x9f\x5e\xe6\x91\x70\x25\x0f\x80\xdd\x6c\x9e\x13\x54\x57\x69\xf1\xbc\x4c\x71\x63\x14\xa3\xdc\x64\x62\x6a\x55\x36\x65\x93\x5d\x80\x9a\x79\xe9\x68\xe6\xeb\xc4\xe8\x79\x2a\x81\x90\xbe\x5b\x98\xa7\x9b\xe7\xc8\x81\x40\x38\x0b\xe2\x88\x2b\x3a\xc7\xb4\xc5\x4f\xab\x87\x78\x0a\xcb\xd2\xcc\x64\xd0\x56\xe6\xc9\xca\x91\x79\x24\x86\x19\xa2\xeb\xcd\x69\xc3\x81\x49\xf7\x3b\x81\x8a\x97\xc2\x95\x1c\x0c\x58\x62\x64\x3c\xbc\xa7\xd0\x4c\xde\x0a\xcf\xb5\x6f\x0a\xef\x02\xfc\x27\x4a\xb9\xa9\x50\x1c\xb9\x14\xc3\x40\x82\x7e\xfe\xe2\x13\xb6\xdd\xae\xb8\x1d\x21\x40\x5f\x53\x9f\xfe\xe2\x95\xcd\xf0\xcd\x6b\x7a\x2c\x72\xd5\x8b\xdb\x07\x92\x23\x3c\x51\x25\x0d\xca\x92\xd3\xe0\x10\x79\x95\x00\x56\xe6\x15\xe0\x6e\xe0\xdb\xa3\xce\x75\xd4\x28\xf8\xd6\x67\x1c\x60\xf3\xc9\xab\x2a\x87\x00\x45\x6f\xf0\x4c\xbe\x05\x24\xa7\x82\x8c\x88\x75\xae\xef\xa5\x21\x62\x7c\x88\x1b\x6a\xeb\x84\xcb\x65\x72\x27\x85\x32\x76\x60\x08\x50\x25\x50\xa8\x76\xf8\x96\xe1\x3c\x14\x50\xc1\x57\x10\x8e\xd8\x62\x6b\x87\x7c\x57\x9d\xf9\xd9\xea\x19\xf9\x41\xf4\xc0\x31\x24\xb9\x4d\xa2\xc4\xeb\xe6\x40\x1b\x2f\x8f\xaf\xde\x20\xa2\x75\xc7\xd3\x69\x81\x45\x23\x14\xe3\x01\xcd\xc8\x47\x85\xa8\xd8\x8f\x72\xbf\x3c\x3c\x90\xc3\x8f\x7a\x65\x37\xd1\x3b\x9c\x0f\x3e\xbf\x45\x7a\xeb\xb5\x8e\xbb\xee\x6d\x64\xf7\xbb\xc2\xd6\x4e\xd0\x7e\x4f\x0c\xc3\x9f\x97\x18\x26\x00\x6f\x06\xf3\x01\xd4\x5b\xc8\x9c\x3b\x9d\x57\xfb\x39\x33\xb1\x49\x25\x8b\x25\x90\xc3\x81\x39\x3e\x9d\x07\xaf\x01\xd2\x38\x73\xc0\x07\x2b\xd7\x0e\xf5\x90\x13\xef\x96\x43\xbb\x17\x41\x08\x31\x98\xa3\x06\x13\x17\xee\x90\xa5\xae\x53\xf5\x11\x07\x05\xb9\x52\x1e\x6c\xc8\x53\x6c\xf5\x6e\x87\xa9\xd4\xb0\x98\x49\xf6\x03\x48\x3c\x76\xe3\x17\xc7\xda\x32\xbc\xe2\x9f\x84\x47\x7d\xd9\x63\xf3\x6e\xc1\x89\x37\xce\xe9\x9e\xe6\x82\xd5\xc2\x91\xaa\xc1\xbd\xc5\x37\x01\xdf\xec\xb2\x80\xa0\xe5\xd1\xd6\x95\xbb\x68\xdf\x83\x0f\x57\x46\x27\xe6\x95\xd6\x9b\x1f\x93\x10\x3e\xce\xd7\x06\xae\x1e\x33\x89\x78\xb5\xb1\x68\xcc\x5f\xd5\x18\xcd\x2a\xd9\xb7\x4a\x21\x7d\x6e\xab\x8d\x35\x2a\xad\xd3\x4d\x09\x57\x38\x19\x75\xbf\x29\x53\x8a\xd4\xc8\xd6\x4a\xdc\x24\xcb\xc1\x68\x9d\xba\x0a\x2b\xaa\x56\x07\xf3\xd6\xf9\x15\x75\x06\xcb\x34\xcc\xcb\xf2\xd0\x4f\x55\x5c\xbb\x17\xed\xce\x98\x07\xda\x0d\x42\xa4\x8c\xf3\x56\xa5\x8c\x3a\xdf\x7a\x26\xbb\x2d\xd3\xd9\xb2\x33\x3b\x17\xb4\x80\x93\x02\xb3\xad\x15\x67\xca\xec\x30\x43\x44\x0c\x66\x1f\x9c\xb9\x17\x24\xa0\x2a\xaa\x06\xcc\x0d\x43\x1e\xd4\x2f\x08\xab\x04\x85\xdc\x19\x1c\xcc\x2e\x16\x7e\x0a\x3c\x2a\x2d\xf7\xc8\xb2\x9e\x19\x7e\x7c\xd0\x4f\x92\x15\x18\xc9\x79\x11\x8c\xd2\xf8\x08\x7c\xf4\x97\x57\x3f\x1e\x0d\x1f\xef\x58\x92\x63\x6e\x74\x53\xf5\x2b\x36\x91\x4c\x4a\x3b\x85\xac\x72\x6c\x65\x96\xff\x7e\x34\x33\x01\x9a\x24\x0c\x74\xb1\x15\x9a\xaf\x83\x5b\x49\x9d\x6a\x81\xe2\xfd\x34\x5f\xc7\x17\xae\x57\xaa\x10\xd0\x8c\xae\x7b\x0b\xc7\xbd\x54\xb9\x3c\x78\xce\x09\x55\x5a\x74\x4c\x72\x6f\xc2\xc9\xdb\x05\x6b\x34\xfe\x1c\x2d\x80\xff\x15\xbf\xc4\xa1\xdc\x96\x1e\x1c\x39\x5c\xfc\xf5\x9d\x23\xdd\xa5\x7f\x5f\x8b\x96\x18\xe2\x56\x3b\x1c\x34\x08\x20\xf2\x2b\xa2\xb4\x54\x66\xd3\x69\xb0\x3d\xb7\x7d\x1c\x2b\xe2\x1a\xb7\x39\xb3\x38\xe6\x9b\x18\x08\x7f\x93\x18\x0f\x9e\x0f\xdb\xc9\x21\x5c\x9c\x45\xce\xb6\xb3\xca\xbc\xd1\x2e\x21\xec\xa2\x65\x6e\xfb\x78\x0b\xda\x28\xdf\x23\x62\x72\x3f\x8d\x8f\x85\x36\x84\xf1\x1c\xa1\x41\xad\xd8\x3d\xab\x56\xfc\x48\x8f\xf0\x2b\x02\x9e\xdd\xbf\xd1\x6c\x97\x25\xb2\xee\x70\x3e\xe7\xa6\xda\xf1\x73\x21\x7f\x15\x14\x3c\x22\x52\x89\xbc\x2b\xb2\xc5\x89\x0c\x30\x3d\x1f\x59\x8e\x76\x16\x07\xd3\xac\x6d\x68\xd5\x3b\x9c\xd5\xec\x2c\x66\xec\x3b\x92\x33\x9a\x51\x78\xd6\x87\xd3\x6d\xf9\xd2\x76\x4f\x11\xd7\x9e\xdb\x4b\xcc\x0d\x07\x5d\x64\x95\xb6\x38\x97\xa8\x1f\xea\xd5\x18\x57\x10\x60\x12\xa3\x30\x18\xfc\x7a\xbf\x7c\xda\x0e\xab\xfb\x48\xd6\x8a\x5d\x05\x8d\xf1\xa3\xe0\x6d\x73\xdb\x42\xa4\x7b\xfc\xec\x02\x00\xd3\xcb\x42\xb5\x76\xd1\xab\x19\x2a\x1e\xe3\xcc\x12\xa6\xb3\xf8\x79\x64\x56\x6e\xb3\x19\x03\xc4\xd9\x65\x77\xa6\x83\xbc\x75\x12\x65\x09\x2e\xa6\x5d\x71\xd2\xf4\x6e\xc8\x5e\x0e\x2e\xa8\x67\xd0\x2c\x67\x20\x27\x94\x1b\x75\x87\x2d\x74\xf4\x50\x79\xee\x60\x6e\x73\x30\xdb\xb7\x23\xc6\xcb\x6d\x1e\x9c\x39\x98\x08\x7d\x43\x5e\xb5\x44\xb3\xaa\x71\x64\xad\xf0\xd3\x7e\x4e\x5c\xfb\x05\xeb\x8a\xb7\x35\x67\xc7\xda\xa9\x20\x7f\xb7\x1a\x7f\x5a\x69\x54\xb7\xcc\xe2\xf4\x87\x70\xd2\xb3\xd9\x1b\x10\x92\x96\x56\x1f\xdb\x6a\x2f\xf2\x46\x89\x38\xab\x4b\x4a\xa5\x8e\x0f\x57\xd3\x99\x22\x00\x0f\x26\x46\x73\xbb\x5f\xdc\x24\x9f\xb7\x05\x3d\x22\x91\xf4\xce\x20\xcd\x89\x89\x2c\xee\x9f\x0b\xb3\x02\x6d\x8d\xf7\x0a\x71\x31\x97\x70\xde\x66\x01\xe1\x46\x82\x69\x4b\x54\x2d\x3d\x87\x14\x11\x05\x83\xe6\xbc\xc9\xa9\x46\x81\xd8\x41\xc5\x30\x72\x85\x79\x38\x00\xe1\xe0\x4f\xf4\x07\xe1\x4e\xe1\x45\x8e\xd6\xe2\xa2\x96\xad\x3f\x67\x7f\x03\x5d\x53\xf9\x5a\x1e\x05\xff\xa4\x20\x12\xa0\x89\xcb\x19\xd2\x3a\xa1\xbd\x62\x29\xda\xbe\x1b\x13\xbe\xc0\x5a\x0f\xdd\xff\xab\xb3\x44\x46\x70\x22\xf1\x03\xf9\x25\xa8\x78\x3c\x6a\xa2\x53\x88\x21\x3f\xc6\x39\x99\x89\x62\xd9\x6f\x67\x80\x4b\x27\x22\x4f\x3f\x7f\xdc\x62\x7e\x6e\xaa\x26\xd1\xf5\x58\x12\x73\x4e\x64\xf9\x17\x2e\xd0\x2b\x33\xd1\xd0\xa3\xf0\xec\x81\x2e\x97\xc4\x0b\x22\x40\x9a\xf6\xe6\x0d\xf7\xc0\xcc\xef\xe6\xe1\x19\xc5\x23\xfb\x13\xc4\x9a\x88\x21\xdd\xe3\x26\x58\xc8\xf3\x09\x2b\x22\xd7\x9f\x64\x32\x08\xef\x34\xb6\x43\xda\x3a\x2e\xef\x7b\x24\x24\x74\xf0\x3b\xd5\x50\x32\xa0\x9d\x68\x6f\x4c\xfc\xbd\x95\xce\x2c\x66\xcc\x17\xb3\x2e\xc2\xb0\xf8\xca\xbe\x29\xf0\x30\xaf\xa5\x25\x02\x50\x41\x62\xe2\xcd\x4d\xaf\xca\x6e\xb4\x80\xc2\xee\x41\x61\x06\xf7\x4d\x2e\x95\x95\x5c\x36\x95\x45\x5d\x84\x26\xe1\xa6\xde\x0e\x1c\x6b\x95\x0d\xa2\xa2\x35\x12\x66\xdb\xf0\xbb\xc8\x2e\x02\xb0\xf0\x05\xac\x37\x9b\xb5\xab\x9a\xb8\x7b\x4e\xab\x2e\xa2\x06\x48\xbe\x74\xc6\x19\x6f\x02\xed\x6b\x1e\x89\x2e\x8e\xe9\xb1\x45\x3a\x79\x4a\x45\xf7\x93\xbb\xa1\xa8\x53\x20\xde\xb2\xd0\xc2\xdd\xed\x1c\x46\x5a\xa3\xf6\x1e\xc7\x22\xbd\xb5\x4b\x19\xd5\x1e\xf1\x35\x37\x86\xe9\x9b\x1d\x4d\xe2\xe6\x2a\x1f\x32\x82\xc9\x2c\x75\x99\xa7\x7a\x28\x6a\xe8\x82\x48\x08\x5a\x17\x17\xa3\x55\x85\xdc\xea\x91\xf2\x51\xc9\xbf\xda\xc4\x14\x35\x73\x37\x85\x6b\x2b\x44\x3e\x09\xdf\xfa\x15\x72\xdf\x0e\xdb\x64\x51\x5e\x3a\x18\x73\x6c\x39\xff\xe5\x5d\x0b\x68\x9d\x34\x91\xbd\x8f\x0a\xd7\x4a\x0b\x9a\xf5\x16\x29\xf8\x20\x7b\x12\xb1\x21\x2b\x4c\x5c\x71\xc6\xce\xe5\xdf\x02\xc2\x9a\xb9\x32\x8b\x6c\xc0\x76\xc1\x94\x30\x76\xec\x98\x7d\xe7\x08\xbe\x1d\x14\x51\xf9\x31\xd0\xf4\x63\x6b\xc4\x37\x70\x9f\x18\x8c\x6d\x9b\x60\x7b\xe4\x61\xb0\xb2\x28\xc2\x04\x74\x60\x67\x6a\x5e\x55\x91\x51\x37\x86\x6d\x6d\xe6\xae\x32\x64\x71\x58\x9f\x89\x04\xd2\xc5\x62\xe6\x9e\x15\xc7\xcd\xdd\x2b\x3e\x65\xc9\x1e\xfe\xa9\x1d\xa2\x8b\x6a\x32\xa2\xee\x1b\x7b\x03\x58\x62\x73\x16\x24\xdf\xec\x37\xe2\x19\x33\x21\x20\xd6\x3b\x50\xbf\xc9\xaf\x01\x6a\xcf\xc1\x91\x42\xd9\x99\xf4\xf9\x87\xda\xca\x96\xfc\x99\x59\x9b\x7e\x93\x95\xcc\x02\x87\x5d\xc0\x67\x14\x70\xbf\xfd\x56\x25\xca\xf2\xfb\x15\xd7\xcb\x96\x78\x1c\xc3\x33\x6f\xb9\x38\xd9\xaf\x73\x62\xe7\x31\x0e\x0e\x4a\x24\x44\x21\x97\x86\xbc\xa3\x7e\xd0\xd8\xaf\x3c\xff\xf9\xf8\xaa\x0a\xdd\xd4\x44\x24\x72\xc3\x08\xd4\x77\xad\x8a\xa5\x67\x5b\x56\xb4\xee\x4e\x66\x52\x2e\x58\x59\xa7\x9c\xe5\x54\x92\x12\x1e\x8b\x1a\x5d\x9c\x3e\x07\xa4\xca\x2d\x99\x6d\xd4\x48\x2b\x7a\xef\xd0\x55\x9e\x54\xa1\x39\x48\x22\x31\x2b\x17\x3e\x24\xb7\x12\x66\x04\x3c\xbc\x2c\xa8\xf1\xaa\x0a\x5a\x96\x20\x9a\x33\xc3\x55\x5d\x74\xae\x03\x40\x64\x52\x24\xc2\x7c\x0c\x30\x44\x0f\x82\x59\x76\xa6\x93\x90\xae\x3b\x49\x53\x9e\xe1\x92\xe6\xe1\x79\xca\xad\x01\x1b\xa2\x3e\xa8\x48\xc6\xb4\x75\x7f\x06\xab\x83\x16\x4b\x09\xf3\x29\xee\xfd\x78\x8a\x6a\xd1\x8a\x8a\x40\x55\xdc\x6d\xa8\x60\x88\x55\x15\xe1\x0f\xc7\x8d\x9f\xeb\x2e\xf0\xc6\xd8\x63\x51\x75\x05\xc7\x08\xb9\x0d\xac\xac\x2a\x0b\xd8\x8a\x45\xa9\xad\x02\x4e\x7a\xba\x5d\xe7\xb2\xc5\x30\xdb\x29\x96\x2d\x0d\x91\x99\xc5\x53\x4e\xfa\x90\x11\x75\xd4\xb7\xf1\x72\x10\x16\x47\xc4\x36\x56\xb9\xb7\x16\xc3\x79\x6a\x2f\xab\xa1\xb2\xc6\xc3\x39\xc0\x3c\x92\xa9\x2b\xc4\x86\xdd\x7d\xb2\x6d\xaa\xbe\x85\x84\x6d\x16\x98\x25\xa6\x0e\x76\x57\xd9\xa5\x43\xe0\xfb\xf0\x10\x8c\xc0\x4d\x8a\x02\x42\x1c\xfc\x3a\x5c\xf1\xfc\x1c\xc0\xbd\xc5\xc5\x2b\xd9\xb2\x51\xcd\xb5\x53\xd2\x22\xba\x8d\x86\x68\x4e\x0f\x27\xf5\x22\xa6\x33\x0b\x78\xbb\x18\x76\xcc\xe7\x4f\x72\x86\xd8\x33\xf4\x47\x59\x66\xb8\x35\xcf\x46\xf3\xf1\x69\xab\xcc\x28\x8e\x71\x86\x9d\x3e\xf6\xdd\x31\x37\xf5\x92\xb4\x3d\x1a\xc9\x30\xe0\xa8\x32\x51\x47\x77\x0b\xbf\xc1\xdb\x11\x78\xfb\x80\xbc\x04\x58\xcf\x32\xd0\xb3\x0c\x4b\x52\x31\x6d\xff\xef\x64\x4c\x6d\x3e\xe8\x4f\x00\x33\x4b\x03\xf7\x71\x50\x57\x25\x63\x65\x5e\x5b\x65\x0a\x0c\x0b\x5d\x09\x7d\xd4\xcc\x98\xef\x60\xf3\x41\x12\xd1\x19\xc5\xfa\x88\x05\x36\x99\xb3\x74\x20\x9c\xe1\x13\x5a\x18\x7c\x72\x77\x19\xf3\x89\x3f\x6f\xe6\xeb\xe4\x69\xb3\x44\xc3\x0c\x73\xa0\xfb\x04\x20\xe1\x8e\xec\xea\xf1\x3b\x26\xd2\x88\xec\xc1\xed\x21\x60\x7c\x1b\xbf\xd6\x0e\x9d\xcc\x73\x77\x06\x35\x8d\x98\x5d\x9a\xa2\xbe\x8d\x05\x58\x68\x14\x17\x05\xa8\x8d\x94\xc0\x4a\x38\x8b\x40\x03\x8b\x30\xf6\x11\xc8\x85\x98\x04\x63\xd9\x40\x88\x55\x78\x43\xd6\x2e\x6e\x29\x02\x44\xb1\x96\xf6\xa2\xea\xc0\xbc\x88\xf1\xd5\xe1\x5c\x9c\x9e\x69\xb5\x87\x7d\x9c\xcd\x17\x1e\x0d\x6b\x33\xdb\xa2\xf0\x70\x8b\xa2\xb4\x53\xa4\xe0\x9c\xf3\xa0\x84\xdb\x63\x1f\xe1\x63\x9d\x02\x34\xb4\x83\x82\x6a\x44\x5c\x56\x6c\x53\x44\xa5\xda\x3b\x6c\x79\x02\x6e\x60\xf1\x64\xb9\x7b\x27\x68\xe2\xc5\xc0\x2b\xe7\x07\x62\x9a\x7c\x57\xeb\x97\x39\x81\x9e\xe2\x12\x8c\x6d\x5b\xe1\x8f\x1c\xaf\xe2\x7d\x1d\xc3\x79\x5d\xf2\x70\xad\x6d\x13\x23\x51\xc1\xc7\xea\x48\xa9\xea\xca\xa7\xf2\xce\xc3\x3f\xba\xbf\xe7\xc5\x23\x04\xe7\x82\xe1\xf7\xcc\xb2\xaa\x53\xcc\x26\x85\x10\x62\x31\xd2\x04\xe1\xf7\x9d\x1b\x2b\x7f\x3d\xab\x5c\x5c\x66\x1d\xb7\xb8\xd7\xe0\xf5\x71\x89\xde\xb0\xa2\xde\x0e\xc1\xb6\xfe\x7b\x14\xcd\x7a\xcb\x2a\xfa\x8b\xcd\xea\x06\x0c\x39\x2b\xe8\x8c\x5c\x56\x1c\xd8\x55\x98\xe7\x5e\x59\xba\xf1\x16\x6a\x6f\xef\x21\x43\x52\x6d\x64\x6b\x11\xa5\x91\x17\x6a\x8a\xa2\xe7\xc3\x92\x04\x11\x09\xc9\x11\x97\x05\xc7\x79\x37\x3f\xcd\xef\xaf\xe7\x41\xa2\xc4\xac\xf6\x48\x96\x34\x57\x11\x96\xe7\xf4\x89\xf8\x2b\x3d\x15\x93\x3e\x1e\x0d\xc5\xa0\xa5\xcb\xcb\x4f\x0d\x6c\x17\x3e\x03\xed\xe2\xc1\x04\x8d\x04\x5b\x25\x30\x4b\xdc\x32\x4b\xff\x8f\x45\x67\x6c\x6b\x11\x02\xf0\xe9\x41\xff\x95\x05\x86\xb2\x10\x72\xfc\x7c\xf3\x36\x36\xda\x60\x0b\xd2\x76\x6e\xde\x29\xa3\x2a\x32\x86\x97\x63\x2c\x1f\xe2\xdb\xdf\x27\x46\x80\xad\x9b\xbd\x3b\x8f\xa3\x8a\xca\xad\x7a\x49\xf9\x3d\x18\x1a\x1e\x2d\x8d\xa0\x33\xb0\xdf\x50\xb8\x70\x4c\xc4\x18\xa0\x7d\x5a\x82\x32\xa9\xe0\x90\xa2\x5d\x9b\xed\xa6\x7e\x4e\xdb\x06\xd7\xeb\x36\xde\xc5\xf8\x2d\x2a\x96\xdc\x65\x2f\x10\xef\xd1\x00\x2d\x00\x12\x82\xa6\x85\xfc\x07\xbf\x57\x38\xe6\x9d\xdd\xc8\x4e\xda\x73\xd3\xa7\x80\x7b\x9a\xc8\xfa\x71\x3c\x76\x4d\x37\x61\x1e\x0c\x47\x1d\xec\x2a\x77\xbe\x57\xdc\x15\x0f\xc0\x0e\x06\x91\x6c\x1f\x42\x7e\x08\xc4\xf7\xf1\xc1\xc5\xdd\xce\xcc\xce\x70\x26\x20\x5d\x55\x2c\xe3\xe7\x3c\xce\x97\xf3\x48\x93\x12\x5f\x98\x85\x46\x4a\x46\xdc\x87\xd5\x47\xf5\x16\x5f\x94\x8d\x0f\x09\x5e\x1a\xb1\xa5\x25\xf3\xf0\xdd\xc5\x21\xf1\x36\xe5\x1d\xab\x0a\x6b\x16\xd1\xd2\x61\xd9\x83\x1a\xd0\xbd\x70\xca\xe7\xde\x17\x66\xe4\x33\xb8\xd7\xf7\xb2\x51\x3d\x00\xd8\x24\xb9\xa1\xce\xcb\x98\x1b\x11\xfb\x95\x98\x63\xa9\x5a\xe0\x3c\x47\x50\x83\xf9\x61\x73\x1c\x0e\xb2\x5f\x70\xf6\x40\x3c\xe8\x1b\xc0\x76\xd8\x5a\xe0\x36\xbd\x83\x9a\xd4\x3b\x58\xa2\x3e\x84\xe8\xc3\x66\x88\x7d\xbb\x50\x50\xb9\xe2\xa9\x10\x0e\x6b\x2c\x46\x24\x3a\x57\x40\x42\x8c\x8d\xdc\x03\x17\x93\xa0\xe7\xdc\x48\x5e\x4d\xb3\x85\xf4\x8a\x73\xde\xde\x61\x4f\x6a\xd3\x7e\x61\xe5\x01\x00\xb0\xb2\x0b\xb7\xa3\x56\x26\x10\x61\x5a\x3e\x45\xd1\x95\x55\xf7\x6d\x4a\xde\xb0\xa6\x74\x75\xa6\x2d\x0b\xfa\x88\x97\xde\xf0\xba\xcf\xc2\xe6\x9d\x22\x1b\x15\x4d\xfa\xaa\xc7\xf8\x92\x07\xfe\x56\x57\xe5\xde\x20\xc3\x36\x07\xe4\xbc\xc2\x20\xd5\x17\x9e\x6f\x47\x9d\xc0\x1f\xf8\x6d\x3d\xe6\x5d\x36\xe7\xf1\x11\xc3\x09\x1d\xdf\x47\x03\xa1\x14\x8c\xf1\x7a\x12\x26\xc4\x39\x11\x8d\xc3\x02\x72\xc5\x0b\x8b\x7e\xd1\x5e\xd1\x78\x81\xf6\x28\x96\xc7\xd4\xc1\xca\x56\x42\x56\x73\x82\x37\x90\x17\xa5\x99\x13\xfb\x03\x50\xf5\xc3\x07\x9b\xd5\x51\xca\x03\xde\x49\xd0\x34\x67\xed\x05\xf0\xb2\x41\x74\x9b\x9e\xed\x34\x7b\xb3\x66\xf6\x55\xdb\x68\xae\xac\x59\xb5\xd8\xf1\xb3\x88\x89\x1a\xc7\xcd\x8e\x95\x1f\x9b\x86\x14\x74\xe9\x90\xa5\xf1\x07\xb3\xe5\x12\x8c\x67\x4b\xcb\xe0\xc6\x16\x6e\x8f\x34\x3b\x1d\xb4\xb6\x95\x3d\x21\xfe\x3b\x49\xf7\x50\x0d\x1e\x01\xcc\x39\xb3\x3c\x62\xdf\x04\xbb\x68\xa1\xd8\xc8\x2b\x1e\x2e\xd7\xfb\x54\x75\x32\x1c\x68\x46\x76\xe8\x40\xdb\x9e\x08\x96\x26\x51\xe2\xbc\x6b\x00\xb0\x44\x65\x43\xbf\xd9\x22\x82\x4f\x53\x40\xeb\xde\x67\xcc\x20\x05\x05\x7d\xf8\xd8\x73\xb8\x72\x75\x61\xbe\xa0\x2d\xd1\xc3\xee\x4c\xe8\x41\xca\x8a\xd4\x8e\x9c\x42\xd2\x3a\x83\x2d\x6b\x1f\xcc\x6a\xd3\x44\x26\x98\xa7\x00\xf6\x29\x64\x09\xda\xe3\xb3\x9c\xeb\xd5\xa6\xab\x79\x85\xec\x90\x65\x78\x53\xbe\xc4\xcf\x80\x32\x51\xca\xb6\x74\x8d\xe3\xd8\xa0\x9e\xb7\x87\x16\x0b\x8d\x93\xcb\xab\xfc\xa1\x95\x0f\xf7\x6b\x21\x3d\xfe\xc1\xf1\xa6\xa9\x65\x1c\x41\x77\x62\x4e\xc6\x02\x70\x60\xfa\x02\x2b\xdf\xea\x38\x29\x4a\x19\xd1\x0a\x48\x62\x40\x3f\x7d\x7f\x93\x3a\xb0\xfe\x3b\xa3\x88\xcc\x7a\xc1\xac\x7e\x27\xd5\x16\xc5\x52\x8c\xc7\xca\xd1\xfe\x73\x8a\x8a\xe2\xaf\xaf\x37\x73\xc2\x54\x00\xc8\xc3\x43\xe7\x10\x4c\x87\x68\xa0\x24\x57\x12\x68\x4c\xf6\xa6\x7e\x98\x81\x73\x8b\x46\x88\x20\xba\xd2\x9b\x22\x10\xe3\xee\xa3\xa2\x83\xe6\x86\x20\x7b\x90\x4d\x09\xaa\x11\x0b\x49\xe7\xb4\xb4\x52\x4b\xa7\x06\xc1\xe1\x02\x23\x9c\x97\x25\x3c\xc0\x8d\xcd\x5f\x72\x27\xcc\x02\x7b\x32\x82\x93\xb5\x46\xc1\x7a\xe1\x0b\x3e\x05\xc1\x1d\x42\x0e\x9f\x4b\x0e\x44\x41\xa2\x39\x9b\x36\xad\xf3\x0c\x1b\x9b\x15\xc4\x3f\x5b\x93\x17\xd9\x78\x43\x56\x2b\xd4\xb9\x04\x9d\xc4\xc5\x3f\xf0\x73\x3f\x35\x6a\x22\x0a\x12\xf1\xbc\x22\xd1\x6d\x8c\x46\x5f\xe1\xd8\x5d\x38\x20\x3a\xb2\xa8\x9b\x83\xff\xce\x84\xf8\x21\x78\xde\x42\xa7\x5b\x04\x3c\x3c\xdf\x71\x64\x40\x8c\xf3\x5f\xea\xb9\x53\xc8\x49\xfc\x0a\xa7\xb6\x5f\xcf\xb6\x2b\x88\x1a\xd0\xd1\xdb\xdd\xe5\x81\x7c\x8a\xaf\x7e\x54\xb2\x2d\x2d\x4a\x62\x89\x77\x53\xdc\x65\x9e\x07\x2f\x6d\x29\x9a\x5e\xab\x35\x9e\x98\x7b\x3d\x4a\x6b\x77\x8a\x04\x98\xcc\x3a\x44\xa1\x70\x6a\x21\xd8\x50\xff\x32\xb4\x51\xc6\xac\x27\x75\x00\x82\x66\x0c\x3d\x82\x84\x3b\xec\x93\x36\x5e\xc8\x88\x93\xc8\x9d\xb9\xa1\xe1\x5d\x70\xce\xf6\xd2\x51\x9b\x5a\xa8\xd6\xb7\xae\x8d\x97\xa5\x43\x65\x13\x1f\xb5\x45\x47\xce\x82\x52\xf7\x21\x71\x99\x57\x62\x81\x56\x1f\x6e\x16\x57\xce\x2b\x51\xae\x43\x95\x0e\x2c\x5f\x11\x74\xa0\x05\xf3\x03\x7e\xa3\xbf\x0e\x25\x32\xe1\xf9\x43\xa8\x21\x2d\x17\xba\xd8\x49\xd7\x81\x67\x3a\x48\x04\x0d\xaa\x54\x33\x26\x2a\xae\x61\xa9\x1e\x1b\xfb\x14\x9c\x49\x1c\xac\x37\x12\x2b\x0f\x09\x35\x74\x96\x6c\xdc\x5a\xa3\x23\x8f\xa6\xad\xd8\xe7\x4d\x70\x89\xdd\x63\xea\x5b\x40\xb6\x86\xd2\xfd\x29\x2c\xe2\x55\x36\x46\xf7\xa3\x84\x06\x2c\x54\xb6\xd5\x10\xa4\xec\x80\x69\xec\xb3\x73\x61\xb0\x68\x1b\xa9\x3f\xa2\x8d\xf2\xf6\x9a\x57\x9a\xeb\x8d\x34\x40\x54\xfe\x0a\x3f\x7e\x8a\x7b\xf0\x56\xc7\x6a\xee\xc7\xa5\x15\x08\x98\x1c\x71\x69\x26\xc9\xbe\x2c\xbf\xb1\x8d\x3c\xee\xf0\xd8\xd1\xf2\x56\x24\x97\x02\x96\x86\x02\x88\x7d\x54\xd7\x2b\xca\x86\x03\x6f\x6d\x94\xa0\xdd\x4d\x73\x91\x08\xb0\xa0\x19\xfe\xca\xfa\xed\xcf\x0f\xd0\x0f\x0b\x39\xb0\x6b\x1e\x2d\xca\xbc\x55\xf5\x29\x6d\xdc\x95\x8e\xa4\x4f\x75\x0a\x39\x1d\xdd\xdb\xe0\x14\x9b\xf7\x16\x73\xca\x54\xba\x49\xe6\x3f\xae\xa4\x82\x2e\x76\x02\x74\x26\xee\x28\xa6\xca\xc0\x39\x4f\x27\xb4\x6e\x2c\x6a\xb2\x45\x61\x60\x38\x15\xe1\x16\x43\x11\x99\xb4\x6b\xb4\x2d\x08\x4c\xa9\x9e\x1d\xd1\xd0\x77\x7f\xff\x17\x8a\xa2\xd3\x05\xe9\x31\x1e\x54\xdc\xbb\xc2\x1e\xe6\xad\xfe\x7e\x64\x95\x54\x6a\xb1\xdc\xb8\x35\x90\x4f\x61\x51\xdf\x4c\xc4\x6b\xb7\xb7\x72\xc7\x46\x2e\xfd\xe1\x95\x09\x55\x39\xc8\x57\x62\x58\xe5\x94\x03\x7d\x4c\xbe\x0b\x44\x85\x4c\xc5\x9f\x88\x57\x1b\x62\xbc\x65\x31\x1a\x9c\xfb\x13\x4a\x64\xe2\x80\x14\x42\xd3\x54\x7d\x68\xd0\x61\xb0\x1a\x8b\xf8\xde\xe7\x12\x3c\x25\x05\x0c\x68\x40\x65\xf6\xb5\xd1\xee\xce\x6a\xe4\xbc\x23\xc0\xbc\x85\xe1\xc4\x07\xa0\x94\xa5\xde\x5e\xaf\xed\x32\xaf\x18\x53\x84\x74\x0c\x7b\xe2\xd6\x45\x51\x48\x00\x4a\xe3\x20\xab\x8d\x78\x52\xbd\xae\x17\xd6\x14\xdd\xe9\x8e\x6c\x36\x53\x89\xab\xce\x78\x1a\x66\x9f\xc4\x8b\xab\xab\xd3\xad\x85\x3b\x6b\x55\x11\x3b\x69\x82\xa4\x1e\xb4\x3f\xc1\x66\x82\x85\xd5\xfb\x85\x87\xf6\xdc\x59\x26\xa4\x57\x73\x0a\xd8\x05\x30\x36\x08\x46\xf0\x71\x30\xe9\x1f\x5a\x2e\xb6\xe8\xc9\x42\x4b\x87\x6a\x39\x45\xd8\x13\x78\x0b\xbd\xaf\x3f\x2d\xfd\x53\xe9\x03\x0f\x4c\xbc\x73\x0b\x6d\xbf\x57\xa9\x71\xee\x47\x02\xff\xcc\xc2\x1b\xac\xe6\x14\x5f\x2c\xb9\x6a\xd4\xdb\x45\xeb\x74\xe7\x72\xa8\xe2\x3e\xd5\x0f\xfe\x74\xa5\x03\x25\xcb\xde\x06\x45\x6b\x31\xf1\xf2\xb3\xff\x74\x62\x17\xd0\x5f\x87\x33\xd3\xd4\xd7\xb1\x32\xb3\x60\x0c\x1e\x5d\xb0\x08\x68\xf7\x8f\x6d\x46\x3a\xb6\x12\x44\x3a\x7e\x58\x11\x7c\x83\xb0\xc9\x65\xba\x06\x3c\x60\x11\x45\x4f\x64\x4b\x65\x5e\x04\x12\x24\x8b\x64\x31\x3a\xfe\xf9\x2f\x9f\x30\x20\xa7\x9b\x3a\x0f\xb4\xf1\x27\x65\x34\xa3\x6e\x61\x31\x38\x44\x9b\x16\xcb\x0d\x05\xe8\xcb\xc1\xf5\x66\xae\x5b\xbc\x2f\x50\x87\x31\x63\x99\xc2\x13\x1d\x65\xd7\xb3\xb0\x9b\xff\x52\x1a\x90\x92\x84\xd7\xcb\x3c\x47\xbb\x85\x84\x59\x63\x42\x9d\xb6\x59\xe4\x34\x79\xfd\x38\x73\x95\xc4\xab\x40\x23\x02\x76\xcd\x23\x62\x4a\x16\xfc\x77\x96\x55\x81\x5d\x97\x88\x62\xb9\x34\x13\x3b\xce\xd1\x1f\xa7\x68\x85\x6c\x48\xdd\x87\x70\xec\x7e\xc8\x61\x9a\xc4\x2e\xa3\x15\x9d\x52\x27\x35\x01\x4f\x2f\xb6\x12\x38\x9f\x7a\xa9\xb6\x59\xc5\x2d\x36\xa8\xd3\x61\xf7\x59\xf6\x7c\x38\x17\x88\xe3\x7a\xbf\x0b\xe9\xfa\x7e\x9c\xaa\xea\x57\x0e\xbb\x34\x2d\x2e\x80\x76\x38\xcb\x7f\xa9\x02\xf2\x6c\xd9\xdf\x0f\x7f\xd7\x28\xb7\x9a\x3a\x4a\x23\x9d\x8b\x74\x6c\xaf\x1a\xbb\x36\xc7\x2e\x1d\xda\xe6\xc9\x93\xdf\x69\x9f\x10\xdb\x04\xe6\xa8\x56\x96\xa8\xf8\x6f\xaf\xa8\x32\x7b\xc0\xde\x5f\xdc\xcf\x49\xac\x10\xa4\xb0\x8a\x64\x5a\xe8\xa2\x7e\x63\xa6\xa2\x57\x2b\xdc\x02\x25\xb9\x47\x5c\x2a\xb6\xfa\xa4\xd3\x96\x68\x0b\xb6\xb0\x7d\x40\x99\xa6\x56\xb9\x78\x6b\xf9\xf3\xa6\x22\xbe\x87\x16\x1b\xa3\x2c\xea\xaf\x28\x8b\xa0\x2b\x74\x3e\x0f\xe1\xfc\x8e\x54\x9c\x1a\x5c\x79\xef\x22\x26\x2f\x0d\x68\xf2\xbb\x21\xe9\xe8\xf2\x62\xbd\x9d\x06\xc0\x73\x25\x9a\x33\xa7\x84\xe1\x7d\x2b\xbf\x15\xc7\x1d\xb6\xe9\x3a\xda\x1e\x9f\x0b\x61\x9c\xbd\x66\x4a\xbb\x6c\xe1\xd1\x12\x11\x2c\xea\x70\x24\xbb\xb3\xa1\xd9\x09\xc5\x2a\x80\x86\x14\x4e\xf2\xf8\xb5\x06\xe4\x36\xe8\x2a\x21\xb2\x91\xd5\x0e\xf5\x2f\xfd\x50\x54\x1f\x3c\x72\x1f\xc4\x68\xa4\xb0\xef\x18\x19\x92\xb7\x0b\xf3\x9c\xda\x6d\xd8\x5a\x74\x52\xd7\x20\xc9\x7a\xb7\x53\x73\x19\x8b\x5a\x36\xc0\x4f\xa2\x33\xde\x5e\x82\xbf\xf6\x74\x46\x52\x3f\x97\xc0\xa1\x42\xe8\x07\x04\x06\xf8\x09\xb6\xe2\x82\x6a\x26\x13\x3c\x31\xce\x93\xb6\x8f\x52\xa0\x53\xec\x51\xa7\x97\x20\x7e\x26\x97\x4e\xf5\x8d\x65\xbf\x2b\xbf\x03\x91\x5c\xe9\xfc\xc2\x1e\x27\x18\x11\xa9\xd6\x84\xe2\x1a\xdd\xa6\xed\x2a\x43\x3e\x54\x8e\xbc\x43\xf7\x08\xb3\xbe\x05\xcc\x76\x46\x57\x2f\xdc\x49\x57\xd0\x32\x4c\x13\xbd\x5a\x42\x8d\x02\x81\xca\x17\x1e\xfa\xe2\x98\x14\xe1\x87\x4e\x8e\xd9\x5a\x5b\x40\x24\x58\x53\x6e\x6a\x83\x11\xe0\x38\x8d\x41\x98\x41\xbf\xa9\x13\x23\x88\x72\xf0\xdf\xfc\x34\xca\x35\x8e\x39\x6a\x32\x51\x53\x7f\xa8\x4f\xd6\x3e\x98\xc4\xac\xb4\x3f\xc3\x72\x04\x36\xc5\xa8\xa7\xaa\x3b\xbe\x48\xea\xcd\xcc\x89\x50\x18\x34\x96\xe2\x01\xfd\x32\x6c\x4c\x66\x13\x5b\x43\xf0\x06\xe9\x62\xe7\x7b\xcf\x17\x93\xf9\x9f\xd3\xad\xe1\xc5\x8d\xfa\x22\x51\x3d\x0a\xd9\xc9\xcc\xd9\xc0\x86\xe1\x66\xb5\x1e\x2e\x8b\xf9\xa8\xd9\x1b\xb8\xf1\x76\x52\x56\x54\x8a\x52\x7f\x68\x36\x24\xf9\xe7\x4c\xe2\x99\xc6\x01\x20\xe2\x29\xd9\xe0\x6d\x3e\x71\x96\x59\x1e\xc4\x5a\x2f\x49\xd2\x71\xbd\x52\xfd\x59\x28\x49\x5a\xaa\x84\xb3\xd3\x4d\xd8\x55\xf0\x6b\x8e\xd0\xeb\xb0\x3b\x5e\x42\xbe\x35\xd4\x5e\xd0\xb2\x87\xeb\x0e\xf9\x86\x9d\x09\x02\xef\xba\x88\x8b\x01\x19\x95\xb0\x4a\xad\xce\x2a\x92\x88\x5a\x23\x64\x3e\xb6\x1c\x5a\xb2\xfb\xc8\xf8\xd3\xcb\x96\x6c\xcc\x35\xc7\xaf\x4f\x40\x17\x44\x95\x24\x04\xb7\x07\xd8\xb6\x64\x5c\x9c\x38\x7b\x0b\xcd\x52\x46\x90\x5b\x3c\x88\xa7\x92\x8b\x40\x89\xb3\x45\x5e\xde\x5c\xb2\xc8\x28\x0e\x59\xa0\x96\xed\xaf\xb4\xcb\x8e\x10\x36\x89\xf6\x30\x77\xda\xa4\xc2\x81\xc9\xe9\x2c\x0f\xcf\xe2\x98\x97\xa0\xd6\x4e\xa0\xd0\x7e\x3f\x9c\x3c\x9a\x90\x59\x52\x20\x0a\xc9\xad\x20\xb3\x4a\x3f\x76\x2e\x21\x4a\x7b\x48\x7b\x95\xe5\x7b\x5e\x84\xd5\xd2\x7e\x75\xec\x47\x66\xe9\xf9\x3f\x3e\x4b\x64\x81\x1b\x91\x45\x72\x03\x4e\x95\xbc\xa6\x41\x1c\x02\x67\xdb\xea\x2e\x29\xab\x5d\xcb\xb7\x9a\x18\xe3\xbf\x70\x16\x2e\x74\xde\x7a\x84\x0f\xd2\x68\x67\xa8\xdb\x82\xcd\xea\x4f\xf9\x02\x1d\xa1\x88\x3a\x77\xa8\x5d\x7e\x37\x57\x42\x0e\xcd\x54\xbb\x8e\x30\xc8\xc8\x4b\xf3\x87\xc2\xdd\x0f\x56\x98\xf3\xaf\xbb\x21\xb2\x6c\xa0\xbc\x69\xee\x66\xa6\xf4\x2c\x09\x45\x92\x9e\xba\x27\xb5\x24\x75\x11\xc8\x74\xd4\x26\x17\x67\xc9\xc3\x81\xee\xdc\x70\x5a\x91\x3c\x31\x88\xff\x43\x35\xfe\xee\x8c\x3c\x41\x41\x1b\xf8\x7e\x83\x58\x98\x51\x63\x82\x85\x62\xa2\x30\x47\x0f\x05\xf5\x66\xb2\x8a\xee\xc8\x89\xa2\x94\x39\x52\x8e\xc5\x99\x5f\x2c\x27\x29\xe7\xf3\xb8\x8b\x26\xf0\xa7\x9e\x6a\xfd\xbe\x13\x0f\x90\x6f\xa7\x4f\x3a\xd7\x55\x75\xef\x2d\x51\x49\x6e\x5a\x89\xef\xa3\x56\xc8\x2d\x37\x2b\x3e\x07\x33\xd9\xfb\x97\xa2\xbd\x21\x93\x6d\x76\x15\xb4\xcd\x46\x4e\x2d\x3c\x69\x7b\xb6\xb2\x2d\x48\x35\x7b\x5a\x07\x95\xb1\xb0\x40\x2f\xf6\xcc\xd1\x85\x25\x42\x5f\xc7\xd7\x61\xc2\x43\xd3\xed\xf7\xe1\x1e\xb7\x38\xbd\x66\x1f\xcf\x49\x46\x40\x57\xcc\xfe\x08\x91\xbb\xff\xce\x44\x8f\x75\x09\xb4\xac\x28\xad\xc2\x32\x56\xdd\x0d\x08\x4f\x04\xe1\x21\x0d\x20\xee\x6f\x0c\x15\xf6\x88\xc3\xc1\xea\x21\x1c\x87\xc0\x1a\xfc\x18\x6e\x70\x34\x5f\x28\xf9\x32\x6b\x5b\x61\x1a\x48\x27\x9c\x12\x63\x28\x08\xa2\x30\xf5\x60\xd9\x54\x04\x65\x5e\x11\x6c\x62\x12\x6e\xee\x5c\x9f\x3f\xa8\x89\x91\x39\x19\x9f\x2f\xc5\xb4\x49\x94\x29\xc7\xd1\xe9\x7b\xbd\xf6\x4c\xa8\x07\xc8\x66\x14\x7e\xd5\x08\x06\x5f\x86\x15\x76\xb8\x4e\xa5\x59\x51\x2f\xf0\x53\x9f\x55\x67\xc5\x42\xd6\x4e\xca\x1b\x7b\xd0\xc4\x42\x6f\x8d\xd5\xcd\xd8\xd2\x84\x9a\xdb\x04\xd3\x61\x61\x4d\xb4\x50\xf4\xe7\x26\x9c\xbb\xa3\xb1\xc9\x51\x9e\x38\xd8\x5a\xcd\x0a\xb2\x62\x49\x69\x32\xbb\xa0\x16\x5d\x38\xfa\x2d\x43\x28\xdc\xfc\x57\x94\x18\x7b\xc1\x05\x5d\xc6\xc5\x8e\xb2\xd4\xc9\x03\xdd\xd5\x5f\x85\x33\x13\x53\x42\x33\x96\x83\x50\x71\x66\x2b\xf8\x26\x25\x87\x9e\x91\x0e\x44\x0e\xed\x41\x24\x6d\x6f\x31\x49\x89\xfe\x94\x60\xff\x87\x18\xf5\x43\xb9\xff\xbb\xac\x82\x87\x1f\x59\x4d\x8e\x96\x97\x32\xed\x3b\xb2\xc2\x84\xc5\x1c\x3c\xdb\xaf\x88\x7a\x4f\x82\x9a\x54\x1d\x85\xd1\x34\x4b\x45\x3b\x00\xdf\x41\xe3\xad\x35\x24\x85\xb4\xb0\x81\xae\xb0\x47\x4c\xa8\xba\x28\xef\x2e\xcc\xa4\xe3\xee\x5a\xf9\xcc\x82\x9c\x26\x2e\x72\xb7\xc7\x24\x96\x7c\xb1\x41\xa6\xc7\x7e\x20\xe3\x22\xc2\x70\xf7\xd6\x84\xf0\xcb\x66\x60\xc9\x0e\x3b\xde\xa2\x16\xda\x77\x37\x7e\xae\xfd\x45\x2a\xd3\xa8\xf9\x88\x01\x8c\xc2\x98\xe2\x4f\x8a\x96\xf2\xac\x45\xfb\xe9\x22\x55\xbd\x47\x48\x37\xee\x35\x91\xe5\xf1\xb8\x3a\x44\x1a\xcf\x18\xa6\x20\xbd\x49\x83\x5c\x3c\x5e\x64\xaa\x5a\xd9\xcf\xbe\xd3\xe5\xad\x22\x5b\xb1\xc3\xef\x2e\x3a\x31\x53\xc5\x9b\xc4\x86\x64\x55\x14\x4b\x7b\xc9\x2e\x88\x70\x59\x2b\x33\xa6\xab\xde\x89\x72\x9a\xae\xeb\x98\x24\x25\x3b\x4d\x6f\x69\x30\x4f\x77\x7e\x45\x1e\x1a\x33\xaf\x5d\x3d\x98\xae\xe5\x7c\xb2\xf9\x7a\x40\x20\xf7\x08\x7e\xa4\x3a\xf0\xf0\x24\x70\xfa\x6c\xb0\xde\xb9\xd4\xfd\x53\x8a\x08\xfb\x67\x5e\x0f\x62\xff\x22\x57\xa0\x0d\x4d\x8d\x2d\x54\xbf\x1b\xe2\xe3\x28\x35\x51\x1e\xc9\xb5\xe1\x79\x18\xa0\x6f\xc1\x43\xc3\xce\x49\xdc\x5c\x0f\xc5\xab\xae\xda\x07\x0f\xff\xc6\x22\xda\x71\x3f\xe1\xca\x24\x76\x39\x65\x2a\x7c\xdb\x41\x08\xe8\x52\x1d\x23\x20\x0b\xb7\x45\x83\x3c\xb8\x58\x2a\x95\x92\xa4\x10\x72\x69\x35\x23\x11\x77\xfd\x32\x88\x73\x36\x4a\xe6\xfb\xff\xe4\x7f\xcf\x2e\x26\x26\x31\x1a\xdb\x6c\xe6\x30\xe4\xf8\x8f\x04\x69\xdc\x10\x2b\xef\xc5\x92\x22\x2e\xbb\xb3\x61\x95\x3d\xd8\x55\x6d\x28\xab\x52\x8c\x4b\x50\xd1\xf2\xc1\x18\x6c\xb1\xb9\xcf\xf3\x0f\x87\x4a\x3a\xcf\xa5\x27\x1b\xd7\xc5\xc1\xb5\x5b\x8e\x88\xeb\x46\xcd\x88\x80\x7b\x26\xb3\x90\x81\x11\x96\xaa\xf2\x8d\x9c\xb6\x3c\x91\x52\xea\x81\x1e\x0b\x2c\x14\xe4\xa0\x78\xe5\x8d\x14\x11\xe5\x7b\x54\xbe\xa5\x75\x28\x7d\xf0\x64\xf3\x9d\x4e\x61\xaf\x8c\xbd\x00\xb2\xc2\x57\x31\x73\x5c\x1a\x42\xf7\x41\x88\x82\x24\x4d\xa7\xf5\x1d\xfa\x39\x13\xd1\x0f\x74\x84\x32\x0d\x20\xff\x42\x3d\x20\x6a\xea\xb2\xdf\x7b\xb6\x38\xdb\x35\x7d\x18\xa8\x4c\x74\xb2\x66\xd5\xbb\x16\xfa\x8a\xcf\x5c\x24\x15\x94\x86\x1a\x05\xab\xcf\x9f\x10\x19\x8c\x8a\xb1\x4a\x7b\x61\xf8\xb4\x5d\xd9\xd2\x03\x1c\x5c\xf3\x6f\xa1\xc2\x87\xec\x46\x38\xc5\x1a\xa4\x7a\x04\xe5\x28\x5c\x06\x9e\x63\x7e\x65\x52\x23\x22\x5a\xb3\x14\x68\x65\x32\x62\x9d\x5a\x48\xe8\xf0\xa0\x36\x26\x59\x60\x52\x12\x9e\x97\x12\xf5\x8a\x70\x53\x68\x6a\xc0\xe5\x3f\xaf\xec\x85\x74\xf4\xa0\xb7\x22\x70\x3c\x59\x35\x87\xbe\x80\x07\x3b\x8a\x14\xee\x8d\x17\xab\xa4\x96\xbf\x28\x84\x36\xba\x4e\x5d\x07\x80\x1d\xc2\x11\x6b\x00\x92\x97\x64\x9a\xb3\xb4\x45\xa4\xa0\xb6\xc7\x07\x12\x5f\x60\x7b\xbe\x4a\xa5\x48\xa0\xc8\x9f\x0d\x48\x45\x4a\xb5\xf3\x55\x08\xdb\x43\x88\xd7\xc1\x2c\x44\x83\xca\xad\xb0\x5f\x7f\x5d\x02\x00\x07\x3d\x8a\x07\x2b\xf1\x22\x36\x26\xba\xe0\x86\x48\xcb\x93\xb4\x66\x83\xc2\x60\xbf\x96\x81\xbb\xfb\x1d\x26\x41\xaf\xdc\xdb\x5d\xa2\xc1\x75\x58\x82\xa2\x06\xe6\x84\x35\xce\xc5\x4e\x10\x6f\x0e\x3b\xda\x1b\xd8\xe6\x18\x12\x03\xa6\x43\x39\x89\x77\x1f\x52\xa0\x22\xe4\xe4\xf9\x18\x20\x40\x85\xe6\x42\xf0\xa3\xd9\xc0\x52\x33\x05\x54\x49\xad\xc1\x67\x58\xc6\x7d\xc4\xc3\xec\x3c\x43\x3d\x19\x14\x5e\xf0\xbc\x05\xcb\x36\x6c\x64\x3b\xee\x30\x0b\x64\xc2\x67\x6f\x65\x67\x60\xfd\x0a\xaa\xcf\x21\xc9\xa5\x83\x89\xe1\xde\x34\x8a\xc8\xb4\x24\x35\xaf\xd9\x43\x21\xca\x34\x56\xce\x2f\xfe\xa3\x72\x07\x7b\x48\xcf\x46\x60\x8e\x56\x0b\xbb\x09\x5c\xa5\x7b\x13\x5b\xcb\xbf\x3a\xa4\x87\xfa\x6b\xfa\xea\xbd\xe9\xaa\x56\xaf\xd1\x69\xe5\x11\x38\xbd\x28\x6c\x2a\xe3\xb4\x2d\x04\xd8\x1a\xd9\x97\xd1\x34\xe3\x77\xd1\x98\x7c\x3f\x1a\x95\xda\xb3\x77\x3a\xe5\x70\xe0\x5f\xea\x84\x04\xad\xf7\x5b\xab\x62\x33\x98\x60\x40\x63\xa7\x4a\xdc\xd7\x14\x42\xa6\x76\xf0\xe1\xc0\x68\x20\x3b\x17\x2f\x54\xc7\x04\x13\xab\x95\x15\x67\x4f\x42\xe5\xfa\x08\xc5\x90\xd0\x72\x93\xf4\xd0\xff\x01\x6b\xdd\xd4\x8a\xc4\x0e\x63\x8a\x97\x32\x13\xbe\x9b\x93\x02\x0e\x37\x21\x4f\x0a\x0a\xd0\xd2\x9a\xa1\xec\x52\xad\x5f\x12\xaa\xd8\x0b\x73\xa3\x89\x6d\x84\xf1\x34\x99\x9b\x8f\x36\x23\x24\xe3\x0c\xcf\xa7\xe0\x3e\xd8\xcd\xbe\x78\x92\x60\x75\x6b\xa0\x88\xad\x63\xfd\x50\xcb\xc7\x1c\x54\x54\x4a\xf0\xea\x5e\x23\x21\xf9\xc8\x23\xab\xbe\x50\x8a\x63\x25\xb8\xff\xa3\xd8\xc2\xcb\x04\x22\x94\xf7\x81\xc0\x0c\x9b\xbf\x8b\xa3\x93\xa1\x12\xc5\x23\x6f\x7e\xe8\x3f\x16\x70\xb7\x56\xcf\x6a\xcc\x03\x65\xd8\x99\xb8\x06\x42\x38\x4f\x9a\x50\x99\x4b\xd4\xce\x5f\x52\xf8\xfe\xe5\xbc\xa9\xad\x99\xa7\x42\x2c\x05\x4a\x43\x08\x7b\x2d\x82\xfc\xc8\x7e\xa4\x2d\xdb\x43\xc8\x80\x12\x61\xd1\xcf\xf4\x4a\x60\x52\x88\x0b\x81\x6b\x18\x91\xbb\xd4\x49\x78\x43\xd9\x36\x4c\x93\x7b\x94\xbf\x92\x4e\x9f\xd4\x8d\xd0\x69\xb2\xc5\x46\xce\x53\x28\x4a\x01\xfa\xfa\xcd\xfd\x79\x04\xa1\x7a\x11\x7f\xed\xa8\xe1\x2c\x85\xa5\x25\xb5\x3e\x8e\x69\xeb\xc2\xed\x3b\x5e\x43\xc7\x8b\xd4\x87\x6d\x23\xba\xa3\xa4\x6c\x49\x6e\x5b\x78\x2c\x79\x72\xfe\x3e\x27\xc3\x80\xb9\x86\xe2\xd7\x6c\x29\x52\xe0\x6d\x35\x93\x8a\x18\x85\x21\x28\x2f\xe3\xab\x4f\x28\x02\x89\xab\x12\x6d\xdc\x94\x98\xe7\xdb\x04\xe7\xcd\x35\x90\x83\xdb\x63\x0e\x41\xb7\x1f\x6a\x2d\x2a\x27\x7c\x1a\xd4\x5e\xf6\x56\xe7\x52\x55\x4f\x35\x7a\x2f\x35\x47\xcf\xc9\x40\x4b\x62\x77\xa5\x92\x15\xc6\x29\x7c\x45\x24\x68\x50\x1e\x35\x02\x45\x52\xd1\x5e\x62\x50\x67\x4b\x76\xde\xfb\xa6\x25\x39\x32\x3e\xd0\x36\xc3\xd5\xa9\xfe\x34\x23\x03\xcf\xb2\x89\x80\xba\x30\x82\xe4\xc0\x0e\x42\x2f\xfd\x33\xb2\xe1\x43\xd1\x9d\x46\xf1\x49\x9d\x91\x74\x31\xe6\x1e\x6b\xd9\x29\x7e\x02\x0d\x73\xe1\x2f\x0b\xe9\x20\x76\xb0\x37\xbe\xe0\x7a\x95\x96\x78\xe9\xd8\x00\xca\x68\x5d\x34\x59\x33\x06\x21\xa5\xb4\x65\xd7\x08\x14\x18\xb0\x49\xdd\xd3\x23\xc1\x18\x4c\xb4\x9c\x31\x9a\x60\xca\x6c\xfb\xf0\xaa\x43\x50\x4c\xfb\xcb\x3b\x10\x87\xeb\x32\xb3\x71\x0c\xe5\xc2\x99\xfe\x85\x90\xc0\x28\x29\x67\x1e\x5e\x8b\xa6\x49\x05\x2b\x33\x9f\x5a\x45\x1a\x9a\x8b\x22\xc6\xbc\x8b\xe5\xf3\x58\x17\xa6\xeb\x24\x5e\x5c\x45\x10\xb6\x82\xc4\xaf\x76\xb0\x47\xb0\x4b\xa8\x10\xc3\x09\xf1\x96\x68\xda\x90\x4a\xac\x38\xff\x27\x41\x27\x08\xb5\xed\xd8\x6f\x46\x11\x1e\x7f\x45\x8b\xbd\x1d\x33\xd5\x2e\xe2\x25\x59\x62\x9c\x14\x5f\x76\x1e\x4a\x44\xed\xfa\x14\xca\x2e\xc9\x16\xe1\x38\xd3\x57\x39\x15\xb9\x9d\xb3\xa8\x19\x43\x4e\x93\x04\x40\xc6\x68\x52\xdc\xa2\x72\x94\x3e\xe4\x39\x8c\x41\x02\x83\x05\x46\x25\x31\x34\x96\xa8\x91\xac\x92\xd8\x2d\x4a\x9a\x6e\x0e\x2e\x70\xc2\x4f\x1d\x7e\x2b\x3a\x1b\x2e\x8e\x96\x7c\x59\x08\xf6\x65\x8d\x20\x09\x11\x6e\x3d\xe0\x3b\x82\x65\x92\x9a\xcd\x85\x3a\x72\xc9\xda\x08\xa6\x7b\x6c\x22\xfe\x59\xca\xe9\xec\x1b\x8d\x46\x58\xc4\x00\x71\x82\xba\xc2\xbe\x31\x54\xb1\x9b\xe0\x0b\xa3\xad\xad\x15\x79\x0f\xc5\x34\x2e\x36\xad\x54\xd7\x6b\xad\x8c\xba\xc0\x26\x50\x09\xe3\xc8\xdc\xa4\x05\xe3\x6e\x1e\x31\xf9\xe7\x47\xc5\x98\x3b\xed\xa2\xf9\x20\x09\x7e\xf5\xad\x6e\x1d\x43\x2f\x58\x7d\x20\x3e\xa5\xb1\x77\x22\xa5\x47\x91\xee\xa6\x3a\xbf\xaf\xc9\x7f\x67\x55\x75\xca\xcc\x44\xff\x91\xfa\x08\x55\x50\xbe\x98\x7d\xac\xad\xbd\x5a\x14\x11\x55\x24\x35\x49\x0a\xb6\x1b\x94\x36\x23\xc4\x93\x1b\x82\x32\xb1\x48\xd6\x85\x71\x00\x4a\x6c\x98\x50\x72\x34\xfe\xa4\x39\x1e\x75\xda\x51\x7b\x62\x68\xef\xa0\x1b\xbf\xb4\xd0\xda\xc9\x42\x4d\x4e\x93\x1a\xe2\xa1\x34\x93\x25\x62\xe3\x8d\x81\xbf\xb7\x86\x7e\xde\x22\x09\x67\x08\x57\xa5\x03\x65\x1b\x10\x4a\xdd\xa9\x17\x11\x16\xbf\xeb\xc7\xfd\x7b\x9f\x54\xed\x78\x95\xd6\x4a\x4b\x68\x45\xba\xef\xfe\xe1\x6d\x8a\x50\x6f\x07\x50\x64\x2a\xb3\x98\x78\x43\x9a\xd3\x80\x2b\x1c\xba\x10\xf5\xbd\xe5\xb4\x3f\xa9\x0b\x79\xf7\xa2\x2a\xe1\xe0\xdf\x46\xd7\x9f\x53\x93\x07\xe6\x83\x80\x6b\x0c\xa0\xaf\x0e\xb2\x26\x94\x9d\x56\x5c\x84\xfb\xa5\xb8\x23\x92\x7d\xe2\x06\xed\xdf\xbb\x4b\x91\xde\x89\x87\x0c\xa6\x2d\x76\xd4\xec\x2c\xbd\x20\x24\x0f\x9b\x16\x5c\x62\x92\x83\xa9\x6e\xcc\x03\x34\x70\x68\x43\x1f\x5c\x9a\x54\x0e\x92\x0d\x54\xc7\x09\x74\xb9\xb0\xe0\xb5\x69\x20\x79\x67\x1e\x4b\x1f\x16\xbd\xb0\x3f\xa2\x78\x1d\xb8\x55\xbe\xdc\xbe\xa6\xa6\x0a\xe2\xfd\x06\x3a\x15\x3e\xee\x4c\x79\x4e\x7a\x6d\x95\xb0\x07\x05\x24\xd4\x10\xdb\x9a\xc0\x54\x79\x6e\x3a\x27\x4d\x4c\x10\x89\xf2\xa8\xe2\xc5\xb2\x07\x93\xfa\x20\x28\xb8\x06\x8d\xaf\xfe\x7e\x1e\x70\x6d\x3e\xaa\x90\xe3\x75\x5c\xe8\x8c\xdd\x05\x85\x65\x64\x86\x8a\x44\xdb\xda\x89\x13\xbb\x62\x59\x2c\x76\xee\x23\x56\x05\x79\x80\xe0\xf3\x97\x68\x9a\xbf\x08\x51\x4f\x06\xbf\x78\x80\x09\x3d\x20\x76\xa0\xd3\x62\xb9\x59\xb4\xc0\x69\x9a\x4d\x65\xfd\xb5\xfe\x59\x32\x7f\xf9\x7c\x8a\xe6\xe4\xb1\xdb\x19\x59\x33\xe2\xa1\xa0\x82\xc3\xa1\x7c\xcc\xa6\x92\x2f\x4b\x0f\x71\x91\xc0\xef\x32\x1d\x90\x55\xfd\x42\x8f\xba\x14\xf2\xc2\x39\x45\x70\x9b\x3a\x62\x1d\xe6\xd0\x65\x2d\xdf\x0d\xe0\x15\x5d\xe3\xce\xc5\xda\x72\x50\x68\x57\x4e\xb7\xec\x4e\xea\x90\x27\x94\xe2\x30\xc0\x91\x1a\x36\xd4\xd9\x8d\xb3\x1b\x11\xdd\x7c\xb5\x00\xf7\xb2\x65\x29\xc4\x7f\x49\xe0\x29\xad\xaf\xdd\xc5\x1e\xa4\x97\xfe\xab\xba\x75\xb6\xeb\x6a\xee\xb7\x9d\xa0\x41\xed\x17\xd0\x1f\x90\xb5\x71\x2a\x0d\x0f\xbc\x57\x9b\x95\xa5\x77\xb5\x52\x1f\xfa\xcd\xda\xee\x2e\x48\xb7\x77\x4d\x50\xa5\x9c\xf6\xbc\x93\xfa\x5c\x24\x3a\x96\x96\xd1\x2b\x1c\xe2\x7e\x5d\x38\x6c\x28\xe7\x42\x36\x19\x27\x04\xcd\x4a\xda\x19\x8e\x50\x76\x98\xbd\x0a\x6f\x15\x8b\x75\xf7\x36\x96\x9d\xda\xe4\x8d\x55\xf3\xa0\x6f\xc1\xc4\xc5\x38\x16\x98\x36\xc4\xd2\xb3\x9c\xab\x8b\x0f\xd3\x47\xec\x4f\xce\x40\xb9\xd4\x4e\x07\x56\x8a\x86\x96\xe5\x31\x2b\x38\x97\x2f\xa1\xa1\xdd\x2b\x77\x33\xb1\x56\x4a\xf8\x2d\xbd\x98\x2c\xb3\x07\x7e\x79\x52\x95\x76\xdb\x55\x90\xf0\xcb\xa9\x03\x04\x0e\x33\x0f\x0a\xe1\xae\x63\x83\x4e\xb4\x3c\x51\x1b\x63\x18\xdd\xf8\x2e\x72\x7e\x4a\xe5\x5c\x75\x4c\xc4\x7d\x61\x56\x4f\xdd\x7b\x81\x37\xd3\xf9\x54\x5f\x47\x52\x71\xa6\x8b\xf9\x48\x80\x09\x23\xea\x01\xfe\xce\xb7\x99\x6a\x12\x6a\x43\x08\x9f\xda\xc2\x64\x08\xdc\x69\x5e\x21\x08\x14\xdc\x94\xf5\x94\xd1\x9d\x4a\xf7\xe5\xc1\xcd\x6a\xac\x2e\xca\x85\xbf\x4c\x6d\x0a\xae\x84\xab\xd4\xc2\x62\x01\x1c\xbb\x37\x82\x2a\x2f\xd9\x62\x75\xcc\x2c\x12\xbf\x93\xba\x97\x9c\x8a\xfd\xfa\x00\xe0\x43\x41\x60\xd8\x24\x1c\x0b\x89\x09\xde\xc5\xdc\xc6\x6a\xf9\x99\x25\x32\xe9\x1d\xde\x61\x0c\x43\x0d\x7f\x6f\x83\x69\xd4\x04\x5d\x64\xce\x9c\x9d\x12\xe5\xc7\x36\xd9\x66\x0b\xef\xd6\x9f\x7f\x79\x1e\x74\xe3\x2d\x48\x4e\xca\xc9\xfb\x88\x5d\x64\x91\xd4\x28\xd2\xab\x64\xa8\x59\x38\xbc\x89\x76\xb7\xd8\x0d\xc3\xe6\x27\xf0\x6c\x82\x8b\xa5\x1a\xa7\x37\xef\xb7\xb4\x19\xb0\xbd\xea\x7f\x54\xbf\x77\x1d\x59\x78\x84\x81\x87\xd7\x7b\x9c\x68\xf2\x04\xdb\xbb\x78\xba\x54\xaa\x38\x7e\xe6\xb1\x91\xae\x70\x8f\x30\xce\x1c\x26\x60\x85\x83\x4d\x6d\x0e\x70\x6f\x34\x65\xd0\xd7\xc0\x53\x48\x6d\xfa\xa3\x85\x69\xb0\x1d\xef\x50\x7f\x46\xb3\x9f\x25\xa7\x7a\x54\x7b\x4b\xa7\xa4\x08\x6f\xb0\xbc\x68\x2b\x9c\xaa\x88\x38\xbd\xe9\xbf\xaa\x48\x16\xb7\x12\x2a\x46\x41\xba\x5d\xf3\xd5\x01\x74\xa3\x2e\xe3\xd5\xbc\xfe\x93\xa2\xdd\x17\xc3\x6f\x14\x59\x46\x93\xcb\xe8\x24\xef\x2a\xbc\xfa\x1e\x53\x28\xcc\xc8\xb7\x36\xe2\x4d\xe0\x70\xba\x8b\xf0\xec\xe2\x80\x38\x30\x2d\x74\xf2\xb2\x58\xd5\x98\x93\x98\xb8\xe0\x7f\x32\x10\x75\x90\xb8\x69\xc4\xaf\xa4\x8d\xb8\xed\x3f\x4a\x0c\xad\x6c\x3a\x51\xef\x00\x8f\x2c\x10\xfc\xef\xa4\xa1\xda\x3f\x73\x57\xc5\xc6\x96\x6a\xc2\x9a\x34\x50\xcc\x2d\x31\xa5\x1b\x65\xc2\x52\x04\x61\x54\x78\x9e\xa3\x94\xf5\xe1\x08\x82\xa3\x29\xba\xef\x92\xf1\xd9\x13\xb5\x4b\x37\xa9\x77\x78\xf5\x97\xa6\xc4\x7c\x6c\x63\x90\xb2\xa9\x60\x0c\x4e\x9d\xe7\x80\x9e\x01\xd2\xb6\x02\x29\x9d\xce\xfe\xa3\x94\x21\x4d\x02\x9b\xae\xb8\xa4\xf3\xbc\x43\x7c\xc1\x16\xbd\xde\x38\xaa\x47\xb8\xc0\xf9\x78\x68\x90\x5a\x15\x75\x7d\x17\xfd\xeb\x6b\x05\x6f\x68\xd6\xc7\x8f\x7c\x82\x6c\x2e\x09\x0a\x68\x05\xf3\x79\x38\xd5\x95\x91\x05\xe5\x07\x1a\x1f\x76\xd7\x5f\x1e\xa2\x96\xbc\x23\x8a\x06\x83\x86\x3f\xbe\x5f\x26\x1b\x71\x1a\x3e\xe8\xbf\xd3\x1b\x86\x8b\x1a\x1f\x1e\xb7\x7f\xc4\xcd\xe4\x2f\xff\x25\x22\x36\x39\xb6\x9b\xc2\xe4\xa5\xb4\xb4\x9d\x17\x16\x5e\xcd\xf9\xc9\xaa\xd9\xc5\x0c\xa0\x89\x24\x01\xfc\x50\x73\xd5\x76\xfc\xd0\xcc\x74\x0b\xf5\x15\x95\xc4\xef\xed\x61\xfb\xb4\xdd\x79\x4c\x9c\x24\xc1\x66\xa0\xee\x32\x09\x6c\xb5\xd7\x89\x98\x04\x2f\x4d\x0d\x8d\xf9\x49\x72\x01\x16\x06\x37\xec\x1c\x18\xc6\xd7\xe4\x4f\x94\xaf\xd4\x5d\x97\x1d\xfe\x56\x3c\x33\xf5\xac\x10\x99\xf9\xde\x35\x7e\xd1\xce\x7f\xc8\x6e\x86\x4c\x1f\x46\x6b\x84\xb6\x48\x21\x14\x19\xa0\x1e\x8f\x8e\x86\xe8\xf5\x6c\x23\xdb\x62\xa5\xbe\xa9\x32\xe9\x0d\xc9\x06\x0d\xe3\xa7\x4b\xa4\xe4\x22\x23\x99\xfd\xa4\x82\x67\x6b\xdd\x38\x54\x64\xa2\x04\x94\xe6\x25\xad\xda\x40\x59\x2d\xbb\xf8\x1d\x23\xcf\xe8\xf9\xe5\xf3\x38\xdd\x58\xc8\x04\xa3\xb0\x08\x3e\xf1\x08\x90\xeb\xe4\x1d\x70\x25\x09\x5d\x2c\x3b\xfe\x3b\x9b\x4f\x51\x8f\x60\xce\x4e\x5d\x22\x5b\x62\xf5\xca\x59\x48\x94\x42\xfb\x7e\x91\x6c\x96\xf7\x45\x4b\xb2\xb4\xf6\xd1\xb6\xed\x6a\x44\xbc\x04\x2f\x26\x89\xce\xea\x7b\xe8\xd5\x2e\xbd\x16\x1e\x2d\xd2\xf4\xfd\xa3\xc8\x70\x44\xfe\x12\x2c\x48\xc1\x38\x7e\xe2\xa3\xe7\xde\x52\x27\xc1\x2a\x28\x95\xee\xd1\x2c\xc7\x2a\x1c\x31\x46\xa7\xd8\xe8\xa9\xca\xde\x86\x8d\x85\x3a\x1f\x41\x0a\x5f\x47\xc6\x54\x0f\xc9\x07\x6f\x6a\xad\x53\x2f\xce\x57\xc2\x8c\x75\x98\xc9\x47\xb0\x2b\xb9\xcb\x3e\x69\xbe\x41\x5a\xaa\xcf\xf0\xe5\x4e\x0f\xaa\x70\xdb\xa1\x55\x61\xd2\xe7\x96\x70\x35\x1e\xad\xc8\x69\x17\x97\xb8\x01\x05\x29\xf8\x35\xe5\x5b\x60\x97\x02\x07\xfc\x02\xe1\xd1\xd9\xa3\x9b\xe9\x7c\x27\x31\x0e\x42\x33\xc9\x05\x68\x39\xac\xb8\xbc\xfc\x47\x53\xcc\x55\xab\x6a\xb2\xe2\x8c\x1b\x8b\xbb\x73\x3a\x6f\x82\xbd\x63\x7a\xad\x48\x79\x89\x48\x8e\xd3\x2c\x06\xe1\x7c\x14\xd6\xb2\x5f\xa2\x64\xda\x22\x5f\xcc\x28\xaf\x95\xa7\x31\xc2\x6d\x22\x00\xde\x24\x1f\x36\xcf\xac\x7b\x58\x19\x0b\xbf\x81\x29\xc5\xee\xea\x7e\xcc\xdd\x45\xdf\x76\xf5\xd8\x4e\x83\x7a\x91\x42\xbc\x52\xcc\xc1\xd9\xb2\x1c\x49\x2b\xcd\x98\xb5\x4d\xaa\xb9\x38\x1f\xee\x86\x6a\xef\xe1\xb2\x74\x2b\xca\xb0\xe9\xd3\xb5\x78\xe7\x1f\x99\x2e\x9f\xee\x09\x75\xe0\x4b\xf0\x26\x99\x09\xa2\x71\x70\x10\x86\xfe\xd5\x11\xd4\xab\x47\xd2\x17\xa1\x0b\x40\x2b\x6d\xcf\x28\x0a\xba\xb2\x89\x4a\x17\x49\xfd\x40\xfb\x11\x4a\x5b\xe5\x57\x43\xb5\x55\x47\xf5\x01\x2e\x53\xd6\x04\x19\x6a\x96\x2a\x4a\x90\x9e\xa5\xd9\x4f\x4d\x67\xf0\x0b\x91\x85\xd5\x5a\x66\xd3\xe9\xec\xd6\xab\x7d\x02\x83\x99\xed\x53\x6a\x8c\x40\xd4\x18\x3c\x68\x90\xf3\xa8\x99\x23\xde\x22\xc2\x3a\x02\xe1\x84\xe9\xde\x9a\x96\xe4\xcc\x9c\x11\x24\x2e\x6c\xfd\x03\xe1\xa4\x22\x5e\x0e\x38\x9f\xce\x6e\xd7\x19\x46\x85\x20\xc4\xc3\x97\x50\x97\x04\xae\xad\x25\x79\x5c\x0c\x0f\xc6\xf2\xfe\x09\xb6\x8d\xea\xef\x83\xfd\xe6\x82\xb9\x89\x52\x3b\xa1\x25\x39\x83\xb8\xcd\xec\x8e\x08\xe4\x8a\x36\x04\x44\x23\xd9\xd3\xfb\xc4\xce\x54\xb3\xdd\xf0\x23\x7d\xd0\x6b\x45\x85\xbe\x11\x9f\x9f\xb9\xf0\x48\xcf\x98\x91\x0d\x27\x8b\x8c\x13\x23\x72\x8c\x7b\x0c\x1a\x97\x93\x09\x9a\x1e\x0d\x75\xba\xf6\x7f\x4e\x94\xdc\x2f\x2d\x01\xd1\xd8\x1f\xcd\xc3\x53\x96\x1d\x55\x1f\x8b\xc4\x34\xb4\x84\x3b\xd7\x5a\xb6\xfd\x2f\xb7\xab\x46\x7d\x63\xc4\xf1\x6f\x54\xc9\xb8\x60\x78\x52\xbc\x53\x53\x2c\xbf\x36\x13\x1b\x86\x68\xfb\x1a\x0b\x14\x3d\x5f\x20\xba\xb4\xfe\xb4\x90\x2a\x88\x49\xbd\x5a\xe8\x92\xef\x1a\x5c\xee\x6c\x23\x86\x44\xf6\x40\x0c\x60\x88\x49\x6f\x6a\xb1\xdc\xc2\xc7\xac\xe5\xc1\xa8\x9a\xd8\xa7\x6d\x40\x08\xcb\x33\xbd\x63\x45\x07\xcd\x13\xb7\xff\x49\xb5\x1a\xd9\x2c\x14\xde\x15\x14\x7a\xab\x12\xad\xd5\x67\x55\xbd\x74\x85\x71\xde\x38\xe5\xc6\xf3\x34\xea\xfb\x34\x4e\xc7\x2c\x2b\x13\x44\xc3\x62\x51\x05\xd6\xcd\x91\x78\x16\x7e\x9a\x5e\x09\x6f\xb1\xd4\xcb\x43\x8b\x3e\xcd\x51\x14\x4f\xd3\x81\x4d\x47\x73\x23\xd7\x53\x7a\xa1\x4c\x5d\xca\xa2\x19\x6d\xde\xbc\xcb\x2d\x91\xf4\x50\x6f\x81\x25\x83\x9f\x43\xc2\x80\xec\xad\xc3\x6f\xda\x9f\x92\x9a\x51\xa1\x3e\xda\x0b\xe9\xe2\x28\xc4\x2e\x5c\x6e\x54\x05\x13\x43\xbc\x98\xd5\x06\x0f\xfb\xef\xdf\x8f\x36\x8a\x23\x15\x38\xf7\xb4\x0b\x3e\xb2\x0f\xe4\xda\x55\xd0\x03\xc9\x3d\xd8\x6d\x9b\x86\x87\x6d\x79\x84\x85\xa6\x38\xdf\x75\x66\x89\x4d\xf8\xe8\x1f\x66\xa3\x53\xe6\x0b\x10\xb0\x53\xe2\xf7\x25\xd5\x8f\x4a\x7c\x50\x14\x2c\x98\x68\x87\xcf\x5c\xe9\x9d\x3c\x21\xd4\xe3\x84\x2d\x34\x6f\xf0\x64\xa5\x83\x60\x99\xc3\x42\x1c\x35\x89\x34\x31\xba\x7f\x42\x44\xd4\x8b\x01\x73\x54\x30\x1c\x8a\x1b\xb8\x67\xa3\xba\x14\x58\xc3\x13\x76\x90\x34\x35\x3d\xa2\x0a\x9d\xf2\x45\x23\xc2\xa6\x13\x73\x05\x3a\x75\xa6\x1c\xe4\x5c\xa0\xa2\x26\xba\x1e\x29\x77\xa7\xa4\xf1\x49\x29\xf6\x82\xcb\x57\xf1\x51\x6a\xaa\x78\xcc\x91\x75\xe1\xbb\xf3\x7c\x02\x43\x76\x7e\x61\x2f\x3f\x1c\xcd\xac\x1e\xf2\xf3\xd4\xb7\xc1\x75\x7c\x22\x11\x33\x16\xf1\x3f\xbd\x6b\x1b\x12\xa6\x81\x56\xd9\xb2\x23\x6e\xa1\x4c\x4e\x6b\x22\x0f\x72\xa3\x10\x41\x9c\xb1\x72\xe8\x9e\x5e\xd6\xc8\x5f\x00\x86\xa1\x47\x90\x66\x1e\x4e\x2b\x09\x84\x5e\x97\x06\xc7\xd9\xe7\xfa\x30\xf5\x29\x40\x29\xa2\xd6\x1f\xbd\xbc\x64\x81\xe9\xa5\xcd\xee\xd1\x22\xf7\x13\x67\x29\x7c\x38\x44\x49\x1d\x62\xef\x36\x6d\xe6\x38\x3b\x26\x88\x2d\x32\xda\x29\x52\xbb\x12\xb7\x5f\xe9\xe6\x16\x0d\x61\x1b\x13\x87\x9f\x4f\x4d\xb1\xad\xf5\xe8\xe2\xc6\x4b\xbd\x26\xdd\xd1\xed\x79\x8b\xde\x47\xa6\x14\x73\x89\x8a\xe9\x9b\x0a\x7a\x39\x08\x36\x97\xac\xbc\xff\x0d\x23\x29\x89\xbc\x9d\xd2\x81\xf1\xb1\x59\xbc\x69\xc1\x9b\xdf\x92\x04\x5e\x96\x4f\x6b\xc1\x13\x47\xdd\xa5\x38\xb1\x23\xb3\x9d\xaa\xc2\x1e\x02\x34\x4c\x30\x42\xab\x0a\x14\xb6\x43\x63\x2d\x29\x04\xe4\xc5\xec\xd0\xb8\x8f\x59\xe7\x5d\xdb\x51\xef\xc0\xe0\x9c\xa9\x50\xea\x25\xc6\xb3\x50\xd8\x57\xba\x41\x16\x08\x94\x86\xed\xfb\xfc\x4f\x5f\x05\xc2\xd6\xbf\x57\x8b\xe4\xb9\x5c\x31\x88\xcf\x9a\xc3\x33\x9f\xd0\xb8\x37\xc3\x57\x1f\x12\x89\x0d\x9c\xde\x25\x35\x74\xf8\x99\x20\x91\x76\x29\x3a\x6b\xfa\x48\xdd\xb7\x27\x31\x43\x8a\x1c\xab\x57\x6c\x14\xd3\x8f\x27\x04\xc2\xa3\x61\xc1\xce\xab\x78\xae\x96\x9f\x57\xce\x17\xdc\x17\xc6\x55\xdb\xd5\xe7\x71\x69\xba\x36\xca\x30\x1a\x0e\xc2\x3f\xf6\x4d\xf7\x73\x9d\x44\x47\x27\xf9\xc1\x21\x20\x11\x30\x50\x41\x82\x43\xca\x98\xbe\xee\xff\x7a\x2e\x40\x0c\x55\x6c\x73\xaf\x4e\x7b\x87\x9e\x8b\xe1\xeb\x71\x83\x55\xf0\xcd\xd5\xa9\x6b\xb9\x26\x52\xb1\x7a\x49\xfd\x31\x14\x8d\x61\x59\x3d\xea\xa3\xe4\x7e\x21\x76\x87\x31\x2d\x54\x44\xdf\xa5\x5f\x0c\x8e\xeb\x4d\x7e\xe8\x86\x21\xc6\xb0\x4e\xff\xd1\x70\x0d\xae\x40\xd9\xbc\xee\xa1\x5a\x33\x14\x77\x77\xa8\x1e\xfb\x03\x17\x01\xf2\x4e\xcd\x67\xcf\xde\xd3\x4c\x02\x63\x9b\x31\x10\x9b\xf1\x6b\xd5\x5b\xdb\x55\x16\xb4\x85\xc6\x31\xbe\xa5\x2a\xb0\xd1\x00\xb3\xcb\x70\x88\x6a\xed\x7a\xce\x81\x44\xda\x97\xc2\x21\x6b\x0c\xdc\x8c\x40\x0a\x8d\x4e\x39\x8a\x19\xcf\x80\x01\x89\x31\xce\xe4\x2f\x5b\xda\x3d\x7d\xc8\x0d\xf8\x48\x35\xce\xf5\x36\xf1\x6b\x44\x03\xd8\xdb\x99\x93\x4b\x6a\xca\x73\x13\xdb\x04\x5c\xae\xe0\x2b\x7e\x89\x68\x1d\x97\x3c\x09\x3e\x7f\x4a\xb0\xa4\x4d\x4d\xc4\x81\x80\x68\x0e\xe1\xcd\x12\x38\xd8\xbb\x70\xa2\xe6\x51\x67\x30\x34\x18\x50\xc4\x10\x15\xc0\x6e\xec\x24\x8b\x11\x3d\xff\x4c\x15\x09\x2a\xf1\x4a\x31\x87\xfc\x13\x4b\xda\x1a\x65\x34\xfe\x3e\x06\xb3\x0a\x15\x1a\x04\xf8\x42\x06\x53\x5b\x9d\x43\x80\xa0\xab\xbc\xd6\x16\x2e\x0c\x0c\x4c\x11\x4d\xb8\xce\x36\x16\xe0\x27\x11\x12\xfd\xd6\xda\xa4\x65\xc2\x12\x17\x16\x9d\xca\x2a\x08\x29\x84\x06\x35\xf8\xb6\xd1\x75\xa2\x9f\xcf\x1b\xa8\xff\xe9\x2c\xe2\x35\xf0\x99\x37\x62\x50\xf4\xca\xec\xa1\xc4\x79\x6b\x92\x50\x58\x3e\x33\xf5\x96\xda\xd3\x59\x8a\x40\xe1\x45\x45\xe7\x9f\x70\x04\x11\xd9\x87\xe4\xff\x9c\x31\x93\x66\xa8\x12\x33\xd8\xc2\xce\xe1\xc3\xc0\xbe\xe3\xc7\x72\xcb\x90\x65\xa1\x35\x3a\x12\x12\x2d\xf8\x03\xf4\x5c\x3e\xbf\x65\x02\x7a\xd9\x9f\x33\x44\xb4\x1c\x9e\x0b\xbc\xd5\x8b\x31\x41\x25\xba\x73\x0c\x43\x5e\xfe\x8a\xe2\xfe\xfa\xea\x0d\x0f\xdb\xc8\x84\x36\x40\xe5\xd0\x2c\x94\x50\x2c\x59\x2c\xe6\xc2\x48\x80\x74\x31\x41\xec\xbd\x5b\x14\x05\xfb\x4d\x53\xcc\x9b\xda\x35\x70\xae\x9b\x2e\xe9\x7f\xc7\xc2\x18\x88\x96\x67\x54\x69\xcf\x2d\x09\x32\x44\x4e\x1b\x85\x2a\xfe\x8d\x87\x46\x63\xd9\x86\xf4\x2a\x41\x2a\x0d\xf9\xe0\xaf\xf9\x9b\xe4\x3a\x2c\xde\x4a\xc7\xa9\x20\xef\x72\xfc\xcd\x5b\x9b\xdb\xfa\x22\x47\x59\xf2\xa5\xeb\xf9\xf7\x2f\x33\xc9\x33\x6f\xf0\x01\xde\x9a\x18\x8a\xc7\xba\x5e\xe0\x85\x66\xea\x70\x47\x35\x0b\x93\xcd\x99\x51\xad\x71\x07\x50\xdf\xb5\x4b\xe9\x28\xbf\x6b\xca\xdd\x30\x33\x28\x0a\xdb\x55\xb2\x70\xde\x48\xfd\x05\x85\xf4\xce\xea\x96\x66\x94\x8f\x24\xc2\xbf\xa1\x1d\x93\x31\xb2\x25\xaa\xbd\xc8\x67\x6a\x33\xb4\xdc\x7b\xf9\x0c\x29\x8e\x77\xd3\x45\xea\x85\x32\xbb\x5a\xe8\xd9\x58\x1c\x95\x80\x4d\xaf\x69\x59\xe8\x3b\xa1\x11\x70\x88\xbc\xf9\x52\x28\x10\x69\xff\x22\x04\xb2\x74\x99\xb4\x16\x07\xfd\x90\xaf\xa4\x46\xae\xc7\x88\x3b\x42\x5b\x79\x79\x91\x3d\xc7\x74\x33\xc6\x87\xff\xd1\xf3\x1f\xe4\xe2\x45\xc5\x77\xaf\x77\x46\x5c\xa5\x41\x3e\xc8\xa5\x71\xa7\x31\x5e\x97\x26\xfc\x31\x2a\x18\x1e\x68\x69\x35\x56\x96\x5d\x0c\x79\xba\xd3\x0f\x78\xff\x41\x0d\x4d\xd1\xac\x29\xcd\x07\xc5\x8b\x24\x71\xea\x20\x32\x7f\xf1\x9c\xdf\xd4\x44\xdc\x3e\x7a\x3c\x0d\x22\xdd\x63\xb1\x6e\x0c\xd9\x71\x6d\x30\x4f\x3b\x72\x1d\xb6\xc6\xbc\xa5\xc2\x13\x64\x79\xe5\xe7\x67\xa8\xcf\x1c\xd1\x27\x88\xce\x5f\x62\x07\xae\xbf\x26\x53\x1e\xc2\x04\xe9\x57\x39\x12\x0d\x86\x77\x1d\x65\xa6\x83\xa9\x0d\x54\xb9\xa7\x72\x8c\x74\x35\x9d\x3c\xab\x68\xab\x7f\x0b\xbb\x61\xc5\x00\x7f\xa7\x6b\xb0\x39\xa1\x30\xdd\x7b\x52\x16\xa1\x97\xc1\xb0\x35\xbb\xec\x4b\x20\x0a\x99\xb2\x15\x21\x57\xbe\xc5\xd0\x0a\x94\xc3\x9a\x20\xce\x91\xd4\xa6\xe3\xaa\xa7\x02\xe0\x0e\x0e\x66\xc6\x3a\xd2\xf2\x39\x25\xf8\xa6\x6e\x7f\xbd\x99\xc8\xb0\x31\x37\x3e\xa6\x7d\xee\x78\xf6\x47\x9a\xbb\x4b\x71\x87\x0a\x81\xb8\x09\x1d\x18\xac\x75\xf7\xe1\x05\xa4\xbe\xaa\x66\x21\x2e\x11\x4f\x3f\x94\x17\x02\xb6\x94\x6e\x9a\x8f\x11\x0a\xac\x86\x8d\x34\xed\x8d\xbc\x27\x65\x66\x29\x68\x6d\xde\x66\xcb\xae\x95\xe2\xb1\x64\xe5\xa6\x5c\xaa\xbc\x54\x83\x94\x04\x41\xcc\xd8\x60\xb8\xf9\x83\x26\x31\x97\x5b\x8e\xec\x46\x0d\x63\xf5\x21\x73\xe1\x26\x7c\x8f\xcb\x10\x08\x93\x10\xfc\xef\x29\x13\x9d\x32\x6c\xbf\x84\xaa\x8b\x38\x6a\xb0\xc6\x4e\xee\x75\x75\x10\xa1\x0d\x23\x13\xd2\x0b\x3a\x87\x59\x66\xa2\xe9\x57\xd5\x01\x01\x2f\xe9\xfb\x80\xe5\x19\xdf\x37\x6d\x88\x5e\x38\x03\x0a\x65\xff\x44\x56\x01\x19\x36\x60\x8e\xab\x8e\x60\xb8\xe7\xd8\xf0\xb1\x11\xa7\x6b\x78\x52\xc4\xc1\xf5\x8c\xac\xbf\xcd\xb8\x65\x6a\xd4\xa4\x85\x34\x40\xe6\x21\x90\x43\xe2\x34\xaa\x44\xfa\x93\x33\xe5\x77\x95\xe5\x5e\xf1\x17\xd5\xbb\x60\x70\xa3\xe3\xc3\xfb\xc9\xaf\xbc\xae\x91\xab\x59\xed\x88\xb2\x21\x06\x19\xcf\x1f\xcd\x72\x75\xbe\x3a\x41\xdb\xca\x62\xaf\x03\xde\xfd\x29\x6a\x9f\x32\x68\x87\x4f\x88\x12\xd8\x7f\x9c\x35\x6f\x44\x42\xab\x31\xc2\x9a\x29\x64\xa7\x42\x62\x30\xf1\xc0\x93\x5b\x19\x98\x60\xb8\x91\xf8\xb5\x30\x5c\x49\x4a\xc4\x80\x9f\xa2\x4f\x8c\x41\xb4\xfe\x76\x57\x0a\x6e\x67\x8e\x5d\x3c\x03\xf7\x0b\xd0\xf1\x8d\x55\x2c\x78\x96\x56\xf3\xa0\x0c\x29\xcd\x74\x14\xc2\x2c\xda\x91\x09\x9b\xcb\x35\xb2\x65\x0a\x6a\xd0\x52\x08\xc3\x63\x0c\x3e\xcd\xa8\x1c\x00\x24\xe0\x42\xde\x91\x53\x1d\x89\xf5\x2c\x7d\x5c\xf2\x5e\x54\x29\x47\x82\x58\x4e\x1d\x54\x1a\xdc\x17\x35\x3e\xc4\xa0\xd6\xe8\xd6\x96\x35\x25\x77\xa3\x31\xa0\x96\xca\x11\x93\x4d\x78\x0c\xf7\x28\x31\x40\x92\x9b\xf1\xcf\x66\x25\x00\xa0\xcd\xc3\x4e\x6f\x68\xa2\x16\x7f\x26\x9e\x01\x7b\xc5\xa1\xcd\xca\x92\x68\x80\x52\x37\x8f\x6e\xa6\x12\xcd\xea\xaf\x88\x4a\x91\xfa\x37\xb0\xd9\x1c\xe1\xe4\x6c\x0a\x8e\xac\x48\x31\xf3\x20\x06\xa9\x3a\x53\x57\xfe\xa6\xbc\xda\x9c\x9e\x73\x1a\xc8\xe3\xd9\xcd\x05\xd3\xb0\x1d\x81\x8d\xba\xae\x6b\x12\xeb\xf3\x64\x5f\xab\x4f\x37\x60\x8d\x27\x75\x59\xf0\x9a\x03\x0c\x11\x05\x4f\x64\xae\x02\xab\x6f\xea\x31\xa0\x62\x6c\x5f\x43\x1c\xbe\x26\x35\x39\xee\x81\x38\xcd\x0c\xae\xa0\xb2\x2e\x2b\x91\xa3\xae\x97\x1a\x90\x62\xe3\xde\x31\xf6\x0d\x82\x61\xec\x73\x84\xb4\x4b\x0b\xe0\xa4\xd5\x27\xa3\x42\x59\x58\x90\xb3\xfc\x8b\x05\x30\xd9\x12\x63\x0f\x42\xa3\x84\x5f\x0f\xcd\x18\xb9\x50\x17\x22\x5c\x56\x4d\xd0\x7a\x5b\x42\xaf\x54\xfa\x74\xd2\xb8\x29\xca\x92\xf6\x26\xb9\x6a\xa1\x2c\x7b\xaa\xa3\x47\xc5\xfe\xee\x41\x1e\x77\x9c\xb3\xbd\xef\xd1\x36\x81\x49\x70\x41\x56\xb2\x48\xc2\x8e\x81\x50\xa0\x35\xab\x64\x13\x92\xb4\x6c\x48\x25\x34\x1f\x83\xf1\x26\x1f\x63\xcb\xda\xaf\x67\x2b\xea\xf5\x68\x2c\x94\xab\xb3\x00\x81\xf0\xb6\x7f\x5f\x0c\xd8\xb4\xf4\xa5\x9b\x84\x1a\xa2\xce\x08\x74\xb2\x18\xd7\x61\xdc\x7e\x2f\x6a\x46\xac\xc9\xd7\xc8\xb1\xc8\x03\x9d\x1d\x8d\xe4\x81\x52\x12\x5f\xf3\x7b\x1e\x8f\x4b\x55\x06\xbd\xe2\xc4\x1d\x26\xb6\x5b\x64\x2f\x42\xe8\x3c\xf8\x2c\xfa\xb6\x90\x6a\x4c\x8f\x44\x6e\x49\x9a\xcb\x80\xb1\xae\x38\xd3\xd2\x56\x22\x97\x11\x07\xef\x52\x77\x1a\xce\x28\x7e\xb9\x51\xc6\x0e\xa7\x4f\x5c\xea\x21\x80\x03\xf5\x06\x07\x3d\x87\xfd\xb0\xac\x0b\x3a\xb9\x51\x04\x7f\x41\xe1\xe9\x0c\x45\x8d\x70\x32\x2f\x8a\x53\x84\x0c\x37\x0c\x28\xf8\x58\x5b\x24\xc8\x98\x42\x41\x33\x10\x8f\xaf\x5e\x4a\x0c\x00\x6d\x69\x7c\xd4\x05\x24\x3d\x0b\xe5\x2f\x6e\xd4\xb6\xd2\x4b\x08\x85\xde\x6b\x97\x23\xcc\x8a\xc4\xd7\x89\xa3\xf5\x6b\xbc\x93\xf0\x14\x4b\x58\xa8\x51\x8a\x81\x44\xf4\x5f\xad\x82\x0e\x7e\x88\xea\xd3\xa8\x32\xe7\xa6\xaf\x09\xe0\x60\x6b\xd5\x6b\xfd\x2d\x49\x8a\xfc\x2b\x59\xea\x95\xde\x39\x39\x50\xd3\x0c\xde\x42\x0e\xbd\xa9\xbc\xd9\xa6\x13\x93\x70\xe3\x18\xcf\xa5\x0d\x6c\xf4\x20\x21\x24\x30\x29\x21\xc8\x08\x5c\x27\xf8\x8f\xb7\xe9\x4c\x95\xfb\xb4\xff\x13\xbe\xc9\x8c\x4f\x5e\x10\x42\xba\xb2\x9d\xd4\xc3\xf1\x30\x3c\x32\xd7\x60\x9e\xbf\xd3\x43\x83\x66\xbf\x64\x30\x70\xa1\xe2\xce\x5e\x7d\x29\xce\x22\xb8\x08\x18\x3e\x23\x6f\xf9\x03\x4f\x2b\xb5\x96\x87\xe0\x8c\xbb\xc4\x06\x07\x47\xa1\x5b\xcd\xf8\x1f\x9a\x63\xdc\x40\x41\x2b\xda\xdb\x3d\x02\x5b\xb3\x3c\xbb\x36\x4c\x73\x5c\xc1\x6a\x99\x88\x28\xfb\xc8\xf1\x00\x9c\x73\xda\xa2\x15\x05\xd8\x42\xf4\x91\xa3\x75\x8b\x7d\x12\xd3\x94\x56\xae\xd0\xb9\xca\x8f\xec\xd7\x2c\x80\x99\xc9\xa0\x5d\x6a\xb5\xc2\x50\xfb\x0c\x66\x9e\x12\x69\x50\x83\x69\x05\xe3\xb3\x0d\x47\xec\xc3\x47\xf8\x84\x19\x75\xe9\xd1\xdf\x3a\x02\x41\x5c\x27\x8a\xbe\x2b\x47\x98\x00\x4d\x07\x21\xf8\xd6\xd2\x20\x4a\xab\x22\x1b\x61\xff\x1c\x71\xa3\x35\x46\x7f\xbb\x85\x66\x55\x3f\xbf\x6e\x01\x55\xd4\x96\x50\x83\x6b\x7e\x9c\x97\xc2\x97\x47\x23\xc8\xf3\xcd\xd2\x6b\xda\xf0\x17\xf0\x89\x8b\xe3\xb3\xc6\x83\x0e\x50\x8b\xd8\x7d\xd0\x33\x55\x16\x19\x32\xc7\xf6\xbb\x79\x4d\xfc\x42\xac\x91\x62\xbb\xf0\x62\x0c\xdb\x62\xbb\xad\x0e\x6d\x5d\x58\xa0\xf4\xc8\x7e\x69\x8a\xe9\xb0\x2c\x4c\x67\x7a\xdf\xd1\xa6\xd3\xe2\xa9\x0f\x8d\x88\xb7\xa1\xf1\x88\x2a\xfa\x52\xd0\x37\xfc\x50\xe9\x12\xba\x90\xf4\x72\x55\x74\x88\x26\xf4\x23\xde\xa7\xf4\x15\x10\x84\x20\xf7\xfd\x52\x15\x62\x2b\x18\x89\xa4\x6e\xdd\xf3\xc9\x1b\xff\x13\xbe\xeb\x1e\x33\xf2\x4a\xf8\xde\x7b\xd0\xd2\xfa\xd1\x73\x5a\x75\x33\x45\xa0\x78\xe3\x38\x30\x06\x9a\xcf\xca\xa9\xd9\xa2\xe7\x95\xaf\xca\x8b\x96\xa0\xb4\xc9\x3b\x88\x00\xcb\x15\x9a\x37\x71\x2a\x0e\x74\x9c\xbe\x1b\x05\x61\x3f\xda\x7c\x77\xbb\xda\xeb\x28\x7d\xa7\xe3\x6c\x45\xab\x33\xf4\x9f\x36\x44\x6d\x5e\x54\xd6\xcd\xf5\x58\xa2\xb5\x4d\xd8\x82\x8f\x84\x7f\x3c\x53\xbe\x51\xa9\x47\xb1\xb0\x6f\x0f\x38\xb4\x4d\x9f\xb2\x67\x9b\x73\x3f\x4e\x55\x78\xf2\x54\x30\x47\x26\x75\xa1\xa9\xe9\xf9\x24\xaa\x18\xf5\xf9\x41\xe3\xfa\x18\x42\xfe\x4e\xe0\x0a\xd2\x1c\x87\x5e\xf9\x43\x29\xe8\x20\x77\x6e\x3e\x67\xe0\xc4\x33\x5f\xf2\xa7\xe6\xcf\x37\x52\x22\xb3\x37\x86\x40\x16\x5b\xa0\xbf\x39\xdd\xf7\x29\x17\x0b\xeb\x18\xb9\xdf\x9b\x63\x34\x53\xa8\xc2\xa3\xe4\x06\xe2\x18\xb5\x16\xe3\x77\x51\xe3\x97\x65\x2b\x2c\x60\x35\xd5\x50\xac\xe1\x40\x3c\x68\x5d\x5b\x56\xeb\xbf\x34\x0c\x20\x06\xde\xa8\x06\x97\x21\x14\x51\xb6\x86\x89\x4e\xac\x3c\x08\xf0\x97\x14\xf4\x07\xe3\xd4\x29\xe8\xe8\x5f\x41\xbf\xe6\xee\xbc\x2d\xa6\x1f\x1c\x65\xd5\xf4\x06\xae\x76\xfd\xdc\x07\x0e\xef\x79\x3b\x35\x96\x62\x68\x80\xaa\x0e\x97\xb6\xef\x16\xaa\x62\x71\xf0\xf1\x97\x36\x26\xc2\x15\xfb\xb9\x01\x98\x91\xbf\x91\x10\x77\xf2\xb2\xfc\xc8\xec\x5d\x09\x25\x75\xde\x49\xe0\xd5\xa0\x1d\x33\xe4\x6d\xd4\xc7\x68\x5e\x6f\x61\xf4\x3b\xb6\xa9\x69\xa2\xc6\x13\x1d\x22\xe6\xa8\x5c\x2f\x75\x5b\x78\x80\x68\xee\x3a\x41\xf1\xe9\x1a\x4f\xbc\x3b\x91\xc8\xbf\xa9\x04\x35\xe5\xac\xea\x2f\x9a\x52\x60\x8f\xc6\x32\xd5\x5d\xe7\xdf\xb9\x8e\xa4\x95\x7a\x1f\x26\x53\xa3\x81\x4c\x98\x21\xf7\x93\xf8\x59\xa7\x63\x73\xd4\x55\xd8\xb8\xf6\x87\x2a\xc8\xfb\xd9\xd1\x62\xc2\x11\x78\x76\x11\x46\x82\xa4\x3b\xaa\x79\x4c\xe4\xb8\x4e\x49\x8c\xcc\x91\x7a\x4b\x3c\x27\xee\xe8\x0e\x4a\x13\x0d\xad\xbb\xfd\x9e\xaf\x0e\xcd\x50\x51\x09\x89\x4b\xcc\xda\xa0\x5f\x96\x1c\x86\xff\x9a\x06\x79\xff\x2b\xd3\xe0\xdf\xf6\xc9\xa0\x45\x56\xa8\x0b\xb8\x81\x9d\xa3\xac\x0c\x7e\x3d\x0d\x9e\x73\xf4\xe1\x1d\xf3\xc3\x42\x1c\x75\x7e\x38\xe4\xbd\x2c\xc4\x58\xe7\xf4\x13\xda\x59\x93\x8b\x8e\xb0\x6c\xad\x09\xa7\x25\x84\xb4\x25\xe0\xc4\x44\xd4\xe7\x4e\x36\x37\x1c\xda\x7e\x24\xbb\x9c\xd0\x62\xd1\x3c\xcd\xcc\x55\x7b\x16\xcb\x84\x9e\x85\x07\xc8\x3d\x81\x62\xb5\x93\x47\x2f\xa3\xdf\xff\xe2\x90\x59\x50\xc6\x36\x75\xea\x53\xea\x01\x60\x12\x99\xea\xad\x4d\x84\x4c\xba\x6f\x9b\xb8\x9c\x21\x67\x80\xbf\x41\xd5\x88\x0f\xc5\xb6\xd2\x18\xf7\x86\x15\xf2\xd3\xbe\x28\xaf\xf4\xf3\x19\xed\x35\x52\x26\x3c\x17\xb6\xea\xb3\x82\x1a\xe6\xd7\x0f\xe7\x5f\x42\x50\x10\x36\x69\x14\x2a\x4e\x52\xe5\x81\x8d\xd9\x58\x7e\xec\x71\xa2\xce\x98\x91\xd5\x48\x36\xbb\xea\x5d\x5e\x20\x27\x6b\x9b\xb2\xc0\x37\x58\xe4\x5d\x6b\xb9\x72\x7a\xca\x58\x73\x97\x15\x0b\x1f\x9a\x23\x29\xb9\xdf\xe8\x60\xad\x11\x69\xcf\x62\xb7\xb8\xa0\x89\x68\xe1\xe5\xe2\x14\x8c\x1e\x80\xf3\xfa\x9d\x64\x30\xd7\x98\x12\x09\x36\x59\x1c\xb5\x87\x34\x17\x2e\x66\x57\x6a\x9d\xf4\x3e\xc7\x4c\x78\x14\x04\x72\xa2\xd9\xd9\xd1\xa2\x45\xfb\xee\xb7\x73\x55\x5c\xdd\x5d\x43\x39\x81\x1b\xb7\xbf\x52\x31\x4b\x49\x33\xdb\xa0\x69\x4e\x78\x7b\xee\x12\x83\x53\x0f\x5c\x23\x5d\xe1\xc9\xd2\xa6\x9c\xc6\x5d\x66\x0a\x06\xc2\x91\x62\x66\xe2\x1e\xf2\x6d\x53\xe8\x45\x5a\x64\x99\x7a\xb9\x0f\xf7\xa8\x72\x1a\xe8\x2e\xa5\x91\xda\x6a\x61\x17\xec\x4b\x7f\x0a\x3e\x88\x9c\x28\x9c\xc7\x14\x22\x15\xfc\xca\xa5\xc1\xb4\xf3\xf5\x73\x95\xb0\xba\x48\x91\xbb\x14\x60\x5c\xbc\x82\x7c\x4c\x1b\x98\xfb\x6e\x4d\xc5\x9e\x61\x4a\xe1\x0d\xfd\x1a\xac\x1e\xb8\x23\x57\x08\x9c\xdb\xa8\x84\x77\xce\x51\x68\xbe\xf6\x97\xe0\xe9\x3e\xa6\xb7\xc0\x6b\xc8\x51\x81\x8c\x2c\xdf\xe4\x40\xfa\x4a\xf5\xb7\x15\xc9\xa6\xbb\x87\xb7\x19\xeb\xd8\x88\xe9\x69\x41\x3d\xdb\x13\xe7\x90\xa4\x1e\x85\x8b\x4d\x92\x1b\x81\xc6\xba\x80\xb1\x2d\xba\x3b\x7d\x22\xa6\x2a\x34\x48\x3a\xf8\xd5\x9c\xfe\x8a\x6e\x9c\x19\x9e\x36\x60\x96\x14\x55\x39\x7c\x9d\x8d\x88\x49\xbc\x8e\x49\xaf\x4d\x35\xf3\x28\x8e\xc1\xb1\x7c\x2c\x7b\x57\xaf\x4a\xab\x44\xdf\xd0\x0b\x96\x03\x14\x12\x14\xc6\x8e\xa6\x60\x8a\x0c\x7f\x3e\xbc\xb9\x67\x24\x86\xd0\x72\xdd\x2f\x8b\x82\xed\x9a\xcc\xcd\x44\x5b\x4e\x44\x0c\x0e\xa9\xe0\x8f\x41\x53\xe9\x24\xf7\x0b\x97\xf5\xca\x8f\x7c\x34\x78\x3f\x91\xad\x24\x17\x8c\x4d\x59\xb7\x6b\x90\xe4\xea\x06\xa6\x34\x13\x10\xb0\x69\x95\x88\x61\x54\x72\x97\xaa\x11\x89\x7f\xb9\xa2\x3f\xa2\x01\xab\x71\xdb\x25\xd9\x5f\xd1\x8d\xa4\x52\xe9\x3d\x68\x44\x13\xb8\xb6\xea\x5e\xdc\xa3\x31\x07\xaf\x1d\xe5\x1a\x47\xc2\x71\xc9\x28\x60\xc0\x2b\x05\x27\xf2\x91\xc0\x97\x47\x3b\x2c\x0f\xb4\xa1\xc1\xcc\x9d\x97\x7a\xf7\x8b\xd1\x87\x9e\x4d\x12\xcc\x9f\x62\xae\x1c\x68\xdb\xe2\xca\x58\xc4\xf1\xf9\x2b\xd3\x0b\x77\xe9\xaa\x19\x37\xce\x02\xf0\x6f\x6f\x03\x3c\x91\x89\x60\x2c\x15\x7e\x72\x50\xe4\xe7\xa2\x76\x16\x91\x07\x1a\x6a\x8b\x1a\x9c\x12\x86\x95\xa1\xbd\xd1\x92\x69\x85\xd5\xa0\xdc\x69\xeb\x26\x86\x0d\xa4\x92\x09\x83\x3a\x66\x8b\x0a\x46\x96\x03\xde\xe8\x18\xf3\x97\x3e\x11\x58\x38\x91\x32\x9a\x1e\xf0\x7a\x3c\xb5\x77\xb1\x49\xa3\x54\xe0\xdc\x6c\xf5\x89\x78\x97\xd1\x16\x4d\xa9\xae\xdd\x89\x57\x63\x24\xd7\x3a\x5d\xf2\xd4\x16\x71\x50\xa3\x5f\xcf\x26\x0a\xb3\xe1\x9b\x02\x24\x54\xd0\xe5\xe5\xfb\xef\x19\x5e\x28\xa6\xca\x1c\xfc\x92\x10\xf2\x4c\xad\x50\x61\x57\x80\xc7\xef\xbf\xb3\x48\x24\xc6\xac\xb9\xc4\x2c\x2d\xae\x03\xd2\xd8\x2e\xba\x70\x57\xf3\x8e\x1d\x71\xaf\xe8\xe0\x13\x14\x49\xb5\xdf\x74\x0d\x24\xbb\x27\xae\x76\x5e\xa2\x70\xe4\x83\x7d\xde\x5a\xbf\x41\x64\x03\x79\x44\x5f\x6a\xa6\x10\x5d\x0c\xf8\xf1\x15\xee\xd1\x6d\x48\xa5\x63\x36\xc8\x40\x44\x40\xca\xf0\x63\x1b\xb8\x24\x51\x8b\x2b\x7a\x0d\xde\x36\x98\x8e\x76\x56\xd9\xa8\xf0\xf2\x26\x33\xce\x87\x44\x6c\xc5\xa5\x9e\x1a\x6c\xaf\xf4\x63\x60\x6e\x30\x94\xf4\x58\xaa\x06\x60\xe9\x9e\xa3\xca\x19\x81\xa5\xda\x03\xca\xa6\xa3\x96\x94\x05\xf9\xbc\xb5\x8e\x03\xeb\x5f\x29\x30\x67\x78\xf1\x48\x5d\x38\x0e\x7b\x2b\xec\x58\xd8\x44\x24\x5e\x5d\x8f\xa3\x25\x76\x2e\x46\xd3\x5e\xa2\xc9\xd8\xc7\xf0\x02\xe2\xcd\x73\xb1\x0c\x5a\x12\x01\x3e\x48\x27\x22\x42\xef\x54\x68\xc2\x6c\x8b\xb8\x01\xc7\xce\x31\x73\x75\x13\x62\xbf\x6b\x78\xda\xa6\xa9\x67\x4d\x6e\xdc\x4f\xca\xcc\xa9\x85\xda\x3a\xf4\x09\xde\xa0\xc9\x45\x93\xcf\xd9\xa0\x88\x09\x4a\x48\xa7\x78\xf7\xa6\xf4\x82\x7f\xc7\x42\x1d\xd8\xfc\x82\x77\x66\x3b\xef\x19\x73\xc5\x5c\xf7\x9e\xba\xea\x57\xfb\xb5\xce\x76\x12\xfc\xa5\xa9\x02\xe6\xb0\x9e\xf2\x8d\x27\xa7\x7b\x1f\x63\xe6\xac\xdf\xb3\x25\x82\x51\xd5\xb7\x6b\xef\x53\xfa\x69\x52\xa0\xf6\xd5\x8a\x72\xea\x38\x64\x1b\x63\x24\x6c\x18\xa7\xcb\xb8\xa7\x69\x88\xb1\xae\x89\x57\x94\xec\xf6\x36\x4b\x32\x71\x04\x53\x7f\x24\x55\x11\x48\x6c\x30\x76\x79\xa2\xee\xa1\xfe\xf6\x88\x37\x6e\x21\xea\x4d\x6c\xc8\x20\x15\x00\xcc\xdb\xf5\xfe\xd2\x51\xf4\x4c\x25\x3a\xb4\xb6\x69\xd0\x84\xa9\x7d\x6e\x7d\x82\xf9\xf7\x8c\x01\xd5\x19\x83\x4e\x65\xcf\xf6\x4c\xe5\x0f\x14\xea\x79\x48\x30\xb4\x98\xf0\xad\xe3\x4d\x02\x42\x9f\x39\x28\xbb\x0d\x71\x19\xb0\xa9\xe1\x26\xb6\x45\x96\xa9\xb7\x67\x81\x53\xdc\xc4\x46\xc8\xdb\xa6\x0a\x7a\xeb\x57\x6f\x6c\xe9\x36\x11\xc0\x41\xfd\x9b\x2c\x2a\x83\x97\x4e\x23\xd9\xd3\xfb\x1f\x81\x28\x19\xab\xb9\x83\x3c\x23\x1e\x1e\xed\x6d\x38\xa6\x6c\x61\x88\x11\xf0\x18\x2b\x11\xb7\x3c\x8a\x96\x67\xd7\x35\x2b\x76\x11\x84\x6e\x5f\x72\x39\x5f\xc6\xe0\xc9\x2f\x52\xa8\xb5\x84\xe0\x3c\xd1\xc4\x8a\x52\x59\x9e\x3b\x4d\x40\x70\xd1\x1c\x71\x65\x5a\x81\x12\x13\x89\xa2\x7e\x4a\x7a\xc4\xb3\x41\x44\x79\x57\x37\x1e\x55\x2e\xe2\xca\x62\x79\x23\x66\xc5\x5d\xc5\xdc\x50\xc2\x44\x01\x20\xcf\x16\xe9\xe8\xf6\x7a\xef\x2d\x80\x38\x07\x7c\xb0\x0d\x16\x5a\x06\xaf\x63\x3b\x94\xe9\xd9\xb7\x55\x96\x80\x04\xc8\x12\x4a\xc9\x79\x6b\x23\xab\xcc\x80\xee\xd0\x08\x71\xa9\x0f\x8e\x9d\xa0\xee\xdc\xb9\x5c\x63\x48\xdb\x92\xaa\x58\xe6\xd8\x2c\x9f\xe4\x7b\xb0\x8d\xe0\xba\x80\x0e\x77\x61\x5c\x47\x7e\xc0\x1d\x9f\xbf\xa7\xd2\x7d\x89\x9f\x3f\x3f\x9a\x1a\x6e\xde\xa4\xb4\x12\xc1\x0d\x11\xd7\x4d\x79\x04\xaf\x4e\xf4\x4d\x3d\x8a\x6a\xa7\x8f\x58\x39\xf3\x98\x30\xff\x3c\x70\xd8\x1a\x0b\xc7\x28\xfe\xa3\x46\x3e\x50\x64\x70\x98\x3a\xaf\xbb\xab\x95\x3a\x6c\x22\xc6\x74\x97\xe8\xf8\xa3\x6f\xd9\x9f\x21\xce\x39\x6a\x74\x90\xb7\xb5\x47\xe0\x08\xcd\x3c\x4e\x09\x60\x2f\xfb\x21\xae\x65\x48\x60\xad\xca\x8e\xe8\xba\xe6\xab\x67\x7a\x72\x8d\x55\xfc\x20\x9a\xe5\x70\xcf\x2c\xe8\xda\x6f\x5f\xba\x85\x32\x8e\x9f\x2c\xd1\x7d\x5e\xa1\xf1\xdc\x4b\xda\x5b\xf1\x44\x72\xe9\xe6\x72\xd6\x50\xc5\x4d\x85\x82\x5d\x3e\xbf\x83\x49\x39\x9b\xcb\x14\xbe\x8f\x12\x85\xdb\xa3\x21\x05\x43\x2b\x03\xeb\xff\x51\xda\xb5\x86\x5c\xbd\xeb\xdd\x53\x05\xe5\x6f\xc1\x56\x4c\x32\x45\x13\x27\xaa\x31\x9e\x8d\x8c\xa2\x6b\x2d\x9c\x4e\x21\xd3\xe0\x0d\x52\x30\xd9\xbb\xac\xa9\x6d\x40\x8b\xb7\x78\x3c\x2f\xee\x6a\xc1\x80\x59\xa2\xe5\x98\x18\x02\x59\x8a\x6e\xb1\xc8\x7e\x66\x4b\x44\x3b\xf9\x58\x4b\x6a\x7d\x30\xee\xc2\xb8\x97\x4b\x3f\xc1\xb5\xed\xba\x8e\xf7\x42\x43\xc7\x70\x43\x3d\xa0\xa7\xc1\xac\x00\x79\xc6\x4a\xfa\xf3\xab\x3c\x79\xfe\x5e\x89\x93\x07\x7d\x1c\x94\xba\xf2\x3a\x80\x8d\xab\xba\xb4\x95\x4f\x8a\x43\xdc\x2d\x35\xa6\xf8\xcc\x4a\x1a\x5d\xf6\x87\xe5\x55\x8f\x5c\x10\xfb\x3c\xa4\x9b\x78\x57\x55\xdf\xcb\xdb\xec\x53\x19\xed\x79\x58\xf8\x82\x49\x0b\x64\xad\x6b\xe4\x02\xce\x4c\xa0\x09\x21\x9c\x0d\xa5\x79\xec\xa3\xa2\x6f\x8b\x07\x7a\xe9\x90\x36\x3d\x8e\x19\xd9\xc5\xf7\xb1\x0a\x50\x1c\x40\x51\x59\x82\xe3\x36\xab\x55\xd7\xf6\xb5\x46\xc4\xd2\xf6\x92\x8b\x4a\x42\xc2\x69\x8e\xab\xc4\x70\x4b\xf3\xcb\x8c\xda\x3b\x16\x3c\x8e\xab\xcd\x4c\x09\xe4\x26\xeb\xe8\x93\x22\xe5\x8c\x2e\xc6\x06\x2d\xf0\x94\x2e\xa2\x77\x70\xe0\x2e\x78\x66\xdd\x94\x61\xa8\xbc\x78\x64\x46\x99\xb8\x9e\xf6\x00\x5f\x1a\xa1\xd5\x6c\x93\x3e\xc9\x82\x59\x80\xe0\x7e\x7b\xd1\x3d\x58\xa4\x6e\xa0\x86\x03\x80\x2e\x51\xfd\x69\x60\xf7\x40\xa0\x5b\x73\x83\xb6\xfe\x6c\x03\x08\xd9\x08\x38\x50\x85\xb4\x05\x8c\x6f\x4a\xb4\xb8\xf6\x3b\x03\xea\x6b\xf2\x22\x67\xa9\x7c\xae\x3c\x1a\x11\x88\xa7\x32\xa3\x86\x02\x7e\xb0\x1a\x6f\xcd\x2f\xc6\x84\xce\x2f\x97\x14\x4e\xe8\xfe\x35\x4c\x02\xd4\xb0\xc0\x56\x3f\x04\x68\x96\x65\xff\x4c\x96\x36\x80\x6d\xe0\x31\xde\x14\xf7\x25\xb0\x1a\xc7\x2e\x10\x81\x59\x54\xb8\x0f\x0d\x44\x32\x07\xbd\x97\x28\xf3\xbb\xf8\xad\x60\xaf\xab\x88\xd5\x6f\x67\x1f\xaa\x5e\x6c\x35\xd2\xd4\x52\xf3\x1a\x48\xc7\x91\xcd\x25\x5e\x9b\xbd\x84\xc4\xe7\x7a\x71\x9a\x40\x78\x6b\x5c\x40\x76\xd7\xef\x3d\x3b\x0a\xfd\x5e\xea\xb5\x76\x0d\x7a\xde\x28\xf9\xb8\xd4\xab\x6c\xc4\xa0\xbb\x78\xa9\xe8\xaa\x62\x73\x01\xd9\xbf\x82\xaf\x1a\x90\x3e\xa0\xac\x1f\x75\xc7\xef\x12\x14\x30\x04\x69\x60\x75\xac\x37\x36\x40\x5b\x44\xd2\xf5\x62\xb8\x47\x1b\x78\x2f\x1a\x54\xcb\x64\xdf\x31\xcb\x09\xa2\x5f\x3c\xcf\x12\xa3\xed\xbd\xca\x79\x8b\xfa\xf8\x4d\xb2\x03\xba\x2a\x8e\x0b\x21\x6c\x38\x1f\x8d\x20\xec\xa3\xc6\x64\xbc\xf7\x5e\xa3\x78\x3d\xd6\x7b\x7e\xe2\x8b\xb8\x85\xa1\x61\x5f\x87\x0f\xc6\x98\xf9\x13\x2e\xbf\x1a\x52\xae\xfe\x62\x26\xc6\x6e\x60\xf8\xa0\xa3\xb8\x99\x4d\xc0\x80\xe9\x5c\xd8\xdd\x1b\xe5\x43\xf7\x5b\xc8\x88\xd2\x4f\x94\xa5\xe9\x1b\x37\x49\x09\x0a\xdf\xc5\x80\x90\xa3\xf6\x55\xda\xf1\x2f\x89\x62\x3d\xd2\x46\x68\xc2\x4f\x0f\xe7\xb1\xf9\x65\xc2\x4a\x33\x76\x53\x5b\x58\x72\x20\xec\x86\x4e\xad\xfa\xc8\x8a\x79\x35\x7f\x88\x30\x94\x27\xad\x43\xf0\xb8\xec\xf8\x9c\x5b\x64\xc4\xb2\xba\x5b\xbd\x7f\xc9\x48\x44\x34\xe2\x50\xbc\xf9\x98\xc9\xfe\xa4\x4c\x31\x32\x6c\x56\x86\x81\xb8\x9e\x22\xf5\x6e\xf2\x82\x3e\x3c\x15\xfb\x91\x33\xe9\xe4\x9c\xae\x4b\x1f\x8b\x29\x27\xca\x0c\x1a\x43\x01\x11\x85\x1d\xaa\x4a\xa4\x40\xe4\xaa\xa1\xb6\xc6\x56\x4c\x0c\x2f\x91\x00\x46\xc4\xce\x7e\xc0\xa0\x35\x05\xb7\x0d\xf3\x03\xf1\x64\x9d\x77\xaf\xb5\xab\xd5\x95\x98\xb2\x1b\x86\xd5\x85\xe4\xdd\x8f\x47\xcd\x08\xcb\xe4\x12\x56\x21\x70\x69\xc7\x6d\x23\x6b\xab\xc1\x5a\x7b\x18\x0b\x95\xb9\xa1\x43\x1e\x88\x8f\x08\xec\xde\xcb\xa9\x00\x92\xfc\x20\x4b\xb6\xb9\x67\xa3\xbd\x2f\xc6\xfa\xfb\xd7\x19\x8c\x25\x1e\x57\xdb\x01\x51\x47\x9a\x30\x36\x1a\x24\x9a\x54\xca\x45\x20\x68\xd0\xa4\x28\xb7\x5d\xb0\x2b\xb5\x90\x2e\xbd\x22\x5e\x7f\x54\xbc\xdd\xbf\x0d\x51\xfc\xde\x02\x6b\xf4\x3a\x8d\x7c\xd4\x36\x7e\x8e\x91\x04\x14\x74\x38\x04\xe3\x33\xaf\x2d\xc6\x5e\x4f\xea\x05\xef\x24\xf1\xa6\x0f\x54\x8e\x6f\x5f\x8d\x87\x42\x1d\xfb\x11\x70\x17\x22\x5f\x45\x7f\x9e\x2c\x26\xcd\x73\xf9\x39\x5d\x8e\x91\x04\xf6\x3a\x6a\xec\xc9\x2c\xe4\xf6\xe1\x42\xe6\x94\x3b\x71\xc6\xb1\x46\xac\xed\x31\x75\x20\x12\x20\x0c\x36\xe3\x9d\x76\x30\x5b\x89\xbe\x26\x9e\x63\x8f\x43\x12\xde\x9c\xc2\xc3\x52\x43\x85\x1d\xad\xb7\xfd\x5c\x48\xf8\x15\x0c\xd3\xf9\x3d\xc7\x8a\x21\x78\xfb\x2c\x83\x14\xb0\xb6\x16\x93\xaf\x9a\x16\x00\x09\x25\x29\xcd\x60\x53\x98\x6e\x53\xb2\x47\x1b\xc7\x46\x37\x1c\xe1\x12\x92\x76\x7d\xfd\x27\xb2\xf3\xaf\x4b\xaa\x38\xa4\x90\xee\xce\x93\x39\xaf\xbf\x95\x73\x50\x26\x45\xec\xf6\xa1\x9e\xf8\xb0\x3f\xde\x3b\xbb\x43\x2a\x84\x2c\x04\xc0\x36\xa9\x93\xf1\x7f\x27\x35\x13\x14\xbe\x06\xfc\x06\x6f\x3e\x9b\xef\x8f\x36\x2a\x87\x53\xe3\x8e\xc0\xd3\x2d\x0b\xc1\xff\x53\x89\x65\x3b\xa7\x56\x4f\xde\x63\xca\x93\x97\x11\xff\x8f\x2c\x95\x77\xac\xf8\x0c\x26\xe2\x0b\x1a\x06\xca\xb3\x9d\x5b\x3a\x3e\x24\x3a\x3f\x0c\xc4\x08\x52\x85\x25\xe5\xda\xc8\x81\x4a\xeb\x5e\xa0\x80\xdc\x40\xe8\x3b\xd8\x72\xb3\x69\xa9\xc9\xbd\x1c\x68\xb1\x8e\xa1\xf6\xa3\x5c\xef\x25\xf7\xe2\xf5\x3c\x29\xa7\xee\x54\x64\x85\x0e\xe4\xce\xd3\x78\x69\xae\x09\x79\x71\x35\x43\xee\xe3\x10\x33\xe6\x8e\x28\x35\xf4\xae\xca\xcd\x9a\x45\x6a\x35\x4b\xe9\xb1\xa2\x66\xf7\x7b\x95\xe7\xbe\x48\x7c\xb4\xbf\x73\x84\x5f\xae\x45\x90\x35\x76\x52\xb8\x32\x3c\xc1\x49\x62\x48\xda\xa8\x84\x18\xc0\xf9\xeb\x1a\x75\xdc\xf8\x0b\x0c\x44\xb6\x8b\xfc\xba\x4a\x53\xcb\xb5\xff\x20\xfa\x55\x45\xca\x38\x5c\x90\x3c\xb2\x9c\xe2\xc5\x41\x6e\x50\xa8\x3f\xf8\x03\xb0\x12\x47\xe1\x8d\xd6\x73\xc1\x70\xa4\x35\xdf\x31\xef\x09\x63\x4a\x39\x69\x66\x1f\x02\xd2\x5e\x59\x90\x8f\x03\x56\x4d\x7e\x19\x7f\x06\xc5\xe6\x48\x61\x78\x42\xe5\x85\x2c\x18\x6a\x68\x2d\xb5\x46\xa2\x3b\x0a\x2d\xdf\x33\x98\xb5\x90\x4c\xf8\xfb\x92\xc4\x85\xc7\x59\x0f\xbd\xb4\xc3\x80\x0f\x69\x91\x37\xe1\xf1\x9f\x5c\x57\x17\x83\xf8\x4b\x10\x6c\x51\xef\xa7\x26\xce\x6f\x7a\x70\x2a\x7c\xf0\x3d\x19\xa1\xa6\x7f\x7b\x60\xd4\xbb\x79\x86\x64\x51\x1f\x05\x16\xff\x31\x99\x56\x8f\xc6\x2e\x6a\x01\xbe\x38\xd1\x84\xa2\xd6\xe0\x73\x61\xdb\x63\xd4\x0e\x4e\xb5\xa1\xd6\x17\x55\x7f\xf7\x31\x96\x24\xb3\x9d\x76\x97\x62\xd1\x0e\x0e\x27\x53\x45\x6a\x83\xfd\xa4\x39\x71\x87\x4f\x5e\x12\xe7\x20\x10\x2c\x32\xb7\xce\xee\x6a\x0d\xf2\x2b\xdb\x57\x0f\xe1\x60\xbf\x9e\x90\x56\xb4\xed\x79\x70\xad\x7a\x7e\x57\xe7\x4e\x39\xa4\x9d\xb1\x18\x30\xe9\x84\xdf\xfd\xf8\x2a\x45\x37\x61\xb4\x97\x43\x9b\x88\x3e\x2d\x84\x67\x2c\x04\xc5\x27\xbe\x15\x95\x9d\x25\x59\xb2\xb3\x96\x03\x48\x8c\x7b\xc8\xe4\xd6\x81\xd3\x56\x75\xff\xd2\xf5\xc5\x2b\x15\x1c\x25\x9f\x8f\xca\x03\xfb\x42\x12\xca\xc6\x2c\x01\xd8\x51\x18\xc7\x76\x12\xc5\xfb\xee\x19\x92\x25\xf1\xf0\x28\xf6\xf2\x62\x85\x58\xd4\xd5\xc9\x3d\x86\x50\x9b\xc5\x49\xee\x8a\xdc\x7e\x0c\x73\x1b\xd8\x0b\xdb\x43\x7a\x1e\x99\x7a\x4d\x27\xf8\x0c\xf1\x13\x4c\xe1\xa4\xfd\x01\xef\xfc\xcd\x49\x48\x80\x9f\x3e\xdc\xda\xfb\x3f\x28\x57\x8e\x5a\x5c\x68\xeb\x71\x0c\x9c\xac\xa4\x6b\x0c\x33\xa1\x19\xa3\x66\xe6\x72\x5b\x18\xdb\x31\x9d\x08\x18\x5a\xad\x4b\x6f\xb3\x69\xd4\x93\x7d\xa1\x80\x07\x0d\xbc\xbd\xc6\x36\x51\x59\xbe\xe7\x14\x79\xae\x51\x7a\x53\x2b\x07\xca\xe5\x28\x60\x6b\xb6\x20\x03\x04\x17\x41\x8e\x0b\x1a\x0d\x7f\xa2\xee\x86\x1f\xb7\xe5\x6f\x7a\x37\x0a\x7d\x44\xb7\x15\xe8\xee\x6d\x9d\x6b\x11\xb5\x72\x66\x72\x4e\x84\x11\xc6\x35\x75\x20\xbe\x90\x63\x42\x4a\x89\x6f\x23\x2e\xcb\x03\x2a\x78\x8f\x44\x64\x29\x9c\x92\x37\x54\xc4\x40\x1c\x46\x8c\x1a\xf8\x14\x12\x05\x4d\xce\x70\xbf\x86\x90\xba\xf2\x43\x9b\xe4\x6f\x61\x9b\xa0\xe3\x6e\x93\xe1\x49\xcb\xe7\x52\x59\x77\xd8\x9a\x91\x91\x8f\x53\x51\xfa\x28\x40\xf7\xcd\x49\x1e\x66\x9b\xa9\x53\xba\xdb\xca\x5d\x85\x8c\xa3\x49\x92\x44\x23\x93\xa2\x68\x49\xaa\xde\xa2\x1b\x07\xf7\x78\x5b\xa5\xb1\x54\x29\xdb\x6f\x49\x97\x62\x87\x10\x5a\xe2\xe9\x6e\xac\xa7\xca\x52\x23\xc6\x48\x46\x0c\x21\xc9\xfe\xfc\xeb\x6a\x60\x25\x4a\x80\xea\x4b\xb8\x7d\x71\xc6\x14\x57\xa8\x82\x95\x36\xf6\xfa\xbe\x6a\x9b\xfc\x6e\x21\x84\x5a\x0f\xf7\x13\x1b\xde\x82\x42\x9c\xe7\xa9\x11\x23\x7d\x24\xab\xc8\xf0\x2d\x74\x1c\x2f\x5c\x6d\x3b\x9b\xde\x87\x39\x2b\x05\x8e\xf9\x5e\x94\x99\x79\x5a\x22\xa0\xfb\xa3\x74\x6d\x39\xc1\xac\x99\x6b\x93\x96\x74\x1e\xfd\xcf\x99\x20\xa9\x6c\x91\x04\xac\xd0\x8f\xc5\x8f\xdf\x6c\x30\xa1\x28\x3c\xd6\x0d\xd8\xbe\x81\xf9\x79\x8c\x16\x15\x23\x10\x1d\xb6\x82\x6b\xe7\x13\xd0\x75\xae\x06\x6f\x7e\x38\x32\x87\xcf\x40\xae\xf3\x12\xc6\x61\xc2\xd6\x41\x0f\x90\xb8\xed\xc5\xb9\xe2\x41\xe1\x71\x87\x11\x50\x84\x76\x04\x17\x05\x5c\x3e\x75\x02\x53\x45\xd8\xd6\xf1\x12\x0a\xa4\x58\x9b\xc7\x7c\x02\x55\xbe\xee\x86\xb2\x02\xf9\x05\x4f\xbf\x43\xd2\x41\xb5\x5e\x6f\x3d\x85\x7f\x3e\x17\x73\x87\x82\xbd\x55\x93\xc7\x7c\xf3\x2b\x8e\x8c\x3a\xc5\x5d\x64\x4a\x4c\x8e\xe5\x35\x18\x43\x94\xdd\xbe\x82\xa4\x40\x6f\xaf\x77\xf6\xf6\xbb\x10\x63\x6e\x6a\x65\xad\xa7\x65\x3e\xc8\x65\xe7\x53\x8d\x7a\xc3\x05\x5b\x38\x52\x87\x98\xc1\x42\xc9\x39\x9c\xdc\xc4\x86\x3c\x10\xe8\x02\x0a\x60\x97\x01\xb5\xf1\x34\x4c\x98\x21\xcc\x94\x7e\xa3\x60\xb3\xd0\xd8\xad\x27\x53\x42\x33\xf4\x23\x53\xf7\xab\x3d\x58\xfc\x6a\x07\x8c\x9b\xc8\xaa\x0f\xe8\x89\x40\xc4\xa5\x86\xdb\x78\x6d\x57\x71\x16\x1e\x9a\x1f\x74\x15\x24\x97\x80\x30\x19\x05\x62\x5e\x1a\x0d\x4e\x62\xd8\x7c\x29\x32\xf2\x5d\xc9\xb6\x62\x63\x8b\x37\xdf\x84\x44\x95\x72\x5f\xa2\xca\x51\x8f\xa2\xff\x5d\xe2\x13\x66\xd2\x05\x19\x60\x4d\x3c\xa5\x0f\x89\x35\xcc\x64\x8f\xdc\xd8\x07\x17\x25\xe4\x8d\xc0\xb9\x8f\xdb\xd7\x15\x9f\x75\x68\x67\x1a\xb3\xfe\x8b\xc6\xc6\xa8\x8b\xe3\x7b\xe5\xc8\xce\xab\x85\x4c\xbc\x34\x07\x7f\x57\x0d\x66\xf6\x8f\xe7\x77\x02\x75\x55\x85\x44\xbd\xe6\x4d\xd6\x43\x4d\xac\x50\xe1\x7e\x39\x8d\xe0\x7b\xe3\x08\x00\x0c\x0d\xaa\x59\xc1\x56\xd0\x8c\x2c\x0b\x41\x04\x13\x85\x2f\x50\xfe\x73\x43\x34\x22\x45\xe3\xa7\x8f\xd6\x50\x3c\x62\x8e\x45\x3c\x02\xf7\xdb\x37\x51\x1f\xf1\x67\x78\x40\x28\xb8\x28\x19\xbf\xfb\x95\x96\xdc\xf5\xd0\x2c\x7f\x0b\x3a\xa1\x3c\x01\x33\xe8\x80\xda\x2e\xf3\x2f\x21\x4f\xca\xfa\xf7\xed\xe0\xc4\xbc\xf6\x26\x9e\x17\x3a\x5f\x18\xd6\xfd\x50\x2d\x13\xe7\xd2\x0e\x48\xd9\xda\x6a\x86\x2c\xbd\x47\x9b\x08\x8b\x06\xf5\xd6\xbe\x32\x83\xed\xe3\xcd\xa6\xb6\x03\xf1\x3c\x63\xf8\xed\xd1\x46\xb2\x61\x80\x46\xcc\x11\x3a\xf6\x28\x71\x95\x16\x07\xad\x41\xbe\x0e\xd9\x6d\x0d\x88\x40\x52\x12\x53\xab\xda\xd8\x3e\x20\x72\x52\x93\xb0\x17\x99\xae\xd2\xf8\x22\xba\x65\x93\xee\xa3\x68\x9d\x5a\xbe\xb2\xa6\x89\x6b\xe6\x26\x63\xc0\x28\xfe\xf6\x82\x49\xed\x98\x5e\xcc\xd8\x1d\x9d\x2f\x6c\x06\xb8\xc6\xc9\x39\x1d\x29\xa4\x69\xd2\xf4\xe2\xda\xf8\x84\x02\xb5\x5a\xb4\x49\x39\x8d\x48\xb5\x36\x1e\x31\x68\x2f\xad\x44\x0e\x28\x86\xad\x03\x28\x79\x20\x74\xad\x6f\x67\x93\xdf\xd0\xbf\x7e\x93\x40\x77\x19\x5a\x79\x57\x3c\xf2\x6b\x5a\xd2\x4a\xb3\xe1\xe5\x28\x8a\x04\xf9\x85\x8e\x48\xb0\x5e\xe0\xa4\x8f\xc8\xeb\x34\x11\xae\x8f\x41\x59\x43\x8a\xc9\x38\x30\x57\x1d\xb4\x7f\xfd\x8b\x1a\x0d\xcb\xb8\x47\xd2\xd9\xc6\x02\x89\x3d\xc3\x81\x9a\x51\x6a\x04\x9b\x43\xf6\x5e\x13\x09\x28\xc1\xec\xad\x57\xaa\xc6\xba\x5a\x16\x6e\x93\x07\x24\x1a\xb2\x71\x5d\x87\x95\xd5\x10\x1f\xe9\xa2\xa4\x2e\xc6\x80\x53\xf3\x71\xaa\x7b\x0c\xf8\x65\xfd\x8d\xa1\xd3\xed\x5b\x10\x4e\x37\x26\x4b\xa9\xe0\xba\x2b\x89\xed\x28\xde\xc7\x70\x32\xcb\x12\x31\x9a\xf9\x0c\xca\x36\x61\x48\x6d\xab\x38\xde\x1f\xd7\xe1\x55\xd8\x31\x52\x39\x12\xfa\xa8\x4f\x4d\x1e\x8f\x5a\x12\x47\x63\xb3\xaf\x0a\x16\x64\x6f\x9b\x8a\xbf\x6a\x6e\x37\xfe\xca\xc1\x3d\x29\x7a\xeb\xb6\x1c\x62\x5f\x8a\x0e\x1a\x55\x3f\x5c\xe3\xfe\xd5\x62\x84\x71\xfd\x34\xb2\xde\x2b\x1a\x72\x28\x4e\xa4\xe5\xbe\x47\xb7\xf8\x33\x85\x1c\x17\x6e\xf6\x74\xfe\x70\x68\x68\xe2\xe8\xbb\x2f\x31\x96\xec\xc1\xbf\xfa\xee\x62\x0e\x4e\x5f\x39\x38\x27\x54\x1b\x83\x2a\x9e\x24\x24\x7b\x25\x71\xe7\xc2\x91\xfd\xf6\xd7\x4b\xb6\x8a\xc6\x73\x0e\x2d\xe4\x39\x37\x10\x5e\x2b\xbc\x7b\x2b\x93\xc6\x40\x2f\x90\x6e\x56\x41\x1a\xa4\xc6\x4e\xb1\xa2\xd7\xfd\xb9\x44\x8f\xef\xa2\x87\xa7\x49\x31\x67\x3e\x72\x5e\x04\x92\x1b\x0b\x9a\x17\x57\xd4\xd7\x61\x74\x06\x21\x74\x08\xd5\x8c\xa6\x4e\xdc\x53\x64\x5e\x8f\x27\x11\x5a\xc0\xa4\x9b\x9d\x51\xac\x76\xb7\xcc\x70\x8c\xee\x2f\x07\x9b\x34\xbd\xad\x3a\x57\x1c\xd7\x62\xaa\x75\x10\x85\x8e\x3d\x3b\xcc\x1d\xdf\x12\xfc\xb7\x3c\x34\xb2\xab\x98\xc8\x29\xae\xc8\xdb\x57\x1f\xff\xed\x94\x5a\xf5\x09\x69\xd2\xfd\xad\x0f\x71\xe6\x00\x43\xcc\xe6\xb5\x39\xc3\x33\x45\xae\x81\xbd\x27\x35\x68\xb2\x93\x2b\xc7\x5b\x1c\x5b\xc7\xf5\xf8\x6c\xec\x1f\xbe\xdc\x3e\x47\xaa\x45\x34\xed\xd5\xf8\xa0\x6d\xa3\x4a\xdf\x94\x31\x12\x8d\x46\xaf\x81\x3c\x9c\x60\x50\x76\x45\x88\x5e\x7b\xa3\xb1\x70\xef\x11\xa2\xd8\x9b\x79\xc6\xfe\xc6\xfa\x54\xe4\x19\x58\x5f\x52\xb3\x4f\xa7\x93\xe3\xab\x20\xdc\xb3\xbf\x6b\x0f\xd5\x43\xaf\xf7\x2b\x4c\x34\x8f\xf7\x72\xae\x36\xef\x88\xea\x51\xfb\x05\xfa\x6c\xd7\x14\x77\xcb\x21\xb4\x04\xab\x33\x3c\x17\xa2\xca\x2a\xc9\xba\xec\x25\x0a\x70\x80\x27\x6e\x08\xa0\x71\x98\xc6\x98\xe5\x36\x51\x55\x4d\xaa\x09\xc8\x25\x62\xa8\x52\x70\x5f\x02\x82\x77\x90\x99\x11\x26\x24\x3e\x6f\x52\x2d\x8c\x82\x55\x04\x95\x1b\xa8\x10\x11\x94\xec\x9c\x4a\xd9\xff\x51\xf1\x1d\xfa\x83\xa7\xc6\x31\x09\x97\x0e\x12\x9d\xc3\xed\x5d\xa9\x6a\xf1\xbf\x64\x28\xfc\x2f\x9d\x3b\xc3\xc8\x4f\xfb\xb1\x97\x4c\x9a\xc5\xa1\x4d\x63\xd8\xeb\x9d\xcc\x5a\x7d\x2c\x33\x56\x72\xbd\xee\x9c\x34\xde\x31\x4e\x90\xf9\x08\xf8\x14\xba\x62\x0d\x18\xf4\x22\x7c\x73\xc0\x07\x09\xa0\x18\x8c\x10\xec\x2d\xb7\xe0\x7c\xc0\x25\x6b\x75\x29\xdf\xa2\x58\x3d\x06\x17\xcf\x1a\x0a\xee\x3a\xbd\x43\x0a\xe4\x8d\xf5\xd2\x28\x05\x23\x34\x24\x08\x1a\x9a\xec\x1e\xf5\x61\x46\x80\xd7\x82\x7b\x69\x9e\x7b\x41\x27\xed\x57\xcc\x17\xf2\xd6\x63\x0d\x24\xce\x65\x5d\x74\x0a\x03\x9b\xea\x4e\x89\x15\x76\x27\xa5\xf5\xcf\xb9\xe9\x7b\x80\xca\xc2\x9c\x0f\x19\x3e\x96\x2f\x7d\x26\x29\x66\xec\xa3\x5a\x88\xa4\x36\x63\x67\x70\x90\x35\xc2\x3c\xa0\x5b\xe4\xb0\xca\xeb\x2e\x5d\x36\xe4\x49\x1c\x6e\xe2\xf6\xff\xe4\xa1\xd0\xb4\x6d\x2c\x0b\x4b\x51\x17\x34\xcc\x1c\xc0\x0c\xf6\x9d\x32\x29\xde\x2f\xe8\x27\xd3\x9c\x8b\x34\x5c\xbc\x41\x49\x89\x9e\xdf\x51\xe2\x20\x41\x21\xc5\x75\x9d\xa8\xa4\x60\x71\x23\xc7\x18\xfd\x8a\x30\xeb\x4e\x25\x04\xab\xca\xfe\x50\x0d\x3c\xa4\x25\x5a\xc5\x28\x7f\x51\xca\xc0\x85\x6a\x23\xde\x2c\x07\x24\xce\x7e\x4a\xf4\xd6\x69\x81\xc1\x17\xea\x38\x66\x36\x7d\x09\x1e\xbd\xa2\xe7\xc4\xc2\x41\x0e\x21\x31\x63\xde\x18\x95\x9c\xac\x83\x05\x35\x67\xf6\x66\xf6\x05\xb1\xa2\x4e\x52\x33\x97\xb2\x48\x45\xbd\x89\xf1\xf4\xea\x61\x8f\x8a\x48\x61\xd6\x61\xea\x29\xdc\xcc\xef\x07\x1d\xde\x93\xc6\x3b\x5b\x03\xb6\x45\x17\x1e\xc0\x27\x92\x67\x1f\xd3\x84\x73\x77\x55\xb6\xbd\x60\x17\x0c\xc7\xa1\xb4\xc1\x34\x0c\x16\x75\xb3\xf7\x50\xbb\x39\xb7\x6b\xde\xd7\xf0\x1d\x2f\x7f\x67\x20\xec\x21\xd0\x34\xc8\x4f\x62\xf5\xa1\xb8\xa2\x5c\xb4\x48\x43\x7a\x4e\x22\x2d\x0b\x52\x4a\x02\xdf\x5c\xe1\xa3\x72\x60\xae\x1d\x72\xba\xd2\x2e\xb8\x30\xfb\x21\xac\x60\x07\xdc\x82\xdb\xcc\x11\xf6\x5b\x06\x1f\xe2\x06\xf5\x9e\x51\x84\x4a\x8a\xc7\xec\xba\xb5\xee\xfd\x6f\x54\x63\x4d\xfc\x82\xfc\xc6\xfa\xc7\x59\xc3\x20\x13\xf2\x9a\xcc\xe9\x57\xdc\x6b\x33\x0f\x77\x99\x16\x8e\x86\xe9\x19\x66\x7a\x9f\x6d\xf8\xa0\xbb\xa6\x0a\x48\xf3\x1a\x0b\x56\x2f\x1a\x36\x7b\x7e\x55\xc8\xd8\x25\x04\xa4\x9b\xad\xde\xd7\xdc\xda\x8e\x29\x65\x2d\xac\xca\xee\xea\xd6\xcb\x3a\x74\x2e\x4b\x23\x24\x82\x01\x7f\x44\xe5\xce\x32\x44\x1a\xfb\x32\x33\x4e\x20\x42\xf4\x50\xfa\x1c\x3d\x9d\x07\xbc\x58\x4c\x10\x31\x74\x02\x65\x70\x7c\xc6\x13\x2b\xe9\x4d\x22\x20\x13\x26\xc7\x58\xc5\x7e\x93\xb8\x17\xaa\x6c\xcd\x32\x82\xe7\x2a\x56\xd9\xce\x7d\x5d\x59\xd8\xba\xb1\x0c\x6c\xbe\x5b\xdd\xe7\x2b\x3b\xac\x66\x08\xd2\x31\xc4\xf1\x77\x43\x8f\x21\x19\x69\x9c\x85\xc2\x30\xd3\xc2\x09\x8e\x91\x2d\xcb\xef\x4d\xfd\x19\xd0\xae\xf7\xba\x67\x76\x15\x5c\x31\xac\x01\x7d\x79\x14\x5b\x9a\x22\x54\x09\x4e\xd4\xc6\x0e\xc5\x89\xc5\x5c\x4c\xec\x68\x1c\xf0\x10\x84\x55\x76\x43\x41\x31\x5f\xbd\xa0\x66\x7e\x36\xea\x5c\xfb\x9c\x45\x49\x58\x65\x4e\x3c\xbe\x7c\xef\xdc\xc5\x40\xfb\x2f\x1d\x55\x12\x81\x23\xb7\x69\xb5\xae\xb5\x12\xd8\xfd\x2b\xc9\x24\x71\x2d\xa5\x02\xcc\x92\x02\x44\x7d\x19\xa6\xda\x1d\xd3\xa0\x26\xb5\x4e\x20\x04\x63\xdb\xe8\xa6\x29\x75\x9e\xaf\x9f\x57\x65\x62\x4d\xa1\x76\x35\x35\xda\xa8\x6d\x33\x2b\xd7\xd0\x12\x93\x6b\xc0\x3c\xfc\xf4\x6e\xbc\xf3\xde\x5c\x7a\xb8\xb6\xb7\x43\xc7\x81\xe4\x90\xe7\x68\x29\x1d\x37\xd9\x67\x64\xee\x6d\x21\x6e\xad\x21\x99\xa1\xb9\x0f\xe8\xd1\x11\x70\x59\x2f\xf9\xc1\x0f\x2a\x0c\xb3\x6d\x67\x84\x8f\x97\x4e\xbe\xeb\x61\xf0\xdb\x9e\x69\x5f\x2a\x18\x63\x1c\xa8\x27\x28\xa4\xf1\xe1\x95\xd0\x70\x4a\x51\xfb\x57\x0d\x48\xa6\x73\x92\x38\x3c\xb5\x8f\xf9\xe0\x21\x15\x19\x94\x6f\x82\x60\x1d\x8b\x9f\x88\x40\x24\x3f\x78\x43\x00\xab\xff\xec\x24\x19\x59\x59\x8f\x44\x86\xaa\xc9\x0b\xe8\x66\xb8\x89\xa6\x1f\x22\x33\x03\x47\xf1\xb3\x10\x70\x70\xd1\xea\xed\xd2\x80\x6a\x63\x15\x8e\xb3\x51\xf8\xcf\x5e\x3d\xba\xb4\x62\x67\xf7\x2d\x59\xbf\xfb\x7e\x89\x64\xe6\x42\xf1\xf4\xbb\xac\x9f\x39\x61\x26\xf8\x6c\x5b\x73\x22\x9b\xf3\x6f\x2d\x12\xe5\x8d\xf4\xc0\x01\x4e\x01\x3a\x06\x37\x28\x5d\xfb\x1f\xcf\x45\xeb\x24\x4d\xa9\x8d\x31\xb4\x5c\x8e\xac\x99\x12\x6a\xa7\x6f\xab\x55\x15\xb2\xbf\x4c\x8d\x08\x28\x50\x8d\x41\x78\xe2\x9d\x0a\xdc\x1e\x12\xc6\x31\xb4\xe0\x1d\x38\x50\x7f\x29\x8e\xb7\xce\x55\x86\x1d\xd1\x47\xe4\xb6\xf8\xa1\x14\x60\x7a\xc6\xb8\xe7\x65\xbf\xa2\xe6\xc3\x3c\xf8\x0d\x81\xf0\xa6\x04\x5a\x4d\x75\xb6\x20\xa8\xb2\xb2\x29\xbe\x8f\xdc\xb1\x8b\x49\xf6\xce\x09\x18\x44\x4c\x74\x01\xb4\x08\xda\x38\x55\xa2\x9e\x87\x08\x18\x9e\x2d\x60\x35\x5c\xce\x90\xef\x7e\x15\xa0\xa2\x55\x3b\xb5\xb4\xc0\x57\x9c\x5f\x0f\x4a\x26\xa5\xd6\xe0\x7a\x24\xe0\xd7\x4a\xfa\x5d\x72\x41\x21\xa2\x4b\xf3\xe1\xbc\x22\x61\x7b\x43\x99\x4e\x73\xe0\xb7\xa8\x20\xdf\x64\xf5\xf7\x5b\x33\xff\x3c\xbe\x12\x19\x21\x76\x5b\x66\x69\x92\xa7\x46\x1c\xe0\x4c\xd0\x1b\x7a\xe2\x5d\x10\xea\xe6\x83\xd6\x41\xc9\x7b\xa5\xfe\x44\xd9\xd0\xa1\x15\x16\x18\x03\x0f\x3d\x6c\x23\x19\x29\x27\x8e\x2c\xf4\x5c\x48\x0c\xb1\xd2\x1c\x83\xf7\x5e\x30\xf8\x63\xd1\x39\x37\x19\x64\x8d\xfb\xad\x14\xfa\x0e\xe6\xae\x0f\xfe\xe6\x7f\x26\x8c\xba\xaa\x60\x3f\x73\x66\x3e\x3a\x4a\x75\xfe\xec\x9d\x1e\x18\x66\xa8\x13\xa6\x6c\x6b\x92\x80\x43\x62\xca\xec\xeb\x35\xea\xe4\x0f\x28\xe1\x9e\xbf\x5a\x95\x73\x0e\x52\x59\x53\x1c\xe1\x19\x6d\x9c\x00\xff\x7a\xae\x96\x40\xfa\x2f\x7f\x95\xe7\x21\x72\xba\x19\xe9\x59\xef\xde\x2b\xc1\xb8\xe6\x8c\x66\x25\x0b\xe1\x70\xcd\x53\x3f\x46\x6f\x03\xc3\x7a\x94\x90\xc3\x3f\xa4\xe1\xea\xa3\x84\xc3\xe2\x69\x31\xc8\x6a\x5c\x27\xc9\xbe\xfa\x17\x14\x67\xe7\xf9\x7b\x2a\x8e\xf0\x48\x64\xa9\x20\x47\x2d\x3b\x0b\x1b\x65\x11\x3f\x90\x40\xd5\x4f\x8d\x01\x1b\xd7\x24\x48\xf3\xcc\x15\x72\xa8\xbf\xe9\xf1\xb8\x24\x94\x33\x66\x55\x37\xa9\x0b\xbb\xe5\xae\x73\x1d\xd5\x4e\x37\x6f\x0b\x2d\x9e\x4f\xf5\xda\xa2\xe9\xd8\x87\xd8\xb2\x8c\x7d\x8a\xdd\xa3\xb9\x23\xe1\x4d\x3c\xa0\xea\x2c\xb1\xc3\x1f\x2d\x28\xc0\x44\x79\xde\xe3\xe5\x13\xb5\xb7\x84\x4b\xe9\x48\x88\xb7\x6d\xf8\xa3\xfe\x05\xb2\x42\xb6\xc9\x1e\x17\x7b\x8a\xbe\xd1\xd6\x63\x67\x6b\x1d\x73\x04\xf7\x89\x51\xee\xaa\x86\x22\xa2\x5d\x5f\xad\x8b\x94\x5e\xc6\x89\x3a\x1b\xcf\xdb\x8b\x43\x84\xb2\xa6\x73\x0b\xad\xc8\x1a\xb2\xe1\xcd\xb7\xb6\x01\xf4\x9c\x28\x49\x2d\x66\xde\xca\x11\xd2\x6c\x0f\xd7\xdc\xc5\x8c\xc7\xed\x1a\x07\xfb\x48\x9a\x11\xed\x29\x49\x50\xa5\x21\x46\x86\xdf\xe8\xf2\xaa\xaa\x79\x7d\xcd\x39\xe3\x7f\xf2\xc1\x9b\x4c\x3d\x26\x8e\xb7\xe5\xac\x6f\x86\xcf\x5d\x92\xb0\xc3\x40\x91\xd4\x8f\xfe\xc6\x83\xbc\xc7\xcd\xdf\x8f\x10\x79\xa2\x38\x09\x6c\x00\xa7\x25\xf6\x3e\xb5\xe0\xc6\x22\xd5\x1a\x28\x1d\x21\x6b\xba\xb6\x32\x24\xa6\x29\x4a\xce\x9c\xf9\xa7\xb1\xf6\xea\xdd\xfe\xb6\x1f\xc2\xa1\x5c\xff\x75\x0e\xba\x29\x1f\xff\x03\xe9\x2a\x29\xd3\x1c\x9c\x2d\xce\xe4\x0a\xf3\xf3\x1e\xe5\xd5\x90\x2f\xbb\xd4\xe8\x77\xb9\xa9\x47\x0a\x77\x0c\x60\x92\x24\x0e\x79\xbb\xcc\x4c\xb9\x92\x2c\x0e\x42\x9e\xee\x31\x0d\xc0\x09\xb7\x3d\x75\x42\x97\xb7\xc4\x62\xf7\xc0\x61\xe4\xd6\xe6\x16\x76\xb6\xc2\x0b\x11\x8f\x67\x66\xae\x43\x63\x3e\xe7\x23\xad\xa3\xf8\xe9\x42\x48\x5d\xa5\x45\xd3\x0e\xa0\xea\xcb\xe6\xe8\x2f\xb9\x02\x0d\xd2\x48\x1e\xee\x91\xdb\x1a\x55\xcf\x7b\xeb\x08\xd4\x58\x5c\x5e\x25\x8f\xd7\xbb\xd4\x0c\x75\x93\x94\xc0\x1c\x9f\xe5\xd6\xaa\x32\xb2\xd8\x20\xba\x5a\x08\x10\xdd\xcc\x1e\x3a\x8a\xb4\x84\xc6\x13\x62\x62\xb3\xfc\x09\x35\x4d\xe6\x26\x6e\xe8\x08\x23\x9f\xd0\xcb\x0a\x9a\x97\xba\xcd\x9c\x9c\x69\x21\x4c\x12\x25\xa6\x81\xa7\x5e\xb3\x8c\x6a\x2b\xb5\x9d\xcc\x3b\xe6\xbe\x8f\xde\x90\x2c\x0b\xc6\x21\xdb\x20\xbe\x88\xb5\x15\xb3\x7e\x5c\x19\x4b\x60\xb2\x43\x03\xea\x1d\x78\x84\x82\x99\xf7\x8e\x7b\xe1\x94\x8b\x31\x67\x22\x65\xfd\x27\x54\x32\xbc\xe7\xc2\x73\xd2\xab\xdf\x59\x03\x5a\x5e\xf5\xc3\xb4\xba\x31\x61\x99\x27\x6f\x5d\x22\x2b\xe6\xdf\xf2\xa7\x8f\xfb\x17\x86\x0e\x9e\x32\xc6\xb5\x33\x71\x09\x6e\xec\x3e\x4a\x43\x95\xb3\xc0\x2c\xaa\x7d\x08\x40\x7d\x9c\xd3\xd7\x34\x87\x47\x00\xa6\x2e\xf6\x44\x4f\x35\x9d\x21\xb0\xe0\xf0\x90\x33\x28\x6e\x98\xed\x4c\x8d\x64\xef\xbe\x8a\x1e\x4f\x1e\xb1\x87\xaa\xa2\xee\x8d\xde\x1c\x6d\x82\x76\x43\xe1\xd1\x31\x6c\x85\xa3\x75\x99\xe3\x79\x2c\xac\xa9\x11\x70\x84\x90\xce\xe2\x1d\x47\x7e\x61\x17\xd7\xa7\x69\x9e\x84\x17\xbc\x67\x92\xcd\xc6\xa1\x77\xef\x31\x8d\xea\xbf\xef\xdc\xa9\xac\xef\xb2\xf0\x7b\x5c\xb4\x4b\x26\x6a\x6d\x22\xdd\xaa\x30\x91\xb5\xe9\x93\x5c\x88\xe7\x4c\xd1\xf6\xb7\xe7\x8b\xc8\xce\x60\x0a\x67\x04\x6d\x5f\x2e\xc1\x16\x7c\x58\x4f\xe6\x74\x80\x2e\x85\x00\x7f\x25\xcd\xfe\xb1\x50\x45\xf4\x0d\x80\xf5\xdf\x73\xa4\xa8\x32\xe8\x2b\x75\x8c\x91\x18\x2c\x1d\x5a\x12\x81\x93\x35\xe4\x1e\xf1\xb2\x97\x06\x6b\xdc\xca\xef\x3a\xdd\xc3\xfc\xc2\xaa\x60\x93\x33\x21\xef\xa5\xd3\x7c\xa9\x48\x3e\x2d\x9b\xf5\xff\x5f\x62\x3c\x07\x14\xf3\x04\x65\xac\xfc\x16\x8e\xc8\x60\x7c\x55\x59\xee\x3f\x2f\xa5\x0a\xf6\xf3\x47\x9c\x55\x63\xaa\xa1\x8c\x47\x27\x62\xe8\xac\x0a\xc7\xfb\x94\xc6\xdb\x74\x67\x6d\xf6\xed\xcd\x35\x38\xbc\x4a\x42\xc4\x99\xe1\x46\x1f\x55\xfd\xf8\xee\x67\xbf\x9a\x10\x30\xbe\x47\xa9\x66\xa1\x40\xa0\xd3\xa4\x46\x26\xbe\x76\xb9\xc0\xb5\x38\x00\x47\xd3\x74\x4a\x01\xcd\xc2\x60\x4a\x21\x7a\xf3\x10\xfe\x44\x45\x09\xa7\x7c\xff\xef\xc4\x25\x40\xb9\x00\x57\x9c\x1c\xdc\x31\xc6\xee\x7b\x52\x1e\x39\xf9\x49\x8b\xbe\xa8\x15\x6d\x66\x1d\x4d\x89\x1b\xb3\x87\x39\x7d\x04\x06\x16\x4b\x7a\x6e\x51\x5e\x6b\x94\xab\x73\xd2\x4e\x43\x3e\xe8\x19\xa3\xf1\x1f\x90\xf7\x86\xef\x0c\x95\x87\x7b\x65\xa3\x2e\x2e\x5a\x4c\x61\x24\x85\x5b\xda\x2f\x2f\xa1\x49\x31\x22\x36\x48\x94\xba\xe7\x6f\x0d\x8f\x3c\xc6\x53\xdd\x0c\x5b\x70\xfe\x87\xa0\x2e\x3a\x22\x21\xbb\xe7\x47\x40\xc8\x38\xe0\xeb\xe6\x3c\xe0\x4a\xf8\x5f\x1c\x81\x27\x37\x99\x97\x6d\xb1\x77\x1c\xd8\xcb\xb1\xe4\xf7\x2c\x11\xe0\xb9\x4d\x8a\xb2\xcc\x39\x58\x27\x49\x81\x94\x7b\x33\x76\x74\xea\x2f\xfe\x07\x0b\x16\xee\x20\x19\x0b\xdf\xaf\xe6\xc7\x3b\x07\x27\xdd\x1b\x4a\x32\xa8\x34\xe7\xca\x4a\x92\x39\x96\xbc\x04\x5d\xb0\x23\xd5\x58\x86\xe5\x9f\xe9\x15\x8d\x3c\xea\xb7\xb1\xfd\x45\x7f\x50\xfa\x54\xc5\xaa\xa8\xdf\xbf\x8a\x3c\xb5\xc7\x64\xb5\x49\x12\xd7\x4b\x61\xcd\xcd\x1c\xad\x87\x74\x44\xf6\x0a\xea\xb5\x1a\x2a\x72\x6e\x4a\xd2\x1b\x5a\xcc\x68\x65\xa1\x52\x02\x51\xa1\x55\x0d\xc8\x5e\xbe\x8e\xb4\x40\x54\x63\x69\xdb\x62\x93\xcc\x40\x7c\x0d\x0d\xb0\xc3\x87\x43\x98\x5d\x3a\x86\x91\x1c\x7a\x70\xa6\x90\xd3\x23\x22\x80\xaf\x52\x14\xf1\xa4\x8e\xfb\x50\xdb\xe7\x7d\x6a\xb3\x4c\xcb\x74\x50\xfe\xad\x4d\xad\xa2\x00\x9f\x1a\xaa\xf2\x10\xe3\xf8\x1d\x49\xa7\x8d\x18\xe8\xae\x9d\x1d\xac\xd5\xbf\x5f\xa3\x9b\x5d\x29\x89\x72\x71\xb9\x29\xe5\x11\xaf\xa2\x22\x59\x1c\xd2\xa6\xcb\x74\x7c\x75\x88\x73\x5a\x77\x6c\x44\xee\xca\xee\xa9\xc4\x5b\x8d\xda\xec\x5e\x51\x06\x4c\x00\xe8\x95\x22\x0f\x5e\x5b\xd8\x8c\xde\xbf\x36\x13\x2b\xaf\xad\x3d\x99\x62\x0b\xea\x04\x51\x61\x94\xc9\x88\x4e\x8a\x44\xd5\xc5\xb2\xdf\xf6\x10\xf7\xf9\x2d\x57\x72\xb1\x45\x3d\x85\x23\x6a\x82\x60\x44\x56\x51\x33\x66\x43\xb1\x2f\xaf\xd9\x6e\x3e\x9f\x1f\x35\xd1\x4d\x02\x1f\x88\x80\x62\xd2\x5c\xef\xd3\x8c\xb8\x94\x0e\x2a\x06\x2a\xac\xdb\xda\x9d\x0b\x8b\x08\x41\x1f\x65\xc4\xd3\x84\xff\x10\x0e\x54\xc2\x0c\x20\xe2\xd1\x1a\x26\x49\xc2\x7b\xca\x10\xc0\x47\xbd\xda\x87\xd1\x98\xe5\x5f\xb1\x1e\xc4\x09\x8c\x58\x99\x10\xe4\x71\x9d\x7f\x02\x0f\x2b\x75\x83\xfc\xd2\xab\xd0\xae\xd4\x7b\x81\xae\xf1\x92\x1f\x2d\x70\x9b\xff\x3c\x13\x5b\x63\x17\xef\x4c\x51\x13\x3d\x86\xd2\x42\xbf\x75\xb1\xf5\x13\xbf\x87\xda\x9e\x38\x9e\x76\xa1\xcf\x17\xb2\x09\x1f\xf4\xc2\x53\xe5\xfd\x45\x1a\xf9\x03\x0a\xad\x26\x6f\x6e\x30\x01\x5b\x1b\x03\xa4\xd6\x14\x9d\xaa\x2c\xe5\x84\x34\xe9\xe4\xa7\x61\x68\x2a\x21\x0e\xdb\x85\x5a\xa4\xe6\xd6\x9c\x18\xab\xb0\xd1\xa8\xed\x8e\xca\x60\xc5\x2e\x5a\xe2\x2a\x9f\xb4\x4f\x2a\xe9\x6c\xe3\x47\xda\xd7\x93\x88\xe7\x12\x2f\x26\xb2\x14\xf6\x51\xbd\x8c\x51\x83\x57\x1f\x8f\xd9\xcf\x10\x4e\x59\x05\xae\x79\xbd\x62\x00\xe0\x08\x89\x44\xe5\x33\x0b\x42\x25\x55\xe9\x1b\xbd\xe3\xe1\xcd\x45\xdb\x9d\x72\x6f\x1e\x70\x86\x9a\x7c\x54\x69\x39\xa2\x70\x55\xb4\x7e\x7c\x0f\xa0\xc7\x64\x1d\x40\xa6\xe8\xb9\xc5\xb2\x57\x96\x96\xee\x2e\xf2\x47\x57\x91\x3f\xb9\x13\x59\x6e\x10\x71\xd8\x51\x85\xdb\xff\xbe\xa4\x74\x95\x27\x07\x13\xa2\x44\x90\xd0\x37\xce\xd0\x16\x28\x19\xf4\x0e\x7e\xc9\xfd\x06\x56\xd1\x6b\x3a\x61\x9f\x84\x31\xf5\x0e\x27\x23\x14\xee\xec\x96\x1e\xa8\x4a\xa4\x97\xa5\xca\xd8\xc5\x4d\x79\xa9\x86\x5a\x7b\x08\xcf\x06\x53\x37\x55\x92\x21\xd1\x74\x44\xd5\x84\xb9\xab\x4e\x30\x8d\xb6\x8b\xfb\x9d\xa1\xdc\x5a\x86\x18\x08\xc4\x6c\x75\xcb\x8a\x8b\xb6\xc8\xd5\xd7\x73\x1f\xd5\x26\x16\x89\xc1\x8a\x7a\x12\xfe\x51\x52\x40\xfe\xaf\x75\x64\xe5\xdd\x75\x67\x10\x8c\x91\xb6\x3f\x17\x4d\x60\x6c\x23\x3d\x91\x32\xad\x59\x89\xe9\xd8\x46\x40\xb0\x09\x47\x32\x89\x1b\x11\x4c\x76\xd6\xee\x02\x17\x2c\x26\x5b\xb5\xcc\xf4\x7a\x96\xa2\x35\x19\x85\x26\x3d\xc9\x53\x1f\x03\x6e\xc1\xa5\xb8\x6b\x31\xf9\x07\x4d\x76\x0a\x64\xda\x8c\x02\x9a\x64\xde\xb2\x97\xef\x82\x3a\x2f\x13\xa4\x5c\x62\xca\xd2\xab\x16\xe0\x18\x47\xb1\x1c\x72\x94\x5d\xe1\xb5\xdc\xdf\x57\x69\xf8\xad\xb1\x00\x5e\x6b\xa0\x66\x81\x06\x88\x30\x45\x77\xaf\xb7\xf2\x86\x38\x1a\x88\xbd\x51\x97\x7d\x17\xfa\xa0\x3e\x9b\x19\x21\x6e\xf3\x8f\xa1\xe1\xc2\xd1\x1b\x25\x50\x46\x3b\x69\xb4\xc0\x54\xa3\x0a\x03\x5c\x64\x7f\xa3\x49\x80\x0c\x6d\x9e\x6a\xb1\xfd\x1c\x5e\x0c\x7d\xb4\xbe\x6e\x5f\x92\xc4\x93\x26\xff\x39\x01\x57\x4b\x79\x32\x95\xf1\xcc\x33\x6d\x8c\x23\xb2\x5b\x9b\x59\xab\x1a\x7e\x6a\x27\xfe\x6a\x81\x11\x9a\x9a\xbc\x17\x41\x8b\x72\x76\x6b\xcd\x20\xdf\xee\x9c\x41\x2b\xe7\x1f\x86\x17\xf2\x6f\x4c\xd2\x35\x6a\x91\x68\x0d\x79\x8d\x33\x59\xc4\xcf\x1c\xd6\xb2\x3c\x64\xdb\x30\x33\x8a\x63\xfc\xbd\x9d\x11\xde\x5c\xeb\x9b\x97\x6b\xd2\xec\x00\xa3\xef\xef\x4c\xfe\x56\x09\xdf\x85\x1e\x69\xce\x2d\xc1\x71\x2a\x9b\x1a\x1d\x7d\x42\x0b\x4f\x55\xa7\x0c\xde\x3c\x36\x3b\xb1\x3a\xe8\x80\xce\xec\x6b\x75\x22\x57\xb4\x6a\xf4\xde\xf0\xcd\x72\xd0\xba\x46\x9d\x20\xb9\x16\x40\x4c\xa6\xa4\xc7\x52\xa1\x44\xb9\xf8\x07\x7d\x58\xef\x2d\xc7\x5e\xc3\xfe\xd2\xea\xe1\x6f\x5f\x65\x29\xe1\xcb\x3b\xeb\xb3\xfb\xec\x3d\x83\x21\x01\xd2\x24\xb1\x38\x89\x9a\xfe\x0b\x94\x4a\x84\xfb\x17\x15\x70\x6a\x4a\x52\x6e\xd2\x77\x67\x8f\x22\xde\xca\xdb\x89\x35\xff\xb0\x84\x82\xfc\xac\x2f\x2b\x97\x26\x06\x86\xfb\x97\xeb\x06\xde\xd3\x42\x5d\xca\xd9\xd5\x6f\x61\x71\x2b\x63\x75\xfb\x13\x7a\x86\x0a\xb7\x44\xb3\x25\xa2\xe7\x8d\x17\xac\x7b\x7a\xdb\x50\x53\x6e\x85\x7e\x0c\xbd\xe8\x18\x39\xfc\x88\x0e\x8a\x1b\xb3\x00\x6c\xac\xfb\xc0\x98\x61\x82\x3a\x56\xb9\x1a\x87\xb6\x36\xa1\x45\x9d\x14\xbd\x05\x80\xd2\x17\xf3\xe6\x56\x39\x55\x17\xe9\x52\x8f\xa6\x0b\xd5\x68\x8a\xa5\x03\x93\x8a\x1f\xa0\xe5\x8a\x8d\x7b\x85\x30\x33\xc0\x7b\x5c\xe4\xc3\x12\xfd\xa6\x36\x26\x8d\x2a\x1a\xcd\xef\x4e\x05\x4d\x28\xbc\x98\x55\x1a\xc0\xcb\xb6\xb6\xe8\x31\xda\x34\x82\x97\xb0\x09\xde\xb8\x2e\xd1\xb8\x31\x47\xde\x7e\x89\xee\x7b\xdc\x40\xe0\x29\x6d\xad\x1b\x7e\xbf\x7d\x75\x60\x05\x27\xa9\x69\x15\x78\x7f\xf7\x50\x14\xce\x8d\xe7\xcc\x8b\xfd\xd8\x58\xe4\x7d\xb8\xc9\x60\x45\x86\x57\xff\x6b\x00\x90\x84\xa6\x88\x6d\xe6\xc1\x0c\xab\x46\xe1\x6c\x51\x2f\xb1\x5c\x29\x75\x8c\x17\xd4\xfb\x2d\x56\x93\xb6\x84\xa9\x2c\x1a\x9d\xf3\x15\xef\xf2\x1e\xa1\xda\xda\xf1\x29\xd2\x6f\x40\x59\xba\x37\x58\x8e\x1b\x78\xf1\xa1\x7e\x73\x8c\x96\xb4\xe1\xea\xa0\x01\xfa\xd6\x26\x8d\x45\x77\x25\xe6\x96\x2b\xfd\xa0\x84\x29\x01\x43\xf2\xe6\xb8\x75\x79\xe9\xb2\xd4\xc0\xf7\x35\x0a\x15\x6b\x3d\xa2\x9e\xb8\x8b\xa9\x2f\xf2\x5c\x14\xaf\xc9\xa4\x8b\x5c\x30\xa2\x70\x12\x0c\x6f\xa8\x9a\xe1\xff\x7b\x8d\x98\xd9\xea\x4b\xa9\x72\x59\x03\xa5\x0f\x36\x90\x3b\x4d\x42\x1b\x67\xc1\x35\x22\x72\xc1\x3a\xb5\xf7\x5a\xb0\x3b\x01\x32\xbc\xa4\x59\xe9\x0d\x7f\xd0\x7d\x03\xa5\x72\xfe\x49\x41\x1f\xdf\xd4\x4b\x98\x75\xac\xca\x04\xef\xf4\x56\x16\x0c\x08\xc7\xe0\x31\x71\x6a\x31\x99\xbb\x30\x85\x54\xb3\x12\x27\xa3\x63\x49\x97\xb3\x5e\x19\xb8\xa4\xf7\x74\x85\xe4\x57\xf7\xbd\xd9\xcb\x25\x90\xe2\x66\x17\x11\x64\x7b\x21\x94\xa5\x19\x8b\x2e\xb1\x71\xee\x39\xdd\x40\xbc\xdb\x0c\x77\x4a\xb8\x9c\x07\xcc\x07\xe5\x09\xb5\x6b\xf5\xf9\x07\x8a\xed\xfb\xd5\x2b\xea\x66\x2c\xbe\xac\xd2\xd6\x80\xd0\x4e\xe0\x75\x97\x7e\x63\xef\xc5\x4b\x5d\xcc\x74\x1c\x52\x59\xab\x77\x95\x4c\x5c\x3e\x9c\x2d\x8b\x11\x12\xce\x8b\x5a\x6a\xaf\x21\x3b\x37\x10\x09\xf0\x2a\x66\xc0\xae\x4b\xc7\x5f\x3c\x95\x19\xbc\x21\xff\xe4\x67\xea\xe9\x87\x5e\x0d\x73\x6d\x77\x90\x2e\xf8\xd4\x5c\xd6\x98\x42\x89\x2f\x6b\xe8\x25\x51\xec\x45\xd7\x88\xf3\x26\xed\x5e\xbd\x85\x35\x65\x47\xc6\x53\xa3\x79\x90\xdc\x21\xd3\x66\x5e\x52\xa9\xa5\xd7\x45\xbf\xc6\x06\xcc\x59\xb1\x83\xb3\xf9\x99\xb1\x78\x17\x2b\xf7\xf2\xd2\x03\xd2\x5f\xd3\xaa\xb4\xca\x7b\xd8\x82\x6f\xa8\x09\x6c\x9d\x0b\x9f\x47\x36\x1a\xba\x8c\xa9\x3b\x79\x54\x3e\xf5\xc1\x09\x93\x39\x56\xf2\x1d\x03\xca\xee\x77\x4d\x8c\x2d\xfe\x53\xb4\x9c\x3e\xd3\xc4\xff\xcd\xe2\x32\x97\x10\xc5\x47\x9c\xcb\xd7\xcc\x21\xe2\xfd\x89\x07\x97\x3c\x84\x7c\xfb\x5f\xd3\x45\xe1\x31\x48\xd2\x2b\xdd\x31\x00\x9e\xf7\xaf\xae\xba\x93\xd0\xf5\x0a\xa6\x6b\xcb\x5d\x31\x4a\x23\xb8\xe2\x31\xe0\x35\x22\x0c\x0b\x59\x7b\x9a\x59\x8c\x8a\x65\x69\xc9\x45\x82\x2e\x5d\x51\x73\xd9\x55\x97\xf6\x8f\x45\xc4\xd4\x7a\xcd\x6f\xfd\x29\x66\x88\x39\xbe\x55\x60\xd2\x14\x74\x70\xcc\xbf\x6c\xc1\xd4\x14\x00\xae\x67\x82\xa1\x70\xc3\x76\x7f\x8e\x89\xc6\xed\xf6\x76\x60\x81\xf4\x3f\x28\x23\x89\x4d\xe9\x87\x0a\xe0\x3f\x51\x21\xd4\xf0\x24\xb9\x5f\x6c\x11\x63\x14\xab\x34\x6d\x27\x21\xcb\x0b\x49\x72\x0f\xcb\x29\x9c\xbb\x13\x8e\xf3\x6a\x70\xb6\xc8\xfa\x04\x92\x96\x82\xb2\x4d\xb6\x72\xeb\x91\xae\x94\x16\x76\xa8\xe6\x12\x56\x6f\x43\x8e\xd9\x31\xd2\x8e\x5e\x6b\xa0\xb9\x02\x7a\x8f\xc4\xeb\x42\x69\x52\x1c\x2d\x7b\xec\x2a\x0c\x8e\x99\x8b\xd0\x0d\x18\x8b\xfd\x33\x21\x38\x4b\x8c\x42\x3c\x72\x8a\x59\x9f\xca\x27\x3e\xc8\x73\x43\xdf\xf8\x1d\x6a\x86\x8a\x0d\xbd\xa3\x9e\x9d\x93\xcd\x34\x40\x3b\x21\xc0\xac\xc3\x91\xc3\x98\xb5\x99\x37\xa7\x00\xe1\x54\x95\x2d\x62\xd3\xb5\x68\x74\x7a\xdd\x42\xc2\xd8\xdb\x82\x17\x8a\xc0\xba\xe6\xa8\x78\x3b\xab\x3a\x9a\xbd\x5b\x8e\x36\x66\xc9\xa7\x37\xe9\x40\xa6\x45\x5c\xd8\xfa\x0e\xa1\xc4\x8d\x41\x9f\x67\x43\x22\xaf\xc0\xe6\xfc\xa8\x05\x6d\xff\xca\x88\x1a\xad\xc1\x67\xb7\x48\xc1\x81\xaa\xc2\x96\xd0\x9d\x1a\xfb\x11\xed\x0a\xb7\x0b\x72\x61\xdb\xb1\xab\x87\x90\xc7\xb8\x29\xfb\x76\x91\x6c\x1c\x02\x4e\xce\x6a\x3a\xd9\x2c\xee\x92\x96\xcb\x96\x06\x8c\x71\x0a\x1e\x8c\x93\xc4\x98\x1b\x65\x3d\x86\x87\xcc\x9d\x90\x45\x8b\x63\x24\x82\x9a\xa5\x17\x45\xd1\x44\xfa\x0d\x2c\x61\x8f\x86\x7e\xd4\x24\x43\xcf\xce\xd9\x59\x64\x0e\x79\x19\x47\x43\xaa\xfc\x22\xf7\xa2\xa3\x25\x97\x9c\xae\x21\xa5\x3d\x42\xbc\x17\xe7\xc1\xeb\xe9\xcb\xdc\xa2\x81\x73\x0a\xe6\x47\x30\x42\xd0\x5f\x14\xb3\xda\x5c\xb2\xec\x86\x12\x10\xed\x1f\x3b\xdf\x37\x56\xd1\xbc\xfe\xc3\xc3\x70\x86\x4e\x4a\xd3\x65\x3a\xbc\xcc\x4a\x3f\xee\xca\x8b\xd1\x8c\x72\x88\x50\xe9\x75\xfc\x99\xda\x5a\xab\x72\xa7\xbd\xf5\x0a\xee\x44\x55\xd5\x96\xa6\x7f\x4b\x12\x93\x54\x56\x13\x59\x34\xd5\x8f\xa4\xab\xb9\xeb\x8c\x88\x04\x71\x21\x9a\x49\x62\x56\xe0\x5e\x32\xcf\x5b\xec\xf1\x80\x28\x79\x86\x57\xc3\x62\xf8\x7f\xf9\x29\xd2\xb6\x08\x09\xf5\x8b\x8a\xdf\xf4\x08\x6f\x6d\x18\xac\x70\xa3\x36\xe3\x7d\x8a\xd1\x65\x68\xff\x45\x76\xe8\xbd\x20\xbe\xfb\xbb\xc5\xc9\x81\x68\x44\x5a\x82\x54\x49\x49\x13\x32\x46\xd1\x0c\x8b\x67\x09\x28\xfc\xb8\x1b\x66\x24\xb8\x2d\x92\x0f\xb9\x6c\x7a\x34\x0f\x2b\xa3\x04\xed\xb7\xab\x4d\x99\xdc\x75\xc0\x29\x96\x62\x8e\x88\x96\xc6\xb1\x6a\xa5\x61\x1f\x0d\xcc\x7e\x87\xba\x98\x1d\x39\x0b\x45\xe5\xdf\x25\x5a\x4e\xd5\xd9\xd1\xee\x28\xf1\xaa\x36\x4b\x6e\xd1\xf4\xb6\x9e\x75\x35\x9f\xc5\x4f\x74\xdf\x32\x58\xc1\xfc\xc7\xd6\x70\xab\xa9\xe9\x23\x7b\x80\x7c\xf5\x14\x09\xf9\x71\x58\xda\xb1\x9c\x20\x28\xb7\xce\xbe\xc5\xb5\x67\x79\x76\x43\x25\x5d\xc5\xd0\x9c\x07\x4e\x2f\xc1\x0c\xcd\x1b\x1b\xfb\x14\x39\xcc\x7c\xdf\x14\x23\xe2\xbd\xae\x34\xb2\x87\x71\xce\x4e\x6b\x54\x25\x74\xfa\x0c\x59\x84\x1e\x2f\x65\xdd\x98\xf4\x53\xa5\x57\x01\x20\xc0\x02\x95\x5a\x7b\xc2\x47\x0f\xa7\xdf\xb0\xda\x45\xfc\xea\x2e\x09\xf6\xfc\xf8\x60\x61\x21\x12\x15\xb1\xc6\x57\x2b\x87\x33\xf0\xef\xb8\xe1\xef\x98\xfc\x23\x89\x1b\xc6\xf7\x8e\x4d\x52\xe5\xac\x2b\xa1\x7e\x3f\x62\x22\x25\x0b\xb2\xd1\xb8\xe3\x5a\x20\xbc\x50\x48\xf6\x26\x91\xef\xce\x45\x8d\x84\xde\xe6\x99\x18\x16\xa0\xda\x96\x44\xda\xb5\xef\x93\x8c\x51\x14\x3f\xa4\xcb\xce\x60\xde\xc2\xa5\xce\x9b\x77\xb1\xcf\x35\x44\xc8\x96\x90\x14\xee\x47\x22\x38\xc4\x66\x40\x22\xd1\x5e\x2a\x32\x7c\x45\x9b\x96\x6d\x60\x00\xdf\xfe\x5f\xff\x28\x37\xdb\xcf\x14\x7a\xd1\x9f\x3d\xc4\xc4\x67\xea\xf2\xb3\x88\xb3\x71\x1f\xe7\x60\x48\xce\x31\xfb\x79\x76\xc9\xd4\x99\xd5\x37\x9f\x41\x25\xfa\x3e\x0b\x55\x48\x36\x62\x26\x89\x2b\xee\x06\x71\xe3\xf9\xf0\x10\xff\x87\x70\xe1\x78\x4d\x97\x01\x51\xb5\x04\x7f\x24\x3a\xee\x1a\x63\x51\x5f\xa7\xe5\x9a\xf8\x5e\xcc\x4c\x69\x3a\x40\x3e\xc2\xad\xf4\xa7\x3a\xf4\xce\xb5\x44\x24\x5f\xa7\x6b\xfc\xf9\x1c\x4d\xbc\x50\xe0\x54\xa1\xaa\x3b\x27\xb0\x77\xec\x86\x1f\xc1\x09\xf5\xe4\x2d\x82\x42\x17\x7c\xa1\x0b\xdf\x53\xc8\xf1\x7b\x33\x2a\x08\xf7\xc9\x3f\x3f\xf4\x24\x49\x44\xe0\x37\x74\x9c\x85\xf1\xa1\xf4\x93\xcb\x70\xdd\xa8\x59\xce\x9c\xdb\x15\x6c\x59\x04\x1d\xda\xc4\xc6\x60\x81\xfa\xc2\xde\xfe\x47\x79\x35\xc5\x86\xb1\xe3\x47\x0a\x29\xf7\xd6\xc9\x0e\xa9\x50\x81\x9b\xcf\x8f\x42\x48\x0e\x70\x24\x64\x22\x12\x60\x3e\x14\x3b\xef\x5e\x46\x54\x7b\x4c\x93\x83\xdc\x30\x09\x67\xc3\x52\xde\xc4\x09\xcc\xa1\x95\xc7\x19\x8e\x5f\x3d\x54\x57\xdb\xec\x5a\x9d\x65\xb6\xf6\x2b\x0b\x82\x4b\xbe\xca\xd7\xce\x22\x69\x67\x25\x07\xb8\x30\x27\xde\xed\xa4\xbe\xa0\x91\x69\x9b\x39\x98\x67\x6b\x57\xc0\xa9\xc0\xbf\x22\x85\x7e\xa4\x05\x33\x3e\x08\x24\xdc\xf3\x14\xc3\xa2\xee\x12\xc2\xf2\x3e\x3d\x19\xc1\x26\x79\x15\xfd\x37\x29\xe2\x9f\xc1\x02\xdc\x81\x53\x3a\x37\xf2\x81\x06\x62\x35\x43\x5d\x4e\xda\x88\x87\x50\x33\xfe\x7f\x2f\xf1\x28\xca\xfd\x07\x5f\x9a\x20\xa2\xb2\x7f\x28\x2e\x07\xe4\x62\x87\x3a\xa8\xe3\x9d\x8c\xa8\x65\x19\x39\x2e\x70\xeb\x75\x23\xaf\xa8\x7f\xde\x55\x8e\x88\xaf\xfd\xd4\xb8\x2a\xc4\x8d\x4c\x5a\x42\x52\x17\xbf\x45\xa7\xb1\xbf\x7a\xf7\xa4\xe3\xf2\x72\x8a\xec\x8d\x6d\x14\x33\x29\xc7\xaf\xc2\x4c\xf0\xdc\xd8\x7b\xda\xb7\x16\xff\x73\x9e\xe1\x3e\x18\x20\xd0\xf4\x1c\x47\xad\x02\x12\xb6\x2f\x45\x6f\x9f\xc1\xc2\x6e\x3c\xb3\xc4\x3c\x49\x50\x46\xc6\x57\x5d\x1b\x48\xc3\xe0\x55\x82\xb0\xc2\x8c\xda\xf4\x02\xf9\x9a\xa5\x9d\x32\x32\xa1\x15\x25\xdc\xfe\xc7\x51\x4c\xcc\x57\xb2\x05\x58\x6c\x96\xf4\xc3\x26\xee\xc6\x4a\x39\x98\x43\xca\xc5\xf5\x26\x19\x8c\x1c\xe6\xa6\xc3\x01\x74\x8a\x5a\x04\xfe\x1e\x5b\x76\x85\x4c\x2e\x2a\xcc\xf2\x76\x3c\x17\x29\xa9\x3f\x43\xe0\x8c\xa3\xdc\x5a\x37\xb5\xb4\xd4\x34\xc9\x00\x62\xd5\x83\x97\xec\x24\x92\x15\xa3\xc8\x74\x46\xe4\xe8\x55\xf0\x5b\xaa\x19\x07\x65\xb6\x18\x59\xcd\x33\x97\xf6\x51\xcc\x97\x7e\x0b\xfb\xdd\x18\x1b\x6d\x10\xdc\x11\x05\x69\x9f\xa0\x06\x04\x81\xed\x42\xef\xb4\xad\x4a\x26\xbf\x06\x57\x93\x33\x76\xe1\xe3\x87\xf8\x14\x52\xdc\x14\xd9\xc4\xde\x5b\xb1\x2d\x74\xa7\xb4\x5b\x87\x4a\xf7\x6e\x3f\xc2\x26\xbb\x1a\x60\x69\x3d\x0c\x1a\x7d\x94\x09\x54\x51\xa0\x2c\xcb\x5a\x78\x55\x11\x5b\x15\x4d\x52\xeb\xd5\xc2\x1b\x49\x83\x45\x0d\xac\x15\xb0\x99\xe6\x41\xa7\xe1\x2a\x94\xbb\x27\x2e\xb4\x06\x66\x24\xde\xd1\xef\xc5\x14\x30\x26\xe5\x68\x7d\x4b\xc0\x9b\x4e\x2b\x9e\x38\x74\xd4\x1b\x8b\xba\x26\xe9\x70\xf6\x57\x48\xc0\xe9\xa7\x51\xc2\xd2\xc8\x34\x33\x0a\x92\xd2\x5d\x7e\xea\x27\xae\xb4\xc7\x20\xe2\x17\x7b\xb6\x76\xf2\x82\xef\x5f\xb3\x64\x3d\xea\x17\x46\xe1\xb5\x41\x0d\xc9\x5e\xa5\xfc\x13\xe3\x9f\xbf\x66\x74\xf9\x5c\xba\x20\x3f\xf4\x89\x39\x96\x43\xc1\x16\x94\x90\x0e\x3a\xa9\x1c\xf3\xe0\xf0\x4f\x91\x08\x5b\x93\xde\x39\x34\x25\x84\x36\xb8\x83\x20\x2d\x4c\xc2\x4c\x8f\x64\x07\xfc\x68\xf6\xe0\x85\x21\x91\x0c\x15\xcb\x31\x0e\x54\x1a\x79\xdb\x95\x22\xde\xf0\x66\xe8\xf4\xca\x63\x88\xc6\x52\x9b\xed\xc6\xa6\x5b\xbb\x5e\x41\x67\x58\x34\x53\xb0\xd1\x7c\xc9\xb9\x23\x1a\xcf\xaf\x1a\xf3\x69\x8a\xfa\xbd\x1b\x82\xb4\x8a\x96\x98\x04\xc4\x59\xb8\x69\xd9\x8b\x54\x4b\xbe\x7a\x4f\x27\x19\x01\x99\xc9\xf5\x54\x1b\x92\xb8\xc1\xf8\xd9\x4a\x25\x4e\x57\x26\x6f\x10\xc4\x9b\x11\xdc\xe2\xf5\x05\x89\xd3\xd6\xc2\xc3\xe4\x43\xc5\x05\x1b\x4f\x3c\x9a\x96\x31\x4a\xee\x7b\xe5\xb5\xd7\x0b\x3e\x31\x3d\x5b\x4f\xe5\xf9\x44\x23\x9d\x46\x85\x34\xd0\x64\x10\x6a\xd4\xab\x39\x86\x42\x17\x05\xf2\x1e\xe2\xbd\xab\x56\x07\x0a\x05\x72\x1c\x0d\xcb\x4a\x3b\xce\x62\xd0\x27\xd6\x51\xc4\x12\x33\x12\x13\xa7\x08\x8b\x10\x70\x23\xc4\xa0\x8e\x27\x65\x17\x38\x57\x9a\xe1\x10\x1a\xe9\x51\xa4\x12\x93\xdf\x5b\x8a\x62\x6c\xca\x21\x7e\x53\x17\x78\x50\x97\x46\x09\x5a\x9d\x4b\x7a\x99\x45\x8c\xbd\x7d\xbb\xd9\x65\x74\xe9\x79\x31\x00\x66\xe2\xfc\x64\x17\x97\x4b\xef\xb6\xcd\x44\x01\x94\x1c\xb5\x2c\x0b\x49\xf5\xcf\x87\xc7\x53\xb2\x16\x4f\xa9\x4c\xe7\x98\x0e\x00\x0d\x83\xd6\xe6\xe3\x73\xeb\xb9\xdf\x77\x85\x99\x2e\xb5\x96\x8f\x08\x1d\xee\x79\x53\xbf\xf7\xaa\xdc\xc2\x22\x00\x8e\xce\x61\x3f\x6e\xfe\x92\xdc\x5a\x4e\x16\x5a\x1d\x1a\xe7\x49\xc1\x71\x00\x13\x1c\x2d\x52\x38\x16\xa7\xc6\xd0\xd1\xdb\x79\xd8\xc1\xc3\xc1\xbc\x62\x9f\x65\x67\x98\x4a\xba\x8f\x91\xf1\x1f\x85\x83\xba\xee\x5a\x09\x95\x74\xca\xea\x99\xd1\x13\x7d\xe1\x51\xe9\x55\xf2\x6f\x2f\x70\x30\x4b\xd6\x6e\x38\xe7\xce\xfd\x11\x84\x72\x22\xb7\x98\x4a\x6b\x0c\x4c\xf3\x35\x07\xa7\x2b\xfd\xd4\xf0\xa3\x98\x27\x59\x67\x76\x26\x4d\x51\x07\xb4\x2f\x73\xf4\xa8\x8a\x56\x07\x11\xc8\xa0\x3e\xb2\x38\xa1\x79\xb1\xaa\xa0\x6b\x92\x2f\x0f\x87\x6d\x08\x45\x62\x6b\x53\xe7\x1a\x44\xe4\xf3\xa6\x97\x77\x89\x31\xf2\xe3\x4d\xec\xff\xda\xb1\xe2\x90\x5c\x7a\x48\x88\xc4\xa4\xb6\xd8\xd4\xed\x8e\x8a\x30\x9c\x95\x1e\x24\x88\xdd\x31\x14\xdc\xf5\x6c\x62\x2e\xc8\x30\xa0\x6a\xaf\x20\x24\x8e\x59\x2b\x73\x5c\x73\xc6\xd5\xeb\xbf\x40\xa6\x53\xf2\x3f\x2d\x48\xb3\x0b\x83\xef\xd6\xfd\x06\x14\x2a\xf6\x4a\xa2\x38\x06\x85\x11\xd5\xdc\xcd\x68\xde\xcb\xca\x9b\x4a\xf7\x68\xb1\x63\x7b\xc1\x56\xdb\x20\x8b\xb5\x8d\x56\x3f\x48\x3f\xd5\x01\x84\x52\xdb\x8d\xa9\x50\x63\x90\xaf\x8e\xe4\xac\xd7\xe4\xa5\x1e\x3a\x79\xf8\x71\x61\xa8\xd0\xfe\xb2\xcf\x16\x4c\xfa\x18\x3b\x3b\x7b\x23\xfd\xfc\xd2\x12\x07\xc7\x25\xa5\x6f\x33\xe5\x18\xb6\x04\x51\x17\x79\x3e\x9f\x5b\x5c\x32\x55\x5f\xbc\x08\xb9\x14\x21\x62\x1d\xe7\xd9\x50\xed\xe2\x47\xad\x95\x0e\xe4\x35\xc0\xdc\x87\x52\xaa\x2e\x31\x92\x00\x36\xd6\x4f\xc4\xcc\xfe\x74\x8f\x74\xe2\x91\xef\x16\xfc\x35\x65\x0b\x4b\x96\x21\xc3\xc9\x0e\xdf\xb8\x64\x50\x20\xbd\x45\x0b\x26\x4d\x13\x8c\x66\x73\x88\x64\x56\x80\x8a\xbf\xdf\x82\x75\xd3\x66\x2a\x07\x46\xaf\x98\x78\xfe\x9e\x01\x36\xd5\x4d\x63\x2a\x39\x7f\xb7\xd7\x68\x73\x73\xd2\xfd\x18\x73\xc9\xbc\x5d\x82\x35\xbb\xce\x96\x81\xf4\xbd\xed\xd1\xba\xcb\xd3\x1b\x07\x14\x82\xf0\xd4\x61\xcf\x53\xe3\xa2\x63\x70\x18\xbf\xf4\xde\x7f\xc6\x70\x2f\xb6\x3b\x46\xc5\x2c\xca\x2c\xe5\xd9\xa2\x20\x5a\x8e\x9d\x04\x8e\x7d\xe6\xa4\xed\x9d\x41\x38\x64\xba\x14\x3a\x21\x55\x52\x3f\x63\x6b\x10\xe5\x2c\x16\x02\x2a\x7e\x2d\x94\x6a\x5c\x33\x32\x55\x23\xfb\xff\xb9\xba\xb2\x34\xc5\x75\x25\xbd\x17\x5e\xea\xe5\x6e\x4a\x1e\xc0\x4e\x6c\xcb\xc7\x03\x14\xb9\xfa\xd6\x3f\x84\x4c\xf5\xed\xfe\x0e\x82\x24\x29\x12\xac\x50\x0c\xff\xf0\xc5\x01\x1a\x7d\x65\x85\x4c\x00\xe9\xcd\xaf\x80\x00\x0d\xfa\xf7\x65\xb9\xc6\x05\x30\x5b\xf2\xf6\xad\x3d\x96\xb8\x96\xe2\x6c\xe2\x3c\xda\x4e\x74\xfa\xc4\x07\x7e\xc4\x93\x68\x04\xcf\xd1\x3d\xf9\x1f\xc0\xb5\xdc\xdb\x10\xa1\x15\xa2\x90\x0a\x7b\x53\xb4\x54\xb0\xa9\x25\xfb\x45\x53\xe0\x80\xf2\xb7\x17\xb0\x94\x99\xf2\x54\x4d\x7a\x5f\x29\x6a\xf4\x0e\x26\x17\xee\x97\xad\x55\x75\x14\xe2\x60\x5c\x5a\x7d\x9d\x61\xe7\xb3\x0a\x88\x48\xcb\x21\x7e\x94\x4d\x4e\xb5\x4f\xd0\xd4\x19\x70\x6a\x95\xdb\xa4\xb6\x1d\xab\x7f\x11\x0e\x00\xc9\x8b\xdd\x84\x21\x26\x71\x70\xaa\x34\x15\xc6\x1b\x7c\xe2\x2e\xa2\xb9\x99\x80\x7e\x55\x62\x73\xcd\x59\xc6\x2d\xac\x3e\xfb\x52\x40\x5a\xe1\x00\x5f\x2e\x23\xcf\xc2\x92\x73\x9f\xd1\x74\x55\x83\x2d\x2a\x1d\xe0\x88\x79\x7d\xb8\xb7\xb4\xc5\xa4\x79\x1b\x0d\x74\x51\x65\xa2\x1a\xa8\x24\xa8\x86\xa4\x0a\x59\xaf\xc6\xc4\x7a\x5a\x13\xc0\xb8\x7a\x5d\x27\x6d\x78\x4d\x80\xdc\xef\xd6\xfc\xaa\x4b\x34\x82\x91\x9a\x34\xe3\x86\x61\x46\xf8\x05\xe2\x0a\xd0\x59\xcf\x02\x5b\xbb\x99\x89\x71\x17\x56\xea\xc1\x32\xc7\xb0\xf5\xd4\x04\xd6\xfd\xe8\x69\x6c\xb6\x68\x1b\xff\xf8\xb8\x00\x5a\xb9\x02\xdd\xa1\xa1\x27\xe2\x08\x7f\x34\xcf\x76\xff\x85\xa7\x98\xb4\x29\x1d\x46\xd9\x97\x37\xb2\xa9\x7c\x20\xb3\x7a\x73\x49\x1d\x79\xb5\x9f\x19\x7d\xfa\x40\xe6\x44\xea\x7a\x4f\x7f\x75\xa0\xfe\x3d\x2a\x00\xb6\x64\xed\x15\xb2\x57\xc9\x02\xf2\xd1\xc9\xef\x25\x38\xb8\xdd\x68\xb4\xbe\xfd\xba\xb6\x00\x9f\x43\x79\x3c\x0a\x6e\x34\x09\xe2\x34\xdd\x04\xb5\x4c\xfb\x99\x02\xb4\xd6\x7c\x1e\x39\x1a\x40\xbf\xbf\xd1\xaf\xdd\x02\xa2\xea\x4e\xac\x9c\x5b\xa2\x0d\xaf\x73\xd3\xcd\xe8\x77\xaf\xc0\x70\x61\x12\x38\x19\xb5\x5d\x31\xa9\x99\x1e\x55\x1f\xd1\x65\x86\x5c\xab\xcc\x0c\x21\x02\x15\x13\xde\xa3\x5f\x65\x6e\xae\xd8\xf4\xa5\x3f\xaf\xcb\xad\x3e\x02\x2d\xe2\xcd\x6c\xea\x52\x63\xc6\x20\x38\x5a\x7c\x67\x24\x5c\x59\x57\x0e\xda\x42\x65\xfb\xde\x42\xfa\x47\x5c\x71\x68\xe7\xc9\x01\x7a\xac\xf9\x46\x49\xb8\xfd\xca\x73\xbf\x05\x16\x09\x76\x32\xea\x90\xcc\xb0\x70\x9b\x54\x22\x94\xf4\x15\xcd\xdb\x53\x47\x93\xc3\x0a\xb5\x11\x74\x1a\x95\x5c\x2a\xc4\x83\xfa\xc5\x6d\xc1\xa1\xfe\x09\x8f\xbe\x67\x09\x4e\xb0\xb7\xa6\x73\xc6\x76\xf9\x8b\xf7\x88\xa6\x14\xfd\x1e\xcc\x6c\x2a\xd1\x14\x9a\x41\x24\xba\xa9\xc4\xbe\x49\xe0\x23\xb2\x55\x1e\x42\x02\x1e\x4f\x7d\x53\xfd\xb5\x49\xfe\xd4\x35\x92\x6c\xdb\x17\xa2\xe5\xfe\xea\x3b\xdb\x0d\x96\xf4\xc7\x85\x16\x34\x3d\x2f\x67\xe7\xb4\x3c\x5d\x41\x55\x46\xc7\xf1\xa9\x03\xb8\xb1\x01\xbe\x66\x64\xa4\xa9\x02\x0d\x80\x92\x3a\xc4\xb0\xa9\x51\xe1\xc8\x4b\x50\xb1\x4b\xb0\x35\x2f\xa7\xff\x1b\xce\xd5\x25\x32\x18\x49\xb1\xb7\x97\x26\x64\xa9\xa9\x30\x18\xf5\x64\xee\x6d\x2f\xbf\x12\x52\x50\x3d\x05\x71\x47\xa7\x1e\x29\xb5\xbe\x00\xda\xfa\x51\x02\xb5\xcf\xc4\x7a\x43\x5d\x72\x23\x9f\x84\xfb\xb8\xd4\x51\x75\xc0\x52\xd6\x5f\xf6\x45\x8c\x2c\xc2\x40\x19\x07\xed\x41\x70\xa9\x87\x3d\xb4\x6b\x43\x8c\x71\xea\x3d\x01\x0e\xde\xc1\x94\xaa\x23\xcb\x94\x42\x77\xb2\x1c\x50\x25\x4a\x58\xb9\xf4\x0c\xb6\xd5\x0f\xf7\x87\xcb\xfd\x64\x60\x30\x44\xfe\xcf\xf5\x8a\x41\xd6\x57\xc5\xa1\xf4\x70\x24\xa0\x08\x42\x1b\xa0\x89\xc7\xe4\xe6\xe8\x03\x2f\xa7\x3c\xc7\x20\x62\xbb\x1b\xc4\xdc\xd7\xad\x1a\x1c\xac\x67\xc4\x91\x7d\x0d\xdb\xb3\x1d\xe3\x08\x2b\xe0\x3d\x94\xc0\x0f\x51\x2b\x74\x1a\x66\x97\x3a\xad\xb7\xfa\x57\x49\x0b\xce\x2a\x22\x08\x5b\x38\xf5\xce\x61\xbc\x11\xd8\xe4\x50\x02\xe3\xc5\x57\xb2\xa4\x29\x62\x0c\xfe\xea\xfb\xe4\x28\xd4\x3b\x48\x2b\x2f\xdf\x28\x43\x78\xa3\x7e\xe4\x1e\x3d\x4c\x52\xbf\xaf\x0b\x72\xd2\xcc\x23\x8a\x8b\x5f\x0c\x97\xd4\x0a\xe0\x25\xc8\x93\xa2\x54\xf9\xda\xcf\x07\x1b\xf8\xd0\xd2\xbd\x5a\x40\x21\x93\x0d\x62\x9b\x35\xb5\xd6\xb2\x0d\x2b\xd2\x68\xaf\x72\x0b\xbb\x58\x35\xe5\x3b\xbe\xd2\xc5\x4b\x47\xfb\xd2\x79\xd8\x6b\x7f\x6f\x8e\x5e\x12\xca\xca\x9c\x62\xe4\x17\xec\x9e\xb0\xbf\xf5\xb9\x55\x51\x90\x4c\x92\xca\x21\x90\xef\x12\xd4\x5c\x95\x10\xbd\xbf\x21\x45\xf2\x96\x73\xbe\x44\x58\xc3\xa6\x16\x72\xee\xd4\x04\x80\xcb\x8f\x0a\x42\x31\x5e\xf7\xdb\xb7\xb7\xfb\x35\x4f\x8e\x91\xf9\x38\x7f\xd1\x2c\x70\xa7\x0d\x81\xbb\xb1\xc5\x7c\xb7\x24\xa8\x36\x59\x1f\xac\x33\xd1\x73\xc6\x02\x3c\x49\xc8\x4d\xc8\xa5\xd9\xc1\x6d\x0b\xf0\xc9\x23\x84\x2e\xa0\xcb\x8f\xf9\x4c\x5c\x7a\x8f\x73\x0f\xd9\x0d\x57\x89\xbd\x26\xdc\xb7\x6f\x8c\xe6\x78\x79\x99\xc7\xa9\xf6\x3b\x86\x33\xe5\x12\xd4\x4c\x39\xbf\xfb\x84\x53\x11\x40\x77\x93\xbe\xea\x64\x96\x38\xa2\x7a\x8f\xa6\x08\xce\xbb\x11\xa8\x5c\xab\xe0\xa4\x1c\xa3\x3a\x9c\x6c\x30\x72\xf1\x5a\x79\x95\x49\xbf\x6f\x59\x4c\x6d\x00\x7e\x46\x07\x23\x87\xd2\xbc\x54\x3b\x28\xf0\x79\x77\x8b\x95\xb9\xc5\xca\x9f\x67\x00\xf1\x95\xd4\xa9\x83\x7d\xfb\x9f\x9d\x4a\xa4\xef\x25\x48\x11\x28\xe7\x25\xf6\x24\x23\xde\x26\x5f\xcc\xe5\x63\x5d\xdd\x54\x39\xc2\x6f\x1c\xc4\xc5\xf0\x05\x01\x2f\x62\xab\x1d\x2c\x5e\xe5\x5b\xb6\x32\xfa\x91\xb3\xfa\xa1\x25\x1a\x59\xa7\x49\x43\x70\xf2\x7a\x14\x6f\xcf\x29\x5c\x92\x09\x5b\xc6\x6d\x8c\x94\x30\x12\xd9\x2a\xf2\xa6\xe4\x37\xad\xc1\xc6\x22\x8d\xb9\x97\x61\xa5\x17\x5e\xe9\x52\x09\x88\x51\x5b\x77\xfb\x9e\x98\xf0\x27\xc0\xd1\x8b\xfa\x37\x7d\xb5\x3c\x17\xe4\x36\xed\x44\x10\x3c\x91\x5c\x92\x4f\x80\xf3\xd8\x10\xc4\xaa\xc0\x6d\x00\x2e\xe9\x90\x4c\x8c\x9d\x99\xe5\xe3\x9e\x00\x62\x70\x7f\x83\x1a\xc8\x2e\x17\x47\xda\x5f\x9d\x84\x83\x0d\xa7\x8d\x9c\x6c\xec\x7d\x1f\x0d\x5d\xb8\x13\x61\xcf\xab\x32\x6b\xda\x61\xae\xb0\xc8\x66\x1e\x8e\x87\xad\xe8\x1c\x96\x17\xba\xc2\xcb\xe5\xac\x76\xf6\x76\x5e\x80\x55\x2b\x32\x34\xb5\xf7\x31\x55\x8c\x1d\xa2\x61\x04\xca\x68\x8c\x0f\x94\xfe\xad\x40\xae\xf8\x71\xdf\x3e\x6d\x2c\x59\x12\xb8\xc1\x92\x68\x38\xcf\x55\x42\x4c\x9a\xc4\x69\xbe\xa2\x4b\x2f\x34\x9c\x61\xa9\x1b\x2d\x87\x34\x29\x6c\x9a\x05\xa9\x0f\xe9\x93\x34\x9d\x33\x86\x0c\xee\x9b\x0a\xa0\xc7\x39\xd6\x06\x99\xf7\xba\xcc\x9c\xb5\xaf\x8f\x5c\x2e\x0f\x8f\x4f\xda\x18\x9c\x96\x65\x76\x3f\x63\xdc\xcc\x53\xdb\x57\xf9\x5d\xd1\xc1\x53\xb1\x16\xfa\x72\x92\x2f\x8c\x6c\x40\xd3\x35\x37\x35\xca\xb7\x13\x57\x1b\x8d\xdc\x74\x05\xf1\x50\xf5\xe1\x7e\x84\xcd\x99\x98\xa5\x96\xf2\xc3\xdb\x5a\x4a\xb9\xeb\x77\xb8\x94\xc3\x3c\x6d\x82\x03\x62\xcb\xdf\xcf\x90\x49\x9a\x47\x7b\x71\xcd\xde\x67\xcf\xcf\x92\x76\x35\xe8\x9e\x8b\xf6\x4f\x39\xcc\xd5\x08\x86\xd1\x69\xb5\x7f\x8e\x6a\x31\x8e\xf5\x52\xd7\x4c\x1e\x7b\x97\xb2\x91\x87\x71\xee\x6a\x2a\x7b\x87\x54\x9c\x4e\x54\x28\xaa\xda\xe4\x55\xbd\xb6\x9b\x9c\x87\x97\x36\xde\xff\x7d\x0c\xb3\xd5\x3b\x00\xcf\x46\xea\x1a\x31\xd7\x7d\xf6\x28\x46\x93\x06\x78\xda\xd3\xd2\xde\x7a\xd4\x1a\x9f\xb2\x50\x56\x2b\xbb\xf7\x15\xb9\x71\x86\x03\x4d\x6b\xfa\x91\xc1\x1c\xbf\xba\x2a\xbf\xf2\x8d\xe8\xbf\xe6\x0a\x3f\xd4\xe1\xd0\x5a\x6e\x99\xbe\x5a\x35\x9f\x23\xc7\x4d\xc7\xfb\x64\x36\x49\xb3\x55\xbc\x0d\x26\x64\xee\xd0\x8e\xdb\x31\x98\x28\xd9\x90\x75\xdd\x04\xa0\xa5\x41\x8b\x42\x90\x60\x36\xf5\x0c\x86\xbf\xe6\x7f\x37\x07\x5f\x5e\xb9\x54\xc7\x0d\x6d\xfd\x81\x43\xe2\x72\x53\x2e\x8c\x97\x9d\xd7\xf0\xd6\x8c\x42\x60\x1f\xa5\x6a\xc3\x97\x4f\xcf\xa9\xbe\x79\xcf\x5a\x52\x83\x22\xcc\x0a\x76\xa8\xfb\xf0\x0a\xc5\xeb\x45\x8b\x2d\x94\xd8\xff\x9f\x23\xf9\x7f\x92\x92\xd3\xe0\x9a\xaa\x9a\xda\x96\x40\xdd\x87\xbe\xe6\x16\xa0\x01\x78\x6a\x54\xb1\x23\x66\x52\xca\x46\xaf\x95\x12\x4f\xaa\xf0\xb4\x82\x08\x95\xd0\x28\xb8\x09\x8b\x96\x85\xd1\x5e\xa5\x4a\xed\x87\xe0\x5e\xda\xda\x90\x3e\x54\xe5\x0e\xcd\xb7\xb2\x35\xb3\x12\xd9\xae\x9b\x62\x04\x0d\x5d\xb2\x5d\xb0\xd7\xfc\x34\xfe\x55\x7d\x36\x95\x75\xd7\x0c\xca\xd0\x43\xd2\x2f\xbc\xe6\x00\x56\x66\xbf\x20\xe0\x5a\x30\x62\x48\x9f\xda\xfc\x78\xc0\x12\x51\xfd\x29\x5a\xc2\xba\x90\x99\x5e\xa6\x4d\xee\xe5\x80\x69\xbc\x37\x41\xa7\xc2\x09\xe5\x0c\x60\x8d\x0a\xb3\xe3\x97\xeb\xe6\xf0\xb6\xd5\x52\x1c\xc8\x73\x3f\x3a\x35\x51\xd3\xf6\xbd\x5b\x6b\xa4\xad\xa8\xad\x82\x84\xc9\x69\x65\x15\xe4\x6b\xd2\x6e\x69\x48\x9b\xdd\xa8\xca\x39\x04\x46\xd4\x64\x03\x9c\x76\xee\x0c\xb6\xd3\xf0\xf3\x73\xdd\x15\xdf\xce\xe5\xd2\xf0\x38\x46\xe6\xa6\xfb\x1b\x2d\x6b\x56\x34\x6f\x6e\x51\x5e\x4c\x6f\x9d\x9b\x1c\x15\xb8\x73\x12\x79\xe3\x8d\x35\xcd\xb4\xb2\xb9\xbe\x55\x84\xc1\x91\x4b\x25\xe5\x66\xc8\x1a\x67\x26\xdc\x54\x9d\x0e\xc2\x23\x56\x07\xa6\x3b\xd3\x20\x58\xf2\x1a\xe2\x80\x4f\xa3\x02\xd1\xe9\x1b\x8b\xf3\x39\xfd\x1b\x82\xb4\x33\x9f\xd3\x5b\xda\xff\xc6\x22\x5d\x57\xc3\x97\x55\xe9\xe4\x73\x7a\xd2\x1e\x9d\xaa\x25\xcd\x53\xf8\xf9\x67\x8f\xff\xfe\x28\xa2\xcb\x31\xd6\xc5\x34\xcd\x26\x16\x22\xd2\x3c\xae\x9c\x23\xd3\x44\x45\xaa\xe8\x51\x2e\x8c\x6e\x18\x6f\x55\x21\xd6\x60\xb4\x90\x80\x05\x7a\xa1\x9a\xc0\x7d\x9b\xd4\x54\x49\x1f\x27\x8f\x54\x23\xaf\x26\x0d\xf6\xf9\x8e\xc1\xe3\xf6\x31\x91\x87\xc4\x5c\x23\x99\x60\xea\xea\x0b\xc7\x72\xf9\x21\xf2\x55\x63\x58\xe7\x32\xb9\x4e\x43\x1d\xc2\xf8\x0d\x36\x3d\x1c\x51\x5e\x42\xac\x05\x6b\x4f\x2d\x11\x5b\xb6\x71\x6c\xa0\x39\xa5\xba\x63\x36\x86\xe6\xe1\x5a\x5e\x91\x20\x98\xf7\x07\x80\x7a\x5b\x88\x2b\x74\xbf\x72\xc9\xb5\xd1\xed\x62\x07\xa5\x65\x97\xe4\x9c\xa8\xee\x53\x52\xc9\xeb\x60\xd5\x25\x75\x97\x16\xfe\x24\x2a\x3b\xf9\xe3\x01\x60\x5d\x46\x33\x1f\xfa\x47\x35\xd5\x7a\xf5\xd3\x97\xee\x5c\x39\x7a\x0d\xc7\x2a\x5f\xf9\xea\xcb\xed\x16\x44\xbf\x68\x9e\xb0\x64\x8e\x6c\x2d\xd4\x99\xd7\x3c\x7d\x38\x9a\xba\xb1\x13\xc7\xdf\xea\x17\xef\x31\x81\x3f\x0c\x00\x83\x8e\x6c\x95\xc3\x84\xae\xae\xd0\x8d\xbd\x10\x07\xec\x9d\x85\xa3\xe1\xf1\x09\xae\x97\x82\xfd\x34\xda\x61\x6e\xea\xef\x47\xb6\x16\xc3\x4f\xb6\xf3\xc4\xcf\x38\x7b\x02\x3c\x7e\x95\xca\x8c\x4a\x73\x15\xb0\x18\xaa\x82\x51\x09\x4f\x4c\xd9\x06\xff\xfa\x00\xb4\x4c\x5e\x83\xf4\xd9\x7b\xac\x99\x2a\x8b\x79\x3b\x9a\xcd\x9a\xd4\xe5\x38\x47\x77\x85\xd3\xaf\x20\xdf\x6a\x88\x30\x85\xed\xde\x1d\xa8\xc3\x41\x73\xf5\xfb\x18\x0e\x1a\x6b\xed\xf8\x83\xe9\xec\x5e\xf0\x3d\x3c\xba\x5a\x20\x96\x63\xe4\x85\xe6\x4b\x5c\x9c\x55\x2d\x13\x50\x8a\xda\xc8\x09\x3d\x03\x55\x30\x53\xf8\x90\x0c\x62\x61\x35\x25\x3d\x72\xda\x97\x3a\xcf\x12\x42\x46\xa1\x01\xe9\x89\xe3\xbe\xb4\x92\x4a\xba\x94\xf8\x64\xbf\x96\x98\x4c\xa7\x80\xb0\x38\xbd\x7e\x4b\xba\xe9\x1d\x22\x0d\xef\x5e\xe4\xb7\x12\xd8\x9e\xb5\x4b\x54\xc5\x57\xa2\xcd\x97\xab\x06\xab\xfc\x1b\x7c\xc6\xfe\x63\xfc\x74\x78\xa6\x7b\x94\x78\x26\x76\x36\x2a\x04\x71\x45\x89\xb4\x71\x4d\xba\x9f\x0d\x74\x99\x16\xaf\x47\x0f\x2b\x92\x89\xdc\xa1\x50\x42\x61\x8b\x9b\x81\xba\x77\x6b\x71\x2d\x34\x7a\xd9\xab\xc4\xdf\xee\x1e\x77\xab\x0e\x3f\x28\xdf\xfa\xe2\xb9\xa7\x5d\xb7\x8c\x1c\x2e\xdc\xe8\x80\x8f\x67\xff\x77\xff\x3b\xff\x48\xcc\x65\xb5\xff\x1b\xe6\x65\x51\xa2\x57\x60\xec\xca\x3a\xa1\xd3\x1e\x68\x05\x74\xa2\x48\xe8\x47\x43\xb6\x45\x06\x76\x33\x4e\xf3\x08\xb3\xcf\x3e\xbf\x4c\x58\x46\x02\xab\x68\x9b\x03\x9b\x53\x2a\xa5\xcf\xe2\x2a\x12\x34\x31\xb3\x80\x5a\xf4\x63\x71\x81\xef\x41\x0f\x90\x36\xe0\xcd\x0a\xcc\xba\x74\x2d\x43\x7d\x13\x83\xce\xff\xcc\xc3\x46\x3f\x48\xe2\x6c\x86\x60\x7f\x0d\x20\xac\x84\x6f\x06\x5a\xc2\x0d\x17\x57\xe4\x2e\x63\xb6\xa0\xff\xa4\x98\x58\xf9\xca\x03\xfa\xac\x8d\xb6\x49\xd9\x2e\xa9\xfb\x72\x2d\xdb\xd8\x23\x69\x28\x37\xe2\x87\x92\xcd\x10\x9c\xb1\x09\xd1\x33\xf9\x54\x14\xd3\x56\xe8\xd0\x7f\x04\xa5\xa0\x65\xad\xbc\x6c\xea\xc3\x05\x61\xfc\xeb\x46\xe6\x3e\xa8\xca\xd9\xad\x36\x40\xf7\xf3\xc4\xaf\x73\x37\x45\xe4\x20\x7a\xba\x7c\xa9\x2a\x0e\xca\x39\x6c\xa7\x8d\x89\xd9\x6e\xf2\x3c\xc1\x8c\x3b\xe4\x64\x91\xf9\xad\xf1\x85\xe5\xf3\x90\x6b\x49\x89\x22\x5e\x34\x55\x33\xbb\x7c\x3a\xaa\x39\xdd\x1e\xd4\x89\xf9\x8e\x17\xf9\x21\xfd\xbd\xf6\x5c\x10\x45\x53\xa5\x9f\x1f\x1a\x63\xdc\xbe\xd9\x7a\x0c\x35\x25\x63\xe1\x5c\xe2\x31\x29\xd5\xba\xc6\x7e\x3e\x2c\x7d\x67\xea\xd5\x4e\xc1\x48\xdf\xdf\xd7\x4b\x29\x93\x28\x1b\xfa\x02\xaf\xba\xb3\xbc\xe9\xe8\xec\xb8\x57\x17\x33\xf7\x4b\xdd\x1a\x87\x6b\x05\xc2\x03\xc5\x63\x23\x90\x4c\x11\xd5\x8b\xfe\xaa\x6f\xdd\x69\x09\xf4\x8b\xe3\x6b\x3e\x86\x8b\x1c\xcc\x41\xfb\x8d\x70\xd1\xad\x37\x76\x20\xc9\x2b\x90\x23\xad\xdd\x22\xa0\x89\x3b\xdf\x7a\x98\x72\xca\xe4\x53\x4b\x26\x31\x31\x72\x97\xeb\xf6\x29\xc6\x8c\x54\xa6\x83\x3a\xb6\x55\x22\xa8\x6d\xb3\xae\xcd\x55\x76\x11\x0f\x4a\xfb\x8f\x84\xf8\x85\x40\x38\xae\x48\xa7\xe7\x37\xf0\xab\xb6\xfd\xda\x3e\x44\xc1\x4b\x14\x61\x30\x79\x3a\xa7\xda\x47\x9f\xab\x61\x1d\x81\x19\xba\xae\xb4\xf0\xc1\xb3\xe8\x7e\x34\xfc\x9c\xec\xd3\x7f\x40\x41\x64\x8e\x31\xf1\x8a\x0b\x26\x52\x3c\xb4\x97\x4e\xa7\x76\x5b\xff\x73\xda\xa3\x05\xea\x49\x39\x86\xee\x9c\x9d\x74\x8e\x30\x71\x04\xcf\xda\x03\xf3\x39\x9b\x98\xa4\x6a\x48\x45\xad\xf0\x3f\x63\x9d\x58\xcd\x3e\x01\xe7\x74\xd9\xff\x1f\x76\x2d\xdf\xcc\x66\x72\xee\x0e\x6c\xb6\x22\x92\xd0\x82\x37\x9a\x44\xf4\x31\xf9\xc5\x77\x58\x52\x4d\x09\xe0\x9d\xc6\x89\x80\x9c\xa8\x19\x23\xa5\x40\x70\xe9\x9e\x71\x5e\xe0\x57\x55\x02\x4f\xca\x65\xee\xd1\xcc\x80\x3f\xde\x7e\x0b\x9f\xbc\xa8\x11\xc6\xdf\x54\x25\xff\x89\x58\xd7\x58\x0e\x00\x93\xea\xc9\x32\xbc\x93\x69\x15\x12\x10\xf3\x29\xcb\x7c\x39\xc0\x27\xb5\x5c\xad\xa6\xf7\x3e\x7b\x79\xe5\xc7\x66\x78\x8d\x17\xc0\xc8\xde\xc8\x51\x58\x5b\x22\x32\x76\x4a\x95\x2b\xc2\x1d\x7c\x9b\x7b\x1d\x93\x3d\x9c\xba\x35\xa7\xf4\xb7\x44\x77\x6e\x00\xa2\x7c\x07\xd6\xa6\xb1\x16\x6f\x09\xac\xd2\x1f\x98\x68\xd1\x93\xee\x76\x8e\x7a\xa9\x35\x08\x2e\x97\x61\xe0\x09\xa0\x19\x95\xb7\x62\xcd\xdf\xe4\xb7\x59\x9b\x87\xe7\x22\xd6\xd5\xcd\xec\xa7\x8a\x67\x2a\x1f\xb9\x91\x6c\x30\x4d\xb4\xd5\x86\x6b\xa5\xc0\xb5\x6a\x53\x98\xa4\xb9\x97\x4b\x4f\xe7\x69\x0d\x32\x72\x90\x68\xed\x53\x1e\x03\x8d\x2b\xc1\x17\x1e\x0e\x2a\xef\xda\x18\x9e\xf5\xa9\x5c\xd6\xb9\x9b\x36\x6b\xd1\x56\xfd\x3d\x16\x3e\xb8\x2d\x5f\xb8\xde\x4d\x9a\xfa\xa0\x63\x58\x87\xda\x12\x09\x15\xaa\x2f\x8b\x16\xd7\x3e\x57\xdb\x90\x9a\xd1\x71\x6f\x4a\xd6\x64\x80\xac\xa4\x7f\x13\xa3\x70\x95\xd7\xa0\x65\x79\xdb\x06\xdb\xe6\x66\x77\x2c\x27\xa6\x3a\x83\xe7\x5e\x1a\x9c\xd0\xe1\xeb\x05\xc2\x9b\xdb\xf9\xdc\x04\xc6\xa2\x1a\xb3\x3b\x8e\x5f\xae\x1f\x73\x00\x77\xca\x77\xd5\x9f\x3e\xdf\x25\xe1\x09\x85\x21\x6e\xfe\x72\x30\x7c\x42\x06\x7c\x03\xb4\xfc\x2a\xaf\xa3\x97\xce\xb0\xbf\x89\xfa\x9e\x77\x15\x87\x0f\x0d\xa7\x09\x36\x08\xaf\x6f\xc0\x9d\xa6\x00\x7c\xb7\x97\x6c\x3c\xf8\x5d\x9e\xfd\xf7\xa8\x39\x25\x8c\x75\x59\x17\xf6\x2d\x87\xa9\x6d\x2c\xe5\xf8\x75\x4e\xee\x68\xe6\xcd\x1f\x1b\x27\x42\x97\x34\x74\x07\xd5\x6a\xe1\x5e\x1a\x19\x00\xd6\xce\x57\x7b\xf9\x37\xa2\x51\x1b\xc0\x85\x56\x4e\x35\xed\x64\x7c\xb1\x8c\x21\x3d\x10\x22\x40\x4b\x7b\xe6\x2b\x65\x08\x51\xa2\x26\x06\x23\x65\xaf\x94\x42\xdb\xed\xfa\x3a\x69\x4c\xe4\xb3\xd9\xbd\x3e\xea\x2e\x1d\x1d\x98\x7d\xd8\xd9\x9d\x26\x84\xdc\x68\x9d\x21\xd8\x12\x41\xe4\x43\xc4\x70\xdd\xa8\x70\xab\x9d\x75\x12\x53\x77\xae\x4e\x45\x4b\x12\xe2\x1d\x51\xbe\x6b\xde\xe4\x92\x31\xec\x9c\x19\x96\xf3\xad\x6e\x8e\x63\x10\x8f\x20\x5c\x00\xd8\x05\x85\x79\x0d\x37\x58\xf5\x39\xa4\x64\x8e\x6a\xe3\x92\x9d\xaa\xa5\xbe\x60\xcc\x84\x05\xe8\xfe\x15\x37\x1e\x29\x6f\x2f\x42\x74\x9b\xfd\xd7\xef\x61\x63\x9a\xe4\x6b\x65\xb2\x95\xb4\x24\x6e\xff\xbb\x6c\x2f\xab\x40\x21\x55\x1c\x32\x58\x01\x6e\x3c\x51\xbf\x8a\xff\x24\xa2\xb4\x39\x65\x6a\x85\x6e\x4a\xb0\x67\xa8\x1b\xbb\x83\x2e\x71\x26\x00\x23\x2a\x9f\x15\xf3\x4d\x7e\xcc\xcf\xde\x34\xeb\x9f\xfc\xc9\xb6\x53\x7a\xc1\x3a\xb6\xb9\x5c\x61\xb1\x61\x6f\xd6\xd8\x39\xeb\xe4\x59\x92\x3b\x5a\x41\x79\x48\x6a\x10\xf7\x34\xfb\x65\x18\x5d\xf5\xcc\xe9\x62\x9d\x96\x2f\xc5\x43\x4d\x0f\xd1\x4b\x26\xfb\x98\x2f\xa3\x55\x69\x21\xe9\xa0\x00\x39\x86\x7d\xac\x90\x85\xe3\x89\xb0\x19\xac\x6a\xe5\xcd\x9e\x95\xb3\xab\x31\xf7\xe0\xcc\x80\x52\x27\x34\x09\x8f\xd2\xae\x1e\x2f\xad\xee\x38\x95\x5c\x34\xec\x5a\xf3\xf2\x63\x8f\x2b\x1c\x0f\x4e\x92\x39\x66\x8f\x16\x6b\xda\xba\x90\x74\x68\x2a\x91\xa3\x99\x84\xe9\x9a\xc2\x12\x4a\xc2\xf2\x80\x23\xc9\xf3\x3b\x91\xd5\xa0\xb2\xcc\x06\x51\xae\x9b\x4b\x46\x02\xbe\xf4\xe6\x6b\x99\x3e\xb9\xd5\x52\xe5\x8d\xfa\x81\x68\xd6\x1b\x31\xcf\xea\x54\x22\xc1\xb6\xef\x55\x89\x63\xfc\x46\x5e\xc0\x0f\xf1\x22\xc3\x40\x4c\xc7\xc7\xe5\xa6\x54\x2a\xb7\x53\xa3\xf1\x63\xb3\x11\x6c\xb8\x92\x2a\x3b\x3a\x34\x68\xc2\xc6\x2c\xf1\x8e\xd7\x7b\xcd\xfa\x39\x50\x55\x66\x65\x8e\x96\xd3\xf4\xa3\xd4\x8d\xce\xb8\x94\xcb\x3f\x45\x00\xa2\xda\x68\xb4\xfb\xc9\x38\x7e\x79\xdc\xd4\xbf\xa5\xc0\x78\x13\xdc\x11\x6e\x97\x3c\x1c\x72\x18\x4c\x46\xed\x66\x0c\x7e\x00\x80\x25\xda\xe5\x4b\xfe\x5c\x43\x47\x9a\xa4\xaf\x98\x14\xf0\x44\xf3\x5a\x4a\xeb\x90\xe9\xb8\xac\x46\xdf\x3e\xb8\x78\xb6\xf0\x36\x1b\xa7\x54\xb1\x61\x6b\x8f\xba\x25\x49\xbf\x72\x72\x53\xad\xeb\xd4\x52\xdb\x62\x1a\x35\x86\x6e\x3f\x99\x7d\xc1\x40\xa4\x1b\x83\x76\x9b\xba\xff\xe2\x87\x07\x84\xf1\xa7\xb7\xaf\x4b\x10\xfc\x58\xe1\x7d\x1e\xa5\x38\xf0\xc4\x61\x85\x5c\x71\x0c\x5a\xd7\xfe\xbe\x9d\xa3\xc0\x45\xbf\x7d\x23\xcb\x25\x34\x63\x2c\x18\x66\x6c\x10\x1b\x6b\x3e\x01\xca\xc6\xc3\xc5\x60\x6d\x61\xff\x23\xec\x59\x70\x10\x65\xba\x4f\xd6\xa6\x48\x6d\x30\x00\xcf\x2a\x2c\x28\x9c\x63\x72\x6e\x44\x85\x88\x90\x1c\xbc\xb9\x9a\xb8\x7a\x9c\x25\xee\x73\x08\x4b\xfc\x1d\x9c\xbf\x04\x15\xb0\x76\x58\x9b\x20\xfa\xaf\xa9\x7c\x09\xc5\x2f\x49\xc0\xa6\xa9\xfd\x92\x5d\x85\x88\xa6\x60\x71\x99\x23\xba\x06\x6e\xb1\x1b\x79\xd7\xc9\xdf\xea\x2f\x72\x4b\x5e\xef\x0b\xca\x0f\xaa\x84\x18\x54\xf9\x06\x97\x58\xa1\x42\x7f\xb5\xfb\x70\x90\x5b\x8f\xe6\x16\x67\xa9\xaa\x54\x78\xd9\xc7\x75\x75\x80\x6b\xe6\x2c\x06\x0a\xab\xbe\xb8\x73\x40\xe5\x92\x65\xde\x25\x28\x17\x3a\xc4\x10\xe9\xae\x56\x41\x7c\x62\xae\x13\x1d\x8c\xfe\xa2\x13\x88\xa4\x49\xd6\x65\xb2\xc1\xb1\x81\x7e\xd9\x6e\x76\x15\xaa\x82\x80\xeb\xd9\x84\xe4\x16\x81\xf0\x36\xc8\xe9\x75\x20\xa1\x18\x68\x07\xbd\x93\x0c\x05\xc4\x87\x57\x74\x26\xbd\xd5\x9e\x70\xa7\xa5\xf4\xf9\x10\x1b\xe3\x7b\x9f\xf3\x05\xa4\x0c\xa7\xe7\x98\xac\x4d\x01\xd7\xaa\x42\x6a\x8c\xce\x95\xe1\x52\x3e\xf0\x3a\x14\xc4\x68\x07\x45\x62\x95\x41\xc0\x5a\xd1\x64\x38\xe7\x48\x57\xe8\x2e\x68\x6c\x00\x84\xfc\x8d\xc2\xdd\xe6\x40\x94\x57\xe5\x57\xb4\x7d\x55\x65\xab\x87\xa4\xeb\xf5\xe1\x63\x26\xe4\x67\x19\xf6\xa7\x50\x8e\xed\xb6\x52\x8b\xd8\x55\xa7\xcb\xbb\x3e\x0b\x58\xd8\x8a\x4b\x2c\x37\x9a\x48\x71\xaa\xc2\x79\xbf\x45\x77\xa2\xe4\x37\x15\xb5\x5b\x22\x21\x87\x21\x2d\x2d\x38\x3c\x37\xc3\xec\x34\x8e\x00\xe3\xf2\x03\xe3\x8b\x73\xd5\x75\x33\x46\x62\xf3\x17\xf1\xa8\x7c\x5c\xf3\xd2\xeb\x2a\xc6\xee\x54\x4a\x33\x55\x01\xe2\x66\x84\x66\x85\x2d\xcf\xa7\xc7\x68\x55\x04\x8d\x95\xed\x1b\xc1\xb8\x0f\xfc\x40\xe0\x41\xa9\xdd\x77\xfb\x5f\xb8\x30\x45\x4b\x65\xb2\x96\xf1\x05\xa6\x43\xab\x6e\xb6\x40\x87\x8a\x54\xc8\x1a\x31\x9c\xa3\x80\xae\xf5\x42\x8a\xd9\x4a\xc9\x2d\x59\xfd\x42\x62\x2a\x9a\x68\xa8\xbb\x44\x7c\x4b\x9f\x60\x56\x8e\x9e\x99\x8d\x92\x97\x41\x8e\x63\x34\x01\x60\xab\x8a\xeb\x90\x2e\x30\xdc\x1d\x9b\xc0\x54\x18\x61\xae\xb7\xb1\xeb\xaa\xfb\xc9\x3b\x20\x05\xc8\x6a\x34\xdf\x0d\xd8\x67\x25\x5e\xde\x54\x0a\xfc\x4a\xed\x2b\x76\x83\xa2\x75\x74\x74\x74\xc7\x9c\xb9\x52\x00\x3d\x2f\xb8\x4c\xe2\xb0\x82\x46\xb9\xd7\xb0\xcc\x35\x09\x02\xf6\x9c\x94\xec\x3f\xcb\x76\x56\x79\x86\xb4\x1e\xc8\x5b\x2e\xb7\x34\xb8\x34\x7e\x39\x72\x5b\x9a\xa6\x7e\x24\xe3\x9e\xa7\xaf\x06\xcf\x76\xfa\x4d\x13\x55\x03\xc5\xd4\x80\xaa\x4b\xf3\xca\xc3\xb3\x2c\x00\x8d\xbd\x5c\x19\xd9\xdf\x35\xd5\xf1\x65\x01\xb5\x6c\xba\x87\xf1\xce\xa4\xb6\x22\x94\x60\x79\x9f\x5c\xaf\xc8\xb2\xee\xc1\xed\xbd\xf7\x25\x19\xe6\xb6\x81\x95\x83\xd5\x9d\x08\x66\x5c\x9c\x16\x76\x23\x8a\x6c\x67\x45\x55\xeb\x27\x94\x67\x6e\xb5\x7e\xd6\xb5\x5f\x2f\x28\x61\x6f\x2c\xf9\xbf\xad\x6e\x69\xe7\x50\x30\xcc\x48\x06\xbb\xca\x30\x26\x34\xc8\xb3\xf4\x52\x14\xf3\x22\x87\x5d\xa5\xbe\xc4\xa6\x3a\x20\x43\xb5\x8f\xb8\x59\x6d\x8e\xe4\x1e\x24\xe5\x01\xc2\xf2\xa9\x41\x02\xcc\x8d\x54\x2e\x5c\x37\x84\xd3\x0a\xfc\xee\x47\x12\xcf\x04\xde\xe8\x1f\xfe\x15\xbd\xfe\x66\x83\x40\xb7\x96\xe1\xaa\xb9\x5a\x05\xe7\x35\x56\xce\x97\x1b\xad\x25\xb3\x09\x4c\x0d\x32\x43\x35\x31\x6c\x3d\x6f\x2f\x23\x38\x95\x5a\xf8\xcf\xc2\x11\x9a\xf1\x91\xad\xa0\x95\x12\x2b\xc8\x2f\xb6\x01\x5f\xcc\x1d\xbf\x29\xc0\x1d\x8d\x78\x28\x9f\x66\xb4\xaa\x78\x39\x70\xb7\xf4\xf6\x91\xbb\xf0\xb3\x5b\x0f\x9b\xa6\x0a\xbb\xf1\x61\x4b\x20\x84\xb0\x49\x5b\xcc\xb3\xe5\x64\x1e\xbf\x05\x90\xf4\x59\x4b\x63\x52\xce\xe2\x47\xc4\x8b\x42\xa9\x0c\x1d\xeb\xf1\x9a\x0a\xe9\x81\xfe\x56\x65\xcc\x76\x0f\xb2\x5f\x31\x9e\xec\x6b\xad\x87\x5a\xfb\xb8\x76\x16\xcd\x8b\xb0\x66\xe1\x91\xd5\x54\xce\x7f\x16\x99\x97\x2d\x25\xfc\x78\xb2\xbb\x64\x41\x27\x90\xf2\x5f\x70\x1e\xb2\x22\x5d\x7a\x94\x2d\xeb\xb4\xc9\x6d\xc6\x99\xa3\xe8\x09\x1a\xe4\xfd\x18\xd0\xc9\x6e\x12\x26\xf0\x1b\x79\x7d\xd3\xd0\xc7\xd3\x9f\x12\xf1\x46\x51\xea\x9d\x40\x97\x13\xed\x3a\x98\x20\x35\xa7\x07\x3d\x51\xf3\xd8\xa7\x27\xf8\x65\x48\xd5\xd6\xee\x61\x3e\xf5\x7d\xb3\x35\xdc\x08\x64\x0f\xb7\xe2\x8d\xf5\xb6\x5d\xa0\x4a\xe9\x61\xee\x72\xff\x77\x48\x95\x9b\x5c\x0e\xb4\x21\x0e\x17\x1c\x6e\xeb\x45\x31\x01\x9e\xd0\xc6\x6c\x64\x68\x57\xb7\x1b\x5a\xae\xdb\xd8\xbd\x4b\xf1\x9c\x7a\xde\x44\xcf\xaa\x56\x7c\x49\xad\xf9\x0a\x0d\x7a\x6d\x76\x97\x4c\x04\x3b\x73\x80\x79\xf6\x4b\x8e\x43\xa7\x8b\x43\x47\xe2\xdd\x4d\xaf\x4e\x1f\xc4\x1c\x6b\x1b\xb7\x7b\x54\x83\x98\xc0\x5d\x98\x9a\xd9\x61\x4c\xc9\xad\xf4\x4b\xf5\x61\x1d\x36\xd8\x61\x1c\xa2\xde\x38\x27\x3f\xea\xf4\x0b\x72\xfc\x97\xdb\x02\x1f\x50\x54\x3f\x97\x81\x32\x41\xc1\xf8\x4f\xae\xb7\xe7\x6c\xc3\xbb\x33\x94\xa2\x0e\x9c\x43\x2b\xe2\x01\xee\xf0\xd8\xbe\xd1\x9f\x0c\x88\x55\xa7\x5d\x65\xd3\xa5\x23\x7d\xac\x23\xd6\x5f\x2e\xba\xd4\x77\x7c\x68\x68\xba\x9e\x3a\xa6\x20\x87\x2c\xb5\x74\xd0\x3e\x7c\x9a\x81\xf9\x16\xd2\xa8\x83\x2e\xae\xfd\xab\x40\x04\xf8\x4d\xf9\x94\x8e\xaa\xd8\x4c\x77\x71\x8a\x4a\x2a\xce\x43\x4b\xf2\x88\xfa\x87\x30\x53\x4d\x06\x83\xe4\xcb\xe9\x1d\xca\x01\x74\x94\xab\xdd\x2c\x8b\xba\x52\xa6\x39\x26\x4c\xc1\x33\xc4\xdf\xcd\x9f\x06\x29\xc6\x9b\xee\xb1\x09\x13\x42\x91\x22\x6e\x2c\xbb\x2f\x1a\x0c\x62\x12\xc4\xf1\xd2\x06\x7b\x84\x12\x39\xa0\x73\xa6\x84\x47\x57\x77\xb4\x38\x46\x39\x4d\x1e\xea\xbc\xff\xe4\x20\x6c\xfd\x08\x57\x80\x8c\x4f\xd5\xfa\x3e\x2e\xe7\xc5\xb8\xda\x9d\x81\x83\x92\xdc\x7a\x02\x3b\x8f\x8f\x8a\xd7\x8c\x7a\xc5\xb9\x5f\xde\x66\x5d\x8f\x50\xa7\x49\x81\x83\xdf\xc2\x24\x62\xe9\xd6\xe4\x63\x4f\xac\xd2\x98\xb8\x1e\x43\x25\x37\xdd\x4d\xd1\xbf\x83\x60\xa8\x9e\x17\x07\x06\x87\x8e\xb7\x25\x58\x8b\xe2\xe3\x68\xdf\x75\x31\x71\xe8\xa4\x3d\x13\xfe\x84\x15\x52\x90\xac\x20\xd7\x8d\x8d\xce\x42\x44\xd7\x8f\x97\xab\xa7\x49\xf2\x2f\xec\x6e\x41\x67\x0f\xd1\x36\x00\x76\x03\xf4\xd7\x06\x4b\x9a\xd4\x68\xd7\x84\x80\xff\x99\x17\xd6\x9d\x15\x48\x45\xc9\xda\x3d\x1c\xb3\x19\x76\xae\xbc\xd1\xb2\x49\x16\x95\x83\x34\x47\xb9\x5c\xa4\x92\x60\x06\xf5\x58\x27\xbd\x56\x59\x64\x03\x72\x0f\x78\xf4\x76\x30\x77\x95\x18\x69\xa7\x55\x8a\xfa\x35\x91\x31\xa5\xee\xd8\xd7\x74\x20\x68\xd3\x49\xd4\xa2\x10\x44\x7f\xe5\xc0\xa1\xa2\x62\x55\x1a\xf9\x18\x11\xff\xd5\x58\x40\xec\x95\xa4\x42\xa7\x2f\xf7\xd8\x3c\x30\xa6\x51\x99\x91\xb9\x28\xcc\xdc\x37\x3a\x44\xc7\x3b\x06\xc9\x15\x97\xd4\x80\xbb\x41\xbf\xcb\x6d\x76\xd3\xa1\x7b\x64\x69\x7e\xd8\xb8\xe3\x0c\xb4\x60\x59\xb4\x29\x78\x92\x79\xd6\xf9\x3b\x5a\x22\x67\xff\x22\x94\xac\x75\x30\xb5\x2f\x55\x4f\x17\xd2\xa9\xba\x9a\xc5\x46\x51\x4c\x48\x73\xec\xf4\xaa\xa2\xea\x3b\xfd\xe5\x92\x8e\x29\x96\x4c\x0c\x27\x3b\xcc\x3c\x2e\x08\xf8\xfd\x74\xe3\xba\xd4\xbc\xe3\x1c\x31\x41\xa5\x5c\xd6\x98\x59\x93\x8f\xf5\xfc\xfd\x9d\xdc\xa3\xd8\x00\x25\x34\x0d\x2a\x40\xb2\xf6\x44\x64\xac\x98\x9c\x0b\xc3\x5c\xc8\x53\x0b\x69\x66\x5f\x4c\x06\x31\xc7\x1b\x05\x0b\x89\x44\xb0\xec\xbb\xdf\xf7\xd5\x4f\x5b\x3e\xbc\x20\xad\x62\x13\xb0\x54\x4a\x12\xad\xe6\x8a\x2f\x16\x24\x2f\x19\x2f\x34\x27\x16\x67\xbf\xad\xf0\x92\x93\x38\xe4\x4f\x98\xd6\x6e\x26\x8e\x3f\x7b\xe9\x4c\x7c\xf3\x13\xb8\xa3\x73\xc2\xc3\x0f\xa8\xb3\x6d\xc2\xfa\x70\x2b\xdd\x61\xa5\x24\x04\x78\x1c\x84\xdc\xa8\x0b\xed\x61\xd4\x81\x68\xa4\x53\xd0\x9d\xe2\x9b\xb0\x7a\x43\x97\x63\xaf\xbb\xae\xd2\x31\xa5\xa1\x6e\x35\x92\xc9\xdc\x17\x56\x89\x2d\xf1\xc2\x44\xff\x48\x99\xa0\x1c\xdd\xe6\x2a\x8c\xc6\xc5\xa1\xa9\x47\x41\x67\xcb\x73\xc7\x6a\x39\xbe\xc6\x3e\x10\xbc\xbc\x19\xa3\x5b\x9b\x83\x12\x05\xe6\x0a\x8a\x59\x7a\xee\x64\x01\xb8\xb6\x52\xd5\xaa\x9a\x8e\x4a\xbd\x4f\x1f\x69\xaf\xc7\x40\x18\xa4\x06\xda\x31\xa0\x9a\x69\x0b\x68\x21\x6c\x22\xa4\x79\x62\x21\x6b\xf2\x8f\x55\xe1\x65\x92\x96\xb8\x0d\x21\x9a\xc4\x8d\x07\xf5\x70\x95\x71\xda\x2a\x98\x03\xed\x92\x86\x11\x05\xf0\x6b\x76\x50\x9b\xd5\x3c\x6f\x71\xd1\xbb\x33\x75\xb0\xea\x69\x2b\x8c\xe8\xd3\x05\x30\x0e\x52\x99\x89\xe7\xa5\x54\x70\xb9\xda\xbe\xe4\x38\x4f\xbb\x07\x49\x11\xc7\x33\x9e\x61\x3e\x85\x3b\x2f\xaf\x48\x2d\x7b\x41\x2f\x6e\x91\xc8\xde\xfe\x67\xc3\x64\x67\xaf\xe8\xce\xd4\x2d\x68\x25\x11\xad\xc7\x50\x7c\x64\x33\xc7\xe7\x6d\xb4\x4b\x46\xfe\xe5\x9c\xb0\x8e\xd0\x5f\x0a\x2d\x69\x2a\x96\xcb\xb5\x15\x7d\x70\x03\x1d\xd6\xe9\xd4\x0b\x94\x45\x9d\xfa\x47\x64\x10\xa5\x42\x3c\x8a\x3b\x3d\x72\x9b\x5a\x14\x95\x93\x36\x1b\xd6\x95\xff\x90\x09\xc9\x3e\x0a\xcb\x62\x41\x01\xb8\x14\x75\xcc\xe8\x3a\x1b\x57\x76\x26\xe3\xcb\x08\x00\x38\xf5\xaa\x06\xb4\x9c\xea\xb7\x4c\x53\x6a\x74\x28\xeb\x1c\x9b\xa0\xe4\xcd\x1a\x33\x7d\x14\xcb\x9e\xc2\xb5\x3c\x47\x8b\x75\x3e\x91\x09\xa8\x03\x04\xf2\xe6\xc3\x5c\x6a\x40\xa1\xa6\x51\x60\x10\x1d\xcd\xc6\x13\x68\x29\x35\xb4\xbb\xcd\xbf\x28\xa4\x6c\xd8\x7b\x1c\xaf\xbd\x09\x43\x50\xfc\xf3\xf1\xb9\x6a\x5e\x54\x72\x54\x43\x32\x6d\x8a\xdd\x8d\xd2\x06\x7c\xc0\x4b\x43\x1b\x90\x22\xb9\x3a\x01\xc3\x46\xbe\x3d\x89\x5d\xd6\x96\xda\x73\xc8\xe0\xb7\xa1\xf9\x80\x48\x6e\x81\xa9\x72\xd0\x10\xbc\x59\xa2\xea\xb2\x5c\xfc\x1f\x03\x47\x74\x11\x00\xf9\x5b\xfd\x8c\x12\x19\x79\x7f\xe2\x24\xf3\x74\x67\xd3\x57\x98\x1a\x2b\x6f\x03\x88\x10\x94\xdd\xb2\x7d\x9e\x90\xfb\xe5\x12\xe9\x6b\x34\xfb\xde\x3a\x82\x4b\x6a\x67\x07\x73\xcc\x58\xff\xb0\x61\xf0\x4e\x3a\xfe\xb2\xfd\x7d\x80\x46\x10\x0e\xa7\x5a\x01\x9a\xd2\x08\xc1\x32\x1f\x51\x7b\xa8\x52\x9d\x15\x1a\x5b\x4e\x26\x4d\x04\xf7\x6a\xb2\x34\x5d\x33\x51\x3a\xea\x0a\x73\x9c\xd7\xcb\xd7\x74\x1f\xfc\x87\xcb\x70\x49\xbf\x56\x5b\x11\x68\x9a\x6f\x81\x35\xb0\x7b\xe4\x7f\xe7\xf8\x3b\x87\x7f\x06\xad\x64\x0d\x97\xb7\x7f\x2e\xf2\xf1\x0a\xf1\x10\x23\x3b\x76\xc9\x45\x60\x5d\x87\x52\x30\x94\xeb\xd3\xcc\xec\x29\xc2\x7e\x9e\xca\xb9\x1c\xae\xe5\x7d\x5c\xc8\x9c\x20\xd8\xad\xfc\x3c\x8e\x5b\x00\xec\xcd\xa9\x91\x56\x5a\xc0\x02\x99\x1f\x5a\x3b\x75\xfc\xfd\x1d\x43\xf4\x72\x12\xf2\xf8\x2e\xe5\xf0\xbe\x9c\x2f\x33\xbb\xbc\x01\x01\xe4\x6e\x50\x6f\xeb\xc9\x56\x04\x2e\xf7\x8e\xc8\x49\x58\x89\x2b\x99\x9c\xa6\x41\x97\xd8\xf0\x87\x4a\x12\x8f\x72\xf1\xf3\xd2\x47\x03\x5c\xfb\x81\x5d\x47\x5c\xea\x67\x25\xdd\x6e\x63\x24\x83\x40\xe0\x4b\xbf\xd7\x82\x0f\xae\xf0\x8c\x44\xc5\x51\x57\x43\xc2\x65\x0b\xc3\x27\x22\x5f\x72\x46\x5a\xd2\x2f\x7d\x3f\xdd\xfc\xba\x59\x34\x47\x9e\x05\xcb\x68\x27\xad\xf6\xb4\x05\xef\x65\x86\x44\x8c\x4e\xf5\x6e\x25\x9a\x59\x47\x89\x4c\x88\x13\x91\x88\x00\x25\x13\x86\x0a\x9f\x6a\x6e\x90\x7e\x11\x8a\xa6\x49\x17\x92\xb9\x0e\x39\xd0\x95\x00\x2b\x49\x8d\x12\x2b\x2b\xd0\x9f\xd6\x8d\xfd\xf4\x08\xb4\xc3\xed\x7f\x5f\xae\x71\xda\x49\xa7\x5b\xb1\x32\xcd\x77\x33\x65\x74\xd8\x7f\x0f\xf5\x04\x00\xb1\xc3\x6d\xf5\xf2\x2f\xa7\x67\xb5\xf4\xa3\x26\xae\x9b\xec\x21\x54\xa9\x83\x07\x33\xb9\xa4\x42\xaf\x1c\x50\xc0\x64\xa8\xed\x32\x90\xe1\xb5\x68\x57\xfd\x3d\x4c\x72\x51\x5f\xe6\x76\xe1\x79\xfa\x58\xa3\x0a\x0e\xe3\x5b\x70\x43\x04\xdb\x74\x0d\xd8\x07\xbe\xc1\xe7\x58\xd9\xaf\x97\x55\x3c\x34\xa0\xdc\xba\x91\x8c\x82\x9a\x36\xe5\x0b\x2a\x71\xdc\xed\x7b\x3b\xc6\x4c\xee\xb9\x97\x83\xda\xe0\xf5\x30\x30\x52\x69\x78\xd2\x3b\xb7\x94\x11\x39\xc4\xa4\xb6\xfc\xf7\x13\x3b\x74\x0b\x18\x81\x18\x03\x7b\x9c\x77\x57\xe7\xe5\xa7\x76\xa5\xcb\xe6\x85\x6d\xde\x2d\xd8\xf0\x4e\xf3\xb2\xf1\xb5\x6b\xdf\xbb\x9f\xb9\x32\x87\x5e\x53\xe6\xb6\x71\xe3\xdf\x07\x15\xd0\x69\xe4\x0a\xfe\xe1\x31\xca\x20\x36\x07\x04\x60\xce\x29\x0c\xba\xd2\x89\x78\x7c\x4a\x0c\x66\x72\xc3\xdf\xc8\xcd\x67\x2e\x07\x00\xed\xf3\xa7\xf3\x00\xd8\x6f\xdc\xd2\x7f\xb7\x6f\xf2\x60\x9d\x00\x94\x20\xea\x33\x10\x77\x42\x5e\x96\x16\x15\xda\xa4\x70\x43\xaa\xce\xc0\x56\x0b\x56\xef\xf3\xa3\x46\x1c\x75\xac\x7c\x65\x0c\xe4\x50\x99\xd4\xea\x37\x03\x71\x23\xb7\x63\xa0\x6d\x2c\x2d\xfb\x5e\x5e\x05\x8f\xfe\x49\xd9\x83\xfb\xa6\x54\x39\x70\x8e\x5c\x03\xd9\xa2\xc9\xc0\xdd\xde\x16\xc8\x49\xbd\xb5\xef\x81\xd5\x45\xba\x1d\x1e\xd0\x04\x21\x89\x22\x2b\x57\x54\x0d\x1b\x4c\x36\xe8\x4a\x54\xf2\x84\x6c\x97\x6c\x74\xcd\x46\xc3\x30\xee\xf2\x26\xd8\x3e\xbb\x4d\xfc\x49\xc6\xdf\x72\x30\x66\xcb\x53\x2a\x5f\xf1\xdc\x6c\xb3\xed\x23\x91\xcb\xbb\x85\x01\xa0\x9f\x47\x87\xa3\x1b\x1b\x3c\xc6\xd1\xb7\x43\xe8\xa4\xb7\xc9\x9a\x7a\x17\xc1\xac\x29\xa5\x46\x79\xe7\x9e\x3b\xcf\x01\xd0\xb3\xde\x56\xef\x33\x55\xb3\x5d\x82\x83\xc3\xb9\x13\x91\x2c\x31\xd5\xa0\x5a\x66\x85\xe3\x39\x0a\x93\x70\x3b\xc6\xa3\xa3\x4f\xad\x12\x22\x64\xf0\x8a\xc3\xf6\x3a\x61\xc3\xd6\x15\x15\xe5\x50\xd9\x4d\x6f\x83\xc2\x44\xbc\xd5\xe2\x19\x53\xba\x38\xef\x4f\xe1\xdd\xb3\xf8\xf8\x07\x9a\x76\x3e\x61\xa1\xd0\xbc\xab\xe3\x7a\xbf\xe7\xf6\xda\xc6\x96\x2e\x0c\x17\xde\x7b\x8e\x31\x39\x90\x6b\xd6\x88\xec\xd3\x5c\x41\xc3\x31\x96\x47\xf3\xe2\xad\xda\x84\xd0\x0b\x0d\xa9\xd1\x1d\x6a\x55\x3e\x06\x91\x80\x22\xf3\xdc\xd4\xd1\x94\x2e\xab\x90\x23\x2f\x71\x4c\x70\x0d\x23\xff\xea\x54\xba\xbf\xb0\x62\xee\xa7\xfe\x3a\x8d\x65\x4f\x9d\xa7\x73\x64\xad\x1e\x73\xbc\xcc\xfa\x5b\x7b\xf4\x7c\x31\x3d\xd2\x4f\x7a\x27\xaa\xaa\xf1\x30\x36\x9a\xac\xc7\x96\xa5\x8a\xb7\xc8\x61\xb1\x7c\x88\xb9\x44\xa5\x27\x71\x1d\x27\x34\x0a\x6f\x6a\xf9\x3c\xca\x09\x1c\x7a\xa4\xe3\xf1\xfb\x52\x39\x88\x5c\x32\xdc\xbe\xe7\x51\x04\x78\x71\xff\xc9\x71\x9f\xab\xd1\xb6\x1c\xa1\xb4\x6a\x4d\x5f\x2f\x81\x99\x19\xab\x8d\x65\x9f\x27\xc8\x86\xe4\xc9\x2d\x1c\x48\xff\xf4\x74\x2e\x20\xc4\xa9\xb2\x8b\x43\xd6\xfc\x56\xb9\x98\xfc\x65\x70\xda\x6d\x01\x52\xde\xa8\x95\xa2\x6b\xdf\x34\xb8\xed\x5c\x32\xdc\x11\xda\xbc\xd8\xd1\xe5\x91\xd3\x9f\x53\x67\xe1\x63\x54\xc7\xe5\x61\x16\x1f\x10\x70\xe7\xee\x33\x9e\x5d\x03\xcd\x4d\x2a\x8e\xa0\x44\x05\x62\xa3\xc7\xda\x37\xa2\x3a\x87\x68\x79\xf4\xb2\x44\xf3\x28\xdb\xc2\xbb\xdb\x38\xb1\xc3\x2a\xe7\xcd\x9d\xa4\xf6\xf2\x61\x28\x27\xb3\x82\x4c\x17\xca\x72\x6d\x68\x9b\x70\xd3\x7b\x4f\x87\x42\xe6\x4d\xe5\x24\x67\x8c\x25\x8c\x2f\x96\x6f\xb7\xed\x6b\xb6\xfd\x99\x1d\x00\x30\x74\x60\xc1\x9a\xca\xd3\x42\x3c\x86\x98\x22\x3a\xc7\x31\x14\x86\x6c\x5e\x85\xd7\x6a\x6b\xcf\x16\xe9\x4a\x30\xf5\x37\x7f\x6e\x7a\x00\xaa\xc2\x55\xff\x77\xe4\x96\xae\x42\x33\x43\x6c\x64\xa5\xc1\x52\xc8\x7b\x07\xc6\x18\x4a\x0f\x91\x25\x1e\x24\x9f\x1c\x25\x5f\x75\x17\x36\x2f\xee\x20\x42\xb9\xc9\x90\xc3\xc1\xd0\xbe\xfd\x53\xfe\x56\x99\xa9\x9c\x84\xe5\xa9\xef\xca\x92\x7d\xcf\xf7\x68\xc4\xf4\x53\xa9\xf8\x9f\x82\x41\x41\x6c\xd3\xb9\xef\x64\x7e\x28\xf7\xc0\x76\xea\xee\x36\xfa\x60\x55\x41\xbc\x95\x7c\xf5\x1d\xe5\x24\x38\x8e\x95\x82\x0f\x5a\x73\xa4\xc9\x6f\x95\x6e\xc8\x97\xd5\xce\xa2\x64\xb2\x07\x1c\xfb\x5e\x21\xb9\x82\x4b\x5b\xd1\x75\x2b\x61\x65\x22\x6c\x8a\x6c\x14\xe3\x2a\xec\x8c\xe3\x96\x6c\xe3\xaa\x56\x27\xb0\x3b\x2f\xe5\x15\x25\xcd\x06\x2c\xbc\xe6\xed\xe3\x52\xe1\xb8\x9d\x25\xdc\xca\x45\xcf\x1d\x09\x70\x88\x9a\xde\xa4\x0c\x18\x51\xf8\x18\xab\x4d\x11\x2a\x37\x8f\x04\x61\xae\x73\xba\xe6\xbb\xdc\x74\x42\x2a\x3e\x4e\x67\xe2\x4a\x8d\xb4\x12\xc4\x29\xce\xe1\x50\xdc\xbc\x99\xd1\xaa\x82\x61\x88\xb2\x78\xc8\x4b\xae\xfe\x22\x08\xe1\xdc\x7e\xae\x29\x73\x57\xa2\xec\x9e\x94\x6c\xdd\x3d\x5d\x26\x35\x66\x73\xcb\xb6\x9f\xb3\xd8\x31\x39\x4f\x65\xa3\x73\x2e\x04\xa2\xab\x90\x29\x58\xf0\x80\x96\x89\xa5\xd8\xae\xa8\x18\x0f\x1b\x5f\x8a\x08\xeb\x8e\x6f\xb9\x36\x6c\x6a\x46\x7c\x23\xdb\x17\xc2\x38\x02\xef\xa5\xb7\xd4\xb7\x94\x3b\x91\xb3\xc6\x56\x47\x99\xb9\x73\x23\x3b\x9c\xf4\x63\xc2\xf2\x08\x4f\x1a\x18\xc3\x97\x28\x10\x21\xaa\x3d\xb7\xcd\xde\x63\x44\x81\xfb\x6c\xb6\xdf\x64\xcc\x5e\x5a\x08\x62\x6a\xd8\x39\x87\x7d\x26\xb7\xeb\x19\x27\xf4\xb2\xe6\x67\x16\x2a\x17\xc6\x43\x56\xd7\x82\xb6\xfa\x91\x05\x82\x14\xca\x45\xe7\xf3\x19\x86\xb1\x9d\x6a\xa4\x7a\x1c\xab\xf9\x13\xa2\xd2\xa9\x95\x0b\x78\x05\x34\xee\xcc\x42\x94\xac\x77\xc4\x74\xe0\xb5\x25\xcf\xfa\x5b\x76\xb2\x86\x33\x5b\x30\x97\xdf\x8c\xe8\x37\x14\xb3\x2f\xfe\xb7\xad\x76\x1d\xfd\x72\x1a\x27\xa6\x72\x11\x6d\x04\x66\x86\x80\xcd\x6c\x2e\xd2\xce\xf5\x61\xb5\xe8\x73\xad\x1d\x79\x38\x30\x9d\x4a\xf7\x5b\xd7\x69\xc7\x9b\xd3\xff\xa3\xd4\x05\x77\x59\x4c\x6f\xb0\xab\x0e\xd4\x3e\x9b\x53\x0a\x13\x94\xf5\x62\x58\x81\x47\x98\xd8\x19\x18\x78\xa9\x39\x05\xc8\xbb\x9e\xd7\x07\x24\xa7\x0e\xe6\x0e\x90\x6d\x8d\xc9\x4c\x2a\xbf\x27\x77\x80\xcf\xf2\x31\x35\x2e\x09\x4a\x65\xaa\x24\x1d\xe4\x32\x2e\xa6\x88\x74\xbb\x0f\xe4\x5d\x21\x5f\x78\x05\xeb\xfd\x4b\xf5\x55\x87\x7f\x0a\x71\xac\xf4\x7a\x09\x85\x79\xca\xce\x0c\x6c\x2b\xb1\x3a\x53\xbb\x91\xa9\xac\x10\x73\x36\x8d\xc2\xff\x16\x82\x09\x63\x58\x13\x6e\x6e\x96\x63\xc4\x1b\xa9\x81\x11\x5c\x80\xb1\xe9\xd9\x16\x16\x99\x22\x2b\x40\xf1\xd3\xba\x26\xb8\xf3\x3b\x8f\x18\x75\x8c\x61\x99\xb9\xf2\x14\x87\x7e\xbc\xa6\xb6\xfd\x26\x74\x50\xaf\xde\x03\x5d\x15\x35\x7a\x55\xd0\x62\x26\x05\x08\x28\x07\xb4\xf0\xbb\x52\xb0\xb1\xe3\xdf\x1c\xa4\xbb\x59\xb4\x29\x8c\x09\x4e\xc7\x2c\x7c\x2f\x0a\x56\x0a\x44\x73\xd9\x3f\x65\xcb\x85\xb9\x67\x89\x5c\x31\xc0\x7d\x2c\x66\xa9\x52\x67\x38\x1a\x59\xd5\x4c\xf2\x67\x54\x8c\x7a\x05\x15\x40\xd8\xd1\x2c\x4a\x69\xd9\x2b\x25\x30\x07\xdb\x6b\xd4\x39\x3a\xc0\xb5\xc9\x50\xb8\xcd\x4e\xbd\x40\xe1\x86\x95\xd3\x90\xce\x2a\xe0\x36\x3a\x3f\x38\x17\xca\x4b\xdc\xe4\xbe\xbd\xbc\x55\xd7\x3c\x4c\xba\x85\x92\x36\xfd\x74\xb7\xda\x03\xa3\xac\x9b\xab\x06\x8c\xe4\x95\x29\x30\x01\xb9\x13\x63\x3e\x29\x44\xf1\xbf\x66\x93\xdd\x53\x30\x57\xab\xf2\x0b\x9a\x9b\x12\x13\x2c\x39\x50\x27\x5c\x5a\x77\xb9\x05\x42\x24\x8e\xca\x4d\xf9\x4b\xc2\xbd\x3f\xaa\x7e\x32\x0d\x64\x24\x9a\x9a\x34\x32\x2a\x1f\xcd\xb7\x5b\x5f\x09\x4a\x50\xb6\xa8\x84\x68\x54\xf5\x5e\x0f\x6a\x7c\xa7\x29\xc2\x43\x28\x3c\xe9\xf2\x6e\x4e\x4c\xa5\x9d\xdd\x0a\x7a\x7d\xa4\x0a\x51\xd5\x0c\xbc\x99\xa2\xfa\x6a\xc2\x68\xb8\x49\xd4\x70\x61\xf0\xd1\xf4\x07\xdd\x83\x14\x73\xb6\x74\x01\x4b\x4a\x5d\x70\x93\xd0\xbb\x9a\xd6\xf2\xb9\xf3\x7c\x49\x5d\x84\x87\x18\x93\xef\x21\x33\xc3\x78\x4b\x81\x04\xc3\x65\x4d\x89\xcd\x03\xc0\x54\xe9\x6c\x42\x6e\xb9\x6c\xbc\x43\xfd\x18\x29\x52\xbc\xad\x73\x04\x79\xf8\xde\x27\x58\x89\x29\x55\x92\x62\x84\x95\xbf\x31\x1e\xe9\xef\x5a\xa1\x4b\x47\x3d\x21\x76\x41\x02\x6a\x71\x10\x7d\xb9\xda\xdc\xa6\x6c\xbc\x5b\xe2\x9c\x3f\x44\x5c\xb8\xc2\x48\x13\x5d\xcf\x52\x84\x19\xb0\x3d\x60\xcf\xe2\x6f\xd4\xbd\x6a\x48\xba\xf7\x36\x26\xc0\x57\xe7\x3d\x07\x1f\x51\xc5\x95\x99\xe4\x2b\xc6\x87\x73\x51\x74\x78\x5c\x0d\x72\xe8\x98\x54\x80\x77\x6b\xc5\x3d\x4c\x1f\x35\x3c\x0e\x5e\x27\x00\xab\x61\xce\x1f\xe6\x40\x31\x3d\xcf\x9f\xf0\x8d\x25\x6a\xe3\x54\x78\xca\x13\x0d\x1f\xa4\xb6\xc2\xcb\xbc\xec\x5b\x76\x4a\xb9\x24\x24\x4f\xa8\xd6\xbc\x83\x4b\x27\x33\x9b\x09\x3e\x35\xf6\xb0\x01\x7f\x72\xb2\x9a\xc2\x4c\xe4\xaf\xf8\xbc\x40\x4f\x0d\xe5\x70\x3b\x5c\x3c\x2c\xa7\x5a\x3d\xbe\x73\xaf\x94\xc4\x72\xcf\xcd\xc2\xe9\x94\xfb\x8e\x88\xcd\xc0\x23\x0b\x63\x95\x93\x3e\x87\x52\xfb\x10\xc9\x30\x5e\x3e\x7b\xc3\xb9\x4d\xde\xfb\x2e\x18\x3c\x2c\x41\xd7\x0f\x90\x38\x6e\xef\x9e\x68\x69\xef\xef\xe8\x76\x2f\xb6\x9f\xa1\xcf\x28\x7f\x98\x42\xf8\x65\x9c\xfc\x4d\x2b\xcb\xf0\x9e\x06\x87\xc4\xa4\x0a\x9a\xa9\x6d\x1e\xdb\x75\x17\x28\xb2\xfb\x93\x00\x30\x10\x63\xa2\x35\x8f\x9f\x06\x29\x4e\x19\x16\xf2\xb8\x83\x3e\x31\x8d\x15\x2b\x9b\x2d\x30\xd0\x4e\x6c\x2d\x4c\xce\x25\xec\x10\x5b\x4e\x62\x37\x04\x77\x55\x02\x9c\xf9\x79\x74\x6d\x79\xd0\x18\x24\xa5\x50\x92\xe1\xf0\xd2\x08\x72\x68\x79\xa1\xa0\x66\xde\x3f\x87\x47\xe5\x51\x91\x1e\x40\x98\x2f\x76\x04\x34\xaa\x30\xc4\x8a\x9a\x3e\x82\xb6\xb3\x09\x26\x16\x79\xea\xd5\x34\x7f\x45\x8f\xef\x50\x22\x60\x7b\xc1\xf2\x55\xbe\xd5\x4d\x3f\xef\xb4\x05\xd5\x61\x72\x64\x95\x69\xd1\xe7\xa3\xda\xbe\x8e\x7c\xeb\xf9\xee\xef\xe0\xfa\xc6\x36\x0d\x35\x2e\xd5\x0c\x93\x7d\x1c\x26\xc3\xff\x08\x41\xd4\x69\x3d\x80\x5b\x7c\x88\x3f\x11\x81\x4b\xb2\x94\x3c\x7f\xf3\xc3\xdb\x84\xde\xcf\xb6\x7a\x1f\x75\x68\x6e\xe2\x53\x83\x14\xdb\xa9\x84\xef\xfa\x79\xad\xea\x1e\xbd\x41\x79\x74\x80\xaf\x30\x55\xaa\x7b\xf8\x4a\xb1\x9d\xb1\x9e\x35\xe0\x42\xcd\xab\x7d\x7f\x52\xeb\xde\x6c\x5e\x91\xa1\xf3\xf8\x95\xa2\xc7\x8d\xfd\x73\x7f\x47\xf3\xc9\x7d\xc6\x97\x74\x97\x4e\x2f\xdf\x69\x3f\x3d\x63\xd1\xea\x58\x4e\xa0\x78\x58\xfc\xb2\x02\x86\xcb\xa6\x61\xe3\x7c\xbc\x53\x49\x0d\x9b\x26\x9b\x28\xf7\xcc\x3f\x23\x37\x51\xe7\x76\xf8\xcf\x29\x64\x9a\xa0\x8b\x6a\xdc\x99\x99\xea\x4a\xc1\x14\x0e\x95\x10\x63\x55\xd7\x41\x57\xcf\x54\x23\xe3\xfd\x8e\xf8\x09\xf9\xd2\xc3\x29\x9c\x95\xe5\xc3\xe9\x60\x61\x44\x41\xd5\x2a\xc7\x6c\x4a\xe2\xd2\x95\x53\xf3\x98\x6c\x08\xfe\xa0\xf0\xd1\xc3\x14\x28\x55\x05\x98\x43\x56\xb5\xf2\xfb\x24\x34\xc7\x1d\x04\x2b\x15\x0d\xae\x24\xca\xc9\x6f\xbc\xa0\x7d\xad\x2a\x16\x0b\x41\x4a\xc9\x3d\x20\xff\x01\x15\xd9\x04\x1d\xd9\xf2\x14\x30\x90\x1d\x7b\xd1\x1e\x8a\xbd\x80\x90\x91\xe6\x5b\xfc\x4e\x7b\xf2\xdc\x02\x76\x75\xae\xd1\x56\x32\x94\xeb\xde\x8f\x1a\x2b\x7f\x19\x73\x77\xb4\x45\xa9\x4a\xc0\xe8\xf8\x05\x9b\xb0\x36\x5e\x41\xef\xd7\x01\x8f\x49\x06\x91\x11\x82\x10\x0b\x48\x5f\x89\x84\x1b\x13\x79\x88\x06\x97\x93\x7f\xe4\xd2\x1e\xc7\x25\x83\xaf\x50\x51\xe2\xbd\xee\xa2\x35\x35\x34\xe9\x69\xea\x47\xdd\x20\x4e\x88\x9e\x55\x36\x8a\xba\x8c\x09\x22\x36\xc6\x1f\x13\x31\xe2\xce\x01\xb0\x66\xf6\xb1\x25\xf7\x82\xd5\x88\xf3\xf4\x8f\x8e\xf4\xbf\x5f\x70\xb0\x8f\xdb\xf5\x6f\x50\x78\x2b\x20\x19\x12\xc5\xfd\x35\x4b\x73\x22\x73\xae\x21\x61\x7a\x62\x3e\x18\xa1\x04\x90\xc5\x0a\xcf\x94\x21\xca\x51\x4d\x7d\xd5\x4b\x10\xaa\x0b\x7a\x2b\xe5\xe0\xe5\x10\xbf\x7c\x5c\xe3\x52\x12\x9a\xf0\x66\x46\xdf\x8f\x81\x62\x35\x2f\x6d\x27\x64\x01\x5e\xac\xe1\xfb\x35\x55\x44\x66\xae\x4c\xf3\xe8\x67\x94\xed\x36\x59\xa6\x1d\xfd\x55\x93\x50\xa6\x20\x97\x83\x85\x66\xed\xc9\x6f\x7b\x0f\xfd\x74\x1d\xb6\xe4\xa8\xb2\x86\xb6\x04\x68\x9d\x25\x91\xae\x98\xe7\xae\xef\x2b\x50\xc4\x54\x96\x5a\x26\x95\x83\x76\x92\x22\x01\xea\x0f\xb5\x27\x3e\x81\x81\xc6\xe9\xdd\x44\xd3\x62\xac\xb8\xb2\xfd\xcb\xdb\x88\x8e\x88\xed\xc7\x77\x28\x21\xa3\xb5\x7b\xc7\x6b\x55\x65\x33\x89\xd2\xd1\x0c\xc8\x17\xb5\x93\x6a\x04\x33\xb8\x72\x55\xb1\x23\x8f\xa4\xce\x8d\x4a\xb6\xc1\x20\xd6\x82\xd9\x7b\xeb\x06\xa5\xc5\x2c\x43\xa2\x50\x49\xc6\x09\xd0\x8e\x40\xa2\xd4\x5c\xed\x18\x3b\x96\x8c\xf6\x9a\xc1\xa1\xf8\x7e\x1f\xea\xfe\xcd\x9f\x83\xc2\xd1\x02\xaa\xa8\x4b\x66\xbd\x1a\x85\xc0\xf2\x4f\xe6\x40\x66\x57\x02\xd8\x9c\x00\x5e\x1e\xd9\x2f\xba\x99\xc8\x60\xfc\x24\xa2\x21\x00\xbd\x66\x32\x8f\x97\xdc\x3f\x36\x9c\x71\xdc\x73\xa3\xce\x0a\x63\xa6\x36\x4a\xf4\x2d\xb7\xaa\x9d\xb8\xec\x11\x0d\x69\xbd\xed\xd2\x85\xd3\x2d\x0f\x00\x87\xcb\x32\x46\xfa\x6d\xc8\x8e\xca\x11\xc4\x5a\xf8\x21\x42\xf7\xc3\xf8\xbb\xc7\x20\x70\xd0\x43\x55\x95\x0c\xff\x9d\x9e\x94\xeb\xe5\x57\xfd\x94\x8f\xfb\x26\xb9\x33\xd1\x0d\xd0\x7d\x2d\x80\x64\xe3\xaa\x9c\x7c\x55\x32\xe7\x6f\x82\x38\x94\xa7\x17\xf8\x1a\x2a\x4d\xab\x7a\x63\x7b\x96\x5f\xc3\x01\xf2\xec\xc9\xb0\xf0\xc7\x68\xb7\x06\xb7\x39\xba\xfe\x95\x0d\xb5\xb9\x57\x94\x78\x5b\x22\x9c\x9a\x55\xdd\x9f\xdc\x9f\x2f\x7b\x8e\x12\x0a\xd0\xe6\x52\x6a\x54\x63\x10\xea\xdf\xa7\x2a\x6c\xb2\x07\x54\x96\x22\x27\x0e\x86\x53\xcc\xb8\xe0\xd2\x54\x62\x99\x9a\x24\xe8\xf3\x72\x51\x12\x97\x2e\x1e\x8c\xe6\x5a\x73\x56\x9b\xf2\xec\x4a\x1b\x04\x3b\x5b\x0b\x25\xab\x10\xb0\xc8\x6a\x52\xf3\xd9\x47\x4f\x37\x46\x52\x33\x18\xf7\x10\x8f\x63\xf8\x19\x26\xde\xa7\x7d\x87\x56\x8e\x5e\xac\xec\x68\xe4\x7a\x59\x94\xbc\x5e\xdc\x53\xfc\x4f\x75\x8d\x1d\x37\x68\x51\x4c\x56\xdc\x7b\x18\xad\xe0\x38\xee\xcf\xbc\xe2\x1d\xbc\xd3\xa4\xc1\xde\xeb\xf2\xda\x7d\xb1\xab\x8b\x17\x03\x15\xf5\x0a\x88\x15\x49\xbb\x40\x5f\xd1\x21\xd1\x32\x66\x62\x25\xd5\xd9\x07\xe8\xa3\x31\xe6\x6c\x9f\x94\x1a\x56\x89\x03\x4d\x94\xa0\x1d\x2d\x3a\x3f\x19\xda\xf8\x3e\x0c\x2d\xd8\x4e\x13\xf1\x36\x75\xaa\x76\x4b\x11\x93\x99\x57\x55\xaa\x7a\x28\xfa\x64\xf7\x42\x66\x25\x4c\x5d\xd7\xbb\x8d\x91\x27\xf7\x31\xe0\x76\xe3\x28\xf7\x38\xbf\x86\x9b\xe8\xbd\x56\x49\xc8\x10\x92\xfb\xef\xcc\xc7\x77\xa7\x55\xd1\xc4\xa0\x03\x45\x1b\x50\x56\x2b\xe3\x0e\xcd\x1e\x96\xe5\x8c\x24\x46\xf8\xe7\x79\x7c\xb0\x66\xc8\x92\x68\x59\x50\x12\xe7\x35\x22\xc9\x5d\x7c\x8f\x25\xa9\x81\x81\x3c\x9b\x83\x91\x9e\x56\x76\x9e\x62\x70\x7f\xa3\xa5\x20\x29\xf0\xb1\x69\x42\x9e\xf7\x25\xe0\x5b\x0c\xd6\x26\xe8\x48\xee\x8a\x0b\xb9\x5a\x16\x3c\xc3\xa1\x56\x2e\xb7\x5e\x85\x71\x8f\x07\xa1\x4b\x6e\xeb\x00\x04\x49\x0a\xe5\x5c\x91\x34\xed\x55\xd2\x57\xce\x68\xe3\xfc\x8f\xce\xf2\x70\x06\x3a\xa4\xb6\x38\xf8\x70\x32\x7a\x13\xed\x0c\x7e\x5f\x0f\x9b\x37\x3e\x90\x0a\x39\x8f\xea\x89\xe8\x0b\xc2\xec\x22\x3e\x4b\xc9\x99\x0e\xdd\xaa\xfd\x1a\x8a\x12\xf0\x91\xf5\x7c\xe2\x3e\x32\x43\xbc\xf7\xce\xb2\x4a\xd6\xcb\x7c\x09\x2a\x80\x6b\x38\x88\x75\xdc\x4a\xdd\xc7\xc3\x90\x77\x58\xf9\x71\x1e\x32\xdf\xf5\xd7\x40\x94\x61\xb9\xbc\x63\x8f\x1c\x6d\x5b\xc9\xbb\xf9\x70\xef\x7a\xd9\xc1\x80\x01\xca\x05\xd1\x83\x4a\x6f\x49\xae\xdd\xdb\x2b\x72\x70\x44\xea\xee\x47\x39\xf5\x3c\x42\xa9\x1f\x9a\xee\xce\xf9\x6b\x5d\xd1\x14\xe5\x92\x94\x5c\x66\x49\x8e\x77\xed\x60\x69\x9f\x4b\xa2\x33\x59\xba\x97\x72\x0d\xea\x76\x94\x04\x83\x88\x5b\x32\x46\xa4\xf9\xba\xcd\x56\x4c\x7a\xb3\x46\x85\xf9\x5e\x66\x82\x21\x92\x56\x4c\x50\xf8\x26\xba\xfa\x3d\x7e\xce\x27\xdf\xcf\xc7\x49\xc8\x3b\x84\x95\x06\x05\x27\xb5\x65\xdd\x4d\x2d\xdf\x95\xf2\x2f\xea\x13\xaa\xb3\xa9\x4d\x74\xfb\xd6\x75\x60\x3e\x34\x6c\xee\x83\x00\x00\x23\x24\x12\x2d\x78\x88\xab\x40\x19\x7e\x44\xff\xe7\xc0\x71\xa9\x96\x28\xfd\x6c\x0c\x9e\xfd\xd8\x72\xcc\xde\xdb\xe1\x97\xbe\x29\xd4\x48\x0d\xd9\xc1\xa2\xac\x93\x3c\xb5\xd6\xab\x79\x52\x72\x21\x62\x24\xf7\x3a\x2b\x90\xe5\x75\xd9\x34\x5f\x00\xa6\xa3\x96\x98\xe5\x8e\x84\x56\x77\x87\x67\x8c\x56\xdf\xbc\xc0\xb6\x5c\xc9\x19\x20\xbe\x45\x74\x79\x3a\xa4\x94\x74\xe6\x54\x9c\xd1\x25\x0f\x58\xa0\x73\x2f\x99\x3c\x56\x3e\x0a\x42\x4b\x64\x41\xa6\x74\x85\xf0\xac\x03\x0e\xe6\x20\x61\x50\x41\xa7\x01\x77\x55\x26\x09\x99\xac\x56\x0b\x1a\x6b\xdf\x70\x05\x88\xc3\xf8\x04\x18\x61\x1e\x6e\xb1\x22\xb2\x29\x54\xc9\xe4\xc2\x79\x52\x39\x62\x42\x4f\x92\x1c\x05\x56\xa3\x8b\xb8\x95\x4b\x15\xc3\x5c\xd2\x6b\x34\x29\x69\x29\x51\x06\x56\x1d\x5a\xcf\xbd\xe1\xb9\x7b\xaf\x43\x87\x52\x69\xbd\x82\xd8\x3b\x9d\x4f\xee\x13\x24\x40\xf5\x13\x9b\x71\x3e\xb2\x01\xab\x2c\x68\x0b\x12\x79\xf9\xfb\x0f\x51\xf9\x83\x01\x30\xa5\x4a\xe9\x5c\x57\x5e\xe0\x50\x29\x1a\x23\x8a\x49\xe1\xf1\xe6\x4c\xa7\xc2\x61\x81\xe6\xb8\xdf\xab\x6e\xad\x70\x1c\xc6\x43\x96\xa3\xbd\x1a\xa7\x61\xaa\x0b\x6c\x91\xfa\x30\x8c\xa9\xa5\x10\x14\x09\xb4\xd4\x01\x2f\x77\x6e\x61\xd4\x1b\xf9\x51\x12\xb7\x15\x15\x62\x85\xad\x95\x6b\x86\xb2\xbc\x49\x77\x7c\x71\x63\x10\x6c\x40\x10\x84\xc4\x0f\xed\xae\x07\xd9\x68\x37\x26\x56\x02\x84\x60\x0e\xf5\xc7\x05\x23\x82\xa0\x96\xed\x33\x82\x61\x05\x7b\xb9\xc5\xa5\x69\x93\x39\x73\x01\x1b\x2a\xd5\xe2\x76\xb6\xd5\xc9\x95\x8e\x69\xfe\xeb\xfb\x65\x88\x3e\xa8\x97\xb7\x4b\xd6\x1a\x4b\x18\x85\x8d\xce\xbe\xbb\x60\x4e\x76\x91\xbe\x83\x75\x87\xe2\x25\x09\x3e\x49\xae\x81\x9e\x01\x86\x41\x0d\x8b\x77\x29\x0a\x2a\x78\x36\x9b\x1c\x18\x3d\xc4\x68\xa9\xdf\xca\xc0\x76\xb6\xf1\x0f\xb4\x67\xa3\x51\x73\x39\x0c\x20\x08\x70\x53\xee\xd5\xef\x36\xdd\x08\xed\x61\xc5\x4f\x58\x59\x0c\x42\xc0\x40\xb8\xe3\x8f\xfb\x4e\x81\x2c\x81\x5e\xc7\x1c\x5a\xdb\xa4\x55\x6d\x4e\xce\x6c\x36\x6c\x02\x37\x1c\xb6\xf5\xbb\xe5\x80\xee\x75\xdb\x4d\x7d\xf4\xe3\x09\x53\x8b\xd3\xb6\xd9\xce\xe8\x11\x68\xa9\x6b\x86\x85\x73\x74\x9a\x07\xdb\x12\x41\x13\x21\xd4\x0e\x42\x11\x8c\xeb\x6e\xab\x72\x9d\xa1\xcd\xdd\x1b\x94\x0c\x82\xb2\xbe\xed\x92\x8a\xc4\x0e\x4c\xa5\x80\x6e\xac\xf6\x49\x0b\xe5\x12\x81\x42\x57\xe3\xcd\x12\x3b\xcf\x4e\xd9\x58\xf5\xbc\xfa\xa0\x26\xbe\x38\x6a\xc4\x02\x42\x34\xd6\xd5\x41\x39\xa4\x88\x5a\xa2\xa0\x54\xb7\xbf\x7c\x16\x8f\x1c\x7e\xa5\xe3\x31\x79\x10\x5e\x22\x8f\x43\xb0\xd8\x98\xa8\x49\x15\xab\x71\xb5\x2b\x81\xa6\xb1\x18\x6f\xc3\xcb\xf4\x34\x07\x9f\x91\x59\x8b\x10\xd5\x83\x39\xc6\xd0\x57\xd3\xd3\x71\x6b\x55\x68\xca\x63\x41\xc9\x5f\xb9\xa2\x85\x7c\x61\x97\x60\x47\xe9\xe1\x51\x33\xd7\x7d\xf2\x3a\xc7\xce\x17\xaf\x57\xcb\xf1\xab\xf9\x6d\x14\x2f\x2e\x1c\x34\xde\xfd\x0e\xfa\x49\xa6\x5a\x25\x7c\x9f\xd5\x74\x15\x32\xe1\x5e\xc2\xa1\x41\x9f\x98\x98\x9e\xa6\xb4\xeb\xf8\x13\x0e\x5c\x9f\xe2\x26\xfc\xca\x36\x76\x06\x84\x7f\xcb\xce\x6c\x3d\x8d\xef\xa3\x76\xbe\x6f\x81\x1a\x6f\xf9\xdf\x54\x65\x6f\x36\x29\x63\x73\x49\x74\x84\x45\x51\x8e\xcb\x83\x7b\xcb\x3f\x01\xaa\x00\xe5\x82\x91\xbc\x24\x43\xd9\x87\x6d\xa9\x7b\xff\x63\xd8\x5b\xc7\x29\xb9\x8f\x6e\xb4\x2e\x25\xa5\x9d\x85\x4a\x9e\xf7\x4f\x79\x63\x93\x79\xf4\x59\x7e\x49\x33\xca\xd8\xf6\x63\x67\xc1\x4b\x5e\x3a\x7a\x78\x7c\x25\xb4\xf2\x42\xf1\x92\xbc\xac\x24\x81\xa6\x29\x78\x02\x93\x54\xbf\xa6\x51\xae\x45\xa1\x16\x59\xea\x52\xe5\xa2\xe5\x0f\xc6\xe2\xe7\xd2\x8c\xf9\x29\x05\xb8\x57\xa5\xc6\xba\x82\xb8\x32\xcc\xfe\x45\xa0\xef\x77\x60\xf6\xb9\x37\x7c\xd6\x30\x02\x1b\x02\xa3\x82\xb8\xdc\x63\xdc\xa2\x12\xb6\xb1\x85\x02\xb4\xbc\xd4\xcf\x67\xac\xbe\xf7\x93\x06\x6d\xdb\x64\x4c\xc0\xb8\x49\x4b\x81\xd5\xec\x46\xf2\x05\x9a\x2b\x82\x9c\x03\x45\x00\xde\xda\x2d\x4a\x5b\x05\xe3\xb0\xe2\x08\x2d\x97\x9b\x66\x6d\x15\x96\x03\x94\x06\x53\x5a\x62\xd4\x95\xa3\xf6\xc7\xa9\x92\xd7\x6d\x33\x29\x06\x9c\x6e\x12\xf4\xff\x55\x05\xd4\x1e\x1e\xa6\xa1\x2a\xcc\xfa\xd8\x02\x47\xfb\x85\xd1\xc2\xfd\x3e\x2a\x4e\x44\xcc\x86\x3b\x05\x2e\x4b\x87\x6e\x1f\x02\xf1\xa9\xcb\xde\x66\x04\x23\x9b\x93\xa2\xbf\x17\x32\x30\xa8\xc3\x8f\xba\x6c\xbf\x44\xb3\xb1\x77\x0c\x24\x90\x35\x66\x2d\x79\x8d\xcd\xb5\x25\xd4\xd5\x1d\xb4\xa0\x76\xa9\x66\x8c\x16\x60\x2b\xd0\x3f\xa7\x8d\x81\x01\x4c\xf6\xae\x35\xd3\x84\xe8\x02\xc7\x60\x9b\xe6\xfd\xb1\x56\x2d\x4c\xa5\xdc\x2e\x0c\x42\x71\x03\xb6\x8d\x7e\x9a\x77\x3b\xe3\xd9\xa1\x77\x2c\x85\x0a\x78\x04\xaa\x9b\x31\xd2\xc9\x9b\x89\x75\x28\x39\x1c\x75\x79\x09\x8a\x6d\x76\x53\xcc\x05\x88\x90\xe9\x30\x1d\xa0\xdd\x31\xec\x8d\x71\x7f\xe7\xcc\x1e\x46\x60\x01\x6f\xe6\x96\xa9\x11\x78\x4e\x8f\x24\x2a\xb6\x8a\xfb\xf3\x30\x6e\xe4\x5c\xce\x9a\x9c\x9f\x0b\x7a\xec\x83\x1b\x83\xe5\x45\xcc\x1f\xe5\x90\x4e\x6f\x83\x1a\x1e\x1a\x1a\x18\x86\xe0\x67\x57\xed\x54\xbe\x3c\xc4\x95\x69\x18\xb3\xf9\x0e\x0b\xeb\xb7\x49\x23\x34\x20\x52\x8e\x6c\x94\x71\x17\x77\x4a\x3a\xdf\x2b\x50\x37\xa7\x98\xc3\x65\xb5\x02\xb3\xe0\x90\x8c\x04\xd7\xc1\x6f\xf9\x54\xd7\x9a\x85\x65\xcc\xfe\x04\xdd\x49\xe7\x3d\xb5\x04\x2b\x02\x11\x69\xb2\x23\x2a\x04\x70\x8c\x36\x84\x03\xf5\x6e\x37\xf3\x9c\xa7\xc7\xc8\xf1\xd6\x96\x67\x72\x71\xfd\xa1\x6c\x71\x1c\x20\x4b\x1e\x45\xab\xa1\xd9\x92\xf3\x65\x4b\xfc\xaa\xec\x86\xf0\xc7\x4d\x7c\xb5\xaa\x08\x7c\x9f\x7c\x1d\x6e\xb5\xa7\x03\x49\x7d\xb7\x3f\x56\x7e\xcd\xab\x69\x79\xa6\xd3\x38\x7f\xd6\xd1\xb2\xe6\x5c\xc5\x34\xfd\xe5\xac\xca\x71\x65\x60\x1c\x7d\x64\x80\x19\xdb\xa0\xad\x94\x03\x9a\x66\x11\x9e\x4a\x6e\x47\x08\x33\x2f\xe7\x56\x59\x6d\x9a\x87\x9b\xaf\xba\xf5\x7f\x18\x3b\xf3\xc2\xe4\x90\xe1\x73\x1e\x08\xee\x27\x5a\xd1\x93\xc5\xed\x69\x33\x41\xe2\xd7\xf4\xbc\x29\xdb\xcb\x87\x93\x10\xe5\x4b\x3f\xb9\xea\xde\xfe\xc8\x0b\x0e\xd0\x92\x7b\xe8\xaa\xde\xc7\x29\xa0\x56\x32\xda\x61\x40\x25\xf6\xf5\x08\xfc\xed\x70\x6a\xe8\x4c\x04\x82\x0d\xc4\x61\xec\x44\x3f\x89\x5e\x02\x64\x8f\xd0\xa7\xda\x82\xa1\x77\xdf\x20\xf9\xc5\xc7\x72\x0c\x07\xee\x79\xa2\xf3\x81\x03\x9d\xdc\x39\xca\x82\x5f\xe7\x9d\x82\x68\x0a\x7d\xb0\x53\xe5\xeb\xf6\x32\x35\x53\xe8\xe3\x57\xd4\xaf\x23\xd4\xe2\x15\xf7\xa8\xd6\xc8\xbc\x74\xa2\xa6\xd1\x70\x33\x4d\xe1\xc6\xac\xb4\x6f\xab\x51\x64\x27\x85\x9f\x71\x2f\x11\x7b\x39\xae\xb9\x87\x65\x87\x2e\xb5\x6d\x59\x87\xab\xe3\x37\x41\xb7\xab\xba\x7e\x8f\x9e\x6d\x95\x2c\xb5\x82\x9f\xc9\xbc\x3b\x1b\x87\xd5\x52\xa2\x84\xcf\xc5\x7a\x0d\x3d\x2a\xdd\xa0\x5d\x34\xf6\x94\xe1\x31\x9d\xfb\x95\x6e\x96\xec\xc0\x57\x14\x54\xb8\x77\x66\x5d\xca\x2d\xd1\x75\x17\xca\xa7\x39\xa7\xa7\xc2\x99\x52\xcb\x14\x9a\x35\x40\x3d\x03\x46\x48\x2a\x11\x6c\x06\x62\xbc\xd0\x48\x10\x22\x59\x36\xe5\xcd\xb9\x4a\x9a\xc5\xaa\x4c\xd3\x39\xd3\xb4\x2a\xe9\x63\xf2\x14\x94\x86\x2d\x41\x7d\x67\xe2\x88\x87\x7f\xfb\xa0\x2f\xc3\x1d\x43\x9b\x9c\x14\x78\xfd\x91\xaf\x72\xa9\x45\x58\xeb\x0f\x14\x74\xbb\xc6\xa2\xac\xd3\x2b\x39\x62\xef\x7b\xf1\x66\xe5\x25\xef\x80\x05\xb6\x73\xee\x38\xa6\x60\x50\x1b\xc2\x53\x04\xb1\x2c\x57\xc6\x44\x15\x03\x65\x1e\xaa\x4c\xb3\x52\x58\x0f\x7b\xdf\xb0\x1b\x90\x63\x4a\x5f\xee\x21\x9e\x5f\xc9\xea\x75\xff\xa6\xf4\x34\xaa\xe2\xa3\xc2\x1f\x8e\x64\x38\xe0\x91\x58\xd7\x7f\x16\xa9\x2d\x68\x5d\x35\xd3\xf6\xb7\x54\xe1\x61\x69\x3a\xb9\xcd\x40\x09\x3e\x33\x72\x6b\x5a\xea\xfc\x31\xe3\x83\xe1\x43\x39\x08\x15\x14\xc2\xeb\x15\xf4\xa0\xf8\x15\x49\x65\x32\x98\x60\x4f\xe0\xf3\xdd\x94\x15\xf2\x7c\x0f\xc8\x9e\x21\x54\xc6\x4e\x2d\x96\x71\x76\x95\xbb\xc2\xdf\x22\xf2\xc1\x9f\x6a\x1f\x00\x55\x8b\x4a\x84\x5d\xf3\xbb\xab\xaa\x5f\x46\x60\x67\x69\x2c\x2b\x9a\xb5\x21\x31\x8f\xce\xab\x46\x21\x4b\x1f\x71\x62\xbd\xe0\x59\x98\x81\x64\xeb\xf2\xa7\xca\xab\x2e\xd7\x3e\x03\xe1\x62\x63\xb5\x92\x78\x95\xe7\x99\xac\xaf\x22\xa3\xe3\xfa\xdc\xbe\xba\x08\xc2\x6f\x2b\x06\xbe\x6f\x41\xa2\x12\x59\x03\xa1\x5f\x91\x10\x4a\x96\x86\x60\x04\xab\x83\xed\x8d\x50\x56\x07\x48\x42\x83\xbb\x19\x26\xac\x4e\x33\xf3\xa9\x54\x66\xaa\x58\x25\x21\xca\x45\xae\xe2\x95\xfb\x63\x6a\x1b\xd5\xfc\x07\x37\x2f\xbb\xe0\x04\x8e\x5f\x94\x58\x48\x70\x88\x59\xcb\xf7\x5d\x2e\xbd\x24\x91\xa9\x21\x4f\x71\x3c\x4b\xea\xc1\x59\x64\x9a\x67\x7f\xda\x43\x9a\x68\x9a\x73\x23\x4a\xcb\x0b\x08\xdb\xf2\x23\x7c\x4c\x52\x38\x29\x05\x7d\xf5\x42\x2e\xdb\xea\x13\x12\x01\xbb\x84\x0c\xd0\xdd\x6c\x1d\x57\x01\x7d\xd5\xf6\xe2\x74\x38\x30\xa6\x6f\x27\x90\xf8\x90\x84\x4a\x4d\x27\x36\x58\xff\xa6\x6d\x2d\x28\xb0\xce\x56\xca\xd2\x7c\x3b\x4e\xfe\x63\x8c\x4c\xd5\x9c\x9b\xf4\xa5\x2a\xa0\x54\x49\x4f\x97\x5b\x33\x42\x36\x16\x18\xa6\x24\x97\x22\x24\xf4\x68\xcb\xa5\x46\x86\x8a\xa5\x02\xb8\xc2\xf4\xcb\x55\xf9\xa6\x32\x03\x2a\x01\x06\x80\x97\xa3\x1d\x40\x50\xad\xe1\x13\x18\xb2\x69\xc8\x31\x85\x3f\x4e\xe2\x28\xd3\x58\x56\xb9\xe4\x94\x2b\x8d\xcc\x28\x5b\x70\x0e\xb8\x6b\xdb\xaa\xc7\xce\x02\xdf\x95\x52\x3b\xc8\x08\x3c\xec\xb2\x34\xae\x2e\x79\xbd\x41\xbe\x94\x95\xf6\x4b\xaa\xea\xaf\xb2\xd0\x34\x10\x8c\x8a\x9e\xd5\xba\xbd\x6b\xf5\x58\x49\x3a\x23\x26\xe3\x26\x47\x4b\x45\xf6\x2f\xfa\xc5\x31\xb4\x6c\x9b\x74\xfa\xc2\x6b\x00\x2a\x13\xce\x8c\xf0\x31\x96\xf3\x81\x4d\xe9\x90\xdf\xff\xe3\x90\xa5\x76\x5c\x6a\xac\xed\x45\x00\xac\x80\xaf\xf6\xb0\x7c\xab\x34\x7b\x5b\xca\xff\x5d\x95\x4f\x5e\xa3\x9c\xe0\x97\xfe\xd7\xf4\x95\x13\x68\x2d\xcb\x50\x9e\x93\xe2\xcc\x61\x9a\xeb\x81\xd9\x72\x00\x90\x21\xf4\xff\xfc\x12\x88\xd3\x44\x26\x86\x06\xfb\xdb\x02\x9e\xef\xb2\x73\x85\xea\xdc\xdf\xc6\x80\x9d\xa8\xf8\xf6\xe3\x32\x74\xe4\x70\x3a\x96\x01\x0e\xaa\x5a\xd4\x37\xd6\xf3\x23\x67\x82\x3b\xa2\xd2\xae\xed\x51\x52\xca\xac\x9f\x0e\xe7\xfd\xae\x80\x09\xf9\x5d\x9b\x43\xf7\x1a\x26\x02\xbf\xea\x07\xd2\x5d\xb8\x2a\x33\xd6\x04\x34\x7b\x49\x63\x21\x75\xe1\x1f\xbc\x05\xfe\x1b\x00\x55\xdc\x94\x28\x0f\x29\xf9\x64\x7b\xbb\x29\x86\x39\x93\x36\x10\x27\x39\xa1\xbb\x6b\xc5\x82\x5a\x69\x97\xc3\x3a\x74\x47\x59\x73\x3a\x6d\x44\xc3\x5e\x51\xb4\x64\xf0\x81\xd6\x5b\x7b\x73\xa4\x34\x56\xae\x5e\xc0\xa8\x49\x55\x6c\x4f\xf6\x14\x5d\xce\x43\x57\x4c\xb5\x97\xe6\xfa\xb1\x65\x3e\x11\x46\xef\x8a\x9b\xbc\x4a\x60\x17\xa6\xc0\x28\x16\x7a\xf9\xa4\xcb\x55\x91\x0f\x4d\x80\x10\x2b\x2d\x55\x3d\x53\x1a\xf5\x16\x63\x64\xe3\x6b\xb6\x30\x86\x82\x0a\x5b\x28\x13\x05\x5e\x4d\x78\xb4\xc3\xb1\x34\x3c\xa4\x26\x94\x4a\xf6\xbf\x9f\x42\x52\x5e\xd6\x8f\x31\x41\x5a\xac\xae\x02\x25\x84\xe9\x0a\xa9\x3e\x5c\x0c\xd0\x77\x5f\x14\x05\x7a\xb0\xb3\xa8\xaa\xfb\xac\xfa\x5b\x43\x49\xe7\x71\xd2\x2b\xca\xce\xab\x5a\xa5\x13\x6d\x6e\xeb\xd0\x41\xce\x7b\x37\xba\xb5\x97\x60\x62\x1d\x5e\xd4\x12\x0c\x9a\x25\xdd\x66\x72\x20\xf4\x1b\x74\x1d\xa2\xda\xc6\xa7\x45\xff\x8a\x3d\x48\xaf\x04\xc8\x2b\x28\x2e\x8f\x54\xe3\xdf\x9b\xed\x44\x2e\xed\xe8\x03\x56\x8c\x78\xea\x55\x62\xe5\xe5\x32\x7c\xf7\x9c\xf0\x4a\x29\x75\x87\x63\x56\xff\x04\x28\x33\x01\xf8\x89\xb6\xa9\x49\xe7\x2b\xba\x45\x50\x78\xd8\xea\x10\x89\x7c\x44\xd6\xee\x16\x9a\x70\xf2\xea\x89\x8e\xb4\x29\x03\x99\x9f\xe7\x1a\xd7\x38\x30\x12\x23\x59\x4f\x9c\x4b\x32\x55\xf1\xff\x83\x88\xb9\x43\xb4\xc9\x01\xbc\x71\x26\xd0\xc6\x06\x02\x0a\xc7\xe6\x83\x78\x9f\x9e\x4a\x8f\xe5\x9a\xd4\xaa\x1b\x2f\xcf\xeb\x92\xa7\xda\xd7\x8a\x0d\x74\xc5\x45\xa2\x9e\x9a\xfc\xb6\x04\x5a\x36\x0d\x20\x87\x39\x61\x39\x8d\xab\x78\x2c\xe0\xa5\xda\x87\xf0\xc2\x84\x67\x2d\x47\x9c\xe9\x0d\xfa\x45\x80\xfc\x3e\x1a\x49\x97\xc8\xce\x58\xd8\xe9\xa4\x53\x55\xde\x2a\x1b\xea\x62\x5d\x3d\x59\xac\xb3\x7c\xcd\xab\xf0\x21\xfe\x02\x65\x8a\xc5\x27\x1c\xed\x2d\x8a\x45\xac\xad\x92\x5e\x24\xd2\x6e\x62\xbe\x07\x9a\x4b\x71\x99\x36\x49\xcc\x2e\x1d\xc2\x84\xc8\x03\x6a\x03\x41\x3d\x54\xc1\x75\x0d\xdb\x8a\x93\xb3\xda\xb5\x66\xc3\x24\xc4\x3a\xd1\xc5\x21\x51\xd2\x16\x75\x5c\x79\x25\xdd\x9c\xf6\xa2\xab\x1b\x34\x82\xe0\x0d\xfb\x0e\x00\x33\x6e\x44\x20\x27\x16\x95\x60\x83\xb2\x7a\xb4\xe1\x8e\xfc\x57\x8d\x15\x4c\x0e\x2a\xd7\x20\xba\xd3\xd8\x0f\xe5\xec\x3f\x6d\x25\x40\x2d\xcb\x52\xe4\xeb\xdf\xf0\x2c\xfc\x6c\x6a\xde\xcd\x2e\x6c\x0a\x31\xc7\x1d\xba\xcf\xea\x10\x40\xd0\xc9\x61\x9d\xe2\xe9\xba\x5c\xf7\x92\x1c\x9e\x3c\x6b\xf6\x3c\x50\x20\x1a\x94\x27\xfe\xa4\xec\xf3\xc3\x68\xc6\xda\x43\x18\xaa\x0e\x2d\xec\x70\x2f\xef\xa8\x93\x17\x02\xf2\x95\xe8\xb4\x5a\x07\x08\x8c\x44\xdc\x8c\x73\x23\xc1\x9f\x4d\x1a\x34\x14\xab\x52\x96\x2c\xd4\xb3\x96\xe3\x34\x46\x1f\xc0\x0a\x40\xb7\xaf\x7e\x2b\xd7\x83\xca\x32\x70\x17\xa7\xa9\x26\xce\x5b\x72\x5b\xb0\x7c\xdc\x4b\xe0\x21\x89\x7d\xaa\xc8\x23\xb0\x81\x83\xaf\x50\x8a\x2d\xb1\x99\xf3\xba\x8f\x52\x5c\x87\x22\xd1\xee\xba\x90\xb4\xbf\xca\xb2\x02\x6e\xb7\x5c\x93\xe7\x51\x01\x47\x86\x15\xdd\xfe\x57\x15\xac\xa3\x13\x7b\xf8\x28\x41\x73\xf6\x4b\x9e\xcc\xba\xa7\x58\x91\x0e\x8e\xbf\x00\x1e\xaa\x93\x1c\x89\xd9\xae\xe5\x63\x34\xf3\xd0\xf0\x4d\xc7\x89\xdb\x10\xfd\xc3\xe5\x32\x1a\xe8\x59\xe9\xf7\xcb\x5f\xf2\x3c\xfe\xad\x92\xbe\x78\xf5\x24\xca\x24\xfb\xbf\xed\x03\xfd\x38\x9f\x14\xdb\x8e\x06\xb1\xd9\x5b\x81\x6f\xf6\xfe\x9a\x65\x56\x32\x31\x1f\x28\x19\xee\x6a\xc1\x02\x60\xb5\x6d\xa8\x60\x69\x1b\xa3\x93\x60\xcc\x6b\x2d\x90\xc0\x90\x3e\x7b\x31\x51\x7e\xe4\xd2\x86\x41\xef\x65\xd1\x66\x9f\x26\x61\x35\x2b\x2d\x8c\x77\xfc\x14\xad\xb9\x2c\x69\x72\xef\x51\xd6\x48\x9f\x83\x98\xe3\x41\xc0\xb3\x5f\x42\xdf\x1b\xdf\x40\x49\xad\x79\xe1\x5a\x72\x6f\x13\x2f\xd8\xd4\x6d\x4a\xe8\x29\xd8\x97\x1f\x65\xa5\x41\xe5\x68\x3e\x35\x62\x84\xa6\x7d\x30\xb8\xb7\x14\x76\xa1\xa2\x71\x56\x50\x25\xd0\xda\xbb\xb9\xae\xf0\x32\x77\x3e\xf9\xe0\x1f\x79\xdf\x2e\x2b\xb9\x03\x4d\xfe\x6a\x0e\x36\x2a\xbc\x86\xa3\x31\xd7\xec\x5d\xf2\xc7\x62\x16\xdf\x78\xd6\x18\xa8\xbd\x7f\x09\x23\x02\x2e\x56\x01\xd8\x04\x37\x8d\x71\x66\xa5\xb7\x30\x13\x5d\x7a\x99\xf3\x1d\x58\x8f\xce\xc5\x7a\xe7\x91\x6a\x97\xe6\x5d\x87\xc0\xb9\x55\x53\xa7\xed\xf8\x04\x1e\xd4\x52\x7d\x71\xfa\x34\xe7\xfe\xc5\xd9\xe8\x2f\x5a\x19\xc8\x1c\x96\x61\xe2\x9d\x87\x1f\xbe\x39\x19\xbf\xfd\x4f\x52\x60\xba\x6e\xcb\x39\x93\xad\x25\x91\xb6\x58\x58\x3a\xd9\xf0\xa8\x79\x8d\x9e\xef\x68\x6e\x22\x3d\x5b\x74\xe8\x94\x77\x07\x2c\xd0\xcd\x79\xf9\x1e\x0b\x5b\x49\x99\x5f\xd0\xa0\x2d\xe5\x43\x09\x99\x8e\x5f\x10\x03\x24\xe5\xec\x10\xf5\xba\xfb\xa8\x28\x19\xfc\x13\xe9\x38\xbb\xde\x54\x35\xb7\x04\x4b\xc9\xb5\x1f\x01\xaa\xe2\xd4\xd1\x24\x92\x08\x9f\x49\x8e\x95\x58\xdd\x1f\x88\xaa\xbb\x68\x10\xe5\x25\x96\x72\x4a\xf6\xee\xe3\x51\x91\x82\x6f\x00\xaa\x38\x96\x07\xfc\xf4\x6a\x1b\x81\x6d\x12\xb8\x8a\xb2\xbd\x85\xf4\x7b\x63\x50\xc6\x53\x8c\x0a\x85\x42\x04\xbd\xf2\x1c\xd4\xd0\x97\xae\x54\xbe\x3f\xbd\xdc\x59\x9d\x15\xce\x65\xad\xbc\x8d\x13\x32\xf5\x50\xcb\x94\x49\x51\x17\x63\xbe\xd0\x43\x22\x56\x49\x27\x8e\x9c\x77\xb5\x73\x8e\xcc\x91\xe3\x31\x5e\xfd\x14\xb0\xe5\x66\xad\xdc\x0c\x39\xe1\xde\xa1\x43\x44\x62\x85\x7d\xdc\x89\xc1\x5f\x2d\x0e\x82\x7f\xcc\xb2\x5d\x3f\x0c\x0f\x8e\xc3\x62\xb4\xac\x1a\x36\x4d\x30\x29\x00\x66\xb0\x7e\xf8\xae\xf7\xb7\x0a\x0e\x8b\xb6\x77\x3d\x53\xf7\xe7\x68\x11\x57\x68\x67\x66\xdf\xea\x94\x1a\x48\x9a\xe6\x4a\xb2\x19\x35\x43\xda\xfb\x5e\xc2\x8b\xed\x00\x8d\x68\xbe\xe4\x9f\x18\xb2\x6d\x62\x90\xd3\x6c\xc4\x0f\x2c\xc4\x2f\x54\xdb\xf6\x57\xb4\x80\xfe\x19\xce\x84\xb1\x30\x97\xab\xd1\x63\x4b\xb4\x69\x60\xf6\x9e\x89\x2e\xb0\xed\xbb\x99\x77\x7d\x38\x8a\x97\x53\xeb\x99\x2b\x71\xc6\x43\xe8\x1b\xfb\x43\x5d\x28\x47\xcd\x1a\x64\x3b\x12\x58\x3b\xfe\x7a\x60\x3d\xcb\x75\xf0\x6b\x15\x1d\x11\x16\xae\x16\x52\x9c\x7b\x6c\xd0\x63\x2d\xf0\x70\xb9\x41\xdf\xc7\x23\xc5\x72\xb0\x3e\xad\x3a\x95\x30\x69\xe4\x39\xd6\x07\x56\x75\x25\x52\x47\x87\x6c\x59\x4b\xab\x82\xeb\xb4\x6b\xb3\xf3\x30\xe3\xf5\x59\x56\x34\xcb\xc0\x92\x96\x13\x10\x7e\xf4\x51\x74\x06\x98\x71\xae\xbd\x89\x12\xd3\xf0\x65\xeb\x00\x1a\x21\xff\x75\x88\x4f\x04\xa7\xe2\xcd\x13\x41\x74\x36\xcb\x93\xaa\x1a\x9c\x1c\x10\x82\x9a\x0c\xde\xa0\xcf\xaf\x07\x59\x49\xae\x81\x56\x3b\xf5\x4e\x30\x1a\xaa\x06\xf7\xf9\xc2\xd3\x65\xdd\xd4\x1e\xd4\x04\x71\x74\x8f\x31\x0f\x1b\x5c\x4c\x4e\x0b\x27\xc3\xcf\x9f\xe5\x92\xc0\xa7\xf8\x93\x87\x65\xb1\xe5\x59\x1f\x2b\x1c\x52\x63\x7b\xd1\x94\x45\x39\x68\xc5\xfc\x51\xef\x89\x64\x93\x41\xc6\x99\x30\xe5\x65\xcb\x89\xf0\x16\x35\x9f\x00\xa2\x97\x45\x22\xef\x7e\xe1\x5f\x4b\xa5\x7a\x36\xa1\x44\x89\xe5\x4d\xcd\x2a\x77\xaa\x1a\x1c\xac\x37\x76\xa7\x96\x60\x2c\x04\xef\x15\x4b\xdd\x8c\xee\x5b\xe9\x10\xe3\x11\x5e\xce\x32\xb2\xcc\xd9\xc3\x52\x97\xea\x13\x13\x4f\x78\x04\x86\x86\xdb\xbd\x5c\xcf\x54\x2f\x91\xea\x29\xe6\x10\xfd\x66\x9a\xd2\x08\xa1\xd0\xb7\x6d\xfb\x35\x0c\x05\xd0\x08\xd7\x56\x68\xcc\xd6\x23\x90\xa7\xde\x8a\x14\x07\x9b\xc4\xf5\x7d\x3f\xb0\xff\xff\x78\x2c\x99\x27\x20\x1a\x1a\x46\xfd\xa6\x7b\x30\xa1\x8d\xd1\x4b\x9a\x88\x52\x93\x57\x75\x17\x30\x2c\xec\xf4\xff\x49\x9b\xf9\xd0\x59\x83\x8f\x36\x33\x25\x51\xb3\x69\x0b\xd3\xfb\x96\x2e\x17\x37\xb7\xa9\x30\xc5\xaf\x78\xdf\x12\xe1\x42\xef\x00\x6a\x7f\x31\xfd\x6c\xcd\x6f\x74\x3f\x27\x87\x83\x68\x6b\x3e\x51\x39\xec\x64\x7a\x8f\x1a\xaa\x3f\x82\x46\x6e\x2c\x4c\x43\xe8\xb2\xc3\x1f\x95\x7b\x7d\xc2\x69\x4b\x35\x17\xe4\xb9\x51\x01\x93\x90\xbb\x72\x78\x09\xb0\x9e\x0a\xa5\xe9\x2c\xdf\xa6\xe8\x0e\x93\x9c\x7e\x21\x8e\xf4\x70\xd2\x5e\xb2\xd7\xc3\xc3\x83\xd4\xbd\x82\x47\x52\x96\xe8\x87\x59\x6f\x1a\x83\x5d\xc9\x2b\xd5\xa2\xcb\xa5\x96\xa1\xc3\xcd\x1e\x1a\xc1\x29\xf1\x0b\x79\x97\x8f\x4c\xe7\x99\xa4\x36\x65\xa5\x68\xdb\x4f\x24\xd2\x15\x3c\x7b\xae\x8d\x6c\x41\xce\xe5\x7b\xe4\x5b\x0e\x1b\x15\x3d\x55\xe1\x1a\xa9\xae\x35\x2f\x8e\xa8\x73\x0f\x93\x26\x34\x33\xc0\x9f\xe1\xae\x3f\xaa\x0c\x23\x52\x22\x29\xb3\xf6\x9f\x60\x91\x47\x30\xa5\x41\x85\x4f\x9a\x7a\xce\x21\x00\x86\x0e\xd6\xf2\x90\x7e\x0c\xc2\x75\xdc\xe2\x38\x51\x5f\x6a\x4d\xd2\xde\x54\x33\x73\x27\xf2\x4c\x8b\xe4\x5e\x23\x1a\x56\x84\xa5\x0c\x15\x30\x12\x56\x5f\x7b\x15\x58\xea\x7b\x9a\x72\xb3\x30\x62\x94\x7d\x4b\x72\x83\x1b\x50\xc7\x02\x15\xf0\xaf\x29\x40\x77\x86\x05\xab\x37\x55\x39\x04\xce\x2f\x8d\x7e\x54\x32\x00\x84\x5e\xc0\xcc\xcd\x56\x38\xb8\x30\xf0\x7d\x00\x40\xc3\xaa\x62\xef\xcf\x4e\xd6\x20\x99\x72\xc7\x26\x47\x6c\xd1\x38\xc7\xb9\x8a\xaa\x63\x8a\x02\xe8\x08\xac\xc6\x0a\x8e\x87\xbd\x41\xca\xd7\x23\x1d\xfa\x21\x1f\x6a\x61\x7b\xa2\x70\xdd\x17\xec\xf9\xbb\xee\xe1\x13\xa2\x27\xb5\x86\xa0\x37\x32\x65\x7c\x00\xa2\x52\x6c\xe3\x63\x74\x07\xa9\x7c\x6b\xd9\x96\xd3\x4b\xff\xde\xd5\x84\xba\x7d\x35\xc9\x74\x32\xc0\x5e\xd1\x34\xb1\xab\xd3\x5f\x96\xbd\x92\xcc\xb9\x47\x82\x19\xe8\xc1\x0f\xb4\x48\x74\x7d\x93\xc2\x19\x3a\x14\x5b\xb6\x35\x70\x5b\x75\xa8\x27\xb8\x3a\xdf\x28\xdf\x76\x23\x62\xc5\x17\x54\x65\x58\xf0\x59\x4f\x5e\x12\x3f\xa7\x80\xcf\x6a\x0b\x5f\x42\x52\xc1\x33\x93\xc4\x82\xeb\x95\x9f\xb3\x0a\xf4\x8e\xf3\x5a\x8d\x61\x87\x88\xbe\x97\x5e\xb7\x43\xb5\xa1\xb9\x83\x8f\x94\xc7\xe4\xce\xf8\xc3\x5a\x3b\x40\x0f\xfd\xb2\x92\xb0\xa8\x4d\x39\x55\x56\xf7\xbc\x4e\x8b\x79\x9b\x1f\x46\x38\xdf\xae\x79\xaf\x86\x02\x2b\x22\xe4\x43\x30\xbf\x07\x7d\x77\xf8\x37\x58\x01\x2e\xd4\x5a\x7b\xe0\x56\x07\x87\xec\xae\x6a\x80\x77\x15\x07\xd4\x6d\x31\xef\xef\x72\x4c\xa1\xbb\xcb\x16\x40\x98\xaa\xea\xbd\xa5\xa6\x18\xf9\x23\x5d\xfa\x20\x7a\xb3\x33\xf5\x51\x65\x53\x8e\x7f\x9b\xa8\x6c\x67\x28\x91\xb5\x61\xfe\x2c\xb8\x8a\x56\xaf\xd0\x4e\xb3\xd6\x69\x44\xe5\x8a\xb4\x8a\x10\xec\x8c\xcd\x00\x6e\x67\x09\x6d\xd6\x63\xed\x73\xf5\x80\xc0\x1e\xae\x2d\x7d\x47\x93\x1e\x2b\xf9\x15\x47\xad\xb7\xff\xd9\x41\xf2\x5f\xd6\xf9\x3b\xeb\xf3\x6a\x36\xf5\xa2\x81\x46\x51\xd0\x6c\xe4\x18\x51\x82\xb5\x41\x8a\x30\xfd\x53\xf5\xb0\x45\xad\x11\x23\x48\x75\xbc\xb4\xdc\x77\x8b\x8e\x04\xfc\x4f\x8f\x36\x54\x13\xbe\x51\xf7\xee\xa3\x1b\x87\x8d\x72\x86\xdd\x48\x5b\x1f\xb2\xf3\x8a\xf4\x94\x87\xcc\xb6\x46\x63\x16\x8a\x1a\x53\x35\x4b\xb1\xd2\xaa\x52\xef\xf7\xa5\x48\xf9\x1e\x3e\x7f\x36\x23\x06\x27\xdb\x97\xc2\xa7\x92\x2f\xfa\x42\x45\xf7\x69\x5c\x67\x8c\xe8\xd7\x28\x2c\x52\x07\xbd\x92\xfb\x8d\x68\xe1\x0a\x5e\xd7\x6d\x10\xdc\x8f\x37\x0e\x00\xa9\xc1\x94\x02\x78\xc1\xc4\xf4\xc6\xa0\x1e\xf6\x97\xcb\x1e\x7d\xb2\xc3\x73\x0e\x68\xe6\xf5\x6e\x61\x45\xba\xae\x66\x96\x13\x7c\x2a\x22\x13\xdc\xb8\x0b\x50\x5c\x6a\x6b\xfa\x5a\x96\x58\x3e\xee\xe9\x72\x01\x74\x84\x07\x7f\x5c\xa3\xb7\x72\x9a\x95\x0f\x2c\x14\x62\xa1\xd8\xef\x22\x63\xcd\x55\x9b\xa7\x5c\x17\x81\x62\xb4\x4f\x37\x1f\x5e\xc2\xf5\x69\xb9\xb8\xf4\xec\x65\xc4\x01\xb9\x57\x64\xd7\x8e\x71\xa2\x7b\x5c\xe3\xf4\xa2\xcd\x95\x06\x1b\xa3\x85\x65\xab\x5a\x28\x00\x87\xeb\x14\x12\x7c\x67\xe3\x85\x2b\x25\x50\x26\x93\x08\xbf\x6b\x34\xea\xfd\xa4\x2d\xc7\x28\x09\x36\xfe\xb1\xba\x57\x4d\xcd\xaa\x83\x89\x39\x05\xfb\x7d\x31\xe8\x10\x23\xbe\x54\x11\xf2\x29\x92\x6e\x90\x16\x98\x43\xeb\x7d\x6f\xc9\x54\xe2\xd4\x59\x92\x80\x40\xc4\xf0\xd8\xde\x07\x2b\xa3\xac\x12\xc1\x58\xa7\x6b\xd8\xe0\xf0\x3f\xee\x81\x34\x0f\x4d\xbe\x95\x3a\x7e\x21\xe7\xb1\x72\xe0\xac\xd7\xbb\x82\x72\x79\x4f\x31\xb4\xc7\xc4\x3a\x96\xb0\x38\xe1\xcc\x64\x84\x02\x87\xe7\x23\xf1\x35\x2c\x29\xec\xba\x31\xf1\xb2\x1d\xc3\x26\xd5\x4e\xd2\x49\xb9\xca\x96\xff\xb8\x1a\xe5\x73\xee\x02\x04\x3f\xd7\x5e\x70\xa9\x28\xdc\xaf\x4d\x55\x43\x8b\xde\xcd\x29\x7a\x61\x6d\xed\x8a\x39\xb5\xac\x4e\xf3\x59\x80\x9d\xe9\x7e\xc5\xfa\x49\x0c\xf1\x69\x0c\x26\x5e\x25\x9e\x4e\x69\xd5\x40\x45\xdd\xaa\xe7\xf8\x4a\x42\xb1\x1b\x5f\x23\x21\x42\xe9\xce\xc1\xc6\x77\xab\xd0\x6d\x40\x1f\x6d\x40\x60\xf4\x3a\x62\x5d\x8c\x52\xa6\x4e\x28\xf5\x51\xdd\xa6\xc1\xa6\x11\x32\x8b\x70\x8d\x60\x43\x63\xcb\xef\xab\x58\x48\x1d\xc4\x56\xf4\x3b\x9c\x68\xd7\xaa\xa0\x7c\x1e\x0e\x3a\x0f\x42\x50\x05\x2c\xa5\xf6\x48\xd8\x23\x62\x38\x13\xe8\xb6\x47\xf8\x1d\x82\xb2\x63\x04\xff\x23\x9d\x8c\x1a\x0f\x8c\x17\x38\xc4\x61\x6b\xdf\xee\x30\x1e\x80\x8f\x25\xd8\xe8\x4c\x07\xb6\x68\x72\x26\x8c\xb5\x2b\x0d\x9f\xfe\x16\xc4\xf3\x83\xfd\xa9\x59\xf8\xb6\x25\x0b\x97\x9c\x93\x8d\x24\xcb\x17\xbd\x47\x87\x55\xba\xa7\x25\x03\x1c\x5b\x4b\x0b\xbb\xe6\xb8\x71\x34\x9e\x14\xa5\xc1\x13\x8b\x81\x37\xdc\x23\x3d\xa5\x21\xd5\x47\x83\xee\x35\xc4\xbd\xe1\x76\x1f\xca\x93\x5d\x4f\xa5\x6c\xaf\xc1\x0c\x5f\xfc\x9b\x08\xc9\x30\x2d\xf6\xd9\x58\xea\x63\xb2\x09\xcf\x70\x02\x6d\x31\xf4\x14\x66\xb8\x75\x6b\x41\x06\x7d\x5e\x95\x53\xed\xe3\xa6\x53\x2b\xf7\x26\x61\x2f\xbf\xe8\x41\x38\xe7\x2c\xc1\xbf\xfa\x88\xe3\x81\x17\x03\x72\xf3\xb1\xe9\x33\x89\xee\x6c\x23\x16\xe3\xd0\xdf\xdd\x63\x2b\x6f\x25\x6b\xb5\xe5\x0a\xdd\x85\x4a\xeb\xe9\xf1\x78\x08\x3d\x94\xb3\x45\xfe\xec\x7b\x93\x05\x7a\x37\x16\x13\xb4\x46\x75\xd9\x44\x09\x6d\xc6\x0b\xe1\x80\x09\x8f\x58\xb5\xf6\xbf\x54\x9b\x6d\xb7\x00\x1f\x99\xda\x8a\xf1\x89\x51\x64\xd4\xb9\xf6\x30\x4c\xa6\xc2\x97\x3c\xcd\xe1\xa1\xfd\x9b\x7c\x8c\x7d\xb2\x95\x68\x3f\x89\xc1\xac\x5c\xa7\xb3\xfb\xcf\x14\x63\x14\xda\x3d\xa8\x87\xec\x10\xf1\xf5\xcb\x3d\xf8\x2e\x73\x25\xb6\x9a\x8d\x33\x17\x8a\x7e\x1d\x55\x64\xe5\xad\x36\xe3\xf1\xd2\x79\x24\x73\x62\x1c\x64\x8a\x7b\xc0\xc7\xe0\xc6\x9c\xeb\x23\xdf\x31\x31\x0b\xa1\x57\xd5\x24\xa6\x2d\x25\x15\x1e\x70\xd1\x51\x97\x8c\x78\x22\x2f\xfb\xad\x91\x72\x00\xa5\xc9\x3f\x3e\xd3\xa2\x1f\x75\xc8\x4c\x4a\x14\xee\xa3\x5f\x77\x9b\x3f\x33\x42\x61\xb5\xb3\x0e\xbb\xca\x16\x9d\x63\xc9\x06\x66\x7b\x3e\x21\x0e\x60\x79\xba\x76\xcc\xab\xd8\x28\x7b\x08\x54\xed\x93\xcf\x43\xd3\xc3\x55\xd3\x8c\x55\x07\x90\x23\x1b\x75\xc6\xca\xde\xd7\x3c\x1e\xc7\xa5\x88\x4f\x13\x8a\x7c\x03\x4b\x78\x74\x99\xd2\x42\x7c\xe7\x28\xff\x72\x62\x3c\xba\x68\x93\xed\xba\x4d\x82\x50\x22\x87\xe4\x4d\xd3\x84\xb9\x4f\x08\x6f\x40\x4f\x7d\x33\xe4\x73\x4a\x7f\x2f\x0e\xe6\x45\xe7\xe4\xb7\xfa\x5b\x7f\x72\x79\xbe\x28\x5d\xb8\xb1\x08\x12\x16\x14\x61\x91\x0a\x95\x06\x8a\x5b\x91\xf6\x6a\x7e\x9d\x62\xf3\x93\x53\xee\xb9\x4c\xde\x03\x3f\x9a\x5d\x0f\x4d\x95\x22\x5d\x5e\xdf\x8f\x55\x67\xbb\x5a\x08\xa9\x37\x76\xbf\x07\xc1\xfc\x72\x40\xe8\x6d\xe5\x65\x9d\xd4\xf2\x2d\x1d\x9f\x41\x4a\x56\x40\x09\xa8\x20\x3a\x43\x15\xca\x8a\x7c\xb5\xc2\xab\x9e\x39\xbc\x93\x07\xf5\xce\xca\x99\x62\x4c\x01\xd0\x76\x26\x43\x2c\x71\x66\x01\x88\xc5\xab\xcf\x56\x2a\x3a\xa7\x96\x46\x3a\x7e\x9a\xd5\x95\xdb\x21\x2c\x55\xe0\x1c\xa6\x24\x0f\x62\xb3\xbc\x59\xca\x35\xa3\x48\x5f\xd6\xcb\x38\x24\x01\x0c\xb6\x6b\x42\x54\xaa\x8b\xf9\xa3\x75\xe0\x07\xf2\x07\x3a\x0b\x96\xe1\x8d\x41\x80\xf3\xa2\x29\x7d\x34\x8d\x40\x59\x83\x2d\x04\xa1\xe6\xb0\xba\xfc\xc9\xfb\x10\xc8\x7f\x16\x2d\x16\xe8\xc0\x6b\xd8\x4e\xf2\x80\x4a\x7b\x54\x5a\x8e\xc2\x23\x53\x4f\xb4\xa3\xc2\xba\x65\xcd\x47\x08\x02\x22\x23\x48\x95\xd4\x55\x4d\xcb\xc7\x40\xbe\x6e\xb6\x2c\xb6\x0c\xe8\x45\x3c\x46\x7b\x21\x78\x03\xae\xd0\x7c\xd4\x96\x77\x8e\xf0\xad\x3e\xda\x67\xdd\xad\xc7\x7d\xa6\x12\x31\x15\x83\x1e\x80\x02\x48\x10\x04\x9c\xae\x89\xf3\xd2\x47\x06\x30\x50\x07\x64\xd9\xc3\xab\x4c\x2e\x65\x0a\x19\x99\x43\x52\xf3\x6c\x9a\x67\xd7\x83\x3c\xdf\x1e\x89\x7a\x2e\xf7\xbe\x37\x6f\xeb\xd3\x87\x72\x23\x35\x7d\x62\x08\xa4\x8f\x61\xae\x33\xcc\x7e\xf9\xcd\x9e\x29\x75\xc0\xf8\x06\xeb\x75\xf9\x82\x44\xf5\x32\xdf\x17\x1d\xbf\x3b\xeb\xb8\x8e\x6a\x55\xe6\x17\x40\xdd\xdc\x1b\xbd\x14\x75\x40\x6f\x4f\x01\x81\x18\x4b\x30\x73\xdf\x8c\xfe\x33\x31\x73\x90\x00\x58\xb6\xb5\xcc\xa5\x23\x59\x0e\xd2\x2c\xd8\xed\xbd\x0e\x8c\x88\x86\xd0\xad\xaf\x7e\x30\xd0\x82\xcd\x4f\xfd\xc4\x1b\xcb\x43\xcf\x28\x5a\x02\xdf\x19\x61\x00\x2b\xd3\xe6\xa5\x2e\x51\xf4\xf2\x72\x4c\xaf\x28\x70\x78\xf3\x71\xb9\x54\x08\x05\xb9\x8f\x7a\x73\xc4\x94\x39\xcd\xc1\x61\x2e\x72\x1d\x1d\x6c\x46\x03\x29\x36\x48\x5d\x3c\xfb\x7f\xee\x70\x9d\x23\x5c\xb4\x09\x66\x1a\x3a\xe1\x18\xbd\x5b\x06\x1d\x96\x89\x2e\xfe\x72\xb8\x88\x80\xd9\x7f\xe8\x16\x97\x01\xdb\x82\xa0\x3b\x1b\x59\x56\x0e\x45\x08\xe0\xd8\x13\x07\x79\xf9\xa0\xc2\xa6\xa1\x74\x40\x2c\x78\xbb\xc1\xc9\x80\xab\xe5\x27\xeb\x56\xc3\x27\xfa\x5e\xe9\xbc\x6d\x4c\x29\x7b\x8b\xe5\x45\xa3\xe9\xb0\x67\x07\x18\x2e\x85\xbe\x7a\x0e\x75\xd5\xf2\xe3\x26\x44\xe6\x89\x26\x33\x67\x2c\xfa\x82\x91\xbd\xff\x6b\xde\x8b\x67\x7f\x92\x8d\x06\x34\xad\x51\xf1\x89\xa4\x7a\xb2\x46\xda\x68\x1d\x16\x80\x2d\x24\xb8\x34\x1d\xce\xd3\xc2\x0a\x3e\xc6\x59\x2c\x42\xc5\x5a\x1b\xb9\x7d\xc2\xac\xe7\xc6\x76\xe2\x45\x53\x00\xfe\x78\x32\xee\x1d\x0a\x79\xab\xd3\x3c\xe0\x30\x21\xe0\xa5\x32\xd5\x84\x26\x34\xfd\x0c\xc7\x48\xe2\x51\x09\xff\x86\xb3\x7f\x0c\xe4\xef\x66\xd5\x0b\x9f\xc6\x3a\x73\xb7\xb1\x02\xdb\xb6\xe6\x6c\xc3\x08\x18\x38\x1d\xad\xa6\x90\x2f\xa8\xe6\xf2\x47\x12\x78\xc2\xb4\x94\x7d\x39\x55\xbb\x2e\xa5\x36\x90\x9c\x81\x8e\x46\x89\x36\xc7\x91\x0b\x06\xb2\x64\x9f\xbe\x2d\xa7\xc5\xab\x48\x61\x45\x8c\x5e\x89\x94\x19\x80\x42\x82\x07\x2c\x4f\xe7\xf0\xda\x2f\x0b\x69\x74\xef\x3e\xe9\x37\xc8\xcf\x51\x8f\x64\xcb\xbf\x96\x8d\xca\x6c\x66\x5b\x38\x2a\x60\x6a\x98\x5d\x65\xb7\x00\x01\xaf\x08\xce\xe5\x57\x93\xf2\xa6\x53\x79\xb5\x28\x0c\x8c\xc3\xfc\x74\xb7\x25\xe3\x1c\xde\x57\x98\x27\x4b\x0e\x26\xa4\x5d\x60\x5b\x7c\xd9\x61\x82\x5e\x35\xab\x23\x89\x53\xd8\xad\x1a\xc1\xc8\xd3\x97\x39\xbe\x67\x52\x9e\x46\x29\xf2\xe1\x40\xb6\x78\xcb\x18\x20\xb6\xd5\x73\xf3\x92\x10\xa5\x4a\x79\xf3\x57\x8f\x03\xb7\x1a\x90\x21\x93\xd3\x89\x8b\x0c\x65\xea\x09\xbe\x89\x1a\x54\xe7\x6d\x2d\xad\x16\xf3\xe8\x97\xbb\xcf\x52\x88\x5d\xf1\x63\x88\x35\xeb\x95\xa5\xca\x56\xcd\xe7\x11\x35\xd1\x7c\xb6\x83\xca\xd0\xd3\xbb\x77\xa6\x06\xab\x5b\x98\x18\x39\x08\x89\x35\xc3\x04\xe5\x46\x14\xdf\xe1\xa3\xf5\xe8\xc3\xc5\x3c\xa8\x71\x17\x74\xaf\xde\x4f\x8f\xaa\x18\x33\x85\x8f\x28\xef\x8d\x44\x8d\xc5\x58\xeb\x6d\xab\xb4\xb1\x62\xfb\xa7\x1c\xc8\x3e\x9c\x73\xf1\x20\x3e\x5b\x0d\xc0\x38\x8b\xbc\x99\x66\x8d\x47\x9e\x06\x52\x3f\x93\xb8\xe8\x3e\xb8\xab\x60\xc1\xcf\xb9\x31\x2c\x7c\x35\x3c\x7f\xce\xc9\x73\xf1\x1f\xb9\x90\x61\x2e\x16\x86\x0d\x3f\x08\x06\x77\x09\x9f\xfe\x44\x3f\x26\x20\x20\x37\xfb\x8e\x86\xb0\xc4\xf2\x8d\x5e\x1a\x69\xcb\x5c\x19\xdc\xf7\xb0\x9a\xfe\xc2\xd6\x52\x94\x7b\x5e\x0f\x64\xe5\x21\x67\x3a\xcc\xf3\x2c\x0d\x9b\xfb\xe1\x7a\xb5\xec\x00\x16\xa5\xd4\x98\xe0\x2f\x3e\x3a\x22\xb6\x59\xa6\xdc\x58\x9c\x72\xc6\xc6\x02\xf3\x12\x53\x2c\xa1\x7c\x3f\xdc\x47\x41\x58\x57\x21\x4b\x15\xd0\x3b\xe0\xfd\x3a\x99\x43\xba\x46\xad\xd7\xa3\x9a\xf3\xf6\xcb\xcb\x1a\x06\x9a\xe0\x05\xbf\x25\x48\x26\xd8\xa9\xa6\x0c\x77\x25\xef\x13\xcb\xa5\xdf\x4d\x64\xc1\x75\x79\xd1\x5a\xca\xbd\x20\x5a\x97\xe3\x37\x2a\x6b\xe1\x11\xa3\x91\xa2\x47\x5c\x39\x75\xe3\x3c\x56\xa7\xa6\x0e\xe2\x83\x6e\x85\x74\x63\xaa\xe8\xc4\x35\x57\xd4\xe2\x37\x03\x9c\x4a\x39\x5c\x60\xb0\xe8\x21\x17\xea\x5e\x4f\x77\x50\xde\xba\x6d\xfb\xea\x55\xa5\x32\x3a\xfb\xa4\x45\xdb\xb6\xd2\x08\xed\x05\x09\xa1\x4d\x41\xd2\xdb\xe9\x6a\xff\x0a\xd1\x6d\xf9\xb0\x4e\x12\xa0\x7b\x23\x33\xba\x04\x02\x6d\xaf\x02\x75\x72\xdf\xa0\x4d\x83\xa5\xb5\xda\xa4\xc9\x1a\x91\x3d\x66\x68\x8f\xf1\xba\x74\xab\xe2\x82\xc8\xc3\x46\xaa\x07\xe8\xd4\x4a\x20\xa3\x97\x8a\x5d\x93\x02\x77\x80\xfe\x27\xd3\x15\x09\xfe\xa7\xf3\x7b\xdc\xc1\xa3\x34\x98\xed\x12\x1e\x0b\xd7\x3a\xd4\x91\xac\x94\x13\xfc\x62\xc7\x90\x5e\x49\x10\xe5\xaf\xf0\x11\x72\xf2\xf5\xba\x38\x72\x83\x70\x91\x90\xb6\x7f\x88\x3a\xa4\x90\xa1\x8d\xef\x81\xff\xeb\xe0\x3b\x5e\xd6\xbf\x27\x31\x0d\xbf\xdf\x66\x40\x95\xc5\xe3\xdb\xae\x93\x8b\xa4\xca\xe1\xbe\x42\x47\x66\x03\x8a\x5e\x69\xc7\xf9\x37\x0b\x20\xc2\xfa\xb4\xad\x88\xc4\xd1\x03\xa1\xe3\x32\xef\x3e\xb2\x50\x7f\x07\xbc\x20\x1f\x5a\x2d\x2e\x82\xc3\x4d\xa0\x7a\xf8\x90\xf0\xd5\x88\x24\x4e\xbf\x03\xbb\xee\x13\xf8\xe0\x4c\xd2\x82\xa7\xf5\x1f\xd8\x3f\x30\x8f\x12\x10\xfc\x6d\xb5\xf8\x70\x48\x70\xb9\x2c\x13\xee\xfd\x6c\x70\x05\xb5\x95\xf6\x82\x23\xf9\x55\x3d\x6b\x03\xb2\x58\x62\xac\x5e\x03\xdc\xca\xd0\x41\x43\xbe\x2f\x93\x85\xa5\xdc\x1e\x72\x1b\xd8\xe7\x91\xe9\x1f\x55\x18\x55\xdc\x96\xb3\xbc\xab\xbd\xde\xa5\xb3\xbd\xed\x3c\x7f\xf9\xdc\x26\xad\x66\xb9\xe5\x95\x22\x40\xc4\x77\x40\xde\x46\x1d\xdf\x9c\x81\xfa\xf4\x36\x68\x0e\x22\x44\xe1\x7d\x84\xdc\xc9\xd8\x47\xd3\xca\xf3\x5b\x72\x8d\x39\x5c\x11\xb6\xdc\xc5\x81\x1b\xc2\xd6\x5b\xff\x45\xcf\xc5\xa9\xb9\x6d\xfd\xd7\x5d\x6c\xe8\xe8\x0e\x87\xbf\x29\x2c\xc9\x52\x1c\xe9\xa5\xe2\x48\xf6\xf9\x03\xbc\xb1\x3b\x85\xae\xf4\x80\x51\x4f\x67\xe3\x58\x6a\x48\x15\x8b\x44\xce\x7c\x89\x55\xfe\x86\xa1\xa2\xb2\xfb\x14\xff\x0b\x73\x1c\xaf\x5f\xf9\x59\xe1\xf3\x25\xfe\x86\xf4\x73\x73\x55\x06\x6b\x28\xe6\x73\xf6\x18\xb3\x46\x39\xb1\x78\x3a\xd9\xbb\x1e\x2f\x01\xf6\xea\x27\xad\x68\xcb\x4d\x6a\xcb\xac\xd6\xae\x5b\xc3\xd9\xa6\x7c\xc7\x6e\xca\xae\xe3\xc3\xa9\x40\x0c\x51\x57\xbe\xf3\xb2\x80\xa6\xbe\xdd\x9f\xca\xa5\x11\x0a\x12\x65\xbd\x8a\xaa\x9b\x37\x2b\x00\xe0\xf0\x07\xd2\x44\x7d\x04\x60\x2e\x33\x40\x8e\xd2\xc3\xaf\x79\xc9\x72\x86\x70\xf3\x92\xeb\x5f\x57\xc9\x4f\x2a\xc5\x23\xc1\x5a\xca\x4b\x34\x52\xba\x3c\xf7\x68\x44\xce\x00\x6c\xbb\x7f\x3d\x85\xb3\xcc\x0c\x72\x37\x1b\x17\xb1\x53\x29\x90\x82\x32\x70\xe9\x93\xd9\xf7\xb7\x40\xf9\x9b\x72\x35\x43\xcc\x39\x20\xff\x3a\xf9\x7d\x07\x3e\x42\x97\x35\x55\x53\xcf\xa3\xf2\xef\xf9\xcf\x98\x3c\x73\xc1\xf4\xb0\x43\xef\x46\x65\xfa\xd2\x91\x41\xc4\xb5\x95\xde\xa8\x1c\xc5\xdf\xfe\xc9\x53\x94\xe3\xa5\x06\x99\xb9\x64\x00\xd1\xaa\xbc\xd3\x90\xd6\xdc\x52\x38\xea\xdc\xd3\x71\x5e\x30\xce\xee\x9c\x1e\x17\x5b\x60\x47\x72\x1b\x3f\x0a\x79\x8f\x48\x03\xa4\xc9\xc9\xb6\xc0\x5c\xb5\xb9\x86\x72\xdd\xf3\x3c\x18\xce\x05\xb8\x1e\x7e\x32\x43\xc9\x73\xa2\x1d\x8e\x1d\xca\xbd\x3c\x60\xe4\xc0\x3a\xbe\x7c\x62\x84\xc5\xc0\x5c\x72\x37\x6f\x6b\x39\x9f\x4f\xbe\x0e\xb5\x3c\x59\x9c\xb3\x76\xbf\xa0\x31\x65\xbb\x50\xc1\x37\xd8\x5b\xa2\x74\x25\xb7\xb5\x1d\x1b\x1e\x25\xe1\x46\xee\x45\x01\xee\xd3\x0a\x67\x25\x79\x70\x4f\xef\x6e\x06\xe1\x7d\xfc\x6b\x6d\x2a\x26\xfe\x77\x97\xf8\x7d\x67\xf6\x2d\xab\xf9\xb1\x5a\x2e\x67\x68\x7e\x0a\x26\xa3\x57\xec\x4b\xd4\xd6\x26\xc1\x98\x7e\x0e\x15\x17\x16\xf7\x37\x53\xbd\x0c\x8c\x31\xd9\x84\xd3\x56\x65\x10\x12\xb7\xf2\xd4\xd6\x40\xc4\x2e\xb7\x21\x44\x88\x64\x02\xda\x19\x5e\xe7\xa6\xaf\xeb\xa5\xff\xb8\x82\xb3\xc7\x2c\x57\xfd\x23\x9b\x18\x36\x7c\xba\xad\xfa\x59\x3a\x1d\x93\xc0\xbf\x11\x35\xbb\xec\x2b\xe9\x6c\xff\x1b\x45\xba\x74\x06\xea\x14\xb7\x87\x77\x4a\x55\x13\x5e\xf6\xf0\x94\x45\x0d\xbf\x56\x78\x4d\x8f\xdc\x4f\xa9\x03\xd0\x86\xee\x7b\x4f\x9e\x10\xc0\xb2\x5d\xb7\xe5\xd7\x4e\xff\x92\xad\x87\x7a\x57\xfb\x4e\x7b\x5b\x5c\x58\x0b\x46\xd6\x37\x0e\x83\xb7\x2b\xf7\x00\xc2\x2d\x24\x8b\xa7\x6a\x47\x2d\x13\xea\x1b\x49\x64\xfd\x5c\x45\xfe\x12\xdb\x99\x29\xa4\x63\x84\x6d\x2d\xe7\x44\xf2\xa4\xf8\x9c\xa4\x6e\x5c\x0e\xaf\x98\xe4\x03\xbb\x3a\x56\x0d\x83\xa4\x5b\x4c\x6c\xd5\x40\x80\x7b\xa0\x16\x41\xc7\x6a\x66\x4a\xa4\x42\x0f\xd5\x42\x4e\x4d\xb2\x0f\x7d\x68\xfa\x97\x4c\x85\x19\xc3\xd9\x59\x1c\x10\xc0\x0b\x4b\x7a\x6d\x82\x83\x55\x85\x83\xdd\x77\xca\xc6\x43\x9b\x98\x78\x64\x15\xfb\x24\x8b\xaa\x09\x90\x2c\x47\x51\x5e\x37\xeb\x6d\x43\x3b\xb0\x84\xfd\x4d\x63\x20\xf1\xd5\xf8\xf9\x7f\x94\xd4\x7c\xbe\xa6\x47\xef\x51\x86\x45\x6f\x28\x11\x2a\x35\xa1\x75\xbe\x97\xe3\xd6\x39\x0b\x78\xa3\xd3\x63\x13\xfb\xe6\xaa\xf9\x5e\xbc\xa8\x6f\xae\xe2\x9f\x2e\xe2\xed\x99\xa8\x5c\xe2\x5d\xf6\xf5\x8d\x15\xfd\x8e\x39\xa2\x97\xbc\xa1\x30\x84\xab\x7c\x51\x2d\xf4\x2b\xb4\x10\x8d\x9a\x42\xd2\xe9\x6c\xf6\xe3\x13\x1f\xb5\xb2\x27\x20\x34\x6a\x6e\x4c\x68\x42\x56\xe7\x18\x36\xb6\xf8\x61\x64\xb3\x55\xaa\xf1\x66\x26\x82\xf3\xa7\x40\x16\x25\x55\x0d\x57\x1f\xa0\x56\x58\xfb\xea\x52\x18\x92\x5b\x4c\x26\xb2\x7a\xf7\xfe\x71\xc9\x55\x35\xb0\x1e\x65\xa9\xb9\x03\xc8\x6a\x63\x6f\x68\xaa\x3a\x9d\xd8\x64\x96\xcd\xb6\xbb\xe7\xc9\x9e\xe1\xed\x54\x3c\x16\x2b\x6e\x13\xc0\xac\x6c\x59\xd0\xaf\x1f\x92\x4e\xc8\x36\xfa\x1e\x1f\x32\xfa\x1e\xbb\xf1\x0b\x3d\xe9\xbb\x46\xb4\x5a\x85\x68\xab\xd0\x24\xce\x99\x2f\x14\x12\x7d\xf6\xf9\x2a\xb5\x93\x90\xac\xf7\x03\xf5\xb2\xc4\xdb\xf1\xaf\x24\x37\xd7\x13\x04\x20\x8f\x87\x4d\xad\x5f\xad\x0f\x4f\x76\xf3\x4d\x19\xc4\xd8\x99\xf0\x5c\x32\x4d\x04\x58\xeb\x37\x4c\x01\x36\x0b\xf0\x6a\xd0\x34\xa0\x51\xe8\xbc\x01\xc4\x29\x37\xed\x8f\x35\xb2\xe3\x75\x12\x73\x4e\xb3\x67\x61\x27\x57\x5a\x72\x28\x4f\xd8\x46\x43\x57\x57\x3e\x6a\x7e\xb4\x4f\xba\xe8\x20\x68\x09\xb6\x90\x27\xd3\xf4\xa1\xb8\x11\xc3\x14\x29\x5d\xbe\x4c\xf1\x11\x7c\x4c\xdd\x5f\xf2\xc1\xed\xb1\xd4\x91\x03\x78\xd3\x69\x92\x97\xfb\x92\xbf\x64\x0a\x60\xea\x27\x8d\x08\x52\x04\x85\x80\x5d\x9e\x7d\x18\x5e\x95\x1d\x94\xc5\x01\xd4\xfd\x29\xc6\xb0\xb3\xcd\x18\x4b\xaa\x20\x09\x9c\x39\x7d\x80\x99\xb2\xfb\xb1\x9a\xf4\x37\x4e\xa5\x35\x9c\x2e\xb9\x88\x82\x03\xc6\x84\xd3\x18\x92\xf5\xa3\xe4\x1e\xf5\xa4\x52\x31\x9a\x04\x38\xa2\x82\xd8\x9d\x24\x84\x87\xca\x13\x1c\x58\x7e\x99\x4f\xa1\x1c\x9e\x18\xd9\x61\xf1\x63\x8e\x1e\x34\x7d\x94\x2e\xf4\xe5\xab\xdc\xba\xb8\xc8\x7f\xd2\xef\xaf\x93\x82\x57\x15\x36\x82\x30\x5b\xa4\x0a\xdf\xdc\xae\x71\x19\x92\x0b\x7d\xe8\x05\x06\x91\xe3\x3e\xa5\xaf\x84\x81\x39\x30\xd6\x0f\x16\x1d\x63\x17\x6a\xdd\xd9\x07\x2f\x74\x27\x6d\x91\x46\x2d\x8a\xf1\x88\xe4\x60\x9a\x15\x76\x87\x12\x94\xcc\xd3\x2e\x4b\x13\x46\x06\xdb\x0d\x00\xd9\x60\x29\xf7\x01\x78\x24\x55\xbe\xa0\xd0\xb2\x91\xc0\x96\xaf\x72\x87\x33\xe2\x45\x49\x1d\xdc\x2c\xb8\xd8\x21\x7c\x4a\xce\xf7\x78\xbc\xd3\x40\xef\x31\x25\xfb\x4b\x6f\x21\x21\x74\xe9\xee\x1a\xf3\xcc\xac\x81\xba\x64\x77\xb6\xe2\xb5\x7a\x9c\x1a\x0a\x89\x0a\x49\xbf\x02\x2c\xb8\x65\x68\x31\xa4\xab\x11\x66\x80\x06\x9b\x94\x0c\xa2\xad\x69\x58\x29\x7c\x05\xe6\xd6\xf7\x18\xca\x6f\xd7\x98\x60\x32\x94\xaa\x9c\xcd\xe5\xa3\x90\x72\x9b\xb3\x82\x33\xd2\x8c\x2e\x30\x5f\xbf\xce\x28\x64\xd8\x02\x1b\x5b\x2a\x89\x74\xa3\x8d\xa9\x41\x9e\x04\xf8\xf3\x4b\x93\x63\x0b\x01\x4e\x73\xce\x4d\x40\x4f\xd1\xfb\xb7\xde\xb3\xb2\x0c\x5d\x54\x31\x38\xe7\x7a\xb3\x82\x09\xd9\xe5\x32\x1a\x33\x84\x06\xd7\xc4\xb9\x46\x76\xb1\xe5\x25\x7d\x29\x1a\xf5\x98\xfc\x06\xd8\x17\xbd\x88\xf5\xfa\xa1\x52\xcf\xc0\x8c\x59\x5c\x2e\xc4\xcd\x4b\x5a\x61\x87\x83\xbe\x1c\xdc\x8f\xc8\x11\xd4\x8c\xa0\x5b\x84\xd2\x00\x28\x99\x39\x21\xb0\x84\x4b\xf3\xe1\xd8\xd6\xbc\xc9\x73\x8f\x86\xc4\x19\x60\x5c\x12\x5a\x2e\xe5\xce\xa8\x4d\xe1\x78\xa8\x03\x7e\x5c\xa2\x39\x61\x6e\x25\x55\xcf\x4f\x7e\xd7\x65\x9d\xbd\x43\x1b\x9a\xa2\xfa\x44\x97\x1a\x5e\xc2\x48\x59\x0d\xff\x52\x62\x26\xe5\x04\x80\x10\x93\x99\x32\x4b\x6c\x59\x27\x7c\x0f\xf1\xf3\xcd\x4e\xc4\x77\x69\x83\x76\xa8\x63\x4f\xb7\x2c\x53\x97\xa3\x36\x4c\x1d\x38\xbf\x7b\x5d\xf9\x51\xba\x39\xb9\x93\xf5\x41\x1b\xe2\xc6\xc6\x7f\xb4\xfd\xde\xa3\xc1\x67\xb0\xf4\x90\x86\xa4\x72\x82\x19\xc8\xb9\x8f\x26\xf8\xa2\xec\xbc\xfb\x6e\xd2\x39\x0c\x61\x51\x6d\xd3\x37\xcd\x91\x04\x51\x3b\x27\xb4\xed\x6a\xe9\xf5\x32\xd6\x8b\x89\x04\xaf\x60\xc2\x9b\x75\x54\xbf\xbc\xfd\xce\x93\x16\x2e\xe7\x46\xf6\xc1\xe9\xa6\x18\xba\x54\x75\x80\x7c\x2e\x99\xba\x87\x49\x30\x81\x6a\xc2\x41\x78\x50\x40\xae\x6c\x1b\xae\xd5\xdd\xd4\x99\x00\xb9\x1e\x54\x3d\xc1\x37\x58\x47\x71\x25\x02\xe7\x63\xf8\x18\xdd\x86\x6d\xa3\x15\x14\xd5\xed\x10\x99\x8c\x71\xb3\x54\x74\x29\xe2\xde\x02\x1c\x7f\x20\x60\xae\x93\xfc\xe4\xf1\xee\x4f\x97\x70\x74\xf5\x2b\xce\xb0\x60\x81\xc5\xcc\x5f\x02\xd0\x8e\x00\x14\xed\x6b\xb8\xbe\x66\xcb\x97\xcc\x15\xfe\x36\x55\x65\xde\x7d\xfc\x5b\x3b\x91\x7b\x78\x48\xb2\xd1\x11\x08\xb6\x4b\x07\x75\x0e\x9c\xdc\x70\x09\xe9\x6d\x8f\x9e\xde\xb1\xbd\xcd\xea\xf7\x5e\xde\x13\xe1\xba\x60\x54\x74\x8a\x3c\x5b\x8d\xd5\x72\x51\x2d\x61\x95\x3e\xe7\x70\x97\xb5\x98\x2b\xfa\x16\xaf\xaa\x31\x5f\x2e\xb0\xbb\x10\x01\x54\x49\xd1\xef\xb4\xe3\x1a\xfc\xcf\xf4\xaa\x7d\x36\x9a\xcf\x5a\xe4\xfd\x5c\x25\x74\x42\xe1\xa7\xaf\xa1\x3f\x49\xfc\x22\x77\xc6\xb0\x78\xcd\x59\x82\x50\x95\xa7\xb5\x0e\xb9\x6f\x9c\x25\x54\xc8\xe9\x1a\xb8\x24\xd0\x3a\x4d\x5e\x81\x2f\x0d\x88\x38\xb7\x2a\x98\x12\xd3\xeb\xfc\x6b\xe6\x8b\x35\xe4\xdd\x61\x38\x8f\x2f\xcb\x75\x8c\xfd\x75\xb2\x67\x18\xe5\x10\x5d\x0c\xef\x54\xc7\x8b\x52\xa3\x0a\xf9\x86\xc2\x54\x5d\x06\xc7\xe5\x25\x2c\x0c\x96\x51\x3d\xed\x59\xca\xaf\x33\x00\x44\xd1\x5a\x28\x1b\xd3\x8c\xcd\x1c\x76\x7d\xbb\x0c\xaa\xb6\x3e\x7a\x0e\xce\x31\xe1\xdb\xd7\x7b\x9c\x2b\x7f\x0a\xfb\xe5\x98\x35\xb3\x41\x02\xd1\x26\x1d\xde\x3a\x73\x12\x5f\x6c\x3a\x57\x7b\xc0\xcf\x4d\x0a\x62\xcd\x2e\x10\x1a\x52\xb7\x0a\x7f\x93\xd2\x8b\xfa\x11\xcf\xaf\xdc\xc3\xaa\xbc\x6c\x43\xd4\x79\x44\x52\x7c\xff\x51\x50\xff\x71\x48\x42\x78\x34\x29\xdf\x7d\x06\x2a\xb1\x47\x66\x50\xc5\x5d\x90\x25\x60\xc8\x55\x9b\x0e\x06\x03\xc2\x93\xab\xfc\xa1\x15\x48\x30\x27\xfb\xfd\x0d\x1c\xa5\x75\xd2\x6c\x55\xbf\x73\x00\xaf\x18\x80\x77\xe5\x01\x4b\x57\xc2\x4f\x89\xf9\xfd\xdd\x77\xc5\xf8\xfc\x2c\x60\x17\x47\xdb\xe7\x01\x9e\x7a\x39\x0c\x7a\xf8\x54\x08\x48\x37\x64\xf5\x13\x2a\x68\x41\xc8\x39\xed\x5a\x10\x46\x9b\x8f\xa1\x01\xc4\x21\x69\x56\x87\xc1\x1a\x0f\x74\xd0\x46\xa4\xf7\x72\xc8\x31\x04\x42\xba\x37\x8b\x0a\x46\xef\xe0\xd3\x4f\xe1\xcd\xe9\xf5\xcd\x22\x83\x76\xf4\x92\x53\xc8\x9f\xaf\x34\xc0\xe3\x08\x8e\xf6\x08\x8d\x93\xa5\xbf\x54\xb9\x16\x1b\x80\xf0\xf9\xd5\xe0\x03\x1d\x00\x9e\x4c\x98\xf0\xef\x9a\x06\x94\x7f\xa1\x0e\xeb\x1f\x61\x13\x2a\x7d\x64\x80\xfa\x83\xdc\xd1\xc2\x6a\xd1\x5c\xd0\x15\x82\xb3\x0f\x0f\x09\x96\x9f\xf3\x91\x34\xa6\x87\xc5\x72\xa5\xf1\x44\x4d\x63\x7d\x98\x2a\x81\x60\xc3\xfd\x6c\x53\xe2\x01\xb5\xb5\xce\x62\xcc\x0d\xd0\x19\x53\x19\x10\xca\x30\xae\xce\xa9\x3c\xd8\x40\xa1\x54\xc7\x34\x52\x39\xc0\xd7\xf9\x3e\x5d\xd4\xeb\xdf\xd5\x3c\x10\x28\xfa\xac\xdb\x70\x30\xdf\x82\xf4\x06\x70\x5c\xa8\x35\x94\x12\xd9\x67\xf8\x49\xcc\x97\xea\x7d\x56\xa7\xcd\xf9\x78\xe8\x4c\x3f\x17\x65\xe6\xcd\x96\xcb\xd7\xf7\xda\x9f\xb2\x3a\xa9\x4e\x20\x8d\xfa\xd2\x4d\x06\xc3\xc1\x63\x5c\xd0\x58\x6d\x5d\x36\x55\x06\xd0\x19\x98\x74\xe8\xcd\x68\x71\x54\xae\xce\x31\x40\xcb\x58\x87\xfe\x5e\x45\x91\x58\xc3\x04\x67\x32\x79\xa2\x61\x13\x55\xfe\xda\xd4\x3f\x01\x9f\xe6\x71\x3f\xe0\x7f\x58\x00\xe8\x59\x2d\xd4\x1f\x25\xe8\xcf\x8b\xd5\x16\xe4\xa8\xa4\x9f\xfc\xb2\x5f\x58\xc2\xbb\xfc\x02\x40\x09\xd2\xe1\x20\x79\x42\x9d\xf9\x1b\xa2\x05\x69\xac\x25\x3b\x4c\x83\x1d\x4f\xde\x59\x72\x0c\x25\x47\x6a\x12\xf9\x76\xc0\x05\xac\xfe\x5b\xde\x66\xef\xbc\xc6\xe7\x73\xd4\x81\xdf\x57\xf1\x6a\xda\x0c\xe0\x1f\x3c\xd7\xae\xaa\x2d\xbc\x01\x82\x32\xe1\x35\x54\x5a\x6a\xe7\x60\x0f\x1d\x02\x42\x00\x6e\xd1\x0d\xc8\x3e\xdc\xeb\xbd\x9b\x99\x47\xb3\x94\xd2\x0f\xd5\xae\x00\x82\x2e\x5a\x5c\xc0\x7a\x68\xfc\xbe\x95\x03\x0c\x74\x61\xf2\xec\x03\x56\xca\x75\x69\x36\xed\x90\xe5\xbb\xc1\xc9\x08\xd9\x5f\x5c\x49\x48\xfa\x1f\x2f\x50\x0e\x49\xc2\x7f\xae\x94\x29\xa2\x48\x25\x17\xda\xa5\x0a\x21\xe2\xfd\xc4\x44\xb4\xff\xc7\x23\xde\x90\xc1\xf2\xf2\x87\x18\x84\x94\x29\xd3\xb9\x9b\x75\x19\xee\xf5\x5d\xee\xa1\x84\x52\x2e\x44\xdf\xa8\xed\xf0\x1b\x33\x18\x9b\x49\xaa\xf5\x10\x80\x87\xa1\x7c\x93\x8b\x91\x80\x2f\x43\x03\x17\x8b\xac\x5f\x84\xd2\x72\xcc\x57\x65\xc8\xea\x88\x0f\xad\x07\x73\x72\xed\x5e\xb2\xe5\xbf\xc8\x8f\xd5\x37\xe8\x6b\x3f\x73\x33\x18\x29\x8c\xe2\x4e\xf5\x15\xaa\xb4\xe3\x11\xb3\x06\xcc\x3e\x27\x1f\xe7\x8b\x50\x7e\x9e\x8d\xc6\xf8\xe0\x38\x61\xe3\xab\x43\x3e\x9c\xad\xaa\x8c\x4d\x49\x0c\x4a\x3c\x9e\x7d\xbc\x1f\x81\x0c\x5b\xab\x3c\xcd\x5a\xf6\x38\xf6\x13\x97\xf6\x21\xca\xaf\x8b\x97\x0e\x32\xab\x35\x45\xf2\x1a\xd0\xec\x5b\x60\x07\xb4\x0d\x81\x60\x67\xaf\x7c\x29\xa5\xca\x16\x88\xd7\x85\x1e\x32\xea\x0a\xcc\xee\x42\x2d\xfd\x5b\x98\x82\xf7\xce\x52\x41\x6b\x56\x82\x5c\xae\x49\xf6\xf7\xce\xb8\xec\x5f\x19\xe7\xb2\x4d\xae\x6f\xff\xe8\xfb\x08\x96\x4e\x8c\x80\x9e\xf7\x83\xbe\x98\xe1\x02\x00\x3b\xf5\xa2\x41\xed\x61\xbd\x35\x55\xb5\x0e\x08\x3a\xf0\x11\x9b\x38\xa1\xf0\x47\xbe\xa4\xd2\x7f\x3b\x3b\x05\x30\xb0\xda\x83\xdd\xf6\xec\x3f\xad\xbe\xf4\x27\x15\x1f\x03\x51\xfc\x73\x2e\xcf\xf0\xe8\x22\xd3\x91\xcf\xf9\x29\x67\x86\x73\xec\x9f\x4c\x0c\x19\x56\xfa\x50\x84\x02\x88\xf9\x3e\xed\xeb\xe3\x8e\xc4\xa8\xca\x97\x91\xff\x5e\x1a\x43\xc1\xb9\xd2\xb2\xec\x50\x0f\x16\xca\xe1\x77\xee\xf5\x57\x21\xfc\xc9\x05\xe8\xb1\x66\xdf\x22\x9b\x39\xc2\xb6\x07\x6d\xec\xac\x33\x69\x40\x45\xe0\x2f\x6b\x20\xc7\x84\xad\x16\x5c\x4d\x07\xef\x10\xb9\x3d\xe4\xd9\x74\x5c\x35\x1b\xe6\xa0\x9b\x94\x08\x37\xe9\x73\x1e\xf0\xef\xde\xd8\x75\x10\x26\x16\xe5\xc4\x85\x23\x7c\xc8\x5c\xac\x7c\x77\xd1\x9d\xf8\x96\x3f\xba\x91\xb0\xbb\x0f\xd9\x6e\x63\xb3\x6e\xc6\x45\xee\xd1\x96\xa5\xf0\x52\x3b\xfc\x91\x2d\x0a\xfb\x20\xac\xa3\xf1\x2c\xe9\x31\x56\xa5\xe5\x92\x61\xcc\xbd\x90\x30\xe5\x6f\x95\x6c\x52\x70\xda\xe9\xd7\x92\x64\x33\x38\x06\x09\xfb\x5e\xd3\xe1\x7b\x2f\x60\xf1\x5d\xe3\xfe\x3b\x45\x51\x9c\x6f\x98\x2a\x84\xae\x43\xb4\x2e\xca\xc7\x3f\x54\xff\xbe\x0a\x87\x70\xeb\xa1\x44\x2a\x8f\xf9\x4a\xe9\x80\xd8\x2f\xd1\xcf\xdb\x97\xb1\xcf\xd5\x87\xf8\xb4\x08\x57\x1d\x3f\xc0\x52\x9e\x3e\xd4\x26\xd8\x6b\x85\x8f\xd9\x45\x2f\xef\xbb\xb2\x24\x00\xf5\x66\x89\x26\xaa\x14\xdf\x84\x7b\x70\x43\xa2\xb7\x80\x06\x8a\xb3\xdd\xba\xf4\xd3\xa0\x1f\x4d\xa9\xdd\x32\xdb\xe2\x5d\xff\x05\x0b\xe9\xe2\xcd\x76\x7d\xcb\x7c\x21\x88\x6c\x81\xe6\x2f\xa5\x87\xb1\xfb\x50\xa1\x56\xe6\x53\xaa\xed\x26\x74\xf4\xd8\x76\x58\x42\xcf\x6e\x79\x20\xcf\xbf\x9a\x0e\xcc\x59\xf7\xdb\x77\x02\xe4\xbc\x67\x85\xad\x79\x45\xfc\x4f\xfd\x17\xfc\x5f\xa3\x10\x65\x42\x40\xf9\xf1\xa5\xd1\xb1\x71\x45\xc5\xe9\x85\x7e\x3e\xf4\x40\x15\xda\xd2\x39\x55\xaf\x22\x81\xfe\xec\xe2\x2c\x97\xa1\x0f\x8c\xb9\xb1\x38\x15\x84\x9b\xf2\x6a\xf7\x30\xbb\x69\x68\xc3\x17\x6c\xb6\x69\x7a\x48\x37\xae\x49\x31\xb2\xa2\x54\x06\x64\xe4\x02\xef\xb0\x23\x0d\x51\x6f\xc1\x60\x43\x2e\x3d\xf6\x34\x46\xe5\x26\x3e\x1b\x02\x7a\x0c\x1d\xae\xbb\xa3\xf9\xcd\xbf\x43\x3f\x06\x77\x17\xdd\x80\x87\x89\x66\xe8\x59\xe8\xc1\x71\x63\x73\xfd\x66\x62\xf3\x9e\xcc\x66\xce\x13\x3d\xe5\x5b\xe1\x99\x92\xbc\xb6\xdc\x85\xa7\x11\xf5\x3f\x9c\x39\xbd\x9d\x46\x14\x5c\xfd\x0b\x0d\xd5\x05\x55\x2c\xa6\x06\x99\xcb\x2f\x8d\x2b\x7f\xa1\x06\x86\xcd\xfd\x5b\x76\x32\xb3\x20\x6e\xfe\x4f\x85\x09\xbd\x09\x33\xa1\xde\xd4\x87\x8b\xa5\x66\x44\xe3\x64\xf6\xe6\x7b\xb0\xd1\x52\x0a\xc0\x46\xb2\x8c\xcc\x9b\x96\x96\x5e\x72\x46\xf9\x1a\x37\xbf\x5b\x60\x22\xd1\xa8\xc1\xb2\x77\x6a\x00\xab\xd9\xa9\xf6\x30\x28\x65\xae\xd5\xf8\x1a\xbb\xab\x83\x61\x42\xa8\x9f\x37\xf1\x8e\x22\xcb\xf1\x96\x40\x33\x62\xe9\xd3\x46\x38\x32\xbc\x76\x7b\x23\x04\xa8\x6d\x11\x10\x30\xb4\xb2\x6a\x07\x25\x47\x95\xaa\x8e\x9b\x40\x8e\x8c\x53\xb0\xb4\xd5\xe1\x80\xc2\x94\xa9\x73\xa0\x6d\x49\x9f\xaa\x9a\x39\x1d\xf6\x72\x72\x56\xc3\xd4\x61\xcd\xc6\x62\xef\xab\x13\x2a\xa8\x4e\xd9\x13\x6a\x0c\xbf\x97\x69\x54\x2b\xa2\x53\xdb\x84\xf9\x91\x33\x0f\xdb\x12\x80\x78\x2f\x63\xa5\x8d\xf5\x18\x7d\xf7\x85\x50\x44\x13\x47\x7d\x89\x44\x54\x10\xf5\x3c\xea\xa8\x03\x9c\x79\xe1\x30\xf6\x50\x26\xde\xfa\x9f\x4b\x77\xda\xa6\xac\x41\xe0\x96\xbc\x5b\x9d\x93\x9c\x5b\xa5\xec\x41\xe5\x5c\x2d\x03\x30\x21\x85\x8d\x2c\x75\xe9\x2c\xa0\x04\xa6\x90\x29\xf8\xd7\xf9\x4b\x6d\x87\xd9\xce\xf6\x25\x54\x08\xdb\xdc\x20\x2d\x44\x6f\x2b\xe8\xdb\x5a\xf2\x80\x8d\xa7\xb4\xf2\x87\x02\x6b\x2f\x08\x0e\x36\x4d\x59\xcb\x47\xa2\xc4\xc8\x02\xc2\xab\xbf\xae\x2a\x5a\x35\x1a\x4a\x89\xf5\xd3\xdc\x85\xcb\xd3\x6e\x4d\x9d\x3b\x20\xad\x99\x3d\xab\x69\x60\x79\x7b\xd9\xbe\x0e\xfe\xa0\x01\x79\xcb\x0d\x87\x37\x56\x02\x5d\x6a\x72\xcf\x56\x86\xeb\xb6\x12\x76\x5f\x79\x17\x4d\xe1\x75\x4d\x24\x60\x88\x27\x76\x9f\xa6\x24\xe3\x62\x6e\x9f\xec\xba\x7b\x64\x04\x16\xfd\x38\x37\xe3\x20\xfb\xc9\xba\xda\x27\xff\xeb\x3b\xe5\xc2\x0a\x80\xbd\xd1\x95\x7a\x5c\x98\xa5\xe9\x7c\x64\x9a\xbf\x4d\xe3\x5a\xde\x20\x16\xf0\x45\x6c\xe1\x57\x75\xc3\xe0\x43\x98\xfd\x67\xba\x93\x79\x4b\x42\x4b\x0a\x57\xbd\x7f\xfa\x4c\xe3\x22\xe7\x86\x3e\xee\x6c\x2f\x0d\xee\xd4\xb1\x48\xdf\xb6\x34\x74\xfa\x3a\x7d\x87\x00\xd8\x48\x5c\xbe\xa4\x5a\xc8\xd4\x9c\xfd\x2b\xd4\xbc\x32\x9f\x1c\xe8\x47\x76\xa8\x1c\xb4\x9c\xd9\x04\xf3\xcf\x34\x03\xe4\xf1\xa9\x11\x5c\x77\x20\xa7\x40\x7d\x3d\x2e\x2c\x70\x3b\xc3\xe7\x20\x60\x54\x03\xfb\xfb\x58\xa4\x5f\x4d\x3f\x3e\x24\xcf\xde\x94\xa9\x98\xfe\x34\xe0\x00\xe0\x2d\x79\x0e\xdb\x69\xf4\xf9\x03\x1a\x02\x81\xaa\x48\x0b\x1a\xb5\x76\x2c\x5f\xba\xe7\xd8\xf9\xf1\xff\xa7\xa7\x25\x2e\x61\xee\x76\x95\x69\x0f\x9e\x6d\x78\xea\xfd\x43\x3f\xaf\xb3\x3a\xd3\xde\x6d\x32\x52\x76\x9f\xb0\x9a\xfc\x92\xe1\xc4\x10\xbe\xd9\xc4\x5d\xf0\x29\xa3\x52\xe5\x3b\xd2\xff\x89\x28\xc4\x7b\xa3\x0b\xef\xee\x3a\xb3\xe4\x30\x25\x52\x73\xb6\xc2\xbb\x7f\xbf\xbc\xbd\x68\x86\x5e\x3f\x6b\xa0\xa6\x36\xcf\x45\x9a\x80\x36\xf7\x54\xa0\xea\x9f\x6c\x83\x9c\x9d\x05\xb6\xca\x7b\xc1\xe9\x2e\x00\x86\xde\x42\x97\xff\x11\x26\xdf\x2a\x0a\x5d\x62\x91\x37\x69\x79\x2d\xd7\x97\x87\xa4\x24\x1c\x77\xfa\xeb\xf3\xea\xbe\xc8\x50\x1d\x4d\x2c\x94\x16\x41\x7c\xd6\xa4\x43\x77\x4f\x40\xb4\x57\x3a\x41\x34\xe6\xa4\x41\x09\xa6\xe2\x72\x28\x13\x75\xbd\xcd\x19\xdc\xca\x98\xa3\x10\x9e\xe1\x06\x07\x00\xe1\x8b\x6c\xf3\xff\x45\xde\xb1\x75\x53\xe5\x7a\x29\x89\x72\x7e\x81\x38\xa0\x77\x50\x1b\x38\xff\xe8\x54\xa6\x00\x67\xb5\xd9\xc4\x0a\x7c\xba\xd5\x8d\xae\x6d\xdd\x64\x39\x5b\xe3\x3b\x91\xc6\x97\x2f\x95\xc3\x8e\xf3\x7e\x67\x0e\xd6\x40\xcd\x48\x59\xca\xe6\xd6\x6d\x93\x09\x8a\x6f\xb2\x35\xb8\x9b\x29\x9c\x26\x9b\xcb\xd7\xba\x01\x89\x81\x7c\x89\xf1\x87\xe7\x77\xd3\xf3\x8c\x56\xa7\xa5\x6c\xd0\x57\x94\x10\x8d\x35\xe8\x9a\x8b\x30\x4b\xc4\x05\x13\x89\x4d\xdc\xc5\xcb\x51\x16\x19\xde\x22\x4f\x6a\x6b\x80\xcd\x49\x9c\xbc\x34\x95\x5a\x65\x4b\x68\x07\x7e\x29\x57\xf2\x27\xcd\xf7\xe5\xf0\xce\x5b\x58\x30\x42\x43\xce\x28\x04\x38\x4e\x44\x49\xe8\x0e\x89\x32\x87\x98\xae\xa4\x8f\xe1\xc2\x65\xe5\xa2\xeb\x5d\x71\x95\xaf\x71\xf9\x70\x02\x02\x94\x94\xb7\xd2\x2b\x5d\xa0\xd4\x73\xdd\xdb\x64\xed\x4a\x9e\xe4\x97\xae\xfb\x6a\xc5\x61\xba\x4f\x50\x19\xac\xfe\x2c\xbd\x72\x95\xa8\xa6\x99\x7d\x68\xa1\x01\x36\x17\x13\x92\xc3\x79\xc3\xb2\x73\xce\xeb\x4e\xca\x29\x6b\x49\x28\x56\x0a\x34\x3a\xc7\x04\xa4\x9f\x9d\x28\x08\x33\xea\xd7\x09\x86\xcf\x91\xca\x49\x8f\x10\x60\x98\xc5\x5b\x07\x35\x11\x90\x55\x50\x0b\xf4\x4a\x9a\xb8\x7c\xdf\xb9\x31\xad\xa8\xe2\x63\x97\x1d\xa3\x68\x1d\x5c\x94\x3d\x68\xfe\x22\x47\x6f\xf1\xf3\x0c\x1f\x06\xbd\x40\x0e\xd7\x22\x19\xed\x6b\xf0\x02\x10\xe3\xc3\xc7\x16\xd2\x94\xf2\x35\xf5\x36\xd9\x97\xb4\x80\x7e\xc7\x56\x6c\xc0\xa2\x2a\x7b\x19\x05\x61\x26\x2d\xd3\x27\xe9\x9e\xcd\xfe\x9f\x2d\xfa\x40\xa9\x32\xf1\x4d\x77\x39\x88\xed\x52\x08\x53\x8f\x85\x1b\x66\xb1\xb0\x00\xf7\xad\x3e\x97\x96\xe6\xbb\x82\x87\xd4\xf3\x9e\xf8\x90\x1b\x89\x20\x4b\x60\x4b\x99\x0b\x29\x63\x09\x65\x1f\x8a\x6b\x8e\xf5\xb8\xf9\x76\xdf\x85\x7a\x59\xd2\x02\x18\x43\xab\x75\xd2\x88\xe3\x66\x68\xc8\xdf\xe0\x81\x7c\xda\x20\x63\xb6\xb3\x4c\xed\xde\x9d\x79\x9a\x86\x5f\xa1\xe5\xcc\x7e\xff\x7f\x27\xf1\x47\x14\xa9\x21\x47\xf3\x5b\x73\x0b\x53\x9b\x51\xad\x61\x78\xe0\xf1\x49\x44\x00\x71\xe1\x46\x50\x09\x64\x61\x1d\x40\x92\x26\x78\x1e\x56\x6d\x9e\x42\xa9\x67\x75\xfb\x66\x1d\x34\xc1\x89\x61\xd6\x8a\x81\x87\x61\xa7\xd4\xaa\x51\x02\x03\x19\xe1\xa3\xc2\x43\xc3\x77\xa1\x2c\x4b\x79\xad\xd6\x0f\xf4\x45\x99\x52\x72\x56\x18\xb0\xd2\x3f\xa8\x37\xc3\x0e\xb8\x6e\x5b\xd3\x48\x72\x1a\x9c\xe9\x98\x93\xb5\xf4\xef\x59\x79\xc3\xd2\x97\x7f\x25\x14\x36\xe6\x93\xca\x49\x66\x8b\x5c\xec\xc5\x72\x28\x9c\xd5\x34\x3c\x24\x9a\x94\xff\x54\x3f\x08\x65\x3f\x4b\x55\x3f\x6b\xa1\xca\x32\x75\x6e\xf9\x7c\xee\x93\x45\x5d\xe6\x04\x36\xff\x96\xac\xa8\xbf\xc8\x9e\x18\xb5\x91\xa6\x76\x13\xf6\xb4\x66\xc8\xd3\xc9\x63\x15\xe3\x9c\xcd\xda\x68\x2f\x6f\xfc\x29\x9f\x55\x89\xbf\x36\x63\xc0\xca\x95\x64\xcb\x34\x06\x23\x6f\x2a\xdf\xca\x63\x91\xf7\x53\xc9\xc4\xd5\x2e\x02\xf4\x0b\xb7\x7d\xef\x80\xf6\x73\xbe\xec\xe3\xd7\x99\x0c\x92\x2b\xc3\xf3\x38\xc7\x6a\x43\xca\x24\x37\x06\x3f\x4a\xa6\xa9\xf7\x3a\x7d\x63\x42\xb6\x80\x3c\x63\xd8\x73\x69\xb3\xca\xde\xb8\x9a\xf6\x7d\xf6\x60\x12\x56\x9d\xea\x1b\xa5\xff\xd7\x9a\xff\xbc\x3e\xb4\xf9\x61\xdb\x87\xa8\xb9\xd1\x7d\x19\x0f\x74\x98\x7b\x40\x34\x2d\xe0\x1e\x10\xb0\x77\x9b\xba\x94\x40\x74\x91\xaa\x5d\x90\xc7\x9f\xc5\xaf\x75\x3f\x8d\x30\xba\x67\xf7\x99\xa8\xf4\x1f\x2d\x97\x71\x16\x2f\x94\x9a\x3e\x41\x3a\xf9\x9b\xc2\xe5\xf4\xf8\xc5\x48\x5c\xd5\xee\x7d\xfc\xa2\x8e\x56\xa1\xf9\x3b\xfd\xaf\xd5\x7a\xf9\xf4\x76\x59\xef\xff\xe6\xe5\xa2\xa4\x1c\xea\x19\xc7\x84\x07\x12\x40\x91\xed\x93\x30\xbc\xc7\xf0\x1c\x04\x58\x79\x14\x40\x0c\xc8\xf8\x0f\xa1\x32\xb2\x73\x70\x14\x99\x55\x8b\x54\x83\x07\x0b\x61\x1a\x57\xea\x1f\x40\xa4\x37\xa9\x39\x03\xea\x89\xa9\xa2\x17\x3c\xa3\x24\x41\x53\xbe\xb2\xa1\x4a\x5f\xe9\xa9\xc6\x8f\x55\xfa\xfd\xad\xd4\xd0\x77\xe8\x96\x2e\x7f\xf8\x9a\x69\x5e\x7a\x83\x92\x3a\xc8\x9b\x84\xae\xd0\x1e\xb2\x42\x67\xab\x7f\xb3\xc5\x98\x65\xb2\x3a\xc3\x65\x47\xf0\x89\x7b\xa9\xd1\x71\x7b\xf9\x0e\xfa\x89\xec\x90\xd5\xfc\x66\x3e\x97\x4b\x00\xb5\x44\xef\xf8\x41\x75\x29\xc8\xae\x98\x68\x8b\x1f\x0b\x59\xc0\x80\x61\x2a\x1c\x38\x96\xd1\xa8\xb1\xdd\x21\x30\xca\x2d\x2e\xcd\x40\x72\xb4\xb4\x4f\x99\x42\xac\x1b\x7a\x3c\x76\xcd\xda\x9a\xb2\x05\x9c\xb4\xa5\x20\x0e\x34\xc1\x3f\x4d\x46\x9c\xf6\x68\xc9\x72\x99\x95\x44\xd1\x16\xcd\x9a\x45\xc8\x35\xbe\x9c\x0d\x76\xb7\x0b\x4a\xc6\x15\x9d\x9c\x26\x48\xbe\x30\x6b\xff\x44\x62\xd2\x54\x53\xe1\x86\xff\xb2\xb8\x90\x58\xab\x23\xf3\x1a\x89\x6e\x85\xa0\x3d\x5d\x6d\x6e\x6c\x03\x85\x08\x7a\x82\x10\x42\xf8\x55\xa2\xe3\x43\x85\xa8\xb4\x94\x23\x57\x7d\x97\xe5\xc1\xf1\x1b\x1a\x3b\x38\xa7\xb1\x7c\x5c\xd2\xc9\xa9\xa3\xfe\x3c\x56\xf8\xb2\xaa\x23\xdc\x6f\xf2\x67\xfe\xc9\xa7\x6e\x2f\xed\xdc\x8f\xcc\x5a\xdf\x5b\xf4\x76\x61\x2f\xe9\x86\x0c\x53\xff\x8a\x5e\xb5\xae\xdd\xe0\xb6\xcf\x5b\x13\xc1\x92\x66\xed\xe9\xad\xc5\xaa\x9b\x41\x0d\xd6\x37\xde\x1a\x53\xab\x72\xd9\x55\x48\xca\xb9\x4b\x74\xc2\x51\x8a\x57\xcb\xce\x05\x48\xe5\x6a\xc9\xc8\x4f\x49\x4b\xd9\x8a\x9d\x4b\xc3\x0f\x4c\x3d\x9b\xc7\x64\xd9\x6c\xb0\x06\x4b\xdc\x8d\xc2\x55\x93\x28\xd9\xdc\x64\xc0\xfe\xf8\xe0\xb8\x1e\xd9\x70\xd5\xfe\x82\xae\x42\xfe\xcf\x12\x4b\xd0\xca\xdf\x25\x06\x09\xb3\x06\x66\x50\x1f\x10\xd7\x85\xf3\x78\x57\xb2\x54\x59\x2a\x35\x3a\xb7\xeb\x40\x0e\x43\x31\x27\x15\x67\x73\x4c\xbd\x72\x95\xe3\x8c\xf6\x4d\x75\xfe\x87\x3a\x93\x52\x27\xb9\x7b\x7b\x6d\xd2\x2b\xf9\x70\xf5\x99\xe5\xad\x28\x7b\x59\x37\xb5\xe9\xe1\xce\xfb\x31\x52\xd6\xfc\x8d\x7d\xa9\xd6\x3a\xf3\x65\x17\xfe\x3c\xdd\x11\x92\x97\xcb\x18\xa9\xd3\xfb\xf2\xea\xf5\x44\x53\xe2\x15\x58\xb4\x84\xaa\xc8\x09\xa8\x64\xe0\x95\x35\xb4\x9d\xb3\x20\x79\xdb\x05\xc0\x83\xf3\xc3\x71\x50\x5d\x6f\xcc\x6e\xf0\xe0\xc2\xb6\xb8\xeb\x6a\x74\xb4\xed\xbf\xb5\x74\x56\x75\x81\x4e\x74\xb7\x5c\xc9\x42\x54\x22\x85\xb2\xba\x52\x8f\x2b\xc1\x12\xb3\x7d\xff\xa5\x4f\xde\x77\xe3\x4d\x28\xdb\x47\xbd\xe6\x37\xab\x36\x20\x8d\x8a\x47\xba\x9a\x40\x6e\xa8\x2d\xfa\xc3\x9d\xf8\xad\x6a\xfe\x96\x5c\xcb\xce\x49\x04\xc6\x58\x28\x6b\xfd\x00\xb0\x22\x9f\xb3\x73\x9a\x43\xfd\x72\x25\x3e\x4a\x58\xdd\x2a\x68\xbe\x49\xa4\x84\xe8\xdc\xfd\x6a\x42\xcd\xdc\x14\xe2\xeb\x54\x95\xa1\x95\x7f\xdc\xb9\xf5\xce\xe0\xc8\xdf\x57\xcb\x09\xb4\x78\x4d\xb6\xd7\x48\x70\x56\x78\xf5\x95\xc2\x8c\xa9\x9d\x93\x31\x83\x6c\x6c\x60\x14\x90\x56\x40\x6c\x02\x6c\x13\x21\x98\x6a\x82\x71\x3a\x33\x82\xf7\x81\xb5\xd9\xd8\xab\xa9\xf9\x2f\x72\xb7\x4d\xa8\x0a\xd0\x78\x76\xa5\x6b\x18\xff\x1b\xa5\xfb\x41\x92\x43\x4a\x0f\xc7\x6d\x18\x25\xbf\xe9\xed\xb1\xe8\xee\x6c\x4d\x8d\x1c\xc4\xb0\x85\x1d\xfc\xe8\x63\xe9\x8e\xf2\xaf\x73\x17\x53\x4a\x77\x1e\xf2\xd2\x15\x24\xc7\x98\x5e\x78\x6c\x3a\xf7\x72\x52\x77\x23\xf8\x66\x1b\x6d\x77\x14\xa2\x5f\x90\x2d\x2c\x79\xaf\xf3\x37\xe7\x6c\x7e\x95\xc4\xfe\x9a\x99\xc4\x69\x2b\x25\x6b\x95\xaa\x7a\xa8\xcc\xa0\x0e\x8b\xb5\x10\x99\x86\x95\xbc\x46\x30\x60\x11\x31\x27\xc3\x87\x45\x01\xe6\x62\x0a\xdd\x8e\x66\x24\xbc\x79\x4a\x6f\x35\xa5\x9e\xa7\x9c\xd6\x9e\x4b\xa0\x2d\x9e\x0c\x15\x3a\x81\x9f\x90\xf8\x71\x31\xfe\x73\x1a\x6f\xf6\x73\x76\x8f\x38\xc0\x21\xed\x71\xda\xae\x4e\x7a\x4d\x3f\x8a\xc5\x3f\xa0\x13\xfb\x71\xa6\x7a\x11\x7f\x30\xe3\x9b\xbe\x8c\x9a\x39\x24\xdf\x2b\x21\x58\x9a\x20\x95\x10\xcc\x56\xe9\xd5\x24\xe3\x36\x32\x54\x58\xa1\x1b\x5c\xb3\x25\xbe\xa2\x0b\x00\x54\x95\x19\xb7\x2c\x84\xc2\xf8\x8f\x0b\x3b\xa0\x41\x2c\xcf\x95\x7a\x3a\x0d\x44\xd7\x5a\x5d\x31\x78\x44\x01\x4b\x6c\xfe\x11\x3f\x9a\x20\xbd\x0f\x39\x64\x39\x4b\x51\x13\x7e\xd0\xfd\xb8\x55\x27\xa9\x0d\x5a\xc8\x6a\xae\x7d\x42\x77\x6f\xa0\x48\x1b\x64\x7a\xd9\x4a\x3b\xf9\xe2\x02\x15\x61\xb6\xa8\xac\x12\x4a\x00\xc2\x1d\x5d\x6e\xe1\x68\x9f\xd5\xbe\x4c\x89\x8d\x04\x14\xa3\x1b\x08\x5f\x2a\xb7\xcb\xa6\x7b\xa9\x14\x02\x62\x7c\x3e\xc6\xf8\x38\x98\xd4\x70\x41\x75\x6b\x26\xa3\xc0\xea\x3c\x2b\x04\xf9\x11\xcf\xc4\x18\xbd\xef\xab\x37\x15\x04\x7a\x77\xad\x36\x33\x9b\xaa\x5a\xcf\x7d\xac\x8e\xa8\xa3\x2f\x19\x0c\x0e\xa3\x5f\xa4\xb5\xf2\x59\x2b\x76\xf1\x29\x6c\x9e\xf8\xe1\xd1\x6a\xaa\x77\x77\x11\xfb\xbf\xeb\x65\x63\x07\x68\x53\xaa\xe8\x2e\xc9\x6f\x63\x71\xb2\xb7\x53\xbe\x5c\x9f\x52\x06\x2f\xf3\xd5\x89\x28\x8c\x4a\xb9\x1f\xef\x77\x4e\xbf\xc0\x6a\xe4\x4f\xd3\x66\xc5\x93\xd3\x64\xe9\xd3\xee\x07\x55\xcb\x52\x42\x25\x40\xe2\x6f\x75\xf4\xe8\x7f\x87\xf8\x66\xcf\x1a\x35\x8e\xd4\x73\x23\xd4\x95\x8c\xd7\x60\xe7\x3b\xa9\x97\xee\x26\x76\x63\x29\x8d\xf2\x1e\x86\x31\x07\x90\x94\x76\x26\xdc\xd9\x09\xe4\xd0\x53\xf9\x6f\xe4\xbd\x25\x05\xe6\x54\x12\x0a\x5d\x4c\xfc\x3e\x53\x54\xe4\x6d\xed\xc7\x95\x70\x27\x24\x1e\x84\xa5\x57\xe5\x66\x2d\x04\x93\x3f\x5a\xb4\x4f\x49\xb1\x50\xe3\x3f\x32\xd7\x60\x93\x2a\xdd\xdd\xba\x30\xe8\x5a\x3f\xb5\xcb\xb7\x9f\x97\xd5\xeb\x17\xd9\x3f\xc6\x98\x9e\x48\x56\xe4\x74\xcc\x2b\x25\x76\x6b\xa7\x00\xa5\xc2\x7d\x12\x6c\xa3\xc4\xff\xb2\xfd\xb6\x18\x33\xb6\x84\xdc\xc6\x6a\xd4\x9b\x1c\xa0\x76\x92\x6c\x21\xb0\x9a\x07\xda\xa2\x09\xdd\x3b\x78\xb5\xb5\x47\xd9\x45\xf7\x70\xea\x4c\xd9\x4a\x47\x15\x2e\x6f\xd3\x2a\xcc\x70\x10\xb8\xa6\x0a\x8d\x82\x3c\xb3\x0a\x37\xd0\xb5\x4c\xc7\xb2\x3a\xf3\x61\x32\x79\x5f\x65\x58\xf2\x2e\x43\x25\xd8\xde\x0c\x5a\xcc\x4d\x74\x09\x01\x7f\x31\x18\xa0\xe4\xd7\x6f\x75\x71\x9a\x28\xbf\xcb\xe1\xba\xde\x9c\x6d\x07\x6e\x7b\x4a\xbf\x91\x6b\x97\xb3\xa7\x4b\xee\x6c\x8e\xff\x34\x44\x60\xa2\xa3\x34\x7e\x4c\xbb\xfb\x95\x3b\x84\xc9\x6f\xec\x4c\x96\xff\xe7\xdf\xd8\x04\x30\xb1\xe4\x02\x5b\xfa\xb9\x99\x18\x96\xed\x64\x5a\xee\x24\x27\x4a\x82\x89\x69\x16\x0a\x07\xa3\x75\x1b\x2b\x09\x8b\x09\x7a\x1b\x04\xf7\x25\xfc\x49\x94\x7d\x4f\x6d\x26\x8e\x8b\x3f\x1b\x23\x0d\x06\xa4\xaf\x23\x38\x21\x51\x02\x0b\x9a\x31\x47\x68\x82\xa6\x2e\xd9\xe1\x2c\x04\x36\x79\x47\xbc\x58\xff\xf1\x25\x69\x17\x99\x0c\x7a\x05\xcc\xbc\x47\x18\x33\xec\xbd\x06\xa8\xc7\x30\xd8\xcc\x47\xa3\xce\x60\x91\x95\x7b\x46\x9d\x41\xc3\x90\xcf\xed\x61\xce\x6d\xbe\x59\x32\x1a\xf8\x1d\x00\xc9\x57\xf9\x8c\x4f\x1d\x10\xaf\x91\xdd\x5e\xbe\x43\x0c\x4a\x4b\x36\xb8\xfa\x39\xc9\xf6\xe9\xca\xce\xd7\xe9\x74\xf3\x4a\x86\x0a\x5e\x02\x05\x61\x23\x5f\xf5\x3f\x4b\x41\x16\xe2\xbb\x5f\xc9\x70\xc9\xde\xb3\xfb\x1c\xc7\x76\x39\xf9\x00\x54\x33\x84\x34\xcd\x2c\xd7\xea\xc9\xd4\x35\x8e\xcf\xba\xba\x8e\x5f\x4e\x21\x5d\x84\x2c\xc2\xbf\x5b\xb6\x97\xb1\xe5\xa3\xc9\xf9\xc3\x67\xcb\xea\xaf\xf6\x61\xf6\xa2\xc1\x6b\x0a\x3f\x92\xa3\xf7\x25\x74\xa4\x77\x67\x1d\x1c\x95\x05\x76\x4a\xf8\x50\x1e\x71\xbc\xaa\x01\x03\xd0\x62\x74\x4d\xcd\x3a\xc3\xce\x25\x90\x80\x4c\xff\xf0\x2d\x10\x48\xdc\xaf\xe0\xfd\x55\x73\xa1\xf7\xa8\xe7\xf5\x6b\x97\xd4\x19\x0d\x3f\x67\xb0\xf8\x08\x41\xcb\x5f\x1a\xdc\x98\x18\xe9\xcd\x3c\x8d\x20\x1f\xe7\xaa\xb8\xc9\x91\x99\xde\xd4\x50\x29\x38\xd4\xe4\xd6\x63\x39\x40\x6b\x38\x90\xf5\xdb\x0f\x41\xd3\xe7\xca\x79\x64\x8b\xd4\x7d\xd3\x61\xfc\xcd\x6b\xf9\x75\xc5\x89\xdd\xc3\xc4\x9d\x4c\x0f\xad\x8e\x71\x17\x18\x82\xe9\xf6\x27\xfd\xa1\xe5\x5c\x39\xac\x79\xbf\xc4\x0c\x61\xd5\x80\x3f\xb1\xb7\x71\xea\x9a\xb0\x2c\xdb\xe4\xcb\xbf\xd1\xb8\xb9\x0e\x96\xf3\x53\xed\x53\x22\x16\x54\x53\xac\xc1\xf9\x5f\xf2\xeb\x92\xbe\x9b\xae\x81\x32\x4b\x86\xa0\xe6\x3d\xfc\x5b\x1e\x3a\x1b\x2c\x9f\x5f\x55\x05\x16\xdc\xd8\x78\x94\x7a\xd8\xfb\x85\xa9\xef\x7d\xae\xd3\x52\xcf\x4c\xbe\x92\x8f\xb1\xf2\x50\x35\x71\x93\x43\x12\x7f\x01\xe5\x03\xab\xf8\x15\xc4\x09\xa4\xb8\x5c\x07\xe3\x3f\x34\xd1\xa4\xf2\xd3\x5e\x62\xe3\x3f\x21\x4e\x0b\x25\x80\x92\x90\x48\x91\x5c\xfa\x08\x66\xf1\x41\xa6\x9b\x55\x05\x26\x10\x37\x31\xf8\xa2\x6c\xd8\x8f\xd6\x1d\xc5\x15\x7b\x48\xd8\x3e\x9b\x5a\xaf\x06\x3f\x50\xc3\xf4\xa3\x85\xc4\xf1\x6d\x45\x11\x0d\x86\x15\xa5\x53\x4c\xaf\x2b\x04\xf0\x72\x5d\x8a\xfb\xa0\x40\x08\x91\x0e\xca\x9a\x94\x7f\x08\xe8\x63\x61\x91\x1d\xa6\x2c\xe9\x94\x87\x99\xff\x75\x81\xb9\x7c\x28\xed\x0a\x64\x7f\xf4\x7c\xc1\xae\x93\x14\x80\xcc\x52\xb5\xea\x05\xe2\xe7\xe4\x47\x28\xc0\x51\x5a\xe7\x49\x71\x08\xdd\x7c\xde\xb0\x90\x84\xe2\xad\x86\xe1\xd5\x18\x77\x3e\x9d\x02\xcc\x2c\xd7\xd0\x26\x3e\x43\xdc\x76\xf3\x41\x07\xab\x6f\xd1\x60\x4b\x0c\xfe\xe5\x8d\xa0\xd5\x7a\xde\x38\x8f\xa6\x15\x76\x6f\x49\x8c\x04\xfa\xdf\xc4\x81\xb6\x9d\x92\x09\x84\x7f\xc3\x38\xaa\x04\x8f\xa7\xd4\x07\x48\x52\x98\xa9\xe4\x3d\x53\xba\xeb\x46\x24\xe1\x70\x53\x99\xc1\x22\xe2\x6c\x47\x63\x09\x77\x4b\x90\x70\x19\x5a\x44\x06\x16\xbe\x97\x39\xbc\x38\xa2\x5d\x5f\xf2\xba\x2c\x7f\xf6\xe7\x96\xfb\x41\xdf\xc2\x73\xe3\x10\xd6\x35\x86\x3b\x01\x3f\x31\x6a\xfd\xf1\xeb\xfd\x8c\xcb\x5f\xbc\xfe\x0f\x86\x40\x38\x64\x7f\x04\xab\x29\x75\x86\xd3\x96\x9f\x74\x11\x27\x7f\x6a\x91\xcc\x66\x73\x1c\xb3\xd4\x1e\xb2\x3e\xc4\xb8\x30\xcb\xbf\x5d\x75\x45\x14\x19\x14\x34\x30\xd3\xc0\x66\x5d\xb2\x9b\xda\xbf\xcb\x8a\x57\x05\x51\xa3\xb4\x50\x9b\x05\xab\x64\x70\xf2\xa8\x93\xba\x54\x0b\xb3\x9b\xb8\xe5\x0a\xf6\xe0\x0d\x08\x2e\x78\xe8\x89\xaa\x08\x11\xf0\x0b\x3d\x58\x0e\x5c\x33\x12\x21\x3c\xeb\xa2\x22\x9d\xe6\x2b\xc6\x76\x1e\xd0\x44\x55\x20\x2b\xcb\xe8\x6a\x27\x02\xe1\x20\x67\xd0\xbf\xc2\xe2\x0a\x02\x33\x9c\xe2\x3f\xf8\xe5\x3d\x04\x3f\x94\x4b\x4b\x49\x50\x45\x6a\x74\xc7\x3a\xda\x49\x28\x07\xc6\x87\x07\x4a\xf7\x6c\x1b\xa7\xfb\x24\x27\xd8\x92\x0e\x6e\xd1\xb0\x46\x8e\x06\x85\x2c\xdc\xe9\xa4\xc2\x8b\x0f\xe3\xca\xe5\x65\x31\x17\xf7\xca\x1f\x9e\x2a\x82\xa6\xa7\x12\x54\x90\x15\x7e\xf2\x27\x80\x81\x60\x9a\x70\xea\x8e\xf1\xb7\xdb\xbe\xa7\x53\xe2\x4e\x82\xa5\xdd\xd9\xb8\x10\x84\x46\x1a\x1f\x61\x50\xe0\x73\x73\xd5\xb3\x1f\x77\xdb\xe6\x44\x4e\x4f\xfc\x44\x20\x89\xcb\x7d\x0a\x4a\x68\x59\x39\xf7\x1a\xde\x07\x2d\xa2\x95\x50\x53\xb5\x7b\xe9\x40\xe8\x8f\x01\xbe\x1f\xa1\xbe\x21\xf3\x63\xa8\x23\x44\x72\xbd\xc1\x5a\x53\x49\xf9\x18\xfa\x49\xa7\x08\x3a\xea\x1f\x99\x7c\xb8\xb9\xdd\x14\x34\x08\xc3\xa9\x91\xa6\x3b\x5d\xe7\x7f\x9d\xd4\x87\x2e\x7e\xa4\xea\x16\x58\x08\x30\x62\x0a\xce\x0f\x58\xdc\xa7\x47\xfe\x38\x0f\xc2\x1c\x17\x19\xfb\x5e\x3f\x02\x41\x0c\x5d\x30\x94\x0f\xea\xae\x0c\x3e\xa9\x5b\x3d\x86\xa6\x30\x75\xdb\x97\x00\x1d\x96\xfa\xa3\x65\xb7\x99\x00\x44\xe5\xc0\x25\x94\xb3\xad\x58\xd2\xf0\x3f\x4a\xcd\xe7\x35\x68\x93\x53\xab\xfc\xb4\x39\x75\x01\x41\x4b\xd1\x87\xa7\x52\x73\x25\xe4\xd9\x6d\x7f\xb0\x27\xd4\x45\x21\x65\xd2\x8f\xa5\x51\xd9\xf9\x5f\x67\xe9\xa7\xc6\x97\x50\x4f\x68\xc8\x90\x55\xb6\x7d\x22\x3d\x74\xc2\xcd\x06\xf8\x61\x5f\x82\xa6\xbc\x28\x33\xc8\x86\x17\x50\x83\xf1\x94\x12\xed\x0a\xc9\x81\x3d\x98\x3a\xdc\xd4\xe7\x65\xe2\x1b\xd2\x50\x7c\xf8\xe0\x3c\xf5\x6b\x19\x78\x48\x18\xf8\xf0\xfd\x95\x5c\x5d\x22\x8a\x1b\xf1\xfc\x14\x84\x5a\x2c\xde\x16\x32\x07\x4a\xbb\xbb\xb0\x16\x9b\xc9\x4f\xc1\x6a\xaa\x51\xa0\xfc\xb1\xae\xee\xd3\x20\xc1\x29\x9e\x48\xbf\x8c\x57\x6f\x22\xe8\xb0\x18\x15\x90\xdf\x63\x67\xd0\x21\x16\xf6\x15\x2b\xd9\xeb\x7b\x0c\x6c\x01\xf1\x7f\x6f\xd6\x38\x81\x3c\x14\x6a\xa5\xdc\xfa\x3e\x3b\xff\xaf\x91\xb6\x6e\x9b\xf2\x64\xbc\xe9\x17\xe7\x13\x49\x89\x30\x30\x89\x01\x44\xcc\xfc\x6f\x97\xe3\x7e\x03\x99\x40\xdf\x69\x25\x29\x05\x1b\xd9\xcd\x40\x77\x5e\xb5\x8a\x83\xe5\x13\xe5\x8c\x2a\x04\xa3\xd8\x45\x88\x55\x5f\xb9\x12\x4a\x72\x4b\xf1\xa7\x14\x56\x1e\x18\x3b\x26\x7b\xf6\x01\x78\xf7\x78\x99\x6a\x06\x03\xc6\xbf\xc0\xb8\x7a\x26\xe4\xa4\x66\x96\x29\x4e\x61\xe9\x0b\x63\x6a\x05\xe7\xff\x4e\x5e\x2b\x46\x84\x53\xdd\x80\xae\x96\x3b\x77\x4b\xee\xc3\x32\x33\x94\xa6\x4a\xe9\x64\x53\xb2\x2c\xb9\xce\x1d\xbd\x46\xfe\xc2\x4c\x71\x32\xbd\x12\xf7\x4b\xf4\xa9\xf3\xdb\x22\x8d\x65\x79\x46\x66\xdb\x83\x7c\xd6\x39\x91\x9d\x6a\x96\x2b\xeb\xd5\xbd\x27\x78\x3d\x54\x98\xa5\x9b\x68\x8d\x08\x81\x20\x87\x10\x43\xd5\x52\xb2\x64\x25\xb7\xe5\x3b\xb1\xca\x56\x02\x64\xa0\x7c\x1a\x34\x4a\xfb\x33\x9b\x2a\xb1\x39\xd7\xa2\x7e\xda\xf8\x2f\x4d\x43\xeb\xb9\xda\x60\x97\x34\x14\xc3\x2c\x2d\xc1\x50\xdf\xa2\x4d\xdd\x87\xe1\xd8\x3d\x70\x85\xa0\x15\x05\x87\x98\xda\x0c\x4e\xe0\x7a\xc8\x32\x2f\x4e\xd6\xcc\x58\xda\x7c\xaf\xcb\x97\x5c\xe3\xba\x19\xd7\x88\x3b\x4d\x1d\x78\x62\x50\x1f\x3d\x5f\x93\x85\x73\xc8\xe8\xc9\xa9\xb4\x64\x6b\xe3\x23\xab\xbd\x1b\xda\x8e\x79\x7b\xf7\x0f\x75\xef\x96\x6a\x2d\xb4\x8c\x7e\x53\x50\x5c\x2a\x7f\xe1\x31\x24\x71\x2f\xe0\x49\x77\x64\xf3\x2a\x69\x25\xee\x29\xfd\x18\xbd\xe9\x39\xf3\x93\x9d\x85\x8a\x98\xc7\xe9\x29\x2e\xe5\x2e\xaf\x05\xfa\xd3\xdc\x02\x75\xb8\xdb\xaf\x19\x3a\xd9\x65\x3f\x29\xc3\x2a\x57\x09\x12\x6e\xad\xc1\x05\xeb\xd5\x12\x1e\x63\x8a\x6f\xa3\x54\x4e\xeb\x53\xe7\xc1\xfd\x78\x4d\xe7\xf3\x53\x02\xcb\x19\x87\x0c\x1f\x2a\x67\x96\x25\x1d\xee\x3d\x40\x23\x7c\xb0\xb7\xd3\x59\x5a\x3c\x98\x7f\x12\x02\xff\x44\x55\x7f\x43\x3e\x65\xee\x10\x08\x18\xe6\xfe\x8d\x0c\xd5\x21\xc9\x8e\x7b\x31\x24\x81\xb2\x32\x9b\x91\xfc\x0d\x86\x08\x65\x97\x30\x33\xdb\x3a\xdb\xc5\xd3\x63\x93\x59\x49\x16\x77\x7a\xc8\x73\x23\x62\x65\x7e\x54\xc4\xa1\x92\x15\x96\x38\x82\x1c\x6a\x26\x5f\xce\x0d\xdd\x45\xe4\x8c\x3c\x66\x94\x08\xc7\x90\xee\x96\x76\x8a\x13\xfd\x61\x6c\xe0\xe3\x84\xf0\x44\x0a\x27\xe9\x1d\xa6\xc3\x4a\x10\xe8\x2b\x7d\x21\x0c\xb1\x28\x7f\x57\x24\x86\xf0\x1c\xa8\x7c\xe8\x92\xd9\xec\x9e\xaa\xdc\xcb\xe7\x4b\x24\x24\x66\xf0\xe0\x33\x18\x5c\x71\xaf\x4d\xcb\x92\x14\xbc\x55\x40\xdc\xe1\x6d\xe4\xae\x66\x1f\xdf\xcf\xbd\x8f\x79\xc8\xbd\x37\x2e\xef\x5e\x4a\x39\x4b\x38\xf0\x3c\xb5\x0a\x94\xf2\x9d\x73\x25\x03\x95\x2a\x50\xc0\x67\x6d\x61\xdf\x43\x24\x85\x90\x87\xec\x61\xa2\xa3\x25\xfe\xc4\x04\x0e\xb1\xcc\x7f\xa6\x98\x86\x9f\x34\xee\x87\xf8\x0b\x5b\xd8\x65\xf5\x54\x8a\xd9\x59\x6f\x1f\xbc\x57\x79\x59\xa3\x02\x64\xba\x92\xcb\x45\xab\x9f\x59\x03\xbd\x24\x3f\xd1\x33\x00\xe1\x3f\x0c\xac\xc7\x92\x10\x0d\x72\x3c\x50\x2f\x93\x2f\x03\xb3\x21\x3f\x17\xa2\x73\x7a\xec\x2e\x55\x36\xa5\x43\x7f\x4a\x96\xaf\xcc\x03\x47\xba\xd3\x0c\x34\x49\xea\x54\x7e\x5c\xce\x2f\x17\xec\xaa\x15\x62\x79\xa8\xe8\xda\x10\x9f\xb8\xbd\x02\xaa\x08\xbd\xca\xe8\xfe\x0b\xa0\x58\x5b\x92\x53\xff\xcf\xec\xfe\xff\xe5\x39\xf1\xef\x4e\x8e\x3b\xed\x3f\xb2\x51\xca\x6f\xc0\x76\x33\xd7\xd4\xb3\x38\x74\x26\x83\x7f\x59\xd6\x73\x9e\x43\x10\x22\xe0\x00\xec\x30\x9e\xfb\xed\x6a\x36\x8a\x4d\xb1\xb1\xb5\x75\x53\x57\x31\xe0\x87\xf9\xd3\x96\xd2\xe7\xf6\x3f\xe9\x44\xeb\x31\x34\x04\xa3\x37\xf8\x04\xf0\xe7\xa6\x1c\x24\xf8\x9f\x53\x9d\xb1\x41\x6f\xb2\x4e\x2e\x41\xbf\x38\xa7\xca\x01\x2d\x47\x19\x6f\x9b\xf1\xa8\x79\x77\x9d\xc1\xdf\xd8\xe1\xe3\x11\x9a\x66\xe9\x3a\x9a\x21\x1a\xfd\xbe\xd1\x78\x9a\x80\x19\x81\x58\xd1\x43\xcf\xd0\x94\x8b\x2a\x0e\x5d\xd5\x21\x2e\x39\xe7\x84\x03\xc4\xa4\xc8\xbf\x25\xce\x03\x77\x4a\xaa\x28\x53\x8a\xbc\x05\xdb\x80\xb4\x08\x86\x23\xd9\x71\x7b\x1c\xdf\x63\x4b\xd9\x4f\x8d\xb8\x17\xc2\xb4\x5f\xe8\x95\x6b\x67\x9f\x8a\xae\x22\x83\xf2\x81\xe5\xdd\x4f\xad\x8a\x16\x8c\xdf\x29\x4a\x61\x5f\xd4\x05\x96\x6c\xee\xd8\xad\xd2\x76\xe3\xd4\x63\x0e\xb9\x5c\x8c\xdc\x23\xe7\xf8\x94\x7f\x81\xdd\x9d\xe3\xec\xf7\x2e\xcc\x8b\x50\x64\x88\xcb\x40\xda\x68\xf5\x89\xfe\x92\x66\x3c\x0c\xf8\x38\x7a\xc1\x1e\x01\x01\x32\x91\xa2\x0e\x6f\xdd\x4b\x8b\x61\x7a\xb9\xf2\x71\x08\xba\xa3\x76\x97\xf2\xaa\x59\x0e\xc7\xa9\x14\xa0\x64\x27\x34\x2d\x0d\xe7\x09\x2c\x74\x13\x90\xa5\xb2\x2f\xee\x77\xfd\x4e\xf2\xa1\x54\x56\xe3\xa6\x62\x71\xdf\x77\x59\x46\x84\x70\xd5\x45\x09\x30\x60\xd1\x77\x96\x53\x37\x7d\x1f\xd2\x54\x73\x9f\xc2\xf0\x88\x14\x8a\xdd\xfe\x25\xfb\x24\x13\xbc\xa7\xe8\x17\x68\xd0\x01\x05\x59\xd5\x39\xd5\xb1\xb3\xf1\xb8\x52\x18\xa7\x36\x76\x3a\xdc\x7b\xff\x2d\xfd\x5b\xc1\xad\x44\x99\xa3\x64\xdf\x4c\x51\x5a\xf6\x23\xbc\x9c\x67\xa7\x32\x22\xc1\x26\x0c\x1f\x90\x15\x6b\xb3\xef\x69\x1e\x65\x9a\xe4\x2e\xef\x16\x0d\x5b\x68\x81\x3a\xa7\x99\x2d\xe6\xb8\x5d\x5c\x95\xad\x1e\xfc\x50\x21\x54\xee\xb9\x41\x14\xb6\x6a\x5f\xf6\xb0\x5e\xf1\x8c\x7e\x0f\x56\xf1\xd6\x97\x7c\x43\x19\x0f\xfb\xe4\x5c\x2d\xfe\x5b\x28\x67\x21\x88\x64\x39\xb9\x63\x56\x6f\x60\xcd\x66\x6f\x37\x61\x1f\x0f\x53\x3f\x2c\x58\x01\x55\xec\xba\x71\x80\x7a\x4c\x9e\x0a\xaf\x46\x63\x4a\x4c\x6b\xeb\x07\x4e\xa1\x64\x38\x51\x72\xaa\x96\x66\xa4\x6a\x7d\x49\xfe\x2a\xd4\xba\x69\x73\x22\xa2\x6c\x56\x27\x69\x35\xe6\x7b\x2d\xb1\x2e\x1a\xf1\x65\xcd\xd6\xce\x1a\x98\x79\xa0\xb6\xb4\x65\xd6\xaa\x5a\x00\x8f\xa7\x94\xed\xf4\xfa\xe2\xcd\x62\x57\xb6\xb5\x9f\x5e\x76\x38\xf7\x08\x9f\xde\xe6\x5e\xee\xec\xf9\xa5\x90\xd0\x20\xc2\xb2\xf3\xd3\x97\xde\x66\x81\x95\x17\x44\xba\xad\xdf\x45\x8a\x81\x3b\x3e\xcf\x52\xfc\x2b\xf5\x2b\x11\x31\x77\x8c\x23\x76\xca\x50\xa3\x6e\xe9\xa5\x40\x9f\xcb\xe9\xf4\x1a\x45\x38\x81\x87\xd4\xc5\xb4\xc8\xe9\xd9\xa5\x29\x74\x3b\xf9\x0c\x9b\x8e\x20\xeb\x43\x8b\x8d\x0f\x61\x8a\x08\xe4\x4b\xcf\xcf\x66\x49\xa1\x1b\x8b\x3a\x81\x37\xbb\xb2\x6a\x2e\x92\x57\x1a\xde\x02\x8e\x69\x01\x07\xe4\x7f\x9e\xd6\x8f\xe5\x90\x83\xff\x98\xb9\x2a\x87\x45\xd7\x6e\xd2\xf7\x84\xf9\xab\x5a\x75\xb8\xf4\x2d\xa9\x51\xd6\x00\x0e\x45\xfb\x68\xae\x96\xbf\x33\x2a\xc0\x51\x79\x64\x3b\x28\xc0\x4c\x9f\x8e\xa0\x26\x25\x75\x20\x12\xe1\x36\xa3\x6f\xac\x4c\x0c\xb3\xa6\xe4\x94\xef\x63\x69\xef\x97\x20\x7a\x93\x69\xbb\x4b\xb6\x64\xcc\x73\x28\x7b\xa8\xbc\x32\xbe\xe1\x67\xf9\x76\xb2\x9b\x6e\x36\xcb\xf8\x21\x3e\x92\x8b\x87\x31\x6c\xc4\x62\x55\x27\xe6\x1f\x9d\xeb\x3f\x65\x33\x08\x97\xf4\x93\x1a\x6a\x10\xea\x6b\xed\xaf\xc1\xfd\xd1\x73\x1e\x78\x5e\x8d\x37\x50\x1c\xcc\x82\x01\xa4\x73\x0e\x32\x2f\x10\xc3\xa3\xa7\xf7\x50\x0f\x0d\x64\x28\x32\x1c\x1a\x2e\x56\x9e\x6f\xdf\x84\xae\x87\x46\xf9\xbe\x53\x85\xc5\x29\x6a\x53\x93\xd3\xea\x54\x6a\x44\x68\x39\xf3\xf8\xb3\x73\x0b\xa7\xdb\xb2\x94\x49\x2f\x40\xe9\x41\x90\x05\x90\x4a\x4d\x50\xe8\xbc\xe9\x73\x1c\xfa\xf2\x7f\x37\x75\xe4\xec\xe6\x08\x2c\x6c\x68\x89\x59\xb8\x69\x00\x5d\x7b\x72\x2e\x1b\xd9\x0e\xe0\x7d\x6a\x90\x60\xd5\x24\x8d\xf4\x4b\x8a\x82\x82\x00\x6b\x73\x80\x27\x36\x48\x1e\x96\xe3\x7c\x4c\xd1\xde\xc6\x80\x3e\x29\xc4\x97\xa2\x99\x53\xd5\x07\x0a\x2a\x26\x9f\x27\xcc\x61\xa4\x1f\x72\x56\xeb\xae\xfb\x56\x5b\xec\xf0\xa4\x2f\x27\xb4\x1f\x76\x97\x4e\x90\x1f\x7b\x6e\x45\xdf\x2f\x1c\xef\x35\xf9\xd7\xa3\xe5\x3d\x3c\x75\x3b\xcf\x17\x30\xe0\xa9\x24\x19\x7d\xbf\xfe\x4a\x86\x75\x79\xdc\x53\x55\xe7\xc6\xb8\x7f\xd1\xdc\xff\xa1\x1f\xb5\x98\xcd\xea\x9b\xea\xff\xf6\x82\x18\xc1\xd1\x72\xfd\xe2\x1e\x22\x38\x4b\xb7\x6c\xd7\x91\x8c\x92\x89\xfb\x07\xbd\x42\x90\xb5\xb0\x81\x6f\xa6\xea\x54\x18\x40\x65\xb7\xa3\x15\x56\x22\x89\x80\xaf\x73\xd3\xa3\x99\x1e\x4d\x45\x05\xa3\xee\xa4\x1c\x7f\x77\x1a\x22\x80\xc2\xfc\x9e\xdc\x40\x3c\xc2\xfb\x92\xd5\x41\xa7\x11\x0e\x21\x02\xc1\x3c\xb0\x80\xaa\x56\x40\x0d\xa7\x2d\xbe\x29\x3c\xd0\xbd\x80\x78\x50\xba\x3d\x4a\x44\x2e\x74\xd9\xb9\x4c\xeb\x50\xf2\x7c\xa9\xac\x9c\x61\x46\xc6\xb7\xec\x7e\x62\xf5\x15\x7b\x8d\x5d\x28\x6b\x85\xc9\x19\xaf\x90\xf6\xdc\xaa\x22\x5a\x6f\xad\x75\xe4\x93\x91\x16\x5f\xbd\xc4\xd6\x79\x33\xb0\x45\x91\x28\xa3\xc3\xab\xe7\x61\x24\xa0\x07\x23\x43\x2d\xb9\xb0\xc7\xf7\x69\xfb\xd6\xff\x6f\x47\xf3\x8b\x4f\x8b\xb3\xa1\x17\xa8\x99\xff\x10\xc4\xc1\xca\x6e\x0c\x39\x55\x67\xc8\x90\x4b\xd5\x70\x3e\xea\x0b\x48\xad\x18\x85\x90\x56\x76\xab\xa1\x46\x2c\x90\xeb\xb2\xc4\x4f\x40\xb8\xf7\x1f\x9f\x9c\x1f\xb6\xe9\xe1\x09\xfe\x7e\xb8\x89\x58\xae\x41\x4f\xf7\x83\xbb\x2c\xf7\x10\xad\xf8\xa3\x9c\xe7\x01\x7a\x2a\x37\x0d\xe9\xf5\x33\x44\x4c\x40\x32\x2b\x18\xf6\x46\xee\x10\xf2\x73\x8a\xb7\x8c\xdb\x17\x47\x3a\xc4\x0c\x1a\xa8\x0c\x6f\x75\xfa\x3e\x51\x53\x97\xaf\x5b\xd3\x3e\xf4\x0a\xc3\x92\x15\xee\x6c\xf2\x3b\xdb\x4b\xac\xaf\x68\x58\x04\x5f\x93\x8c\x12\x1a\xec\x7c\x6a\xf9\xb3\x3f\x56\xda\x46\x97\x40\xda\xad\x63\x45\xc0\xa0\x55\xc8\x1b\xa0\x88\x75\x71\xa5\xe8\x17\x71\xeb\x95\x24\xd0\xf4\xe9\x06\x5c\x07\x26\xb8\x54\x79\xf1\xae\xe5\x65\xd9\xc6\x46\x28\xf9\xfd\x16\xd9\x3b\xaf\xa6\xde\x6c\xe8\x4e\x4a\x0b\x25\x23\xbf\xe3\xdf\x7b\x8f\xd2\x4b\xa2\xaa\xab\x50\xb3\x9c\x3e\x88\xa3\x94\xf6\xc1\x30\x08\x63\x65\xd9\x31\xcc\x93\xaf\xfe\x17\x61\x59\x4b\x70\x9a\x01\xeb\xd0\xb2\xa5\x75\x1a\x93\x7a\xe0\x61\xd8\xc2\x3d\xd7\x77\x80\x66\xc3\xa8\xd1\x42\x7d\x20\x28\x7d\x07\xfb\x73\x90\xca\x9b\xe7\x72\xc7\xfb\x22\x7f\x81\xcd\xc1\x9b\x1e\x25\xcb\x24\xbe\x73\x49\xe2\x53\x9d\xec\x1c\xd9\xd2\x56\xc7\x78\xbf\xa7\x25\x34\xdb\xfa\xba\x00\x82\xf6\x76\xa9\xb6\x38\xdf\xef\x09\x12\x94\x72\x9b\xbe\xd2\x23\xd4\x90\xca\x89\xf1\x8c\xba\x68\x7f\x4b\x3e\xa9\xd2\x96\x22\xfb\x67\x7b\x37\x60\xb5\xf8\xe3\xda\x0a\x98\xf5\x6c\x7d\x14\x97\x75\x57\xfb\x53\x4b\x25\x36\xe2\x22\xfd\x67\xc4\x3d\x66\x19\xe1\x48\x0a\x14\x6d\xa4\xf7\x4a\xd3\xd7\x6a\x48\x0b\x35\x7c\x8f\x26\xf6\xea\x2a\xba\xdb\xe1\x6e\x5f\x64\xa5\xc9\x0a\xc0\x69\xbf\xf9\x49\x4f\xeb\x5e\xee\xb1\x8b\x4a\x5a\x2a\x58\xee\x00\x60\x35\x17\xe5\x97\xa3\x29\x89\xb5\x3d\x8c\xa2\x9b\xf9\xc7\x3d\xcc\x4d\x5b\x9a\x92\x72\x4a\xec\xcf\x69\x0d\x7c\x02\x06\xf0\xf1\x89\x24\x82\x1a\x4a\xe0\xb4\x99\x69\x49\x76\x04\x72\x2d\x95\x9f\x3c\xe7\x4e\x3a\x46\x73\xd9\x29\xe1\xd9\x80\x1b\xbe\x23\xbf\x10\x53\xe9\x35\x06\xcc\x36\x3c\x77\x91\x72\xe7\x4a\xcd\xde\xbf\xb0\x65\x5b\x3f\x06\x7a\xa4\xec\x0f\xfe\x0b\x64\x35\xc5\x1c\xfd\xf4\x84\xde\x5d\x7e\xa8\x5d\x8d\xb6\xa0\x31\xd5\x1c\xb7\xc9\x48\x01\xf3\xba\x23\xa5\xa7\xc4\xad\x49\x4c\x1b\xc1\xd8\x5a\x52\x0e\xbf\xba\x6f\xa3\xce\xf0\xc6\x2c\x35\xda\x24\xc5\x8e\x12\xb2\x3f\x87\x0e\xe8\x72\x1c\xf8\x1c\x42\x88\x79\x07\x49\x09\x80\x5a\xdd\x3e\x0e\x9b\xff\xac\x63\xb2\x94\xfd\x4a\x41\xeb\x95\x03\x18\x8a\x0a\x42\xa9\x20\xd8\xde\xdd\x54\x87\xe0\x6e\x19\xe7\xf7\x1b\x97\x8c\x60\x26\x95\x8f\x9a\xb7\x46\xb7\x16\xdf\x90\x52\x1d\x53\xed\x3f\x28\x0f\x6e\xd2\xba\x6d\x23\xac\x5c\x12\xb7\xcc\xac\xcb\x85\xed\x2c\xf6\xb3\x1d\x4e\xc4\xe7\xf2\x35\x8a\xf2\x39\xcb\x91\x10\x52\x75\xd3\x28\xb2\xb7\xdf\x21\xf2\x84\xfb\x28\xf4\x4f\xc9\x9f\xcb\x11\x69\xf6\x77\xa9\xb4\x46\xaf\x34\x6d\x9a\xa1\x55\xe3\x41\xf1\xac\x6b\x28\xd2\xe6\x12\x4b\x55\xad\x80\xc2\x76\xdf\xa4\x5f\x01\x8c\xa7\x0a\xb2\xb2\x72\xa2\x45\x7d\x1c\x65\x26\x53\x39\xc9\x79\x93\xa2\x0b\x33\xd5\xca\x70\xea\x75\x05\x97\x1a\x20\xe4\x72\x2e\xca\x93\xb6\xe0\x94\x9c\x8b\x03\x71\xca\x56\x02\xbd\x93\x94\x88\x77\x1f\x6b\xc9\x12\x48\xa7\x6a\xfd\x67\x54\xfd\xfe\x13\xd3\xf0\x9f\xf4\x64\xc9\x3a\x2e\x46\x8b\xfc\xab\xde\xc7\x7b\xcb\x95\x40\x27\x3f\x07\xa8\xca\xd1\x39\x31\xe9\x50\xa3\x85\x7a\xc0\x15\x67\xcf\xab\xba\xc8\xd6\xec\x07\x16\x17\x52\x10\x18\x94\xff\x95\x0f\xb9\xda\x26\x0f\x99\xc2\x55\x43\x9e\x15\xbc\x5d\x80\x2a\x95\xae\x6c\xa3\x01\xea\xbb\x31\x99\xa6\xf9\x6c\x34\x76\xa7\xa9\xd1\xbf\x52\x3e\x98\x4e\x3f\x8f\x89\xce\x90\x6a\x6e\x3c\x87\xaf\x35\xba\xbb\x16\x42\x7b\xc0\xd8\xeb\x6d\xa9\x7d\x08\xf5\x87\xd1\xea\x03\x13\x78\x94\x43\x37\x72\xb1\x56\x8f\xb2\x2f\x86\x57\x6d\x4a\x4b\x85\x57\x21\xe9\x91\xb5\x47\x1f\x19\x20\xb1\x49\xf9\xf3\x23\x93\x6d\x12\xa2\x2f\x4c\xaf\x7b\x5b\xcb\x9e\xbf\xc0\x4f\xdc\x43\x33\xfb\x5e\x12\x25\xf6\x9d\xb9\xf0\x68\xc4\xd0\xd8\x1b\xfd\xfb\x8e\xa0\x9d\x4f\x0a\x6c\x77\x08\x4c\x19\x02\x4b\xf8\x94\xbe\xf5\x7b\x4f\xa7\x01\x63\x5c\xf7\x2f\xdd\x9f\xfe\xaf\x14\x0e\x7d\x87\xb3\x5b\x46\x80\xb2\x6e\x4f\x11\x50\x71\x8f\xa1\x84\x79\xeb\xd1\xb2\x1f\x76\xbb\x2c\xdf\x99\xdd\x42\x76\x4b\xfc\xf6\x68\x35\xe0\xd4\x89\x68\x4f\x91\xbf\xcd\xf8\x26\xb2\x0f\xac\x2c\x58\x75\x49\xcb\x53\xd1\x24\x63\xb6\x19\x62\xe3\x5f\x68\x58\x67\xb4\x50\xe2\xa9\xa3\x74\xe6\x14\xfa\xc1\xec\xdc\xf5\x95\x22\xcc\x75\xfd\xa1\xce\x13\x5c\x86\xf6\xd1\xec\xae\x10\xee\xd2\x3d\x1c\xe4\x76\x1c\x0a\xe6\x58\xda\x9e\x56\x8b\xe5\xbd\x90\xf4\xfb\x2c\xa3\x2d\x12\xda\x4f\xb2\x9d\x5a\x5b\xb1\x60\xa5\xe4\x5e\xa2\x0d\xfc\xca\xd1\x46\x1e\x97\xb3\x36\x87\xd9\x61\xfe\x27\x05\xae\x1d\xe6\x7b\xb4\x6d\x38\x17\x5f\x6a\xf8\x13\xad\xbd\x32\xd3\x78\x77\xb9\x04\x7b\x60\x2e\x7d\x98\xe6\xde\xc4\x0b\xdc\x75\x5a\x91\x15\xcb\x9f\x51\x56\x4b\xb9\xb1\x25\x0b\x9d\x16\xf7\xb5\x93\x5c\x8e\x9d\x26\xf4\x0f\x01\xd8\xd8\x91\xe8\x09\xc0\xda\x24\x29\x1e\x60\x3e\xae\x06\xf2\x59\x52\xaf\xc5\x79\x6f\xd7\x0d\x8a\xf6\xcd\x76\xf6\xa6\x37\x80\x20\x3f\x33\x71\xb8\x29\xfd\xbd\x79\x68\xee\xa6\xf3\xaf\x44\x0b\xd1\x64\x6f\x45\x89\x9f\xca\x11\x67\x0b\x83\xc9\x2c\xf6\xb2\xa8\x00\xa4\x06\x2c\x4f\x91\xe8\x2b\xe2\x01\x72\x6d\x36\x08\xee\xd3\x09\x3b\xe3\x9b\xf8\xf2\xfe\x31\x84\xfc\x7b\x3d\xc6\x11\x53\xa3\x7d\xdb\x88\xe9\xc6\xcb\x2e\xfd\x65\x73\x5b\x0e\xf9\x37\xf6\xb3\xb7\x64\x9c\x6a\x0a\xfb\xbf\xb4\x4b\x26\x5d\xa2\x07\x32\x42\x70\x3f\x84\xa5\x16\x3f\x58\x94\x50\x19\x40\x8e\x24\x53\x25\x8d\xd4\xab\x9e\x21\xdc\xed\x23\x17\xf6\x54\x1d\xb0\x4a\x35\x3a\x90\x0b\x56\xe4\x5d\x6a\x79\x48\x7c\xca\xdf\xcd\x8c\x76\xb3\x10\x35\x86\x3c\xeb\xc5\x23\x83\x77\x0a\xaf\x2a\x0c\xd3\xf3\xdb\xa4\x32\xf1\x2d\xd0\xd6\x5e\x63\xe0\xce\xd1\xbb\xc6\xed\x7d\x5f\x3b\xdc\xbd\x9e\x58\xfe\x7e\x3d\x90\x94\xf4\xbd\xca\xc1\xaf\x53\xa1\x42\x53\xf1\xab\x50\x42\x8c\xe4\xa0\x6c\xad\x20\x12\x92\xe2\x7f\x54\x8e\x99\x74\x79\x94\x30\x4f\x81\xf2\x05\xcb\x2c\xe4\xbe\xce\xc5\x41\x8b\x59\xeb\x5b\x7f\xfc\x41\xf6\xdb\x8d\x6d\xee\xfb\x3d\x6c\x13\xc7\xc7\xe3\xc2\x9f\x06\xd1\x11\x22\x6c\xfc\xd5\x72\xa9\x13\xe5\x89\x35\xa5\x4f\xf9\xcc\xb1\xe3\x77\x7a\x5c\x74\x5a\xc8\x20\x3a\x8b\x1e\xb7\x50\x40\xde\xc4\xa5\xe0\x78\xa7\xad\x52\x41\x01\x59\x5d\x2c\x8a\x58\x4e\xda\xb0\x29\x2f\xd7\x28\x74\xcb\x3d\xd5\x3b\xe8\x3a\xcf\xc5\x24\xcb\xa9\xd4\xda\x7c\x52\x20\x80\x74\x5c\xf4\xb5\x37\x8f\x14\x25\xd9\x63\x6b\xc7\x17\x18\x4b\x55\xf9\x80\xa6\xfc\x01\x41\x55\x2b\xbb\x4a\x8d\xf4\xad\xba\x54\x90\xfa\x58\x76\x93\x21\xb2\xc7\x55\x58\x40\xd0\x6c\x0b\x78\x80\xa4\x74\x58\xa2\x70\x17\x80\xb9\xc3\x0f\x83\x82\x01\x4f\xbf\x96\xf5\x02\x6a\xa7\xbc\xfc\x96\x6d\x2f\x20\xdd\x58\xd3\xf6\xf0\x9f\xc2\x09\x06\xb8\x15\xd6\x8b\xc9\x79\x0b\xcf\x91\x7d\x09\x5e\xfd\xae\xf2\x1f\x72\x8e\x55\xd8\x99\x1e\x6f\x6d\x40\xd8\x4b\xb2\x7e\xa1\x0c\xde\x2e\xce\xb0\xb4\x22\x21\x2d\xfe\x27\x67\xee\xc7\xe3\xb4\x2b\x74\x86\x34\x9a\x3e\x97\xa1\x7c\x42\x9a\xd7\x94\xe5\xdd\x7c\xbb\xb2\xf7\x6d\xc2\xa9\xbc\x7e\xb7\x6c\x41\xf9\xb7\xf8\x84\x5e\xff\x64\x5f\x9d\x2e\x40\xf0\x52\x11\xd3\x02\xfb\xa1\xc6\x3f\x8a\xfc\x47\x36\x38\xe1\x83\xca\x46\x79\xff\x61\x94\x4b\xa9\x00\x3a\x3b\x4e\x9c\xc1\xd8\x9b\x2b\x7b\xaf\xfc\x2d\x6a\x4f\x81\x9a\x76\x63\x13\x3f\x42\x1c\x7b\xe7\xf2\x7e\x90\x95\x65\x64\xfd\xff\x60\xac\x00\xb9\x3d\x03\x1c\x5b\xca\xf5\x00\x3d\x54\x99\x50\x62\x68\x29\x11\x1f\x77\x87\x64\x69\xa9\x70\x19\x0f\xe8\x2f\x88\x79\x7c\x12\xa5\x0e\xf6\x9b\x0c\xa9\xcd\xd8\x5c\x99\xee\xf1\xed\x88\x6a\xf7\xe7\x2b\xeb\x0f\xe2\x5c\x79\x57\x51\x33\xd8\xdf\xa6\x1c\x93\x7b\x2d\x11\x72\xae\x30\xc6\x15\x2a\xf1\x50\xe0\x56\x96\x4f\xc2\xa4\xd5\x2c\xca\xe1\xad\x13\x7d\x75\xdf\x86\x1a\x09\x21\xa1\x43\x22\x85\xfe\xbd\x29\x3d\x4e\x43\x6a\x03\x28\x3b\xc6\x24\x74\x1d\xdb\x45\x78\x69\x7c\xb1\x6a\xe5\xbf\xa3\x5a\xd8\x21\xea\xab\x84\x8f\xb8\x8d\xda\xe1\xbf\xa1\x82\x70\xef\x9e\xbc\x79\x66\x11\xd8\xc4\x3d\x25\xd9\xb2\xe0\x27\x20\xc0\xf1\x24\x09\x5f\x0c\x55\x10\x2d\x61\x41\x04\xcc\x8e\x28\xe0\xb9\xb0\x6e\xc2\x5f\xf5\xed\x4d\xf5\x09\x7b\x6b\x35\xe4\x4f\x01\x64\xcd\xc9\x28\xd9\xa4\xfc\x37\x4b\x6e\x23\x5b\x93\x79\xfc\x2b\xfc\x04\xe6\x0f\x51\x5b\xf4\xd0\xca\x61\x5d\xd0\x36\xda\xa8\x94\x48\xeb\x55\x1e\xa0\x92\xf3\xca\xee\x9a\x65\xdb\x79\xa8\xe5\x22\x63\x38\x5d\x56\x98\x8c\xc2\x9a\xc2\x11\x0a\x90\x8d\xaa\x93\x90\xee\x21\x7e\x7d\xbc\x84\xa5\x62\x5e\x33\x84\x99\x29\x30\x1a\x04\x2d\xdc\x84\x8d\x55\x9d\x70\x3e\x10\x65\x82\x77\xfd\xcc\x1d\x55\x47\x9f\x1a\xc0\xb1\xcd\x6e\x89\x62\xc0\x5e\xc3\x73\xb3\xbc\x3c\xfe\xf6\x51\x73\xea\x71\x19\xc6\x66\xb4\xee\x25\xe4\xd4\xaa\x48\x76\x95\x3b\x21\x7a\x75\xf9\xc7\x58\x63\xcd\x97\x0f\xd7\x3f\xf8\x40\x98\x6c\x5f\x26\x1d\x01\x0c\x61\xe3\x7e\x6e\xfa\xd6\x85\x07\xd4\x64\x88\x85\x18\xce\xd8\xb8\xbc\x66\xbf\x70\xac\x6a\xaa\x33\xe1\x2f\x85\x62\xc4\x64\x60\x60\x6f\xb5\xc4\x88\x4d\x35\x8c\x18\xe6\xf0\xe7\x25\x44\xa1\x0a\xbb\xa9\xeb\x7e\x33\x62\xc4\x48\x11\x87\x01\x08\x3c\x3b\x2d\x7a\x9c\x41\x55\xe7\x4a\x75\x42\x34\x1b\x1f\xb9\xeb\xd2\xcc\x4b\xec\x21\x7b\x02\x90\xb2\xd9\x5b\x37\x17\x2e\xa4\x30\x33\xcc\xd4\xb4\xe8\x4e\x75\xba\xd9\xc0\x73\x27\x5c\x31\x09\xfe\x14\x2c\xf9\xfe\x8f\xaa\x2b\xcb\x52\x5d\x47\xb6\x73\xe1\xe7\xfc\xbc\x49\xc9\x0d\xc6\x89\x6d\xb9\xdc\x40\x92\xa3\x7f\xda\x4d\xc8\xdc\x5b\xb5\x16\x32\x09\x1c\x1a\x5b\x52\xc4\xee\xa0\x87\x0a\x6f\x07\xfe\x60\xf7\x51\x0b\x66\x30\x43\xd4\x18\x17\x05\xe6\x8e\xf5\xef\xc5\x13\x5b\xd5\x82\x31\xad\x52\x5c\x83\x91\xe5\x1a\x21\x08\xb5\xb5\x50\xed\x7f\x99\xf7\x2f\xde\x48\xae\x86\x95\xe8\x98\xf7\xe1\xfb\x3d\xb2\x61\x07\x1f\x83\x66\xaa\xbe\x3f\xec\x57\xc5\xd2\xd3\x2f\x6c\xee\xf3\xe1\xa5\x58\xfc\xb8\xb4\xef\xe7\xce\x36\xe2\x34\xba\x8a\x46\x7a\xa9\xff\xbb\xa0\x9e\x8c\x8e\xde\x2d\x5b\x99\x6f\x5f\xab\xcf\x82\x8e\x2e\xb7\xee\xa7\x15\x8f\x65\x25\xdc\x6c\x1a\xf1\xb6\x36\x2e\xa3\x65\x26\x2a\x2e\x9e\xbc\x58\x3c\x47\x0b\x1a\x57\x16\x12\x5d\x54\x5e\x2e\x33\x4f\xe2\x40\xe9\xe3\xf5\x28\x70\x8a\x6e\x6c\x1a\x3d\x1b\x4e\x60\xf6\x2a\xaf\x7e\x48\x1d\x49\x0b\xea\xa3\xf3\x14\x0e\xf7\xad\x7b\xe0\xff\x61\xdf\x77\x85\x93\x5f\xee\x14\xe9\x78\x34\x6e\xc2\x27\x8b\x13\x25\xc7\xe3\x7d\xae\x4a\x4e\x7b\xaa\xb5\xee\x64\x81\xdf\x12\xc5\x04\xe4\x1d\xbc\x75\x93\xb0\xdd\x02\xd5\x6e\xcb\xf4\x67\x3e\xcb\x3e\xc3\xfc\xb2\x6c\xf1\xa4\x9d\xdb\x0e\xe0\x3d\x87\xe9\x29\xeb\x47\xec\xbd\x6a\xd8\xe5\x67\x2f\x90\x7c\x5c\x21\x27\x58\x80\xda\xa0\x02\xd7\x28\xe0\x36\xdb\x2b\x37\x9e\x84\x54\x51\xf3\x89\xcb\x69\x34\x2f\x5f\x35\xcf\x78\x15\x3c\x67\xf5\x3d\x07\x71\x26\x02\xd8\xd2\x21\xae\x4f\x9b\x2f\x95\x69\x9b\x1f\x14\x37\xde\x54\xee\xd8\xbd\xe2\x8a\xce\xa5\xef\xc5\x7c\x51\x26\xda\xc7\xb9\xae\x4a\x76\x75\x38\x6a\xb9\x7d\x96\xb9\xa4\x63\x63\x8f\x9d\xa7\x88\x72\x2b\xdb\x00\xb8\x37\x39\x83\xaf\xec\x15\x68\xbd\xb7\x8b\x56\x8c\x6c\xc0\xa1\x3a\x9b\x36\x6a\x24\x97\x52\x27\xc9\x7f\xb9\x81\x88\x7f\x8e\xea\x25\x47\x00\xac\x28\x99\x94\xeb\x55\x33\x0c\xcc\x4c\x15\x23\x2e\x77\x3c\x5d\xfd\x64\x01\x00\x76\x04\xdb\x80\x9c\x6b\xa4\xd7\xe8\x1f\xe9\x35\xba\x7c\x6e\xca\xee\x21\x99\x9d\xb3\xb9\xfa\x59\x9e\x30\x9e\xd2\x50\x15\x47\xd9\x0e\xb3\xdc\xb0\x4d\xaa\xfd\xd9\xb7\xdd\x0a\x24\x9a\xa6\x57\x17\x52\x34\x07\x1d\xbc\xfe\x14\x1e\x29\xab\x76\x1a\x8d\xdd\x27\x6d\x9a\x52\x57\x66\x7d\xf7\xef\x5b\xc1\x51\x2a\x68\xa8\xe5\x74\xff\x07\x56\xa7\x2e\x83\x1a\x7d\xc8\xbf\x48\x07\x2e\x53\x0e\xdf\xd2\x5f\xf0\x50\xfe\xcc\xa9\xf8\x9c\xf6\x8b\xfc\x60\xaf\x16\xce\x43\x9f\xbc\x79\x13\x07\x4d\x13\x6e\x40\x60\xd7\x40\x22\xba\xb7\x3b\x76\xef\xc7\x67\xf9\xc7\x3f\x00\x26\xe0\xbf\x51\xaa\xa0\xa5\x72\x6a\x4c\x28\xd6\xb0\x14\x58\xb0\xe9\xbf\x5d\xa6\x65\x37\x74\xff\x69\xf4\x7f\x63\x65\x03\xd7\xbd\xcb\xa7\xcc\xa6\x14\xae\x69\xc2\x04\x6a\x09\x03\xd4\x55\x94\x70\x40\x9f\x59\xcf\xb7\x8b\xdd\x52\x5f\xa2\x8d\xf8\xf6\xb2\xe9\x10\x6d\xe7\x9c\x73\xd4\x3b\x3c\x75\x3d\x5e\xf6\x0a\x15\x1f\xe8\x9b\x38\x27\x1f\x78\xbf\x12\xe4\xc6\x59\x38\xc9\x31\x72\x71\x2a\xc5\xcf\x36\x88\x0e\xc8\xee\xe1\x2e\x7e\x02\xc6\xaa\x6f\xca\x35\x7e\xaa\xa8\x71\x50\xee\x4d\x42\xbd\xa3\xee\x2e\x60\x80\x06\x8e\xd4\x8d\x88\x42\xb8\xab\x95\xf3\xdd\x7f\x96\x73\xd7\x7e\x2d\xa9\x65\x77\x77\x8f\x94\xb9\x93\x51\xa6\x2e\x56\xce\x80\xa0\x1d\x46\xbd\xd5\x83\xf1\xf8\x89\x94\x54\xc0\x66\xbe\xfd\x26\xee\x54\xe6\x3a\x31\x87\xaf\x8d\x2e\xe0\xae\xe3\xf2\xf1\xd8\x02\x8b\xa8\xb1\xb9\x6b\xdf\x5e\xa6\x80\x7b\xd9\xc9\xb6\x61\x4a\x3f\x4d\xf9\xef\x8f\xa4\xe3\x0c\x20\x4e\x95\x44\x96\xd3\xd9\x02\xd1\x26\xff\xbd\x19\x3e\x5a\xa0\xbe\xf3\x7d\xb8\x17\x55\x7e\x06\x93\x8e\xf8\x5e\xcb\x43\x93\x7d\x22\xb0\x2d\x88\xbc\x5e\xa8\x48\x6a\x82\xbe\xb9\xb8\xc4\x23\x44\x41\x77\x35\xb3\x56\x1b\xb5\x47\x5f\x9e\xa1\x37\xd7\xbf\x22\xa7\x1e\x96\x89\xe6\x29\x4d\x55\xef\x01\x8a\x52\x74\xaf\x41\x8a\x34\x3f\x19\xc1\xfc\x4d\x13\xc3\x9c\x5d\xd5\x6c\xfd\x5b\x65\x20\xf3\xfa\x54\xf4\x80\x8d\xed\xef\xa4\x4d\x76\x0e\xd9\xc1\xd8\xf2\x15\xb1\x13\x45\x53\xac\xff\xd2\xe1\x7a\x70\x05\x54\x0e\x48\x7c\xd9\xcb\x14\xb5\xcf\x0e\xf5\x0b\x4a\x3d\x09\x4e\xad\xd1\x0d\x48\xe2\xa3\xce\x79\x29\xc1\x44\x54\xa6\x5a\xfc\x84\x37\x2f\xeb\xa0\x64\x47\x92\x52\xa2\xf6\x2e\x87\x18\xac\x15\xd4\x19\x64\x8a\x6e\xd5\xca\x0a\x05\x8f\xe6\x23\x44\xef\xc8\x5c\xce\x8f\xd5\x59\x0c\x45\x11\x7f\x11\x44\x01\xaa\x28\x08\xa1\x8b\x9c\xde\x9a\x64\xe2\x2d\x73\x83\xbf\xdd\x46\xd8\xa2\xa8\xd9\xc1\x53\x1f\xad\x2f\x6c\x20\x22\x08\xde\x05\xd3\xbd\x5a\x44\x48\x44\xc8\x7f\x27\x5f\xdb\x9c\xb5\x02\xd7\xab\xfc\xf1\x95\xee\xe3\xe2\xa7\x4c\xff\xb6\x3d\x99\xbc\x7e\x21\x48\x66\x62\x7b\xca\x99\x3f\xaa\x7a\x7c\x32\xda\x84\x84\xf7\xa5\x1a\x04\xb8\x7b\x2b\xc7\x50\xc0\xca\x01\xc8\xe7\xd1\x8d\x31\xa8\xd8\xc9\x18\x0e\x6e\x5a\xbc\xb5\x08\xe6\x8d\x1b\x16\xe8\x0c\x17\x9f\x8b\xa0\x2d\x6d\xb1\x48\x2e\x68\xaf\x8a\xc2\xe5\xc0\x00\x0e\xcb\xa0\x72\x94\x61\xd3\x1d\x46\xf6\x70\x90\x5b\x24\x06\x3c\x8f\x47\x99\xb7\x55\xb5\x94\x5f\x41\xbc\xa2\x1c\x8b\x31\x60\x16\xc3\x2e\xb0\x24\x17\xc9\xbd\x7e\x27\x73\x88\xf6\x09\x16\x88\xbe\x2e\xdc\xa5\x5e\xfc\xb3\x58\x60\x33\xf3\x13\x6e\x02\x63\x54\x50\x85\x9e\x00\x29\xc6\xa4\x14\x6b\x4c\x74\xda\x4f\x4d\xfb\x74\x55\x5f\xf6\xe2\x35\xe1\x16\x0a\x2d\xbd\x1d\xc4\xa1\xbf\x22\xbf\x40\x63\xbf\xf7\xb2\xa3\x73\xf7\x02\x2c\xa8\x48\x1b\x98\x82\xef\xc1\x8e\x97\xcc\xda\xe0\x8e\x67\x0e\xd4\x3d\x1a\x98\x93\x03\xbb\xc3\x98\x6b\x42\x6a\xd8\x56\xdd\x4f\xfa\x90\xb8\x4d\xe5\x2a\xe2\x6b\xf4\x83\x27\x61\xf0\x5d\xc4\x98\xb7\x4a\xe0\x59\x7e\x8f\x56\xf8\xcf\xb3\x2c\xa4\x24\x9e\x3c\x47\xd4\x7c\x18\xa4\x95\x78\xea\x0f\xf8\x08\xf7\x58\xcc\x7e\x4a\x99\xc1\x09\xac\x7c\xb3\xa7\x8b\xaf\x32\xa5\x89\x04\x31\x06\xbb\xd9\xe3\xae\x5a\x99\x2c\x27\x1a\x44\x1a\x3a\x08\xa1\x14\x58\x63\xf8\x93\x8d\xf2\xfa\xbe\xc8\x54\x1d\x10\xf1\x10\x26\xf6\x6d\x60\x3c\xf4\x34\x71\x19\x37\xd1\x33\xe9\x06\xe6\xd3\x2c\x0f\x93\xe8\x90\x51\xf6\x28\xdc\x67\xd7\x4e\xeb\xcf\x05\x1c\x52\xfe\x1f\x7a\x92\x0c\x24\x1f\x59\x6f\xcb\xee\xc1\x5a\x28\xd0\x12\x52\x82\x52\x99\x28\x1e\x26\x71\x3e\xd2\xe7\x3d\x3a\x4b\x69\x8e\x6d\xc4\xa3\xbc\x76\x63\xf2\xd3\xb8\x31\x1e\xef\x26\x32\xbf\x63\x15\x4f\xee\xe2\x91\x77\xa0\xf9\x63\xd8\x46\x1b\x9d\x40\x54\x6d\xe9\x17\xdd\x67\xcb\x76\x9e\xdf\xd5\x30\x41\x3b\x46\xe6\xd4\x14\xb9\xed\xc3\x48\xcd\x17\x5f\x7c\x40\xb4\xa3\x5e\xa2\xff\x0a\x6e\xa2\x61\xca\x76\x33\x0c\x54\xed\x54\x84\x09\x69\x43\x30\xf4\xbd\x52\x1f\x85\x49\xdf\x4f\x43\x44\x0f\xe5\x6d\x7c\x19\xc4\xdd\x41\x6c\x1e\xe9\x83\x70\xe7\x64\x7f\x63\x8d\x88\x96\xab\x7f\x0a\xa4\x58\xee\xba\x8d\xb2\xd0\xb6\x5f\x40\x8e\xe6\x6a\xc0\x82\x0e\x81\x0b\x40\x07\x48\x33\x2f\x78\x57\x01\x18\x66\x7b\xbd\x75\x95\xdb\x95\x20\x00\x5d\x25\xe1\x9c\x90\x2e\x81\x91\xb9\x49\xfc\xc7\xa3\xf2\x29\x6a\x53\x3c\xf2\x1f\x2b\x5f\xca\x85\x5b\x3f\xf0\x9a\x86\xdf\x70\x50\xfe\x43\xb5\xe3\x96\x1a\x2f\xf0\x6b\x4b\xc0\x78\x69\x0b\x26\x3a\x2b\xcc\x15\x03\x19\xb5\xda\x0e\x3a\xb7\xc7\x53\x4d\xf8\x57\x24\xe4\x9a\x44\xf7\x60\x7c\x83\x2f\xfd\x4e\x9d\x8e\xae\x5c\x8c\xbc\xbc\x48\xfa\x0b\x06\x17\x02\x1b\x09\x89\x97\x82\x2e\xd2\x91\x3a\x7e\x2a\x05\x46\xf4\xed\x18\xe1\x55\x09\x11\x25\x1a\xf1\x77\x21\x80\x84\xdb\xed\x72\x6a\x68\x33\x68\x26\xa3\x41\xa1\xb7\xab\x9a\x57\x1f\xa2\xcb\x37\x13\x16\x75\xf0\xe4\xda\xce\x71\x7e\xba\xe3\x86\x42\xea\x4a\xa1\x91\xf5\x71\x77\x85\x3d\xd4\x28\x2b\xbd\xc4\x74\xce\x86\x8e\x22\xe9\x3c\xc9\x71\xa5\x79\x2b\x7a\xae\x9d\xb2\x03\xbc\x18\x5e\xed\xf7\x38\x55\x0b\x89\x52\x5b\xed\x34\x51\x19\xe1\x5e\xb9\x18\x59\x6c\x71\x65\x06\x07\xbd\xfc\xf6\xd2\x6b\x3e\x1c\x8e\xf9\x9f\x7c\x96\x16\x57\x82\xb9\x53\xb1\x6a\xb6\xd0\x91\xf1\x76\xd2\xb5\x83\xfd\x47\x59\x93\x09\xee\x9c\xd3\xd4\xe5\xa1\x4a\x30\x1f\x61\x8d\x92\xfe\xfa\x8a\x2b\xbd\x2f\x6b\xc0\x0d\x28\x37\x06\xd1\x0c\x84\x61\x8a\x65\x98\xe5\x1b\x73\xdb\xb9\xf1\xf7\x25\x31\xe6\x19\x9f\xae\x99\xaa\xc6\xa8\x0c\x53\xf0\x8a\x3c\xe6\x13\xfa\xc9\x02\xae\xb2\xef\x5a\x3d\x88\x56\x80\xdc\x9a\x07\x13\xb0\xb0\x9f\xd2\x45\x9c\xde\xa2\x36\x24\xa5\x01\x90\x7c\x65\xe6\xd5\x5e\xab\xc8\x04\xae\x4c\x1a\x94\x7b\x59\x76\x19\xbc\x5d\xe5\x6b\x23\x42\x56\xdf\x76\xca\x87\x82\x7f\x1e\x7f\x37\x32\xae\x2e\x07\x15\xed\x24\xd2\x44\x12\x33\x46\xc3\x80\xc8\xef\x80\x96\xee\x12\xeb\xc2\x69\x81\xb1\xfd\x41\xff\x6a\x05\x24\x56\xf1\x85\xb3\x29\xf8\x4f\x7d\xd2\xd3\xdf\x0d\xa1\x28\x41\xf1\x65\x69\xc2\x0f\x1f\xb9\x13\xe5\xdf\xeb\xe5\x1c\x5d\x2e\x48\x07\x70\x5a\x3e\xfb\x1e\x87\xf0\x36\xcc\x79\x77\x46\xf7\xfe\x34\x71\x0b\x36\x23\x50\x3f\xf2\xe0\xb8\x92\xb8\x60\x04\xa2\x91\x14\x52\xac\xd3\xf2\xe4\x80\x2e\xb9\x69\xc3\x48\xc5\xa8\xf3\x6b\x34\x0d\xbe\xd4\x72\x46\xa6\x94\xe1\xc3\x82\x6c\xd7\x6f\x78\x46\x57\xed\x24\x2d\xe5\xa6\x04\x8b\x5d\x05\x59\xad\xa3\x4a\x79\x07\xaa\xa9\x86\x22\x2d\xfa\x62\x2e\x85\xdd\xb9\x84\xec\xea\x5c\xa0\x9a\x8a\x6e\x3f\x2b\xbc\x97\x7c\x70\xf9\xb3\x1c\xa7\xe2\xe8\xbe\xbc\x9f\xc1\x00\xdb\x1d\x92\x14\x32\x0e\x95\x72\xbf\x63\x1b\x96\x7a\x47\x2e\x97\xa3\x0a\xc3\x52\x35\x64\xbd\x3b\x07\x7b\xfa\xee\x7c\x3c\x92\xe3\x2f\xa2\xc0\xae\x91\x73\xc8\x5d\x1e\x47\x71\xd0\xca\x9e\x42\xfd\x1c\x94\x84\x55\x4a\x82\x9e\x07\xfd\x75\x51\xff\x41\x4f\xa8\x8a\xaf\x1a\xb5\xfc\xfb\x3a\xae\xe6\xbf\x40\xc3\xd0\xd9\xd2\xdf\x3a\x3f\xa6\x7d\x2c\x5c\xc9\xc2\xdc\xc5\x15\x41\x19\x4d\xff\x84\x2f\x80\x87\xa6\x2a\x35\x79\x65\x25\x88\xa8\xba\xe2\x33\x37\xa3\x4e\xe6\xdd\x39\x20\xd0\xa0\x64\xe7\xac\x81\x93\xd6\xff\xef\xfc\xd2\xa3\xac\xce\xe9\xde\xa3\x42\xe6\x38\x3a\x95\x65\x69\x6f\x03\xe6\x22\x51\x0f\xf1\xcf\x81\x8e\xc1\x89\xdb\xf8\xd8\xb8\x54\xc1\xac\x48\x99\xc2\xbc\x22\x20\x95\x16\xe4\xbb\x9a\xcb\x3c\x74\x34\x2c\x9c\x2d\x2d\x68\x59\xf2\x1b\xdd\x55\xbe\xde\x04\x1c\xd5\x56\x44\x3b\xf7\xf9\x8f\xe4\xc5\x7f\x37\x78\x8c\x5d\x96\xca\xc1\x43\x39\xc8\xe6\xa2\xe5\xf7\xe0\x4f\x4d\xfc\xcb\x6f\xe4\x51\x76\xc8\xab\xaa\xc6\xb4\x3d\x11\x74\xa3\xb1\x7a\x19\x3b\x14\xb0\x29\x40\xac\x74\x19\x5f\x7e\x59\xc9\x24\x1d\xab\x84\x71\xe5\x57\x56\xd2\xf8\xd6\xdb\x70\x9b\x91\x8f\xdc\x47\x43\xc4\xcf\xf1\xf3\x26\x27\x76\xef\xe0\xcf\x87\x1d\xef\x66\x44\x67\x33\x0b\xed\x94\xe3\xd1\x96\x8f\xb0\x7f\xf9\x3c\x7f\x4a\x4d\x26\xda\x9a\xd3\x97\xe1\xf1\x8d\xb2\xce\x60\xd8\x75\x19\x61\x37\xa2\x77\xa4\x3f\x7d\x87\x6f\x5f\x16\x34\x2a\x12\xe7\x64\xb7\x9a\x49\x21\xdd\xaa\x17\x7f\xf2\x68\xc8\xec\x21\x67\xad\x8b\x45\x17\xf5\xa3\x0e\x9e\xc1\x70\x44\x0e\x8a\x19\x74\xcd\x39\x4e\x1e\x01\x2b\xe4\xa8\x72\x61\xe3\x28\x28\xb0\x1b\x8b\xee\x7d\xf1\xdb\x08\x9f\x73\xb4\xa6\x49\x02\x29\x95\x26\x2d\x69\xb6\xfc\xd6\x59\x85\xf2\xf1\x26\x19\x8d\xea\xb7\xcd\x3e\x0d\x2b\xfc\x35\xbf\xf2\x60\x53\x35\x15\x2f\xe5\x89\x46\x8a\x1e\x58\x83\x93\xba\x56\x67\xc2\x15\xa0\x84\x98\x75\xa8\xfd\x84\xb9\x31\x5c\x3e\x38\x22\x6b\xaf\x69\x67\xed\x9f\x9c\xfe\xd6\x8a\xf4\xaf\x0c\x6b\xbc\xa9\x92\x74\x58\x3d\xdc\xce\x76\x87\xac\x84\x1e\xa0\x8c\xd2\xbf\x28\x33\x05\xad\x89\xf5\x57\x36\x7e\xe1\x00\xab\x72\x53\xbf\x62\x76\xec\x2e\xe4\x93\xd4\x2f\xa0\x4c\x74\xe2\xca\xfd\x4e\x28\xae\x81\x48\x52\x5f\xfb\x92\xd5\x8c\xe2\x90\xff\x71\xb4\x44\xce\xc5\x4d\x46\x97\xfc\x2c\x0b\xca\x47\x3e\xb2\x17\x32\xd7\x0f\x53\x8d\xdf\x5f\xd2\x89\x4e\x88\x2b\xb2\xd8\x72\x97\xc1\x85\xc6\xa9\xab\x34\x9f\x4b\xf0\xd4\xe7\x6b\xab\x35\xc7\x96\x80\x85\xaa\x40\x9b\x19\x16\x31\xab\xc8\xa7\x40\xef\xca\x94\x76\xaa\x7c\x9d\xed\xc1\x39\xbb\x80\x04\x50\x70\x0a\xb5\xeb\x7b\xd7\x9f\xe9\x77\x9c\x6d\xa3\x5e\xce\x9b\xde\xf1\xf8\xf0\xaf\xae\xe6\x98\x60\x7a\xf1\xbd\xd1\x3b\x71\xbc\xa9\x94\x74\x01\xaa\x30\x9b\x29\xbf\x51\x2a\xb2\xfe\x83\x01\xc5\xac\xe0\x12\xa4\xd8\x08\xa3\x7b\x29\x39\x6f\x54\xb5\x5b\x36\x63\x60\xcd\xd5\xd2\xb1\x5a\xa1\x97\x22\x83\x95\x62\xd4\xa1\xe5\xd6\x5c\xe6\xa9\xaf\x19\xb7\xb0\x27\xc6\x87\x20\xca\x17\xce\xea\x61\x54\x26\xe7\x74\xdd\xf5\x65\x58\xf9\x04\x09\x93\x83\xa4\x45\xe5\x59\x96\x29\x2a\x72\xf2\x16\x8e\x10\x3f\xb0\x34\xa8\xa0\x60\x60\x82\xb3\xb3\xb7\xc6\x8d\x86\xfe\xb5\x8d\x0a\x8b\xf5\x26\xa0\xbe\x2f\x6f\x61\xe5\xef\x6f\x75\x24\xcc\xb0\x7a\x18\xfe\xe7\xa8\x0d\x60\x50\x56\x0e\x84\x08\x43\x89\x03\x38\x83\x65\x1f\x7e\x7d\x62\x79\x19\x1b\x7f\xfd\x7e\x90\x3d\x6a\x76\x7c\xc0\xcd\xf5\x46\xc6\xdf\x93\x37\x50\x84\x1e\xc1\x02\x2c\xbb\xfe\x80\xbc\x87\x2f\x8b\x5e\x8d\x99\xc5\x58\xef\xc8\xb3\x8b\xc2\x71\x75\x71\x68\xd9\xf1\x00\x59\x73\x8d\xe6\x4f\x72\x7d\xa0\xc1\x8d\xaa\xbb\x49\x5c\x9a\x3b\xed\x5f\x54\x74\x9d\x9e\x67\xee\xdb\x49\xf5\x57\xa9\xf1\x9a\xa8\xb7\xee\x5b\x7f\x76\xda\x7f\xde\x69\xe6\xa6\x99\x9b\x05\xdf\xfe\x70\x0f\xba\x2c\x50\xde\x75\xdd\xc7\x70\x63\xbb\xf7\xb3\xd4\x39\xc0\xe9\xf8\x4a\x97\xa4\x06\xa3\x90\xd2\x94\x0a\x31\xeb\x76\xd4\x85\x20\xf5\x8c\x4d\xaa\xee\xb4\x4a\x74\x6d\x68\x17\x4d\xdd\x3f\x5a\x50\x48\x23\xf8\x18\xb6\x95\xb0\x89\x88\x60\x41\x19\xa5\x80\xc4\x9e\x74\xd0\xef\xcd\x23\x6c\x46\x98\x04\x91\xa6\xb8\x4b\xed\x2a\x4b\x11\xb1\xd7\x72\xdb\xa0\x47\x7a\x88\xcb\x42\x83\x07\x14\xdd\x84\x02\x5d\x68\xa2\x79\x8c\x0b\x6c\xcc\x49\x9d\xfb\x2f\x66\xa8\x82\x93\xde\x9c\x7c\x52\x17\x16\x77\xa5\x72\xb8\x5f\x16\x93\x9c\xec\x54\x6f\x46\x86\x02\x81\x43\x90\x5b\x6e\x36\xe0\x74\x1d\xb9\x56\x07\x24\x98\xce\x27\xc7\x01\xa2\x7f\xa9\xd2\x12\x29\x18\x9e\x7f\x83\x9d\x18\x10\x1f\x20\xc9\xab\x25\x20\x36\xa2\xc5\x0f\x5d\x4f\xd5\x14\x47\xcd\x89\xb6\x8b\x5e\xa0\x94\x16\x61\xc8\x29\x16\x54\x87\x2f\x9d\x58\xde\x29\xfb\x40\x10\xdb\x65\xc0\x09\x0b\x7a\xc1\x99\x48\x5b\x58\x3d\x02\xd9\x45\x65\xe0\xb9\x1d\x51\xc3\x29\xaf\x27\xd4\xf0\x8e\x8e\x12\x6b\xb1\xd6\x8f\x08\x92\x6a\x2f\x42\x23\xb5\xa3\xef\x3c\xa7\xb0\xe4\x1c\xab\x0c\x94\xd9\x82\xbc\x4a\xf7\x38\xea\xfa\x2b\x9e\xb0\xcd\xdf\xde\x9d\xe5\x6b\x0d\x2b\x22\xf4\x01\x96\xce\x90\xdf\x17\xe8\x6f\xff\x7b\xb1\x2f\x31\x39\xf3\x76\x12\x89\xd4\xc5\x6d\xef\x3e\x3d\x44\x43\x21\x1f\x1a\x2f\x9f\xad\xf6\x41\x95\xb1\x6d\x83\xdc\x53\xa2\x59\x50\xd8\x7b\x66\x73\x1e\xcb\xa7\x02\xe1\xe5\xc6\x22\xd5\xd6\x9c\x2d\xce\xb1\x2b\xf4\xa1\xbc\xa8\xb3\xd6\x9b\x0d\xff\x1a\xa1\x36\x78\xe6\x6e\xc9\x65\x67\xd7\xb3\x65\xa3\x12\x93\x83\x84\x68\x6f\xb9\xfd\x4c\xe1\x1b\xdf\x8c\xd2\xc1\x37\xea\x39\x34\xb2\xed\x6b\x30\xc7\x23\xe0\xc7\x32\x1f\x86\x34\x0b\xff\x4b\x16\x1a\xf5\x76\xa9\xa3\x11\x67\x1d\x6c\x66\x81\x20\x1b\x71\xad\xfe\x14\xf0\xe3\x8c\x9f\x02\xa4\x99\x5d\x57\x04\x9c\x14\x3e\xc7\x63\x16\x3e\xe8\xb3\x95\x31\x8d\x7e\x9a\xd5\xfb\xc2\x01\xcb\x16\xec\xf6\xed\xdb\x69\x85\x0e\xa4\x65\xf0\xc9\x67\x61\x5a\x3d\xd6\xc9\x70\x79\xf4\xfa\x3e\x59\xa6\xd6\x8e\x7b\xc2\x02\xa6\x7f\x7f\xe0\x09\xa4\x97\x67\x8a\xa2\xf5\x46\x5d\x5e\x6b\x31\xca\xef\x58\x90\x62\x58\x07\xa0\xa3\xc0\x66\x5f\x4a\x49\x90\xe4\xfb\x9a\x8d\xd1\x37\x25\xfc\x81\xc1\x18\xa2\x7f\x69\x5f\x6e\x12\x12\x99\x2e\x69\xb3\x47\x82\x86\x7e\x6e\xf5\xeb\x78\x83\x23\x3e\xc7\x40\x36\x2a\xef\xf4\xeb\x32\xb3\xa9\x8b\x2e\x6d\x01\x38\x55\xf1\x1a\x30\x28\xce\xaa\xb4\xfa\x0d\x96\x0b\x9e\xbb\xc0\x52\x96\x66\x97\xa7\x63\xe7\x40\x69\xbb\x6a\x94\xa2\x54\xae\xcd\x52\x1e\x55\xb7\x10\x06\xeb\x6b\xb0\xb7\xe1\x05\x8b\x22\xf5\xae\x9a\xb4\x1a\x66\x23\x07\x09\xf3\x68\x64\x94\x92\x6c\x39\x44\x34\x34\xd6\x2e\x3b\x15\xb4\xec\x7c\x82\x76\xe9\x98\xdc\xa3\x76\x3f\xb0\x24\xdf\x2a\x13\x53\x23\x9f\xa5\x48\x44\x98\xc2\x84\xa0\x9c\x82\x29\x52\x1a\x55\xd5\xb2\x36\x45\x55\x2b\x5a\x0b\x86\xe5\x6c\x71\x2c\x01\xd0\xca\x52\x4a\x65\xb1\x14\x71\xb5\x66\xde\xce\x8a\x57\x2a\x2b\xa6\xab\x58\x85\x83\xb2\x16\x37\x5e\x49\x52\xb4\x2a\x57\x86\x0a\x70\x5f\x74\xc8\xe7\xd7\x75\xe7\xea\xc4\x6a\xa5\xac\x62\x92\xdc\x9c\x2f\x19\x76\xc5\xa8\x43\x45\xc7\x0c\x8b\xff\xf7\x55\x42\x6a\x6b\x85\x40\x48\xde\x98\xb1\x54\xea\xcf\xea\x22\xb9\x1f\x1f\xa3\xfe\xca\x72\x0a\x62\x66\x28\x98\x8e\xf1\x12\x47\xd5\x0c\x13\x56\xa1\x99\x97\xb2\x1c\x9b\xf8\x4a\xa4\xe4\xb9\xb4\x34\x31\xf3\x2a\x46\xc1\xe8\x74\xd5\xd9\x22\x6a\x49\x7f\x01\x13\x5d\x40\xa5\x89\xfb\xa8\x40\x5d\x89\xaa\xc9\x50\xea\x93\x9a\xc7\x3d\xd3\xfe\x49\xc3\x70\xb3\x66\x99\x2a\x44\xf1\xb1\xc9\x66\x01\x98\x64\x50\x26\x73\x6f\x7c\xcf\xe8\x1f\x62\xeb\x1f\x1e\xf0\x26\x85\x6a\x62\x87\xd9\xbf\x4d\x4e\xfb\xae\x1a\xd0\x33\xf9\xb2\xd2\x52\x5b\xca\x77\x84\x48\x42\x36\xc8\x51\x3a\x3e\x7c\x4f\x29\x7c\x63\xf7\xf4\x60\x54\x4d\x59\xde\x10\x7d\xfe\xb1\x82\xca\xc0\xdd\xa6\xf9\xb2\xda\x99\x62\x8c\x7e\x6e\x23\xe9\x2f\x63\x34\xf9\x80\x72\x7a\xb4\xb5\x92\x04\x97\xd1\x7c\xcc\xb2\xce\x4d\x53\xd8\x9a\x46\x97\x08\xe1\x51\xbb\x74\x4d\xb0\x31\x75\xcb\x6e\xeb\xef\xa7\x04\x9b\x2e\x1f\x3d\xac\x0b\x20\x8a\xc7\x29\xfe\x0d\x50\xe0\x93\xc1\x49\x68\x2d\x38\x71\x96\x33\xfd\x4f\x94\xf5\xff\x9d\x32\x63\x5c\x1c\x65\xf7\x3f\x40\xe0\x4a\xf4\x3e\xbd\x81\x5b\xad\xbc\x11\x40\x69\xbe\x16\x66\xd4\x73\xda\x2b\x20\x69\xcb\xd2\x8c\xfc\x5b\x8d\x1c\xd3\x0b\xfe\xc9\xcc\x7b\xbc\xf1\x42\xfc\xc1\x18\x19\x9c\x5d\x80\x06\xdf\xe1\x9d\xa6\x27\x04\xeb\x72\xe9\x2d\x1c\x1b\x07\xb9\x75\xae\x8f\xcf\x0e\x55\x43\x08\xb6\xf4\x57\xac\x3c\x6e\x95\xac\xcc\xb8\xd9\x22\x97\xf3\xc3\x05\x53\xb5\xe2\x51\x1d\x43\xe0\xbe\x60\xfe\x24\xba\x98\x5d\x94\x9f\x7c\x35\x54\x8e\x29\xa0\xec\xfc\x0a\xdc\x0b\xa1\x38\xdb\x14\xe3\x64\x32\x76\xd9\x4c\x70\xb2\xcd\xb6\x5a\x95\xde\xcb\xf5\xdf\x29\x94\x6b\xe9\xe1\x0a\xc5\x7f\x6d\xc1\x0e\xbe\xc9\x92\x77\x23\x7c\x99\xdb\xe9\x52\x28\xc6\x95\xb8\x24\x9b\x10\xcd\xce\x18\x97\xd8\x4b\x71\xf3\x3c\x6c\xc6\x88\xc2\x52\xcd\x60\x93\x05\xff\x79\x9c\x9e\xb0\x0e\xd1\x1f\xca\xef\x65\x35\x59\x7f\x6c\x5f\xa4\xa9\xb9\xf7\x42\x0d\x43\x05\x15\x7e\x9f\xe4\x0a\x51\x95\x29\xd4\x08\xc7\xea\x0c\xa5\x99\x04\x6f\xdd\x3f\x9c\xac\xd9\xce\x45\x1a\x14\x38\x94\xc9\x06\xa9\x6c\x35\x16\x74\x36\x0d\x25\x22\xd3\x2e\x9b\xc1\x79\x54\x52\xa7\x73\x14\xda\xec\x04\xd2\x52\x10\xea\x1f\x9e\x70\xb6\x4f\x61\xc9\x52\x76\x1e\x7e\x4a\x99\xa3\x9b\x93\x17\xc1\xb3\x9c\x3a\x42\x89\x9e\xe8\x0a\xf2\x6c\x79\xe6\xcc\xa9\x52\x41\xeb\x18\xa8\x5d\x82\x50\xf5\x8f\x93\xd4\xc7\xf0\x42\xd5\x0c\xf2\x53\x26\xf6\xab\xdd\xf6\x23\x5d\xbd\x1c\xef\x82\xe6\xf9\x9c\x62\xf4\x48\x5f\xa1\x59\x0c\x14\x6d\xed\xb1\x70\x9f\xaa\xb9\xa9\xa4\xfd\x26\xca\xd9\x05\xd5\xcf\x6f\x2d\x17\x1b\x97\xe6\xaa\xfa\x78\x6e\xe9\xc7\xa6\x49\x18\x1a\x23\xae\x32\x25\x6d\x83\x44\x4c\x6c\x69\x1c\xfc\xd3\xde\xf1\xf1\x59\x69\x83\x21\xfe\xe7\x69\x44\x99\xf5\xa2\x71\x47\x53\x56\xaf\xd8\x75\x2d\x67\xcc\x8c\x13\xd1\xef\x91\x9f\xbd\xee\x52\xf7\xe6\x81\xa6\xcd\x23\xb8\xf4\x17\x3c\xa9\x52\x33\x75\x0f\xfa\x6c\xe2\x20\xed\x76\xf4\x78\xd8\x28\x10\xe4\x51\x6f\x58\x6e\x02\x26\xdb\xd3\x7f\x40\x86\x0a\x76\xb5\xa5\x1e\x43\x64\x87\xd4\x67\x3d\x1a\x78\xd2\x92\xa5\x3f\x25\xb2\x71\x2c\xa8\x65\xd0\x1f\x96\x3f\x07\x37\xd8\xa5\x1c\x09\xda\xd8\x82\x3a\x86\xdd\x05\xde\x29\x9c\x9e\xe2\x0c\xe7\x32\xe4\xe3\xdd\xab\x2e\xcd\xda\x3a\x43\x98\xae\xd2\xb2\xff\xbd\x02\x87\xf0\xa3\x1d\xa6\xbc\xde\xd1\x44\xe0\x75\xc5\xc7\x45\x82\x43\xb9\x8a\x59\x0b\x62\x8f\xe5\xba\xf1\xa2\x81\x22\xbd\xfd\xac\x05\x19\x2d\x5a\x4d\x2d\x05\x9d\xf4\x46\x12\x69\x64\xe4\xf7\x8b\xc2\x60\x02\x57\xb4\xda\xb4\x94\x1b\x61\x4c\x66\x67\x05\x31\x45\x33\xbb\xc7\x37\xc2\x89\x0a\x26\xb9\xd1\xae\xd5\xfd\x88\x4e\x06\x47\xe0\xe2\xf3\x16\x7e\x2b\x1f\x0d\xc4\xd1\x56\x96\xea\x3f\x0f\xef\x7a\x54\x56\x8c\x22\x62\xc8\x04\xd3\x23\xd1\xc5\xfe\xab\x91\xc2\xd5\x8d\xbf\xf1\xbc\xd0\xad\x45\x61\xc8\x09\xcf\x7f\x01\x84\x1a\x06\x0d\x8c\x51\xe7\x70\x90\xc2\xb9\xa3\x97\x81\x5e\xa4\x3f\x52\xfb\x98\x6b\x46\x43\x1f\xe1\x09\x1d\x88\x33\xaf\x18\xcf\xb2\x03\x75\xaa\xc3\x74\xc5\xbd\x97\x1a\xb2\xa6\xb9\x76\x97\x6f\x09\x79\xa6\xa7\xc8\xaa\xf1\xc6\xd3\xa7\xfe\x7c\x65\xcc\xfe\x06\x87\xfb\x83\x84\x45\x8e\x41\x28\xe1\x60\xbe\xc8\xb7\xff\x00\xe3\x4e\xd9\x64\xd4\x2a\xec\x95\xd1\x6c\x8c\xc7\x48\x38\x28\xc5\xe7\x5f\x24\xa5\xa1\x0c\xbd\xa9\xf2\x6c\xc7\x29\xaa\xc8\x32\x5f\xbb\x32\x34\xe3\xb4\xb2\x4c\x91\x33\x2e\xbf\x09\x32\x4e\xaf\xca\x8f\xd3\x8d\x46\x94\x4b\xa4\xe3\x2b\xd3\x3e\x58\xa3\x90\xec\x57\x24\x45\x87\x55\x8c\xf7\x48\x49\xa7\x59\x3b\x9d\x55\x63\xd3\x4e\x61\x97\x50\x46\x51\x4e\xce\x86\x49\xed\xb9\x42\x96\xa0\xdd\x26\xb0\x70\x3b\x04\xab\x2c\x92\xff\x3b\x43\x64\x87\xe8\x0b\xb1\xdc\x60\xe3\xa6\x3b\xb1\x37\x8a\x2f\x2a\xb2\x03\x5b\x06\x5d\x9b\xc3\x8a\x3e\xb4\x5d\xdc\xb6\x70\xf3\x03\x4e\xba\x33\xbc\xb2\x4d\xa6\x50\x82\x96\xba\xeb\x43\xa0\x12\x9b\x90\x77\x7a\xab\xc5\x6a\xc0\xab\xb0\x6a\x52\xe5\x8d\xab\x0f\xfd\x21\x1f\x34\x59\x7b\x18\x00\xae\x56\x5f\x20\xe0\x2d\x9d\x48\xec\x10\xce\x5a\x4e\x83\x7b\xda\x9d\x4e\x51\xf3\x25\xcb\xf0\xdf\xc1\x8b\x0a\xa8\xaa\xb9\xab\x27\xce\x49\x45\xd9\x96\x4d\x67\x37\x56\x3d\x9f\xff\x9e\x4c\x56\x6b\x46\x4d\xa8\x1c\x4a\x52\x38\x1a\xe1\x05\x80\x60\x66\x66\x35\xba\x50\x14\x1c\x5b\xd9\xa1\xed\x8b\x02\xd5\x70\x43\x7a\xa9\x5f\x0d\xaf\x8b\x66\xd4\xb5\xc0\x42\xd2\x32\xb1\xb4\x79\xe3\x99\xca\x46\x41\x02\x3e\xd7\xc2\xe5\xb7\x3e\xfa\x1a\x1e\xc0\xe2\x56\x33\x17\x0a\x8b\xf2\xd3\x39\xd6\x5f\xac\x49\xb4\x70\xf7\xde\xbd\xef\x54\xb6\x3b\x9f\x58\x78\x10\x05\xa8\xfd\x54\x9a\xd6\x47\x6a\xfa\xfa\x07\x88\xc0\xc3\xe3\x62\xaa\xe6\x1a\x53\x3f\x3e\x4f\xa5\x63\x74\x2f\xcc\x0c\x9f\x6b\xb8\xc7\xf0\xf2\xc6\x38\xa7\xb0\x89\x67\xa0\xef\xe5\x94\x11\xec\xaf\x3f\xc8\x3f\xcd\xae\x2d\x5b\x17\x56\xb0\x98\xce\x35\x1d\xbe\xe1\x39\x29\x69\xe0\xf1\xb0\x2f\x36\xf5\x80\x86\x66\xcb\x57\x2b\xdb\xf2\xf7\x65\x69\xf9\x06\x9e\x25\x3c\x36\x6c\x57\xdf\xa5\x90\xd2\x45\xaa\xa9\x58\xdf\x0d\xc3\x2d\x8c\xc3\x52\xba\xfa\x4f\xd5\xef\xa0\xb5\xe7\x45\xfa\x0f\x4b\xd4\x5d\xa7\x1d\xd2\x86\x66\x17\xa9\x63\xb9\x4a\x0c\xbc\xfe\x87\x28\x04\xcd\xe0\x32\x5e\x84\xd9\x20\x39\xb8\x93\x83\x99\x25\xc4\x09\xe7\xd2\x6c\xa3\xd5\x1e\x65\xd9\xea\xff\x8c\x35\xbe\xe6\xf2\x16\xf6\x48\x05\x8e\x3c\xde\x03\xa1\x24\xeb\xc3\x49\x76\x5b\xd5\xad\x61\xa6\xee\xa3\xbc\xed\x2a\xe5\x96\x04\x5c\xdf\xef\x9a\x36\x5e\x3f\xc0\x04\x67\xe6\x1e\x65\x5b\x69\x1f\xae\xe3\xa1\x76\xf2\x21\xfe\x43\x29\x96\x89\x78\xec\x67\x18\xe4\x39\x28\x38\xf8\xb3\x6d\xcb\x8b\x45\x07\xcd\x15\x3b\x45\x35\xaa\x6a\xcb\x72\x1a\xbf\xc5\x70\x29\xe3\xe1\x2b\xd5\xe2\x0c\x95\x32\xed\xab\x5c\x88\x2a\xd2\x0e\xbe\xae\xac\xf1\xd6\xc0\xd0\x11\x8d\x59\xad\x3a\xfa\xf0\xc3\xab\x29\x4c\x70\xe8\x18\xeb\x48\xe5\x20\x74\x1a\x9b\xef\x83\x7b\xea\x26\x02\xed\xd4\xcf\x8b\xeb\xd2\x7b\xec\x00\x1c\xa5\xb1\xdb\xcf\x43\x61\x7c\xcb\xb8\xae\xae\x52\xf5\xd9\x59\xa2\xfa\xc3\xc2\xba\x9f\xb7\x65\x5e\x36\x81\x67\x87\x4d\x98\x95\x84\xf2\xff\x00\xdd\x48\x4d\xf2\x7d\xac\xd1\x29\x28\x59\x34\x00\x98\x1f\xb6\x1e\x11\x47\x0d\xf8\xb4\x7f\xc0\x4b\x27\xec\x8b\xcb\x12\x67\x15\x62\xd9\x41\xd6\xd5\x61\xef\xcb\xf6\xdb\xdf\x5a\x1b\xfe\x5b\x20\xd5\xc2\x31\xd8\x2e\x7f\x28\x0a\x67\x7d\x51\x65\x56\x34\x62\x7a\xd8\xa2\x54\xc3\x60\xca\x5e\x41\xc6\xf8\x4a\xd9\x83\xda\xea\x6a\x56\x4a\x5d\x5d\x2f\x5b\x6e\x18\xee\xff\x7b\x53\x89\xbb\x4b\x47\x5e\x76\x76\xae\x2d\x80\x9d\x2a\xd2\xe2\x26\x06\x2d\x53\x92\xa2\xca\x3d\xf2\x97\x6d\x48\x3c\xb7\xec\x0b\x52\xd4\xdd\x40\x58\xe5\xb0\x1d\x72\xc3\xde\x63\x25\x24\x19\xc4\xec\x45\xd5\xfa\x76\x85\x81\x8b\x60\x17\xab\x12\x50\xd7\xa1\x42\xb1\xb1\xb0\x56\x40\x75\x2c\x2f\x6d\xb0\x5e\x69\x1e\x7c\xb3\x65\x41\x49\x53\x18\xa2\x90\x31\x99\xaa\x07\x61\x2b\x6c\x19\x6e\x31\xe4\xbb\x82\x94\x6b\x95\xdf\x9e\xec\x45\x28\x80\x0b\x2f\xfd\x95\xb5\x65\x52\xae\x35\x8b\xb9\xf9\x67\xaa\x2e\x73\x5f\x55\xfa\x02\x43\x3a\xf5\x1a\x60\xfe\x05\x1a\xdb\x9b\xc9\x7a\xfb\x46\x60\x75\xd0\xf6\x9d\x75\x8d\xa7\x73\x9d\x8f\x10\x9d\x40\xf9\xeb\xfa\x95\xb1\xcc\x16\x07\xac\xbd\xce\xe4\x15\xbd\xbe\x87\x06\xc1\xf5\x85\x52\x4f\xb5\xaf\x76\x8f\xa8\x78\xa7\xf8\xec\x04\x4e\x73\x55\x26\x56\x6a\x5f\x39\x3f\x5d\xfc\x36\xbd\x1b\x9f\xcb\x67\x96\xa7\xfb\x12\x7d\x9c\x32\xe8\xb1\xc2\xea\x4e\x32\xbe\x96\xf1\x99\xa7\x84\xef\x70\xa9\xce\x0a\x18\x09\x53\x3c\x2b\xb6\x80\x76\x39\xd2\x46\xcc\xb3\xc5\x56\xda\xff\x4c\xc4\x39\xab\x94\x1d\x27\xfb\x3a\x8f\xbd\xca\x5c\xb8\xe6\xec\xa6\xd3\x96\x12\x26\x2a\xde\x09\xf2\x28\x8f\xbb\x6a\x7e\x34\xc3\x5f\x4e\x95\x08\xf6\xd9\x62\x3d\xcf\xb0\x8f\x77\x91\x04\xef\x93\x6a\x77\x3f\x97\x22\xc8\x90\xda\xfc\xcf\xff\xee\x74\xfe\x9e\xc1\x25\x9e\x62\x37\x55\x06\x69\xb7\x88\xf1\x10\xac\x69\x6e\xc4\x45\x4b\x9b\xca\xea\x31\x3a\xfb\xf9\x5e\xbe\x25\x9e\x45\x53\xef\xd9\x53\xf0\xa7\xee\x4a\xdb\xe2\xc8\x0f\xf0\xa5\x26\x8e\xf6\xbf\x49\x91\x83\xdb\xcb\xd1\x1f\x3c\x6b\xa0\x72\xc4\x2d\x92\x3d\x5c\x90\xbe\x32\xec\x09\x92\xeb\x51\xf4\x75\x4d\x72\x45\xeb\x77\xbe\x29\x18\xba\xf9\xcf\x66\xb5\x94\xba\x17\x60\x39\x54\x51\x23\x0a\xa6\x74\x39\x07\xae\xb2\x85\x37\x7d\xb6\xec\x35\xc2\xeb\x7a\x11\x15\x76\xac\x62\x63\x54\xab\xc3\xf4\x69\x7b\xf5\xea\x1f\x4c\x77\xe4\x00\x09\x2c\x2a\x3e\x4f\xd0\xaa\x3d\x2e\x9b\x05\x49\xb3\x91\x24\xe1\x76\x53\x19\x46\x79\x09\xd1\xb9\x9d\x00\x55\xa4\xda\x62\xa5\x9f\xec\x94\xad\x13\xcb\xc6\x28\xa0\x0d\xdd\x1c\xf3\x11\xf5\xe9\x32\x24\xdd\x37\xdd\x0d\x6c\xb1\xa2\xe1\xed\x50\xb6\xd2\x8f\x7e\x14\x89\x76\x93\xfb\xb5\x43\x4d\x01\x8c\x56\x0b\x39\x1e\xcc\x22\x6b\x0f\x99\xa5\x2d\xef\xce\x11\x30\x02\x8e\x4c\x10\x68\xf3\xa9\x6a\xb7\x5c\x90\x0f\xf5\x26\x08\x8e\xa9\xf6\x2c\x1b\x00\x27\x98\xd9\x41\x50\xb5\xea\x69\xf6\xc3\xbd\x6c\x8b\xcd\xc4\xc5\xde\x77\x15\xe7\x02\x60\x95\x8a\x5b\x1a\xcb\xeb\xe9\x7d\xfd\x8c\xf7\xe0\x4e\xdc\x23\x07\x1b\x01\x81\xf7\xd3\x05\x71\xb5\xde\xbd\xa7\xb2\xff\xe0\x3c\x56\x2a\xd8\x0b\xaf\xc2\xc1\xad\xba\x6b\xeb\xcf\xda\xac\x22\x49\xf0\xe4\xbc\x4d\xad\x64\x04\x0a\xf6\x1b\x3c\x1e\x84\x54\xc2\x03\x5d\x77\xef\xab\x6e\x20\xcb\x73\x9d\x2c\x08\x54\x70\x27\xf2\x84\xac\xaf\xb4\xdc\xab\x7c\xf5\x5f\xb6\x6a\x20\x70\xbf\x5d\x32\x13\x0d\x0d\x92\x2d\xca\xe6\x00\x42\xcb\xa4\x14\x05\x26\x7e\x04\xd7\xbc\x12\x4a\xbe\x97\xc0\x2d\xcb\x10\x53\x9a\x8b\xc9\x2c\xe1\x12\x34\x95\x6f\x9b\xa6\x64\xda\xb9\x08\xa3\x1c\x5f\xe7\x64\xc3\xc1\x9d\xfb\x82\x1a\x5c\xb2\x47\x01\x0c\x51\x95\xf3\x0f\x41\xbd\x85\xfa\xb5\x9a\xba\x6c\x87\x3c\x29\x19\x50\x38\xe6\x8a\xb6\x5c\xc7\x2a\x62\xb1\x02\x04\x03\x57\x5b\x2a\xab\x28\x97\xc8\x42\x59\x46\x15\xb9\xf7\xfe\x7a\x8d\xb2\xc0\xff\x69\x00\x87\x5c\x43\xad\x76\xe1\x10\x9c\xfa\xe9\x30\x5f\xb1\xe4\xfa\x53\xa8\xe1\xb9\x4d\xaa\x6f\xa7\x55\xda\xb3\xd6\xe5\xdd\xf6\x69\x64\x10\x5d\x5e\x15\x24\x69\xfe\x0d\x32\xa0\xff\xb1\xbb\x02\xfd\xc8\x5a\x2b\x62\xf3\x46\x4a\x71\xb5\x5c\xe9\x20\x6d\xc0\xa9\xe7\xea\x5c\xee\x0c\x7d\x19\x07\x51\xe5\xe5\xe5\x65\x91\xaa\x94\x97\x31\xc4\x67\xaa\x78\xeb\xe1\xfe\x8d\xbc\xc7\x2b\x0e\x4b\x46\x70\x8c\xe6\x5c\x31\x58\x18\xc6\x7c\x15\xca\xa5\xc6\x0b\x25\x78\x3b\x55\xaf\xc4\x71\xf3\xe7\x78\x9c\x11\x6b\xdd\x3e\xd4\x87\x2c\x17\xca\x2b\x4d\x9b\x90\xd5\x5e\x31\x13\x69\xd5\x61\xa9\xb3\xb0\xa0\xfe\x8b\x62\x17\xc5\x68\x8e\x22\x16\x65\xea\xe0\xaf\x0f\x29\x43\x0f\xbb\x60\x32\xac\xc5\x58\xeb\x96\x7d\x97\x56\x2a\x0e\x81\xad\xaa\xfe\xe3\x85\xad\x52\x32\xaa\x55\x15\x65\x4d\xd9\x78\xc9\xab\x66\xfa\x49\x8b\x00\x98\xe6\x6c\x82\x01\x24\x2b\x0d\x95\xb2\x58\x9e\x45\x20\x1e\xe7\xb0\x13\x21\x99\xb8\xaa\x36\xcb\xa2\x91\x35\x30\x7d\x38\x08\xc5\x9d\x63\x1b\x49\x73\x35\x8a\xdb\x2a\x86\xb9\xe9\xc7\x1f\x3f\x4c\xc4\xc0\x26\x75\xa4\x1b\xf9\xce\xa4\x2b\xbc\x14\xae\xac\x21\x4b\xbd\xba\x96\x35\x93\x55\xde\x11\x7e\xde\xbb\x8e\x84\x21\x94\xdd\xc2\xac\x3b\x1e\x36\x5c\x48\x7b\x2b\x52\xfd\x4d\x60\xae\xcc\x20\x05\xc6\x96\x1d\x09\xb8\x22\xa2\x19\xc3\x88\x19\xb7\x8a\x63\x81\x64\xd5\xc7\xdc\x46\xc0\x0c\x5c\x05\xab\x53\x28\x19\x6e\xd9\xe8\x2e\xf9\x7e\xa4\xa9\x7c\x1c\xfe\x93\xa3\xbe\xed\x34\xba\x20\x45\xfe\x55\x2d\x42\x63\x1a\x2e\xd7\x81\x5c\x1e\x9b\xdd\xe9\xa8\xa5\xf2\x71\x95\x96\x52\x22\xd3\x26\xf1\x3f\x8c\x90\xbd\xc8\xef\xe2\x93\x5d\x7f\x7c\x42\xfa\x86\x0c\x75\xd5\xab\x9f\xa5\x7b\x70\xe3\x40\xff\xf6\xd8\x45\x61\xa2\xdc\xcb\x4b\xe3\xd7\x79\x8f\xb1\x1d\x78\x3f\x04\xfb\x22\xf7\xc6\x8e\xb5\x6f\x4a\xc8\xb8\xe7\x29\xe5\xd3\xf1\xe7\x82\x76\xb2\xc4\x97\xee\xee\xc6\xa2\x5f\x60\x5b\x39\x96\xb1\xa9\x5b\x6c\x86\x3c\xbb\x9e\x1d\x9c\x3c\x63\xd7\x9b\x5b\x05\x72\x75\x50\xca\x5a\x50\xd7\xf6\x60\xad\x9c\x4b\xdd\x01\x62\x23\x56\xce\xa6\xfd\x76\x99\x49\x46\xed\xaa\x99\x29\x68\xc4\x30\x6a\xc2\x08\x95\x96\x57\xc3\xe3\xc3\x4d\xd9\x71\x79\xc9\x94\x2a\x72\x25\xb6\xdc\xeb\x60\xb1\xf5\xf7\x81\x98\x3c\xac\x7e\xba\xdf\x49\xd0\x44\x6e\x86\x6a\xac\x93\x6c\xb6\xd3\xd7\xec\x09\x9e\x75\xb8\xcd\xa3\xe0\xd7\xae\x11\x88\x3b\x86\xb1\x4d\xa9\x67\x75\x63\xa3\x2d\xb2\xa2\x20\x11\x27\x1a\x8b\x33\x5b\x34\x5f\x39\x54\xea\x4c\x04\x89\xd8\x24\xf5\xa3\xef\xe3\xf4\x3f\xc0\x92\xe3\x7d\xe4\x06\xb3\x6e\xfa\x48\x37\xe4\x92\xf7\x03\xbf\x7d\xe3\x8d\x6f\xb3\x51\xe9\xa7\x19\x3d\xc8\xfd\x0d\xa1\x1c\x47\x27\xc8\x28\x35\x85\x58\x51\x3b\x39\x64\x94\x32\xe1\x0f\x34\xb7\xb2\x89\x97\xfe\x3f\x77\xf8\xa0\x45\xf5\x7f\x63\xc5\x5d\x56\x66\x95\xd9\x65\xaa\x08\x84\x17\x06\x01\xc6\x4b\x0f\xe4\x08\x06\xe7\x18\xdd\x01\x39\x4d\x1e\xfd\x3d\x3c\x63\xca\x46\x71\x7f\x86\x54\x55\x85\x23\x84\xb4\x49\xfe\x96\xe8\xde\x84\x70\x96\x2e\x3d\x1e\x67\x27\x98\x97\x2b\x67\x44\x9b\xf5\x88\xe2\x5a\xb5\x3e\xb6\xfe\x82\xb5\x4b\x45\x7d\x11\x86\xdd\xcb\xd9\xe7\x51\x69\x1a\xe0\x1e\x4d\xab\xf0\xdc\x49\x7e\xc1\xbb\x9c\x64\x11\x5c\x1f\x9f\x67\x0c\xf4\x09\x9a\x55\x31\x7f\x47\xee\x85\x19\x71\xb9\xf7\x7d\x3c\x0e\x70\x81\x40\xe0\xd3\x31\x30\x0e\x34\x71\x55\x2d\xdc\x18\xb3\xb6\xe0\x65\x34\x35\x55\x64\xcf\x07\x0d\x63\x77\x46\x86\x8b\xbc\x8c\x1e\x4e\x18\x73\x52\xc2\x1a\x6a\x56\xf5\x60\x09\x23\x2f\xab\x32\x9d\xca\x7e\x40\x81\x43\xb8\x6c\x6e\xc2\x92\x3b\x15\x19\x28\xb9\xcb\x59\x9c\x5d\x74\xdf\xfb\x27\xe1\x6d\xbe\xe1\x90\xc8\x6d\x88\xcc\xbe\x85\x5d\x0f\x47\x39\x7c\x4a\xca\xc8\xa4\x39\xca\x58\xed\xd3\x1f\xd1\x1b\xe5\x07\xeb\xa2\x06\x4f\x2e\x9c\x0f\x47\x50\xa0\x14\x2f\xa5\x75\xa5\x3d\x53\xc9\xfc\xe5\xf7\x53\x33\x96\x15\xce\xaf\x90\x45\xda\xf6\xf3\x76\x3d\x8f\x2f\x6e\xf3\xd3\xb1\xf9\xa0\x33\xeb\xef\xf7\xf2\xb4\x68\xf4\xe3\xab\x28\x57\x65\x3d\x42\x27\x5a\xa5\x36\x64\x0f\xca\xcb\x8c\x28\xcd\xc5\x9f\x19\xf3\xfb\xe2\x2a\x9c\xe9\x00\x29\x44\x18\x5b\xaa\x99\x99\x9e\xcd\x24\x65\x08\x25\x2b\xba\x69\x66\x5c\xac\xa7\x95\xa7\xb0\x0d\x5d\xda\xa8\x9d\xb3\xce\x68\x85\xf0\xc7\x03\xea\xf5\x85\x70\xcd\xb1\x7f\xbb\xe6\x5e\xdd\x5b\x5d\xd1\xfa\xc0\x8f\xb3\xf3\x14\x5e\x29\x03\xd5\x1f\x10\x03\xa0\x57\x99\xe8\x1f\xc0\x20\x80\xb2\x33\xe4\xbf\xd1\x1f\xe7\x14\x1e\xff\x07\xa9\xf8\x86\xa4\x37\xaa\xa4\x83\x3a\x4d\x63\xf7\x9a\x26\xe0\xe8\x01\x61\xdd\x7a\x78\xa4\x39\xc9\xd4\x66\x85\x07\xb1\x8d\xff\x71\x41\x5b\x54\xbb\xd9\xbf\x92\x11\x01\xf6\x59\x5d\x6d\x38\xbb\xc6\x36\x1b\xf3\xeb\x5f\x9f\x6c\xa0\x8f\xa3\x32\x15\xb2\xce\x0d\xc1\x58\x46\xb6\x86\x56\xf6\xf2\x55\x71\xc7\x98\x61\xdf\xb8\x54\x21\x6e\xd9\x2c\xc9\xb4\x74\x8d\xce\x30\x62\x64\x28\xe9\x05\xc0\xbd\xbb\x11\x60\x73\x79\xf5\x0a\xc8\x41\xc1\xd5\xfe\xe1\x11\x24\x04\x5b\xed\x18\x74\x2e\x6e\x3d\x94\x70\xb7\xfc\x68\x1e\x70\xc6\x35\x1f\x74\x21\x89\x4b\xc0\xb9\x6c\xe1\x16\x6d\xb3\xe6\x37\x57\xe2\xf9\x74\x70\xe7\x69\x44\xbc\xfa\xa5\x03\x2b\x0f\x98\x9c\xbd\x5a\x33\xa2\x29\xb7\x95\xf8\x37\x37\xc1\x8e\x4e\x35\x7c\x00\xe3\x7e\x31\x6d\xba\xac\xb5\xbd\x74\xe3\x73\x99\x65\xd4\x71\x68\xcb\xd9\x23\xd6\xe1\x1c\xf6\x4c\x88\x03\x0d\xca\xc1\x0c\x23\xc1\xa4\xd7\x4f\x7f\x56\xe6\x9e\xbb\x49\xd3\xd0\x44\x37\xd5\x22\x69\x7f\x98\x69\xbd\x9c\xa8\xc9\x20\xb1\xd1\xf1\x23\x0f\x49\x06\xa8\x9f\x5d\x51\x31\xec\x22\x70\xcf\xb6\x84\xb5\xeb\x34\x3e\x83\x03\x8d\xb9\xef\xdd\xdb\xd7\xd6\xc4\x6a\xfe\xa1\x7f\xb9\x51\x3e\xf5\x87\xbb\x88\x53\x6f\x1f\xd6\x52\x3c\xb9\x89\xf0\x59\x7e\x35\xe8\x92\x14\xbf\x98\x1b\xf8\xcf\x07\x19\xb7\x4c\xc4\x7c\xab\x4f\xe6\x24\x70\x20\x32\xf5\xd8\x2d\x97\xeb\xc3\xb3\x17\x49\xe9\x09\x83\x05\xec\x11\x7f\x54\xd3\x00\x77\x17\xbb\xba\x6f\xcc\xa9\xde\x53\x63\xbe\xe6\x18\x1d\x86\x2d\xfd\x0f\xb3\xc3\x98\xf9\x61\xc7\xb2\x53\x55\x23\x61\x29\xf5\xd8\x52\xb5\xeb\x68\x62\xec\xb5\x89\x01\x57\x63\x05\x6e\x21\xc4\xb1\xad\xac\xec\xb2\x38\x74\xe9\x2b\x3a\x61\x53\x22\x92\xbb\x15\x7b\xe8\x2b\x31\x9c\xbf\x3b\x1f\x58\xe2\xf4\x12\xb5\x9d\xf1\xf3\x85\xe1\x53\x42\x1c\x50\x3f\x1d\x79\xe2\x5f\x57\x80\xae\xb5\xc5\xe1\x06\x55\xdd\xa1\xa6\xaf\x7f\x63\x5e\xcf\x48\x36\x4d\x9a\xea\xc7\x59\xc1\x44\x1c\x4f\x64\x46\xf8\x1f\xff\xc7\xd9\x70\xfc\x37\xd2\xbd\xa9\xd4\x71\x6a\x86\x9c\xfa\x87\x1e\x20\xef\x4a\x14\x43\xd5\x8c\x62\x8b\xd0\x08\x71\x7b\x64\xf2\x72\x4f\x37\xf1\x63\xcb\xee\x7f\xc0\x38\x56\x29\x2c\x0f\xa5\x82\x3e\xd8\xcb\x60\x59\x8f\xe1\x68\xf9\xf6\xf0\x99\x97\x52\xcc\x9f\x56\x14\xbf\xa7\xa0\x82\xc3\x1f\xd6\x12\x5f\x8e\x39\xd8\xa4\xf5\x55\x9f\x6f\x18\x37\x79\x4c\x0c\x68\x4a\x08\xf5\x47\x08\xf6\x43\x7b\xf2\x21\x12\xdc\xcb\xc0\x66\xd4\x64\x35\xf1\x76\x52\x8e\xdb\x1d\x9b\x52\x26\x28\x6c\x16\x6e\xdd\xc1\x47\x37\xde\x4f\xce\xb8\xe1\xfd\x9a\x0c\x0f\x8b\xa9\xe8\x80\x94\x13\x95\x75\x28\x52\xc6\xe4\x23\x7e\xef\xcb\x95\xeb\x5e\xdd\x5d\xc1\x8d\xee\x8d\x1c\x91\xd5\x80\x74\x28\xab\x86\x9f\xf5\xf6\x4b\x2b\x2c\x21\x55\x39\xd0\x59\x02\x87\xd9\x9b\xfa\x1f\xff\x4a\x65\xc5\xbf\x71\x7f\xcc\x36\xc5\xbe\x6b\x55\xd5\xc1\xd3\x0a\x88\xb2\x77\xab\x4b\x69\xef\x1b\x71\x7a\x22\xdd\x10\x12\xea\xc1\xec\x53\x74\x3e\xd0\xe3\xa4\x59\xed\x3c\x8f\xbc\x41\x2f\x53\x0e\xb7\x73\x93\xcd\xaa\xa2\xc9\x97\x5c\x81\x20\x27\xe3\xb2\xd5\x29\x32\x9d\xcd\x04\x20\xd7\xb8\x75\x52\x61\x57\x1b\x91\x5d\x6e\x4f\xca\xe5\x02\x12\xcf\xbe\xd0\x28\x43\x36\xb6\xbf\x87\x3c\x01\x22\xe4\xf1\x19\xe0\x3f\x6d\x26\x0f\x2b\x90\xa5\x90\xbe\xb9\x25\x02\xab\xdc\xe8\x88\xac\x53\xb6\x77\x95\x86\x36\xac\x7d\x8d\x29\x98\x01\x6d\xa4\x53\x4a\xa0\xec\xe1\x7a\xc5\xc2\xf2\x93\x77\x97\xbb\x60\x19\x4e\x02\x19\xe8\x46\xe5\x36\xca\x5d\x5e\x59\xfd\xbd\x0d\x0f\x2a\x37\x46\xc4\x1c\x17\x28\xd3\x6e\x17\x69\xde\xe9\xb1\x1a\x22\x71\x2f\xee\xde\x9c\x1f\x63\xaf\xa8\x4b\xfe\x46\x57\xa8\xa0\x52\xfb\x0e\x12\x81\xb5\x4c\xe0\x88\x18\x77\x45\xec\xdd\x77\xc8\x13\x7a\x16\xc9\x30\x7d\x13\x7e\xb7\x53\xd6\xcd\x68\xe8\xb1\x9d\xc2\x2d\x90\x90\xbc\xae\xbd\x72\x0a\xcc\xc6\xe3\xc9\xfe\x76\x67\x42\xbb\x96\x72\x6b\x56\x35\x8c\xd3\xd5\x1e\xe9\x81\x86\x98\xdc\x81\xee\x45\x30\x11\x5b\x85\x8d\xea\x6e\x03\xef\xaf\xc0\xd9\x6b\x32\x5b\x59\x6c\xd0\x60\x51\x0b\x03\x58\x86\x43\x25\xca\x9b\x66\x9f\xa1\x6c\xc4\x84\xa8\xa3\x9d\xe8\xd6\xc0\xa5\x42\xde\xce\x49\x19\x12\xdb\x68\xdc\x7d\xdc\x65\xa5\x0b\x78\x53\xf7\x80\x5f\xea\x10\xda\x1a\xdf\x5a\x46\x9d\xb6\x9d\x7c\xb7\x4d\xd0\x17\x1a\xf7\xb4\x9b\x9e\x20\x87\xe8\xe3\xd3\x29\x7a\x7a\x1f\xf5\x7f\xd3\x3f\xca\xab\x8a\x64\xfe\xf0\xf6\x12\xde\x6b\xd1\xb9\x00\xf5\x51\xe7\x37\x74\xce\x63\xc4\xc1\xa1\xa0\x35\xff\x7c\x12\xb7\x9d\x72\xcf\x58\x61\xa3\xff\x71\x13\x27\xdd\x01\x11\xa5\x88\x8a\x78\x8a\x43\x56\x52\xf0\xc3\x0f\xd6\x39\x4e\xf5\xda\x4c\x2a\x13\xcf\xaa\x26\xc4\x06\xeb\x75\xb6\x15\x96\x0f\xf6\x37\x1c\xe5\x1a\x1e\xab\xc4\x8a\x28\x07\xe1\x5d\xc4\xd3\xce\x5b\xa6\xb2\x7d\x5b\xfe\x6c\xb8\x7b\xc7\xf9\x8a\x8f\xc8\x83\x3b\x98\xe5\xce\xa4\xb8\xc3\x44\x2f\x78\xea\xdd\x26\x3b\x85\xff\xf8\x97\xa7\xb2\xdb\x82\x82\x96\x97\x85\x1b\x32\xc0\xe4\x4d\x0c\xfd\x94\x5f\x11\xff\x3c\x5a\x18\xa4\x9b\x63\xc5\x30\xf6\x4e\x6f\xc8\xf7\x63\x74\x5f\x99\x01\xb8\x96\x19\xbc\x41\x97\xe3\x59\xcf\x38\x8b\x8e\xa7\xf4\x1b\x65\xa3\x50\x69\x40\xef\x01\xc2\x8b\x73\xf6\xca\xb3\x97\xd1\x17\x04\x91\xb3\x2a\x41\xb0\x64\x6f\x8c\xc7\x65\xd3\x02\x0a\xaa\xaf\x70\x8b\x57\x6a\xed\x76\x70\x35\xd0\x4e\x2d\x74\x88\xb0\x53\x13\x82\x9a\xcc\xe8\x48\xc8\x5a\xdf\x63\xd8\x5e\x99\x4e\xfe\x14\xc2\x78\x2e\x3f\x92\x54\x95\x7a\xa2\xce\x2b\x84\xeb\xcb\x92\x11\x47\xa4\x2f\x54\x97\x73\x10\x1d\x35\x65\xf0\x68\x98\x84\x38\x1f\x9f\x40\x24\x8e\xf7\x88\x9d\x14\x1b\x1b\xec\xdf\x1d\x04\x51\x6f\x96\x53\xf7\x12\x56\xa7\xd9\xcd\x52\x0c\xfb\x08\xd6\x68\x05\x3d\x1e\xd2\xf3\x1d\x59\xb2\x5e\x7a\xec\xf2\xb1\x65\x97\x70\x3e\x0f\x0a\xa0\x1f\xef\x20\x10\x70\x33\xdf\xc8\x1d\xf3\x78\x28\x5e\xe3\x11\xb6\x4e\x65\x34\x47\x90\x1e\x26\x2d\x07\xf5\x21\x60\x07\x75\x0a\xc7\xc1\x6a\x2e\xa3\xe4\x87\x3e\xfb\x28\x0d\xf6\x0f\x55\x2c\xf2\xc9\xfd\xcc\x20\x8e\x8a\x8c\x6e\xfb\x5a\x58\x66\x55\x26\x80\xed\xb3\xf8\x3c\x5b\xe1\x9e\xe1\x7b\x75\x29\x1c\xe8\xa7\xe5\x80\xbe\x74\x9c\x66\x4a\xa2\xdd\x30\x79\xfb\x8a\xf1\xf0\x08\x5e\x80\x12\x01\xd0\x85\xe0\xfa\x05\x63\x46\x3e\x19\xfd\x87\xd9\x6f\x63\xcd\x4f\x61\x4e\xe0\x08\xd4\x93\x83\x17\x65\x8d\xcb\x2a\x47\x4a\xc9\x5b\x83\x42\x40\xc0\x5f\xad\x8a\x35\xc5\xbe\x80\x84\x02\xfc\x18\xa4\xd4\xcf\x95\x51\xb2\x4f\x0e\x01\x9c\x92\x0f\xeb\x5f\x9e\x61\xd3\x52\x96\x78\xa7\x7e\xf4\xb2\x07\x7b\x26\x9b\xf2\x62\xab\x57\xce\x45\xb6\x29\x1e\x5b\x9d\x96\x20\xa5\x36\xb9\x1d\x46\x5b\xa7\x9d\xb5\x44\xfb\x80\xf5\xe6\x54\x1f\x58\x4a\xd1\x60\x07\xc8\x58\x5c\x1f\xaa\x9c\x99\x77\xed\x92\xb9\xd7\x90\xec\x3d\xbc\xb8\x5a\xf7\x2e\x36\xba\x14\x55\xff\x2d\x39\x9b\x3b\xfb\xf3\x7e\x99\x93\xc1\x6d\x28\x14\xda\x8f\xde\x52\x70\xf5\x2e\x22\x34\x50\x96\x5b\xee\x5e\x38\x62\x25\x89\x54\x4f\xe9\x9c\xfb\x17\xda\xba\x6c\xb2\x1f\x2b\x53\x58\x57\x6a\xc4\xf6\xb1\xf4\x96\xc1\x6f\xf6\xf0\xdd\x1e\x9f\xb0\xe2\x7a\xf4\x91\xcf\x47\x2b\x2e\x35\x0e\xa8\x47\x31\x66\xff\x32\xe0\x6f\xe6\x9c\xc6\xc6\xca\x30\x9a\xc6\x2f\x62\x81\x48\x07\x1c\xcf\xc2\x6c\x18\xc0\x0c\x17\xcc\xe0\x0a\x84\x11\x68\x29\x66\x4a\xcd\x5a\x05\xd4\x34\x58\xb9\x38\x04\x7e\xc8\x28\x01\x29\x48\xf8\xd1\x02\x19\x2c\x75\x06\x05\xdf\x6f\x8d\x3d\x10\x07\xa8\x44\xb3\xb7\x8c\xaa\x5d\x6d\x19\xf7\x7d\xf5\x46\x46\x42\x8a\x86\x72\xd4\xf0\x98\xae\x61\xee\x89\xac\x96\xf6\xfe\xef\x9c\x53\x68\xb5\x43\x1b\x0d\xba\x41\xb5\x6c\xd0\x91\xd9\xf8\xec\xdf\xc4\xa3\xfa\x9f\x13\xf6\x2c\xee\x6e\xb4\xd5\xf6\x6a\xcd\xef\xb7\x2c\xbe\xf2\x45\xa1\x58\x61\xca\xaa\x57\xe1\x48\x4d\x0e\xb5\x25\x5e\xce\x72\x45\x8f\x4b\x1d\x33\x8c\x3c\xf1\xac\xa0\xb6\x3a\x83\x50\x8c\x7c\x4d\xe1\xeb\x63\xea\x19\xcd\xb5\xf6\xdb\x3d\x68\x20\xf0\xac\xc1\x87\xe6\xf0\x89\x72\x9b\xcb\x76\xfe\x15\x1d\x04\x14\x7b\xb6\x0c\xce\x43\x6e\x50\x65\x50\x77\x1c\x59\xdc\x23\xb5\x25\xd6\xa4\xfa\x31\xe7\x2c\x1d\x55\x06\x9c\xcc\xb2\x26\x5b\xb4\x92\xff\x1d\x59\x78\xe9\x72\x6e\x26\x30\x2d\xe8\x23\xcd\xf2\x39\x44\x00\x2f\xd9\x7e\x18\x57\xee\xeb\x52\x36\xd0\x6a\x5d\xce\x5c\x6a\xdc\x19\x20\x23\x54\x96\x5b\x75\xb7\x33\xe7\x41\x4a\xec\xb2\xa1\xdc\x47\xf5\x07\x76\x18\xea\x24\x99\xb1\xcf\xf4\x5a\xdd\x9c\x7d\x3d\xb2\xcc\x9e\xc5\x78\xe6\xae\x82\x51\xd0\x35\xb5\xa5\xb3\xb4\xba\x47\x08\x90\xd8\x0c\xe0\x5f\x79\x87\x8f\x26\xc3\xc3\x25\xa6\x1d\x99\x93\xba\x0b\xdb\x80\x94\x83\x68\x25\x40\x8d\x7d\xf1\x28\x50\x1f\x02\x3f\x3e\x74\xd0\xf5\x53\x93\x4e\xb1\x19\x96\xb2\x5d\xf7\xde\x61\x06\x9b\x92\xb7\x53\x88\x48\x4d\x90\xd0\x87\x82\xb0\xda\xeb\x00\xc6\xc8\xd2\x32\xe7\xa1\xec\xda\x62\x8b\x04\xc5\x87\x9a\x05\x7c\x0b\x9f\xc9\x32\x6f\x25\x98\xd0\xe0\xf7\x90\xa0\x7b\xa5\x1b\xb8\x16\x09\xb9\xa8\x90\xb8\x5f\xb6\x4e\xb4\x61\x7e\xe6\x9f\xd1\xdd\x06\x19\xa8\x3e\x7b\x97\x82\xcf\xb2\xb7\xd2\xfc\x23\x93\x30\x6f\x3f\x7f\xfa\x32\xeb\x94\xe5\x8b\x7c\x86\x7d\x4b\xbd\x5c\x87\xa0\x85\xb8\x49\xbf\xcd\xb9\xe4\x6a\x20\x2c\xb5\xa2\xb7\x6d\xa6\xfa\x02\x07\x64\xff\xd3\x1e\xe3\x52\x8a\x92\x9e\x7f\x53\xc4\xe2\x76\x56\x5b\x11\x26\x2e\x56\x2a\x39\x9c\xc7\xc0\x05\xd7\xab\x5f\x1c\x47\xe2\x9b\x67\x3c\x06\x30\xf1\x74\xb5\x2b\x08\xb7\xd8\x65\x0c\x1d\xcb\xdb\x77\x68\xf8\xe5\x15\x7d\x11\xa8\x6b\x70\x38\xc6\xdd\x3f\x36\x02\x10\xc1\x78\x23\x7d\x02\xd9\xe1\xe5\x45\x9f\x3a\x22\x7b\xe2\x54\x90\xa4\x5c\xa4\x55\xd1\x3f\xf2\x1c\xf0\x12\xd8\xba\x9e\xa9\x1f\xf6\x3d\x78\x84\xaa\xf0\xe1\x7e\xe6\xc3\x04\xb8\xc7\xf8\x13\xed\x69\xe8\xcf\xdd\x53\x58\x0d\x11\xc0\xbd\x4c\xbe\x08\x28\x45\xa2\xe1\xb0\x1d\x72\x26\xdb\xf7\xc8\xad\x59\xba\xf6\xe4\xa6\x08\x0a\x01\x9e\x1f\x1c\x77\x2c\x6e\xd5\x6b\xb0\xf1\xc7\x70\x7e\xec\xfe\x39\x9c\x4e\x6e\x2a\xd7\xd9\xaa\x1b\x51\x29\xce\xb0\xa1\x1d\x36\xbb\x76\x0f\x30\xed\xb0\xa5\x19\x7a\xcd\xc7\x65\xc7\x38\x6c\xf2\xb0\x82\xa0\x3d\xd9\xe1\x2c\x67\x87\xe4\x4c\xc1\x12\x1a\xa4\x2d\x18\xe4\xe3\x3c\x84\x2b\xcc\x90\x42\x56\x81\xf3\xe1\x57\x53\xc0\x90\xba\x41\x7d\xc8\x72\xbd\x74\xf6\x9b\xe1\x21\xd6\xbf\x8b\xc3\x7d\xdf\xf2\xe5\x3f\x75\xdf\x54\x86\xdd\xc1\x54\x60\xeb\x62\x83\xb6\x45\xbd\x0d\x34\x87\x75\xb5\x7d\x25\x4d\x40\xcd\x30\xe5\xec\x9c\x75\x1b\x3d\x52\x7b\x22\x4f\xb4\x71\xab\x57\xba\xac\xb4\x2d\x67\xb8\x5c\xd0\xa4\x72\xc0\x08\x53\x11\x9b\x1c\x23\x92\x0a\xf5\x4a\x50\x6c\x3b\x20\xf1\x0e\x1b\xaa\xea\xf3\x0a\xfb\xec\xa0\x92\x5c\x91\x98\xd5\x37\xf5\x5e\x36\xe3\x62\x81\x40\x06\x61\x6d\x3c\x7a\x04\xea\x95\xa0\x1d\xaa\x59\xba\x7f\x05\xeb\x02\x76\x94\x5c\x72\x7a\xd1\x6a\xfa\xe5\xef\xa3\xaa\x96\xfd\x0e\x4b\xed\xb1\x51\x7a\x48\xd1\x04\x23\xed\x8f\x5a\x26\xa4\x7a\x07\x2b\xa4\x9c\x00\x4d\xbf\x89\xfd\x51\x16\x15\x14\x5c\x65\x76\x72\xbb\xa4\xcc\x96\x6c\x95\xa4\x2d\x4c\xf4\xcb\x06\x1e\xde\xf5\xb4\x37\xab\x74\xc8\x6e\x4b\xef\xd0\x03\x76\x9b\xd7\xf2\x2e\x7f\xec\x35\xd3\xe5\x33\x50\xf7\x2e\x07\xf5\x02\x3f\x83\xff\x6a\xc9\x43\xce\x94\xe8\xc8\x91\x3b\x94\x12\xaf\x08\xc3\x51\xff\x64\x8c\xf6\x08\x1a\xbf\x6e\x9b\x48\x3c\xe6\xfb\xd1\x4e\x71\x67\x65\x38\x77\x87\xfc\xbc\xe4\x0b\xd8\x95\x6d\xd1\xef\x4d\x1d\x92\x2f\x2f\xcf\xb2\x9f\xd2\x3f\x29\x87\xb9\x5e\x04\xb9\x8b\x23\x52\x97\x1f\x10\x22\xb7\x0a\x32\x42\x37\xd1\x89\x62\x52\xd6\x00\xc8\x2e\x79\x2f\x12\x7a\x3c\x83\x77\xff\x18\x58\x5c\x7e\xa8\x31\x26\xa7\x96\x96\xa5\x6a\x19\x54\xbc\xa6\xcd\xef\x6a\x67\x6c\x01\x84\x02\x34\x35\xfe\xea\x9c\x0c\x57\x6a\xa6\x4d\xa6\xa2\x89\x42\xfb\x14\xd6\x73\x3e\xd2\x88\x32\xc4\xe8\xab\x4c\x94\xa4\x87\xec\xfe\x7e\xee\x55\x8f\x8f\x93\xb9\xde\xef\x05\x94\x3a\xfd\xbd\x3e\xa6\x3b\x47\x73\x48\xc2\x9d\x8f\x01\xf6\xe5\x72\x30\xb5\x43\xfe\x72\xa1\xa8\x68\x3c\x28\xab\x58\x35\x12\x88\xce\x11\x56\xb9\x68\xd8\x98\x91\x40\x73\xee\xea\xd5\x8b\x23\x8a\xfa\x6d\x67\x0f\x1e\xd6\xa2\xef\x17\x7e\x64\xcd\x16\x92\x30\x13\x48\xd4\x5b\x21\x14\xee\x6f\x31\x59\x81\x58\x06\xf6\xd5\x6d\x53\xcd\xf7\x93\x7f\xb7\x94\xfb\xeb\xb5\xee\x80\x60\xa2\x3b\xfd\x05\xa4\x11\xf6\xc2\x7e\x76\x17\x74\x94\x2e\xbd\x4c\x42\x09\x07\x2b\x30\x4d\x3e\xd1\xc2\xe9\xf2\x9f\x7d\xeb\x22\xb8\xa6\x39\x23\x0a\xb0\xd9\xce\x45\xd3\x3d\xb5\x14\x41\x3f\x81\x6a\xcb\x46\x72\x5b\x7c\x85\xa4\x9f\xb0\x85\x52\x1d\x76\xc9\xfd\x3c\x82\x81\x02\x2b\x81\x46\xe6\x68\xcd\x34\xd6\xee\x0e\x13\xa8\xde\xaa\x98\x9a\xf1\x72\x93\x00\x41\xc5\xad\x9d\xe3\xb8\x52\x93\x44\x0f\x69\x2a\x6e\x8a\xfc\xa4\x43\xb7\x4c\x41\x7e\x6a\x2c\xfb\xbd\x04\x40\xdc\x7a\xd6\x06\x25\x73\xa8\x01\x1a\xec\x99\xec\x7b\x0e\x1e\x85\x9a\x3d\xed\x53\xf6\x28\xee\xf2\x04\xfb\xe3\x55\x7e\x33\x77\x69\xca\x95\x42\x0d\x9a\x44\x14\xfb\x6e\x05\xc7\xe5\x4a\xce\x27\x6c\x73\x99\xf4\x26\xa2\xd2\x14\x69\xa8\x57\x83\xbd\x2b\xc9\x64\x6a\x14\xad\x97\x09\x6f\xa2\x95\xa6\xda\x40\xe2\x88\xdd\xa8\xc5\x70\xeb\x87\x51\x72\x8c\xbf\xaf\xae\x77\x68\x25\xa8\x17\x9d\x06\x26\xd9\x7a\x73\x0b\x21\x90\xed\x11\x20\x83\xe7\x6a\x53\x3e\xd6\x52\x0a\x87\xbe\x8b\xa6\x15\xb6\xb1\xaf\x2b\xdf\x49\x86\xe7\x0e\x70\xb2\x7b\x9e\xde\x01\x82\x0c\xca\xd9\xd3\xb0\x88\x4d\x44\xf4\x6e\x70\x40\x5f\x5a\xde\x4c\x3c\xd5\x3f\xca\x0a\xf9\x18\x27\xfb\x2d\xdb\x4a\x4c\x59\x6f\xf6\x9e\x4d\x6e\x81\x36\x99\x4e\x07\xf9\x9c\x3a\x76\x96\x46\x2f\xeb\x6f\x24\xd4\xa9\xc3\xa4\x44\xc2\x37\x6c\xde\x82\xde\x01\xe3\x3d\xf7\x9d\xf8\x65\xbc\xcb\xdc\x40\x9b\x7b\xf5\xa0\xfa\x66\xb7\x06\xf2\x0d\x2d\xfd\xb2\x89\x2b\xb3\xf3\x5f\x28\xcb\xb1\xd0\xb5\x17\xb3\x9d\xf8\xf5\xbe\xc6\x21\x18\xa7\xaf\x91\x67\x1c\x49\x8c\xb3\x05\xa0\xe5\x20\x4b\xf8\x73\x92\x8f\xe6\x9e\x0f\x68\x0d\x6d\xed\x2a\x95\xbd\xd2\xc5\x59\x82\x53\x41\x7b\x86\x9d\xfa\xbd\xbf\x3a\x53\xcb\xbd\x1a\x59\x55\xc3\xbd\x2a\x09\xe9\xa5\xdc\x0f\x3e\x8d\xab\x15\x1e\xe2\x1c\x67\x97\xe8\x64\xe7\xcb\x8e\x7c\x3d\x26\x1b\x57\x18\xc7\xf6\xd9\x25\x00\xc9\x3e\x56\xcf\xc9\x16\x06\x97\xe5\x3a\x9d\x84\x44\xb4\x41\xa2\x56\x28\x3e\xe0\xb4\x85\xc1\xb8\x69\x09\x87\xe1\xac\x0b\x46\xd4\x1d\xbc\xc5\x76\xa6\x06\x4c\xdd\x27\xc7\xb6\xd2\x3b\x58\x96\x06\xf8\x28\xaa\xff\xdf\x94\xa1\x68\x74\xb7\xc0\xa1\x9c\x9a\x7f\x49\xa6\x04\xd4\x02\x5c\x2d\xa2\x68\x18\x73\x3c\x46\xb7\x08\xdb\xde\xa3\xa6\xda\xf1\x98\x96\xba\x37\x31\x5c\x70\x03\x5b\xc2\xbc\x2d\x91\x94\x4a\xa8\x39\xd2\x4f\x49\xd0\x8e\x98\x57\x18\x9f\xf9\xa9\xa1\x3c\x89\xce\x93\x5c\xda\xc5\x95\x19\xef\xf7\x68\x42\x55\x67\xbb\xe3\x6a\xea\xd0\xb2\x4d\xbd\x21\x73\x40\x60\xe3\xa3\x1e\x13\x31\x9f\xb2\x4d\x2f\x55\x15\xbb\x3b\x33\x14\x5a\x37\xb2\x56\xd8\x91\xdf\xa7\x20\xb6\x72\x91\xdb\x2c\xfa\x28\xfb\x1e\x1b\xa6\x43\xff\x61\xee\xca\x63\x93\x9f\x23\x60\x2b\x35\xa6\x90\x13\xe5\x5e\xcd\x72\x31\x82\xfa\xe8\xf2\xf4\x41\xc0\xe9\x3b\xb5\x13\x61\x2a\x56\x4e\x1a\xfd\x18\xad\x3c\x5f\xcb\x2d\xfb\xd7\xb2\x4e\xb7\xf8\x59\x95\xa8\xc9\x26\x6a\x9c\xa5\xed\x19\xcd\x9c\xf2\xf6\x48\xcd\x28\x5b\x90\x10\x51\xe4\x5f\xab\xad\xcb\x0c\x23\xa8\x6d\xeb\x7f\x7d\x63\xb1\x87\x3b\x5f\xa5\xbe\x0a\xbb\x3c\x59\xe7\xa9\x0b\xa2\xdf\xde\xd6\x79\xa0\x90\x54\xf9\xc6\x39\x45\xc0\xec\x6a\xd1\x39\xb4\x1c\x97\x97\x1e\xb5\x1c\xb7\xda\x91\x89\x3e\x8c\x5b\x2e\x41\x37\x8f\x47\x0f\xb6\xf1\xbd\x85\xda\x43\x44\x04\xdf\x81\x0d\xa8\xce\x9a\x30\x5d\x17\x1b\xc5\x3d\x1f\x35\xd4\x39\x2a\xb3\xa0\x1d\x11\x39\xb6\x12\x24\xc4\x9f\x32\x44\xd0\xaf\x49\x33\x8c\x73\x35\x05\x65\x6e\x12\x59\x20\x54\xbe\x78\x7e\x81\x2d\x42\xac\xa2\xd2\x84\x8c\x32\x3f\xc8\x4d\x34\x67\x88\x4c\xe9\xb1\x4e\x82\xda\xe0\x05\xda\xd5\xe6\x0d\xaa\xfc\xba\xbf\x2f\xbb\xeb\x23\x0c\xbb\x31\x0e\xcf\xfd\x55\xd6\xa4\xce\xaa\x0a\x5a\x0c\x5c\x1d\x94\xf3\xb7\xaa\x49\x8a\xc4\xde\xe5\xa1\x3b\xb4\x83\x29\x9b\x8f\x72\x9d\xd8\x40\x69\x35\xc5\xfa\x66\x47\x3e\xbb\xce\x96\x8f\x20\x36\x2f\x28\x28\x63\xd9\x0a\xcb\xc1\x41\x5e\x6d\x30\xde\xfb\x68\x00\x73\x55\x13\x3f\xb0\x6e\x9e\x84\x0f\x3c\x0c\x16\x0a\x34\x5f\x6b\x15\x95\xb4\x52\x3c\x94\x21\x7f\xd4\x72\x91\xe1\x3a\x72\xc3\xc7\xbc\x93\x60\x89\x6c\x5d\x70\x95\xd8\xeb\xc1\xed\xd2\x5e\x3b\x85\x7c\xa9\xce\xac\xf8\x2e\x73\xb4\xd9\x5a\xb9\xd3\x15\x21\x8f\x78\xeb\x4d\x3e\x65\xff\xc2\xcb\x6f\xc9\xa0\xb9\x69\xf2\x5f\x32\x10\x5c\x55\x9d\x0b\x2d\x16\xfa\x18\x01\xb0\x53\x63\xe8\x8d\x9d\x0a\x75\x2c\xe2\x13\x60\x94\xd4\x9b\xd4\xf9\xf8\x56\x17\x6b\x09\xb5\xe8\x22\xbe\xe8\x5c\xa6\x6c\x93\xaa\x67\xc5\xe5\xcf\x26\x3e\xce\xe0\xc6\xb7\x7a\x3b\xe8\x5f\x49\x5e\x92\xb9\x06\xbb\xe1\x42\xc4\xd1\x7a\x97\x5c\x7d\xa8\xe6\xcc\xc9\x0a\xd1\xea\x3c\x6a\xc2\x22\x7c\x26\x23\xdd\xd1\xe3\x98\x2d\xc2\x41\x70\xfc\x32\x80\x78\x18\x55\x93\x4d\x3d\x7a\x76\x49\x16\x10\x00\xad\x07\x2f\x62\x94\xa7\xeb\xb6\xd3\x6d\x97\x42\xad\x4f\x94\x6b\xae\x46\x9b\xb3\x33\x7a\xe6\x4a\x8e\xc3\xa8\x7d\x44\xe3\x69\x3b\xf2\x79\xf7\xa8\x66\x7d\xd1\x7b\x48\x31\xc4\x8b\xfc\x9b\xe6\xb0\x5d\x81\x08\xc7\x2f\xfc\x63\x83\x0c\x94\x79\xb5\xe3\x33\x13\x8e\x33\xbb\x26\x98\x24\xd3\x87\x6c\x7f\xf8\xda\xb3\x0d\x75\x56\xb1\x0d\xd2\x6b\x06\x79\x4b\x20\x9b\xd8\x42\x67\xb8\x54\x94\x6d\x35\x49\x30\xe3\xfe\x27\xee\x0c\x7f\x57\x35\xae\xca\x6a\x1a\x62\x1d\x30\x6a\x64\x52\x01\x5d\xda\x2e\x6e\x4c\xf9\xab\x4c\x0d\xb9\x6d\x73\xfe\xd8\xac\x5a\x79\x42\x7a\x99\xa9\x0d\xd0\x0a\xf9\x77\x7a\x6e\xda\xae\x3e\x45\x93\x78\x0a\x23\x7d\x8e\x41\xb3\xff\xc9\x9f\x4d\xa7\x10\x8c\xa1\x37\x31\x4d\x98\xf7\x68\x2e\xcc\x92\xdb\x1e\xdc\xb6\x5b\x8d\x29\xf3\xaa\x89\xcc\x67\x34\x59\x25\x4d\x86\xd3\x60\x05\xed\xcb\x7c\x79\x5e\xf4\x99\xb6\xcc\x57\xa1\xee\xa9\xb1\x65\x7e\x18\xab\x34\x32\xb2\x74\x87\x42\xf3\xcd\x56\xd9\x10\x43\x51\x73\x90\x55\x4a\xc2\x9e\x42\x1d\x9f\x0f\x35\xc7\xda\xa2\x3c\x3e\x91\xde\xf7\xb8\xd6\x13\x0e\xcd\x5f\x29\x05\x2e\x1f\x97\xdf\xff\x24\xf4\xa1\x4f\x7e\x66\x43\x28\x67\xfb\x52\xc8\x49\xe7\x91\x91\x83\x70\x63\x6e\xb2\xb3\x94\x7f\xd4\x76\xa6\x15\x22\x27\x24\x04\xcd\xcb\x64\xbf\x1f\xe7\xb2\xfa\xaa\xf3\x84\xa4\x90\x48\x54\x4e\xf3\xb9\x94\x7a\x6a\x13\xe9\xa5\xfc\x20\xca\x43\x4b\xe3\xf3\xe4\xad\x7d\x41\x1e\x89\x33\xf9\x70\xca\xd7\x6c\xd8\xce\xe8\x14\x0e\x50\x48\xc4\x50\x1c\x16\x20\xac\x6a\x21\x61\xcd\x8b\xbd\xf9\xb0\x39\x53\x0b\xd1\xbe\xaf\x8f\x07\x6e\x62\xd5\xb0\x6d\x69\x89\x8e\x2a\x49\x1f\x72\x07\xee\xa1\x03\x98\xbd\x91\x18\x22\x98\x61\xd0\x81\x1b\x56\xd8\x70\xf1\x0b\x28\x9b\xfd\xdc\x8e\x66\xcd\xac\xd1\x63\x42\x55\x21\xfb\x8b\x52\x87\x4c\x91\xe9\x82\xa6\x12\x14\xdc\xfe\x4b\x0f\x2b\xf3\x9b\x1a\x4c\xa1\x7b\xbf\x57\xd1\xe9\x3d\x8b\xaf\x75\x77\x8e\xfd\xdd\x2d\xb6\xfb\xe8\x66\x0f\x1d\x19\x35\x48\x9b\xb9\x33\xfd\x3f\x5d\x0d\xb0\x64\xb4\xd3\x7f\x29\x55\xa9\x23\xfa\x98\x95\xdb\xff\x1a\xdd\x84\xd9\xfe\x36\x7e\xd3\x4e\x70\x4f\x27\xe4\xcb\x22\x21\x3f\xc5\x50\x0e\xea\xbd\x7e\x7d\x6c\xba\x0e\x98\xd0\x3c\xb9\x7b\x74\x8c\xf6\x4f\xc4\x3e\xc5\x7a\x21\x9f\xa8\xbd\x97\x06\x75\x91\xe0\x05\xa8\x87\x86\x57\x44\x2f\xe4\x40\x7e\xfd\xfe\x07\x3b\xff\x44\x6c\x61\x96\x85\x5e\x6c\x17\x1e\x05\x79\xa2\x2f\x75\x96\x1b\x38\xe7\x12\xd0\x48\x77\x0e\xda\x2a\xb2\xa1\x14\x4d\xa3\x13\xf2\xcf\xde\x82\xa4\xe8\x29\x8d\xf4\x69\x0e\x6a\x0d\x84\xad\xf5\xfe\x14\xd6\xb9\xf5\x60\xbb\x99\x52\x33\x7d\xa5\xab\x95\xad\x27\xe5\xfe\x49\x1a\xa4\x25\xbc\x39\x08\xef\x77\x63\x67\x65\x50\xa9\x6e\xbc\xc7\xe8\xc6\xf4\xd7\xaf\x8e\x78\x23\xdf\xc6\x50\x42\xf9\xc9\x73\x8d\xdf\x77\xce\x9b\x29\x36\x97\xa5\x46\x7f\x0f\xa5\x52\xeb\xb6\x29\x7a\x48\x7e\x65\x10\xc1\xf1\x33\x97\x57\x94\xf7\x34\x52\xdd\x1e\x9b\x16\x78\xc5\x05\x58\x6e\x74\x8a\x87\xe3\xee\x92\xee\x23\x71\xcd\x4b\x5d\x4b\xb7\x92\x6b\x57\xc2\x63\xf7\x65\x4a\xe5\xf8\x4f\xbe\x89\x44\xf7\xa2\xb5\x8b\xe2\x75\x8a\xf6\x8e\x75\x37\x35\xd2\xad\x9a\x6f\xa0\xba\x88\x2c\xb6\xda\xc3\x5a\x0c\x9d\x52\xbf\x95\x6a\xa4\x81\x8c\x1b\xfb\x5b\x90\x78\x5a\x7f\x4e\x9b\x38\x5a\x52\x84\x34\x82\xe0\xf3\x94\x95\x38\x95\x05\x6b\xd4\x1f\x52\x2c\xc4\xb6\xe0\xd0\x30\x23\x50\xc3\xdd\xa4\xea\x3e\x8f\x61\x68\x03\x4a\xb9\xb5\x45\xe2\x75\xb9\x30\xfe\x92\x86\x08\xbf\x66\xf3\x86\x61\x70\xed\x18\xb1\x75\x65\x82\x37\xbf\xa7\xac\xb1\x5c\x07\x21\x5c\x62\x3e\x74\x15\x2e\x9d\x4f\xa5\xc5\x49\x71\x93\xe4\x23\xc9\x96\x53\x04\xdd\x80\x1c\xe4\x09\x1e\x6a\x26\x30\x66\x9d\x11\x07\xd5\x93\xdb\x47\x66\x21\x35\xe7\xdf\x9f\x65\x4b\xbb\x23\x4a\x9a\x13\xc1\x24\xea\x9e\x9c\x8a\xd0\x6c\xe0\x46\x53\x05\x4b\xea\xf6\x50\xae\xa4\x76\x52\x9f\xec\xb7\xb1\xb9\x29\x45\x2f\x24\xbb\x64\x94\x59\x27\xb4\x4e\x39\x18\x52\xcd\x04\x34\x97\xff\xc2\xb8\x3d\xbd\x3d\x6f\x7a\x2c\x35\x9d\x28\x40\xce\xa5\xeb\x11\x93\xa1\x0e\xbe\x68\x41\xea\x18\x95\x79\x5b\xf2\x82\xa6\x6f\x9f\xef\x2c\x54\xa2\xe9\x9d\xe6\xd6\x98\x2e\x0d\xe5\xb7\x8b\x84\x26\x0d\xab\x13\xd9\xca\x70\xd0\x5f\x9b\xb2\x43\x8a\xa8\xf4\x74\x85\x07\xa6\xf3\x17\x95\x9c\x0c\x30\x0e\x1b\xe6\xa8\x51\x14\x1a\x27\x14\xa1\xe1\xbc\x0f\xef\x54\xde\xec\x55\x59\x04\x92\xc2\x95\x81\xb0\x2d\xd9\x4c\xec\xb2\x16\x68\x5d\x85\x57\xca\xe1\x2e\x47\x19\x27\xed\x79\xd2\x5a\xca\xa2\xe9\x13\x6e\x1e\x91\xb2\x6e\x2a\x91\x92\x79\xd9\xc2\x01\x53\x49\xba\x29\x01\xe1\x69\x6e\xce\xe9\xab\x8d\x94\x75\x03\x2e\x9e\xd2\x19\xca\x56\x47\xb9\xe2\xd3\xe0\x02\xa2\xcc\xc5\xfb\x53\x29\xe2\xe3\xe6\xa6\xd3\xfd\x8e\xcf\xed\xcf\x50\x13\xc9\xbb\xd7\x05\x9f\xc3\x1e\x1a\x96\x6f\x22\x23\xcd\x96\x21\xa4\x0e\x5b\x04\xf5\xc3\x2e\x7a\x38\x43\x1c\xd6\xb4\x78\x6f\xf7\xd7\xf3\x6b\xfa\xe4\x0f\xf3\xd5\x3f\x99\x2c\xf7\x4f\x6a\x35\x19\xd1\x2e\x53\xcd\xa3\xed\x72\xfc\xb0\x33\x77\xb9\xf5\x1d\xee\xad\xbd\x91\xff\xa3\x1f\x1b\x71\xe3\x1e\x4c\x65\x82\xe1\xa9\x02\xa7\x10\x5e\xb7\x6f\x98\x07\x6b\xe2\x7f\x33\x0b\xd5\x43\xef\x20\x21\x5d\xe8\x9d\xe1\xb0\xc8\x17\xfd\x25\x72\x52\xb4\x93\x2e\xbf\xe0\xf2\xa9\x5a\xc5\x3c\x44\x70\x4e\x99\xa6\x45\x49\x7b\xb1\x73\x27\xd2\xd2\x8a\xc0\x9b\xe8\x10\xd1\x9e\x9b\xa7\xa7\xda\x4a\xd8\x7a\x0e\x95\x75\x64\x24\x21\x6c\x30\xd1\x3e\x3a\xc2\x3a\xb3\xbb\xdc\x38\xd8\x40\xa2\xb3\xd2\xd4\xdb\x9a\x73\x51\xde\xfd\x8d\xba\xac\x71\xf2\x6e\xfd\x78\x2b\xbb\xf5\x70\xdf\x15\x8e\x59\xd5\x47\x73\xfb\xdf\x19\xe9\x0d\x78\x53\x96\x4d\x6d\x67\xf0\xdf\x68\x3c\x62\xfa\x12\xb3\xce\xa3\xe1\xa4\xcc\x11\x53\x9c\x62\x8a\x3b\xa8\x5e\x9e\x39\x72\x6f\xfe\xa0\xa2\xc0\x7f\xcd\x48\xdd\x12\x7d\x29\x93\xd3\x77\x60\x02\xfd\xc4\x80\x8f\x1f\x93\xe8\xa3\x87\xcd\x6f\x39\x14\xc3\xa9\x5c\xf0\x9c\x29\x0f\x68\x4e\xfc\x5b\x7c\x65\x40\xf0\x08\x67\xb7\x4e\x86\x32\xee\x92\x6c\x35\x95\x9e\x7f\x58\x14\xb8\xbf\xdd\x86\x79\x07\x99\x72\x3f\xf7\x2b\x0a\x74\x87\xd5\x69\x50\x68\x38\xb6\xfe\x4b\xf6\x27\x1a\x36\x6e\x7e\x95\x01\x5a\x3d\x4b\x1f\xfd\x2b\xf4\x4d\xfd\xd4\xa6\xb3\x59\x0f\x7a\x56\x0c\xf8\x2f\xf3\xc3\x4a\xda\x9c\xc6\xed\x53\xd6\x1f\x3c\x2a\xef\xe9\x9d\xc2\x21\xa5\x37\x70\x89\x4d\xe3\x10\xfd\xaa\x20\xd6\xa9\x5f\xa5\x06\x52\x59\xa0\x7a\xb9\x42\xa2\x67\x15\x00\x83\xfa\x57\xa2\x3e\x4d\x4a\x0d\x5f\xc7\xff\x50\xa1\x9c\x39\xb1\xa6\x3f\xdd\x40\x41\x87\x11\x42\x44\xe9\x0d\x1a\x32\xb7\xb2\x91\x46\xde\x39\x5f\x75\x96\xe7\xde\x6e\xfb\xc1\x9d\x35\x97\x9a\x4b\xd3\x58\x19\xd6\xfb\xd3\xa8\x04\xa9\x51\x7e\x43\x65\xe3\x0a\x66\xa0\x3b\x62\x76\x0a\x7d\x98\x35\x84\x01\x56\x4c\xdf\x39\xf6\xd1\x98\xa3\xfc\x5f\x3d\x40\xc0\xd5\x62\x77\xec\xbd\x63\x64\x77\x06\xd1\xa9\x7b\xa6\xda\x75\x97\xda\x50\xf2\xab\x9e\xc1\xeb\xa6\x4e\x0d\x35\xcb\xb0\x4d\x01\x88\xee\xe9\xdd\x89\x14\xa8\x94\x89\xf8\xc8\xe5\x2b\xd7\x64\x48\xa7\x14\xf1\xe1\x12\xf8\xfe\xf6\xca\xdf\xd3\xe3\xe7\xe1\x1c\x8a\xb6\x9e\x7a\xd0\x38\xb0\x13\xc6\xca\x87\x83\xd5\x0d\x91\x4d\xee\x31\x54\x2a\xa9\xd9\x16\xbe\xc5\x1b\x6c\xb8\xf2\x76\xbf\xd9\x76\x25\xfa\x50\xb9\xf3\xdb\x2d\x65\x98\xde\xe2\x36\x9a\x60\x55\x83\xde\x69\x88\xac\x1e\xd9\xab\x9f\xbe\x14\x5b\x4c\x9e\xd4\x88\x71\x16\x8d\xdb\x79\xeb\x77\xe7\x4c\xfc\x3d\x77\xf6\xd6\xca\x7e\x5a\xd3\x15\x01\xbf\x84\x30\x0c\x1d\x0a\xbd\x04\x9d\x44\xbf\x7a\x75\xf1\x6a\xa1\xdf\xea\x47\x05\x26\x57\x3d\x18\x01\xf3\xe8\x04\x76\x63\xa5\x6a\xd1\x6c\xec\x26\x75\xd8\xf2\x96\x63\xd4\x15\x93\xe8\x77\x50\xea\x38\x75\xe5\xe6\x3d\x1c\x67\x48\xa1\x54\x2b\x4f\xe2\x00\xec\xfd\x78\x0a\x96\x8b\xa2\x66\xe0\xad\x9f\x9f\xf2\x83\xb1\x95\x75\x12\xa6\x52\xb0\xa2\xda\x6f\x67\xf9\x12\x92\xed\x5a\x22\x5e\xd1\x4d\xbc\xb3\x8b\x16\xde\x41\xd9\xc9\x7e\x1d\xf4\x71\xc0\x32\x3c\x94\x65\x3c\xd0\xf0\xab\x2f\x09\x33\x9b\xae\x8a\xcf\xbe\x4c\xd3\xa3\x37\xe8\xbf\x8d\x33\xc0\x98\x24\x56\x97\x33\xa9\x38\xb0\x6f\x8c\x7c\x52\x3d\x86\x0f\x8c\x15\x63\xa8\xfa\xa2\x6f\x98\x86\x1a\x02\x89\xbe\xff\x95\x7c\xbf\x57\x70\x09\x63\x91\xf5\xf1\xa3\xfb\x6b\xc8\x0c\x6a\xd7\x1b\x51\x6e\x04\xad\xdf\xd4\x4f\x7c\x65\x31\x5f\x56\xc0\x5c\x6c\xfa\x29\xd0\xa3\xaf\x92\x36\x72\x68\x37\x77\x16\x0f\xfa\xea\x29\x1b\x52\x1d\xc9\xbe\x75\x1f\xf1\xd1\x5f\xf1\x67\xb0\x08\x56\x07\x71\x4b\x66\x4d\x52\xd1\x62\x0d\xdb\xd2\xe5\x2d\xb2\x3d\x66\xb0\xc9\xf4\x61\x43\xd1\x6d\x35\x5b\x30\xc5\xa3\x87\xa8\xbf\x21\xc3\x98\xbf\x29\x3f\x20\x8a\x4b\x86\x7e\x2c\x6d\xa0\x93\x79\x8c\x5e\xa1\x1b\x79\xe7\x01\xeb\x03\xad\x21\xe5\x20\xbe\xb7\x45\xfe\x1b\x3e\x7f\xcb\x66\xe2\xf8\xdb\x95\x62\xb4\x8c\x55\x9c\xbf\xf4\xef\xe9\x23\x16\x72\x19\xb6\xd9\xdf\xc4\xd2\x5b\xba\x42\x53\xd7\x49\x2f\x9d\xc0\x8e\x30\xe2\x3d\x7f\x1c\xbe\x0f\x52\xb8\x5b\x69\x78\xe4\x97\x0f\x4e\x67\x2e\xd8\x19\x54\xdd\xb9\x3a\x41\xce\x11\xb7\x30\xdb\x28\xa3\x9c\x3d\xd6\xe3\xa0\xaf\xd8\xcf\x1e\x98\x29\x37\x67\xed\x6b\xe9\xb5\x32\x45\xcf\x71\x4a\x5e\x97\xe7\xdc\x91\x0f\x1a\xff\xf4\xb8\x57\xcf\x57\x94\x9f\xac\x7e\xbe\xfe\x2a\x85\xd8\xcc\x14\x1b\x25\xfa\x8f\x1d\x98\x5f\x37\x6a\xe0\x76\xdd\x44\x12\x3a\xcd\x1b\xe2\x2a\x96\x93\x03\xb6\x23\x8a\xba\x44\x62\xba\x3e\x23\x90\xd4\x21\x3a\x7c\x7b\x90\xec\x98\x4c\x3b\xeb\x01\x35\x8f\xb3\x94\x37\x91\xac\x49\xfe\x07\xff\xc1\x64\xff\x1d\x98\xf2\x38\x93\xe4\xed\x9b\x1a\x22\x92\xdf\x21\x84\x43\x3e\x73\xdc\x59\x66\xf2\x8d\x55\x2c\x58\x6c\xfe\xd7\x4a\x75\x96\xf7\x8a\x24\x94\x09\xed\xc4\x36\xc3\xdb\xec\x69\xec\xca\x4c\xa1\x0a\x72\x42\x5c\x22\xdf\xc1\xd4\xbf\xd9\x7a\xec\x5f\xa1\xb5\x85\xb1\xbf\x37\xa0\x53\xef\x24\xa6\xa9\xaf\x3e\xca\x53\x2a\x03\x47\x6e\x26\x50\x0c\xed\xf5\x83\x1d\xbc\xbc\x15\x70\x4d\x3a\xf5\x64\xeb\x95\xaa\x39\xb8\xed\x08\x4b\x5f\x8c\x9e\x80\x20\x3e\x72\x02\x2a\x45\x41\xa9\x38\x44\x9b\xc3\x4a\xad\x5e\x59\x79\xa0\xd7\xca\xa7\xda\x0d\x8a\x9f\x41\x26\x0a\x18\xa7\x27\x1b\x63\x65\x97\x8f\x3b\x7f\x4e\x00\x4f\x66\xd9\x79\xd3\xf0\xa3\x65\xf9\x27\x7f\xb4\xef\xfc\x19\x1f\xac\xc4\x7e\xb0\x4c\xc6\x83\xcd\xee\x1f\x37\x30\xdd\x92\x3a\x88\x2f\x27\x1e\x71\x23\x02\xe7\xf6\x3e\x7a\x9a\x9b\x8d\x64\x38\x46\xb3\x74\xbf\xc9\x8d\x28\xea\x7b\x1e\xfe\x58\x2c\x57\xfe\x99\x8a\x9d\xc3\x57\xd7\x74\x09\xf4\x39\xf5\xa3\xc3\x07\xa7\xef\x4c\xb5\x3b\x25\x0f\xa4\xa6\x67\xa8\xbc\x3f\xba\x4c\xd6\x7e\xe9\x1c\x7d\x2f\xd0\xec\x2a\xbd\x88\x09\x98\x7b\xf0\xef\x70\x22\x6b\x67\x50\xf6\x62\x22\x76\xf1\xa5\x9e\xfa\x41\xc7\x41\x12\x4a\x9b\x2f\xd0\xab\x57\x89\x2d\x1f\xcc\x49\x88\x77\x98\x75\xc8\x42\x9c\x33\x8a\xba\xa5\xe1\x1f\xf1\xa0\x81\x9d\xf8\x78\x59\x7d\xcb\x5c\x2e\xac\x9a\x36\xfb\xa0\x69\xbb\x9b\x98\xe2\x8d\x3c\x20\xf3\x36\x57\xfe\x51\x6e\x77\xdf\xea\xf1\xe5\x4b\x92\x8b\x52\x99\x7d\x7f\x79\x2b\x8b\xf7\x07\xa5\x97\x18\x40\x1d\x23\x5f\x0a\x90\xf3\xac\xfc\x2f\xc3\x1e\x04\x1b\x8d\xa1\x1f\x88\xc6\xe9\x32\x44\xf2\xe8\xf3\x5c\xdc\x1c\x0d\x8b\xa3\x73\xb7\x31\x52\x15\x34\xc1\x33\x49\x2d\xd1\x7e\x88\x46\xe7\x9f\x7b\x9f\xe9\xf8\x9e\x5e\xd8\x01\xed\x4f\x71\xf1\x36\xa2\xc5\x43\xee\x10\xba\xc3\xe6\xea\x12\x3a\xa8\x61\x8a\xa0\xcf\x32\x2a\x3f\x76\xcd\x16\x5d\xae\xf4\x20\x10\xf3\x74\x3e\x0e\x49\xc6\xa3\x77\x38\xbe\x78\x47\x5c\x36\x1c\x30\xce\x12\xcb\xed\x62\xeb\x99\x81\x57\x56\xc2\x46\x97\xcb\xdd\x16\x11\xf7\xf2\x96\xed\xc5\x5b\x86\xe7\xd4\xdb\xb1\x89\x36\xe1\x31\x87\x95\xd5\xee\x38\x11\x2a\x6c\x8c\x4f\xdd\xd6\xae\x7f\x7c\x3a\x91\xf5\xc0\xd7\xa0\xa7\x07\x9a\xa9\xee\x97\xdc\xa7\x53\xfd\x86\x3b\xd9\xb0\xfe\x8e\xe9\x3e\x1c\x6c\x34\xa7\xde\x68\x08\x5b\xf7\xaa\x3b\x0a\x9a\xd3\x3d\xc8\x83\xa3\x5d\x32\xee\xfd\x61\x66\xd4\x1d\xc2\x34\x7d\x4e\x10\xfd\x6b\x2c\xce\x15\x63\xe3\x30\xd3\xdf\x03\x8c\x78\x17\x94\x0c\xad\xe9\xbc\x83\x91\xb6\x51\x77\x47\x8f\xd6\x7f\x18\xab\xd9\x31\xf7\x38\xfb\x35\xf4\x03\xfc\xb4\x72\xf5\x85\x03\xd4\xaf\xdd\x21\x65\x99\xfc\x4a\x6b\x38\xf8\xf4\xd8\x0a\xdf\xa8\x86\x1c\x91\x27\xac\x16\x53\xbf\x96\xca\xd5\x4d\x0d\x34\x7b\x93\x8c\xf3\x7a\xf4\xf3\x6c\x99\x8c\xc6\x6f\xe5\x0a\x46\xdf\x10\x08\xf0\xe0\x95\xbb\x1f\x06\xc4\x01\xe8\xd1\xe1\xb5\xda\x9d\xef\x24\xfb\x0c\x9a\x24\xeb\x56\xa1\xab\x5b\xff\xf1\x79\xdf\x6d\x69\xff\x4e\x66\x7d\xf5\xba\x3d\x1b\xdf\x91\xff\x74\xbb\x78\xda\xed\xb2\xc2\x5e\x82\x00\x78\x13\xd1\xcf\x49\x5b\xd5\x42\xb9\x36\x77\x8f\xab\x54\xef\xb0\x5d\x3b\xfa\xa1\x7a\x4e\xd1\x42\xe2\x08\x52\x60\x02\x52\x10\xf5\x49\xa7\x58\x15\x18\x2b\x8b\x7f\x58\xeb\x59\x5a\x4a\xcd\x55\xfe\xc8\xb6\x6e\x90\x00\x85\x2f\x87\x91\x32\x5d\x95\xc5\xfd\x9b\x94\xf4\x8a\x98\x8e\xeb\xef\x6a\x2c\xfa\xe5\x45\x37\x8b\x2e\xb0\x9b\x38\x5d\xef\x26\x5e\x17\x36\x9c\xa5\x94\x7e\x3a\x56\xba\xb3\x6f\x02\xa2\xe5\xdd\x29\x8e\xc4\x72\x2a\x1d\x70\x4f\x7b\x8a\x51\xa1\xb0\x6e\x75\x7f\xcf\xb5\x75\x7f\x1d\xd4\x60\xcb\x34\xf3\xb9\x4a\x57\x55\x86\x9c\x17\x68\x49\xd5\xba\x40\x45\x2e\x7c\x18\x4b\x9d\x21\x10\x81\xd5\x06\x10\xe6\xec\x86\xee\xfa\xd9\x3c\x43\xa2\x29\xdc\x57\xa7\xe5\x71\x39\xab\x07\x73\xaa\x3f\x1a\x8e\x74\xb3\xc3\x74\x23\x3a\xce\xe4\x11\x7c\x8f\x5b\x3f\xaa\xcb\x7e\x3d\x04\x01\xd5\x84\x9f\x2b\x05\xa1\xf2\x0c\xf7\x38\x60\x39\xa2\x04\xdb\x60\x3a\x4e\xc0\x56\xfc\x08\xf0\x65\xfd\x4c\xff\x7b\x68\x15\xb2\xa9\xcb\x66\xb0\x68\x92\x60\xb2\xbd\xf2\xc7\xbc\x4c\xf3\x0f\xf9\xfe\x1f\x59\x4a\x18\x73\xa3\xb4\xb6\xb3\x9e\x8a\x9e\x33\x4c\xad\x9c\x7f\x86\x68\xdb\x3e\xac\xc2\xd1\xdc\x1e\xbe\x52\xca\x5b\x6e\x08\xda\x30\xb2\x12\x38\x8a\xc4\xee\x73\xfa\x62\x22\x3a\x73\xa0\x75\x9a\x67\x73\x12\xa7\x30\xb5\x70\xeb\xa4\xb3\x04\x53\xfb\x51\xf9\x48\x8d\x3d\xd5\x9a\x30\x49\x6c\x36\x07\x9f\x96\x01\xdc\x79\xc4\x26\x8c\x1b\x84\xe4\xb8\x1f\x0b\xb1\xc8\x71\x51\x0c\x51\x84\x55\x7e\x61\x5c\x4e\xb0\xb9\x4a\x22\xfd\x37\xe5\xb7\xb2\x8e\x34\x37\x2c\x2e\x9a\x2c\xac\xab\xec\xd5\x59\x74\x97\xf3\xf2\xd4\x4d\xef\x43\xc7\x8a\x31\xd8\x28\x4b\x86\xd5\x8c\xbb\x3a\xfd\x0d\xeb\x57\xed\xe2\xc1\x49\x64\xbf\x9e\x07\x58\x0d\xdc\x46\x46\x88\x48\x7c\x01\x32\x6b\xe3\x30\x7d\xe0\x94\xa6\x16\xb2\x2f\x1a\xd0\x10\x27\x8b\x35\x9a\xb4\xf2\x8d\x40\x7c\x91\xbd\xe2\x80\x8e\x68\x9d\xea\x54\xd5\xab\xcf\x29\xd1\xe7\xb1\x21\xab\x2f\xc8\x8a\x77\x4f\xd4\x4d\x6a\x78\x99\xa4\xf7\x13\xad\x4b\xf7\xb1\x6b\x3f\xba\xd3\x81\x56\x20\x34\xa6\xa5\x28\xe0\x63\xca\xce\xbf\x26\x0c\x62\x33\x70\x4e\xbe\x7f\x7d\xa4\x49\xba\x55\x64\xb0\xba\x25\x5d\x7e\xa6\x72\x21\x6a\xcc\xd4\x08\x36\x77\x95\xb3\xa4\x1e\xf8\xca\xc2\x56\x32\xdf\xb4\x94\x2d\x27\xfb\xcb\x0b\xb8\x0f\xd1\x2d\x9e\x5a\x67\x81\x81\xab\xd8\xda\xd9\x1a\x8e\xd1\x21\x63\x45\x96\xd2\xf1\x6d\x20\x8d\x6e\xa7\xd3\x67\x53\xc3\x7a\x48\x49\x4a\x8e\x4f\x62\x8e\xd2\x0d\xde\xd1\x50\x0b\xde\x68\xce\xb5\xf3\xc6\xec\xa6\x4f\x29\x38\x6f\x72\xe8\x2a\xd5\x80\xe7\x08\x68\x5c\xc3\x9b\xf4\x53\xb6\x36\xec\x22\xbe\xcf\xae\x93\x97\xf4\x95\xb0\xfa\xce\xf6\x2c\x66\x54\x98\x9d\xac\xdf\xb5\x0b\xf5\xbe\x1e\x08\x7f\x74\x3e\xb9\x8f\x93\x1e\xd1\x9a\xf4\x12\x82\x44\xf6\xe3\x8e\x72\xdc\x02\x86\xd9\x44\xee\x84\xed\x97\x02\x9e\x94\x05\x7d\x5c\x9d\x68\xc9\x65\x39\xc9\xbe\x10\xd9\x61\xf3\xae\x8c\xaf\x91\xeb\xe4\x2b\x97\x42\xdb\xce\xd6\x57\xff\xa5\x7c\x9f\x51\x1e\xd1\x75\xc7\xd3\xce\xcb\x41\xf7\xa6\x3b\x0e\x63\xd8\x4e\xc0\x03\x27\x8c\xde\x99\x44\x5c\x59\xe3\x2f\x63\x51\xb0\x75\x8c\x66\xf6\xd8\x89\x7b\xf4\x4a\x6d\x99\x4f\xdd\x7c\x66\xb4\x11\x97\x5d\xb4\xb6\x69\x22\x7d\x2e\xaf\x7e\x54\x9b\x7a\xca\x2f\x77\xa4\x2f\x23\x46\xe4\x3e\x5d\xfb\x87\xb2\xbb\xe4\xc9\xa9\x83\xe7\xe6\xda\xea\xf8\xd0\x8b\x92\x2d\x6a\x35\x71\xdf\xf2\x16\xc3\x0e\x4f\x1e\xd5\x30\x04\x62\x29\x79\xec\xad\xb4\xb6\x50\xc0\x3a\xf0\xa9\x5c\x03\x7a\x9d\xe0\x47\x46\x17\x5b\xfe\xd8\x59\x3e\x63\xc9\x0d\xca\x23\x0c\x47\x0f\x9a\x1f\x93\xf7\x18\x0a\x80\x23\xaf\xf6\x2c\x86\xf1\x9d\x3b\xe9\x39\xd2\xda\x0e\x6b\x65\x8e\xb1\xb3\xd1\x58\x5f\xa3\x91\xcb\x24\xa0\x5d\xab\xa2\x8b\x75\x1f\x6b\x11\x42\x21\x57\x20\x71\x4c\xc3\x47\xe2\xf6\x55\xa3\xc1\xd3\x05\xf6\xac\xba\x8a\x11\x20\xe1\xb8\x89\x23\x0d\xd4\x3e\x96\xe1\xfe\xb7\x46\x10\x01\x59\x99\x6e\x84\xbe\x8d\x71\xed\x67\xd8\x48\x95\x12\x2b\x5c\xc7\x44\x61\xdb\xcb\xb6\xd4\x59\x52\x73\xb5\x2e\xde\x4f\x37\xb6\x1d\x31\x07\x26\xe6\x41\x03\xab\xaa\xea\x3d\x6b\x19\x1b\xad\x6b\x76\x46\x8f\x7e\x9d\x79\xc6\x52\xa5\x1b\x9d\x5b\x06\x45\x5d\x59\x1a\x08\xa9\x53\xf3\x97\xc6\xde\xb3\xbc\x2b\x60\x68\xa2\x9f\x79\xcf\x91\xe4\xb5\x33\xaa\xc6\x1a\x5b\x71\x71\xeb\x7b\x84\x64\xd5\xfa\xe4\xd9\x05\x14\x7a\xd2\xfe\xe8\x33\xa5\xe8\x6c\x4a\xeb\x35\x05\xc3\xfa\x0d\x3d\x3f\x55\x72\xfc\x2c\x2b\x83\x58\x9a\x47\x4c\x54\x90\x74\xd9\x28\x1b\x74\x17\xfd\x6a\x74\xf1\x76\x1b\x7d\x44\xb0\xa1\x58\x3f\x65\x6c\x75\xee\x19\x2e\x3b\x68\x5a\x2f\x8e\x1c\xdf\x1f\x59\x1a\xb8\xfd\xc1\xff\x38\xaa\x09\x07\x1c\x9a\xfb\x59\xb6\x51\xfd\x5d\x23\x74\x9c\x35\x0a\xda\x16\x32\x5a\x75\xbb\xbd\x2a\xc3\x14\x4e\xbd\xe2\xf1\xc2\x52\x2a\x3e\x5a\x5b\xbf\xbb\x16\xfb\x5c\x3e\xab\x75\xa4\x97\x75\xbe\xa6\x54\x2b\xe9\x4a\x5f\x57\x3a\xfb\x2d\x08\x4a\xb0\xbc\xd8\x8d\xfa\xef\xd8\x39\x38\x7b\xd9\x8f\xdc\x3a\xef\x3a\xcb\xb0\x6c\xb7\x1e\xce\x7e\xa7\xc1\x19\xf7\x0c\xf0\xd8\x1b\x83\x5c\x4a\x1a\x0c\xfb\x74\xdd\xcd\x0e\x67\x7a\x53\xa5\x70\x8c\xfc\xac\xb7\x3d\x90\xcb\xf6\xef\xf0\x6b\x6f\x41\x05\x64\x5e\x73\xb4\xc7\xa7\xbb\x0c\xbd\x18\x15\x13\xfe\xe3\xc1\xf4\xa2\xd2\xaf\x52\x51\xfb\x4a\x1d\x25\x15\xf5\x52\x4e\x94\x3b\xf2\x52\x55\xbf\x5f\x8b\x20\x2d\xc0\xbe\x1a\xe7\x79\xed\xc3\x25\x8d\x5c\x62\x8f\x86\x7c\x8c\x61\xa5\x26\x65\xb1\xc6\x12\x13\x1f\xee\xae\x43\xb1\x2f\x9a\x07\xca\x93\x39\x44\xc4\x15\x56\x42\x83\x80\xe7\x2e\x58\xab\x74\x3a\xdd\x7d\x30\x94\x3a\xb3\xf6\xc8\x23\x38\x6b\xeb\x6b\x10\xd5\x96\xde\x0f\x7f\x74\x80\xc2\x68\xe2\xba\x19\x8e\xa6\x47\x92\x6a\x38\x82\x3f\xd7\x33\xca\x59\x78\xa8\x9d\xaa\xdc\xca\x10\xf4\xb0\xb0\x04\x5e\x25\xc6\x5c\xcf\x46\x8d\x63\x36\xc7\x2f\x1f\x0b\x70\xde\xec\x58\xa6\x76\x2c\x16\xae\x3a\x88\xc6\x33\x93\xbe\xdc\x0c\x82\xaf\x9a\x04\x3f\x3a\xa0\x4d\x61\x65\xb6\x4e\x22\xc3\xda\x71\x38\x48\xad\x9b\x1a\xd2\xe3\xee\xee\x7b\x4e\x81\x13\x82\xcf\xea\x46\xb0\xc8\x0c\xbe\x5b\x72\xc9\xc0\xae\x7c\xe8\x4f\x5d\xf6\xb8\xd6\x14\xbb\x39\xad\xa7\x2f\x47\xae\x94\x1d\x07\x2e\x45\x12\xf5\x30\x7c\xdc\x6c\xfe\xc0\x47\xbd\xd7\x30\x8b\x29\x0e\x8c\x9d\x96\xe4\x21\x63\xf6\xee\x02\x2a\xc8\x40\x0f\x12\x35\x8a\xe5\xa6\x47\x9e\x82\x67\x7f\x74\xa9\x1f\x89\x5d\x33\x0c\xef\x53\x84\x2f\xe4\x6d\x80\x43\xac\x89\xad\x33\x43\x4f\xf3\x0f\xcd\xd1\x15\x1c\x66\x7f\xb6\xae\xd3\xac\x6f\x4f\x35\x3d\xf7\xdf\x43\x5e\x99\xf9\x5f\xd9\x0f\x8d\x62\xa0\xe6\xe0\x0e\x2d\xd9\x61\x3c\x26\xb5\xb2\x2d\x3d\xd6\x38\x22\x92\x5a\x49\x3e\xbb\x39\xb4\x5a\x3d\x6a\xf4\xdd\xad\x80\x3e\xcb\xd7\x12\x5f\x2b\xbc\x33\xca\x6e\x20\x0c\xd9\xfa\x8d\x73\x19\x5a\xdb\xd5\x88\x60\x49\xaf\x71\xb8\xf4\x96\x0b\x74\xec\x3e\x55\x17\x6d\xca\x96\x04\xce\x34\xdb\x60\x30\x0c\xd3\x93\x16\xe4\x37\xb2\xeb\xbf\x40\x64\xc9\x6e\x70\xa9\xdc\xd8\xc9\x99\xcb\x2c\x91\x1d\x1c\x3a\x9f\x53\x6c\xa4\x69\x74\x87\xad\x81\xd9\xb3\x4a\xd2\x92\xed\xdb\x3d\x96\xaa\x99\x61\x10\x1c\x2c\x4c\x3a\x8b\xc6\x73\x56\x50\x20\xf3\xb0\x63\x72\x28\x07\xdb\x57\x64\xda\x2e\x03\x19\x8e\xe1\x46\x28\xc9\x36\x5d\xe0\xf5\xd4\xa5\xd4\xd5\x76\x84\x9b\xc6\xf0\x89\x8f\xa4\xb5\x5d\x07\x7d\x6c\x33\x67\x82\x73\xd5\x9a\x6d\x06\x43\x6d\x52\xe6\xd0\x4d\xec\xdb\xf2\x5e\xcb\xc9\x66\xf1\xb8\xe2\x0b\xa9\xee\xe6\x31\x3e\xcf\x52\x09\xb5\x07\x1b\x08\xbd\x0f\xca\x4f\x9d\x44\xb9\xa5\xc3\x28\xf9\xa4\x33\x1c\x69\xc4\xa8\xdd\x3e\x7a\x5c\x99\x9e\xfd\xf4\x32\x39\xb5\xca\xf0\xfe\xf1\xe6\x01\x16\xed\xca\xe4\xc2\xa8\x0d\x12\x6d\x79\x3f\xb3\x5c\xeb\xdf\x4e\x5e\xcb\xfa\xcd\x85\x5a\xe9\xbd\xa1\x97\xb4\xc4\x40\xeb\xdc\x84\x1e\xec\x32\xf7\x1f\x27\xbb\xcd\xfd\xf4\x65\x49\x47\xe7\xfa\x3e\x60\x74\xd0\xd5\xd5\x00\xef\xd3\xaa\xee\xf6\x6f\x9c\x32\x53\x3a\xa2\x0d\xae\xa0\x07\x88\xee\xd6\x6c\x5e\x2d\xa5\xbf\xdc\xee\x4d\xa9\xf9\xa0\x87\x8b\xef\x0c\xa6\x2e\x9e\xc3\x63\xbd\x7c\xf6\x83\x6f\xd4\x27\x7b\x26\x88\x82\xb8\x76\xfc\x04\x3e\xf0\x73\x76\xf8\x21\x7e\xb2\x4e\x9c\x9f\xbe\x6c\x11\xed\xe8\x8b\xd6\xb6\x33\x39\xca\xec\xc3\xfe\xae\xa4\xe5\x37\xf7\xac\x97\xe8\x46\xef\xe7\x57\x32\x9c\xa8\x66\xe3\xd7\xb4\x34\x2e\x5c\x7d\x3c\x0e\x5d\x2a\x05\x82\xb3\x3e\x14\xda\xdc\x7a\xf6\x1d\x04\xeb\x6a\xb2\x8f\x8e\xb3\xdb\x5a\x38\x9a\x42\x4d\x39\xc2\x3f\xa9\xdf\xcd\x02\x86\xbc\x35\x34\x5b\x0c\x12\xdf\xaf\x94\x33\x1c\xcb\x70\x1b\x1e\x24\xc4\x80\xd1\xc9\xae\xad\x8f\xb1\x7c\x9b\x0b\xf7\xd3\x8f\xcf\xba\x38\x42\xb8\x0c\xcd\xd3\xe5\x0f\xcc\xb6\xb5\x5a\xd4\xe0\x24\x44\xff\xad\x1c\xa1\x17\xa0\x37\xfb\x70\xa8\x08\x8c\x4c\x6a\xeb\x7a\xae\xf9\xfb\x60\x10\x84\xcc\x5a\x63\xcd\x98\x8f\x71\x2b\xfb\x91\x72\x79\x4f\x7e\xd8\xa0\x18\x36\xfd\x73\x65\xf6\x16\xa3\x12\x96\x76\xee\x42\xc3\xc9\x8e\x33\x86\x4f\x83\xa0\x0a\x96\x43\xd6\x09\xf8\x3c\x65\x66\x4b\x73\x6d\x4c\x9b\x82\xfb\x79\x78\xae\x40\x47\x3a\x9a\xd5\x69\x91\x5e\x98\xcd\x68\x34\xaf\xf8\x60\x80\x41\xce\x44\xcf\xea\x48\x0c\x48\xf1\xe0\xbf\x3a\x31\xb9\xff\xa3\x61\x2b\xba\xfe\x30\x65\x39\x1d\x0d\x63\xde\xb8\xfb\xc1\x65\x35\xba\xb5\x3e\xf4\xf6\x4c\x02\x6d\xe4\xa0\x63\xd2\x90\x6c\x62\x31\x04\x97\x63\x08\x06\xf2\x7d\xe3\x5c\x11\x81\xe9\x6e\xda\xc3\x02\x0f\xaa\xc3\x67\x68\xc5\xab\xf8\xe9\x9e\x7f\x0d\xec\xdc\xc9\xa4\xab\xc2\xf3\xec\x70\x51\x90\x7d\x0f\xc9\x81\x80\xc3\x1b\xfa\xbf\xe7\x89\x56\x8e\x37\x3a\xe5\xe5\xad\x76\x35\xee\x91\xf8\x7c\x9f\x42\xfe\x7a\x07\x61\xd1\x3d\xe8\x89\xe4\x5e\x8d\xb4\x4f\xbf\x43\xcb\xef\x86\xf4\xd6\xdf\x0d\xfb\xdf\xd5\xf7\xe5\xb0\x0a\xcb\x3f\x3a\x6a\xb5\x9d\xb9\x63\x91\x18\x4e\x09\xcb\xa7\xc9\x5e\x22\xf7\xcb\x46\xbc\x0c\xc3\x3d\xef\xd7\xfe\xcc\xea\x1d\xff\xd6\x8e\x33\x01\x68\x11\x8a\xed\x1a\xe7\x8e\x74\x74\xaa\x5b\x53\xe7\xb0\x2d\xa4\xef\xd6\x20\x85\x07\x36\x27\xbc\xe2\xfb\x52\xce\xc6\x96\xbf\x17\x06\xab\x66\x35\xe2\x06\x82\x6a\xbc\xc9\xb8\xa2\xcc\x77\xa7\xee\xea\x67\x19\xf2\xad\xd2\x35\x4a\xaa\x8e\x01\x30\x2d\xbe\x94\x43\xfc\xf4\x5a\xda\x6d\x44\x86\xbb\xde\x90\xd5\x94\x7d\x6d\xbc\x77\x7e\xd1\xb2\xf1\x0a\xc6\xb1\xd4\xde\xe7\x1c\xea\x00\x24\xc8\xcd\x31\xcc\xd5\x76\x13\xe6\x7e\x7d\xcd\xfb\x83\x87\x56\x97\x5d\x52\x60\x60\xd1\x7a\x7b\x98\x3c\x8d\x4e\x34\x5a\x6a\x35\xc0\x60\xfd\xea\x51\xaf\xe7\x51\xe9\xc7\x92\x14\xf9\x29\x5d\x72\xbc\x5f\xf9\xfd\xd6\x29\x38\xc5\x65\x81\xed\xa2\x29\x8d\x30\x06\x0d\x19\x8a\x6f\x6f\xbf\xa3\x82\x79\x04\x47\xb6\xaf\x70\xbf\xd1\x1d\xe6\x7b\x64\xd9\x81\x5e\x3c\x57\x4b\x29\x51\x8c\xd5\x69\x7e\x2f\xb5\xe5\xec\x10\x3f\x5c\x11\x2f\x36\x17\xca\x3b\xf3\x59\xd7\x4a\x19\xd9\x02\x97\xea\x4c\xce\xdd\x2c\xaa\x77\x9c\xfc\x2f\x87\xa5\x46\x73\xe3\x78\x8b\x56\x73\xbf\x8a\xae\x5c\x7f\x10\x84\xfd\xf5\xba\x7d\x9b\x57\xfc\xea\x2b\x1b\x79\x9d\x42\x45\x6e\x49\x2b\x79\xc9\x60\xd7\x74\xb5\x25\xbd\xd5\xed\x5a\x39\x78\xce\x29\xc2\x00\x68\x43\x1d\x1e\x73\x6d\xce\x47\x64\x29\xe4\x35\x5a\xd5\xca\xda\x89\xe6\xf3\x95\xdd\x2c\x6e\xf3\xfa\xc5\x6c\x3e\xe7\x10\xbc\x73\xe5\xf9\x4f\xda\xfd\xe6\xee\xf6\xfe\xe5\x43\xc8\x83\x78\xe1\x72\x8e\x46\x6f\x7c\x60\x0c\xac\x85\xe5\xe8\x66\x83\x2c\xe2\x96\xbb\x0e\x3d\x82\x29\xe3\x1e\x63\x8b\xa8\x2f\x76\x80\x7d\x00\x70\x98\xa6\x5b\xf4\xc2\xe3\x31\x7d\xa5\xfe\x58\x68\xaf\x3f\x4c\xd3\xe8\xd4\x7c\x58\x5d\xee\x75\x74\x23\x73\x9a\x53\x44\xb9\xcd\x62\x1c\xb4\x20\x2c\x04\x69\x19\xe3\x11\x27\xd2\xae\x23\x65\x85\xb2\x55\xee\xdf\x07\x6c\x48\x7f\xaa\x11\x89\xa6\xda\x69\xa1\xb0\x50\x0e\x44\xa9\xdf\x6a\xf3\x3b\x18\xd4\x6e\x6f\x97\xeb\x5d\x1f\x27\x1d\xfb\xd3\xe1\x22\xad\xae\x78\xda\x25\xae\xd8\x3c\xf9\x01\x69\xf2\xb9\x97\x82\x81\xd6\x3a\x1d\x15\x3a\xff\xc8\xe3\xdf\xe8\xdd\xe5\x9d\x34\x0e\xaf\x70\xc4\x6e\x54\xab\x7d\xb3\xf1\xe2\x0a\x8b\x3e\xcb\xfc\x57\x5a\x74\x87\x2b\x40\x52\x83\xa9\x81\xa0\x92\x8e\x87\x27\xac\xd3\xd5\xfc\x3e\x1d\x85\x5d\x0a\xcf\x10\xc8\x9f\x6e\xaa\x93\x08\xaa\x07\xd9\x51\x91\x49\x74\xb7\x2f\x17\x00\xde\x0b\x02\x77\xaf\x41\xfb\x84\x29\xb3\x38\xdc\x8a\x5a\x84\x89\xe3\xc7\x03\x75\xc1\xc1\xc6\x05\xdb\xff\x14\x12\x0d\x62\x77\xea\xc4\x04\x4f\xd1\xf4\x6c\xa4\xa2\xbc\xd1\x12\x60\xd0\x64\xda\xe4\xa9\xbc\xd7\xd7\x48\xc1\xfe\x54\x36\x2d\x8a\x8a\x80\x4d\xc0\x5c\xf9\x09\x71\xe4\x61\xb7\x47\xea\x34\x3d\x22\xd5\xf7\x68\x62\x93\xc9\xf6\x3d\xb3\xc3\x6f\xff\x67\xbb\x48\xbf\x0a\x8a\x3c\x6d\x4a\x1b\xb8\x4b\x54\x77\x03\x24\x45\x0f\x5e\xa6\xcb\x06\x75\x3c\x44\xd3\x83\xbb\x00\xef\x4a\xe1\xb7\xd5\xf8\xb7\xb4\x89\x40\xbd\xd3\x91\x90\x69\x79\x46\x2f\x19\xcb\x98\x9b\xfb\x8d\x6f\xd4\xc8\x4b\x60\x14\x89\x40\x5e\x46\x4a\xbf\x51\xe8\x22\xd2\x98\x35\x33\x27\x9a\xf4\xe6\x39\xf2\x17\x69\x30\x60\xba\x34\xb8\x79\xe6\x59\x6f\x65\xb9\x11\xc6\x08\xab\x81\xa1\xef\x84\xb8\xa0\x10\x3d\xb2\x3e\x02\xe3\xbd\xf8\x8f\x2d\x9f\xf2\xee\xc8\xe3\x2e\x95\xc4\x27\x7a\xe7\x4b\x3f\x3b\x08\x52\x1e\x01\x4b\x1a\x44\x05\x57\xcf\x26\x4d\x83\xc5\xd9\xe2\x7c\xd7\x91\xf3\x25\x47\x43\x02\xe3\x5c\x4b\x40\x03\xb4\xe9\xc1\x05\xc8\x66\x94\x6a\xf9\x77\x61\x24\x0b\xfa\xb7\x7c\x0a\x20\xc7\x94\x0f\x6c\x4a\xb0\xfb\xd3\x80\xfb\xb3\x3f\x55\xbb\x9f\x3c\x20\xd9\xf8\xc6\x56\x3d\xef\x71\xa0\x86\x3a\xe3\xdb\x18\x28\x0b\x86\x61\x34\x90\x25\xac\x87\x3b\x89\xe7\x99\x52\x6b\x07\x45\x7c\x34\xd3\x02\x1a\x4d\x3e\xea\x91\xf3\x1a\xbd\xfb\xb1\xfa\x5a\xca\x68\x0f\xdd\xfc\x2b\x56\x92\xd4\x72\xb3\xc8\xd3\x9f\x98\xe6\x69\x57\x62\xc7\xa8\xc6\xf6\x4b\x8c\x97\xd7\xb8\x29\x15\xf4\xa5\x3e\xd8\xcb\x65\xd5\x8b\xe9\x3f\x11\x3b\x69\x8f\x13\x0a\xd4\x1a\x19\x28\xf0\x3b\xe2\x2b\xa0\x29\x11\x9e\x97\xe5\xaa\xd2\xe9\xf9\x4a\xe4\x33\x68\xd8\x56\x9f\xe2\xb3\xac\x87\x6c\xb0\xaf\x91\x1c\x75\xa2\x25\x23\x5b\x4b\x27\x88\xb8\xbb\x0e\xd2\x5a\xe7\x4d\xe1\xb9\xa0\xcd\x55\x2e\x83\x38\xec\xd0\x56\x79\x7e\xd1\xc8\x01\x0f\xdf\xc4\x10\x97\x91\x73\xd9\x70\x96\x53\x6b\x11\x47\x93\x2e\xe6\x6c\x8e\x33\x1c\x37\x48\xdf\xb0\xee\x4b\x37\x37\xd7\x3f\x13\xde\x73\x3d\x5c\x23\x29\xe5\xc8\x1f\x77\xd8\xdf\x4b\xcd\xf1\x40\xbf\x84\xb7\xee\xa5\xcb\x71\xc0\xf6\x9a\x8f\x8f\x7d\xd6\x11\x4e\x49\xcb\x84\x4c\x43\xe7\xe3\xa1\xa8\xca\x87\xaa\xaa\x5b\xf5\xbe\xdc\x39\x2c\x05\xfe\xe6\x56\x7c\x7a\x9b\xff\x5d\x79\xe3\x65\x45\xe3\x9f\x80\x8c\x23\x71\xf5\xe6\x36\x3c\x2e\xbd\xa8\x70\x8e\x74\xfe\x63\x13\xf6\x28\x53\xf8\xad\x76\xe5\xdd\x77\x37\x33\xf1\x80\x45\xfa\x16\x1d\xfa\xfb\x5d\xe2\x85\x43\xab\xd7\x11\xb6\x59\x7b\x59\x1d\xd0\xba\xe6\x90\xae\xcd\x5c\x62\x14\x08\xa2\x41\x99\x73\x0e\x77\x10\xf6\x77\xa2\xe1\x71\xb9\x95\xfb\x01\x6c\x14\xa2\x1f\x54\xb6\x64\xf7\x2f\xe3\x84\x77\x0e\xa3\x04\x78\xf2\xeb\xee\x59\x91\x9d\x80\x00\x4c\x65\x03\x53\xfd\x9c\x22\x34\x44\xd9\xab\x7a\x6c\xb3\xe6\x5e\x15\xe0\x7e\xd0\x46\x8c\x23\x89\xca\x77\x70\x28\xcb\x1a\x21\x98\xb7\x6c\x5f\xde\x6e\xf6\xf7\xeb\xea\x74\x90\x1e\x0d\xb1\xf0\xe8\x3c\x22\xd4\x11\x7c\xe3\xca\x3e\xa0\xc3\x85\x5a\xc1\xe8\x01\x71\xb0\x8e\xad\xb2\x20\x30\xe2\x4d\xa4\x01\xee\x19\xd5\xa0\x1a\xdd\x65\xa8\xe7\x41\xbf\xab\xcf\x96\x43\x8e\xbf\x2f\x24\x0a\x95\xc5\xd4\x35\xe6\xbe\x5c\x19\x6f\xbb\x1a\x42\x3e\x80\x2b\x38\x6f\xe3\xab\x9a\x52\xd8\x84\x5f\xb2\x1e\x74\xf9\x6b\xb0\xc7\xc8\x6d\x8e\xde\xfd\x48\xd9\xb1\x47\xa6\x11\xed\xe6\x5d\x95\x8f\x6b\x87\xcf\x0e\xfa\xd5\x37\x87\xa1\x51\xd8\x1f\xe7\x12\xa6\x0e\x5b\x45\x58\xca\xa3\x9a\xf1\x4f\x23\x13\x19\xca\x28\xc7\x6c\x56\xde\x18\x7e\xb6\x80\x06\x70\x42\x20\x0e\xa2\x66\x83\x46\xa3\x7b\x67\x7b\xb5\xef\xd5\xfd\x60\x07\x3b\xc2\x48\x7a\x65\xa3\xef\x7d\xe5\x77\xec\x2d\x5b\xc0\x88\x9e\xd2\xd1\xdc\x28\xeb\x9e\x5d\xd9\x26\x90\x82\xde\x6e\xa4\xb0\x71\xea\x36\x73\xe6\xcb\x8e\xa4\xec\xfd\xfd\x90\xa4\xcc\xd3\xd6\xa7\x65\x3a\xdb\x80\x0e\xbe\x4c\x03\xe9\x05\x6a\x3a\x7d\xd7\x45\xff\xbc\xec\x07\xbd\x90\x60\xb8\xb9\x18\xdf\x90\x01\xe8\x07\x88\x83\xe7\xa0\xd1\xd3\x41\x01\xdb\xfe\x12\x51\xde\xdc\xf7\xd9\xcb\xf5\x86\x22\xc4\xd8\xc1\xa3\xe7\x4c\x8d\x24\x8f\xb0\xa1\xd8\xc3\x85\x0b\xdd\xfd\xe5\xb8\xc6\x5c\x18\xc5\x61\x47\x2b\x39\x87\x81\xc5\xa3\x9e\x12\x18\xb3\x7f\x52\xc1\x83\x01\x42\xee\xda\x8e\x1f\xc6\x6a\x03\x18\xa6\x9f\x7a\x58\x6f\x72\xdf\x76\x31\xe2\x5b\x9c\xb8\x6d\xfd\xe7\x9b\x51\xfa\x33\x52\xdc\xb3\x99\xec\x6b\x50\xdb\xa7\xf5\x11\x4d\x7c\x86\x8f\x6a\x1c\x1a\xa1\xcd\x57\x61\xb9\x84\x42\x30\xb7\x7e\x26\xfa\x9a\xad\x60\x2e\xab\xbf\x0f\x9a\xe4\x4b\x4d\xff\xe0\x35\xab\x97\x4f\x5f\x35\xb6\xf6\xcb\xd7\x6f\xd7\x89\x1c\xa1\x6b\x1e\xda\xff\xc1\xbd\xfe\xca\x75\x47\x07\xe9\xcb\x6a\x74\xa8\x16\x9c\x20\xb5\xeb\xc6\x91\x16\x80\xf8\xdc\x4c\x06\x95\x3d\xee\x54\x7a\x69\xb0\xd3\x3f\xa3\x20\x01\x14\xfa\x3c\x67\x4c\x48\xdf\x2b\x39\x6a\xcd\x33\x26\x65\x97\xfb\x6b\x9e\x06\xd9\x04\xac\x13\xa6\xb4\x78\xa5\xa9\x02\x57\x18\xd6\x3b\x11\xfe\xe0\x8e\x3d\x7a\x85\xfa\xa8\xe5\x2a\xff\xe7\x01\x39\x48\xeb\x23\x1f\x4a\xda\xae\xb9\xa9\xe3\x14\xc1\x08\x38\x44\x8c\x2d\x3f\xaf\x04\x25\x91\xd4\x22\xb8\x61\xd7\x78\x25\x76\xe0\xaf\xa9\xdf\x6c\x74\x3a\xe2\x35\x93\x9f\x8b\x10\x0b\xbd\x1e\x0d\x50\xb3\x86\x91\xbc\xda\xdb\x63\xa3\xb7\x1f\x47\x37\x0e\xea\x39\xac\x65\x95\xb5\x6d\x47\xd9\x4d\x23\x7f\x92\x4c\xfa\xb2\x07\x5c\x8c\x6e\x01\x63\x90\xb9\xc0\x9a\x7e\x94\x99\xb3\x26\x77\xbf\xe1\x66\x7c\xd7\xd2\x59\x96\x5a\x4c\x35\xd5\x7e\xc3\xe0\xc1\x79\xc0\x8f\xd8\xee\x1a\x2b\x7c\x71\xf0\xe6\xf3\x53\x2f\x44\x2b\x09\x2c\xec\x36\xc9\x38\x8f\x3d\xf3\x36\x45\x52\xcb\x69\xf3\x0c\x73\xdf\x49\x7d\xe4\x66\x4e\x43\x61\x08\xf4\x5c\x00\x4e\xa6\x0b\x67\x81\xbb\x27\x6f\xa1\x88\xd6\x2b\x97\x75\xfb\xa3\x5b\xc1\x16\xa3\x94\x75\xf0\xd9\x20\x29\x92\xe3\x17\xda\xa4\xb2\x6e\x05\x01\x7b\x33\x26\x11\x19\xb3\x08\x7c\x7d\x1b\xb5\x18\x4a\x29\xd0\xeb\x91\xed\xe6\x4a\x6f\xe9\x1b\x79\x5d\x07\x46\xa1\xf7\x5c\x49\xf8\xa3\xd0\x89\x52\x45\x2b\x4d\x67\xfe\x4c\xf6\x7e\x75\xa7\x9d\xd7\x94\x3a\x52\xf0\xdc\x7d\x5d\x30\x87\xb3\x64\x38\xa2\xc1\xdf\xf8\x67\x54\x22\x62\xfc\x71\x30\xaf\x72\x7a\xdd\x15\x12\x12\x98\x03\x55\xc7\xeb\xc5\xa6\x5f\xc6\xe8\x08\xcc\xe3\xf3\xa9\xac\x99\xf2\x21\x71\x02\xe9\x1f\x83\x65\x6a\xd9\x7e\xcc\xfa\x4b\xc3\xcc\xaf\x99\x4a\x74\x0c\x40\x35\xe2\x5f\xb0\x08\xce\x35\xce\x26\xed\x42\x4d\xd2\xc6\x52\xee\x76\x39\xc4\xda\xee\x35\x3d\x93\x30\x81\x2e\x0d\x09\x93\x3d\x0e\xfe\x11\xd4\x98\xce\x3f\x19\xd5\x83\xf9\x6c\x9e\x3c\xbc\x23\x36\xfb\x2f\x94\xca\xfc\xc5\xdf\x05\xe9\xb6\x68\x42\xee\x1c\xc7\xb5\xf8\x9f\x4c\x0b\x39\x68\xf0\xca\x29\x8f\xa3\xd7\xec\xd4\xc3\x7d\xc5\x10\xc0\x5d\x7f\x49\x91\x65\x3a\xa5\x4f\xcc\xf4\xe0\xc2\x77\x86\x03\x66\xb5\x64\x9e\xa7\xc0\xa2\xe7\x52\x4d\xb6\x9e\x4a\x01\x7b\x8e\x8d\xb6\x2e\x65\x5b\xbc\xf2\xa6\x5c\xf1\xa6\xb2\x97\xf5\x5d\x96\x80\x3f\xd9\x1e\xb2\xe5\x2b\xe1\xcd\x24\x33\xb0\x9f\x6c\xa4\x00\xf1\x8b\x2f\x8f\xca\xf7\x96\xca\x42\xc7\xab\x1c\x4e\xb2\xd8\x38\x47\x83\x1e\x7e\xb1\xfd\xf2\xdd\xe4\xd7\x6c\x00\xd0\xe6\x75\x41\x02\xf4\xec\x88\xa4\x5c\x39\xe5\xe3\x5c\x60\x6a\x50\x12\x8b\x1d\x0e\x61\x63\x7b\xc5\xeb\xca\x16\xe0\xeb\xb8\xbd\xa2\x66\x08\x0f\xf3\xf7\x03\x87\xbd\x1f\xc2\x77\x2e\x7a\xff\x93\x1b\xff\x9a\x73\x38\x2e\xbb\xb8\x20\x0b\xc2\xd5\xa4\x12\xe9\xa7\x69\x89\x9d\x20\x48\x3f\xce\xe2\x5d\x5c\x3b\xc2\x48\x36\xe2\x79\x83\xf2\x23\x37\xd9\xf1\xe5\x6e\xff\x39\xdf\xe5\xe8\x40\xb4\x38\x5d\x28\x81\xff\x9e\xe3\x81\x79\x9d\x64\x46\x5b\xbe\xec\x21\x19\x57\x98\xed\x02\x22\xe9\x3c\x5c\x67\xb5\xcf\x2f\x7b\xa0\x72\x66\x7e\x84\x4b\x8c\x6c\xca\x43\xfa\x29\xe1\x53\x59\xed\x3f\xba\xdd\x43\x79\x02\xb6\x84\x91\x02\x46\xf4\xda\x83\x05\x07\xa6\xf3\x3d\xd2\xe8\x9a\x0a\xe6\xb3\xc1\x5f\x7f\xa3\x01\xc0\x0e\x3e\xf6\x47\x06\x05\xce\x91\x73\x0e\xef\x2e\x6b\xe5\x10\x46\x20\x83\xee\x01\xdd\x42\xa1\xbf\xa7\x2c\x65\xb7\xc8\xb2\x18\x2a\xb1\x49\x5e\x1d\xbc\x6f\x8a\x7d\xed\x50\xe9\x40\x43\xcf\x6b\x78\xb0\x71\xd0\x40\x32\x9d\x8c\x3f\xc8\xab\x20\x80\x90\x2a\xee\x07\x8c\x00\x9c\x03\x0e\x49\xe1\x18\x90\xda\x8b\x26\x46\xa5\xb4\x5f\xf2\xaf\xfb\x56\xce\x71\x3b\x72\xc0\x40\xa9\x73\x46\xc1\x7d\x63\x68\x60\xc4\xdb\x6c\xbd\xe5\x9d\x77\x5a\xf3\x2b\x5e\x38\x93\xe1\xa7\x66\x0a\x60\x03\xc7\xe6\x94\xcd\x29\x92\xbc\x3d\x34\xdb\x3d\x87\xbf\xac\x7a\xbe\x77\x18\xdf\x2c\x74\xb8\xbf\x8f\xbf\x7a\xcc\xb8\xa9\x56\xff\xe2\xb1\xf3\xc8\x27\xaf\xf8\xeb\xc2\x10\xfa\xbf\xbf\x51\xdd\x7f\xc0\x0b\xee\xd9\xdf\xd1\x30\xd5\xd5\x75\x4f\x1b\xd3\x8d\x7d\x50\x3e\x46\x04\xf6\xcc\x14\xe0\xab\x9a\xba\x9b\x24\x74\x47\x2f\x22\xdd\x35\x04\xb5\xd4\xa9\x43\x4a\x3b\xbe\x1c\x47\x50\xb1\x96\x59\x4f\xfc\x36\x1e\xb6\x95\x04\x5f\xc9\xbc\x0c\x41\xae\xfe\x9d\x8e\x44\xfe\x72\x2d\x99\xd2\x72\xfd\x91\x06\xcf\xce\x44\xce\x93\x60\x40\xfd\x09\x5e\xa8\x93\x3b\x77\xd8\xba\x0b\x18\x38\x97\x93\xb5\x13\x36\x5f\xfc\xcb\xae\xfe\x1e\x86\xf4\x06\xe6\x9d\x4b\x64\xbe\xf5\x94\x52\x1a\xdb\x80\x38\x6e\xaf\x24\x71\x5a\x9e\xf8\x2f\xf3\x7a\x7c\xea\xb0\xdf\xcc\xc8\x40\x89\x40\x45\x58\x19\x94\x39\x2c\x36\x5b\x65\x8f\x8a\xe2\x54\x7f\x11\x5a\xd6\x37\x54\x29\x75\xa5\x26\x25\x98\x50\x3e\x87\xb1\x02\x43\x11\x78\x39\xc6\x2d\xab\x29\x8f\x4d\xaa\xa9\xf2\x83\xc1\x86\xc9\x86\x27\x53\x54\xf8\x9d\xd5\x64\x9d\xc6\xf4\x65\x09\xcc\x81\x71\xca\xfe\x03\x1a\xf1\xb5\xbb\xd1\x01\x8d\x2f\x27\xb0\xe8\xef\x62\xc5\xd7\x67\xf1\x48\xcf\x1a\xd0\x47\xb1\x31\x4a\x67\xdc\xe1\x55\x63\x84\x5e\x63\xe5\xb2\xd7\x44\x66\x43\x10\x61\x9c\x90\xa6\x7a\x18\xd8\x03\x1c\xf5\xf5\xa4\x32\x4f\x67\xfd\x7d\x22\x89\x68\x0a\xa8\x42\x37\xe9\x13\x4f\x81\xe7\xaa\xff\x75\xf1\xa4\x3a\x2d\x57\xa5\x0e\x8b\xf0\x8d\xee\x5f\x9a\x3c\x73\xd8\xb5\xb3\xf3\x90\x1b\x0b\x63\x12\x1f\x5e\x20\x80\x2e\x7c\xc6\xc0\x45\x25\x02\x96\x65\xa8\xa2\x61\x76\x82\x34\x18\xf2\x61\x35\xb2\x79\x3b\x44\x97\x7d\x03\x18\x2f\x77\xec\xff\x3e\x15\x8f\x38\xec\x03\x0e\x03\x95\x73\xcb\x6a\xfb\xe7\xa7\x41\x0d\xe2\x0a\x15\x1a\x28\xdf\x58\x95\x86\xc2\x37\x65\x1a\x2f\x60\x63\xb9\x8f\x9d\x19\xbd\xa0\xc6\x43\x30\xe5\x87\xb5\x7d\xf5\xde\x09\x13\xde\x40\x07\x42\x77\xbc\xff\xf7\xd0\x47\xf4\x5c\x89\xd7\xc7\xe7\xfe\xbd\x60\x09\xf8\x4a\xdc\xbe\x01\x07\xff\x6b\xf0\xb4\xe6\xa0\xc2\x2f\xd7\x4b\x24\x75\x1f\xdb\x29\xbf\x6d\x8e\x8b\xee\xf1\x7b\xf4\xbd\xbd\x99\x3c\x02\x13\x04\xb3\xe0\xcb\xa9\xae\x5b\xed\x43\xf1\xa5\xb8\xd5\xae\xb4\x7d\xb0\xd7\x5a\xcb\x07\x30\xf0\x7b\x15\x14\x02\x12\xb2\x54\x57\x8e\x99\x76\x48\x76\xd9\x4d\xad\x99\xbd\x44\x84\x7a\xf5\x66\xe3\x8f\x8f\x33\x95\xff\x73\xdc\xf7\x12\x21\x02\x89\xa8\xcc\x7d\xd7\x71\x6d\xb9\x12\x1a\xf5\x4c\x5b\x3b\x23\xb4\x11\xf8\x84\xe2\xf5\x82\x12\xfc\x9d\x94\x97\xf8\xd8\x1f\x18\xb5\x8a\x5f\x45\xad\x2c\x84\x54\x1f\xa3\x1e\x56\xd6\xc0\x26\x45\x62\x75\x67\xc4\x43\x69\x56\x4e\xfd\x53\x66\x75\xd9\xb2\xca\xa7\xa0\x39\x23\x00\xca\x5f\x17\x00\x04\xe8\x32\x38\x34\xf5\xa8\x39\x6b\xfa\xd2\x86\xde\xb8\x1a\x43\x65\xdc\xed\xf4\xde\x6a\xf8\x0d\xbe\x8d\x0f\x8c\x7a\x20\xda\x28\xc8\x66\x08\xd4\x80\xbf\x87\x9e\x97\x60\x88\xb6\x3f\x62\x3c\x26\x46\x66\x67\xd0\x72\xd4\xb4\x2f\x3f\x38\xa8\xc5\x37\x11\xfd\x59\x48\x34\x75\xf5\x25\x36\x10\x0e\x2f\xe3\x9a\x85\xdb\x94\x11\xae\xf8\x5d\x56\xc6\xf6\x03\x1e\xe7\x26\x6b\x00\x0b\x78\x7b\x11\xf7\xdc\x6e\x37\xd1\x55\x10\xa2\xa0\x2f\x0d\x90\x02\x3b\x3f\x0d\x71\x05\x6c\x85\x05\x3a\xf4\xec\x1a\x35\x7d\xb7\x26\x3b\x0d\x03\x5f\x30\x5f\x01\x4e\xc8\x10\xcf\x18\x2b\xc0\x6c\x28\x80\xa4\xca\x5e\x1b\x88\x97\x78\xbb\xfd\x89\x06\x55\x46\x8b\xcd\x3c\x1b\x2c\x88\x1e\x34\xc9\x6c\x0a\xe4\x59\x8d\x7a\x91\xea\xf1\xc2\x40\x2b\xff\x23\xed\xf3\x94\xa7\xf0\x8b\xbf\x7c\x52\x32\x51\x3a\x03\xf1\xac\x92\x01\x8d\xc7\xe3\xec\xec\x66\xa3\x6e\xbf\x63\x17\x89\x63\x66\x45\x82\xca\xcb\x26\xa8\xfa\x11\x97\x6f\x3b\x9b\x1d\x3c\x3d\xe1\x1a\xe5\x0d\xb1\xa6\x40\xe3\x67\x0f\x80\x62\x04\x36\xcc\x47\xfe\x8f\xe7\x7f\x02\x1d\xd9\xc5\x05\xbd\x6e\xac\x65\x94\x80\x20\xba\xb2\xc4\x31\x34\x18\x7a\xcb\xdd\x52\x29\x19\x79\x53\xae\xbc\x57\x3c\xac\x0d\xbc\x65\x21\x38\xc7\x21\x54\x3a\xfc\xe7\xa7\xf5\x91\x9a\x2f\x25\x7a\x9a\xb2\xee\x9f\xec\xa4\x8c\x0d\xcd\xc8\x9d\x5e\x1a\x1d\x61\x50\xb6\x17\x51\xa3\xa5\x07\xa9\x6c\x69\x18\x9c\xdc\xaf\x17\x19\x90\x3c\x60\x27\x1d\x98\xc3\xcd\x42\x0b\xc3\x2f\xc7\xae\x41\xe5\x84\x79\xd8\xb0\xbe\xaa\x1d\x0c\x94\x60\xe9\x93\x1a\xa3\x13\x20\x8d\xba\xcc\x88\x89\x66\x46\xbd\x13\x76\x70\xfd\x48\x2c\x3b\xb3\x48\x59\x0e\x2a\xff\x73\x27\xee\x2f\xbb\x45\x86\x04\xd8\x9b\xac\x74\x78\xfb\xcf\x1e\xad\xef\x4f\xd5\x33\x53\xf2\xa0\x3b\xc7\xe3\x1d\x83\x47\x99\x6e\xdf\x75\x18\x9a\xcc\x38\xd2\x05\x00\x60\xc5\x5e\x85\x6f\x06\x4e\x09\x8e\x7a\x8f\x36\x76\x9e\xa6\x60\x99\xc2\xdc\xf9\x2e\xa1\x43\xd9\xe2\x87\xe9\x24\xc6\x6b\xb4\x3c\xdf\x35\xf4\x48\x56\xa8\x1c\x5c\x59\x8d\x65\x3c\xc1\xb0\x58\x80\x10\x5a\xbf\x2e\x30\xdf\xd8\x45\xeb\xde\xb4\xa8\x73\xfb\x4e\x23\x36\x0e\x65\x23\x96\xac\x6b\x78\x09\x91\x79\x09\x9f\x41\x14\x3d\xdf\x40\xa8\x22\x42\x3a\xf1\x14\xa9\x2f\xdc\xa2\x2d\x83\xd8\xbe\xd5\xab\x8a\x54\xc7\xa7\x07\xe7\x5a\xbf\x38\x90\x17\x4e\x2b\xe7\xea\x89\xe8\x5c\xde\x5c\x98\x17\x8f\x39\x43\x9e\x65\x6d\x35\xce\x72\x51\xea\x2b\x48\xb3\x96\xcf\x64\xaa\x0c\x20\x9b\xed\x2c\x27\xac\x96\x8f\x73\xc1\x3a\x5e\x3d\xa5\xff\x77\x6a\x4f\x8e\x51\x9a\x46\x93\x29\xce\xa5\x7c\xd7\xf7\xd8\x99\xa1\x70\x3e\xae\x3d\x0b\xeb\xe8\xc9\x12\x6c\x26\x9d\x7d\x91\xd5\x6e\xa1\xc0\xf8\xf2\xa9\xae\x9e\xe5\x7a\xc6\x3c\x33\x58\xe4\x9c\xdc\xf5\x45\x84\xc7\x92\x65\x28\xd4\x27\xe1\x42\x0a\x28\x83\x36\x63\xd1\x40\x6b\x2b\x89\x9e\xce\x48\x3b\xcb\xcf\x29\x58\x28\xaf\x6c\x4f\x1d\x9b\xa9\xcf\x9c\xcc\x6d\x6a\x8d\x6b\xa6\xb5\x26\x63\x93\x14\xeb\xb8\x28\x2f\x07\x3b\xe6\x1a\x74\x36\xaa\xe6\x08\x03\xfd\xce\xc7\x78\xc9\x98\x21\x62\xda\x23\xba\x0a\x45\xce\xcb\xc0\x10\x74\x83\xbe\xb3\xdf\xd7\xd1\xa3\xb2\x73\xb2\xb5\xa3\x50\x24\x5d\x5c\xe5\x5d\xe3\x6f\x87\xdd\xb0\x7f\x25\x30\xc1\x2e\xa1\xd5\xbf\xdb\x6f\x81\x2d\xf9\xfb\xe9\x13\xe5\x84\x1c\xa7\xdf\xd5\x18\xf4\xc1\x44\x05\xbf\x0c\x5c\xba\x35\x40\x6a\xa7\x5a\xfb\xdc\x8e\xdb\xc2\x23\x22\xe6\x8d\x22\x01\xa7\x75\x7b\xff\x5d\x65\x03\x65\x9f\xbe\x84\x46\xe0\xac\xae\xd8\xa0\xdb\x07\xc7\x1d\x98\x51\x6a\x7d\x3f\xdd\xb6\x53\x04\xb5\xdd\x2b\xcb\xb3\x6c\xf9\x92\x1c\x32\xf7\xd3\x74\x37\xbb\x17\xe9\x8a\xa1\x07\xb7\x16\x49\x68\x3f\x42\xe4\x04\x66\xac\x24\x0f\xf4\xe1\xd6\x9f\xf3\x3b\xc9\xea\xa0\x0c\xf5\x39\x44\x98\xf4\xa8\xcf\xc7\x67\xb5\x79\x37\xb8\xb7\x16\x94\xd8\x66\xdf\xc6\x46\x31\x46\x33\xfe\xaf\x8a\x48\x92\x07\xd9\xac\x3a\x3a\xa8\xc5\x37\x87\x94\xee\xb8\xbb\x37\xf3\xa9\x8c\xca\x8c\x34\xf7\xf5\xfe\x36\x2e\x16\x5e\x6c\x65\x93\xcc\x7f\x1c\x84\x6e\x0b\x4f\x64\x25\xb6\x97\x8d\x2f\x2e\x5f\x3d\x2d\xbb\x9c\x20\xde\xa4\xcf\x31\xcb\xe0\xc8\x60\xcf\xdc\x2b\x5f\x6e\xb6\x90\x7b\x47\x27\x4c\x6f\x60\xc2\x4a\x7b\x5c\x4e\x2c\x48\xde\x17\x30\x15\x8f\x7d\x6a\x35\xdd\x9f\xfd\x05\x61\x3d\xcb\x8f\x5e\x69\x79\xfb\x58\x1b\x14\xfb\xf8\x6b\x59\xca\xa6\x6e\xb1\xf4\x29\xee\x64\xee\x8a\x7d\xac\x7c\x91\xfd\x91\x23\x57\x2e\x4c\xe7\x60\xb4\x6a\x63\x0f\x04\xcb\x09\x46\x7b\xa4\x77\x40\x4c\xfe\x17\x1f\x74\x80\xe2\x13\x7a\xa6\x72\x84\x99\x13\xe4\x66\x34\x77\x87\x6d\xa6\xde\x4a\x7f\x15\xbe\xca\xc7\xe7\x7c\xb2\xe3\x74\x38\x1c\xbe\x51\x0e\x1a\xc5\x7e\x95\x59\xed\xa3\x9b\xd1\x81\xec\xd8\x59\xca\x5e\x09\xcc\xa7\x3d\x06\xfe\xdb\x63\xa4\x54\x26\x4e\x88\x96\x01\x9c\xfa\x55\x90\x48\x77\x99\x34\xd9\x45\x2b\x4d\x91\x9b\x89\x26\x80\xb3\x23\xf6\x7f\xa1\x30\xfa\x47\xd2\xd8\x76\x02\x99\x92\x2d\x78\x2e\x27\xe9\xeb\x66\x74\x69\x74\xbe\xfe\x5c\x97\xe2\x2d\xb3\x5f\x59\x6e\x02\xe7\x2d\x9b\xf4\x1f\x22\x4e\xe3\x5d\xe7\x42\xf9\xf7\x56\xa3\x4a\xaf\xd1\x8a\x0f\xb8\x68\x58\x45\xb2\x9e\xc8\xcc\x92\xcd\xd1\x77\x75\x83\xa3\xd4\xd6\x1a\x9e\x5e\x4b\xc2\x92\x96\xfe\x1d\x0f\xb1\x3f\x4a\x28\x4c\x9c\x92\x37\xa5\x5f\xfb\x2b\x91\xf9\x6c\x68\x2a\x9a\x7c\x17\x66\x25\x25\xca\x40\x23\xfa\x78\x45\x7b\x27\xe8\x81\x70\xde\xb0\xa4\xa9\x9c\x4e\x52\xe5\xe0\x87\xad\x12\x95\x2f\xed\x33\x16\x83\xfa\xd6\x53\x0d\xad\x5b\x81\x50\x6a\xa8\x15\x1b\x1e\xfc\x81\x5a\xe9\x32\xdf\x92\x5d\x7c\x39\xd0\x57\x95\x6c\x23\x57\x55\xbd\xb7\x0b\xfb\xd2\xb3\x61\x65\x26\x78\xe5\x5c\x7e\xcb\xd4\x06\x1a\xa0\xd5\x2a\x41\x86\x58\xf7\xdd\x3e\x4a\x67\x67\xa5\xca\x69\xbd\x04\x51\xad\xf6\xc2\xb1\xaa\x6b\x01\x94\x2a\xe3\x95\xa4\x07\xab\xec\xe0\x5a\xc1\x8e\x89\x36\x00\x4b\xaa\x88\x55\x6e\xbf\x6d\x9c\xaa\x06\x67\xdd\x64\xa9\x48\xa4\x2b\x42\xf9\x33\x11\xf3\x9b\x1c\x96\xaa\x07\xcf\x0a\x56\xa3\xf4\x27\x59\x5e\xa9\xab\x2d\xf6\xd6\x71\x0d\x85\x4b\xec\xce\x57\xe5\x45\x71\x08\x67\xee\x68\x1b\x02\xa2\x82\xe3\x18\xd8\x42\xfa\x7c\x0f\xe4\x00\x29\x01\xac\x8c\xd3\x1e\xfe\xed\xec\xfb\x8e\xe1\xe5\xb9\xd2\x87\x5a\x56\x4c\x19\xb4\xc5\x49\xe0\xd4\x22\xe2\xfa\xcd\x70\x93\x05\x35\x8a\x73\x5c\xa5\x80\x80\xeb\x7b\xb6\xa4\xb0\xea\x5f\xf4\x8f\x80\x3e\xd2\x0f\xbc\xcc\x31\x66\xe9\xab\x67\xe2\xf0\xef\x4f\x80\xd5\xf2\xcc\x7a\xf4\xb5\xc1\x5b\x43\x6a\x19\xa0\x94\x87\xf4\xaa\xe2\x38\x2e\xe8\x32\x71\x51\x38\xa1\xe1\x64\x0e\x07\x2c\x17\xfd\x02\x6b\x1f\x79\x10\x79\x5e\x4a\x51\x67\x2e\x70\x2e\x6f\x0c\x37\x4f\xae\x65\xf9\xc9\x0e\x6f\xee\xaa\xb3\xd3\x1b\x00\xea\xad\x66\x02\x12\x4e\x42\xc3\xda\x20\xd2\x7b\xb7\xa9\x81\x30\xa6\xc9\x71\xa5\x02\x9a\x34\xea\xe5\x73\x2b\x09\x4c\xc8\x66\x41\x8d\x99\xbc\xc8\x96\x45\x82\x2d\x9c\xc5\x60\x11\xee\x9b\x6b\xbe\xce\x4c\x75\x9e\xf5\x2b\xbb\x55\x2d\x9b\x8d\xcf\xf3\x2e\x5f\xa5\x1c\x36\x4e\xb3\x10\xa2\xf2\x69\x75\xbf\xbd\x9b\xf8\x42\x79\xea\x74\xa7\x6c\xe1\xa7\x38\x98\xaa\xe7\x3b\x6d\x26\xb6\xb2\x8d\x93\xfc\xa4\x7c\x61\x10\x69\x3b\xaa\x70\xa9\xe8\xd3\xd8\x08\xf9\xc1\xce\x71\xb1\xef\xfc\xd8\xf2\x3a\x51\xf6\xa0\xe3\xcd\xc0\xe0\x14\x65\x7e\x8e\xc8\x6e\xa8\x3c\xe0\x23\x63\x8b\xf8\xd0\xaa\xd8\x1d\xde\x2e\x53\x89\xf9\x57\x71\x4d\xd1\xe7\xa9\x0d\x0d\xca\xee\x54\xa0\x72\x15\x45\x8e\x2e\xe6\x61\xb9\x91\xc5\xd1\x5d\x14\xf6\x59\x12\xab\x39\x1c\xd3\x10\x1d\xdc\xe4\x5f\x3f\x8c\x39\x60\x7b\x4d\x29\xc4\xed\x3f\x68\x57\x38\x78\x98\x3f\x4a\x81\x0b\x6e\xdd\xd2\x9f\x4e\x5e\x10\xd3\x49\x96\xdc\x64\x77\xa7\x8c\xad\xb6\x50\xa7\x1c\x19\x6d\x53\xbe\xe8\x82\xf6\x3f\x87\xe5\x9d\x6a\x1b\xc5\xf6\xb7\x1a\x1a\x98\xa6\x34\x86\xaf\x01\x6f\xf6\xcd\x0e\x51\xbd\xb2\x51\x90\xc8\xe3\x87\x81\xa7\xc5\xce\xeb\x04\x2b\x80\x6d\x78\xa8\xde\x9f\x10\xfe\x23\x34\xab\x6c\xdd\x09\xba\x3e\x73\xd9\x09\xa9\x81\xf2\x5c\xc0\xcf\x24\x20\xf0\x64\x37\x95\x83\xcc\x74\x81\xe7\x03\xc5\x77\x3a\xad\x83\x01\x0d\x45\x46\x51\xf4\xfb\xe5\x23\xcb\x97\x4d\xc0\xac\x5c\xc6\x63\x97\xcb\x7a\xbb\xe2\xf3\xfc\x84\xa3\xd8\x0f\xcf\xd6\x45\x62\xd0\x9f\xf2\x15\x98\x9c\xf0\x03\x0e\x3b\x25\x34\x7d\x48\x09\x7f\xca\x87\xe3\x3d\xe9\x03\x43\x47\xfd\xc4\x3f\xf8\x61\xe4\x79\x3f\xca\x4c\x1d\xdb\x15\x2c\x50\x5b\x14\xf2\x0e\x62\x34\xaa\x75\x70\x22\xf6\x1f\x7c\xca\xf6\xb2\x71\x72\x9e\x47\xa8\x6d\x8e\x1a\xe9\x32\x2a\x2e\x8c\x23\x90\x36\x34\xa2\x3c\x22\xb0\x37\xb9\xd2\x69\x98\xb6\xeb\x7e\xf8\xa6\x5b\x4c\x23\xe7\x0e\x97\xf0\xa3\x9b\x91\x7a\x7d\xaa\x67\xea\xd8\xe1\x8c\x01\xb6\xc1\xef\x14\xa3\x32\xb3\xb4\x72\x79\x2a\x8f\x68\x24\xc6\x20\xd3\x1d\xb7\xe7\x26\xa3\xc4\x47\x39\xdb\x04\x05\x30\xac\x91\x40\xd9\x59\xfe\x87\x5b\xff\x6b\xf0\xd4\x5c\xb3\xc0\xb4\xad\x7c\xe1\x9e\x10\x61\xee\x11\x20\x5a\x37\xa9\x13\x59\xce\xe5\xa7\x50\xb1\xb2\xe7\x79\x8c\x21\xb2\x51\xb0\x23\x65\x33\xaa\x5a\x1f\x88\xf5\x90\xf0\xb4\x2c\x10\xf6\x9a\x44\x49\xf3\x50\x16\xdf\x43\xa5\xb5\x74\x39\x18\xb7\x93\xcc\x66\x1e\xac\xb3\x5b\x69\x0c\x01\xec\x0d\x3a\x91\x31\x0c\xc7\xea\x47\xe8\x68\xca\xde\xf1\x19\xa3\xad\x97\xb3\xd4\xd2\x85\xbd\xd6\x23\xcc\x6f\x19\xfb\xb8\xea\xeb\x18\x4a\xd5\x09\x1f\x18\x94\x7f\x74\xc5\xb7\x91\x7e\xb8\xe2\xdf\x98\xd0\xb8\xf7\xcd\xa9\xb0\x12\xc4\x35\x1a\x64\x8b\x09\x08\x16\x51\xba\x91\x30\x67\x0c\xf5\xe3\x60\x36\xf9\x20\x7e\xc5\x00\x93\x65\x41\x70\x69\xf7\x3d\xdb\x36\x06\xd7\x4b\x09\x8d\x1c\x00\x7d\xd1\xa0\x37\x55\xe9\x0e\xde\x30\x31\xa7\x72\x1e\x2c\x17\x34\xa6\xde\x98\xc6\x43\x1f\x78\x5b\xd9\x60\xde\xf9\x7d\xf2\xa9\x39\xf8\x49\xf7\xa8\x1d\x94\x15\xa5\xbb\x22\x5d\xf2\x3e\x55\x13\x93\xfb\x94\x62\x57\x72\x1f\x8f\xbf\x01\xdd\x09\x49\x71\xc6\x2b\x12\xeb\x3e\x06\x0f\x10\x53\xf3\x9c\xaa\x39\xd4\xbd\x5c\x55\x9c\x46\xef\x94\x1c\xca\x18\x6a\x9a\xd8\xa6\xba\x3b\x64\xe7\x9e\x42\xf7\x50\xae\x85\xff\x9d\x29\x19\x5b\x73\xad\x46\x60\xcd\x00\x18\x0d\xa2\x76\x9b\x3c\xe1\x20\x3c\xa1\xaa\x04\xb1\xff\x05\x16\xb5\x4b\x7d\xf3\x10\x43\x0c\x86\x4f\x92\xd7\x50\x55\x13\xce\xfb\x38\xdd\x38\x90\xb3\xbf\xfe\x09\x7a\x3d\xed\xa1\xb5\x11\x9f\xb9\x5f\xb6\x24\xa9\x7e\x99\xb3\xce\xf1\x16\xe1\x90\x7f\xbe\xaf\xcb\xef\x88\x81\x04\x7b\xe2\x41\xae\x26\x5f\x79\x5e\xab\x2d\x54\xd3\xd7\x5a\xa9\xec\x67\x35\x89\xd0\x11\x5c\x30\x18\x56\x38\x8f\xc6\xdf\x51\x7f\x64\x8e\xe4\xf4\xb1\x34\x67\xaa\x25\x6f\xd9\x66\xbb\xae\xc2\x64\xcd\xf7\xd0\x0a\xde\x6b\xf9\x20\xfe\x25\x0d\x11\x1b\x09\x55\x08\xf3\x1a\xb7\x8f\x0d\xf9\xb7\xfe\xd7\x2e\x53\x11\xbf\x16\xd1\x93\x37\x03\x67\xbe\xb7\x9c\x8d\x32\x7b\xca\xad\x6e\x9a\x51\x66\x16\xdd\xf8\x82\x7d\xaa\x30\xb4\xaf\x70\x00\x3c\x11\xa6\xbf\x15\x0f\x3b\xa2\xe5\xdb\x41\xd0\x7a\x49\x0e\x81\xbc\x6d\xf9\x65\x10\xae\x14\x31\x9f\xfa\x94\x72\xd0\x8d\x9e\x06\xe9\x48\x85\x8d\xa3\x36\x78\x80\xe2\xfc\x62\xd0\xbd\x6c\x01\xc8\xad\xbe\x01\x97\x52\x43\x21\xe4\xe4\x2e\x09\xe2\x02\x61\xf2\x48\xf5\x19\x04\xe7\xfc\xcf\xf7\x55\x68\x84\x60\x82\xbc\xb9\x19\xae\xc3\x80\xd1\x5e\xe1\xc1\xd1\x45\x31\xd5\x21\x5e\xc3\xdf\x31\x68\x99\xc1\xba\xb2\xba\xc8\xcf\xb3\xa5\x66\x87\x04\xec\xc3\x21\x05\xd0\x01\x4b\xc1\x04\xcb\x23\xdd\xfa\xcd\xf4\x32\xc8\xf2\x81\x0c\xb2\xf4\xa2\x77\xb7\xa5\x31\x4a\x1e\x91\xab\xe3\xc7\x9a\x1d\x18\xff\x6e\xb9\xe4\xdf\x54\xdf\x76\x6e\x94\x77\x40\x5e\x2c\xbb\x12\xaf\xbe\x4b\xf7\x7b\xd9\x81\x0a\x64\x29\xdb\xce\xdd\x46\x58\xbb\x53\x21\xcf\x95\xea\xef\xf6\x54\x94\x5a\xe0\x81\xc4\x76\xce\x1f\x22\x42\x56\xe6\x03\xf3\x7b\x3a\x9e\x80\xd9\x09\x86\xcd\x20\x87\x72\xd4\x26\x62\x3a\x03\xfa\x7a\xc1\x68\x8d\xa3\x73\xab\xda\xa5\x45\xad\x33\x8c\xf6\xba\x55\x84\x85\x16\xcc\x87\x38\x5c\xd8\x95\x0e\x84\x0f\xfb\x6a\x5f\x76\x3e\xaa\xf2\x23\xbb\x68\x5d\x72\x24\xcc\x8d\x61\xb1\xc5\xbe\x81\x89\x2f\x12\x1e\xed\x4a\xa7\xe1\x01\xec\x04\x5e\xc6\xf2\xae\x58\x6f\x0a\xc0\x9c\xc1\x28\x31\xd8\x11\xa3\xa5\x6a\x9b\x66\x99\x34\xd4\x67\x57\x4a\x8e\x34\x46\xf5\x9d\x4f\x86\xbe\xa1\x30\xea\xdb\x2b\x7d\x14\x96\x8a\x4a\x05\x68\xb3\xb7\x02\x61\x08\xd8\x4e\x67\x7f\x48\x70\x84\x1e\xb9\xef\x63\x0c\x43\x17\xc3\x29\x02\xc5\x5a\xf1\x2f\xdb\x29\x55\xb5\xd1\x31\x86\x14\x0f\xa4\x4b\x46\xc5\x95\x01\x69\xb3\x30\xde\xe8\x37\x01\x7d\x96\x4d\x3d\xc4\xce\xc6\x55\xfd\x96\x0b\x3a\x86\xbb\xb5\x5e\x65\xb1\x5d\xb5\xbd\x69\x1f\xe9\x08\x54\xef\x2c\x4b\xf4\xe4\xbd\x01\xd4\x48\x69\xb3\xa4\xc9\x56\x5e\xe1\xeb\xd5\x3e\x02\xfc\xab\x72\xa3\x6e\x1c\x22\x45\x94\x2e\x5e\xdc\x2a\xb7\x69\xc9\xab\x50\x45\x6e\x99\xdb\x34\xb7\x4c\xa8\xe5\x78\xca\x52\xd2\xb7\x57\x7f\xb2\x4d\x8d\xd9\x1f\xcd\x87\x8b\x75\xa4\x86\x42\x19\x2b\x50\xea\x2b\x37\xbd\x89\x04\xe7\x26\x34\xd7\x0d\x1c\xd4\x25\x52\x9a\xa6\xd5\xe2\xa4\x72\x7d\x08\x36\xdb\xb2\x76\xee\xcd\x96\x0c\xf6\xd9\xbc\xa5\x29\x45\xa0\x96\x91\x26\xe7\x70\x04\xcb\xd0\x6f\x09\xfc\xca\x43\xff\x99\x3d\x14\xba\x37\x9d\x71\x12\x63\xd8\xf0\xd6\xa6\x8c\x54\x13\x85\x22\x18\x71\xa4\xbb\xd6\x70\x32\x74\xc1\x96\xe3\x38\x9b\xda\xde\x8c\x03\xf7\x65\x80\xfa\x9c\x7c\x51\xd6\xa5\xbb\x61\x33\xa4\xef\xc5\x00\x04\x44\x4b\x1f\x9b\x68\x40\x36\x7d\x40\xa2\x65\x7b\xc0\x0b\xac\x29\x3b\x93\x37\x9d\x05\x9a\xbe\xda\x86\x85\xf9\x02\x0c\xc4\x96\xd1\x39\xa6\x21\x7e\x4a\x7f\x49\x9f\x29\xed\x0f\xbf\x53\x6c\x62\x9c\xc2\xdc\x54\x2a\x6c\x53\xfd\x3a\x9b\xf4\x23\xcb\xb0\x61\x10\xd3\xbe\x49\xd5\x1a\xec\x2d\xb7\xae\xb7\x92\x15\xca\x1e\x1f\xa2\xa3\x8f\x87\x73\x59\x7a\x8c\x77\x1d\xc0\xc7\x6e\x46\xfe\x46\x67\x57\x5c\xc0\xd3\xfe\xd8\x0c\xea\x69\x42\x2b\xb7\x7a\x6f\xa4\x77\xf3\x76\x5e\x55\x23\xd4\xe4\x68\x6c\xff\x1f\x73\xa0\x5f\xcb\x32\xa2\xab\x21\xc0\x6c\xd1\x64\x8f\xcc\x8a\x6c\x5f\x85\x04\x1e\xba\x11\xbe\xff\xc0\x66\x73\xe4\x78\x96\x82\x69\x1c\xce\x6b\x1c\x02\x27\xfc\x12\xb1\x4c\x60\xf2\xdd\x3a\x43\x6c\x17\xfd\x03\xb1\x14\xc7\x11\x4f\xe8\xe8\xe3\x52\x4f\xdb\xd4\x89\x0c\x9b\xca\x84\x80\x9b\xe6\x23\xd7\xbf\xd4\x94\x29\x2e\x68\x9b\x7f\x11\x26\xf3\x07\x9c\x9f\x33\x3d\x90\x36\xeb\x98\xd2\x9f\xe2\x2b\xca\xce\xdf\xbb\x10\x58\x92\x09\xd2\x2a\xb3\xf8\x50\x51\x31\x6a\x99\x38\x48\x21\xb4\x7e\xe7\xb2\x84\xbc\x25\xd8\x7f\xbb\x27\xfa\xa6\x82\x06\xa7\x90\x8e\xca\xc9\x1e\xd1\xa9\xe5\x5d\x2c\xe1\x47\x06\x5c\xd5\x49\xaa\x79\x95\x73\x19\xc9\x99\xda\xa1\x71\xcc\x78\xf6\xbe\x33\x26\x37\x5a\xf5\x51\x46\xed\x43\xdd\xa1\x37\x1a\xdb\x06\xea\xfa\x7e\x6a\xb9\x75\xbf\x49\x15\xf5\x4f\xb2\xa8\xf2\x6b\x08\x37\xec\x45\x22\xd4\x10\xce\xd7\x1c\x26\x7a\xfe\x40\x81\x54\xa3\x34\x2e\x31\xd2\x3b\x85\x4a\xe7\x8d\x32\x83\x3f\x35\x82\x3a\xb3\x14\x55\x01\x00\xa6\x2e\x24\x57\x56\xd1\xbc\x8c\x7d\xbc\xc6\x0d\xb9\x26\xc2\xee\xf8\x86\x5f\x0e\xe7\x00\x57\x58\x59\xd6\x18\xca\x7c\x8c\x31\xd4\x9b\x06\x8d\x1f\xd5\x84\x39\x1a\xc9\x55\xbb\xee\xb5\xa9\xc8\xab\x6f\xcb\x77\x98\x2d\xbb\x9a\x81\x2f\xdc\xe8\x6f\xc6\x50\x0f\x28\x2c\xf9\xd6\x31\x8b\x79\x71\x2b\x2b\x6a\x36\x02\x5a\x96\xd4\x47\x7a\x56\x04\x0d\xc9\x04\x81\xc5\x6d\xa7\x1f\xbc\x69\x0e\x39\x97\x1a\x77\x07\x57\x34\x41\x01\xe7\x72\x41\x79\x43\xee\xfc\x8c\xee\xac\xf8\xdd\x5c\xf1\x3b\xa8\xb4\xf2\xb7\x64\x8b\x6f\x6f\x09\xf1\xb0\x96\x47\xc2\x7c\xd4\x0f\x57\x54\x11\x13\x8c\xdf\xe0\xf1\xc6\x96\x92\xea\xad\x73\xa1\x06\x8a\xf5\x3f\x51\x2a\x65\x1e\xc2\x02\x33\xe2\x66\x81\x0a\x39\x3a\xef\x80\xeb\x96\x3a\x7e\x07\xa4\x18\xa3\xe3\xb8\x41\x20\x68\x7a\xc9\xc1\x22\x90\xc6\xce\x6b\x95\xf0\x83\x0c\x30\x83\x54\x65\x58\x6a\xe1\x1c\x63\xce\xf8\x65\x32\x1a\x92\x90\x8d\x03\xe2\x61\xdc\x7e\x53\x89\x2d\x02\x6b\xc4\x31\x8b\x23\xb5\x1a\x00\xe8\xa1\x2a\xe5\x93\xcb\xfa\x27\x33\xb5\x87\x35\x59\x0f\x9b\x4c\x13\xb3\xb3\xb7\x15\xa5\xea\xbc\xed\x17\x97\x1e\xff\xb1\x63\xe3\x71\x64\x9c\x21\x36\x44\xef\xa1\x54\x66\x72\x8e\x2b\xbf\x75\xd9\xc4\x72\x24\xf4\x21\xd4\x5d\xfb\x75\xc0\x65\x76\xff\xe0\x27\x90\x4b\x56\x5c\xd1\xbb\xdc\x03\x39\xea\x25\x9c\x3a\x03\x81\xa3\xe2\xcb\x88\x0f\x7d\xda\x22\x54\x02\x2e\x0f\x01\xf6\x21\xde\x45\xe2\xaf\x96\xb1\x7e\x04\x4c\xce\x86\xe1\x68\x1e\x1b\xe2\xf5\x0b\x35\x10\xc6\xa8\x0f\xc1\x34\x12\xeb\xb9\xbe\xd6\xeb\x72\xb0\x66\x89\xc0\x5c\x7b\xa3\xfd\x32\x47\xf8\xc8\x66\x7b\x3b\x79\x61\x0f\x96\xb1\x1d\x34\x11\x9f\x2e\xc5\x57\x45\x6f\x0e\xf5\xf1\xe2\x7e\x57\x0b\x65\x30\x70\x7a\x85\xa6\x2c\x19\x55\x61\x16\x6f\xc0\x58\x08\xac\x38\x57\x8f\x0c\x46\x1e\xc9\x1c\x38\xf9\xca\xed\x1a\xd5\xe6\xc3\xbe\x96\x42\x7b\x5f\xc5\x47\x66\xde\x49\x45\x05\xb9\xdd\xc0\x37\x1a\x7a\x25\xa1\x80\x57\xd2\xc3\xbe\x86\xc5\x40\x19\x89\x63\x0f\x2b\xba\xd1\xd1\xb9\x5a\x5f\xf6\x7c\x3f\xdc\xa9\xd8\x73\xb0\x9b\xf6\x9c\xd6\x86\x29\xfd\xfb\x62\x3a\xd3\x3e\x33\xc3\xc5\x7f\x07\x4c\xd8\xc0\x5a\xed\x46\x50\xd0\xe4\xe7\x5d\x0e\xd0\x1c\xc1\x1b\x94\xa3\x27\xec\x52\xa5\x55\x7b\xd2\x07\xd9\xa7\x8e\x83\x8b\x3b\x8d\x47\xf6\xd0\xa4\x48\x9b\x5e\x84\x13\x24\x52\x33\xe8\x45\x99\x5a\x60\x85\x51\x60\x52\x96\xa6\x64\x13\xc7\x0f\xf3\xb1\x0f\xb4\xa2\xfd\x08\xc2\xe2\x0a\x23\x86\x67\xcc\xc1\xd9\x18\x9b\xf6\xcb\x4e\x66\xef\x4d\xc5\xdf\x61\x7b\xe6\xf3\x48\xf5\xb2\x55\x69\x43\x80\x0d\x7b\x8d\x68\xa7\x31\x9d\xf3\x55\x60\xfe\x1b\x11\xd0\xed\x76\x2a\x2d\x1f\x26\x75\x8a\x8f\x01\x79\xf1\x34\x00\x08\xaa\xf8\xa1\x4c\x21\x1d\x8f\xd0\x74\x3b\x6f\xa5\xdc\xbb\x3c\xad\xe6\x0b\x56\xca\x8e\x06\x17\x6f\xcd\xdb\xdb\x95\x5e\x58\x6e\x46\x83\xb4\x69\x7a\x45\xbe\x40\x19\xcf\x70\x20\x98\x14\xeb\x72\xef\x69\x28\xc3\x71\xbb\x31\x40\xe9\x46\x79\x9a\x74\xa2\x5b\x18\xea\x6d\x27\x99\x60\x72\xa9\x13\x3a\x78\x0e\xa1\x1c\xcb\x47\xf8\xd5\xed\x8f\x2a\x54\x2b\xab\xb6\x76\x7d\xc0\xb5\x0c\x1f\xc6\xc9\xc3\x88\x8f\x07\xfb\x58\x10\x77\x13\x33\xd8\x10\x05\x1d\xfe\x51\xf4\xb3\x0b\x27\x6f\x5a\xaa\x9d\x86\xfd\x0e\x05\x7b\x61\x2d\x01\x5e\xa1\x3b\x77\x5f\x9d\x5b\x4f\xef\x3c\x8e\x10\x0d\x34\x7a\xbc\xba\x16\x08\x18\xd2\xf7\xf6\xc7\x77\xf4\xf2\xcb\x2f\xe1\x00\x99\x50\x44\x13\x37\x14\x0a\x38\x80\x27\xc2\xd1\x7d\xfa\x8a\x78\xee\x00\x81\xe8\xa1\x5d\x0d\xaa\xa6\x0b\xbe\x34\x7d\x3d\x93\xe6\x05\x6d\x6d\x84\x89\x8d\xff\x7d\x7c\x5b\x4e\x3f\x7e\x51\xb6\x96\xa9\xc0\x60\xc8\xe2\x96\x2b\x23\x66\x0c\x79\xdc\x9d\xb1\xd5\xb1\x43\x80\xa1\xc5\xe7\x26\x95\x5c\x75\x0a\x2f\x3f\xe1\xc3\xa2\xb3\x7c\x54\xe6\x01\x94\x6d\xa5\x22\x11\xa7\xad\x1c\x80\xf0\xeb\xfb\x21\xbc\xe9\xcf\x7a\x60\x83\xc5\x32\x26\x19\x62\xf2\x41\xf9\x3a\x0c\x19\xde\x7b\x23\x81\xf9\x4a\x6f\xce\xad\x88\x64\x80\x07\x7b\xab\x70\xf1\xf5\x87\x5f\x6a\x19\xaf\xf6\xd6\x2b\x5f\x1c\xda\x91\x7e\x04\x7a\x0d\x66\xca\xae\x71\x42\xa1\x0c\x2e\x73\xec\x79\x05\xbb\xac\x6b\x20\x8e\xf9\x2b\xe1\x25\xab\xe2\x20\xbf\x31\x4b\x12\x08\x23\x14\x6c\x71\x88\xc3\x4d\xa7\xa3\x55\x26\x07\x86\x60\x42\xf5\x05\xb1\x4e\xe9\x63\xe4\x0b\xc3\xfa\xa2\x93\x57\x1b\x68\xeb\xf4\x22\xc9\x67\xce\x8a\xcd\x43\xd9\x5a\x3f\x39\xde\x03\x7f\x1c\x17\xf7\xb7\x80\x64\x56\xb9\x5e\x55\xdc\xc5\x71\x79\x87\x5c\xef\x29\xa3\x7b\x6a\x90\xac\x9b\x53\x77\xc0\x90\xe4\x06\xe1\x93\x53\x66\x96\xc5\x6f\x06\x6d\x3c\x81\xb9\x7d\xff\x0a\x39\x5d\x08\x3b\x90\x4b\x6d\x17\xc0\xe4\x8e\x2b\xf4\x8f\x6e\xea\x62\xf8\x15\xc0\xe3\xa6\xcd\x0a\x46\xa2\xd7\xd8\xb5\xcc\x18\xbc\x81\xb7\xaa\x4c\xd3\xb2\x3c\x60\xd0\x50\x79\xf3\x92\x3f\xe2\xe8\xd1\x4f\x4c\x59\xfe\xf8\x0e\xd9\x34\x0a\xc1\x2c\x87\xdf\xec\x2c\x5a\x01\x86\xef\x1c\xe0\x4d\xcd\x38\x40\x37\x2d\x81\x2b\xc3\x20\xf7\x52\xc1\x5c\xea\x80\x49\x9b\xc0\x8c\x24\x8b\x25\x1c\x5a\xec\x1d\xc8\xcb\x1e\x26\x06\x63\x05\x26\x2a\x1f\x8a\x8b\x15\x4e\x3c\x1e\xa0\xaf\x47\x1c\x14\xce\x0b\x7a\x60\x23\x98\xbb\xd7\xb8\x87\x60\x5b\x17\x6a\xfe\x27\x69\x9d\x03\x71\x8c\x23\xd7\x43\x8e\xe7\x26\xfc\x00\xcf\x66\xb4\xc0\xef\x3f\xf9\x0e\xcc\xd6\x96\x26\x50\xff\x71\xd8\xd9\x9f\xb0\xc9\xf6\x89\x5f\xfa\x35\x62\xc5\x17\x80\xbd\x0d\x4e\xe7\x6c\xc4\x95\xbd\x85\x52\x1f\x18\x3f\x25\x61\xd0\xc3\xc7\xc9\xdb\x6d\x7d\x44\x28\xce\x84\xcf\x2a\x63\xb8\xf9\x6c\x79\xf5\x7e\xab\xc0\x31\x6e\x5c\x3b\xc1\x16\x70\xa8\xfc\x83\x72\x24\x92\xda\x8c\x32\xe9\xa8\xc8\x69\xd9\x4a\x48\x11\x88\x61\x90\xad\xa4\xdc\xab\xce\xf0\x38\xc4\x1a\xb2\xf4\xda\x22\xe0\x38\x4d\x6d\x5d\xae\x51\x54\xce\xc2\x6c\xe6\x71\x71\x98\x4e\xd9\x1c\xbc\x39\x28\x67\x11\xdf\x2e\x3b\xf6\x5a\xcd\x80\xb4\x36\x46\x24\x6a\x1a\x37\x9f\xce\x0d\xa0\x75\x81\x53\x5c\xbf\x8e\x88\xef\x3d\x34\x60\x33\xa7\x4f\x56\x34\xf6\xef\x48\x81\x8c\x30\x58\x9b\x3f\x28\x65\xc7\x43\xe8\x35\x35\xbd\xcd\xe8\x0f\xf1\xd6\xa2\xa8\x19\x38\x79\x20\xb0\x88\xe3\xd6\xa8\xcc\x07\x72\x9e\x93\xca\x50\x77\xfe\xe4\x00\x6e\x47\x49\x07\xcb\x2f\x37\x24\xcb\xfb\x18\x72\x26\x90\x54\xd2\x87\x72\x33\xee\x61\xc2\x39\x55\xc2\xc6\x84\xd0\x26\xde\x86\x05\xd4\x14\xbe\x98\x97\x0f\x0c\xf2\x79\x76\xde\x76\x35\xbc\x87\x66\x88\x37\x62\xb0\x87\x2d\x92\xa7\xf1\xda\xd2\xe2\xe2\x6a\x42\x7f\x84\x88\xa2\x69\xe4\x0f\x3b\x8d\xff\x64\x4a\x38\x5c\x9e\x0f\x13\xe2\x3d\x3f\xdf\xc2\x43\x7e\x51\x53\x5a\x3b\x9a\x09\x03\xe1\xbf\x0c\x62\x9f\x79\x85\xa5\xa0\xe1\x58\x16\x4c\xcf\x65\xf4\xa4\x8d\xdd\x5c\xf4\x19\x9f\x63\xb7\x68\x37\x52\xde\x45\xde\x25\xe7\x7a\xda\x62\xe4\x89\xd2\x18\x7f\xfb\x29\x35\xdf\x64\x5f\x42\xbe\xc3\x1f\x95\x46\x3f\x39\x92\x7e\x7e\xca\xfb\x71\x0c\xd4\x4f\x4f\x85\xd3\x4f\x39\xf7\x46\x56\xa6\x3f\xa9\xfd\x1f\x43\xaa\x6d\x5a\x58\x2e\x1c\x76\x6f\x46\x84\xe0\x54\x35\x22\x3c\xef\x08\xf1\x39\x9b\x67\xd7\x10\x5c\xd7\x2b\x5f\x47\x89\xe3\x69\xf2\xc1\x56\x49\x2f\x11\x5a\x51\xdd\x0e\xf3\x54\x3d\x09\x77\x9c\xe0\x4e\xeb\xd9\xb1\xea\xaf\x11\x53\x5e\xd6\x2d\xc7\x97\x3f\x52\x85\x6e\x99\x7d\xa1\x7f\xfd\x0e\xca\x8d\xdd\xa4\x75\x47\xbf\x1f\xd7\x3f\x72\x77\x58\x30\x68\xba\xaf\xb1\x3b\x63\x12\x64\xf8\xcf\x52\xf9\x0c\xe3\x12\x79\x18\x56\x3a\x2e\xb0\x16\x73\x16\x12\xc3\xcd\xf7\xea\x17\x87\x43\x74\x9d\x1f\xdc\xde\x5a\x65\x99\xce\xc1\xf1\x8c\x23\x96\xfc\x32\x73\xb7\x01\x09\x6b\xab\xe0\xa3\x6c\x78\x61\x84\x6b\xe6\x72\x25\x0a\x85\xb1\xa2\x3f\x21\x60\x10\x61\xc5\x43\xbc\x09\xe5\xc9\x8e\xff\xc8\x3f\x51\x48\x90\xb8\xa5\x88\x4f\x67\x71\x1f\xfe\x8b\x1b\xb1\x71\xb7\xc6\x78\x07\xfd\xd5\xf9\x8d\xf0\xb0\xfe\x24\x0f\x58\x28\x54\x04\xb9\x73\x48\x50\xa4\x08\xc5\x1f\xb4\xd5\x7a\x64\xcd\xe5\x8f\x4c\xa5\x21\xff\x34\x56\xca\xe1\x63\x5c\xc2\x79\xd1\xad\xcb\x0b\x5a\xfe\x51\x04\x3b\x66\x2c\x36\x55\x68\xd5\x68\x6a\xcc\xa3\x6c\x1a\xe1\x81\x38\x0a\x67\x26\xaf\x00\xa6\xd6\xf4\x9d\x7d\xf4\xe3\xe2\xe0\xa1\x25\x2b\x74\x9d\xef\x70\x90\x29\xc7\x70\x02\xa3\x29\x33\x28\xef\xdb\xb2\x2c\x28\xca\x80\x80\x2d\x5a\x33\xd6\x48\x20\xe2\x25\x2c\x24\xcb\xa9\xb3\xab\xbe\x24\x62\xac\xe4\xf4\x5b\xb5\x71\x14\xdb\x92\x0f\x2c\x2b\xb5\x1e\x97\xa1\x8e\xe3\x5d\x53\xcf\x7e\x53\x55\xe3\x0d\x68\x8a\x6b\x17\x08\xa7\x75\xe2\xd7\xcc\xbe\x05\xef\x97\x63\x33\xdd\x86\x52\x69\xea\x46\x47\x47\xff\xec\x4d\xfb\x1b\xd2\x36\xe4\xcf\x14\xe8\x72\x07\x2f\x35\x8f\x85\x17\x0e\x48\x1b\xe0\xed\x14\xe1\xee\xc9\x19\xc4\x65\x60\x13\x6c\x8c\x0c\xcf\x9e\xa2\x07\xa3\x45\x28\x48\x1a\xdf\x7c\xc8\x3a\x61\x39\xb1\x54\x87\xc8\x4e\x9b\xff\xbb\x8d\x71\x35\x2e\xc5\xf3\x78\x68\x49\x02\x03\xe2\xd4\xf7\xcb\x20\x46\xe9\x35\xb3\xbb\xea\x77\xd8\x0b\x4b\xd2\x99\xd8\x02\xbe\x4f\x39\x3c\x46\xee\x98\x01\x75\x6b\x9d\xe6\x68\xc6\xe2\xee\x83\xfb\x58\xbf\xea\xbb\xff\xe9\x71\x3a\xaa\xaa\x13\xb8\xa1\xa4\xa5\xb1\xb5\xbf\xd7\x24\x0a\x8e\x2a\x1a\x7d\x58\xcb\xca\xaf\x87\x03\x62\x60\xd6\x81\x4a\xb6\x59\x91\xe9\xc4\x32\xc2\x62\x4f\x43\xd2\xd3\xe7\x1a\x1b\xbb\xa5\x70\xd3\x12\xca\x97\x45\x95\x48\x2c\xa8\x49\xef\x67\x3b\x71\x8f\x5c\x76\xfb\x49\x3c\x76\x06\xb7\x0a\x5e\x7e\x19\x09\x87\x47\x9a\xef\x4a\xe1\x55\x82\x5c\x3b\xde\x05\x25\xe5\x33\xa0\x66\x21\x4c\x82\x96\x07\x4a\xbe\x75\x02\xf5\xaa\x13\xba\x53\x2c\x29\x02\x93\xe7\xf2\x76\xa6\x7e\x77\x86\xab\x7f\xb7\x89\xaf\x03\x6b\xc7\x48\x92\x0f\xd8\x19\x5a\x4f\xce\xa6\x1d\xd2\x4f\x22\xad\x5d\x46\x4f\xe5\x66\x5b\x74\x55\x76\x5e\x1c\xbb\xf8\x79\xbb\xb2\x4a\xea\xa1\x7a\xe9\xf8\x47\xcb\xcf\x52\xf6\x40\x01\x9b\x51\x77\x39\x7e\xcd\x5d\x44\x7d\x19\x97\xa3\x3f\xfb\x55\x9d\x3c\x85\x40\xa2\x50\x75\xf6\x8e\x28\x6a\x8f\x2b\x9b\x1e\x72\x1b\xce\xc8\x97\xe0\xd2\x78\xae\x9f\x2f\x5f\xe0\xe8\x7f\x7b\x96\xf6\x2c\x5a\xca\x9f\x2d\xbc\x81\xcb\x78\xaa\x51\xfa\x7d\x82\x96\x59\xdf\x54\xd9\x59\x2a\xbd\x09\x00\xc1\xc9\xe5\xac\xfd\x2c\xc7\xc3\x59\x70\xad\xe6\x16\x04\xce\x93\x1f\xd7\x6e\x70\xe3\x94\xbf\x63\x86\x44\x30\x02\xe9\x47\x51\xc0\xf0\xe1\x95\x37\xdf\x77\x52\x5e\xa2\xf5\x33\x69\x74\xe1\x5e\xf9\x93\xc3\xfa\x10\x18\x6e\x78\x16\x9e\x6b\x7d\xc0\x89\xc5\x12\xe6\xdd\xdb\x75\x78\xef\xc7\xcb\x05\x12\xb1\x57\xd7\x41\xad\x9d\xdb\xbc\x5e\xde\x90\x15\x77\x8d\xac\x10\xe2\xb1\x9f\x1c\xfe\x8f\xe7\xa5\x9c\xf4\x81\xc6\xca\x12\x8f\x87\xd1\x3c\xdb\x2f\xb4\x20\x71\x5f\x59\x6b\xe5\xe8\xa7\x8f\x85\x16\xea\x4d\xb7\x6b\x84\xb5\xc6\xdd\x33\x5b\x02\x55\xad\xd9\x87\x93\x63\x05\xfb\x80\xad\x86\x78\x55\xe0\xea\x05\xb5\x0a\xa7\x46\x0b\xcc\xd8\xad\x20\x56\x0e\xbb\xce\x38\x6d\xfb\xdc\x6b\xa2\x74\x9b\x89\x85\x41\xb2\x79\xd8\x46\xae\x9d\xbc\x62\x91\x90\x64\x79\x66\xbf\xb9\x23\xdb\x96\x89\x09\x6d\x8f\x52\x54\x36\xa3\x11\xd8\x7d\x8f\x36\x08\x6c\x20\x63\x45\x84\xfd\x23\x17\xd8\xf6\xa1\x4e\x69\xb9\x1d\x06\x61\xb0\x28\xf9\x77\xe3\x15\x12\x74\x5a\x6d\xde\xd2\x99\x29\x94\x9d\x63\x38\x29\xb6\x0f\x2b\xf2\xbe\x7d\x22\xf5\xf8\x1a\x49\x55\xf6\x37\xcf\x9a\xe8\xaf\xf2\xcb\x3f\x2c\x0d\x2d\xf8\x8a\x8c\x40\xf5\x9d\xe5\x37\x33\x22\xbb\xfb\x22\x83\x7e\xb3\xac\xfb\x3a\x2f\xd3\x36\x85\x9d\x32\xe0\x5b\x0f\x10\x08\x2b\xa4\x16\x65\x09\x7f\x3d\x88\xe2\x26\xc3\xc0\x1c\x6a\x14\xb2\xce\xb2\x89\x2e\x9b\x10\x8f\xcb\x5a\xad\x3f\x83\x59\xde\xb3\x5b\xea\x04\xa7\xfd\x1a\x1a\xb2\xdd\x1b\x69\xed\xe0\x22\x99\xce\x72\x35\x58\xf8\xb9\x94\x85\x4c\xa2\xc7\xb3\x94\x33\x82\x54\xcf\xee\xdd\x8f\xbb\x05\xa1\xa1\x1d\x68\x4e\x39\x95\xc0\x56\x72\x89\xae\x16\xd3\xff\x27\xf9\x48\x52\x65\x20\x43\xc8\x13\x17\x29\x5f\x3f\x1f\xec\xa8\x22\x16\xc9\x00\x28\x21\x5f\xbd\xc1\xdc\xb1\xe1\xde\x4c\x67\x85\x9e\xa7\xb0\x08\x91\x2f\xa4\x92\xa6\xa6\x60\xa8\x52\xfc\x59\x93\x98\xb0\xdf\x11\xd0\x0a\xac\x37\x22\x4e\x1b\x90\xf8\x0e\x8d\x42\x80\x19\x31\x8f\x52\x7b\x6a\x04\x69\x8b\xc1\xde\xc0\xa0\x7b\x4c\x46\x22\x3d\x34\x80\xd6\xaa\x46\x74\xa0\xc7\x77\xc5\x80\x05\xe0\xf6\x83\x2c\x9d\x01\xee\x5a\xc1\xa9\x9c\xfb\x26\x31\xf1\x5b\x78\x2e\x59\x9c\x65\x71\x41\x27\xfd\x3f\x68\xef\xae\x03\x9f\x14\xb4\xa0\x6c\xcf\xfe\x7b\xdc\x79\xec\x07\x40\x9b\x37\xe4\x4b\x1e\xaa\x7b\xcb\x32\x5b\x47\x72\x9a\x72\xa2\x54\xe0\xcd\x50\x0f\x13\xff\x2c\x45\x42\x4d\x5c\xa2\xf0\x82\x30\xea\xc9\x30\x1c\xa1\xc4\x74\x29\x57\x16\x14\xa8\x25\x01\x1d\xdb\xaf\x2a\x1d\x0e\x68\xa9\xea\x50\xe3\xc0\xc7\x58\xae\x33\x01\xd0\x5b\x39\x39\xec\x1e\x82\xcf\xf9\xd2\x69\x9b\xb6\x6c\xa9\xe8\x9c\x1d\x2f\x05\x4c\xc4\x7a\x48\xb4\xc4\x30\x03\xd4\x03\x63\xd6\xe8\xee\xf0\xc1\x65\x37\xd4\x4a\xe7\x0a\x96\x0b\x6f\x05\xfb\x2e\x8b\x40\xea\x00\x9f\x8d\x06\x03\x6a\x7e\x1b\x6b\xee\x48\xf5\x0c\xe0\x19\xe6\x0c\x5e\x59\x52\xd8\x02\x25\x93\x38\xd3\x5c\x6d\x5b\xe0\x80\xd1\xd5\x68\x2d\x5c\x5a\xfc\xa0\x50\x94\xfa\x33\xe3\x5b\x8f\x18\xac\x3b\xfe\xcf\x51\x9b\x1f\x01\x12\x19\x66\xad\x3c\x40\xb4\x37\x17\xdb\x84\xd2\x45\x33\x68\x55\x80\xab\xbd\xb7\x29\xcb\x22\x2d\x7c\x52\x77\x49\xb5\xca\x2e\x67\x3d\x97\x98\xe6\x53\x2b\x32\x79\x6a\xe4\xcf\xe4\x17\x64\x70\x96\xa2\xb3\x6a\x75\xfd\x37\x96\xf5\x87\x7f\xe6\x48\xf7\x95\x25\x8d\x6f\xfa\x73\x4e\xfd\xa1\x99\xfc\x53\xd6\xc2\xee\xe3\x24\xad\x05\x4c\x4b\x0d\x9d\xc9\xf5\x2b\x55\x02\x34\xa5\x4f\x63\xdc\xd1\xa1\x7d\xe7\xa8\x3c\xde\x57\x40\x3c\x5c\x3a\x77\xdd\x76\xb3\x9d\x76\xdf\x63\x67\x3c\xe5\xfd\xa8\xab\x22\xe0\x6b\xbd\x60\x6f\xd5\x0b\x24\x02\xc6\xc9\xfb\xb2\x21\xb7\x1d\x35\xe3\xb5\x60\x03\x5a\x0f\xee\xe2\x81\x73\xdc\x18\x85\x46\xfb\x92\xe7\xc2\x3b\x2d\x11\xc0\x55\x5e\xde\xaf\x30\xea\x2f\xb1\x1b\x7e\xa7\xa4\x3b\x12\xdb\x96\x2f\xc3\x18\x2f\x5b\xa2\x44\x3b\x03\xcc\xa9\xbe\x4c\x6b\x1e\x03\x8c\xf0\xfd\x4b\xa0\x9e\x02\x9d\x25\x1a\x7c\xd5\xa4\x27\x85\x69\x09\xdb\x95\x32\xfb\xfc\x72\xdb\x2f\xfb\x06\xf9\x53\x9d\x6b\x17\xd7\x10\x90\x64\xd8\x33\x06\xd8\xcc\xf4\xf2\xa7\xd1\x61\xb0\x37\xbf\x80\xe8\xa7\xb0\x5f\x7b\xc2\xf8\x20\x4f\xdd\x85\x1f\xef\xe3\xf6\xad\x13\x8d\x7f\x0e\x63\xcb\x92\xca\x19\xa5\xbd\x16\x8d\x83\x3d\x15\x50\x25\xda\xa7\xaa\x4b\x4d\x4d\x9e\x15\x7b\x7f\xde\xd9\xad\x3a\x3e\x46\x5d\x11\xaa\xc2\xd7\x81\xa9\x68\xc8\x42\x7f\x7b\xf1\x2a\x0e\xf4\xe8\x09\xc4\x82\x16\x7c\x68\x20\x51\xe8\x39\x2f\xf2\xea\x14\xe5\x16\x68\xa4\xb1\x15\x62\xd2\xa9\x93\x23\x3d\x6d\x74\x5b\x0e\x46\x4b\x18\x14\xf2\xe1\xbc\xaf\x3e\x59\x63\x9a\x64\x8d\xdd\xc5\x81\x8d\xd0\x38\xfe\x8a\x6c\x47\x14\xd8\x92\xe2\x7a\x3e\xa2\xe7\x5b\x06\xed\x03\x21\x4f\xba\x57\x02\x9f\x23\x4f\x65\xa6\x16\xd8\x8c\x7f\x48\x23\x55\x44\xb4\x27\x0d\x4f\x52\x45\x97\xa1\xe4\x6d\x4c\x1a\x85\x35\xc8\xeb\x4a\xdf\x04\xf8\xac\x5b\x75\x4f\x0f\xcc\xa4\x83\x92\xb2\x0f\xb0\x6f\x78\x6d\x1c\x69\xfb\x13\x5b\xeb\x28\x7b\x00\x3d\xb1\xb2\xfe\x40\x65\x4b\xc8\xf6\x15\x86\x8e\x1f\xb5\x45\xc0\x35\x1e\xb5\x7f\xca\x24\xf8\x99\x8d\x67\x7e\x16\xec\x82\x16\x83\xb8\x9f\x79\x85\x7a\x29\x74\xa7\xb0\xda\x8b\x0d\xd7\xfe\x61\xc8\x93\x00\x68\x64\x8b\x45\x43\x6f\x87\x38\x1b\x4e\x96\x18\x97\x5f\x2e\xa8\x7b\x10\x9c\xc6\x3e\x88\x8a\xd3\xf5\x52\x99\x2e\x46\x19\xaa\xf8\x54\x63\x2e\xdd\x1c\x96\xeb\x19\x56\x7f\x1c\x77\x36\x37\x25\x70\x6d\xe4\xf9\x5c\x1d\xb8\x4c\x64\x7a\x35\x38\x8c\xfc\x54\xf9\x97\x05\x36\xdd\x5e\x49\x65\x40\x8e\x25\x43\x44\xd6\x9b\x04\x91\x47\xb5\xff\xe5\x2a\xab\xfb\x46\x2b\x73\x20\xc1\xd5\x3d\x64\xc2\x5b\x9f\x3a\x09\x74\x46\x1a\x59\xb5\x73\xa7\xbd\xa9\x46\xbb\xc3\xbd\x90\x76\x18\x88\x28\xc7\x81\x3a\x67\x6b\x73\x57\x8b\x45\x99\x4a\x85\x6e\xb1\x03\xd9\xd6\xc8\xf2\x81\xf5\xa9\xa6\xa6\x3d\x97\xe9\x8a\x0f\xce\xe1\x25\x5b\x96\xd1\x2a\x6b\xc4\x92\x6a\x03\xcf\x05\x5b\xad\xce\x23\xde\x54\xf1\xc2\xbe\x8c\xc0\x2f\xf9\x8c\x25\x29\xcd\xa4\x0c\x9e\xbd\xa3\x8f\x77\x88\x93\xfc\xc1\x67\x60\x0b\x65\xdf\xa7\xdf\x8e\xa9\x6a\x7e\x91\xa9\x9a\x8a\x97\xa1\xfa\x9a\xfb\x94\xe5\x60\xb4\xd3\x17\xe8\xc1\x82\x14\xd8\x76\x40\xdb\xc2\x66\x10\xb0\x36\xc7\x48\x7f\x22\xd7\xca\x71\x8a\x3b\x14\x9e\x81\x4e\x77\x6c\x61\x6a\xa8\xf8\xc9\xdb\xff\x39\x4e\xcd\x0a\xd5\x71\x7d\x6f\xc2\x01\xe9\x96\xca\x0f\xf3\x60\x04\x8a\x1c\x56\xfb\xc6\xfa\xda\x07\x8c\x4f\x96\x80\xb7\xcb\x9d\x8f\x64\xe5\xef\x23\x88\xf3\x40\xb4\x23\x18\xed\xdc\x5e\x02\xa9\x21\xd2\x53\x05\x0b\x47\x3c\xa5\x8a\xa3\xaf\x6f\x41\x2a\x75\x46\x02\xb9\xd3\x6f\x8e\xa8\xa8\x3d\xbd\x4b\x71\xc1\x77\x95\x5e\xa3\xe6\xa4\x1d\x2d\x45\xbe\x8e\x94\xaa\x7a\x81\xc4\x93\xc2\x62\xd5\xa5\x6b\x92\xf1\xe8\xc8\x3d\xdb\xff\xad\xda\xf9\x6c\xf9\x93\xa2\x0b\xe2\x5c\x34\x09\x3a\x19\xf5\xd1\xa8\x49\x40\xf9\xea\xe2\x81\x70\xe2\xb2\x09\x08\x74\x7a\xac\xf7\x71\x49\xd9\xc6\x7b\x4d\x3a\x7b\x55\x8f\x2b\xa5\xa6\xd5\xdc\x32\x04\x45\x6d\x6a\x98\x10\x5e\x1e\xdb\x8a\x0e\xef\x6e\x42\x21\x40\x6d\x7a\xc5\x2b\xed\x55\xc0\xba\xb7\xe1\xb2\x8d\x40\x85\x80\x1e\xca\x18\x51\x5f\x01\x03\x0b\xbc\xfa\xd3\xeb\x2f\x56\x96\x55\xba\x50\x19\xe4\xd7\xa5\x90\x55\x17\x1a\x02\x04\x5f\xff\x5b\x4f\xa5\x95\xb1\x6b\x89\x88\x3c\x9c\x2d\x43\x85\xd9\xa0\x1e\x0a\xd3\xc4\x4d\x6f\xa7\x3d\x2d\xcc\x15\xbb\x75\xaf\xe3\x7f\x31\x5c\xda\xb1\x7e\x39\xce\x60\x0b\xd9\x2d\x0f\x77\x7f\x30\xc4\x0b\x5c\xe8\xf6\xe5\x06\x86\x83\x3e\x1c\x68\x9b\x78\x87\xe8\xca\xa7\xe8\xac\x7e\x65\xcb\xc1\x6d\x51\x9f\x3c\xad\x26\x2a\x42\xfd\x3a\x09\xbe\x2e\x4f\x80\x9a\x80\x5f\x6b\x79\xfe\x83\xfd\xd0\xf5\x33\xcc\x01\x69\x57\x8d\x83\x36\x7a\xb1\xab\x93\xdb\xab\x2c\x4f\x78\x06\xaf\x20\x3a\xdc\x88\x48\x5f\xfc\x49\xba\xba\xee\x15\xee\xf6\x2d\xa0\x91\xda\xdb\x0f\xc1\x6c\x3d\x52\xd9\x42\x55\x8f\x45\xb9\x9b\x30\x09\x2a\xb5\x7e\xa5\xb8\x05\xf7\x5e\xd6\x22\xc4\xb7\xfd\x94\x24\xc0\x1b\x2d\x6b\x03\xd5\xfb\x51\xe7\x4f\xb4\xd3\x83\x02\xb0\xa2\x97\xb0\xc4\x40\xf7\xa4\xa8\x4c\x6d\xff\xea\x51\x13\x77\x1a\xc7\xc6\x76\x9e\xcf\x1c\xc3\xfc\xac\x8c\x82\x2c\xb9\x8e\xff\x53\x61\x04\xa3\xfd\xd6\xfc\xbb\x75\x0c\xa3\x43\x06\x39\x0c\x82\xb4\x07\x14\x22\x7e\xac\x6e\x20\xc2\x95\x01\xc5\x8a\xcd\xc1\x1c\x1c\xa5\xc0\xa9\xf5\x97\xed\xc7\x78\x3f\xf0\x6a\xdf\xb2\x85\x6f\xe0\xfa\x40\xaa\x90\x95\xb7\x0a\xa1\xc2\xd4\xe4\xdf\xa0\xaf\xfa\x5b\x29\xff\xa0\x2d\xab\xa4\x81\xaa\xa6\x2d\x5f\x98\x3e\xcd\x65\x5a\xb4\x42\xc6\xc7\xa9\x06\xfe\x05\x92\xf1\x84\xb5\xbb\x1e\x0a\x8b\xf0\x88\x1f\x93\x0e\x97\x83\x69\xd7\x43\xa3\x9b\x0b\x59\x6e\xc5\xa8\x89\x69\x7b\x8c\x64\x58\x0f\xfd\x65\x96\xab\xd3\xf5\x1e\x18\xd9\x89\x1e\xec\xb0\x94\xcd\x51\xe7\x80\x81\x69\xf6\x40\x19\xea\x8b\xcd\xe7\x48\x3e\x72\x46\x5c\x30\xbf\x87\xec\x20\x50\xe4\xeb\xf1\x57\x65\xdf\x4c\x77\xb5\xa5\x7e\xf1\xaf\x08\x98\x1a\xd0\x50\x60\xd6\x97\x71\x58\x0e\x6f\x0a\x1d\xf4\xf5\x09\x2a\x46\xf2\x3f\xd0\x78\x84\x67\x2f\xf2\xbf\xc9\xff\x1e\x4c\x8a\xc4\x13\x96\xcf\x14\x38\x75\xbe\xd2\x6e\x17\x68\xce\x26\x67\x5b\xb0\x5a\xd2\xb6\x0c\xbd\xd2\xee\x76\x81\xd9\x42\xb3\xf5\x3f\x0d\xd1\xfa\xd1\x06\x69\x61\x1c\xbc\x12\xf9\xf8\x0b\x32\x7a\x4f\xe2\x63\x87\xc4\x2e\xfd\x79\xf9\xd3\x3e\x1f\x79\x73\xcc\x06\x7d\x6b\x19\x00\xa1\xf7\x96\xaa\x30\xdd\xf9\x79\x1c\xe9\x9f\x4c\x3c\x53\x96\x7f\x3a\x99\xe7\x4f\x39\x2b\x9f\x31\x30\xdf\x20\x90\x67\x13\xf9\x88\x91\x2f\x5f\xfe\xb5\xa7\xdb\x71\xc2\xc9\x2d\xc6\x99\x4d\xdd\x9b\xf3\x72\xce\x97\x30\x82\x98\x79\xf2\xce\x11\xb1\x3f\xa5\x60\xb8\x49\x82\x6c\xa4\xdb\x2a\xdc\x71\xcf\xc3\x67\x89\x8b\xe4\x5b\x81\x1c\xc8\x3a\x50\x1a\x95\xd3\x08\x5b\xf3\xb6\x6f\x1e\x67\x3f\xa1\x3b\x14\xa1\x4a\x01\x32\x57\x57\x3e\xb4\xd2\x21\xe7\x7e\x48\xb1\xe8\xce\x6e\xae\x0b\xfc\x8e\x7f\xa1\x4f\x91\xb2\xc6\xa1\xc0\xec\xe8\x80\x96\x45\xe2\xd4\x4d\xd9\x05\x4c\x46\xad\x4b\xa1\x58\x7e\xa3\xd9\xe3\x49\xee\x28\x90\xf5\x23\x82\x52\x43\x20\x55\xa3\x6c\x1a\xc3\x43\xd7\xff\x1c\x66\x77\x23\x2f\xd0\x23\xfb\x25\xd1\x24\xfc\x49\x52\x1a\x93\x22\x33\x9d\x93\x1a\xfc\xd3\xf9\x04\xeb\x91\x40\xb9\x74\xc6\x86\xbf\x5f\xbd\xf7\x72\x10\x2d\xfb\xe7\x98\x72\xf8\x2c\x4f\x65\x3d\xda\xd8\x9f\x9e\xca\x7c\x64\x28\x82\xd9\x5c\x1a\x04\x53\x20\xdc\xcf\x70\x1b\x1d\xb7\xf2\x6f\x9c\xb4\x83\xb1\x06\x79\x16\x0f\x7d\xea\xc7\x3d\xb8\x79\x53\x3a\x59\x2e\xdd\x1c\xc0\xa7\x5b\x7b\x6e\xfa\x1b\x99\x52\x14\xe2\x53\xd2\xa9\xf3\x2c\x2b\x0f\x31\xec\xb2\x87\x98\xe0\xa6\xb3\xbf\xa5\xe6\x7e\xe6\xfd\x23\x6e\xeb\xf3\x01\x87\xd1\x1b\x85\xc8\xfa\xee\x9f\x96\x55\x3d\xfd\xd0\xb2\x23\x9f\x38\xa1\xfc\xd0\x69\x58\xf0\xf6\x89\x08\x35\xae\xdd\x65\x38\x3a\x03\xf9\x87\x42\x79\x41\xe1\x79\x72\xec\xd3\x8f\x34\xab\x3f\xc0\xeb\xc7\x56\xa0\xf8\xa6\x9e\x17\xdc\xc4\xb4\xca\xfe\x54\xd5\x0a\x80\x6f\xed\xa4\x81\x7b\x7f\x87\xe5\x05\xd4\x6d\x84\x5a\xd4\x59\x3f\x72\x1f\xd7\x51\x23\x6d\x4f\x0c\x87\xd3\xf8\x54\xf7\x0b\x6b\xb6\xcd\xef\x9d\xc0\x47\xbc\x6e\xff\x0b\xff\x83\x2b\xbd\x0f\x8e\xa8\x61\x08\xdc\x7d\xd1\x50\x05\x4b\x97\xc3\x80\xa4\x9d\xed\xe7\x7f\x21\x8e\x6e\x55\xc1\xac\xa9\x14\xc0\xfb\x12\xbc\xde\x72\x90\x84\x9b\x37\x5b\x48\x95\x19\x9a\x1c\xfa\xe6\x2f\x03\x92\x4b\xd4\x1c\xe9\x81\x61\x81\x3a\xfa\x0a\x85\x9c\x80\xec\x82\x51\xfa\x86\x87\xe2\xb8\xa1\x6b\x2e\x2f\xb3\xd8\x27\x58\xdd\x1b\x38\xff\xfe\xf3\x60\xd5\x0f\x01\x25\x73\x40\xd0\xb9\x33\x06\x1d\x66\x45\x0f\x1a\xf5\xda\x35\xb8\x9c\xc7\x65\x4f\x72\x24\x3b\x0e\x33\xfd\xf0\x26\x04\x5a\x30\xf2\x21\xd3\x05\xf6\xce\x85\x30\xef\xce\x5d\x05\x88\x8f\x42\x52\x43\x8b\x5f\x01\x40\xc7\x35\xfd\xe8\xcd\x58\x63\x7c\xa0\x2f\x89\x47\x2a\x2b\xc0\x5d\x0a\x65\xed\x44\x1e\xc9\xb6\xc1\x5b\xac\x4d\x65\x88\x56\xb6\x86\x4b\x37\x38\x10\x11\x3d\xbd\x36\x68\x06\x38\x1a\xdf\x21\xf6\x79\x80\x19\x4e\x80\xbc\x36\xf1\x10\xda\x50\x87\xdd\x4f\xb9\x29\xf3\x63\xea\xdb\x8b\x83\x36\x20\x90\x81\x80\x16\x48\xd4\x44\xbe\xd1\x56\x17\xb4\x7c\x26\xea\x26\x6c\x7c\x3a\xa8\xc4\xbe\x90\x67\x1e\x1b\x15\x1f\x97\xfa\xe9\xca\xc1\x9c\x47\x3d\x62\x84\x7c\xb2\xf5\xbd\x9e\xf2\x07\x10\xf5\x47\x81\xe6\xfd\xe7\x7a\x56\xd9\x0e\x4c\x55\x7f\x1d\x26\xc6\x59\xca\xe2\x01\x5a\x65\xaa\xb7\x27\x41\xe8\xe5\xc5\x3e\xec\xfd\x53\x09\xd1\x87\x20\x65\xd0\xde\x63\x20\x83\x54\xe8\xf7\x9f\x5d\x1a\x87\xca\xd6\x1e\xd2\x19\x77\x1d\x01\x84\xbb\xa5\x74\x77\xde\xe4\xfd\x7c\xda\xad\x38\xcf\xb4\x47\xb8\x6f\x97\x9e\xfd\x5e\xbe\x15\x4e\xfd\xf7\x0c\x1d\x25\x17\xda\x7b\x39\xdb\xb4\xe4\x43\x8b\x1d\x6b\xf7\x1d\x7b\x0e\x09\xa9\xcb\x5c\xfa\x16\x5f\x11\xc3\x47\xc4\x22\x2e\x7f\xbc\x19\xf5\x18\x25\x2e\x32\xfe\x90\xc0\xf8\x34\x2e\x15\x10\x1f\xc3\x29\xe5\x3e\x56\x20\xbb\xfc\x86\xf7\x90\x86\x8f\xd8\xf8\x6b\x9b\x04\x24\xbc\xee\xa6\xef\xf2\x30\xd2\xfd\x5d\x24\x95\x72\x0d\x71\xb7\x1b\xfe\x10\x30\xba\xaa\xcf\x00\xd7\x51\x9c\xb0\x7b\x0f\xe7\x09\xa3\xf9\x1c\xeb\x6b\xe9\x0d\xc4\xa7\x17\x66\x9a\x48\x55\xb4\xdf\xdc\x3d\xc1\xf0\xa0\xd7\x28\x39\xb4\x15\x26\x60\x7a\x4d\x44\x2a\x2e\xb1\x93\xea\x7f\x1d\xee\xfc\x75\x20\x50\xfb\xb7\x54\x4d\x75\xd8\xaf\x81\xc1\x43\x97\xe6\xbd\x5a\xff\xab\x1b\x2b\xbe\x8d\xac\xb3\xd8\x44\xec\x7d\x10\xe3\xfa\xe5\xef\xc3\xdf\xa8\x2f\xb3\xaf\x45\xdf\x6f\x6f\x39\xd1\x0e\x0d\xf1\x72\x79\x53\xb4\x8e\xd5\xfd\xd0\xad\x54\xc1\xf7\x80\x13\x53\xff\xd8\x12\x24\xa8\x7e\x1e\x05\xc4\x43\xe3\xa3\x3b\x90\xc6\x15\xcf\x99\x43\xf2\x5d\xe5\xfe\xd6\x7a\xeb\x93\x96\x45\x8c\xf4\xf9\xfe\xb1\xfd\x3f\x57\xdf\xb6\xe5\xaa\xce\x33\xfb\x2e\xb9\xe9\x9b\xfd\x52\x06\x1c\xa0\x03\x98\x8f\x43\x32\xe9\xa7\xdf\x2a\x55\xc9\x64\xfd\x73\xad\x31\x90\x09\x49\x68\x02\xb6\x25\xd7\xc1\x7e\xd9\x41\x57\xc6\x13\x13\x3d\x04\xdd\x35\xe9\x2e\xea\x5c\x6f\x8d\xb4\xe3\x33\x64\xf8\xba\x28\xb9\x74\xee\xa3\xa2\x9d\x10\x3d\xc2\xb6\x50\xfd\xd7\x66\x33\x10\xb7\xa0\xe9\x54\x17\x66\xaa\x5d\x89\xed\x66\xf3\x4d\xbe\xb4\xfa\x75\xf5\x70\x76\x5d\xb9\x58\x38\x97\x88\x0d\x96\xf5\x4b\xf5\x70\x74\x0f\xa6\x4a\xf9\x3e\xc8\x7b\x08\xdf\x46\xbe\xcf\xfe\xec\x0f\xd7\xe4\x77\x37\x4e\x7e\x88\xe7\x0d\x54\x64\x65\x87\x27\x99\x12\x20\x5c\x9d\x2a\xae\x8f\xa4\x0d\x4a\x65\x7e\x43\x0e\xc4\xa3\xf0\xd5\xee\xf4\xfb\x75\x23\x68\x8f\xfa\x74\x5f\x9e\x74\xce\xf3\x98\x62\xf1\x13\x90\x00\x4a\xd1\x8b\xbe\xad\xd5\x7d\x0d\xb0\x8c\xc7\x5e\x1d\x6a\x57\x61\xea\x50\x61\x9e\x58\x1d\x47\x48\xf8\x30\x69\xe9\xd9\x2b\x14\xfc\x98\xa7\x8d\x6e\x21\xbc\xdc\x96\xd8\xdb\xa4\x5b\xab\x39\xb1\x57\xe8\x30\xe7\xf3\xed\xca\xde\xb3\x4b\xb3\x2a\xaa\x16\x05\xd0\x20\x8d\xfb\x25\xf2\x76\x47\x3a\x5c\xf7\x53\xb2\xbc\x0e\x5a\xa7\xca\x08\x65\xb0\xe9\x86\x80\xf1\x3e\x5f\xe4\xdd\xd0\xd2\x0d\x14\xaa\xcc\xb7\xb9\xe0\x66\x23\x19\x83\xbc\x0a\x7e\x60\x93\x13\x2d\x7b\x39\x56\x60\xbb\xd8\xb5\x79\x43\xab\xe9\x5b\xe0\xf0\xd9\x5a\x6e\xdb\xc8\xb5\x9a\x45\x5a\xfa\x5a\x0e\x45\x42\x11\x10\x21\x53\xa1\x06\xa5\x42\x01\x9c\x0c\xc7\x90\x62\xaf\x15\x2f\x00\xf4\x40\x1b\x4e\x94\x0e\x1f\xe8\x6e\xc9\x67\xfb\x75\x26\x31\xe9\x49\xde\xfe\x72\xa7\xb4\xce\xef\x56\x61\x83\x06\xf4\xd9\x86\x07\x65\x17\x00\x34\x97\x86\x9e\xbf\x98\xe2\x33\x7d\x35\xf4\x75\xf3\x2c\x1f\x18\xb7\x8b\xac\x3b\x6f\xa7\xca\xb0\xc4\xb3\xa8\x39\x83\x12\x1e\x4e\x91\x32\x7f\x2c\xc2\x0b\x30\x57\x6f\x03\xb7\xde\x86\x72\x14\x70\x01\x5a\xa6\x1f\x1d\xd3\xcd\x45\x7f\x9b\x43\x48\x5e\xda\xa6\x28\xbb\x82\xb9\xae\xf9\x8f\xcc\x9d\x2c\x00\xb9\x9a\xcb\xff\x23\x96\x8b\x3c\x42\xb7\xc7\x40\x3f\xd8\x90\x33\xb9\xde\x39\xf4\xbc\x3c\x8c\x17\x63\x39\x02\x58\x02\x51\xc6\x87\x2a\xd8\xec\x02\xcf\x12\x74\x46\x77\xac\x9c\x94\x0d\xb1\x6d\x5c\xf2\x79\x92\x9b\x24\xca\x0a\xda\xbb\x55\xb8\x47\x72\x7f\x8e\xda\x50\xca\x82\x3a\x66\x3f\xbe\x05\x3b\x80\xdb\xa4\x64\xc5\xe0\x38\xe9\x9b\xf5\x88\xfc\xbd\xf5\xf9\x06\x61\x09\x98\x4e\xa1\x27\x7a\xed\x6a\x06\xbf\xdc\xa2\x2e\xd4\xa8\x7d\x89\xd4\x23\xac\xb9\x27\xd9\x5f\xda\x44\xde\x7f\xa8\x84\xc5\x7b\x5f\xd6\x86\x24\xa5\xd6\xc3\xb1\x56\xc0\xed\x22\xb9\x68\xae\x51\x9f\xb1\x8a\xd1\x54\xab\x5b\xd0\xc4\xb1\x40\xc8\xa5\x71\x14\x9e\xb9\x74\xed\xac\x34\x5f\x1c\x0f\xe4\x47\x03\x8a\x4d\xe0\xe7\x9b\x2d\x5c\x7f\x6c\x1e\xfc\xd1\x56\x7c\x6e\x24\x3a\xa4\x84\x40\x64\x5a\x48\x06\xdc\xfe\x02\x1b\x9c\x01\x43\x38\xb5\x30\xdb\x94\x9d\x5e\x76\xf6\xb7\x08\xd3\xd6\x4c\x67\x96\x2f\x82\xb3\xc9\xb5\xc0\xd0\xd8\x7d\x47\x90\x83\x3d\xb7\x49\x35\x55\x98\x73\xb1\x0b\x07\x51\xd1\xf7\x10\x02\xdc\xe4\xac\x85\x6b\xeb\x39\x9a\xb3\x67\xd4\x9e\x54\x6e\x6f\xc4\xa7\x69\x00\x41\x14\xab\xfb\xaf\x94\x17\x89\xdd\xd7\x47\x45\xe4\x26\xbd\x6f\x09\xe8\x5d\x03\xbc\xac\x2a\xab\xf8\xf3\xe6\x00\x17\x72\xc8\xb7\x99\x0b\x7a\x16\xf5\x81\x1d\x08\xdc\x40\x22\x74\xbe\x49\xac\x11\x34\x20\x55\x7b\xc1\xa1\x41\x29\xda\x45\xb7\xd3\x8b\x78\x85\x97\xde\x0b\xea\xb4\x9c\x36\x53\x5b\x91\x09\xed\x6b\x95\xbc\x25\xad\x2f\x43\xc3\x13\x69\xe6\x34\x92\xb0\x7d\x48\x4c\x82\x8d\xad\xb4\x9a\xe5\x20\xbf\x22\xa2\x00\xec\x60\x5f\xc3\xde\x03\xe2\x01\x32\x3a\x79\xfb\x96\xd2\xd7\xa5\x75\x74\x5f\xa3\x64\xa7\xd7\xe1\xfa\x77\xab\x2d\xef\x43\xa0\x37\xec\x09\x22\x04\xc7\xeb\x67\x7c\x72\xd2\x26\x54\x00\x5d\x52\x7d\x00\xfc\x17\xd6\x55\xae\x7f\x3b\x54\xdc\x2d\x9a\x36\x38\xf8\x75\x81\x56\x35\x94\xb3\xf9\xed\xcb\x15\x3a\xd4\xb4\x24\x96\x62\xb5\x5e\xc4\x9a\xb9\x0f\x69\x4a\xbf\x5d\xc1\x3a\x56\xd0\x20\x49\x2d\x04\xbf\x5d\xe0\xed\x8c\xc2\x49\x02\x56\x80\x00\x01\xd7\x26\xd1\x29\x58\x2f\xbc\xdc\x0d\xc7\xa9\x2a\x4c\xfc\x88\x2a\xdc\x91\xc6\x0d\xa5\x55\x9e\xd7\x28\xfa\xbb\x4d\xfb\xe9\x3b\xc0\x3f\x02\x2a\xb7\xa8\xd5\x71\xf6\x9a\x9e\x36\xd3\x5e\x14\x8d\x5e\x9f\x48\x36\x54\x0a\xb1\xf0\x55\x64\xb6\x5f\x19\x89\x3a\x25\xa7\x15\x7b\xd8\x9e\x73\x48\x50\x42\xb0\x1a\x88\xd4\x9a\x5d\xa7\xe6\x82\x4f\xad\x47\xee\x41\x8c\xa3\xfe\x46\x97\x14\xbe\x38\xe7\xb8\x4a\x19\xbc\xb4\x76\xcd\x0e\x70\xba\xc2\xa9\xf5\xb2\x5b\x6e\x1f\x2c\xef\xb6\xf8\x73\x72\xfd\xea\xb3\x8d\xf2\x4c\x07\x59\x9e\x03\x1f\x26\xf7\xb3\x2c\x40\xad\x7b\xe3\x93\xe0\x4c\x79\x59\x33\x01\x60\xb0\x8e\x3e\x3d\x73\x3f\xd0\x7f\x0a\xb8\x06\x03\xad\x6a\xad\xfe\xfb\x7c\xfd\x21\xb3\xd0\xc0\x1e\x8c\xa1\xcd\xee\xf2\xd5\x01\x43\x60\xe6\xf6\x51\x25\x0a\x5b\xbd\x94\x34\xb7\x70\xcc\x01\xe9\xf0\x07\x1d\x77\x3f\xb7\xff\xf6\x27\x91\x3f\x00\x71\x7b\x5f\xa6\xf5\x38\x7c\x1b\x81\x36\x70\x9e\xba\xa5\xb7\xce\x65\xc7\x72\x9b\xff\x1e\xef\x32\xbd\xf6\x4f\xea\xfd\xaf\x7d\x8f\x7f\x0b\xf5\x43\xde\x23\x34\x56\x76\x46\x63\xa0\xf2\xdc\x7d\x54\x13\x59\xa2\x0f\xe0\x4f\xce\xe4\x13\x56\x74\x2a\xeb\xbd\x69\x2a\xa2\x08\x6c\x4b\xc6\xc4\xe4\xbd\xf3\x30\xfa\x5a\x25\xe2\x74\x0d\xa7\xf0\x0b\x17\x37\x1c\x18\xde\xf1\x2d\xc9\x2e\x7a\x61\xd4\x8d\x4c\xea\xcf\xd3\x97\x47\x4f\x18\x5d\xf6\xc4\x32\x08\x6c\x72\x42\xbf\x92\x43\xa9\xa5\xd8\x81\x36\x40\x65\x30\x60\x05\xa3\x63\x29\x26\x21\x17\xc6\x50\xa1\xa9\x7b\x64\x5d\xce\x37\x52\x17\xa8\x36\xdc\xcc\xf4\x94\x48\x37\x99\xf2\x4b\xc4\xad\x9e\x8c\x73\x69\xc3\x2b\xc0\x19\xf2\x9b\xe8\xf2\x96\x2f\xee\x0f\x42\x16\x1c\x14\x70\xee\xac\xae\x40\xd9\x5a\x65\x8c\x03\x00\x7c\xe1\x11\x2e\xae\xc9\x1d\xee\xd9\xc6\xd5\x78\x87\x25\xf0\x55\x16\xf7\x6d\xeb\x43\x9b\xf6\xb5\x5a\x11\xc5\x02\xb6\x3e\x25\x2b\x6f\x26\x68\x41\xb9\xb9\xf5\x62\x76\x87\xc8\x75\xd5\x0d\x55\x29\x28\x48\x0c\x83\xb4\xf9\xbd\x81\x62\x50\xc5\x34\x70\xfa\x72\x58\xa7\x26\xbf\x61\x54\x57\x77\xf8\xff\x3f\x82\x8a\xcf\x1f\xff\xc0\x53\xe4\xa0\x08\xa4\xc6\xab\x86\xfc\xc3\x26\x5c\xdc\x42\xbb\x46\xaa\x01\x70\x0c\xf5\x7e\x0e\xd6\xf8\x1a\xf7\x8e\x71\xb5\xfd\xfa\x9b\x85\x7c\x70\x05\xee\x86\xd3\x95\x83\x86\xdb\x07\xcc\xa8\xfc\x34\x98\x11\x57\x07\xd8\xb1\xbb\xe2\xcd\xc4\x74\x1e\xc3\x39\x0b\x0e\x7f\x0c\xdb\x19\xf0\x3f\x8b\xab\x55\xe3\x81\x89\x5a\x64\x76\xe0\x00\x49\xdc\x94\xa2\xdc\xba\x55\x49\x09\x89\xe9\x0e\x50\x9b\xd6\x9b\xf8\xef\x60\x37\xbe\x74\xba\x97\x14\x17\xa7\x26\x79\xc0\x65\x00\x01\xc1\xbd\xc2\x6d\x84\xe5\xeb\xb6\x09\x53\x07\x15\x1d\x3a\xe1\xee\x2e\xa5\xd0\x88\x4c\xe5\x72\x3e\x5c\xe8\x46\xde\xb8\x3f\x2a\x54\x62\xe4\xaf\xb6\x7b\x5f\x90\xef\x90\x41\x38\x82\x9e\x7f\x90\x86\x10\xcb\x7f\x0b\xca\xf2\xb9\x62\x1d\x94\x50\x01\xf4\xad\x84\x46\xcc\xeb\x0f\x83\x9e\xca\x01\x2e\x05\xf0\xa8\xa0\x09\x82\x3b\xce\x46\x29\x81\xb7\x28\xf3\xb0\x33\xa4\x5b\xa2\x5b\x4f\xf7\x2a\x89\xec\x94\x5a\xf7\x48\x42\x9c\x1e\xe7\x8f\x54\xd4\x80\x95\x0d\x03\x45\x36\xd3\x8c\x64\xdd\x63\x22\x40\x8e\x10\x24\x75\xf8\x9c\x76\xc9\x60\x6d\x77\x17\xcb\x10\x94\x06\x7e\x5a\x9c\x7d\x94\x31\x85\xed\xb0\xf1\xb5\x4a\x7c\x83\x22\x7f\xd5\x48\x57\x03\xe0\x09\x99\xf0\x52\xed\x8c\xc4\xfc\x6d\x0b\x68\xc4\x06\x3a\x12\x57\xf9\x89\x94\x47\x99\xe8\x13\x2a\x10\x7b\xe0\x94\xb0\x92\x2d\x6d\x05\x00\xa2\x42\x67\x9a\xd5\xb3\x7d\x71\x64\x04\x61\x15\xe5\x43\x71\x1c\x35\x50\xe9\xe1\xb1\x80\x57\xe8\x98\x24\xd0\xa8\x45\xfe\x84\x07\xb4\x42\xb1\xf0\xfc\xfb\x3c\x06\x71\x60\x9f\x73\xf5\xbe\x8d\x1a\xd1\x3e\x65\x62\x3e\x6c\xbb\x16\x19\xca\xa3\xe1\xf0\x82\x29\x05\x72\xda\x86\x0e\xbb\xb9\xa9\x18\x30\x86\x1a\x38\xd6\x46\xf4\x79\xa3\x2a\x6a\xa2\x66\x09\x61\xe1\x86\xb6\x71\x44\x57\xa5\xe3\xdd\xb8\x56\xf0\x08\xa7\xbb\x33\x74\x55\x00\xc5\x70\x08\x4b\x5a\xe0\xb7\xdf\xe1\x60\x37\x65\x11\x4f\x21\x90\x19\xf1\xba\x34\x06\x30\xd5\xf1\x53\xb3\xe4\x08\x93\x3c\x22\x37\xd2\x07\x90\x0c\xc5\xf3\xc9\xed\x0f\x35\xba\xb1\xec\x28\xb8\x17\x44\xc4\xf4\x41\x19\x65\x75\x55\x66\xf7\x2c\xde\x2e\xf4\xc6\x5b\x16\x5c\x76\x32\x7b\x76\x7b\xf2\x57\x76\x87\xd4\x18\xe7\xc2\xec\xde\xd2\x6b\xd5\xdf\xd4\x06\x7a\xdd\xa2\x2d\x57\xa4\x92\x35\x2a\xda\xa5\xf5\x7a\xbd\x1f\x1d\x5e\xcf\xbb\x93\x8d\xe4\x91\xec\x5a\x02\x02\x74\x4c\x55\x61\xc3\x42\xed\x4a\x73\xb0\x3d\xb6\xb3\x17\x70\x9a\x32\x02\x77\xe4\x90\x80\xb3\x2b\xd5\xfa\x15\xac\xfd\xed\x21\x55\x81\x4a\xa7\x47\x43\xbb\xc1\x74\x11\xd8\x63\x17\x2e\xc4\xce\x5a\x6f\xa6\x58\x1a\xb2\x21\xa2\x44\x22\x8b\x05\x89\x3d\x8e\x69\xb8\xb1\x41\x99\xb0\x10\x69\xec\x6c\x55\x35\x12\x33\xca\x25\x09\x14\x11\x2e\x66\x81\xd6\x20\x52\x8d\xaf\x79\x02\x2f\x14\x84\xd0\x82\x08\x82\xb0\xb1\xe5\xea\x2e\xa1\x96\xcd\xfc\x53\x05\x79\xec\x1a\xbe\xa0\x8e\x1e\x46\xbb\x2e\xa5\x7d\xe3\x47\xa6\x00\x7c\xf8\x8a\x0b\x3f\x7f\x8e\x35\xac\xcd\xe6\x4f\x21\x61\xbe\x41\x75\xab\xda\xf5\x82\xf0\xc4\x23\x74\xdf\x5a\xf0\xd4\x8e\x00\x7b\x74\x00\xd0\x84\xcd\xd8\xe6\xaa\x87\xbd\x34\x16\xda\xf0\xf6\x05\x30\x5d\xc4\x22\x6b\xe4\x6a\x28\x0c\xb3\x9e\x7e\x99\x03\x76\x92\xaa\xae\x7a\x5a\x03\x56\x92\x26\x9d\x01\xc0\x89\x7e\x58\xc5\x88\xd4\xc3\x2d\xb1\x8a\xc7\x1d\x55\x77\xb8\xcf\x51\xda\xc0\x26\xce\xbc\xc4\xff\x3b\x9d\x30\x07\x52\xe7\xe4\x5b\x5f\x09\x50\xd1\xcd\x5a\x1c\x60\xd6\x73\xdb\x4f\x51\xef\xcf\x4d\x7b\xfa\x8a\x0d\x09\xb0\x86\x3d\x13\xa4\xef\x9f\x90\x3b\x0b\x48\x05\x1a\xf7\xf2\x13\xc1\x23\x5c\x96\xa8\xed\x5a\xc1\x42\x69\x70\xd4\x23\x01\x99\xf5\x2a\xb2\x5e\x5a\xa2\xe7\x56\x01\xb6\x57\xc7\x65\x87\xd4\x3a\x16\xe9\xc9\xb0\xc7\x14\xf1\x10\xe4\xcb\x46\xb2\x77\x92\x2e\x2a\x46\x35\x2f\x54\xd0\x61\x18\x8e\x96\xf1\xd3\xb8\x79\xf0\xbe\x96\x30\x1c\xce\xff\x29\x86\xac\x31\x4a\x01\x2e\x72\x86\x5b\xf0\x44\x81\x75\xfb\x89\x5d\x55\x40\x92\xb9\xd0\x31\x38\x42\x7c\x00\x03\x5a\x42\x97\xb3\x8e\xff\xc6\xe0\x6a\xaf\xe3\x9b\x6a\xe5\x63\xcc\xdd\x50\x12\x5b\x88\xd9\x5c\xc7\xdc\xea\xa8\x4e\x04\x7b\x4c\x91\xf4\x07\xc4\x60\x4f\x95\x83\x2c\x13\x61\x2c\x83\x0d\x21\x54\xb6\x0e\x52\x9f\x5d\x9f\xcf\x27\x75\xd9\x8f\x1c\x62\x06\xba\xdc\xd9\x9d\x33\x43\xeb\x40\x58\x13\xc6\x85\x07\x6c\xe7\x9b\x09\x1f\x6e\x35\xe7\xfb\x54\x6b\x62\x99\x08\xdb\x0d\xd2\x12\xd0\x66\x53\x09\x79\x15\x63\xa5\xcb\xcb\x8c\x2b\xa9\xdf\x55\x08\x01\xde\x95\x8c\xec\xc7\x79\xd1\x45\xd8\x45\x8c\x09\x0e\x59\x38\x71\x85\x21\x5f\x72\x4f\xf9\x35\xcd\x12\x4b\x98\x32\x2c\xfb\xbf\x54\x14\x46\x97\x5d\xd4\xab\x10\xd7\xf1\xfd\xe5\xef\x8f\xf2\xeb\x81\x2a\xd9\x1f\xa1\xfc\x1e\xd5\x49\x6f\xc5\xf2\x96\x2b\xc1\x73\xfe\x8f\x70\x4a\x21\x0f\xff\x64\x91\x06\x61\xc7\x97\xcf\xc3\x09\xfa\xc2\xa1\x4c\x5c\x90\xa5\x50\xbc\x7f\x09\x12\xdb\x0e\x24\x36\x9e\x08\x6b\x77\x65\x93\x6d\x0f\xfc\xda\xb8\xed\x64\xf5\x1a\xf3\x23\xdf\xeb\xff\x06\x45\x44\x75\x5a\x1f\xea\x9e\xcb\xfe\x3a\xcc\x69\xc6\xd0\x4e\x38\x84\x75\x91\xbd\x40\x49\xaf\x0f\x6f\xf2\x45\x52\xe3\x55\x3a\xc1\xef\xf0\xc5\x86\x9e\x60\x07\x2c\x05\xc6\xec\x1e\xbc\x0b\x4a\x66\x8c\x8f\x6a\x9a\x5c\xca\x7f\xe5\x13\x1e\x04\x91\xf0\x6a\x2d\x82\x8b\x2d\x70\x0c\xf6\xad\x25\xf2\x5e\xad\xf3\x46\x0b\x61\x7e\x77\xd6\x72\xbc\x89\x66\xc0\x8b\x25\xa5\x9a\x32\x2f\x2e\x7a\xfa\xa0\x5e\x7d\xe8\x39\xa4\x2a\x8a\xef\xbc\x0c\x7e\x01\x78\xac\x61\x95\x2c\xe7\x64\x97\x6c\x00\xf9\x3a\xc7\xa7\x25\x0d\x1b\x8b\x0d\xe7\x84\xaf\xbc\x92\xe5\x0f\x8e\x9f\xb0\x74\xc9\x71\x1a\x96\xbe\x26\x3a\x41\xb8\x50\x9b\x2c\xdd\xe6\x72\xfc\x25\x05\xd6\x35\x3d\x6f\xb7\x20\x78\x28\x50\x9a\x1e\x9a\xd8\x74\x5d\xfe\x52\x6f\xb6\x06\xed\x95\xcb\x16\x0a\x6a\x20\x69\xea\x27\x75\xf0\xea\x83\xd8\x15\xad\x59\xcc\x76\x19\xb4\x4f\xb4\xcb\xb9\xa2\xe0\xe7\x32\x38\xe7\x65\x2e\x9d\x50\x2e\x9d\x65\x11\x0e\x0a\x81\xd4\xba\x66\xc1\x3e\x05\x64\xb6\x20\x51\xb3\xc8\x7d\xad\x09\xb7\xc8\xa4\xb4\xe2\x4b\x0b\xa2\xea\xec\x97\xaa\x7e\x0e\xd1\x07\x45\x59\x44\xd1\x39\x7b\x61\x8e\xfb\x30\x4c\x9c\x84\xb8\xd8\x05\xaf\x23\xd1\x4c\x39\x94\x2e\xfc\x5e\x35\x0c\x49\x07\x22\xf6\xfd\x50\xf0\xe1\x82\x7b\x31\xc1\x66\x92\x82\xa8\x5a\x10\xa8\x12\xa9\x52\xee\xba\xfb\x0a\xfc\x78\x01\x5e\xa0\xe8\x12\xf0\x98\x90\xdb\x03\x87\x2d\xcc\xb0\x51\x37\x2f\x4d\x52\x98\xda\x38\x20\x9f\xef\x1c\xda\xfe\x04\xe1\x24\x57\xa7\x6a\xd5\xb3\xcd\xa9\xab\x35\x95\xe9\x0a\x88\xb9\xf5\xdf\x3e\xc7\x70\x59\x7e\x87\x9c\x08\x1a\xe3\xa1\x80\x33\x85\x1c\x2e\x08\x44\xd4\x4f\x28\xd6\x09\x10\xe2\xf2\x0e\x9d\xfe\xd1\x0b\x45\x94\x80\x10\x38\x66\x72\x57\x0e\x79\x52\x6b\x1f\x62\x46\x2d\x6a\x7c\xfc\xb8\x0c\x89\x37\x56\x33\xfd\x71\x0f\x0d\x09\x8a\x44\x08\x28\x13\xc0\x41\xcb\x30\xdf\x89\x48\x19\x51\x47\xb1\x6e\xa8\x51\xdd\x3d\xf8\x26\x81\x4e\x26\x8d\xd6\x96\x1f\x5e\x55\x52\x29\xc0\x77\xaf\x73\xfb\xf3\x6f\xb4\xe0\xf8\xfb\x50\xb6\xf0\x45\xdb\x99\x97\x25\x1a\x6e\x15\xa0\x2e\xc1\xb2\x06\x21\x83\x60\xfc\xf2\xf3\xe6\xbe\x99\x38\x34\xeb\x0e\x7f\x5d\x8c\xc2\x3a\x18\x01\x6d\x16\xdf\xa6\xbf\x93\x6a\xff\x57\x58\x83\xff\xc2\x9f\xc6\xef\xd3\x5f\x20\xac\xb4\x93\xc3\xc4\xef\x28\x45\xd3\xdf\xb1\x42\x17\x7e\xb3\x25\xb2\x9c\x35\x58\x88\x2c\xc8\x81\x36\xf9\xf9\xdc\x34\x8c\xfd\xa6\xb9\x46\xed\xff\x96\xe2\x13\x61\xac\x45\xec\xbc\x61\x7e\x93\xcf\x3d\xa1\x67\x2d\x03\x80\x9d\x5a\x0c\xdb\x76\x63\x68\x6d\x48\xfb\x9f\xd4\x1c\x3c\x17\xf7\xaa\x23\xdb\x96\x08\xcf\x2c\x29\x0a\x1c\x73\x4b\x5e\xcb\x15\x20\xc8\x1a\x6e\xb9\x2d\x51\x50\x8b\x2b\x58\xc2\x62\x2a\x52\x3c\x27\xf7\x42\x16\xce\x07\xfa\x12\x59\xd8\x99\xee\x9c\x7a\xa1\x6d\xba\x8c\xf4\xa1\xa9\x5f\x27\xc6\xae\x60\x3b\x6d\x19\x42\xe9\x75\x5c\xbe\xf4\x31\x50\x04\x0d\x8c\x8e\x0b\x47\x48\x44\xd8\xa1\x36\x6f\xd5\xb7\xbd\x81\x99\x1c\xdf\x3f\xdf\x9e\x2d\x7c\xd5\xa6\x11\xbe\x8c\x04\x29\x7f\x75\xdb\x8e\xf6\x09\x8d\xb7\x91\x26\x46\xc3\x35\x13\x90\x22\x93\xeb\x73\xd3\xd4\x64\x38\x41\x39\x71\x30\xcb\x09\x37\x60\x0f\xe8\xd2\x30\x58\xe6\x43\x6f\x00\x40\x73\x78\x34\xba\xd6\x2d\x75\xcc\xe2\x06\x0e\x36\xe0\x87\xd3\xf5\x7c\xc0\x92\x1e\x05\x4a\xc0\xbe\x12\xff\x71\x28\xbd\x3a\xef\xa1\x04\x85\x73\xa8\xae\xbe\x00\x0d\xcd\x36\x1c\x9e\x1e\xdb\x87\x6f\x94\x99\x1c\xc6\x4e\x2a\x11\xb7\xc7\x9a\x4d\x0b\x56\x88\xce\x20\x74\xed\x06\x3f\xd0\xc9\x7e\x7a\x92\x86\x58\x3d\x09\x7b\x6f\xfe\x01\x01\xbc\xe1\x21\x2f\x96\x7b\x86\x44\x8c\x31\xb0\x3a\x3e\x1c\x32\x96\x97\x36\x13\xa8\x88\xfc\x0f\xe9\x37\x5a\x5f\xf4\x30\xfa\x11\x60\x86\xef\xda\xea\x40\xeb\x16\x05\x0e\xca\x7d\x54\x95\x89\x00\xdd\x24\x9a\x26\xf7\x50\x4a\xb6\x4e\xce\x7f\xdf\x7e\xfc\xfb\x63\x4a\xd9\x43\xad\xcf\x75\x75\xfa\xb1\x1a\x75\xf6\x10\x47\x93\x2e\xc4\x5e\x3d\x09\xc4\x03\x73\x89\x88\xea\x58\x30\x25\xc9\xcc\xf7\x69\xdc\x3e\x17\xdf\x23\x8c\xe1\xd3\xd7\xa2\x85\x11\x21\x59\xcc\xb1\x2f\xe7\x0c\xbd\x17\x42\x68\x60\x07\xae\x0a\x9d\xb8\x5f\xd1\xc8\x45\x30\x1a\x77\x66\x0b\xad\x05\x00\x31\xb8\xad\xb7\xe3\x53\xfe\x2a\xc0\xd4\xa8\x72\xca\xd0\x03\x1b\x51\x7a\x02\x66\xce\x7f\xbe\x29\x42\x26\x3e\xbd\x83\xa5\xa4\x44\x66\xf9\xe6\x69\xf3\xb9\x5f\x2d\x0a\x3d\xe1\x68\xc6\x03\x39\xdf\xe6\x4e\x64\x26\x15\xb8\xe3\x7a\x57\x02\xd9\xb4\x82\xbf\xdc\x12\xbd\x4f\xa8\x35\x00\x92\xca\x83\x73\x77\x83\xd7\x9f\xe9\xb8\x25\x7d\x9e\x69\x6b\x74\x91\x68\x17\x2e\xe7\x70\x7e\x39\xd7\x35\x1e\x5f\x32\x13\x16\xe7\xab\x1f\xaa\x49\x78\xdd\xf9\x8f\xac\xb7\xdd\xe3\xa4\x2e\x12\x29\xb2\x88\x10\x90\xe7\x13\x3f\xc2\x26\xec\x36\xe1\x27\xf7\x23\x3b\xe9\x9f\x1f\xb7\x30\x81\x7e\x10\xf4\x42\x3c\x8c\xa3\x63\x63\x3c\x07\xa4\xcf\x9f\x6d\x88\xa5\x6f\xb1\x0f\xa5\xb5\x88\x29\x3c\x9a\x6d\x66\x99\x6e\x74\x01\x6e\xa8\xc0\xbc\x34\x2e\x27\xb4\xdf\x5e\x06\x90\x23\x64\xd5\x25\xd0\x2f\xf7\xfb\xb8\x43\xbe\xe4\x4f\x21\x29\xf8\x92\x3d\xa9\x90\xea\x76\x24\x4f\x6b\xfd\xab\x2f\xf6\x0a\xb6\xc6\x31\xdb\x57\x38\x1e\xc0\xc6\xd8\x38\x48\x98\x48\xe8\x24\x76\x9b\xa5\x5d\xb1\x6e\xdc\x6d\x51\x15\x73\xe2\x9c\xfb\x04\xaa\x21\x7c\xcb\x34\x3d\x93\x6c\x08\xde\xf2\x15\x70\x44\x4b\x48\x4a\x40\x08\xeb\x88\xa8\xfd\xde\x7d\xbb\x1c\xf8\x65\x0e\x9f\x83\xb5\xdc\xfe\xe2\x6e\x50\x55\x5b\x18\x7d\x96\x2f\xb5\x8a\x3d\x34\x8d\xe2\x73\x7c\xdd\x4a\xe7\x50\x75\xab\xa9\x70\x21\x68\xc9\xbb\xdc\x66\x05\xe3\xed\x26\x7e\x10\x8e\xce\x3f\x14\xcb\x7d\x22\x32\xf9\xea\x5f\x7b\x1b\x06\xb8\xa1\x7c\x40\x53\x26\x99\x0a\xf0\xd9\xed\xc2\x9c\x2d\xbc\x06\xf8\x8b\x84\x1f\x3a\x8c\xd9\x02\xe7\x32\x47\x56\x0c\xc1\x40\x00\x7e\xf4\xbd\x4d\x33\xc6\x29\xa4\x63\x90\xc2\x46\x22\x40\xa5\x73\x86\xb6\x60\x2e\xcb\x8b\x0b\x6a\xed\x5f\xb6\x19\xf9\x6e\xf3\x2d\x9b\x1b\xf8\x8e\x0b\x0b\x51\xf4\x4b\x68\x2f\x10\x2d\x56\xfe\x38\xed\x79\x34\x7a\x7c\xed\x71\x74\x9c\xc3\x39\xad\xa1\xbd\xef\x68\x72\xc1\x5f\xd6\x70\x30\x07\x3d\x6f\x67\x28\xb2\x03\x23\x79\x95\x9f\x39\xd0\x31\x62\x54\x5a\x70\x46\x09\xae\x75\x8b\x68\x06\x94\xe7\x18\xbf\x2a\xf9\x2e\xd2\x41\xab\x01\x48\xb9\x05\xce\xe4\x13\xdd\x03\x4a\x7c\x92\xa2\xa8\xb4\xf4\x56\x00\x8f\xb2\xbd\x42\x5a\x03\xe6\x3a\x2e\x16\xe2\xd8\x98\xfd\x46\xc7\x3b\xce\xe5\x16\xc5\xb3\x26\x84\x40\xf4\x2e\x80\x5c\x42\xba\x63\x71\xf3\x43\x09\x1a\x84\x76\xc6\x97\xb9\x39\xe0\xbc\xd1\x37\xb7\x45\x32\x1c\x13\x3d\x60\x5b\xa8\x9f\x09\xa6\x52\x97\x8c\xdc\x64\x40\xe2\x19\xee\x49\xee\x03\x37\xe0\x2b\x0d\xcb\x6c\x50\xb5\x08\xa8\xa0\xbf\x57\x60\xae\x76\x54\x3d\x1e\x40\xe1\x60\x72\xb6\x03\x46\x26\x19\x99\xd7\x11\x0d\xd7\x58\x62\x29\x80\xb8\xa4\xe5\x2f\xf3\x08\xd5\x22\x1c\xb5\xe2\xd6\x66\x6a\x25\x2a\xf5\x43\x0a\x7c\xd9\x99\x62\xb7\xde\x47\x65\x45\xd5\xcd\x03\x86\x86\x47\x38\x86\xd8\x0c\x18\x6c\x68\xe9\xa6\xe4\x0c\xf8\x6b\x9b\xde\x15\xfa\x63\x1d\xf5\x7a\x4e\xc4\x89\xec\x7b\xe4\xd7\x10\xc1\xa8\x16\x0d\x09\x9e\xca\x7d\x4f\x63\xf4\xa4\x4a\x2a\xf0\x2a\x5f\x96\xf9\x29\x94\x7d\xa1\x75\x21\x8a\x3e\xc2\x2a\xc2\x6f\x1d\x16\x12\x9a\x50\xdb\x98\xc6\x86\x27\x8e\x04\xed\x08\xf0\x8a\x0d\x0f\xfe\x2b\xc1\xb3\x40\x30\x95\x63\x0a\x59\x8c\xfd\x6a\x0a\xa1\x1b\x67\xcc\x72\xa8\x8a\xa1\x23\x65\xa6\x66\x41\x27\x21\xff\x73\x12\xa7\xc1\xa2\x3e\x51\x40\x1f\xf8\x15\xbd\x79\x3b\xb5\x2d\x1f\x48\x72\x33\xb4\x2c\x41\xf2\x15\x88\x17\x29\xb5\x7b\x3b\x4b\x0a\x17\xe8\x95\x57\x30\x90\xed\xda\x9e\x42\x5c\xa0\x8a\xd8\xc4\x55\x6b\xca\xa5\x4a\x5b\x53\x8e\xb4\xa8\xc3\x6e\xca\xa2\x8b\xd3\xc4\x1a\x01\x2c\x11\xc4\x91\x03\x03\xd7\x37\x63\xd5\xda\x70\xe5\x8c\x12\x2f\xa3\x41\xa1\x6d\xd7\xce\xd8\x19\x28\x8d\x75\x93\x04\x49\x6c\x50\xe7\xac\x19\xed\xa3\x6e\x57\xfc\x06\xc2\x40\xd8\x0e\x69\xf6\x3c\xbb\xc9\xd6\x3f\xe5\x21\x53\x39\x43\x57\xbc\x8a\x76\xe4\x29\x48\x88\x0d\xca\x14\x0f\x2a\x65\x84\x4b\xfa\x87\xe0\x94\x2f\x9f\x09\x79\xe1\x37\x60\x57\x8e\x3a\xde\xd2\x45\xd9\x7e\x3a\x00\xc6\x13\xbb\x1b\x0f\xd3\x0a\x41\x08\x3d\x8d\x80\x2a\xc2\x09\xbf\xba\xb2\x8b\x83\xe6\x22\x19\xb4\x7d\x48\xe1\xf9\x60\x6f\x5d\x90\xa8\xe9\x4d\xed\x6b\x20\x60\x34\xfd\x1d\x6e\xfa\x91\xfe\x51\x13\xe2\xdc\xdb\xe1\x33\x1e\x00\x18\x27\x0a\x56\x5c\xbb\x80\x13\x58\xa7\xdd\x5b\x41\x39\xb6\x9e\x64\x9b\x10\x70\xb0\xb6\x56\xa0\x6d\xf6\xc2\xfb\x09\x12\x62\x5b\x3e\x28\xa6\x61\x5d\x5e\x22\xe8\xc2\x45\x31\xb0\xb8\xeb\x69\x93\xfb\xa6\x07\x6b\xcf\x2e\xbc\x8d\xed\xa3\xec\x15\xfe\x55\x44\x19\xb4\x31\xfa\x52\x39\x3a\x69\x29\x50\x85\xa0\xb0\x44\x2c\x3b\xda\x4c\xa7\x50\x01\x64\xc9\x6d\x27\xe1\xa3\xb4\xe8\xaf\xb4\x34\xa7\xb8\x4d\x0a\x60\x93\x25\x4c\x19\x72\x9d\x47\x02\x35\x94\xc3\x8a\xa1\x30\xed\x02\x06\xd4\xad\xdd\xa7\x6a\xa4\x4a\xf5\x74\x7f\x73\x48\x8f\xd8\xdd\xaf\x29\x6a\x7a\x3a\x44\x2c\xcc\xd3\xa5\x7b\x21\xbf\x74\x49\x5f\x14\x17\x97\x49\x1d\x88\x23\x21\xc3\x61\x43\x48\xe3\xbf\xbf\x7b\xa6\xcf\xa5\xab\x78\x99\x16\xbd\x51\x95\x39\x74\x2b\x87\x26\x62\x61\xbe\x2c\xd8\x2a\x22\xa9\xea\x65\xe8\x8f\x4a\x1f\xfb\xf7\xa0\x74\x86\xdd\x40\xf8\xd7\xf7\xbd\x34\x34\xce\x17\x27\xa2\x7f\x45\xb4\x82\x3f\xfc\x2e\xd8\xc2\xd4\xcf\x57\xfe\xaf\x33\x64\x7b\x2f\x98\x34\x62\xfb\x33\xd0\x58\xed\x73\xf9\xb5\xf9\x6c\xb1\x10\xf1\x01\xc8\x49\x68\x13\x76\xad\xb7\x35\x44\x14\xc7\x2c\x7c\xfa\xc6\xbe\xc0\xd9\x58\x1f\x17\xc0\x64\x30\xb8\x37\x8b\x3e\x61\x74\xc8\x66\x2b\x91\x0d\x94\x81\xe6\x1d\x93\x3b\x36\x03\x25\xf6\x41\xba\x7f\x45\x10\x6f\xcd\x14\xce\x18\x28\xae\xc9\x4c\xef\xc3\xf3\x79\xd0\x12\x82\x32\x96\x88\x76\xbb\x2d\xb5\x6a\x8b\xa6\x8d\x16\x33\x0a\x43\x93\x2f\x3d\x7c\x20\x4a\xe0\x7c\x01\x8b\xba\xf0\x91\xa8\x65\x18\x78\x88\xc7\x97\xa6\x7f\xc4\xcb\x84\x05\x8f\xa5\x9a\xf4\xc0\x48\xdb\x50\x08\x9b\xd9\x9e\x69\x93\x66\xc7\x8a\x7b\xd9\x23\xeb\xfc\xc3\x4c\x42\x1a\x1f\x1d\x51\x88\x1f\xbb\x61\x1f\x40\xcd\x6c\x4c\x5a\xdf\xa5\x0f\xb3\xc9\xb7\x65\x22\x44\x66\xd8\xe4\x9c\x88\x17\xeb\xdd\xce\x56\x6e\xf0\xdb\xe8\x2a\x93\x88\x33\x9d\xe3\xf3\x41\x3d\x14\xbf\x15\xdb\xea\x24\xb1\x05\x88\x40\xfa\x1e\x01\x95\x09\x21\x47\x7f\x8b\x9d\x73\xcb\x55\x92\x77\x68\x03\xbe\x41\x87\x9b\xa4\x25\x45\xc3\x89\x1c\x18\x9a\x12\xdb\x78\xcf\xa4\x57\x5a\xf2\x4f\xf8\x16\xae\xe0\x08\xbd\x22\x59\x22\xf7\xa5\x77\x40\x4d\xdc\x38\xe7\xfa\x22\x38\x95\xe2\x73\x01\x40\xf3\x3c\x39\x3c\x25\xf6\x9c\xc2\xae\xc2\x29\xb5\x8a\x87\xb1\xaa\x7d\xa8\x9f\x3b\x17\x58\xdd\x59\xbf\x11\x92\x21\x58\xa6\x7d\x57\x37\xcc\x13\xc6\x97\xc7\xa0\xf7\xf8\x88\x75\xbb\xca\x2f\xe3\x1c\x3d\x91\xb5\x3a\x98\x7c\x49\x92\x44\x58\xaa\xe3\x42\xff\xb2\xe1\x5c\x0f\xbb\x75\x89\xcc\x38\x99\x85\x1e\x27\xfc\x91\x3c\xc0\x93\xec\x01\xd7\x5b\x8e\x33\xe0\x22\x7b\xa2\x03\xfc\x76\x2a\xc7\x97\x79\x45\xb5\xcb\x73\x43\x0c\x17\xad\x80\x7b\x85\x50\x37\x40\xab\x10\x34\x33\x06\x58\x04\x72\xe8\x21\x1f\xf2\x62\x09\xc2\x11\x36\x7b\xfe\xc7\xa4\x91\xe0\x9b\x3a\x67\xf4\xe6\xb3\x0a\xb4\x61\x4d\x4f\xd4\x6e\x07\xd5\xd8\x90\x2f\xdb\xe2\x70\x4a\x3a\xa8\x80\x74\xb8\x30\x1a\x0f\x1c\x8f\x50\x37\xa1\x8f\xcb\x11\xdc\xf1\x63\xa4\x15\xac\x6b\x3a\x13\xf1\x7d\x7c\xd5\x33\xe5\x84\x51\x91\x31\x1b\x0d\x63\xdd\x12\xa3\xe5\x05\x1a\xc6\xfd\x87\x87\xe6\x10\x1e\x43\xb9\x3d\xc1\x50\x38\x30\x34\x85\x0e\x8e\x87\x3d\xa1\x1d\x51\x9a\x87\x25\xbb\x7e\x68\x5e\x54\x53\x03\xf8\x4a\x2a\x25\x4b\xf8\x52\x00\x2f\x73\x0c\xf2\xc6\x9f\x32\x68\xe5\xd2\xb4\x73\x3f\x8d\xd1\xdd\xb8\x1e\xc4\xd2\xac\x45\xc7\xd1\x1f\x9f\x61\xeb\x3d\xc3\x81\x0c\x85\x7f\x4f\x52\x5f\x76\xb8\x56\xa9\x50\x46\x36\xf0\xbd\xa4\x7b\xe2\x4c\x5a\xdb\x8e\xa5\x0d\x25\x94\x0f\x5d\xa4\x31\xe1\x71\x20\x9d\xbb\x53\x71\xcf\xa4\x9f\x04\x13\x3e\xee\xa1\xdb\x7f\x58\xb0\xdf\x5a\x28\xbe\x7e\xff\x09\x2f\x04\xeb\x0a\x7d\x93\x02\x31\xf1\x49\x2a\x26\xc1\x96\xe3\x96\x8b\xb9\x4d\x3a\xf4\xda\x6d\x69\xbc\x9f\x21\x7e\x61\x41\xda\x02\x91\x33\xbb\x14\x99\x87\xd3\x21\x4b\x8e\xe9\x49\xdd\x08\x4a\x7a\xed\x67\xe3\xf2\xff\x6f\x41\x78\xce\x8d\xd0\x28\xb7\xf5\x48\x4b\xf5\xe5\xbf\xb6\x02\xf9\x4e\xc6\x15\x43\x02\x8f\x7e\x05\x45\x10\xa4\x63\xe3\x80\xe9\x29\xb8\xb4\x4c\xa8\x95\x42\x68\xc8\x51\x6c\xd2\x2f\x80\x8b\x3b\x73\x74\xe1\xf6\xe8\x65\x97\xe8\xa4\x6a\x83\x71\x9a\x04\x15\x82\xdb\x0f\x5f\xb7\x07\x2d\x7c\xe7\x0f\x2f\x29\xd3\xa8\x43\x01\xef\x04\x44\x8d\xb4\x4b\x56\x57\x8a\x12\x1c\x08\xc8\x00\x2c\x34\x30\x9d\xf0\x55\x3e\xff\x24\x40\x7c\x0f\xca\x69\xb8\x70\x8a\x1e\x2d\x37\xf3\xa8\x3a\x19\x6e\xe4\x1f\x78\x1b\x28\xc3\x6e\xa3\x97\x9d\xf7\x12\x36\x11\x65\xbb\x57\x61\x30\x03\xb0\xe9\x89\x9f\x43\x01\xcc\xa0\xfe\x26\xc5\x39\x93\x1e\x3d\xe9\x7d\x61\x5b\xdd\x85\x34\x02\x89\x8f\xc3\x97\x4b\x46\xc5\xc1\x42\xda\xbf\xa4\xaa\xa9\x67\xf1\x76\xef\xe6\x4a\x98\x05\x6d\x45\x00\x5d\xf6\xe0\xf1\x9e\x02\x18\xc8\x83\x29\x6c\x62\x9d\xda\xb8\x4b\x57\xe5\xd6\x33\x77\x68\x50\x05\x06\xa5\xbf\x2c\x19\x91\x49\x52\x0a\x16\x50\x07\x57\x87\xbf\x2e\x4e\x9d\xf7\xd7\xd8\x09\xc0\xf3\xaa\x9e\x22\x6f\x97\x4d\x73\x8c\x75\xa2\xf3\xd6\x3e\x56\x9e\x8b\x85\x2d\xf1\xf5\x3b\x32\x28\x5e\x37\xe8\xaf\xfa\x76\xaa\x6e\x78\x3b\xd7\xae\x19\x76\x59\x5a\x3c\x63\xdb\xea\x4b\xf8\xb9\xc3\x15\x3a\x3f\x83\x16\x2a\xf7\x61\x3b\x25\x57\x0a\xb4\x51\xd6\xbe\x2c\x61\x5a\xe0\x7e\xf9\xa1\x43\x39\xa7\xee\x27\x3d\x84\x44\xca\x4b\x44\x2d\xd3\x62\xaf\x72\xc5\xb0\x06\xa4\x5d\x5c\x5f\x70\x41\x05\x72\xb2\x21\x29\x8c\x5b\x86\x14\x9f\x8b\xc5\x4f\x7e\x95\x73\x2a\x22\x5e\x85\x5f\x1b\x50\xa9\xf6\xd3\xcb\xff\x42\x46\xc8\xad\x0d\xc3\x60\x26\xaf\x9c\x95\xc3\x15\x45\xf2\x49\x79\x42\xd5\x73\x8f\x4b\x93\x89\xcd\xab\x76\xf4\x36\xce\x36\xee\x1d\xb8\x4b\x52\xcb\xad\x4f\x44\x02\x45\x1c\x48\xac\xb6\x6a\x14\xb5\x5a\xcc\x84\x3c\x4d\xfc\x09\x40\x6b\x84\x76\x10\x3a\xd9\xe3\x8f\x9d\x96\xdd\x78\xea\x71\x6c\x40\x0e\xbc\xd2\x15\x1d\x03\xb3\xf7\x1d\x53\xef\x99\x2a\x36\x0b\xef\xf0\xb4\xbc\x12\xed\x87\xa2\xfe\xb0\x27\xe7\x06\xb3\xce\x62\x93\xbb\x30\xe0\xb1\x19\x89\xcc\x57\xa6\x3f\xcd\x23\x21\x60\xf3\x11\x67\x12\x9a\x23\xfc\x9c\x09\x4e\xa4\x1b\xa9\xbb\x7b\x7a\x9d\x53\xe1\x77\x3f\xab\xa3\xed\x9e\x42\xad\x25\x8c\xd9\xad\xdf\x12\x1c\xea\x5c\x04\x96\xfa\xc2\xca\x28\xf6\x70\xfc\x7d\x67\xa2\xa1\xfe\xa9\xe8\x75\xd3\x61\x5d\xdc\x95\x1f\x0c\xea\x0e\x47\x2e\xd7\x51\xfe\xaf\xcb\x8a\xef\xce\xef\xb1\xaa\xd9\x1c\x20\xcc\x56\x0c\x53\xd9\x02\x57\xb4\xe4\x3e\xf6\x7e\x7b\xac\x83\xcd\x50\x75\x62\x26\x27\xc2\x56\xd4\x10\x5d\x45\xf9\xf6\xe9\x16\x73\x80\x56\x8d\x6b\x31\xf3\x15\x00\xf2\xf4\x51\x3d\xa0\x3b\x47\x80\x9d\xfa\xea\x23\x00\xa9\xe5\x49\x3a\x39\x4f\xac\x3b\xb5\xf1\x8e\x90\x0e\x01\xa6\xa9\x0d\x38\xd3\x96\xeb\xfb\x54\x9c\x7a\xdc\x88\xa6\x25\x3c\x60\xda\x54\x55\x69\x54\xd6\x46\xf5\x5f\x7d\xd6\x86\x59\xbb\x5e\xa5\xbc\x95\xdc\xcd\x5d\x9b\xc6\xbb\x12\x40\x90\xf8\xe5\x90\x4a\xf7\xe1\x04\x56\xda\x01\x10\xaa\xa5\x6e\xe2\x81\x76\xc9\xa9\x60\xb9\x05\x73\x26\x41\x8a\x96\x73\x69\xc7\x2f\xd1\x19\xfa\x32\xc8\x93\x05\x4c\xe0\xc0\x1e\xd9\xd5\x12\x6d\x01\x62\x34\x98\xcc\x3d\x28\x47\xd3\x8e\xab\x70\x2e\x9b\xc0\xdc\x36\x2c\x7f\xfb\xde\xac\x71\xcd\x02\x52\x64\x1f\x15\xc7\x25\xc1\xe9\x57\x71\x44\x28\x4d\x43\x4b\x13\x48\x5c\xb6\xc2\xfa\x54\x5b\x0d\x00\x8c\xae\xc4\x8c\x76\x2d\xd5\x64\xca\xc3\x4a\x39\x06\x2a\xa2\xf5\x1c\x34\xac\x58\xf6\x88\xf5\x87\x6b\x4c\x5b\x0b\x68\x8f\x04\x6f\x15\x4b\x07\x08\xf3\x81\xd2\x97\x16\x12\x56\x14\x0a\x03\xb5\x74\xf6\x35\xcc\x39\x27\xf9\xb3\x20\xf0\xeb\x35\x55\xa5\xb1\x15\xe3\x1b\x91\x49\x21\x55\x05\x6a\x60\xab\x67\x68\x1d\xa0\x58\xba\xf3\x54\x87\x52\x7c\xa2\xe8\xb0\x51\xc9\xd1\xdc\x8b\x2c\xd0\x2d\x08\x73\xf8\x15\x17\x51\xc2\xc8\x2e\x6f\xb3\x56\xe0\x18\x4a\x17\xf2\x6c\x84\xb6\x99\xef\x4b\xc7\x3d\x9f\x82\x4e\xcd\xe8\x62\x7a\x42\x6e\x61\x98\xa9\xc2\x35\x69\xba\x7c\x2e\xb1\x12\xb0\x12\x07\xb4\xc3\x29\x4b\x1e\xbb\x2d\x1d\x14\xef\xb0\xaa\xa4\x1f\x22\xc9\xbc\x69\x4d\x76\xe7\xd3\xa4\xe5\x1f\xca\x3d\xb4\x5e\xf9\xc8\xa3\x88\x88\x22\xbf\xe3\x11\x42\x62\x7e\x51\xdc\x71\x31\x0b\x21\xea\xcf\xbc\x27\xbc\x85\x22\xee\xb2\x7f\x23\x94\xda\x50\xc8\x84\xec\xa8\xcd\xa7\xf9\x67\x01\x7d\x92\xa4\x9b\x43\x47\x96\x7c\x87\x71\x53\x7f\x01\xaf\x5d\xfd\x46\x9f\x03\xb1\xbd\x1c\xce\x3c\xc5\xee\x3f\xf6\x79\x6e\xde\xc7\xc2\x41\x59\xda\x28\x76\xab\x6c\x55\x66\xaf\xd0\xc1\x93\xc8\x9b\x2f\x0d\xf6\x96\x8f\xe2\x21\x78\x48\x3a\x47\x10\xc9\xd2\xec\xb7\xd9\x4b\x71\x9c\xcf\xe9\x37\xf9\x72\xda\x3d\x21\x8f\x17\xfb\x0d\x13\x51\x49\xcb\x90\xdd\xbc\x03\x58\x19\xc9\xd5\xa0\x84\xee\xe9\x32\x88\x6e\xab\x14\x70\x8e\xdb\xe2\xc5\xfe\x32\xc7\x04\x41\xe0\xc6\x86\xdd\x36\x33\x23\x5f\xc6\xd7\x48\x24\x10\xba\xdb\x39\xdc\x71\xbd\x05\x91\x29\x8f\x31\xf5\x73\xb9\x1c\xd7\xc2\xf1\x9f\x54\x0e\x30\xe7\x26\x18\xd1\xfb\x52\xf0\x45\xf5\x58\x00\x61\x3b\x1f\xd4\xc1\xd9\xa1\xda\x45\xac\x92\xd4\x0c\x30\x95\x22\x98\xe6\xb4\xdf\x57\xc4\xcb\x19\x80\x8d\x97\x14\x5a\x20\x82\xb3\x4e\x21\x90\x03\xd7\x18\xcc\x61\x08\xd0\x39\x27\x30\xd6\x09\x54\x9a\x08\x13\x3a\x5b\x49\xde\x00\xb9\xe4\x01\xc6\x9a\x87\xf0\x4b\x02\x21\x51\x7a\x9f\x8e\x69\x73\x68\x20\x02\x93\xe4\x97\xc3\xd2\x36\x70\x47\xc9\x3d\x9b\xdd\x99\x41\x68\x10\x6f\x34\x42\xc9\x80\x22\xeb\xdb\x99\x2c\x86\xb9\xd0\x10\x6c\x1e\xff\x79\x6a\x34\xbb\xfd\xb7\xea\xd9\xf3\xb8\xf7\x3e\x64\xa9\x11\xa6\x25\x4e\xcc\x97\x55\x0b\xe4\x20\xfc\x12\xdb\x5f\x58\xf4\x2a\x64\x8a\x24\x53\x67\x59\xa4\xf5\x91\xf2\x8e\xd9\xe7\x2a\x67\x3d\xc7\x9a\x32\xee\x32\x87\xf7\xd8\x28\x26\xb8\x15\x0c\x76\x14\x25\x42\xa0\x9a\xcf\x49\x44\x11\xba\x8c\xa4\xa4\xa0\xb6\x42\x05\xc8\x39\xf5\x57\x8d\xe6\x50\x89\x63\xb3\x65\x81\x19\xb9\x51\xf9\x0f\xe2\x88\x90\xa7\xb4\x9e\x03\x3f\x75\x39\x89\xe8\xe6\x31\x61\x06\x35\xa7\xc9\x9e\x50\x9e\x85\x25\x50\x4b\x7b\x57\x43\x20\xc3\x73\xcc\x49\x11\x01\x4a\x0e\x7f\xf7\xa8\x5d\xd2\xcc\x09\xcf\x9c\x5c\x5b\x45\xbf\x7d\xf2\xd5\x91\xa3\x02\x9d\x40\x9e\x5d\x74\x18\x8c\x61\x3d\x09\x9b\xae\xbd\x10\xb8\xf4\x2f\xcf\xb8\x69\x1d\x26\x74\x52\x72\x16\xb3\x77\xef\xdd\xdc\x12\x84\x77\xd0\x44\xeb\x38\xc7\x35\x51\x90\x77\xc2\x08\xd3\x09\xed\xd4\x4a\x84\x65\x2a\x4d\xa3\x5c\xd3\xe6\xfb\xb2\xd2\x82\xe1\xb8\xd3\xcb\x30\xdb\x26\xb8\x09\x35\x14\x09\x06\xa2\x21\xe4\xd3\xac\x1d\xd5\x97\xc1\xee\xf4\x16\x35\x02\xbb\xce\x94\xfc\x19\x73\x03\xe4\x90\x87\x1d\x8f\x68\xbc\x14\x07\x1d\x52\x02\x9c\xb2\x9d\x61\x95\x41\x23\x0a\x4a\x3c\xf5\x29\x57\x0a\x2f\x2c\x65\xb9\x88\x32\xc9\x5b\x7d\x8a\x84\xc4\xa6\x3d\xba\x76\x53\x7e\x1e\xb1\xcd\x1a\xe8\x6c\xc0\xda\x42\x3d\x62\x72\xb7\xce\x9d\xe1\x95\x28\x60\xe6\x99\x0b\x05\x81\xa6\xb4\x63\xb1\x4b\x17\xd0\xc6\x0e\x1b\x0c\x59\xe8\x9e\xa0\x9a\xb7\x2a\x62\x95\x67\x4a\x85\xed\xa5\x73\x3f\x76\x04\x4f\xfa\xc3\x4e\xf4\x29\xd7\x61\x94\x62\x98\x80\x43\x93\xac\x51\x13\xfe\x4e\xaf\xab\xf8\x43\x07\x24\x96\x1f\x05\x18\x16\xe1\x58\x12\x3a\x5a\x5c\xdb\x5c\xd7\x03\xe8\xac\xac\xe0\xb6\xfd\xf1\x3f\x0d\xfd\x8d\xbf\x61\x9c\xfc\x73\x46\xac\xa4\xc8\x3f\xf4\x05\xda\xa9\x90\x79\x98\x72\x1f\xbe\x6d\xf9\x68\xff\x9e\x28\xe7\x73\x9c\xb4\x38\x11\x6a\xe9\xca\x47\xf7\x13\x05\xf5\xa3\xe4\xdb\x97\x90\x5a\x33\x27\xd9\xbf\x18\xef\x6b\xc8\x0f\xcc\x5c\x08\xfd\x85\x55\x9a\xef\x48\x81\xd3\xe2\xc9\xff\x02\x5f\xc3\x1d\xc0\xf4\x6d\x11\xb6\x59\x87\x2d\x3d\x0d\x86\xb0\xe6\x40\xa1\x26\xcb\xe1\xbd\xfe\xf2\x9b\xc6\xc9\xcb\x7b\x0f\x62\xbd\x84\x10\x83\xec\x92\x2a\x07\xbf\x3f\x9e\x29\xda\xaf\x48\xb4\xd5\x3b\x51\x59\xc0\x1b\xce\x4b\xab\xfa\x46\xb8\x65\x81\xfa\x4a\x5b\x34\xff\xd3\xf5\xfb\x1e\x9f\x75\x08\xb8\xe5\xcd\x4e\x9f\xc4\x35\xfc\x07\xc1\x60\x50\x8c\xe3\xdf\xe1\xbe\x44\xe7\x97\xc2\x92\xf3\x5f\x08\x03\x63\xa7\x06\x38\xd8\x78\xab\x3e\x49\xb7\x45\xa7\x44\x59\x16\x7e\x6c\x7e\x3e\xf3\x0d\xf4\xd2\xb2\x97\x07\x0f\x82\xb8\x8e\xf3\x0b\xde\x35\x06\x76\x05\xcb\xab\xbc\xb9\x20\x82\xba\xed\x3c\x3a\xba\x48\x6f\x34\xb9\x95\x27\xc5\x38\xfb\x24\x8a\xd6\x42\xdc\xd3\x61\xb2\xd6\x7a\x54\xa2\x02\x63\x3f\x0d\x4d\x47\xc7\x1f\x61\x00\x21\xcc\xd4\x02\xaa\x05\xcd\x32\xb6\x07\xbf\x81\x87\xab\xdb\x60\x1a\xef\x3b\xed\xae\x0e\x29\x22\x28\x38\x11\xc9\x85\xd1\x51\xfd\xcc\x40\xb0\xbc\x6d\x46\xbe\x44\x34\x3d\x4c\x13\x88\xd5\x3a\xc3\xac\x66\x70\xc7\x63\x85\xf8\xd5\x1e\x04\x92\xe9\x3a\x0e\xd0\x02\x23\x4e\x2c\xf0\x64\x73\xa0\xcd\xe6\x2c\x57\x01\x17\xf3\x06\x56\xfa\x27\x5a\xc8\x00\x39\x89\x1a\x0a\x3b\xa3\x61\xfc\x95\x38\xf8\x90\xbd\x9b\x42\x26\x71\x68\x39\x68\x80\xdd\x9e\xd4\xa0\x36\x20\x63\x3c\x97\xb6\xe4\x77\x7d\x10\x57\x56\x73\xb1\x21\xe7\x8b\x5b\x68\x9b\x11\x82\xa6\xf5\x03\x3c\xca\x0d\xab\xda\x96\xff\xbf\xb9\x01\x82\x46\x95\x4d\x14\x05\x74\xea\x90\xa2\x0f\x25\x9e\x01\xf5\xfb\x73\xd3\x11\x0d\xef\xb6\x01\x99\x01\x67\x05\x43\x9a\xa1\x9d\xca\xab\x91\x6e\x2d\xaa\x14\xff\x79\x03\x33\x7d\x89\x66\x25\xc1\xcf\xce\x85\x14\xe6\x9e\x95\x81\xfe\x2b\xe3\x85\xaa\x53\xe0\x9c\x2d\x7e\x4a\xbf\x29\x0b\xaf\x66\x7f\x84\xa4\xfc\xa2\x29\x40\xdb\x97\x2d\x52\xa0\xd6\x02\x10\x97\xd8\x41\xf7\x98\xe4\x6a\xd0\xec\x31\xaf\xcb\xea\x9e\xfa\x52\xaf\x6b\x5f\xc0\x0e\xd6\xde\xae\x96\x06\xfb\xe9\x1e\x94\x7b\xeb\x6e\x23\x09\xea\xf3\xc5\xc4\xa4\xb7\x3f\xf1\x8a\xe5\xa6\x3e\x7f\x01\x88\xa4\x1b\x95\xe3\x0d\x12\x4c\xec\x51\x04\xe6\xec\xd0\x42\x5f\x74\xef\xd3\x1e\x7e\x4c\xee\xaf\xa4\xbf\x51\x31\xdf\x8e\x7e\x7f\xf2\x13\x4d\x53\x48\x4a\xd9\x13\x4c\xd7\x24\xad\x7b\x3f\xcf\xd7\x68\xef\xf0\x5b\xec\x0b\x66\xfe\xb4\xc9\x8f\xb3\xca\xdd\x5d\x69\xa9\x18\x39\x38\x2d\x09\x6d\xb6\xe5\xc6\x37\x49\x6c\xf9\xa7\x93\x71\x62\xc1\xe3\xb9\x55\xb5\xa9\x7f\x4d\x29\x84\xb8\x61\x29\x91\xd2\x59\x70\xc9\x24\xde\xac\xb8\x21\x4c\xc4\x4d\xb5\x82\x85\x20\x95\xf6\x8e\xe2\x66\x3e\x27\xa8\x61\x28\x24\x6e\xc4\xb6\xb9\x25\xdc\x2e\x1d\x8d\x70\x76\x36\x7f\x64\xa9\x14\xa4\x0b\x41\xea\xe4\xcd\xe4\x31\xea\x20\x4e\xd0\x60\x4b\x47\xd8\xb0\x7f\x4a\x11\xe2\xe9\x05\x0c\x59\x30\x0d\x53\x08\x0a\x03\x60\xc7\x5b\xeb\x89\xe4\x59\x68\xa6\x67\x9e\x79\x2a\xee\x42\xc8\xf7\x58\xf7\xda\x9f\x01\xb6\x9b\xa3\xb2\xf3\xb4\xf9\x1a\x13\x33\x20\x6c\xd3\xfe\x75\xb5\x08\xc4\xa3\x71\x94\x8d\xab\xcf\x2c\x04\xde\x39\xc5\xca\x50\xbe\x50\x7b\x21\xee\xee\xb8\x55\xf9\xa0\x5b\x45\x8b\x37\xc1\xe8\xfe\xad\x10\x06\x26\xf4\xed\x9f\x97\x85\x17\x02\xd5\xfe\xa9\x47\xa5\x9e\x15\x41\x73\xff\xda\x29\x34\x1b\xb2\xd6\x72\x41\x69\x6b\x2b\x7b\xcc\x21\x7c\x5c\xda\x81\x57\xd4\xc3\x5d\xa2\x2c\x3d\x5d\x59\x77\xb6\x1f\x73\x09\x1e\x75\x76\x07\x58\xa9\x5b\xfd\xef\xcc\xd5\x05\x03\xc6\x71\xfa\xbe\x75\x8c\x9a\x45\x5e\x36\x4a\x7c\x02\xdf\x00\xc1\x2e\x7f\x1b\xcd\xa5\xfc\x8f\x9c\x1b\x94\x09\x84\x57\x77\x10\x5f\xd2\xe2\x55\x34\x14\x4e\x4a\x44\xf3\x2c\xaf\x9c\x3c\x91\x29\x99\xa7\x7d\xe5\xdd\x26\x54\x9f\xb4\x69\xd9\x0a\x4d\x50\x4b\xb1\x78\xcc\x90\x7d\xd3\xf7\x5e\x1e\x45\xc8\x1e\x32\xfb\xe4\xb7\xf5\x59\x66\x16\x67\x29\x7b\x17\xe8\x37\x5e\x86\xe2\xac\x4f\x64\x81\xfa\x73\x5e\x5d\x07\x7d\xd1\x23\xb4\xb1\xe6\x06\xcc\x50\x85\x31\x09\xe8\x4e\x62\x4b\xba\x73\xdc\x45\x7d\xe9\xb6\x58\x16\xe9\x7c\xe9\x8d\x6f\xc7\x82\x8a\x43\xd6\x60\xf7\x4b\x24\x4c\xb7\xb9\x44\xba\xf0\x83\xdb\x4c\x1b\xac\x29\x96\xba\xbb\x32\xca\x95\xea\xfd\xd6\xb6\x6a\x60\x74\x44\x5e\x00\x28\x78\x26\x69\x56\xed\x5b\xf6\xe5\x83\x1b\x1e\x08\x18\xfe\x5c\xf1\x85\xe1\x08\xe3\x50\x41\x0a\x55\x0b\x18\x38\x43\xce\x25\x1a\xbd\x4b\x55\xf6\xfa\xea\xea\x9f\xa5\x77\xb6\x94\x4f\xaf\x92\x5a\xf1\x65\x0b\x47\xab\x6e\x9c\x3f\xbc\x46\x94\xce\xd2\x17\xa2\xf4\x17\x16\x5b\xdd\x2f\xc5\xb6\xe8\x60\xd5\x8d\xac\xdd\x31\xac\x30\xc4\x40\x88\x5a\x1c\xd8\xb4\x2e\xcb\x89\x1e\xf2\x5a\x98\x06\xc5\x11\xa8\xc3\x26\xe7\x28\x74\x10\xef\x4e\xff\xd1\xdd\x0a\x08\xe3\x26\x63\x86\x2e\xdf\xe8\xc2\xd5\xe5\x04\x5a\x02\x09\x9d\x4f\xa5\x43\x66\x37\x42\xd5\x50\x0c\xe6\x8b\x80\xd3\x50\x70\x57\xc9\x58\x3a\x5d\x1e\xd9\x03\xf5\x62\x60\x49\x8a\xff\x71\x0e\x67\xac\xbe\x5f\xa8\x5f\x7a\xd0\xd8\xc4\xe4\xa9\x2f\xb7\xa1\x59\x62\xa1\x5d\xfa\xe3\xe6\x88\x9e\xa8\xb3\x59\x74\x17\x8e\x60\xf3\x12\x90\xca\x34\xd5\x82\xac\x4d\x26\x2c\xc5\xdd\xd0\x05\x75\x3f\xa9\x2f\x92\x29\x3a\xdf\xea\xec\xda\x0a\xe5\xaa\xa0\xfd\x76\xbb\xfc\x32\x63\x48\x13\x5e\x31\x4b\xcf\xc0\x6b\x50\xa7\x8a\x19\x60\x13\xb3\xb2\xee\xc0\x8a\xec\xaa\x4b\x0f\x21\x10\x7d\x5b\x45\xd8\x1d\x89\x18\x62\x5d\xce\xc8\x14\x71\xc8\x77\x1c\xfb\x27\x24\xac\x6c\xce\x04\x2b\x18\x07\xba\x15\xf7\x3d\x05\x2a\x31\x38\x97\x44\x28\x1e\x31\x3a\xfc\x17\xb0\x38\x4a\x14\x4b\xaa\x5e\x55\xc6\x4b\x9e\x60\xd1\xac\x8e\x00\x94\xf8\x22\x6a\x30\x80\x8e\xb7\x93\x58\xda\x14\xb9\x20\x8c\xde\xfc\x74\xeb\x39\x61\x21\x9f\x72\x1a\x57\xb8\xa0\x8a\x34\xc5\x6b\x0e\xc5\x6e\xd5\x6a\x39\x9f\x23\x30\x52\xb7\xba\xcb\x7c\x55\x6d\x2f\x5d\x8d\xb8\x42\xb3\x97\x33\xf4\x6b\xb8\x0a\x58\x1b\xe7\x3c\xcf\xb1\x13\x63\xbd\x0e\x7f\x86\x1f\xa7\xc5\xf9\x5c\xd7\x54\xbf\xa3\x49\xd5\x5f\x6d\x4e\xc1\xd9\x41\x4d\x0d\x5a\xc0\x33\xe3\xea\x92\x66\x93\xcf\xa6\x7c\xe9\x98\xd1\x24\xab\xd8\x38\xa2\x4b\x9b\xfe\x05\x3c\x73\x7c\x3e\xc3\xfd\x0d\xac\xd2\x70\xe8\x9a\xc2\x6c\xba\x0d\x1f\xba\xe1\xbc\xb8\xd1\x0f\x32\x9c\x22\xc7\x57\xe9\x31\x1d\xa7\x72\xb0\x77\xbd\x2c\xbe\x58\x38\x75\x32\xaa\xf5\x38\x6c\x91\xc1\xc8\x7d\xc5\xac\xc4\xe9\xb9\x4e\xfd\x81\x23\x7e\xf9\x70\xd9\x1b\x95\x2a\x4a\x2e\x40\x5d\xac\x9a\x75\x38\x7c\x3d\x1c\xcc\xe6\x55\xe6\xee\x3a\x0c\xec\x46\xfe\xe5\x24\x46\x5a\x56\x46\xac\x4e\x6b\x73\xe2\xb1\x7a\x93\xb9\x2a\x91\x10\x95\xeb\x5d\x67\xb1\xc6\xce\xd2\x8f\x45\x2b\xc4\x51\x89\xd6\x5c\x47\xba\x40\xb9\x2b\xd9\xa2\xf5\x2d\x34\x46\x8b\x19\x76\x13\x98\x45\x6c\xd0\xbf\x2d\xdd\x98\xcd\x2f\xf6\x1c\x16\xf9\x3e\xc9\x65\x4b\x5a\x1b\x18\xfc\x0f\x4a\xd6\x91\x48\x8c\x0f\x70\x05\x07\xfa\x9d\xff\xe4\x27\x76\x4f\x9b\x6d\x5a\xf1\xe2\x2e\xe2\x30\x89\xd3\xec\x25\x28\x86\xd4\x46\x10\x4b\xe0\x45\xa8\x28\x76\x2e\x81\x45\x85\xce\x98\x33\x3c\x6c\x80\x3e\x7c\xd6\x6e\x01\x5f\xb0\x9b\xdb\x7d\xba\xec\xb7\x24\x74\x04\xf0\x4b\xeb\xf1\xe8\x6f\x12\x2a\x63\xbd\xe0\x99\x96\x24\x93\x0c\xee\xf6\x67\x8e\xec\x64\x43\x25\xa0\xc6\x89\x5e\x0c\xb4\x95\xba\x4e\xe3\x8e\x05\xfa\x5b\x6c\x72\x59\x09\x4d\xcd\x14\x53\x38\x8b\x42\x94\x8c\x5f\x47\x80\x08\x95\xc9\x46\x09\x92\xd9\x73\x16\xa6\x8b\xcd\x94\x54\xed\x6a\x46\x96\x2b\x1b\x96\x41\x61\xab\x59\x9b\x02\x7e\xf2\x5e\x6f\x46\x00\xc3\xf5\xa2\x08\xcf\x70\x55\x1b\x77\x79\x2b\x59\x23\x7b\x4a\xd2\xdc\x20\xbb\x26\x9e\x64\x00\x3b\x2f\x6e\xf5\x20\x7a\xcd\xe5\x7d\xf2\x45\xf1\x77\x11\x64\xe9\x5d\x34\x39\x56\xbf\x9a\x3c\xbe\x0a\x45\xc7\x32\x2b\xdf\x36\xf5\xdd\xb1\x7a\xc3\x57\x3b\x41\x47\x53\x88\x9d\x7d\xf8\x55\xc0\x23\x04\x92\x17\x71\xdc\x0e\xb8\x73\xff\x88\x0a\x5d\x2e\x8a\xa9\x4d\xf6\xd3\xfe\x25\x21\x40\xe7\xc2\x49\x5b\x93\x5e\x3b\xbd\xe6\x34\xd5\x6a\x52\x57\x6f\x16\xac\x78\xb9\xe9\x8c\x1a\xb0\xed\xb4\x30\x7d\x5e\x48\x8c\x89\xb3\x7c\x6b\xe5\x27\x01\x19\xe5\x63\x6f\x12\x93\x2a\x1d\xc7\xc9\x99\xb8\x8b\xa0\xf1\x28\x4b\xdd\xc4\xbc\x4f\xee\x31\xe3\x70\x46\x88\x9c\x09\x1f\x95\x02\x36\x09\x93\x34\x74\xb2\x3e\xb9\x86\x9c\x5b\xb5\x1d\xdb\x84\xb2\x4f\x5b\x7f\x4d\x81\x24\x9d\xc3\x5b\x03\x7a\x6f\xae\x20\xf0\x20\x70\xf4\xf0\x49\x08\x21\xa4\x58\x9b\x76\xdd\x08\xfa\x39\xf1\xdc\x56\x24\x6b\x39\x60\xa2\xc7\x38\xc0\x55\x4a\x22\xa5\x68\x93\x5e\xec\xab\xc5\xc8\xcb\x6f\x42\x78\x9a\x4f\xb9\x57\xa4\xc9\x52\x48\x2c\x1a\x7a\x0c\x2c\x51\xc0\x0d\xb5\x90\x93\x26\x5a\x4b\x58\x1e\xb0\x89\xf0\x9e\x46\x25\x2f\xa9\xaf\xf2\x61\x2e\xe9\x4b\xd5\x27\x9e\x5b\x57\x89\x24\x76\x69\xed\xa3\xda\xb8\x06\xf0\x46\x0b\xf0\x6c\xf7\xe5\x11\x80\x2e\xa2\xda\xba\x61\x6f\x5c\x6c\x39\x74\x78\xa8\x1f\xac\x09\x8d\xb9\xc6\xd5\xfc\x05\x2d\x6d\x42\x8e\xd4\xa2\x8e\x7b\x9e\x7e\x69\xf8\x8f\x5e\x6a\x3e\xbb\xfd\x2b\x13\xf5\x79\xfe\x0a\x1f\xc8\xbf\xcc\x2e\xfe\x2f\x39\x5e\xcd\xe5\xcd\xd2\x4c\x41\x33\x4e\x79\x3f\x5b\x8b\x84\x04\x06\x69\xc4\x2e\x96\x12\x5b\x9b\x16\x53\x64\x6c\x84\xc2\x86\x23\x28\xed\xa9\x2d\x9f\x7d\xd4\xee\xc5\xa6\x8b\x5a\x36\x45\xe3\x29\x4d\x32\x9b\x88\x8b\x92\x89\x30\x55\xdc\x28\x94\xcc\x04\xd2\x1c\x67\xee\xb1\x07\x36\x50\x9c\x9d\x90\x99\xe8\x5a\xfc\x69\xb3\xfe\x59\xa7\x94\x47\xdd\xda\xd0\xc3\x62\x6a\xfa\xc9\x4d\xad\x09\x7f\x12\x45\x66\xc1\x0c\x64\x5f\x07\x67\xb5\xc2\x2d\x1f\xbe\xf7\x78\x04\x91\xd6\x86\x95\x7c\x25\xba\x7c\xbd\x51\x81\x9b\x35\xc5\x7d\x43\x14\x8b\x40\xc7\xbc\x75\x49\x58\x4b\xa1\x03\xde\x58\x8d\xf0\x2d\x7d\xd7\x1c\x3d\xe9\x3d\x19\x54\xae\xcb\xf9\x8e\xdd\x36\xe8\x5f\xed\x48\x84\xe5\x34\x06\x7e\xb2\xaa\x9a\xbe\x13\x52\x56\x9c\xa3\x8d\xda\xd6\x2d\x2a\xe9\x3f\x57\xb9\x18\x9d\x37\x29\xeb\x5c\x31\x8b\x55\xbc\xfc\x8d\x02\x51\xa6\x3d\x00\x8e\x30\x95\xaa\x10\xca\x73\x3c\x2a\xd6\x71\x3f\x4e\x1f\x22\x60\xce\xe6\x2b\xd5\x81\xae\xd4\x9d\x9c\x34\x99\x3b\x17\x20\x98\x43\xdd\x8c\x0f\x2b\x0d\xda\x18\xe5\x79\x9d\xca\x75\x83\x2d\x6d\xae\x9c\xaa\xc0\xd9\x19\x1a\x68\xd6\x21\xf8\x45\x3f\x17\xcc\x3e\xab\x9c\x19\x66\x74\xae\xac\x18\x7f\xe2\xbd\x47\xef\x6c\x32\x0a\xd9\x0b\xaf\xc6\x92\xbc\xce\xc9\x4f\x6f\x30\x81\x96\x93\xf4\x71\x01\x1e\x94\x65\xc6\x16\xc0\xc6\x73\x5b\xe0\xdc\xca\x50\xd8\x9e\x43\xda\xde\x87\x5d\xe1\x4e\xc5\x66\x8a\xa3\x31\x8a\x95\x33\xe0\x32\x57\xa9\x9f\xe1\xda\x1c\x04\x03\x6e\x79\x7d\x51\x76\xcd\x01\x98\x0c\x72\x1f\x32\x69\xe9\xa8\x1d\xda\xe1\x4e\xa2\x93\x5e\x41\x9c\x43\x8a\x2d\xad\xf9\x4f\x80\x4d\x9b\xe4\x28\xea\x32\xb5\x31\x50\x51\x70\x80\xa0\x74\x21\x0e\x00\xc5\x37\x97\x98\x38\xbc\x0c\xe9\x81\x34\xc1\x9c\x1f\xe3\x48\xd3\xe0\x45\xbb\x36\x99\x5b\xe1\x78\x63\x2b\x29\xf0\x93\x5a\x55\x3f\x28\xf5\xaa\x38\x2d\x91\xbc\xc1\xfa\x8d\x95\x02\xea\x94\x2d\xa1\xbe\x84\xb2\x37\xbd\xc7\x1d\x3d\x29\x13\x4b\x17\x21\x4b\xdb\x2b\x32\x09\xb4\x5f\xa8\x0b\x13\xbb\x88\x7a\x3e\xd1\x93\x59\x45\x81\xa3\xe5\xa7\x05\x12\x0f\xae\x70\xc2\x95\x26\x5f\xa4\x62\xd7\x7d\xa4\x00\xaa\x78\x83\x72\x68\xe9\x65\xbd\xed\x03\x08\xc7\x22\x0b\x10\x6a\x9a\x59\xca\x5a\xd8\xd8\x6e\xcf\xb7\x58\x63\xb6\xc1\x69\x8d\x42\x05\x94\xca\x42\x0c\xc2\x01\x90\x3c\x75\x36\x91\x2a\x12\xec\x8a\x07\x44\x28\x28\xcc\xbd\xf6\x80\x31\x9e\xee\x96\xee\x77\x12\x44\xcc\xbe\x90\x95\x8d\x04\x4b\x2c\x82\x93\xe3\xd9\x0b\x0f\xe9\x3a\x51\x92\xee\x3a\x9b\xb9\xea\xb6\xec\x00\xfb\xd6\x86\xf5\xb7\x4b\x45\x85\x41\x55\x4a\xf7\x0e\x15\xcf\x58\x46\xc7\x4f\xb2\x1e\x82\x54\x20\xa9\xb5\xfe\x03\x2c\x25\x22\xae\x70\xe3\x04\x7e\x0f\x56\x71\x23\x8f\x92\xb7\xb6\xa3\x26\x19\x8c\x36\xea\x8d\x8c\xfa\x39\x79\xb2\x49\x4b\x39\x0f\x30\xaa\xca\x31\x0e\x4a\x6a\x94\xb7\xb2\x9f\x4a\xbe\x66\xc0\xb9\xd2\x18\x0f\x3f\xcf\x1c\x9a\x6b\xa9\xce\x4f\xf7\xff\x9d\xd9\xee\xe9\x9d\x61\x55\x47\x83\x2e\x90\x90\x6a\xab\x0b\x48\x09\x45\xe9\xcb\x56\x04\x4d\xf2\x0b\xd6\x71\x09\x6d\xb5\x7c\x97\x69\xad\x21\x0f\x46\x07\x52\x3e\xaf\x88\xb0\x98\xab\x3f\x1a\xfc\x3f\x62\x20\xa9\x69\xbc\x63\x74\x9c\xb4\x67\x9a\x55\x02\x00\x33\x1b\x13\xde\x9f\x68\x80\x30\xc5\xb5\x6c\xc1\x29\x03\x32\x69\x77\x1f\xad\x20\xf7\xd2\x54\x84\xa2\xf5\x40\xcf\x49\xa2\xb2\x21\xaf\xa6\x58\x8a\x6d\x22\xcd\xed\xd3\x18\x7c\xbf\xdd\x4d\x7e\xfd\x32\xbc\x2e\x57\xf8\x0a\x61\xb4\xd3\x33\x85\xfd\x35\xbe\xdf\x82\x2c\xbe\x6c\xb0\x94\xa7\x9e\x65\x12\x71\x4d\x3d\xf4\x20\xb4\x99\xf7\xfa\x67\x23\x45\x0b\x2b\xba\xdc\x04\x9e\x91\x5d\xd3\x3e\x9c\x55\x89\x6e\xe0\xa8\xb7\x87\xb7\xf4\x1e\x96\x70\x96\xcd\xff\xbc\xb9\x67\x7c\x73\x23\xd2\xbb\x43\x0d\x03\x5e\xe8\xa0\xc3\x4e\x71\x86\x06\xdf\x0d\x41\xfc\xcf\x5b\xba\x0a\x62\x45\xec\x5f\x81\x47\x40\x08\xcb\x3c\x91\x20\xbe\x7b\xc5\x8f\x69\xa4\x0d\x6d\xf2\x1a\xcc\xd2\xf8\x85\x4a\x1a\xa1\x93\xe0\x5a\x06\xb8\xc8\xa5\x0e\x22\x5f\xda\x41\xee\x11\x60\xb2\xbd\x5d\x12\x5b\x68\xfc\x4c\x53\x4c\xed\xf7\x76\x98\xab\x41\x33\x20\x87\x0b\xaa\xaf\x32\xcb\xcb\xa1\x5e\xd8\x7e\x71\xb4\x76\x50\xf2\x46\x06\xc0\xdf\xfb\x01\xa1\xe3\x66\xd3\xce\x41\xb9\xc7\x4e\xa8\xc4\x8e\xd5\xc8\x54\xc1\x87\xa1\x3b\x97\x96\x20\x00\x03\x46\xc8\x03\x5b\xe7\xde\xb3\x57\xdd\xec\x11\x0f\x9b\x3c\x09\xa2\xed\xb9\xa1\x25\xbc\x85\x09\x17\x99\xa0\xc1\xa5\xe3\xb4\x0a\x72\x68\x51\xb4\x76\xf3\x3c\xe2\xde\x46\x39\xe7\xb5\x05\xfa\xde\x0f\x82\x06\x21\x12\xe0\x37\xc0\x96\x3f\x5b\x11\x50\xef\x4d\x78\x19\xe3\xe4\xab\x4f\x98\xa8\x81\xb6\x14\xa6\x77\xbb\x6c\x9a\xab\xca\x19\x63\x87\x17\x0a\x2d\x48\x67\x16\x59\xc1\x65\xaf\x43\x6a\xc4\x87\x64\x3c\xff\xb6\x5c\xaa\xa3\x21\x74\xd1\x3e\xd4\x56\xd3\xf2\xbf\x5c\xf2\xf8\xd1\x73\x83\x19\x13\x35\xca\xec\x77\x05\x1c\x6e\xb8\x11\x8b\x37\xc2\xf1\xb7\x8c\x15\x4c\x08\xef\x98\x6d\xa9\xd8\xc1\x71\x6e\xce\x6d\xaf\x00\xc4\x8a\xf5\x77\x3c\xdd\xa6\x13\x92\xf3\x03\x4f\x53\xba\x6a\xfc\x7b\x28\xd4\x64\x5b\x7f\xef\xa3\x22\x13\xe3\xdb\xe0\x4c\x1f\x13\x0d\x80\xf2\xf6\x6a\x47\xd8\x7c\xa1\x2b\x29\xb7\xc6\x30\xdc\xc8\xa0\xb5\xb6\xc6\x0d\x8d\x34\x90\x25\xe0\x4d\xd2\xdb\xd6\x7d\x07\x5a\x14\xd4\x51\xee\x3a\x76\xc7\x7d\xda\x30\x48\x84\x08\xf1\xa0\xa8\x5a\xe9\x9b\x52\xf7\x95\xbf\x80\xcd\xe2\x4f\x9d\x05\xac\xd9\xa2\xf3\x7d\x3e\x28\xc3\xf6\xe2\x96\x72\x56\xeb\x85\xfb\xc0\x39\x0e\xd1\x7c\xb8\x08\xdb\xc8\x0c\x60\x95\xfb\x2e\xb0\x91\xf1\xc7\x57\x15\x36\x62\xf0\x5c\x77\x6d\xaf\xe6\xab\x15\x3c\x99\x04\x77\xb4\x53\x69\x18\x1d\x61\x3b\x0e\x1c\xe5\x36\xe6\xc0\xd3\x41\x6e\x63\x0f\xcd\x13\x20\x27\x43\xd5\x7e\x75\xb1\xa4\xf8\x22\x9a\x12\x31\xf9\x85\x7f\x9f\xce\x26\x54\xd6\x6e\xbb\x3f\xfb\x71\x42\x8c\x7b\x75\x10\x69\xf7\x05\x9e\x8c\x77\x81\xa1\x51\xe3\xe5\x55\x0d\xfd\xe4\x66\xb6\x56\x46\x33\x50\x95\x70\xad\xf3\x27\x59\x86\x7f\x8a\xe2\xcc\x5c\x7d\x96\x1e\x7c\x2e\xe6\x16\x6f\x74\xe4\x81\x4d\x7e\x3f\x81\x7c\xac\x97\x10\x9a\xea\x5c\xa8\x02\x7f\x05\x98\x9d\xc2\x78\x97\x11\xe0\x82\x3b\xcc\x3f\x71\x04\x97\xb9\x65\x8d\x86\x0c\xcc\x50\xb8\xf3\x86\xe0\xa3\xae\x1a\xab\xba\x26\xa4\xd6\x76\x81\x1e\xc3\xdc\x8b\x40\xe6\x58\x48\x91\x73\x92\x10\x4f\x98\xed\xdc\xba\x71\x74\x03\xd4\x51\xa3\xd2\x04\x84\x01\x27\x95\xde\x4b\x1c\xdd\x3a\x7e\x52\x2f\xad\x97\xb6\x6b\x76\xe2\x8b\x37\xec\x69\xf6\x2b\x96\x6f\x60\xa6\x1c\xfe\x6c\xf0\xb6\x8e\x93\x36\x83\xb0\x9d\x15\x38\xf2\x18\x0a\xb5\xa1\x31\x3d\xa3\xf3\xc4\x0a\x41\x2f\x61\x33\x37\xa0\x33\x8b\x46\xcb\xaf\xa6\x5a\xe0\x91\xe3\x6f\x4b\x8f\x0a\xd0\xd4\xd7\x06\x29\x6c\x4d\x37\xdb\x68\x4d\x22\xb0\x58\x10\x72\x00\x58\x70\xc4\x88\xab\x8f\xec\xe3\x9b\xda\xe1\xb2\xf7\xcd\x8c\x2b\xe2\x12\xb9\x69\xc0\x32\xed\xb7\xbc\x14\xe2\x17\x99\xd5\x1d\xf9\x43\x40\xb8\x9a\x4d\x72\xb8\x7c\x82\x84\xe2\x25\x45\x5d\x8b\x7b\xce\xe0\x2d\x6a\xa8\x11\xb7\x8d\x72\xfb\xb3\x9c\x7a\x51\x5d\xb8\xd0\x96\xa5\x14\x8e\x3f\xa5\x50\xa3\xed\x96\x79\xf3\xa9\xbe\x2b\xc1\xfa\xd6\xcb\x35\xa5\xeb\x54\xbc\x2c\x0d\x2d\x2e\xf7\x47\x00\x2c\xf9\x9c\x95\x66\xba\x7d\x49\xd1\xa0\xb8\x96\x4c\x0a\x4b\x94\x10\xd8\xe6\x1f\xc4\xf5\xcf\xf2\xf3\xb2\x8e\xc5\x31\x91\x57\xef\x05\x81\xe5\x22\x30\x12\xb9\x2c\xa1\x8e\xf5\x41\xb2\x28\x26\x58\x4b\x51\x1d\x6d\x59\x68\x08\x68\xb7\x9f\x03\x24\x6f\xec\x97\x85\xbd\x9e\xaf\x45\x85\xd8\x25\x7f\x76\x27\x86\xee\x6c\x3c\x7d\x26\xc7\xe1\xc8\x9a\x4d\x61\xc6\x4f\x50\x26\xe6\xf3\xfe\xbb\x2e\xd9\x7d\x93\x74\x0e\xe8\x9c\x85\xe8\x24\xa6\x4c\xb8\xcd\x2d\x5e\xef\x27\xbb\xee\x52\xb0\x73\x47\x43\x04\x28\x8e\xeb\xa7\x84\x5f\x84\x4c\xef\x16\x28\x57\x14\xc1\x3c\xa1\x37\xa7\xcf\x00\x02\x83\x8b\xa8\xae\x3d\x67\x29\xd1\x4e\xf4\xe7\x4a\x0f\xc4\x89\x9b\x11\xbe\xa4\x0f\xa0\x33\xc9\xb1\xf4\x70\x6f\x27\xa1\x3b\x37\x2e\x55\xdb\xac\xdc\x67\x61\x0e\xf7\x94\xae\xac\x70\xa0\xae\x00\x3f\x9f\x31\xdc\xa0\x6a\xb5\xfb\xf6\x45\xb7\xc5\xb9\xea\xb4\xce\xa7\x27\x9a\x42\x7c\x22\x71\x14\x5c\xb2\xd8\x0c\xff\x41\xa5\xba\x5e\x0f\x31\x3c\x94\x4f\x45\x05\x72\xe2\xf4\x61\xa4\x85\xe2\xc5\xb0\x63\x4e\x33\xa3\xb7\xdb\x5f\x8f\x50\xa4\x13\x2e\x14\x61\xd5\x8d\x2b\x61\x48\x58\x3a\x4c\x73\x6e\x64\x22\x68\x08\x3a\x09\xa1\x4b\xc7\x9d\xdd\x96\x05\x91\x9f\xce\x58\xb9\x0c\x23\xbf\x19\xc4\x7d\xdf\xda\x5d\xf3\x61\xd0\x71\x56\x3c\x8f\x73\x21\xff\x15\x88\xd8\x00\x8f\xcc\xe3\x6b\xa0\x22\xcd\x9c\x31\x6d\x1b\xe5\xbb\xb8\xb9\x63\xd4\x83\x28\x51\xcb\xe8\x13\x0f\xd1\x9a\xed\xec\xe0\x00\x5d\x53\xf7\x66\x1c\x3b\x85\xfa\x59\x2d\xd4\x0a\xbb\x45\xc0\xd6\x13\xfa\x31\xb7\x7d\x0a\x05\x67\x3c\xf9\xc2\x8c\x56\x7d\x0d\xc4\xa9\xe5\x34\x71\x16\x95\xca\x66\x53\xf1\x06\xfa\x32\x7e\xc7\x82\x99\xda\xfd\x7f\xc6\xbb\x26\x68\xf6\x48\x37\xcf\x6e\xa4\x6b\x0f\x51\xbc\xdf\xb8\x85\xe7\xd4\x71\x8e\x0c\x28\x28\xa1\xa7\x2d\xbd\xa8\xf5\x3d\x30\x5c\x11\xc2\xf1\xd2\x24\x72\xba\x5a\x87\x92\x4e\xa7\x33\x09\x3d\x93\xf3\x58\x58\x4e\xeb\x76\xc4\xb2\x98\x2c\x9f\x59\xfe\x84\xd8\x8c\x5c\x1b\x3a\x76\xda\xc3\x0a\xfd\x24\xde\x19\xf1\xa0\x74\x88\xb4\xf1\xb9\x0f\x30\x24\x0a\x33\xc2\xd1\x4d\x50\x45\xe1\x8a\x16\xee\x63\x02\x46\x01\x1e\x5f\x02\x15\x5a\x45\xa0\x3c\x8e\x1b\x6b\x1a\x25\x81\xed\xfa\x78\x7c\xb9\x4f\xd2\x4b\x9e\x2c\xef\x60\xb1\x04\x90\xed\xa6\xa4\xb0\x8e\x9c\xc7\x8f\x10\x59\x53\xee\x7d\x78\x76\x44\x27\xd1\xa5\x28\xa2\xf3\xed\xe9\x73\x85\xfa\x1e\x70\x49\x49\xc0\xd8\xa4\x39\x24\xd4\x4c\x5a\x1a\xc7\x43\xe3\x8a\xfc\xe6\x17\xae\x3f\x65\xee\x96\xa2\x25\x86\xd7\xc2\x04\xc6\xfa\xf9\x57\x05\x56\xfa\x26\x23\xa5\xb2\xa1\x4d\x2e\x2c\x36\x82\x5c\xaa\x3e\x58\x58\x76\x5f\xab\x79\x65\xdc\xd4\x8e\x57\x78\x25\xf7\xd1\x75\x0d\x3c\xdf\x52\x72\x8f\x45\xd8\x5f\x15\x61\x7f\x35\x59\xfb\x2d\x57\xa0\x1f\x69\x39\xa9\x98\xee\x2d\xbf\xfc\xf1\x7e\xc7\x70\x2b\xfa\x0d\x7b\x42\x60\x2d\x5d\x8b\xf3\x37\x2b\xbf\xfe\x4d\x4b\xe0\x30\x21\xc7\x98\xf6\xe4\x7d\xd2\x6f\xa8\xdf\xfe\x12\x6e\x00\xb5\x45\xff\x09\x6c\xba\x76\x94\x55\x02\x79\x00\xa6\x3a\x56\x11\x65\xa3\x15\x3e\x4c\xb7\x5b\xe5\xa6\x42\xf8\xb8\x78\xe5\x6b\x09\xbd\x3b\x61\x2a\xa5\xa7\xc7\xe5\x66\x37\x5a\x79\x50\x45\xef\x79\xfb\x65\x05\x38\x52\x9f\xe3\x86\xcf\x01\x9b\x1c\x62\x39\xdf\xc3\x50\x85\x02\x98\x88\xa8\x46\x0b\x96\x93\x50\xc8\x50\x5c\x96\xb0\xde\x5f\x88\xec\xe5\x7f\xd5\xc8\xd2\x7d\x32\x3d\x02\xca\x38\x7d\x79\x6e\xe6\xff\x9c\x8f\x75\x10\xf1\x16\xe0\x01\xe6\xd8\xdf\x55\x9e\x8c\x3b\x66\x1e\xb7\xd4\x1f\xea\x39\x9a\x6c\xa1\xf1\x04\xb9\xe8\x96\xec\x73\x6b\x84\x2a\xa0\x24\x7f\xcd\xed\x4b\xd3\xcf\x8d\xa8\xb4\x38\xa3\x91\xd5\x75\xfb\xde\x51\xfc\xb5\x16\xc6\x48\x7e\xc1\x74\x63\xd7\xec\x84\xca\x26\xbb\x4a\x10\xe8\x75\xf9\xb1\x9c\x39\xba\x88\x3e\x80\x97\x85\xea\x3b\xad\x9a\x72\x8c\xb4\xac\x5b\x0a\xa5\x03\xbc\x23\xf4\x68\x02\x74\x39\x8d\xb5\x73\xb7\x66\x52\x95\x64\xa0\x71\xc6\x70\xea\xda\x0f\x67\x17\xeb\x18\x83\x13\x59\x36\x59\x5a\x96\xb7\x70\x98\x8b\x1c\x29\x86\x92\x7a\x2a\xe7\xcd\x9c\xe6\x0c\x63\x70\x84\x06\x54\xb7\x06\x2e\x30\x0f\x2a\x11\x0d\x7e\x39\x85\xd4\x1b\x60\xa3\x5e\x4d\xc4\xa0\xcb\x36\xea\x6b\x32\x6b\xf6\x83\xbb\x31\xca\x82\xd3\xae\x8c\x80\x9e\x79\xdc\x26\x19\x32\xc1\xd5\x43\x03\xbd\xaf\x77\xee\x64\x7c\xba\x0d\x27\xab\xec\x08\x3b\xd9\xbd\x0d\xd5\x12\x01\x4e\x9c\xa3\x44\xfe\xec\x5d\x6e\x7a\x26\x90\xe4\x97\xf8\x2b\x1b\x71\xb6\x96\x0d\x36\xb5\x0c\x0f\x45\x9b\x58\xdc\x1e\xd2\x1a\x57\xd8\x1e\x45\xca\x0c\x52\x46\x90\x7a\x81\x18\xa9\xf8\xaa\xdd\xfd\x1c\xc7\x06\xb0\x33\xb1\xaf\x3f\x0f\x61\x31\x59\xd7\xed\xcf\xd9\xc7\x6f\xf8\x73\x8a\x42\x63\x61\x97\xb1\x2a\x8b\xd8\x06\x6d\x5f\xae\xe8\x37\x69\x88\xf5\x5b\xa0\x38\xc7\x9d\xed\xb0\x88\x87\x17\x27\xf7\xa8\x73\x71\x91\xc1\xf7\x28\x57\xcc\x8d\xe5\xc3\x7e\xab\x34\x07\x70\x48\xec\x21\xf0\xef\x29\x42\xe7\x58\xf0\x54\xa0\x3a\x4a\xbf\x88\x10\xda\x87\x52\xa3\xcd\xc6\x1c\x05\x65\xdb\x79\x0d\xc8\x66\x0a\x50\x45\x3f\x62\xb9\x93\x7b\xb1\xe4\x1b\x54\x8f\xde\x06\x45\x4c\xf4\x10\x66\x4a\x6d\xf9\xee\xec\x12\xca\x81\xd7\xf4\xc5\x1c\x3f\xcf\x74\x75\x5e\x20\xeb\xb9\xac\xdd\xfb\x64\x2e\x11\xba\x09\x90\xa6\x8e\x5a\xfa\xa6\x5a\x79\xf4\x90\x40\xff\x0e\x85\xd9\x94\x7f\xe6\x49\xe8\xd3\x13\x22\x62\x0c\xca\xa7\x82\x31\x0b\x0b\xe4\x16\xfc\x1c\x7e\x49\x9e\x5b\xe0\x09\x37\xfa\xd4\x3d\xc1\x20\xbe\x84\xee\x04\x39\x4d\x30\x1a\x9f\xf1\xf2\x5b\xad\xdf\xea\xb3\x4c\x0c\x80\xbf\xdc\x69\xfd\x09\x50\x88\x12\xb5\x67\x11\xfc\x12\xa8\x9e\x8b\xd1\x5a\xf1\x8d\xd0\x3a\xfc\xd1\xeb\xb2\x6c\x79\x4e\x4a\x47\x9e\xd5\xef\xd3\xe6\xa5\x4f\xfa\x4f\x54\x58\xa6\x50\x97\x0e\xcc\xdc\xc6\x90\x64\xfb\xda\x21\x8c\x26\xda\xf5\xb5\x34\x09\xb8\x49\x79\x22\x30\x1b\x32\x3f\x55\x57\xce\x61\x9c\x0f\x47\x68\x6a\x01\xfb\xe9\x75\x14\x47\x60\x52\x1e\x91\x9f\xeb\xb1\xfe\xc0\xf4\x47\xa8\xe6\x47\x5e\xab\xe9\xa8\x18\xcd\x3d\xb2\x64\x0f\x43\x1b\xfb\x99\xb6\x80\x6b\x12\xc4\x29\xd5\x49\xfc\x82\x0c\xa6\x3d\x72\xe4\x67\xf2\x34\x2d\xa4\x15\xf5\xa7\xc4\xa2\x17\x80\x9d\x59\x2b\xbe\x37\xae\x53\xd0\x48\xfa\x93\x6a\xd6\x17\xc8\x4e\x1e\xd9\xda\xe5\xff\x63\xb4\xc5\x08\x01\x7b\x52\x08\x53\xeb\x83\xdb\xf4\xbe\x11\xa2\x69\xfe\x62\xf3\x64\x09\xa8\xdb\xe4\xd3\xf1\x8f\xc2\x76\xf9\x02\xb6\x1c\x4d\x77\xa6\x6e\xd2\x70\x64\xe1\xcd\xe5\x4d\xb0\x6a\x42\x70\xe9\xff\x54\xf1\x42\x30\xc9\x5b\x0a\x0f\xaf\x75\xc4\x5f\x9e\xe9\xae\xf1\xc8\x33\x42\xfd\x4d\x7a\x8f\x70\x73\xe0\x17\xa1\xf8\x9a\x15\x02\x5a\x4d\x80\x26\x00\xa2\x5b\x75\x30\x0d\xf3\x95\x0c\x21\xb9\x41\x4b\xf1\x20\x1c\x89\x7f\xe0\x30\x50\xbe\xb1\xef\x65\xc1\x92\x3b\x69\xbb\xa1\x00\x52\xe2\x0a\x57\x32\x61\xd8\x83\xe2\x6b\xe4\xfe\x12\xb5\xb4\xee\xda\x31\x6a\x13\xaa\x29\x8f\xcc\x93\x6e\xa6\xd0\x65\x16\x54\x0f\x66\x49\x42\x1b\x5a\x96\x03\x1e\xdc\xc3\xf1\x9c\x0b\x67\x6c\x44\x76\x0a\xcf\x09\xce\x2a\x51\x9c\xd6\xd3\x07\xfa\xa4\x83\x7c\x95\x0c\xc4\x2c\xee\x29\x4d\x80\x28\xa0\x7d\xe5\xe3\x8f\x1b\x64\xce\xa0\xdc\xaf\x50\x1f\x8a\x1a\x56\x61\xe4\x3f\xed\x36\xfe\xf3\x46\xbc\xac\x4a\x8f\x05\xac\x8b\x38\x24\x54\x32\x7a\x10\x96\x04\x9c\x78\x7f\xdc\xa2\x91\xa1\x04\x89\x25\xd6\xe9\xd0\x51\x3e\x73\x8a\x04\x02\x90\x4e\x64\x8b\x0a\x87\xb4\xdd\x82\x92\x09\x1d\x77\x80\x0f\xc7\x4d\xc3\x42\x67\x87\xa3\xa0\xc7\xef\x59\xfa\x81\x1f\x1b\x95\x38\x22\x40\xe3\xc3\xc1\x29\x5c\x3c\xc9\xb2\x78\xe6\x91\x51\xda\xeb\x46\x27\x83\x22\x71\xda\x46\x02\x6f\x69\xa7\xca\x8f\x71\xda\x6d\x84\x36\xeb\x8d\xab\x6a\x39\x0e\xe0\x5d\x1b\x21\x95\x75\x36\x43\xc5\x4a\xee\x84\x11\x55\xf8\xa6\xee\x79\xbb\x41\xa0\x2b\x37\x04\x70\xae\x3c\xe0\xdb\xc0\x0e\xad\xf4\x0e\xc5\x4a\xe1\x43\xf9\x99\x76\x77\x2f\x81\x4f\xb5\x3e\xbf\xce\xf3\xc2\xca\x55\x2f\x79\x41\x3a\xc7\xa7\x3d\x75\x07\xfb\xec\xad\xd3\x3e\xbf\x43\x74\x46\x79\x6d\x8b\xfe\x12\x87\x8c\x4a\x1c\x13\xd5\xe4\x5d\x21\x14\xb8\xf7\x1a\xa6\x1b\x56\xda\xd6\x0a\x52\xc4\x1e\x36\x02\xb1\xa6\xae\x29\x13\x21\xa4\x76\x1f\x9f\x1a\x7e\xbb\xe4\xcb\x71\xbc\x59\x6d\x40\x15\xfa\x98\x49\x76\xa0\x4a\x19\xf7\x2a\x6d\x75\x96\x2a\x7a\xb5\xa6\xfb\xf1\x9e\xa5\xbd\x00\xd6\xc6\x2b\xd6\x5f\x41\x06\x9f\xe5\x02\x4b\x43\xdf\x11\x20\x95\x23\x72\xd1\x95\x9b\xb9\x77\x1d\x25\x08\x79\x92\x47\xdd\x9e\x30\x5f\x58\x7c\x61\xa9\xdd\x4e\x55\xd4\x2c\x12\x2a\x74\x13\x08\xbf\x85\xa2\x71\x00\xe4\x10\x6b\x8a\xd9\x6e\xe1\x9d\x89\xb4\x19\xde\x60\x94\xd4\x8c\x15\x46\x88\x4d\x54\x20\xeb\xd3\x95\x57\x10\x17\xfa\x3a\x0b\xb0\x9a\xda\x43\x8d\x3d\x07\x6a\xf4\xac\x80\xca\x4d\xb2\x7c\x00\xb0\xe6\xa4\xa0\xd9\xc2\xda\x76\xeb\x12\xb1\xa0\xb0\x10\x96\x90\xaf\xa3\x57\xaf\xc0\x9f\x1e\x55\xb2\xce\x1b\x15\xed\x8f\x56\x3c\x82\x1e\xcf\x6b\x78\xe3\x63\x6a\x7f\x02\x63\x13\xf0\xd4\x6f\xb4\xb3\x37\xc7\xf5\xf6\xa8\xb5\x9b\x6d\x0b\xa7\xdb\x98\x1b\x5b\xf8\x5b\x34\x5f\xb4\x58\xb3\x99\x87\xb0\xae\x31\xe5\x77\xe7\x5a\xbf\x6c\x6c\xb4\x50\x99\xd2\x09\xb4\x45\x97\x65\x69\x25\x21\x6a\x83\x10\x15\x4b\xdd\xc3\x3a\x00\xae\xeb\xd7\xa7\xfd\x87\x59\xce\x6c\x64\xdc\xab\x58\xe8\xfc\x1f\x18\xec\x71\xe8\xf9\x14\x0c\x36\x7f\x35\x51\x9f\x51\x7e\xdd\x86\x22\x76\x7b\xff\x39\x3d\xa4\xf8\x84\x7d\xa5\xcd\x61\x5b\xaa\x3e\xab\x75\x90\xc1\x0e\x69\xa7\xb3\xaa\xe4\x43\x94\xd4\x93\xdf\xd6\xa6\x3b\xcb\x93\x48\x27\x8b\x93\x30\xab\xf0\xc8\xe6\x2f\x3e\x39\x88\x8f\x3b\x09\xf9\x73\xcd\x52\x62\x4b\x5d\xbd\x54\x97\xd8\x85\x4a\x39\xda\xb4\xe3\xd6\x9e\x73\x5b\x5b\x18\x22\x28\x37\x3b\xda\x6c\xf4\xd8\x08\x62\x3d\x8f\xbf\x95\x8f\x8f\x85\x04\x28\x3a\x6a\x36\xe0\xae\xa7\xaa\x02\x14\x6b\xd2\x2c\xad\x1d\xc6\x7a\x5b\x02\x1d\x9b\x14\xa4\xbe\x08\x5f\xfb\xb5\x08\xe9\x86\xbb\x77\x98\x60\x1c\x16\xac\xca\x36\xd4\xc3\x11\xe8\x4f\xc0\x02\xeb\x3f\x06\x59\xcf\x73\xba\x32\x35\x83\x5a\x14\x3b\x88\x44\xdd\xc8\xbf\xe7\xfa\x59\xe8\xb2\x26\x9f\xf6\x48\x23\xd5\x81\xb1\x40\xc6\xf2\xa5\x90\x09\xa5\xa9\x6e\xc7\xa8\x8d\x0b\x67\xd9\x32\x11\xb4\xa8\x0e\x4a\xce\x14\x20\x6f\xf0\x91\x5a\x36\x3b\x0a\x5b\x9e\x7f\x7f\x7b\x72\x03\xdb\x93\x2a\xdb\xf0\xd4\x0d\xd1\xd2\x45\x3f\x79\x73\x4a\xd3\xd2\xe9\x2f\x32\x6b\x05\xa3\x7d\x49\x92\x11\x0d\xae\x3c\x6c\x73\x8b\xf6\xd5\x65\x76\x38\xe7\x6a\xce\x4c\x2d\x37\xce\xec\x1d\xbb\xca\x9d\xc9\xbe\x48\xb2\xa7\xe5\x6a\x6b\xbd\xba\xf1\xe1\x80\x6f\xc4\xce\x56\x29\x45\x53\xa8\x64\xe4\x61\xd9\x8f\xff\x62\x5b\x6b\xab\xa7\xe5\x6e\x38\x79\x5a\x44\x9d\x20\xc0\x5c\x5d\x9c\x36\xb0\xae\xa5\x3b\x6c\xac\xa3\x52\x1c\x56\xb1\x0f\xc2\x24\xdc\x77\x57\x70\x57\x47\xea\x8e\xb0\xe4\x61\x7e\x60\x8f\x31\xbc\x0f\xf9\x55\x28\x78\xb2\x5f\x69\xc6\xbe\x29\xb2\xf5\xcd\xd4\x46\x14\x06\x95\x6e\x98\x9e\x13\x6f\x81\x38\xb5\x7e\x25\xf9\xec\xa7\xb1\xac\x97\xe0\xde\x3c\x94\x22\x2c\x6b\xe5\x50\x37\x90\x8e\x89\x1f\x45\xb1\x87\xd4\x64\xf7\x90\x40\xd2\xdc\xad\x74\xf1\x6a\x72\x17\xea\xa4\xba\xae\x09\xeb\xda\x15\x9e\x6b\x37\x71\xc5\xb8\x86\x4c\xe9\x26\x9d\x49\x44\x99\x93\xd8\x26\x20\xdf\x80\xb8\xca\xd9\x77\x9c\x84\x43\x4e\x82\x26\x3b\x94\x35\x35\x4d\x88\x99\xb6\xa2\x24\xa7\xc8\xb7\xec\xf7\x16\x5c\x1f\x85\x26\x56\xb6\x13\xf2\x38\x07\x75\x9e\x9c\xe1\xc1\x0e\xf7\x46\x67\xde\xcc\x0e\xd7\x3d\xd5\xd4\xd3\x71\xe9\x47\xb8\x80\xa1\x96\x8b\xd5\xba\x74\x1f\xfa\xe5\x69\xe4\x93\xe0\x31\x1c\x7b\x21\x05\xdd\xea\xb4\x36\xa4\xdf\x4e\x4c\x85\xaf\x00\xef\x45\x44\x29\x7f\x01\x50\x37\x7b\x9c\x08\x80\xb5\x59\x08\x95\x52\xb1\x94\x4f\xc4\xe7\xea\x6b\xed\x84\x7c\xae\x7c\x93\xfe\x52\x38\x8b\x2e\x84\xe8\x2e\xa8\x27\x72\x67\x40\x70\xec\x59\xdd\x24\xa8\x02\x42\x41\x91\x52\x02\x63\x1e\x31\xa3\x6c\xe6\xa9\x70\x28\x9c\x58\xfe\xd1\x09\x14\x3b\xf2\x10\xac\x04\x52\x53\x12\xe5\xd0\x40\x97\x3a\x5d\x2a\xc9\x81\xf5\x6e\xf1\x52\xcd\x96\xa8\xa9\xfb\x47\x82\xbc\x8e\x12\x57\x05\x96\xde\x0f\x18\xa1\x36\x41\x87\xe4\x11\xda\x98\x99\x91\xd4\x25\xd2\x10\xff\xbe\x1b\x5f\xf1\xc3\xc1\xb6\x87\xaa\xf3\xee\xcd\xb0\x94\x00\xcb\x3e\xfb\x81\x7f\xa7\xfb\x02\xd7\x1f\x28\x94\x59\x11\x67\x4b\x94\x7c\x67\x07\xad\x04\xb7\xf9\x6d\xc3\x7e\x16\xa8\xda\x42\xcc\x5a\xa2\x0f\x04\x3c\x80\xfc\xf7\x73\x9c\xd7\x97\x39\x74\xdb\x3a\x01\x4f\x16\xc2\xf6\xf8\xcc\x95\x34\x98\x1a\xf5\x84\x09\xa6\xdd\x55\xa3\x15\xaa\x63\x84\xe2\x76\x4e\xfa\x7e\x10\x8e\x1b\xaa\xac\x7f\x98\x92\xfd\x31\xff\xb6\x3c\x4d\x4e\xf8\x7f\x79\xe2\xb5\xb2\xc0\xab\x0c\x17\x47\x8a\x2b\xbf\x7b\xfa\xf8\x5e\xd9\xd9\x0f\x57\xde\x5f\x61\x45\xcc\x32\xd1\x95\x29\x18\x7e\xe5\xe4\x5f\x71\xa5\xf9\x74\x86\xd1\x45\x45\xbd\xcf\x95\x84\x39\xff\xec\xab\x63\x6c\xb7\xb1\x5a\x63\x7d\x90\x51\x4c\x21\xe4\x7a\x4e\x50\x27\x25\x7f\xdb\xad\x8b\xab\xe8\x1d\x30\xbf\x9a\x89\x7d\xc6\x65\x91\x15\xf1\xc2\x81\x18\xbd\x92\xa0\x9c\x40\x91\x55\x20\xfc\x67\x88\xf5\x0b\x07\xfe\xca\x9e\xe3\x03\xa5\x2b\x87\xec\xda\xd8\x41\x7f\x45\x8b\xb2\xfc\x90\x2d\x9a\xf4\x3d\x08\x1b\x2f\xdb\x78\x2b\x85\x16\xab\x2f\x4a\x85\x58\x2c\xf5\xe9\xf9\xb7\xe4\xfc\xd2\x22\x96\x85\xa1\x34\x9b\x93\x90\x25\xae\x05\x66\x13\x13\xfe\x4e\xb4\x3b\x0d\x94\xf0\x3e\x84\xa8\xf4\xc7\x9e\x72\x29\xbc\xb2\xa8\x68\x33\x58\x75\xde\x88\x74\xfc\xf4\xe2\x43\xfe\x91\xe3\xe2\xc7\xee\x4f\xc1\x89\xed\x22\x7a\x31\x00\x4e\x85\x6b\x10\xf0\xdf\xa3\x4c\x73\x09\xa3\x20\x94\x18\x7d\xbc\xa2\xde\xa7\x1c\x99\x8d\x2e\x97\x23\xad\x81\x4e\xbe\x61\xb1\xc0\x55\xf9\x11\xd9\x26\x96\x44\x1e\xdb\xdf\x43\x74\xb1\x3d\xc0\x61\xa1\xf9\xbe\xeb\xcf\xef\xe4\xc8\xe9\x77\xd2\xd4\xfd\x2d\xfa\xa4\x6d\x6d\x36\x2f\xe1\x0a\xb7\x4a\x3e\xc2\x2d\x79\x2d\x44\x2b\x0b\x2c\x0f\xd0\x31\xa7\xed\xe7\x3a\x94\x69\x8f\xa9\x99\xb7\x2a\x02\xd9\x75\x71\xa3\x71\xee\x01\x42\xa6\x77\xab\x4d\xd1\xaf\xef\x5a\xc1\xb9\x6c\x60\x3f\xd5\x46\xf6\xc9\xe1\x5f\xc5\x12\x3b\xf8\xa3\xfd\x2a\xc9\x9f\xcb\x9c\x76\x82\x96\xa1\x2d\x35\xc4\x17\x7d\x99\x2e\xb3\x8d\xca\xc4\x56\x05\x5f\x7b\x1b\x93\xf9\xfd\x55\x0a\xf6\x21\x54\xb2\xc8\x52\x1e\x6f\xe9\xcb\x98\x59\x75\x31\xf7\x53\x12\x33\xea\x5c\xa0\xbe\xee\xfd\x8b\x85\xa3\xc4\x66\x9b\x31\xc5\x9f\x49\x90\xea\x19\x9d\x16\xf0\xc7\xe1\x90\x7a\x54\x81\x2c\x09\xbe\x0a\x0a\x3c\xa6\x8e\x81\x3d\x2b\xc1\x48\x45\x65\x66\xa0\x0c\x0b\x96\x4f\x46\x96\x5b\x0f\xb2\xfa\x78\x00\x4c\x96\x27\x25\x18\x54\x76\x2d\x61\x07\x81\xe6\x12\x7a\xb0\x61\xb3\x49\x14\x78\xbc\xb9\xab\x91\xfd\x71\x45\xdc\x8a\x03\x8b\x49\x80\x06\x38\x70\xd8\xfe\xfa\x4b\xdb\x21\xc0\xb8\xf6\x5b\x6d\x01\x44\x4e\xd5\xf4\x58\xb0\x5d\x14\x9d\xf9\x55\x72\x44\xf6\xd0\xfd\xdb\x6f\x04\x3b\x14\x5f\x17\x39\xd0\x49\xde\x95\x7f\x31\x70\xc8\x52\x0d\x0a\x60\xb2\xb0\xc7\xdb\x36\x2a\xa2\xd2\x87\x6d\x9f\xbc\x9b\x80\x4b\x06\x1c\xf5\x21\x60\xf2\x40\x79\x14\xc5\x52\x9e\xad\x28\x65\xe9\xbd\x46\xdd\xf5\x08\x89\x05\x92\xbf\x15\xe4\xa8\x02\x1d\x29\xfc\xd4\x0f\x49\x98\x1d\x72\x65\x39\xbc\x28\xef\xc1\x2b\x4b\xc9\xd5\x8b\xd3\x9e\xb3\x1c\xa9\x83\xc0\x9a\x7f\x03\x60\x3f\x0d\x87\xd2\xfd\x72\xc9\x3f\xec\x76\x88\xb2\x20\xcc\x58\xb7\x25\x6c\xb9\xba\x0f\x9f\x9a\xb5\x3b\xc0\x61\x67\xf0\xfc\x82\x2d\x63\x59\xbd\xb6\x06\xfb\x56\xf6\x3e\xbb\x3d\x6c\x2b\xb7\x42\xb5\x52\xcf\x55\x1f\x31\x87\x19\xbf\xe5\xa5\x27\x37\xeb\x20\x39\xd7\x09\x9e\x64\x81\x8c\x9e\x9e\x14\x71\xa5\x29\x32\x60\xcf\xa1\x2a\xe9\x6b\x73\xc2\x52\x37\xb4\x4f\xad\x2d\xe1\x85\xcf\xc6\xbe\xa7\x8f\xbd\xdd\x49\x90\xf0\x55\xe1\xc9\x28\x01\xf2\x55\x17\x9f\x20\x2e\xd9\x86\xe4\x1e\xa9\xc3\xae\x56\xae\x08\xe8\xe4\xe5\x68\xa9\xbf\xaa\xa5\xc3\xca\x76\x1d\x81\xad\x47\x2b\x3b\x19\x94\x0d\x51\x5f\x43\x30\x36\xbe\x1c\xf8\xe7\xa4\x63\xaa\x25\xf2\x91\x89\xca\x73\x3a\x09\xb1\x9c\xe8\xd6\xec\xde\x5f\xb5\x94\x66\xed\x95\x6a\x3c\x6a\x38\xd5\x2e\x5a\x42\xe5\x5a\xb0\x06\x90\x9a\xf2\x44\xda\x9d\x5e\x55\x4a\xd2\xa6\x2f\x67\x18\x54\x83\x7b\xa7\xc8\x72\x00\xe8\xf1\x6d\xc0\xc4\xbe\x6c\x7a\x77\xcd\x82\x61\x2f\x1d\x9c\x1c\x69\x5e\x6c\xf7\xdc\x87\x6b\x17\xee\x25\xa6\xf9\x85\xfb\xde\xf0\x13\x51\xf3\x39\x2a\x10\x5b\x0a\x5e\x40\x5f\xcb\x91\x78\x3d\x79\x46\xd6\x85\xfb\x7a\x0b\x02\xa2\xa7\x37\xda\x15\xec\xab\x9d\x67\x52\xb4\x45\xa5\xc5\x12\x92\x71\x09\xf7\x6a\xaf\xa5\x85\xaa\xad\x53\x37\xfd\x84\xd6\xdb\x0a\xdb\x7b\x07\x1e\xe0\x52\xf1\x7e\x3e\x28\xc1\x06\x40\x5b\x28\xdf\xb2\x9c\xdf\x6a\xb6\x40\x66\x0b\x7c\xdd\xd6\xe1\x67\x5f\xce\xea\x5b\x5d\x3e\x22\x0d\x39\xf4\xba\xb8\xe6\x32\x61\xd9\xa3\x0c\xc2\x97\xf4\xf4\xdb\x7a\x06\x59\xd5\x25\x4a\xbd\x35\x4a\xfd\x77\x3a\x43\xfd\xd7\xa2\x95\x5e\xd4\xf2\x5e\xdd\x27\xda\x0e\xbb\x66\x2d\x46\x73\xfe\x2d\x76\xf2\xdc\x2b\x74\x3f\x14\xa0\x08\xed\x7f\x5d\x5d\xe8\x71\x82\x59\xa9\x5a\x83\x43\xb4\xbf\x4f\xed\x95\x88\x43\xd8\xc7\x7f\x3c\x80\x54\x6f\x58\x61\xb3\x59\xbb\x28\x86\x1e\x2c\x7d\xd5\xb5\x75\x99\x1e\x41\xbd\x5d\xbb\x96\x08\xef\xfe\x29\x65\x9c\x7d\xa4\xec\x17\x9e\xbd\xb4\x51\x16\xb7\x93\x65\xea\xee\xc6\xfd\x1e\x34\xf5\xc1\x07\xd1\xf7\x22\xf2\xfb\xa4\x8c\xad\xc3\x87\xaa\xbf\xb4\xf5\xda\xc8\xb2\x74\xf5\x07\x1b\xa4\xc2\x4b\xbb\x7c\xbe\x14\x8f\x07\xac\x36\xf1\x1c\x87\xff\x4c\x12\x5d\xed\x16\xa3\x3f\xe3\x75\xa2\x04\x8c\x85\xa5\xaa\xf5\x0e\x63\xa2\xef\x1a\xe0\xa5\xf1\xdb\x0d\x49\x46\xdb\x54\x7b\xd9\xb1\xa0\xdf\x8d\x2b\x07\x7c\x6f\xc9\xe1\xda\xa5\xeb\x73\x84\x82\xcc\xed\x30\x7a\x09\xd6\xd6\x0e\xfa\x7e\x40\xe5\x73\x0e\x4f\xdd\x3d\x77\x51\xc3\xdb\x73\x68\xdf\xc3\x75\x20\x47\x72\xb7\xdf\x3e\xe7\xf0\x5c\xb1\xcb\x72\xba\x85\x04\xfd\xba\x3d\x28\x9f\x1b\x81\x7e\xd6\x83\x0b\xa4\x4a\x65\xd0\x6d\x5d\xf1\xf6\x07\x29\x56\x75\xe5\xc8\x23\x42\xed\xb9\x1d\xe6\x53\x6a\xde\x50\x89\x8a\xbd\x49\xfa\xb8\x69\x5a\x63\x47\x85\xa3\x3f\x9f\xb7\x98\x6e\x3a\xab\xdd\xb7\x4b\xde\x32\x5e\xa4\x33\xec\xda\xb7\xd2\xb6\xbd\x8d\x67\x76\xff\x2c\xed\xb7\x87\x55\x9e\x2b\x16\xab\x53\xb0\x1b\x9a\x3a\xba\xf0\xbc\xc4\x9e\xed\xea\xd3\x44\x8f\xcd\xed\x8c\xc2\x07\xcc\xb2\x34\x4d\xdd\xce\x5b\xdc\x04\xf6\x48\x42\x8a\x9f\x5d\xb2\x4c\x8e\xea\xb8\x5a\x3e\xb3\x7e\xc0\x65\x59\xcb\x71\x54\x27\x92\x4d\xea\x8c\x7c\xbd\xc8\x2e\x30\x26\x80\x8c\xd1\xa5\x37\x53\xf0\xd9\xac\xdd\x11\x2c\xcf\x8a\x38\xb0\xf0\xb8\x01\x11\x12\x1c\xb0\x81\xec\x4b\xcf\x6d\xd5\x5e\xb7\x21\x3b\xc6\x83\x7e\xe0\x15\xcf\xed\x0d\x41\xb2\x81\xe9\x54\x08\xff\xb1\xb5\x0a\x67\x6d\xd9\x67\x91\x8a\x31\xf0\x26\x01\xe7\x7d\x8c\xd9\x19\xae\xa3\x00\xe5\xfb\x6d\x83\x41\x31\xde\x3b\xa6\x33\xb9\xde\xa0\x95\x4a\xb8\x89\x4f\xbb\x20\xf3\x2e\xce\xae\xc3\xd7\xd0\x6f\x77\x1d\x5f\x9d\x99\x3a\x1e\x0f\x02\xf2\x4e\x61\xde\x47\x95\xdf\xf5\xf9\xf9\xe6\x0a\xe9\xe1\xee\xfd\x94\xc0\xa3\x45\xd3\xed\xda\xe8\x18\xea\x56\x45\x77\x80\xde\xdb\x72\x7b\x92\xc3\xf4\xea\xa8\xe8\xf9\xbb\x5a\x1d\xc2\xbc\xb1\x23\x0e\x67\xf5\xb7\xb6\xdc\x08\x53\xf1\x28\x77\xf2\xf1\x06\xce\xaf\x71\x96\x08\x53\x1b\x46\xe6\x79\x7c\x57\x43\x72\xcc\x7a\x15\x2e\x63\xcd\xe0\x51\xd1\x0c\xc2\x01\x94\xf8\xbc\x27\x27\x66\xde\x3f\x1b\xc7\xed\x11\x38\xd6\xf9\xf6\x31\x3f\x62\x91\x17\x48\x05\x9b\xd7\x6a\xe5\x04\xfe\x1a\x3e\xc8\x5b\xd0\xfe\x25\x5a\x9a\x6f\x12\x10\x0e\xf7\x29\xe9\x0c\xeb\xb3\xe3\xc9\xc2\xf4\x99\xf7\xa0\x4d\xf6\x38\xe5\x82\xa7\x91\xdb\x53\x3e\xdc\x0e\xfd\x10\x4e\xc8\x86\xe2\x3f\x55\x0c\x2c\xf4\xc7\xda\x15\x78\x22\xd7\x03\x46\x3f\x52\x27\x5f\xa1\x7d\xde\x88\x28\x98\xa4\x07\x08\x7f\x9e\x83\x13\xbe\x9e\x14\x92\xa3\x23\x7a\xa8\xd6\x02\x97\x9f\xb1\x5a\x25\x54\xfe\xbf\x91\x36\xd8\xc0\xe1\x0b\x13\x8e\x90\xb0\x75\xdd\xe6\x81\xc0\xf7\x95\xb0\x40\xc7\x7b\x8b\x91\x25\xc4\x7d\xdd\x8d\xc5\x3b\x21\xf3\xcb\x0d\x83\x82\xda\xb1\x13\x25\x42\x14\x19\xde\x5f\xb7\x4b\xfb\x46\xa0\xfb\x37\xa1\xd4\xa5\x8f\xf5\x62\xfd\xd2\xbc\x37\xd7\x11\x63\x93\x35\xa9\x0d\x7b\x43\xfc\x09\xad\x97\x38\xb2\x64\x60\x95\x0d\xf2\xa3\x90\x2a\x3e\x02\xe8\x4f\x68\x7e\xac\xee\xad\xe5\x00\x82\x67\x67\x68\xfb\x37\x1f\x7a\x39\xaf\xd1\x8a\xb0\x35\x58\x84\x74\x9f\xf6\x2c\x9c\xff\xac\x8d\x83\x4a\x78\x6a\xd6\x00\x3e\x43\x00\x03\x9b\xdb\x5f\xa0\x38\xea\xb5\xe9\x92\x1c\xb4\x63\x36\x1d\x90\x1e\x94\x0d\x78\xbb\x67\x6d\x9b\x20\x12\x4c\xe7\xc8\x7d\x48\x8b\x3c\xc8\xbb\xe3\x4c\xb1\x8e\x2c\x67\x74\x8b\x82\xb4\xe6\x19\x5e\xe8\x27\x2f\x15\xea\x3f\xb9\xa1\xf9\x93\x59\x81\xf5\x46\x20\xf5\x12\xe2\x3e\xda\x98\x50\xb4\x1b\x59\x4a\x2b\x1d\x66\xf7\x85\x7f\xfc\x3f\x99\xc1\xfb\xeb\x03\x91\xfc\x83\x5b\xe4\xaf\xa2\x0d\x0c\xe3\x54\x79\x65\xeb\x33\x63\x9a\xac\x33\xcf\x55\x4a\x24\x2c\xe4\x2a\xd1\xe0\x8c\xee\x1a\xb6\x12\x39\x0a\x64\xd1\x90\x3f\xbf\xfd\xd4\x70\xac\xfe\x6a\x4e\x62\x70\x60\xc9\xc9\x7a\x11\xa2\xf9\x3f\x01\xe0\x3f\xf7\x80\xef\x9f\x81\xfc\xc7\x34\x33\x5e\xfe\x52\x71\xe6\xb4\x0c\xb9\xb3\xfa\x37\x90\x39\x2a\x59\x24\x49\x7f\x05\x22\xcf\x5e\x8b\x41\x10\x2a\xce\x40\x6b\xc6\x5f\x95\x90\x15\x33\xb2\x2f\x44\xc5\x4b\xfb\x75\xc6\xd5\x04\xaa\xbc\x6f\xdd\x8f\xa0\x07\x3c\x6e\xe3\xf8\x88\xd7\xdb\xed\xaf\x36\x2b\x57\xa0\x2a\xd3\xa8\x8d\xc5\x05\xbd\x08\xb3\x08\x4a\x3f\x9f\x7f\xe5\x41\x3e\x01\x20\xec\x3b\x63\x01\x77\x2c\x7a\x0a\x17\x67\x21\xb7\xc7\x21\xd7\xf8\xb0\x93\x07\xc1\x20\xb4\x9d\xdd\xe3\xda\x23\x9b\x99\x9f\x24\xff\x94\x15\x0c\x86\x49\x91\x8f\xc0\xf6\x30\xd8\x53\x72\x56\xfb\xad\x52\x5c\x88\x0c\x7c\x04\x27\x12\x94\xff\xb8\xcf\xab\xcc\x51\x96\xeb\x9f\x6f\xe4\xeb\xf0\x70\x8a\xc2\xee\x66\xe4\xfe\x9d\x31\xe5\x2a\x6d\x00\x4f\x6d\xce\xed\x63\x0a\x43\x30\xf2\xfc\x2a\x97\x9f\x0e\xc8\x5c\x8f\xa0\xb4\x24\x36\xc1\x79\xfc\x96\xc6\x83\xc5\x73\xd6\x05\xb0\xf6\x2b\x58\x07\xc8\x0d\xc9\x11\x28\x8b\x97\x47\x6d\xfb\x4c\x64\x29\x34\x32\x52\xb7\x71\x45\x98\xff\x91\x58\x22\x70\x0e\xa8\xf0\xfc\xd9\x3f\x45\x69\xb8\xa8\x04\xa2\x0f\xec\x12\xd4\x42\xe9\x62\x14\x5f\x00\xa1\x12\x14\xb8\x08\xed\xd5\x20\x6a\xc9\x3f\x14\xad\x06\xc8\x98\x65\x01\x90\x74\x29\x10\x40\x4e\x01\x5f\xde\xc3\x87\x7e\x73\xd3\xa7\x05\x0b\x98\x2a\x8e\xcc\xca\xa8\x67\xeb\xfb\x63\x00\x13\x15\xe0\x0a\x0a\x40\x47\xe4\xff\xf1\x16\xd6\x1f\x5e\xbe\xd2\x1a\x9f\x1d\x5b\xfb\x08\x06\x80\xa0\xe6\xc5\xad\x08\x09\x6b\x2f\xd5\x87\x17\x52\x8c\x09\x1a\x83\x3c\x1e\xd9\xa7\xe4\xa0\x49\x14\xe8\x14\x87\xcc\x71\xb1\x7e\x9e\xea\xaa\x01\xc8\x03\x79\x00\xf5\x37\x47\xa0\x97\xb0\x33\x98\xa5\x28\xe1\x6c\x00\xbe\xf3\x56\x60\xa0\x3b\xfd\xdf\x4d\x1d\x68\x1a\xe1\xfe\x0f\x40\xbb\xf5\x27\x62\x0d\x86\x2c\x80\x9d\xf3\xa4\x2c\xc8\x99\xed\x18\x5e\xe2\x0f\x3c\xfd\x2e\xe5\x89\x8c\x7b\x37\x6e\xd5\x78\x15\x54\xb3\x61\x84\xfe\x18\x5f\xb4\x94\x54\x86\xef\xe0\xa6\x23\xc9\x78\x04\x9d\xe0\x41\x36\x81\xce\xdc\x79\x05\xc4\xf4\x8f\x03\xb5\xad\x3b\x82\x03\xe6\x11\x40\x06\x39\x72\x58\x43\xc2\xdd\xf9\xb0\xc9\x7e\x93\x68\xc2\x9f\x0f\x5d\x16\x7b\xb8\x7d\xb3\x1c\x15\xb0\x8f\x51\x2b\xc0\x54\x73\x8b\x69\x18\x99\x01\x57\x58\xd8\x9f\xda\xee\xce\x20\xa7\x12\xb4\xe5\xc2\xc3\x2d\x51\x0d\xe4\x0e\x03\x74\xd0\xfc\x43\xbd\xaa\xa5\x77\x6e\xe3\x6f\xfa\x24\xe9\x40\x6f\x1a\xcf\x66\xd7\x13\x0a\xf6\xc1\x25\x37\x7c\x79\x96\x63\xd6\x0d\x9b\x1f\x86\xa1\xaf\xee\x6e\xf9\xdc\xf2\xfb\xe6\x51\xef\x9f\xf0\x75\x3c\x6f\x77\xcc\x0f\x7f\xfe\x9e\x1d\x87\x07\xf7\xb7\x01\xf5\xcb\xcf\xe9\x9c\xc3\x3e\xa7\x5b\xde\xc4\x25\xac\x79\x1b\xff\xcc\xfe\xa5\x3f\x83\x36\x84\x13\xb9\xf1\xfe\x83\xea\xd5\xbe\xa9\xf0\x37\x48\x0a\x39\xef\xe0\xc4\x9a\x68\x18\xf0\xbf\x73\xf5\x79\x99\x4a\xcc\x44\xc0\x59\x70\xca\x03\x20\x0e\xfe\x69\x25\x75\x22\x14\x1c\xbe\x68\xd0\x3f\xc4\x5a\x08\x71\x6b\x38\xd8\x3c\xc8\x5e\x00\x2e\x5a\xec\x85\x9d\x9b\xfe\x1c\x03\xbf\x34\x49\x95\x08\x8a\xd6\x9b\x6c\x84\xbd\xfe\xd7\x9c\x13\xba\x29\xa0\xac\x59\xc8\x9d\x32\x6b\x1c\xd0\x11\xf5\x73\x00\xbf\x2a\x24\xaa\xb1\x5c\xe9\x5d\x0f\x5b\xd5\xe4\x5f\x85\x79\xcc\x08\xde\xf2\xe5\xbf\xd9\x0a\xd5\xf3\xd5\xba\xda\x8d\x95\x40\x79\xfe\x4b\x2d\x9a\x0c\x22\x1b\xa1\x84\x25\x44\x21\xbc\xaa\x58\xef\xb2\x96\x9d\x92\x8d\x77\x51\xf7\x45\x1a\x37\x15\x2d\x1b\xbb\xd0\x98\xce\x84\xb7\xe7\xeb\x9c\x81\x28\xf4\x28\x51\x7f\x7a\xe3\x54\xe5\x65\x9d\x8c\xa3\x5f\x5f\x5b\x26\x43\x22\x51\x44\xe3\xc5\x1f\xff\x4b\x8e\xda\xf7\x3a\xfb\x4b\x59\xe8\x6b\x7c\x53\x80\xfa\xd8\xb9\xea\xf6\xaa\x26\x82\x2f\xb9\x9e\xbd\x46\xe8\x4e\x7e\x3c\x7a\x91\x44\x71\x51\xe7\x1f\xeb\xf0\x7b\xd2\xbe\x26\x35\xbe\x4d\x7a\xc2\x5e\xd6\x03\xbf\xdc\x60\xd0\x1b\xdb\xc4\x93\x85\x86\x89\x16\x4d\xc0\xa3\xf0\xcc\xf7\xf7\x1c\x59\x57\xf9\x3d\x55\x15\xb6\xa0\xcf\x44\x49\xa2\xb5\xfb\x5a\x34\x90\x38\xec\x82\x7e\x8b\x8f\xbe\xbf\xd9\x66\xf8\xf9\x21\x41\x6b\xbf\x58\xbf\xf9\x75\x79\x89\xea\xd7\x72\x82\xb7\x64\x76\x7f\xb3\x26\x69\xbf\x99\x7a\x1f\xb6\xe5\x74\xc4\x82\xfd\xd4\x2b\x5e\x7e\x02\x13\x83\xcf\xdc\xaf\x3d\x6a\x36\x29\xa2\xa8\x35\xa5\x9d\x5c\xc8\x9a\x70\xd5\xdf\x24\x98\xc1\xaf\x5b\x34\x29\x18\x42\x60\xc7\x65\xae\xd9\x29\x8c\xff\x16\xef\xbd\x50\xdc\x0d\xd6\x2b\xb4\x26\x79\x95\xc4\xe4\xf0\x08\x37\x00\x77\x6e\x5b\x95\x2f\x66\xfc\xc5\xe8\xb0\xbc\xb9\xb4\x41\x4e\xd8\x90\x69\x1e\xb5\x35\x27\xbd\xff\x25\xae\xc3\xbb\xa8\x7a\x3e\xba\xdd\x60\xaa\x1c\x07\xf4\x70\x92\x64\xe7\x9a\x4d\xec\x7e\x90\x00\xd2\x7c\x39\x52\x8c\xff\xc9\x44\xd1\x42\x31\xb2\xb6\xd6\x5c\x17\x71\xc7\x65\xaf\xba\x9a\x16\x43\x2f\x40\x27\x42\xa7\x95\x78\x0f\x67\x7e\xe3\x62\x77\x00\xdf\xe6\xac\x12\x1d\xfa\xf4\x12\x7d\x65\x75\x60\x41\x25\xd5\xac\xcd\xd5\xb6\x7d\x0b\x09\xc8\xca\x4a\x01\xf5\x23\xc8\x22\x80\xf0\xed\xf1\x4d\x2d\x14\x3a\xf9\xc6\x16\xe0\x3b\x8f\x6c\x76\x74\x6e\x37\xfb\x05\xbe\xa6\xb1\xc0\x0e\x5e\x47\x88\x16\x7b\xdc\xc7\x45\x50\xa3\x1e\x36\x15\x51\xd1\xa5\xd8\xed\x27\xf2\x72\x68\x9b\x44\xb8\xfd\x33\xba\x6f\x2d\x63\xd4\x08\x27\x6a\xb5\xdb\x1d\xbf\x8a\xe9\x70\xad\x40\xaa\x43\xda\x95\x2f\x61\x87\x3b\x65\xcc\x41\x0a\xe1\xbd\x02\xe0\x93\x6f\x6c\x28\x1e\x3d\x98\xa9\xed\x32\x9c\x0e\xc2\x91\xef\x2e\x28\x20\xe4\x45\xc0\x6d\x5b\xcc\x0c\x54\xbf\x29\x09\x27\xce\xc7\x12\x2f\x34\x36\x3b\x6b\xbe\x1b\x08\x00\x80\x85\x70\x9f\xf7\xb3\xdf\x82\x5e\xc3\xb8\x95\x61\xf4\xee\x07\xf6\x9e\x0e\xb7\xe0\x59\xda\x85\x57\x4a\xbd\xab\x49\xee\xc4\xe8\xfc\x39\x32\x40\xc6\x17\xfd\x0a\x07\xcd\xfe\xb0\x6e\x72\x04\x36\x79\x00\x89\xde\xfe\x6e\xcb\x7e\xf8\xb5\xa1\xc6\xed\xaa\x75\x40\xe4\x1c\xe5\x49\x88\xa7\x35\x9a\xd0\xb3\x8c\x31\x69\xc8\xcb\x76\x91\x39\x62\xf9\xe7\x53\x1d\xfa\x90\x59\xf4\xb6\x14\x7d\x1b\x25\x11\x0e\xba\x88\x2f\x7c\xa8\xd9\x61\xae\x13\xfc\x92\x0c\x19\x17\x4e\x9e\x07\x77\xac\x3f\x2a\x59\xa4\x42\x75\x06\xaa\xa1\x3d\xc8\x12\xd1\xc4\x85\x61\x93\xd4\xe8\xc7\x43\xf2\xdd\x8d\xcf\x0a\x7b\xfb\x81\xc3\x24\xa7\x3f\x2f\x9a\x2c\x5a\xa0\xad\x33\x6e\x96\x91\x2f\x83\xcd\xe0\xdb\x60\x67\x80\xdd\x3f\x55\x7d\xef\x22\xb3\x33\x8b\xfc\xb2\x3a\x29\x24\x4c\xd7\xfb\x4d\x5a\xa8\x3d\x08\x5f\xdd\xa8\x22\x68\x5f\xd5\xf6\x7a\xe8\x04\x0f\x25\x7a\x79\x58\x2f\xaf\xf5\xa3\x93\x13\x80\x7a\x37\x7b\xba\x65\xc0\xbb\x91\xd4\x3b\xca\x85\xef\x54\x14\x57\x51\xa2\xdf\x94\x0e\xbb\x4c\xb8\x4e\x37\x75\xe4\xc8\x58\xd4\xd8\x65\xd0\x27\x15\x67\xf2\xf5\x48\x5c\x3a\x05\xda\xf2\xcc\x4b\xb7\x4b\xda\xa5\x2f\xba\xd2\x3d\x98\x51\xec\xd4\xfa\x29\x81\xb2\xe0\x4c\xbc\x1e\x02\x1c\x7e\xa6\x40\x4d\xbb\xbe\x5b\x0f\x85\xf9\x2f\xde\x88\x1b\x94\xf8\x49\x83\x8d\xe2\x1c\x93\x3c\x92\xef\xd7\xa7\x3f\x4f\xe9\x6c\x8b\xb5\x2b\x3f\x3c\x6d\xe4\x14\x5a\xd0\xf0\x76\xec\xd3\xd4\xdf\x96\x18\x3d\x46\x03\xa8\xc3\x7a\xfc\x74\x2e\x76\xff\xc3\x79\xe9\xf3\xb2\xd1\x0d\x5b\xac\xdb\xfa\x42\xd1\xf3\x54\x81\xdc\x66\x91\x61\xca\xf5\x0c\xfb\x7a\x0f\x48\x7d\xd8\x80\xd9\xac\xea\xe2\xbe\xae\x36\x4a\x85\x08\xc2\xe2\x9e\x99\x58\x90\x35\xc5\x7a\xba\x23\x23\x0b\xaf\x1e\xdb\xb7\x85\xb2\xf8\xd9\x9d\xe2\xab\x8a\xc9\xe2\xa1\x3d\x2e\x9f\xa4\x6c\x1d\x8d\x76\xe2\x2f\x89\x38\x91\x90\x07\x61\x46\xf2\x12\x9f\x31\xf9\x78\xc6\x93\xef\x34\x17\x91\x5c\x7a\xad\x84\x3f\x65\x93\xf7\x9c\xc2\xa8\xd4\xa2\xe7\x33\x76\x56\x81\x03\x90\x5b\x8e\x5d\x18\x8b\x27\x38\xa1\x64\xb4\xd8\x44\x28\x54\xc2\xc1\xef\x2c\x97\x4e\xd5\x66\x3c\x2e\xa1\x89\xb5\x36\xc8\x5c\x7a\xb8\x89\x5c\x72\xaf\xc8\x80\xe4\x02\xaa\x1e\xd9\x31\x64\xcf\x40\x14\xa2\xf2\x63\x5a\x2f\x3a\xf8\xa0\xfe\x0c\x99\xc8\xa7\x94\xd1\xa5\x55\xf7\x84\x14\x16\xfb\xda\x27\x3d\xc2\x9e\xb7\xc1\xda\x33\x34\x5c\xa5\x58\xde\x31\x1c\x58\x94\x42\x94\x63\x2d\xf6\x29\x3c\xf9\xf3\x3e\x23\x54\xa8\xd4\xd9\x3f\xd3\x28\xf1\x72\x8c\x8f\x64\x53\x5c\x36\x45\x56\xd0\x4f\x01\x33\xb0\x06\x99\x18\xff\x7c\xec\x29\x0c\xed\xc2\xdd\x8a\xb9\xd6\xb6\x39\x2c\x07\x35\x12\x5d\x46\xf2\x56\x80\xf1\x1e\x53\x55\x99\xce\x6f\x09\xed\x6e\x6c\xd9\x45\x8b\xc5\x17\x18\xb6\x5c\x1c\x44\x41\xdc\x3f\x64\x72\x9c\x01\x1b\x21\xc8\x36\x9f\x7d\x48\xf2\xe4\x93\x7a\x8b\x58\xba\x29\xb2\x81\x8d\xf8\xe1\x4c\x18\xef\x22\x82\x81\x82\x75\x46\x97\x92\xca\xe0\x4a\xf0\x4f\xb5\x67\x41\x9f\xb5\x4d\x92\x35\xe7\xd5\xb2\x71\xef\x20\x91\x1b\x11\x7b\x9c\x2f\x5e\xcc\xfe\xf8\x3f\x34\x19\x65\xd0\x58\x75\x72\x59\x43\x18\xcb\x9e\xfb\xf8\xad\x15\x8f\xd4\xd4\x25\x38\xb2\x34\xd3\x8f\xba\xee\x69\x83\x81\xee\x79\x8b\x82\xd4\x32\x7f\x55\x85\xb2\x9b\x29\xef\x8c\x86\x6b\xe7\x0d\x91\x67\x39\x0e\xba\xb2\xba\x57\x41\xed\x85\x9d\x5a\xb3\x7c\x1f\x52\x68\xd8\xd3\xf3\xe2\x00\xeb\x10\x98\x45\xf7\xab\xf6\x4a\x51\xee\x2f\x98\x67\x91\x3e\xf4\xb4\xfb\xd5\xcf\x96\xab\x60\xbe\xaf\x1d\x84\x36\xb3\xc7\x11\x9c\x98\x47\xe5\xd7\xb8\xfa\xf5\xb9\xba\x26\x16\x6f\x67\xb6\x82\xa8\x60\x63\x04\x59\x13\xd0\xb0\xcd\x9d\xb8\x0f\xe7\x53\x87\x56\xac\x6d\x27\x8e\x5c\x77\x2a\x61\xee\x4e\x97\xf6\x7d\x04\x1d\x67\x51\x5a\x82\xaf\xe7\x3a\x6d\x17\x5d\x55\xb7\x91\x5c\xea\xea\xeb\x24\xe5\x8c\x5c\x1d\xec\xb6\xf4\x69\x42\x8d\xc5\xa9\x3a\x73\x65\xe5\x04\x13\xba\x2b\x95\xd8\xe3\x44\x00\xba\x8f\x76\xb0\x0e\xb8\xc2\x3a\xa2\x2b\x35\x37\xee\x28\x43\xcb\x63\x96\x9f\x83\xb3\xb5\xae\x78\x39\xdd\x59\x3c\x55\xd8\xa4\x2b\x1a\xbd\xbb\xd2\xb7\x44\x8d\x79\xa3\x75\x19\xd3\x38\xa6\xad\xa9\x3f\x63\x7f\x2a\x9d\xf9\x43\x32\xc6\xf8\x56\x41\x1c\x12\xf0\x62\xf4\xec\xb0\xfa\x4a\x9b\x1a\xff\x91\x80\x87\xf1\x5c\x66\x3c\x8d\xaf\xba\x3f\x6c\x65\xea\x8e\x01\xce\xe2\x49\x31\x58\xb6\xc1\x0e\x1a\xea\x21\x79\x89\xe2\x8e\xcb\xc2\xfb\xf2\x67\x30\x79\x76\xad\x63\x82\x35\xf4\xd6\x04\x40\x85\x95\xb7\xce\x96\xb6\xc6\x36\x2a\x6b\x38\x04\x21\x28\x58\x42\xe8\xd8\xea\x17\x85\x82\xfb\xf8\x2b\xfa\x92\xab\xc7\x93\x94\x62\x33\x83\xa2\xaf\x6c\xe3\x78\x67\x07\x55\x12\x10\x11\xc0\x08\xf8\xe7\xa0\x07\x29\x6b\xcd\xca\x3a\xe5\x50\x98\x11\x8c\xe2\x9f\x4a\x36\x3e\x38\x39\xce\x89\x48\xa2\x0f\xb9\x1e\x2d\xa3\xfc\x96\x11\x7e\x97\xa1\x59\x59\x19\x46\x2e\xc2\xc7\xfd\xf0\x10\x64\x04\xd9\xdf\x2d\xc4\xda\xb1\xce\x52\xd1\x77\xde\x8a\x9c\xa6\x23\xec\xb0\x4a\xcd\xf7\x89\x5b\x5f\x7f\x2b\x3c\xd1\xa7\xb8\x5e\xe1\xf5\xf8\x08\x3e\x91\xee\x08\xd7\x97\xe7\x39\xda\xaf\xb2\x52\x7e\x1f\x61\xec\x2c\x5d\x5c\x9d\x76\x74\x90\xb8\xef\x4f\x92\xff\x4f\x9f\x4e\xcc\xa0\x73\x1d\xaa\xfe\x7c\xde\xc9\x4d\xf3\x2e\xc9\xbf\x26\x81\xe0\xc1\x20\xe6\x53\xe4\xff\x04\xb2\x1f\x2b\x25\x51\xac\x6d\xcf\xf6\x8c\xce\x08\x3c\x9f\x4d\x69\x4c\xbb\x5d\x50\xef\xa9\x7d\x60\x8b\x95\xe0\x89\xaf\x94\x4f\x17\x7c\x1f\x02\x4e\x3d\x20\x81\x00\x48\xd3\xd0\x5b\xdf\xfc\x2f\x6c\x51\x3f\x10\xbb\x07\xc8\x7a\x9d\x11\x62\x7d\x0a\x7a\xac\x08\x25\xc0\x6d\xcf\x7f\x9d\x2f\xb8\xba\xbd\xe8\x43\x91\x0e\xfb\x2a\xe7\x21\xca\xc9\x3b\xfe\x30\x30\x85\xae\x6f\xd2\x10\x9e\x9e\xe9\xf6\x37\x68\xcb\x66\xd3\xe4\x20\xa5\x6c\x6b\x65\x1a\x6d\xdd\x2d\x1e\xbf\xee\x84\x56\x81\x1f\x74\x4e\x81\xf2\x45\x0b\xeb\xbd\xc1\xc8\x81\x26\x7e\x0c\x8b\xd2\xc1\xbf\x09\x43\x10\xf2\xaa\xab\xb2\x6d\x30\xa7\xca\xf2\xb4\xd1\x34\xb8\x47\x0e\x65\x4a\x15\xcc\x88\x3d\x5e\xe2\x00\xdb\xa7\x4c\xf5\x84\x97\x6e\xfc\x3e\x86\xad\x20\x0f\x75\x63\x0c\x69\x4e\xf1\xd9\x6f\x4a\x4f\x58\x47\x23\x1e\xa7\x4a\xfc\x19\x45\x5c\xb2\xc8\xb2\x4d\xc5\x28\x48\x4b\xbc\x7e\x2e\x9d\xce\x2f\x24\xf1\xd5\xd2\x83\xd3\x3a\x8a\x87\x41\x33\x86\xf2\xba\xcb\xd9\xeb\x7d\x20\x8b\x54\xfd\xfa\x29\x6d\x95\xee\x53\xa9\x56\x36\xb2\x6a\x86\xd6\x42\x58\x84\x5f\x3d\xc1\xca\x81\xe2\xf2\x53\xda\x83\xe3\x03\x66\xef\xb0\x55\x11\x5d\xdf\xa1\x8a\xb9\xed\xf9\x9f\x6f\xb0\x98\x4e\xb6\x0d\x96\x38\xef\x64\x98\xfa\xf6\x36\xa8\x5e\xdf\x0d\xb5\x6c\xde\x8f\x64\xcf\x05\xf8\x91\x68\xfa\x30\x42\xbd\x7b\x8e\x56\xa0\x19\xe9\xb7\x1e\x9c\x20\x2c\x41\x18\x6b\x61\x8d\x2b\xc2\x56\xba\xf7\x76\x7f\x4a\xa3\x7f\x48\x7f\xdc\x9c\x6f\xf4\x95\xda\x47\xbe\x50\x12\xea\xb1\xfd\xca\xeb\x30\x58\x96\x10\xca\xc7\x83\x38\x53\xa7\xc6\x5a\x2f\xea\x74\xb7\x44\xce\x58\x5f\xb7\xab\xb3\x27\x0b\x4b\x21\x54\x0c\x07\xe6\x22\xd6\x40\x67\xc9\x3f\xdf\xe2\x66\xfb\xe2\x01\xbd\xb3\x57\xf7\x5a\xcc\x35\x71\x77\xf8\xfc\xb4\x05\xd7\xba\xf4\xa7\x7e\x48\xe2\xd3\x04\xf8\x00\xa1\x48\xe4\x26\x9b\xe3\x8b\x62\x24\x0e\x19\xbc\x53\xb3\x98\x48\x6b\x98\x3b\xa4\xb5\xea\xe4\x73\x08\xb1\x6d\xb0\x8a\xde\xa9\xda\x5c\x48\x7a\x3f\x4e\x60\x49\x5d\xa8\xf9\x7b\x99\x5e\xf1\x34\xc9\x0f\x0c\x58\x99\x26\x60\x0c\xd6\x88\x99\x80\x85\x3a\xb4\xc1\x8f\xd0\x5c\x55\x04\x16\x7c\x24\xb2\x90\x0e\x67\x74\x3b\x1f\x91\x0d\xce\xf4\xf7\x07\xa9\x4a\x3a\x1a\xf3\x6d\x51\x55\x40\x2e\x24\x31\x89\xa4\x9c\x13\x62\x35\xce\x00\x3a\x5f\x09\x42\x90\x1e\x8e\x00\xec\x78\xd4\x89\x0c\xe4\x3a\xfc\x22\x2f\x49\x79\xbf\x34\x9c\x96\x36\x5b\xc0\x73\x1a\x49\xdf\x36\x40\x3e\x51\xb1\xa7\x01\x2e\x2f\x08\x4e\x89\xea\x59\x4e\x2d\xe0\xf6\x55\x5f\x12\x67\xad\xd9\xbe\xec\xba\xd0\xe0\xde\x72\x31\x31\x74\xc9\x70\xdd\xc1\x4d\x61\x51\xba\x81\xf1\x74\xcf\xa8\xe8\xa8\x22\x4f\xa7\xa6\x2c\x8d\x98\x56\xbc\x07\xa1\x29\xce\xad\x5d\x01\xbf\x6c\xd3\x29\xd9\x95\x06\x0f\x79\x58\xd0\x36\x53\x55\x6e\x43\x38\xdf\x61\xb7\xc7\x02\xb6\xb7\x86\xb0\x22\x85\x36\xd9\x1f\xaf\xed\x34\x8a\xa5\x6d\x13\x4b\x9e\xa2\x3d\xf2\x07\x0f\xb2\x81\x98\x77\x43\xe3\xe5\x7b\x7e\xf3\x28\x83\x81\x91\x76\xb5\x2d\x63\x24\x0c\x2d\x0f\xe5\x2f\x3c\xfe\x92\xa2\x35\xf6\xf2\xb1\x6a\x50\x05\x7b\x38\x71\xca\xd1\x9c\xbe\x2f\x6f\x3d\xdc\xc4\xc4\x9e\xda\x50\x9f\xe7\x7e\x12\xa9\xd4\x70\x6a\x4f\xf3\x25\x21\x65\x71\xe8\x28\x35\xd4\x47\xf5\xef\x12\x7d\x4a\xef\x0a\x2b\xe7\x26\x7d\xfc\x8c\x1c\xb4\xc0\x1d\x47\x5d\x27\x45\xac\x39\x69\x63\x19\x43\x58\x23\x58\xd8\x84\xed\x44\x83\x65\xc3\x2e\x58\x56\xbc\x46\x69\x6b\x94\xf1\x38\xb7\xaa\xd5\x33\x0b\xdb\x38\x79\x41\xdb\xdb\x65\x3a\x30\x56\x26\x5c\xea\x07\x2e\x4e\xe2\x69\x0a\x6f\x74\xc4\x00\x85\xbf\x14\x77\x1b\xd7\xcb\xd2\xe5\xb5\xb0\xf4\xf1\xdb\x05\x65\x4c\x4c\xbd\xe8\x19\xd0\xde\xbc\xaa\xc3\x21\xcf\x24\xcb\x78\x4c\x4a\xcc\x01\x8f\xed\x4b\x91\x1c\xaa\x2c\x19\xcf\xdc\x0e\x48\x30\x5b\x1e\x18\xcc\x9b\xfd\x9a\xf9\x83\x7a\x8f\x65\xf7\xc0\x10\xf2\x93\x58\xe6\xd7\xb6\xda\x11\x60\xb2\xa7\x6f\x0d\x32\x2c\x16\xcc\xda\xea\x50\x9e\xb6\xcd\xa9\x37\xdb\x4c\x5d\x65\x12\x7f\xb6\xd9\x99\x94\x0f\x39\x13\x90\xd6\x05\x3c\x7c\xf0\xc1\xa2\x11\xa7\x81\x19\xd0\x22\x0d\xfe\x95\xf7\x3e\x6a\x58\xd9\xd1\x79\x8f\x70\x2d\xf8\xab\x64\xad\x11\x78\x56\xbe\x15\x12\x8a\x30\x9c\x8e\xd7\xac\xbf\x66\xa6\x05\x62\x2a\x19\x5b\xa1\x5c\xe2\xe2\x66\x62\xdd\x26\x2c\x13\x0f\x22\x8d\x2d\xe1\x62\x6d\xd3\xb8\xb3\xea\x64\xa5\x19\x4b\x3f\xa2\x5e\xe5\xe9\xe4\xa7\x4e\x10\x64\xb1\xab\xe6\x1f\x32\x35\x80\xc0\x93\xc7\xf5\x9b\xc4\xc2\x92\x1a\x3a\x59\x58\x1e\xf0\xe0\x2a\x74\x6f\xf7\x4a\x75\x6e\x90\x95\x42\x5f\x3d\xb3\x53\x75\x82\x4f\x3d\x0a\x7e\x91\x86\x90\x84\xa5\x18\x20\x2a\xcf\xce\x3d\x9a\xe9\xff\x82\x18\x68\x16\x92\xa8\x2a\xb3\xea\x9c\xef\x5f\xab\xe5\x3c\x25\xd2\x09\xb4\x27\x81\x33\x2c\xf6\x42\x03\x2f\x3e\x39\x58\x7e\x6a\x8d\xd8\xea\xa9\xf1\x6e\x86\x91\xdf\x4b\xcd\x82\x42\x7e\xd0\xb4\x9c\xe4\xa1\x2b\x87\x27\x44\xd7\x39\x39\xcc\x81\x46\x09\xce\xcd\x9a\xca\xe1\x00\x99\xbf\xcc\x15\xc7\xbf\xbc\xfd\x9d\xae\xa1\xf6\x97\x56\xa8\xf8\x3a\x41\x8b\xbe\xb7\x7f\xf0\x11\x60\x81\xe2\x3a\xfb\xb2\x4f\xa0\x6c\xa0\x51\xce\xe2\x9b\x0d\x90\xd7\x8b\x45\xd6\x2b\x7b\x19\xcd\x39\x5b\xdc\xda\x38\xc3\x15\x5d\xb0\xb7\xf0\x9d\x17\xdd\x1a\xae\x1f\x08\xdf\xbb\xfb\xc1\xcf\xbc\x03\x23\x68\x3b\xbd\xfd\xa0\x31\x83\x3c\x0e\xb6\x4a\x78\x76\xd6\xd6\x8f\x1b\x24\xd8\x7c\x56\x6f\x80\xfe\x15\xf9\x54\x45\x2a\x48\x1f\xef\xe6\x49\xec\x9a\x9e\xbc\xeb\x2c\xb2\x0f\x79\x79\xc4\x8f\xf5\xeb\xcf\x20\xf7\xf4\xe6\xfe\x60\x0d\x46\x93\xcc\x8f\x32\xf3\x4f\xac\x6c\xc3\xdb\xc1\x09\xb8\x72\x7a\xe8\x7b\xbe\x1c\x7e\x88\x16\xe1\xc6\xce\x74\xb8\xfc\x0c\xae\xdd\xfc\x20\x1f\x4c\x9d\xe1\x67\x08\x32\xd8\xc1\xcd\x96\x55\x78\xff\x78\x4d\xdc\x5f\x94\x85\xfb\x87\xca\x6b\xb0\xe7\x89\x62\xdf\x27\xf3\x8f\x72\x40\x45\x48\xfb\x5b\xab\x17\x65\xeb\xad\xbc\xc9\xf9\x5e\xa3\xbc\x20\x0e\xeb\x5c\xe5\x90\x53\x4d\x43\x3f\xc9\x87\xb8\x8f\xbc\x65\x91\x57\xe7\x4a\xf7\x9a\x14\x50\x14\xf4\x93\xc4\x89\x02\x0b\xd5\x57\x70\xf8\x0d\x2d\xb4\x79\x67\x0f\xe5\xfe\xfd\xde\xae\x97\xdd\xc7\xbe\x28\x0d\x66\x18\xb7\x07\x2f\xde\x9b\x3a\x0f\xb6\xe9\xb9\x7f\x82\x75\x12\x79\x58\x60\x2b\x79\x50\x1d\xd8\xde\xa3\x43\x9e\xff\x82\x17\xb6\xb7\x41\x2d\x63\xc5\x08\x5b\xdf\x94\x38\x6f\x71\xc7\x54\x71\x79\xe7\x8f\x7f\x8c\xfb\xae\x71\xc7\x76\x04\x9f\x8c\xda\x56\x6f\xcb\x6a\x8f\x14\xc6\xe0\x6f\x8d\x0f\xef\x7b\x58\x72\xaa\x58\xf7\x10\x4f\x8c\x42\xb3\x6f\x8c\x37\x2d\x91\xd3\x6f\x5c\x34\xbd\x19\x05\x62\x79\x66\xa4\xea\x0d\xe1\x49\x98\x53\xaf\xe8\x7c\x66\x37\x34\xcb\x29\x27\x8b\xa5\xc0\x58\x47\xb7\x72\xa2\x17\x74\xda\x55\xa0\x34\x2d\xd1\xcd\xa2\x94\x7d\x6a\xe9\x17\x66\x17\xb9\x72\xb8\x58\x8b\x53\x38\x6b\xa7\x74\xbb\x49\x0b\xa3\x29\x03\x5f\x28\xa1\x73\x0e\xf0\x93\x8b\x12\x80\x55\x66\x3f\xc4\x3b\xf6\x4a\x73\xe5\x9b\x72\x36\xdd\x62\xa2\xe7\x42\x5f\xdc\xb0\xf5\x02\x34\x78\xf7\x12\x20\xdf\xee\x32\x26\xef\x78\x73\xe7\x82\x42\xb2\xd7\xb0\x46\x4f\x55\x1d\xb6\xa9\xd5\x10\x67\xd3\xc0\x9a\xc0\xff\xf6\x17\x96\x3c\x58\x13\x3d\xae\x2d\xc8\x5f\xd7\xca\xf1\xe1\xb8\xb8\x86\x71\x5c\xa0\x53\x23\xf8\x14\x09\x57\x42\x91\xd6\x5f\x3a\x49\x0f\x06\x2f\xad\xa3\x3e\xf7\x81\x6c\x5f\x9d\xe8\x71\x36\x90\xce\x84\x34\x0c\x5a\xbb\x8d\x08\x83\xbe\x0e\x4a\x61\xc9\xcb\x32\x16\xca\xd1\xe2\x64\x81\xe5\xd8\x48\x29\x3f\x20\x86\xbe\xb2\x23\x82\x63\x81\xf6\xf5\x50\xf9\xc9\x94\xe0\x85\xd3\xe3\x14\x07\x40\x64\x98\xb4\x36\x7a\x37\x29\x7c\x45\xd4\x08\x66\xe7\x27\x8e\xc5\xe7\x30\xcf\x40\x42\x78\x44\x24\x64\xaf\xff\xee\xa2\x92\x61\xe6\x1c\xa6\x1b\x80\xa4\x85\x19\x08\x5a\xad\x34\x5c\xac\x01\x3a\x13\xfb\xaa\x03\x55\x42\x59\x6d\x2c\xc2\x13\x1e\xf0\x6e\x03\x7a\x9f\x24\x38\x2e\xa5\x1c\xf8\x25\x3c\xf0\x89\x2a\xff\x12\xac\x14\x3b\xee\xf9\x40\xf5\x75\xe3\x4a\xdb\x31\xd6\x75\xf8\x63\x20\x49\x0c\x4b\xa1\xbc\x98\x43\xb1\x99\x44\x65\xdd\xd9\x24\x49\x14\x38\x4c\x24\xb6\x53\xb1\x4f\x3c\x74\x7c\x16\xf3\x6c\x48\x9f\xa0\xd8\x61\x7e\xc5\x80\xb4\xb6\x7f\x87\x2c\x45\x0f\xd7\x25\x2e\x32\xc0\x39\x5c\xb8\xdc\x03\x39\x93\xf2\xfd\x79\x76\x60\xf2\x91\xfe\x8d\x7e\x2b\xf2\x0e\x12\x10\xe6\x70\x64\xa4\x07\x50\x1e\xe1\x4b\xad\xac\xa6\x31\xad\xbb\x90\xef\xf1\x96\xf9\x49\x2f\x12\x4b\xf7\x6b\x71\x9b\x25\xef\x08\x6c\xfe\x06\x3b\xa2\x28\x11\xed\xd6\x4b\xb7\xf4\xe9\xc8\xf9\x70\xf1\x95\x9d\xad\x4e\x94\xb8\x54\x1d\x31\xd0\x25\x8f\xde\x49\x5a\xc8\xb3\xdc\x4f\x7e\x28\x90\xa0\x4b\xa1\x67\x01\x62\x77\xc8\x13\x31\xcb\x9e\x93\x54\xe9\x1e\xa4\xbe\xf1\xab\xed\xc6\x2d\x15\x5f\xbd\x9f\xf6\xbc\x93\x33\xe1\x72\x17\xad\xec\x39\x8e\x91\x18\x62\x71\xd9\x3a\x86\x5e\xe8\x90\xff\x07\xa5\x92\xf5\xf1\xb1\x6e\x6d\x51\x82\x7a\x0e\x26\xa4\xfb\x71\x62\x6d\x96\x1d\x31\x7c\x3d\x44\xc7\xb2\x87\xaa\x11\x35\xec\x14\xde\x0d\x8b\xc0\xef\xca\x89\xb3\x2b\x72\xd3\x8e\xdc\xb2\xb2\xaf\x26\x0f\xce\xda\xfc\x8a\xb1\x6a\x2d\xbe\x1f\x60\x40\xea\x8a\x2d\x96\xb3\x47\x08\x65\x40\x60\xa6\xce\xa7\x48\x7d\xd3\x79\x39\xa4\x97\x51\xfb\x22\x63\xb0\x92\xea\x72\x9a\xc9\xc0\x50\xab\x93\xf7\x9d\xc7\xcf\x24\x22\x9e\x18\x3e\xa0\xb3\xc9\x5a\x03\x33\x41\x89\xca\x02\x76\xa3\x7d\xad\x32\x0d\xeb\xd6\x09\x13\xdd\xbf\x64\xfe\x11\x47\xc1\xdc\x19\x6b\x22\x8b\xb9\x49\x88\x76\xc3\x8b\x60\x65\xe0\x9a\x8c\xb2\x92\x26\x65\x4d\x87\x97\xc3\x17\xcd\xb9\xbf\x04\xb8\xc0\x42\x71\x4e\x5c\xb3\x81\x7c\xc9\xd5\x95\x2d\x44\x87\xcb\xb9\x6b\x64\xe7\xe2\xea\x6d\x12\x6b\x01\xb1\xcd\x7e\x89\x35\x3c\x32\xd6\x24\x62\xdb\x32\x8a\x02\x0e\xbb\x11\x7d\x89\x8b\x80\x8f\xfd\x72\x88\xdc\x76\x0c\x36\xdc\x2c\x8c\x49\xf9\x43\x8a\xbb\x82\xea\xe2\x0d\x4b\x34\xf7\x44\x74\xeb\x1e\xea\x05\x3b\x16\x62\x15\x90\xae\xc4\x86\xdd\xd7\x72\x3b\x91\x12\x37\x8c\x46\x8e\xa0\xc3\x6d\xaf\xa0\x06\xec\xcb\x18\xba\x94\x58\xc5\xaf\x3b\x03\x6f\x01\x86\x9c\xd8\x79\xe0\xca\x91\x0d\xb7\x78\xc7\x17\xc7\x66\xbd\xcc\xb5\x64\x70\xe6\xfc\x01\x43\x2e\xae\x43\xa6\x4c\xcc\xfc\x3e\x55\xdf\xa0\xbd\xde\x5c\x0e\x51\x8f\xc8\x1e\x46\x3d\x00\x53\x02\x34\x04\x51\xf5\x3e\xf1\x86\x7e\xd2\xd7\x38\xb1\xe4\x60\x53\xaf\x29\xb3\xae\xbf\xbf\x12\xe9\x6e\x47\xa6\xff\x0a\x92\x94\xb1\x12\xe3\x7c\x5b\x25\xe7\xdc\x1a\x56\x77\x81\xdd\x01\xc1\x94\xeb\xf2\x4b\x80\xbc\xdd\x9d\x28\x11\x80\xd8\xb6\x47\xe0\xdb\xf2\xf9\xa2\x89\x0e\xe5\x08\x3a\x9b\xdd\xb5\xaf\x80\x4a\x81\xce\x16\x73\x1d\x87\x2d\xf0\x4c\x44\x6c\x8b\xb7\xae\xf1\xd6\x1c\x01\xff\x14\x4a\x99\x32\xda\xe2\xf3\xad\x5b\x86\x3a\x8d\xc7\xc0\x7c\x6f\xfa\x70\x51\x0d\xad\x77\x0f\xa6\xdb\x60\x19\x55\x97\x46\x86\xdb\x2a\x0e\x9d\x5e\x0a\xad\xf3\x7d\x08\xc8\x1b\x28\x74\xd9\x49\x99\x59\x5c\xbf\x40\x89\xc1\x8b\xa5\xe3\x63\x0e\xb3\xd0\x99\x81\x38\x74\xc0\x2c\x88\x56\x96\x81\x06\x24\xc5\x66\x47\xbd\x63\x69\x2b\xcf\x2e\x4c\x8c\xc0\xb3\xd3\x8f\x8b\x65\x6c\xfe\x9d\xf9\x8b\x64\xb4\x67\xfb\x02\xf6\x85\xa0\xe6\xab\xef\xc8\x29\xb2\xbd\x3d\x57\x72\x5b\x4e\x03\xd0\x8f\x0c\x1d\x30\x82\x90\xcc\xbb\x8e\xe1\xa4\xb1\x17\xc4\x3b\x6e\xf8\x94\xb7\x65\xd3\xb2\x1b\x43\x0f\xec\x37\x24\x20\xcf\xc2\xa5\xfc\x31\x98\xa5\xa6\x6f\xe1\xe4\xd5\x1e\x00\x83\x1d\x80\x81\xc0\xeb\xac\xbc\x7a\x61\xce\xe7\x34\xbc\x4a\xbf\x9b\xe4\x33\xd5\xba\x1d\x8c\xa2\xca\xc7\xbb\x58\xed\xb6\xc0\xe6\x67\xf2\x8e\x4a\x5c\x34\xc3\xf2\x59\x3c\x5d\x29\x5c\x12\xf6\xaa\xa9\x84\x08\xbd\x77\x18\xc7\xa4\xe9\x13\xc4\xbc\xb9\x24\x6d\x7d\x33\x9d\x37\x61\xce\x5a\xc1\xe5\xa5\x25\xd6\x0e\xa9\x1c\xfd\x01\xa9\x17\x5d\xf7\xc7\x6e\x30\xa7\x26\x05\x9e\x71\xdb\xdf\xab\x23\x7d\x36\xc8\x07\xe6\x87\x8c\x67\xc8\x8d\xb2\x9b\x8a\xa4\x2a\xeb\xa1\xfc\x60\x08\x80\x91\xa9\x07\x79\xdf\x37\xf7\xe1\x87\x68\x49\xf7\x67\xfb\x39\xf2\x73\x62\x3d\xb3\xca\x33\xa1\xb2\xb9\xa8\x72\xb1\x69\x69\x73\x73\xd9\xda\x00\x32\xe3\xb2\x7c\xa8\x15\xba\x0d\x17\x67\x35\xdb\x90\x6d\x2f\x19\xfd\xf0\xad\x19\x0f\x11\xed\xea\xdc\xdb\xc3\x93\x6b\x95\x63\x7d\xf1\x75\x53\xfb\x64\x93\x44\x66\x1f\x5f\x3f\xc0\x59\x22\x2d\xcd\xae\xb5\x82\x91\xe2\x39\x95\xda\xc7\x0f\xaf\xba\x3e\x7a\x4d\x7c\x40\x19\xdf\x38\x97\x2f\x33\xe4\xd5\xca\xd6\xa5\x37\x61\x2a\x03\xba\xce\x17\x8f\xaf\xd2\xe8\xc2\xd3\x7e\x73\x75\xcd\x5d\x21\xd9\x58\x5b\x5d\xf8\x03\xb7\x75\xe6\x2e\x87\x73\xf3\x84\x26\x18\xd6\xea\x33\x5f\x63\xc8\x64\x6d\xf9\xf7\xb4\x67\xe6\xb6\xa8\x51\xb3\x92\x03\x5d\x94\x5f\xaf\xb1\x75\x7b\xe2\x58\x6f\xc9\xef\xf3\x05\xc8\x8e\xd4\x67\x50\xff\xc6\x6f\xfd\x51\x67\xee\x71\xb8\xb4\xb0\xca\x5e\x90\xbb\x17\xab\x4b\x20\xbc\xae\xa1\x2a\xb2\xe5\xa6\x54\xc6\x21\xca\xec\x73\x98\x02\xa5\x60\xf7\xe9\x57\xce\x52\xaf\xc4\x58\xae\x07\xcf\xc2\xdb\xdd\x72\x03\x56\xaf\x3a\xe4\xd0\x10\x29\xf9\x5c\x6f\xf3\x85\x09\xbe\x62\xc3\x2f\x39\x86\x58\xde\xe4\xdb\xd6\xa0\x57\x2a\x21\xda\xa0\x48\xc8\xa3\xa1\x37\xec\x41\x37\xd6\x4b\x83\x98\x9f\x80\x19\x7a\x96\x8f\x4e\xa9\xf5\x34\x58\x0a\xf2\xb1\xf0\x88\xbf\x93\xcf\x56\x90\xdc\x07\x15\x0d\x3b\xc4\xbd\x87\x7c\x1f\x84\xdc\x19\xda\xd3\xf2\xaa\x91\x07\xc9\x46\xad\xd2\xd1\xa5\xc7\x61\x8a\x81\x98\x53\x93\x34\xa3\xcb\x9f\xb9\x91\x64\x30\xeb\x07\x61\x5b\xea\x64\x0e\x79\xf5\xa8\x06\xb9\x9e\xd2\x57\xb0\x80\xbc\xa6\x93\xd8\xeb\x15\x69\xeb\x10\x39\xe4\x7a\xc6\xc4\x9d\x3c\xc2\x07\x49\x84\xf4\xfe\x91\x93\x0d\x6b\x96\xb4\xf7\x91\x14\x87\x5f\x51\xee\xe1\x59\xc1\x9d\xaa\x85\x9b\x62\x10\xf0\xca\xde\x8e\x90\x40\x61\x23\x5c\x79\x2a\x65\x70\xcd\x41\xa7\x10\xad\x50\x61\x5f\xb1\xad\x20\x0c\x86\xfd\x0c\x98\x84\x98\xed\x2f\xdf\x6c\xc2\xaf\x03\x9b\x74\xe3\x13\x7c\x32\x18\xdf\x33\x56\x82\x1c\xfa\x83\x43\xe7\x9a\xa1\x76\x13\xe9\x37\x9a\x42\x4f\x03\xdc\xa4\x49\xbd\xd3\x49\xb6\x77\xde\xef\x38\x05\xbc\x01\x64\x43\x17\xd3\x5b\x9d\x20\xeb\xd2\x4f\xda\x2f\x61\xa8\xd5\xd1\x00\x1b\xa3\xec\x57\x45\x7f\x20\xb2\xa3\x36\x48\xe8\x6b\xf9\xe8\xf1\xb6\xe9\xe9\xa9\x2d\xcf\x11\x10\x94\x95\xc1\x58\xbf\xb7\xec\xe2\x10\x6e\x36\x8f\xa7\x61\xb6\xc7\xaf\x34\x15\x1e\x50\x26\x29\x6c\xac\x65\x3a\xa0\xb0\x11\x0e\x41\xae\x26\x2b\xce\x23\x4d\x23\xd7\xe9\x14\x00\x16\xc4\xc3\x39\x5e\x9d\xaa\x4c\xe1\xca\xc1\x6c\x85\xe0\xb6\x1c\x8a\x6c\x02\x86\x94\xf4\x41\xf2\x61\x9d\x85\xae\xce\x3b\xf8\x89\xb0\x29\x97\x42\xfb\xc9\xc4\x9d\x04\x13\xb1\x9d\x70\xfb\xf8\x4b\x61\xca\x34\x2e\x6b\x85\xcc\x5b\xe3\x15\x7b\x5f\xdc\x4e\x3d\x7e\x41\xde\x85\x63\xbf\xbf\x64\x89\xf4\x7c\x06\x47\xf1\xeb\x67\x1f\xdb\x96\xea\x37\xc1\x54\xbc\x18\x43\x74\xe7\x41\xfe\x21\x8d\x80\x64\x5c\x2f\x83\x1f\x94\xb1\xf4\x3a\xb4\xf0\x17\x86\xcf\x93\x93\xed\x35\x6b\x4f\xf8\x05\x65\x7a\x25\x31\xe6\xf2\x80\x8d\x02\xaf\xd8\x8a\x74\xf8\x0e\x4a\x22\x54\x7b\x38\xf5\x80\x8c\xe7\x12\x64\xc4\xa8\x4b\x63\xbd\xb1\x3a\x0d\x61\x21\x62\x0c\x47\x4a\x60\x79\xf0\xcb\xb7\x11\xa7\xd0\x27\x41\x8b\x7a\xfd\x1e\x01\x76\xaf\x2b\x00\x8d\xb8\x32\xd5\xb7\xc4\xe7\xae\xa3\x78\x8d\x2b\x7b\x14\x8f\xed\xa2\xc3\x28\x9c\x67\xa6\x5b\x35\xa5\x91\x3d\x6c\xf9\x47\x1b\xa3\x8f\x68\x75\x0e\x94\x90\xf1\x88\xc7\xf6\xc3\xbf\x1e\xb7\xcf\x51\x65\x2b\x6e\x27\x69\x7c\x16\x4e\x95\x26\xfd\x6d\x81\xf4\x08\x56\x63\xb0\x18\xcf\x03\xc9\x00\x7b\x71\xf7\x3e\xca\xf2\x3e\xea\x8a\x3d\x54\x57\xc4\xdc\x86\x9d\x71\xf1\x4c\x74\xa4\x52\x77\xb0\x17\xf5\x65\x9b\x2f\xbb\x87\x83\xd1\xa6\xba\x82\xcd\xca\x05\x9f\x06\x6f\x31\xae\x39\xe2\x25\x8c\x34\xb1\x18\x79\xa3\xf8\x9d\xbb\x48\xf2\xe2\x7c\xae\x9f\x44\x53\xa5\x60\xb3\xdb\xd9\x5f\x5d\x21\xcb\xc9\x9e\xbe\x44\xab\xa7\x21\xd1\x67\xbb\x20\x73\x0e\xfa\xe5\x93\x7e\xa8\xa5\xf3\xc9\x15\xc8\xcb\xdb\x16\x93\x66\x52\x99\x17\x71\x1b\xd1\xc5\x84\xbd\x12\x66\x9a\x41\x1f\x84\x0d\x53\x1f\x64\x9e\x92\xa8\xd7\x51\x7e\xb0\x52\xa1\xc4\xb9\xfc\xf4\x3e\x7c\x2d\x97\xe8\x24\xcb\x79\xd3\xdc\x96\x33\x9c\x96\xce\x5e\x5c\x47\xb7\x02\xd5\x4d\x84\x6c\x91\xb3\x64\x8b\x5a\x4f\xcd\x97\x52\xfc\x96\x5d\x00\x51\x09\x8f\x19\x6b\x60\x62\xaf\xd1\x65\x29\x5f\x35\x22\x6b\x00\xac\xe2\x51\x66\xd1\x7b\xe1\xec\x72\x01\x55\xa7\x7b\x90\x55\x29\xb7\xa3\xb1\x97\x62\x2a\x22\x1d\x8d\x62\x5e\xe2\xe9\xe4\x8f\x8d\x66\x64\x62\xda\x05\x09\x1c\x15\x44\xfc\x79\x68\x1e\x7c\x8d\x64\x71\xbc\x84\x8f\xde\x4b\x46\xdd\x84\xf3\x5a\x30\x29\xfb\x6a\xb9\xb4\x77\xe9\x7f\x1e\x6c\x10\x82\xf3\xc8\xfa\x39\xcf\x1d\x97\x9f\xe5\xc7\xf9\x7d\x97\x5d\xe9\x94\x3d\x4a\xcb\xec\x97\x71\x3e\xc9\xf8\x9f\xcf\xd3\xfe\xf7\x00\xce\xf5\xc1\x4d\x24\x9a\xd1\x23\x9b\x76\x0e\x34\xaf\x16\xfb\xf2\x26\xe8\x87\x33\x13\xdf\xe2\x8a\x5e\x0c\xed\xe6\xf0\x2f\x2e\x7f\x61\x84\xee\x4c\x73\x71\x2d\xcb\xd6\x90\xc2\x24\x3a\x66\xf5\x48\xf2\x96\xf8\x94\x47\x6a\x82\x8d\x19\x96\x4a\x5b\x27\xee\x22\xfd\xc0\x66\xfc\x84\x32\x61\x02\x91\x55\x91\x8b\x8e\x01\x25\x53\xb4\xd5\xd2\x07\x9c\x9a\x78\x02\xb4\x6a\x06\x9c\xc4\x1e\x78\x96\xe8\xe6\xa2\xc5\xcf\x59\x0e\xb1\xf3\xfc\x12\xdb\xd1\x0e\x12\x01\x93\xba\x88\x02\xfc\xfc\x28\xee\x32\x13\x56\xbb\x57\x4e\x24\x6a\x99\x31\x79\xa5\x12\xf9\xb5\x2d\xb0\x28\x89\x64\xcb\xe9\xa8\xef\x9e\xb4\x67\x02\xe6\x8e\x0c\xcc\x97\x78\x95\x3d\x2f\x65\x68\x33\xcd\x63\x7e\x89\xc7\x38\x76\x32\xfc\x7e\x38\xd3\x12\xfe\xa2\x72\x7a\x02\x8c\x17\x2e\x79\x7e\x98\xf3\x74\x69\xaa\x95\x43\x03\xdd\x05\xa9\x78\x35\xf3\x52\xc0\x2b\x4f\xb7\x19\xd4\x46\x52\x25\x97\x8d\x66\xd4\x0b\x94\x80\xcf\xad\xfb\x4d\xb4\x82\xb0\xce\xe9\xa2\xcb\x82\xbf\x96\xfe\x8d\xa4\x20\xcc\x18\x08\xf0\x4b\xf0\x23\xed\x67\xdd\xe9\x6f\x85\xb5\x6a\xbf\xd5\xa8\xad\x27\x86\x10\x5a\x45\xfe\x4f\x7b\x22\xf1\x72\xfb\xc3\xd8\xc0\x90\x55\xcf\x19\x8e\x20\xca\x08\xed\xee\xff\xd3\x3c\x12\xc4\x4d\x00\xba\xab\x51\x14\x34\x53\xca\x16\x44\xcf\xc5\x85\xed\x16\x35\x34\x5d\x46\xe4\x78\x22\xc6\x76\xa3\x31\xb2\x7c\xb6\xba\x58\x4d\x4f\x3a\x4e\xea\xad\xe3\x12\x26\x5a\x58\xf3\xd5\x31\xdd\xa7\xcc\x3a\x49\x57\x47\x8f\x2f\xb5\x2c\xda\x1d\xae\xc9\xd9\x5c\x78\xb3\x59\x50\x6d\xa5\xae\x58\x98\x9c\x4e\x50\xde\xfd\x66\x9a\xce\x5f\x8e\x56\xd3\xe9\xc6\x0b\x34\x5c\x2a\xd2\xa5\x9d\x4a\x65\x6f\xce\xdc\x3c\xbd\x93\x86\x30\x45\x96\xaa\xbb\xc5\x96\x9c\x91\x4e\xf3\xa0\x27\xd5\xb8\xf2\x01\x99\x8a\xcf\x99\xa7\x89\xf8\xd4\xf0\xa1\x0a\x47\x29\x9b\x53\xc7\x9f\xe2\x1c\x4e\x75\xb4\x88\x81\xfe\xf0\x2f\xc2\xc8\x3b\x68\xb7\x18\x90\xf0\x98\x22\xbb\x12\x22\xd3\x7c\xb7\x1d\x7f\xc4\xbb\x7d\x26\x32\xb9\x4b\x84\x07\x24\x47\xb9\x63\x78\x70\x3d\x77\xe2\x0b\xa6\xbc\x2e\x3a\xa8\x54\xa5\x5e\x47\xb8\xf9\x1f\x96\xb9\x66\x3a\xe5\xf4\x8c\xad\xb4\x17\x27\x64\x4d\x64\x8a\xa6\xbf\xcc\x45\x02\xf7\xb3\xf2\x6f\x22\x24\xd2\x23\xe7\xa9\xc6\xf5\xb7\xd6\xf3\x26\x76\xda\x1f\x3c\x8d\x62\x87\x92\xf1\xc9\xfd\x7d\x71\x32\xee\x94\x3a\x5d\x1a\x15\x1a\x5e\xe7\x87\x9c\xc3\x97\x4f\x29\x9d\xae\x09\xb0\x1c\x5f\xac\xca\xed\x2f\x24\x94\xac\xb6\xbe\x90\x68\x7a\xb6\xf1\x2a\x9f\x22\x25\xa1\x57\xd9\xcb\xdb\x69\xa3\xb0\xcd\xd2\xb2\xd3\x0b\x06\x68\x9d\x07\xb9\x6e\x5b\x87\xd9\xbf\xc6\x4e\x38\xcb\x57\x7e\x13\x8a\x8a\x07\xd3\x1f\xd5\x57\xd6\x7a\xdd\x2b\x41\x36\x95\xfb\xd2\xf9\x0c\xd8\xcc\x2b\x01\x4a\x34\x17\x56\x59\x5f\x18\x2a\x82\x05\xaa\xd7\x37\xf9\x6b\xd9\x24\x5d\xa7\x07\x36\x0b\x95\x13\x7e\xcf\x59\xeb\xa1\xbf\xe7\x44\xe6\xd8\xef\x89\xf5\x42\xe7\x62\x16\x08\x11\x93\x09\xf0\xeb\xba\x02\x7e\xa0\xf5\x5a\x3e\x94\xfd\x66\x58\x87\x23\x48\x34\x5c\xfe\x4d\x21\xe5\xf2\xeb\xea\xc5\x22\x27\xee\x96\x39\x4c\xe3\x4d\xb1\xec\xc5\xf2\xab\xf4\x4a\x91\x2d\x85\xff\x54\x33\x96\x73\xf4\x9c\x8e\x36\x82\x53\x94\xdc\x22\xea\x5e\x72\x37\xd6\xdb\xce\x60\x5a\x56\x6f\x01\x5f\xb9\x44\x95\x44\x4c\x46\xb4\xc2\xa8\xd7\x5b\x0e\x40\xcc\xd5\x78\xea\xb8\x0d\xb5\xa4\xaa\x59\x3f\x86\x90\xd9\x78\x75\xaf\x6b\x0c\x4e\xce\x3c\xce\x0a\x48\xf5\xf6\x54\xa3\x18\xbc\xa3\x51\xdf\xe3\x75\xb9\x71\x09\xd9\x09\x7e\xff\x72\x62\x21\x45\x7f\x86\x5b\x7d\xc5\xb9\x3e\xa7\x60\x86\x3e\x6d\x24\xf9\xa2\x52\x3e\xe5\x39\x61\x11\x4d\x0c\xdd\xa2\x2b\xde\x76\x83\xdd\xf7\xaf\x76\x3e\xd4\x28\x8f\x9b\xca\x19\x3c\x55\xc0\x74\x1f\x37\xab\x53\x5f\xd3\x86\x8e\x1c\xc2\xe6\xfe\x7a\x68\x24\x59\xaa\x72\x86\xcd\x99\xcd\x92\xdd\x02\xd7\xce\x96\x97\x6a\x46\x7e\x7e\x44\x28\xe5\x0f\x7a\x79\x05\xe5\xb3\x1c\x82\xf6\x8e\xb3\xe8\x16\x7a\x01\x73\xa8\xb1\xd2\x3f\xe5\xce\x2a\x06\x28\x24\x73\xea\xdb\xe6\x9b\x91\x3b\x4b\x6b\xc1\x1b\x40\xde\x7e\x5d\x2c\x6b\xce\x77\xce\x3d\xda\xdf\x2f\xc2\xb0\x93\x44\x99\x05\x89\x30\xea\x67\xd9\xba\xd0\x97\xcf\x04\xc7\x34\x37\xe2\x86\x62\x3c\xae\x0b\x7c\xc3\x85\x07\x67\xa5\x5a\xd6\x70\xf5\x76\x4e\x22\x49\xc2\x58\xcc\x86\x40\x12\x2b\xe9\x32\x86\xcf\x1f\xce\xbf\xbf\x44\xdf\xb0\x9d\xec\x48\x87\x9e\x47\x41\x1b\xa6\xe5\x11\x68\x08\x19\x42\x0e\x70\xc0\xb8\xc1\xd7\x9a\xc6\x0b\xfa\xee\x33\xd6\x0a\xaa\x06\x5c\x61\x4f\xd6\xa7\x5d\x51\x3e\xf6\x83\x56\xe1\x2d\xcb\x25\x17\x92\x3b\x89\x45\x1d\x50\xb5\xb0\xa7\x59\xd8\x08\xf0\xd3\xab\x9a\x31\x68\x14\x67\xe4\x5c\xce\xa9\xd0\x13\x8a\x05\xa2\x6b\x3f\xb5\x5a\x3d\x94\x39\x57\x07\x18\x34\xfa\x71\xa3\xd7\xd9\x14\x0e\x63\x98\x7a\xe9\x23\x5d\x5c\x42\x15\x16\x87\x18\xfb\x7d\x01\x88\x31\xdd\xd0\xc6\x57\x50\x59\x83\x97\xea\x2d\x1b\x5f\xfc\x07\x03\x2a\x66\x64\x60\xd7\xb5\xac\x47\xe5\xa1\xc6\xd9\x88\x88\xe9\x23\x64\x93\xe5\xbd\x65\x2d\x65\x6e\x03\x4a\x71\xc3\x18\xd6\x40\x4e\x44\x4d\xfb\xfd\x31\xa9\x73\xfe\x1b\xe2\xf4\x61\x65\x77\xb0\x09\x78\x65\x89\x0f\xd0\xf0\xf3\x2f\x02\xb9\x5e\x84\x55\xbb\x66\x9b\x38\xaa\x8b\x24\x88\x06\x22\xf6\x87\xf4\x35\x01\xb4\x09\x3b\x94\x47\x48\xe9\x4d\xae\x8a\xcf\xc9\xf4\xa0\x62\xcd\x50\x59\xb9\x29\xf5\x32\x44\xc3\xbf\x07\x98\xac\x5e\x1b\x01\x67\x55\xb4\xd1\xd3\xaf\x72\x7f\xce\x58\x80\x61\x34\xbb\x29\xd8\x39\xf1\x05\x94\x01\xc8\x82\x3d\x0e\xf7\x26\xdb\x2a\x25\xc0\xc2\x73\xad\xcc\xd6\x1b\x1d\xeb\xe4\xd6\xd8\x3f\xee\x87\x1c\xcf\x44\xa6\xec\x61\xe3\x0d\x3e\x28\xf7\x0a\x36\x6e\xc1\x70\xd3\x52\xb1\x3a\x8c\x08\x5f\xb5\x54\xd6\x4a\x5f\x84\xdb\xec\x4b\x2f\xca\x27\x68\x47\x9e\x15\xf4\x94\xa4\xd0\xb7\x4e\x4c\xd7\x7b\xac\x01\x6a\x4f\x4e\x73\x84\xf1\x95\xf2\x4a\xed\x3d\x05\x7b\x54\xaf\x34\x9e\xc4\xd8\x84\xd8\x86\xc3\x53\xc8\xcb\xcd\x34\x3f\xcb\x37\x56\xd6\x62\xa7\xde\x2a\xfd\x03\x8f\x25\x09\xfc\xd8\xd7\x4a\x5e\x7f\x5b\xcb\xf6\x2e\xcd\x5d\xa3\x87\xd3\x56\xb1\x6e\xc5\xa8\x87\xa4\x08\x99\xc1\x69\x7b\x82\xe2\x35\x31\xee\x62\xe1\xd5\xe2\x36\x68\xb5\xc9\x6d\xc3\xe1\xba\x16\x56\x6c\x96\xb8\xc8\x50\xbf\xb7\x34\xd6\x4f\x16\x25\xb0\x41\x4c\x59\xea\xd4\xc6\x6f\x8f\x3c\x59\xab\x01\xbd\x4d\x5b\x43\xb7\xb7\xe7\xe4\xb2\x07\x54\xd3\xe7\x0e\x4f\x67\x1d\x4c\x14\x62\x43\x83\xf3\xd5\x27\x1d\x6e\xc8\x62\x75\xb2\xac\x07\x3d\x12\xc3\xe7\x66\x39\xb5\xb7\x29\x54\x40\x24\x2f\x04\x30\xfd\xcc\x9f\x40\xa9\x88\xaa\x89\x52\xa1\x26\xee\x16\x7b\xf2\xca\xfd\x89\x82\xab\x4f\x74\x78\x1b\xc7\x44\xf8\xb6\x00\x9b\x38\x50\x11\xdd\x99\xe2\x1f\x82\x22\x61\xf6\x56\x1e\xd5\xf4\x4d\x1d\x0e\xb0\x6f\xbb\x38\xe1\x1e\xfb\x85\x86\x2e\x35\x5c\x45\xfd\xe3\x2d\xd9\x8b\xaf\x2c\xb1\x50\xc0\xc8\x83\xe9\xe5\x37\xcb\x93\x46\x2a\xc1\x8f\x3d\x39\x71\x72\xfa\x6c\xec\xa3\xf1\x5c\x6d\x6d\x32\x8c\x2b\xae\xbe\x26\xd6\xac\xdd\x72\xa9\x52\x5c\x41\x15\xd4\xd1\xae\xcc\x15\x24\xdb\xea\x09\xf7\xf7\xe7\x9b\x7f\xd5\x5a\x6d\x7c\x87\x15\xdc\x3e\x2c\x72\x87\x23\x51\x75\xa4\xc0\xa2\xf3\x62\x6d\x30\xa5\x7b\x9e\xcd\x64\xb6\x1c\xd7\x6a\x7c\x92\xd7\xf8\xc4\x2f\x21\xae\x33\x14\x1f\x34\xc4\x3d\x73\x98\x92\x3d\x2b\x16\x18\xfe\x72\x89\x6f\xca\x59\x34\xb1\x27\xe6\x8f\x62\xe6\x86\x69\x88\xbb\xca\x85\x4f\x9c\xbc\xe4\x3c\xb6\x1f\xab\x39\xa5\x52\xf6\x74\xe3\x38\x1e\x83\xe5\x40\x22\x73\x60\x21\x37\x54\x4e\xee\xa8\xa4\x0a\x91\x48\xb9\xf2\x69\x79\xa6\x51\x3a\x6e\x4f\x16\xfc\xb8\xb3\xf5\x89\x25\x16\xa2\xe4\x64\xd7\xe6\xb8\xbc\xf9\xca\x6b\x22\x4c\x3f\xff\xfb\x27\xaf\x38\xaf\x7f\xc1\x6c\x15\xf5\x47\xef\x8e\x7c\x5f\x47\x3d\x4a\x8f\x6f\x06\x97\x5e\x1e\x99\x10\x78\xc3\x57\x05\x3a\x86\x85\xc9\x13\x38\xbd\xa0\x0e\xd1\x06\x06\xad\xa0\xfb\xe7\x7f\x28\x5a\x54\x5f\xbb\xb1\x0f\x2f\xbb\x61\x74\x0f\x2b\x7d\x50\xb5\xe6\x62\xa8\xb7\xba\x17\x92\x76\xdb\x29\x05\x5d\xc8\x1a\x61\xd6\x0f\x4f\xbc\xfd\xcb\x43\x4f\x0e\x79\x8a\x59\x60\x60\x54\x59\xc4\x5b\x53\x3a\xb2\x8b\x81\x38\x8c\x33\x38\x31\x9c\xa4\x5d\x44\x62\xca\x36\x62\xbb\x66\xb1\x5f\xc1\x6b\xec\xcb\xa1\x90\xe2\xbf\x96\xcd\xec\xc1\x09\xf6\x44\xa2\x55\xe3\xc0\xa0\xaa\x6b\xbb\x0e\xe4\xc5\xde\xbc\xdf\xc7\x4d\xf1\xbd\x19\xc3\x80\xfb\x8a\xf1\xeb\xa1\x47\x3d\x4c\xae\xb4\xd7\xa6\x52\x6f\x9a\x6d\x50\xed\x63\xaf\x91\xbf\x4e\x4e\x70\xf5\xd4\x03\x2f\x31\xcc\xfe\xe6\x75\x48\x61\xaa\x07\x35\x7b\x5e\x15\xa8\xe2\x84\xad\xde\xec\x54\x0f\xed\xa6\xd3\xdf\x0c\x72\x42\xb8\x99\xa1\x80\xd6\x56\xb3\x29\x61\x8e\xed\x4f\x94\x0a\x99\x3d\x0d\x51\x7f\xca\x96\x96\x57\x3f\x3f\x79\x13\xe5\xa7\x33\xd6\xb5\x93\x7e\x7d\x31\xe5\xcb\xee\x86\x01\x45\x47\xcd\x99\x73\xda\xaf\xfe\x26\x15\xcb\x43\xb5\x3b\xe9\xd8\x76\xb2\xf8\xdf\x49\xb4\xab\xb3\xee\x3a\xe8\xbf\x27\x7b\x64\x6c\x49\x67\x84\xe2\xac\x2a\x28\xdd\x16\x38\x0d\x67\x00\xab\x2e\xd2\x6d\xd9\x1f\xa1\x0e\x5d\x2e\xb7\x60\xf4\x7b\xb5\x09\x46\x7d\x74\x95\x41\xaa\xb9\x07\x94\xaa\xa3\x73\x4d\x07\x4f\x52\x72\x76\x97\xf2\xa1\x16\xb6\x53\x7c\x99\x6e\xd0\xb3\x4f\x04\x4d\x61\x3a\x64\xd0\x27\xcb\xb6\x51\x22\x34\x5f\xcd\x40\x2a\x74\xee\xe6\xdb\x05\xbd\x76\x2f\xd3\xbb\x12\x6f\x77\xff\x0d\x18\x7b\x06\xc8\x90\xfa\x9f\x7a\x73\xa8\x33\x90\xca\xfb\xc5\xda\x6d\x4f\xad\x89\xb9\x88\xeb\x22\xbb\xe4\x6f\x78\xa9\x2c\x00\x03\x2b\x86\x26\x78\xf0\xd1\xb0\x74\x04\xeb\x31\xfc\x88\x25\x08\xc0\xc1\x59\xb4\xc4\xe7\xb6\x12\x6c\x2b\xc1\x38\x35\x5c\x7e\xea\xf2\xe9\x0e\x86\xd9\xe6\x70\x95\x6d\x9c\xeb\xb2\x1d\x0f\xb1\xec\xa7\xf2\x77\x01\xcd\x09\x27\x41\xf7\xee\x63\x04\x34\x4d\x4b\x62\x2b\xe5\x06\x48\x8d\x5d\x8b\x5c\xf2\x56\x2e\xd3\x77\xd5\x79\x6f\x76\xe1\xd9\xaf\x2f\xf1\xaa\xcb\x57\xfb\x29\x7b\x89\xae\x6a\xdd\x7e\x35\x82\x2e\xbb\x5d\xd5\x44\xd1\xee\xe0\x6b\x57\x70\xae\x22\x55\x43\xcf\x36\x56\x11\x90\xeb\x35\x99\x1c\x63\x70\x0b\x82\xa9\x9b\xa6\xfa\xf7\xa4\x67\x64\xce\xb0\xe7\x13\x89\xa2\xab\x66\x44\x9d\x80\xd2\x1d\x56\xf3\xf5\x73\xda\x9c\x47\x24\x65\xb1\xdf\x3a\x1a\xdc\x6a\xdf\xac\x99\x5a\x87\x07\x2b\x3e\xa5\xe7\x19\xff\xe4\x83\xdc\xbc\x3f\x10\xf6\xf7\xa9\xbc\xd3\x4b\x8b\x8e\xb0\xb8\x0f\x8b\xb1\xb3\x4a\x7c\x59\x67\x9b\xda\xe4\xdc\xc3\x73\x75\x69\x6f\xee\x75\xdc\x94\xe8\xad\x36\xa6\x1d\x87\xde\x38\x7d\x65\x82\xb5\x45\x36\xde\x4e\xc4\x36\xd4\x81\x09\x7c\x70\xe3\xbe\x41\xe2\x12\xd6\x58\x2e\xed\x75\x77\x32\x22\x09\xa6\x2a\x92\x86\x1d\x44\x23\x51\x2e\x56\x3d\xbd\x13\x79\xf5\x0d\xb7\xe6\x6e\xeb\x4e\xc2\x08\x44\x3c\x17\x4b\xd7\x3e\x61\x57\xc5\xb3\x2d\xdb\x4e\x79\xc3\x16\xb3\x13\x25\x8a\x28\x81\x06\xaf\xb7\xc8\x7d\x0d\x9c\xdb\xea\x9c\x17\x8c\xdb\xca\xc0\x1d\x97\x93\x83\x3d\x7d\xf8\xa2\x66\x31\xdd\xbb\xaa\x0c\x2d\x9a\xbc\x29\x3d\x9a\xc2\xd2\x3e\x9c\xbb\xf5\x15\x0b\xef\x3d\x9d\xc5\xf2\xbc\xd9\xaf\x14\xf9\x94\x17\xa2\xb5\xe2\xae\xf7\xb8\xab\x9c\x71\xb7\xf1\x73\xe3\xbd\xf8\x5a\x0c\x93\xf5\x43\xa0\x95\xfc\x9f\x86\x72\x50\x6f\xa5\xe9\xf6\xdd\x83\xbc\x74\xbd\xce\xa0\xd0\x24\xa9\x26\xb3\xd1\xde\x07\xc6\xaa\xa3\x5b\xfe\x91\xad\x49\xb3\xf1\xd8\x6b\x37\xa5\xbf\x23\x5a\x5d\x44\x5f\x4b\x01\x6a\x72\x99\xd2\x1b\xf5\xdd\xc0\x8a\x6d\x71\xb1\xa6\x73\x5e\xb4\x60\x0d\x42\xf0\xe2\x29\xf8\x15\xad\xfb\x95\x49\x09\x9f\x87\x4d\xb9\xdf\x0f\xbb\xbc\xf0\x35\xac\xca\x52\x76\x89\x1c\x4a\x68\x5b\xc1\x6a\xdd\x19\x30\x5e\xb4\x5e\x45\xcc\x71\x94\x8b\x19\xc0\x7e\x5e\xa7\x8e\xae\xb2\x8d\xf0\xf9\xf4\xfa\x17\xe9\xc6\x20\x96\x7d\x29\x32\xb7\x28\xa2\x62\x3b\x1e\xac\xba\xda\x2c\x85\x54\x61\x58\x06\x8e\xc4\xb5\x57\x86\xf1\xcd\x28\x2e\xab\x6b\x09\x82\xd0\xb6\x07\x9f\x37\x6e\x50\xb7\x5d\xe7\x15\x45\xfe\x9f\x3f\xf2\x04\x14\xeb\x7d\xb0\x13\xe2\x77\x0f\x22\x1f\x21\x48\x0e\x4d\x65\x63\x5b\x4a\x73\x91\xca\x1c\x1e\x93\x48\xbb\xab\xcd\x60\x9a\x57\xf8\xd6\xea\xe3\x12\xad\x98\xc1\x16\xf6\x2f\x42\x2d\x90\x09\x1f\x38\xc2\x81\x75\x45\x1c\xb0\x0a\x70\x82\x37\xb1\x83\x8f\xb0\xed\x4c\x87\x9b\x13\xb6\x8c\xab\x61\x52\x8b\xc5\xee\xc5\x46\xdd\x68\x65\x08\x2d\x3e\xc8\x12\x76\x7d\x14\xbd\xb0\x95\x90\x81\x01\x6b\x78\x7c\x17\x41\x45\xad\xf5\x1b\x84\x5e\x9b\xe2\xa9\x48\xc4\x57\x56\x12\x93\xd7\xf1\x96\x63\x11\x65\x98\x11\x88\x3f\x54\x14\x48\x4b\x15\x41\x6f\x7d\xcd\x23\x66\x10\x6c\x4d\xe4\xbc\xa7\x8a\x20\x6b\xd3\xcc\x9f\x0e\x74\x65\x9d\xd5\xf4\x17\xb7\x0a\x12\x02\xa7\xf4\xb6\x62\x4e\xb6\xa9\x91\xfe\x77\x13\xa8\x6b\xf2\x86\x1b\x1a\x53\x40\x00\x8a\x0b\xf2\xcd\x69\xbd\xd6\xce\x03\xb0\x5c\xce\x00\xf6\xc4\xa2\x65\x5a\x7f\x96\x4e\xb9\xc5\x35\x40\xa7\x8b\x67\x7b\x66\xa2\xd3\x9a\xed\x0a\x12\x28\x90\x85\xf1\x6d\x76\x87\xfd\x05\xa5\x58\xb3\x3f\x8b\xbc\x72\xdf\xc8\xbf\xdd\xb6\x58\x1f\x64\x94\x48\x2c\x06\x73\x35\xdc\x03\xb7\xcc\xa3\xa9\x2c\x0f\x36\xf1\x3e\x4a\x1b\x07\x44\xe2\x49\x47\x25\xd2\x06\xe1\x9b\xd8\x55\xe7\x45\x1b\x39\xf3\x02\xf6\x9c\xf3\x48\xdd\x11\x42\x2f\x7c\xe2\x0c\x81\xdc\xfe\xdf\x29\x96\x70\xf8\x29\xea\x20\x12\xcf\x9a\x12\x85\x6c\x30\x8d\x55\x97\x70\xd2\x71\xd0\x8f\xfb\x5c\xed\x14\x11\x7b\x30\x37\xfa\x90\x89\x9e\xb7\x0d\x45\x18\x6d\xc3\xeb\x25\xd3\x8d\x30\x5a\x69\xa6\xf3\x14\x79\xf8\x2b\xa7\x6d\x26\xb9\x49\xc3\x9e\x91\x14\x63\x0d\x35\x0d\x86\xc3\xa2\x80\xb9\xa7\x18\xcd\xf1\x32\x15\x98\x9c\xb5\x0c\x79\xe0\x88\x47\xbd\x3e\xd2\x2e\x92\xdf\x22\x90\x4b\x33\xa5\xef\xbd\x09\xce\x8e\x33\xef\x77\x6b\xc5\x24\xab\x19\x29\x80\x05\x01\xbd\x88\x98\x1c\x36\x61\x60\x85\xf8\x49\x6b\xbe\x46\x10\x7c\x68\x72\xe4\x4d\x44\x69\x0b\xdc\x49\xd9\xdf\x94\x5d\x68\xde\xa3\xe5\x17\xc3\x2c\xf7\x2e\xc0\x4f\x6a\x32\xd3\x54\xb2\x60\x03\xf0\x20\xef\x92\x3c\xd9\x4d\xf2\x27\x34\x29\xd2\x87\xab\xfa\x5c\x59\x0b\x7d\xb1\x22\x1d\x30\x84\x12\x1c\x8c\x20\xfd\x82\xd9\x2d\xfd\x5b\x6c\xbc\xe1\xce\x90\x64\x6f\xd2\xbf\x10\x38\x05\xe3\x59\x84\xe7\x3d\x07\x11\x3d\x8a\x05\x16\x3c\x6b\xd4\xd0\x25\x72\x91\xa4\x99\x45\xaf\xea\x1b\x64\x8d\x4c\x6e\xf2\x34\xed\x97\x02\x9f\xdb\x32\x7e\xc9\x31\x34\x4d\x6d\xbd\xd3\x92\xca\xa9\x0d\x6a\x74\x64\x43\x3f\x9f\x41\xad\x0f\x63\x1f\x04\x7c\x4d\x9b\xf6\x08\xf6\x75\xfb\xea\x13\xc6\x43\x6f\xa4\x97\x73\x4a\xff\x8e\x0d\x0b\x78\x33\xe3\x4c\xf6\x32\x6f\x27\xcb\xf5\x9c\x5c\x7a\x1e\xa5\x19\xff\x53\x5e\xb3\x5d\x81\x83\x85\x9d\x33\x08\xba\x89\x74\x6a\xac\x1d\x28\xf1\x27\xb7\xfa\x87\x61\x17\x2b\x1f\x08\x65\xc4\x48\xbe\x75\x25\x59\xdb\x04\x46\x2a\x8d\x22\x57\x8f\xe2\x5c\x83\x56\xad\x17\x9c\xf4\x5c\x28\x83\x46\xb3\x05\x9e\x29\x96\xa3\x1f\xff\xef\xcb\xbf\x92\xe7\xb6\xd1\x08\x72\xd3\x4a\x92\xd3\x9e\x8f\x22\xde\xb3\x38\xd0\x08\x2d\x79\x91\xc3\x24\xa1\x80\x8a\x48\xa8\x5d\xd7\x4d\xca\x04\x08\x41\xfa\x14\x95\xc6\xc6\x31\xa4\x13\x69\xb9\x64\xfa\x93\xdc\x71\x83\x13\x15\x5f\xd5\xf6\xf1\x93\x0d\x2c\xc8\xfb\x9b\x48\x98\x6e\x19\xf2\xe7\xb6\x3b\xc4\xd3\x73\xdc\x29\xc3\x58\xc9\xc3\xa0\xe1\xb1\x43\xd7\x5a\xa8\x76\xf7\x63\x71\xe8\xda\x15\xad\x87\x13\xa9\x49\x0b\x9e\xf1\x03\x4c\x14\xa1\x4a\x20\xb1\x51\x77\xd2\x3f\x65\x16\xd1\x5d\xc6\x98\xfc\xe8\xb9\x19\x7b\xcd\x23\x11\xcb\xfb\xd2\x59\x47\xf4\xfe\x9c\xae\x5d\x39\x76\x9a\xbc\x02\x28\xf7\xc7\xa9\xe5\x42\x77\x82\x8a\x05\xcb\xc8\x90\x56\x9e\x75\x68\x6a\x02\x68\xed\x9e\x99\x12\x36\x4c\xc3\x41\xfe\xf5\x66\xaf\xfb\x2d\xf3\xb4\x99\x25\x5c\xce\xfd\x5d\x1d\x56\x0e\xdd\xfb\xdf\x42\x29\x0f\x5b\x84\x6e\x82\x7f\x5e\x07\x90\x42\x5c\x09\x35\x3c\x8c\xbc\x26\x85\xfd\xb2\x5b\xc1\x74\xbc\xae\x2d\xe8\xc7\x53\xee\xaa\xdc\x1a\x68\xda\x62\x59\x8b\xa2\xcd\xd0\x9e\x7b\xbe\x01\xd2\x22\x5f\xf4\x6a\x2f\xe1\x26\x18\xfd\xca\xcd\xb4\xb1\x59\x61\xa7\xab\xd6\xec\x01\xef\x4e\x80\xac\x89\xab\x0d\x10\x31\x0f\x05\x50\x8e\x57\xaa\xa1\x11\x1f\x3d\x34\xab\xb5\x66\x57\x0d\xb5\x53\xd3\xc8\x39\x55\x38\x38\xdb\x36\x3e\xa7\x4a\xd4\x2b\xa1\xe3\xa6\xd3\xba\x55\xd8\xfc\x83\x1d\x8e\xf7\x7d\x7f\x58\x31\x84\xe8\x86\xc7\x33\xde\x99\x3d\xac\x2e\x5b\x7f\x79\x1d\x2e\xef\x41\xfe\xd0\x5f\xb6\x8c\x08\x0e\xbc\xca\xe9\x50\xa2\x0b\x58\x1f\xee\x78\x71\x3e\x7d\x51\xc0\xe2\x42\x06\xa6\x99\xc8\x15\x22\xbd\xd7\x0f\x9d\x07\x0f\x9e\xde\xe7\x5a\x00\x15\x40\xb4\x51\x5d\xe4\xe3\xc2\x1c\x4e\x49\xf6\x01\x1c\x1f\xf8\xd1\x70\x15\xce\x9c\x62\x79\xa3\x2a\xad\xfd\xc1\xbb\x47\x14\xbb\x5e\x54\x8a\xfc\x10\x1e\xf1\x29\x85\x89\xce\x87\x12\xfe\xee\xe4\x79\x45\x10\x1c\xf2\xd2\xb9\x95\xb5\xc7\xbf\xa9\x3b\xad\x07\x8d\xc5\xf2\xcf\xd7\x58\xf7\x01\xf3\x28\x42\x30\x3e\xfc\x1b\x6c\x28\x3a\x12\xbf\xec\xe6\x5b\x7d\x22\x25\xfa\xe0\xf1\x68\xc8\x0b\x87\x9e\xbc\xf6\x0e\xa7\x00\x65\x64\x85\x2b\xf0\xe9\xfd\x07\x58\x96\x3d\x4d\x72\x04\x1d\x6b\xa6\xeb\xd6\xa1\xdc\x89\xd9\xa8\x73\x10\xc9\x12\xe7\xab\xfe\x9c\x7c\xb2\x03\x11\x7d\x8f\x8d\x8c\x1f\xf9\x7a\xe6\xe5\xe4\x2e\x1b\x77\xc5\x76\xcf\x3a\xa8\xe1\x26\xbd\xab\x91\xa8\x0c\x62\x3e\xb9\x9e\x6e\x3a\x4e\xd7\x61\x71\xf6\xb8\x1f\x94\x5c\x4e\xe1\x47\xf1\x73\xcc\x53\x10\xc9\x57\xba\x1e\x03\x49\x11\x29\xbf\xc5\xfb\xd1\xe8\xb7\x4f\xfc\x99\xed\x7e\xf2\x0e\xf4\x4d\x2a\xaa\xb3\xb7\xcb\xe1\xdd\xc3\xbb\x60\x09\xe0\x87\xaf\xca\x81\xef\x3d\xbe\x99\x0b\x5b\x90\x23\xe0\x43\x86\x20\x06\x93\xf7\xc8\x7c\x53\x4e\x48\x8c\x58\xf7\x00\x45\x7c\x64\x3f\x09\x34\x20\xa7\x0a\x96\x66\x2e\xe4\x97\x2f\xad\xf8\xda\x58\x3f\x63\xd0\xeb\xa3\xba\x5c\xf4\x52\xcb\xfa\xe8\xdb\x55\x78\xf8\x6a\xd6\x28\x8f\xce\xc7\x67\x94\x3b\x1b\x4b\x18\x9d\x86\x43\xf3\xdb\x8b\x87\x53\x01\x39\x62\x66\x5b\x93\xa1\xb7\xab\xa9\x71\xb4\x7b\x5b\xa6\x40\xe4\xcc\xdb\xb9\xe8\x47\x8d\x5a\xbe\x4c\xea\x79\xc7\x78\xe4\x76\x71\x1e\x24\xc3\x4e\xd4\xf9\xca\x39\x78\x43\x41\xa2\x96\x3c\xec\xe9\x75\xa8\xdb\x59\x57\x12\xce\xbd\xde\xe0\xe7\xde\x91\x97\x1e\x76\xa4\xdb\x49\x7a\xfa\x6d\xe4\x2c\x8e\x3a\x3f\x0b\x31\x89\xe5\xab\x3d\xda\x5e\x37\x38\xc1\xfe\x0b\x3e\x7a\xf0\x4c\xd5\x5a\x63\x1a\x0f\x69\x21\xcf\x06\x3c\xb0\x8b\xa0\xfc\xde\x9b\xf4\x29\x45\x6d\x60\x0f\xc7\x8b\x13\xcf\x95\x38\xe6\xd3\xf8\xaa\x66\xa9\x53\xc8\x04\x5b\x1e\xef\x25\x4b\x01\x94\xd4\xcc\xd1\x40\x6e\x5e\x39\xed\x20\xbf\x44\xc3\x2d\x44\x65\xb3\x5a\x39\xd9\xe7\x32\x04\xac\xd7\x3a\x27\xbf\x58\xcb\xf3\xe4\x7d\x62\xd1\x96\xf3\x5f\x9c\x96\x56\x82\x6a\xd3\x86\x30\x3d\xac\xe7\x22\x8d\x51\x7d\x4e\x5d\xa4\x41\x48\x99\xb9\x78\x25\x71\xbe\x48\xfa\x7c\x79\xd7\x17\x6a\x89\xb3\xf2\xe9\xdd\x79\x65\x89\x86\x04\xdf\x19\x83\x74\x17\x8d\x58\x6f\x89\x46\x8e\x98\x98\x5d\x1e\xe7\x95\xa2\x98\x65\xc2\x1b\xe9\x3d\x06\x14\x02\x08\x84\xff\x63\xc5\x0f\x09\xcc\x8c\x65\x01\xc4\xbd\x94\x6a\x4f\xfa\x17\x1f\xb2\x63\x39\xdc\xe9\x3e\xc2\x46\x26\xa9\xf8\xed\x26\xed\xa4\xd9\xc4\xe1\x66\xa9\x99\x91\x58\xd9\x1b\x8c\x39\x6e\x32\x38\xf8\x8b\x5c\x64\x85\x75\xac\xdc\x48\x37\xa9\x31\xba\xa0\x74\x70\xe6\x63\x5e\xeb\x44\xfa\xf0\x60\xc5\xe3\xd2\x4b\xd4\xaf\xda\xcc\x8a\x12\x1f\xad\x07\x9d\x66\x33\xdd\xac\x2c\x3c\xe7\xc4\x23\xec\x27\x95\x4c\xab\x2b\xb7\x06\xc5\x7e\xd9\x9d\xd3\x51\xf9\xf9\x09\x34\xa7\xe9\x21\xcf\xd9\x7a\x1a\x90\x46\x8d\xb7\xa8\x0a\x7a\xac\x3f\x64\xb3\x97\x7f\x3e\x23\x9b\xe5\xbe\x7d\x00\xb8\xe1\xdf\x0e\x27\x35\x75\x3b\x16\xeb\x37\xb2\xc8\xc6\x88\xa2\xb7\xd2\x8e\x06\x24\x4e\xfe\xe9\x65\x5d\xa4\x6a\x75\x88\x93\x79\xa0\x48\x47\x5a\x3e\xaa\x8c\xdc\x17\xa7\x0b\xac\xcc\xc0\x60\x84\xba\x2c\xaf\xf3\x38\xe9\x27\x41\x87\x5b\x83\x70\xae\xbd\xed\x47\x8f\xb1\x6b\x24\xa8\x30\x56\x02\xc6\x01\x3e\x9b\x6f\x37\x55\x11\x2c\x82\xaa\xa1\xb3\xef\xab\x0f\x2e\xcd\x65\x21\x69\x3c\x04\x50\x18\x2d\x2e\x95\x43\xec\x77\xe6\xf1\x18\x2c\x26\xee\xfb\xd6\x20\xc2\xfa\x14\x37\xd4\x14\xc8\x54\x45\x85\x1e\x00\x5d\x18\xbf\x8d\x74\xfd\x95\x7c\x0c\xb5\x4a\xe1\xda\x00\xaf\xf2\xf6\x70\xdb\xd2\x97\x67\xb0\xcb\x03\xf0\x32\x64\x76\xa4\x58\xcb\x28\x8b\x8c\xa1\xad\xd1\x10\x92\x09\x43\xdd\x7f\xda\xaa\x64\xef\x21\xd8\xf7\xee\xa2\x8b\xc5\xd6\x26\x56\x6d\x20\x30\xd0\xba\x7a\xa1\x45\xbc\x4e\x92\x91\xe0\xa2\x71\xa7\x30\xf5\x82\x51\x1e\xe0\x33\x68\xf7\x22\x98\xc2\x81\xda\x96\xd7\xbe\xf0\xc4\x87\x70\x05\x00\x23\xab\x64\x0a\x5a\xbe\x95\xca\x86\xbe\x7c\x5e\x03\xa7\xa7\x58\x63\x07\x62\x49\xf4\xd4\x8b\x37\xf4\x7e\x85\xf1\xa6\xb4\x0b\x76\x8f\x6d\x3e\x5f\xf8\x9c\xef\x1f\x17\xa9\xa1\x2e\xc1\xf8\xf7\x47\x1e\xff\x67\xbc\xf7\xc5\x9a\xfb\xfe\x19\x63\xe1\x74\xff\x54\x9d\x0f\xb7\xfa\x05\x4b\xd8\x3f\xf8\x93\xae\xbf\x24\x7e\xfe\x27\xd5\x42\xe6\xfe\xf9\x36\x70\xd8\x6d\x08\x7d\xd1\xb1\x62\x3f\xff\x24\x09\x65\x1d\xf6\x9a\xe4\xc2\xbb\xc6\xc2\xa2\x4b\x20\x50\xc2\xcb\x43\x1d\x39\x57\xa3\xf1\x9d\x1a\x33\xc0\x25\xea\xb5\x9e\xe3\x93\x07\x75\x97\x93\x49\x4f\x79\x0e\x37\x6f\xa2\x44\x2c\x3a\x1d\x9f\xe1\x5e\xbf\x48\xcb\x44\xbb\x76\x81\x04\x1d\x0b\x71\x37\xa5\xa5\x3b\xac\xe9\xe6\x74\x2b\x24\xfc\x82\x96\x20\xd1\x85\xc3\xed\xa1\x6c\x33\x8f\xa1\x89\xb0\x1c\x62\xac\x5a\xfa\xda\x85\x28\xc2\x85\xd4\x52\x8a\x06\x9b\x2b\xdd\x52\xc2\x01\x16\xc1\xf1\x37\xb9\x5e\xc2\xcd\xf9\x47\x9f\x04\xad\xce\x68\xa0\x2b\x1c\xc8\x25\x95\x54\xb4\x1e\x5f\x27\x47\x74\xb7\x13\x71\x92\x23\x9a\xcd\x15\x3e\x90\x54\xe0\x31\xea\x43\x7c\x02\xe1\xba\x2b\xb2\xf7\xad\x1d\x2b\x10\x8b\xc2\xda\x22\xec\x82\x93\x0b\x22\xa1\xfc\x61\xf1\x00\xf8\x75\x3f\xdc\x97\x85\xd1\x71\xea\xd2\x1f\x10\xe2\xd2\xb9\xa7\xe5\x4f\x07\x2e\xc1\xf9\xb0\xb8\x5f\xc2\xa5\xd8\x3d\xa1\xeb\x55\x70\x1d\x05\x04\x96\x77\x3b\x23\x7a\x3d\xf9\x53\xf9\xb2\x3e\xaf\xf4\xea\x62\xee\x3c\x7e\x55\x9d\x8f\x7e\xbe\x98\xc7\xb2\x01\xb1\x51\xfa\xfc\x4e\xc1\x74\xf4\x70\x7f\xab\x02\x88\x29\x01\x59\xbb\x54\x36\xb0\xbb\x5d\xdb\xee\x5b\x3f\x41\xfa\x1a\x6b\x6e\xef\xb5\x25\xb4\x46\x94\x6a\xd9\x48\x62\x4b\x62\x90\xd1\x13\xb5\x26\x7e\x40\x92\x4b\xd9\x5e\xae\x46\xa4\xf5\x72\xbe\x27\x71\x9b\x91\x4e\x91\xcf\x8d\x28\x05\x53\x0d\x0e\xc2\xeb\xc9\xdf\xb3\x9c\xab\x74\x17\xc4\xc1\x77\x1e\xea\xa1\x1f\xa1\xac\x43\x3c\x3b\x25\xe8\x69\xa8\xe8\x01\x42\xe0\x94\x9d\xdd\xa5\x2e\xa5\x5c\x50\x9e\x61\x33\x5d\x6c\xea\x5c\xbb\x32\xca\xb7\x69\x1a\xa0\x06\x29\xf4\xcb\x15\x4e\xc8\x96\x22\x53\xbf\x2f\x5a\xe8\x6a\xa5\xd3\x90\xaa\x34\xc3\x7c\xf6\x71\x1f\xce\x3c\x1f\xff\xb6\x39\x06\x54\xb7\x25\xd6\xd6\x37\x45\xd9\xd8\x3e\x65\x01\x80\xf6\xd7\xe5\x94\x6b\xc6\x7a\x90\x5e\x59\x94\x73\x3b\x49\xcd\x03\xf7\x11\x90\x0e\x5a\xe3\x8e\x6b\xb1\x3c\xcb\xe9\xf0\xb8\x8d\x42\x24\x61\xfe\x52\xd6\x09\x49\x05\xc5\xc0\x76\xf0\x77\x1d\x2d\x3b\xdf\xee\x28\x34\xb6\x20\x3a\x76\xd0\x77\x38\x63\xdd\xd4\xa3\x2e\x7f\xc2\x76\x63\x1f\xae\xf8\x4b\x87\xf3\x9d\x88\xf9\x87\xe2\x82\xfa\x34\x98\x04\xdf\xae\x69\xe8\x1b\xe9\x0e\xc2\x46\xb8\xde\x43\x3f\xa1\x1a\x67\x63\x32\x17\x26\xe4\x96\xed\xda\x54\x68\xd5\xfe\x10\x36\xb6\xf0\x29\x57\x61\x36\xdd\x84\xe1\x47\xf1\x24\x4b\xe2\x3c\x35\x57\xbd\xc7\x07\x58\x08\xbd\xa4\xe9\x40\x21\x90\xc1\x17\x2c\xf8\xa6\xf4\xbf\xb3\x1e\xe9\x6c\x23\x88\x2d\xd8\x5f\xa4\x68\x0c\x47\x62\xf5\xac\xec\xf1\x15\xae\x23\xb5\x6e\x9c\x91\xc1\x3f\xd3\x79\x6d\x60\x16\x84\x7d\xb1\x5c\x5a\xf6\x2c\x50\x97\x05\x14\x69\xf0\xb5\x40\xbe\x07\xa5\xa0\xd0\x28\x0f\x45\x05\x8f\x7d\xe1\x54\xe2\x04\x36\xdb\x6a\xa6\x2a\x87\xb0\xc6\xaf\x1a\x20\x57\xe8\x21\xa4\xf3\x2f\xfc\x88\xe7\x50\x3f\xf8\xa3\xbe\xfa\xde\x42\x12\x5a\x8e\xd4\x2d\xe5\x37\xdc\x61\x95\xf7\x00\xca\x8e\xfe\x29\x76\xbb\xf0\xa7\x06\x28\x8a\x7b\x96\xfd\x45\x15\x67\xac\xfe\xc0\xb6\x50\xbb\xab\x42\x02\x72\x2f\x0f\xa6\x50\x90\xb0\x2c\xbe\xf2\x2f\x76\x47\x69\xf8\x91\x3f\x2d\x7f\xe8\xad\x02\x3b\x2d\x72\x58\x15\x29\xf8\xe7\xc2\x7b\x67\xc3\xe4\xd9\xc7\x72\x10\x12\x49\x2f\x07\x82\x8d\xbd\xbf\x4d\x92\x29\x0d\x80\x99\x16\x96\xd7\xa4\x4d\x10\x7e\x46\x8c\x3a\x8f\xa0\x47\xc4\x59\xb8\xc5\xe8\xe7\x9c\x66\x5e\xc5\x4f\xb7\x60\xba\x57\x3b\x62\xed\x1e\xae\x95\x76\x03\x5b\x51\x71\x34\x24\x0f\x74\xbc\xd4\x4a\xe1\x53\xac\x8f\x1a\xa3\x90\xb0\x01\xe2\xe9\xfa\x01\x63\xf5\x3d\xf1\x50\xc7\xa9\x38\xb0\x29\xcf\xc6\x16\x0c\x92\xe2\x31\x32\x90\x8e\xa1\x16\x3b\x6f\x4d\x84\x9d\xad\xe9\xff\x73\xf5\x6e\x59\xb2\xea\x3e\x13\xe7\x7b\x0f\xa3\x5e\x6a\x54\xfd\x60\xc0\x09\xae\x04\xcc\x9f\x4b\xe5\xce\x5a\xab\xe7\xde\x0a\x45\xc8\xe4\xf9\xea\x9c\xbd\x90\x49\xee\x17\x63\xcb\xd2\x2f\x5a\x7a\xfe\xaf\xa7\xf8\xab\x40\x30\x96\xa8\x00\x68\x84\x47\x70\x21\x44\x0a\xc3\xcb\x04\x9f\xcd\x5c\x1a\x4a\xc0\x95\x71\x94\xbe\xef\xe8\x11\x5a\xad\x59\x03\x7b\x48\x32\x9c\x92\x19\x0b\xf7\x97\x40\x0c\x3b\xe3\xf6\xf6\x2c\xfd\xa5\x38\xcc\x2d\x58\x0a\xd2\x97\x95\xed\x22\x7f\x1f\x18\x02\x7c\xb2\x74\x02\x76\x81\xe4\xae\x34\xdb\xa5\x47\xa5\x4b\x2c\x1d\xd2\x4b\x8b\xdd\x8a\xe0\x3b\x84\x57\x52\x83\x6d\xa2\xff\x20\x41\x61\xeb\x8b\x68\xab\x18\xd1\x0e\xac\x02\x18\x6e\x11\x0a\xea\x41\x2a\x5c\x44\xa9\x15\x0d\xa8\xf0\x1b\x64\x65\x8f\x4a\xe4\x35\x99\x28\x90\x15\x30\x08\x78\x05\x76\x22\x07\x02\x0a\x1f\x5a\xc6\x8f\x2b\x90\x3d\x3b\xc8\xb0\x63\xde\x83\x4b\x86\xb4\xf3\x35\x7e\xca\x8a\x13\xb4\x57\x72\x0f\x51\x64\xd7\x67\xd6\x5c\x0c\x5c\x87\x59\x90\x2e\x9f\xa8\xb8\x8c\x0a\x21\x85\x56\x72\x88\x26\xbf\x28\x9e\x1d\x1f\x99\x1d\xd0\x6c\xce\x09\x95\xdf\x3d\xfd\x64\xe9\x7d\x27\xb9\x5f\x9c\x28\xac\x0d\xd8\x71\x49\xfc\x78\xb4\x9e\x52\xa6\xa5\x6d\x0d\x6a\x42\xa2\x92\x63\xa3\xcd\x07\x9f\x3c\xc4\xee\x2b\x00\x08\x84\x2b\x38\xe6\x00\xb9\x65\x92\xd9\x7d\x7b\x5d\xb2\xbd\xc7\x25\xcd\xa1\x7b\x7c\xe8\x21\xda\x04\x49\xb3\xc6\x0d\x32\x56\x68\xfd\x57\x22\x79\x61\xab\x7f\xbb\xb4\x83\x0d\x6f\xbe\x82\x1b\x1c\x5e\x50\x90\x97\xd7\xb0\x00\x57\x88\x0f\xd7\x5f\xc4\x1b\x64\xda\xf8\xe0\x47\x52\xb6\x8b\x23\xef\xc1\x34\xd8\x4b\x66\x1a\xbf\x87\x9e\x0d\xb4\x9a\x10\x72\x23\x16\x68\x3b\x9f\x9c\x00\x2f\x44\x06\x8c\x4b\x20\xb3\x1e\xb5\xe7\xfb\x1d\xf8\x81\xdf\x26\x30\xbe\xe1\x7d\x6c\xc2\xc6\x91\xe0\x0f\x16\x1f\xe9\x1c\xe0\x11\x30\x02\x83\x04\x82\x40\x0a\xb4\xfc\x7e\x85\x70\x62\xaa\xa6\x9e\x4c\x6e\x13\xbc\x28\x5e\x93\xba\x7d\x7c\xf0\xad\x01\x28\x74\x06\xb8\x02\x4a\x3e\xaf\xf5\x41\x72\x81\xbd\x2a\xbc\xca\x08\x0c\x29\x54\x4d\x76\x91\xe3\x5b\xb6\xd3\x66\xcc\x55\xbf\x40\xf2\xf1\x4b\xf0\x81\x80\x0e\x08\xdf\x30\x7b\xe8\x4e\x30\x07\x44\x7c\x03\x47\x80\xd1\xf6\x2a\x71\xfc\x2a\x0a\xe8\x8f\x86\x9d\xd3\x25\x74\x41\xd2\x38\x16\x35\x90\xdb\x79\xcc\x29\xe8\xe4\x5b\x39\xe3\xdd\xdf\xca\x1d\x99\x00\xe0\xc0\x3b\xac\x10\x21\xdc\x90\xb9\x63\xed\x05\x9e\x4a\xd1\x00\x10\x0c\xd1\x0a\xc6\xf1\x1d\xe9\xf4\x05\x78\x24\x6d\x20\x87\x72\x35\xd2\x4d\x3f\x3a\xe4\x4c\x3f\x8d\xcf\xb4\xf5\x27\x0f\xc4\x6c\xfa\xa1\x20\x87\x98\x18\x44\xd7\x55\xde\x8e\x30\x3b\x32\x0c\x24\x0a\xb3\xc1\xbb\x54\xdd\xc7\x6f\x55\xda\x7b\xe7\x94\x12\xcb\x2c\x1c\xd3\x59\xa8\x87\x6d\xad\x05\x56\x9a\x9e\x6e\x73\x4b\x73\x6c\x2e\xe2\x85\xd6\xe1\x9b\xa5\x2d\x47\xb2\x3c\x39\x79\xf1\x0d\xd8\xa0\xc7\xee\xd3\x35\x7c\x37\x4e\x41\xe0\x94\xc8\xa6\x2d\x2f\x08\xf3\x24\x21\x21\x0b\x82\x30\x04\xbb\xc9\xea\x99\x3e\x2f\xa2\xbc\x42\xb0\x19\x6d\x38\x37\xe3\xeb\xbd\x39\xaf\x85\x57\x48\x3c\x04\x80\x9d\x2f\x1f\x2e\xda\xf4\x89\xf4\x1e\x41\x96\xc5\xf8\x32\x28\x33\xeb\x55\x42\xe3\xe1\x5b\x56\x62\x48\xc3\x96\xe6\x93\x6a\x90\x1b\x50\xef\x52\x77\x8e\x08\x3c\xb3\x44\x3c\xda\xee\x6e\x9e\x83\x0c\x66\xb6\xac\x60\x4f\xed\x53\x88\xd2\xa0\xd8\x49\x4f\x1e\xb2\x7b\xe0\x1d\x07\x2f\x10\xc9\xe3\xba\xcc\x33\x9d\x0d\xd6\x0b\x39\xbc\xe5\x6d\x06\xaa\xc0\xf8\x5c\x50\x86\x59\xf4\x00\xe8\x3c\xd0\x6b\x0e\xb2\xd7\x1e\x14\x83\xe4\x29\x29\xf8\x24\x89\x8e\x05\xd3\x27\xd1\x9d\xfa\xcc\x7e\xab\xb5\x52\x70\xf9\x3f\x4a\xcb\x21\xb4\x6c\xaf\xa2\x42\xcf\xeb\x4c\x79\x27\xb2\x0a\xdc\x0f\xef\x4b\x71\xb9\x51\x54\x87\xe1\x7d\x1c\xf9\xa2\x59\x43\x3d\xea\x96\x5a\xbf\x4b\xab\x0f\x1f\x06\xa1\x80\x36\xd2\x14\x23\xcc\x7a\x7d\x57\x42\x01\xec\x00\xa6\x9b\x54\xb3\xda\x75\xe1\xcb\xb2\x5e\x3e\xb6\x6e\xf5\xc7\x1f\xc3\x94\xd6\x8a\x51\x49\xbf\xb1\xab\x30\xf3\x2b\x3d\x31\x2b\xc9\x6f\x6b\xdd\x5f\x79\x54\xeb\xcd\x79\x05\x07\xc3\x11\x20\xe3\x4c\xbd\x65\x0c\x54\x32\xd5\x68\xad\x90\x19\xf3\x25\xd1\x79\xc0\x40\x2b\x37\xe2\xfd\x5d\x11\x03\x5c\xfd\x88\x80\x75\xb3\x19\x1d\x62\x6f\xc5\xc5\x89\xbd\x04\x5c\xaa\x7f\xae\x82\x12\x99\x9d\x9b\x9a\xf3\x4b\x9a\x1f\x6b\x76\xce\x05\x15\xa5\xf3\x78\x87\x2e\x22\x53\xd5\xb3\x60\xad\x51\xbf\x73\x46\x04\x72\xac\x11\xe1\x6d\x8d\x6d\x6b\x12\x2d\xb4\xbc\x49\x8c\x88\x23\x96\x57\x6f\x33\xad\x50\xcb\xa7\x3c\xb4\x18\x6d\x2b\x6b\xa6\x15\x03\x9d\x98\x7e\x1f\xef\xd5\x55\x7f\xdf\xf7\x7b\xe4\xc5\xe3\x0c\x75\x86\xe5\x96\x6a\x42\xd2\x9f\xe4\x9d\x01\xd2\x7d\x14\x5a\x07\x87\x21\xcd\x22\x59\x02\x46\xe0\x8e\x96\x6b\x3f\x13\x6f\x89\x18\x08\x92\x9f\x6e\x4f\xa4\x99\x52\x09\xbe\x5a\x36\xf7\x62\x9f\x25\x4f\x63\xbf\x82\x2a\x60\xa7\x1a\xfd\xa9\xa5\x4a\x28\x61\xe1\xcd\x05\xc4\xa0\x49\x74\x2f\xc8\x6a\x59\xc1\xd6\x7f\x84\x4a\x74\x95\x62\x35\x52\x4a\x69\x58\x73\x97\x7d\x92\x05\x8c\x9b\x95\x86\x67\xfd\x8b\x80\xe0\xec\x35\xae\xdd\x3b\xf2\x9e\xf6\x37\x8f\xbd\xfc\x0b\x19\xe7\x63\x67\x35\x66\x56\x04\x3d\x40\x39\x3a\x73\xec\x0f\x66\x0a\xaf\xdd\xe2\x79\xa0\x74\xb7\x2c\x1e\x5b\x2d\xd0\x15\xb7\xb4\x96\x0f\xbc\x01\xc2\x0a\x38\xe8\x03\x7a\x41\x28\x2c\x9b\xa9\x0c\xde\xa5\x8c\x7b\x58\x56\x63\x21\x6c\x30\xcf\x1c\x29\x5b\xb2\xe2\x61\x98\x78\x45\x51\x18\xb6\xe8\x40\x33\xb0\x57\x53\xa1\x83\xc0\xf5\xec\xb1\x4a\xae\xc2\x16\x1c\xd5\x7a\x6b\x12\x95\xae\x3b\xb5\xb1\x33\xb6\xce\x4d\x06\x57\x6e\xf1\x64\x00\x69\x62\xe7\x20\xd5\x21\x06\x37\xe4\xc5\xfb\x35\x6b\xc8\x6f\xe9\x47\x74\x9d\xdc\x4a\xfb\x4a\x87\x99\x3d\x97\x7f\x5e\xdf\x2c\x11\xab\x83\x27\x35\x2f\xe9\xd6\x3b\x43\x80\xe0\x7e\xfb\x44\x22\xc1\x98\xe9\x83\xf8\x48\x0a\x4e\x60\xc5\x5e\x7c\x5b\x48\xab\x24\x06\x57\x42\xd4\x5a\x9c\x81\xfd\x37\x9a\xc3\xd0\xb6\x0e\xd0\xc0\x6e\xcf\x50\xa6\x55\x95\x74\x0c\xb3\x01\x07\xac\x11\x39\x5c\x4f\x2d\x11\x88\x85\xbd\x6f\x72\xd7\xeb\xc7\xad\x05\xbb\x3b\x50\x09\x20\x1f\x84\xe9\x9c\x12\xf2\x1a\x56\x7a\xd8\x17\x97\xdc\xa7\xf1\x21\xf2\x04\x36\x82\xb5\x61\xd4\xb0\xb0\x52\x9a\xd8\x46\xc3\xc7\xef\x9c\x64\xc0\xf5\x70\xca\xae\xbf\x41\x88\x28\x4b\x9c\xdc\x98\xfe\xfe\x03\x4c\x38\xbc\x0b\xbe\x24\xb4\x89\x3d\xd9\xde\xc5\xad\x99\x77\x8f\xf4\xf3\xb8\x6c\xb3\x0f\x8a\x71\x2b\xf3\x65\x3d\x14\xdf\xc4\x7c\xf9\x57\x4a\xe8\x84\xe0\x1a\xb8\x64\xee\x48\x8b\xfc\x03\xeb\xca\xd6\x4b\x74\x84\x4a\x29\x34\x34\x7d\x09\x31\x00\x28\x84\xcd\x15\xe1\x35\xe7\x3a\x04\xc8\xc4\x3e\xa7\xd5\xa9\x24\x5c\x85\x5d\xea\xb9\x86\xfc\xc5\x5c\x02\x64\xa0\xc1\x02\xf7\xc4\x7a\xa2\xa9\x7e\xb7\xcf\x1d\x5b\x9d\x80\x26\xa0\xd3\xc0\x1d\x95\x87\xa4\xb7\x35\xf1\xce\xec\x5c\xa4\xd9\x34\xe7\x97\xf0\x08\x60\x9c\xc7\x69\x91\x4f\x59\xdd\x31\xe6\x04\x05\x3f\x26\xb4\x9f\x29\x7b\x9d\x05\xeb\x98\xf3\x72\x91\xa9\xa0\x8d\x8d\xe5\x50\x22\x8b\xd9\x37\x27\x7d\x46\xc8\x35\x52\x81\x09\x39\x78\x2d\x32\xac\x35\xba\x87\x2c\xf6\x71\x3c\xeb\xf6\x70\xd3\xb3\x16\xbf\x04\x4e\x40\xaf\xe6\x50\xe1\xc1\xc1\x14\x88\x48\x5a\x23\x95\x16\x42\x73\xdc\x0a\xaf\xc6\x0c\x46\x09\xb7\xdf\xd3\xf5\x39\x03\x76\xa7\x2d\x76\xd6\x06\x97\x5e\x37\xb2\xc8\x49\x2b\x78\x05\xc4\x80\x7e\x95\x27\x82\x7d\xac\x07\xe2\x24\x84\xed\x1f\x1e\x8a\xa7\x14\x4b\x9f\x90\xce\xf5\x19\xf8\x9a\xd9\xe7\x8c\xd1\x28\x4f\x7b\x98\x1c\xba\xf8\xb4\x1a\x7a\x25\x0f\xcc\x4c\xfb\xee\x9c\xee\xb9\xb2\x8b\x8d\x10\x7e\x5a\x12\x42\x83\x45\x5d\x21\x90\x06\xbf\xa9\xc9\x8d\x47\x4f\x6a\x9b\x00\xb5\x2e\x12\x5c\x7b\x4e\xfb\x75\x58\xdd\xf6\xcb\x5f\x26\x3a\x6b\x9f\xf9\xdd\x12\x0d\x9e\xf9\x45\x70\x03\xfd\xe8\x78\x3d\xb2\x00\x0e\x5c\x07\x94\x93\x2a\x0b\x31\x5f\xbe\x3f\x7b\x2b\x17\x8e\xa7\x41\x97\xd9\x61\x4b\x66\xf0\xf8\x7e\x1a\x97\xe7\xe7\xfa\xb1\x85\x2e\xb7\x86\x60\x74\xfc\xb0\x97\xf7\x03\xa8\x25\xa7\xd6\xf4\x62\x67\xeb\xa7\x9e\x21\xda\xbd\x22\x08\x96\x47\xf0\xc3\xbc\xc4\x9f\xdb\x1f\xfa\x53\x90\x65\x4a\x13\xe3\x9f\xde\x93\x32\x4b\x81\xc2\x3f\x1e\x0e\x49\x17\x35\xec\x98\x9b\x37\x4e\x11\x7e\xc6\x87\xfc\x27\xfd\xfa\xf9\xfc\xd8\x2b\x80\x61\x85\x35\x6c\xfd\xba\xe0\xae\xe7\x2f\xca\x79\xfb\xbc\x22\x66\xae\xdb\x48\xec\x83\xe0\x71\x68\x6a\x87\x24\x66\x09\xa8\x00\x34\x81\xcb\xf8\x29\x49\x1d\x73\xc4\x2c\xf0\x28\x07\x9a\x88\xb9\x6a\xf0\x87\xbd\x22\x58\x8a\x6d\xc5\xc6\x82\x90\x9a\x35\xc6\x01\xaf\xad\xa9\x70\xef\xdb\x9e\x1b\x6d\x01\x45\xb0\x5b\x45\x22\xf3\x19\xca\xeb\x27\x36\x62\x4f\x62\xdf\x48\x8d\xbb\x01\x16\x58\xd2\x66\x0e\xe5\x90\xf1\x68\xe8\x10\x12\x0d\x42\xcd\x2c\xa4\xef\x4a\xc8\x7a\x45\x62\x6e\x83\x3c\xcc\x9e\x7a\x44\xee\x43\x6c\x0e\x39\x15\xf3\x0d\x6a\xb8\x15\xf5\xca\xea\xd9\x8c\x4d\x82\x7b\xb8\x98\x28\x19\x47\x8c\xde\x79\x6a\xec\x0a\x7d\xe9\x65\xaf\xb1\x7b\x04\xb0\xcb\x00\xe9\xf9\x8c\x43\xe9\xa5\xe0\x7d\x2c\x0c\x2e\x36\xb3\xf7\x64\x1b\x1d\x07\xb1\x5b\x24\x3a\x28\xf0\xd1\xb5\xba\x55\x33\x7b\xff\xf2\xd3\x8c\xfc\xc1\xb2\xd8\x47\xf4\x92\x63\x46\x49\xe6\x68\x53\x85\xac\x00\x24\xbd\x7d\xde\x00\x20\x9c\x67\xbf\x51\x69\xf5\x51\xe2\x49\x19\xbe\xfd\x2c\xfa\x48\x07\x2a\x1d\xc2\x4e\x1e\x5e\xbb\x95\xef\xf2\x4d\x69\xef\x85\x70\x81\xf7\xb0\x5b\xdb\xeb\xa0\x0d\x21\x4d\xac\x31\x21\xd4\x04\x38\xd7\x6f\x95\xd8\xbb\x9b\x14\x8f\x60\x53\xde\x58\x33\xec\x78\xf4\x93\x67\x92\xc9\xee\x42\xee\xdb\x7a\x01\xc0\x46\x0f\x6e\x2b\x0f\x6f\x6a\x69\xc6\xee\xd2\x9f\x44\xa3\xf2\x82\x1d\x72\x6a\x8a\xe0\xcd\xe5\x6f\x66\x2f\x45\x66\x40\x99\x09\x5c\x00\x1f\x43\x59\x42\x28\xf4\x1c\x20\xf2\xfc\x8a\xd1\xfb\x4c\x84\x35\xc4\xc6\x18\x87\xed\x9c\x86\xa5\xd6\x9b\xcd\x50\x1d\x1e\xd8\xb3\x50\x04\x73\x58\xf2\x3d\xea\x33\xd5\x47\xe3\xc9\x4c\xab\xd7\xe1\x13\xbc\x0a\x1f\x5c\x06\x8d\xc0\x4e\xc5\xc9\xe0\xd2\x2a\x9f\xe7\x35\x44\xaf\xa7\xfc\x2f\x51\xf5\xc2\x0b\xaf\x97\x13\x1f\x72\xd3\x4e\x81\x2f\xc7\x3b\xb5\x66\x58\xeb\x8f\x90\x48\x0c\x5a\x48\x32\x1c\xf9\xaa\x5c\xd5\xea\x04\xce\xd2\x89\x03\x84\x33\xb2\xcb\x64\x76\xbb\x5e\xd9\x9a\xc7\x6f\xe9\xa1\x6b\x94\x00\x89\xac\x9b\x3b\x61\xa7\xac\xaf\xef\x94\xbb\xdd\xba\x39\xb4\x42\x7a\x3d\x64\xae\xfc\x23\xae\xf7\xd1\x6c\x6a\x98\xb7\xfe\xb5\xc7\xd8\xc9\x2f\x82\x20\xbb\x60\x17\x99\xbd\x87\x10\xd6\x94\x3c\xdc\x47\xf4\x06\x6f\x93\x68\x99\x6d\x7b\xcb\xa2\xc2\x5b\x14\xc6\x68\x31\xa1\xdd\x56\x34\x6d\x72\x2c\x2c\x8c\xfc\x1d\x7a\x5b\x39\x37\x88\x44\x6c\x62\x7e\xec\xf9\x29\xab\x1d\xde\xc8\x08\xe6\x09\x19\x4f\xb8\x3c\xe3\x9b\x4e\x4b\x97\x3f\x27\xb9\x41\x41\x3a\xe3\xf5\x21\xb6\x34\x5e\x2d\x6b\x79\xbc\x42\xe0\xc0\xda\xc9\x18\xab\x56\x2c\xcd\x28\x94\xb8\xc3\x23\xbe\xc3\xea\xa9\x5d\x5e\x91\x4e\x11\x96\x16\xaf\x74\x2b\xd9\x11\x49\xab\x9c\x6e\xd4\x11\x74\xc3\x4a\xe3\xf1\xd0\x86\xb2\x84\xbe\xbe\xa4\xa1\x7e\x30\xaf\x1b\xdd\x0a\x85\x1a\x33\x9a\x3c\xe6\xae\x94\x24\xdf\xbd\x49\x72\x4e\x4d\x56\x1d\x57\xad\xd3\xe2\x03\xbd\xbb\xe3\x1e\xd4\xfa\x51\xb0\x97\x11\x47\xbb\xd1\xaa\xec\x6e\x9b\xd1\xcd\x61\x68\x6b\xf1\xe2\x58\xef\xcc\x3e\xbe\x6f\x72\x2d\xf8\x34\x49\x36\x9d\xd6\x80\xfe\xa4\xae\xd1\x2a\x1d\xf8\x59\xee\x39\x33\x9c\xf4\x60\xcd\x49\xdd\xfa\x71\x96\x80\xf5\x58\xfe\x48\xce\x1d\x8b\x9e\x04\xab\x32\xfe\xa8\xb4\xbe\xb0\xc6\x82\xe1\x5f\x4d\xd7\x53\x0f\x78\x04\x7c\x56\xbb\xb4\xd4\xad\x9e\x9e\x42\x56\xdd\x2f\x76\x3a\x59\x94\x2a\x7c\x10\x33\x20\xb5\xae\x23\xb2\x6b\x34\x95\x1f\xbf\x32\x69\xc6\x28\x65\xac\xe9\xb9\xbc\xdc\x05\x84\x06\xe7\xc8\x0f\x18\x93\xd5\x95\x8a\xdc\x1a\x13\xf5\x99\xec\x4b\xa5\x86\x32\xac\x16\x36\xf8\x00\x7f\x86\x34\x89\xa5\xb4\x20\x88\xc7\x35\x0c\x3e\xe9\x05\x8b\xb0\x0a\x0a\xd9\x86\x54\xa3\x80\x20\x7b\x27\x7a\xc0\xde\x74\xdb\xa3\xf5\xa4\x20\x3b\x59\xe2\x67\xc3\x44\xa6\x95\x96\xb0\x6a\x77\x56\x94\xd3\x03\x12\x8c\x4a\x54\x79\x20\xaf\x87\x6c\x03\xef\x91\x17\x11\x22\x76\x56\x54\x4e\x95\x60\x0e\x5b\xa8\xb4\x93\x04\x60\xa5\x2e\x0d\xb2\x28\x36\x6f\x75\x6e\x93\xa1\x83\x34\x0a\x5e\x71\xfe\x10\x5a\xb2\x8f\x4a\xe4\x3f\xd4\xdb\x51\x29\x34\x53\xfb\x02\x51\x8f\x60\x8a\xf9\xe2\xe4\x56\xc3\x36\xbb\xb5\xfc\xcd\x8e\xc4\xd0\x07\x12\x6d\xa2\x85\x63\x05\xb9\x4c\x60\xf9\xa4\x08\xce\xfa\x98\x1b\x53\xdb\xcc\x44\x49\x33\x6b\x35\xf0\x2b\xf0\x28\xff\xd4\xbf\x01\x8f\x42\x70\x0d\x6b\x16\x30\x10\x02\xf8\x89\x10\xc0\x23\x8a\x22\xed\x77\x69\x0e\x00\x87\x7f\xee\xba\x24\x96\xc5\x7a\xf7\x2b\x1e\x91\x39\xf0\x80\x97\xd7\xa3\xab\x1e\xec\xe0\xa0\xa9\x22\x14\x04\x95\xdf\xc9\x79\x68\x8c\x05\xb3\x1c\x3c\xe7\x66\x19\x89\x94\xf8\x6d\x90\xa1\x07\x69\x02\x0f\xeb\xa1\x78\x5d\x04\xe3\x4b\xc0\x0a\xfe\x10\x6a\x44\x8f\xb4\x3f\xc5\xa9\xa0\xbb\x04\x7d\x14\xb5\x20\x1c\x52\x61\x67\xba\x06\xa7\xe2\x96\xa7\x36\x5b\xc3\x57\x5c\x87\x2b\x58\xfb\x99\x17\xc6\x89\x12\xe8\x69\x93\x60\x43\xc0\x84\xb0\x11\x01\x96\x10\x06\x22\xe4\x65\x1a\x5e\x42\x78\x05\x07\x4d\x90\x4b\x70\x2b\xcb\x7b\xc9\x9a\x0a\x5a\x18\x96\x1b\xe9\xd8\x9a\xc3\x31\xff\x7a\x0e\xbb\xd0\x03\xbf\xcc\xa3\xe5\x0f\x1e\xe0\xeb\x6c\x09\x08\x7a\x73\x7a\xc7\x1e\xe5\x63\x41\xaa\xf9\x90\x64\x7f\x89\xfb\xa0\x41\x5c\x28\xd1\x89\x4c\x41\xfa\x23\x46\x28\xa3\xd1\x6d\x6d\x7a\x8f\x71\xcb\x5b\xf5\xfe\x16\x0e\x57\x7b\x75\x06\x44\x98\xf6\xac\x91\x97\xb1\x1e\x97\xe6\x4d\x49\x79\xbe\x19\xb1\x96\x0f\xcd\xe5\x47\x81\xc7\xb5\xa2\x52\x0f\xdb\x5a\x51\x50\x6a\xe6\x0a\x89\x84\x6e\x87\x66\x90\x1f\x01\x69\x78\xb9\xfd\xf2\xb2\x78\x8f\x24\x2b\xf5\x96\xe6\x1a\x10\xb6\xbc\x04\x15\xc3\x3a\x6d\x88\x50\x13\x03\x22\xed\x2d\xdc\x96\x25\xca\xac\xc6\x3a\x48\x1b\xe6\x6f\xe2\x43\x68\xcb\x0d\xcf\x11\x14\x10\x07\x44\xc4\x8f\x2e\x68\xad\x5b\x12\x09\x37\xb9\xe8\x3a\xda\x97\x45\xc1\x82\xc0\x46\x44\xf3\x3f\x87\xa0\x58\xce\x3e\x9a\x07\x65\x5c\xbf\xc4\x43\x21\x56\xfc\x60\xc1\xc9\x00\xb9\xff\x93\x0a\xbe\x0b\xaa\xc7\x15\x00\x56\x47\x92\xfe\x88\x0e\x7e\xd3\x08\xef\x44\x96\x6f\x6a\x78\x67\x65\xcf\xbf\xd4\x04\x1a\x7e\xbd\xa1\x39\x5c\xbf\x99\x28\x0a\x6b\xc5\x13\x1d\x70\xcd\xbd\x66\x35\x64\xcf\x10\x28\x36\x47\x4e\x84\x1c\x3d\x1b\xdf\x03\x92\xcc\xd3\xd5\x7f\x09\x35\x21\xd5\xee\xfa\x3a\x82\x0b\x60\xbd\xbd\x5d\x42\x70\xb0\xf1\xe5\x65\xf2\x7f\xc4\x0f\x0e\x9e\x30\xf8\x25\xc4\x44\x89\x03\xf9\x04\xee\x5a\xc1\xb3\x56\xf9\xad\x1f\xaa\x64\x27\x90\xa1\x40\xe0\x43\xd5\xf6\x15\xf0\x31\x94\xdf\x6b\x0e\x98\xc3\x6f\x69\x23\x8f\x0d\x58\xd1\x94\xdd\x4f\x02\x07\xbe\x1a\x97\x22\x68\x12\x47\x43\x83\x40\x68\xbe\x49\x19\xa0\x80\x2e\x91\xe4\xea\xbd\xd0\xc4\xd5\x91\x53\x50\x6e\xb5\xfb\x72\x58\x0b\xdb\xbe\x36\xb3\xb6\x72\x8b\x26\xa1\x80\xfe\x56\x5b\x10\x35\x68\x04\xf2\x01\x72\x91\x43\x7d\xcd\x0a\x8e\xfb\x69\x4b\xf6\xd6\x90\x3f\xf2\x57\x23\x5e\x58\x87\x36\x16\x64\x4b\x90\x85\xb5\x21\x2e\x22\xf9\xdc\x85\xe8\xaf\x33\x0e\xe0\x83\x56\x68\x05\x90\x95\x56\x51\x38\x6e\xb1\x78\x6b\xb4\xeb\x8a\x7b\xf3\x9d\x07\x07\x16\xec\xc1\x91\x16\x6b\x07\x6e\xd3\x9e\xc6\x85\xbf\xb8\x54\x3d\xaf\x1f\x55\xf4\x24\x4f\x2f\x49\xfa\xdf\x24\x19\x06\x09\xc5\xb3\x62\x2c\x8d\x9a\x91\x1a\x96\x0f\x6c\x8c\x5e\x6f\x13\x45\xea\xb9\xd1\xed\x56\xc2\x07\xfd\x95\x46\xbd\xda\x1d\xcc\x41\x69\x0e\x0c\xc6\x5d\x4e\x5a\x1a\x8e\xd8\x2f\x21\x34\x78\x18\x0d\x45\x42\xd5\x44\x0a\xd8\x87\x62\x3d\x78\x1d\x7e\x41\xb3\x13\xcd\xe8\x6a\x1c\xfe\x1b\xc1\x30\x64\x67\x5a\xd1\x8a\x4f\x3a\x84\xed\x3b\x47\xac\xdd\x42\xf7\xd1\xc3\x76\xad\x7b\xe9\xd4\x43\xea\xbe\x8f\xac\xcf\x01\xc3\xda\x71\x34\x83\xbb\x31\x55\x70\xfc\xc2\x7e\xf5\x1f\xbc\x8e\xa5\xe1\x41\xa8\x7b\xdf\x16\x05\xa7\x83\x5b\xf3\x8e\xbc\x86\x68\x86\xfc\xe1\xc0\x07\xc3\x63\xbb\xfd\x89\x43\xee\x2e\xbf\xff\xfc\xad\xb3\xcb\x55\x78\xd0\xd6\xcb\x29\xa2\x76\xbc\x62\xec\x10\xd9\x75\xfe\xbe\x27\x60\x99\x75\xc3\xd3\x8e\x4c\x26\x1f\x81\x19\x90\xc3\x7e\xd2\x20\xd9\xc6\xda\x1a\x99\x53\x6b\x28\x22\xa3\x9d\xf1\x14\x94\xdf\xf7\xcb\xe0\xda\xaa\x4e\x00\x78\x9f\xf5\x1f\xd9\x18\xc8\x26\x1f\x42\x64\xff\xac\x1e\x1b\x6d\x86\x90\x32\xfd\x25\xaa\x87\x07\xbb\x7d\xd3\xde\x7f\xa3\x9b\xd0\x7f\x40\xcc\xcc\x7e\xb0\x73\xd7\x83\xfb\xbf\x77\x84\xaa\xf7\x56\xc3\x55\xba\xd2\xfa\xdd\x61\x8a\x32\xfb\x82\x56\x51\x15\xc2\xe3\x52\x52\xb0\x99\xae\x81\x00\x85\x7e\xc8\x99\xf3\x67\xab\x01\xb8\x56\x8b\x57\xea\x71\xd7\xc9\xf3\x28\x1d\x67\xe4\xd7\x12\xb8\x0f\x88\x7f\x29\xb9\xdf\x43\xe0\x35\x9b\x39\x56\x50\xf5\xcf\x6c\xe4\x63\xf0\xc5\x73\xf4\xa1\xe8\xf5\x0e\x43\x8b\xbb\x8a\x1f\x57\x08\x8d\x6f\x0f\x65\xd9\x69\xf5\xcf\x18\xd2\xef\x2b\x1a\xbb\x62\x7f\x38\x36\x64\x4b\xa2\x76\xe0\xad\x01\xed\x58\x05\x4e\x3c\x7d\xee\x5b\x52\xff\x82\x4f\x30\x18\xf7\x5b\x05\xc7\x04\xaa\x80\x5b\x2e\x8b\x43\xc0\x3d\x52\x12\x8e\xcd\x99\x1d\x5a\x1b\x19\x16\x83\x0e\x60\xbb\xef\x08\x41\x24\x5c\x04\x20\x12\x3d\xa9\x31\xa3\x78\x5d\x18\x8b\x9e\x5e\x3b\xca\x9d\x84\x72\xfa\x84\xb1\x54\xb0\x56\x65\x78\x38\xf6\x5a\x37\x29\xf6\x5b\x25\xb8\xdd\xe4\x90\x70\x46\x9a\xf9\xe4\xc4\x23\xb1\xb5\x28\xfd\x4e\xb4\x95\xfe\xd2\x50\x22\xf5\x83\x92\xd2\x0b\x64\x45\x25\xca\x33\xb6\xa8\xe9\xc2\x84\xde\x46\x28\x41\xbe\x47\x6a\x6c\x11\x07\x8d\xf4\xc1\x20\xb9\x2b\x5a\x67\x8d\x30\x7e\x2b\x60\x35\x4e\x0a\x19\x50\x79\x70\x67\xd6\x26\x89\xf3\x87\x29\xd0\x0d\xc2\x76\xe5\xe1\x36\xbb\x2b\x71\x49\x97\x6f\x6d\x77\x6e\xb2\xc4\xb2\xef\x5d\xba\x40\xa0\x7e\x99\x3f\x74\x7d\x9c\x31\xb2\x77\x42\x5f\x34\xe0\x48\x9c\x51\x03\x90\x68\x55\x35\x6c\xfa\x40\x10\xf4\xd5\xba\xed\x97\x8e\x3a\x46\x35\xfb\xaa\x07\xbc\x0e\x08\x47\x1b\xe2\x4a\xdb\xa1\x37\xf5\x0d\x94\x98\x64\x02\x4b\xef\xd2\x7c\x9d\xf1\xfa\x59\xc7\xe8\x6c\xdc\x12\x8c\x43\xe7\xf4\x60\xe1\x50\x9e\x89\x99\xa5\x8d\x8a\x22\x1c\xac\xad\x1a\x72\x96\x3d\x08\xd4\x9c\xee\xa3\x70\x0a\xf0\xb3\xf1\x61\x05\xa1\x2f\x06\x66\xfb\x39\x02\x49\xfb\x72\x47\xd6\x58\xe5\xbc\x5a\x9d\xb7\xd3\xf4\x58\xd6\x7e\xf2\xc4\x25\x5a\x74\x0a\x7a\x8e\x28\x0d\xcf\x1f\xf7\xc3\x04\xf0\x74\xf5\x71\x1b\xba\x18\x6d\x46\xb1\xab\x4c\x86\x49\xf5\x38\x14\x9e\xfc\x34\xa7\xe5\x4d\x0f\x4b\x8f\xe0\x18\x9e\xf2\x54\x90\x06\xe2\xcf\xed\x94\x33\xbd\x29\x6e\xf1\x3a\x4d\xb9\x9f\xd6\x37\xd7\x49\xd7\xaf\x77\xa8\xc8\x23\x99\x92\x57\xca\x08\xe3\x38\xf7\x7c\x69\xdf\xa8\xa2\x45\x5c\xb1\x0f\x81\x78\x29\x5b\xe0\x3e\x26\x88\x2e\x0e\xb4\x06\x22\x28\x81\x46\xc9\x7f\x82\xa4\x5c\xb3\xf0\x45\x79\x97\xb7\x95\x8b\xcc\x47\x61\xd5\x66\xad\xcc\x6b\xa6\x37\x06\x36\xb7\x95\x1d\xad\xc3\x3d\xc0\x07\x28\x6f\x82\xdb\x3d\x7b\xd4\xbd\xe4\xfc\xf1\x01\x16\xb0\xe4\x04\x76\x53\xf7\x24\x11\x2f\x93\x28\x77\x31\xd0\xa6\x88\xa7\x19\x53\xb8\x26\x61\xab\xbe\xb7\xcf\x52\xf2\x51\x77\xb3\x5c\xcb\x94\x7b\x21\x64\x45\xb6\xdd\xc9\x3a\x66\x31\x5d\x76\xa4\xfe\x7f\x87\xbd\x86\xb9\x5d\x22\xc5\xa4\xbb\x9e\x72\xb3\x1d\xc7\x76\xba\xaf\xb9\x87\x40\x95\xde\xb8\x90\x29\xee\x7d\x9c\x99\xc6\xe0\xa4\x24\x6d\x15\x5f\xfe\x3b\xfc\xac\x4f\xcb\x31\x91\xd4\x8b\xd8\x63\xd6\xf5\x69\xd6\x78\x9d\x5b\x3b\x0d\xd4\x0c\xc1\x8e\x99\x3d\xc7\xa0\xea\x6a\x15\x2e\x61\xef\x5d\xeb\x72\xda\xa5\x4d\xbf\x71\x35\x7b\xf8\x78\x89\x93\x4a\x62\xe2\x76\xef\x8d\xa3\x20\xb0\x5f\x89\xaa\xf8\xd7\x1f\xa3\xb0\xbb\xeb\xcd\x0f\x2f\xa9\x17\x45\x9c\x96\x43\x20\x1b\xe0\x5b\xe6\xe0\xc6\x20\x2d\x46\x53\x6e\xa3\x6a\x5b\x6b\x09\x8e\x0b\xdc\x3f\xf5\x25\x7b\x98\xb5\x5a\x7c\x7a\xbb\x6b\x9e\xa7\xc8\xd4\xec\x02\x4a\x72\xf5\xef\x27\xa7\xd1\x1f\xe9\x38\xd6\x46\x99\xd7\x6e\xaf\xaf\xae\x45\x2f\x81\x0b\x43\x42\xde\xa1\x12\x21\x1c\x7b\x5d\x66\x19\xfc\x88\x76\x08\x3f\x1a\xc4\xa5\xb1\x13\x78\xc8\x0b\x02\xbf\xff\x18\xd9\x5b\xee\x13\x56\xe4\xb3\x78\x31\xf3\xfb\x2f\x07\x3e\xe6\x79\x6d\xf1\xcb\x40\x92\x87\x3d\x96\xaf\x8b\x80\xe0\xce\x47\x80\x64\x44\xa0\x08\x58\x32\x43\x33\xb5\xc3\x80\xf2\x81\x2a\xf3\x16\xc6\xaf\xab\x7f\x7c\xf4\x80\x8b\x09\xdc\x8a\x9b\x6d\x6e\x5c\x8c\x7a\x52\x6a\xbd\xab\xcd\x89\x6e\xe6\xe1\xbb\x46\x20\x15\xa9\x0b\x5d\xc3\xcc\x3c\x11\x2d\xff\xa0\x3d\x16\x32\x3d\xec\xf3\x77\x04\x5c\x66\x46\xef\xa3\xf0\xfa\x59\xa5\xce\xb3\x75\x30\x2f\x67\xa5\x3d\xe6\xe9\x19\xec\x66\xe8\x66\x29\x28\x01\x61\x61\xa7\xc4\x07\x1d\x1f\x23\xa2\x0c\x1d\xaa\xdd\x2c\x91\x61\xe8\x97\x08\x62\x32\x23\x82\xb3\x04\x0d\xc6\xea\xc8\x53\x49\xc4\x5c\x2e\x0d\xed\x37\xb0\xe2\x5d\x3a\xe4\xcb\xf9\x30\x88\x6f\x78\xd2\x54\x1e\x99\x59\x7d\x7a\x13\x4e\x02\x6e\x0c\xf9\xf9\x30\x7b\x26\xbf\x74\xe0\x83\xf4\x34\xe8\x31\xe6\x49\xfd\x97\x46\xd2\x15\x09\x83\x59\x87\xa4\xfe\x73\xe6\x4a\xb0\xec\xbb\xc2\x9b\xe9\x99\xeb\x1d\x52\xba\x79\x09\xac\x5d\x27\x35\x43\x38\xad\x34\xcf\xda\x10\x47\x90\x62\xc8\xb7\xb1\x2e\x86\x7e\x9b\x35\x88\x0c\xab\xfe\x4f\x46\x40\x64\xe6\x86\xb3\x01\x5d\xba\xc1\x67\x46\x51\x81\xf2\xa3\xc9\x7a\x77\x19\x51\x32\xbf\xf2\xfe\x77\x9e\x2f\x22\x6b\xfe\xcb\x64\x80\x9b\x4d\xa7\x4b\x97\xd1\x6d\xd7\x13\x04\x9b\x97\xcf\xac\x02\xb6\x05\x6d\x8f\x91\x77\xb3\x7f\xea\xb5\xc5\xf8\xd7\x19\x07\x9e\xae\x33\x8e\x3c\xde\xd4\x74\x09\xdd\x49\xeb\x8b\x48\x9b\x39\x2b\x68\x8d\x05\xc6\xb6\xb6\x22\x37\x91\x90\x12\xda\x69\x5d\x8c\x6d\x38\xbd\x86\xa5\xc6\x11\x85\x8b\x86\x09\x96\x66\xad\xa9\xd7\x1e\x24\xc4\xdc\x85\x38\x60\x17\x84\x64\x33\xa2\x6e\x48\x91\x06\x43\x8b\x47\xb3\x46\xfa\x56\x97\x16\x39\x2d\x21\x0b\xae\x63\x9d\x67\x8a\x7b\x71\x2d\xff\xb6\x74\x69\xda\x93\x76\x26\x39\x49\x07\xe5\x68\xcb\x2e\x7e\x40\x9d\x4b\x14\xda\xb1\x22\xd4\x29\xee\x5d\xea\xde\x07\xb1\x56\x66\xa1\x21\xa6\xad\x74\x42\x5c\xd9\x6d\xfe\xf5\x49\xfe\xe3\x84\x7d\xfc\x04\xa1\x36\x06\xd2\x3b\x19\xe4\x1a\x97\xc8\x06\xf8\x12\x05\x87\x63\xd7\x32\x65\xd5\x93\x91\xe6\x22\xe2\x30\xb4\x2d\x29\xc9\x02\x29\xa5\x4a\xbe\x81\x19\x52\x95\x18\xc5\x72\x30\x08\x6a\x11\xe9\xe5\x79\xf1\x00\x66\xc2\xcf\x22\x44\x0c\x7d\x6b\xfb\x35\x32\x89\x32\x61\x90\x28\x62\xca\x71\xab\xfc\x0c\x5c\xbe\xa1\xd2\x7a\xf8\x44\x8d\x3e\x24\x45\x24\xe2\x6a\xa0\x04\xf0\xcf\xdd\x93\x3c\x9d\xcd\x47\x88\x09\x2e\x21\x96\x33\x0a\xf0\x6d\x51\xf9\x16\x0d\xfc\x09\x6e\x9b\x06\xa1\x59\x41\x1e\x39\xc9\x7c\x00\x60\xfd\x1d\xee\x46\x28\xee\xcf\x61\xe0\xf5\xd2\x59\xac\xa3\xfc\x6e\x8c\x43\xbb\x9a\xa5\x9f\xed\xb9\x45\xc6\x6b\x44\x9e\x81\xe0\x56\xb5\x6f\x4a\x5a\xcb\xab\x06\x62\x1a\xc2\x96\x08\x58\x59\xc1\xb5\xc9\xb4\x1c\x7a\xc7\xce\xb0\x1d\xa7\x3c\xa8\x69\x21\xdd\xc7\x9a\xe9\x6d\x00\x34\x21\x04\x8c\xb7\x62\xf1\xa7\x96\x80\x9c\x6b\x61\x08\x51\xf0\x71\x74\x19\x54\xca\xed\xa7\x76\xe5\xe6\xea\xcd\x06\x3b\xb0\x80\x23\x62\xb8\x46\x40\x1e\xb0\x9e\xfd\x24\xc3\x5f\xef\x43\x83\x83\x7e\xa4\x64\xa9\x90\x3a\x6e\x71\xa4\xc2\x1e\xbc\x78\x04\xda\xab\x9b\x46\x0a\x9d\x5b\x65\xaa\xbd\x40\xee\x77\x9c\x7d\x8c\x39\x3d\xf6\xf0\xdd\xd9\xcb\xb1\x57\xba\x93\xd2\x43\x9a\x0c\xa1\xf7\x90\xf2\xae\x41\x66\x12\x79\x76\x59\x33\xa7\xf0\x9e\x11\x73\x33\xfc\x26\x17\x4a\x5a\x45\xf2\x81\x20\x28\x6f\xe7\xb0\x40\xb9\xfa\x3b\xec\xd5\x53\x4b\xd4\x04\x4a\xc3\xcf\x25\x32\x73\x1a\xa6\x16\x00\x61\x55\xd5\xff\xae\x76\x08\xc3\xd0\x24\x06\x69\xeb\x25\x1c\xd0\xa4\xe3\x89\xc1\x8c\x1b\xd7\x7b\xc6\x67\xeb\x3a\x21\x6a\xe9\xb7\xdd\x14\xa0\x3f\x49\x00\x12\x44\x08\xb1\x0f\x47\x98\x08\x8a\xbe\xcf\xa1\x3b\x5a\x0e\x9b\xbd\xf9\xbf\xd9\x3f\xa6\x2c\xf8\x0d\xea\x82\x11\xe2\xdc\x1e\x9e\xa0\x7d\xf4\x58\xdf\xa6\x44\x19\x9e\xe4\xcc\x1e\x33\xfe\xae\xbf\xcb\x7f\xf9\xbb\x5e\x85\x42\x55\x7f\x95\xde\xfd\x3f\xc6\x0c\xfd\x95\x6d\x76\x04\xe9\x5f\x7a\x22\xb6\xd6\xfb\x0f\xef\xcb\xd1\xbe\xef\x6b\xc1\xf3\x69\xcd\x3b\xef\x11\xbd\xab\xa3\x0c\xdf\x20\x02\x78\x19\xa0\x96\xc3\x8d\x41\x54\xf1\xb7\xf7\x5e\x06\xe6\x53\xbc\x33\xd5\x03\xde\x39\x11\x87\xe8\x86\x1a\x51\x6e\xfb\x89\xbc\x1b\xfe\xf5\x8d\x2a\xd6\xa7\xd3\xf9\xe7\xa3\x96\x6f\xc0\xb3\xfc\x04\xde\xdf\xe2\xa1\xbe\xbf\x29\xdb\xf3\x4f\x08\x98\xeb\x83\xa9\x83\x06\x17\x16\x06\xe5\xe7\x8b\x80\x1f\xb1\x4c\xcd\xb4\x7e\x56\xf5\x01\x0d\xf8\x3b\x8e\x56\x43\xa2\x54\x8a\x36\x50\xa1\xe8\x7c\x12\x81\xc1\x45\xdd\x89\xfc\x52\x38\x39\xcd\x41\x5b\x5c\x9f\x84\xff\x2c\x77\xb6\xd4\xcb\x6a\x04\x6b\x77\x1f\xfc\x65\x7d\xbe\x7c\xe2\xb5\xfa\xab\x88\x56\x8f\xc9\xb0\x27\x6f\xe2\xbe\xec\xb2\xbd\x35\xe5\x42\xfa\x38\xbb\xe1\xd3\xb5\xb2\xac\x98\x78\xa4\x8a\x3a\x00\x21\xab\x00\x31\x5e\xed\xdc\x7d\x61\x0b\xbf\xcd\xaf\x12\xcd\x31\x5a\x83\x2c\xaf\xdf\x5f\x93\xdf\xa0\xd7\xf4\x62\xf2\xe6\x6b\x72\x9e\xc3\x6b\xe2\xbe\xa6\x50\x42\x30\x6b\xb8\xe8\xa8\x33\x93\x3a\x12\xa0\x08\x45\xc3\xd2\x89\x42\xc7\xca\x71\x6c\x2b\xec\x6d\xbe\x1d\x84\xf7\x69\xcd\x0a\xc2\x89\x9b\x5c\x30\x9d\x91\xb1\x0d\x7b\xf8\x0e\xfc\xd0\x99\xc2\x22\xc8\xc1\x0c\xc5\x38\xbe\xd8\xae\x01\x86\x28\x04\x0f\x31\x4e\xe1\x7e\x3c\x18\xf9\x60\x58\xb5\xd9\x3d\x63\xdb\x88\x27\x0a\x13\x71\xee\x22\x1f\xe5\xcc\x9a\xe4\x95\x87\xb1\x08\x5f\x14\xf1\x1c\xaf\x9c\xe8\x52\x32\x63\x53\x4b\xf9\xc5\xe7\x0e\x59\xee\x8c\x60\x7d\xa5\x7f\xe2\x16\xc1\x03\xbf\x8e\x22\x4c\x79\x20\x92\x1b\xba\xa7\x36\xdd\x45\x3f\x7c\xa1\x6b\xa9\xcd\x39\x2f\xcb\x0f\xc0\xae\x9b\x8b\x8b\x03\x6f\x94\xdc\xf3\xce\xcd\x0f\x03\x2f\x03\x5c\xa7\x7e\x5f\x92\xc6\xcc\xad\x43\xba\x7a\xe6\xc0\x6f\xf5\x5e\x1c\x88\x46\x3c\x70\x64\x0b\x34\x1f\x36\x0a\x8a\xdb\xfa\x2d\xff\xb2\xe0\x44\xc7\xb4\xd6\xe0\x19\xb9\xa7\xcf\x4d\x74\xd4\xc3\x3c\xaf\xea\x20\xb1\x5f\x0a\xf8\xdc\xae\x26\x10\x8d\x84\xba\x74\xf3\x9b\xd6\x2c\xc7\xef\x6f\xf1\x5c\xa7\xdf\x32\xe6\x20\x27\x21\xc2\xc0\x3f\x75\xbf\xc5\xd6\x74\x17\x06\xc3\xed\x38\x80\x09\xa6\x91\x03\xd3\x89\x3d\x0a\xe7\xa1\x57\xed\xea\xcc\xb6\x84\x41\x27\x1a\x65\xad\x36\x73\x32\xe6\x26\x55\xfb\x9b\xe3\xf5\x87\xa5\x35\xc8\x55\xfc\x4d\xce\x7c\x76\x6b\xae\x7c\x29\x5d\xd6\x16\x7d\x52\xb7\x47\x69\x5a\x9b\xa5\x69\x7f\x47\x08\x5e\xd7\xe2\xfc\x20\xe4\x7a\x7a\x77\xd5\xc9\x44\x1c\x32\xba\x36\x74\x6f\xb9\xdf\x6b\xf3\x01\x2b\x5f\x65\x7d\xdd\x58\x66\x2b\xa0\x86\x24\xea\xe7\x24\xb3\x9e\x76\xf8\x8d\x02\x4d\x54\xfe\x53\x6a\x99\x29\xd7\xea\x5a\xf2\x53\x5b\xd1\xc9\x45\x5c\x74\xa1\xb4\xd4\x8d\x2f\xaa\xbf\xcd\x06\x79\x6e\xe5\xe1\x90\x5d\x24\x7b\x7d\x04\xdb\xcc\x0a\xcb\x27\x51\x08\x41\x46\x45\xd8\x24\x8f\xde\xd1\xfc\xfc\x6f\x83\x88\x05\x0b\x43\x0e\x8e\x86\xdb\x63\x0a\xec\xbe\x17\x63\x20\x27\x96\x5d\x4b\x03\x31\xb9\xcf\xd3\x5a\x45\x47\x5c\x97\x1e\x3c\xcd\x49\xa6\xb5\x26\xb4\xd2\x7f\x49\x41\x6a\x42\x5d\x2b\xfd\x0a\x5a\x46\xbd\x42\x95\xfc\xa6\x5d\xcb\xe6\x77\x67\xbe\x7c\x14\xed\x9a\xa6\xc9\x51\x2b\x2f\xd5\x37\x27\xd2\x6c\x3c\x8d\xe8\xbc\x8e\x27\x27\xfe\x86\xda\x14\x60\x5d\xbf\xb7\xf6\xf2\xd2\xd7\x61\xc6\x38\xf9\x1b\x0f\xf0\x50\xbc\x1d\x84\x10\xb1\xf3\x70\x5e\x8f\x07\x57\x57\x9c\xcf\x79\xb8\x73\x1c\x83\x2f\xa4\xe8\x5b\x5b\xff\x1f\x99\x3f\xfe\xd1\xb6\xc9\x86\x76\x0f\x67\x81\xf2\x7a\xee\xb2\x37\xd6\xcc\x50\x42\x5c\x82\x2a\x64\x6f\x8c\x40\x46\xa5\x23\x9e\xac\x91\x86\xb8\x2c\x6b\x49\x27\x0e\x85\xcc\x0c\x99\x43\x67\x7c\x87\x1c\x31\xe4\x2f\xdc\x79\x23\x87\x12\x02\xd4\xe8\xf2\x43\xf9\x5b\x3f\xd8\x17\x26\x36\x31\x10\x08\xb3\xb7\x16\x3f\xe2\x70\x59\x47\x9e\xf5\xda\xb3\x88\x64\x27\x32\x92\x02\xec\x03\x8f\x99\x1f\x4e\x95\xf6\xb9\x1b\x3a\xad\xaa\xe4\x34\x87\x12\x89\x13\x64\xfd\x70\xe6\xbc\x9d\xca\xb2\x47\x67\xa2\x97\x31\x72\xba\xf0\x3e\xd5\xa5\x22\x40\x8e\xf3\x82\xba\x7d\x56\xc1\x47\xce\xea\xbe\x24\x3b\xe9\x3f\xe2\x86\xa0\xfc\xeb\x21\xce\x80\x16\xe9\x04\x0a\x35\x8d\x6c\xda\x11\x30\x35\xbd\x9c\x2a\x8c\x80\x04\xd1\x84\xce\x89\x3f\xec\x17\xfd\x98\xb0\x0e\x81\x81\xf6\xd0\xad\xa4\x39\xc8\xb2\xf3\x6f\xcb\x96\x9e\xab\x5b\x3b\x80\xb1\xca\x88\x84\x7c\x06\xe7\xde\x0a\x7e\x75\x10\x9f\x58\xd7\x0b\x9e\xe4\x5d\xe5\xa4\xb8\x3e\x50\x89\x5e\x42\x0c\xe1\x1b\x18\x5b\xe6\x8f\x08\x16\xe1\xe9\xe6\x7f\x6c\x3a\x23\xe8\x58\x6b\x22\xce\xfa\xd1\x5e\x15\xd0\xfd\x78\xdc\x0e\x1f\xba\xad\x2f\x52\x86\xc0\x35\x10\x65\x88\xf4\xa1\x68\x03\xdd\x08\xa2\xb6\xa5\x19\xda\xf9\xf9\x0c\x28\x51\x03\x93\x9d\xf6\x85\xdc\x6a\x6c\x3c\x2d\x81\x8d\x06\xae\x85\xfb\xb6\x66\xb6\x43\x98\xe0\x1b\x3d\xaf\x39\xb8\x44\x9a\x5a\x55\x4f\x9f\x97\x63\x89\x06\x1a\xc4\xfa\xb8\x34\x88\xf6\xe2\x44\x71\x51\xbf\xac\x59\xaa\xe7\x0e\x61\x39\x5a\xa7\x28\xd9\xd1\x2c\xad\x6c\x6d\x11\x76\x99\xad\x8e\xd6\xac\x5e\x31\x4a\x67\x8a\xd1\x82\x53\x62\xe4\xde\x70\xf7\x13\x89\x82\xe7\x22\x1c\x6f\x66\x08\x1d\xf4\x10\x21\x95\xcc\xfb\x69\x8a\x2a\xf0\x32\xa7\xe8\x06\xf4\x61\xb2\x86\x05\xef\x48\x77\xfd\x70\xbc\xa3\x58\x0d\xaf\xb2\x80\x22\x74\xc8\x5e\x02\x03\x63\x6d\x95\x76\x59\x9d\xa9\x10\xae\x6f\x2b\x64\x61\x68\x5e\x0d\xef\x71\xfd\x22\xb3\xcb\x2d\xb1\x8c\xf0\x71\x73\x63\x5f\x99\x73\x89\xa6\x20\x61\x14\x17\x32\xa1\x09\x35\x35\x3b\x84\xe6\x55\x82\x47\x5e\xcb\x6f\x88\x66\x9f\xe1\x52\x3b\xa2\xdc\xd0\x1f\x28\x3c\xe6\x46\x43\x02\xe8\xc2\xd3\x68\x0f\xa7\xef\xf1\x74\x40\xb2\x1b\xd2\x1c\x9c\xa5\x55\x42\x41\xb0\x74\x5e\x00\xeb\xe9\x78\xd7\x48\xca\x3f\xc8\x9e\x3f\x2e\xe2\x6a\x40\xf1\xf6\x9e\xc5\x71\xc5\x86\xfa\x27\x6f\xc3\x65\xdd\xa3\x93\x8d\x20\xa2\x94\xda\x69\x58\x3f\x69\x2f\x6d\xb0\x1a\x38\x25\xe0\x90\xb3\x0a\x18\xc3\x99\x69\x86\x9b\x08\x25\xc8\xa5\xf9\xf5\x39\xe1\x01\x11\x12\x09\x26\x77\x8b\xfa\xb8\x04\xe2\x28\x94\xf4\x1b\x3f\xa9\xd1\x94\xd2\x12\x1c\xbd\xc3\xab\xcf\x23\xac\x86\x55\xa2\xfb\xdc\xa1\x2f\xaf\x06\xb4\x41\x69\xca\xab\x30\x47\x18\xce\xf3\xfb\x6a\x75\xd5\x8d\x90\x41\x8f\x31\x8e\x40\x68\x19\xae\x5b\x9a\xe0\x0b\x6c\x78\x01\x68\xe7\x97\x72\x47\xcc\xfc\x65\xb4\x33\x64\x54\xaa\xa6\x9c\x2c\x8b\xb6\x92\xf3\xfa\x7a\xbb\x47\xef\x70\xb0\xc7\xa2\x25\xcc\x9e\xe8\x54\x86\x3f\x6e\x6c\x47\x83\xdc\x1d\x09\x51\xc2\x9d\xb2\xb4\xa7\xf5\x4c\xc8\x06\xf2\x6b\xfa\xbf\x2b\x1c\x9f\x32\x33\xcd\x26\xc1\x02\x3b\xd6\xdb\x42\x01\x12\xac\x25\xd6\x17\x07\xf2\xf3\x81\x4f\x25\x9b\x67\x03\x00\xcf\x0d\x77\x0c\x73\x09\xe8\xf9\xd3\xa8\xcf\xd8\x92\xab\x4b\x80\x68\xe3\x25\x38\x8d\x19\x35\x78\x6c\x37\x97\x09\xad\x5b\x66\xc9\x98\xed\xcd\xbf\x06\x5c\xd2\x73\x83\x4c\x8b\x3d\x89\xb2\xc4\xd7\x0b\x9e\x24\x6b\x9b\xf2\x67\xb1\xb1\x5c\x0e\xfe\x22\x44\xe9\x25\x96\xd2\x39\x45\x4f\xc4\x0e\x64\xe7\xa4\x17\xf4\x07\x21\xf3\x42\x22\xf1\x5e\x58\x9f\x7e\xca\x9e\xc9\x8a\x4e\xe8\x07\xa0\x8e\x45\x19\x9b\xa0\x4e\x0b\x5c\xe5\xf1\xbb\x93\x96\x2a\x77\xf0\x20\x3e\xa6\x0e\x4c\x73\x3b\xf8\x05\x3c\xaa\x67\x1c\x85\xc5\x0b\x5c\x53\x33\x88\x7a\x02\x6b\x89\xf7\xdb\x39\x4b\x3e\xc0\x1d\xc8\x25\x5d\xd4\x35\x50\x7a\x07\x1a\x8e\xf7\xec\xd2\x90\xdf\xde\xd9\x0b\xf2\xcf\x7a\x53\x68\x16\xca\xe6\x3b\x9f\x89\xcf\xf5\x82\x41\x12\x5f\x6c\x69\xcd\x09\x37\x45\xa0\x3b\x66\x6b\x5e\x8b\x05\x36\x5f\x6d\x43\x60\xc7\x7b\x2b\xeb\x98\x4b\x40\xdd\xe6\x9b\x78\x84\x7c\x74\x49\x2a\x98\x9d\xfe\x22\x96\xe3\x78\x56\x66\xea\xda\xb1\xed\xde\x40\x3c\x58\xd8\x1a\xdb\xed\x99\xa3\xca\x2e\xe7\x93\x0c\xa6\x13\xb4\x6e\xc1\x9b\x0e\xe2\xc4\x8f\x50\x67\x3f\x4a\xf4\xd3\x0e\xa4\xa2\x40\xbf\xe7\x50\x81\x13\xbd\xe4\xa0\x1e\x73\x07\x65\x7e\x6a\x68\x06\x66\xcc\xe2\x35\x28\x10\x9b\x14\x02\xea\xee\x8b\xa2\x43\x19\x0e\x9e\x63\xba\xdc\x21\xee\xe6\x7e\x5f\x10\xb4\x36\xf8\x86\x4f\xd5\x23\xa6\x0e\x38\xf3\x55\xa7\x4c\x1f\x38\x63\xb4\xaa\x9c\x79\xcd\x4b\x6d\x9f\xc3\x50\x85\xc3\x5b\xf2\x8e\xbd\xa0\x4b\xa2\x95\xcd\xaa\x8d\xf3\x94\x79\x3a\x93\x35\x2a\x57\x1a\xe0\x29\x88\x15\x65\x4f\x0b\x01\x68\x53\xc8\xcf\x1c\x4c\x2a\x38\x64\x6a\xb1\xa1\xfd\xa8\x91\x43\xb3\xac\x6f\x3d\xbf\xc3\xe4\xf3\x8b\x01\x04\xbe\x60\x9e\xdb\x1b\xce\xaf\x23\x6f\xdb\xf5\xf4\xef\xb0\x35\x9f\x02\xa0\x66\xed\x7d\xbe\x98\x66\x80\x0b\xbf\x88\xb4\x8e\x6a\xbd\xe9\x6e\x1e\x79\xfe\x5b\x99\xd3\x8a\xb8\x30\x24\x5d\x09\x9e\x86\xe8\x87\x42\xa2\x14\x4f\x01\xf5\xb7\x2e\x7f\x7f\xb1\xe9\x78\x20\xe8\x47\x86\x5f\x9a\x7e\xbf\xac\x0e\x09\x76\x19\x43\x7f\xf8\x78\xf9\x57\x47\xa2\x3a\x28\x74\xca\xaf\x43\x97\xfa\x0c\xab\x91\xcb\x10\xf2\xa0\x99\x45\xea\x35\x07\x44\x4d\xd6\x86\x94\x2a\x83\x20\x58\xfd\xc4\x40\xff\x03\xf2\x21\xed\x2b\xd0\x27\x81\xde\xfa\x06\xf9\x87\x69\xa7\x58\x5f\x5a\x4f\xbc\x3b\x34\xdd\x1a\xbf\x8a\x41\xee\x36\x65\xa2\xe3\x21\x49\xfb\x23\x12\xed\x61\xa8\x7a\x48\x7b\x5f\xad\xe6\x14\xbe\xd1\xd3\x1f\xb8\x44\x08\x5c\x1d\xf0\x23\xcb\xa0\x97\xef\x48\xf4\x64\x81\x51\x0c\xdd\x30\xae\x39\x82\x23\xb2\x73\x74\xdf\x4a\xe2\x54\x3d\xb2\xf7\x27\x39\xb3\x17\x06\xab\x47\x4f\x4f\xac\x42\xeb\x71\x5b\x93\xc3\x6f\x50\xea\x30\xc7\x9e\x8c\x89\xc1\x9e\x20\xba\x0a\x33\x74\x2d\xae\xee\x0f\x6f\x05\xc6\x27\xdd\xec\xba\xa0\x54\x59\x73\x9c\x83\x77\xbb\x7f\x34\x06\x92\x91\x2a\xf1\x4f\xd5\x85\xe5\x19\x66\xbb\x57\x7b\x1e\xf8\x3a\xed\xa1\x80\x6d\x46\x34\x62\x61\xa2\xe5\x20\x7a\x12\xee\xd3\x3b\x4c\xef\xf2\x61\xaa\x95\xa8\x21\xcf\x60\x44\x94\xb4\xdc\x5c\x07\xf7\xe1\x9b\xf5\x88\x59\x21\xfd\xba\xd7\xe1\xde\x60\x27\x4a\xa6\x33\xb0\x38\xaf\x28\xd1\xdd\x23\x42\x76\x05\x5b\xee\x45\xf1\xb4\x3b\xb8\x9a\xfe\x04\x20\x1d\xa6\x59\xa3\x7e\xf4\x04\x3d\xb7\x02\x64\xb2\xe7\xd7\x8d\xcd\x42\x44\xb8\xd6\xc9\xbf\x37\x4c\x49\x0b\x3a\xe7\xea\xa0\xc9\x0f\x57\x40\xad\x62\xc1\x43\x01\xe7\x9e\xf1\x70\x41\x49\xbf\xfd\x82\x1e\xab\x20\x57\x1e\xe0\x1c\x88\xa9\x23\xc0\x51\x60\x39\x22\x1a\xe3\x22\x7a\xe9\xb8\x65\x9d\x44\xc8\x92\x99\xcf\x7b\x77\x56\x25\x44\xb5\x20\x32\x16\xcd\x3d\x5e\xb3\x06\xc1\x5a\x62\x1d\x68\x26\xb0\x0b\x1a\x36\xcd\xea\xa2\x0d\xb4\x91\x9b\xc0\xa3\x5b\xff\x2a\xa7\xce\x1b\xff\x22\xd6\x6a\xe7\x6f\x4b\xb9\x8f\x64\xc9\x9d\x90\x51\x76\x39\xda\x30\x9b\x95\xd2\xbf\x14\xc7\xf7\x73\xfd\xe6\x35\x30\x56\x3f\x77\x2a\xe7\x9e\x7d\x54\xc5\x1a\xce\x70\x75\xc5\x9a\xe2\x5c\xf1\x9e\x5b\xa9\xae\x71\xd4\xa3\xb5\xcb\x65\x31\x7a\x54\x67\x3a\x2a\x24\x6c\xcf\x8f\xda\x0b\xd9\x85\xf8\xd0\x58\x8f\x0d\x3e\xa4\xb4\xd8\xbe\xb5\x8e\xfc\x31\x6a\xfa\x5a\x8d\xf1\x56\x82\x23\x2a\x8f\xf2\x21\x5c\xb6\x67\xc6\x85\xa5\x58\x70\xbe\x81\x5a\x7d\xba\x19\x5e\x7d\x6b\x27\xe0\x61\x39\x99\x20\x8d\xb4\x2b\x28\xd6\xb5\x1f\x66\x29\x28\x00\xba\xd4\x10\x5d\x89\xc3\x3b\xde\x36\xda\x3b\xaf\x69\xf6\xa6\x98\x62\xd6\xe8\xbd\xb4\x5d\xb9\x74\x3b\x47\x86\x57\xe5\x30\xaa\xf8\x45\x16\x17\x39\x63\x09\x3e\x14\x7d\xfa\x1d\xe7\x27\xe4\xd6\xc6\x36\xa0\x7b\x3b\xfc\x63\xb0\x7b\x42\xe5\xc8\x5f\x7f\xfc\x0b\x0f\x44\x57\x71\xcd\x00\xce\xb5\x4f\x9f\x57\x17\xc9\xa3\xbb\xd7\x30\x83\xfa\x35\xb4\x4e\x31\xec\x80\xa4\xe1\xab\xa6\xa3\xef\xbc\xa6\xfb\xdf\x45\x3c\xcb\xff\x2e\x74\x44\xbe\x48\xf6\xf2\xc7\x03\x2c\xc4\xdb\xe0\x85\x32\x33\x73\xad\xec\xb9\x3c\x68\x22\xef\xfa\xa8\x4b\xd5\x90\x0b\x02\xf3\x85\x7d\x83\x56\xaa\x29\x54\x45\x0f\x9a\x48\x1c\x1d\xdc\x8c\x1c\xc1\xcd\xbe\x54\xe7\x75\xd3\xbe\xec\xbb\x05\x8d\x21\xb7\x47\x6f\x61\x6f\x60\xcd\xc6\x29\x39\xf0\x2b\x04\x3c\x59\xd8\xa4\x98\xc0\x92\x8f\x59\x7a\x1d\xb7\xed\x21\x70\x86\x21\xd8\x74\x94\x27\x4d\xab\x0d\x86\x36\xdf\x53\x5c\xfc\x2c\x50\x10\x21\x09\xb8\xb0\xf6\x4a\x44\x69\xfd\x0a\x74\x58\xcf\xc6\x2d\x0a\x19\x41\xbc\xc2\x4f\xed\x2d\x8b\xc9\xf5\x51\xf6\x26\xa4\x8f\xe2\xf4\x6e\x60\x00\x14\x23\x7e\x0c\xbc\xf8\x47\x58\x4b\x0c\xd4\xd1\xce\xda\xc9\x23\xbc\x9e\x8e\x23\xcb\x37\x8a\x6c\x2e\xbf\x91\x17\x6d\xb5\x07\xf4\x65\xc2\x9b\x86\xbe\x8a\xae\x01\xab\x59\x1d\x61\xa4\x4f\xb9\x27\x95\xcd\x75\x87\xf1\x89\x8b\x96\xbd\x7d\xa0\x0d\x66\x7b\x71\x49\xb3\x42\x75\x31\x00\x7a\xa5\xe5\x1f\xfe\xbd\xd8\xf0\x1a\xba\x3e\x5d\x6c\xb2\xb7\xce\x68\x03\x98\x2d\xf4\xed\x6e\xe2\x57\xed\x69\x56\x67\x77\x43\x6c\x7d\xd2\x80\xe8\x76\x67\x84\xb9\xc9\x4f\x39\x7a\x52\xfe\xd1\x52\x97\x2a\xa8\x33\xe8\xc4\xc7\x7c\xd7\x89\xa0\xa9\xba\x86\xd5\x26\x8d\x40\xb1\xc3\x91\xa0\x79\xfb\xf9\xcc\x6f\x59\xe0\x42\x30\x6a\xd0\x4a\x2b\xe3\x64\x82\xb7\xd6\x0e\xc7\x9e\xd0\x5e\xb4\x29\x90\xe1\xce\x30\xb4\x5c\xdd\xe2\x58\x16\x89\x3e\x6c\x95\xdd\x8c\xad\x16\x31\x1e\xb6\xaa\x9d\x0f\x60\xd4\xf9\xde\x67\xf6\x3b\xac\x99\x40\x5f\xaf\xb3\xd2\xf4\xc2\x23\x48\x43\x8d\x05\xc7\xa0\x89\x1c\xec\x49\xf9\xdf\x11\x09\xe2\x01\xb7\x5d\x3d\xc2\xd4\x6d\xfc\xe1\xf9\x96\x7f\x8c\x93\xdf\x02\x53\xb5\xa1\x9f\x60\x6d\x41\xae\x50\x3c\x84\xca\xba\x99\x29\x7e\xdd\x1b\x6e\xad\xac\xd5\x9a\x74\x99\x26\x08\x83\xba\xc0\x56\xd1\x3e\xf8\x9d\x71\x7e\x9a\x66\xaa\x0b\x0d\x43\x57\xb8\xc4\x76\x1a\x90\x0b\x64\xd4\x95\xd3\xe7\xe6\x30\x5b\x2e\x60\xad\x29\x7c\x65\xfe\xc3\x56\xe3\xd6\x9c\xae\xe6\x86\xbd\x8c\xdc\x5c\xa4\x6f\x83\xa4\x56\x09\xfa\x3d\x3e\x8b\xba\x1f\x48\xc8\x56\x8d\x32\x15\x62\x16\x74\x10\x13\x32\x26\xf2\xda\x76\xe1\x90\x17\x1e\xc9\x94\x8e\x58\x08\xe2\x72\x84\xd1\xe5\x97\x5e\x3d\x7c\xdd\xe5\x1f\x07\x5f\xad\x12\x6e\x1b\xb0\x36\xad\x98\x77\x78\xda\x79\x31\x33\xb5\x0c\xf0\x88\x28\x82\xc2\x4d\xd5\x7e\x4e\x69\xbb\x6e\x32\xdb\xee\x28\x27\x9a\xa0\x14\xe9\x85\xb1\x02\x4e\xea\x2d\xdb\x61\x1c\x5a\xff\xa1\x26\x8d\x33\xde\x98\xd1\xe4\x9d\xc5\x8b\xbf\xe3\xd9\x94\xb4\x9e\x78\x6f\xb1\xa6\x67\x2f\x72\xeb\x73\xdb\xff\x3c\x6b\x0b\xf6\x35\xe4\xe8\x1c\x40\x05\xbd\xba\x0a\x66\x53\x78\x5a\x07\x1f\x3d\xe2\x2d\x2b\x1e\x62\x4b\x0e\xce\xfb\x96\xad\x69\x8c\x8c\x6f\xc0\x61\x1d\xa2\xb6\x9d\xe7\xbb\xe7\x90\xeb\x06\xd5\xaa\x99\xbd\x7a\xda\xaa\x07\xd3\x59\x79\x75\x01\x93\xa3\x21\xc5\xcd\x26\x58\x80\xa6\xd0\xea\x23\xdd\x1b\x17\xd8\xc9\xa1\xc3\xc5\xbb\xcf\xf5\x2e\xb2\xc4\xc8\x62\xda\xf6\x1e\x5c\x0d\x5a\xb7\xf9\x18\xcc\x06\xfe\xbc\xd5\xa4\xdc\x94\x9d\x47\xe2\x56\xaa\x22\x67\xb6\x04\x54\xbc\xce\x03\xd2\xfe\xf2\x24\x6f\x01\x1f\x72\x7b\x89\x5a\x21\xcd\xdb\x47\x64\xf5\x26\x1d\x1b\x10\xec\x42\x56\x7d\x83\x36\xf8\xed\xc1\xd8\x92\xbb\x28\xeb\x8b\x18\x38\x80\xa2\x24\xd0\xe1\xb9\xf2\xa7\x1c\x90\x5e\xc0\x3d\x55\x5b\x15\xe5\x35\xdc\x77\xae\x9a\xf1\x2f\xe8\xd6\x28\xa5\xf5\x9f\xbc\x85\x5e\x42\x57\x90\xc9\x6a\xd6\x16\x7d\x35\x80\xdd\x75\xfe\xd6\x66\xae\x97\x04\xa5\xcd\x9e\x55\xa7\xbb\xb9\x36\x93\xf1\x7b\x6e\x29\xfd\xc1\x79\x78\x6c\x8c\x9a\xc9\x1c\x0b\xb8\xbe\x6c\x81\x20\xe3\xd9\xb3\xfc\x76\x43\xcd\xcd\xea\xbe\xdf\x95\x29\xa6\xcc\x2c\x6b\xe3\xa1\x08\xb1\xcc\xd4\x00\x56\x59\x89\x46\x75\xf3\x2f\x96\xce\x7d\x23\x4c\x95\x3b\x00\xc6\x70\x97\xe5\xb4\xbd\xea\x6e\xb3\x3a\x37\x12\x2f\x7a\xb4\x98\x28\xe6\xb5\x3e\xbd\x3d\x2d\x7a\x9e\x00\x7a\x9f\x76\xb8\xf4\xab\xfb\x90\x32\xad\x8e\x08\x58\x7b\xeb\xd2\x1a\x71\x95\x5f\x4e\xd0\xfb\x90\x35\xaf\x9d\x58\x34\x55\x4d\x92\xfa\x8d\xd1\x13\xbe\x1b\xf5\x7b\xe2\x80\x5a\xfd\x86\xda\x9d\x3f\x52\x34\xd9\xf4\xb1\x1b\xb0\xf9\xd7\x73\x55\xd7\x7e\xbd\xf8\xb1\x5e\x49\xee\x5a\xaf\x88\x01\x73\xec\x45\x38\x2b\x57\x34\x86\xb2\x46\x2e\xad\xd0\x2c\x6b\x33\xf0\x7a\x39\x6b\x2f\x3b\xd2\x60\x65\xb1\x73\x44\x5e\x5d\x04\xb7\xf1\x84\x32\x2e\xb9\x88\x4d\x57\xbd\x73\xba\x16\x6a\x38\xac\xc5\x73\xef\x5d\x77\x8d\xdf\x6d\x3e\x7b\x62\x61\xad\xf9\xb5\xf0\xf2\xac\xe8\xb4\xf9\x74\xe1\xeb\xb3\x22\x90\xa1\xab\x3b\x9c\xb5\x9a\x31\xa2\xc9\xcf\x51\x8e\xd5\xe5\xde\xf9\x84\xd3\x76\xa3\xf7\xbe\x6a\xef\x4f\x18\x98\x7b\x5c\xb1\xf7\x0b\x4e\xb4\x4f\xa4\xe6\xaf\xd6\xbe\xbe\x48\xd9\xdb\xc0\x02\x9c\x09\x80\xb0\x9e\x01\xda\x6c\x53\xd3\x68\xc5\x8c\xfe\xcd\xf6\xb3\xd9\x74\xcf\xac\xc9\xae\x8f\x2c\x12\x05\xd6\xef\x37\x49\x18\xce\xde\x6b\x38\xbb\xf7\x64\x47\xed\xf7\xc8\x6b\x6c\xcd\xbd\x8e\x27\x45\x3d\xcd\x6a\xb3\xf2\xc5\x48\xd4\x05\xa3\x16\x27\xad\x45\x81\xa4\x4b\x08\x9e\x2f\xd7\x48\xfc\x9b\xf5\x11\xbd\xc7\xbf\x5c\xbd\x6d\xeb\x29\x58\x5f\x3f\xe1\x70\x7c\x8d\xdd\xaf\xe6\x12\xd9\x49\x8b\xe3\x8e\x84\xd4\xc3\xa8\x3c\xba\xd5\x64\x94\x01\xb7\xb9\xca\xf0\x7d\x80\x3a\x1f\x04\x48\x16\x1e\x14\xf9\x72\x74\x5f\xa1\x3b\x7e\xf1\xf7\x93\xcb\xcb\x8b\xb8\xd8\x9d\xf2\xe1\x30\xc0\xfa\xe8\xa3\x00\x0d\x06\xdf\x88\x9d\x36\xaf\xd5\x52\x3d\x52\x90\x5b\xb1\x13\x73\x4c\x21\x52\x55\xf0\x6c\xf2\x4c\x6a\x21\xeb\x6f\x8a\x10\x3a\x50\x98\xe3\x95\x5e\x2a\xc3\xd9\x17\x7a\x84\x17\x72\x9a\x16\x0d\xff\x2e\xe5\x63\x40\x03\x29\xa6\x5b\x0e\x6a\x5f\xc3\x16\x45\x9f\x01\xce\x53\x77\x8f\x02\xe9\x97\xa8\x58\xea\xe2\x26\x5a\x19\x2f\xc5\xb5\xcb\x4c\x5c\xc3\xea\x2f\x3f\x33\xeb\x56\x46\xaa\x8e\x63\xfe\x08\x64\x67\x89\x6f\xdf\xe2\x19\xf3\x6c\x2f\x90\xf9\x17\x7b\x85\x56\xcc\xf7\x19\x66\x11\x79\x30\xef\x7f\x2f\xe6\xb4\x2c\x65\x78\x29\x20\xcf\xf6\xe2\x2a\x31\x24\x38\xa2\xd0\xeb\x2b\xe6\x85\x2e\x16\x9a\xb2\x46\xa6\x96\xc9\x03\xd9\x96\xfc\x87\xd1\x47\x7f\xa8\x17\xab\x5b\x22\x5c\x69\xc1\x38\xe7\x35\x37\x74\x9d\xd3\x03\xf9\x54\x2f\xd0\x63\x83\xd8\x24\xc3\xbe\x17\xcf\x8f\x8f\x7e\x01\x46\xec\xa9\x2c\xb4\xe4\x42\x1e\x21\x07\xf0\x96\x8c\xb7\xae\x73\xcb\x73\x34\xb9\xa9\xc1\x15\x64\x6d\x1a\x94\x3d\x5c\xac\x55\x50\xbf\x7e\xcc\x2f\x5e\xce\x7e\xb8\xd6\x80\x7e\x2e\x3d\xfd\x32\xae\x92\x88\x69\x7a\x9f\x4e\x67\x30\x43\x84\xc3\x74\xfe\x25\x71\x07\xa1\x5b\xdb\xcb\x26\xf3\xb0\x21\x08\xd5\xf2\x00\x8b\xc5\x1a\x58\x37\x79\xf0\xc8\x7a\xd2\xd3\xfe\x4f\x80\x46\x6b\x18\xbc\xb5\xe9\xfd\x0c\x28\xab\xdb\x29\xe8\x80\xc0\xef\xc5\xec\xd9\x2a\xa4\x2a\xfb\xe9\x6a\x22\x1c\x94\x21\x65\x94\x8f\x52\xda\x23\xa8\xc6\x87\xe9\x74\x41\x40\x8d\x8d\x99\x88\x98\x77\x6b\x2d\x8f\x7c\xdc\x1f\x7d\xcc\xe8\xa5\xb8\xb5\x78\xe8\x14\x37\xb8\x2c\x81\x3d\x5c\xb8\xad\x59\xf5\xb8\x96\x9c\x89\x37\x9c\xc9\x85\x58\xd2\x4f\x25\xea\x66\x49\xf0\x3e\x71\xcd\xa9\xf9\xf7\x16\xe4\x25\xaf\x32\x30\xa2\x1e\xa9\x7d\x4b\xc2\x17\x54\x20\xca\xa6\x3c\xeb\x2c\x42\x8f\xbe\xe0\x88\xb3\x95\x07\xbb\x61\x7c\x44\xe0\xdd\x2c\x0c\x6c\x36\x9b\x71\x7e\x30\x56\x3e\x29\xdf\x07\x53\x2b\xe6\xf7\xfa\x8f\x13\xd1\x04\xdf\x31\xf2\x3a\xbf\x07\xa5\xe0\xcf\x8a\x43\x98\xd5\x8a\x9c\xaf\x80\xf6\x5d\xf6\x32\x8c\x32\x7b\x3e\xaa\xc2\x1a\xae\x02\x17\x5e\x45\x9a\x65\x73\xa8\x09\xcd\x51\x29\x01\x66\x88\x8f\xd5\x79\xdb\xfc\x7d\xf1\xd0\xf2\xb9\xaa\xd9\x3b\x7b\x1c\xd9\x9f\xd6\xe9\xe9\xe5\x77\x9c\x21\xa6\x73\x7d\xf3\x23\x14\xa4\x5b\x37\xad\x32\x0c\x76\x1a\x0a\xd9\xdd\xa6\xb3\xd4\xb6\xf0\xbe\x5d\x91\x76\x36\x17\xa6\xc2\xcd\xc5\x2f\xa3\x36\x25\xa4\xe1\x87\x74\x14\x8e\x74\xe6\xb4\xb3\x57\x9a\x3f\x87\x46\xdf\x8c\x0c\x6a\x19\x0d\x7d\x38\x25\x8f\x1e\x9c\xf3\xab\xb0\xab\x8e\xe1\xe0\x5d\x91\x5b\x73\xf6\xb7\x41\xf3\xad\x32\xa3\x73\x7a\x06\xc3\xaa\x99\xd4\x68\x85\x91\x22\x88\x70\xce\xee\x69\xa4\xd9\x5c\xba\x40\x8d\x01\x9f\xe1\x5d\x66\xd2\xb8\x60\xa4\x7f\x29\xa2\x87\xe7\xf4\x1b\x4f\xa5\x75\x42\x9f\xe4\x1c\xc6\xb0\xc5\x0c\x18\x14\x71\x88\xab\x46\x68\x66\xbe\xa8\x80\xaf\xbc\xbf\x6e\x7e\x22\x1f\x3c\x94\x22\xaa\x7d\x46\xc3\x4f\x97\xc8\x51\x9a\xec\x55\x02\xba\x53\xb4\x40\xff\xc4\x13\x24\x6a\x62\xdf\x1c\x8a\x24\x28\x36\x0b\x9f\x10\xad\xf1\x9d\x16\x0e\x10\x3c\xdf\xfb\xf8\xfe\x93\x2a\xdc\x73\x8f\x21\x3f\xfb\xae\x12\x91\x58\x7f\x8b\x20\x85\xf8\x88\x42\x15\xcb\x59\x84\x35\x34\xa0\x9f\x10\xaa\xc7\x26\x11\x8b\xf6\x4d\x03\xe6\x97\xa8\x8b\x74\x3c\x3b\x7b\x51\xe6\xc2\xac\xe3\xe7\xac\xc4\xac\x67\x79\x49\xff\xe4\x69\x4d\xec\xc0\x29\x9e\xf2\xd0\x3c\xf5\x65\x7b\x42\x42\x9f\x5d\xbd\x67\xd9\xbb\x58\x6c\x1d\x07\x76\x3f\x9f\x45\xa1\x6a\xa7\xbe\xf4\xcf\x62\x9f\xef\xe0\x34\xea\xf3\xf0\x2c\xb3\x10\x8d\x65\x58\xbd\x17\x67\x06\x83\x37\xcc\xa0\x47\xe0\xa9\xf0\x69\x4c\x23\x9f\x36\x6c\x99\x8c\x8d\x73\xcc\xe3\x04\xce\xa3\x17\xac\xcd\x44\xc9\xb0\x67\x7e\x31\x6c\xfa\x69\x75\x0b\x77\x4b\xb7\xed\x13\x21\x3a\x3e\x9d\x43\x50\xf6\xd9\x0f\xf8\x5e\x3d\x51\xa3\xeb\x8d\x87\x4d\xdc\xe3\x9e\x99\x48\xf2\x4c\x85\x33\x1e\x79\x5e\xa5\x4b\xf6\xb4\xfb\xd9\xf9\xd4\x57\xfa\xb9\xd6\x1f\x1f\xb5\xfe\xd1\xf8\xc9\xcf\x35\x3b\xcf\xfb\x07\xd0\xd3\xec\xc6\xea\x01\x8a\x3f\x75\x66\xf7\xf2\x07\xe9\xab\xb8\xb1\x3f\xf9\x95\xe3\x78\x7e\xb2\x32\x69\x7e\xb2\xd4\x44\x7e\xb2\xe7\xed\xaa\x52\xff\x49\xef\x80\x38\xbe\x94\x15\xfc\x83\x76\x61\xd5\x20\x1c\x0a\xde\xe6\x85\x21\x2e\x63\xc8\x84\x14\x74\x81\x51\x1f\x94\xd5\x55\x32\x1b\xea\xd0\x29\xbf\x34\xe1\x63\x6c\xa6\x7f\x6b\x60\x60\x9c\x2c\xbe\xd9\x0d\xc5\x28\xda\x23\x4a\x75\x4c\x37\x53\xd1\x15\xdb\xfa\xe0\x2d\x06\xaa\x51\xac\x43\xb4\xe5\xe5\x28\xf7\x82\xa7\x4f\x9f\xf9\x3f\xc5\x1b\xe2\x08\x07\x7f\xd8\x0d\xc6\xe0\x25\x04\xdc\xad\x5e\x68\xf0\x7e\x33\x11\x41\xa1\xa3\xf7\xec\xf3\xb4\xe6\x80\x52\xc2\xb1\xd1\xf8\x8b\xd1\x23\x15\xcd\x70\xf5\x51\xc8\xc0\x14\xae\x50\x45\xe1\x4a\xab\xea\x29\x00\x20\x0b\xb7\xfb\x13\x5e\xd4\x02\xc9\xb9\x56\xf7\x00\xdc\xef\x13\x6f\x68\x41\x2b\xe0\xeb\x03\x12\xc9\x25\x1e\x3b\xd9\x8c\x88\x0d\xbd\x43\x88\x01\x8d\x2c\x7d\x43\x3c\x3e\xbc\x4d\xa6\x13\x1a\xae\xfb\x87\x81\xed\xb0\x28\xe0\x2b\xce\xcd\x81\x9b\xc2\xda\x7e\x6a\xa7\xe0\x4d\xa1\x2a\xc6\xe6\x10\x75\xbe\x8f\xb3\x47\x23\x09\xfa\x02\xdd\xbd\xd0\x7f\x47\x2a\x50\x6e\x83\xc5\xc8\xad\x06\x21\xa0\xe4\xb5\xdd\x02\xe4\xf7\x5b\x6f\x39\xf6\xa7\x0f\xa3\xfb\x6c\x43\xd6\xcd\x19\x95\x9a\xee\x9f\x5b\x4e\x7b\x03\x26\x95\xb5\xdb\x73\x03\x4e\x02\x55\x89\x5e\xa9\xb6\xba\x6c\xd7\x10\xb7\x8c\x31\xb4\xa5\x06\x9b\xca\x1d\x7a\x4b\x04\x2e\x03\x55\x19\x29\x1f\x66\x7b\x1a\xf2\xda\x4a\xbd\xd6\x28\xe8\x72\xe3\x6d\x2f\xe1\xe7\x2b\x43\xa9\x88\x34\x83\x86\x33\x6f\x52\x2f\xf2\x97\xb5\x4b\x3c\xa9\x94\xf4\xd1\x1e\x23\x53\xfe\x41\xb2\x26\x1a\x7e\x9e\xde\x00\x97\x3a\x09\xf0\xed\x8e\x5c\x75\xf1\x1d\x5b\xd9\x4f\x73\xdd\xd9\xbd\x99\x28\xdb\x3a\x5d\xfa\x2e\x4d\x17\xf9\x9b\x48\x4e\xe7\x0f\x8b\xb7\x97\xa7\x6b\x56\x83\x67\xba\xba\x3e\x89\x66\xd9\x71\x70\x79\x3a\x4f\xd4\x24\x08\x4a\x48\x9c\x76\x4c\x03\x36\x8b\x55\xa6\x3b\x85\x47\x97\x35\x89\x92\xab\xc2\xad\x5e\x3a\x5f\x4c\xb1\x30\x2b\xc2\xc9\xc0\xb0\x8c\x8c\x41\x28\x5d\xa1\x51\x7e\x5e\x5a\x0a\xaf\xaf\xac\x41\xd3\xa4\x48\x74\xa4\x76\x86\xe3\x64\x82\x08\x07\xa7\xac\xb2\x1a\xc3\x92\x4b\x8a\x60\xc9\x43\x5e\xf2\x6b\xcf\xca\xfb\xb7\x52\xb7\x0b\x9a\x89\xc8\x86\xef\x30\x83\x7d\x09\x4b\x5b\x7c\x02\xfa\xcb\xbd\xb8\x93\x63\xaa\x23\x22\xfc\xb9\x5c\x48\x2c\xda\x6e\xaa\xb6\xd7\x35\xc2\x27\x4c\x1e\x7d\x62\xfa\xde\x54\xf8\x9d\x9f\xca\x22\xbc\x09\x5c\xaf\xbd\x44\x46\xa6\xf2\xd3\x1a\x9d\x93\xbd\x83\x8c\x84\x11\x47\x13\xd2\x03\x6e\x74\xf9\x7e\x92\xa7\xcc\xe4\x04\xeb\xa1\x5e\xdf\x17\xb9\x95\xf6\x81\x4e\x9a\xa7\x87\x7a\xca\xf0\x47\xf3\x13\x37\x65\x51\x1c\x79\xc6\xd0\x76\xe2\x25\xcf\x81\xde\x9e\x32\xd5\x3b\xdd\x6c\xff\xdd\x25\xb7\x86\x31\x36\xdd\x92\xb0\xdd\xe4\xdd\xcc\xe9\xf7\x4d\x00\xc8\xe4\xa2\x8e\x71\xb7\x90\x30\x9d\x05\xe4\xb4\x2b\xe8\xb9\x9e\x2c\x0c\x9b\x38\x3c\xce\xd1\x94\x6e\xcf\x94\xbf\xfd\x94\xd3\x9f\x7d\xf3\xf8\xb4\xa5\x3f\x55\x87\x53\x7a\x2b\x9b\x17\x31\x2c\x7e\x77\x24\x22\x30\x41\x5c\x43\xa7\x02\x87\xa8\x40\xad\x49\x11\x72\xa0\x70\x96\x20\x69\x9a\x39\x24\xcd\x8d\x38\x57\x33\x83\x0e\x38\x79\x92\xa2\xac\x5e\xa2\x97\x13\x58\x18\x8d\x9d\x0a\x30\x27\xe9\xe1\x30\x75\x8d\x81\x4c\xd4\x29\x03\x9c\xc0\xe7\xc8\x1a\xd4\x13\xa7\x9d\x2b\xf0\xfa\x3b\x97\xca\xbe\xe9\x67\x08\x00\x9f\xb2\x3c\x76\x32\x0e\x92\x4d\x91\x89\x49\x21\x53\x62\x62\xce\xf4\xfd\xf6\xf2\xf8\xf6\x96\xcf\x78\x51\x69\x6e\x54\xb0\xfb\x78\x89\xfe\x32\x5e\x37\xc9\xd1\x53\x0a\xf8\x6b\x51\x94\x87\x5b\x7e\xae\xe3\x7e\x65\xe2\x34\xaf\xb8\xb9\xe3\xee\x7f\x5f\x24\x77\xfa\x03\xfc\x01\x69\x23\xba\x93\xab\x22\xf1\x85\x8e\xe9\xb1\x45\x55\x8e\x3b\xc8\xd6\xea\x39\x8e\x08\x27\xdd\xf9\xe9\xb0\xcf\x93\xb0\x91\x4e\xee\x3c\x69\x35\xe0\xe2\x18\x8d\x02\xf7\x14\x6a\xb9\x95\xe2\x9d\x76\xad\x67\x06\x88\x8e\xb5\x7a\x27\x83\x44\xce\x43\x56\xe2\x74\x88\xce\x15\xec\x99\x8b\xcd\x43\x70\x0b\xc7\xea\x4f\xd8\xc1\x05\x86\xf4\xa2\x43\x0d\xe6\xe2\xc7\x47\xaf\x8a\x4d\xb8\x8d\xf9\xdd\xab\x2e\x18\x11\x25\xc3\x79\x8c\xce\x1a\x89\x1d\x03\xae\x13\x83\x1c\x11\xc3\x38\x7a\x6f\x87\x27\x31\xe7\x35\x86\xe0\xc6\x39\x5d\x7d\x25\x89\xb4\xec\xb3\x07\x11\xd1\x46\x52\xa4\xaf\xc8\x78\xb3\xb1\xd8\x33\xf2\xa6\xc1\x63\xf0\x50\x4b\xc9\x39\x8e\x13\x93\x18\xc6\x7c\x34\x8f\xda\x98\x3f\x72\xe4\xad\xd0\xb2\xd7\x79\xf6\x20\xd0\x39\xe7\x33\x3f\xc5\x32\x1f\x33\xbe\xd5\xb4\xf2\x53\xb3\xd2\x1e\x6e\x49\xd8\x9c\x99\x42\xa3\x70\x04\x72\x70\xa0\x31\xdf\x2d\x84\x11\x63\xd9\x27\xf7\x6b\x6f\x86\x1f\x58\xe2\x33\x49\x9e\xc1\x08\xaf\x6a\xff\xc7\x48\xd4\xf1\x7b\xa2\xda\x19\xc8\x9f\xe5\xeb\x06\x7f\xfa\xb6\x1e\x37\x1d\xd9\xee\x49\xe4\x50\x3d\x40\x13\xe0\x3a\xfd\xf3\x95\xc2\x62\xbd\x65\xd6\x44\xd7\xd0\x03\xd2\x5f\x82\x62\xee\xf9\x62\x8f\xed\xb1\xb7\x30\x13\x32\x42\x09\xdf\x44\x16\xa8\xc6\xc2\x1c\x18\x2a\x1a\x26\x94\xc4\x98\x37\x6c\xed\xa4\xbf\x12\x73\xdd\x77\xdc\x27\x6d\x30\x15\xa1\x3c\xff\xc5\x30\xea\xa3\x6a\xbc\xfe\x81\x97\x23\xfa\xd0\xd6\xc4\x12\xf3\x15\x8d\xad\x4b\x89\x4e\x66\x3f\x32\xc3\xc3\x31\x30\xf8\x62\x4c\x64\x00\x45\x63\x45\x26\x40\x01\x27\xaa\x57\x11\x44\x51\xb5\x0f\x3c\x28\x24\x96\xa4\xa3\xea\x81\x8f\xbd\x80\x99\xad\xdf\x0f\x1c\xe8\x8e\x30\xc2\xb0\x23\xf6\xf0\xe1\x20\x1c\x6d\x77\xce\xec\xdd\x3c\x66\x8f\x16\x93\x89\x5c\x97\x93\xe6\xf9\x62\x06\x26\x4c\xe4\xc7\xf4\x51\x88\xd1\x8d\x07\xde\xc8\x21\xb5\x1f\x0a\x8f\xa8\x45\x8b\x3e\x42\x0c\xf8\x21\xe8\xdf\xa3\x90\xbc\xff\xb0\x27\xb0\x91\x39\x1e\x68\x2e\xeb\x67\x84\x6b\x14\x59\xf3\x2c\x2b\x8d\xda\xc8\xfc\x24\x2e\x74\x46\x45\x43\xd3\x71\x78\xbc\x38\xb0\x23\x28\xe9\x51\x1e\x5c\x19\x99\xab\xd2\xe4\x7c\x40\x14\x90\xbb\x49\x91\xdb\xf6\xc8\x0c\x12\x7b\x64\xaf\x43\x11\x6b\x53\x7c\x50\xfa\x91\x97\x08\x77\x7f\x84\x8b\xfd\x61\x5f\xfc\x9d\x8b\x79\xc7\x00\xba\x17\x8d\x2c\x2a\x86\x0c\x11\xc3\x31\xd3\xfa\x26\xd7\xf4\xa4\x29\xe8\xab\x5e\xae\x47\x8a\x18\xfa\x47\xfa\xa1\xb2\x22\x84\xe0\xdf\x8d\x59\x5a\x76\x57\x12\xec\xa3\x74\xeb\x81\x3d\x92\x26\xd6\x15\xf0\x6e\x01\xf4\xcf\x4e\x4d\xd5\x26\x71\x48\x29\x7e\xcb\xef\xcc\x51\xb3\x2f\xe7\x8f\x32\xbc\x82\xfe\xbf\xfc\x8f\x90\x79\x0e\xc2\x90\x41\xca\x03\x47\x36\x18\x82\x91\xe3\x07\xc4\x5c\x47\x2c\x24\x8a\x43\x69\x04\xd3\xc4\x63\xca\xff\xea\xde\x53\xcf\x36\xff\xf3\xbe\xce\xd9\x90\xf2\xf9\x9f\x7d\x9f\x8f\x60\x76\xfe\xcb\x3d\x57\xb0\x36\x1f\x86\x2f\x77\xee\x03\x90\x2b\xc8\xe9\x37\x36\x2a\xdc\x18\x5d\x70\x4d\x31\x42\xac\x43\x43\xba\x60\x13\xdd\x05\xe5\x94\x43\x6a\x19\x5f\x41\xbf\x58\xf9\xa2\x1f\x57\x26\xb2\xc8\xbc\x4e\xca\x37\x0d\xf5\xeb\x86\xa1\xc6\xbc\x44\xc0\xb2\xa3\x07\xe7\x08\x0a\x0a\x32\x1f\xea\x71\xeb\xc6\x72\xfc\x4d\x27\x65\xfd\x52\x28\x32\xae\xf9\x52\xdf\x17\xa7\xcc\xb0\xbe\x0c\x7a\xbf\x3c\x2d\xd0\xa2\x59\x74\xb0\xeb\x28\x59\xc0\xbc\x3e\xe4\xbe\xb3\xf5\xfd\x00\x56\x0d\x3a\x85\x22\x25\x62\x33\x7a\xcf\xb2\x63\x8b\x2e\x53\x8c\x96\x97\x60\xe1\xaa\xe0\xe6\xbf\x25\xd5\x68\x05\x0c\xca\xb3\xfa\x01\xec\xf4\x86\x9a\x96\xa6\x20\x0e\xa0\xe9\xa1\xaa\xc4\x7a\x62\x2e\x58\x99\xfd\x46\x7f\x09\x5b\xba\x83\x8f\xee\xc7\xa1\xe0\xb6\x2f\xc7\x94\xd6\xa6\x2c\x2b\x66\x69\x4b\x18\xcd\xc3\x2f\x6b\x96\x6c\x9d\xc5\xe8\xce\xe5\x01\x83\x20\xaa\xc2\x73\x7f\x25\xc2\xf0\xd1\x75\x65\x5a\x52\xee\xcb\xee\xd3\x74\xe8\xe1\xb3\x36\xd8\x24\x3d\xf8\x0c\xfd\x1a\xc2\x02\x65\xf2\xe0\xad\x6d\xe6\x1b\x1c\xde\x87\xcb\x3f\x62\xbd\xc1\xa5\xc5\x79\x59\xe0\x28\x55\x0e\xb9\xa3\x4d\x89\x2a\xbc\x98\x0d\x3a\x58\xfd\xc6\x24\xd4\xe1\x52\x3a\xfa\x70\xad\x1c\x3b\x37\x43\x2d\x6f\x58\xfa\x6d\x19\x3c\x6a\x64\xb8\x40\x5a\xe2\xac\x61\xa6\xe8\x85\x9d\x29\x2e\xd1\xb0\x5f\x41\x13\x1f\x3c\x8c\xdb\x9f\x0b\x98\x3c\x06\xb4\x91\x6a\x58\xd5\xa3\x2b\xbe\x04\x4b\xe5\x3e\xc0\xb2\x94\xa4\xf6\xb0\xcb\x71\xea\xdc\xd4\x20\x40\x22\x77\xfc\x0c\x96\xe3\x9e\x62\x5a\xd6\x8d\x7a\x79\x66\x8f\x6a\xb9\x0e\x55\x43\x15\x78\xff\xb9\x7f\xfa\xf7\xe0\xae\x56\x93\x78\xa8\x82\x3a\xe2\xeb\x34\xd3\x78\x4a\x3b\x71\xb0\x8f\x04\xe4\x52\xf8\x7b\xf5\xc4\x36\x3f\x9e\x0a\xa0\x99\x2e\xbc\xd9\x88\xae\xe1\x79\x60\x40\x4b\x86\x7e\x25\xd9\x38\xec\x9e\xc9\x6c\x43\xa5\x90\xc9\x80\x84\x05\x29\x90\x0f\x3f\xee\x7e\x1e\x90\xcf\xa7\xa3\x2e\xbf\x94\xba\x02\xa1\x75\x10\x17\x68\x00\x4a\xfd\x4b\x64\xd6\x43\x40\xd2\xe3\xae\x15\x07\x68\x58\x8d\x91\xc3\x1a\x30\x56\xd9\x4b\xd2\xaa\x50\xed\x89\x99\x6e\x7f\x09\xb2\x8a\x6a\xfa\x8c\x42\x73\x8a\x70\x06\x02\xcb\xb5\xa0\x67\x50\xc7\x51\x1e\x7d\xd9\x22\x20\x0b\x90\x55\xa7\x94\x68\xeb\x7b\xc4\x29\x0e\xd0\x8a\xf1\xe9\x12\x48\xd5\x2b\x70\xaa\x57\xaf\xc6\xc4\x50\xc6\x7c\xb4\xed\x0a\xcc\x34\xdc\x31\x40\xc8\xcb\xf6\xf7\x49\x03\x5e\xad\xfc\x45\xba\x6a\x83\xd8\x3a\x68\x95\xe3\x3e\x5f\x4e\x56\xd5\xa7\x7c\x40\xf6\x7b\x51\x1c\xe5\x40\x4d\x5b\x5a\xf5\x9f\x76\x91\xcf\xb6\x2c\x2a\x6c\x3f\x44\x45\xfd\x72\xae\xc8\xab\x03\x0b\x7d\xdc\x17\x7c\x24\x69\x78\xd2\xb0\x2c\x5d\xb1\x6c\xaf\xb8\x56\xdf\xca\xcd\x28\x85\xad\x0d\xad\x11\x61\x20\x60\x2b\x57\x5b\x2e\x6d\x69\x71\x8e\x60\xb0\x49\x05\x83\x18\xb2\x34\x9d\x86\xf6\x34\x66\x05\xa9\xc3\xe8\x3e\x09\xac\x73\xb7\x73\xc8\x16\x63\x48\x52\xa1\x1f\x72\x84\xfc\x0d\xf6\xc8\x5c\x6c\x94\x0f\xf9\xd1\x20\xac\xbc\x36\x8f\x56\x59\x03\xdf\x1a\xd0\x59\x34\x41\x6e\x5a\xeb\xaa\xe1\x16\xd8\x7d\x00\x5d\xe1\x2a\xd3\xe9\xf5\xfb\x7b\x6b\xf6\x0d\xa8\x0c\x56\xeb\xb3\x9d\xbc\xb0\xab\x59\x05\x49\xda\x0e\xea\x05\x73\x21\xe8\x2b\xd0\x40\x9e\xa4\xe6\x2d\x1e\xbc\x41\xd3\x07\xc5\x06\x97\x75\xe4\xc3\x97\x9a\x0f\xc2\x4d\x1e\xc8\x37\x02\xbf\xdd\xc0\x50\x1c\x31\xc9\xdf\x31\xec\x6f\xd6\xb8\xa2\x25\x63\x76\xff\x97\x39\x38\xed\x46\xf5\xb4\xfa\x67\x11\x83\x15\x30\x53\x82\x04\xdf\x40\x63\xbb\x61\x57\x7e\x60\x0e\x25\x42\x3a\x89\x69\x33\x4b\x7e\xac\x5e\x02\x12\xa0\xb1\xde\xb0\x53\xe2\x58\x79\x9d\xc9\x63\xd5\x42\x70\x02\xa9\xdf\xd2\x93\x64\xdc\x5f\x4c\x6c\x80\xb8\x2f\xdf\x6d\x67\xb2\xd2\xb7\xd2\x37\x4d\x8d\x3e\x72\x76\xc1\x68\x55\x38\x6a\xdf\x84\x69\xcd\x92\x2b\xad\xf7\x88\xfb\x2e\xd8\x86\xee\x74\xe4\xe6\xf3\x11\xf0\x54\x8a\xe4\x12\x64\xb9\xc7\xbc\xb4\x68\x8d\x14\x0a\xbc\x50\x17\x67\x9d\x05\x7d\x9f\x17\x33\x88\x7a\xc4\x0d\x11\xd6\x07\xa9\x25\xe6\x9a\x82\xd2\x7c\x06\x20\x42\xe8\x55\xd2\x96\x5a\x79\x55\x1b\x1a\xa5\xa3\x91\xa2\x7a\xeb\x55\xaa\xc5\xd0\xd7\xe3\x86\x0d\x59\x81\xa3\x9d\x66\xf8\x01\x20\x79\x9a\x60\x4e\xf1\x3c\x03\xbd\x7a\xfc\xa7\xc4\x42\x84\x7c\xc1\xe4\x04\xba\x41\x4f\xed\x66\xef\x1a\x59\xb3\x2a\xd4\xb8\xf7\x71\xc5\xad\x9e\xcd\x56\x47\xce\x0a\x68\x79\xf2\x91\xb0\x0f\xc8\x70\x30\x5a\x0e\xfe\xda\x6b\x96\xaf\x80\x4c\xd7\x21\x5e\x7f\x21\x5e\x1b\x2b\x15\x78\xd7\xfb\xb8\x81\x6f\x15\x2c\xd6\xcd\x9b\x87\xe8\xcc\xe3\x54\x02\x25\xbb\xfe\xa8\x39\x6a\xe6\x98\x25\xaf\x64\x36\x24\x13\xe2\x52\xae\x6c\xcd\x8f\x51\x18\xf2\xc7\x15\x5a\x09\x18\xf7\x8f\xbc\x63\x5d\x45\xd2\xf6\xd8\x5c\xc5\x9f\x01\x67\x60\xe7\xc1\x26\xaa\x33\x5b\xad\x6d\x7b\x36\xf4\x2a\x22\xe3\x3e\x48\xa9\xee\xea\x15\x43\x77\x59\xea\xf0\xb1\xe4\x92\xf7\xde\x9b\xc3\xdc\x9b\xd5\x3e\x69\xbc\x02\x40\x3b\xb7\xb1\x39\x2f\x3e\x85\x3d\x2d\x22\x65\xd6\x11\xa4\x56\x31\x52\x1f\x51\xfb\xf5\xb5\x7b\xe5\xce\x0d\x96\xd7\xce\xef\x02\x86\x94\x39\x63\x76\x79\x22\x99\xcb\xc1\xd4\x2c\x33\x1b\x62\x75\x16\xc8\xdd\x8d\x95\x06\xc3\xaf\xdc\xc8\x34\x36\x4e\x06\xcd\xbf\xd7\xd6\x10\xa9\x19\x4b\x17\xfb\xc9\x84\xb0\xe6\xb4\x47\xcc\x15\x08\xb9\x51\x17\xcc\xc0\x91\x09\x1e\x0c\x09\x39\x35\x73\x60\x4f\xb1\xd5\xb4\x3e\x6f\x73\x6c\xe6\x22\xc7\x52\x5f\x7e\x7f\x75\x55\xad\xfa\x78\xd1\xcb\x6d\x66\xfc\xba\x0b\x80\xf9\x8e\x92\x3a\x2a\x6a\x6f\x82\xcf\x2a\xe8\x28\xa9\x5c\x41\x16\x9d\x40\xad\xe0\x12\x95\x0d\x31\x24\x6f\xf1\x27\x68\x6e\xba\x61\xaf\x65\x6d\x60\x0d\xe0\x58\xa3\x89\x0b\x7b\x26\x36\x79\x12\x3f\x55\x83\x88\x88\xa2\x3c\xb5\x1d\xf0\x59\xb9\x26\xe8\x6b\xd6\x25\xff\xc7\xc2\xae\x70\x32\x87\xae\xee\x1a\x38\xe8\xa1\x01\x74\x31\x39\xda\x6c\x57\x9a\x4b\x25\x76\x67\xdd\xc1\xc6\x37\xb5\x82\x3f\x55\x50\xed\x8a\xa7\xdb\xda\xfb\x60\x9c\xf1\xe1\xf6\x9e\xca\x20\xeb\x43\x7e\x92\xc5\x07\x45\x2d\x1d\x3e\xca\x6b\x91\xed\x77\xbf\xac\xd6\x99\xe4\xd9\xa0\x6f\x1b\x97\x38\xfd\x66\x7a\xfb\x1c\xd5\x5a\x82\x25\x7a\x21\xc1\x3d\x50\xa7\x57\xf0\x66\xed\x43\x3b\x44\xcd\xd8\x74\x8f\xcd\x9a\x82\xf6\x7a\x46\xee\x3f\x38\xae\x51\xeb\xf9\xf8\xc9\x96\x49\xbd\x4d\x07\x70\xb0\xfa\x61\x0f\xda\xea\x7e\x02\x32\x34\xcb\x76\x4c\xa7\x7e\xd8\x82\xff\x9b\xe8\x60\xb6\xe9\x7c\x74\x49\xb3\x72\x78\x30\x61\xe3\xf9\xe3\x5b\x91\x90\x59\xd3\x7e\x00\x03\x76\xe1\xce\x11\xfa\xaf\x00\x04\x7e\xad\xe7\xc6\xd2\x05\x2a\xb7\xe1\x4e\x43\xf7\xb0\xf7\xd8\xd6\xef\x30\x8b\x30\xc8\x69\x4d\xfc\x84\x82\xec\x06\x2d\x1a\x22\x7b\x01\x77\x13\x49\x76\x6e\x41\x49\xb0\x8b\xfb\xf0\x54\x7a\x68\x48\x1e\xa1\xc0\xda\x72\x0c\xfc\xf7\x09\x98\x67\xd1\x18\x81\x69\x25\xa9\xf0\x3a\x5b\x98\x7f\xe7\x8c\x74\x2d\x70\xbc\x25\x77\xd3\x5d\x72\xdf\x76\xd7\xbe\x69\x3a\xd6\x25\x17\xf9\x61\xba\xcb\x41\x3e\x5d\xcb\xf3\x37\xeb\x19\xa1\xff\x20\xb7\xf6\xf4\x2d\x75\xd7\xfc\xd4\xb7\xa0\xbb\xca\x3c\xc4\xfe\x03\xaf\x78\x59\x6f\x91\xd8\x46\x58\x5c\xac\x7f\x42\xb5\x94\x5b\x45\xf2\x25\xc1\x9f\xfb\x25\x61\x5c\x20\x5c\x0f\x51\x55\xd1\xc5\x10\x52\x1a\xd0\x56\x61\x29\x11\xfc\xfc\xa6\x21\x49\x57\xb3\x62\xf8\x4d\x94\xd6\xe3\x36\x65\x89\xaa\x9a\x45\xf9\xc0\xe8\x9a\xe6\x24\x74\x22\x57\xed\x52\xc8\x5b\x07\xa3\xf0\xc8\xab\x07\xd8\x75\xde\x0b\xa0\xb7\xb8\x6b\xda\xf2\x1d\xf5\x06\xdc\x3a\xf8\x7d\xb7\xaa\x7c\x54\xe4\x59\xd7\x12\x5b\xba\x5a\x41\xbd\xe4\xef\x35\xe6\x11\xa8\x89\x51\x2b\xf6\x30\xbb\x8a\x7e\xbb\x70\x94\x35\x02\xce\x3b\x84\xe4\x12\x1e\x8b\x6f\xc2\xbe\xa9\x59\xda\x55\x77\xb8\x76\xf6\xc1\xf3\x15\x66\x24\x78\x13\xe2\x89\x67\x89\xb7\x17\xb2\x40\x80\x2c\xe8\xa4\xbd\xd8\x88\x8f\x1d\x24\x4e\x05\xdf\x9c\x19\xaf\x6f\xed\x2a\x26\xa9\x77\xb3\x54\xa2\x88\x61\xd5\x42\xa0\xc9\x53\x38\xda\x6d\xf5\x1d\xdd\xa6\x77\x95\x66\x6c\xde\xed\xb0\xba\xe0\x23\x00\xde\xaa\xcd\x75\x4d\xbb\x15\x5c\xd6\x2e\xc0\x9a\x05\x21\xeb\xd6\xbb\x8a\x00\xb3\xae\x54\xd7\x5c\x18\x34\xe0\x0b\x86\x97\xd5\x89\xf4\xe7\x74\x56\x0f\x2b\x9f\xaf\xf3\x00\x23\x0e\x12\x75\x11\x88\xd8\x95\xf1\xfb\xe2\xa5\x2e\x5e\x19\x7d\xcb\xce\xa4\xaa\xc2\x21\xc2\x59\xf9\x08\x29\xcc\x2e\x1f\xfa\x95\x99\x09\x18\x77\x53\x56\x7f\xe7\x1c\x57\xad\x20\xf2\x2b\xe4\xaf\x35\xc3\xba\x75\x7e\x57\x00\x79\x9d\xf8\xeb\x7c\x92\xf3\x82\x1a\xb9\xab\x6f\x2e\x38\xdf\x6c\x35\x14\x42\xc7\xbd\xcb\x53\x11\x14\x37\x43\xad\x4e\x7b\x1f\xab\x70\xb2\x79\x0e\xb0\xac\x2d\xf8\x4b\x8b\x48\x05\xae\x03\x4c\x6b\x6c\x35\xb1\xd3\x09\xa3\xe1\x68\xad\x96\xe5\xbb\x83\xf1\x6a\xe7\x32\x7a\x81\xfb\x4e\x97\xdf\x59\x38\x30\x59\x26\x23\xb0\x43\xd7\x80\x97\x3a\xe9\xcd\x94\x02\x1b\x97\xda\xa3\x47\x63\x66\xf7\x69\xd2\x51\xd0\xb1\xcf\x0f\x0e\x01\xde\x5c\x1d\x1d\x08\x30\x40\x69\x4d\x2c\x0c\x8a\xd9\x72\x0a\xeb\x17\xd1\xab\x7a\xb7\xd3\x28\x6f\x47\x97\x24\x1b\xd8\x25\x41\x10\xf0\xbc\x53\xe1\xaa\x0b\x7c\x1c\x90\xaa\xdc\x45\xfa\x7b\x2a\x63\x2f\xbd\xad\x49\x00\xf0\x25\x6c\x0e\x9a\xa6\x17\xfe\xdc\x48\xcf\x1c\xd4\x55\x86\x7e\x00\xb8\x2a\xca\x22\xba\x12\x6a\x18\x98\x0d\xaf\x22\x49\xd8\xc9\x83\xad\x9c\xcf\x69\xd5\x82\xaf\x74\x61\x18\x2e\xde\x14\x7c\xeb\x7a\x1a\x3b\x75\xe5\x81\x29\xaf\xae\xb3\xad\x92\xd7\x21\xc3\xd7\xcd\x58\xfd\x22\x53\x75\x0f\xb0\x24\x6d\x9e\xca\x81\x04\x6c\x79\x0c\xad\xb1\xc4\x67\x05\xb1\x99\x1c\xce\x4f\x22\x7f\x25\x0c\xd5\x25\x87\x67\xca\xdb\x8c\x18\xcc\x38\x52\xab\xe1\x05\x01\xdd\x07\xc5\x48\x78\x9a\xc7\x1e\xd6\x50\x6a\x4f\x96\x9b\x73\x59\x73\x83\x9e\xee\x5d\x41\x1e\xab\x40\xa9\x7b\x62\xfc\xb6\x3b\x3f\x36\x0f\x30\x19\x54\x4c\xc1\xf0\xdc\xe0\x3f\x0e\x64\x26\x72\x53\xd4\x4b\x48\xeb\x1b\x3a\x4c\xdf\xbe\xc2\xfa\xaf\x84\xac\xbc\x75\xa0\xe4\x17\xf7\x64\xeb\x19\x81\x76\xb1\x06\x61\xbc\x10\x6e\x0b\x66\x6b\x59\xc8\x77\x1d\xe7\x7a\xc8\xd0\x10\xb7\x80\xad\x81\x0d\x05\xad\xf5\xb0\x16\x34\x53\xa7\xbd\x68\xad\x37\xae\x3c\x54\x0e\x49\xc0\x9a\xe9\xf3\xc7\x73\xc8\x43\x5e\xb9\xb5\x85\x6f\x6e\x5a\xe8\x4f\xb0\x66\xe8\x54\xba\xa2\xdf\x56\x5c\x2e\xe8\xa4\xf8\xd7\xc6\xca\x88\x8f\xf1\x43\xb6\xd6\xbf\x7a\x16\xd0\x40\x42\xa8\xa6\xdf\x00\x7c\xfb\x31\x9d\xb5\xd5\xf9\x97\x8f\x24\xdb\x69\x69\x3e\xd1\xc7\x95\x89\x81\xfe\x0d\x59\x33\x7f\x5c\x65\x9b\x00\x04\x65\xf7\xca\x4a\x89\x84\xdb\x19\x4a\xdd\xbe\xcb\x78\x5d\x40\x7d\x8d\xa9\x9e\xaf\x79\xae\xfd\x0d\x87\x9d\x4b\x43\xe2\xc2\x45\x2a\xaf\x25\xec\x51\x73\x41\x9f\x1a\x18\x7c\x65\x85\x5e\x9b\x4d\xe5\xa9\xc3\xb4\xb7\xca\x0d\xc4\xd5\xf9\x79\x15\xbe\x36\x76\x84\x5c\x16\xb1\x5d\x2d\xf6\x22\x8d\x02\x6f\xd8\xdb\xbb\x7b\x0c\x45\x1a\x91\x8b\xc0\x45\x01\xb1\x08\xdf\x5e\x7a\x60\x60\xa7\xf5\xf8\x12\xd2\xa7\x31\x1d\xea\x76\x43\x59\x7f\x22\xcc\x11\x6d\xa0\xfe\x03\xd6\xea\x59\xfa\x3c\x42\x17\xc5\xfa\x6a\x6c\x56\x92\x90\x69\xf3\x48\xfa\xfd\x4d\x3f\x06\xa0\xac\x50\xe5\x90\xbb\xdf\x8a\x0d\x52\x67\xdf\xa8\x4a\x84\xbd\x5d\xf8\x7d\x17\x45\xb6\xf3\x14\x90\xc4\x14\x2a\x0c\xc7\x7f\x70\x58\xdb\x1f\xca\xdf\xc2\xeb\xfe\x5d\x08\x12\xf6\xa7\xeb\x8f\x1d\x0a\x9b\x3c\x83\xf5\xf4\x67\xdd\x92\x4a\x4a\xd6\x5f\x23\x99\xfd\x41\x6a\xcd\xdb\xb6\x7f\xd9\x1a\x81\x7c\x2d\xfe\xbc\x7d\xfe\x76\xab\x9c\x18\xc1\xf5\xad\xa7\x95\x4f\xe6\x1f\x48\xc2\xbe\x19\x5c\x5d\x9b\xbe\x67\xba\x8b\xdf\x8d\x02\xf2\xce\x87\x4b\xdc\xbe\x31\x88\xe1\xd3\xd1\x17\xc8\x76\x80\x53\x18\x98\xa6\x77\xf5\xc9\x6b\xe3\x84\x44\xd7\xa4\x28\x9b\x77\x9a\x86\xc4\xe5\x18\x95\xf0\xfe\x1e\xdd\x33\xf0\xcf\xaa\x19\xa6\xbd\xbc\x5e\xb5\x7a\xe5\xfa\x82\xb7\xe5\x95\x18\x3f\xfa\xda\x9b\xc2\x0f\xa8\xad\x83\x9f\xc0\xab\xfa\xc0\x8e\x80\x9d\x04\xed\xbf\xe8\xf4\x64\xd5\x47\xb2\x2b\x0d\xcf\xee\xc1\xf4\xe4\x40\x23\xcc\x68\xe7\xda\x2e\x49\xd0\xb4\x16\x8e\x83\x5e\xb5\x36\x3d\xb1\x2f\x24\x32\x72\xb1\xd9\x1d\x34\x5a\xc7\x3e\x61\xa7\xb6\x3e\x07\x5b\xb5\x42\xd5\x8f\x68\xd0\x3b\x9c\xc7\x93\xbf\x78\x27\x5e\xe5\x70\x94\x67\x11\xa5\x35\x08\xaa\x08\x54\xe4\x9c\x75\x1c\x62\x2d\x60\x95\x88\x66\x81\x5d\x5f\x80\xbc\x79\x01\x01\xde\x34\xce\x58\x56\x61\x19\x2f\x77\xb2\x3d\x65\x41\xbc\x56\x47\x63\xed\x6b\x2a\x4a\x1d\x2a\x59\x1f\x8f\xad\x2e\x2b\xb8\xfc\x08\xb0\xaf\x17\x77\x26\x60\x2f\x7a\xc8\xe2\xe2\x4e\xef\xb7\x6f\x66\x6a\xb9\xb8\x4e\x7a\xf5\x69\xf9\x6b\xe8\x56\xe6\x93\x90\xf7\x7a\x86\xf5\xe0\xf7\xe9\x05\xc0\xb5\x6e\xe1\x54\xe2\x67\x4a\xee\x3a\x09\xf6\xda\x48\xda\x85\xdd\x69\x6e\x56\xf7\xf6\x85\x10\xa0\x30\xd3\xdf\x1f\x81\xa8\xd6\x17\xd6\xbf\x24\x40\x2d\xa3\x15\x1c\x17\xdb\x68\xb1\xdf\xcd\xdc\xbf\x04\x8b\xf5\xed\xe4\x7f\xd1\xb9\x79\x65\xf5\x33\x61\x7c\x11\x23\x7b\x91\x67\x9b\x43\xae\x17\x4c\x59\x89\x39\x60\x61\x92\x70\x73\x1b\x34\x7a\x49\xab\xfc\x95\xbb\x8d\x09\x3c\x56\x4f\xb7\x94\xbd\x17\x44\x09\x7d\xea\x6a\xfb\x82\xd2\xbd\xf8\x69\xa6\xe5\x55\xc4\x2b\x35\x97\xfd\x4b\x34\x64\x4c\xb3\xfc\xd0\x66\x77\x12\x84\x79\xa5\x59\x9e\x4a\xa0\xc3\xba\x24\x99\xe8\x57\x2a\xe2\x9e\x83\x16\x8b\x7f\x5f\x00\xbd\xca\xd1\xf9\xeb\xba\x25\x44\xc2\xee\x0a\xd1\xfd\x65\xa7\xce\x26\xf0\x31\xb8\x35\xc3\x8d\xbe\x93\xf6\xfa\xeb\x6d\xe3\xdf\x12\x70\x05\x07\xc4\x5e\x6e\x6c\x2c\xe3\xb3\x57\xc9\x83\x1d\x72\x1d\xd3\xa2\xe5\x82\xeb\xf0\x0b\x6f\xc6\xb7\xac\xe9\x7d\x1c\xb5\x04\xf2\x35\xed\xea\x1e\xff\xaa\x1b\x6a\x3d\xf4\xeb\xb7\x68\xd6\x2e\x70\xeb\x3e\x5e\x92\xb2\xf2\xd1\xdb\x86\x71\x85\xdd\x80\xb0\xf9\xef\x42\xb8\x3d\x0b\x9e\x20\xf4\x9b\x67\x64\x9a\x65\xce\x9b\x39\xa0\x05\xa3\x2f\xf6\x85\x61\xc5\x1e\x88\x58\x7f\xf0\x7e\xad\xa9\x9b\x23\xe4\x06\x12\x73\x81\xb5\xb5\x06\x6b\x0f\x5c\x3b\x4f\x2c\x6d\x3a\x2f\xbf\xb9\x93\xf3\x8b\x7f\xed\x63\xca\xe6\x30\xdc\x1a\x83\x3e\x15\xb0\x43\xa9\x0d\xa0\x76\x85\x31\xfd\xda\x37\xe6\x5a\xb8\x40\xdf\xab\x3a\xb9\xfe\xba\xfc\x2c\x8a\xa4\xbf\x8e\xcb\xbf\x11\xd6\x11\xdb\x57\x7f\x27\x2f\x81\x03\x70\xf6\xc4\x79\x5c\xab\xd7\xce\xbc\x18\x60\xc8\x7a\xeb\x58\x87\x7c\xad\xbf\x60\x68\x37\x00\xea\x19\xc3\x96\x66\x3a\x89\x53\xd9\x71\x48\x67\x8b\x7a\xd5\xe5\xc9\xaf\xa0\xb8\x1e\xfd\x1e\x34\x81\x6b\xdd\xf3\xc7\x06\x80\x0c\xdc\x9f\xe9\xfe\x6d\xbc\xa5\x92\xae\xd5\xb9\x11\x6d\xbf\x88\x9e\x76\x02\xed\xc5\xbd\x55\x40\x06\xf5\xdb\xea\xc1\x6c\x2b\x0b\x0b\x55\x7b\xae\x75\x2e\x4d\x27\x1e\x48\xe9\x60\xd2\x06\x6b\xd7\xfa\x27\x76\xf0\xf2\xcb\x39\x9e\x16\x7d\x91\x76\x30\x4e\x05\xde\xd3\xcc\x42\xef\x1e\xc5\x6b\x7d\x04\x5e\xc9\xcc\xe4\x79\xca\x6d\x85\xc1\x73\xe7\x3a\xfd\x6a\xf7\x13\x2c\x9c\xb8\xa6\x2a\xe6\x28\x34\xe2\x49\x94\x9a\xad\x78\x00\x1d\x2d\x5c\xc5\x9b\xa3\x19\x52\x1c\x28\x9a\x18\x42\x02\xc3\x5b\x7c\x8a\x6a\xcb\x77\x0f\x06\x9a\x82\x67\x5b\x00\x6d\xc0\xa0\xe2\xb2\x8f\x02\x57\xc1\x6e\x6d\x93\xbe\xc4\xc5\x81\xb6\x12\xb8\xd2\x51\x24\xe4\x76\xfd\x94\xd7\xb1\xcf\xc4\x3d\xc6\x78\xad\xd1\x9e\x64\xc1\x03\x92\xbe\x9c\x8b\xab\xb7\xe4\x52\x02\xdc\x35\xbd\xdc\x7d\x74\xa9\x38\x92\xfb\x6d\x53\x9f\x3c\xe8\x7f\x01\xf5\xcb\x2f\x0f\x01\x9b\x8e\xb2\xcc\x1f\xe6\x40\x93\x9d\x2d\x33\xd6\x88\xf7\x74\x5b\xd3\x31\xd6\x68\x43\x97\xb4\x71\xcd\x4f\x50\x3e\xb8\x19\xeb\x8c\xce\xac\x55\xcf\x96\x8c\x09\x2b\x29\x98\x58\xe1\xbf\xa7\xdd\x74\x85\x99\x9f\xd7\x82\x01\x21\xc1\x64\x2f\xe5\xab\x9c\x8c\x13\x83\xb5\x33\x69\x18\xe3\x95\x4f\xcd\xb9\x3a\xe4\xe9\xf1\xe4\x30\x24\x34\xd3\x80\xbb\x2b\x11\xd0\x0b\x5f\x8a\x92\xfa\xad\x20\xdd\x0e\x00\x78\x4b\xa2\x90\x0b\x6c\x4e\x12\x24\x6a\x1b\x39\xd5\xe3\xc6\x1a\xf6\xd7\xb5\x2f\xb8\x77\xf1\x78\xb9\x45\xeb\xec\x02\x3b\x71\xc6\x6f\xeb\x71\x33\x08\xbd\x18\x22\x1d\x2c\x28\xc4\xdd\x0b\x0f\xba\xd7\x68\x5b\xa3\xa1\xfd\x00\xb8\x88\xae\xac\x17\xf3\x1a\x1b\xff\x1f\xa7\xcb\xa6\x2d\x96\xad\x91\x83\xcb\x1a\x88\x5f\xc5\x11\x9a\xf5\x48\xf3\x48\x28\x2d\x72\xdb\xb3\xd8\xc2\x9e\x05\xed\x7b\xf6\xbc\x3a\xef\xce\x3a\xf8\xb7\x70\xe6\x19\xc1\x36\x34\x79\x20\x15\x38\x32\xb6\x6b\x4f\x66\xae\xcb\x2a\x73\x98\x81\x13\x86\x87\xcd\xab\xea\x93\x60\xfd\x53\x8d\xb2\x13\xef\x08\xa8\xbf\x6e\xc3\x37\x42\x77\x87\xf7\xd5\x79\xc1\x2a\xe3\xed\xce\x3a\xb2\x48\x37\xcb\x59\x1f\xd7\xce\x61\x12\x47\x04\xc7\x21\x85\x57\xf4\xac\xdd\x7e\x11\x2b\x0c\xd7\x85\xe6\x25\x34\xc5\xaa\x3f\x10\x95\x19\xf7\x8a\x48\x72\x15\x52\x2e\x24\xb9\x0b\x50\x53\xdf\x9a\x9e\x51\xd1\x9e\x1e\x1a\xed\x8d\x9e\xb3\xc8\x6d\x76\x16\x88\xfd\xf0\x58\x27\x6a\xe4\x9f\x71\xe7\xa6\x6b\x1c\xdd\x8f\x4e\xca\xb0\x0e\x12\x03\x0d\x1d\x9f\x68\x33\x73\x18\xaa\x65\x00\x19\x7e\xf0\x5a\x4f\xd5\x69\x67\x9d\x5e\x1f\x08\x01\x4c\x8a\x3c\x47\x8b\x59\xd4\x49\x12\x88\x69\xd9\x91\xf0\x57\xfb\x02\xcf\x89\x38\x5f\x04\xa8\x70\x03\x5e\xbf\x55\x0d\x94\x9d\x1e\xe6\x74\x49\xdd\xfc\x74\x46\x42\x68\x16\x11\x35\x4c\x23\x1f\xfc\x3a\x03\xb5\x86\xcb\x7c\x0a\x22\xbc\x5d\x7e\xe3\xf3\x7a\xc5\xd6\xed\x2b\xd4\x0b\x5e\x1c\x63\x35\xb0\xf2\xae\x81\x4d\x14\xb4\xa9\x96\xfc\x04\x50\x0b\xf5\x78\xa3\xf4\x20\x44\x13\xa6\x4f\xda\x1d\x8d\x81\xf6\x33\xfd\x83\x56\xb8\xf7\x04\x60\x73\x3b\x9e\x84\x27\xc0\xaf\x55\xc1\xe2\xbe\x9d\x10\x11\xd2\x9e\x12\x02\x98\xce\x30\x13\xc4\xc5\x68\x0f\x9c\x7c\x73\x8a\xc1\x7a\x01\xf3\xe3\xb6\x5a\x25\xf0\xd6\x34\xc0\xc2\x84\x55\xda\xbb\xb0\x5c\x5c\x0d\x09\x6c\xda\x4f\x47\x1d\x1c\x7f\x6a\x4e\x0a\x51\x41\xcb\x36\xe0\xd0\xc9\x23\xf8\x79\xa5\x0e\x8c\xb0\x33\x13\xf8\x78\xab\x61\x71\xbc\x81\xcd\x18\x1a\x94\x18\xb0\x9c\x43\xe6\xca\x70\xef\xe3\xc5\xfc\x0c\x9b\x02\x2b\x00\xcb\xda\x4b\x3f\xea\x25\xc0\x1e\x13\x67\x5f\xbf\xbe\x9c\x80\x9d\xd7\xfe\x0b\xad\x19\xc5\x8a\x5a\x71\x61\x23\x0e\x2c\x61\x0f\x0f\xd5\xec\xfc\x60\xba\x06\xd0\xc2\xb1\x04\x21\xc3\x6d\x55\x72\x86\xe3\x0d\x17\x5c\xf8\x60\x9b\xca\x4b\x87\xa4\x2a\xc9\x19\x26\x66\xf2\x72\xfa\xca\xd6\x4c\x3b\xf6\x20\x0e\xe3\xe1\xa1\xd1\x45\x23\xe5\x70\x71\xd6\x7e\x2e\xde\xc2\xb5\x07\x5a\x3c\x68\x34\xea\x83\x1d\x3c\x06\xf8\xf4\x7a\x3c\x4a\x5f\x84\x33\x3a\x40\x07\xe0\xce\x03\x4d\x79\xb5\xa0\x0b\x07\x0e\x73\x6a\x5f\x62\xd5\xaa\xc7\xd5\xe1\xe9\x88\xb3\xe9\xa8\x1c\x1a\x44\x5e\x2b\x17\x64\x85\xdd\x3f\x07\x49\x14\xed\x24\xc4\x76\x88\x3f\x3c\x5d\xc2\x40\x9f\x04\xc2\xe2\x03\x14\x73\x90\x0d\x33\xc8\x1a\x93\xda\xed\x88\xed\x0a\x5e\x2a\x3e\x2f\x23\x32\x24\x74\x48\x56\xb6\x7e\x8b\x9c\x08\x18\xf9\x7e\xb7\x1f\x92\x52\x24\x82\x44\xfc\xdf\x42\xfc\x66\x5f\x99\xf3\x06\xbb\x9e\x20\x86\xc6\xc6\xaa\x5d\x03\x6f\xab\x59\x95\x80\x54\x3a\x1e\x40\x11\x9c\xdb\xab\xaa\xb0\x96\x4f\x62\xf1\x23\x5e\x5c\xd0\x88\x63\xc3\xf6\x56\x05\x5a\x14\x15\x46\xb5\x36\x45\xfb\x89\x47\x92\xb7\xa5\x0a\xba\x69\xf6\x94\x82\x59\x9c\x85\x5f\x25\xa0\x58\x17\xea\x86\x09\x9f\xde\x91\xe2\x8b\x70\x46\x16\x2e\xe2\x34\xdb\xf6\xd3\xa2\x4e\x15\x86\x34\xf6\x50\x33\x0f\xed\xe8\x46\x90\x86\xd6\x0f\x91\x53\x30\x6f\xc0\xd1\xe1\xfc\xb5\x41\x56\xeb\xea\x7b\x01\x53\x30\xc0\xa2\xc1\xe3\x05\x5d\x15\xc7\x18\xf3\xdc\xac\xbb\xeb\xb5\x83\x1b\x99\x19\x99\x66\x3f\xf3\xe1\x62\x31\xad\xa4\x57\x00\xa1\x63\xd1\xce\x76\x7a\x31\x1f\x4f\x67\x4e\x71\x7b\x92\xd1\x3f\x36\x4a\x56\x1e\x1e\x79\xcb\x75\x19\x72\x8c\xa9\x52\x6d\xcc\x84\x9f\xf6\x52\x5a\x13\xb0\xc6\x82\xb0\x83\x6c\xcc\x37\x77\x4b\x7b\xe3\x28\x27\xb1\x4c\x37\xe7\x60\xf9\x61\xd7\x77\x97\x05\x3e\x46\x8b\xf6\xfc\x40\x1e\x0b\x90\xe1\xb6\x3a\xcd\x6e\xab\x2f\x7d\x54\xc9\xfc\x1f\x08\x15\x50\x3a\xee\x51\x39\xe6\x71\x38\x2a\x8c\x86\xbd\x04\x1c\x35\x23\x34\x59\x3c\x56\x7d\xea\xed\xd1\x19\xef\x06\x28\x70\xc8\xdf\x02\x23\xcf\x18\x66\xe5\x01\xcc\x65\xae\xff\xbb\x78\xbc\xac\xa4\x40\x45\x0e\x64\x6b\xd5\x61\xf6\x45\x59\x10\x5e\xea\xec\xcd\xe2\x91\x44\x42\x35\x00\xc8\x87\xa6\x01\xe8\x85\xe9\xed\xb9\x63\x45\x7b\x37\x16\x6c\x6d\xdf\x63\x6d\x88\x9d\x63\x4d\xd7\xa1\x58\x1c\x00\x0b\x35\x17\x14\x64\x2d\x6b\x66\xe4\x15\x98\x6d\xcd\x7a\x57\x36\x38\x88\x50\xa0\x35\x07\x56\x75\x56\xaa\x8e\x19\x11\xa1\x02\x4a\x32\x9f\x98\xb9\x2a\x4c\xfd\xb0\x76\x97\xdc\xf3\xc7\x1c\x70\xd0\x63\xce\x57\xc4\x42\x03\x92\xfc\x1b\x7a\xe1\xc7\x1c\xe3\xe4\x18\x2f\x5e\x1b\x0c\xb9\x34\x2e\xfb\xd3\xda\x66\xe1\xdb\x82\xbe\x1e\x88\x81\x0e\x4d\x3b\x9e\x69\x8c\xc0\x7b\xe7\x23\xfb\xb4\x5e\xff\x7c\xda\x08\xef\x65\xfd\xe1\x21\x14\x6f\x18\x0b\x44\x6d\xaf\xe8\x4b\x06\xbc\xa7\xda\x2d\x6a\x8e\x3b\xff\xf5\x28\x70\xbb\xcd\x4c\x89\x40\x21\x40\xca\xe3\x45\xde\xb7\x63\x52\x04\xf0\x36\x1b\x0a\x3b\x39\x16\x59\x6f\x6c\x75\xa1\x62\xaf\x3d\x9b\xfc\x6d\x40\x80\xb0\x9b\xd3\x3b\xea\x9b\x29\x6a\xca\xe9\x66\xd3\x4f\x27\x69\xbf\x4d\xa6\xc7\xac\x92\x49\x6e\x9e\x5a\x6c\x83\x9b\x3e\x20\xcc\xc2\xf6\x6c\x12\x8a\xc7\xa4\x21\x00\x17\x96\xe5\x77\xc6\xbd\x66\x27\xad\x33\x44\xb6\x61\x7b\x18\xbe\xec\x2e\x71\xcb\x65\x8b\xce\xa5\xa7\xd9\xc4\x2d\x99\xa0\xb4\x42\x23\xa4\xe7\x61\x86\x68\x92\xd9\x85\x7b\xcd\x03\x85\xd5\x0e\xa4\xda\x71\xf7\x99\x78\x06\x80\x9c\x15\x8b\x73\x30\xb2\x44\xa6\xb5\xe2\xb8\x69\xab\x32\xe9\x7a\x26\xca\xf9\x94\xf9\x88\x0b\x96\xbe\xed\xe1\x26\x68\xf9\x9f\xe4\xd2\x88\x6b\xe6\x96\x72\xd4\x4e\x99\x0f\x08\xe3\x6f\xd5\x67\x38\xe0\x1b\xd7\x97\x32\xef\x1a\x1b\x39\x32\xe4\x6c\x90\x00\xc0\x47\x24\x47\x2b\x06\xc1\xf0\x59\x96\xea\x35\x84\xe7\x73\x6a\x15\x11\xdf\xd9\xbb\x85\x08\x82\x46\x8b\xd2\x38\x3c\x42\xfd\x68\x56\x44\x5e\x1d\xb9\xac\x0f\xf9\x3b\x8f\x1c\x07\xdd\xb6\x40\xa7\xde\xa1\x38\xf9\xc3\x23\x35\xa3\x1a\xca\x14\xfa\xa6\x63\x3d\x4a\x6e\x22\x40\x4c\x2b\xf4\x76\x71\xc4\xb0\x4e\x71\x25\x52\x40\x18\xcc\x9c\xe3\x92\x21\x8c\x4b\x9f\xc2\xfe\x6a\xc3\xbb\x66\x7b\x90\xde\x81\x7c\x87\x78\xd2\xa4\x31\x3f\xd0\x2e\xcb\xc2\xae\x31\xe2\x8e\xf3\xca\x1a\xd1\x8b\x76\xb3\x54\x2b\xf4\xb6\x3f\xce\xb3\x8b\x13\x10\x67\xb2\xa6\x27\xe5\x60\x1c\xfd\xb4\x8b\x61\x0b\xf6\x34\xb8\x63\xe4\x67\xf7\xf7\x43\x8b\x28\x26\x1d\x42\x6a\xd5\x88\x87\xaa\xac\x89\x51\x06\x07\xf4\x86\xb9\x39\x3c\x2d\xfa\x48\x27\x09\x51\x99\x61\x87\xca\xeb\xd5\x46\x22\x8f\xb4\x6b\xa3\x70\x59\xf9\x46\x3c\xfb\x7d\x24\x62\xde\xda\xd4\x55\x46\xc7\x1f\x67\xe1\xab\x9d\x2c\x4e\xa3\x88\x0c\xfd\xc8\x3d\x55\x69\xbc\x34\x70\x40\xcc\x0c\x09\x04\x03\x2d\x5d\xc0\xe2\x50\xc5\x92\x3a\xe5\xeb\x98\xa5\xf7\x01\xc4\x47\x36\x75\x76\x04\xc2\xe4\xc2\xf6\xba\x75\xc2\x0e\x45\x9f\x01\x32\x40\xf6\xb1\xa3\xa5\x71\x32\xf0\x11\x04\x00\xb7\x3a\x53\x7c\x75\xf3\xa0\xaf\x01\xc8\x52\x2e\x76\x04\xff\x59\x42\xbc\x60\x6e\x39\x06\xb6\x81\xa2\x8f\x25\x4a\xcc\x27\xc3\xa8\xf7\xe9\x0d\x5f\xa0\xa2\xf9\x8c\xef\x35\x40\xd1\xf6\x35\xe7\x17\x75\x77\xd0\xa3\x58\xb5\xc1\xf4\x47\x8a\xc0\x1e\xe3\xf4\x76\xa6\x5b\xa5\x6a\xf5\xee\x7d\x56\x35\x43\xec\xf9\xf1\x95\x4a\xb4\x72\xed\xcd\xd7\x68\x46\x53\x61\xdc\x4b\x27\xd9\x5b\x9c\x9a\xce\x61\x7a\x9f\x13\x47\xb7\xed\x19\x22\xe4\xf7\x25\x8a\x1e\x48\xd1\xd5\x07\xcd\xb2\x4a\xec\x39\x82\xa5\xc0\x2d\x13\xa5\xe4\xae\x4d\x40\xa3\x0f\x97\x46\xd7\xba\xd6\x7a\x8f\xa5\x08\x8d\xbe\x4b\x8a\x52\x3d\xa2\x48\x78\x6f\x46\xee\x9c\x02\x37\x01\x56\xdd\xf1\xb8\x69\x99\xe6\x6a\x41\x77\x94\xd8\xec\xcc\xc4\xa5\xc8\xb2\xbf\x09\xd1\x77\xd1\x5e\xf3\xd8\xe9\x07\x03\xcf\x0a\x73\xe9\x03\x80\x0c\x38\xd6\x6d\xcf\x73\xb3\x99\x94\x01\xa3\xdc\x58\xe4\xba\x8f\xe9\x43\x34\x7f\x57\xf0\x3a\xf7\x08\xd2\xd9\xf9\x41\xd1\xb6\x66\xe6\x1f\x8d\x14\x07\xe5\xe2\x94\x7d\x50\x9a\x17\xb2\x88\xb3\xdc\xa6\x80\x4e\x0b\x8a\x8c\x18\x0f\x9c\x9f\xb8\xc4\xd9\x3d\xd0\xb4\x20\xa5\xf8\x75\x33\xa9\xdd\x7c\xde\x19\x30\x7b\x06\x00\x20\xf0\xd4\xe3\x1d\x0a\x49\xe0\x74\x40\xac\x47\xf5\x56\xad\xab\x77\xe5\xb8\xb4\x0f\x7b\x69\xee\xf8\x58\x94\xb3\x37\xc5\x09\x44\xce\x48\x16\x64\x17\x1c\x1d\xc4\x35\xcb\xb8\x41\xd1\xf9\x5f\x5a\x62\x7e\x3e\x34\x1c\x6f\xcf\xd2\x1a\x44\xee\xc1\x9e\xac\x0f\x66\xb5\x2d\xd1\xe9\x66\x0e\x7a\x8c\xf3\xd0\xd7\x80\x93\xf7\x77\x87\x1b\xbc\x5c\x1f\x2c\x72\x70\x2e\x94\xae\x1a\x18\xbc\x2f\xe0\xf9\xa6\x8f\x62\x69\x67\xd9\x07\xfe\x97\x40\x6b\xce\xec\x5a\xd8\x85\xf3\xac\x5b\x38\x20\xb2\x2e\xdf\x9a\x16\x31\x68\xc8\xb8\xbe\xaf\x88\x82\x82\x77\x4a\x54\xbb\xf5\xfd\x64\x57\x7b\x4f\xaf\x39\x20\xe8\x5e\x41\xfa\xfa\xa9\x7d\x43\xf7\xe4\x9f\x80\x9d\x3d\x77\xb8\x96\x31\x04\xc1\x03\xb5\xda\x71\xf7\x78\x80\x0f\xc2\x79\xb2\xa7\x82\x17\xd0\x1e\xc0\x61\xaf\x5a\x6d\x62\xbc\x0c\xa2\xa9\xf9\x6e\x0a\x34\x0e\x5c\x35\x4f\xb0\x75\xd2\x61\x71\x03\x9d\x35\x40\xe1\xfa\x04\xb7\xda\x7b\x07\xce\xab\xbe\x64\xc9\xe1\x6b\xdf\x6b\x4d\xd4\xcf\xa5\x1e\x1d\x8d\xf9\xab\x71\xab\x8f\xdb\xe4\xa1\x5a\xa1\x68\x7c\xc4\xcc\x71\xa1\xef\xc0\x4c\xe4\x2b\x11\xe5\x0a\x89\x63\x4c\xaf\xf3\x5a\x38\xb6\x6c\xe6\xb7\x3f\xfe\x80\x5c\x3f\x84\xfc\xa5\x39\xd0\xcc\x32\x56\x85\xff\x6d\x17\x02\x24\x49\xb5\x16\x2c\xf8\x1a\xbc\xeb\x65\xd3\x86\x01\xf6\xae\x10\x8f\xcb\xec\x9e\x1f\x06\x00\xa1\xeb\x60\x97\xeb\xed\xbc\x5f\x87\x5d\x0f\xb8\xc2\x5e\xca\xd7\x00\xc7\x8a\xdb\x49\x38\x67\xd7\x21\x26\xb3\xb9\x62\x44\x6c\xd7\xec\xf3\x13\x57\x26\xbc\xb5\x7b\xf8\x88\xb7\x66\xc5\x09\x3b\x35\x5e\x75\xfd\xa8\xa5\x36\xc8\xcd\x3f\xe2\xa7\x71\xff\x00\x60\x82\x56\x7d\x7b\x30\xc4\xae\xbe\x77\x34\x94\xf8\xde\x35\x7c\xb5\x96\xeb\x62\xcb\x1d\x89\xf5\x41\xb5\x16\x84\x15\x4a\xa8\x6b\x98\x18\x37\x3a\xc3\xb6\x57\x25\xc0\xbe\xf6\xe2\xfb\x44\xbe\x38\xd9\x29\x54\xd8\x36\xaf\xce\x37\x7d\x09\xb6\x9b\x4e\x40\x02\x76\x18\xeb\xe7\xa5\xc9\x1f\x42\x54\x9b\xc3\xf8\xa3\x26\xda\xf0\xe4\xc0\x69\xb2\xc7\xa1\x5a\x4d\xb0\x9d\x61\x15\xed\x03\x09\x49\x08\x61\xd2\xe9\x91\x98\xbd\x7d\xec\x00\xaf\xfa\x19\x48\x6f\x6b\xdc\xf8\xdb\xe2\x28\xec\x8d\xd8\x4f\xb7\xa3\xb7\x43\x30\xf6\x21\x2b\x48\xd4\xe7\x26\x10\xf5\x41\xc1\x02\xbc\x92\xcd\xd1\xe2\xc9\xb0\x3e\xaa\x0e\x0b\x61\x06\x32\x1f\x76\x17\x49\xda\xad\x7c\x2f\x31\x8d\x75\x88\xaa\xad\x9e\xc9\xbf\x55\xd5\xed\x5b\x9d\xdf\x5a\x72\x7e\x2f\x2d\x4e\x7a\xf3\x3c\xa7\x3e\xac\xc8\xa8\x44\x41\x00\x07\xe4\x97\x08\xa4\x1d\x14\x61\x6f\x24\x3c\x81\xce\xf3\x92\x5d\x73\x7f\x8e\x67\x6b\xf7\xb1\xc9\x02\x16\x36\x52\x85\x37\xda\x2e\xb9\x17\x77\x1a\x45\x3e\x0d\xf3\x4d\x09\x0a\x62\x36\xcd\xa3\x09\x95\xa1\xb0\x38\xdf\x5b\x11\x4e\x36\x43\xd5\xc4\x06\x1c\x91\x8c\x1e\xd4\xc1\x66\x73\xeb\xd6\x31\x4a\x1e\x46\x00\x4c\x36\x1f\xe9\xb2\xe5\x06\x32\x2f\x9b\x16\x5b\x01\x98\xac\x34\x5d\x93\x2b\xc0\xd9\xae\xf7\x2d\xfb\x29\x24\x71\x11\xd9\x74\xf3\x2f\x19\xd7\x9a\x67\x0d\xc9\x99\x49\x85\xd5\xad\x84\xc3\x6a\x2b\xa3\x5a\xf3\xb4\xdc\xc8\x42\x54\x97\x9c\xf9\xe6\x96\xde\xf3\x9a\x19\x7b\xbc\xd9\x25\x0c\x7a\xf6\x7e\x23\xae\xcd\xe4\x4e\x00\xd7\xfe\x01\x06\x2d\x92\x80\x7d\x0e\xb4\xf6\x84\xd6\xb6\x6a\xc0\xfa\x05\x97\x0a\x02\xde\xb2\x90\xbb\x58\xc6\xf7\x44\x22\x6c\x5c\x11\x94\xd0\xbf\x8f\x9f\xdc\x4b\xc5\x23\xb5\xeb\x5f\x17\x3d\x57\x53\x8a\x57\x0f\xfa\x99\x95\xba\x81\xdb\x83\xcf\xfb\xc3\x41\x5d\xeb\x85\xf7\x13\x65\x34\xe0\x7e\x69\xb4\x74\xba\xcd\x5f\x2b\x7d\xfe\xed\x6a\xfb\x55\xb4\xc6\x16\x8b\x3b\x74\xb4\xb2\x4c\x7b\x6e\x9c\xe8\x07\x1b\xe3\xf8\xf1\x03\x72\x60\x78\x35\x9c\xcb\xbd\x7f\x70\xb9\x75\x5b\x1d\x21\xa6\x67\x39\xef\xc8\xd3\x21\x23\x7b\x2f\x75\xa8\xa1\xe8\xed\x54\xee\x35\xf4\x4f\x51\x42\x02\x26\x4d\xe9\x7b\xb9\xbf\x98\x9f\xc1\x0d\xd1\x03\x6c\x1d\x7a\x9b\x6d\x89\xfb\x88\x42\x84\x35\x6e\xf7\x20\xc4\xd6\x88\x48\x01\xf4\xa6\xb9\xbe\x3b\x25\x82\xa1\xd0\xed\x95\x80\x35\x2b\x4c\x4c\xdd\xdc\xb2\x64\x56\x90\x61\x47\x87\x88\x5b\x7b\x3c\x54\x0c\xe2\xb6\x49\x43\x7f\x67\xed\x27\x6f\x51\x49\x78\x4b\x89\x1f\x64\x78\xeb\xb4\xbd\xf4\x7c\x6b\x7a\x73\xf9\xed\x73\xc8\x8f\x5a\xfa\xd7\x7b\x47\x68\x4b\x72\xab\x81\x03\x1e\xd1\xa4\x00\x81\x6b\xe6\x21\x6d\x15\x87\x7b\xfb\xd4\x91\xa8\x69\xa6\x1d\x7d\x09\x77\xfb\x59\x17\x95\x4f\x86\x47\xe8\x72\x43\xfb\xd0\x00\xec\xf6\x04\x6d\xe8\x48\xf5\x51\xf8\x78\xe4\x51\x64\x8d\x80\x94\x94\x58\xb9\x7d\xe2\xec\x2d\x81\x02\x27\xd7\xd4\xb7\x37\xad\xb9\xa1\xb9\x15\x32\xe3\x46\x0b\x85\xdc\xec\xae\xcd\x49\x27\x14\x81\x8d\x66\x09\xcd\x6e\x86\x82\x2f\x37\x6f\x76\xd1\xc7\x0e\x12\x38\x5e\x13\xd5\x6d\x56\x42\x55\x39\x69\xd7\xf6\xaa\x07\xfd\x3d\x31\xf2\x42\x2c\xf4\x31\x47\xe3\xc3\xea\xcf\xa8\x22\xac\x45\xc4\x27\x1a\x06\x5b\x1a\xf5\x4d\xb4\x75\x44\x03\x3b\x47\x1c\xfa\x9f\x6b\x14\xbe\x82\x21\xce\x87\x1e\xf6\x5e\x14\xb2\xa1\x02\x37\xf1\x0b\x4f\xce\xfb\xfe\x01\xc9\xdb\xb1\x15\x04\x19\x66\xc8\xb2\xe6\x7b\x46\x5b\x0b\x19\x40\x3c\x42\x7b\x16\x4e\xe5\xe1\x99\x69\xaf\x69\xbe\x1a\x7d\x7c\x8e\x4d\x3b\x5a\xbc\xd9\x0f\x85\xdc\x79\xb2\x61\x18\x9c\xf8\xbe\x2e\x31\xc6\x1b\x73\x57\xb4\x59\xe5\x77\x55\x07\x35\xa4\x88\xee\xa8\xf0\x99\xf9\xb4\x47\xd5\xaa\x0f\xb8\x7f\xfe\x00\x22\xe0\x96\x3f\x7a\x41\x69\xfe\x3f\x33\xfc\xee\xd6\xdd\xbb\xbd\x15\x51\xc3\x2c\x7f\x0f\x59\x99\x3b\x35\x3c\x20\x95\xdc\xe9\xe5\x76\xda\x12\x4f\x4e\x3a\x38\x4c\x60\x72\x60\x57\x86\x5c\x4b\x98\xdd\x0f\x7e\x55\xb0\xab\x23\xe9\xfc\x3c\x16\xde\x79\xbb\xac\x1a\xe6\xab\x4f\xa4\x79\xee\x0f\xf6\xf3\x91\x54\x37\xf0\x5d\xaf\x0f\x9d\xfa\x83\xdf\xd8\xda\x61\x0c\x63\x67\xb8\x76\x2b\xf0\xcc\x3a\xe6\xfb\xdb\xd4\x7b\xc7\xf5\xdb\xbe\xab\x3b\xb7\xf2\xbd\xe7\x32\x37\x40\x79\x5e\xbd\x1a\x5b\xdf\x50\x7e\x71\x23\xb5\xff\xb1\xe6\x7a\x49\xa9\xd0\x0c\x4f\x69\xb7\xe9\x1e\x5d\x15\xb3\x95\x38\xbe\x5e\x3b\x18\xd6\xc5\xcd\xa5\x3b\x9e\x97\x66\xcf\x68\x38\xe6\xe3\xb6\x5b\x40\xef\xda\xf2\xf9\xd6\x0b\xda\xe6\x30\x4e\xff\xea\x7d\x52\x72\xd7\xea\xa3\x75\xde\x6a\x74\xac\xb9\xea\x09\x20\x89\xad\x8a\x52\xab\xd4\x4a\x8f\x96\xb1\xbd\x2a\x4d\x05\x53\xef\x08\xac\x75\xaa\xa4\x7d\xd7\x8e\x3d\x21\x6b\x9c\xbf\x78\x8b\xcd\x22\x70\x63\x65\x48\xd9\x5a\x3a\x4d\x34\x78\xbe\xe6\x57\x24\xcb\x99\x49\x4d\xc8\xb0\x13\xb5\x48\x3f\x8b\x6d\xc1\x3e\xc9\xad\xbb\xe6\xdf\x36\xfb\x8a\x59\xd6\x78\x40\x6c\xb9\x9f\x95\x0f\x75\xbf\xea\xee\x0f\xfc\x2a\x14\x9d\x35\x1d\x1c\x01\xcf\x8f\xbd\xa3\xd2\xf9\x40\xac\x72\x9e\xae\xd6\x5b\x23\x20\xc2\x7d\xce\xe9\x63\xdc\xc8\x66\x70\x7f\x48\x08\x3b\x42\x98\x62\x0d\x45\xef\x35\x11\xe6\xb9\x92\x74\xb4\xa6\x87\xbb\xcd\x97\xb7\xf5\x47\xf7\x81\x35\xf2\xf2\x9e\x95\x5b\xb2\xbc\x9d\x93\xfa\xe5\x28\xf4\x32\xdf\x30\xf4\x00\x8c\x8b\x61\x7e\x3a\x52\x81\xb8\x74\x61\x91\xaf\x53\xdf\x1e\x5a\x6e\x1c\x02\x68\x5f\xc7\x33\x68\xe9\x7b\x90\xb5\xcc\x24\x99\x75\xb9\xe6\xd7\x3d\x73\xb6\x56\x40\x3a\x02\x6b\x6c\xf5\x42\x0d\x4e\xf3\xf5\x93\x3d\x93\x74\x89\x81\xd3\xe5\x1a\xe0\xf6\x1a\x63\x59\x87\xac\xab\xb0\x7b\x47\x76\x61\x0d\xb9\x20\x8b\x3b\xcb\xc0\x47\x72\xa3\xbd\x8b\x5a\x6e\x06\xc7\x7e\x96\xea\xd1\xd7\xda\x06\x11\xeb\x7c\x02\x85\x58\x77\x0b\x83\xa3\x34\xd8\x81\x72\xca\x7a\xac\x63\xa6\xce\xbe\x42\x5f\x99\x3b\xd8\xef\x7c\xbc\xa5\x2a\xd2\xc8\xc7\x61\xde\x61\xc4\xea\x78\x03\x56\xd6\x72\x28\xec\x49\x8c\xf5\xb5\xa2\xbd\xfd\x97\x55\x18\x29\xbb\x03\x93\x2d\x09\x8c\xe4\x4c\x14\x46\x35\x33\xed\x9a\xea\xd8\x1f\xfe\x91\x04\x9e\x5d\x79\x35\xa0\xb3\x5f\xbc\x0a\x3d\x2f\x94\x8f\x45\xea\x28\xca\xf9\xf7\x9b\x88\x7e\x2f\xcc\xc7\x27\xaf\xbd\x5d\x19\x7b\xce\x4e\xc7\xb6\x2e\x40\x5b\x7c\xf6\xab\x38\xef\xe7\x22\xbf\x62\xf9\xbf\xc8\x0a\x8c\xe5\xef\x11\xa9\x62\x85\x0f\x67\x8b\xe8\xee\x45\x5e\x09\x10\xde\x35\x82\xee\x0e\xa9\x67\xd9\x4f\xd9\xcb\x7d\xa0\xeb\xf0\x42\x2a\x25\xd7\x97\x93\x6b\x29\x33\xc4\xb8\x2a\xe5\x2c\x1c\xfb\xde\x44\x56\x96\x32\x5e\xc8\x69\xaa\xb4\xf7\xfb\x8c\x00\x0b\xe3\xa5\xb1\x2e\xc3\x25\xa1\x4f\xd8\xae\xaf\x4b\x7b\xe7\x28\xff\x82\xf1\x1c\x6d\x7c\x48\xdc\xac\x53\xde\x61\xa1\x39\xeb\x5d\x23\x16\x26\x7b\xe0\x98\xd1\x63\x5f\xd2\x41\x11\xab\x0b\x50\x5d\xa4\xb7\xef\xfd\xa5\x24\x1e\x6b\xfa\x5f\xfe\xa6\xc2\x88\x39\x0a\x6c\x35\x8b\x41\x99\x0b\xc2\x65\xed\xa5\xd5\xef\xcb\x42\x7e\x3b\xc6\x64\x38\x67\x6e\x3c\xdb\x25\x8f\x89\xae\x1e\x58\x7b\x92\x31\xbb\xc3\xd7\xe3\x18\x16\x75\x2e\xac\x65\x73\x31\x1a\x0a\x5c\xd9\x5f\xfd\x16\xc0\xd9\xc5\x19\xd2\xf0\x71\x1d\x6a\x2d\x2f\xfd\x8a\x98\x21\xbe\xd0\x3d\x12\x5b\xa7\x37\xbd\xc9\x4b\x7a\x6f\x6c\x5c\x9a\xc5\xe0\xa5\x25\x5d\x9a\xb6\x78\xda\x25\xb5\x20\x75\x0c\x36\xbd\xc3\xd0\x9c\xbb\x6b\xb7\x24\x75\x30\xc9\x82\xe7\x1e\xa0\x15\xbd\x04\x24\x7d\x77\x61\x4f\x99\x59\xcd\x55\x04\x8d\xea\x09\x43\x93\x32\xc8\xf2\x30\xd5\x0c\x5b\x3c\xa6\x6d\x0f\xd3\xbe\xfa\xf4\x52\x7a\x81\x53\x57\x7f\x89\xc3\x58\xfb\x00\xae\xaf\x4c\xbc\x5c\xd2\x22\xce\xfa\xec\x9f\xc8\x78\xbc\x31\x50\xb0\x24\xb1\xea\x67\x40\xa9\xfb\x49\x6b\xce\x1e\x79\xa9\xdd\xcc\xa9\x68\x47\x4f\xeb\x0f\x6a\x89\x9f\x1c\x51\x60\x0b\x94\x1f\xf4\xea\xdb\x64\x11\x69\x1f\xc7\xc4\x1b\x09\x98\xca\x4c\xe2\x92\x00\xf1\x3a\xc9\xd1\x29\xcf\x4b\xca\x33\x6a\x29\x5e\xb1\xa1\x67\x85\x17\x6a\x3e\x80\xc5\x5f\x9c\x3e\xd2\xee\xe2\x53\x9a\x9d\xf8\x00\x26\x4f\xc0\x58\xbe\x39\xfa\xbe\x7c\xe3\x5b\xc2\x4b\xeb\xcd\x3b\x5f\x1a\x1c\xef\x5d\xc8\x73\xf8\xc1\x56\x37\x14\x65\x39\x5f\x8b\xc0\xee\xae\x3a\x13\x20\xf1\x10\xc8\x98\x2f\x0a\x77\xcf\x8a\x30\x17\x28\x5e\x2c\x70\xa4\xfb\x53\x6e\x64\x8e\xc1\x7b\x33\x14\x75\x3e\x57\x0e\x4c\xcc\x80\x45\xf8\x94\xa4\x33\x9b\x72\x68\x67\x6e\xb0\xc5\x19\x48\xa0\xf0\x21\xcf\x55\x6d\xfa\xb9\x16\xad\x88\x71\x60\x0e\xef\xb3\x6d\xa7\xd6\xd4\x6c\x2d\x2f\x2e\xa8\x64\x6d\x37\x76\x5a\x9d\x42\x71\xe6\x9a\xd8\xdd\x77\x19\x1a\x1e\xa3\xb5\xf7\x2f\x49\xc9\x3b\x68\xfe\xe2\xef\xeb\x93\xe3\x19\x4d\x4c\xdd\xf1\xf2\x52\x79\xd4\x8c\xd1\x61\x9d\x5f\xc2\xcc\x07\x8a\x1d\xba\x03\x49\xa3\xad\x28\x34\xdd\x52\x14\x3c\x47\xf6\x8b\xbc\xf9\x90\xa0\x71\xbe\x8c\xb0\xf7\x09\x2e\x35\xce\xfc\x74\xb9\x59\xb3\x93\x2e\x4d\x7b\x41\x30\x0a\xca\xb7\x6a\xce\x91\x40\x0d\x8b\xdc\xf3\xe0\xe8\xcd\xd9\x23\x84\xf9\xbc\x5b\x47\xec\xef\xab\x41\xe6\xf9\x3d\x9a\x51\xab\x04\x94\x9f\x76\x03\xdf\xbb\xf6\x19\x0c\x40\x51\x8f\x30\xfc\xf3\x39\x5b\xa7\x92\x18\x96\x39\xbd\xde\xf1\xca\x9b\x1d\xae\x40\x33\x3d\xcf\x4d\x05\xeb\x10\x88\x1b\x7f\x59\x67\xdb\xbb\x6a\x33\x2a\x12\xfd\x7c\xee\x8d\x42\x1f\x4d\x12\x8f\xd0\xa6\xa1\xcf\xde\x6c\x8d\x36\xea\x18\x24\x17\x2c\xd5\xba\xb1\xbf\x67\x8e\x21\xac\x99\xe9\x0c\x33\x34\xfc\x7d\x0a\xb4\xd8\x65\x4d\x2d\xd2\xf2\xfb\x69\x7f\xdb\xe7\xdf\xcf\xde\xd1\xf5\x7e\x60\xdf\x9e\x77\xcf\x37\xe1\xdb\x5f\xde\xe7\x2b\xd1\xb9\xfb\xbc\xfe\x20\xff\xe1\x56\x38\xb7\x9e\xfb\xd5\xff\xbd\x35\x98\x6c\x4d\x17\x86\x4c\xd3\x7e\xda\x42\xe4\xd7\x5b\x7b\xd4\x19\xf5\x15\x55\x3c\x81\xef\xf5\x7a\xa4\x7f\x6e\x58\x9d\x27\xcc\xba\x75\x45\x9c\xfa\xbe\xd6\x7f\xd1\x6b\x07\xdd\x3e\xd9\x06\xb4\x83\xb5\x48\x82\xde\x19\xf7\x7e\x00\xb3\x47\x4e\x58\x5d\x29\x60\x83\x7d\x63\xc5\x98\xb7\x35\x39\x63\x05\x81\x93\x74\xfa\x96\xd8\xf8\x04\x9c\xba\x0c\xb2\xe7\x3b\xe0\x12\xb4\xfa\xd4\xf4\xad\x41\xa0\x67\xcf\x9e\x58\x7a\x52\xeb\x27\x5d\x6d\xeb\xe9\x78\x52\x15\xcd\x25\xda\xcf\xcf\xfc\x2b\x26\xfd\xaf\xa2\xeb\x9f\x79\x7d\xf3\x7e\x3e\xf3\xa8\x17\x11\x01\x0f\x87\xba\xa0\x4f\x08\x01\x69\xdd\x44\x72\x3f\x38\x10\x4f\xa2\xe8\xd1\x3d\x1d\x2e\x9a\xb1\xe7\x04\xe1\x4d\x3f\x5e\x5c\x73\x62\xf1\xad\x3e\x9f\xf5\xeb\xe8\x0d\xe5\x9f\xeb\xb7\xf8\x64\x47\x2b\xa5\x6f\xdd\xc8\x9f\xeb\xe7\xed\x18\x4f\xb7\x07\xc7\xfa\xfe\xd4\x48\x37\xfa\xa9\x52\x27\xf9\x71\xbd\x75\x36\x3f\x7f\xc4\x4a\xf9\xa9\x6a\x9c\xff\xc0\x6d\xa8\xc5\xa6\x35\x3e\xd8\x3f\xd6\x26\xf3\xad\xd9\xf7\x8d\xd5\xf9\x8f\x23\x55\x65\x71\x19\x75\x18\x6c\xea\xfd\xb3\x9f\xbc\xfe\xf9\x03\xf7\x83\x54\x06\xb1\xef\xf3\xca\xed\x58\x9d\xad\xd7\xf6\x87\x5a\xf6\x3f\x79\xc0\x67\x9d\x30\x7d\x0c\x20\x69\x7c\xfe\x27\xbd\x85\xe7\x8f\x34\xe1\x9f\xb4\x2f\x59\xa0\x7c\x06\x27\xfe\xa4\x51\xa0\x7d\xeb\xf1\xda\x4b\xe4\x0f\xd5\x8f\xc0\xbf\x98\xba\x02\x29\x0f\x2e\x45\x35\xf9\xe3\x99\xf3\x3f\xae\x33\x02\x67\xab\x53\xea\xaf\xc5\x79\xee\xe0\xa2\x07\xc1\x7d\x87\x04\xf0\x2e\xde\xbd\x28\x40\xe0\x9b\xbf\x55\xe6\xc8\xa8\x78\xe7\xfb\x7f\xd4\x6b\x51\xfc\x18\xa5\x03\xa5\xdf\xaa\xf2\xb1\x09\x88\x59\x33\xf2\xd7\x63\x53\x30\x98\x54\x3e\xf0\xfb\x57\x97\x6e\x9a\x3f\x65\x3f\x1b\x7d\xdf\xf5\x8c\xc3\x1d\xed\x64\x7f\x4e\x5b\xe6\x85\xc7\xc7\x51\x28\xc3\xcd\xe3\xd6\x13\x25\xd9\x3f\xb6\x9c\x15\x27\x4a\x6c\x7f\x59\xdb\x61\x5a\x11\x41\x0b\x7b\x14\x7a\x7b\x86\xee\xed\x01\xab\x32\xc6\x82\x63\x2c\x05\xd2\x4c\xac\x7f\x9c\xef\x66\xed\xd7\xf2\xd1\xfe\x76\xc0\xff\x18\xe0\xf8\x0f\xc0\xbf\xce\xc6\xea\x4e\xb6\xc1\x59\xe2\x31\xff\x38\x0b\x45\xe7\xa6\xbb\xc2\xfc\x17\xce\x1a\x35\x91\xcf\xc9\x1b\x84\xd2\x96\xf7\xd4\x8a\xb6\xef\x9b\x16\x07\xac\xff\xd1\x78\xfd\x21\xa2\x05\xbe\x7f\xeb\xb3\xa9\xc0\x23\xf1\xa1\xdb\x9b\xef\x6f\x7d\x75\xaf\xe4\xcd\x4e\x92\x37\x20\xee\x53\x0a\x68\x56\x84\xce\x95\x80\xf4\xf0\xea\xdd\x17\x67\x40\xe3\xe4\xad\xfb\x0f\x0c\x62\x58\x76\x3e\x6d\x75\x80\xf8\x3e\xe4\x0c\xd8\x15\xa1\x49\xa1\xd4\x7b\x49\x8c\xc0\x0f\x0d\xf3\x3f\xfc\xe7\x62\x13\xbb\xd6\x08\xff\xd7\xde\xce\xd9\x11\x52\x94\xfc\x6b\x3f\xdb\x33\xd2\x82\x8e\x34\xc7\xb5\xfc\x75\x84\x7d\x9d\xfc\x3d\xd0\x8e\x7b\xc2\xfb\xbf\xa4\x1d\x10\x17\xad\x2f\x7e\x08\x33\xd7\x49\xe4\xd2\xc7\x0d\x4f\x83\xed\x20\xf5\xba\x2e\xcb\x86\x20\x12\x6e\x62\xf1\x71\xc2\x36\x52\xec\xe5\x6d\x6f\xb9\xed\x28\x97\xa3\xfd\x54\x6e\xd1\x80\xcf\x21\x40\x2b\xd6\x23\xe4\x10\x16\x0c\x34\x49\x16\x1c\x52\x03\x42\x74\x22\x57\x2a\xf2\xed\xa0\x2c\x20\x9d\x02\x64\xfa\xb5\x96\x02\x8a\x8a\x6e\x81\xd9\x15\x2d\xd4\x5d\xfa\xb9\xc3\x78\x7b\x98\x88\xc2\x76\x49\x8e\xd9\xdb\x9d\xf1\x16\xce\xde\xde\xa0\x59\x3c\x1c\xce\xbe\x40\xee\x72\x80\x64\x81\x3f\x3d\xbd\x88\xe9\x1e\x77\xe7\xdb\x90\x14\xc1\x25\x85\x02\xab\xcd\x56\xcd\xa7\xfb\x0c\x2a\x04\xd0\x2f\xe6\x55\x99\xae\x95\x44\x7d\x6b\x81\xa6\x90\xcb\x84\x2e\x81\x20\x26\x66\xaa\x43\x0f\x91\x82\x30\x3c\x41\x5c\xeb\x5b\x27\x31\x06\x8f\x27\x29\xc3\x79\xce\x05\xd1\xe9\x68\x02\xf3\xd3\x37\x9d\x0b\x45\x0a\x3c\xfe\xd3\x26\xb3\xe0\xfe\x27\x89\xfe\x27\x07\x51\xa7\xaa\x37\xc9\x8c\x50\x02\xb0\xfa\x07\xac\xa5\x2f\x4a\x08\xc4\x4b\x0a\x1b\x14\x83\x30\x19\xd6\x08\x01\x98\x5b\xe0\x70\xaa\x4d\x08\x40\xf9\xaf\x53\x2d\xf1\x06\xbb\x8a\xc0\x4c\xb6\xd6\x54\xa3\x29\x3d\x49\xd9\x0d\xd2\x01\x45\x12\x03\xc2\x55\x4c\xcb\x22\xa1\x86\x22\x70\xcf\x54\x10\x84\x2f\x23\x24\x04\xd0\x8b\x61\xe3\x12\xb6\xcb\x43\x14\x72\xeb\xe0\xc2\x70\x3a\x8a\x56\x6e\xd5\x3c\xb4\x06\xd4\x84\x00\xda\xe0\x60\xa4\xdb\x94\xdf\x83\xc7\x24\x4c\xd6\xda\x26\xf5\xdf\x7a\x84\x0a\x4a\xa4\xcc\x00\x1f\xe2\x09\xae\xbb\x6d\xc2\x10\xb5\x3f\xac\x56\x76\x42\xbd\xb5\x76\xad\x2d\x4d\x90\xff\x12\x03\x7f\x32\x69\x31\xec\x6a\xca\xf3\xf6\xd1\x03\xb6\xe2\x72\xcc\x59\xbf\xcc\x13\xa2\x35\xbe\x3e\xb4\x08\xdc\xd6\xcf\x31\x1d\x06\xee\x51\x9d\x30\x57\x17\xe8\x24\x72\x6f\x85\x4d\xc7\x99\x42\xde\x01\x81\x9a\x27\x9b\xe2\x6e\xe7\x58\x72\x50\x64\x9c\x64\x08\x74\xab\xd2\x2b\x06\x55\xa6\xf4\xeb\xcd\x54\x9b\x46\x04\xd5\x94\x24\x1f\x48\x89\x01\xee\x2a\x1d\x9c\xb3\xff\x66\x31\x19\x5d\x61\x80\xd3\x81\xda\x41\x93\x34\x36\xd2\xaa\x4d\xae\x47\xa5\x28\xc0\x3a\xae\xec\xa0\x7a\x54\xdf\x19\xbb\xc6\xad\x6d\xb3\xd9\x60\x98\x62\x9c\x25\x9a\x7e\x13\xc8\xb1\xa7\xcc\x19\x72\x61\xd0\xa3\x5c\x55\xac\x5c\xf4\x6e\x9d\xb8\xec\xa3\x4f\x27\xc9\x0b\x50\xe9\x02\x39\x2a\x83\x7b\x08\x70\x81\xc7\xb7\x1c\x9e\xe3\xa5\xb3\x19\x2f\x6f\x7a\x8f\xe8\x82\xb2\x3c\x7b\x0b\x7c\xe4\xe0\xf0\x88\x18\x92\x99\x81\xe8\xd6\xb3\xfa\xa5\x34\x81\x3d\x2f\xe8\x9d\xaf\x2c\xec\x71\x36\x66\x5b\x57\xc4\x9a\x8d\xa4\xda\xef\x17\xd2\x5f\x76\x99\xcc\x82\x87\x85\x70\xa2\x10\x13\x88\x0c\xf8\xd1\x75\xc3\xbf\x24\x41\xa0\x95\x2a\xbb\x45\x23\xf9\xa4\x63\x0c\x29\x9b\xc1\x10\x49\x33\xec\x30\x86\xa2\x6d\x95\x47\x50\xfb\x19\x32\x27\x73\x98\xab\x76\x9d\xc9\x2e\x30\xc3\x1a\x52\x6f\x5a\xa9\x89\x20\xa4\x5f\x47\x37\x71\x2d\xbb\x1b\x4f\xcf\x26\x18\x11\xb4\xc3\x65\x15\x08\x3c\xba\xec\xac\xcc\x2b\x14\x16\x5c\x99\x89\x07\x52\x01\x81\xa2\x31\x86\x66\xc1\x43\x47\x56\xe7\x61\x61\x48\x03\xcc\xbc\xee\x95\xdb\x29\xc4\xd2\x8d\x4d\xe5\xc0\x61\x9f\xef\x91\x21\xdd\x2a\xe6\x56\x4c\xdf\x97\xba\xc5\xe3\xac\x1b\x05\x72\x7c\x34\x5f\xa0\x55\x30\x4a\x04\x72\x04\x9c\x4f\xe8\x77\xb3\x17\x7f\x72\xcc\xe8\x45\x7b\x1b\x5d\xc1\xc8\xcf\x01\x4d\x6a\xd6\x5a\x66\x32\x88\x60\x2c\x4a\xd5\x1d\x43\xeb\x7a\x54\x23\x7b\x2c\xe0\xd8\x71\x54\x75\x9c\xa0\xbc\x49\x39\x87\xc9\xe6\x79\x5d\x36\xe2\x91\xe6\xaf\x8c\xab\x1a\x73\x3c\x0e\x7a\xae\xc7\x08\xc1\x71\x1b\xec\x19\x8d\xdc\x8c\x08\x3e\x9e\x65\x45\x20\xc2\x98\x5d\x5e\x07\xa8\x3f\x7e\x34\x47\x04\xf1\x15\xaa\x21\x54\xc5\x5f\x24\x7f\x0e\xf1\xdd\xe2\xd4\xeb\x31\x20\x25\xcf\xf8\xc5\x75\xe4\xa8\x55\x81\xf4\x9a\x7b\xa4\x4b\xc5\x2c\x7b\x40\xe3\xde\xcd\xb9\x63\xff\x60\x4c\x7f\xa8\x74\xad\xbd\xe2\x27\x9a\xde\x92\xbc\x48\xed\x21\x48\x72\x7a\x87\xb0\x02\x4d\x46\x8d\x43\xcc\x4c\x57\xdc\x15\x16\x69\x24\xcd\x90\x3f\xd7\xbe\x1e\x1e\xde\x35\x2a\x51\x0d\xd3\xb9\x19\xac\x3e\x46\xa5\xac\x8d\x2d\x92\x1e\xde\x84\xd9\x9d\x94\x66\x39\x6a\x87\x15\xda\x98\x34\x4a\x34\x26\xd6\xab\x23\xe3\x37\x1e\x97\xeb\x93\xd2\xd5\xfe\x60\x18\xd1\xe3\xda\x83\xba\xfa\x68\xa0\x38\x58\xd2\x2a\xb8\xd6\xe7\x5b\x3d\x35\xb3\x07\xc2\x81\xf4\xcb\x90\x3e\x59\xea\x0f\xab\x41\x76\x6f\x94\x3e\xec\xc2\x2c\xf5\x74\x3f\xf2\xe3\xd2\xcd\x40\x94\x22\x0f\xfb\xd1\xf4\x49\x30\x66\xe2\x8e\x76\x1f\x3c\xf1\x7a\xec\x81\x70\x5f\x1e\xc4\xfe\xd1\x98\x79\xec\xd6\xaf\xb7\x7f\x34\x2b\x35\x20\x10\x87\x10\x12\x0f\x15\xae\x34\x6f\x2b\x9b\x3d\x6a\x03\x88\xed\xd7\xea\x25\x22\x86\xd8\xa6\x96\x65\xf7\x2a\xa2\x8b\x50\x92\xc2\x03\x06\xf5\x86\x50\x5c\x84\xbc\xc4\x5c\x93\x46\x8b\xbd\x94\x42\xc2\x0a\x7a\x13\x22\xbf\x3c\x20\xf4\x94\xfe\x84\xf2\xc7\x61\xef\x1f\x61\xa6\x90\xa0\x78\xda\xa5\x96\x40\xc2\xee\x5b\x90\x2e\x01\x0a\xd6\x22\xd0\x21\x25\xc1\xa5\x1e\xb5\x25\xf3\xd3\xbb\xa2\xa5\xeb\xbe\xde\xe3\x86\xad\xc4\xa3\x91\x4a\xc5\x5d\x6a\xce\x1e\x2f\xac\xb1\x85\x31\xe2\x03\x21\x54\x71\x4e\x3e\xb0\xfc\x25\xb5\x0a\xbf\x00\xd0\xaa\x50\x9a\xed\xe3\x6e\xf0\x50\xb7\xa2\xd9\xcf\xb0\x12\xf5\x22\xa4\xac\xf2\xf0\x6c\x98\x30\x05\x0c\x7c\xcc\x1f\xe3\x98\x2e\x76\x21\x54\x9a\xd9\xbe\x47\xe4\x54\xb9\xc2\x03\x67\xe6\xc2\x70\x77\x2d\x93\x87\x90\xc0\x81\x8d\xd6\xca\xc5\x1f\xd2\x5b\x5b\xf4\x76\x8e\x4d\x5e\x2d\xd1\xe0\x31\xb7\x34\x0a\x17\xb8\xe8\x92\x36\x90\x9a\xbc\x46\xc3\x94\x3e\x66\xbd\x5b\x8f\x72\xa8\x83\x02\x58\x8a\xce\xa2\xec\xf1\xa3\xc7\x24\x3b\x68\x02\x76\x3b\x3e\xb3\xbb\x6b\x0c\xab\x50\xa3\x03\x4f\xd9\xfe\x11\x7a\xfc\xf0\x70\x9a\xac\xdf\x24\x45\x51\x80\x0c\x56\xd8\x27\x0a\xca\xd1\x46\x48\x2e\x5b\x34\x8f\x0f\x97\x27\x9a\xc9\xbd\x1e\xca\x92\x1f\x83\xb7\x35\x1e\xa5\x8b\x44\x82\x07\x1c\x9c\x5e\xed\xb3\x20\x37\x03\xc4\x31\x78\x8b\x20\xab\xe6\xbf\x21\x32\x7b\x97\xc1\xee\xcf\xc3\x83\xa8\xdf\x5c\xcc\xba\x8b\xbc\x06\x94\x9a\xfa\x92\x66\x46\x3f\x79\x3e\xf6\xc3\x73\xd7\xb8\x93\xfc\xa9\x93\x01\xf5\x99\xea\x75\xe7\x23\x11\x8c\x63\xd3\x5e\xe7\x61\xb5\xaa\xea\x31\x33\x73\xa4\xf9\x41\x40\x21\x1d\xef\xf6\xcb\x9a\x5a\xec\xfd\xc3\xf9\x59\xbc\x5e\x56\xe3\xa9\x06\x43\x8a\x20\xef\x75\x62\x67\xe1\x91\xe2\xbd\xcf\xff\x90\xd0\xcf\x95\xa5\x91\xe1\xc7\x45\xdb\x37\x64\x26\xfd\x0c\xed\xa7\xe9\xba\xe5\x23\xfe\x79\x8b\xfa\xa3\x98\xa4\xe7\x9a\xff\x21\x5c\x50\x2a\x16\xff\x10\xe9\xa8\xd7\x2a\xff\xeb\x43\xa6\x19\xe6\x4c\x03\x32\x3b\xfb\xbd\x8b\x14\x81\xf3\xf9\x57\xf9\xa3\x66\xf4\x21\x71\x02\xd7\x8e\xfc\x50\x6e\x36\xb0\x5a\xfe\x4d\x11\x3c\x0a\x7d\x8c\xd1\x45\xf7\x5c\xa1\x22\xc4\x2d\x22\x16\x3c\x1f\xde\x07\x95\xf2\x45\x8d\x9e\x1c\xd2\x31\xbd\x79\x96\xa5\x01\xe5\x49\x3e\xcd\x71\x93\xbd\x99\x35\xca\xf2\x43\xd9\xd7\xe3\x55\x18\x15\x90\x37\x30\xf3\xb7\x24\xc5\xdc\xbc\x79\x63\x9f\xfb\xdf\xfa\xda\xb4\x33\x22\xff\x05\x83\x71\x4b\xa0\xe6\x5a\xa1\x89\x6c\x4c\x7b\x70\x23\xf3\x7a\x5c\xda\xed\xea\xf9\xea\xc9\x4d\x3b\xe4\x90\x06\x59\x55\x0b\xe5\x75\x6e\x55\x0f\x42\xbb\x14\x39\x28\xb3\x9d\xfc\x0a\x21\x84\x58\x0a\xa9\x64\x6e\xf4\x7b\xc4\xd2\xb8\xde\xa0\x6b\x85\xac\x49\x83\xa9\xd4\xdc\xd0\x3a\xe8\x8d\x4b\xf0\x62\x41\x1c\x02\xaf\xdd\x62\xf7\xa1\x68\xe1\x2e\x4b\xff\x06\xca\x1b\xa1\x63\x81\xc1\x2e\x56\x78\xb9\x11\x84\x33\x52\x1c\x35\x30\x60\x76\xf1\xc9\x22\x47\x10\xd2\x78\xb7\x68\xa9\x60\xc0\x68\x95\x0f\x2e\xd3\x8d\xa1\xf9\x90\xef\x68\xf2\xcf\xcc\x90\xe2\x71\x5a\xbd\x25\x31\x10\x55\x5a\xd6\x2a\xe4\x60\x25\xd7\x1c\xbd\x21\x99\x43\xb4\x87\x12\x1f\x5c\xe1\xd1\x64\x2f\x73\xf6\x08\x29\x48\xbf\x1c\x9a\xc6\x51\xc4\x37\xd9\xf5\x3d\x10\x35\xea\x36\xc9\x89\xdc\x03\xc9\x62\x19\x92\x5f\x43\xa3\xb2\x63\xac\xb7\x53\x0f\xcf\x2e\xfe\xcb\xc3\x90\xf3\xb7\x64\x3b\xc2\x93\x36\x5c\x6b\x27\x34\xe0\x70\x2d\xcb\xb3\x6e\x0f\x37\x47\x06\xcd\x0f\x40\xe1\x94\x83\x1c\xfb\x26\x0b\x33\xd8\x3d\x44\x1f\x84\xab\x59\x07\xe2\x29\x0d\x8f\x5d\x03\xe8\x03\x20\xf2\xf7\x02\xd5\xbb\xe2\x36\x65\x58\x2b\xd4\x38\x62\xca\x63\x35\x2b\x42\x59\x86\x5d\xb8\xfa\x41\x34\x61\xda\xe9\x2f\x4b\x88\xe3\xe5\x8d\x7f\x4c\x85\x43\x87\xb9\x85\x1a\xc7\x2b\xd1\xed\x08\x31\x0e\x9f\x44\x56\xa9\x3d\x8c\x35\xc0\xc8\x43\x85\x6a\xdf\x2e\x2b\xcf\x63\xc0\xa1\xac\xa8\x85\xef\xcf\xb2\xe4\x3a\xb8\x53\xff\xc4\x20\xcc\xb2\x89\x73\xd4\xdf\x26\xd0\xb1\xe6\x71\xe2\x62\x4b\xe1\x44\x1b\xfb\x71\xf1\x89\xda\xd3\xdf\xa9\x6f\x30\xa4\x38\x56\x5d\x4f\x37\xfd\x26\x43\xa7\x86\x42\x27\xe5\xf2\x1c\xa0\xe3\xc3\xfe\xa2\x58\x07\xde\x20\x06\x7e\xa0\x44\xc9\x21\x2e\x76\x1c\x45\x5e\x33\x88\x77\x5c\xdb\x79\xdc\xe6\xbd\x90\x47\xce\xfb\x5a\x29\x54\x38\x3c\x7e\x8e\x92\x2f\x05\xa9\xcc\x71\x5c\xc7\x82\xb7\x6c\x5f\xda\x46\x59\xfe\x0a\x59\x0f\xba\x1e\x61\xc3\xc3\x55\xea\x7a\x2f\xe9\x9e\x82\xdc\x4e\xeb\x08\x09\x52\xde\x70\x17\xfe\xb0\xdf\xd9\x71\xf0\xa2\x7d\xb0\x18\x27\xec\xa5\x59\xee\x29\xc8\x80\x1c\x77\x92\x12\x8a\x4d\x80\xa1\xec\x67\x89\xab\x85\x80\x37\xf4\x58\xbe\x28\x10\xc2\xad\xc2\x47\xc9\xb5\x46\xae\xf0\x68\xbe\x5d\xd8\x52\x97\x29\xc4\x9f\x0d\x76\x97\x5f\x59\xcb\x87\x1c\x1a\xac\x18\xd9\x1b\xbc\x3f\xd4\xe5\xb0\x27\x45\x6e\x9b\xdd\xb5\x5b\x95\x5f\xa9\xe9\x83\x28\x4a\x12\xea\x20\xa5\xd5\x24\x90\x05\x69\x42\x2e\xf0\xa0\x9e\xb7\x15\x2f\x65\x3e\x53\x7b\x20\xa8\x2d\xa0\xcb\x2a\xc9\x90\x50\xbb\xc0\x45\x8d\xd4\x01\x24\xde\xc7\xb9\xe5\xbd\xe5\x17\x0c\x79\xbb\x4e\x39\x2f\x07\x8e\x48\x48\xe5\x24\xbb\xd3\x44\x32\x22\xb1\x6c\x91\x8a\x09\x3c\xc7\x49\xfb\x5c\x43\x9b\x0a\x82\x22\x7e\x0f\x63\x0b\x0b\xdf\x3a\x0c\xb5\x7a\x8f\xa0\xcd\xb7\xf7\x42\x9f\x9c\x21\xcf\x3a\x41\x10\x16\xa5\xc6\xe1\x29\x58\x4a\xc7\x80\x8a\x48\xaf\xd7\x97\xa2\x20\x3c\x54\x77\xa5\x87\xfb\x16\xc5\xee\x2b\x44\x41\x62\x09\xf5\xff\x87\x9c\xa5\x51\x63\xd5\xe2\xc7\x51\x74\xd4\x9f\xc9\xe9\x7f\xbc\x2a\x29\x44\x70\x12\xa3\x05\x87\x74\xe7\x4a\x0f\xa8\x21\x15\x07\x3b\xb8\x4c\xe5\x18\xf3\x9f\x1f\x62\xa1\x83\x2b\xe7\xc7\xab\x14\x05\xda\xfd\x7f\x05\x44\x06\x9a\x21\x34\xb2\x78\x74\x58\x8d\x82\x4f\xe6\xdd\x9f\x50\xb7\xc7\xda\xb9\x9b\x68\xa0\x7f\x76\xf8\xb6\x9a\xc8\xc3\x1d\x86\x6f\x04\x1a\xef\x6f\xdf\xcb\xb7\x13\x77\x5c\xc9\xe0\x1d\xa4\xf4\xf7\xca\x47\xcf\xc5\x42\xd6\xd0\x8b\x70\xb5\x10\x1a\xd9\xc7\xdc\xcc\x48\x6c\xa1\x59\x67\xe1\xf4\xb4\x4a\x29\x81\xec\x67\x43\xdf\x63\x18\xc0\x9f\x26\xb3\x16\x54\xe6\x04\xde\x5f\xfb\x20\xbd\x91\x35\x97\x07\x89\x8b\x90\x13\x71\xe6\xe7\xc0\xc2\xc6\xf1\x7a\x6e\xd2\xe5\x76\x7a\x64\x11\x6a\x58\xbe\xbf\x22\x67\xd2\xf5\x5b\x8e\x30\xbc\x57\x66\x16\x3c\x69\x3c\xf0\xdd\x47\x77\x3f\x32\x78\xd1\x77\xed\xe6\x50\x05\xb9\x06\x09\x42\x40\xff\xa9\x87\x5f\x92\x05\x1e\xe8\x0e\x19\x73\xf7\x17\xa3\xba\x11\xcf\x1d\x1f\x17\xb6\x5c\x7a\x64\xde\x30\xb4\x1b\x42\x24\x6a\x00\x20\x2b\xd8\xdf\x05\x08\x91\xb0\xd1\x48\x4b\x3f\x32\xb4\x1c\x32\x24\xcf\x43\x06\x27\x8f\x53\xe8\x09\xb7\xe3\xf4\x52\x67\x1f\x4f\x4a\x2f\x40\xcb\x37\x44\x3e\x7c\x60\x78\xa6\x7d\xd9\x5d\xff\xa6\xb4\x08\xb0\x65\xa2\x1d\xf6\xe8\xef\xd1\x38\x9b\xf6\x41\x3d\x5a\xeb\xcd\xec\xd9\xc7\x24\x6f\xc9\x11\x1e\x62\xdd\xb7\x10\x36\x84\xea\x48\xa0\x4c\x21\x3d\x72\x21\x7d\x42\x22\x26\x6b\x6e\x72\x1d\xd4\xff\xb2\xe9\x10\x82\x08\xb5\x86\xf8\x49\x9d\xa5\xb0\x52\x23\x4f\x1e\x66\x48\x64\xd4\x27\xa8\x06\x9c\x0b\xa5\xa1\x10\x91\xc0\xa0\x91\x52\x2c\x69\xfb\xab\x4e\xb3\xbb\xce\x38\xc3\x10\x2b\x09\xd1\x0f\x0d\x52\xc2\x90\x58\x92\xe2\x8d\xda\x96\x5a\x57\xc7\x0b\xcb\x16\x35\x84\x6b\xff\xdc\x42\x27\x4c\x84\x95\xc8\xc7\xea\xe9\x5f\x4d\xc3\xa1\x7e\x0c\xf5\x41\xaa\x04\xfe\x89\x4f\xe9\x93\x87\x9a\x49\x6e\xee\x92\x2c\x79\x94\x33\x8c\xa3\xf5\xe4\xa5\x7a\x12\x07\x70\x5f\x3d\x28\xf8\x95\x5b\xfa\x65\xf5\x0e\x79\xdb\x81\x8b\x44\x48\xc7\x05\xe1\x7e\xb1\x31\x49\xd6\xf8\x08\x96\x36\xb4\x04\x16\xc8\x4d\x49\xda\xc3\x8e\x61\x13\x57\xf2\x8b\x4b\x10\xd2\x27\xa1\x91\xc2\x01\xd5\xa6\x92\xf2\xd1\xdc\xf0\xe2\x52\xf7\xfb\x4c\x96\xc5\x3d\xdc\xba\x44\x4b\xdb\xba\x1d\x1e\x8f\x14\x24\xad\x18\x03\x54\x49\xbb\x45\x7c\x54\x6d\x56\x88\x8e\x54\xf8\x12\xd8\x30\x81\xbd\xaa\xfb\xdc\x13\x4b\xde\xde\x36\x44\x19\x66\x09\xc3\xcc\x91\xc0\xda\xd7\x1f\xf9\x18\xfa\x5a\xd8\x19\xc6\xa0\x62\xd4\x46\x6e\xea\xfe\x85\xf0\x6d\x6f\x15\x5c\x7b\x40\x07\x08\xa2\xb9\xd5\x5b\x97\x26\x16\x68\xfa\x91\x2e\xdc\x72\x28\x03\xa2\x9f\xaf\xb3\x05\xeb\x49\xc8\x25\x2c\x4e\x97\x23\x52\x6c\x50\xd8\x68\x04\xbd\x9e\xf2\x2d\x87\xc6\x5a\x7a\x97\xfc\xe4\x91\xd3\xe4\xb6\xb2\xfb\xa4\xb5\x0d\x25\x7b\xf6\x33\x05\x8b\x21\xe1\xc2\xf3\x9a\xc1\x87\xd1\xca\xe9\xbd\x08\xdf\xd0\x63\xfc\x48\xd5\x14\xcd\x26\xeb\xa2\xb1\xba\xbe\xb8\xfa\x58\x53\x24\x29\x17\x55\x7c\x89\x40\x94\xeb\x20\xf4\x5a\x72\xfb\xa5\xe8\x75\x81\xf6\xfd\x12\x35\x4c\xe1\xb3\x3f\x21\xb0\x99\x73\x30\xce\xa7\xab\xe3\x3a\x2e\xd1\x33\xb5\x12\x42\x41\x42\xcc\x08\x25\xad\x50\xd9\x72\x33\x63\xd9\x42\xf3\xa5\xf6\xd4\x75\xb1\xbb\x3d\xc7\xd6\xca\x2e\xf5\x97\xe2\xf8\x4e\x74\x2d\x59\x97\xa0\x8f\x99\xfa\x49\xfe\x74\x2b\x0a\x46\xef\x52\x2f\xf4\x7c\xbb\x99\xad\xa9\xff\x2f\x0a\x69\xa0\x92\xca\x24\xfd\x09\xdc\x87\x23\xb4\x58\x71\x27\xae\x8e\xc6\x22\x15\x9f\x29\xc1\xef\x75\xed\xad\xd4\x6b\x27\xe0\xac\x9e\x9a\xb9\x8f\xda\x58\x82\x90\x12\xf2\x09\xe3\xe8\x31\x64\xcc\xf1\xd7\x7e\xe2\xb7\x3f\xce\x35\x2d\x7c\x4f\xa7\x34\x5f\x4e\x1c\x31\x0b\xa3\x22\xbc\xf4\x53\xe2\xa7\x38\x33\x27\x19\x53\xe6\xca\xd0\xba\xdd\x86\x28\xbb\x63\x2a\x6b\x39\x64\xc1\xd3\xca\xdd\x2e\xbd\x19\x98\x9c\x89\x86\x99\x5e\x00\xd4\x98\x6b\xe8\x34\xa1\x2b\x1f\x9a\x34\x40\xec\xb1\xae\x45\x3f\xd7\x1b\xcb\x7d\x6e\xb9\x4f\x56\x17\xa5\x90\x85\xf1\xdc\x61\xd7\x8c\x79\xf9\xb8\xdb\x18\x45\x2a\xb1\x1c\x2a\x8e\xf5\x56\xa2\x39\x83\x6f\x6f\x66\xb2\x77\xec\x90\xca\x0f\x24\x66\x86\x10\xa1\x39\x0a\x13\xa3\x61\x29\xff\xaf\x8f\x8f\x2b\x46\xf1\x42\x66\x86\xc3\xbb\xb1\xbd\x5b\x11\xc7\x1a\x8d\xb3\xe6\xb5\x30\x6b\xd8\xf4\x28\xc0\xd2\x36\x6f\xfd\x03\xb7\xad\xe9\xd1\xe6\xb7\xad\xae\x92\x86\xd9\x25\x8b\xb3\x0f\xa5\x5a\x93\x00\xef\xc9\xde\x66\x28\x4c\xbd\x07\x4c\x78\x95\xba\x52\xda\x85\xd7\xe8\xd3\x76\xc9\x07\x68\x66\x08\x27\xa5\x88\xf6\x72\x6e\xa3\x8e\xd1\x9a\xd0\xd7\x1c\x76\xda\xb2\x8c\xa1\x64\x2d\xba\x6c\xa9\x8c\x7a\x48\x92\x7b\x36\x42\xc7\xc6\x9a\x72\x4d\xd9\x67\x46\xbb\xf6\x3c\x69\xa7\xa5\x9c\xa1\x98\xc3\xa7\xca\xb6\x07\x2f\x1c\x67\xd9\x0d\xe1\x82\x5d\xfe\xe3\xd1\x76\x2e\x84\xe9\xc2\x0e\xef\xbf\x46\x71\x87\x9c\xcd\x93\x81\xf7\x30\x43\xd5\xc3\xcc\x6f\x1a\xef\x26\x6b\x63\x4f\xa4\x4f\x8f\xa6\xa8\x71\xb1\x7a\x74\xec\xb7\x97\x91\x8a\x43\x43\x81\x5f\x9d\xd5\x9a\x4f\x0e\xf8\x75\x1e\x95\x4e\x0b\xce\xd3\x98\x3b\xcf\x4d\x59\x67\x9e\x87\xea\x5d\x79\x33\x3b\x9e\x5c\x27\x99\x4f\x28\xdb\xbc\x3b\x77\x6b\x75\x68\x8f\x4a\x40\xe4\xe2\xf0\x49\x77\x75\x17\x7f\xea\x3a\xbe\x33\x1d\x86\x33\x29\x4a\x23\xe7\x1a\x14\x6f\x56\xe6\x01\x76\x90\x0b\x4e\x13\x25\x68\xea\xaa\xf7\x5a\x42\x38\xfe\xea\x98\x2d\x3f\x1b\x44\x6f\x86\xe8\xbe\x76\x56\xd3\x3d\xa5\x8a\x53\xf2\xa3\x57\x2b\x11\xe1\xbf\x52\x41\x81\xd4\x75\x2c\x9b\xf3\xa4\x4d\x78\x7a\xa2\xcb\x27\xb1\x98\x9e\xa1\x94\xee\x85\xd0\x5b\xd9\x7d\xd0\x9c\xe3\xb1\x1d\x86\x3d\x29\x57\xef\x26\xb7\x6e\x2f\x14\x2f\x07\xc6\x41\xe3\x4c\x51\x05\x95\x30\x9b\x40\x8f\xd5\x1f\xaf\xf4\x1b\x8b\x94\x55\x3d\x64\xb3\xc7\x91\x6d\x71\x33\x07\x8e\x4e\x41\x2f\x85\x62\xdf\x6e\xf1\x71\x80\x35\xd0\xe0\x88\x66\xe7\x9a\x7f\xab\x22\xcf\xed\x66\x9c\x8a\xa8\x6c\x32\xb8\x2e\xcf\xf3\xa6\xa1\x4e\x14\x34\xd7\xa4\xc0\x53\x0f\x49\xfd\x40\x80\xe7\x1f\xad\xa7\x23\x99\xb2\xe6\x3f\x11\xe6\x2e\x93\x95\x3d\x2c\xe9\x61\x76\x68\xf7\x59\xdb\x58\xbb\x5c\xc7\x2a\x23\xd0\x5c\x30\xe3\xc7\x38\x62\x38\x04\xd5\xcc\x52\x41\x07\x4a\x25\xd0\xae\x16\x49\xd1\xba\xc5\xa9\x6a\x89\xae\xe2\x3a\x69\x3b\x5d\x57\x35\xa5\xfe\x09\x06\x77\x4f\x19\x9d\x7c\xe5\xd0\x06\xfa\xa9\x12\xdd\x81\x04\xd0\xc4\xe7\x15\xfa\x3f\xa5\x09\x00\xf5\x4d\xca\x09\xb6\x37\xa6\xa4\x1a\x04\xbc\x15\x1f\xae\x99\x1a\x38\x73\x96\x46\x90\x86\x67\x3b\x26\x8e\x73\x69\x44\x36\x72\xe1\x34\x0c\x6d\x26\x95\x83\x5a\xa1\xcb\xd2\x3c\xfa\xa9\x8e\x34\x71\x95\x62\x9f\x52\x7e\xad\x63\x8e\xbd\x4d\x26\x44\x36\x0f\xb4\x35\x18\xab\x5f\x7a\xd7\x76\x26\x75\xff\x2e\x7a\x01\x15\xc1\xc5\x17\xa6\xcc\x7c\xb8\xcb\xb8\x88\xda\x6c\xe6\x14\x7b\x45\x20\xe8\x11\x01\xb3\x5d\xb1\x56\xf1\x56\xa4\xbf\x73\x1d\xd2\xbb\x02\x58\x15\xc2\x6c\x6e\xdb\x17\x64\xef\xa9\xca\x73\x94\x2c\xd5\x1a\xb4\xa4\x28\x85\x64\xfd\x8d\x68\xd5\x9b\x9d\xa9\x96\xe6\xc7\x04\xd7\xf6\x1a\x31\xc4\x28\xd1\x5f\x6c\xd6\x4f\xc9\x61\x68\xc5\x35\xbb\xb8\xf7\xae\x52\x3f\x31\x26\xc6\x4d\x3d\x33\x70\x73\xf9\xd4\x5a\x3e\xe9\x9e\x8b\xa0\x19\x2a\x7a\xe1\xe3\xcf\xa9\x8b\x0d\xee\x3a\xd2\xf0\x1b\x74\x79\xda\x75\x28\xa3\x23\xde\xc2\x8c\x2d\xe5\x55\xeb\xe7\x07\x97\x07\xad\x94\x2d\xe4\x2e\x87\x62\xd2\xc0\xd1\xab\x0e\x90\x2c\x9f\x42\x3c\x07\xa3\x1f\xac\x77\x73\x0a\xe5\xa9\x9c\xfa\x50\x4d\x8a\x31\x71\xb7\xaf\xa1\x5e\x12\xee\xd1\x13\x4d\x54\x6b\x2b\xec\x31\x86\x0c\x9b\x11\xd1\xfa\x45\x4d\x3a\x58\xaa\x8e\xf0\xd1\x7c\xeb\xd7\x2e\xa6\x3a\x80\x04\x31\x71\xd6\xdc\x69\x3b\x15\x30\xec\xa2\x44\x97\xd4\x5a\x51\x68\xf2\x45\x0b\x77\x69\x7d\x07\xcd\xb0\xd7\x32\x8e\xdf\xe3\x99\xb8\xeb\x67\x8c\x87\x76\xf0\x67\x31\xec\x1e\x01\x6c\xd6\xf8\x1e\xb8\x44\xc7\x31\x99\x2e\x25\xbe\x5b\xdf\x0f\x82\xc3\xa0\x40\xe4\x9a\x32\x52\x80\x76\x21\x22\x37\xd0\x0f\x1f\xc3\x5c\x15\xcf\x96\x7e\xd3\xc9\x26\x8e\x44\x89\x24\xe0\x73\x61\xbc\x44\x0e\x36\x2f\x28\x37\x49\xb6\x54\x88\x20\xb3\xb6\x7c\x35\x11\xa3\x33\xdd\x6b\x4c\x88\x99\x8c\x1c\x91\xcf\xb2\x17\x39\xbc\x0b\x01\xa9\x16\xf4\x90\xae\xce\x5d\x3d\xd0\x38\xe2\x43\x05\x2d\x53\x65\xeb\x26\x64\x69\x4d\x45\xb3\xed\xbe\xe8\xe9\xf7\x8a\x22\x5c\x06\xe9\x78\x1f\x27\xd3\x99\x3c\xfc\xc1\x1a\x89\x0f\xb7\x8f\xb2\x94\xe8\x0e\xdc\xa5\xaf\x26\x86\xd4\x54\xc7\xe5\x70\x95\x76\xd0\x01\x07\x6c\x09\x6d\x23\xdc\xdb\x2c\xab\x0f\xc9\x20\xd8\x53\xd5\x05\x46\x54\x9f\x76\xef\x8d\x34\xce\x44\xea\xee\xac\xd1\x13\x6f\x86\x69\x4d\x45\x65\xb8\x54\x92\x9d\xcf\x3b\xec\x81\x46\x40\x17\x13\x30\xa3\x14\x95\xd9\xfc\x05\x0c\x3d\x24\x9a\xc8\xae\xe0\x2a\x9b\x7b\x2e\x75\x83\xad\xa0\x96\x66\xda\x3c\xd8\x9d\x96\x3d\x6c\xdc\xe8\x7a\x82\x68\x42\x6b\x96\x5c\xd1\x59\x10\x9f\xfb\x96\xbd\x6a\x2a\xd7\xa9\x74\x6a\x6c\x86\x22\x14\x13\x86\xd0\x10\xeb\xe2\x63\x6a\xda\xe8\xd4\xa4\x9d\x10\x6f\x45\x3d\x24\x07\x29\xe8\x31\x51\x14\x3d\x60\xe6\x89\x09\xe3\x50\xa3\x54\x27\x2b\x11\xdf\x9d\xec\x3b\x37\xd3\x90\xe6\x12\x9f\xb5\x55\xfa\x4a\x7d\xe4\x37\xe3\xd3\x5f\xd5\x99\x45\x2b\x73\x7a\xcf\xb7\xb8\x53\x92\xac\x5a\x44\xd4\xa5\xe5\xdc\x13\xb5\x96\xa0\x5f\xe0\xfb\x5b\xb6\x2b\xd0\x62\xc4\x33\xcb\xf4\xbc\x0e\xae\x94\x43\x4c\xcb\x5e\x58\xe8\x34\x70\x24\x0d\xc9\x07\x45\xd2\x4b\x54\x5a\x3a\x19\x65\x01\xc7\x66\x89\x1b\x7b\x6b\x2b\xf1\x27\xbb\x3f\x14\x57\xaa\x57\xe6\x47\xc9\x31\x75\xa1\x66\x85\x48\x3a\xfe\x0e\x68\xcb\xfe\xa1\xac\x94\x57\xd5\x8f\xae\xa6\xa4\x13\x76\xf3\x96\x5c\x2a\xe3\x1a\x3f\x78\xfc\x12\x1f\xb7\x59\x1d\xaf\x34\xdf\x1f\x31\xb3\x33\x33\x7a\xd2\xec\xe2\x98\x5f\x2e\xb5\xf4\x52\x46\x2f\x24\x40\xa9\x72\xa4\x06\x63\x9a\x3c\xbb\xcc\xde\xc4\xa6\x13\x4e\x5b\xc7\xf7\xdf\x88\x8d\xf4\xa0\xb8\xd2\x7f\x6e\x1d\xc0\x82\x1b\x35\xfd\x60\x0f\xef\x15\x94\x07\xff\x69\xf0\x70\x6b\xc9\x8c\x0d\x22\x23\x98\xe1\xcf\x8d\x06\x49\x12\x64\xff\x23\x65\xcf\x0a\x48\x2f\x3d\x3f\xc2\xa5\xac\x1f\x60\x55\xf5\xa0\x2c\x19\x34\x5e\x35\xde\x96\xe0\x0a\x3f\x58\xd3\xa6\xfe\xda\x00\x06\xf1\x70\x23\x96\xf9\x94\xd9\xac\x24\x08\x5d\x13\x76\x3a\x54\x68\x72\x10\xa9\x97\x4f\xd5\x76\xb2\xd6\x17\xc2\x3f\x78\xc8\xfd\x24\x59\xa7\xbe\x41\xcd\x20\x5d\xac\xea\xa5\xef\x2f\x39\xaf\x60\x2e\x37\xf5\x1f\x02\x51\x6a\x99\x41\x1c\xca\xf3\x14\xfe\x53\x80\xdd\x1d\x70\x3f\xbf\x69\x42\x40\x59\x5a\x51\x47\x9d\x7f\x6b\x58\x8a\x71\x31\x3b\xc7\xc3\x60\xcd\xdc\x49\xba\xd2\x48\x76\x2a\xa3\x58\xd2\xc9\xc5\x17\xdd\xc0\x10\xdd\x6a\x4f\xa6\xdf\xfc\xf8\xfb\xaf\xe0\x14\x0a\xdf\xac\xa5\xfe\xdf\xff\xef\xff\xf9\xff\x03\x00\x00\xff\xff\x71\x1d\x08\x34\x38\x36\x05\x00") - -func dataEnglishJsonBytes() ([]byte, error) { - return bindataRead( - _dataEnglishJson, - "data/English.json", - ) -} - -func dataEnglishJson() (*asset, error) { - bytes, err := dataEnglishJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/English.json", size: 341560, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataFemalenamesJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x6c\xbd\x4b\xb2\xab\xbc\xd3\xe5\xdd\x7f\x47\xf1\xc6\xbf\xfd\x8d\xe0\x1b\x43\xcd\xa0\xa2\x1a\x32\xc8\x20\x5b\x80\x0f\x17\xef\x83\x2b\x6a\xee\xa5\x14\xde\xe4\x6f\x71\x2a\xe2\x69\x1c\x1e\x6f\x63\x90\x52\x79\x5d\xb9\xf2\x7f\xff\xd7\x7f\xff\xf7\x7f\xfe\x47\x5a\xd6\xff\xfc\xff\xff\xfd\x3f\xcb\xbf\xcb\xd5\x10\xe6\xfd\x3f\xff\xdf\xf1\xef\x57\x58\xe7\xd4\xa4\xf0\x7b\x9d\xd3\xd8\x9e\x17\xb7\x30\x97\xff\xce\xcb\x98\xd3\x27\xdc\xe2\xda\xff\xfe\x8f\x47\x1c\xc7\x74\x8f\xf3\xef\x75\xb9\xb1\xdf\x69\xd9\x96\x30\xe2\x93\x2e\xcc\x71\xfd\xbd\x6e\xa7\x79\x5a\xfb\xdd\x7f\x75\x39\xbf\x37\x86\xb1\x39\x3f\x78\x96\x2f\x9d\x37\x29\x3f\xbd\x9e\x9f\xf4\x31\xfb\x27\xe5\x97\x5a\x7f\xce\x76\x1a\xc7\xf3\xa2\x09\xf3\x94\x7f\x2f\xe6\xcd\x1f\x7e\xe9\xcb\x27\xfe\x80\xa9\x29\x77\xcc\xf1\x7c\xa2\xb0\xf9\x0d\x97\xb2\x08\xe7\xf7\x9e\x69\xb8\xc5\x39\x9f\x0f\xd2\xc6\xdb\x84\x8f\x1f\x71\x59\x52\xe3\x5f\xed\xd3\x9c\xe3\xf9\xc7\xcd\x3e\xae\xbd\xaf\x51\x18\xbb\x98\xcf\xab\xa1\x2c\xf0\xe2\x0b\x71\x2b\xaf\xee\x7b\x11\x86\xdd\xbf\xe5\xaf\x37\xc7\x5b\x6c\xfc\xe7\xde\x69\xee\xd2\xe8\x3f\xf0\x0c\x6b\x9f\xa3\x2f\xd4\x2b\x0c\xfc\xc1\x30\xaf\x7d\xc0\x8b\xcc\xf8\xb9\x80\x1f\x5f\xd6\xf8\xea\xc3\x98\xa2\xac\xea\x7e\xde\xb6\xe9\xe7\x22\x61\x69\x8c\x94\x84\xf3\xe2\x11\x46\xdf\xf9\xa6\x3c\x51\x9c\xf1\xa7\xf7\xb9\x6c\x78\x5c\xf0\x72\xe7\xf7\xa6\xbd\x39\xff\xac\x4d\xc1\xbf\x13\x72\xf2\x4f\x1e\x5b\xf6\xdf\xea\x63\xbd\xff\xef\xe5\x1a\xe7\xb8\x40\x30\xca\x63\xfe\x5e\x74\x79\x82\xb4\xc6\x77\xc4\xfb\x3c\x62\xc0\xbb\xc5\x79\xcf\x2e\x27\xb9\x9d\x63\xcb\xf5\x95\xb7\x79\x4c\xfe\xcd\xb0\xf4\xd8\xfa\xc7\xd6\x26\x97\xbe\x79\x5a\xb8\x3e\x78\x9d\x67\x11\xc3\xf3\x4b\xe5\x83\x29\xe3\x4d\xdb\xfd\xba\xe4\xb2\xd5\xe7\xa7\xf6\x54\x78\xf1\x5b\x79\x3d\x11\xd9\x31\xf9\xcf\xaf\x61\x70\xd9\x4a\x45\xe8\x64\xe3\xce\x03\x51\x56\xeb\x7c\xf8\x60\x87\x85\x7b\x8d\xb5\xb3\xa3\x18\xe5\xa9\x66\xff\x30\x4f\x1b\x7e\x79\x81\x72\x29\xfb\x8e\xdf\x6d\xfe\x6c\xe5\x30\xf8\xff\xf9\xa1\x34\xde\xca\xf9\x4e\xb2\xfd\x7e\x1c\xb6\x9b\x2b\x95\xc9\x37\x9b\x0b\xf5\xea\xf7\x9c\xfd\xa3\x71\x9a\x07\xff\x2c\x6c\x7e\x3c\x4c\xe4\xf8\x7c\xfe\x9b\x39\x95\x3b\xf8\x46\xc7\x22\x15\xbb\xef\xec\x2d\xf9\x79\x8b\x5d\xe7\x5b\x36\xef\xcb\x1a\xb2\x0b\x60\x68\xf7\xf3\x31\xe6\xb4\xfa\x0f\x87\x1f\x17\x3f\x79\xd9\x7b\xd9\x86\x38\xba\xb0\xac\x65\x2b\xce\xfb\xc7\xd6\x1f\x77\x4d\xf7\x7b\x18\x77\x9c\xd7\xc1\xb5\x40\x11\x3e\xd7\x8f\x45\xe1\x9f\x7f\xd6\x95\xdb\xf9\x9a\x47\x7c\xf2\x4e\xcd\x2a\xe7\x85\xc2\x5c\x54\xa2\xeb\xbb\x38\xbb\x75\x59\xf6\xfc\xf6\xef\x3c\x8a\xcc\xbf\x7a\xec\x6a\x91\xd2\x3c\x40\x55\x96\x35\x76\x8d\x5c\xee\x94\x7c\x2f\xe2\x0a\x89\x33\x45\xed\x8b\x9f\x83\x2a\x9e\xc7\x34\x8b\xa2\xe2\x55\xd1\xf9\x79\x5a\x57\xff\xf3\x69\x84\xb2\x8e\x0b\x75\x87\xc9\x02\xee\x1c\x07\x7f\xd4\xc7\x56\x8e\xec\x0a\xd9\xc0\xc5\xdc\x4f\x90\xd5\x3e\x7c\xfc\xb9\x83\x59\x0e\xd7\x38\xd4\xbc\x37\x7f\xc8\xf0\x2a\xe7\xe9\x94\xb4\xb8\x40\xbb\x35\x19\x27\x26\x6f\x4d\x82\xc5\x7a\x84\x21\x89\x1a\xc2\xa3\xe7\xa2\xcf\xa6\xf3\x97\xdf\x21\x47\x2c\x4a\x6b\x8a\x1d\x37\x1a\x62\x07\x1d\x96\xe9\x1d\x2c\xdb\x87\xf7\x3d\x8c\xe6\x79\xd9\x05\x7f\xee\xf2\xa2\x34\x2d\x65\xd9\xa1\x57\x8a\x32\x92\x75\x7f\x94\xf7\x38\x9f\x75\xf6\xd3\xd3\xc5\x39\xe4\x16\x7b\x60\x56\xd9\x77\xbe\xa1\xc6\xab\x6f\x0c\x65\x35\x53\x2a\x8a\x7a\x82\xaf\x00\xfd\x3a\xc7\x0e\x9a\xa1\xfc\x76\x03\x9d\x59\x5d\x23\x5f\xa6\xc9\xce\xde\x82\x17\xa4\xd6\x0e\x5b\xd1\x7a\xe7\x6d\xf7\xf7\x84\x65\xb2\x25\x83\xcc\x3d\x36\xb5\x93\x2e\xf2\x2d\xf4\x4d\xd1\x14\x0d\x2c\x3e\x0c\xfe\x18\xcf\xaf\xa7\x16\x96\xff\x0d\x8d\x54\x94\x50\xd9\x00\x97\xc2\x09\xef\x7c\x2b\xaa\x66\x85\x6e\x30\x8f\x80\xba\xad\xbc\xe5\xea\x5f\xdd\xa7\x4c\xdd\x6b\x96\x91\x2f\x63\x3b\xe2\xdf\x2d\xda\x1e\x17\x66\xa0\x7c\xb7\xde\xe5\x8b\xf0\x6e\x02\x4f\xfe\x06\x51\x5d\xfc\x0e\xea\x6b\x52\xf2\x8a\x3a\x7a\x26\x9c\x71\x57\x14\x2b\x4e\x88\x19\x59\x3a\xbb\x45\xa1\xc0\x17\x2a\xbe\x81\x9b\xb4\x22\x6a\xeb\xbc\xb5\x11\x87\xcb\x8d\xe9\x34\xee\x70\x82\xb3\xec\x91\x6f\xfa\x4f\xc2\x2b\x51\xac\x9e\x87\xa5\xf6\x37\x59\xf0\x8e\x63\x28\x26\x01\x87\xbf\x1b\x5d\xc6\xca\x39\x09\xa2\xba\x70\x86\x6e\x72\x97\x36\x8a\x70\x9a\x27\x89\x4d\x7b\xc5\xf2\xdd\xf3\x17\xe4\x36\x83\x9d\x28\x1c\xa9\x22\x28\xb8\x0c\x66\x28\x5d\x3e\x8b\xa7\x80\xd5\x2d\xee\x99\xaf\xde\x54\xfc\xce\x00\x9b\x55\x96\x06\x66\xaa\xda\x4b\x6a\xb1\xe2\x0b\xf9\x7d\x42\xd9\x4b\x9e\x08\x28\x1c\x93\x53\x8f\x0c\x22\xef\x32\x24\x1a\xc6\x41\x5f\xab\xd8\x8e\xd6\xf7\x36\xd3\x91\xce\x3b\x7e\xfb\x9d\xa6\x8c\xc7\xde\xe6\x75\xf4\x0d\xad\xe1\x8c\xeb\x8d\x95\x5b\x5f\x1d\x60\x68\x98\xe2\x5a\x62\x61\x44\x4c\xf1\x8c\xeb\xca\xab\xbf\xf8\x7e\x82\x13\x32\x94\x20\x8b\xde\xd5\xe2\x8a\x74\xd8\xe7\x15\x41\x4a\x44\x9c\x53\xfd\x41\xb8\x78\x8c\x12\x4a\x94\xb7\x78\xe4\x54\x5c\x58\x97\x53\xb3\xf2\x93\xb8\xbe\x5c\xd6\x11\xaf\x65\x31\x1c\x3e\x49\x8c\xb1\x16\x8d\xc0\x8a\xbd\xe9\x5d\xf8\xc6\x11\xf1\x9c\x47\x9e\xe5\x79\xcd\x80\x21\xf0\x9b\x86\x24\xeb\x7b\xfe\xd8\x94\x3b\xd7\xcb\x22\x4b\xe6\xa3\x8d\xe2\x0e\xf9\xfe\xe5\x38\x8d\x81\xef\x75\x7e\x72\x8f\x6a\xd6\x26\x84\x4c\x43\x2a\xbb\x3e\xf8\x11\xc4\xa1\x2e\xa1\xd6\xd3\xd5\xe8\x44\xa3\x6d\x82\xe4\x41\xce\xf3\xe2\x9b\x17\x0d\x92\xfc\xfe\xd8\xa6\x21\xb8\x33\xdc\xd3\xf1\x6f\x43\xf2\x1d\x9b\xc3\x80\x37\xa9\x2e\x56\x82\xcd\x7a\xd2\xdb\x9e\xb9\x2f\xc5\x35\x9a\x71\x08\xc7\x76\xc1\xea\xd8\x65\xc0\x11\x1e\xe1\x91\x74\x5b\x68\x43\xde\x5e\x50\x37\xa2\x51\x8e\x78\x1e\x5e\xcf\x22\x51\x52\x03\xb1\xb9\x87\xdd\xb5\x5b\x1b\xa8\xf7\x20\xd8\x4b\xb8\xf1\xc9\xd3\x72\x39\x03\xdd\x56\x5e\xd4\xcd\x4e\x2f\x47\xa9\xaf\x4e\xde\xb9\xfa\x03\xad\x5d\x13\x8b\x90\xa5\x8b\x2e\x3e\xdf\xaa\xc4\x9e\xae\x27\x6e\xc5\xd2\x15\x87\xc6\x1f\x09\xfe\x6f\x31\x25\x17\xef\xca\x9f\x15\x41\x65\xdc\xc4\x29\x18\x71\x60\xca\x61\xff\xb8\x0e\x92\xb5\x6c\x25\xd6\xb1\x10\x1d\x29\x82\x2c\x96\xbc\x6e\x53\x2a\xe1\x9c\xbf\xec\x98\xfe\x6c\x78\x34\x7f\x9f\x07\xcd\x7a\x39\x79\x99\x02\xbf\x43\xff\x8e\x17\xb9\x85\xf7\x5c\x9e\xd3\xdf\xe7\x1e\x2e\x2a\x77\x87\xcf\x35\xbd\x3c\xb4\x09\x62\x36\xf6\x37\x3d\x86\xf2\x76\x93\xaf\x6b\xde\xce\x45\x59\x36\x2c\x71\x51\xae\x88\x1c\x2c\xec\x09\x72\x50\x5c\x8e\x9f\xb3\x1e\x28\x78\xc1\x19\xc1\x5c\x86\xa2\x2f\x76\x75\xc4\xa1\x2e\x7f\xd5\xfb\x96\xad\x53\x12\x0f\xc7\xd6\x40\xb2\x0d\x61\x14\x6f\x48\xfe\xf8\xe5\x9a\xc3\xe2\xf8\x73\x2b\x7e\xfa\x44\xcb\x52\x64\xbd\xed\xa0\x2e\xe8\xc0\x34\xdc\xfd\x1c\xd6\x69\xa7\x1a\xf7\x37\xb5\x65\xf0\x3f\xec\xca\xf6\xd2\x1b\xc0\xcb\x26\x28\x2d\x73\x84\xa9\x71\x5c\x8f\x1c\xc6\x6e\x84\xbc\xcc\xb4\xd0\x16\x8f\xbb\x91\x88\xb0\x56\xf5\xd4\xd0\x40\xc1\x0a\xac\xd4\xb2\xe5\xe9\x65\xcf\xe0\xa6\xfd\x0d\xe2\x2e\x77\xa6\x9e\xf1\xf1\x0d\xd9\x85\xb6\x9c\x74\xfc\xb1\x85\xb2\x74\x9f\x72\xfc\x2b\x96\xe8\x36\x4f\xd3\x53\x1c\x4a\x78\xbe\x4b\x68\xe9\x6c\x16\xa1\x68\xb9\x99\x66\x4d\x12\x0e\x96\x8b\x5c\xe4\x4f\x94\x13\xdf\xc3\x56\x59\x72\x24\x50\x77\xdd\xfc\xb3\xf2\x13\x51\xf3\x64\xe6\x3d\x53\xcf\x35\xdc\xba\x48\x03\xff\xd4\xec\xc1\xb1\x4a\x23\xf4\x29\x03\xa5\xb2\x7b\x6e\x21\xaa\xe7\xa2\x16\x53\x12\x1e\xe2\xcf\xd3\xe0\xc3\xe8\x14\xff\x26\x4a\x02\x21\x4a\x8a\xaf\x8d\x4b\xb1\x34\x91\xa7\x68\xa4\x87\x37\x26\x04\x4e\xf0\x45\xbe\x59\x2c\x24\x03\x23\x14\x63\x9c\x25\xcd\x50\x04\x50\xb6\x07\xd2\xdb\x5c\x0c\x6e\xe4\xc9\x8f\xa9\xeb\xfd\x9e\x5d\x0f\x9f\x6e\x7a\x21\x1b\x1b\x2d\x63\x04\xc9\xd2\x8c\x70\x57\xc2\xa2\xf2\x7f\x46\x18\x16\x1e\xc0\x39\xd8\x11\x39\x2d\x52\x1c\xcd\x22\x21\x45\x90\x77\x04\x3f\x0f\xe8\x10\xf3\xc0\x5c\x9f\x60\x6b\x2e\x89\xf9\x60\x5a\x4b\xf4\x23\x32\x78\xb4\xa4\x89\x39\x97\x58\x2e\x90\x19\xe7\x13\x17\x67\x21\x52\xb3\x24\xc8\x00\xe5\x4e\xbc\xee\xa2\xd6\x1f\xfe\x4c\x48\xd0\x64\xbc\x52\x4b\x7d\x36\x30\xc1\x24\x41\xcb\x40\x03\x5b\x7f\x94\x61\xa0\xa4\x8d\xee\xe9\xa2\x74\x19\x07\xcc\x0c\x50\xdb\xf4\x97\x06\x00\x2b\x68\xd9\x6e\x78\x25\x14\x2c\xe4\xc4\x1f\x53\xcf\xf3\x61\x55\x02\x38\xa5\x03\x33\x2e\x25\x1c\x4a\xf8\xbb\x1f\x88\x1f\x0b\x1a\xf1\x36\x49\xb0\x7d\x3b\x3f\xc1\x59\x33\xc9\x4e\xb8\xf3\x2d\x21\x7d\x32\x71\x07\x7e\xd2\x98\xee\x4c\x41\xeb\x09\xb2\x63\x89\xac\x65\x79\x10\xbf\x4f\x48\x83\x9f\x51\xee\x71\xd1\xda\x23\xd7\x89\xe1\xf4\x40\x83\xaa\x4e\x5b\x79\x31\xb8\x80\x2f\xcd\x97\xcc\x4c\x83\x1d\x3e\x2b\xfc\xc0\x96\x67\xbe\x18\x10\x86\x52\x16\xcb\xba\xbe\xb0\x20\x9b\xdf\x9c\x99\x95\x6d\x68\xc2\xca\xa2\x31\x05\x55\x8e\xa7\xa9\x3e\x17\x9b\x1f\x3f\x9f\x0d\x33\xcf\x2d\x72\x58\x56\x4f\x79\xba\x3b\x60\x02\x44\xe1\x9a\x66\xa4\x9c\xe2\xfd\x8e\x2d\xe3\xb2\x97\xbb\xc0\xb3\xe5\xee\x95\x70\x7b\xa2\x85\x64\x80\x45\x7d\x61\x59\x4a\x38\x6f\xf4\xf8\xcb\x2f\x61\x0f\xc6\xf4\x7c\x5e\x54\x7d\xd0\x95\x5d\x1a\x1e\xa5\xa4\xe6\x4d\xe4\x06\x1a\xca\x0c\x88\x17\xde\x2c\x63\x04\xf7\xc5\xea\x02\xac\x95\x95\xb8\xb9\xf5\xe4\x43\x4d\xd2\x41\x13\x32\x2e\xbf\x17\x1d\x06\xd5\x84\xd0\xbb\xfc\x1c\xcc\x57\x39\xff\xfe\x73\x89\xce\x1a\x97\xa5\x1e\x33\x26\x89\x02\x12\x62\x4d\x39\xe1\xd9\xdf\x21\x8d\x5d\x71\xba\xce\xab\x37\x4c\x45\xf1\xa9\xd3\x25\x8e\x76\xed\x3c\xe5\x96\x8b\x84\x14\x51\x51\xd6\x2c\x7e\x1e\x25\x17\x48\xf1\x88\xcd\xc4\xf1\x7a\x5c\x13\x68\x92\x5e\x6a\xa8\x13\x2d\x8f\x52\x8c\xca\x44\x85\xf3\x84\x5f\xb4\x50\x62\x8e\x3a\xa4\x1c\x0c\x57\xef\x8c\x88\x5a\xd1\xa5\xe5\x50\x64\x57\x8a\xbe\xc5\x5a\xe1\x38\xea\xb5\x11\xea\xca\xbf\x65\x79\x33\x28\xf8\x57\x2c\x52\xf7\xb9\x68\x05\x97\xab\xa3\x7a\x1a\xe1\xc6\x52\xdd\xf6\xe2\xf2\x34\x25\x82\x77\x35\x10\xef\x8c\x67\xcc\xf1\x9b\xd3\xe4\x2a\x52\xbc\x0d\x78\x58\xa2\x3c\x19\xd2\x06\x2a\xe9\x22\xc3\x3c\x09\x08\x3e\x6b\x1d\x9b\x79\x37\x6c\x5e\xfd\x4c\xb4\xbe\x87\x0d\x16\x77\x7a\xf0\x57\xe3\x59\x66\x6e\x16\x96\x06\xa7\x86\xde\xf5\x2b\xa4\x0e\x01\xdd\x78\xa9\xbb\xf1\x2e\x78\xed\x36\xbc\x7a\x56\x48\x5d\x32\x4c\x2b\x78\x55\x23\xae\x2e\x25\x5d\x55\x01\x7e\x8f\x34\x4c\x1d\xeb\x7f\x13\xcf\xee\x33\x52\xef\x64\x66\x5a\x2c\xc3\x06\x8f\xc6\x62\x79\xdc\xf5\x09\x1d\xbd\xcd\x0b\x5d\xb3\xf4\xf9\x40\xcb\xa5\x99\x09\x63\x93\x0c\x51\xd2\x52\xe6\xd9\x19\x9e\xec\x52\x3b\xc4\x52\x76\xa2\xe3\x8a\xf3\x02\xbf\xbd\xd6\xc4\xa4\x18\x0e\x79\x38\xe2\x8a\xb1\xf5\xf3\x64\xe9\x0e\xa6\x84\x13\x94\x92\xc9\xf8\x47\x6e\xe4\x98\x03\xab\xd9\x30\x7e\x8c\x22\x9e\xc5\x30\x46\x16\x19\x3b\x79\xcd\x7b\x59\xc7\x96\xee\x16\x8f\xcd\x06\x93\xfd\x6f\x7e\x55\x43\x58\x45\x01\x1c\x3f\x73\xdd\xaf\x0c\x23\xb5\x6e\x83\x27\x05\xca\xb7\x83\xd6\xb8\xa1\x12\xab\x79\x76\x81\xbc\xe8\x51\x0f\x9f\x36\x89\x7b\x98\x55\xcb\x1b\x6d\x96\xe5\x7a\x04\x28\x52\xfc\x47\x26\x38\x96\xa9\xd8\x8a\x79\xc2\x9f\xd3\xef\xb7\x6f\xe3\xb3\xb7\xbb\x11\x8d\x98\xe1\x9a\xbc\xe3\x86\xad\x1f\x3c\x0f\x4f\x6e\x96\xba\xc3\xe1\x7b\xd2\x57\xa1\x8c\x4a\x79\x21\xb3\x0c\x99\x83\x80\x52\x7e\x92\xbc\xf1\xb8\x41\x0e\xbb\xe0\x3f\xbe\x70\x9d\x5a\x2a\xf1\x65\xbf\xb9\xa7\x13\x6e\x5e\xf5\x4e\x6f\xe4\x80\xe9\x34\x6a\xe6\xa6\x41\x06\x06\x62\xff\x90\x8c\x40\xd7\x06\xaa\xe3\xe9\x4e\xa9\x19\x62\x60\x9d\x70\x6b\x99\x29\x5e\x99\x63\xce\x2c\xe4\x96\xdd\x1b\x79\x9b\x5b\x62\xfa\x60\x29\x1a\x48\x75\xed\x8e\xc0\x1a\xb9\xba\x0a\x74\xa1\x11\xa5\x6e\x32\xdc\x12\x94\x5c\x2d\x4e\x88\x9a\xc6\x66\x47\xa4\xb0\xbe\x69\x19\x3f\x38\x73\x3f\xb1\x94\x0b\x95\x6d\xfa\xc8\xad\x21\xd4\xf0\x91\x46\xe0\x19\xce\x13\x83\x1e\x2c\x85\xc9\xb9\x2b\x9c\x6d\xed\x91\x5d\x8f\x58\xbf\x72\x02\xe2\xfc\xa6\x1a\x70\x39\x58\xc5\xaf\xce\x11\x51\x43\x5f\x7e\x0a\xb5\x2f\x73\x0d\xcf\xcf\xde\x21\x33\x7c\xbf\xcd\x92\x14\xa8\xca\x0f\xd9\x9e\x12\x10\x48\x52\xd0\x2a\x56\x10\xfb\x37\x9e\x34\x88\xda\x83\x43\x99\x53\xcb\x02\xd1\x4c\x85\xf2\x9b\xb5\x91\x0a\x52\x13\x5f\x0d\x6a\xa3\x6b\x92\x98\x0c\xd0\xad\xd9\x73\xe8\xed\xa4\xc5\xdc\x27\x6c\x84\xc7\x6a\x31\x8f\xe2\x29\x5d\x4a\x17\xe5\x43\xec\xc3\x9b\xba\x65\xa7\x9b\x20\x41\x5e\x89\xd8\x02\xd6\x7e\x89\x0c\xaf\xa8\x87\x82\x46\xd3\xf7\x24\x71\x2d\x12\xa0\x2d\xab\xa5\xa3\x84\xbc\xdf\x7c\xf7\x0a\x55\xc3\x6a\xf7\xab\x18\xed\x3c\xbd\x10\x21\xe7\xd0\x95\x3d\x3d\xdf\x7f\x60\x46\xfc\x16\x05\xca\x50\x64\x0b\xa9\xdb\x0a\x61\x42\x58\x0a\xab\x17\x97\xa1\x96\xe7\x35\x64\xf0\x8f\xdf\x78\x1e\x13\xa0\xf3\xf2\x43\xa5\x36\x04\xa9\x2b\x8c\x92\x66\x2a\xfe\x6e\x7c\x22\x90\xda\xb8\x51\xbd\xe9\x50\x97\x6f\xe6\x7d\x8b\xf3\x03\x5f\xf5\xd7\x94\xf3\x00\x31\xbf\x1e\xa4\x60\x32\x53\x2a\x1f\x22\x1a\x66\x9a\x1d\x45\x61\x18\x03\x94\x04\x18\xa1\xb5\xd4\xaf\xe5\xe5\x2f\x49\xbf\xc3\xf1\xa0\xfa\x88\x03\x8d\x51\x43\xa0\xd1\x07\xce\xc1\x78\x71\x22\x27\xaa\xee\x78\x2d\xec\xe6\xf2\x84\x04\x00\xf1\x53\x6e\xf9\x22\x3e\xb7\xed\x31\x54\x69\x31\xfe\x40\xb0\x65\x49\x11\xe7\xf0\xe4\x9f\xc6\xf6\x47\x2d\x71\xf1\x7a\xd4\xae\xc7\x99\x29\xd4\x5d\x2c\x1b\x3d\xfb\xbf\xe2\xe6\x43\x13\x55\x34\x19\x56\x72\xd4\x58\xca\x9c\xb4\x41\x70\x1f\x41\x80\x18\x89\x4b\x50\x33\x1b\xe7\x1a\x6c\x1f\xb9\xd1\x34\x4b\x32\x75\xc7\x4f\x68\x1a\x96\x8a\xb0\x15\x57\xa1\x4a\xd9\xa8\x6b\x07\xa9\xe3\x53\x6e\xb0\x41\xcf\xb0\x48\x05\x7a\x17\x20\xcf\xfb\xea\x21\x1a\x3c\x50\x8b\x2b\x30\x14\x41\x60\x73\x7b\x89\x4e\x71\x7e\xcd\x4a\x61\x77\xda\x2e\x72\x95\xa1\x88\x5e\x52\x68\x38\xc0\x43\x90\x5d\x7a\xa1\xeb\x47\x9c\xaa\xd3\xd0\x99\x05\x96\xf5\xad\x08\x00\xc5\x80\x62\x69\x16\xf1\xc3\x69\xa1\x8b\xc8\x49\x14\x72\x04\x67\xfe\xd7\x02\xaa\x4a\xed\x4c\xd1\x58\x92\x14\x4f\x90\xae\x8e\xcc\x98\x16\xcb\x07\xd0\x4f\x4c\x33\xee\xd2\xe1\xa0\xdc\x24\x11\x15\xac\xf2\xec\xf5\x1e\xcb\xad\x42\x6e\x4d\x05\x61\x1b\xad\xe6\xee\xe9\x1c\xea\x79\xa9\xf5\x95\x25\x7c\x23\x34\x13\x97\x20\x68\x7a\xb9\x6a\x0d\x37\x61\x13\xf4\x94\x1a\xef\x85\xf9\xbb\x5a\x79\x44\xe9\x9f\x4b\x59\x51\xb5\xd8\xb2\x56\xe2\x14\xcb\xf0\x28\xb0\xef\x8e\x0f\xbb\x0d\x19\x94\xe3\x1c\xc0\xbe\xd2\x1b\x0a\xa6\xff\xa1\xe1\xdf\xf6\x08\x28\xc6\x85\x72\xa3\x85\x70\x0d\x98\x8e\x03\x39\x23\x92\x02\xa5\x5a\x2b\x5d\xd7\x23\x8d\x4d\x96\x4a\x43\x16\xb4\x44\x18\x5e\xc1\x23\x0c\x3b\x61\x62\x92\x90\x39\xa4\x28\xfe\x24\xb5\x85\xbe\xae\x25\x7a\x89\x40\xc2\x6f\x74\x94\xd3\x3f\x47\x3b\xa8\xd0\xd0\xfd\x84\x92\x64\x05\xb3\x9c\xea\x96\x82\xc1\xd5\x06\x88\xec\xd8\x51\xdf\xec\xe6\x89\xbd\x2f\xcb\x91\x2e\x25\xe9\xa8\xb0\x4a\xc4\xcd\x0a\xe9\xa5\x24\x34\x61\xb9\x94\xdf\x0e\x8f\xda\x77\xd4\xde\x71\x0d\x14\x39\x82\x39\x2e\xb0\x39\xa9\x31\x19\xb8\x8c\x99\x40\x45\x65\x1b\x22\x7c\x5c\xa9\xc2\x22\x1e\xb2\x16\xbd\x60\x0b\xa9\x62\x4c\xc9\x0a\xa2\x34\x7b\x2c\x5f\xe1\x6d\xe7\x0e\x44\xc0\x50\x3a\x6e\xf7\x0c\x77\xa3\xdc\xee\xcf\x96\x14\x7b\x87\xa4\x2b\x45\xc6\xfc\x1b\x22\xa0\x6d\x6d\x10\xea\x7e\x91\xf1\x48\x9e\x69\x4a\x33\x4f\x5c\x4a\xab\x91\x27\x16\x46\x7f\x22\x15\xe3\x0e\x13\xff\x83\x20\xc4\x6a\xfa\x97\xc4\xee\xa9\x72\x00\x45\xab\x0e\x39\x14\x8e\x29\x2a\x3a\x5c\x37\x6e\x79\x97\x70\xf0\x82\x38\x94\x6f\x56\x05\x5e\x61\xf4\x52\x20\x0b\x23\xc5\x23\x92\x34\xd7\x9a\xe0\xfe\xb7\x1a\xb2\x59\x54\x48\x97\x48\x94\x00\x02\xac\x12\xbc\xc6\x46\x83\x08\xba\x03\xf9\x1f\xb8\x3c\x12\xd0\x47\xf6\xce\xb7\x34\xce\x03\xbb\x2c\x2c\x08\xf3\x23\x20\x87\x78\x05\x6c\x7e\x6a\xd6\x40\x38\x74\x68\x99\x2d\x46\x8e\xa8\x8b\xea\xc6\x7c\x9b\x53\xa0\xca\x98\x8d\x1f\x05\x37\x64\xe8\xcd\x5e\x8d\xa0\x8b\xe6\x34\x22\x7f\x9c\x8b\x29\xe0\x6e\x58\x83\xc2\xf9\x13\xbd\x64\xe0\xc3\xb8\x96\xa3\x29\x8e\x86\x25\x5a\xfc\x58\x5b\x34\x9c\x5a\xfa\x65\xbe\xae\xdc\xae\x28\xf5\xa8\x56\x6c\x41\x4e\x48\x63\x54\x1f\xe4\x5c\x0f\x62\x57\xac\x06\x05\xdf\x71\xa0\xcf\x69\xa5\x4a\xd4\x30\xbe\xb9\x66\xe4\x06\x97\xc1\x8f\x8f\x45\x68\x0c\x4a\x5a\x38\xfa\x5c\x15\x29\x2c\x17\xd3\x86\x47\xae\x91\x14\xfc\xfa\x81\x79\x9d\x40\x7c\xd8\x3c\x35\x9e\xac\xae\xe7\x18\xf1\x75\xbb\xaf\x0e\x3b\xaa\x21\x17\x2a\xd6\x8b\xc8\x93\x39\x40\x58\xc1\x8e\xe5\xaf\x4c\x79\x7e\x99\x69\x0d\x94\xa0\x10\x99\x2c\xde\xa5\x45\x4a\x5d\x15\x9a\xe4\x0d\xee\x41\xf3\x47\x10\xf1\xb5\xf7\x48\xd4\x28\x6b\x31\x15\xaf\x80\x0c\x38\x53\xd5\x52\xdc\xba\x69\x95\x3d\x2d\xb2\x15\xdf\xe0\x89\x41\x18\x9a\xa2\x5a\x05\xad\xb4\x71\x88\xeb\x4c\x55\x01\x7f\xe1\x11\x2e\x4d\x25\xa6\x00\x80\x4f\x4e\x92\x25\x92\x63\x74\x2f\xa6\xc7\x6f\xb4\x4a\xb6\xf5\x0b\xae\x67\x74\x87\x52\x1d\x1c\xd2\xa2\x75\xad\xdf\xe1\x62\xe1\x21\x9e\xe6\x1a\x48\xf0\xb2\x6a\xe2\x98\x41\x1a\x76\x8c\xf6\xd7\x3a\x09\x10\x3d\x6c\x6d\xd2\xd4\x25\x57\x26\x01\xf6\xd4\x28\x70\x50\x15\x43\x5f\xf4\x4d\x1c\x89\xca\xed\xe3\x44\xc0\x6b\xed\xb2\x62\x0b\x84\x65\x57\x89\x6a\x57\x47\x32\x4b\x13\xc8\x4d\xb7\x70\xa4\x5d\x6d\xf9\xc8\x56\x89\x75\xac\x5e\x51\x1d\x2e\x5a\xcc\xac\x32\x22\x79\x43\x56\x0c\xc1\x27\x0e\xb3\xa6\xbc\xac\xb4\x82\xde\x9c\xcd\x0a\xfd\xf3\x20\x82\x37\x41\xb7\x1c\xc5\x65\x0d\xea\xe9\xe4\x49\x10\x93\x27\x56\xac\x8b\x32\x45\x75\xa9\x57\x50\x73\xa8\xf2\x0f\x03\x86\x65\x0e\x9d\xa4\x98\x8a\x5f\xda\x06\x77\xfc\x92\x65\x6b\x7d\x8f\xd2\x5b\x23\x63\x05\xe3\x57\x43\x7f\xae\x52\xa4\x49\x16\x1c\x82\x28\xe8\x35\x0a\x18\x38\xb1\xab\x22\x6f\x4d\x39\x31\x04\x97\x30\x3b\x62\x25\xc7\x1e\x9b\xca\xea\x50\x10\xb3\x7c\xd4\x79\x7c\x03\xb5\xcb\x62\xe9\xf9\xcd\x57\x91\x4b\xe6\xa3\xd1\x78\x64\xb6\x0d\x4d\x54\x2d\xdc\xd7\xd5\xa2\xe2\xf3\x6a\x1a\xf8\x5b\x2d\x9f\x6a\xa4\x71\x00\x76\x92\x69\xe8\x39\xdc\x83\x24\x39\x76\x58\x1f\xba\xcc\xe5\x3b\xbc\xf9\x9b\x87\xcd\x9a\x6a\xfc\x0d\xc5\xd6\xd1\xcd\xe6\xc6\x2c\x45\xbb\x13\x20\x32\x73\xeb\x8f\xf4\x3b\xf4\x88\xb8\xbb\xef\x48\xe8\x9d\x24\xff\xec\x80\x51\x43\xa0\x81\xce\x8a\x71\x90\x12\x4b\xbe\xf9\x87\x35\x15\xe6\x1a\x5b\x92\x6d\xcd\x25\x65\x63\xb9\xf9\x73\x5d\x27\x37\x0f\x87\x8b\x85\x23\xed\x26\x41\x4e\xc4\x01\x16\xe4\x8a\x0f\x1e\x21\x48\x3a\x4a\xce\x55\xf5\x0c\xa4\x13\x14\x10\x13\x39\x38\xe2\xe9\x1d\xf0\xce\xe0\x0f\x0c\xcf\x59\xb2\xf7\x51\x6c\xf4\x26\x2d\x34\xcf\x9d\x4e\xc2\x81\x2f\x38\xdf\xf4\x65\x59\x7a\x28\x87\x99\xf0\x3f\x3e\xf2\xd1\xd1\xe7\xa6\x25\x28\x88\x8f\xbf\x1f\x27\x38\xea\xb3\xe8\xfd\x07\xd7\xeb\x48\x44\xf2\xac\xb1\xac\x5f\x8e\x06\x83\x24\x48\x7d\x2d\xca\x75\x3c\x11\x2b\x7d\x30\x96\x07\x33\xa2\xdd\x9a\xe6\xf7\xe7\x97\xe2\x6b\x9a\x89\x38\xa3\xee\x78\xc7\x71\x3b\x77\xea\x00\xee\xfb\xaf\x35\x02\xfe\x3d\xde\x27\x49\x94\x52\x74\x0d\x01\xd9\xa3\xe2\x16\x8b\xfe\xd0\x76\x21\x6d\x6f\x5b\x80\x54\x64\xff\xab\xc9\xa0\xaf\xbe\xe1\xf4\x20\x33\x4f\xdd\xe0\xc7\x36\x76\xbe\xa3\xfb\x82\x2c\xfe\x8e\x0a\x5d\x90\xda\x4d\xc5\xb9\x68\x59\x13\xe7\x41\xa0\x19\xf7\x94\xa7\x01\xbe\xc1\xa7\xfc\x3b\xb1\x6a\x75\xd4\x0a\xc4\x3f\x81\xdd\x78\x03\x93\xbf\x31\x9f\xc5\xc7\x79\x5d\x4a\x40\x47\x97\x25\xd3\x94\x4c\xf5\x5a\x24\x7a\xbe\xb1\x98\xa1\xa8\xfd\xbf\x52\x46\x6a\x43\x35\x7e\xd4\x1b\x52\x75\xbe\x31\xb5\x39\x86\xa7\x00\xfb\x98\xc1\xae\xe9\x54\x44\x84\x9a\xca\x45\xe1\xa8\x15\xc8\x61\x2b\x5d\x9c\xd6\x7c\x4f\x7f\x6b\x95\xac\xca\xc4\x8c\xed\x37\x2d\x0e\x9d\xc1\x4a\x96\xa9\x4a\xd9\x9f\x5a\x5e\xe6\x59\x65\x31\xaa\x9d\xde\x8c\x19\x06\xc9\xae\x0e\x40\xf6\x7f\x1b\xa4\x4f\x99\x40\x8a\x7a\x25\x44\x73\x60\x11\xde\x92\xa0\x2b\xb3\xa0\x56\xbb\xbf\x68\x56\xff\x62\x43\xcb\x56\x02\x47\x7a\x4f\xd1\x0b\xb1\x97\xb4\x64\xf6\x96\xe6\xc7\xd4\x8f\x92\x33\x84\x73\xc2\x44\x8f\x99\xbc\xc8\x96\xf7\x27\xb2\xc8\xd2\xcd\xdb\x5f\x8c\xcb\x1e\x5a\x58\xd9\x57\x9c\xa5\xb8\xda\xb1\x61\xb9\x42\x92\x05\xbb\xd3\x13\xa0\x3f\x4c\x1f\xe9\x81\x35\xf7\xd0\x7b\x0f\x25\x1d\x51\x34\x41\x7b\xcd\x7e\x8a\xab\x95\x24\xff\xb3\x0a\x9e\x2c\x07\xf9\xf0\xdb\x38\x37\xaa\xa7\xe0\x8f\x18\xd0\x10\x6d\x7d\x5b\xb1\x0b\x33\x8e\x6e\x11\x7b\xaa\x89\x2f\x4d\x03\xce\x65\x27\x29\x49\x07\xa5\xfc\x42\x3e\x60\x5d\xd8\x63\x0a\xaf\x68\xbe\x10\x63\x4c\xcc\xa9\x1c\x72\x78\xee\xaa\xf4\x1d\x04\xeb\xcb\x56\x27\x07\x66\xa8\xc8\x39\x96\x68\x22\xa0\x31\x5e\x52\x91\x33\x0b\x40\x70\x8e\xca\xaf\x11\x16\xbc\xc6\xcb\x42\xc4\x91\xfe\xd2\x4d\xb0\xf2\x45\xb7\xa8\xd7\xdd\x48\x10\x2a\xc9\xad\x56\xe3\x44\x96\x16\x0f\x0e\x11\xc2\x5c\xc5\xb9\xbf\x91\xa3\xa4\xd8\xb1\xb8\xfc\x03\x30\x72\x17\x0e\x39\x86\x38\x4e\x6f\x04\x8e\x4d\x2e\x61\xed\xb8\xa6\x4b\xd7\xc3\x8d\x5e\x1c\xb0\xdc\xf5\xea\x1f\x09\x1b\xa9\x9e\x99\x2e\x6a\x82\xd7\xa6\x25\x77\xbc\x02\x62\x55\x5e\x5a\x8b\x0f\xde\xe7\x62\xea\xef\xfc\x77\x24\xf7\xc9\x9b\xd0\xd4\x37\x0f\x67\xcd\xd5\xfb\xae\x5a\xd5\x2a\x09\x42\x52\x4e\x6a\x09\xcb\x47\xd2\xad\x80\x6d\xa5\x91\x22\xac\x96\x0a\x44\x52\xad\x71\x12\x0e\xeb\x85\xf5\xa6\xb6\xbd\x5e\x0a\x89\x0a\x98\x12\x0f\xba\xb6\x5a\xfb\xda\xfc\x40\x28\xc7\x48\x2c\x41\x10\x9c\x58\x76\xa3\xdd\x4b\xc2\xf9\x5e\xa4\x73\x12\xa7\x33\x88\x97\x62\x41\x51\xa6\xcc\x91\x79\xc5\x9c\xaf\x4c\x35\xed\xdb\xb4\x9d\xaa\x22\x27\xa9\x6f\x66\x62\xf2\x61\x49\x25\xb7\xf4\x88\x02\xe9\x17\xc8\x6f\x5d\x20\x46\xbf\xbd\x04\x94\x41\xc1\x4f\x89\x7e\x37\xdc\x8a\x46\x3d\x25\xb3\x85\xc8\xc7\xa6\x0c\x77\xb7\x93\xfa\x7a\x74\xf0\x96\x94\x1b\xec\xf9\x11\x02\xbb\x16\xb3\x7e\x10\x3c\x46\x0c\x84\x44\xb6\x5b\x6e\x90\xba\x5c\xd3\x9b\x0e\x52\x16\xe8\xd4\x13\x38\x92\xe3\x68\xc1\xb1\x92\xfa\x84\x35\x1e\xb9\x2e\xf4\xd3\x53\xa1\x58\x04\xf0\x2f\xe2\xf4\x1b\x0e\x88\x66\x38\x06\x36\xac\xfc\x62\xb2\xb0\xb6\x8b\x58\x9f\x6f\x26\x16\xd1\xde\x28\xb6\x88\x4a\xb2\x52\x13\x11\x8a\x28\x70\x0b\x83\x49\x45\x26\xf4\xda\x24\x61\xea\xb8\x8a\x9c\x43\x70\x9a\x83\x64\x83\x6f\xac\x8d\x94\x8a\x12\x60\x79\x37\x12\x8b\x26\xcc\x27\x2d\xfb\x2b\x1a\xa9\x50\x97\xcd\x04\xb4\x3b\x6b\x47\xbb\x65\x3a\xfc\xaa\x16\x63\xfc\xd8\xfd\x20\xfb\xd7\x3c\x23\x51\x55\xd4\xd5\x87\x5a\xf7\x1d\xba\xed\x17\xd3\x91\x34\xbf\xd3\x06\xb9\x91\xaf\x70\x45\x61\x78\x35\xac\x7c\x79\x94\x6e\xc5\x0d\xdb\x2a\x94\x11\x06\x35\x07\xd6\x3c\x56\x94\x12\x0e\x95\x36\x29\x70\xcb\x2d\x26\x0a\xa0\xd0\x9a\x15\xed\xb3\x86\x0a\x91\x65\x8c\x86\x8f\x5b\x4d\x92\x7d\x0c\x67\x04\xb0\x8e\x91\x13\xb9\x10\xec\xd2\x5e\x5c\x51\xd8\x7e\x27\x40\x2d\x56\x8a\xbb\x91\xf1\xb8\x5e\x7e\xf5\xdb\xe4\xd1\xd2\x73\x57\xfa\x03\x13\xf5\xf3\x45\x6a\xaf\xee\x79\xcf\x30\x5e\x28\x59\xe6\x89\xe6\x7e\x6c\x04\x97\x20\x39\x57\xe9\x1e\xb2\xe2\x95\x38\x89\xc7\x8d\x45\x5e\x11\xd8\x5f\xfb\xde\x2b\x63\x15\xab\xaa\x45\x34\x5e\x78\x07\x65\xb7\x98\x60\xd6\x4a\x00\x1c\x77\x04\x18\xe5\xa0\x3a\xf2\xe7\xb9\x63\x55\x52\x8e\x17\x7f\x31\x66\xe1\x5d\x13\xe4\xbf\x45\x1b\xd0\xa9\x9a\x52\x3e\x8a\x09\x00\x02\x33\x03\x16\xd9\x1b\x19\x06\x81\xcb\xee\xac\x42\x1a\xc6\xc6\xcf\x97\xa5\x8a\x7d\x9b\x3a\x03\x3f\x9d\xf2\x1e\xdf\xec\x3e\xb9\x9c\xb0\x9d\x09\x14\xba\x03\xcf\x1d\x11\xf4\x97\x7f\x44\xde\x76\x4e\x6a\x1d\x2f\xc2\xe5\xac\x18\x89\x29\xb4\x30\xb2\xc5\xbc\xc8\xfd\xc2\x04\xf7\xe6\xba\x40\x51\x34\xd6\xfb\xcd\xfc\xc1\x5d\xba\x12\x6a\xde\x71\x54\x4c\x1c\x5e\xd3\xba\x02\x8b\xc3\x4c\xa6\x27\x56\x2b\x0e\x22\x1e\x78\x25\xd6\x14\x43\x87\x9a\x57\xb7\x5b\x84\x52\xfd\x1b\xc4\x3b\x8c\x9a\x23\xeb\xc6\x89\x4d\xc5\x89\xaf\xa3\x64\x4a\x33\x7f\x3d\xb0\x5f\x4a\x7c\x60\x92\x8b\x19\xc7\x15\x19\x23\xde\x82\x6d\x4b\x92\x1d\x95\x5a\xcf\x23\xaa\x4f\x21\xf8\xc1\x72\x1f\x84\x9b\x59\x6d\xc6\x1f\x65\x03\xf8\x65\x17\x84\xc2\xfc\x52\x4d\xf9\xca\x4b\xc4\xd9\x24\xa5\xe1\xcb\x37\x29\xd9\xfa\x41\x2c\x9b\x8f\x5a\x63\x3d\x5a\xe2\x53\xc2\x0f\xbe\x92\x23\xb2\x19\xe4\x19\xa3\x97\x68\x2b\xc3\xc6\x79\x40\x2c\xb9\x49\xbf\xca\x60\x0d\xa8\x50\xb1\xff\xd5\xae\x16\x0a\x6c\x7f\xd1\xd4\x34\xe5\xcc\x07\x5a\x6b\x95\xc6\x81\xaa\xa2\x58\x92\x9d\x14\xc6\xe8\x7e\x96\xd4\xfb\xe7\x01\x32\xf4\x81\x15\xf8\x9b\x26\x62\x45\x8a\xd7\x0f\xd9\x30\x0f\x03\x05\xe8\x31\x8a\x8e\xbe\xd4\x97\xd9\xc6\xc9\xac\x48\xd5\x00\x6e\x65\xd2\x40\x8a\x05\xcf\x92\xdd\xc3\x8c\x38\x21\x4a\x30\xda\x68\xfd\xf5\x37\xa9\xb8\x70\x17\x32\xb3\x8a\x8e\x34\xd9\xa7\x3c\x49\x02\x82\x15\xe5\x95\x18\xa9\x97\xd1\x09\x81\x03\xe7\xa5\xc4\x2a\xbb\xa0\xef\x8a\xf3\x31\xa2\x13\x66\x9a\x5f\x44\x69\xcd\xef\x08\xc0\xe1\x47\xa4\xec\xc8\x35\x63\x75\x66\xcd\x97\x5c\xa8\x80\x0e\x5e\x15\xe8\x2f\x42\x17\x2a\xf5\x09\x5c\x4f\xcd\xea\x82\xc5\x05\x42\x62\xd2\x2c\x0f\x60\x45\x70\x28\x3c\x44\x35\xbd\x2f\x62\xb1\x3a\x4f\x6f\xed\x3a\x40\x7c\xb0\xe6\x02\x83\xea\x93\xf0\xc2\x3d\x04\x8f\xd5\x5c\x18\x2b\x8a\xfe\x5d\x01\x5f\xae\xa8\x3c\x74\xed\x08\x9e\xb8\x0f\xb2\x97\xb5\x95\xc4\xd7\xb5\xa1\xd3\xcf\xee\x32\xff\x46\xca\xcc\xe6\xa6\x1c\xaf\x1c\x5b\xc9\x8f\x08\xfc\xee\x1d\x8c\x00\x07\x5f\x1e\xe2\xb7\x56\xf3\x9a\xc0\x0c\x08\x0d\xc5\x53\xf2\xf1\xf1\xe6\x6a\x61\x97\x94\xde\x48\x8d\xca\x74\xe7\x10\x81\x51\xb6\x83\x73\x2b\xc1\x8c\x6b\xa5\xe9\x4d\x0b\xd2\x91\xfc\xee\x5b\x4b\x74\xd3\xb9\xb5\x9e\x0a\xfe\x20\x99\xf9\xbe\x64\xc1\x7c\x83\x6b\x9e\x4a\xba\xa0\x12\x71\x1a\x66\x43\xa1\x27\xaa\xf0\x31\x5b\x83\x93\xf2\x08\x9f\x41\x9a\x3c\xcf\x6f\xf5\x93\xff\x53\x6a\x67\x95\x55\x0e\xa7\x9f\x32\x10\x4b\x28\x21\x49\xac\x56\x4b\x7f\x54\xff\xb4\x56\x86\x03\x51\x48\x59\xe2\x29\xb5\x2e\x52\x31\x45\xe7\xbf\x8d\xd6\x10\xa5\xfc\x31\xb6\xe9\xd2\xdd\xbc\x48\x90\x0d\xcd\x8a\x74\x78\xf5\x51\x20\x61\x40\x16\x95\x33\xbd\x8a\x3b\x82\xa5\x33\x33\x88\x78\x8f\xd1\x3e\x1d\xb0\x46\x94\x84\xe1\x53\x04\xf9\x25\x4c\x7f\xab\xb1\xbc\x31\x99\xc7\xa4\x2a\x0b\xf8\x59\x83\x96\xe2\xc2\x02\xf8\xa6\x64\x00\x07\xaa\xc3\x1f\x8e\x29\x96\x86\x05\x9c\x6f\x6d\x3d\x53\x1b\xa0\x65\x6a\xfb\x30\x0a\x0d\x2c\x27\x4c\x42\xba\xb2\x0b\x32\x14\x6f\x57\x31\x2d\x70\x54\x8f\x52\x0f\xb0\xdb\xda\x04\x20\x04\x61\x82\xeb\x97\xae\xf2\xe6\xd2\x1c\x2f\x48\xd2\x90\x87\x48\x10\x83\xb0\xf1\x65\x85\x56\x58\xf7\x16\x9b\x1f\xcd\xb7\xf0\xda\xcb\x9b\x52\xdf\xec\xd8\x8b\x86\x41\x5f\xc3\xce\xef\x4f\xd2\xc2\x12\xa4\x4f\x48\xda\x70\x5a\xbf\x91\x1a\x3e\x95\xd2\xf4\xe1\xa9\xc1\x61\x16\x44\xa0\xb1\x14\x45\x28\x39\xeb\x5b\x64\xe3\xa1\xd0\x2e\xe1\x79\x12\x21\x16\x49\xea\xb9\x35\xa3\xbe\xf0\x8a\xcc\x74\x15\x3f\x48\xe2\x92\xb4\xb2\x60\x09\x2f\x67\x49\x6c\x20\x3f\x88\x79\x15\x10\xb7\x3b\xf1\x5b\x56\x0e\xa1\xde\x7a\x23\x3a\x55\xa0\xda\x0e\x10\xff\x62\x3d\x67\xa5\xc9\xb0\x56\x20\x24\x5b\xb6\x57\x22\xba\x1a\xa9\xde\x1c\xf0\xa6\x51\xf6\xc8\x4e\xf4\x55\xe2\xce\x2b\x6b\x55\xde\x71\x66\x60\x32\xbf\x4d\x27\xe7\x65\xa7\x70\xb8\x1f\x09\xba\xab\x1a\x97\x33\x86\x9a\x4f\xbf\x51\x07\x3a\xac\x6c\x67\x38\x57\x99\x41\x11\x86\x59\x0d\x9a\x55\x84\x74\xdb\x19\xea\x8d\x23\xdd\x95\x4b\x73\xf4\xc6\xb8\x57\x5a\xbc\x60\x98\x9f\x2a\x6f\x48\x54\x3d\x26\xe2\x5b\xee\x24\x5f\x31\x46\x0f\x5f\x3d\xd1\x55\x86\x76\xf5\x55\xff\x6c\xa4\xb7\x83\xab\x31\xa1\x6c\x55\x13\x27\x81\x44\x28\x82\x1e\x78\x08\x03\xc7\x37\xc0\x16\xe2\x27\x56\xed\x03\x6b\x8f\x54\xe2\xef\x8a\x8f\xe6\x99\x25\xf5\x78\xb5\xc8\x6c\xac\x91\xaa\xe9\x28\x98\xda\x0b\x9a\x9f\xeb\x57\x01\x97\x90\x1e\x85\xfe\x77\x6c\x48\xba\x0b\xc7\x53\xd4\xc6\xf3\x98\x6b\xe7\xb3\x5f\xb7\x91\xdd\x88\xab\xe4\x1a\xc9\xcf\x77\xfe\x73\x92\xb4\x87\x64\x70\x93\x32\x5b\x89\x56\xac\x99\x4b\x3f\x96\xda\x16\x3d\xad\xc2\x24\x67\xdd\xea\x09\xba\xbf\x61\x43\x7f\x2f\x59\x8a\x12\x65\xf3\xea\x4a\x6b\xfb\x08\x1b\x8f\x51\x14\x2e\x1d\xcb\x98\xa3\xad\x1a\x99\xb4\x30\x84\x56\x3c\x95\xc4\x73\x24\x79\x5f\xab\x27\xf8\x21\x9a\x6e\x48\x29\x9b\xf4\xba\x7d\x29\xa7\x1f\x7a\x62\xda\x24\xdd\x07\x52\x9e\x81\xf0\xfb\x83\x82\x4d\x0a\xe2\x92\xe3\x20\xd7\xef\x81\x47\xf1\xf3\xb2\x81\x2c\xbc\xc8\x64\x66\x71\x2d\xb2\xcd\x73\x6a\x55\xdd\xd2\x60\x97\x23\x98\x23\xfa\x5f\x90\x9d\x78\xb2\x8e\x5f\x0d\x0a\x5c\xbf\xa4\xc0\xbc\x39\x2b\xb9\xc3\x47\x42\xd7\xea\x5a\x9c\xd7\x01\x1d\xc6\xf3\x51\x8e\x3f\x9f\x8d\xe9\xba\x21\xcd\x1a\x61\x8c\x9a\x9b\x93\x7e\x3a\x82\x31\xbe\xb0\x02\x17\x0a\xb2\xc1\x1e\x20\xca\xf0\x8f\x45\x91\x02\x8d\x1a\xa8\x86\xce\x09\xbb\x80\xaa\x26\x40\x46\x36\x4c\x4c\xdf\x8c\x77\x1c\x76\x7a\x1e\x0e\xf8\x92\x39\x01\xc4\x28\x2d\xbd\xf4\x13\xbc\x82\x34\x7e\x5e\xd4\xb5\xb0\xcf\x10\x12\xf8\xa5\x90\x87\x96\x96\xb2\x85\xad\x13\xa9\xb5\xc4\xd7\x3f\x26\x54\x20\x73\xde\x6f\x54\xdc\x42\x96\x19\xaa\x73\x85\x3e\xb4\xa8\x48\x5d\x28\xd6\x5a\x4d\x6c\xc4\xf6\x43\x0d\x66\x6e\x44\x6d\x74\xe4\xe1\x17\x4c\x6e\x00\x8e\xdf\xb0\xc1\x6c\x36\x25\xc2\xb6\xa5\x14\x37\xc2\xac\xd0\x10\x29\xff\x91\xda\x8f\x14\x50\xde\xe0\xbc\xa9\xea\x81\xf9\xc2\x90\xaf\xc3\x1b\xa0\xf0\x8d\x44\x4b\x55\x3e\xfa\xdc\xd0\xb9\x57\x55\x3a\xbc\x76\x16\x5e\x02\xe3\x9a\x9f\x9d\x20\xdd\x55\x18\x6e\xed\xd4\x4f\x52\x67\x12\x07\xe3\x22\x5d\x2d\x0f\x21\x01\x8a\x69\x7c\x4a\x37\xbd\x22\x0a\x12\xfa\xb8\xb3\xf4\x16\x6c\x34\xe6\x59\xf8\xff\xc8\xab\x19\x85\xf9\x77\x12\xaa\x73\x4b\xe2\x46\x5e\x8a\x84\xed\xd2\x87\x04\x65\x64\x96\x53\xc8\x43\x77\x49\xf0\x8d\xf6\x12\x91\xd8\xa9\x48\xbb\x60\xed\x4e\xf4\xb9\x07\xe4\x57\xe6\x8d\x38\x09\x63\x8e\x83\x23\xf2\xc1\x01\xad\x72\xbc\x5f\xd8\x40\x83\x74\xdf\xee\x33\x3b\x55\xb5\xf8\xaa\x64\xa1\xc6\x71\x87\x45\x1a\x22\xad\x80\xe1\xd4\x67\xae\x99\x52\xd0\x1f\x45\x35\x7f\xf9\x07\x83\x90\xe9\xa6\x5d\x3c\xc2\x18\x83\xae\xce\x5a\x45\x80\x1a\xd9\x9c\x9a\x93\xc9\x1d\x6b\x84\x93\xb6\x00\xa9\x41\xdd\x95\xca\x4d\xa8\x59\xbf\xc8\x7f\x3f\x97\x3b\x93\xca\x8d\xb2\x7e\x57\x3e\x04\x7a\xd2\xb5\xb7\xb1\x11\x5f\xd1\xb5\xe3\x47\x56\x76\x9f\x7c\x33\xd7\x38\xfe\xdb\x00\xcb\xc3\xc3\x08\xd0\xca\x2a\xf8\xb7\x14\x32\x0c\xe4\xc3\xa4\xfa\x2a\xbc\xd0\x65\x41\x50\xcc\x7b\x46\x88\x93\x55\x40\x3c\xd6\x22\x36\xb7\x13\xc7\xf5\xb7\xeb\x17\x4e\x7f\x47\x4c\x4e\xe5\x8c\x84\x88\x44\x72\x4f\x5a\xf5\xe1\x83\x44\x5e\x25\x94\x64\x32\x11\x11\xa7\xb1\xa9\xc4\x0b\x09\x74\xc4\x51\x60\x04\x3f\x5e\xe0\x4c\xc3\x85\xa1\x9b\xb3\x0f\xf2\x26\x9d\x94\x54\x44\x4f\xa9\xe4\xc5\x56\x75\xf7\x8d\x54\x98\x77\xe4\x23\xd7\x4b\xdf\x04\x49\x0b\xca\xde\xb1\x93\xa9\xc3\x4e\xf4\xf8\xd9\x44\x21\xc6\x01\xda\xf5\xfc\x88\xe9\x3f\x92\x34\xcc\x92\xb6\xfc\x6b\x2b\x62\x25\xb0\xa2\x26\xc2\x0e\x8f\x22\xef\x22\x0b\x38\x21\x5f\x89\xf8\x46\xe0\xd7\x03\x6b\xac\x8c\x76\x84\xe1\xe1\x99\x3e\x9e\x94\xb9\x1b\x65\x01\x90\x2d\x47\xcb\x82\x87\xea\xd3\x0d\x85\xf7\x72\xb6\x1b\xd6\x48\x4b\x40\xe3\x5a\x62\xde\xa4\xf5\xca\x55\x70\x6d\xc5\x4d\xff\x16\x8e\xfc\x79\x6a\xcb\xd8\xf9\xf7\x69\x1e\x88\xb8\x4b\x04\xe2\xf4\x6c\x46\xae\xd1\x36\xca\x4d\x08\xd8\xad\x49\x2c\xd2\x2c\x72\xf8\x4e\x4b\x4a\x8d\x86\xe9\xb9\x1f\xf7\xb0\x84\x98\x8a\xa0\xaa\x97\x39\x94\xa4\xb8\xdc\x50\xa5\x5d\x82\x9f\xd9\xbc\xbd\xd9\xfb\x5f\x37\xc1\x2f\x7c\x7d\x8a\x89\x41\xfa\xa8\x73\xa8\xc4\x31\x77\x86\xdd\x01\x82\x96\x35\x4a\x1a\x97\xa7\x89\x55\x9e\xca\xa0\xb9\xd2\x4c\x43\x96\x9e\x20\xce\x1d\xe3\x44\xf7\xf0\x20\x18\xc7\x56\xb5\x8c\xd4\x2a\x31\x23\xbd\x51\xe0\xaf\x03\x01\x69\x8a\x24\x3b\x60\x8f\x91\xbb\xb6\xcb\x9c\x14\xd1\xe7\xbf\xb8\x3b\x57\x3b\x5f\x4a\x10\x66\xc5\xb6\xf2\x57\xee\x58\x25\x75\xba\x2d\x8b\xce\x3a\x77\xf1\x64\x11\x9b\x88\xba\x7c\x09\x53\x72\x62\xe9\xa8\xb6\xc3\xf2\x04\x42\x65\x3d\x26\xba\xd8\xc5\xed\x27\x97\xa0\x98\xab\x9b\xcc\xd0\x61\x0f\xe5\x01\xce\xf4\x0d\x73\x8e\x1b\x22\x95\x89\x71\x3f\xd8\x68\xa1\x0e\xa3\x72\x86\x48\xba\xdd\xcc\xc0\x18\xf5\xa4\x44\x9c\x14\x3c\x7f\xbc\x94\xb7\x0c\x6a\xc7\x10\xe9\x2d\x4d\xf0\xc6\x3c\x48\x26\xb2\x8a\x7e\x85\xc4\x74\x21\x03\x0b\xdb\x26\x71\xca\xa5\x43\xa3\xc4\x46\x0a\x19\xc2\x87\x47\xb7\xaf\x9f\xd8\x79\x13\xb8\x7f\x1d\xde\x73\x2e\xf9\xb7\x2d\x0c\x7b\xc0\xf6\x64\x2b\x0b\x8d\xe8\x61\xe3\x46\x06\x36\x9b\x7d\x70\x62\x76\xe4\xca\x6a\xfa\x37\xea\xea\x9c\x57\x96\xa2\x5a\x59\x72\x41\x43\xef\x32\x0d\x03\x49\x00\xcd\x42\x40\xdc\x28\xd1\x42\x57\x55\xd5\x3f\x29\x67\x40\x8e\x91\x39\x8f\x2f\x0b\x7d\xde\x2f\x67\x9c\x87\x3d\x8a\xf8\x3c\xa4\x96\x61\x1a\x9b\x7f\x28\x4c\x36\xc9\x43\x0a\x03\xcc\x9c\x1f\x6a\x89\xeb\x7d\xf7\x8a\x59\x6d\x44\xf1\x6d\x92\x8c\xd6\x6d\xde\xa4\xd1\xb0\x36\xad\x9f\x6a\xbe\x96\x38\xce\x8b\x59\x6a\x40\x2b\xbb\xc7\x56\x3f\x2a\x2b\x67\x04\x96\xe7\x47\x91\x67\x89\xc2\x0d\x4b\xa4\x4b\x9d\xec\x80\xbd\x46\xfd\xaa\x0e\x3d\xa0\x06\xac\x2d\x76\x8c\x8b\x2f\xe3\x4a\x8c\x1f\xc1\x17\x54\xb8\x5e\x1a\xc1\xa0\x17\x15\x41\x95\x06\xb7\x9c\x49\x95\xb7\xe0\x1e\x8d\x87\x34\x93\x00\x7c\x50\xf2\x6b\x69\x50\x2f\x51\xce\xf0\xe2\x44\x8d\x86\xe5\xde\x2a\x1b\xac\xe1\x3e\xa6\xcc\x88\xbd\x88\x1f\x4f\x22\xb4\x67\x2f\x64\x9b\x31\x2c\x4c\x6e\x64\xa1\x27\x30\x93\x03\x97\xa6\x67\xfd\x35\x58\x43\x86\xbf\xc9\x62\x7b\xd0\xba\x4e\x26\xc9\xcb\x4c\xd8\xc0\xd8\x4d\x8d\x1b\x2b\xc9\x3f\x5d\xcc\x2b\xb1\x44\x59\x4f\x97\x51\xd5\x09\xad\xb7\xce\x0b\x7b\x08\x0e\x1a\x9d\x10\x11\x43\xfa\x5a\xe9\xa9\x6f\x74\x60\x53\xb8\x68\x81\x5e\xda\xb9\x7b\x99\x35\x38\xb2\xc4\x4f\xc7\x62\x60\x13\x46\x66\xd9\x45\xd0\x67\x06\x77\xda\x58\xbe\x49\xc2\x6a\xba\x33\xc8\xfa\xb3\xe1\xfc\xa7\x6e\x64\xec\xd3\x43\xc7\xf5\x69\x46\xb8\xf3\x4b\xa4\x0e\x1b\x4d\xb6\xcf\x56\xd1\x0d\x6d\xe8\xb3\xb0\xcc\xc9\x68\xa3\x4a\xa6\x8b\x4f\xc7\x22\x96\xa8\x7b\x89\x59\xba\x05\x21\x7a\xb5\x23\xc3\xe8\xe3\xff\xe5\x5d\x73\x91\x7f\x46\xad\x66\x03\x76\xf0\x67\x4b\xd2\xba\x27\x07\x09\xb5\xec\x81\x25\x9a\x21\x5e\xc8\xbd\xe6\x2e\xc1\x69\x15\xeb\x9b\x22\x63\xf2\x5d\x0b\x68\xa8\x75\x3d\x64\x0a\xa4\xfe\x40\x64\xcd\xc1\xca\x69\xa4\x0e\x48\x88\x0c\x9b\x20\xf3\xba\xe8\x6e\x84\x9b\x02\x81\xf0\x87\x75\x16\x18\xd6\x8b\xdc\x1f\x75\xf5\x98\x75\x7e\x32\xc6\x50\x17\xf1\xd2\x21\x07\xde\xd0\xea\x2e\x4a\x33\x3d\xf5\xf6\x33\x09\x6a\x73\x93\x72\xcb\x67\x90\xd4\xfc\x88\xf0\xa0\xaf\x69\x18\x34\xfb\xd7\xd1\x52\x13\xb9\x26\xeb\x18\xb1\xf3\xf2\x38\x8c\xa7\x71\x2a\xf2\x08\xe3\x35\x97\xb8\x91\xdc\xc8\x75\xca\x09\xdc\xbe\x7b\x26\x5d\x48\xa3\xf5\xe4\x2f\x47\x89\x4b\xe1\x78\x21\x96\x7e\x13\x74\xbe\x0a\x1b\x84\xa9\x43\x11\x57\x57\x8d\xe2\x08\x8c\xd2\x88\xa3\xa9\x85\x41\x11\x81\x79\x93\xa7\xcb\xd7\xac\x3b\xc7\xfa\x3d\x38\x0b\xcd\xdd\xa1\xde\x73\x01\x8a\x49\xae\x83\x32\xcf\x45\xa1\x9d\x8d\x64\xde\x8c\xa4\x4a\x2d\x7b\x88\xce\xa4\xd6\x30\x17\xf0\xd8\x84\xf3\x2f\xb2\x1f\xaf\xb1\xe9\x8b\x8d\x94\xf3\x7a\xba\xff\xcc\xf0\xbc\xc9\xc8\x50\xd9\xbf\x59\x13\xff\xa1\xf9\x09\xec\x06\x5f\x64\x8c\xda\x12\xc4\x3a\x1e\xa6\x34\x8a\x7e\x10\x16\xbd\x51\xa0\xcc\x32\x3c\xe4\x42\x40\x00\xd7\xbd\xa3\x71\xd2\x06\x95\x59\x8c\x51\xb8\x14\xf3\x74\x0f\x89\x74\x88\x02\x68\x8c\xc8\xb1\x57\x41\xec\x7d\x5b\x19\x18\x9b\xd0\x4b\x8f\x39\x1e\xd3\x5a\x7b\x26\xf4\xf6\xa4\x7f\xc8\x91\x9e\xb8\x6e\x99\x64\xc9\x48\xf1\xec\xe4\xf4\x78\x07\x24\x5f\x66\x06\x5f\xab\x20\x66\xb6\xa7\xff\x93\x31\xc5\xe4\x28\xb5\x62\xb3\xfc\xff\x5f\xaa\x03\x40\x74\xce\x25\x1e\xe0\x48\xe6\x5a\x2b\x90\xba\x15\x90\x4d\x4c\xd7\xe7\x89\xac\x39\x45\x5e\xe7\x0b\x2e\x02\xa4\x30\x65\x7d\x77\x8e\x43\x05\xd3\x15\x07\x01\x35\x52\x3b\x3e\x68\xfc\x3d\xfc\x48\x34\x22\x41\x13\x18\x61\xd9\x46\xd2\xaf\x5e\xe8\x32\x8a\x3c\xbb\xc8\xbe\x25\x6f\xbd\x4a\xde\x7a\x9d\x04\x2d\x2d\x1f\x69\xc2\xc8\x6a\x47\x82\xa5\x5e\xd8\x36\x72\xcc\x6d\x81\x7c\x0b\x70\x8f\x58\xbd\xc8\x54\x84\x5d\xc1\xe2\x09\x99\xa4\x81\xde\x66\xbf\x60\x27\x69\x27\x5e\x45\x65\x37\x4f\xe8\x41\x2f\x76\x87\x41\x48\x50\x4c\x44\x14\xb5\xa9\x93\xe6\x5a\xe7\x4c\x6a\xcd\x07\xc2\x41\x90\x01\x8d\xd2\x3d\x93\x05\x6b\x33\x0c\x42\x66\x71\x63\x9f\x76\x2d\x99\x4a\x95\x72\xbe\xc8\x25\x1c\x8f\x4d\x7e\x66\xd4\x1e\x1e\xcb\xe6\x91\x2d\x85\x72\xf4\x8c\x17\x8a\xd0\xcf\x46\xef\x5e\x08\x92\xec\x65\x30\x46\x20\x08\xca\xa0\x38\x68\xc4\xe7\x37\x79\x12\xe2\x8a\x6f\xbd\x04\x26\x4f\x5d\xdb\x83\x68\x90\x42\xbb\xb5\x52\x4d\xc6\xa6\xfd\x92\xa7\x9e\x4a\x82\x7a\xa1\xfc\xe1\x65\xac\x0b\x18\xa9\x65\x7e\x45\xe5\xe4\xf3\x73\x1f\x65\x74\xc4\x9f\xa4\x9d\x22\xba\x82\x60\xdc\x8e\x4a\x14\xaa\xb4\x3f\xcf\xdd\x5b\x2b\x4b\xf0\x13\x2f\x73\x94\xae\x9d\x9d\xe0\xc9\x60\x66\x33\xb2\x00\x64\xed\x95\xb0\x85\x3a\x2c\x3f\x74\xc0\x06\x34\x32\x3b\x79\x62\xc8\x77\x80\x11\x31\xc0\x5c\x28\xca\x5e\x13\x8b\x78\xaf\x2b\x19\x6d\xcd\xba\x27\x41\x9f\xaa\xef\xc6\xdf\x3d\xb3\xb2\x50\x8d\xb3\xb8\xad\x28\xd6\x28\x49\xcf\xaf\x4f\xc5\x36\xb6\x27\x53\x37\x8b\xa4\x6e\x8a\xbf\x85\x79\x2e\x2d\x59\x47\x1a\x61\xc5\x3d\xf2\x03\x6a\x8d\x22\x39\x9d\x63\x27\x69\xfd\x08\xa7\x75\xd1\x99\xff\x0b\xfa\x02\x8b\x3a\x7a\x0b\x83\x25\x54\xdc\x2c\xc8\xc3\x39\x48\xcf\x99\x35\x91\x08\x99\x51\x59\x30\xa7\x83\x26\x85\x4c\x11\xa7\x1b\xd1\xec\x4f\x0a\xe9\x01\xb7\x63\x81\x4f\xc8\x76\x39\x33\xfc\x21\x39\xc8\x24\x54\xcf\x83\x92\xa7\xc1\xa7\x6b\x09\xdc\xb4\x7c\xea\x40\x26\x14\xc3\x90\x30\x75\x29\x08\x0b\xab\x6b\x83\x81\x4e\xfb\xd6\x66\x76\xcb\x76\x28\x7c\x1c\xb3\xe3\x7c\x63\xc0\xb7\xf1\x21\xd9\xf6\x2f\xb4\x2c\x8a\x16\x60\x31\x66\xce\xc2\x16\xab\x23\x4b\x00\x7e\x99\xcb\xeb\x17\xc9\xf1\x1e\xb6\x28\xf1\xbe\x65\x6b\x91\xe4\x1e\xd8\xcc\x54\x5c\x03\x7c\x32\x09\xcd\xd0\xc1\x31\xe1\x4a\x42\x67\x6f\x90\x69\xa9\x12\x12\x9f\xdb\x64\xd8\x9b\xcb\xc0\x02\x99\xe8\x5f\xe2\x70\x09\x8c\x92\x80\xf4\xea\x38\xd8\x20\xda\x1b\x1a\xa0\x78\x25\x96\x2b\xd4\x90\x24\x42\xfb\xb2\xbb\xaa\x5a\x7e\x99\x80\x86\x68\xd3\xb8\x96\x94\x6b\x86\x25\xce\x3e\x60\xe4\x8d\xbc\x79\xd9\x09\xa9\x2d\x84\xb7\xe2\x9e\x25\x17\x68\xad\xa6\x38\x40\xcc\x99\x4c\x2d\xa1\x5c\x23\xf5\x76\xd2\xce\x29\xf8\x64\xbb\xe4\x2c\x9f\x44\x9e\x95\xd3\x81\xbb\x9b\xd7\xe9\x47\x45\x52\x9b\x8c\x3c\xfa\x1d\x6a\xcc\xd5\x78\x31\x62\x9e\x0d\x31\x83\x06\xe8\xfd\x2c\x94\x34\xd2\x96\xfa\x25\xbf\x81\x35\x9c\xdf\x29\x5f\xbb\xca\xe1\x32\x13\x4f\x54\xdc\xd9\xc4\xae\x96\x11\xce\xd0\x5b\x1a\x5a\xc5\x0d\x5c\xbd\xfd\xe9\x0b\xfd\xc1\x4e\x25\x19\x91\x88\x9a\xa1\xb5\x63\x42\xec\xc7\xc5\xe0\xe5\xc2\x61\x2d\xe3\x51\x2d\x5a\x03\x3a\x52\xda\xcb\x2a\x60\xc3\x77\x04\x64\xb7\xbf\x23\x2b\x3d\xaf\xb4\xbb\x37\xdb\x09\x66\x3d\x66\x1d\x29\x76\xd4\x1d\xaf\xff\x83\x96\x30\x08\x2c\x3f\xac\xf1\x02\x24\xca\x4c\x90\x14\x2f\x16\x01\xa5\x50\xd5\x88\x5b\x55\xcb\xd8\x5a\x3b\x22\x84\x6f\xdb\x3d\xbb\xb1\xec\x25\xf8\x41\xe9\xc8\x4e\xbc\x13\xa8\xec\x12\x2f\xee\xbe\x47\xf5\x0a\xb2\xcd\xf0\x5d\x48\x54\x31\x9c\x85\x63\x58\xb3\xc0\xb9\x7e\x6b\xa5\x11\xba\x07\x75\xce\x49\x7c\xb5\x72\xfb\x56\xe0\x4c\xca\x03\x1a\x08\x94\xff\x81\x15\xce\xc2\x01\xd4\x68\xb7\x4c\x09\x17\xc7\x1f\xcc\x06\xcd\x32\xe0\x02\x6c\xf3\xab\x90\x74\x6c\x3c\xab\x4b\xf1\x01\xd8\xe1\x37\xc9\xd8\x21\x4b\x4d\x05\xea\x7d\xea\xc3\x2f\xbc\x0d\xd9\x54\xe5\x15\x2e\x97\x6c\xdf\x1b\x2e\x4c\x7f\x34\xe8\xaf\x2c\x65\x2b\x24\xb2\x8c\x3e\xfb\xfc\x77\x89\x0a\x2f\xdc\x41\x44\xb9\x4a\xd3\x67\x05\xd6\x5f\xc6\x47\xc2\x66\x48\x07\xcf\x53\x4c\x6d\xbd\xf2\x73\x04\xb5\x06\x2b\x6f\x60\x11\x70\x18\x9c\xdc\x34\xe2\x8d\xba\x5b\xb6\x89\x3b\xfa\x26\x75\xd1\x3f\x2d\x6a\x42\x67\x0b\x6b\xd9\x4e\x32\x17\xb0\x92\x45\xc3\x8d\x05\xda\xa8\x06\x0a\x32\x87\x59\x80\x55\x39\xfd\x85\x1d\x92\xae\x86\xb9\x15\xc8\xe7\x8f\xa6\xc9\x7e\x44\x32\xc2\x26\x23\x53\xc4\x7a\x6b\x57\xc1\xcc\x87\xfb\x4e\xe3\x50\xab\xe2\xe7\x10\x8a\x25\x4f\xcc\x0e\xa4\x45\xd8\x55\x55\x14\x1f\x02\x20\x7e\xb0\x19\x62\xf1\x25\xeb\xf7\xda\xf2\xe3\xa9\x99\xe8\x01\xb6\x59\x7e\x6d\x4b\x62\x3a\x58\x5b\x59\x26\x99\xdd\x70\x99\x40\xdd\x5e\x22\xde\x4b\x63\x67\x93\xd8\x91\x77\xd3\xee\xfb\x4c\x22\xdc\x63\x58\xaf\x9f\xee\x85\xd0\x5d\x13\x75\x66\x3f\x33\x1f\x70\xdf\x98\x9c\x60\xf1\xae\xfc\x5c\xe7\x4a\xe1\x47\xa9\x1a\x2e\x28\x44\xfc\xda\x68\xcd\x3b\x38\xd9\xa9\xdb\xb4\x25\x59\xc6\x26\xed\x37\xc5\xd4\x65\x0d\x0b\x8f\x51\xe6\xf8\x3f\x2d\x71\x0d\x80\xc8\x9b\xb8\x0b\x39\xc6\x44\x9e\xd9\x9a\x0f\x92\xd1\x08\x9b\xf6\xf6\xcb\x0b\x65\x25\x2a\x7a\x2a\x11\xc0\x93\x59\xfc\x27\xe7\x1c\x3d\x82\x75\xae\xb8\x7f\xa8\x58\xfa\xce\x3c\xc4\xeb\x20\x07\x02\x33\xe2\x2b\x89\x57\xd0\xee\x32\x53\x90\x0c\xa1\x11\x73\x16\x0c\x3b\xca\x51\x8a\x95\xd5\x97\xd0\x52\x99\x12\xa8\x03\x50\x1b\xe1\x4c\xb5\x61\x45\x17\xe3\x8c\x8d\x34\x32\x4a\xf1\x82\xd8\xf3\xba\xce\xe8\xde\x30\x22\x0f\xa0\xa0\x16\x2b\xc4\x77\x0c\x17\xc8\xa6\x7b\x94\x7f\x99\x2d\x24\xac\xe4\x3b\x58\xd8\xf7\xbf\x22\xef\xfe\x89\x7e\x21\x20\x6c\x4d\x23\x2c\x2f\x6b\xdb\x5f\xe6\x48\xb8\xa7\x8c\xf0\x8d\x92\x8d\x67\x6a\x9d\xae\x56\xa7\xd5\x22\x65\x65\x32\x37\x0c\x9c\x23\x61\xdc\x14\xe2\xff\xd4\x0d\x61\xe1\x8d\x5a\xf5\x68\x9b\x42\x4c\x28\xe8\x20\x73\x62\xdd\x4d\xbb\xcd\xf0\xdf\xc2\x67\x6b\x64\x04\xc5\xa8\xc9\x9e\x0e\x59\xf3\xb7\xf8\x25\x6f\xad\x6d\x59\x78\x7e\x99\x97\x4c\xbd\x1e\x6f\xc2\x84\x1c\x08\xec\xe3\xcc\x88\x59\x17\xeb\xc5\xae\x7e\xdb\xee\xde\x2f\x50\xb3\x4a\x73\x64\xae\xa9\x0e\x91\x5a\x92\xfa\x6b\x59\x8e\xb1\x8c\x76\x3a\x7c\x2e\x98\x6a\x76\x61\x04\x65\x3a\xf4\x34\x92\x36\x0d\xd6\x09\xc7\x7e\x15\x0d\x42\xea\xc7\x5d\x9a\x27\x4e\x2f\xda\xc3\xc5\xbc\x59\xbe\x45\x1c\x01\x22\xe3\x7b\xb4\x79\x77\xa2\x2b\x0e\xd5\x80\xe2\x96\x96\xad\xe3\x5f\xe2\x29\x51\xd2\x9d\x59\xd7\xb1\xb6\x07\x3f\xbd\xf1\xcd\x83\xec\x59\xac\xb0\x2c\xdb\xc8\x6c\x81\xa4\x57\xcd\x72\x40\x07\xd8\x85\x3f\x7f\x31\x1d\xf0\x54\x0e\xbc\xcd\x79\xf9\x43\x15\xfa\xe3\x0d\x27\x3f\x21\x17\xcb\xe2\x65\xbf\x37\xb5\x48\x64\xcf\xb9\xc9\x9e\x60\xe3\xd2\xc5\xa3\x14\x58\xdd\x2b\x91\xe1\x59\x3d\x0c\xeb\xeb\x15\x8e\x80\xe4\xec\x41\x45\x4a\x88\xd7\xdd\xa4\x21\xe1\x21\xd9\x7a\x43\x69\x6b\xd0\x94\x04\x0b\x4d\xcd\x74\x0f\x50\x0d\xe0\x06\x8e\x4d\x3f\xf9\x0e\xbd\x29\xfb\x25\x54\xda\xfc\x34\xd3\xcb\xb3\x31\xf0\x4c\xef\x0c\xfc\xf0\x3b\x4d\xc7\x13\x6c\x2f\xc8\xf9\xe1\x50\x70\xfb\xa4\x26\x87\x8a\xe0\x26\x85\x08\xe1\x1c\x30\x0a\x73\x4e\xb9\xe6\x3d\x2c\xe7\x70\x49\xaa\x7b\x53\x63\x94\xb0\x66\x8e\x52\xba\xb3\x69\x9e\xe8\x9e\xba\xb5\x9b\xd4\xf6\xa5\xa5\x5d\x06\x3c\xc4\xae\x0b\x5a\x5a\xe5\x55\xc7\xba\xf6\xdc\x5c\x26\xa1\x4a\xba\xa2\x0d\x32\xc8\xa4\xf8\x57\xec\x65\xfe\x70\x14\x6e\xd0\xb7\xce\x57\x38\x3f\x43\x9b\x72\x44\xf0\x11\x4e\x4f\x1a\xa7\x46\x80\xa1\xdd\x0f\x87\xca\x94\x23\x3f\x09\xc8\x40\xe6\x66\x58\xd8\xec\xee\x40\x1a\x10\x05\x1d\x72\x44\x8b\xc2\x1c\x63\xe5\xb4\xe2\x25\xa9\x49\x28\xec\x87\x59\x10\xb4\x13\x06\xaa\xb5\xe5\x7b\x04\x45\x4b\x62\xec\xef\x64\xf0\x10\x4f\x51\x89\xa9\xad\x10\x57\x99\xcb\x2c\x85\xad\x0b\x42\x1f\xd0\xea\xf3\x34\x54\x9e\xb7\xf3\x82\xf8\x24\xeb\xbd\xf4\x7b\x8f\x97\x6d\x1a\xa4\x57\xbc\x4e\x7b\xd7\xd6\x96\xe7\x24\x92\x33\x73\x4a\x20\x18\x10\xd3\x47\x19\x01\xa3\x96\x74\x12\x27\xe2\xcb\x90\x9e\xca\x30\x82\x91\xe2\x92\x5d\x1c\x47\x4e\x18\x1a\x39\x7a\x43\x5a\xde\x7b\xce\xb9\x8a\x3a\x73\xb1\x55\xc3\xd0\xea\x51\xf9\x92\x24\x9d\x92\x91\x25\xed\x78\xf0\x6e\xb8\xda\x30\xb6\x16\xf4\x91\x68\x2a\x3c\x08\x84\x6c\xc7\xa4\x9f\xdd\xcb\xc1\x3f\x7e\x9c\x7e\x02\xf1\x52\x9b\x2f\x9e\x49\x83\x6b\x0b\xf6\xd9\x2d\x02\xff\x3c\x46\x54\xf9\xa5\x0d\xe5\xe1\x14\xa1\xd0\xa1\x8b\xb0\x92\x57\x35\x02\x0a\x86\x9d\x9d\x72\x22\xc4\x6e\x6a\x15\x45\xb4\xa2\x75\x51\x34\x6b\x09\x5d\xc0\xa5\xc2\x42\xd7\x10\x59\x6e\x2d\x82\xf4\x26\xb6\x80\x13\x71\x77\x51\x81\x96\x59\x90\x79\xe6\x1b\x87\x43\x05\x9d\x56\x6f\x23\x03\xaf\x60\x25\xfa\x8a\x4f\x4c\x74\x7c\x4c\x8b\x54\x0b\x1f\xa4\x2d\x7a\x68\x8b\x34\x91\x4c\x87\x15\x73\xd5\xf5\xae\x3e\x96\xc7\x2c\xe5\x2e\x7e\x0e\x94\x1a\xf5\xdb\x4c\x4d\x61\xdb\x21\x6c\x26\x7b\xf2\xa9\x50\x88\xce\x0c\x48\x2d\x53\x75\xfe\x9b\xa6\x26\xe8\xb8\x8b\x4a\xe3\x44\xf7\xc3\xe3\xd3\x5a\xf8\x8d\x48\xd9\x5a\x5d\xa1\x77\x03\x26\x8d\x24\x2e\x71\x65\x37\xb2\x66\xb0\x66\xf1\x38\xe2\x85\x03\x67\x93\x9e\xa0\x45\x8c\xcb\x2c\x5c\xcc\xca\xf4\x2c\x63\xd5\x6b\xbc\x83\x5d\x5e\x05\xf1\xf8\x67\x53\xd2\x0a\xe6\x6f\xb5\x1d\xe7\x99\x83\x36\x94\x25\x61\x93\x86\xd6\x09\x3a\x1c\xec\x81\x74\x5a\x57\x5c\x73\x19\xa6\xb4\x62\x6a\x7f\x1c\x24\xfa\xae\xad\xfc\x88\x1d\x15\x5f\x5c\x2c\xc0\xd8\x71\x4b\x49\x0a\xc5\xa1\xbf\xb3\xcc\xa4\xb2\x89\xbf\xd3\xe9\x7e\xd7\x89\xc0\x73\x2b\xd8\x2d\x2c\x6b\x2d\xf7\x03\x63\x34\xcb\x6c\xee\x20\x6c\x14\x04\x85\x8b\x4f\x8f\xdc\xf6\x7e\x29\x1a\xaf\xd3\x0d\x43\x03\x16\xd6\x25\x59\x16\xae\xae\x28\x2f\xa2\xd4\xbf\xb2\xa4\x41\x95\x65\xc5\x10\x4c\xf0\x88\xec\xed\x5c\x6b\xcd\xd3\x3b\xb5\xe2\x21\x54\xe4\x81\xb0\xec\xf7\xf4\x91\x08\x6f\xba\x76\xa5\xba\xb6\xb2\x8d\x52\x02\xd2\x5d\x5c\x19\xa6\xa8\x9e\x51\x3b\xf5\x59\xe2\x7a\x46\xba\x7a\xdf\xf9\xa2\x10\x2a\xe4\xe7\xbb\x3a\xd0\x14\xd1\xb2\x72\x7c\x44\x1d\xc9\xc3\xc0\x59\xc7\xb8\x1f\x4a\x85\x52\x45\xb5\xa1\x29\xe5\x9b\x8c\x51\x29\xaa\x15\x76\xf2\x97\x26\x18\x02\x22\x9c\xc5\x32\xed\x94\xd3\xb9\x0e\xd2\x32\xd4\x19\x96\x7e\xe5\xc8\xa2\x70\x1d\x3a\x11\xa5\x12\xba\x2b\xdb\xa2\xf6\xc8\x07\x48\x85\xfb\x3a\x01\x1e\xe3\x48\x26\xe9\xb4\x2e\xc8\xd5\x59\x74\x2c\x21\x8e\x52\xcb\xef\x4a\x6a\x58\xcc\xa5\x00\x3e\x6f\x17\xf6\x0f\xc5\x0f\xc8\x7c\x8c\xf5\x52\x4d\x95\x0e\xe4\xac\x5b\x90\x83\x30\x80\x3e\xa5\x04\x67\x69\x58\x5e\x44\x09\xac\x17\x28\xde\x47\x54\xaf\x49\x7f\xe4\x21\x21\xe9\x23\x08\x8b\x68\x22\xc1\x5e\x44\x8e\x47\x26\xbd\x15\x1f\x64\x25\x4c\xb7\x0e\xce\x47\xc7\xad\x10\xe0\xcd\x34\x49\xb5\x8c\xeb\x17\xff\x20\xc6\x48\x0d\x63\x15\x56\x17\xc0\xa4\xe0\x48\xb6\x7b\x7b\x0c\x58\xc4\x8d\xf9\xd8\x90\x39\x7f\x83\x7d\xe0\x49\xee\x87\xae\x76\xab\xaf\x09\x70\x8f\x16\xcc\xba\x15\x85\xf9\x50\x14\xe3\x22\xda\x5e\x89\x75\xe6\x78\xdf\x3a\xba\x54\x17\x84\xf5\x85\xed\x51\x5c\x39\xeb\x69\xa4\x47\x04\x50\xa3\xb5\xa6\x41\xf0\x24\x1e\xa9\x49\x0f\x08\xe2\xa5\x44\x33\x29\xb4\x5e\x80\xd0\x99\x23\x2f\x9e\x6c\x09\xae\x08\x00\x12\xa6\xda\x75\xa4\xbe\x23\xc3\x77\x46\x7b\x45\x94\x6e\x80\xb4\x4c\x68\x50\x3e\x89\xe3\xfd\x7f\x80\xaf\xf6\xe0\x4c\x44\x76\x22\x8a\xba\x39\x86\x07\x21\xe9\x67\xe3\xdc\x57\xe0\x09\x1b\x69\xf6\xbd\xb4\x2d\x37\x75\x0f\xe7\x4b\xb8\xa7\xed\xbf\x2e\x0f\xcc\xd2\x12\x32\x7a\x40\x72\x91\xb3\x3d\xfa\xc3\x12\x45\x07\x46\x6d\x57\x7c\xb4\x52\xcc\xd2\xf8\xc9\x00\x87\x2a\x6f\xa7\x40\x4d\x0b\xe1\x61\xe3\xd4\x63\xb0\xf7\x08\xef\x61\x98\x38\x5e\x42\x67\xd6\x0c\x4a\x56\x10\xc9\x56\xf4\x6d\xd0\x67\x6e\x40\xac\x67\xd0\x5e\x89\x41\x79\xd8\x8f\xa9\xae\xe4\x1f\x69\x13\x33\xbc\x59\xb0\xc0\x93\xf0\x4a\x66\x75\x6f\xaf\x83\xc0\xb5\xfd\xa5\x02\xda\x5a\x11\xe5\x09\x2d\xbf\xec\xb6\xf5\x76\xe6\x28\x2d\x9c\xab\xd4\xee\x9f\x01\x3c\x0c\x8c\x08\x84\x0a\x74\x67\xeb\x8c\x70\x16\xf5\x5e\x9e\xea\xa5\xf4\x7f\x8c\x58\x65\xca\x3b\x49\x28\x1a\x97\x97\x0c\xf8\x66\xd7\x77\x1b\x85\x88\xae\x36\x8b\x36\x82\xd7\x9f\x50\xe6\xbc\x6d\x28\x10\xfc\xd2\x43\xba\xa2\x75\x4c\xd8\xcd\x48\x29\x11\x74\xdc\xd2\x0d\x1d\x83\x41\x6e\x13\x31\xe8\xc1\x82\x74\x5c\x15\x6f\xe5\x25\xf4\x4f\x33\xca\xfd\x6f\xe1\x90\x5f\xb5\x0e\x36\x0d\x03\x7b\x79\xe1\x3c\xce\x8c\x38\x30\xe5\x30\x0c\x83\x1e\x11\xa2\xdf\x42\xeb\x77\xfb\x92\xdb\x23\x20\x6e\xd0\x92\x5a\x42\x4e\x38\x8e\x40\x25\x8d\x92\x15\x35\x86\x7e\x69\x34\x9f\x95\xd1\xdb\xfa\xfe\x84\xe0\xfb\x8d\xb4\x87\xf6\x6e\x66\x16\x46\x6a\x20\x8b\x2b\x75\x30\xc9\x20\x15\x81\xb4\x4f\x34\x7b\x47\xaf\xeb\x45\x67\x42\xd8\x88\x0b\xfe\x81\x49\xbf\x17\x3d\xe1\x97\x03\x5c\x6f\xc0\x0f\xea\x98\x50\x17\x3e\xa9\x7e\xc7\x20\x90\x4e\x01\x99\x34\xca\xc2\xd3\x28\x92\xbf\x09\x25\x56\xa1\xb2\xb5\xff\x51\x8b\x2b\x1e\xdd\x1c\x01\x8c\x5e\xbb\x6e\x96\xe2\x7d\xb8\xf8\xa4\x6f\x19\xa5\x72\x0c\x8f\x77\xd9\x9a\x29\x44\x2b\xdb\x12\x75\xee\xf7\xa2\x44\x98\x07\xcd\x05\x50\xce\x0c\x61\x37\x94\x90\x8b\x42\x06\x1d\x1d\xfa\x74\x67\xe6\xa6\xfe\x6c\x68\x19\xa8\xd0\xd5\xf3\x4b\x46\x59\x84\xfa\x8f\xf6\x6a\x52\x0a\x47\x49\x6b\x8c\xa4\xcd\x02\xfe\x46\x8a\xca\x43\xd8\x27\x45\xea\xe8\x74\x2c\x63\x8b\xea\x71\xd1\x89\x7b\x72\x49\x8b\x09\x93\xad\xf9\x15\x42\x34\xc5\xce\xfa\x1c\x55\x53\x8b\x5a\x97\x42\x65\x16\x0c\xf8\x33\x89\xcf\x11\xd7\x0d\x79\xfe\xaa\xb0\x93\xb4\x87\x10\x3a\xca\xf4\xe1\x41\x8d\xc6\x72\x04\x5b\xd2\xa4\xdd\xaa\x0e\x2d\x71\x25\x5e\x82\x28\xcc\xe2\x4e\x8e\xeb\xed\x05\x73\xde\xa5\x6d\x89\x2f\x2a\xbf\x7a\x2c\x71\x2a\xef\xc6\xe3\xe0\xc7\xf2\xc0\xf3\xc3\x06\x88\x3e\x34\x3b\x32\xb0\xf2\xe1\xd3\xc1\xdb\x0d\x3c\x4c\x36\xd4\xd6\xd3\x03\x3b\x92\x69\x35\x35\x84\x24\x43\xed\x11\xc7\x01\xea\xae\x24\x03\x6f\x66\x47\xff\xd2\xb4\xfe\x04\x90\x38\x69\x9b\xfa\x2a\xa3\x70\x6a\xd2\x98\x40\x3d\x3c\x4f\xd1\xd7\x37\x41\x2b\x8b\x8b\x24\x2d\x18\x7d\x92\xb8\x7f\x13\xb7\x88\xdc\x4f\xb5\xb1\xf4\xcf\xc6\x4f\xfd\x2e\x51\xa2\xbc\xe2\x92\x87\xbb\x94\x58\x05\x2b\x33\x2d\xaa\x41\x5e\xe5\xe4\xb3\x43\x6b\x12\x7d\x33\x86\x96\xc7\x62\x9b\xd8\xc2\xda\x5f\x41\x1a\x4d\x6c\xe3\x87\x27\xce\x12\x5e\xb8\x6e\xe4\x88\x21\x91\xde\x81\x53\x62\x08\x77\x66\x6d\x73\xd0\xf9\x30\x3b\x61\x15\xd5\x05\xc0\xf5\x40\x98\xc0\x53\x9a\xf2\x6c\xd0\xb4\x5f\xc8\xf7\x2a\x8b\xd9\x05\xc4\xcb\xad\x4f\x32\x96\xe3\x34\x42\xea\xe5\xf4\x9c\x24\x5f\x89\x8c\xe8\xf6\xc0\x91\x8a\x3d\xa0\x61\x51\x20\xbe\x36\x29\x47\xfa\x42\xa3\x40\xf5\x78\x0a\x6b\x5e\x03\x26\x48\x46\xfb\xcd\xd3\x9e\x49\x83\x35\x5c\x10\x1a\x9c\xe0\x68\x1e\x03\x52\x20\x3b\x58\x4d\x24\x23\x64\x58\x6f\x06\xa3\x97\xd1\x1c\x45\x97\x61\xe9\x8f\xd2\xcf\xef\x95\xa8\x99\x7d\xba\xa4\xd6\xa4\x80\xb4\x87\x9e\x6c\x36\x06\x97\x66\x5a\x7a\x4d\x92\x2c\x50\x60\xe8\xaa\x2d\x82\xc6\x2f\x48\x8b\xa6\x33\x9e\xde\x97\xb9\x62\xdb\xc8\xd1\x75\x34\xc7\xd5\xdf\xc2\xb9\x64\x63\xda\xce\x86\x82\x0d\xf6\x0f\x1c\x60\x73\xec\x58\x94\xb3\x06\x44\x8c\x27\x35\x23\x44\x0d\xf4\x0a\x03\x02\xae\x41\x28\xe6\x86\x09\xe5\x9f\xef\xc8\x71\xfa\x65\xc4\x39\x64\xe9\x82\x63\xfa\x25\xe9\xc6\xe5\x28\x6d\x62\x6c\x27\xb2\xf9\x25\x52\xb2\x3c\x02\xe1\xf3\x52\xe7\xe4\x1b\xd7\x10\x69\x40\x49\x52\xf2\x24\x38\xd2\xf2\x83\x8e\xaa\x88\x97\xfe\x09\xcd\x7a\x3c\xb6\x0b\x17\x21\x0d\x1d\x5d\xdd\x47\x00\x23\x52\x6f\xa9\x3a\x87\xde\xa5\x16\x15\xde\xee\x9f\x7e\x49\xe9\x67\xb9\x93\xab\xf9\x98\x4b\xee\x5d\x81\xc5\xf0\xdd\xc8\x4f\xf6\xc1\xbf\x15\x3d\x76\xd0\x8a\x72\x0e\x1c\x9b\xd4\x24\x78\x6a\x93\xc0\x59\x2a\x4f\xd7\xc2\x63\x2f\xa3\x42\xbf\x54\x94\x24\x9f\xe8\x95\xe7\x0e\xec\x6a\xb7\x98\x9f\xa8\xf2\x73\x7f\xcc\x28\xe0\xf4\xa2\xac\x69\x1a\x1f\xa7\x73\xf6\xa3\xf9\x90\xa3\x19\x10\xee\xe0\x71\xb6\x3c\xc3\x75\xa8\xb0\x00\x3f\xa1\x86\x56\xc3\x78\xcc\x28\x97\x7d\xfa\x6c\xf4\x41\x47\x65\x39\x52\x0a\xf6\x5e\xc7\x6c\xd4\x4c\xa9\x5e\xff\xd9\x14\x4e\x5a\x6c\x2b\x9c\xd5\x8f\xc6\x49\xd6\x86\x86\xc4\x15\x19\xba\x74\xc0\xef\x1c\x24\xc6\x7f\xf5\xa8\x28\x59\x6b\x8a\x20\x88\xad\xb8\xdc\xb0\xe9\x6f\x04\x89\xad\x75\xa7\xf8\x61\xa6\xf3\x37\x88\xb3\x5b\x71\xce\x51\x5c\xd5\xf7\xa5\x67\xd9\x52\x26\xd2\xae\xd4\xcb\xd5\x95\x09\xf4\x23\x63\x54\x6e\x37\x16\x9a\x7a\xba\xb2\xa1\xc5\x08\xaf\x67\xba\xb4\x9c\x5f\x5a\x9b\x64\x6e\xde\xf3\x42\x57\x23\xdd\xb5\x86\xa6\xe5\x99\x4e\x0c\xe9\xcc\x81\x5d\x94\xc2\x33\xa0\x62\x90\x06\x29\x7a\x3f\x8f\x39\xad\x7e\xf2\x13\x69\xb9\xac\x7b\xcd\xfd\x5b\xf5\xe8\x0d\x48\xc1\x11\x02\x2c\x5a\x15\x57\x81\x03\x7d\xe2\x70\x29\x38\x00\x5d\xdd\x12\x32\x3d\x29\x16\xf7\x7b\x8d\x93\x1e\x67\x45\x61\x82\x9e\xaf\x02\x4f\x78\xea\x39\x0d\x3f\xd9\x69\x95\xd9\x45\xfd\x45\x01\xc4\x45\x60\x7f\x4a\x0a\x56\xee\xbc\x48\x00\x4a\x7e\x89\x85\x04\x9a\x38\x05\xc6\xe1\xe3\x7e\xc2\x91\x51\x89\x8a\x2c\xf6\xbf\x4d\x98\xfb\x76\x73\xcf\xee\x77\x2a\x2c\xe2\xd7\x4e\x5a\xcb\xa2\x60\x8e\x2f\xc0\x31\x38\x4d\xc5\x11\xc0\x91\x34\xb7\x40\xf0\x87\x0a\x91\x3e\x58\xc1\xe0\xb9\x43\xc2\xd7\x38\xbc\x48\xbb\x33\xc8\xa0\x14\x72\x8d\x2d\xc5\x36\x3f\x51\x85\x9b\x40\xf0\x54\xb4\x93\x30\x6a\xcc\x32\x44\x9f\xb3\x1a\x8f\x29\x28\x50\x34\x69\x12\xad\x03\xc7\x20\x02\x2a\x46\x54\xde\xcc\x2c\xca\x24\x63\x6c\xe2\x65\x48\xbd\xef\xde\x04\x1f\x1e\xd8\xa7\x31\xc8\x0c\xca\x21\x65\x52\x78\xcd\x3a\x40\xca\x82\xe2\x59\xe7\xe9\x69\xf3\xc4\x20\xb3\xb9\xb6\x59\x27\x27\x66\x99\x89\x55\x04\xd4\xa6\x16\x4a\x52\x53\xca\x40\x97\x5a\xb9\x39\x1f\xca\x7a\xb6\x37\xa4\x92\x17\xb6\xab\x1d\x9e\xfd\x25\xfa\x0d\x54\x25\x1c\x56\xce\x44\x55\x57\x01\x50\xe7\x55\x0e\x7b\xeb\x10\x86\xf2\x52\x28\xe4\x76\x88\x29\xcc\x7b\x68\xaf\x3e\x80\x1f\xef\x9b\x30\x4a\x07\x01\xd4\x1e\xec\xc8\xd2\xab\xdd\x12\xed\x50\xdc\x51\xe4\xd6\x9b\x49\x43\x81\x78\xe9\xe4\x56\xeb\x56\x29\x37\x50\xe4\xac\x63\xe9\xe0\x06\x08\xb2\x5f\x1a\xc8\xcd\xef\xc5\x40\xac\xf1\x21\x2c\xf2\xa4\x80\x0c\x59\xa9\x26\x82\x22\x9c\x3e\xc0\xc5\xed\x1b\x2b\x48\x06\xbb\x98\x5a\xfc\xe6\x5b\x60\xac\xd2\x70\xb8\xee\x52\xb1\xc2\xc8\xb2\x75\xd2\x2a\x97\xfc\x1d\xeb\x9a\x2b\xe2\x90\x25\xe9\x7c\xce\x9a\xd9\xe4\xb1\xf5\x6c\xc3\xa2\x53\xde\x17\xa5\x09\xb1\x5c\xd7\x8e\x4e\x62\xe6\xc7\x22\x01\xa6\x45\x4d\xb8\xab\x10\x36\xd6\x21\xc6\xe9\x86\xa0\x7d\xec\xd8\x7f\x66\x54\x8d\x08\xb4\x9f\x9c\x14\x7e\x54\x2c\x60\xde\xff\xa6\xe1\x32\xca\xde\xff\x9d\x60\x49\x2d\xe1\x1f\xe4\x74\x5e\xce\x1e\x4f\x1e\xca\xfb\x39\xa0\x93\xa9\x92\xf2\xe3\x14\xae\xbd\x06\xe0\x72\x60\x67\xed\x76\x4e\xec\xe7\x04\x71\x88\x71\xd7\xdd\x2f\xe1\x38\x82\xb5\x03\x6f\x84\xab\x27\x8d\x46\xbf\xbb\xb5\x27\xb9\xe6\x1c\x3e\xa8\x57\xdc\xb3\x64\x6f\xee\x52\x8a\x89\xd7\x21\xf1\x3f\x3a\x1f\x40\x46\x62\x93\x25\xec\x81\x0f\x5a\x58\x72\x70\x87\x49\xf3\x70\x39\xb7\xa4\xcf\xca\x12\xb4\x97\xa7\x77\x71\x68\xb4\x3f\xa6\x39\xc2\x57\x89\xf7\x8d\x1e\x80\xd7\xb0\xef\xa0\x32\xbb\xf1\xa4\x2b\xad\xd6\x2c\x24\xb5\x96\x65\x01\xfd\x4b\x71\x41\xfd\xa3\x41\x1a\x81\x18\x1d\xbc\x27\xe9\x0a\x72\x80\x9f\xb9\xfd\xfe\x49\x14\x08\xdb\x0e\x81\xfa\x36\x65\x9e\x77\x2c\x37\x6c\x12\x1b\x0d\x34\x07\xc7\x5a\xa4\x8e\x9b\x5f\x13\xf1\xbf\x6b\xd4\x2b\x30\xc9\xae\x51\xb1\xa4\xe4\xb7\x5e\xc9\x6c\x5c\xeb\xc3\x88\xfb\xc3\xba\xcd\xe4\x48\xb6\xe4\x08\xd2\x04\x2f\x2f\x31\xbd\xc2\xe2\xa9\x4a\x26\x67\xc7\xed\x26\xbd\x08\xe9\x3a\x13\xff\xe2\xd7\x5b\x69\x5b\xfe\x47\x2b\xbd\x6c\xd2\x9c\xc2\x7a\xb0\xb9\x51\x3a\x2b\x71\x6c\xdd\xe7\x3b\x2c\xf3\x45\x17\x60\xd0\x62\x44\x22\xe7\xe8\x82\xf2\x2b\x49\x60\x3f\x2f\x8d\xbb\xcf\xbe\x32\x99\x81\x4e\x39\x66\xf6\x3d\x2a\x29\xd8\x28\x94\xd7\xe5\x88\x13\xdb\xa1\x23\x08\x50\xa2\x7d\xc8\x88\xc3\x1e\x88\xdf\x4a\x55\x01\x93\x5e\xcd\xf6\xdb\xd3\x6e\x68\xb4\xad\x4c\xd9\x70\xef\x87\xa0\xd9\xba\x3b\x1b\x51\x24\xde\x6b\x55\xea\xca\x7e\x34\x52\xb1\x0c\xd2\x33\x39\x23\xdc\x6b\xb6\x46\x4e\x3e\x61\x70\x49\x66\x6c\x31\x93\xad\xb3\x05\xad\xb2\xc4\x32\xfe\x92\x58\x3d\xf9\x76\xa8\x53\x11\x44\xfa\x60\x15\x45\xe7\x57\x93\x30\xf0\x9d\x28\x3a\xff\x03\xd8\xae\x5b\xf9\x29\x41\xcd\xb1\x67\xc5\xd2\xac\xae\x1f\x58\x26\xfe\x10\x7f\xf1\x61\x9a\xcb\xd0\xc0\xe8\x03\x09\xd0\x7d\x3f\xd2\xb1\x79\x90\x8f\xbb\x7e\xb0\xc9\x0a\xf4\x02\x70\xae\x67\xc9\x00\xac\x02\x08\x32\xa2\x6b\x39\xf6\x3f\x4c\xde\x6b\x52\x91\x48\x9e\x0a\x6a\x60\xc6\x9e\x44\x97\xc2\x49\x28\x45\xbe\x9a\xcb\x40\x60\xd1\xc7\xcb\x28\xf0\x78\x89\x18\x88\x21\x9d\x85\x21\xd6\xa2\x04\x2a\x1d\xc4\x05\x88\x1d\x18\x8f\xcc\x2c\x8a\x5a\x0a\x22\xef\xb8\x1c\x9b\x4b\x2d\x17\x00\x54\xc2\xc1\xb4\xfb\xe5\x79\xe1\x43\x49\xcd\xbc\x31\xd3\xdf\x44\x45\xf7\x48\x6b\x5b\xde\x6e\xd0\x53\x8a\x1c\x23\x2f\x42\x8e\xcd\xa5\x76\x06\x9f\xa4\xaa\x63\x7c\x4a\xb7\xa3\x0f\x6d\x7a\x68\xb5\x4c\x7b\xb5\x16\xd0\xba\xe7\x7c\x49\x3e\xc8\xe8\xa0\x65\x5b\x92\x5c\xaf\xe2\x99\xb0\x99\xec\x11\xef\x77\x49\x54\xec\xc4\xfa\x04\xe5\x2d\xfc\x82\x7d\xdc\x05\x49\x02\x29\x8f\x6f\xc9\x3f\x60\x4e\x09\x01\x09\xf1\x48\x99\x41\x35\x2d\xac\x64\x0b\x1d\x6f\xcb\xe6\x4f\x38\x2a\x23\xc1\xda\xc7\x50\x80\x05\x97\xc2\x44\xb9\x23\x37\x60\x9e\x0c\x3c\x10\x63\xf7\x14\x57\xe6\x9a\x7e\xc8\x52\xac\xb8\x94\xcc\x6b\x31\xd6\x53\x96\x46\x74\x2c\xad\xc8\x30\x1b\xd6\x97\x1c\xe9\x98\x20\x6b\xd9\x6d\x10\xd9\xd0\x8d\xdb\xe2\xfa\x45\xa8\x1e\x12\x0b\xcb\xef\xd4\xac\x02\x58\x5c\x77\x8d\x1f\x24\xe0\x5e\xa7\xa6\x21\x23\x18\x38\x9a\x0e\x92\x1b\xfe\x2d\xc7\x1b\x2c\x93\x14\xf7\xe2\x25\x7b\x39\xe8\x80\x4e\x0b\xe0\xe4\x12\xdc\xd2\xf1\xb5\x46\x92\x05\x2e\x52\x19\xb4\x0e\x46\xbf\x10\x7a\x16\xae\xc1\xac\xdc\xd6\xb5\x2a\xe1\xd9\x82\x95\xc2\x58\x82\x4d\x18\xcb\x63\x22\x01\x69\x18\x1a\xb2\xca\x33\x4c\x32\x2e\x3e\x5c\x68\xa6\x61\x5d\x3c\x43\x33\x70\x32\xe6\x10\x95\xc1\x6f\xee\x90\x92\xe8\x75\xbc\xa1\xd6\xc4\x8a\x32\xd1\xc9\x07\x64\xf8\x93\xa2\xc6\x34\x8a\x9e\x19\x05\x7b\x42\x2f\x36\xd7\xf9\x7c\x59\xf4\x8e\x0e\xb7\xb3\x7e\x7c\x37\x2c\xd6\x31\x4a\x48\xfd\x41\xc5\xc9\x20\x88\xed\xa4\x62\x84\x1e\x13\xe7\xae\x17\x6f\xc5\x3f\x09\x47\x5b\xe8\xef\x75\xef\x60\x96\x8e\x53\x11\xba\x3e\x2d\x9a\xd4\x3c\xf8\x51\x41\xa6\x57\x24\x65\x49\xa8\x4c\xde\x95\xd0\x4b\xa6\x39\x69\x1d\xd9\x7c\x51\x22\xae\xa1\x45\x84\x6b\xa4\x66\xa1\xa2\x5c\xd3\x78\x14\x8d\xb3\x53\xe1\x48\x42\x94\xcf\xde\xec\x25\xb6\xc4\x48\xf4\x9a\x20\x71\x8d\xb1\x5f\x00\xb5\x6c\x6a\xa6\xdf\x77\xdb\x38\xb1\x6e\xe3\x07\x24\x1c\x2b\xa7\x86\xfc\xb9\xe1\x8d\x54\x40\x90\x35\xfd\xe0\x4c\x15\x6f\xc4\x30\x87\xf8\x1f\x0a\x12\x38\x52\x91\x4f\x5e\x67\x85\x82\x17\x37\xea\x09\x84\x8e\x50\xd0\x10\x84\x1b\xa7\x7b\x62\x03\xe5\x4e\x07\x65\x1b\x39\x42\x9d\xe2\xb9\x86\x67\x60\x42\x13\x4d\xd3\x8b\x10\x5e\x2d\xe9\xaf\x62\x0d\x58\x1e\x8d\xcc\x3e\x9a\xff\xc1\x16\x96\x9b\xf0\x77\xef\x46\xee\xed\x39\x8e\x88\xd9\x19\xdc\x15\x99\x83\xa4\xbc\xb7\xc2\x2e\x50\xab\x9a\x50\x0c\x3a\xf5\x77\x53\xc0\xf0\x8c\x2a\xb7\x5d\x5d\x7c\x94\x46\x58\x00\x68\x7f\x86\xf0\xe4\xac\xb5\xe9\xad\x60\xf6\x6d\x26\x59\xcf\x3c\x0b\x0e\x48\xc0\x70\xc7\x40\xab\x20\xda\x82\x94\xfd\xd2\x5c\x9e\x75\x7a\x52\x33\x4b\x7a\xd3\x62\x29\x34\xea\x18\xf0\x94\x0c\x03\x6f\xfc\x3b\x51\xe1\xcc\x13\x6b\xa2\xf0\x47\x12\xe0\xc4\x8f\x18\xb4\x14\xf1\x08\x2c\x8c\x24\xf0\x94\xa4\x4a\xb7\x0d\x8d\xe2\x7f\x78\x0f\x36\x7f\x03\x3e\x8b\x80\x48\xa3\x82\x7a\x12\xfe\x8d\x25\x52\x48\x6c\x5b\x8c\x36\x70\x3c\x32\x67\xa8\x81\x6b\x6a\x05\x10\x71\x27\x8a\x1f\xd6\x92\xa8\x4b\x2e\x95\x7c\xa3\xb9\xea\x64\xab\x79\x44\xed\x34\xca\x54\x2d\xe2\xa8\x28\x74\x2f\x93\xe7\xff\xa6\x1d\x13\xb5\x44\x12\x47\xa4\x5e\xa8\x7c\x80\xe7\x34\x1a\x4d\xa1\x75\x63\x8f\xc9\x2c\x6e\x61\xe5\xc3\x16\xfa\x3d\x9c\xa9\xc0\xa1\xbc\xa1\x92\xd4\x96\x7f\xff\xaf\xff\xfa\x3f\xff\xf5\x7f\x03\x00\x00\xff\xff\x1c\xf7\x13\x7e\x95\xd2\x00\x00") - -func dataFemalenamesJsonBytes() ([]byte, error) { - return bindataRead( - _dataFemalenamesJson, - "data/FemaleNames.json", - ) -} - -func dataFemalenamesJson() (*asset, error) { - bytes, err := dataFemalenamesJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/FemaleNames.json", size: 53909, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataKeypadJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x9c\x94\xcd\x6a\x85\x30\x14\x84\xf7\x3e\x45\xc8\x52\xeb\xff\x5f\xec\x0b\xf4\x21\x4a\x17\xdd\x75\x21\xa5\x14\xba\x2a\xbe\xfb\xcd\xd5\x8b\x99\x91\xe3\x3d\xea\x46\x26\x42\xe6\x3b\x33\x1c\xf2\x1f\x19\x63\xdf\x7e\x3f\x7f\xbe\xec\xab\xb9\x1f\xfc\xb1\xf0\xf2\x7d\x96\xc6\x7c\xff\x8d\xe3\xcb\x43\xdb\xd2\xae\xb2\x0a\xb2\x0e\x32\x5b\x25\xde\xdb\xea\x59\x7e\x2c\x7f\xbc\xa7\x0c\x23\x70\x13\x10\xad\x38\x43\xb1\x0b\x26\x58\x05\x30\x4c\x23\xfb\x77\x4a\xc6\x0d\x95\x48\x35\x92\x2a\xc5\xfe\x59\x59\x32\x97\x58\xcd\x91\x0a\xfb\x70\xdd\x69\x6d\x96\xfb\xb9\x5a\xcc\x05\xb5\xc9\xf6\x83\x56\x26\x41\x09\xd4\x21\xa8\xd5\xdc\x13\xb5\x4b\xa6\x12\xaa\x3f\xd0\x1f\x59\xe5\x5a\x97\xcd\x7e\x81\x0e\x73\xf5\xe2\xd8\xe8\x1f\x6b\x65\x12\x95\x48\x03\x92\x60\x4e\xd9\x3d\xd5\xca\x64\x28\x91\x62\x24\xe5\xe7\xd6\x5a\xe4\x62\x56\xc7\xac\x04\x59\x83\x12\xe5\xc8\x04\x9b\x8c\x04\x4b\x11\x16\x5f\xb6\x25\x04\xa5\x24\x5a\x86\xb4\x42\x79\x6b\xaf\xcc\x40\xb4\xfc\xe4\xd6\x53\x08\x79\x2d\x1d\xbe\x07\x0b\xcc\x7f\xa7\x68\x8a\x6e\x01\x00\x00\xff\xff\x2d\x9a\xa0\x40\x67\x06\x00\x00") - -func dataKeypadJsonBytes() ([]byte, error) { - return bindataRead( - _dataKeypadJson, - "data/Keypad.json", - ) -} - -func dataKeypadJson() (*asset, error) { - bytes, err := dataKeypadJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/Keypad.json", size: 1639, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataL33tJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xaa\xe6\x52\x50\x50\x4a\x2f\x4a\x2c\xc8\x50\xb2\x52\x00\x71\x80\xdc\x44\x20\x33\x1a\xcc\x04\x72\x4c\x94\x74\x60\x4c\x07\x25\x30\x2b\x16\x22\xa0\x94\x84\xac\xcc\x02\x55\x2e\x19\x59\x4e\x03\x61\x44\x35\x82\x19\x8d\x60\xda\xa0\x6a\x4e\x45\xd6\x6c\x8c\x2a\x97\x8e\x2c\x67\x86\x30\xc2\x12\x55\x59\x26\xb2\x32\x43\x84\x32\x45\x04\xb3\x06\x55\x47\x0e\x0e\x1d\x35\x08\xa6\x39\xaa\x8e\x7c\x64\x1d\x06\xa8\x72\xc5\xc8\x72\x2a\x08\x23\x4c\x51\x95\x95\x20\x2b\xd3\xc6\x69\x53\x05\xb2\x32\x55\x54\xb9\x2a\x64\x39\x23\xa8\x1c\x90\xac\xe5\xaa\xe5\x02\x04\x00\x00\xff\xff\xd5\xd6\x71\x46\xdd\x01\x00\x00") - -func dataL33tJsonBytes() ([]byte, error) { - return bindataRead( - _dataL33tJson, - "data/L33t.json", - ) -} - -func dataL33tJson() (*asset, error) { - bytes, err := dataL33tJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/L33t.json", size: 477, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataMackeypadJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x9c\xd4\xcb\x4a\xc6\x30\x10\x05\xe0\x7d\x9f\x22\x64\xd9\xda\xfb\x35\x42\xd7\x3e\x84\xb8\x70\xe7\xa2\x88\x08\xae\xa4\xef\x6e\x6c\xa5\x39\xa7\x4c\x99\xd4\xcd\xcf\xf4\x87\xcc\x97\x39\x24\xf9\x4e\x8c\xb1\x4f\x9f\xaf\x1f\x6f\xf6\xd1\xfc\x7e\xf8\xcf\xca\x97\xcf\x5b\x69\xcc\xfb\xd7\xb2\x3c\xfc\xd5\xb6\xb6\x47\xd9\x84\xb2\x0d\x65\x71\x94\xb8\xee\x5c\x6f\xe5\xcb\xfe\x8f\xef\x29\x63\x04\x77\x81\xe8\xc5\x3d\x54\x97\x30\x61\x0d\x60\x38\x8d\xdc\x7f\x50\x66\x3c\xa9\x24\xb5\x28\x35\x5a\xfb\x4c\xcd\x8d\x59\xa2\xba\x98\x04\xc7\xb0\x7c\xd2\xc2\xac\xaf\xc7\xea\x71\x2c\x48\x4d\x6e\xef\xb4\x2c\x09\x25\x68\x40\xa8\xd7\xba\xe7\x5a\x94\x8c\x92\x34\x46\xc4\x47\xad\x66\x2d\xca\xee\x3a\xbf\x09\xc7\x1a\xe5\xad\x42\xff\x52\xcb\x92\x54\x92\x1c\x4a\xb0\x4f\xb9\x7b\xaa\x64\xc9\x26\x41\x29\x42\x65\xd4\x03\xa0\x46\x9c\xe3\xdc\xa4\x65\xa8\x0d\xca\x61\xb8\xed\xb6\x8c\xe5\x88\x39\x25\xb8\x28\x80\x12\x25\xab\x40\xab\x52\x1e\xda\xff\x84\x4b\x5a\x89\xda\x7c\x6f\x06\xf9\xac\x38\xbc\x15\x64\xcd\x37\x2f\x18\x61\xf2\x0d\x98\xf0\xe5\xd9\x31\xff\xbb\x26\x6b\xf2\x13\x00\x00\xff\xff\xa3\x67\xe0\x02\xd0\x06\x00\x00") - -func dataMackeypadJsonBytes() ([]byte, error) { - return bindataRead( - _dataMackeypadJson, - "data/MacKeypad.json", - ) -} - -func dataMackeypadJson() (*asset, error) { - bytes, err := dataMackeypadJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/MacKeypad.json", size: 1744, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataMalenamesJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x5c\x5a\x4b\xb6\xeb\x38\x6c\x9c\xf7\x2a\xfa\xbc\x71\x56\x90\x35\x64\x07\x39\x19\x50\x22\x2d\xd1\xa6\x48\x3f\x52\xb2\x5b\x37\x27\x7b\x0f\x28\xb1\x0a\x78\x3d\xd3\xf5\x95\xf8\x01\x0a\x85\x02\xc8\xff\xfd\xf5\x5f\xb1\xed\xbf\xfe\xf3\xbf\xff\xfa\xfb\xef\x5f\x4f\xb7\x85\xf6\xeb\x3f\xae\xc7\xb2\xe6\xfb\xa9\x96\x29\xd4\xfd\x7e\xde\xe2\xbc\xba\x90\xee\x3f\xbe\x31\xa5\xe8\xb6\xfb\x0f\xef\x3e\xd1\x8f\x0f\xfa\x4b\x75\xfc\xd1\x1f\x93\x0e\xda\xc2\x7b\xbd\x9f\xf7\xb5\x6c\xae\xe1\xa5\x2a\x8b\x28\xef\x35\x54\x8c\x96\x23\xa6\x79\xbb\x63\x3c\x6d\xae\xbe\xc6\xff\x4b\x76\x69\xcc\xb0\x84\x52\x97\x70\x3f\xbf\x42\xce\x61\x1f\x33\xb4\x3d\x7c\xc2\xd8\x44\xf0\x5f\x2e\x69\xaa\xd1\x71\x6f\x3a\x8e\xcb\xb2\xa4\x7c\x62\xa0\x4f\x1c\xef\x3c\x5d\x2b\x19\x0b\xd8\xf7\x35\x7c\xc7\xbc\xae\x8e\x97\xf7\xb8\x95\x7d\x3d\x75\x8f\xf7\x53\x72\x15\x6f\x3c\xc3\xe3\x51\xc3\xf8\xe3\x51\x5d\x1e\xfb\x68\x73\xd9\x87\x69\x83\x98\x8d\xeb\x16\x4b\x64\xac\xca\x57\xcc\x58\xdd\xb9\x95\x8c\x6d\xd7\xb0\x94\xaa\x93\xae\x87\xc3\x5c\x9c\xd6\x8b\x39\xe2\xb0\xf1\xd7\xa5\x1d\xe6\x7d\xbb\x5d\x66\x1b\x6b\x78\x07\xfe\x2e\xbe\x2a\x30\x87\x2f\xc7\x92\xe0\x20\x59\x0e\xc6\x9c\xc5\x9f\x63\x69\x75\x5f\x8f\xf1\x65\x3d\xd5\xa4\x0b\x86\x7b\x96\x61\x89\xe7\xe1\x68\x4c\x4c\xeb\x92\xc2\xea\x29\x6e\xd8\x57\xbe\x73\xb4\x1d\xc6\xdf\x75\x33\x32\x2c\x7d\xf5\x0a\x91\x5e\x76\xdb\xf1\x07\x22\x03\x8c\x95\x00\xb5\xe4\xbe\x35\xe4\x79\xfc\x23\x0b\x3c\x0b\x77\x56\xcb\x18\x7e\x0a\x59\xe0\x8f\x79\xa7\x7a\xe0\xfd\x49\xdc\xe5\x81\x00\xe7\x01\xf8\x55\xbd\x2b\xae\xf5\x30\xf2\x99\xf1\x99\xac\xe5\x34\x40\x1c\x4b\x29\x07\x1c\x22\x7e\x0a\xdb\x78\xc3\x89\xe1\x61\x3f\x99\x6d\xfc\x1a\x8e\x25\x60\xb8\x6e\xf6\x82\x35\x1f\xad\x85\x34\xf6\x3c\x95\x69\x1a\xef\x7f\xe2\xbc\x97\x0a\x38\xe5\xd0\x86\x79\xdf\x6b\xb7\xcb\x7b\x58\xb4\x78\x8f\x05\x34\x40\x75\xae\x2e\x2e\xf0\x0b\xfc\xd0\x56\xf7\x1d\x8f\xb3\x60\x59\x2d\xd8\x02\x5e\xe9\x23\x63\xe0\x2b\x88\x95\x3c\x10\x49\x81\x78\x79\xc6\x8d\xfb\xcd\x7b\xc9\xb1\x30\xd8\xf1\xf2\xa4\x38\xda\x19\x8b\x89\x26\xdb\xe2\x0b\x4b\xd8\x5d\x4e\x08\xa8\x14\x04\x3f\x88\x6e\x8b\x24\xef\x52\x40\xe4\x66\xa2\xa4\x16\x9f\xf1\xe9\x7c\xd4\x1d\xa3\xe7\x52\x37\xc7\x48\xaf\x24\x00\x79\x98\x43\x1e\xb6\x5c\x92\xc4\x94\x06\x75\x20\x07\x54\x21\xc0\xa6\xff\x20\xfb\x79\x02\xbf\x4c\x63\xec\x90\x38\xb6\x4b\x0a\x9e\xd7\x89\xd5\x76\x86\x98\x31\x9a\xe0\xcf\x73\xab\xe2\xb3\x83\x31\x59\x35\x82\xfa\x28\x41\x63\x5a\x98\x82\x21\x98\xc8\x80\x98\x94\x68\x0e\xde\x33\x5c\xe4\x5b\x6e\x05\x31\xd1\xb1\xe8\x08\x34\x05\xbc\xcc\xab\x06\x17\x53\xc1\x93\x29\xf0\xd3\xb1\x85\xb9\xf0\xa5\xf9\xa0\x17\xe7\x35\xb8\x31\xaa\xf0\x69\xf1\xa5\x02\x87\x29\x3e\x1e\x85\x23\xc7\x85\x4e\x2b\x4d\x22\x00\xa6\x3c\x09\x28\x60\x65\x43\x94\x58\xd3\x86\x7f\x48\x2f\xf0\xbc\xf0\xa1\x89\xcf\xb1\xea\x54\x4e\xcf\x81\x36\x03\x2a\xb0\x68\x0d\xc8\x3b\x62\x03\x46\x9e\x04\x70\xd9\xe0\x31\x1d\x43\x3e\xc4\x02\xb8\x96\x1d\x2b\xfd\x86\x46\x5f\x7a\x86\x51\xe7\x72\x2c\x95\xb9\xcc\x1b\x1a\x7c\x07\x5f\x0b\x57\xa3\x7e\xf6\x18\xe1\xc7\xf5\x44\x0b\x50\x17\xe6\x1a\x01\x89\xc1\xf4\x21\x5f\x8e\xd1\x3f\xe2\xc2\xf2\x47\x86\x2f\x70\xc1\xe9\x83\x62\x1d\xc3\x28\xb3\x08\x2d\x64\x05\x8d\xc0\xa0\x90\x88\x15\x4a\x30\x45\x63\x6e\x99\x2a\x63\xa8\xba\x0d\x53\xef\x82\xf9\xf1\xc2\x12\x4d\x46\x50\xe2\xeb\xc8\x19\x9f\x85\x25\x6a\xba\xae\xc7\x14\x48\xd6\x01\x59\xd4\xe5\x05\x88\xb9\x89\x80\x32\xa2\xba\x87\xd3\x58\x58\x00\xa6\x2d\xa6\x5d\xa9\x17\x4a\x83\x43\xcf\x61\x8e\x09\xfe\xe0\xbe\xaf\xa4\x3c\x86\x4a\x9b\xee\x10\xc1\xbe\x38\xd1\x18\x4a\x37\x34\xb3\x50\x2b\xe9\x80\x61\xef\xbc\xea\x91\x17\xc9\x72\x66\x6e\x17\xee\x3d\xe0\x11\x09\x71\x83\xc4\x13\x3b\x0d\x58\xe3\x2d\xa4\xa2\x66\xdb\x4f\xc4\xea\x1e\x3d\x66\xb3\xa7\x97\x63\xe6\xbe\xf7\xc0\x50\x56\x79\xb3\x9f\xb2\xf0\x60\x60\x3f\x5e\x4e\x26\x86\x64\x3f\xc0\xd3\x5c\x90\xb5\x9e\x47\x02\x1f\xbc\x0e\xf8\x53\x58\xc4\x69\x2e\x39\x39\xf5\x7a\x2c\x2b\xe6\x1e\xd1\xea\x4d\x12\x15\xce\x5a\x56\x0c\xd1\x91\x8c\xf5\x3f\x42\x8a\xff\x90\x05\x36\x2c\x48\xf2\xac\x62\x41\xad\x4a\xa0\x80\x82\x9f\x2e\x6e\x4c\xac\x0d\xc1\x72\x93\x31\xa3\xd7\x04\x85\xa8\xdb\xf1\x7a\xfc\xd0\xb8\x3d\xc9\x61\xe2\x16\x35\xa7\x4c\x27\x5d\xde\x6d\x81\xf7\x63\x73\x6e\x56\x9a\xa3\x09\xba\x68\x21\x99\x8a\xa5\xe1\xd5\x4f\xac\x0b\xfc\xaa\x9a\xa0\x09\xab\x38\x8f\x58\x7c\x45\x28\xe2\x16\xe4\x6d\x44\x22\x25\xf0\x8b\x31\xd7\x85\x94\x7a\xab\x32\xbc\x82\xc0\x9a\x21\xdc\x5f\xd2\x34\x2f\x9a\x2f\xfe\x3e\x98\x92\x4c\xb2\x68\xbb\x7c\x64\x32\x8f\x46\xbc\xfc\x7c\x54\x5a\x30\x3c\x7b\xa4\x14\xd8\x0b\x06\xca\x4a\x10\xc7\x4e\xcd\xff\x0d\xd9\x5b\x6e\x0d\x5b\x74\x2b\xdc\xea\x8c\x41\x91\x47\xbc\x41\x62\x61\x16\xdf\x6b\xf8\xc0\x3c\xe9\x80\x5e\x90\x62\x83\x3c\x23\x3a\xb2\x1a\x91\x4b\x4b\x41\x6f\xac\x87\xf2\xd0\xc5\x27\x85\xc4\x77\x20\x08\x4e\x15\x16\xa4\x9e\xf4\x28\xb9\x8d\x77\x4b\x4d\x0a\xd6\x8a\x44\xd4\x45\x1c\xfd\x7e\x2b\xb4\xf1\xca\xdb\x4d\x98\x26\x09\x7b\xe7\x1f\x8c\xb3\x81\xa8\x04\x26\x13\xd4\xf6\x94\x9c\x6e\xac\x3a\x7a\xb5\x58\x0d\xf0\x52\xe9\x2c\x74\xe4\x56\x4b\xcf\xf0\x44\xac\xce\x30\x1a\xaa\xb1\xd0\x98\x6a\x05\xe3\x46\x4f\x6d\x2e\xcd\x25\x61\x9c\xc3\x17\x4a\x6c\xaf\x94\xfe\x32\xf2\x46\xde\x19\x33\xbd\x6b\xdf\x2c\x53\xb3\x3e\xd6\x79\x8d\x86\xea\xc7\xbe\xbf\x63\x92\x5e\x9c\x80\x9c\xb3\x99\x6f\x71\xa6\x2e\x28\xa6\xb8\xba\x4b\x09\x8c\xde\x69\xe2\x8d\x84\x1f\x14\x2e\x37\x06\x0a\x42\x00\x60\x10\xf9\x8f\x22\xec\xf2\xc2\xf8\x3d\x98\xc4\x24\xfb\xc7\xe6\x96\x43\x22\x57\xf2\x2b\x86\x71\x46\x72\x4f\x0a\xa7\x5c\x8c\xf0\x2c\x02\x92\xb1\x59\x65\x89\xe0\xb7\x03\x89\xe1\x8a\xef\x5d\x05\xd1\x15\x5c\x58\xd2\x97\xf1\xd1\x15\xc3\x02\x58\x9a\x1c\xef\xb5\x6e\x6d\x67\xfa\x98\xfc\x5b\x8b\x14\xa6\x9f\x90\x40\x8e\xad\x32\x1d\x3e\xfb\x00\x11\x8c\x20\xfa\xab\x72\x1f\x5f\x9b\x94\x53\xd0\x04\xd6\x22\x1d\x1e\xbb\x54\x1e\x8b\x91\x25\xd2\xf5\x0f\x04\xea\xb7\x14\x61\x81\x91\x57\x5e\xff\x2a\xf5\x93\xac\xd8\xb8\xbf\xc1\xb6\xa2\xf0\x3f\x88\x88\x28\x99\x48\x7b\x00\x3b\x1c\x1f\xd3\x1f\xba\x25\x82\xeb\xc4\x89\x5a\xe0\x49\xf6\x34\x9c\x16\xdb\xc6\x6d\x17\x59\x77\x42\x1c\x6b\x95\x1d\x54\xf9\xfb\xf0\xd5\xdc\x40\x83\xa8\x62\xef\x65\x37\x38\x63\x19\xeb\x88\x4b\x76\x33\x98\x58\xf4\x68\x18\x29\x67\xd7\x76\x87\x78\x2c\xa9\x06\xd7\x88\xbd\x1a\x03\xd1\xe6\x5c\x02\x47\x58\x28\x2a\x49\xeb\x7e\x9c\xa4\x63\x70\x85\xbc\x82\x19\xd4\x67\x16\xbb\xa2\xbb\x22\xd8\x78\x2e\x99\x72\x25\x17\x10\xed\x22\xbf\x21\x60\xd7\xa8\x52\x44\xcc\x4f\xda\x4d\x8e\x9c\x74\x2b\x1a\x3a\x00\xba\xfc\x1d\xea\x4c\x8d\xfb\xcf\x6e\xf5\x91\x11\xf7\xa1\x26\xdd\x2a\x45\xfb\x06\x04\x5c\xb9\x08\x70\x97\x5f\xc1\x4e\x51\xdd\xd3\xa8\xd7\x44\x88\x6b\xcd\xd7\x57\x9b\x94\x34\x58\x69\x14\xd5\x09\xbb\x96\xa2\xdd\xce\x5a\xf5\x4b\x0e\xd2\x02\x94\x75\x35\x7e\x72\x13\x3c\x32\xb8\x62\x38\x4e\x52\x15\xdd\x23\x96\x7a\xc2\x9c\x33\x25\xf9\xf5\x3e\x20\xe2\x8e\x89\x7c\x15\xb6\x8d\x82\x65\xeb\x35\x3e\x60\x61\x2b\xd6\xa7\x69\x7d\x08\x59\xb0\x07\xd4\xe7\x25\x52\x55\x35\x95\x7d\x27\x56\x3c\xfc\x29\x33\x76\xf1\x5c\xb8\x53\xf4\x5e\x42\xd3\xcc\x89\x08\x5a\x8f\xcd\x84\x96\xac\xd1\x2c\xe6\x6a\x4f\x39\xaa\xc1\x03\x36\xfd\xc4\x5e\x25\x53\x19\xca\x2a\x77\x72\xb5\xf2\x86\x14\x7f\xcc\xea\x82\xf7\xc8\x02\xc3\x41\xb3\x08\x4b\xb2\x83\xe4\x83\x58\xa7\x12\x7a\x41\x53\x91\x89\xa0\x5a\x58\xba\xbe\x63\x47\x0d\x1d\x81\xbd\x9e\x0c\x17\x11\xbd\x24\x3a\x29\x7b\xa6\xa8\x8d\x43\xad\x74\xa5\x88\x65\xab\x43\x60\x98\xc8\x6e\x4b\x2d\x1f\x2c\x2d\x68\x0e\x9b\x53\x27\x56\x6e\xd1\x9f\xaa\x75\xd7\x43\x4b\xb5\x4d\xdb\x8e\x41\x8b\x97\xde\xc9\x00\x13\x5e\x6d\x0c\x88\x86\xab\xc9\x03\x8e\x60\xed\x2e\xdf\x45\xf8\x45\x8c\x81\x92\xba\xd0\xf2\xa2\x0d\xb8\x43\x91\x18\xd8\xe0\x4c\x29\x2e\x92\x2e\xb3\xb0\x74\x8b\xa9\x32\x9f\x12\xd9\xc4\xd3\x47\x5b\x5e\x9a\xb4\xf6\xb3\x19\xd9\x6a\xd4\xf2\x44\x3d\x28\x95\x8d\x78\x90\x81\x03\x43\xfa\xc0\x4e\x64\xb7\x44\xa0\x88\x76\xbf\x0f\x82\xe0\x02\x0a\xde\x6f\x06\xe7\x49\xc2\x6b\x67\xbc\xd2\x18\x77\x0f\x94\xd5\x86\xa4\xb1\x08\xaa\x2b\x6d\x46\xf7\xb1\x27\xc1\x89\x21\xac\x65\x4f\x2b\xa9\x30\x89\xe5\x52\x2d\x69\x92\x63\x72\x51\x67\x3a\x46\x2d\x77\xd8\x17\xaf\xc5\x0c\xac\x37\x29\xb0\x2b\x4a\x8e\x90\x7a\x1a\x54\xb4\xd9\x22\x5e\x11\xbe\x95\x48\xa6\xeb\x74\x80\x61\x1e\xd1\x07\x76\x4c\x9c\xf7\x01\x1f\x5c\x1d\x13\xbe\x3f\xe3\x25\x07\xf0\x57\xf7\xd6\x8e\xbd\x44\x82\xea\xae\x8d\x80\xed\x92\x83\x2a\xbd\x77\xaa\x49\x8d\x00\x92\x68\xf7\xa6\x8d\xfb\x43\xf5\x46\x0e\xd4\x2d\xca\xae\x02\x5d\xe4\xe8\xab\xd7\x93\x14\xa4\xb4\x1f\x7b\xa7\x6e\x32\x61\xb1\x2c\x0c\x48\x36\x13\xa5\x6e\x62\x21\xb0\x60\xdb\x52\x8f\x61\x04\xed\xbc\x48\x7d\x42\x8a\x35\x5a\x71\xb3\x05\x96\x90\x05\x34\xe6\x22\xa9\xd3\x25\x6d\xab\x68\xf7\x4c\xe4\x4a\xc4\x48\x8b\xca\xe8\xfe\xa3\xa1\xc5\xde\x60\x56\xc5\xcf\xad\xc9\x30\xd8\x44\x2e\xa6\xdb\xa2\xd0\xd2\x24\x6d\xe2\xfd\xee\xce\x00\xcb\xab\x28\x73\x9c\xac\x94\x5c\x98\x81\x26\xd7\x40\xf9\x3d\xfd\xa8\xcc\xe9\x27\x09\xe0\x61\x06\x5d\x47\x27\x32\xb1\x66\x82\x26\xd1\x60\x9a\x04\x8f\xbb\x73\x38\x26\x3e\xd2\xd9\x88\x40\x11\x69\xd1\x56\xc1\x52\x70\x31\xb5\x7a\x55\xb8\x8b\x63\xb8\x08\x5f\xd3\x5a\x52\x72\x01\x54\x4e\x79\xc3\x47\x3e\x39\x92\x96\x30\xe8\xc6\xe4\x33\xa3\x87\x58\x4c\x3d\xd8\xfb\xb1\x6c\x88\x1e\x19\x62\xab\x35\xd4\xd4\xfe\xd0\x2e\x69\x73\x59\x85\x86\x68\xc1\x49\xcf\x2e\x36\x96\x73\x57\xf5\x85\x83\x8f\x22\x0c\x03\x4b\xee\xe1\xe1\xb4\x53\x8a\x4d\x92\xe0\x24\x26\x35\x92\xa7\xe0\x8e\xc1\x87\x26\x23\x2d\x8e\x9d\xb3\xd8\x22\x2b\xe0\xbd\x1e\x46\xa8\xa7\xed\x5f\x55\x16\x79\x29\xd2\xab\x68\xeb\x8e\xb1\x94\xf9\xb6\xde\x05\x4c\xec\xfa\xf4\x33\xb6\xd3\xb2\x40\xcc\x54\xa0\x35\x71\xfa\xa0\x5c\xf5\x32\x8d\xef\xae\x90\xa9\x5f\x64\x0a\x15\xb8\x1f\xe6\x9a\xb9\x5b\x88\x6b\xcf\x1f\x95\xef\xaa\xcd\xc3\xc6\xb0\x7e\xbb\xf6\xfb\xd0\xee\x7b\x91\xea\x73\x73\xa6\x61\xec\xb2\x36\xff\x23\x68\x33\x99\x83\x16\xcf\xce\xc6\x75\xfe\x12\xf4\xfc\x05\xcc\x73\x49\x14\xb2\xa0\x8b\x50\x99\x87\xba\x7e\x31\x95\xd1\x64\x92\xa1\xe4\x2e\xb6\x03\x3a\x62\x09\xce\xde\x46\x25\x80\x9f\x6e\x96\x5c\x09\xe9\x21\x59\x0d\x58\x2c\xed\x60\xf7\xe4\xab\x11\xdc\x33\x22\xa7\xee\x7d\x0d\xed\x2b\x9e\xbd\xc0\xe3\x8e\x59\x59\xee\xbd\x16\xd2\x83\x33\x1e\xe4\x88\xa5\xc5\xde\x9a\x95\x59\xb5\x66\xf2\x74\x99\xa5\x3e\x62\x99\x51\x8c\xe6\x5d\x0f\xc8\x95\x9e\x89\x6d\xda\xd3\x9e\x70\x53\x56\xee\xe4\x3f\x86\x8f\x9d\x67\x72\x04\x86\x2b\x14\xd9\x7c\x56\xa6\x9b\xb3\x46\xed\x6b\x66\x73\xc0\xc5\x9e\xa0\xf6\x01\x64\xac\x5d\x95\xf0\x46\x59\xe2\x8e\x5b\x75\x68\x53\x73\x5e\x89\x64\xff\x25\x0f\xdf\x2d\x0f\xd6\x93\xd0\xa9\xdb\x69\x0e\x94\xb3\xe3\xa9\xc2\x6e\x52\x8d\x29\xe2\x7e\x34\x8b\x89\x25\x09\xb5\x1f\x57\xff\xe4\x71\xd3\x67\xd0\xba\xc3\x3d\x8b\x09\xd2\xc8\x81\xaa\x69\x39\x6b\xab\xd7\x4d\xfe\x60\xb7\x98\x39\x30\x1d\xb3\xe2\xbd\x85\x73\x2b\xe8\xe3\x5c\xc7\xbf\xec\x5d\xf6\xd3\x3e\x78\xf4\x8e\x18\x86\x61\xe7\x13\xd5\x6c\x35\x1f\x54\x64\x7d\xf0\x40\x26\xaf\x3e\x66\xa6\xf5\x9d\x87\x4f\xe1\x87\x7d\x9e\xa4\xfa\x72\x52\x8d\x72\x22\x04\x2f\x2b\x8e\x8f\x1c\x0b\x34\xa9\x7b\x18\xba\xbf\x79\x1a\x97\xf4\xdc\xee\x25\x98\x0e\x1b\xad\x0c\x62\x9b\x8a\xc9\xe2\xda\xcd\x93\x84\xac\xdd\x73\x38\x81\x50\x15\x46\x79\x17\x2e\x73\x74\x74\xa9\x43\x5a\x78\xe0\xd3\xc2\xda\xca\x1e\xe8\x1b\x61\x55\x43\x34\x25\x4f\xb7\x14\x45\x8e\x6a\xd4\xaf\xe9\x4b\xf5\xc8\x20\x86\x24\x25\x1d\x0a\x17\xcd\xe0\x13\x95\xf4\xf3\x20\x10\xd9\xa9\x15\x22\x6d\x3c\x00\x5a\xc9\x79\x39\xf2\x5c\x42\xca\x1e\x3d\xdc\xdf\xbf\x14\xa6\x89\x24\x27\xf6\x93\xe8\x23\xf5\xd6\xf0\x38\xd8\xdb\xf5\x64\xf6\xd2\x3e\x66\x73\x58\x48\x3f\x54\xe2\xe1\xc4\x7d\xa2\x09\xd1\x19\xd9\x16\x8e\x9f\xa2\xe7\x96\xec\xca\xde\x0a\x18\xd9\xd1\x89\x13\x78\x04\xd6\x8f\xba\x50\x80\x3e\x64\x65\x3f\xb0\x76\x0b\xe4\xb5\xcd\xd2\x9f\x64\xe0\x05\x0b\x62\x99\x34\x6e\x79\x80\x79\xaf\x86\x29\x9a\x17\xe9\xdc\xb4\xb1\xae\x58\xe9\xe4\xaf\xad\x28\x3d\xa9\xa1\x5e\xe9\x68\xd3\xa2\xe5\x1b\x11\x95\x93\x4d\x76\xa2\x7a\xd1\x9f\x52\x45\xed\x2e\x0e\xd2\xe6\xc5\xe1\x09\x8f\xc3\x33\x23\x2c\x7c\xe5\x3a\x34\xd2\xd3\x81\x30\x1b\x2e\x60\x07\x31\x2b\xb3\xe7\xe8\xe1\xfd\x1d\x0f\xef\x52\x1f\x91\x05\x4b\xf1\x0c\xa5\x90\xed\x8d\x99\x43\x14\x1c\xfc\x53\xd8\x2f\xd1\x0e\xd8\x4c\x11\xf3\xa2\x23\x6f\x52\x05\x4f\xbf\xf4\xea\xcb\x2a\x72\x82\x53\x4e\x87\xf6\x19\xc7\x22\xea\x87\xc1\xef\xd8\xbb\xef\x67\xf2\x20\xa6\xfb\x6c\x91\x2e\x29\x49\xe1\x1b\x27\x25\x8e\xc4\xe0\x52\xfe\xc9\xe3\x1b\x71\x92\x22\x95\xac\xb1\x17\x55\xd6\xda\x05\xbe\x3a\xda\x5c\xaf\x9e\x58\x5e\x94\x48\x4b\x9b\x73\x37\xaf\xdb\xdb\xa0\x06\x7b\x62\x58\x4d\xb0\xf3\xd4\xb0\x4c\x68\x71\xe8\x25\x1c\x26\xcc\x7a\xbc\xb5\x59\x56\x92\x96\xf4\x2f\x03\xa6\x5e\xbe\x2a\xa4\x23\x23\x99\xa7\x65\x5f\x0d\xcb\x71\x38\x42\x2c\x7b\x5c\x09\x79\xe1\xd6\x84\xb0\x09\xea\xba\x53\x38\x14\x4b\xee\x37\x0b\xd8\x7a\x5c\xb9\xed\xaf\xbd\x54\x62\x45\xae\x76\xab\xb7\x22\x14\x06\x9f\xbc\x48\x3a\xb9\xcc\xab\x46\x06\x65\xd6\x55\xbf\x9a\xfa\x3f\x12\xf8\x8f\xab\x03\x3e\xeb\x25\x0d\x73\xec\xbc\x97\x29\x6a\xde\x85\x93\x57\x27\x6a\x9c\x61\x73\xb4\xf0\x7e\xb3\xf8\xb7\xe7\xff\x22\xf6\x89\xd3\xbe\x69\x9e\xc3\x9f\xba\xae\x57\x90\x88\x40\xa7\xa1\x9f\x94\x54\x60\x2a\x68\x5d\xa6\x76\x16\xb5\x24\x72\x90\x13\xac\x81\x6d\xf8\xba\xb3\x90\xea\xd7\xc7\x78\x79\xe2\xe0\x09\xb9\xa1\x15\x51\x73\xe6\x8e\x04\x92\xce\xae\x9d\x7a\x3d\x45\xba\xaa\x52\x0c\x16\x85\x2b\x49\xd7\x8f\xde\x86\xd0\xfe\x0f\xc5\x98\xff\xe3\x44\xb1\x6b\x11\x84\xc1\x75\x03\x02\x08\x96\xea\x31\x1b\x31\xff\x4f\x44\x86\x6c\x85\x4d\xcd\x14\xe2\xa2\x77\x9b\xfe\xe8\x07\x4f\xdc\x6e\x75\x4d\x05\x80\x14\xe7\xbb\x36\x50\x14\xbe\x24\xc6\x7e\x8d\x8a\x94\x20\x91\x0b\xe7\xfe\x66\x0e\x0c\xe2\xd1\x29\x6a\x29\x08\x7e\x17\x9b\xf0\xd4\xc4\x1b\xc9\x79\x1f\x1d\x8c\xb5\x88\x37\xd9\xb5\x2a\x27\x43\xf0\xd4\x4a\x2a\xfc\x84\x17\x85\x94\x10\x4e\xb3\x30\x54\xa2\x0e\x89\x57\x4c\x46\xd1\x88\x9d\x57\xe6\xcf\x1c\x4c\x63\x3f\x78\xc5\xb4\x0f\xf6\x4e\x93\x53\x49\x2f\x3f\xb3\x7b\x3a\xee\x0d\x38\xaa\xfd\xea\x4d\xc5\x4a\x9a\xbb\x32\xc6\xfd\x48\x02\xed\x47\x31\xba\xa3\xfb\xba\x1e\x9f\x4d\x45\x7a\xe5\x41\x52\xa7\xdb\xa6\xca\x4b\x83\x7b\x64\x6c\xac\x9a\x12\x1f\xa6\xdb\x28\x86\x92\xa8\xd5\xd6\xa0\x6b\x1b\x4f\x0e\x49\xad\x5a\x7f\xbe\x48\x06\x6c\x64\x69\x75\x28\xc9\x0b\xab\xed\xd7\x89\xc0\x65\x22\x20\x78\x3f\x6e\xa5\xd0\x7d\xf2\x1a\xc2\xb8\x1b\x88\x70\x93\x8d\x31\x88\x4b\x33\xf4\x27\xbf\xb6\x6f\x61\x1d\x71\x9f\x68\xf3\x1c\xa3\xf0\xc4\xfc\x36\x39\xdb\x54\x6c\x75\x4d\x21\x8b\xfb\xe6\x9d\xcc\xc6\x14\x01\xf4\xc5\x56\x79\x95\x68\xb9\x54\xf9\x30\x58\xcf\xee\xc8\xd5\x0d\xe2\xb7\xd2\x2c\x3f\xbc\x87\xb8\x15\xaf\xc7\xb0\xd7\xad\xa5\x60\x6e\x2d\x65\x06\xc5\xd3\xa1\x0a\x73\x67\xd2\x0a\xd3\xa9\x7a\x7c\xc8\xde\x6c\xb7\x24\xd8\xc3\xe3\xeb\xe6\x2c\x30\xb9\xc8\x34\x06\xa2\x5f\xed\xf8\x25\xdc\xef\xe8\x0b\xd4\x0b\xa6\xbc\x3f\x99\xf5\x9a\xd6\xfc\xaf\x83\x34\x49\x41\xb1\xe8\xad\x99\x34\xe3\x52\xd4\xab\x98\xd3\xd1\xf6\x0e\x2b\x39\x53\xef\x20\xf4\x3d\x8d\x67\x36\x7e\x57\xb1\xb7\x63\x7c\xa8\xb0\xa3\x2e\xed\x07\xc0\x43\x8d\x57\x7d\x62\x8f\x34\x18\xf1\x7d\x8b\x96\xc4\x33\x24\xd1\xe2\x94\x2a\xd7\x3e\x1e\xe6\x0e\xaa\xe6\x5d\x29\x75\x8a\xa9\x58\x02\xbb\xe6\x29\x98\x9b\x05\x2f\xbd\xbd\xf8\x0c\xff\xbe\xa0\x05\x9a\x37\xb7\x98\xe7\x3f\x6f\x2c\x24\x6d\x0b\x98\x8c\x2a\x30\x4e\x7a\x01\x71\x19\x79\x5e\x84\x00\x55\xf4\x53\x64\x0a\x8d\xb1\xe8\x1a\xae\x63\x3c\x49\x66\xe0\x1f\x53\xfb\xb7\xc8\x4b\x62\xf1\xc1\x45\x3a\x2c\xf2\xbe\x51\x0d\x3f\x5c\xd7\x0e\x7f\x78\xf9\x80\x97\x90\x2f\x24\x8d\x61\x4e\xd3\x8b\xea\x77\x26\x60\xc3\x88\x00\x24\x29\xf6\xb6\x03\xaf\xf2\xfd\x79\x53\xa0\x1f\x22\xb6\xf2\xeb\xaf\xff\xf9\xbf\xbf\xfe\x3f\x00\x00\xff\xff\x45\xf8\xc0\x95\x0f\x2e\x00\x00") - -func dataMalenamesJsonBytes() ([]byte, error) { - return bindataRead( - _dataMalenamesJson, - "data/MaleNames.json", - ) -} - -func dataMalenamesJson() (*asset, error) { - bytes, err := dataMalenamesJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/MaleNames.json", size: 11791, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataPasswordsJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x4c\xfd\xeb\x72\xf3\x3a\xd0\x2c\x8c\xdd\x0b\x7f\x24\x55\x7b\xbf\x3b\x65\xc9\xe7\xe4\x16\x72\x07\xf9\x91\x02\x49\x88\x84\x44\x12\x7c\x78\xd0\xe9\xbb\xf9\x6f\xa6\xbb\x21\x2f\xfb\x59\x65\x2d\xd9\x92\x48\x60\x30\xc7\x9e\x9e\xff\xab\xfa\xff\xa6\x75\xab\xfe\xdf\xff\xbf\x6a\x0e\xeb\x7a\xcb\x4b\x5b\xfd\x4f\x75\x38\xbe\x7f\x7c\x7e\xbd\x1e\x7c\xff\xe8\xa1\xfd\xf8\x77\x8b\xcb\xf6\x28\xbf\xb2\x9f\xed\x12\xba\x3c\xd9\x83\x79\x5f\x57\xff\x45\x1d\xd6\x58\x87\x61\xb0\x87\xa7\x9c\x37\x3d\x1c\xe2\x36\xc6\xe4\x7f\x37\xe6\xe9\x12\xfd\x0f\xbf\x7e\xfd\xdb\x1e\x84\xba\xb1\x77\xf3\x5f\xed\xeb\x16\xa6\xce\x1e\xad\x7d\x68\xf3\xcd\x9f\x0a\xeb\x16\x17\xff\x3c\x7c\xd9\x83\xe3\xdb\xdb\x9b\xfd\x38\xdb\xa5\x06\x7f\xbf\x75\x9f\xe3\x32\xe2\x61\x1f\x96\x21\x3e\xfe\xae\xdb\x2f\x61\x6f\x2e\x63\xf4\xdf\xed\x13\xdf\xc8\x9f\x79\xe4\xdd\x1e\x6d\x8b\x7d\xde\x94\xfd\x4d\x17\xfb\x58\xfc\xb6\xde\xf5\x79\x5b\xea\xf8\xcc\x9a\x9b\xe6\xf5\x42\xdc\xdf\xc6\x4f\xdb\xa2\x2d\xdc\xff\x60\xdd\xec\xc7\x25\x0d\x03\xfe\xac\xcf\x0d\xef\xaf\xf1\xcb\x49\xfe\xd9\x43\xbe\x46\x5c\xe9\xb4\xf6\x69\xf2\x87\xf6\x9a\x3e\x0f\x51\xab\xe0\xef\x12\xe7\x19\x2f\x0f\xf6\x69\x78\xc3\xb2\xf6\xfe\xdb\xaf\xcf\x8f\xf7\xe3\x01\xcb\xd1\x75\x78\x4b\x5b\xa8\xe5\x16\x16\xff\xc3\x35\x0d\x57\xbc\xb4\xb5\xa5\x0e\xfe\xcc\x23\xd8\x12\x47\xbd\x09\x97\xf6\x0b\x5f\x7e\x79\x71\x18\xb2\xfd\xcc\xb8\x65\xbf\x9f\xb4\x45\xac\xd0\x69\x89\xb1\xcd\xa3\x5f\x79\x1e\xe7\x9d\xcb\xb0\xc6\xbb\xdf\xcb\x66\xcb\xd7\xe2\x89\x2e\x69\xa5\xfa\x30\x8e\xfc\x93\x5d\x0f\x9a\xbc\x5c\xe3\xb6\x45\xad\x15\x6f\xc7\xd6\x13\xdb\xae\xdd\xb3\xbf\x1c\xf8\xff\x47\xff\xf6\x37\xcc\xc3\x89\x2f\xef\xed\x9a\xfd\xc5\xf3\x92\x26\x2d\x82\x3d\x37\xac\x31\xf8\xcd\xa5\x60\x92\xe3\xd2\xf9\xf0\x3b\xb8\xe1\xca\xbb\x36\x43\x5a\x62\xb3\xc4\x0d\xcb\xda\x9e\xba\xde\x9f\x99\xc3\x72\xc1\x26\xe4\x5b\x9d\xf1\x20\x8c\x61\xc9\x58\xc2\x6d\x49\x77\xbf\xc6\x30\x34\x90\xdc\xe4\xfb\x43\x91\xe8\xf6\x64\x0b\x0b\x69\x5e\x66\xec\xcf\xda\x98\x10\xe3\xfa\xe6\x3e\xc7\x09\xaf\x0c\xf8\xa2\x90\x44\xec\xc1\x9c\x97\xd5\xae\xd5\xdf\x3e\x69\xfb\xc7\x60\xbb\x92\x20\x32\xf6\x16\x17\xec\xda\x14\xd6\x86\x6f\x1f\xc3\xb4\xfb\x15\x1f\xde\xfd\x9b\xc7\x02\x2f\xeb\xf3\x32\xf9\xcf\xd5\xae\x77\xda\xfa\x00\x09\x9b\xb6\x84\xed\x34\xd9\x8c\x03\x3f\x71\x9d\x72\x9e\x71\xde\x72\xe6\xf2\xdf\xfa\xb0\x45\x4a\x42\x6a\x22\x65\x74\x1d\x33\xaf\xa6\xb3\xdf\xdd\xc2\x03\x52\x72\xc9\x5b\x78\x2d\x8d\xbf\x57\x0c\xdd\x10\xb9\xdc\x7e\xf5\x13\x96\x9b\xc2\x3e\x04\xfc\x7c\xde\x9b\x6b\xed\xcf\xdb\x56\x2d\x61\x49\x2e\xf0\x53\xea\xfa\x8d\xa7\xae\xb5\xad\x8f\x12\x9c\xf0\x0f\x0f\x4e\xa7\x18\x79\x75\xf6\x8f\x62\xd6\xf4\x38\x60\xc3\xc0\x5d\xbb\xe3\xcb\x2f\x3c\xda\x46\x40\x04\xe7\x21\x3c\x70\x03\x53\xd3\x1c\xbe\xdf\x5c\x60\x6e\xe9\x19\xa0\x94\x7c\x23\x6a\xbf\x81\xf3\x3e\xa5\x8c\xbb\xf4\x13\x3d\x61\xe3\x5d\x14\x74\xc5\x26\xd7\x2d\x44\x36\x4e\x53\x5a\x71\x0f\xf9\x76\xce\x35\x8e\xee\x64\xdf\x5c\x6c\x1d\xf3\x75\x4e\x94\xeb\x21\x5c\xb8\xb0\x4b\xa8\xed\x5a\x7d\x55\xa4\x30\x6c\x75\x9b\xd8\x62\x7d\x4e\x51\xa7\xe0\x61\xbb\xd3\x4b\x2c\x6b\x9c\xa7\x3a\xaf\x1b\xa4\x09\x32\x81\xfd\x5f\x78\xd6\x7d\x51\x4d\x47\xbe\xb4\xcc\x8a\xed\x98\xec\xb4\x9e\x70\x7f\xfa\x18\xbb\x85\x2d\x6d\xb8\xe0\xb0\x50\x16\x96\xe0\x17\x27\xf9\x9a\xf0\x9b\x96\xd2\xec\xf7\x84\x15\x33\x41\x9f\x20\xe8\xbe\x02\xa1\x6d\xa9\x78\xa2\xee\x6e\xb0\x13\x83\x8b\x1a\x53\x5b\xb6\xab\x1e\x76\x9c\xd0\xe4\xba\xc8\xf7\xe1\x0d\x5f\xd8\xc8\x69\x0a\x38\x3d\x65\x1b\x0e\x87\x97\xda\x35\x45\x60\xff\xfc\xa2\x62\xbb\xe6\x3b\x74\xc2\xfd\x70\x78\xff\xd1\xb1\xe3\x1d\x0f\x75\xc6\x21\x73\x91\xed\xf1\x16\x94\x1c\xd7\x2a\xa6\xad\xe2\x14\xdc\x18\xfc\x0b\xcf\xdb\x7a\xc7\x3e\xe8\xaf\xbe\xf9\xe5\xbb\x1b\x56\x2a\x42\x5b\x98\x89\x1a\x27\x0f\x2d\x64\xb2\xde\x37\xfb\xf3\xe0\xc2\x70\x4d\x17\x5e\x7c\xba\xd9\x27\xf9\xc9\xf5\xa5\x1d\xd6\x97\xf6\xe0\x89\x8f\x0b\xee\xbe\x4b\x0b\x7e\x35\x86\x36\xad\x78\xa6\xc7\xa1\xe6\x91\x0a\xcb\xb6\x44\x1c\xd3\x30\x6f\x81\x36\xca\x56\x12\x32\x6a\x57\x33\x72\x17\xfd\xc3\xb9\x4f\x39\x77\xe5\xba\xfc\xae\x17\xd7\xf7\x1b\xd6\x43\x87\x6e\x48\x76\x0a\x67\x48\xfd\xc9\xf6\x89\xc6\xc3\x0e\x08\xcf\xe6\xb8\x9f\x4e\xf8\x90\x6d\x5f\x36\xaa\x98\x3c\xf7\x50\x0f\xbe\xb4\x76\x5f\x7e\x59\x5b\x7e\xf0\x94\xae\xc9\x4f\x1c\xd7\x43\x12\xd6\x25\xbb\x67\xdc\x6a\x68\x24\xb4\x53\xbc\x3d\xf2\xc2\x9b\xd0\xfa\xd5\x7b\x5d\x07\xec\xe1\xf1\xf8\xfe\x5e\xd1\x0a\xe1\x8f\xc7\x6c\xb6\x90\x37\x6a\x47\x69\x8b\xbe\xa0\xed\x92\x78\x79\xa6\x70\xe7\xb1\xa8\x70\xae\xf1\x5c\xd4\xd7\xe0\xa6\x13\xcb\x73\xb7\x33\xeb\x3b\xf9\xf3\xf5\xfd\xf9\xfe\xe6\x26\xaa\x8e\x81\xc6\xc0\x5e\xb5\x51\xe1\x64\x7c\xda\xe7\xe1\xd3\x85\xeb\x88\x2f\xff\x8b\x3e\x95\x5d\xf4\x8f\x30\x45\x81\x75\xee\xf6\x40\xeb\xb9\x71\xe5\x75\x16\xba\x68\xeb\x9f\xca\xd5\xbf\xb4\x06\xf4\xc6\x4b\x66\x1a\x3b\xd5\x6d\xe0\x72\x2f\x09\x8f\x7e\xf4\x85\x0d\x32\x87\x64\x6f\x71\x92\x37\x33\x91\xa9\xf1\xfb\xcd\xcd\x06\x25\xb2\x2d\x79\xaf\xb9\x0d\x7b\x31\xbd\xeb\xb6\x9b\x5a\xc0\x2e\x8c\x4d\xf0\xbb\x31\x53\xbb\x50\xe9\x98\xe6\xf6\xf3\xe5\x12\x37\xcf\xd4\x9a\x7e\x94\xaa\xe2\x1a\xed\x09\x0b\xd4\xe1\x53\xec\x63\x71\x22\xdb\x3c\xd8\x16\x4f\x54\x2f\x69\xaa\x61\xbe\xba\x5d\x02\xfe\xfb\xf3\x6d\x06\xbe\x82\x05\xe6\xdf\x87\x21\xde\xa9\xbb\x16\xb3\x22\xd0\xcc\x19\xda\xed\x78\x80\xcd\x94\xe9\xb4\x27\x43\x93\x07\xbf\xdf\x7b\xb8\x26\x3a\x01\xfc\xa8\x8a\xfe\x09\x37\xb0\x36\x35\xf0\xf6\xf6\x8d\x15\x18\x6b\xfc\xd9\x35\xe7\x16\x12\xaa\x25\x34\x73\xc3\x93\x11\xe6\x4c\x07\xe1\x94\xa0\xd2\xb7\xa2\x4b\x6c\x83\xaf\xb8\xa6\x6b\x7e\x04\x9e\x00\xd7\x4a\xd0\x6b\xfb\xda\xeb\xca\xea\x48\xb3\x3f\xbf\xac\xe7\x32\x27\xff\x1b\x13\xec\x19\xf6\x6a\x7d\xb4\xd2\x6e\xb1\xa5\x6f\x32\xeb\x8c\xf8\x27\x50\x29\xd3\x06\x9f\x4d\xbc\xe9\x5c\x9d\x86\x07\x45\xd7\xcd\x89\xff\x3c\xbe\xfb\xb7\xab\x17\x7c\xfd\x7d\x12\x6c\x57\x96\x93\x34\xc4\x2e\xc2\x65\xc8\xfb\x0f\xae\x8e\x8e\x51\x05\xbb\xf6\xc4\x47\x2d\x65\x13\xea\xb4\xb4\x49\xfe\x90\x36\xf8\x13\x5f\x10\x83\xd9\x36\xab\xa2\xa2\x93\xb2\xeb\xfd\x62\x27\xa8\x22\x39\x6e\x53\x1a\xc3\x20\x49\xc7\xfb\x74\xd4\xd5\x1f\xf6\x55\x41\x2f\x5d\x03\x9c\xa3\x2e\xb7\x4f\xf3\x16\x03\x54\xc5\x29\xf6\x34\xb1\xb3\xa9\xdf\x0d\xee\xd7\xc2\xbd\x0e\x7b\xb7\xc3\xc3\xb4\xbd\x19\xe9\xcb\x64\x7f\x7f\x33\x92\xb6\xaf\xfb\x88\x15\xba\xe0\x92\x4d\xcd\x35\x19\x17\x75\x09\x5f\x37\x8a\x86\xfc\xc9\x66\x1f\xcd\xd5\xe4\x89\x5c\x4e\x29\x0e\x2d\x74\x89\x5c\xa8\xc6\x34\x81\x7f\xc2\x00\x67\x84\x1e\x39\xfc\x51\x3b\xc4\x5b\x7c\xb9\xd7\x55\xf1\xb7\xb1\xe6\x70\x17\x60\x13\x4c\x59\xc0\x24\xbb\xa6\x35\x23\x57\xc9\x62\x50\x94\x23\x04\xf5\x9d\x8e\xab\x2d\xe9\x15\x66\xca\xcc\xbf\x6b\x80\xd7\x55\xaf\x15\x7d\x1e\x88\xc4\xba\x2f\xf4\x05\xcd\x72\xaf\xd0\xa5\xbf\xf8\xc2\x22\x98\xbe\xc4\x1e\xa4\xa5\xf6\xbf\xf7\x0b\x19\x22\x56\x4d\x5a\xc5\x7f\xd9\x6c\x94\x01\xd3\xf4\x2d\x7c\x61\x9c\xca\x8a\x8e\x96\xbf\xe4\x3e\x9b\x8e\x90\xf4\x9a\x2a\xa0\x81\x5e\x92\xbc\xd4\x36\x36\xe5\x84\xdc\xa8\xde\xd7\x5b\x2c\xda\x5d\xfb\x92\xa7\x81\x26\xc1\x3d\x0e\x69\x32\xbb\x97\x7c\x19\x1e\xfe\x16\x8d\x3b\x7d\x78\xc9\x12\x1a\x29\xd0\x48\x4f\x44\x76\xd6\x9c\x38\xaa\x82\xd8\x9a\x52\xef\xfc\x61\xbb\x44\x3b\x80\x15\xdc\xc7\x3e\x75\x8c\x66\xa2\x6b\x69\x6a\x13\x6e\x37\xf4\x04\xd7\xb3\x2d\x51\x94\x39\xb3\xa6\xc3\xa1\x64\x52\x67\xce\xab\x4b\xc8\x3b\xbe\xfc\x5a\xcc\xb6\xd1\x26\x99\x63\x6b\x82\x5e\x02\x0b\x8b\xb8\xfc\xd6\x66\x73\xf8\xb9\x29\x27\x73\x86\xb3\xb6\xdd\x9f\x99\xd3\x38\x63\x41\xb0\xd7\xfe\xd3\xad\x0f\x03\xb8\x29\x2d\x57\xba\x51\xd7\x60\x7f\x05\x2d\x21\x8d\xec\xfe\x1b\x85\x7e\xde\xc7\xf9\x82\x3f\x37\x47\xf5\xa6\x20\xd0\x75\x09\x8f\xfc\x5a\xe2\x83\xd1\x14\x1d\x44\xd7\x0e\xff\x26\x75\x6a\x3b\x1a\x10\x4a\x36\x71\xd8\xa0\x47\x4d\x7a\x96\x85\x5e\xfc\xba\xe2\x94\xbe\xb4\xfb\x3a\xe9\xfc\xd9\x51\x8f\x6b\xa2\x38\x99\x52\x6f\xb9\xc0\x34\x26\xae\x4f\xcd\xe3\xa2\x8b\x3a\xb8\x5a\x70\x89\x2e\x9a\x0d\x91\xef\x1b\x9c\x4c\x3b\xb4\xd2\xb4\x16\x49\x5d\x63\x07\x11\x5a\x87\x34\x5f\x26\x9c\x21\xad\x6b\x6b\x17\xeb\x2a\xff\xf0\xef\x78\x7b\xc7\xf2\x34\xf6\x37\x08\x5e\xf8\xd4\x07\x54\xf1\x52\x22\x23\xf3\x37\x37\x79\x9e\xfb\x8a\x3b\x52\x00\x61\x1b\x64\x52\x38\xd1\x1d\x37\xc1\xb4\xa8\x17\x22\x64\xef\x9f\x10\x33\x22\x5c\x3b\x40\x69\x64\xca\xe5\xc9\x2d\x1c\x1d\x7f\xfb\x55\x73\xc1\x15\x36\x99\xfb\x66\x1b\xdb\xc6\x53\x45\xeb\xcf\xe5\xec\xc3\x2d\x24\x17\xa3\xd3\x60\xdb\xac\x10\x63\xc5\xaf\x2c\xaa\x1b\xb9\x78\x52\x74\x1e\xc3\x33\xd2\x68\x2d\x7e\x92\xbc\x30\xa8\x3a\xc3\xb9\xb6\x8b\xe0\xef\xdd\xb2\xc1\x01\xb6\x63\xda\x52\xc4\x26\x53\x58\xfd\xc6\x0f\x98\x60\x84\x5d\xc7\xe2\x09\xc5\x9e\xa6\x88\xf8\xff\x08\x76\x0e\xdc\x75\x44\x05\x6e\xdd\xe1\x75\x48\xbc\x57\x93\x3f\xc8\x9d\xf9\x1e\xbd\x5c\x8b\x8f\x0f\x69\x52\xf3\x82\x69\x16\x5a\x58\x38\x7f\x43\xfa\x83\xfe\xdc\x50\xe2\x05\xfb\x13\x5d\x97\x7b\xd8\x13\x16\xd6\x84\xcf\xf4\x81\x3f\xe7\x9f\x57\xff\x39\x14\x7e\xac\xcd\x21\xe0\x33\x83\xef\x2e\x8d\x42\x70\x53\x84\x94\xc8\x9b\x7f\x43\x81\x98\xb7\xc8\x60\x45\x09\x93\x83\x16\x0e\x37\x64\xf1\x92\xf9\x1b\x90\x04\x13\xc3\x31\xa4\x01\x07\xcd\xb4\x03\xf5\xa4\x59\x80\x1d\xd6\xc2\xe4\xeb\x12\x78\x33\x32\xa6\x61\x71\xf7\x14\x31\x64\x58\x1e\xe7\x30\xe9\xfe\x67\x2c\x98\xdd\xd5\x86\x1b\x6d\x63\xc6\xd1\xeb\x28\x36\x16\xc0\x6c\x32\xd5\x7e\x4a\x32\xed\x5b\x93\xf7\x8e\x8b\x76\x7c\xb3\x7f\x65\xd3\xfd\xfa\x2d\x0e\x18\x43\x55\x82\x8b\x0a\x3e\xc6\x13\x97\x59\x7b\xb8\x10\x25\x0d\xc8\xed\xec\xf8\xdf\x76\xc9\x37\x53\xc7\xb3\xf6\x69\x40\x86\xc5\x7c\xf8\x23\x9d\x78\x13\x0a\x6c\xaa\x9d\xc4\x97\x3b\x9a\x8a\x6f\x64\x36\x75\x8d\xfe\xe6\x8b\x44\xd5\xfd\xb9\xe8\xca\xec\x66\x9b\xb7\xa6\x96\x9e\xd7\x73\xbf\x24\x2d\x29\xf5\x77\x5f\x8e\xce\x10\x5a\x4a\x5c\x30\xbf\x26\x48\x75\x60\xfd\x0f\x1f\xdf\xf6\x0f\xca\x6a\xa1\x61\x5d\xa3\x8b\xf3\xc9\xdf\xe9\x6c\x1e\x1c\x4f\xb7\x29\x81\x05\xda\xd3\x4d\xd2\xbe\x52\xb7\xbb\x1f\x40\x4f\x23\x31\x7c\x6a\x77\x73\xf4\x78\x09\x0b\x3d\xaf\x50\x3f\x3c\x6e\xa8\xe0\x79\xb7\xb6\x02\x5c\xec\x25\x31\xe9\xe3\x51\x9b\x42\x49\x1e\xc7\x39\x14\xbf\xa1\x5e\xf6\x6d\xc7\x9f\x8f\xb6\x34\x2e\xde\x66\x00\x5c\x01\x73\x6b\x99\xa2\xf2\x80\x00\xd6\xdd\x0f\xbb\x5f\x1e\xf2\x21\x30\x9d\x26\x1a\x3d\xfe\xf4\x9e\xc6\xfd\x6f\x39\xb1\xfb\x5a\x9e\xd9\xf6\x79\xc4\xa3\xa6\x77\x25\x8c\x87\x2e\x06\x14\x79\xbb\xe0\xc4\xf8\x3f\x9f\x4a\x06\x6e\x36\x03\xcd\x40\xfa\x61\x7a\x8f\x69\x9e\x1a\xb7\x10\xa7\x33\x74\x36\xdc\xfb\x03\x77\x94\x0e\x14\x63\x58\xdc\x4a\x6c\xf6\xa5\xd8\x19\x1e\xe2\xd0\x8e\xb8\x25\x73\x26\x5a\x5b\x3c\x04\x24\x76\x6c\xa1\x3c\xa6\x46\x39\xa2\x85\xf1\x27\xf2\x41\xad\x14\x94\x52\x89\xd4\x55\x08\xe2\xcc\x13\xe0\x85\x9b\xd1\xf5\xac\xc9\xa4\xed\x52\x6e\xcd\xb4\xf2\x82\x57\xaf\xff\xf6\x84\x63\x70\xf6\xb4\x52\xc3\x53\x56\xd7\xb8\x42\x73\xcc\x97\xe1\x8c\xa5\xf4\x88\x7d\x5f\xe8\x78\xdb\x35\xfa\x79\x91\x17\xb1\x78\x02\xc6\x57\xc3\xdc\x05\x7e\xe2\x68\xa6\x7f\xa1\xa2\xab\xf1\x85\xb7\x32\x3f\x8a\x69\x8b\x29\xf0\xba\x4d\xdf\x0d\x0a\xa0\xcd\xeb\x68\xcc\xea\xc2\x82\x9a\xdf\x54\x82\xc8\x4e\x32\x68\xfe\x3d\xa3\x78\x17\x0c\x65\xd8\x3a\x7e\xd6\x33\x8f\x35\xb3\x77\xb7\x34\x8e\xf4\x0d\xda\x1d\x2e\x1c\x83\x87\x03\x05\x2f\x16\x9d\x3e\x04\xb8\xaf\xa6\x16\xe4\x32\xe7\x2c\x9b\x35\x96\x98\x0c\x2a\xe8\x44\xbb\x67\xce\x9c\x1c\x7e\xb3\x29\x97\xc3\x8f\x3b\x82\xc5\x4c\x9a\x7b\xb1\xf3\x77\x1e\x17\x22\xb3\xd2\x33\x69\xe3\x86\x73\xc1\xa2\xf8\x72\x9b\x4f\x0f\x47\x2a\xbc\x92\x5c\xa6\x54\x68\x85\x87\x54\x4b\x9f\x9b\x58\x3c\x33\xd4\x8f\x6f\x62\x85\xf8\x53\x2f\x84\x9f\xcf\x83\x67\xf6\x69\xe3\x01\x77\x11\xa4\x2d\xb2\x18\x00\xd6\x2c\x0c\xca\x18\xc1\xf7\x82\x3a\x08\x54\x14\xc7\x0f\xff\x86\x2c\x8c\x35\x82\xaf\xb6\xa4\x62\x9b\xc1\xf5\x03\x03\x2b\x64\x91\x98\x1a\xc9\x8c\xb5\x43\xd3\x30\x7d\x3d\xe7\xb9\x61\xbe\xc4\x5c\x46\x7a\x49\xb5\xb9\xf9\x34\x3c\x3b\xb4\xa0\x45\x43\x0c\x88\x2c\xcc\x34\xc7\x9d\x77\xc7\xa8\xdd\xaf\x01\xee\x18\x3e\xd2\x83\xf6\x4d\x07\xcd\x1e\x0f\x34\x4a\xeb\xa3\xe9\x21\x1d\x66\x09\xe8\x73\xcc\x66\xe1\x53\x80\xaf\x92\xa7\x09\x91\xa2\x59\x11\xe8\x29\xf3\x32\xa9\xb0\xcc\x15\xd7\xa6\xdb\x41\xd5\xd6\x32\xff\x34\x32\xcd\x67\x52\x95\x19\xf5\x66\x65\x69\xda\x78\x4d\x03\xd5\xa6\x3c\x2d\x58\xe3\x0a\x9e\x43\x9b\x98\x4e\x59\xfb\xd0\x75\xd0\x29\x4b\xe6\x83\x7f\x0c\xa8\x2e\x66\xfa\xd7\x00\xcd\x7a\xc9\xa6\x11\x18\x66\xcc\x90\xf1\xe2\x48\xda\x8d\x68\xbf\x7a\x13\x29\x25\x12\x1f\xf4\x76\x4c\x85\xd7\xd2\x23\x13\x23\x0d\x77\x5d\xab\x57\x7a\xce\x6f\xe0\x1f\xbe\x2a\xf8\xe5\xe6\xfe\x31\x57\x62\x9a\x82\x02\x1b\xae\xb6\xd1\x0c\x23\x3a\xe5\x07\x4c\x36\xb1\x1a\x52\x1b\x38\x94\x8c\xa4\x3c\x37\x7a\x0a\x0d\x3d\x7b\x33\xe3\x35\xbc\x68\xd3\x16\x8c\x8e\xb7\x65\xa7\x09\x71\xcf\x7c\x56\xd0\x14\x97\x2b\xfd\x7b\x53\x10\xf2\xc5\x15\x8c\x30\x5f\x66\x22\x04\x63\x63\xe1\xee\x83\x4b\x75\xa5\x26\x31\xaf\x54\x69\x7c\xcf\xd7\x71\x25\x12\xdf\x7f\x09\x33\x73\x03\x07\xc6\x42\x08\xa3\x97\xc0\xd7\x97\x6c\xf0\x69\x09\x4c\x33\xf9\xd9\x57\x72\xc9\x34\x36\xb6\xd4\x4e\x82\x3f\xf3\xfd\xf3\xcb\x32\x8a\x7b\x33\x16\x5d\xd3\x3d\x31\x25\xc2\x54\xab\x29\x3d\x08\x5e\x1f\xfa\xa0\x3c\xaf\xc5\xbb\x90\x60\x73\xfd\x5b\x26\xa9\xcd\x5e\x5d\xa9\xe8\x56\x4f\x6c\x21\xdb\xed\x1e\xff\x35\xc8\x1e\x61\x5b\x8e\x9f\xfe\x5d\x54\x0d\x34\x13\x8b\x15\xab\xbd\x44\x7e\xd4\x1c\x1f\xd8\xc1\xb0\x6d\x38\x2e\x9b\xb9\xc4\xab\x8e\x12\x23\x9c\xb0\x2f\x34\x5b\xe6\xb5\x64\x85\x40\xcc\x3e\x28\x9d\xe7\x0f\xcf\x61\xa6\x44\x98\xb0\xe2\xb3\xe1\xfa\x70\x23\x71\x98\xe1\x05\x79\xb2\x46\x99\xca\x92\xf0\x77\x85\x0d\x53\x6b\xeb\xd5\x47\xe6\xea\x16\xf7\x37\x83\xb6\xb4\x63\xe9\xc7\x83\x04\x95\x56\x46\x8f\xf9\x98\xca\x33\xdb\x8a\xa8\xfa\xbc\x73\x35\x3c\x4e\x0a\x71\xf0\x0f\x9b\x8a\x7a\x38\x7c\xfe\x7e\x7f\xba\x7b\x0e\x57\xe1\x00\x91\x31\xe5\x20\x4b\x74\xbb\x70\x01\xcc\xae\x04\x9a\xfc\xdc\x96\xec\xbd\x9d\x11\xaf\x3c\xe1\x23\x1b\x95\x68\xe6\xc7\x12\x46\x64\x81\x2c\x0e\x88\xc8\xc5\x5d\x42\xf1\xe2\x4d\x0f\x63\x31\x93\xfc\x88\xc6\xd3\x75\xfe\x4c\x9a\x4e\x25\x1e\x9b\xe3\xbc\x22\x73\xc5\xd2\x17\x75\x3b\x6e\xb1\x77\xfb\x44\xff\xc8\x0c\x56\xc4\x92\xf9\xea\x60\xa7\xf2\x6e\x6a\x1f\xe5\x0d\x73\xbb\x26\x9a\xbf\x61\xb0\xb0\x0a\x96\xa9\xfc\x15\x42\x29\xed\x33\x6f\xc1\x14\x45\x2a\x1e\xc1\xd4\xd1\x45\x6d\x42\x5c\x59\x6f\x30\x85\x23\x67\xce\x1c\x7b\xb9\x5d\x75\xbe\x0d\x14\xa9\xdb\x5e\xea\x6e\xfb\xb4\xb2\x92\x32\x04\x3b\x39\xc8\x70\x97\xd2\xd8\xd3\x4b\x54\xdc\xcb\x19\x5f\x15\x8a\x71\x70\x7f\x65\xcb\xfc\xbd\x99\xbb\xb1\xd3\x60\x7a\x30\x50\x17\x31\xe6\x33\xd9\xcc\x4c\x88\x87\x95\x46\x59\x15\x32\xd4\x85\xf0\x55\x31\xa9\xdf\x31\xe1\xe9\xe9\xf2\x41\xe9\xa4\xc0\xea\xca\xe6\xd1\x78\xd1\x70\x66\x2f\x91\x68\xc9\x75\x38\xc5\x0d\x22\x6c\x2f\x59\xe9\x4d\x31\x3d\xb4\x9a\x12\x56\x92\x15\x5f\xbe\xbe\xe6\x8c\xed\x33\x85\xba\xcd\xf8\x24\x88\xf0\x5a\x54\x0c\x2b\x28\xe6\x41\x21\x67\xbf\x9a\x2a\x80\x4f\x11\xcc\xfc\x79\xa2\xd9\xae\x80\xb1\xe5\x35\x45\x6c\x93\x39\x8a\x6d\x86\x8b\xd5\x4a\xfd\xb6\x69\xa8\xa9\x95\x66\x0f\x21\x71\xa8\xce\x52\xae\x26\xca\xca\x17\x9e\x86\x62\x29\x4f\x25\x69\xda\x46\x93\xd8\xc4\xa3\x64\xd2\x3a\x49\x9b\xee\x4c\x1d\xa2\x98\x53\xc9\x2b\x43\x8a\x2e\x6e\x7c\xab\xfb\x29\x0d\x2a\x10\x95\xf2\xdc\x9c\x9e\x4f\xc6\x17\x35\xb5\x54\x0c\xc3\x46\xb7\x72\xda\x37\xbf\x83\x6e\x37\x07\x05\x7e\xa0\xb9\x3f\xd8\x2a\x53\xd5\x5d\x4f\xcb\x69\x02\x63\x92\x83\xcc\xdd\x38\xd5\xd7\xe6\xee\x39\xb6\x5b\x92\x17\xa7\x42\xad\x6f\x9c\x69\x27\x5b\x21\xbf\x6b\xcf\x00\x2a\x0b\x18\xcc\xb9\x67\x45\xc7\x23\x29\x8a\xc1\xe1\x76\x8c\xef\x8b\x2b\xf2\xde\x42\x5e\xfa\xcc\x97\xa9\xa8\xdc\xd8\x4e\x11\x1a\xcb\x9d\x43\x39\x88\x5d\x7a\x8e\xd8\x02\x3b\x2c\x08\x3a\x58\x6b\x46\xfa\xc3\xed\xa2\x12\xc5\x4b\xb2\x28\x16\xa5\x25\xb3\x99\x9e\xc6\xab\xa0\xa7\x37\xa6\xec\xcc\x97\xbb\x21\x24\x42\x81\x80\x25\x48\x66\x81\x43\x25\xa5\x0d\x8f\x79\x9c\x03\x33\x72\xb6\xea\x38\x46\x76\xfd\x1d\x3c\x1c\x64\x85\x0f\x7e\x41\xa8\x08\xcd\xa8\x7e\x99\x60\x2d\x88\x5c\xd7\x51\x29\x13\xb3\x6b\x4f\x85\x9e\xbb\xdd\x96\x1c\x10\xf9\x8c\x6e\xb5\x75\x57\x76\xbd\xd2\x57\x90\xb6\x0a\x41\xf0\xbe\xb1\xca\x6a\x9a\x97\x7e\xc1\xab\xfa\xfb\x06\x99\x69\x3d\x5f\xd8\xf0\xec\x50\x9e\x4d\xea\xa9\x74\x91\x63\xa6\x2a\xa0\x8f\xe3\x55\x02\x46\x4c\x2b\x8d\xb7\x97\x2e\x2a\x2a\x65\x56\x39\x3d\xa9\xa0\x98\xd1\xd6\x89\x65\x1d\x86\x0c\x2a\x37\x3e\x4b\xf5\x28\x2a\x0b\x66\x97\x6a\xa1\x15\x04\xd3\xd3\x14\x2c\xab\xbd\x4a\xf3\xc7\x57\x31\xd7\xdf\xb5\xc4\x1b\x4b\x6c\x52\xa6\xec\xef\xb2\x42\xc1\x3d\x5a\xa8\x52\x2f\xea\xe0\xdd\x16\xfa\x91\x73\x1e\x14\x78\x6d\x49\x81\xb9\x49\x0e\xf5\x85\xbf\xa1\x2a\xc4\xe5\xc4\xac\x97\x47\x49\xc2\x41\x26\x56\x9e\x3e\x5a\x58\x1d\x61\x8b\xb9\xec\x4f\xe8\x08\xe5\x92\x87\x6b\x18\xe9\x5a\xf0\x1d\x37\x94\x47\x90\x7b\xc4\x3a\x86\x85\xce\xf9\x2d\x6e\x05\xcb\xc0\x45\x91\x80\x52\x50\x4e\xd9\xd4\x0d\x77\xcf\x5c\x09\x7f\xb3\x31\x2f\x73\x1f\x71\xa3\x1e\x06\xd0\x69\xf9\xf0\x6f\xad\xef\xb6\xa3\xc6\x31\xdb\x63\xa4\x3b\x3d\x14\xc6\x8e\xf9\xb9\xff\xff\xdb\xd9\xa6\x3a\x76\x25\xc2\x77\xde\xcd\x76\x42\xc8\xd7\xd4\xb1\x5a\xb5\x6d\xb8\xb4\xe3\x9b\x7f\x57\x25\x54\xf7\x37\xb3\xc3\xf2\x03\xb1\xb5\x13\x09\x49\xbb\x06\x6a\xe0\x2e\x5b\x88\x99\xe8\x5f\x4d\xac\xeb\x87\xba\xf3\x0a\x85\xef\x08\xbe\x20\x4f\x0a\xd5\x78\x3e\x29\xd0\x8c\x50\xe3\x7d\x56\x60\x74\x4d\x4b\x07\xbd\xff\x2c\xeb\x7f\x33\x0d\x74\x61\x12\xd8\xf5\x1f\x7d\x3c\xf3\x7c\xd7\xfd\x95\xf0\xba\x30\xc3\x63\x0e\x4c\x94\x41\x34\xcd\xbc\x2f\xc8\x68\xfe\xfe\xbe\xf2\xba\x48\x93\x33\xa9\x6f\x7b\x12\x37\x25\x9b\xa3\xfd\xab\x0a\xfc\xc3\xdf\xa7\x44\x23\xe6\xaf\x7a\xc9\xe3\xe5\x6e\x6c\xf0\x1f\xec\xaf\x3c\x13\x9c\xb0\x07\xd8\x6b\x3f\x40\x72\x83\x7f\x95\x37\xc5\xd5\xdc\xf7\x80\x4d\xf3\xe0\xda\x5f\xf9\xfd\x57\x7a\xac\x5d\xf9\xc3\x47\xe8\xed\xd8\x16\x07\xdd\x13\x16\x84\x6a\x98\xe3\x30\x97\xb4\x50\xc9\x2d\xed\x1d\x37\xdc\x62\xe7\xc4\xd4\xb5\xf9\xc1\xb6\xf0\x8d\xca\xfd\xb8\xf1\x9b\x99\xb9\x52\xbf\x51\xf6\xb6\xed\x5e\xd1\x0f\x51\x33\xfb\x22\xb8\xc9\x14\x58\x28\x37\x9b\xea\xaf\x90\x57\xe4\x15\xc9\x44\x1c\xcb\xaa\x24\xcb\x9c\x3a\x3a\x6e\x10\xac\xf2\xae\x4c\x25\x79\xd6\x84\xbe\x80\x45\x7b\x8f\xbf\x7b\x63\x10\x36\xf2\x75\x0a\xc0\x7b\xee\x82\x83\x75\xa8\x45\xa8\x9b\xed\x06\x59\x11\xf2\xa3\x2a\x93\x65\x3e\x3c\x4b\xb1\xf6\xba\xa2\x65\xcc\x1f\x2b\x29\x0c\x48\x65\x52\x59\x7a\xa1\x43\xe5\x36\x5e\x77\xe6\x96\x94\x05\x7c\xf3\xf7\x99\x21\xb1\x38\x30\x00\x60\x12\xbd\x7e\xe3\x9f\x8f\x7a\x71\x85\x54\xb2\xce\xa5\x69\x75\x66\x24\xaf\x09\xb9\x36\x05\x1f\x48\x01\xfd\x22\xaf\xe8\x25\x46\x95\x19\x1b\x8f\x38\x58\x09\xeb\xcc\xf9\xa7\xfc\x17\xa9\xcd\xa9\x51\x21\x68\x72\x91\x85\x8e\xb4\x3b\xba\x06\x54\x4e\x6f\x7d\x5a\x15\x2d\x2a\x6d\xef\x1a\x8e\xd9\x5a\x06\x5a\x12\x75\x77\xb4\x87\xcc\x4c\xd2\x62\xf1\x0a\x21\x1d\x76\x8e\x19\xfd\x08\x7d\x43\x53\x33\xd2\x11\xeb\x7d\x31\x07\xfa\x3c\x29\x9e\x90\xe6\x36\x95\x72\x62\x5a\x03\x2e\x69\xc5\xf8\x0d\xe7\x64\x18\xcb\x81\x72\x60\x4b\xd4\xb2\x54\x88\x5f\xc6\x52\x1e\x82\x2e\x4d\x0c\x88\x96\x56\xa9\x92\x25\x8f\x23\xb4\x92\xd2\x95\x76\x84\xdb\xc0\x68\x66\xf4\xe0\xf9\x2a\x77\x9a\x7e\xfe\x38\xe2\x8c\x7a\x0e\x44\x5b\xc4\x3a\x69\x58\xcc\x6e\xe3\x12\x16\x93\x1f\xd6\x15\xb9\x26\x66\x08\xa6\x8b\x72\xaf\xb4\x20\x9e\xdb\xb6\xeb\x1f\x2a\x66\x65\x58\x3b\x2e\xa6\x21\x2d\x14\x9c\x03\x0f\xfb\x39\x7a\xfc\x0e\xd7\xdc\x7c\xf4\x52\x45\x01\xb0\xa7\xd4\x47\xfc\xa2\xd7\x5b\xf1\x62\xec\x7e\x19\x3b\xb8\xc5\x66\xe6\x2b\x6d\x1e\xb1\x54\x2f\xbf\xfa\x88\x1b\xf8\x0f\x6a\x0c\xb1\xdc\x90\xec\xa6\xb1\x38\x84\x22\xd1\xd7\x2e\xe5\x66\xc8\xd4\xe5\x51\xc4\x9d\x81\x9c\xe9\x29\xb3\xf8\x2d\xad\xa2\x39\x1c\x37\x84\x49\x87\x4f\xff\xae\x18\xa2\x08\x54\x63\x07\x82\x22\x26\xf7\xb9\xcb\x6d\x4b\x4d\x69\x7f\xa0\xda\xe8\x5a\x3c\x55\x64\x18\x54\xd7\xf0\x3f\x3e\x15\x88\xcd\x64\xf7\x4f\x4b\x8a\x5c\x7d\x55\x92\xfd\x70\x5c\x93\x85\x0a\xf1\x59\xde\x67\x8e\x54\x72\xb9\x94\xe4\x51\xfe\xf4\x3b\xb7\xbb\x9c\x54\x34\xc8\x9e\xe6\xc6\xb9\x76\x93\x48\xf7\x63\xc9\x67\x9d\x42\x57\x95\x48\x25\x23\x11\x2b\x13\xe1\xf8\x88\x34\x12\xb0\xa1\xc4\x58\xb3\xa4\xb1\x9c\xfb\x4c\xab\x7d\x32\x8d\x14\x8a\x07\x21\x2c\x9b\x17\x0e\xe5\x70\x8e\x28\xeb\x9e\xca\x96\xdd\x4a\x70\x87\xc2\x28\x73\xe2\x2c\xae\x75\x4b\x8c\x52\x2e\xbf\xff\x29\x65\x41\x7b\xcc\x54\x6e\xc9\x74\x99\x5f\xa4\x69\xc1\x97\x6f\x6c\x42\x0e\xa1\x6a\xe9\x2d\xd9\x3d\x8d\x35\x1d\x83\xd0\xee\x03\x7d\x12\x4f\x86\x61\xfd\xf7\x81\x49\x6d\xcf\x2e\xf7\x50\x4a\xf8\xf4\x0c\xe1\x8b\xb8\x7f\xcf\x36\xb0\xe6\x66\x0e\x1b\xc3\xcc\x56\xa5\x0e\xcf\x84\xc1\x83\xbf\x28\x2d\xfc\x6e\x66\xfc\x13\x39\x80\x81\xf0\x22\xa0\x3d\x4a\xc5\x44\x69\x72\x13\xdf\x4e\x01\x21\x4a\x6a\xfe\xde\xf8\xe2\x51\xa3\x9b\x6a\x0e\x3d\x65\xa5\xcf\x88\x6d\xbb\xec\xdf\xd8\x41\xaf\xb4\x22\x01\xe0\x29\x56\x7a\x4c\x44\x9b\x9c\x06\x1e\x4e\x25\x7d\x6d\x2b\xf7\xb0\x28\x8d\x01\x95\xb5\xc5\xa6\xc7\xbd\x0d\xc5\x8c\x0f\x61\xa0\x1f\xeb\xd9\x8c\xde\xed\xa1\x1d\x03\xe2\x92\x96\x74\x4f\xcc\x29\x0d\x70\xc1\xcc\x83\x64\x50\x59\x67\x79\x5c\x17\x99\xce\xdf\x2f\xa4\x0c\xe7\x9d\x8b\x30\xa4\x7f\x3b\x02\xe1\xba\x54\x03\x2d\x40\xa3\xaf\x69\x2a\xfa\x46\xdc\xc9\x05\x5f\x78\xf5\xb7\xa2\x3d\xe6\x90\x6b\x93\x5f\x85\xac\x1e\xc4\x2d\x14\x5a\x13\x56\xe4\xec\xa6\xc0\x2a\x61\x67\x4e\xc2\x5e\x80\x0e\x54\xf7\xb8\x96\x4b\x28\xb9\x7d\xcf\x40\x31\x31\x3f\x75\x97\x7c\xa9\x5e\x48\xce\x23\xc4\xd7\xcc\x2f\x81\x1d\xe1\xb1\xd1\xa5\xb4\x50\xdc\x14\x24\xd7\xeb\xf2\xb8\x85\xe1\xa2\xfc\xac\x4e\xad\xb9\x22\xe6\x4b\xe3\xd3\xaf\xc1\x36\x60\x88\x2c\x3c\x04\xa5\x50\x4d\x5b\x24\x66\x4c\x96\xe7\x2b\xe5\xd1\x4a\x2d\xc5\x62\xd1\x3b\xba\x96\xa6\x10\xb6\x86\xe1\x99\xc9\x64\x1a\x75\xd1\x3d\xdc\x1d\x4f\xdd\x6c\xca\x17\xa0\x1c\xb9\x6c\x4c\x7a\x36\xfc\xbd\xfd\xa0\xbf\x77\x85\x77\x3a\x3f\xa4\x7c\x4d\x43\x9c\xfd\x4e\x1e\xa6\x60\x6f\x9e\x63\x43\x31\xfe\x84\x58\xe8\x85\x0d\xdd\xe8\xe4\x9f\xf9\xd6\xa6\x61\xf7\xb5\x14\xe0\xcd\xeb\x83\xb7\xb1\xbc\xd0\xa5\xe6\x3d\x21\x00\xc8\xc2\xb8\xd9\x8d\xe0\x83\x2c\x22\x1b\xf1\xc4\xf8\xd0\x01\xaf\x93\x85\x5d\x78\xea\x11\x7a\x68\x42\xbb\x99\x95\x90\xa4\x78\xff\x20\xf8\x6c\x54\x50\x3b\xc7\x52\x6d\x9c\x53\x83\x1f\x7d\x62\xc8\xb6\x71\x79\xec\xc6\xa9\x03\x94\x52\xc4\x4e\x87\x86\x4e\x80\xa7\xd2\x2e\xc8\x81\xe0\x0b\x97\x89\xd8\xcd\x64\x00\x2e\x9d\xd9\xd0\x25\x0c\x8a\xeb\x88\x7b\x63\xcd\x87\xfe\x7e\x28\xa0\x0f\xfb\x71\x4f\x58\xca\x3b\x9f\xdc\xc2\x53\x49\xbe\x52\xf0\x31\x0f\xbc\x4f\x35\x23\x10\xf3\xb3\x58\x08\xa3\xa4\xf1\x7c\x9e\x03\xe0\x24\x2e\xbe\xbb\xdf\xc0\x63\xe7\x1b\xe4\x91\xe0\x0c\xdf\x2b\x5c\x74\xb6\x63\x89\xc2\x96\x79\x00\x8b\x47\x50\xd0\x63\x2c\xcc\xc2\x7d\x47\xa9\x57\x65\x0d\x0b\x16\x97\x70\xa2\x3b\x43\x13\xb3\x16\x41\x5b\x79\xaf\xd2\x2f\xe7\xa4\xaa\x84\x97\x11\x33\x5e\xb1\x70\x09\x4f\xd2\x1f\x71\x53\x68\xfd\xcf\x3c\x59\x3a\xd6\x76\xe4\xe0\xbf\xf2\x2f\x6e\xf8\xf2\x4b\xcf\xfe\x6d\x0f\x9e\xbd\x3e\x8a\x7f\xe0\x55\x19\xfa\xfc\xe1\x79\x5f\xfd\x2f\xff\xf1\x53\x1b\x7e\x52\xd3\xf3\x9e\x5b\xfe\xf9\xa4\x03\x91\x63\xd2\x42\xc5\xf9\xa5\x63\x23\xec\x8c\x69\x0c\x56\xf5\x2d\x34\xda\x25\x56\xd8\xf6\x7e\xef\x1c\xe2\x82\xd3\xcf\xe5\x4d\xfc\x8c\x91\xfb\x34\x16\xef\x76\x62\xf2\x9c\x05\x68\x3f\x22\x87\xfa\xd8\x00\xe0\x43\x89\x7d\x96\xe5\xba\xcb\xd4\xbb\xfb\xd9\x64\x56\x57\x1f\x82\x70\xa6\xa0\xcf\xd0\xbb\xc6\xd1\xe4\x10\xa2\x16\xf5\x31\x5d\x6a\x98\x9f\xec\x92\xeb\xce\x72\xb3\x5c\x1c\xf3\x87\x74\x68\x61\x11\xb3\xb0\x82\x9b\x02\xfc\x0b\x57\xc5\x7e\x24\xde\x00\x71\x15\x42\x9e\x8f\xf2\x78\x3a\xfe\xda\x71\xb2\x70\x5f\xbb\xa8\x32\x0f\xfe\x6e\x2e\xf7\x9b\xe8\x47\xff\xe3\xd3\x66\x56\xaf\xf8\xeb\x89\xab\x33\x69\xe5\x4b\x91\xc7\xcd\x41\x56\x2e\x90\x21\xbd\xad\x02\x51\xb5\x81\x1b\xcc\xd7\x3d\xf9\xba\x27\x45\xea\xc1\xa5\x7a\xf2\x77\x77\x7e\xd4\x93\x57\xf0\xf6\xff\xb2\x6f\x3a\x5b\x7c\xde\xb6\x2c\x51\x1a\xf9\xc3\x53\x79\x7c\x50\xa4\x14\x61\x3a\x3f\x60\xe6\x55\xcc\xfc\xf4\x41\x7b\x19\xcb\xce\x8e\xfe\x16\x8b\xe4\x55\xcb\xdb\xf0\xc7\x22\xd1\xd2\x2b\xf9\x7f\xff\x52\x91\x3b\x6a\xc3\x1d\xfe\xcc\xae\x08\xab\x14\xf1\x99\x39\xe5\x0f\x6d\x85\x67\xfb\x68\xf6\xd7\x66\x60\xec\x4e\x0b\xa6\xda\x7c\x45\x57\x6f\xcc\xd8\xc8\x27\xdf\xff\xc9\x5b\xb9\x4b\x4a\x9e\x7d\x7c\xfd\xe4\x0f\xfe\x51\x28\x27\x07\x27\x69\x64\x32\xf4\x49\x85\xfd\xe4\x25\x3e\xa5\x1b\x98\xd0\xc6\x2a\x65\x8a\x3f\x7e\xbd\xe9\x26\xf9\xfe\x97\xfd\x25\x9d\xf0\x2b\xdf\x3f\xbf\x11\xff\x22\x15\xc1\x33\x98\xf1\x83\xdb\xf5\x4f\x97\xe7\xf2\x99\xb0\x00\x5a\x07\xfc\xd5\xa4\xdf\xea\x97\xc7\xe3\x0b\x5e\xf9\xd4\xda\x3c\xf5\xab\xb5\x2f\xfb\xab\xff\x77\x40\x03\x71\x65\xe7\x82\xfe\xf8\xfa\x7a\xb5\x07\x20\x25\x9b\xa1\x84\x91\x62\x85\x2e\x54\xa4\x77\x33\x8d\x6b\xbf\xf4\xcf\x3f\xbe\xbd\x01\x87\x08\x6c\x29\x40\x19\xe6\x13\x4b\xd5\x3a\xc2\x11\xfe\x9f\xbd\x9c\x39\xd4\xe3\xc7\xd7\xcf\x81\x69\x0b\x33\xaa\xc8\x0a\x98\x39\x26\x02\x0d\xe9\x06\xd5\x50\xcd\x39\x24\x74\x83\x70\x1d\xa1\x22\x16\xc4\xa5\xaa\xdc\x9b\xaa\x43\x45\x65\x5f\x4e\x0a\xd2\x6c\xbd\xfe\x83\x39\x44\x68\xb1\xb6\xf6\xcf\x1f\xec\x35\x31\x63\x8e\x6c\x36\xad\x8f\x9e\x14\x77\x3d\x92\xc2\xe4\x89\xbb\x2a\x00\x3a\xd2\x99\x6a\x60\x70\xb1\x11\x5c\x35\x8e\x01\xb2\x75\xf0\xbb\x45\xc2\xd9\x9b\x30\x70\x8b\xdd\x92\x33\x60\x6d\xdd\x90\xf9\xf6\x87\x1f\xff\xe6\x85\xfe\x56\x52\xf7\x2c\xd5\x98\x09\x52\x75\xf6\xa1\x8e\x0b\x7b\x91\xb4\x46\x1b\x6e\x34\x3e\xf6\x57\x6c\x82\xb0\xd7\xbf\xe1\xc7\xd7\x47\xc5\xa2\x68\x85\x2c\x19\x5d\xfd\x86\xfe\x42\x6c\x23\x8b\x21\x8c\x5b\xed\x35\xd8\x95\x6f\xff\xc6\x03\x64\xe7\xdd\x6f\x71\xcf\xf7\x6c\xe1\x06\x9b\x01\xdc\x11\x87\xeb\x1d\x66\x41\xc6\xe6\x02\x6f\xbe\x06\xb9\x38\xd1\xdc\x64\x58\x15\x3b\x64\x7d\xa4\xd7\xe7\xf0\x77\x24\xba\x95\xb6\xed\x53\x4b\x3d\x86\x16\x8a\x1d\x97\xf0\xf3\x06\x99\x6f\x9f\xf0\xb6\x0f\x1f\xdf\xc7\x4f\x5f\x8f\x53\x59\xc6\x7a\xef\x4a\xab\xcd\x49\x69\xfb\x31\x0f\x54\xb5\xca\x6e\xdd\x5e\xc5\x6d\xaf\x79\x6d\xbc\xf4\xc4\x92\xeb\xc1\xfe\xe4\xdd\xff\x88\x60\x7a\x56\x79\x62\x8d\xb3\x6e\xab\x31\x6f\xfd\x92\x99\x17\x35\xb9\x50\x45\x70\xf4\x70\x8e\x81\xee\xc2\x92\xfc\x98\x5b\x06\x29\x76\xbd\x1f\x92\x50\x9e\xdf\x9b\xa2\x0d\x40\x0d\x16\xdc\xad\x29\xbd\x2d\x01\x42\xe2\x18\x4f\xac\x84\x42\xea\x39\xdf\xb8\x5a\xdb\xad\x84\xd0\x5e\xfe\x8d\x0d\x74\xb9\x5d\xcc\x4e\x9c\x22\x32\x91\x15\x4a\xc2\x02\x2a\x2a\x83\xce\xe8\x3d\x2b\x81\xdb\x67\xe6\xac\x57\x7b\xa5\xc3\x93\x2a\xe2\x9f\xa0\x34\xc6\x5a\x48\x5b\x25\x75\xd7\x50\xf3\x3d\xaf\xf9\x41\x48\x91\x4a\x80\xef\x5f\xfe\x5d\x11\xff\xee\x97\xdf\xa1\x3d\x0a\xfb\x9e\x08\x96\x54\xc5\x76\xda\x5b\xba\xa1\x0a\xa7\xd6\xc1\xd6\x8f\xad\x13\x76\xf3\x88\x22\x4e\x9e\xbf\x66\xee\xa4\x76\xa8\xbd\x5f\x79\xb8\x78\xe2\x33\x41\x56\x1c\x34\x93\xe9\xe1\x0c\x6a\x68\xf9\xfd\xf6\x05\x35\xb1\x7f\xd8\x4e\xe3\x32\x26\x39\xe4\x4d\xe3\x95\x2c\x5c\x3b\x73\x43\xde\x7f\x85\x3b\x97\xba\x86\x48\xe6\x61\x1f\x6b\x24\xf5\x2e\x16\xf9\x8c\xdc\x2d\x8f\x18\x06\xa2\xe0\x07\x33\x37\x70\x6b\xed\x68\xb8\x7c\x16\xfc\xef\x25\x28\x87\x31\xee\xaa\x1d\x6e\x7d\x44\x32\xe0\xea\xf9\xe3\x02\xa0\x45\x49\xa3\x0d\x45\x06\xb3\xd0\xbf\x4c\x29\x78\x32\xf8\x05\xfc\x67\xa5\x41\xd0\x1d\xe6\x80\xcd\x25\xe6\x41\x48\x26\xba\xfe\x8e\x3f\xe7\x8f\x47\x7c\xdf\x9f\xb8\x4f\xf3\x74\x18\x76\x03\x93\xe3\xaf\x28\x90\x70\xc4\xb4\x5e\x16\x56\x52\xd1\x6e\x72\x43\xf7\xdc\x1f\x98\xfd\xee\x18\x76\x74\xa5\x05\xd3\x45\xc2\x06\x32\xe5\xde\xe1\x0b\xeb\x76\x62\x4e\xc1\x13\x7c\xc8\x59\xf8\xe9\xc5\x5a\x99\xdf\xbd\xed\x4a\x0b\x3a\x48\x12\xf6\xc7\xbd\x02\xa4\xa5\x1d\x17\xb5\xaa\x0e\xc1\xfc\x82\xd9\xb1\x85\x30\xa4\xfb\x46\x05\x6b\xa2\x4d\xd4\x64\x9f\x37\x96\x6e\xdf\x3f\xfc\xbb\x7a\xb5\x81\x54\x7f\x58\x40\xc8\x95\x62\x5e\xaf\xf5\x0e\x44\x5e\xac\xdb\xab\x91\xee\xe3\xd3\xbf\x2b\xba\x53\xaa\x00\xe7\xac\x8c\xc7\x9a\x9b\xe2\xbe\x17\x00\x04\x6b\x35\x5e\x9b\xc2\xb1\x7c\x7f\x35\x46\xb9\x21\xe0\x3e\x9e\xd2\xb0\xf5\x7e\x61\xb9\x7f\x44\x34\xaa\x84\x93\x60\xc7\xc9\x73\x50\xc4\xec\xb3\x44\xca\xfa\xc7\x2a\xf8\xf8\xa2\x32\xcc\x9c\xb7\x80\xb8\xb3\xc7\x17\x64\x6c\xea\x98\x1c\xbf\xc5\xc8\xb2\x07\xf0\x27\x08\x2a\xbd\x80\x0b\x05\x53\x74\xca\x50\x20\x12\xf3\x4e\x30\xbb\x39\x66\xac\x02\x79\x96\x06\x9e\x08\x52\x48\x28\xb4\x79\xd2\x90\xb5\x95\xe9\x31\xf2\xb7\xed\x2b\x2f\xe0\x69\x6f\x81\x62\x72\xb8\x48\x2c\x32\xbe\x28\x37\xb4\x60\x66\xfd\x59\x34\x6f\x8a\x1d\x54\x3e\x95\xd8\xba\xb5\x51\x57\x44\x5b\x34\x66\xe3\x1d\x3f\x8b\x44\xb9\x94\x85\x16\xc2\x0a\xd7\xd2\x51\x73\xce\xe7\xac\x6b\x55\xda\x70\xf4\x90\x14\xb1\x96\xfd\xbf\x1a\x1d\x4f\xf8\xa2\xae\xb2\x05\xc8\x04\x9c\x9b\xeb\x8a\x15\xff\xcb\xdf\xbc\xba\x30\xf0\x55\xa9\x6e\x87\x9c\x94\x89\x83\xda\x2c\xc6\x87\x3e\xc9\x65\x52\xe5\x18\x53\x15\xc0\x2c\x98\xa9\x55\x23\x80\xa7\x3a\x14\x38\xd8\x19\x40\x1c\xeb\xf0\x3d\x22\xb0\x54\xb3\xf9\xd3\x20\xf4\x58\x5a\x47\x94\xc0\x27\x76\x3c\xec\x5d\x7b\xfa\xf7\x11\xe8\x19\x95\x73\x74\xfc\xf6\xef\x0a\x21\x2c\xa0\x8b\xc4\x7b\x75\x9e\x09\x1a\x1e\x52\x44\xc4\x1c\xc5\x93\x94\xa5\x57\xc9\x99\x1d\xf9\xc3\x37\x8e\x79\x4a\xbc\x2f\xd3\xfb\x14\x9f\x75\x08\x14\x09\xbb\x74\x82\x48\xb7\x95\x4d\x5f\x8e\x2a\x45\xad\x1e\x05\x7d\xec\xd2\x1b\xf2\x5f\x15\x01\xd3\x32\x38\x40\x86\x4c\xb8\x13\x93\xd1\x11\xc9\x8c\x2e\x5f\x5c\x25\x0c\xf8\x82\x5c\x84\xf5\x89\x58\x33\x5b\xec\x4d\x94\xd9\x0a\x5f\x80\xdd\x78\x78\xc6\x44\x67\xd3\x05\x09\xf9\xff\xd7\xd9\x6b\xde\x0f\x4b\x12\xad\x29\xd9\xb2\xf5\x5e\x76\x2a\x49\xab\x0a\x30\x0a\xf3\x4d\x2b\x04\x3e\x43\xa4\x85\x08\x25\x2e\xf3\xa6\x27\x15\xfb\x81\x05\xae\x98\x15\x4c\x84\x70\x2d\xa5\x5e\x88\xdc\x1f\xed\xeb\x17\xf7\x38\xd4\x03\xd1\x9b\x0b\x50\xf5\xaf\xe6\x22\x77\x47\x59\xf7\xeb\x4d\x1c\xb9\x12\xb1\xa3\x51\x31\xbb\x4e\x2b\xbd\x86\x25\xf4\xbe\x84\xa6\x40\x94\x9f\x18\xf2\x3e\xb0\x8b\x97\xc5\x0f\xb8\x96\x4c\x53\xbe\x09\xda\x65\x8a\xb4\x66\x9b\x12\x7b\x78\xfd\x0d\xce\xb1\x45\xf4\x66\x47\x34\x13\x2b\x96\x99\x7a\xf4\x22\x14\xf6\x48\xcb\x07\x24\xbc\x2a\xac\x91\xb9\x8c\x39\x5d\x82\x1d\xc8\xea\xd5\x0e\x4b\xdd\xe0\x0d\x78\xb8\x12\xc2\xd5\xa9\x70\x72\xe9\x1e\x46\xd7\x22\x0e\x83\x59\xec\x9a\xb0\x71\x57\xff\x8b\xa0\x52\xbb\xdc\x66\x34\xbb\xf8\xb5\x96\x86\x16\x4f\x08\x94\xf4\xf2\xdc\x0b\xe2\x6e\xc1\x09\x72\x9a\xee\x91\xab\x51\x75\x11\x48\x74\x2e\x50\x17\xc7\xe2\x09\x37\xb9\x04\xe6\x28\x7a\x22\x9a\xfd\x7a\x59\x3f\xaa\x00\x63\x1c\x99\x2f\xb6\xf0\x68\x64\x8f\x66\x8c\xa7\x86\x40\xaf\xe7\xf3\xaf\xb3\xa6\x57\x00\xec\xe9\x1e\xc8\xa7\x6a\x87\x0e\x0a\xca\x54\x32\xa6\xb7\x6b\xc1\x66\x9b\x0b\xd0\x15\x5d\x5e\xd4\xe3\xe2\xea\x44\xb0\x2e\x73\xf9\x4b\x0a\xcd\x93\x8b\xaa\x64\xd8\x5a\x9c\x94\xbc\xf3\xd4\x24\xde\x6f\x0c\x4f\x02\x47\xed\xa0\x13\xeb\x8d\xe2\x16\x32\xba\x2d\x74\x36\xa3\xa4\x7f\x2f\xfc\x19\x77\x8e\x67\x82\x28\x3a\xc0\xd0\xa1\x02\xdd\xc6\x60\x07\xa5\xbe\xdd\x20\xfa\x7d\xe4\x7e\xf2\xff\x2a\xf8\xa9\x3f\x9f\xc7\xea\xd5\x99\xcd\x2a\x5d\xf7\x82\x18\x48\x0b\x9b\xc7\x52\xfc\xe3\x87\xe9\xb6\x5d\x49\x5f\x13\x01\x75\x63\xc6\x50\xfa\x1a\xec\x46\xe9\xa9\xd9\xbd\xb4\x2c\x0f\xb3\x3f\x1d\xa6\x0c\xbd\xc7\x10\x7b\x40\x14\x51\xbb\xba\xc4\xc9\x7d\x41\x3c\x7a\xd4\x99\x87\x12\x9e\x35\xcd\x88\x29\x33\x3a\xa9\xe1\x89\x75\xb0\x07\x03\x74\x0f\x44\x05\x6e\xb2\xbb\x89\x75\x45\xec\x25\xd3\xe7\xa5\x5b\xdd\x71\xfa\x29\x76\x4c\xba\x74\x93\x72\xad\x16\xb5\x11\x16\xd4\x94\xfe\xba\xd1\x4e\x35\x11\x63\xee\x87\x69\xb5\xee\xd4\xc5\x1b\xd1\x91\x5b\x41\x0c\x12\x1e\xcc\xae\x59\x3f\xaa\x15\xbd\x20\x87\x49\xf0\x38\xd0\x54\xe4\xfb\x89\xda\x27\xaf\x89\x35\x99\xbc\x74\x61\x1d\x25\x05\x44\x14\xb1\x81\x1a\x09\xcd\x3d\xae\xea\x70\x58\xdc\x26\x63\x47\x4b\xc1\xd5\x53\xd4\x61\xc9\xcc\x79\x9b\xc9\x0a\x34\xf4\xe6\xc3\x40\x4f\xd8\x06\xb1\xc7\x41\x9e\x17\x65\x9f\x70\xbc\x73\x69\x58\x3f\x87\x6b\x69\x8c\x84\xa0\xe6\x56\x2a\x58\xdd\xe6\x4a\x9f\x16\x37\xe2\x34\xa8\xa7\xc5\x34\x5e\x8b\xa5\x99\xa2\x9f\x2c\xc2\xf7\x4d\xd6\xa0\x3f\x2e\x05\x76\x70\x8b\xf5\x8b\xb4\xe0\xba\x0f\x04\x22\x1e\x7e\xfd\xbb\xa2\xb1\x53\x1d\xd6\xac\x27\x0d\xe8\x29\x2c\x82\x00\x2c\x7b\x57\x0b\x62\x1d\x65\x38\x01\x45\x20\x45\x80\xb7\xc9\xe1\x08\xdb\x92\xf7\x6c\x16\x37\xcf\x29\xca\x20\x65\x0b\x0e\x59\xbc\x5c\xa4\x52\x3c\x25\xbb\xd2\x76\xba\x72\x3c\x13\x18\x98\x77\x57\x05\x74\xb7\x1c\xce\xc2\xa0\xbd\xb7\xcd\x2e\xd5\x32\xd3\x66\xb0\xbc\xf8\xaa\x4a\x2e\xae\xfd\x80\xc4\xb0\xe1\x2c\xf7\xdc\xda\x38\x5c\x89\xf8\xc3\x27\x40\x49\x78\xb0\x34\x31\x1b\xe2\x29\x7b\xbc\x93\x83\xf5\xd8\x28\xe1\x65\x79\x61\x86\xbd\xe3\x53\x47\xa4\xf1\x9e\x6d\xe1\x2b\x52\xe9\x5a\x74\x38\x28\x0b\xd5\xad\x63\x7d\x2a\x04\xec\x0c\x02\x47\x17\x66\x66\xc0\x00\x5a\x87\xfb\x91\x85\x72\x18\x77\xfb\x2b\x4a\x95\x90\x73\x2c\xf4\xf9\xee\x33\xf7\x20\x67\xf5\x92\xf4\x41\x4c\xce\x9b\xc3\x2f\xfb\xcd\x4c\x95\x93\x57\x28\xb3\x00\x47\x92\xa8\x74\xf9\x44\x27\x47\xb8\x52\x31\xed\xee\xf3\x32\x63\xb8\x32\x98\x76\x0c\xe1\x40\xe1\xf1\x18\x46\xc9\x13\x74\x90\x42\x53\x0f\x8f\xd1\x77\x81\x47\x49\x1d\x4a\x2e\x31\x40\x7c\xf6\x81\xfd\x97\x08\xdf\x36\xa0\x20\xa0\x41\xe9\x94\x45\x7c\xf1\xa2\x7b\x79\xdd\xb6\x9f\xb2\x14\x5e\xda\x52\x60\x63\xdb\x61\xf2\xca\x9c\x7f\xbc\x2e\x44\x30\x6c\x05\xb4\x6a\xfe\x83\xad\x02\x2e\xa1\x77\x48\x34\xd5\xe5\xc8\xb3\xec\x62\x21\xc8\x86\xbf\x2f\x1b\xc1\x1c\xd0\x69\x07\x8e\x10\xbd\x66\xaf\x77\x59\x77\x6e\x3e\x99\x19\x9e\x61\xa6\x55\x35\x93\x31\x64\xf2\x30\x30\x28\x19\x93\x5a\x83\xa0\x1e\xa0\x7b\x5c\x19\xf2\x54\x09\x1d\x0f\xc0\x15\x42\xae\xa5\xf4\xc4\x83\xed\x82\xd5\xe6\x50\xe0\xbd\xe8\xcf\x64\x5a\xc3\xac\x20\xdb\x96\x4c\xe0\x3c\xfb\x53\xd6\x02\xf8\x3c\xb4\x65\xaf\x65\x21\x99\xb2\x5f\xc6\x1d\x26\x29\x9b\xee\x1e\x0a\x78\x55\x96\x61\xb9\x34\xac\x3d\x02\x16\x51\x01\x6d\x3e\x35\x40\x42\x3c\x04\x03\x48\xd3\x29\xb2\xe3\x15\xe2\x2e\xf2\x09\x27\x5d\x60\x45\xfb\x84\xba\x82\x43\xa5\x10\x5a\x0d\x81\x87\x73\x96\x4e\x9a\x97\x0c\xac\x83\xc5\xa3\xbe\xc9\xfe\xc7\xe6\x9b\xb3\x74\x6e\x47\x92\xde\x94\x6d\x20\x53\x14\x0f\x7c\xd9\x03\x74\x1e\x11\x65\x69\xb7\x0c\x25\x6b\xb6\x1b\x7e\x2b\xc3\x42\x0f\x2c\xf7\x8e\x92\x57\x68\x59\xcc\x09\xe0\xfb\x09\x56\x79\x60\xae\x1f\x19\xc2\xbc\xa0\x47\xff\xb6\xa4\x52\xf5\x7f\x21\x24\x9c\xba\xa5\x40\x6a\xe6\x85\x0b\xee\xbd\x04\x0c\x6d\x28\xdd\x8e\xf2\xb3\x1f\x9f\x5f\xfe\x0d\xe9\x9c\x4e\xfb\x5f\xb5\x19\x4b\xfe\xa0\xe5\xe8\xf7\xa5\x40\xb1\xd1\xf2\x05\x99\xb9\x1f\x9f\x97\xee\xc7\x73\x7f\x4f\xa1\xa6\xcc\xd7\xdf\x98\x48\x66\xef\x26\x91\x0d\xbe\xe2\x66\x6e\x19\x1a\x00\xd9\x59\xbd\xfa\x12\x8a\xb8\xe2\x73\xfb\x87\x5d\x3c\x5f\x7a\x89\x57\x21\x6d\x7d\x83\x80\x8f\xfa\x78\xf5\x8d\xad\xee\xd3\x95\x1e\xc3\x85\x2d\xb1\x53\x27\x4c\xee\x69\x27\xac\xcb\xeb\x83\x35\xa3\xbd\x9c\x86\x52\xa0\x2f\x28\x24\xf4\xae\x03\xf6\x90\xc6\xd1\x96\x1d\x0b\x02\x64\x33\x43\xef\x41\xb8\xf9\xfb\xc8\x02\xed\x39\x2e\x82\x1c\x78\x4f\x57\x89\xfe\xfb\x58\x58\x1d\xd6\x15\x79\xa5\xa6\x64\xdf\x46\x8b\x2b\xa1\xf2\x4a\x5b\x07\x0f\x91\x5a\x2b\x04\x18\x87\xde\xa6\x33\xeb\x91\xa9\x84\x9d\x4b\xc7\xf8\xbc\x62\x24\x53\xda\xab\x4d\x66\xfd\xe3\x04\x9c\x29\x66\xeb\x51\x0a\xcd\xb2\x16\xd9\x7c\xa1\x9d\x39\xd6\x2f\x24\x6b\x23\x81\xed\xef\x5f\xc7\x0f\x24\x94\x04\xea\xc1\x96\x25\x35\xec\xd8\x05\x44\xc7\x7a\xe2\x0e\xef\x04\xc0\x0b\xfa\x56\xba\x69\x70\xfe\x14\xbb\xc6\x9b\xa2\x08\x28\xcc\xd3\xae\xca\x36\x9a\x66\x2a\x28\x7a\x0b\x83\x82\xaf\x97\xd9\x33\x05\x8c\xbb\x23\x1e\x29\x4d\x93\x6e\xfc\x66\xfb\x40\xa4\x8e\xfb\x7c\xfe\x8c\x99\xd4\xc7\x5f\x9e\xb5\x42\x1a\x88\x18\x2b\xc7\x51\x9d\x86\xac\x16\x2d\xef\xb0\xc0\x0e\xd9\xdf\xed\x38\x78\xf0\x0a\xfe\xa3\x1e\xa0\x5a\x2c\xde\xe1\x29\x14\xfd\x0b\x62\x0f\x7b\x2d\xa5\x27\xbb\x69\x52\xb2\x2a\x2b\x59\xd5\x2c\xca\xf9\xc4\xbb\xda\x65\x92\x97\x3e\x4a\xc7\x9a\xf2\x1e\x43\x40\xf0\x62\x6a\x5f\x88\x0a\xd7\xc7\x5c\x1c\xf3\xca\xbc\x29\xa4\x52\x45\x11\x6f\xe9\x96\xac\x62\x3f\x85\x44\xc1\x71\x6e\x15\xaa\xbf\x6a\xa4\x35\x0d\x4d\xd4\x67\x2c\x46\xc0\x85\xa1\xa7\xf3\xe8\x19\x13\x75\x2b\x98\x63\xca\x48\xea\xb2\x2f\x6a\x36\x50\xd2\x25\xa3\x39\x95\x65\xa7\x9b\xaa\x75\x38\x5c\x7e\x87\x17\x2f\x96\x2b\xc3\xb7\xa9\x7c\x7f\x43\x3e\x8d\xa5\x71\x46\x93\x66\x1b\x6d\x69\x89\x51\x31\xa1\xe9\x91\x6e\x06\x59\x8d\x9e\xaa\x69\xbd\xe6\x2c\x03\x1e\xdc\xb5\x64\x5b\xeb\xf4\xa4\xb5\xf3\x83\x95\x8a\x33\x40\xdc\x89\x79\x41\x2c\x76\x7b\x3f\x0c\x53\x48\x4d\x66\xc2\xa5\x15\x5d\xc5\xbe\x8e\x0d\x85\x44\x08\x90\x8b\x43\xcb\xe8\x8a\xd8\x71\xbf\x28\x80\xf3\x15\x01\x42\x2d\x35\x0f\x6a\x7e\x73\x72\x96\x91\x91\xfb\xb6\xb7\xc8\x0a\xbe\xbf\xbf\x1a\xa7\xd7\x59\x4d\x78\xe6\x51\x13\x23\xe5\x8a\xb5\x34\xa7\x9a\xad\xe9\x05\x7e\x32\x6d\x31\x6a\xd3\xc0\xd5\x82\xb8\x41\x81\x74\xbc\x37\x05\x34\xee\x72\x8d\xf4\x4a\xf2\x92\x4b\x82\xda\xb0\xcd\x56\xb6\xc3\x8e\xcd\x1d\x77\xb9\xf5\x0a\xfb\x87\x53\xa1\xd0\x0a\x0d\xff\x1a\x75\x0b\xe6\xa5\xc6\xd0\x14\xaa\x17\x77\x73\x85\x2b\xbe\x7a\x57\xda\x7f\x78\x7d\x08\xad\x09\x4f\x5c\xbd\x57\xd2\xe5\x08\x85\x7f\xe6\x77\xa5\xbf\xc2\x3b\x4c\x15\x9d\x1a\xf7\x72\x70\x4e\x08\xee\x9f\xe7\x17\xce\xdf\x4c\x57\x9b\x80\x8c\x99\x8a\x13\x6c\x21\x65\x81\xc9\x5e\x4d\x3f\x21\x42\xb9\xfd\xd5\x38\x92\x52\xee\x6b\xf2\x30\xf3\x85\x09\xe0\x26\x75\x4b\xde\x67\x7a\x01\xf1\x8a\x3f\x2b\xa9\xa3\xee\x95\xec\x6c\xf3\xde\xf5\x72\xbc\x3d\xd4\x82\xbd\x9c\x76\xb5\x2e\x0f\x2c\x81\x0c\x16\xe7\xa4\x19\x66\x7b\xb7\x43\xc5\x93\xe8\x9d\x35\x2c\x93\xe4\x41\x11\xf1\x95\xfc\x20\xb7\x54\x17\xae\x8f\x91\x78\x07\x33\x66\x9f\x90\xb9\x99\x39\xf0\x93\x19\xd2\x27\xfb\x40\xd9\xc3\x4c\xae\x1a\x78\xd1\x9e\xf4\xe3\xf5\x9b\x1a\x61\x53\x98\xe7\x71\xfc\x03\xf0\xe5\x5b\x93\x0b\x8f\x93\xe7\x82\x3b\x1c\x6c\x4f\x89\x88\xb3\x6b\x6f\x21\xce\x26\x8b\x8e\xf7\xb4\x47\x3f\x87\xd3\x7e\xb9\xf8\x9d\x7f\x7f\x1c\x18\x80\x36\x25\x62\xf3\x46\x14\x38\x14\x28\x37\x75\x92\xfe\x8d\xaa\x28\xf2\x50\xda\xfe\xb3\xa1\x19\x3b\x5d\x87\x9a\x7b\x9d\x88\x74\x6f\xbc\x95\x44\x59\xb7\x41\x71\x42\xe9\xe3\x01\x3a\xe1\xc0\xd3\xbc\xc8\x99\x43\xd6\x07\x3c\x44\x08\x87\x5e\x9d\xce\xab\x85\x95\x38\xdc\xab\x30\x86\xa5\x2c\x6d\x87\xb6\xe8\x1c\xd1\x45\x8c\x21\x7a\x30\x56\x09\xc5\xec\x1f\xf0\x42\xfa\x3a\x7d\x0f\xfd\x50\x25\x5f\x1f\x19\x4b\xec\x35\x66\x26\xb1\x7b\x6a\x39\xbb\x46\x75\x86\x21\x27\x46\xb2\xaf\x42\xc9\xd3\x79\x73\x3c\x37\x4b\xa4\x56\x70\xbe\x6a\xfb\x58\xdf\x89\x30\x17\xbe\x12\x3b\x66\x74\x05\x72\x47\x6b\xdf\x27\x19\x12\x6f\x3d\x13\xfe\xdd\xd3\x2e\xca\xf4\x1f\x7e\x7f\xd4\x92\xce\x2c\xa9\xc0\x13\xa8\x94\xbf\x6a\xe5\x82\xb4\xad\x68\x02\xf5\x07\x8e\x00\x56\x01\x73\xd8\x45\x9e\x40\xa2\x30\x44\xcc\x0e\xd0\x62\x4e\x68\x63\x11\x1a\xf0\x33\x04\x45\xe1\xc1\x9e\x32\x3b\xbf\x44\xf2\x1c\xde\x90\xd0\x0c\x43\x4d\xab\x88\x32\x1d\x8e\x4b\x74\x4e\x9f\x85\xa4\x19\xbb\x7b\x7f\x44\x0b\xfa\x77\xe5\x2a\xaf\x94\xb7\x98\xd7\x3d\xfc\xfe\xfe\x60\x23\x2f\xd4\x39\xb7\x9c\x4f\xfe\x5f\x45\xa7\xb2\x62\x9e\x1e\x2a\x3a\x31\x09\xdf\x98\xd2\x5c\xa8\x66\xfe\xd7\xff\x72\x45\x3d\x3d\xce\x74\x9e\x2d\x40\x4f\x6b\x2f\x55\x6b\xce\x2f\x33\x74\x57\xdb\x30\x3a\xb0\x2c\x7c\xb1\x43\xd6\x9b\x47\xd4\xa6\x1c\xd8\xc2\xe3\xbd\xbc\x5b\xa0\xab\x33\x09\x0c\x89\xb7\x1d\x42\x6d\x4b\xe3\xeb\x1f\x27\x66\x90\x18\x33\xd7\xc4\x4d\x8d\xe1\xd1\xa3\x45\x79\x89\xad\x4a\x33\x5d\xbe\xe6\x81\xba\x23\x8e\x34\x06\x9f\x6f\xfe\xed\x4f\x95\x43\xb7\x14\x8a\x23\x81\x4a\x59\x1d\x74\xac\x05\xf1\xce\x93\x99\x78\xdc\x66\x1b\xd7\xcb\x99\xfd\x0c\x7b\xdb\x0e\x6a\xdb\x2e\xfe\xf5\xe8\x5d\x18\xe8\xb2\xef\x05\x2b\x3e\x7b\x89\x1f\xde\xb0\x49\xc9\x91\xa7\x44\xad\x26\x75\x7a\x32\xf9\xb2\xa6\x7b\xb1\xf2\x05\x26\x66\x96\x4f\x1d\x84\xce\xbd\xb2\xaa\x15\x3c\xda\x5a\xab\x6c\x66\xae\x2f\xcd\x8b\xa7\xa1\xde\x0f\x2c\xdb\x99\x0b\x44\x6d\x77\x1a\xe4\x58\x9a\x1d\x07\x3b\x88\x19\x99\x61\xc9\x81\x25\xa4\x15\xc0\xcd\xc6\x42\xf7\x01\x49\xc9\x7a\x79\x6b\xdf\x17\x4a\xf0\x52\xe8\x98\x6e\xb1\x2d\x4e\x64\xb8\x11\x81\x82\x6c\x96\x52\xeb\x70\xa9\x27\x6f\x65\x61\x5d\x38\x33\xb9\xea\xc1\x26\x37\x5d\x05\x09\x27\x5d\x51\xca\xa8\x5e\x82\x10\xb6\x33\x23\xb3\x81\x08\xe5\xb6\x30\x27\x22\x73\x4a\x71\x34\x91\xe1\x03\xef\x06\x60\x0e\xe6\x29\x44\x96\xf2\x21\xc7\x2f\xff\xc6\x95\xa6\xa9\xa8\xb9\x6d\x61\x9a\x01\x80\x57\x62\x03\x4a\xb1\xdf\xdc\xe3\x89\xf2\xe3\x5c\x19\x2c\x66\x38\x31\x0d\xd6\xd0\xae\xa0\x65\xfb\xd4\x68\x3a\xa2\x58\x50\x14\x9e\x09\x48\x50\x4e\xe5\x45\xe9\xd7\xc6\x17\xa3\xdb\xc4\x6e\x46\x74\x47\x33\x89\x38\xc9\x69\xbb\x04\x73\x3c\x55\x7b\x54\x66\xe5\xe3\x20\x96\x0a\x19\x52\xef\xbd\xa0\x6b\x9e\xe2\x22\xd2\x17\xfb\x84\x85\x0c\x53\x76\x8a\xe9\x4c\x0e\x51\x47\xb7\xc0\xbb\x70\xa5\xde\xaf\x87\x17\x2f\xb9\xce\x42\x25\x79\x75\x8c\xa1\x42\x20\xee\x61\xf5\x5a\x92\xf8\x0b\xc1\x30\x51\x11\x3c\xb4\x21\x7e\xd8\x56\xbb\x42\xa0\x6e\xe0\x18\xd0\xf4\xef\xac\xfa\x28\x1d\x0c\x33\xb5\x13\x8b\xe0\x38\x63\x55\xd0\x4c\xe9\xfb\x36\x3c\xc3\xbf\x83\xe8\x1c\xd8\xd8\x89\xcf\x9c\x4b\xe7\xa9\xbb\x16\xf8\xa0\xd5\x62\x74\x14\x27\x91\x30\xaa\x4a\x23\x09\xd2\xc1\x63\xe1\x65\xf4\x9e\x92\x9d\x9e\xdc\x22\xad\xb7\xda\x7e\x51\x49\x06\xc7\x07\x55\x85\x7f\x12\xde\xf4\x65\x08\x3d\x4b\x9e\x03\x81\x29\xad\xf3\xc4\x25\x5d\x70\x55\x7c\x0e\x9e\x51\xd6\x31\x5f\x6d\xb8\xe3\xf8\xea\x1c\xbc\xd9\xa7\xf5\x99\xd8\xcd\x3d\xaa\x81\xfa\x69\xbe\x9a\x1a\x4c\x41\x2c\x40\x28\x69\x3a\xa9\x88\xf1\xd7\x06\x33\x90\x86\xc6\x61\x93\xb1\x68\x92\x0a\xde\xb1\xea\xfa\x8e\xf8\x47\x66\xdb\x24\x63\x0d\x84\x25\x26\xea\x5d\x17\x6e\x99\xa4\x94\xc0\xb5\x62\xcb\xea\x6e\xc5\xe3\x59\x4a\x9b\x66\xd2\x6a\xee\x9a\xa9\x18\xb3\x9e\xb0\x95\x5e\xf0\x90\xf3\x48\x64\x65\x5d\xbf\x38\x08\xfa\x30\xfc\xd2\xe8\x74\xa6\xba\x79\x3a\x95\xf2\xea\x72\x69\xc7\xf0\x42\x1b\x3d\xd2\x91\x6d\x8f\x6b\xb3\xc3\x52\xe7\x69\x78\x40\x53\x6f\xdb\x1f\xa8\xd2\xe2\x7e\x41\xc5\x6d\x9f\xb0\x3f\x83\x77\x3a\x23\xf8\xdb\x59\x8b\x3c\x9b\xe2\x0d\x37\x74\x43\x10\x43\x08\x20\x58\x89\x2f\x28\x15\xeb\xab\x95\x72\x2e\x34\x52\x76\x77\xe6\x23\x40\xb1\xbf\x00\x03\xc3\xe5\xdc\x77\x94\xf0\xc1\xd9\x9c\xa8\xe4\xed\x74\xec\x2b\xd2\xae\x7b\x52\x02\xad\x7b\x8c\x13\x6b\x2e\x8d\x09\x3b\xe9\x01\x72\x18\x14\x28\xb6\xeb\xc8\x56\xef\x81\xd8\x17\x71\x28\x22\x1f\x92\x59\x71\x33\x87\x5e\x90\xf5\xe6\xd5\x52\xd9\xc6\xf8\x54\x2d\xb9\x2f\xe8\x0f\x65\xce\xc0\x14\xc3\xdb\x7e\x64\x6f\xef\x61\xf6\xaf\x30\x54\xac\xf1\xae\xd0\x2a\xde\x95\x78\x4d\xcd\xff\x53\x79\x8a\x51\x4e\xf4\xcb\x5a\xa9\x42\xb3\xc4\xed\x79\xa1\x6b\x67\xd7\xc4\xec\xf5\x69\x49\xac\xcd\x65\x53\xaf\xc8\x49\x51\xe6\xb9\x10\x13\x58\x1a\x2b\xb7\x4a\x71\x69\xd5\x56\x1f\x0f\x1f\xf8\xc4\x3a\x0b\xe6\x78\x21\xa0\x00\xf9\xb0\x26\xef\xa4\x70\x39\x7c\xf9\x37\xa4\xec\xc7\xa5\xec\x99\xd8\x76\x0a\xef\x44\x10\xdd\x4d\x16\x31\xbc\x7a\xa8\xbd\x79\x45\x2d\xd9\x0d\x78\xc0\xb0\xf6\x79\x48\xac\x49\x89\x85\xcc\x03\x47\x95\x65\x2c\xe2\x60\xdd\xca\x3e\x18\xf6\xcd\x7c\x4c\x2e\xb8\xf9\xc4\xf6\xaf\x62\x7d\x57\x3c\xaf\x8d\x08\x8b\xec\x8f\xae\x82\xf3\xd9\x72\x85\x49\xbd\x09\x02\xdd\x7a\xf4\xa5\xa6\x3e\x57\xb4\xa4\x1a\xb3\x55\xe4\xa2\xcc\x11\x70\x85\xeb\x1a\x3b\x38\x86\xe8\x1e\x39\x68\x2b\x0e\x54\x3f\x2c\xc5\xad\xff\x76\x47\x97\xe1\x73\x3c\x6b\x04\xd9\xcd\xa5\xcf\x23\xbf\x0a\xdc\xa1\x50\x0d\x5a\x34\xa7\xd2\x8b\xc7\x1e\x0c\x42\x3d\x0f\xb3\x05\x82\x40\x03\x0a\x42\x88\x38\x51\x43\x16\x41\x27\xc1\x29\xba\x47\x2f\x91\xe0\x8a\xb7\xc7\xa0\xe2\xdf\xc3\x7c\x3d\x1a\xf2\x7d\x6a\x97\x82\xaa\x97\x52\x98\x4a\x8a\xf5\xea\xce\x52\x47\xb0\x8e\xa0\x28\x1e\x14\xbc\x43\xf5\x8a\x9f\x07\xbd\x2f\x28\x4d\x3b\x37\x48\x69\x72\x6c\xb9\xa8\x00\x5a\xe3\xc4\xc5\xbd\x8b\x99\x50\x06\x5b\x2e\xa0\xf3\x2d\x14\x20\xed\xaf\x53\x20\x64\x22\x86\x65\xa7\xbc\xf9\x67\x60\x27\xb2\x39\x64\x33\x1b\x06\x5f\x94\x77\x8e\x29\x20\x89\xcd\x69\xd0\x51\x02\x51\x9e\x1f\x4f\xb3\x2d\x1b\xfd\x78\xdb\xb0\xbd\xf5\x0b\x45\x03\x16\xf2\x48\xf9\x44\xef\xc2\xf3\x62\x10\xfa\x3c\xc6\x91\xb0\xe6\x97\x32\x36\x57\x9e\x27\xd1\xf4\xa8\xb7\x08\x55\x7f\x95\x11\x7f\x98\x48\x2c\x90\xa6\xd5\xf7\x51\xed\x0d\x8f\x33\x99\x74\x2c\x50\xa4\x73\xb1\x95\xca\xa7\x17\xec\x0a\x4d\xcb\x98\x5a\xf6\xdc\x2d\x69\x66\x27\x8d\x93\x3a\x9c\x64\x71\xd8\xbc\x8b\x0c\xa9\xf8\x6a\xba\x3e\x6e\x1b\x55\x47\x67\xae\x0e\x5a\x07\xf6\x75\x0a\x57\x42\x82\x26\x69\x7a\x1a\x4c\x82\xf1\x86\x15\x8e\xb5\xb7\xf1\xaa\xc9\x71\x2f\xbd\xbd\xde\x8b\x19\x55\x21\x9e\x3a\x29\xe2\x31\xad\x27\xfa\x1d\x69\x38\x4d\x68\x0b\x47\xcf\x1f\x5e\x71\x33\xeb\x4b\xc3\x91\x3a\xd1\x29\x23\x3b\xd9\xa3\xcb\xff\x29\x5a\xc4\xad\xd4\xef\x2f\xe6\x47\x9f\x50\xf5\x0f\xcc\x2c\xb9\x14\x0f\x19\x49\xb1\x60\xb1\xcf\x27\x9b\x2e\x3d\x48\xe4\x23\xe7\xb4\xf5\x17\x02\xf7\xe5\x8a\xab\x44\xd0\x60\x94\x82\x34\xdb\x69\x61\x24\x81\x8e\x19\x3c\xb0\xe0\x80\x47\x33\x75\x4c\xf3\x99\x20\xaf\xc4\x45\xc6\xf8\xc8\x6a\xed\xca\x74\xe0\xec\x66\xd0\x8c\x04\x3d\x54\x32\x12\xce\x9b\x13\xd4\x79\x45\xb8\x0e\x04\xd4\x8f\x25\x91\x13\x4e\xa6\xa2\x34\x95\x39\xf4\x54\x8a\x60\x49\x54\xc0\x50\x30\xf9\x1e\xda\x45\x35\xc5\x38\x5f\x10\xa0\x8e\x05\x4c\x42\x36\x38\x51\x40\xa5\x55\xc0\xf4\xd2\xb6\xed\x92\x37\xf3\x68\xc5\x33\x92\x04\x05\x8f\xd6\x67\x13\x6f\xca\xd8\x2a\xe2\x44\x70\x2d\xd4\x99\xde\x27\xf9\xcd\x4b\x06\xe3\xe6\x00\xdf\x8a\xfe\x32\xb9\x48\x7c\x79\xa0\xfd\x66\x6a\xc3\x97\xcd\x43\x2b\x05\xd3\xf1\x53\xc1\x17\xba\x3b\x87\xf4\xab\x59\x51\xd6\x10\x00\x07\x87\x12\x73\x9a\xcf\x20\x94\x2d\x03\xe1\x93\x89\xa6\x1a\x79\x4e\xe6\x3c\xc3\xe1\xb3\x53\xbd\xd0\x34\xac\xa5\xf3\x69\x35\x9d\x05\xab\x89\x12\x17\x83\x5f\x54\x69\x69\x40\xba\xa4\x94\x9a\x7f\x57\xa5\xed\xc4\x57\xee\x51\xfa\x76\xed\x7c\xc2\xc8\x8a\x03\x00\xd4\xc8\x8c\x75\xaf\xfb\x80\x1a\xe8\xd5\xbe\xb0\x32\x4e\xc6\x98\x28\xa3\x0a\x1d\x1e\x3b\x59\x27\xdf\x80\xb8\xf4\xeb\xb1\xe7\x49\x82\x02\xba\x6d\x3a\xc0\x53\x1d\x64\x34\x09\x63\x5b\xed\xc0\x90\xf3\x2c\x9f\x36\x17\x1b\x2c\x54\xd3\xd0\x78\x6f\x7d\x5a\x44\x21\x33\xc4\x3c\xf3\x44\x99\x02\x0b\xac\xb3\xc4\xd1\xe4\x4e\x1c\xc3\xb7\xd2\xa4\xb3\xce\xbb\x18\xc4\xdf\x3f\xbe\x80\xa9\x0d\x53\xe1\xb1\x44\x84\x5c\x07\x02\xa4\xd4\xa4\x76\x7a\xb1\xb7\xad\xa6\x0d\x26\x21\x7d\x3f\x3f\x55\xf5\xf3\x36\xb9\x0c\x95\x43\x64\x8b\xc5\x0e\x66\x3f\xf1\x20\x91\xc2\xcd\x69\x91\x94\xc8\x6d\xe1\xdd\xa7\x54\xbc\x3a\xb2\x5d\xac\x7b\x4d\x2a\x6d\x74\xa9\x31\x9f\x34\xc5\xc2\x1f\xed\x65\x44\x15\xeb\xe6\x52\x17\x28\x39\x33\x11\x20\x02\x20\x49\x44\xcf\x79\x9f\x22\x71\x92\x5e\x31\x10\x74\x60\x60\x3f\xb5\xb7\xc6\xb3\xf0\xe9\x31\xdf\x85\xd8\x49\xf7\x18\x89\x6a\xf0\x5c\x3f\x91\x78\xf5\x8b\x93\x16\xc9\x11\xb8\xff\x5e\x63\x18\x62\x50\x38\x6c\x51\x11\xd3\x28\xf9\xf9\x64\x8b\xca\xfd\x2f\x4d\x62\x8a\x47\xa4\xc8\x16\xaf\xdd\xd2\x89\x79\x54\x76\x73\x91\xfc\x81\xba\xa0\xc1\x3b\x38\x03\x1d\xd2\x45\xc4\x18\x3b\xe3\x8c\x7c\x0d\x94\x01\x57\xae\x13\xb2\x25\x4e\x0c\xc1\xf0\x28\x2e\x60\xad\x13\x24\xd0\x2c\xde\xf1\x83\x30\xac\x76\x2f\x8e\x83\xab\x46\x11\xae\x79\x93\x50\x24\x2a\x06\xf4\xf1\xcc\xbf\x7e\x7c\x02\xfe\xd0\x38\x8c\x86\xdd\xd3\x0e\x99\x54\x1b\x86\x0a\x39\x6c\xbe\x73\xa8\x08\xb2\x9e\x76\x20\x60\x31\xc2\x10\x2e\x85\xe8\xa3\x42\x36\xb3\x16\xab\x6e\x1e\x0a\x79\xa1\xdc\x3f\xd3\xef\x45\x29\x90\xf8\x0a\x48\x54\x2a\x10\x27\x25\x14\xf5\xb2\x03\x0e\x77\xf1\xe7\x99\x06\xc5\xdb\x3e\xbd\xd1\xbd\x87\x36\xc9\x6c\x99\x72\xb5\xc2\x7a\x49\x29\x11\x9b\x32\x62\xfe\x32\x74\x0c\x2a\xc7\x70\x27\x46\xc9\x4b\xe0\xb9\x15\xc0\x7c\xf1\xaa\x80\xa0\xa4\xde\x58\x8c\xb0\x8a\xe4\xec\xc8\x07\x78\x76\x9a\x89\x40\x07\x52\xac\x45\x21\x28\xa3\xbf\x64\x5a\x23\xbb\x91\x07\x8b\x9b\xc5\x0d\x72\xe4\x38\x71\xba\x40\x16\x12\x32\x38\x38\xb1\x95\x98\x22\x92\xfa\x27\xeb\xbd\xbd\xc5\x54\x78\x0c\x85\x23\xb3\x93\x91\x08\xcb\x89\x77\x4f\x63\xc7\xa9\x21\x1d\x88\x93\x11\xe0\x7e\x25\x3c\x87\xdf\x2f\x60\xe7\x37\x95\x42\x9d\x24\xa3\x57\x01\x44\xce\xd4\x0c\x9a\x5d\xd1\xef\x10\x9f\xc6\x75\x99\xd9\xa6\x6a\xaa\x54\xcc\xdb\xde\xfa\xab\xb2\xf5\x5f\x78\x64\x2f\x11\x51\xa7\x05\x4a\x27\x55\x2d\x0a\x27\xa8\x2d\x5a\x23\x72\x4a\x0b\xa4\x73\x57\x78\x2a\x99\x0a\x2f\xe4\x76\x80\x88\x7c\x80\x90\xd5\x8b\x8b\x85\x19\x00\x81\xde\xff\x81\xc1\x4e\xf5\xd7\x5e\xbb\xc6\x31\xb7\xed\x8a\x16\x52\x87\x94\x1d\x8a\x4a\xa8\x54\x7f\x62\x72\xd7\xd9\x37\x68\xe3\xe0\x7c\xb7\x95\x0a\x76\xca\x0f\x2c\x4a\x38\xba\xce\x50\x23\x73\xb3\xed\x5a\x80\x38\x17\xed\x90\xc8\xaa\xb2\x39\xd5\x1a\x73\x0b\x16\x3c\x05\xff\x4f\xe7\x82\xbc\xdd\x43\xda\x44\x49\x20\x7e\xca\xa5\x50\x04\x86\xd7\x89\x71\x66\x49\x9e\x27\xaf\x27\x88\xad\xdc\x3c\xbd\x32\xc9\x61\xc9\x8f\x80\xa0\x0f\x14\x1a\x64\x4e\x4e\x92\x89\xbf\xfe\x99\x31\x38\x4f\x2a\x93\x1b\xe6\x24\x62\x6f\xbc\xc5\x43\xa5\xd1\x29\x5f\x92\xdc\x5e\x76\xbd\xd5\xcb\xe7\x87\x2f\x99\xd3\x76\x8f\xa5\x39\x61\x64\x72\x05\x65\x3b\x92\xc7\x9b\x01\x76\x2d\xa8\x2e\xe6\xf7\x4f\xff\x86\x12\x08\x44\xb3\xa9\x5b\x1e\x39\x55\x16\xe8\x6d\xb9\x58\x79\xdd\x0a\x35\xf1\x50\x33\x66\x31\x03\x05\xba\x18\xd7\xb2\x82\xae\xa2\x19\x19\x6a\xbd\x03\xbc\x51\x65\x07\xd6\x75\xfd\xe6\x70\x69\x39\x90\xbc\x6d\x40\x53\xaf\x20\xae\x83\xc9\x8b\x12\xb4\xaf\x22\xa7\x43\xcb\xc4\x44\x65\xcb\xcb\x3e\x40\x8f\x64\xe0\xa4\x4e\x25\xe6\x04\xc7\x02\xcf\x09\xbd\x92\xff\x53\x09\x69\x8c\x33\x32\x8a\x93\x2b\x99\xfe\xc6\x26\xaa\x54\xef\x20\x13\x01\x4d\xea\x97\xeb\xbf\x15\x27\xfd\xe3\xf3\x8b\x24\x62\x9b\xa3\xda\x52\x91\x93\x48\x0e\x63\xb3\x7f\x64\x9d\x38\xbc\x81\xd7\xc0\xc2\x37\x8d\x62\xb0\xfd\x1e\x90\xb2\x01\x0e\xfb\x43\xfa\x83\xa5\xb6\x6b\x2c\x5c\x26\x4b\x7b\x62\x82\xd3\x1d\x59\xae\x51\x78\x8c\xf4\x80\x2c\x72\x20\xd7\x43\xa1\x0a\x87\x15\x25\x4f\xae\x7b\x18\xf0\xa9\x0b\xfa\x0e\x6e\x24\xe4\xa0\x13\x32\x69\x60\xa7\x50\x2b\x84\xf4\xc5\x5c\xc5\x4b\x00\x9a\xcb\x1d\x62\x86\x06\x29\x6e\x13\xfc\xae\x2b\x05\x9c\xfd\x2f\xb8\x8e\x37\x05\xe1\x45\x31\x00\x5f\xab\x66\x53\x72\xc6\x96\x18\x3c\x29\x0e\x74\xa7\x81\xf0\x39\xb3\x3f\xbe\xb0\xe6\xee\xf9\x09\xe3\xad\x33\x8f\xba\x2b\x39\xb7\x3a\xab\x28\x83\xbb\xc9\x91\xfe\xa4\x59\xa6\xb5\x58\x02\x7b\x2d\xf6\xe9\x32\x31\x4f\x12\x6a\x13\xc7\x9d\xde\x82\x8f\x58\xa1\x97\x20\x63\x59\x21\xff\x73\x2b\x31\x81\x2e\xf2\xf0\xf3\xf1\xfe\xf5\xc9\x76\x1c\xf2\x07\x3c\xef\x8d\xfd\x73\x61\x7f\x7b\x67\x07\x8b\x93\x39\x68\x92\xcc\x62\xd1\x99\xf8\x41\x57\x2f\x9c\x14\x37\x76\x54\xd7\x79\x2c\x58\x80\xc3\xc7\x2f\x50\x8a\x53\x47\xfe\x8c\x5c\x18\x16\x38\x85\x83\xd2\x9f\x17\x46\x43\xce\xae\x41\x37\xd3\xb9\x34\x99\x4a\x30\x83\xdb\xd3\x3b\xb4\xd0\x5f\x9c\xf1\x43\xde\x04\x21\x5d\xa6\xec\x81\x22\xcb\x90\xb6\x10\xab\x00\x2c\x4b\xbb\x0b\x3f\x74\x8d\xe2\xe2\x59\x58\xca\xa6\x53\x59\x89\x1c\x09\x81\xaf\x39\x2a\x6a\xdb\x30\xbf\x40\x0d\xb0\xb1\xf4\xe5\x9b\xf4\xaf\x42\x4e\xb3\x85\x22\x69\x44\x45\x81\xbb\x6c\xe1\x31\xb0\x15\xe4\xe3\xe3\x40\x7a\x57\xd5\x9d\xdd\x9d\x82\x5e\x46\xf2\x71\x22\x31\xa2\x27\xce\x99\xd6\x50\xc5\xc2\x77\x5d\x1c\xbb\x64\xdb\xc5\x93\x60\xb5\x47\x3f\x81\x17\xdf\x54\x3e\xca\x43\x71\x33\x55\x48\x30\x99\x1f\x64\x24\xba\x5e\x54\x91\x73\x68\xe9\x0f\xce\xae\x39\xf9\xe7\x16\x4f\x61\xbb\xcd\x07\x28\x78\x64\x68\xd5\x02\x17\x15\x46\xb4\x19\x0a\x97\x51\x6d\x8b\xcd\x42\x48\x9f\xfd\xbb\x62\x9d\x49\x0d\xf2\xa6\xc5\x37\x32\x9e\xc5\xd2\x91\xce\x1c\x38\x21\x39\x77\x2d\xe2\x39\xde\x62\xb9\x67\xf7\x6c\x61\xf6\x79\xd3\x4b\x4f\x8e\x83\xba\x05\xac\xd2\x53\xdf\x39\xab\x45\x2d\xfd\x87\x7a\x13\x67\xca\x81\x49\x4a\x25\x2e\x79\xdf\x22\x61\xf4\x11\x16\xce\xfe\xff\x12\x34\xd7\xc8\x7c\x1c\x36\xb5\x99\x6f\x41\x90\xf4\x30\xbc\xa0\xe8\xdb\x2d\x15\x42\xd4\x66\x49\x82\xaf\x34\xfb\x2c\xfc\x30\xb0\xf2\xf0\x4d\x3d\xb3\x48\xb4\x80\x00\xf4\x43\x21\x15\x32\x9f\x81\x49\xdd\x34\x79\x97\x9c\xdf\xe2\x3d\x2e\x77\x15\xd3\x12\x51\xf5\x22\x62\x98\xf5\xd3\xe1\xd6\x81\x34\x4a\x63\x2c\x3d\x57\xa6\xb0\x82\x28\x3c\xb6\xc4\x6e\x81\x60\xc6\x41\xa0\x50\x2d\x06\x36\x9c\x86\xe3\xf3\xf3\xb3\x0c\x1f\xb2\xe5\x6b\x79\xc8\xdb\xac\x7c\xe1\x74\xcb\x1f\xa5\x69\xb9\x64\x4e\x47\xe2\x10\xa9\xa5\xdb\xbf\x36\x0e\xa5\x19\x3d\x36\x06\xd9\x8f\xcb\xce\x94\x27\xd6\x9f\x0b\x5d\x18\x79\x97\x95\x7d\x64\xaa\xe0\x97\x26\x72\xb8\x70\x67\xaf\x57\x05\x62\x6a\x1e\x44\x02\x9b\xb9\x3a\x8b\xc7\x48\xdf\xa5\xca\xc0\xf6\x72\x59\xcf\x7b\xd7\x91\xb5\xdd\x25\x1f\x2c\x9f\xe6\x38\x46\xf1\xf8\x7c\xbe\x01\x09\x43\x25\x51\xa0\x3c\x1e\x11\x39\x6b\xe8\x55\xb0\xcb\xbd\x16\x9d\xb7\x39\xae\xc4\x56\x17\x1a\xed\xda\x51\x50\x15\xa2\xc0\x07\xcc\xc8\x7f\xf0\xe0\xdb\x63\x80\xba\x78\x3f\x1e\xc8\xcc\xe9\x05\xdc\x89\x81\xe5\x0a\x42\xce\x0a\x19\xba\x20\xc8\x4a\x50\x0e\x5c\xd3\x8b\x7c\x37\x7b\x8b\xeb\x58\x49\x47\x81\xf4\xdf\x2e\xa7\x58\x4d\x9e\xde\x1b\xeb\xe7\x11\xec\x71\x70\xd4\xeb\xe5\x0b\x31\x85\xa9\x02\xd3\x89\x81\x85\x9d\xd2\x72\xed\x8d\x74\x5b\x81\x9a\x83\x0f\xa2\x5d\x34\x1d\x29\xd7\xe7\xd8\x6c\x2f\x2f\xb3\x2d\x42\x5c\xfd\xe5\x60\x95\xa5\x6a\x5f\x67\xb6\x30\x10\x90\x25\xd2\xc2\x32\x01\xa4\x9c\x6a\x91\x8e\xb0\x73\xae\x21\x71\xe8\x5d\x03\x51\x8c\x9d\xa0\x8f\xe6\x38\x9f\x03\x77\x4e\x6e\x4f\x4d\xf6\xc8\x67\x6a\x89\xf9\xdf\x0a\x27\xaa\xa3\x81\x04\xec\x5b\x89\x12\xf3\x26\x08\x0f\xe1\x2a\x80\xc8\x76\x3a\xf6\x9b\x2a\x5d\x8e\xc7\xa3\xd7\x85\x15\x4d\x15\x55\x98\x1a\x01\x0a\x1a\x4f\x6d\x96\xa7\x5d\x48\x0c\xac\x49\xf5\x82\x56\x54\x40\x37\x2d\x72\xf7\x3a\x11\x2c\xce\x0e\x39\xa2\x2b\x24\x62\x23\x68\xbb\x28\x5b\x3f\xd2\x4e\x6c\x5e\x52\x27\x03\x88\x97\x1f\x05\xd9\x9f\x23\xb9\x19\xa7\xbc\x30\x2c\x36\xdb\xcf\xf3\x82\x26\xc7\x85\x19\x12\x1d\x8e\x73\xe9\xbc\x7b\xbf\x7f\xcf\x77\x08\x0a\xc6\x97\x41\x76\x7c\x52\x40\xd6\x7c\x2c\x55\x49\x59\xf6\x73\x82\x2b\x4a\x88\x47\x86\x22\x52\x9d\xda\x45\x74\x6a\x1e\x1c\xbf\xa0\x4f\xc2\x9a\x1f\xd8\xc3\x72\xf8\x78\xb7\x7f\xbe\x64\x6b\x60\xaf\xb8\xbb\x89\x3c\x5b\x3f\xbf\xfe\x5d\xfd\x4f\x99\xd0\x04\x2c\x36\xe7\x5b\x21\x51\xec\xa9\xd3\xe2\x38\xb6\x27\x97\x45\x3c\x7b\xbb\x48\xea\x96\x2e\x3f\x48\x87\x02\x01\xa4\x43\x56\xb8\x7c\x84\x9d\x36\x4b\x23\x34\x05\xa2\xca\x17\xe4\x6a\x16\xb1\xbb\x17\xe2\x45\xcd\x91\x4a\x25\x32\xde\xc0\xf2\x07\xf1\x5a\x52\x83\x6e\x75\x10\x18\x13\xcd\x70\x27\x18\x2e\x6f\x8b\x02\xd6\x46\x54\x6b\xe6\xff\x08\x65\x3d\x7a\x57\x10\xc6\xe7\xe5\x65\xeb\x5e\x2c\xd4\x1b\xeb\xd4\x3e\x39\x4c\x5d\x8e\xd9\xdb\xc2\x59\x3b\x1d\x84\x45\xc0\xb9\x63\x13\x04\x5c\x26\xd3\x5f\x2c\x00\x85\xd7\x9c\x89\xab\x98\x9b\xfa\xb0\xa8\x6c\xe7\x84\x76\x58\xe5\x4b\x62\x16\x5c\xfc\x35\xcc\x0e\x6f\x35\x7c\xfe\xbe\x60\xe5\xfb\x7c\x03\x7a\xc9\x91\xf9\xfd\x40\x9e\xb3\x8b\x85\x06\xdc\x16\x77\xa5\x8a\x23\xf7\xfb\x43\x75\x68\x8e\x7e\x9d\x14\x6c\x0b\x6e\x61\xc6\x92\xe8\x38\x5a\x4d\xc4\x56\x2c\xff\x30\x87\x1c\x33\x87\xb5\xcd\x05\x61\xe0\xa4\x05\xf9\x55\x8d\x53\xdf\x83\xe3\x0f\xb0\x10\xd3\x39\xeb\x01\xa9\xbb\x5c\xaa\x3c\x53\x8e\xd3\xb6\x60\x31\xc3\xf3\x29\x8b\x1c\xbc\x48\x86\xd0\x29\x45\x41\xed\xda\xbc\x35\x08\x0c\xcc\x73\x0f\x72\xd6\x4c\xae\xc8\xd3\x6b\x7b\x3b\x05\x71\x7a\x79\x3a\x5d\x85\xf3\xfd\xae\x73\x53\x10\xf9\x75\xe9\xa9\x72\x1c\x11\xca\xfb\x63\xa9\x7c\x5e\xbd\x2f\xd6\x7f\xc5\xd1\x37\x64\x54\x35\x33\xc1\x8d\xbc\xbd\x48\x3f\x9e\x3e\xa6\x84\xe9\x8a\x87\x79\x30\x4a\x44\x99\xf7\x4a\x80\xed\x68\x3e\x2b\x81\x2f\x99\x74\xe0\xe1\x36\x3d\x1a\x7a\x43\x4a\x89\x8b\x8d\x18\x98\x83\xff\x6d\x3e\xd7\xff\xfe\xef\x41\x48\xcb\x3a\x48\xa9\x6c\xe4\xd6\xb0\xa7\x4e\x9e\x0a\x20\xf1\x65\x63\x9b\x92\x65\x82\x5f\x63\x24\xc1\x3e\x55\x0f\xb8\xfd\x42\xea\xdd\x3c\x4a\x13\xca\x3e\x67\xd4\x7a\xcd\x88\x35\x61\x2e\xf0\x20\x85\x4d\x1c\x4d\x07\xe9\x1e\x58\xa8\x33\xa7\xbc\xc0\x29\x2d\x88\x74\xf1\x20\xcb\x0b\x41\xcb\xbd\x59\x71\x92\x2d\xba\x6c\x36\x0f\x6d\x76\x26\x33\x45\x4b\x05\xa5\x49\x64\x6c\x5c\x0a\x4d\x99\x56\xb1\x3b\x2c\x06\x75\xe7\x6e\xc9\x84\x87\x99\xc7\x90\x7b\xe6\x67\xbe\x7f\xfc\xbb\x12\x5b\x42\x85\xf2\xc9\x18\xef\x84\x6c\xc9\xcd\x43\x5f\x38\x74\x47\x2a\xcd\xe9\xa7\x9d\x19\x37\x13\x1a\x46\x51\x7f\xfd\x3c\x0e\xc6\x47\x5d\x70\xc7\x97\x3d\xf8\x3d\x1c\x7e\x0f\xac\x37\x80\xdf\x9c\xdd\x1e\xa1\x50\xbe\x4f\x25\x11\xf0\x9f\xa2\xb7\x87\xd4\xac\xcf\x5d\xd3\xb2\x31\x85\x71\x36\xff\x2e\x52\xdb\x82\x4f\xa0\x52\xee\x9b\x05\x26\xb5\x40\x1e\x55\x6a\x1c\x04\x8c\x74\x36\x1c\xa5\xb1\xe6\xfe\xc1\x20\x34\x11\xb8\x8e\xee\x56\x68\x68\x6f\x5b\x98\x89\x2c\x01\x28\x80\xf1\x78\x57\x1a\xf1\xe3\xe5\x22\x78\x86\x66\x0c\x7a\x6d\xee\xf2\x9f\x52\xbb\x80\x02\x9d\xfb\x66\xcc\xe9\xe2\x22\x38\xa3\x84\x99\x3c\x56\x83\x5f\x38\x48\xc1\x44\x11\x0e\xfb\xd5\x7d\x7f\x7f\xff\xbe\x63\x8d\x40\xcc\xc6\x8c\xf9\xe4\x48\xc6\xca\xb9\x7d\xb7\xd2\x0d\x47\xc6\xea\x83\x16\x5c\x29\xf3\x4e\x41\x9f\x99\x6f\x35\x4c\x84\xa5\x10\xca\xfa\xd8\xac\x0a\x8e\x6b\x54\xf7\x5c\xde\x27\x8d\x18\x10\x8e\x85\x33\x3e\x0f\x3a\x9f\x15\x0c\x9c\x39\x39\x89\xeb\xcb\x69\x08\xc7\x37\x24\xcb\x5f\x03\x48\x6f\xb3\x3f\x73\x03\xda\x6a\xaf\x29\x55\x7f\x15\x74\x10\x78\xd3\xdf\x2d\xac\x3a\x4a\xbd\x20\x9a\xe4\x89\x17\x87\xe0\x68\x3a\x8b\xbb\x5f\x78\xff\x2c\xaa\xab\x33\x33\x20\x88\x94\x4c\x9d\x9a\xa9\xa6\xb7\xbf\x2c\x84\x81\x84\x53\xf3\x4b\xc3\xb6\x09\x43\x9c\xed\x06\x61\x42\x73\x7e\x35\x1c\x8f\x25\x3f\x29\xbc\x27\x48\x3c\x88\xfa\x92\x64\xbe\xf9\x77\xa5\xd1\x37\x45\x44\x45\x58\xd8\x17\xfa\x35\x33\x1a\x0f\x11\x1c\xc4\x57\xa7\x8a\x66\xe8\xf9\x6b\xfe\x1f\x2c\xb3\xfa\x8f\xff\x0f\xef\xfe\xd5\x91\xac\xa9\x99\xa8\x52\x13\xba\xd1\x65\x35\xe7\x7f\x7c\xfb\x77\xc5\xa4\xf6\xa5\xf8\x72\xca\xa3\xcf\x41\xcc\x00\xf9\x92\x49\x0b\x36\x9b\x07\x93\x5a\xc1\x33\xfd\xbb\x62\xe3\x5e\xaf\x10\xa5\x76\xa8\x51\x45\xd0\xa6\x2f\xb2\x49\x2a\x1c\xa4\x11\x79\x25\x98\x96\x3e\x6c\x2c\xd9\x15\xbf\x3c\x15\x36\xe0\x57\xc1\x12\x12\xe2\xcd\x1a\x03\xdd\x65\x52\x65\x01\x02\xe3\x77\xfa\x56\x1a\x31\xb0\xc3\x3c\x3b\xfe\xb6\x15\x32\x9f\xbb\x22\xca\xa8\x64\xa8\x89\x2a\x15\x68\x1f\x1e\xa1\xe6\x2e\x8b\xb1\x9c\xe9\xde\xbc\xf0\x74\xfc\x0b\x4f\xc6\x70\xf6\x37\x24\xd3\xb4\x38\x6c\x22\x25\x38\x32\xba\x9a\xf9\xe3\xce\x5b\xab\xbd\xb9\x16\x7f\x81\xbe\xab\x45\xc4\x19\x90\x18\xcf\x25\x73\x52\xdc\x25\x9f\xc1\x3f\x09\x1e\x11\xd6\xfb\xe4\xc4\x1e\xca\x3c\xb0\x9b\x09\x04\x72\xdb\xcf\xc8\xa1\x21\xc5\xde\xbc\x10\xd3\x69\x54\x04\x80\x86\x7e\xfa\x73\xa5\xf1\x05\x05\x5d\xe6\x38\xd9\x39\x5b\x43\x5b\x08\xaa\x44\x3e\x6b\x4e\x41\xb5\x87\x41\xd8\x34\x11\xfc\x9a\x99\x0f\xa4\xf9\x33\xb7\xb9\xe7\xca\xbc\xba\xc5\x1a\x4f\x9d\x2d\xa2\x12\x1d\x63\x53\x38\xd9\x6a\xd1\xa2\x7b\xe2\x83\xca\xb6\xb5\x6b\x51\x9f\x91\x64\x9e\xdc\xad\xaf\xdc\x39\x17\xd8\x29\xb0\x39\x9e\xcf\xdb\x5f\x4a\xe2\xc1\xf3\x22\xac\xaa\x2c\x8f\x75\x28\x3c\x1f\x9b\x88\x6e\xbc\xc6\x7e\x26\xf8\x54\x33\xce\xec\xb6\xa9\xba\xdb\x2e\xf6\xda\x06\x54\x57\xb9\x39\x1a\x7e\xd4\x93\x67\xa7\x8f\x0f\x76\xf3\x21\x55\x26\x22\x42\xdb\x34\xa6\x18\xbc\x86\x26\xd6\xbd\xe4\x03\x5e\xd9\x6a\xbc\xee\x13\x46\x4b\x56\x64\x69\xf0\x67\xe2\x54\x26\x2e\xfa\x3c\x08\x6c\x84\xb0\x57\x79\x22\xba\xca\xbb\xd3\x2e\x05\xd5\xd4\xf4\xca\x25\x2e\xa3\xc6\x48\x78\x4e\xf1\xc4\xac\x13\x0a\xc7\x28\x4f\x1c\x68\x33\x0e\x1f\xc7\xcf\x77\x82\x53\x93\x1d\x51\x98\x4b\x8e\x59\x60\xa6\xb9\x8c\x19\x0b\x02\xff\x76\x9c\x7b\xa3\x92\x85\x0a\x52\xb2\x63\x60\x40\x3c\xe8\x14\xab\xc9\x23\x2f\xb8\x84\xe5\xd8\x1e\x9b\xf7\x99\x75\xe9\x2b\x47\x7f\x99\x3e\x26\xee\xed\x71\x37\xb5\x88\xb2\x5f\xa1\x1a\x74\x6a\xc4\xbc\x2f\x8c\xbb\xd6\x5e\x69\x1d\x51\xf0\xa3\x60\x17\x8e\xf5\xbb\xbf\xcb\xe1\x35\xb7\xfa\x96\x21\x7f\xec\x09\xec\xf3\x99\xcb\x89\x71\xc1\x42\x98\x74\xaa\x95\x98\x5b\xb2\x0b\xb3\x6a\xde\xc5\x4e\x2e\xc9\x49\x8c\x67\x67\x01\x51\x0e\x47\xc8\x6d\xed\x03\x53\xe1\xc1\x79\x6e\x13\x9e\xc3\x7a\x5f\xbe\x45\x49\x2b\x0a\x7a\x8d\x5c\xa5\x57\x30\x0c\x62\xa5\xea\x4a\xab\x60\xcb\xf2\xad\xf7\xac\xd3\x71\x65\x5d\x77\x2e\x14\xc1\x4b\x10\x41\x47\x5d\x66\x23\x79\x58\x44\x4f\xfc\x51\xa8\x86\xa3\x18\x0f\x2f\x79\x7a\x30\x7f\x9f\x34\x99\xea\xf8\xe3\xdf\xf6\xe0\xfe\x90\x0e\xf9\x38\x7e\x79\x34\xed\x8f\xde\xfc\x1b\x52\xe4\x3d\x6e\x03\x79\x34\xa6\x6e\x66\x2b\xe4\x10\x9e\x61\x51\x30\xba\x48\x95\x43\xbf\xc1\xd5\x2f\xa3\x52\x5c\x75\xab\xcf\xdb\xeb\xb2\x7c\xe0\x11\xa0\x2b\x50\x8d\x5b\x69\x9a\xbf\xba\x7e\x47\x78\xfc\x89\x4d\x71\x9d\x53\x16\xb3\x0d\xac\x2d\x95\x29\xd3\x60\x27\x06\x02\x9a\x74\x7a\xd0\x09\x55\xd3\xb6\x0f\xcc\x62\x2e\x60\x63\x31\xad\x19\x70\x7d\xaa\xeb\x4e\x4a\xc7\x5c\xe9\xc0\x99\x78\xb0\xf8\x7f\x31\x9b\x3d\x26\x42\x55\x91\x36\xf1\x28\x29\x15\xe2\x6a\x27\x06\x9a\x84\x7e\x10\x19\xcc\xd5\xaf\x8d\xaf\xa0\xfe\xaf\xe0\x7b\xfa\x1a\x3e\xef\x4d\x99\x68\x37\x0b\x2d\x2f\x24\x04\x4a\xe2\x15\x0b\xe1\x1c\x03\x66\x02\x45\x57\x57\xcb\x3a\x96\xc1\x21\x8b\x2a\x36\x66\x4d\x61\xf9\x9c\xc3\x38\x30\xb8\x09\xbb\xad\x8a\x9f\xef\xcf\xcf\xba\x13\x65\x4a\xf3\xb7\x8a\xde\x5b\xc5\x79\x8b\x9e\x7f\x27\x09\xb4\xc6\x4e\xb6\xd3\x1a\x5a\xb6\xcb\xcf\xb2\xc9\x1c\x31\xd6\x01\x7e\xb9\xbd\x06\x81\x9b\xdb\x11\xca\x2c\x54\xbb\x40\xc2\x4e\x33\xd3\xd1\x4d\xde\x1b\x72\x1b\x38\x12\x57\x74\xf5\xf9\x35\xb6\xa3\x07\xbe\x1b\xe1\x65\x9f\x9e\x29\x30\x1e\xb5\x95\x84\x9b\x57\x06\x8b\x80\x58\xf9\x51\x91\x59\x05\xa7\xcd\xa9\x29\xa9\x90\xc0\x8b\x58\x01\xeb\x34\xc8\xaf\x0c\x65\x78\xf5\x2c\x5c\x1b\x26\xb4\xf8\x0b\x1d\xea\x04\x67\x36\x3e\xd5\x6e\x0e\xcc\x17\x6d\xc8\x13\x4e\x3c\x08\x3e\x8e\xd4\x37\xa5\x69\x6f\x59\x5e\xad\xcc\xad\x5b\x1f\x64\x32\x4b\x73\xfb\x5f\x8f\xcb\x56\x48\x4d\x83\x29\xb9\x07\xf9\x65\x5a\x67\x8c\x42\x55\xd0\x19\x39\x14\xb6\x95\x41\xca\x16\xe3\xaa\xd0\xef\xf7\xcc\x55\x47\xef\x2c\x5e\x71\x71\xa8\x36\xba\x63\x92\xf8\x6f\x3c\xd7\x5c\xf8\x20\x87\x91\x3d\x09\x9e\xdf\xa3\xbb\x83\x91\xa4\x38\x4f\x51\xe7\x29\xe6\xdb\x8e\xa2\x9d\xb3\x73\xd3\x77\x7b\xbc\xba\x42\x3d\x42\xc6\x21\x71\x20\xaf\x1f\xbd\xaa\x38\x1d\x28\x16\x15\x4a\xa7\xc7\xf3\x41\x6c\xa0\x8f\x39\x66\xb2\x3f\x09\x3f\xe0\xa3\xd8\xd9\x79\xe6\x33\x18\x09\xca\xb6\x37\xf8\xfc\x91\x46\x2b\x83\x51\xff\x7a\x24\xeb\x02\xbb\x31\x85\xaf\xc6\x2c\xaf\x8c\xd1\xf9\xf0\x66\x6d\x32\x8f\x9e\x5e\xcc\x31\xad\x73\x9f\x8c\x85\x9f\x53\x52\xe8\x0e\x89\xc0\x0c\x1e\xa8\x92\x66\xd3\x4e\xee\x63\x64\xe5\xaa\x8d\xf0\xad\xcd\x68\xf1\xff\xff\x82\x41\x10\x3a\xa0\xfa\x1e\xc6\x0e\x82\x8a\x14\x2b\x4e\x1d\xa7\x72\xb1\x38\x1d\x5e\x93\xe5\x50\x85\x54\x79\xe7\xa1\x55\x72\x18\xb7\x88\xa8\x38\x83\x88\x3c\x0b\xb3\xb9\x85\x38\x72\xc7\x42\x43\xed\x59\x53\x62\x4a\x9e\xa9\x7b\xc2\xa6\x3e\xfe\x36\x00\x41\x11\x83\x2b\x0b\x62\x18\xc7\xb8\x14\x17\xe8\xde\xed\x65\x6c\x4d\x7c\x45\x24\x59\x66\xfc\x73\x1a\x44\xa5\x49\x35\x75\x99\x5d\xcf\xfa\x10\x5c\x60\x5e\x2a\xc0\x5d\xd4\xa3\x0f\xba\x71\xaa\xce\x40\x0d\x78\xce\x9f\x44\xb8\x1c\x7b\x8c\xc5\xf7\xc9\xc1\xf5\x50\x40\xfc\xaf\xe1\x02\xfb\x82\x5e\x8f\x1d\x83\xbb\xb3\x38\x53\x42\x1b\x46\x0e\x12\x06\x3d\xf4\x58\xba\xa7\x46\x02\x34\xc5\x38\x4f\x7a\x60\x78\x2e\x69\x66\x1d\x80\x49\x6c\x7f\xea\xf8\xeb\xdf\x94\x47\x56\x22\x6f\x7f\xb9\x88\x75\x13\xfb\xbc\x13\xc8\xcd\x3c\xdc\x8b\xf0\xa9\xa2\x95\x9c\x77\x4e\xc1\xd2\x60\xc8\xd9\x01\x45\x43\xe1\x12\xff\x60\x19\xcb\xdb\xe3\xee\x84\x05\xd5\xb1\xa1\xcb\xf1\x27\x63\xee\xe2\x31\xac\xef\x82\xba\x80\xcb\x69\x5f\x0b\x5f\x80\x85\xad\xaa\x15\x8f\xc5\xec\x30\x06\xac\xd0\xc2\xc5\x33\x63\x2e\x1a\xea\xb9\xe3\x43\xa3\xe4\xdd\xf9\xd5\x08\x28\x9f\x0b\x0a\x49\x70\x0b\x1e\xff\xd2\x96\xd0\x78\x0e\x4e\xa4\xf2\x1a\x64\x0a\x7d\x4a\x11\x10\x4d\xf2\xfd\x39\xca\x0f\x7d\xd8\x47\xec\x3b\xc7\x49\x82\x13\x11\xd9\x25\x24\x75\x87\x5d\xb2\xe8\xf3\xbc\xc8\x5b\x6a\xeb\x46\x7e\xa9\x70\xe2\xd4\x7d\x4f\x0a\xe0\x1d\x40\xeb\x4c\x2f\x6a\xa0\x7b\xe7\x2e\x8e\x86\x13\x7b\x79\x56\x0c\xa3\xd7\xd8\x25\xc2\x1f\x39\xdc\x17\xdb\x9e\x39\x8f\x96\xbc\xd9\x30\x92\x9c\x1f\x7e\xd0\xbe\x0b\x28\x0c\x13\x81\x8d\x37\xb7\x20\x32\xb4\xf7\xcf\x90\xa5\x34\xdd\xff\xc4\x4d\x0e\xc3\x8d\x9b\x76\x4d\x6b\xc9\x40\x3c\xd4\x1e\x73\xf8\xfd\x79\xe7\x59\xda\xb7\x04\x5c\xe3\xd3\x47\x91\x81\x8a\xc2\x3b\xe7\x27\xe1\xc8\x5e\x14\xf4\x43\xa1\xe9\x58\xc7\x50\x46\xd4\x83\x7d\x9b\xc1\x85\x99\x4e\xfa\xad\x7e\x95\xa0\x45\xc7\xe4\x24\xaa\xc7\x73\xa6\x06\x37\xaf\x0c\xc9\x9d\x79\x4b\x80\xb9\x01\xa6\x25\x9e\x1f\x87\x2e\x10\x08\xbc\x9b\xed\x62\x1b\x6f\x30\x67\x89\x05\xd3\x8e\x10\xa2\x13\x86\x4c\x12\x43\x84\xa9\xba\x7c\x38\x65\xcf\x9d\x57\xe2\x2f\xf7\x9f\x6f\x47\x6c\x22\x10\xf5\xcc\x66\xd5\xb4\x12\x91\x58\x56\x1f\x4e\x85\xc6\x45\x73\xa0\xc8\x53\x94\xef\x9a\x17\xd0\xc4\x52\x62\xe4\x7c\x8f\xf5\xa5\xc5\xd8\x6c\x22\x94\xab\x2d\xe0\x17\xb5\x12\x9a\xaa\xcd\x58\xc8\x16\x80\x03\xd6\xaf\xeb\x7f\xf9\x17\xd6\xd3\x0c\x39\xd1\x13\x16\x30\xa9\xe4\x92\x97\x91\xb5\x54\xf6\xc0\x7f\x1c\x09\xcd\x32\xc5\x39\xd1\x45\xf3\xfa\xa2\xdc\x61\x4d\x06\x05\xcf\x4f\xe4\x71\x05\x49\x8b\x1d\xfb\x2c\x39\x7f\xf1\x85\x09\x1a\x71\x78\x13\x62\xa9\xb1\xf0\x13\x52\xfc\xdc\x38\xed\xff\x8e\x9e\x5a\x9f\xc0\x86\x68\xab\x0f\x17\xea\x2f\xb3\xe1\xf0\x5d\xc3\x6b\xee\x99\x33\x59\x57\xff\xa3\x79\xfd\xac\xbe\x62\x86\x39\xa5\xbb\x25\x74\xce\x49\x6b\xc8\x93\x7a\x13\x9d\xd6\xfc\xd0\x28\x4c\x30\xc7\x20\xff\xf4\xe2\x31\x98\x32\x55\x42\xed\x04\x04\x5a\x77\xf4\x19\xfb\x64\x0f\x91\xb5\x62\xde\x9d\x5f\x6a\x6c\x05\x06\x70\xe7\x99\x65\xa3\xcb\xe5\xc5\x67\xfe\xf7\x08\x4d\xbc\x39\x31\xf3\x88\xe0\xde\x9c\x40\xb8\xd6\x1f\x5f\x60\xbd\xd4\x1c\x1c\xb8\xc7\xaf\x59\x06\x22\x2a\x86\xa2\x08\x00\x60\xac\x7b\xfd\x64\x4c\x03\x1f\x11\x4b\x7f\xc9\xc3\x05\xcf\x5c\x4a\x03\x06\xa8\x33\x28\xf3\xfb\x36\x25\xd2\xbd\xaf\x9b\x36\xe0\xec\x72\xa5\x2d\x38\x02\xfe\xe2\x35\x38\x92\x64\x61\x18\x9c\xef\xca\x47\xbc\x16\xa0\x37\x3d\x5f\x0d\x49\x87\x53\xb4\x7d\x3d\x04\xa8\x19\x7d\xee\x2c\x95\xc9\x90\xe1\x10\xbb\x5d\x56\x77\x86\x5f\xba\xd0\x29\x8d\x1d\x84\x56\x23\x6f\x26\x8d\x3f\x1a\x1d\x81\x36\x31\x67\x80\xd3\x4a\x91\xfd\x25\x1f\xf5\xc0\x76\xfa\x47\x78\xb0\x0f\x7e\x56\xe4\xef\x4c\x01\x14\xcf\x42\x7f\x25\xce\x4a\x4c\xad\x42\x5d\x30\x9d\x4e\x61\xd2\x48\x5d\x71\x8f\x0d\x25\xa9\x75\xce\x6b\x9c\x7b\xfa\x30\xde\x33\x4a\x74\x77\xb4\xd3\xce\xd2\x4b\x78\x66\x61\x62\x54\xf0\x57\x33\x7b\xf7\x98\x57\x7a\x2d\x65\x18\x74\x18\x0b\x2f\xba\x60\xd8\xa6\xe5\xa9\x5f\xed\x99\x51\xe0\xf8\x14\x59\x5d\xec\x44\xf9\xde\x9a\xbe\xe5\xb4\xf0\xa4\x79\x35\x1c\x42\xa4\xce\x1b\xa7\xc4\x77\x11\x7c\x80\x6e\xf3\x55\x7a\xcc\x4b\xeb\x7b\xe2\xdd\xd7\x50\x9b\xf3\x52\x88\xe5\xec\xd1\xdc\x73\x04\x9f\x53\xfc\xf8\x2b\xf6\xa1\xf4\x72\x37\x65\xc0\x9c\xb9\x57\x0a\xf6\x90\x5c\x85\xde\xda\x91\x03\x9e\x5e\xed\xc7\x28\x0e\x51\x61\x3f\x88\xf7\x34\x2d\x63\xc6\x1b\xad\x24\xde\x96\xc7\x7e\x78\x9f\x0a\x59\x83\xc0\x93\x63\x93\xa1\xf6\x63\xf1\xd4\xd6\x79\x28\xfc\x2b\x28\x15\xa9\x78\x82\xd9\x6f\x34\xfe\xa5\xe0\x34\xfa\x4b\xd2\x0b\x01\x8d\x67\x9c\x9f\x1d\x9f\xec\xad\x9b\xea\x90\x0c\xa4\x1c\x40\xb3\xf7\x4a\x79\xb4\x10\x07\x08\xa4\xa5\xb0\xbf\xa0\xaa\xc4\xbe\x6f\x55\x08\xdb\x32\x17\xb2\x5d\xd2\x49\x24\xa4\x3e\x52\x33\x70\x54\xe9\x6b\xd4\xe0\x1f\x19\x98\xf7\xc3\x7d\xbc\xbf\x7d\x13\xc5\xe3\x6c\x4e\xc0\x3a\xc3\x02\x72\x35\x9d\xb7\x89\xab\xb9\x06\xc4\x73\x6d\x68\xd9\x1a\x3e\x3e\x54\xf3\xaf\xf3\xed\x86\x1b\xf0\x0a\x1b\x07\xa5\xb8\x43\xa9\x8a\x94\x07\x85\x1e\x00\x54\x0c\x15\x39\x68\x60\x18\x0a\x91\x45\x7a\x61\x85\xd5\x49\x05\x6d\xcc\x71\x26\x4c\xcd\x94\x0d\x5d\xcd\xe5\x42\x32\xd4\x74\x00\x7d\x59\xaf\x98\x0f\x8a\x13\x41\x32\x97\x4a\xa3\xd3\x96\x23\x07\xdb\x72\x48\x20\x3d\x0c\x0d\xce\x03\xe5\x17\x1e\xc4\x93\x39\x60\x20\xfe\xd4\x70\x44\x17\xb7\x25\x13\x99\x89\xde\x42\x9c\x09\xfa\x9d\xd3\xc4\x97\xd7\x72\xb7\x00\x0f\xa1\x2b\x58\x02\x05\x80\x4c\xf9\x08\x6c\x65\x0c\x33\xcb\x80\x7d\x1f\xf1\xa2\xd7\x76\x41\xa6\xca\x3b\x84\x54\xfe\x34\x13\xaf\x46\xac\xb4\x6c\x35\xeb\xe0\x19\x23\x56\xa9\xd5\x1b\xb5\x32\xfe\x15\x44\x09\x54\x2d\x18\xaf\xbc\x2a\xa3\xf4\xd7\xbf\x16\x9a\xfd\x3f\xfc\x06\x90\x7f\x53\x43\x10\x90\x10\x39\xac\x65\x8a\xa3\xed\x3b\x8a\x42\xe5\x48\x4c\xf1\xbe\x11\x88\x92\xeb\xf6\x41\x98\x6b\xdc\x97\x78\x21\xc3\xec\x38\x92\xbd\xab\x39\xff\xde\xee\x9f\xc8\x0e\xd8\x76\x2a\x3c\x40\x8f\x3c\x60\xf2\xa6\x9d\xd7\x1b\x22\x80\x1b\xc3\x5d\xc7\x31\x8d\x0a\x22\xa2\x26\x73\x4f\x0a\x85\x93\x26\xad\x01\x28\xba\x11\x6a\xf8\x94\x0d\x7d\x3f\x1c\x58\xbd\xf0\x80\x4c\x82\x84\xee\x1e\x66\x9f\x26\x75\x58\xad\x79\x1f\x34\x43\xc2\x99\x28\x60\x96\x2f\x8b\xda\x6d\xe0\x1a\xb3\x24\x50\x98\x1c\x40\xbf\x06\xbb\xa3\xb8\x62\x07\xcd\xe1\x29\x29\x1f\x1a\x68\x0e\xf1\x0e\xc7\x4a\x59\x02\x6a\x13\xf3\xdb\xf7\xff\x54\x03\xfc\x51\xed\xc8\x30\x65\x02\xbd\x7c\xc3\x99\x40\x3d\x25\xef\x0f\x02\x34\x17\xfe\xf0\x59\x55\xc6\x7d\xe0\xb4\xc9\xab\x85\x3e\x8f\x85\xf9\xc5\x7d\xd6\x54\xdc\x51\x96\xcb\x87\x1a\x99\x2e\x24\x88\x60\x57\xf3\x89\x99\x95\xa0\x6e\x01\x2f\xc0\x30\x26\x9c\xb2\x73\xda\xb2\x5b\x2c\xd7\x1a\x22\x99\x0b\x28\xc0\x3b\x16\x10\x30\x3b\x21\xcf\x8d\xcc\x76\x7d\x34\x95\xca\xa4\x6a\xde\xc9\xc5\x6e\x31\xdc\xa4\x12\x6d\xfc\xab\x49\x38\xfe\x89\x09\x2d\x67\x67\xe4\x2a\x61\x28\x15\x2e\xc1\x3b\x45\x89\x73\xf6\x66\x95\x54\x3a\x46\xc8\xc7\xfd\x41\x76\x6f\x80\x5c\x5f\xec\xe7\x68\x07\x87\x78\x14\xed\xb1\x2a\x6b\x87\xfc\x7f\xd1\xa5\x7a\x34\xec\x1d\xab\x2d\x83\xa7\x0d\x71\x78\xd7\x9a\xa0\xc6\xf3\x4e\xf0\xe1\x18\x5b\x62\xf0\x1c\x97\xc2\xb1\x20\x62\xa4\x83\xfb\x81\x38\x5f\x24\x76\x70\x44\xde\x90\x73\xf2\xf4\x2b\x7b\x4e\x46\xc4\x5d\xdf\x9f\xfe\x6d\x0f\x3e\x7f\xfc\x1b\xc7\x1b\x5e\x4c\x45\x17\x97\x30\xd7\x36\xe5\x1e\x9e\xf4\x3e\x3b\x2b\x0a\xcc\xaf\x1d\x90\x8a\x7e\x80\x8a\xc9\x9a\xbd\xcc\xa8\xc4\xd3\xc7\x3c\x70\xe9\x72\x01\x58\xc2\x01\x44\x74\xb3\x1e\x1b\x13\x21\xf7\x46\xf5\xda\xb4\x68\x0a\x9a\xad\x39\xb1\xe7\x5e\x82\xd6\x9d\xbc\x26\x72\x1d\x5e\xa4\x79\xb5\xf7\x3b\x09\xb1\x50\xcb\xe4\x7a\xbb\x1c\x51\xa9\xc8\x7d\x02\x3e\x85\x91\xc2\x50\x8f\x1e\x54\x16\xa8\x9c\x3a\xac\xcc\xc1\x9d\x34\xab\xa4\x0c\x6d\x9a\x17\x36\xf5\xdb\xaa\x6f\x8f\x99\x55\x42\x1f\x89\x43\x18\x92\xc5\x07\x1c\xba\x32\xb8\xb5\x3a\xe8\x01\x89\x03\x96\x02\xcb\x3d\x90\x9f\xfc\x70\x7c\x11\xb1\x9a\x73\x51\xf0\x97\x66\x3f\x40\x7f\xe4\xee\xb9\x52\xc8\xa7\xcc\xb6\xe9\x36\xb7\xec\xa5\x54\x7b\xba\x27\xe2\x46\x32\x91\x82\xca\x33\xeb\x34\x0b\xa2\x5e\xca\xc1\xce\x2c\x47\x86\x2c\xa9\x40\xb0\x3f\xb0\xb2\x30\x94\xa1\xcd\x73\x3c\x81\xc8\x28\xb6\xbb\x90\x08\x85\x55\xdb\x8c\x7d\xaf\x46\x7c\x73\x4e\x38\xa2\x8d\x93\x12\x28\xf9\x53\x49\x90\xb1\x3f\xbf\x26\x82\x7f\x6a\xc5\xd1\x7a\x7d\xa1\xd2\xae\xa6\x0e\x90\x23\x99\x30\x88\x8b\xf2\x8f\xb2\xc0\xcf\xb7\xfd\xe3\xff\xb3\x5c\x04\xbf\x73\xdd\x57\xfa\x84\x1c\x9f\xc4\xfe\x7e\x2f\xf5\x95\x56\x21\xf6\x04\xf8\x70\x7c\xc6\x19\xe6\xab\x98\xb5\xb9\xe8\x48\x68\x92\xa1\x3f\x0c\xfa\x29\x85\xbf\xe5\x22\x24\xe7\x28\x5f\xd0\x55\xa0\x62\x6c\xf9\xb0\x23\x26\x0e\x2b\x9f\xaa\x0c\x60\x0e\x6d\x19\x56\x89\x14\x17\x1f\x10\x00\xe0\xc3\xbe\x59\xc5\xc0\x4c\xed\x8a\x58\x5a\x69\xa3\xef\x9f\x5f\x92\x73\xfc\x8d\x7b\x6a\x2c\xac\x0c\xfc\x00\x33\xb8\x9d\x46\x26\xaf\x1a\x26\xf3\x97\x6a\xe4\xa6\x5a\xa8\x4d\xb1\xca\x6a\x60\xfe\x63\x2c\x45\x25\x6c\xc3\x6d\xef\xfb\x0b\x03\xf0\xf7\xc8\xdc\x15\xfa\x99\x0e\x0d\x92\xc1\xcb\x52\x97\x6b\x43\xd1\x9c\xcc\xfc\xe3\x0a\xbc\xc6\x83\x49\xec\x41\x49\x21\x87\x63\x31\xa1\xe5\x09\x1c\xf1\x69\x4a\x03\x79\xe8\x83\xfa\xe6\x25\xdd\x84\x5a\x9b\xfe\x66\xa4\xcd\xf4\x14\x50\x3b\xf9\x40\x0c\xff\x0d\x96\x1b\xcf\x87\x31\x21\x6e\x27\xf3\xc5\xc6\xb7\xb4\xa8\xff\x39\xa5\x71\xc5\xa2\x13\x69\xb7\xc0\xfe\x09\xe3\xee\x95\x6d\x01\xf7\x5f\xe8\x1b\xdd\x88\x6d\x63\x24\x01\x46\x28\xed\x6b\x2a\x2f\xf9\x1e\xd0\x42\x15\xf8\x7a\xd8\x6e\xb9\x70\x44\x4e\x6a\x08\x39\x85\x65\x64\xf0\xea\x24\x9a\x82\x8f\xf8\x40\xfb\x95\xde\xe1\xea\xc9\x11\xad\xff\x2a\x59\x38\xc2\x0f\x77\xe3\x75\x49\xa2\x22\xf4\x12\x4b\x05\x7f\xba\xc1\x79\xc5\xe0\xa5\xb5\x3c\xf8\x2b\xfd\xe3\xdc\xbc\x40\x00\x69\x75\x42\x37\x8a\xa3\x5a\x0b\x79\x4a\xe8\x70\xf8\x68\x81\x32\x5e\x80\x1c\x17\x35\x26\xc4\x32\xd9\xeb\x9c\xd7\x78\xea\xf2\x22\x9b\x61\xf0\xbd\x13\x50\xe0\xc9\x52\x55\x53\x00\xe4\x54\x5b\x80\x39\x79\x9c\x28\x65\xb1\x16\x8a\x44\x83\x27\x60\xe9\x53\xed\xec\x99\x07\x4d\xa0\x58\xda\x6a\x21\xfd\xc6\x70\xbf\x59\x34\x86\xe3\xa1\x49\x49\x8e\x95\x53\x5b\xe5\x32\xae\x5b\x69\x60\x34\x4f\x93\x93\x37\x2c\xc0\x23\x0a\xa3\x2e\x94\xee\x41\x3c\x59\xc1\x6b\xbd\x28\xea\x7c\xbe\x33\x00\xfe\x10\x01\x72\x99\xfa\xe4\xad\x97\x87\x9f\x77\x34\x3b\x0e\x8f\x32\xef\x98\x9d\x9c\x08\xa9\xbc\x6f\xa1\x30\x79\xfb\xa8\x73\x6c\x74\x66\x93\x58\xee\xcb\x8c\x84\xd0\xd4\x51\x33\x8b\xdb\xbf\x09\x74\x8f\x92\xec\xd2\x78\x4f\x8b\x50\xa7\xd0\xb1\xa1\x3b\xf3\x14\xfa\xc9\xe1\x64\xb8\xc5\xb5\x09\xb3\x37\xa1\xa0\x60\x27\x0b\x8b\x37\xed\x6e\x4c\x85\x62\xcd\xdd\x12\x02\x8d\xe6\x35\x0d\x62\x13\xf4\x1e\x57\x26\x8a\x27\x5f\x54\xc6\xb9\x20\xf2\x84\x00\xfc\xb9\xfb\xc5\xe7\x83\x29\x63\x77\xbe\xb9\xa4\xf4\x4a\xd7\xd2\x5d\xed\x98\x99\x64\xbe\x11\xb6\xc6\xb7\xb4\x26\x04\xcd\x49\x4a\x61\x80\x89\xf0\xac\x48\xcd\x92\xef\xac\xb3\xa1\x7b\xe0\xa0\xc1\xca\x8b\xcf\x02\xe6\x31\xe9\x3a\xec\x86\x29\xa5\x82\x47\x2a\x45\xf1\x7a\xf9\x7d\x7b\x5b\x08\x48\xaa\x4d\x3d\xd2\x4b\xf7\xc9\xc6\x37\x0e\xf9\x21\xbd\x1d\x8b\x8e\xe4\x28\x00\xa2\x42\x0b\x5c\xfa\x11\x9b\x51\x33\x99\x9c\x2d\xa3\x02\xeb\x4f\x27\x1b\xb3\xf9\x0c\x7a\x5a\x7c\x8b\xa3\x44\xfa\x1d\x42\xe0\x94\x00\x8b\x5a\x03\xb7\xb4\xd1\xdb\xb7\x0e\xa8\x40\x84\xba\xa8\x27\xb2\x2e\xce\x63\x1c\x7c\x0a\x37\xac\xe3\x25\x15\xee\x81\x5b\x7a\x0a\xca\xc8\xa9\x9c\xd8\x37\xcf\xd6\x2b\x0c\x33\x11\xef\x55\x25\x3a\x7e\xfe\xbc\xf9\x7f\x54\x4b\x65\x54\x8d\xf7\x02\x91\x6d\xd1\x2f\x6e\x56\xbe\x71\x09\x37\x56\x7d\x5e\x1d\x18\xb1\x26\xe1\x5f\xba\xcf\x4c\x10\x7b\x77\x09\xcf\x53\xff\x90\xbf\x43\x80\x93\x2f\xff\x46\xee\x1d\xc7\x82\xc8\xd4\x30\xd4\x15\x9a\xbe\x74\xfd\xba\x0a\xc1\x0c\x16\xff\x9b\xaf\x1f\xff\x86\x1e\x63\x63\xb3\xd9\x74\xb5\x69\x64\x44\x50\x07\x3d\x3e\x83\xb9\xd9\x8c\x39\xa9\xea\xd6\x18\x3a\x52\x1f\x65\xce\x24\x1c\x34\x56\xcc\x51\x63\x70\xa8\x6c\x3f\xcc\x83\x46\xf7\xc1\x35\xec\xf7\x9e\x07\x2a\x34\xa9\xd5\xd8\x1b\x93\x25\x10\x70\x3c\x50\x54\x83\x8d\xcb\xf9\xa9\x5e\x25\x07\x68\x36\x1c\x06\x07\xfc\x8c\x63\x74\xd4\x71\x37\x8a\x77\xf0\xc0\xbc\x06\x56\xd6\x8c\x17\xae\xa2\xb6\x33\x51\xef\x82\xa6\x7b\xbc\x06\x61\x74\x80\x26\x51\x68\xe6\xb1\xdd\x4a\x82\x72\xbc\xbd\xc3\x3b\xc5\x8c\xdf\x9a\x3b\x40\x37\xc4\xc7\x56\xac\x65\x34\x1b\x51\xe5\x6e\x0d\xe9\xe8\xfe\x87\x86\xef\x52\xe6\xe8\xed\x1b\xec\x15\xc6\x51\x95\xa1\x7a\xde\x7e\x48\xa0\xc9\xe0\xd8\x9a\x49\x55\xeb\x8b\x5c\x05\x81\x4d\x9d\x4c\x8c\xf8\xcd\xf3\xee\xd4\xd6\x38\x72\x49\x30\xe6\xd1\xd9\x90\xee\x74\x1f\x3c\x67\x88\xc4\xb6\x0f\x29\x45\xf9\x4f\x59\xf4\x8d\x07\xb2\x0e\x8b\xda\x72\xd5\xd4\xe9\x9a\xcb\x8c\x3c\xb0\x8e\x4e\xc6\x8b\x85\x72\xd0\x08\xbd\x89\x56\x31\x3f\xf3\xcc\x42\x65\x71\x8c\x9d\x1b\xb7\xb6\xc4\x66\x76\x05\xd0\x03\x5f\xbf\xc8\xce\x7f\x3b\x41\x05\x10\xfc\xb7\xe5\x98\xbe\x7b\x40\x0e\xdf\x3f\x8f\x1f\x44\x51\x48\xdb\xbb\xf6\xe4\x9f\x9d\x92\x32\xa4\xe6\x20\x6b\xe2\x29\x58\x7e\x57\x54\xd9\x9d\x1a\x16\x8e\xf0\xc9\xce\xe9\xc0\x62\xd2\xc9\x01\x06\xc8\x87\x05\xed\xc1\x49\x70\x99\x35\xf8\x25\xe2\x81\x50\x03\x66\x2c\x80\x04\xe7\x43\x4d\xb5\x6f\xd3\xb5\xac\x19\xc7\xc4\x38\x40\x46\xfd\x45\x0e\xfb\x67\x10\x18\x27\xe0\x61\xcd\x2f\xa0\x6b\xa0\x41\xea\xd5\xff\x14\x9a\x16\x62\x67\xa4\xb3\x4a\x70\x3b\x05\x6f\xf1\x40\x48\xf1\x9f\xbc\xd6\xb2\x13\x80\x53\xef\x6d\x98\xe3\x8b\xa0\x9f\x70\x2d\x53\x0f\x79\xc7\x09\x27\xbd\x1d\xb5\xb4\xa9\x95\xa2\x3f\x0a\xed\x5b\x6f\x2e\x44\xaf\x0c\x98\x1b\x6e\x3c\xeb\x50\xb1\xed\x32\x91\x38\x0d\xf5\x69\xfb\x41\x6b\xdd\x69\x2c\x93\x4b\x3a\x93\x35\xcf\xf0\x8f\x2c\x49\x98\xef\x0d\x17\xf7\xed\xed\x0d\x49\x4f\x0c\x4b\x81\xd0\xc6\x65\xa6\xd0\xac\x23\x3d\x69\x53\xae\xb7\x42\xd5\x9c\xcc\x33\x21\x57\x7b\xee\xe5\xa4\xd6\x59\x63\x03\x4c\xc8\xd8\x29\x83\x70\xde\x4f\xc5\xe1\x8d\x85\x0c\x0b\x59\x70\x6e\x30\xd2\x1d\xea\x33\xc8\x59\x9a\x9e\x41\x2e\xeb\x95\xeb\x82\x90\xcf\xd7\xfb\xf3\x1d\x85\xb9\x53\x20\x2b\x1d\x99\xae\x58\x23\xf4\x34\xe3\x11\xfb\x3e\x09\xdb\xcd\xa8\xb3\x5d\x5e\x2c\xd9\xb6\xdb\x34\xb9\xd9\xe2\x14\x46\x4b\x79\xe5\x87\xce\x4b\x7e\xd2\x32\x2c\xe9\x6a\x07\x94\x51\xe4\x28\x1e\x06\xc5\xf7\x15\xdc\xd6\xc8\x9a\xa2\x89\x86\x2a\x44\x16\x7c\x88\x5e\xaf\x49\x4d\x93\x48\x30\xa2\x16\x41\xfb\x33\x33\xcc\xc0\x89\xb4\x21\xd2\x6d\xab\x5f\xac\x1c\x35\xe8\x78\xfd\x56\xd9\xf4\x1e\xbb\xee\x35\xde\x69\x11\x15\x98\x7b\x61\x88\x2a\x9d\x06\x2e\x4f\x48\x18\xf8\xa8\x5f\xca\xd8\x33\xef\x4f\xf8\x29\xc0\x32\xfe\x62\x79\x31\xc6\x0c\x39\x7a\xf8\x31\x05\x05\x73\x87\xdd\xf6\xae\x65\x66\xe0\x23\x81\xee\x68\xf3\x67\xa2\x6a\x20\xff\xbb\xcf\x18\xea\x59\x1c\x01\x90\x0a\x92\xb9\x3c\x44\xab\x34\x38\x20\x76\xd1\x66\x2b\x3c\x61\xf3\x56\x55\x1c\x30\x6c\xea\x9c\xd4\xb3\xa9\x9a\xbe\xd7\xfd\x74\xce\xe3\xc4\xd4\x8d\xeb\x54\x26\xde\x92\x50\x7b\x7e\x68\xf3\x09\x14\x35\xde\xe7\x4b\xea\xd1\x9c\x47\x91\xe7\xfb\x79\x2c\x6d\x11\x8e\x3d\x8f\xcc\x8a\xfa\xe0\x4f\x46\xf8\x4e\x3f\x8a\xbc\x9a\x7f\xd1\x38\x3c\x38\xee\x2d\x5f\x4c\x5c\x81\x0a\xce\x1a\x33\xb8\x7b\xbe\x90\x66\xbb\x61\x37\x8b\x17\x52\xcc\xcc\xb0\x4c\x38\x31\x16\x8b\xa1\x0c\x84\xb4\xa0\x18\x83\xae\xb1\x3b\x04\x0c\x8f\xa8\xf1\x2d\x44\x44\x28\x3a\x77\x8b\x2e\x3a\x20\x8c\x81\xdf\x68\x61\x82\x48\xe5\x39\x1c\x09\x15\x84\xdc\x25\xf1\x52\xa0\xb0\xe2\xcf\xbd\xfd\xb0\xaf\x72\x1f\x7c\x4f\x3f\x8e\xa5\xe0\xe2\x55\x2c\x22\x49\xa4\x48\xdd\x03\x64\xd7\x34\x28\xa9\xd4\x67\xde\x4d\x00\x9e\x38\x33\xba\x28\x27\xc8\xfc\xb3\x78\x47\x2d\xac\x84\x45\x8a\xfc\xa7\xc7\x95\xfa\x2e\xa9\xde\x95\x46\xb1\xd3\x45\x1d\xe8\x98\xa7\x96\xd5\x85\x1d\xa7\x1f\xa8\x55\x5a\x7c\x53\x08\xda\x58\x04\xfe\x40\xd0\xe7\xfb\xc3\x87\x64\x55\x42\x8d\x93\x3e\xe7\xb4\x6f\x75\x16\xdd\xeb\xaa\xca\x6f\x7a\x30\xc9\x69\x67\x13\x1a\x33\x0b\x98\xe1\x7e\x3c\x75\x74\x49\x32\xec\x2d\xc4\x7b\xda\x37\xf3\x50\x2a\xb4\x29\xd6\x60\x59\xbc\x9a\x36\x8c\x64\xce\xdb\xb2\x9a\x6f\x37\xcf\x04\x54\x6c\x6e\x13\xd6\x07\xf7\xe1\xe4\x2a\x33\x73\x3e\xb5\x23\x9a\xfc\x57\x7d\xde\x0a\x8f\xe8\xe6\x94\xb7\xd8\xec\xf5\xc2\xd1\xd1\x76\x10\x35\x9b\x21\x5f\xe8\xc5\xc5\x45\xb3\x1a\xb6\x45\xf8\xd2\xa5\x55\xf4\x71\xc9\x1a\x0d\x34\xe6\xe2\x6a\x30\x48\xbd\xfe\xa5\x1b\xc4\xc9\xe9\x9b\xfb\x37\xd7\xd0\xab\x18\x17\xc2\x87\xc1\x51\x82\x03\xed\xdc\x1d\xa4\xed\x76\x39\x11\x0e\x4b\xb8\xaf\xf7\x6f\xff\xae\x50\x51\x7e\xbc\x1a\x8c\x38\x89\xcb\x8d\xb4\x5a\x03\x1a\xa6\xfc\x06\x50\x83\x33\x8f\x6e\xb2\x79\xae\x44\xca\x86\xea\xbf\x79\xb5\xbe\x8f\xa5\x8d\xbc\xf7\xe2\x05\xb7\x3c\x10\x88\xdd\x84\xa1\x63\xa7\xad\x9d\xdc\xd2\x9d\x70\x1a\x5e\x61\x9b\x45\xa1\x33\xb3\xe2\xcb\xa6\x2d\x63\x06\xdc\x11\x6e\x1a\x8d\xb2\x5f\x8f\x91\x7a\xd6\xb1\xd7\x75\xbe\xb9\x0d\x22\x6c\x51\x90\xdf\x51\x6a\xc2\x93\xa2\x60\x58\xbe\xd6\x13\x3b\x4e\x1a\x4d\x2a\xf5\xb1\x1f\xd8\x49\x37\x6e\xe4\x7b\x00\x07\x17\xf2\xaa\x51\x33\x85\x1b\x26\xee\xba\x7e\xbb\x69\x6e\x52\x21\x7b\xae\x3d\xf6\xc4\xee\x68\x9f\xfd\x3c\x01\x62\xc3\x62\x92\x4f\x7e\xe5\x91\xba\x58\x80\x47\x0f\x78\xaa\x99\x21\x8a\x37\xb5\x51\x5f\x3d\x65\x88\xd6\x04\xf8\xf0\xac\x96\xfe\xb2\xd1\x7d\xb9\xc4\x42\x7f\x95\x5b\x67\x77\xac\x90\xbd\x23\x21\x82\xab\xb5\x5c\x97\x19\x95\x65\xbc\x0d\xed\xb5\x77\x3d\xb2\x89\x08\x85\x0f\x76\xea\xf4\xda\xe9\x73\x8e\x9a\x7a\x92\xda\x32\x8d\xe4\xc4\x53\x7d\x38\xbe\x7d\x21\x77\xe1\x59\x1f\x9e\xdf\xc8\xe6\x45\xef\x0f\x58\x90\xaf\x73\xba\xf9\xb5\x52\x55\x10\x56\x16\x58\x26\x3e\xf0\xbe\x04\x24\x7e\xbf\x3e\x3f\x35\xae\x1c\x5c\x39\xd8\x6a\xe7\xc1\xd6\x70\x53\xd3\x06\x2c\x43\x3a\xcd\x83\x6c\x1d\xd8\xc4\xb8\x65\x16\x05\xab\xa6\x52\x86\x78\x74\x66\x72\x35\xa2\xc5\x79\xd6\x98\xac\x18\x25\xc3\x8d\xda\x59\xca\x90\x8b\xd9\xe7\x34\x96\x30\x6d\x64\x7f\x2e\xa8\xba\xde\x21\x2e\xca\x0e\xd9\x7e\x0a\x30\xb7\x14\x0d\x6a\xfe\x76\x14\x9f\x86\x3b\x9c\x50\xf7\xed\xc8\xe4\xd5\xef\xd7\xbb\x46\xde\x34\x91\x32\xd8\xa4\x85\x30\x4f\xaf\x95\x90\xca\x15\xac\xf0\xd7\x44\x31\xd9\x56\x72\xc7\x08\xc8\x1b\x07\x33\x4d\xdf\x90\x8b\x42\xe2\xea\x4d\xc7\xb4\x4e\xce\xf9\xa5\x82\xc9\x83\xc6\x15\xad\x2a\xd8\xaf\xc0\x96\x98\x73\xb8\xc4\x33\xdb\x85\x4d\x42\x3e\xf8\x03\xf5\x74\x02\x55\xdd\x74\x9f\x03\x69\xea\xe3\x20\x12\xb1\xd5\x7c\x3e\x06\xb1\xea\x45\x61\xd0\x56\x9a\x27\xdc\x7f\x25\xd1\x4a\x57\xf4\xdd\x18\x54\x51\x77\xe6\x21\x82\xc1\x2d\x0a\x68\xd7\x7d\x6b\x2b\x4e\x85\x2f\x39\xc5\x34\x9e\xd1\x75\xcc\xfa\x32\x6f\xc3\x79\x58\x88\x78\xd8\xcc\x79\x23\x41\x80\x79\x6c\x0d\x16\xf5\xc0\x66\x8f\xc3\x1b\x3a\x6a\x1c\x1c\xac\x83\x1e\x9e\xeb\xbd\x65\x0b\xcb\xc2\x03\x15\xc4\x1f\xe6\x52\xc6\x8a\xa3\x9a\x0f\xbf\x7f\x70\xeb\xde\x75\x12\x58\xac\xb7\x73\x42\xa8\x83\x63\x18\x45\x34\xee\xc5\x4c\xa2\xfc\xcb\x6e\x7b\xee\x31\x11\x56\xec\x98\x44\xa0\xae\x93\x85\x8a\x78\x44\x02\xd7\x40\xb7\xdd\x2d\x2f\xd9\xa2\xc3\x8d\xf3\x60\xb6\xe5\x35\x7f\xab\xb1\xc0\x85\x40\x17\x67\x0e\x25\xf0\xce\xb3\x41\xa3\xb2\xf9\x6a\x43\xce\xb9\x64\xe7\x45\xae\x6e\xce\x48\x1e\x68\x7a\x23\x66\x65\x16\x1c\xb2\xf8\x14\x31\x73\x53\xcd\x69\xde\xe2\x7f\x5b\xe9\x96\x9f\x4e\x1a\xd4\x1b\x06\x71\xe3\x79\xcf\xd8\x46\xb9\xa8\x6b\x65\xd3\x3c\xcf\xc0\x74\xa4\x8f\x9a\x44\x25\xc6\x79\x0e\x68\x67\x92\x0f\x67\xc3\xf8\xb6\xd4\xa9\x49\xca\x45\x05\xbe\x7b\x0d\xa5\xdb\xea\xa9\x77\xa6\xd8\x7c\xdc\x2a\x6b\xdc\x00\xf4\xf9\x1b\x3f\x3c\xc8\x83\x6e\x7e\x0c\xee\x38\x23\xca\xdc\x27\x1d\xd7\x4d\x95\x6b\xf7\x57\xa8\xc2\xdf\xd3\xfc\xfd\x75\x81\xb3\xe8\xa0\x25\x16\x0f\x86\x6e\x81\xbc\x6c\xde\x89\xe8\x32\xb9\x25\x55\x2d\x21\x60\x15\xcc\x4a\x2f\xe8\x78\xd2\xa4\x23\x4f\x58\x9f\xf7\x50\x1e\xd2\x96\x3b\xf9\x93\x90\x75\xed\xc4\x05\xf4\xca\x8f\x05\xa4\xee\xa3\x1c\x0e\xf0\xe4\xed\xb8\x73\x2a\x60\x71\x4c\x2a\x32\x8e\x51\x53\x7a\xc7\x3b\xe1\xab\x40\x17\xe2\xc1\x2c\x7a\xbc\xa5\x2d\xa5\xda\xec\xcc\xd7\xd8\xf8\xef\x6f\xf4\x0d\x7c\xfc\x52\x65\x9a\x67\x32\x15\x5a\x25\x31\x87\xf8\xfc\x1d\xa6\xc4\x4e\xa5\xc1\xff\xe4\x2a\xf2\xc5\x42\x4a\x45\x64\x9a\x6c\x54\xf3\xf5\x48\xc2\x4c\x32\x45\x16\x27\x45\x29\x9b\xf6\xac\x17\x12\xc9\x43\x68\x7b\x1c\xb9\x3a\xbf\xbf\x85\x25\x3c\xd4\x8d\x3a\x7b\x1c\x93\x26\x9e\xc1\x17\xe1\xb8\x85\xa2\x9b\x32\xd9\x37\x91\x7b\x0f\xb9\x9b\x42\xd1\x46\x15\x33\xb5\x67\x08\xed\xc5\xf9\xa8\x58\x7a\x06\x15\xf1\x42\x6d\xc4\xa8\x6f\xb4\x0f\x7f\xaa\xa3\x27\x8f\x54\xb7\x8e\xe3\xd1\x24\x58\x65\x94\x8e\x1c\x06\xc9\x12\xdf\xab\x2e\x0c\x60\x0b\xcc\x28\xa2\x0b\x09\x20\xb1\x1e\x5b\x2c\x8c\xbd\xa7\xb2\xb4\xab\xf7\xe0\x90\x13\xcd\xe4\x81\x7d\xa7\x28\x0b\x12\xf1\x38\xce\x7e\xf4\x20\x3d\xa3\x5a\xf9\x36\xf3\xeb\x09\x53\x8e\x27\x96\x7c\xcd\xd8\xb5\x98\x05\x84\x47\x51\xb4\x07\x9d\xda\xc1\x0a\x35\xaa\xa4\xcf\x14\x94\x48\xb3\x0e\xb8\xf4\x03\x41\x6a\xa6\xa6\x50\xf8\x38\x32\x19\x1d\xea\xd7\xac\xff\xb0\xd4\xa1\xcd\x32\x82\xdc\xcd\xaf\x0f\xff\xae\xe4\xbd\x6a\xa2\x97\xcf\xbe\xa7\x3c\xbc\xba\x2d\xfc\xc4\xf8\x90\xe3\x8a\x60\x8e\x95\xdb\x5f\x7a\x02\xc0\x47\x0b\xed\xa2\x0c\x83\x3b\xad\x1a\xe9\xa3\x99\x6a\xb9\x5e\xcb\xa4\x34\x27\x1c\xc1\xdd\x7b\x64\xcf\x2c\x58\x48\xea\xbe\xf7\xa1\xa8\x13\x1b\xcd\x1b\x1f\x06\x0b\x5f\xb5\x31\x97\x98\xc4\x2c\x8d\x29\x2a\xc0\x5c\xea\x5c\x12\xb5\xbd\xf9\xc3\x24\x40\xf7\x86\x74\xfc\x15\xc6\x55\xa1\xee\x11\x2f\x3e\x59\xa6\xa2\x9d\x62\xcf\x53\x94\x8c\xdf\xc2\xa6\x1e\xf2\x9b\x85\x9e\x2c\x45\x1f\xa8\xab\x0f\xcc\x64\xf8\x98\x62\x8d\x2a\xae\x53\x60\xf0\x5a\x97\xf1\xa1\xde\xa1\xbc\x33\x46\x77\x16\x07\x9e\x3b\xb4\x57\xc2\xf1\x79\x64\x51\x26\x3e\x5c\x51\x45\x70\xe1\xaa\x83\x99\x19\xfe\x7d\x4e\x48\x7c\xae\xae\x21\x99\x2d\xf3\x2c\xd4\x85\xe9\xa2\xd5\x39\xc8\xd8\x4f\x36\x62\x04\x11\x6a\xcd\x0e\x9f\x15\x52\x72\x16\x60\x1d\x54\xa9\xb4\x89\x03\xdb\x2a\x9c\x4c\x93\xce\x94\x7d\x1a\xb3\x99\x79\xdc\x59\x75\x56\x2f\xc0\xd9\xc7\xb1\x31\x2f\x76\x4f\x63\xf9\x89\x27\xbc\x7d\x95\xb0\x1e\xbf\x7e\x22\xae\x0a\xe4\xd7\xa4\xec\xed\x1d\xa2\xf5\xc6\xd9\xd7\x47\xba\xcd\x47\x98\x45\x14\xab\xd9\x9e\xf8\x1a\xd8\xee\x61\x10\xe7\x05\x96\x81\x79\x85\xf3\x8c\x59\x0d\x2f\x06\x21\xa4\xb7\x90\xb8\xcb\x54\x37\x99\x3a\xd6\x7c\x16\xe2\x75\x3f\xbe\x99\x6c\x7e\xcd\x25\x01\x8b\x2b\xb3\xa9\x4b\x21\x0b\x75\x49\x2d\xf5\x07\xb8\x63\x1d\xd9\x16\xb5\x59\x8b\x73\x6b\x91\x3e\xd3\xbc\xaf\x9d\x18\x0a\x0b\xb9\xba\x02\x97\xcb\x24\x73\x6d\x85\x3f\x6d\xc9\x11\xa5\x94\x11\x3a\xec\xc1\x8d\x22\x4c\xe4\x89\x5e\x37\x66\x68\xa3\x90\x3b\x21\x13\x81\x44\xc1\x2e\x4e\xd3\xb1\xb0\xdc\xd5\x3e\x6b\x9a\xf0\xcf\xe1\xd1\x08\x72\xa4\x21\x49\x71\xb2\x7b\x68\x8a\x38\x96\x7e\x25\x73\x8f\x7c\xdf\x8e\xef\x2f\x76\xca\x5a\x73\xa1\x51\x4f\x82\x1e\x32\xc3\x45\xab\xfb\xb4\xd8\xfa\xcc\x73\x05\xc2\x21\x38\x96\x2c\x3b\xe0\x91\x43\x6d\x5a\xa2\xb3\x1d\x01\x4a\x8a\x48\x0d\x30\xc4\x7a\x0c\x65\x50\xb7\x89\xd7\xdf\x00\x48\xe6\xc6\x4d\xe1\x68\x16\xb9\xa9\xf9\x53\x6c\x36\xa6\x5c\x3d\xce\x45\x8f\xb3\xbd\x89\x80\xe7\x18\xa0\xb2\x52\xb6\x54\x36\x31\x07\xd6\xd6\x7a\x62\x88\xcd\xc8\x6a\x5e\x18\x54\x3a\xc7\x35\x24\xf2\xfb\xeb\x9b\x8e\xbb\xa0\x8c\xbe\xc5\x0a\xbf\x1c\xab\x67\x2f\x07\x3e\xc1\xb7\xf1\x20\xb7\xdc\x82\xa2\x6b\xe0\x0c\xc2\x39\x36\x99\xf3\x6f\x54\x9f\x73\xc2\x5a\x21\x0e\x9c\x04\x0c\x92\x61\x87\x74\xdb\x01\x21\xef\x9c\x8a\x06\x1b\x6e\x7e\x73\x26\x92\xc0\xd6\x03\x0b\x82\x24\x2f\x64\xa1\x77\x40\x3f\x9e\xb2\x78\x81\x01\x60\x9b\x56\xf5\xf2\xb9\x7e\x13\x96\xc9\xd4\x14\x9d\xda\x19\xdd\x62\x22\xbe\x1e\x92\x26\x60\x5e\x35\xec\x96\x38\xd6\x32\xdc\xaa\x4c\xfc\x89\x05\x6f\xd2\xdc\xf2\x8e\x7e\xe4\xe0\xc3\x86\x88\xf0\xcc\x85\xe1\x38\xfa\x78\x40\xfe\x9d\x37\xe1\xad\x0c\xff\x62\xeb\x63\x73\x2b\x06\xe2\x0c\xc5\xf3\xa5\xd0\x08\xe4\x55\x84\xbb\x2a\x83\x0b\x23\x46\xa9\x82\x13\xfb\xfb\xfd\xa3\x09\x93\x47\x22\x48\x39\xbd\x39\x15\x08\x7f\x61\x66\xbb\xa4\x9a\x5c\xf0\x0e\xea\xd7\x0c\xb4\x78\xa7\xe1\x9f\x87\xc4\x49\x32\x2f\x22\x6e\x74\x21\xe2\x75\x73\xe9\x28\x01\xcf\x07\x1d\xac\xcd\x1b\x5b\x39\xc9\xd6\xd1\xc5\x5a\x8e\xe8\xe4\x46\x6b\x94\x20\x11\x03\x77\x76\x86\x56\x9a\xbb\x67\x1b\x96\xfb\x37\x74\x51\xa3\x39\xb1\x57\xd0\xbb\x43\x03\x11\x0f\xc3\x89\x69\xa6\x54\xb4\x3f\x6e\xed\xb4\x2d\xde\x9b\x08\xb5\xda\x79\x98\x44\x02\x63\xcf\xa6\xdf\xb0\xe1\xe0\xd6\xf6\x57\xf8\xe4\x07\x52\xce\x04\x60\xc0\x9c\x4c\x34\xd4\x82\xe5\x3b\x88\xc6\x65\xa8\xc5\xd9\xee\xcc\x9d\x61\x2e\xde\xa4\x00\x0b\x81\x94\x8e\x2a\xd0\xe2\x03\xd9\x47\x21\xe3\x2c\xb0\x92\x8f\xdc\x66\x44\x2f\xde\x9a\x2a\x67\xa9\x2d\x90\x3f\xc0\x06\xe0\x41\x16\x38\xa4\xcf\x9e\xce\x1a\x6d\xde\xa5\x06\xae\xad\x3a\x3c\xb7\x1b\x29\x15\xf2\xb5\xb4\xff\x35\x5e\x9c\x8b\xc4\x0e\x5c\x4d\x40\x08\xea\x65\x0b\x97\x8a\xa6\xa5\x03\x14\xc8\xac\x7f\x48\xb8\xfb\xbc\x3b\xe6\x01\xc4\x74\x61\xfe\xd6\x8b\x0f\x72\xbb\x30\x34\xdc\x55\x3a\xe9\x73\x67\xea\x4b\x94\x99\x48\x40\x56\x68\x14\x68\x81\x07\x8a\x5d\x07\xae\xcc\xea\x7f\xca\xa8\xfb\xaf\xaa\x00\x4d\x60\x77\x6f\x61\xc6\xb7\x3f\x8c\x0a\x69\xc8\x8e\x8d\xf2\xff\x35\xd5\x0b\x6b\x3f\xb5\x08\x42\x4c\x62\xb6\xbe\x0d\x0f\x3f\x09\xaf\xbc\x20\xe6\x61\xa9\x87\x60\xaf\x9d\x38\x6d\x92\x64\xd6\x6a\x33\x59\x44\x5c\x80\x01\xc0\x6f\x7a\xce\x9b\xce\xb6\xbf\xa7\xb1\x94\x98\x3d\x0e\xe5\x36\x80\x7f\x00\x2e\x7e\xf4\x11\xb7\x84\x0a\x39\xd4\xb7\x4e\x6c\x94\xdd\xd6\x3d\x4b\x7a\xa7\x2c\x89\x55\xc0\xed\x69\xe0\x8d\xae\xdb\xa8\xc4\x9a\x0b\xb1\x9c\xe0\xf3\xfe\x4a\x5a\xc7\x61\xe1\xfc\x74\x54\x13\xe5\xf1\xd3\xa7\x42\x96\x02\x7a\xc3\x33\xc2\x2f\x12\xc7\xe9\x99\xf9\x9c\xed\xc9\xc4\x47\xdb\x23\x33\x31\x87\x61\x7c\x2e\xf9\x98\xa7\x01\x8d\xe9\x4a\xb5\xd1\x04\x48\x75\x2a\x9b\x6b\xaf\xf9\x78\x26\xb2\x85\xb6\xb5\x2b\x61\xd7\xb2\x4f\xc2\x09\xba\x8a\xe3\x38\x09\xdb\x6d\xaa\x46\xe7\x4b\x11\x67\x4a\x16\x78\x2a\x94\xea\xa0\x9d\xec\xd2\x33\x1b\x7c\x3e\x2e\x74\xa3\x05\xc2\x93\x26\x50\xe6\xf6\xa1\x31\x8b\x18\x72\x36\x88\xa5\x34\x4d\x85\xdf\xc7\xb5\xbe\x10\xfc\x26\x2c\x70\x38\xc4\xa1\xe5\xbd\xd4\xe2\x54\x64\x15\xea\x12\xd8\xab\xee\x6e\xbe\xba\xc8\x46\x76\x33\x11\xc4\x02\x39\x4a\x77\xc8\x3e\x32\x0e\x34\x9d\x30\xc3\xd0\xc0\xd7\xfc\x08\x82\x05\x39\xac\xa6\x62\xbe\xf1\xcc\xea\xaf\x73\xb9\xd2\xc3\x67\xdf\x0d\x9d\x39\x48\xa1\x66\x99\xba\xa5\xfd\x55\x4b\x10\x24\xeb\x61\x1f\x2a\xfa\xfd\x57\x81\xeb\xfd\xdd\xb9\x9e\x2b\xd4\x95\xb7\x07\x1e\xf8\x1c\x05\x56\x9a\x47\x95\x9c\x9d\xa0\x5c\x3e\x9b\x37\xb5\xd4\x64\x9b\xa6\x61\x5b\x7d\x49\xe8\x4c\x0f\x9a\x74\x36\xf7\x09\xdd\x62\xd5\x1f\x9e\xdc\xdf\x18\x88\x79\xda\xe4\xcc\x88\x82\xfd\x30\x6c\xdc\x8d\x3e\x47\x00\x6e\xf6\x10\x6e\xa2\x0d\xcb\x32\x40\x68\x4e\x62\x06\x29\x5b\xe0\x71\xa0\x04\xfa\x46\xc2\x43\xf3\x96\x19\x61\x2e\x9d\x7d\x47\x92\x79\x4d\xc5\x40\x81\x7b\x59\x58\x79\x87\xb2\x92\x94\xad\x7e\xc4\xfa\xa1\x4c\x77\xa1\x28\x6f\xc2\xc8\x5e\x24\x9f\xff\x47\x78\x88\xc5\xbb\x9c\x86\x71\x0a\x57\xef\x23\x8a\xa0\xae\x72\xb4\x1c\x98\x32\x3a\x13\xd7\x86\x3c\x66\xa7\x65\xa7\x8e\xf6\x11\x22\xe6\xaa\xc1\xd8\x7a\xa1\x58\xd3\xdf\x7d\x4a\x18\x51\x85\x6e\x6e\x13\x71\xc6\x3a\x47\x85\xc2\x0e\x9c\xc2\xfb\xc8\x71\x5a\xca\xae\x62\xc9\xec\x22\x68\xa5\x4c\x39\x2f\x91\x31\x85\xc9\x97\xe7\x16\x7e\x3f\x0f\xdf\xe8\xf0\x0d\x4d\xbf\x89\x2a\x87\xa1\x29\x30\x60\xae\x34\x1b\x2a\xdd\x45\x5d\xc2\x1e\x95\xf5\x4c\xfd\x3b\x69\x98\xd8\xdf\x5b\x8e\x23\x9c\xd2\xc8\x6e\xa9\xfa\x95\xae\xeb\xe3\x56\x78\xac\x9d\x6c\x89\xe7\xb2\xff\x8b\x32\xfb\xdd\x0e\x29\x8b\x35\x6e\xdf\xf6\x0d\x99\x9d\x4b\x54\x92\xd4\x84\xbb\x0c\xa9\xbb\x75\x3f\xf1\xfd\x76\x76\xc3\x9b\x5c\xd7\xd6\x00\x04\xa6\xe9\xaa\x5e\x95\x5f\x95\x33\xd5\x36\x8d\xb8\x44\x3d\xd1\xa5\x29\xbf\x8e\xd3\x39\x55\xaf\x9c\x5b\x85\x36\xf1\xa7\xc4\xfa\xa2\x5a\xf5\x16\x12\x7d\x70\x53\xbb\x83\xda\x75\xfb\x50\x68\x0a\xc7\x62\xf0\x87\x7d\xe1\xec\xc4\x7f\x7b\x0c\xc2\x54\xd0\x3c\x00\xca\x57\x40\xee\xf9\xa2\xee\x7a\x35\xd1\x9a\x60\xca\xc4\x33\xb5\xfb\x09\x7d\xe1\x51\xc1\xc0\xb4\xc1\xdd\x3f\xda\x96\xd8\xc3\x55\x6c\xe4\xc6\xb3\x6d\x3b\x47\x5c\x86\x19\x7f\x56\xf5\xde\x89\xd2\x64\x84\x56\x97\x91\x74\x01\x53\xdb\xe0\x02\x2c\x0f\xa1\x3d\x3f\xbf\xd1\x95\x50\x79\x22\xe4\x83\xa0\x5e\x9f\x1d\xb0\xbc\x4a\x6d\xff\xed\x4d\x87\x27\x09\x0b\xca\xc2\xed\x7a\xe3\x2a\xba\x10\xb2\x61\xbd\x0c\x81\x6e\xd9\x77\x66\x72\xa8\x54\xcf\xf4\x18\xe7\x9e\x41\xba\x98\xd6\x90\x83\xa3\xce\x0b\xa3\xb8\x7b\x8b\x17\xe8\x6f\xb3\xa9\x52\xce\x99\x9a\x76\x80\x34\x52\xb4\xd9\xe3\x72\x65\x9e\x4e\x9c\xde\x93\xb7\x37\x20\xf5\x33\xc5\x5d\x40\xae\xda\x19\xc0\x68\xcb\x4f\x18\x4b\xeb\xe3\xd1\x05\xfe\xf3\x05\x75\x0b\xd1\x3f\xe8\xda\xfa\x8c\xe2\x0b\x11\x70\x68\x12\x11\x3a\x74\x8b\x6c\x54\xf3\x3e\x07\xc4\x82\xf6\x27\xfe\xaf\x42\x33\xda\xe1\xc8\x2a\x9c\xe7\xe0\x14\x1c\x99\x0c\x9d\x88\x97\x7f\x04\xf3\x55\x69\x9f\x97\x44\xb1\xd8\x42\x1d\x56\xb5\x3f\xcd\xc0\x18\xbc\xff\xf8\x77\x05\x8a\x5b\xf1\x08\xc6\x29\x36\xa4\x71\xda\xc5\x99\x60\x46\xc4\x27\xc5\xe0\xb4\x86\xad\x3f\x11\x8c\x0e\xa6\x64\x19\x63\x3b\x46\x3d\x61\x54\x1b\x8b\xda\xa3\x58\xc9\x46\x69\xdc\xd1\xbc\x33\x35\x08\xed\xe6\x4c\x70\xd2\x92\xaa\x77\x4e\x33\x12\x45\x1e\x2b\x15\xe7\xd0\x2b\x66\xea\x9c\x72\xbc\xfa\x9f\x32\xe6\x1e\x11\xec\xb0\x65\xce\xc0\xa8\x31\xca\xbd\x02\x55\xda\x2d\xcd\xcc\xa2\xec\x7d\xa0\x8f\x84\x2f\x5a\xe8\x9e\x30\x50\x27\xe4\x21\x89\x9e\x93\x1a\xcd\x22\xc9\x70\x43\x8e\x77\xf9\x71\xe2\x47\x7f\xc1\xd7\x57\xa1\x97\x92\xf7\xf9\xb9\xdc\x1f\x33\x94\x27\xda\xe3\x0a\x97\x46\x71\xe3\x9c\x8f\x63\x79\x41\xea\x58\xb7\x3c\x05\xd5\xad\x4f\xed\xf8\x0d\x0f\xcd\x5c\x88\x70\x42\x77\x4b\xf7\xe2\x4f\x3b\xb9\x85\xc1\x31\x7d\x75\x41\x2d\x4b\x81\x81\x79\x0a\xe7\x46\x50\x5f\x8b\x8c\x03\x0d\x7e\x43\x77\xc7\x53\xfb\x4b\x2a\xf5\x08\x81\x78\xbd\xd5\x9b\x59\x66\x27\x47\xa5\x45\xb2\x28\xf3\x2a\x32\x78\x1f\x9e\xa8\x7c\xf0\x5c\xfc\x5d\x56\xb7\xbe\x71\x06\x12\xa9\x46\xbd\x25\x19\x1e\xbc\xd8\xc3\x38\xd9\x7b\x18\x0a\x53\x79\xf6\xf9\x65\x95\x86\x91\xc0\x4f\x08\x65\xa6\x08\x24\x7d\xa0\xd0\xfb\x54\x0f\x94\x8b\xea\xfd\x72\x09\x9a\xec\xb5\xa8\xa1\xdd\xab\x91\x61\xe7\x6f\x39\x83\xda\xd4\x36\xb3\x8f\x28\x76\x51\xfe\x55\x34\xb8\xca\xfd\x32\xa5\x48\x23\x76\x10\x5e\xfd\x17\x60\x8f\xa3\xb7\x00\xbc\xf3\x1c\xb0\x78\xe0\x07\xa2\x72\xb0\x01\x8b\x60\xf6\x61\x40\x2e\x61\x48\xcf\xa1\x9c\x8d\xcc\x5f\xc9\xa1\x7f\x38\x17\x1b\x0a\xde\x64\x20\x26\xd5\x26\x9d\xda\x45\x0c\x58\x7e\x92\x4e\xca\x52\x17\x06\x82\xad\x4c\x88\x58\x2f\xff\x71\x1b\xa8\xd0\x67\xce\x04\xc0\x3e\x38\x25\x06\x45\x63\x66\x66\xd7\x93\x8e\x9a\x52\xd6\x47\x64\x1a\x2a\xc1\x72\x59\x32\x29\x0c\x72\x43\x50\x0f\xb8\x57\xce\x7d\x11\xf6\x39\x15\xcc\xb8\x60\x25\x76\x5c\xe4\xc7\x1e\xd8\x5a\xea\x4a\x18\xc7\xda\xe1\x9e\xe4\x39\x22\x27\xf9\xbb\x1c\x5a\x02\x1b\x50\x9d\xf5\x85\xf3\xfa\x87\x4f\xb3\xe5\x43\x26\xd8\x5e\xa9\x47\x27\xac\xe3\x14\x9a\x02\xfc\x6e\x3c\xab\xcd\xae\x5d\x2f\x4e\xab\x4c\x82\x01\xe7\xa5\x64\xb2\xaa\xd4\xce\x11\xa9\xc4\xdb\x41\xe2\xdd\x68\xd1\x8a\x9e\xde\xde\xfe\xba\x97\x30\x44\xf2\x58\x89\x42\x68\xaf\x19\xae\x75\xcc\xfc\x78\x6f\x69\x62\x30\xda\xda\x6a\xb7\x54\xf3\x77\x62\xce\xf3\xe9\xb4\xf6\x64\x29\xf0\xe6\xed\x95\x0b\xd3\x84\xa5\x30\x4a\x4f\x1d\x01\x33\xc0\x9b\xad\x92\x7d\xc8\x7b\x36\x5d\x84\xf7\xd0\xb0\x01\x5f\x71\x61\xd8\x7c\x58\xc6\xc4\x19\x2b\xf6\x50\xfe\xc4\xd6\x5f\xc9\xe0\x0f\xde\xbc\x3b\xe3\x35\x07\x36\x94\xfe\x6d\x5a\x87\x3e\xc9\xda\x61\xfa\x1c\x7c\x87\xa1\x71\xba\x5f\xa6\x03\xf2\xc0\x7e\xbd\x0b\xea\xbf\xb8\xdc\x7d\x99\xfb\x12\x7d\x35\xec\x90\x48\xe6\xf6\xe3\xc1\x91\x44\xda\x2e\xe3\x55\xf1\x1b\x16\x25\x39\x99\xe3\x7c\x04\x2f\xaf\x61\x3f\x9e\x25\xe7\x8f\x01\xe3\x40\x68\x90\xcc\xee\xfd\xed\x8d\x1d\x00\xf7\x15\x65\x1b\x5b\xb2\xd7\xb8\xf1\x3b\xbb\x45\x0a\xf5\x27\xc9\x00\x62\x14\x51\xdf\x2c\x97\x56\x2d\x00\x48\x5a\x92\xd9\xc7\xe7\xca\x89\x01\xcb\x42\x95\xba\xa5\xdb\x10\xcb\xa4\x97\x7d\x92\xd9\x31\xeb\x59\x26\xd0\x38\xb9\x09\xf9\xd3\xe2\x76\x24\xf0\x67\xb1\x30\x35\x60\xbb\x3d\x19\x8d\x8c\xf9\xf1\x9d\xe5\xe2\xa3\xf2\x99\x24\x3d\x1a\x3e\x04\x53\xf1\xe2\x1c\x47\xf7\x87\xb5\xe3\xf5\x7e\xfc\xf8\x77\xe5\x7d\xcc\x68\x75\xf7\x39\x2f\x90\xbb\x8d\x55\x7a\xef\xa8\x4b\x6c\xe1\xb2\x98\x6c\x55\x47\x4b\xe3\x24\x34\x65\x8c\xa9\x22\xe5\x13\x28\x2d\xe1\x71\xf8\x64\x37\x56\x85\x5d\xff\x30\xf1\x45\xa5\x5c\xc1\xdf\x30\xe1\x81\x77\x99\xca\xc0\xcb\x2d\x7e\xec\xee\x0c\x10\xb2\x79\x82\x69\xf4\xcc\x3c\x4e\xb6\x73\x84\x11\x0c\xb9\xe4\x59\x94\x39\xf6\x66\xa5\x89\xc0\xa7\x42\x08\xa6\xeb\xbd\x02\x78\x40\xe6\x2e\xf3\x5e\xdb\x13\x87\xca\xa8\x7b\x86\xf8\x3c\x55\x63\xa6\xd2\x6d\x3a\xb0\x8c\xe3\xae\x05\x34\x58\x5c\x31\x83\x86\xde\x05\xfd\x6a\xe7\xda\x19\x33\x7b\xdb\x3f\xba\x1f\x64\x2c\xd2\x60\x31\x08\x40\x48\x18\x97\xab\x7e\x77\x74\x54\x39\x9c\xe7\x28\x1e\x0e\x45\xfe\x2a\xe1\x6d\xc3\xab\xe4\x12\xff\xe3\x81\x30\x9b\x6c\xce\x80\x6a\x1a\x0e\x49\x1d\x30\x10\x17\xcc\x2a\x1c\xe4\x5e\x0a\xd5\x1e\x8e\xdf\x98\x7d\x31\xe1\xf4\xed\xd2\x8c\xfd\x4d\x37\x2e\xd3\x63\xa2\xda\x2a\xab\x77\x1d\x80\x79\x77\xca\xba\xd0\xc8\x37\xb1\xc0\x20\x91\x82\x80\x19\x76\x8b\x88\x92\x62\x7f\x13\xcf\x96\x19\xac\xa1\x64\x54\x07\x8b\xf1\x6e\x24\x6a\xf6\x67\xfd\x1b\x0f\x0b\xdd\xc2\xb9\x54\xb1\xcf\xf9\xc1\x0a\xd6\xe8\x10\xdd\xd2\xe7\x32\x6d\x82\xac\x4e\x2f\xf8\xd8\xb4\x40\xdc\x17\x48\x41\x52\x69\x90\xe3\xf1\x0f\x8e\x18\x27\x74\xc6\x39\xaa\x90\x66\x35\xd5\x0c\x19\x27\x95\x80\xfd\xfe\x8d\xc2\xcd\x6c\x42\x28\x34\x1f\x80\x31\xc3\x18\x7b\xd2\xf2\xa0\xbf\x79\x10\x0e\xe8\x0f\x3b\x02\xbf\x2d\x66\xca\xc4\xf3\x77\x2b\x7b\x46\x3c\x5d\xc1\x0a\x7b\xef\xe3\xc3\x52\x19\x29\xa7\x3c\x15\x18\x34\x7d\x59\x7f\xd2\xa4\x81\x35\x1f\xb7\xdb\x95\xb5\x25\xf3\x24\xd4\x79\x00\x2e\x99\xa4\xe0\xd3\xd4\xf3\x8a\x04\xa4\x77\x75\x2c\xa4\x85\x34\xb3\x82\x23\x48\x96\x06\x14\x65\xc3\x28\xcc\xb4\x12\x92\x5e\x14\x18\x99\xb7\xbd\x87\xcb\x15\x4f\x99\x3d\x3a\x51\x7d\x4b\xfd\x98\xf5\xe5\x3f\x2c\x6b\xcb\x06\x1a\x2f\x1a\xd2\xcd\xfa\x57\x77\xc7\x2f\xf0\x35\xb9\x8e\x56\x6e\xf2\x39\x5f\x31\x8d\xe5\x4a\x2c\x92\x07\x82\xf8\x71\x93\x9f\xe0\xfd\xf2\xae\xae\x70\x78\x6e\x08\xe1\xa7\xed\xb3\x45\x25\xc4\x9c\x92\xe4\x1d\x2b\x78\xe8\xf4\xbd\x48\x43\x9a\xee\x56\xaf\xfd\xf8\xb8\xc8\xbb\x5c\x1e\x65\x76\xb1\x73\x50\xc2\x6b\x4f\xfe\x5d\xa9\x46\xc0\xe4\x74\x02\x53\x12\x6b\x5d\x5b\x99\xc7\xea\x25\x78\x9c\x3b\x4d\xbe\xbc\x84\x7e\x00\x85\xf0\x28\x36\xbe\x31\x3d\x09\x83\xbc\x21\xa3\xc9\x6a\x7c\x6b\x97\xc0\x11\xd9\xb6\x73\x70\x58\x50\x77\x38\x05\xd1\xe4\x0c\xe5\xf4\x89\xdb\xda\xce\x74\xad\x11\x8a\xbb\x2a\x21\x64\xc6\xa1\x25\xf0\x2d\xc4\xc3\xb7\x3f\x37\xee\xed\xfb\xed\x03\x99\xa9\xe7\xbe\x10\xf3\x55\x06\x16\xb2\x20\x91\x06\xcd\x69\x03\x8f\x85\xcb\xc6\xf1\xfb\xf7\x0f\xd2\xa7\xc8\xd3\x55\x0c\x94\xa1\x8f\x04\x24\x5a\x66\x4c\xaa\x88\xe5\xb9\xa7\x39\xb4\xf7\x7c\x08\xfb\xe7\xd8\x26\x32\xb2\xf9\xae\x94\x9e\x5a\xd3\x87\xa7\x21\x3f\x90\xb2\xea\x35\x64\x70\x2e\x33\xca\x7c\x56\x27\x0b\xcf\xde\x16\x78\x52\x57\xa0\xc7\xe2\x10\xf6\xcb\x7a\xab\xdb\x1d\xe7\x95\xa3\x31\xcd\x9e\x2c\x0c\x30\x18\xa6\xf3\xc8\xd1\x8c\xbc\xd1\xa8\xf0\xc0\xe9\x38\x1e\x80\x5b\x74\x02\x85\x40\x0f\xbc\x2e\xc4\x06\xee\x00\xc8\x2d\x41\xfd\x43\xa4\x97\x37\xa7\xd7\x80\xbc\x2f\xaf\x3a\xbe\x88\x46\x9c\x48\x4e\xd4\x36\xa5\x91\xde\xe1\x47\x70\x1a\x00\xfc\xf8\x47\x1f\x5e\x8d\xd7\x6d\x9f\x66\xf4\x8d\x22\x09\x5d\xa8\x3c\xcc\x66\x5c\xa4\x5a\x48\xb0\x35\xfb\x3c\xcb\x38\x48\xf4\x57\x62\x8a\x92\x85\x01\x40\x6c\x84\x2e\xa8\xd5\xa9\x31\x9d\x88\x1c\x43\x0b\x5c\x80\x3f\xb3\x9e\xea\xe5\x13\x04\x49\x0e\x24\x5c\x49\x23\x36\x79\xbb\x2d\xb2\x2f\x53\xd3\x7c\x7f\x90\xa9\xbc\x7e\x0d\x34\xa9\x67\xd9\x63\x13\x77\x31\x55\xd4\x25\x5d\xde\xc7\x07\xe3\x10\xcf\xc3\x96\xca\x6e\x1c\x65\x45\x7b\xb5\x55\x9b\x13\x36\x45\x4d\xfb\xb4\xed\xe6\x4a\xc4\x7b\x23\x36\xc5\xbb\x23\xc5\xcb\x19\x60\x34\x79\x4d\x4b\x97\xa8\xad\x2d\x0a\x69\xd9\xc8\xff\x9f\xba\x9e\x27\x04\xb1\x77\x28\xdd\x56\x18\xe3\x31\xdd\xcf\x23\x7a\x1c\x3c\xb3\xc9\xac\x5c\x3d\xde\xec\x5f\xa5\x09\xba\x2e\x8e\xb7\x7b\x73\xad\xa7\x22\xdd\x13\x8c\xc6\x66\x3e\x3f\xfb\x18\xc2\x65\x97\xe3\xf3\x10\x43\x57\xbc\xa6\x07\x24\x7b\x2c\xb9\x6a\xf7\x7f\x20\x90\xb1\xa0\xbe\x4c\x2e\xb6\x3c\x2a\x39\xfd\x70\xaf\x13\xc2\x29\xa9\xd9\x62\x89\x2d\x41\xa0\xef\x4f\x89\x2b\xd9\x59\xe4\x52\xc9\xa8\x74\x14\x8b\x73\x9c\xce\x1c\x3f\x6b\xb7\xbb\xd0\x4d\x5d\x9d\x02\x8e\x0f\xb7\x2d\x92\x42\xc0\x9c\x46\x64\x39\xd2\xe9\xe4\xc1\x63\x55\xe6\x91\x51\xa0\x59\xe7\x7d\x3b\x0a\x5b\x47\xb7\xdd\x4c\xa8\x8a\x2f\x48\x9c\x59\x18\x4e\x62\x65\x9f\x7f\xca\x71\xdf\xe0\x58\xa6\xc9\xc8\x9b\xcf\x3f\xa8\x10\xd8\xd6\x4b\x6a\x89\xa3\x93\xbb\x2f\xf8\x9e\x39\x05\x51\xca\xd4\x6b\x2c\x2c\xd6\x99\x61\x57\x24\x3d\x64\x8d\x62\x74\xe4\x01\x33\x30\x5d\x49\xd2\x2f\xaf\xea\x25\x78\xcb\xc1\x09\xe7\xd0\x59\xc4\x4b\x3e\x91\x95\xce\x5b\x7e\x28\xae\x98\xc3\x30\x96\x20\x29\x9c\x45\x39\xf9\x79\xbb\xfc\x03\x86\x39\x98\xf5\xd9\x5e\x54\xe7\xdc\xb9\x0d\x11\x37\x09\x02\x43\xe9\xfd\xdf\x57\x82\x7a\xfc\xf7\x8f\xeb\xde\xfd\xf3\xe7\xe6\xad\xcc\x91\xb1\xd8\x00\xd3\xab\x5e\x98\x6b\x90\xb6\xe2\x64\xa2\x3a\x4e\x00\x0e\x87\xa4\xc2\x74\x84\x6b\x38\x33\x0f\x5e\xd7\x81\x02\x96\xcc\xac\x00\x89\xd4\x2f\xa7\x27\xba\x04\xc0\x6b\x80\xaa\xcb\xb4\x10\xde\x49\x16\x6e\x7f\x80\x39\xdd\x6c\x90\xdd\x37\x15\x64\xd2\x73\x87\x2f\xa7\xca\xcc\xb1\xd2\x34\x0e\x9e\x8b\xc8\xb6\xba\x9b\x49\x21\x47\x93\x9a\x49\x18\x44\x22\xed\xb8\x2c\x08\xc0\x2f\xc8\x80\x0f\x9f\xbf\x07\x0c\x31\x3d\x14\x24\x89\xb7\xd8\xc9\x29\x43\x82\xab\x12\xb4\x9b\x8c\xca\x03\x73\xa0\xf7\x7f\x1d\x21\xf0\xce\x5d\xa7\x41\xd4\xcf\x08\x15\xe4\x28\xb9\xcc\x29\x13\xa9\x54\x54\xdf\x7f\x58\x8a\xc4\x90\x7a\x9c\x22\x66\xd7\x56\x4e\xdb\x61\x56\xdd\xc4\x7b\x66\xe9\x96\xb8\x40\xe0\x22\xf2\x44\x87\xd3\x01\x6a\x08\x2d\x2c\x56\x68\x15\x2a\x0f\x05\xed\x37\xbb\x40\xd1\x12\x64\xc2\xf6\xfd\x19\xe6\xe3\x91\xb9\xe4\x19\xf3\xc9\x7d\x15\x8c\x83\x7b\x5e\x78\xce\x09\x3a\xb8\x27\x9e\xbe\x0d\x1a\x66\x58\x86\xb5\xc4\xb9\x8c\xa3\x8d\x35\xc7\x24\x7b\xc6\x9d\x09\xf7\xd8\x32\xb7\x86\xb9\x2d\xc0\x14\x9e\x6f\xdf\x77\x7a\x65\xd0\x84\x3e\xbe\xe0\xeb\xe3\x9b\xe8\xe3\x23\xe9\xac\xba\xdb\x79\x7f\xd7\xb8\xe1\x87\x7a\xee\xbe\xeb\x2e\xfd\xf3\xfb\x11\x39\x39\x06\x69\xf9\x47\x7c\xac\xd3\xf3\x97\x67\x6a\x6a\x1f\xa2\x5e\xc0\x17\x53\xf2\xdb\xa9\x4c\x6f\x21\xe5\xf9\xa9\x10\x70\x9d\x80\xf4\x23\x76\x62\x52\x0f\x9d\x77\x14\x89\x29\xcc\x22\x93\xe7\x48\xf4\xc7\xc3\x14\x0a\x59\x25\x3a\x1a\x6c\x35\xb9\xe7\x38\xb6\x83\x7f\xb4\xed\xc4\xfb\x9d\x0d\x30\x8c\xc5\xbd\x26\x44\xf5\x8a\x74\x10\x9c\xac\xf0\xbc\xad\xf7\xd8\x6a\xe0\x10\x87\xf2\xfb\x74\xf7\x3b\x99\x5a\xa6\x8f\xe3\xbf\x33\xce\x47\xe9\xf6\x02\x03\x35\x73\x64\xd3\xde\xb2\x38\x30\xa5\xb1\x0d\x47\x48\xdb\x9e\xc4\x52\x89\x39\x71\xb5\x93\xc8\x70\x60\x93\x1f\x0e\x92\x35\xe6\x21\x75\xb4\x10\xa6\xc4\x07\xa2\xd8\x2e\x61\x91\x8b\x01\x36\x50\xe5\x40\x85\xec\x30\xb9\x68\x38\x6c\xe2\x56\x26\x04\xb9\x4f\xc4\x15\x49\x93\x83\x6e\x48\x12\x21\x7d\x24\x4e\x3c\x10\x18\xd0\x38\xdf\x1f\xdb\x69\x77\x1d\xf9\xb0\xff\x27\xee\xda\x2d\xc6\x7d\xbd\xf9\x6e\x3f\x1e\x9f\x4b\x7d\x42\xc7\x96\xcf\x98\x84\xd3\xf3\xf6\xf5\x85\xd9\x74\xa1\x57\xc4\x6b\x36\xba\x27\xec\xe0\xfd\x5d\x12\xf1\x9a\x9a\x26\xb6\x5e\xf3\x7f\x25\x17\x9a\x1d\xac\x84\x3c\x07\x79\xad\x2a\x17\xac\xf3\x99\x35\x35\xf5\xa3\x1e\x74\x1c\x3c\xbd\x81\x53\x03\xa6\x04\xd6\xec\x25\xea\xb6\x6f\xac\x6f\xce\x40\xdb\xb0\xd4\x69\xce\xd6\xb2\xc8\x61\xda\xc4\xd4\xb6\xf9\xe8\x43\x74\xea\xa6\x71\x16\xc4\xdf\x3e\xf5\xe3\xed\xfb\x1b\x0f\xed\xd5\xc4\x71\x93\xee\x61\xc6\xa3\x3b\x9d\xf6\x25\x79\x73\x4a\xa5\xce\x18\xa5\x67\x09\x59\x32\x9f\x09\x18\x85\x8f\xef\x9f\xdf\xaf\x77\x1e\x90\x77\x45\x26\x1a\x2c\xeb\x39\x7a\x28\x59\x6f\xe8\xc7\x33\xe6\x97\xf5\x0f\xec\x47\x6d\x16\xae\xb4\x5a\x86\x4d\x29\x59\xcc\x55\x3f\x54\xaa\x64\xf1\xd4\xfa\x73\x2f\x46\x9c\x9f\xd3\x63\xe6\x73\x2d\x3f\xe3\xfb\xfb\xe7\x07\x69\x42\xb7\x1e\x05\x03\x5e\x78\xa3\x4c\x7c\x82\x80\x94\x2d\x41\x10\x8d\xa3\xb6\xc9\x0f\x8e\x51\x95\x54\xf8\xe1\xac\x49\xc5\x05\x52\xb9\x14\x1e\xec\x52\x0b\x3b\xe2\x14\x92\xd6\xf2\xe4\x4c\x45\x64\xde\x3b\xc5\x38\x74\x2c\x23\x77\xa7\xfb\xbf\xfb\x17\x78\xe1\xd6\xb0\x72\x02\x9f\xd9\xb9\x33\x13\x71\xab\x7d\x26\xd1\x29\x43\x2d\xae\xb4\x76\xbf\x44\xff\x0f\x87\xf4\x36\xf5\xac\x30\x39\x77\x52\x4f\x1e\x24\xf3\xa7\x76\x72\xc7\xb9\x67\xa5\x91\x48\xa3\x2d\xaa\xce\x44\x30\x07\x3c\xd1\x02\xda\xe9\xe1\x18\x40\xaf\xa4\xc9\x65\x56\x37\x3d\x24\x64\x17\xc4\x88\xd5\x35\x14\xc9\x30\x52\xed\x50\xbd\x8a\x6f\xfe\x39\xff\x76\x3a\x9d\x6c\x25\xa6\x23\xe3\x53\x7b\x94\xdc\xb3\x0f\x2b\x48\x18\x27\x21\xa1\x7e\x89\x27\x51\x81\xb7\x26\x8f\xa4\xbb\xfd\x75\x3c\x42\x25\xf8\x32\x4d\xe6\xae\xa9\x9d\x93\x77\x6d\x71\x06\xd5\xa5\x04\xde\x35\xe6\xb3\xd0\x44\xe5\x8e\x43\x0a\x6a\x0e\xe4\xe8\xf7\x81\x2e\xe5\xa6\x9b\x8e\x02\x0f\xc5\xfb\x2c\x3e\xfe\x24\xc2\xe0\x4b\x83\xee\x26\x54\x4c\x38\x37\x09\x4a\x83\xbe\x96\x97\x4e\x4a\x69\x5f\xfd\x53\xb7\xf0\xef\xf6\x8e\xa0\x2a\x95\x39\xd2\xb7\xbe\xad\x37\x3c\xd5\x5f\x9e\x0f\x9c\xfc\xcf\x8f\xbd\x8b\xa0\x7e\x3a\x9c\x8a\xe9\x64\x7f\x9e\x29\x92\x85\x3e\x61\x3d\xec\xaa\xd6\xd7\x51\x29\x2b\x07\xc9\x2a\x51\x47\x72\x6b\xb0\x2c\xde\x17\x8d\x59\x56\xb7\xd4\xe6\x0d\x7a\xa4\x81\x58\xf7\xe5\xca\x4a\xb1\x45\xcd\x4c\x72\x6e\x25\x25\xff\x3e\xce\xcf\x0f\x3c\x60\xee\xe5\x5d\xdc\x24\x4e\x5e\x4e\x28\x93\x03\x81\x66\xf6\xb5\xdb\xe9\x42\xb6\xca\x67\xf3\x69\x78\x96\x3b\x14\x42\x95\x81\xeb\x53\x94\xf0\x7e\xa2\xa3\x7a\xb1\x26\xf1\x2f\xce\x85\xbb\x77\x03\xcc\x1d\x4a\x03\xcc\xc7\x88\xa8\x87\x92\xa0\x84\x4f\x4b\xb3\x70\x8e\x6d\xf2\xcc\x65\xa5\x69\x12\xcc\x8b\x3c\xdb\x40\x7a\x85\x11\x68\x0d\x8e\x76\x5a\x3a\x66\xf8\xc1\xa3\x03\xc9\x73\x4b\xab\x60\x4c\x60\xea\x0f\x36\x74\x98\xa3\xcb\xa8\x87\x80\x09\xd8\x9f\xb5\x3d\x75\x3d\x23\xb2\xb4\xbc\x14\x82\x4e\xac\xa3\xbe\x89\x25\xf8\xbe\x8f\x9f\x8b\xbb\x78\x5f\x24\x09\xf1\xa2\xb7\xe0\x4e\x76\xf8\xd9\x06\xe3\x89\xbe\x13\xed\xbf\x0f\x5c\xcf\x04\x9f\xf9\x14\xb3\xa4\x0e\xdd\x11\xc2\xcd\x3c\x1f\x8e\xef\x49\x84\xa6\xe8\x0e\x62\xc7\x6d\xd6\x94\x3c\x33\xa9\x0e\xac\x23\xaa\x02\xfa\x2e\xcf\x89\x41\xed\xe0\x23\xee\x78\xac\xaf\x24\x97\x30\xe9\x1f\x44\x61\x66\x2a\x9d\xdc\xd2\x76\x8f\x23\x46\x12\x1d\x79\x58\xbb\x95\x75\xac\xe5\xf8\xdb\x83\x95\xe4\x8a\x64\xcf\x0d\x8e\x7b\x12\x25\x5c\xa8\x1b\x3b\x7b\x5d\xf1\x53\xa9\xd7\x9b\x42\x43\x3e\xb9\xa4\x91\x54\xc2\x19\x15\xb4\x5c\x26\x89\x8f\xe1\x93\xbf\x36\x93\x81\x11\x69\xf1\xc6\x97\x4e\x7e\xd3\x04\x5f\x38\xdd\x93\xaa\xdc\x60\x1e\x15\xe4\x60\xd7\x69\x76\x5d\xad\x12\x0d\x39\xa4\xed\xcf\xe5\x94\xf4\xcb\xfb\x63\x43\xd6\xd1\x44\x45\xe4\x6d\xbd\x80\xc1\x65\xb2\x10\x4e\xaf\x48\xfa\xa2\x93\xc7\xa9\x91\x29\x8d\x17\xf8\x7e\x97\xa3\xf7\x7f\x57\xe8\x21\x9e\x0a\xb5\x61\xd4\x45\x78\x37\x0b\xef\xdf\x33\x0c\x4c\xee\xef\xa7\xc0\x40\xd2\x01\xe5\x00\xf4\x62\xa6\x29\xce\xf8\x02\xa6\xc1\x8a\xb1\xa3\x0a\x69\xc7\xe3\x37\x11\xc3\xaf\x69\x6c\xe6\x0b\x12\x51\x57\x0f\xaf\xd3\xad\x04\x21\x9c\x85\x82\x44\x71\xa6\x5b\x1e\x78\xfa\x8c\xe2\x31\xba\x39\x11\x30\x40\x9d\x3f\x9f\xdb\xf3\xf9\xcf\xd5\xd1\xf3\xee\xdf\xfe\x60\x1d\xcf\x47\x24\xbb\xf6\x88\xec\xe3\x76\xfc\xea\x26\x94\x56\x0b\xd3\x96\xc7\x00\xf4\x89\x6f\x39\xc3\x1d\xf8\x20\x1e\xfc\xe3\x08\xba\x02\x3b\x13\xbc\xfb\xf7\x9f\xf7\xb9\x3d\x5f\x07\x1e\x79\xb6\xf0\x78\xf6\x45\x65\x11\x73\xe9\x98\x94\x66\xcf\xb5\x0e\xbc\x8a\x66\x3e\xd0\x4c\xa0\x15\x73\x9d\xe8\x40\x88\x18\xce\x3c\x6a\x2a\x9f\xd9\xc7\x90\x32\xff\xbc\xb1\x47\xdb\xb7\xc1\xcc\x2a\xce\xe2\x60\xb6\x8b\x2a\x21\x4d\x3a\xc8\x43\x98\x0a\xd3\xcf\x52\x33\x20\xc1\x94\x08\xba\xb1\x76\xac\xc9\xea\x23\x20\x32\xfe\x2f\x0c\x3e\x2f\x0e\xce\x40\x1e\x56\x95\x81\x2c\x98\xb9\x07\xc6\x97\xde\xbc\xd9\xb0\x1d\xcc\x3d\x49\xb8\x0a\xe6\xba\xc5\xe7\x13\x28\x61\x33\xb6\xea\x40\xe8\x8a\xd6\xfd\xf9\x7a\x0f\x75\xb7\xa2\x81\x82\xdd\x9d\xdf\xbf\xfe\xed\x0b\x08\xc8\x7c\xe5\x44\x0f\xef\x04\xdc\x7f\x3c\xff\x05\x4c\x23\x2a\xc8\x82\xfe\x73\x1a\x19\xf2\x02\x30\x53\x31\xbb\x13\xe5\x40\x94\xac\x13\xca\xbb\x54\x0a\xf6\xd0\x7c\x0f\x25\x45\x69\x95\x98\x28\xc7\xda\xd8\x43\xc9\x3d\xa9\x26\xe1\xcc\xe8\x77\x16\x9a\x28\xc4\xb5\xb8\xdf\xc4\x17\x05\xe7\xf7\xfd\x7c\xe3\x50\xdc\xe9\x0c\x2c\xcc\x7e\x62\x3b\xab\x8f\x47\x29\xf4\xdb\x69\xe5\x92\x38\xda\x4b\x13\x33\x86\xc7\x58\x5a\xc0\x1b\x8a\x51\xf6\x04\x3f\x11\x5d\x2d\xb1\xcb\xee\x41\xac\xe4\x68\x79\x88\x51\xc2\x8e\x03\xe7\x40\x98\xfe\x67\x64\xc5\xfe\x63\x08\xc4\x76\x8a\xef\xf7\x3b\xda\x31\x6f\xf7\xf6\x13\x64\x36\xfb\x22\x70\xbb\x3b\x11\xa1\xcc\xea\x9e\x6d\x3d\xfc\xa3\xf6\xc7\x7d\x42\xca\x6e\x7b\xa8\x97\xda\x14\x54\x81\xf2\x91\x5d\xa0\xb4\x90\xd8\xbf\x8a\xd5\x33\xe8\xe2\x74\x4d\x03\xc9\x1d\x9a\x01\x8c\xfa\x70\x31\x7c\x12\x3c\xb2\x31\x1c\xe7\x88\xe7\x1e\x33\x85\xb9\x0d\xf3\x73\xff\x00\xdf\x13\x06\xc3\xd3\x43\x9d\x72\x99\xaf\x52\xd0\x93\xbd\xc6\xe5\xc5\xc1\xde\xb5\x1e\x58\xf0\x98\x3a\x25\x38\xc7\xbd\xbd\x7a\xfb\x5b\xc5\x18\x82\x4e\xd5\xfc\x93\xbf\x80\x12\xf7\x12\x55\xc7\x69\xe2\x5e\xc8\x0b\x2a\xb9\x7d\xb2\xe4\x46\x38\xf7\x90\x2f\xaa\x66\xb4\x91\xd5\xe3\x91\x68\xfe\x67\xce\x9a\xe3\xf2\xf8\x37\x74\xcb\x17\x53\xac\x3e\xc7\x54\xc3\x66\xbd\x39\x14\xc9\xd8\xdb\xd7\xfa\x38\x57\x04\xf2\x68\x40\x0a\xc6\x91\xe3\x18\xdf\x02\x27\x74\x7f\x7c\x38\x8d\x4c\x05\xf2\x0d\xc6\x56\xef\x3f\x6f\xcf\x81\xee\xce\xea\x1e\x10\x9b\xef\x5e\x4d\xcb\x40\xb6\x4d\x9c\x55\x9a\x1c\x1f\x46\x9b\x5f\x26\x46\x81\xce\xff\x22\xad\xa0\xa9\x34\xb3\x33\x24\x72\x12\x42\xbf\x10\x19\xb4\x95\x26\x05\xb3\x48\x1b\x7b\xa9\x5c\x9b\x43\x03\x98\x55\x61\xaf\x9e\x8f\xe8\xa4\x2e\xf0\xfe\x6d\xfc\x6a\x6a\x85\x86\x19\x5e\x0e\xd5\xe8\x67\x4a\xad\x7a\x4b\xd0\x6c\x76\x33\x75\x8c\x6f\x4c\x90\xdd\x2b\xfa\x1b\x76\x6f\x5a\x8e\x88\x0e\x52\x6c\x05\xb9\x98\x70\x06\xaa\x57\xc4\x00\x21\x7b\x3a\x4a\x01\x60\xec\xf0\x5c\x88\x99\xee\x0b\x64\x02\x23\x45\x35\x65\x73\x38\x75\x1b\xb9\x18\x6e\x1e\xe2\xc1\x46\x1d\xd7\xa1\x51\xab\x30\x4b\x29\x5f\x26\x38\xad\xeb\x26\x8f\x64\x44\x6c\x35\x89\x2c\x27\xac\x24\x44\x08\x4f\x70\x15\x93\xc7\xa7\x62\xcb\xa9\x7e\x33\x3c\xe6\x95\x8f\xe6\x28\x81\x3a\x15\x62\xd6\xd3\x10\xca\x9c\x77\x8c\x73\x26\x0c\xe6\x64\xee\xba\x43\x78\x2a\x40\xde\x35\x36\xf8\xf7\x39\xad\x1f\x55\x81\x83\x54\x2f\xa2\x20\x84\x21\x9e\x91\x62\x66\x3d\x9c\x4e\x9a\x14\x99\xbb\x91\x63\x29\x9d\x2d\x6d\x64\xa4\x83\x6e\x66\x61\xdf\xf2\xce\xde\x1c\x9f\x95\x4b\x9c\x84\xd7\xe4\x84\x1b\x6b\x31\xd8\x9c\x4e\x9f\xe2\xa5\x1c\x2e\xca\xb6\x0d\xfb\x69\xfb\xc0\x91\xdf\x08\xcf\x53\xd6\x70\x5b\x9c\x21\x08\xba\xe2\x6a\x87\xbc\x75\xdf\x04\x4d\x14\x15\x01\xf3\x0f\x98\xab\xed\xd1\xb0\xb6\x14\xfe\x93\x53\xcb\x53\x19\xd0\xeb\x89\x47\xae\x52\xb3\xbc\x12\x32\x0e\xd9\xeb\xd9\xde\xda\x16\x1e\x6b\xb1\xc0\xda\xa5\xaf\x9a\x72\xf8\x1b\xeb\x0b\xa9\x28\x16\xe8\x30\x0b\x38\xbc\xed\x9b\xd5\x76\x99\xab\x7a\x89\x1a\xa6\x50\x3b\x15\x29\xfa\xc9\x7c\x5c\xfe\x0c\xb5\xd2\xef\xa7\xf1\xdf\xad\x7a\xcd\x26\xa8\xc8\x9e\xce\x86\xf3\xe8\xa3\xdc\xc8\xfc\x1f\xb7\xeb\xed\xe6\x4b\x10\x6f\x8f\x1d\xef\xe1\x85\x2e\x7f\x57\x0b\xfc\x18\xfb\x5d\xd2\xca\x91\x9a\x97\x21\x84\x8d\xd3\xaa\x86\x32\x75\xee\x26\x34\xba\xbd\x61\xb3\x1e\xa0\x3e\x12\x49\xb6\x0f\x4e\x56\x26\xfe\x4a\x3b\x47\xc2\x23\xdf\xdf\x3f\xaf\x3f\x1c\x10\xd8\xf9\xeb\x1e\xb7\xeb\x7d\x46\x5e\x6e\xea\x6e\xd9\x55\x85\xb3\x95\xb2\x7c\x83\x46\xa7\x8a\x1c\xe3\x2e\x11\x0e\xa0\xbb\x05\x38\x05\x05\x6b\x6e\x4a\x81\xff\x2a\x64\xdc\x5c\x37\xb3\x59\x24\x2d\x13\x53\xb6\x5e\xe2\x81\x43\xba\xe6\x41\x94\x66\x62\x5e\x9f\x2f\xf7\x88\x9a\xd0\x9c\x86\x2c\xd0\x90\xf9\x50\x44\x1b\xed\x83\xff\x07\xe5\xa0\x29\x2f\xa9\xd9\x40\x3c\x02\xa3\x4f\x7e\xcf\x21\x8a\x8d\xe7\xb2\xd7\x2a\x38\xea\x4e\x51\x6c\xc1\xe3\x95\xa4\x3f\x8f\xf5\xeb\xe6\xb7\x89\x19\x8f\x28\xb8\xbe\xa2\x88\xb3\x68\xda\x1d\xfc\xb5\x91\xfb\x62\x29\x3c\xf1\x07\x72\xbd\xa8\x64\x2a\x3c\x40\x21\xcc\xae\x43\x2b\x6e\xc2\xb0\x6e\x3d\x0e\x5c\xd8\x95\x8b\x06\x8d\xa0\x02\x76\xd1\x7a\x7e\x1d\xbe\x7e\x91\xc9\xf8\xfc\x9e\x66\xf0\xa3\x7d\x7e\xfd\xeb\xef\xa8\x84\x8e\xd3\x35\x92\x27\x6d\x1b\xf6\xeb\x82\xaa\xf4\xe9\xdf\xe5\xf6\x39\x56\xa5\xc9\x57\x44\x2e\x7e\xcc\x99\xa1\xb3\xd3\x36\x11\x4a\x26\xc4\x61\x67\xae\x03\x5b\x81\x6b\x5d\x61\x97\xbb\x32\x18\x0a\x25\x54\xe5\x7b\x0a\x05\xf7\x92\x6f\x65\x24\xba\x1a\x75\x56\x8b\x81\x36\x3d\x20\x22\x1e\xa3\x53\x99\x63\x18\x73\x4f\x2d\xe0\x28\x03\x5c\x62\xab\x86\xe0\xc2\x81\x4d\x44\xe4\x92\x4a\xf7\xd9\xfb\xed\x1f\x92\xb1\xde\xc3\x3e\x90\x24\x29\x4f\xa2\xb2\xf6\x7c\x20\x67\x82\xf8\xe0\xbe\x24\xf7\x61\xea\x34\x66\xd7\x87\xa2\x8b\x60\x76\x5d\x81\xfe\x58\x1c\x02\x2d\x62\xd9\x3b\x7b\x8d\xc8\xa2\xc8\xf8\xca\xdf\x8f\xc3\xaf\x9c\x6f\xa2\x25\x3a\xb3\xd9\xbd\xc5\x6b\x61\x49\x6a\xe0\x14\xee\xf1\xa1\xa9\xac\xd3\xff\xcd\xd4\x95\x6c\xa9\xae\x04\xc7\xbd\xff\xc2\x2c\xbd\x6a\x66\x58\xf9\x4b\xbc\xd0\x50\x12\x42\x13\x68\x44\x9c\xe3\x7f\x77\x46\x44\x16\xd7\xef\xbe\x3e\x57\x07\xba\x6f\x83\xa8\xca\xca\x8c\x8c\x8c\xb0\x7d\xeb\x17\x11\x16\x88\x23\x12\x69\xff\xf3\xf5\xb7\x85\xcc\x6e\x22\x38\x87\x8d\xd2\xfd\x47\xf5\x78\x06\xcb\x06\x79\xe9\x85\x61\x50\x51\x11\x90\xeb\xab\x0a\xb1\xc5\xc7\x9b\x14\x6c\x29\x33\x6e\xdb\x49\x3a\x38\x49\x5c\x62\xb4\xfb\xf8\x7d\xdc\xef\x98\x5e\x57\x2b\x4e\xd0\x3c\x8b\xfa\x00\xb2\x22\x35\x86\xb0\xd3\xc9\xc5\x64\x73\x56\x88\xc6\x1a\x2c\xdd\xe1\xd4\x3a\x04\x30\x99\x4d\xc8\x00\x8b\x1d\x62\x97\xa5\xfb\x4f\x3e\x5f\xbb\xfb\x46\x6a\xb9\x74\x74\x53\xcd\x25\xe3\x18\xdc\x46\x65\xeb\x25\x3f\xb8\x59\xbc\x96\x45\xc7\xe7\x70\xaa\x6a\xbc\xcd\xbf\xcb\x31\xdf\x9e\x1c\x87\xa4\x06\x0b\x85\x7a\xbe\x53\x5b\x64\x6f\x45\x86\x97\xcc\x0d\x27\x28\x40\x72\xfd\x6c\x6d\xbf\xde\x76\xde\xd0\x65\x72\x63\x9f\xeb\x89\x86\x5b\x2e\xbd\x48\xfa\xb0\xb7\x73\xb9\xd2\xba\xc4\x95\xa8\xfa\x62\xf2\x64\x01\xd0\x64\xc8\x75\x22\x91\xed\xee\xba\x61\x40\xdf\x33\x57\x87\xe8\x5c\x6f\x27\xf1\x59\x99\xca\x15\x06\xe6\x27\x1b\xb5\x90\x5a\xe2\xcf\x3f\x31\x57\xa4\x0d\x1f\x19\x59\xb4\x5f\xfa\x8d\x63\x0b\xa5\xea\xed\x54\xcf\x23\x14\xe9\x69\xb4\x85\x86\x35\x3a\xd2\xbd\xe7\x2a\x28\x46\x2c\x80\x45\x1c\xa1\xf4\x16\x98\x5a\xbd\x4c\xc3\x12\x0d\x31\x22\xa9\x60\x64\x68\x5e\xe2\xa0\x27\x76\xf6\x55\xaa\x9f\x68\xf1\xe2\xfa\xa3\x18\xb1\x12\x8d\xa2\x71\xaf\x3a\xc0\x8b\x95\x5a\x41\x57\x3b\x27\x37\xc4\x58\x94\x17\x3b\x21\xfd\x3b\xb9\x60\xee\xe4\x91\xb8\xa3\xaa\x4c\x54\x9c\x28\x96\xfc\xa9\x0a\x05\x5d\x34\xa7\xb4\x96\x89\x73\x4d\x64\x06\xcd\xf8\x60\xeb\xdf\x9b\x99\x65\xf3\x9b\xf3\x8e\x2a\x2a\x1a\x81\xd4\xb0\xa1\xc5\x8c\xde\x69\xd3\x10\xa6\x90\x8f\x2b\xfc\x31\x24\xd5\xd4\x53\x04\xde\xe7\x41\x74\x2a\x42\xf2\xf4\x23\xb4\x37\xb3\xe4\x4f\x95\xdd\xec\xb2\x01\xc0\x2b\xb6\x88\x24\x3a\xb6\x6f\xe7\xb6\xc8\x28\xa4\x86\x7e\x99\x74\xcd\xaf\xae\x68\xa9\x14\x02\x0e\x12\x3f\xef\xc1\x03\xd3\x7d\xb4\xf0\x48\x6a\x7e\xf4\x8c\x4a\xb2\x66\x3c\x90\x9e\x95\x58\xa9\xc1\x5e\x9b\xa5\x4a\x73\xc3\xae\x58\xe2\x81\x39\xeb\x91\xc1\x30\x3f\x80\x1b\x2f\xcb\xaf\xf7\xa1\x7e\xe1\xe7\xf2\x4b\x7f\x7b\x11\xb7\xd9\x40\x87\x91\x77\xa0\x95\xaa\x59\x4c\x18\xdc\x89\x31\xc3\x40\xd7\xe8\x4f\xe2\x8b\x97\xa3\x6c\xb9\xdb\x6f\x78\xb1\xd1\xd7\x6e\x2e\x8b\xd6\x61\x3c\x91\x7b\xaf\x8f\xa2\xb4\x68\x4d\x44\x51\x33\xbd\xae\x74\xea\x9e\x2c\xaa\x88\x68\x44\x6d\x51\xdb\x33\xa1\xa1\x41\x8d\xfd\x46\x4a\x33\x86\xd5\x6e\x25\x71\x48\xd8\xf6\x08\x76\xad\x7b\x32\x39\xea\xee\x67\x02\x09\x66\xd5\x43\x51\x05\x74\xdd\x2e\xf6\xbf\x15\x5d\x62\xaf\xc3\x52\x72\x2d\x3f\x1c\x03\x70\x3d\xe7\xa5\x67\x85\x20\x83\x88\x5d\xbd\x60\x3a\x9a\xb9\x58\x4f\x40\x7b\xa9\x06\x69\x6e\xda\xc7\xfa\x3c\xb2\x79\x0e\x79\x06\x99\x72\xa1\x52\xa5\x50\x43\x03\x11\x73\xc2\x5c\xfb\x38\xdf\x7f\x90\xeb\x8d\x15\xf0\xfe\xf6\x52\x2a\x75\xf8\x30\x70\xe7\xe3\x37\x94\x47\xa5\x0a\xc0\x37\x79\x7f\x46\x04\xf7\xcf\xa0\xb1\x84\x7f\xa2\x50\xb4\xa2\x14\x09\x51\x29\xf8\x04\xe5\x22\x39\x41\x93\x77\x8e\xc7\x5c\x04\xc8\xb5\xd9\x8e\x57\xf2\xfa\x4e\xa7\xe8\x87\x72\xbc\xdc\xc2\xd3\x62\xf9\x4e\xc9\x89\x1a\x88\x9d\x3a\xf3\x5d\xe5\xa0\xa8\x3d\x92\x4c\xb1\x8f\x38\x08\x4f\x73\x9d\x62\x25\x57\xaf\x7a\x6a\x3f\x62\xdd\x5a\x81\xec\x66\x6a\xe1\x23\x8d\x00\x78\x96\x6b\xe5\xdf\x96\xf3\x91\x1a\x36\xfd\xbd\x3e\x3c\xd9\xf9\x81\x7c\xbf\x86\xbc\xed\x8a\xbe\x01\xa2\xd8\xf2\xb9\x79\xa0\xe6\xf6\x2e\x2a\x45\xb8\x31\x75\x1c\x0e\xd8\x9f\xae\x87\xf3\xcd\xf9\x8a\x64\xd9\x08\xd8\xdc\x3b\xbe\xf9\x77\xd7\x30\x36\xc9\x9b\x68\xe1\x8e\x02\xce\xa0\xbc\xa1\xb8\x24\x0f\x0f\x8e\x15\xc5\x51\x1f\x97\xfc\x4f\x13\xe8\x60\x05\x35\x4f\x9a\xb4\xe7\xd2\x8d\xac\x76\x4b\x7a\x92\x54\x59\x43\xd9\xbb\x6e\x26\x62\x96\xe6\x70\xe0\x7c\xe8\xa4\x6f\xb9\xbd\x30\x90\x5c\x2f\x97\xa1\x6c\xde\x24\xbb\x9f\xd9\x56\xbe\x9e\x8f\x6a\x1e\xdf\xf2\xea\x91\xe1\x5d\x5c\xee\x9a\x0c\xda\x91\x44\x79\xbd\x46\xcf\x57\xce\xf2\xd1\xee\xca\x1f\xa8\x7d\x8a\xc8\x0b\x16\x5b\x7a\x3e\xdb\x59\xfc\xe0\x71\x20\x22\xb2\xc8\xef\xf8\x9e\xf8\xf6\x60\x66\x2e\xea\x14\x6d\x99\xf7\x7e\x91\x46\x29\xda\x25\xec\x8f\x13\x45\xc0\x2c\xe1\x70\xc5\x2a\xb2\xd2\x84\x7c\x5b\x78\x9b\x34\xfa\x9a\xd9\x56\x94\xc9\xa6\xd5\x4d\x02\x6d\x5b\xaf\x84\xe0\x41\xe3\x4e\x16\xcc\x88\x98\xf8\xe2\xd2\xfb\xab\xfd\xe0\x53\x23\x30\x11\x71\x28\xb3\x75\xb9\xd4\x77\x77\x39\x1e\xd8\x77\xee\x81\x7a\xf0\x68\xfe\x49\x69\x20\x92\x9c\x1c\xef\xb1\x07\xe7\x4e\x0c\x9d\x25\x34\xfd\x3f\x41\x50\x7c\xc8\x6a\xa5\xcc\xc1\x8d\xe5\xc0\x54\xb3\x33\x81\x39\x6a\x9a\x08\xdb\xa1\x6f\x11\x4b\x4b\xbb\x23\x6a\x60\x11\xd3\xc0\x4b\xbd\xac\xdd\xe0\x64\xd0\x59\x5c\xab\x3c\x3c\x5e\x9b\xc8\xf6\xcb\x36\xca\x80\xa3\x7b\xbe\x33\x16\x2d\x9d\xd5\x57\x3e\x86\x12\x7d\xa0\x49\x2e\xee\x57\x7e\x9b\x25\x7a\x9d\x83\xbe\x78\x54\xd2\x6c\xe9\x1c\x0b\x28\xe0\xbc\x62\xfe\x54\x51\x6a\xce\x1b\xe8\xe0\x0c\xb8\x77\xea\x06\x7e\xc8\x4e\xc3\x51\x3e\x56\x8e\x4b\x09\x1b\x81\xfa\x16\xc8\xb3\x7b\x7c\xbf\xe1\x7e\xb8\x23\xee\xd2\x31\x4e\x5d\x5f\xcb\x39\x1f\xbc\x51\x18\x1a\xd3\x2b\x81\x2d\x2b\xb4\x1d\x70\x79\x7e\x15\xac\xa7\x42\xce\x6e\x49\xb0\xcf\xb5\x69\xbd\xed\xc3\xe9\x8a\x59\xf0\x4e\x28\x74\xf6\x58\x3d\xf6\x95\x65\x04\x38\x70\xb8\x61\x35\xda\xab\x3c\x27\x08\x0a\xab\x61\x3c\x5b\x5c\xdd\x4b\x07\xc9\x93\x6f\x3b\xda\x85\xb4\x23\x06\xa3\x37\xbb\x93\xb0\xba\x0f\xec\xac\x7f\x7f\x13\xcd\xee\x99\xb2\x49\x21\x32\x19\x9e\xb2\x8a\x82\x9c\x27\xf3\xcf\x2e\xdf\x44\x1c\xd8\x4b\x5f\x96\x29\xc7\x85\x64\xf9\xfd\xf5\x6f\x8f\xaf\x1d\x87\x12\xb4\x79\x0e\x17\x26\xa8\xb6\xe4\x1b\x17\xa9\xe8\xa4\x9c\xb6\x55\x93\x62\xd2\x3f\xce\xde\x6f\xe4\x60\x72\x05\xef\x89\xba\xcf\x0c\xe4\x53\xf2\xb5\xff\xf9\x24\x88\xe6\x2a\x0a\x08\xff\x6b\xec\x1b\x24\x9a\x56\x0f\xa2\xb5\xd4\x3b\xa1\x6f\xf0\x31\xc4\xe3\x7b\x79\xb3\x0c\x3a\xaa\xaf\x61\xa1\x4a\xad\x97\xd1\xf2\x34\xc5\xeb\xaa\x7d\xb0\x91\xc2\xae\x11\xcb\xc7\xf1\x35\x7d\x4e\x92\x93\x07\x26\x27\xec\x78\x18\x75\xfa\xbe\xa2\xa4\xf2\xab\x3b\x3f\x97\x55\x3b\xc6\xe1\x53\xfa\xfc\x7b\x8c\xf6\x3d\x87\xb6\x3c\xd3\xdb\x49\x9d\xd9\xe9\xf1\xab\x4f\xd4\x87\xe6\x26\x1d\xa2\x09\xf5\xfe\xe0\x7a\x3b\xba\xbf\xa7\xab\x43\xca\x04\x17\xe1\xb4\x9a\xf0\xf4\x85\xaa\xe2\x20\x82\x13\xe8\x41\x8e\x23\xa5\x0a\x53\xc9\x37\xd1\xfe\x84\xa4\x81\x4e\xba\xcb\xdc\xe4\x0b\xfe\xa9\xdb\x71\xbb\xbc\x00\xd3\xdf\xf4\x1f\x6e\xc9\xd4\x2c\x5c\x80\x18\x3b\x3f\xab\x51\x3c\xd8\x2b\x23\xc0\x03\xf1\xb0\x91\xdf\x26\xd7\x3b\x05\xbd\x21\x38\xda\x8e\x4b\x05\x1f\x5a\xb6\x78\x27\xfb\x97\xdf\xf5\x39\x19\x65\x3b\x22\xc1\xee\x94\x57\x61\x89\x91\xe6\x69\x99\x1e\x4a\x21\x21\x58\x0f\xfd\x68\xb5\xc8\xc9\xd4\x3e\xfe\x8d\xe1\x46\xc4\x74\xef\x4e\x79\x5d\x30\xcc\xb9\xcf\xd6\x22\x42\xaa\xcd\x8d\x41\xb8\x44\xf5\x5f\x52\xfe\x31\x51\x2c\x93\xbb\xcb\x0a\x8e\xb5\x36\x6c\xdf\x35\xce\xa0\xea\xa7\xc8\xbd\x72\x5f\xc7\x36\x29\xaa\x1f\xcb\x4a\xcd\x68\xe8\x3f\x15\x4e\x4e\x74\x75\xb7\xf7\xfb\x71\x3f\x70\x7e\x28\x6b\x8b\x5c\xea\xf0\x83\x1d\x49\x83\x23\xc7\xca\xc1\x5e\x53\x9a\x3f\xb0\x32\xa6\x79\x98\x94\x11\x45\xc1\x7d\xad\x09\xbb\xa5\x05\x3e\xdf\xb9\x0c\xcf\x85\x12\x69\x29\x0f\x9a\xfb\x7e\x3f\x81\x86\x88\x47\x32\xf2\x52\xd0\xfe\xf2\x49\x57\x3b\x91\x1f\xc2\x98\x1a\xc1\x1c\x56\x52\xba\xdf\x6a\x02\x29\x2b\x4a\x36\xf4\x98\x3a\x96\x08\x3f\xb6\x37\x27\x8d\xfa\x21\x49\x45\x46\x4a\x7b\xd7\x6c\x4d\x71\x1a\x69\xf4\x1b\x96\x64\x3e\x4b\xdf\xcb\x7a\xd4\x87\xea\xb1\xe9\x2f\x87\x32\x7d\xef\x9c\xda\xc8\xa0\xf6\xaa\x0f\x6f\xbc\xb0\xf0\x5a\x9e\x29\x5b\x9f\x5d\xba\x48\x00\xd7\x3b\xba\xed\xdc\xf9\xda\x5f\xab\x4c\x3a\xfc\x07\x79\x54\xa6\x96\xc9\x6d\xf2\x64\x4b\xc1\x75\x56\x07\x6a\x74\x3c\xd5\xf6\x50\xa7\x93\x2d\x85\x56\xa6\x46\x42\xed\x84\x97\x7a\xc5\xb6\xd8\x27\x76\xe6\x54\xdc\xd6\xb1\x44\xdf\xc4\xb0\xfc\x36\xdf\x62\xe0\x28\x6a\xdf\x2c\x5c\x27\x56\x1e\x3a\x49\xf4\xbf\xa2\x3f\x1d\xea\xb9\x52\xbd\x4a\xcc\x2b\xea\x4c\xfd\x3c\xde\x9c\x5b\xa7\x34\x89\x84\x1b\x2d\x97\x39\x71\x43\x1e\xeb\xea\x74\x20\xac\x84\xd8\xad\x40\xf1\x88\x5e\x1c\x63\x14\x11\x45\xef\xd8\xfb\xc7\x23\x65\xfa\xc5\xfb\xe5\x70\x02\x7f\x05\xf2\xba\x4a\xbd\x2a\x14\xc0\x6a\x2b\x70\x6c\x89\x17\x56\xe9\xac\x7c\xfa\x15\x29\xc1\x13\x4b\x1e\x1f\x8f\x9a\x7c\xde\x83\x48\xd2\xfe\x57\x27\x12\x23\x6f\x5d\xc3\x08\x91\x43\xf8\x44\x58\xdf\xfc\xab\x8a\x22\x4d\xfb\xbd\x8b\x2e\xc9\x47\x7b\x2f\x26\xb0\x4a\x38\xca\x9e\x54\xaa\x0c\x21\xe3\xa5\x31\x36\x8c\xc8\xab\x32\x8c\x52\x49\xe0\x07\x8b\x5e\x58\xce\x03\x0e\xab\xeb\x21\x3f\x4f\x78\x29\x97\x3f\xfc\x41\xfc\x58\xb3\xf7\xd3\x19\x29\x3e\x4b\x0f\xfd\x49\xfe\x50\xf1\xb3\xe7\x2e\x03\x2b\xea\x32\x7d\x64\x05\x59\x26\x96\xe6\x78\xf2\x53\xcc\xc9\xfb\x4b\x48\x38\x89\x5e\xb6\x80\x8b\xec\xc3\x5c\xf8\x06\xa7\xc4\xc1\xbe\xa8\xa6\x37\x26\xac\x70\x46\xe2\xb5\x52\x26\x0d\x4b\x43\x28\x37\x77\xc7\xc9\x7c\x70\x45\x6f\x28\xfc\xfb\x60\x6c\x98\x33\xe7\xe0\x93\xe1\x87\x28\x90\x4d\xae\x28\x60\xf1\x20\x59\xc5\x31\x19\xa9\x81\xe0\x11\x60\x88\x2e\x51\xe2\x5b\xbf\xef\x73\x4b\x8e\xa0\x65\x41\xee\xd8\x43\x80\x48\x9e\x48\x22\x2a\x63\xd5\xcc\xe1\x56\xbc\x3c\x02\xe8\xb4\xb3\xa2\xf0\x48\x85\x5f\x2b\x74\x40\x4a\xd5\x1c\x4c\xf2\x8d\xc2\xf9\xf3\x54\xb9\x4d\xe4\xaf\x23\x94\x87\x67\xb2\xd0\xdc\x60\xfe\x58\xf8\xc6\x9e\x4e\x97\x2a\x9d\xb8\xb9\x6b\x97\xd4\xac\x35\x19\x83\xe6\x98\x0a\x3a\x8b\x24\xca\x6a\xe2\xa1\xa4\xb2\x4f\x5d\xee\xa6\x59\x5d\xd2\x62\x06\x7b\x69\x2d\xe3\xde\x96\xd8\x2a\x4a\x88\x46\xc3\x23\x74\x7e\x67\xfe\x48\x61\x3d\x6e\xf9\x62\x1b\x38\xb1\xda\x42\xee\x60\x94\x81\x6f\x5f\xae\x8c\x28\xed\xd8\x7d\x38\x1c\xde\xae\xef\xcb\xbb\x61\x17\x01\xec\x66\xde\x7a\xbb\x8f\x9b\xf3\x87\x16\xfb\x4b\x03\xba\x32\x30\x60\x35\x71\xbe\xcb\xcc\x61\x7f\x91\x68\x98\xc5\xc1\x44\xd9\x84\x2c\x8e\x30\xdb\x23\x75\xc1\x34\xe4\x0d\x6b\x16\x7b\x4c\xb8\x02\x70\x31\x7c\xef\xc7\xca\x23\xd2\xf0\xfe\x9b\xff\x61\x7d\xcc\xb6\x51\x79\xb2\xcf\x9d\xd3\x8a\xc6\xb9\x0e\x52\x1b\x5a\x2b\xc9\x9b\x1d\x20\x25\x27\x60\x28\x7c\xb4\xcd\x07\xcd\x4f\x82\xd1\xa6\xc3\x6b\xac\x43\x98\xa2\x8e\x6b\x9c\xb3\x66\x57\xdd\x1b\xd2\x8a\xb8\x56\xca\xd8\xd6\x76\x77\x9f\x46\x6c\x0b\xdb\xec\xb9\xb7\x99\x1e\xb4\x1d\x60\x86\x0c\xfc\x88\xb3\xa7\xed\xf3\xd3\x09\x45\xa1\xa9\xc0\x44\x52\x74\x73\x28\xaf\xf5\x71\xf7\x43\x93\xc5\xe9\x2c\x0a\x7c\xed\x04\x29\xb9\xf3\x4f\x1b\x3b\xea\xa0\x77\x32\xc4\x8a\x93\x82\x05\x5a\xbd\x26\xe5\xab\x54\xf9\x1e\x15\x01\x14\x08\x34\xa3\x7e\x3a\xdc\xce\x1e\x18\xc0\xfb\xdb\xeb\x29\x6a\x22\x0d\x68\xc8\xaa\x5e\x6b\x3a\xef\x72\xa3\xfb\x37\xfb\x3a\x02\xd7\x04\xef\x98\xa6\x4f\xac\x9a\xed\x84\x11\x79\x1e\xe1\x44\x85\xda\x38\xea\xa1\x47\x66\x59\x2a\x33\x63\x34\x60\x3c\x1a\x0c\x89\xc3\x84\x76\x15\x09\xa5\xa8\xe3\x94\x36\xb4\x22\xd4\xdf\x96\xe7\x97\xb7\xf3\x7a\x23\xe7\xd7\xfe\xd2\x59\x78\x9b\xab\xe4\x8b\x73\xd3\xf5\xc6\x4f\xd7\xd3\x33\x5f\x78\x77\xce\xe7\xfd\x98\x29\x49\x3a\xff\xc5\x21\x33\x96\x76\x3c\x3b\x1f\x91\xb9\x8e\xee\xbc\x50\x5f\xe4\x30\xb2\xf3\x42\x35\x37\x49\x34\x81\xd6\xbe\xd5\xcf\xbd\xc2\x92\x0c\x25\x23\x7d\xe9\xbc\x6b\x08\xa7\x88\xd2\x98\x55\x16\x83\x35\xc3\x86\x98\x13\x3d\xa7\xfb\x5c\x27\x7f\x6f\xcb\x54\xa1\x85\xbd\x6c\xee\xa4\x7e\xb0\xbc\x52\x71\xe7\xd1\x6e\xa5\xfb\xcc\x57\xce\x87\x79\x25\x00\x2f\x5c\x3a\xa2\xfb\xc7\x5a\xec\x00\x89\xa8\xbb\xfd\x48\x5c\x98\xa0\x03\x2a\xc4\xd1\xe7\x15\x7f\x70\x51\xce\xcb\xc6\xa1\x93\xcf\xe7\x18\x8a\x49\x20\x57\x54\x7c\x85\x6d\x82\x08\x6f\xf3\x50\xef\x6f\xe4\x5f\xe7\xcd\x67\x26\xc8\x35\x97\x10\x58\xdd\x91\x88\x53\xa9\xe6\x98\xd7\xa1\xb9\xb2\xa1\x0d\xa7\x1a\xcf\x44\xda\xa2\x7b\x71\xb6\x23\x64\x95\x68\x6e\x96\x8f\xa5\x95\x6b\x79\xea\x5c\xcf\x6d\x2f\x24\xd2\xbb\x05\x82\xe1\xd3\xc2\x5d\x35\xba\x3f\x93\x14\x7f\xf8\xef\xc1\x14\x05\x0a\xe6\x7c\xd4\xde\xbc\x4f\x26\x01\x27\x8b\x42\xb0\xa5\x0e\xd9\x2a\xfd\x74\x23\x79\x37\xff\xaa\xac\xbe\x11\xf0\x1a\xf2\x36\x62\xb1\x00\x49\x3b\xde\xb4\x7c\x71\x57\x13\xd8\xed\xe1\x65\xd5\xdd\x2c\x9a\x0e\x51\xee\xc2\x49\x73\xbe\x52\xb1\x20\xb4\x9e\xe5\x2d\xea\xcf\x56\xf2\x7d\x6e\xfb\xa7\xb0\x36\x0a\x14\x38\x05\x61\x70\xc5\x8c\xa5\x4e\x3e\x99\xd0\x29\x3b\x53\x5c\x0a\xa6\x6f\x1c\x90\x59\x8a\xfc\x51\x61\x75\xda\x92\x1a\xa3\x97\xcb\xf2\xfa\x3a\xb0\x9e\xfb\x20\xd2\xca\x09\x6a\x62\x55\xd5\xfb\xfb\x9d\x24\x04\x09\xd5\x16\x37\x85\x16\xc0\x7b\xbf\x9e\xf0\x85\x4b\xa9\x1a\xe1\xea\x7d\x58\x8f\xe1\x34\x9c\xc9\x01\x3e\xb3\xc0\x3e\x1c\xce\x6e\x81\x61\xd5\xec\xaa\xab\xd4\x99\x28\xcc\xac\x32\xaa\x20\x7f\x29\xc2\x8c\x5f\x3f\x65\x09\x01\xf5\xb5\x77\xc6\xcc\x47\xc7\xc2\xe7\xf9\xed\xde\xcc\xbc\x82\x5c\x46\x70\xf9\x58\x3b\x26\x82\x56\xbb\xc9\x22\xfb\x78\xc7\x1f\xfc\xde\xc2\xd6\x2c\x11\x0a\x5b\xfa\x0e\x25\x28\x3d\xe2\xd5\x03\x72\x7e\xea\xc9\x85\xc4\x6b\xea\xb1\xea\x64\x25\x36\x5a\x56\x22\x65\xad\xb1\xad\xaf\x47\xa6\x3a\xb0\x26\xf4\xb6\xcc\xc8\xe1\x5a\xa5\x56\xd4\x4f\xe2\xa5\xd5\xb7\xb2\xf0\xfe\xf5\x59\x5f\x70\x93\x45\x3b\xf1\x95\x57\xe2\x7f\x47\xb1\x4b\x91\x86\x07\xf1\x45\x30\xbe\x22\x44\xbf\x7f\xb1\xc8\x9c\x7a\x1f\xf6\x44\xeb\xf2\xa1\xf3\x53\xfa\xdc\xad\x06\x26\x67\x17\x9f\xb6\xf2\x12\xe6\x3f\xbc\x2c\xbb\xf9\x2e\x85\xa5\x2e\x24\x6c\x90\x62\x14\x94\x24\xa1\xbe\xd4\xa0\xe8\xd0\xb7\x73\xe3\x76\x89\xb9\x65\x8c\x85\xf3\x86\x48\x27\x3e\xb9\x64\x21\xe8\xaf\x8a\xba\xf4\x00\xe4\xa2\x4b\x1a\x4b\xa1\xc4\x83\x4c\x9a\x7b\xc2\xf9\xfe\xa4\x6f\xa2\x85\xbb\x8f\xb6\xbc\xc0\xbf\xe3\xb7\x0f\xa3\x12\x39\xe7\x37\xa6\x69\x2a\x74\x3e\xf9\x44\x94\x1a\x0a\xbb\xdc\x38\xc9\x0a\x2c\xce\xa9\xc7\x79\x11\x9c\x69\xb8\xd6\x22\xf3\x00\xc7\x64\xb5\x05\xcf\x00\x46\xb2\xdb\xf9\xe4\xb2\xcd\xf4\x95\x21\x73\xab\x2b\x2f\x07\xbc\x97\xf3\xf9\x34\x7f\x5f\xfc\xa8\xcf\x27\x9e\x25\xb0\x56\x66\xd4\x3e\x1f\x98\x71\x82\xf7\xdf\xbb\x34\xde\xe0\x59\x62\x85\xbc\x97\xa5\xe0\xaf\xb6\xec\xbf\xc2\x38\x8a\x46\x78\x71\xf1\xf5\x61\x42\xba\x74\xf8\x88\x25\x28\xcf\xca\x00\x55\xfa\x0e\x73\x1c\xb8\x69\x47\xd7\x33\x50\xe3\x1f\x17\x24\xc7\x08\x09\xa3\x36\xa8\x9e\x9d\x20\x63\x87\x9c\x2a\xef\xdf\xcb\xfb\xc8\xa7\x37\x57\xcf\x7e\x89\xd1\xed\xa4\x81\xc4\xf3\xa8\x1e\x8c\x04\x97\x9a\xea\xd0\xf0\x62\x28\xef\x36\xa9\x69\x62\x21\xcc\x61\xa2\x89\xdb\x3b\x2b\x5a\x19\xed\x6e\xc5\x8d\x25\x15\x2c\xdf\xe3\x14\xbe\xa5\x8b\xe2\x33\xb0\xa3\xc8\x5f\x42\x11\x2a\xcd\xf1\x0e\xd5\xa2\xb9\x5e\xcf\xe7\xed\x81\x73\xc2\x0f\x3b\x5f\x74\x9a\xdd\x6f\x04\x57\x93\x72\x5b\xfa\x81\xa1\xb9\x89\x12\xbe\x59\xef\x16\x30\x59\x3f\xfb\x5c\x96\xfc\xf5\xdd\xa2\x6a\x55\x30\xcc\xb6\x6f\xcd\xfa\x94\x52\x16\x1a\xba\xce\x0f\x96\x21\x31\xa8\x27\xf0\x02\xa1\xee\x76\x1e\xae\x2d\x4d\xdd\xbb\xe4\x5b\xce\x12\x8e\xb4\x64\x22\xea\x5c\x7c\x05\x9a\x4d\xfa\x95\x60\x49\x7a\xd9\x43\xa7\x03\x11\x12\x86\xce\x4f\x7c\x2b\x32\x6b\xe5\x2a\xa1\x2b\x81\x3d\xb2\xfb\xd8\xb8\xeb\x44\x4d\xed\x32\x75\x0c\x52\xa5\x5f\xa0\x35\x6b\x58\xcc\x9d\xb5\x2c\xd6\xf9\xe6\x44\x74\x16\xbb\xcb\x12\x34\x69\xe7\xad\x71\xfe\xd9\xee\x89\x3a\xbd\x6b\x22\x9f\x48\x82\x5a\x3a\x62\xab\x2e\x12\x58\x9f\xd1\xb0\x6a\x2f\x9d\x80\xbd\x9d\x55\x1a\x1f\xdf\x8b\xf7\xb2\x1f\xa2\xf5\xd8\xe1\x6f\xff\xb4\xa4\x13\x1f\xa7\xc5\x55\x7e\xf3\x9b\xb1\xc2\xa2\xa9\x33\x8f\x11\x57\x63\x2f\x53\x18\x2f\x4e\x05\x71\xcd\x2d\x4f\xad\x98\x5c\xac\xcb\xf3\xdc\x91\x75\x3d\x9f\x02\xf5\xbf\x25\x60\xc0\xc3\x00\x45\x4a\x13\x48\x9f\x42\x67\x61\xbf\x8b\x22\xad\xc4\xc7\xec\x86\xb8\xa6\xc7\x1f\xdd\xdf\xd9\x4f\xf8\x93\x99\xeb\x2f\xd9\x9d\x9e\x49\x2a\xc0\x0c\xa7\x08\x21\xaf\xa9\xed\x02\xe9\x57\x35\xba\x8a\xdc\x20\x75\x68\xfc\x8a\x26\xb0\x12\x9f\x7e\xf9\xac\xb5\x3d\x96\xb9\x1b\x2c\xfc\x47\x24\x83\xd0\x34\x24\x41\x52\x84\xae\xeb\x45\x48\xa1\x79\x25\xff\x1e\x7d\x6c\xa9\x57\xc6\x16\x29\xc8\x16\x4f\x7d\xfe\xb2\x9e\xcb\xf6\x8a\x25\xd6\x04\x2b\xea\xc8\x76\xc7\x7c\x12\xbe\x76\x1c\x37\x8f\xb5\x18\x04\x60\x5b\xb5\x5d\x9f\xbd\xfe\xf0\xb2\x53\x45\xd8\x56\xf9\x0f\xb1\xde\x0a\xf5\x90\x41\x75\x73\x32\xe6\xb7\xe3\x41\x8b\x6a\xd8\x7d\xbc\x06\x00\x21\xdc\x66\x56\x4b\x7a\x10\x4e\x5c\xdc\x81\xfe\x0a\xd2\x68\xda\x9f\xf6\xde\xd0\xc0\x78\xc7\x8e\x6d\x54\x82\x6d\x03\x72\x45\xf2\x37\x31\xc4\xe4\x60\x85\x6d\x34\xaf\x8f\xb1\x8f\xf1\x24\x7a\x5e\x7a\x5d\xd4\x17\x89\xbd\xd3\xaf\x33\xab\xe7\x8c\xb8\x0c\xb5\x8d\xd9\x5e\x4b\x7e\x5a\x34\xd7\x3a\x0d\x3c\x37\x5c\x6e\xf4\x92\x3e\x17\xaa\xf9\x9c\x9b\x2d\xe4\x54\x88\x92\x71\xea\xf9\x70\x57\xc6\xca\xd9\x74\xc6\xd2\x6b\x33\xac\xac\x0c\xf1\xc2\x46\x3d\x39\xe9\xf0\xf9\x7f\x83\x56\x83\x05\x31\xa1\x63\x45\xf5\xc8\x0b\x44\x3b\xb9\x32\x89\xa3\x5d\xf6\xae\x48\x5e\x26\x41\xe2\x44\xc5\x3a\x26\xb9\x4e\x84\xdc\x0b\xf1\x26\x6f\x49\xe0\x2c\x3e\xc7\x69\x96\xbe\x7b\xaa\x52\xd3\x29\x1d\xfc\x07\xa2\x90\xcb\xf0\x69\xa7\x9a\x19\xe7\xcc\x1d\x03\xab\x6b\x96\x6b\xf9\x1c\x27\x3f\x40\xd7\x26\x61\xbb\xff\x36\x56\x29\xae\x78\xb6\x5f\x8e\xc9\x93\x82\x1a\x7d\xf6\x53\x9a\xac\x93\xcd\xb9\x9c\x59\xb9\x2d\x8e\x98\xda\xb6\x1a\x32\x17\x36\x91\x23\xd0\xf2\x0c\x25\xde\xf7\xfb\x61\xf5\x27\x8f\xfc\x21\x34\xb3\x28\x8b\x13\x10\x70\x86\xd5\x19\x8c\x80\x9d\xfa\xb7\xa3\xab\x60\xcd\x6e\x4a\x25\x94\x4e\xad\x8b\x44\x32\x94\x49\x18\x7a\xec\x81\x1d\xa1\x39\xed\x89\xac\xc1\x98\x85\xc8\x9d\xbf\x59\x91\x58\xaa\xe4\xa1\x01\x61\x84\x71\x76\x7b\xa9\x08\xcc\x21\xc2\xaa\x9c\x78\x91\x54\x4a\x3f\x77\xee\x72\xdb\x85\xcf\x3c\x72\x8e\xac\x77\x2d\x0f\x5b\xc0\x45\xcf\x31\x10\x50\xbb\x26\xc5\x58\x47\xe4\xb0\x92\x25\x16\xc5\xbe\x88\xf3\xd4\x63\xa5\xc5\x57\xb3\x93\x1b\xb1\x5a\x9e\xb6\x9f\x5d\x4c\x06\x4d\x88\x4e\x63\xca\xb3\x76\x1f\x87\xf8\xf3\x20\xcd\x5f\x84\x05\x85\xec\x5e\xd4\x92\xb0\x74\x2d\x32\xcb\xc7\x5c\xf6\xf8\xda\xd1\x94\x50\x59\xf5\x42\x60\x84\xe3\x29\x3f\xfa\x08\x48\xab\xf9\xee\x7f\xfe\xf7\x3f\xfe\x2f\x00\x00\xff\xff\x9c\x84\xb0\xba\xce\x07\x01\x00") - -func dataPasswordsJsonBytes() ([]byte, error) { - return bindataRead( - _dataPasswordsJson, - "data/Passwords.json", - ) -} - -func dataPasswordsJson() (*asset, error) { - bytes, err := dataPasswordsJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/Passwords.json", size: 67534, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataQwertyJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x98\xd7\x52\x23\x3d\x10\x85\xef\x79\x0a\x18\x72\xce\x39\xe7\x9c\x33\x98\x9c\xc1\xe4\x8c\x31\xcf\xfe\x6b\xf8\xb7\x56\xdf\xa9\xb2\xc6\xbe\xd8\xbe\xd9\x6a\x2f\x33\x5f\xb7\x5a\xad\xa3\x63\x67\x8a\x8a\x8b\xa3\xc9\xa7\xa3\x87\xcb\xa8\xa7\x38\xfe\xe0\x3e\x96\xb8\x70\xf7\x37\x74\x1f\x0e\x7f\xa2\xba\x3f\xf1\xdd\x6b\x3a\x9d\x2b\x8e\x5a\x86\xfe\x3e\x13\x3d\x2e\xcb\xf3\xbf\xe1\xde\xff\xff\x13\xa5\x22\x92\x7b\x7b\xfc\x5b\xbb\x19\x1f\xef\x65\xf3\x67\x6c\x1c\x8c\x84\x5c\x4a\x30\xca\x09\x02\xda\xca\x7c\xc2\xb3\x71\x1f\xbf\x6f\x2a\xb8\x8c\xe0\xd6\xd2\xfc\xe0\xf6\x72\x0f\x7b\x5a\x91\x24\x02\x2e\x27\x18\xd5\x04\xc1\x1d\xfb\x1e\xf6\xb2\x26\x49\x04\x5c\x41\x30\x5e\x0a\x82\xbb\x6a\x3c\xec\x75\xdd\xc7\x9f\xdb\x0a\xae\xb4\xda\xbc\x2a\x82\x51\x4d\x10\xd0\x54\xed\x13\xde\x2f\xfa\xf8\x6a\x5a\xc1\xd5\x04\x77\x57\xe5\x07\xd7\x1f\x78\xd8\xc3\x92\x24\x11\x70\x0d\xc1\x9d\x15\xf9\xc1\x48\x1e\x57\xc9\x7e\x0b\xb8\x96\x60\x54\x13\x02\x4b\x12\xf4\x3e\xde\x13\x01\xd7\x11\x7c\x3b\xef\x1f\xbc\x99\xf5\x71\x7a\xce\xc7\x0d\x03\xc1\xe4\x02\xae\x27\x18\x1b\x13\xac\xb2\xbf\x36\xf7\xe4\xb8\x7e\x0b\xb8\x81\xe0\xba\xbe\xdc\x55\x72\x0c\xdd\x58\x15\x54\x71\x23\xc1\x58\xa6\xc0\x2a\x9d\x56\x15\xd2\x7c\x21\x37\x59\xcd\x5b\xb3\x95\x22\xb7\x10\xdc\x5c\x92\x1f\x0c\x09\x8c\xb5\x92\x49\x04\xdc\x6a\x25\xc8\x6d\x56\x82\xdc\x6e\x25\xc8\x1d\x04\xa3\x9a\x20\x18\x82\x12\x8b\x30\x93\x08\xb8\xd3\x4a\xe9\xbb\xac\xe4\xad\xdb\x4a\xe9\x7b\x08\xa6\x40\xf0\x54\x51\x6d\x78\xbe\xa9\x1c\xb1\x20\x08\xb9\xd7\x8c\xdc\x67\x25\xc9\xfd\x56\x97\xc8\x80\x95\x24\x0f\x9a\x49\xf2\x90\x95\xc0\x0d\x03\x2c\x00\xc8\xad\x00\x9e\x57\x7d\xfc\xb5\x13\x96\xe4\x11\x56\xfc\xb6\xe1\x5f\xba\x98\xf4\xf1\xe5\x94\x8f\xef\x16\x0a\x6b\xf2\x28\xc1\x1f\x5b\x1e\x70\x3a\xe6\xe3\xf3\x09\x1f\x23\x79\x22\x78\x8c\x60\x2e\x93\x3a\x4e\xe9\x65\x92\x93\x51\x1f\xbb\xa2\x04\x3c\x4e\x30\x7b\xc9\x4d\xe2\xc5\xc1\x24\x5c\x95\x2b\x4a\xc0\x13\x04\xf3\x41\x02\xa8\xe9\xec\x3d\xf7\xc4\x55\x2f\xe0\x49\x82\xb9\x4c\xc2\xa8\xe9\xdc\xc8\xe3\x11\x49\x22\xe0\x29\x82\x59\x0d\x61\xd4\xf4\xeb\x99\x9c\x13\x12\x27\x11\xf0\x34\xc1\x04\xf0\xb2\xa0\xbe\x53\x86\xa9\x54\x2e\xa1\x80\x67\x08\xe6\x32\x99\x84\x97\x05\x61\x94\x43\x57\xbd\x80\x67\x09\xe6\x32\x09\x63\x95\x54\x27\xaa\x96\x4b\x22\xe0\x39\x82\x59\x0d\x61\x94\x7d\xaa\x13\x55\xcb\x25\x11\xf0\x3c\xc1\xdc\x0c\x56\xcf\x84\xa8\x32\xf1\xe4\x2d\x10\xcc\xf1\x61\xbf\x99\x04\x7d\x4d\x04\x2f\x12\xcc\xbe\x72\x12\x78\x39\xb3\x2d\xec\xb7\x5b\x95\x80\x97\x08\x66\x5f\x09\xa3\x2d\xe6\xd5\xca\x7e\xbb\x24\x02\x5e\x0e\xe9\x31\x44\x5f\x6c\x31\xf5\xe4\x68\x38\xac\xc7\x2b\xac\x98\x8a\x46\xe1\xa1\xc9\xe4\x51\xa7\x04\x38\x9d\x11\xf0\x2a\xc1\xa8\x40\x2a\x63\x42\x0a\x15\xf5\xdb\xdd\x26\x02\x5e\x23\x98\x8a\xc6\x2a\xe9\x5e\xa9\x21\xd4\x16\x57\xbd\x80\xd7\x09\xe6\x4b\x74\xac\xd4\x0d\x4e\x0e\xc7\xd0\x8d\xa7\x80\x37\x08\xe6\x8d\xc0\xfe\xb1\x32\xcc\x7a\xe2\x1c\x6f\x12\xcc\x9b\x99\x93\xc0\xdb\x84\xfd\xe6\x55\xe6\xf6\x47\xc0\x5b\x04\xe3\x3a\x97\x97\xb8\x61\x58\x55\x62\xc5\xdb\x04\x73\x94\xb8\x61\xec\x37\xe5\x94\xc7\xde\xb5\x4b\xc0\x3b\xa1\x03\xc2\xd1\x63\xf5\x18\xb1\xc4\x8a\x77\x59\x31\x75\x80\xc7\x98\xdf\xfa\x69\x31\xc5\x2d\xbb\xf3\x2d\xe4\x54\x8a\xe8\x02\x7e\x5a\x2a\xd8\x16\xee\x11\x4c\x89\x41\x9d\xd2\xa4\x54\xea\x3b\xf7\x1f\xe2\x05\x08\x7a\xdf\xea\xeb\xde\x81\xd5\x2f\x2d\x87\x81\xc9\x08\x82\x13\x7c\xb4\x80\x8f\xac\x3c\xf2\xb1\x95\x47\x3e\xb1\xf2\xc8\xa7\x56\x1e\xf9\xcc\xca\x23\x9f\x5b\x79\xe4\x0b\x2b\x8f\x7c\x69\xe5\x91\xaf\xac\x3c\xf2\xb5\x95\x47\xbe\xb1\xf2\xc8\x69\x2b\x8f\x7c\x6b\xe5\x91\xef\xac\x3c\xf2\xbd\x95\x47\x7e\xb0\xf2\xc8\x8f\x56\x1e\xf9\xc9\xca\x23\x3f\x5b\x79\xe4\x17\x2b\x8f\xfc\x6a\xe5\x91\xdf\xac\x3c\xf2\xbb\x95\x47\xfe\xb0\xf2\xc8\x9f\x56\x1e\xf9\xcb\xca\x23\x67\xcc\x3c\xf2\xb7\x95\x45\xce\xda\x59\xe4\x9f\x7f\x6e\x38\xdd\xbf\xd9\xa2\x6c\xd1\x7f\x01\x00\x00\xff\xff\x4c\xae\x50\xc0\xce\x20\x00\x00") - -func dataQwertyJsonBytes() ([]byte, error) { - return bindataRead( - _dataQwertyJson, - "data/Qwerty.json", - ) -} - -func dataQwertyJson() (*asset, error) { - bytes, err := dataQwertyJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/Qwerty.json", size: 8398, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _dataSurnamesJson = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x54\x7d\x5b\x62\xf3\x3a\xcc\xdc\x5e\xfc\xdc\x15\x74\x0d\xdd\x41\x9f\x28\x89\x96\x18\x51\xa2\x0e\x29\xda\x9f\xd3\xcd\x17\xc0\x0c\xe8\xfc\x4f\x27\x27\x5f\x12\x4b\xbc\xe0\x32\x18\x0c\xfe\xdf\xe3\xff\xa4\x76\x3f\xfe\xf7\xff\x7d\xb4\x23\xdd\xdb\xe3\x7f\x3d\x7e\xca\x76\xb6\x72\xca\x57\xef\x94\x73\x0a\x47\xb3\x6f\x9e\x51\xff\x3b\xd5\xf2\xd6\x7f\x5a\xc2\x2b\xe9\xff\x1f\xf2\x23\xb1\xe2\x67\xf1\x4b\x47\x29\x35\xca\x7f\xef\xf0\xc9\x45\xff\x25\x9c\x4b\xac\xf8\xb7\x9f\x30\xef\xfc\xd3\x5b\xba\xf5\xa7\xb6\x50\x2b\xfe\x50\xa8\x77\xd2\x7f\xb9\xb7\x72\x5c\xf8\xa1\x35\xd4\x39\x85\xf1\x8f\xf1\x57\xbe\xac\x65\x4a\x7c\xbc\x39\x87\xba\xdb\xb7\x96\x9a\xd6\x6e\xff\x9c\xe3\xdb\xfe\x5c\x8e\xfa\xd7\xdf\x21\xef\xf6\x74\x5b\xc8\x59\x1f\x45\x1e\x56\x7f\xf3\x53\xfa\xb9\xea\xb7\x63\x3d\xf5\xf1\xf4\x37\xf7\x64\xdf\x7a\xcb\x9f\xda\x6e\xfd\x0b\xe5\xb2\xef\x6f\xc9\x7e\x75\xad\xd1\x7e\x35\x2c\x58\x90\x29\xe0\x2f\xaf\xe5\xfc\x0d\xd9\x7e\xf2\x8c\x5c\x82\x59\x1e\xd7\xfe\x51\x56\x74\xde\xa2\xfd\xfe\x15\xab\x3f\x7f\xac\xb7\xfe\x85\xbb\xd7\xd3\x7e\xea\xd2\x8f\x48\x57\xb3\xdf\x3c\xae\x89\xbf\x20\x2f\x67\xff\x1c\x5f\xe1\xd4\x7f\x8b\xcb\x3b\xd4\xc5\x7e\xaa\xc8\xcf\xdb\xf7\xda\x1d\xe5\x9b\xfa\xb8\x2d\x9c\xf2\x51\xbf\xb6\x01\x5c\xd2\x5a\x56\x59\x78\xfd\x22\xc6\xc5\x7e\xad\xec\xf8\xf7\x35\xe8\x63\xf2\x83\x8e\x5e\xaf\xed\x63\xaf\x94\x72\xd4\x2f\x6a\x7a\xc5\x1a\xf0\x1b\x97\x3d\x43\x4d\xf3\xa6\x1f\x8e\xd7\x2b\xff\x74\x5d\x8a\x3e\x8e\x2d\xb2\xfd\xe7\x96\x8f\xb5\x23\x72\xc5\xdb\xf7\x7b\xad\xc1\xfe\x5e\x38\x12\xde\xfe\x1d\x6e\xfc\x8b\x9c\xa3\xb2\x37\x3c\xf7\x82\xa7\xbc\xe4\x43\xa2\x3d\xd6\x79\xc6\x5b\xdf\xe9\x5d\xca\x62\xcf\x55\x71\xf8\x6a\x69\xcd\x76\xed\x7b\xa2\x64\x29\xe2\x61\x6f\xf3\x13\xcf\x1d\x8b\x22\x8f\x5c\xf5\x63\xaf\xf2\xc6\x1b\xe6\x62\x5b\x7b\x85\x7b\x3c\xd9\xd6\xd7\xcd\xfe\xe6\x53\x0e\xa9\x7d\xf1\x0e\x6d\x93\x23\x70\xe3\xf1\xfa\x8d\x63\xdd\xd2\x71\x14\xfb\xab\xcf\xd2\xee\xbf\x3b\x8e\xdb\xf0\x09\xe7\x6d\x07\x2b\xfe\xb3\x17\xb1\x97\x4e\xcf\xa7\x1d\xe5\x25\x05\x3b\x41\xe1\x63\x3f\x7d\x7c\xf0\xa2\xcf\x62\x0b\xb6\xc9\xaa\xe4\xdb\xd7\x49\xfe\x4f\x3f\xae\xcb\xce\xbe\xec\x7d\xe4\xec\xe6\x60\x0b\xa2\xcb\xc0\x6d\xb7\xff\x8d\x4d\x3f\x52\x5e\xee\xc4\xe6\x7e\xce\x92\xed\x07\x9e\xa9\x6d\x38\x32\xf2\x57\xda\xb8\x5d\xf8\x88\x34\xf1\x7e\xce\x4b\x39\x43\xb6\x03\x51\xfb\x2f\x6e\x57\xe3\x05\x29\x72\xcf\x7e\xed\x1d\x0f\x9c\xa5\x5e\xb1\x85\x4f\x39\x43\x58\x67\x5d\x53\x5b\xaf\x38\x4d\x58\x20\xde\x56\x59\x9e\x17\x1e\xe9\xee\x33\x8e\xee\x55\x78\x11\xb6\x34\xdb\x6e\xcf\x35\xbc\xf9\xfa\x53\xf9\x2c\xf6\xe1\x6e\x36\x2a\x17\x75\xd7\xfd\x5f\x3e\x38\x59\x35\x62\x21\xff\xd9\x0f\xc9\x41\x2a\x7c\x67\xac\xbf\x5c\xa1\x66\x8f\x5b\x17\x3c\xc3\x16\xde\x76\x36\xf3\x81\x13\x83\x23\xc5\x4b\xc7\x9d\xb7\x1d\x5b\xc2\x99\xa2\xbd\xc8\x15\xe4\x87\x71\x5b\xf1\x66\xa7\x1c\xf6\x62\x5f\xc9\xbe\xd8\x0f\x3f\x63\x5d\xbb\xbf\xa5\x58\x42\x5b\xda\x37\x8f\xdb\xd2\xcf\x13\xa7\x8e\xdf\xd8\x3a\x2f\x4a\xbb\xe2\x39\xe3\x4c\xc8\x1d\xc1\x65\x97\x55\xba\x36\x2c\xd3\x15\x3e\xf6\xa7\xae\x14\x2b\x4f\x3e\x0e\xee\x21\x07\x75\x8b\x6f\xfd\x19\x39\xfa\x25\xe3\x96\xad\xa7\x1b\x5a\x6c\xae\xdc\x25\x7e\x60\xf9\xda\x9d\x5a\x6c\x1f\xe5\x99\x66\xdb\xad\x76\x7e\x16\x5a\x40\x33\x13\xb3\x3c\xac\x9c\x72\x9c\xb6\x1c\xec\xf3\xe5\xe0\x56\x7c\x5a\xed\x09\x07\xb6\xe2\xda\x3f\xed\xa6\x57\x9a\x85\x50\x8f\x76\x57\xdc\xa5\x59\x7f\xe4\xc4\xe6\xbe\x63\x78\xf1\xe4\x8b\x8d\x8c\x3c\x7f\xc5\xae\xb0\x98\x8d\x97\x9d\x24\x39\x27\x5f\xe3\x60\xbb\x9c\xf1\x57\x9f\xb2\xc6\x7b\xb6\xfb\x92\xc3\x1b\x2f\xf2\x94\xad\xb1\x13\xbd\xf6\x5b\x16\x07\xb6\xa3\xcd\xdb\x91\x96\x9b\xef\x29\xff\x79\x85\xf6\x1f\xac\xfe\x1c\xda\x2d\xcb\x52\xf4\x61\xb6\x18\x71\x75\xe5\xa3\x2f\x1c\xd9\x92\x13\x1e\x50\xae\xf2\xad\x47\xbb\xc2\xca\xc1\xa6\x3d\xbe\x8e\x0e\x4e\x4a\xfd\x1f\xcd\x80\x3c\x9a\xdd\x5c\x39\x6f\xfa\xfb\x93\x5c\xb0\x72\xd9\x25\x9a\xcb\xc7\x0e\x1a\x4d\x4c\xc8\xaf\x50\xff\x98\x5f\x1c\x35\x31\xdc\x76\x7e\x9f\x7f\xfc\x8c\x1c\x85\xdf\x80\xb3\x8b\x0f\x39\xd7\xfe\x89\xf4\x8e\x65\xc2\xf1\x4e\xba\xe5\xcf\x4e\xdf\x9a\x3f\x62\xdb\xf1\xab\x15\x96\xb1\xea\x4b\x14\xdc\x46\xfb\x27\x71\x85\x5c\xba\x1a\x7e\x13\x1e\xb6\x8b\x03\xe1\x53\xe0\x8a\x89\xdd\x2c\xf6\xd9\xf2\x8c\xf1\x2c\x76\x09\xdf\x58\xa2\x23\x2e\xe9\x0c\xb6\xe5\x6f\x7c\xe8\x24\x67\x02\x27\xa7\x3c\x9f\xf8\x21\x59\x77\x9e\xb4\x96\xe4\x7d\x6d\x3b\xfd\x73\xe5\xc6\xc8\x71\xb2\xc7\x16\x8b\x0c\x5f\x2a\x26\x19\xef\x2f\x6b\xb3\x06\xbb\xb0\x1f\xbb\xfb\x1a\x3d\x2c\xfe\x7b\x17\x4f\xf1\x61\x86\x66\xd3\xed\x36\xe7\xf3\x0e\x8b\x3e\x7e\x2b\xb7\xbd\x68\xc8\x3c\x39\x67\x0c\xd9\x1e\x26\x2f\xc3\xbe\xbf\x23\x3e\x4e\xcf\x36\xbc\x73\xa5\x0f\x91\x2b\xfc\x32\x53\xf0\x93\xe4\xfd\xe1\xd1\x0b\x57\x5e\xac\x65\xf6\x8d\xf6\x95\x2d\x53\x4d\xf1\xe4\x99\xb2\x25\x6e\xfd\xbe\x69\x39\xe5\x49\x4f\x3b\xb4\xb9\xcf\x81\xe1\x0f\x3d\x93\x84\x20\x7e\x18\xe5\x72\x4d\x78\x54\x59\x14\x0b\x25\xec\x1b\x37\xd6\x46\x23\x82\x8a\xeb\x7b\xe3\x51\xef\x08\x5b\x6d\xd6\xbd\x6e\x65\xa1\x1b\xb5\xfd\x98\xe2\xbc\xdb\x4b\x73\xa3\x36\x35\x1a\xf6\xd1\x33\x4c\x18\x37\xd6\x3e\x7a\xea\x6d\xb3\xe5\x16\xef\x66\x36\x49\x62\x08\x33\x51\x7e\xb1\xc4\xdb\xde\x29\xac\xfa\x5a\xa7\x87\x09\x7a\x09\xf4\x9d\xc4\x32\x45\x7b\x84\xb9\x7f\xfd\xa7\xbd\x86\xdc\xbc\x9e\xef\x5f\xac\x13\xc3\x9e\xfe\x8b\xe7\xb9\xc2\xaa\xbf\x73\xf4\xb3\xe0\x07\x6c\x47\xec\x76\xf3\x12\x9e\x0b\x23\xc4\x38\xf1\xc5\xb3\x3d\x65\xfe\xc0\xb1\x8a\x51\x6f\xb6\xa8\xef\x92\x9f\x11\x1f\x77\xca\x0d\xc0\x8d\xed\x1e\xea\x48\x58\xd0\xdc\xc6\xd7\x0b\x67\x37\x72\xef\xf0\x87\xe7\x7e\x1c\xdc\x7f\xf1\xe4\x70\x10\x7a\x48\x12\x5c\xac\x7a\xe5\x1b\xcb\x93\xb1\x5c\x5b\x9f\x26\x04\x2f\x2d\xe4\xf0\x1b\x2c\xd2\x89\xf1\xc5\x78\xa0\x0e\x8b\xfd\xf2\xcf\x96\x3b\xb5\xc6\xc6\xb8\xe5\x36\x5f\x74\x07\x0b\x64\x67\x06\x27\xab\xff\x9a\x2c\x8f\x1d\x9a\x30\x23\xe8\xb2\x7f\x95\xe0\xb6\x9e\x7e\x9a\x56\x8b\x51\x9f\x62\x56\xed\x17\x96\x98\xd7\xb0\xe8\xd6\x84\xb5\xa7\x6c\x4f\xf3\x8a\xab\x1e\x82\x35\x97\xd7\xf8\xa3\xb8\x5b\x73\xd9\x22\xce\x43\x3d\xe0\x1b\xcb\xe2\xe1\x5e\x99\x26\xac\x99\x9c\x1a\x9e\xef\x1c\x12\xfc\xf0\xba\xe2\x9f\xe4\xaf\x54\x73\x02\xf2\xc2\xcd\x5e\x40\xfe\x34\x3d\x9c\x58\xc6\x9d\x97\xf9\x96\x70\x5f\xee\xf0\x62\xc7\xe1\xf6\x00\xa8\x70\x51\xf5\x52\xf2\xc3\xdf\x30\x35\xc7\x85\x6f\xa8\xe3\xb7\x47\xd7\xa0\x0b\x7f\xf6\xed\x76\x48\x7f\x9f\x56\x47\x76\x42\x82\x11\x7b\xe9\x0f\xef\x81\x1e\x78\x04\x31\xfa\x18\x6e\x24\xe4\xdd\xe0\xcf\x0b\x22\xa1\x13\x8b\x1c\x16\x1a\x0f\x39\x5c\x0c\xcf\xe4\x6f\xba\x87\xd6\xd0\x0d\x16\xc9\x4f\xb2\x18\xd8\xc9\x76\xa3\xd8\x91\xff\xaf\x27\xf8\x6e\x09\x73\xf5\xa1\xdb\x24\xdb\x63\xc7\x79\xd6\x18\xde\xa2\x62\x49\x2c\xd4\x22\xe9\x23\x4a\xe0\x55\x25\xfe\xc7\xee\x2f\xe5\x65\x76\x48\x02\xab\x09\xb1\x02\xb6\x58\x0e\xd9\xaf\x6c\x04\x22\x2c\xf1\x23\xbb\x3d\xf8\x52\x3e\x76\xb7\x5a\xe8\x1e\xef\x4a\xa2\x62\xeb\x5e\x32\x03\xb4\xaf\x23\xc1\x8a\xa8\x3b\xb5\x28\x2a\x2c\xf2\x6f\x30\x89\x6e\x03\x3b\x4c\x99\x5e\x37\x9e\xe0\x79\xd3\x4c\xc0\x3c\xd0\x2c\x36\xcc\x6c\xe7\x56\x3a\x3d\xd9\xbc\xc9\x65\xbf\xdd\x1e\xef\x39\xda\xfe\x5d\x35\x98\xd1\x93\x9f\x5f\x57\x84\x24\x6a\xce\x61\x5e\xb2\x5a\x11\x38\xe6\x5f\x89\x82\x63\xc5\x9e\x49\x24\x08\x6f\x34\x75\xbd\xdc\xc1\x83\x37\x44\xe3\x57\xe4\xc1\xb9\xd2\x7d\xe3\x17\x26\x79\x9d\x0f\xd6\xb4\xd4\x23\xd9\x75\x50\x6f\x21\xf9\x83\x65\x1d\xb5\xd8\xb7\xae\x82\xf0\x36\x17\x66\x27\xa1\x31\x2f\x34\x6b\xb1\xd4\xb0\x23\x18\xa6\x6b\x79\x3e\x3d\x96\xbf\x90\x06\x1e\x6e\xd6\xc3\x34\x21\xf8\x68\x6e\xff\x4e\xff\xa7\xad\x3f\x9f\xf6\x47\x1b\x4c\xce\x53\xf3\xc6\x5a\x2c\xd7\x71\x4f\x36\xf9\x61\xb1\xa8\xb1\xb9\x7f\xc0\x1f\xb8\xf1\xa2\x6a\xd1\x1f\x8c\xaf\x47\xce\x50\x70\xee\x66\x3d\xfb\xe6\x08\x34\x3f\xb5\xd3\x14\xee\xcd\x4c\x6d\x93\x1f\x16\x0f\xe0\xc9\x35\xcf\xee\x1c\x6c\x91\xed\x60\x30\xe5\xd9\xb8\x08\xe2\x72\xe2\x29\xfe\xfc\xc1\xa4\x0f\xe1\x40\x37\xcf\x20\x61\x64\xbe\xb0\x55\x62\x2f\x2c\xe7\xd6\x7d\xc7\x45\xd1\xbf\xee\x0f\x7f\x06\x5b\xc1\xd6\x75\x13\x2d\xa8\xf4\xc0\x51\x7e\x0a\xc9\x9c\xee\x16\x2f\x16\xa2\x32\x59\x76\xba\x33\x8d\xb1\xe1\x1a\xe7\x22\xa7\x08\xfb\xbc\x05\x3b\xbb\xe2\xc7\xe3\xa9\x41\xbe\x3d\xb2\x3d\xf9\xca\x6b\x1c\x3e\x21\xe3\xa6\xbc\x11\x3b\xbd\xc2\x2f\xff\xe2\x92\xe6\xf1\x6c\x76\xb3\xf5\xc7\x67\x49\xaf\x2c\xfe\x90\x60\xe7\xb4\xbb\x76\xa5\x13\xd1\x0a\xe3\x71\xa6\x09\x67\x2d\x11\xbb\x2d\x46\xe7\x01\x24\x81\xb9\x78\x51\xbb\x60\x98\x43\x33\x4f\x0d\x6f\x53\xf1\xe3\x19\xf1\xcd\x9e\xea\xf4\xe1\x49\xc0\xf9\x94\x8b\x77\x00\xb2\x58\x8a\xfa\x0f\x3c\x64\x61\x98\x21\xc7\x19\xe6\xf6\xb0\x5b\xbe\x8b\xd1\x64\x3c\x7d\xce\x38\xb8\xab\xde\xc1\x75\x63\x9c\x4f\xc7\x23\x4e\x4a\x0f\xa8\x7d\x85\xf5\x79\x0f\xd3\xab\xc7\x01\xf1\xb6\x5c\x89\x8c\xcd\x97\xd4\x6d\xc4\x05\x66\x07\xda\x81\xff\x1e\x1e\xa2\x68\xd2\x80\xbd\x99\x60\xd5\x96\x8f\xa7\x9b\xc8\x75\xe4\xe5\x6f\x0d\x9d\x6c\x63\x3f\xbc\xd8\xe1\x1f\xac\x62\x3b\x6d\xb1\xc4\x0d\xe1\x6f\x48\xe8\x23\xe7\xc7\x2c\x87\x86\x8e\x70\x25\x85\x5e\x66\x8a\x81\x3f\x86\x70\x3d\x0e\xc4\x66\x8b\xc1\x92\xb6\xc8\x54\x76\xfd\x26\x98\x92\x3d\x33\x68\x57\x1f\x67\x3b\xff\x42\x6c\x20\x7b\x67\x7f\x41\xde\x50\xf6\xee\x9b\x8e\x30\x9f\x94\x73\x03\x13\x76\x74\x8f\x1a\xf6\x78\xa8\x87\x17\x8f\x18\xfd\x6a\x99\xe7\x16\x67\x12\x19\xfb\x89\x69\xe3\x2d\xb2\x07\x8d\x81\x76\x4e\xb6\x39\xda\x99\x7f\x69\x32\xc4\x3b\x8a\x30\x71\xeb\xc7\xb5\x55\xbc\x97\x3d\xb7\xd9\x95\x8e\x23\xbd\x75\x09\xcc\x1c\x59\xda\xe0\xe3\x97\x52\x61\x26\x26\x89\x42\xb0\xd9\x62\x13\x98\xfa\xc7\xc0\x50\x96\xfb\x23\x21\xad\x1d\x78\x4d\x2b\x1e\xe6\x71\xe7\x9d\xf1\xe9\xa7\x98\x81\xb2\xc4\x02\xff\x74\xca\xb5\x96\x05\xbb\xcc\xa2\xc4\x57\xb2\x60\x5c\x82\x10\x39\xa3\x0e\x03\x15\x60\x22\x3d\xe1\xee\xe9\x21\xdb\x68\x6c\x25\x82\xf8\x04\xbc\xda\x82\xe0\x46\x7d\x94\x05\xf6\x92\xdc\xf3\x43\xe5\x3a\x3d\x99\x6a\xeb\x09\x8d\x6b\x21\x76\xd2\xfe\x9a\x1f\x5f\x5e\x5c\x20\x39\xda\x15\x9f\x07\x13\x41\x57\x8e\xe8\x84\x6e\x79\x2b\xf0\x77\x77\xe0\x0d\xdb\x4f\x98\x90\x20\x07\x78\xb6\xf7\x60\x8a\x0b\xb7\x96\x61\xc7\x6b\xf9\xb1\x57\x6b\xfa\xa4\xf6\xba\x07\x8d\xb3\x62\x03\x38\x0a\x51\xac\x23\x76\xa5\xbd\x35\x93\x44\x54\xca\x8c\x53\xef\x4a\xaf\xb0\x84\x27\x5c\x47\xc5\xa9\x90\xc4\xe1\xc4\x66\x3c\xc7\x5e\x9b\xc7\xc7\x3d\xaf\x06\x97\x9c\x84\x10\xde\x31\x21\x12\xab\xfd\x87\x29\xa3\xa1\x25\x38\xc3\xb9\x00\x4b\xea\x4c\xe6\x24\xcc\xa1\xc7\x15\x7f\x18\xe1\x97\x0a\xed\x99\xfa\x64\xf9\x38\xb3\x12\x1a\x2f\x00\x26\x94\xa4\xd8\x3e\x57\x73\x54\xfe\xfd\xc0\xcb\x22\x3f\x6e\x16\x31\xfe\xbb\xe9\xb7\x2c\xeb\x97\xd8\xda\x9e\x38\xea\xb9\x98\x1f\xc4\x58\x11\xe5\xbd\xc4\x9d\x7a\x92\x2b\x9f\x6f\x27\x4b\xbd\xee\x6a\x7f\x47\x6f\x0b\x36\xd5\xdc\x90\xbe\xa5\x1e\x4f\x5d\x88\x42\x53\x21\xd7\x2c\xc3\x7a\xcb\xde\xce\x88\x2b\xd4\x43\xdb\x33\xca\xd9\x07\x10\xa0\x36\x87\x69\x93\x1d\x03\xd9\x6a\x73\x27\xa1\x13\xfd\x7b\xe1\x83\xd4\x95\x13\x62\xb9\x24\x38\xc0\x03\x02\xd6\x44\xe6\x21\x11\x12\xc3\x9d\x65\xc0\x3a\xe6\x29\xd4\xde\x5c\xc4\x0b\x63\xdc\x79\xc8\xe5\x85\x0a\xee\x92\x27\x61\xf6\x4b\x92\xae\x6b\x1c\xcf\x38\x39\x2d\x8b\xfb\xcc\x66\xf9\x26\x1e\x84\x41\x48\xd6\xdb\x63\x7f\x0e\xf1\xb0\x1c\x52\xbc\x82\xc5\x88\xb8\xf7\xe1\x36\x40\x61\xdc\x18\x5b\xbd\x02\x14\xe5\x29\x61\x9b\xe5\x89\xcc\xe4\xec\xde\xaa\xcf\x7b\x58\x0a\x76\x0e\xf7\xae\x76\x8a\x50\xe7\x33\xb9\x97\x9c\x93\x66\x01\xfa\x20\x7b\xb1\xe7\x91\xcf\x55\x5b\x81\xc5\xb1\x0d\xdd\xf0\x3b\xb2\x86\xc8\x80\x25\x7c\x62\xd0\x14\x7f\x0c\xdc\xde\x81\xc2\x48\x7e\xe3\xd8\xa3\x44\xdf\xf6\xe7\x25\xc0\x94\x6f\xc2\xa0\x1d\x61\x59\x80\xc6\xf4\xd6\x0a\x36\xe9\x24\x54\xad\xbf\x61\x6b\xcd\xc4\x42\x81\x2c\xf8\x69\x79\x39\xf3\x76\x12\xc8\xac\xb6\x2d\x04\xc1\xe4\xca\xe0\x52\xfa\x91\xea\x75\x9c\xad\x07\x6c\x18\x63\xe7\x43\x2c\x7e\x31\x67\xf5\x0c\x3d\xef\xb8\xf2\xe2\x1c\x11\xad\xee\x67\xb8\xd4\x88\xed\x34\xbb\xb2\x08\x16\x4c\x01\xca\x20\x88\x8f\xb4\x5e\xce\x1c\x41\xc0\x8d\x41\xb6\x9e\x09\x2c\xce\x16\x99\x1f\xcb\xad\x59\x22\x6c\xa0\xad\xed\xa7\x12\xc6\xcf\xb4\x3d\x19\x96\x02\x10\xa6\xa3\x5e\xe7\xdd\x71\xd4\x92\x07\xd2\x1a\x3d\xd8\x3d\xe8\x0a\x52\xd9\x7d\x97\xef\x32\x1e\x95\x6f\xb9\x77\xb3\x75\xdb\x61\x68\x24\x5e\xc1\x9a\x78\xc6\xb9\x4a\x90\x67\xb7\x69\x19\x89\x88\x24\xeb\x37\xe3\xf8\x53\x0c\x20\xe2\xc6\x89\x80\xc5\x1c\xeb\x2b\xf0\xe3\x36\x26\x44\xe9\xf4\xc0\xb3\xd2\xf1\x1a\x26\x28\x5f\xfc\x06\x8d\x9a\x1f\x9a\xf8\xd0\xbe\xe9\xa2\xea\x4f\xb8\xf1\x11\xe7\x7b\x5b\x06\x52\xba\x1d\xde\x63\x16\xfb\xc6\xf0\xba\x05\x87\x5d\x65\xc9\xe8\xb5\x81\xd4\xca\xa5\x1a\x00\xaf\x5c\xa1\x6e\xb1\x59\xf4\xe4\x48\xae\x2b\xb1\x02\xcd\x29\x80\x18\x05\x3e\xda\x56\xae\x8b\x51\xcc\x88\xce\x35\xe9\x33\xf4\xa4\x7c\x46\x36\x6c\xab\xac\x39\x6a\xad\xdf\xac\x89\x16\x86\xf1\x03\xa1\x70\xc5\xf6\xcc\x25\x88\x45\xf3\x07\xff\x20\x21\xba\x34\x08\x44\x94\xce\x3b\x2d\x67\xb2\x98\x51\x3a\x73\xb8\xec\xae\x7e\x96\x48\x57\x45\x30\x60\xde\xed\xa1\xe6\x22\xb1\x15\x53\x0a\x31\x70\xe6\xff\xdf\x9e\x16\x17\xbf\x3b\x72\x07\x69\xb0\xe9\xa8\xe6\xc2\x54\x54\x8e\xd1\xc2\x97\x41\xea\xf0\x8c\xee\x37\xf4\x30\xf1\xcb\x67\xa7\x67\xcf\xc5\x5d\xb0\xfc\x16\x2c\x77\xf1\xb4\x6b\xf3\x0a\xc9\xc4\x1b\xa4\x80\x05\x30\x3f\x82\x8c\x6a\xbd\xf4\x8f\xc4\x97\xfe\x7f\x59\x86\x59\x9a\xe8\x6a\x17\x7d\xd2\x88\xd7\xd0\x7b\x0a\x30\x20\xf9\x27\x84\x4c\x43\x28\x7f\xd0\x00\x22\xa6\x6a\x7a\x55\x23\xff\xe4\x61\xeb\xf6\x7c\x22\xa5\xb9\x7f\x25\x4e\xaa\x48\xb4\xcc\x84\xfc\x4a\x60\x85\x32\x1a\x5c\x57\xc8\x0c\x0c\x8e\x59\x83\x40\x9c\x23\x71\x46\xaf\x68\xfe\xc1\xc0\x30\xd6\x7f\x0c\xdb\xa8\x7a\xdb\xb1\xf0\x9e\xdf\xab\xad\xe1\x16\xac\x72\x54\x60\x6c\xc2\xd3\xd6\x29\x47\x96\x4c\xde\x08\xe5\x0d\x68\x27\x54\x93\x90\xac\xde\x81\xf7\xa2\x9d\x04\x7a\xc4\x52\x8d\xa2\x0a\xcd\xda\x1b\xeb\xb3\xc1\x56\xd9\xa6\x99\x71\xd2\xda\x0c\xb2\x86\x81\xc7\xe9\x67\xca\xb5\x86\x5b\xd1\xbf\x1e\x91\xa6\xe7\xc0\xfa\x43\xd8\x08\xdf\x00\x0f\xd3\x2c\x95\x81\xa0\xbd\xa1\x1a\xea\xc0\x3b\x62\xf8\x92\x99\x1d\x89\x78\xdd\x71\xdc\x21\x7b\x62\x34\xa7\xc0\xda\x03\xcb\x6c\xe1\xce\x09\x69\xe5\x3c\xfb\x1d\x5c\xf0\xac\x7b\xe8\x9e\x65\x14\xfb\x91\x19\xb9\xd8\x54\xb2\xa3\x40\x4f\xff\x59\xf3\x64\xe6\x09\x18\x2f\x48\xaa\xe2\x30\xcc\x2e\xc7\x48\x9f\x48\x02\xc9\x01\xc5\xfa\xfa\x4b\x8c\x8c\x93\x98\x35\x49\x79\x20\x8c\x22\x14\x9b\xe0\x25\x9b\x2c\xae\xad\xc2\xf9\x85\xdc\x01\x62\x55\x0d\x58\xb0\x47\x2f\x7a\xee\x37\x51\xb9\x76\x88\xa7\xc1\xb6\x25\x5a\x69\xee\x88\x9c\x1e\x16\x83\xec\x78\xa1\x46\x5b\x68\xbe\x74\x6d\x59\x58\x7a\x79\x08\xb9\xc4\x9f\xd8\xba\xed\xe2\x67\x41\x7c\x52\x27\xfb\xb8\x15\xc8\xfb\xc3\xa0\xfe\xad\x26\xd6\xbb\x6e\x24\x24\x1d\xc0\x9e\x1c\xc8\x6c\xe9\xcb\x44\x14\x45\x5c\x5c\xd8\x86\xb3\x3c\x79\x80\xe4\x46\xe8\x8e\x76\x37\x2c\x9a\xba\x61\xd3\x24\x44\x7d\x67\x26\x49\xc5\x52\x72\x0d\xac\x3c\x1f\xd5\x7d\x76\xa3\x81\xd8\x40\xd2\x1c\xfb\x8b\xbd\xb1\x46\x7d\xfb\xe6\x7f\xfc\x40\x44\x9a\x10\x5d\xca\x04\x20\xee\x84\x3f\xe0\x75\xc8\x7d\x06\x6a\xa4\x51\x8d\x59\xb6\x66\x88\x8a\x1f\x48\x3b\x44\xe5\x1b\xa5\x48\xea\x69\xa9\xeb\x54\x3a\x33\xc1\x50\xf9\xc5\x54\x70\xe5\x97\xf2\xb5\x14\x28\x9b\xda\x32\x9d\x91\x21\xff\x4c\x18\xee\x8d\xd7\x78\xca\x72\x12\x68\x9b\xdc\xfa\xbe\x91\x6e\x2a\xfe\x42\x17\x18\x50\x7b\x92\xe4\x07\xd9\xdb\x27\x54\x09\x40\x11\xc0\xac\x8a\x46\x01\x28\x2a\xf3\x5d\xe0\x41\x10\xbd\x65\xc9\xcd\x11\xc6\xc3\x8b\xc9\x3a\xac\x96\x9b\x4d\xe2\xfa\xed\x68\x58\x10\xd2\xa3\xd5\x09\x24\xf5\x0b\xf1\x39\x2e\xba\x99\x99\x2d\x66\x54\xd2\xcb\xc7\x9e\x60\x05\x7e\xd6\x6e\x3f\x35\x19\x88\x4f\x52\x7b\x64\xc7\x97\x29\x9a\x2d\xf2\x6b\x04\x66\xfa\xd6\x74\x60\xc1\xc1\x75\x45\x5d\x99\xb9\xe1\x06\xbc\x0b\x81\x58\x31\xdd\xbb\x2d\xa5\x5d\x28\x7b\xeb\x8a\x6c\xcf\xbe\x26\x4c\x18\x2c\xff\x7c\x11\x76\x5b\xcc\xf0\xb6\x4b\x83\x6c\xfe\xf9\x8d\xe6\x6f\xf1\x9a\xf9\xa4\x85\x18\xc0\x33\x92\x29\xb2\xda\xb6\x0e\x63\x4d\x74\x43\xe3\x56\x2b\x61\xbd\x03\xad\x99\x64\xe4\xf6\x5b\x77\xb8\xfb\x01\x1b\x02\xe0\x58\x31\x0d\x5b\xe8\x6e\xa0\xde\x55\x3f\xb6\xfe\xa5\x96\xdf\x19\xf1\x5f\xd0\xbc\xe5\x26\x24\x64\x98\xbe\xd6\x55\x08\x3f\x14\xb9\xa1\x48\xd8\xc4\x5e\xca\x83\xd1\xe2\xcb\x59\x69\xe5\x40\x40\x09\xfc\x99\xe5\x0a\xe2\x10\x7a\x50\x68\x99\xd3\x61\xdb\xb3\x96\xe5\x89\xa4\xf9\x29\xff\x16\x56\xda\x7a\x7b\xd8\x59\xeb\xae\xb6\xc1\xb1\x49\xc0\x67\x90\xf5\x32\x92\x97\x26\xd6\x87\xb8\xb3\x46\x24\x5b\x37\x93\x5d\x7b\xe4\x22\xce\xab\x98\xef\x84\xcf\xa8\x84\xc2\x61\x52\xb5\xb6\x4c\x97\x2d\x76\x02\x09\xa9\xc4\x8f\x2c\x08\xdd\xc8\x52\xb4\x7e\xa0\xe7\xb5\x38\xa2\xa0\x27\x67\x25\x20\x26\x46\xd9\x0c\xdf\x25\xa9\x8b\x59\x80\x1a\xc6\x65\xc6\xc2\x8b\xa9\x9e\xc4\xd5\xc3\x8d\xd4\xfd\xeb\x32\xff\x62\x7a\xea\xa2\xfd\x61\x37\xe4\x44\xee\x86\x80\x33\x5b\x7c\x16\x56\x20\xe7\x12\xba\x60\x0d\xae\x82\x18\xef\x4a\xc4\xff\x3e\x8e\x19\x20\xa2\x3b\x34\x4d\xb3\xc7\x4a\x07\x2b\x26\x53\x47\xa0\xa5\xd9\xbd\xfd\xb0\x18\x18\x43\xf3\x70\x6a\x3a\x4c\xcc\x61\x96\x32\x4d\x13\x41\x5a\xe6\xa2\x72\xc9\x79\x03\x22\x53\xa8\x2b\x1b\xda\x67\x7f\x87\xe8\xd6\xec\xd0\x55\x1d\xe5\xf9\xe4\xce\xff\xa9\x9f\x7a\x16\x33\xee\x34\x70\xb5\x4f\xc9\x50\x68\x25\x17\x30\xe8\x8b\xf9\x0b\x1c\xa2\x54\x2e\xbb\x6f\x78\x6e\xe2\x7d\x13\x0f\x85\x27\x91\x2d\x85\xe9\xd9\xc3\xed\xa0\xdf\xc0\x1b\xd4\xb2\x36\x66\x83\x92\x56\x55\xa0\xb2\x33\x00\x3d\x8b\x8b\x08\x5c\x62\x19\x73\xdc\x68\xc6\x46\xe9\xfa\xb7\x4b\xf2\x63\x90\xb8\xd6\xcd\x80\x68\x85\x27\xcf\x8c\x23\x7b\x60\xc7\x18\x4a\x23\xe6\xbe\xc2\x09\x9e\xe9\x9f\xdd\x83\x98\x59\x6a\x0f\xbc\x38\x08\x91\xe4\xfa\x4d\x76\x26\xc4\x28\x30\xe9\x48\xe7\x4e\xe2\x05\x0a\x57\x17\x2f\x81\xae\x0c\x13\xab\xb5\xd0\x2e\x55\xb5\xde\xfa\x85\x1a\x3e\xfd\x8e\x96\x18\xca\xa8\xd8\xc5\x7a\x20\x98\x1c\xf9\x10\xcb\x72\x8a\x7d\x21\x32\xf1\x2c\xd0\x22\x41\xda\x41\x7d\x63\x1e\x64\xb5\x2e\x38\xc7\x8e\x34\x7a\x96\x5b\x1a\x37\x67\xfa\x20\xbf\x0a\x35\x31\xa3\x21\x2c\x3d\xe1\x8a\xc7\x7c\x0f\x18\x57\x22\x7e\x10\x06\xe4\xd6\xc2\xa0\x79\x00\x7d\x77\xa6\x3a\x33\x5f\xe9\x0a\x1f\x8f\x59\x62\xae\x56\xfe\x9e\x15\xbb\xf7\x3a\x6b\x41\x00\xa1\x11\xf9\x20\x51\x2d\x7e\x2e\xf4\xb2\x93\x99\x30\x15\x10\xbe\x64\x07\xf5\x60\xdc\x25\x33\xf9\x5b\xa2\xe4\x34\x08\xe7\x92\xbc\x55\x2d\xc0\x8b\xbc\xc8\x2b\x37\xda\x16\xe2\x95\x56\x0b\x34\xee\x70\x25\x78\x9e\x84\x47\x17\xff\x49\xf8\x5c\x41\xa3\xee\xd9\xab\x91\xd1\x12\xe3\xd6\xbd\x5b\x20\x68\x8c\xab\x40\x1e\xca\x49\x33\x7f\x47\x49\x6a\xcc\x13\x81\xd1\x61\x74\x06\xfe\xc5\x59\xd9\x4d\xf6\x69\x31\xe2\x6a\x17\x5c\x70\x46\x9a\xd7\x96\xae\x0b\x78\x02\x2e\x76\x48\xb0\xeb\x01\xe0\xac\xfc\x49\x46\x97\xca\x62\x00\x20\xa3\xcf\x80\x93\x04\xb0\xdb\x8e\xe7\x54\xde\xb0\x2f\x2f\xa0\xe4\xb6\xe5\x6f\xd4\x63\xab\xd2\xc9\xf0\xd4\xea\x50\x22\xe0\xa5\x2b\x5d\x34\x51\x12\x0a\x32\xf1\xd7\x7a\x21\x50\x40\xb1\x5a\x1b\x0b\xc7\xb7\x6d\xe3\xe2\x89\xb9\x16\x23\x8c\xef\x17\x9f\x1a\x29\x30\xc6\xce\x6a\x43\xe5\x16\xc3\x7c\x2a\x4f\x00\x41\xc6\x11\x0d\x8b\x97\x88\x12\xee\xd3\xc2\x16\x78\x58\xcf\x9d\xee\x72\xe4\xc1\xcd\x1b\xbb\x3a\x25\xfc\xcd\x87\x59\x53\x71\xb2\x76\x7a\x1d\xd5\x6e\xe6\x9c\xbc\x66\x14\xcb\x95\x79\x55\x24\x36\xb3\xcf\x55\x3a\x60\x70\x0a\x13\xf9\x45\x38\x76\x06\xc2\x15\x04\x1d\xca\x0a\x6c\x6e\x83\x71\x4c\x66\x62\x9a\xcd\xcb\x62\x72\x10\x81\xc2\x91\x89\xa3\x20\x87\x07\x63\xd5\x8e\xaf\xee\xc4\xa2\xb8\x87\x43\x4c\x0c\xfb\x42\x1e\x39\xc9\xd1\xc5\xe3\x99\x9b\x98\x4a\x7b\x3b\x81\x8e\xf0\x84\xde\xf5\x1b\x41\xdf\x15\xc4\x74\xdb\x36\x1b\x9d\x09\xa1\x02\x73\xa8\xf3\x2c\x58\xba\x74\xc2\x4e\xd9\xef\x01\x4d\xc8\xfd\x74\xca\x1b\x36\x5a\x63\x90\x08\xf2\x84\x78\x64\x98\x7d\x2e\xd7\xd6\xbd\xa2\x70\x27\xa7\x42\xb4\x3f\x6c\x4b\x45\xad\x89\xac\xeb\xd1\x38\x17\x2e\x90\xb2\x13\x1f\x56\x51\xe3\xc1\x09\x5e\xe0\x5c\x58\xab\x09\x53\x05\xcb\x51\x52\xcf\xd7\xa8\xf9\x9a\x8b\x96\xbc\x00\x56\x96\x94\xa1\x49\xa9\x2d\x86\x7c\x7a\x51\x58\x5e\x90\x7c\x1e\x85\x34\x02\x63\x42\x04\x09\x17\xc9\x2f\x6a\xea\x17\xc6\xb6\xef\x41\x37\x71\x90\x62\x76\x78\xc9\x99\x9d\xf6\xd2\xa4\x7d\x14\x16\x98\xaa\x1b\x40\x35\xd9\xfc\xb8\x99\x69\x6d\x3a\x1d\x2e\x32\x9e\xa1\x9d\x82\x64\xc9\xe9\xd2\x77\xb7\x52\x12\x3c\x99\x7d\x0b\x5f\x47\xab\x51\x63\x75\xdf\x41\x78\xfa\x8b\x5a\xc9\x39\x5e\x40\x86\x8b\x83\x3a\x91\x6a\x1b\x5c\x92\xa7\xbb\x4e\x4d\x3c\x90\xe5\xc8\xad\xc7\xb3\x2d\x08\x6e\x35\x98\xb1\xd4\x2e\x5c\xd9\xf3\xb8\x43\x79\x48\x08\x9d\x73\xb1\x54\x5e\xfd\x61\x72\x00\xd2\x8e\x50\x05\x90\xc1\x24\xa6\xa5\xdf\x48\xa7\xae\x25\x46\x7c\x40\xbf\x10\xcc\x34\x59\x27\x5b\x96\x78\x4b\x84\xf8\x7c\x78\xdc\xec\x95\x0d\x46\x0a\x4f\x87\x7a\xe7\xd0\x3d\x7a\x76\x02\xe5\xda\xb5\x78\xc0\x8b\xac\x0c\x40\x8b\x47\xcd\xf7\xbd\x35\x5b\xc5\xde\x88\x65\x03\xd0\x8d\xfd\x50\x4c\x04\x37\x03\x3c\x0c\x3c\x43\xc3\x69\xd9\xbc\xb2\x83\x83\xf1\xec\x66\x45\xe6\xe2\xa5\xc5\x2b\x48\xd2\x88\xda\xfe\xaa\x55\x10\x4b\x10\x66\x24\x18\x9b\x1a\x7e\xa0\x51\xcd\x03\xf0\x0b\x77\x3c\x9e\x83\x75\xd3\x82\xb3\x27\xd4\xa3\xc5\x3b\xb1\x74\x9e\x9c\xa4\x26\xf6\xd8\x73\xa1\xd2\xc9\xea\xcb\x49\x72\x57\xfb\x90\x5b\x7c\x4f\xf6\x92\x39\x10\x98\xe2\xa9\xd6\xc1\xa2\x97\x46\x95\x6f\x58\x14\x6c\x1d\x2c\xbe\xa1\xbc\xe5\x41\xe8\x18\x64\x0c\xb5\x5a\x4e\xb7\x94\x4f\xed\x04\x0c\xe8\x2b\x2f\x42\xce\x72\xa4\x59\x62\xb9\x87\xb3\x64\x7a\x23\xa7\x82\x06\x0e\xd5\x93\x6e\xe4\x54\xbb\x12\x62\x8f\x19\x75\x6c\x1d\xc1\x4d\x3f\x80\x48\xc4\x33\xa1\xf2\x1c\xaa\x39\x02\x56\x59\x70\x2b\x43\x5f\x12\x71\xa7\xb0\x5a\x09\x3d\x28\x2f\x17\x3e\x44\x62\xf3\x6a\x81\xd0\x9a\xae\x61\xc0\x5f\x08\x17\x98\xc2\xbc\x80\x21\xc9\xb9\x25\x1a\xd6\x5a\xb2\xba\xbe\x98\xfd\x41\xe1\x9a\xb5\x4a\x6d\xa9\xc1\x52\x70\xc0\x17\x86\x67\x9a\x31\x68\x4e\x25\x8e\x3d\x02\xd1\xc8\x8c\xfa\xdd\xf4\x6a\x21\xd3\x7e\x53\xa9\xe5\x8c\x13\x3b\xdd\x89\x12\x15\xdc\x56\xcd\xf8\xfb\x8e\x96\x28\x27\xe3\x76\x16\x4a\x43\xf9\x6c\x2b\x49\x1f\xac\x26\x03\xa7\x73\x5c\xf4\xde\x31\x98\x13\x3b\x4e\x93\x23\xfb\xcf\xf4\x38\x62\x27\x3f\x12\x00\x90\xb7\x8a\x38\xa4\xc9\x53\x7b\x02\x77\xe1\xc3\x3a\xaa\x5f\xea\x3c\x80\xbe\x89\x7d\x74\x6a\x80\x13\x64\x24\x53\x64\x24\xa1\x06\x09\xa6\x75\xea\x9e\x9b\x2a\x55\xd1\xd9\xab\x28\xca\x19\xc1\x97\xc8\x24\xd9\x43\xca\x7e\xe0\x61\xe9\x92\xa0\xb3\x8e\xe1\x11\x5e\xe0\x7f\x7f\x53\x5c\xc9\x53\xbe\xe4\x1a\xb3\xb4\xb1\x85\x85\x31\x78\xe5\xd3\xb6\x7e\x90\x94\xd4\xbd\x28\xf5\x1b\x5e\x2c\xd0\x6f\xb0\x90\x7a\x79\x19\xec\x88\x3d\x6c\x33\x89\xa4\x61\xcb\x38\xcf\xc0\xc4\x2a\x1c\xa4\x3d\xd7\x7d\x06\x64\xac\x7f\xfa\x04\x0e\xc9\x32\xc0\xb8\x3d\x70\xfe\x7e\x0a\x8d\x71\x0b\xe4\x81\x6d\x71\x61\xa6\xb5\x71\xb9\xf5\xbf\x66\x16\x12\x42\x14\x89\x38\x33\x56\x52\x6e\x3e\x3d\xbd\xfc\xb9\xf6\xd7\xbe\xd2\xec\xae\x3d\xa1\x96\x65\x10\x6e\x22\x6a\xc9\x1c\x44\x5d\x2d\x8e\x45\x4b\xf6\x6b\x0e\x0a\x04\x9a\x8c\x78\x82\x2f\x23\x2f\x12\x58\x3f\x1d\xf8\xad\x51\x2f\x4e\x2f\xaa\x9e\x44\x44\x32\xe2\x9f\xe8\x60\x87\x96\xea\xf0\xbe\xf0\xa5\x57\x0c\xa4\x05\xc4\xee\xec\x51\xc9\x6f\x9c\x89\xa4\xdc\x2a\x37\x61\x16\x0d\xb9\xf9\x63\x21\xee\x00\x4b\x36\x0f\x52\x3c\xbe\xad\x3c\x7a\x06\x6d\xb3\xa7\x39\x11\xa1\xe3\x3d\x08\xea\x65\xc3\x3b\xec\x91\xc4\xb0\x83\xc6\x16\x1c\x27\xa3\xa5\x34\xbe\xae\x25\xe5\xa7\xc4\xc6\x01\x95\x93\x16\x09\x70\xa9\x2f\xb2\xc8\xd9\xec\x8c\xfe\xd5\x00\x87\xb9\x77\x44\x51\x24\xde\x3c\x50\x92\x76\x0e\x8f\xbb\xf9\x7e\x27\x00\x1d\x6f\x7c\x68\xe3\xf5\x51\xcf\x4e\xaf\x7a\x79\x31\x2f\x7f\x70\x0d\x32\x41\x61\xcd\x7c\x71\x66\x96\xc1\xad\xde\xfe\xa4\x5a\xce\x26\xfa\x0c\x4a\x4e\x40\x49\x59\x83\x5d\x56\x12\xd6\x8e\x6d\x8c\xf6\xac\xb9\xfc\x85\x02\x9d\x76\xef\x21\xaa\x18\x5f\x52\x10\x36\xef\x45\x90\x9c\x3e\x7b\x0a\x21\xb9\x51\xb2\x9b\x6b\xa8\x9a\x5d\x06\xcb\x35\x4f\x5a\x16\x96\x55\x65\xbd\xf8\x57\x2c\x8e\xc0\xf9\x0d\x6c\x1a\xb1\x3e\x13\xf5\xea\xfa\x17\x3f\x8e\x63\x35\x05\x93\x19\x12\x6b\x7c\x6e\x11\x81\xf6\x68\x30\x7d\xfd\x86\xd6\x62\xf4\xf8\xb7\x2d\xcc\x02\x21\xed\x6d\xf9\x28\x7c\x5a\xc6\xe6\x1c\x86\x5d\x63\xc1\xbe\x09\x59\xe0\x49\x5b\x9d\x31\x8e\xdc\x03\x47\xdf\x2c\xe3\x19\x2e\xb8\x99\x56\xba\xc5\x65\x59\x29\xa5\x88\xf7\x90\xb7\xbc\xa3\x1d\x95\xc2\xb0\x56\x4c\xa9\xd3\xf7\x25\x2e\xd0\x3b\x61\x86\x2c\x4c\x3c\xf4\x12\xa0\xdf\xd8\x82\x26\xa6\x29\x22\xe1\x23\x9f\x4b\x7e\xb7\x59\xd2\x14\x6e\xae\xf1\x1b\x68\xf9\x6b\x30\x2d\x2f\x43\x6c\x2d\x02\x3d\xc3\xc7\xd7\xca\x01\x9c\x27\xb0\xe7\x5e\xf9\x8c\x53\xcc\xfe\x8a\x4a\x1d\x7d\x3e\xc8\xaf\x04\x86\x7e\x9a\x9b\x20\x7b\x09\xc8\xcd\x07\xa1\x52\x7b\x3b\x39\x41\x6c\x2b\xda\x98\x2e\x92\x83\x90\x2a\x2d\xfd\x15\x68\xfd\x40\x16\xfa\x97\xc0\x41\x50\x38\x9f\xd8\xc2\x16\x11\xce\x2b\xd8\xce\xf2\x6d\x49\xb7\xbd\x4d\x46\x85\x50\x31\x13\xbe\x56\x9a\xbd\xb2\xf0\x72\xd0\x98\x55\x21\x09\xf7\x91\x75\xbf\xed\x2c\xd1\x55\xe7\x17\x72\x27\x79\x7b\x22\x21\xd1\x5e\x6f\x8f\x0e\xfb\x2f\x0e\x63\xc9\xfd\xe4\xd5\x95\xf3\x93\x90\x33\x5b\x1d\x42\xcd\x97\x9d\x5e\x65\x9a\x58\xdc\x32\x31\x3e\x13\x4b\xb5\x74\xd4\x35\x79\xac\x25\x21\x25\x58\x78\x97\x89\xcc\xce\xb6\xb1\x0a\xbe\x15\x66\xc5\x8a\xd4\xe0\x80\x0f\x7e\x90\xc4\x12\x2f\xbb\xb1\x5a\x29\x1f\x3c\xa0\x8b\x5b\x16\xd1\x9d\xf1\x53\xb4\xca\xd0\x1c\x75\x4b\x03\x1d\xce\x65\xc2\xf3\x86\x5e\x09\x9d\x9e\x12\x14\x24\xb7\x62\xf0\xa0\xa4\xab\x68\x9e\xd8\xae\x52\xbe\x66\xc4\x36\x4e\x36\xd7\x96\x5d\xb6\x56\xd2\x80\x05\x0f\xc7\x1a\xb7\xc6\xf5\xfa\x0d\x6f\xe7\xc8\xbd\xed\xf8\x6d\x73\x6a\x1a\xda\x5a\x36\x7a\x6f\x2c\x8c\x35\xe7\x39\xab\x8d\xc4\x1d\x94\x70\x9a\xd8\x02\xb9\x26\x4e\xf4\x5a\x71\xce\x02\x69\x68\x4a\x38\x7a\x18\x1a\xee\x0c\x48\x83\x88\xe7\x4e\xb8\x27\xd8\x5a\x2e\x8e\x07\x07\x40\x3b\xb6\xf4\x28\x72\xc6\x76\x8f\x64\xe5\x2e\x3c\x80\x12\x47\xf0\xaf\x1d\x7d\xb0\xf8\xc9\x02\xf4\x0a\x9c\x62\x88\x76\x98\x7e\x98\x56\x6e\xa3\xf4\x5e\x16\x52\xab\xe6\x9e\x5f\x5e\xa6\x84\xf3\x89\xdc\xc1\x33\xae\x95\x01\x9f\x57\x22\xf4\xd3\xcd\x2d\x77\xad\x5d\xd2\xd1\xea\x79\x60\x99\xfc\x26\x8e\x6f\x70\xa1\xa4\x28\x83\x9e\x51\x24\xa0\x35\x67\x7c\xfe\x61\xf8\x1d\x1f\x7a\xfb\x9f\x6e\x90\x3b\xa8\x01\x5e\x0e\xb4\x3f\xbd\xc0\x1f\x69\xca\xc5\x94\x2e\x80\x5b\x3d\x75\xd0\x17\xb4\x4f\x6f\xf1\x96\x8a\x81\xb7\xe7\x70\xe0\xee\xdc\x5f\xaa\x8b\x7e\xf5\x09\xbf\xa0\x4c\x0e\xc3\x7d\x39\xb7\x73\x4d\xce\x89\x9a\xdd\xcf\x83\x19\x9b\xbc\x55\x43\xee\xb1\x36\x27\x90\x3d\x5e\x4f\x22\xf9\x62\x86\x26\x7b\xdf\x83\x39\x8e\x5e\x61\xec\x11\x48\x87\xa8\x64\x00\x3a\xb0\x5d\xc5\x21\x61\x5b\xcf\x4a\x33\x2e\x31\x8a\xbc\x07\x48\xde\xcb\xc2\x1b\x93\xfb\x0f\x49\x0d\x6f\x33\x06\x3f\xf2\xb6\x04\x86\xb6\xfe\x39\x51\x2f\xec\x8e\xfc\x2c\xde\x8e\x50\xb7\x12\xf0\x9c\xc5\x88\x73\xb0\x72\x7b\xf2\x8c\xeb\x0f\x8c\xbd\x81\x04\x89\x04\x85\x5c\x1b\x23\x42\xcb\x1b\xd4\x08\xb4\xd7\x36\x47\xa3\x48\xa6\x24\x2b\x2b\x98\x45\xb2\x0a\x83\x38\x63\x5a\x69\x76\x41\xe9\xb8\xe8\xce\x94\xe0\x95\x1c\x48\x79\x5b\xe8\x23\xf7\x54\xbe\x65\xce\x73\x63\xf3\xc6\x82\x53\x56\x95\x04\x7e\x3c\x10\xd1\xe3\x2a\xc9\x8b\x79\xc5\xc8\x96\x56\x21\x0c\xc0\x96\x28\xce\x5f\xcc\x54\xc3\xc7\xfb\xa3\x0c\x98\x63\x0e\x34\x3b\xd3\x49\x72\x05\xb8\x02\x59\x7c\xa6\xf0\x7b\x60\xf4\x21\x26\x09\xdf\xf2\x03\xba\x8d\x45\x2c\x87\x65\x49\x12\x93\x22\xf6\xc8\xc1\x16\x62\xaf\x28\x17\x48\xc8\x1d\x2d\xe7\xd3\x16\x08\x4b\xad\xb2\x64\xce\x96\x31\x86\x09\x05\xb1\xb2\x0d\xce\x04\x36\xfb\xe8\x0b\xf9\x1b\x1e\x91\x4e\x19\xa4\xb3\x1a\xd9\x8c\xf2\x14\xff\x0f\x4a\xed\x41\xff\x55\x78\x9a\xce\xa0\x68\xd0\xc3\x38\x7d\x2f\x04\x74\x92\x70\x8f\xa6\xab\xca\xbc\x76\xa4\x8a\x56\x51\x7a\x80\xdf\xc2\x9c\x65\x50\x4f\x73\xd2\x95\xde\xcf\x4e\xd6\xcf\xd3\xc1\xe5\xc5\xf9\xda\x9b\x86\x7f\xaf\xb2\xc2\x71\x81\x0b\x5f\xb5\x96\x03\x84\xd2\xd9\xa9\x6a\x83\x12\x13\xd3\x99\xbf\xfb\x1b\x2e\x60\xe7\x1b\xb9\xa6\x9b\xa4\xd0\x8c\x7b\x8c\x2a\x64\x9f\xf3\x82\xe7\xed\x8b\xbc\x7a\xff\x67\x57\x20\xac\xc3\xf4\xd1\x21\xdd\x35\xfe\x60\x49\x07\x27\x44\x0d\x26\xd3\x86\xbc\x00\x1a\xdb\xbc\x19\xcb\xda\x70\x0a\x0f\xe7\xc6\x6e\xa5\xa2\x9d\x19\x40\x96\x77\x76\x07\xae\x23\xad\x7a\x16\x10\x19\xc4\xdd\x36\xe7\x44\x6a\x59\x83\x1d\xcf\x4f\x46\x68\x12\x59\x35\x14\x9a\x1b\xb2\x19\x79\x68\xe7\x61\xcf\x19\x88\xf2\xc6\x44\x20\x36\xd9\xa7\x57\xc4\x96\xb1\xd3\x59\xe1\x1b\x5f\x26\x6f\x6b\xc8\x7d\x79\xdb\xfd\x91\x8d\x72\xc0\xd0\xb8\xa3\xc8\x78\xf8\xf7\xe3\x2f\xfe\x85\xf0\x23\x0c\xf2\x07\x38\x5b\x39\x6d\x0f\x4e\x80\xd2\x46\xae\xb0\xe3\xa1\x89\x1c\xaf\x03\x0e\x85\x42\xeb\x76\x68\x25\x23\xe6\x13\x55\x76\xff\x2d\xa3\x25\x64\x66\x09\x3d\x5c\x5a\xf2\xf1\xfb\x82\x4c\xdc\xe2\x5f\x5c\xbd\xb7\xf7\x67\xe4\x42\x36\xa3\x96\xf0\xf0\x1a\xff\x9c\xef\xce\x97\x00\xaf\x36\x39\xae\x26\xef\x09\xce\x0f\xb9\xf6\xd1\xfa\x21\xec\xe7\x1c\x50\x95\x38\xa7\xfc\x00\xef\x7e\x3a\x85\x43\xdc\x35\x69\xc8\xac\x2d\x69\xf4\x60\xb0\x48\xf9\xd3\xd0\x46\x73\x3c\x95\x77\x63\xbe\x55\xc5\x21\xa1\x84\x93\x10\x89\x99\xf5\x1d\xa6\x0f\x10\x36\xab\x2c\x7d\x06\xc3\x45\xb9\x02\xcc\x66\x99\x33\x3f\xfb\x0a\x26\x88\xa6\xc5\x48\xca\x03\x3a\xd4\x15\x8d\xb2\x87\x6f\x6e\x4b\x01\x96\xbd\x47\xac\xa9\x05\x54\xf0\xb2\x99\xd1\x4c\x85\x5d\x61\xcc\xd1\xe4\x3a\xd8\x9b\xcc\xf4\xef\xb2\xff\x16\x9b\x06\x92\x7d\x64\x39\x16\x42\x5f\x0a\xd8\x9a\xc5\x4c\x60\x11\x4e\x1f\xfe\xcf\xa8\x7c\x19\x0f\x17\xac\xbf\x66\xc1\xd8\x6f\xbc\x50\x83\x30\xd4\x7e\xbc\xb8\x96\xd1\x9d\xd7\x65\x1b\x21\x8f\xcc\xb4\xd8\x5a\x86\x82\x5d\xf9\x0a\x54\xa7\x46\x96\xf7\xcf\xf8\x26\x8b\x44\x33\x30\x84\x9a\x7d\xc2\xb2\x06\xee\x9e\xdc\xe0\xb6\x04\x46\xbd\xba\x49\x91\x75\xa5\x99\x2c\xe4\x0f\xf0\x2d\x6d\x63\x75\xc3\x43\xb6\x84\x2c\x7b\x44\xe6\x8f\xb8\xd7\x9a\x66\x48\x90\x91\xe4\x71\xc3\x46\x5b\x31\x99\x5c\x24\x2d\xfa\xf2\xaf\xd3\x75\x79\x05\x6d\x10\xfa\x9e\x39\x38\x54\xb7\x7c\xbc\xdd\x06\x21\xb8\xd8\x17\x1e\x83\x5b\x23\x30\x64\x8b\x4f\xf2\x06\x4a\x20\x61\xe8\x15\x7e\x0b\xeb\xb3\x4e\x74\x55\x4b\x0b\x06\x76\x20\x51\x5c\x92\x64\xfa\x2b\xd9\x22\x27\x5c\x94\x81\xe4\xb0\xea\xf0\x1e\x40\xa7\x93\xa0\xa6\x18\x6d\xfd\xac\xa9\x0b\xb4\xaa\x4b\xe3\x1c\x42\x3a\x84\x9b\xe7\xd2\x6f\xb0\x9b\xc3\xd7\x8e\x77\x25\xc8\x22\xd8\x8a\xe6\x95\x16\x72\xaf\x27\x60\x6c\x93\x86\xd0\xa0\x7e\xc6\xaa\x7c\x30\x5d\x97\xc8\x9a\xfa\x12\x47\x29\xe6\x76\x4a\x9b\x3a\x8b\x93\xd9\x33\xa9\x31\x5a\xf8\x64\xbf\x1b\x2c\x6f\xe9\x0d\xe4\x17\xb9\x8d\x12\x18\x03\x86\x77\xb6\x43\x42\x62\x6d\x0c\x76\x7b\x91\xff\x3a\xe3\x8e\x51\x7d\x42\x8c\x62\x27\xce\xd8\xcb\x33\xf2\xc6\xd3\x7e\xd1\x10\xa9\x07\xb3\xc7\x37\x57\x5a\x6d\xb7\x7c\xd5\x33\xb3\x8b\xb6\x15\x67\xc0\xea\xee\x23\xe6\x60\xa1\x9b\x2c\xee\xec\xb5\x48\xb9\xfc\xde\x96\x6e\xf1\x04\x8b\x16\x4c\xbc\xfe\xd3\xbe\x18\x8f\x00\x34\xe1\xbd\xd4\x4c\x19\x20\x90\xae\xc6\x83\x3e\x7b\xaf\xff\x1c\x26\x23\x9a\x1a\x3c\x96\x58\x3e\xd7\xbb\x07\x9f\x74\x1b\x95\x9c\xa7\xa9\x54\x4f\xba\xd8\x7f\xa0\xd4\xc9\xd1\x9f\x08\x26\xb0\x15\xf8\x18\x6d\xad\xac\x06\x99\x4a\x82\x61\x13\xc1\x5e\x7f\x4b\x15\xb7\x78\x01\x0f\xeb\x2a\xc9\x5d\xbc\xd2\xbd\x07\x54\x1f\x58\x73\x89\x60\x3d\x07\x64\x23\x77\xf5\xd8\xdf\xe0\xff\x07\x4a\x55\xf2\x33\x50\x84\x20\xa4\x9d\x03\x5b\x7a\x67\x39\xca\x97\x9d\x88\x13\xf5\xdb\xb7\x6c\x27\x5c\x58\x6c\x13\xab\x92\x6c\xfe\xfc\xd1\xc2\xa5\x77\x0a\x28\x55\xe7\x41\x01\x05\xbb\x82\x4e\x6b\x3d\x5c\xcf\x41\x93\x10\x67\x0d\x19\x5b\xdc\x9d\x14\xb0\xa7\x5a\x9e\x78\x7b\xb4\x71\x74\x27\x7d\x9d\xdd\xf9\x67\xf1\x6d\xa6\x2e\x27\xad\x3a\x6b\xa7\x84\x1d\x37\x76\x43\x9c\x4e\x0d\x8c\x23\xf7\x67\x02\xc5\x8e\x2a\x44\x75\xd5\x3a\xd2\x2d\x7d\xbc\x6a\x27\xed\x7d\xde\xf0\x54\x47\x98\xec\x87\x8c\xfd\x8e\xeb\x53\x09\x04\xcb\x76\x8e\x44\x29\xac\xcc\xde\xf9\x0c\x6d\x76\x59\x82\xb2\x79\x73\x8a\x98\x66\x43\xd0\xb7\x32\x84\x4a\x4e\x9c\x10\x74\xa6\xae\x88\xa4\x7e\x63\x22\x9a\x61\xcc\xa1\x4c\x5f\xe1\x7a\x12\x92\xf4\x18\xe5\xc8\x36\xdf\xdb\x57\x36\xea\xaa\xcc\x5f\xcd\x8b\xb7\x73\xcf\x3c\x5c\xda\xdd\x94\xc9\x51\xf9\x0d\xf5\xdb\x6e\x30\x7c\x9e\xd6\xae\xc8\x16\xb8\xd0\xfc\x3c\x1a\x23\x66\xed\x87\xc6\x99\xb4\x45\x68\x17\x43\x3c\x5b\xf8\x81\xb0\x62\xdf\xbc\x63\xc6\xdc\xb1\x5e\x2f\xd6\xc9\x66\x4d\x38\x02\x83\xf7\xc6\x12\xd7\x44\x2c\xa3\x5d\x68\x5b\x94\xc8\x99\x45\x5e\xbd\x86\xd6\x1d\x7c\x21\xf6\xd0\x8e\x31\xc2\xd0\x12\x85\x90\xdb\x5b\x9c\x6e\xab\x46\x8f\xb1\x53\xea\x76\xb4\xfc\x1a\x6d\x1e\xc8\x6e\x0a\x9d\x12\x72\x92\xac\x29\x93\xfb\xcb\x10\x4d\x8c\xcb\xc2\x54\xe2\x62\x4c\x1b\x07\x59\xce\x58\x96\xf6\x5f\xbf\x92\xe2\xd0\xc9\x12\x19\x60\xb3\xda\x39\xef\xe3\x91\xb8\x35\xa7\xd8\x71\xe6\x76\x77\x7c\xef\xb0\x8f\xc5\xd2\xde\x2a\x3a\x29\x03\xce\x11\xf2\xbe\x13\x1d\x24\x35\x08\x56\x32\x17\x25\x79\x59\x11\x2d\x7e\xfb\x2b\x79\xbf\xf4\xc1\xd9\x6b\x15\xdd\xd9\x6a\xd3\x54\x4c\x53\xf4\xac\xdd\x1b\xb3\x9c\x2a\x15\x14\xb2\xb3\xc4\x04\x74\xae\x5e\x27\x24\x3f\x6f\xbc\xba\x3c\xdc\xb2\x56\xf4\xe0\xa8\x4b\x61\x8d\x55\x0c\xab\x73\x80\x8b\x99\x72\x75\xd6\x7a\x48\x11\xdc\xe0\x18\x4b\xf2\x82\x4b\xb1\xb1\x19\xe7\xa3\x84\x1c\x33\x1c\x1a\xc4\xb3\x8a\x4e\x0b\x98\xc5\x9a\x32\x78\xc9\x86\x2a\x6f\x7d\x59\x9d\x48\xdf\x86\x56\x86\x16\x19\x60\xbc\x66\xd2\x52\x08\x33\xbd\x3d\x81\xb9\xd8\xfe\xaa\x26\x61\x08\x62\xac\x9e\x03\x1c\x5e\x9f\x8f\xa0\xc5\xbc\xd5\xb2\xe3\xca\x66\xf2\xc3\x14\x2a\xd5\x15\xff\x41\x58\x94\xe9\xe0\x16\x67\x24\xc9\xee\x1a\xfe\xd3\xc9\x09\xa9\x31\x50\x3e\x84\xa5\x58\x24\x0f\x70\x75\xee\xcf\xf5\xba\xd0\x96\xc3\xbf\x53\xbc\x63\x53\x9e\x15\x7c\x6b\xf4\xa6\xe4\x03\xd8\xa5\x49\x05\x21\x99\x56\x7f\x1f\xf0\x10\x1e\x3a\xc8\x61\x65\x91\xd2\x98\xc7\x56\xaf\x33\x3f\x4c\x1d\xa2\xe8\xe1\x4d\xf3\x60\x5e\x92\x0a\x4a\x3a\x1c\xe8\xff\x32\xc4\x3c\x1b\x00\x27\x97\xe4\xcb\x60\x5b\x3a\xa9\x3e\x8d\xe2\x43\x92\xeb\xb0\x90\x10\x2a\x8e\xff\x93\xf5\x68\x09\x08\x36\x0f\x46\x25\xa0\x95\x4d\xb4\x74\x17\xe5\x50\xbf\x8f\xde\x5e\xba\x39\x6b\xb9\x7a\x77\xbe\xd2\xfa\x3c\x41\xd2\xe5\x9d\x19\xde\xfe\xa1\xa8\x9a\x3d\x12\xc7\x85\x73\x27\xe6\xdb\x70\x01\xe3\x84\x93\x49\x2e\xd9\xaa\x83\xf4\x3b\x0f\xa5\x98\xb8\x9b\xc5\xac\xc8\x26\xcb\x1b\x57\x45\x99\x5c\xe6\x44\x1f\xa8\x40\xb0\x32\x1c\x16\x9a\x83\x77\x71\x4b\xd7\x89\x0d\x9b\x62\x14\xa3\x14\xb9\xa9\xc6\x57\xfb\xe1\xe3\x28\x6a\x30\xfa\x1a\xec\xea\xe9\xc5\x42\x80\xa9\x95\x3d\x3c\xf9\x83\x8d\x55\xcd\xd7\xfc\x64\x7f\xaf\x0a\x03\x10\x14\xa9\x86\xca\x5b\x3d\xb4\x72\x4d\xfe\xeb\xda\x59\x01\x78\x59\x0d\x0b\x5e\x08\xb6\xc8\x5e\xfd\xc7\x41\x27\xd3\x99\xe1\x0e\xa5\x0c\x44\xea\x61\xfe\xbe\x5d\x86\x15\xa5\xdd\x3b\x28\x49\xf3\x30\x3e\x2d\xb3\x7c\xcd\x70\xd0\x20\xf6\x79\xb1\x2d\xd0\xb2\xd7\x85\x95\x92\x77\x20\xfe\x2f\x21\x45\x03\x9f\x4e\xbc\x0c\xab\xb8\x92\xf5\x07\x76\x2b\x51\x90\xe2\xed\xc9\x69\x93\x34\x05\xed\x40\x65\xb4\x32\x6a\xb5\x1d\x2d\xf0\x97\xe7\x81\x9a\x20\x91\x6e\x81\x3e\x24\x25\x13\x06\x14\x67\xad\xbb\x92\x8d\x3d\xbd\x01\xf6\xa2\x4b\x54\x39\x0e\x74\x73\x1e\xe9\xd7\x9e\xea\x43\xbe\x99\x83\x34\x73\xf0\xce\x04\x67\xf2\x24\x09\x57\xf4\xab\xd4\x42\x98\x11\x3e\x29\x05\x66\x2a\x5c\xbc\x8d\xca\x49\xb7\x5b\xdd\x97\xe6\x19\x3b\x59\xa3\x07\x4a\x74\x2d\x01\x05\xde\x7a\x76\x0b\x46\x77\x61\xb4\x72\xe2\x44\x2f\x4d\xf0\xe1\xb1\x09\x15\x49\xb8\x30\xfa\x25\x2d\x1f\xc3\x65\x77\x0a\x43\xd9\x63\x34\xf9\x0a\xf9\xfe\x44\x8c\x98\xc1\xf6\x53\xfd\xb5\x9b\xbd\x49\x97\x9b\x37\x3b\x29\x2a\xeb\xb7\x5c\x8b\xc7\xee\x52\x0c\xc1\xb7\x45\xd8\x8b\xea\x65\xec\xe9\x01\x36\x31\xf0\x50\xf1\x21\x33\x18\x12\x72\x81\x0d\xb2\xad\x68\xf4\x91\x33\x16\x99\x22\x3b\x43\x3e\x7b\xac\x66\x14\x1e\x0b\x32\xbc\x17\x69\xe2\xce\xbf\x3f\x1e\x43\x7b\xc5\x42\xc5\x04\xa6\x07\x61\x2f\x5e\x75\x75\x38\x8d\xa1\x08\x3b\x6b\x00\x49\xdc\x9b\xf8\x17\xd6\xb6\x95\x4f\x6e\x5b\xb0\xba\x83\x90\x5b\x80\x7c\xfe\xea\x95\x3a\x00\xef\xcd\x75\xa1\x0e\x54\xad\x71\xee\x29\x28\xa2\x36\x1f\x5f\x82\xac\xac\x3f\x16\xc9\x86\x82\x10\x1c\xc4\x11\x82\xa6\x18\xce\x2e\x73\x85\xa2\x9b\x7d\xf6\x83\x92\xa0\x4d\xb5\x4d\x5c\xcc\xe7\x31\x78\x56\xa4\xfb\x59\x59\xcc\x1b\x25\x2a\xcb\x4c\xcf\x32\x52\x75\x00\x80\x12\xff\x49\x82\xe2\xa1\xed\xb9\xe2\xb3\x65\x25\xec\xc1\x9e\x5e\x2f\xf0\x0e\x05\x6d\x6a\x65\x29\x57\xcb\x0f\x6b\x00\x75\xf1\x3d\x64\x66\x7c\x87\x15\xa5\x60\x8f\xa7\xd7\x74\x20\xe1\x00\xf9\x2d\x74\x13\x92\x9b\x6f\xe1\x80\xed\x72\xa7\x92\x99\x04\x4b\x08\x1c\x7a\xbd\xe1\x2d\x5b\xcc\x38\x1a\x21\x11\x57\x15\x53\x7a\xb3\xf1\xa9\xe7\x2b\xb2\xb7\x6b\x2e\x23\xea\x50\x9b\xe5\x07\x1a\x00\x1d\x1e\x71\xf7\xd3\x41\xb6\xd1\x1d\x2d\x77\xd2\xe6\xbb\x87\xf5\xfd\xe2\x59\xb1\xf2\x3c\x1a\xb0\x0e\x3b\xda\x6c\x36\x0f\x67\xd7\x70\x50\x9f\xa9\x37\x92\x4a\xeb\x45\xcf\xe4\x2d\x28\xaa\x29\x40\x6f\x02\x6c\x20\x61\x69\xad\x55\xf3\xab\x6b\x15\xce\x5f\x36\xcb\x51\x0c\xaa\x16\x67\xbf\xc9\x9f\x28\x5f\xd6\xf2\xf9\x21\xd0\x7c\xcf\xde\x96\x33\x18\x8a\x47\x71\x77\x4e\x15\x00\x94\x80\x00\x2e\xfd\xbd\x7f\x1f\x8b\xa5\xea\xe8\xbd\xba\xbc\x5a\x70\x8d\xea\xb1\x2e\x0b\x9e\x6d\xfa\x2a\x82\x21\x30\xc9\xdf\xde\x84\xd0\xf4\xb4\xd9\x53\xca\xf9\x67\x00\xdf\x12\xcb\xb6\xc5\xfb\x4a\xac\x8f\x8d\xe5\x9c\xda\x57\x1a\xb9\xc9\x99\xbd\x1d\x60\x4b\x37\x3c\x1c\x34\x4b\x1c\xe7\xd5\x8b\x38\x9d\x72\x33\x46\xfc\x44\x5f\xf1\x33\x7a\x41\x67\xd6\x0d\xa1\x9b\x57\x6a\xd7\x11\x00\xfd\x89\x59\x59\x08\xfd\x6d\x49\x02\x5b\x3b\xdc\x4f\x0f\x93\xf4\xd4\x3c\x40\xd0\x23\x90\x71\x2b\xd1\xa9\x9b\x75\x31\x94\x1a\x50\x9a\x25\xf4\x20\xc7\x4a\xc6\xeb\xe2\x37\x15\xb6\x5d\x2c\x55\x23\x32\xe2\x52\x49\x68\xfc\x63\x30\x04\x2e\xab\x2c\xd1\x2f\xe4\xa8\xda\x9d\xac\x05\x5a\x7b\x3f\x50\x7f\x33\x4a\x3b\x62\x02\x6e\xed\x4a\xf0\x28\x0e\xde\x70\x66\x1f\xeb\x57\x0d\xc5\x3b\x97\xcb\xe4\x12\x69\x49\xc1\xae\xc6\x7b\xcf\x70\x60\xd6\xc6\xc8\xb3\x03\x51\xec\x15\x06\xff\xa2\xef\x1a\x0a\x95\x4e\x08\x8b\xaf\x41\xa4\x77\x24\x6d\x0b\x97\x31\x87\x83\xb3\x5d\x25\x7f\x17\x6f\xf8\xcf\xbb\x2d\xe5\x6e\xda\x17\xb3\x22\x22\x09\xbd\x00\xe2\x4e\xfe\x3d\xd8\x91\x80\x73\xee\x3a\x20\x5b\x01\x06\xf9\x86\xea\x5d\xf3\x36\xb7\x16\x4e\xb6\x58\xee\xee\x6b\x57\xf7\x91\xf2\x7d\x47\x95\xc5\x5a\x64\x04\x43\x13\x0d\x8a\xd3\xdf\xad\x54\x64\x1f\x36\xfa\x30\xd5\x3a\x78\x19\x9d\x21\xd0\x8b\x84\x4a\xe7\x38\x99\x53\x61\x04\x00\xbe\x80\x76\x37\xc3\x88\xcb\x9a\x77\xe3\x74\x6a\xdd\xf2\x6f\xd1\x33\x90\xa3\xbb\xf6\xf0\xc3\x74\x00\x1b\xa9\x6a\x28\x2c\xa8\x42\xd7\xc2\x79\xc9\xb1\xfe\x16\x2b\x30\x29\xa2\x0d\x8d\xcd\xb6\x79\x33\xe1\x9b\x2e\x6a\x04\xd7\x72\xc4\x00\x83\x66\x9c\x0a\xb4\x2e\x3b\xb3\x8d\x45\x86\xa9\xe0\x86\xb8\x5b\x92\x98\x9a\x01\xf0\x9d\xaa\xb3\x04\x4d\x93\x0b\xd5\xf5\x82\xcf\x3d\x8b\xb7\xdb\x9d\x08\x01\xa3\x27\xeb\xba\xcc\x80\x01\x87\x90\x8e\xc7\x04\xef\x33\xb3\x59\x5e\xdc\x3e\x52\x43\x2d\x76\x19\xda\x84\x20\xab\x64\xca\x69\x32\x45\x82\x2f\xef\x1e\x24\x3c\x9f\xd8\x2d\x49\x48\x47\xb5\x75\xd2\xea\xe2\x03\x2d\x60\x5d\xf1\x0d\x3b\x0e\xb0\x33\x92\x05\xb2\x0f\xef\x7a\xc6\xc4\x20\x50\x83\x10\x06\xa8\x91\xa4\x25\x57\x2a\xdd\xa2\x6b\x46\xad\xd6\xfd\x4e\x28\xa8\x1c\x9e\x89\x6c\xaa\x6a\xe7\x09\x68\x26\xea\xf3\xa2\xca\xa4\x3e\xd3\xf4\xb5\x51\x88\x38\xbb\xb9\x57\x5c\x6f\x4b\x07\x8b\x97\x55\x25\xe0\xa2\xfc\xc7\xed\xff\x8d\x66\x08\x24\x1f\xf5\x9f\x69\xb7\xb7\x05\x69\xa7\xa6\x9b\xdc\x62\xa2\x17\x38\x10\x95\xd6\x6c\xf3\x08\xca\x24\x4a\x24\x56\x80\xf6\x1d\xb4\x06\xb4\x01\xca\xfb\x9f\xb6\x04\xf4\x72\xed\x5f\xfa\xb3\x7c\x5a\xfb\xdc\x1b\xc2\xd0\x15\x48\xbc\x1c\x5b\xe7\x67\x68\x7b\x79\x75\x80\x6b\x27\xd7\x65\x80\xd9\xbd\x26\x43\x6d\x6b\xfa\xfd\x85\x5a\x1a\x35\x3c\xbf\x44\xea\x75\x84\x51\x0a\x8d\x90\xf4\xa4\x38\x33\x02\x15\x12\x14\xd6\x4e\xa4\x72\x4d\xf2\xf6\xa8\x31\x5a\x23\xf1\x68\xa0\x5c\x9c\x3e\x4b\x1a\xe9\x25\x77\x0d\xbc\x26\xad\x2f\x11\x25\x27\x0d\x8a\x22\x66\x96\xf8\xd7\xa8\xa5\x8a\x07\x42\x09\x42\x8f\x9e\x5d\x56\x7f\x48\x57\x1e\x04\xe2\x44\xae\x82\xd7\xb8\x0d\x36\xf8\xc0\x2a\xca\x5a\xce\x11\x8c\x1b\x12\x35\x8f\x81\x44\x47\x92\x86\x4c\x06\xce\x42\x5c\xcf\xd5\xad\x62\xc1\x00\x7f\xec\xa4\x92\x71\xb0\xd3\x65\xfc\x8d\x63\x3e\x3b\xf1\xb8\x53\xfe\x08\xbe\xb5\x6a\x8a\x85\x7d\xae\x8b\xcb\xdb\x31\x75\xd5\x36\xca\xea\x0a\x92\x0a\x76\xa0\xf8\x04\xfa\x9d\x69\x84\x51\xe0\x66\x75\x05\x46\x55\xa7\xc4\xe2\x2b\x8b\x08\xf7\x5f\x2c\x42\x7f\x50\x23\xd5\xd2\x8f\xbd\x46\xb3\x6d\x3f\xc4\x7e\xd0\x2b\xc4\xa3\x1c\xc7\x2b\xa8\x75\xa4\xcb\x3d\x59\x5e\x2e\x68\x9b\x6b\x1a\xfa\xd9\xb9\xae\x41\x33\x7f\xd2\x0b\x6e\x87\xc6\x0e\x38\x5f\xb9\xea\x41\x2d\x91\x6a\x21\x46\xb3\x49\xda\xde\x88\x0f\xd5\xf6\x5b\x5b\xd0\x27\x41\xa1\xd9\xf1\x75\x40\xa8\x0c\x39\xa8\x13\x60\x25\x79\xa0\xae\xfd\x9c\xb1\x70\x9a\xab\x77\xa4\x5c\x5f\x79\xbc\xa0\x14\x01\xdb\x3a\x92\x65\x74\x03\x5a\xa9\xd6\xc5\x65\x3a\x7a\xe4\x14\xb0\x02\xf8\x2c\x60\x4f\x68\x76\x05\x57\x32\xef\x5e\x27\x88\x5e\x1d\x38\xe8\xc1\xc4\x91\x02\x8f\xc7\xa7\x69\xce\x27\x11\x00\x68\xcc\xaa\x51\x61\x7f\x51\x92\xa6\x3a\x0a\x74\xe3\xee\xbe\x3f\xd9\x3c\x9f\x84\x75\xd4\x9f\xba\xba\xd7\x3f\xcc\x0b\xd9\xc5\xec\x6e\xa4\x26\x63\xc2\xe1\x6e\x58\x9f\x8f\xea\x5c\x21\x33\x20\xd4\x10\xea\x3f\x7b\x5c\xd8\x25\xed\x34\xe9\xe4\xc7\x33\x20\x9d\xbe\x4d\xf7\x72\xf2\x0f\x0b\xf6\x8d\x6e\xf1\x00\x53\x89\xbe\x1b\x77\xa1\x53\x09\x33\x7a\xc5\xe7\x9d\x66\xe7\x42\x65\x17\x0e\xbd\xb7\x34\x95\x85\xde\xe5\x24\x46\x9c\xc3\xab\x40\x65\x02\x19\xe5\xcc\xb4\xdd\x4a\x1a\x8d\xcd\x42\x48\x79\x02\xc4\x01\xb2\x15\x36\x2c\x43\xda\xe5\xb1\xcd\x70\x1d\x44\xb6\xb7\xea\x61\x96\x24\xdb\xa8\x4b\xbf\x63\x3c\x90\x91\x6f\xe8\xe5\xf1\xb4\xa9\x19\x52\xe9\xb7\x4c\x15\xfc\x6c\x8b\xa1\x27\x17\xeb\x82\xda\x9e\xe2\x61\xbf\x7f\x1f\x5e\x7f\x33\x88\x83\x5e\xd0\xb1\xab\x27\x96\x42\x3a\x31\x79\xeb\x85\x78\x0b\x42\x6e\x3f\x85\xaa\x35\x5a\x59\xb2\xa3\xb8\x7b\x5c\xaf\x64\x5b\x70\x13\xd0\x78\x8f\x9a\x94\x37\xe5\x04\x05\xe4\x58\x4e\xbd\x02\x94\xb1\x23\xfd\xef\x51\x7e\x92\xc5\x0d\x7b\x97\xbc\xdc\x29\x34\xf2\x6f\xe6\x24\xa2\x64\x5b\x87\x37\xdd\xda\x55\xf8\xe0\x12\x3a\x51\x56\x8f\x9f\x27\xd2\x2f\x0d\x59\x1f\x0a\xe3\x0d\xf9\x12\x79\xd3\xf5\x42\xec\x74\x6b\x78\x85\xb8\xbb\x76\x84\x07\x6d\x08\xbb\x0d\x29\xae\xea\x7b\xad\xf8\x15\x14\xbe\xb6\xd1\x6c\x6e\x5d\x18\xa3\x8c\x2c\xf1\xac\x9e\x13\x0b\x24\xdb\x03\xc4\xa9\x88\xd2\x97\x17\x83\xc8\x63\xc9\x65\x6d\x0b\xcb\x54\x1a\x0f\xc2\x92\xa4\x35\xf2\xef\xb2\x6f\x4b\x23\xa7\x27\xc5\xbe\x34\xe4\xfa\xa2\xef\x92\x44\xef\xbc\x64\xde\xd6\xc9\x16\xf3\xf7\x30\xe4\x5f\xd9\x39\x0a\x93\x4f\x09\x6b\x60\x6a\x19\x0f\x00\x5a\xe6\x6d\xe3\xa5\xe4\xaf\x05\xe7\x31\x29\xa1\xc9\x3a\x90\xaf\x5a\xd4\x97\xa0\x13\xed\xf4\x80\xb5\xb5\xc4\xf0\xe1\x04\x43\xe8\x08\x89\x55\x0f\xca\xea\xaa\x2a\x4a\xc1\x06\x9d\x05\x3d\xbd\x53\x60\x8c\xaf\x4d\x0a\x66\xbc\x5d\xdd\x7b\x2e\x68\x7b\x36\x1a\xbc\x9d\x92\xe4\x4a\x43\x33\x41\x10\xc9\xd8\x89\xa9\xdf\xc1\x43\x74\x48\xfd\x3e\x00\x9c\x21\x84\x5d\xbb\xeb\x05\x4b\x44\x16\x67\xe7\xc5\xb4\xa1\xc3\x39\x17\xba\xbc\x29\x7c\x49\xc8\x68\xdd\x79\x4b\xf0\xfb\x1e\x04\x3e\xcd\x4c\x2c\x2b\xb7\x8a\x07\x16\x71\x08\xf6\x06\x23\x03\xa8\xda\x1c\x2a\x44\xfd\xf0\x4d\x11\xdb\xfc\x19\x02\x15\x86\x61\xaa\xa8\xb9\xb7\xab\x7d\x65\x3d\x72\xf4\xe8\x46\x79\x01\xf0\x43\x2b\xe1\x83\xe7\x90\xef\x9c\x3c\x90\x97\x98\xe1\x2f\x24\xf0\xa7\xf3\x8e\x9d\x29\x57\x90\x70\x6b\x22\x20\xae\x9d\xca\xf6\x12\xe7\x6a\xd5\x9b\x0d\x5d\x05\x5e\xe8\x3d\xac\xe2\xfd\x60\x7b\x93\x2d\x46\x64\x7b\x31\x1e\x49\x52\x39\xb6\x9f\xdf\x24\x0c\xbf\x83\xa7\xf1\x97\x07\xfb\xe5\xa6\x14\xe3\xe1\x44\xfa\x83\xfb\x22\x97\xbd\x83\x61\x13\x4f\xa7\x74\xf0\x88\x2e\x29\x80\x31\x7b\x24\x34\xc3\xc8\x46\xf7\x8b\xe8\x6f\x21\x24\xe1\x0a\x36\xb0\x9e\xd6\xed\xe1\x8c\xa8\xb9\x8e\x06\x09\x79\x78\xab\xc4\xb2\x07\x08\x58\xf2\x4d\x37\x7f\x23\x2f\x68\x89\xe0\x1d\xe0\x1a\xcd\xc8\x1a\xff\x4b\x66\xb5\x96\x7a\xb1\x4d\xf3\x68\xf6\x9d\xc3\x33\x02\xb4\xcf\x8d\x3d\x4f\x2a\x1f\xc1\x48\x06\x42\xd5\x6a\x83\x32\x13\x64\x05\x9b\xd7\xd1\xb2\x96\x9c\xc3\x20\xef\xf0\x0d\xd3\x49\xd0\x70\xb2\x7f\xbb\xa1\xc1\x60\x81\x24\x39\x6a\x62\xd9\x9f\x15\xcd\x38\x6d\x28\xd0\xab\x06\x65\xc2\x42\x9c\x8e\x5e\x6a\xc9\x8c\xf6\x90\x50\xfe\xb3\x30\xc5\x75\xbf\xaa\x25\x22\xf2\x99\x6b\xf8\xc2\x37\x64\x3d\x07\x04\x4f\xc1\x45\xf1\xed\x38\x19\xf0\x42\x95\xd2\x76\x80\xb6\xd9\x32\xe5\x10\x54\x6c\x94\xfd\xb8\x38\xbe\x1d\xa2\x64\xdf\x40\x44\x8b\x9b\x16\xb6\x74\xaf\x9f\xb8\xf2\xdb\x97\x3a\x89\xc7\x50\x0a\xd6\xc3\xb2\x2e\x7a\xa6\x50\x71\xdc\x54\x61\x3d\x2d\x83\xfb\x3e\x0e\xf9\xe6\x15\x1b\xf1\x8f\x20\x97\x02\xfa\x38\x25\x20\x62\x59\x21\x7b\xa7\x9b\xe9\x41\xa1\x0e\x21\xa1\x15\x4a\x4e\x12\xc5\x82\x86\xfb\x53\x26\x40\x1e\x15\xac\x31\xb1\xab\x68\x30\x63\x23\x9d\xb5\x44\x23\x6a\xf6\xcc\xea\x2a\x0b\xba\x12\x0d\x19\x46\xa9\xb5\xa3\xb4\x74\x01\x88\x92\x9c\xc8\x23\xca\x2c\x8e\xf2\x54\x1d\x2c\x03\x62\xf7\xa0\xfd\x6d\xf6\xa5\xc4\x2d\xc1\x75\x4c\xbb\x13\xf2\x3c\x38\x0d\xca\x63\xb5\xfd\x4f\x2e\x0e\x96\x31\x78\x42\x25\x52\x8a\x35\xa2\xef\xf2\xaa\x16\x0c\x1a\x61\x93\x6d\x31\xb2\xc7\xcd\x8e\xfd\xf3\xdb\x09\x32\x4b\xda\xe3\x7a\xa1\xa0\x56\x62\xf1\xd0\x27\x0c\xa8\x04\xac\x0c\x89\x4f\xc8\xbc\xbf\x3a\x8a\xc9\x72\x01\xe1\xfe\x67\x6f\x51\x9a\xc3\xc4\x3a\x77\x67\x53\x4c\xa3\xd0\x18\x34\xfb\x87\x2b\xf2\xee\xc0\xf3\x03\x8b\xe0\x3e\x63\x3f\xbb\xf3\xb5\x94\x0f\x83\x27\x5f\xcb\x93\x5b\x2b\x9f\x5d\x2c\x2f\x98\x32\x9a\xed\x40\x94\x26\xe3\xe3\x64\xc2\xde\xa8\x7d\x57\xd1\x5c\xa8\xd4\x1c\x4e\xef\x80\x18\xf8\x6e\x2d\x32\xe8\x04\x29\xf5\x05\x4d\x07\x71\xbb\x24\x01\x3c\x25\xe2\xf5\x52\xba\xdf\xbf\xb9\xe7\xaf\xd6\xbf\xdc\x64\xef\x89\xd7\x49\x01\x10\xc5\x35\x15\x86\xc4\x83\xea\x47\x31\xfc\xf9\x2d\x89\x12\x6c\x47\x4c\x42\x6a\x50\xfa\xc1\x50\x24\x04\x87\x42\xc7\x9d\x7e\xb4\xaa\x13\x78\x72\x1f\xd4\xcb\x74\x6d\x63\x79\x61\x72\x39\x0f\x2a\x56\x30\xee\xdf\x0a\x04\x5a\x96\xa8\x81\x21\x3a\x5e\x92\x37\x07\xb3\x6a\x0c\xd2\x15\x75\xcc\xc9\xbf\x72\xd9\xf2\x3b\xf9\x84\x8c\x26\x41\x17\xca\xf8\x62\x28\x33\x59\x6e\xf4\x2c\x97\x02\xff\xf6\xe1\xe7\x8c\xda\x4b\x4e\x16\x0b\xab\x88\xa7\xb3\x56\x3c\xdf\x9d\xb5\x27\xd2\xd6\x4f\x3b\x4a\x07\xec\xea\xe5\xbd\xa9\x00\x92\x52\xe7\x19\x56\x2f\x6e\xea\x63\xfd\x82\xd2\x66\xa4\xbb\x41\xbf\x8b\xae\xba\x28\xfe\x06\x04\x93\xe6\xd5\x22\xa3\xdc\xc1\xf4\x98\x36\xdb\x03\x64\x30\x6f\x41\x5d\x57\x32\xb9\xa2\xab\x92\x2d\xf1\x05\x57\x66\xbc\x56\x36\x48\x98\xd5\x0d\x33\x84\x70\x5b\x61\xaf\x63\x1b\x7c\x0b\x45\x14\xd9\xeb\xa0\xab\xe1\x05\xf0\xa2\x61\x21\x97\xe7\x27\xc0\x22\x40\xa3\x2c\x7d\x7d\x90\x1f\x7d\x17\x46\x21\x56\xde\x7d\xe2\xcb\x14\x2e\x0d\x30\xec\x5d\x35\x9a\xe1\x6b\x25\x04\x85\xde\x48\x65\xba\xe5\x0f\x30\xb3\x48\xd8\x4f\xa4\x4b\xb3\xba\xa1\x11\x15\x6b\x9c\x69\x5d\x08\x2a\x6b\x23\x0a\x40\x99\x70\xb1\x11\x63\xdc\x45\xc9\x47\x40\x8a\x93\x80\x2e\x11\xc4\x8a\x2c\x4b\xca\x9d\xb7\x8f\xd5\xd2\x1b\xda\x35\x0e\x86\x99\xcc\x37\x7e\x02\x65\x57\x36\x70\x57\xb4\x7e\xf2\xb4\x3b\x64\x47\x53\xe5\x10\x8d\xa1\xc1\xe9\x3d\x26\x29\x7f\x72\x2a\x88\x69\x41\x57\x9e\x64\xb1\x4c\x01\x45\x7d\x58\x10\xeb\x6a\x32\x0f\x69\x14\x64\x58\xa2\x13\x66\xf3\x42\xd7\x9b\xb7\x73\x53\x1c\xd1\x6d\x61\xa9\xd0\xd5\xc8\xda\x93\xf9\x84\x5f\xa2\xc6\x0f\x44\xdc\xb5\xa3\x78\xc0\x02\xe7\xd0\x64\xf5\xf3\x3a\x5b\x7a\x38\x21\xe2\xf9\x4d\xba\x9a\x30\xca\xb7\x23\x33\x77\x95\xe7\x18\x7a\xa8\x97\x8d\x92\x78\x80\x1f\x93\x5d\x06\xf2\xf0\x4c\xf9\x0d\xcd\xbc\x63\xd8\xe1\x68\xde\x7a\xe4\x94\x3e\xdc\xc4\x25\x59\xb5\x8b\x17\x99\x3a\x39\x38\xb2\xf6\x9a\x2e\x96\x3f\x78\x33\x07\x42\xb0\xcd\x2e\x2e\x9c\x73\x81\x7a\xad\xa9\x52\x31\xa1\x12\x0b\xe6\x3d\x8b\x70\xd4\xd6\xb1\x0d\x50\x4e\x83\x46\xe2\x5c\x26\x42\x49\x93\xa5\xc7\xc1\x68\x01\x5a\x64\xa0\xa2\x7f\x82\xe8\x3a\xea\x01\xf6\xd9\x30\xdb\xc9\x73\x64\x53\x1c\xf6\x5b\x9d\x1d\xc6\xd9\xfc\x2e\x64\x73\xed\x04\x78\x47\x8d\x93\xb3\x52\xbc\x4d\xe4\xd6\x35\x96\x74\xcf\x15\x0e\xa6\xc8\x50\x12\x14\xbc\x81\xf2\xb1\xd5\x67\x87\xf1\x63\x4f\x84\x9d\x2a\xd3\x67\x70\x2a\xca\x4c\xcd\xd2\xd9\x65\x33\x8d\x0f\x01\x4e\x45\xc9\x4b\xb7\x7a\x80\x29\x3b\x71\x9e\x94\x83\xb2\x60\x90\x1b\x5d\x41\x76\xd6\xe5\x62\x03\x28\x6a\x2d\x4d\x03\xbd\x7a\xb2\x9b\x6a\x36\x41\x31\x70\xe3\x32\xa9\xc0\xc6\x7b\x71\xbd\xa9\x73\x58\x21\x26\x1d\x8a\xfa\xd8\xa9\x33\x5f\xbd\x44\x86\xaa\x64\xed\xcf\x23\xcb\x19\x03\x58\x9c\xe2\xfd\x1b\x2a\x12\xe0\xf6\xf6\xa1\x3c\x0d\xdd\x5d\x95\x94\xef\xcb\xf2\x6f\xec\xc9\xcb\x19\x5e\xe2\xec\x10\xd8\x3c\x73\x34\x80\x47\xad\x93\x41\x45\x96\x71\x43\x1f\x71\x5d\x47\xa3\x43\xa4\x4f\x1b\x95\x61\x6d\x60\xe5\xc8\x1e\xa8\xe6\x9c\x0f\xb6\xdc\x80\x77\x2d\xb9\xa1\x77\x0c\xb8\x04\xcd\x03\x1e\xa1\xba\x0b\x0f\x43\x39\x0e\x9b\x5f\x51\x3c\x9d\xb4\x8b\x0b\x21\x94\x9c\xcd\x09\x97\xc5\xdc\x66\xe3\xc1\x9c\x9d\xcd\x8f\x62\x41\x2b\x9e\xcd\x39\x6c\x70\x78\x01\x3d\x7f\x35\xda\x24\x0f\x62\x94\xbc\x17\x48\x89\x46\xe6\x64\x5b\xeb\x78\x34\x87\x1a\xeb\x8b\x5f\x2c\x0b\x68\x91\xa4\x9d\xd5\xaf\xcd\x16\x7f\xf3\x4d\xa1\x6e\xbe\x68\xbb\x03\xd9\x60\xc5\x89\xa1\xa1\xd3\x28\xbb\xe8\xa0\xbc\xfd\xac\xc7\xfa\x92\x70\xc5\xbb\xf4\x83\xa7\x74\x34\x3d\x79\x58\x50\xfb\x78\x05\x4d\xcc\x12\x3e\x51\x94\x15\xfb\xf3\xcb\xde\x1e\x6b\x20\x7c\x00\x94\x5b\x0a\x01\xe5\x09\x91\x42\x1d\x29\xed\xe5\x23\xcf\x8e\x32\xa8\x61\x6f\xde\x51\xf5\xdd\xf6\xd0\x6a\xf2\x0d\x75\x22\x9c\x8d\x17\x77\x59\xbd\x17\x69\xf7\x7a\xac\xf9\xb6\xef\xe0\x00\xa5\x4f\x97\xb2\x12\xb6\x57\xb0\xe5\x5c\xd9\xd3\xa6\xca\xfe\xf9\xd5\xc7\x67\x2c\xf1\x3b\x5b\xa2\x82\x56\x30\xbb\x4c\x9c\x5e\xc9\x1c\x9d\x8e\x35\x19\xe5\xce\xbe\xf0\x49\x62\xa4\x83\xbb\x26\xc7\xed\x83\x97\xc2\xc7\xb5\x74\x51\xe6\xa2\xc1\xb4\x30\xb5\xbb\x7e\xc7\xe1\x85\x1f\xf1\x55\x1b\xe2\x3e\x92\xaa\x36\xf6\xcb\x3d\x3b\x67\x34\xcd\x4e\x4e\x99\x46\x27\xea\x6d\xd7\xd5\x6e\xb5\xb2\x0f\x58\xb0\x8a\xab\xdb\xcc\x8b\x83\x7e\x1e\x24\x31\xa0\x52\x5d\x28\xd1\xa5\xd0\x0a\xc2\x6f\x2a\xe7\xaf\x1a\x96\xb0\xc9\x8f\x6f\xf1\x1c\x40\xcc\x42\x39\x94\x59\x36\xdf\xf3\x23\x13\x27\xc7\xdb\x53\x3d\x45\xbc\x4c\x31\x0c\xeb\x95\x6e\x2c\x8c\x45\x90\x48\x50\x29\xda\xd9\x56\x2a\xfd\x7b\xdc\x36\x8d\x72\x82\xa7\x21\x6f\x6f\xb0\xa0\x61\xb5\x08\xf1\xe5\x4a\x06\x2a\x18\xb3\x23\x7f\x91\x8d\x3e\x59\x05\xfa\x3a\x1d\xda\x83\xe2\x8a\x34\x47\xb4\x02\x03\xbd\xa9\xf7\x6b\x61\x55\x57\x9a\xe0\x35\xbb\x18\xe5\x4a\x6c\x37\x51\x8b\x0e\x63\x20\xac\x79\x07\xbe\x9e\x32\x91\xb7\xab\xcf\xb6\x61\x96\x6b\xf9\x70\xe5\xcb\x10\x0e\x3d\x7a\x22\x89\xc4\x25\xe4\xb3\x9b\xff\xfd\x4b\xdf\xd8\xd5\xc9\x60\xdd\x09\x28\xad\x9c\x06\x00\xf6\x1d\x52\x5b\xe0\x05\x1f\x8a\x78\x68\x35\xfb\x03\x9c\x64\xa4\xd6\x2e\x11\xa3\x03\x7f\xa8\x76\x6b\x9d\xa5\x78\xf5\x35\x8d\x2a\x30\x2e\x91\x0d\xc5\x41\xea\x16\xc5\x45\xa3\x67\xa9\xf5\xe3\x1a\x8a\x4d\xb1\x12\x6c\x30\x0b\x65\xe9\x1c\xfc\x88\xfe\xcb\x92\x00\x0f\xc0\x65\xcd\xa0\x0d\x6b\xde\xea\xb5\xc3\x00\x55\x8a\x49\x2e\xbe\x37\x4f\x7f\xe7\x0e\x39\x66\x97\x13\xff\x4d\xcd\x3a\x99\xe9\xb7\x49\x45\xdb\xc9\xee\x2e\x2d\x71\x23\x63\x6a\x8a\xd4\xf9\xa4\x0e\xe5\xc1\x75\x0e\xf4\x5a\xb3\x37\x41\x45\x0c\xe2\x61\x0f\xca\x62\xfa\x8c\xc8\x35\x50\x46\x90\x00\x9e\x9d\x9f\x19\x06\x7b\x1e\xda\x7f\x96\x4c\x79\x4f\xa7\xc4\x34\x88\x5c\x15\x26\x44\x73\xac\xeb\xf6\x19\x98\xc6\x99\x06\x13\xb0\x0c\xee\xea\x8f\x5b\x0e\x08\x2c\x9a\xdd\xda\xe2\x13\xc7\x54\x35\xe1\xd9\xb1\xe4\x7e\x40\x52\x21\x97\x18\x2f\xa3\x47\x31\x07\x52\x5c\x67\x04\x7d\xda\x73\x6b\xee\x7e\x0c\xf4\xba\x71\x41\x9b\x87\xdd\x67\xf8\x41\xa9\xd5\xb4\x4b\x1d\x72\xa2\x7e\xd8\xe5\xb0\x8e\x62\x3d\x60\x41\x8e\x1a\xf5\x52\xd8\x86\xf1\x61\xd7\x31\x7b\x98\xe7\x31\x93\x4c\xb6\x1c\x96\xd3\xa8\xe7\x16\xfd\xcb\xd9\xb4\xff\xca\x4d\x1e\xf1\xe6\x31\xa1\x06\xdf\x6e\x08\x68\xb4\xcb\xab\x6e\x36\x8d\xe4\x70\xf6\xcc\x3b\x3a\x99\xad\x05\x3e\x2a\x08\xfb\xb8\x42\x1c\x33\x15\xc1\x33\x8f\xd6\xc8\xf7\x74\x41\x37\x31\xcb\xa3\x76\xab\x08\xcc\x98\xb3\x32\x66\x4b\x99\xf7\xe6\x56\xf4\x8b\xfd\xdf\xad\xfc\x15\xdb\x6a\x83\xb5\xd3\x38\xd1\xef\xe0\x95\xb2\x66\xb7\xb6\x3b\xf2\x27\x3e\x8a\x00\x6d\xee\xa3\x93\xc4\x78\x26\x74\x8b\xf2\xe5\x8f\xb9\x44\x1d\x5f\x40\xa0\x30\xdc\x89\xf2\x83\xc7\xc4\xea\x12\xf1\xf5\x69\xc8\xb5\x80\xed\x41\xd9\x00\x66\x13\x77\x5f\x51\x5c\xb9\x0b\x86\x6f\xdd\xde\xc3\xa9\x49\xa2\x6d\x1a\x14\x28\x28\x58\x36\xba\x82\x50\x1a\x45\x78\xe6\xcd\x21\x7a\x09\x71\xa4\x28\x36\x75\x7f\x47\x7f\x49\x8e\x40\x45\xba\x76\x39\xd7\xab\x52\x4e\xd1\xe4\x09\x11\xb3\x2b\xe8\x77\xa2\x3f\xe5\x62\x1f\xbc\xb5\x9c\xb1\xf9\x3c\xba\x5e\x59\xbc\x7f\xb3\x43\xe8\xd4\x11\x34\x3c\x13\x71\xcf\x0c\x66\x80\x56\xc4\xbd\xa1\xf9\xf9\x74\x51\xea\x5a\x59\x98\x53\x29\x28\x43\x19\x5e\xf8\x1c\x3f\xae\x57\xfc\x8c\x44\x23\x2e\x6c\x90\x9e\x77\x67\x80\x91\x94\xa7\x93\x54\xc6\xd4\x4d\x6d\x3e\x44\x72\x4b\xb1\xe2\x38\x9f\x54\x67\x65\x0b\x47\x50\xba\x1d\x4c\xb9\xd7\x38\x6f\x30\x33\x6c\x69\xf8\xe0\x31\x7a\x79\xe4\x3b\x2f\x31\x27\x74\x20\xee\x3e\xa2\x61\x27\xa6\x7a\x1b\xdc\x20\x59\xdb\xca\x0e\xd6\x42\x55\x13\x9d\x4b\xc9\x56\x2d\x4d\xc1\xa8\x95\x74\x5a\x51\x07\xeb\x0e\x99\xaf\x07\xe0\x01\xf8\x47\xc6\x0d\xc5\xc5\x91\xeb\xc1\xf1\x2d\xae\x52\x63\x7c\x4b\x78\xb1\xbe\xba\xe4\xc9\x31\x54\x39\xf2\x30\x28\xe9\x1c\x4d\xcf\xfd\x58\x83\xb3\xe2\x54\xbb\x18\xc5\x51\x2d\x08\x80\x55\x76\xeb\xd9\xb2\xf3\xa1\xcd\x57\x08\xe0\xb5\xfe\x6a\x27\x61\xc8\x1a\x90\x48\x6a\xd3\x6c\xf5\x3d\x3b\xe5\xc8\x23\xbb\xc7\xe4\x04\x2e\xcb\x00\xe2\x5f\x3a\xac\x04\xaf\xfc\x21\x01\x6c\x52\x61\x5c\xb4\x19\x4e\x46\x06\x08\x1e\x43\x7f\xe9\xff\x88\xe1\x64\x11\xa6\xee\x58\x19\x09\x92\x65\x94\x6b\x4a\x4b\x5e\xbd\xea\xcc\xa4\xd9\x17\xfb\x9b\x1d\xac\xfc\x29\x63\x0c\xe1\x68\x42\xc1\x8c\x04\x59\x99\xe2\x1a\x92\xe9\x1a\xe4\x2c\x7e\x4a\x22\xc5\xe3\x52\xa7\xf0\x63\x84\x7a\x49\x6d\x21\x3d\x5b\xd0\x72\x60\x8d\x45\x66\x03\x76\x8d\x9a\x11\xb0\xf9\x48\x35\x31\xb2\x44\xce\xe3\xe9\xcd\xfc\xae\xaa\xb4\x71\x3e\x93\x58\x76\x07\x32\x54\x5e\x11\xfc\x0e\x2d\xa6\x74\x10\x27\x15\x24\x28\x00\xc4\xa9\xbf\xb7\x7a\xdf\xc3\x93\xb1\xa8\x26\xe9\x9e\x98\x7e\x7c\xbc\xd1\xe6\xcc\x9e\x77\x32\x08\x47\x7f\xb0\xdf\x43\x80\x7f\x30\xeb\xb5\xff\xd7\x27\x7f\xb0\xa8\x0b\x55\x1e\xd4\xba\x29\x4a\x08\x81\x89\xf2\x67\x36\x6b\x09\x18\x2b\xe5\x94\x86\x57\x20\x43\xa6\x92\x96\x25\x31\xc9\x66\xae\x6a\x3f\xe1\x06\x7e\xe2\xdb\xbb\x4d\x5c\xa4\xd2\x7a\x6a\x6d\x81\x94\xa6\xf4\x80\xf0\x2c\xc0\xb5\xdf\x38\xa6\x2a\x23\x97\xb1\x26\xdd\xe4\xe0\x45\x7f\xba\x94\x72\x3f\x29\x61\xab\xf7\x86\xc9\xe4\x1c\x9e\xcf\x3a\x8c\x37\xf6\xa9\xa2\x31\x58\xe3\x03\xea\x28\x74\xea\x52\x5a\x6b\x86\xae\x67\xf0\x2c\xe0\xc5\xce\x7d\x40\x66\x72\x8f\x00\xe2\x68\x5f\xc2\x48\xb3\xe4\x6b\xdc\x0e\x4c\x41\x81\xe1\xb8\x7d\x44\xc0\x51\x46\x2b\x5e\x1c\xbd\x60\x9c\x38\x79\x0d\x56\xe2\x11\xfa\x45\x38\x64\xc4\xd2\xca\x88\x77\x54\xb9\x35\x2f\x86\xf8\x7e\x6d\xc1\x25\xce\xb5\x42\x87\xc8\xfc\xfe\xfd\x33\xa2\x37\x6c\xd4\x1a\x0b\xe7\x98\x32\x9b\xd9\xed\xe4\xfc\x28\xfd\x4a\xf6\x3a\xa1\x63\xb6\x7c\xc5\xff\x24\x81\x6a\x18\xf1\x43\x7f\xac\xed\xbb\x19\x6c\xb1\x63\x8e\x6f\x8e\x17\x01\xc9\xfb\xd9\xff\xeb\x76\xb6\xe5\xb0\x0c\x7a\xca\x8c\x0c\x7d\x92\x20\x82\xdd\x89\xda\x6a\xd6\x6c\x99\x10\x96\xc8\xf1\x39\xa2\xc7\xef\x13\x29\xd3\x62\x2d\x60\xcb\x9b\x35\xfa\xb0\x38\xfb\x42\x13\xed\xa5\x4d\x6d\x88\x72\x24\xea\xb9\xd8\xe4\xa9\x85\x65\x30\x54\x36\x8a\x7d\x43\xfb\x9a\x47\x0c\x93\x08\xab\xd3\xb9\x75\x78\xef\xe2\x7d\xa6\x94\x96\x51\xce\x1c\xdd\xf0\x27\x70\x1e\x1d\x06\x01\x8a\x33\x76\xc1\xc9\x37\x0a\x0a\x6d\x50\x74\x6d\x24\x1a\x07\x3e\xb2\xa9\x40\xc7\xae\x0d\x91\x50\xb1\x43\x9c\x56\x52\x39\x94\x73\xd7\xb2\x34\x07\x05\xa1\x95\x03\xe4\x7d\x9c\x42\x55\x31\x65\xf7\xe5\x66\xaa\x37\xde\x37\xf8\x27\x05\x6b\x6f\x4c\xc0\x7d\x3a\x05\x70\xf1\x36\x29\xcc\x58\xc2\x6d\x0a\xce\x9f\xc0\xc0\x31\x7c\xf5\x2a\x08\x0a\xa7\xc2\x19\x3e\xae\x7f\xae\xfe\x13\x20\x49\x61\x21\xc9\x47\x56\x64\x96\x22\xc2\x64\x01\xed\x8f\xd8\xb7\x7e\x3d\x7c\x18\xab\x2b\x8e\x93\x6a\x61\xf2\xd0\x27\x59\xf5\x1a\x4f\xe1\x18\x44\x13\x53\xb6\x03\xd1\x41\x44\xd1\x16\xc6\x05\x89\x74\xce\xfe\x51\x6a\x20\x91\x90\x69\xff\x32\xcc\xd5\xc9\xab\x2b\x09\xf4\xe4\x15\x1a\x96\x9d\x9b\x73\xa9\x2a\xdd\x84\xc4\xb8\xae\x9d\x77\x68\x44\x3e\x0a\x86\x26\x8e\xf1\x6d\x0b\x64\x7a\x79\x92\x6f\x8e\xfa\xf8\x80\xea\x75\xf1\x8c\x35\xe7\x35\x19\x85\x71\x9d\x46\x16\x28\xfd\x9b\xae\x8b\x82\x94\x95\x38\xb0\x2a\x3b\x0e\x35\xf4\x53\x32\x02\x53\x58\x4b\xdf\xa4\xce\x5b\xea\x6c\xce\x97\x59\x98\x8c\xfd\x97\x70\x2c\x2c\xa8\x99\x49\xde\x03\x5e\x7b\xf4\xef\x18\x6b\xd0\x9f\xe4\x0a\x2e\x69\x57\x4d\xd2\xc2\x0a\x03\x57\xba\x2b\x98\x25\xec\x04\xb0\xd9\xcf\x48\xf2\xc4\xd3\x17\x16\xa8\x65\xad\x36\xa2\x35\xde\x5f\x9e\x25\xf4\xa4\xe0\x83\x87\x2e\x73\x27\x04\x33\xfb\x34\x73\x9d\x4a\xe4\x1a\x79\x13\x18\x24\xda\xe6\x40\x5e\x14\xe6\xb9\x4e\xce\x85\x08\x1d\xc3\x9e\xc4\x2e\x41\x4c\x4f\x89\x99\xb6\xb2\xec\x77\x96\xc5\x5c\x06\x35\x82\x6c\xbe\xb3\xfb\xf4\x20\xed\xf0\x65\xaf\x80\x3e\x06\x2b\x5f\x3b\x98\x4b\xcf\x38\xbd\x40\xcd\xe6\xc0\x57\x59\x99\xf2\x4e\x2c\x20\x5d\x17\x02\x4a\x33\x88\xa0\x38\x22\x19\x59\xe0\xdb\x39\xab\x0f\x75\x62\x95\x77\x22\x1b\x80\x6d\xae\x0a\x4c\xa9\x79\xfb\x4e\x6e\x07\x1a\xd2\xee\x0a\x69\xce\x46\x19\x26\x68\xce\x96\x11\x12\xb1\x13\x67\x1e\xe4\xfb\x32\x66\x71\xea\xfc\x1d\x4e\x63\x91\x70\xc0\x9e\x33\x21\x57\x07\x4b\x61\x28\x1c\xba\x2d\xa7\x03\xe2\xfc\xd2\x27\x47\x10\x4e\x48\xa0\xc3\x57\xb3\xf4\x9d\x24\x3e\x89\x0c\x67\xc4\x82\xbe\x5d\x90\x5b\x23\xd5\xc3\x6f\x06\xa8\xb1\x6e\xbb\x8f\x82\xb0\xb1\x7f\xe1\xc5\x0e\xd0\xbd\x6c\xc8\x8b\x03\x0b\xc7\xa6\x4d\x45\xe7\xc3\x95\x7e\xda\x7d\x20\xdd\xfe\xc9\xe9\xf9\x0b\x0a\x25\xea\xe2\x1d\xfd\x1d\xd7\x6f\xf2\x36\x68\xa3\xbf\x52\x84\x43\x25\x40\xa1\x16\xe7\xcd\x6f\xed\x00\x80\x07\x11\x45\x3b\xba\xd6\xf7\x87\xd9\x2c\x44\x19\x25\x35\x18\xa4\x91\x1c\xc1\x17\x1c\x57\x9b\x34\x41\x8d\xb6\xec\xfc\x79\x67\x8b\xb6\xe8\x05\x78\x95\xec\xc3\x2f\x35\xdb\x73\xd8\x8b\xc3\xd0\x0e\x8e\xda\x01\x38\xa1\xcb\xa0\x15\x03\x32\x68\x5d\x8c\x3c\x7a\xd3\xc3\xc2\x6e\x13\x0c\xa6\xe5\x9d\x58\x3c\xb9\x5a\x82\x0f\x81\x96\x13\xc0\x1a\xf8\x1c\x48\xa9\x9d\x6a\x77\x76\x52\x58\xa6\x01\x20\x9b\x92\xcd\xc3\x8a\x29\x2c\xcb\xca\xa6\x53\xf0\x52\x76\x49\x99\x22\x07\x4e\xa7\x85\xdc\x61\x72\xdd\x3d\x32\x00\xef\xf8\xc3\xe6\x33\x67\x03\x5d\xb0\x01\x67\xa9\x62\x5e\xd0\xa9\x47\x61\x36\xad\x54\x3d\xd0\x01\x0d\xda\xd2\x1d\xe9\x2a\x54\xed\x7a\x4c\xcb\x8e\xdd\x27\xa5\x9c\x44\x4a\x66\xa0\x3c\xea\x29\xf9\x4e\x81\xf5\xc5\xa9\xc4\x0d\x15\x19\x18\xf0\x4f\xf1\xfe\x3a\xae\xd8\xed\xe4\xc2\xe6\xf1\xb4\xf1\x51\x90\x21\x2e\xae\xd5\x20\x11\x5a\xdb\x47\x45\xec\xcf\x14\x07\xab\x06\x53\x4e\x21\xf8\xbc\x39\x6d\x5f\x27\x09\xec\xa4\xf2\x7b\xa5\x79\x5e\x4d\xcb\xda\x30\xf1\x94\x1d\x12\xa6\x90\x5c\xb3\x1a\x4b\x60\x1a\x6f\x98\xbf\xb8\x85\x5e\xe1\x01\xd8\x51\x6a\xd1\x9b\x1c\x52\xfc\x0f\xa3\xb8\xef\x14\x8d\xa6\x33\x7c\xb3\x53\x0f\x59\xdf\x86\x64\xda\xe9\x10\x30\x06\x2d\x92\x08\xd7\x35\x03\x03\xbc\x07\xaa\xfb\x83\x45\x7d\x84\x79\x87\xa3\x43\x3b\xc7\xd4\xef\xe5\x05\x00\xcc\xe4\x03\xd8\x43\x34\xb4\xac\x35\x86\xdc\xc6\x44\x24\x71\xc0\x7c\xac\x48\x31\xa4\xd3\x39\x41\xda\xd4\x82\x14\xc3\x09\xfc\x93\xea\xdd\xa0\x38\x35\xfa\x32\xdf\x0e\x88\xbc\x51\xab\x95\x68\x03\xad\x67\xa8\x5b\xda\xae\x21\xbf\xd1\x09\x40\x24\x45\xc4\x0f\xe9\x27\xd0\xdd\x45\xcf\x7c\x85\xe4\x13\xa5\xfd\x7f\x71\x0c\x1d\x30\x3b\xc5\x2f\x91\xe0\x93\xbd\x33\x1a\xb9\xad\xe6\x4a\x5c\x93\x48\xc5\xc3\x1c\xa7\xca\x8b\x48\xba\xe2\x3e\xaa\x6e\x9b\x1e\x2b\x80\xa5\x9b\x0f\x40\x5b\xa9\xbf\xd1\x89\x29\x85\xbc\xb2\xb6\x54\x00\xbc\x58\x4b\x00\x60\x6f\x1f\x05\x71\x72\xce\xca\x81\x6e\x3d\x6d\x72\x1c\x42\xdb\x43\x9c\x5c\x7d\xb4\x7d\xbc\xd2\x3a\x98\x21\x7c\xb9\x17\x9d\xc7\x68\x2d\x71\xb2\x34\xef\x99\xa1\x21\x3c\x77\xcf\xec\xe7\x9c\x98\xf0\x7a\x33\xf3\x83\x68\xbd\xdd\x6e\x4b\xbc\x7d\x22\xab\xc2\x5c\x08\x7d\x13\x48\x1b\xd5\x15\xeb\x4e\xa0\x96\xc7\x6c\x8c\x6d\x0c\xa4\xb1\xe9\xb9\x18\x09\x17\xa8\xf7\x89\x60\x7a\x0f\x8d\x89\xb8\x5b\xf0\xa7\xf6\xc2\x5a\xc3\x59\xa1\xf8\x4a\x57\xb1\x28\x2a\xe7\x4c\x75\x94\x2b\x46\x8b\xe1\x5b\x87\xbf\xde\xc4\x60\xd9\xf1\x83\x7e\x46\x5b\xd5\x78\xd1\x84\x36\x1d\x48\xce\xce\xdb\x9e\x7f\x71\x22\x54\x99\xea\x41\x0d\x42\xf3\x85\x53\xfd\x90\xfb\x61\xbe\x4a\xa3\x4c\xc8\xdd\x7b\x37\xbf\x4e\xe7\xc7\x69\x4e\xec\x25\xda\x5c\x22\x7b\xea\x56\x56\xd5\x19\x65\x18\x8b\xe3\x44\xf3\x49\x62\x15\x4f\xbc\x46\x2a\x64\xd2\x9f\x0f\xab\x46\x93\xd9\x7b\x43\x3d\x59\xe2\x8c\xe7\x93\x8a\x25\x15\x65\x67\xea\x32\x98\x1c\xc9\xce\xd9\x25\x3e\x92\x32\x62\xc6\xce\x0e\xa7\xbb\x21\x48\xf4\x29\x69\xb5\x8d\xa9\x22\x4e\x92\xef\x11\xf1\x9f\x0e\x23\x43\x6a\x91\x7e\x7f\x07\x97\x1b\xee\x4a\xbd\x0b\x55\x95\xd2\x93\x71\xb2\xd7\x45\xb5\x14\x15\x7e\x02\x82\xa9\x5f\x57\xe4\x2e\xa9\x31\x2d\x51\x62\x63\xa6\x64\x1c\xb5\x56\x59\x4d\xb4\x5e\x59\xd8\xd4\xa3\x05\x60\x44\x68\xbb\x28\x90\xae\x3e\x0a\x4d\xea\xae\x23\xdc\x71\xbe\xd7\x88\xa9\x2d\x72\xa9\x4c\x48\xdf\xec\x0b\x61\xa3\x5d\x47\xf1\x83\x45\xa9\xfe\x91\x64\xb7\x5a\x30\x8c\x08\x39\xd4\xb3\xc3\x22\xd8\xf0\x0c\x16\xbb\x7d\x10\xfe\x0d\x38\xcc\xa4\x83\xad\x01\x21\x91\x71\x21\x6e\xc1\xac\x0c\x49\xe8\xed\x62\x30\x2e\x67\xc8\x49\x8b\xe7\x87\x6d\x55\x79\x88\x48\x4f\x78\x25\xb6\xa1\xfb\xd9\x97\x97\x29\x6f\x6c\x19\xfb\x03\x33\x5b\xdb\x54\x87\x3b\x8d\xee\xbd\xf3\xdb\x3f\xe1\x56\x51\x7c\xdb\x9f\x11\x23\xfa\x7f\xd1\xb5\xec\x31\x6f\xc2\x6e\x2d\x10\x66\x1d\x7e\x3d\x76\xe8\x98\xdc\xac\xd6\x7d\x8c\xca\x53\xdf\x49\x47\x2e\x3f\xe8\x04\x79\x82\x89\x16\xb5\xd3\xb9\x98\x4c\x08\xa1\x1c\x09\x7f\x6f\xea\x98\xe2\x70\x6a\x25\x76\x1b\x9d\xb5\x1b\x21\xf2\x00\x51\x9f\x8a\xd3\x52\xd1\x0b\xa8\xd6\x95\xbc\xff\xa4\xe1\xce\xb7\x1c\x01\x2e\xac\x8b\xb7\x9d\xe4\xa8\x28\xaa\x0c\xe8\x79\xa4\x0a\x3f\xe2\x17\x3a\x8a\x3d\x30\x85\x6b\xe4\xe5\x73\x3d\xaa\x65\x60\xc5\x8b\x9c\x22\x8a\x4f\x6b\x3c\x0b\x98\xdd\x9b\xfb\x4b\xf8\x8e\x34\xb1\x8e\xe3\x42\x4a\xdb\x42\x56\x94\xf6\xb2\x83\x02\x33\xb9\xc4\xbf\xd9\x6e\xe2\x4c\xd9\xe8\xb6\x96\xbb\x29\xbf\xc7\x3a\xc0\xe4\x93\xe1\x77\xe5\xf5\x9c\x84\x6a\x96\xc4\xab\xc0\xda\x4b\xc9\x17\xf3\xd8\x39\x90\xb6\xba\x8a\x75\xf3\x42\xd8\x53\x4f\x9d\x11\xeb\xac\xd9\x1e\x72\x32\x16\xb6\xa3\x90\xe1\xad\x8a\x3e\x3c\x60\x62\x05\x74\x72\xcd\xe9\xc9\x45\xc0\xb4\x6f\x81\x70\x14\xcf\x95\xf6\x21\xc0\xd1\x70\x14\xe9\xc3\x62\x30\x0e\xd7\xbb\x7c\xba\x55\x0b\x98\xd3\xa9\xc5\xf4\x4a\x94\x27\xbb\x02\x3f\x2d\xba\x26\x8e\x4e\x8c\xbb\x3d\x19\x90\x07\xa7\x2e\xa3\x2a\xa0\x31\xfa\xdb\x3e\x74\xe2\xba\x6b\x56\xfa\x56\x2e\x18\x5e\x10\xb8\xc4\xe2\x0d\x8e\xd6\x39\x4a\x9d\xb0\xd4\xd8\xc8\x11\xfe\xd1\xdf\x6f\x1f\xcf\xc5\x56\x02\xbe\x27\xcb\xb7\xf2\x95\x9c\x56\x1e\xdd\xe4\x76\xdd\xaa\xbc\xac\xf8\x79\x48\x20\xaf\x68\x17\xf3\x52\xca\x87\x61\x05\x97\x58\x06\xa7\xa4\xca\x82\x81\x28\x1d\xce\x5f\x90\x49\x4c\x7b\x91\xb5\x90\x65\xc5\x47\x28\x9b\x43\x91\x69\x33\x2f\x5a\xca\xe5\x05\x78\xc2\xdd\x68\xea\x28\xc1\x4f\x63\x09\xd9\xb6\xed\x23\x56\x45\xfc\x12\x94\xe0\xc0\xaa\x50\xa1\x71\xab\xb8\x6e\x1c\x29\x43\x32\xff\xcd\x45\x46\x01\x58\xf9\xad\x3f\xc4\x68\x31\x0b\x40\xa1\xfb\x05\x0f\x49\x55\x36\x6f\xf0\xb6\xae\x14\x2c\xb5\xc4\xce\x17\x8d\x22\x4b\x89\xaa\xde\x42\xef\xaf\x31\x82\x17\x19\x46\x7d\xd8\x87\xee\xcc\x92\x8a\xa2\xd8\x3d\x69\x1a\xb9\x22\x4e\x76\x4e\xf9\xc4\x34\xcb\xed\x41\x26\xae\x7d\x79\xa0\x76\x05\x4b\x64\xcf\xee\x93\x54\xa8\x5b\xa4\x97\x8d\x21\x92\x6b\x3c\x6f\x63\x24\xa6\xd6\x0f\x57\x3b\x96\x51\x67\x06\x02\xbe\xd3\x59\x10\x1c\x3a\x14\x39\xea\x69\x72\x70\xf3\xfd\xe5\x62\xdf\xce\x62\x36\xe6\x97\x3b\x85\x8b\x65\x40\xa2\xb5\x0a\x02\x61\x8d\xe4\x35\x54\xce\xe3\xe0\xe7\xe3\x41\x46\x07\x60\x0e\xbf\xb8\x64\xb7\x0f\xc6\x57\x46\x10\xd7\xe5\xe4\xee\x2a\x9d\xcc\xba\xfe\xa6\xd3\x2d\x29\x91\xe8\x37\x87\x0a\xd8\xa8\x2e\x42\x80\x56\x97\x6a\xfc\x6a\x51\xbc\x19\x06\x94\x49\xdd\x35\x6a\x33\x62\xc2\x07\x8e\x7d\x45\xbe\x3a\x2a\x57\xd6\x35\x05\x36\xcd\xd9\xef\x6f\xac\xc7\xb0\xf4\xf7\x17\x09\xe7\x7a\xf6\x41\x7c\x22\xf3\x63\x2f\xbf\xd0\x47\x09\xe7\xee\x05\x04\xc9\x3e\x7c\xee\xb1\x44\x04\xce\xd9\xaa\x6f\xd7\xaa\xd6\xe1\xf7\x2c\xaf\x7c\x48\x5b\x60\xb3\x79\x27\xf3\xc9\x5c\x02\x68\xe7\x61\x60\x73\x13\xe4\x9f\x78\x50\x32\x14\x6d\x72\x8a\x43\x31\x49\x51\x6b\xc8\x34\x66\x4b\x04\x01\x78\xa0\x03\x66\x03\xa7\x4c\x62\x4a\x0c\x64\x29\xab\xcf\x81\x1d\x18\xa2\x58\x43\x4e\x46\xd1\xa9\xfe\x9c\x12\xa2\xcd\x84\xe0\x70\xa1\x39\xa3\x01\xf8\xf4\x84\xe7\x95\x58\xea\x56\xdd\x10\x2f\x31\x47\xe7\x8c\xc8\x26\x38\xfc\xb1\x0d\x6c\xf5\x28\xde\x2f\x9f\x93\x8f\x46\xc9\x66\xc0\x73\x78\xb3\x05\x56\x5b\xfa\xf5\x2c\x55\x04\xa5\x62\xe0\xc6\x1c\xda\xac\x58\x1d\x39\x58\x84\xd6\x36\x2d\x99\x5a\xd4\xb2\xca\x49\xa1\xe0\x87\x78\xdf\x21\x93\x01\x1f\x56\x32\xe7\xaa\xf9\xd4\x16\x9b\x23\xeb\xc3\xc7\x27\x96\x84\x13\x02\x5f\x1f\x52\x98\xb2\x37\x82\xbd\x3f\x38\x59\xf2\x92\x2b\x5a\xb9\x6c\xc4\x29\x4e\xdb\x3b\x06\x9b\x53\x80\x13\x29\x87\xca\x22\x30\x09\xe3\x26\xd7\xf4\x48\x43\x0f\xe1\x76\xa6\xe1\x19\x38\x97\x50\x33\x33\x84\xeb\xff\x86\x9e\x09\x00\x2e\x7f\x6b\x74\x3f\x66\x6d\x5b\x28\x48\x4f\xe5\xde\x10\x11\xa8\xc5\xa2\x55\xd6\xea\x16\x57\xe7\x91\x58\xd6\x04\x49\x92\x2b\x94\x7e\xa6\x00\x6d\x42\x09\x6f\x59\x04\x31\x0e\x27\x2a\x32\x56\x0e\x7e\x7c\x8b\x49\x4c\xb6\xf3\xa8\xcf\x7c\x29\x7e\xc8\x64\xb0\xc2\xf8\x4a\x9b\xa4\x6d\x6d\x65\xfd\x9d\xd6\xac\xf2\xa7\xa8\x8b\x0c\x05\xa7\x51\xa1\x98\x86\xda\xba\xcd\x53\x7b\xd8\x70\xe7\x89\x82\xc2\x35\xf6\xdb\x13\x32\x0b\x57\x95\xb6\x73\x70\x4e\x81\xfc\x51\x5e\x9e\x63\x28\xfa\x3a\xfd\x8b\x80\x7a\xf6\x27\xae\x94\x9f\x43\x1f\xfa\x4f\x5f\x7c\x5a\x4f\x52\xcd\x3f\x70\xe3\x15\xac\x82\x6f\x51\x59\x30\xaa\x8f\x8a\x2f\xb6\xa0\xcf\x7a\x6c\x71\x23\x96\x05\x97\x20\x62\xe0\x9e\xfa\x16\x02\x9c\x2a\x22\xc5\x40\xc7\xf2\x7a\xcb\x87\x87\xdc\xa2\x56\xe1\x69\x48\x9b\xc6\x31\x10\x0a\xd7\xb0\x05\x00\x50\x59\xcc\x79\x9c\x5a\xf5\x24\x0f\x49\x2c\x3f\x20\x03\xf3\x48\x4a\xd6\x41\x99\x7c\x4c\xea\x07\xa9\x52\xa7\x73\x11\xaf\x75\x94\x63\x21\xaa\x64\x93\x55\x79\xf8\xbf\x2c\xfd\x27\x78\xcc\xf2\x81\x68\x34\x58\x06\x3d\xed\x0b\x4e\x4e\xfd\xdf\x98\xa9\xce\x51\xaa\x0a\x3e\x9f\xd6\x9a\x3b\x45\x46\x21\x72\xfc\xbb\xf9\x4c\x6b\x5c\x64\xe5\x46\xb3\x26\xfe\xf3\xda\xc1\x30\x0a\xae\x4a\xf9\x21\xe9\x5e\x2c\x5d\xfb\x83\xee\xd2\xb0\x19\xf5\xc2\xbe\x9a\x39\xfb\x7a\x02\x6c\xbf\x11\xb7\xbf\xbc\x00\x50\xd0\xbe\x60\xaa\x0a\xdc\xe4\x85\x4a\x01\x84\xde\x4c\x88\x40\x7f\xe6\x67\x28\x77\x2b\x61\x8d\xda\x74\x36\xb7\x2c\x60\x78\x0e\x3d\xac\x0a\x4a\xa3\x4b\x75\xb6\x6e\x32\xaf\x34\x7a\x93\x4a\x91\xad\xf2\xa5\x88\x75\x34\x03\x9a\xde\x69\x64\x27\xdd\x2f\x9a\xac\x35\xf0\xd8\x5c\x63\xcd\x07\x51\xd8\x20\x98\x07\xab\x04\xf4\x3e\x43\x7a\x40\x23\xfa\xe2\x31\x96\x36\x3f\xa0\xa0\xea\x66\xf1\x4a\x8e\xe0\x5c\x1b\x41\x0a\xf9\xe1\x72\x9f\x78\xf5\x31\xc8\x58\xc3\x6a\x1c\x01\xc8\x55\xad\xde\x79\x25\x57\x79\x76\xe5\x8e\xac\xb2\x1c\x48\x8f\x5f\xa3\x03\xfa\x20\x7b\xc9\xc1\xca\xdb\x59\x48\xe0\xb0\xa0\x09\x14\x62\x2a\xed\xa4\xd6\x3e\xa9\x8b\xd7\x70\x02\x9a\x6e\x78\x38\xae\xb3\xd7\xaa\x43\x8c\x6f\x67\x83\x1e\xe0\x33\x69\x61\xd4\xd5\xac\x95\x22\x8f\xb6\xb6\x3e\xe2\x3e\x2d\x92\xc2\x5a\x49\x30\x25\x3e\x1a\x24\xa8\xf4\x8f\x35\xae\x18\xbc\x59\xfa\xa9\xca\x30\x80\x5a\x3d\xca\x5b\xbc\xfc\xb3\x44\x1b\x22\x62\x5b\x5b\x4f\x74\xa1\xcc\x3e\xae\xc6\xec\xa6\x9c\x3d\xa8\xbb\x97\x8f\xb7\x8a\x68\x59\x00\xf1\x82\x92\x81\x39\x1b\x45\xa3\x27\xd4\x64\x51\x5c\x97\x0b\x4c\xba\x8b\xe6\xcb\x0f\x83\x0b\xa0\x45\x2a\xfe\xb6\x78\x6b\x86\x55\x34\x57\x9f\x98\xa4\x24\x37\xea\x87\x84\xf7\x0c\x94\x21\x42\x5a\x44\x29\x1c\x2b\xee\x80\xd8\xca\x3c\xe2\x73\x72\xc4\x25\xb6\x77\x7a\xa3\x0f\x4c\x99\xc2\x97\x62\x3e\xfd\x99\xc2\xf6\x2a\xa6\xb4\xae\xe9\x80\x73\xb8\xef\x82\x89\x6a\xda\xe2\x44\xf2\x7a\x55\xe3\x03\x71\x13\xc4\xcc\x97\xa4\xbb\x85\xa1\xcd\x0d\xc0\xe8\x27\x1c\xc9\x73\x27\xe5\x77\xfa\x1e\x18\x07\x04\x0f\x2f\x01\x8d\xf7\xfd\xed\xfe\x00\x72\x4d\x09\x6a\x6d\xa6\x40\x39\x7b\x5b\xab\xc2\x38\xd4\x4d\x1b\x62\x77\x9d\x3a\x8f\x3a\x4c\x70\x88\x7b\xfb\x78\x0c\x56\x5b\xb4\x99\x51\xff\x90\xb3\x58\x1b\x67\xf4\x54\xe5\x5d\x42\x91\x3a\x91\x9b\x59\x29\xb6\x70\x25\x8f\xd3\x5c\xc7\xee\xe0\x54\x6c\xe5\xcb\xfa\xc4\x38\x05\x57\x3b\x80\x9c\xc5\xc0\x17\x1d\xbb\x80\x14\xb1\x42\xf5\xf9\x29\x79\x1f\xd4\x86\x9e\x98\x7c\x6c\x83\xb8\x9c\x1f\xc5\x4c\x64\x72\x04\xcb\x00\x61\x9d\xfd\x62\x1b\x60\x1a\xb8\x3e\x0e\x0f\xc9\x99\xb5\xdb\x56\x98\x35\x30\x75\xc4\x9a\x41\x89\xc5\x28\x77\xd9\x73\xbc\x3f\x93\xe5\x73\x14\xb3\xd3\x21\x41\x5d\x49\x18\xd1\x44\x22\xa0\xaf\x17\x0c\x10\xd5\x63\x77\x29\xee\x3c\x86\x47\xa0\x61\x56\xb7\xa4\x3b\x3b\x5f\x45\x83\x5c\x7d\xd9\x27\x94\xc6\x1f\x94\xdf\x39\xe7\xc5\x57\x3f\xe2\xd0\xd8\xf8\x46\x72\xce\x5e\x25\xad\x28\x39\x96\xf7\xe4\xfb\xdd\x8a\xc4\x47\x68\x8f\x67\xa7\x68\x2d\xdb\x82\x33\x25\x77\x26\x50\xe4\x01\x9a\xf6\x64\x97\x9f\x3e\x65\x04\x1d\xce\x18\x1c\xe5\xcd\x5e\xaa\xfc\xb7\x20\xd9\x5a\x86\xea\x82\xb5\x16\x2b\xe7\xac\x43\x89\xd1\x89\x32\xcf\x78\x32\xc7\x43\x20\xb8\x18\x79\x01\x12\x99\x63\xec\xdb\xec\x43\xaa\x59\x8d\x9a\xc3\x2f\xa9\x76\x4a\x2f\x3d\x31\x84\x79\x72\x39\x12\x39\x28\x2e\xd4\x34\xa1\x57\x9c\x97\x8c\x94\x83\x3b\x9c\xcd\xbd\xa5\x09\x70\x1d\x18\x3b\xc8\x5c\xa1\x5a\x1b\x8b\xbe\xab\x98\xf0\x93\x62\x9c\xb3\x4e\x34\xb5\x17\xee\x83\xcd\x7f\x47\x1b\x1f\xf2\x30\xb4\x82\x3a\x1f\xde\xeb\x7c\x70\x3c\x84\x1c\x05\x6b\xe9\x47\x48\x8f\x06\x25\x94\xde\x94\xa8\xfe\x00\xce\x08\x2e\xed\x3d\xda\x11\x5c\x0c\x6e\x95\xc0\xc3\xab\xb7\xae\x17\xe1\x52\xd4\x24\x33\x2d\xb1\xfd\x98\xae\x0d\x91\x01\x90\x0c\x4d\x06\x15\xd5\xe6\x34\xe0\x5f\xb7\x5d\x93\x0b\x1b\x5a\x75\x3c\x43\x57\xec\x8f\xca\x1b\x7a\xa2\xf5\x94\x94\xc6\x21\x84\xd6\xd6\x5b\x99\x76\xdb\x4e\x5c\x60\x95\xa3\x02\xcd\x15\x51\x5e\x30\xa8\x94\x3a\x52\xcc\x9c\x98\x92\x82\x20\xd3\x9f\xc1\xe2\xf6\xe6\x2f\x14\x3b\xe2\x50\xb0\x51\x85\x21\x32\x39\x2a\x1b\x6b\x34\xf0\x78\x80\xea\x64\xa5\x37\xbd\x47\xe6\x07\xe5\x8a\x36\x56\xbf\xc5\x12\x21\x73\x37\x4d\x6e\xfa\xc1\x8e\x99\x68\xb7\x62\x3e\x0f\xeb\x99\x2e\x9c\xa6\xa4\x2b\xec\x99\xa6\x93\x3a\x1a\x4b\x64\x72\xa0\xd9\x58\xd9\xd2\x7a\xb0\x75\x40\xab\x4e\x76\xef\x17\x17\x6e\x8c\x72\xa4\x41\x28\xa7\xae\x4c\xe6\x64\x02\x54\x45\x72\xd8\xc8\x00\x58\xbd\x3a\xf9\xe3\xac\x7c\x65\x1d\x3d\x90\xf7\x24\x1f\xbd\xf5\x1c\x5a\x3f\xde\xb8\xb1\x99\x58\xb1\x43\x5e\x12\x48\xb3\xfc\xc9\x0a\x43\x5c\x0e\x12\xe4\x97\xe0\x73\xd5\xe7\xaf\x8e\xbc\x36\xe3\x0c\x31\xe5\x8b\xad\x83\x43\xfe\x78\xc2\x9c\x93\xb7\x43\xb1\xaa\xf2\x6f\x86\x0f\xf8\x16\x66\x41\x7e\xd5\x38\x39\x6a\xbc\x95\x4c\x1d\x95\x5a\xe2\xd4\x39\x48\xfe\xed\x2c\x4d\x34\x1a\xde\xb0\xc4\x57\xa0\x56\xf6\xca\x01\x8c\x88\xa6\x72\xdf\x59\xf1\x19\x3a\xe5\x3f\x62\xa8\x92\x83\xb6\x04\xd1\x55\x5d\x81\x8f\xba\x48\xe2\x00\x7f\x3c\xbb\xc2\xff\xcc\x2c\x77\x0e\x57\xbf\x01\x7b\xc5\xf7\x57\x09\x22\x2e\xae\x04\x96\x91\x82\x5a\x40\xfb\x66\x59\x43\x92\xf8\x93\x1a\xa9\xc1\x1c\xac\x22\x60\x20\x80\x52\xe3\x05\x50\xdd\x95\x2c\xb0\xbe\xc2\xf7\x54\xef\x43\xac\x35\x4a\xbe\x42\x3c\x61\x0c\x1b\x46\x5b\x9f\x97\x91\x50\x26\xc9\x54\x2a\xcf\xe1\xe5\xc5\xf9\xbd\x86\x08\xf7\xb7\x33\xe9\xdf\x13\x3b\x7e\xb6\x82\x63\x21\xf1\xf0\x1f\x3e\xd0\x40\x0c\x4d\x32\x39\x71\x58\x64\x98\x1c\x98\x30\x45\x1d\xd6\xca\x03\x0b\xda\xcf\xe0\x7d\x4b\x2a\x22\xd3\x60\x1f\x82\x55\x56\xaa\xa7\x11\x06\xd7\x2e\x92\xe1\xea\x22\x28\x1a\xd3\x88\x17\x6a\xe3\x2a\x3d\xe2\x5b\xac\x91\xe9\xc8\xeb\x3a\x69\x85\x86\xf7\xc9\xbe\x71\x47\x9c\xba\x7b\x94\x63\x9a\xac\xe1\x48\x54\x13\x10\x1b\x89\xd3\x39\x87\x8e\x54\x6b\x24\x05\x3a\x83\x02\x02\xfb\xf9\x09\xe8\xc9\xb9\xa2\x87\x85\xa0\x18\xa9\xc8\xc6\x0b\x50\x0a\xed\x72\xbd\x90\x7e\x6e\xe1\x97\x0d\x1a\xf9\xe2\xab\x13\x47\x7e\x62\xd8\xbc\xca\xd4\xe1\xbf\x19\x47\x56\x92\x0b\x40\x9c\x9c\x9f\x81\x80\x1f\xe3\x7c\x27\x09\x62\x3a\x63\x7e\x03\xca\x82\xb6\x95\x60\xde\x43\xf0\xf1\xc8\xaf\x70\x2a\x9e\xfb\x00\x1d\x35\x8c\x40\x6c\x60\x21\x9c\xc0\xdf\xd8\xed\x0e\xa1\xab\x87\xc1\x04\x07\xd1\x53\x0a\x73\x9e\x81\x0d\x31\xc7\xbc\x17\x72\x26\x51\xdf\xd8\x1d\xd8\xd8\x8a\xac\xc2\x9e\xc8\x85\x68\x1c\xda\xef\xfa\x7a\x2b\x07\x0b\x4a\x92\xce\xe9\x14\xd1\xe7\xf8\x1a\x17\x9e\x36\x20\x90\x21\xab\x56\x7d\x05\xee\x69\xfd\x0f\x56\xa7\x99\x81\x16\x7c\xd8\x07\xa1\x27\x60\x54\x88\xbd\x03\x3c\xfc\x1d\x37\x66\x9d\x8c\x05\xdb\x3b\xba\x13\x0c\x7f\xa3\xb5\xc4\x68\x4c\x76\x03\xea\x90\x1f\xc8\xed\xd6\x72\x81\xc3\xa7\xfd\x54\xf6\xfa\xd1\xeb\xf4\x18\x33\x89\x6a\x66\x47\x51\x46\xef\xac\x0e\xfe\xb3\xd5\xe8\x07\x55\x82\xbc\x68\x8d\xba\xf0\xe9\x55\x8f\xdd\xe7\x06\xec\x71\x38\x90\x93\xec\x9c\x6d\x4c\x13\x05\x72\x8b\x12\x5e\x3e\xd8\xe0\xa7\xf7\xca\xac\x88\x7c\x95\x26\x7a\x18\x3b\x31\x6c\xd8\xd4\x88\x82\x65\x54\x57\x0e\x9e\x8a\x4f\x1b\x0f\x1f\xb6\xf9\x05\x42\x93\xc6\x05\x45\xe7\x8a\x77\x36\x6b\x8f\x0a\xc8\x5c\x31\x21\x49\x6b\xbf\xfa\x4f\xb8\xb6\x88\x3e\x3a\x4b\x62\x6b\x79\x8d\x29\xee\xef\xe0\x1d\x5b\x3e\x64\x3d\xd5\x9b\xf8\x2c\xe7\x47\x89\x35\x9d\x19\x68\x88\x51\xfa\xd3\x37\x89\xd2\x8f\xac\x33\xa8\xf6\xbb\x26\x4b\x98\x53\xb5\x67\xa0\x6f\x1a\x04\xb5\x42\x66\x01\x46\x24\xac\xea\x8e\xed\x9d\xe3\xc8\x5d\x3e\xbb\xde\x61\x3b\x59\x2e\xd9\xbc\xc4\xd9\x05\x14\x16\x9f\x2e\xb7\x00\x22\xd3\x45\x1a\xe2\xa3\x86\xf5\xb2\xc4\x5c\x86\xae\xf6\x06\xa6\xd8\x8c\x3e\x40\x33\xc9\x13\x48\x63\x07\xb3\xac\x4f\xf0\x29\x86\x9c\xe6\xf0\x1e\xd3\x27\x22\xdb\x28\x5e\xd6\xb6\x7e\x81\x0d\xad\x2b\x88\xe6\x67\xad\xc1\x90\x0c\x55\x15\xe6\xb4\x2f\xe2\x31\x5c\xc2\xf5\x44\x97\xf7\x15\x3d\x97\x47\xeb\x0c\x86\x64\xd6\x00\xed\x5a\xc8\x2f\x07\xad\xf5\x5c\x38\x74\xa8\x06\xcb\x3f\x38\x52\xa9\x32\xe3\x75\x54\xa1\xc8\x64\xd9\x86\xe9\x5a\x6c\x3c\xd9\x01\xbb\xb3\x71\xc2\x80\x6a\x3e\xbb\xaf\x13\x47\x05\xea\x4c\xf9\x0a\x21\x83\xe0\x3a\x79\x87\x82\x17\x83\x95\x57\x04\xdb\x84\xd2\x41\x22\x2e\x46\x1a\xa8\x42\x7c\x9b\x33\x68\x0d\x12\xec\xd3\x30\xbd\xef\xd3\x2f\x29\x69\x11\xa9\x3a\xe5\x3c\x0f\x5a\x6f\x8a\xf0\x51\x15\x12\x90\xf6\x15\x97\xf9\xfa\x8c\xce\x0e\x98\x29\x05\x65\x69\x0d\x74\x8d\xe2\x6d\x52\x2b\x76\x14\xb4\xa8\x87\x96\x84\x85\xfa\xd7\x1c\x4e\xb2\xf9\xbc\xcd\x8d\x48\x9a\xfc\xf2\xc4\x10\xf7\x3b\xb0\x7a\x0b\x9f\xd1\x02\x78\x24\x3a\x7f\xb2\x2b\x2a\xb9\x70\x98\x21\xab\x8b\x4a\xe5\xa7\x79\x34\xed\xc8\x7a\x3f\x8c\xf9\xb2\x91\x12\x36\x6f\x1b\xf2\xe6\x09\x72\x3b\xde\x63\x43\x56\x5d\x18\x3a\xa1\x81\xfa\xb2\x4a\xf3\xf9\x32\x63\x2e\x8c\x7a\x79\x69\xc7\x1e\x04\xeb\xb4\x55\x9f\x82\x80\xf7\x2f\x6d\xde\x56\x89\x8a\xd7\x0f\x28\x5a\x97\x5a\x7b\xbb\xa9\xaa\xb4\xb1\x7a\x66\x40\x94\x5f\x73\x00\xfc\xf7\x5c\x31\x73\x43\x12\xa2\xc5\xfe\xba\x1e\x21\x92\x61\x02\xa3\x81\xbe\x81\xee\x5d\xbd\x0d\xfb\x38\xfc\x9c\x1d\xcc\xbb\x9f\x5e\x7a\x5e\x0a\x78\x8e\x4b\x1c\x23\x5d\x30\x7a\xca\xa0\x69\x06\xc6\x83\x86\x3e\x51\x68\x6f\x4a\xa6\x15\x6c\xc2\xd1\xca\x2b\xb2\x0b\xa9\xd2\x3d\x00\x4d\xdf\x1f\xf1\x4a\x9c\x5c\x53\x8d\x2e\xe1\xa4\xbe\xa6\x61\x33\xb8\x21\x62\x32\x01\xb5\x49\xa4\x32\x7a\x16\xac\x91\x89\xd4\x2f\x09\x66\x0e\xb0\x2a\x74\x78\x74\x42\x26\x55\xbd\x8d\xac\x86\x99\x3a\x2b\x72\x4c\x2e\x8c\x50\x0c\x2a\xe7\x0e\x84\x3a\xe6\x2d\x9c\xc3\xaa\x79\x63\x7a\x5c\x59\xd9\xcd\x61\x88\x18\xec\x18\xd1\xb5\x57\x06\x55\x3f\xd4\xd7\xdd\xd2\xf0\x95\x1c\x9a\x63\x93\x46\x32\x58\x2e\x36\x2f\xcd\x8e\xd6\x3a\xd4\x73\x5b\xb5\x3e\x12\x44\xd4\xb9\x7e\x38\x36\x66\xf6\xea\xfe\x1c\x06\xc9\x47\x87\x31\x01\x78\x92\x34\x94\x25\xbe\x32\xc4\x1b\x95\x06\x0b\x9b\x02\x1d\xe8\xb7\x8f\x7e\xbc\xad\xb8\x41\x3a\x87\x16\xf3\x9b\xe3\x3a\x96\x8f\xe0\xea\x89\x47\x80\x54\xc5\xa5\x85\x01\xa4\xdf\xdf\xe6\x7c\xad\xd0\x41\xd7\x42\x63\x23\x0a\x48\xc6\x17\xe9\xdb\xa7\xf7\x18\xca\x21\x02\x8f\xa9\xd0\x03\xb2\xed\x62\xd5\x4b\x6a\xff\xa2\xcb\xe5\xfa\x0e\xc8\x5f\xc4\x94\x6b\x6c\xc0\xc9\x6d\xed\x00\xa4\x60\xa0\x0d\x88\x38\x55\xfd\x29\xca\x99\x6e\xd5\x23\x06\xbd\x29\x79\xd5\x9a\xc3\x94\xb7\x42\xc1\x2e\xb9\x66\x54\xeb\xbd\x5b\x81\xc4\x93\xce\x0b\x32\x52\x8f\x1c\x0e\xd4\x52\x34\xd2\xc0\x77\x34\x15\x4d\xa8\x9b\x56\xd8\x83\x5a\x0c\xe5\xab\xdb\x57\xcc\x5d\xdc\x9a\x51\x87\xd5\x74\x72\xa4\xe8\xc1\x89\x48\xdd\x3e\xd9\x6e\x5d\x1d\xe1\xeb\x31\x5b\x1f\x07\x20\x08\xc7\xe0\x72\xa1\x74\xbf\x6a\x2a\xe1\x10\xee\xdd\x4d\xbd\xff\xd0\x8a\x92\xd1\xfa\x2d\xb6\x3a\x59\x70\xf5\x2c\xce\x44\x3f\xa9\x31\x1e\x9d\x4b\xa6\xcd\x89\x38\x41\xa4\xa6\x29\xd3\x18\x23\x62\xd8\xcc\x68\x49\x98\x93\x42\x25\x8a\xf1\x01\x6b\x3a\x36\x8d\x3e\xf3\x43\xb0\x30\xfd\xe3\xd0\x8d\x91\xbb\xc7\xd1\xd0\xa1\xb7\x9c\x3e\x56\x2c\x85\x19\x95\x5f\x7a\x00\xb9\xbf\x5b\xa4\x3d\x23\x00\xfa\x4a\xcc\xaa\xb5\x1f\xf3\xfe\x7d\x5a\xb0\x6b\xec\x88\x05\xfb\xd1\x51\x82\xa5\x70\x56\xed\x93\x77\x01\xc9\xd9\xf7\xd5\x54\xb8\xfd\x2b\x4e\x8f\xa4\x40\x02\x38\x4d\x63\x39\x9c\x75\x00\x1c\xe5\x90\x83\xf4\x30\xe5\x22\xc3\x38\xf4\x9c\x90\x4e\x97\x5d\x72\xd4\xcb\xc8\x7f\x86\xa4\xca\x6a\xc2\xbb\x99\xcf\x25\x6c\x6f\x35\x2c\x56\xdb\xc9\x18\x28\xb8\x17\x16\x56\xb1\x0e\xb3\xa4\xa1\xa7\xa5\x3e\xb8\x7a\xea\x3b\xe8\x63\x12\x9e\x03\xa2\xd4\x56\x51\x28\x10\x2a\xeb\xd5\x87\x12\xce\xd8\x83\x3e\xc8\x94\xa4\xae\x8b\x2b\x42\xab\xda\x87\x90\x1d\x35\x38\x48\xe8\x0b\xd5\xa7\xa1\x18\x4a\xf9\xeb\x58\xe1\xdf\xf0\xd9\xce\xec\x0b\xb0\xa3\x6b\xca\x59\x4c\xa8\xff\xd5\x4e\x46\xb0\x2d\x4d\xea\xe7\x41\xb0\x81\x23\x40\x15\x89\xf2\xc4\xb5\x76\x0e\x4f\x91\x8f\x64\xcd\xcb\xa4\x13\x16\x48\x9d\xe8\xe4\x2a\x1e\x7f\x30\x4d\x4e\x9d\x28\x8a\x73\xfe\xd2\x1a\x9d\x5d\xd0\xdd\x8f\xb1\xce\x75\xf2\xcc\xce\x74\xe0\xb8\x27\x18\x79\xeb\xf0\xe9\xf6\x0d\xe5\x4c\x92\xd6\xfb\x52\x70\xe9\x56\xd4\xe0\x56\x76\xcc\xac\xda\x54\x6b\xd1\xf8\x1a\x07\x51\x53\xb3\x12\x5c\x8c\x4c\x55\xa7\xe8\x6d\x15\xa8\x63\x3c\x20\x28\x12\x79\x69\xec\xa6\xd4\x21\x31\xe7\xba\x65\xbc\x08\x7d\xd4\x1a\x21\x00\x87\xbd\x63\x7d\x7d\x02\x14\x31\xc5\xbf\x78\xba\x09\xb3\xf1\x96\xc0\xdf\x6b\x96\x83\x86\xe5\xe4\x16\x4a\x71\x10\xfb\xcf\xea\xdc\x4c\x38\x91\x5b\x89\xdc\x0f\x4b\x72\xbc\x4b\xf9\x18\xa2\xb2\xea\x43\x01\x5f\xcb\xd3\xb3\xbf\xde\xc6\xe4\xe9\xc1\x2f\x63\xa2\x45\x99\x2a\x9e\xe0\x00\xe6\x72\x30\xe1\xd3\x7e\x31\xe0\xa4\xe2\x1d\x21\x4b\x75\x2e\xce\xf5\xc8\x3a\x0f\xca\xbe\xb2\xf2\xea\x03\xc5\x08\x0b\xe3\x87\x3f\xde\x21\x87\xfa\x13\xd9\x2a\xa6\xa3\xca\xfc\x1e\x95\x0e\x00\xd1\x67\x5e\xaf\xbd\xdd\x54\xaa\xf6\x06\x37\x4a\x53\x89\x37\x39\xc9\x26\x22\xd1\xbb\x9f\x0b\x8a\xc6\xb2\x5f\x99\x3d\x85\xaa\xd7\x06\x8e\xbb\xcf\xd9\x56\x6e\x10\x81\xd7\x8b\xd1\x45\xf7\x32\xb0\xab\x89\x82\xbb\x39\x06\x8f\xa7\x7a\x7c\x49\xa8\xec\xc9\x9b\x02\x88\x45\xbf\xe1\x63\x4f\x21\xd7\xc4\x2c\xd1\xed\xb9\xcf\xed\x0d\xd3\xda\x48\xf0\x00\x0f\x21\xfc\xb2\x2f\xcb\x87\x66\x2a\x8f\x1c\xa5\x37\xa5\x47\x82\xbb\xd0\x06\xc1\x2e\x9e\x88\x38\x0e\xe4\xec\xa7\x57\x64\x21\x43\xe5\x4f\xb4\x33\xe6\xdd\x06\x70\xa6\x58\xb5\xeb\xb9\x47\x62\xd4\x3c\xd7\xe2\x44\xff\x0e\x65\x60\x55\xb1\xbb\xe8\xcf\x64\x58\x91\x1e\x36\x85\xed\x2c\x12\x90\x55\x57\xc1\x9c\x29\x39\xaf\x09\xb3\x2a\x63\x5a\xfc\xc8\x91\x27\xa9\x7c\xec\xfe\x6b\x26\x41\xd5\x8d\xd9\x76\xa8\xef\xba\xb8\x79\xa8\xc5\x27\x04\x87\x09\xfd\x29\xa0\x65\x3b\x47\xfc\x52\x22\x31\x08\x51\x72\x6a\xd0\x48\x3c\xae\xc4\xa9\x90\x79\x72\x8a\xc2\x20\x09\x1e\xb3\x69\x3b\xdb\x57\x4c\x1e\x25\x23\x32\x9b\x61\x89\x65\x25\x0b\xef\xa2\x02\xa6\x3c\x26\xee\xdf\xce\xd1\x23\x03\xb6\x1c\x57\x5e\x07\xb2\x62\x50\x48\x69\x2e\x74\xac\xb6\x2b\x7e\xbf\x7a\x50\xd2\x07\x09\xe0\x13\x3b\x15\xb7\x9a\x51\xd9\x45\x5f\x7f\x41\x0d\x05\x06\x01\xb7\x01\x5a\xbc\x19\xa6\x6c\x0e\xde\x64\xd1\x4f\x12\x64\x26\x4b\xbc\x27\x9d\x44\x3b\x84\x4b\x83\x73\xe1\xc5\xb7\xbc\x50\x6e\xd2\xb9\x31\x9c\x4d\x15\xa8\x20\x26\xef\xfe\xb9\x31\xbd\x53\x1b\x8d\x91\x71\xfd\x9e\x29\x00\x31\x94\xec\xdc\x89\x01\x86\x85\xa3\x98\x0a\xa3\xe0\x13\x6c\x8e\xee\x38\x61\xed\x28\xbd\x68\x08\xee\x33\x84\x64\xa3\x9e\x5f\x7d\x5b\xe3\x6b\xbc\xa9\xf4\x55\x24\x15\xb6\x3c\xa1\x9f\xa8\x26\x14\x9f\x9c\x4c\xb8\x94\x1e\x31\x8f\x59\x09\xbb\x6b\x68\x5b\x0b\x81\x7d\x27\xfd\x92\x1f\xa1\xc1\xa0\x35\x88\xfb\x0c\xbd\x1f\xdd\x6d\xdd\xa1\x3e\x8d\x91\x1a\x6e\xe6\x3b\x55\x8f\x0a\xb1\xd3\xe8\xc1\xec\x22\x09\x6f\xc0\x80\x39\x24\xa2\x73\xaf\xd1\x5b\x8d\x9f\xb4\xca\x63\xfc\x70\xf2\x55\xd0\xaa\x3a\x4b\xea\xa0\x84\x86\x69\xe9\x1a\x2f\xd9\x2a\x56\x56\x7a\x34\x89\xb5\x12\x5b\x1f\x1d\x1f\xd6\x85\x85\xa0\x18\x10\x4f\x63\x67\x4e\x0b\xa0\x09\x48\xde\xd8\xd8\xfd\xe2\xe2\xb1\x98\xea\x02\x87\xd8\xe6\x1e\xf2\x63\x64\x13\xf8\xb2\xee\xae\xc4\x57\x7e\x21\x96\x57\x9a\x0f\xe2\x32\xfa\xad\x9d\xe9\x4d\x5c\x24\x72\x3e\xc2\xb5\xb0\xb7\x24\xa9\xfc\xc8\x09\x29\xc4\x6e\x64\xbd\x80\xbe\xb9\x58\x8d\x0d\xd1\x71\x6d\x7d\xce\x54\x01\x4f\x52\xdf\x8b\x79\x18\x85\x16\xc4\x4c\x8c\x86\x0d\x2f\x71\x28\x98\xee\x24\xf0\x02\x6f\xa6\x8a\xe3\x08\xa4\x2b\xae\x05\x86\xe4\x93\x73\xd9\xa9\x68\xd0\x7e\xc1\x20\x6b\x61\xb4\x47\x9a\xbd\xa9\xfd\xa6\xe9\xaa\x28\x91\x5e\xe4\x8a\x5d\x91\xdc\xc2\x22\xae\xc0\x4c\x83\x4d\xa9\x27\xef\xb0\x71\x02\x14\x67\xc2\x1e\x9e\xf1\xab\x4a\x2b\x75\x07\xda\xe8\x63\x4d\x3e\x7a\x6b\x8f\x23\x6e\x30\x99\xce\xcd\xf2\xb9\x15\xa1\xe7\x5a\x96\x02\x98\xcd\xa7\x50\x8f\x61\x3d\x72\x35\x59\x4d\x91\x5f\xda\x7d\x54\x96\x13\x10\x16\xd2\xd7\x97\x31\x35\xd4\x9a\x8c\x33\xc7\x75\x54\x5c\x1e\x03\xf9\x75\x33\xed\xe6\x7c\x5d\xa0\xde\x29\x12\xe8\x17\xa2\x97\xe4\x02\x24\xe2\x65\x6d\xf3\x5a\x96\xc2\x22\x11\x62\xa1\x95\x64\x0d\x14\x9f\xa3\xb7\x7b\x66\x17\xd7\xa9\x63\xf0\xa0\x4a\x31\xe0\x92\x7e\xd5\x7c\x0e\x3d\x72\xe6\xad\x69\x1b\x0b\xdf\x65\x1f\xca\x73\xaa\xcd\xd8\xb0\x77\x5b\x27\xce\xb5\x75\xcf\x55\x37\x39\x07\x81\x1a\x65\xff\xec\xa0\xbd\x5c\x5c\xf4\xa6\x6f\xb1\x81\x40\xcc\x40\x5c\xb2\x42\x47\x62\x51\xcd\x10\xc5\xc4\xb5\xd0\xa4\x3c\x95\x9f\x82\x23\xf3\xfc\x2a\x5c\x5d\x11\xa9\x89\x9a\x08\xc3\xf8\x20\x62\xa9\x9c\x2e\x5c\x6c\x6d\x66\xea\x0e\x49\xf5\x8a\xee\x6d\x8d\x92\x0d\xb1\xab\x14\xf3\x52\x97\x3c\x06\x4c\xdd\x43\xbe\x52\xce\x95\xcd\x1c\xb2\xd4\x15\x7d\x86\x7a\x3d\x43\xa7\xda\x97\xf6\x05\x1b\x74\x74\x29\xc1\xe2\xc1\x01\x57\xfc\xc2\xbd\xf6\x19\x94\x14\x79\xb3\x78\xd4\x25\xa5\xde\x00\x07\x64\x30\x7d\x76\x88\xc1\x6c\x85\x74\x80\xed\xcf\x84\x87\xcd\x0e\xe6\x49\x9e\x50\x80\xeb\xb2\xc1\x06\x62\x47\x35\xb2\x59\x59\x43\x7b\xf6\x8d\xf6\xea\xe9\x7a\x52\xa6\x2e\xa3\x4b\x32\xc4\x3a\x16\x50\xd2\xd8\xf2\x9c\x6e\x8a\xdf\x01\x9a\x37\xd1\x20\x06\xab\x63\x34\x87\x36\xff\xd0\x33\x35\xd4\xa7\xfa\x0a\x8c\x80\x73\xe0\x19\xb6\x20\xb3\x34\x48\xd3\xc7\xf8\x66\x82\x61\x26\x87\xc1\x93\x2c\xdf\x61\xb7\x4b\x70\x4d\x46\x8d\x8a\xc0\xe8\x71\x16\xed\x6d\xc3\xa1\x40\x76\x39\xfe\x50\x7a\xe5\x6a\xf8\xcc\xf3\x56\x76\xe0\xa6\xd1\x07\xf2\x69\x17\xcf\x98\x69\xc1\xac\x45\xd3\x0f\xf2\x61\x8e\x91\xfd\xd6\x70\x79\x64\xd1\xf3\x3f\x9c\x7f\x67\x7f\xfb\x14\x5d\x53\x4d\x87\xb5\x80\xc2\x92\x49\x6d\x0d\x95\xe7\xcd\xa5\x17\x55\x6f\xc5\x76\x35\x77\xff\x85\x9f\x88\x9a\xed\x26\x0e\xfc\xc3\xc4\xde\x5a\x38\x12\x4e\x75\x3a\x78\xed\x9e\x20\x1f\x98\x4f\xf7\xde\x1a\x37\x21\xe7\x68\x9c\x8c\x99\xae\x6f\x51\xef\xe8\x43\x7f\xad\x26\x07\xc6\xa2\x67\x6f\xb5\x3b\x1b\xc7\x7d\x9a\x95\xc7\xf0\x5f\x07\xdb\x24\xee\x76\x52\x66\xe2\x6c\x12\x71\x6a\x3e\xcb\x57\x05\x64\x08\xf6\x64\xad\xb7\x60\xee\x9b\xea\x54\x44\xff\x8a\x22\xe1\x6f\x47\x91\x55\x71\xee\xe3\xeb\xba\x01\xd5\x71\x85\xdc\xc4\x02\x28\xc7\x26\xa3\xf8\xb5\x47\x97\xd2\x6d\x63\x36\x2c\x6a\x59\x4a\xb3\xf2\x01\x14\x79\xc8\xf9\xe7\xe0\x83\x69\x76\xea\x26\xee\x85\x92\xcd\xc9\xe7\xb2\xfd\xa4\x83\xf4\xce\x4d\x19\x36\x6e\x5a\x2a\x53\xee\xf0\x4b\x18\x67\xb5\xf9\x1e\xc8\xe5\x4e\x56\x1f\xac\x76\x02\x0b\x2e\x36\x89\xf3\xd8\x95\x87\x00\x24\x4d\xa7\xed\xc3\x13\x1e\x18\xaf\xa9\x53\x92\x4e\xd4\xa7\x81\x55\x83\x9e\xc7\x1d\xa0\x56\x8d\x0e\xf3\x46\xfa\xa6\xad\x2c\x5e\x87\xb2\xb7\xb4\x3e\x85\x46\xd1\x77\xa5\xde\xb1\x13\x5b\x47\xb4\x3c\x1f\x44\xba\xc7\xc8\x17\x8c\xfb\x11\x23\x74\x03\x7d\x1c\x7c\xc5\xcb\x37\xe0\x4c\x72\xb4\x61\x6e\xe8\x24\x25\x6e\xa4\x74\x03\xe7\xfb\xb1\xfd\x54\xa2\x2f\xab\x4e\x80\xcc\x20\xcb\x3b\x06\x95\xe5\xfe\x95\x86\xf2\x99\xe3\xb9\xc7\x17\x8f\xb6\x4e\x59\xb4\xff\x26\xe4\x68\xcf\xa7\xce\x59\x7f\x68\xfd\xe5\xc9\x68\x77\x4b\xa7\x03\x49\x18\x43\x2f\x81\xc3\xc3\xe0\x38\x14\xf4\x9a\x1e\x2c\x0e\xeb\xf0\x02\xff\x12\xa8\x9c\x34\xa3\x56\xac\x53\xae\x77\x45\xd3\xc1\xe0\xd1\x5a\x02\x43\x2b\xd5\xa9\xf4\x23\xbb\xa5\xc7\x90\x76\x7e\xa0\x69\x2e\xa1\xba\xeb\x94\x0d\xb1\xf7\xe6\x2d\x6f\x56\x6d\x25\x33\xff\x7c\xcd\x82\x7c\x25\x56\xd9\x15\x7d\x0f\x3a\x22\x6a\xad\x25\xb5\x7f\xf6\xf6\x24\xdf\xaa\x81\xae\x2b\xc5\xed\xb3\x49\x79\x44\x1e\xbd\x46\xe5\x20\xb6\xca\x1b\x06\x01\x8e\x20\xc6\x0b\x79\x4e\x69\x53\x0e\x88\xc3\x89\xd5\xf6\x3e\xdf\xa0\xda\x61\x0f\x6a\x18\xf0\xd3\x74\xd0\x9f\x3d\xa1\xc2\x99\x5e\x93\x12\xa3\x6c\x57\x72\x66\x4a\xa3\x41\xd8\x48\x3d\xd5\x37\x21\xe6\x6a\x9b\xf3\x7d\xa1\x2c\x32\x79\x55\xcb\xc0\x3b\x18\xe2\xb7\xd7\xb7\x5e\xe2\xe7\xb7\x48\x59\xc7\x6e\xd4\xd9\xb6\x55\x50\x06\x6d\x54\xbb\x57\x58\x02\x2c\xaa\x52\xe7\xa9\x4f\x23\x9e\x94\x43\xe2\x7e\x13\x49\xa1\x6d\xd0\x74\xaf\xc4\x9e\x93\x8b\xf3\x5e\x4e\x2f\x65\x9e\xf0\x74\x12\x7f\x5e\x1b\x8f\x9a\x58\x04\x2f\xfb\x8b\x0d\xf8\x33\x43\xd9\xe4\x9b\x01\x65\xb2\x10\xa6\xeb\x4d\x72\x09\xf8\x05\x3a\xa2\xda\x9b\x57\x2c\xb8\x90\xb8\xfa\x85\x03\x26\x5f\x2d\x94\x21\xb0\x59\xfb\x76\xb3\xfb\x8d\x00\xe2\xfe\xf5\x82\xe4\x82\x54\x0f\xcb\xb8\xc4\xc3\xcb\x82\xd4\x92\x9f\xf5\x05\x38\xad\x80\x3a\x1f\x62\xf3\x87\x36\x3f\x27\x5c\xea\x30\xc7\x93\xe4\x5c\x5d\xe3\x2f\xd5\x20\x79\x88\xf3\x56\x48\xcc\xb6\x5f\x6d\x26\x4c\x41\x42\x7c\x76\xab\x50\x01\xff\x26\x3b\x44\x5b\x67\x5c\xd3\x4c\xaf\xc0\x75\xdd\x6e\x6f\x2e\x6e\x91\xd8\x8d\x64\xbd\x3f\x16\xd1\x5c\x9c\xe7\x6d\x5f\xae\x28\x02\xa2\x3e\x24\x77\x9c\x2a\xc6\xc6\xdf\x5f\x88\xf9\x1d\x81\xb1\x7b\xee\x36\x9b\x0b\xe3\x05\x51\x8a\x90\xab\x8e\x76\xdc\x38\x8b\x01\x54\x95\xde\x9d\x5d\xb7\x0a\xd0\x00\xe2\x44\x4f\xb3\x24\x1a\x1e\xe6\x45\x6a\x08\x4a\x22\x71\x39\xdc\x4c\x3b\xb8\x8e\xae\x78\xe0\x58\xcd\xfb\xf2\xb0\x03\x92\x50\xd2\xa6\xbe\x1d\x35\x8b\x43\x81\x40\xe9\x3f\x4e\x39\x95\x1d\x4d\x15\x4c\xfd\x53\x49\xd9\x08\xf0\x00\x2b\xc1\x03\x82\x4a\x93\xaa\x2b\xc3\x1f\x83\x85\x05\x8a\x44\xf6\xe1\xc0\xe1\x4d\x71\x02\x6c\x8a\x31\x71\x41\x93\x8c\x95\x7d\x22\xda\x80\xe6\x3a\xb7\x1b\x6a\x5c\x4d\xeb\xa8\xce\xca\x6d\xf1\xc5\x81\x36\x12\x4b\x42\x5e\x68\x09\x95\xba\x6e\x0b\x95\xb3\x4f\x5c\x13\xad\x4c\xe0\x8b\xf9\x20\xff\x23\x50\x23\xfb\x40\x17\x6c\x0e\x3f\x18\x39\xb4\x17\xdf\xe5\x3d\x0d\x51\xbe\x9d\x14\x91\x8f\xcf\xe3\x55\x55\x49\xa2\x00\x56\x8a\x07\xaf\xe6\xf7\x7f\x98\x18\x08\xf9\x3e\x61\xc8\x11\x40\x80\x04\x5b\xa3\xa7\x23\x72\xcb\x5c\xab\x1d\xe3\xe3\x19\x00\x7e\x58\x8f\x9e\x94\xec\x43\xbe\x85\xab\x85\xd8\x5c\x72\x80\x08\x55\x65\x8d\xed\xab\x9f\x39\x81\x59\x7e\x7e\x25\x8c\x95\x8e\x81\x03\xff\x1d\x9b\xf9\x32\x2d\x20\x8c\x37\xb0\x36\x03\x8b\x4c\xad\x11\x05\x18\xf2\x98\xdc\xaf\xe8\x10\xb1\x88\x3e\x68\xe8\x9d\xf2\xbf\x65\x30\x35\xb8\x41\x99\x92\x6e\x1b\x35\x22\xda\x57\xbd\x94\x3a\x30\x92\x61\xbb\x9d\xa9\x7a\x66\x20\x02\x58\x32\x6b\x77\x0d\x24\x5d\xd5\x6e\x06\xf9\x55\x87\xc3\x93\x1e\x9e\xa9\x81\x20\x51\x21\xc2\xc3\x9c\x89\x78\xb2\x66\x9a\x3d\x9c\xca\xa3\x41\x21\x8b\xdd\x48\xa0\x77\x14\xc0\x19\x11\x9e\x7d\xeb\x3e\x73\x35\x3b\xd8\xc2\x72\x03\x37\xf1\x73\xb2\xb3\xbc\xee\x2e\x1c\xa2\xa2\x05\xe6\x25\x94\x17\x9b\xa2\xe9\x64\x55\x60\x09\x2a\xba\x0f\x36\x94\x38\xf9\xdd\x51\x68\x4f\x2f\xb5\x32\x76\x78\x3f\x7a\xa8\x4e\xb1\xd7\xd4\x17\xc6\xec\x83\x83\x6d\x52\xcb\x1c\x23\x8a\xce\xcf\xe9\x6f\x86\x4e\xaf\x51\xff\x6c\xe3\xb9\x90\xa5\xaf\xb3\xbc\xf2\x77\x7c\xa8\x2a\x4b\x90\x3b\xe3\x53\x3c\xdb\x97\x47\x21\x81\x5d\xc5\x84\x80\x8a\x33\x7b\xe9\x08\x9c\x87\x12\x2d\x19\x23\x9f\x72\xcb\x3d\xe8\x95\x58\x8b\xe3\x5d\x94\x91\xc9\x59\xc9\xc7\x2c\x79\x7f\x42\x40\xb9\xe8\xb0\x3b\x58\xb6\x1a\x38\xa4\x57\x7b\x34\x70\xaf\x4e\x5e\x3e\x55\xdc\x81\xe0\x4e\x56\x02\x26\x65\xb6\x20\x91\xb8\x93\x7d\xeb\xb2\xb4\x12\xae\xb7\x41\xb6\x41\x2b\xc6\x50\xd6\x26\x71\xb3\xfa\x98\xe2\xf4\x13\x60\xa4\x56\x15\x43\xa6\x81\xe3\x96\x46\xde\xbe\xd9\xf1\x87\x79\x04\xe6\xb3\xab\xcb\xcf\xe2\xee\x67\x8e\xc2\xd3\xe4\x74\xd4\xb4\xfb\x9f\x0b\x33\xb1\x2f\x4e\x25\x53\x4f\xfc\xf7\x2b\x36\xab\x24\x28\x0c\xcf\x4d\x36\x18\x0f\xe3\xe5\x7d\xf4\xb1\x46\x40\x50\xfa\xb1\x06\x7b\xce\x83\x90\x7d\xf1\x86\x96\xcd\x95\x7a\x55\x00\x88\xf3\xc2\x4c\x11\xc9\xa2\xcd\x7e\x20\xb6\xc1\x8c\x1b\x33\x6b\x2a\x8a\xe3\x2c\xbc\xcb\xb9\x55\x47\xa1\x4f\x38\x6c\x38\xdb\xe4\x6c\xa9\xbd\x13\xc6\xe3\x87\xac\x15\x85\xea\xd5\xda\xe9\x2c\x43\x95\x90\x1c\xf4\x57\xe4\xe8\xe2\xd5\x9d\x9d\x1f\xb5\x29\xc3\x4b\x5f\x87\x93\x3d\xe3\xf2\xa5\x00\x54\x94\xdf\x95\xaf\xcf\xbe\xb2\xae\x51\x31\xb2\x7a\x54\xa4\xb5\xf6\x45\x35\x6b\x50\xaa\xe4\x40\xee\xae\xb4\x24\xbe\x20\x68\x30\x0c\x40\x2a\x65\x6a\x7d\xbf\x55\x68\x9f\x72\xdb\x4c\x8c\x25\x36\x8a\x63\x92\x95\xb6\x61\xca\x4e\x18\x4d\x80\xed\x3f\x77\x5c\x9c\x22\x18\x9d\x26\xdf\xc4\x51\x25\xe6\xa3\x8c\xc8\x74\x62\xad\xbc\x8c\x41\x06\x5a\x77\x64\x57\xbd\xde\x00\x57\xbc\xf9\x0d\xe0\x03\x2b\x15\xc0\xa2\x55\x95\xfc\xb2\x28\xb6\xb0\x26\x28\x61\xc6\x4c\xfa\x0a\x15\x7b\x21\x9c\x7b\x90\xb2\x92\xdd\x9b\xc0\xf6\xa8\x54\x3e\xce\xf2\xfb\x4f\x91\xf2\xcb\x4c\x76\x99\x4d\xf2\x01\xb6\xb0\x8e\xd2\xd6\xca\x79\xd9\x4a\xb5\xcf\x4e\x2e\xd4\x2b\xcd\xa6\xb9\x43\x9b\xcb\x38\x2a\x27\x0d\x2b\xb3\x84\x0f\x2d\x0c\x5d\xa7\xdc\x9c\xce\x4e\x09\x0c\xf2\xed\x37\x27\x8b\x46\x12\x4a\xef\xcf\xe8\xe0\xb9\xb5\xa3\x8a\x0d\x99\x80\x51\x55\xce\x40\xfd\x87\x7e\xa9\x9e\x19\x3c\xc4\xf2\xd5\xc0\xad\x11\x91\x92\xfc\xd3\xc6\x71\xcd\x92\xc8\x2b\x63\xca\x6c\x37\x18\xae\xb6\x40\x1f\xba\x5b\xbf\x66\x47\xe0\xe4\xbe\xa8\xb2\x1a\x66\xc6\xbf\x0e\x37\x5b\xef\x11\x39\x1a\x38\x19\x3a\xf0\x11\x56\x24\xfe\xc4\xce\x64\xe0\x17\xa9\x91\xcb\x5c\x7b\x05\x58\xf3\x01\x26\xa0\x45\x3e\x9f\x57\x66\x1b\x21\xd2\xea\xa0\xb2\xb6\x8d\xb3\xdb\x1f\x0b\x18\x3b\x26\x20\x9f\xdc\x09\x28\xb6\x3b\x45\x68\xe1\x9a\xca\xc7\xa3\x9c\xbe\x7c\x6b\xbb\xf8\xd6\xfd\x71\x1e\x91\x6a\x44\xa1\x04\xfe\xf6\xa6\x43\x65\x65\x4c\x63\x3e\x86\x18\x9c\xa1\xa8\x9f\xda\x49\xbc\xb1\xf9\xec\xc3\x16\x5c\xf6\x5b\x35\xef\xb5\xf1\xd4\x0e\x2e\xd5\x8f\x90\x40\x17\xb6\x2b\x89\xa5\xfe\xaf\x83\xfd\x0a\x84\xc5\x8e\x26\xa7\xdd\xe9\xf4\xbc\x03\xbb\x94\x7d\x26\x51\xf6\xb6\x8d\x1c\xc9\x2d\x7f\x51\xf4\x16\x34\xff\xad\x70\xf9\x38\xdd\x6a\x53\x66\x80\x2d\x53\xf7\x2d\x8a\xff\xcc\x75\xc5\xd7\x40\xb2\x3a\x57\xdf\xa4\x48\x7c\xe2\x04\xdb\x59\x51\x53\xb5\x07\xb3\x1a\x0a\xa2\x3f\x1d\x46\x4d\xe5\x2d\x9f\x30\xa3\xa9\x84\x1b\x5f\x0d\xe6\x69\x6b\xc5\xf9\x77\x9f\xcd\xe1\x74\xf2\xd6\x8f\xea\x27\xf7\x4b\x38\x6c\xe4\x36\xb5\x21\x2e\x1e\x28\x9f\xa9\x41\x15\x96\x4d\xb1\x11\x24\x46\xa8\x8a\xcc\xab\xb2\x78\x38\x43\x24\x51\x77\x50\x4c\x55\x40\x2b\xc1\xa8\x58\x27\x79\x8d\x2d\x71\x88\xfa\xcb\x55\x34\xcf\xca\xce\x29\x45\xda\xf0\x40\x5a\xa5\x46\x03\x9a\x97\x97\x9f\xe8\x35\x93\x1b\x1f\x51\x0b\xa3\xb0\xb6\xf1\x23\x2d\x56\x28\x95\x63\x4c\x75\x01\x08\x14\xea\x35\x7b\x52\xf2\xa7\xc8\xee\xd9\x28\x05\x93\x40\xf7\xa8\xda\xf3\x4d\xf1\x17\xbe\xe8\x53\x59\x48\x4c\xd0\x84\x90\x9a\x7f\x41\xf3\x0b\x54\xab\x01\x2a\x71\xae\xee\x18\x96\xa7\x14\x04\x42\x23\xcb\xe0\x40\x28\xc4\xed\xfd\x89\x9e\x14\x29\x53\xeb\x4b\xcf\xca\xa5\xb3\xab\x3e\x79\x15\x5e\x75\x59\xfc\x94\xab\x6d\xeb\xac\x2d\xd6\xc3\x3a\x21\x1f\xd0\x7b\x27\x41\x50\x13\x27\xb3\x23\x27\x4d\xb3\xa6\x7e\xc8\xdd\xb5\x8d\xc2\x92\x47\xfd\x54\xa5\x9f\x91\x41\xe8\x74\x19\x33\x34\x0c\xef\x95\x8b\x8d\x3c\xea\x5d\x87\x4c\x44\xf4\x7e\xf7\x77\x66\x52\x4b\xfd\x82\x11\xee\x99\x40\xc4\x8c\x7e\xca\xad\x80\x5d\x2c\x26\xfa\x4f\x70\x6f\x0d\xfc\x34\xd3\xef\xdd\x7b\xe4\xef\xf1\x03\xde\x63\x01\x25\x2a\x09\x6f\xc4\x47\x83\xbb\x30\xa0\xd5\x67\x47\xe0\xff\xe4\x90\x5d\x8b\x19\x2d\xca\x93\xff\xda\x2d\xa9\xbc\x66\xb3\xea\xa7\xbb\x44\xa2\x4b\xc6\x2b\x0b\xbc\x23\x59\x72\x88\x52\x5b\x52\xf8\xa5\x75\xac\xe8\x2f\xfc\x92\x1a\x96\x08\x0e\x8a\xdb\xf4\xb3\x77\x43\xdc\x9d\x44\x63\x09\x44\xfe\x79\x45\xfb\x8a\xbc\x2b\x01\x2a\xd0\x36\xe9\xcc\x35\x53\x19\xca\xeb\x00\x2c\xd6\x21\xcf\xdb\x44\x1c\x51\x1f\xa6\xfa\x91\xfb\xd5\x7f\x66\x9e\xb8\x56\x55\xc7\xc7\x99\x53\xad\xd1\xf5\x56\x7d\x96\xcb\x59\xa8\x9d\xf7\xcf\xd5\x1a\xfd\x92\x9b\x80\x9b\x43\x94\x62\x80\xe8\x31\xbe\x53\x79\x73\x84\x38\x42\x76\x82\x86\x49\x0d\xa1\xd8\x3e\xd2\xb0\xc8\x29\xf3\x26\x61\x5a\x39\xd9\xac\x78\xc3\xeb\xef\x2f\x06\x32\x8c\x2e\xdb\xaf\x6e\xb5\x69\x48\xd9\x46\xe9\x8c\x18\xbb\x9c\x2c\x30\x99\xac\xa0\x43\x41\xec\x85\x96\x2c\x06\x93\xf0\x38\x49\x40\x8b\x1a\xe4\xf3\xa8\xd2\x04\xb7\x8e\xd3\x2e\xcb\xbc\xff\x09\x29\xb3\x03\x6a\xa4\x94\xa4\x3f\x83\x56\xa6\xf4\x37\xfa\xe4\xf4\xb2\x29\x6c\xa0\x07\xca\x36\x4d\xd5\xc3\x46\x87\xc2\x3f\x65\x63\x10\xc5\xbb\x72\x3b\x8b\xe1\x86\x4a\x33\xea\x5a\x5a\x5b\x09\x0f\x0a\xb3\x80\x3c\xde\xef\x6b\x73\x75\x0c\x3a\xfc\xb4\x17\x1c\x0d\x26\xe2\x26\xcb\x35\xc4\xf5\x87\xaf\xb6\xd1\x0e\xe4\x66\x51\x9c\x44\xb6\x7a\x4e\x9c\x01\x2f\x07\x9d\x02\x9c\xce\xef\xcc\xdd\xa8\xbd\x85\xd0\x46\xfa\x65\x75\x96\xca\x08\xa6\x2b\x3a\x5a\xb8\x00\x71\x9a\xbe\x76\x19\xa5\x98\x85\xd8\x72\xbd\xdb\xf7\xf6\x71\xd6\x7b\xa9\x08\x85\x9e\x92\xaa\xd9\x07\x68\x58\xe2\x51\xd3\xd2\xe5\x82\xdf\x63\xee\x24\xac\x69\x2d\x5e\x65\x91\x10\x1e\x49\x80\x91\x9b\x89\xe8\x99\x8a\x45\x44\x2c\x55\x6f\x09\x18\x80\x36\x87\xad\xb0\xed\xdd\xc5\xb9\x8c\xfc\x45\x54\x23\xbe\xb9\x6d\x9a\x24\x0c\x77\xf7\x1d\x7e\xed\x8a\xda\xdf\xd2\x85\xe6\x1d\xa4\x6d\xdc\x2e\x0d\x14\xd1\x0e\xf8\x0a\x33\x65\x8f\x6f\xda\xfd\xd6\x97\xa5\xdf\x23\x05\x77\xb9\x80\xbb\x94\x8b\x14\xc8\xb7\x23\x2c\xf6\xe1\x08\x1e\x4e\x70\x7b\x4c\xaa\x7f\xf0\x05\x26\x40\xad\xd5\x24\xcd\x1e\x9e\x64\xa8\x95\x50\x31\x05\x63\x0e\x98\xe4\x1a\x50\xd8\xa7\x42\xc0\x00\x62\x2d\x7d\x84\xf9\x2c\x20\x07\xb4\xdb\xe5\x13\xb2\xcf\x99\xda\x23\x8b\xd8\xb2\x17\xbc\x5b\x3a\x1c\xed\x2b\x5c\x0b\x5f\xa8\x9a\x67\xe4\x10\x95\x17\xef\xe2\x9d\x7d\xa2\x7e\x1a\xf5\x19\x17\xe6\xe8\x3e\x97\xf9\x99\x03\x7b\x8c\xc5\x2b\x20\x62\x95\x68\x36\x11\xe1\x93\xcb\x9a\xb8\xd0\xca\x47\xf7\xc4\x6b\xe9\x4f\x79\xb3\x93\x08\x4c\x23\xa3\x64\x19\xba\xec\x33\x04\xcd\x8c\x10\xf6\x60\x49\x8d\xc2\x64\x95\x65\x35\xb6\x75\x7d\x4a\xdb\xc0\x91\x33\x9f\x0a\x34\x25\x22\x9c\x35\x9d\xd2\x7e\x33\x35\x9f\x37\xc2\x8a\xd9\xf1\x45\x5e\x25\xd5\xb3\xfc\x78\xcd\x81\x79\x4e\x63\x74\xd2\x36\xa4\xe2\xd5\x26\x36\xd8\x26\x6e\x8c\xac\xa3\x2c\x99\x6d\xce\x89\x64\x84\xa9\x76\x27\xb7\xe3\x14\x47\x12\x4d\x9c\x43\xee\xa9\x9b\xd4\x6b\x63\xbb\x24\x0a\x11\xf6\x65\x34\xaf\x0a\x3b\x3b\x67\x24\x42\x4a\x4d\x29\x64\xe7\xd0\x39\xc6\xf4\x03\xaa\x88\x04\x90\x17\x6e\x6b\x78\xaa\x34\x7a\xa0\x15\x9e\x20\x40\xf1\x13\x9c\x7a\x1f\x03\xef\x65\xf3\x76\x70\x58\xdb\x30\x04\xb3\x13\xaa\x0d\x5a\x14\x45\x89\x22\x0d\x1b\xbb\x7a\xd1\x72\xf9\xa0\xe1\x4a\x2d\x2a\x22\xa2\xbe\x31\xc4\x84\xc3\x9f\xcb\x84\xd1\xc4\x8a\x37\x53\x8e\x69\xfa\x20\xae\x32\x63\xeb\xa2\x0c\x23\x47\x9a\x12\xef\x81\xce\x54\x43\xa5\x74\xed\xde\x79\x73\xe0\x9e\x85\x19\x1f\xff\xe9\x40\xd5\x3c\x6c\x7f\xa7\x95\xa3\x4e\xde\x31\xb2\xf2\xf3\x4a\x4b\x85\x9f\x79\xe9\x38\x76\xd6\x4b\x49\x73\x93\x9b\x68\xfd\x1e\x6d\x4b\xae\xd7\xa4\xca\x57\x0c\x83\x7c\x6b\x54\x80\x5c\x47\x28\x06\x12\xab\xd4\x00\xda\xba\x96\x86\xda\xd6\x99\xc8\xc3\x3b\xc7\xb0\x7f\x4f\x70\xb4\x32\x7a\x8e\xaf\x48\xb1\xd0\x38\x75\xe8\xc2\xcc\x3a\x2b\xe2\x74\xb0\x79\x4c\x39\x52\x84\x86\x15\xf0\xc0\x53\xa5\xa4\x65\x40\x66\x9a\xd8\xd8\x76\x9a\xe5\x57\x3e\x3f\x3d\x6a\xad\xac\x88\x93\x86\x27\xa1\x10\x02\x21\x6b\x00\x5a\xdf\xbc\xc4\x34\xc6\xfa\xd2\xec\xc0\x56\x6d\x3c\x58\xde\xa7\x05\xa0\x0f\x0a\xbb\x47\x0a\xbb\x9b\x2c\x83\xdd\xc3\x72\x96\x67\x25\x1c\xd1\x2c\xc3\xe4\xc4\x07\xaf\x70\xcc\x5e\xa4\x33\x45\x00\x90\x7a\x6d\x13\x41\x06\x52\x9e\xe4\x9c\x10\x08\x1d\x7d\x49\x20\x8c\x8b\x1d\x78\xb1\x54\xda\xc6\x00\x51\xef\xc6\xbe\x7d\x2c\x89\x7a\x44\x90\x33\x39\x89\xa2\x79\x3e\xa4\x60\x33\x89\x71\x2c\x0a\x57\x6c\xad\x24\x15\x07\xb3\x0b\x50\x13\x74\xdf\x98\xc6\x1b\x7f\x03\x88\x4c\x86\xd0\xf0\x21\xee\x7f\x9a\x86\x92\xbb\xe9\x7f\xda\xd7\x14\x52\x97\x2f\x96\x82\x4d\xf9\x14\xa0\x46\x2a\x2a\xe6\x5d\xef\x3a\x40\x16\x8a\x93\x62\x82\x90\xd2\x2d\x85\xb9\xb0\x29\x73\x3e\x4c\xf9\x95\xc8\x9f\x26\xbf\xb6\x50\x3f\xe9\x0f\x7d\x53\xfb\x3f\xbf\x0d\xd1\x53\x60\x3f\xf8\x77\x40\x28\x8a\x3d\x0a\xb0\x2d\x70\xe2\x9c\x76\xf2\x80\x4a\xc5\x37\xbf\x41\x84\x94\x5c\x7a\x3c\xba\x18\xca\x13\xc0\x8e\xca\x43\xa1\xeb\xad\x5f\x95\x1d\xe5\x57\x8a\xa0\xbd\x2e\x3e\x18\x71\xce\x3e\xbf\x4c\x8b\x01\x2e\x2b\xe0\x75\x55\xe5\x40\xc3\x2b\xda\xc9\x75\xba\x33\x1d\xc1\x4b\xbb\x44\x2d\xae\x1d\xfa\xe1\x37\xe9\x2a\xb7\x37\xaf\xdf\x61\x0f\x6a\x85\xcc\x6f\xea\x9f\x21\xbf\x0e\x1b\xd3\x4e\x6a\x5f\x6e\xde\x75\x53\xa8\x40\x65\x38\x86\xdd\x82\xab\x38\xd1\x1b\xda\xec\xd1\xbf\x7a\x18\x15\x0c\x74\x8c\x4b\x7b\xb3\xf8\xc5\x0e\xf0\x83\x1a\xea\x59\x92\x1d\xfb\xd9\xf3\x6f\xa5\xf0\x48\xcb\x4e\xfd\xa4\xe8\x12\xe5\x3a\x20\x1f\x2a\xac\x12\xfe\x5f\xf8\x20\x94\x83\x16\x24\x32\x4e\x99\xc8\xac\x62\xef\x27\x07\xfa\x25\x96\xe5\x3c\x3f\xc1\xff\xaf\xfd\xb2\x2b\xa1\xc2\x0f\x43\x8c\x40\x2e\xe5\x90\x32\xea\xd9\x00\x42\x55\x6b\x86\x7d\xb1\x59\x88\xf8\x8a\xd3\x5d\x6d\x30\x9b\xf7\xc8\x13\xcf\x14\xaf\xf9\xe1\x5d\x05\xd6\x34\x40\x96\x25\x7a\xcb\x91\x76\xd2\xbb\x82\x3f\xca\xa4\x5d\x05\x8b\x51\x29\xb2\x9b\x04\x9e\x25\xda\x16\x4e\x2c\xa2\xa2\xbb\x0c\x9c\xd2\x60\x63\x87\x4a\xa6\x64\xe1\xdb\xab\x64\x22\x44\x73\x6c\xac\xd3\xa8\x40\x90\x66\xd5\xd4\x5c\x8d\xce\x59\x34\x6c\x55\x88\xec\x7f\x5b\xd8\x55\x65\x99\x5c\xab\x00\x63\x71\x41\x4d\xe9\x74\xf9\x2a\xcc\x5c\x60\x47\x64\xce\x2d\x5c\xf6\x95\x37\xad\x81\x60\xaa\xd7\x99\xbc\x56\x67\x16\xf0\x96\xc2\xda\xa2\xa5\x55\xec\x2a\x65\x8a\xa1\xb7\x46\x95\x54\xd5\xd7\xc1\x7f\x41\xe8\x0a\xdd\x1b\xf5\x77\x1c\x4a\xed\x28\xa5\xdd\x45\xde\x68\x7d\x81\xe8\x0a\x58\xb3\x1f\x4a\x31\xad\x63\xcc\xcf\x53\xb5\x1f\xe0\x4d\xd9\xc1\xb1\xa4\x2f\x70\xb0\x04\x17\x8d\xa9\xe2\xbe\xfe\x94\x23\x28\x24\x69\xe3\x7f\x3d\xd4\x1d\xd9\x27\x6a\xfd\x5f\x92\xaf\x62\xb7\x43\xfd\x03\x3c\x6b\x10\xc3\x26\xf8\x7a\x08\x1d\xe9\x4f\xfe\x2a\xb7\x8d\x43\x40\x16\x96\xba\x65\xf3\x86\xec\x1d\x94\x81\x1f\x94\xda\xc5\x2e\x27\x2f\x7e\x1a\x57\xd9\xd2\x89\x5e\xff\xeb\x6c\xd2\xb9\xd1\x68\xae\xb2\x29\x64\x69\xb3\xc6\xf1\x0e\xb6\x0f\xad\x8f\x0d\x66\x41\x4a\x1c\xe5\x49\x14\x2c\xdc\x10\xaa\xf5\x51\x55\xb9\xc0\xdb\x25\x4a\xbd\x67\xe7\x78\xed\xf6\xaa\x66\x0c\xbb\xfb\xe8\x2d\x99\x31\xb6\x89\x9e\x63\x12\x52\xf0\xde\x39\x4a\xf7\xea\x05\xb5\xd6\x9e\x6f\xca\xa1\x81\x27\x9e\x08\x2d\xa9\x0b\x7a\x3e\xb4\xb0\x6d\x5e\xad\x57\xe8\xac\x9c\x4a\x72\xe3\x7c\x70\xd5\x50\xe3\x10\xc4\x1c\xd0\xe0\x13\x5a\x1a\x7a\xcf\x15\xa1\xbf\x7c\x95\x01\xa5\x4a\xa0\x73\x6d\x08\x73\x34\xa9\x01\x9d\x88\x2a\x1d\x71\x10\x4e\xa6\xc8\x82\x92\x82\x43\xd8\x49\x53\xd8\x7d\x18\x24\x44\x01\x3e\xa3\xed\xc1\x16\xe8\x04\xf6\x07\xa7\x50\xa3\x22\xcb\x72\x2c\xeb\x94\x36\x38\x09\xb3\x61\x9b\xa3\x9b\xe6\x21\xb5\xc1\x87\x56\xb6\x16\x26\x29\x3a\xd9\xc6\x54\x54\x1f\x26\x57\xb5\x22\x2c\xbb\xba\x1c\x63\x84\xae\x97\xb6\xff\x1a\x8b\x76\x83\xe1\x3c\xb5\x33\x13\x3a\xbc\x87\x16\xc5\x92\xdf\x45\x70\x2f\xbf\xc3\xff\x24\xb7\x47\xae\xc8\xc5\x27\xa3\xe9\xc7\xa7\x1e\x6c\xa4\x0c\x6d\x92\x5f\xd9\x76\x95\x6f\x0f\x87\x09\xbe\xa3\x5d\x59\xff\xb0\x8b\xa1\x35\x6f\xc3\x3d\x41\x12\x1a\xf5\x6a\xb1\xac\xd0\x48\x48\xa6\xee\xe2\x72\x33\x49\xad\x8f\x5d\xbf\x95\xda\xdd\xd0\x23\x71\x47\xab\x37\x9e\x12\x9a\x9e\x64\x68\x97\x33\xf6\x1f\xa1\xde\x5c\xc3\xd3\xa9\xcf\x63\xf6\x2d\x3f\x55\x4e\xc1\x10\x59\xfb\x16\xce\xbd\x31\x58\xf6\xe0\x43\xf4\xe0\xa4\x4a\x97\xcb\xd5\xaa\x3a\xe7\x97\xae\x67\xf3\xe1\x8d\xc9\x7a\x12\x26\x57\x9b\xfa\xb4\x5b\x07\xda\xb9\xd6\xca\x9c\x0e\xe8\xf3\xf6\x3a\xdd\x2a\xff\x1b\x51\xc0\x11\xaf\xe7\x23\x92\xe4\xe0\xba\xa8\x2b\xe7\xf2\x7d\x67\x00\x8f\x3a\x91\x21\x46\x73\xed\x66\x8c\x63\x82\xf5\xbc\x74\x8a\x0f\xe8\x28\xf4\x90\x54\x0a\x3b\xca\xdb\x8d\x70\xc8\x6c\xa9\x70\x89\xa6\xe4\x92\xd2\xc7\x57\x62\x5c\xfb\xfb\x9c\xbc\xf6\x15\x23\xcc\xe0\x5b\xa7\x3f\x03\xc7\x69\x86\xbd\x71\x2f\xc7\x0b\x7d\x1b\x39\xa8\x04\x91\x59\x65\x49\xda\x2a\x32\x56\x89\xe7\x03\xb2\x58\xba\xa0\xf4\x42\x41\xb8\xc7\xc9\x73\xd9\x65\x65\xc1\x79\x0b\x43\x2c\x42\xc2\x4f\xb3\xc0\xa6\x93\x89\x22\x4d\x67\xbf\xbb\x84\xf3\x34\xcb\x3e\xd0\x6c\x19\xf0\xd3\x32\xba\x6f\x96\xe8\x5b\xa6\x2d\xf0\xec\x23\x92\x6b\xe8\xea\x88\x4e\x7c\x51\x9f\xca\x48\x58\x85\x4c\x31\x8a\xa4\x74\xad\x00\x80\x5c\x08\x61\xa7\x09\xad\x54\x3a\xb5\x79\x1e\xd1\xf0\xa8\x0e\xbe\x03\x86\xb2\xbe\xd0\xd0\x75\x7f\x50\x5d\x23\x74\xe8\x7d\xd6\xed\x3d\xae\x74\xf7\xa1\x39\xe1\x7c\x52\xb5\x53\xb5\x5b\x48\xbc\x6c\xd9\x25\x49\x5b\xba\xd0\xe5\xda\x60\x9a\x95\x48\xc2\x6a\x27\xd4\x12\x15\x45\xfa\x77\x86\x8f\x4b\x5b\xd8\x46\x2b\x77\x03\x85\x0d\xf6\x9b\xf4\xfc\x62\x81\x1a\x44\x8e\x2b\x9e\x3e\xaa\xef\x4c\x2a\x1c\x68\x47\x41\xdb\x8b\x11\x39\x3d\x43\x1d\xc0\x61\x77\xc9\x14\x94\xe8\x02\xd9\x02\x61\xad\xdd\x5d\xc0\xe6\xc8\x30\x78\x46\x39\xf8\xb4\x97\x1f\xf1\x28\x6c\xda\x01\x19\x38\xff\x3a\xe5\x83\x8d\xe6\x09\xa6\xc1\xbb\x6b\xe5\x8f\x02\x07\x5d\x13\x69\xf0\xf2\x28\x6c\x66\x95\x50\x98\x02\x10\x0e\xe6\xca\x17\x63\x06\xc8\x02\x2d\x84\x37\xd2\x1c\x37\xfd\x9a\xa4\xbf\x10\xed\x8b\x7b\x70\x45\xcc\x62\x9a\x30\x8f\x01\x4c\x01\x67\xf4\x0e\x65\x2d\xb4\xb2\xe3\xb3\x57\xf2\xea\x6d\xc6\xe7\x90\xad\x19\xbd\x00\xda\x8e\x49\xaa\x54\xe8\x9e\x9b\xe9\x25\x20\x2e\xe1\xf9\xd8\xad\xcf\x13\x90\x14\x49\xe8\xb1\xa2\xde\x92\x39\x73\xa3\xf5\xe4\x53\x53\x83\x47\xa7\xcd\xb8\x48\xcc\x75\x73\xe7\x64\x96\x4b\x03\x40\x83\xed\x93\x49\x79\xeb\xe3\x88\x95\xa2\x3a\xbb\xa1\x7e\xd6\x31\x60\xb3\x1d\xe0\xb9\x9f\x4f\x44\x46\x47\xbc\x25\x20\x7e\x22\xf0\x8a\xfb\x98\xf6\x11\x07\x8b\xd5\x87\xd8\x9a\xd6\x89\x13\x5a\x55\x10\x17\xed\xb9\x95\xa3\x2f\xb3\x26\x44\x68\xc2\xd0\xa6\x62\x34\x64\xec\x20\x92\xee\xcc\x2e\xe4\xb2\x6b\xec\xf5\xa7\xfd\x73\x2b\xef\x5f\x94\x05\x94\x0f\xe9\x71\xb4\x2a\x0f\xb8\x54\x88\xf6\x2f\x02\x31\xc1\x24\x35\x8b\x6f\xd7\xde\x46\x69\x31\x7a\x2b\xc7\x00\xfc\x57\x5b\xf4\x07\x5a\x7d\x31\xfe\x4a\x32\x28\xc4\x8b\x18\x7e\xab\x5f\x7c\x2b\x60\xca\xcb\x67\x33\x9f\x0e\x72\xa5\x1e\xe7\x41\xe0\x42\xe2\xee\xd0\x90\x58\x4d\x63\x5e\x84\x26\xf1\x0b\xec\xdb\x34\xd2\x1a\x7d\x4e\x16\x0e\xe6\xbd\x71\x02\xb6\xbe\x28\x63\x98\xc9\xe7\x22\x4e\x61\x8c\xc4\x27\x81\x53\x75\x35\x18\xc4\x95\x7a\xbb\x9f\xb8\xc7\x4c\x60\x63\x61\x65\xb9\x96\x96\x2a\xaa\xe9\x28\xb7\xcf\xc9\x5e\x8d\xf8\xd7\xbe\xb3\x82\x8c\x43\x37\xbe\x0e\x07\xdb\x26\xa0\xf3\xd2\xa2\x73\x57\x66\x6b\x2c\x80\x90\x89\xcd\x97\x83\xa9\x40\x27\x71\xb9\x37\xc7\xf4\x34\x7c\xb0\xe5\xbc\x86\xe0\xb9\x29\xbd\x3b\xc2\x12\xcf\xa1\x86\x5d\x09\x5a\x5d\xda\x24\x66\x87\x8f\x1d\xa0\xaa\x60\xe0\x32\xb7\xab\x33\xca\x0b\x59\xd1\x12\xf4\x92\x15\xcd\xb1\xe6\x8a\xa5\xdb\x79\xa9\xb0\x2e\x7a\x2c\x99\x75\x57\x76\x46\xfe\x48\x06\x74\x71\xfa\x61\x3a\xa8\x8a\x60\x11\x24\xc2\x0c\x17\x54\x52\x28\x2c\xb1\x2e\x64\x03\x05\xa0\x33\xeb\xd9\xf0\xb3\x62\x64\xa1\x16\xa6\xb9\x23\x51\xfc\xba\x89\x73\x6b\xf9\x0f\xc4\xe8\x48\xe9\xa5\xa5\x7c\x70\x60\x34\x94\x23\x77\x77\xf6\x3f\x65\xb3\x32\x39\x1b\x42\xfb\x92\x11\xc5\xbb\xbc\xcf\x24\x2e\xc2\x92\x6e\x76\xe1\xbc\x3f\x4d\xcb\x15\x0f\x42\xd1\xc8\xb8\x73\x82\x70\xa1\xd3\x4f\x9a\x41\xf3\xa8\x53\x73\x41\x15\x23\x71\xea\x90\x0e\x72\x61\x21\x88\x38\x95\x32\xbb\xbc\xd5\xe8\x7a\x7a\x9f\x8f\x76\x71\x78\x54\x76\x11\x99\x2b\x7d\x42\x28\x58\x94\x78\x6c\x9c\x23\x9d\xc7\x36\xa8\xab\x0b\x88\x41\x90\x05\x34\xd6\xac\xd6\x8d\x28\xf3\xaa\x50\x8e\x15\x1a\xc4\x88\x9e\xec\x7c\xd8\x29\x80\xab\x85\xad\xdd\xf6\xec\xa0\x32\x6e\xce\xa4\xfa\x99\xd7\x27\x78\xad\x8d\xf7\xd8\x3b\x3a\x02\x00\x24\xc9\x3b\x5f\x37\x94\x53\xd6\x5e\x21\x78\x2a\x1e\x60\x62\x71\x09\xd7\x72\xa5\xed\x5b\x03\x1a\xb5\x56\x27\xc3\xad\x26\xfc\xeb\x02\x8c\xde\xb3\x35\x08\x43\xe2\x1c\x78\x70\xf5\x62\x57\x30\x6d\x0a\xfb\x14\x1d\x39\x36\x65\x7e\x0c\x54\xcb\x71\xa5\x0e\xb6\x76\x31\x72\xbe\xc5\xfc\x9d\xb8\xa7\x7f\x23\x71\x4a\x5e\xb6\xe1\x0e\xd3\x87\x30\xa0\x4e\x6c\x59\xbc\xbc\xa8\x23\xe2\x46\x09\x83\x85\x5d\x89\x22\x0a\x4d\x04\x07\x9c\x6d\xc8\x1d\xb4\x9e\x4f\x99\x13\xea\x1e\xe9\x35\xe6\x48\xb6\x51\x1d\xba\x3d\xd8\xc3\x0c\xc9\x87\x57\x16\xed\x5b\xf3\x98\xba\xd3\x4c\xaa\x07\xb4\x07\x1f\x58\xdd\x42\x00\x45\x67\x89\xe2\xd6\x1e\x06\xc9\x8c\xe6\x9f\x1a\x50\x18\xf6\x79\xf7\x12\xc1\xcd\x1a\xdf\x04\xde\xfc\x31\xa8\x3c\xb7\x5f\x1f\x6c\x26\xa9\x20\x2e\xbc\x8f\xcf\x3d\x53\x6e\xde\x1d\xf4\x22\x3d\xc5\x06\x86\xd9\x59\x93\x5c\x1a\x9d\x10\x07\xa5\x51\x29\x0a\xea\x3a\x6d\x63\x30\xf7\xac\x2c\x18\x4a\x8a\xcc\x1e\x07\x1a\xd4\xfa\xf6\x21\x0c\x1a\x6f\x1c\xc9\x52\x3f\x39\x7b\x83\xa0\xad\x7d\x15\xde\xea\x2a\x16\xca\xc6\x99\x32\x16\xff\x29\x0c\x33\x6a\xfc\xd3\x9d\x15\xc7\x98\xce\x0b\xb0\xbd\xae\x60\x5a\x98\xb7\x3c\x79\xb8\x3a\x25\x6e\xd8\x0d\x1b\xd3\x6d\xca\x98\x2a\x2e\x4f\x93\xab\xcd\x04\x26\xc8\x01\xea\x7f\x19\x3a\x4c\xc9\xcf\x9b\x24\x4d\x6c\x16\xc8\x97\xfd\x67\xed\x94\xa8\xd1\x84\x90\x1a\x08\x3a\xdb\x0f\xbd\x4a\x85\x83\x82\x24\xe8\x22\x17\x75\x0e\x90\xcf\x0b\x8b\xbf\xed\xe4\xba\x96\x56\x52\x21\x3b\xfe\xdf\x04\xd6\x07\xe9\x43\x93\x86\xcd\xde\x72\x10\x07\xab\x26\x54\xd7\xb0\x9c\x02\x41\xcd\x49\x89\x63\xbf\xa8\xac\x05\xd8\xe4\xf0\x61\x2d\x51\x49\x58\x48\xe6\xac\x54\x63\x49\xcf\xc4\xea\xe4\x77\xf6\xf2\xad\x31\x58\x70\x8e\x0e\x53\x2c\xf9\x0a\x33\x38\x4e\xea\x11\xda\x60\x00\x10\x1b\xb6\x94\x99\x00\x4a\x8c\xbb\x60\x68\x51\xe0\xc4\xc2\xa6\x21\x0a\x4e\x32\xa5\x79\x2a\xd4\x76\xea\xa0\x7c\x69\x81\x9c\xa5\xa4\xeb\xe9\xce\x55\x29\x12\xce\x62\x70\x56\xfd\xd9\x4f\x87\x93\xe4\x29\x48\x2f\x39\xbd\x1b\xec\x28\xcb\xb7\x7b\x67\x70\x7c\x7c\x98\xd9\x11\xd4\x69\xf2\xa5\x73\x4c\x93\xf3\xec\x54\xbf\xf6\x17\x13\x9e\xe5\xc1\x58\x60\x2d\x93\x36\xc7\x1b\x38\xba\xf9\xd0\x44\x89\x70\x0f\x6f\xfc\xd9\xc6\x6c\x2f\x2b\xb7\xb2\x59\x62\x4c\xce\x34\x63\x6c\xcf\xf9\x1c\x05\x07\x39\x55\x2e\xe0\x55\x02\x18\x97\x4a\x1d\x87\x65\xd3\xd3\x35\xda\xa1\x74\x9b\xbd\x33\xf5\xa7\x54\x96\x8e\x26\x25\xcd\x62\x30\x2e\xcb\x67\x92\xa6\x7a\xc2\xaa\x2d\x4f\xae\xa8\x44\x05\x93\xfb\xed\xfd\x6a\x3e\x2f\x55\x63\x57\x57\xbf\xf9\xe3\x05\x4d\x58\xf7\x03\xd6\x09\x05\x02\x53\x1c\x04\xe4\xc8\x65\xbe\x18\x53\x03\xac\x45\x76\x9a\xa0\xc0\x7a\x26\x27\x36\x1e\xdd\x85\xd1\x74\x72\x14\xcb\x6a\x26\xd8\x67\x5f\x59\xf9\x73\xec\x51\x3a\x7f\xa1\xce\xee\x23\xcf\x54\x98\xc9\x1f\x2a\xa7\x8b\x9d\x2b\x67\x72\xf2\xda\x19\xb9\xd3\x3b\x45\xaa\x76\xdc\xe4\x1f\xce\xf2\xda\x94\xaf\x5a\xd8\x55\xcd\xa1\x05\x6a\x48\x57\x34\xbe\x52\x8b\x38\xce\x6c\x85\x54\x90\xdc\x02\xc0\x87\xf3\xfe\x01\xde\xca\x7e\x5b\x05\x43\x12\x90\x08\x02\x83\xce\x3a\xfe\x78\x11\x34\x74\x54\x3e\xb4\xeb\xc4\x29\xc9\x1e\xf6\x9b\x9e\xfd\x20\x2a\xe8\xdb\x7a\xbd\x5b\x1c\xed\x50\x1f\x4b\xd6\x90\x35\xa9\x30\x1b\x75\x19\x26\x42\xe1\xa1\x4f\x6c\xd8\x38\xd4\x36\x21\xf5\xd0\xfa\x95\x5d\x54\x26\x90\x2a\xdf\x6b\xb7\xf9\x17\xe3\x92\x6d\xaa\x07\xc6\x23\x71\x2a\xce\x3b\xb0\x0c\x75\x73\xac\xa4\xa9\x91\x3f\xc0\x70\x61\x21\xa7\xde\x8e\x10\x7a\xef\x77\x85\x30\xa3\x05\xbf\xac\x62\xa8\x19\x70\x6d\x3f\x65\x3a\x92\xef\xc0\x22\x5e\x08\xf6\xd0\xd5\x37\xc8\x48\x77\x68\x85\x0e\x3b\xa9\x48\xc3\xe0\x5c\xde\x81\xa4\xc4\x75\x97\x2b\xcd\x61\xe1\x24\x55\x9d\x0f\xc9\xb9\x04\xb7\x8e\x6a\xa4\xce\x6b\x3e\xbd\x74\xb7\x51\xec\x78\x0d\xde\x2b\x42\x42\xb7\x7e\x35\x0a\xeb\xe0\x57\xdf\x37\xba\x75\xb4\xeb\x91\x34\x4f\x09\x7f\x87\x92\x5a\x7a\x21\xa5\x55\xe7\xc3\x17\xd5\xb2\xad\x55\x6d\x0d\xeb\x50\x9a\xc0\xfc\xfb\xd9\x71\xfc\xc6\x84\xe8\xe2\xf8\xcd\x8f\x0a\xc6\xc2\x77\xa6\x05\xd0\x07\xf2\x9d\x4e\x4a\xce\x36\x7a\xb7\xb6\x91\x59\xae\x9d\xac\x96\x55\xdc\x16\xf3\x61\x15\x8e\xd3\xa3\xb6\x4a\xf0\x80\x98\x29\x4e\x84\x74\xd7\x6f\xf6\xf9\x2c\xff\xfc\xec\x28\x6c\x69\x73\x89\x0c\x8f\xc4\x69\x45\xd0\x30\xa7\xc3\x65\x79\x5d\xf5\x5e\xa9\xad\x8e\x8a\xb9\x02\xba\xc3\x21\x9a\xe6\x30\xd8\x9c\x54\x59\x07\x9e\x83\xc7\x26\x7c\x48\x9f\x59\x48\xd8\x79\x7b\x90\xfa\xe2\x74\x00\xed\x3e\x91\x33\x6b\x67\xea\xcd\xca\x52\x43\x37\xdb\x8b\x0a\x8e\xfa\x6e\x1b\x25\x4a\xc5\xdc\xe2\x34\x61\x92\x86\x23\xcd\x98\x3a\x8d\x33\x85\x92\xbe\x86\x3e\xf5\xc9\x2f\x6c\x69\x6d\x42\xff\x7f\x9d\x33\xe2\x47\x2c\x5c\x87\xce\x8a\x7c\x0a\xfd\x84\xb1\x17\xa8\xf7\x8f\x0c\x59\xbb\x0e\x03\xe3\x18\xa6\xc7\x73\xca\x3e\x89\x59\xce\xd2\x86\x43\x35\x53\x36\xd2\x4a\x4d\x93\x9d\x1d\x1b\x32\x1c\x9c\x60\x05\xed\x0a\xb9\x3b\xce\xaa\x0a\xe8\xee\xf9\xb1\x61\xb6\x1d\x7e\xa2\xa1\x11\x61\xeb\xcb\x19\xbc\x6f\xc2\x49\x28\x2a\x8b\x47\xcc\xb4\x82\x7b\xa8\x34\xf3\x38\x06\xa6\x85\x0e\x92\xda\x33\x34\x27\x39\xda\xcd\xd7\x3d\x40\x8d\x62\xcb\x14\xf7\x97\x88\xb7\xa3\x74\xe4\xe0\x38\x5b\x8e\x48\x42\x2f\x59\xbc\x14\x9a\xf7\x8b\xd6\x96\xec\x5f\xb3\xaa\x67\xda\xab\xcd\x81\xc3\x27\x27\xa7\xa3\x4e\x94\xc9\x9a\xca\x1c\x54\x55\xdb\xd0\x91\x21\xa9\xaf\x43\x00\xf5\x24\x5a\xaa\x5b\x43\xc2\xdc\xf8\x93\x17\x37\x64\x58\xac\x5f\x57\xf5\xe1\xd4\xf8\xe8\x82\xa8\x6f\x2f\xcd\xbf\x82\x0f\xf7\x96\x8b\x60\xc5\x10\x33\x4c\x6f\xd8\x25\x67\xb8\x89\x6d\x76\x85\xb6\x4e\x8d\x75\x2d\xd4\x3c\x39\x61\xfb\x9e\x3f\x76\x5e\xb4\x4f\x03\xd1\xb3\x96\x33\xed\xc7\x13\x3a\x85\x08\xa5\x81\x4a\x60\x02\xe3\x66\xaa\x1a\xce\x4f\x74\xf6\xdd\x62\x1a\x5b\xf8\x5a\x4f\xfd\x8d\xaf\x86\x72\xbc\x76\x4c\xe0\x95\x2a\x44\x69\x6b\x08\x13\xcc\xd8\xe2\x72\x04\x56\x2d\x7d\xd8\x18\x68\xd8\xb8\xa3\x7c\xce\xc4\xa1\x2a\x8a\x40\xdc\x5e\xda\x1e\x0c\x04\x39\x72\x7f\xd4\x75\x31\x1c\x31\x74\x97\xdd\xab\xb5\x3f\x71\xce\x7c\xbc\x56\x66\x24\x27\xf6\xc9\x7b\xf0\x51\x69\xdb\x03\xba\x17\x20\x40\x8e\xa3\xb8\x21\xa3\xf8\x09\xca\xfe\xb0\xe3\x37\xe2\x63\x85\x41\x60\x99\x82\xc7\x16\x6b\x92\x13\x58\x68\x7c\xd8\xd8\x5d\x7c\xc4\x89\x31\xc2\xec\xbf\xe6\xf7\xd1\x12\x9b\x38\x6a\xc6\xa8\x4d\x88\x2c\x17\xce\x0c\xc0\x61\x85\xe8\x2f\x96\x1c\x9f\x38\x44\x71\x95\x57\x46\x51\x60\x53\x76\x65\x83\xc9\x4c\x32\xd5\x64\x1c\x33\x78\x47\xf6\x48\x44\x65\x59\x9c\x5e\x40\xb3\xab\xae\x9c\x03\x92\xfc\x64\xab\x2b\xb2\x1f\x6b\xd8\x32\x8b\x13\x66\xf6\x32\x6a\xb2\xe6\x3d\x8e\xfa\x8f\x24\x1b\x9d\x24\x85\x72\x44\xd4\x46\x4a\x7f\x78\x37\xd2\x8a\x8a\x2b\x91\x35\x8d\xb6\x59\xf0\x97\xe0\xce\x85\xa8\x6c\xc8\xc8\x77\x12\xf5\x56\xfc\x94\xd1\xae\x59\xa1\xf0\x64\xbd\x3c\xfa\xdc\x7a\x1d\x4f\x01\x0c\xd7\x73\xb4\x8d\x72\xa9\x61\x54\x9f\xeb\xb7\x41\xa9\x3a\xb1\xeb\xbf\x0e\x0b\xa8\xbd\x48\x3c\x72\xfa\xca\x70\xa6\x92\xe4\x1b\xd1\xc7\x39\xa2\xe5\xcb\xde\x38\xbf\xf3\x7c\xb4\x8d\x15\xc8\xcd\xa1\x41\x0c\xf0\xc1\x0a\x6a\xd6\x81\x32\xab\x0d\xf9\xa3\x4a\x40\x63\x63\x92\x55\x6a\x99\xed\x49\x3e\x04\x24\xb8\xdf\x94\x5c\x5f\xd8\xee\x9c\xcb\x18\x0b\x29\x67\x99\x3d\xd8\x8d\x89\x32\xfc\x26\x68\xe2\x7a\xfc\x69\xb6\xf7\x74\x78\x43\xf2\xf7\x9b\x4a\xb3\x01\x9f\x06\xdd\x97\x54\xf6\x30\x5c\x11\x3d\x21\xac\xab\x6f\xcc\xaf\x56\x1d\x42\x9b\x51\xc2\xc7\x0c\x1a\xf9\xe0\xe6\xa1\x5f\x1a\x8d\xcc\x21\x53\x68\x02\x3d\x15\x94\x5e\x33\x41\x5a\x27\x3e\xd6\x81\x3a\x13\x1d\xa2\x85\x17\x8f\x30\x51\xd8\x71\x76\x62\xa0\x61\xa8\x96\xd5\xb1\x01\x11\x75\x62\xad\xc2\xbd\x87\x34\xea\x54\xd0\x2f\xa5\x8a\x03\x48\x01\xb9\x22\x73\x18\x6d\x55\xa4\x85\x4e\x9f\x2f\x8f\xb5\x33\x06\x9e\x38\xa9\x47\xa9\x1e\x34\x89\xe1\x76\xf4\xc1\xda\xde\x0f\x57\x01\x0d\x8c\xb5\x43\x6e\x06\x94\x4a\x12\x20\x3e\x8b\xd2\xc8\x64\xbe\xbd\x0a\x35\x6a\x94\x50\x14\x59\x2a\xb6\xbb\x7e\x0f\xe9\x88\xf6\x8e\x43\x6a\x4d\x05\x8f\xc8\xeb\x51\xb4\xc7\x35\x9c\x25\x0b\x30\x13\x50\xe3\x81\x73\xf8\x3f\x84\x44\x29\x7b\xf5\x82\x55\xf4\xda\xd5\x85\x5b\x0a\x08\xf1\xc5\x32\x52\x79\x3e\xd9\x46\xa7\xc7\x23\xb9\x87\x55\x55\x00\xce\x74\xde\x49\xbe\xfa\x10\xe3\xee\x1c\x78\x43\xb3\x6a\x1a\x0d\x85\x26\x34\xd4\xa1\x0d\x20\x7f\x07\x7e\xfb\x9f\xab\x5f\xd4\x3f\x67\x98\xf5\x2d\x67\x3d\xca\xf9\xb0\x00\x4a\xcf\x61\x60\x5b\x87\xdc\x0e\x6f\xdd\xe6\x50\x08\xad\xb4\x40\xad\xba\x8f\x3a\x25\x1b\x57\xed\xbb\x35\x70\x1c\xe5\xea\x2d\xfd\x2a\x01\x83\x9e\x6e\x13\x71\x04\x87\xc4\x87\x9f\x12\xd4\xf2\x87\x1a\xa3\xd6\x0c\xd5\xce\x43\x48\x4c\x03\x3a\xd0\x31\x7d\x5c\x8f\xd5\x0a\x4d\x3c\x46\x52\xaa\x8c\xb6\x79\xad\xf5\x31\xa4\x53\x3d\xa4\xc4\xb6\x86\xba\xff\xa1\xf3\x0d\x0d\x38\xf3\xe4\x77\x18\xe2\xb3\xb9\x73\x16\x05\xfd\xbf\x43\xee\x92\x87\x74\x92\x91\xf5\x88\x22\x13\xc9\x24\x49\x58\x07\xb2\x4f\x00\xbe\x1d\xe6\xd6\xa6\x6a\xce\x47\x7b\x59\xb8\x6d\xca\x97\x01\x67\xf8\xd6\x1f\x44\x6e\xc1\x9b\xfd\x60\xea\xc9\x2e\xfd\xc6\xe5\x12\xcb\x0b\x7c\x5b\xb6\x11\xdc\xde\x16\xc6\x7c\xc4\x32\xa4\xa7\x1a\x9e\x84\x58\xc6\x59\x14\xdb\xb2\xfc\xd3\x74\x6b\x1e\x46\x43\xa9\x30\x71\xbb\xd3\x51\x16\x4e\xd9\x10\x7f\x4c\x60\xf6\x88\x3f\x9c\xe9\x3c\x1f\xfd\xdb\x78\x8e\xea\x91\xe6\xa2\x0e\x0c\x1c\x6c\x23\x3e\xa0\x50\xca\x48\x50\xeb\x68\x9c\xb7\xc4\x9c\x43\x72\xbb\x6b\x10\x25\x20\x01\xe2\xa3\xdb\x0c\xfc\xc6\x5f\x96\x2f\x47\xc7\xd5\x14\xd8\x92\x5e\xc9\x06\x75\x2e\x84\x72\x60\xbe\xd3\x74\x9b\x6b\x10\xe7\x81\x74\xe1\x10\xba\xca\xbd\x99\x3d\x62\x5b\x1c\x93\xb6\x06\xce\xd3\x59\x6d\x1a\x36\x07\xbe\xa8\x88\x03\xe8\x86\x09\x75\x6a\xa5\xa2\x6d\x78\xfc\xa8\xf5\x0e\x54\x0b\xac\x7b\xce\xc0\x2d\x37\x79\x4b\x94\x5f\x65\x21\xbe\xfb\xf0\xec\x59\x65\x9d\x0c\x36\x57\xa9\xf3\xe1\xcc\xc5\xe3\x26\xbe\xa2\x9a\xa9\xaf\xf9\xf3\x49\x18\x28\xa4\xfc\x1d\xae\xa7\x33\x31\x50\x87\x09\xd0\x53\x55\x58\x6c\xe4\xcf\x5a\xcb\x27\x4b\x95\x7a\xdd\xf5\x0b\x7c\xfd\xb2\x5c\x07\x40\x67\x82\xab\x1c\x95\xb8\x60\x1a\x44\x0f\x74\x4b\xe9\x0f\xfc\x6a\x03\xa9\x99\xcd\x77\xaf\x3e\x75\x1b\x1d\xe1\x8b\x8b\xc5\x84\xd5\x6f\x89\xca\x2f\xdd\xe8\xfc\x56\x83\xa8\x42\x63\x2c\xfa\x79\x0f\xb1\x0b\x89\xc8\x6f\x40\xb7\xab\x65\x88\x8d\x68\x71\x12\xb1\xe6\xba\x92\x39\x4e\x08\xb5\x46\xcc\x6d\x79\x98\x01\x75\xdf\x76\xa1\xfc\x31\xd4\x2e\x2f\x12\x01\x2f\xa2\x5b\x9a\xf8\x55\xb3\xef\x27\x47\x28\x1f\xca\x39\x02\xee\x1a\x31\x8a\xfb\xf0\x41\x0c\x7a\x54\x69\xfe\x56\xae\x7f\x76\xc2\x5f\x1e\xfd\xea\xec\xd0\x16\xc7\xb0\x23\xda\x9c\x5c\x56\x5c\xcb\x26\xf6\x4b\x9a\x0e\x5b\x65\x20\xb9\xa8\xd3\xae\xcf\x65\x69\x70\xaf\x20\x3d\x6a\x76\xf3\xff\xb9\x7a\xb3\x05\xd5\x75\xdf\x69\xf4\x5d\xb8\xfe\x5e\xca\x49\x4c\xe2\xce\xe0\xfc\x32\xc0\x86\xa7\x3f\x2a\x55\xc9\xac\xff\xb9\xd8\x1b\x77\xaf\x9e\x80\xc4\x96\x4a\x35\xa8\x25\x99\x9a\xd7\xd6\xf4\xc3\xcd\xf0\xa8\x24\xd9\xe9\x27\x78\x1b\xdd\x25\x9b\xc7\xb3\xae\xc9\x9a\x27\x99\x0f\x3e\x7f\x69\xa9\x6e\x5e\xfa\x70\x46\x00\xeb\xf4\xe1\xa0\x13\xc8\x50\x23\x86\x27\x13\x80\x5d\x12\x1b\x24\xbe\xee\x03\xb5\xd7\x3d\x88\xcd\x62\x03\x08\x89\xdd\x04\xe8\xf7\x61\x4b\xea\x61\x66\x72\x95\x76\xca\x6b\x43\x68\x6e\x97\x67\xd1\xa1\xab\x03\xa3\x43\x69\x5a\x0b\x27\x2b\x56\xa3\x7e\x7c\x88\x82\x1b\x99\x71\xaf\xb3\x9c\xd1\x9c\x8b\x28\x1c\x15\x83\x06\xdf\x57\x21\xcd\xa2\xb4\xcc\xbf\x2a\xb9\x1a\xe5\xeb\xd8\xb2\x57\xd9\x9f\xb0\x09\x7b\xd7\xe5\xa9\xa1\x61\x95\xdc\xef\x55\x5b\xe6\xf5\x41\x4f\x0b\x7b\x1f\xfe\x0b\x05\xe5\x41\x5f\x15\x4f\xca\xe4\xc6\xb9\x97\x9f\xc4\x17\xac\x04\x72\x8f\xec\xfc\x1e\x3d\xec\xce\xd5\x2a\x2d\x6b\x38\xb9\x35\x97\x75\x1d\xad\x6a\xe5\x71\x0b\x09\x84\xcc\x13\x4b\xdf\x83\xab\xec\xa4\xce\x7c\x04\xd7\x60\x64\x91\x0f\xee\xf0\x75\x7b\xc3\x5e\x9b\x64\xac\x0e\xb0\x95\xf6\x8b\xd7\x5f\x24\x9c\xd8\x41\xc5\xb6\x4d\x58\x17\xea\x51\xa3\xeb\xb1\xbf\xa8\x57\x5c\x53\x5a\x6e\x47\x11\x30\x9c\x62\xd2\xba\x55\x5a\x8d\xa4\x92\xce\x76\xbc\xcd\x6f\xeb\xf0\x7f\x1f\xd9\xe5\x47\x84\x96\x15\x11\x72\x63\xc3\xe0\xfe\x13\xfb\xe9\xab\xa9\x2b\xe2\x68\x99\x12\xcf\x4d\xdb\x56\x9b\xed\x71\xf6\x8b\xce\x37\x56\xb5\x49\x8e\xc8\x78\xb5\xf8\xb4\x83\x36\xa4\xb2\x4f\xee\x66\x31\xf5\xc8\xc0\x99\x49\x5c\xda\x26\xfa\x82\xd0\x37\x00\x0a\xce\x5f\x22\x5b\xf8\xe0\x77\xe1\xd1\xe1\x6e\x2c\x24\x6d\xea\x2c\x84\xfd\x8a\xb6\x23\x8e\x97\xed\xef\x16\xcb\xf8\x62\xe9\x74\xb5\xfc\xee\xf3\x2d\xc7\xf6\xf3\x65\x1d\xdf\xf0\xcb\x59\xd2\x8c\x09\xfc\x74\xa5\x36\x34\xed\xe3\xd9\x6c\xcf\x4f\x72\x34\x74\xb6\xb4\x00\xb5\x33\x48\x76\x3e\xc1\x54\xf2\xda\x5a\x20\x06\xf0\x2b\xe3\xa3\x22\xca\xae\x15\x62\x56\x47\xab\xd3\xad\xc1\x73\xea\xc0\x7e\x2f\x99\x2a\x27\x70\x8c\xf8\xf3\x37\x5d\x44\x80\x88\xc3\x67\xbe\x0c\x43\x0a\xdc\x6e\x71\xac\xd5\xbe\x8f\xfb\xcf\xc5\x7a\x6f\xbe\xff\xd2\x9b\xc7\x27\xf4\xdc\x7c\xaf\xc1\xc3\xf7\x31\xaf\x9d\x38\x8b\xfa\xed\x09\x51\xe6\x82\xdc\x32\x1d\xb5\xa6\xbc\x47\x9e\xcf\xba\xc5\x62\x0d\xe2\x5a\x33\xb7\x60\xa2\xb9\x37\x68\xa3\x77\x24\xdc\x8a\x10\x87\x54\x42\x98\xca\xe4\x78\x7f\xdf\xfd\xe5\xf5\xad\x2a\xb0\x9b\xb4\xcc\xfc\xf1\x56\x6d\xa8\x51\x1b\x6e\x9e\x79\x3e\x7e\xd6\x41\x9a\xc2\x5a\x11\x4f\x44\xad\xf2\x94\x86\x5f\xa4\x2b\x8c\xf7\x5a\x2f\x40\x34\x99\x2a\x6e\x28\xa8\xe8\x81\x76\x04\x27\xb3\xab\xef\x58\x2c\x83\x34\x38\x3a\x52\x6d\x2f\x57\x2e\xa9\x2d\x8b\x7c\x18\xbe\x31\x59\xee\x9a\xe8\xd2\xd3\x07\xa2\xb2\xa3\x49\x15\xcd\x7c\xf8\xfc\x61\x93\xcb\x0b\x02\xfa\x0d\x9e\x25\x57\x64\x67\x5b\x3b\x55\x3b\xd6\x2e\x9e\x3f\xf0\x1b\x6a\x8e\xc1\x7a\x51\x6f\x87\xfd\xc8\x8f\xc7\x3d\xf7\x24\x33\x9f\xb5\xc5\x41\xae\x59\x58\x8a\x03\x81\x7e\xa5\xf6\xb5\xb9\xe8\x25\xc2\xdb\x87\x33\xaf\xdc\xb4\xac\x8d\x8d\x4e\x5e\x7f\x4b\x98\xa4\x54\x7e\x62\x94\xdf\xab\x58\x3f\xf0\x25\x7b\x38\x94\xe3\x9b\x56\xb4\x58\x8c\x6d\x88\x21\x53\xd8\xbd\xee\x59\x50\x33\x8d\x55\x1e\x9c\x3b\x11\x34\xc4\x36\xd7\x93\xc5\x6b\x4d\xdf\x6f\x32\xaa\x91\xc7\x40\x61\xd8\x1a\xd5\xcf\x8a\x19\x06\xbb\x17\xf7\x05\xa1\xc8\x3c\x2f\xa3\x46\x52\xd0\x67\xd3\xc7\x0f\x54\x2c\x81\x02\xab\xac\x79\x96\x0f\x4f\x29\x1c\xd7\x38\x61\xfd\xa6\xf8\x74\x61\x9c\x9c\x5f\x52\x16\x8d\xcd\xa4\xfa\x99\x22\x7d\xd3\x2e\x9b\x90\xf7\xcb\x76\x6d\xf6\xb3\x71\x06\x67\xf5\x9c\xf1\xe4\xff\x52\xe0\x7a\xb0\xc2\xfc\x39\x60\xfa\xdd\xf4\x16\x06\x33\x31\xe7\xd5\xbf\xaa\x08\x5f\x03\x69\x5e\xcd\x77\x91\x41\x32\xa6\x5c\x34\x91\x18\xb1\x3d\xd0\xf1\xd2\xba\xcc\xb8\x31\xc2\xc5\xed\x19\x3c\x9f\x67\x8a\x30\x5c\x94\x42\x1a\xcd\x87\x64\x26\x93\x60\x34\x88\x1a\xd8\xc6\x31\x40\x48\x02\x26\xc1\x9c\x97\x69\x11\x0c\x0c\xeb\xad\xf2\xde\xa6\xc6\x0c\xf3\x31\x4c\xb3\xa4\xaf\xfe\x7a\x91\x24\xb0\xd4\x0f\x19\x01\xa9\x00\xd6\xe3\xc8\xff\x5e\xfe\x89\xcf\x91\x19\x9d\x1d\x41\x8a\x2a\xe8\x23\x4f\xdf\x09\x00\x72\xe3\xc4\xed\x1c\xa3\x39\xc5\x6f\xd6\x61\x93\x6a\x5f\xdb\x1a\x16\xbd\xdf\x7e\x8b\xec\xec\xa7\xc8\xa4\xb7\xfa\x74\xaa\x92\xc8\xc9\x68\xe0\x1d\x29\x3a\x90\x9a\x57\x9e\x04\x52\x71\xa0\x96\x50\xe4\xe5\x75\xb4\xb1\x5e\x26\xd1\xfd\xb2\x56\x29\x45\x3e\xdf\xf9\x19\xe2\x44\x08\x57\x08\x87\xc2\x25\xad\x5a\xaf\xc2\xad\x1f\x1b\x03\xff\x15\x4b\xd1\xdc\x62\xfd\x60\xff\x2f\x01\x48\x96\x37\xb9\x7b\x53\xd2\xa6\xf5\xd4\x20\xe4\xa0\x17\xd2\x71\x2b\x66\xba\xec\x3b\x41\x02\x69\xd8\x6c\xe1\x35\xed\x01\x2e\x5d\x74\x53\xff\xbb\xa9\xff\x03\xe5\x88\x88\x15\x47\x25\x5b\x24\x90\x6d\x1b\x37\x1e\xe4\x73\xbd\x5b\x83\xcf\xb7\x16\x3a\x82\x81\x7b\x3e\x66\x43\xa1\x1a\xb8\x83\xb3\x76\x29\xac\xdd\xae\xbe\x4d\x63\x89\xf9\x90\x06\x44\xdb\xdd\x9c\x78\x31\xfe\xe5\x3d\x62\x11\xc8\x5a\xb5\x22\x42\x8f\xfc\x58\x41\x39\x1c\x28\xea\x66\x74\x30\x24\x1c\x32\xbf\x55\x59\x89\x73\x18\xc1\xae\x30\xbc\x7d\xb8\xe9\xb6\x2e\x6a\x6b\xd1\xd4\x9f\x8f\xcb\x1d\xb0\x14\x3d\x3b\x1d\x9f\x6a\x81\x53\xa3\xbd\x54\x7e\x47\x3f\x23\xa6\xef\x29\xe0\x30\x7f\xe8\xb7\x71\xb6\xee\x30\xa7\xc8\x5b\xb7\x7b\xac\x84\x2b\xfa\x02\xc9\xbe\x84\x61\x88\xff\x0a\x68\xf5\x12\xfa\xd5\xb7\x88\x7d\xbb\xb6\x9b\xe3\x66\xf8\x23\x20\x5d\xcb\xcb\x51\x14\x2a\x5b\x14\x2a\x57\x0e\x4b\x04\xe9\x0b\x61\x90\xe6\xbf\x5a\xe0\x27\xb3\xfa\xed\x56\xeb\x63\x2b\x7d\x37\xfb\x4d\x51\xa2\x70\x61\xc7\x5f\x6e\x4d\xd6\xcf\x9b\x53\xaa\x0a\xa2\x4e\x2e\x1a\x04\x81\x83\xf2\xc1\xa4\xcd\xe9\x8e\x3e\xf8\xba\x35\xf3\xbd\x1a\xd2\x7f\x95\x65\xd4\xc8\xe7\x8a\x67\x64\xd7\xb0\x48\x96\x84\x64\x4e\xca\x49\x44\xa1\xa1\x07\x5a\xb4\x3f\x07\x19\x24\x47\xe5\xa8\xbb\x93\x67\x1b\xae\x56\x0d\xbd\x77\x58\xc3\x3d\x5c\xa5\x2d\x7d\x13\xfb\xbe\x1a\xec\x2d\x09\xf9\xb6\x4f\x7c\x62\xb3\xd2\x1c\xb9\xf1\x58\xa6\x36\xf6\x05\xbe\x80\x07\xb7\x31\xa4\x5b\x31\xc8\x33\x7a\xd4\xef\x5d\x7f\xcc\x99\xd2\x34\x8b\x7d\x63\x70\x06\x25\x17\x15\x33\x2d\x74\xd6\x34\xff\x0c\x09\xff\x72\x5b\xb6\x69\xd2\x72\xcb\x1a\x53\x30\xb0\x95\xad\xcd\xa3\x01\xcd\x9e\x7f\x4d\x92\x5b\x69\x14\x49\x2e\x51\xe5\xb9\x80\x3b\x51\x86\xb0\x9e\x00\x1c\xe8\x03\x70\x0e\xff\x0a\x79\xfb\xc0\x48\x40\x1c\xef\xa5\x58\xd5\xa2\xf3\x01\xb4\x06\xc9\xe3\xc4\x27\x47\x39\xbd\x0b\xa7\xf8\xb9\x0a\xd8\xee\x46\x24\x0d\x05\x96\x9f\x1d\xc0\x5c\x45\xf3\xa1\xc1\xcf\x15\x57\x3d\x2e\x6e\x04\x8f\xfa\xd1\x50\xd5\x80\xda\x13\xfe\x1d\x0c\x32\x30\xb0\x3f\xfc\x94\x07\x39\x06\x11\x11\x37\x0c\x2f\xcf\xed\x2b\x9e\xd8\xa2\x01\xb1\x9d\x0a\xed\x75\xe9\x3d\x68\xde\x57\x53\x49\xba\x5d\x80\x5e\x2a\x2e\xce\x7a\xc5\xdd\x7a\x6a\xf6\x8a\x2c\xaa\x8e\x3a\x27\x85\xd8\x23\x5a\x4a\x07\x04\xb7\x7c\x64\xca\xa9\x67\x2c\x2d\x3f\xc6\xd3\xf2\x89\xd8\xca\xdc\xc3\x4a\x1c\xa5\xf7\x47\x38\xd2\x37\xfd\xa5\xfe\x21\x09\x42\x15\x42\x21\xd9\x64\xcb\x23\xb0\x97\x2d\x0a\x31\xcc\xdc\xbd\x15\x0c\xc8\xe9\x72\xb7\x66\x3a\x13\xdc\xc1\x41\x8e\xf9\x2f\xaa\x30\x1a\xe9\xd7\xff\x63\x58\x8c\x39\x21\x8b\x7f\xc4\x43\x7b\x6d\x56\xc6\xe8\x22\x43\xb4\xe0\xe7\xac\x08\xea\x6d\xbe\xb6\xd2\xbc\xb4\xb1\x47\x4f\xf0\x7e\x1e\x4d\x44\x9f\x44\xf0\x21\xef\x0f\x16\x37\x85\x1e\x26\x4e\x81\x80\x5f\x57\xe1\x94\x65\x6f\x11\x10\xdb\x27\xac\xa4\x1c\xfa\x70\x2a\xc6\x86\xee\x8d\xfc\x00\x2b\xb7\xaa\x14\x2f\x56\xee\x84\x73\x2f\xd5\x0d\xd4\xf5\x76\x61\xd1\x0d\x0c\x18\x90\xa2\xdf\x0b\x78\xc3\x97\x90\xca\x92\xec\xf1\x64\xb4\x24\x7c\xc8\xe5\xbe\x76\x11\x6a\xb0\xea\xea\x16\x51\x28\xf5\xfc\xd4\x2c\xd4\xc8\xdb\x0f\x62\x7c\x24\xf8\xcc\x29\xc8\x93\x78\x0f\x1f\x60\x48\xab\x0d\x81\x78\x9f\xa6\xe3\xb2\x0c\xb4\xb2\x4a\x06\x94\x42\x42\x56\xa2\x73\x56\x71\x17\x11\x59\x2f\xfb\xbd\x9c\x03\xcb\x93\x02\x6c\x14\x41\xeb\xc3\x1d\xde\x7d\x43\xa5\x66\xaa\x8c\x05\xbe\x00\x9b\x7b\x5c\xe5\x68\xab\x06\x14\x7f\xf4\x1e\x3b\x8a\xbc\x7f\x8f\xdd\x25\x26\xb6\xb0\xa3\x9e\x95\x93\x2c\xcd\x40\xd1\xde\x74\xfc\xf7\x22\x40\xb8\xdb\x5e\xc0\xc7\x41\xe8\xf5\x45\xa3\x0c\x1c\x63\x50\xa1\x3a\xbb\x62\xf8\xb9\x1f\x63\xa1\x0b\x6b\xfc\xce\x67\x1d\x74\x7a\x05\x46\xe2\x67\x4e\xd2\x88\xef\x37\xfe\x4a\x11\xb3\xf0\xbd\x55\x0d\xbe\x9b\xfe\xc3\xb9\x4d\x67\x9c\x0f\x11\xc4\x17\x21\x4b\xf6\xc3\x5d\x15\xe6\xf7\xc2\xbd\xee\xba\xdc\x05\x8b\xe2\x58\x20\xc0\x5c\xe2\x82\x5d\x1a\x8b\xdc\xf1\x0f\x6f\x3a\xec\xee\x20\xea\x71\x51\x87\x73\xaa\x15\x38\x42\x95\x0f\x76\x34\x09\xd0\xa2\x52\x85\xcc\xbc\x92\x62\x88\x58\x60\x4d\x80\x7d\xeb\x70\x23\xe9\x5e\x83\x60\x4d\x54\x56\x98\xf6\x08\x64\xde\xe2\xc2\x4d\xbe\x0d\xb2\xf3\xff\x2d\x7c\x23\xcf\x9c\x54\xec\x52\x2f\x07\x03\x63\xc6\x64\xc7\xc7\xbc\x39\x6d\xe1\x2d\xd4\x86\x9a\x2e\x5d\xce\x82\x8d\xdf\x01\x24\xcb\x16\xa4\x53\x13\x1c\x68\xcf\xf8\xdb\x2b\xc7\x5b\x36\x30\x76\x35\x3f\x5c\xcf\xcc\xc9\x19\xd8\x97\xa4\xb1\xe1\x30\x6f\x38\xf1\x27\xfc\xbf\x97\xaa\x8b\x34\x54\x95\xde\x47\x0f\xcd\x81\xa8\xbf\xb5\x15\xd7\xa8\x4b\xec\x8e\x6e\x04\x7a\xf8\x3c\x96\x2b\xb6\xd7\xd2\xa6\x63\xea\xe9\xbb\x5b\x9b\x69\xb6\xfe\x35\x29\x64\xe4\xc6\x50\x89\x99\x75\x50\x5c\xaa\x62\x21\x1e\x8d\x47\x22\x6f\xb6\xb5\x7d\x71\x45\xbb\xe9\x6a\x96\x86\x63\xa0\x04\x14\x8d\x2f\xef\xc0\xe4\x5d\xf3\xe5\x1a\xc1\x77\xa8\xca\xde\xda\x14\xad\x8d\x71\x3a\x87\x73\xa7\x84\xca\xb9\x43\x8c\x9e\xc9\x25\x12\xf3\xf5\x8f\x70\xfe\x74\xb3\x76\x5f\xa4\xf0\xac\x80\x8b\x99\xae\xbe\x7a\xcf\xcc\x60\x03\x3f\x91\x7d\xaf\x06\x64\xf0\x12\x12\x47\x3c\x38\xdd\x27\x70\x44\x0e\x54\xf0\xea\x49\x4f\xe2\xc8\x1c\xdb\xaf\x23\x7b\x81\xbb\x6b\x98\x82\x9c\x37\x46\xb5\xfd\x93\x9a\x6c\xc5\x88\x04\x0c\xd0\x8c\x75\xec\xa8\xed\xfb\xbf\xff\x0a\x78\x4f\x2d\x25\xb9\xb7\x8a\x92\x3a\x68\x90\xa9\x08\xe8\xac\xa0\x08\x56\x7d\x72\x88\x09\x5b\xbf\x51\xeb\x03\xbd\x67\x11\xfb\xd4\xae\x48\x32\x07\x96\xe6\x6c\x0b\x63\x6e\x31\xf8\xdc\xfe\xd9\xaf\xe2\xc0\x2b\xe7\x72\xf0\x52\xf3\x4c\x25\xd2\x17\xd4\xc1\xfc\xd1\xaf\xc9\xce\x43\x31\x20\x6d\x67\x55\x88\x43\x73\x0a\x4c\xa2\xf8\xda\x5f\x1f\x23\xe2\x3d\x90\xe8\xdc\x54\x8a\x87\x22\xce\x80\xef\x04\xbc\x93\x35\x25\xe1\x56\xf4\x94\xf6\xea\x59\x82\x81\xfb\x94\x92\xfd\x9f\xe1\x31\xae\x78\x3d\x13\x4c\x4a\x24\x62\xcb\xd2\x81\x0e\x08\x36\xe3\x5d\x40\xc8\x62\x28\xe7\x7a\x47\x30\xb2\x4f\x53\x7d\x09\x3b\x02\x96\x22\x83\xb5\xe5\x61\x5d\xb6\x3d\x5b\x0f\x4b\x72\xcf\xa2\x43\xa3\xe7\xec\xaf\x87\x2a\x5a\x2d\xaa\x24\xe8\x7d\xe4\x8a\xf5\xe9\x7d\xc9\xfe\x23\x29\xe7\xc2\xfd\x27\x49\x9e\x58\x6e\xc6\x9f\x3a\xa0\xad\xa0\x98\xe6\x27\xc0\xb0\x6e\xec\x18\x4a\xea\xba\x69\x1b\xb1\x4a\x07\xb9\x3c\xed\x14\x4f\x1a\x4d\xbe\x43\xc0\x85\x4b\x54\x43\x44\x0c\x55\x04\x13\xb9\xcc\xa5\x0b\x31\xec\x41\xec\xd2\x4e\x6b\x3b\xe2\x1d\x9f\xa1\xa7\x8d\x6d\x08\x7a\x0b\xae\x8f\xd7\x4c\xd7\x3b\xb2\x7b\x55\x98\xd3\x26\xc4\x17\x9b\x72\xe8\x81\x6a\x86\xc8\xc6\x37\xa1\x8e\xcd\x24\x7c\x41\x55\x4a\x9d\xe9\x4c\xba\x6f\xf6\xbd\xcd\xd5\x4f\xf7\x81\x9d\xa3\x3d\x9d\x78\x1d\xb0\x53\xc5\x77\xd9\x21\xf6\xc7\xb7\x60\xf7\xf7\x6c\xb7\xd7\xb6\xd1\xe5\x6d\xcf\xd3\xb8\x66\x0a\xbf\x28\x4f\xe1\x63\x19\x0e\xa2\x79\x8e\xb0\x1b\xb5\x49\xf5\x3f\x4c\x1c\xfd\x38\x84\x23\x04\xef\xc7\x7a\x34\xf6\x32\xef\xbe\x83\x36\xb1\xf0\x92\x3c\x64\x81\xdd\x9c\x6a\xfa\x59\xaf\x3d\x49\x69\x4a\x2e\x95\xc8\x06\x3d\x8e\x46\x92\x42\x8b\x97\x9b\x9b\xfd\x22\xe2\x28\xec\x2e\x54\xe7\x37\xd3\x48\x34\x87\xac\x65\x3a\x3f\x03\x1c\x4e\x85\x18\x27\x1c\xe1\xc9\xc8\xc0\x79\xd2\xa5\xfd\xc2\x6d\x8b\x9b\xed\x6b\x45\x50\x61\xe0\x27\x82\x96\xea\x29\xf1\xc6\x84\xd1\xac\x22\xba\x30\xa4\x54\xc7\x6b\xc7\x8a\x4e\x95\xa2\x3d\x0d\x18\x98\x9f\x1d\x20\xb7\xd0\x33\xe1\x54\x4d\x83\x3e\x9d\xa5\x3c\xad\x51\xd1\xb8\xfa\xc7\x0e\x1b\x06\x2a\x03\xce\x9b\x6a\x41\x2b\xeb\x27\x7f\xb5\x78\x99\x2b\x09\xb1\x77\x80\xdb\xf9\x16\x56\x57\x46\x27\x0a\xd5\x41\x34\xc1\x77\xe8\x7b\xee\x16\x44\x11\xd6\x7e\x38\x72\xc8\x47\xd2\x6b\xd9\x05\x4f\xba\x93\x9d\x14\x8c\x72\x26\x1f\xf3\xd4\x31\xfd\x42\xc6\xfe\x99\xa5\x47\x67\x9d\x0e\x1d\xed\xee\xd3\xa0\x09\x7f\x1a\xe6\x00\x63\xbe\xde\x8c\x12\x63\xa5\xb2\xb8\x1e\xff\x68\x8d\x83\xf4\xec\xdd\x31\x1d\x75\xfc\xc9\xc4\x0b\xe1\x74\x54\xef\xb8\x91\x2a\x98\x34\x0c\xca\x9a\x06\xdc\xd9\xe9\xc5\xbe\x4e\xef\x08\x2b\x79\x87\x98\xf9\xaa\x7e\x3f\xf8\xaa\xe3\xf7\xe6\x18\x28\xdb\x2f\x79\xe5\x16\xed\x90\x9c\xc7\x79\xc6\xdf\x70\x4a\xc5\x9a\xc3\x93\x98\xe9\x7b\x4a\xd2\x3a\xa1\x1e\xa4\xd1\xdd\xfd\x9b\xc4\x40\xe9\xb3\x45\x99\x60\xbd\x1c\xe1\x13\x18\xf9\x48\x10\xb1\x43\xc4\x2d\xdc\x96\xce\xb2\x41\x24\xe9\x04\xd4\xec\x59\x25\xd7\xb5\x91\x90\x5c\xff\xa1\x8d\x57\x57\x2b\xf0\x6e\x3a\x7f\xba\x94\x07\xdb\x01\x2e\x64\x45\x81\xb0\xdb\x68\x04\xe0\xf5\x33\x8a\x40\x62\xbd\x19\x8f\x0a\x59\x1e\x46\x00\xe3\x22\xce\x32\x82\x49\xdd\xd5\xd2\xaa\x75\x15\xf6\x5e\x56\xfe\x55\xb9\xfc\x3a\xbf\xce\x27\x9c\x3e\x42\x60\x85\xdf\x6a\x23\x08\x20\x64\x84\x10\x16\x5a\xb8\x4d\xc8\x05\x5e\xa4\x0e\xc8\x0c\x59\xb1\xe7\xc5\x79\x7e\x1d\x48\xe9\xa4\x41\x82\xb7\xcc\xb9\xe8\x26\x1a\x22\x26\x80\x7e\x99\x48\x3e\xe2\xdd\x87\x13\x8a\x6e\x7c\x8d\x93\x88\xbb\x41\xb3\x88\xe6\x77\x6a\xdb\x19\x26\x48\x3d\xcb\x2b\x54\xbf\x2a\xde\x46\xee\xea\x79\x40\xf5\xaa\x31\x56\xba\x56\x49\x14\xdc\x6b\x12\xa6\x43\x4c\xbd\xc0\xd4\x75\x69\x7c\x94\xdf\x11\x66\x2d\x08\xa4\xc1\x5a\x47\x7f\x92\x5b\xa7\x35\xe4\x3f\x96\xc4\x76\x6b\xeb\xa2\xeb\x01\x18\x8a\x50\xb5\x4b\x68\xde\xd7\xf1\x8c\x49\x08\xd4\x5b\x7e\xd3\x16\xbb\xbd\xbd\x4f\x27\x03\x93\xae\xb2\xec\x2f\x50\xa3\x8b\x5d\x0c\x30\xab\x53\x71\x58\x9b\x40\x23\x74\x9c\x6c\x4d\x22\x2f\xbf\x13\x8f\xa9\xcb\x2f\x9d\x84\xd7\xa4\x19\x4b\x96\x69\x83\xd5\x90\x2c\x25\xcf\x5f\xa0\xe5\x42\xa2\x7e\xf8\x60\xe8\x18\x85\xa3\x25\x6d\xb1\x86\x39\x60\xb7\x4f\x4b\xbc\xb1\xc3\xd2\x73\x5e\xc9\xca\x9a\x6e\xd1\xb2\x4a\x98\x37\x67\x45\x4f\xbc\xaa\x10\x8f\x57\xf8\xd2\x7a\x6a\x56\x11\xe8\x15\x5c\xb6\xf3\xa6\x95\xef\x99\x2f\xb5\x36\xbd\xc8\x2b\xe8\xc6\x27\x3e\x1e\xf9\x47\x48\x14\xf6\xb5\xd2\xac\xf0\x50\x92\x5c\x1b\x20\x31\x77\xdc\xc7\x26\xe9\x37\xa4\xdb\xeb\x6e\xc7\x35\x71\x5a\x9f\x7e\x3c\x5c\x79\x9c\x74\x5f\x05\x5e\x80\x9b\xe8\x33\x70\x6a\x31\x82\xfa\x49\xf2\x5f\x95\x55\x6e\x0d\xca\xfb\xd2\x4c\x29\x86\xbb\x7f\xc8\xe7\x85\xf9\xa8\x89\x74\xc1\x35\x3a\xef\x3e\x1c\xa1\x0f\x36\x24\x73\x55\x84\x89\x2c\x20\xff\xd2\x2f\xaf\x6b\x8c\xc9\x04\xfd\xcc\xa6\x50\xbe\x4f\x39\x45\x7e\x37\xf5\xc7\x23\x1b\x42\x90\xb6\x94\xa2\x6a\x77\x1a\x5b\x96\xf1\x97\x39\x39\xfe\xc0\xa9\x71\x89\x59\xf7\x13\xfb\xcc\x49\x46\xb6\x75\xfe\xe2\xc7\xc2\xcf\x8d\x96\xe0\xf0\xc0\xf1\xbb\x67\x39\xb5\xe5\xe6\x85\x42\xc0\x1c\xa5\x51\x16\x7d\x65\x38\xea\x2d\x04\x2b\xec\xdb\xca\x57\x86\x06\xf6\x4f\x1a\x0f\x12\x79\x67\xe0\x0c\xdb\x7d\xb4\x44\xc1\x45\x54\x51\x78\x87\x39\x54\x7d\x2b\x1d\x03\x6c\x6e\xfe\x9d\xe4\x75\xa7\x70\x3e\x19\x58\xf5\x38\x38\xd5\x71\xff\xee\x8e\x08\xf7\xc7\x5e\xab\xf2\x10\x52\xc1\x9e\xdc\x9b\xba\x28\x22\xa9\xab\xcd\xc8\x66\xfb\x51\x14\x73\x1a\x24\x87\xbd\x75\x5b\xd0\x69\xd8\x9b\xab\xef\xed\x6f\x24\xa8\x89\xba\x3b\x0e\xdb\x80\xe1\x55\xce\x3b\xa5\xf0\x78\xec\x35\x35\xfb\xe4\xdd\x4b\xfa\x8f\xcb\x1f\xde\x6d\x03\x84\xa7\xfa\xcf\xdd\x18\x80\xa8\x8a\x4b\xec\x28\x0f\x72\x20\xfc\xfe\xf4\x44\x86\x07\x01\x30\x21\x60\xe9\x08\x73\xb2\xab\x04\x52\x75\xe9\x8e\xd8\xc1\xe7\x0e\xc1\xb4\x7d\x10\x3b\x15\x52\x66\x97\x36\xa8\xe4\xf7\x54\x2f\xd4\xad\x23\x73\x15\x97\x00\xaf\xf2\x7c\x8a\x10\x71\x0f\x81\x0e\x14\x9a\xf0\x82\x21\xe1\x0b\xbc\x5a\x78\x11\x30\xea\x80\x22\xfe\xf6\x89\xe1\x7e\xbb\xb8\x6c\x5f\x1a\x51\x92\xd6\xe9\x76\x83\x89\xd8\xc6\xf8\xc0\xb5\x89\x5b\xad\xd6\xfa\x91\xd0\x72\x52\x61\xb8\x35\xe1\x0b\x62\x90\x78\xa3\x7d\xab\x8f\x36\x31\x13\x09\xef\xef\x2a\x27\x12\xb0\x25\xd8\x73\xb9\xa8\xcd\x21\x2b\xf0\xdf\xfd\x9e\xb2\x6b\x98\x37\x19\x52\x77\x83\x44\x51\xb7\x23\x91\xf3\x23\x98\xf1\x2f\xc2\xfa\xfe\xea\xef\xe4\xf3\x3b\x90\x6c\xdd\x63\x8c\xd1\xbb\xdf\x86\x25\xe8\xde\xd6\x83\x69\xde\x2e\xa7\xce\x49\x54\x77\x18\x04\x47\x49\x04\x5f\xe0\x16\x73\xdc\x35\xbb\xf1\xbb\x44\x6d\xa2\xb9\x4a\x79\xd0\x81\x56\xb7\x2a\xee\x50\xbf\x70\x9f\x07\x0f\xcf\x67\x8d\x2d\xd2\xca\xcb\xfe\xe6\xbc\xd1\xeb\x71\x67\x59\xca\x91\x84\x61\xe1\x6c\x16\xb3\x60\x96\x01\xe9\x48\x0f\x5a\x08\x1c\xe4\x1a\x65\xd8\x92\xd1\x75\x82\xaa\xf2\x87\x33\x39\x48\xb9\x3c\x40\x17\x21\x8c\xcf\x90\xd4\x60\x11\x85\xf3\x5d\xdf\xa6\xf9\x04\xd0\xb4\xb4\x3f\x65\x8b\xbb\xae\x59\x16\xa7\x6f\xcb\x54\x14\x43\x00\xe7\x18\x07\x8a\x2e\x4f\xea\x60\x5d\xfe\x10\xec\x76\xb2\x4c\x42\x30\xf6\xe6\x77\x4c\x97\x36\x99\x16\xc9\x7e\x03\x4d\x2a\x91\x34\x76\xa3\xf0\x49\xd6\x63\x14\x78\x08\x83\x38\x1c\x38\xff\x64\xf6\x62\x6f\x8c\xf6\x38\x7f\x43\xc1\x19\x2d\x9d\x67\x80\x39\x69\xb8\x2e\x73\x98\x5b\x43\xae\xa0\x3d\xc7\x7e\xd5\xa2\x44\x7d\xf2\x97\xce\x4f\x88\x94\xdf\x0d\xed\x3e\xaf\xdb\x76\xf0\x97\xf2\xf1\xec\x36\x9d\x49\x4f\x29\x41\x10\x18\x23\x2a\x68\x14\xb4\x6b\x77\x5c\x0b\x7a\xb5\x9a\x52\xb3\xfc\x66\x9b\x2c\x77\xc1\x12\x36\x74\x6b\x98\x77\xd8\xed\x06\xec\x5b\xe3\x97\xfd\x3e\xca\xd3\x07\x6d\x7b\xb3\x81\xb1\xed\xbd\x51\x91\x77\x7b\xc6\x4a\x7e\xdb\x53\x4b\x96\xa4\x3f\x51\x3d\x23\x3f\x3a\xc4\xb4\xdb\x67\x4c\xdc\x13\xb7\xfc\xee\x65\x40\x64\x77\x2a\x33\x63\x63\x20\x93\xe1\x36\xc8\x46\xce\xeb\x0f\xf1\x93\xc5\x82\x5a\xfb\xf5\x27\xfa\x48\xc1\xd7\xe3\x63\x58\xfc\x8e\xe2\x74\x2f\xb9\x45\x7d\xda\x55\xc7\x56\xed\xe0\x86\xe4\x86\x0a\xfc\xa7\x5a\x95\x43\xf1\x97\xd9\x51\xd9\xbd\x08\x16\x0e\x4b\x51\xa2\x7f\x2e\x45\xe5\x4d\x78\x36\x8f\xe0\x30\x1d\x95\x97\x3d\x44\xef\x07\x41\x85\xf1\x10\xd4\x89\x05\x6f\xff\x71\x49\x43\x54\x50\xf6\x1e\xd5\x67\x5a\x78\xe3\xb5\xb1\x8a\xbd\xd5\x9d\x5f\x65\x79\xf8\xd7\x91\x43\x02\x61\x7c\xea\x66\x39\xf8\x4e\xac\x05\x4f\xc9\xec\xad\x76\xe9\x25\x16\xb1\x3b\x53\x54\xd2\x2b\x2b\x30\xc9\x2e\x52\x87\x11\xfa\xda\xe4\xbe\xfd\x72\x33\x1f\x3b\x9d\xfa\xc6\xb4\xdf\xe1\xfc\xb5\x09\x05\xea\x13\x0c\x57\x65\xf6\x71\xea\x28\x3b\x82\x19\xdb\xd5\xe3\x4f\xca\xa6\xf0\x50\xdc\xf8\xe4\xe4\x74\xca\xfb\xa6\xe7\x2f\xfa\x26\x77\x4a\xd9\x65\xd3\x16\x3e\xa7\x91\x1c\x5d\x42\x71\xee\x37\x06\x1b\xb1\x49\x26\x78\x57\x8e\x3c\x10\x78\x6f\xe8\x50\xf9\x88\x1c\xe7\x59\x07\x7c\xe4\xc9\xe4\xb2\x6b\x9e\x55\x35\x6e\x89\x2b\x0f\x0d\x4f\x94\x31\xa3\xed\xdc\xee\x82\xf1\xf0\x21\x7d\x9c\x59\x82\x57\xc1\x96\xa6\xcb\x50\x84\xc7\xc2\x03\x24\xd2\xf9\xa8\x70\x55\xcb\x7c\xd0\xec\xd6\x9a\x03\xe5\x31\xef\x20\xac\x8a\x89\x7a\x2f\xa5\x72\xc5\x40\xb2\x3d\x32\xb5\x41\x4a\x55\xfb\xef\x36\xac\xb8\x48\xc8\x08\x4c\xda\x9a\x80\x90\x13\xa9\xaa\x34\xcb\x80\x56\x3b\x87\x5b\x55\xec\x32\xec\xd6\x38\xf5\xbc\xb7\x60\x6b\xff\x94\x20\xd0\x4a\xf1\xb4\xeb\xef\xae\xd3\x08\x14\x58\x96\x68\xfb\x87\x8e\xb6\x97\x4c\x20\x31\x91\xba\xc8\x05\x38\xe0\x42\xa5\x62\x72\xd5\x6c\xf3\xd6\xa6\x61\xb7\x10\x3b\x3a\x85\x1b\xce\x59\xd8\x2d\xd2\x1c\x48\x05\xb4\x67\xea\x0e\x38\x53\xd6\x50\x7a\x8a\x50\x84\x29\x8d\x3c\xbb\x06\x3d\x89\x91\xee\x6d\xc8\x3a\x72\xa7\x86\x48\x71\x3e\x5b\x64\xde\xa9\xc1\xa6\xef\x6c\x3c\xcc\x52\x0b\x2b\x7e\x3a\xd0\xf4\x2c\x9c\x27\x3d\x19\xdf\xcb\xdb\x09\xf3\xd4\x80\xd8\x6d\xa3\xdc\x28\x57\xc1\xd6\x27\x02\xc0\x7a\x44\xad\xb9\x84\x87\x05\x68\x11\x9c\x09\x15\x69\x59\x40\xce\xa4\x5c\x20\x0b\x8f\x94\x7d\xf7\xd1\xca\xa9\xbe\x2a\xf5\xbf\xce\x41\x92\x25\x6b\x76\x89\xb4\x0f\x4f\x63\xe2\xf9\x37\x25\x19\x56\x61\xa5\x00\x18\xd1\xd5\x7c\x75\xec\x25\xac\x33\xfc\xd6\x0b\x6b\x40\x0a\xd9\x7f\xce\x19\xf8\x88\x8a\xc2\x23\x3a\xa9\xae\x46\x4c\x4e\x07\x97\x78\x2a\x0a\x69\x16\x82\x0c\x45\x39\xd7\x76\xb0\xe4\xe5\x02\x3f\xf7\xe3\xbe\x59\x10\xbf\x07\x60\xbf\xaa\xd4\x02\x74\x8f\x69\x91\x96\x4c\xa5\x7c\xc7\xfd\x8e\x72\x52\x70\x12\x18\x07\xb4\x95\x78\x15\x1e\x61\x6e\x4b\xed\x37\xca\xbd\xcd\x1b\xed\xfb\x2a\xd1\xaf\x2b\xa9\xde\xba\x30\x2b\x73\xc6\x8c\x1d\x67\xbd\xb4\xad\x8b\xfc\x73\x4f\xf7\x9d\x52\x30\xc0\xba\x87\x91\xc7\xfd\x69\x64\x5b\x44\xaa\x86\x37\xcc\x27\xa8\x09\xdf\xa8\x2a\xd1\x65\xa6\x17\x29\x09\x22\xb8\xe5\x2d\x34\xf8\x2e\x11\x79\x38\x95\x2d\x30\xa1\x43\x41\xbe\xbb\x84\x32\x7b\xdb\xb7\xf7\x2a\xa4\x65\x21\xdc\xbf\xff\x3c\x01\x77\x2b\x0e\xfd\x4b\xe0\x5d\xcf\x13\x07\x76\xe6\x1f\x3f\x68\x9c\xdd\xa0\x62\x10\x0e\x20\x74\x56\x2e\x79\x95\xfa\xca\x8e\x3d\x22\x85\x6b\xa3\x52\xc0\x51\x3b\x29\x55\xa5\xcf\xd4\x60\x64\x99\x63\xe3\xd8\x3b\xb5\xfd\xc1\x91\x21\x4b\xc1\x93\xae\xf3\x16\x2d\x7c\x8d\x3b\x1b\xc0\x26\xe7\x5d\x1e\x31\x44\x5f\x1f\x1f\xd2\x02\x6e\xd2\x18\x21\xbf\x23\x2b\x65\x69\xa2\x34\xb7\x98\xf4\x53\x12\x61\xec\x0f\x2a\x2e\x82\x03\xb7\x0b\x4b\x99\x33\x09\x45\x33\x55\xa0\xb3\x93\x5f\xd8\x55\xe6\xa7\x35\x7a\x3e\xf2\x9a\x3e\x67\x84\x9d\xdd\x67\x06\x50\xcc\xbb\xdf\x6a\x82\x00\x71\x06\x99\x54\xa0\x74\xd5\x00\x2d\x98\x77\xae\x0b\x92\x31\xfb\x92\xbe\x01\x84\xf2\x67\x3c\x8f\xea\x93\xde\xe7\x72\xc7\x5c\xef\x19\xac\xaf\xa7\x70\x9b\xc0\x8a\x20\xf9\xa5\x47\xa2\x95\xce\x32\xc9\x23\xc7\x7e\x80\xea\x86\x75\xa6\xbb\xa5\x52\xe0\x7b\xe6\x9f\x00\x78\xd4\xbd\x2d\x46\x4f\x2f\x8b\x66\xec\x9f\xf6\xb2\x8a\x9f\x6c\x87\xf7\x2d\x4f\x3a\x3b\x2b\x23\x0f\xc5\x27\x49\x9d\xdd\x00\x9a\x10\x2c\x6a\x59\xad\xc3\x3e\x97\x36\x63\x93\x2d\x4a\x07\xdd\x0d\x9d\x0b\xe6\x59\xca\xf1\x60\x3c\x7a\xf0\x3d\xcb\x4d\x8c\x5f\x56\x8a\x31\xac\x05\x1a\xc2\xf0\x54\x3d\x26\xe7\x6d\xbc\x41\x8f\x1c\x34\xa1\x26\x0d\x7d\xc7\x04\x11\x23\x5f\xea\x1f\x5e\xc1\xd8\x45\x51\x99\x5a\x4e\xad\x86\x75\xd5\xee\x3e\xc2\x9d\xaa\xd2\xe0\x20\x5f\x62\x54\x97\x1d\x67\xb7\x73\x15\xdd\x11\x2d\x8f\xe3\x4d\xb4\x13\x98\xc1\x0e\x57\x0c\xe5\xec\x88\x9c\x82\xfa\x06\xf7\x62\x21\xdc\xa0\x12\x78\x9d\x0a\x99\x4f\x58\x67\xc4\x93\x38\x93\xfc\x1c\xe1\x5a\xec\xdd\x20\xf2\x46\x39\x86\x3f\xe4\xbe\xf0\x33\xd5\x3f\xe8\x10\xab\x94\xf9\xa3\xa9\x9f\x8f\xb4\x33\x7f\x05\x93\x67\x19\xa8\xd8\x81\xfb\x24\x6d\xc4\xfe\x0c\xab\x33\xe9\xa4\x4d\xa0\x63\x53\x63\xb6\x95\xb8\xc3\xf5\x79\x14\xfa\x2c\x31\x3f\x93\x22\xa3\xf5\x7a\x5a\x21\xfc\x57\x5e\x62\xa2\x8e\x8b\xbe\xca\x0e\x59\xd9\x10\xad\xe9\xbf\xb8\x25\xfb\x12\x46\xe8\x9b\xd7\x71\x88\x8e\xd1\x30\x9f\x08\x20\x6f\x46\x78\x22\xea\x76\x8c\xf1\xf8\x52\x22\x11\x11\x34\xd6\x34\x2d\xba\x57\x45\xa9\x70\x22\x45\x84\x74\x58\x5d\xfb\x6e\x66\x0b\x1c\x43\xcf\x9b\x68\x2a\x08\x54\xcd\x91\xbe\x35\x67\xb2\x89\x6c\x2b\x79\x09\x98\x95\x3f\xf2\x1f\x36\x66\xd6\xc1\x1f\x3e\x80\x67\xba\x09\x99\x0d\x53\xef\xe5\x27\x38\xc5\x69\x4f\x7b\xef\x85\x79\xd7\xb6\x18\x73\x34\xa6\xa1\xc0\x9f\x42\x28\xe2\x9e\xb6\xfc\x37\x59\x5e\xfd\x54\x4a\x63\x25\x08\x0b\x33\x69\xc4\xbd\x3f\xdc\xba\x61\x54\xde\x51\xba\x11\xf7\x7e\xfb\x92\xd9\x5a\x5e\x09\xc8\xdf\x8c\x5d\xf1\xb3\x7a\xab\xfa\x6c\xee\x02\x3e\x7a\xf4\xaf\x08\xda\xa1\xd5\x00\x14\x5c\xe0\x5d\xd5\xa1\x6e\x7f\xee\xfd\x65\xaf\x6a\x15\x09\x55\xa7\xf7\x15\x0d\x14\xf4\x2f\x9c\xbc\xab\xae\xef\x2b\x77\x07\x58\x7c\xe1\x4a\xd6\x29\x9f\xdf\x41\x0e\xc4\x5c\x47\x83\x91\xab\x9f\xa4\xd6\x73\xd7\x23\x7a\xe1\xdd\x8b\xe0\xd0\x3b\x6f\x47\x0d\x57\x3d\x82\xaf\x8c\x81\x38\x92\x8c\x57\xef\xe5\x4d\xb3\x5a\xec\x28\x64\x71\x75\x25\x9a\xe0\x72\xd0\xae\x08\xe2\xee\x10\x2b\xba\x13\xa3\x6f\x1a\xb7\xb5\x0c\x97\x94\x87\x0b\xaf\x48\xa8\x14\xfc\x33\x9f\x9a\x66\xa2\x44\x65\x81\x5f\x9f\x6f\x0f\x53\xd1\x3d\xf5\x96\x76\x88\x1f\x84\x8e\xf7\x95\x4e\xf1\xda\xa8\x4f\x1c\xc4\x1a\x51\x1c\x1d\xb4\x34\xe2\xd5\x56\xbe\xb5\x57\x1c\xa3\x57\xf1\xf2\x01\x14\x24\xb7\xca\x68\x36\x48\x32\x7a\xdd\x73\xb0\xab\x5c\x00\xad\x3e\x37\xbc\xb1\xad\x72\x27\xd6\x44\x18\xe7\x0c\x9f\xd6\x73\x0b\x67\xa0\x53\x9b\x4d\x78\xec\x63\x90\x76\x35\x4f\x1e\x38\xf0\xe2\x31\xbf\x4a\x10\x04\xc2\xab\xe6\xb4\xf7\xf4\xb5\x45\x01\x71\x45\x05\x51\xcf\x9f\x09\xa3\x27\x3c\x70\x26\x84\x29\xa3\x2c\x0d\x78\x05\x1c\xe1\x59\x77\x20\x5e\x50\x69\x69\xa4\x86\xd8\xe6\x13\x41\x60\x3b\xf9\x24\x56\xda\xfd\x8a\x82\x3d\x38\x6d\xfe\xd4\x59\x63\xef\xc8\xde\xf3\xaf\x04\xe9\x57\x1d\x76\xe2\x1e\x24\x58\x64\xbd\xc9\x07\x5c\x1b\x98\xbd\xc2\x7a\x87\x75\x41\x38\xe7\xdb\x76\xa3\xf7\x09\xb6\x94\x94\x3b\xd8\x13\x73\x2a\xae\xc4\x98\x55\x93\x4f\x2f\x06\xca\xbe\x8b\xda\x38\x6b\x17\x21\x9b\xca\x6a\x37\x2f\x6d\xbd\x0e\xf0\x32\x6e\xce\xad\xea\x87\xe7\x11\xbb\x64\x30\x53\xed\x81\x05\x52\x51\x55\x8d\x6e\x87\xfc\x82\x03\x72\x36\x72\x0c\x28\xf0\x9a\x6a\x9e\x4f\x9a\xd5\x4e\xf9\x56\x5f\xbd\x48\x9c\x3c\xe5\x5f\x7c\x04\xc2\x20\x63\x1f\x21\xdf\x7f\x62\x35\xe3\x15\x02\x6b\x4e\xbb\x97\x7d\x47\xa8\x43\x27\xfb\x4b\xdc\xde\xe4\xd1\xc3\x56\x85\xab\x8e\x5b\x89\x5c\x9a\xc7\xb0\x1d\x1a\x3d\x28\xfb\x11\x9e\xe6\xfe\xe2\xc0\x57\xb9\xd0\xe4\x48\x4c\xca\x24\xad\x6c\x8e\x14\x9e\x2c\x28\x2f\xb7\x14\x65\xa6\x98\x73\xc4\x36\xdc\x3d\x4d\x48\x07\xbd\x8c\x83\x1d\x28\x7c\x51\x3c\x10\xa8\x17\xb1\xac\x05\x62\x82\xc8\xa7\x71\xcd\x7d\x8a\x8e\x70\x34\x8b\x9d\xfe\x28\x1a\x2e\xf5\x07\x3b\xf3\x6a\x07\x95\x3c\x17\x91\xd1\x25\x9b\xb4\x25\xfe\x16\xb4\x51\xca\x01\xee\xe3\x64\xef\x93\x20\xcd\x3e\xb9\x7f\x0d\x3b\x07\x3b\xdd\x7f\xfa\xd0\xf2\x4f\x70\x00\x44\x32\x67\x18\x68\x89\x5b\x4f\x98\x4d\x56\x38\x2d\x8e\x28\x85\xb1\x9f\xed\x53\x21\x53\x61\x5a\x4a\x57\x83\xdb\x8f\x12\x4f\x13\xa2\x2c\x8f\x26\xc9\x67\x7c\x40\x8e\x5d\x89\xc6\x1c\x48\x2a\x0a\x36\xd1\x81\x58\x1d\x02\x84\x80\x11\xa9\x50\x85\x4f\x38\x6f\x9f\x2f\x5a\x36\xa6\x61\xbf\x6d\xab\xd2\xfe\x85\x3e\xa5\xa8\x51\xb1\xba\xad\x70\x4c\x74\x5e\x71\x2b\xdb\xed\x11\x34\x69\x8c\xf9\x14\x8c\x5e\x44\x70\x7b\x01\xbd\x77\xb4\xcb\x56\x4a\xeb\x77\xad\x7d\x63\x30\x79\x4d\x44\x5a\x98\xe0\x6f\xfb\xec\x16\x38\x78\xfc\xc0\x73\x97\x4d\x31\xd8\xc8\xda\x8e\x68\x4f\x9c\x89\x75\x3e\xfe\x9f\x6c\x09\x7d\x91\x0a\x8d\x2c\x6e\x9f\x18\x03\x6c\x38\x78\x4a\x1c\x35\x24\x28\x47\xe1\x18\xd5\x76\x34\x9d\x25\x47\xb4\xac\x18\x39\x04\x17\x3b\x0d\xb4\xbc\x2e\x4a\x1a\xdc\xc3\x6a\x74\xff\xff\x65\xbf\x50\x18\xb8\x67\x6b\x5d\x19\x46\xb3\x63\x97\x20\xf4\xb0\xb9\x76\x0c\xa1\x43\xf4\x23\x73\xb6\x68\x48\xb6\xef\x63\xbc\x0b\xad\xa5\x6a\x78\xdf\xab\x0d\x94\x71\xa1\x32\x7f\xec\x28\x91\x29\xd6\xda\xfb\x8b\xa4\xd9\x71\xf8\x70\xa0\x48\x22\xad\xf4\x66\xc4\xc8\x61\xf5\x11\xa9\xd7\x47\x1f\xf1\x23\xdb\xcf\xa4\x7a\x4d\x1c\xc0\x02\x56\xf5\x9a\xe9\x1e\xb8\x23\x2d\x95\xfa\xdb\x42\x47\x58\x17\xe6\xaa\x3a\x5b\xec\xfe\xd4\xb7\xdb\xd6\xa6\x6c\x7f\xbd\xb6\x0b\x94\x63\x51\x18\xdd\x0b\x03\x2e\x62\xca\x3f\x33\xc8\x4c\x9c\xee\xf3\xfa\xe5\x9a\x7c\x2a\x39\xdb\xcb\x53\xbc\x1b\xf8\x4c\xb2\x67\x51\xd4\xd0\x58\x5b\x1b\x53\x6f\xfb\xfd\xbe\x5d\x2d\x81\x50\x8f\x0a\xcd\xc8\x92\xca\xc2\x1e\x91\xe4\x58\x7b\x73\x7e\x0c\x6e\xb0\x2e\x7c\xf5\x17\xa2\xdf\xe7\xf2\xf1\x3b\x1a\xde\x3d\x92\xcc\x05\x0b\xe2\xc9\x49\x61\x3e\x9b\xeb\x5a\xf6\x9a\xe4\xd0\xc0\xba\x9c\x94\xfe\x4a\x4d\xd7\xfc\x06\xc0\xad\x51\x33\xb4\x84\xfe\xe1\xa5\x46\x76\x48\x41\xef\x8e\xda\x65\x51\x02\x0d\xb9\x54\x42\x35\x5e\x6d\x75\x34\xef\x3d\x37\xf2\x51\x7e\xd9\x19\x29\x80\xae\x0e\x1e\x89\x26\x8a\xc1\x7a\x47\x56\xa7\xbd\x60\x82\x2f\x22\x86\xc7\x97\xd2\x89\x5a\x89\xb3\x09\x8d\x86\x64\xfd\x4c\xb2\x74\x0c\x46\x6b\x67\xad\xe2\x25\x7a\xec\x36\x6b\xa4\x90\xe8\xa5\xe9\xbd\xa9\x26\x68\x18\x2b\x0b\x77\x44\xd5\x47\xac\x23\x66\xab\x88\xbb\xe6\x03\xdf\x4d\xbf\xea\xb6\x7c\x3b\x15\xf6\x85\xa9\x11\x77\x85\x13\xbf\x9e\x5c\xac\x2d\xaa\x9e\x57\x1a\xb6\x44\x4b\xc0\x77\xe4\xcd\xc0\x89\xe9\xe0\x22\x70\x8c\x0b\x73\x7a\x61\x9b\x99\xf4\x8d\x2b\x2d\xbf\x9c\x3e\x50\xcd\xc1\x0c\x24\x7c\xf9\x96\x36\xfe\xdd\xa4\x7f\x17\x1c\x36\x7d\x11\x3e\x0f\x57\xea\x62\xda\x76\xb7\x04\xcc\x88\xd4\x25\xa6\x77\x96\x10\xa1\xc3\xf5\x78\x67\x8d\x54\x9e\x31\x06\x87\xae\x5f\x44\xf3\x60\xb7\x27\xaa\x16\x09\xa3\x70\xf8\x75\x84\x2b\xda\x71\xc7\xeb\x75\x54\x46\x71\x1d\x31\x20\xa3\xdb\x93\x0f\x1b\xf2\x44\x9d\xa0\x02\x7f\xed\x84\xf0\x9f\x86\x82\xe4\x57\x53\xed\xcd\x5e\x6a\x5f\x04\xea\x60\xa6\xa7\x32\x48\x67\x40\xfd\xbf\xbe\x29\xf5\x9f\x64\x12\x2b\x4c\xa8\x4d\x23\x47\x33\x6b\x28\xb0\x05\x5c\x82\xdd\xa9\x85\x53\x55\x34\x78\x8a\xbf\xa9\x03\x8d\xf3\xd7\xf2\x49\x01\x9c\x04\x30\xbb\xe6\x2e\xcc\x15\x41\xc1\x94\x9f\x22\x86\xb1\xdc\xa2\xec\x56\xa2\xfd\xc4\x72\x33\xf6\x6f\xa9\xaf\x48\x82\x6f\xa4\x1a\x05\xc0\x63\x1f\x3a\xc3\x29\x65\x18\xb4\x09\xbd\xb4\x2f\xfd\xb3\x45\xf5\xe1\xf6\xe9\xf6\x13\x41\xf2\xdc\x6b\x51\x72\x39\x50\xde\xd0\x66\x69\x3c\xe7\xa3\xfc\xbb\x2b\x89\xf6\xc2\x48\x3d\xf3\x5d\x2b\x6c\x8e\xe7\xd4\x7f\x23\xbb\x09\x00\x4c\x58\xb1\x48\xaa\x88\x6c\xa8\xb0\xcc\x08\x71\xef\xd8\x58\x35\x57\x88\xae\x50\x62\x4d\x51\x62\x3d\xc3\x93\xe5\xe5\xe6\x42\x4f\x84\x4a\xf9\x23\xcd\x24\xc0\x4a\x73\xfb\x03\x6b\xbd\x65\x5d\xfd\xd4\x3b\xf5\x84\x51\x5f\x6c\x4c\x4f\x7b\xae\xcd\xc2\x93\x43\x6e\x87\x61\xdd\x3a\x63\x95\xa0\x23\x0f\x63\xbb\x2b\x72\xe3\x46\xfe\x42\x7f\x6e\x04\xf8\x90\x09\xfa\xe1\xa0\x71\x79\xe5\xde\xba\x2c\x16\x53\x7e\x3c\x80\xcf\x11\x29\x34\x8d\x0b\x53\xaf\xeb\x88\x41\xff\x99\x5e\x51\x22\xb5\x64\x1a\xdb\xa1\xc2\xc0\x78\x8f\xaa\x69\x0d\x7a\xe8\xf2\x54\x60\x1f\xbd\xea\x90\xbf\x79\xcb\x17\x9f\xd1\xd9\x00\x80\xec\x1d\xf4\xa3\x0b\xf8\xec\xbb\x95\x48\xe9\xd2\x46\x77\xcc\x0d\x0a\xf3\x58\xe2\xc6\xaf\xf9\x63\x5a\x11\xc5\x62\x44\x7e\x76\xdf\xbf\x90\x8c\xe3\xcf\xe3\xa3\xc8\xa0\x8f\x6f\xcc\x4e\xe3\x8f\x17\xd2\xae\x41\xc1\x40\xf6\x94\xac\x5e\xf1\x69\x39\xf3\x74\xdf\xd0\x8c\xcb\xde\x00\x45\xe8\xc6\x6d\x47\x2a\x30\x46\xa6\xf0\xc6\xb0\xdd\xe4\x08\x2a\xff\x1e\x5e\xb4\x4b\x93\xb9\x03\x10\x61\x88\xe7\x14\x57\xd9\x99\xed\x96\x2e\x22\xc4\x9c\xc9\xdb\xee\x63\xfa\xac\x82\x5b\xbd\x9b\xc6\x6c\x90\x33\x90\x85\xc2\x5d\x6b\x6c\x0e\x82\xa6\xe9\x8a\x19\x08\x08\x99\x3a\x60\xf7\x44\x3b\x49\x20\xa6\x21\x0c\x16\x6f\xc6\xae\x2b\x6a\x74\x37\x36\x2d\x6b\x30\xeb\x3c\x88\x2e\x29\xac\xa3\xf7\xa1\xce\xea\x94\x54\x61\xa5\xe1\x4f\x88\xab\x44\xa4\xec\x2e\x07\x25\x5b\x9d\xf2\x2a\x9b\xc5\x55\xa7\xf9\x9a\xac\x6d\x91\xd0\x40\x57\xe5\x72\xef\xd1\x1b\x09\x40\xf1\x27\x2a\x78\x79\xba\xb7\x33\xac\x02\xbc\x3e\x0c\xef\x1f\x40\x26\xdf\x9e\xad\xca\xc4\x6e\x1d\xfc\x57\x5e\x7b\xc8\x35\x8f\x69\x22\xf7\xef\x09\xb6\xfb\x4a\x88\xc9\x63\xf8\x2e\x64\x65\x83\x30\x22\xa6\x0d\xf7\x2f\x8c\xe6\x1d\x06\xb1\xa2\x91\x45\x88\xd5\x50\x72\x05\x07\xe8\xc5\x9b\x6e\x0c\x6b\x1f\xbb\xba\x07\x71\x73\x14\xb1\x37\x36\x44\x62\x94\x73\xe9\xf3\xf8\x24\xc2\xac\xb9\xf5\x77\x4f\x18\x15\xea\xa6\xfe\xef\x3f\x7f\x38\x27\x91\xe5\x90\x3f\xfe\x20\x57\xce\xef\x5d\x18\x2b\x33\x17\xf3\x45\xcc\x28\xab\xb8\xce\xcb\xdc\x6c\x71\x04\x25\x0f\xf7\xa1\xd2\x44\xcc\x64\xfb\x8d\xe7\xcc\x3b\x74\x88\x81\xc4\xe0\x48\xb5\x2f\x14\x54\x31\xe4\x75\xe7\x24\xd4\xfa\x57\x6d\x00\xb6\x47\xf2\x6b\xe8\x95\x30\xb0\xd1\x18\x00\x7f\xbb\x7c\xd9\xe5\xd9\x5d\xe2\xae\x05\x3b\xb2\xb8\xe2\xac\xa7\xda\x22\x09\x47\x7e\xa3\x56\xf5\x08\xfc\x9d\x02\xaf\xc5\x30\x21\x0a\x19\xd6\x34\xdb\x6f\x4d\x56\x9d\x13\x8e\x84\xf2\x6c\x41\x8f\x3d\x22\x44\xbb\xab\xb0\x76\x52\x7b\xb4\xdc\x61\x64\xd9\x2d\xce\x8c\x13\x57\x21\x2b\x11\x32\x7d\xa4\xbb\x00\x51\xfb\xe1\x54\xb9\xfb\x4f\x69\xda\x33\x0f\x8b\xa4\x77\x52\x49\x2f\xdf\xbb\x91\x46\x29\xfa\xe1\x35\xf2\x65\x65\xf8\x3e\x6a\xd7\x98\x29\x60\x05\x34\xb2\xec\x70\xd2\x72\xf5\xed\x6c\xc3\x1f\x5b\x36\x0c\xa9\xce\x6b\xa4\x3b\xee\x5b\xe4\x6a\x40\x41\x8a\x45\x3b\x54\x80\xdb\xdb\x23\x8d\x6a\x2a\xc2\x6f\xaf\x36\xde\x53\x2a\x93\x76\x2a\xab\x5d\xa2\xa1\x97\xd3\x01\x19\x46\xc0\x80\x7d\xe6\xa4\x4a\xc6\x57\x25\x98\x20\xe7\xde\xd4\xa7\x7b\xe2\x9d\x7b\xda\xc9\xed\xe1\x85\xbe\xf6\x5f\xb4\x48\xda\x79\x4e\xc7\xa7\x45\xb2\xc3\xa9\x49\xbf\xcf\x4e\x36\xfd\x3a\x68\x78\xe5\x4c\x08\xc3\xcf\xf3\xd2\xb1\x7c\x04\x60\x73\x4c\x6c\xe4\x31\xb3\x23\x17\xa9\x6c\xf2\x1a\x62\x60\x9f\x1f\x90\x7b\x18\x49\x38\x35\xc2\x6f\xa7\xbd\x31\xdb\x27\x39\xe5\xc2\xa8\xb7\xca\x09\x01\x90\x87\xd7\xc5\x56\x35\x70\x5c\x5c\x23\xcd\x76\x63\x25\x42\x81\xc9\xc3\x85\x79\x8d\xbe\x44\xd6\x8f\xb7\x59\xb4\x55\xb5\x3d\xb7\x4b\xac\x57\x2e\xc1\x5d\xb6\x9a\xd8\x87\xae\xde\xe1\xf2\x73\x8b\x78\x60\x60\xef\xc2\x58\xc6\x83\x00\x6d\x1f\xfc\x64\x1a\xb5\x42\xe7\xa7\xe6\x0a\x83\x12\x6f\x9f\xee\x75\x9f\xa3\xa6\x79\x65\x52\x01\x96\xfa\x94\x35\x11\xe9\x7e\x4b\x89\x7e\xd0\x36\xbf\xbd\x79\x3b\x2e\xf9\x39\xff\xe3\x03\x2e\x89\x6c\xba\x49\xcf\x5b\x22\xc5\x15\x83\xcf\x48\xa7\xbb\x0f\x4f\xb5\xf0\xd2\x87\xcd\x56\xcb\xf4\x0d\x5a\xc4\x8c\x9e\x12\x8b\x3f\xa6\xcc\x72\xb7\x75\x84\x76\x3a\x8b\x4b\xcd\x26\xbd\x0a\xb6\xf1\xea\xd7\x4f\x9c\xc1\x4c\x35\x3f\xb9\xcf\x82\x1e\xf5\x70\x38\x7a\x56\x7a\x68\x0b\x33\x1a\xeb\x02\x98\x77\x21\x78\x64\x87\xb8\x9c\x94\xee\x45\x47\xa3\xb5\x7a\x97\x8c\xbe\x8e\xac\x19\x54\x20\xa2\x4f\x7b\xef\xc9\xc6\xf7\x8b\x65\xe3\x34\xba\x1e\x6d\x90\xf4\xb4\x77\xda\xb7\xbf\xe8\x2d\x7d\x02\xad\x0d\x30\x8b\xf1\x2c\x19\xf1\x70\x6f\x8c\x58\x1b\xea\x96\xc4\x14\x2e\xda\xd0\xca\xbf\xce\xb1\x03\xe0\x4b\xdd\xcf\xbd\xf0\xb6\xde\xaa\x5c\x56\x73\x7d\x8d\x44\x86\xfa\x0f\x93\xa4\x87\x14\xd9\x1f\x1d\xe1\xc0\xbb\xe0\x58\x72\x0f\x4f\xaa\xd8\xc1\x8a\xe6\xd1\xcb\x8f\x0e\xac\x3c\x37\xbc\x5e\x02\x7a\x5a\xe7\x15\x2a\xd9\x8e\x25\x7f\x97\x74\x0b\x76\x1c\xa2\x76\xbf\x3d\x31\xdd\x76\x20\x4e\x9a\x64\x7d\x93\x06\x25\x40\x73\x64\xde\xd4\x71\x17\xf2\x57\x05\x5d\x54\xef\xa3\x61\x41\x37\x3e\x64\x06\x36\x49\xd5\xe2\x47\x50\xd6\xeb\xa8\x21\x96\xd9\x7c\x93\x75\xac\xe6\xcf\x3b\x74\x10\xf9\x03\x16\x71\x6f\x53\xb2\xfb\xc5\x31\x72\x07\xbd\x96\x91\x2c\xa4\x1a\x43\x0e\x6e\x28\x20\x60\xf9\x75\x76\xc2\x0e\x90\xbd\x56\xf0\xdc\x6d\x47\xcc\xf5\x20\xac\x0c\xcd\xb2\x6f\x40\xc7\xef\xfd\x3e\x11\x20\xc9\xef\x69\x1c\x6f\xa4\x52\x65\xec\x84\xbe\x9e\xc3\xed\x1a\x3e\xac\xaf\x98\x67\xdf\xff\x3a\xa1\x1e\xb1\xa8\x6d\xcb\x52\x5f\xe8\xfe\xa2\x04\xa4\xce\xd4\x6a\x3b\x80\x86\x5e\x75\x45\x4a\x6c\x3d\x75\x2e\x21\x0d\xe0\x4a\x02\x41\x8e\x48\xaf\x3c\xf2\x28\x07\x4a\x8d\x60\xa0\x1d\xce\x9b\x26\x99\xb4\x74\x11\x99\x0b\xb9\x4e\xba\xbf\x3d\xf1\x82\x0c\x2f\x28\x9c\x15\xdc\x2d\x39\x4e\x7d\xff\x84\xf4\x5b\xea\xb9\x65\x05\xc3\x7c\x6d\x15\xea\xda\x03\x78\xf1\xc5\xf4\x9b\x96\x41\x52\xb6\x68\x1f\x0a\xc7\x35\xe9\x92\x45\xfb\x45\x13\xa0\xf6\xea\xcb\x71\x36\x3c\x19\x7c\xa3\xa9\x5b\x40\x05\x60\x76\x3c\xe8\x1c\xf8\xe6\xc9\x37\x97\x28\x6a\x67\x64\xc9\x3c\x98\xbc\x04\xfb\x16\xfc\x9d\x1e\xf9\xae\xba\x76\x02\xc9\x89\x44\x2e\x77\x9a\x4f\x6a\xa8\xa7\x7a\xfe\x58\x96\xb5\xa9\xec\x6d\x19\xfc\xcc\xda\xc9\xf0\x6a\x2a\x0b\xcb\xbb\xac\xfe\x6a\x64\x12\xde\x58\x47\xb6\xc0\x90\xc9\x09\xd0\x1b\xd3\xd0\xc9\xed\x05\x9b\x39\x6f\x2d\x1f\x5a\xad\xea\x9a\x7e\x8c\x4e\x34\x4d\xa2\xac\xf8\xae\x96\x8b\x80\x9f\xe1\x43\x8a\xa6\xed\x1b\xba\x25\x90\xf8\x16\x7a\x1f\x58\xfb\xb0\x80\x82\x99\x9e\x3f\xf9\xc1\x36\x1e\xcd\xbb\x72\xa0\x39\xcd\x9a\x99\xd0\xa4\xa7\x30\x93\x02\x3d\x45\x11\xfe\x4b\x1e\x81\x4d\xff\x3f\x36\x2f\x42\x9e\x53\x23\x4a\x87\xce\xdd\x89\xd0\x2d\x02\xb8\xab\x11\x72\x7e\xb4\x68\x8e\xa0\x63\x7a\xb7\x24\x08\x9b\xd9\x81\x3e\xe4\xb6\x3f\xc5\x6d\x51\xbe\x38\x2e\x0e\xca\xf0\xbe\x89\xdb\xe4\x27\xc9\x78\x9a\xb2\x7e\x0e\xc0\x1b\xd5\xe8\x9d\xc3\x23\xcc\xca\xc5\x2b\x52\xd2\x87\x7c\xf3\x7d\xbe\xee\x27\xa7\xd7\xee\xfb\xc6\x05\xf9\x59\x57\x84\xa2\xb9\xdc\x87\xff\x56\xbd\x2a\x01\x34\x63\xbb\xac\xdf\xde\x0d\xe2\x39\xaf\x1c\x42\x35\x0c\xaa\xc2\xa0\xc9\x7e\xbb\xd8\x66\x30\x00\xe2\x2e\x82\x2c\x3d\x3e\x0e\xf9\x9f\x15\x77\x0b\x09\x5b\x3b\xfd\xcb\x56\x79\xc1\x7b\xea\x17\xbf\xa6\x44\xa2\xdd\xc5\x61\x56\x4d\x4c\xfd\x0e\x43\x78\xdb\x3c\x68\x94\x60\xdb\x04\x77\x6b\xaf\x6b\x36\xde\xff\x67\xcc\xab\x16\xe5\xf1\x77\x65\x10\x0f\x14\x09\x69\xdc\x06\x94\x4e\x5b\xfe\x0b\x0a\xe7\x7b\x69\x73\x2a\x5b\xa7\xb0\x72\x72\x5e\xe7\x0b\xdb\x35\x47\xe8\xd9\xdf\xc6\x0a\x87\xb9\x83\xe1\x37\x43\x6b\x3e\xb7\xdb\x07\x0a\x0f\x9a\x78\x28\x72\x91\xdb\x41\x4b\xc8\x05\x4e\xe3\xfb\x43\x58\x75\x94\x05\xc2\xee\x07\xd1\xe4\xe6\xe5\x01\x93\xa7\x1c\x54\xb6\x5f\x18\x89\xcc\x98\x81\x75\xf2\xbb\xf1\xbd\xe2\x82\x36\x52\x4d\x0a\x69\xcb\x9a\xc2\x43\x3c\x61\xef\xcf\x5a\x22\xed\xc0\xd1\x95\xf0\x80\xc5\x60\xbe\x70\x2c\x7f\x37\x16\x5c\x69\x9b\x86\x03\xcc\x82\x9b\x16\xcf\xd0\xe0\xd6\x53\xf7\xaa\xf4\xc7\x74\xde\x02\x74\x5c\xec\xf9\x20\x58\xa3\xfc\x83\x53\x46\x07\x1b\xef\x65\xeb\xd5\x1b\x8c\x85\x24\x6d\xb1\x26\x66\x78\xfb\x71\xb7\x72\x8e\x79\x12\xdf\x76\x8a\x42\xe7\xc6\x50\x99\xdb\x53\xe4\xa9\x84\x3e\xaa\xaa\x3b\xc1\xa2\x71\xc8\xcb\x15\x2b\x9f\x84\x4d\x8d\xb3\x3f\x42\x73\xba\xc9\x94\x2a\x4a\xa3\x65\x10\xfb\xa6\x8a\x49\x64\x57\x77\xf2\x23\x96\x87\x1f\xf7\xad\x4b\x68\x2d\x7c\x50\x45\xb9\x13\xd6\xe7\x76\x93\x21\x9d\xda\xc9\x56\x81\x41\x86\xff\x50\xbb\x52\xc4\x93\xcb\x2e\xe6\x91\xba\x26\x8c\x7a\x90\x14\x46\x8d\xd3\xad\x30\x28\xf8\xa7\x86\x8d\xd5\x1b\xe1\x76\xc4\x7e\x16\xb4\x5f\x25\xa2\xe9\x86\x28\x83\x8e\x86\x73\xf4\xf5\x15\xc0\x8f\x55\xec\xaa\x11\xad\xcb\x2b\xa4\xc3\x4e\x32\xf4\xb9\xe4\x37\x04\xee\x1d\x8e\x71\x61\x41\x5b\x0a\x86\x8f\xb3\x74\x34\xdb\xeb\xbc\xf2\xa3\x6d\x16\x9a\x37\x4d\xe1\xa1\xf8\x5d\x42\x45\xef\x0f\xe1\x63\x95\x0e\x71\x53\x15\x1d\xe5\xbb\xdb\x72\x29\xa7\x0d\x81\x54\x43\x7d\xa9\xb7\x53\x35\x54\x64\xb8\xfb\xc5\xc9\x40\xa2\x0f\x78\xe7\x57\x43\xaf\xe9\x9c\xc5\x31\x3d\xde\x04\x69\xa4\x70\x68\xd3\xe7\xe2\x6d\x1b\x64\x7c\xc1\x3f\x25\xe0\x8b\xe2\xb1\x4b\x89\x37\x90\x08\x87\x52\xe8\xfa\xd1\x69\xf0\x13\x79\x4b\x5c\x22\x44\x83\x66\x1b\x25\xeb\x09\x25\x2e\x91\x20\x3b\x92\x03\xc0\x72\x61\xbe\xe6\x59\xb6\x9d\x7a\x55\x24\xc8\xc0\x8b\x9f\x23\x42\xf8\x30\x02\x26\xf4\x5c\x56\x9a\x0a\xb8\x4b\x96\xec\x86\xa6\xd4\xc0\x25\xbb\xfb\xdd\xdc\xc4\x1d\xb3\xb8\xbb\x25\x58\xe0\x88\x33\xa4\x46\x0d\x42\xdd\x26\x90\xac\xdf\xe0\xe8\xaa\x0a\x9a\xe0\xde\xc7\x46\xee\x9f\xac\x0b\x57\x18\x78\xd1\x13\x4a\x20\x1f\x93\x11\xd9\xdd\xd3\x27\x11\x88\xf2\xdb\xd3\x0a\x42\x96\x1d\xb6\x70\xdb\x85\x87\x3b\x02\xd4\x30\xbd\x81\xcb\x96\xb6\xf0\x2d\xbf\x3b\xee\x00\xb0\xdd\x1e\x69\xb4\xb8\x1e\x49\xc1\xb2\x97\x06\x50\x2b\x72\x4a\x64\x5f\x84\xf9\x74\xf3\xf2\x0c\xc3\x00\x28\x8f\x88\x16\xdf\xde\xbb\xd8\xd6\x73\x25\x46\x7a\xf9\x9f\x84\x49\x96\x88\xbb\xd6\x4d\x2b\x97\x1f\xa4\x34\xa5\x80\x21\x63\x94\xfe\xb3\x1d\xee\xde\x07\xd9\x7c\x78\x5d\xca\xd7\xde\xae\x4c\xd1\x02\x70\x3a\xf2\xf3\xd4\x10\x39\xb5\xe7\xc1\x96\x49\x34\x9d\x4f\x98\xbf\xd9\x2d\x7a\x36\x23\x65\x21\xa8\x58\xb5\x08\x0e\x2f\x76\x94\xfa\x01\xfa\x8c\xf2\xe7\x8e\xa6\xff\x77\x30\x19\x63\xd1\x07\x9d\x8c\xf4\xef\x69\x6b\xb1\x5d\x23\x8a\x68\x59\x48\xfa\x21\xa2\xe0\xe3\x3a\x52\xd3\xe5\x46\x5f\x9a\x31\x8d\x9c\xd6\x3c\x6f\x6d\x3b\xe4\x29\x41\x4a\xab\x7d\x19\x28\x14\xad\x97\x3f\xf4\x5a\x1c\x3e\x49\x0d\x56\xb3\x15\xb0\x43\x5e\x06\x48\x8b\x32\xb3\x7d\x43\x0b\x05\xe5\xa9\x7a\x27\xe8\x51\x7d\xc4\x8c\xf7\x61\x90\x87\xa9\xbd\xea\x9f\xbd\x4d\xde\xfa\x14\x8c\xc9\xee\x73\x28\x15\x33\xba\xa2\x23\x47\x80\x8c\x8f\xea\x1e\x31\x48\x8f\x9a\x48\xd3\x8f\x9f\x83\x8c\xad\x08\x76\x3f\x34\x45\xd7\x3c\x9d\x24\xdb\xae\x6a\x6c\x16\xf6\xcf\x56\xe5\x69\x25\xa7\xa0\xae\x41\x2c\x70\x27\x8f\x9c\xd7\x2e\x97\xd0\x6f\x4a\x35\x43\xd3\xea\x44\x73\xcb\x7e\xd2\x8b\x98\xf4\xf7\xd8\x6e\xa5\x5b\xd9\x7d\x3e\x19\x78\xb6\xc4\xd4\x22\x2d\x14\x09\xa0\x23\x25\xe4\xb4\x28\x4f\xfe\x13\xe5\xdf\x27\xff\xbb\x7d\x2d\x57\xb3\x6b\x2d\x8a\x63\x9f\x8a\x54\xbe\xe0\x4c\xad\x61\x74\x68\x55\x9b\x5d\x80\xa2\x1f\x82\xe0\xa4\x0e\xeb\x4a\xdb\xdc\x52\x4d\x56\xa1\x45\xf0\x4d\x17\x95\xe8\x48\x72\x36\xa0\xb9\xbb\x5d\x75\x94\xa0\x81\x42\xc8\xc6\xa9\x8c\xe2\x1e\x4e\x4a\xbd\x38\x73\x52\x6c\xa0\x15\xc1\xbe\x25\x9c\x50\x8e\x34\xfd\x27\xc9\x66\xf6\x46\x0e\xe4\x03\xad\x85\x93\x7a\x0d\xe5\x29\xec\x13\x17\x51\x47\xe7\x4e\x51\x8a\x15\x05\x2c\x9e\xea\xd4\x02\xd8\x20\x05\xf7\xc3\x05\x24\x37\x15\xd3\xb6\x54\xff\x87\xf7\x99\x07\x78\xb5\x6b\x9e\x4a\x7e\xdb\x7d\x9a\x8d\x53\x0c\x80\xb6\xa2\x6d\xe7\x96\x86\xdc\x95\xf2\x8e\x79\xdf\x11\xd8\x09\x7b\xd8\x32\xf1\x86\x45\x80\x65\x58\xc5\x7a\x2c\x54\x56\xa9\x94\xb7\x01\xc4\x63\x5f\xb6\x3a\xac\xe7\x97\x73\x47\x5a\x5a\xa6\x8a\xec\xd0\x15\xe8\x53\xa2\xc2\x02\x58\xec\xb5\xd1\x9d\x87\x6b\x56\xed\xb4\x9d\x72\xfb\x5a\x60\x7a\x95\x14\xef\x62\xa5\x9a\xc6\xef\xfb\x14\x0a\x83\x67\x8d\x32\xc9\xfd\x35\x2b\xfe\xff\x07\xc0\xc1\xff\x00\x64\xdf\x38\x9f\x3e\xa4\x30\x56\xd9\x8e\xf2\x30\x99\x49\x0a\x98\xee\x90\xe7\xd4\x41\x7c\x14\x28\x77\x02\x52\x4f\x7d\x78\xbf\x9f\x4c\x6f\xb7\x3d\x2b\x2d\xbf\xf8\xf5\x08\xda\xdc\x68\x9b\x8e\x83\x4c\x5f\x16\x74\xa1\x43\x49\x04\xe0\x26\x70\xb1\xae\xb2\x8f\x87\xb3\xed\xd6\xe8\x42\xf4\xb0\xbd\x7b\x89\xe8\x92\x17\x76\xd6\x8b\xb6\xa4\xfe\x71\xe4\xc8\xdd\xda\x11\x27\x04\xdd\x87\x6e\xf0\xe1\xee\x92\xb0\x1f\x0a\xea\xc4\x12\xda\xc1\xb9\x4b\x0a\xea\x46\x30\x6c\xb0\x14\x69\x9b\x80\xec\x4e\xd7\xe5\x0e\x80\xa8\xbd\xdf\xec\x5b\x82\x5a\x5f\xc3\x42\x7e\x09\xcb\x5d\xd8\xb4\xf9\xd5\xdc\xff\x13\xf1\xe3\xaa\x04\x4e\xbc\x60\x68\xa4\x6f\x16\x97\xa3\x47\x09\xc3\xfe\xee\x73\x88\x1d\x74\x8f\x2d\x54\xef\x57\x38\x74\x00\x47\x1d\x04\xe6\x07\xe7\xbf\xde\xf3\x02\x4d\xbb\x5a\xd5\x0a\x6a\xd3\x63\x35\xd7\x2d\x55\x63\x82\x8e\xb7\x46\x47\xd4\xd3\x5d\x2a\xe8\x12\x0e\x98\x8a\x6a\x62\x5f\x52\xc4\x6e\x17\xa1\x5c\x2c\xba\x1f\x49\xc5\x19\x08\x94\xca\x2e\x83\xb6\x2b\xde\xf9\xe0\x3e\x4d\x69\x0d\x75\x79\xe0\xf4\xbe\x29\x71\x47\x92\x79\x68\x26\x1e\x05\x45\x9e\xed\x1f\x7d\x98\x45\xf8\x5f\x78\x8b\xcd\x77\xd1\x52\xf2\xd2\x78\xd8\xf6\x9d\x46\x7e\x3c\x88\x24\x00\xa3\xfe\x05\x83\x5e\x18\x29\x6f\x5c\xf0\xeb\x9a\x87\xfc\x45\x73\xa4\xd3\x7e\x64\xb8\x47\xc4\x76\x01\x4b\x7c\x8f\xc3\x99\x4b\xc7\x3d\x8b\xee\xa3\x53\x46\x6c\x8d\xef\x5d\x65\xa0\xb3\x44\x5f\x03\x4b\xe2\xeb\x70\x7a\x76\xba\x55\x0d\x95\x9b\x97\xa0\xa1\x8d\x37\x08\x7a\x37\x79\x44\x58\x07\x2c\x39\x1f\x7a\xe1\x74\xce\x2d\xdf\x34\xee\x71\xf4\x7e\x3e\x69\xcf\x4d\xca\x20\x2d\xd9\x7a\x6b\x97\x5f\x9d\xcf\xc1\x80\xdc\xaa\xac\x21\xc8\x17\x38\x85\xfb\xd7\xc7\x11\x49\x11\x97\xe4\xb7\xab\xcc\x91\x7a\x0f\x77\x88\x4d\x66\xca\xbf\x5d\x46\xdd\xe4\x0a\x86\x09\x9b\xbc\x03\x88\x2d\xbf\x40\xc6\x8e\x6e\xfc\x15\x3e\x4a\xb3\x70\xa2\x57\x60\xd4\xc0\x73\x0e\x51\xaa\x35\x66\x83\xc6\x17\x8c\x0a\x6f\x02\x17\x40\xec\x41\x13\x8a\xc8\xa9\x85\x39\x1c\xf3\xbd\x7d\xb9\x35\x49\x48\x9f\x77\xdf\xdf\xe6\x30\x22\x9b\xf1\x37\x34\xeb\x74\x8d\x63\xf0\x4e\x9f\x7c\xcc\xc1\x9b\xfe\xb6\x56\x6c\x8b\xf6\xd1\x36\x85\xc0\x7b\xa6\x54\x24\x91\x48\xbc\xdc\x46\x0e\x97\x47\xbc\x5f\x6c\xcb\x40\xc9\x53\x14\x0f\xaa\xa9\xa4\x04\x06\xa6\x63\x3e\xbc\x6f\x63\x12\x1e\x64\xf9\xfa\x42\x3b\x56\x42\x97\x5f\x65\xb0\x0a\x71\x88\x33\x8f\x60\x6d\x58\x48\xa2\x0e\x91\xd1\x08\x49\x7e\x74\xdd\xcf\xfb\xe0\x80\x07\xf8\x37\xe1\x6f\x64\xed\xf9\xa1\xfa\xac\xe2\x2f\x23\xa9\x19\xb3\x28\x2c\x61\x85\xe1\x7b\x5c\x3f\xab\xbd\xa1\x91\xbb\x26\xf9\x29\xdc\xbc\x3b\x25\xb2\x08\x82\x72\x15\x41\x8a\x91\xde\x92\x76\x92\x87\x6c\x63\x2b\xbd\x84\xc4\x22\xef\x0f\xa9\x09\xf7\x0b\x6b\xa1\xfe\x70\x3b\xc7\x21\x46\x79\xd2\x3c\x9e\xaa\xde\xaa\x5d\xfb\x01\x8e\x5f\xdc\x10\xe5\x6c\xd5\xcb\x48\xd6\x23\x80\x72\x90\x97\x60\x16\x2e\x06\x51\x77\xaf\x3b\x5d\x28\x6f\x89\x93\xba\x20\xfd\x77\x1a\xd6\x3b\x40\xdf\x15\x1f\xea\xd3\x9a\xf8\x68\x3b\x14\x83\xfe\xbb\xac\x14\xb1\x2e\x12\x22\xd5\xec\x22\xc3\x18\xb9\x72\xec\xee\x2e\x5d\x95\xc0\xbf\xbf\xfe\x88\x6a\x82\x50\x78\xd6\x89\x4c\xe3\xbe\x32\xc8\xd6\xfe\xa3\x64\x22\xdb\x68\xce\x70\xef\xb3\x96\xef\x5b\xc8\x48\x8a\x9d\xed\xba\xf5\x52\x5c\x53\xbc\x9b\x17\x50\x09\x81\xda\x45\xf0\xb3\x1c\x6a\xc1\x01\x60\xc3\x77\x41\xc0\xb5\xc7\xd2\xf7\xb7\x33\xa8\xe1\x27\xdc\xc9\xa4\xa3\xec\x4b\x28\xc8\x6d\x43\x12\x1c\x95\x97\xdd\x77\xa8\x9c\x22\x5e\xfd\x8e\x21\xf3\x89\x69\x6b\xf3\x92\xba\x34\x1b\xc5\xb2\x99\x4b\x83\x84\x7d\x86\x8c\x4b\x1e\xe5\xde\xf7\x1c\x48\x6c\xf5\x7d\xcb\x8a\x10\x2f\xbf\xf2\xa6\xd6\xda\xda\x3b\x16\x66\x59\x37\x11\x34\x20\x3a\x7b\xec\xec\xf4\x16\xef\xc8\x2b\x29\x8f\x0c\x70\x47\x54\xc5\x45\x1e\x42\x8d\x19\x2d\xe4\xea\xd1\xd0\xa2\xf0\xc4\xc3\x14\xa9\xed\x5e\x7c\x79\xb7\x1d\x6e\xb4\x57\x78\xbf\xc0\x83\x8a\xd2\x65\x64\x44\x64\xc9\x98\x63\x0f\x58\xbd\xb8\x85\xd4\xe4\xe1\xc5\xd6\x57\x54\x23\xfb\xd4\x99\xb4\xfa\x99\xd6\x92\xe9\xb3\xf6\x40\x4d\x44\x4d\x00\x65\xb2\x10\x3b\xdf\x14\xe3\x94\xd0\xc5\x90\xa8\xb7\x46\x4d\xa7\x57\x1b\x3e\xb5\x9c\xde\x21\xc1\xf1\x22\x62\x75\xe8\x4d\x42\x2f\x29\xf1\xa7\x8e\x4d\x48\xa4\x6f\x0a\xc4\xac\x15\xd9\x3a\xca\x3f\x6f\x62\x24\x40\x3d\xd5\x61\xce\x6f\x9f\xb2\xce\x6f\x72\x8e\x8e\x5b\x76\xd0\xf7\x4e\x55\xb5\xdf\x98\xb3\x5d\x32\x92\x8d\xf5\x93\x7c\x3d\xc5\x48\x0a\xf3\xa0\x39\x9c\xf5\xe7\x9f\xa0\x68\xce\x1a\x48\xcf\xf4\x4b\x9c\x1b\x13\xe5\x0f\xf2\x05\x7c\xea\xaf\x2a\xe1\xfe\x2f\xb7\xc9\xcd\x9f\xb8\x1a\xd3\x1d\x76\xca\xb8\x0f\x83\xeb\xb4\xd5\x3f\x51\x35\x9f\x91\x1d\x7a\xc5\x88\x65\x92\x3b\xfc\xf4\x6b\x68\xdc\x4d\x28\xcc\x1e\xb1\x83\xbe\x3f\xbe\x6b\xc2\x6b\x97\x01\x93\x72\x5f\x78\xda\xe6\x23\x5a\xc6\x33\x62\x6c\x9f\x34\xd3\x7e\x46\x50\x2b\xf8\x12\xf4\x6f\x4f\x32\x00\x87\xb7\xa3\x47\xe9\x6f\x2c\xff\xec\x59\x7c\x39\x0d\x8c\xb0\xdf\x9c\x8e\x58\xb0\x73\xbd\x23\x13\x79\x38\x9a\x75\xda\x60\x57\x78\xa0\x63\x47\xa0\xe0\x83\x0b\x09\x38\x24\xe4\x38\xd1\x36\x09\x07\xb5\xb5\x46\xe7\x94\x46\x29\xc5\x39\x3b\xf2\x40\x0d\x51\x1b\x7c\x77\x97\x2f\x5e\x95\x3f\x2f\xd2\xf3\x9a\xf8\xa5\xb6\x99\x42\xaf\xea\x1d\x98\xfc\xbf\x58\x59\xe8\xa3\xd0\x09\x4b\x18\xb7\x5d\x8a\xc5\x6c\x0b\x19\xcc\x28\x76\x41\x27\x84\xcb\x5c\xd4\xf6\xde\x6d\x1b\xae\xde\x57\x59\xa3\x3b\x48\x40\x97\xce\x7f\x69\x12\x98\x09\x70\xe0\xd8\x2c\xc3\x5c\xe9\xe2\x25\x1e\xac\xcd\x13\x6b\x94\x14\x9d\x6c\x68\x5f\x30\x1d\xc4\xe3\x10\x56\xda\xa9\xd3\xe9\xf4\xa5\x81\xcb\xa7\x49\x5e\x34\x49\xc3\x5b\xdd\xc8\xe3\x25\x9c\xa1\x7c\x33\xd6\xc5\x04\xd8\xad\x59\x8b\x45\xf2\x42\xd3\xc3\xb9\xe0\xce\xa3\x75\xdc\x91\x68\xe3\x98\x72\x03\xf1\x88\x35\xbd\x97\x4f\x1d\xcf\xfc\x7b\x1f\xca\xcc\x51\x84\xb2\x87\xaf\xba\xd3\x6f\x13\x61\x11\xac\x19\x25\x6b\x87\x79\x26\xa9\x16\x77\x17\x2d\x32\xa9\x52\x97\x2a\x33\x47\xed\xc4\x51\x4f\x57\x54\x93\x56\x06\x76\x31\x69\x84\xa8\x2f\x26\x18\xe9\x37\xcc\x48\x91\xad\x85\xc0\x62\xf9\xd6\x03\x93\x08\x4c\x86\xa3\x09\xff\x74\x04\xaa\x9f\x2d\xb4\xda\xea\xd3\x4d\x5b\x93\x9b\x51\x68\x1c\xa1\xa3\x20\x2d\x91\xea\x7e\xc8\x66\xfe\x28\xdf\x2f\x73\x8f\x65\xa9\xd4\x8b\x68\x81\x81\x69\x66\xe9\x9a\x78\x59\x1f\x56\x8e\x9f\x62\x95\x21\x9e\xe2\xe1\x7a\x5b\xee\xea\xbe\x3f\xef\xe9\xb5\x14\x8e\x2a\xec\xea\x7c\xb2\x82\xaa\x76\x7e\x90\x8c\x56\x67\xb2\x3b\x37\x4e\x0b\x36\x4e\x0f\x6e\x2a\x29\xd6\xfa\x95\xbf\x92\x27\x42\x91\x0d\xb1\xf6\xaf\x20\x75\x79\x56\xb2\xe2\xb8\xfb\xa7\xfe\x22\xf7\xa0\x68\xbd\xb1\x12\x20\xa5\xcb\xc6\xbb\x4d\xa7\x40\x9c\xb2\x01\xd4\x95\x88\x91\xd2\x69\x89\x9c\xf2\x07\x41\xbd\x4d\x7c\x89\xcf\x2a\x20\xef\xad\x5a\xd5\x5d\x93\x4f\xed\xc2\x1b\x3d\x67\x34\x04\x99\xed\x49\xe8\xa6\x99\x9d\x27\x30\xb7\xb7\x14\x06\x6e\x5a\x41\xe0\xeb\xbb\x68\x92\xca\x70\x8a\xa2\x7d\xa2\x6f\xe8\x74\xff\xa6\x9d\xdc\x48\x27\xf6\xd0\xcf\xb5\x19\x8f\x4e\xf9\x1d\x7e\xe5\xaa\x5d\xff\x68\x60\xd8\x79\x1c\xf1\x48\x12\xe4\x78\x13\x75\x19\xc1\x92\x63\xe1\x79\x64\x5e\xcb\x63\x8c\xd0\x9d\xa5\x16\x2b\x45\xbc\xd7\xb7\x52\x9c\xfd\x96\xe6\xa4\xa1\x8d\xb7\x41\x4e\x0d\x9f\xf3\x63\x23\x7f\x77\xd4\xeb\xee\x0a\x40\xbd\xba\x4f\xea\x63\x9e\x0e\x3c\x91\x19\x8f\xdb\x39\xc2\x02\xa3\x9c\x85\x1f\x35\xeb\xa8\xac\x79\x57\x76\xeb\x3e\xff\xcc\xa6\x11\x1d\x0c\xc5\x1a\x53\xd5\xa5\xd7\xda\xf5\x07\xec\xf2\xaa\x97\x87\xf2\x7f\xba\xf3\xb3\xf2\xfa\xb4\x15\x04\x3d\x03\xf7\xdf\x1c\x3c\xb6\x41\x6e\x70\x50\xb2\xd2\x91\x11\x3d\x11\x79\xe2\xb0\x88\x67\x81\x0a\xa3\x97\xd5\xf5\xfa\xfa\xf0\x57\xcb\x8a\x9d\x26\x6d\x5d\x1f\xfa\xd0\xbe\x6a\xca\x31\xaa\xc9\xb6\x1e\x3f\xac\xda\xa7\xfa\xbf\x5b\x7d\x50\xef\x3d\x86\xb7\xfe\xa0\x22\xc1\x4a\xce\xd7\xcb\xa4\x5e\xfc\x3e\x64\x04\x0a\x6a\xbe\xb2\xb9\xee\x7e\x8a\x3e\xff\x9e\xb8\x4d\x93\xc6\xd1\x45\x60\x5f\x57\x24\x5a\x56\x3a\xba\x55\x97\xb6\xa7\xe2\x85\xfe\x0a\x22\xf8\x7a\x12\x36\xc9\xab\x87\x76\xd0\x0f\xf4\xab\x93\x0a\xe0\x7b\xf1\xb3\xc0\x1d\x51\x05\x12\x96\xb0\x1b\x70\x8b\xc8\x08\x75\xe2\xc5\x62\xbb\xef\x2e\xeb\x54\xb0\x8c\x02\xa5\xb6\xad\x76\x0d\x1b\xc8\xb4\xd0\x1b\xf8\x75\xb4\xfb\x03\x99\x9d\x65\x09\x95\xb3\xd3\x56\x41\xb6\xa2\x6e\x51\x91\xb3\xef\x88\x77\x3b\x01\xa1\x71\xca\x0b\x6b\x2c\x16\xc2\xf0\x84\xb9\x64\xe3\xe8\x29\xca\x1a\x03\x3f\x93\x46\x83\xb6\x5f\x86\x97\xc8\xc5\xf9\xc1\xb9\x23\x4d\x92\x64\x5a\xec\xe0\xfe\x55\x75\xf8\x67\x1e\xa2\x48\xb1\xa9\x2a\x38\xde\x6e\xb3\xc6\x04\xb1\x5e\x91\x17\x11\x2d\xb3\x62\x30\x92\xb6\xc0\x25\x95\x1c\xaf\x1d\x07\x67\x3e\xf7\xd6\xd0\x24\xb6\x5c\xbc\x43\x8e\xcf\x07\x2c\x9f\x1c\x85\xd4\x38\x78\x5f\x48\xa3\x40\xb8\x94\x78\x6a\xf9\xe8\x0b\x07\x06\x7b\xd2\x17\x51\x73\x0c\xbb\x73\xdf\x47\xd1\x30\x11\x96\x94\xab\x0e\x34\x42\x0e\x46\x46\x51\x7a\x37\xdd\xc8\x5a\xe5\xee\x63\xe5\xb6\xcc\x61\x6d\x2d\xba\xa6\x15\xc9\x8a\x72\x76\x8a\x7c\x68\x32\xd7\x9c\x49\x20\xf1\x7c\xd2\x22\xd4\xa0\x0f\xc1\xc8\x9a\xd8\xbb\x81\xbe\x1b\x64\x3c\x1f\xe4\x6a\xa4\x3b\xfd\x4a\x62\xa1\x99\x49\x09\x10\x56\xe9\x8b\x91\x8f\x1d\xc2\xff\x04\xe0\x23\x56\xae\xb2\xa1\xc1\x36\x4c\x18\x80\xc2\x6b\x3b\xe3\xfd\xd1\xed\x6b\x38\x4a\xf1\x5d\xee\x0f\xac\x6c\x2f\x39\xff\x72\xc4\x1a\xfd\xa9\x00\xb7\x46\x2b\x48\x68\xd0\x04\x68\x38\xfb\x0f\x9f\xe4\x08\x7a\xa5\xed\xb2\xb1\x08\xe6\x70\x91\x9c\x75\x92\x22\x73\x22\x20\x35\x35\x8c\x6d\x72\x6a\x67\x58\x10\xed\x6d\x42\x43\xed\x3b\xf6\x4b\x99\xc9\xe6\x41\xbc\x79\x44\xab\x2c\x9c\x82\x20\xa2\x4d\xf4\x93\x1b\xb5\x9b\xb8\xc3\x50\x2a\xc8\x84\xd5\xea\x5d\x09\xab\x0b\x0d\xf0\x1e\x3e\xfb\x9d\x05\x83\x0e\xa2\x4b\xbb\xb1\x33\x05\x03\x02\x9f\x6d\x77\x25\x78\x8a\x19\x27\x47\xa7\x43\x94\xc3\x43\x58\xb9\xd9\x26\xb7\x38\xa1\xd5\xea\xd0\xab\x0d\xe4\x6c\x8f\xbb\x28\x36\x42\x52\x32\xa7\xae\xf5\xe8\x38\x7e\x29\xa9\xb9\xcf\x1e\xa2\xe6\x1f\x9d\xa8\xb8\x5d\x33\xe9\xe8\x14\xe2\xde\x29\x4a\xc4\x0a\x46\x2f\x08\xba\xa2\x69\x2c\x4c\x07\x35\x0b\xb4\xf2\x51\x6c\xb5\x4b\x69\xd9\xe9\xdc\x54\xea\x7a\x66\xbf\xf3\xd5\xfe\x8b\xd0\x16\x1e\x6b\x4e\xbb\x6a\xfe\xfa\xb0\xfe\x92\x2f\x98\xff\xa3\x5b\xf8\x30\x87\x08\xfb\xde\xa7\x84\x0d\x9f\xe0\xc5\xfa\xd7\x17\xeb\xb3\x02\x25\x82\xad\x17\xa9\x0b\xae\x5c\x94\xd9\x0a\xfd\x61\xde\xad\xdf\x4f\xbf\xcd\x6c\xce\xe1\xdb\xa7\xe6\x09\xec\x36\x1f\xd0\x36\x61\xc6\x55\xc3\x41\x29\x3c\xa8\xac\xbc\xa2\x23\x34\x3a\x26\x55\x88\xb8\x3a\xbc\x32\xfb\xb2\xec\xc0\xee\xa6\xcd\x4d\xad\xc3\x59\xb9\x2f\x95\x55\x97\xb5\xed\x50\xda\x98\xd2\x2d\x03\xdb\x97\x7c\x59\x88\xc6\xdb\x63\x7a\x4a\x44\xb4\x84\x89\xe7\x99\x1c\xac\x3c\x3e\x2d\x01\x1e\xd9\xa4\x1c\xd9\xa6\x83\xda\xc6\x66\xae\x34\xb5\x38\x4b\xae\x7b\x2d\x45\xca\x6d\x27\xb8\x6d\x6b\xfa\x96\x42\xa5\x24\x6c\x9e\x09\x5b\x12\x95\xda\x8f\x3a\x7b\xc2\x05\xec\x5b\x48\x6b\x13\x92\x6b\xbd\x30\x1c\x99\x1f\x4e\xd1\x9d\x44\x73\xf4\x70\xd0\x4d\xcc\xb6\x83\x0e\x4c\x5b\x78\x9c\xd9\xe5\x16\xf3\x9a\xa3\xcc\xf8\x8b\x90\x25\x41\x53\x96\x1b\xfe\x6b\xab\xf2\xf7\xac\xe2\x24\x08\xc9\xf9\xca\x83\x2c\x17\xee\x79\x07\xda\x13\xd4\xd6\xfe\xd1\xc6\xc0\xd1\xfe\xa5\x84\x61\xe4\xd1\x28\xb5\xbe\x77\x97\x83\x66\x55\x1d\x49\xcc\xe9\x0c\x45\x64\x50\x58\x24\xfe\x5b\x93\xdf\xbb\xcb\x4d\xcd\xa1\x73\x52\xfc\x51\xe1\xa4\x91\x55\x53\xfa\xf0\x7a\x12\xc9\x05\x94\x79\xcd\x61\xc6\xc0\x47\x13\xc5\x45\xe7\xac\x20\x28\x28\x59\xf9\x0f\xbb\xae\x97\x59\xdd\x07\xa2\x78\x0f\x85\x37\xdb\xb3\x0e\xd9\x91\xb2\x10\xac\xce\xa4\xbb\xd3\x5f\x96\x34\xc3\x36\x7c\xaf\xc7\x81\x41\xcb\x3f\xc7\x1a\xf3\x9b\xb6\x12\x50\x4c\xb4\xcc\xf2\x77\x6c\x94\xd2\xcd\x4d\x6d\x1c\x0c\xec\x74\x62\xba\xfa\x24\xe0\xbc\x11\xd3\x26\x17\x34\xb8\x03\xd2\xc3\xc7\x3b\x31\xa4\xbe\xbe\xcd\x2c\x78\x2b\xe1\xd3\x46\x1e\x0a\x06\x3e\x2d\x01\xb8\xf9\x48\x21\x0c\x78\x90\xf0\xc9\x5a\x7f\x7f\xbc\x07\x0e\x76\x38\xbc\x16\xcb\x00\x1f\x24\xd5\xae\x3c\x4c\x80\xbb\xca\x95\x82\xb3\x0d\xc0\x07\xcd\xbd\xfb\x14\x7e\x0d\x40\x8f\x56\xf9\xba\x87\x9f\x9f\x27\xf1\x84\xbf\x42\x8b\x54\xc9\xa6\x60\x54\xc4\x37\xe6\x59\x17\xba\x16\x7a\x54\xa6\xf8\xc6\x4c\xcd\x54\x63\xfb\xcc\xe2\x7a\x3b\x93\x26\x72\xad\x7e\xf2\x8a\xfd\x0e\x28\xe1\xdf\x4c\xec\x96\x7e\x36\x38\x01\x21\x50\x84\x45\xe8\x87\x0b\x2e\xbc\x3e\xcd\xab\x26\xe3\x51\xee\x92\x5d\xd2\x1f\x4a\x36\x91\x55\xb1\xd3\x03\x6f\xc9\xcd\x79\x41\xf7\x28\x02\x79\x0d\xf6\x2d\x23\xb1\x87\xd8\x50\x4c\x1b\x6b\x63\x45\xbf\xd9\xc0\xa0\xe0\x60\x9d\x7b\xb9\x6d\x88\xec\x72\xec\x95\x53\xed\x79\xd7\xb0\xd8\x79\x0b\x48\x81\x13\x2b\x2b\xd4\x23\x02\x7d\x5c\xa9\x3e\x29\x09\xa1\xab\x92\xfa\x43\x97\xde\x2c\xeb\x36\x1d\x16\x3f\x9c\xe1\xd0\x79\x71\xc7\x16\xd4\x69\xde\x8f\x97\x4b\xa4\x77\x30\xaf\x5f\x42\x5e\x93\x17\x59\xbe\xc8\xe4\x08\x03\xca\xed\x6f\x4e\x9b\x80\xe5\x49\x49\xf4\xfd\x79\x81\xbe\x5b\x34\x57\xd9\xe6\x06\x15\x50\x9f\x8e\x3f\xe8\x45\x0b\xf5\x17\x0c\xfa\xb7\x81\x42\xd3\xcd\xde\xe8\x2c\x77\x8d\xac\x27\xe8\x34\xc6\xc3\x8e\x1a\xa5\x2a\x77\x51\x77\xda\x36\x26\x80\xcf\x8e\x39\x44\x97\xde\xe1\xab\x75\x13\xe7\xb5\x5d\x6e\x0e\xbf\x7f\xed\x83\xbe\xe3\xff\x93\x22\x4e\x46\xf3\xfe\xcb\x73\xd9\x73\x56\x2d\x5c\x9d\xca\x02\x31\x7b\x04\xdb\x5b\x6f\x1a\xcc\xe6\xb5\x71\xa5\xd1\x54\x2e\xad\x1a\xb7\x9d\x79\xa7\x0f\x65\xf4\xfe\x2d\x02\xf3\x44\xc2\x7f\x64\x5b\x02\x7a\x3a\xa3\xc6\x95\xf9\x2c\x38\x3f\xfd\x14\x82\xd4\xf0\xfc\x62\xca\x11\x4e\x96\xc6\x6d\xdc\x74\x44\x0c\x31\x10\x66\x4e\x74\x0b\xdb\x9d\x78\x0c\xd8\x2d\xeb\x08\x32\xd8\xce\x3c\x2f\xee\xcd\x8b\x97\xbd\x2a\x9c\x63\x5f\x58\x87\xef\x61\xc6\x4f\x0f\x75\x96\xa3\x98\x84\x15\xd9\xcd\x92\x2b\x0f\xcd\x03\x43\x4e\xa1\x9b\xe7\x75\xbb\xa7\xe1\x5e\x58\x1e\xd7\x0f\xcb\xe3\x22\x09\x14\x8a\xdc\x4a\xc0\xe0\x3e\x1c\x1c\x87\xe9\xd7\xa5\x47\xd6\xb4\x88\x32\xfb\x23\xe6\xd0\xa2\xd2\x71\x3e\x04\x47\xfa\x28\xcd\x52\x68\xfb\xf2\x54\xd8\x46\xf2\x8d\x30\x06\x53\x41\x3c\x69\x44\x36\x0c\x52\xb9\x8b\xc7\xb2\xc4\x4d\x12\x84\x23\x24\x1a\xf8\x03\x3d\x0d\xdc\xa9\x8e\x71\x67\xf6\x34\x7c\x7b\x3f\x48\x9b\x98\x17\x3a\xc3\xfe\xdd\xf2\xba\x76\x37\x60\xff\x59\x65\x5d\xa2\xe2\x55\xbe\x59\xa1\x8d\x03\x8c\x00\xa5\x30\xad\xef\xc6\x3e\x73\x62\xe2\x1a\xcb\x41\x59\xd7\xd5\x99\x59\xfa\x8a\x30\xb8\x2d\x61\xfa\xce\xdf\x8d\xfd\x4c\xfb\x34\x0a\xd7\x26\x7a\x43\xda\x1f\xc1\x06\x48\x55\x8b\x98\x46\x11\x5b\x83\x17\x8f\xcd\x0d\xcc\x05\xc3\xef\x71\x54\xdc\x9a\x1d\xb8\x57\x08\x6b\x9f\x32\xff\xb6\x47\x6a\xe0\x3c\xba\x55\x1b\xf7\x73\x09\x83\x75\xc4\xbc\xc3\x49\x84\x5d\x3c\x65\x72\xc3\x11\x19\x4b\x70\x77\x1f\x27\x7f\xed\x6c\x2f\xa5\x57\x75\x96\x3e\x1e\x11\x83\xb9\x65\x0c\x9e\xfb\x11\x75\xb1\xf6\xd7\x26\x29\xe8\x6f\x16\x66\xbd\xf3\xa7\x65\x26\x78\xb7\x68\xb1\x1e\xe8\xbe\xef\xaf\x25\x1c\x24\xd5\xf2\xf5\x53\xb8\x34\x23\x9d\x21\xfe\x4d\x34\x20\x68\xbb\x99\xb5\xb6\x68\xec\xd5\xb9\x92\xfb\x0c\x33\xc1\x74\xb7\xf3\x0d\x80\x2c\x39\x38\x0f\xa9\x3e\x1a\x17\xa9\xf9\xc5\xd7\x2e\x0d\x52\x42\x77\xd5\x09\x6e\x6e\x10\xbf\xa8\x32\xe8\xf2\x8f\x22\x69\x37\x8c\x94\x53\x7e\xfe\xc4\xac\x5e\x7b\x2c\xcc\xc0\xe9\x28\x92\x96\x93\xec\xc7\xce\x07\x0c\xe9\xeb\x93\xc9\xf4\xa6\x9a\xff\xbe\x5c\x17\xc9\x62\xfb\xa2\x7d\xfc\x82\x0e\xc6\x93\x21\x3a\xfa\xeb\x7e\xa3\xb9\xf9\x7a\xcc\x04\x82\x78\x67\xf1\x8f\x50\x1c\x9f\x0f\x8a\x68\x05\xe3\xbc\xa1\x5c\x66\xa5\x8d\x23\xd0\x6b\xef\xa9\x5c\x9a\xb0\xbe\x6d\xff\x69\x4e\x48\xce\x0b\x7b\x7b\x95\xf4\xc6\xda\x21\x0a\x9c\x6a\x51\xa9\x6f\x29\x5a\x76\x3b\x39\x31\x8e\xf5\xdd\x5a\xec\x26\xdf\xb5\xd7\x24\x33\x91\x4d\x6c\x0d\xf0\x77\x07\x62\x0f\x45\x20\x84\x9d\x8d\x3e\xee\xb4\xbf\x6a\x97\x3b\xce\x15\x94\x9e\x4b\x3a\x7d\xf2\xa0\xc8\x82\x9a\x53\xcf\xcd\xdb\x4a\xeb\xc0\x6b\x8f\x3b\x48\xb9\x0e\x5c\xc8\x2f\xe0\xa7\x9e\xbb\x88\x6b\x3a\x04\xd1\xb8\x9b\x91\xc7\x7f\xa2\x04\x88\xec\x25\xdc\xd4\xda\x24\xce\x60\x60\xc6\x1c\x18\x91\xa4\x0f\xf7\x4f\xe4\xbd\x00\x2f\xdd\x25\x29\xa5\x54\x00\xcf\x4e\xc9\x8d\x3d\x48\x11\x57\xe2\xf2\xd9\x23\x06\x0c\x45\x77\x54\xd8\x7e\xe3\xd7\xd3\x8d\xa8\x7c\xef\xfc\x84\xae\xe4\xf8\xc7\xc3\x7c\xab\xdd\xc2\x9d\x18\x55\x5d\x41\x21\x8e\x75\xe6\x91\xb5\x09\x95\xdd\x12\x48\x94\x4c\x7e\x5b\x6f\xb2\x51\xd7\x2a\xdb\x89\x55\x5a\x03\x47\x16\x7c\x97\x0d\x9f\x7b\x58\x0c\xa3\x16\xe1\xd6\x3b\xb7\xf9\x5d\x8f\xad\x4f\x1a\x62\xe8\x2b\x58\x99\xd3\x4c\x89\xcb\xad\xc4\xce\x3c\xde\x89\x94\xa8\xe5\x15\xa3\xbc\x24\x35\xdd\xbd\xaa\x79\x5e\x6a\x94\x6f\xb6\xb3\xb0\x5c\x07\x44\xc4\x7d\x3a\xff\x6c\x1e\x3d\xf3\xe9\xe1\xf5\xb9\x86\x76\xc9\x31\xac\x5f\xbc\xde\x11\x0e\xad\x74\xab\x9b\x89\x68\x58\x0b\x84\x77\x62\xde\x34\x6b\x9e\x65\xf4\xc6\xfe\x6d\x4e\x54\x64\xcd\x9a\xb8\xff\xdd\x27\x8b\xb2\x12\xdc\xa8\xfb\x57\x14\x4e\xf7\x28\xfe\x82\x75\xf7\x84\x2f\x04\x2d\xd9\xfd\x48\xc2\x10\x48\xfa\xe2\x81\xfe\x9c\x67\xed\x96\x6f\x76\xef\x1e\x13\xce\xc5\x12\x01\x34\xb6\x8b\x87\x88\x79\xed\x88\x0d\xdf\x8d\x13\x3a\x88\xc5\xe0\x41\xe2\x27\x97\x3d\x5e\x50\x5f\x2f\x59\x66\xd2\xe3\xcf\xdb\x3c\xcb\xc3\xdc\xf6\x1d\xe6\x0b\x3e\x83\xf5\xf2\xd4\xfc\xf1\x99\x1a\x08\x7c\xb0\x1f\x00\x84\x4f\x3d\xf2\x5b\xac\x05\x7b\xdd\x29\xaf\x39\x7b\x70\x65\xdc\xf0\x69\x3b\xd7\xe6\xa9\xe2\x01\xcf\xa4\x32\x2c\x0e\x4e\xba\x2a\xd5\xdb\xcb\x4c\x15\xed\xf0\x39\x55\x79\x23\x40\xd1\x4f\x89\xe2\xf8\x90\x0f\xec\x8a\xc4\x3a\xf9\x3a\xc2\x0c\x2a\xa4\x27\x43\xde\x79\x70\x60\xa3\x10\xcd\x11\xb2\x9d\xd3\xce\x23\x1e\x15\x50\xf5\x3f\xa8\x5c\x86\x45\xb2\xab\x98\x51\x0d\x8b\x6a\x0b\x37\x5a\xd9\xa6\x1f\xf4\xe5\xec\xeb\xe1\xcd\xa3\x5d\xfe\x23\x5f\x30\x17\x51\xe8\x88\xc0\x08\xca\xcb\xdd\xfe\x1f\x7c\xa5\xc6\xa9\x31\x40\x71\x2d\x27\x0d\xe0\x6b\xe2\x90\xc2\x66\x9a\xf6\x5b\xee\xc8\x1e\x96\xd0\x35\x0d\xc1\x99\x10\x87\xb8\x83\xbb\x0d\xb7\xff\x9f\x4b\x0b\x26\x16\x64\x98\x1e\xce\xe6\x73\x22\x80\x26\xef\x88\xc6\x92\x27\x9f\x47\x2e\x73\x5b\x5e\xbb\x12\xd8\x88\xf6\x56\xb9\x1d\xbe\x70\xd6\x39\xac\xf8\xca\xdc\x0d\x5f\x49\x2d\x33\x2c\x9c\x96\x0f\x3d\x5c\x50\x20\x1d\x83\x28\x59\xb6\x0f\x84\x3e\xd3\x0e\x10\xf7\xaa\xb8\x9a\x6d\x08\x1c\x97\x1c\x38\xb8\x92\xf6\x94\x0b\x9e\x53\x72\x8f\x7b\xa7\xcf\x97\x20\x09\x4e\xc3\x7f\x4c\xd8\x45\xa9\xb3\x9f\xbb\xc8\xf3\xb2\x8d\xc8\xae\x30\xca\x3e\x77\x25\x20\xec\x25\xfc\x7a\x7c\xc9\xc2\xee\x5c\x38\xa4\x3a\x71\x6f\x2b\x2a\x94\xb2\x39\x0a\x04\xab\x62\xa0\x4e\xbd\xc2\x56\x78\xe5\x3e\x11\x87\xd1\xdd\xe1\xf2\x9f\x66\x8b\x1b\x7a\x41\x18\xeb\xf9\x9f\x99\xe8\x61\x73\xc2\x9f\xdb\x1f\x97\xa0\x65\x02\x81\x41\xd1\x4d\x03\xdc\x7a\x16\x61\x2b\x9b\x0c\x1c\xac\x20\xd4\x8a\xf4\xfa\xcc\x54\x56\x70\x2b\x38\x02\x52\x40\x8a\x7b\xee\xfb\x0f\x94\xfa\x68\xd7\xc9\xb3\x0b\x6f\xb7\x72\x87\xc0\xfd\x1e\x0a\x78\x98\xe8\xca\x43\xb7\x70\x4a\xb4\x23\xf7\xe1\xe7\x8a\xfd\x8e\x7a\xfb\x2c\x2a\xb8\x7b\x46\xaf\xd4\x8b\x33\x54\x5c\xdd\x5c\xf8\x9c\x90\x0e\x22\x95\xcc\xa6\xda\xe3\x4a\x91\x69\xa4\x1f\x20\x3e\x0b\xd8\x4a\x16\x8e\xb0\x79\xd4\x2d\x95\x49\x22\xf5\x6d\xcd\x3c\x17\x94\x49\x99\x41\xd8\xe5\x27\x86\x47\xef\x2a\x05\x9e\x12\xee\x20\x7a\xd2\x3f\xe2\xa3\x8d\xff\x16\xce\x7c\x89\x74\x4c\x2f\x5e\xad\xd6\xaa\xb9\x33\x4c\xae\xe4\x71\xb5\x30\x8a\x4c\x34\x89\x05\x87\x93\x76\xb3\xa5\xe6\xb7\x4a\xf5\x57\x73\x89\x29\x17\xd9\x66\xcb\x8f\xee\xb3\xe4\xf0\x9e\xb1\xed\x8f\xd8\x0e\xb2\x57\x9c\xf0\x91\x73\xb8\xcb\x30\xfd\x64\x09\x07\xfe\x25\xc8\x8f\x50\x61\x4a\x50\x99\xc2\x8e\x6d\xde\x22\x46\x10\x1e\xc7\x7c\xc4\xef\x9b\xd6\xe2\xcd\x0a\x1c\xd1\xc2\x13\x8b\x25\xd7\xdf\x1d\xf4\x1f\x0f\xfe\x26\x94\xa3\x0b\x69\xaa\x7b\xd8\x57\xd4\xa5\x19\x2d\x4f\xb5\xf9\xfe\x16\x19\xe8\xe7\x12\x74\xb8\x2c\x1f\x9e\x29\x32\xf2\xec\xec\x28\xfc\xc4\x5f\x26\x29\x0e\xde\xa8\xfe\x1e\x8e\x77\xcc\xfe\x51\xe7\x2b\xf9\x09\xd2\x62\x9a\x69\xd5\xa6\x6f\xca\x34\xf8\x83\xf7\x1f\xd5\x98\xb6\x0d\x31\x3b\xce\x7e\xd4\x12\x33\x44\xd6\xfd\x61\x51\xea\x1a\x6d\xdf\xe2\x95\x0e\x99\x45\xa8\x76\x99\x86\x1a\x83\x3c\x68\x1b\xbf\xb3\x1c\x2b\x8e\x30\xf4\x8b\x4c\x7f\xdb\xfe\x6d\xff\x29\xd2\x5e\x0a\x8d\x81\x7b\x45\x8c\x04\xdd\xf6\xcc\x57\x61\x2d\x86\xb4\xcf\x8b\x5f\xaf\xfc\xbf\xfe\x9b\x7b\xed\xf7\xa4\xb7\xd9\xd5\xb7\xd3\x8b\xb8\x8e\x83\xfc\x6c\x96\x70\x93\xec\xcb\x1e\x6c\x1f\x44\x18\x5d\x9c\xce\x41\xe4\xed\x7d\x43\xb6\x1a\x47\x7b\x67\x8f\xfb\xfb\x92\xa9\xb1\x66\x8b\x89\xe0\x06\xcc\x6d\x8a\x02\x37\x26\x9e\x02\x56\xde\x0b\x34\x41\x5b\x45\xb0\xfd\x73\x0a\x62\x79\x91\xd9\x51\xe5\xfb\x27\x3a\xf0\x42\x5b\x63\x20\x8b\xfe\x43\xe1\x7c\xad\x53\x81\x74\xb9\xa5\xf5\x19\x2e\x97\xe2\x27\xdd\x62\x8a\x47\x06\x3a\x19\xf6\x0b\x5f\x11\x90\x11\xb9\xc7\x76\x24\xfd\x13\x97\x23\x56\xef\x03\x3d\x40\xe6\x41\xf9\xf9\x15\xff\x92\x4e\xc3\x04\x43\x28\xcc\xac\x29\xe2\x29\x1b\x96\x77\xdc\xdc\xef\x38\x2b\x5f\xb2\x7f\xc6\x71\xc2\xaf\x81\xe1\x17\x21\xfa\x70\x02\xc1\x38\x4a\x1e\x5f\x6f\x69\xc8\xc3\x53\xf9\x52\x33\x7a\xa5\x7a\xac\xdc\xc1\xc0\xaa\xc8\xed\xd3\x01\xc6\x58\x09\xc7\x62\xfd\xc7\x9f\xb8\x5a\x1e\x81\xd5\xc5\xcd\xd5\x8b\x84\x8a\x22\x5d\xbc\xf7\x57\x52\x4c\x71\x02\x72\xea\x8e\x77\x22\xeb\x2f\x9d\x57\x09\x45\x67\x80\x3a\x69\xe7\xf5\x00\xa9\xb3\x57\xf4\x94\xce\x40\x48\xaf\x90\xb9\xef\xf7\x96\xe7\x85\x8c\xbd\xb2\xc4\x0f\x49\x1f\xfb\xec\xde\xc1\xf2\x3b\x92\xed\xf7\x16\x85\xb4\xdb\x6e\xab\xbb\x7e\x07\xa2\xe1\xb7\xea\xae\xad\x7e\xf1\x89\xbe\xf6\x7f\xd9\x43\xec\x21\x76\xc3\x99\x18\x27\x13\xa8\x45\xb9\xe7\xa8\x6d\x4f\xff\x71\xc7\x42\xa4\x05\xfe\x10\xc9\xad\x9c\x6e\x4c\x36\xdc\x5d\x7e\x81\xf0\x32\x9b\x58\x49\xd1\x5c\x5b\x9c\xcd\xca\x53\x78\x45\x07\x23\xaf\xa0\xa5\x44\x78\xc2\x30\x84\x59\xd0\x1a\xbd\x12\x54\x0f\x39\x47\x46\xd0\x0f\x9c\x4f\xc4\x59\xfa\x92\xff\xc9\x8a\x47\x32\x22\x8d\x32\x28\xd1\xb5\xea\x33\xf6\xdf\x77\x18\x7a\x59\xa9\xa7\x28\xd7\x14\xdd\xcc\x1c\x1d\xe4\xbc\x51\xda\xe5\x71\xd8\xe4\xcd\xa5\x83\x0f\x0b\x4b\x20\x38\x7a\xd1\x9c\xb9\x46\x9e\xab\xc6\x77\x7f\x2d\x15\xe1\x2f\x91\x74\x1a\x16\x4c\x53\x33\x6a\x70\xdd\xfa\x36\x9c\x6d\x5a\x58\x85\xac\x77\x0c\x12\xca\x0a\xcd\x99\xe2\x7a\x99\xd2\x18\x61\xf4\xc3\xe0\x57\x1c\xdc\x86\x4a\xb3\x1b\xb2\xe3\x4e\x6c\x6d\xab\xb0\x4e\x0a\x6f\x3c\x03\x8c\x95\xb9\x1d\x48\x2f\x72\x34\xbe\x2d\xbb\xe1\xe6\x2c\x31\x85\xb5\x36\x26\x60\x7e\x86\x3c\xeb\x16\xf0\x06\x89\x1b\xe2\xd4\xd1\xbe\xff\x09\x27\x5b\xa2\x5a\xcf\xd4\x4a\x77\xbb\x91\x5d\x52\x8a\xb3\xd0\xeb\xf4\xc2\x9d\x68\xa8\x41\x91\x1e\xc0\xc9\xa4\x9c\xe2\x50\xd6\xd4\x10\xcf\xce\x36\x5b\xff\x38\x69\xe8\x30\x28\xb5\xdb\x97\xa2\x92\xd8\xc2\xa9\xc6\x47\xe8\x6b\x7b\x69\xdd\xed\x56\x09\x6e\x05\x36\xf6\xc0\x68\x22\xbe\xa8\xca\x25\xc3\xe5\xaf\x0c\x5b\xa9\x9e\x14\xf4\xf8\x7f\x4c\x9d\x0d\x41\x7d\x8e\x3b\x96\xd6\x42\xa9\x05\x41\x04\xd4\x83\x27\xb9\x68\x33\x1e\x05\x83\x3f\x9f\xb7\xf4\x17\x72\x1e\xb3\xf2\xa5\x89\x2c\x30\x3a\x09\x82\x72\xcb\x2b\xe9\x00\x2c\xf1\x73\x5b\xda\xc5\x7b\xec\xea\xda\x45\x36\x59\x79\x89\x7d\xe7\x86\xaf\x10\x9e\x2d\x94\x9b\x8d\xa1\x2a\x1b\x02\x48\x6f\xa6\x1f\x2d\xcb\x0f\x80\x3b\xcf\x82\x3c\x54\x01\x42\x42\xf1\x61\xb9\x1e\xfe\xcb\xe9\xc3\xa8\x4c\xd4\xb8\x03\xcf\xa6\x64\xa5\x15\x21\x4a\x3b\xe2\x07\xb1\xf3\x00\x6d\xf2\x0b\xe7\xf6\xad\x32\x33\xc2\x17\x7c\x53\xc8\xfe\xed\x92\x97\x70\x63\x23\xb0\xf3\x86\x2c\x81\x1c\x3d\xeb\xa5\x7f\xee\x45\xea\xb4\xde\x4d\x2f\x9b\x08\x2f\xd8\xa3\xca\xad\xd7\x2f\xb8\xdf\x6e\x5e\x16\xcd\xb7\x3c\x8a\x2e\x86\x8d\x5d\xc0\xb0\x1f\x0e\xb3\x6f\x3d\xfd\x09\xae\xa3\xfe\xba\xe4\xcb\xd5\x59\x6e\x30\x92\x6e\x29\x4d\x4e\x67\x58\xfd\x7c\x8f\x44\x96\xc1\x8e\x2f\x99\x5a\x85\x8e\xb7\x31\xf1\x64\x6a\x8f\xb7\xbf\xf9\x23\xe5\x67\x16\xd7\xc4\xae\xb8\xac\xd5\x16\xac\x93\x88\xc0\xb9\x5a\x3e\x06\x22\x47\xa3\xc3\xb8\x0f\xcd\x93\xce\xe6\x49\x74\xee\x39\x72\x9f\x4e\xb4\x99\x7e\xa2\xcc\xb5\x72\xde\xab\x84\xab\x93\xa1\x66\xe7\x74\x47\xf2\x94\x5b\x9d\xaa\x13\xca\x92\x88\x9f\xb6\x7d\x47\xe4\x8e\x22\xd5\xbc\x2c\xf5\xa6\x05\xa1\xe4\xbf\x76\x64\x6b\xae\x26\x25\xd2\x75\x30\x3c\x67\x4f\x82\xd3\xe8\x2b\x45\xef\x19\xb4\xf0\x21\x3f\x6f\x1e\x56\x8e\x6c\xf8\xf9\x74\xdb\x51\xed\xbd\x86\x55\x04\x4a\x52\xe5\x00\x79\x15\x45\xdc\x39\x61\xf8\xb9\xdb\x50\x18\x06\xb0\x94\x16\x03\x40\x9b\xa6\x23\xc5\x67\x80\x7c\xfd\xac\x28\x3d\xb5\x98\xd9\x71\x4d\x38\xb5\xdf\x8a\xa1\xdb\x6b\x90\xe3\xf7\xba\xef\x82\xaf\x24\x96\x29\xca\xf5\xb1\x86\x3e\x18\xe4\x11\xe7\xc3\x75\xd2\x88\xe0\x92\xb7\x9d\xec\xa2\x40\xb2\xf7\x5f\x22\x79\xd9\x0e\x16\xea\x03\x27\xdb\x8a\xb0\xa2\x87\x37\x28\x92\xb3\x7c\x82\xf2\xad\x00\xeb\xb5\xb6\xc6\x42\x56\xf9\x6b\x7d\x3e\x93\x7f\x49\xd1\x49\xb9\x96\xad\xb9\x29\x84\x5a\x70\x45\x21\x5a\x35\x55\x08\x43\x84\xbe\xff\xed\xbd\x6b\xb3\xd9\x5f\x09\xe4\x84\xb8\x2f\xa4\x3c\xa9\xf7\x53\xdf\x13\x5a\xd8\x8a\x60\x44\xd3\x70\x63\x97\x13\xf2\x0a\x58\xf2\x14\x5c\x46\xed\xb0\xb6\xbd\xd9\x6d\xae\x99\xf2\xae\xb6\x63\xe2\x17\x93\x99\x6c\x9d\x7d\x72\x33\xc7\xf9\x8e\xe4\x61\xb0\xc8\x39\x88\xfe\xbb\x9d\x7f\xf4\x27\xe8\x0e\xe1\xe6\xde\xad\xdb\xd9\x57\x4f\x1e\x82\xd4\x30\x2b\x77\x7c\xaa\x1c\x1b\xd4\x21\x8e\x31\x64\x90\x3d\x7c\x80\x3c\xb7\xc9\x71\xe4\x33\xda\x55\xf4\x55\x6c\x81\x08\x9e\x76\x20\xc2\xa3\x40\x33\x88\x77\x90\xc6\xc5\x95\x04\xed\x5c\x8c\x04\x70\x1b\x23\x0b\xd3\x2e\x1d\x8a\xcd\xec\x95\xf3\x20\x2e\x6f\x49\xec\x4f\xd5\x28\x18\x0e\x0a\xfe\xa9\x06\x41\x83\x1d\xeb\x9c\xc9\x54\x02\x1c\x79\x2e\xa0\xce\xfb\x26\xff\xc4\xc8\x77\xd1\x42\x04\xe1\x67\x59\x44\xcb\x78\x5a\x89\x74\x90\xd5\x83\x1c\x4d\x07\xa1\x90\x99\xa5\x61\xb0\xda\x98\x29\x46\xc1\xf9\x59\x82\x40\xae\x4e\x70\xa8\x30\xe5\x89\xc5\xa8\xb9\x05\xd4\x10\xec\x60\x36\xe1\x57\xff\x02\x52\xc1\xb3\x1f\xda\x46\x62\xf7\x2a\x6c\x69\xc9\xf7\xc9\x9e\x4d\x4d\x7f\x2a\x99\xa1\xf6\xf7\x25\x75\x65\x64\x4e\x3f\xfc\x0c\xe5\x80\xac\xe7\x3d\xec\xcd\x88\x63\xcb\x8d\x67\x5e\xdf\x24\x0c\xd5\x96\x0b\x88\xbb\x2f\x3c\xcf\x77\xf2\x1f\x21\x0f\x12\xed\xfc\xfe\x99\xd2\x28\x86\x7a\xed\xc2\x9c\x66\x6d\xe7\x50\x27\xc0\x06\x98\x96\x42\xaa\x49\x34\xbf\xb1\x6d\xd0\xe6\xa1\x71\xbc\x9b\x3b\x34\x30\xe9\xb1\xf2\x94\xf4\x1c\x5c\xc9\x97\xbb\x22\x81\xf7\x3f\xf2\xdf\x0e\x26\xa6\x14\x5c\x17\xda\x41\x58\xdf\xa9\xce\xe5\x68\x0d\x4b\x17\x22\x98\x2e\x49\x2b\x6d\xc7\xa5\x57\x2b\x00\x12\x44\x80\xf1\x28\x08\x3f\x0c\x97\xfc\x9f\xb3\xda\x1f\x3a\x0e\x95\x82\x7d\x87\x4a\x42\xb6\x07\xef\xcf\x36\x13\xc5\x02\x52\xa6\x83\x8f\xca\x91\x17\xc1\xb2\xf2\x45\x3c\xb7\xe3\x65\x71\x93\xbd\x44\x0c\xe4\x6c\xf9\x37\xa6\xb0\x0f\xb4\x59\x5e\x77\xeb\x66\x18\x6e\xe6\x10\x9a\x5d\x6a\xb2\x6c\xbb\xf2\x7b\x8e\xc2\xfd\x4a\x1c\x4d\xe8\xb5\x3f\xdf\x32\x4e\x86\x8d\xb1\x06\x78\x3c\x0a\x85\x8d\xd9\x7a\xd0\x8c\x62\x8d\x63\x2f\xf7\x8d\x9d\x4e\xc8\x6b\x27\xa5\xc0\x2d\x26\x74\x7a\x55\x3f\x0c\xce\x99\xac\x94\xb3\xac\x6a\x8b\x9a\xe9\xaa\xfd\x5a\x5d\x6c\x67\xe6\xae\x7b\x06\x26\xe2\xd3\xe7\x60\x50\xae\x61\x36\x02\x6f\x87\x62\xcd\x1f\x4f\x93\xae\xdd\x90\x58\xf7\x93\xb0\xfc\xc3\x6d\x6e\x98\x2a\x65\x97\xa3\x48\x49\x83\xd4\x2b\xc8\xdd\x89\xd5\x44\x1e\xd2\x01\xf7\x8d\x93\x6d\xd3\x1d\x4d\x18\xd8\xeb\x1c\x18\xec\x37\x5f\x9e\x1d\xe2\x4c\xff\xc4\x4f\x4c\xbb\xd7\xeb\x25\xa6\xa6\x1d\xe1\x67\x21\x1f\xf3\x48\x03\xdd\xbc\x77\xeb\x22\xc2\x87\x10\x85\xd3\x45\x4e\x7b\x7d\x73\xa4\x58\x2f\xbd\x10\xee\xa2\x29\xb0\xab\x9e\x82\x25\xac\x50\x57\x4f\x25\xe9\x1b\x21\xb0\xfb\x94\xcf\x36\xca\x77\xbf\x7c\xb6\xca\x93\x0a\x9c\x6b\x65\x94\x58\x13\xab\x21\x0b\x49\x3f\xd6\x87\x89\x11\x8e\x00\xc7\x38\xa3\x38\x2f\x5a\x5d\x1d\xf6\xf8\x7f\x4c\xac\xf2\xe3\xa4\xef\xd9\x29\xb9\xcf\x05\xe9\x9a\xd7\x79\x33\xf4\xca\x3e\xa1\x73\x74\xf5\xf4\x59\x2e\x66\x21\x67\x08\xc0\x55\xf7\xb5\x49\x1e\xba\x51\x0c\x8d\xa3\xc9\x93\x20\x97\x4f\x17\xc8\xd1\x22\xfb\x64\xb8\xa5\x04\xf1\xc5\x11\xb3\xf1\x0c\x05\x14\xb6\xa1\x87\x0f\x52\xae\xb2\xea\xbc\x0a\x03\xe6\xf9\xd6\x0d\x34\xab\x8c\x42\x98\x8e\x2c\x0a\x17\xb7\x16\xc5\x7c\x48\x34\xa8\x99\xa7\xd4\xfc\x4f\xf7\xe2\xb9\xf6\xe1\x7f\xc0\x0f\xd4\xd6\x79\xb9\xfc\x07\x77\x7d\x3c\x72\xa6\xf9\x97\x9f\x7d\x4d\x04\xc5\x82\xac\x87\x55\x90\x59\xa6\xfc\xab\xb9\x91\xcf\x2c\x87\x66\x5b\x2e\x4a\x8b\xcd\x0a\x2e\x85\xd1\xcf\xff\x4f\x68\xea\xcb\xbc\x89\xe5\xd4\xee\x3d\xb8\x6a\xb1\xc3\x8b\xe2\x75\x52\x12\x37\xea\x97\xb8\xf9\xec\x80\xfb\x51\x70\x47\xb1\x32\xc7\x72\xc8\x32\x67\x2c\xb5\x88\x22\x2a\xe5\x23\x56\xf6\x2b\xa2\xe7\xe3\xf1\x26\xad\xd9\x98\x64\xa6\x32\xb2\x68\x47\x33\xc8\x9d\xc5\x87\xf3\xed\x42\xb4\x63\xc4\x19\x9a\xcf\xd6\xcd\xd9\x4a\x60\x1b\x42\x32\xc9\x98\xb4\xbe\x51\x1c\x82\xe7\xe2\xe9\x1b\x51\x89\x3c\xdd\xf3\x58\x21\xb6\xbc\x99\x9e\x90\xa9\xfa\x23\x47\x6a\x59\xf6\xea\x39\x66\x6d\xd6\x8a\xea\xc8\x1c\x94\x3b\xed\x63\x38\x29\xb1\xce\x33\x5c\xf1\xef\x83\xc1\xe1\x3e\xd9\xd7\xae\x00\xb6\x7f\xbd\x68\xe0\xe8\x9b\x17\xa5\xaa\x47\x04\x88\x1d\x5b\xc4\x04\xca\x46\x1d\xfe\x8c\x6e\xe5\x8e\x86\x90\xae\x74\x3d\x50\x58\xb6\x08\xde\x1b\xae\xe1\x3f\xeb\x00\xa0\x47\x27\x91\x56\x75\xca\xa7\x06\xe3\x1a\x9d\x7d\x68\x5e\xc3\x6f\x76\xe3\x44\xd1\x5d\x8b\xe4\xea\xb8\x84\x22\xab\xcb\xdf\x14\x2b\x61\x7b\xd7\x25\x41\xff\x4d\x27\x25\x9e\x89\xa7\xa2\x2f\xc0\x63\x09\xa2\xd4\x4d\x61\xa8\xe7\xe7\x86\xa5\xc8\x71\xaf\xe2\x47\x45\xb3\xd1\xc9\x75\xb0\xb3\xca\x23\x93\xe1\x82\x2d\x25\x64\x05\xa9\x89\xf9\x35\x72\xc5\xed\xd0\x91\x35\x63\x7f\xe7\x10\xd4\x42\x0c\x0a\x8f\xb0\x77\xfe\x16\x3b\x53\xf1\x15\xdf\x14\xda\x0c\x8c\xf6\xc7\x18\x5f\x7f\x70\x2f\xd1\x88\xf1\x53\xbd\x20\x7f\xdf\xba\x90\x50\x67\x91\x9a\xfa\xae\x7f\x97\xd5\x14\xbd\xd4\xb5\x72\x92\x2c\x8b\xba\x7d\x98\xba\x21\x3d\xc0\x5b\xc9\x7c\xd6\x66\x7e\xe6\x29\x21\xca\x98\x4f\x8b\x6f\x45\xaf\x7a\x31\xeb\x50\xba\x58\x68\x25\xd9\x56\x3b\x23\xcb\x0f\x40\xdb\x98\xcb\x7e\x52\xd4\x7f\x1d\xa5\xf9\xcb\xc5\xd8\xf3\x0a\x6f\xbe\xcb\xfe\x70\xc7\x3d\xd9\xc5\x91\xaf\xfb\x74\xdf\x9f\x0b\x81\x93\xb2\xdf\x3a\x3f\xf4\x07\xb0\xee\x56\x2e\x4c\xde\x30\xf2\x98\x04\x76\xab\xd5\xd6\xd0\x00\x68\xb4\x1e\x24\x6d\x69\x24\x14\xc2\x2a\x6b\xed\xc2\x5a\x60\x72\xd9\xa2\x83\x89\x7a\x94\x84\x17\xf2\x3e\x1d\xd1\xc8\xa9\x57\xf7\x87\x76\xae\x8d\x78\xcf\x20\x0c\xa1\x63\x8b\x5e\x91\xdc\x2c\x6f\xb6\x3c\x40\x09\x1e\xe7\xfe\x81\x54\xf3\x02\x70\x8e\x48\xfe\x3a\xd0\x1e\x72\x94\x34\xea\x6c\x74\xa1\xb4\x98\xb7\xb7\x97\xe5\xfb\x01\x56\xe1\xc3\x3b\x30\x1e\xf8\x7b\x09\xa7\xca\x32\x2a\x07\x7c\xa2\x8d\xd5\xde\x86\xab\xbb\x82\x1c\xad\xe9\xba\x69\xec\x74\x04\xb6\xb3\x27\x50\x10\x1c\x46\x86\x73\x9d\xe0\xcc\x2a\xb6\xdf\x16\x9e\x67\x1b\x25\x66\x1b\x72\x2e\xc5\xd5\x52\xea\xaa\x46\x80\x2b\x03\xe9\xd6\xba\x28\x40\xce\x4e\x11\xa6\x8c\x2f\x3f\x0b\xde\x86\x12\xac\x34\x8b\x59\xfb\x4d\x0a\x4f\x1c\x8a\xc7\xa6\xf3\xb1\x69\x16\x5c\x31\x3f\x6b\xed\x65\xdf\x9b\x87\x9d\xe6\x89\xab\xbb\xa5\xf3\xe4\x04\x46\xcb\x03\x30\x74\x0e\x6e\x14\xad\x7e\x6d\xd9\x39\x09\x06\x5a\xb9\xc9\xac\x62\xf9\xe8\xae\xb2\xe6\x87\x74\xaf\x7b\x5d\x15\x47\x67\x47\xe3\x24\x95\x9a\xad\x11\x2f\xa2\x7c\x15\xf1\x82\xab\xea\x97\xc5\xf7\xbe\xf0\xff\x25\x83\x21\x3f\x45\x9b\x5c\x72\x0e\x61\xf1\xa0\x58\x48\x58\xbd\xc8\x24\x2f\x8d\xda\xb5\xe6\x26\xd5\x9e\x85\x49\xce\x9b\x68\x0b\x41\x7b\xb0\x7b\xf4\x0a\xa9\xf0\xa2\x2a\x6d\x4e\x00\xc5\x7d\xb1\xeb\xaa\xb7\xa3\x34\xef\x93\x9f\x64\x77\xff\xd3\x01\xbb\x9e\x67\xaa\xcf\xdf\x29\x3c\x55\xc2\x7e\x93\x5b\x5d\x87\x82\xc2\x4b\x77\xff\x1e\xda\x8d\x4d\x32\x53\x08\x57\x3a\x6c\xbd\x41\x46\x3b\xec\x0a\x69\xa4\x86\xf0\x56\xbf\x39\x3f\xb5\x47\x9e\x7f\x47\x6a\x4e\xec\xe4\x31\x60\xd1\xe4\x15\x34\x2f\x05\x41\x38\x7a\x12\xac\xdb\x6b\x8d\xb1\x95\xce\xc6\xaa\x36\x64\x2c\x37\x55\xdc\xd6\x56\xaa\x61\x1d\x73\x1d\x27\x05\xd7\x8d\x76\x2d\xe9\x70\x65\xbe\xeb\xf3\x66\x75\x84\x40\xab\x07\x7d\x44\x19\x1c\xf0\xd4\xbc\x98\x15\x9f\x0c\xf8\x02\x1e\x77\xd7\x22\x76\x74\xb6\xdf\xda\x7f\x90\x71\x0f\xf6\x12\xf8\xa7\x0e\x4f\xe1\x78\x90\xe3\x36\x69\xc2\x05\x49\x84\x8e\x42\x0d\xae\xfe\xf9\x94\xd8\xbd\x03\x27\x18\x8a\xb2\x16\xad\x11\xcd\x21\x8a\xc9\x55\x6b\x12\x1b\xbe\xe9\xaf\xf9\xc7\xc2\xad\xbd\x04\xdd\xa1\xf5\x8c\x9a\x2b\xf6\x87\x4c\x71\x11\xbb\xeb\x8f\x3f\xf3\x2d\xe4\x07\x73\x85\xb8\x52\x1e\x76\x1f\x75\xdb\xc8\x74\x50\x37\xdc\xb7\xf8\x4e\x82\x45\x08\xb8\x16\xad\xc6\x27\x5f\x04\x57\xed\xc8\xe3\x97\x77\xc7\xdd\x32\x2a\xd1\xd9\xfc\x43\x95\xe3\x11\x57\x3f\xe1\xb2\xd1\xd5\x78\x66\x5d\xa5\x3d\x1a\xec\x92\xd9\x6b\xb2\xf0\xf5\x16\xd2\x8a\x73\xb1\x2b\x9a\xa7\x47\x17\x5c\xc1\x2e\x5a\xb3\x70\xbc\x21\xf5\x39\x6f\x9e\xf7\xe0\xcb\xa5\x6a\x6a\x96\x25\x7f\x69\x2a\xf2\x2e\x7d\xda\x0e\xdd\xa5\x66\xcc\x83\x4d\x55\x5d\x68\xc4\x0b\xa2\x3e\xe1\x77\xfc\x82\x52\x94\xc7\xe5\xc7\x31\xb6\x61\x35\x18\x08\x0f\x75\xa6\x33\xcc\x2e\x15\x47\x8a\xbd\x8f\x4e\xad\x40\x96\xf0\xb3\xbf\x37\xe1\x6a\x74\xa3\x9b\x46\x6f\x4b\x33\xfd\xb2\xa2\x59\x38\x2d\xa9\x54\x34\x9c\xf7\xc5\x10\x70\xed\x42\xa8\x16\x42\xef\xe3\x12\xcb\x8e\xd5\xce\x4b\xd1\x25\x2f\x22\x1e\xf6\x4a\xf9\xcd\x66\xcd\xeb\x37\x58\x1f\x1b\x5f\x93\xeb\x56\x19\x73\xa1\xa7\x0a\xfb\x67\x62\x67\xf0\x3b\xdc\xb5\x2a\x0e\xef\x5f\x14\xee\x5b\x1b\x7a\x3a\x21\xdd\xcf\x5d\xda\x4d\x5c\x95\xe6\x23\x28\xb6\x73\x04\x9f\x1e\xd3\x4d\x06\x49\x22\x09\xf1\xbc\xd1\xd6\xfa\x62\x8d\xfc\xc2\x2c\x25\xa9\x1f\xc7\x3a\x22\xeb\x42\x1b\x83\x33\xb8\xce\x8b\x48\x82\x67\x0b\x5c\x3c\xa7\x98\x46\x43\x61\xd3\x72\x80\xfc\x42\xe1\x6a\x54\x84\xf4\x99\x05\x9f\xe6\x10\x5f\x43\xd9\x49\x86\x05\xd0\x55\xc5\xaa\x1e\x4c\xf3\x3c\xc8\xc3\x83\xde\x3f\x44\x36\x37\xbd\x9f\xeb\x25\x43\xd8\x5f\x90\x6a\xb1\x4f\x91\x41\x75\x48\x3b\xee\x1e\x12\x2f\x0e\x04\xb7\xb0\xc0\x47\x24\x16\x53\xb1\x0f\x2a\x02\x5c\x90\x4d\xdc\x54\xac\x2a\xb4\xb4\x53\x5d\x57\xd2\x3e\x4a\x18\x5b\xb8\x27\x45\x6c\x7d\xde\xed\xfe\x33\x2d\xf4\xcf\xd5\xe5\xab\xb6\x37\x11\x29\xdf\x9d\xba\x1c\xd3\xc2\x31\x0e\x7c\xcf\xec\xf1\xa6\x18\x47\xe7\x8d\xdd\x75\x0f\x05\xbc\x2d\xd6\x30\xb2\x05\xc0\xe2\xc7\xfb\x57\x04\xd2\x7a\x44\x17\x7c\x0c\xce\x5d\xa5\xb6\xc0\x36\x15\x92\xb7\x93\xd8\x7c\x35\x8c\x7c\xad\x1b\x66\x49\x01\x1a\x37\xe9\x05\xd6\x58\xb9\xd1\xc5\x06\x34\xf3\x41\x1a\xf7\xc3\x0b\x02\x96\x9b\x2b\xf9\xb6\x76\xfc\x6b\xc7\xb7\x55\x27\xa1\x0f\xa8\xcf\xa2\x6b\xf7\x79\x79\x47\x3a\x09\xdd\x97\xa3\x5d\xee\xfd\xd5\xf5\x18\xc7\x68\x93\x8f\x25\xcc\x3f\xac\x25\x7e\x91\x53\xb0\x26\x9f\xce\x2f\x77\xd8\x7a\xdc\xbd\x0e\xf3\x43\x31\x91\xcb\x2f\x68\x68\x08\xa6\x77\xe3\x86\x84\xb6\x77\xf1\x11\x14\xe1\xd9\xe1\xa6\xbf\xd1\xad\x61\xd9\x2c\x4b\x88\xd9\x5e\xa6\xdd\xab\xec\xd9\x03\xdb\xe1\x84\xe4\x33\x4b\x5d\xd2\xb3\xc6\x39\xb3\xed\xc1\x85\xf9\x28\x2a\x6e\xe6\xf0\x16\xfb\x93\x1e\x10\x12\x20\xef\x5a\xd1\x52\x6b\x12\xf9\x56\x58\xca\xc6\x0a\x04\x8a\xc8\x9f\x36\x32\x11\x58\x85\xbf\xb6\xeb\x2a\xdd\x86\xe5\xc7\x1a\x8f\x84\x11\x40\x89\xa1\xa8\x44\x14\xb5\xfe\x35\xc5\xf9\x7d\xce\x2d\x89\xf6\x8a\xc6\x19\x9d\x95\xce\x6f\xec\x51\x91\xdc\x76\x8f\xd6\x86\x33\x6f\x19\xc3\x4e\xce\x02\x9c\x66\x2e\x88\xc4\x7a\x61\xba\x77\x2f\xe2\x4b\x8d\x68\x26\xfc\xd6\xf1\xaa\x9d\xfb\xd6\x98\x06\xd9\x2a\x85\xeb\x77\x10\xe3\x9f\xd6\xd9\x2f\x4d\xf1\x73\xff\x5c\x93\xad\xf9\x1d\xb9\xb3\x3e\x43\xdf\x6d\xfd\xed\xaa\x2a\x05\x31\x2b\x9a\x8f\xe6\xee\x26\xfa\xab\x28\x17\x27\x34\xfa\x01\xff\x12\x57\x65\x8e\xb3\x08\xcd\x6c\xdc\x74\xc3\x47\xa4\x95\x67\xeb\x69\x61\x4c\xe9\x6f\x99\x1d\xf4\xbb\x22\x56\x04\x0a\xfb\x79\x6d\xb7\xc6\x37\xf9\xbf\x47\xe7\x34\x60\x64\x47\x82\x2d\x12\xfa\x38\x71\xcd\x2b\x6f\x4d\xca\xda\x0f\x8d\x56\xef\x2e\x1a\x62\xc2\xbc\x39\xb5\xdc\x15\x59\x8d\x78\xeb\xc9\x3e\x57\xaa\x57\xf4\xbd\x57\x3b\xb6\x8f\x35\x87\x54\x48\xd3\xd6\xf4\x54\x86\x33\x5e\xb3\x49\x90\x2e\x0f\x7e\x9c\xd5\xde\xbb\x1e\xf0\xed\x20\xd7\x1d\x94\xe9\x18\x66\x2e\x4a\x6b\xee\x6a\xe8\xb0\xba\x3a\xc8\x80\x24\x8e\xd7\x4d\xba\x26\xef\x66\x75\xfa\xfe\xe3\x9e\x99\xee\x17\xe3\xde\xb0\xdc\x15\x64\xf9\xe1\x6b\xdf\xb5\x8b\x0c\x31\xfb\xf4\x8f\x4a\xbc\x6a\xad\x89\x61\xcb\x1b\xad\x6f\x7f\x93\xbe\xbe\xcd\xfa\xcc\x88\x97\xc2\xf9\x61\xe2\xc0\x7e\xdf\x25\x2a\xdf\x2f\xe2\xbe\xf0\xf8\xcf\xdc\xf1\x9b\xa9\x33\xfe\x08\x10\x03\x75\x72\xa2\xf6\xd4\xad\xe6\xc6\x90\xcd\x7b\xe4\xaf\xf7\xb9\x99\xa3\x82\x77\xfa\x3f\xae\xc0\xae\x51\x73\x62\x65\xb3\x34\x7f\x85\x9e\xd7\xb1\xe0\x57\xd6\xcc\xeb\x05\x6a\xb5\x3d\xde\x67\x30\x5f\xf4\x78\x2b\x43\xfd\xaa\x82\x0c\xed\x67\xcf\x72\xbb\x0b\xb6\x65\x87\xd9\xb1\xff\xdb\xd4\x32\xba\x2f\xaf\x48\x78\xbc\x26\x46\x08\xb5\x20\x3c\xef\x8b\x3d\xf3\x8c\x47\xec\x48\xce\xcc\xf1\x0f\x42\xfc\x7c\xb2\x61\xdd\x19\x1b\x75\xc2\x3d\xec\xe1\x87\x69\x48\x95\x72\xc8\x87\x7c\xdf\x13\x61\x72\xd5\x7b\x72\xfa\x25\xa7\x7e\x96\x1b\x26\x9c\x8d\x48\x89\x81\x53\x0a\xa1\xa6\x23\xac\xca\xd0\xca\xa7\x50\xa3\x7a\x34\x25\xc7\x8e\x9e\x1d\x11\xc2\xd5\xc8\x99\x39\x52\x59\x4e\x0d\x6e\x6c\x1b\xe7\xc8\x03\x3d\xac\xce\xb7\xb0\x13\xc3\xd1\x47\x38\x18\xef\x2d\x4f\xb7\x5a\x2e\xd2\xb4\xf7\x72\xf6\x25\x42\x86\x76\x2b\xcd\x0f\xd2\x21\xdf\xfe\xff\x23\xeb\xc3\x4d\x70\xef\xce\xf4\x30\x8c\x18\xa7\x70\xee\xb3\x3d\x9d\x57\x31\xb7\xd6\x4a\xc8\xa7\x72\x77\xa3\x75\xbb\xdc\x48\x71\x6f\x10\xdf\xae\x63\xfc\x75\x70\x42\xf1\x33\xe9\xde\x7a\x06\xe2\xd5\x77\x47\x9f\x0d\xd4\x80\x5b\x28\x5d\x35\xfb\xb3\xb3\x95\x23\x48\xbe\xd3\x6b\x91\xe8\x15\xf4\xb4\x42\xa5\xff\xba\xf2\x33\xf6\x9c\xfe\xa1\xe2\xc7\xd5\xb8\xfe\x83\x7b\xae\xbe\xb3\xbb\xdd\xcc\x83\x9d\x33\x4f\x40\xef\xf3\xc2\x41\xb0\x69\x67\xd6\x5e\x64\xb8\xb5\x0f\x38\x1c\x86\xf0\x99\xdd\x70\xc3\x04\xed\xcc\xe4\xce\xb2\x02\xc1\x26\x6b\x27\x7c\x18\x97\x7a\x07\x47\xff\xac\x1f\xe6\x4c\x9c\xae\xa3\xb2\x1d\x90\xd9\x12\xd9\xdd\x4e\x96\xdc\x71\x6a\xa9\xa3\xcc\x16\x41\xdf\x84\x9b\xe9\xc5\x32\xd1\x0e\x51\xba\x64\xb5\xa6\xd7\xb7\xb7\x99\xfb\xa4\xbb\x65\xcd\x3c\x5b\x97\x8a\xbe\xeb\xef\xe1\x78\xb2\x20\xe4\x96\x42\x3f\x2b\x5b\x6b\x0e\xc1\x8e\xf5\x25\x62\x09\xcc\x56\xad\xe0\xcf\xfa\xab\x34\x38\xfe\x0b\xa2\xc3\x1f\x72\xa5\x94\x72\x41\x4b\x24\x6c\x5e\xee\xb7\xce\x53\xca\x2a\xd9\xaf\xd2\x9e\xa7\x5b\x6e\x2f\xf7\xc0\xb3\xf7\x0e\xe1\x1c\xb4\xb7\x71\x0c\xd3\x36\x3a\x7f\xe2\x80\xdd\x2e\x69\x03\xf2\xa0\xf9\xc2\x94\x3e\x3a\x54\x3f\x3d\x84\xe9\xbe\x84\x45\xc3\x8f\xce\x79\x34\xaf\xd5\x68\xb3\x80\x43\x53\x59\xd0\xca\xe5\xa9\xbd\x98\x53\x8a\x0c\xa8\xc9\xc7\x61\xde\xe8\xde\x3f\x53\x69\x82\xe6\x08\x8d\xef\xfd\xa9\x8e\xd5\x43\x5c\x78\x0c\x37\x28\x02\x5e\xe8\x1c\xb4\x46\x58\xb7\x67\xfb\xdc\xca\xf6\x61\x35\x0d\x92\x83\x58\xa0\x76\xcc\x2b\x12\x03\x46\x5e\xfa\xa4\x47\xe1\xf1\x9b\x0b\x4b\xec\x7f\x40\x79\xba\xb0\xf3\x80\x05\x39\xf3\x2a\x74\xbc\x8f\x21\x32\xea\xd7\xa5\x0d\x14\xf1\x91\x7d\x70\x45\x0f\xee\xb7\x55\x2e\x3f\xd7\xc4\x61\x53\x0e\x62\xe6\x53\x56\x64\x5a\x58\xd1\x08\xa0\x96\xb9\x42\x58\x45\x0d\x32\xdc\xc7\xc9\x3c\x32\x45\xa8\x9c\x69\x79\x69\x74\x2b\x4d\xad\x35\xdc\x6b\x34\xe1\x81\xa0\x7a\x56\x22\xcf\x64\xc1\xc7\x87\x4c\xc2\xc2\xc2\xcf\x5a\xed\x40\xae\xd3\x25\x1f\xd9\x1a\x97\x67\x1f\xf1\x26\x7d\x8d\xd8\xa1\xf4\x1f\x8d\x1a\x97\x48\x9f\xb0\x15\x50\x0e\x5e\xbe\x7d\x8b\x7b\xb2\xeb\xcc\xed\x1b\xf9\x81\xc8\x4f\x7f\xc4\xad\xcf\x14\x7e\x0f\xec\x5d\x5d\x47\x9c\x95\x61\xbd\x39\xa3\x1b\x78\xf7\x37\xc2\xac\x31\xa4\x95\x8f\x4d\x34\xc0\xf7\x28\xd9\x14\x3d\x1c\xf9\xaf\x56\x20\xf0\x82\xeb\x0e\x69\xe1\x8e\x38\xb3\x5c\xcb\xd0\x62\x1b\x05\x69\x1f\x79\x26\xf4\x7d\xa8\xef\x82\x42\x8e\xf2\x90\x2e\x64\xeb\xce\xbd\x3a\x7d\x06\xd9\x85\xbf\xed\xd8\x12\x4e\x9a\xb1\xad\xce\x2d\x4f\x7b\x94\x3b\x07\xca\xc9\xe8\xd6\xa3\x59\x2f\x5f\xd6\x14\x11\xe2\x2f\xab\x32\x34\x19\xe1\x6b\x56\xe5\xbd\x0d\x2e\xcd\x46\xab\xdb\x21\xad\xfd\xf7\x83\x27\xf4\xc9\x22\x98\xd8\xc2\xbb\x0e\x98\xed\x8c\xb8\xa9\x1f\x4e\x9e\x92\x79\xd7\xbb\xb2\xe1\x2e\xff\x55\x96\x09\xd8\x6a\x13\x57\x60\x1b\x3a\xba\xed\xde\xdc\x6c\xe2\x33\xdd\x9b\xde\xff\xb7\xfa\x7e\x13\x0b\x79\x63\x83\x6d\x59\xba\xee\xe6\x93\x22\xf1\xca\xfa\x61\xba\x9a\x20\x2d\xfd\xdb\x53\xaf\x61\x0d\xbb\x4e\x18\x74\xac\xa7\x82\xe9\x6f\x3f\x96\x15\x0b\x78\xdd\x47\xaf\xc7\xae\xe5\x40\x6b\x08\xfd\xf0\x52\xe3\x9a\x44\xa0\xb2\xf5\xa4\xe0\xdd\xb6\xd9\x21\x90\x80\x47\xfb\xc7\x5e\x27\xf2\x96\xde\xbf\x50\xb9\x77\x91\xc7\xa6\xad\x82\x4a\x25\x3e\xa6\xbb\x41\xb5\x0a\x23\xba\x79\x00\xf4\xe4\x5e\x11\x6b\x3e\x45\x8b\xb7\x8a\x8f\x1e\x6d\x11\xf3\xc4\x0a\x44\x86\x4e\x40\xd5\xa3\xaf\x0f\x81\x22\x05\xd0\xdf\x58\xdf\x0b\x7f\x4e\x3f\x39\xa7\x46\x94\x5f\xa0\xad\x2c\x4c\x6e\x2b\x23\x22\x6e\x5c\x48\x2f\xd0\x30\x36\xef\x27\xcb\xf0\xa3\xb6\x41\xb6\x6f\xe6\x47\xe1\xc0\x5a\x27\xc6\x91\xd7\x36\xa4\x0e\xcf\xcc\xbe\xd0\x9f\xec\x20\xd5\xf1\x48\xf4\x54\xde\xe1\x38\x25\xc6\xd3\xe7\x9a\x44\x32\xd9\x69\x7d\xb1\xd7\xb9\x92\x49\x0e\x51\xb4\xc8\xba\xaa\xf5\x6d\x11\xaa\x8d\x2d\xac\x33\x3e\x11\xeb\x09\x17\x2a\x5f\xec\x28\x48\x68\x57\x58\xef\x4b\xb3\x15\xe4\xa5\x05\xaa\x86\xd8\x18\x62\xd3\xdb\x1d\xb2\x69\xf9\x8d\x6e\x38\x12\x1f\xa8\x45\x8e\x8b\xf2\xa5\xf5\x17\xb9\xba\x22\xb6\x44\xf3\x67\xe6\xfd\x7a\x39\x41\xaa\xc0\xaa\xf4\xa7\xb5\x44\x67\x1e\xe5\xf7\x0a\x33\x0e\x75\xdd\x91\xbe\x62\x45\x05\x72\x94\xd4\x8a\x1f\x3f\x1e\x70\x33\xc9\x00\x5d\xba\xb2\xf5\xae\x74\x8d\xc3\xfd\x1c\xfd\x96\x5b\x63\xa9\xb5\xae\x9d\xd2\xc9\x85\x3d\x2e\x0d\x28\xf7\x90\x06\x18\x0e\xf1\xc3\x29\x1c\x3a\x26\xb6\xe4\xd4\x08\x5b\x41\xab\x16\xdd\xca\x79\x19\x18\x2c\x29\x1c\xe2\x86\x77\xa1\x43\x9c\xf0\xdc\xf9\xfe\xae\xf4\xe3\x44\x6b\xa0\xc1\x75\x65\xce\x0c\x45\x04\xb3\xa3\x1c\x33\x58\xe3\x00\x30\xfe\xa6\xc6\x27\x96\xf1\x0f\x1c\xb0\x38\x18\xbe\xbd\xf2\xc1\xb4\x48\x55\x81\x74\x7e\xf5\x19\x1e\x9b\x41\x80\xa7\x60\x3b\x54\x38\x76\xc1\xd3\xbb\x08\x3b\x5a\x6b\xb8\xe3\x90\x3f\x2e\x05\xf1\x85\x78\x3c\x2d\x31\x90\x56\x1a\x07\xbd\x89\xf8\xf4\x01\xab\x7b\x23\x7d\xb7\x19\xe3\xe8\x54\x0d\x5f\x64\x59\x24\x7b\x50\xf1\xe2\x17\x04\xdd\x90\xc3\x53\xce\xff\xaf\xac\x85\xb1\x6e\xcc\x3d\x1c\x79\xc8\x81\x2a\xa9\xb6\x70\x0c\x15\xd0\xd8\xb2\xe7\x47\x98\x20\x06\x77\x79\x95\x5f\xf2\xe2\x2f\xe5\x98\x7e\x55\xc4\x52\xc0\x87\x7b\x78\x0e\xa0\xbf\x7c\x98\x59\xb3\xb0\x80\xe6\x26\x45\x80\x97\xfd\xf1\x7e\xb9\xa0\x49\x67\xc5\xe0\xd9\xaa\x2a\x0e\xec\x06\x52\x36\xea\x66\x05\x8c\xf7\xf0\xf6\x2e\x28\xf6\x98\xbe\xa4\xaa\xa0\x70\xfc\xeb\x9e\xf9\x49\x99\x87\xdb\x9a\x6b\x97\x8c\x1c\xf5\x4b\xe3\x8e\xb3\xaa\x39\xa7\x17\xef\x80\x33\xcc\x8b\x83\xfc\xc7\xfd\x61\xc0\x70\x71\xe5\xd7\x3c\x05\xda\x7b\x6a\x8f\xaf\xba\xa5\x0a\xaa\x67\x0f\xdb\xdf\x8e\x63\x78\x02\x8a\x2a\x85\x4a\xfb\xc9\x3e\x4c\x18\xbc\x8f\xe7\xe2\x18\xd8\x1f\xf4\xc8\x61\x51\x25\x87\xc8\x94\xf1\xe0\x6b\x65\xeb\x38\x65\xed\x8e\xfa\xd5\x02\xc8\x3b\xfd\x85\xc8\xdb\x66\x59\xda\x88\xfb\xd2\xe3\xf0\x1b\x7f\xc7\x96\xd8\xd3\x69\x0d\xc4\x2f\x6b\x91\xc9\x3f\xeb\x69\x27\xec\x97\x49\x77\xcb\x27\xe4\x8e\x88\x9e\x26\xd9\xb7\xf3\x3e\x0c\xd2\xec\xb8\xff\x82\x04\x46\x7e\xd6\xd1\x22\xe2\xbb\x43\xdc\x90\x4e\xe6\xd2\x76\xbe\xff\x4f\xf1\x1b\x04\x1a\xc2\x09\xdb\x03\x3a\x34\x04\x98\xc2\xb6\xf4\x9b\xe5\x3f\x15\x35\x47\x0e\x2e\x77\xfe\xc9\xe9\x33\xa2\x2b\x00\xf1\xe0\x03\x8f\x58\xb8\x82\x32\x26\x46\x75\xf5\x6b\x9b\x19\xb4\x94\xbc\xdc\xa4\x99\xd9\xfb\x6e\xef\x80\x97\xda\xf0\x3c\x55\xbc\xd0\x11\x4a\x7c\x37\x57\xd9\x7c\xb3\x45\x25\xe8\xef\x04\x34\x67\x62\x90\xa1\x74\xf2\xba\xf9\x53\x45\xd3\x7d\x7f\xfc\x96\x7a\x7f\x7a\x96\xa2\x6e\x7f\xca\x29\x80\x1d\x9d\x51\xee\xe2\x14\x25\x2a\x0d\x80\x62\x15\xc6\x9f\x9b\x2d\xcd\xbb\xc5\x07\x4a\x3c\x3f\x51\xbf\xf2\x76\xf7\x46\xf2\xd2\x14\x72\x63\x0b\xfb\xf9\x01\x44\x2c\x1a\x6d\xd2\x2b\xf5\x95\xbd\xa9\x7f\x31\xf7\xfe\xc5\x69\x26\x94\xab\xf2\x81\xbb\x28\x49\xbe\xea\x51\x3a\x7f\xe2\x5e\x11\x68\xc2\x1e\x06\xaa\xd8\x34\xdb\xf1\x09\xd3\x54\x2f\x22\xb2\xba\x7e\x2b\x2d\x49\x34\xba\xd8\xd0\x5d\x2e\x87\x25\xc4\xef\x4f\xe5\xbc\xee\x86\x36\xd4\x66\xee\x57\x83\x59\x63\xef\xd4\x14\xe4\xeb\x4d\xbd\x3e\x5c\x53\x97\xfe\xa6\xfd\xdf\xcd\x33\x7c\xcf\x41\xcc\x26\xd3\xf8\xac\xdc\xeb\xce\x55\x3e\x7c\x30\xd5\x7e\xa8\x84\x38\x36\xe6\x5d\x9c\x11\x2d\x74\xc2\xdc\x81\x0b\xd5\x31\xb9\x6f\xc3\x80\x24\x97\x16\x4f\x81\xbb\xb4\xa4\x7b\x23\x42\x4c\x5c\x81\x26\xd8\x83\xa3\x4a\x2c\xd2\x8b\xcf\x52\x6b\xae\xd2\x21\x3f\x41\x85\xad\x9d\x2d\x44\x2d\xfa\x08\xb1\xde\xbd\x6a\x80\xb9\x89\x30\xcb\xa3\x91\x8e\x0e\x76\x14\x56\x10\x6c\x74\xb7\xb6\x36\x87\x44\x94\x23\x8f\x32\xfd\x3c\x22\x77\x00\x1e\x17\x7c\x3f\x44\xe7\xdf\x0f\x51\x3b\xf7\xf8\x44\xfd\xc8\x2b\x40\x26\x33\x04\x46\xb0\x70\xdb\x3e\x22\x24\x02\xec\x77\xb7\x7d\xb0\xf7\xb5\xa9\x48\x37\x29\xe6\xf6\x4c\xe3\x1c\xf6\xa4\x3b\xb2\xd5\x12\xab\x11\x6b\x3e\x12\xbb\xde\x5d\xf4\x0e\xeb\x73\x7d\x63\xab\x83\xdf\x36\x5b\x7d\x55\x67\x01\xd4\x2a\xef\xd8\xb7\xee\x87\x0d\x44\x6f\x3c\xea\xe0\x5c\x23\xc1\x62\x05\x21\x45\xab\x25\x18\x71\xae\xcf\x23\x40\x22\x81\x51\x09\x75\xce\x8a\x20\x7c\x32\x04\xf0\x7a\x63\xd1\x0b\x60\x91\x23\x41\x22\x6f\x7b\x0b\x13\x6d\x00\x20\x0b\x9d\xf4\xd6\xbe\x44\x71\xbb\xf6\x69\xa8\xac\x54\x5c\x73\xca\x85\xed\x64\x0a\x36\xff\x06\x47\x40\x66\x06\x10\x59\x90\x1f\xf0\x97\x43\xc9\x64\xd5\x2e\x73\x5c\x2a\xd1\x0e\xf5\x1e\xcb\x9d\x3b\xc6\xba\xdc\xf4\x1b\x83\x8f\x4b\xf2\xad\x76\xa9\xbe\x4f\x2e\x4e\xdf\x15\x04\x52\xf8\x8a\x78\x35\xfb\x60\xc9\xb3\x05\x2b\x80\x26\xee\x4b\xe3\x83\xce\x2c\x99\xe6\x60\x80\x88\xc2\x3a\xcb\xc9\x6f\x5e\x0a\x2b\x9a\xf2\x0f\xb9\x0e\x30\xb4\x33\x42\xe6\xb2\x8a\xcb\x34\x07\xd5\x70\x2e\x5d\x47\x36\x9e\xed\xe6\xce\x19\x08\xd9\xcf\xcc\x43\xf2\x2f\xeb\x05\x70\x83\x07\x56\x3a\xc7\xd2\xdd\x74\xb0\xd9\xce\xb8\xdf\x41\x27\x48\x14\x73\x4c\xf5\xbf\xc2\xc7\x38\x95\xdd\xb1\x71\x0b\x64\x6a\xaa\xe1\x7a\x31\x05\x42\x3e\xc1\x91\xc8\xaf\x54\x94\xf1\xff\x30\xf2\x58\xf3\x78\x9e\x16\xab\x9e\xbb\x93\x40\x74\x8a\x93\x10\x93\xc0\x12\x25\x51\x09\xe6\x5e\xfb\xd5\x69\x6c\x2e\x0a\x8a\x7a\xbf\x1b\x43\xef\x10\x08\xe0\x35\x51\x04\x44\xd4\x88\x23\x85\xd9\xb9\x80\x92\xe5\x47\x4c\xff\x0d\x30\xb0\x53\x2c\x98\x5f\xc6\x87\xcd\xfe\xd1\x1f\x3b\x61\x10\x63\x73\xd8\xb1\xfb\x67\x91\x80\x56\xf0\xe9\xf3\x08\x33\xa2\xa7\x40\xbc\xe7\x02\xfd\x16\xbd\x22\x19\x8c\xe3\x9f\xb5\x1e\xea\xe9\x96\x2a\x10\xd4\x0b\xf7\x58\x22\x29\x5e\xe4\x5b\x5c\x12\x72\x5c\xe8\x39\xcd\xb4\xca\x24\xc2\x01\x63\x14\x71\x87\xdb\xd9\xf1\x09\x4f\x6d\x64\xc7\x27\x49\x72\x39\x86\xa8\xaa\x83\xb4\xa1\x0e\xe5\x5c\xe5\x93\x6f\x17\x89\x5d\x7a\x4a\x16\xb2\x0f\xe4\xc8\xf3\xce\xb2\xe8\xb1\xee\x48\xb6\x0d\xb8\x5c\xc4\x64\x68\x26\xcb\x30\x69\xd8\x14\xd4\xb3\xc8\xce\xf7\x81\x7a\x69\xf3\x9a\x8a\xb1\xf3\x2a\xd8\xc0\x76\xbf\x54\x33\x9d\xa7\x5b\x88\xfb\x07\x19\xf3\x8d\x36\x1c\x11\xb5\xe1\xba\x82\x34\x78\x89\x5e\xdb\xfb\x93\x92\xf3\xef\xd9\xe4\x66\x0c\xa9\x70\x2f\xe0\x20\x1c\x76\x5d\x98\x05\x89\xfa\x62\x47\x03\x6b\xa4\xc9\xde\x5b\x37\x00\x86\x19\xbe\x94\x68\xf0\x03\x24\x19\x62\x5f\x52\x8c\x57\x84\xb8\x74\xdc\xbb\x41\x8a\x08\xb7\x5f\xc4\x66\xcb\x55\x08\xa4\x83\x98\xb9\x9c\x92\x03\x59\x49\x75\x37\xf2\xb4\xe3\x29\xc2\x47\x38\xff\x84\x1b\x9b\x10\x93\x23\xa2\x62\x2b\xb1\xf8\x4e\xc1\xa7\xe4\xd8\x8b\x4e\x51\x8e\xe1\x8c\x60\xc5\x41\x31\xbb\x5d\x8a\xf2\xe8\xaa\x62\x30\x1c\x9c\xc2\xdb\x6a\xd3\x63\x9f\x37\xd1\x1b\xb6\x20\x1f\xf6\xac\x65\xed\x1a\x54\xe6\x61\x8a\x69\x61\x0b\xe7\x08\xd2\x62\x83\x22\xbd\x27\x39\xb9\x08\xc5\x15\xc2\x84\xf4\x88\x0a\xcd\x7f\x40\x4b\x70\xf8\x56\x71\xf1\xcf\xaa\x48\x8f\xf0\xd9\x7f\xe3\x86\xf2\x9a\xc9\xde\xf9\x12\x8b\x90\x04\xdb\xba\x0f\x3f\xf9\xcf\x0a\xaa\xbb\x2f\xe9\x23\xf5\x26\x2d\xdf\x1e\x72\x84\xef\xf3\xb5\x82\x11\x86\x26\xef\x2f\x9a\x82\x60\x5c\x53\x8f\x7f\xec\xe2\xa6\x5a\xdd\x2d\x6e\x93\x8d\xc3\x1d\xd3\x93\x8b\x66\x89\x30\x59\x0f\x3b\x6e\x5b\x8f\xcc\x34\xaa\x76\xcf\x2f\x11\x90\xad\xe1\x25\xd0\x11\x0e\x72\x42\x55\xfc\xd6\x71\x6d\x8b\x48\x90\x39\xdf\x00\x43\x88\xb5\x80\xee\xf9\xf8\x7f\xf4\x52\xfe\x49\xe1\xee\x35\xaa\xa8\x9b\xe8\x37\xba\xe6\x6f\x09\x04\x66\x54\x8a\xe4\x55\x64\x06\xe0\x2e\xf5\x64\x4f\x5c\x41\x73\x06\xcb\x82\x1e\xf7\x4b\x92\xcf\xdf\xe9\xe2\x59\xbf\x53\xdc\xbb\xc8\xc7\x3b\x93\xdd\x9e\x87\x16\x68\xa3\x02\x88\x06\xd9\x42\xf2\xe9\x2e\x7d\xfd\x4b\x33\x8b\x20\xa4\x8c\xa8\x5a\x7a\xa7\x2d\x70\x99\x23\xdb\xf5\x34\x52\x90\x8c\xea\x0a\x95\x45\x88\xac\x8b\x22\xea\x50\x2d\xc5\x90\xf5\xb8\xbf\xf6\xe7\x7b\xd9\x53\xd9\x02\x1c\x76\x07\x24\xd6\x30\x28\x4a\x84\xe1\x40\x0e\xc9\x08\x39\x38\x54\x05\xfd\xc9\xaa\x2c\x5d\xff\xc0\x76\x0b\xc9\x17\x25\xe0\xb5\x23\x0f\x2a\xe9\x6d\xbb\xe0\x9c\xe9\xbd\x04\xa1\xed\x88\x7c\xfb\xb0\x68\xfc\xdf\xad\x67\x61\x95\xe8\x4e\x6b\x13\xb8\xdf\x31\x36\x6d\x3f\x6c\xf3\x95\x29\x13\x06\x38\xc2\xf6\xc1\x8e\x1c\x48\xaf\xb4\xb3\x8b\x0b\x7b\x5e\x2a\xb2\xbc\xf2\x70\xd6\xc3\xfe\xa4\xc8\xc5\xca\x2b\x47\x9b\xf6\x9c\xce\xa0\x5d\xf8\xb7\x41\xb9\x40\xc7\x68\xbb\xc1\x46\xb2\x2a\x46\x5a\xb2\x01\x1e\x65\x5d\x85\xc3\xb1\x65\x6c\x8a\x0b\xb4\x15\xbf\xe9\xe0\xce\x21\xef\x54\x95\x58\x87\x32\xe9\x6a\x04\x39\xad\x21\x07\xaf\x85\x55\xd5\xf7\x48\x8e\x73\x2a\x10\x1b\x83\xa7\x0f\xf3\x58\x5a\x6e\xc7\x5a\x66\x72\x8e\x31\x5f\x5a\x55\x7a\x15\x72\xb3\xd7\x1e\x2a\x4a\x71\x2e\xfa\x11\x58\xba\x3e\x9f\xdf\x8d\x9b\x71\x6a\x47\xc7\xba\x65\x98\xc3\x9f\x5b\xac\x4d\x0a\x76\x54\x6e\x5d\xee\x1b\xce\x25\x9c\x2a\x42\xea\xd0\xec\x41\xc2\x58\x61\xf5\x7c\x53\xf6\xb7\xa8\x0e\x38\xb7\xda\xe4\x5f\x95\x02\x6c\x81\xab\x35\x0b\xaf\x90\xe6\x83\x79\x21\x7f\xeb\x12\x0a\x07\x2f\xb2\xca\xfe\xab\xc8\xa2\x77\x5b\xb2\x60\x4c\x92\x0a\xb8\xc8\xfa\x76\xab\xaa\xba\xe0\x4b\x2e\xe9\x3d\x09\x66\xba\xae\x12\x18\x54\x0b\x2b\x06\xab\x33\xd8\x23\x76\xc8\x5d\x4c\x24\x5d\x99\xcc\xb9\x24\xa2\xb1\xf3\x91\x9a\x4c\x7e\x5e\xaa\x44\xee\xff\x04\xbf\x9c\xd7\x2f\x0d\x46\x85\x1c\x32\x67\x1e\x98\x68\x7d\xdf\xd4\x7b\xfc\xa5\xf9\xee\xe2\xde\xc0\xb4\x12\x3f\xd9\xca\x3d\xaf\x19\x8a\x0f\xb2\x59\xc5\x0d\x8d\xfe\x79\x9f\x2d\x9c\xdd\xad\x26\xe0\x37\x18\xd5\xa3\xf3\x40\xbd\x9a\x2b\xe3\xf4\x54\x98\x69\x11\x50\x95\x1b\x47\x24\x13\x94\x9d\xf2\x10\x01\x5d\x9f\x1f\x9c\xd5\x92\x09\xbc\x66\xf3\x47\x19\x1b\xda\x2b\x20\x97\xd9\x99\x53\x22\x3b\x5f\x4f\x96\xea\xb0\x6b\x57\x12\x4d\x3f\x77\x72\xf9\x18\xef\x56\xc1\xf5\x92\x26\x3a\xd6\x15\x44\x14\xa7\x9c\x88\xf9\x03\xa3\xd9\x23\x9c\x66\xe1\x6d\x44\x2e\xe9\xd0\xd1\x6e\x67\x5c\xd4\xca\x8c\xf2\x72\x1e\x4b\xcb\xca\x19\x1d\x4d\xe1\x88\x76\x74\x69\x02\x0d\x50\x96\xc8\x3e\xf2\x18\x05\x3e\x26\x32\xb1\xac\x92\x53\x8e\xf5\xd3\x7a\x22\x0e\xbe\xbe\x1a\x80\x35\xdb\x75\x64\x1e\x76\x51\xd6\xda\x07\xac\xfc\x34\x35\x02\x91\xd1\xe7\x58\xb6\x0d\x58\x8b\x88\xbf\x3b\xa3\x6b\xd3\xbf\xa2\x05\xf7\x4d\x3c\x33\x4e\x33\xf7\x2d\xf0\x46\x41\x88\x07\xd5\x02\x83\xa0\x7f\xa7\x9a\x28\x5f\xc1\x33\x8a\xc2\x5c\x71\xe5\x35\x81\x62\x8c\xb1\x4d\xb6\x6a\x38\xcd\x90\xee\x9d\x59\xd9\x83\x13\x48\x0a\x0b\x33\xa2\x52\x07\x3d\xc1\xfb\xfa\x4d\x44\xa9\x9c\x8e\xc9\x4f\xad\x32\x43\xe9\x17\x41\x40\x76\x27\x0e\xcd\xa0\xae\xb7\x67\x95\x07\x55\x4e\x9f\x20\xa6\x9c\xff\x86\x49\x37\xb3\xdb\x45\xf5\x55\x65\xd4\x09\x36\x0d\x6a\xe5\xef\xaf\x0a\xa5\xfb\x54\xf9\x64\xad\x88\xde\x32\xcf\xc9\x09\x2b\x14\x3f\x58\x9e\xa2\x4a\xe3\x6f\x08\x1b\x14\xa0\x1b\x41\x47\xad\xdb\xd3\xdf\x66\x5f\xd3\x87\x08\x19\xb1\xfe\x58\xa0\x39\xf1\xc5\xc2\x1b\xa9\x0b\x8f\xe6\x2e\x47\x42\x35\x4b\x55\x56\x52\x8a\x27\xe9\x72\x4c\x72\xbd\xca\xca\x62\x65\x58\x55\xc5\x9a\x6a\x51\xba\x19\x6e\xaf\x83\x38\x69\x97\x26\x7e\xae\xd7\x21\x9b\x74\x40\xa2\x28\x23\x12\x55\x94\x7d\xdd\x2c\xec\xbe\x10\x72\x33\x80\x27\x7c\xfa\x68\xda\xf8\x50\x52\x44\xa2\x1a\x23\x38\x8b\x0e\x4b\xb1\xa8\x92\xae\x1f\x97\xfa\x25\x44\xaa\xaf\xff\x69\x34\x35\xad\x31\xb4\x4a\xa4\xb3\xb2\x9a\x22\xc6\x25\xac\x0a\x46\x59\x5e\x68\xb8\x3c\x92\x90\xdb\x2b\x32\x96\x59\x43\xd9\x8b\xd6\x8c\x5f\xfc\xcd\x7f\xb5\xdd\xd8\xee\x10\x4a\x3e\x3e\xaa\x91\xc8\x60\xba\x00\xbb\x84\x23\x3b\x15\x68\x58\xe6\xff\xac\x5c\xa3\x1b\x8c\x13\xd4\xaf\xb4\x87\x9d\x93\x95\x43\x1a\x18\x5d\x52\x31\xdb\x82\x2d\x0a\x4e\x51\x2f\x36\x70\x03\x13\xec\x41\xe3\x19\x02\xfc\xb0\x12\xb3\xab\x54\xa0\x0e\xe7\x50\xac\x4a\x0a\x60\x0a\x16\x2e\xbf\x0c\x89\x49\xb6\xaf\x18\x4e\xc5\xe7\x30\x97\x10\xb8\x14\xc8\x84\xff\x6d\x02\x87\xd8\x41\xd0\x6c\xac\x4d\xb1\x0e\x25\x08\xa3\x26\xaa\x4b\x5c\x2a\xac\x90\x1a\x66\x0d\x14\x2a\xd1\x7a\x07\x41\x40\xf1\x87\xa5\xb5\xa9\x46\x96\x22\xb7\x78\x19\x8e\x7d\xd8\x0f\x1d\xbc\x1b\x59\x12\x61\xce\x7d\xd3\x84\x52\x46\x34\xa4\x6b\x1d\x19\xb8\xad\xd4\x24\x6d\xda\xb5\x49\xab\xd0\xb8\x42\xf0\xf9\xfd\x93\xc6\xb2\x3e\x83\x65\x73\x69\x72\x87\xe9\x16\xef\xcd\x1d\x73\x86\x91\x0a\xcb\xc6\x99\xab\x74\x59\xaf\x07\x3d\x12\x20\x45\xd6\x61\x82\x25\xfc\xe4\x9d\x51\xb3\x55\x99\x4e\x56\x6f\x05\x79\xa6\xd6\x49\x43\x80\x2a\x4b\xa9\x9a\x23\x53\xae\xfb\xc8\xeb\xf2\xfe\xba\xa8\xcc\xf9\xa5\x04\x99\x88\x35\x6f\x01\xee\x6d\x6e\x9a\xa0\xdc\xdf\xa4\x12\xca\xfa\x52\x5a\x5c\xd6\xc8\xfe\x5e\x6b\x40\x51\x63\x84\xb4\xaf\xda\xb3\xad\x1c\x42\xf4\x07\x2b\x21\x6c\x12\xac\x8e\x40\x45\xf0\xda\x04\x0a\x04\xff\x3a\xc8\x53\xb4\xf0\xdc\xd1\x15\xd1\xb1\x2c\x76\xc0\x42\x12\xfd\x16\xd6\x01\x0b\xfd\x9d\xd6\x08\x7e\x71\xb6\x6a\xd8\x0d\x80\xa4\xda\xfc\x71\x8e\xfe\xb7\xf3\xae\xc8\x64\xdd\xd2\x20\x4f\x81\xdc\x08\x38\xe2\xdd\x6c\x63\x51\x54\xdd\x29\x2f\xfb\xed\xb2\xde\xc8\xd1\xd2\xc5\xbd\xf1\x7c\x2c\x96\x75\x36\xd9\x22\x09\x51\x92\x83\x24\x82\x3b\x53\x04\xa4\x8b\x6e\xb2\x90\x6b\xb8\x24\x45\xb7\x22\x52\xe9\x94\xf9\xbd\xae\x94\xf9\x0e\x73\xa2\x79\xf3\x56\xac\x8b\x50\x8e\x99\x84\x72\x94\x58\x9a\xdf\x42\xa3\x12\x50\x14\x3c\xaf\x55\xcd\x58\xab\x47\xce\x3f\x21\x27\x15\x36\xc1\xd4\x11\x7b\x60\x4e\x0a\x7f\x56\x86\x88\x3f\x6d\x3a\x8c\xf2\xb3\xb9\x45\x8b\xa0\xa7\xf7\x9d\xf2\x2f\x2f\x5e\x41\xc2\x4e\xbf\x0f\x4e\x0f\x8e\xcc\x12\x3e\x65\xd3\x3d\xaa\xb1\xb6\xd5\x28\x5f\x83\xfa\x0e\xe3\x65\xd6\x3b\x35\x0c\x33\x81\x63\xb1\x02\x52\xa6\x10\xae\x60\xbd\x68\x53\x08\x73\x7c\xc1\x1a\x07\xc9\x92\xc4\xad\xae\x2b\x45\x5e\x9e\xed\x94\x44\xad\xe0\x48\xc7\xb4\x64\x7f\x12\x51\x07\x0d\x21\x26\x0d\x21\x0b\x5a\x7f\x55\x35\xb6\x64\x89\xed\x4a\x18\xce\xe9\xca\x4f\x42\x2a\xd9\x28\x0d\x9a\x7d\x09\x5b\x75\xf9\x07\x75\x1a\xe7\x25\xb8\xa7\xfa\x3f\x3f\x3f\x4f\x59\xe9\x1f\xfc\x59\xcf\x7b\xc1\x66\xf5\xf4\x19\xdb\x83\xa5\x8c\x4a\x9a\xa0\x50\x3c\x59\x33\xd9\x03\x5f\xda\xa7\x33\x18\x7d\xa1\x11\xaf\x87\x52\x73\xc1\xea\xa7\x76\x6e\x55\x8a\x92\x87\x5c\x71\xd4\x3b\xbc\x9e\x9e\x40\xfb\xca\xc1\xae\xe9\x99\x29\xa1\x78\xb6\x91\xe5\xb3\xed\xa8\x08\x7e\xf7\x5d\xdb\xdd\xa0\xf5\xb9\x5e\x3a\x93\x1c\xe1\x3c\xc3\xbd\x11\x81\x19\xee\x30\x92\x3b\x32\x99\x96\x83\x50\xb5\xa1\x68\x8e\x3f\x14\xbd\x39\x43\x69\xda\xd3\x5c\x22\x42\xba\x5f\x54\x03\xbd\xfd\xff\x38\x3f\xe8\xcf\xb0\xcd\x2c\x83\x6c\x0b\x19\x54\x11\xf5\x54\x53\xf7\x62\xd0\xc2\x52\x34\x6c\xe6\x8e\x9d\x0f\x94\xa3\xd6\x3d\x3e\xbf\x9d\x65\x88\x28\x80\x2d\x6a\x0f\x5b\x76\x95\x28\x56\xaf\x60\xc8\x5e\xc6\x58\xfd\x92\xdf\x8c\xac\x0a\xb6\x3b\x7d\xea\x52\x54\xff\x3d\xca\x08\x3a\x60\x5b\xcb\x2d\xb2\x0f\xcd\x6f\x44\x0f\x6a\x85\x56\x09\x7a\x10\xf2\x35\xf6\x49\x14\xa2\x63\x8d\x37\x12\x7a\x1f\xa1\x87\x30\xc0\x66\xb9\x74\x43\x8a\x46\xaa\x8f\x4c\x1e\xd2\x97\x51\x44\xee\xa5\x14\xb0\x95\x5c\x4e\x8f\x34\xc8\xde\x08\x16\x10\x99\x5a\x1f\xcf\xa5\x28\x5c\x76\xb4\xc0\xae\xd7\x24\x74\x6b\xd2\x24\x90\xdf\x84\xfa\xc3\x17\xb2\xb1\x13\x55\xbe\x6b\x52\xba\xce\x4e\x1d\xc1\x5b\x25\x6b\x26\x99\xdd\x13\xbb\x52\x13\x24\x05\x90\x52\xaf\x95\x38\xd0\x85\x12\xa3\x0b\xc4\xb4\x4b\xdf\x80\xc4\x84\x8f\xb6\x72\x2d\x10\xb2\x10\xfb\xf0\x4d\xee\x52\x0b\x37\xb3\x42\x3a\xea\xb4\x2b\xe0\x30\xf1\x2d\x1c\x0f\x7b\x38\xdf\xc8\x3f\xbf\x80\x46\x24\xec\x8b\x39\x92\x8e\x81\x25\x0d\x18\x21\x05\x72\x2a\x52\xe7\x9f\xf8\xde\x59\xe2\xae\x6f\x8d\x9a\xe1\x53\xe7\xfa\x61\x9d\xf8\xa9\xdc\x36\xde\x9f\x85\x0c\x38\x2b\xea\x38\x14\x7b\x53\xbb\x6f\x0f\x21\xbd\x2d\x4b\x2b\xf3\xd6\x86\xa1\x2d\x89\x35\xda\xdb\x8f\xfd\x57\xd6\x88\x11\x69\x21\x84\xd4\x30\xd1\x51\x0f\x69\x6b\x75\x2c\x2f\x6b\x91\x79\xd9\x05\x3e\xe6\x5b\xec\x4b\x7e\xfe\xf7\xa8\x34\xe3\x0b\x8a\x19\x86\x3e\xdb\x2d\x42\x3c\xe3\x6a\x96\xc3\x57\x19\xf8\x00\x4e\xb3\x17\x7c\xb8\x70\x65\x7b\x46\x2d\xaf\xaa\xbf\xe4\xc1\x89\x14\x0d\xb8\xa9\x2c\x2b\x41\x0f\xe1\x75\xe0\xe9\x9d\x9d\xc3\x55\x1a\x66\x26\x94\xe2\x84\x59\x16\x37\x2b\xf8\x7a\xaf\x7c\x8c\x11\xa3\x9d\xf9\x1c\x3b\x42\x1e\x21\xf3\x6f\xbb\xed\x45\x79\xc7\x2d\xb1\x89\xb6\xc4\x3b\xdd\x17\x25\x4b\x02\x6d\x1f\x71\x67\xc4\xc2\x27\x85\xfb\x11\xb3\x46\x64\xe0\xb0\x42\x5b\xe9\xb0\xc4\x52\x10\x46\xb5\xaa\x28\x37\x47\x24\xe8\x16\xee\x8b\xfc\x14\x93\x0a\xdd\xf8\xff\x6e\x5a\xd7\xde\xe1\x1d\xee\x32\x32\xff\x63\xed\x82\x93\xa8\x58\x9c\xb2\x96\x04\x11\x38\x5b\x95\xff\x02\x38\xda\x6d\xf0\x8a\x78\x6a\x9a\xd4\x92\x63\x01\x39\x1e\xd3\xcc\x6a\x23\xb9\x3a\x98\xe6\x9b\x3f\x92\x21\xd5\xe3\xd8\xd9\xc3\x6d\xfe\x98\x14\xe7\x79\xe4\x7d\xd1\xe1\x67\x4d\xa6\xc4\x39\xb6\xe3\x88\x55\x05\x87\x26\xfe\x9b\xdf\xc1\xff\xbb\x13\x3d\x08\x0f\x9f\x96\x84\x99\xed\x10\x3a\xe2\xea\x03\x47\xeb\xca\xbc\x5e\xb4\x43\x01\xa3\x53\xce\x24\x47\x5d\x28\x7b\x4c\x5a\xad\x9c\xfc\x8d\x1a\x8f\x7f\xb5\xc8\x76\xfb\xd8\x4f\x62\x91\x41\x2f\x0f\x9e\x1a\xf5\xfe\xfa\x0f\xab\xbf\x30\x41\x24\x64\x91\xaa\xad\x5b\x0d\xb8\x86\x17\x97\xb3\xfd\xc0\x8b\x03\x4b\x72\xfe\x36\x6a\x03\xb6\x92\x65\xe1\x89\x0c\x13\xb9\xdf\xaa\x78\xb1\x05\x47\x64\x5b\xe4\xad\xd9\x56\x10\x45\xdb\x51\x59\x49\x7e\x02\x71\xb3\xae\x84\xf8\x13\x1d\xb1\x34\xd7\x6c\x30\x1c\x30\x05\x31\xc0\x99\xe1\x66\xf7\x15\x65\xd3\xf9\xd2\xdc\xdc\xde\x02\x19\x2e\x82\x9d\xf1\xf8\x7f\x2d\xfa\x98\xd6\x8c\x99\xe1\x4a\x98\xce\x16\xd5\xa2\x31\x19\x41\xe2\xe6\x30\x04\x21\xeb\x0e\x23\x65\x56\xa1\xc1\x71\x03\x3f\xab\x36\xa2\x56\x11\xbc\x76\x0b\x34\xd3\x6c\x36\x1d\x41\xa6\x87\xc4\x20\x4c\x1d\x97\x18\x89\xaa\x44\x1d\x03\x29\x84\x0f\xa2\x6c\xe0\x53\x27\x89\x55\x48\xad\x94\xc8\xb3\xdc\x9a\x72\xd6\x2e\x29\xcb\xf3\xa5\xf4\xb8\x5f\xf4\x16\xd2\x96\x64\xe1\xb3\x84\x1d\xc6\x82\xc3\x4a\x0b\x79\x60\xb9\xa3\x05\x8f\x2a\x7c\x80\x89\xf5\x43\x00\xdb\x11\x0c\xaf\x18\x27\xcd\x76\x51\x32\x88\x29\x88\x94\x33\x62\xf7\x7d\xeb\x9d\x97\x24\x82\x83\x15\xa8\x51\x9d\x6e\x9f\x58\x00\xbd\xaa\x2c\x46\xdf\x71\xdd\x60\xa9\x50\x2b\x27\x91\x7f\x7c\x91\x36\xc7\x80\xf1\xb5\x91\x2f\x51\x4e\x1f\xec\x17\xb6\xe9\xb0\x92\x0c\xbf\x5f\x8c\x7d\x88\xbf\x85\xb6\x06\x0e\x5c\xbf\x9a\xb0\x54\x19\xff\x36\x21\x88\xbd\x82\x4b\x99\x48\x21\xdb\xa2\x5a\xb3\x9e\xf4\x15\xf5\xe6\x67\xba\xe9\x91\x35\x25\xb7\xe9\xe3\x2a\x87\xb1\xb0\xcf\x69\x02\x9f\x6b\x7e\xc0\x56\xd4\xa4\x57\x18\x74\xd9\x09\xab\xa9\x25\xe2\x0a\x78\xd6\x83\x24\x16\x45\xa9\x46\xea\x23\xe7\x36\xa3\x9d\xd9\xba\xa4\x47\x9c\xda\xf2\x9f\x97\x9b\xd3\x88\xe2\x4d\x26\x29\xa5\x59\x1f\x8f\x3e\x84\x7e\x38\xbd\xdc\x93\x50\xed\xaf\x56\x75\x9b\x02\x71\x93\x17\x71\x6a\x59\xc2\xb0\xcd\x7a\x90\x60\x7e\x8a\x3f\x16\x11\xfb\xe7\xa5\x47\x09\xbd\xe2\x1e\x7f\xd6\x16\x6d\x03\xa3\x4c\xff\x29\x1a\x83\xc0\x02\xcc\x91\x34\x5e\xed\x39\x62\x2a\xf3\xae\x72\x20\xdb\x35\x44\x86\x99\x15\x5b\x4d\xe5\x31\xdc\x17\x75\x5f\xf6\x6d\x99\x9f\x58\x29\x6d\x1a\x0e\xda\xb2\x0d\xf5\xad\x5a\x03\x3b\xe9\xe4\x44\x9c\xa1\x56\x95\xa9\xb5\xab\x9a\xa6\x72\x2c\x5a\xd4\x4d\x5a\x4d\xda\x55\x45\x48\xd9\x31\x91\x2f\x16\xa3\xd6\x8c\xc9\x3c\x65\x77\xe1\x25\x72\x4f\x36\x25\xed\x0e\x3c\xb3\xfb\xcf\xde\x0c\xc1\x14\xd4\x7f\xd4\x9e\x73\xd2\x12\xae\x28\x87\x64\xcf\x3d\x0e\x41\x45\x9f\x72\xbe\x59\xd7\xbd\x6a\x1c\xba\xa2\x2c\x66\x39\x4a\x26\x57\x0f\xe5\xd5\x2b\x48\xe5\xf0\x47\x69\x5c\x32\xe9\xc9\x1d\xc5\xe2\x6e\x0d\x4e\x92\x68\x63\xf5\x7e\x6b\xca\x89\x72\x2e\xa8\x60\x31\x95\x3c\x52\x4c\xbe\x50\x23\xfe\xef\x6e\x51\xd6\x7c\x84\x11\x9e\x57\x72\x56\xf8\x8a\x68\xb6\x24\x15\x81\x22\xf0\x77\x53\x9a\x2f\x62\x6e\x3a\x61\x03\x2e\xea\x22\xfd\xa3\x4b\x56\x77\xb8\xa8\x01\x09\x10\x5e\x62\xed\x92\x11\xa5\x35\x6a\x33\x5a\xe2\x61\x42\x2c\x7f\xb2\x34\xd3\x75\xf3\x1b\x56\x21\xdf\x70\xff\x7d\x7f\xc2\xf7\xe4\xa3\x44\xd5\xda\x92\x57\x3d\xe5\x04\x77\xa2\xb8\xac\xef\xa9\xaa\x56\x7e\x03\x30\xe7\xf8\xd1\x2b\x2e\xf1\x11\xde\xb6\x83\xab\x0e\x2b\x7a\x02\xef\xe6\x40\x07\x76\xb8\xd7\x28\xbe\x9e\xc2\x84\xf3\xfa\xe9\x7d\x90\x6e\xd8\x1c\x56\x08\x45\xbd\x0a\xa6\xfd\x61\x54\xb6\x30\x9a\x0f\x90\x1c\x7e\xcb\x2d\xb6\xc4\x1d\xe9\xf6\x3e\x62\x97\x11\xe7\x3b\x3b\x68\x7f\xdd\xd5\x37\x15\xb8\xcd\x44\xca\x8a\xe7\x9d\x3f\x94\x95\xf5\x90\x04\x9c\xdf\x55\x85\xd9\x51\xba\x84\xd3\x77\x13\x72\x77\x30\x83\xcb\x16\x49\xbe\xce\xf9\x8a\x0a\xd0\xae\x2f\x4a\x29\xad\xd6\xba\x02\x5b\xc1\xab\x36\x71\x6a\x89\x98\x06\x0d\x2b\x61\xfe\x15\xea\x6b\x7c\x34\x04\x91\xdc\x2e\xb6\xbe\xec\x53\xcc\x34\xa3\xdd\x90\x74\x9c\xab\xa0\x92\x59\xc9\x28\xf0\x6f\x3f\x5a\xa6\xd6\xfe\xfb\x61\x7b\x60\x71\xb8\x51\xa3\x86\xf4\x6e\xc5\xcb\x3a\x28\x98\x68\x9a\xe6\x55\xd2\x59\x8e\x90\xc3\x15\x08\xa3\x93\xff\xb6\xd2\xc6\xb8\x25\x54\xa4\xe7\xa4\x88\x09\xcc\x50\xc5\x63\x8f\x29\x6c\xef\x24\xb0\x07\xeb\xb8\xd2\xa6\xa5\xef\xf0\x59\x83\xbd\x1f\x56\xe9\xb3\x54\x05\x81\xbb\xba\x55\x8e\x9f\xfe\xe5\xd6\x36\xf0\x39\x27\x58\x36\xf8\xe8\xb2\x4a\xb2\x5e\x65\x8f\xc6\x01\xb7\x15\xa8\xa4\xe2\x1f\x68\x95\xf8\xa8\x48\xc9\xd2\x28\x8d\xc7\xcf\xc8\xe2\x40\xac\xa7\x78\x66\x7b\x14\x7a\xab\xa8\x30\x21\x7d\xd9\x3f\x87\x9c\xd8\xa2\x43\xdf\x8f\xef\xa7\xfb\xa8\x80\xdc\xad\x82\x6c\xc5\x9e\x6c\x27\x76\x9d\x0a\x3b\x93\x5f\xf9\xed\x59\xf1\xe5\x3b\x84\x3a\xab\x2f\x7a\xaf\x61\xf6\x8c\xa3\xc6\x57\x24\x41\x87\x17\xa8\x34\x7f\xd4\xdf\x15\xa1\x86\xb4\x61\x8c\x58\xd8\x0a\x63\x1e\x0e\x46\x3f\x8c\xc8\xb3\x27\x64\x0b\x67\x9d\x65\x9e\x39\xa0\xc2\x2b\xe0\xe6\xcd\xdb\x94\xaa\x3c\xad\x46\xe7\xd5\xcb\x9e\xed\x08\xdb\x1a\xfb\xab\x6f\x96\x6f\xcf\xa7\x6f\xe9\x6b\xf9\x13\xdf\x1c\x6a\x79\x2a\x3c\x1e\xac\xcf\x0a\x6d\x45\x56\x48\x91\x06\xe5\x22\xe4\xbf\xaa\xa6\x0f\x4c\xb4\xeb\x6a\x7a\xf6\xf0\xad\xc1\x38\x2f\x56\xcb\x8b\xab\xfc\xe3\xa9\xf5\x55\xe5\x16\xce\xe6\x1c\x13\x4f\x39\x77\x63\xb0\xc3\xc5\xe5\x2e\x83\xbe\x3c\xc3\xfc\x26\xe2\x2f\x8f\x6f\xd8\xdc\x1c\x11\x8b\xe6\x81\x5d\xc1\x71\x1b\x15\xc6\x1e\x70\xa2\xcf\x4f\xbd\x4c\xbb\x39\x3c\x3d\x39\xa7\x5b\x30\x4b\xd7\x3c\xb5\x0b\x15\x60\xd9\x83\xad\x76\xca\x73\x6e\xf1\x18\x67\x8e\x4d\xe9\x5a\x8a\x11\x80\x1c\x4d\x8f\xa8\xd8\x76\xe5\x22\x4b\x85\xea\x52\xc0\x5e\x2b\x8e\xfe\xe6\x3b\x36\xc1\x19\xc3\x5e\x2f\xd1\xed\x86\x44\xc3\x42\x21\xe0\xc4\xa2\x6d\x3b\xc3\x47\x2e\x7c\x6e\x7c\x42\x2a\x22\x5b\x2e\x2a\xee\x24\x70\xf9\xbb\x1d\x44\xc4\x14\x37\x73\x62\x6a\x3b\x18\x3b\xca\x72\xa6\x70\x3c\xfd\xec\x82\x0a\x5b\x38\xe6\xbd\xb0\x5c\x3b\xfc\x39\x4e\x4a\x2d\xe6\xe4\x08\xb4\x35\xcd\x38\x33\x84\x3c\x82\x09\x25\xc0\x17\x71\x2e\x3a\x89\xc9\x55\x69\x41\xf0\xd7\x60\x62\x8a\xc1\xcf\xe4\x87\xd4\x45\x51\xd9\xa4\x63\x6f\x24\x8e\xe5\xba\xfb\x1a\xc3\x4e\x98\x30\x38\xe0\x77\x88\x84\x86\xf1\xa7\x98\x47\xa3\x4c\x7d\xc6\x66\x33\x6e\x25\xc6\x2f\x9c\x62\xac\x52\x7f\xf8\x40\x94\xc4\xb7\xb2\xd0\xbd\xd4\xd7\x22\xb9\x75\xb4\xb0\xcb\xe4\xc8\x00\x6b\x9c\xc2\xa0\xb5\x29\x87\xc6\x1c\xc6\x74\x63\xa4\xf1\xc3\x67\x27\x87\xe3\x4e\x4e\x0a\x1c\x2a\x34\x26\x27\x6f\xd9\xc1\xc1\x16\xbd\xf1\x0b\x8b\xf3\xcf\x3b\x3c\xe0\xe7\xd5\x33\x2f\x4d\x14\x20\x26\xbf\xe8\x6f\x31\x18\x45\x77\xe4\x15\x93\x75\xc0\xcd\xb3\x7d\x20\xf3\x72\xb0\x83\x6c\x8a\xf6\x4b\x35\x19\x8b\x32\x99\xeb\x94\xff\x8a\x8a\x31\xbf\x2f\x39\x3f\x4d\x8b\x2a\xb0\xbe\x5e\xcd\xb5\x6e\x67\x20\xd4\x10\x16\xcd\x43\x5e\x6f\x25\x4f\xd8\xdd\x2e\xf9\x00\xa4\x6e\x03\x67\xae\x4f\xe9\x6c\xe1\xe0\xed\x3f\x2e\x2d\xe1\x9f\x5e\xc6\x66\x1c\xde\x7f\xba\x5b\xbb\x27\xb8\x6b\x12\x16\xd6\x43\x52\xc1\x43\x49\xf0\x56\xb1\xd1\x10\xc0\xde\xd4\xce\x1f\xb9\xcd\xba\x22\xf0\xc3\x05\x76\xf5\x20\xb0\xd1\x3b\xb7\x4f\x97\x5b\x84\x73\xae\x8a\x4d\x61\xbc\x29\x35\x60\x45\x26\x69\x40\xc4\x4c\x59\x99\x07\x52\xc5\xd5\x8c\xf0\xfc\xf1\xaf\xc8\xf9\xe6\xc3\x87\xfb\x4b\x96\x67\xa7\xe3\xc6\x67\xb0\x0a\x20\x7d\xca\x1a\xe0\xf8\xe6\x6f\x40\x0d\xa0\xbb\xf9\x83\x5d\xe6\x5b\x14\x84\x5d\x00\x85\x7a\x6b\xba\x66\x60\x61\x65\x07\xdf\x06\xaf\xf8\xf4\x39\x78\x8a\x71\x2e\xab\x8a\xef\x1b\x06\xd8\xae\x74\x4b\xfd\xff\x6e\x95\x84\x8e\xdc\xba\xc3\x9e\x06\xb2\x6d\xc6\x82\x11\x70\xd4\x9e\xe9\x5e\x9b\x69\x8e\x7d\x30\xd4\x10\x13\x14\xe2\x82\x76\xcc\x0e\xb7\xa8\x71\x91\xa9\xb1\x09\x77\xe9\x52\x04\xf7\xf7\xa1\x4a\xc4\xd6\x54\x64\x03\xe4\xde\x05\xb0\x9a\x75\xbd\x01\x9d\x3c\xac\x99\xe8\x03\xf3\x7b\x38\xfd\x0d\x3f\xf2\x8b\x00\xf7\x77\x28\x0a\xe6\xca\x70\xff\x1a\x5e\x2c\x56\x93\x68\xe4\xfc\xc6\x6c\xfd\xe1\x70\xde\x45\x47\xbe\xf1\x57\x0f\x3a\x29\x8e\xf2\x5b\x44\x74\x84\x39\x50\xb1\x66\x57\x39\xc3\x6f\x17\xd2\xf9\x22\xd8\x19\x56\x52\xca\x57\x28\xa1\xe1\x08\xf7\x3e\x2b\x8e\xfe\x29\x34\x83\x1f\xe2\xf1\x51\x7a\x11\x5f\x56\x1f\xc2\xf2\x49\x4b\x62\x60\x2f\xbc\xd9\x3e\x07\x86\x27\x0f\x6b\xd2\xb4\x4d\x0e\x2e\x78\x4a\x6b\xd1\x5e\x63\x1f\xe0\x6a\xc0\xab\x78\xef\xd6\xce\x1c\xb4\xf9\xba\x3e\x1c\xa6\x21\xdf\x8e\x13\x3d\x19\x24\xd0\xa2\x28\x2c\xde\xaf\xa2\x9a\x03\xfe\x36\x42\x0b\x3d\x2d\x4c\xd6\x7b\x77\x98\x31\x80\x41\x27\xa6\x9c\x15\xa4\xa1\x3c\x38\x7e\x7c\x53\xf0\xe1\x0e\xd5\x86\x4a\xa3\x71\xa5\x81\xc2\xfe\xc2\x02\x70\x4d\x2d\x1d\xd0\x75\x06\x84\xf1\xe8\xcc\x74\xda\xad\xfa\x7c\x86\x17\x91\xf2\x9e\xdd\x7e\x48\xc5\x5c\x0a\x9f\x04\xa4\x1e\x79\x35\x75\xc3\x6e\x9e\xe0\xdb\x5b\x56\x42\xf2\x50\x70\xf3\x3f\x66\x1c\x1d\x95\x1c\x7c\x2b\x4a\xfe\x77\x8b\x99\x7f\xd4\xb1\x71\xdd\xf2\x7f\x61\xd3\x9e\xe5\x57\x67\x5b\xc6\x97\xff\x14\xf5\x5b\x9e\x74\x43\xc3\x5f\x9a\x15\xdd\xf3\xc9\x82\xce\xfd\x90\x7d\x95\x3c\xf8\x1b\xc6\x2d\xa7\x4a\x37\x4f\x38\xd9\xeb\x1d\x62\x95\x5d\x2e\x0b\xab\x07\xd3\xee\x0b\x15\x33\x52\x13\xe8\xda\xf0\x4c\x70\x1e\xc6\x7b\x58\x27\x62\xa3\x3c\xf5\xe8\x3f\x1a\xef\x52\x08\x1b\xad\x2d\x2d\x72\x71\xdf\x46\x05\xc1\x6e\x7d\x15\x70\x68\x37\xc8\xf7\x4b\x4b\x6d\xbc\x46\x1c\x23\xbf\xe0\xf1\xcc\x81\x32\x19\xf8\xf5\x68\x86\x93\x4a\x02\x61\x42\x15\x41\xba\x81\x8e\xf0\x89\xa3\x8f\x2d\xfd\x71\x3e\xfb\x39\x97\x02\xd1\x8d\xaf\x55\xbc\xdd\x92\x5b\xaf\x6e\xff\xaf\x29\x71\x70\x59\x57\xbb\x8a\xf8\x99\x05\x6d\xbd\x4a\x44\xda\x52\xac\x7a\x07\x51\xec\xfe\x69\x96\x5c\x07\xf9\x3d\x88\x1d\xba\x96\x19\xd3\x4c\x8d\x95\x85\xc0\xe5\xeb\xfb\x33\x38\x5c\x54\xdf\xfd\xef\x96\x7c\x61\xcf\x99\x85\xe1\x96\xd5\x3c\xac\xfd\x68\xc7\xfd\xa4\x2f\x1c\x27\xfe\x8a\x7e\x08\x0b\x53\xc0\x7b\x6b\x17\x78\x9e\x87\xcd\xf8\xb2\xcb\xf2\xa6\xff\x4c\x2c\x07\x56\xb1\x4b\xe1\x82\x48\xd1\x17\x8a\x3d\x0e\x87\x3f\x0c\x28\x5a\x6e\xf5\xbb\x0b\xb1\x68\xa8\x18\x54\xff\x2f\xee\x61\xb4\xd4\xa7\x88\x6f\xb5\xaf\x52\x33\x70\x72\x4c\x00\x0f\x64\x7e\x7f\xb4\xfb\x8c\x85\x5d\x86\x6e\xed\xc3\xda\xb0\x04\x7d\x18\x66\x10\x6f\x3d\xde\x99\xb1\xba\x3a\x23\xed\xa8\xff\xf2\x81\xe6\x4b\x18\x64\xc2\xbd\x4c\xa3\xe7\xe6\xbc\x36\xcb\xa5\xc4\xea\x43\xb1\x6d\xe7\x43\x7e\x88\x47\xcd\x31\x87\xbe\xb3\xda\xea\x59\x20\x82\xeb\x1f\xe2\xb4\x9a\xcb\x12\x75\xf7\x2c\x67\x87\xf9\x67\x41\x0c\x96\x1f\x2b\xca\x10\x9a\x3b\xf8\x47\x4a\xe8\x2c\x27\x7a\x8c\x12\xfc\xef\x26\x05\x62\xfa\xf1\xe8\x6c\xd5\x71\xbc\x7c\x84\x25\xdf\x74\xc7\x9c\xf9\x1f\x77\x62\xdb\xb8\x5b\x3b\x3e\xa9\xb1\x06\xfb\xee\x97\x3d\x13\x33\x6f\x2b\x1e\x17\xd9\xee\x0b\xf4\x87\xeb\x68\xe5\x3c\x3a\x25\xc6\x7d\x5d\x71\x5f\xd0\xf5\xc1\x4b\xb8\xd6\xb8\x03\xc6\x13\x33\xee\xa0\x37\xac\xea\xc2\x98\xe4\x8f\x4b\xf8\x35\x5a\x71\x97\xc8\x78\x83\x43\x17\x89\xc5\xcf\xc3\xa3\xb9\x34\xfd\x05\x27\xe6\x41\xd9\x26\x2b\x94\x27\x90\x5f\xff\x94\xa8\x80\x4f\x95\xd4\x59\xba\x0a\x6c\x0f\x4f\x79\x38\xc8\x67\x38\x23\x0f\x45\xb3\x5c\x84\x75\x3c\x5c\x52\x50\xac\xae\x65\xb8\x2d\x7c\x93\x56\x6c\x6b\x72\x4e\xe2\x16\x8c\x32\xeb\x95\x47\x55\x59\x25\xb2\x2b\xdd\x7e\xc6\x47\xbc\x24\x0b\x0d\x76\xea\x32\xfc\xae\xbf\x77\x99\xc5\x42\xfc\x57\x7d\x56\x88\x98\x60\x15\x4b\x04\x74\x5d\x90\xf9\xf3\x20\xe6\x35\xd2\x07\x56\xec\x8e\x0e\x17\xbf\xb1\x36\x3a\x0b\xe1\x74\x8e\x58\xeb\x38\x2d\x4d\x50\x50\x54\xbe\x29\xdd\xbd\x36\xeb\xb0\xde\xef\x66\xfe\xde\xb2\xd7\x30\x72\xb2\xfd\xa1\x9d\xc2\x80\xf3\x07\xcd\x79\x71\x39\x5e\x21\x3c\xd8\x77\x29\x75\x29\x42\x70\x61\x42\x0e\xd7\xfe\xb3\x79\x0d\xf6\x71\xc1\x7a\xba\x3c\xf1\xbd\xa4\x49\x7f\xef\x06\x93\xa2\xd9\x15\x69\x3f\x8f\x5f\xfe\x71\x8d\x62\xa9\x57\x6c\xae\x3d\x22\xfc\xd2\x57\x6b\x47\x7d\xe5\x27\x48\x78\xe0\x88\x45\x0c\xbc\x62\xe4\xef\x9e\x25\x61\x3f\xe3\x5d\x67\xb1\xc6\x8a\xb5\x3b\x3e\x1c\x16\x97\xc6\x19\x44\x90\x32\xd3\x73\x8e\x9f\x8f\x44\xfd\x85\x21\x57\x77\xec\x17\x0a\xb8\x85\xf1\x63\x11\x9d\xdb\x6a\x41\xa6\x11\x00\x07\xf4\xdf\x9a\xc3\x3a\xd2\xb6\xd1\x78\x8c\x38\x4d\xaf\xfd\x58\xbe\xc1\x7b\x4a\xd3\xdd\x41\x04\xec\x46\x24\x4e\x88\x07\xd6\xcb\x81\x17\xc6\x5f\x04\x7b\x2d\x6e\xca\xc2\xd2\xd0\xc4\x99\x49\xba\x8a\x4f\x84\x98\x7d\xfc\x6a\x47\x64\x32\xa9\x76\x42\xe2\x31\xa6\x7d\xc5\xbb\x88\x0f\xec\x15\x18\x27\x0e\x6c\x9d\x65\x2b\xed\x02\xad\x3d\xa4\x10\xf4\xaa\x6e\xa1\x22\x14\x35\x08\xab\x5f\x3b\x73\xbc\xfc\x03\xce\xf9\x52\x69\x17\x86\x57\x6f\xf9\x84\xbd\xf1\x0e\xfb\xa1\xff\xaa\xf5\x10\x20\xf0\x72\xd7\xde\x07\x85\xa2\xc2\x63\x62\x5b\x7d\x65\x8a\x41\x5e\x09\xde\x60\x27\xe9\x7a\xdb\xfb\xa3\x60\x03\x4f\x7b\x96\xc3\xaf\x17\x75\x9c\x4d\xde\x6b\x58\x9e\x5f\xef\x90\x8e\x22\x19\x97\xb9\x3f\x79\xa4\xbc\x74\x8d\x60\xa0\x56\xd7\x4d\x35\x58\x7e\xdc\xb9\xae\x14\x16\xcf\x91\xb0\x43\x73\x7b\xbc\x0d\x81\xfa\x85\x76\x00\x1e\x8a\x2d\x9b\xc2\x9a\x99\x59\x9a\x86\xcb\x0f\x75\x40\x7f\xaa\xee\xf6\xa0\xe2\x58\x51\xd7\x10\x3a\xeb\xa8\x13\xb3\xe1\xe6\x9f\x5f\xb5\xab\x20\x54\x20\xce\xcd\xfa\x79\x8e\x81\xe8\x59\x22\xb6\x5f\x96\x7c\xf6\x0c\xad\x9f\x68\xda\x8c\x12\x91\xff\x82\x24\xa7\xb8\xcf\xec\x5a\x15\x17\xe9\x6c\xf6\x9e\x30\xb0\xf3\x3f\x20\x17\xa1\xfd\xa7\x9c\x12\x00\x0c\x36\x6b\x4a\xce\xd0\x81\x06\x36\x0a\xa1\x7b\x6e\x11\x0f\xbc\x5b\xe8\xdb\xe9\x1b\x34\x60\x41\x5d\xae\xb6\x94\x83\xa5\x95\x92\xd0\x22\x3d\x58\x4d\xf2\x71\xa3\xaa\x82\x9c\x9c\x03\x1b\x92\x30\x41\x57\xff\x41\xec\x42\x17\x3d\x41\xf2\xfb\x91\x6f\x19\x59\x58\x13\x42\xa1\xab\x27\xd4\x71\xb5\xd4\x9b\x1c\xa2\xdd\x36\x91\x9b\x8f\xb0\x54\x15\xf3\x17\x66\x17\x1f\x29\xe7\x77\x51\x12\x77\x3b\x52\x16\xe2\x8a\xf0\x9b\xcc\x84\x48\x76\x68\xd4\xb9\xf0\xd2\xef\xc1\x7a\x4f\xf7\x58\x1d\xed\xcc\xc5\xa3\xbb\xf6\xd1\xe4\x02\xde\xa0\x7e\x99\x6d\x75\x10\xc6\x27\xc4\x66\x0b\x6b\x3d\x5b\xb8\x5b\x84\xd3\x00\x0f\x4d\x6a\xf9\xc6\x58\x79\xe7\x90\x1c\xa4\x80\x2c\xe8\x36\xff\xa5\xee\xa9\x15\xfa\xd2\x2b\x6e\x97\x35\xc7\x76\x89\xda\xec\x8a\x29\xea\x8c\x99\x5e\x83\xf0\xb2\x6a\xb3\x9b\x11\x7a\x3d\xa9\x48\x18\xc1\xca\x26\xc8\x7d\x2b\xf5\x49\x98\x48\x46\x36\x76\x55\xa6\xb0\x67\x3b\xfc\x72\x85\x3e\xe2\x63\xb8\x14\x22\xb0\xba\x4b\xe1\x66\x20\x07\x56\x65\xa2\x06\x41\xd7\xb5\xaa\x81\x0a\x2e\x9a\xd0\xb2\xd0\x4d\xe5\x6a\x6a\x89\xc9\x5f\x13\xeb\x24\x11\x09\xcd\x42\xec\x23\x91\x2a\xcf\xd5\x05\x45\x6d\xcb\x27\xaa\x27\x4b\x3e\x24\xcd\xb2\x22\x07\xd9\x30\xf5\x72\xbc\x0e\xbb\x8e\xf0\xff\x4a\xe5\x4b\xff\x2f\x99\xac\x2e\xd0\x95\x12\x00\xf4\x44\x7b\x0a\x5b\x9f\x32\xd4\x5b\x12\x0f\x0f\xf1\x0e\xef\xa3\x28\x2d\x42\x85\x9a\xe7\xff\xb1\xc2\x4c\x47\x4b\x9b\xd8\xce\x66\x1a\xb6\xf5\x8b\x0a\xc6\x95\x49\x82\xc9\x89\x84\xd6\x70\x34\x1e\xe5\xec\x17\xb7\x7f\xfa\xc7\x7b\xf0\x88\x56\x61\x85\x4b\x10\xf1\x67\x04\x22\x68\x59\x9a\xc4\xa2\x84\xe2\x13\x2b\x89\x2d\x72\xd8\xcf\xda\xdb\xce\xf9\xc8\x1c\x71\xe8\x33\x47\x65\x7f\xd5\xdf\x81\xbf\xb2\x6a\xef\x28\xfa\xc9\x98\xcc\x92\x71\x78\x58\x99\xe2\x52\x07\xda\x3b\x4c\x7e\x03\x4d\xf5\x54\xf0\xf5\xa4\x0e\x70\x52\xc6\xd9\x04\xe7\x50\xfd\x0c\xa7\x4f\x72\x01\xe7\x2e\xaf\x16\x8b\x0a\x45\x3c\x99\x70\x1a\xa1\x2c\x13\x87\xe7\xb7\xb2\x66\xdc\x84\x44\x6e\x7a\x02\x93\xc6\x1f\x53\x1e\x89\x43\x9e\x11\x4b\x7e\xec\x2c\x29\x0f\xc9\x31\x08\x58\x8e\x76\x21\x04\x43\x71\x15\x4d\x74\x14\xaa\x6d\xdd\xa9\x2c\x43\xde\xe1\xc6\x5d\x9b\x59\x77\x38\x75\xe7\x98\x13\x5b\x91\x29\x39\x6c\xa3\x3a\x16\xcf\xdb\xf5\xef\x00\xa5\x84\xb0\xe1\xb1\x05\x9b\x31\x78\xa2\x10\x5b\xb8\x69\xc8\x1d\xc4\xfa\x27\xda\x49\x87\x1e\x90\x31\x2c\x53\x24\xe4\x61\x88\x47\x78\x7b\x94\x08\x63\x2e\x60\xa7\xe5\xc5\x67\x8b\x09\xce\x07\x99\xec\x59\x29\x15\xf6\xe2\x94\xd1\xff\x81\x15\x86\xe3\x86\xfa\x52\x08\xcb\xbd\xc1\x84\x55\x04\x87\xc5\x4a\xed\xc9\xf2\x54\x1a\xac\x71\x66\xb0\xd3\xbd\xf5\x01\x4f\x0d\xc0\x31\x18\x95\x78\xf7\xf4\xf8\xae\x88\x5a\xe2\xd5\x38\xe8\x36\x02\x17\x31\x86\xc2\x3e\xac\x0f\x79\xc6\xaf\xe0\x85\x48\xe7\x64\x36\xd2\x90\xff\xd8\xdd\x01\x41\xa1\xa5\xdb\x90\x7b\xcd\x85\x73\x0a\xbf\x5e\x98\x9c\x88\xea\x98\x5a\xf5\x1b\xf6\xd9\xf0\x43\x08\xed\xec\xbb\x99\x96\x6d\x4d\xcc\x71\x74\xac\x89\x35\x36\xb5\xa2\x57\xc1\xe9\xd0\x45\xf0\x4b\xa4\x3e\xe9\xb3\xb8\x22\x3d\x0c\x5c\x06\xc1\x8b\xf0\xa3\x50\xd9\x28\xcf\xed\x96\xe7\xd3\x35\xf9\xb5\x4b\x62\x05\x18\xda\x5b\xfa\x8f\xcd\x58\xe0\x84\x35\x1c\xc4\xf8\xc3\xbc\x4e\xa4\x2d\x78\xbd\xce\x36\x48\x3e\x24\x88\xfd\x31\x0d\x23\x5a\xcd\x0e\x5a\x89\x66\xa3\xc9\xf2\x8c\x05\xc1\x23\x56\xa6\x87\xa8\xb6\x84\x2b\x49\x3e\x94\xc4\x7e\xfc\x32\xaa\x8e\xa8\x2a\x2f\x3d\x0e\x81\x27\x0e\x24\x39\x62\x57\x67\xd2\x64\x38\xbf\x83\xdb\xe2\xdf\x0c\xa4\x5f\x30\x63\x5c\x9f\x9e\x6d\x55\xe8\x88\x06\x6d\x11\x1f\xc1\x15\xf6\x55\xe3\x28\x16\x4d\x4c\x52\x40\x3e\x68\x07\xe4\xc1\x68\x5f\x3f\x53\xe4\x61\xaf\x3a\xac\x09\x89\xda\x82\x11\xf3\xfd\x45\xad\x26\x79\x38\xe3\x71\xe0\x48\x2c\x0d\xcc\x7e\x4a\x1d\x63\xe5\xbf\x99\x26\x2c\x30\x47\x8d\xb1\xf7\xea\x2f\xb8\x2d\x3f\xc0\x3a\x69\x99\x3a\x2a\x77\x9e\xf4\x40\x17\x8d\x9c\x3f\x00\x92\x7b\x07\xb1\x48\x8a\x85\xdf\xf9\xa3\x29\x75\xf6\xf0\xc5\x4a\x93\x33\xc5\x0d\xbf\xb9\x0b\x13\xaa\xcc\x6d\xf8\x9d\x39\xeb\x78\x67\x96\x6f\x72\x43\x09\x7a\x22\x88\x9e\x5e\x86\xf2\xaa\xf0\x92\x7d\xf1\xa7\xfd\x2a\x7a\xb9\x5f\xbe\x3f\xbc\xec\xd3\xa0\xe1\xe0\x9f\x3c\x64\xc4\x51\x15\x58\x9d\xd3\xf3\xec\xa8\x7f\x3f\xf5\xa8\x55\x95\x3b\xdb\xc4\xab\xde\x1a\x6c\xdb\x16\xe8\x5f\x58\x57\x0a\xa8\xac\xe2\xb0\x7b\xc8\x17\xc1\x53\x14\x69\xe9\xca\xe2\x63\x5f\x9c\x0e\x5c\x34\x4d\xb8\x1c\x49\xf7\xaa\x0c\x66\x6a\x78\x74\xd7\x34\x95\x95\x10\xfd\xca\xb6\x8c\x00\x32\xd4\x2c\x21\xf3\x2d\x0a\xbc\xcc\x41\x49\xcc\x63\xd8\xac\x25\xe1\xa8\xe7\xbe\xa4\xb7\x17\xa6\x56\xea\xb2\x32\xf4\x29\xf6\xcf\x3e\xfd\xe3\x9f\x5c\x15\x09\xb6\xf8\xbe\x61\xbf\x7c\x0f\x58\xc1\x2a\xda\xaa\x69\xf6\xda\x38\x8b\x65\x70\x4b\x10\xe7\x22\x06\xb2\xe9\x94\x79\x01\xac\x13\x0c\xb4\x94\x62\x79\xc8\xcd\xd0\x6a\xd8\x68\xf8\x4f\xeb\x68\x8b\xe4\x2f\xef\x44\x2c\xc8\x45\x2f\xed\xa7\x41\xfd\xab\x2f\xc8\x51\xf1\x82\x82\xe5\x1c\xcb\xb4\xf2\x2a\x3a\xee\x41\x83\xc5\x03\x89\xd9\xfe\x78\xff\x13\x30\x76\xa9\xd6\x81\x97\x1b\x49\xa8\x47\x5d\x83\xd9\x72\x48\xbf\x11\x51\xc1\x18\x3a\xa0\xcd\xc3\x72\xaa\x52\x09\x4f\x9e\x48\x75\xb8\xa2\xce\x27\xe7\xd6\x12\xfa\xc3\xdd\x84\xc4\x69\x67\x39\x0c\x5d\x70\x94\x66\x47\xe2\x65\x89\x12\x99\x67\xfe\x0e\x75\x3f\xcb\x60\xd6\xae\x7b\xd9\xa8\x9a\xf7\x90\x4b\x2e\xc0\xd9\xd3\x14\x1b\xfa\x65\x89\x62\xe0\x3c\xeb\x78\x6b\x06\x45\x98\xfe\x2b\x12\xd7\x40\x48\xa3\x34\xcd\x9f\x0d\x2b\x48\x90\x2c\x45\xf7\xc4\x70\x18\x54\xcc\x4f\xbf\x97\xeb\x25\xfb\xa0\x7a\x5e\x52\xde\x70\xf0\xa8\x54\xee\x0a\xf7\x2a\xbe\x7c\x35\xfa\xad\xad\xaa\x9e\xc6\x88\xdc\x17\xf9\xad\xc2\x13\x60\x6a\xd1\x4a\xae\x68\x9b\x93\x12\x2f\x95\xd9\x5d\x4b\x92\x3e\x84\x52\xde\x34\x75\x43\xb8\x99\x8a\xd7\xaa\xa8\x95\xfa\x4f\xbf\x0f\xbf\x77\xee\x64\xb8\x78\x04\x8c\xda\x6f\xf0\x6f\x28\xa7\x0c\xea\xd7\x12\x5a\xe0\xdc\x24\xa0\xc0\x48\x8b\x6c\x8c\xd6\x5f\x01\x6b\x55\xf7\x41\xef\x1f\xf7\x9d\x53\x5f\x6d\x15\xe1\x3f\xd5\x34\xfc\x89\xf8\xd9\xfb\xe4\xa3\x8f\xc9\x63\x3e\xee\x1a\xe3\xac\xda\xba\xfd\x09\x84\x21\xad\x8c\x8e\xa3\x62\x75\xda\x8d\x2f\x86\xe3\x1e\x59\x2e\x93\x94\x87\xb2\x78\x0b\xdd\xd4\x52\x5b\x60\x1a\xfa\x79\xcd\xc7\x59\xef\x2d\xd8\x45\x6e\x55\xc7\xb6\xb7\xb7\x5e\x76\xc9\xaf\x43\x03\x74\x7b\xbf\xe3\x16\x05\x33\xc9\x1f\x9e\xcc\xb5\x5d\x32\x0f\x57\x38\xd2\x8b\xdb\x48\x65\x8c\xd4\xd9\xf3\xed\x66\xcb\xaa\x7d\xeb\x1a\x63\xf3\xa4\xa9\xf9\x06\x9b\x4a\xc2\x9d\x95\xf9\xd5\xb3\x95\x1f\x2c\x70\x65\x11\x39\x17\x82\xc4\x1e\xd6\xc6\x7f\x82\x47\xbc\x3f\x96\x6b\xe2\x9b\x6d\xcb\xa7\xc6\xe8\x83\x4b\x5a\xfe\xc0\x88\xf1\x8d\xfb\x0f\xb7\x94\x24\x3a\x56\x01\x69\x90\x7e\x6f\x57\x73\x94\x9a\x64\xca\x72\xb3\x53\x9b\xdc\x37\x90\x55\xee\xd9\xd4\x36\xc8\x75\x25\x9b\xca\x6b\x60\xff\x21\x55\x41\x63\xb6\x83\x9c\x01\xa6\xc1\xe0\x3e\x0a\x63\x7b\x3d\xe5\x43\x53\x3a\x7d\x2e\x7c\x10\x26\x52\xdd\x29\xd0\x09\xef\xdd\x1c\xf1\x70\x01\xa5\xda\x4f\x0a\x83\xdd\x08\x1c\xc0\xb5\xac\x8a\x66\xe4\x6b\xec\xe3\xf7\x44\x11\x6c\x78\xec\x79\x05\x0c\x8f\x80\x77\x62\xb4\x8d\x57\x59\xbe\x80\x80\x90\xb2\xe5\x83\xd0\xcd\x08\x2a\x9c\x72\x6f\xb6\xa1\x89\x8d\x37\x11\x48\x46\x7f\x25\xfd\x0b\xe9\xf1\xcc\x29\x29\x3e\xd0\x4a\x16\x7e\xc1\xe2\x1c\xed\x5d\x02\x5c\x46\xf6\x64\x5c\xbe\xb0\x71\xcd\xbb\xff\xd9\xa0\x31\x86\x74\x99\x75\x08\xe6\xf1\x11\xac\xf9\xbc\x35\x7a\x78\x1e\xaa\x44\x6d\x91\x17\x9e\x40\x1e\x32\x47\xe4\xb7\x56\xa2\xbe\x6b\x47\x81\x0f\x19\xbc\xcf\xe5\x73\x51\x03\x54\xfe\x87\x3d\x8c\x1a\x1f\x0d\xeb\x1c\x97\xf5\x47\x78\x22\x70\xa6\xcf\x8c\x39\xb7\xe9\xc5\x02\x09\xf9\x3c\x05\x9f\xe1\xf2\xfe\x14\xb5\xd7\xd9\x54\xf8\xa6\xac\xed\x01\x1c\x2a\xa7\x6a\xda\xdf\xa6\xe4\xb9\x70\xf8\xd3\x86\x36\x04\xff\xdd\x4b\xee\x93\x35\x37\xfc\x77\x55\x68\xdb\x0b\xdb\xcb\xd3\x66\x09\x8a\xe6\x70\x70\x9f\x43\x7c\xab\x1c\x3b\xe1\x55\xe3\x0f\xcb\x33\x62\x5c\x97\xbe\x90\x9b\x89\xf8\xb9\xac\x15\x77\xb4\x21\x67\xd9\x03\x2f\x2e\xb6\xec\x63\xa2\x04\xd2\x75\x20\xc3\xb7\x6d\x19\x6c\x94\xa0\x9f\x16\xf3\xc9\x96\x00\x2e\x20\x02\x7b\xb0\x32\xff\xd9\xde\x90\xa3\x69\xbb\x83\x78\x9b\x76\x52\xb1\x15\xea\xed\x94\xd7\x63\x44\xfa\x10\x92\xfe\xc9\xc4\xfb\x96\x62\x0f\x39\x91\x44\x1c\x3d\xf3\x9e\x91\x25\xd9\x09\xc0\xb3\xb5\x86\x39\x7d\x6b\x6f\xad\xc5\x79\x5b\x09\x70\x04\x9f\xa0\xea\x4f\xb5\x3b\x49\x90\x35\x88\x79\x2c\xf0\xc3\x3c\x14\x4c\x02\xc9\x92\x52\xb8\xec\x00\x38\xcd\xb2\x0e\x8c\xe4\xd6\x23\x6c\x05\xeb\xff\x47\xd6\x9b\xa5\x3b\xcb\xf3\x4c\xa3\x73\xc9\xf1\x3f\x29\x03\x0e\xb0\x68\xcc\x0b\x38\x79\x92\xd1\x6f\x95\xaa\xe4\xdc\xdf\xb5\x8f\xf0\x4a\xb7\xd2\x80\x6d\x95\xaa\xf9\x2f\x6e\xb1\xaa\x9c\x8e\xff\x30\x14\x8e\xcd\xbf\x1c\x09\x61\x1a\xcc\x01\xa4\x44\x2d\x64\x1d\x84\xc9\xb0\xc1\xd9\x25\x30\x22\xd5\xdf\x77\xfa\x0a\x09\x0a\x42\x98\xed\xfa\x03\x83\x5e\xa5\x31\xa2\x12\xad\x5b\x45\x23\xee\x20\x8e\x75\xc3\x97\x2e\xf3\xbd\xa0\xe6\x73\x0a\x01\xb4\xe9\xa7\x60\xb2\x8e\xed\x49\xb7\xd0\x59\x69\xc1\x06\x69\x90\x5d\x0f\x31\xf2\xa3\xfb\x03\x77\x69\x95\x76\x68\xf1\xd3\x3e\x31\x23\x39\xdd\xbb\x5f\x0f\xb6\x3f\xf4\xcf\xfb\xa0\x6e\xc8\x0f\x9d\xc8\xaa\x88\x85\x21\x15\xd5\xa1\x7e\x0c\xd6\x21\x89\x39\xc0\x44\xe6\x7f\xb2\xa0\x52\x97\xb8\xf9\xf8\x7e\x70\x1b\x3e\xd7\x97\xf3\xd6\xa7\x68\x3e\x79\x73\xff\xf4\xae\xbb\x28\xa7\xc1\x16\x79\x2b\x34\xec\x05\x5f\x4a\xba\x0a\xfb\x6e\x9a\xbe\x82\xf3\x40\x86\xdd\x2b\xbd\x28\xef\x4e\x57\x17\x8b\xf2\x2b\xed\x30\xe6\x10\x4c\x3c\xb0\x26\xae\xa3\x2c\x27\xdd\x7a\xb8\x61\x59\x77\xf5\xb3\xc0\xde\xef\x38\xc8\x1b\xa7\x52\x0a\x77\xcb\x1e\xce\x63\xf9\x7e\x18\x31\x27\xb9\x5b\xe6\xb3\xa1\x77\xb3\xf2\x42\x89\x07\x9c\xac\xef\xa4\x6e\x2c\xa2\xfc\xf8\x72\x8a\x22\x42\x93\xc0\xb1\xd1\xb7\xac\xd5\xaf\x7a\xf7\x00\x62\x39\xde\x9b\xa9\x05\xbe\xc3\xd6\xdb\xc7\xf7\x29\x9f\x40\x18\xf9\x3c\xc4\x34\x75\x19\x0e\xf7\xdd\xf0\xa5\xd3\x80\xdc\x52\xd0\xde\x7d\xe0\xdb\x63\xa1\xd0\x63\xbc\x36\x3a\xdb\x18\x80\xfa\xa8\x30\x86\xa3\x91\x4d\x25\x1b\x2a\xff\xc7\xe4\x87\x5d\x6c\xc0\xa7\xfe\xef\xe7\xf0\x20\xb4\xf5\x91\x8b\x97\x8d\x08\x34\xcb\x9f\x47\x26\x54\x61\xd4\xd3\xb4\xe3\x53\x18\xfd\x30\x68\xee\xca\x49\x0b\x1e\x29\xa7\x3f\xa7\x64\x6d\xc8\xd3\xfa\x25\x76\x7c\x29\x62\x5e\xdb\x53\xe0\xca\x34\xcc\x40\xd4\x7c\x83\x9c\x69\x94\x81\x7d\x37\xb7\xd0\x11\x78\x79\x7e\x3a\x29\x6d\xc1\x72\x98\x83\xe6\x80\x82\x2d\xa8\x08\xe0\x38\x04\x16\x73\x16\x5b\x30\x44\x14\x3d\x7f\x3d\xb4\xb3\x0c\x84\x13\xdd\xb3\xda\x8f\xc3\x2a\x63\x9f\xc0\xab\xfb\x5e\xb2\xd7\x33\xcf\x61\xd1\xac\xfa\xe8\xcc\x0a\x94\xf8\x70\xe7\xee\x50\xb5\xcd\xbc\x2d\x2a\xf4\x7f\xd5\x5f\xcc\xb7\x92\x0f\xa7\x3c\x44\x3e\xf3\xe1\xbb\xc0\x07\x71\xec\x33\xb2\x21\x62\xc3\x9d\x43\x2a\x61\x85\xa2\x6d\xa8\xb8\xb5\x76\x5d\x89\x53\x10\x3e\xc1\x8e\xdd\xcb\x0f\xa5\x56\x38\x62\x52\xe3\x71\x4f\x12\xa6\xc3\x55\x6f\x16\xaf\x00\xf3\x6e\xf8\x9a\x39\x05\x61\xe7\x80\xd6\xcb\x1e\x0d\xe5\xfc\x72\x1f\x12\x3d\xc2\x50\x02\xa3\xc0\xc7\x00\xf7\x50\xff\x43\xd7\xc4\x87\x6f\xa1\x1b\x41\x35\x5e\xc3\x65\x2c\x0e\x81\xff\x08\x3f\xa2\x28\x70\x2f\x6c\x97\xc9\x1a\x69\x4c\xc2\x76\xb6\x4c\x2d\x4f\x96\xa3\xe2\x29\xbd\xd0\xe1\x2d\x3a\x3e\xcd\xb9\x0a\x3e\xb0\x2a\x80\xb7\x78\xe8\xbe\xff\xab\x7e\x88\x06\x2a\x36\xe8\xa5\x05\x35\xaa\xe6\x80\xf2\xa8\x92\x3d\xe2\x22\xa4\xb3\x59\x06\x6d\x47\x17\x5b\x71\x90\x5e\xe7\x06\x7f\xd7\x2f\x01\xee\xaa\x40\x27\xc5\x2c\x93\xb8\x48\xf6\x84\xbd\xb5\xa4\xbd\xba\x2b\xe9\xf9\xf6\x12\x8d\x47\xd7\xda\xab\x2b\x0c\x26\x1d\x2f\xb3\xb5\x10\x27\x5e\x35\xf1\xac\xb3\x58\x69\xee\xc1\x4b\x98\x59\xb6\x59\xab\x67\x61\x3e\x88\x46\xc7\xa6\x76\x0d\x49\xfd\xb3\xc8\x66\x74\x05\xbc\x42\xc0\x65\x61\x2c\xe6\xb2\x57\xe5\x3f\xe9\x22\x07\x11\x38\x16\x6d\xdb\x77\xf7\x12\x56\xda\x42\xc8\x1d\xcf\x32\xff\x92\x6b\x6c\xdc\x8c\x54\x96\xdc\x3c\x80\x8e\xd8\x90\x6f\x81\x45\xf3\xfa\x5c\xb4\x77\xa7\x93\x93\x93\x15\x14\xa7\xbc\xbb\xda\x81\xfa\xa5\x8d\xb6\x41\x6a\x07\xfe\xa1\x25\x44\x27\x21\x5b\x71\x98\x95\xa4\x2e\xbd\x6d\xc2\x47\xf6\x3a\x27\x9a\x57\x4e\xb3\x90\x6c\x86\xe4\x4f\x2d\x69\x71\xca\x32\x8f\xb6\x19\xe6\xdb\x76\xda\x7b\x78\x57\xda\xa6\x5b\xf3\x85\x47\x4a\xf9\x31\x94\x4b\xb2\xf2\x1c\x2b\xb1\x1b\x19\x56\xe7\x9d\x7e\x89\x67\x73\x9c\x2e\x59\x99\xb8\xe4\xad\xfa\x86\xdb\xdd\x6f\x39\x52\x14\xc4\x88\x22\x20\xa0\xe5\x9e\x3f\xc4\xf8\x4f\x00\x85\xad\x57\xdf\xe0\xa9\xd2\xfc\x3a\xad\xcd\xe4\x47\xbe\xd9\x29\x9f\xfa\xa6\x9f\x55\x0b\x10\xa2\x2e\xb8\x21\x3e\xa9\x14\x7e\xce\x25\xec\x53\x9f\x6a\x83\x3e\x49\x21\xdf\xc2\x28\xe1\x99\xe5\xa0\xff\x04\x37\xd4\x8f\x9d\x16\x36\xe4\x6b\xfb\x26\xb7\x8a\x0e\x01\x84\xd0\x07\xb0\xde\x26\x2f\x82\xe9\xd9\xa2\x44\x02\x7b\x8e\x90\xe5\x33\x44\xd1\x43\x95\x47\xf2\x10\x26\xec\x03\x88\xc1\xf4\x78\xcc\x6f\x65\x52\xb1\x56\x1d\xca\xe5\x33\x3b\xc7\x91\xff\x39\xcc\xa7\xbc\xb5\x87\xf9\x29\xab\x0b\xdb\x5a\x9c\x0b\xef\xc4\xbe\x5a\x7b\xec\x30\x0e\xda\x23\x0c\x2b\x83\x4f\xa4\x3d\xf1\xa6\x4c\x3a\xec\x98\x1d\xb3\x7f\x38\x17\x63\x8d\x38\x4b\xf6\xc3\x07\x5d\x88\xbd\x9d\xcf\x14\x2e\x60\xaf\xfc\xd1\x31\x18\x18\x95\x5e\xc6\x8e\x58\x6b\x9b\xda\xa6\x8f\x1e\xeb\xf5\x49\xaa\xa6\xbb\x39\x93\x6b\xf1\x12\x52\x5d\x95\x7f\x61\x9b\x62\xca\xef\x4b\xb0\x3a\x40\x58\xe6\xb6\x19\x00\xfd\x1e\xbc\x0d\x6e\x5a\x01\xb6\xfb\xd1\x49\x17\x1d\xb3\x2e\xfa\x19\xd6\x49\x3e\x9a\x6a\x38\x13\xf6\x48\x7e\xf9\x6d\x93\x3d\x28\x97\x9f\x1c\x05\x38\x36\xa6\xdc\xac\x7b\x07\xc3\xf7\xd5\xdc\xcf\x71\x93\xbc\x1d\x24\xdc\x01\x23\x9f\x15\x63\xee\x61\x1c\x1f\x29\xa9\x7a\x99\x70\x75\x9e\x41\x18\x2e\x91\x57\x20\xe0\xb6\x97\xca\x1a\x69\xbb\x0b\xd5\x39\x31\xf6\x53\xc2\xd4\xae\xbc\xb9\xff\xa5\xe7\x91\x00\xe5\xb2\xcb\x5c\x72\x8d\xc4\x4c\xce\xc2\xdd\xda\x78\xb1\xb8\x8e\xe4\x24\x29\x69\x2f\x93\x24\x7c\x40\x05\x63\x17\xf6\x66\x5d\x22\x5e\xd7\xb9\x0f\x39\xd1\xef\x73\x4f\x54\xf6\xa3\x0b\xa1\xa8\xaf\xb5\xab\x59\x36\x93\x11\xfd\xdf\xa5\x9f\x60\x2a\xd5\x4f\xa6\x31\x75\x0a\x57\x49\xd7\x38\x68\x6f\xcc\x9d\x9d\x4d\xb6\xb4\x03\x4e\xc1\x77\x48\x08\x3e\x91\x44\x14\x3e\xec\xfe\x3d\xd9\xb4\x3f\x3b\x71\x28\x59\xa1\xbe\xcb\x5a\x2a\x21\x91\x09\xa7\xc8\x17\x6d\x46\xdf\x26\xbb\x86\x1a\x83\x14\x06\xaf\x9f\x7a\xfb\xc2\xf2\x09\xcb\xc3\xf7\x67\xe4\xbf\x7e\xd7\xd3\x35\x5c\x95\x33\xfb\x7b\xf6\xec\x1a\x42\xd2\x90\x6d\x89\x3a\x6b\xcb\x38\x69\x1f\x13\x04\xb9\x82\xaf\xe7\xeb\xab\x63\xb3\x02\x07\x0d\x2e\x25\x0e\x7d\x0f\xf9\x4e\xff\x05\x27\xf7\x5f\x7e\xbe\xfd\x25\xe7\xef\x71\x94\x63\x85\x82\xc7\x1e\xdc\xac\x13\x8e\xb2\x3a\x59\xd3\x00\x33\xc7\x9c\xd9\x01\x8b\x91\x4f\xe9\x39\x1c\x3e\x61\xc1\x94\x77\x6f\xd1\xf2\xa2\xab\xc2\x38\xea\x4e\xb9\x5f\x75\xf6\xe9\x5d\x37\xed\xa8\x49\x2f\xb8\x4f\x8a\x60\x99\x0e\xea\x83\x00\x6e\x6f\x39\x0e\xdf\xf3\x11\x7e\x97\x6b\x23\xea\xd2\xcd\xc9\xc7\x68\x9b\x09\x77\xcf\x77\x10\x7e\xee\xcc\xa8\xcb\xdb\x49\xfd\x3d\x87\xae\x8d\x79\x00\x32\x5f\xb4\xf5\x7c\xff\xe8\xbb\x6f\x24\x94\x11\xde\xae\x8d\x5b\x51\xb5\x0b\x0f\xff\x4a\x7b\x9b\x1d\x8f\xe9\xa3\x76\x1d\xb6\xf4\x5b\x90\x7e\x5f\xaa\x35\xae\x3b\x24\xd5\xbe\x23\x6d\x00\xf6\x21\x78\xfa\x08\x77\x89\xeb\x20\x7e\x03\x76\x15\xb9\xc1\xfe\x15\x62\x1b\xaf\x6c\x1d\x1b\x32\xe7\xcb\x4e\x85\x21\x9e\xb5\x0a\x21\xbb\xb4\x88\x13\x69\xf7\xd2\xdd\xce\x84\x59\x06\x04\x6e\x40\xe5\x83\x71\x6f\xbd\x2b\xfb\x63\x6c\x9b\xff\x88\x41\x9d\x90\x6a\x1d\x9b\x70\xa7\x83\xb0\x18\x98\x3d\x2f\xcb\x36\xfd\x47\x0b\x45\x3d\xb1\xe1\xe4\x93\x52\xe0\x58\x57\x13\xa7\x45\x68\xee\x95\x37\x39\x0b\x6c\x9b\x82\x53\x15\xac\x71\xe5\xf8\xf7\x40\x08\xb8\x53\xba\xfa\x19\x4a\xfa\x5d\xd0\xbd\xed\x02\x03\xce\x0f\x7f\x85\xe6\x60\xa5\x3f\x1a\x9b\x25\xcf\xa1\x72\xcb\x59\x89\xab\x77\x18\x5a\x21\x71\x75\xe6\xe8\x24\x2f\xf1\x42\x42\x8f\x2c\x3c\xaf\x5f\x10\xdb\x95\x9a\x5c\xff\x92\x50\xfd\x94\xf7\xe6\x59\x23\xa8\x85\xec\x6a\xdf\xf9\x57\x0a\xa3\xdd\x83\x57\x78\x7e\xe9\xa2\x0b\x30\x33\x91\xef\xcc\xff\xc1\x6d\xd7\x47\x11\xe7\x9a\x77\xd6\x13\xfb\xed\xd9\xed\xbc\x2d\xbe\x44\x48\xe5\x34\x48\xcd\x11\x61\x63\xa5\x11\x9e\x59\xe1\xd6\x7c\x7c\x04\xbc\x1c\xa7\xac\xb3\xd0\x6e\x65\x0f\x00\xa3\x08\xb2\x63\x59\x62\x0b\x02\xbf\xe7\x83\x79\xe8\xf0\xd4\x4a\xea\x11\x7c\xc5\xa7\x19\x4e\x12\x79\x8e\xf4\x33\x3e\x98\x05\xbc\x1c\x49\xf5\xb6\x9d\x44\x6e\xac\x75\x76\x2a\xa8\xa8\x96\xf3\x27\x20\xe5\x8b\x26\x59\x36\xd5\xb7\x82\xc5\xdd\xd9\x3f\x3e\x6a\x6b\xef\x9e\xde\x60\x5c\x79\x7d\x20\x9a\xed\x56\x37\x06\xac\x96\xf3\x98\x58\x12\xb8\xca\x3a\x52\xbf\xb7\xf9\x93\x62\x63\xb9\xe1\x6c\xa6\x99\x80\x5b\xd2\x06\xce\x8f\xb0\x69\x92\x52\xe4\xf7\xb3\x29\x36\x0b\xd8\x7e\x4e\xf2\x02\xdd\x23\x78\xc6\xca\x8a\x39\xd2\x65\xd6\xbc\x36\x07\x51\xb7\xd9\x3c\x03\xfc\xcf\xf9\x15\x05\xc5\x1e\x49\x33\xf7\x1d\x22\xb8\xe6\x5c\x20\xa5\x07\xea\x01\xf9\x37\x42\xcc\xa9\xf2\x29\xa1\x56\x92\x52\xcf\x16\xab\x70\x6e\xde\x1a\x53\x27\x31\x5c\x7b\xfd\xec\xe4\x21\x7f\xd8\xa5\x74\xda\x0c\xcb\x87\x65\x11\x0b\x46\x47\xdb\xc3\x7b\x5d\x30\xaf\xc1\x8c\x06\xf8\x0a\xa3\x95\x87\xa3\xfd\x22\xc6\x8c\x51\x65\xe4\x81\x39\x38\x20\x46\xb3\x73\xb3\x7a\xd9\x23\x02\x8c\x6c\xd5\xbd\xf6\xe0\x72\x03\xdf\xc1\x3d\x58\x31\xb6\x3e\x3c\x89\x23\xc0\x64\x54\x7b\x3a\x30\x68\x95\x39\x8f\xbd\x98\x5a\x23\x56\xa9\xa4\x60\x53\x0f\x36\x73\xe5\xca\xd7\xb0\x9d\xc2\x4e\xb9\x5e\xc2\x1e\xa0\xe7\x48\xba\xea\xe5\xe3\xaf\xb3\x9c\x64\x23\x2d\xa7\x0e\x3a\xed\x97\x52\x9d\x6b\x66\x45\x0c\x69\x20\x70\x4c\x50\xd9\xb2\x05\x3b\x3b\x3e\xeb\x92\xc9\xf9\x59\x52\x44\x20\x2c\x11\x3d\xb9\x24\x01\x97\x7f\xde\x93\x54\xcc\x4e\xab\xbd\x6d\xb5\x67\x51\x62\xe5\xc9\x4b\xbf\xec\xc4\x96\x8e\x1d\xd4\x69\xb8\x44\xba\xde\x20\x12\xe6\xf0\xb9\xa7\x51\x41\x3c\x3b\xf9\xd3\xb6\xff\x61\xf9\x52\x82\xc6\x34\x51\x84\x3c\x15\xba\xed\x4f\x0e\x76\xad\x9a\x11\x11\x03\x91\x3b\x6d\x44\xa6\xbc\x89\x5a\xb3\x86\x13\xd8\x8e\x85\xa9\x39\xd6\xb7\xde\x41\x56\x10\xe4\x94\xec\x6e\x19\x9a\x56\x76\x15\x2e\x9c\x64\xa1\xf9\x8b\x34\x1f\x09\xef\x30\x83\x5f\xc1\xef\x8e\x44\xb0\x09\xb6\xb6\x61\xa6\xea\xcb\xf5\x58\xef\xa9\x45\xe2\xd7\xb5\x3b\x83\x70\x32\x0a\xdc\xa0\x2b\x2a\x4d\xc0\x4e\x36\x5d\x50\xcb\xda\x2e\xc1\xb1\x82\x30\x39\x1c\xcf\xc8\x06\x64\xcd\x88\xbe\x44\x94\xb5\x63\x91\xb3\xcd\x38\xdb\xd9\x91\x1e\xcd\xc5\x41\xf1\xfa\xab\xba\x17\x88\x34\xf1\xb5\x90\x85\xd8\x83\xb2\x41\xde\x09\x22\xa0\x3a\x16\xf4\x7a\xf8\x75\x23\x54\x1e\x55\x75\x78\x40\xe0\xf1\xb6\x80\xad\x05\x4a\xe4\xff\x4f\x0d\xed\xe7\x3f\xe2\x01\x28\x06\xc3\x3e\x35\xd4\x36\xcf\xf6\x51\x9f\xaa\x80\x9f\xc0\xe5\x6f\x95\x5b\xf6\xe6\xed\xe4\x73\xe8\x22\x8b\x00\x9f\x2f\x6f\x8f\xd0\x8b\xd2\xdd\xe7\xa2\xc0\x52\x25\x96\xae\x9b\x60\xe4\x50\x9d\x00\xed\x95\x4b\xf5\x95\xc3\x7e\x61\xd5\x0e\x43\x79\xb3\xcb\x10\x05\xd8\x3f\x61\xb3\xc3\xec\xde\x34\x3e\x7a\x06\xaa\x0d\x75\xb0\xce\x0f\x7b\xe7\x3c\xed\x59\x42\xb1\x34\x12\x29\x12\xfd\x85\x93\x09\xad\x18\xee\xac\xb9\xfa\x6c\x0b\x25\xef\x6e\x4e\x07\x03\x08\xfb\x72\x75\x85\x16\x81\x44\xcd\x21\xf1\x7d\x25\x2d\x1a\x43\x3a\x43\x79\xb8\x6a\x13\xe5\x55\x18\x2b\x2d\xda\xf1\x80\x23\xef\x75\x54\xb5\x0b\xce\x5f\xa5\xa7\xfb\x8e\x8b\xd6\x55\xbc\x9c\x11\x38\xec\x49\xe4\xe1\x25\x51\x69\x3a\x0d\xf3\x4b\x16\x5c\x9b\xf3\xf1\xfb\xf5\x13\x9d\x06\xc5\x9a\xf5\x39\xde\x88\x0b\x13\x67\xc9\x0f\xe9\xd7\xe5\x48\x0d\x49\x31\xb6\x43\x8d\xbc\xe2\xf0\xc2\xb1\x65\xea\x90\xea\x70\x15\x38\xd5\xd5\xf9\x3e\xc5\x23\x1a\x68\x0f\xdb\xad\x9c\x3d\x3b\x99\x61\x80\x73\x1e\xc5\x92\xf7\x8f\x83\x77\x5e\x14\x62\x54\x4a\x10\xc4\xc5\x90\xb5\x12\xea\xc7\x3f\x3f\xa1\x21\xe6\xbd\x60\xd9\x6c\x1a\x0d\x72\xb2\x88\x67\xda\xb2\xdf\xc8\xeb\x9f\xa8\xac\x7e\x2e\x0b\x1d\xdc\x25\xfd\xe8\x62\xfb\x87\x97\x59\x55\xfe\x5b\x5e\x71\x45\xf5\x35\x7b\x9d\xcd\xf2\x2b\xaf\xca\xe8\xec\x24\xc1\x75\xa3\x33\x02\x1e\x36\x6c\xbc\xf6\x95\x65\x2f\xce\x88\xb2\x89\x05\xcf\xb5\xb2\x93\x6f\x73\x87\x28\x33\xd6\x67\x39\x28\x58\x9e\x24\x61\x05\xdc\x35\x45\xe1\x76\xb2\x9b\x22\x6f\x8f\x54\xff\x23\x0a\x02\x9d\x20\x7f\xbc\x24\xde\x51\xa1\xc1\x76\x02\xda\x4a\xe6\xb8\x4d\x3d\x07\x67\x75\x80\x28\x44\x31\x51\x92\xd1\x13\xcd\xe5\x2f\xfe\x54\x7e\x1d\x29\x84\x9e\xa9\x1b\xd0\x5f\xc5\xf3\xbe\xa2\x95\x7c\x23\x38\xf8\xeb\xb8\xde\xdb\x47\x7f\x73\x9f\xd9\xd5\x58\xfc\x27\xf8\x04\xf3\xec\x0d\xc9\xae\xbc\x32\x6c\x57\xd8\xdc\xea\xdf\x10\xf6\x68\x20\x03\x0e\xab\xce\xc2\x8a\x23\xd4\xdc\x1e\xba\x24\xee\xbc\x0d\xc3\xec\x36\x47\xe0\x21\x7e\x52\xc5\x9a\xbe\x73\x0b\xec\x79\x4b\xd2\x6d\xe5\x59\x78\xac\x59\xd9\x66\x67\x17\x26\xf8\xd7\x29\xdf\xd6\x17\x34\x01\x5e\x8a\x15\xbd\x15\x08\x44\x75\x15\xbd\x50\x5a\x53\xdb\xec\x74\xfc\x9e\x5c\xab\xd7\x1c\x62\x2b\xe4\x3f\x4a\x3a\xb9\xc7\x6e\x19\x32\xca\x7f\x54\x94\x36\x78\xb1\xf7\xe7\x7f\xa0\xd3\xac\x3f\x92\x15\xf7\x9f\x9f\xe9\x6e\x2f\x74\xaa\x5e\xbc\xa2\xec\x3e\xf2\x97\x70\x3d\x71\x20\xac\xd3\x26\x26\xed\x83\xef\xf2\xde\x9b\xe2\x52\x71\x55\x50\x26\xdb\x47\xf1\xd3\xcf\x4b\x3a\x9e\xf0\xb0\x71\x63\x94\x54\x8a\x4e\x1f\x4a\x3a\x36\x67\x4e\x7a\xe6\xbe\x4b\x47\xa6\xf6\xf5\x9e\xa5\xf6\xb9\x60\x39\xc4\x5a\xfc\x12\x13\xc0\x8a\x38\x15\x0d\xb7\x3a\xa4\x97\x67\x63\xb3\xb7\xd2\x74\xe9\xd0\xe8\x04\x19\x6a\xde\xa3\x93\x76\x15\xc2\x64\xb6\xb1\x66\x12\x14\x24\x68\x0f\xef\xab\xb0\xe8\x00\x13\xd8\x9f\x6e\x5b\x83\x44\x62\xd2\x14\x14\xa1\x6b\x2a\x6f\x15\x99\x53\xd6\xa3\x72\x64\x75\x5c\xf4\xaa\x45\x80\x94\x5c\x81\x5b\x7c\xab\x73\xf5\xef\x89\x10\x39\x43\xb2\x95\x91\x1d\xb9\x44\x50\x81\xea\x8a\xbb\x40\x45\xa7\x7b\x6f\x0d\x99\x02\xa9\xfb\x52\x13\x83\x07\x35\x37\x87\x5f\xee\x34\xaf\x14\xce\x21\xa8\x8b\x54\xff\x28\x89\xdb\x4a\x22\xef\x82\x7c\xe2\x72\x82\x0b\xb0\xf7\x4c\xb8\xb3\x38\x29\x27\xd1\x52\x8e\x37\xef\xbb\x5d\x26\x72\xcb\xe3\x6d\x97\x0d\xf0\x47\xa5\x4e\x25\x6a\x88\x85\x58\xb5\x4f\x13\xd7\xda\xf8\xdf\x3f\x3a\x9d\xcb\x1e\x4f\xcf\xda\xe7\x79\x73\xc7\x65\xd7\x00\xbd\x90\xce\x94\x88\xd4\x82\x2f\x85\x54\x2b\xaf\x64\xd0\x31\xf2\x8a\xa8\xfe\x32\x51\x0f\x04\xdd\xed\x7d\x52\x53\x26\x5c\x0d\x50\x2a\x85\xbb\xdf\xd1\x64\x53\x47\xa1\x1c\xb5\xa1\x58\x68\xdc\xab\xec\x82\x87\xda\xaf\x19\x76\xcc\x0a\x77\x3e\xb0\xec\xd2\xce\xc5\xd5\x08\xfe\xd8\xbc\xa7\xe7\x2a\xcf\x91\x95\xfe\x91\x18\xc8\x8e\x24\x49\x92\x6c\x03\xee\x91\x61\x3c\xc7\xc2\xcb\x63\xb9\xc3\x61\xa4\x5c\x61\x5e\x54\xce\x6f\x46\x03\x9d\x1b\xf4\x66\x74\xec\x6f\x00\x5e\x81\xf4\x9d\xf3\xb0\x5e\xee\x36\x19\xd7\xa9\xbc\xce\x33\x42\xa1\x11\x9c\xb5\x84\x8e\x7f\xe7\x7c\xbf\xcf\x5c\x59\xf7\x39\x98\x57\x7b\xae\x08\x45\xf2\x91\xae\xda\x3d\x89\x94\xb6\x7d\xe8\x75\xb8\x55\x5a\x32\x6d\xee\xec\x7e\x8a\x8d\x45\x28\x0e\x80\x25\x82\x24\x63\x38\xf2\xd6\xf9\xab\x6d\x2d\xba\x45\xfe\x5a\xce\xab\x61\x57\x06\xe7\xaa\x6e\x53\xd1\xb7\xc6\x67\xdf\xe6\x85\xf3\xdd\x06\x63\x57\x0e\x82\xd5\x89\xad\x3c\x83\x11\xb6\x1c\x6d\xa1\x3c\x8f\xea\x2b\x85\xca\xf5\x4c\x11\xd5\xd5\x2e\x75\xd4\x7a\xbd\x34\x75\x88\x2d\xcf\x11\x3b\xea\xdb\x3d\x0e\x87\xa2\xb4\x09\x10\x12\xe2\xb5\xac\x50\x60\x00\xf8\x96\xbe\x73\x3a\x59\xd8\x55\x49\x2a\x22\xe8\x1c\xff\xe4\x8a\xaa\x30\xd8\x60\x67\x78\xfe\x63\x19\x66\x07\x89\xe0\x14\x0a\x43\x3d\x66\xdc\x9b\x6a\x38\xfd\xfb\x0e\x13\x57\xa9\xb5\xf2\xdb\x5f\xab\x17\x51\x04\x62\xd7\xe2\xfd\x45\xaf\xb5\xca\x2e\x7a\xd8\x25\x7d\x33\xc2\x48\x22\x62\x62\xa7\x79\x0a\x1c\x84\x59\xc4\x01\xb2\xfc\xaa\xf3\x74\x93\xb7\xb8\xfe\x43\x21\xc0\x52\xdf\x52\x25\xdc\x75\x40\xc3\x9d\x7e\x04\x6e\x91\x73\x4a\x72\x31\x46\x93\x73\x11\x22\xee\x16\xcd\xf2\x6a\x5b\x38\xbd\x59\xc9\x76\xa8\xfd\xe4\x00\xdd\x32\xab\x6c\x3b\xa5\x9b\x84\x64\x36\x85\xaf\x8a\x7d\xe5\x4e\x7f\x41\x33\x49\x35\x1c\x55\xb3\x7f\xf9\x08\x1a\xd8\x19\xdd\x9f\x58\x5e\x66\x49\x47\x27\xf7\xd5\x98\x00\x40\xb2\xb9\x84\xdc\x1b\x3a\xa8\xd8\xef\x37\xf2\x27\x06\x41\x4c\x75\xe6\x74\xd2\xd2\x03\xab\x8f\x6a\xac\x22\x68\x7b\x0a\xb3\x21\x54\x70\xa2\x86\x9d\x2c\x35\x3c\x75\x95\xcd\x2a\xb1\xa9\xa6\xac\x84\xe9\xf0\xd0\x63\x01\x96\x23\xc2\x12\xa5\xdd\x5b\x4a\xdb\x88\x29\x4b\x57\x96\x14\x69\x92\x4e\x6d\xfa\xa7\xaa\xb6\xba\xfe\x29\x61\xcc\x64\x93\x0a\x1b\x4f\x75\x8e\x7a\x6c\x97\x6e\xa2\xee\x3f\x86\x18\x89\x53\xe3\x29\x9b\x95\x33\x54\x24\xce\x0b\x63\xd1\x96\x44\xc2\x1c\x11\xdb\x4c\x4b\xbe\x12\xd0\xd1\x58\x5a\x3f\x2c\x5c\x78\x6d\xe4\x1b\x33\x18\xbb\xc8\xa1\xa5\x74\xf2\x72\xd9\xd5\x9f\x1b\xb1\x33\xba\x38\x18\x64\xe8\x12\x2a\x60\xd8\x49\x91\x47\x96\xc3\xb7\x1b\x96\xd2\xd1\x0c\x0b\xe1\xc0\xa8\xb2\xd6\x4a\xb8\xaa\x7f\x88\x5d\x5c\xb4\xd5\xd6\xc1\xce\x00\x6a\x34\xa2\x2a\x7c\x42\xdc\x13\x66\xd1\xef\x55\xb5\x9d\x26\x27\x9c\x55\x51\xd8\x31\x34\x55\x36\xd0\xe9\x11\x75\x5d\x69\x23\xda\xc1\xec\x73\xbc\x70\x56\x3b\xc1\x06\xb2\xf9\xa3\xff\xd3\x33\x35\x27\xe9\x14\x7a\x97\x27\x5d\xff\x9f\x20\x3c\x68\x34\x9f\x22\x98\x3f\x94\x48\xaf\xec\xb4\x5f\x7c\xf4\xf0\x81\x03\x09\x06\xa8\x8e\xee\x34\xb0\x0c\xdc\xf7\x28\x0d\x97\x30\xa0\x66\xbb\xad\x46\xec\xcf\x50\x3b\xbf\xfe\x87\xf2\x9f\x02\xd5\xf6\x4d\xa8\xe9\x50\x86\x51\xbd\xb6\x4b\x22\xdb\xa1\x39\xa5\x0f\x33\xf0\x2b\x9a\x0d\xda\x4f\xc4\x5c\x8f\xf9\x1f\xdb\xbf\xd9\xf1\x48\xba\xce\xfc\xd4\x1c\x43\xf6\xde\x32\x4a\xc9\x8b\x24\x36\xb7\xd6\xf0\x8c\x61\x52\xd7\x52\xb4\xfa\x32\x25\xc9\x43\x7a\x29\xe3\x63\x1e\xd5\xa8\x1b\x86\xc4\xbd\x5c\xff\x45\xc4\x85\x90\x26\x77\x0f\xa5\x9a\xb9\x76\x1d\x1b\xdd\x36\x5b\x47\x76\x01\x38\x50\x2c\x5e\x91\x58\xcb\xc9\x13\x52\xe8\x39\xe2\x6a\x3f\x3e\x55\xf9\xf3\xdd\xc3\x1a\x4b\x34\x81\xc8\x1e\x34\x5c\xca\x9f\xa5\x5d\x45\x99\x52\x98\xa0\xd4\xc3\x3f\xeb\x0e\x62\xd9\x27\x78\x65\x25\x22\xd7\x6c\x03\x3a\xb2\x01\x98\x90\xa3\x1d\xcd\xb5\x30\xd7\x44\xb4\xa3\xba\x7e\x14\x42\x76\x1f\x76\x9b\x90\x21\xe0\xb5\x9d\x0b\x02\x23\x09\x7f\xc9\xea\xc2\x11\x50\xe9\x20\x1a\x18\xa3\x1b\x37\x45\xe0\x9a\x9c\x4b\x70\x1c\xa5\x68\xf3\x94\x5c\x49\x4d\xd0\xae\xcb\x54\x3b\x75\x44\xa3\x7d\x54\xd2\x10\xa6\x9c\x98\x30\xb4\xa0\x78\x1d\xc9\xc7\x96\xba\xec\x9a\x48\xba\x9f\xd8\xd2\x87\x5b\x84\xbf\x5d\x49\x16\x87\xa5\x15\x95\x9b\x5b\xd3\x44\x85\xa9\x94\xdc\x35\xd2\xf1\xd7\xcc\x32\xad\x9b\xc5\xac\xb4\xc1\xd2\x0a\xc3\x1b\xef\x42\x32\x97\xa8\x23\xa3\x8c\xf4\x44\x68\x1f\xa6\x08\xd8\x17\x75\xcf\x21\xde\x87\x68\x70\xe4\xc8\x85\x88\x65\x9f\xe4\xb3\x6e\x63\xba\xee\x59\x25\xb9\xbe\x33\xad\xb5\xe7\x2b\xda\x7e\x3c\x09\xbb\xc4\xd6\x17\x08\x6c\xe4\x47\x41\x09\x48\xfe\x5d\x6a\x25\x2a\xba\x68\x4a\x90\xab\x5f\x54\xe2\x0f\x6f\x11\x7a\xe9\x78\x51\x06\x97\x04\x83\x00\xd5\xb4\xb9\x15\xa3\x41\x55\x26\xe6\x21\x96\x94\x65\x6d\x92\xc0\xaf\x1c\x2a\xbe\xe9\x5b\x69\xf7\xf1\x4d\xee\xf3\x86\x8f\x81\x28\x15\x99\xe2\x80\x9a\xc1\x34\x3a\x4d\x4e\xb8\x1c\x78\xa9\xbd\x5d\xca\xec\x2a\x95\xb9\xb9\xe9\x58\x79\xa9\x62\x90\xc2\x3c\xd6\x8f\x2e\xdc\x66\x51\x29\x7e\x1e\x06\xe2\x79\xa0\xfb\xa7\x44\xdf\x51\x48\xc2\xab\xd0\xde\xe4\x05\xa3\x24\xaa\x68\x5e\x2d\x22\xec\x25\x0e\x93\x12\x56\xd4\x07\x74\x97\x36\x4a\x54\xaa\xb6\x7f\x6e\xdd\xc8\xde\x5d\x5d\x59\x0b\xd8\x28\x64\x2b\x5a\x43\xd1\x7b\xed\x56\x6a\x5c\xea\x8f\xaf\x87\xc8\x44\xef\x99\xde\xf6\x31\xc8\x6e\xbc\xe7\x9f\x88\x7b\x24\x76\x78\x43\xc1\x38\x71\x90\x25\x7d\xc6\xee\x9c\x3e\xe0\xf9\xed\xba\x18\xc4\xff\x8b\x9b\x47\x8f\x9f\x14\xf6\xd4\x9f\x57\xac\x39\xd0\xc6\xe0\xab\x21\x3b\x0f\x5b\x88\x08\xb3\x43\xe7\xbb\xf9\x3f\x2a\xdd\x0f\xdf\x61\x44\x0b\x9f\x29\x40\x13\xe8\xc0\x1b\x03\x6f\xde\xf5\xed\xca\xdc\x3b\x58\x71\xc7\x1c\x12\x1a\x4f\x98\xf5\x42\x6a\x07\xac\xe5\xcf\x73\x58\x88\x8d\xb8\x3d\xca\x3e\x0f\xb4\xa6\xe2\x7b\x2b\x2c\xd0\x82\x14\x74\xcd\x6a\x1d\xca\x37\x14\x1a\x99\x25\x64\xe0\x4d\x4d\xde\x4c\xc7\x00\x27\xdd\x6a\xc8\x89\x75\x07\x6b\x3f\x8a\xd8\x6d\x83\x91\xd4\x40\x3b\x25\xe9\x07\x29\x7a\x0b\xed\x0c\x04\x8c\x91\x2d\x33\x51\x94\x60\x95\x64\x11\x1b\xcf\x2b\x49\xe9\xc2\x63\xe0\x67\xd0\x09\x29\xbe\x1f\x37\xf1\x07\xcf\x3a\x05\x55\xaf\x7c\x7d\x9b\x73\xa2\x74\x89\x66\x87\xad\xe9\x82\xd9\x4f\x45\x7f\xda\x91\x5f\xe5\x59\xd8\xfe\x08\x19\xee\x39\x2b\xc2\x19\x9d\x34\xaf\xf3\x26\x91\xfa\x00\xad\x88\x74\x97\xc3\x88\xea\x74\xcb\x3b\x1f\xd9\x2c\xee\xef\x8d\xee\x1c\x27\x98\xe9\xbe\x53\xb0\xe2\xe4\x9a\x5b\xa5\x7a\xb8\xed\x96\x55\x84\x7d\xa1\x98\xc8\x0b\x42\x0d\x28\x62\x3d\xce\x30\x87\x3d\x4e\x32\xd3\x8e\x93\xb1\x80\x07\x64\x8a\xfe\x2a\x2b\x63\x1c\x8f\x95\x6c\xbd\x03\x84\xdf\x3b\x7b\x25\x39\xef\xa4\xfe\x80\xc8\x35\x2b\xae\x0f\x8a\x43\x7f\x1e\xec\x8c\x5e\x5c\x60\xe1\x4e\xe8\x87\xe9\x0c\xd7\x4a\x0a\x00\xdd\xa3\xdc\x8f\xf4\x57\xb7\xc2\xb0\x6f\xbe\x8c\x47\x52\xef\x2e\x81\x8d\x47\xfb\xa3\xf0\x20\xd0\x0e\xc0\xdb\x17\x82\x22\xe1\xdd\xc9\xca\xb0\xea\x78\x02\x71\xc6\x60\x40\x72\x0f\x19\x1a\x85\xae\x35\x0f\x54\x84\x57\xa2\x6c\x87\x4e\xa2\x3b\x9c\xd1\x9a\xe8\xfd\x24\xd5\xf0\x9e\xa2\x1b\xb0\x55\xc2\x04\x5b\xf9\xb2\xd7\x66\x6b\x1e\x45\xec\xe5\xfe\x2c\xad\x24\x64\xad\x67\x85\x60\x93\xe7\x38\x2e\xf5\x88\x3e\xdf\xc3\x85\x3a\x6a\xa2\x29\xcd\x7f\x9b\x7f\x11\x9f\x1b\x3a\x11\xd2\xf8\xb8\x2b\x2f\x1b\x77\xee\x81\x19\x3c\x42\x39\x98\xcf\xc3\xcf\xff\x28\xed\xd1\xf4\x53\x48\x0e\x62\xc2\xfd\x2e\xab\x02\x97\xf0\x3c\xd2\x44\x80\x1a\x8f\x25\x59\xfd\x97\x0e\x38\xac\xe1\x7e\xf9\x95\xd5\xa5\xf6\x4f\x36\xb0\x39\x85\x7e\x3d\xb6\x2d\x22\x44\xec\x9e\x47\xac\x54\x93\x4e\x11\x1b\xcc\x5f\x3d\x63\xda\x94\xdd\x93\x5a\x98\xfe\x06\x23\x75\x14\x2a\x48\x7e\x9b\xb2\x6f\xaf\xe0\x7a\xa4\xee\x1b\xfc\x20\x58\x39\xd9\xce\x83\x9d\x3b\xa4\x37\xb7\x56\x1f\xfa\x8c\xec\xd8\x65\x7d\x6f\xab\x2c\xd6\x91\xbb\xa3\x1b\xdc\x65\xd5\xbb\x62\xf4\x5c\x70\x19\xbb\x1f\xc3\xb8\xf2\xa4\x2f\xff\x52\xc2\x9f\x88\xe0\xdf\x52\xa6\x75\x93\x90\x7b\x29\x21\xb3\x5b\x5a\x7c\x84\x6d\x2c\x9c\x06\x6c\xcb\x89\x5e\x79\x0d\xfa\x86\x8b\xda\x59\xe1\xc9\xcb\x68\x26\xef\x74\x99\x57\x87\x6f\x96\x38\xe5\x96\xdc\x08\xba\x0b\x1d\x57\x96\xe4\xcd\x9c\xbf\x22\x5f\x90\x3f\x44\x7a\xfb\xc8\x6a\x1d\xab\x39\x7c\x37\x35\x2b\x67\x61\xaa\x57\x78\x22\x39\x63\x52\xba\x9b\x4a\xfb\xdb\x49\xbd\x7a\xdb\x3f\x50\xa0\x8e\x7d\xc4\x02\xa9\x86\xdf\x6b\xd5\x01\xef\x1d\xb5\xfc\x4e\xd8\xd6\xf9\x4d\xde\x77\x7b\x38\xe7\xf0\x9a\xa3\x84\x13\xbd\x64\x82\x21\x25\xc5\xf4\xf6\x6b\xab\x86\x83\xda\x9f\x0f\x03\x4d\x4e\xd0\x93\x87\x8d\xad\xf1\xd8\xd4\xfa\x6d\xdf\x36\xc8\xab\xc4\x32\x53\xc4\xd6\x21\xda\x90\x37\xbc\x17\x1e\xaf\xd6\xc4\x7b\xeb\x43\x87\x11\x88\x47\xb5\x84\xe9\x67\xcc\x03\x53\x1a\x76\x2f\xa6\xbd\x38\xa7\x7e\x88\x09\x0a\xae\xa4\xf7\x02\xad\x34\x57\x9e\xb1\x28\x4f\x6b\x8c\x5c\x43\x20\xc5\x7c\xd4\xa4\xec\x1f\x30\x06\x58\xe1\xb5\x16\xc2\xc8\x84\xfe\x31\x5c\x38\xe3\x53\x7a\x03\x78\xd7\xda\x35\xc2\x44\x42\x75\xdd\x18\x64\xc7\x73\x54\x3f\xf5\x59\xd1\x76\xf4\x13\xe7\x59\xff\xe6\x37\x2d\x01\x30\x64\x60\xcf\x29\x06\xf6\x53\x11\x60\x30\x61\x97\x2d\x54\x51\xa1\xf9\x8c\x55\xf3\x09\x97\xe8\x55\x05\x5e\xa7\x9b\xec\x1d\x11\xe1\x7a\x12\x9f\x91\xcd\x07\x95\x40\x33\x94\xbb\xcc\x47\xd4\x2e\x11\x11\x82\xde\xb6\xbb\xa6\x70\x76\xcf\xe4\x91\xc2\x46\x98\x7c\xc9\x33\xcc\x26\xf0\x5f\x1e\x0c\xc9\xf6\xe7\x12\x69\xfb\x25\x0b\x01\x7f\x89\x27\x4d\xfa\xce\x50\x3f\xc6\xf3\xad\xe4\x03\x54\xc9\x36\x5b\x5d\xdd\x80\x71\xa8\x30\x04\xc5\xe0\x94\x51\xd6\x50\xae\x50\x15\xf5\xa4\x4d\xbe\x66\xd5\x74\x98\xa8\x28\x20\x3a\x9b\x96\x1c\x56\xa1\xbc\x8d\x08\x14\x8b\x35\x65\xb6\x0f\xe1\x75\xeb\x46\xef\x7e\xf4\xce\x21\x96\x01\xfe\xc5\x64\xa5\xc1\x76\x5a\x61\x4a\xda\xb1\x14\xed\x3f\x92\xb2\xf6\x08\x81\xf2\x0a\xa8\x5e\x08\xa3\x67\x6b\xef\xe2\xc7\xe8\xcf\xc2\x0d\x94\x9b\x5f\x15\xde\x86\x3d\xdf\x2e\x72\x8f\xdb\x5d\x91\xf8\x58\x4e\x01\x43\xb6\x0e\x4f\x7a\xd2\x1e\x06\x57\x5e\xf7\xd2\x1f\x6b\x94\x56\xb7\x0f\x9c\x05\x46\x55\xe8\x5a\x4a\x3b\x84\x25\xe2\x8f\xd6\xa5\x90\xc2\xcb\xf7\xbb\x47\x2d\xa1\x4a\x0e\x64\xac\x4b\x71\x44\x87\x2a\x50\x6f\x1f\xb1\xbc\x5b\x95\xa0\xd5\x7d\x42\x2d\x61\x67\xac\xfc\x01\x6c\x1b\xaa\x3b\xc1\x9e\x8f\x9e\xde\xbb\xb9\x07\x74\x51\x76\xc5\x2d\xf3\x10\x65\xd9\x1c\xe9\x99\x4e\x9f\x94\x5a\x29\x69\x8d\xeb\xc4\x47\xea\x3c\x16\x38\x42\x8e\x9a\x43\x29\xfe\x83\x1f\xb9\xbd\xb6\x6d\x54\x25\x68\x63\x23\x61\x2f\x60\x81\xee\x4f\x42\xdd\x5d\xd1\x4d\xcd\x10\xbf\x34\xa8\xbf\x13\xd6\x8d\x3e\x20\x4a\xf4\xc9\x99\x02\x9d\x32\x0a\xed\xa8\x2a\xee\x96\x5e\xbc\x9b\x2f\x17\xb4\xb2\x8f\x29\x9f\x8f\x6e\x8e\x78\x4b\xd8\x49\x0d\x51\xd9\x31\x6b\x12\x33\x6e\xf4\x08\xcf\x06\xf7\x74\xed\x43\xa3\x83\xc8\xed\x3f\xda\x83\x11\x94\x94\x68\xc4\x6c\x83\x41\x9e\x5a\xdc\x48\x79\x64\x92\xcf\x6c\xc9\xea\x25\xac\x02\xe8\x8e\x7b\x0d\x56\xb7\xb8\xd6\x5d\x44\x42\xfa\x26\xe5\x3e\x76\x59\xbd\x79\x3e\xa4\x73\x13\xa2\x0f\x1f\xc2\x9b\x47\x5d\x86\xce\xd6\xf7\xbb\x76\x95\x77\xee\x94\xc1\x53\x33\x79\xd4\x9d\x0f\x9c\x35\x6a\x97\x73\xd4\x9c\x29\x9e\x3f\x52\xdf\xf1\x9d\x73\xc4\xc5\xda\xec\x9d\x49\x68\xfd\xa6\xe5\xfc\x86\xee\xe1\x53\x27\x3f\x25\x3f\x9e\xfe\x8b\x01\x5a\x1d\xb4\x36\x28\x9b\x2e\x81\xf7\x1c\xa9\xf5\xef\x86\xcf\xd0\xf8\x20\x47\xd1\x07\xe8\xd8\x75\x55\xb6\x34\x3c\x68\xd4\xcf\xce\x64\xb2\x2f\x7f\x27\x8c\xfd\xe2\x16\xee\x55\xb0\xf1\x60\x0c\xdd\xab\xd8\x05\xee\x9f\xf0\x35\xbf\x44\x0d\xb0\x9f\xe8\x96\xfa\x6a\x75\xe2\x1d\xef\x0e\x83\x55\x16\x83\xbb\x1a\x7b\xbb\x15\x8d\x65\x8f\x66\xa0\xfd\x91\xf7\x30\xe8\x5a\x73\x7d\xc5\x38\x55\xf2\x91\xec\x6b\x12\x09\xbb\x12\x55\xf5\x1a\x51\xdc\xad\x5b\x17\x0e\x0c\xf8\x07\x5d\x6b\x77\x04\x8c\xdf\xe5\x60\x61\xb8\xf5\xec\x9f\xdc\x65\x6b\x7b\x51\x1b\xa7\x6b\x96\x75\xc2\xaa\xce\xc4\x1d\x8e\xbe\x56\x42\x36\x13\xc3\x7b\x0e\x61\xcc\x2d\x52\xd7\x1d\xc9\x0c\x48\x5e\x6a\x56\x0c\x36\x5f\x55\x5a\x15\xb8\xdb\x03\x37\x3d\x17\xac\x82\xd8\x2a\x0c\x17\xda\x0b\xf1\xa1\x57\x0c\xfc\xc8\x8d\x8e\xc7\xa0\xab\xd0\xb1\x79\x65\xfb\xc7\x2e\x4c\xd8\x20\x54\x7d\x8a\x09\xbd\x7f\x54\x17\x1b\x4f\xaa\x14\x77\x31\x40\xa3\x71\x77\xc4\x72\x65\x23\xb2\xab\xed\x0a\x0a\x2f\xb1\xbd\x55\x79\x5b\x63\x26\x5f\x76\x7d\xcc\x4c\x1a\x2d\x30\xe7\xf4\x11\xd9\x1c\xb6\xbd\x20\x63\x73\x65\xa6\xd7\xc5\x66\xf2\x35\x33\x99\xd2\x8e\xa1\x8a\xba\x40\x41\x92\xa9\xac\xcd\x09\x61\xc0\xf0\x0f\x9d\x74\x0a\x8b\x50\xd4\x95\x7a\x87\x53\x6c\x56\x9d\xe8\x29\x7f\x86\x57\xe8\x98\x20\xc0\x6a\x5a\xa8\x4b\x61\x00\xb6\x3a\x86\x6d\x84\xeb\xca\xd5\xcc\x04\xdd\x49\xdd\x4c\x60\xeb\x2a\x4c\x73\x84\x9f\x82\xce\xf9\x93\x90\x31\xca\x81\x99\x5d\xde\xd5\x0c\xdb\x10\x11\x14\xed\xf0\x57\x59\xc5\x02\x16\xe0\xbb\x4e\x6a\x23\x5d\xe8\x99\x53\x24\x97\x00\x30\xb2\xf8\xfc\x24\x39\x40\xdc\x42\x60\x3c\x3a\xa1\x63\xb0\xff\x19\x7b\x4b\xcc\xe2\x59\x81\x3d\x67\x04\xe0\xdb\x49\xd2\xa2\xdf\xe7\x95\x8c\x4e\x85\x21\x79\xbb\xb2\x65\x57\xd1\xfa\x61\x4f\xdc\x66\xb1\x4b\xe9\x15\x1f\xe9\xe8\x87\xa8\x82\x56\x8b\x32\xb0\xca\xe6\x22\x68\xc2\xbc\x7b\xc8\xd0\x6d\xba\xa4\xb1\xc7\x08\x1a\x29\x5b\x9c\x00\xb9\xbd\x98\x2c\x68\x5c\x3f\xd8\x88\x64\xe2\xbb\x36\x32\x68\x48\x72\xdf\x70\xb8\xba\xc2\xdf\xf7\xc1\x8a\x0b\x30\xfc\x29\x8b\x88\x9b\x97\xe3\x0f\xe1\x3c\x94\x39\x6b\x47\x45\xd2\xc3\xc1\xf4\x08\x6c\x05\x7f\xd9\xdc\x17\x7f\x04\x17\xed\x48\x9c\x8a\x8e\x5f\x10\x37\x12\xe7\x07\x99\xf3\x8a\x8d\x9a\x02\x6f\x3d\x12\xbd\xaf\xed\xa8\x58\xfa\x1b\x8e\x6c\x7e\x31\x16\x69\x22\xc1\x2c\xf5\x4f\x6b\x15\x88\xb8\xa6\xc8\x05\x18\x29\x53\x2c\xbd\xbb\x5a\x78\x19\x1b\x97\xd8\x5e\x82\x46\x64\x0f\xd3\x9d\x7b\x7e\xff\x43\x45\x75\x2c\xd9\x87\xb3\x60\x9c\xbd\xa5\x0b\xed\x99\x32\x3a\xdb\xae\xf3\xd3\x6d\x95\x1e\x4d\x9b\xe3\xd3\x94\xb8\xb9\x3f\xf0\x2f\xd4\xe1\x0e\x03\x0a\x15\x8b\x76\x65\xc5\x16\x62\xc3\x62\x12\x37\x87\xc5\xdb\x4c\x34\x1e\xc5\xac\x5a\x89\x73\x2f\xc3\x5d\x58\x2c\x2b\xef\x61\x78\x39\x8c\xb0\xd9\x62\xa9\x0b\x1e\x6d\x4c\x16\xb2\x57\xb4\x28\xff\x57\x93\x03\x88\xae\x8e\xa3\x76\xce\x76\xef\x03\x7b\x95\xe0\xc8\xb0\x3f\x69\x43\x45\x6a\xf5\x03\x3d\x77\xb7\xf4\xf9\x35\x25\xa8\x6e\xf3\xee\xb5\xfc\x29\x1a\x8f\x55\x9d\x03\xfb\xe9\xe6\xcb\x77\x4b\xfe\xc7\xfc\x65\xc9\x3a\x6d\x91\xc7\x35\x0c\x2d\x4d\x9f\xdd\x04\xd0\x5a\x59\xec\xfa\x0c\xb6\xd6\xa0\xae\x7a\x07\x61\x0d\xef\x6b\xf7\x6f\x22\x75\x95\x55\xad\xcb\x1e\x34\xb3\xc2\xc8\xa2\xd1\xbd\xad\xee\xf5\x34\x87\x1c\xc0\x27\xed\x05\x58\xf3\x6e\xea\x27\xaf\x0c\x86\x59\x73\x5f\x3f\x7a\x50\xd7\xaa\xe1\x70\x7e\x3b\x75\xba\xfa\xb6\x7b\xac\xec\x5f\xee\xc8\xf8\x24\xaa\xb5\x2a\x73\xdd\x96\xc7\x1c\xd9\xb5\x5d\x92\xdc\x4e\x5a\x68\xab\x94\xc7\x48\xf7\x9a\x58\x33\xef\xcc\xd8\x87\xf0\x8e\x76\x19\xab\x4c\x2f\xe0\xcf\x11\x61\x5f\x30\x95\x50\xea\xe0\x42\x46\x27\x47\x4d\x27\xb4\xcc\xd1\x9d\x04\xa7\x7f\xe4\x2c\x0d\xbf\xe0\x10\xe3\x29\xd5\x67\x49\x84\x75\x97\x74\x70\xb7\xfe\x57\xa6\x66\x85\xf1\x97\x7f\x91\xaf\x7f\xd1\xaf\x9f\x61\x57\xe6\xe7\x6a\x6b\x04\x4f\x1f\x5b\x3b\x9c\x32\x8a\xf2\x98\xc6\xb8\x6e\x85\x71\x8a\xae\x9a\xfd\x23\x4d\xd0\x0a\xf2\x68\xeb\xff\x92\x7c\x6d\x99\xc2\xca\x6a\x9a\xc7\xb0\xcc\x08\x9b\x2d\xfb\x81\x0a\xbb\xae\x59\x90\xa5\x4d\x07\x4f\x35\x43\xe7\x65\x69\x15\x32\xfe\x6b\x52\x9a\x45\x50\x61\xa6\xfc\x4f\xb0\xed\xe7\x97\x75\x1b\xd5\x6d\x0d\x9f\x63\xd4\xbe\xe4\xbb\xda\xd2\x4e\x07\x0e\xd7\xef\x28\x82\x4c\x4e\x62\x48\xb9\x90\x09\x08\x02\xad\x6b\x23\xc2\xe6\x67\xfc\x93\x41\xbe\x04\xb0\x37\xce\x8d\xdf\xfa\xd9\xd5\x57\xfd\x8a\xb1\xaa\x38\x7f\x9b\x9e\xdd\x39\x43\xce\x27\xa3\xcc\x75\x47\x45\x9f\x8f\xf2\x96\xc6\xb1\xa7\x34\xf0\x25\xb2\xaa\xc8\x19\xd8\x1c\xb3\x14\x96\xb8\x60\x84\x30\x81\x53\xf0\x98\xba\xa2\xea\x58\x3e\x21\xb0\x9e\xf3\xea\xf4\x84\x96\xc2\x9d\x2d\x4e\x72\xe4\x9e\x45\x41\x15\x4f\x60\x61\xfb\x8f\xa3\x0a\x00\xfd\xc1\x36\x25\xeb\xeb\xf4\x52\x82\x06\xea\x5f\xe6\xea\x82\x68\xf0\x80\x69\x32\xbd\xea\x22\xbe\x09\x57\x97\x40\x18\x86\x49\x91\xbe\x7a\xbf\x67\xb5\x42\x68\x04\xdb\x76\x5c\x5e\xde\xc6\x2e\x38\x0f\x71\xa2\x67\xad\x91\xd8\x0c\xc9\xc4\x0f\xed\xcc\x2c\x9d\xd9\x80\x75\xd7\x8f\x1e\x30\x1b\xa4\x56\x76\x0a\xe7\x6e\x66\x2c\x30\x72\x31\xa6\x1c\x91\xb9\xe7\x16\x76\x75\x23\x7c\x5f\x59\xc0\x0d\x50\x82\x89\x68\x4a\xee\x2c\xf8\xf6\xfa\xb0\xc8\xb3\x96\x74\x11\x36\x59\xf4\xdb\x48\xd4\xa1\xd8\x36\xf3\xdc\xc5\x7c\xb4\xb9\x62\x8d\x5a\xf6\xe6\xe9\x63\xfb\xa9\xad\xd9\xa2\xf4\xd0\x3b\x66\x0d\xa8\xf9\xab\xd2\x7f\xd2\x73\xe3\xe1\x94\x55\x6d\xdd\xfb\x33\x87\x43\x46\xfd\x59\x35\x9f\xa1\x1a\x3c\xef\xe8\xe6\xf7\xb0\x1d\x96\x5f\x07\xbe\x07\xe5\x6f\xec\x10\x7d\xb2\xbd\xb9\x0f\x72\x5d\x2e\x6b\xb9\x28\x38\xb3\x21\x82\xbf\x7d\xf7\xd2\x17\x82\x20\x7d\xb0\x49\xb0\x8a\xa8\xbf\xd9\x33\x47\x38\x7b\x36\x3e\xab\x62\x99\x96\x62\xb0\x47\x9d\x2c\x42\x0e\xca\xe4\xa0\xd9\xe2\xaa\xfa\x7e\x45\x99\x3d\x09\xc5\xa0\x60\xe6\x71\x53\x3c\x48\xa4\x65\xf7\x29\xdc\x47\xa0\xa7\xe1\xba\xde\x7d\x76\x4a\xfa\x6a\x70\x77\xc1\xaa\x25\xe3\xf6\x24\x8e\xe0\x91\x40\x6c\x8a\x36\xfa\x6a\x8d\xa6\x66\xcd\x72\xc3\xb0\x72\x37\x3a\x9e\x5b\xab\xba\x61\x59\xa0\xe2\x79\xce\xb2\xed\xcb\xb3\xaa\xe8\x25\x8b\xcc\xd0\x85\x1f\x51\x57\xb4\x85\xef\xf0\xad\x45\xd1\x6c\x9f\x51\x83\xf0\xca\x73\xa3\x7b\x5a\xf9\xc5\xa3\x56\x6d\x70\x6c\x60\x25\x39\x87\xff\x98\x4a\xcf\x61\xbf\xdd\x4d\xaa\xe2\xed\xc8\x14\x5f\xbb\x1e\xd5\xd3\xb4\x4f\x37\xf1\x98\x9b\x8f\x60\xc0\x10\x1d\x35\x07\x0d\x6e\xf0\x2b\xe1\x2e\x4a\x15\x9e\xe2\x15\x7e\xa3\x40\x0b\x51\x85\x37\xef\x99\x4e\x56\x36\x1d\xe6\xf9\x30\x2d\x81\x45\x31\xab\xe9\xb5\xb0\x37\xea\xaf\x4d\xc2\x66\xfa\x2f\x2e\xd3\x74\x90\x8a\x92\x8a\x2c\xfe\xec\x92\x17\x9b\x36\xff\xd1\x55\x04\x92\x47\x16\xdb\xab\xa8\xab\x09\x25\x0b\xeb\xe6\x5e\x2d\xca\x2f\x16\x0c\x86\x64\x7d\x03\x5c\xfa\x12\x54\xfb\x26\x30\xaf\x59\x05\x97\x0a\x1a\x90\xaf\xe6\x9f\x42\xd8\xe0\x63\x35\x85\x6f\x3a\xde\x1f\x5e\x48\x3e\xb1\x44\x30\x49\x58\xda\xa3\x51\xba\xa9\x30\xc6\xfe\xe0\x17\x1e\x02\x95\xe3\xf9\xeb\x97\x46\x17\xd5\x7e\x4a\x2b\x7d\x2e\x8d\xf5\x4c\x8a\x05\x1f\xb2\x27\x69\x97\xb7\x4b\x2a\x99\xcf\xfb\xb6\x05\x32\x2c\x06\xb3\xf4\x6d\x0c\xd5\xd3\xdb\x7e\xbb\xe8\x92\x6d\xd7\xb1\x45\x9c\xfc\x0c\x36\x10\x73\x12\x0a\xcc\x74\xd2\x4f\xeb\x0d\x8e\xd7\xa6\x73\x09\x81\xc7\x22\xfb\x32\xe8\xca\xea\x75\x2f\xdb\xe7\xaf\x5f\x79\xdc\x6c\xbe\xe0\xca\x4d\xb2\xee\xba\x72\x03\xfe\x92\x08\xc8\x96\xc6\x4a\x4e\x6f\xe6\x14\x54\x57\x32\x6e\xeb\x44\xdb\xe7\xbb\x9e\x36\x21\x78\x6f\xd4\x56\x8c\x43\xe5\xb5\x62\x6a\x6e\xc0\x6d\xac\x9f\x27\x38\x9a\x2d\x73\xa3\xd7\x2a\xc1\xff\x86\x40\x6f\x8d\x60\x64\xd9\x0e\xd9\x74\xcf\x02\xfd\x42\x6a\x05\xc5\x74\x77\xbd\x55\xde\xba\xd9\x36\x87\x27\xed\x6f\x30\xa0\x55\x00\x58\xb6\x39\x24\x90\x67\x6e\xd5\xee\x5d\xe4\x13\x79\xb9\x0b\x8b\x9a\xc0\x94\x4e\x72\x70\xa8\xd0\x6e\x95\xef\x9d\x2a\x35\x7e\x28\xe5\xe3\xa6\x4d\x71\x75\x77\x04\xf4\xf5\x8b\xb2\x0a\x90\xc1\x17\xfd\xd2\x23\xf7\x73\xd2\x50\x05\x78\x79\x87\xf7\x09\xc3\xa1\xaf\x02\x46\x9d\x0f\x86\x96\xa1\x08\x49\x78\xc4\x38\xff\x15\x51\xc5\xae\x19\x5f\x26\x05\x8b\xb3\xad\x9f\x8a\x58\xee\x45\x4d\xbc\x58\x5e\x5d\x93\x9b\xd5\xf8\x08\x19\xbd\xac\xa5\xe7\x97\x3a\xb9\x92\x8a\x8a\x6b\x4a\x65\x25\x8b\xec\xac\xcd\xd7\x25\x34\xcd\xe6\x1b\x16\xd5\xa3\x2a\x11\x6f\xe6\x92\x04\x78\x41\x3b\xc1\x77\xdd\x4f\xf5\xd7\xc1\xad\xb2\xbf\x44\x55\x2d\x37\x5a\x28\x0d\x53\x0b\x71\x0e\x8e\x1c\x86\xf0\x55\xec\x72\x50\x8d\x69\x2e\x84\x82\x9a\x75\x74\x47\x8b\x8b\xb3\x32\x90\xc4\x8e\x76\x8b\x0f\xb2\xb7\x57\xcb\xbb\x85\x01\x16\x56\xd2\x3e\x3b\x88\x04\x7c\x51\xa1\x0c\x3d\x07\x1f\x65\x57\x87\xa0\xf8\x73\xd6\x6f\x7d\xfe\x5a\x75\xa7\x73\x19\x5a\xf0\xcc\xe6\xa7\xc0\xa9\x84\x49\x52\x7f\x1f\x4a\x99\xe1\x0c\xe4\xc5\xb4\xd7\x92\x6a\x91\xd6\x93\x12\xb7\x43\xd1\x30\xb0\xae\x53\x64\x20\x2b\x0f\x74\x77\xfb\xf9\x48\x2a\xb5\x95\x98\x86\xbc\x46\xb1\x7d\xd1\x48\x63\x55\xcd\xc2\x19\x7c\x48\x1c\xc1\x8d\x3d\xd5\xd8\xdd\xa9\x06\x38\x9e\xdc\xf2\xdb\x11\x1b\x63\x38\xb0\xb2\x93\x6b\x67\x47\x14\xbb\x75\x0d\x4b\x17\x77\x52\x7e\xb0\x8d\x3b\xc9\x59\xf1\x5c\x94\x64\xc3\x9f\xb6\x54\x3b\x31\xbc\xfc\x0d\x38\xc2\x6a\x62\x9d\x8b\xe5\xdc\x66\xf5\x7f\x4a\x0f\xaf\xf6\x99\xdc\xfe\xbd\x84\xb6\xdc\x6d\x61\x9c\xc7\x5b\xb8\xcd\xb2\x9a\x4d\x39\x9b\xfb\xac\xc8\x02\xd8\x30\x22\x50\x8c\x45\xae\x7f\xb2\xbd\xb1\x63\x3f\x11\xf5\xbb\x55\x92\x83\xe0\xb7\xc8\x96\x65\xb9\xdb\xc4\xe6\x96\x8b\xa2\xf4\x46\xdc\x20\xda\xfa\xba\x13\x6a\x9c\xca\x32\x79\xf8\xe6\x7f\x2c\x60\xd4\x22\xb5\x92\x8d\x74\xe1\x19\xc2\x37\xd5\xc6\xb3\x2b\xcb\xfc\xf2\xa6\x82\xd3\x81\xad\x0d\x04\xf1\x97\x0a\x63\x74\x3c\xd8\xda\x5d\xb9\x29\x41\x3f\xf7\x62\xc7\x36\xaf\x53\xd4\x4f\xee\xff\x22\xad\xe6\x49\x0e\x1a\xac\x5d\x9a\x6f\x79\x5d\xa3\x7b\x2b\xaa\x32\x8a\x60\x71\x70\xef\x24\x41\x67\x2f\x76\x18\x98\xba\xfb\xcf\x11\x7d\xac\x52\x6f\xee\xef\x14\x01\xdb\x29\x9a\x3b\x68\xf9\x46\xf6\xe1\xe8\x08\xf2\xaa\x8c\xba\xb5\xf2\xbc\x5d\x09\x23\x5b\x29\x6c\xab\x04\x39\xbc\xb3\xd7\xbc\x75\x60\xc0\xfe\x5a\x85\x7e\xba\x43\x7a\xf4\x76\x1b\xfb\x0e\x51\x6c\xd1\x00\xc5\xd8\xbf\x7a\xc0\xd5\xcd\xc9\x11\x32\x43\x66\x5d\xd3\xfb\x61\xe5\x17\x84\xe0\xc4\x45\x14\x60\x56\xbe\xb6\x16\xde\xf4\x64\x27\x6c\xe7\x05\x76\x13\x0c\xaf\x59\xd6\xce\x36\xf0\x2a\xc1\xc1\x6d\xda\xd1\x00\x34\x60\x8a\x4f\xaa\x4f\x15\xc7\xbb\xfb\xf4\x3c\x54\x46\x47\x11\xbd\xfd\x6e\xf5\xc6\x33\xbf\x8b\xf4\xd4\x31\xb2\x76\xc0\x2e\x7c\x40\xfc\xf9\x8d\x16\xb4\xb7\xa4\xf5\xa6\xc2\x24\x69\x41\xd8\x14\x2f\x2f\x38\x23\xd9\xb5\xc9\xb3\x61\x39\xa5\xf3\x2c\x84\x89\x16\xbb\x60\x16\xf9\xe0\x0c\x11\xb1\xbd\x27\x5e\x0f\x0b\x5d\xe3\xbd\x5a\x5f\xd3\xa4\x8a\x5c\xfd\x19\x2b\xbc\xbf\xb2\xb9\x09\x80\xc0\xb3\x1d\x23\xe0\x3b\xe7\x96\xcf\x23\x5c\x1a\xe6\xbe\xe8\x22\xdb\xd0\x2e\x5b\xbc\x9b\xb9\xcf\x60\xa8\x79\x55\xf9\x89\x30\xc7\xa1\x88\x44\x5c\x0f\x76\x96\x57\x65\x1f\xd8\x28\x72\x1a\x0b\x1a\x30\x1c\x0d\xe9\x50\x79\x2d\x47\x4a\x64\x5b\xab\x87\x6c\xef\x85\xcc\xe2\x5d\xe5\x9a\x4d\xaf\xaf\xe8\x3a\xb3\xcf\x0d\xf3\xc9\x10\x89\x0e\xcd\xde\x32\x0f\xaa\xcb\xbb\x10\x8b\x7e\x5a\xb6\x8f\x3a\xca\x03\xa9\x42\x13\x84\x3d\x99\x25\xf4\xa4\x7e\xf4\x18\x26\x0b\x63\xfd\xce\x0c\x00\xa2\x89\xce\x59\xf2\xa5\xad\xd3\x08\x78\x9f\x95\xb3\x62\x39\xc6\x13\xb4\xf8\x5d\x2e\x94\xd7\x1d\xb4\x63\xe5\x7a\x57\x59\xb9\x5f\x57\x92\x87\x7b\x98\xe2\x8e\x45\xfa\x18\x8f\xfa\xf6\xda\x5a\xa7\xcb\x38\x97\x73\xa4\x2a\xd4\x7b\x36\xb4\x72\xc7\xef\xc5\x57\xc7\xc8\xcf\xf8\x51\x76\x99\xf9\xd7\x8d\xae\x5c\x12\xc7\x96\x5b\x32\xa6\x96\x14\x9e\x24\xc1\x1d\xed\x57\x18\x55\x92\x8f\x9a\xd1\x9e\xcd\x1f\xd1\x2a\x70\xac\xb6\xbd\x3c\x6c\xd0\x33\xb5\x5f\xf2\xe1\x5d\x68\xda\x34\xb1\x25\xed\x5e\xf0\xfe\xd4\xb5\x2a\xb2\x08\xb2\x2e\x94\xd8\xfe\x00\x78\xf9\xf8\xd7\xf2\x9c\xf7\xa6\x59\xb4\x1d\x64\xbf\xf0\xee\x3e\x5a\xda\xbd\x62\xe4\x9e\xbe\x3d\x7b\x44\xdf\xda\x07\x81\x96\x64\x61\x08\x19\xdc\xa0\x9e\x69\x45\x7e\x02\x7b\x75\x7f\xea\x41\xe4\x07\xe6\xb0\x21\x77\x57\x8a\xe8\x45\xaf\x17\xb3\x10\x9c\x7e\x21\x6a\x32\x3e\xb1\x1e\x2a\xc0\x6b\xa8\xa2\xde\xc3\x21\xc0\x2b\x6d\xcc\x91\x2c\x44\x31\x14\xdf\x14\x21\xe4\x2a\xe7\x21\x11\x93\x7c\xf5\x97\xad\x34\xdf\xee\xca\xce\xe1\x4d\x16\xce\x30\x4b\xb8\x31\xcc\x48\xcb\xd4\xbd\x0b\x21\x80\x57\x78\x20\x23\xb2\x9c\x5d\x69\xec\x52\x36\xf2\x90\xcf\x1f\xb1\x1e\x6d\x8c\xad\xc8\xc7\x7e\xbe\xc5\x5d\x06\x9b\x4d\xb8\x40\x66\x66\xd3\xb4\x85\x1e\xb5\x67\xf1\x3f\xfc\x15\x92\x8d\xc3\x31\xb2\x07\x7c\x1f\x99\xe6\x3a\x5f\xb1\x96\xa8\xaa\x7f\xb7\x9e\x74\xb3\x71\xee\xdd\xb6\x82\xa2\xd4\x93\xbe\x8e\x18\xf8\xe1\x08\xbf\xcd\xb2\xbf\xa2\xc6\x9f\x18\xa5\xbe\xd6\x10\xae\x46\xa4\x8d\xed\x4c\xce\x08\x93\x82\xa3\x94\x28\x69\xb6\xa3\x63\x1a\x27\x0a\x17\x5f\x2a\xb0\x97\x10\x54\x31\x01\x09\x6c\x80\x0c\xff\xec\xd4\x74\xc7\x17\x15\xe6\x9a\x69\xa3\xea\xb7\x47\xc8\xc2\x47\x65\x7f\xcb\xe9\x87\xdd\x5d\xf3\x0e\x42\xe2\x1f\x47\xfb\x3f\x69\xec\xf6\x05\xa8\xa7\xda\x7d\xa2\x96\xad\xd8\x15\xb1\x90\x17\x25\x03\x2d\xf2\x20\x35\xc3\x2a\x86\xaf\xd9\x9d\xdf\xf2\x8d\xfe\x5b\x77\x7e\xa2\x51\x5e\xb7\xb9\x29\x64\x05\xd8\xe1\xba\x6e\x9d\xf5\x66\xa1\x7f\xce\xff\xa9\x8d\x3e\xef\xaa\xfe\x47\x25\xb7\x5a\xfd\xbf\xb5\xc0\xcf\xb7\xfa\xea\xbb\x2d\xe2\x5b\x30\xa0\x43\x1a\x02\x5f\x7f\x11\x49\xbb\xf2\xcd\x6c\xaa\xd7\x55\x4e\xff\x4d\x14\x0b\xd0\xbe\xd0\x34\xb3\x73\xa9\xb5\x0f\xa2\x0c\x2f\x91\xcf\x59\xdc\x99\x22\x88\xd0\x8a\x10\x98\x5f\x85\x26\x44\xa8\x41\x5d\xc4\xdc\xcd\x5d\x14\xf0\xfb\x33\x06\x36\x93\x88\xce\x9d\xd7\xca\x0e\xf8\xba\xa6\x96\x04\xb0\x36\xac\x40\x2e\xff\x3f\xbe\x08\x6a\x7b\x89\xab\xbb\xd6\x0b\xec\x90\x23\xca\x36\x12\xc8\xcf\x12\x07\x3b\x47\x8a\x0d\x7b\x1b\x8a\x5c\xcd\x99\xd4\xf6\x3f\xd1\x1f\xbf\xb8\x1b\x4c\x17\x59\xd6\xe0\x8b\x24\xea\x6d\x91\x66\xa6\x4a\x10\xaa\x41\xfa\x21\xf1\x9a\x6d\x05\x2d\x1a\xe4\x95\x09\xf7\x56\x7f\xea\x25\x57\x96\x56\x0a\x66\x4b\x02\x19\x70\xce\x2a\x8a\x25\x41\xd6\x1c\x1e\x14\x68\xc7\xf9\xc3\xd3\xa5\xbc\xd2\x49\x7c\xbf\x0f\xf7\xec\x1f\xa1\xfb\x1f\x10\xb5\xe9\x88\xf4\xd1\x67\xc4\x87\x70\x8f\x8d\xac\x3f\xa4\xb4\x2d\x32\x4e\xda\xc3\x87\x16\x38\xc0\x25\x39\x2f\x02\xe2\xf8\xfd\xbe\x83\xa8\xe1\xf6\x88\x81\x0d\xa0\x96\x92\x8f\x69\x92\x70\xd7\xca\x84\x7f\xac\x95\xf6\x26\xd2\x05\x43\xff\x6e\x99\xfa\x21\xe9\x4d\x08\xc7\x3f\x1e\x24\x5d\xf3\x96\xe0\x64\x59\x69\xef\xa1\xf4\x4c\xd1\x77\x33\xd4\x17\x53\x41\xfc\x0f\xcc\x24\x2c\xfc\x47\xa9\x75\xe1\x13\xf9\xe1\x88\xab\x06\x68\x7f\xf3\x16\x0c\x17\xe7\x69\xdb\xa7\x64\x57\xe0\x65\xaf\x56\x78\x4c\x5f\x41\x5b\xf5\xe6\xe7\xf6\x84\x02\xc6\x66\xd7\x3d\x78\xe9\x4e\xd0\x0e\x6a\xf7\x69\xb3\xed\x97\x94\xee\x1c\x26\x64\x18\x8a\x63\x73\x9f\x6e\x02\xe0\x0f\x28\x74\x7d\xbc\x35\xdb\xdf\x73\xe3\xee\x59\x11\x74\xff\xb1\xfb\x0f\x0f\x0e\x82\xe6\x37\x50\x7b\x3f\x6a\xf7\x78\x83\xc2\xc6\x9f\xf0\x46\x5b\x99\x9d\xe1\x0f\xa5\x0a\xd7\x7b\x16\xec\xa0\x49\x17\x28\x82\x68\xde\x34\x49\x6d\x1e\x40\xce\xc5\x16\xc3\x00\x7f\x84\xd7\x92\xfd\x54\x12\x41\x79\x23\xfe\xd7\xeb\xf2\x7e\x83\x0a\x65\x5b\xbd\xd5\x71\x87\x03\x6f\x74\xe4\xad\x12\x7c\xca\x17\x6a\x9a\x9f\x94\xaa\xda\xa8\x63\xf2\x85\x4d\x1f\x2f\xbd\x93\xa9\x6d\x14\x2f\xdb\x3a\x57\xbe\x65\x2b\x58\xb8\x01\xbe\x9a\x4f\x96\x9d\x9c\xcd\x0e\x29\x2b\x22\xc1\x76\xc6\x4f\x6e\x7c\x61\x9d\x1a\xd2\x15\xf0\x70\xb3\x3a\xe3\x6f\x69\x9d\xdc\x08\x69\xe3\x60\x83\x99\xff\xbf\x4d\x72\xff\xb8\x89\x76\x28\x57\x00\x51\x3e\x3e\xb5\x75\xb2\x4a\x3e\x3c\xb7\x5d\xfa\xcb\x81\x4b\xf7\x88\x53\xd0\xfe\xc8\x47\xdd\xcc\x52\xff\xba\xc5\xea\x16\x79\xea\xac\xe1\x7d\xa4\x44\xc8\x33\xf8\xa1\xee\xb6\xfa\x45\xf0\xaf\xff\x41\xef\xd4\x12\xf1\xff\x7a\xcc\xcc\x3a\x13\x36\xdf\x7e\x18\x74\x3f\xca\x64\x39\x1d\xb9\x11\x0b\x47\xba\x0f\xb1\xde\x0f\xb6\xd6\xc3\x7e\x75\x88\x86\xba\x2d\x34\xfe\x4a\xa9\x09\x2e\x20\x62\xc3\x3b\xb5\x53\x5e\xad\xa3\x03\xfd\x3e\x0a\x7d\x23\x38\xcf\x4d\x92\x58\xed\xc7\x5e\x1e\x29\xb4\x3d\xab\x7d\x89\x1a\x31\xe0\x44\x78\x34\x87\x6b\x9b\x06\xc9\xb5\x8e\x66\xe5\xe1\x60\xe3\x87\x23\xc9\xf9\x8e\xe8\x87\x1d\x53\x78\x93\x53\x04\xcc\x16\xfb\x89\x3e\x38\x6f\xc4\xe4\x36\x9e\x91\x44\x7b\x27\xf6\xc2\x3d\x88\x83\xda\x61\x58\x5d\x87\x4f\x97\xfd\xb1\xf0\x01\xe7\xa5\xcc\x83\x43\x21\xa6\x76\x6c\x64\x70\x2b\xfd\x3a\xf5\xd4\xd5\x6f\xb6\x25\xde\x49\x01\x58\x55\x57\x96\x20\x9e\x70\xcb\xed\xba\xff\x80\x6a\xa8\x07\x67\x86\x6a\x7b\xff\x80\xe5\x50\xb0\xc3\x22\x9a\x64\xe9\x04\x51\xec\x65\xa4\x2b\x15\x76\x74\xd7\xcc\xee\xfa\xed\x45\xe7\x0e\x7f\x00\xbc\xe2\x6e\x1f\xca\xdf\x3c\x6c\x68\xf5\x36\x76\x9b\x09\xfd\x41\x0a\xb7\xb0\x45\x67\x4e\x1c\x9c\x72\x47\xc7\x28\xd1\x92\x56\x3e\xd2\x5b\xb8\x28\x9d\x5a\xad\x21\x6e\x23\xad\xfc\x7d\x0a\x6f\x38\xe5\x13\x75\x26\x0d\xca\x19\x84\x2d\x44\xe4\xf6\xc2\x27\x06\x51\xcf\x7b\xba\xf6\x6e\x73\xcc\x22\x7c\x19\xfb\xc9\x3c\xa8\xd8\x06\x61\x2a\x05\x45\x32\x39\xdf\x33\x8c\xdc\xf9\x2c\x3b\x49\x92\x14\xc8\x54\x25\x6c\x50\xb5\x5f\xa1\x3b\x9e\xfb\x35\xe0\x0a\xd9\xca\xfa\xfc\xc4\x95\x7b\x6b\xf1\x3d\xb0\x9a\x0a\x94\xc2\xce\x04\x0d\xe0\x1b\xc4\xaf\x04\xf4\x62\x72\x71\xb7\x44\x4a\x25\x61\x8a\x70\x9e\xc2\x46\xb7\xf0\xe6\x06\x54\xf4\x44\x47\x30\xd0\x8b\x90\x59\x83\x4d\x8d\xb8\x3c\x9b\xad\x4b\x7a\xd5\x15\x12\x72\x1f\xcd\xa1\x4b\xda\x58\x11\xc3\xc0\x96\x6f\xd2\xc9\xe9\x3e\x68\x06\xb4\x98\x1a\xd8\xce\xcf\x2a\x4f\x1d\x7f\x50\xfe\x44\x81\x45\xd4\x2f\xa1\xe2\x19\x6d\xfc\x62\x1b\x4d\x06\x8d\xac\xb1\x9b\xf7\x81\xd0\x06\xf4\xc3\x28\x4b\x7e\xe9\x85\xf2\x4b\x09\x14\xbb\xca\xe2\x48\xc9\x5d\xf3\x44\x7c\x03\xcc\x3b\x01\x09\x7b\x7f\x17\x36\xe7\x37\xf2\xdd\xa5\xf7\x80\x46\xa4\xe8\x31\x92\xb1\x3d\xc0\x75\xff\x4b\x2d\xb8\x4d\x9e\x9c\xb6\xc2\xd6\x30\x87\xc2\xd9\x13\xa9\x15\x3c\xe3\x97\x36\x0f\x2c\x65\xd2\x71\x8c\x96\xbf\x6f\x9d\x96\xf9\xe5\xaf\xe7\x9d\xfe\x87\x62\x2d\xd8\xfb\xb7\x19\x77\xd4\x40\x77\x29\xc3\x68\x91\xdd\xca\xa2\x2d\xc6\x92\xc3\x82\x86\xe1\xc0\x1a\x1e\xad\xed\x1f\x46\x46\x08\x02\x24\x7f\xc0\x7e\xb6\x81\x14\x00\xff\xe9\xff\x40\x36\xc4\x07\xff\x2b\x92\xad\xfc\x15\x38\x7f\xd2\x57\xe0\x8f\x82\x51\x89\x03\xec\x84\xf0\x84\x08\x67\x03\x6c\x89\x1e\x57\xb6\xef\x09\xb9\xa5\x9d\xa6\x51\x0b\x4e\x35\xa8\x60\x53\x55\xbb\x60\xaa\xf3\x17\xd1\xe8\x3e\x1c\x43\x11\x7d\xee\x9f\x44\xa0\x43\x13\xbc\xa3\xcc\x8f\x80\x32\x3a\x35\xab\x27\xb1\x40\xa7\x79\xac\x56\xcf\x3c\xfe\x1f\xe3\xe3\xa2\xf7\x7f\x0e\xc2\x3a\x5a\x16\x1d\x35\xa7\x53\x76\x8d\x1c\xef\x43\xd6\x0e\x3b\xfa\xf6\x3c\xed\x63\xa7\xf4\xe1\xda\x69\x83\x4c\xcf\xab\xf7\x22\xab\xab\xfa\xf3\x03\x8e\x58\xba\x14\xd6\xab\xcc\xbb\x7d\x50\x69\xbd\x7e\x62\x90\x83\x26\x10\xaa\xb9\xb1\x7e\xbf\x4c\x3c\x6e\xa2\x1a\x68\xae\x43\xf1\x6c\xe7\x92\xe3\x0c\xe7\xfc\xcb\xe4\x10\xf4\x40\x5a\xd7\x58\xae\x80\x3e\xd6\x38\x0e\x5d\x50\xed\xd7\x3c\x48\xcb\x3a\xce\x67\xc4\xd6\x45\xea\x88\x53\x88\x88\x59\x84\xd3\x8c\x0d\x9e\xff\xb8\x60\x71\x47\x62\x57\x5f\x3c\xc3\x9b\x86\xb7\x46\x0f\x87\x3d\x6e\xc5\x72\x48\xa8\x09\x20\x84\x91\x79\xe9\x0c\xc9\xb5\x40\x62\x44\x77\xd0\x2c\xe6\x59\x6d\xd3\xe7\x80\x03\x2d\x30\x3d\xab\x43\xdf\xe5\xb3\x79\x81\xf9\x88\x98\x88\x55\x53\x6e\x7f\x08\x48\x84\x4b\xf9\xb3\xc4\xe3\x57\x77\x03\xb2\x03\x1b\x1b\xcf\xf9\x94\x58\x18\x9f\x64\x16\x0a\x02\xca\x16\x91\x4d\x67\x32\xd0\x97\x8b\x56\xc7\x1c\x49\x0a\x00\x67\x23\xbf\xc5\x36\x52\x04\x2a\x30\x37\x39\x06\x91\x0f\xd9\x54\x06\xcc\x11\x43\x87\x14\xb2\x70\x8c\xbc\xba\x77\x1e\x44\xf8\x3c\x81\xbc\xd1\x44\x0c\x27\x93\x24\x91\x27\xba\x15\xb5\x78\xf2\x21\x56\xa8\xa1\x1e\xa7\x32\xf8\xba\xfa\xbf\x2a\xaa\xbe\x95\x3f\x0f\x47\x3e\x56\xe1\x1e\xab\xb4\x6d\xc3\x1c\xdc\xc3\xa1\x61\x33\x43\xde\x96\x46\xd1\x7f\x38\x95\xe1\xd7\xd7\xec\xbf\xe9\x60\xd9\x8d\xad\x61\xf0\x0a\x48\x5a\x04\x26\x51\x4e\x0d\x74\x57\x68\xf8\x7b\x49\xbf\xfa\xb0\x9a\xb1\xc1\x44\x62\x39\x7c\x92\xb8\xb4\x79\x02\xb5\x4a\xfd\x72\x45\x38\xf5\x45\xf4\xbb\xf7\x1d\x9d\xa0\x8c\x60\xf1\xa3\xcc\x8c\xf8\xe9\x00\x09\xd6\x16\x6a\xd7\xd3\x8c\x2c\xfe\x48\x6a\x70\xda\x76\x95\x90\x7f\x0f\x0b\x11\x49\xb1\x53\x1d\xa6\x33\xe8\xfb\x91\x06\x22\xa2\x4c\xcf\x2e\xe4\xc3\x39\x0a\xa2\x9e\xc0\x6f\x63\x09\xbe\x02\x5f\x36\x6d\x47\xb4\x5b\x9d\x8f\x10\x8d\x7b\xe7\x24\x88\xb1\x91\x86\x12\x1c\xde\xae\xde\x4b\x48\xed\x10\xdc\x1d\x18\x85\x24\xcd\xf5\x6c\x36\x5f\x7b\x0b\x9c\x46\x2f\x8f\xe9\x1c\xd0\x65\x07\xbb\xa0\x84\x11\x57\xb6\xd5\xcc\x6b\xfc\x33\xac\x89\xcb\xa7\x59\x1d\x93\xfa\x50\xf6\xb2\x11\x3f\xa0\x79\x3f\x58\x05\xca\x72\xed\xd6\x1f\xaa\x61\x97\x46\x33\xe5\x02\xbe\x12\x3e\xcc\x4e\xa9\x22\xbd\x7e\xbf\x57\xf6\xfc\x27\x08\x08\x78\x9b\xe2\x80\xbb\x3c\x10\xc8\x01\xa3\xfe\x2e\xa4\xd9\x5b\xa5\x15\x41\x80\x1f\x2a\x0b\x51\xc2\xab\x17\x89\x21\x22\x39\x84\x0f\x84\x1f\x6a\xe7\x73\x81\xd8\x04\xa1\x3e\x48\x10\xa7\x8b\xb4\x0a\x7c\x81\x2e\x9a\x9d\x8a\x41\xbb\x6f\x24\xc3\x40\x0a\x0a\x9b\x7e\x25\x4a\xb2\x0d\xba\x84\xe8\x20\xe8\x0f\x61\xeb\x75\xe3\x56\x1f\xa1\x22\xa0\xb7\x17\x4b\x5b\x1c\xc7\x2a\x06\x7f\x38\x31\xab\xc7\x9b\xce\xf9\xeb\xdd\x1f\x8c\x77\x61\x0e\x1b\xd5\xd8\xb8\x1d\xc7\xf5\x98\x64\x06\xf6\x0b\xbd\x4e\xda\xbc\x7d\xeb\x91\x78\xfc\x99\xe6\x7c\xb3\x38\x5b\x5f\xf7\x3b\xfc\xfa\x68\x3a\xd3\xb0\xcf\xa4\x2c\x08\xea\x01\x61\xc1\x9f\x6c\xb5\x08\xbf\x32\xb7\x4b\xc7\x33\x3f\xff\x5e\xad\x9f\xd0\xef\xd8\x4c\x22\x9a\x42\x0b\xff\xb1\xd1\xb3\x21\x07\x25\xeb\x53\xbd\xad\x36\x22\xf7\x5f\xd0\xe7\x1b\x3c\x2a\xdd\x85\x47\x0b\xdd\x70\x2f\x39\x0e\x02\xd9\xf8\xc7\xf3\xf8\x1d\x72\x47\x04\x19\x2e\x91\xcf\xfd\xf9\x05\x7f\xdb\x5b\xd0\xde\xcc\x8a\x61\x5d\x46\x28\x8b\x19\x92\xf8\x2a\x5e\x97\xbd\x8a\x9f\xdf\xaf\x39\xd2\xb7\x6d\x0b\x7c\xce\xc1\x3e\x70\x37\x97\x87\x67\xb3\x10\x98\x48\x7a\xc7\xaf\x14\x6e\x3f\xb0\x2d\x4c\x91\xed\x43\xdd\x38\x99\x9b\xed\xcf\x7f\x7c\xc3\x7a\x49\x03\xdc\x27\xda\x5f\xd1\xe3\x52\x06\x0a\x6b\xef\x8f\x4e\xd4\xdb\xbe\x06\xa5\x7c\xbf\x43\xc3\x72\x57\x47\xf3\x65\xff\x05\x1c\xd9\x77\x5f\x77\xed\x42\x74\x1e\x95\x1e\x48\x07\xd5\x8f\xb6\x30\x55\x2a\x0b\xea\xa5\xf0\x16\xb7\x36\xe0\x72\x75\xc7\xe4\x7a\x13\x2b\x84\xd2\xc0\x0f\x2c\x3b\xee\x19\x79\x47\xfe\x3f\x62\x47\x77\xcf\x61\x5c\x1d\xc1\x59\x7e\xa2\xdf\xf3\x20\x42\xfd\x9d\x1d\xd6\xbb\x1b\x29\xfa\x4e\x7d\x64\xc5\x34\xd4\xa2\xca\x77\xab\xf1\x9a\xa8\x4a\x0f\xa9\xb9\xfd\x41\x6a\xc4\x19\xa1\x53\x1e\x1f\x37\x34\xd0\xc3\x6a\x54\xc5\xc7\x74\x0d\xf9\x90\x33\x75\xfa\x34\xb6\x44\xdc\x97\xc2\xca\xec\x28\x3b\xb6\x42\xe4\x41\x94\x96\x58\x0e\xf4\x23\xb0\x8f\x71\x17\x2d\xc3\xd3\xcb\x15\x23\xb9\x27\xea\xd7\x05\xf7\x5b\x41\xfa\x86\xd5\xb9\xa2\xcb\x59\x50\x82\xd3\xb0\x54\x29\x06\xa8\xa3\xb7\x85\x87\xf7\xa4\xb0\x32\xb0\xe1\x34\x33\x91\xdc\xfd\x74\xaf\xdc\xe4\xef\xe8\x5b\xed\x31\x08\x9d\xc0\xb9\x0a\x21\x89\x33\xda\x71\x91\x55\x68\x48\x95\x0b\xf4\xdc\xc8\x0e\x73\xc3\x46\xf8\x9e\xd2\xfb\x16\x74\xc8\x9c\x19\x8d\x88\xb5\xd8\x17\x1a\xa4\x70\x37\x42\x13\x32\x22\x71\x45\x4a\xe1\xa0\x70\x7e\x22\x5a\x06\xf4\x40\x07\x1e\x6a\xec\xed\xce\x3a\xec\x2d\x90\x86\x5a\x1a\xb0\xe7\x98\x4a\xf3\x56\xa8\xe4\x05\xbd\xe8\x83\xc0\x08\x09\x0f\xe2\xf2\x9f\xc1\x9c\x05\x93\xed\xd2\xd1\x9f\x33\x15\xee\xd6\x90\x97\xae\xbe\x10\x62\x07\x57\x0d\x1a\x25\xdc\xb6\x4a\x91\x49\xd3\x31\x5c\xf0\x4c\x61\xb7\x06\x8b\x7a\xce\x9b\x20\xfe\x3e\x18\x51\xf3\x70\x8c\x84\xd5\xdc\xff\xea\x4f\x1f\x0e\xbe\x84\xcc\xc4\xa1\x89\x9f\x76\xdf\x1a\x1e\xa7\x78\x12\x25\xd2\x15\x6c\x34\x9c\x61\x90\x06\xed\xb6\x72\x51\xec\x8f\x49\xb4\x02\x70\x28\xd8\x15\x3d\xca\x7c\xe9\xaa\x3b\xa0\x20\xe6\xac\x75\xac\xe5\x0e\xbf\xb4\x9b\x93\xf4\x41\xa1\x27\x60\x15\x09\xee\xe7\xbc\x44\xc6\x20\x24\x32\xfc\xdf\x4f\xda\xb5\x81\xa6\xce\x78\xf8\x7c\x37\x19\xea\x91\x01\x10\xea\x19\xc1\x19\x02\xef\x67\x2f\x2f\x11\x3a\x60\xb7\x49\xda\xc5\xdd\x74\x0e\x56\x4b\x93\xb7\x76\xa0\x2f\xc8\x27\xb9\x62\x4c\x9a\x85\x88\x00\x3c\xf8\xe3\x1e\xf4\x1d\x28\x81\xf9\x96\x30\xbd\x16\x48\xb5\x97\xb4\x88\x67\xe1\x97\x8a\xa7\x5e\x16\xef\xc5\xfb\xd0\x2f\xa4\x3d\xbf\xc9\x82\x74\x7d\x1d\x5e\x66\x67\x07\xce\xc3\xe1\x14\xe3\xb3\x10\x6e\xdc\x7f\x96\xe4\x36\xc1\xa8\x0a\x00\xd8\x31\x86\xbd\x9a\xa4\x1e\x50\x1a\x44\x4e\xcf\x3a\xdf\x0a\xea\x99\x04\x19\x30\xc6\x9b\x50\x07\x00\x0b\x9d\xda\x9b\x82\xf7\x40\xa5\xe0\x0d\xfd\x86\xb4\x78\x99\x9d\x8d\xb2\x15\xc3\xc8\x63\x7d\x42\x4c\x70\x36\x61\x41\x1f\x57\x26\xac\xb1\xcf\x57\x8b\xdd\x41\xdf\x88\x43\xd1\x13\x9d\x84\x41\xcb\xb3\xbb\x8a\x8b\x81\x73\x27\xa8\x54\x5b\x72\x84\x3d\x89\x9e\xd1\xe8\x15\x0d\x52\xa1\xfa\x6f\x6b\x3c\x8f\x24\xad\xcb\xd6\xfc\xe8\x20\xb1\xe1\xbf\x8a\x83\x1c\xd3\xec\xf4\xe1\x03\x86\x53\x20\x49\x6f\x53\x18\xa1\xf0\x4d\x54\xd9\x0d\x00\xf0\xad\x30\xfa\x1a\x70\x47\xff\xfd\x84\xae\xbe\xf6\x0a\xb1\xef\x1b\x36\x87\x9e\x8f\xdf\xe6\xde\x06\x1c\xc1\x36\x7a\x27\x31\x63\x22\xdd\x43\x70\xe8\x3a\x1f\x8c\x96\x58\xff\xf5\x10\xf5\xac\x4e\xa9\x28\xd6\xb9\xb9\x91\xe0\xb2\x74\x16\x85\xed\x43\x9d\x4c\xb3\x66\x27\xe7\xc3\xc2\x9b\xcf\xcb\x49\x09\xf5\x8a\x47\x5e\xd3\x5b\x72\x7f\xdb\x3a\x0f\x0a\x0d\x58\x53\x73\xa6\x5f\x93\xbc\x61\x16\x5b\x80\xc5\xb0\x20\xf1\x02\x2d\x73\x6e\x73\x96\xd3\xe5\x42\x91\xe8\x99\xbb\xab\x0b\x76\x85\xb2\x5c\x96\x5d\x11\x46\x80\x3e\x3c\x46\x48\xcd\xf4\xc5\xed\x08\x7c\x90\xc0\xd6\x14\xfc\x71\xcb\xdb\x1c\x34\x0b\x8f\x86\x16\x3c\xb2\x04\x4e\x32\x9e\x22\x5f\x34\x8f\x3f\x30\xf0\x5b\x1e\x91\x13\x30\x7c\xff\xbb\xc0\xc7\xe3\x01\x94\x03\xe8\xb4\xfa\x27\x7f\xfa\x2c\x7f\xe1\xa8\xf3\x57\x09\x1f\xc0\x32\x80\x3b\x0a\x44\x98\x33\x78\x88\x9a\x6f\x0c\xe7\x77\x5c\x53\x8d\x20\xe5\xaa\x0b\x3f\xd2\x43\x8e\xd6\x23\xd3\x87\x66\x6b\x7c\x67\x13\x73\xa7\xe0\x1a\x17\x4e\x03\xcf\x27\x18\xb3\xc1\xf4\x90\x6a\x6d\xaa\x91\x0c\x6a\xfb\x11\x62\x23\x4a\x04\x06\x1b\xef\xe2\x31\x52\xca\x6d\xa8\xe0\xd1\x71\xe4\x66\xdc\xd6\xb3\x44\xd5\xfc\x44\x9f\xfe\x49\x7a\x4c\x78\x0c\x34\x42\x07\x8c\x33\x9a\xa5\xdc\x6c\x55\xf1\xdc\xa0\x91\x5b\xc6\xf5\xc4\x49\x98\x97\x04\x79\x2d\xc9\x1c\xf5\xb8\x9b\x92\x62\x9c\xe4\x3e\x70\x87\xa0\x42\x0e\x05\xe9\x6c\x16\x02\xdb\x26\xd0\xc7\xb6\xdb\xbc\x65\x0d\x75\xd8\x44\xf1\xd1\x94\xc6\x86\xc1\x8c\xf1\x0e\xc7\xea\xad\xe3\x8b\x43\x30\x16\x9d\x97\x51\xd1\x98\x50\x4e\x12\x62\x97\x4a\x0c\x22\x59\xa9\xf0\x42\x02\x38\x22\x37\x02\x9d\x71\x23\x29\x4d\x0c\x2c\xbd\x62\x24\x02\x88\x14\xe8\x23\x5c\x27\x08\x77\xd4\x16\xc0\xe4\x66\x8b\x1c\xc2\x35\x4a\x8c\x8f\x96\x5d\xfe\xb4\x3d\x3e\x1d\xdf\xea\x3f\xe5\xc3\xb3\xca\x12\x1c\xbe\x88\x72\x16\x80\x09\x51\x34\xad\x9e\x72\x84\x79\xb6\xc0\x0a\x1b\x31\xcd\xea\x69\x57\x3e\xd9\x1f\x79\x8b\x52\xeb\x39\x13\xd0\xb6\x6d\x03\xe5\x17\x11\xde\xb4\x08\xd6\xb0\x4f\xab\xcc\xba\x67\x3a\x27\x17\x1b\x3d\x13\x82\x0a\xe5\x21\xf8\x4c\x23\x03\x4c\x79\xf9\xe7\xff\x56\x96\x61\xf6\x2f\x7c\xc2\x40\xfd\xe4\xd4\x0f\x59\x45\x35\x35\x0d\x1c\xc6\x15\x12\x31\xd4\x5d\x9b\x54\xa0\x16\xb3\xb4\x42\x36\x9e\x45\x79\x1c\xce\x14\xde\x71\x68\x58\x1d\xe2\x60\x94\xda\x45\x26\xf0\xa0\x7d\xc9\x10\xfa\x3c\xbb\xa4\x83\xe4\x31\xc5\x52\x3c\xcc\x17\xb1\x8e\x19\x69\xb4\x64\x73\xc0\xa6\x86\xb7\x49\xcf\x31\x5b\xed\x2b\x0f\x39\x94\x48\x3e\xb8\xd4\xd0\x47\x36\x6a\x9e\x48\xfa\x08\x83\x8d\x21\xcb\xe1\x78\xc8\xca\xd9\x82\xb5\x9c\x40\x15\x9f\xe6\x42\x82\xeb\xd1\xd7\xdc\xf5\xc1\x90\x9c\xe7\xd5\x90\x18\x95\x00\x96\x93\x64\x5e\x7d\x5d\xc3\x49\xfc\xac\xdf\x16\x9c\x3a\x78\x37\x1b\xb4\xb4\x66\x3c\x8e\x19\x95\x0b\xd3\x2f\x12\x00\xf9\x4f\xc4\x4b\xa2\x7b\x49\xaa\x87\x0f\xca\x1a\x13\xb9\x2d\x06\x81\xc8\xec\xa2\x5f\x00\xe6\x5f\x67\xf6\x98\xfa\xe2\x79\xd4\x64\x85\x74\x81\x79\xb8\xdf\x8d\xca\x9f\x1e\x93\x81\x84\x3f\xbd\x15\xf6\x76\x62\x8e\x14\x74\x4c\xe5\x6f\x17\xf3\x13\x7b\xe0\x30\x32\x00\xe5\x43\x9c\x15\xef\x23\x89\xe8\x91\x42\xd3\x71\xe9\x93\xda\x2a\xf6\xe6\xb1\x0b\x87\x84\xd4\xa5\xbf\x44\x11\xc8\xda\x83\x00\xe5\xc3\x99\x0a\x0e\xd1\x9b\x20\xa0\x22\xdf\xe3\x6c\xa2\xe7\xae\xee\x71\x54\x76\x49\x57\x83\x2d\xe1\x31\x53\xe1\x6b\x17\x1e\xe9\xb2\xa6\x9b\xe5\x92\x8e\x5e\x77\xcf\x91\xbe\x02\x7f\xe9\xe6\x7b\x2e\xf3\x70\xdb\xbf\x92\xdd\xd5\x95\x4f\xab\x03\xbb\x72\xd2\xf6\xa1\x2b\x41\xde\x98\x0a\x43\x7f\x9c\xb2\xc1\xdb\x60\x46\x42\xdf\xb7\x02\x6c\x47\xaf\xac\xb5\xcb\xf5\x1d\xa2\x48\x75\xb3\x14\xe9\x1d\x2d\x9b\xba\x68\x58\x38\x83\x51\x4e\x4b\x18\x87\xd3\x81\x48\x1c\xa4\x5d\x76\x9c\xd0\xe0\x6e\xa7\xf8\x0b\x1b\x86\x19\x7b\x68\xa2\x6c\xe0\xc8\x26\x86\xe9\x0b\xe2\x06\x9d\xe9\x3e\x52\x6c\x04\x0a\x65\x33\x97\xac\xea\xa4\xd3\x45\xcb\x43\x47\x3e\x63\x95\x60\xc6\x66\x91\x10\xda\x80\x72\x21\x92\x8d\xed\xf6\x57\x40\x24\x7c\x87\xf6\x11\xe5\xe4\x8b\xcb\xc6\x31\x8f\x54\xc9\xa1\x04\x17\x36\x3a\x3c\x49\xf8\xbb\x5d\x2e\xf1\xce\x52\x30\x60\xd3\x26\xf0\x5c\x7e\x09\xb4\x4b\xb8\x9b\x3d\x82\xd0\x63\x3a\xb1\xcf\x31\x12\xfc\x33\xff\x84\x65\x0c\xcd\xf2\x0d\x2c\x8c\xd8\x39\x69\x20\x52\x16\xc6\x23\x17\x45\x24\xce\xab\xfe\xb2\x8c\xfb\xa6\x53\x4b\xd6\x97\xee\x35\x5f\xa4\x1e\xda\xa7\x74\x4e\x48\x99\x88\xd0\xe0\xcb\x98\xe8\x66\x07\xb8\x46\xc0\x4c\xc8\xc3\x3e\x89\x0e\xdd\x36\xd7\x28\x48\x6b\xfe\x4f\xc0\x4b\x33\x58\x87\x09\xb9\x23\x24\xd3\x7c\x5f\xac\xcb\xdf\x50\xbf\xbf\x1b\x9e\x92\x3f\x22\x29\xbf\x43\x1b\x82\x8d\x8a\xc3\x3c\x24\x18\xc4\xb9\xfe\x76\x87\x8f\x9f\x53\x7c\x5a\x4f\xd2\xc8\x6d\x24\x7d\x82\xfb\xb9\x3b\x49\x04\x96\x0d\x2e\xed\x98\xed\x4b\xdf\x89\xc5\x90\x54\xf5\xca\xa7\x7c\x19\xf6\xfc\x0d\xce\x48\x8e\x44\x8c\x17\xca\xdb\xf3\x21\xcf\x3e\x5f\x13\xdd\xa5\x21\xfc\xda\x0b\x51\x03\xff\xc3\x73\x61\x32\x87\x83\xa4\x24\x75\x3a\xa5\x18\xd9\x83\xbb\x51\xd1\x68\x70\x27\x05\xb0\xfc\x68\xd6\x87\x95\x4e\x4c\x0d\x5b\x1f\xe4\xa0\x7f\x97\x8f\x00\x13\x3d\xb3\x30\x07\xa7\xb4\xb1\x3f\x0a\x00\x0a\xf1\x91\xdd\x56\x5c\xbf\xa2\x6e\x42\x41\xb7\xbd\x21\xdf\x79\x61\xb7\xf2\x43\x75\x26\x38\xf3\x73\x20\xaf\x91\x7b\x4a\xcb\xe2\x08\xf9\x1d\x67\xf9\x1d\x62\x52\x0f\xee\xba\x82\x22\x92\xee\xe6\xd5\x87\xac\x84\x16\xaa\x4b\x74\xe0\x9e\x7f\x7e\x80\x77\x6e\x26\x0a\x07\x65\x62\x82\x3e\x28\x00\xa1\x07\xa6\x9d\xec\x52\x60\xac\x3f\x37\x83\x59\x9f\xf7\x9a\x18\xb3\x49\x71\xc7\x97\xa3\x3b\x54\x1e\x27\x71\x24\x20\x21\x4d\xd6\x21\xa3\xa6\xcb\x79\x1b\xf2\x53\x78\x7b\x69\x84\x70\x04\x17\xc4\xf9\xfb\x0d\x4f\xee\x2b\x8f\x61\xfe\x03\xda\xc8\x4c\xb0\x63\xf6\xd4\x3f\xb7\x5e\x00\x14\x72\xde\xdf\xa5\x1c\xcf\xf8\xb3\x6b\xa2\x8f\x60\x91\x04\xf7\xdc\x83\xa6\xfa\xc0\x50\x9c\x69\x34\xc7\x58\x3e\xb1\x8e\x9f\xfc\x02\xb5\xde\x7a\xad\xdc\xc7\x2b\xa4\xf3\x88\xf0\xb0\xfe\x67\x5c\x76\xa5\x7a\xff\x8c\xe6\xe3\x01\x88\x8d\x7a\x50\x3f\xe2\xcb\x8d\x82\x32\xce\x4f\x80\x58\xe7\xa7\x13\xd9\x64\x0a\xbd\x47\x75\xc1\x98\xad\xc0\x11\x80\x85\x5d\x33\x9f\xcd\xb5\xcd\xa1\x94\xc0\xfe\xc1\x3d\x16\xf6\xe1\x7a\x08\x7f\xdc\xac\x36\xae\x0b\x4e\xa8\x3c\xd9\x84\xb9\x88\x2d\x03\xe2\x74\xc4\x00\xcf\x5d\x27\x44\xe5\x23\x07\x74\x6c\xf1\xfc\xe0\x93\x0a\xd0\x71\xe2\x27\x61\x3e\x7f\xed\x74\xf5\x3f\xd3\x71\xe8\x19\xe2\x45\x40\x09\x01\xc9\x0e\x45\x23\x75\x65\x2b\xea\xf0\x40\x61\x79\x08\xc6\xbf\x3b\xca\x87\x0d\x9c\x63\x85\x0a\x49\x00\xc8\x37\x06\xf7\x15\xd4\x12\x7d\xaf\x87\x07\x9f\xbe\x35\x52\x34\xca\x81\x74\xab\x9d\xd6\x0c\xe4\x00\x20\x3a\x8e\x20\x05\x61\xd9\x83\x6c\xa8\x03\xdc\x7d\x62\x17\x6f\x38\x86\xf4\xb4\x12\xbc\x99\x5e\x79\x44\x5f\xf0\x08\x56\x3b\xaa\x54\x45\x56\x01\x09\x19\x32\x1f\x4f\x40\xc7\xce\x9a\x27\xdb\x57\x3a\xd9\x4b\xe4\x67\x94\x0b\x76\xd9\xb4\x71\x68\x8a\x15\xe7\x8a\x15\xed\x19\xe1\x37\xcf\x23\x39\x4a\x85\x45\xe7\x2f\x96\x19\x16\x0f\x59\x83\xa8\x00\xcb\x60\x5f\xd1\x03\xe8\x89\xed\x74\x3d\xd6\x6b\xcf\x21\x00\xdf\xf3\xd6\xc9\x48\x68\xcf\xba\x54\x76\xce\xc3\x0e\xb3\x20\x03\x59\x64\x8e\x1f\x47\xa3\x12\x4b\xa9\x22\x47\x54\x72\x05\xb6\xca\x2d\x03\x8e\x7e\xf8\x93\x2d\x61\x65\x3b\x77\xb3\xad\x8b\x4c\xee\x4f\xd5\xcd\x5b\x09\x34\x06\x18\x3e\x29\x23\x21\x82\xc9\xf7\x97\xa4\xa0\x8d\x73\xde\x16\xa6\x7c\x5b\x26\xc0\xb7\xf5\x98\xba\x88\xad\x20\x8d\x3d\xc7\x48\xc9\xc6\x87\xad\x3b\x62\x8f\x6d\xfd\x12\x70\xd6\xd6\xcf\xb1\x8e\x80\x2e\x22\x6c\x06\xfb\x60\x3e\xb0\xaf\x7a\x49\xec\x20\x6f\xc1\x24\xff\x71\xf7\xe4\x36\x85\x4a\x29\x0b\x9f\xaa\x0d\x54\x61\xd9\x29\x02\x28\xe7\x6d\xbb\x98\x70\x8e\x9f\xd0\xdd\xe1\x8f\x16\x8e\x49\x55\xcc\x96\x26\x49\x7c\xd2\x70\x36\x64\x85\x64\x93\xb0\xbb\xc2\xc8\x21\x88\x8f\xae\xe6\xd5\xa7\x09\x51\x3e\xea\x21\x03\x1c\x9c\x2a\x2c\xd4\x57\x04\xab\x8a\x40\xba\x16\xd5\xf1\xa0\x94\xa8\x66\x59\x21\x54\x23\xf4\xf1\xca\x6c\xb9\xae\x4e\x7a\xd7\x3a\xb1\x46\x63\x77\xf5\xf4\x5a\x55\xa4\x6b\x7a\x87\x85\xc3\x5b\x86\xf9\x38\xf5\xe9\xf9\x40\x66\xd5\x9a\x84\xf1\x2d\x75\x3d\x88\x90\x34\x5e\x99\x0d\x19\xae\x5c\xbb\x72\x6b\x40\x41\xdc\x62\x1f\x58\xa0\x89\x7f\x72\x3b\x2c\xa1\xb2\x5c\x30\x71\xdf\xbc\x95\x4c\x75\x7b\x41\x2b\x20\xf4\x9a\x7b\xe9\xb4\xca\x2e\x6b\xb9\xda\x97\xa2\x3f\x7c\x04\xf5\x23\x11\x94\x53\xb0\xca\xec\x22\xd2\x36\x64\x22\x32\xf8\x18\x89\x5e\x12\x9e\x88\x4c\x22\xc9\x15\x9c\x91\xdc\x52\xd1\x04\xe9\x2d\x42\xd4\x17\x24\xbc\x11\xd0\x49\x41\x19\x58\x68\x60\xfd\x67\x9b\x81\xe2\xfb\xc4\x3f\x77\xe1\xf9\x10\x3b\x41\x76\x9e\xbb\x2d\x12\xdc\x06\x6e\xe2\xc7\x93\x7d\xfb\xf9\x29\x90\xa0\x48\x24\x37\x45\x1e\xf7\x84\x84\x0a\x62\x1e\x87\xe8\x18\x65\x09\xe2\xc0\xc4\xc0\x96\xa9\xf4\x55\xae\x8b\x58\x57\xfc\x9e\x99\xea\x52\xf8\xeb\x3b\x47\x64\x56\xf6\xec\xa4\xe0\x3e\x9b\x09\x1d\x82\xc4\xfa\xe5\x07\x51\x4e\x7a\xf9\x4d\x04\xe9\x5a\x5a\x19\x7f\xad\xbc\x21\xf2\x2c\x11\x11\x59\x45\x39\x04\x94\x12\x28\x09\x69\xa7\x53\x23\xf2\xda\x0a\x1d\x2e\x37\x36\xd1\xa0\xa2\x66\x94\xa3\xfd\x41\xcc\x60\x0a\xf0\x11\x83\xf4\xc3\x4c\x66\x21\x25\x37\xd1\x1a\xdb\x83\xea\x3e\x8f\x4d\x9b\x29\x4d\x76\xaa\x83\x98\x24\x08\x90\x72\xbc\x02\x6b\x5c\x2f\x32\x39\xf4\x35\xbb\x1f\x67\x39\x74\x3b\x54\x12\x71\x6c\xae\x83\xa4\x9b\x63\x15\x9a\x84\xeb\xc7\x6a\x10\x6e\x56\x88\xa1\x34\xef\xdd\xb1\x9d\x5f\x23\x75\xe6\x1c\xa9\x3f\x8b\x91\x2a\x95\x91\x44\xfe\xd1\xc5\x98\xfe\x46\x5d\xd1\x22\x8a\x89\x42\x83\x46\x78\x1d\xf9\xc3\x84\x19\x8c\xe9\xa5\xa3\xcd\xad\xc2\x5b\xee\x40\x75\x30\xe7\xf8\x86\x1f\xb6\xfe\x95\x9f\xf9\xa9\x28\x2c\x87\x58\x78\x43\x56\x26\xf9\x13\x32\x1f\xd9\xe7\xaf\x0a\xee\x79\x3a\x04\x1d\x1b\xb1\xa7\x00\x25\x17\xd3\xf8\x94\xfe\x54\xfe\x01\x8e\x61\xdc\x3f\x23\x1d\x3a\x18\x26\xb2\xff\x47\x33\xac\x38\xb7\xa5\xd9\x95\x3c\x73\x8b\xd0\x6e\xee\x02\x4f\x2f\x72\x1e\x61\x10\x39\x3b\x82\x22\xc5\x2a\xa6\x9d\x95\x34\xff\x2c\x52\xb9\xfb\x60\xc4\x97\xe4\xad\x7a\xed\x73\xb2\xd5\x00\xab\xf8\x21\x3b\xe1\x14\x85\xb8\x85\x2f\x34\x01\x10\xbf\x2b\x87\xec\x13\x62\x97\x41\x31\xa3\x2e\x78\x79\x08\x15\xe1\x9d\x3b\x93\xdd\x80\x8e\x3b\x98\x62\xef\x82\xd9\xae\xfe\x07\xb2\x30\x74\x5e\x0d\x39\xeb\x46\xe1\x42\x43\x72\xdb\xec\x21\x55\xf4\xcc\x09\x84\x0c\x34\x2c\x19\x92\x9c\xe4\x06\x57\xb3\xea\xfd\x5b\x11\xd9\xd1\xe9\xe2\x0c\x90\xbb\xaf\x6b\x40\x23\x55\x19\x9b\x80\x4b\x42\x3c\x53\xae\x8b\x26\x8f\x67\xf8\xca\x23\xd3\x88\x62\x9b\x33\x49\x1b\xf3\x09\xcc\x64\x97\x7f\x46\x59\x0f\xb1\x73\x01\xef\x50\x1e\x33\xfb\xe7\xec\x7d\x1f\x1e\xe9\xd9\xf9\x07\x86\x20\x86\x97\x8f\xb0\x69\x48\x3a\x99\x59\xec\x1a\xcf\xcb\x0e\xaa\x4a\x3e\x68\xfa\xde\x5b\xe5\x2d\xbf\x0b\xaf\x88\x4e\x72\x4d\x02\x06\xed\x93\x6d\xef\xbd\x80\xb4\x55\xe5\x67\x87\xb1\xca\xdf\x02\x89\xdb\x42\x6d\x12\x26\x78\x09\x64\xee\x48\x9a\x5b\xd7\x66\x40\x39\x06\x00\x63\x97\x88\x2f\x94\x48\x07\xd8\xb9\x6f\x80\x50\x26\x78\x26\x67\xb0\x4c\x58\x90\x75\x75\xf8\xb6\xf2\xbd\x62\x26\x93\xc9\x7f\xa8\x38\xce\x10\x61\x01\x4b\x19\x9b\x2c\x0f\x39\x73\xdf\x96\x2f\xc7\xff\x02\xae\xf3\xac\x9b\xe6\x4d\x82\x9c\x53\x3e\x7f\x6e\x4b\xd9\xd8\x2c\x41\xc4\x74\x1f\x8d\xdf\x59\xec\x84\xbd\x30\xac\x8c\x08\xf7\xae\x7c\x86\xcb\x0a\x46\x1f\x12\x3d\xeb\x90\x97\x4e\x41\x8c\xf0\x09\xbb\x7a\x9b\x94\xe6\x1c\xf4\xde\x6d\xdb\xf7\x4c\x64\x81\x76\x21\x4a\x77\xab\xca\x48\x14\x08\xca\xac\x2d\x8e\x65\xb8\xfc\x44\xe9\xfe\xc2\x5d\x72\x86\xe9\xb0\x0f\x7a\xb5\x08\x7d\x44\xe9\x51\xfe\x39\x4b\x9e\x12\xe9\x3b\xb3\x97\xb8\xcd\xfe\x0d\x00\x66\x8d\xd0\xf9\x2e\xcf\xa7\x32\xeb\xf0\x22\xfe\x72\xb9\xa3\x54\xc1\x29\x32\x22\xcb\xd8\x45\xe4\xaf\x61\xd3\x57\x43\x62\xb2\xe2\xc6\xcf\x3e\x8b\x1a\x43\x03\x58\x17\xe3\x28\xdc\x2e\xd2\xee\xe8\x0b\x6a\x05\x12\x71\x8f\x8b\x8b\x7a\xba\x84\x18\xa6\xf3\xcb\x48\x1a\xe0\x04\x44\x90\x12\xf5\x7d\x76\x82\xd1\x91\x83\xab\x5f\x3b\xcb\x6c\x66\x1b\x32\xb1\x18\x7d\xc3\xc9\x63\x33\x42\xfd\x85\x5c\x14\x17\xcd\x27\x82\x8a\x56\x11\x2a\x8a\xfc\x9d\x67\x16\x40\xdf\x2c\x43\x3c\x8f\x24\xf0\x23\x5e\x81\x7e\x95\x5f\x60\x33\xcc\xf1\xf9\x00\xd6\x41\x65\xf9\x89\x6c\xec\xf7\x47\x2c\x96\xb2\xca\x65\xf3\x6d\x3b\x75\x3b\x0b\xe9\x9b\xff\x76\x85\x94\xc3\x22\x91\x09\x46\xc2\xca\x3e\x22\x77\xcb\x87\xdb\x95\xe4\x74\xb9\x86\x4d\x96\xa7\xe8\x69\x3f\x00\x9a\x4b\x68\x74\x86\xd8\x17\xc1\x0b\xb3\xb5\xe1\xde\x73\x38\x7f\x4c\x45\x19\x8f\xb8\x52\xe9\x27\xf8\x56\xb3\xdf\x3e\xab\xf4\xb1\xef\x9f\x1c\xd6\x87\x7e\x24\x65\xe3\x0d\xe1\xd3\x4e\xd3\x8e\x53\x1e\x45\xef\x90\x2c\x02\x9c\x69\xb1\x7b\xbd\x80\x9b\xf8\x40\x29\x82\xd2\xdf\x54\xc6\x3e\x90\xc8\x37\x67\x5f\xc3\x5e\x50\x6b\xfb\x2d\x85\xce\xa6\x2f\xf0\xd1\x19\xb7\x50\x40\x74\x99\xf4\x36\x5e\xf3\xc9\x1d\x95\x95\x8c\xdc\x4b\xc0\x49\xd1\xef\xc9\x36\xff\xfd\x8f\xf1\x56\x2f\x9c\x3b\x95\x18\xcf\xe9\x51\x96\x04\x7e\x4e\xae\x3e\x2f\x30\xa2\x1a\xa1\x06\xea\x8e\xfc\x08\xce\xcd\xc6\x04\x2a\xc8\x20\x7c\x8f\x4e\x9a\x0d\x8b\x06\x20\x3f\xfe\xa9\xea\xa4\x65\xf1\xb6\x33\x88\x90\x8d\x7e\xda\xfb\xdd\x2c\x8c\x6d\x98\xb9\xd6\xdf\x55\xcd\x8e\xbb\x9e\x61\xb9\x76\x53\x9a\x78\xc3\x38\xd1\xd9\x06\xf7\x29\xa4\x0a\x7a\x22\xf7\x88\xe7\x98\x95\x0f\xe0\x24\xc5\x3b\xd8\xa8\xa7\xc4\x28\x51\xab\x72\x97\x43\xea\x20\xdb\xf7\xfc\x51\x60\x84\x42\x9e\xeb\xc2\x2d\x4e\xcf\x54\xb6\x4a\xaa\xcd\x94\x28\xf3\xbc\x7f\x89\x00\xb7\xb7\xd4\x05\x26\x65\x89\xf3\x6e\xab\xd6\xf9\x2e\x5a\x5c\xe4\xcd\x7e\xca\xf5\xed\xbf\xf9\x08\xef\xf4\xeb\xa3\xfe\x97\x95\x42\x89\x16\x9c\x35\x92\xf1\xea\x78\x56\xde\x32\x86\x93\xe1\x55\x95\x80\x7e\x7f\xe4\x67\x79\x0b\x7c\xb3\x19\xf2\x58\x44\xe1\x51\x66\xc4\x29\x05\x94\xe3\x54\x1c\x14\x24\xe1\xf0\xe1\x56\x49\xfe\x63\x21\xfa\x27\x93\x2a\xcc\xc4\x9b\x6c\x54\xf2\x3f\x9a\x27\x14\x02\x92\x36\xfd\xcc\x51\x26\x86\x4c\xdc\x21\x1b\x3a\xea\xa9\xfc\xc0\x43\xc8\xd3\x51\x22\xa4\xc8\x26\x22\x1a\xb6\x1c\x69\x0e\xc1\xfa\x25\x03\x98\x6b\x9b\x09\x63\xd9\x0f\x4c\xe7\x9f\xcb\x4a\x33\xa6\x47\xac\xa9\x05\x58\xd8\xa6\xe6\x0e\x53\x53\x5b\x35\x75\xf3\x90\x99\x27\xe3\x7f\x74\x2a\x87\x3c\xa3\x62\x8a\xe8\x2e\xfc\x85\x86\x94\x7f\x2c\x20\x5f\xf4\x34\x39\x68\x73\x73\xe5\x48\xbd\xe8\x4b\xc4\x1f\xce\x0a\x49\x43\x6b\x9a\x1d\x64\x4a\xa1\x7e\x4a\xa8\xca\x63\x0a\xc1\xf4\x15\x51\xba\x17\xfa\x67\x7c\xe1\x74\xb7\x88\xc4\x7d\x28\x1c\x58\x3d\xc0\x99\xf8\x54\x3c\x45\x7d\xe6\xc0\x94\xfe\x4d\x35\xb4\x8b\xda\xbf\x42\x0c\xd4\x12\x3f\x9b\x2a\xe0\x44\x82\x02\x0b\x52\x0c\xb3\x5c\x22\x6c\xbc\xc8\x19\xc5\xdf\x80\x34\xdf\xe0\xfc\xc8\x68\x14\xf9\xef\x1c\x78\xd2\xab\x4d\x13\x11\x94\x48\x32\x10\xa2\x45\x02\x64\x0a\xcb\x90\xd3\x85\x5d\x3e\xe8\x6d\xa7\x83\xcf\xf8\x3f\x2f\x29\x1c\xba\x69\x5b\x0b\xf8\x86\x9e\x2c\x22\x0e\x65\x7f\x79\x20\x3c\x81\xa5\x33\xbb\x31\xf7\x83\x04\x1f\x4a\xa2\x50\x1b\x38\x5c\x84\x7a\x8d\x32\xa3\x08\xf9\x39\xbc\x4d\xef\xaf\x35\x03\x63\x72\x6a\x8c\xed\xcb\xdd\xd6\x24\x33\x56\x05\x47\xf8\x2a\x3f\xc4\xca\x59\x84\x4c\x2d\x61\x23\x3a\x2a\x6b\x12\xe0\x14\x71\x22\xd8\xa4\x50\xbc\x54\x57\xee\xcf\x0e\xcc\x7b\xa9\xa5\x2e\x1c\x29\xf2\xe9\xed\x8a\x43\x1f\x43\xf4\x9c\x48\x7c\x29\xaf\x99\xab\x49\x18\x87\x0e\xf1\xc7\x2e\x86\x63\xc1\x14\xff\x70\xbe\x8e\xec\x54\x4e\x31\xb2\x0b\xc4\x90\x38\xee\xe5\xc9\x6d\x76\x59\x5f\x3c\x53\x4a\xb4\xf7\x8b\x55\xd0\x4f\xdf\x98\x17\x65\xa7\xee\x15\x7b\x25\x16\x84\x7b\x79\x91\xf1\xf3\x7c\x36\xbe\x82\x0c\x49\xac\x42\x13\xd1\xa7\x61\x51\x79\x23\x41\x6f\xc7\xf4\x4f\xf4\x0a\xfd\x19\x3f\x12\x45\xaa\x57\x5b\xe4\xa0\x7f\x6a\xb0\xc0\x66\xdf\x8e\xfa\xed\x1b\x9a\xcd\xaa\x6d\x30\x26\x88\x63\xdb\xe1\x2c\xf3\x6a\xc6\x2d\xd2\x6e\x90\xe3\x4e\xda\x9e\x42\x0b\x89\x4d\x1c\xe6\x4d\x45\xc8\x36\xef\xa4\xd5\xd8\x29\x24\xf6\xee\x36\x07\x36\xee\x6a\xa7\xc8\xd5\xcf\x6f\xd1\xba\xb7\x1c\x1c\x43\xfb\x4d\x84\x07\xd9\x4e\xc8\x31\x9f\x3c\x46\xde\xe2\x10\xe0\xd5\x15\xcb\xf4\xd6\xdb\xe3\x45\xe2\x80\xfe\xc9\x0b\x69\x64\x2f\x56\x67\xb3\xf9\x1f\x63\x15\x36\x8e\x61\xdf\x92\x39\x9c\xc6\x12\x8f\x69\x66\x08\x9b\x6d\xe6\xef\x8f\xa0\xb3\xfe\x94\xb0\xaa\x4f\xef\xf8\x7f\xa0\x2a\x63\x90\x3e\x74\x8b\x45\x76\x87\x7c\x4d\xef\x40\xc7\x4e\x32\x78\x08\x8a\x71\xd0\x50\xaf\x73\x91\x0e\xea\x47\xb2\x4a\xfb\x93\xff\x30\x2d\x55\x50\xd8\x10\x30\x60\x02\x57\x9d\xe2\xa6\xaa\x26\xe2\x6a\x3b\x23\xde\xf0\xe4\x87\x59\xab\x2a\x10\x20\x5c\xbc\xa5\xdc\x13\x6d\x2c\xd7\x42\xd1\xf1\x5a\xa4\xa6\x4a\x03\xda\x49\x0f\xa7\x0e\x09\x6d\x5e\xe1\x09\x11\xb2\x29\x6f\x49\xfa\x28\x2d\x85\x6c\xa1\xb7\xc8\x88\xc0\xc8\xe8\x19\xe3\x26\xa9\x04\xcb\x3c\x13\x74\xcd\xba\x96\xd7\xf4\x9e\xf8\x23\xac\x0a\x10\xb0\xa3\xc8\x45\x69\x8f\xb0\xc7\x5d\x46\xa9\xb2\x88\x49\x4c\x2b\x5d\xce\xd2\xf9\x61\x0e\x01\x55\x98\x7c\x2d\x67\xfe\xeb\x29\xae\x0a\x72\xf2\x52\xe4\x72\x5a\x82\xf6\x03\xa7\x0f\xff\xcf\x4b\xc9\xa1\xb5\xea\xaf\x39\x08\x46\xfa\x42\x17\x98\xf0\xfa\xe3\xd7\x72\x3c\x03\x18\x73\x18\x2b\x22\xeb\x3c\xc0\xd4\x9f\x9f\xcf\xce\x9f\x9e\xb7\x63\x09\xcc\x2b\x7c\xe4\x96\xc4\x50\x9a\x25\x55\x02\x5d\x2d\x43\x32\xd1\x2a\xc6\xf7\xd0\x9a\xd7\xff\x94\x3a\xf4\x97\x3e\x7d\xf9\xcf\x07\x9a\x71\xff\x12\x7b\x6c\xf3\x2b\x5a\x34\xd3\xe7\xf0\x50\x58\x52\x85\xa8\x1f\x45\x5f\x48\xfe\xa4\x55\x50\x56\xed\x9a\x44\xea\x6a\x5a\x29\x49\xa5\xd6\xef\x5b\xe6\x99\x36\xde\x82\x24\xf4\x6b\x38\xc1\x19\x86\xce\xa0\x93\xd8\xa3\x53\xe1\x53\x67\x4f\x64\x15\x04\x16\x41\x92\xa8\x83\x7e\x42\xab\x71\x8a\x66\xc9\x94\xc3\xe8\x15\x09\x1e\x04\xdd\x6c\x96\x3c\x3f\x34\x69\x5d\xd7\x1a\xc8\x97\x4c\x64\x22\x06\x1f\xdc\xa2\xb0\x60\xfd\x5c\xeb\x4c\xbf\xd5\x4f\x43\xba\x2e\xa6\xdc\xc2\x03\x29\x76\xf9\xb6\xe1\xf3\xd9\x7c\xb2\x12\x86\xe8\x17\x4b\x47\xa6\x91\x38\x32\xe4\x7b\x51\x99\xa1\x56\xd9\x22\x5b\xe1\x31\x9c\xc5\x9d\x53\x6b\xb8\xf4\x8c\xbe\x66\xf1\x39\x67\xfa\x0c\xf2\x97\x49\x5b\xb8\xba\x9c\xd4\x2c\x8e\xa5\x1e\xde\xec\x80\x5f\x6e\xd8\xbb\x14\x2c\xc6\x5e\x7b\x62\xf8\x0f\x28\x46\xa3\xd5\x22\x6c\x4b\xc9\x4d\xe3\x4f\xef\xe9\x46\xad\x34\x8b\x99\x51\x67\x05\x67\x28\xea\x20\xdb\xfe\x5f\x11\x5c\xf9\x1d\x84\x6a\xcd\x90\x48\x38\x41\x49\x92\xc5\x67\x55\x80\x1a\x5d\x5d\xea\xc2\x64\xa0\x67\x1d\x85\x67\x55\xd9\xc0\x3e\xdb\xea\x84\x5c\x13\xd5\xaf\x4f\xd8\x7d\xf9\x72\xfa\x14\x0c\xf2\x0c\x7f\x1d\x24\x6d\x79\xf2\xa5\xbd\x47\x02\x69\xfc\xd5\x9e\x84\x9d\x84\x8b\xa5\x33\xe2\x27\xed\xed\x93\xaa\x94\xb4\x13\x78\x26\x36\xfc\x32\x75\xe3\x19\x3a\xf8\x55\x43\x9a\xc0\x3a\x85\x1f\xcf\xf6\xce\xc3\x27\x06\x8e\x7d\x2d\x01\x6c\x8d\xde\xe9\x63\xc8\x0d\x99\x39\x1f\xd9\x46\x0d\x55\xf4\x1b\x12\x3d\x87\x3a\xf1\x2f\x99\xa6\x0e\x9e\xce\x79\x71\x24\x16\xd1\x89\x94\x2e\xde\xc9\x88\xc9\x52\xf4\x1b\x0f\x92\x54\x80\xfb\xa1\x81\x5f\xae\xe4\x06\x0c\x40\x9e\x31\x3d\x3e\xa8\xb2\x3a\x77\x49\x75\xad\x8e\x2c\x44\xbe\x3c\xfc\x5c\xd4\x21\xa9\xc7\x86\xc8\xae\x1f\xf2\x73\x8e\x4b\x6d\xc8\xee\x68\x87\x2d\xac\xfb\xd5\xca\x55\x60\x48\x84\x39\x06\x8f\x8d\x18\x59\xf4\x0f\xc9\xaa\x63\xfa\xca\xd8\xe2\x27\x2b\x5a\xe7\x26\xa0\x9b\x21\x25\x54\x55\x47\xad\xaf\x6c\x82\xf7\x41\xa2\x46\x9f\xa6\x17\x6c\x76\x88\x6d\xe4\x67\x49\x1f\xfa\xf7\x5e\xf5\x47\x2f\x9a\x45\x5f\xce\xaf\x7c\x5c\x8a\xdc\xcb\xfb\x12\x0a\xaf\x35\x64\x5d\x2b\xdb\xce\xd4\x6b\x05\x27\x0f\x7e\x6f\xac\xe8\xfb\xc2\x96\x4c\x5f\x84\x8d\xb7\xd8\x4c\x8c\xe7\xbd\x0f\x3a\xd4\x0c\xd2\x15\x51\x34\x45\x69\xfa\x78\xbe\x64\x3d\x83\x1f\x60\x23\xef\x08\xce\x06\xfe\x9a\x4c\x20\xf7\x21\x32\xe3\x15\xca\x02\x86\x9b\x0f\x9e\x69\xc5\x95\x68\x4b\x24\x7b\xa0\x7d\xf8\x31\xf4\x49\x4e\x33\x67\x88\xbc\xfa\xb4\xe9\x96\x4e\x6e\x34\x90\x63\x10\xb6\x3b\x7e\x16\x35\x81\xcf\xed\x7a\xab\x09\x0a\x5f\x9a\x21\xf6\xb6\x07\xe2\x11\x06\x28\x0d\x75\x6b\x5e\xb4\xc4\x8f\x6a\x03\xb5\x29\x02\xf3\x41\x38\xcf\xd8\xc5\x2b\x20\x09\x6e\xb4\xe2\x32\x21\xfa\x9c\x19\x2d\xf5\xa2\xa9\x0d\x12\xec\x1b\x5c\x16\xd1\x94\xb6\xe1\xa7\x60\x6c\xbe\x3a\xdd\x05\x02\xc9\x3f\x78\x1b\x31\x38\x47\xdb\x74\xbd\xda\xa4\xfd\x0d\x57\x97\x53\xeb\x15\x3c\x52\xde\xed\xb6\x4d\xea\x7f\xf7\xb0\x41\x39\x4d\xc8\xed\x13\x34\xa8\x77\xa4\x6e\x96\x08\x7e\xef\x3c\xbc\x97\x0f\xdb\x29\xc5\x83\xcd\xad\xdb\xe4\x72\x9c\x64\x19\x53\xb2\x88\x50\x9f\x4b\x1a\xc1\x0e\x29\x5d\x29\x94\x69\xc9\xff\xf1\x3c\x0c\xa4\x48\x89\x09\x96\x95\xc8\xd2\xd9\x36\x37\x32\x60\xee\xd8\x30\xe2\x52\x0c\xe2\xd4\xf8\x0c\x87\x5b\xb0\x53\xf8\x48\x71\x58\x5c\x17\x49\x63\x9a\x5f\xe1\xee\x90\x1a\x77\xe5\x9d\x7b\xc7\xf9\x60\x1c\x74\x67\xa4\x12\xa1\xe1\xc0\xb9\xd4\xae\xe0\xab\x31\x28\x12\x3b\x47\x60\x01\x12\x5b\xb3\x3d\x7e\x38\xcd\x9c\xcc\xb3\x4a\xb6\x98\x90\xda\x84\xeb\xd9\x6f\x01\x0e\xed\x13\x74\x92\xfd\xba\x5b\x8b\xfa\x0b\xac\xae\x2b\xb7\x43\xc8\x45\x12\x79\xad\x69\x46\x91\xed\x68\x9c\xb7\x75\x82\xdc\x34\x70\x8e\xb0\x2b\x98\x90\x1e\x4c\x78\xf1\xf8\xaf\xcd\x3f\x59\x84\xa6\xbc\x75\x14\xa0\xf5\x6e\x8f\xfb\x20\xde\x46\xc0\xed\x2d\x74\xe7\x7d\x32\xea\xf2\x5d\x34\xf3\x03\x79\xbb\x62\xb8\x6a\x9b\xf1\x6e\x85\xa8\x4d\xe7\xbd\x60\x36\x50\x09\x9b\xd9\x8d\x2a\x06\x8a\xc9\x6e\x62\x6e\x8b\xd2\x41\x67\xf1\xc9\xdf\x73\x00\xa1\x74\xc2\x51\x34\x4d\x8e\x08\x6c\x3b\x0f\x6f\xa2\x67\xca\xe9\x7b\xd3\xf9\x3b\x0c\x14\xde\x79\x0e\x98\xec\xa7\xd1\x7a\x27\x05\xab\x02\x15\x5b\x35\x3a\x89\x7e\x8d\xb4\xbc\x69\x06\x6d\xaf\xb9\x87\x4b\xad\x10\x30\x84\x13\xfa\x60\xef\x67\xc9\xca\xbe\xaa\xab\x5f\x2e\x35\xf3\xc1\xfe\x65\x06\xac\x8d\x5e\xc2\x5e\x51\xf7\x83\xb0\xa4\x9b\xff\x0f\x07\x0a\xab\xda\x2b\x8b\x31\xa5\x3f\x84\x9c\xd1\x3c\xa1\x7e\x58\x01\xd6\xed\x98\x9a\xa9\x2e\x51\x34\x9e\x84\x77\xbd\x83\x28\x75\x9e\x6d\x67\xed\x52\x34\xdd\x3f\x36\x05\x5a\xa5\xe5\x04\x9c\x6b\x98\x80\x71\x6b\x21\x63\x9c\xcd\xe3\xc7\x99\xe2\xb8\xe9\x5d\xee\x58\xe8\x6e\xe4\xaf\x11\xfa\x9a\xc0\x2f\xa3\x6d\xef\xbf\xc2\x43\x3b\xd3\xc5\x8c\x42\x2b\xdc\x31\x37\xfb\xec\x03\xb9\xaa\xb7\x5d\x08\xb4\xda\xd9\x9b\xd4\xfe\xf2\x4c\x43\x1f\x0c\x81\x1c\xd9\x67\x0a\x91\x59\xb3\x90\xbd\xc5\xcd\xc4\x44\x43\x92\xa1\xbb\xf7\x4a\x84\x65\x5f\xe9\xbb\x19\xf3\x84\x5f\x2a\x86\x13\xed\x77\x4a\x55\x68\x4e\x21\x9a\x76\xbb\xe2\x21\x72\x56\x61\xc4\x14\x34\xac\x10\xab\x85\x4a\xeb\x46\xc1\xbd\x5f\x91\x35\x78\x35\xbf\x20\xdf\xa3\xac\xba\x22\xaf\x43\x7a\x29\x48\xd7\x48\xa1\x42\x76\xab\x0a\xd8\x2b\x92\x81\xe0\xe4\xeb\xff\x67\xaf\xac\x4b\x3d\x46\x27\xb6\xa9\xd7\x16\xd9\x3e\x9b\x26\xb6\x0b\x3d\x3d\x25\xbf\x2e\x32\x13\x90\xd6\x0d\x23\xf8\x8f\xfa\x4d\x00\x7b\x66\xb6\x3a\xae\x59\xaf\x61\x2f\xa1\x4c\xd9\xa9\x28\xd1\x66\x6a\x69\x4e\xc8\xd3\x11\xe5\x6b\xee\x7e\x84\x30\xbd\x5d\x5b\x97\x76\xb6\xbf\x6d\x18\xaa\xc1\x0b\x5b\xeb\x2c\x45\xdc\x99\x95\xab\x13\x42\xb7\x42\xe2\xe6\x25\x26\xb4\x3b\xfe\xde\x77\x8c\xae\x9f\xb9\xef\x89\xfe\xc6\x3e\xd2\xb1\x8f\x71\x3b\x91\xb6\x43\x5b\x85\x0b\x09\x93\xf3\xf0\x4f\xfa\x6b\x73\x21\x73\x3e\x18\x7f\x96\x16\x10\xab\xc7\xc0\xb0\x41\xa3\x68\x95\xd3\x90\x88\x03\xc9\xd2\xdd\xa7\xaf\x6b\xe4\xb1\x66\x48\xf4\xca\xec\xf9\x21\x58\x56\x8c\x99\x2b\xac\x89\xe5\x67\x72\xa1\xfb\x1a\xa1\x3e\x2b\xc0\x0b\x7f\x1f\x09\x22\x11\x59\x12\x55\x72\xc6\x94\xa4\x46\x49\x9e\x13\xb1\xea\x20\xc7\x4d\x57\xe0\x11\xcc\xab\x21\x4f\x75\x0a\x59\x33\x43\x38\xcb\xd6\xac\x87\xff\x11\xb9\xc3\xc5\x5a\xd0\x5e\x8e\x57\xf8\x05\x91\x9c\x20\x6a\x0f\x44\xee\x86\x51\x2f\x6b\xd5\x59\x25\x68\xf7\x11\xb5\xf5\xcc\xff\x9d\xf4\xe7\x38\xdd\xd7\x84\xa3\x4d\xb4\x34\xf0\xf6\x49\x59\xb3\x79\x34\xb4\x7c\x73\x53\xf5\x91\x3d\x62\xab\x94\x9f\x65\xe8\x36\xee\x97\x6d\x12\x9d\x39\xe9\x7f\xe9\xdf\x02\x71\x10\xb3\xe9\x74\x23\xb7\x36\x5e\x78\x20\x66\x38\xfa\xad\xe8\x29\x50\x96\xf5\xbf\x8a\x5c\x3c\x87\xe3\xaa\x13\xf4\x0f\xd0\x04\xe3\x12\x3d\x6e\xda\x10\xc9\xe8\xf1\xc0\x3e\xe6\x14\x72\xe8\xe6\xc9\x82\x15\x89\x0e\x3b\x84\xe8\xb7\xc0\x4b\x49\x81\x44\x51\xd1\x1c\x10\xa8\x15\xc9\x02\x91\xbb\xbc\x47\x4c\x2e\x8d\x68\x0f\x6f\xfe\x48\x5a\x08\x9b\x1d\x09\xf8\xa6\x88\xdc\xc7\x22\x57\x7d\xf7\x7c\x48\x2e\x6c\x5f\x60\xef\x07\xa9\x6d\x8e\xac\x14\xdd\xa4\xab\xed\xb0\xef\x67\x25\xfe\x98\x5e\x32\x57\x8a\xb7\x93\xae\x10\x18\x26\x37\x97\xe0\xa3\x70\x6a\x52\xef\x77\xb8\x65\xa9\x0f\x65\x30\x77\xa4\xa0\xc5\xe9\x0d\x25\xfb\x6d\x08\xc6\x78\x1c\x92\x5e\xcd\xce\x7e\x72\xdf\xe0\x97\xf6\x70\xee\x9b\xf0\x32\x2b\xeb\xe9\x67\x61\x33\xbc\x0c\x11\x8a\x3a\x70\xc5\xde\xb1\x68\xf5\x45\x3e\x3f\x7b\x0d\x4f\xfd\x3d\x3c\xb6\x76\xab\xb5\x3f\x7e\xe1\x7b\xa0\xd1\xcc\x44\xa3\x19\x7a\xe2\x41\xa8\x63\x23\xc4\x51\x32\x63\x3f\x72\xf1\x7a\x7e\x4f\xa2\x74\xec\x29\xa1\xb6\xd9\xaa\xe0\xbe\x0a\xce\xcb\xa2\x08\xa3\x2a\x6f\x24\x9a\x5d\xb8\x97\x33\x31\x42\xad\xde\x9b\xad\x5f\x91\x7a\xb0\x95\xfe\xfb\x19\xb5\x7b\xb1\x3f\xee\xfc\xad\x5e\x74\x6c\x73\x40\xd4\x1b\x99\xf3\x5b\x98\x0e\xcd\x6b\xa1\xaf\xf3\xea\xcc\x2c\x0e\x25\x51\xda\xf0\x4d\xf0\xe9\x99\x1f\x7b\x6b\x81\x89\x36\xa2\xe7\x53\xc6\xf2\x50\x09\x2c\x9e\x81\x38\x9e\x9c\xfa\x6c\xd0\xb3\x1b\xb4\x81\x9d\x40\x58\x52\x70\xf8\xf6\xb3\x60\xe2\x1b\xeb\xb5\x88\xf8\xd8\x7e\x8b\x9b\x8c\xb0\xad\x07\x8f\xca\xe1\x11\x0c\x51\x43\xf2\x21\x90\xac\x69\x3e\xb6\x3f\xd2\xa6\x47\xcf\xeb\x4b\x26\x08\x44\x2c\x75\xb3\xfb\x37\x85\x72\x32\x85\x95\x55\xff\xcc\x4d\x99\x02\xc4\x52\x7e\xa2\x5b\x4f\xab\x3b\x90\xf6\xee\x3e\xe2\x9c\xfa\x24\x49\xd3\xd6\x23\x58\xfe\xe1\xe0\x65\x1f\xf8\xe2\xa7\x13\x56\x69\x3f\x45\x93\x4c\xea\x28\x3e\xdf\xf5\x4b\x2c\x3e\xa3\xe0\xb1\xe1\xa6\x9b\x96\x2b\x5a\x1a\xf8\xa3\xdd\xdd\xd3\x69\x7a\x83\x55\x1c\xb9\x8d\xee\x65\x9d\x64\x2d\x45\x07\xb0\x2d\xe4\x06\x5b\xc2\xcf\x47\xcb\xeb\xf1\x43\x9a\x23\xf0\x5e\x3e\x38\x48\x44\x18\xa1\xb1\x4c\xd8\xb4\x7f\x36\x5c\x75\x95\x3e\x79\xad\xa4\x48\x42\x58\x49\x62\x5e\xed\x7b\x42\xa3\x4a\x2a\x59\x21\xbc\xd1\x57\xb7\x32\x4f\x68\x2d\x32\xba\xbe\x28\xb1\x04\x63\x28\x09\x50\x0d\x0b\x5a\xc0\x87\xc2\x61\x0b\x7e\x35\xda\x4d\x85\xbb\xd2\x3a\x37\xfc\x54\x0e\xd8\xb3\x60\x46\xc7\x56\xff\xd9\xd2\x82\xc2\x4b\xc4\x14\x6f\xa3\x97\x2c\x13\x4b\x87\x8f\x2e\xe5\x6f\xac\x5c\x9c\x57\xcc\x58\x72\xbc\x5b\x31\x37\xe1\xab\x02\xb2\x4a\x94\x37\xd5\x9d\x6e\x05\x6b\x0a\x5d\xd1\x9a\xae\x48\xa4\xba\xc8\x29\x84\xb1\x39\xc1\x3e\x8c\x82\xf7\x88\xd2\x84\x0e\xf8\x98\x35\xc3\xf4\x2a\x8c\xb1\x3c\x8d\xe3\x41\x63\x6d\x29\x42\xb1\x3e\xb7\xb4\x66\xb4\x12\xfc\x28\x7c\x96\xa6\x47\x40\xaf\x83\xcf\xe8\xd0\x68\xa1\xd6\x64\x09\xb6\xde\x82\xec\x0d\x3f\x46\x2c\xe1\x52\x74\x9a\x2e\x7b\xf3\xb9\x52\xee\xbf\x8b\x3f\x79\xe4\x75\xb1\xc8\x7f\x77\x09\x2f\x23\xd7\x7f\x92\xd0\xc8\x15\x00\xd2\x4f\xcd\x01\xf4\xc6\xa2\x1e\x74\x6b\x72\x50\xe5\x94\xd9\xa8\x8f\xfd\xfc\xe2\x84\xad\x71\x0a\x71\xa9\xe8\xd4\xf6\xc2\x2f\x05\x48\x1f\xeb\x4f\x39\x5a\x7c\x2d\xc3\x49\x5e\x48\x8b\xa4\x2b\xc1\x12\x6e\xf7\x4b\xfa\xda\x05\x7d\xca\x71\x7d\x09\xbf\x11\xa0\xc3\xfe\x5e\x30\xef\x13\x1d\xfe\xb1\x0f\xfe\xe8\x7b\xfd\x17\xdb\xa5\x3f\xdb\x44\x45\xca\xd6\xdb\x11\xed\x3f\x59\xbb\xff\xa5\xff\xb9\x78\xe6\x0f\x60\xe8\x97\x03\xdf\xa0\x83\xdf\x43\x2d\xaf\xa4\x80\x2d\x9b\x78\xfa\xec\x22\x69\x4d\x1f\x56\x0a\x53\xe5\x7e\x77\x72\x79\xab\x63\xa8\x55\x1b\x2a\x4a\x4f\xeb\x3f\xd2\x53\x35\x0f\x27\x31\x67\xed\xe8\x74\xe9\xa9\xbc\xc2\xfb\xaa\x54\xa6\x78\x91\xe7\x62\x87\xe6\x8a\x45\x09\x01\x54\xa9\xee\xf9\xca\xb1\x90\x13\xcf\x03\x0b\x98\x02\xba\xf1\x9f\x81\xcc\x44\x7d\xef\x18\x44\x4d\x3f\xa3\x9a\x88\x60\x8a\xa0\x44\x68\x09\x1c\xa7\x86\xec\x29\x60\xe5\x73\x0b\xcf\x28\xec\x84\x77\xd2\xcc\xa7\xac\xa0\x31\xf7\xb6\x6c\xc0\xe2\x84\x75\x43\xd3\x20\x2c\xbf\x22\xce\xeb\x9b\x57\xb4\x53\x7d\xfc\x69\xf7\x9f\x04\x6e\xe0\x6c\x1e\x96\xe6\x2d\x79\xdb\xe6\xba\x5f\x5e\xb6\xbe\xf6\xb4\xaf\x11\xbc\xbd\x0b\xe9\x6e\x9d\x5f\x76\xad\x5b\x5a\xf7\x86\x7a\x98\xff\xe5\x6f\xa8\x1c\xd8\xa5\xd9\xfe\xb5\x9f\xb2\x53\x8b\x37\x9d\x92\x9c\xc3\xd6\xb0\xf9\xb2\xf5\xa7\x53\x76\x38\xf0\x6e\xe5\x36\x8d\x60\x78\x91\xfd\x19\xaa\xcc\xb1\xc5\x63\xc0\x7f\x85\x2e\x0c\x36\x0a\x5c\x5c\x56\xc9\x63\x61\xa3\x75\x5c\xab\x5c\xd8\xe7\xd6\x20\x06\x8a\x2d\x94\xda\xe9\x9b\x44\xae\x45\x70\x18\xb3\xd0\xef\xc4\x4c\xb3\xa4\x5e\xc5\x68\x1b\x24\x32\x96\xa1\x96\xfd\xd9\x82\x45\x84\x99\xc7\x08\x91\xd1\xc9\xcb\xe9\xe9\xb1\x88\x7a\x0e\xfe\xf0\x55\xcb\x6d\xc2\x82\x76\xfb\xb4\x8d\x2d\xe9\x98\x20\xaf\x2a\xc8\x3b\x63\x3f\x5d\x7d\x3f\xfd\x84\x98\x42\x5e\xeb\xe5\x2d\xef\xf3\xc2\x26\xd5\x73\xcd\x55\x86\x40\x36\xf4\x1e\x87\x1d\xc5\x66\x86\xad\x3a\x62\xb1\xe4\x21\x76\xb9\xd2\x82\xbe\xea\x5c\x18\x7c\x08\x44\x4f\xcc\x4f\x00\xc5\xbc\xdf\x83\x21\xfd\x69\xf1\x25\x3d\xa1\x59\xf3\xd7\xcf\xf2\x2e\x00\xce\xae\x92\xc7\x86\x07\x1f\xbd\xca\x44\xfb\x19\x3e\x04\xcf\x84\x20\x0b\xff\x57\xc9\xbe\x7c\x8a\x86\x6d\xed\x23\xc2\x7e\x5d\x6d\x46\x82\x72\x25\x86\x6e\xb9\xae\xe1\xd6\xba\xd5\xcc\xbf\xf7\x5b\xc1\xca\x20\xe3\x74\xd2\x54\x93\x15\x9b\x9e\x07\x17\x15\xfb\x4d\x83\x84\x16\xb9\xfb\x07\x82\x67\xda\x31\x76\x8c\x62\x7c\xd6\x38\xfb\x07\xac\x05\xba\xcd\x6a\xec\x90\x02\xd3\x80\x65\x10\xda\x7d\xe6\x50\xa6\x0f\xe5\xe3\xdf\xc3\x50\xc4\x1b\x80\x8e\x24\xcc\xdd\x3d\xb8\x6f\xd0\xe3\xba\x8f\xff\x04\x48\xe8\xe0\x91\xf6\x69\xc3\x3c\x04\xee\x7e\x41\x2f\x18\x63\x65\x54\x0c\x8a\xf8\x01\x5c\x76\x11\x80\xf7\xda\xd3\x47\xb0\x94\x23\xc9\xb5\x23\xb8\x2e\x04\x06\x8c\x99\x4c\xb6\x2a\x36\x73\x04\xe6\x77\x41\x57\x03\xbb\x41\xfd\x67\x14\x00\x7f\xcd\xbd\x1f\xcf\x67\xd8\xb9\xdb\xaa\x10\x23\xa2\xda\xd1\xc2\xec\x61\x7e\xdc\x38\xac\xc9\x69\xef\x3d\x4a\x2d\x12\x58\x93\xe8\xe7\xfd\x49\x3d\x6c\x8f\xa2\x4a\x47\xb5\x51\xfb\x02\x17\x77\x76\x9c\x7a\x30\xb2\x03\x9f\x47\x83\x97\xa3\x33\xcc\xd4\x6d\xab\x18\x98\xbd\xa0\xf8\x12\xf4\xb2\xbe\xa8\xf4\xe9\xad\x26\xd8\x63\xc4\x7f\x1e\xc2\xe0\x07\xb1\xfb\xe0\xa8\xae\x2a\xf0\xfa\xf9\xa9\x26\x94\xd5\xf7\x2e\x46\x21\x34\xef\xd8\x9e\xe4\xc4\x13\xbb\x4a\xb0\x03\xd9\x35\x13\xd9\xba\xfe\x4a\xdc\xa7\xf4\xb0\x02\x88\x91\xf6\x5c\x18\xad\x54\x4c\x03\x6e\x52\x70\x3a\x30\xcc\xef\x43\xf4\xd9\xb0\x90\xbf\x63\x87\xdf\xdb\x8a\xdd\xb1\x79\xdd\x47\x66\x81\xc7\xc9\x3d\x44\xa9\xa5\xf4\xf8\x88\xf0\xf5\x5d\xaf\xb5\x85\x2f\x9d\x0b\x16\x25\x54\x8e\x14\xb0\xee\xb3\x5e\x5e\x6b\xb8\x8d\x1b\x3d\xdb\xae\xf8\x9a\x81\xe1\xff\x78\xb5\x63\x73\x4b\xb7\x71\xdc\x5a\xf6\xd2\x8b\xff\x59\xf7\x9f\xeb\x5b\xbb\xbf\x6d\xf6\xbb\xba\xa9\xe0\xed\x2a\x75\x5c\x9d\x2d\xb0\x8b\xb0\x7c\x88\x9c\x45\xa7\xb5\xcb\xa0\x01\xf4\x14\x42\x38\xe7\x89\xe8\xbf\x4d\x71\xca\x40\x07\x46\x16\x36\x6f\x70\xa3\xe7\x72\xe1\x38\x7c\x0b\x7f\x03\xc5\x96\xe0\x74\x07\x1d\xb6\x02\xdd\xdf\x43\x91\xfb\xbc\xf2\x4c\x3b\x3b\x9b\x08\xde\x2b\xc0\x6e\x47\xae\x1f\xa1\xfd\x95\x22\xc1\x6e\x8d\x8c\x4b\x90\x6a\x25\x70\x66\x05\xd4\x45\xdd\xdd\x85\xd9\x57\x37\x7b\xdd\xef\x74\x55\xa7\x59\xeb\x99\x39\xb6\x16\x9d\x13\xea\x04\xf3\x07\x85\xaa\x63\xd1\xe6\x78\xbe\x48\xb6\xe3\x15\xcf\xdc\xa9\xa1\xeb\x10\xb7\xee\xc7\xe1\x2a\x91\xfb\x1e\x6a\x64\x38\xe1\x92\x59\xeb\xaf\x4e\xe9\xb5\x1c\xc6\x90\x26\xb9\xa9\x6b\x03\x09\x41\xd6\xa0\x59\xb6\x74\x80\x09\x82\x97\xab\x2e\x81\x0b\x99\xf4\xec\x67\x29\xa4\xe1\xc2\x5c\x8a\x2f\xb3\x22\x8e\xc2\x4f\xa7\xf4\xed\x89\xae\x3b\x45\xcc\x61\xfc\xea\xf8\xa3\x8f\x14\xd3\x9e\x18\xcc\x60\xdf\x8b\x48\xb6\x75\xf0\x29\xde\xdf\x6d\xc4\xe0\x01\x52\xa2\xed\x9c\x03\x2f\x99\xc3\x49\x9b\x89\x74\xc9\x92\x11\x7d\x88\x2f\xa9\xbd\x7b\xa1\xb3\x9d\x0c\x30\xec\xbc\x93\xff\x1d\xfe\x6d\xf2\xf3\x15\x06\xd3\x77\x92\xb6\x7a\xbb\xf8\x23\x61\xdf\xc1\xb3\x3c\xad\x4c\x78\xfa\x17\x65\x4f\xa0\x7d\xf0\x7f\xae\x3d\xf7\xac\x7e\xc9\x90\x08\x9f\xa6\x55\x2d\xe5\x34\x56\xda\xec\x8f\xa8\x32\xfc\xad\x01\x18\xf4\xc7\x0f\x65\x3d\x26\x7d\x84\x5e\xcc\xe1\x7a\xaa\x7d\x21\xba\xf0\x3b\x0a\xa5\x2f\xa1\xc3\x6f\xe6\x56\xfe\xd3\xa9\x53\xf7\xf1\xb6\x8d\x7f\x39\x30\x7d\x16\xe4\x8c\xa1\x4b\x62\x6d\xfc\xae\x04\x0e\x7f\xf6\x61\xef\x12\x61\x29\xef\x52\x84\xe5\xbd\xcb\x3e\x7a\x35\xf2\x0e\x35\x35\x53\xb9\xc8\xff\xbd\xbf\x0b\xbb\x19\xf7\xa4\x0e\xc7\x95\x6d\x4a\x79\xa9\x8d\xd1\x52\xfd\xec\x2b\x69\xbe\x7b\x34\xe9\x56\xe3\xc2\xca\x0d\xf0\x2e\x7c\xb8\xea\x1f\x45\x34\xeb\x5b\x6e\x66\xef\x39\xe6\x82\xb7\x17\x1d\xa4\x81\x79\x6e\xe0\x8f\xd8\x9c\x2f\xba\x29\xbf\x5b\xb3\xc5\xe5\xe0\xd4\x87\xc7\xa2\xfe\xce\x33\xfd\x3d\xd1\x21\x61\x27\x05\xb3\xb1\x97\xd4\xef\x74\x9f\x04\xc7\xde\x49\x3f\xb5\xfd\x30\x11\x4d\x90\xe6\xfd\x67\xe4\x37\x35\xeb\x97\x37\x18\x47\x98\x3e\x5f\xa7\x83\x30\xaf\x02\x00\xf1\xe1\x19\xff\x92\x91\xbf\x98\x14\xd8\xe2\xb5\x9c\x1e\x7f\xf5\xba\x75\x85\x01\x6b\x8f\xce\x4a\xdc\x87\xac\x5c\xfa\xfd\xa5\x35\xa2\xc8\x5e\x20\xf4\x49\x70\xbe\x47\xc3\xe5\x67\xf2\x17\xf7\x25\x7b\x8f\x47\xb4\x54\x40\xcf\xf1\xcf\x88\xf6\x4a\xfd\xfc\x43\x46\x3e\x8a\x3a\x36\x76\xcd\xd9\xd7\xe5\xaa\x77\xa0\x03\x5f\x32\x04\xaa\x0a\xc0\xbb\x9e\x7b\x34\xd9\x6e\x16\x80\xf7\xd9\x18\xff\xf6\x86\x36\x96\x7c\x08\x6f\x64\x3a\x81\xb7\xba\xc4\x0e\xf6\x73\xc5\x15\xe4\x0f\x8f\x34\xec\x25\x38\xcf\xe1\xdd\x97\xf7\xa4\xd4\x84\xfb\xa7\x69\xb7\xa9\x43\xcd\x94\x34\x8b\x1a\xdc\x11\xf0\x8f\x7e\xc2\x3b\xf9\xcf\x7c\xd5\x0f\x31\x19\x34\x51\x98\x05\x50\x83\x08\x6c\xfb\x3d\x7a\xde\xdd\x55\x84\xd6\xdb\xa6\x8c\x20\xa1\x7a\x1a\xe2\xe3\xff\x45\x02\xa2\x8f\x4a\x19\xd4\x09\xb8\x4b\x58\x66\x7b\x6f\xe4\xad\xc5\x1c\x6e\xb6\x4b\x74\x45\xd0\xe2\x6b\xd1\x89\xd9\x36\x9f\x0c\xfe\xbf\x73\x6e\xaf\x02\x1f\x0f\xa9\xdf\xed\xcc\x91\x91\xa8\x07\x22\x06\xe5\x77\xe6\x91\x02\xd2\xab\xb8\xe3\x20\x57\x1f\x9b\xa0\x6f\xa6\xce\xd8\xc8\xc1\x98\xab\x50\xf3\x79\x15\x09\x1f\x6d\x30\x4b\xc0\x68\x43\x55\xcd\x17\x53\xd1\x31\x5a\x55\x5f\x5f\x2b\x52\x8d\xa3\x8b\x62\x55\xa4\xfa\x19\x8b\x6d\x6b\x14\xaa\x38\x53\x93\x75\xfd\xfa\x23\x54\x03\xf8\xeb\x4c\x67\x51\x03\xa4\xa8\x27\x32\x13\x49\xf3\xd0\x44\xde\xe3\xea\x48\xf5\x4e\xa0\x0b\x61\x8f\x25\xe7\x18\xa1\x89\x10\x5d\x94\x68\x6c\xd8\x26\x26\xf9\xba\x64\x7b\xd9\xa7\xa2\x08\x6c\x28\x82\xed\xe5\x84\x10\x3e\x3d\x3b\xc9\xc9\x0e\xbf\x87\x89\x2f\x9c\x83\xeb\x67\x9b\x1b\x09\x9f\xae\xcc\x7d\xe0\x25\x05\xe3\xd5\x83\x07\x4f\x36\x78\x3f\x27\x22\x5a\xe8\xca\xac\xd4\xb8\x79\xe7\xa5\x7d\x3f\x60\x16\xc8\x75\xcf\x3b\x2f\x41\x7d\x9e\xd6\x1f\x95\xb9\x87\x6c\x51\xad\x1a\xef\xd4\x3c\xd8\x4e\x81\xda\x06\x43\x79\xe6\x80\xd5\x3c\x39\x0f\xda\xb6\x4e\x7e\x96\x26\xa6\x39\x7c\xda\x27\x3b\x3f\x32\x02\x3a\xeb\x3d\xb7\x0c\x92\xb3\x16\x3a\xd9\x9f\x55\xb5\xdd\x59\x07\xb1\x64\x4f\xfe\x06\xde\x34\x51\xb5\xc6\x71\x56\x83\x65\x6b\x68\x99\xbb\xe3\xaa\x99\x79\x96\xa9\xbd\xc0\xb4\x86\x55\x22\xe8\xee\x3a\x3e\x5c\xaa\x9f\xf4\x7f\x67\x65\x0c\x9c\x9a\x7c\xcf\x39\x30\x70\xbf\xf6\xfd\x5c\xe6\xff\xc8\xd7\x91\x82\x1b\x1d\xe2\x7f\x3a\x24\x72\x34\x6a\x07\x88\xb0\x38\xb2\x32\xce\xac\x66\xcc\x30\xb8\x5b\xdc\x09\x7a\x68\xf4\x54\xfc\xf9\x29\x90\xc1\xf3\xb7\x7d\x85\xc8\x5a\x1d\x20\x5b\x84\xe3\x93\xa7\x39\x6c\x00\x86\x30\x14\x86\x25\x0d\x8b\x0d\x24\xf1\x3b\x6b\xda\xf6\xa6\xcc\x83\xb0\xb5\x2e\xab\x53\x62\x27\xcb\x2a\xe6\xb5\x5d\xd6\xfc\x1f\x1c\x6b\x70\xf1\xee\xc2\x66\x4c\xf1\x74\x5a\xb6\x1f\x40\xf9\x6d\xa3\xc4\x63\x1f\xd9\x10\x70\x1c\x92\x52\xf9\x50\x7c\xf6\x81\xc6\x5e\x38\xdc\x1c\x45\xd0\x04\xb8\xdc\x9e\x7e\xb9\xfe\x3a\x30\x44\xd7\x0f\xae\xcc\x08\xb5\x14\xed\x7b\xde\x9b\xfc\xf9\xd0\xa4\x7a\xd8\x5e\x82\x1e\x02\xd3\xbc\xea\xc7\x07\x03\xdc\x93\x36\x41\x35\x95\xff\x00\x3b\x08\x87\x36\x06\x87\x78\xc2\x36\xe3\xac\x6a\xaa\x20\xe3\x82\x1d\x99\xc3\x4e\x76\x19\x6d\x00\xcc\xd8\xf8\x50\x0f\xab\xe0\x59\x18\x05\x63\x39\xc9\x6d\x2c\x64\xf8\x16\xc5\xaf\x17\x85\xe8\x95\xc3\xe7\xab\xd2\x4f\x3a\x21\x0a\xfc\xcf\x1c\xd5\xd8\x3f\xda\xda\xef\xa5\x39\x42\xed\x10\x4a\x71\xd3\xba\xcf\x2f\xb5\x4f\xfa\x30\xb1\xda\xf3\x5b\x69\x8e\x3b\x0c\x55\x33\xf9\xd9\x4c\xc9\x4c\xe1\x14\x80\xf6\x00\x5b\x21\x60\xbb\xac\x42\xc9\x91\xa2\x21\xf3\xc2\x72\x06\x1b\xdb\x8a\x81\x70\x4a\xb4\xcf\x1a\x59\x99\x56\x83\xfc\x93\x50\x31\x36\xc8\xbe\x68\x21\xda\xe6\xf3\xcb\x9e\x48\x58\x1c\xa2\x65\x7e\xa8\x3b\x87\xac\x4c\xb6\x47\x82\xa8\x3c\x47\x2e\x65\xbb\x6e\x3c\x43\x93\x0a\x7d\xe9\xca\xb6\xbc\xd6\x31\xba\x22\xb3\x6e\x6a\xde\xa2\x5b\x9e\xd8\x39\x49\x9c\x9a\xb7\x7e\xb7\x95\x5c\xbd\x91\x14\xad\x0e\x00\xd6\x62\x5e\xc3\xa4\x5e\x83\x55\xa9\x66\xe8\x64\x34\x9f\x82\xbe\xbc\xc3\x8a\x80\xf4\x32\x78\x12\x20\xb0\xb4\x7f\x44\x9f\x43\x04\xec\xef\x57\xac\x33\x1b\xf2\xf0\xe1\x37\x93\x44\xc6\xd8\xd2\x1d\x29\x8b\x5b\xba\xc3\x5c\xe0\xbc\x3f\x7c\xfe\x19\xe6\x8f\xe7\xde\xfa\x19\x6b\xcb\xe6\xac\xed\xc3\x42\x8b\xcd\xd6\x86\x7e\xeb\x2d\x4d\x6c\x9e\x3c\x9f\x91\x32\xe2\x25\x98\x0f\x38\xcb\xac\x9f\x9b\xe5\xc7\xfa\x51\xeb\x82\x9b\x34\x26\x78\x66\x79\x69\xac\xd5\xfd\xe1\xfd\x09\xe5\x97\xa6\x69\xc3\xd4\x62\x31\x6e\x71\xbd\x3b\xfa\x16\x14\x6d\x21\xd7\x99\x32\x21\x47\xb5\x3b\xe6\xdb\x7b\x1b\xc2\x07\xe8\x3b\x90\xc3\x8d\x18\x19\x7a\x47\xe6\x5f\x0e\xeb\x9a\x0f\x86\x85\xe6\xed\x9f\xb8\x4e\xa5\x7a\x92\xef\xb4\x2a\xc7\x0d\x56\x6b\x77\x50\xbb\x47\xde\xb2\x0f\x91\xf6\x69\x55\xf7\x29\x75\x06\x0c\xa3\xd8\x7f\x10\xe8\x5f\xd5\x25\xb0\xf3\xea\x4b\xdb\x83\xbc\xd3\xd8\x20\xcb\x44\xc2\x47\x3a\x06\x1b\x3c\x41\x88\xa2\x3c\xce\x9b\x6d\x96\xa5\x5c\x6a\x23\x9c\x7b\xec\x82\x96\x72\xfc\xb0\xf5\xc5\x66\x98\xde\x7d\x3a\xc5\x4d\x5a\x0a\xa3\x0b\x96\xd2\xcb\x56\x61\x4f\xd5\x69\xe7\x9b\xcc\x15\xec\x9b\xd7\xd2\xb6\x00\x84\x54\x0b\x22\x87\x4d\xc2\xfd\xdd\x22\xfc\x7b\x99\xcf\x8b\x0d\x89\x88\xf2\x98\x57\x36\xe0\x96\x19\x69\xd7\x97\x7f\xb6\xdc\xd8\x6b\x4b\xfe\xc7\x83\x72\xe2\xc1\xb9\x59\x4b\xaa\xdf\x35\xa9\x1d\x84\x14\x0a\x35\x0d\x26\xc7\x15\xfe\x0a\x09\x7f\x7f\x73\x00\xf6\x7f\x82\xe5\x61\xa6\x20\x5d\x0f\x5a\x03\xec\xe7\xfc\xa5\xf0\xf7\xfe\xb3\x2a\x0b\x34\x35\x7e\x15\x70\x57\x58\xac\x46\xc3\x90\x15\xa2\xbf\x19\x9e\xb7\xde\x2d\x99\x95\xc0\x8b\x0e\xc1\xb7\xc1\xe4\xb6\x73\x0e\x63\xca\x2c\x3f\x85\x77\x18\x2d\x54\x42\xe1\x45\x26\xf4\x13\x13\xae\xa6\x12\x5c\x50\x77\xae\x92\x13\xe5\x7a\x5f\xfd\xea\x82\xc8\x29\xa8\xa4\x8d\xa3\x2e\x4e\x7b\x9c\xc1\x36\x08\xa6\xfa\x2c\x83\xbe\x09\x41\x48\x20\x35\xfb\x78\x1c\x91\x4e\x26\x16\x8f\x55\x6c\x82\xfc\x7f\x81\x1f\x62\x73\xb9\xc9\xe5\x45\x35\x86\x53\xd3\xc9\x2b\xa7\x08\x91\xcf\x61\x32\x49\x16\x49\x79\x4a\x41\x37\xe6\x88\x03\xe2\xf8\xaf\x55\x28\x3d\x01\xc9\x29\xfd\x96\x15\x99\xa0\xd9\x34\x2f\x0d\x82\x13\xaa\x22\xeb\x24\x9d\x7f\x95\xc7\x21\x74\x12\xde\x02\x08\x07\xcc\x66\x06\xb1\x06\x6f\x76\x6a\xba\xd0\xb1\x1e\xb7\x22\x3c\xec\x57\xe1\x6a\x45\xa6\x7b\x04\x88\xe8\x64\x1d\x6d\xa3\x75\x2a\x40\xc4\xa6\x2d\x5d\xda\xe3\x49\xdd\xc7\x78\x8a\xce\x8c\xff\xbf\xd2\xf4\x01\x84\x77\xfa\x67\x16\xf5\x52\x6c\xf0\xfb\xe1\xc7\x88\xbd\x03\xfc\xef\xbc\x98\x31\xcc\x52\xc6\xb9\x59\xb0\x8d\x40\xfc\x14\x8b\x1a\x1f\x69\xcc\xe1\xb4\x3b\x46\x7c\xca\x98\xa4\x4c\x19\x45\x8c\x97\x42\x6c\x4c\x57\x2f\xae\x3b\xef\xb5\x4f\xe3\x9f\x21\xc9\x3a\x15\x79\xaa\xea\xe3\xd8\x30\xb1\xb3\xe1\x05\x17\x19\xd9\xcf\xca\x1e\x3b\xa8\xf0\xd8\xcc\x3b\x66\x8e\x2d\xb6\xa3\xfb\x27\xaf\xe9\xa7\xe6\x17\xf4\x0a\xf4\xbd\x3e\xb1\x55\xa3\x2b\x84\x7d\xaf\xea\xbc\xdb\xf9\xc5\x68\x55\x59\xa1\x3f\x23\x33\xf2\xe9\x20\xbf\x23\xf3\xab\xfb\x85\xf1\xe3\x3d\x3d\xa0\x55\x0d\x07\x32\xc6\xf9\x3a\x98\x5b\x05\xfb\xaf\x8d\x5e\xaf\x8e\x40\x58\xe6\x3f\xc3\x99\xf3\x95\x65\x09\x51\xd7\x3e\x02\x59\x5b\x0c\x89\x38\xed\x4f\xc4\xe6\xba\xa2\xd3\xff\xe8\xf3\xa6\xee\x47\xf2\xfa\x5b\x94\xb7\xd0\xe7\xe0\x94\xf7\x9b\xb1\xa5\x67\x27\x19\xe5\xb6\x53\xee\xed\xe7\x72\xc2\x19\xb3\x4b\xf8\x39\x40\x20\x12\x1f\x7f\x86\x73\x9a\x23\xe8\xad\x08\xb2\x02\x45\x0f\x1b\x04\x22\x23\xb1\x84\x3f\xf5\x50\x01\x93\xcb\xac\x13\x8e\xe0\x5e\x25\x0c\x60\x40\x25\x0e\xe0\x1d\x40\x1f\xd0\xf2\x4f\x13\xa0\xe3\x94\x36\x44\x59\x03\x1a\xd7\xcd\x9d\xce\x30\x87\xd8\x71\x98\x49\x55\x05\xdb\xfe\x55\x34\x58\x3b\x3a\x1e\xd8\xd8\xbe\x30\x1f\x34\x55\xdb\x90\xaf\x26\xac\xb1\xf1\x94\x28\x4d\xb0\xa9\x4d\x9b\x60\x74\x05\xce\x20\xeb\xc7\x73\x56\x66\x23\x7b\xd4\xab\x18\x63\x43\x0e\xf6\x0b\xae\x58\xc5\xad\x00\xa8\x4a\x8c\x7b\x75\x81\x0e\x5b\x08\x3b\x0f\x70\xfb\xe4\x20\xd1\xd8\xbe\x07\x37\xbc\xb5\xfc\x70\x37\x91\xfe\x72\x75\x33\x47\x59\x0d\x05\x47\xf8\xc5\xc7\x3f\x93\x06\x81\xd1\x97\xa5\x81\x4f\x76\x72\x28\xe9\xd5\xcf\xbf\x5f\x38\x6b\x59\x45\x2b\xef\x6d\xa5\xd0\x6b\x52\x0e\xec\x21\xb0\x0e\xb2\x3b\xe7\xfe\x9f\xf7\x33\x6d\xa4\x6c\x62\x4b\x47\x98\x7c\xf2\x75\x87\x0f\x4e\x94\x16\x00\x99\xf7\x97\x69\x71\xad\x91\xf0\x0a\xd4\x63\xd0\x98\x01\xf4\xbd\x73\x64\x57\xf1\xf0\x85\xfd\x20\x4a\x65\x8e\xf4\x95\x75\xfe\x4f\xc0\xfc\xdc\x93\xbc\xd4\x7d\x02\xe4\xea\xdc\xc7\x89\xa3\x73\x20\x1c\x7f\xf6\x0a\x2f\xea\xaa\x52\x7f\x30\x10\x2e\x9f\xc5\x6f\xeb\x6a\xaf\xc8\xd5\xda\x2f\x42\xe0\x60\x0f\x1a\x8c\xfb\x46\xb3\xaf\x9d\x98\xf2\x44\x90\x80\xb8\x2f\xd0\x4e\x11\x56\xaf\xdb\xa5\x20\xd8\x1a\x5e\x18\x60\xe1\x0b\x69\x2f\xc3\xee\x29\x43\xdd\x99\x7f\x56\x1a\x08\xa2\x26\x8c\xec\x55\x5f\xf3\x15\xdd\x25\x6b\xeb\x68\x66\x08\xe6\xbc\x50\x71\x89\x85\xc0\xa0\x57\x77\xc0\x16\x4e\xc6\xc5\xf2\x97\x74\x8f\x8b\x1c\x98\x3c\xeb\x98\x0e\x19\x2a\x84\xca\xd7\x26\xd8\x05\xe4\xbe\x3f\x02\x83\xdf\xc3\x4e\xc8\x2e\x8d\x3e\x0b\x8c\xea\xa8\xb8\xbc\xd6\xcc\xbf\xec\xe2\xf2\x7f\x85\xfd\x9f\xc2\x67\xf3\x15\x18\x91\x9d\x16\x81\x90\x75\x79\x87\xeb\x0b\x47\x20\x05\xd2\x4e\xd5\x76\x07\x5f\x19\x48\x77\xad\x4c\xee\x5a\x23\x11\x76\x59\x00\xe4\x65\x40\xfa\x11\x0f\x1f\xd3\xbf\x50\xf8\x8b\x86\xa1\xd7\x2e\xa3\x0d\xdb\x3c\xae\x82\xd9\x85\x52\x76\x89\x6c\x63\x40\xec\xe7\x9f\x72\x61\x58\x93\x76\x30\x3f\x91\x17\xa9\xef\x67\xf1\x8d\x8b\x3c\x96\xce\x6f\xf5\x03\x89\xa1\x6a\x3f\x01\xca\x58\xb9\xd7\x4f\x8d\x83\x98\xc4\x26\xc0\xa9\xea\x13\x55\xda\x60\x9d\x10\x68\x78\xe0\xdd\x87\x82\x66\xd7\xa7\x90\x74\xcd\xcb\xb6\x28\xd3\xeb\x94\x5e\xa4\x0e\x6d\xb9\xed\x28\x5d\x88\x12\xe5\x83\x70\xb5\x4a\x80\x4b\x7d\xec\x14\x55\x1b\x7d\x3f\xa3\x2c\x66\xbe\x1f\x5f\x74\xbf\x25\x2c\x42\xbf\xf2\xa2\xfe\x2a\x47\xff\x0b\x76\x22\xf9\x37\xdf\x84\x8e\xe0\x45\x52\xff\xca\x5b\x56\x40\x80\x78\xde\x27\x27\xb2\x32\xde\x9f\x20\xde\x97\xfa\x6f\x42\x0c\x77\x0b\x70\xd0\x68\xc1\xb4\x57\xcb\x85\x59\x7f\x38\xb7\x7b\x13\xbf\xdd\x8b\x3f\x28\x19\xef\xd9\xb6\x6b\x73\x83\xa7\x57\xf9\x33\x39\x8d\x9f\x40\xb1\x0f\xe3\x75\xb3\x80\xf2\x0c\x8e\xb7\x3c\x32\x82\xad\xf9\x0e\xa4\xf7\xdd\x02\xe6\x41\xf3\xc7\x55\xe5\x43\xab\x00\xdd\x90\xfc\xed\x3e\x49\x02\x93\xc2\xf9\x94\x4d\xd0\xb7\xb8\x3a\xef\xe6\x25\x0e\xbc\x3a\xd3\xa4\xfa\x25\x3c\xff\x45\x53\x3d\x41\xcf\x8f\xf0\xc0\x20\xd8\x7c\x6e\xb9\xae\xe2\xe5\x7f\x9b\x0d\x06\xad\xda\xec\xdb\x84\x59\x4f\xb0\xfb\x41\x71\x90\x13\xea\xfe\x6c\xc6\x1b\x76\x4e\xd2\x22\x51\xd0\xf3\x5a\xf2\xc8\xbf\x7a\xf1\x94\x00\x3d\x9f\xa4\x63\xd5\x0f\xda\x54\x8e\x41\xff\x5c\x54\x00\x51\x73\x25\xbc\xdb\xf2\x79\x8b\xa2\x21\x17\x3d\xf0\xfb\x15\x95\x6b\x8b\xc2\x90\xc2\x2a\x75\x8f\x7c\xdb\x13\x27\xb2\x54\x03\x05\x01\x38\xcd\x28\x55\xdb\x13\x67\xfc\xfb\x91\xb1\xab\xee\x74\xa1\xb0\x19\x46\x52\xdc\xd3\xec\xf3\xac\xbd\x24\xda\xed\x62\xfc\x9f\xaa\xac\x00\x6b\xfb\xbd\x1e\x9c\xe0\x03\x5a\xc3\x5c\x88\x63\x95\xb1\x44\xc5\x4f\xa3\xb8\xda\xba\xe9\xa3\x5c\xb4\x09\xbc\x6e\x66\xba\xd9\x89\xf0\xb5\x73\x8c\xc2\x61\x60\xd5\xd7\x3e\x37\x76\x7f\x66\x2e\x84\xfd\x77\x9c\x5a\x5b\xf0\xf5\xcb\x29\x9e\x01\x86\x42\x8c\xa1\x1c\x8a\x0c\x11\xfb\x63\xbc\x06\xae\x09\x58\x81\x08\xa5\xd8\x68\xd3\xbf\x86\x23\x04\x19\x0e\xd0\x4f\x0d\xba\xb7\x5f\xe4\x63\x0f\xe2\xff\x2d\x18\x3c\xed\x11\x59\x03\x84\x2e\x6c\x5b\xd9\xff\xbc\x8e\xd0\x24\x34\xcc\xcb\x46\xb4\xee\x88\x98\x54\x24\xfa\x16\x81\xdb\x35\x2c\xcd\xae\x88\xb9\xe9\xbc\x33\x71\x6d\x14\x92\x03\xbd\xfe\x79\xbd\xda\xbb\x96\x56\xc0\x2d\xb8\x09\x5a\x6f\xad\xf1\x76\x39\xf6\x01\xbf\x0c\x3e\xdc\x7e\x35\x92\x4e\x80\x5c\xf1\x73\x4e\xed\x5d\xd9\x59\x76\xb4\x10\x9c\x73\xf6\x2f\xf5\xc7\xd4\x87\x2a\x57\x78\xb2\xc0\x23\x1b\xa4\x27\x27\xae\x2b\x87\xbf\x46\x5e\xc9\x47\xb0\x32\x49\xed\x25\xac\x0b\xfa\x0f\x39\x49\xf1\x67\x73\x33\x1b\x16\xfd\x0c\x63\xd4\x5b\x3c\xfa\x3e\xbe\xf0\xde\x0d\xb2\x05\x2e\xef\xf3\x2f\x51\x78\xcd\xf5\xda\x7f\x68\xb4\x26\x18\xea\x00\x38\xc8\x9a\x70\x41\xed\x6f\xcc\x7e\xa2\xb7\xf0\x81\xdd\x83\xc4\x7f\xab\x2d\xee\x96\xb0\x67\xe4\xee\x0c\xe4\x63\x5d\x90\xe7\x25\x0d\x44\xd9\xb1\x61\xa8\x50\x82\x6d\x00\x52\xa4\x06\x59\x8a\x04\x7b\x4b\x74\xf5\xf0\x2b\xe0\xac\xd2\x10\x9e\xe0\xbd\x6f\x3e\x10\xec\x8c\xad\x81\x43\xca\xb5\xf9\x91\x20\x42\x56\x2c\xfc\xf2\xbe\xc5\xf3\xaf\x31\xb8\x19\xb4\x0f\xca\x3b\x23\x7e\x0a\x08\x0c\x61\x9d\x77\x96\x33\x2c\x69\xc9\xe2\x43\xd4\x31\x51\x6f\x34\x5a\xf9\xa2\x1d\x77\x60\x11\x32\x7c\x36\x97\x59\xd2\x5c\x4e\xb1\x90\xcf\x9f\x34\xf3\x6c\x64\x46\x0f\xfe\xe1\x20\xd4\x6d\x27\xfd\xad\xf8\x1a\x19\xbe\x03\xee\x40\x92\x5b\x76\x39\x70\x17\x96\xc2\x67\x56\xf7\x04\x97\xab\x5f\x46\x1c\x0f\x9a\x94\xcf\x3c\x3c\x33\xcb\x36\x00\xe1\x44\x47\xcf\xf8\x3f\x29\xfc\x6b\x9b\x46\x07\xd0\xaa\x9f\x41\x36\x70\x7a\xdd\x71\x16\xdf\xd5\xe3\xa8\x73\x9c\xc3\x30\xb9\x1d\x46\xc6\x8b\xda\x25\xfa\xe1\xa2\x73\x20\x8b\xcb\x8f\x21\x47\x3c\x5a\x6a\x0e\x54\x01\x4e\x94\x70\x16\x7d\x99\xcf\x96\x28\x34\x33\xf7\xf4\x80\xd1\x8c\x70\xe9\xff\xc4\xea\x47\x3a\x0b\x07\x32\x86\x07\x67\xec\x52\x22\x32\x4f\xd0\x83\x66\xbb\x04\xaa\x8b\x3b\xd8\x4e\xb2\xc8\xb3\x01\x17\x95\xc3\x23\x4e\xfc\x21\xb9\xfd\xdf\x9f\xab\xf0\x91\x15\xd7\x73\xe4\x2e\x14\x08\x89\x14\xff\x77\xe4\x61\x61\x38\xd3\x0e\xf7\x25\xb1\xf9\xa1\x12\x55\x6e\xd2\x07\x30\x4b\x3e\xeb\xea\x85\x2e\x62\xe8\x42\x05\xfa\xaf\x36\x8b\x93\xbc\xf0\x56\xb8\x75\x64\xde\x06\x6a\x59\xe6\x68\xe1\x97\x69\x73\xa0\xe4\x04\x47\x1a\x93\xc4\x0a\xd1\x06\xb0\xad\x31\x0f\x52\x19\x15\xa8\xe7\x5c\x71\x80\xeb\xdc\x41\xf2\x75\x56\xe9\x6a\x8b\x0e\x4d\x4e\xb8\x4f\x2a\x70\xf8\xb8\x09\x74\xe0\x54\xe6\x37\xbb\x7f\x04\x96\xec\xa4\x83\xef\x25\x20\xd5\x3d\x30\xea\xdd\x56\x2d\xc5\x40\xf3\x02\x86\xf5\xc9\xac\x54\x15\x2b\x83\xd8\x84\xdd\xb3\x56\x4d\x9a\xf6\xca\x24\xc5\x5b\x5e\x04\xd9\xd9\x7e\xdf\x43\xba\xe1\xba\x04\xd1\xcd\xdb\x66\x1c\xd0\x3a\xd5\x06\xb6\xf3\xcd\x36\x79\xf9\xb8\xdc\x04\xba\x43\x35\x6b\x55\x36\x97\x6c\x80\x99\x9d\x40\xdf\x79\xd7\x9e\xce\x15\x07\x6b\x03\xcc\x19\x54\xb6\xcd\x7f\x40\x43\x03\x30\x8f\x7c\x24\x60\xe7\x6b\x28\x0f\xa6\x97\x40\x73\x44\x1e\x3d\x88\xa7\xf3\x61\xf6\x70\xc2\x33\x4e\xb5\xa6\x3a\x61\x8a\xd8\xa2\x2c\x18\xdd\xb6\x5e\x02\xca\xdf\x32\x23\xe9\x8f\x29\x49\xd8\x81\xd4\x25\x78\x75\x73\xe8\x19\x16\x3e\x04\x3a\x44\x44\xdd\x6a\x69\x3e\x70\x9c\x77\xd1\x71\xa1\x2d\xb0\x47\xf2\x7e\x8f\x48\xe5\xcb\x3e\x59\x46\xd2\xfb\x77\x17\x20\xaf\x1d\x26\x00\x77\x31\xa6\xa4\x31\x10\x8c\xaf\x20\x45\x84\x4b\xcf\xf2\x79\x49\xe7\xcf\x1a\x45\xe1\xd9\xd8\xaf\x13\x1f\x57\x52\xd3\x1e\xe6\x9c\xf0\x3c\x39\x53\x66\x22\xf4\xc1\x98\xa4\x9d\x7b\xeb\xf5\x67\xa2\xbb\xd6\x5e\x1a\xa0\xb5\xf4\xb3\xba\xf2\x6b\xe1\xea\x42\x66\x7e\xb8\xf5\x8a\xf8\x3f\xcb\x07\x6c\x9d\x25\xd8\x07\xb2\x44\xe6\x3b\xa6\xcc\x60\xba\xc7\xa4\xb9\x02\x56\x1c\x5a\xf0\xb4\x20\xb2\x15\x4c\x43\x31\xf4\xbf\x04\xcf\xf7\x24\x40\x7d\xfe\x07\x45\x8f\xc2\xc8\x26\xd6\xdc\x55\x71\xee\xbf\x11\xaf\x14\xbc\xe2\x35\x85\x8f\xb0\x4e\x69\x06\x2a\x91\x2d\x8f\x71\x7b\x41\x7c\xd5\x1c\x48\x61\x03\xe8\x29\xc0\xf7\x63\xca\x8d\xd5\xaf\x3b\xb7\x23\x12\x9a\x20\xca\x78\x00\x6d\x77\x13\xea\xa5\xb6\xdc\x69\xdb\xa0\x6d\x51\xcd\x2e\x70\x21\x0f\x28\x9d\x77\x17\xd5\xb1\x0b\x1c\xb4\x79\x94\xab\x4a\x84\x35\x81\xc0\x42\x08\x7d\x0e\x6f\x15\xef\x72\x2f\x3b\xd2\x8f\x7f\x9a\x87\x05\x7d\x42\xbf\x03\x70\x44\x84\x58\xdf\x21\x5c\x5a\xe6\xe6\x32\x0c\x40\xbd\x85\x5c\x87\x9d\x71\x8b\x84\x5d\x66\x2d\xc0\x70\x68\x09\x13\x62\x51\x05\x90\xad\xda\xa2\xac\x27\xde\x92\xce\x20\xe5\xdb\x2e\x2f\x18\xf9\xdb\x41\xc4\x7d\x8b\x34\xec\xc4\x8d\xc1\x22\xed\xc3\x92\xec\xc5\x83\xb5\xaf\x78\xed\xc4\x4f\xfc\xa7\x44\x92\xbf\x1a\xe4\x91\xbf\xf2\xd9\x79\x0c\xe0\xf7\x2f\xd2\xd7\xfe\xb2\xd2\xdb\xe8\x78\x3c\x13\xaf\x77\x8f\x62\x3f\x7f\x6c\x96\xc8\x6c\x96\xfe\x25\x7b\x00\x6e\xb2\x69\x87\x27\x08\x4c\x48\xfd\x06\x08\x3a\x75\x16\xcf\x07\x4f\x19\xf8\x96\x29\x34\x7a\xfa\xfc\x8c\x62\xea\x26\xd6\xc5\x54\x7c\xb1\x98\x6c\xab\x21\x50\x7d\x4f\x93\x5f\x62\xee\x0b\xf3\xc3\xdc\x87\x50\xc1\x60\xdc\xec\x60\x56\x55\xb1\x30\x51\xa6\x23\xcc\x1d\x64\xc8\x69\x8e\x08\xe4\xa9\xe5\xb6\x4d\xe1\x12\x36\xcd\x71\x57\x17\x59\xdb\x2f\xf1\xf3\xf9\x0f\xb3\xdc\x76\x1c\x92\x0f\xbe\xfe\x16\x24\x78\x26\xf2\x5c\xbf\xa1\x1e\x1b\x2c\x4d\x8e\xbc\x37\x60\x1f\x4b\x74\x7e\xed\x87\xa7\x90\x06\xe8\x62\x9a\x52\x15\x65\x3e\x44\x31\x13\xe8\x72\x57\x80\xf1\x77\x1b\x5d\x53\x3b\x47\x01\xd8\x7f\x22\xc2\xea\x94\xa7\xc9\x94\x44\xe1\xdf\x24\x9e\x9e\xd2\x38\xaa\x09\x02\x97\x46\xc9\x61\xa6\x14\xb3\xc4\x94\x06\x7d\x7a\x6c\x64\x17\x2e\xae\x63\x0d\x03\x5e\x8c\x66\xec\x5c\x69\x48\x73\x4f\xad\x95\xe4\x52\xff\xdc\xd8\xfc\x22\xe4\xa3\xb9\x4a\xd0\xbe\x82\xa3\x44\xe2\xbe\x5d\x75\xc4\xef\x73\xeb\xde\x38\x9b\x1f\x47\x06\xf7\x8e\xa5\x85\x68\x8f\x56\x60\x94\xa0\xe1\x17\xa4\xc1\x73\x40\xc6\xdc\x08\xba\x90\xe6\x53\x97\x6d\xf0\x39\xf3\x7a\xa9\x10\xf0\x8c\xf0\x91\xfd\x82\x79\x5d\xf4\x1d\x8e\xb3\xe2\xc9\x67\x24\x25\x73\x8f\x0b\x7b\x67\xf6\x03\x9c\x66\xe0\x6f\x35\x5f\xd1\x0f\x38\x15\xef\x3a\x26\xc1\x6b\x28\x25\x55\x38\x8e\x58\x13\x06\x82\xfe\x6e\xe8\xcc\x07\x62\xfe\xfc\x70\xb4\xce\xea\x19\xfc\x93\xd4\x3a\xda\x05\x4c\xc3\x9b\x33\x12\x44\x9f\x60\xa2\x13\x40\xaf\xea\x49\x3c\x4f\x6f\x75\x3f\x4f\xb5\x19\x40\x00\x8f\xec\x7a\xf8\xe2\xf0\x24\x8e\x80\x98\xe7\x1a\xad\x60\x1b\x69\xf3\xf0\xa4\x3c\xfb\x39\x87\x55\xcd\xb3\x31\xc7\x9e\x12\x2b\x38\xb5\xdf\xbf\x23\x1b\xf6\x22\xf9\xd3\x2f\xa7\x29\xaf\x6d\x11\x90\x67\x74\xfa\xe6\x25\x9c\x73\xe4\x2d\x9d\xe6\x80\xf9\xf3\x9b\xb4\x7c\x4f\x8a\x21\x5c\x7f\x7b\xa9\xed\x80\xfc\xda\xb0\x04\xec\xd1\x9e\x64\xf7\xe7\x8e\xc8\xfd\x70\xf2\xed\xb8\x37\xe9\xc3\xc1\xfa\xdc\x97\xad\xf3\xa1\x0b\x8b\x91\x0f\xe8\x5e\x34\xf6\x2a\xa4\x1d\x0f\xf5\xfa\x41\xc2\x1e\x43\xce\xbd\xb7\x0d\xcb\x11\x3c\xff\xa7\x20\xff\x7d\xd4\x71\x50\xc2\xd7\x2f\xcf\x7e\xa8\x5d\x1c\x23\x6e\x4a\xae\x4b\x03\x0a\x94\x88\x37\x1b\xce\xe8\xcb\x0d\xf8\xc9\x68\xf2\x34\x94\x4b\x36\xeb\x43\x69\x5d\x85\x42\xbd\xd0\x50\x14\xe7\xe0\x44\x5b\x1a\xe2\xfc\x92\x1d\x86\xe2\x3d\x96\xa1\x65\xa9\xc1\xcc\x67\x8f\x51\xb4\x1a\xac\x88\xe1\x13\x63\x87\x3f\x80\xcf\xde\x47\x3b\x61\xd7\x40\x6d\x88\x0c\x49\x81\x77\x2e\x40\x78\x61\x7f\xa0\xa5\x8c\xe5\xdd\x4d\xf9\x87\xfc\xb3\x03\xda\x0a\x9f\xb6\x25\x35\x15\xc6\xb9\x0e\x64\x77\x23\x41\xc1\x0f\x48\xa6\xe0\x3e\x68\xd0\x36\x74\x08\x8b\x6c\xa5\x22\xf6\xf5\x06\x95\x9b\x68\x7e\xbd\x66\x05\xcf\xf5\xf5\x9f\xec\x76\x68\xb4\xd8\x37\xf8\x48\x6b\x50\xaf\xa2\x96\x82\xf2\x3e\xfa\x93\xd6\x4d\x3d\xbe\xe7\xd0\x26\xa4\x83\x1d\x85\x37\x3f\x61\x5f\xea\x41\x8d\x40\x0d\x17\x8c\xbe\xdc\x6c\x2b\xdc\x7b\xa1\x51\x35\x7e\x88\x59\x0e\xda\x87\x3a\x0b\xfb\x05\x76\x17\x5f\xcb\xde\x0a\x5f\x4b\x6a\x69\xec\x66\xce\x78\x31\xca\x16\x6c\xda\x08\xdd\x03\x82\x5b\x7d\x30\xe5\x4b\x9e\x04\x3d\xe7\xd8\x93\xc3\x41\xa0\x5f\x0f\x21\x94\xe0\xeb\xde\x76\x4d\x6b\x34\x1b\xce\x4a\x6a\x24\xc6\xf3\xda\x6e\x0e\x59\x02\x64\x01\x74\xe0\x40\x10\xd9\x18\xb4\x83\x5e\xa9\xda\x2e\x11\xe0\xec\x09\x43\xa0\x70\xd6\x56\x26\x55\x9f\x0e\xf9\xf4\xda\xe8\x8c\x9b\x8e\xf9\xe7\x09\xc4\x6d\x7f\x1f\xa6\xfc\xbd\x1b\x58\xab\xbb\x31\x5b\xa5\x22\x73\x20\x3b\xad\xe4\x19\xb4\x22\x49\x8a\x0f\x98\x41\x45\xf1\x51\x18\xed\xd4\xab\xa7\xcd\x11\xa8\xd0\xd1\xa5\x38\x47\x4d\xb8\xe8\x7e\x38\x06\x6e\x4b\x58\x5a\x99\xfa\x5e\x3d\x9e\x98\x7c\xfe\xb7\x3a\x12\x55\xd4\x7b\x78\x77\x97\xb0\x0f\xda\x18\x68\x56\x42\x46\xa0\xfd\x31\x86\x6c\xec\x33\xe0\x2a\x06\xea\x73\x60\xef\xdb\xf4\x06\x59\xc6\x68\x5d\x63\x62\xb8\x71\x90\x8c\xc2\x13\x13\xd7\xd2\xe7\xd7\xec\x18\x66\xa9\x0b\xa2\x6d\x62\x7b\x26\x75\x3b\x3e\x8e\xae\xa2\xdb\x41\x3b\xa0\x4b\x2c\x28\x74\x3b\xd8\x38\xf1\xd0\x16\xfa\x5d\x17\x84\xc9\xcb\x1d\xb9\x53\x1b\xa7\xb8\x44\x30\x9a\x26\x91\x4e\x8c\x51\x98\x12\x79\x7d\x45\x31\x02\x9d\xb3\xba\xb5\x28\x9a\xa4\x8b\xec\xf9\x55\xf1\x6e\xc8\x63\x8b\x99\xa8\xc3\xee\x4c\x2f\x22\xd3\x8d\xce\x4d\x6b\xf4\xc1\x82\x24\x8b\xb6\x49\xba\xbe\xb1\x46\xba\x27\xb8\x1f\xa3\x4b\x94\x7f\xa4\xba\x0e\x93\x9b\x1f\xcf\xe8\x71\x00\x76\xfe\x63\x2b\x45\xc8\xa6\xdb\x85\x87\x6f\x51\xa4\x29\x76\xe9\x3f\xc4\x56\x49\x93\x70\xc7\xa9\xe0\xdb\x7f\x0e\x26\x29\x4c\xd0\x21\xd9\xba\xd0\x2e\xac\x0d\x5b\x81\x78\x81\x47\xb7\x33\x89\x30\xfd\x49\x1d\x13\x76\x2f\xea\x2d\x61\x41\x1c\xe5\xe6\x1d\x53\xa5\xaf\xbe\xd4\x14\x74\x21\x3a\x06\xd2\xe6\x2d\x0f\xa7\x8a\x3c\x3c\xa5\x8d\x17\x2b\xea\x8a\xe6\x65\xf4\x9a\x07\x6e\x6a\x90\xdc\xa6\x40\x38\x58\x04\x29\x49\xff\x29\x36\x42\xf2\xd8\x3a\xbe\xf0\x12\xad\xbf\xb4\x70\xf3\xe2\xd9\xfa\xfe\x4c\xe2\xc4\xc9\xa6\x00\xb6\x09\xd9\x45\xa1\x6c\x80\xea\xac\xd4\xc9\x4a\x0e\x3b\x73\x1e\xbb\xe2\x1c\x85\xaf\x67\xe4\xe3\x65\xbe\x48\x5f\xe5\x1e\x9f\x81\x70\x0f\x6f\xad\xf8\x72\xf9\x0d\x04\xf5\x9b\xe3\xe1\x1f\xac\x43\xaa\x48\x3e\x85\x22\x0e\x44\xbe\xf9\x91\x94\x6b\x88\x0e\x76\xba\x3b\xbe\x03\xcc\x78\x57\xf7\x2b\xf5\xee\x44\xa4\x93\xd8\x60\x20\xd3\x05\xbd\x97\x87\xf7\x56\xae\x35\xcb\xa3\xfc\x67\x61\xbe\x6e\x5c\xb2\xe1\xa1\x24\xa6\xef\x7b\x0e\xb3\x73\x79\xb6\x41\x29\xf0\x9e\x65\xb5\x14\x3b\x71\xef\xc9\xa8\x11\x32\xcd\x03\x17\x86\xb7\x1b\x48\x8a\x9c\xf8\x8e\xdc\x1a\x5c\xd9\xf2\x15\x87\xff\x22\x82\x5a\x39\xde\x43\x53\x90\xd5\x44\x4a\x9f\x70\x65\x72\xc1\x7f\x9c\xf3\xf0\xd6\xe2\xfd\x6b\xec\x3e\x64\xc7\xd4\x24\x05\x34\x90\x79\xa7\x1c\xf4\xe2\xd7\xfc\x9a\x59\xd6\xbf\x04\xe4\xb4\xd0\x7f\x2a\x02\xd8\x53\x41\xd6\xec\x83\x39\x74\xce\xdb\x78\x81\x6e\x77\x69\x60\x67\x2d\xbb\x2a\x67\xcb\xfc\xf7\x7c\x29\x8d\xcb\xef\x66\x3b\x5d\x68\x6d\xe6\xe3\xa0\x14\xfb\x1f\xdc\xdf\xbd\x64\xad\x85\xa3\xd6\x04\x06\xd6\xd9\xac\xa5\x3f\x92\xaf\x18\xe1\x54\x54\xe5\x4f\x78\x57\x6f\xbd\xdd\x95\xe1\x72\x30\x5d\x5a\x65\x46\xbe\x1d\xec\xcd\x60\x37\xe8\x0f\xb5\xef\x86\xec\xa7\x1b\xab\x27\x5b\x2e\xf0\x5e\x65\x1b\x86\x26\x2b\xf7\x5f\xe2\xbb\xbe\x23\x1a\x2f\x7c\x30\xef\xa9\x9e\x9b\xc2\xea\xe8\xef\x82\xc8\x9b\xca\x46\xec\x6d\xdb\xb2\x53\x36\xe8\x76\xdd\xf8\x07\xb8\x53\x78\x83\xdd\x12\xae\x5e\x9f\x9b\x42\xb6\xeb\x23\xa3\x6f\x88\x52\xe4\x1f\x64\xe7\x4e\x56\x0c\x12\x14\x08\x02\x12\x2f\xdb\xcc\x85\x02\xe4\xaa\xdb\x2e\x18\x3e\x1c\x05\x21\x37\xb8\xee\xe8\xb7\x9c\xc5\x89\x36\xde\x91\x09\x26\xfc\x0d\x1f\x4b\xf6\x69\x10\x85\x24\xe8\x16\x1d\x99\x8d\xc7\x79\x6f\x61\xb3\xfe\x57\x96\x35\x39\x1d\x99\xa2\x6d\x03\xe9\x41\x92\xb2\xe0\x0c\x89\x41\x38\x71\x1f\xf3\xa0\x4e\x0d\x1d\xe6\xae\xf2\x0e\xd4\xe2\x2a\x57\xa3\xb7\x5d\x45\x96\x02\xd0\x20\xb0\x0b\xb3\xca\x31\xd9\x46\x5a\x59\xae\xf2\xc7\xbb\xe0\x14\x1a\x1f\x5c\x51\xda\xd7\x4f\x77\x77\x15\x36\x7a\xaf\x55\x9f\xd9\x36\xb1\x31\x6d\x5f\x00\x21\xd8\x9b\x80\xd0\x87\xb8\xd3\x45\x44\xfb\xf2\xab\x96\x1d\x9d\x3c\x2a\x08\xe0\x9a\xbc\x0d\x7b\x81\x01\xc7\xce\xc3\xb4\xc0\x4f\xd4\x47\x79\x5e\x28\x43\x70\xc2\x78\x34\x72\x64\x8e\x85\x7e\x76\xb4\x8d\xa6\xa4\x47\x66\x71\x44\xd4\xca\x91\x85\x93\xf4\x1a\xe1\x78\x95\xd9\x5a\xc9\x43\x6c\xee\x2f\xab\x05\x28\x6e\xe8\x27\xca\xf7\x30\x88\x4e\x4c\x51\x77\xc6\xd6\xdd\xcc\xd1\x9e\x35\xd8\xc2\xcb\x8d\xb2\x82\xd6\xbb\xd9\x22\x1f\x30\xb3\x63\x44\xa3\x3d\xdb\xa8\xc8\xe2\x2b\x58\xbd\x57\xb2\x5a\xe3\x92\x65\xbb\xbb\x86\xca\xaf\x69\xff\x86\xfd\xd2\x4a\x65\x11\x2c\x99\xe2\x96\x79\xa0\x0a\x61\xe6\x4f\x9b\x26\x35\x64\x5a\x67\x26\x33\xd4\x2f\xf2\xf8\x2a\x01\x9a\xb3\xdc\xd3\x93\x84\x17\x0c\xff\x81\xa0\x60\x41\xf2\x8f\x57\x53\x90\x1d\xbc\x21\x23\xce\x1d\x6c\x9b\xee\xa2\x81\x3c\xd3\xcb\x2a\xc7\x26\x49\x05\x4a\x56\xba\x25\x2e\x80\x49\x36\xea\x85\x7a\x8c\xb3\x74\x55\x4a\x03\xbe\x03\xfb\xac\x2b\xbb\x20\xe4\x2b\xca\xe2\x3d\x43\xe2\x26\x4b\xf6\xd6\x6b\xca\xf0\x0d\xe0\x6d\xbb\x1e\xb6\xc9\xfa\x69\xe3\x65\x72\x46\x5e\x9b\x0d\xbc\x1b\xd5\xb8\xe4\x36\x8a\x57\x99\xa4\xc9\xb0\xdf\x4c\xef\x38\x29\x2c\x0e\x79\xb7\x4e\x79\x80\xb8\xc0\xaf\x52\xfb\x0e\x98\x2c\xf3\xbf\x1a\x2e\x44\x90\xb5\x5e\x6a\xb9\x90\x86\x7f\xda\xaa\x2a\xe5\xe3\xa1\x8b\xfe\xf0\xf6\x94\x3c\x9c\xf6\xdb\xc9\x03\x70\x86\x67\xd3\x03\x5e\x0c\x2f\x45\x05\xda\x67\x49\x4a\x29\x4c\x37\x61\x5f\x4c\xa0\x6c\x58\x94\x61\x29\x6f\x1a\x2a\xc1\x83\x98\x2a\x04\x38\x1a\xec\xd1\xac\xe1\x76\xca\x06\xd8\x47\xc8\xcc\xe9\xbe\x37\x8d\x50\x9e\x8d\xd1\xc4\x61\x8b\x63\x86\x24\x6c\xa7\x58\xa0\xd9\x29\x49\x6b\x80\x8d\x1a\x31\xae\xa3\x69\x4f\x61\x2f\x1f\xdd\x17\xf8\xe9\xf8\xa7\xcb\x6a\xe2\xa2\x27\xa9\x3d\xbb\x0d\xd7\x2d\xf2\x28\xed\xdf\xe6\x23\xeb\xbf\xe4\x17\x5f\x11\x46\xa5\x14\x3e\x64\xcd\xf0\x47\xfa\xfa\xb6\xf2\x48\xec\x4a\xa2\x51\xd3\x22\xfe\x61\x3d\xcf\xc3\xdc\x3a\x36\x4f\x72\xae\x50\x6c\xaa\x7b\x79\xc0\xa3\xac\xe3\x93\x57\x28\xeb\x38\x1c\xd3\x50\xe9\x24\xff\x9f\xb4\x09\xf6\x7d\xc7\xec\x84\x71\xcf\x28\x12\x70\x41\xd4\xb7\xf2\x3c\x45\x3a\xd4\x5f\x6e\xf2\x53\xb0\x79\xc3\xcf\x80\x2d\x36\x57\xfd\x42\xc7\xcc\x42\xf4\x60\xff\x48\xdf\xb9\x23\x7b\xcd\xdb\x2f\x58\xfc\x95\x73\xb1\x17\x85\x82\xec\x60\xe5\x7a\xb3\x25\xab\x26\xd8\x49\x86\xd8\x73\x6d\x62\xc5\xdd\x36\x1e\xab\x9a\x34\x62\xe7\x58\x01\xdd\xcf\x4e\x22\xdf\x69\x6f\x61\x27\x3b\xbf\x1e\xf5\x64\xce\x7f\xbc\xa1\xce\x63\xf2\x2e\x25\xbc\x05\xe4\x21\xb5\xdf\x21\xbd\xc0\xb8\x3e\xe9\x17\x14\x9e\xf5\x57\xfc\x71\x9e\xb4\xf4\x81\x20\x82\xa7\xc3\x66\x0b\xc0\x29\x6d\x85\x5d\xed\xbc\x17\xf6\x16\x6a\x46\xcc\x91\xbc\x09\xaf\x5a\x12\x26\xe0\xc4\x40\x26\x3f\x69\x3e\xdb\x3c\x7c\xb8\x97\x43\x53\x87\x56\x44\xb9\x46\x12\xe3\x75\x25\xdd\xb4\x7f\x69\xba\x44\xea\x29\x0c\x19\xe6\xc8\x40\xcc\x9a\xe9\xdc\x54\xea\x92\xd9\xbd\x9a\x55\x9a\xc2\xa1\xa3\x60\x33\x2a\x43\xab\xe5\x83\x14\x42\x88\x37\xe3\xde\x1e\x6a\x06\xa9\x47\xe3\x7d\xd5\x14\xfd\x20\x3c\xe4\x60\x6f\xe7\xf8\x65\xa6\x41\x83\xa1\x4e\xf8\xd6\x6f\xa9\xb9\xe1\xbb\x19\xbe\xc6\x88\x02\x64\x57\x67\xb1\x39\x26\x5c\xa4\x10\xe1\x43\xcd\x85\x9b\x5a\xbf\xce\xc4\xc7\x00\xb4\xd3\x80\x09\x6f\xe8\x1a\xd5\x55\x83\x41\xaf\x99\x5b\x88\x64\x95\x35\x2b\x44\x1c\xbb\x7a\x41\xde\x53\x8a\x07\xc4\x93\x3d\xfb\xaa\x75\x97\xc2\x1d\x66\x4b\x5f\x1d\x3f\xa1\xb8\xf8\xe8\x2d\x7a\x3a\xff\xdc\x46\x3e\xb0\x2b\xe9\x3f\x0d\xf2\x9b\x5d\x29\x5b\xd4\xb5\x65\x88\x40\x61\xb4\xa7\x66\x3e\x3e\x9c\xc0\x12\xba\x82\x72\xad\x3a\xa3\x75\x15\xdb\x03\x0c\x65\x5a\x85\x49\xfe\x8c\x7e\xd6\xbc\xeb\xe5\x1c\x10\xa4\xcc\x44\xed\x89\x2d\xfd\xe5\xcc\x00\x80\x49\xbe\x61\x36\x21\x77\xfa\xaf\x23\xb5\x37\x89\x4e\x28\x3e\x1c\xb2\x22\x01\x40\xa6\xf0\x56\xd1\x27\x2c\xd8\xd7\xaa\xa0\xca\xea\x9a\x63\x6f\x69\xd5\xac\x6c\x04\xb4\xc5\xd8\x78\x62\x02\xbf\xb7\xa8\xca\xdb\x9b\x42\x85\xf6\x51\x36\x75\xaa\x0f\x15\xd6\x84\x68\x84\x59\x7d\xcc\xdb\xc6\xe9\xee\x93\x47\x07\x58\xb5\x7b\xb3\xfd\xb9\x06\x40\xb6\xe6\x12\xdd\xcf\x96\x06\x6a\x83\x91\xa6\x1e\x6b\x5b\x93\x7c\xab\xc0\xae\xd8\xaf\xc5\xd5\x45\xa5\x09\xd1\x64\x95\x37\x55\x0d\x31\x09\x6c\x7c\x9a\x39\xd5\x2f\xd4\x13\x7c\x4a\x1e\xa9\xa7\xc0\x72\x50\x83\x66\xb0\x26\xe7\x17\x6b\x44\xb8\x7d\x75\x7b\xc8\x9b\x4f\x92\x27\xd6\xb3\x8a\xc7\x68\xc3\xdc\xe2\xb6\xd6\xd4\x17\xde\xbc\x7c\xd4\xa9\xaa\x07\xf3\x60\x97\xba\x7f\x23\xbf\x33\x4f\xb4\x9f\x52\x8e\x01\xc2\x3a\xdd\xfc\xea\x94\x19\xd4\xd9\xec\x2a\x97\x33\xbd\xf5\xfc\x33\x31\xbf\xca\x06\xf7\x42\xfd\xc9\x7d\xcb\x30\x78\x29\x8e\xc3\x2e\xc5\x67\x83\xa5\x44\x43\x0e\x01\xcb\xd2\xb7\x64\xed\x6c\xd8\x4a\x63\x13\x0d\xa5\x73\x14\x8f\xcb\x1f\x83\x36\xdb\xe3\xc0\xeb\x56\x1f\x8c\xff\xc3\x66\x8b\x32\xd1\x6a\x4a\x89\x09\xa1\x6a\x5a\x12\x3b\x50\x4b\xda\xce\x16\x49\x6a\xe7\x9e\x4b\x43\xfe\xca\x64\x13\x28\x5e\xe9\x6f\x5e\xd5\x9e\x92\xe7\x31\x66\x4e\xe9\x4a\xe4\xce\xca\x04\xcf\x4d\x41\x06\x91\x6c\xd0\x17\x4f\xbd\x9d\xa1\x53\xf3\x6f\x17\xdc\x94\x70\xe6\x9f\xed\x67\xe2\x0a\x09\x5b\x3b\x62\xad\x53\xfd\x70\xfa\x9c\xe0\x9e\x2d\xa3\x29\x02\x1a\x90\xa2\x94\xb0\x9e\x8a\xec\xcf\x8f\x7c\x97\xca\x19\xca\x94\xd2\x1a\x07\xa0\x23\xb5\x74\xcd\x72\xce\xf2\x0b\x98\xca\x11\x39\xdf\xce\x53\xd2\x40\x5c\x5b\x6c\x7c\x5b\xcf\xa9\x88\x6c\x3c\xd9\xf4\x39\xfd\xda\x5d\xd1\x03\x5b\x7d\x56\x86\x04\x05\x41\x3a\xa2\x01\xc1\x9e\xea\xe1\x4a\x14\x36\x8c\x64\xd1\xc3\x61\x68\x52\x00\xd8\xb0\x57\x66\xeb\xb5\xa2\x0e\x64\x18\xc4\x3c\xd1\x25\xac\xab\xd8\x21\xd3\x98\xa5\xe8\xe4\xa2\xa4\xd0\x2f\xa3\x73\x16\x6e\xdd\x68\x88\xa9\x89\x16\x6e\xcb\x53\x8e\x46\x86\xdb\x59\xb1\x05\xf6\x55\x73\xeb\x03\xe3\x04\x86\x35\x58\x69\x16\x91\xa4\xe8\x8a\x65\x8d\x28\x84\x81\x0b\x86\x5a\x5d\x67\xf8\xd9\x80\x6f\x36\xab\x47\x36\xd8\x94\xfc\xd1\x50\x8e\x58\x2d\x4d\xd6\x87\x8c\x47\xa5\x89\x93\x2c\xaf\xc4\x6a\x43\x96\x69\x68\x63\xd6\x2b\xde\xe0\x2f\x9c\xcd\xdb\x6c\x0f\x76\xd1\x28\x7d\x09\xd3\x29\x68\x3c\x16\x45\x3c\x9c\xbc\x45\x40\x07\xfc\xb0\x94\xd1\x00\x33\x15\x45\x9c\x16\xce\xe7\x9e\x70\x2a\x60\xc0\xc6\x1d\x0f\x91\x2d\x7a\x4a\x93\x72\xa6\x3f\xe1\xc4\xa3\x4d\x31\x91\xe8\x70\xd3\x26\x2b\x12\x67\x50\x45\xdb\x66\xee\x66\x4f\x7f\x2c\x83\x7a\x61\xab\x9d\x6c\xdc\x4f\xd8\xd0\x0b\x2a\x48\x1b\xd5\xe7\x1f\x95\x70\x3b\xce\x27\x21\xf6\x71\x6e\x4c\x65\xd8\x64\x85\x36\xa6\xb6\xe6\x98\x6e\x40\x47\x84\x3a\x19\x59\xb4\x61\x89\x88\x8e\x1c\x41\x0b\x2b\x78\x5a\xb3\xcb\xbb\xec\x60\x2d\xb3\x77\x75\xba\x8c\x41\x72\x17\x14\x5c\x33\x87\x23\xb1\xc6\x67\xc4\x6b\xa2\xf7\x30\xf3\x28\x42\xc8\xb3\xf0\x3c\xb7\x23\x70\x54\x1a\x50\x15\x7e\xd4\xe7\xea\xe7\xfc\x53\x88\x16\x2c\xb4\x6e\x76\xb4\x6c\xea\xf5\x7b\xb8\xcd\x71\x97\xac\x9d\x83\x9e\x45\x30\x45\x32\xda\x05\x3f\xc3\xca\xed\x99\x2b\x17\x8b\x67\xa4\x08\x3e\x33\x12\x23\xbd\x8a\x78\xe6\x34\x4a\x30\x93\x42\x15\x53\xe1\xef\x1a\xa5\xad\x6d\xfe\x5a\xb0\xc9\x33\xc2\x25\x9f\xda\x2b\xd9\xae\xfa\x25\xa1\x8c\x44\x6f\x4f\x59\x91\x64\xed\x9e\x7d\x65\xa3\xf3\x95\xdc\x76\xe0\x4d\xe8\xc7\x43\x18\x5b\x06\xb9\x96\x83\xe9\x64\x15\x65\x4b\x5e\x24\x56\xa8\xb7\x93\xff\x8d\x47\x70\x1b\x73\x5d\xc2\xb9\xc1\x76\x0a\x81\xc9\x83\x08\x66\x43\x3d\x63\xa0\xc6\x3a\xe5\x34\x3e\xd8\x56\x2f\xf3\x87\xaa\xa9\x62\x08\x4f\xd0\xa1\x86\x1b\xe6\xa0\x36\xf5\x50\xaa\x42\x2d\xce\xc0\x6b\xd1\x30\x9b\x0a\x1b\x66\x5b\x6c\xf1\x07\xba\x11\xfb\x48\xed\xe4\x61\x3e\xd0\xa2\xf0\xf6\x96\x95\x70\x6c\x94\x65\x66\x4e\xcc\x60\x7a\xb6\xf6\xd8\x51\xa4\x87\xb9\x40\xd3\xe5\xf2\x0b\x08\x8d\xb1\x16\x39\xfa\xc0\x68\x85\x85\xe6\xe6\x9c\x23\x3c\x76\x2d\xee\xcf\xc5\x3b\x18\x37\xcc\x8e\x9a\xad\x68\x61\xaa\x44\x7b\xae\x5e\x96\xe3\xf6\xd7\x0f\xfc\x1f\x32\x1d\xcb\xe1\xdb\xb5\x2b\x9c\x36\xb1\x69\x69\xf3\x1b\x8f\xe7\xc8\x6f\x87\x3b\x02\xbe\x7c\x62\xc6\xc0\xa0\x68\x12\x25\x99\xf7\x27\x59\x45\x1e\x2a\xab\x2e\x99\xfd\x46\xb2\x8f\x3a\x15\x03\xde\x23\x51\x58\x1d\x33\x25\xd4\xda\xd7\x2b\x1d\x0e\xf8\xc3\x6c\xb5\x15\x39\xb6\xb9\xe7\x16\x3b\x46\x85\xe2\x99\x12\x41\xc0\x9e\x8c\x41\xf1\xba\x0d\xc3\x7b\xeb\x64\x9b\x2c\xfe\x09\x4e\x9e\xa4\x76\xd9\x76\x90\xb1\x64\xc3\x4c\xcb\xb0\xb9\xaa\xeb\x05\xa2\xb0\xbf\x77\x6f\xbd\x3f\x42\xd8\xc3\xb7\x30\x95\xc4\xe6\xda\xec\x34\x45\x34\x47\xe4\x2b\x36\xa5\x17\x7b\x41\x7d\xba\xd5\xcd\xba\xd3\xfa\x8c\x4c\x8c\xeb\xd7\x64\xee\x9d\xf8\xad\x2b\xb4\xf7\x70\x51\x35\xce\xec\x97\x4e\xea\x9c\xad\x52\xfc\xc0\x41\x34\xee\xd7\x46\xc4\xb6\xea\x6a\x82\x85\x1d\x57\x18\x8f\x81\xe5\x42\x0a\x5a\xf7\x61\xd4\xeb\x87\x8d\x9a\x7a\xb7\x3e\x18\x55\x30\xf0\x38\xd8\xd5\x94\xf3\x00\x06\x79\x6e\xb5\xce\x89\xcd\xbd\x6c\x77\x54\x36\x55\x6a\x84\xab\xd9\xa8\xf0\x59\x72\x22\xed\xe8\x98\x16\x4d\xb3\x68\x6e\xd5\xfc\xff\x8b\xbc\xf5\x3f\xe6\x3b\xfa\x64\x8a\x99\xb0\x3d\x69\x4b\xc8\x98\xe1\x55\xe2\x50\x0f\xfa\x64\x6b\xeb\x8e\x45\x2f\x2c\xfa\xd8\x36\xd4\x01\xe8\x6a\xf0\x81\xba\xf2\x65\xcf\xab\xc4\xcc\xd6\x45\x08\x75\x67\x13\x6a\x24\xcc\xfe\x10\x10\xc8\x7d\x66\x1e\xc3\x55\xeb\x97\x75\xdf\x49\xaf\x0f\xa7\x2d\x7a\x89\xb5\x4e\x1a\xfe\xa1\x37\xb4\x3c\xf8\x42\x1d\xa9\x33\x52\x33\xf6\xa4\xce\x54\x17\xf6\xb3\x1d\xbe\xeb\x52\x9e\x1c\x22\x57\xff\x6a\x21\x1a\x76\x11\xd6\x96\x82\x3b\xec\xe1\xa4\xdd\x65\x9f\x82\xfe\xed\x64\xe5\x9f\x10\x28\x3c\xbb\xe0\xff\x46\x3d\x0f\x12\x25\x69\xa3\x75\x7d\xd4\xc7\x8a\xe4\x5f\x60\xd1\x6b\x69\x2e\x5b\x77\xe3\xf7\xc1\x86\x4b\xee\xa6\x1d\x38\x6f\x52\x0d\x59\x15\xf0\x95\x5f\xd7\xc6\x97\xfa\xb9\x85\x74\xb6\x99\x08\xbd\xd1\xba\x86\x49\x97\xc2\xcb\xba\x34\xb0\xb9\xd3\x14\xbe\x20\x15\x9f\x3c\xe6\x5f\xd6\xed\x7f\xea\x4a\xfd\x97\x57\x2a\x54\xdc\x24\x90\x92\xa2\x78\x22\x52\xfa\x71\x3c\xe6\x50\xc6\xd9\x8e\x58\x5d\xb7\xb4\x2f\xc4\x95\xd1\x32\x7b\xc5\x6d\xc3\x99\x65\xcb\x09\xcb\x00\x3f\x34\xef\x05\xd8\x23\xc5\x68\x53\x5c\xc8\xea\xaa\x57\x7f\x77\x6b\x96\x29\x05\xf3\x40\x38\x71\xa4\xf1\x54\x30\x08\xcd\x90\x93\xad\x7c\x89\x86\x32\xee\x6b\xa2\x0f\x61\x27\xea\xcb\x8f\x83\x7e\x81\x84\x6a\x96\xbf\xef\xf7\xb3\xfb\xff\xfa\x56\xce\xf2\xdf\x59\x06\x5c\x37\xb5\x9b\x5f\x02\x17\x5f\xf8\x91\x29\xc8\x17\xeb\x0c\xcf\xd3\x4f\xd1\x8a\xfe\xb1\x89\x58\x5f\xfa\x07\x5a\x34\x57\x09\xd9\x22\x68\xab\x96\xf7\x92\xca\xb4\xc2\xb6\xca\x87\x79\x65\x58\xf0\x1b\xc5\x3c\x8f\xd1\xe4\xda\xbf\x31\x58\x34\x68\x6c\xa3\x37\xd0\x53\xde\x06\xc2\x97\x63\x30\x6f\x70\xd1\xbc\x4f\x06\xc5\x91\x4f\x4b\x6f\x29\xb8\xdf\x3c\x27\xdf\x79\xee\x14\xdb\x2b\x1b\x28\xd7\x17\x71\x94\xde\xa7\x7d\x7a\xb6\x1c\xde\x52\x01\xbd\x71\xfd\xee\x11\x31\xc2\xe9\xfa\x9d\xb8\x0b\x7a\xd3\xa1\x94\xef\x82\x94\x5b\x98\x67\xa9\x2f\x66\xf3\xae\x3c\xe4\x5e\x25\xec\xb1\x61\x93\xc5\xfc\xdd\x59\xd1\x24\xab\x57\xa1\x2c\x88\xac\x9e\xfa\x9c\xf2\xc6\xc2\x4c\xfd\xb2\xf7\x1e\x42\x25\xd1\x22\x5e\x10\x3f\xb1\x79\x55\xaf\xd6\xdc\xb2\x33\x70\xfd\xa7\xed\x15\xfa\xc5\x97\x4d\xba\x73\xeb\x70\xf1\x18\x61\x9c\x2f\x21\x93\xf5\xfb\xf5\xef\x03\x1b\x0b\xff\x3d\x42\x4b\x59\xa3\x13\x6e\x5b\x5a\x52\xf6\x6e\x25\x0e\xde\x1e\x28\x43\xf1\x52\x73\x89\xbd\x91\x7f\xc0\xc7\x17\xcd\xba\x77\x21\xb6\x72\xcf\xfc\x09\xec\xe8\x93\xd3\x1d\x93\xd3\x3d\xcd\x08\x65\xf1\x3d\xfd\x8d\x70\x3e\x99\x03\xde\x61\xba\x7a\x2b\xb3\x37\x6c\xe1\xd0\x72\xef\xbf\x1f\xef\x53\xbc\x21\x32\x50\x6a\x6b\xe5\xb7\x89\xdd\x77\x6b\x41\x81\x73\xf4\x60\x83\x6a\x4f\xe1\x83\x55\x23\x0d\xd7\x8a\xf6\x2d\x9e\x84\x98\xa2\x48\xbb\xcd\xf4\x39\xb3\xc1\xdf\xb5\x24\x29\x85\x22\x1f\x24\x4b\xc2\x94\xb5\x41\xb5\x51\xb3\x7c\xb2\xe1\xd2\xdc\xb1\xf6\x60\xed\x60\x2c\x3a\xcd\x75\x2a\xfa\x16\x09\xb9\x7e\xc3\x91\x95\x74\x5b\xac\xc4\x27\x0e\xeb\x4d\x27\xbd\xe2\x2e\xdf\xdd\xab\xb9\x4c\x5c\x00\x4b\x9a\x60\x28\x52\xd8\xd1\x79\x8a\xde\x12\xdf\x31\xbc\x7e\x67\x0e\xc2\xf3\x6a\x68\xc7\x3d\x46\xc3\xfc\x3f\x36\x9b\xec\x7b\x08\xdd\x10\x85\xf2\xa8\x6f\x4b\x28\x89\x86\xa1\xfe\x7f\x54\x5d\xe9\x92\xb3\x3c\xaf\xbc\x97\xf9\x7d\x6e\xca\x80\x03\x0c\x8b\x79\x01\x27\x4f\x72\xf5\x47\xad\x6e\x39\xf3\x55\x4d\x15\x0a\x01\x86\xb0\x78\x91\x7a\x91\x0c\xd5\x9b\x47\x47\xca\x64\x55\xa4\x9e\xd3\xa2\x45\x15\xa7\x80\x53\x41\xd9\x4a\xd5\xa6\xac\x46\xfd\xca\x6d\x40\x7e\x61\x18\xc5\x32\x5f\x3f\xa1\xea\x7c\xc5\x1d\x00\xa8\xe5\xbc\x3f\xdf\x8f\x9c\xcf\x51\xd5\x8a\x41\xb8\x96\x40\xdd\x4a\x60\x64\xaf\x48\xdd\x31\x6f\x47\x4d\x6a\x0e\x05\x33\x4a\x5d\x29\x4c\xb1\x27\x49\x3d\xd6\x6d\x3f\x2b\x91\x38\xc8\x33\x1f\x2c\x41\x61\xf4\xd7\xd4\xae\x46\x45\x83\x0d\x95\x48\x32\x72\x1f\x5f\x46\x1b\x0b\x54\x84\x1c\xda\xe8\xfd\xd3\x5c\x44\xde\x89\xae\x1d\x5e\xc6\xf2\xe5\x3c\xb0\x66\xc5\xe4\xde\x95\x12\x39\x44\xfb\x4c\xae\x17\x26\xa7\xdf\xf2\x13\x2d\x44\xb2\xc7\x77\xdd\x77\xd1\x85\x64\x06\xbc\xed\xf2\xfa\x9d\xc2\x3f\x58\xfa\x57\xfd\x22\x6a\x34\xa0\x3d\x1b\xeb\xce\xe7\x2c\x4a\x1b\xca\x4d\x64\x0f\x39\x8c\xe5\xc1\x32\xd2\xbf\x93\xa3\xc3\x53\x0a\xd0\x67\x56\xa1\x2c\x53\x2d\x06\x2c\xc3\x07\x4b\x45\x48\x28\x90\x55\x94\x25\x6d\x6a\x01\xa6\xe7\x1e\x85\xfd\xc7\x2b\x7c\x45\x40\x12\xee\xcf\xd4\x6c\x44\xc8\x79\x82\x3b\xb6\x2f\xf7\xc1\xaf\x27\x34\xaf\xe6\x6f\x4d\x8a\x6e\xc6\xc9\x1e\xc4\x39\x02\x5f\xca\xcd\xef\xd4\x2c\xcd\x9a\x1d\x66\xf5\x30\xc7\x13\x73\xeb\x3f\x38\x39\x06\xa1\xe9\xa8\xbf\x85\x0a\x59\x20\x58\xa8\x98\x73\xba\x3a\x2e\x23\x9b\x35\xa9\x56\x35\x4a\x21\xab\x91\xa1\x0e\xbb\x16\x2c\x4a\x9d\xb7\x26\xfe\xd0\xc1\xe2\xaa\x03\x6a\x5c\x8c\x58\xd9\xb1\xe5\xaf\x1b\xd2\x1e\x65\x3b\xbc\x8a\x72\xac\x75\x50\x89\x2a\xaa\x56\x36\xcf\xaf\xd4\xad\x9a\x3f\x5a\x13\xe6\x67\x47\x60\x7d\x51\xa7\x3a\x25\x84\x35\x89\x61\xa4\xc4\x8d\x4d\xc6\x2e\x71\x26\x8f\x89\x3e\x47\xc8\xe4\xb3\x67\x3e\xb2\x9c\x54\xe0\xad\x28\x7c\x1e\xe5\xb1\x58\x8c\x3a\x1f\x51\x38\xca\x2e\xe6\xe5\xd1\x3e\x15\x8d\xc4\xed\x2d\x95\xa2\xd6\xba\x86\xc1\xc8\x93\x82\x06\x30\x4b\x66\x19\x0a\xcc\xcb\x59\xb6\xc9\xa7\x32\x33\xc7\x17\x3f\x07\x66\xd1\x2f\xcb\x50\xed\x5f\x84\x0d\xfa\x91\x7e\xfd\x60\xe5\x55\x2f\x74\x6a\x61\xb8\x80\xdc\x1c\x2b\x4c\x8e\xf6\x42\x10\xe8\x55\x97\x27\xd6\x64\xb6\x64\xcd\x42\xfc\xc3\xf0\x92\x74\x57\x0f\x31\x08\x92\x8b\x00\xa7\x8a\x6b\xb8\x7f\x05\xe8\xf6\xba\x1e\xae\xa5\x85\x51\xa4\xdf\x62\x2f\x55\xf9\x6b\xb7\x97\xb3\xa9\x75\x0d\xde\xaa\xed\x24\x75\x51\x9e\xeb\x27\xc4\xb9\x7c\x0b\x37\x2c\xf5\x40\x6e\x28\x98\x18\xb3\xf6\x85\x49\x91\x97\xb2\x00\xca\x20\xf3\x6a\x77\x1b\xe4\x81\xc9\xf6\xad\x5e\x3e\xd1\xda\x50\x41\xe5\x32\x95\x85\xd1\xc6\xfc\xed\x56\x6d\x3c\x29\x0e\xd2\x7e\xff\x2a\x94\x08\xb6\xdb\xa4\xb0\xcc\x60\x11\x6b\x60\x60\xa6\xa9\x78\x65\x03\xfa\x21\x97\x3e\xd6\xa3\x10\x34\x9e\x51\xfd\x4a\xfb\xfb\x1b\x0e\x3a\xc8\xcc\x89\xed\x46\xfc\xd1\xe6\x15\x56\x16\xb3\x6e\x39\xa3\x68\x14\x68\xc1\xaf\x44\x97\xa1\x01\x56\xe4\xa1\xee\x7c\xa5\xaf\x4d\x33\x6a\xe9\x3c\xd1\x2c\x6a\xc2\xd6\xc4\x3c\x36\x38\x25\xb0\x52\x85\x7c\x0f\x7f\x7f\x5e\x47\x3c\x2a\x52\x04\x6b\xbc\x18\x54\xb5\x5a\xdc\x3b\x1a\x8f\xa5\x28\x7b\xfe\x55\x7c\x82\x4a\x8f\xea\x48\x76\x63\x54\x82\xeb\x47\x78\x74\xa8\x94\xd2\x8f\x73\xd7\x85\x64\x98\xb5\xd6\xb2\x52\x41\x82\x44\x3b\xda\xb4\xfa\x8c\xca\x56\x8f\x24\x67\x14\xbf\x80\x23\x53\x0d\xa7\x87\xb7\x63\xf3\x50\x01\x4c\x53\x3c\xa4\xb7\x0a\x36\xff\x82\xb2\xf4\x8a\x42\x93\xfd\x03\x55\xbd\x5c\xcf\x3a\x56\x5b\xac\x62\xcf\x7d\x55\xf9\x34\x6d\xe9\x62\xbd\xd6\xcd\xa0\xb9\x24\x31\x03\x81\xf8\x51\x71\x8e\x98\xde\x68\x9b\x7e\x66\x07\xcb\xd0\x83\xbd\x95\x3a\xad\x9b\x7a\x87\x63\x74\x78\xb3\xec\x32\x5e\xf1\xec\xb0\x6b\x39\xfe\xb0\xec\x94\x54\x0a\x5b\x51\x9c\x66\x24\x38\x38\x6a\x51\x34\xe6\xd8\x52\x0f\x35\x38\x86\xcc\x4c\xac\xe1\xc2\xbb\x72\x32\xbe\x56\xb4\x26\x3e\x38\x5d\xab\xf2\x58\xa8\x36\x51\x11\x0c\x6d\xa4\x17\xa7\x00\xf2\x94\x42\x99\x3d\xf7\xd1\xfb\x43\xa4\x4c\xd6\x23\x45\xbe\xcd\x6b\xf9\x22\xa4\x31\x16\x3a\x09\xf1\x5b\x9b\xe2\x13\x74\x26\x58\x81\x77\x7a\xa1\xd7\x76\x9c\xcd\x75\xf0\xe5\x5e\x23\xab\xb8\xce\x9a\xc3\xc3\x6b\xe5\x12\xed\x2b\x77\x41\xbb\x0a\x55\x35\x14\xb1\x52\x44\x2a\x77\xe5\xa7\x9c\xb4\x91\xd8\xe2\x32\x8a\x8d\x2b\x11\x9d\xfe\xff\x9d\x49\x2d\xd2\xd7\xe5\xb0\x0f\x3b\x8b\xf0\xbd\x16\x45\x7c\x95\x00\xaf\xbd\x91\xb4\xde\x5a\xe9\x5d\x1b\x76\x2c\x4e\xfe\xe1\x86\x8f\x1c\xbf\x27\x4b\x6c\x77\xcd\x29\x4a\x68\xd1\x9a\x59\xb4\x85\x2d\xf6\x47\x95\xad\xe7\x5c\xa2\x92\xbf\xe2\x21\x54\x0d\x2d\xc4\xd8\x6c\x12\xc0\xc2\x98\x2e\x42\x0a\x77\x98\x10\x77\x5c\xc3\x76\x6a\xa5\x26\xb4\xb7\xbd\x78\x27\x58\x23\x93\x25\x30\xea\x66\x57\x69\x15\xb4\x1f\x71\xc7\xe2\xbb\x50\x75\x4b\x23\x9d\x71\xec\x21\xaa\xbb\x20\xaf\xb0\x89\x41\xeb\x73\x33\x96\x27\x4e\xea\x08\x22\x59\x53\x5a\x3c\x31\x0e\x85\x26\x5f\x64\xc1\x5e\x60\x18\xc3\x82\xd7\xe9\xbe\x17\x0b\xec\x85\xf9\xb9\xb0\x78\xf6\xad\xac\xe5\xca\x0e\x75\x29\x4f\x82\x32\x97\x72\x7c\xcb\x57\x45\xea\x8c\xa0\xa2\x91\x40\xb9\x48\x30\x64\x89\x14\x1b\x1c\x61\xd4\x13\x2d\xf2\xe6\x5b\xbc\x4e\xf1\xe3\x22\x6d\x7d\xb0\xc7\xce\x2b\xd4\x63\x16\xc7\x55\xb0\xaa\x26\xf9\xa4\x25\xcc\x7e\x97\x1c\xf5\xb6\xed\x58\x65\x14\x83\xbe\x29\x34\x18\xed\x8d\x6e\xac\xb6\x9c\x48\x30\x8b\x0d\x31\x55\x67\x21\x6e\x23\xba\xfe\xb7\xde\xac\x03\x39\xc3\xec\x24\x55\x2c\xb4\x5e\x7e\x53\xc3\xb8\xfd\x26\x9a\x2e\xcf\xd7\xe2\xad\x38\x50\x88\x27\xa1\xdd\xf3\x42\xf1\x5a\x1b\xc7\x7a\xe5\xe4\xdd\x48\x56\x6f\x56\xa5\xa7\x7a\x25\x39\x87\x07\xcd\x02\x23\xed\x18\x8a\x4e\x35\x46\x05\x93\x84\x32\x26\xcf\x7b\x90\x0b\xf6\x26\xc9\x0c\xf9\xd2\x39\xaa\x6c\x61\x51\x8b\x2a\x9b\x2f\xc4\x38\x44\x01\xed\xe2\xb2\xa9\xac\x95\xb5\x15\xef\xd6\x21\xb7\xb0\x93\x34\x5c\xbc\x23\x10\xe3\xf5\x13\x83\x34\x65\xf3\x74\x19\x44\x00\x5b\x55\xac\xfb\x3a\xc5\x64\xa1\x8e\x5c\xc2\x36\x28\x58\x79\x18\x8f\xe0\x9c\x59\xeb\x2e\x65\xe2\x49\x32\xe3\x28\x8d\xbd\xa8\x1c\x3f\x49\x49\x74\x6a\xa4\xc4\x09\x98\x68\x1a\xb9\x5c\x61\x49\x8a\x82\x98\x0d\x62\x1f\xaa\x84\x85\x4c\xdc\x79\x8a\x21\x76\x1e\x5a\x0e\x73\xe8\xc5\xad\x34\x28\x5f\x57\x49\xbd\x01\xf1\xa0\xba\x56\x98\x48\x4d\xae\x0a\x19\x94\xb6\x14\x6c\xba\x94\x0e\x9a\x36\x8d\x55\x86\x56\xa3\x9b\x07\x8b\x77\x55\x49\xa0\x1f\x6b\x64\xcc\xc6\x3a\x48\xac\xed\x94\x71\xf3\x78\x42\xbd\x47\x91\x7e\x33\xa8\x62\x45\x72\x70\x59\xcf\xed\x78\x46\xb1\xc9\xba\x7c\x2f\x60\x95\x53\x2c\xb1\x73\xe4\x80\x75\x2c\xe5\x0a\xe6\x18\xd1\x33\xa3\xa4\x56\x00\xa6\x69\x59\x37\x74\xcd\x90\x37\xf3\x33\x03\x6a\x4b\x1d\x88\xc5\xc3\x4b\xa6\x31\xe8\x39\xfd\x90\xf3\x6a\xf7\x43\x6f\xe1\x88\x5b\x4b\xa2\x98\x3a\x07\x97\x8b\x63\x95\x4b\x39\x77\x15\xc7\xa8\x25\x77\x4b\xb4\x66\x4c\x41\x6f\x01\x77\xac\x44\xa5\x2c\x82\xf0\x92\xb1\x57\x49\xa4\xcc\x31\xb2\xd1\x16\xb8\x90\xf6\x08\x86\x46\x94\xa1\xea\x1f\xd9\xfb\x50\xed\x94\x76\x8e\x2b\xc9\xb1\x86\x75\xfe\x29\xa5\xb1\x44\xa1\x72\x05\x2b\x69\x2f\x55\xd4\xaa\xda\x91\x07\xf0\x87\xe7\x38\xab\x72\x76\xaa\x24\x6d\xed\xe4\xa0\x60\xbe\xc8\x3d\xe3\x5c\xfe\x61\x43\x16\x96\xb3\xc0\xb4\x56\x8d\x13\x5e\x34\x28\x0d\xfb\xfa\xf9\x0a\xf9\xe1\x47\xe4\xa9\x1e\x73\xd8\xf0\xa2\xb0\xe6\x17\xec\x91\xd9\x79\x3e\x9c\x30\xa9\x3c\xcb\x03\x4f\x78\x50\xc1\x1f\x3e\x34\x61\x85\x0e\x30\x97\x29\xae\xa1\x97\xc8\x9c\x28\x76\x35\x73\xb9\x46\x24\x42\x81\x5a\xba\x39\x20\x68\xfa\x0d\xcc\x0b\x7f\x54\x5e\x06\x52\x0d\x72\x48\x45\x5a\x67\x18\xdc\x30\xa6\x8a\xb9\x5d\x22\xab\x22\x27\x9a\xb4\x0d\x95\xf2\x3c\x43\xdd\x91\x32\x24\xbd\x0c\x30\x45\x96\xb9\x64\x69\x3d\x54\xde\x01\x5b\xb2\xb2\x84\xe4\x3f\x8b\x64\xa0\xab\x88\x4e\xe6\x4d\x97\x8d\x7e\xd7\xc6\x17\x13\x72\x69\x28\x9b\x37\xa3\x43\x81\xa4\x57\xd1\x14\xd1\xcf\xc9\x57\xc3\x96\x9c\x3b\x07\xbb\x78\x98\xd7\xba\xae\x51\xf8\x8a\x4a\x97\x8f\x10\x3c\xba\x38\xa0\xb7\x60\x2f\x72\x7b\x85\xff\x4c\xbd\x59\xaa\x05\x87\xac\x4a\x82\xee\xec\xde\x9e\x76\xf1\x0f\x3b\xdb\x07\x6b\xff\x74\x0e\x39\xcc\xe9\x50\x2c\x0b\x26\xda\x2a\x99\xa8\x21\x10\x61\x43\xfe\xad\x32\x83\xf7\x9c\x26\xd7\x11\x93\x32\x40\x67\x88\x5f\xc9\xc9\x67\x80\x90\x07\xbf\xfa\xaa\xe2\xf5\x75\xe6\x77\x21\xeb\x62\x33\xe0\xeb\xad\x25\x37\x96\xbb\xea\x90\x5e\xbc\x0f\x78\x5a\x06\x71\xba\x86\xc6\x0c\x19\x42\x79\x78\x80\x06\x16\x03\x96\xf0\xfc\x94\x6d\x64\x21\x06\x55\x25\xc8\xce\x96\x60\x7c\x65\x86\x49\x7a\x28\xfd\x59\xe7\xe5\x9a\xe8\xc5\xe3\x55\xb8\xf0\x9c\x39\xa3\xc5\xe9\x31\x12\x78\x33\x78\x84\x7f\xce\x4c\x51\x91\xfe\xcc\xd6\xc7\x73\x96\xda\x17\x8d\xb3\x51\x88\xe3\xa4\xd2\x46\xb9\x36\xdf\x29\x32\xa7\x07\x1f\xc5\x9d\x01\xdc\xd1\x7e\xe7\xa6\xd1\x95\x48\x49\x4f\xc7\x2f\x5d\xd7\x3c\x72\xc8\xe8\xe8\x57\x11\x41\x7a\x52\xb1\x7a\xf8\x41\xb3\x32\x87\x4e\xcc\xbf\x41\xfd\xcd\x8f\x3f\x41\x96\x99\xc5\x39\x74\x32\x2c\x15\x42\x2b\x85\x92\x78\x13\x9b\x25\xd0\xdd\x7c\x09\xa3\x68\x52\xec\x6c\x30\xae\x72\x1b\xd2\x22\xfe\x0b\xf3\x10\x5c\xb2\x77\xbe\x23\x7c\x41\x9a\x51\x45\xba\x27\xac\x6c\x64\x4b\x6f\x5d\x01\x01\xb0\x20\xbc\xad\x73\x78\xe5\x9c\x7f\xab\x73\x5f\x42\xdf\xb7\xac\x62\xe1\x18\x72\x7d\xf8\x7f\x1f\x71\xda\x82\x8d\x97\xd6\x10\xc2\xf5\xe4\x8f\xbc\x7c\x6c\x1a\x91\x46\x9d\x11\x8d\x91\xc2\x97\xaa\x7b\x4f\xad\xa0\x17\x52\x7e\x6d\x49\x8f\x3b\xf8\xe9\xcc\x61\x94\xcf\xf1\xb2\x17\xf8\xa2\xfe\xd7\x26\x95\x80\x52\xc3\x82\x04\xe1\xf9\x6e\xb5\xba\xad\x15\xf0\xec\x14\xa8\x0c\x67\x61\x54\xef\xca\x15\x06\x86\x16\xeb\xd4\x41\x87\x53\x16\x17\x8a\x63\xd1\x95\xba\x8d\x7e\x44\xfb\xf5\x35\xcc\x91\x7f\x9e\x33\xe1\x32\x83\xf1\x8f\xb4\x5f\x14\xf8\x36\x11\x91\x3a\x38\x37\x35\x1b\x9e\x02\x99\x76\x0f\xae\x28\xfa\x9d\x55\xe5\xa7\xa6\x53\x23\x01\xa0\x8b\xe1\x18\x76\x3e\x45\xa6\xc5\x9d\x30\xbf\xce\x7e\xd3\x6f\x28\xaa\x6d\x58\x20\xf9\xbf\xf2\xf6\x7f\xa8\x6a\x57\xa3\xa0\xcd\x50\x90\xfd\x61\x59\x90\xdf\xc0\xad\x59\xba\x7e\x1f\x5e\xef\x4c\x51\x99\xae\x65\x8e\x9c\xa6\xc6\xaf\xc0\x43\x5c\xf5\x6d\xaf\xf3\x09\x9d\x2d\x0b\x9a\x7b\xcf\xba\x3b\x42\xb0\x73\xd0\x03\x2b\x82\x84\xb6\x41\x11\x90\xd5\x01\xd6\x0b\x95\xc4\xef\xb2\xa6\xc1\xac\xf7\x69\x1f\x8f\x19\x9c\x5f\xa3\x9d\x2e\xab\x6a\x68\xbd\x97\xa2\xfd\x29\x43\xfd\x0e\x25\x26\xd5\xf5\x00\x3b\x0c\x91\xc0\x60\xb8\x5d\x04\xcd\x27\xcc\xc8\xfd\x19\xb5\x48\xd2\x42\x4e\x73\xdb\xed\x76\xea\x26\xda\xb1\x59\x0e\x3c\xb7\xb0\x14\x77\xf3\x2f\xb6\xc3\xee\x58\x18\x08\x13\x7d\xf0\x4a\x9e\x2b\xe2\x7b\xef\x15\x80\x06\x2f\xee\x09\x77\xee\x56\x9a\x7e\xd4\x0d\x49\x3a\xb2\x56\x41\x8f\xe3\x41\x21\x81\x8c\xe1\x35\xeb\x7a\xf2\xf9\x59\xd9\x3f\x24\x70\xc4\x3c\x6d\x9b\x5c\xca\x17\x41\xf6\x04\xb7\x4c\x7a\xfa\x5e\xd7\x28\x75\x83\xe0\x00\x89\xa5\x8f\xcf\x8b\xed\xef\xa7\x62\x1c\x86\x60\x3e\x9b\xa4\xe0\xc8\x8b\xf8\x99\xdd\x34\xc3\xa5\x08\x91\xd8\xf7\x13\xfa\x10\xc7\xfe\xc9\xec\x22\x3f\xe9\x9d\x7a\x5f\x9e\x01\xc5\x26\x2b\x8e\x02\x3c\x28\xf5\x71\x96\xf5\x92\xe9\x3c\xac\x74\x82\xf2\xc6\x5f\x83\xa1\xf5\xc9\x1a\xe0\x3a\x90\xd0\xc6\xd9\x17\x96\xe2\xa1\x79\xb3\x44\x0d\xc1\x79\x97\x1d\x8a\x45\xb1\x2a\xa0\x6f\xa2\xbb\x79\x38\xcd\x41\x51\xa5\x02\x21\xc9\x75\x6e\xce\xe1\x49\xec\xd7\x14\xf3\xf7\x97\xad\x08\xbe\xdb\xfe\x91\xec\x20\xeb\x80\xae\x28\x28\xae\x1c\x35\x9d\x5f\x8d\x75\xf3\x92\x97\x95\x93\xd9\x54\xf2\x1b\x64\x3b\x53\xf6\x53\x43\x10\xba\xe2\x78\x35\xae\x50\x64\x08\x39\x4e\x1b\xe8\xb4\x12\xdf\x2a\xcb\x1b\x0b\xfb\x59\xe4\xb6\xbb\xaa\x5f\x50\xcc\xa8\x69\x0c\xae\xac\xc0\x58\x34\x15\xc9\x99\xbb\xd3\xcd\xa7\x85\x52\x57\x64\xcd\x8f\x26\x4b\xaa\xff\x45\x96\xe3\x09\x73\xc9\xbc\x44\xd4\x75\xda\x01\xa5\xbd\x9e\xd5\xc3\x55\xcc\x3a\x62\x90\xaa\xbd\x5c\x7e\xc3\xea\x71\x4d\x5e\xae\xaa\xdb\x63\x25\xa0\xf0\xbe\xea\x2f\x59\x6e\x6f\xd2\xa0\x6e\x78\x4b\x15\x06\x4d\xb7\xe7\xb6\xbe\xca\x5f\x2c\xe8\x13\x0a\x86\x7c\x17\x15\x10\x61\xa8\x3e\xee\xe2\xc5\x9d\xb1\x4c\x92\x28\x6c\x8d\xde\x5d\x36\x19\xee\x5c\xa1\xd3\x7a\xcf\xfb\xd2\xa2\x41\x41\xbf\xec\x85\x51\x27\xdc\x12\x22\xea\x18\xbb\x0f\x5e\x7b\x55\xd1\x45\x6e\x51\x9a\xbd\xa7\x50\xf1\xf5\x88\x23\x39\x7b\x08\x2a\x59\xa1\x37\xa6\xee\xfc\xc5\x79\x94\xcd\xcb\x0d\x8c\x99\x5a\xe2\x3b\x55\x65\x93\xee\x3f\x6e\x53\x77\x6a\xbc\x3b\x4f\xb2\xf5\x5c\xd9\x15\x56\xee\xaf\xf7\xa1\x7a\xd4\x5b\xff\xfb\x7a\x69\x90\x78\xd9\x93\x1f\x25\x0a\x1b\xf1\x0c\x51\xfa\x0a\x12\xd0\x55\x4f\xa7\xcc\x50\x02\xb1\x79\xe0\x54\xca\x82\x5d\x75\x1c\xb4\x42\x35\xbe\x2a\xeb\x5c\xf0\xe3\x5b\x09\xb4\x1c\x8a\x40\x95\x09\x4d\x28\x62\x45\xc9\xbc\x73\x09\x49\xed\x96\x42\xbc\xfa\xba\x09\xe5\xf5\xd3\xbc\xed\x26\x53\x52\x0f\x51\xcf\xe0\x11\x47\xb2\x2b\x25\x01\x3d\xb2\xfb\x82\xd0\x37\xad\xe1\x1e\xe4\xd4\x3e\x11\x08\xb3\x38\x58\xfc\xe4\x16\xa8\x2a\x9d\xae\xc1\xf6\x3a\xce\x34\xba\x5e\xc8\x75\xb0\x9d\xb9\x8e\xf9\xab\xba\xc8\x3a\xdb\x91\x50\x32\xe6\x19\x1c\xaa\x71\x5b\x80\x41\x80\x7f\x5f\x9a\xd3\x8f\x18\x5b\x2e\xc1\xc8\x13\xda\xf3\x3a\x9e\x52\x5c\xdc\xb3\xc6\x2a\xd7\x46\x08\xe4\xb5\x8a\xe8\x8c\x1c\xf1\x22\x6b\xa6\xf9\xf4\x6a\xb4\xbd\x18\x71\xfd\xec\x15\xb9\x55\xb3\xd0\xeb\x82\xc7\x81\x68\x07\x9b\x8c\xbc\x36\x51\x13\xa1\x14\xc3\x65\x38\x28\xb9\x22\x0c\x9e\xbb\x6b\x3c\x45\xdb\x7b\xd0\x07\xe2\xca\x87\x26\xfb\x57\x16\xf8\x1a\x81\x7e\x5c\x4e\x8d\xba\x67\xc3\x65\xf1\x31\xad\x49\x71\x2a\x21\x4b\xa9\x3f\xdf\x2a\xaa\x7e\x3c\x3e\x09\x00\xe8\x7a\x8c\x51\x0d\x2d\x50\xcb\x0f\x99\x46\xe4\x0e\xd4\xae\x82\xc8\xd7\xd4\x22\xfb\xf6\x62\xb8\x24\xe3\xac\xa3\x20\xb5\x32\x86\x52\x62\xd5\xab\x61\x91\xf8\x06\x57\x9b\x8b\x5f\x40\xea\xdb\x88\x5a\x64\x3e\xbc\xbc\x0f\x5e\x2a\x60\x7c\x19\x70\xde\x77\x25\xe5\x30\xaf\x44\x52\xc4\x95\xbe\x44\xc5\x44\x9d\xe6\xf3\xed\xed\x96\x35\x41\x89\x54\x3f\x4d\x74\xa1\x72\x20\x22\x1f\xe6\x83\x51\x05\xd5\x15\x38\x69\x2b\x75\x16\xa9\x97\x82\xdf\xd7\x58\x7f\x5c\x6e\x7a\xed\xce\xf2\x2b\x66\x5c\xe9\x27\x6d\xdc\x79\x69\xf0\x47\xba\x8b\x34\xed\x29\xcc\x1f\x41\x30\x81\x5c\xbe\x9d\x7e\x4a\x08\x34\xed\x05\x64\x83\x15\xd8\xe8\xbb\xce\xb9\x4b\x2c\xae\x3e\xc3\x3b\xc8\xcd\xe2\x7e\x58\x5d\x95\x9c\xc3\x99\xc3\x0f\x28\x13\xb5\x0a\x87\x50\x99\x01\xdd\x4c\xfe\x41\xbe\xe3\xc3\x7a\x6a\x28\x7a\x9d\xcd\x30\xe0\x4c\xa4\xa1\x9c\x32\x65\x12\xdb\xe6\x4c\x54\x93\x4c\xfd\xc2\x01\xf9\x29\xc7\xa8\x13\xe2\xe4\xe1\xa6\x94\x3a\x07\xe1\xfd\x57\x9d\xc6\xef\x35\x3d\xe0\x3f\xbc\xca\x57\xf7\x41\x8c\xbf\x5b\x37\xf7\x80\xf2\x35\xe1\xcd\x70\x16\xaa\x77\x33\x19\x1a\x51\xf2\x65\xe9\xf4\x3d\x30\x8b\xe9\x9a\x8c\x2a\x95\xa2\xb2\x9a\x6e\x99\x08\xe9\xd9\x3c\xe0\xc1\xc1\x52\x28\xa0\x91\x94\x56\x64\x75\x1a\x96\x42\x49\x93\x37\x6b\x9c\xe7\x10\x65\x94\x1f\xbb\x3d\x95\x7d\x39\x58\x5f\x45\x77\xc2\x28\x7e\x13\x2a\xac\x89\x81\x3c\x57\xa0\xdd\xc8\xfd\xfa\x9e\xf3\x05\x94\x53\x43\xb2\xf1\xce\x8d\x11\x48\x12\xc9\x01\x2f\x32\x7e\x79\x42\x7b\x49\xc5\xd4\x18\x0c\x1d\xe8\x1a\x28\x4e\x99\x99\x03\x80\xb6\x6e\x33\x55\xca\x5f\x41\x9c\xa3\xbd\x15\x87\x3b\x47\xb3\xda\xba\x6b\x00\x77\x04\x3a\xcd\x02\x32\x20\xd9\xa2\x1e\x61\x24\x77\xa4\x41\x8f\x3b\xdc\x0b\x59\x84\xd3\xd0\xa0\x9c\xf1\xf2\xba\xda\x80\x73\xfe\xd0\x3d\x73\x29\x26\x1f\xb7\x5c\x60\xde\x8e\x60\x4a\x3e\xfd\x0f\xda\x26\x96\x34\xe6\xf0\xf2\x69\x79\x7d\x75\x19\x7d\x08\xe1\xdc\x7a\x91\xff\x9c\x6a\xba\x97\x51\x36\x47\x50\x0b\xf1\xd2\xe8\xdc\xb3\x7d\xb3\xa0\x57\xd1\xf4\xeb\x92\xb8\x43\x1e\x23\x92\xb4\xf6\x61\xcc\xd1\x78\xef\x9e\xf9\x8f\xff\x97\x45\x48\x01\x41\xf0\xd2\x92\x0b\x55\x76\x33\x67\x65\x40\xb1\x52\xb2\xb0\xba\x0d\x1d\x23\x5d\x60\x8b\x84\xc5\xdd\xc2\xa1\xd4\x02\x89\x3c\xd6\xfd\xad\x35\xd0\x47\x22\x89\xf0\x8e\x42\xab\x3d\x4a\x62\x07\xa2\x99\x6b\xd4\x43\xd7\x2d\xc2\xe5\x5f\x45\x24\x04\x16\xc1\x03\x91\xf6\xfc\x31\x4e\x7b\xab\xcd\x6e\xf5\x6c\x85\xda\x14\xdc\x43\x25\x1a\xb7\xd2\xea\xd4\xdb\x9a\xfb\x0f\x8b\x7b\xf3\x9b\xfd\xc5\x36\xdf\x91\xe5\x6f\x9a\x67\x5b\x7b\x9c\x11\x91\xd8\x88\x02\x60\xe8\x48\x4e\x59\x0c\x5a\x67\x66\x6f\x2c\xe6\x92\x51\x97\x75\x4b\x95\xc7\x72\x79\x49\x11\x02\x33\x69\xf5\x5b\xfe\x52\xd3\x32\xec\x68\x83\x8f\x98\x59\xe2\xdb\x90\xf5\xe6\x21\x42\x6e\x65\x8b\x77\x75\xcb\x83\x4d\xfe\x9d\xac\x99\x99\x1e\x01\x23\x51\x1b\x61\xf0\x10\x25\x62\x88\x51\x8a\xc3\xb7\x85\x90\x8a\x85\x59\xd5\xdb\x2d\x11\x25\xb4\xd9\x23\x24\x41\xcb\xb1\xbc\x9a\xe0\xa4\x3d\x1d\x8a\xe1\xfc\x4c\x9e\x65\x0f\xde\xa9\x8a\xc6\x48\xf4\x30\x08\xb3\xc5\xad\xef\xc4\x45\x14\x58\x6d\x4b\x6f\xbb\x69\x64\xea\xbd\x73\x15\x01\xf0\xaa\x2c\xac\x5e\x95\x95\xd3\xf6\x00\xa5\xf3\x13\x5c\xd3\xe4\xc8\xe3\xd0\xac\x54\x41\x04\xf5\x59\x6b\xe5\x1e\x3f\xdf\x0a\x6d\x23\x10\xda\x60\x18\x73\x52\x56\x50\xad\x2d\x50\x51\x96\x86\x25\x9b\x63\xc2\x3c\x08\x33\x65\x2f\x9f\xa9\xd0\x0c\xfd\x68\x56\x66\xa5\x69\x8d\x80\x2b\x6c\xa2\x16\x46\x50\xf6\xe1\x7f\x08\x97\xa9\x1f\x4a\xe3\x21\x72\x36\x03\x22\x60\xd0\xf7\xca\xf3\x29\x1a\x5c\x79\x4a\x87\x6d\x75\x70\xc1\x8f\x97\x4e\x3f\x3f\xaa\xa0\xb2\x3a\x69\x4f\xd8\xb7\xee\xea\x68\xe5\xe1\xfe\x09\x3e\x60\x29\x54\xcb\xdc\x9a\xaf\x54\xee\x58\x05\xb5\xbb\x7a\xe7\x08\xa7\xaf\x79\xe9\xea\x8a\xeb\x08\xf2\xeb\x5b\x6b\x95\x08\xbb\x47\xbe\x14\xa3\x0d\x0a\x9a\x2a\xbf\x7e\xfd\x6c\x90\x58\x3b\xf9\xed\xac\x3a\x6f\x34\x07\x00\x3d\x84\xa3\x54\x58\x01\xad\x10\xd4\xad\x1e\xa4\x8b\x75\xd8\xd4\xb4\x35\x85\xd2\x5a\x61\x4c\xab\x92\xa8\xea\xbd\x09\x4e\x75\x51\x1a\xfd\x51\x61\x94\xe2\xa0\x10\x6f\x65\x89\xd7\x27\xf6\xb4\xec\x4a\x22\x14\xad\x5f\x47\xab\x72\xaa\x20\x3b\x9f\x97\x34\x37\x67\xa9\xbe\xac\x09\x25\x60\x0f\x6c\xe6\xa2\x62\x68\x9f\x3e\xdc\xbe\xab\x03\xff\x73\x47\x9c\x03\x5c\xb1\xf8\x4a\x42\x1c\xdb\xeb\x8e\x6f\x55\x47\xdf\xa2\xfe\xd5\x06\xc1\x45\xe8\x35\xc5\x3a\x49\x4b\x63\xf1\x8a\x83\x17\x31\x6b\x37\x13\xeb\xb9\x20\xeb\x14\x58\x47\x7c\x98\x88\xc1\x43\x3d\x55\x45\xd4\x5b\x5e\x59\xe7\x2e\xdd\xc8\xa5\x9c\x92\xf7\x2c\x92\xbe\x5b\x98\x0a\x5a\x58\x2d\x5b\x8a\x88\xab\xd0\x03\x65\xcd\xf5\x51\x32\xf7\x6c\x86\x38\x8b\x50\x03\x8b\x9c\x01\x97\xb5\x1c\x98\x0d\xa8\x54\xb8\x90\xfd\xf3\x13\x6c\x46\x0f\xf8\x92\xd9\x52\x7b\xb0\x13\x58\xe4\x70\xb1\x34\xf8\x23\x68\xc9\x11\x8c\x57\x8c\x17\xe1\xbd\x55\xb8\x76\x5d\x8f\xa4\xf2\x2e\xa0\x39\x7e\xf4\xf9\xb7\x95\x88\xc9\x95\x59\x20\xb0\x73\x53\xc1\x7a\x71\x6c\x7e\x14\x69\x81\xc4\xd3\x7f\xca\xee\xe1\xc1\x7e\xc2\x3e\x04\xc1\x02\xa6\x5d\x2a\x0c\x5b\xe3\xc0\xe5\x2a\x8a\xe5\xa5\x65\x92\xf0\xff\x22\x08\xf1\x92\xa2\xe8\x4b\x54\xf5\x6f\x25\x81\xee\xb7\xee\x10\xff\x67\x28\x83\x3c\xa8\x89\x2a\x60\x8e\xee\xb7\x78\x17\xf4\x3b\xbb\xea\x24\xcb\xc2\x02\xdb\x58\x60\xcf\x8d\xf3\x33\x71\xb6\x7c\xd9\x7e\x93\x77\x68\xbf\xc9\xdf\x73\x1b\x34\xf9\xa5\x85\x86\x32\x34\xa4\x70\x15\xa0\x1e\x2a\x20\xfa\xf4\x26\x53\x67\xaa\x42\xfb\x21\x33\xe5\x55\x4e\xd8\x7a\xed\x1e\x9c\xcf\xc4\x35\xe7\x75\xb7\x5a\xee\x41\x71\x3e\x0c\x21\x16\xb1\xfb\xca\x7a\xdd\xda\x65\xca\x7f\x2a\xc3\xf9\xa1\x4d\xe5\x1c\x3b\x05\x55\x71\x76\x02\xa3\x93\x10\xb3\xac\x18\x41\x90\x54\x05\xf7\x4b\x3d\xb4\x66\x21\x48\x91\xe7\xf0\xad\x08\xc7\x76\x9d\xf6\x5c\x1b\xdb\x72\x8d\x55\x73\x3b\xb9\x3c\xbb\xef\xc4\xa5\x58\xee\x84\x13\xb8\x66\x71\x44\x58\x1d\x91\x42\x99\x9e\xa7\x38\x9a\xa9\xd9\x77\xbd\xbf\x0e\x5d\xf5\xcf\xaf\x73\x56\xbd\x78\x8a\x54\x05\x71\x87\xaf\xfd\x6b\xe2\xb5\x2f\xda\x72\xd3\x2c\x13\xaa\xa1\xfb\xa5\x80\xa5\xd9\xa6\x35\x3d\xba\xa3\x67\x04\x5e\xfc\x3c\x83\xd5\x3b\x9e\xe2\x80\x8c\x85\x88\x8b\xb1\xe8\x22\xa0\x14\xab\x1a\x6d\x70\x3e\x47\x37\x66\x3e\xc8\x37\x5c\x81\x71\x62\xe9\x95\xff\x70\x0a\xd2\x9f\xab\x72\xaa\x8c\xfa\x07\xa2\x35\x52\x6f\x5a\xf1\x90\xb5\x6d\x48\x92\xa6\x7f\xf2\x19\xb7\x29\x6b\xf3\xdb\x1e\xad\xdf\x0d\x57\x69\x8b\xfb\xa9\x29\x7b\x8e\x33\x91\x85\x08\x7f\x68\xe1\xa5\x62\xee\xa0\x67\xf6\xf1\x96\xa9\x55\xb5\xc1\x35\xb9\x87\x95\x22\x5d\x8f\x1a\xfd\xd4\xe3\x9c\x3f\x11\xc1\x92\x4f\x51\x0e\xeb\x2d\xeb\x16\x16\x07\x5e\x9c\xfa\xc4\x14\xd5\xa3\xd4\x75\x54\xb5\xf5\xdc\x78\xcc\xa2\x59\xfb\x43\xcc\xef\x47\xb8\x74\x82\xe9\xa8\x61\xc0\x03\xfd\x04\xff\x9d\x7b\x7c\xfb\xd7\x33\x2d\xc0\xfc\xb8\xe0\x21\x78\xe7\xcc\x88\x75\x57\x3a\xcd\xf9\xb1\x81\x05\x92\xc7\x57\x9e\xa4\xf1\xf9\xf9\x88\x15\x69\xfd\x40\x63\x28\x3f\xa2\xce\xfd\x40\x59\xe6\x97\x41\xfc\x68\x0c\x40\xb8\xd1\xa9\x8e\xfe\x61\xf3\x85\x68\xcf\x1e\x89\x43\xb6\x66\x7a\x67\x43\xeb\xd6\x68\xe5\x3f\x8c\xae\xa8\x57\x66\x29\xfe\xe5\xf3\x1f\xb2\xd9\xbe\xd9\xee\x5d\x7f\xde\xc2\xe0\x6b\x6d\x75\x5f\x8c\x38\x83\xcc\xb8\x3e\x50\x16\x41\xb4\x4c\x44\x20\xa3\x60\xef\xcf\x43\x53\x5d\xcf\xae\x75\xbe\xd2\x4b\x31\x8f\xcc\xd7\x21\x71\x60\xbd\x1c\xc9\x9d\x6e\x23\xe6\xcb\x60\x4e\x92\xa0\x21\xf5\x5e\x7b\xdf\x82\x03\xf9\x62\xfd\x97\x93\x25\x5b\x9e\x59\x0e\xdd\x03\xe0\xd2\xa2\xcd\x0e\x55\xb3\x07\xaf\x1e\x13\x85\x3f\x54\x61\xfd\x87\xba\xe8\xdd\x1e\xea\x43\x95\xcd\xaa\xad\x75\x28\x7b\x7c\x58\xfa\x2c\x9f\xa4\x1a\x72\x00\xed\x86\xf9\xd6\xf4\x0b\x1c\x67\x19\x95\x6d\xf5\x23\x1d\xd1\x55\xe2\x27\xc3\x0c\xe7\x31\x0e\xc6\x87\xf9\x5b\x5b\x9d\x07\x15\x1a\x87\x29\x34\xba\x6c\x3c\x48\x80\xa3\xe7\x72\xf3\x9f\x92\xb2\x07\xd4\x7a\xb5\x65\x8a\xff\x9b\x4f\x91\xc1\xa1\x03\xb1\xa9\xb2\x7b\x8a\x59\xb9\x5f\xab\x58\x97\xaa\x19\x33\xef\xc2\xb0\xd3\x57\x14\xc1\x02\xfb\x21\xea\xd6\x2b\x2b\x80\x10\xaf\x7c\x0d\x3a\xe4\x9a\xda\xba\x09\xf0\x42\x8f\x7f\x0b\xfb\xe6\xe1\x0f\x5a\x73\xc8\xc3\x2c\xfe\x26\x4a\x81\xe4\x93\xa2\x0e\x2b\x1e\x69\x66\xaa\xd8\x96\x67\x7d\xf3\xc4\x3b\xb4\x51\x1e\xc9\x35\xad\xa2\x52\x5c\x55\x67\xd6\xa8\x69\xc0\xa8\xd9\xb7\x4a\x61\xc8\x96\x24\x4e\xdb\x98\x83\x9f\xe4\x98\xe3\xfe\xdd\x31\xdb\xd8\xd7\x5b\x29\x1b\xd4\x99\xff\x48\xa4\xa2\xea\xc1\x0a\x71\xc3\x61\xf4\x78\x74\x39\x2c\xeb\x4f\x49\x15\xf4\xb0\x67\x66\x71\x39\x35\x8f\x06\x20\xd8\x55\xc7\xeb\xcb\x4b\x3b\xf3\x99\x98\x55\x1f\xae\xc8\xde\xeb\x0b\xf5\x55\x7d\xf9\x8a\xa1\xaa\x1e\x04\x7a\x68\x94\xb8\x30\x59\x71\xdc\x85\x8e\xb0\x13\x9b\x86\xba\x73\x21\x95\x34\xc4\x84\xfb\x36\x2c\xee\x5d\x32\x43\x97\xbd\x97\x13\x30\x96\xbc\x2c\x3d\x74\x15\x58\xbf\xb5\x6e\x42\xac\xd0\x9e\xf2\xca\xc0\x75\xb0\x55\x60\x84\x60\x7a\xdb\x0c\x9f\x78\xa8\x7e\x3a\x3f\x5f\x30\x19\x99\xa3\x73\x50\x47\x6d\xc8\x4e\x3e\xe9\x7c\xe8\xb2\xdb\xd3\x2b\xbd\x9f\x3e\x84\x0d\x20\xe1\x2a\xb7\x72\x97\xde\x94\x97\x6c\xef\x9a\x65\x8a\xc6\x22\xae\xea\x94\xba\x08\x91\xc3\x88\x5a\xf7\x2d\xc1\x54\x19\xc4\x55\xb2\x46\x21\x17\x96\x7f\x82\x7f\xaa\x80\x6f\x28\x44\x5d\x45\x5e\x85\x34\xd8\x8f\x0a\xdd\xb9\x15\xba\x07\x28\x44\x29\x16\x1a\x00\xf6\x5f\xfb\xce\x64\x1e\x3f\x68\x3f\x1f\x6c\xb3\x7a\x7d\x94\xcf\xa7\xe8\x78\x47\x73\xb8\xdb\xf7\x24\xd5\xd8\xed\x00\x31\x47\x52\xb2\xdb\x11\x07\xc3\xb4\x59\x41\x66\xda\xa8\x4f\x61\x57\x6c\x11\x3b\x6c\x0b\x36\x29\xce\xae\xc1\x7f\x5d\xd7\xb6\xd1\xac\x1f\xd6\xf7\x73\x89\xeb\x61\x71\xba\xa5\xf3\xe9\x89\xe7\x26\xee\x69\xbd\x5c\x54\xca\xd3\xa6\x82\xba\x04\x5b\x2b\xe7\x23\x5d\xdd\xba\x14\x3a\xd8\x5d\xd4\xda\xf3\x5f\x1b\xbc\x24\xa2\x32\x68\xb0\x5c\x16\x79\xdf\x95\x14\x12\x5f\x4e\x80\x55\xb1\x3b\x32\x97\x16\x0d\xaa\x74\xab\x0e\x6c\x13\xd1\xae\x90\x1d\x9b\xae\x28\x5a\xbf\x69\x33\x57\xfe\xb9\x4f\x1e\x13\x2b\xb6\x60\xc9\xb9\x9c\x54\x64\x47\x8b\xc0\xcd\x60\xf6\xf0\x94\xb4\x0b\x2a\xdd\xe7\x2f\x07\x88\x5d\x69\xd2\x65\xdd\x4a\xae\xa8\x4d\x25\x62\xc8\x85\x38\xc7\x84\xa5\xc3\x3c\xd6\x97\x8d\x91\xe5\xec\x59\xed\xcc\x9f\xf1\x0b\xa0\x22\x7f\xb7\x0d\x71\x30\xf7\x66\x79\x3c\xb4\x22\xba\xd9\x1a\x4f\x2a\xc8\x42\x82\x4f\x22\xaf\x6e\xe1\xf6\xc3\x1a\xb9\x96\x8d\xb3\xd6\xfd\x49\xf9\x75\xe8\xf4\xbf\x2c\x58\xd4\x79\xc9\xbc\x5d\xbf\x14\x5a\x59\xed\xd9\xe8\x48\xe7\x98\xb3\x63\x5a\x3c\x4c\x75\x38\x25\xae\x9b\xde\xbb\x2e\x78\xaa\x9c\x9c\x59\xa0\xb2\x7f\x8a\x25\x1e\x7b\x1d\x1a\x3a\x1d\x19\xe6\x59\xfc\x20\x4e\x6c\x30\x93\x3a\x57\x4c\x3a\x09\x11\xe9\xd2\x1c\x42\xb3\x76\x05\x64\xa3\xe7\x82\x85\xf6\x1f\x6e\x95\xce\x47\x0b\xbd\xe1\x4e\x8e\x5b\x65\x8d\x1a\x0a\x68\xd0\x78\xeb\x3a\xa7\xae\x9e\xbf\xaa\x6e\x9f\xb9\x23\xcf\xdb\x69\xdf\xba\x32\xae\x11\x7b\x2b\x58\x05\xa4\xc3\x24\xfa\xcd\xa5\x8d\x37\x79\xee\xe8\xe5\x64\xbf\x07\x2f\xdd\x9e\x45\x72\x55\x82\xf1\x2e\xf1\xd0\x16\xb0\x0c\xbe\xd6\xa6\x83\x08\x9f\xed\x18\x5f\xdb\x2f\x19\x45\xd9\x73\x34\x80\xbf\x09\xc9\x85\xd0\x3d\x5a\xe6\x37\xf5\x3d\xd3\xb4\x06\xcc\x35\x0d\x65\x3d\x26\x9d\xc6\x30\x28\x35\x91\x7a\x0e\x6b\x52\xbb\x73\x09\xea\xbb\x64\xc7\x02\x72\xfd\xe3\x35\x75\x20\x88\x11\x65\xb6\x1a\x1f\x8c\x9b\x7a\x4f\xe0\x7e\xd2\x6b\xbe\xc8\xa5\xf9\x40\x3c\x9a\xeb\x22\xd5\xf6\xf6\x27\x43\xbd\x14\x34\x65\xd9\xd1\xbd\xf5\xfc\xbf\x4e\xde\x0c\x3b\x84\x40\xf4\x2f\xd4\x43\xc3\x5d\xe0\x35\x13\xc5\x0d\x15\xd8\xfd\x87\xba\xb1\xa5\x36\xe1\xd8\x39\x0a\xe8\x68\x5e\x6e\x45\xa9\x85\x2c\xc2\xdb\x93\x72\x44\x7d\xdc\x21\x01\x94\x7e\x05\x4b\x30\x0c\xff\x5c\x37\x5e\xe5\x76\x96\xca\xc3\xbe\x2f\x2d\xa1\x75\x0b\xe8\x6c\x51\xa4\xc9\x06\x39\x1c\x62\xcd\x6e\x71\xb0\x10\xef\x44\xa1\x83\x65\xfd\x94\x5c\x94\xb5\x9c\x07\x6b\x26\xcf\xb2\x2e\xfa\x77\xcf\x59\xb8\x30\x7b\x16\xe6\x1b\xc3\x5a\xae\xb5\x91\x71\x8c\xc8\x9f\xa0\xb4\x85\xab\x1f\x3b\xb3\xe7\x3c\x48\x4d\x96\xbf\xf5\x89\x32\x23\x2b\xee\xe7\x40\xe6\x09\x5c\xa5\x78\x2c\x8c\x73\x1c\xed\x8e\x64\x94\xca\xed\xa7\x2a\xf8\xe4\xd5\x7e\xed\x01\xf7\xc1\x13\x41\x4f\x60\xad\x83\x79\x2b\xf8\x7b\xfd\xba\x23\x03\xba\x68\xcd\xd2\xe8\xbe\x7d\xf5\x68\xaf\xcc\xfd\xe2\x24\xe6\xae\x5b\x93\xd7\x42\x92\x97\x53\x72\x18\xfc\x69\x78\x0f\x8b\x3f\xbf\xd9\x08\xac\x0d\x8b\x66\xc4\x3e\xfe\x8a\xb2\x0b\x87\x84\x42\x5b\x3e\x1b\xa8\x70\x14\x78\x63\x64\x23\xd7\x3e\x58\x34\xa9\x37\x03\x6d\xcb\xaf\xc6\x6d\x2d\x39\x29\xb5\xc5\x7b\xf9\xbb\x84\xf1\x06\xac\x00\x7d\xa4\xe5\x15\xf3\x2b\xc4\x66\xd9\x4d\xdd\x50\xa5\xf4\x03\xe5\x7f\x2c\x64\xdf\x00\xcf\xfa\xf3\x79\x03\x04\xaa\x8a\x39\x6a\x21\x0c\x56\x49\xda\xa0\x8a\xae\x75\x1b\x92\x90\x2c\xd4\x07\x90\xf7\xb6\x17\xc3\xbf\x54\x13\x76\x27\xfd\xbf\xb4\x6a\x43\x98\x26\xfa\x70\xc6\xe5\x6a\x1b\x29\xf6\x95\x73\x68\xd6\x5d\xaf\xe0\x75\xd6\x28\x24\x7a\x71\xdc\xeb\x8c\x95\x3e\x87\x60\x04\x8f\x62\xab\xda\xa5\x3f\xe4\x2f\x58\x31\xb1\xb7\x66\x96\x6a\xb4\xf5\xeb\x46\x38\x35\x0a\xa9\x5d\xe4\x4e\x24\x5f\x2f\x8d\x47\x49\xdd\xfa\xa3\x2e\x6c\x03\x1b\x39\x05\x72\x0e\x1f\x2e\xd7\x28\x88\xdb\x46\x51\x4e\x45\xac\xde\x09\xe4\x61\x95\xf5\xed\x32\x86\x87\x1e\xae\xa8\xb5\x13\x21\x59\x7b\x47\x6d\xc0\xa6\x68\x9f\x59\x15\xe9\x42\x67\xb7\x2b\xdc\x05\xbb\x72\x7b\x1b\x73\x6d\x44\x95\x5e\x84\x95\x63\x36\x27\x00\xd7\xf5\x1b\xc6\xe9\xb0\x8d\x98\x19\x60\x48\xc4\x3a\x02\x62\x5f\x60\x94\x32\xff\x09\x13\x43\x92\xb5\x51\x4a\x0d\x9e\xb1\xcd\xb1\x5b\xfe\xf9\xb2\x47\xa4\x70\xa9\xfa\x77\x09\x6a\x31\xd2\x4a\xbe\xcc\x32\x89\xb0\x48\x96\x29\x57\xfe\x27\x08\x40\x0e\xcb\x45\xa0\xa1\x7d\xb9\xba\x68\xe6\xe5\x69\x5d\x16\xc2\xf3\xd8\x88\x7d\xd0\x63\xe5\xef\xcb\xc9\x86\x39\x2a\x80\x97\x51\x04\x70\x1b\x42\xbf\x9b\x59\xa0\xb5\x2e\x1d\xa3\xda\x48\xc4\x6b\x4b\x46\xfb\x27\x49\xde\x9e\x02\x34\x80\xaa\xaf\x25\x0f\x37\xed\x55\x15\xef\x3d\xf0\xb6\x4e\x31\x1e\xee\x45\x3b\xb4\x21\x85\x3b\x16\x46\xe1\x1a\xa3\xdf\xa5\xf9\x17\xe6\xb6\x67\xb2\xc9\xab\x88\x08\x97\x3b\x2a\x7f\x14\xe1\x61\xd0\xea\xf4\xf0\x43\xa7\x77\xe6\x33\x65\x7d\xe0\x20\x0b\x43\xd5\xcb\x4f\x49\x01\xbb\x76\xee\x57\x3c\x77\x91\x71\xe1\xd9\x87\x50\xee\x58\x39\xdc\xf7\x8a\xba\xbc\x11\x63\xea\x70\x25\x3d\x80\xe7\x9b\x4f\xcc\x59\x9f\xf2\x23\x8c\x5e\xff\xac\x4c\xe5\x9d\x35\x3c\x35\x4e\x3a\xfa\x63\xbc\xc6\x2d\xc9\x50\xb5\x65\x50\x54\xcf\xd0\x61\xb3\x80\x2c\xe3\xd0\xc7\x80\x17\x62\x57\x64\x8b\xf8\x96\xa9\xaf\x45\x81\x41\x02\x2b\x17\x93\x0a\x39\x21\x92\x46\x5c\xae\x8c\x59\x98\x17\xcb\x8b\x37\xd1\x60\x37\x47\xb1\xbf\x74\x22\x9e\x53\x73\xd6\xbf\x9e\x65\x72\x7e\x36\xfd\xdb\xb9\x39\x1a\xce\xbd\x88\x11\x67\x54\x80\xcf\xfc\x71\x08\x0b\x50\x89\x82\x02\xe4\xf9\x6e\xc6\x86\xfb\xc0\x55\x2e\x09\x06\x1b\xc3\xb9\x57\x10\x1b\x87\xa8\x6f\x4e\xaa\x9b\x5f\x2a\xc7\xdf\x93\x17\xd0\xc1\x6b\xd6\x4f\x4d\x9b\xd0\x03\x09\x63\x0c\x0f\x46\x55\xe2\xf1\x18\x40\xc6\xe3\xd6\x94\x41\xb1\x22\x76\xa5\xae\xdf\xe9\xf7\x03\x95\x78\x49\x10\x1f\x00\x8f\xa9\xa8\x5c\xcf\x81\xaa\xbc\x75\xdb\x58\x31\x3a\x6a\x54\x8c\xab\x28\xbd\x77\x08\xd1\x9e\x9f\x77\x47\xb6\xa0\xd3\xa4\xfc\xb0\x80\x82\xbe\xa4\xbf\x6b\x27\xe5\x69\x99\xa3\x54\x32\x3a\x8f\x36\x67\x3e\x7c\x76\xeb\xbb\x16\xaf\x3c\xb0\x94\xcf\x77\xc8\x35\x7a\xfd\xcc\x66\xcd\xaf\x0e\xf8\x16\x73\x14\x72\xcc\x1a\x3f\x1d\x73\xa4\x64\x8f\x39\x0c\xef\x2d\x62\x71\x9e\x08\xbb\x63\x1e\xa9\xa7\x64\xbd\x92\x18\x94\xa8\xdb\x13\x40\x2e\xd6\x73\x54\xec\x27\x78\x60\x23\x7e\xac\x55\xb6\x9d\xc7\xc3\x06\x19\x2a\xcb\xb9\xba\x6f\x27\x9a\x75\xd0\xa1\x51\xd3\x17\x42\xc0\x9e\x0f\x9d\x8c\x5b\xdb\x69\x5d\x69\x6c\x69\xe1\x37\x0e\x0e\x97\x6d\x41\x52\x22\xc8\x55\xc1\x99\xde\xf7\xf7\xab\x71\xaa\x77\xda\x32\xa2\xc5\x90\x1e\xca\xd1\x20\x02\x83\x34\x67\x9d\x53\x7d\x29\x10\x85\xe5\x48\x02\x40\x48\x78\xf4\xb0\x71\xfb\xc6\x8d\x8b\x80\xa7\x30\x65\xb4\x4e\xa2\x13\x78\x60\x67\xe5\xee\xb0\x31\xb0\xdf\xb6\xf2\x49\xde\x75\x94\xd7\x4e\xfc\xbd\x8b\xff\x12\xf5\x69\x37\x92\xcf\x75\x51\x26\xc1\x75\xaa\x1c\x21\xa0\x9e\xb4\x2c\xac\x3d\xc1\xff\xc9\x7f\x42\xc9\xd4\xee\xdf\x09\x26\xe0\xfd\x44\xfd\xdf\xbb\x04\x04\x1c\xad\xed\x25\x5a\xb5\xbd\x74\x9c\xd2\x58\x47\xf6\x2a\x6a\x6a\xdc\xa6\x91\x7c\x67\xbd\xaf\x7b\x56\xf2\x66\xcf\x71\xd4\xa4\x67\x0a\x22\x1d\xd2\x0a\x4e\x2c\x97\xd7\x4b\x15\xed\x2a\x9d\x0f\x57\xf8\x3c\x19\xec\xc1\x90\xb6\x7e\x44\x25\x7a\x87\xb5\x4f\x94\x53\x2d\x52\xef\xb0\xa0\x0b\x2a\x35\x73\x2f\x5e\xc2\xcf\xdf\x7a\x7c\x55\x8d\x3e\xbf\x8f\xf0\x32\x2c\x54\xc0\xd9\x8a\x44\xb7\xb7\xa2\x1b\xb4\xd1\xc5\x66\x43\xeb\x1b\xe9\x3e\xfb\xf0\x2d\xca\xce\x67\xab\xda\x41\x29\x58\x72\xc0\x3b\x0d\x0d\xec\xe5\xf4\xf7\x74\x03\x0a\x99\x95\xfc\x25\x26\x16\x20\x50\x8b\x77\xb6\xe1\x2e\x90\x38\x6d\x4f\xa5\x34\x8e\x6d\x60\x55\xb4\x4e\xc5\xef\xbc\xee\x6f\xd6\xee\x07\x11\xa0\xa5\xc8\xbe\xf5\x4f\x52\xc5\x31\x5b\x3d\xa9\xc3\xef\x71\x68\xfa\xd6\x3e\x45\xa1\xbd\x95\xca\x97\x39\xe8\x57\xce\xb5\xde\xc5\xa3\x76\x27\x48\x8f\xc6\xb3\x10\x3d\xd0\xbb\x5d\x43\x93\xff\x5d\x53\xc0\x0a\xfa\x71\x7e\x46\xa9\x7f\xb4\x91\x44\x28\x01\xf7\x35\x0a\x65\x1e\x2b\x38\xdf\x00\xfb\x31\x2e\x5f\x45\x5f\xeb\x31\x1b\x43\xdb\x7e\x56\xec\x96\x36\x6d\x60\x17\x4e\xf7\x04\xae\x89\x73\x96\xa3\xa6\xcd\x92\x55\x5a\xb7\x97\x97\xd3\xb0\x2d\x51\xfa\x45\x9e\x9c\xe9\x0a\x17\x49\x2f\xeb\x33\x6a\x0c\x70\x8c\xfa\x57\x56\x02\x11\x0b\xb5\xbc\x01\xa3\x24\x0d\x72\xc0\x13\x78\xad\xd2\x2c\xbc\xce\x06\xe7\x0a\x21\x0b\xb2\xd8\xdc\x83\x1a\x35\x28\xf5\xca\x41\x06\xda\x4d\xc4\xee\xa3\x80\x1f\xec\x70\x66\xda\xd7\x37\xe7\xf4\x28\xd5\x3b\x09\xcf\x63\xa7\x63\xaf\x75\x91\x69\x65\x15\x95\xd8\xda\xf2\x25\xc7\x00\x75\xad\x6e\xab\xa1\x61\xe5\x5a\x9d\x9e\x63\x0b\x15\xa4\xad\x77\x22\x95\x98\x72\xbf\xe4\x5a\xbf\x72\xd4\xfd\x43\xe0\x57\xa6\x8e\x6b\x71\xc7\x5b\x8f\x68\xe7\x0c\x14\x26\x39\xd6\x4f\x95\xb1\x67\xf9\xc2\xac\x52\xf1\x41\x02\x40\x45\x6c\xf8\x65\xbe\x7e\x1a\x3e\x40\xf0\x00\xd1\x95\x67\x9c\xa7\x28\xd4\xfe\x73\xf2\xb5\xcf\xe1\x22\x02\x99\x71\x12\xa8\xf1\xd2\x91\x04\x4d\x02\xdc\x1a\x45\xd5\x15\x9c\xa6\x9d\xc1\xb6\xd4\x89\xf4\xe9\x38\x56\x5e\xb8\x53\xe0\x84\x6d\x58\x7f\xfd\xf1\xd0\x64\x21\x1d\x52\x33\xd2\x81\xe1\xe7\x71\x8a\x82\xc6\xea\x88\x45\x95\x21\xfd\xc3\x7e\x85\x5e\xcc\xea\xd9\x47\x15\xf6\xcf\x22\x75\x65\xb4\xcd\x39\xa2\xfe\x2b\x20\x7c\xe4\xf7\x29\x92\x2f\xa4\xfa\xce\xa0\x4c\x8b\xdb\x2d\x54\x9a\x1d\x5b\x87\x79\x00\x73\x58\xe6\x20\x4a\x27\x51\xb2\x21\x2b\x48\xe8\x81\xeb\x47\x79\xb3\xb2\xbc\xa5\xff\x0b\x15\x61\x31\x8f\xc1\xf7\xf6\x5a\x73\xcd\x7c\x87\x9d\x24\xdd\x74\x80\x91\xc3\x0d\xc8\x0a\x3f\x10\x00\x20\xec\xc7\xe2\xb5\x44\xdf\x9f\x12\x70\xb6\xe8\x3a\x7e\x93\xe5\xd9\xb4\x9c\xe2\x11\x2c\x25\x30\x31\x16\xa5\xe5\x4b\xae\xbe\xe8\x9d\x59\x0e\x0e\x64\x96\xb2\x2f\x85\xd0\x80\x7c\x08\x60\xb9\x34\x89\x1e\x44\x3f\xce\xbf\x76\x1c\x07\x14\x8c\x1d\x88\xeb\x44\x6c\xdf\x1d\x19\x64\xd5\xfe\x77\x7e\x03\x39\x3e\x0f\x12\x7d\x42\xe7\x56\x43\x5c\xc8\xa1\xc0\x38\x38\x4a\xfa\xe7\x12\x35\x4d\x8b\xfb\x49\xf3\x92\x25\x06\x54\x78\x31\xf9\x8b\x71\x0d\xf4\xe2\x2f\x21\x16\x60\x81\xd0\x0d\xa8\xcd\xc8\xea\x34\x2c\x5f\x17\x48\xc8\x24\x05\x3e\xb2\x70\x88\x00\x4b\xfd\x67\xe6\xb8\x65\xc9\x8d\xf0\x1d\x2f\x06\x1a\x52\xcc\x5b\x5e\x3f\xc2\x0b\x08\x2e\xb0\x46\x4a\x76\xc9\x1a\x34\x81\x0b\x2e\x11\xe6\xca\xe1\xcd\x22\x09\x80\x25\xd8\x45\x8b\x94\x1d\x17\x66\xea\xac\x71\xf8\x94\x3f\x3a\xcd\xfd\x67\x0b\x19\x3e\x00\x07\xfc\xc6\xfd\x96\x33\xca\xa9\x36\x15\xf4\x44\xd7\xaf\x4d\x28\x73\x6c\x97\x01\x9f\x3e\x29\xdd\x7c\x4a\x4d\xee\xd7\xc6\xa6\xc3\x27\x70\x25\xb0\x06\x72\x77\x51\xf9\x7f\xd9\x3c\xd6\x7d\xa4\x9c\x5a\xbe\x39\x59\xcb\x09\xe7\x12\x39\x95\x46\xf0\xbb\x09\xfa\xbe\xd5\xd0\x4c\xef\xe0\xd8\x4f\x50\xd0\xf5\xe5\x1e\x92\xce\x91\xfa\x98\xaa\x2b\x74\x6b\x8f\x02\x00\x9f\x9c\x4b\x6f\xc1\x05\xc4\xb2\x26\xfc\x61\x2a\x02\x1e\x4c\x2b\xc1\x08\x83\xe4\x9b\x6d\x1c\xc1\x3c\xd8\x34\xff\xfb\x8a\x85\x4e\x36\xc3\x76\xd7\x16\x0b\xbc\xee\x03\x59\x37\x02\x8d\x26\xd8\x15\x84\x2d\x01\xca\x1b\x61\x62\x3a\x46\x59\x3e\x9f\x5f\xde\xf9\x99\x04\x50\x80\x6e\x80\xa6\xb3\xfc\xb0\x70\x5b\xc9\x01\xca\xb1\x54\x0e\xaa\xf9\xaf\x7b\xe9\x18\x0e\xa5\xf3\x25\x7c\xc1\xdc\x38\xf1\x74\xa9\x9d\x32\xf5\x14\x26\x9f\x5a\xfa\x9a\xf4\xb2\x19\x1b\xcd\x57\xd1\xb4\x49\x64\xb9\x86\x02\xb3\xcd\xff\xc9\x2f\x0f\x9b\xb1\x89\xb6\x8e\x13\xdf\x1d\x64\x9a\x88\x7c\xb7\x48\xe7\x94\xc8\x1b\xb7\xa5\x68\xe8\xdb\xe9\xf3\x1c\xa8\x32\x37\x68\x03\x21\xa9\x8e\x50\xe8\xaa\x58\xee\x1d\x29\x30\x76\xc7\x3f\x03\x3d\x4b\x09\x59\x1b\x6b\x02\x29\x94\xe9\xd5\xf1\x6c\x62\x65\xa3\xcd\xce\xfc\x30\x6e\x53\xaa\x4c\x9d\x13\xd1\x7d\x19\x12\xdc\x22\xa4\x4b\x9a\x39\x7d\x98\xe8\xb4\x48\xb5\x60\x8b\x82\xa2\x3c\x86\x71\x61\xe8\x2e\x0b\xf5\x60\xcd\xb5\x9f\x59\x99\xf8\xf9\xf1\xd8\x25\xcf\x2c\x3b\xac\x71\xbe\x45\x5e\x0f\xf7\x09\xe0\x22\xde\xe1\x5c\x6a\xaf\x66\x09\x5f\xd3\xc6\x91\x03\x5c\xc2\xff\xe9\x0c\x90\x2a\x4f\x6f\xce\x5d\xec\x2e\xe8\x02\x0a\xe9\xbe\x3c\xed\xb7\xfa\xf4\x1b\x79\xef\x3d\xd0\x13\x9a\xf7\x8c\x59\xed\xf5\xc8\xe2\xd5\x88\x11\x4b\x90\xd5\x6f\x4a\x6e\x00\x37\x11\x66\xa9\x1c\x60\x80\xda\xae\x23\x21\xfb\x28\xcc\x05\x06\x9b\x52\x1a\x1a\xd3\xa6\x63\x6c\x9a\x4a\x8e\x2e\x44\xe4\x01\xe4\x7b\x44\xa4\x4f\x0e\x21\xa8\x85\x4c\x75\xcf\x97\xbd\x04\xfe\x7a\xd8\x24\x80\x1c\x71\xeb\x2f\x58\x2f\x0b\xe5\xdd\x49\x00\x87\x72\x6a\x68\x4c\x5d\x0f\x79\x2e\x3e\x30\xa2\x78\x47\xe0\xcb\xcc\x09\xeb\x23\x54\x66\x1e\x71\xb1\x1f\x48\x61\x2b\x1d\xfc\x98\xed\x66\xdf\xfc\x7a\xa4\x08\xe7\x63\x6e\x10\x89\x39\xf0\x6b\x0f\x55\x5b\x1e\xe9\x25\x17\xd6\xf4\xea\x28\x19\x02\x02\xbb\xd4\xa6\xc3\x23\x0c\xa8\x88\x91\x80\x0a\xeb\x05\x9a\x07\x6c\x9a\x66\x22\x25\x3a\x39\x90\xe5\x67\x78\xe1\xe6\x7a\xf3\x2d\xcc\xd7\x14\x0f\x6c\x96\x15\x61\x3e\x94\x1f\xcf\x10\x51\x0b\x49\x62\xa4\x52\x56\xc9\x43\xe5\xed\x7a\xa9\x8c\xd2\xe0\x46\x8e\x96\xe5\x30\x36\xab\xa3\xc9\x0f\x6f\x73\x72\xf3\xd5\x42\x99\x92\xb7\x2c\xf7\x02\x67\xf4\xf0\x46\xa6\x04\x58\xee\x02\x37\x93\xd3\x39\x65\xf1\xa8\x05\x03\x1b\xde\x2a\xa8\x0c\x6f\x14\x5e\x11\x40\xb4\x91\xb5\xf9\x3a\x11\xde\x60\xef\x30\x39\xf0\xb5\x3b\x03\xe1\xc0\x11\x39\xdc\x58\x45\x98\x7f\x73\xf1\x12\xc1\xfd\xcc\xcd\x71\xf5\x99\x08\x7e\x38\x75\x01\xa1\x21\x4d\x85\xe5\xb2\xf3\xfd\x71\x2e\xbd\x52\x89\x43\xa1\x34\x74\xc9\x37\x9b\xe8\xa1\x10\x84\x66\xdd\x4f\x27\x29\xe8\x66\x8f\x0f\x54\x6b\x42\xf3\xff\xfe\xfb\xc1\x63\xb1\xe6\x75\x16\x73\x8e\x52\x00\x1e\xf2\x31\x8b\x7b\x2f\x2c\xfe\x80\xe7\x32\x09\x72\xe1\x3a\xd3\x24\xcf\xef\x41\x78\xdf\xde\xe2\xb4\x37\xe6\x3c\xdc\x6d\x08\x65\x58\xe7\x60\xf2\xdb\x10\xb2\x12\x19\x31\x33\xdf\x3b\x64\xb9\x62\x0e\xd9\xa5\x76\x15\x52\x90\xf6\xc7\xf1\x0a\xa8\xf5\x1d\x6c\x02\x07\x3c\x77\x42\x2e\xc8\x00\xd7\x1a\x5a\xc9\xe2\xc3\xe3\x95\x6c\x34\x9b\x01\x84\xed\xbc\xbd\x64\xd0\xd6\x66\xd4\xb0\x0d\x60\x28\xb0\x7e\x5c\x9d\xb0\xce\x70\x3b\xae\xaf\xcd\x2b\x89\xf3\xa2\xc1\xf6\x67\xfd\x48\xa3\xda\x46\x5d\xf2\x7a\xe9\xcf\x39\xee\x88\x85\x1b\x97\x59\x48\x25\x8b\xb4\x4c\xef\x90\xe5\x23\xd0\x41\x06\xad\x6f\xca\x53\xd7\xd3\x0d\x59\x33\x3f\x3c\x12\xbf\x3c\x9d\x45\x52\x18\x1f\x1c\xd2\xd8\xbc\x2d\xa0\x31\x7d\xa1\x58\x6c\xcf\xd9\x03\x64\xab\xfd\x39\xe8\x51\x09\xdb\x03\xb2\xf0\x54\xd9\xc6\xc2\xf0\xcb\x06\x6c\x01\xb9\xaa\x3d\x90\x0b\x30\xc5\xfd\x83\x43\xe0\xa4\x15\x67\x44\x06\x73\x3f\x85\x8d\x54\xaf\x17\xd0\xf1\xde\x3b\x8b\xd1\xee\xfe\xba\x33\x4b\xe3\x40\x01\xe1\x03\xce\xca\x9a\x50\xef\x77\x4b\x65\xfe\xa3\xa9\x59\x7b\x96\x86\xe5\x79\xdb\x99\xb5\xf8\xbd\xd7\x76\x4c\x41\x73\xc3\x35\x76\x66\xb9\xda\x86\x3f\xe1\x5d\x5a\xcf\x4e\x33\x8a\xae\xae\x0f\x55\xd7\xe9\x81\x5a\x87\xef\x7c\xc7\xc5\xa6\x59\x23\x57\x51\xde\xc5\xc6\x55\x51\x2f\x83\x35\xde\x8d\x94\xde\x2f\x4d\xa1\x7a\x1e\x9b\x9b\xab\x3c\x4a\xec\xa5\x6e\x52\xd5\x7c\x12\xbb\xb3\xd9\xb1\xd6\x7b\x1e\x49\xb9\x3f\xa3\x44\x7c\xd2\x03\xb1\x49\x22\x43\xec\xdf\x8f\x5d\x84\xa0\xeb\x6c\x28\x29\x8e\x7d\xa1\x88\x76\xd1\xe0\xae\x53\xeb\x8e\x1c\x6e\x24\xdc\x1c\x45\x11\x37\xdf\x3e\xf0\xbf\x95\x66\x9e\xaa\x79\x4d\x57\x68\xfb\xd4\xc1\x62\x5c\xff\xb9\xf8\x58\xca\x23\x6b\x3f\x68\xdd\x0a\x49\x2f\xd6\xec\xa3\xd3\xb7\x48\x06\x37\xac\xd5\x33\x61\x05\xa9\xeb\xa8\xda\xfb\xb5\x9d\x9b\x02\x34\x87\xa0\xd7\x4a\x7a\x7b\x1a\xe7\x22\x02\xba\x06\x8f\x18\x59\xaa\xf6\xec\x0a\xd8\xca\xab\x39\xc9\x5d\xb5\x7c\x49\x65\x50\x04\xfb\x87\x25\xfd\x28\xce\xef\x03\xc6\x92\x1e\xae\xb7\x0d\x70\x78\x9c\x20\x2b\x76\x5f\xdb\xd8\x3f\x30\xc9\x2e\x8f\x84\x06\xa4\x37\xeb\xe3\x9d\x75\xf0\xce\x86\x0f\x30\x0b\x04\xaf\xf5\x4e\xa8\x81\x11\xe3\xbe\xb5\x36\x5e\xcf\x2f\x52\x2f\x4f\xe7\x92\x54\xe4\x97\x79\x6d\x0a\xae\xbe\x8c\x50\x3b\x97\x69\xf0\x6b\xea\xb8\x92\x60\xd4\x87\xce\x36\x2d\x9e\xba\x06\x8c\x00\x83\x86\x47\xb4\x3e\x9e\x5d\x75\x87\x2e\xf2\x74\xd3\xd6\x37\x2d\x50\x43\xf2\x0e\xda\xd7\x58\xbc\x44\x8b\x87\x0c\xf2\x8f\x83\x05\x1a\x99\x25\xb9\x17\x9f\x98\xe9\x55\x7a\x30\x90\x5c\xf1\x05\xc6\x11\xaa\xa3\x87\xef\xa9\x5d\x00\x8e\x85\x5d\x48\x3e\xe6\x0d\x18\x43\xfa\x7f\x3e\x77\xb9\xe9\x41\x67\x77\x24\x32\x25\xf1\x71\x44\xb9\x83\xdb\xf4\x60\xf1\x72\x76\x9e\x1c\x3d\x4d\xfa\x7d\x58\x42\x03\x6a\xc0\xa3\x6d\xef\x7f\xbe\x98\x03\x6f\xc0\xd7\x19\xe8\x08\x19\xd6\x1e\x0d\x36\xc0\xe5\x4c\xea\x69\x9a\xf5\x6c\xa4\xf1\xb6\x3e\xe4\xf0\xc8\x6e\x2b\x87\x12\xc8\xef\xf8\x12\x8e\x89\x7e\x60\xf8\x5a\xc9\xa2\x56\x4b\x20\x72\xfc\xda\x27\x3e\x5b\x42\x6e\x42\x64\x3b\x88\xf8\x23\xd9\xfd\x7a\x01\x3e\xae\xd2\xb4\x2a\x22\x70\x60\xfb\xf8\x73\xf0\x61\xf2\xf5\x5d\x4f\xa7\x0d\xd9\x92\xd7\xd9\x9e\xb2\x85\x3d\xe8\x3b\xab\x9c\xfd\xce\x29\x40\x05\xe7\x17\x5d\xe0\x8b\x89\x0b\x76\x5a\xb6\x74\x5b\x09\xf4\x51\x4d\xfd\xd0\x55\x71\x14\x7c\xeb\x67\xaf\xf2\x7b\xf7\xd4\x5a\x7f\xed\x2e\xcf\x46\xe6\xfe\x2c\xed\xee\x5d\xb4\x65\x8b\xe4\x1b\x3b\x87\xbe\xb6\x17\x5f\x9c\x45\xef\x0f\x1b\x01\x0a\x28\x93\xf9\x95\x79\x21\x23\x41\x2c\x02\x26\x66\x12\xe7\xde\x6f\x3d\x01\x2f\xa7\x65\xff\xd0\xb0\x96\xae\x2d\xfc\x3f\x6d\x68\xfd\xca\xb1\x26\xf9\x4c\xec\xe5\xaf\x19\xc5\xbc\x1b\xd2\xe3\x95\x54\xa7\x7a\xa5\xc6\x14\x02\x0a\xc1\x2b\xfa\xd6\x2a\x90\xa8\xbf\xb2\x5a\x42\x79\xee\x70\xa7\x85\xcf\x79\xd8\xd6\xf2\x3f\x41\x2f\x50\xd6\xb4\x73\x62\xfe\xea\x89\x5f\xb1\x08\x80\x00\xa2\xf3\xc8\x90\xc0\x83\x73\x2a\xd2\x16\x7c\xa2\xf0\xa4\xa3\x39\x0c\xc1\x37\x88\xa2\xe2\x13\x5a\x52\x00\x3a\x30\xeb\x0b\xe3\x5b\x5f\xd8\xcc\x4d\x4f\xa2\xc5\xcf\x52\xce\x49\xfa\xde\xfb\x24\xfc\xba\x6b\x04\xbc\x03\xb2\x60\x73\x91\x52\xa4\xf7\xed\x48\x1b\xc9\x41\x3d\xc3\x54\x13\x58\x53\x29\x8b\x43\xb1\xc4\x96\x35\x14\x8d\xea\x79\x39\xda\xa9\xa2\x46\xe6\xc1\xa1\x9c\xca\x5d\x05\x7f\xbd\x83\x5a\x67\xc1\xde\x69\xa8\x68\xb1\xdf\xf7\x1b\xf2\x35\x8e\x1d\xe0\xb4\xf1\x46\xd5\x90\xdd\xa5\x8d\x81\x8f\x4c\x91\x80\x12\x39\x68\xd8\xe8\x36\xf3\xdc\x46\xa0\x77\xbc\x19\x64\x46\x7f\xa4\x3b\xee\x4f\x08\x64\xc7\x6b\xfe\x09\xfd\x71\x04\xe5\x22\xac\x21\x39\xac\x20\x6a\x67\xb7\x8b\x1f\x13\xe6\xb0\x95\xdb\x1b\xd7\x7b\x16\x0d\xc7\x66\x5b\xfc\x6a\x0a\x87\xe6\xdb\x39\x06\x42\x12\xdf\x53\x16\x80\x21\xd2\x5f\x77\x5e\xea\xea\x1d\xda\x9d\x7f\x39\x0a\xb9\x95\x36\x93\x40\x80\xaf\x4a\xe7\xc1\x7f\xee\xe3\x3b\xbe\x4b\x30\xe8\x95\x5e\xc6\xf5\x71\x50\xdd\xf5\xb6\x43\x5d\x54\x02\x40\x02\x55\x86\xbc\x39\xb5\xfe\xe3\x72\xd6\xf6\xa2\x28\x56\x59\x13\xaa\xca\x79\xf5\x9f\x7c\x55\xaf\xf7\x7b\xe1\xb7\x52\xfd\x84\x58\x88\x61\xc8\x12\x21\xaf\x40\x34\x29\x54\x5e\x18\xf8\x06\x91\xf9\xad\x71\xfc\xf2\xfd\x0b\x07\xfe\x16\x08\xd0\x60\x8f\xc9\x24\x9c\xc4\x1c\x76\xb2\xb7\x3a\xfe\x0b\x4a\xee\xea\x05\xae\xdb\x26\x7b\x55\xd0\x07\x29\x86\xc3\x96\x42\x58\x87\x3e\xc6\xb7\x97\x74\x8b\xae\x5b\x19\x06\x0b\x94\xbb\xbd\x5c\xe7\x9d\x05\x7d\xf4\x5c\xf6\x12\xb0\xc4\xfd\x9f\x1b\x1c\xd0\x43\xf8\x38\x9f\xd2\x53\x87\x09\x69\x44\x3e\xf2\xb9\x8e\xa2\x5a\xfa\xc1\x79\xe8\x75\xb8\x42\xa8\x90\x14\xb9\xa9\x07\x90\x49\x86\x25\x53\x77\xd0\x11\x18\xb9\x1c\xf7\x1a\xda\x01\xd7\xd7\x4e\xf8\xe4\x8d\x2b\x9a\xd4\x21\x2b\xec\xb8\xa5\x0b\x0d\x23\x61\x07\x85\x33\xe6\x6b\xd7\xc1\xb7\x33\x2f\x64\xb5\x6f\x85\xed\x81\x8d\x4d\x42\x53\x00\x1c\x3c\x26\xe5\xed\x85\x24\xc5\x1f\x72\x9e\x0b\x83\x00\x16\x2c\xb3\x04\xe0\x97\xec\xa9\x1d\x94\xb4\x88\xcd\xb0\xe6\xf1\x62\x10\x2c\xfd\x39\x7e\xa7\x84\x62\xaf\x79\x13\x26\x66\xce\xe3\x1f\x11\x78\x39\x0d\xdb\x00\xbe\x51\xa5\xe0\xf2\x71\x84\x00\x7c\x49\x42\x73\xa0\x04\x1e\x70\x8e\x8d\xf8\xe8\x4b\xe2\xe2\xd7\x17\xe4\x30\xe5\x2d\xbc\x91\xa7\xac\xde\xef\xca\x1a\xa1\x5f\x98\x79\xf1\x44\x51\xe6\x22\x8c\xc3\xde\x20\x5d\x55\x81\xa4\xae\xdc\xf2\x2c\x2e\x60\x70\x46\xa0\x2c\x81\xc3\x38\x7e\x84\xbf\xc8\x57\xd3\x7b\x5f\x9b\x0a\x7c\x13\x44\x02\xe6\xa2\xfb\xca\x16\xa4\x80\x5b\x1c\x94\xe8\x00\x8e\x42\xcb\xd8\x21\x55\x21\x40\xfc\xa2\xd3\xbe\xd9\x3a\xf8\x59\x9a\xed\xc8\x37\x49\xd1\xfd\xf0\xd6\x9c\xd7\x21\xed\x5b\x58\x71\x59\xbc\xd6\x39\xa4\x0d\x6e\x2d\xc3\x84\x00\xee\x66\x5c\x47\x5d\xfd\xb4\x72\xf5\xc2\x6c\x3f\x54\x33\xfd\x12\xa4\xbe\x51\xf0\x60\x7c\x58\x37\x05\xb3\x96\x9e\x3b\x38\x4b\x50\x82\x4e\x6a\x72\xc1\x47\x40\x6f\x3e\x30\x14\x4d\xc0\x20\xf4\xeb\xe5\x62\xdc\xcb\xc5\x38\xe9\x71\xf6\x70\x6e\x2b\xb9\x6a\x0e\x3f\x64\xd9\x18\xd3\xea\x00\xca\x58\x7f\xcd\x92\xc1\x07\xf8\xa1\x34\x82\x30\xf1\xee\x32\xf4\x62\x20\x17\x74\x69\xc2\xa1\xc2\x10\x81\x6c\x98\x21\xbb\x42\x14\x46\x97\x2a\x2d\x90\x69\x64\x04\x55\x2d\xbb\x25\x0c\x25\xa5\x7b\x5a\x37\xaf\x94\x2c\x42\xb9\x1f\x4b\x79\xc5\xda\x2c\xf9\x20\xa7\x4b\x82\x08\x3b\xaf\x9a\x80\x64\x2e\xc5\x25\xf4\x85\xf6\xf8\x8d\x49\x18\x10\xfd\x42\xd5\x9d\x54\x5c\x75\xf3\x63\xff\x07\x89\xf2\xb9\x48\x86\xef\x9e\x31\x3a\x44\xb6\x3c\xea\xad\xde\xef\x60\x42\xe3\xc0\x45\xf2\x7a\xbf\xfd\x9c\x37\x83\xdc\xf4\x0f\xee\x00\x56\x74\x04\x49\xbc\x85\xa0\x78\x45\xc1\xd7\xc1\x14\x34\x5f\x3a\x50\x5a\xba\x25\x77\x20\x3e\xff\x51\x34\x25\x3d\xa0\xa1\xec\x4b\x02\xf1\xc1\x50\x65\x95\xe3\x98\x05\xa9\xd8\x35\xd0\x3a\xe0\x2c\x2d\x0c\xc5\x4a\xdc\xfd\xa1\x96\xda\x96\x49\xfa\xf3\x23\xd5\xb1\x80\xae\x68\xe5\x03\x48\xcf\x6f\x21\x53\x07\xb4\x85\xee\x2e\xf4\x11\x84\xe0\xb0\x77\xde\x2d\x53\x8f\x4c\x2d\x9f\xe3\xef\xee\x70\x49\xc6\x50\x85\x40\x0b\x81\x18\x60\x02\x16\x50\x8a\x43\x46\x66\x88\x74\xc0\xbc\x3f\xc2\x8a\xd9\xc6\x09\xf7\xac\xef\x63\x22\x75\x64\x2f\x7f\xfd\x10\x3b\xd1\xac\x8f\x6b\x08\xce\x23\x0b\x4a\x08\xc4\x45\x29\x87\x44\x3d\x2f\x17\x51\x60\x4d\x0e\x32\x2a\x0e\x44\xb1\x9e\x86\x57\x21\xf5\xed\x40\xb0\x73\x70\xcc\x83\x20\xfa\x58\xf2\xce\x94\xaa\xb6\xb4\x5c\x5f\x91\xf9\x2f\x92\x13\x4a\xb5\xbb\x38\x84\x65\x62\x6e\xbe\x50\x1d\x1a\xd1\x50\x5d\xea\x05\xf2\x09\xd2\x4a\x78\xb1\xb8\x08\xd4\xc4\x5a\xa5\xa8\xd0\x69\xfa\x63\x91\x57\x6a\xf6\x39\x66\x4d\x3b\xf2\x9e\x7a\x46\xf6\xb9\x13\xab\x62\xcf\xaf\x2e\x52\x71\x7b\xde\x88\x36\xdc\x33\x4a\xff\x81\x99\x78\x12\x7e\x81\x0c\x88\xb7\x1b\x16\xc5\xbf\x73\x38\x89\xf7\x88\x7b\x5a\x88\x7f\xb2\x20\x39\x3c\xc3\xe3\x66\x7e\x6c\xd3\xb7\x93\xa9\xd5\xad\x52\x43\xa0\x2a\xe7\xb1\x41\x32\xbf\xb1\x62\x70\x38\xd1\xe4\x8b\xf4\x9b\xb6\xa2\x0a\x52\xb3\x58\x26\x86\x62\xbf\xac\x35\x9d\x85\xb7\x50\xfb\x62\xd1\x6f\xe6\x52\x84\xed\xcd\xde\x2d\x61\x2e\x24\xcb\xb7\x15\x8e\xac\x80\xaf\xf0\xd9\xc6\x26\x19\x52\x2c\x57\x29\xd3\x53\xe0\x70\x0b\xc8\xd1\x36\xaf\xc2\x2b\x00\x4c\x44\xa1\x7d\xbf\x9e\x3c\x31\x4c\x3a\xbe\x2e\xbf\xf9\x82\x8c\x3f\x41\x15\x6e\x6e\x46\xa5\x83\xb0\xea\x71\x18\x06\x71\x15\x02\x98\x84\xb1\x2d\x3c\x9b\x2f\x2d\xfd\x57\xe4\x6d\x2b\x01\xca\xa0\xfe\xe4\x96\x03\x20\xb1\xff\x91\x3a\x40\x16\x4d\x18\x8c\x2f\xc4\x02\x05\x6f\x1a\x1f\xaf\xca\x66\x4a\xed\xfe\xad\x50\xba\xf4\x0b\xb8\x02\xda\x7d\xbe\x92\xa3\xd7\x2c\xe2\x0e\x63\x9d\x25\x7f\xe0\xa2\x00\x84\x6c\x3c\x52\xd3\x6b\xa5\x82\x42\x88\x32\xe4\xf5\x4c\x4f\x1e\x1e\x59\x5c\x3a\xcc\xcb\x83\x99\x91\xf8\x49\xef\xff\xf9\x14\x18\x8d\xaf\xb5\xdc\xd6\x77\xb9\x69\x2b\x10\x1c\x71\xbf\x09\x2e\xb1\x0e\x75\x9a\x73\x68\x26\xdc\x57\x65\x82\x7f\x83\xe8\x4b\x40\x35\xa6\xb7\x36\xb5\x07\x94\x2e\x2c\x5b\x12\x1b\xd1\x02\x69\x75\x24\x79\x20\x79\x97\x2b\x80\x06\x40\xcd\xfc\xd2\x22\x65\x75\x80\xdb\xc8\x94\xe7\xdd\xe0\x1a\x3d\x72\x27\x4c\x47\x19\xb4\x23\xef\xa5\x8c\xf2\x67\x08\x6b\x2a\xf4\x83\xb1\xc3\x1c\x9b\x49\xe9\x65\xb3\x01\x6e\xc0\x3b\x56\xaa\x01\x6c\x89\xe9\xe3\x0d\x09\x95\x4f\x6e\xb2\x0f\x33\x94\x51\x18\x82\xef\xfd\xeb\xd1\x28\x5c\xfd\x26\x99\xa3\x0d\xa0\x4c\x21\x50\xfa\xad\xa9\x55\x58\x2b\xd1\x84\x1c\x9a\x10\xc3\x3b\xa4\xe1\x2b\x51\xd5\x6b\x60\xb9\x56\xd0\x64\x7c\xb9\x7f\x88\xdb\x40\xf3\x24\x48\xf3\x5a\x1e\x77\x08\x8e\xaf\x25\x6b\xfa\xb4\x12\x47\xb9\x12\xff\x81\x68\xfe\x70\x5c\xb2\xba\xde\x88\xb0\x1c\x57\xbc\x20\xf0\x09\x6f\x01\x4f\xd8\x22\x8e\x80\x21\x19\x21\x34\x48\x08\x8a\xaf\xd0\xc9\x15\x52\x65\x26\x85\x7c\x9d\x25\xcd\xdf\x54\x1c\x6c\x28\xc0\x46\x7f\x9d\x9b\x19\xb3\xb3\xc5\x42\x14\x22\x4b\x46\xff\xaa\x9c\x4c\x00\xcf\x2d\x60\x87\x2c\xc0\xd6\x2c\x21\xeb\x95\xc6\x90\x74\x4d\x58\xf3\x10\xd2\xfa\x36\x13\xeb\xa1\xba\xea\x71\x55\x39\x91\x51\x13\x54\xb0\x2e\x73\x94\x72\xfd\x4e\x68\xba\x63\x36\x44\x49\x75\x2f\xe9\x5d\xb9\xe7\x35\x35\xfb\x69\x64\x5c\xf5\x3d\x99\x4e\xae\x84\x1f\xb8\x10\xbb\x73\xed\xdf\x86\x6b\x80\xdd\x72\x5a\x1a\xa4\xbe\x09\x43\xc8\x6e\x61\x79\x7b\xf6\xd0\x6b\xfc\x6f\xfe\xb4\xa5\xba\xe2\x8c\x47\x42\xe7\x2f\x62\x72\x2d\xb5\xff\x6a\x3d\x00\xae\xe2\x91\x0d\x41\x24\xbe\x80\x53\xc7\xb2\x7c\xc8\xe7\x86\x1c\x7e\x3f\x6b\x1d\xb4\x6e\x67\x45\x5c\x10\x0d\x02\xa6\xc2\xca\xa1\xa0\xc5\xd6\x7f\xf3\xa8\x7b\x61\x27\xbb\xec\x89\xf8\x8f\x0d\xb0\x13\x22\x32\xac\x09\x11\x14\x04\x9a\xb7\xc8\xf5\x71\x53\x18\x1a\xc4\x17\x59\xab\xd2\xdc\x09\x52\x71\xdf\x81\xda\x68\x06\xc8\xcb\x97\x5a\xbe\x34\x24\xd1\x02\x97\xfe\x29\xa0\x1d\xc2\x93\x83\xc2\xcd\xd3\x8f\xc7\xc8\xda\xc4\x99\x2b\xe6\x93\x9f\xb3\x4c\x00\x52\x75\x9c\x48\x88\x3c\xc3\xe3\x9a\xeb\x4f\x79\x96\x2c\xe9\xa8\x5c\x13\x53\xee\x25\xc9\xf7\x79\x49\x13\x87\x09\xbf\xf5\x0a\x75\x25\x10\x9b\x02\x40\x31\xed\xd7\x59\x07\x0f\x9b\x21\xcd\x2f\x44\xc2\xf0\xca\xfd\x3a\x9d\x5a\x3b\x65\x26\x48\x7f\xc9\xfd\xf6\x68\x08\x4a\xd0\x6f\x5a\x0a\x6e\xff\x7c\x69\x60\x0a\x79\x24\x02\x5e\xdd\xc8\x7b\xa6\x6c\x3f\xea\xe8\xec\x76\xa6\x37\xd1\x04\xf5\x9f\x4f\x8f\x3d\x7c\x71\x71\x4a\xe6\x72\xaa\x9b\x8d\x75\x3c\x18\xa7\xe6\x94\x1d\xb5\x09\x8b\xc6\x90\xf0\x67\x0b\x34\x35\xa7\x05\x1b\x63\x0d\xef\xe8\xf1\xe0\x95\x00\x00\x3b\xc1\x15\xd6\x7c\x34\x40\x07\x9e\x0c\x22\x30\xd6\xab\x11\xea\xdd\x11\x9b\x08\x8c\x06\x99\x01\x18\x43\x5f\xe6\x47\x44\xc3\x35\x08\xd2\xd1\xec\xb2\x7f\x8b\x84\xfd\x01\x49\x6d\x91\x2f\xc3\x60\xdd\x49\xd2\x52\x87\x08\xcd\xfd\xfc\xd6\xa2\x7d\x96\x5b\xf6\x18\x06\xd7\x3b\x50\x18\x01\xc9\x00\xf2\xa8\x79\x67\x0b\x1d\x92\xd7\x51\xf6\xd8\xae\x59\xe4\xca\x10\xd2\x88\x00\x1e\x24\x50\x1e\xb2\xca\x9a\x98\x24\x99\x32\x4d\xcc\x27\x32\xa0\x1a\x69\x0b\x73\x4c\xff\x3e\x52\xe4\x5e\x9d\xb2\x3b\xd0\x37\x98\xc6\x4a\x84\xc5\x1d\x86\xda\x17\xec\x96\x76\x85\x3f\x94\x8b\xf8\x08\xc5\x37\x25\x0d\x39\x26\x64\x26\x14\x8c\x9c\x6e\xa0\x3f\xe1\x9a\xc0\xcd\x00\xa4\xc1\x63\x6e\x49\xa9\xa5\x29\x32\xd8\x13\x14\x01\x7c\xd9\xe3\x65\x28\x42\x90\x74\x70\x80\xf4\x88\x42\x53\x70\x11\x28\x0a\x16\x59\x6a\xaf\xec\xc0\x31\xa2\x20\x72\xa2\xce\x6b\xc7\xe1\x95\x85\x52\x97\xa8\xa8\xc9\x7b\x55\xd5\xad\x06\xb8\x27\xaa\x12\x9e\xb5\x1b\x1d\xc6\xbf\x47\xa4\x89\xa9\xc5\x8e\x44\xb1\x25\x9d\xe0\x47\xa0\xf7\x7d\x49\xa4\x8c\x30\x1e\x39\xbc\x34\xe0\x45\xf0\xb5\x13\x40\xa6\xaf\x89\x6c\x00\xfe\x71\x12\xfe\x61\x57\x5b\xc2\xe9\x16\x0b\x31\x52\x30\x6f\xa5\xb2\x3f\xfa\xc7\x30\xef\x5e\xe7\x41\xe6\xdd\x51\x15\xb2\x48\x28\x12\x21\x7c\xc7\xf5\xbd\xb9\x6d\xd4\xb8\x6a\x44\xed\xde\x05\xfc\x59\x6b\x1a\x1e\x41\xf0\x19\x21\xe2\x23\x20\xc9\xad\x97\x66\x9c\xcf\x71\x66\x20\xf2\x93\x0b\x6d\x08\xee\xf2\xbd\x8c\xa8\xef\x72\xcf\xaf\xec\xca\x68\x6f\x51\x22\x54\xc4\xf1\x23\x8c\x54\x4e\x1f\xdd\xa0\xd5\x2f\x77\x3e\x02\x85\x60\x8d\x05\x4f\x8b\x73\xf5\x11\x2c\x05\x02\x3f\x28\x05\x92\x7c\xfe\xa5\x48\xf3\xcb\x31\x1d\x73\x13\xe7\xd8\x03\x88\xa2\x2e\x16\xd6\x08\xfa\x66\xcc\x1b\x23\x54\xd5\x08\x49\x59\x07\xae\x99\x75\x35\x53\x28\x90\x8f\x69\x68\x77\xc0\x99\xcb\xde\x85\x3f\xbc\x2f\xa3\x6f\xee\xa3\x9e\xf7\x1c\x6a\x1e\x0f\xb9\x92\xd7\x28\x7e\x3f\xa0\x63\x79\x31\x00\xa4\xd5\x61\x22\xa0\xf6\xf8\x61\xce\xfc\xbe\x13\xd5\x3c\x32\xd0\x99\xd6\xb2\x4b\xe6\x83\x8e\x26\x72\x30\x8f\x70\x91\x3f\x03\x68\xee\xff\x8b\x60\xf9\x71\xfc\x8a\x8f\x38\x21\x85\xcf\x93\x28\xab\x2a\x26\x8f\xb5\xfa\x3f\x59\x67\x65\xdf\x1e\x0e\x49\x25\x12\x45\xfa\x69\x8f\xf9\x74\x8d\xc1\x87\x8d\x0b\x29\xfa\x00\xf5\x0f\x65\x8b\x81\x5c\xf9\x21\x6c\x45\x9d\xd9\xc3\x65\x84\x28\x95\xf7\x70\x82\x81\x44\x47\xf2\x4c\x1d\x0f\x72\xe7\x1f\x9a\x7b\x3d\x92\xee\x5f\xe6\x50\x38\x7f\xe4\x00\x68\x8d\x1e\xf1\x21\x92\x3d\x03\x5e\x45\x80\x93\xca\x86\x1b\xde\xd8\x4f\x16\x9a\x32\x95\xe0\x33\x9a\x41\xc1\x5b\xac\x49\xb4\xf7\x15\x43\xee\xbc\x1d\x5a\x07\xee\x45\x68\x82\xb8\x27\x79\xa4\x8d\xf3\x3c\x7c\x65\x3b\xda\xcb\x67\x4f\x58\xb8\x96\x0f\x73\x98\x36\x58\xd3\xf6\x92\x94\x48\xea\xcf\x4c\xf1\x8d\x8f\xd4\x35\xfe\x28\x25\x0d\xb5\x17\x63\x72\xa8\x1d\x47\x27\xc3\x59\xf8\x72\x0d\xa7\xb0\xb6\x83\xa8\x58\xd6\x53\x30\xdd\xec\xf0\x12\x5f\xb6\x99\xf7\x50\x34\x79\x1d\x4a\x3e\x64\xde\x10\xa3\xbe\xa1\x60\x00\x2b\x48\x89\x4f\x81\x29\xca\xc1\x6c\x9c\x87\xbb\xd7\x5e\x87\x39\x1e\xf3\x61\x1e\xe6\x50\xe1\xf8\x48\x7e\x60\xc8\x77\xa8\x6a\x5c\x93\xbe\x6c\x26\x07\x4d\xe8\x1c\x90\x92\x2a\x81\x8c\x4d\x70\x2e\x44\x82\xe6\x03\x68\xf2\x2e\x0a\xce\x25\x02\x21\x49\x56\x25\xf1\x2c\x12\x16\x61\x70\x25\xda\xeb\x62\xfc\xdb\x00\x7c\x43\x76\x63\x66\xa1\x66\xdc\x6a\x94\x58\x92\x6b\xda\x3d\x23\x08\x9e\x32\xd7\x50\x6a\x0e\xcb\x00\x9e\x28\xe9\x3b\xa0\x74\x19\xd2\x28\xe9\xe1\xaf\xcc\xc0\x31\x69\x5f\x79\xd3\x7a\x87\x5d\x36\xdd\x84\xba\x2e\x61\xb5\xf0\x12\x72\xe3\x74\x39\x0a\x8f\xd2\x4b\x06\xdc\x16\x56\x6e\x96\xf6\xef\x2a\x19\x07\xd8\xd5\x61\x93\xd2\xfb\x10\x93\x12\x0a\xd0\x14\xd3\x80\xa2\x47\x26\x5d\xb0\x93\x82\x71\x93\xea\xbe\x36\xd3\xfc\x58\xcb\x23\x0b\x87\x70\x17\xf5\x48\x02\x19\x30\xa2\xd6\xba\x21\x14\x1b\xca\x16\xfe\x0c\x53\x91\xa0\x06\xdb\xf9\xde\x5e\xea\x00\xd0\xac\xf8\x35\xc2\xa6\x44\x0e\x0a\x30\x15\xb7\xdb\xf9\x7e\xa4\x38\xc3\xda\xd2\x50\x36\x29\x3f\xf8\x40\xf6\xce\x57\xe3\x11\x52\xd4\xba\x30\xc4\x7e\x73\x89\xd4\x9b\xff\xf8\xa9\x4a\x30\xe3\x56\xa3\x07\x35\x5d\xca\x7a\x00\x83\x1a\x22\x1a\x10\x23\x0a\x45\x8c\x0c\x44\x81\xef\x8c\xa7\x4d\x7a\x21\x39\xf8\x7c\xbd\x44\x32\x92\x10\x44\x7d\x7a\x6a\x5c\x09\xbb\xf6\x1d\x3c\x08\xc2\x6a\xd2\x95\x04\x83\x39\x25\x54\x64\x91\x27\x40\x92\x3e\xc4\xca\x81\xea\xb1\x7d\x78\x4f\xf5\x6e\x59\xc8\x80\x08\x1e\x1b\x5d\xf0\xc2\xa1\x0b\xd0\x1c\xd5\xe3\x31\x84\x2c\xf4\x98\x24\x8c\xd3\xaa\xbc\xd8\x3d\x43\xed\x90\x03\x3a\xed\x76\xd5\x8b\x45\x92\xa9\x20\xcc\xce\x2b\xb7\x52\x2b\xa8\x3e\x22\xe8\x6a\x08\x23\xa8\x48\xdb\x01\xdd\xce\x6d\xa1\x8d\x19\xe0\x99\x0a\xee\x2d\x0f\xcb\x9c\x40\xe7\x04\xc4\x70\x5f\x70\x85\x4e\x57\x01\x08\x54\xce\xc9\x81\x38\xc1\x34\x22\x4e\x74\x67\xb0\x62\x5d\xd6\x22\xab\xbd\xa1\xf3\x03\xe1\x11\xc8\x9a\x6c\x52\xc5\x68\x7b\xe5\x41\xb8\x9b\xb4\x7c\x6d\x21\xec\x83\xe0\x3c\xf6\x36\x04\xb2\x26\xe6\x96\x04\xdd\xbc\xe6\xac\x98\xea\x98\x5d\x34\x79\x1d\xc4\xbb\x08\x89\x79\x06\x06\x07\x49\x66\x3f\xf3\x12\x83\x48\x8b\x84\x96\xb9\xc2\x8e\xde\x75\x49\x09\xab\xb1\xd7\xe9\x25\xc5\x0a\x78\x80\xc4\x06\xa7\x8e\x7b\x52\xc2\x02\xe3\xad\x13\x25\x1d\xa1\x75\xa8\xae\x81\xe1\x23\x67\x1b\x36\x27\x8f\x3d\x91\x65\x26\xc0\xc8\xae\x45\x60\x78\x26\xb2\xc1\xba\x42\xcf\x12\xc0\xe2\x26\x2d\x69\xc4\xbe\xda\x65\xb8\x9a\xd6\x46\xbf\x68\xe0\xce\x58\x5e\x14\xf1\x36\x00\xb3\x23\xec\x0e\x15\xca\x3a\xa0\xf5\x79\xc2\x10\xe8\xa3\x10\x87\x36\xa5\x99\xbd\xe7\x07\x02\xb9\xd3\x70\x3b\x77\x58\x4c\x84\x77\x07\x73\xb1\x1d\x20\x54\x76\x24\x81\x7e\x46\x54\x3a\xaf\x2b\x00\x3d\x82\xeb\x40\xa2\x86\x84\x97\x2e\x4b\x93\xc0\x81\x3d\x01\xe6\x21\xb7\xd9\xad\xee\x4f\xa6\xb5\x3b\xeb\xb5\x79\x15\x6c\x4a\x10\x9e\xf6\x7a\x1a\x73\x8a\x43\x48\x48\x12\x79\x98\x40\xe8\xbc\xf5\x24\x7d\xfd\xef\xed\x95\x18\xe4\x42\xcf\x76\xa1\x13\xf8\x5f\x42\x1e\x8c\x4a\x98\x61\x14\x3d\xeb\xde\x2f\x30\xb0\x96\x8a\x4a\x21\x5f\x17\xc8\x2e\xc1\xd2\xe6\xe3\xb9\x0c\xc7\xfe\x7c\x84\xf8\x59\x7a\xfd\x0f\xa5\x4f\x81\xf9\xe1\x23\x99\x88\xaf\x4a\xe3\x58\x04\x22\xa2\xbe\x1f\x0a\x6f\x7a\x98\x53\xd7\xba\xf1\x2e\xb1\x8a\x93\x2e\x4e\x3b\xbc\x8d\x71\x6c\x8b\x4d\x5a\x46\xca\x7f\x00\x29\x60\x0d\x73\xd1\x87\x14\xab\x51\x8c\xa1\x0c\xc7\xd9\x4a\x1d\xf8\x85\x92\xd7\x50\xb1\x1f\x09\xbc\xfd\x96\x7f\x4d\x42\xe5\x7f\x6d\x08\x1f\xa5\x8d\x6c\xf6\xce\xd1\x91\x0d\x5e\x05\x42\x41\x9f\xb7\x53\x4a\x64\xd4\x88\xc9\x23\x3e\x1d\x48\x59\xef\x5f\xb8\x8f\x2f\x12\x8a\x15\x44\x04\xad\x77\x08\x85\xdc\x84\x94\xfc\xc8\x82\xbf\xa7\xaa\x08\x93\xd8\x76\x39\xaf\xaf\xba\x48\xfe\x57\x8e\x22\x12\x67\x5a\x59\x9a\x75\x79\x11\xca\x94\x38\x85\x81\x90\xa6\x25\x1e\xcd\xa4\xde\x38\xe4\xdf\x21\x31\xe2\x65\x82\xd4\x17\xc7\xf6\x24\xef\x0c\xfc\xdc\xbb\xc3\x3a\x1a\x9b\xc7\xfd\x50\x77\x44\x86\x1e\x7c\x29\x3f\xaf\xd2\x24\x3f\x3f\x30\x29\xea\x8b\x98\xe7\x1f\xa2\xa6\x3f\x14\xa3\xff\x04\x0a\xf6\x13\xa5\xd1\x4f\x5e\x55\x25\xb2\x08\xf5\x0b\x8f\x04\x1f\xfe\xa4\x4a\xec\x97\x05\x2c\x31\x7f\x40\x37\xf5\xfb\xf0\x49\x63\x39\x9b\xcf\xbf\x90\xd2\xef\xc4\xd1\x0a\x60\xf3\x99\xcb\xe8\x11\xad\x8f\x5a\x65\x4c\x81\xee\x0a\x82\xfa\xeb\x4f\x78\xff\xaf\xf4\xfe\xa7\x16\xe3\x2b\xc8\x13\xf0\x00\x79\x09\x33\x74\x02\xbf\xc9\x95\x7b\x7c\x8b\xe1\x9f\xb4\x4c\x96\x60\x13\x59\x6c\x53\x77\xbf\x86\xf0\xff\xff\x74\x32\x31\x01\x43\x6a\x0a\x85\x92\xb7\xf2\x91\x2f\x17\xf1\x14\x9e\xa8\xad\xdb\xe3\x50\x99\xee\x75\x2f\x09\x42\x32\x94\xb4\x49\x16\x36\x19\xad\xa2\x36\xc7\x8b\xe6\x4b\x01\x86\x5f\x7f\x74\x64\x9e\x04\xfa\x3d\x9d\x40\xeb\x7a\x26\xf3\x2d\x24\xd1\x7e\x71\xc2\xec\x02\x26\xbb\xe4\x4b\x38\xe5\x7b\xce\xda\xb6\x27\xe0\xee\x89\xb4\x9a\x14\x4e\x90\xf3\xf2\xa5\xee\xe8\x33\x03\x22\x89\x20\xbd\xbd\xb3\x7f\x26\x0d\xbf\x9e\xe9\x94\x77\xc8\x19\x5e\x8a\x72\x09\xa1\x45\x37\x2c\x40\xd0\x11\xb2\xc7\x7f\x42\xfc\x3d\xbc\x3a\x2a\xd8\x3f\x14\x27\xae\x24\x8c\xc2\x08\xc4\x2f\x45\x65\x6e\xaa\x86\x61\x4c\xdd\x48\x78\xb7\x2e\x9b\x60\x9f\x3b\xe0\xef\x8e\x01\x4a\x81\x01\xda\x28\x58\x4d\xfc\x0f\xc7\x27\x77\x0d\x2d\x85\xfb\xb4\xf7\x87\x40\x9a\xb3\x4c\x04\x02\xcd\x72\xc3\xb1\xe8\x1a\xa8\x79\x41\x48\xd0\x4d\xc4\xd0\xdc\x75\x11\xe6\x83\x35\x67\x00\x82\x64\x1e\xe2\x06\xe3\x21\xe0\x0a\xc5\x8e\x5b\x56\x08\x1e\x6b\xf2\x72\xf3\xb7\xd8\x42\x48\xb1\xbb\x89\x61\x20\x89\xe0\xd5\x46\x0b\xf8\x0c\x58\x90\xae\x2a\x15\x15\x0b\x75\x76\x45\x2a\x2a\x03\x1e\x0c\x1d\x04\x50\xd9\x1f\xd9\x95\x08\x6c\x74\x1e\xde\x38\x59\xd0\x57\x37\x1a\xb7\xde\x8a\xd3\xb8\x7b\x16\x4f\xfc\xd6\x68\xf3\x9e\x37\x42\x88\x22\xcd\x75\xcf\x1c\x6b\xdc\x93\x5d\xc5\x1f\x0a\xb3\x8c\x10\x16\x0e\x6d\x96\xd3\x06\x6b\x4b\x8e\xd8\x61\xc8\xfa\x20\x7f\x93\x12\x3f\x78\xca\x61\xea\x69\x9d\x43\xe5\xc2\xfa\xfd\x27\xc7\x45\x77\x0e\xd2\x2f\x30\x4e\xb3\x54\xc6\x2c\x16\x94\xf8\xce\xe1\xa2\x6f\x17\x56\x25\xe1\xdb\xd5\xa7\xb8\x52\xa2\x7d\xf6\xca\x32\x51\x0c\x4d\x7f\xef\x38\x81\xed\xa9\xf2\x83\x49\xba\xf9\x09\x6c\x85\x9f\xff\xa3\x84\x0b\x01\x4c\x5f\x4d\x0c\x77\xab\xb0\xb7\x22\x1c\x4b\x5e\x01\xab\xbf\x9a\x2b\xe9\x55\x9b\xf2\xd9\x55\x69\x22\x7f\xd9\xcc\x85\x10\x96\xca\x61\xf8\x65\x8f\x63\x83\x25\xdb\x07\x02\x32\xc0\xb8\x10\xc0\xe8\x64\xe6\x09\x63\x82\x5d\x80\xa7\x3d\xd3\x06\x85\x9f\x62\xbc\x72\xdd\x2c\x1c\x7a\xa8\x1a\x25\x46\xc1\xa8\x99\x52\x58\x26\x47\x3a\x38\x0c\x4f\xf4\xcf\xec\x83\xe8\xa4\x17\xaf\x9f\xff\x54\x98\xc6\xe8\xac\x92\xea\x99\x16\x9d\xb4\xc1\x02\x26\x6a\x14\x28\xca\xfd\x31\x02\x0e\xe5\x14\x50\x6e\x7c\x38\x75\x53\x17\xee\x38\x93\x58\x4c\x08\x71\xce\x8c\x0b\x28\x8e\x01\x78\x42\x6b\xa9\x08\x3e\x36\xcd\x3a\x05\x50\xaa\x37\xc3\x59\x18\xa1\xc3\xda\x14\x22\x41\x2c\x0c\xe9\x99\x14\xca\x95\x57\x61\x59\xed\x2a\x07\x7f\x7b\x51\x89\xf1\x6a\xb8\x50\xee\xe2\xf0\x49\xee\xb1\xc2\x84\xd5\xa3\x05\x28\x52\xff\x7f\x4a\xe9\x5c\xdb\x5b\xff\x76\x9b\xa5\x16\x75\xad\x85\xf6\x20\x3e\x21\x23\xe6\x89\x36\x5c\xd6\xf3\x10\x90\xb4\xb0\x07\xbc\x80\x89\x1a\x14\xac\x04\x41\xb1\xd0\x6b\x33\xfe\x73\x90\x76\x0d\x0a\x35\x02\x0a\xcd\x5b\xe0\xa1\xb8\xbb\x64\xa1\xaf\x70\x02\x03\x3e\x2a\x80\x52\x1a\x64\x5c\x53\x5d\x08\xb4\x9a\x6c\x10\x42\x00\xd3\x54\x7c\xb6\x6b\x4b\x31\x83\x90\x1e\x58\xa2\xe9\x03\x6e\x8a\x27\x03\xb0\x94\xa0\x51\x73\x5b\xfa\x33\x0b\x59\x62\x1b\x1b\x49\x0f\x67\x8f\x6b\x3b\x09\x53\x84\x54\x72\x89\x88\x4b\x42\x51\x60\x88\x38\xc9\x60\xd5\xe2\xc7\x19\xdf\x0a\xa8\x95\x42\x2a\x12\x4e\x32\x04\x54\xbd\xd8\xe7\x3a\x10\x8b\x9a\x3a\xf7\xc4\x6f\xa8\x47\x7d\xe5\xff\xaa\x10\x5a\x47\x5d\x9f\xb4\x4f\xbc\xe4\x5d\x71\x35\x1b\x30\xc7\xe4\xfc\x32\xb2\x5f\x45\x61\xa5\x3c\xfb\x94\xed\x6a\xa8\xb2\x9c\xc7\xd0\xeb\x19\x34\x17\xb1\x48\x00\xbc\xc6\xcb\xbe\xb2\x8f\x7b\x75\xcd\x7b\x09\x59\x5f\x7d\xd8\x2e\xc0\xbf\x23\x74\x73\x5e\x74\x8a\x93\x89\x4d\x03\x7c\xd5\xaf\xe0\x8e\xe4\x36\x5d\xaf\xe7\x52\xb0\x36\x83\x9b\x3d\x0c\x0f\x42\xbe\x87\xe1\x56\x43\x75\x87\xea\xf4\x01\x13\x0b\xd6\x16\x90\x62\xdb\x15\x81\xff\xc8\x3e\x89\x0a\x70\xf5\x49\x78\x9c\xcb\x65\x1a\x67\x46\x8f\xc7\x3c\x10\xc0\xf5\x8f\x62\x49\xe9\x45\x70\xfa\x95\xea\xd3\x46\xd3\x84\x25\xa6\x70\x66\x4a\x4d\x99\x29\xb1\x6a\x8b\x21\xc1\xdc\x22\x0d\xf6\x10\x36\x01\xa8\xf0\x0c\xf0\x80\x42\x3e\x9a\x98\x5f\xb0\xcf\xe1\x9d\x4b\xab\x40\x6c\x23\x1f\xd2\xf4\xe0\x49\xc5\x31\x7a\xcf\xc4\x72\x9d\x14\x10\xaf\x94\xbc\x8f\x81\xf0\xd8\x2c\x89\x1f\x95\x00\x4e\x71\x8d\xce\x2a\x7b\x41\x0b\x3c\xb7\x09\xf5\x78\xe9\x02\xd9\xf5\x23\x36\xad\xe3\x63\x01\xaa\xa7\x30\x67\x9f\x77\x2f\x98\x59\x3d\x08\x4d\xab\x0f\xdf\x04\x35\x01\xa2\xd7\xae\x4d\x5e\xe4\x98\x5b\x9d\x01\x55\x6b\xf6\x37\x65\xa7\x2d\x8d\x4d\xc2\xb8\xe3\x2a\xd4\x59\x00\xbd\x11\x49\xec\xe2\x2c\x01\x89\xcb\x13\x15\x86\xec\xb7\xaa\xbd\x46\xec\x8b\x0e\x15\x50\xff\x16\x3c\x93\xe8\x2f\xcf\x59\x8f\x9c\x9b\xf9\x72\xca\xec\xc6\xe2\x7e\x66\x33\x8d\x7a\x26\x0a\x2b\xd8\x5d\xdd\xc3\xb1\x47\x8f\xe1\x89\x8a\xdf\x25\xc8\xda\x41\x7a\x8e\x45\x74\x03\xb2\xde\x65\xa6\x52\x92\xbd\xde\x8b\xce\xda\x7b\x03\xcf\xc4\x59\x7f\x43\x38\x1b\x34\x7a\x89\x63\x43\xe3\xb3\xf2\x7e\xda\x88\x85\x58\xb4\x3b\xfd\x6a\x92\x73\x26\xf1\x10\xa1\xbd\x11\x4e\x3d\x4c\x19\x9d\x89\x59\xc7\xd3\x26\x17\x9c\x4f\x9d\xf2\x16\x05\x7f\x9f\xdf\xfd\x57\x13\x95\x84\x38\x04\x3d\xea\x05\xd5\x15\x07\x42\x55\x80\xa1\x5b\x13\x7e\x58\x8f\x7e\x4b\x1c\xc8\x2e\x15\x67\x9e\x16\xf3\xe6\x1e\x18\xa4\x85\x04\xd0\x19\x29\xe3\x03\x1d\xf4\x8b\x3e\x8f\x36\x31\xba\x02\xdf\x16\x90\xae\x72\xea\x2b\x6b\x39\x99\x17\x38\x94\x06\x74\x0c\x1c\xf5\x71\x10\x11\x00\x77\xaa\x88\x7e\x94\x10\xe3\x3c\xbe\x93\x1e\x0b\x1f\x81\x8f\x4b\xdf\x75\x90\xb4\xf2\x2d\xd7\xca\xb3\x5f\xe5\x5e\x6d\x73\xa9\xca\xb4\xcb\x31\x2b\x2d\x0f\xd8\xdc\xbd\x7c\x91\x6f\xee\xd0\xff\x43\x0c\x5c\xe0\xd5\x38\x1f\x3d\xe6\x14\x23\xf5\x03\x0c\x58\x3a\x7f\xc2\xc5\x04\x8d\xc3\xf1\x20\x1d\xe5\x20\xf6\x4b\xf0\x35\xd8\xfe\xfd\x08\x11\x47\x41\x25\x29\xf5\x00\x7b\x2f\xe0\xdc\x79\x25\x22\xdc\xce\x35\xea\x59\x16\x2f\xda\x8c\x18\xba\x5d\x22\x68\x87\x2b\x69\x7b\xc0\x73\x0a\x12\xec\xc1\x1c\x0c\xb0\xcc\x1c\x6d\x40\x34\x68\xe0\x37\x74\x8f\x07\xa8\x19\xbe\x95\x21\x19\x34\xd8\xb5\xe3\x21\x84\xfd\x3f\x20\x46\x7b\xde\xd4\x55\x3b\xe4\x12\x05\x47\x95\xb7\x96\x78\x65\x0a\x06\x4d\xbc\x56\x7f\xcc\xdd\xcb\xb9\x49\x19\x03\x62\x42\x4c\x1f\xe0\xb5\xf5\xe7\xae\xac\x3e\x30\xf7\xe7\xab\x84\x56\xb0\x0c\xd8\x8a\x30\x67\x85\x32\x16\x65\x28\x82\xba\x14\x22\x91\x7e\xdc\x87\xc8\x27\x97\xb6\x9c\x59\xcd\x68\x12\xf6\x7b\x55\x26\x67\x2f\xcf\xc2\x85\xe6\x7d\xfb\xd7\x32\x07\xbe\x0c\xec\x74\xf6\x79\x61\x93\xb6\x4b\x39\x1f\xd8\x9e\x46\x64\xd9\x95\xc5\xb3\xe5\xf0\xc1\xbc\x51\x07\x02\xed\x53\x81\x76\x8e\x39\xd3\x9e\xdf\xca\x2c\xee\xf9\x75\xc9\xdf\xe8\x29\x97\x86\xdd\xda\xfb\xc2\x49\x9b\x85\xee\x37\xa5\x1e\x67\x83\xc5\x71\x52\x20\x61\xec\xcd\xfd\xdb\x57\xaf\x67\x6f\x75\x3b\xc4\xab\xdb\xd0\xd4\x3a\xd4\x28\xda\x5a\x0b\x26\x01\x50\xb6\x52\x57\xcc\x05\x0e\x8f\x6f\xc9\x1b\x2d\x61\x47\x14\xba\x88\x80\x99\x09\xe9\x65\xb7\x89\x89\x30\x57\x56\x65\x8d\x18\xe1\x42\x5f\xb9\xcd\x3d\xdd\x19\x80\xf6\x4a\x79\xa4\x1d\x36\x8d\x8a\xb8\x90\x59\x50\xdc\x2a\xf8\x14\x5d\x84\x93\x2a\xcb\x65\x73\xbd\x4b\x42\x45\x9a\xcc\x6c\xf3\x1a\xa0\xbb\xa6\x45\xba\xcd\x13\xe5\x8f\x06\xc0\x16\xc9\xe0\xdb\x34\x24\xd8\xf2\x25\xf9\x21\xf7\x81\xfa\x21\xba\xce\x1e\x2e\x21\xef\xa8\xf9\x93\xd7\x50\xa8\xdc\x5a\xb7\xbd\x65\xbc\xfd\x7e\xe0\xfe\x9e\x47\xa2\xbd\xfa\x3d\x07\x0a\x0e\xf6\x4f\x67\x0e\x30\x9d\x5a\x27\x87\xd8\xfd\x11\x3c\x5a\x9f\x02\xd2\xfd\xd6\x3d\x14\x7c\xfa\xb1\x29\x1e\xcd\x8e\xe9\xb7\x20\x2b\xb5\xb1\xf5\x0d\x09\xd9\xe7\x75\xc2\x94\x4e\xe0\xb8\x56\xfa\x06\x6e\x4e\x5d\x35\x04\x8c\x02\xef\x97\xd0\x3f\x7a\xf0\x92\xdc\x53\xaa\x72\xed\xb9\xab\xdc\x86\x1c\x39\xf7\x43\xec\xdb\xc4\x79\x27\x64\x8b\x02\xf2\x86\xc4\x27\x37\xf4\x0a\xaf\xc2\x6d\xd6\x3f\x38\x97\x10\x33\xf5\x6e\x36\x7d\xe1\x71\xe5\x8f\xc4\x51\x0e\x21\x22\x4a\x04\x63\x29\x93\x21\x6b\x4f\x56\x41\xe6\xde\xa8\x8b\x73\x8f\xbd\xa1\xe7\xb8\xf9\x2e\xc4\xf4\x46\x5e\x91\x0e\xc6\x61\xaa\x2d\xb7\xc8\x88\x58\x9c\xfa\x24\xec\xdf\x6f\x33\x54\x1a\x03\xc0\x07\x52\x15\x6d\xe8\x60\x73\xb4\x2b\x88\x1d\x7a\x4a\xd9\x6e\x3c\x07\xba\x49\x31\xc4\x80\xcc\xdf\xc0\xf5\x4d\x85\x9e\x37\x6b\x3e\xd6\x03\x04\x0a\xad\x3a\x8b\x71\x85\x7d\x1d\xbf\x81\x44\x37\xa9\x80\x6b\x9d\xce\x58\xfe\xb8\x34\x12\xde\x0f\xc2\xbc\xca\x4b\x50\x74\x74\x22\xaa\xb1\x43\x47\x80\xa2\x3f\x90\x40\x70\x8c\x57\xd9\x3d\xb5\x4c\x1d\xa2\x42\xdc\x58\x79\xc4\xcf\x5e\x4b\x7e\x7d\xe1\x0a\xab\x0d\x41\x02\x71\xc7\x72\x1e\xc4\xe3\x5b\xaf\xbb\xda\xff\x5e\xb9\x76\xfd\xcd\x7b\x3b\xc6\x3c\xd6\x42\xdf\x24\x34\x4a\xbe\xec\xd8\xaf\xad\xb9\x2e\x31\xe5\x5c\xb3\x8d\x21\x89\x3b\xcb\x8d\xb3\xb2\xc2\xa9\x91\x8a\x4e\x79\xff\x30\x17\xba\x7a\xa9\x57\x6d\x83\x7d\x38\x04\xc5\x13\xeb\xdf\x3b\x42\xc2\xfc\xe0\x49\x48\x1c\x1e\xaa\x5f\xc2\xbc\x7d\x84\x93\xfb\x30\xad\x0b\x9c\x1d\x31\x6e\xc2\xbf\x61\x94\x6b\x6f\xbb\x84\x94\x24\xa8\x64\x13\x0e\x0e\xc0\xd7\x14\x32\xcf\x70\x47\x8d\x48\xe0\x45\x98\xe2\xf0\x58\x68\x15\x2f\x46\x23\xdd\xc2\xd1\xaa\x29\xf7\x80\x0a\x1c\xdb\x26\x47\xe8\x29\xf8\x6a\xc6\xac\xd1\xb3\xb9\xfb\x92\x56\x35\x33\xd2\x35\x8d\x67\x96\xbb\x53\xcf\x27\x0d\x66\x4b\x51\x97\x81\xcb\xd2\x4d\xa8\x1d\x50\x38\x4a\x7f\x2d\x75\x3e\x78\x46\x4b\xf5\xc9\x8c\x47\x3e\x3e\x86\x98\x12\x67\xb6\xcb\x99\x84\x89\x5a\x5a\x6a\x69\x09\x21\xc5\x05\x0c\xeb\x39\x24\x93\x3e\x14\x72\x2a\xb0\x9e\x22\xee\xee\x0e\x57\xa5\x5b\x3d\x90\xa0\x78\x6f\x86\x42\xf3\x39\x66\x6c\x81\x8b\x66\x83\x01\x96\xf9\x53\x37\x46\x53\x38\x14\x95\x86\xc2\x83\xbf\xbe\x2f\xf9\x54\x2f\x3b\xe7\x8b\x8e\xe5\xfb\x71\x74\x9e\xe7\x96\x96\xc6\x90\x5a\xe6\x06\xc2\x43\x01\xc5\xff\xfd\x7c\x04\x2c\x6f\x68\xea\x48\x8d\xfa\xb2\x7c\x4d\x64\xac\x6d\x88\x92\xc1\xd2\x04\x35\x97\x3c\xf8\x78\x64\xf1\xaa\x48\x56\x18\xc3\x20\x87\xe4\x49\x10\xc9\xde\x76\xb6\xd6\x0b\x58\xf9\x0a\x64\x7a\xb6\x34\x91\x04\x44\x3e\x1e\xb5\x60\x26\x60\x8f\x73\x80\x5f\xb8\xc7\x87\x04\xdf\x2f\x34\xa2\xd2\x52\x3d\x5c\x55\x57\xfc\xcd\xd5\x9f\x0b\xe0\xdc\x89\xa3\xf9\x45\x51\xc1\x93\x88\xbf\x36\xa2\x76\x89\x23\xa9\xb4\x23\x85\xe1\xcb\x2b\xc7\x93\x63\x4d\x70\x1f\x83\x61\x8b\x5d\xf1\x68\x9b\x0a\xae\x27\x3c\x17\xbc\x81\x06\x4c\x8f\x58\x3c\xa7\x39\x8f\xdf\xd0\xa3\x35\xf4\x83\x2c\x9a\x39\x3b\x9d\x6c\x7e\x15\x58\x3d\xf4\x88\x82\xad\x9d\x54\xce\xb0\x93\xf3\xc7\xdf\xe1\x76\x0a\xf6\x2f\x52\x4f\xbd\xe5\x44\xdf\x47\x46\x0b\x37\x3b\x59\xe7\x9b\x4a\x69\x5f\xd9\xd5\x7f\xc5\x9e\x16\x83\x72\xe9\x03\x00\x1a\x34\x31\x98\x03\xcb\xe7\x95\x0e\x62\x00\xed\x69\x52\xfd\x73\x2a\x1c\x41\x41\xe5\x97\x9e\x46\xf6\x86\xf5\x53\x00\xd7\x3c\x75\xe9\xf5\x4e\xff\x34\xea\xb7\x80\x36\x4d\x25\xa5\x2e\x60\x7e\x9e\xc5\xf5\xa3\xe7\xd7\x2a\x4b\xa5\x2b\x5c\x96\xac\x3f\x5b\x85\xe8\xdb\x04\xb0\x3b\xa4\x43\xd4\x6c\x67\x80\xd8\x5b\xbf\x90\xbd\x86\xd8\x9b\x87\xbb\x93\x1f\xcd\x04\x2c\x03\x61\x70\x6c\xa3\x26\xc0\xf6\x42\xf4\xc8\x5a\x0b\xa4\x4d\x05\xbe\xe3\x14\x70\x4a\x2a\x06\x4c\x3e\xcf\xde\x42\x0f\x29\x39\x26\x3f\x3e\x10\xa3\x67\xef\xe0\xc7\x83\x79\x8c\x53\x02\xc6\x5b\xfe\x4d\xfd\xa2\x74\xfc\xa8\x4a\x95\xcd\xc9\x07\xe6\xcf\x02\x49\xb7\x12\x37\x67\x3d\x5f\x65\xfa\xdd\x63\xfb\xaf\x0e\xa1\x42\x33\x2a\x4d\x9f\xb3\x36\x61\xa4\x2a\x38\x9b\x05\xe2\x2f\x5b\x18\x10\xbb\xfb\xb3\x08\x4f\x77\x5d\x8d\x6f\x40\x98\xdd\xc5\x68\xd0\x1a\x3c\xf3\x82\x6a\x9d\x45\xe2\x4b\x04\xb1\xd9\xf2\xf1\x23\xf8\x9d\xf2\x47\x1e\x57\x42\xf6\xac\x21\xe7\x2a\x40\xa7\x2f\x45\x43\x0c\x82\xc6\xa0\x5d\x01\xa5\x17\xc7\x67\x4e\x78\xb4\x41\xeb\xd0\xb8\x86\xa3\x24\xbc\x80\xd0\x0b\x41\x24\x80\xf5\x4e\x90\x73\x7f\x08\xd7\x4b\x42\xe6\xad\xb9\x9b\xdb\xd9\xda\x73\x21\x91\x24\xdb\x91\xa5\x83\x71\xfd\x56\x3f\xc7\x18\x6e\x8e\x9e\xf5\xd4\xa6\x36\xda\x69\x1a\x4f\x90\x60\x5c\x7d\xd2\x30\xe2\x9d\xdd\xd8\x25\x7a\x4c\x0a\xce\x38\x85\x66\x13\xab\xa0\xa8\x45\x7e\xb8\x0c\x49\x2a\x1b\x7e\x9e\x1b\xc7\x63\x16\x4b\x93\x2a\xcf\x4d\xe3\x69\xde\x84\xa3\xab\x36\x4c\x97\xaf\xf8\x88\xfb\x2d\x24\x65\x3a\x39\xcc\x44\xef\x4a\x24\x60\x42\x99\xc5\xff\x4b\x12\x10\xd3\xfa\xbd\x57\xa0\xf1\x06\x56\x2a\xfd\xc3\xfa\xe6\x59\x91\x6d\x0b\x60\x5e\x3c\x5f\x29\xd8\xe3\xa3\x80\x05\x23\x90\x64\x3c\x98\xce\xd1\x96\x6a\xca\xc6\x94\xce\x90\x7b\xba\x66\x51\xbf\xe1\xb1\xc5\xe9\x1a\x3c\xb6\x68\x29\x55\xc7\x4a\xfc\x1c\xa5\xd4\x1e\xd0\x46\x17\x5c\x6f\x26\xe5\xce\x02\x92\xcc\x2c\x18\xe2\xbb\x7c\x51\x5c\xf4\x11\x5a\x42\x8f\x53\xb2\xa6\x0e\xd4\x63\x23\xe2\x40\x3d\x9f\x87\xf9\x43\xf1\x10\x83\xe8\x21\xf1\x67\xc0\xf3\xd4\x5c\x5a\xd8\x31\xc9\xf2\x58\x59\x7f\x7d\xc0\x18\x98\x2b\x72\x00\xf5\xb2\xbe\x08\xd5\x29\x9b\x94\x74\x95\x6f\x38\xf4\xa6\x92\x6a\xc1\x8f\xb9\xc1\xfe\x1f\xb1\x66\x9d\x0f\x26\xd8\x21\x41\x95\x67\x89\x50\x09\x1d\x28\xdb\xc4\xc7\x9c\xae\x96\x41\x03\x92\xcf\xef\x84\xcb\x52\xb1\xd6\xfd\x08\x60\xba\x05\x63\x24\x40\x1e\xd6\xe7\x51\xe6\x2a\xcf\x01\x08\xf4\x96\xf3\x01\xe1\x5f\xff\x05\x18\x08\x31\xa0\xea\x3d\x7c\xbc\x1c\x4f\xf7\x92\xfa\x17\x66\x1b\x6a\x1c\x11\x4a\x2e\x38\xdf\xa1\x33\xa5\xa9\x86\x0b\xfa\x79\xb0\x37\x79\xa9\xdd\x2d\xb6\x54\x89\xce\x33\xd5\x0a\x91\x81\xfa\x03\xea\x13\x8a\xf0\x6b\xdf\x35\x7c\xa1\xcd\x79\xd8\x4a\x30\xcd\x73\xc0\x61\x32\x07\xc6\xd9\xf1\x62\x04\xf0\xbd\x66\xcd\x0a\x87\x7a\x64\x82\xfc\xe0\xd4\xaf\x68\x0c\x2b\xae\x44\x05\xdf\xa1\x62\x12\xab\x70\x24\x1a\x7d\xb0\x76\xcc\x73\x9c\x43\x1d\x3e\x5e\x83\x1b\x00\xf4\x04\x82\x9c\xa9\x8f\xa1\xf6\x52\xaa\x2a\x4e\x04\xf7\xb1\x20\xc4\xaa\x3a\x80\xb7\x2f\x7e\x08\x18\x61\x8e\x47\x67\x70\xd9\x7e\x62\xf8\x80\xfd\x62\x80\xf7\xd7\x8f\x55\x36\x89\xd8\x0d\x01\x7e\x19\x4a\x90\x87\x07\x1b\x14\x01\x4d\xa2\x0f\x6a\xd0\x1d\x4c\x48\x94\xe0\xfc\x75\xd6\x9a\x03\xaf\x38\xab\x65\x18\x9a\xc4\xf5\x30\x07\xfa\x94\xeb\x7b\xd5\x43\x87\xe8\x0d\x01\x32\x14\x74\x64\x80\xd4\xa4\x10\x82\xc8\x8a\xb3\x7d\xb0\x37\xb5\xbe\x03\x5f\xa8\x81\xfb\x90\x43\xab\x75\x50\x72\x6a\xc8\x9b\x4c\xb6\xc0\xba\x2a\x11\x9e\x17\xd3\x58\xd6\x9f\x55\x19\x6e\x2d\x85\x68\xc4\x4e\xc0\x1f\x98\x71\xf1\x02\xe6\xe6\xae\xf5\x5e\x65\xc0\xf5\x0a\x27\xae\x4a\x4b\x80\x21\x69\x98\x0d\x31\x01\x7e\x63\x0d\xad\x70\x88\x67\xa2\x4c\x18\x98\x57\x17\xf4\xe6\xfc\x54\x31\xf6\x7f\x72\x5f\x6b\x2e\xfd\xd6\x5a\xdb\xf4\xf3\x7f\xb4\xea\x22\xa6\x8c\x6e\x17\x7d\x0d\x34\x5f\x4d\x83\xec\x93\xce\x2a\x55\x2b\x6c\x2c\xdc\x1c\x68\xc6\xd2\xa1\xb2\xd0\xde\x5e\x45\x54\x9f\x3a\xf3\x53\x46\x5c\xf6\x1c\x2c\x5b\x65\x28\x9d\xf9\x5e\x7e\x2a\x7d\x00\xb0\xfa\xf2\x21\xd6\xad\x50\x29\xac\x2f\xff\x04\x1f\x7c\xb2\x95\xed\xff\x3c\x6f\x40\x32\x06\xcc\x10\x98\xb6\x42\x05\x2c\x9b\xdf\xcc\xf4\xba\x2a\xe7\xb3\x09\x64\xfd\x91\xb4\x82\x56\xf6\xa9\xa8\x29\xab\x20\xd6\xbf\x2c\x3c\x13\xe5\xde\x7b\x08\x16\xf3\x9f\x40\x66\x88\x08\x3b\xd0\x2b\x0e\xad\x1c\x63\x55\xd6\x52\xde\xc6\x7d\x99\xf5\x5f\xc0\x6d\xf6\xa0\x9f\x38\xec\xf0\x0e\x4e\x66\x62\xa5\x99\x89\x61\x26\xe9\x87\x70\xf6\xfc\x2e\x90\xa4\x24\xe9\x10\x64\x3e\xeb\xbd\xcd\xe5\xbc\xdc\x01\xa5\x2e\xa9\x74\x11\x8e\x38\x41\x29\x8c\xaf\x8e\x7b\x82\xd5\xf0\x04\x93\x01\x1f\x40\x6a\xca\xbb\x03\x81\x78\x0b\x02\x09\xd1\xb8\x50\xf5\xb2\x96\xf9\xc1\x79\x9c\xbd\x25\x7e\xd0\x6c\x93\x75\xa2\x53\xe0\x09\xa6\x47\xc2\x1d\x2d\xb4\xae\x0b\x4c\x64\x1f\xaa\x84\x08\xd3\xd9\xc4\xbc\x5e\x41\x77\x80\x95\x58\x13\xec\xba\xd4\x49\x23\xd2\xb5\x43\x3d\x2a\xbc\xc5\xec\xe5\x8d\x0d\xad\x8d\x70\x02\x00\xcc\xc4\x24\xa7\xef\x61\x03\x54\x6a\x43\xc0\x82\x75\x48\x15\x0b\x90\xe6\x78\x36\xc3\xb0\xe3\xd0\xca\x43\xff\x6e\xbf\x65\xf8\xd5\x04\xca\xec\xb5\x55\x70\xd8\x24\x24\xf4\xc6\xba\x53\x48\xcc\xf5\x93\xb4\xa1\xbd\x46\xbf\x8a\xe6\x71\xae\x52\x23\x7b\xc4\x2e\x83\xb2\x40\x7d\xea\x09\xed\xed\xde\x62\x67\x74\x55\xf2\xe7\x76\xb7\xa5\x83\x85\x82\xfa\xc5\xa0\x19\x24\xa2\x24\x22\xcd\xfc\xae\x86\x1a\x72\x57\x77\x61\x38\xc9\x31\xeb\xaa\x90\x66\x95\xa2\xdb\x5d\x1d\x56\xe1\x2b\x6d\xb6\x3f\x25\x11\x23\xec\x83\xf3\xec\x6e\x01\x34\x25\x81\xd0\x85\xd7\x17\x6a\x46\x12\x2c\x2b\x55\x4b\xb2\x5e\xa0\x85\xb6\x10\x4d\x59\x02\x4c\x89\x77\x9c\xdf\xcd\x9b\x60\x9a\xeb\xda\xe0\x9d\xf6\x3a\x35\xf4\xe6\x10\xf2\x67\x40\xca\x50\x0b\x07\x96\x21\x02\x6f\x86\x0e\xa3\xe3\x38\x2f\xfd\x3b\xb7\x61\x7e\x47\xc8\xd4\x52\x47\x6d\x85\xae\xbc\xa9\xdd\x55\x5e\x64\xe2\x22\x10\xa4\xaf\x54\x69\x8f\x76\xf0\x01\x14\xd4\xb2\x92\x30\xd4\x15\xd5\x1b\x3a\xdc\x93\xc6\x97\x06\x9e\x73\x0e\xf4\xe6\xa5\x2d\x35\x36\x25\x9e\x93\xbf\xa8\x9c\x25\x1c\xd1\xd4\x1e\x76\x45\xec\x0c\x0b\xbe\x47\x93\xee\xda\x3a\x54\x06\x23\x47\x91\x5d\x91\x29\x64\xb7\x5a\x5b\xe6\xe7\xbf\x52\x74\xe9\xe6\xf4\xbf\x5b\x9d\xea\x2c\x00\xea\x9a\x21\xa2\x4e\xd3\x34\x16\x9b\x51\x1d\xc4\x50\xe7\x47\xe0\xcd\x90\x84\x03\x44\x53\x67\x3b\x07\x6e\xaa\xfb\xe3\x78\xde\xcd\xcc\xfc\x75\x18\x12\xfa\xab\x6a\x11\x94\x84\x89\xfd\x1c\x05\x94\x14\xb6\xcf\x96\xcc\xa4\x74\xb0\xc6\xe6\xc3\x00\x6d\x73\x62\x28\x5d\xc6\x3f\x22\xe2\x62\xf9\x16\x3b\x1a\xbe\x27\xac\x04\xba\x6d\x60\xce\xf1\xee\xc3\x16\x73\x9a\x85\xde\xdc\xad\x05\xa9\xc2\x76\xee\x57\x40\x35\x85\x35\xec\x30\x8f\x87\x8d\x22\x35\xdf\xe2\xdb\x55\x0a\x6b\x8e\xfb\x26\xe6\x74\x7d\xac\x21\x76\x97\x57\x8a\xe8\xe5\x25\xce\xf1\x37\x71\x39\x33\x3f\xd3\x61\x60\x15\xea\x71\x54\x10\xb4\x89\x1e\x7f\x44\xda\x3b\x48\x38\x08\x84\xf9\x22\x22\x97\xda\xaf\x9d\xdb\xab\x79\x60\x83\xcb\xac\xc0\x4d\x0c\xe4\xc6\x76\x37\x5b\xb7\x8b\x34\x53\x0b\x94\x0c\x73\x8d\x38\xc2\x59\xd1\x16\x85\x0c\xdc\x42\xac\x28\x85\x03\xd3\xd6\x36\x5e\x01\xa6\x62\xa4\x23\x42\xf8\xe9\xa5\x88\x97\x31\xd9\xf3\xe4\xa8\xc4\xb7\x46\x30\x68\xce\xd8\xe8\xa7\x6b\xd2\x5c\xd4\x22\xbd\x4b\xf0\xea\x14\xf1\x1e\xad\xe2\x5b\x60\x4d\x24\xee\x81\x2c\xf3\x0f\xe4\x72\xba\xa9\x16\xb5\xdb\xdc\x8b\xe7\xd6\xda\xde\xbb\x99\x1f\x87\x73\x96\xc8\x54\x83\xb2\x4d\xa9\xb4\x9d\x0e\x01\x49\x6e\xc7\xe9\xeb\x03\x95\x36\x41\xd2\x93\x35\xdc\xbe\xd3\x26\x25\x33\xf7\x5c\x74\x79\x4d\x78\x74\xa8\x0a\x65\xa1\x10\x51\x0e\xf4\xb4\xe1\x2e\x01\x9a\xa1\xde\x63\x01\x9f\x50\x5c\x0a\xe6\x09\xac\xeb\xf0\xdf\xbd\xf6\x52\xe4\x40\xc4\xda\x68\x5a\xa6\x9b\x10\xd8\xa9\xd2\xf7\x0e\xf3\x5f\x19\x07\x83\xe4\xed\x17\x67\xf8\xa2\x3f\xa1\x0b\xe7\xeb\x3a\xcf\xfd\x26\x60\x71\x7f\x20\xfe\xe6\xfd\xd4\x07\x25\x6c\xc1\x35\x67\xa7\x8b\x7c\x98\xca\xff\xa8\xaf\xf9\x40\xea\xce\x97\x2c\xcc\x7f\x92\x70\x3b\x1f\x89\xca\x7f\xec\x3f\x78\x23\xf5\x2e\x8e\x48\x82\xdc\x20\x0e\xf0\xde\x83\xf9\xf3\xce\xcc\xab\xbd\x73\x90\x2a\xdf\x6e\xe5\xfb\x43\xe3\xb9\x9b\xdf\x35\x89\x80\xb7\x0d\xf5\xa8\x2d\xe7\x75\x0b\xfc\xae\x97\x9c\xbb\x90\xf2\xf8\x23\x10\xf7\xe0\x74\xc3\xa2\x14\xa0\x4f\x98\x5b\xec\x1e\xfd\xee\x89\xab\x7e\x7b\x4e\xb2\x80\xf4\x0c\x33\x39\x07\x84\xd3\xad\xee\x7a\x85\x40\x9c\xca\x7b\x2f\x17\x6d\x87\x7a\x1a\x37\xdd\xa3\xf9\x46\x39\x40\x8f\xf4\xcb\x7a\x42\x51\x21\x2d\x8c\xa6\xf1\xd5\xb8\xe6\x2f\x2a\x9d\xbd\xe6\x24\x91\xb7\x69\xbe\xf9\xb6\x22\x02\x74\x5f\xf2\x73\x02\x4c\xbd\x90\x97\x52\xbe\xfe\xd5\x08\xbe\x2f\x8d\xb1\x5f\x4a\x7b\x41\x85\x8e\x9f\xd7\xc0\x8c\x36\x7d\x3a\x1b\x0f\xf8\xb0\xf1\x85\xd6\x20\x30\xa8\x43\x73\x6c\x78\xb9\x7b\x10\x82\xf4\xd6\x63\x6f\xd1\x1f\x11\x3a\x18\xae\x27\x8f\xee\x4f\x04\xfa\x81\xcd\xfd\xd9\x23\xf6\x6e\x2f\x10\x82\x88\x65\x8d\x39\xfd\x4b\x22\x74\x40\x52\x3c\xcb\xa8\xff\xb6\x7e\x6f\x58\x9a\xf8\x35\xf2\x55\xda\x63\x18\x38\xc8\x79\x92\xf7\xf9\x04\x8e\x97\x50\x56\xbe\xa5\xcf\x22\xc6\xdf\x73\x3e\x47\x0a\xe1\x09\x89\x8a\xdc\x0b\x47\x3b\xae\x93\x17\xa6\xa8\xfe\x41\x82\xac\x40\xb6\x72\x1d\x1c\x7c\xde\x8c\x22\x95\xfa\x04\x75\xca\xbf\xf5\xc2\x01\xad\x42\x41\x99\xf5\x3e\xd9\x02\x01\xb2\x01\xd5\xf7\xc4\x02\x63\xee\x2a\x38\x06\x82\x76\xb8\x35\xfd\xc7\xc7\xfd\x99\x7d\x26\x2c\x78\xac\x27\x8b\x9f\xc8\x3e\x64\x06\x2f\x01\x68\x77\x0d\x00\x9f\x42\xe6\x26\xb8\x44\x14\xd6\xe7\xdc\x85\x54\x5a\x79\x2e\xf7\x12\x36\x80\x4a\x0a\x84\x9e\x1e\x1d\x52\xf9\xe9\x28\x79\x6d\x1f\x60\x86\xc1\xdd\x5d\x61\xcf\x2f\x61\x0d\x05\xa7\x6a\x4b\x57\xf0\xa8\x67\x62\x5f\x54\x0f\xe9\x0d\xd4\x63\x78\xfb\xfd\xad\x1c\x5c\x55\x40\xe2\xbd\xd0\xe3\xf5\x2b\xee\xde\x8c\x2f\x11\x69\x3e\x5f\xd7\x37\xf3\x27\x64\x56\xee\x8c\x92\x50\xba\x0b\x91\xb8\xa7\xfd\x9d\x0a\x77\xb9\x62\x23\x94\x5c\x9e\x0d\xe9\x59\xae\xbf\x61\xb6\x2e\x69\xe0\x1b\x27\xc9\x7d\xfe\x82\x7a\x61\xbe\x1d\x46\x86\xc5\xe1\xa2\x67\xbd\x62\xf7\x33\x28\x3d\xb0\x31\xd4\xd8\x1b\x76\x2c\xfe\xff\xdc\x7b\x39\xe0\xb9\x59\x80\x39\x8b\x06\x36\xbd\x16\x91\xc2\x6a\x77\xf0\xad\xe9\xb5\x85\x8e\xf8\x2d\x74\x68\xbe\x0b\xc5\x23\x6c\x69\x53\x7f\x97\xbc\xe2\x27\x9f\xe0\x5a\xbb\xaf\x22\x2e\x7a\x00\x01\x77\xe5\xa6\x72\xcf\x67\x28\x03\x86\xaa\xdf\xcc\x57\xda\x2e\xb3\x75\x0b\x81\x69\xd5\x35\xbf\xe7\xa1\x4b\x02\xd0\xbe\x00\x65\xf5\xa3\x4e\xca\x61\xb8\x65\x62\xd8\xcd\x3b\xfe\x56\x9b\x96\x53\xd3\x2b\x94\x72\x1b\x18\x77\xce\x4d\x66\x50\x3a\x66\x9a\x1f\x41\x2f\x87\xf9\x77\x9b\x1c\x3d\xd8\x3b\xdc\xe9\xdd\x11\x11\x78\x27\xa5\x94\x6e\xc1\xee\x6f\x75\x0c\x8e\x95\x97\xcb\xea\x6d\x2f\x32\xe5\x0d\x53\xc7\xf9\x8f\x05\xb4\xe6\xbe\x3e\x79\x21\x7f\xee\xfa\xa4\x2f\xf4\xc5\x05\x08\xb1\x44\xfb\xaa\x46\x95\x40\xdc\x47\xfa\x23\x40\x28\xa8\x2e\x56\xdd\xc4\xda\x22\x01\x46\x04\x69\xd5\x83\xee\xf1\xf6\x0d\x39\x5e\x83\xee\xe0\x2c\xd9\xc1\x2e\x94\xca\xdc\x86\x51\x01\xc5\x81\xdd\x80\x31\x0b\x61\x7b\xbe\x03\x12\x6c\x8f\x90\xbe\x86\x02\x9a\x02\xa6\x6a\x91\xe4\x0a\xe3\x45\x28\x9f\x35\x9f\xc5\x33\x4d\x02\xd9\xb6\x87\xce\xc2\xb2\x5c\x61\x19\x88\x11\x53\x7b\x61\xec\xd3\x22\xb0\x6f\xd0\x28\x6c\x94\x1e\xf8\x4d\x3c\x0e\xbe\x04\xe3\x9a\x28\x43\xf7\xb4\xe4\x66\xa0\x81\xef\x47\x99\x56\x7d\xd2\x7c\xc7\x3b\x10\x9d\x42\xe3\x09\x59\xf8\x78\x84\xc4\x61\x0e\xd9\xc5\x66\x0c\x6f\x63\x73\x41\x1f\xed\x7e\x22\x53\xfe\x56\x9c\xc2\xe8\xd2\x15\x12\xb5\x76\xd4\x44\x51\xe8\x60\xdd\xca\xff\xea\xdc\xb9\xe7\xe1\x71\xd6\x10\x80\x74\x7d\xc4\xcc\x28\x4f\x11\x08\x29\x7c\x36\x1b\xca\xa3\x08\xcb\x71\x1d\x73\xe0\x45\xed\xea\x09\xd1\x7b\x68\xab\x02\x48\x2d\xaa\x3d\x7e\x9b\xda\xe5\xda\xcb\xeb\x0b\xff\xdd\x13\x6f\xec\xf6\x26\xc1\xc8\x02\x7e\xb1\xa6\x37\x07\x67\x2e\x6e\x18\x11\xbb\x19\x1b\x67\x3c\x67\x41\x7d\xb3\xae\xf3\x6f\x91\x72\x95\x45\x44\x25\x5d\xb6\x89\x0d\x21\x89\xee\x05\xbb\xe7\x0e\x14\x2f\x81\xc8\xc0\xea\xec\x29\xc0\xb8\xb5\xe9\xbb\x5d\x13\x25\x06\x30\x3b\x10\xca\x73\x9a\xb7\xd4\xd5\x45\x52\x80\x93\x4d\x5c\x08\xdc\x75\xd5\xe7\x9b\xa1\x80\xf8\x00\xe7\x4a\xdb\x70\xd0\xb0\xc9\x71\xba\xfc\x2e\xd5\x8e\x4b\xe4\x24\x78\xb0\x40\xe9\x01\xb3\x3b\xf0\xb0\x69\xd2\x25\x07\x60\x57\x8f\x24\x18\xfe\x36\xac\x70\x5c\xa7\xaa\x0c\x97\x2a\xa4\x97\xb4\xaa\xae\x3c\x7f\x4d\x65\xe9\x89\xe9\xc1\xc4\x05\xd1\xe2\x79\x0c\xa0\xaf\x83\x6b\xf9\x7f\xfa\x79\x63\x95\x9b\x48\xda\x10\x49\x84\x6a\xae\xc0\xad\x2f\x92\x92\xe5\x94\x99\x19\xd6\xaf\x3d\x25\x00\x98\x5a\x7b\x26\x21\x63\xf1\x44\xec\x0a\x65\x44\xda\x83\x66\xd0\x76\x0a\xdd\x4b\x57\x69\x14\x7c\x77\x4b\x4d\x97\xd1\x21\xb7\x0a\xe3\x98\x71\x8f\x00\xf8\x13\x2e\x78\x52\x93\x80\x87\xb3\x0b\xcd\x52\xd8\x67\x86\xac\x35\x3f\x04\x12\xf7\x3c\x42\x9e\x11\xb9\x37\x5f\x09\xc4\x81\xbe\x4f\x47\x51\x9e\xf3\xfa\x56\x8a\x2e\x0a\x43\xcf\x0a\x13\xc5\x7d\xaf\xb4\x7e\xa2\x15\x49\x01\x95\xc7\xb0\x5e\xf0\xef\x06\xbb\x4e\xbd\x48\xb9\x30\xac\x77\x40\x26\x20\x69\x04\x60\x56\xd1\x8a\x4f\xef\x1a\xf9\x25\xd0\x95\x04\xc8\xe2\x75\xfd\x71\x80\x6c\xde\x08\x67\xfd\x47\x88\x29\x58\x55\x44\xe0\x96\x7a\x52\x96\x51\x43\x30\x6b\xdb\x2a\xa5\x77\x91\x22\x39\x37\xbe\x14\x8e\x9f\xe5\xf6\xda\xbc\x50\x02\x51\xae\x65\x67\x11\x12\x36\x50\x01\x27\x9b\x29\x48\xed\x6a\xc3\xe0\x5d\x38\x15\x56\xcb\x3d\xbc\x32\x69\x64\x39\x93\x2a\x79\xce\xcc\xf6\x9d\xf3\x78\x71\x8a\x74\xba\x1b\xa5\x9f\xf9\x1c\xda\xbd\xa7\x6c\x0e\x4e\x70\x4c\x03\x97\xe2\x98\xd9\x4a\x58\xec\x5b\xdd\xe1\x99\x5f\x33\xe1\xae\x4e\x6c\xda\xb9\xae\x86\x63\x27\x75\xed\x4e\xe9\xaa\xb9\xee\x70\x78\x73\x4a\x01\xde\xbd\x39\x39\x69\x73\x3c\x6d\xfb\x5f\xd3\x49\xe5\xca\xb0\x0d\xb3\x06\x2e\x0b\x3b\x0d\x47\x2b\x62\x67\x2b\xcf\x92\xb9\x0e\x20\x01\xe8\x07\x71\xa6\xab\x63\x53\x7b\xda\x33\xc3\xdf\x2d\x2a\xfb\x99\xe4\x47\xe2\x12\x91\x52\x92\xec\x39\x3c\x07\xc2\x23\xeb\x88\xf1\xfb\x52\x77\xca\xf4\xb3\x2b\x7e\x37\x6c\x44\x7a\x69\xec\xee\x16\x7c\xb7\xb2\xd1\x07\x64\xcb\x82\x7d\x84\x56\x5b\x58\x5a\xc9\x76\x1d\x70\xa9\x8c\x48\xad\xed\x81\xfa\x6d\xe2\xff\xb6\xb8\x13\xfb\xf6\x40\xd6\x5b\xea\x91\xa7\x84\x96\x1c\x46\x2b\xa0\xec\x51\x7a\xe2\x69\x37\x8e\xc0\x2d\x10\xbe\x36\x1c\x3c\x57\x50\x07\x9e\x3c\xc2\x3a\x0b\xbb\x7f\xd8\x3c\x2f\x51\x52\x71\x7d\x6f\x2c\xca\x5a\xf3\x26\x67\x18\x8b\xa8\xad\xe8\x72\xb5\x08\xe4\xfb\x0c\xd7\xcf\x49\xc2\x94\xbd\x34\x28\x9b\x28\x88\x85\xc9\x8b\x96\xee\xe3\xa9\xf6\xd6\xba\x98\x8e\x3a\x98\x0f\x3e\xa8\x47\x8e\x5f\x91\x39\xde\xb1\x65\x48\x3a\x5a\xd3\x39\x13\x17\x0b\x90\xa3\xa2\x06\xac\x5d\x22\xb0\x06\xd3\xcf\x32\xef\x49\xfb\xad\xb2\xdf\xf4\xe9\xde\x2c\x4c\x2e\xba\x65\xee\x01\x87\x57\x69\x5e\x66\x25\xb8\x8f\xac\x1f\x9d\xde\xa1\xce\x99\xfe\x6d\x42\xd3\xbe\xd6\xf9\x8b\x21\xa6\x98\xde\x91\x08\x58\xb2\x25\xb3\xe8\x16\x78\xf7\x71\x68\x06\x6a\xcb\x44\xa4\xae\xf5\xd7\xd4\xaa\xbc\x04\x4e\x46\x45\x85\xf7\xd5\x7a\x77\xa1\x78\xcf\x90\x96\x38\x84\x30\x3d\x84\x1d\x3b\x12\x48\x4b\x97\x54\x2f\x0b\xcb\xc0\xc8\x20\x6f\x59\x5e\xa1\x91\x61\x39\x92\x73\xcf\xa0\x3e\xfa\x9c\x59\xbb\x6b\x5e\x6e\xc5\x7b\x42\x04\xe7\xbd\xd2\x89\xa9\x9c\x74\x74\x2b\x9a\x0e\xd8\xc4\xd6\x1e\x19\x3a\x84\xb2\x85\x2e\x13\x69\x39\x25\xae\x5c\x71\xf6\x54\xd0\xc4\x00\xe2\x95\x30\x5d\x19\x38\xb4\x2d\x43\x56\x46\x44\x0e\x64\x05\xf9\xed\x5d\x91\x04\xd7\x5c\xc3\x8f\x80\xde\x97\x26\xde\x16\x0d\x12\xd0\x7c\xea\x2d\xd9\x09\xb8\xde\xed\x34\x55\xe5\x84\xa6\xa6\xbc\xb4\xf6\x28\x6d\xec\x65\x0d\xf4\xef\xf5\xc7\x88\x74\x11\xaf\x74\xb7\x6e\x72\xa2\x62\x2f\x42\x55\xc8\xf7\x5c\xc1\x3d\xa5\xbc\x66\x8d\x19\xfb\x9e\x39\x03\xa4\xfa\xa1\xaf\x49\x73\xe8\x6d\x8e\x69\x93\x5c\x63\xa8\xa1\x6f\x15\xa3\xf8\x3b\xa0\xbe\x83\xa6\x68\xd6\x6c\x53\xf7\xaf\x4e\x6b\xa7\xe9\x85\xbd\x8a\x7f\x84\x0d\x36\xa8\x70\xf9\xd2\xad\x68\x36\xb4\x01\x44\xf7\xda\xe4\x8f\x15\x0b\xff\x64\xef\xbb\x70\xf6\x1e\xff\x10\xeb\xab\x65\xbe\x78\x28\xd9\x1f\x6d\xc5\x5e\x73\x1e\xcd\x66\xcf\xe5\xad\x88\x45\x09\x44\x72\xe1\x72\x13\x54\x8d\x29\x01\xf5\xd5\xb5\xde\x9c\xe3\x25\x70\xf0\x1a\x83\x77\x0b\x07\xdd\xdf\xad\x4c\xfc\x55\xf2\xe4\xf3\xaf\xe7\x6b\x22\x70\xd3\xc1\x53\x81\x87\x70\x74\x70\x12\x74\x18\xcf\xeb\xcc\xc8\xae\x7f\x43\xd1\xc2\xcb\x97\xca\x99\x5e\x3b\xd3\xe3\x60\x1f\xac\x07\xf0\xa0\x09\x61\xe2\xde\x04\xf2\x57\x6a\x09\x5b\xf3\x31\xcd\xca\xa9\x83\xff\xf5\xa2\x58\x97\x7f\xda\xaf\xd8\x65\xbf\x12\xa1\xc4\x3b\x71\xd6\x70\xf6\xe8\x84\xc9\xb6\x46\x82\xef\xe3\x16\xb2\x78\xa8\xfa\xf0\x8a\x79\x11\x9f\xff\x6c\x3a\x55\x2f\xdf\xf2\xa0\x2f\x81\xb9\xf1\xff\xd4\xdf\x32\x78\xdc\x7a\x1b\x4f\x9f\xfe\xfa\x59\x38\x35\x47\xd6\xf2\xda\x15\x85\xb5\x39\x84\x3f\xcf\xc0\x0f\x2f\x73\x8b\xf2\x77\xed\x58\xdf\x01\x3b\x4e\x01\x8f\xb6\x70\x78\x0b\x69\x4c\xa3\xa1\x08\xf9\xec\xf4\x7d\x0d\xc1\x4c\xa0\x92\x43\x3a\x14\x56\x3e\x82\x2a\xaf\x55\x72\xa3\x3d\xdf\x47\xc2\x94\x53\x44\xc3\x1a\xc2\xa4\x69\x2d\xc2\xf7\xbe\x75\x1b\x95\xec\xdb\x92\x0e\x61\x3d\xaa\xd4\x3d\xaf\x2a\x2b\x62\x8b\x25\x8a\x8a\xdb\x40\x69\xcb\x3b\xcb\x11\xf5\x2a\x61\xa6\x7a\x7d\xf1\xcd\x35\x44\x35\x4f\x82\x88\xcf\xab\xac\x59\xe0\x64\x58\xd9\xca\xa9\xd5\xa1\x18\x82\x2a\x07\x84\x64\x83\xe9\x52\x18\xbc\x42\xf2\x93\x67\xc0\x4a\x22\xa4\x3c\x4f\xe9\x76\xee\x63\x60\x9b\x99\x1d\x03\x7c\x59\x50\x76\xe4\x91\xe2\x6e\x43\x13\x90\xbf\x78\x0d\x4c\xf2\xda\xfe\xeb\x2a\xa0\xe6\x96\x7e\x97\x2a\x65\x4f\xe1\xaa\xbd\x35\xf4\xa8\xb7\x59\xe3\xcc\xff\xc0\x37\x35\xf5\xd6\x9c\xe8\xea\xc1\x40\x88\xd8\x65\x71\x41\x57\x6a\x41\xad\x55\x3a\x72\x2b\xd2\x41\x04\x31\x03\xef\x75\x32\xb4\xa1\x48\xc7\x43\x40\xfe\x93\x57\x6b\x85\x66\x88\xa4\x40\xa1\x5b\xe8\xbd\xf2\x2a\xee\xd5\x2a\x42\xcb\x5a\xdc\xe3\x9b\xdb\xef\x41\xaf\x76\x08\x73\x94\x00\xd7\x32\xc9\xf1\xb5\x8c\x4c\x26\x5b\x10\xa9\x8b\xb5\xa8\xd6\xb8\x16\x59\xf1\xd9\x9b\xe2\xfe\xba\x08\x81\x9c\x1c\x09\x6f\xfe\xce\x59\x20\xa4\xc5\x75\xca\x23\xa2\x5d\xe7\x3d\x84\xcc\x4e\x38\xae\xda\x68\x6e\x42\x7b\xee\x31\x7f\x1a\x21\xa5\xab\xb3\x2e\x6e\x1d\xab\x6b\x0a\xa2\xc0\xc6\x04\xc4\x19\x89\xb6\xa6\x56\x6a\xad\x8d\x30\xbb\x6b\x70\x66\x2c\x18\x40\x0c\x64\x48\xd7\xda\xb0\xf9\xf2\xc0\xff\x91\xbd\xcf\x8b\x82\x7d\xa2\x39\xe9\xca\x09\x16\x94\x2c\xf9\x8d\x0c\x68\x07\xae\xd5\x7f\xe9\x56\xb2\xbe\x6c\x28\x34\x09\x0a\xfd\xf9\xb0\xe0\xb0\xa6\x57\xc0\x0e\x56\x8c\x15\x08\x69\x7e\x05\xee\xd0\x42\x5e\x6b\x9b\xb7\x8c\x7b\xa0\xa9\x25\x5f\x5a\xe5\x00\xe3\xbe\xb5\x0a\xe2\x3e\xd8\xfb\x35\x71\x73\x90\x34\xd4\x2a\xe3\x83\x0e\x22\xa4\x99\x3d\xc5\x0b\x57\x08\xc4\x62\x41\x53\x31\xd5\xaf\x05\x52\x43\x27\x78\xc4\x3f\x74\x2d\x21\xfe\xa3\x6d\xd3\x91\x36\x6d\xbe\x81\x4a\x40\x50\x37\x44\x6b\xeb\xd5\x42\xed\xdc\xe7\xa6\xc0\xda\x71\x32\xb8\xa6\x44\x4f\xd9\x7a\x0b\x4c\x2d\x3c\x31\xcb\x26\x4b\x25\x7a\x67\x39\x21\xfa\x24\xab\xda\xda\x04\xea\x16\xf0\xea\xf8\x7d\xfe\x82\xaa\xf7\x08\xc2\xb8\x15\x7d\x24\xdd\x67\xa9\xf4\xbb\x14\x60\x3a\xfd\xf8\x28\xff\x30\x58\x65\x61\xb2\xa8\x45\x59\x8a\x4c\x85\x97\x12\xfa\x2f\x88\x2e\x09\xa6\x42\x1a\xcb\x37\xdb\x39\xb5\x5a\x6c\x04\x40\xf8\xb4\xf5\xfb\x34\xd0\xb5\x91\x03\x16\x6b\x65\x4b\xb8\x48\xfd\x7c\x11\x8e\x76\x59\x93\x4f\xd5\xe1\x53\x3b\x92\x6d\xe3\xe2\xa7\x42\x51\x37\x2f\x81\x25\x64\x01\x10\x34\xaf\x58\x8b\xe5\xe7\xb8\xb8\xf9\x82\xff\xc7\x79\x1d\x89\x95\xb0\xa8\x2f\x6f\xb9\xde\x46\xd7\x67\x91\x4f\xfb\x16\xd7\xba\x50\x0f\x09\x77\xda\xeb\x96\x3d\x2d\x80\x9b\xf2\x94\xcd\x7e\x7c\x02\xc3\xf3\x1f\x8b\xda\x75\xf8\x4a\xac\xce\x61\x70\xfb\x48\xf1\x1b\x13\x38\xfa\x2d\xdf\xb3\x10\x49\xbd\xa4\x4b\x0b\x61\xd5\x53\x5c\x75\x9b\x48\x07\x8a\x3e\xcd\x21\xd0\x3a\xbf\x66\x2e\x77\x47\x6b\xd7\xb3\x27\x07\xfe\xb7\xda\x0f\x8e\x49\xfa\x6f\x05\x67\x08\x01\x78\x7c\xcc\x8b\x43\x80\x75\xa0\x16\xe6\x2f\x7a\xb3\x3d\x14\x58\x11\x37\xb9\xd6\xc7\xe3\x9c\xc3\xf0\xd6\x7f\xf7\xaf\xaa\x12\xbf\x48\xb4\xf0\xfe\xfe\x42\x34\x77\xe7\x97\x52\x87\xfb\xf5\x69\x41\x80\xc5\x31\xdf\xf2\xf4\xcd\x6f\xaa\x7e\x91\x7e\x13\x38\x19\xbe\xaf\x3d\x80\xcc\x52\xff\x72\x9c\x35\xbf\xd2\x95\xc2\x2b\x57\x8a\xae\x17\xe7\x4d\xf3\xce\x7b\x38\xef\xac\x2e\xdb\xcc\x88\x7d\x37\xd0\xd2\x0f\x30\x99\x10\x67\x8e\x87\x20\x05\xc9\x25\xc8\xd1\xd4\x4d\x9c\xde\xab\x8c\xf6\xa7\xfa\x4f\x65\xa6\x29\xd4\x57\xeb\x86\xdc\xdc\x9b\x98\xf3\x48\x8f\x4c\x04\x17\x4f\x6e\x04\x33\x68\xc3\x15\xe0\x0f\x8f\xfa\xc5\x5e\x4d\xa2\xc4\x5f\x59\xd2\xae\x3e\x11\x97\xbf\xee\x53\x18\xf0\xda\x90\xe3\xf5\x14\x62\x72\x2a\x97\x70\xe9\xc7\x28\xd4\x73\xd9\x04\x8c\x75\x18\x79\xa0\xce\xed\x25\x5a\xe9\xaf\x5b\x16\xca\x4b\x63\xb4\x74\xa4\xea\x59\xed\xa9\x44\x16\x0c\x6a\xb0\xf1\x16\x30\x0e\xe3\x13\x7c\x12\x47\x6f\xb2\x1b\xe3\xae\xb6\x40\x78\xb9\x02\xeb\x1c\x9e\x6c\x53\x53\x9e\x46\xb4\xea\xdf\xcf\x7b\x48\xc6\x76\xce\x85\x9e\xbc\xbf\xf0\xe0\xfc\x04\x6a\xfc\xbc\x3f\x71\x7c\x17\x79\x6f\xa7\x01\xa0\x51\x62\xf0\x47\xe3\x75\x3f\xa5\x05\xbb\x07\xd6\x1c\xd4\x1f\x0f\x34\x4c\x80\x14\xcd\xc2\x6d\xd6\x31\x9e\x23\xa0\xd3\xaf\x22\x37\x5f\x1b\xd5\xfa\x72\x54\x1e\x03\x0a\xb3\xda\x75\x94\xc4\xec\xc3\xbb\x6a\x97\x98\xed\x43\x40\xf6\xbd\x86\x97\x6f\x0d\xa1\x5c\x6b\x89\x42\x4b\xf6\xa6\x58\x0f\xbc\x7f\x67\x7a\xfc\xba\x7e\xd4\xa5\xd0\x25\xf6\xa7\x90\x4d\x07\xd6\xbd\x84\xcc\xec\x76\x85\xbc\xac\xde\x50\xc8\xca\x6a\xd5\x57\xb9\x71\x8a\x61\x10\xcc\x44\x43\x04\x0e\x23\xf9\x98\x7f\xb9\xa2\xec\xc5\x89\x1e\xe2\x51\x00\xe4\x1a\x93\x4c\x80\xdf\x1d\xfa\x5c\x5d\x57\x33\xd3\x2c\xf8\x2b\xfd\x0c\x48\xfc\xa3\xbc\x03\xb0\x5e\x57\x87\x4c\x9f\xf3\x25\x24\x35\x52\x4c\x3a\x43\x1b\xc2\xbd\xb8\x59\xa0\xd3\xe5\xa1\xef\x08\x73\x45\xa7\x44\x8e\x46\xf2\xa6\xec\x49\x95\x46\xab\xe3\xca\x1d\x16\x60\x21\x07\xd3\x6e\x16\xcc\x60\x3d\x26\x6d\xa6\x31\xf9\x58\x1a\x0c\xdc\xc1\x1b\x8a\xfc\xab\x55\x4c\xd9\x71\x3e\x87\xaf\x83\xb0\xab\x5d\x78\x90\xa4\x05\x8b\xb1\xe4\x41\x1c\x36\x66\x37\xcd\x56\x78\x10\x38\xdd\x3a\xfe\xde\x83\x66\x24\xdc\x75\xb3\xf6\xc5\x4c\x7f\x17\x58\x7d\xa3\x55\x07\x3e\xe4\x5b\x2f\xe6\xf8\x47\x4f\x14\x31\x99\xb3\x23\x2a\x30\x82\xaa\xc3\xbd\xd1\xab\x72\x0c\x3d\x00\x5a\x25\xf6\x57\x5b\x05\xbc\xb9\x5f\xcd\x24\x03\x59\x97\x7c\xd5\x57\x42\x08\x20\x48\x9c\xe2\x5a\x98\x89\x47\xb7\xd3\xf3\x7f\xce\x6e\x0e\xb8\x71\x59\xf2\x86\xfd\xe5\xa3\x36\xd1\xd0\xc7\xd9\x54\x55\xcf\x79\x26\x3c\x7c\xce\xc3\x4a\xf0\xb7\xcb\xba\xb6\x5e\xc5\x3e\x0b\x84\xf8\x38\x13\x47\x19\xc8\xbd\xfa\xd2\x6e\x34\x91\xe7\x01\x9d\x7a\x14\xe8\x89\x31\xc2\x34\xd6\x83\x55\xc3\x90\x47\x89\xd2\xfe\xa3\xb0\xfc\xfd\x50\x9f\xe0\x3e\xc5\xc4\x8c\x0b\x80\xbd\x66\xd9\x2b\xc3\xba\xd8\xbb\x31\xa8\xbe\x8a\x4f\xff\x10\xdc\xe2\x31\x9f\x34\x42\x7a\x40\x4a\x4d\x0d\xde\x63\xde\x1f\xf2\xd8\x79\x60\x5c\xcb\x76\xe5\x31\xb7\xc3\x38\x79\xd8\xd7\xb9\x44\x78\x03\x8a\xef\x89\xd9\xc9\x47\x30\x09\x1e\x36\x82\xd5\x3b\xf6\x80\xa2\x1c\x45\x62\x9f\x74\x54\x46\x2e\xc1\x77\xb4\x6b\x42\xd3\x65\x9f\x43\xfd\x48\x3f\x96\x5f\xb5\x25\x9f\x9d\x07\xb0\x30\xef\x1f\xe1\xca\x83\xf6\x6c\x1f\x62\x65\x40\xda\x13\xfb\x82\x07\x6c\x88\x42\x51\xd6\xe7\x0f\xf9\x5a\x08\x73\xce\x51\xd8\xcd\xf4\x22\xca\xa7\x8f\xcc\x90\x71\x3b\x7d\x49\x14\xea\x17\xf0\x96\xb7\x47\x3c\x9f\x79\x53\xf5\x0d\xee\x6d\x92\xfe\x41\xcb\x5d\x09\x0d\xc8\xab\x3c\x0e\xa0\x22\x90\x62\x9f\x15\x43\x70\xef\x66\x90\x5c\x6a\x87\x62\x5b\x89\x6b\x2b\x5b\xe5\x41\xd2\xe6\x39\xfc\x04\x81\xe1\xf6\xff\x60\xc3\x12\x99\xa6\x0e\x35\xe0\xd4\xf0\x9e\xd7\x2a\xbf\xac\x43\xdd\x57\x26\xef\x1c\xab\xce\x55\xe1\xc8\x39\xd4\x31\xfc\x92\x65\x67\x6a\x11\x21\xd1\x57\xa9\xde\xc3\x0f\x27\x79\x8e\xc3\x29\x96\xe3\x50\xaa\x8c\x8f\x85\x15\x1a\x90\x88\xd5\x92\x1b\x48\x82\x77\x28\x2b\xc7\xea\x83\x3d\x3c\x82\x78\x37\xe2\xfa\x00\xdd\x2b\x07\xd5\xe3\xc7\x73\x38\x05\xfc\xf8\xd9\x11\xb5\x0d\xc3\x38\x02\xc8\x5f\x84\xae\xe7\x60\xd8\x0d\xe0\xa3\x8f\xd4\x89\x85\x50\xb0\x12\x73\x03\xa4\x82\x7d\x79\x07\x9c\xfc\xe2\x36\xe7\xb7\xa7\xb3\x0f\xc5\xc9\x94\x8c\xb9\xea\x28\x01\x32\xdf\x6d\x3e\xa8\xff\xf6\x15\xa5\x15\x0c\xc3\xf1\xe6\xef\x08\xe4\x14\x9d\xd7\xda\xeb\x4c\x56\x0a\xcf\x66\xa8\xef\x34\x54\x3a\x65\x54\x10\x68\x05\x94\x82\x3d\x9a\x27\x9e\xec\x14\x62\xbc\xae\x23\xcb\x68\x62\x0b\xef\x36\xcd\x95\xdf\x76\x76\x1b\xf8\xad\x14\x7c\x86\xf0\xce\x1c\x32\xf9\xcb\x43\x92\xc5\x34\x06\x72\xe1\x0f\x34\x00\x6b\x4b\xdf\xc0\x21\x85\xb6\xae\xc8\x09\x69\x0a\x67\xe6\x89\xbe\xfa\x43\x92\x6b\xe0\xe0\x34\x64\xc7\x02\xd7\x5b\xaf\x4b\x5f\x65\xb9\x85\x9c\x8b\x80\xc6\x5e\x26\xbf\x18\x91\xbc\xd5\xd7\x50\x33\xeb\x21\x8f\x76\x31\x5b\x0d\xd7\x15\xbe\x00\x16\x59\xef\x8b\x33\xeb\x4f\x72\xc2\x9d\x4d\x1e\x6a\xbc\xc7\x25\x08\x7c\x91\x56\x2c\x0a\x03\xcc\x59\x3b\x02\x5e\xc6\x75\x88\x13\xd4\xb5\x1d\x24\x7c\x72\x26\x0b\x3c\xfc\x20\xc8\xf8\xb3\xe9\xe6\x3e\x85\x39\x3f\x29\x5c\x0b\x2c\x05\xad\x95\xed\xa8\xfa\x15\xd0\x54\x52\x74\x04\xe6\xfc\xd0\xb8\xab\x47\x16\x91\x10\x6c\xb7\xfc\x21\xde\x19\x9c\x7d\x12\xad\xa0\xd1\xcb\x69\x53\x5f\x36\x15\x92\x01\x66\x97\xad\x5d\x2f\x49\x88\xbe\x4c\xa1\x05\x6c\x23\x2b\xc1\xc1\xcb\x1f\x04\x3d\x19\x03\xf6\x9a\x48\x31\xbb\x27\xf1\x1b\x92\xbe\xc4\x2b\x22\x81\xc6\x84\x3f\x45\x7a\x19\x58\xf7\x2c\x15\x60\xe1\xfe\xe7\x9b\x0d\xa4\x05\x81\x64\xb7\x6e\x48\x17\x03\x45\x8a\x2f\x8a\x7c\x3a\x21\xc0\xfa\xfa\xeb\x44\x1d\xc2\xbd\x8d\x6c\x10\xae\x75\x54\xf5\x3d\x19\xd9\xdc\x81\x5f\x4a\x88\x1b\xc1\xdc\xc7\xaa\x59\x68\xf9\x3c\xf3\x86\xdb\x60\x6e\xd2\x2a\x7b\x16\x25\xc5\x2b\xbb\xfb\x1e\x7a\x4c\x84\xbf\xaf\x6b\x20\xdd\x91\x82\xe0\x46\xbf\x04\xc9\xa7\x67\x43\x04\xf4\x98\xa3\xea\xce\x40\x17\x58\x72\xc4\x48\xd3\x48\x82\xd7\x63\x37\x2d\xe6\x87\x4b\xf6\x04\x3d\x6c\x32\xb2\x20\xec\x72\x8b\x81\x14\x21\xf7\x77\x6e\x07\x7f\x1f\xe8\x92\x4d\xa1\x13\xda\xc2\x65\x7f\x2b\x8a\x0d\x56\xe5\x77\x01\x86\x1f\x02\x5f\x7f\x1c\x25\x50\xf1\xb9\xd7\x2a\x09\xca\x23\xf7\x18\xff\x7b\x97\xf2\x71\x72\x55\x0d\x7d\x9b\x05\x6d\x5f\x7b\x94\x51\x78\x69\xd2\xd0\x64\x88\x3b\xbd\xe9\xdd\x9b\xea\xaf\xef\x3f\x72\xc1\x77\x3f\x11\x0e\x5b\x03\x6a\x5d\xc5\xe5\xe9\xaa\x97\xa7\x89\x92\xad\x9c\x55\x76\xc4\xd5\x63\x26\x25\x58\x70\x85\x9c\x5a\xd3\x0d\xae\x0d\xf8\xcc\x91\x8d\x47\x83\x06\x9c\x80\xc0\x87\x86\x31\xc0\xf0\x9a\xd5\xc3\xef\xfb\x97\x70\xfb\xb3\x6e\xab\xdc\xb0\xd1\x6b\xe8\x00\x36\xe6\x9d\x9a\xfd\x77\x6d\x68\xf6\x12\x23\x6c\x0b\x63\xcc\xe0\xe2\x8d\x3c\x94\x32\xf3\xe0\xbb\xea\x94\x2c\x1a\xd8\x9e\x42\xe3\x40\xbd\xac\x85\xb1\x9c\x83\x33\x06\x2c\xfc\xa0\xb5\x78\x02\xc8\x52\x04\x75\x37\xc5\xbf\x49\xa1\x7d\x9c\xa8\x92\x21\x5f\x73\xb1\x64\xba\xf2\x4f\x92\xbe\xa5\x86\x6a\x30\x72\xd9\x9c\x76\x03\xf6\xae\x7f\xa4\xdc\x23\x00\xef\x01\xd8\x2f\xa7\xd3\x49\x5d\xab\xf8\x64\x00\xd9\x97\x33\x80\xee\x36\x26\x2e\x52\x1f\x46\x2b\x42\x4d\xe4\xe0\x15\x94\x5f\xde\x4c\xa4\x6e\xb8\x0c\x98\x5b\x57\x46\xfd\xa4\x22\x0c\xbf\xb5\x75\x40\x0a\x10\x93\x6e\x97\x4d\x33\xdb\xae\x74\xba\xd7\x48\xdd\x91\x58\x80\x21\xa0\x4c\xb4\xe1\x57\xc4\x75\x48\x4b\xcf\x8c\x9c\xa9\x28\x4f\xed\xdf\x72\xc6\x8d\x43\x8b\x20\x41\x65\x3f\x80\x07\xf6\x6b\xfc\xe8\x33\x44\x70\xd7\x10\xbe\x6e\x96\xf6\x9d\xd0\x90\xdd\x3c\x0c\x6e\xa6\xe7\x41\xa0\xf1\x67\x40\xef\x43\xd3\xf8\x29\x86\x01\x5e\x04\xfa\x8a\xa3\x70\xec\x6d\x23\x60\xf0\x36\x2e\x8b\x9e\xdc\x89\x6a\xb7\x02\x00\x41\x3f\x8c\xd7\xb9\xd9\x99\x37\x6f\xf2\x73\x69\x45\x99\x0e\x4a\x38\xdc\x6d\x97\x47\xbc\x0d\x21\x22\x5a\x55\xde\xed\x32\xce\xaf\xf1\x0e\xb2\x3d\x80\xf1\x60\x22\x09\xae\x20\xa8\x01\x50\x62\x51\x98\x02\xe9\xd8\x25\x2f\x54\x3a\x5a\x1d\x40\x34\xc6\xfa\x3f\x29\xc4\x1d\x21\x6e\x2c\x49\x64\x0b\x3a\xed\x11\xe9\x78\x0b\x3b\xf1\x2c\x00\xea\x1e\xd8\x31\x74\x54\xef\x3d\xb9\x71\x53\x41\x9e\xf9\xab\xd4\xbc\x60\xd9\x04\xa2\x3d\x66\x4e\x02\xb1\xb5\x97\x8c\xfa\x44\x59\x06\x0b\xbd\xc7\xe8\x92\x6c\xda\x67\x32\xd1\xd2\xc7\x7f\xa9\x7b\xbb\x24\x06\x5f\x88\x6b\xaa\x97\x8a\xff\x09\x43\x0b\x5f\x02\xed\xee\xe8\x71\x88\xa3\x3a\x84\xdd\x26\xe1\x2c\x32\x41\x2d\xb9\x95\x2d\x92\x46\x06\xf8\xd1\x75\x50\xa0\x1d\xf2\x4e\x04\xfd\x50\xa5\x64\x0c\x61\x2c\x1e\xff\x4c\x12\xf0\x49\xf0\x55\x14\x22\x5e\x4a\xee\x8e\xd8\x0b\xed\xe3\x8b\x94\x23\xaf\x7a\xf0\x4b\x71\xeb\xd2\xf6\x72\x63\x6a\xe0\xe8\x29\x52\x94\x02\x2a\x0f\xd0\x0e\x91\xef\x92\x08\x4b\x6b\xe1\x62\x0d\x4b\x56\xcd\x20\xa0\xf6\xa9\x67\xdc\xae\x94\xde\x71\x9b\x0f\x66\x0e\x4e\x5d\x09\x43\x28\x7d\xd8\x3b\x10\x2a\x3f\x70\xa0\x05\xb4\x22\x3b\x1f\x46\x4d\x16\xd9\xb3\x44\x10\x3e\x26\xc2\xbe\xeb\xbe\xc8\xfa\x2e\xf9\x2d\xfd\x28\x39\xfb\xa9\x92\xc4\xfb\x40\xbb\xd6\xef\xea\xa7\x66\xce\x10\x3f\x1c\x97\x7f\x8a\xf7\xfc\x1f\x96\xd4\x3f\xd9\xc7\x82\x1f\xe6\xef\x3f\x99\xb2\x33\x1f\xa7\x89\xdd\x0c\x3d\x6d\xfd\x2e\xf5\x72\x32\xfc\xbb\x10\x34\x5f\x98\xe2\x7c\x67\x80\x42\x1c\x67\x9f\xf6\x58\xfa\x33\xf0\x4e\x32\x2d\x04\x4a\xde\x11\xd6\x6f\x19\xa7\x07\xb9\x14\x91\x98\x84\x40\xd0\xd3\xf0\xbc\x08\xdd\xf6\xf2\x4c\x04\xbd\xcf\xcb\xa6\x6a\xe4\xcb\x86\x73\xd7\xe7\xcd\xef\xc5\xd0\x78\xed\x39\x60\xf4\x3e\x04\x74\xe7\x75\x06\x91\x71\x79\xcd\xca\xc7\x00\x43\x4f\xbf\x74\x1b\xec\x2c\xde\x72\xbc\xa8\xde\x41\xd0\xfd\xba\x4e\x25\x3c\xdb\x57\x0d\xf7\x5e\xb3\x7e\x06\xf4\xb2\xb8\x42\x08\x7c\x41\xce\xe7\x74\xf3\xe2\x03\x43\x9f\x55\xd4\x7d\x4d\x76\x61\x35\x1d\x76\x3b\x77\x1f\x94\x41\x7e\x39\x55\xc9\x29\xbf\x39\xc2\x7d\x79\xb6\xfa\x0b\xad\x1f\x70\xbb\xfc\x1f\x64\x31\x20\x5c\x84\xd9\xc1\x08\x0e\xad\x8f\xd6\xca\x3e\xac\x78\xf8\xe2\x83\x67\xfa\x5f\x01\x8b\x6b\x3a\xb2\x2f\x81\xfa\xc3\x6e\xc9\x82\xa5\xe9\x48\x27\x25\x95\x2c\xf8\xca\x85\xd8\x87\x59\x10\x7a\xbb\xb6\x99\x11\xaf\xbf\xcf\x45\x79\x7f\x30\x38\xe3\x77\x71\xbe\x02\xbe\xbd\xdc\x5a\xd4\x6f\x9c\x4d\x14\x04\x45\x40\x18\x66\xf9\xa1\xfc\xfd\x02\xfc\x0b\x3f\xeb\x09\xcf\x76\xe2\xe9\xc1\xec\x42\xc6\x0c\xfb\xc0\xdb\x65\xa6\xaa\xf1\x93\x22\x16\x0e\xa3\x3f\xcf\x2a\x69\xe8\xd5\x5f\xb6\x16\x4a\x37\x7a\x85\xe4\xcd\x93\x1e\xf1\x20\xe1\x73\x6d\x7f\x87\xc1\xcd\xd3\x26\xf2\x42\xd5\x43\xe7\xed\x62\x68\x0f\xcb\xbc\x09\x32\xaf\x84\x12\x3d\xf3\xe4\x09\x9f\x89\xe6\x7a\x7a\x66\x21\x33\xa2\x0a\x75\xda\x9f\x39\x80\xf0\x37\x00\xef\x45\x80\xf7\x1c\xa0\xf9\xa1\xc1\xe7\x7b\x4e\x9a\x2d\xb2\x26\x92\x65\xfc\xa7\x2b\x9b\x4f\x3a\x82\xb5\xd0\xcf\x39\x3b\x7a\x25\x7c\xe4\x2b\xc1\xd9\xf5\x18\x72\x40\x92\xea\x7e\x7a\x41\xbd\x42\x6d\x86\x10\xee\x77\xcb\x1f\x5a\xfb\x4a\x91\x99\xbb\xee\x81\x37\xaf\x19\x18\x4d\xa2\xd0\x35\x66\xb9\x25\x18\x0a\x14\x39\xd5\x02\x6e\x98\x00\x4b\xd1\x58\x23\xd6\x1b\xa2\xee\x44\x5f\xdd\x85\xed\xf7\xad\x69\x27\xae\xe7\xc7\x97\xac\x07\xb5\x26\xf6\x2e\x84\x11\xdc\xa5\xa1\x9f\x6f\x7b\xe5\x67\xae\xa3\x28\x32\xe6\xf2\xfe\x85\x9d\x03\xa1\xe8\x32\x0d\xb9\x27\x02\x9b\xef\xe9\x14\x2c\x9c\x6a\xce\xfc\x4e\x58\xf9\x29\xd7\x7d\x16\xcf\x1f\x7c\xb8\x4d\x22\xd0\x59\xa8\xf4\xfc\xef\xf6\x44\xdc\x0d\xb0\x90\x1f\x2d\x53\x98\x5b\x9a\x69\x77\x5e\x12\x5b\x78\x7b\x5f\x4f\x8a\xfc\xde\xd9\xad\x75\x6e\xb9\x97\xc1\xbb\x5e\xea\xe2\xb7\x5d\x38\x97\xe4\xe2\x3f\x0f\x89\xc5\x3b\x51\xf4\x03\x3a\xc5\xf4\x85\xbd\xdd\x23\x8a\xa7\xad\xc6\xf0\x8e\x6c\xb1\x05\x60\x99\xce\x2d\x0c\xca\x40\x5a\x2f\xed\xbc\x12\x21\x0c\x9d\xe8\x81\x6b\x88\x01\xbe\xd3\x94\xb5\xa3\x35\xe9\x3c\xaa\xf5\x0f\x5c\x03\xdf\x4c\x0b\xac\x51\xdc\x24\x8b\x79\x7d\xfa\x4f\x3e\x00\x7e\xe0\x27\x87\x69\x0a\x12\xfd\x7a\xcb\x14\xee\x7a\xd1\x3d\xdd\xa1\xed\x6b\x53\x56\xad\xa1\x3d\x8c\xcc\x3a\xfd\x74\x1c\xcf\x2e\xb1\xe9\xd5\xb5\x8c\x7d\xff\xda\xaa\x62\x16\x06\x92\xbc\xaa\x99\x00\x8c\x5d\x1a\xb1\x18\x19\x35\x79\xe9\x50\xd3\xb5\x50\x62\xd0\xd6\xac\xf1\x4b\x58\xea\xeb\x41\xb3\x0f\x94\x2c\xbe\x0b\x91\xbd\x36\xba\x19\xc3\x66\x1d\x54\x85\xe6\xae\x1f\x66\xed\xf7\x57\xe3\x01\x31\x0f\x02\xcd\xe9\x2f\xa2\xfb\x96\xf3\xf9\x0d\x75\x51\x9e\x63\xda\x8f\x76\x54\xdc\xcb\xe6\x59\xea\x38\xf3\xb3\xa1\xcc\xa7\xca\xff\x46\xe5\x69\x6f\x21\xaf\x13\x46\xfc\xf6\x8c\xf8\x79\x1e\x45\x4e\xf9\x21\xa9\x0d\x04\x2e\x71\xd9\xc7\x1c\x12\xb5\x87\xfc\xdf\xcb\x4b\x87\xa6\xf1\xdb\x55\x4a\xc0\xca\x77\x76\x64\x57\x09\x88\x7b\x41\xa5\x4f\xf0\xe8\x22\x6d\xd7\xab\xb8\x1f\x89\x4e\x74\xa7\xe2\x9f\xff\x9e\x8d\xd3\x49\x6b\xd0\x6f\xe1\x77\x37\x5a\xdc\x40\x59\xd6\x77\x5d\x09\x72\xbc\xe0\x57\xe3\x2b\x16\x10\x85\x42\x96\x78\x49\xa1\x49\x3d\x8b\x99\x79\xcd\x67\xe8\x44\xcb\xe3\x7f\x46\x5e\x32\xb8\xe4\xd0\x8d\xe6\x13\x30\x2f\x0b\xdb\x67\x4e\x56\x28\xaf\x78\x59\x2b\x24\x7d\xe4\xa9\x6e\x3a\xf4\x14\x96\xee\x10\x8f\x5e\x69\xf8\x0e\xd1\x68\x2e\x1b\x74\xda\x9d\x0f\xb9\xc3\xbc\xd1\xbf\xc7\x8d\xf6\xed\xb7\x06\xe6\x79\x9a\x01\xb7\x23\x36\x7d\x96\xea\xf5\x94\x8f\x49\xbe\x45\x16\xab\xa3\x02\x50\xbd\x41\xd7\x81\x49\x12\x06\x1d\xb8\xb4\x90\x8b\x3e\xbf\x18\x75\x24\x19\x89\x6f\xc7\x2b\xfc\x20\x7b\x0d\xc3\x07\x59\xb0\x5b\x98\x05\xf4\x9f\xec\x35\x0c\x04\x3c\x25\x1c\xc0\x43\xf5\x24\xa8\xcb\x4c\x0b\xc2\x6c\x13\xa1\x4f\x08\x3e\x1f\x6c\xad\x2f\x99\xae\x5c\xc0\x62\x86\x2c\xb4\xab\x0b\x08\x85\x9d\x57\x16\x54\x2d\x28\x4f\xed\x1b\xd2\xaf\x57\x86\xc8\x92\x70\xe0\xf9\x21\xd4\x7f\x06\xa4\xd0\x7f\x5a\x86\xd4\x04\xd7\xa5\x90\xcd\xb3\x30\xc0\xfa\x19\x70\xdc\xfc\xf1\xff\xd9\x9f\xca\x3b\x5d\xbd\xf4\x33\x80\x7a\xd7\x53\x0c\x56\xea\xc2\xcd\xa6\xf3\x1d\xdb\x4d\xa7\xe6\x50\x8e\x84\xdf\xb2\x50\xf3\x45\x8a\xd5\xa8\xe9\x3c\xbe\x20\xf6\x3f\x82\x7e\xc0\xc3\xcf\x79\xf8\xc6\x7f\x70\xf0\x4d\x84\x3a\xd0\x69\xc0\xbf\x9f\x7f\xc0\xfe\x78\x8d\x03\xe1\x3e\x85\xeb\x2d\xc2\xef\xc9\xe4\xb9\x0b\x55\x6b\x32\x89\x11\x2c\xa1\x9f\x9d\x7c\x10\x74\xa5\x7f\xbe\x09\x26\x2b\x6f\x06\x4c\xd1\x5e\x5e\x5c\xa2\xde\x3a\x10\xf0\x91\xf4\xba\x9c\xfe\x96\x46\x3d\x4a\xd6\x64\x64\x16\xc7\xa1\x3d\xad\x07\x02\xd1\x18\xeb\x34\xdc\xb9\xa8\x59\x2f\x02\x11\x46\xc4\x64\xc5\xa4\xf5\x03\xfa\x63\xc4\x7c\x0d\xd3\xfa\x0c\xc8\xfe\xfa\x4c\x6d\xfe\x06\xd0\xbd\x84\xb6\x2c\x8c\x8e\xf2\x4a\x31\x8e\xba\xd2\xd4\xc4\xad\x33\xd5\x65\x2e\xf9\xd1\x9c\xef\x1d\xaa\x72\x04\xaf\xcb\x48\xf7\xac\x47\x33\xf3\x3d\x6b\x13\x54\x3c\xeb\x76\xb2\x15\x3c\xeb\xb4\x0b\x0b\x2f\xf6\x89\x2b\x69\x46\x8d\xc4\x26\x49\x92\x52\x2e\x17\xf3\x4f\x08\x9a\x03\x3b\x8c\x2c\x99\x6c\x3d\x61\x5f\xe6\xcb\x4d\x60\x7e\x01\xff\xad\x39\x17\xc4\x09\xe8\x7b\x09\x60\x8f\xcd\x89\xef\x2c\x92\xc2\x1e\xb0\x6a\xe6\x2a\x64\xf3\xa5\x80\x1d\xfb\xce\x14\x5d\x14\xbd\xdb\xed\x30\xfc\xdf\xcd\xfa\xf7\xf2\x2f\xd3\x63\x07\x68\xfe\xe5\x30\x27\x68\x53\x48\xda\x5a\x1c\x80\xd9\x75\x0f\xb8\x4e\x52\x09\xa7\x46\xf5\x8e\xda\xef\x88\x93\x3a\xa7\x10\x28\x83\xff\x8e\x9f\x43\x0e\xc6\x2d\xb0\xf7\xe1\xd4\x76\x8a\xe3\xea\xc7\xce\x23\x6b\x52\x67\x1e\x9a\x59\x1f\xa8\x7b\x85\x4b\x24\xaa\xa9\x50\x4d\xa9\xeb\x44\xd7\x2f\xd4\x8c\xe2\x08\x30\x47\x92\xed\xc1\x29\x33\x24\x87\xe2\x53\xe8\x7a\x17\x5e\x7f\xd7\x11\x09\x54\xb3\x37\x72\x4f\x54\xa7\x3a\xed\xf1\xf0\x9f\x86\x19\xa4\x6f\xfc\x5f\x05\xba\xbf\x48\x2d\x00\xc2\xd7\xb8\xaf\x47\x95\x73\x81\x05\x69\x17\x7a\x9e\xfa\xa1\x07\x20\x92\x97\xb0\xf5\x73\xc8\xd2\x1e\x1c\xf7\x01\x62\x4f\xb4\x0b\x1f\x2b\x42\xec\xe5\x21\x7a\x40\xbe\x82\x40\x79\xe0\xef\x2f\x06\x0d\x1c\x5e\x30\x47\xbf\xa5\x89\xbd\x87\x1b\x1a\x80\xf6\x92\xc5\xb6\x80\x1b\x4a\x87\x7a\x2d\x84\x2d\x1e\x40\x71\x31\x33\x65\x61\xcf\xdc\x09\x60\xf6\x55\x22\xd5\x00\x9b\xf9\xb1\x66\x58\xa4\x0b\xf1\xed\xa3\x4d\x3f\x87\x39\x94\x6c\x2d\x92\x8c\xd8\xc1\x51\xab\x2d\xc6\x70\xfb\x00\xf6\x8b\xf2\x4a\xc0\xe9\x17\x6d\xe6\x88\xfd\x39\x42\x5d\x0b\xeb\x95\xbc\xea\xe7\x81\x96\xf1\x85\x10\xef\xc0\x5d\x50\xd0\xfa\xb1\x86\xb1\xc2\x01\x7b\x45\xfd\xea\x0c\x32\x5f\x44\x99\x28\xfb\x7b\x96\xea\x36\xab\x90\x47\x86\xc0\xc0\x92\xb8\x2a\x0c\xb1\x21\xc2\x29\x55\x6e\x8f\x42\x8e\xcb\x4d\x97\x43\x24\xd7\x49\x01\xc1\x09\xf0\xb9\xd4\x11\xd9\x77\x0b\x46\xfd\xb8\x3f\x40\xa8\x23\xa3\x02\xe4\x2f\x01\xba\x42\x81\xfb\x33\xbc\x26\xfc\x62\xe7\x90\x11\x3d\x72\x8a\xab\x94\x45\x33\x3b\xd2\x73\x15\x17\xf8\x48\x97\x60\xac\x84\xf6\xc7\x80\xf7\x80\x0d\xa5\xef\x0e\xa7\x8f\x5e\x7a\xdd\x9f\x39\x78\x05\xe4\x53\x1f\xc8\x85\xcf\x11\x0d\x69\xe1\x4f\x48\x71\xc4\x9e\x37\xad\x10\xec\x0b\x29\x2b\xc7\xf1\xbf\x6c\x0c\x7c\x72\x18\x5c\x62\x2c\x5b\x50\x53\x65\xf5\x12\xc6\x0a\x9c\x35\xb4\x8c\xac\x4d\x66\x5e\xce\xbc\xf5\x58\x14\xf4\xe6\xb7\x6d\xa3\x38\x0a\x50\x15\x5d\x3b\x1b\xdc\x40\xbc\xc8\x0f\x71\xe6\x07\xa1\xf0\xf0\x79\xe6\x33\x2e\xc7\x67\x5b\x4c\x2c\xd4\x4a\x4d\xbf\xac\x07\x25\xc2\xbd\xce\xe3\xbf\xab\x2c\x7e\x15\xec\x42\x9f\x22\xf6\x95\x25\x09\x26\x5c\xa6\x5b\x84\x82\xe8\xf5\xf6\x37\x41\xf7\xf5\xe6\x14\x67\x47\xff\x4f\xf9\xef\x72\x92\x7d\xb2\x53\x36\xc9\xfa\x58\x21\xb1\xd9\xdb\x4e\x21\xc3\x8a\xa4\x7c\x11\x01\xd9\x66\x2c\xbe\x6f\x7e\xb3\xee\x01\xe9\xee\xa0\x0f\xb8\x57\x8c\x07\xfe\x2e\xee\xc4\xce\x95\x81\x12\xdf\x94\x34\xdc\x31\xd3\xf2\x23\xa4\xca\x5b\x60\x7d\x27\x48\x76\x1c\x44\x78\xca\x95\x6f\xd7\x2e\x08\xd7\xf6\x66\xc7\xb8\x41\x20\x29\xd2\x0f\x5b\xd8\x05\x81\xc5\xc5\x8e\xdd\x3f\xfc\x4a\xce\x9f\x82\xdf\x01\xd4\xaf\xa4\x77\x6c\x45\x1e\x9d\x5b\x91\x66\xdc\x56\x6e\xb9\x18\x6d\x21\xfd\x8c\xb2\xdd\x8f\x70\xfe\xb9\x12\x73\x5c\xc4\xdb\xf5\xdc\xd9\x2a\xab\x13\xfb\xb0\x47\xf3\x6c\xf1\x54\x84\xef\x70\xd8\x7f\x6c\x0e\x60\xc3\xa6\xe3\x61\x0e\xce\xc8\xfa\x8e\x59\xbb\xf5\x2a\x19\x68\x0c\xbe\x95\x91\x8b\x70\xe6\xda\x4a\xcf\x9b\x84\x0a\x67\xd1\x32\x73\xc9\xe2\x8b\xf5\xf4\x37\x47\x6d\x90\x70\x09\xd8\xf6\xdc\xc4\xf0\x37\xb5\x56\x10\x13\x26\x25\xa0\x9f\x44\x02\x98\x72\x80\x16\xf0\x81\x69\x0a\x48\x87\xfb\xe6\x4d\x86\x5a\xa5\x48\xbb\x45\xf3\xc3\xfb\xcb\x0d\x39\xa9\xf2\x23\x3c\x3f\x97\x21\x37\x1e\x2c\xb9\xcd\x61\x7f\x44\xf8\x0f\x14\x01\xda\x72\xef\x95\xc6\x2d\x6b\xb0\x6e\x01\xcf\xc4\x5a\xe3\xc4\xe0\x45\xc5\x16\x8f\xa1\x29\xe7\x9b\xf5\x28\x73\x0b\x69\xde\x2f\x4a\x51\x6c\x3d\x34\x33\x0b\x37\x18\x73\x0a\x71\x71\x5e\x93\x1e\x6e\xf7\x5c\xe3\x30\x4c\xc5\x43\x38\x61\x02\xcf\x6f\xcd\xd6\x1c\x82\xe2\x67\xd5\x48\x5f\x9a\xe3\xb3\xe2\x22\xcc\x3e\xb4\xc2\x02\xf2\xdf\x80\xfc\x10\xfb\x4a\x8d\x09\xc0\x9c\x22\xb0\xfe\xe7\x1d\xf8\xff\x48\xc8\x6f\x7d\x97\x04\xa7\x7f\x6b\xca\x8b\x48\xa0\xf8\x00\x5c\x59\xd4\x73\xbe\xbe\x25\x2a\x0c\x50\xbc\x5c\x41\x26\xfd\x00\x6e\xfc\xdc\xe6\xaa\x21\x46\x6e\x27\x4c\x1e\x06\xea\x02\x92\x17\x40\x4c\x25\x40\x6a\x0c\xdb\x7b\xd5\xd3\x88\x65\xf3\x8a\x01\x9f\xa2\x84\x21\x9b\xa4\xc7\xff\xe8\xfe\x36\xad\x73\x1d\x69\xca\x0f\x81\xff\xcf\x9e\x3a\x68\x5b\x90\xd9\x31\xe8\x08\x8c\x8c\xc5\x92\x13\x05\x25\x60\x0a\x96\x80\xa8\x75\x5b\x5a\x41\x59\x63\xb4\xa2\xd0\xc2\x2d\xd7\x50\x7e\xb6\x70\x2a\xb7\xc4\xca\x75\x95\x93\x44\x81\xa0\x3c\x10\x80\xd6\x2d\x61\x12\x26\x16\xc4\x38\x93\xc9\x90\x4f\xa9\xa5\x0f\xdc\x1f\x52\x6b\xe3\x24\xd9\xfc\x90\xa8\xb6\x80\xf2\xa8\x24\x1a\xfc\xb5\x63\x25\x8f\x60\x1f\x07\x0e\x6e\xb6\x24\x7c\xf6\x7b\xe7\x62\x70\x31\xc5\xb5\xbe\x25\x53\xb9\xd6\x9b\x58\x6e\x60\xac\x25\xb6\x63\xed\x31\x45\xd2\xad\x51\x22\x00\x70\xb5\x26\x69\xe7\xe6\x13\x3f\x4b\x6f\xc4\x02\xd2\xef\xd7\x3a\x00\x31\xe7\x51\x14\x32\xd7\xe0\x0f\x7b\xd0\x68\x0a\xfc\x20\x58\x7e\xed\x67\x9e\x47\x58\xf1\xae\x41\x67\x02\x9d\x61\x24\x0c\x04\xa2\xeb\x5a\x2e\x5c\x0c\x6f\x2d\x73\x0c\xa9\xd7\x12\x12\xef\x70\x3c\x0b\x75\x73\xc4\xec\xf1\x3c\xf4\xdf\x5e\xb6\x7a\xf5\x3a\x2e\xdc\xeb\xd9\x89\x61\x7a\xb8\x07\x8d\x61\x91\x3a\x38\xf4\xf2\x54\xea\xb4\x11\x99\x5e\x78\x70\xa0\x5e\x5c\x75\xd8\x6d\x3e\x3c\x82\x1c\x11\xd7\x41\x20\x9a\x40\xfe\xd9\x45\xca\x23\xcc\xfb\xc6\x81\xa9\x7d\x80\x62\x39\xe9\x0d\x0e\xb2\x06\xd5\xae\xfd\x6c\x94\xf9\x04\x73\x5a\x81\xb5\x7a\xba\x46\xe2\xaa\x32\xdc\x9a\x8b\x74\xdb\x77\xe5\x68\xd6\x3c\xea\xbc\xa1\x90\x11\x01\x17\x43\x93\xc3\x82\x44\xbb\x2c\x1b\xd7\xf4\x56\x86\x65\x85\x8c\x23\x19\x20\xf6\xfa\x56\x2e\xc7\x29\xe8\x01\x16\xea\x46\x92\xeb\x46\xec\x3f\xdd\xd8\x00\xfe\xb3\xc6\x5e\x24\x06\xa0\x06\xc4\x24\x90\x5a\x0f\xd2\xd4\x3e\x62\x58\x93\xf0\xb3\x6b\x3a\x84\xd2\x05\xd6\x86\xc2\x53\xab\xeb\x3a\x05\xd1\x60\x6c\x5c\x01\xf7\xea\x8c\xd5\x43\x5c\x77\xe4\x20\xb8\x14\xc7\xa2\xe1\x23\x10\xcd\xfc\xff\x1a\xdf\xda\xa9\x61\x8c\xed\x91\x4d\xb1\x38\x13\x5b\x3d\x17\xd8\x17\x9d\xf5\xe3\x31\x07\x59\x42\x3e\x01\xf6\x28\xf1\x6a\xf4\x4c\x6d\xad\xc9\x2b\xb0\x24\x26\xc8\x77\x7f\xa9\xec\xba\x96\x2a\xf2\xd7\x52\x3b\x1f\x0b\x2c\xd5\x4e\x0c\xbb\x2f\x2e\x70\xe7\xb8\xf7\x93\xf9\xee\xc5\x9e\x3d\x92\x07\xce\xf0\x57\x73\x7d\xf8\x0f\x03\x4e\x31\x2c\x68\x38\x85\x05\x3e\xc0\x7e\x84\xf2\x91\x26\xfc\x87\x5c\x85\x86\x40\x71\x49\x78\x87\xe8\x17\x19\x52\x2d\xe5\x97\xec\xcd\xa5\x68\x84\x0c\x46\xc2\x2f\x01\x26\xcb\x5a\x95\xe5\xb4\xc8\x67\xac\xc0\x20\x2e\x53\xe3\x4c\xe0\x59\x54\x94\x83\xbf\xa0\x2c\xe6\xb2\x8a\xcc\x64\x41\x22\xef\xe0\xf3\x21\x18\x7f\x21\xd5\xcf\x23\x24\xab\xe8\x27\xb2\xb8\x10\x78\x60\xa3\xe3\x93\x54\x49\xc0\x64\xe0\xab\x8a\x88\x0b\xd1\x15\xf6\x81\x24\x8d\x39\x48\xde\x16\xf5\x49\x7a\xf2\xb3\x06\x6f\x8b\x27\xc2\x78\x1a\xe3\x74\xb7\xd9\xa5\xb5\xfb\xfb\x87\x62\xfc\xec\x47\x96\x69\x26\xfb\xc1\x75\x45\xaf\x26\x4b\x4f\x0a\x83\x1d\x8d\x9f\x65\x89\xb7\xe4\xe0\x23\x64\x1f\xd6\xa0\x9c\xea\x6d\x9e\xea\xaa\xcb\x57\xb1\x3e\x5d\x87\x66\x03\x4b\x3a\x5a\x83\xb5\xe0\xb1\xfe\xfb\x81\x0b\x0e\x46\x97\x38\x16\x3a\x0a\xb2\x1d\x56\x6e\xa0\x3a\xa3\x05\x8d\x18\x81\xb7\x51\xdb\xa4\xf8\x92\xd7\x3d\xcd\xaa\x1d\x2d\x49\x97\xfd\xb7\x72\xcc\xfd\x5b\x5d\xec\xe3\xb7\x28\x39\xe4\x81\x2f\x31\xe6\xe6\x73\x6e\x31\xf9\x0f\x74\xd6\xfb\x9d\x41\x00\xf6\x9d\x6d\x9c\x53\x49\x7e\xb0\xf3\x26\x93\xe1\x7c\xce\x5c\x12\x46\xf1\x0b\xb9\x04\x1e\xd9\x7e\x0a\x47\x71\x8c\xb8\xd9\xdf\x04\xb2\x7f\x0a\x66\x84\xeb\xe8\xbf\x22\x05\x3f\xd7\xc0\x70\xcd\xa7\xdf\x2b\xbb\x7b\x92\x1c\x9a\x35\x52\x9a\x7f\x25\x1c\x3e\xcb\xe4\x63\x16\x8f\x1f\xb8\x47\xdd\x8c\xe9\xbd\xfb\xb3\x34\x85\x4c\x00\x9c\xe0\x48\x7b\x90\xec\xb1\x05\x3e\x0f\x9a\x6c\x54\x39\x48\x51\x7f\xbf\x5b\x91\x88\x8a\x73\xd9\xa3\xc0\x80\x4d\x75\xac\x79\xd7\xde\x23\xa9\x13\x04\x80\x4e\x15\x70\x0d\x8e\x3b\xa6\x2a\x7e\xc3\x4b\xc4\x08\xaf\x74\x79\x14\xd2\xfd\xa8\x10\x85\x85\x02\x98\x6c\x8f\x24\x9d\x7d\xf0\xb8\x79\x1d\x6c\xa0\xfd\x99\x44\xfc\xc5\xa0\x7b\x96\xb6\x7d\xf9\x43\xd2\xb0\x51\xf4\x29\x42\x86\x0d\xf8\x1a\xe8\x68\x9a\xdd\x12\x92\xd1\x95\x45\x85\xe0\x55\x98\xcf\xf4\x16\xc1\xc2\x5e\x2a\x70\xeb\x44\xac\x90\xf0\x94\x5b\xcc\xc3\x29\xfa\xc1\x4f\xeb\xfd\x15\xe8\x5f\xbf\x17\x67\xfe\x03\xe7\x9f\x83\x5a\xe1\xdd\x36\xa6\x90\x9b\x3e\x12\xe2\x3f\x77\xa1\xd4\xff\x0e\x2e\xc5\x2b\xc8\x0e\x61\x3f\x84\xd7\x8f\x57\x0d\x93\xf0\x60\x5c\x0c\xa4\x55\xec\xba\x83\xb9\x31\x82\xa1\xa0\xa0\x23\xac\x0f\x31\x22\xe6\x18\x32\x58\xb8\x2c\x04\x3d\x80\x27\x41\x1e\x07\x86\xe9\xda\xa3\x63\xb7\x28\xce\x04\x6f\x31\x54\xec\xb8\xec\xa2\x24\x37\x29\x4d\x34\xb9\x77\xe9\x2c\x12\x84\xf7\x7e\x6f\x86\xe2\x40\xd8\x0f\xf6\xd1\x2c\x18\x15\xfa\xea\xbc\x0f\xf1\xe4\x30\x82\xa3\x0b\x24\x7a\xfd\x38\xeb\x04\x06\x3a\x47\x90\x93\x4f\x05\x3d\xd8\xaf\x96\x2c\x74\x29\x98\xa9\x64\x85\x2b\x0f\x6b\xf3\x91\x85\xdc\x8d\x35\xd6\x84\xa9\x41\x5a\x1f\xaa\xd5\x20\x94\xea\xd2\x94\xac\x55\x89\x7f\xc9\x6c\xa6\x2d\xcf\xef\xbf\x56\x4f\x3e\x11\xeb\x38\xa5\x07\xa1\x46\x53\x0a\x15\xa1\xb1\x02\x34\x10\x14\x8c\x7b\xd9\x95\x1f\x1d\x2b\x46\x17\xa2\x38\xd4\x5d\xa9\xf3\x11\xdd\x1a\x84\x28\x43\xd3\x1e\x52\x62\x7c\x89\xc0\xe5\x10\xa7\x63\x0d\x9b\xe2\xb1\xfa\xbc\x08\xef\x54\x5b\xf3\xe5\x30\xd8\xfc\x64\xe2\x93\x30\x86\xe2\xc8\x78\xd2\x47\x72\x74\x6c\xe2\x1d\x91\xf3\x14\x6c\x16\x1b\x34\x06\x28\x82\x34\x9e\x83\xac\x09\x06\x6e\x2d\xab\x75\xb7\x26\x08\x47\x84\x14\x09\x5c\x0b\x85\x60\x40\xf4\x78\x44\xc0\x65\x27\x2f\x85\xd4\x51\x85\xbf\xdc\x2c\xc8\x8e\xe5\x7a\x05\x7f\xc4\xe7\xdf\x23\xe0\xaf\x3b\x45\x64\x2d\xee\x3f\xef\x9e\xab\xcb\x10\xcf\xd1\x58\x56\xb2\x4a\xec\xe4\x27\x2f\x54\xc3\xab\xe0\xc5\x66\x0e\x61\xd0\x57\x40\x4d\x23\x81\x74\xc4\xc8\x49\x98\x21\x8b\xe3\x44\xf1\xf3\x89\x88\x1d\x81\x6e\xe4\x55\x9c\xa9\x90\x37\x46\x32\xcd\xe6\x0e\x36\x27\x75\xe7\x86\x19\xe8\x00\x0a\x64\x8c\x60\x8f\x29\x8d\x3f\x66\xe5\x25\xad\x1b\xaf\x42\x41\x8d\x39\xa6\x4f\x76\x94\x97\x37\xb0\x23\x44\x88\x2e\xae\xfa\xb2\xe6\xdc\x80\x1d\x42\x97\x59\x1f\x58\xa2\x18\x95\x0b\xb1\x65\xd7\xf0\x1b\xee\xb6\xce\xb5\xb3\x9c\x12\xb2\xd4\x7a\xc7\x3c\xc8\xf2\x20\x87\xe2\x81\x4d\x73\xf9\xd6\x8e\xe9\x39\x93\x42\x52\x9b\x2f\x42\x15\x2b\x6a\x04\x46\x83\x1b\x9d\x54\x46\x85\xaf\x06\x4f\x3c\xa8\x01\x23\x4a\x08\xfc\x6a\x6d\xe3\x01\x8f\x7b\x39\x38\xa4\x35\xb8\xda\x63\xa2\x93\xf2\x98\x06\x9d\x58\xea\xf8\x1f\x3b\x20\x7f\x2f\xfd\xaf\xce\xde\x7a\x65\xbd\x1f\x55\xfc\x7a\x0b\x1a\x93\xeb\x51\x7f\xe7\xe2\xaf\xeb\xa3\x8a\x6f\xf0\xa8\x21\x34\x63\x97\x6e\x97\x0b\xc2\x28\xde\x8a\x17\xc4\x3c\x4a\x3e\x92\x9c\x19\x2f\xda\x3e\x0d\x7a\x47\x48\x68\x21\xb5\xe5\xbc\x94\x1a\x7b\x80\xc4\xf4\x43\x46\x4b\x7b\x9b\x1e\x65\xd7\x76\xfe\xb4\xd9\x82\xaf\xa5\x05\x6b\x38\x25\xac\x9a\x8a\x3d\x56\x2f\xa5\x3a\xc7\x03\x59\x8e\x46\x6c\x01\x93\x74\x14\xdd\x05\x56\xd5\x49\x53\xb6\x47\x2b\x8a\x5b\xa4\xb4\xa0\x0d\x97\xa7\x59\x56\x09\x4d\x8b\x58\xe1\xac\x30\x3d\xa5\x87\xff\x98\xb3\x08\x30\x9c\x29\x3e\x66\x90\xd3\x2f\x46\xbd\xcf\xa4\x1f\x59\x3c\x9d\xbf\x84\x03\xb0\x60\x26\xfd\x22\xa5\x0a\xdd\x41\x21\x2e\x7b\xe6\xcb\xf8\xc8\x82\x44\x3d\xd2\x73\x16\xf9\xc5\x2e\x5c\x9b\xef\x3c\x92\xe8\x2b\xe7\xae\xcf\x82\x8c\x3e\xd2\xe2\x0c\x46\x0f\xe7\xd3\x86\x07\xde\x70\x3e\xa8\x82\x99\x05\x86\xf6\x50\x7e\x3a\xd9\x25\xd2\x3c\xd0\xc4\x03\x9a\x49\x6a\xeb\xed\x25\xaa\xfc\x0e\x50\x64\xa7\xc9\x9c\xb9\xf3\xd3\xce\x47\x93\xa1\xc9\x87\x6c\x15\xf6\x37\x67\x96\x50\x9a\x58\xa5\x75\x93\xbf\x66\x69\x79\xf3\x76\x21\xbb\xcc\x86\xb7\x0b\xad\xd0\x92\x75\x27\xf5\xfb\xff\x94\x5a\x20\x73\xc4\xdd\x26\xd1\x5c\x06\xd4\xd8\x75\xc4\x41\x67\xd0\x20\x04\x2a\xbf\x81\x0b\x43\xe3\x06\x67\x6b\x37\x83\x1f\xc7\xb3\x69\xdf\x34\x8a\x36\x43\xab\x00\x52\xf2\x06\xeb\x27\x5a\x86\x65\x40\x47\xc1\x9c\x92\x85\xbd\x27\x1a\x87\x1a\x5e\x07\x36\x0f\x1a\x0b\x75\xa9\x07\xa0\x86\x9c\x0c\x72\xe6\x37\xc7\x9a\xc0\xff\xc9\x64\xe1\x45\xef\x80\xd2\xa8\x29\xf6\xbc\xeb\xab\x33\x8c\x0c\x4a\x89\xad\xf7\xe4\xaa\x59\x1e\x88\x2e\xb3\x75\x6d\xea\x34\x14\x09\xc1\x0d\x12\xc4\x1f\x4a\x27\x75\xa7\x01\xfe\xd0\xdc\x03\x33\x3f\xb1\x9d\x87\x59\x33\xbb\x61\x96\xa0\x32\x44\xbd\x39\x1e\x1b\xe6\xf8\x0a\xd9\x05\xb1\x74\xe6\xc3\x0b\x34\x7e\x0e\xf3\x16\x32\x35\xc3\xbc\xca\x6f\xc2\x35\x23\x9b\x65\xf7\xf0\xb5\x85\x70\x0c\x31\xb7\xed\xc2\xf7\x21\x3f\xc5\x9f\xb9\xef\x20\xb6\x5c\xa1\x1b\x6d\xa1\x4d\x6b\x77\x71\x6f\x2a\x69\xfe\x36\x62\xd7\x1c\x77\x00\x29\xae\xb3\x9e\x91\x07\xd8\x50\xef\xfd\x11\xc7\x86\x0d\x8c\x85\xf6\xec\x8a\x25\xb3\x16\x92\x71\x56\x2f\x2d\x0e\x41\x8f\xb5\xc0\x73\x18\x43\x9e\x83\x06\x34\xcb\x89\x6f\xc8\xf4\xc5\xe1\x89\x5a\xc3\x79\x73\xe8\x3e\xe4\x47\x95\x81\x45\xee\x4a\xb0\x7d\xec\xa9\x27\x23\x2a\xa7\x48\x71\x59\x38\x84\x48\xf0\x80\xa6\xc1\x81\x5d\x2e\x82\x73\x37\xdb\x08\x7d\x2b\x49\xf3\x01\x78\x54\x3d\x70\xca\x51\x0d\x50\x5a\xd5\x97\xeb\x87\x16\xda\x16\xf1\xe6\x26\x11\x70\xa8\xb0\x82\x8a\x58\x4c\x35\xfa\x7a\xbf\xce\x99\xaa\x69\x16\xaf\x34\x0d\xef\x2b\xe7\x1d\x7d\x95\x48\x52\x4f\x0c\x3f\xcf\xc7\x3f\xa8\x09\xe9\x6b\xb4\x8d\x3d\x2a\x77\xda\xe0\x9c\xd5\x95\xba\xed\x84\xa8\x3e\x00\xdf\xdb\x06\x9b\x68\x35\x3e\x33\xc6\xd2\x9f\x9d\xfe\x4c\xb3\xce\x0e\xee\xbb\x24\xc4\x88\x10\x51\x68\xf6\xd4\x17\xaf\xcb\xf7\xf6\x6f\xb2\x9c\x23\x9e\x8d\x85\x22\x58\x90\x2d\xc5\x88\xb9\xef\xa0\xdf\x5c\x04\x66\xad\x22\xe8\xfc\x3f\x55\x5f\x96\xe0\x2c\xcf\xf4\xba\x97\x77\x67\x06\x9c\xe0\x66\x30\xbf\x81\xe4\x4b\x56\x7f\x4a\x25\x95\xf3\x9c\x9b\xb6\xa0\x99\xc2\xe0\xa1\x5c\x92\x82\xa8\x73\x44\xdc\xdd\xf0\x46\xed\x72\x43\x62\x01\x1b\x5a\x98\x5f\xe8\x0c\x1d\x1a\x45\xec\xe2\x1d\x21\x03\x9e\x6c\x24\xfb\xb8\x2e\xae\x5a\xab\xf7\x2d\xc0\xd2\xb9\x75\x06\xb8\x12\xcb\xb4\x42\x43\x71\x0f\x2d\x5f\x5a\xa5\xfa\x03\x48\xde\x11\xd0\x86\x62\x97\x73\x8c\xa9\x80\x11\xfe\x89\xb3\xba\xb2\xe3\x1a\x42\x11\xe3\x9a\xc3\x6f\xdf\x20\x12\x15\xb4\x1f\x74\x2b\xc8\xca\xb1\xb7\xcb\x4f\x19\x0c\x96\xf2\x08\x8a\x4e\xb1\xce\x86\x87\x08\x49\xcf\x11\x25\x02\x79\x4b\x71\x43\x5c\xb4\xd0\x7b\x78\x80\x5a\x67\xbd\x36\xd1\x4d\xe6\x7f\x9b\x22\xc4\x2c\xd4\xd6\xc2\xb7\xe2\x15\x9b\xa4\xce\xd4\x89\xfc\x97\x11\xc9\x09\x7c\xd8\x39\x1c\x31\x92\x24\x3b\x5c\xcc\x79\xfd\x4f\xe4\x9a\x35\xd2\xbc\x9d\x5f\x43\x03\x8b\x24\x33\x4a\xf7\x8f\x10\xe3\x66\x63\xfc\x00\x3e\x12\xf1\x1e\x24\xb8\x86\x74\x4b\x8b\xd6\xed\x25\x50\xff\x68\x8b\xa3\xe8\x0b\x1d\x99\xf2\x2d\x94\x7c\x3c\x30\x86\x28\x32\x02\xe8\x9d\xfd\x83\xf1\x26\x8f\x84\x19\x06\xad\x4b\x9b\xec\x26\x98\x49\x3c\x6a\x7e\x00\xe5\x1a\x1c\x9b\x14\x13\xc8\xc0\x64\xdb\xbc\x25\x6a\x36\x7c\xd8\x33\x19\x3e\xf8\xc9\x38\xc2\x80\xa0\x59\x23\x98\xbd\xbb\x65\x20\x2c\x25\x44\x46\x47\x7e\x20\x5f\x65\xb0\x6f\x62\x73\xeb\xf8\x24\xfd\x57\xc3\x10\x43\xa2\xc4\xdc\xf4\x29\x85\x09\x05\x77\x13\x1d\x6f\xb8\x73\xa7\xe5\xa8\xd3\x39\xd8\x70\x2e\x34\xe3\x1d\x07\x83\xa4\x51\x0f\xd5\x4a\x45\x56\xac\x25\xfc\x5f\x50\x69\x38\xb4\x03\xf5\xc6\xa9\x09\x48\x92\x95\x37\x44\x61\x4e\x05\x38\x36\x4c\x3d\x71\x9f\xb9\xce\x0b\x6a\x65\x5b\x63\xcb\x50\xa9\x1a\x64\x0c\x3a\x84\x31\xd1\xa0\xec\x5b\x0c\xc1\x69\x7a\xa1\xee\x20\xfc\x26\x7c\x45\x7d\x73\x86\x6f\x80\xeb\xc0\xa9\x9f\x6f\xf5\x41\xe7\xd8\x9c\xb3\x7c\x23\xc4\x6a\x69\x93\x3e\xa3\xa1\xfe\x63\xc4\x80\xcc\xd4\x2c\xf0\x20\x9b\xc1\x27\xf5\x72\x16\x9b\x46\xb4\x97\x3a\x77\x02\x39\x98\x34\xd1\x03\x1c\xba\x36\xe4\x50\x47\x3a\x6e\x01\xe8\x6a\x06\xc9\x11\x0c\xdd\x52\x66\x60\x78\x09\x2d\x83\x2e\x74\xd5\x78\xc6\x1a\xc0\x6f\xfe\x8b\x30\xd1\x00\x1b\x19\xcd\xef\x39\xe6\x1d\x43\x16\x06\x9a\x05\xe2\xf2\x15\xe8\x5c\x2a\x40\xa9\xe0\x39\x16\x19\x46\x2d\xb5\xdb\x52\xe8\x3a\xf4\x82\x0e\xd0\xd6\xf0\xcd\x4b\x18\x38\xa1\x59\x85\x25\x04\x61\xb7\x12\xb7\x26\x4c\xec\x92\x02\x8d\x47\xd2\x6e\x3e\xa2\x6d\xe5\x8f\xdf\x2d\xb7\xf6\xe6\x7f\xc2\xaf\x68\x70\xd3\x2d\x12\x67\x90\x4d\x97\x88\xc4\x9b\x69\x41\xb4\xe9\xd2\x49\x8e\x45\xb2\xca\x9a\x4e\x1f\x82\xdc\xb3\xe7\x09\xc9\xda\xc4\x0a\x83\x5a\x6f\x41\x31\x2a\x47\x32\xb8\x58\xd7\x68\x67\x87\x1c\xbf\x3e\x2b\x7e\x31\xe4\x7f\x28\x38\xe3\x42\xdf\x12\x68\xb5\x34\x02\xde\x5e\x28\xc4\x4e\xa4\xbe\x38\xe1\x49\x2b\xf5\xea\x3a\x3d\x67\x0e\xb4\xfe\x8c\x25\x12\xeb\x6e\x2e\x05\xd9\x0d\x1a\x42\xe1\x37\x61\x5d\x2f\x31\x78\xfa\xfb\xe4\x55\x97\x38\x3c\x83\x6c\x4f\xa0\x34\x41\x3e\x58\xff\x34\xc3\x0b\x1b\x5c\x1c\x11\x7a\xd2\x79\x83\x7f\xc6\x34\xe5\x21\xf9\x48\x75\x48\x33\x37\xb7\x5e\x70\x0e\x1a\x90\x55\x37\xbc\x12\x11\x84\x98\x0f\x98\x3e\x9c\xe6\x85\x1c\x2c\xaf\xa5\x1b\xf2\x80\xa6\x13\xfd\x5e\x39\x2e\x5b\xd7\x44\xf5\x6d\xba\x16\xb5\x63\x40\x61\xdb\x80\xc1\xaf\x88\x29\x92\xd8\x82\xb8\xac\xd3\x74\xce\x3c\x70\x2c\xef\xd5\x38\x37\x97\x65\xa5\x95\x91\x14\x88\xf9\x49\xae\x72\x7e\xa7\xac\x32\x50\x5b\x67\xe5\x21\xd9\xa0\x56\x34\x39\xe8\xf1\x50\x42\x28\xc9\x9b\x10\x6e\x0f\xe4\x15\x6d\xac\xe8\xd3\x7a\x87\xaf\xc6\x6a\x2d\x30\x6f\x45\xfa\x31\xe5\xd5\x4d\x02\xb3\xc9\xc3\x82\x60\xc0\xa2\x98\x25\x7e\x97\x62\x14\x61\x1d\x28\x3a\x0b\xa5\x27\x7c\x69\xf6\x7f\xa0\xda\x9c\x14\x75\x4b\x9a\x4e\xd7\xb0\xc3\x14\x45\x7c\xbf\x69\x64\x25\x9e\xc6\x48\xd4\x43\x80\xda\x2f\x9d\x5d\x1e\x2b\xd8\xb3\xf8\xba\x6c\x38\x2b\x86\xef\x9d\x43\x93\xf4\x5b\x98\xc9\xf5\xed\x91\xd3\x2f\x63\x34\xce\xc5\xf9\x92\x8a\xc3\xa8\xec\xd7\x33\x67\xfc\x83\xfd\xa6\xe3\x50\xed\xff\xb5\x1b\xc2\xdb\x06\xeb\x0b\x1d\x3f\xe8\x21\x9f\x9b\xfc\xa3\xcf\xc9\xef\xfb\x63\x35\xbb\x78\x3c\x4c\x24\xfb\x60\xd4\xc3\x96\xe6\x23\x49\x5c\x78\x5f\xd0\x5a\xeb\x83\xb7\xc2\x0f\x83\xdb\x8e\xff\xfd\x8f\xd3\xab\xd6\xb7\x25\xaf\xa6\xa1\x1a\x64\x1d\xf2\xb6\xc1\xc6\x38\x87\x21\x05\x3c\x2d\xc9\xc6\xa9\x2b\xeb\x37\x18\x64\x20\x98\xa9\xfc\xbc\x77\xc5\xa8\x4d\x29\x9b\xef\xee\xbc\x0b\x94\x77\x89\x65\xdb\xc2\xe2\x0e\xef\xef\xae\x27\x04\x26\xcf\x97\xe5\x92\xd7\xee\x9f\xb1\x4f\x3a\xce\xae\xf7\xe4\x5d\x36\xae\x58\x5d\x74\x9f\x70\xd5\xd4\xb1\x1b\x69\x9f\xe1\x97\x11\x9d\x35\x43\x9e\x41\xeb\x57\x5d\xf2\xf4\x21\xbd\x68\xea\x27\xb1\xfe\x59\x38\x6f\x8c\x0c\x55\xbc\x4b\xb8\x15\xc9\x51\x83\x14\x20\x28\x3e\x6a\xcb\xb9\x4c\xde\x60\xbe\x99\x55\x03\xd2\xcf\xcf\x03\x03\xb9\x3c\x3e\x55\xf3\xf6\xfa\x99\x7e\x19\xec\xa6\xbf\xc9\x4f\x14\xf3\x28\xab\xa5\x72\xe1\xea\xdc\x7f\x63\xee\x32\x72\x80\xf2\x9f\x7d\x4b\x31\x00\x1e\x1c\xf3\x15\xd6\x1b\x45\xd3\x26\x6f\x28\x36\xc6\x49\x9f\x4d\x9c\xaa\xfc\x8c\x1f\x99\x4e\x36\xc1\x6f\x6b\x9a\xbd\xf2\x44\xd2\xfd\x4c\x22\xfa\xdb\x3b\x0f\x9a\xb5\xb0\x05\x05\xaa\xdc\x54\x43\x64\x9f\x18\xdb\x1b\x4a\xef\x08\xe8\x83\x03\xc4\x78\x0e\x50\x6c\x30\x8b\xe9\xff\xe6\x68\xe1\x65\xc3\xe8\x60\x0a\xbf\x60\x4c\xe5\x44\x53\xff\x0f\xf3\xc4\x5f\x1e\xde\x69\x8e\x20\x9a\xe3\x95\xee\x6b\xb5\x31\x31\x19\x3f\x90\xc0\xf6\x00\xdf\xab\x34\x79\x74\x1c\x5d\x63\xe4\x85\xc1\x02\xc3\x88\xaf\x32\x05\x1d\xe8\x94\xb9\xc6\x49\x7e\xc2\x4b\xb1\x74\x2b\x9f\x24\x00\xc2\x77\x43\x6c\x9e\x8c\x3c\x9d\x22\xc3\x8d\x15\x7d\xdb\xe7\xcd\x4d\x9e\x6c\x93\x5f\xea\x9a\xc2\x53\x83\xc7\x4d\xfb\x8b\xe6\x9e\x5a\xa0\xf2\xc8\xcd\x8d\xa1\xdc\x3a\x31\xf9\x0d\x0b\x5e\xd3\x00\x8c\xf3\xd5\xdd\x35\x74\xdc\x3d\x4b\x8b\xfe\x95\xc2\xa2\x63\x52\x72\x97\x9c\x37\xae\x4e\x44\x12\x67\x03\x28\x09\x29\xa6\xec\x60\x17\xa0\x33\x08\xc0\xca\x03\x43\xbd\xc2\x2b\xb2\x9b\xca\x71\x38\xbe\xb3\x8f\xe4\xc8\xb1\x2a\x56\x80\xe4\x45\xb7\x58\xf8\x6c\xd1\x79\xb8\xde\x55\x95\xae\xdd\x21\xa7\x5d\xc3\x24\x43\x44\x24\x0d\x8e\xae\x76\xff\x4f\x5d\x6f\xd8\x61\xb0\x0f\x65\x5f\xe6\x8b\x7a\x93\x86\x8a\x5c\x2e\x8a\xcf\x75\xbb\x2d\xc6\x49\x60\x55\xff\xaa\x75\x62\x16\x5e\x56\xf3\xc7\xf6\xf9\x41\x8e\x90\xd4\xfc\xc1\x2c\x41\xd0\x56\x27\xb0\xc6\x2f\xd3\x26\xc2\x2d\xc8\x7b\x52\xf3\x55\x6f\x86\x50\x0c\x50\x21\x04\x2e\x1a\x35\xda\x6a\x43\x9b\xfe\x1d\x23\x0f\x43\xf6\xd9\x71\x5f\x51\x94\x2a\xb3\xe0\xe1\xab\x71\xf2\x77\xd7\x9f\x72\x9a\x61\xce\x31\x82\xa3\xeb\xc5\xc0\xf5\x50\xf1\x8a\xc1\xdd\x55\x2e\x46\x79\x2e\x68\x74\xf1\x87\x94\x4c\xb1\xaa\x6b\x0e\x12\x88\x21\xbf\xe5\x73\x63\x82\x35\xb9\x51\x31\xa7\x72\xcd\x65\x80\xdf\xbc\x37\xa8\x17\x03\x99\xbc\xfb\xf6\xcb\x69\x8d\x81\xc1\xdd\x25\xc4\xea\xff\xca\xa2\x8f\xe5\x51\x97\x9b\x35\x86\x31\x80\x3a\x45\xe4\x25\x3d\xf5\x0b\xae\xe4\xe2\x2d\x1d\x4a\x39\xbe\xfa\x04\xc3\x45\xfb\x74\x78\x68\x90\x62\x63\x5f\xbe\xa7\x76\x19\x98\xc2\xbd\xe0\xbe\x1e\x32\xc4\x60\x92\xbb\x1a\x26\x94\xe1\x99\xd1\x93\xd6\x0c\xc3\xf6\xe7\x76\xe7\xf2\xd3\xde\xbd\x1c\x9d\x1d\x5b\x28\x2f\xd1\x8f\xc2\xa1\x1f\x16\x1b\xdd\xf5\xc2\xed\xcf\x85\x9e\x59\x5e\x19\x90\x87\x23\xc8\x94\x26\x83\x7d\xc6\x18\x4e\xaf\x98\xf1\x13\x01\x09\x79\xe7\x8d\xc8\xad\xa3\xf7\x8e\x09\x72\x19\x02\xb0\x84\xc3\x62\xec\x91\x2e\x11\x8c\x5a\x9a\x49\x49\xaa\x4c\x6a\x3a\xdd\x99\xa5\x09\x29\xe5\xff\xaa\x73\xd8\x60\x84\x73\x46\xd5\xeb\x8d\xbe\xc7\xde\x2d\x42\xc4\xaa\xb9\x4a\xa7\x56\x61\xd6\xcf\x5a\xce\xa7\x2e\x2f\x3f\xac\xda\x08\x82\xd2\x95\x95\xc4\x70\xfa\x83\x0c\x9a\xd3\x75\xf3\x8a\xba\x29\xc3\x15\x53\xd5\x3e\xa7\x5a\x82\xb1\x80\x05\x1d\xd6\x3a\x61\xe2\x4b\xcd\x6b\xee\x46\x24\x69\x52\x43\x7d\x1e\x2d\x05\x6b\xec\x88\x01\x1c\x0c\x34\x4a\x18\x68\xc4\x08\xc5\x6a\x57\xca\x23\x1b\x20\x09\x07\x19\xc4\x72\xa0\x38\x42\x85\xd6\xd0\xaa\xae\xf6\x59\xef\x35\xc8\x52\x22\x4f\x1d\x24\x24\xb1\x9a\x71\xca\x94\x5f\x64\xe5\x84\x21\xb4\x71\xa5\xc8\x6f\x50\x94\xf8\xb3\x52\xa0\xc8\x4a\xc9\x2a\x9e\x36\xc4\xc8\xa2\x40\x19\x94\x0d\xc7\x56\xfb\x30\xc8\xb1\x6f\x69\x55\x26\x29\x53\xe9\xa5\x87\xbf\x40\xaf\x41\x9b\x2d\x55\x92\xc8\xb6\x0c\xa7\x53\x47\x59\x64\x24\xc8\x39\x0a\xb0\xa3\x6c\x80\xe7\x2c\xd6\xab\x18\x1d\xbc\xc4\x70\x3e\x83\x86\x53\xc8\x2f\x38\xe9\x79\x76\x86\x99\xd7\x29\x65\x31\x2b\x47\xd1\x93\x60\x9b\xde\x15\x33\xcf\x92\x7b\x35\x8c\x3c\x8f\x3e\x07\x74\x5a\xe5\x21\xde\xcc\xec\x73\x9a\x9e\x18\xe2\xbe\x80\xfc\x77\x99\xc2\x20\xa4\x3b\xd5\xcc\x1e\xb8\xd7\x17\x38\x63\xcc\xa6\x03\xdb\xd3\xe3\xeb\x83\x19\x60\x4d\x9b\x83\x31\x15\x8c\xab\xb4\xa7\x7f\xf9\x52\x2c\x83\xee\xe5\x6c\xf0\xe0\x2a\xc9\x03\xc5\xda\xd9\x85\x6c\x29\x29\x1d\xc0\xef\x57\x16\x28\x59\x09\x90\xd6\xcd\x79\x42\xf8\xd7\xe1\xfa\x8f\xfb\x87\xf8\x4f\xfd\x07\xe4\x0c\x19\x48\x1e\x3f\xbb\x96\x1a\x20\xa5\x7d\x88\xda\x37\x58\x3d\x63\x45\xa3\x2a\x92\x10\x7a\x8d\x81\xa2\x6d\xd0\x72\x50\xc8\xdc\x35\x24\xb8\x50\x6f\xfc\xa6\xd8\xe4\x0e\xfd\x52\xe0\x10\x5f\x74\x12\x95\xb4\x09\x9d\x46\xe5\x69\x9f\x3a\x5d\xab\xba\x1e\x43\xf9\x78\xc4\xce\xad\x4a\x8c\xc8\x29\x56\xdb\xf1\x20\x64\xb8\xc1\x41\xac\xf9\xc7\xf6\xa3\xe6\xbd\xfb\xcf\xf8\x52\x1c\x4d\xc9\xe0\xee\x3c\x12\x6e\x27\x6b\x56\x00\x06\xb3\x6f\xe8\x20\xe8\xf7\x94\x7e\x00\x43\x7d\x0a\x1c\x53\x11\x61\xfb\x03\x1d\xb1\x47\x6f\x33\x4f\x8f\x24\xd5\x40\x3a\x4a\x8a\x53\x93\x68\x35\x3a\x39\xc0\x51\x9f\xf3\x3e\xd3\x9b\x8f\x3b\x75\xbd\xe2\x33\xbd\xe8\xc4\x00\x4a\x96\x98\x58\xb7\xdc\x67\x52\x3b\x44\xcd\x2a\x5a\x76\x63\x69\xc2\xf4\x08\x46\xd6\x22\x12\xd5\xfe\x77\xb7\xbf\xa0\x61\xc5\xe4\x83\x61\x78\xe4\x5c\xda\x78\xbb\xa7\xc2\x4d\x36\xa6\xd3\x6a\x41\xc4\x2f\x9f\x75\x03\xed\x2a\x48\x57\x8b\x88\x6c\x69\x95\xfe\xcb\x99\x16\x6b\xb7\x78\xe5\x0b\x1b\xf4\x33\x49\xf6\xff\x14\x51\xd1\x3a\x18\xde\x8c\x80\x44\xb3\x7b\x19\xcc\x25\xcc\x4c\xbf\x05\xe4\x85\xf2\x0f\x25\x6b\x63\xbe\x1e\xfd\x51\x9c\xe4\x03\xef\x6f\xdd\x28\xc3\x24\x2a\x45\x8a\x33\x92\x1c\x1a\xe9\x56\x60\x3a\x30\x1c\x0d\xa7\x8c\x53\x86\x27\x37\x8d\xcf\xdc\x3c\xa3\x11\x3c\xc5\x71\xb2\xca\x79\x24\xbf\x6b\x13\x33\x0b\xd1\x05\x8d\xfb\xed\xfd\x0c\x6a\x56\xf0\xbd\x9e\xb4\xff\x00\x31\xeb\xff\x6e\xf1\xb2\x5a\xfe\xbf\xa0\x6d\x4d\x3a\xe3\x28\xe7\x90\x2a\x0a\x15\x98\xec\x4d\x48\xcd\x58\xf8\xe4\x37\x17\xc3\xaf\xe2\x36\x42\xa8\x47\xf3\xaf\x5c\xb2\x7e\x0c\xa9\x5c\x1b\xeb\xee\x56\xfc\xb9\xa3\x72\xf0\x9b\x51\x94\xd6\x63\x40\x73\x6d\x4d\x99\x5c\x8d\xf9\x06\x2d\x7f\xea\x26\x60\x9d\x6a\x4d\x06\xb6\x7c\xeb\x14\x5d\xfc\xbe\x85\xd2\x8b\x5b\xe4\xd2\xb8\xc4\xc7\x2b\x95\xb0\x74\x76\x40\x73\xae\xa1\xd6\x8a\x49\x16\x62\x6c\x2d\x3f\x8b\x00\x6f\x59\xd6\xdc\x7a\x73\x09\x01\xf2\xc0\xd2\xad\x2b\x4a\x4f\x12\xd8\xa8\xdd\x09\xcb\x15\x29\x37\x45\x26\xa4\x95\x73\xa6\xf5\xca\x7e\x71\xc5\x2e\xb6\xd8\x3e\x29\xdc\xd8\xd2\x56\x78\xff\x53\x24\xf0\xb7\xa4\x08\x4a\x4b\x7f\x3a\x5e\x39\x35\x6e\x31\xb8\x69\x4a\xd5\xe0\x10\x3e\x2e\x61\xec\x02\x41\x46\xe6\x44\xfd\xdf\x1d\x9e\xd6\x44\x4f\x47\x7c\xd5\x60\xd6\xe2\x1b\x1d\x94\xf2\x38\xee\x06\xc3\x7a\x86\xae\x0e\x74\xfa\x1f\x8c\x22\x19\x0e\x96\xd6\xad\xfc\xb9\xe3\xe6\xec\xb7\x7b\xbc\x90\x51\x86\xcc\x31\xfa\xbe\xb4\x30\xaa\x38\x1a\xf3\xe3\xe1\xce\xe5\x7b\x35\x26\x00\x1e\x60\xc0\x2d\x04\x7a\x1e\x07\xb4\xb4\x88\xbc\xcb\x2e\x20\xf3\x92\xda\xe4\xfe\x72\x70\xbe\xcc\x00\xa6\xaa\x1d\x6d\x69\x15\x23\x6d\xad\x6f\x6e\xbd\xea\xae\x92\x79\x76\x06\x62\xa9\x23\xaa\x9f\xe6\x9c\x34\xd2\xd5\x26\x1b\x4c\xfa\x45\x55\xb7\x6f\x82\x27\x0c\x4f\xb6\xd6\xe0\x79\xad\xca\x27\x3c\xec\xc5\x67\x8f\xf7\x28\xa1\x20\xe1\x88\xa5\x8c\x58\x22\x85\xfe\x70\x3d\x3e\x07\xe8\x71\x71\xe2\x9a\x5c\xb4\xba\x05\x5f\x6d\xe4\x54\xfa\x51\x40\xbd\xf1\xcb\x98\xd9\xfb\x75\x46\xd9\x37\x1a\x3b\x5b\x62\xe2\x0e\x1a\xf5\x60\x6e\xc1\x3c\xfc\xd2\xca\x9f\x67\x4b\x8e\x74\x23\x43\x63\x89\x88\x1d\x98\xeb\x4c\x04\x39\xb2\x24\x18\x8f\xac\x5c\x45\x78\xc8\x5c\xe1\x26\x13\xee\x3a\xb9\xfc\xaf\xca\x4c\x46\xde\x35\x09\x5d\x6b\x92\xd0\x52\xeb\x31\xb3\x23\x47\x78\xea\x48\xaa\x2b\x0d\x90\xf4\xf5\xce\xab\x68\x64\x9c\x1b\x3a\xac\x4a\xe0\x7f\xae\x59\x86\x31\x2d\x24\xdc\x0e\xe8\x94\xf0\xf0\x76\x74\xef\xfe\x1d\x89\x63\xc5\x03\x39\x40\x83\x7a\xa5\xd6\xb3\xac\x8c\x1c\x00\xb1\xd8\xd4\xa8\x1d\x98\x8b\x8f\x3b\x96\x1e\x0f\x89\x77\x1e\xc9\xbd\x3d\xb8\xf1\x14\xd7\xe8\xce\x60\x4e\xd4\x7a\x69\x8a\x96\x86\x7b\x00\x67\xdc\xcd\xd0\x63\xb5\xca\xd6\x3f\x6a\x1b\xe7\x2b\xbf\xc9\xc9\x64\x7c\xd0\xb5\x49\x13\x15\x1f\x80\xdf\xe3\xaa\x2e\x41\x0d\xcb\xcb\x2a\xa7\x24\xe4\xb1\xfa\x17\x54\x97\x7b\xe3\xab\x54\x17\x0e\xec\x2a\x87\xae\x14\x6b\x5f\x93\xde\x3d\x8d\x61\xac\x7d\x65\xe7\x0a\x26\x33\xe4\x9c\x49\x8a\xbe\x52\xea\x62\xff\xcc\x3e\xf6\xdc\x3f\x3f\x17\x98\xdb\x53\xa7\x48\x30\xbb\xa1\x82\xc6\x3b\xb8\x83\xbb\xe0\x95\xe4\x4e\x0f\x1c\x78\xd3\x90\xa0\x66\xb7\x62\x09\x12\xca\x5e\xaf\x3c\xd4\x70\xa3\x79\xf1\x0b\xdc\x35\x0a\xda\x31\xa6\xde\x65\x5a\xa3\xf1\xef\x4e\xa2\x2d\xc2\x1f\x7e\x45\x45\x33\x50\x7b\xb9\xfc\xde\xed\x2e\x13\xff\x21\x9a\x8b\x52\x3c\xf7\x12\xbb\x23\x1f\xc3\x9e\xd4\xc6\x3b\x6f\x8b\x31\x4e\x44\xab\x16\xdb\x8c\x8b\x8e\x30\x42\x90\x9b\xac\xb5\x7c\x3f\x75\x2d\x99\xcc\x35\x7c\x19\xfc\x4f\x59\xd8\x09\xdf\x11\x3f\xf3\x52\x4a\xeb\x7b\xe6\x7c\xe2\x9e\xbe\x89\x31\xb0\x1d\x34\xf2\x2a\x40\x55\x03\xbb\xe5\xce\xd1\x27\x49\x8e\xd2\x49\xbb\xd5\x3b\x07\xff\xb9\xa4\xaa\xd2\x2f\x38\x41\xf9\xd4\x89\x30\x1f\x24\x9d\xd3\x17\x7a\xbb\xa5\x1e\x6f\x4f\x9b\x07\xc2\x63\x17\x45\xd5\xe1\x7f\x64\xce\x91\x5b\x74\x43\x9b\x41\x39\x2e\xdb\x6d\xa3\xc5\x50\x68\xdb\xee\xac\x24\x61\xeb\xfe\x90\x96\x73\x87\x44\xec\xd6\x6a\xef\x62\x80\x58\x47\xda\x9a\x93\x23\xfd\xfe\x6d\x35\xf8\x63\xb5\x49\x80\x1d\x68\x97\xb9\x4f\x70\x21\xb7\x8a\xf8\x08\x6f\xb4\x61\x71\xbf\xea\x7e\x45\x29\x3e\x9b\xa3\x49\xfc\x39\xcc\xe2\x0b\x16\xfd\x97\x3f\x09\xea\x77\xf4\x0e\xa9\x72\x3f\xf1\xfa\x99\x20\x91\x5e\xba\xd5\x85\x04\xac\xda\x15\x95\xe1\xbe\x33\x88\x91\xf7\x4c\xaf\x38\xb8\x8e\x14\x9c\xac\xf2\x01\xbb\xd3\xd1\xf5\x95\xe1\x4a\x39\xe5\xd0\xd3\xb8\xa8\x21\x31\xd2\x1f\x32\xcb\xee\x65\x53\x56\xd1\x11\x83\xc4\x54\x22\xee\xbd\xe1\x6d\x94\xe1\x50\x11\xc9\x6f\xf6\xde\xbb\x95\x89\xe3\x49\x6b\xb2\xff\xb5\x38\xca\xae\x36\x29\xb8\xe8\xd1\x41\xb6\xdf\x27\x53\x7d\x41\x1a\x40\x1b\x66\xcd\xff\x35\xef\x69\x0b\x37\x56\xd6\xc8\x16\x62\x35\x9b\x38\x94\x59\xe3\x77\x03\x36\x40\xf3\x56\xd6\xda\xa6\x1e\xd7\xde\xf2\x42\x67\x21\xab\x89\xbf\xda\x31\x18\x7b\x57\x09\xb7\x9e\xff\x83\x42\x39\x89\x76\x90\x2a\x15\xcd\x0e\x36\x4e\x7c\x60\x48\x50\x10\x27\x0f\x6c\x12\xe5\x32\xb8\x61\xcf\x37\xd0\x30\x88\x85\x67\x1d\x82\x60\xd9\xc1\xc9\x9a\x07\x78\xde\x8d\xcc\x3a\x34\x05\x4d\xff\x9e\xea\x5b\x96\x3a\x4e\xf3\x2a\x41\xc4\xbb\x39\xf7\x05\x72\x9f\x0c\xe5\x9d\xdb\xb7\x04\x17\xd0\x3a\x18\x4b\x40\x3b\x85\xc8\x8c\x20\xf8\x51\xf6\xd3\x1d\x7c\x94\x05\xb2\xa5\xef\xf7\x1e\x45\x68\xfb\x7e\x6b\x87\xf7\xff\xc7\x9f\x83\xf7\x07\xd5\x62\xb7\xf4\x91\xee\xc9\x96\xfe\x37\x92\xb4\xf6\x62\xd2\xef\x96\xee\xaf\x68\x6c\x37\x02\xf4\x24\x9e\x5d\xf7\x8f\x10\xb0\xc1\x4e\x5c\x1f\x92\x41\x91\xf6\xae\xf3\x0e\xa2\xb1\x2f\x88\x7c\x27\x9b\xf1\xcd\x75\xba\x08\x66\x0f\x16\xd3\x57\x44\xcc\xcc\x14\x0a\x8d\x40\xec\x09\x10\x89\x4b\x38\x93\x76\x9b\xdc\xfd\x4e\xa4\x3f\x51\x70\x53\x7b\xd6\xee\x16\xc4\x46\x02\x8c\x40\x06\xfc\x21\x55\xac\xad\xac\x7f\x95\x48\x64\x4d\xfb\xfb\xb7\x77\x70\x76\x93\xd3\x68\x79\x16\xfa\x36\x80\x2e\xd8\x0d\x87\x3c\xb3\x77\x2f\x22\x0a\x06\x37\xd2\x5e\xc1\xec\x12\x83\x1b\x32\x29\x74\xf4\x25\x75\xb6\xa0\xee\x51\x39\x83\xfe\xc8\x5c\x13\x2b\xd7\xb9\x54\x19\x0b\xe9\x37\x4e\x7a\x23\x51\x7b\xf2\xa4\xe3\x12\x5e\x4c\xa3\x54\x76\xc1\x07\x6c\xe1\x00\xf3\xa1\x01\xe9\x0a\x65\xe2\xec\x20\xc4\x61\xdd\x31\x88\xe5\x73\xde\xc2\x85\x8a\x19\x3a\xde\x13\xb7\x6e\xce\x79\x28\x58\x2a\x86\x9d\x23\x6b\xe5\x09\x58\x55\xa0\x74\xe1\x2f\xed\xbf\x67\x11\xf7\xe6\x98\xed\xb1\xae\xa1\x4f\xe6\xad\xb0\x7e\x63\x3f\xc8\x60\x30\xef\x64\x24\x54\x42\xd3\x1e\xac\x3b\xb9\xa7\xac\x85\x1e\xa3\x78\xb5\xc9\xa9\xeb\x89\x04\x10\xf4\xe1\xaa\xac\x79\x17\xa2\x70\xc8\x81\x55\x10\x27\x9a\xd7\xfc\x1d\xc5\x64\xcc\x2f\x3b\x10\x25\x22\xf0\x4d\x78\x07\x1a\x73\x80\xf9\x26\x0a\x65\xd7\x35\xcb\x16\x6a\xcd\xdb\x21\x53\x20\x0f\xee\x40\x65\x91\x9b\x5a\x4d\xaa\x7f\x94\xfd\x1d\x66\x48\x20\x4a\xf3\x2e\xd3\xdd\x77\x95\xf6\xcb\x9a\xde\x68\x8b\xc9\x64\xd3\x5d\x4f\x9e\x67\xe2\x34\xbb\x24\x9a\xdd\xd9\xc9\x72\xe7\xfc\x16\x3b\xad\x61\x20\x99\x09\x19\xf5\x5c\x93\x68\x77\x7b\xbd\xbb\xf3\x0f\x83\x13\x78\xbd\x54\x49\x3b\xa1\x8e\x9b\x87\x70\xe2\x9a\x82\x39\xa7\xc1\x90\x73\xe3\xe4\xca\x94\x1e\x1a\x3e\x58\x6b\x73\xe7\x53\x2b\x47\x5d\xfe\x10\xa6\x41\x43\x55\xc9\x61\xf5\xf2\x4e\x27\x7a\x22\xa2\xa7\x51\x28\x97\x04\xb0\x9b\xbe\x37\x77\xa4\x24\x2c\x36\x6e\xd2\xbf\x1a\xe9\xa0\xec\x85\x2e\xad\x2a\x45\xc1\x50\x16\x31\xad\x91\xda\x60\xe5\x33\x18\x64\x8d\xb2\x7c\xce\xa6\x8b\xe3\xe4\x50\x5c\x36\xf8\xe0\x0e\xe9\xa4\x94\xe6\xc2\x19\xa9\x85\xce\xb5\x4b\xbd\x3f\x9c\x8d\x59\x34\x75\xb0\x54\xb9\x05\x21\x5a\x4e\x02\x9d\xa6\x1c\x00\x06\x4a\x4b\x2f\x9e\xeb\x1f\x3e\x44\xd6\x5f\xe5\x86\x87\x82\xaa\x4b\xdd\x79\x8c\xed\xa7\xf3\xb1\x04\x9b\x7e\xa9\x3d\x99\x66\xa9\xf9\x08\xfa\x5b\xcd\x94\xad\x05\x5f\x8f\xae\x47\xca\x22\x5b\x76\x9f\xb3\xe3\xaa\x94\x29\x6a\xb3\xac\xa4\x47\x80\xb7\x07\x09\x56\xde\x95\xb5\x6c\x71\x05\xa2\x4c\x5a\x53\xad\x0e\xe6\xb2\xa6\x03\x1a\x40\xff\x39\x3b\x2f\x7c\x86\xec\xd3\xe5\x1a\xce\x5f\x38\xeb\x8e\xbc\xb6\xa2\x10\x0c\x0c\x86\x58\xe8\xcc\x25\x38\x72\x98\x1a\xf6\x46\x00\x0d\x1b\x77\x12\x8b\xc3\x59\x76\x3c\x30\x24\xe9\xe9\x1d\x64\x8d\xf2\xcf\x52\x08\x46\x08\xfc\xdd\xc0\xe2\xb8\x00\x4f\x02\x7d\xd3\x6d\x17\x89\x2e\x6f\xba\x68\xbc\x0b\xdc\x6a\xdd\xe7\xfa\xd0\xca\x1f\x4b\x69\x89\xe4\x09\x00\xb2\xc6\x96\xc8\x67\x05\x9f\x0f\xb3\x00\x93\xe3\xbc\xf3\x38\xf2\x54\x36\xf0\xf3\x32\xca\xda\x13\xe2\x78\x7a\xad\x38\x2f\xbf\xd8\x28\x5c\x9d\xee\x25\x8c\xd7\x01\xc8\x2f\x74\x3a\xa0\x58\x96\x4c\x81\xb5\x0a\xfd\x2d\x66\xdc\x92\x0e\xd0\x8d\xe3\xbd\x01\x21\x4e\x44\xc0\x4e\x9a\x00\x29\x70\x12\xcd\x6f\x09\xba\x9f\x5f\x90\xb5\x0c\xa3\x78\x86\xe3\xd7\xdb\x28\xf9\x22\x35\x06\xb0\xfe\x94\xc5\x40\xa1\x34\xaf\xfa\xff\x40\x3a\x61\x28\x03\xee\x48\x8c\xb3\xfd\x95\x9d\x3d\xdf\x3f\x68\x54\xb8\xc9\x52\x50\x02\x7d\xd2\x37\x4c\x8e\x1a\xc9\xd8\x7f\x79\x6f\xfd\xff\x3b\x05\xa6\xff\xa8\x90\xfa\x97\x3e\xcd\x3f\x7b\x03\xa4\x00\x4a\x95\xf8\x2f\x59\xb3\x7d\x39\x60\xec\x08\xfe\x48\x99\x2b\x30\x2d\xe3\x8d\xeb\x9f\x8f\xcd\xf8\x5f\x4d\xf2\x94\xef\xbd\x39\x31\xd0\x3b\xd0\x00\xfb\xf7\xa6\x74\x4e\xb0\x49\x0b\x15\xf4\x40\x7d\x94\xa0\x6c\xf1\x19\xf2\x2c\x94\x64\xbf\x3c\xdf\x4a\x35\x46\x54\x3a\x31\x4c\x30\xf7\xb4\x41\xa0\xe1\xa6\x73\xce\x7d\x84\x4b\x11\xa6\xc4\xfc\xcd\x9a\xef\xf5\xec\x1f\xa9\xf3\xfd\x64\xec\x83\xc0\xa3\x48\x56\x06\xf9\x38\x66\xaa\x4b\xcc\x2d\x7b\x5c\x6e\xae\xc1\xa8\x9e\xeb\x9b\x86\x48\xd6\xb3\xa9\x6b\xf0\xf8\xee\x73\x0a\x13\x25\x6f\x94\xe7\x2a\x57\x5a\xfb\x76\x64\xa4\xc4\x9f\x08\x63\xba\x6e\x43\x84\x49\x9d\x88\x41\x38\x45\x90\xc9\xc8\xa4\x08\x0e\x32\x12\xb5\x1e\x76\xb8\x34\xcf\xf5\x69\x35\x1f\x0f\xf3\xec\xd7\x43\xf2\x59\x9d\x9e\x4b\x77\x55\xea\xc9\x8f\xf3\x9f\x4c\x3a\x67\x18\xf3\xf1\x20\x6e\xa5\xdc\x3d\x94\x20\x4e\x16\x5c\x41\x5e\x61\x59\x83\x85\xb8\x0e\xe4\x05\x0e\x91\x93\x32\xe7\x8f\x47\xd2\xe7\xc8\xe5\x35\x10\x64\xbc\xeb\xf6\xa2\x33\x17\x61\xca\xe9\x6c\x4a\xcc\xc9\x4e\x72\x3b\x52\xa5\x0b\x90\xc4\x57\xf4\x6b\xa1\x7e\x35\xf1\xa8\xd5\x72\x75\x98\x73\x18\x32\x5d\x61\xa4\x67\xb8\xc4\x4a\x1f\x66\xce\x98\x1c\x22\xe7\x70\xdd\x82\xc5\x69\x57\xd8\xfd\x9e\x70\x01\x6d\x09\xa2\xa1\x32\x44\x66\x06\x6f\x66\x7b\x63\x99\x54\x03\xf5\xbc\xf4\xcf\x59\xc2\x63\x65\x4e\x1f\xb6\x54\x06\x94\x1e\x39\xff\x74\x80\x90\xd9\xb3\x26\x3d\x7f\xab\x1d\x74\xab\x12\xd4\xf1\xb4\xad\x8d\x71\xc8\xcf\x6b\x74\xa5\x4a\x3a\x43\x8a\x0e\x0c\xb8\x85\x2c\x31\xdc\x21\x53\x71\x57\x30\x16\x33\x10\xf1\x9b\xd2\xd6\xc8\x1f\xdc\x82\xa9\xb8\xe5\x60\x3b\xba\xcf\x8a\x23\xab\xd6\xc9\x67\x7c\x8a\x0d\xf8\xd4\x26\x0c\x39\x5a\x29\xa3\x29\x0c\xfa\xe2\x72\x13\x63\xda\x10\xf5\xda\xbd\x2c\x2d\x28\x84\x12\xb1\x7e\xde\xcf\x67\xe6\x5c\xa9\x8d\x9f\xa0\x2e\x48\xbb\x25\x60\xab\x81\xab\x30\x7d\xe8\x9f\xf7\xc4\xa8\xc8\xf3\xee\x46\xd0\xcf\x3b\x4c\x8f\xda\x4d\x52\x9f\x63\xf1\xc8\x5a\xe9\xe4\xbd\x2c\xcf\xa7\xcc\x2c\x99\xa7\xe7\xd3\x8a\xb7\xa5\x2f\xe0\xd9\x72\x90\x05\x39\xb2\x71\x6e\xa0\x58\x88\xcd\x95\x46\x88\xc0\x35\xda\x04\x75\x78\xcc\x03\x13\xcc\x41\x21\xec\x8e\x92\xc0\x22\xa8\xc1\xf2\xfb\x43\x5e\xe0\x1d\x22\x06\x18\x57\x60\x0a\x88\x66\x54\xb5\xc5\x5d\x83\xc8\xa5\xc0\xb4\xec\x9a\xe2\x7b\xba\xd4\x33\x57\xc3\x89\x8a\x26\x4a\xee\x9a\x21\xee\x62\x45\xc4\x84\x4c\x42\x6f\x90\x9f\x35\x1e\x08\x48\x84\x97\x1d\x75\x16\x3e\x15\x61\x00\xe6\xe5\xc9\x48\xe3\x59\xe5\x82\x95\x7f\x2e\x56\xbc\xb8\x1c\xd7\x36\x65\xfe\x0a\x6e\x2f\xf1\x8f\xe7\xca\x00\x97\x95\xbf\x1f\xdf\x27\x88\x9f\xab\x7c\xb7\xec\xb9\x4e\x2c\xd5\x87\x78\x16\xdd\xbd\xd2\x2b\xac\x67\x97\x92\x7e\x96\x20\x2c\xe6\xb3\xfb\x3c\x63\xe6\x80\x57\xa2\x7b\x58\x06\x51\x85\x9e\x05\xfa\x8d\x94\x54\x72\x36\x63\xb2\xee\x16\x04\x79\xb9\x4c\xb9\xe2\x67\x37\x06\x06\x4a\x9a\x3a\x7f\x66\xc5\x8e\xec\x84\x90\x49\x22\xf2\x20\x9b\x95\xb2\xcd\x33\x94\x98\x5f\xfd\x8c\x3a\xf4\x89\x29\xc4\xec\x99\xb9\xc8\x03\x4d\x17\x0d\xba\x62\xc2\xe3\x19\x96\xf2\x4f\x70\xad\xbc\x84\x95\x20\x0f\x21\x36\xd3\x13\xb1\xdb\xff\xc8\x69\xdc\x45\x6a\x3c\xc9\x4d\xbc\xde\x9c\xb8\x7f\xa6\xab\x5b\x6d\x49\xb7\x05\xe2\x95\xe2\x34\xb6\x46\x59\xb9\x27\x2c\xd9\x58\x96\xa0\x3d\x2a\xa4\xf5\x84\x6a\x03\x5f\x32\xfb\xb0\x99\x3d\xe5\xc8\x4b\x90\xc9\x49\xd6\x4c\x13\x87\x0e\x06\x2a\xd3\x6a\x1e\xb7\x52\x30\x1e\x91\xc5\x85\x29\x0b\xd6\xd2\x8f\x7b\xb9\x49\x4b\xfc\xb8\x4b\x18\x26\x91\xc3\x02\xcb\xbd\xb9\x4a\x47\x01\xc2\x3f\xaa\x61\x74\x27\x7d\x13\x5b\x90\x25\x16\xd2\xd7\x68\xbb\xd5\x92\xa7\x71\x3f\x7a\x1e\xd8\x83\xef\xee\xa3\x8a\xca\xd8\x94\x54\x0d\xa6\xa3\x7f\x08\x0f\xa7\xae\xd0\x91\xab\xca\x52\xca\xc0\xb3\x93\x1f\x45\xc9\xac\xa1\x7c\xf3\xa8\x24\xae\xf9\xf5\xac\xf2\xfc\x7b\x90\x57\xc2\x53\xda\xe3\x0c\x50\x68\xc8\x75\xf1\x15\x70\x7c\x86\x71\x3f\x2c\xbd\xc4\x72\xdc\x95\xda\xf7\x88\x2c\x4b\xe2\x7e\x4a\x3e\xe0\x87\xdb\x2e\x28\x8b\xc6\xc9\x8c\xe1\xd8\x45\x9f\xa7\x07\xfa\xbb\xe7\xe9\xb7\x3f\xaf\xf2\x2f\x33\x40\xfe\xa2\x8d\x19\x75\x60\xf0\x40\x58\xf2\x51\xe1\x4d\xe0\xed\x4b\x1c\xb9\x3c\x5c\x32\x33\x85\x91\x17\x7f\x61\x8f\x23\x88\xd9\xc8\x5d\x0b\x18\x7d\x8a\x96\x3d\x42\xa2\xde\xc0\x93\x49\x19\x8f\x34\x8a\x06\x23\xd1\x8f\xfc\x1e\x48\x42\xc8\x2f\xb9\x7b\xbd\x34\x9b\x9e\x31\x7d\x2c\x6e\xe4\x3b\x18\x91\xa2\x3a\x52\x91\x2c\xbb\xe0\x6f\x78\x82\xdd\x57\x11\xea\x04\x45\x98\xaf\x2a\x2e\x04\x9f\x8a\xae\x4d\xd9\x7b\xc0\x99\xc9\xac\x3e\xd2\x9e\x83\x21\x39\x50\xa1\x3f\x6b\x06\x3f\xff\xf4\x09\x5c\xf5\x57\xdf\x92\x14\x80\x49\x54\x04\xe1\x57\x9e\x64\xe0\x82\xd2\x2a\xec\xb7\x1b\x26\x5d\x91\x2a\xff\xe5\xc2\x48\xd1\xf1\xa0\xb3\x83\xf6\x26\x60\x7d\x24\x19\x10\xe7\x99\x99\x52\x19\x2f\x97\x7c\xca\x9e\xe1\x2f\x66\xdf\x50\x18\x8e\x85\x20\x6d\x8e\x09\x82\xcc\xe1\x51\xfe\x71\xa3\x9d\x59\x29\xda\xdb\xbb\xc4\x93\x98\xde\x6c\x6e\x27\xd2\xd0\x4e\xc1\x24\xa1\xe9\xe9\xd6\x10\x68\x92\xb1\xca\x74\x33\x3a\x39\x59\x5b\xba\xf0\x67\x4f\xe8\x97\xd2\x72\xcc\x7e\x95\xb8\xe5\xd6\xdf\xa7\x81\x3c\x40\xf4\x16\x0d\x8b\xf4\x67\x2f\xd4\xb3\x92\x45\xf9\x26\x6b\x4f\xce\x4f\x53\xfd\x91\xf3\xea\x3d\x91\x7a\x89\x04\x7c\x17\xc4\x81\x85\x19\x8b\x33\xee\x10\xb8\x9a\xac\xb9\xa7\xda\x19\x97\x7e\xfd\x8e\x10\x4d\x5e\x02\x3d\xbd\x35\x9b\xa2\x67\x3c\xc9\x99\xab\x0e\x54\xbf\x9f\x8a\xc4\x3b\xa6\x88\x7f\x4d\x45\x29\x78\x53\x81\xf2\x27\x57\xc5\xbc\xe1\x64\xf5\x1c\x7f\x77\x59\xc5\xef\x5c\x11\x95\xd0\x6f\x2d\x41\xf5\x5c\x74\xf0\xe7\x33\x40\x06\xd1\x88\xb4\xc6\xd2\x3d\xd5\xf4\xd9\x41\x0f\x8a\x7d\x86\xa9\x88\xf8\xb0\x65\x2e\x26\xb1\xb2\x60\xb6\x46\xea\xa8\x7d\x2d\x22\x51\x5a\x7b\xa3\xa8\x97\xfd\xb6\x3e\x7f\x80\x89\x74\x9f\xc6\x10\x1d\xb2\x91\xa0\x79\x24\x37\xf5\x07\x10\x0b\x14\x2e\xd3\xba\x29\x39\x42\x65\x40\x34\x79\x84\x95\x85\xec\x95\xad\x46\xa5\x0b\xc0\x7f\xe2\x74\x66\x81\xb3\x95\xaa\x0d\xd0\xeb\xe1\x6e\x1e\x28\x12\x52\x18\x6b\xca\x7f\x56\x49\xfa\x1d\xca\x9d\xf9\x9a\x9f\xc5\xcd\x21\x85\x27\x21\x18\x2f\x8a\xd3\xf9\x90\x5b\xdb\x08\x83\x34\xf2\x50\x9d\xab\xa2\x59\x11\x30\x3d\xb3\x12\x04\x27\x5a\xdd\x4e\xe9\xfe\xfa\x84\x86\xf3\x3d\x7f\x43\x16\x79\xab\x4f\x89\x6e\x73\x36\x54\xe6\x74\xc3\x64\x37\xf7\xae\x7c\xec\x21\xcb\x36\xb9\xe7\x34\xef\x06\x3c\x47\x78\xdc\x95\xcf\x83\xb2\x16\x53\x1a\xe5\x99\x46\x97\xba\xf1\x26\xe1\x11\x53\x78\x74\xad\xe2\xcc\x50\xd0\x28\xef\xd1\x19\x0d\xce\x5c\xbb\x07\x9f\xe3\x86\x18\xdc\xc6\x72\x22\x85\xb3\xbe\xbb\x8b\x1a\xb3\xe6\x47\xd7\x02\x26\x71\x10\x73\xb9\x31\x30\x1b\x9b\xe4\xff\x47\x06\x22\x46\xf5\x57\x41\x09\xbd\xc2\xce\x0a\xf7\x45\x4d\xb2\x61\xcd\x08\x8c\xd6\x4c\x66\x71\xef\x5a\xb8\x98\x41\xac\x96\x36\x25\x63\x45\x54\xa2\x33\x3d\xaf\x8b\x9c\x54\xa8\xfa\x91\x15\x2a\xe9\x38\xb8\xb1\x05\x3a\xe4\xe2\x55\x8f\x24\xaa\x27\xdf\x4e\x2b\x27\xd1\x3b\x2f\x8a\x5f\xc1\x91\x4d\xac\xd1\xdf\x4c\x27\x30\x7b\x02\x86\x7a\x5d\x05\x4e\x68\x13\x13\xf4\xd2\x76\xd0\x33\x13\x63\xb2\xae\xa1\x37\x62\xf0\xa1\xab\x05\x67\xa7\xf1\x56\xba\x14\x15\x79\xab\xf1\xc3\xd7\x5f\x87\x19\x73\x16\x27\x4b\x0d\x85\xc7\xb5\x7c\x5d\x61\x0c\xba\x84\xec\xe0\x8f\xab\xeb\x0d\x76\x58\x3b\xbe\xcf\x20\x8d\x26\xf2\xf1\xe0\xeb\x26\x3b\x3d\x28\x4d\x86\x59\x5b\x01\xab\x33\xc6\x19\xf6\xfc\x49\xf3\x1e\x3b\xb5\x65\x2c\x1b\x88\xb4\x7e\x43\x4a\x0a\xa3\x02\x91\x48\x49\x3c\xe2\x42\x30\x5b\x67\x0c\xe9\x48\x34\x2d\x5f\x86\x81\x91\x54\xb6\x97\x91\xdb\x96\x4e\x77\xb2\x9f\xff\x92\xd3\x04\x60\xa7\x99\xca\xfe\x0f\xe3\x57\x92\x50\x23\x3b\x70\x74\xb7\x5d\x82\x8d\xc5\x5a\x9e\xf5\x0f\x30\xaf\x39\xb8\x39\x63\xfa\xc8\x35\x2d\xc8\xa3\xaf\x14\x49\x0d\x23\xbe\x34\xf9\xda\xa5\x6b\x13\x6f\x38\x79\xce\x32\xf7\x95\xea\xe6\x98\xda\xdd\xd9\xa5\x37\x74\x0b\x09\xe1\x34\x21\xf4\x23\x9c\xb6\x7b\x10\x5d\xb5\x31\xad\xc9\x50\xa5\xaf\xcb\xe8\x59\x0d\xfa\x02\x12\x74\xbf\xb5\xe5\x8f\xbb\x3a\x24\xd1\x5e\x8f\x10\x5e\x1a\xa9\x4f\xf2\x9f\x98\xa9\x41\x26\xdd\x82\x54\xed\x39\x6a\x55\x3f\x68\x2b\x3a\xd0\x96\xff\x04\x92\x72\x63\xc6\x54\x4e\xd9\xd2\xd9\x23\x3e\x0e\xfe\x7b\x18\xa0\x59\x66\x9f\xe0\xc2\xc5\xe4\x11\x08\xe7\xad\x92\x1e\x26\x57\x9e\xe1\xfe\x9f\xa2\xca\xc3\x1d\x72\x45\xfe\x02\x04\x0b\x18\x6f\xde\x99\xb5\x7a\xef\x02\x13\xe0\xa3\xfe\xbb\xf0\x24\xcb\xb4\x5c\x8d\x1e\xe0\xc3\x9d\x49\x6d\x83\x28\x48\x27\xa3\x26\x71\x51\x17\xfd\x72\x50\x51\x87\x12\x3c\xcb\x7b\x14\x67\xf4\x3e\x3b\x3b\x75\x3f\xaf\x4e\x46\x2d\x9a\x06\x76\x87\xca\x7a\x93\x3b\x5a\xeb\x26\x16\xa9\x12\xd1\x00\x26\x1e\xa7\x8e\xdd\x48\x2e\xaa\x7a\xa0\xa0\x2d\xe2\xbd\x0c\x9a\x6a\xfe\xb2\x33\x6b\xe8\x0c\xcf\xb8\x1f\x27\xd0\x30\xc5\xe6\x86\x16\x33\xab\x30\x90\xd3\x61\x32\xb7\x8f\x38\x08\x4c\xe4\xee\xe0\xbc\x42\x40\x9e\x04\x72\x60\x5d\x60\x8a\x90\xb3\xc1\x60\x29\x3a\x31\x41\x80\xd3\x14\xe2\xc6\x0e\xe2\x7d\xca\xde\x7e\xa8\xff\x0b\x8a\xeb\x9b\x41\xe1\xa1\x86\x21\x1a\xc8\xdd\x62\x44\xd6\x2e\xf0\x45\xfb\x39\x12\x61\x2f\x49\x27\x0c\xd2\x41\xb6\x92\xd9\x58\x00\xa1\xff\x09\xe9\x17\xde\x2b\xa8\x4f\x88\x6a\x6b\xd5\xd9\x47\x20\xac\xee\xd0\x35\xe1\xf3\xa8\x0a\x75\x0e\x35\xec\xf8\xea\x1a\x6e\x76\x85\x3d\x7f\x03\x6b\x5c\xe5\xbc\xeb\xe4\x73\xf8\xd9\x75\xbe\x72\xb0\xe3\x01\x82\x30\x49\xcf\x98\x61\xfd\x90\x3e\x5c\x5e\x52\x50\x03\xa1\x8e\x25\xc7\xba\x70\x8a\xbe\x44\xcb\x55\x70\x1f\x14\x58\x8d\x46\x86\x22\x1d\x78\x03\xb3\xec\x3d\xc1\x7d\x4d\xc1\xc6\xfd\x35\x52\xe4\xb8\x0a\x90\x9c\xc6\x0b\xce\x8a\x7d\x1b\x08\x2f\x38\x4d\xd0\x83\xd6\x5e\xc9\x7b\x6d\xfb\x15\x5b\x85\x81\x1b\xec\x85\xd4\xa0\x0e\x68\x8a\xdf\x04\x4f\x5a\xbf\x58\x3f\xe2\x23\xbe\xeb\x27\x9c\xed\x38\x4b\x35\x60\x16\x4e\xc7\xda\xe9\xf4\x97\xe5\xd2\x01\xfa\x6b\x8a\x04\x3a\x58\x83\x51\x90\xc2\x4d\xc2\xc8\x1c\xed\xa9\xd1\xc3\xef\x0b\xcc\x4f\x99\xaa\x19\xe2\xa9\x1f\xec\xd1\x0e\xb4\x00\x02\x83\x53\xb7\x60\x9a\xe2\x5a\x7e\x5f\x2b\xcc\x35\x4e\xf1\xbd\x81\x83\x9d\xab\xa1\xff\x90\x3e\x2b\x99\xb3\xb4\x02\x1e\xe4\xb2\x63\x65\x50\xb6\x53\xf4\xe7\x07\x6a\x04\xcb\x84\x0e\xb7\xb9\x3b\xea\x59\xe3\x1d\x37\x2b\xb1\x66\x1b\x10\x38\xd4\x85\x59\x45\x1d\x46\x79\x56\x4d\xaf\xb4\xab\x0b\xa2\x75\x6a\x32\xab\x83\x8e\x15\x59\xb0\xa8\xa3\xf8\x13\x13\x85\x74\x87\xb4\x9e\xac\xb5\x9c\x6c\xab\xb7\x03\x7e\xde\xa2\xf4\xae\x52\x35\xb0\x1a\x54\x84\xac\xc1\xdd\x3e\x89\x46\xd6\x3b\x70\x83\x61\x39\xfa\xc1\x92\x52\x96\x90\x78\x12\xb6\x6f\x9c\x56\x01\xc9\x5b\x8e\x77\x77\x37\xb9\x43\x2e\x84\xd3\x42\xaf\x51\x39\x16\x98\x62\x41\x61\x75\x76\x63\x52\x00\x1e\xe9\xca\xfe\x27\x6c\x7a\x78\x30\x1b\x13\x87\xdf\x80\x4f\x82\x0e\x91\x31\x8f\x9c\x99\x91\xf4\xdb\xb4\x7b\x1b\xe1\x4e\x78\x7a\xa3\xe0\x6b\x02\xa1\x39\xde\xfc\x84\x04\x43\xb2\x5d\x3d\x37\x47\x74\xdb\x5d\x1c\xd6\x9d\xaf\x2d\x14\x49\xe5\x9f\x37\x35\xfd\x67\x6a\x1c\xaa\x00\x65\xa9\x78\x28\x07\x0e\x71\x43\xfd\xcb\xda\xc7\x27\xad\xf4\x3e\x3e\x27\x02\xfa\x6e\x7d\x39\xc8\x2b\x55\x27\x3c\x34\xeb\xbb\x6d\x49\x77\xce\x3a\xf6\x34\xb8\x73\x0d\xc0\xda\x1e\x8e\xed\x3c\x8c\x8f\xdb\x80\xbf\xbc\xb4\x01\xd3\x04\xad\x3c\x3c\x81\x2a\x95\x5f\x7b\x95\x58\x8f\xa7\x42\x6b\xfa\x34\x33\xaa\x0c\xa2\xaf\xf7\x46\xd3\xb3\x69\x4a\x17\x6e\x57\x9a\x09\x48\xd9\x7d\x48\x82\x0b\xac\x18\x27\xba\xf4\x8a\x95\x25\xeb\x66\x7b\xda\x50\x1a\x17\xa6\xf2\xcb\x69\x3f\x0d\x13\xc6\xec\x9b\xeb\x17\xdb\x4b\xe7\x47\xe3\x2c\xd8\xb7\x36\xb5\xea\xdf\x48\x94\xfa\x76\x6d\xaa\x2f\x67\x3a\xbf\xe5\x78\xd0\xb0\x0f\xb3\x3c\xe4\x7c\x7e\x0b\xfd\xfa\x38\x34\xfb\xb2\x8f\x6c\xcf\x8e\x93\x64\xdf\x14\xdc\x5e\xa9\xe4\x7c\xed\x49\x36\xfe\x67\x24\xc1\xe6\x8b\x39\xea\xe8\xfc\xd9\x42\x84\x2d\x3f\xdf\xff\xbb\xad\xcd\xf2\xa7\xe5\x69\x50\x5f\xaa\x49\x7e\xa8\xf0\xf7\x29\x3d\x4c\xf1\x89\x7a\xed\xc3\x59\x00\xe7\x02\x53\x6a\xc6\xe0\x12\x8e\x7f\x5b\x22\x81\xe3\xa3\x58\xfa\x27\xc1\x44\x54\x3c\xe0\x0f\x93\x3f\xde\x6c\xb6\xde\x61\x77\xd7\xbe\xf9\x8c\x0b\x7a\x37\x1f\xbe\xbd\x5b\x67\xe1\xda\x10\xfa\x26\x63\x37\x06\xd3\x4e\x21\xe6\x07\x49\x36\xb1\x03\xe5\x3d\xc1\x1a\xb0\x5b\xe0\xd9\xbd\xf5\xfc\xc7\x67\x5f\xd4\x01\x56\x65\xe8\xbf\xa3\x87\xfe\x56\x8f\xe9\x5d\x82\xab\x5b\x9a\x12\xc2\xdf\x1e\xf4\xda\xb5\x83\x2d\x74\x04\x41\xaf\x22\x18\x5a\xc2\x6f\xa5\x88\xbd\xd1\xde\x64\x91\x8a\x83\x7c\x09\x16\xb2\xbe\x77\x30\x8d\xf5\x25\x02\xe6\xed\x94\x87\xe0\xba\xd4\x93\x3c\x66\xe8\x90\x2c\xdc\x76\x91\x47\x61\x90\xa8\x8b\xc8\x27\x00\x39\xd0\xef\xdd\x7c\x97\xf0\xf8\x7e\x43\xcd\x99\x74\x65\x64\x15\x74\xed\x7f\xb0\x92\x65\xc8\x0f\x56\xf2\x1e\x2b\x25\xaf\xfe\xee\xa4\x7e\x43\x13\x09\x54\x86\x12\x33\xb7\xdf\xca\xc9\x78\x5b\xeb\xd7\x6d\x0a\x7d\x4c\xef\xcf\x29\xff\x04\xf4\xc1\xf4\x6d\x0c\x6c\x3a\xe9\xd7\xcb\x6e\xf1\x98\x8b\xc6\xc7\x20\x29\x2f\x34\x1a\x05\x0d\x39\xa8\xc9\x59\xbe\x88\x9e\xe4\x26\x1a\x17\x2c\x08\xc7\xb0\x20\x9c\x28\x9a\xec\x8c\x63\xf6\xb5\xe1\x3d\x18\xef\xb9\xe1\x91\xd3\x9b\xef\xa4\x2a\xf1\x9d\x94\x65\x61\x40\xc3\xa2\x77\x9a\x74\x57\x5f\xf5\xbd\xca\x73\xb0\x6d\x9a\x6d\x79\x61\xac\x47\xa2\x70\x9d\xc9\x1d\xf6\xbd\x5e\x48\xc3\x71\xca\xaf\x98\xd8\x2f\x99\x05\xb9\x00\x85\xd7\x37\x1e\x94\xd8\xf3\xfd\xea\x0b\xae\xb5\xfc\x5b\x62\x75\x04\xb1\x36\xff\x8c\x5e\xc5\x46\xae\xce\xb9\x2d\x49\x07\x90\xe9\x60\x0b\xf5\xaa\x97\x8c\x80\x5e\x56\x73\xfb\x3d\xc0\x54\xb3\xc0\x2a\xca\x32\x59\x81\xaf\xac\xe4\x9a\x57\xd2\x06\x68\x3b\x76\xb1\x7b\xe1\x7d\x2f\xc6\x6f\x1b\x82\x69\xfc\x66\xa2\x10\xc2\x6c\xe1\x57\x68\xbb\xd4\xe0\x30\xef\x08\xbd\x68\xd3\x2d\xa5\x3d\x78\xc5\x73\x37\x30\xb4\xe7\xa4\x83\xee\xa4\xc8\xbf\xd8\x3a\x04\xed\xb8\xb6\x43\x28\x87\x2e\x0e\x59\xca\xaf\xac\x6c\xb0\x4e\x5a\x5e\xaf\xbe\x34\x57\x17\xa4\xe4\xc2\xd0\x1d\x14\x07\xa4\x5b\xe8\x10\x78\xfc\x25\x08\xd0\x49\xba\x8c\x70\x4e\x64\x1c\xd6\x17\x8a\x38\xcf\x9a\x9b\x73\x25\x75\xf5\x8b\x40\x53\xf0\xde\xf0\x2d\x61\xee\x1b\x59\x45\x2c\x33\xf3\xa8\x7c\x52\x9c\x79\x82\x12\xe7\xbf\xc3\x4c\xf7\x92\x1a\x0a\x5c\x43\xfc\x82\x2e\x7b\xe7\xb8\x06\x13\xe5\xce\xf0\xbd\xd3\x97\x6b\xc0\x66\x16\x63\xd9\x0d\x6f\x2e\x62\xf2\x8c\xbd\xb9\xd6\xaa\x3e\xe9\x7a\x49\x0e\xf3\x6a\x91\x66\x77\xd5\xaf\xca\xff\x05\x13\x19\xe4\xd1\x51\x5c\x64\x0e\xa3\xaf\x7a\x54\xf9\x29\x1b\x2c\xe4\x19\x33\x55\xdf\x4a\x38\xa9\xf8\xf5\x54\xba\x8e\x21\x07\x97\x26\x87\x55\x2c\xe7\xcc\xc4\x2e\x6b\xfe\x55\x75\x5d\x4e\xa3\xcf\xb4\x66\x74\x9a\x71\x95\x9e\xb9\x2d\x6d\x4a\xd3\xbb\x66\x48\xbe\xf9\x8f\x99\xb3\x4c\x39\xf0\xed\x16\x19\x33\x26\x89\x12\x80\x8c\xcc\x2a\x1a\xce\x8c\x02\xed\x4b\x22\xf2\x0e\xef\x19\xd2\x94\x6d\xe4\xcb\x86\xf9\xca\x59\xee\x8c\xc9\xe7\x14\xae\xae\x58\x72\x61\x2e\xa9\x90\x6c\x1c\xf7\x3d\x29\xb3\xe7\xf2\x14\x45\xef\x0f\x5f\x49\x29\xaa\x20\x2c\xeb\x61\xa4\xee\x33\x74\x61\xe0\xfd\x21\x90\xa8\xce\x15\x19\x62\x34\x67\xe4\x56\x83\x68\xa8\x5f\xfb\x66\x9f\x1f\x27\x7d\x7d\x90\x07\x4b\x6e\x33\xe2\x5b\x0b\x11\x7c\x1e\xc2\x92\x0f\x72\x0b\xe1\xb1\x98\x3e\x7c\x76\x86\x68\xf6\xf7\xb2\xd6\x94\xac\xe7\x4b\x8e\x9f\x27\x0c\xd9\xbd\xa4\x61\xe0\x4d\x53\x51\x2b\xc9\x22\x75\xd1\xf2\x08\x01\xfa\x92\x76\x23\x3d\xe2\x44\xa0\xc3\x83\x39\x27\x0c\x08\x50\x5e\x37\xa7\xcd\x0c\x1c\xf2\x3c\x14\xe9\xb7\x1b\x13\xa0\xfa\x14\x9b\xb8\xd5\xb9\xaf\x63\xa6\x23\x4d\x19\x83\xe9\x8c\xfb\xcd\x73\x5f\x6e\x8d\xce\x53\x1c\xe9\x16\x55\x99\x31\x47\x67\x36\xb3\xdc\x36\x59\x40\x6e\x72\x56\xbb\xfe\x6e\x65\x30\xda\x67\x4b\xfe\xdf\x85\x50\x34\x6f\xe3\xd5\x2d\x18\x73\x30\x6c\xfb\xfc\xaf\xa1\x43\x53\x60\x06\xb7\xa0\x49\xc7\x44\x14\x51\xec\x83\x26\x85\x9c\x53\x77\x7e\x94\xd9\xdd\x35\xda\x37\xf8\x3f\xa2\x19\xe4\x10\x51\x99\xef\x6e\x31\xee\x8d\xbd\xa8\xd0\xd6\xa2\x75\x63\x3d\x2c\x91\xd6\xa7\x86\xf3\x3c\x10\xda\xe4\x3e\x07\x19\x53\x7e\x15\x56\xe7\xdc\xec\x07\x1b\x0c\xab\xcc\x23\x7f\x44\x11\x3d\x7a\x35\x66\xd0\x86\xfd\x8c\x15\x1a\xee\x0f\x03\x9e\x47\x37\xb7\xf5\xb7\x30\x68\x96\xd6\xb5\x25\xcb\xf9\xcd\x67\x55\x6f\x25\xb8\x9d\xd5\xd5\x88\xe8\x39\x07\x57\x7c\xfe\xbb\x89\xe6\xbc\xc7\x56\x5b\xd5\x5b\x0b\x5f\x4a\xf2\xa7\x29\x2a\x74\x56\x76\x1e\xfc\xb5\xd8\xad\xd2\x3f\x05\x16\x01\x52\x5d\xf7\xda\x0d\xa9\x4f\xba\x7c\xf8\xc8\x43\xa3\x9b\x13\x69\xb2\xe4\xd8\x6f\xf4\x2a\xdc\x52\x74\x6e\xad\x9f\xf0\xa3\x78\xae\x9a\xdd\x32\x40\x93\xc4\xe8\xa1\x9d\x4b\x15\x77\x7d\xf1\x04\x90\x13\x44\xf1\x44\x00\x91\x56\x32\xa3\xdf\x7c\x01\xca\x6f\xb8\x78\x22\x2a\xc9\x52\x2f\xa4\x55\xfb\x07\x47\x6a\x67\xb1\xcb\x0a\xd2\xf4\x46\x65\xd4\x13\x49\x5f\xb1\xab\x3b\x58\x2a\x73\xc0\x96\xc8\x6d\xef\xb3\x51\x27\xdc\xe8\xfd\xda\xca\x40\x8b\x8a\xb3\x68\xd8\x08\x2a\x75\xb8\x44\xde\x9c\x7f\x30\x90\xc7\x96\x1e\xa4\x3c\xb7\x90\xc8\x3b\x95\xa2\xd4\x9d\x0f\xe7\x2a\xff\x49\x90\x57\xf8\x04\xe0\x70\x79\x0a\x68\x27\xeb\x52\xc8\x79\x32\xb7\x6e\xa1\x38\x33\xd1\xc0\xfd\x2a\xd9\x80\x38\xfc\x51\xae\xe3\x2d\xb2\xe6\x8a\x9f\xb9\x35\xb0\xe2\x1a\x7b\x53\xbb\x92\x44\xdd\xe8\xf2\x71\x4a\x75\xfc\xec\x9f\x13\x72\x25\x65\x59\x29\xc3\xb2\x33\x26\x8c\x4f\xf5\x32\x40\xb2\x16\xb3\x58\xc2\x07\x79\x7e\x26\xbf\xd4\x9c\x43\xb5\xff\xcc\x53\x79\x71\xeb\x41\x1e\x88\xd6\x2b\xf5\x22\x6e\x60\x4e\x1e\x2a\x3f\x03\x6b\xab\x34\x30\x54\x4b\xc2\xf5\xd5\x39\xcc\x6f\x51\xa3\x9c\x72\xdd\xbe\xb1\xba\xdd\xbb\x08\xcd\x30\xf0\xec\x6b\x7f\xce\x92\x52\x93\x03\x21\x9a\xb5\x2e\x6c\x28\x1f\x3f\x4b\xca\x6c\x7d\x9f\xeb\x8a\xad\xe3\xa6\x03\xfd\x93\x89\xab\x65\xa2\xed\xee\x0e\x9e\x20\x54\xff\xd8\xdf\x36\xea\x7b\xf6\xfd\xd7\x5b\x67\x5b\x23\x75\x97\xde\x96\xc1\xa6\xee\xe2\x14\xc0\x0f\xb1\xb9\x73\xbc\x29\x5c\x4c\xc1\x37\x4f\x79\xea\x67\x94\xa9\xa3\xb5\xc8\x0a\x8e\x9d\xc9\x87\x4d\x67\xba\x29\x7d\x75\xba\xcc\xe0\x4e\xb4\xeb\x35\x01\xbf\x99\xa5\xdc\x24\xe5\x92\x01\x7f\xcb\xfa\x11\x80\xf5\xbf\x38\xd3\x56\xbf\x8c\x5a\x3d\x05\x8d\x5a\xf5\x25\x44\x64\x5c\x82\x43\x09\x56\x60\x4c\x8b\x88\xbd\x96\x6e\x62\xe9\x61\x10\xe4\x1d\x4a\x50\xc1\x9a\x7f\x35\x1d\x29\x5f\x59\x46\x95\xd3\x2d\x27\xd8\xd4\xeb\x3f\xc4\xa6\xb5\x1d\xfd\x22\xef\x6b\xa6\x8e\x79\xbb\xcf\x1f\x5b\xa6\x81\xbb\x9b\xff\x23\x53\xda\x49\xb6\xf7\xcc\xfd\x0c\xe4\xa8\xfd\xdb\xfd\x70\x8e\xeb\x2d\x42\xf4\x3d\x71\xc4\xd8\x50\x8b\x0a\x30\xc8\xdd\x7e\xb3\x30\x4e\x8d\xf6\x40\x45\x83\x71\xd1\x26\x1f\xca\x8b\x24\xda\x2a\x13\x20\x04\x9d\x83\x22\x5d\xa5\x69\x61\x68\xe2\x51\xf7\xa7\x72\x25\xc0\xef\x2f\x5c\x27\x8b\xd3\x56\x99\x42\xd8\xaa\x3d\x1a\x91\x89\xab\x06\x6a\x08\x51\x8b\x46\x6d\x0f\xda\x2f\xa1\xbc\x38\x09\x0c\x8f\x61\x44\x58\xe5\xc5\x19\x43\x64\x88\x30\x92\x1c\x8d\xae\x41\xe7\xeb\xb7\x42\xea\xaf\xdb\x5d\xca\x10\x33\xcb\xf9\xb3\x64\x0e\xcf\x91\xb1\x42\x3a\xb5\xab\x1e\x64\xc1\x4d\xc7\xb5\xb7\x8b\x36\x8a\x80\xea\x2d\x23\xd1\x36\xb4\x94\xdb\xec\x6e\x3d\x2d\xbf\x82\xec\xbc\x9d\x61\x0e\x9a\xb7\x7f\xfc\x2f\x6c\x49\x03\xd2\x98\x05\x02\x79\x9a\x89\x2f\x86\x34\xcb\xd0\x60\x55\x4f\x1a\xb5\xcf\x3e\xfb\xaf\xc8\xb3\x0c\x36\x95\xb9\x63\x60\xa7\xea\x94\xa1\x22\x37\xcc\x3c\x49\x4e\x88\xfa\x50\x9a\x57\xb5\x05\xcd\x92\x59\xbf\x7e\x92\xad\xe6\x67\xb8\xc5\x7f\xbe\x67\x26\x9f\x36\x31\x49\x9b\x44\x00\xc1\xf4\xfc\x23\x38\xa4\x8a\x82\xf8\x3c\x77\xdf\x42\xab\xc2\xe1\x1d\x68\x4a\x22\x50\x6f\x24\x54\xc3\x68\x8b\x5c\xec\x22\x5b\xce\xe0\xb2\xc3\xb1\x50\x1c\xeb\x99\x7b\xdb\x57\xc1\xd3\x3f\x92\xba\xec\xcd\xae\x76\xa7\x41\x67\x16\x1b\xcb\xd0\x5f\x62\x99\x45\xaf\xfe\xf8\x17\x74\x58\x55\x24\xd6\x33\xdc\x12\xc8\xa8\xfe\x67\xb6\xe6\xa0\xb4\xf7\x71\x93\x3e\x7c\x6b\xa6\xfc\x68\x9c\xfd\x3d\x14\x08\x86\x9d\x27\x23\xd8\xb0\xf1\xd4\x44\x81\xc1\x3b\x87\xa3\x27\xa4\x75\x7d\x25\x8c\xa9\xc8\x3f\x36\x94\x84\xae\x4b\xe9\x3e\x07\x3e\x18\x99\x76\x92\x31\xab\x21\xe4\x61\x9f\xcd\x4c\x5f\xf4\x43\x93\x0d\x47\x6d\x32\x6d\x3d\xea\xc1\x77\xfc\xa8\x55\x12\x81\x68\xbf\x27\xd2\x59\x0d\x8e\x1f\xae\x5b\x18\xd9\x3a\x2a\x8f\xb9\xde\xaf\x42\x8d\x9e\x43\x21\x21\x7b\x62\x3e\xe2\x3e\x56\xe5\x1a\x1e\x45\xcc\xdf\xf2\x9b\xc2\x3d\x90\xc8\x2b\x11\x06\x78\x7b\x86\x4f\x26\x08\xd5\x62\x62\xff\xd3\x85\x77\x57\x70\x92\x8e\xe7\x42\xf1\xbe\x63\x4e\x5c\x56\xa0\xfb\x78\x50\xcd\xe8\xd0\xdb\x71\x78\x83\xa2\x5f\x19\x8d\x8b\xd3\xb0\xc7\x1f\x0b\xbb\x31\x79\xef\xd4\x52\x12\xf0\xee\xe9\x11\x71\x68\xa7\x58\xb7\x30\xdd\x0c\xa3\x20\x43\x0c\xd7\x3a\xdf\x9a\xa5\x4c\x3d\xa5\x1a\x62\xfd\xc9\x59\xdc\xee\xe4\x8f\x28\x7d\xb7\x30\xcb\x04\x31\xc1\xff\x95\xac\x7b\xd3\x86\xff\x48\x9e\xe6\x29\x52\x84\x28\xa1\xe2\x42\xa2\x75\x1b\x15\xda\x39\x92\xbf\xad\x42\x93\x88\xd5\x87\x8e\xc5\xf9\x08\x74\x59\x6d\x88\x55\x02\x23\xdf\x56\x47\xde\x27\x71\xb9\xf7\x51\xc1\xf3\x43\x73\x8f\xe0\x5d\x6b\x56\x06\x6a\x3f\x62\x7b\x62\x9c\xba\x2f\xb1\x81\xd8\xdf\x3e\x6e\xe7\xc1\xc7\x85\x93\x8d\x70\xff\xe4\x03\xac\xfa\x14\x20\x23\x11\xb5\x80\x55\x16\x41\xbc\xbe\xcb\xf6\x33\xfe\xd4\xcc\xb5\xf5\x75\x6f\xd2\xb1\x35\xc7\x5b\x4f\x37\x9f\x24\x6e\xf5\xeb\xc5\x93\x83\x12\xce\x70\x51\xa8\xb4\x36\xf2\x1f\xac\x4f\xe1\xc4\xed\x43\xea\x79\xd5\x86\x90\xce\xdb\x5e\x41\xd9\xf2\x4e\x64\x0d\x45\x3c\xeb\xa5\x3f\x74\x64\x58\xe7\xeb\x62\xd7\xfc\x67\x8f\x55\x2e\xa5\x4b\x30\xb9\x6f\x0f\x02\xd5\xd9\xab\xc1\x3a\xab\xd5\xae\x70\x0f\x21\xc3\x5c\xe9\xa1\x61\x0a\xea\x47\x0d\x62\x6f\xb5\xa7\x7f\xd2\xc3\x74\xaa\xa1\x29\x6d\xbd\x77\xbf\x49\x48\xcb\x11\x39\x1d\x81\xa5\x0a\xeb\x11\x6f\x41\xea\xd0\x3e\x22\x84\xa3\x2a\x27\x77\xfa\x23\x01\xb5\xfd\x23\xc5\x2e\x03\x5a\xa1\x11\xc3\x7e\x93\x9b\x7d\x4b\x00\x6c\xc7\x67\xed\xaf\x29\xbc\xdf\xb5\x46\x03\x21\x43\xd2\x33\xdb\x91\x8b\xd1\x1c\x88\xbd\xbe\x73\x0c\xba\x87\x40\xda\x6e\x37\x2b\x46\x65\x7b\x1d\xa9\x1f\x05\x13\x53\x68\xa0\x12\xa2\xb5\x91\x01\x6a\xf1\x2c\x0c\xbf\xe4\x2c\x41\xec\x3d\xdf\xc3\xad\x3e\x37\x9c\x4a\xad\xdd\x65\x67\x03\x0b\xcc\x46\x07\x67\x5b\x61\x0d\x7b\x15\xaf\x56\x04\xbc\x78\x56\x45\x75\x61\x56\x8a\x02\x22\x0a\xe4\x5d\x5f\x67\x50\xb7\x90\xe4\x29\x60\x1d\xee\x4c\xeb\x46\x78\x50\x25\x5a\x2b\xde\x68\x14\x48\x94\x36\x38\xa9\xa4\x37\xe3\xed\xaf\x87\x15\xe4\x36\xde\xfb\x88\x2e\xac\x43\xfb\x88\xc8\x35\x0e\x67\xc1\x4d\x71\x9f\xad\x7e\x44\x7d\x56\xb8\xd2\x3d\x4e\x49\x44\xad\x9a\x55\x33\x30\x52\xed\x7a\x83\xae\x18\x77\x67\xe2\xd3\x06\x4b\x0a\x57\x9b\x02\x22\x3f\x7b\xd7\x71\xf6\x91\xb4\x52\xe7\x5b\x3b\xdf\xb5\xae\x5f\x0a\xcb\xda\xd0\x91\xe9\x20\xe0\x4f\xf3\xe2\x99\x42\x63\x45\x09\xe2\x69\xb9\x54\x3d\x61\x54\x28\x5d\xaa\xad\x78\x6d\xc3\x4b\xb7\x2e\x0b\xe9\xc1\x88\x9a\xca\x05\x60\xb3\xee\xcc\x50\xc4\x9d\xde\x5d\xe5\x5d\x98\x94\xe9\xbd\x33\xad\xf7\xae\x40\x01\x0c\x72\x95\xd8\xe0\x3d\xc0\xbe\x21\x0a\xcb\xd8\x16\x46\x7d\x59\x3b\xae\xeb\x9b\xf4\x62\xb7\x71\xfa\xf9\xa7\x32\x0a\xb1\x95\xa5\xdd\xbc\xfe\x39\xad\xbc\xbc\x18\xfe\xb9\x81\xaa\x77\xec\xb6\xec\xf1\x29\xab\x40\x82\x24\x9e\x4f\xd0\xa1\xfd\x27\x20\xc5\xd5\xc6\x10\x3f\x2e\x36\x0b\x8d\x31\x36\x88\x67\x68\x95\x9b\x51\xd2\x92\x16\x86\x85\x2c\x27\xeb\x33\x53\x32\x7c\x0b\x69\x4c\x37\x63\x25\x79\x39\xaf\x61\xcd\xee\xba\x2e\x64\xcb\x6b\x54\x8a\x72\x67\xbe\xf5\x96\x17\xca\x57\x6f\xb9\xd0\x05\x6a\xcb\xfe\x33\xc4\x17\x17\xf9\x19\xa1\x7d\xf1\x75\xc7\xb7\xb2\xac\xb6\x11\x31\x07\xd1\x79\x47\x06\x41\xb7\x71\xa7\x74\x0d\x40\x12\x5d\x7a\xf3\x9e\x85\xc3\x25\x27\x72\xaf\x67\xe4\xb2\xf9\xe9\xc6\xe7\x5d\xa4\xbb\x61\x38\x46\xdd\xb0\x6a\x6d\x99\xea\x19\xc0\xb3\x08\xc1\x80\x59\x71\x37\xb7\x73\x0d\xc3\x4b\x10\xbb\xdb\x95\xc2\xab\xf5\xe6\xa7\x47\x62\x77\x13\x6c\x41\xf6\x6e\x9b\xfb\x77\x92\xe1\xad\x0d\x57\xe9\x31\xb8\x7b\x2b\x72\x3b\xb4\x71\x6a\xfd\x04\xe0\x8d\x38\x4a\x61\xef\x9b\xbe\x5f\x59\xb2\x7e\x45\xb2\xfe\xca\xc6\x6c\xb3\xc1\x95\x5c\x84\x35\x7d\xbd\x91\x9e\x0a\xe6\x36\x3d\x74\x9d\x90\xdd\xb9\xd9\x20\x66\x10\xbb\xe9\x92\x60\xf0\xb0\x8b\x76\xc1\x5c\x6e\x15\x0a\xbb\x5e\x83\xe9\x19\x3c\xed\x2f\xe7\xb2\x0d\xc9\x06\x0b\xdc\x6d\xdd\x96\xd4\xce\xaf\x9a\x44\xe4\x04\xc5\x86\x9b\x8e\xdd\x38\xb7\x00\xef\x57\x65\x05\xbb\xf3\xab\x14\x10\x92\xd2\xaf\x00\xc2\x23\x76\xac\x9b\x40\x89\xf7\x13\x82\xcc\xc1\x2d\x6f\xb2\x0d\xda\x90\xb7\xa4\x7d\xf6\x6f\xa7\x76\x5f\x62\xbb\x63\xe6\x47\xfc\x70\x7c\x36\x64\x67\xef\xa9\xca\xe2\x76\xdd\x9e\xc1\x19\x77\x49\xbf\x2c\x58\x62\x9d\xc4\x03\xd2\xda\x6f\xf8\xd2\x5f\xe0\x30\xb2\x74\x76\xf8\x8f\x90\x5f\xc0\x44\x0f\x8a\x7d\x61\x52\x2e\x18\xe1\xbc\xda\x67\xbd\x3f\xfc\x1a\x23\x0d\x6e\x4b\x39\x18\xee\xd3\x47\x8f\x71\xba\xb3\x2e\x3b\x58\xe9\x93\x06\x59\x08\x27\xc6\x69\xc5\xcf\x73\xd3\x59\xd5\x98\x49\x26\xce\x69\x7c\x62\x14\xf9\x1f\x28\xe5\xcc\x6e\x01\x29\x6c\x25\x48\xec\x3c\xad\xb7\xba\x81\xeb\xad\xb7\x7e\xbd\x17\xef\xf9\xaf\xf7\x94\xbb\x41\x6c\xf1\x36\x7a\xd5\x34\xc3\x5a\xdf\x93\xdc\x5a\xd5\x5b\x70\x0a\x7a\xf7\x60\xad\x67\x10\xd0\x79\x97\xc8\x44\x17\xa1\xbb\xb6\xd8\x57\x23\xfd\xb5\x1e\x1a\xc5\x81\xa7\x1e\xc7\xab\x9b\x80\x8d\x58\x35\xc9\x0e\x8c\x6c\x3b\x8f\x48\xd9\xc2\x48\x5e\x77\x0d\x16\xfb\x53\x6f\xd5\x5a\x21\x39\xb9\xca\x9e\x08\x3d\xf0\x1f\x55\xbe\xbc\x2a\x19\xe6\x65\xd7\x04\x1b\xbe\xd0\x5f\x10\x0c\x29\x93\x2b\xc7\x0c\x74\x83\x55\xd6\x19\xc8\x1a\x4f\xf9\xc5\x8a\xf1\x8d\xd9\x3b\x85\x85\x1d\x77\xd5\x0a\xab\xc1\x4f\x11\xcd\xc9\xa1\xcf\x3e\xd1\x24\x12\x7c\xe6\x48\x6f\xcd\x07\xd3\xf3\x60\x15\xab\x61\xe5\x2a\xaa\x14\xfc\x9e\xb8\xa3\xc2\x5f\x2b\xd3\xe3\x89\x30\x52\xe3\x56\x33\x26\x98\x04\xf9\xa4\x72\xbe\xe4\x3f\x1b\x64\xba\xd5\xc6\xd2\xe1\x40\x3b\xbd\x99\x91\xb1\xe6\x7f\x1c\x67\xf3\xb8\xc6\x85\xe8\xc2\x82\x9c\x9f\x93\x52\x4a\xd7\xe4\x32\x4d\x8e\x3e\x24\xad\x7b\x64\x67\x4d\xff\x13\x5f\x3d\x74\x45\x41\x38\x6a\xca\xf6\x59\xd3\xab\x72\x6f\xc4\x32\xef\x40\x13\xff\x77\xd5\x9b\x71\x12\x83\xe1\x64\x7b\xcd\x3a\x9c\xf2\xcb\x41\xaa\x8f\x0e\x33\x32\x87\xd8\xc1\x72\xcf\x5a\xa6\x86\xae\x29\xdc\x84\xad\xe7\x5f\xf8\x4f\x1b\x7d\x6d\xfc\xdf\xfe\x2d\x6b\x0d\xae\xbc\x75\x66\x68\xb0\x8b\xd9\xbf\xa7\xfc\x72\xf7\x89\x8a\x3e\xce\x28\xf5\x26\x62\x4d\x5b\xb7\xa6\x5d\x75\xba\x95\x67\x58\xe2\x73\xb0\x4f\xfd\xaa\xdc\xc4\xe3\x8c\x6b\x9a\xc5\xfc\x77\xfa\x1a\x51\x6e\xd1\x3e\x82\xa7\xcf\x7f\x3f\xec\x16\xeb\x37\x87\xc8\xc0\xd0\xc4\x29\x86\xd8\x66\xa7\x1f\xdf\xba\x25\x60\xe7\x2b\xf8\xb3\xdc\xeb\x3f\xbe\xb3\xf7\x9f\xf7\xcb\x97\x3b\xcf\x3b\xb9\xe0\xf7\x60\xaf\x08\x57\xb6\xef\x4f\xed\x18\x14\x7e\xa7\xaa\x37\x56\x77\x8b\x0d\x6d\xcb\x52\x05\x69\xde\x8a\x99\x30\x9e\xa3\x85\x27\xe4\x02\xf7\x3e\xa7\x86\xb4\x58\x62\x79\x86\x51\x6e\xb0\xb6\x1b\x19\x1a\xc2\x22\xa2\x37\x66\x0d\x59\x19\xdc\xe9\x96\x90\x5a\x4e\xab\xc1\xa5\xb2\x87\xb9\x54\x65\xa0\x2d\x55\x8a\x83\x4b\x3d\x10\x4e\x72\xb4\x33\xbd\x60\x89\xdc\x17\x03\x64\xe3\xcb\x60\x70\xa9\x73\x90\xff\x31\x18\xe5\x71\xf2\x5e\x9e\x3c\xb4\xa8\xfb\x48\xd3\x0d\x96\xff\x40\x92\x38\xc4\xa0\x74\x55\xbb\x98\xbe\x06\xb2\x42\xb7\xe4\xf4\x93\xc8\x5f\x69\xfb\xe0\x3f\x7d\x75\x5d\x3d\xd1\xf5\xd5\x42\xb9\xcf\x2e\x5b\xd5\xa5\x9c\x29\x88\xf1\x45\xd4\xfb\xc6\x7e\xdb\xa2\x18\x7a\x6f\x34\xe0\xa7\x9b\xc3\x73\x37\x22\x22\x0b\x3b\x0a\x20\xf3\x6b\x76\x7a\x91\x2c\xc4\x52\x86\x3a\x69\x78\x87\xb1\xe5\x0b\x55\xa2\xdf\xa3\xfc\x61\x26\xf9\x12\x4e\xc0\xe2\x5e\x2e\xb2\x27\x5f\x5c\xb6\xff\x95\xfc\x68\x48\x7a\xf0\x41\x3c\x10\x0f\x9c\xb7\xe3\x52\xa9\x15\x99\x44\x74\xeb\x46\x49\xa1\x6e\xc1\x00\x3d\xb7\xa0\xc5\x7f\x45\x80\xff\xfe\x98\xf4\xef\x04\x43\x61\xae\x0e\xef\xe5\x74\xde\xfc\xe7\xa9\x24\x0e\xa0\x1c\x2c\xfc\xdf\xe1\xfa\x40\xca\xa0\x6c\xb1\x16\x37\xe8\x74\xb0\x6b\xe2\x77\x61\xe6\x01\xf8\xf7\xdc\x6d\x8d\xb0\xce\xa2\x6f\x14\x4c\xfc\x9d\xff\x9b\x29\xc7\x90\x66\x4d\xc9\x2d\x31\xa9\x0b\x07\x5e\x8a\xf3\xfd\xdd\x08\x00\x9c\x8e\x48\x3a\xf9\xbb\x33\xd5\x24\xff\x6e\xf9\x8c\xff\x31\xfa\xf6\x57\x31\x77\xe3\x51\x9e\xbf\xba\x2b\xad\xd2\x10\x69\xf2\x55\x9c\xfa\x3a\x04\x33\xff\x49\xd3\x42\xf8\xf3\xfe\xa5\xd1\x2a\x29\xff\x7f\x7a\xff\xf2\x9c\xfe\x78\x03\x1c\xed\x32\x3d\xff\x4b\x92\x45\xfa\x43\xb8\xa2\x93\xf0\x77\x15\xb1\x3c\x2e\xbf\x83\xc4\xbc\xde\x5f\x1a\x06\x06\x1e\x0b\x63\x3c\xe5\xa5\x10\x42\xe4\xcf\xd8\xa0\x44\x12\x98\x05\xd6\xdd\x6a\x92\x0d\xcb\xc6\xd7\xde\xb7\xfa\xa4\xd5\x2f\xdf\xb7\xb2\x64\x99\xa3\xfc\x63\x4d\x39\x7f\x82\x5c\xff\x3f\xb5\x9b\x90\xb1\xa5\x35\xeb\x2d\x42\x74\x58\x17\xfa\x0c\x14\xd7\x74\xb2\xd4\x7c\x6f\xdd\x4b\x61\x16\x3b\x19\x2a\x6e\x85\xa4\x38\xef\xae\x8b\xf4\xff\x64\x2b\x30\xdf\x53\xc8\x04\x0c\xbc\x03\x30\xd0\xf3\x68\xce\x8c\x48\x8a\xc2\xdd\x33\xc6\x99\x24\xcf\x9f\x1c\xdb\x22\x6b\x56\xde\xbf\x9d\x99\x6d\x97\x4c\xf2\x7a\xdd\xd5\x92\xfd\x04\x6a\xc1\xe6\xd7\xa1\xd6\xa0\xf7\x5b\x9f\x44\xde\x35\xa4\xf4\xf7\x09\x57\x5f\xfc\xb1\xfa\x3b\x39\xbd\xce\xfd\x54\xf6\x52\x28\xf1\x63\xae\x53\x9c\x6c\x92\xaf\xaf\x0e\x5a\x1a\x7f\x48\xd9\xbf\xb1\x5f\xd9\x51\xab\xf0\x85\x98\x7f\x16\xbf\xd2\x75\xb0\x8e\xc6\x97\x85\x94\x3d\x66\xeb\x72\x84\xe5\xef\x33\x51\x2b\xcc\x9a\x0a\x72\x52\xe9\x02\x0c\x90\x43\xbb\x79\xce\xdd\xda\x57\x16\x97\x48\x11\x98\x97\x70\xc2\x06\xc3\x3f\x33\xda\xa7\x39\x20\xc1\x27\xf9\xe8\xd9\x2e\xef\x79\x8b\xe1\x2f\xc6\xc7\x1c\x9a\x3b\x60\xec\x77\xd1\x63\x2c\x14\xf1\xf8\xa7\x90\x1c\x90\x69\x37\x0c\x82\xe3\x7c\xe5\x11\x3a\x02\x88\xa8\x72\xb3\xa7\x78\xf0\xd6\x81\xd3\xc3\xcf\x43\x6c\xd5\xd9\xb8\x06\xcf\xb5\x90\x4a\xff\x0d\xf0\xe1\x84\xbe\x01\x0e\x0b\xe7\xf4\x66\xa5\x38\xa3\xd3\xb1\x25\x91\xe8\x5f\xfc\x85\x9e\xe2\xea\xe0\xa4\xfb\x38\x38\xff\x7b\x18\x3d\x83\xe1\xb9\x12\x5c\x7b\x37\x13\x8e\x55\xf4\xf7\x33\x70\x94\x10\x00\x58\x9a\xe6\x50\xe6\xf0\x8d\x81\x16\x80\x56\xa0\x7f\xc5\xe9\x17\xab\x93\xbe\x59\x9e\xc1\x3b\x75\x2f\x52\x37\x66\x9c\x9d\x52\x41\xb0\xb9\x11\xf3\x56\xa8\xd3\x90\xd8\x0a\x23\x0b\x9d\x49\x87\x73\x8c\x4e\x30\x11\xb7\xc6\x55\x14\x2a\x0e\x3c\x9f\xec\x4c\xc2\x47\x98\xdb\xe8\x42\xa6\x22\x86\xb2\xc1\xc4\x6d\xc7\x25\x3e\xe6\x34\xe4\xec\xd6\xb4\xf7\x87\x81\xee\xa7\x0f\x0c\x9c\x95\x7c\xef\x9a\xac\x7b\x92\xda\x10\x56\xc2\x61\x11\x0e\x38\xa8\x81\x32\x2c\xdf\xd9\x1b\xf6\x84\x8d\xda\x03\x4a\x2f\x7c\xde\xb4\x74\xbd\x47\xd1\xaa\x6f\x5c\x94\x23\xeb\xb3\x0c\x3f\xf6\x3e\xb2\x48\x9d\xed\xee\x12\xc4\x91\x64\x6b\x4b\x9b\xbf\x8c\xae\x3c\x10\x8a\xf2\xcf\x7f\xf5\x87\x3d\x68\xa8\x2f\xca\x30\xf7\xd2\x4c\x14\x80\x5c\x4f\x0d\x3e\x1e\x85\x56\xe4\x2e\x59\xa0\x5e\xfe\x33\x26\x82\x20\x56\xa0\x89\x2c\xef\xd3\xe9\x26\xbb\xea\x80\x22\x20\x54\x20\x88\xa4\x64\x5b\x12\xf7\x5f\xa6\x6a\x36\xf4\x92\xd7\x6e\xbd\x99\xe4\xf3\x8c\x38\xd8\x93\xb9\xec\x88\xe3\xc5\x71\x6b\x8b\x59\x16\xc8\x0d\x44\x34\x08\x98\x32\x2e\x40\x6b\x5f\x07\x51\x8b\x90\x26\x98\x03\xe2\xd5\x92\x0a\xc1\xfe\x13\x3a\x58\xa7\x9f\xc0\x23\x96\x68\xd9\xf8\xc4\x14\x5f\x08\x0c\xb4\x55\xda\x0d\xd4\xf9\xe6\xd1\xb2\x3a\x57\xcf\x3a\x48\x99\x60\xc8\x6a\x1f\xec\x1b\xf5\xa6\xfc\xb9\x4a\x68\xcc\x4d\x91\x79\xaf\x3c\xbf\x9f\x1b\x75\x1f\xa2\x67\xb9\x4f\x89\x03\xb4\xae\x30\x70\xb0\xc7\xf1\x8c\x81\x19\xb4\x06\x74\xbf\x8a\xdd\xc9\x4a\x4a\x3e\x6a\x70\x09\x16\x64\x4d\xc0\x3c\x73\x37\xab\x7a\xa2\x72\x12\xf3\x1f\x63\x49\x5d\x4d\x3e\x74\x12\xb6\xce\x56\xe8\x66\x64\xaa\xb7\x3c\xff\xa1\x28\x43\x32\x40\x0a\x01\xc3\x20\x6f\xe3\x8f\x76\x4f\xca\xaa\x7c\x26\x37\x9b\xfd\x8f\x32\x00\x65\xe7\x84\xd4\x13\xb3\x14\xf1\xc2\xe2\x57\x17\xca\x4f\x43\x18\xa0\xb2\x94\x6d\xf1\x2e\xff\x6c\xf1\xbf\x9f\x69\x3d\xf4\x9f\x75\x95\x51\xf2\x5a\xbe\x3a\xf9\xdf\xc4\xd2\x2d\x19\x9e\xf1\x8a\x27\x7b\x5b\x9f\xe1\x6d\x2c\x39\x80\xc6\xbc\x65\x98\x1d\x2b\x6f\xf2\xd1\x6c\x4c\xcc\x80\xfd\xa3\x75\x0b\x22\x97\x07\x38\x05\xda\xc4\x9b\xe4\x8c\x51\x89\x51\x3c\x42\xbe\xd9\x69\xff\x21\x8e\x0a\x5b\x63\x16\x2d\x77\x80\xfb\x82\x0c\x51\x66\x87\x3c\x38\xb9\xf3\x08\x0d\x95\x87\x3c\x0a\xad\x64\xde\xc5\xa3\x87\x49\x9d\x99\xbf\x77\x0a\x95\x2d\xe6\x87\x12\x96\x1e\x65\x75\x2e\x98\x95\xe4\x90\x3c\x4a\xee\xcc\xfe\xde\x82\x80\xaf\x9f\x3f\x8d\x3c\x7e\xeb\x67\x48\x6c\x06\x9e\xc3\x39\x2c\x87\xf5\x5f\xf9\xdb\x3e\xa4\xbd\xff\xc8\x4a\xb3\x7d\x64\xa7\xbe\x96\x80\xbc\x12\xcc\x4b\x4b\x3c\x21\xf8\x21\x8f\x74\x9f\xbb\x9a\xf8\x87\xb7\x14\xbe\x3b\x69\x6c\x8f\x20\x71\x3c\x3c\x76\xb5\xca\xd4\xd8\xee\xa0\xd2\xab\x0c\xb3\xf7\x84\x89\x53\x49\x00\x40\xbf\xd0\xdf\x9a\x47\x82\x67\x2b\x37\x1b\xfc\x3d\xc9\xff\x53\x48\x3a\xbf\xc5\x5b\x27\x51\x10\x0d\x77\x66\x0d\x65\x3d\x78\xe6\xaf\x79\x2c\xb7\x8f\x18\xdc\x04\x59\x29\x53\xf9\x47\xfe\x4f\x3f\x8f\x60\xe5\x20\xe6\xf3\x60\xdd\x01\x11\x29\xe8\x88\xd3\x74\xc0\x6e\xe3\x97\xcc\xfa\x83\xb9\x3d\x56\xb2\xc2\xce\xfb\xf5\x2e\x9c\xa8\xc9\x91\x45\x49\xb3\x63\x07\xe8\x06\x28\x32\x9c\x43\xd2\x1d\x09\x36\xe2\xeb\xcb\x43\x59\x4a\xe7\xa8\x23\x82\xa4\xdf\xed\xa7\x34\xd1\x9f\x9f\x32\x73\x44\x48\x38\x54\x08\x28\x8c\x92\x7f\xd3\x41\x18\x33\xaf\x3f\x31\x02\x4e\x75\x66\xe8\x20\x00\x58\xdd\x4f\x3b\xdd\x0f\x87\xd6\x13\xf9\x96\x93\x24\xd4\xa7\x5b\x92\xce\x53\xa4\x45\x4d\x90\xa4\xe5\x26\xbf\x6e\xdd\x74\x53\x3f\x60\x52\xc2\xe2\xc4\x91\xea\x04\xd7\x96\xdd\xc1\x43\x2d\xe5\x74\xf7\x33\xde\x63\xcb\x87\xfe\x3d\xd0\x7b\xda\x01\xcb\xa2\xd2\x3b\x1c\x93\xa7\x67\x38\x28\xd4\xcd\x9c\x6c\xac\xad\x9e\xfd\x54\xff\x77\x25\x4a\x83\xc3\x63\x99\x47\xac\xef\xdd\x9b\x24\xb0\xfa\x33\x09\xfc\x72\xb4\x9d\x22\x48\x36\x49\x22\x76\xfa\x51\xfc\xcf\x1c\x5c\xff\x21\x6e\x00\x1a\x06\x96\x14\x23\x9b\x6a\xb7\xca\x00\x7c\x32\xa8\x32\xd5\x59\xfa\x02\x21\xef\x04\xa4\x4e\xd8\x54\x07\x9d\x79\x08\x4f\xe3\x42\xf7\x83\xa9\x58\xed\xbe\x8a\xf0\xff\x8f\xf3\x70\x89\x29\xbf\xa9\x28\xb3\x65\x0a\x37\x24\xfb\x70\x93\xf7\xf6\xc0\xca\xff\xa8\xe4\x23\xca\x2f\xcd\xf2\x4e\xfe\xf6\x3b\xb8\x38\x58\x9a\xf2\x09\x9f\x2b\xb6\xad\x13\xec\x1b\xb9\xeb\xc9\x18\xa9\x2b\xe1\xf3\x5f\x47\x9e\x44\xc6\x0f\x52\xc4\xe4\xa4\x2c\xde\xa2\xee\x26\x0d\xc0\x3d\xb7\xd2\xfe\x8a\x8c\x94\x31\x17\x32\x87\x7a\x00\x22\xe9\xd4\x79\x77\x9c\xc5\xd5\x7f\x2a\x5a\x69\xf0\x11\xfa\xbd\xc8\xa9\xbe\x5d\x70\xf8\xd4\xd2\x16\xd4\xff\x34\xf2\x1a\xca\xa5\x06\xca\xe0\x29\xff\xec\x0c\x79\x22\xb2\xe5\x01\xd3\xe3\x3f\xd2\xf9\xa5\xb3\x90\x51\x27\x1e\x87\x8e\x39\x62\xce\x58\x3f\x68\x68\x37\x5f\x13\xb7\x73\x2e\x44\x3a\x63\xd8\x21\x19\xf2\xc6\x71\x82\x24\xac\x0f\x97\x27\x68\xdd\x90\x93\x2f\x1f\x98\xc9\x4d\x10\x9d\x64\x6c\x70\xf8\xb8\xe5\x8a\x2f\x40\xd2\x87\x9b\x1e\x8d\xf3\x60\x53\xda\xc5\xff\x4f\x33\x8f\xbb\x7a\x92\x16\x21\x58\x7e\x92\x4f\x48\x52\x30\xb0\x6e\x26\xc5\x1b\x74\x0b\xd2\x78\xd3\x18\x63\xb2\xda\x83\x7d\xa2\xf1\xfb\x71\x1a\xfe\x7d\xf5\x26\x79\x8c\x61\xe4\x78\x23\xc7\x20\xb8\xc7\xf7\x1e\x12\x67\xa3\x0d\x25\xf9\x7f\x0c\xd3\x04\x30\x9d\xcf\x7f\xca\x10\x74\xbc\xa7\xe0\xf2\x73\x28\x3f\xde\xe3\x2d\x1b\xe7\x5b\x86\xcf\x71\xa0\x6e\x3e\xe1\xb6\xd1\xe4\x54\x3b\xff\x56\x84\xfb\x96\xd5\x21\x01\x0a\xd7\x68\x79\xed\x36\x69\x0b\x8f\x4d\xd4\x46\x03\x72\x9b\xb6\xa1\xb9\x9f\x1f\x0e\xd6\xab\xe8\xe0\x91\x0b\x30\x56\x75\x33\x20\x20\xe0\x93\x7e\x5a\xf8\xe9\x4a\xc1\x49\xfa\x9a\x83\xe9\x7f\x83\xb4\xe0\x8c\x79\xab\x07\xc8\xe0\xae\x4c\x4e\xb7\x72\xbf\xe5\x06\xdd\x96\xa6\x7d\x99\x40\x39\x22\xbd\x9e\x34\xf5\xce\xdc\xaf\xfb\x29\x23\xe2\xba\x33\x59\x1e\x20\xfe\xb7\x07\xa5\x0a\x6e\xd3\x3f\x63\x6e\xcf\xc5\xe7\xea\x6d\xa5\xba\x80\xb5\x0c\x8b\x74\x06\xc8\x3d\x0f\xf9\x6b\xd0\x01\xc3\x14\x7b\x55\x56\x31\xa6\x55\xdd\x58\xc4\x71\x89\xdf\x1e\xf4\x77\x64\xfa\xf2\x5e\x0d\x72\x9d\xe6\x04\xdb\xb8\xba\xd7\xb6\x23\xbc\x20\xfb\xc1\xd9\x44\x57\x1d\x08\xf7\xe9\x7d\x72\x5b\x10\x2e\xf4\x1c\x5a\xe8\x29\xeb\x18\x39\x74\xb1\x5d\x97\x40\x2d\x3b\xc4\x08\xb8\x61\xe9\xec\xfa\x02\x0b\x01\xa2\xca\x86\xc0\xbe\xce\xed\xf8\x09\x0b\x54\x4f\xac\xf7\xa3\xce\x50\xd5\xf7\xa9\x38\x64\x70\x92\x49\x3f\x7b\x6e\x3b\x1a\x58\x4a\x02\x58\xa5\x13\x8f\x66\xce\xbf\x8c\x71\x0a\x0b\xd0\xe7\xdc\x07\xdb\x94\x28\xc8\xeb\xcf\xc6\x1a\x3a\xd4\xd4\xc9\xf0\x81\x66\x12\xaa\x2a\x9f\xd2\x87\xc0\xa0\x31\x8e\x49\x3e\x22\x7f\xe7\x0c\xe3\x19\xdf\xc2\xfa\x4d\xb7\x7f\xa3\xd6\xcd\xa0\x42\x80\x35\xfa\xe1\x34\x6d\x9f\xac\x7a\x2d\x23\x34\x6e\xa5\x26\x70\x53\x85\x22\x75\x09\x83\xee\x56\x0d\xe1\xe6\x1f\x8a\x7f\xb7\x16\xff\x6f\x61\x94\x9e\xf4\x62\x25\xcc\x84\x32\x90\x0b\xf1\x81\x4f\xe8\x15\xac\x59\xff\x9e\x58\x7f\x8f\xe9\x60\x4e\xdf\x18\x96\x5f\x06\xa0\xc2\xec\x68\x3f\x29\x94\x32\xd2\x30\x30\x04\x08\xf4\x9e\x1a\xaa\x67\x5c\x01\x86\x13\x1e\xdd\x76\xf8\x97\x02\xc9\x21\x71\x44\xc6\xb6\x56\x62\x7a\x51\x48\x76\xde\xbf\xef\x30\xd1\x9f\x65\x4c\x2e\xf9\xe2\xa3\x65\xc7\x72\xf3\x1e\xd8\xeb\x1a\x6e\x7a\xd3\x0f\x1a\xe0\x58\x19\x83\xcf\x01\x5c\x6c\x78\xec\x3a\x6e\x5d\x91\x76\xf0\xbc\x9f\x8f\x50\xa8\x0b\x90\x50\x69\xe5\x42\xcd\x94\x81\xc6\x24\x5a\x29\x01\x3b\xf8\x67\xcb\x31\xf9\x2e\x98\x8c\x70\xe4\x0f\x73\x97\x20\xae\x2d\x3e\xb9\x53\x16\x53\x67\xb0\x7a\x43\x1c\xf0\x7b\x9a\x65\x49\x0c\x61\x03\x22\x12\x1b\xa1\x64\x30\x6b\xf2\x6c\x40\xad\x98\x42\x45\xe0\x0e\xdf\x0c\x6f\x70\x42\x6a\x01\x2e\x3f\xec\x3e\xd3\xd6\x2f\x60\x77\xcf\x35\xac\x0b\x69\x3e\x5a\xd5\x3a\xbc\x09\x61\xc8\x5d\xd5\x02\x0c\xad\x7c\x6f\x32\x92\x06\x89\xb2\x0c\x6e\xbb\x23\xd1\xbd\x21\x32\xbf\xc0\x20\x7e\x06\xcf\x1f\x43\x99\xb8\x18\xcc\x3a\x06\x11\xdb\xc6\x08\x2e\x30\x46\xfc\xa2\x09\x71\xcb\x77\xe7\xfe\x0d\x31\x85\x01\xf0\x93\x4d\x58\xcf\xdf\x11\xca\xa5\xc9\x64\x48\x25\x74\xfd\x03\x66\x19\x85\x50\x82\xa0\x86\xb3\x83\x2c\xf4\xa0\x82\x50\xb5\xfd\x30\x48\xe0\xe0\x1b\xd2\x04\x1f\xc9\x1c\x84\xeb\x7a\xfd\x2c\xd2\x17\xe8\x66\xe0\xef\x30\x0c\xbf\xa4\x53\xc0\x74\x48\xaa\x24\x04\xf0\xf2\xea\xea\x10\xf5\x54\x78\x17\xdc\xa7\x38\x50\x93\x3a\x81\x54\xef\x0c\x74\x89\x89\xba\x87\x50\xc3\x1e\x3a\x0a\xa2\xff\x5b\x69\x5f\x2b\x57\x45\x6e\x18\x90\xce\x23\xe9\xde\x21\x26\x60\x06\xb1\xda\xc3\x03\xbe\x5a\x37\x81\x6f\x5a\x9d\xd3\xe8\xe5\x53\x06\x24\x43\xd5\x14\xfb\x10\x8e\x33\x43\xb5\x6e\x74\xdd\x29\xb9\x40\x21\x80\xda\x15\x1b\x94\x03\xe9\x52\x0a\xdc\x7a\x05\xb5\x94\x28\x85\x02\xc6\xca\x40\x9f\x95\x5b\xfc\x0b\xef\x35\xef\x00\x30\x9c\x84\x80\xf5\x56\x89\x13\x39\xfc\xac\x57\x6d\x3c\xca\xff\x28\x29\x04\x32\x0c\xf1\xbe\x3b\x19\xf2\xce\x32\x38\x2f\xcf\x78\x3f\x3c\x49\x99\xc7\x11\xd7\x6f\x98\x91\x78\x4e\xda\x3d\x12\x2d\x63\xba\x7a\xc8\xaf\x50\xb9\x70\x7d\x86\xbe\x1a\x75\xa7\x34\x16\x2e\x25\x8b\x43\x83\x41\x65\x8f\xa3\xba\x1c\x83\xbc\xc9\x35\x99\x01\xc1\x85\x10\x6d\x30\x24\xb5\x87\x5d\xd3\xa5\x86\xf8\xf6\x59\xc9\xa9\x47\x43\xfa\xf1\x19\x93\xe7\x7c\x29\x40\xa0\x90\x78\x02\x75\x8c\x07\x28\xa3\xb3\xb6\x88\x69\x3d\x07\x5c\x23\x62\x3a\xda\x71\x6e\x0c\x56\x92\xae\x81\x5d\x1f\x94\x3c\x5e\x92\xc6\x49\x86\xbc\xd7\x25\xc4\x03\xa6\xaf\x12\x00\x06\x3c\x40\x59\x90\x5b\x97\x4c\x8e\xe7\x4d\x9a\x07\x67\x7c\x0b\xe9\xe4\x1c\xeb\x90\xba\x30\x09\x94\x14\xa8\xd7\xd0\xe2\xed\xa4\xbb\x4e\x98\xb4\x93\x7c\x52\x03\x52\x1f\xc5\x9a\xa2\x5d\x7b\x2d\xf3\xcd\x91\x92\xbb\xa0\xb3\x9c\x52\x38\x99\x87\xb5\x00\x90\x76\x48\xf2\x55\xdf\x1f\x45\x57\x85\x04\x11\x6e\xb4\x6e\xe1\x80\x4e\xc5\x0b\x1c\xe7\x0a\x39\x55\xa8\x33\xe8\xeb\x02\xe3\x73\x95\x3c\x83\x3e\xf8\x54\xa4\x3b\xa1\x20\xdb\x90\x74\xcc\x89\x53\x39\x06\xc2\xdb\x7d\xe2\x33\xe3\xdb\x4c\xa4\xaf\x0f\x8a\x0e\xff\xc1\x37\xfd\x1c\xbd\xad\x4a\xaa\x57\xd2\x7d\x46\x0a\x5a\xba\x7b\xac\x2c\x85\xfe\x6b\x02\x13\x4c\xc6\x15\xe9\x5c\xde\xa1\xd1\x00\x73\x2f\x07\xad\xae\x01\xa9\x48\xa0\x4e\x0b\xa5\x92\x74\x0e\x1b\xb6\xb0\xe1\x4e\xfb\xa5\x14\x7d\xc8\x82\x69\x15\x38\x3a\x54\x5c\x60\x7a\x82\x12\x6e\x6b\x87\x04\x48\x11\xe2\x0e\x53\x4b\x7e\x08\xa4\xed\x51\x6c\x21\xcb\x0f\x3d\x0e\x0e\x3e\x14\xff\xb5\x52\x6b\xcd\xca\x3a\xc4\xef\x84\xe5\xaa\x87\xd2\x12\xb2\xd2\x46\x66\xc9\xd8\x6f\x3c\x98\x51\x8c\x0e\xc0\xc6\x6c\x7e\x0c\x54\x5c\x07\x03\x66\x02\x3c\xe0\x72\xf0\xf7\xf5\x80\x43\x2a\x7c\x63\xd2\xf3\xa3\xf6\x06\x2c\x20\xf9\x74\x62\x50\xe3\x69\x73\x00\x7a\x63\xd2\x48\x52\x9b\xdd\x94\x97\xf4\x2a\xac\x1d\x51\x99\xe6\x24\x1a\x3d\x12\x0a\x71\x0d\x5f\xa7\xbd\x37\x47\xd9\x9b\xa8\xef\xad\xa8\xdb\xf7\xde\x24\xfe\xf4\xbd\xd7\x9b\xb6\x16\xdf\x7b\xf0\xd7\xe3\x5b\xe5\x86\xfb\xb5\x16\x4e\xdd\x8c\x6f\xe9\x33\xfd\x5f\x97\x81\x97\xe8\x02\x66\x3f\xa5\xca\xe0\x71\x85\x6f\xfe\x79\xad\xdf\xa1\xc7\xb0\x85\x34\xf2\x17\xf1\x45\x3f\xeb\xe7\x3e\x9d\xf0\xfe\xb9\xee\xc4\xaa\xef\xc3\x2e\xc7\x07\x06\x5c\xba\xc8\x4f\x96\x30\xe0\x27\x9d\x1c\x5b\x7d\x48\x1c\xfd\x28\x53\xe9\xe3\x9a\xc4\xd4\x5e\x18\xbb\x5e\xcf\xfb\xc3\xdc\x94\x37\xd3\x56\xdf\x61\x33\xe8\x31\x18\x11\xf6\xc1\x71\x67\x3f\x04\x30\x49\x4e\x21\xd2\x74\xdf\x1e\x0f\xf7\xa8\xfe\xdb\x55\x79\x9f\x5d\x8e\x61\x9a\x53\xe8\x31\x4c\x7d\xeb\x55\xea\x3e\xef\xfa\xf7\xcb\x9b\xb7\x85\x51\xc6\x0e\xef\xca\x80\xdf\x7b\xad\x53\x57\x6d\x7f\x97\xff\x5d\x99\x2a\x05\x7e\x59\xe1\xbb\x6e\x4d\x91\x73\xf9\x23\xc0\xf5\xee\x3a\x01\xf0\x89\x69\x5d\xad\xbb\x33\x0a\xdf\x65\x97\x39\xfb\x9e\x7b\x02\xd2\xdb\x93\xbd\x1d\xac\xd7\xa3\x4a\xcb\x01\x73\x8a\x2d\xcc\xda\xd7\x55\x66\xed\x2b\xf3\x34\xdc\xe8\x9d\xd7\xb0\x30\x4a\xf4\xee\xc4\x54\x20\x2f\x7e\x96\xe8\x85\x26\x79\x0e\x35\x3b\x09\x5d\x85\x30\xac\x9f\xdd\xb1\x5e\x3f\xca\x16\x42\x2a\x01\x50\xb1\x3c\x60\x0c\x73\x8e\xda\xb7\xd2\xd9\x80\x7c\xfc\xd9\xd7\x0f\x85\xaa\x09\x73\x0e\xf5\x05\x8f\x51\xf2\x01\x64\xa7\xd7\x2e\x82\x49\xce\xf2\xed\xfa\x27\xdf\xea\x6d\xd7\x12\x36\xf5\x98\x38\x95\x60\x42\x34\xf7\x5d\x15\xf6\x2d\x15\xab\x37\x9a\xdf\xa2\x88\xed\x3b\x4f\x59\xfa\xa1\x6f\x24\x1e\xf9\x35\x06\xfd\xf7\x6d\x15\x96\xd4\xd0\xdf\x64\xf0\x4b\xaa\x61\xbd\x64\xa0\xef\x4f\xec\xc4\xf4\x23\x97\x86\x48\x60\x7b\x5b\x5d\xe0\x83\x5c\x00\xa6\x49\xbd\x15\x99\x7f\xa7\x42\xc7\x71\x03\x30\xb0\xe5\x1b\x1d\xea\x58\x06\x7e\x6f\x4c\x7a\x8a\x2c\x01\x27\x56\xe7\xf9\xdf\x9f\xf8\x84\x5e\x37\x87\xe0\xaf\x7b\x8d\x15\xfd\xf3\x7a\x61\x1a\xba\x11\xac\x32\x78\x03\xec\x52\xcc\xaf\x6a\x75\xe8\x33\xdb\x98\xe7\xe9\x4b\x21\x97\xf3\x5a\xe5\x4d\x2f\xfd\x99\x57\xb9\x34\xb0\x85\x30\x04\xe9\x93\xaf\xa2\x7c\x55\x03\x89\xcd\xd2\xab\x50\x8d\xe8\x55\xc2\x4b\xe5\xe5\xd2\x21\xae\x34\x81\x6e\xd0\x21\xaa\x9d\x2f\x84\x41\xbd\x0e\xa2\x13\xc9\xbc\x1d\xb3\xf2\x0d\x34\x3a\x2e\xd8\x5b\xef\xdc\x0a\x64\x7d\x51\x84\x21\xef\x2c\x34\xe3\xfe\x12\x3f\x04\xde\x75\xaf\x10\x5b\xa8\x2d\x44\x22\xf6\xd5\x5b\x36\xe8\x39\xe4\x2e\xd8\x90\xdb\xbb\x72\x1e\x51\x52\x0c\x88\x34\xc7\x92\x6d\x78\xbf\x7e\x9b\xee\x43\x3d\x03\xeb\x5b\xa0\xd5\x3c\xc1\xb0\x46\x8a\x29\x24\x1a\xba\xf3\x7d\x52\xed\x8c\x80\x96\xd4\x2e\xd2\x1a\x52\x0e\x2b\x3d\x3b\x5e\x29\x56\x48\xda\x22\x69\x2c\x80\x69\x53\x5a\xcf\x43\xe8\xd3\xef\xc4\xdd\xac\x07\xe1\x6d\xc6\xbd\xeb\x79\x42\x3a\x56\x0e\xf5\x4e\x8f\xab\x8a\xb4\xde\x91\x7a\x71\x89\x98\x7d\x41\x52\x31\x8c\xeb\x93\x62\xa9\x36\xda\xdb\x95\x62\x60\x6d\xae\xdf\x41\x7f\xd2\x61\x53\xef\x95\x31\x64\x1d\xe4\x60\x1f\xa2\x72\x86\x24\xa5\x60\x63\x29\xfd\x6b\x70\x0d\x69\x00\xd6\xd8\x17\xdc\x77\xf3\x3b\xb0\x07\x55\x31\xff\xc5\xdd\x72\xa8\xde\xc3\xc9\x3e\x2b\x5f\xef\xf2\x71\x52\x23\xfa\x1f\x8b\x9b\x8a\x11\x6a\x86\xa0\xb6\x17\x1b\xa8\x9a\xbd\xac\x3e\x5e\x43\x2a\xc2\xde\x6c\xbc\x5b\x27\x97\xf6\x70\x8f\xb3\x82\x9b\xc2\xa3\xb5\x0a\xa9\xcd\xbf\x20\xbc\xc3\x1d\x38\xad\x07\xb2\xb9\xa7\x45\x5d\x52\xe4\xb9\x68\xd9\x7b\x39\x25\xbb\x7f\x96\x57\x39\x10\xf5\x77\xc1\x07\x9f\x9e\xea\xb6\xf0\x98\xc0\xfb\x10\x70\x96\xe2\x9a\x3f\xcf\xee\x8f\x3f\x93\xb3\x27\x8f\xab\xcb\xe7\x34\xd2\xf4\x5f\xe8\x4e\xe8\x18\x33\x02\xcd\xd2\x95\x80\xcf\xbe\xce\x39\xc7\x25\x79\x62\x86\x03\x48\xa2\xf0\x48\x79\x08\x33\x7c\xf5\x63\x61\x1d\xc9\xff\xe5\x37\x27\x8b\xae\x7c\x53\x7e\xc9\xc6\x85\xba\x69\x98\x0f\x1b\x42\x29\x23\x47\x08\xe6\x82\x88\xb3\xbe\xe2\x4b\x0f\x8d\x5d\x8c\xeb\x37\xfb\x72\xd9\x18\x2c\x32\xa8\xae\x4c\x83\xe5\x2b\x5d\xfe\x29\x5f\xd6\xe5\x55\x34\xfc\x52\x0f\xe0\x0a\x95\x57\x98\xb0\x8b\x34\x72\x59\x27\xc8\xbb\x78\x97\x5c\x89\xaf\xa4\xae\xc7\x95\xfc\xeb\x3a\xbf\x9f\x69\xed\x6a\x13\xdf\xda\x55\x28\xaa\x34\x22\xac\xba\x9e\x18\x65\x30\x18\x9e\xd2\x56\xa1\x3b\x5f\xf7\x9d\x64\x63\xfd\x0e\xab\x8f\xf3\x96\xb1\xcb\x79\x37\xa5\x1d\x9c\xe4\x10\x42\xc2\x94\x9c\x5e\xb8\x14\xef\x0c\xde\xbb\x04\x05\xc1\xd6\xdd\xe9\x4e\xda\x83\x42\x94\xa2\x88\xd4\x7b\x3f\x1e\x51\xe9\x9f\xf7\x40\x7d\x85\xcf\x28\xf7\xfd\x89\x26\x34\x70\xdf\x27\x43\xdb\x6d\xf8\xbb\x0e\x05\x39\x31\xee\xb7\x1f\x4d\x98\xcf\xc8\x8d\xe4\x1c\xe3\x63\xa1\x64\x44\x50\x75\x4f\x11\x9a\x2f\x1b\x1b\xd9\xfd\xa3\x1e\xc2\x05\x36\xd7\xbd\x08\x4e\x29\xcc\xf5\x8f\x30\xea\xaf\x21\xf0\x60\xe8\x51\x08\x72\x88\x42\x54\xb0\xcd\xc2\x4f\xdc\x25\x2c\x74\x75\x05\x42\x39\x55\x38\xec\xd9\x2f\x10\x0c\x3b\x67\xff\x2a\xcf\xd0\xaa\xc0\xa0\xb6\xc8\xfc\x1f\x33\xed\xaa\xdc\xac\xfa\xba\xb5\x45\xbe\xbb\x9d\xff\x2d\x61\x85\x2b\x1f\x57\xac\x3b\xf6\xfe\xac\x5d\x0d\x23\x2e\x23\x44\xbb\x69\xfb\x1f\xbe\xe6\x57\x24\xf5\xc0\xef\x47\x02\x1b\x99\x29\xa3\xf6\x9e\x7c\xe2\x7f\xe9\xa6\x12\xad\x21\x5d\x5b\x3a\xe9\x63\x7f\x71\x06\x09\x65\x1c\x1f\xc9\x65\xbc\x75\xc8\xfb\x95\x24\xca\xf5\xcf\x84\xb6\x2d\x6c\x1c\x5e\x19\xa2\x3e\xc0\x85\x86\x39\x9e\xa7\x1a\x69\x03\xe3\xcc\x68\xda\xf9\x7f\x77\x9a\x1a\x09\x5e\xa7\x53\x52\xc3\x9f\x08\xca\x1a\x4f\xaa\x5f\xc0\x72\x60\xd3\x3b\x7d\x74\x59\x86\x23\xf1\x4c\xf5\x55\xc7\x4a\xc1\x93\x7a\x23\x4a\x90\x08\xc9\x5a\x3a\x91\x7e\xda\xf4\xc6\x56\x19\x91\xd7\x9d\xa3\xf9\xd3\xfa\xb4\x94\xc5\x60\x24\xe9\xdc\x31\xff\xe1\xff\xd9\x14\x17\x82\xce\x05\xe7\x04\x5d\xf1\x42\xda\x17\x59\x9c\x6d\x48\x81\xfe\xd4\x2d\xea\x4b\x1e\x45\xa7\x7b\xf3\x6a\xb5\xf5\x8a\x9b\x46\xb4\x86\x17\xde\x8a\x45\xa3\x3c\xb7\xfb\xbf\x42\x91\x22\x44\x1f\x4f\xb0\x1f\x59\xc6\x0a\x58\x63\xee\x1d\x25\xc1\xcd\x9e\x02\x0f\xb3\x4a\x41\xe8\x2c\x91\x2f\x67\x43\xd4\x07\xdb\xdb\xb3\x4c\x22\xe2\xcf\x37\x7e\xcc\x4f\xda\x64\x8e\xc7\x6f\x40\xd2\x24\x33\x0d\x4a\x50\x26\x99\xfd\x17\x59\x32\xbb\x30\x05\x4b\x79\xfb\x43\x9f\xec\x24\x9a\xe2\xb9\xcc\xd1\xf5\x35\xb4\xbe\x24\x93\x81\xd7\x92\x0f\x79\x06\x6b\x80\xf1\x7d\x48\x5a\x8c\xad\x4a\x34\x23\x5d\xda\xc0\x9d\x48\x42\x5f\x65\x86\x00\xaa\x84\x02\xe6\xf0\xdd\x3d\xb3\xf4\x55\x0d\x3c\x92\x7e\x8b\x55\xdb\x92\x67\x41\x55\xcd\xc8\x06\xa0\x17\x87\x0d\xf5\x54\xf1\x59\xfd\x45\x71\x8a\xf0\xb4\xc7\x00\x94\x1b\xaf\x8c\x66\x9e\x90\xcc\x6f\x8b\x10\x8b\xf2\x3c\x43\x12\x83\xda\xb2\x67\x2e\xcc\xaf\x39\xd1\x6d\x56\xf5\x90\xbb\x0b\xf9\xe9\x93\xf3\xe7\x15\xc3\xd0\xae\x89\x7e\xe2\x73\x94\xca\x45\xe5\x2c\x27\x08\x41\x92\x46\x33\xf8\xe4\x80\xc9\x10\xc9\xfb\x90\x65\x95\x67\x15\xe0\x3a\xd5\x30\xda\x7f\xbb\x50\x60\xe0\xa8\xb0\x20\x97\xd1\x11\x33\xab\x0d\xdd\x76\x43\xbb\x5f\x18\x96\x31\x7b\x4c\xd8\x6a\xb8\xfe\x5b\x7d\xfb\x8a\x0d\x5a\x19\x3a\xa4\xcb\x9f\x23\xe8\x61\xd7\x33\xb6\x4f\x3f\xad\x8d\xfa\x8f\x76\x45\xa5\x08\xbd\xa3\x55\x67\x41\x3a\xd4\x0f\x7b\x72\xf6\xfe\x5b\x22\x82\xc9\x6f\x1c\x6f\x63\x7a\x80\xe7\xe8\xf1\x01\x43\x4e\x03\xfd\x8c\x78\x53\x31\x77\x88\xac\xf4\x90\x1d\xc1\xb2\x0e\x14\x13\xe1\x80\x43\x21\xc8\x21\xa8\xa1\xce\xac\xa3\xe1\x87\x08\xd2\xbd\xfd\xa3\xc1\x61\xdd\xe4\x2e\xc3\x81\xd6\xd7\xa1\x55\x26\x12\xfc\x71\x98\x45\x6b\x3d\xd1\x43\xf3\xd2\x6a\x0e\xe9\x66\xdc\xd2\x07\xf1\xe4\x2d\xfe\xb3\x61\x3a\x9a\x8d\x2b\x72\xdc\xbd\xe4\x43\x42\x82\x8b\xe6\xa1\x1c\x6b\x23\xa0\xe8\x91\x9d\xae\x61\x4a\x30\xbd\x58\x51\xbb\xc0\x5a\x5a\x03\x0e\x1d\x82\x68\x39\x6a\x13\xef\x5f\x14\x1e\xc2\xde\x72\x2a\x47\x1b\x3c\x43\x96\xf0\x84\xa6\xfc\x49\x90\xf4\xed\xc1\x14\x9e\x25\x7c\x23\x75\xfd\x6a\x02\x92\x64\x5f\x30\x12\x61\x43\x91\xb2\xc6\xda\x67\x9a\xca\xff\x79\x39\x50\x4d\x12\xba\x1e\x2b\xe9\xee\xed\xf3\xe4\x34\x22\xa6\x43\xd8\x37\x69\xf7\x3e\x52\xa8\x83\x4d\x17\x4a\x3f\x7f\xb3\x9a\x7b\x64\xd6\x6a\xbb\xd9\x4b\xb6\x72\xb8\x3d\x60\xd8\xee\x69\xe5\xe9\xda\xcd\x0f\xd2\x85\x3e\xe8\xca\x6f\xdd\x8a\x93\xe3\x63\x9f\x46\x61\xf3\xd3\x14\x28\x6f\x77\x27\x81\xb4\x5b\x8d\x64\x43\x3d\x28\x69\x0b\xa4\x42\xef\xd4\xf6\xf8\xf6\x26\xd7\x70\x64\x74\x20\xcd\x9c\x5b\x56\x1a\x86\x34\x70\x2d\xd2\x4b\xa9\x7b\xb6\x34\xa5\xb8\xc8\x6a\x63\x07\x8a\x67\xc0\x81\x64\x95\x98\x88\x75\x10\xaa\x34\x43\x4e\x85\x0c\x0d\x49\xee\xa2\x9e\x4a\x77\x04\xda\x31\xd7\x4c\x4d\x90\xa6\x73\xad\xeb\x27\x4e\x2f\xc1\xc8\x56\xff\x32\x77\x2d\xf2\x0a\x6d\x95\x29\xfa\xad\x3e\x25\x60\x42\xa3\x28\xfb\xd2\x6d\x54\xa2\x13\x4e\x55\x35\x92\xc1\xde\x07\x37\x9c\xa2\x94\x28\x09\x69\x40\x10\x25\x11\xdb\xab\xd5\x01\xfd\x5c\xef\x50\x37\x97\xb2\x8f\x7d\x93\x34\x45\xec\x17\x2a\xc6\xef\x72\x77\x11\x20\xc5\x42\xbe\x2a\xd7\xbb\x4a\x0a\x65\x38\xca\x3f\x5a\x57\x2d\x9a\xbc\x16\x5d\x27\x9f\x1f\x57\x57\xae\x05\xc3\x12\x8a\x26\x5e\x4c\xfa\x39\x76\x45\x7a\x94\x86\xfa\xb1\x34\xcb\x61\xdd\x59\xbf\x0d\xb3\xfa\x3d\x36\xa0\xe5\x5e\x9a\xa8\x6a\x99\x3c\xec\xe6\xb4\x0d\xdd\x43\xb9\xa3\x34\xf7\x4a\x51\xda\x32\xc4\x4b\x7e\x59\xc3\x58\x9a\xc9\x6e\x02\xd4\x75\xe7\xf2\x38\xf7\x8f\xf4\x5e\xf2\x2c\x2a\xb0\xfc\xf1\x60\xd0\xa5\x90\x85\x8d\xee\x1e\xcc\x7e\x6c\xa1\xf0\x03\x61\x13\xd2\xda\x9a\x4b\x2d\x37\xa1\x50\x44\xc1\x04\x51\xa5\xe4\x8b\xe3\xc4\x0d\x30\xc9\x5e\x5f\x39\x16\xf6\x8e\x02\xe8\xc7\x51\xd5\x18\xfe\x25\x7e\x37\x5c\x76\x59\x3f\x36\x5d\x4a\x7e\x6c\x52\xe0\x69\xe9\x74\x11\x1d\xf4\x53\x78\xaf\x9c\xc9\x45\xd9\x94\xad\xf0\x00\xdb\x44\x99\x9e\x14\x75\x66\x4b\xe0\x52\xe4\x8d\x5a\x26\x4f\xda\x68\x34\xd5\x19\x90\x90\xe0\x97\xca\x0c\x59\xd0\xb2\xf4\x06\x52\xae\x9e\x7b\x0d\x10\x08\x66\x7f\x12\x81\x66\xce\x6c\xff\x9f\x4f\x13\xb5\x8d\x52\xef\xb6\xe4\x3f\xe1\xff\xd0\x4f\x16\x61\xd2\xb0\xc6\x31\x86\x28\x4c\xa1\x68\x3d\x84\x52\xfc\x02\x0e\x5a\x4c\x5b\x5f\xa0\x70\x46\xfe\xb8\x5d\x54\x82\x5b\x59\x8d\xe4\xaf\xbc\x01\xf1\x12\x0e\x17\xfe\xa9\x44\x24\x18\x41\x2d\x45\xea\x21\x4d\xfe\xb8\x47\x88\x08\x1f\x78\x55\x62\xcf\xf4\x5e\x59\x6a\x30\x79\x54\xce\x63\x1f\x4e\xde\xf7\x43\xd5\x97\xfe\x63\x1d\x9f\x26\x05\x95\xfc\x1f\xf5\x52\x62\xa7\x26\x3d\x8d\x1a\x59\xf2\x47\xa5\xdf\xf0\x01\x03\x8b\x26\xdf\x74\x5f\x50\xc9\x62\x84\xdf\x54\xee\x72\x2a\x5b\xde\xb9\x13\xf4\x89\x6f\x9e\x9d\x04\x91\xc3\xda\x65\x3e\x84\x03\x41\x2e\xcd\x65\x1d\x56\x25\x44\x4c\xe4\x40\xab\xeb\xbb\xac\x32\xc0\x3e\xdc\x9e\x97\x3b\xad\xe0\x00\xc7\xc7\x6b\x4b\x45\x6b\x23\x56\x7a\xe0\x56\x8b\x64\x74\x94\x9f\x9d\xbc\x61\xe4\x46\x50\x58\x06\xf4\xb6\x90\x6c\xb1\xc3\x51\x9c\x65\xe7\x68\xd9\x00\x95\x2d\x01\x3c\xe0\x6f\x40\xb7\xa7\x88\x1b\x71\x78\x96\x28\xff\x07\xc3\x57\x9e\x2c\xfa\x54\x47\xd1\x0f\x2c\x5d\x6b\xa5\x30\x6d\xc5\xf5\x5d\xf8\x5c\x91\x50\xcb\xad\x1e\x1c\x1f\x1e\xf9\xfb\x65\xbe\x04\xd5\x5b\xfe\x95\x6f\x89\x93\x65\xc8\x53\x3a\xb0\xae\x80\x02\x2a\xd6\x55\x56\xbe\x07\x10\xeb\x17\x43\x22\x49\x02\xed\x02\x4c\xa2\x02\x45\x75\x0d\x95\x97\x36\x96\xc7\xcd\xb3\x1f\x52\x57\x81\xf2\xcb\xff\x02\xf0\x65\xb4\xea\x48\x71\x98\x23\x6f\x1c\xb9\x1c\xd9\xab\x66\x2b\xd4\x71\x36\x04\xe5\xd2\xcf\x7f\x52\x8a\xd1\x46\x34\xf0\x05\xc8\x50\x00\xe1\x31\xd6\xb2\xe8\xfc\x7a\xfa\x79\x88\x11\xc2\xa1\x98\xf3\x61\xef\xb3\x22\xfa\x87\xe7\xea\xfb\xf7\x79\x84\x67\x9b\x01\x7c\x8b\x39\x04\x64\xe4\xc4\x6e\x40\xdf\x48\x3a\x95\x2c\x71\x58\xef\x97\xed\x3e\x84\x07\x02\xf4\x35\xca\xbe\x70\xc4\x1d\x1b\x5f\x39\x65\x92\x1c\xe9\x40\x8e\x83\x24\x64\x90\x1a\x7a\x49\x6f\x06\x59\x7a\xbb\xb6\xd9\xa5\x5f\xb3\x4f\xba\x8c\x0d\x4f\x3a\x13\xda\x2e\xb7\x74\x69\x36\x9d\x63\xbd\x4f\xee\xc8\xd4\x90\x43\xd5\xd2\x11\xd4\xf1\x23\xfd\xe3\xd5\x5f\xbf\xd2\x96\xb2\x5a\x2a\x22\x5e\xa8\x7d\x43\x9a\xb3\xc2\xf0\xc1\x5f\x0b\xc4\x26\x9b\xb4\x53\xe0\x0e\xee\x5b\x9e\x19\x5c\x0d\x57\x74\x39\x39\xc0\x82\x9e\xaa\x57\x29\xb5\x6d\x12\xec\xaa\xcd\x9e\x49\x3f\x61\xb3\xaa\xb9\xb0\x8e\xb1\x77\x8c\xf5\xb4\x81\xae\x73\x63\x75\xa6\x78\xec\x15\xc9\xc7\x34\x34\xb1\x0f\x09\x63\x4b\xca\xd8\x48\x38\x66\xab\xf3\xbd\x33\x75\x13\x2d\xc9\xf6\xdf\x4f\x8e\xc6\xdf\x5d\xab\x29\x5e\xc8\xed\xf6\x43\xf1\x1b\xb3\x2f\x37\x12\x91\xeb\xc2\xf7\x0f\xba\x33\xbf\xd9\x85\xea\x33\x10\x14\xa1\x51\x87\xa2\x32\x4d\xb2\xda\x6d\x3c\x25\x10\xf3\xbd\xa9\x17\xc3\xf3\xec\xbf\x51\xb3\xd5\xf5\x95\x93\x09\x7b\xed\x74\x5e\xc4\xa7\xa9\x9c\xb6\xd7\xda\x18\x9f\xdb\xab\x33\x3a\x95\x92\xb1\x87\x71\xd6\xfe\x57\x17\x74\x44\xf6\xf2\x65\xfc\x77\x2f\x6f\x4a\xc4\x78\x25\xbb\xff\x78\xa0\x7b\xd9\xfc\xed\x46\xfb\xa4\x00\xe9\x5e\x34\x7e\x71\x0d\x99\x4a\x30\xb3\xa7\xba\x17\x4f\x70\x00\x42\xda\xf8\x7b\x27\x62\xb7\xd2\x00\x83\xda\x3b\x06\x4c\xfa\x91\xf9\x16\x51\xc4\x90\xe7\x80\xbf\x65\xdd\x6a\xcd\x90\xa6\x86\x76\x75\x34\xf6\xfc\xa7\x8b\xca\x88\x38\xf0\x5f\x1c\x3b\x6a\x41\xa2\x2b\xfb\x8f\x06\xba\xa7\x97\xcf\x4c\xed\xfc\x22\x91\x01\xff\xd1\x3f\x76\xa6\xe3\x40\x78\x66\xe3\x5e\xcc\x6a\xb0\x92\x52\x37\x53\x68\x02\x5b\xe5\x3f\xa6\xd0\xa4\x89\x0a\xc2\xa0\xe2\x19\x86\x64\x5d\x0d\xa9\x9a\x4b\xd4\x4f\xc8\xd4\x50\xc8\xc1\xde\x9e\x77\x4c\xb3\x41\xb4\x46\xbb\x93\x8c\x0e\x77\x9d\x3e\x1a\xb3\x05\xcc\x57\xed\x84\x63\x92\x16\xc7\xed\xcc\x2b\x6a\xe1\x8c\x74\xbf\xd8\x90\x90\xa9\x0e\xf1\x86\x1c\x4c\x8a\xcb\x30\x85\x7b\xab\xed\x95\xb8\x02\xd2\x42\xfe\x1e\x6e\x54\x98\x85\xbb\xf8\xc9\x32\xb4\x36\xaa\xbc\xe0\x91\x7c\x21\xe7\x86\x2d\xb4\x10\x00\x42\xab\x9d\x52\x38\xfa\xb7\x4c\x4e\x37\xbc\x69\xa2\x4a\xb9\xe7\xca\x5f\x0d\xf4\xa4\x48\x4c\xdd\xaf\xf8\x6f\x24\xe5\x1a\xec\x57\xbe\xd3\x0e\x62\x43\x1e\x6a\x12\xd2\x39\x66\x6e\x91\x67\x26\xa1\x39\x92\x72\x45\x9d\xc0\x29\x8a\xcb\x9a\x12\xde\x06\x62\x26\x8d\x6f\x95\xae\xe5\x5b\xf9\xa4\x59\xd2\x14\x98\x69\xf2\x6d\x4a\xd4\xaa\x6e\x28\x77\x12\xa8\x12\xde\xca\xa6\x35\x9a\xec\x34\x30\xb4\xd0\xeb\x89\x2c\x83\xad\xc0\x90\xfd\x4f\xdf\x83\x2d\x25\xef\xbb\x6d\x59\xbd\xaa\x2d\x5f\xa1\x37\x13\x52\x8c\x86\xa8\x27\x64\xdd\x18\x65\xb9\x00\xfe\x4b\xa7\xb3\x65\x0c\x12\x78\xb7\xb2\xab\x8f\x52\xd0\xa6\x9d\xec\xb8\x6d\x9a\x33\xdf\xa4\xc6\xb0\x41\x5c\x8b\x2b\x56\xc6\xb1\xb6\xb0\xe2\x32\xf0\xe0\x95\x94\xd0\x70\xd8\xf2\x13\x55\x1b\x77\x7c\x86\xc2\x4c\x8e\x8e\xf5\x96\xbb\x46\x8e\x2a\x4b\x7b\xe3\x18\x8a\xdf\xa2\xa7\xbd\xe5\x98\x3e\xdf\xfa\xfe\x4a\xc6\xd8\x6c\xc4\xc3\x29\xdf\x6d\x3c\x22\xe2\xb4\x45\xb6\x2c\xf4\x6f\xac\xca\x3c\x4e\xe1\xa2\x09\x9a\x6d\x7c\xba\xb8\x82\xf4\x69\x9e\x5d\x29\x64\x7c\x32\x8b\x79\x1b\x11\xb8\xf1\x1f\x3f\x7a\x5a\xf5\x46\xd8\x34\x29\xe6\x70\x5c\x42\xfc\xc6\x7a\x09\x64\x94\x41\xcb\xa6\x66\x01\x77\xb3\x8a\xb5\xe9\xb1\xc6\xd6\x3f\x0d\x9f\x91\x86\x9e\xdb\x98\xee\x95\x1f\xce\x88\x77\xca\x0f\x90\xac\x47\x33\x52\xb6\xe4\x73\xdd\xc3\x40\xc9\x15\x8d\x89\x0c\xf0\xd1\xdb\xb0\xa0\xeb\x2b\x19\x9e\x25\xe1\x72\x5d\x1a\x34\x39\x4c\xda\xd4\xba\x10\xa1\xd2\x82\x89\x65\xeb\xf0\xbf\xba\xee\xcd\x15\x93\xa6\x1b\x4c\xb6\x46\x49\xd6\xc4\x8b\x05\x3f\xc1\x96\xf6\x90\xb7\xb1\xce\xd0\x57\x50\xfb\xb8\xe1\x56\x0a\xe1\x9a\x7f\x8f\xd6\x9a\xae\x09\xea\xb7\x3a\x40\x0d\xf1\x1c\x10\xf0\x84\xe8\x5d\x08\xb1\x9b\x8b\x97\x64\x3d\x75\xa9\xde\x64\x0e\x55\xa5\x6f\x23\x35\x9b\x36\xf0\x43\x87\x6d\x4a\xc8\xdf\x24\xf2\xb6\xb7\xc4\xfe\xbf\xd5\x34\x76\x76\x65\x03\xba\xec\xcd\x19\x80\xe5\xb3\xeb\xe0\x3c\x7b\x30\xde\xbd\xba\x75\xa1\x9b\xee\xd6\x5a\x25\xa6\x63\x77\x9a\xdd\xc5\x2d\xf5\x1f\xf8\x37\xce\x8d\x69\x2f\x1b\x06\x54\xbc\x80\xdf\x97\x9d\x9c\xd2\xea\xc8\x67\xfa\x79\x09\x93\x8e\x3c\x7a\x04\x8b\xb0\x54\xd6\xcc\x88\xb7\x3f\x93\x50\xa8\xee\x20\x9d\x99\xeb\x68\x63\xb8\x7e\x86\x90\x25\xb9\x5f\x01\xd8\xf5\x47\xd9\x68\x9e\xb6\xde\x87\xff\xf8\xf5\x5e\xc2\x83\x1e\x32\x36\x6f\x7f\xed\x56\xab\xd4\x3b\xcb\x00\x02\xd7\xa3\xe4\x83\xd6\x6a\x4d\x3b\x14\x61\xaf\xff\xa4\x64\x23\x25\x9c\xea\xc2\xe3\x8e\x34\x85\x04\x5e\xb8\x54\x40\xa0\x5a\xc3\xbd\x77\x89\xd7\x6c\x4a\x0b\x5e\xad\x33\x92\x39\x52\x58\x6b\x59\xf8\xcf\xb9\xd1\xd1\xdf\x90\xf6\x7f\x5c\xa4\x79\x20\x32\xbc\x4a\xca\xc6\x86\xd3\x03\x4f\xdd\x7b\x8c\x48\xba\xf2\x12\xcc\x7e\x29\xcf\x5c\xaa\x4d\x56\x8d\xc8\xdd\xf1\x99\xff\xda\x25\x41\xb3\x4f\x0a\x45\x5a\x77\xf8\x56\x2e\xad\x55\x2a\xb7\x5f\x20\xa4\x51\xff\xa3\xf4\x8c\x5e\x03\x6b\x1c\x7d\x08\x88\x92\xff\xda\x79\x73\xad\x12\x49\xfc\x47\x99\x22\x4c\x6c\x58\xc2\xa9\x2b\x78\xa2\x5e\x4a\x52\x25\x3f\xa4\x80\x92\xb3\xd7\x10\x6b\x9e\xa8\xd4\x92\x9d\xdb\x40\x94\x79\x11\x91\xe5\x06\x79\x19\x7e\x2b\x86\x46\xfd\x5a\xeb\x5b\xac\x92\x8a\x79\x15\x16\x50\x68\x4c\x01\xbd\x94\xaa\x0c\x9d\x89\x56\xf6\x1d\x56\xcf\x47\x67\xea\xd4\x9a\x8e\x42\x89\x55\x43\x1a\x7b\xc1\x61\xb3\x2b\x15\x21\x1d\xed\xc5\x20\x48\x77\xde\x74\x59\x18\x75\x6f\x81\x95\xba\x0a\xe8\x66\xca\x8e\xbd\x26\xda\x79\xbc\xc8\x1a\xc7\x00\x53\x8d\x0e\x24\x61\x78\x8b\xed\x42\x78\x63\x53\x88\xce\xd0\xa2\x13\x35\xe4\xad\xdd\x1e\x48\x61\x25\xf2\x2e\x9b\xc3\x89\x07\x1f\xab\x74\x69\xc6\x78\x2b\x91\x5b\x26\xd1\x1b\x4f\x09\xe1\x9e\x83\x57\xa8\xcb\x3b\x9d\xec\x6a\x2e\x37\x9b\xcd\xe5\x0e\x69\xb8\xe5\x3e\xe7\xbd\x08\x51\x1b\xe3\x6e\x97\xd2\x93\x97\x3b\x04\x3d\xac\x6f\x14\xd2\x19\xf7\xb2\xfe\x24\x69\x38\x19\xba\xdc\x63\xcf\x65\x87\xe6\x8c\x74\x61\xee\x18\x24\x2f\x8d\x51\x10\x2b\x45\x67\x5f\x5a\x6c\x54\x42\x66\xc4\x23\x65\x0e\x42\x48\xd6\x65\x64\xbc\x4c\xd7\x57\x07\x22\xa1\x67\x91\xe2\xa0\x95\xa1\x2e\x53\xbf\xf7\xc0\x92\xb2\x23\x95\x13\xc1\x0b\xd2\x42\x98\xd1\xba\xd4\x48\x8f\x36\xe4\xfd\x9d\xa5\x62\xba\x83\x80\xea\x31\x27\xa5\x6d\xea\xe1\x1f\x28\x4a\xee\xe9\x73\xb4\x4b\x85\x90\x8c\x22\x07\x0b\x94\x07\x43\x44\x46\xb9\x39\x4b\x9d\xd7\x18\x54\x2d\x95\x44\x9f\xc5\x06\x04\x07\xcb\x68\xca\x0d\x72\xc2\xdf\x65\x65\xd6\x8e\x7a\x54\x62\x81\x36\x61\xcb\x9e\x3e\xbe\xec\x59\x16\x71\xcb\x4a\x2f\xf2\x05\xbe\x9b\x7a\x7a\x6b\x58\x30\x59\x65\xf1\x0e\xf5\x1d\xe4\x40\xfb\x53\xf3\x89\x40\xdf\x05\x55\x19\xc5\x6f\x4a\x8b\x79\x69\x83\x6e\xa3\xac\xbe\xa8\x2d\x8e\x8b\xa7\xd1\x2d\xe5\x50\x3d\x09\x62\x9f\xba\x53\x06\x8b\x34\x69\xd6\x10\xa7\x09\xc9\x7c\xab\xd9\xa8\xe1\xc3\xd9\xef\x85\x7d\x36\x1b\x4b\x85\xa4\x8e\xa4\xaf\x16\x17\xe8\xf0\xca\x7c\xc9\xf1\xcb\xa1\x12\xed\x33\xe9\x50\x9c\x91\x16\x4e\x8e\xd7\x44\xf7\x20\x2b\x95\x6a\xc9\x99\x9c\x24\x03\x13\x35\x69\xd4\x00\x2c\x99\x4a\x98\x56\xb6\x41\x22\x35\xef\xf4\xbc\xe9\x46\xb3\xa4\xfb\xb8\x59\x32\xfa\xb0\x24\xcc\x2e\xa9\xe7\xbf\xa4\xfe\x62\xa0\x0d\x3f\x09\x8e\x2a\xe1\x36\x60\xea\xca\x20\x65\xc7\xc1\x2e\x49\x75\x88\xd0\x34\x29\xca\x6c\x87\x56\xe9\x9e\x80\xe8\xfb\x26\x48\x0f\x6f\xa6\x97\x14\x52\x3c\xc9\x35\x78\x04\x2b\x0b\xb9\x57\xfd\xdd\x5d\x31\xee\xef\x5e\x43\x5b\xe6\x2b\xf7\xee\xbf\x10\xe8\xfe\xab\xf6\xd9\xb2\xf2\x30\xe8\xed\xdc\x9f\x35\xd0\x3e\x68\xfd\xcb\x6f\x29\xd8\xa0\x83\x29\xe0\x2f\xf2\x5f\x6e\x2e\xe8\xf0\x17\xea\xeb\x7f\xa9\xc9\x19\xca\x5a\x6d\x3a\xfa\xa1\xf9\xe6\x8c\xfa\x5f\xf7\x4e\xfb\x4b\x9b\x84\x65\x5c\x08\xfa\xcf\x2a\x20\xfc\x20\x8c\xbd\xf1\xef\x72\x85\xba\x0c\x66\xec\x38\xc7\x50\xaa\x68\x85\xe8\xac\x9c\x23\xee\xbe\xfd\xc0\xe6\x17\x58\x42\x6a\xa7\x6c\xcd\x7f\x4d\xd9\xd8\xf5\x2b\xf6\x9c\x43\xee\xbe\xcc\x5e\xd3\x97\xa7\xe7\x22\x15\x3d\xab\xf9\xfe\x84\x24\x8c\x7d\x30\x5e\xae\x57\xe8\xad\x60\x3e\x26\x74\x62\x9e\xae\xa4\x71\x67\x8f\x93\xa0\x94\x4c\xc8\x59\xbc\xe5\x9a\x63\x86\x7b\xae\x2f\xca\x70\x60\xfa\xbc\x53\xdb\x6c\x09\xb5\xf5\x4e\x28\x55\xb4\xd9\xd5\xc9\xb8\x2e\x3e\x8b\xb9\x9e\x21\x09\xa3\xd4\x3b\x64\xfe\x94\x45\x80\xf2\x23\x95\x59\xca\x73\xdd\x3f\xf7\x76\x20\x81\x87\x4b\xf9\xa3\x8b\x92\xbc\xec\x8c\xac\xa5\xa6\x17\x61\xae\xeb\xff\x27\x30\x53\xff\x11\x98\x41\x0d\x2c\x06\x0d\x96\x24\xf9\x4d\x48\x20\xcd\x58\xb8\x6c\x31\x54\x3b\xd7\x45\x17\x13\x1a\x16\x73\xb5\x0f\xd4\x75\x47\xea\xd4\x65\xa8\x0c\x3f\xe3\xa2\x26\x89\x25\xcc\xf6\x62\xd9\xaf\x0c\xe5\x1d\xcc\xab\x84\x39\xd7\x8c\xd9\x14\xde\x3e\xa6\xfb\xcf\x7b\xa2\xd6\x8c\x02\x6a\xb3\x57\x32\x44\xbb\x77\x9d\x3c\xe3\xd0\x16\x16\x16\xfe\x53\x51\x93\xf0\x78\x25\xb2\xeb\x5c\xc8\x5a\xc1\x7e\x1b\xe0\x5f\xec\xf9\x41\xc2\xc2\x3b\x58\xb3\x67\xb4\x6a\x6f\x0c\x42\x9e\x43\x50\x20\x6d\xe0\xee\x57\x02\x45\xdd\x90\xb7\x41\xfa\x27\xbd\x18\xfc\x9e\x41\x04\xb5\x4a\xee\x26\x54\x6b\x9a\x0d\x05\xd3\x7f\x21\x74\xe3\xbf\x1b\xdd\x1d\x8d\x57\x67\x5a\x85\x9d\x21\x71\x23\x2f\x33\x88\xf7\xb3\xf8\x47\xe8\xe6\x52\x0e\x9b\x0b\xe0\x64\x81\x22\x5e\x37\x30\x1f\x44\x8e\x4c\x64\x20\x48\xf3\x12\xea\xb8\xe5\x8a\x96\xc4\xb0\xae\xba\xec\x3a\x1c\x34\x65\x63\xbb\x3d\x49\xf6\x00\xa2\xce\x67\xd5\x61\xca\xa0\xcb\xa6\x8d\x8a\x95\x12\x94\xc9\x0f\xfd\xc3\x6a\xd2\x95\x19\x9a\x73\x9e\x7e\xa9\x70\xf6\x5a\x8d\x15\xe1\x5b\xc8\xe8\xe4\xf0\x87\xb6\x85\xac\x48\x27\x54\x75\xd8\x9f\x81\x88\xce\x2e\xb1\x43\x7b\x23\xe2\x11\xb9\x26\x9f\x64\x71\xd8\xa5\x44\x6b\xa2\xbc\x68\xc0\x78\x6e\xa9\x75\x39\x1c\x49\x43\xb9\x2b\x64\x4b\x21\x9b\x83\x97\xfc\x4d\x14\x02\x39\x8b\xce\xb1\x4b\xa4\x7e\x46\x87\x98\x97\xbb\x85\x68\x12\x26\x77\xd4\x46\xd9\x80\x21\x04\xa9\xd0\x23\x3b\xa5\xdb\xb3\x4a\xd6\x10\x48\xda\x3f\x25\x1e\x9a\xf5\xd7\x78\xf6\x12\x2a\x3f\x22\xa6\x1a\x58\xc3\xa3\x75\xf6\x71\x8c\xcb\x7f\xdc\x5f\xff\xd2\x9e\x51\x31\x3d\xc3\x00\xd8\x80\xb2\xc2\x9f\x77\x93\xa0\x92\x21\xaf\x88\x9f\x37\xf8\xb6\x14\xfa\xb8\x83\xa6\x6c\x88\x63\xf7\x27\x66\x79\xaa\x34\x64\xee\x4c\x56\x36\x80\x94\xb5\x3d\x1e\x2b\x15\x9d\x29\x15\xf2\xcb\xa1\x9b\x93\x6d\xa0\xe2\xb5\xe2\xd3\x13\x2c\xbc\x99\xb7\x3a\x97\xab\x9c\xc3\x47\x35\x14\x48\xe5\x50\x90\x06\x48\xd5\xe7\x93\x69\xd6\x56\x4c\x5d\x37\x47\xd7\xd3\xca\x97\x13\x52\xcf\xe6\x99\xe2\x44\xa7\x9c\xe7\x00\x67\x51\x7a\x9e\x98\x0e\x7d\xf2\x7c\x25\xd2\xf6\x01\x79\xb6\xf2\x78\x48\x3f\x07\x5a\x3b\xba\x04\x70\xa6\xb8\x12\x2e\x7d\x54\x76\x69\xb1\xc6\xf3\xbf\xb3\x14\x7e\x72\x5a\x19\x27\x74\xfd\x1d\xde\x6e\xa4\x4a\x7d\x05\x22\x8d\x0d\x38\x44\x6d\x42\x70\x06\x72\x82\x14\xe3\x69\xd2\xea\xa9\x2d\xc4\x78\xea\xc4\x19\x1b\x20\x74\xe7\x79\xe3\xe0\x8f\xb1\x71\x22\xe2\x59\xad\xfe\x65\xb9\x4a\x38\x1a\x30\xd1\x14\x1a\x1a\x3a\x6f\xd7\x83\x73\x6d\x9d\x81\x56\x00\x8e\x55\xb6\xd8\x67\xee\xe7\x9c\xb9\x3d\x18\xbd\x7c\x28\x15\x02\x7d\xd2\xd5\xe1\xe4\xc8\x13\x74\x86\x99\xc7\x62\x95\xf4\x5c\xef\xcd\x69\x74\x48\x78\x57\x27\xd0\x20\xf7\x5a\xbb\xb2\xde\x13\x3a\x97\x81\x38\xd6\x7a\xfe\xe5\x35\xc1\x88\xfc\x59\x5e\x6c\xd8\x9e\x85\x5a\xeb\x56\x32\x9e\x60\xe0\x99\xa5\x85\x54\x20\x24\xaf\x20\xc1\xb3\xac\x47\xba\x98\xfa\x01\x6d\x9e\x12\xfb\x6b\xd6\xc0\x00\xe3\xe7\x90\x79\xbf\x2f\x81\xd0\x20\x2a\xea\xa1\xe1\x70\xf1\x4e\xbb\x86\xdc\x25\xfd\x1f\xfb\x5c\x35\xaa\x85\xdb\xad\x6e\x4f\xbe\xa9\x6e\x82\xf9\x8c\x12\x80\xaf\x20\x45\x1b\x3c\x23\x91\x97\x87\x26\x93\x9b\x34\x8d\x3d\x9e\xee\x44\xc0\xcd\xba\xda\x9c\x4b\xfd\xf8\x65\x22\x6d\x6a\x27\x58\x63\x33\xf5\x30\x9f\x79\x9a\xfa\xf6\xa9\x49\x5d\x48\x9f\x8d\x0d\x3f\x43\xee\x28\x7d\xba\xde\x52\xba\xf9\xce\xa5\x9b\x29\x3c\x4f\xe7\xc2\x39\x08\x0a\xcb\x13\xb3\x4d\xdc\xcf\x7a\xc0\xac\x01\x92\xb8\x07\xd0\x06\xea\xca\x43\x76\xc6\x87\xf4\xb3\x52\x28\x06\xed\xac\xb5\x40\x56\x0e\xe5\x1f\x48\x1f\x9f\x44\x03\x8f\xb1\xd7\x3b\x04\x85\xfa\x47\x60\xdf\x00\x8d\x48\x9e\x98\x37\xe2\xd1\x56\x09\x34\x3f\xe1\x44\xa8\x73\xae\x6b\x4c\x52\x40\x74\x28\x44\xb3\x0c\x6e\x01\x16\x96\x39\x31\xf0\xf3\x4c\xf4\xe2\x42\x29\x76\x1f\x14\x43\xa2\x64\x88\xe9\x89\x24\x1c\x6e\x95\xe1\xc5\xc5\x7b\x35\xd9\x90\x1b\x57\xfc\xb8\xe3\x5d\x7d\xdc\xed\x5e\xe8\xe5\xfa\xb8\xdd\xb8\xb2\x33\x2c\x01\xce\xdf\x64\xed\xa3\x7d\x1a\x83\xae\x8f\x56\x39\x58\x7c\xf4\x5b\xe7\xfa\x18\x52\x3c\xf2\x9c\x8b\x99\x6a\xf0\x58\x5a\xfb\x16\x13\x77\xb2\x8e\x17\xdb\x5b\x87\x52\x44\xca\xc8\xed\xed\xa7\xca\x7d\xb5\x7f\xbc\x1c\x51\x3d\x5a\x96\x52\x92\x12\xf5\x3d\x51\xd3\xfb\xb4\xae\x93\x54\x76\x21\x0f\x5a\x3e\x64\x27\xff\x68\xdd\x8c\xf9\x51\x6f\xd9\x8d\x3f\xaa\x44\x42\x1f\x10\x0b\xbf\xb8\x4a\x2a\x2b\x0f\x18\x8b\xf8\x74\x29\x50\x11\x8f\xfd\x21\x05\x9f\x07\x33\x28\x1f\x21\x1f\xf1\x50\x00\xfa\xb1\x4a\xcd\x0f\x92\x4b\x3c\x0e\x34\x83\xb5\xf5\x8a\xf0\x07\xaf\x6f\x4d\x5b\xec\x99\xc4\x80\x7b\xb8\x3d\x1c\xab\xf3\x07\xd4\x8e\xf9\xde\x3e\xca\x4f\x15\xeb\xe1\x36\xb0\x6f\xa1\xdf\x5a\xf0\x4f\x08\x35\x27\xf7\x08\x62\x07\x3a\xf2\xb2\x36\x7a\xe0\xcd\xf1\x53\xa6\x17\x15\xaa\xec\xab\x19\xd5\xed\x7d\xa0\x63\xbb\x87\xca\x12\x3b\x2e\x8f\x14\x8d\xa7\x21\xee\xd8\x38\xf7\xf3\xf0\x20\x6a\x26\xda\xa3\x87\x6c\x58\xc3\xda\x07\x1a\x70\xaf\xcd\x1f\xf1\xb5\x3e\x52\xf8\x4a\x50\x6a\x89\xca\x4d\xc3\x2d\x99\xa6\x61\xf0\x50\x41\xfe\xac\x65\xf4\x8b\xc4\xb0\xc9\xbb\x3d\xc8\x93\x58\x29\xa5\x84\xe9\xef\xd1\x1e\x1d\x97\xc6\xf4\xc7\xe4\xcc\xfc\x7f\xb7\xff\x9e\xfc\x4f\x94\x35\xef\x55\x19\xf1\x36\xb8\xa6\x3c\xd2\xfe\x8c\xf4\x41\xaf\x84\x24\x9a\xa4\x7c\xce\x10\x74\xce\xc1\xaf\xce\x70\x01\xa0\x38\x13\x2a\xa8\xae\xb5\xc4\xe7\x6c\x20\x04\x66\xf3\xda\xc5\x93\x30\xf6\x1a\x18\x2f\x89\x80\x41\x2e\xf4\x04\xf3\xf8\x3b\x32\xfd\x95\x0e\x65\x83\x6a\x9e\xef\x97\x45\x85\x88\x91\x4b\x82\x02\x0f\xe1\xa8\xab\xf4\xeb\xe9\x5b\x6e\xaa\x29\x2d\xb3\x92\x8c\x27\xbb\xef\xd2\x3b\xf2\x6b\x9a\xee\x83\x92\x46\x37\x1b\x63\xc8\x28\xcd\x12\x3f\xda\x11\x61\xe7\x46\x7b\xd4\x48\x93\x67\xe0\xeb\x23\x9c\xee\xb8\x8c\xe9\xb6\x81\xa5\x04\x99\xe4\x09\x03\x90\x4f\xe9\xab\x4d\x8a\xc5\x4f\xf7\x10\xc2\x4b\xf1\xfb\x20\xaa\x44\x25\x1d\xeb\xe7\x80\xe4\xed\x97\x13\x92\x03\x93\x58\xd3\x53\xcb\xff\xa3\x0e\x4d\xd3\xc7\x02\xd0\xf7\xcc\x92\x5c\x9d\x1a\x4d\x49\x1c\x5b\x0f\xc2\x2f\xa4\x4a\x14\x7d\xaa\xa7\x02\x53\x86\xb4\xa6\x69\x64\x31\xd5\x26\xa5\x26\x1f\x74\x4d\x75\xcb\x21\xcb\xb4\xf6\x92\x35\x8b\xa1\xc1\x5f\x53\x00\xed\x34\x34\x9a\x29\x01\x25\x45\x6f\x27\x04\x92\x7a\xdc\x64\xb2\x1e\x1e\x85\x76\x4a\x3d\x27\xf2\x4a\xd1\x60\xe9\xed\x9a\x22\xc1\xd6\x40\x50\x2c\x09\x5d\x62\xc7\x1d\x7f\xa5\x70\x6a\x0b\x89\x29\xed\x13\xcc\xb6\xb8\x37\x99\x03\x0e\xa1\x55\x10\x48\xff\x4d\x9b\x04\xf7\x11\x3d\x67\x20\x16\x06\xb9\xfa\xe9\xf9\x15\x52\x46\xaf\xd0\x61\x31\x48\xf6\xca\x94\x7f\x89\x34\x93\xcf\xb5\x65\xb6\xef\x93\x93\xed\x36\x21\xed\x2f\x0f\x79\x57\x66\x93\xc9\xe9\x84\xcc\x09\xae\xd4\x68\xda\x00\xa2\xdf\x45\x82\x4d\x11\x92\x31\x74\xb9\x34\x0f\xe5\x9a\xf6\x50\xa9\xca\xdb\x39\x4b\x0b\x49\x12\x00\x10\x79\x0a\x51\x27\xf7\xb0\xd5\x76\x12\xa4\x5a\xbf\x3a\xde\xca\xec\x33\x74\xae\xd9\xda\x06\x75\xdb\xca\xce\x0e\x84\xa6\xd3\x2e\xe5\x2a\x43\x63\xa0\xb9\x7e\x78\x7d\x8b\x0e\x5f\x62\x24\x34\x85\x8a\xd4\x2c\x09\x69\x57\x7b\xd2\xed\x7d\x84\x5e\xfa\x24\x3b\x59\x2b\xfd\xa1\xe5\x31\x02\x0e\x06\x43\xe6\x0a\x84\x07\xfe\x12\x4f\x73\xba\x28\xac\xc4\x0f\x13\x39\x2b\x8c\x1b\x4c\xd1\x27\xa4\x32\x4e\xa4\xac\x4d\x50\xaf\x14\xcf\x74\x42\xcb\xa5\x2f\x9c\xa6\xd1\x56\x78\x57\x93\x5b\xc6\x20\xc9\x5e\x3c\x69\x2b\x1b\x9a\x98\x1f\x04\xc4\x07\x93\x46\xd1\x95\xc7\xcf\xa1\x00\xf2\x78\x87\x81\xed\x78\x37\x8a\x3b\x49\x6c\x6a\x24\x3f\xbc\xcf\x01\xf5\x99\xc6\xf1\x9e\xa2\x72\x1f\x25\x98\x36\xb6\x8f\x3e\x4a\x43\x3d\x4d\x16\x92\x4d\x9b\x34\x99\xec\x28\xab\xd4\x9b\xac\xb1\x9c\x25\x07\x37\xa2\xbb\xe0\xa5\x8d\x1a\x35\x79\x36\x36\x58\x2e\x0b\x8c\x02\x29\x14\x9f\x52\xc8\x1d\xbd\xa5\x93\xf4\x9e\xd8\xfa\x8c\xf5\x8e\x60\xe1\x58\xaf\x7f\x64\x99\x10\x61\xe8\xd8\x87\x37\x0e\xc3\x13\xd2\x90\xac\x9b\x0d\x1d\xb5\x0b\x32\x85\x46\x11\x90\x34\x91\xda\x44\x8d\x9f\xda\x49\x5b\x50\x60\x8a\xff\xee\x98\xde\x21\xca\x21\xb1\xb4\x91\xa9\x30\x86\x66\x31\x45\x97\xfc\x1b\x32\x38\x89\xf9\x69\x10\xf2\x46\xd2\x50\x42\x36\xdd\x75\x57\x09\x50\xad\x49\x09\x86\xc8\xe6\x87\x90\x1a\xd5\xaa\x6a\x30\x9b\x80\xa2\x5f\x39\x56\x37\x35\x10\x62\x61\x6f\x19\xb2\x90\xfd\xba\xad\x97\x40\x75\x23\xc8\x22\x7c\x04\x28\xae\xb5\x6a\x8a\xdf\xd5\x97\x74\x63\xd6\x2c\xf9\x20\xc8\x30\x85\x5b\xc2\x88\x09\x9e\x9d\x20\x3e\x31\xcc\x1f\x3f\x78\xc0\x42\xa7\xc4\xd1\x87\x40\x44\x47\x75\x9f\x0e\xc7\x08\x3c\x53\xa7\x29\xff\x79\x6f\x17\xf2\x08\x4a\xc2\x32\x38\xce\x4a\x58\x06\x4f\xe1\x11\x7b\xcd\x98\xaf\xd0\xd3\x70\x59\x27\x25\xee\xba\x6b\x26\x58\x33\x92\x75\x2a\x21\x71\xe4\xb1\x2a\xff\x35\xd6\xb0\xde\xdc\x34\x53\x4a\xd8\x80\x0d\x88\x1d\xa0\xbf\xa3\xed\xd3\x4b\xf5\xb0\x41\x09\x55\x23\x63\xdf\x09\x7b\x94\x83\x0a\xef\x7e\x97\x70\xaa\x5e\x73\x3a\xd4\x4e\x6b\x79\x68\xa5\x74\x0f\xc6\x6c\xad\x92\xd7\x4e\x23\x3b\xa6\x63\x0c\x8b\x01\xf6\x89\xdf\x2d\xf2\x67\x98\x8d\x3c\xfa\x9c\x37\x32\x98\xb4\x80\xfc\x3a\x36\xa9\x5a\x92\x42\x13\x48\x52\x7c\x3c\x49\xf2\x5c\xce\xa0\x3e\x85\xf4\x80\x5d\xf0\x89\x20\x64\xa2\x10\xe8\x91\x3a\x18\x6a\x9e\x53\x00\xbc\x62\xef\x1b\xf9\xc2\x53\x80\x19\x2b\x30\xbb\x29\x91\xac\xe8\xce\x37\x3a\x7a\x5b\x69\xd8\x6e\x48\x83\x49\x77\x76\x7c\x25\x21\x89\xc0\xf9\x8c\x38\x81\x87\x69\x47\xc8\xd4\x49\x93\x49\x3c\x20\x03\xf1\x7e\xa7\xa8\x9b\x30\x04\x95\xa6\x15\xcc\xbb\x79\xa2\x35\x5c\x67\x47\xb7\x7d\x11\x90\x6a\x96\xcf\xe9\x75\x24\xc3\x7e\x88\x47\xfd\x4f\xa5\xb6\xd7\xb7\x8f\xa9\xca\x16\xd2\x58\x6b\xd8\xb4\x8c\x29\x8c\xe6\x0d\x31\xb3\x15\x80\x5f\x19\x84\x11\x36\xfe\xe8\xc1\xa5\x96\x43\x94\xe5\xbe\x12\xe5\xa1\x40\x58\xcb\xbb\x44\xa0\x4e\xca\x3b\x59\xed\xaf\x36\x01\x12\x51\x92\x91\xb9\xdb\xcc\xde\x1b\x6d\xc5\xa8\x10\xa5\x83\x35\xf2\x0f\xa0\x1d\x25\x1d\xa2\x7b\xd5\x9a\xbc\xee\xd2\x8c\x0a\x19\x92\x3b\x36\xa6\x08\xd0\x8d\x2e\xc2\x2e\x95\xa5\x0f\x89\x7a\xd6\x6d\xb9\x42\x49\xe9\xd6\x8a\x8d\x99\xe2\x03\x23\xfe\x56\xc4\xff\x95\xcd\x35\xb4\xfa\x51\xec\x10\x90\xc5\x1b\x7a\xe2\x94\x67\xaa\x78\xb7\x78\x84\x8a\x3c\xbe\x27\x8f\xab\x88\x94\x74\xa3\xba\x74\x4b\xf3\x4c\x3e\xc2\x22\xdd\xad\x16\x31\xe8\xa1\x95\x3d\xe4\x9f\xf8\x00\x5d\xf0\x29\x54\xa3\xd2\xfe\xe9\x68\xe2\x7f\xd3\x26\x41\x1d\x08\x38\x4b\x7b\xa6\xf5\x29\xdd\xa1\x7e\x43\xec\xe8\xc3\x9e\xb6\x75\xe4\xc0\xf2\xf5\x38\xdb\xe0\xec\x39\x02\xde\xb9\x8a\xc6\x2f\x76\x95\x8b\x22\x80\xa4\x6d\x07\xb4\xcf\x7a\x7e\x08\x90\x40\x4a\x99\x7a\x31\xd5\x6a\x55\xff\xfa\x5c\xc5\x09\xaa\xa3\x3c\x81\xc4\x77\x6a\x5b\xe4\x1f\x63\x10\xce\x56\xfa\x2f\x42\x66\x59\xa7\x6e\x12\x8f\xaa\x57\xe8\x3b\x39\x61\x5f\xff\xdd\xd9\x24\x0d\x35\xb2\x91\x91\xa3\xcf\x63\x97\x6b\xe7\x70\xc3\x20\x65\x71\x60\xad\x71\x05\x08\xcf\x5a\x5b\x90\xd0\x52\xcd\x21\x21\x95\x15\x1c\x87\x43\x05\xb5\x9b\x90\x54\x21\x59\xa9\xa1\x9b\x1e\x0c\x60\x65\xa0\x5c\xef\xdc\x2f\x18\x1e\x3f\xf6\xb4\x26\x4a\xb3\xdb\x22\x5f\x87\xd5\x3a\x9c\xbc\x9a\xd5\x27\x2c\x89\x24\x08\x95\x4e\x69\xf4\xac\xc9\x05\x85\xb3\x52\xf0\x87\x55\x1a\x05\x00\x3f\x8e\xab\x2f\xe9\x25\x5c\xd3\x1a\xb2\x52\xc8\x6a\x02\x73\x90\x0b\xa3\xc6\xe4\x43\x81\x34\x8e\x5f\x43\x69\x6a\xb2\x06\xcc\x94\x86\x80\x59\x7f\xb5\x42\x03\x7a\x70\xc1\x38\x7f\x2b\x40\x1e\xf7\x29\xdb\x41\xaf\x5d\xd8\x2f\x0f\xb3\x12\x15\x5d\x1b\x6a\xd5\x6f\xcf\x57\x96\xb4\x93\x7a\x39\xd6\x23\xfa\x16\x09\x2d\x35\x8c\x44\xb9\x59\xfb\xa9\x3c\x31\xd7\xd8\xad\x05\x29\xe5\x30\x64\x65\xf8\x0c\xd1\x07\x1f\x5c\x36\x43\xc2\x4f\x7f\xa8\x3d\x08\x8b\xdd\x84\x53\xbb\x3c\xab\x52\xab\x87\xb0\x01\x19\x5c\x40\x51\xab\x46\xf1\xc2\x0d\xfa\xd7\xe8\x70\x3d\xd9\xeb\x00\x62\x02\xef\x90\x7b\xca\xc9\x20\xad\x76\x1b\x91\x46\xe5\x83\x6c\xd1\x50\x6a\xcb\xb3\xae\xe2\xc1\xea\x22\x4b\x56\x0a\x7a\xb4\x3c\xbb\xf5\xfb\x2f\x75\x4a\x07\xcf\x30\xd1\x55\xe9\xb9\x59\x3f\x57\x04\x2b\x9f\x15\xe3\x51\x41\x79\xe1\x66\x49\x41\x43\x03\x2a\x43\xd7\x7a\x40\x3b\xc6\xd6\x7f\x40\xab\xe5\xb7\x59\x8a\x55\xa0\x66\x84\x90\x53\x83\x60\x40\x6c\xc7\x29\x27\x2b\xf7\x28\xcb\xa8\x13\xb5\x95\xd1\x6e\x88\x47\xf1\xb7\x18\x98\x6e\x09\x43\xb9\x1d\xa9\x14\xab\xda\x10\x03\x32\x68\x48\x85\xf2\x1f\x20\xbb\x76\xd0\x2e\xd6\xad\xa2\xeb\x28\x37\x85\xf3\x8b\xfe\x1f\x9c\x15\x47\x5d\x71\xea\x9a\x9b\x27\x18\x40\x7c\x2a\x8d\x8c\x4a\x0c\xdd\xcd\x7e\x40\xc4\xfc\x5f\x05\xaa\xae\x9b\x05\xfd\x18\xad\x1b\x58\x3e\x43\x78\xea\xc9\xd1\xc4\x90\xa6\xc4\xae\xf1\xa0\x09\x5f\x0c\x94\xf9\x6b\x87\x12\xf7\x53\x1f\x31\xe2\xff\xfc\xa1\xd4\x62\x86\x50\x7a\x98\x25\x26\xe5\xaf\xa0\x4f\xe2\x1a\x4a\x2f\x8d\x6e\x6c\xac\xc1\x0e\x0f\x62\xa7\xcd\x4b\x12\x74\xd2\xcd\xcc\x36\x24\x28\x32\x27\xd7\xe7\xe8\x59\xc3\xe0\x61\xea\x56\xa6\xf3\x50\xba\x7a\x3a\xd7\x60\x98\x27\x98\xf1\xbb\x9c\xd4\x69\x95\x53\xe2\x7f\x3d\x83\xca\x5e\x78\x5f\x8f\x94\x3d\x91\x20\x61\x54\xb7\xb2\x23\x92\xda\xff\x29\xc0\xe3\x88\x8a\x52\xae\xd1\xfc\xbc\xb9\x9b\x74\x67\x31\xde\xa2\x5e\x55\x53\x96\x3b\x8c\x39\x39\x6b\x25\x9d\x30\x3c\x6e\xe9\x50\x1d\x74\x29\x74\x87\xe6\x3d\xc0\x53\x24\xe0\xa4\xfc\x0d\xa7\x3b\x86\x72\x15\x3c\x6e\xa8\x51\xb5\x5f\xdd\xfa\x05\x99\x7a\xa7\xca\x2a\x71\xad\x67\x57\xa7\x72\x05\xad\x55\x22\x5a\xd3\xcd\xdf\xb3\xc7\xbc\x83\x13\x8d\xf4\xf6\x58\x07\x83\x2c\x49\x1b\xcd\xaf\x8f\x22\xbe\x10\x38\x96\xa7\x80\x77\xd4\xec\xc5\xa2\xe9\x0d\x04\x71\xfc\xbc\xeb\x26\xab\x4d\xfb\x61\x6c\x4d\x60\x17\xd7\xd1\x53\xd3\x95\x2e\xac\x19\x36\xc5\xf6\xf6\x31\xe9\xca\x86\x91\x9c\x0b\x4a\xc1\xf6\x4e\x98\x34\xd0\xf1\xe0\x92\x3a\xe9\x21\x2c\xde\x49\x49\xe5\x62\x34\x15\x2a\x3a\x27\xcb\xd8\xf1\xd9\x6f\x14\xe4\xd4\x98\x6c\xeb\x0a\x5c\xbe\x1d\xda\x6c\xff\x36\xd2\x40\xa6\x9b\xbd\x85\x17\x89\x97\x5f\x1b\xe7\xaa\xf1\xf9\xde\x0f\x8e\x71\xbe\xf7\xe0\x8d\xd5\xb7\x90\xee\xf4\x75\xee\xb8\xff\x92\x6f\x51\x38\xc8\x80\x7f\x56\xdf\xc8\x24\xff\xb2\xe3\xf2\x85\x8d\x12\xbf\xef\x6f\xb6\x4e\xb1\x1f\x38\x4b\x40\xdd\xfe\x6a\xec\x07\x73\x99\x90\xe6\xfa\x55\x91\xdf\x41\x24\xd8\x2f\x98\x22\xfe\x40\xbf\x90\x37\xf5\xe9\x1d\xe4\xb9\xb1\xfa\xfd\x26\xce\xdb\x7f\x45\xf1\x80\xc9\xa9\x44\x0b\xbf\x1e\xb6\xe7\x21\x06\x46\xd0\x01\xf6\xec\x7a\x5c\x36\x94\xf2\x00\x9c\x01\xb6\x08\x9f\xca\x18\xe8\xa7\xf2\xe3\xfb\xf0\x0d\x87\x88\x17\x65\xb9\xd8\x9e\x7e\xec\x83\xe3\x5c\xf1\x27\x51\x13\xf9\x03\x3f\x14\x55\x58\x1f\xab\x7b\xb0\xd7\xdb\x3e\xc0\x9d\xa5\x75\x5e\xd4\x97\x7a\x47\x46\x24\x00\x3f\x6c\x43\xa1\xe4\x54\xeb\x1a\x03\x7a\xe0\x47\xd3\x06\x5d\x0c\xf4\x6d\xcf\xeb\xcf\x7f\x99\xa1\x07\x3e\x28\x1e\x6b\xed\x00\x55\xc0\xc2\xbd\xfe\xa4\xb3\x65\xdd\x0e\x4d\x24\xbc\x5d\xd3\xe5\x24\x0a\x65\xcb\x77\x39\xbb\x34\xd7\xb9\x97\x1c\x2a\x5c\xe7\xbf\x82\x5c\xec\xe0\x18\xfa\xe9\x81\xc1\x9a\x60\xe5\xb1\xc0\xf5\xec\x2a\x5e\x6a\xc1\x80\x20\xf9\x1d\x67\x5e\xbb\x4a\x54\x59\x15\x7b\x7a\x33\x95\xe1\xec\x50\x82\x6f\xb6\x30\x93\xcf\x0d\x94\xd7\x7f\x56\x4b\x21\x0f\xb1\xb5\x2e\x23\x16\x3f\x3e\x9c\xe7\xdf\xe2\x86\x41\xe4\xeb\x1f\x61\x04\x1b\x9e\x46\xb6\xc3\x1b\xe2\x09\x62\xfc\xbe\x4b\xd2\xc5\x48\xe8\x81\x52\x5f\x97\x50\x96\x00\x81\x63\x7f\x49\xde\xb3\x9c\x0c\x21\xce\x65\x0d\x4b\x16\x0c\x92\x19\xb0\x7f\x97\xef\xde\x83\x06\x8a\xd8\x9e\xe1\x08\x74\xbf\xa5\xea\x0a\x6d\xaf\x39\x24\x3f\xde\x9e\xf6\x45\x44\x35\x17\x2b\x9f\x7d\xcd\x24\xb0\x1e\x5e\x94\xc8\x52\x34\x78\x46\xe2\xdd\x9b\xa1\x6e\xd2\xac\x6d\x41\x13\x7d\xef\x90\x6f\x31\x30\xf5\x4b\x98\x1b\xdd\x0e\x80\xfa\xe4\xce\x3b\x67\x86\x21\x00\xb8\x4f\xe4\x94\xbf\x43\x9d\xc7\x80\x0c\x2c\xde\x49\xda\xae\x6f\x69\x79\xbf\x21\x7e\xc8\x9b\x6e\xb5\x7c\x17\x07\x87\x72\x58\x1c\x04\x61\xd6\xe8\xd2\x62\x92\xbc\x4a\x11\xcc\x3e\x6a\xaa\x90\xad\x92\x0d\xe3\x7b\x90\x7e\x3c\x1a\xc3\x12\xad\x7b\x85\x4c\x57\xad\x90\xb3\xf2\x55\x75\x77\xbf\xac\xdd\xb1\xb2\x47\xa0\x02\x86\xec\x9c\x4b\x58\x5a\x5c\x4c\xc5\x85\x2a\xd8\x7f\x2e\xf5\x75\x29\x6c\xfa\x2a\x55\x89\x1c\x2f\x25\x38\x58\x39\x16\xb7\xe3\xa1\x16\xd8\xee\xd7\xe8\xc3\x84\x2b\x05\x6a\x72\x3f\x7a\xe1\x3d\xe4\x10\xfc\x85\xee\x6d\xa2\x7c\x0e\xbc\x90\x37\xaa\x7a\x7d\x76\x96\x88\x17\xac\x12\xfa\xb2\xeb\xcb\x1e\x83\x74\xab\x47\x59\x7c\xbe\xc2\x83\xc5\x23\x15\x6c\x2f\x5e\x39\xcc\x19\x5f\xf9\x2f\x49\xbf\xe8\xd5\x99\x7f\x44\x00\x29\xec\xb4\x0c\xc9\x81\xea\xd5\xe9\x7c\xd6\xbd\xf0\xb6\x1d\x99\xfd\x69\x26\x98\x3f\xa1\x63\x66\x98\x89\x94\x40\xec\xd8\x3a\x52\xbc\x07\x5a\x60\xe5\x45\x37\x1e\xd7\x08\x7b\xc5\x7b\x49\x69\x31\x7a\x4b\x11\x2f\xb5\x96\x58\xc0\x28\x73\xe1\x82\x94\x4d\x5c\x2a\x4c\xc7\x54\x9e\x89\x83\xfd\x67\xb4\x09\x0d\x31\x74\x3a\x28\x8e\x86\x39\xd4\xcc\x63\x90\x7d\xf4\x4a\x4f\x1e\xea\x86\xe8\xe4\x75\x62\x7c\x41\xe1\x30\x07\xfe\xa4\x7b\x56\xc7\x45\x21\xed\xeb\xe3\x0f\xe2\x7a\x7f\x44\xf4\xb9\xde\x75\x0b\x1d\xaf\x77\x9d\x29\xfc\xe4\xd1\x05\x4e\x93\x41\x38\x8c\xa2\x59\x77\xfb\x59\x0f\x5e\xb7\xc2\x2a\xd6\x27\x5e\xf8\x5f\x06\x59\x2f\x9c\xd0\xdb\xf4\xeb\x46\x7a\x28\x95\xc9\xe0\x4c\x1f\x32\x50\xa7\x07\xd8\xfc\x96\x5d\x4e\x28\xa5\xda\xd7\x3d\x48\x3f\xac\xba\xb6\x3d\xcf\xd2\x98\xb0\x74\x79\x37\x8b\xdb\xe9\x1f\x52\x94\xb9\x64\x0a\x6e\x65\x6a\x2e\xde\x0a\x31\x32\x3f\x4f\x93\xc7\xb1\x0b\x89\x9d\x6c\x13\xaf\x5a\x25\x39\x65\x4d\x8c\x54\xba\xea\x2e\xc2\xc2\x55\xb7\xa5\x44\x76\xe5\x05\x29\x2e\xef\xf2\x44\x6f\xeb\xf2\x46\xc9\x4f\x56\x25\xd2\x6b\xc3\x07\x1f\x22\x5c\xa5\x51\x05\x6c\x3f\xa5\x58\x70\xf9\x4c\x8b\x2a\x1a\x88\xa6\xf0\x6b\xbc\x0a\xb4\xb9\xa9\x4b\x36\xdf\x3f\x09\xb0\x56\xf7\x2e\xfb\x85\x34\xd7\xed\x3f\xe9\x7d\x79\x29\x73\xeb\x8b\x46\x5d\xfe\xd0\x30\x3d\xa5\x43\x76\xcf\x8a\x0b\xf3\xba\x04\xf1\x9d\x5f\xdd\x67\xdb\x50\x76\x89\xb7\xac\x34\x81\x2b\xcb\x3f\xc4\x80\x77\x57\xae\xf4\x71\x23\xec\xcb\xfa\xe6\xfe\x44\x9d\x4f\x7f\xc6\x3f\xa1\xf8\x41\xf5\xae\x76\xce\xda\x40\x9c\x5e\x00\xbf\xc0\xd4\x2f\x25\x29\x6e\x6a\x20\xde\xb3\x54\xd4\x4e\x5e\xc9\x53\xf2\xaf\x9e\x7f\x0b\xf9\x24\xa6\x8a\xdb\x98\x80\x9a\x5f\xdf\x4f\x70\x1a\xcf\xef\x3b\xb9\x26\xfb\xf9\xad\x47\x17\x21\xfa\xb8\xcc\x90\x14\xc0\x10\x94\x6e\x8e\x4a\x44\xdf\x0d\x52\xd4\xc5\x5a\xbe\x36\x32\x07\x0b\x98\xca\x2a\x48\x97\x95\x3e\x8d\x35\x7d\x97\xfe\x9b\x69\x89\x6f\x40\x89\xc6\x50\x19\xfb\x72\x55\xa2\xa8\x03\x71\xd8\xaf\x19\x94\xdc\xc5\xf9\x66\x3e\xd1\xf9\xca\x1e\xd0\x3a\x5f\x4a\x2c\xe1\x2e\xb4\xa9\x3f\x6f\x30\x91\x1c\x1c\xd4\x28\xb9\x69\xef\x44\xc1\x31\x85\xbb\xb0\x20\x81\xab\x7b\x2d\x54\xcd\xfa\xf8\xa2\x7d\x95\x91\xa7\x6a\xf8\xe0\x8d\xb2\xef\xcd\xad\x90\xce\x2b\x64\x46\x0c\x65\xeb\x04\xfc\xdd\x99\x3e\xf9\xb6\x1c\xe1\x0a\xc2\x55\x68\x5e\xa5\x8c\x75\xeb\x5e\xd8\x47\x78\x85\xec\x17\x47\x8d\x2e\xae\x19\x22\x5d\xad\x2a\x9b\x9e\x3a\x65\x14\x62\xc3\x67\x46\xf1\xa3\x4b\xf5\xb1\x83\x90\x1f\x93\x84\xcc\x85\x94\x05\x82\x83\x8e\x4c\x86\xea\xc5\x9f\x55\xd9\x01\x85\x58\xd9\xd5\xe7\x1f\x6d\x29\x04\x7b\xae\x9a\x55\x4b\x58\xad\x1e\x3a\x4a\x57\x91\x80\x59\x89\x04\x03\xab\x21\xf8\x1d\x1b\x78\xe7\xae\x37\x16\x37\xc5\x9a\xdb\xa5\x71\xf6\x12\x43\xb6\xae\xd7\x63\x6d\xcf\xa1\x87\x68\xf0\x77\x7a\x90\xee\xf8\x23\x22\x80\x04\xb4\xf0\x57\xd8\x28\x3e\x94\xd2\xd2\xae\xe4\x6b\x57\x0e\xcb\x02\x45\xc2\x44\x57\x30\x44\x20\x20\x86\xe2\xff\xee\xc2\x5e\xa8\xeb\x81\x49\x77\x07\x90\x91\x1c\xc0\x2e\x61\x03\x05\x03\xd5\xa0\xe7\x51\xa8\xe6\x60\x80\x3e\x90\xe7\xa1\xf4\x05\x03\x92\x21\x3b\x72\x88\x8a\x65\xf1\xc7\xdc\xbc\xc9\xef\xc4\x91\xe8\xef\x0a\x10\x67\x4d\xae\x53\x41\xa8\xf7\xea\x48\xa5\xe7\x68\x9f\xf5\xd6\xa5\x7a\x66\x33\x15\xc7\x44\xe8\x3e\xd9\xc1\xb2\xa2\x48\x82\xac\x79\xc7\xff\xac\xff\xe7\x83\x61\xd8\x85\x70\x03\x29\xda\xc1\xad\x43\x69\x7b\x67\x65\x52\xf0\xb9\xdd\xa1\x21\xb5\x9d\xd2\x44\xda\x44\xd3\x76\x10\x3a\x59\xc2\x45\x58\x12\x4d\x9b\xcb\xc6\xfa\xf5\xad\x37\x67\x1a\xc0\xc4\xe7\xee\x6b\xed\x2a\x66\x3d\xc9\xe5\xb4\x1e\x8b\x74\xd2\x0c\x65\xad\xd2\xab\xba\xa6\xa7\x5e\xa3\x35\x51\x61\xfc\x84\xa5\x32\xbf\x10\xd8\x23\x1f\x52\x3c\x2b\x24\x6e\x9c\x7f\x35\x94\x67\x0d\x06\xd1\xfb\x2c\xaf\xc6\x1b\x65\x03\x54\xbf\x1f\x50\x8e\xf7\x32\x0c\x11\x4f\x44\x02\xf9\x63\x5d\xfa\x8c\x80\x97\x6f\x25\x77\xb2\x51\xf6\x49\xcd\x6a\xe8\xfe\xa8\x1b\x6a\x90\x5a\x49\x65\x55\x72\x24\xc5\xd1\x66\x3d\x0b\xeb\x7b\x71\xb2\xc6\x3a\xb5\x2d\xae\x27\xff\xc3\xf4\xe7\x12\x15\xcf\x18\xec\xb7\xd2\x73\x3e\xac\x44\xae\xa7\x23\x19\x4f\x9e\x73\x7d\xe9\x45\xb1\x13\x5c\x0c\x6d\x60\x22\x47\x07\x28\x1f\xcf\xbc\x77\x5d\xb5\x42\x53\x29\xc4\x47\xd5\x7b\x3c\xe7\xcc\xff\xe6\x50\xdb\x9b\xb3\x06\x2d\xc8\xfc\xf0\x2e\x03\x26\x60\xf9\x4e\xce\x69\x29\xdc\xc8\x7a\x36\xce\x96\x82\x36\x5a\xe5\xaf\x86\x0b\xa5\x56\x75\xef\x49\x24\x94\x7a\xc8\xe9\xcc\xb7\xe4\xc9\x6e\xf9\x10\x22\x7e\xf7\x51\xa9\xd7\x23\x37\xb6\x68\x50\x4f\xcb\x1d\xf0\x07\xe5\xc6\xd4\x14\xab\xa9\x4f\x38\x41\x13\x52\xc2\x0d\xc6\x30\xac\xb9\xf3\xa6\x8d\xb6\xc4\x8b\x82\x12\x1c\x3f\x4c\xb4\xb5\xf1\xdd\x61\xd0\xe7\x65\xc8\x8e\x59\x85\xc2\xd7\x2b\x43\x71\x2d\xd6\xc1\x66\x53\x30\xb4\xbe\xb2\xb2\x28\xce\x9c\x94\x2b\x72\x4a\xa9\x02\xe5\xaa\x92\x6a\x93\x98\x03\x96\xe2\xd6\x58\x63\x36\xe0\x74\xb7\x1c\xae\x84\x78\x9a\xd2\x2a\x99\xd5\xde\xa5\xd1\xde\x9a\xb7\x83\x60\xda\x1d\xe0\xf8\x09\x8e\x21\x7d\xb4\x2b\x96\xf1\x2b\xb0\x72\x0a\xed\xb1\x7b\x08\x7d\x31\x68\x23\xc5\x76\x5d\xab\xd2\xe5\xd1\xfa\xcd\x70\x21\xb4\x59\x82\x75\x58\x08\x7f\x56\x5f\xe8\x7b\x43\x43\x41\xa8\x76\x14\x23\x2f\x60\xf2\xc5\x1d\x95\x21\x14\xd7\x36\xd5\xe4\xa1\xa1\x46\x5c\xf6\xd8\x16\x52\x82\xfb\x33\x70\x96\xbe\x5a\x59\xaa\x74\xe7\xec\xf5\x64\xb8\xcd\x8d\xc8\x8f\xbe\x6d\x7f\x5d\x01\x25\xa1\x96\xb7\xae\x1c\x67\x0f\x7b\xa6\x85\x04\x16\xa6\xfe\x7b\xac\x53\xaf\x53\xa4\xc7\xa3\xd3\x1f\xb8\xd8\x1f\x44\xea\xdb\x87\x8a\x3d\xd0\xa3\x06\x78\x10\xec\x91\x01\x7f\x8e\xd4\x93\x3a\xd3\x27\xde\x09\x38\xd5\x7a\xf9\xbf\x2e\xd2\xf6\x92\x7e\xd9\xcb\x67\x65\xfd\x60\x1a\x75\x9d\xb0\x48\xf0\x12\xd3\x7e\x0e\x76\xef\x10\xee\xc4\x53\x64\x1f\x9d\xf0\x2b\x62\x35\x85\xf8\x9e\x3a\x2d\x08\xf1\xf1\x64\x36\xd2\xe4\xbb\xe0\x93\x9d\x94\x44\x5b\x59\xed\xdb\x98\xe4\x0a\xf5\x37\x0d\x08\x01\x36\x5e\x9b\x73\x22\x05\xd7\x38\xd7\x80\xb0\x3b\xeb\x3d\xeb\xed\x5d\x21\xf0\x99\x42\xe8\x0d\x96\x06\x38\x6f\xfb\x4c\xdf\x70\xcb\x6c\x9f\xc1\xab\x1d\x2b\xd5\x2d\xc4\x74\x3c\x6b\xcf\x66\xbd\x29\x4d\x2a\xb7\x5b\x9a\xf4\x90\x5a\x63\x86\x0a\xd4\xd4\xa4\xd6\x05\xc4\xd2\x0f\x75\x0f\x1f\xef\xff\xb6\xfa\xf1\x08\x6c\xab\xff\x8b\x96\xb7\xd5\x9b\xdd\x0c\x03\x9b\x67\xd6\xf9\x9d\xf8\xc7\x28\xb6\x49\xcf\xc1\x45\xcd\x72\x80\x61\x65\xca\x1a\x16\x14\x90\x31\xa8\xc0\x40\x0b\xc7\x21\x00\xaa\x98\x59\x5b\x2f\xd6\x8e\xb5\x24\x85\x87\xd9\xf8\x15\xb7\x6e\xa7\x02\x89\x34\x0a\xcb\x21\x3d\x7c\xe4\xd6\xcf\x99\xca\x44\x86\x18\x2d\xb0\xce\xd9\xc5\x6b\xa4\x9e\x58\xb5\x66\x2f\x36\x96\x51\xb9\x81\x10\x48\xb3\x57\x57\xa5\xf4\xd4\xa6\x3c\xe7\x24\xc9\x2d\xa8\xe1\xef\xbf\x5b\x81\xb9\x16\x5d\x88\x86\xd7\xd0\x42\x68\x13\x0f\xa9\x7a\xcb\x00\x26\x03\x6a\x48\xbd\x0d\x89\xf9\x58\xa0\x06\x54\xa6\x72\x03\x52\x3f\xab\xf7\xd2\x61\xb3\x2b\xc1\xae\x72\x4a\xd0\xb7\x95\x83\x3b\x52\x83\xcd\x06\x0d\x90\xb7\xde\x28\xc4\xb6\xbb\x3c\x3b\x77\xdd\x25\x85\xa6\x57\x12\x56\x67\x67\x90\xc1\x99\xe3\xdb\x65\xd3\xdc\xe1\x0b\xd5\x4a\xa1\x12\x5b\x7f\x38\xee\x79\xdd\x9f\x81\x96\x78\xd7\xe6\x4a\xf1\x37\x77\x64\xf1\xdf\x9a\xef\x2b\x94\xce\xce\x43\x32\xd7\x56\xb0\x8f\xd0\x22\x5d\xb3\xfd\xc3\xcd\x01\xee\xe2\x6b\xb1\x6f\xe9\xb1\x1f\xe0\xaa\x72\xc9\xff\xec\xf4\xd0\xc5\xc6\x72\x57\xb3\x43\x9a\x26\x55\xf9\x90\xa5\x59\xf4\xff\x99\xe7\xcd\x7c\x24\xcc\x62\x6e\x79\x94\x9a\xda\x90\xa9\x80\xda\x94\x40\xe3\xf0\x4d\x01\xb3\xfb\x92\xa2\xd9\x0d\x5e\x0a\x11\x1e\xbe\xe4\xfe\x30\xdf\x22\x3d\x3f\x1b\x0c\x4a\x4f\xed\xb8\xf5\x1a\xa7\xa3\x1e\x0c\x84\xb8\x1b\x2c\x7d\x3b\x30\x77\xd5\xb9\x56\x4d\xcd\x8d\x3d\x3f\x70\x4c\xe9\x0d\x00\x75\xb5\x2a\x36\xb1\x75\x1d\x78\xa8\x12\xba\x23\x2e\xa2\x16\xc9\x67\xe8\x0b\xef\x61\x05\x6a\x7d\x2c\x4d\x14\xa1\xb7\xe5\x03\x4e\x37\x1c\xcc\x5a\xb5\x96\xd0\x4d\xbb\x2e\x51\x16\x80\xf5\x6f\x4d\x29\x19\xa0\x6e\xd2\xdd\xc2\x36\xc6\xe0\xc1\x66\xe1\xb0\x36\x21\x80\xde\xd0\xc3\x13\x1a\x58\xff\xdb\xa0\x4d\xe5\xcd\x01\xb9\x01\x1f\xa0\x1d\x50\x65\xdc\xd9\x95\x3e\x30\x81\xcd\x32\x78\xd2\x87\x8b\x25\x36\xfd\xd7\x53\x85\x03\x26\x8a\xaa\x95\x17\xe3\x38\x07\x3f\x0d\x41\xcf\x7b\x3c\xe4\x42\x79\xa8\xc3\x62\xa5\x2e\x22\xf3\x12\xf2\x44\x71\xa8\xc6\xb9\xbd\x03\x72\x78\x92\x6f\x43\xb0\xd0\x2f\xa0\x5e\xa1\x31\x05\x4a\x33\xf7\x47\x44\xc5\x43\x41\x70\x42\xe3\xb4\x9a\xdd\x06\x6b\xeb\xb8\xce\x1a\x04\x0a\x38\x42\x83\x8d\xbb\x6e\x4d\x41\xd9\x03\x95\x14\x5d\x9f\x3c\xaf\x8a\x9b\xad\x88\x0e\xa9\x2f\x7a\x44\xf6\xf9\xc1\x08\xf2\xb1\x4a\x86\x4f\x4a\x6a\x40\x45\x72\xd5\xd6\xf8\x7e\xf9\xb8\x0e\x17\x57\xe7\x08\xf4\xf8\xd9\x86\x3b\xf4\x07\x6f\x28\x1d\x85\x0a\x69\xcf\x3d\x76\x7a\xee\xbd\x15\x39\xfc\x53\xe1\x06\xf9\x70\x6e\x8c\xfd\x90\x38\x22\x58\xd3\xfc\x5f\xc4\xff\x8f\xa2\x2a\xed\x88\x30\xc0\x21\xc7\xbc\x03\x9d\x53\xa4\xb2\xdc\x2f\xee\xcd\x14\x55\x8e\xd1\xb9\xc0\xc9\x66\xe8\xa7\xd9\xfb\x4a\x45\x39\x1b\x92\x30\x4e\x75\x64\xf9\x44\x50\x9e\x0c\x21\x13\xaf\xa5\x0e\xf4\x3c\xbf\x02\x89\xe5\x93\x89\x49\x98\x57\x92\x5c\x59\x93\x2e\x9d\xf3\x80\x79\xe0\xbd\x2b\xc2\x11\x72\xdf\x9d\xea\x42\x50\x50\x93\x5c\x9a\x18\x50\x47\x46\x47\x82\xff\x63\x3a\xfc\x91\x3e\x67\x95\x78\xd9\xab\xa7\x77\x1a\x66\xaf\xdc\x55\xd0\xbc\x49\x3b\xac\xfb\x72\x15\x29\x8a\x85\xfa\x9a\xdd\x1d\x3e\x0b\x7b\xb7\xe8\x2f\x64\xdd\xe6\xef\x2f\x5c\x76\xb0\x57\x04\x5d\x34\xc9\x9e\x02\x7a\x93\xf0\x9f\xa4\xd1\xf4\x30\xad\x32\xff\xe3\x1d\x4d\x52\xc3\x38\xdc\x2d\x82\xd3\xa0\x47\xd2\x53\x45\x8d\x12\x82\x7f\x29\x4c\x26\xa0\x12\x3e\x8e\x3a\xfd\x9e\xba\x6e\x1d\x8c\x95\x42\xb8\x4d\xfd\x9b\xc3\x1d\x94\xa9\x96\xd6\xab\xca\x23\x4d\x4f\x7e\x5d\x52\xee\xb6\x26\xbf\x2a\xce\x59\x5f\x9a\x3f\xae\xf7\xf5\xd6\xdb\x8a\x60\x33\x33\xd2\xeb\xc5\x6e\xa8\xa7\xd7\x76\x65\xb4\x73\x53\x19\x71\x29\xd8\xec\x8e\x12\x39\xab\x89\x1a\x68\xbb\xb4\x7a\xa0\x86\xe6\x05\xc7\xa0\xe8\xc4\xeb\xd8\x07\xb5\xca\x6d\x94\x2a\xde\x35\x22\x22\xfe\x5a\xd6\x18\x35\xd4\xe5\xf6\xf1\x75\x5d\xaa\xd3\x57\x21\x25\x20\x91\xb2\x70\x19\x36\xc0\xda\x16\x7a\x66\xa1\x0a\x5f\x3d\xf7\xcb\xab\xbc\xaa\x94\xf6\x3a\x21\xa3\xd0\xff\x39\x65\xae\xc8\x48\x5f\xd2\x2f\xe0\xd8\x1c\x19\xd8\x71\xd7\x80\xbb\x62\x3c\xbc\xdd\xcf\x99\x19\x42\xd5\x93\x3f\x88\xf7\xdb\x1f\xef\x6e\x5d\x4f\x57\xf3\xaa\xed\x47\x1a\xdd\xab\x42\x0e\x7b\x95\x5c\x5a\x0b\x0a\x09\xa0\xa2\xec\xdd\xc4\x03\x20\x69\xf3\xe4\x4d\xef\x8e\x5e\x4e\x26\x1a\x2a\xe5\xd0\xc2\x06\x6d\x2f\x3d\xce\x6a\x70\x57\x82\x3a\x94\xd0\x9a\xc7\xd1\xfb\xe2\x10\x3f\xd1\xc5\xd1\xf4\x09\x39\xa6\x97\xe3\xee\xda\x9c\xd1\xef\x41\xce\x61\x77\x12\xd8\xf3\x3b\xd2\x83\xf6\x7c\xa3\x1f\x46\x14\x77\x68\xf7\xb1\x66\x28\xe6\xee\x90\x85\x3a\x25\x72\x46\x59\xa7\x5d\x19\x99\x56\xfa\x18\x0e\xa5\x8c\x18\x76\x89\x14\xee\xff\x88\xa5\xec\x39\x85\x06\x9b\xf7\xbc\xf6\xf4\x82\xa2\xe9\x4a\xc8\x1b\x81\xee\xbe\x7f\x73\x86\xbc\x2b\x08\x77\x10\x8a\xa5\x29\x26\x0e\x10\xd3\x02\x12\x73\x95\xc8\x9a\x64\xd6\x0e\x8f\x1c\xee\x69\x73\xe5\x37\x4f\xf9\xe0\x7e\x8b\x01\xeb\x81\x50\x96\x2d\x12\x5c\xb6\x8f\x94\xac\xac\x8f\x1b\x8a\x69\x10\x5f\x0b\x6d\x25\x1b\xc7\x31\xb1\x69\xbb\xc9\x72\xd8\xee\x5a\xf8\x9f\x7d\xd2\x3f\xf6\xf4\xe0\x9a\xc5\xea\xfe\x3f\xaa\x38\xc1\x26\x7b\x15\xdd\x6f\xbb\xc3\x80\xdc\x63\x43\x94\x58\x53\x53\xbc\xb5\x9b\xea\x63\x1f\xaa\x8f\xa9\xf9\x36\xc0\x7c\xd3\xcd\x3e\xdc\x26\x6d\x35\x55\x5b\x5b\x64\xc3\x53\x49\x4d\xb3\x09\x58\xa0\x14\x19\x24\xe1\x3e\x84\xfb\x25\x37\x68\x57\x48\xfb\xde\x5b\xac\xc6\x3c\xc8\xb7\x2f\x6c\x31\xeb\xe4\x4b\xfa\xe5\x06\x07\x64\xb2\x4b\x37\xed\x4a\x6c\x32\x1c\x92\x34\x83\x40\xcf\x93\x73\x6e\x94\x58\xbb\xb8\x76\x55\x3c\x1f\x11\xae\xd0\x4c\x83\xe0\x10\x01\x1f\xfe\x56\xe3\xdd\xdb\x6a\x26\xc5\x60\x8b\xf1\xf3\x86\xcc\xac\xef\xcd\x3d\xcb\x27\x7d\x53\x87\x67\x40\x66\x00\xc3\x79\x97\xc7\x2d\x2e\x2c\xee\x7b\x63\x72\x5b\x3a\x65\x45\xa9\xd2\x5b\x59\x6d\xf0\xf2\xf2\xac\x9d\xcd\xa7\x97\x95\xed\x8d\x34\x67\x56\x20\x5b\x09\x11\x31\xe4\x4d\xab\xe6\x03\x16\x87\x1d\x30\xec\x63\x48\x9d\xd0\xb0\x80\x0b\x3f\xf4\x08\x53\x30\x2c\xea\xf6\x59\x3d\x4e\xe2\xb3\x55\xad\x0b\xc5\xd1\x9a\xf2\xf4\x88\xfc\x51\x64\x06\x8e\x10\x9f\x09\xd5\xb3\x5d\x19\x10\x5b\xd8\xc6\x6d\x88\xb3\x3c\xf8\x4f\x76\x91\xad\xe4\x45\x65\x1b\x44\xbe\x29\xd8\x36\xbe\x23\x46\xb3\xfd\x84\xa6\x46\xeb\x4c\x89\x06\xb2\x8d\x7b\xd6\xca\x5d\xfa\x63\x5b\x61\x02\xa1\xa1\xae\x75\xb6\xba\x6f\x5e\x0e\xfc\x0c\x25\xb3\x88\x2f\x6e\xe3\x72\xeb\xdf\x8b\xdf\xf5\x93\x38\x3d\xf9\x7e\x8c\x73\xd2\xe4\xc0\x36\x5a\x7f\xe0\xe0\x8b\x3a\x3e\xd7\xfa\xd3\x63\x93\xae\xdb\xf8\x08\x7b\x8f\x6d\x9c\xd2\xae\xa4\x23\x88\xb0\x31\x81\x03\x62\x6b\x94\x95\x1b\xc7\xf5\x13\x5c\x27\x2c\x14\x89\x75\x41\x6b\x6d\xd3\xa6\x3d\x3f\xce\x55\xd7\xae\x0e\xa3\xec\x7a\x71\x10\x09\xd5\x05\x02\x4a\x78\x6f\xf4\x2c\x5f\x47\x98\x4d\x5d\x57\x49\xb4\xad\xf9\xd5\x11\x33\x4f\xa1\xd1\x86\xe4\x53\x2a\x74\x7d\x64\x61\x61\x48\x63\x31\x43\xf2\xb2\xd9\x6c\x58\xc2\x5b\xee\x22\x6d\xef\x10\x64\xbb\xe6\xe2\x7c\x7f\xf8\xaa\xb7\x3d\x00\x8f\x27\x0d\xd6\xcd\x93\xf6\x78\xba\xf8\x00\x20\xd1\x56\x09\x70\x01\xbc\x5b\xc8\xf1\xda\x25\x7a\xd6\x1a\x13\xa2\x28\xc4\xa6\x93\x35\xe6\xec\xc3\x8b\x8c\xad\x34\x10\xf5\x19\x01\xa8\xbe\x67\x68\x0b\x61\xb5\x2e\x31\xd7\x86\xa6\xed\x07\xfd\xef\x08\xcd\xb9\xfd\x26\x8d\x68\x73\xbf\x43\x02\xca\xaa\x71\x57\xf4\x82\x74\x7d\xf6\xca\x7f\x25\xbc\xa6\x2a\x02\xd3\x4e\xdc\x6c\xbd\x06\xfe\x0b\x79\xe6\x8b\x90\xe4\xd5\x64\x3a\x05\xd0\xe3\xbe\x5b\xfa\x93\xd8\x1f\x94\xd8\x74\x6b\x8b\x9e\x0a\xbf\x0c\xb8\xf9\x5d\x02\x99\x67\x99\xee\x2c\xa5\x36\x64\x66\x12\x80\xa1\x10\xba\x6b\xaf\xa4\x33\x85\x53\xb6\x21\x37\x03\xd7\x2f\x50\xcf\x7a\x73\x3b\x3f\xb6\x2c\xeb\xc7\x1b\x7d\x2b\xa2\x03\xbe\xde\xd1\xb7\x33\xc4\x0c\x59\x64\xec\x51\x3d\xcb\xbe\x47\x4a\x7c\xf9\x87\x49\x65\x36\xca\x35\xac\xf7\xcf\xc9\x6f\xb5\x96\x82\x73\x9c\x20\x2b\xcc\x0c\x2d\xad\x48\x24\x67\x8d\xb6\xde\x49\x86\x70\x6b\xfd\xea\x14\x22\xed\x41\xd1\x4d\xf2\x6b\xaf\x48\x76\x59\xeb\xad\x12\x62\x80\xdc\xaa\x49\xf3\xad\x29\xf8\xb0\x56\x4e\xad\x59\xa9\x86\x0b\xda\xfd\xf6\xa1\x36\x0a\xb1\x51\x2f\x13\x06\x04\x71\xbe\xb9\x85\x04\x9c\x04\xc3\x30\x20\xf3\x43\xd8\xbd\xe3\x47\x01\xdd\xda\xfe\x9b\x8a\x34\x97\xad\x3b\xaf\x94\x4c\xb8\xfa\x67\xb6\x74\x6b\xf1\xd0\xfb\xea\x02\x92\x13\xd7\xa0\x89\x75\x79\x26\x97\x71\xf3\x4b\xb2\x8b\x0d\x42\xa6\x61\x26\xa2\xae\xe2\x59\x59\x29\xd5\x5f\xeb\x61\x3e\x39\x3f\xb2\x96\xa9\x6b\xc4\x4d\x12\x50\x95\x30\x32\xfc\x12\x9a\xb4\xd2\xf2\xe7\x64\x4d\xb4\x66\x34\xc1\x7a\x7a\x20\x61\x52\xbc\x8d\xb1\x4f\xb0\x8d\x25\xcb\x06\xc5\x38\x76\xfe\x57\x4a\xa6\x10\x15\x8a\xac\x61\x7a\x46\x65\x1c\x6a\xa3\x7a\xc9\x9a\x9f\xcf\xbe\x23\xb8\xa8\x94\x57\xcb\x6a\x33\xd7\x88\xb2\x1b\xd0\x46\xe4\x22\x40\x37\x6e\xd3\x9a\xb1\x8e\xff\xe7\x40\x79\x72\x06\xfc\x66\x42\x86\xd6\xa5\xf5\xd2\xa7\x4a\xec\xed\xdd\xa4\x95\xf6\xe6\x2c\xba\x55\xe3\x94\xb5\x53\x1e\x81\x8b\x55\xfa\x10\x57\xf7\x34\x5d\xb7\x3f\x14\xe2\x4b\x87\xb9\x68\x26\xe4\xb8\xdf\x82\xf0\x1c\x02\x5d\x89\x9b\x85\xc2\x93\x0d\x68\x5b\xd1\xf1\x38\x9b\x0e\xf3\xbc\x50\x9a\xe3\xce\x98\x47\xe6\x1d\x4f\xbb\x46\xcf\x40\xaa\x38\x5d\xdf\x47\x53\x51\x8e\x15\xf6\x72\xec\x99\xd7\xab\xfb\xad\xf0\xff\x50\x8e\xd6\x89\x37\xf8\x0b\xaf\x94\x8c\xf3\x0f\x8c\xbf\x1a\x04\x0e\xea\xd8\xfd\x85\xc2\xde\x93\x43\xa4\x3e\x76\x47\x3a\xa6\x04\x12\x53\x27\xda\xad\xd1\x56\xac\x69\xe4\x5c\x92\x01\xe8\xdb\x09\xce\x9e\xb2\x4b\x51\x3a\x5c\x00\x7c\x64\x51\xbc\x12\xcd\xd8\x00\xfe\x73\xf1\xb9\x33\xd4\xaf\x6e\x8e\x82\x96\x5b\x29\x87\xd6\x86\xf2\xf5\x59\xdc\x02\xcf\x77\xbf\xd7\x3f\xd7\xee\xba\x17\x06\x62\x97\xdb\xeb\x82\x45\x4e\x40\x56\x52\xb2\x0b\x54\x60\x09\xb2\xb5\xcf\x79\x59\xa7\xca\x6b\xcc\x05\x46\x5d\x89\x80\xd2\x73\x77\xaf\x37\x0d\xe7\xa7\x04\xe9\xec\x1d\xee\xda\x6d\x92\xb7\x5e\x9c\x4b\xe2\x27\xc1\xc8\x5d\xff\xa3\x5d\xe1\xd2\xa4\x8b\x60\xe0\xe1\xb3\x49\x0b\x9c\x00\x56\x89\xd1\x15\x89\xe9\xb9\xce\x36\x7f\x5a\x7d\x25\x7a\x9d\x02\x35\xee\x5b\xaf\xee\x87\x66\x6d\xcf\xc6\x48\x2f\x58\x1d\xd4\x9b\x63\xbf\x7f\xa1\x16\xc0\x52\xdb\xc1\x0d\x5b\x8f\x43\x2f\x15\xb2\x71\x0e\xe0\xee\xdc\xb8\xdd\xbc\xce\x99\x92\x6a\x55\x69\x7b\x8b\x0c\x6c\x08\x43\x32\x6f\xfc\xde\x3c\xfe\xc0\xfe\xfc\x82\x18\xef\x5c\x9e\xcc\x25\xc5\x12\x0a\x0c\xfc\xa4\xcb\xb6\xb3\x59\x5c\x82\x55\x4b\xd9\xba\x46\x64\x23\xa0\x2e\x58\xc7\xee\x0b\x14\xeb\x74\x52\xab\x0e\xbd\xb0\xa1\x90\x34\xe1\x56\xa4\x5b\x0a\x40\x94\x28\xc4\xeb\xec\x29\x48\x4e\x6c\x01\x31\xe2\xc8\x5d\xd5\x4e\x93\x2e\x0b\x3e\xc1\x4c\xc0\xf9\x66\x07\xff\x49\xe6\xce\xaf\xa1\xb4\xa5\x4b\xd8\xd9\x87\x18\xc3\x38\xeb\x99\x7d\x23\xd3\x0e\x1e\xa1\xd2\xb8\x73\xb6\x2e\x4a\x5e\x75\xf8\xd9\x2d\xd4\x39\x88\x14\x4b\x5b\x1c\x6f\x35\x34\x8b\xd7\xae\xdc\x3a\x77\xb9\x44\x1b\x9d\xf2\xb6\x60\x6c\xda\x9f\x6b\x99\x24\x5a\x08\x67\x28\x96\x56\x39\xfb\xbf\x7c\x54\xd9\x45\xf2\x10\x19\xa4\xdc\x1d\xe8\xfd\xac\x97\x17\xe6\xd1\xfd\x47\xc5\x3c\x2f\x76\x69\xe4\x45\xbb\x0a\x94\xa4\x86\xb7\xc3\x40\xdd\x7f\x5d\xde\x0e\x4c\xf5\xf3\x6a\xb3\xb4\xb4\xb8\x50\xc8\x1f\x5a\xe0\x36\xa8\x35\x92\xf4\x5e\x32\x05\x97\x96\x9c\x57\xe9\xec\x25\xf7\x61\x59\x22\x97\xc8\xc0\xca\x53\xe9\x94\xd6\x52\x84\xe0\x5d\x97\x0a\x24\x7d\xf0\x24\x3c\xbd\x3e\x86\x88\x1e\xdf\x31\xab\x72\x6e\x95\x08\xbf\xd9\xd8\x96\x1b\x1e\x2a\xd6\x9b\x9b\x1d\x49\x00\x7e\xd1\x21\x8c\x68\x15\x97\x57\xc7\x4b\x0c\xdc\x1d\xfc\x3f\xaa\xde\x2e\xd9\x59\x9e\x07\x16\xbd\x3f\xc3\x78\xe7\x75\x2e\x0c\x18\x70\x02\x98\x8f\x9f\xe4\x49\xaa\xf6\xdc\xb7\x5a\xdd\x72\xd6\xae\x5a\x55\x6e\x58\x04\x0c\x18\x5b\x96\xa5\xee\x85\x80\x9c\x8e\x9a\xfc\x3e\xd3\x4a\xce\xc1\xe4\x31\x27\xc1\xf4\xb7\x2c\x7f\x98\xe0\x9f\x21\xfc\xfc\x4c\xa3\xbe\x73\x2d\xdc\x3e\x53\x17\xf7\x92\xca\xec\x7d\xdd\xe3\x66\x7b\x79\x54\x17\x26\xe5\xeb\x79\xd4\x07\x3b\x58\xf0\xf1\x69\x15\xe5\x51\x07\xb1\xf6\xa5\x9e\x52\xd3\x8f\xb2\xc5\x02\xd6\x03\xd3\x5f\x52\xf9\x79\x08\x87\xb7\x88\x47\xa6\xa7\xe0\x61\x13\x30\x72\xf0\x65\xbb\x6b\xf9\xd3\x80\xa7\xa0\xc4\x7e\xa4\x77\xd0\x17\x3d\x40\x95\xe1\x4d\xdc\x7a\xf1\xe3\xa3\x52\xc3\xa9\x43\x7f\xce\x60\xf8\xbb\x78\xd4\x56\x79\x8a\x4d\xaa\xed\x86\xa4\x55\xfd\x48\x4b\x65\x4d\xcc\x02\x1d\xf8\xbf\x89\xf7\x95\x7a\x0f\x68\x71\xc8\xc9\x53\x79\xd3\xfd\x0c\x35\x41\xf6\x07\x66\x53\xfb\xc1\x88\x4b\x67\x63\x28\x27\x5d\x2e\x56\x9a\xf5\xe8\x68\x73\xde\x79\x47\x63\x7c\x83\xa5\xa3\xcf\x69\xfe\x88\x4e\xee\x23\x02\xbb\x8f\xc7\xb9\xfa\xae\xb7\x3b\x11\x66\x4f\xbb\x0e\x92\x3a\x6c\x84\x0e\xdb\xac\xd0\x90\xf9\x3e\x16\x28\x0c\x9c\x8e\x23\x4e\x6d\x76\xcb\x32\x7e\xb6\x9c\xfc\xc5\xa2\xed\x39\x38\xcb\x6e\xf9\x7d\x0d\xc0\x04\xe0\x39\xc6\x71\x0d\xb9\x88\x19\xce\x0a\xef\x0e\x67\xeb\xe5\xeb\x8b\xaf\x60\xae\xef\x41\x7c\x80\x8d\x54\xdf\x8c\x07\xf7\x14\xc3\x88\xb0\xcf\x88\xbd\x23\x36\x48\xdd\xa7\xbc\x5f\x9b\xc3\x50\xd8\xc3\x40\x4c\xd6\xe7\xba\x93\xd3\xad\x56\x95\x9b\xa8\xf5\x16\xeb\x10\x0b\xd1\x59\x57\x49\x04\xd9\x46\xe5\xc4\xc5\xd0\x1a\x22\x84\x33\x86\x81\xa2\x9a\xcc\x6d\x21\xca\x70\xb0\x82\xcc\x75\x22\x03\x8d\x01\xa6\xae\x19\x68\x4f\xd6\x5e\xa8\xfd\xe6\x0a\x4e\xc3\x58\xd1\x87\x0e\x9b\x17\x79\x0c\xf6\xb6\xaa\x99\xed\x5c\x38\x30\x92\xe9\x2f\x3c\x19\x10\xe5\x03\xbb\x3f\xa1\xf8\x82\x90\x04\x78\xf1\x37\x5b\x63\x21\x2c\x5b\x5a\x1b\xe3\x1f\x6f\xd8\x5b\xbb\x5c\xeb\x33\x5c\x14\x3f\x1e\x40\xf4\x2c\x24\xc3\x8b\x26\x93\x3d\x76\x0e\xb3\x48\x2f\x8e\x20\x66\x74\xf9\xd3\x60\xc6\x13\x57\x64\x0e\x02\x3d\xe4\x09\xfe\xe4\x06\xc1\x7d\x12\xf4\x78\x7f\xe8\xf4\x22\x0a\x90\xf1\x01\x41\xef\xa7\xaa\xd8\xa7\xaa\x1d\x8b\x96\x61\xe7\xfc\xa3\xc5\x81\xef\x23\x18\xef\xe0\x03\xd9\x42\xc9\x1b\x84\x7d\x75\xd3\x55\xcb\x26\x1a\x3a\x30\xb5\xb0\xfa\x25\x18\x73\xe6\x3c\x91\xff\x79\xce\xe3\x78\xe8\x07\xea\x95\x67\x30\xb7\x74\xe2\xb5\xcb\x9e\xa3\xbf\x09\xc6\xb3\x84\xb4\x3b\x6b\x02\xe6\xbe\xc8\x93\x9d\xd3\x5b\x77\x8c\xa5\xe0\xb8\x12\xd6\x93\x38\x7d\x83\x33\x55\xc2\x51\x73\x0a\x82\xbd\xe3\xfd\xa3\xee\x3b\x79\xd4\x11\x4a\x62\x4e\xdd\xc7\xd2\xd9\xe2\xb4\x6f\x50\xc3\x4c\x4e\x66\xd9\xf6\xe6\x55\xa4\x7c\xa1\x88\x37\xd3\x47\x60\x03\xa3\x08\x05\x23\xc5\x0d\x2e\xa9\x68\xe7\xa9\xc4\x47\x43\x02\x3e\xd5\x74\x26\xc5\xe0\x14\xe4\x7c\x41\x5b\x69\xa6\x75\x63\x4e\x4c\xb9\x71\xf0\x21\xb6\x48\x0e\xc5\x99\x74\xda\x73\xb2\x7e\xcc\x03\x4f\xa7\x17\x16\x6d\xc8\x90\x75\xdb\x15\xd4\xb9\x03\x93\xb8\x7a\xba\x49\x60\x6b\x25\x59\x6d\x9a\xd6\xd0\xd4\x3c\x25\xd3\x2d\x6e\x3e\x0a\x2d\x80\xe1\x2f\x18\x21\xc0\xe7\xe7\x95\x98\xee\x01\xbe\x52\x7e\x6b\x13\xa6\xb8\x24\xcd\xba\x91\x5a\x76\x90\x73\xcf\x3a\x2c\xce\xf0\x0d\x92\x48\x0b\x0b\x8d\x2c\xcf\xd3\x0c\xbe\x51\x58\xe7\x36\xd4\xb1\x83\x06\xf7\xde\x15\x68\x09\x22\xbd\x90\x59\x9c\x8e\xfc\x4e\xe4\xf0\xcb\x8d\x98\xb0\x51\x5e\x4c\x8a\x9c\xb4\xb2\x9d\xf8\xf7\xaf\x6d\x8b\x5d\x1b\x67\x86\x58\xd1\x8a\x7f\x76\x4a\x42\x9e\x2a\x17\x4d\x27\x08\x46\xf9\xff\x6c\x04\x0b\x8a\x40\x0c\x66\x71\x62\x28\xc7\x89\x80\x8f\x87\xf9\xf2\x1a\x09\xef\x18\xbe\x35\x55\x67\xc7\x12\x1c\x74\x7b\xc8\x14\x22\x8b\x5a\xdd\x5c\x83\x42\x30\x31\x05\x6b\xaa\x6d\xdd\x0c\x74\x7d\xab\xf8\xfa\x1a\x5b\x9f\x7d\xc5\x25\xc2\x4d\xa6\xca\x14\x65\x1b\xed\xbe\x64\x37\xab\x64\xb0\x03\xb7\x32\xaf\xb6\x78\x02\x92\x6c\x2c\x6d\xc5\x46\x52\x07\x39\x89\xf4\x8c\x32\x51\x01\xf9\xaf\x42\x2f\xef\xc4\xf9\xbd\x5f\xac\xac\x8b\xf6\x41\x5c\x54\x04\x7d\x25\x7c\x3c\x13\x13\x86\x06\x42\xaf\x7d\x28\xca\x4d\xe1\x90\x05\x9b\x9e\x0f\xeb\x93\xf3\xf3\xfc\x47\x2e\xbd\x5b\xf3\x51\xe7\xd5\xc3\xfc\xf4\xe4\xa6\x73\x54\xea\xa1\xe7\x83\xb3\x08\x00\xbe\x92\x1c\x99\x59\x86\x0a\x49\xf7\x40\x06\x9c\xff\x13\x93\x1e\x69\xe8\x48\x50\x6f\x05\x96\xcf\x48\xb7\xc7\x34\x70\x9b\x37\x1d\x37\x7f\x5e\xae\x89\x8d\x0d\x0a\x74\xc1\xa3\x37\x47\x5e\xb3\x4d\x27\x0e\xef\xa3\xa7\xf4\x6a\x32\x1e\xce\x9a\x17\x6c\x76\xd7\x0c\x05\xfd\xcc\x8d\xb5\x0a\x4c\xa2\x91\xe3\x67\x95\x22\xbc\x12\x7c\x75\x65\x6a\x7c\x75\xcb\x0f\xfc\xf6\x89\xba\x77\x6a\xb1\xe9\x13\xc9\xe0\x26\x65\x41\x4d\x49\xa6\xd3\x18\x64\x9d\x60\xa1\xfb\x90\x83\x8e\x52\xaf\xe3\xfd\x28\x92\x5d\x1f\xef\xf9\x28\x41\x07\x77\x67\xf2\xbe\x49\x60\x7c\x64\x1c\x0e\xd9\xd2\xc0\x38\x40\x27\x09\xb8\xe6\xc8\x31\x6e\x7d\x77\x09\xfe\xb9\x0c\xd6\x1d\xfe\x2a\x77\xb1\x4f\x84\x76\xa0\x36\x0d\x90\x1b\x87\xdf\x18\x91\xd6\x4e\x08\xe4\xef\x66\xac\xff\x7c\x46\xe2\x7b\x2b\x32\x51\x17\x31\xc5\x35\x4e\xb6\x7a\x70\x68\x1e\xf1\x45\x9c\xea\x6b\x47\xa4\xfd\x91\x97\x8e\x94\xc1\x8e\x06\xba\xc7\x46\x86\x84\x8e\xf0\x77\x71\x91\xc9\x06\xfe\xfb\x60\x1e\x30\x88\xe5\xe6\xc6\x28\xb7\x51\x4c\x65\x04\x2b\x10\x98\x80\xb5\xa2\x65\xdb\xea\x68\x0c\x69\x7a\x3f\xd2\xba\xb6\xc2\x87\xf2\xb1\xbc\x72\x5f\x9d\x1f\x78\x2c\x3f\x35\xa8\xb1\xd4\x48\x17\x35\xc3\xf0\xee\x39\x5b\x1a\xa3\x07\x1b\x8b\xf5\xac\xbe\x24\x38\x7a\x96\xd2\x40\x38\x0c\xa2\xca\x1d\x41\x15\x49\xf7\xe0\xc8\xf9\x94\xff\x2a\x22\xca\xc7\xbc\x92\x70\xce\x5e\x83\xdf\x72\x9e\x83\xdc\x2e\x4b\x2c\x6b\x04\x3f\xa1\x97\x8d\xca\x2e\xbd\x5f\x02\x60\xbe\xd7\xbb\xf2\x14\x64\xfe\x02\x4c\x9b\x66\xdd\x0b\x33\xfd\xdd\x80\xa8\xeb\x8e\xc3\xec\xc9\x24\x28\x5e\xbb\x43\x54\x00\x63\x23\x33\x19\x29\x7d\x34\xa6\x45\xe3\x92\x21\x27\x66\xb1\xf2\xf9\xcb\x1f\x1b\x45\x2c\x02\x36\xbb\xca\x7a\x14\x11\xf9\x99\x05\xc6\x85\x93\x51\xb6\x18\xe9\xed\x08\x90\x75\x45\x9f\xd1\x98\xf8\xa5\xe5\x8f\xdd\x80\xfc\xdf\xf9\xc3\xfe\x13\x1e\x36\x3a\xa3\xf2\x8b\x49\xc4\x6e\x28\x20\x38\x99\x04\x74\x88\xec\x77\x87\x70\x3e\xf7\xca\xc5\x19\x10\x27\x85\x63\x29\x87\x2b\x27\x6b\xb5\x16\xcd\xe7\x40\x9c\xac\xf0\xc6\xc9\x10\x14\x75\x58\x8a\xde\x3a\xef\xbc\xad\x4c\xb1\x38\x64\x01\x32\xc3\x22\x83\xfd\xc1\x07\xf7\xcc\x00\x30\xc4\x5d\x71\x56\xe3\x76\xd8\x27\x40\xd0\xe2\x5d\x5f\x2d\xfb\x99\x49\x96\x3e\x59\x04\x7a\x5a\x87\xcd\x9e\x8a\xe7\x40\x0e\x69\xac\x4a\x1d\xdc\x63\xa6\x11\x33\xbb\xb3\x66\x2e\x7e\x42\x7c\xae\xf2\x40\x80\x46\xd9\xcb\xf9\x88\x5f\xcf\x47\x8c\x63\x79\xa2\xba\x64\x36\x13\xe4\xed\xa5\x42\xfc\xf3\xc8\x1c\x26\xc4\xc3\xf2\x3b\xcb\xc3\xea\x41\x61\xfe\xa0\x20\x00\x7a\x89\x75\xef\x19\xef\x28\x23\x0a\x89\x57\x68\x31\xd0\x19\xe1\xb6\x7c\x4b\x9a\x27\x65\x17\xec\x59\xc8\xcd\x67\xd3\x6d\x0e\x1c\xc8\x90\x0f\x36\x52\x70\xf4\xdd\x85\x19\xc8\xc3\x47\x9c\x7c\x36\x0c\x47\x27\x64\x1b\x6e\x94\x0f\x58\xed\x97\x0b\x83\x38\x0b\x93\xc4\x71\xc0\x62\xd0\x22\xc0\xe6\x69\xa8\xe8\x5f\xec\x5e\x49\x1b\x56\x1d\x21\x9a\xe9\x14\xc9\xdf\x09\x65\x2a\xc1\x5c\x44\xf1\xb7\x6d\x1e\x61\x6a\x40\xf4\x77\xf7\xa6\x25\xa4\x81\x4b\xb1\xc3\x0d\x55\x16\x02\xa6\x6b\x0f\x77\x51\x73\x1e\x6e\xc6\x5d\x0f\xf7\x98\xc9\x3a\xd8\x57\xde\x9a\x47\x27\x64\xc1\xff\xc8\x0c\xe8\xa4\x7a\x20\x93\xc9\x04\xfe\xdd\x0d\x47\xfd\x99\xe7\xb6\xf1\xe4\x3f\x0b\x12\xae\xf8\xff\xf4\x56\x6c\x93\x41\xf1\x01\xda\x97\xef\x97\x93\x65\x33\xd4\xfb\xc9\x47\x5a\x11\x0b\x40\x20\x0e\xbf\x43\x56\x90\xa1\x8d\xcc\x88\x55\x2e\x61\x46\x63\x88\xc6\xce\xe6\x74\x2f\xd1\xff\xc1\x83\xe1\x0f\x0f\xa2\x18\x5e\x32\xba\x60\xa8\x72\x65\x0f\xc5\x17\x88\x86\xf2\x2a\x36\x18\x92\x4c\x75\x28\x52\x6d\x1c\x8a\x12\xe6\x0c\x60\xd9\x4f\xfb\x3a\x9e\xb2\xec\x12\xda\x1c\x1a\x69\xf9\x50\x96\xfb\xab\x73\x60\xb0\x24\x0f\x63\x21\xd3\x2f\x77\x8f\xb1\x10\x32\xc0\xa9\xa5\x06\xc3\xa8\x4b\x21\x45\x9a\xc0\x22\x63\xe3\x07\x7a\xea\x40\x50\xd3\x25\x2a\xc6\xd8\x46\x3e\xe9\x94\x1b\xf2\xbf\x96\xfe\x3b\x38\x8d\x4b\x16\xe2\x4b\xce\xaf\x7a\x91\x4d\x0f\x89\xa8\xe0\x1f\x3e\xb9\xc5\xe8\xf8\x21\xbb\xbb\x58\x8d\x06\x92\xdc\xf4\x39\x18\x2c\x72\x9b\x0c\x98\x15\x9e\x22\x05\x64\x23\xcc\xc8\x7d\x21\xc9\x1f\xd2\x48\x08\xc2\x6f\x68\xd0\xd9\x57\x79\x1d\x39\xe7\x07\xac\xd2\xb0\xee\x36\x5b\x14\x0d\x64\xde\x29\xb2\x07\x1e\xc1\x8f\x76\x6d\x55\x84\x84\x14\xc6\x1b\x5a\x25\xb6\x70\x16\x03\x3e\xb5\x4f\x17\x59\x83\x06\x70\x0d\xf2\x3f\x03\x3d\x7f\x6f\xf5\x3b\xb8\xde\x33\x60\x72\x19\x74\x82\x2f\xfe\x20\x56\xa2\x86\x90\x17\x1b\xd0\x47\xeb\x66\x97\xb9\x7e\x84\xa6\x43\xda\x7d\xc0\x52\xa6\x37\xd8\x33\x22\x0c\x54\x84\x85\xa0\xfc\xa1\x1b\xbc\x3f\x02\x9c\xe6\x18\xb2\x31\x42\xf7\xa9\x40\x6b\x03\xe3\x2f\x82\x76\xc8\x39\x1e\x4d\x4f\x22\x98\xc1\xe3\xd0\x1c\x74\x95\x27\x71\x82\x1d\x47\xa1\x25\xeb\x14\x85\x24\xf0\x31\x28\x26\x44\x1b\xb3\x0a\xbf\x6a\xc9\x02\x0e\xa2\x9e\x74\xc7\x96\x5e\x38\x03\xa7\x86\x24\x4e\x42\x36\x09\xeb\xea\xc4\x6d\x58\x29\xfe\x33\x90\xef\x63\x48\x4d\xfe\x1a\x4c\x86\xfc\x3c\xa8\x0f\x37\xa4\xc6\xc1\x60\x90\x62\xaa\x03\x88\x27\xbc\x7c\xea\x62\x6a\x0a\x29\x42\x8e\x07\x19\x92\x43\x8c\xab\x06\x26\xd6\x91\xae\x81\xfe\x8b\xb5\x62\x5d\xd3\x36\xf6\xc6\x9f\x0c\x7a\x30\x52\xbc\x99\x79\xc2\x14\xaa\xde\x0d\xaa\xaa\x9d\x9d\x93\x5e\xf5\x9c\x35\x7a\x4c\x5d\xfc\x0b\x29\x3f\xe2\x3d\xf4\xc4\x67\x1d\xd1\x75\x1a\xbb\xfb\x13\x09\x6b\x78\x72\xfd\xf1\xb9\x82\xb2\x30\x42\x62\x7a\x74\x78\xc1\xdb\xef\x1b\x6d\x37\xed\x94\x3e\x74\xc6\xfa\xa3\xb4\xdf\x20\x08\x5a\x64\x83\x98\x1e\x92\x43\x31\xbb\x4f\xd6\x4a\xd1\xa3\x21\x44\xa9\x27\x28\x53\x0d\xc0\xbb\x34\xd4\xb1\x74\x05\xad\x45\xff\xe6\x24\xa5\xaf\x1f\xf8\xa6\x83\x55\xf0\x1d\x64\x86\x11\x50\xd5\x23\x1c\x9f\x24\x6b\xce\xaf\x48\x70\xb6\x5d\x67\x12\x0d\xe3\x9f\x49\xb5\x6d\x78\x12\x04\x69\x18\xc5\x05\xc7\x00\x26\x2b\x98\x5e\x0d\xd6\xc5\x74\x73\x17\x82\x97\x44\x7d\x78\x40\x6c\xf1\x20\x14\xf5\x5e\x3d\x9e\xb7\x7e\x91\xc9\x1d\x67\x63\x30\x17\xe8\x7b\xd0\x7e\xea\xa0\x14\x19\x69\x7d\xdd\xa4\xac\xd9\x23\xb2\x28\x7e\xb3\x9d\x37\xbe\x26\xe1\x4b\xa4\x4c\x86\x2b\x03\x27\x40\xf4\x41\xd2\x39\xd0\x5c\xf1\x37\x2b\x13\xee\xa0\xe7\x79\x16\x01\x56\x65\x41\xd0\x0b\x67\xc4\xa0\x74\x0c\xdd\x05\xa7\x77\x0c\x06\xc9\x85\x61\xf8\x08\x72\x7b\xab\xbc\x8e\x5b\xd4\xdb\x64\x79\x3c\x7e\x50\x92\xfa\x3d\x42\x8f\xbc\x9c\xe2\x26\x86\xe0\xa9\x1c\x86\x20\x9d\xec\x9f\x22\xd4\xab\x58\xe5\x0c\x01\xe5\xbe\xca\x3f\xd1\x2f\x11\xc1\x05\x24\xee\xc7\xaa\x44\x16\x43\x4f\x1e\x04\x6d\x80\x95\x68\xc3\xca\xd3\x42\x3c\x8e\xfc\xb7\xcf\xab\xd9\x84\xac\x79\xc7\x97\x54\x8e\xe0\x03\x2c\x47\x52\x63\x2a\xd6\x6c\xbd\xd2\x90\xd0\xe5\x33\x36\x9b\x83\x2d\xb9\x74\x41\x34\x3a\xdf\xd4\x6c\x82\x7e\x9c\xdf\x86\x73\x39\xea\xd3\x37\x83\x6a\xe5\x3f\x11\x69\xae\xef\x8d\x8c\x8e\x27\xa1\xaa\x32\xbb\x2a\x73\x11\xe4\x4f\xf2\xfd\x3a\x48\xed\x81\x98\xdd\x45\x3b\x4f\x3d\x15\xd0\xaf\x71\xf0\x85\x41\xcc\x93\xd8\x8c\x94\xc4\xf8\x10\x9f\x27\x4d\xb8\x53\x3f\xea\xf9\xcd\x69\x0f\x5a\x4f\x83\xca\x38\x07\xdf\xa3\xb2\xf5\xfb\x7c\xf4\x2c\x17\x2e\xa5\xf7\x79\x09\xf2\x42\x66\xb4\xf4\x08\xee\x0d\xf6\xc3\xeb\x0a\x42\x44\x6b\x77\x49\x74\x90\x57\xb2\x8e\x48\xe4\x82\x8d\xee\xb1\xfe\x36\xb9\x12\x0c\x26\xc7\x70\x9a\xf5\x64\xc8\x4a\x82\x94\x1c\x33\xb4\xeb\xc0\x39\x5a\xa1\xf5\xc9\x72\x3c\x81\x48\x6c\x13\xe3\xe2\xc1\x58\xf8\xd8\x30\x13\x66\x09\xf8\xa2\xeb\xc2\x99\x1f\x15\xba\x01\x9c\x24\x44\x87\x20\x92\xe0\x8c\x70\x4e\xc8\xd8\xbb\x54\x55\xf2\x78\xc2\x29\x4f\x38\xe8\x63\x01\x62\x69\xcf\x61\x08\x1e\xc8\x1f\x8d\xe3\x11\xdf\x60\xf2\xd8\x32\x36\x6d\x7c\x14\xea\x8c\xd2\xb6\x8b\xa5\x92\xf4\xbd\x88\x72\x2a\x90\x9e\xe3\xcf\x25\x7a\x05\xa0\x07\xb1\xa9\x39\x63\xa4\x5e\x4b\x20\x96\xce\x62\xa9\x5e\x26\xc2\x7a\x7a\x9b\xe6\x1d\xfa\x2d\x72\x0a\xf5\x6e\x13\x02\x45\x82\x1c\x12\x5f\x81\x98\x34\xa5\xfa\x06\x9a\x48\xcd\x7a\xfa\x14\x6c\x60\xce\x0f\xf9\xe2\xf8\xd9\x43\xe7\x2d\x08\x36\xbb\x23\x0e\xe8\x24\x30\xd9\xc7\x02\x56\x77\xab\x8f\x77\x42\x49\x96\xc1\x28\x16\x92\x2d\xa0\x95\x2c\xa4\x29\xbb\x35\x5c\x18\x20\xaf\xd7\x7d\xca\x2a\x06\xd2\xbf\x8e\xb6\x2e\x02\xc2\x49\xcd\x71\x3a\x67\x8f\x38\x85\x1a\xe3\xe4\xa4\x20\x23\xc0\x83\xe9\x6e\xe0\xa1\x5c\x58\xaa\x1e\x9c\xab\x75\xf7\xaa\x99\x4f\x77\x2b\x56\xa7\xbb\x1f\x6d\x48\xef\xec\x83\x26\x3b\x5c\x48\x17\x76\x68\xcc\x22\x4a\xbb\xd5\x16\xbb\xe3\x5b\x29\x71\xd0\x1d\x9f\x61\x12\xdd\xe3\xbd\x32\x7c\xcc\x79\x25\xc5\xd3\x47\x8a\x60\xfd\xa8\x3e\x49\x59\xd8\x52\xa8\x9c\xd8\x85\xbc\x7c\xe8\x40\x82\x3e\x92\xdf\x5f\x0b\x06\x75\x7d\xda\xc8\xe5\xe1\xf6\xb9\x89\x4d\x12\xa1\x30\x35\xe0\x46\x06\x97\xae\xf1\x84\xd9\x8b\xfa\xea\xa4\xf6\x95\x15\x51\x4c\x9e\x2d\x40\xc8\x09\xc0\x35\x39\x04\x6e\x3b\xa3\x7a\x56\x01\x91\xc4\x3b\xd6\x3d\x25\x59\x89\x86\x4a\x43\x74\x0e\x74\x07\x27\xd8\x9d\xd8\x30\x6c\xa2\x24\xbe\xcb\xfa\x0e\x0e\xc7\xa0\x02\xe9\x68\x36\x76\x9e\x17\x4e\x0e\x47\x9a\x94\x56\x4a\x4e\xc1\xe3\xea\xc5\x7e\xc9\x4c\x87\xae\x4d\x82\xc0\x37\x39\x1f\x8c\xe3\x35\xcc\x77\x5a\xc9\x85\xd0\x55\xe5\x55\x00\x60\x6e\xc4\x9d\x4b\x7e\x88\x89\xb1\x2e\xa2\x43\xed\xaa\x88\xae\xba\x3a\x71\x8a\x62\x20\xf5\xba\x02\x02\xac\xf9\x74\x6a\x9e\xb7\xe0\x50\x44\x36\x3a\x6f\x72\x48\xa4\xe8\xec\xc8\x10\x5a\x45\x11\x79\x8b\xe0\xbb\x43\x0b\xe3\x7a\x44\xb7\x14\xda\x1c\x06\xb6\xde\x8d\x58\xfb\x78\xd4\x9c\x96\xf4\x19\xf8\x48\x16\x7b\x3b\xa4\xf8\x2b\x92\x22\xb1\x81\xf0\x94\x5a\x59\x57\xb4\x0e\xdd\x95\x08\x86\x75\x22\x48\x71\x68\xba\x92\xb1\x37\xc0\xe2\x8a\x76\x68\xac\x67\xb0\x49\x5a\xaf\xce\x83\x7e\x41\x03\x5d\x89\x98\x3b\xb0\x2a\xfb\x9e\x99\x0e\x97\x6e\xe6\xc1\x59\x46\x54\x97\x25\x1a\x63\xe0\x0a\x16\xaa\x2e\xa8\x0b\x63\xee\xe6\x94\x92\x24\x66\x3c\x83\x5a\x30\x8b\xfd\x11\x54\x87\x3c\xb8\xb1\xcc\x23\x46\xbe\xe4\x1f\x12\x10\x13\x2a\x12\x07\x04\xf2\x36\x89\xd8\x35\x44\x1b\x91\x3d\x20\xc2\x4c\x1b\xd7\x07\x77\xee\x74\x79\xe5\x15\x97\x22\x1a\xc7\xb2\x34\x26\xc8\x7b\xd3\x25\xe7\xf0\xc0\x74\xf6\x33\x31\x10\x66\xfa\xd8\xe0\xf4\x0e\x02\xc8\x1b\x89\x24\x34\xfd\x3a\x10\x9b\x68\xf7\xa4\xfb\x4b\x9f\x9b\xc4\x88\x1f\x31\x16\x7e\xc4\xc7\x8b\x29\x4c\x50\x46\x82\x1e\xf2\x0a\xfa\xc3\x4b\x14\xb5\xa9\x25\x79\x18\x9c\x52\x50\x38\x5e\x30\xc7\xb2\xc8\x1a\xc5\x17\x00\x14\xff\xf6\x20\x16\x00\x2c\xc8\xae\x29\x98\x24\x45\x9f\x01\x38\x89\x83\x12\x6f\xfc\x0c\x18\xf4\x8f\x91\x03\x05\x76\xc8\x60\xdb\x6e\x24\x4f\x5d\x92\x94\x06\xa8\x24\xdb\x7d\x1c\xdd\xcd\xd2\xe6\x2d\x97\x50\x9f\xb6\xe0\x93\xec\x74\x8e\x4d\xc4\x93\x9b\x6a\x18\x3c\x41\x5d\x62\x42\x17\xca\xe9\xe6\xb1\xb4\x4e\xad\x1c\x4a\x90\x42\x8a\x74\x72\xe9\xf9\x5a\xc1\x4d\xc4\x5f\x17\x3e\x2d\x79\x23\xbb\xc4\x06\x9d\xc8\xae\xdf\xa5\x29\xd8\x40\x13\x48\x5b\x74\xde\x81\x6d\xc8\x8c\x09\x3e\xb6\xfe\x79\xf3\xa3\x4a\x5a\x67\xc0\x57\x26\x1d\x93\xf4\xee\x18\xa8\xe7\xb4\x91\xa2\x27\x7c\x25\x34\x2b\x87\x37\x79\x8e\xd2\xad\xf5\xcb\x74\x3f\xfc\xcb\xc0\xfb\x6d\x5e\x53\x84\xa0\xd0\xd0\x01\x45\xa4\x76\xb1\xdf\x49\x71\xce\xe3\x2e\xdf\xfb\xbf\xa0\x80\x74\x10\x7c\x89\xd6\x0d\x86\x13\x9b\x64\x8f\x1b\x11\xfa\xf7\x2b\x76\x43\x86\xd5\x2b\x7c\x3c\x83\x17\x32\x66\xd2\x66\xb5\x9b\xe5\x43\xe6\x43\xf9\x10\xcc\x0e\xb9\x69\xcb\x03\x25\x8a\x3e\x9b\x21\xf2\x26\x67\xa3\xf3\xe3\x6f\x84\xd2\x1a\xf7\x65\x37\xe7\x4c\x44\x88\xbe\x5f\x69\x9b\x38\xaf\x73\x01\xfd\x55\x84\x8b\xee\x3a\xe5\xd9\x26\x0d\x50\xee\xca\x65\x03\xc7\xd8\xf0\xe1\x7f\x7b\xb6\x74\xc4\x19\xb3\x71\xa4\x75\x2d\x07\x79\x0b\xa1\xe3\xd3\xbb\x10\x30\x28\x47\xab\xba\xba\xd4\xe8\x02\x80\xe6\x40\xc1\xeb\xb9\xbc\x8a\xbb\x4c\xdc\xb0\x61\x86\x9a\x41\x5a\x20\x56\xe3\xda\xc9\x8a\x0f\x4c\xd8\xd2\xe7\x11\x9a\x13\x04\x96\x0b\x58\x89\x68\xfc\xa5\xe5\x74\x8e\x2d\x24\x7d\x7d\x78\x63\x2d\xfd\x2b\x2d\x71\x3c\x72\x15\x98\xee\xeb\x51\x3c\xda\x5b\x44\x1f\x96\x3c\xa0\x55\x1c\x94\x20\xdb\x1a\x08\xbb\xd2\x18\x2b\xbb\xe6\x8b\x46\x26\x59\xe1\x0d\xe9\xf1\x95\x20\x9d\x3c\x79\xde\xd9\x49\x95\x2b\x53\xf8\x93\x02\x36\x92\xdd\xb3\x9f\xb5\x0f\x1b\xc8\x1e\x11\xdf\x5c\x2f\xf6\xd0\x3e\x7b\xa4\x6e\xea\x4e\x05\x65\x9a\x81\x76\x93\x68\xd2\x90\x0f\x5f\xa9\x13\x31\x66\xc7\xa9\x28\x32\x62\xb9\x9d\x7d\x02\x03\x79\x1a\xfb\x09\xa7\xe0\x29\x69\x81\xfc\xfb\x71\x15\x80\xef\x2d\xa3\xff\x7b\xaf\xd1\xf4\xbf\x37\x03\x6e\xbf\xf7\xcc\x15\x92\xef\x6d\x83\xe2\x39\xa8\xf6\x5f\x3a\x4a\xad\x50\x7a\xfd\xb7\x1e\xe2\xb4\xfa\x52\x94\x0c\x21\x72\x22\xa4\x34\x34\xa9\xe4\x27\xf2\xe5\x6c\xe8\x8b\x0e\xda\x7d\xa3\x86\xfc\x88\x7c\x90\xfa\xfe\x1b\x91\x12\x5f\x4a\x23\x7e\xf3\xc2\xa0\xdd\x2f\x38\xfc\x58\x0e\x9c\x1f\x7c\xad\x9f\x0f\x52\xcb\x97\x4d\x40\x9d\x15\xd3\x1a\xcf\xd7\x9b\xe1\x17\xd9\x4b\x41\x8b\xb9\xd3\x50\x05\x41\x26\x05\x9b\xbf\xd6\xdf\x89\xc0\xf6\x0b\xba\x5c\x82\x75\x47\x52\x98\xc3\x60\xea\x4c\x36\x89\x7d\x30\x18\x13\x1f\x24\xf7\xd9\x40\xfb\xd5\xe5\xdc\x0e\x28\x82\xb8\xda\x87\x79\xd2\x9f\xdb\xab\x0f\xf6\xcc\x89\x79\x35\x9f\x08\xde\xf9\x38\xd9\xf8\x49\x34\x7b\x77\xe8\x24\x9a\x2c\x19\xeb\xfd\x51\xf7\xfb\xfe\xfc\xb8\x11\x83\x63\xf0\x88\xf8\xc8\xb7\xd5\xa2\xf0\xea\x58\xd2\xfb\xb2\x54\xbc\xdf\xdb\x6c\x28\xd1\x59\x56\x91\x6a\xd6\xa5\x17\x5f\xa3\x35\x19\xb2\x27\xc2\x7e\x92\xd7\xe3\x5d\x17\x8e\x4e\xf0\xb1\x86\x50\xe1\x9b\x4b\xd3\x44\xee\x3d\xb3\x32\x56\x17\xc1\xa6\x65\x36\x39\x09\x22\x1b\xf3\x01\x20\xa9\xec\x0c\x85\x62\xfa\x1b\xcb\xd8\xb7\xb8\x24\x0f\x45\xb0\xbc\x8b\x07\x23\xbc\x0b\x93\xa8\xde\x3c\xe7\xa6\x65\x35\xe8\x0f\x8a\x84\x32\x94\x08\x88\xfa\x80\x24\x61\x2c\xc8\x76\xd0\xf5\xe0\xa4\x0b\x42\xcb\xa0\xed\xb4\x96\xdf\xa0\x59\x86\xa5\xe1\x9f\xbd\xe2\x5b\xdb\x9c\x75\x2b\x39\x88\x1e\xed\xe1\xbe\xe9\x85\x06\x7c\xca\x9c\x04\xd6\x33\x06\x1b\xa6\xe6\xb3\xc0\xa2\xd6\x04\x1b\xe6\xc4\x85\x4a\xe0\xf6\x8c\x7c\xf1\x4c\x84\x9a\x86\x49\x6f\x39\x9b\x8d\x15\x67\xcb\xba\x61\x2c\x9f\x05\x89\xa6\x56\x3c\xdf\xe8\x2c\x82\x1a\x34\x37\x0a\x10\x90\x5e\xa2\xf3\xd0\xee\x9e\x1c\x9b\xe5\x74\x65\xb7\x83\x1b\xdb\x8f\x5d\x53\x89\x49\x06\x94\x6c\x06\xa4\xdf\xf4\x33\xe8\xf1\x79\xa2\xf9\xf0\x7e\xd7\x00\x0f\xa7\x0a\xd2\x5b\x99\xc2\xef\x14\x1a\xd0\xef\xf4\x7b\xed\xe9\xf8\x66\xba\x53\xdf\x18\x08\xff\x09\xe8\xde\x6c\x48\xa4\x7d\xfe\x4e\x62\xd3\x7a\x83\xc8\x24\x4e\xd3\xe8\x2b\x91\xe1\x52\x88\x78\xdf\x50\xb2\x60\xa5\x13\xe8\x5d\x37\x21\x57\xfb\x61\xff\x6d\x9b\x76\x3b\x07\xaf\xbc\xa8\x4f\x76\xa4\x9f\x89\x11\xe4\x9d\x34\xc1\x44\xb4\x40\x10\x77\x16\x5e\xb6\xd0\xb1\xf5\x4e\xf3\x6e\x13\x38\x2e\x45\xda\xc6\x12\x87\xc9\x3c\x7c\x83\xdb\xfa\xb9\xc9\xac\x04\xf1\x26\x0f\x1c\x86\x7a\xef\xa7\xa0\x78\x22\x25\x8e\xf2\xba\x9d\xa0\xc9\xad\xc9\xd7\x3d\x41\x19\x4c\x04\x9c\x27\xe5\x1b\x5e\x9e\xf0\xfb\x24\x62\xde\xd7\xab\x22\x1e\xdf\x01\x95\x1c\x5f\xb0\x9e\x9c\x2a\xb2\x44\x26\x3b\xf8\xb1\x05\xce\x3e\x35\xf2\xcd\x4c\x3a\x4d\xb5\x14\x77\x90\x4e\xe9\xbf\x60\xe1\x74\x4e\x4f\x64\xc6\x93\xe7\xb2\x64\xa9\xbe\xbf\xca\xa0\x3c\x95\x57\xe9\xdd\x8f\xf1\x6a\x81\xc3\x2f\x38\xc9\x5e\x64\xd7\x94\x24\x07\x46\xeb\xe0\xde\xb4\xf7\x3a\x2d\x62\xd7\x3c\xb8\xb0\xfc\x72\x05\xb7\x2c\xd4\x0e\xc4\xa4\x9f\xe4\x5f\x4e\xce\xf9\x9f\x93\x6f\xd2\x12\x78\x71\x92\xf2\x42\x2b\x19\xf8\x3d\xbd\xe0\xf5\xf0\x51\xf0\x05\x17\xcc\x76\x05\xbb\xe6\x79\xaf\xf9\x68\x1b\xfd\x7c\x7f\xb8\xd6\xfe\x82\xfa\x49\xbe\xdf\xf1\x2f\xb0\x94\x05\xaa\xdf\x38\x24\x07\x75\x27\x94\xa7\x96\x67\xec\xc6\x32\x12\xd2\x8b\xdb\x56\xfe\xfd\xe7\xf8\xbe\x53\x9a\xda\xd6\x5b\x73\x75\x6e\xcd\x9f\xdf\x86\x82\xbb\x0d\x9b\x0d\x44\x9a\x38\x60\x46\x8d\x3a\x9b\x27\xff\xbd\x90\xa3\x13\xb1\x10\x34\x97\x0d\xf7\x4e\xf6\xfe\x9f\x58\x3c\xfb\x2a\x34\x24\x22\xd9\x4e\xf7\x61\x0f\xd0\x73\xd1\x6e\xef\x33\xb3\xb4\x65\xef\x0d\x51\xc1\x01\x55\x32\x50\xda\x13\x21\xfa\x16\x89\x79\x8f\x63\x78\xc0\x6d\x2a\xcb\xd5\x83\x9b\xcc\x10\xd7\xe7\xfc\xba\xad\x6f\x80\xdc\x99\x9f\x55\x94\xa0\xbe\xfe\x70\x7d\x12\x43\x48\xcc\xe6\xdc\xdc\x89\x75\xdd\x0c\x52\xb9\xee\x53\x93\xb6\xeb\xd6\xe4\x0e\x64\xa0\x31\x1b\x05\x8e\x9d\x1e\x02\xe1\x27\xbf\x77\x1a\xcb\xd7\xfd\x14\x7d\xe8\xe8\x33\x99\x8b\xe2\x3c\xd7\x2d\xba\x50\xb6\x42\x27\x26\x94\xb1\x77\x9d\xb7\xfd\xb9\xf3\xcc\x4a\x1b\x42\xdd\x3e\xf5\xfc\xdc\xe0\x32\x3d\xca\x8b\xeb\x45\x86\xf6\xbd\x04\x00\x87\x57\xe6\xc6\xfa\x3b\x94\xbe\x3e\x07\xfe\x8c\x0c\x71\x2c\x07\xe8\x48\x3a\x9a\x5f\x85\xb6\xdc\x15\xca\x6f\xd7\x91\x3c\xc7\x97\xd0\x6d\x23\x2b\x9d\xc9\x12\x6b\x0f\xfe\xb3\x7a\xb1\x09\x5f\x2e\xc0\xa1\x10\x2a\x6c\x68\xe9\xe8\x92\x5f\x1f\xd9\x26\x0b\x4b\x4e\xc4\xcc\xde\x6d\x2a\x7d\x57\xa9\x93\x75\x90\xde\x26\xc4\xa5\x74\x81\x2d\xee\x24\x98\xc2\xcd\x73\x05\x03\xe5\xe5\xe1\x15\x0e\x98\x5a\x82\x92\xf7\x5d\xbc\x7f\xb8\x20\x68\xce\x43\x21\x5b\x14\xcc\xa2\x47\x8d\xd8\x42\xa8\x91\x6c\xa7\xd6\xf7\xaf\xa6\x44\x8e\x04\x4b\xed\x2a\xd1\x8a\x00\xff\x13\x19\xa9\x4e\x49\x82\x19\xb3\xd3\x2f\x95\xc1\x4e\xba\xc4\x6c\xc0\xf0\x20\x92\xd1\x3b\x22\x40\xd0\x9e\x6d\xce\xe5\xe6\x4f\x5b\x91\x41\xfe\x26\x1b\x67\xde\x47\x1d\x86\x5b\x67\x2d\xf3\xaa\x80\x3f\x43\x34\xb2\x2e\x0f\xdd\x28\xfc\x85\x72\xab\xc1\x5f\xaa\x9f\x26\xb9\xa3\x6c\xb2\x90\x9e\x74\x5b\x5c\x50\xb1\x3b\x09\xa2\x26\x98\xd1\x4d\xca\x12\xb6\x8d\x9d\x3f\xd9\x82\x3d\x55\xaf\x88\x3c\xcb\x56\x88\xfe\x35\x31\x4c\xef\x4a\xd2\x75\x82\x77\x34\x14\xef\x2e\x9b\x6b\x7f\x18\xb0\x03\xc8\xcf\x02\x74\x65\x5e\x72\x31\xe3\xb2\x67\x72\x9e\x81\xbc\xe8\x62\x55\x0d\xbc\xa7\xce\xab\xf5\xe5\xba\x88\x95\xce\x3b\xf7\xa5\x61\x6b\xa5\x2f\x0b\x9d\x1f\x91\x40\x7e\x16\x11\xcc\x7d\x44\x29\x66\x96\x5e\xe3\x40\x9d\x64\x61\x9d\xd6\x57\x9e\x8d\xc9\x94\x5c\x5e\x36\xd6\x1f\x01\xfc\xb5\x19\x48\xdb\x27\x40\x0e\xb6\xd3\xeb\x5d\x6f\x9e\x43\x5c\x5e\x6f\x11\x30\x9c\x91\xb3\x73\xde\x47\x80\x6d\xe8\x16\xff\x32\x48\x64\x7a\x92\x01\x91\xa4\xa6\x89\xdc\xa5\xe8\xd4\x93\xf8\x4d\xc9\xe1\x76\x4f\x91\x48\x73\xde\x20\xe5\x0f\x79\x86\xd3\x7b\x11\x82\x9d\x1c\xa4\x66\x6b\x07\x43\xe9\xbd\x6a\x9f\xcd\xce\x9f\xcc\x86\x20\x11\xf9\x29\xa4\x59\xaf\xc3\xc6\xca\x78\x89\x14\x09\x29\x50\xdf\xaf\x7e\x94\x6e\x27\x57\xbb\xa0\xad\xc6\x39\x38\xf0\xa3\xce\x41\x0c\x5a\x19\x93\xe2\xae\x20\x9d\x14\xbc\x08\x1f\xf1\xd6\xf8\x56\x8b\xfc\x06\x7b\x29\x23\xb2\x0d\x3d\xc5\x03\x5a\x9f\xba\xa5\x0a\x37\xdc\x22\xd8\x28\x58\x6b\xd0\x02\x3b\x0c\x33\xce\x37\x82\xbf\xd4\xe0\x20\x5e\xd8\xab\x8a\x7d\xcf\x49\x50\x83\x0e\x35\x2f\x24\x29\x2d\xc7\x24\x6e\x53\x30\x86\x10\x59\x33\x88\xf3\x23\x32\x22\x60\xf0\x7f\x42\xe5\x82\xf1\x9b\xa0\x02\xe2\x63\xc5\x12\xd0\x25\x12\xd5\xb2\x35\x2e\xbf\xeb\x8f\x99\xe9\x1b\x0a\x03\x3f\x9d\x4e\xf8\x78\xd3\xff\x80\x2d\xf1\xfa\xd9\x17\x78\x90\x1f\xd2\xbe\xbb\xf1\x4f\x52\x0d\x62\x31\x4e\x5e\xc0\xac\x7a\x55\xb9\x49\x11\x43\xbf\x6a\x8d\xe3\x9e\x99\x8f\x3f\x89\x60\xee\x32\x83\x6d\x0b\x8a\x0c\xdb\x9a\xb6\xc2\xb1\xc6\x70\x56\x1c\x97\xc1\xe4\x8f\xe6\x10\x8b\x1d\xc8\x97\x48\x80\x2a\xed\x28\x50\x77\x6d\x4f\x31\xa7\x3a\xa3\xd1\x22\xd8\xb8\x65\xf7\x43\x5d\x0b\xd0\x16\xe4\xaa\x62\xd9\xdc\xcb\xab\x11\xb1\x26\x96\x66\x6a\x68\x0f\x83\xee\x01\xa4\x54\xed\x54\xac\x6f\x02\xfe\x2b\xfb\x9b\x26\x14\x95\xe0\xce\xe4\x0c\x04\xa5\xe8\x21\x81\xe8\x26\x10\xdf\xfe\x8f\x93\xf5\x9a\x35\xa3\x3b\xeb\xe9\xbd\xe9\x29\x19\xa7\xb3\x56\x2d\xc9\x9e\x1e\x3d\xe4\xcf\xa3\x32\x31\xfc\x24\x67\x89\x15\x3c\x9b\x07\x92\xfa\x53\xad\x43\xcb\x31\x3b\xab\x1c\x14\x67\xed\xd8\x6d\xac\x4c\x7d\xb5\x32\x24\x07\xce\xb5\x5c\xf3\x83\xc0\x2b\xdd\x42\xa2\xa1\xaa\x27\x90\xb7\x86\x74\x43\x0b\x83\xea\xcf\x67\x15\x8f\xcc\xa9\xf4\x39\xc2\xae\x11\x3b\x3f\x33\x3f\xe5\x27\x47\x15\x2b\xc7\x42\x76\xaa\xb3\x90\x95\xe2\x2c\x7f\xb8\x9f\x83\x12\xec\x2c\xe2\xc9\xa5\xea\xd0\x69\xef\xa6\xa7\x00\x1a\x74\x15\x7b\xd1\x9f\xae\x7b\x1c\xbd\x8a\x66\xd6\xec\x04\x9a\xc8\xa4\x52\xd5\xcc\xf0\x2c\x41\xe0\x59\xf2\xf4\xd6\x94\xf3\x2c\x43\xf0\xb0\x0e\x9c\x18\x9c\xe0\x82\x15\xdd\xe9\xbd\xaa\x8b\x9a\x6f\x2e\x1d\x39\x96\xb6\x26\x16\xc9\x3a\x96\xfb\xe5\xee\xcf\x13\x69\x3b\x1f\x02\xe4\xd4\xe8\x2d\xfb\xc2\x73\xa3\x81\x01\x69\x54\xfb\xea\xb0\xd0\x2c\x4a\x03\xc3\xe3\x21\x6a\xd6\xd2\x58\x35\xe7\x88\x1b\x3c\x83\x74\x73\xce\x22\x79\xcd\x20\x81\x62\xed\xf2\xd2\x7a\xc5\x39\xc7\x2f\xd5\x15\xce\xae\x9d\x2c\xb4\x6b\x42\x87\xf5\x79\xdc\x31\xa7\x35\xe7\x6f\xfd\xd9\x65\x20\xff\x7e\xd9\x3f\x82\xcb\x59\x5e\xe6\x73\x14\xcb\xd5\xc9\x34\x9c\x33\xff\x8b\x8e\xc3\x1e\xf0\x47\x25\x59\x4b\xf3\xa5\x96\x4a\x8d\x9d\x33\x8b\x6b\x39\xc7\x97\x8c\x53\x29\xba\xcd\xf0\x40\x79\x66\xb0\x2f\x42\xfa\xd0\xe1\x32\xd4\x35\xd6\x38\xce\x0c\xb6\x5c\xf5\x25\x39\xe8\x98\xa1\x32\xc5\x5c\x82\xb3\x09\xab\x9e\x66\x1e\xfb\x47\x83\x05\x7a\x5e\x49\x7c\x9f\x99\xf1\x7d\x67\x0e\x85\x22\x27\xb7\x4a\x07\xa9\x3e\x8f\xaa\xfb\x66\xa0\x8a\xa3\x02\xc6\xab\x24\x78\x04\xd7\x68\x1b\x74\x9d\x8c\x35\xb8\x58\xef\xb5\x51\x8d\xde\x12\xd1\x01\xec\x23\xa7\xbf\x6d\x10\x1f\x25\x37\x1a\xd2\x83\xce\x33\x47\x76\x6b\x8b\x7e\x5b\x39\x73\xd6\x86\x9d\xf4\x2b\xf8\xe3\x5d\x1d\xa3\xa6\x22\x5d\x72\x02\x56\x09\xda\xf8\x42\x65\x1b\x27\x20\x6c\x79\x05\x9d\xea\x5a\xe8\x22\x70\xbe\x55\x32\x83\x3b\xd5\x62\x3c\x01\xa8\xf0\x9c\x8d\xb2\x75\x09\xba\x7d\x60\x9b\x52\xff\xf8\x59\x39\x3d\x73\x34\xb6\x9d\xa0\xcb\x21\x85\xad\x35\xd8\x6f\xec\xce\xe2\xba\x04\xb4\xf9\x78\x3b\x79\x70\x90\xe3\xd1\xec\x6d\x6f\x6a\x07\xa7\xc4\xea\xc1\x2b\x78\x15\x11\x22\xf7\xd6\x34\xe9\xf1\x3a\xed\x6a\xa1\x17\x71\x42\x45\x94\xe4\xa3\xf1\x82\xcd\x70\x9c\xb8\x00\x7c\xa6\xfb\xc5\xd0\xe7\x33\x18\xce\xd1\x76\xb5\xa8\x7a\x8a\x9c\x37\x41\xda\x59\x88\x5c\x52\x8e\x37\xe5\x21\x9d\x14\x6b\x12\x4a\xcb\xad\xd6\x81\x8d\xfe\xb8\xc5\xa1\xba\x81\x60\xbb\x08\x8b\x5b\xe4\x54\x26\xc4\xe9\x32\x4d\x02\x31\x43\x3a\x13\x38\xe2\x1b\xdd\x2b\x34\x65\x64\xe7\xc1\x15\xae\x3a\xc0\x80\xe7\x19\xac\xcd\x7e\x09\x44\xe8\xfa\x64\x4c\xad\x81\x46\x0d\x9d\x1e\x03\x3f\x3f\x2e\xd8\x9c\x69\x42\x14\x94\x23\xeb\x6b\x48\x27\xab\x78\x9e\x13\xf2\x5e\x2a\xc9\x04\xf9\x91\x96\x52\x38\xaf\x0f\x1b\xa4\x62\xda\x62\x38\x79\x71\x32\xe3\x05\x20\x89\xc1\x95\x14\xaa\xb7\x98\x89\x0c\x04\x7b\xda\xd1\xa6\x0d\xc7\xbd\x93\xc7\xf2\xfe\x65\xd9\x1d\xb7\x48\xde\x0c\x58\xff\x27\x6e\xcc\x3b\xdc\x39\x07\x0c\x0e\x85\xdf\x1f\xb7\x02\x67\xc0\xfe\x2a\x8f\x07\xa0\x17\x6c\x1c\xc7\x6d\x1d\x1a\x0f\xf1\xd5\x4e\x21\xb2\x8b\xda\xb0\xeb\x1d\x3c\xac\x88\x1f\x9d\xd8\x21\xbd\x44\x04\xb3\x4c\xb9\x0b\xa4\x4c\x00\x86\xb8\x34\xf6\xd5\x93\x9e\x70\x4c\x5f\xd9\xda\xb0\x0c\x1e\xe1\x9a\x58\x4a\x21\x7d\x29\x03\x56\x10\xe3\xa2\x78\x7f\x64\x6e\x89\xc0\x54\xc4\x99\x95\x6b\xa1\xf6\x5c\xf3\x29\x07\x04\xf0\xa2\x3a\xb5\x53\xfe\x54\xe1\x1d\x8f\x0d\xd3\x3f\x76\x54\x19\x4b\x47\x15\xad\xed\xcc\x0c\x1f\x80\x2e\x7c\x11\xb6\xd1\x28\x6c\x67\x71\xbc\x86\x60\xa1\x04\x93\xad\x38\xa2\xf6\x79\x96\x81\x00\x95\x00\xef\x36\x8e\x3a\xd8\xa4\xd8\x93\x25\x0d\xfe\x61\xba\x75\x03\x88\x61\x32\x47\x8d\x67\x5f\x3b\x31\xd1\xa6\xa1\xf7\x2f\xd8\x99\x63\x49\xe1\x6b\x03\x7f\x56\xc3\x2a\x2f\x86\xf0\x02\x1c\x62\x88\x3d\x45\x2f\x1b\x69\x6b\xf4\x04\x48\xc1\xc0\x36\xc8\x1c\x4c\x41\x2a\xd4\x37\x04\x55\x98\x11\x13\xec\xb1\x9b\x7c\x5a\x87\x2f\xd5\xfb\xed\x95\xac\xc4\xf7\xc3\x5d\xcb\x9b\x10\x8f\x52\x2e\x14\xba\x65\xb2\xf3\xba\x55\xd0\x12\x93\x8f\xb9\x7a\xa4\x0e\x78\x64\xfd\x21\xda\x74\x59\x59\xa4\xc7\xcc\x20\x9e\x03\xd6\xb5\x5f\x08\x71\xcf\x22\x1c\x86\x66\x18\x9f\x48\x6e\xbb\x7e\xe2\xe8\xee\x9c\xe0\x75\xf3\xff\x7c\x1d\xe4\x50\x0e\xf1\x91\xeb\xae\x76\x83\xb5\xf6\xf8\x14\x14\x7e\x7c\x84\x45\xa6\x91\xe3\x00\x81\x40\xdb\x33\x88\xab\x37\xcb\xd6\x3d\xf2\x4a\xd5\x3c\x92\xda\xf2\x04\xab\x8d\x6d\x5f\xa2\xf4\x54\x93\x03\xf4\xb2\x5c\x9c\x8b\x91\xfc\x36\x78\x69\xcb\x49\x92\x10\xa0\x59\xbf\x28\xca\x92\x3b\x98\xbf\x6b\xc5\xf0\xbb\x39\xb5\x20\x38\xab\x79\xd1\x89\x5d\xd8\x81\x17\xc1\xef\xd0\xcc\x43\xb2\x36\xe7\x4c\x02\x1d\xeb\xa6\x76\x66\x1d\x82\x0a\xb5\xe8\x28\xfb\xfa\xbf\x65\xd2\xdd\xa8\x2b\x80\x0d\x24\x8e\xda\xcf\x56\x3d\xd9\xfc\x48\xff\x44\xcb\x9b\xae\xd6\x17\x1e\xc9\xe6\xa8\xfc\xef\x09\x27\xee\xa9\x1f\x29\x65\x28\x12\x1f\x0f\x57\xea\x73\x36\xc6\x43\x02\x28\x98\x2d\x58\x87\x25\x14\xbc\xfd\x4d\x2f\xf6\xc0\x0a\x94\x7f\xa2\x69\xf8\x36\xea\x4c\xb3\xc7\x8e\x44\x42\x38\xf0\xd9\x5e\x1f\x51\xd7\x16\xcd\x13\x49\x68\xcb\xae\xc3\xf0\xb3\xd1\xf3\xda\x06\xdd\xab\xfb\x47\xa4\xa3\xb7\x16\xd7\x77\x69\x7d\x81\xe5\x96\x81\x06\xfb\xcd\xe8\xf5\xfd\x16\xa7\xc1\x7e\x4f\x2b\xa9\x59\xf6\x3b\x68\x34\x6d\xf0\x7d\xfa\x47\xb3\x1f\x94\x40\x02\xc1\x6d\x16\x33\x6d\x7d\xf1\x44\xf6\x59\xcd\xe2\x02\xb5\x4f\x19\x8a\x03\x1b\xe9\x6c\x69\x57\xed\x70\xb3\xa5\x20\xbe\xd5\x80\x6f\x93\xab\x4b\xf5\xc0\x0a\x39\x09\x3c\x0f\x08\x89\x0b\xf4\xbe\xc6\x09\x29\x44\x91\xdd\x3a\x59\x18\x11\xec\x4a\xa2\xa0\x94\x65\x80\xd2\x8e\xc8\x5e\x35\x1d\xc3\x8c\x3f\x00\x93\x2f\x79\x70\x2b\xde\x4e\x50\xfc\x56\xdd\x7d\x55\x06\xec\x5e\xd7\x35\x78\x70\x23\xdb\x0d\x9c\xb5\x43\x25\x37\xaf\x8d\xe3\xcc\xe1\xdf\x39\xa2\xef\xb5\x50\x0c\x68\x97\x54\xf6\x1e\xd4\x29\x7b\x1d\xea\x12\xc7\x4a\x73\x7a\x5f\x6e\xcd\x7b\xf6\x85\x5e\x6a\x2b\xf9\x74\xac\xe4\x2a\x9c\x21\xbe\x22\x08\xb6\xfb\x25\x96\x26\x55\xb7\x2f\x8c\x4a\x06\x6b\xee\x37\xf6\x90\x79\x17\x1c\xda\x7c\x0a\xc5\xba\x63\x2f\x9b\x40\x14\x18\x75\xf9\xaf\xca\xef\x67\x47\x28\xec\x49\x20\x8f\xc2\xae\x25\x84\xbd\xc0\x39\xde\xa8\x76\x59\x95\xb2\x90\x14\x89\x94\xba\x22\x67\x75\x7a\x4d\xbb\x00\x37\xfa\x78\xf8\x2d\x02\x09\xa8\x55\x20\xc8\x0a\xf6\xb9\x20\x80\x91\x54\xae\xb3\x08\x68\x67\x86\x57\xee\xa3\x0f\x24\x7e\xd8\xe8\xb4\xd8\xc4\xde\xcd\x05\x8f\x6f\xbe\x0e\x31\x60\x89\x5f\xb7\x17\x54\xe8\x92\xf3\xbe\x34\x5a\xd7\x1c\x79\xdf\xbb\xc7\x5f\xc4\x02\xe6\x9e\x65\x73\xec\xf2\xe9\x62\xfa\xc7\x57\x65\x93\x89\x9b\x9e\x20\x40\xb1\x2f\x23\x98\xa9\xa1\x76\x21\xe4\x7e\xeb\xc0\xaa\xf4\xa8\xa6\xaf\xb2\x6b\x10\x72\xee\x5e\x96\x83\x07\x72\x19\x48\x1c\xb2\x76\xb1\x0b\xec\x0c\x74\xdc\x7d\xc6\xc4\xfc\x4c\xd0\xf6\x4e\x7c\x41\xca\x57\x46\xa9\x9a\x96\x5d\xf7\x26\x6a\x90\xdd\x07\x23\x7d\x58\xe8\xe9\x78\x52\x50\x96\xef\x1a\x5a\x6d\x96\xe7\xff\x4d\x9f\xcc\xf2\xb5\x28\xe2\x0e\x90\x0c\xff\x76\xac\x16\x2a\x76\xbc\xd5\x53\x0c\xbb\xe7\x0f\xe4\x8f\x00\xfc\xb9\x1c\x64\x6c\x0b\x5d\x13\xcf\x74\xb2\x5b\x82\xa0\x8c\x28\x84\xed\xb1\xe9\x09\x72\x41\x30\x09\x92\x93\xd8\x23\x64\x78\xce\x83\xf1\x20\x3b\xc2\x99\x83\x61\x18\xcc\xc1\xc7\xc4\x53\x5b\x73\x7d\x7c\x03\xb1\x0c\x9a\xe2\x4d\xb3\xbc\x3d\x2d\x3e\x95\xdc\x53\x08\xfa\xef\xa9\x65\x55\xec\x49\xd4\xc3\x8b\x18\x2c\xc1\xa4\xb5\xf0\xf0\x1e\x79\xa4\x64\x3a\xee\xf9\x99\xa4\xbe\xd5\xd5\x4d\xcc\xfa\xed\x3c\xde\x09\x6c\x1d\x6f\x0f\x5b\x00\x02\xab\x86\xbf\x89\x8a\x25\x1e\x7f\x4b\x48\x42\xa0\xc7\xcb\x93\x0b\x3a\x4e\x09\x14\x5a\xe2\x94\xa3\x52\xba\xa9\x0a\x20\x35\x4b\x8e\xd4\xc2\xbe\x86\xea\x40\xf1\x79\xc8\x3b\x70\xcf\x7f\x75\x27\xa6\x9f\xe0\xa0\xfc\x60\x3d\x9a\x0e\x5a\x05\x13\xae\x37\x47\x24\x8b\xf9\x9e\x95\xd3\x8e\x1a\x0b\xa2\xf5\x19\x4c\x9c\xb5\x31\x14\x99\x05\xa7\x49\x54\x9d\x13\xc3\xa2\xea\x74\xb3\xb2\x5a\xf1\xac\xe3\x95\x83\x2a\x18\x99\x3c\x5e\x86\xb8\x7d\xcd\xb1\x24\x5b\x39\x45\x66\x4c\xe4\x40\x54\x28\xf8\x46\xa6\x60\x11\x22\x23\x68\xa6\x1e\xce\x76\xdc\x25\xc9\xa3\xd6\x4e\x61\x78\x95\x73\xd9\x9a\x9e\x1c\x86\xb7\x0f\xd3\x67\xb6\x0f\xcf\xbe\xdd\xab\x68\x7f\x79\xb6\xa0\xb8\xb1\x72\x8e\xa5\x7c\x30\x84\x44\x84\xbc\x8d\xe1\x3a\xce\x67\xe4\x1b\x94\x81\x50\x82\x3b\x59\xb9\xd9\xc1\xa3\x6c\x7d\x2e\x52\xfd\x1d\x29\x64\x61\xb3\x91\xed\xde\x83\x11\x58\xeb\x25\x06\x66\x11\x06\x0f\xc1\x7a\x84\x69\x9d\x04\xf0\x39\xc3\xfb\xc4\xb1\xd6\x05\xfa\xa0\xe6\x48\xa5\xbe\xa8\xad\xc9\x52\x01\x55\x1f\x16\xb6\xe9\xe3\xed\x6b\xcb\x6f\x25\x3d\x18\x0a\xea\xe2\xfc\xca\x4e\x7e\xb9\xe5\xfb\x4b\xa2\xdf\x7c\x83\x12\xd3\x4f\x91\x63\x25\x7d\xcb\xb2\x46\xb6\xc6\x80\x12\x5d\xe6\xa6\x84\xe7\x0d\x9c\x77\xcc\xdf\xd8\xc0\x72\xe7\xff\xb3\x49\x2f\x49\x7c\x0d\x49\x56\x17\xc8\xcf\x14\x6c\x05\x1b\xc9\x05\xb7\x14\x9b\xd4\x2e\xde\xd2\xf1\x4a\x85\xbf\x38\x86\xb8\x58\x72\x37\x3c\x28\x5c\xe2\x49\xa7\x42\xa6\xe3\xe4\x5e\xd6\x2d\x4d\x3a\xcb\xc4\x59\xea\x96\xc6\x6f\x89\x7d\xe3\x1f\x3c\x44\xf2\xe3\x8a\x0e\xff\x0f\x97\xb0\x4a\x91\x00\x1f\x4c\x99\x5e\x21\x9f\x47\x40\x72\xca\x5b\x8e\xd2\xf5\x5e\x6c\x20\x24\x57\xa9\xf7\x70\xc5\x5d\x70\x86\x15\x15\x60\xc8\x07\xde\xf5\x9e\xb9\x09\xc7\x19\xd9\x82\x3f\x9b\x12\xb9\x56\x84\xf3\xf0\x74\xf5\xba\xe2\xdf\x24\x5e\x5e\xeb\x29\x7b\x0e\xa8\xe3\xbf\xfe\xcc\xa0\xd7\x26\x92\xb4\xe2\xa3\x3e\x0f\x8f\x14\x06\x16\xb1\xae\x7d\xd7\x22\xa6\x6d\xa2\xb7\x4e\x4b\x7c\x04\x00\xdf\xfc\x12\x9b\xbc\x13\xe7\x2b\xd5\x79\xd2\xef\x42\x62\x7a\x06\xf2\x8f\xdf\x01\x4f\x58\xb9\x0d\x71\xe1\x8f\x90\x38\x52\x81\xb2\x80\xa8\x3b\x81\xa6\x80\x27\x8b\x1a\x8f\x22\x18\x15\x0c\x3d\x83\xf3\xd0\x70\x2f\x2a\xd1\xba\xee\x73\x23\x2f\xfe\x6c\xc1\xdd\x5a\xd5\x47\x3a\xd8\xc4\x47\xb2\xd6\x88\x63\x05\xbd\x31\x8b\x35\x6a\xac\x30\xb4\xf5\x27\xd5\x0b\x9e\x63\x1e\xd5\x73\x85\xc0\x00\xa3\x35\xb1\x16\x27\xbe\xe2\xef\x37\x1e\x4d\x09\x9f\x95\x21\x36\x1b\x04\x6c\xdf\x1a\xd2\x7c\x43\x74\xc5\xf0\x49\x5c\x42\xf1\x93\xe0\x29\x06\x79\x35\x1b\x9f\x19\x4b\x62\x4a\x6e\xde\x57\xa7\x47\x2e\x3a\x72\x8b\xa8\xa7\xb5\xfc\x5c\x32\x8e\x05\xa2\x35\x95\x60\x02\x5d\x23\x7a\x13\x60\x6e\x16\xe7\xea\x4c\x46\xed\x1f\xee\x7e\x6e\xff\xa0\xef\xc9\x10\x24\x44\xae\xc0\xd2\xca\x33\x38\xd7\xb8\xc8\xf0\xc7\x09\xbb\x36\xe6\xb9\x15\x5d\x5e\x7a\x88\xc2\x0b\x9c\xc5\x64\xaf\x2d\xcf\x27\x6d\xda\xf5\x8f\x40\xeb\x5a\xc6\xf3\xe6\x95\x33\x89\x2c\x0d\xc4\xea\x23\x98\x9f\xc3\x87\xbe\x96\x81\x27\x07\xf3\xb3\x40\xa9\xcf\x24\x48\xd7\x99\xd3\x39\x37\xa2\x67\x8e\xc9\xae\xd6\xc6\x52\xca\xe7\x6b\xe3\x99\x59\x65\x9e\xad\x5a\x2b\x41\xa9\xe6\x9b\xff\xdf\xef\x22\x73\x3d\x78\xcd\xdb\x1d\xb4\xcf\x21\x25\xb2\x36\x36\x96\x95\x14\x8c\x56\x4c\x62\x83\x05\xd3\x25\x7b\x8d\x2c\xa7\xeb\x8a\x70\x62\x96\x88\xd3\x20\x11\x9b\x93\x65\x88\x86\xba\x81\xf2\x4f\x8d\xd2\x85\x85\x5b\xae\xf2\x8a\xd8\x0c\x36\xdc\x5c\x62\xb5\x65\x75\x1d\x61\xa1\x85\x3c\xe6\x59\xc9\x76\x6b\x1e\xce\x60\xa8\x56\x6a\xb7\x03\x66\xd6\xac\x39\x75\x22\x67\x7e\x07\x19\xdc\xda\xff\x41\x39\xd8\x9f\x0f\x0e\xfc\x2b\x88\xd7\x0e\xf1\x24\xf7\xd0\xa3\x6f\xbb\xe3\x80\x7d\x16\x5f\xf3\x06\xee\x33\x9e\x7c\xcb\x8d\x3b\x7a\xcb\xfa\x6f\x2a\xfa\x01\x28\x86\xd7\x80\x41\x3b\xfd\x14\x57\x2e\x88\xab\x5f\xba\x9c\x7d\x1f\x8b\xc8\xb0\x9f\x39\x89\xed\xbd\x2f\xc7\x2b\xd0\x76\x1d\x1f\x9e\x1d\xea\x2d\x42\xe0\x18\x26\x9c\x0e\xb3\x05\x44\x56\x3d\x89\x4b\xb9\x9f\x70\x7a\xfe\x3e\x6f\x51\xa5\xbc\xcc\x25\x18\xb4\xed\x15\x1e\x5c\x74\x02\xd9\x35\x1c\xf1\xa7\x70\xd7\xa9\x8f\xef\xed\x91\x35\x92\x6b\x58\x6f\x41\x88\x1d\x1a\x80\xe0\xbe\x66\xf2\x8a\xf3\x5d\xcb\x67\xe5\x38\x07\x23\xf6\x12\x0f\xab\x53\x96\xc3\x0a\x66\xec\x99\xa4\xce\x9f\x2a\xd6\xe3\x0f\xf9\x45\xd7\xf4\x2f\x91\x1c\xf9\x3e\x92\x68\x9e\xcd\x1a\xe7\xbf\x2e\x0a\x8f\x62\xfe\xc4\xff\x5c\xfa\xcd\x35\x8b\x8f\xf9\xa2\x27\x1a\x4c\xd6\x59\xff\x4a\x2f\xee\xe1\x84\x13\x25\x7b\x3c\x00\x4e\xde\x56\x4f\x04\x4a\xa2\x92\x76\x39\x31\x47\xc7\xef\x43\x81\x43\x81\x97\x3c\x74\x9a\xe3\x9c\x1b\x57\x75\x78\x82\x57\x27\x20\xd1\xff\xe9\xc2\x75\x40\xbe\xe9\x48\xd8\x32\x34\xdd\xed\x07\x43\x81\xab\x32\xce\x04\x4f\x7a\x9c\x40\x82\x31\x4e\x91\x2f\xfe\x0f\xc7\x04\xdb\xad\x0a\xa9\x33\x43\xa4\x57\x50\xcd\x62\x43\xe5\xa6\x33\x37\xa1\x0f\xe4\xbc\x07\xa7\xb5\x22\x34\x30\x74\x14\x71\x61\x7b\x52\x9d\xa3\x95\x3b\x96\x70\x3c\x1b\xac\x37\x69\xba\xed\x85\x8e\xc1\x37\x8e\xee\x92\x7c\x30\x6b\x72\x62\x5c\x44\x3a\x2f\xb1\x2d\x12\x6d\xac\x5f\xa9\x22\x4f\x0d\xda\xc9\xa3\x3b\x5f\xac\x48\xd9\xaa\x48\xb9\xdb\x7f\x1b\x4d\x77\x8b\xc4\xb3\x6f\x68\xbd\x05\x06\xde\xde\x6c\xd3\x9d\x4b\x94\xe5\x78\x57\x1f\x21\xf1\xd4\xdb\x6c\xd0\x3e\x6a\xd6\x01\xfc\x6e\x1c\x3c\xcc\x84\xba\x54\x7a\x61\x9f\x11\xc1\x60\x33\xac\x1a\x28\xb8\xba\xe9\x86\x61\x60\xfe\x15\x48\xa1\x09\xc2\x44\xb3\xfe\xdb\x47\x13\xec\xff\x34\xf3\xe4\xc3\xf4\xf2\xa1\x78\xc0\x72\x33\xa1\x1c\x25\x17\xf8\x97\x5b\x33\x83\x25\x2c\x26\x03\xa4\x01\xe6\xda\xc2\x72\xab\xf5\x2c\xf7\x2c\x1b\x77\x91\x9c\xe8\x72\x0f\xaf\x22\x69\x5c\xc3\xf4\x47\x81\xdd\xa3\x1d\xf7\x87\xc5\x3b\xb3\xb9\x2c\x77\xa7\x5b\x5c\x44\xe1\xb1\xdc\x9d\xae\x2b\x5f\xbd\xd9\xe2\x22\x90\xae\x2f\xb1\x7b\xbb\x2b\xce\x0a\x91\x75\x33\xee\x6e\x31\x43\xed\x64\x29\x1b\x04\xb4\x46\xdb\x57\x13\x7e\xb0\x8b\x28\xcf\x10\x50\x94\xc6\x86\xac\x02\xa4\xa5\xae\x4f\xbb\xa3\xab\xbe\xfe\x23\x9d\xb7\x17\x39\x2e\x19\xf4\xd7\x95\x6c\xb1\x56\x36\x71\x22\x1b\xc9\x7d\xa0\x04\x89\x8e\xca\xba\x31\xbb\x7b\x71\xd1\xfa\x80\xc1\x1a\x5d\x0e\xf1\x65\x40\x05\x9c\x9e\xa9\xa5\xec\xb2\x61\x60\x0b\x44\x95\xed\x49\x37\x96\xf0\xad\xa9\x67\x2d\x6e\xbf\x04\xa1\xb8\xbd\x26\xd0\xe8\x12\x6b\xa1\x16\x88\x34\xce\x25\xd2\xef\x91\xe3\xe6\x96\x33\x2c\x2d\x25\x23\x3a\xf4\x32\xe2\x1e\x81\x8e\x60\x08\x8f\x50\x3b\x30\xce\xf3\x97\x36\x6a\xcd\x71\xba\x78\x96\xe0\x0c\xe1\xf3\xc3\x42\xe6\x7f\x41\x32\xce\xf0\xe7\xc5\xdd\x49\x1f\xa2\x39\x48\xc8\xd3\x4e\xb2\xec\xcc\x87\x00\x3d\x16\x2f\x45\x07\x67\x20\x9f\x4c\x5e\x04\xd4\x92\xc7\x92\x5f\xad\xde\xf9\xfe\x65\x93\x98\x05\xda\x05\x73\xa5\x59\x5d\x77\x80\xb5\x49\xb3\xd9\x86\xfb\x29\x16\x79\xa4\x96\xbc\xef\x52\x35\x33\x18\x3e\x86\xa5\x89\x5a\x82\x32\x2e\x1e\x02\xd2\x69\x32\x51\xf0\x11\x2e\xca\x68\x40\xee\x61\x94\x53\x12\xc5\x79\xf9\x99\x6c\xbe\xa1\x27\x98\xcb\x93\x5f\x03\xdc\xe2\x3c\x72\xbe\x6a\xd4\x21\x56\xac\x17\xf1\xf0\x2e\x79\x12\x97\x77\x1e\x21\x6e\xe9\xa8\xe7\x2d\xf4\x8a\x5d\x6c\x6c\x5b\x4b\xee\xc2\x13\xbe\xe4\x44\xe7\xd2\x92\xde\x57\x80\x83\xa1\x40\x4b\x7a\x91\x06\xfc\xe6\xfe\x1b\x82\xfc\xf2\x2f\xf9\xd6\x26\x20\x36\xf8\x14\x09\x04\x86\xb8\x9e\xb7\x84\xbc\xe3\x02\x67\x92\xd8\xbf\x0d\x15\xce\x34\x16\xe4\x8a\x93\xf0\x3e\x9d\x3c\xfe\x24\xb1\x27\x7c\xae\xf5\xad\x77\x9b\x48\xa9\x08\xc9\xfb\xad\x63\x8d\xce\x3e\xd8\xca\x61\x34\x09\xf5\x8c\xa5\x5b\xd2\x2e\x12\xf8\xe4\x7e\x3a\x31\xaa\x6f\xf7\x97\xc7\x6d\xad\x96\x6d\xca\x63\xf0\x1c\x38\x88\x1a\xfc\xd1\xa2\x83\x62\xbd\x88\x58\x7d\x92\x87\xc8\x79\xe9\x74\xa4\x8d\x18\xfe\x3a\xd3\xba\x33\x5c\xda\x99\xd4\x09\xca\xf7\xd6\x0d\x97\x4b\x64\x01\x06\x27\x5d\x64\x26\x05\xbb\x35\x59\x9f\x2b\x19\x0a\x65\x01\x43\x18\x96\x8b\x08\xdf\x27\x4d\xf0\x80\xf4\xa8\x46\x46\x7c\x1b\x90\x96\x41\x1a\x31\xa9\x17\x92\x1c\x41\x1a\xee\x5e\x77\x31\x6c\x71\x3f\xe0\xb8\xe1\x39\xfa\xea\x7e\x5d\xe2\x67\xa3\x8f\xef\xf3\xa1\x47\xd7\x31\x7f\xde\x40\x3d\xc4\x45\x2f\x36\x07\x8c\x88\xb7\x0f\x7e\x4f\xd1\x04\x3d\xef\xe6\xba\x35\x18\x44\xde\x37\xd7\x48\x9e\x77\xf0\xb4\x1f\x8c\x20\x32\x30\x7c\x48\x5f\x2e\x06\x86\xe7\xbd\x89\x43\x08\xac\xee\xf1\x73\x6f\x38\x90\x4a\xf9\xb0\x74\x5a\xf0\x5b\xa2\x66\x00\x13\x7f\xbb\x24\x81\x22\x26\xea\x9b\x16\x95\x95\xd4\xa8\x7b\xde\x6e\xea\x2f\xc2\x4f\x5d\x69\x50\x1d\x40\x0f\x47\xd4\x42\x8f\x00\xfb\x40\x89\xac\xef\xdf\xcf\xf7\x47\x1a\x03\xaa\xf8\x42\x6e\x64\x83\xeb\x5b\x4b\x81\xc0\x24\xb0\x3f\xea\x5e\x86\x1f\x63\xfb\x51\xd9\x1f\x3e\x91\x08\xcd\xf3\x95\x46\x13\x5f\x3a\xfe\x2b\x17\xad\x8c\x3c\x7d\x95\x4c\xff\x4d\x9f\x4d\xec\xf4\xe9\xe4\x71\xa9\x3d\x2d\xe8\x27\xa2\xac\xdf\x8f\x08\xdd\xbf\x51\x6f\xb8\x28\xc5\x1c\x8f\x98\xf3\xb9\xe1\x5e\xfe\xd0\x67\xbd\x6e\x91\xc8\x5f\x47\x27\x20\xdf\xb3\x55\xf6\x0f\xd9\xfc\x33\x07\xd9\x7c\xd1\x71\x67\xdf\x9e\x54\xd5\xdb\x85\x80\xa9\x97\x58\x6b\x11\x60\x25\x01\x96\x60\x94\x07\x76\xb0\xbd\x7f\xa7\x58\x1a\x8d\x7d\x38\xa9\x9f\xbe\x40\x1d\x3b\xff\x1c\xa9\x01\x1e\xf3\x56\x51\xdd\x67\x77\x2b\x3c\x49\x46\xfd\x84\xbf\xeb\x95\x8e\x80\x24\x76\xaf\x7c\xc0\x1b\xf3\xb5\xac\xcc\x51\x0d\x32\x39\x90\x92\x9e\x8c\xea\xfa\x56\x9e\x3e\x3b\x22\xc2\x8a\x1e\x4f\xa4\x80\x21\x10\xd1\x5f\x8d\xec\x1d\xe3\xec\x8f\x77\x7c\x91\x18\xa9\x53\xd2\x23\x3b\x99\xd7\x5c\xb2\xc7\x06\x58\xa9\xb5\xd6\xe7\xc3\x2e\x10\x3f\xc2\x9a\x69\x84\xa4\x3f\x0b\x57\x35\xad\xa4\x86\xd6\x93\x5c\x43\xcf\x42\x59\x75\x30\xd3\x8b\x3b\x7e\x9b\x4e\x0d\xa9\xc0\x22\x99\x5f\x77\x11\x94\x97\x55\x3f\x5f\x96\x55\x7b\x82\x40\xd4\xd0\x14\x9e\x5d\x90\xd5\xab\xad\x95\x99\x3b\x82\x9e\xee\x59\x5a\x6d\x75\x04\x0c\x55\x9e\x35\x7f\x4b\x22\xed\x7c\xb0\x89\x90\x96\xde\xcf\x90\xcf\x19\xde\x56\x11\xc3\x1f\xe7\x15\xfc\xf3\x87\x5a\x0b\xd6\xda\x4f\x82\xb8\x78\xde\xf2\xa8\xda\xe5\x75\x9f\x55\xfa\x4b\xcd\xcb\xd9\x26\xdb\x30\x5a\x37\x95\x7f\x09\xda\xf3\x33\xcd\xf7\xc6\xc3\xcb\xd9\x98\xf2\xcb\x21\x92\x77\xfb\x7d\xe1\x2e\xde\x64\xe6\x67\x9d\x18\x58\x6c\xe5\x38\x73\xb2\x03\x38\x06\x03\x3e\xa6\x6d\x3f\x4a\x79\x7b\xb0\x7e\x81\x74\x7e\x3f\xd1\x24\x0d\xdf\x9d\xf6\x9e\x60\xaa\x24\x4b\x3c\x1b\x27\x66\xb6\x59\xa0\x69\x5d\x24\x24\xa3\xf1\xee\x9d\xea\x5e\xcd\xbc\xad\x8d\x3c\xd3\x21\x9e\x7a\x2c\x2f\xfb\x03\x49\xfb\xa1\xea\xea\x9b\x82\x50\x10\x3b\x14\x1b\x14\x66\xae\xcb\x23\xc9\xb9\xd5\x7b\x15\xf9\xfd\xc2\xbb\x5b\xb8\x4a\xef\xac\xf6\x2f\x3e\x87\x98\xdb\x3e\x31\x01\x6c\xea\xca\x4f\x28\x2d\xce\x34\x3a\x9f\xe8\x37\xda\x3c\xf2\xe9\x31\xee\x02\xd6\x9d\xf0\x68\xc9\x13\xd8\xbc\xe5\x9d\x88\x48\xf0\xfa\x00\x51\x88\xf7\x57\x8f\x3f\xe9\x21\x86\x91\x79\x1d\x6b\x04\x0f\xeb\xb2\x5d\x8e\xf8\x51\x77\xbd\xb1\x07\x98\x23\x7d\x0d\xe2\x51\xb9\xf6\xf1\xa8\xe4\xc4\x62\x34\x76\x38\xbd\x1f\x2d\x76\xfa\x91\x5b\xe5\x01\x49\x98\x7f\x8a\x4d\xf8\x01\x36\x49\xaf\x8f\x7d\xf2\xfa\x25\x9c\x43\x64\xfb\x70\x36\x7d\x52\xde\x43\x7a\x46\x68\x64\x95\xcc\xea\x51\x0e\xd3\xc3\x66\xa0\x6c\xb7\x40\xa4\xe4\x17\x3d\xac\x95\xc9\x6c\x00\x3c\xad\xf2\x4e\xe1\x19\xfb\xb3\xea\x50\xce\x3f\x8d\xb4\x9c\x5d\x18\x98\x05\x7a\x22\x3e\xa7\x2b\xa2\x43\x28\xdb\x87\xae\x44\xb7\xe0\x7d\x04\x2b\xdb\x56\x7b\xb1\x0b\xd9\xe3\xd1\xd0\x57\x7c\x02\x1b\xaa\xaa\x08\x56\x79\xd1\x88\x2a\x10\xe8\x43\x89\x85\x19\xff\xcd\x6a\x1d\x90\x0f\x81\x25\x54\x93\x42\x1e\xa0\x80\x11\xcd\x63\x9e\xc0\x04\xac\xf0\xa7\xf9\xa6\x57\x67\xbe\xaf\xe0\xc4\x57\xf4\xde\x7c\x47\xf2\xdf\x7c\x7b\x7f\x6b\xdf\xda\x75\xfe\xb8\xce\x6f\x7b\x90\xc1\x99\x7d\x5b\x63\x73\x3e\x76\x2a\xe2\x5a\x41\x46\x7b\x33\x1c\x83\x5d\x5f\x74\xfc\x4e\x20\x2f\xd2\xed\x3b\xc7\x95\x06\xb1\x48\xce\xf5\x15\x9c\xf9\x0a\x14\xf6\x18\xda\xab\xd1\xca\x9f\x67\xf0\xdb\x2b\xd6\x01\x0e\x26\x75\x88\xa0\xcd\x27\xe3\xfd\xb1\xb5\x38\xa6\xd9\x35\x50\xec\xa2\x1e\x54\x09\x16\xfd\xd2\xd8\xec\xc9\xfd\x03\xd6\x27\xde\x66\x5d\xbe\xbf\xe9\x80\x6d\x7d\x7a\xd1\x43\x1a\xfe\x43\xe1\xbf\x5c\xdf\x25\xe6\x18\xb6\x25\x26\x13\xf0\xec\x2f\x8c\x9b\x41\xaf\x92\x83\xd2\x95\x1b\x8d\xf9\xbe\x2e\xaa\xff\x63\x13\x59\xc9\x5c\xe7\x65\x8c\xff\xce\x7f\x9a\xce\x8c\xc4\xa0\xb8\xa8\xc1\x5e\x8c\xec\x88\x18\x26\x21\x7c\xcd\x4a\x63\x98\x6b\x3c\xbf\x2c\xc1\xf9\xb9\x0e\x7c\x23\xc1\xbb\x5e\x5d\xdd\xfa\xd6\x13\xa2\x7b\xd9\x7a\xec\x33\x1c\xdb\x33\x7a\x50\x3f\x3f\x32\x78\xfd\xf4\x45\x8f\x8e\xca\x00\x45\x62\x32\x90\xd9\xff\xd1\xf3\x33\x4d\xd7\x40\x3f\x07\x07\x05\xd4\xf7\xf5\x13\x1f\xee\x78\xc9\xb2\x0c\x0a\xb6\x72\xa2\x7e\x56\xaa\xe4\x91\x0e\xfd\x19\xb1\xd4\x7c\x8b\x45\x9a\xe2\x73\xfe\x84\xfc\x29\x20\x0b\x11\xe1\xbf\xdc\x67\x31\x3b\xa9\x89\x48\xf2\x79\xd7\x90\xda\xe5\xbf\x30\x08\x0c\xa4\xea\x57\x7e\xda\x9c\x95\x35\x3b\xbb\x1c\x38\xd3\x4b\x67\x4f\x38\xfa\x10\x2d\x2a\x73\xe3\xfb\xcf\x54\x73\x9b\xa1\x74\xea\xe5\x2a\xf5\x2b\x43\x2b\x8b\x50\x09\x68\x3c\xfb\x8b\xf2\x33\x40\xf9\xef\x04\xeb\xdc\x78\x6c\x3c\x53\xd9\x16\x95\x14\x72\xf8\x13\x02\x35\xdb\xc1\x41\xd1\x8f\xe5\xc7\xc6\xe7\xcf\xf5\xc7\x39\x77\x4c\x21\x06\x9f\x6b\xc8\x04\x24\x89\x17\xa4\x89\xa7\x4f\x83\xc8\xc6\x01\xfd\x0e\xc1\xf1\xdf\x49\x1e\x71\xf6\x48\x00\x32\xe7\xc3\x48\xb7\xb7\x72\x71\x83\xf7\xe9\x59\x69\xa3\x82\x79\x66\x9f\x7d\x05\x19\xbf\x99\xf6\x5a\x79\x75\xae\xff\xd0\x8e\x30\xac\x9f\x1e\x57\x7c\xc5\x18\xee\x82\xcc\x7f\xaf\x55\xfb\x56\xf1\xf4\x1f\x43\xfb\xc6\xb0\xa4\xf8\x09\xe0\xde\x21\xd0\xff\xd3\x15\x09\xd4\xbe\x55\xeb\x59\x43\x35\x80\xb9\x19\x36\x30\xb4\xee\x29\x29\x29\x72\x4e\x5b\xc8\x12\x6c\x67\x6b\x78\x49\x39\x1e\x70\x36\xea\xbd\x62\x28\x8d\x5b\xe1\xa8\x09\xf5\x1d\x36\x7a\xcf\x40\xf9\x09\x09\xb4\x59\xc4\x2c\x9d\xaa\xd9\x83\x6f\xb5\xc2\x8f\x50\xbe\x25\x6e\xf5\x8f\x0e\x44\x6a\xc1\xfa\x36\x94\xee\x87\x9e\xd4\x12\x22\x04\x66\x93\xcd\x01\xa5\xff\x33\xa7\xa2\x05\x49\x68\x14\xb0\x26\x13\xb2\x65\x79\xd8\xf0\xd6\x39\xba\xc2\x49\xbc\xf3\x4e\xaf\x14\xb6\x9c\x44\xd7\x3c\xdd\x21\x36\x64\x28\x63\x5e\x75\xfd\x27\xa1\x82\x10\x15\x60\x78\x69\xfe\x8f\xda\x04\x0c\xf6\x70\x95\x02\xee\xda\x1a\xe5\xc6\x74\xaf\x1c\x61\x26\x2c\xa7\x72\x8c\x30\xe8\x6c\x52\x71\xb2\x82\x19\xa0\x13\xc0\xdf\x30\xee\x2a\x11\x35\xa9\xa7\xbb\x7f\xf3\xe7\x9e\xe9\x7b\xd0\x8e\xb0\x2d\xa4\x13\xeb\xd0\x04\xe6\x4c\x87\xc7\xcd\x55\xc0\xe9\xa8\xd4\x00\x01\xf0\xa5\xa6\x49\x42\x2e\x56\x66\x8c\x37\x13\x31\xa2\xdd\x1d\x49\x81\xcd\x40\x53\x39\x81\xaa\x01\x23\x40\x79\x70\xb6\x16\xcd\xfe\xd5\xb1\x1a\xd2\x74\xd0\x0f\x35\x1d\xc9\x66\xb4\x24\xaf\x3f\x12\x4f\x9a\x34\xba\x4e\xce\xbe\xa5\xa3\xb6\xaf\x2e\x69\x4f\xe0\x91\x9b\xe4\x41\xc7\x93\x81\x01\xc5\x51\xfd\x9a\xf1\x44\xb9\x02\x5a\x3c\x53\x65\xa0\xcc\x54\x4f\x71\xda\xdb\x4b\xe5\xa1\x87\x12\xb9\x21\x5e\x30\x31\xd6\x63\xaa\x9b\xe7\xbb\xba\x5e\x41\xbc\x0b\x70\x00\x1f\x3c\x50\x06\x01\xc0\xd4\xa4\x15\x9c\x13\x8b\x47\x16\x29\x17\x20\x7c\xd4\xc1\xa0\xa5\xd9\x09\xa2\x77\x2c\x15\xc9\x08\xe4\xc9\x8f\x53\x1b\xce\xa6\x82\x44\x16\x6a\x5d\x94\x9f\x3c\x00\x3c\x95\x6e\x5d\x18\x5a\x1b\x3c\x5e\xfa\xef\x71\x49\x7e\xe0\x10\x07\xb8\xdd\x0b\xe8\x7a\x79\x1a\x7d\x7e\x13\xe4\x39\x74\x11\x76\xb8\x53\x69\x37\x08\x5f\x20\x05\x1d\x8a\xab\x82\xf0\x02\xf6\xc1\xb2\x79\x30\x9e\x61\xca\x52\x16\x56\x82\xe3\x14\x52\x60\xd3\x4f\xa0\x23\x1f\x8a\x50\xc1\xba\x21\xaf\x92\xc9\x09\x32\xd1\xf0\xcb\x84\xcc\x13\x02\x38\x59\x0e\xa1\x4c\xc0\xb4\x89\x49\xde\x3b\x28\x15\x48\xd0\x60\xfa\xb3\xfc\x37\x79\xf7\xcc\xfd\x59\x33\x9d\x49\xa9\x09\x53\x7a\xc5\x75\x0c\xe9\x81\xd8\x1c\x41\xf5\x4a\xf7\x50\x18\x7d\x3a\x25\xb9\x44\x01\x78\xd4\x75\x9d\xf2\x9c\x4e\x89\xdd\xca\xe4\xbc\xf2\xdc\x83\x6c\xb2\x42\xf4\xe4\xf1\x67\xa9\x8d\x15\x6c\xc2\x7a\x56\x3c\x11\x60\x66\x04\x4e\x29\xb2\xf9\x1d\x51\x4c\x82\x0f\x39\xf6\x62\x49\x44\x87\xb2\x0d\x43\x7d\x8b\x15\xc3\x4a\xce\xc8\xb3\xfb\x78\x37\xa5\x55\x95\x59\xe3\x6e\x63\xaa\xe9\x2a\x0b\xa2\xcb\x70\x99\x85\x8b\xbf\x2b\x5b\x55\x45\x8a\x4b\x1f\x7b\xf3\x4d\xb3\x8c\x81\x09\xe9\xb1\xbc\x68\xee\x42\xae\x61\xf8\xc6\xf4\xdf\xb0\x6c\x96\x29\x75\xba\x79\x37\x78\xc7\x0f\xf9\xfd\x41\xef\xff\x26\xe0\x4d\x18\xe8\x19\x95\x37\xde\x9b\x0a\x4a\x1c\xdc\xcb\x9b\x64\x3a\x86\x5e\xee\xc4\x32\xb0\xa8\xc6\xe3\xfd\xbc\x15\x37\x35\xde\x0c\x32\xb7\xd2\xaf\x3c\x1e\x1f\xc5\xca\x8e\x07\x43\x6f\x47\x44\xc7\xd3\x6c\x82\xc4\x03\x53\x8e\x0c\x05\xa0\x8e\x9d\xdf\x8c\x0b\xfd\x08\xc1\xd4\x72\xe7\x3a\x64\x1f\x36\x95\x14\x72\x00\x3d\x3c\xd7\xf1\xc6\x43\xfc\xcc\xc8\xd1\xf3\x10\x48\x57\x77\xb0\xd9\xc8\xcd\x9f\xda\xdc\x0d\xdf\xf3\x58\xdf\x4c\x63\x1f\x3d\xdf\xa0\xc5\xd4\x8f\x15\xfe\xd4\x8d\x88\x4b\xc0\x23\x39\x7c\xb8\xef\x60\xa7\x6f\x40\xd9\xa7\xa3\x59\xc8\xea\x92\x47\xc6\x86\x30\x92\x6d\x44\x30\x48\xa6\x0a\x41\x95\xd4\xc8\x58\x23\xee\x73\x5c\x6e\x5f\xc1\xb5\x52\xdc\xfe\x86\xfc\x5e\x16\x2e\x55\xc0\x51\x59\xf9\xfc\x16\x8f\x98\x10\xcc\x7c\x02\x4b\xfa\x27\xd1\x0c\xef\x72\xfc\x2a\xf6\xd8\x18\x3c\xe3\x1b\x36\x65\xeb\x6f\x2a\x43\x6c\xcf\x50\x7b\xd8\x64\x14\x21\x91\x29\x94\x12\x6c\x3e\xea\x1c\x00\x63\x79\x24\x57\x4a\x80\xad\xcd\xef\x60\x2c\x41\x9e\x31\xba\xcd\xa9\x4b\xc2\x34\x68\x50\x4f\xc1\xc6\x6e\x8d\x92\x63\xa4\xa7\x8f\xe8\x32\x0e\xee\x52\xe0\x00\x06\x92\x88\x3b\x1d\xb3\xe6\x2f\x23\x46\x15\x1e\x36\x64\x19\xa4\x06\x13\xcb\xce\x5d\x38\x63\x86\x19\xe6\x67\x45\x64\x28\x55\x2c\x12\x75\x1a\x47\x2c\x52\x5c\x04\x07\xc7\x3f\x48\x4b\xa8\xd9\xa4\xbb\xe3\xd0\x30\xa6\x3f\xcd\x2a\x49\x28\xce\xe6\x85\x93\x13\x75\x8f\xce\xcc\x25\xd1\x8c\xb4\xf0\x29\x73\x5a\x3d\xa6\x54\xfc\x95\xe6\x7f\x7c\x79\xf9\x2d\xd9\x03\xe4\x41\xfb\x62\x68\xd6\xaa\x05\x4a\x01\x9b\x08\xbf\x7c\x20\xcb\xd6\xef\x3c\x78\xd0\x5a\xdc\x98\xf3\x75\x17\x3e\x57\x71\xec\x66\x12\x14\x99\xe5\xb4\x2b\xeb\xce\x1e\xdc\xc9\x45\x68\x90\xa8\x4b\x14\xa1\x09\x25\x1c\x1a\x95\xf2\xd1\x27\xc8\x5f\x51\xaa\xe0\xa0\x58\x67\x96\x3f\x11\x5d\xf8\x1a\x77\x8c\x01\xbd\xd0\xd6\xb6\xca\xd3\x69\xda\xe6\xf2\x79\x9b\x22\xaf\x11\x5a\x11\x59\x33\xdf\xbc\xfd\x86\x36\xc4\x8a\x6b\x66\xeb\x61\xe3\xfa\xbf\xec\xed\x4c\x96\x56\xf0\x97\x4b\xdc\x61\x55\x8a\x5c\x5e\xf9\x9f\x45\xdd\x3c\x7c\x51\x3c\x4b\x38\xa3\x7e\x58\x5f\x7a\x66\xc8\x87\x6b\x49\xf8\x65\x16\xb3\x39\xfc\x1f\x50\x74\x90\xe8\x43\x48\x6d\xf8\x88\x7a\x11\x49\x09\x2c\xb6\x54\x35\x38\x22\xf4\xbe\xe6\x63\xa2\xcb\x22\x2b\x80\x33\xc7\x9d\x20\xfb\x64\x0d\xdd\x88\x76\x13\x0e\x75\x64\xff\x8c\xca\xc2\x5f\x2a\xeb\xd8\x9f\x94\x9f\x1a\x8b\xbf\xba\x20\x14\x23\xf8\x6d\x61\x76\xc1\x5d\x3d\x03\x23\x87\x8f\x34\x0e\x6e\xb7\x98\x5c\x08\x42\x72\x0c\x66\xe6\x6d\x0e\x36\x79\x71\x0c\x85\xb8\x91\xcd\x45\x59\xc8\x01\xe5\x20\x11\x50\x6a\xe0\x8e\x14\x8f\xe1\xee\xf8\xe3\x4e\x1c\xfd\x87\xa8\xe4\x41\x99\x2a\xe1\x85\x99\xfa\x0e\x47\x12\x13\xd9\x50\xdf\xcc\x8d\x02\x60\x37\x68\x88\x52\x01\xf5\x3d\x2b\x79\x7a\x08\xfa\xe9\xc1\x1d\xe5\x6e\xe1\x0d\x75\xe7\x22\xfa\x10\x39\x74\x4e\x3a\x4a\xb0\xc6\x28\x34\x78\x72\xff\x4c\x66\x98\xa1\x46\x14\x9a\x21\x25\xac\x0d\xf0\x52\xf3\x9f\xcc\x94\x1c\x22\x76\x6d\xa8\xdd\x53\x55\x03\xe7\x07\x40\x79\x31\x20\x14\xd2\x0d\x5c\xe9\x18\x42\x17\x6a\x08\xea\xa2\xc1\x69\xb6\xa4\x47\xe1\x9f\x8f\x3f\xe4\x72\x70\xb9\x7c\x00\x43\x08\x9f\x24\x8d\x25\x4c\xfa\xde\x49\xa7\x75\x5d\xea\x4a\xb8\x86\x20\x44\x4b\xcb\x00\xad\x5a\xa0\xd2\x24\x1d\xa6\x59\xf2\x04\x25\x02\x23\x87\x92\x6f\x57\xa7\x20\x0e\x3d\x89\x7c\xfc\xea\x65\x5f\xef\x93\xb7\x94\xa3\xc5\xc0\xfb\x74\xa4\x76\xc0\x08\x91\xe1\x83\x5a\x10\xcc\x98\xb2\x32\xad\x0a\xf4\x1c\xc0\xcc\xad\x9a\x76\x74\xb4\x0e\xf9\x0b\x9a\x1f\x47\xef\x50\xa6\x73\xf5\x87\x33\x80\x44\x03\xee\xfd\xe0\x23\x47\x68\x99\x64\x6a\x06\x57\x9f\xa9\x44\xab\xd4\x45\xf2\xf9\x48\xf6\xdc\xa4\x1c\x11\x62\x45\x83\xf2\x4f\xac\xb4\xe1\x35\x74\x25\x8e\x23\x84\x27\xb0\x8a\x18\xda\x0f\xd5\xd9\x02\x75\x04\x92\xa1\x79\x02\x1b\xb5\x79\x29\x25\x16\x0d\x19\x4b\x82\xbb\xb4\x35\xb0\x31\x4a\x8a\xc1\x46\x58\x9d\xd6\xf3\x0d\x1c\x6d\x17\xef\x63\xab\x1b\x74\x18\x78\x9f\x1b\x16\xe6\xa4\xf6\x20\x89\x8d\xbc\x42\xa4\x56\x22\x08\xd9\x23\xee\xf8\x2a\xf2\xca\x88\x71\x00\x89\x69\xac\x49\x5c\xb8\x43\x46\x64\x86\x40\x68\x58\xa0\x31\xa4\x45\x30\x9d\x97\x2a\x02\x4c\x80\xf5\xb5\x4b\x7a\x1b\x92\x1b\xb1\xbe\xeb\xec\x7e\x32\x11\xc7\x1a\x7b\x8f\xe9\x23\x84\x59\x50\xa8\x50\xf8\x42\x65\x88\xae\xe4\xa2\xb7\x47\x5b\x7a\x40\x2e\x83\x6e\x63\x0e\x9d\x0e\x9f\x7e\xf1\x2e\xa6\x90\xf1\xf8\xa3\xbf\x31\x22\x80\x56\x67\xa1\xe5\x00\x6d\x09\x1f\x3a\xa0\x2d\x81\xa4\x46\xee\xec\xee\x99\x75\x54\x27\x37\x20\x17\xef\x08\xc0\x5b\x82\x7c\xd8\x26\x94\x55\x5a\xbf\xc5\x9a\xa4\x8f\x68\x2c\x06\x85\x5d\x0f\x58\x60\xe5\x7b\x4d\xce\xaa\x15\x90\xef\xc7\xc6\xee\x7c\x53\xe6\x05\x10\x19\x89\xc4\xdc\x75\x6c\xfa\x8a\x40\xc4\xfa\x20\xda\xe9\xd5\x1e\xe0\x7d\x95\x28\xdb\x00\x3f\xb3\xce\xbc\x45\x08\xea\x00\x52\x70\xfd\x7b\x51\xee\xd2\x10\xbc\x33\x58\xb3\xe6\xe2\x38\x50\x0c\x40\x03\x63\xb4\xad\xe0\x77\x82\x57\x40\x30\x69\xe9\x7a\x20\x87\x8c\x15\xa4\x18\xff\x7e\x9a\x0f\x1d\xd2\x14\x54\x3c\x80\x46\xc5\x9f\xbd\x0f\x92\xe5\x7f\x26\xd4\x4d\xf9\x6a\x90\xae\xe0\x27\x66\xe8\xe0\x47\xdb\x7b\x76\xef\x49\x94\x22\x24\xbd\xbf\xad\xb1\x93\x9a\xfe\xde\xa8\x6b\x70\xaf\xe5\x94\x2a\xc0\x1d\x12\x07\x77\xf9\x4a\xda\x42\x91\x4d\x00\x59\x25\x5f\x1d\xa4\x2e\xc4\xb9\x0e\x26\x6f\x94\xc7\x87\x5f\x61\x0f\x57\xbc\xff\xfc\x70\xfd\x07\xa2\x55\x3a\x0a\x47\x53\xad\xd0\xc1\x66\xa0\xdd\x42\x7e\xa9\x0a\x7e\x4b\x02\x31\xca\xd7\xb7\x04\x17\xde\x03\xcd\x7f\xd7\x9a\x38\x08\x8e\x8b\xce\x03\xc0\x16\x5c\xd3\xd7\x2b\x44\x27\x4e\xad\xe6\x02\x85\xe8\x44\x28\x09\x40\x6d\x42\x62\x0b\xae\x36\x51\x02\x4a\xee\x82\x5c\xf7\xda\x1b\x3f\xc9\x2a\x3b\xed\xa7\xb5\xd6\xd7\x9d\xcf\xd5\x9d\xdb\x93\x6a\x57\xed\x71\x6b\x86\x63\x1b\x9b\x1b\x64\x00\x94\x17\x71\x21\x8a\x10\x9f\xd8\x24\xd4\x0c\xc5\x09\x55\x73\xbd\x98\x0e\xdc\xbb\xb3\x81\x3f\x59\x7f\x32\x14\xab\xbc\x8a\x06\xf3\xf4\x21\x5a\x3e\xa4\xa5\x97\x04\x03\x24\x94\x34\xc5\x77\xac\xfb\xb2\x8e\x44\xb4\xfd\x22\x22\xb0\xb2\xa3\x5f\xab\xaf\x73\x28\x55\x4c\x5d\x68\x4d\x28\x0f\xa5\xaf\xbd\xd2\xc9\x7b\xc4\x97\xfb\x15\x97\x1a\xe7\x87\xf2\x3e\x4b\x84\x07\x4e\xd1\xd7\xf7\x10\x08\xd7\x0d\x9b\x61\xa1\xd7\xb2\x44\x7e\x53\xbf\x48\x88\x42\xe1\x9e\xfd\x22\xf6\xf3\xbe\x68\xcd\xbf\x47\x0c\x39\x5b\xb7\x99\xcc\x91\xcd\xd4\x3b\xa9\xa5\x03\xa7\x1d\xe5\xbb\x2b\x48\xcd\xa7\x92\x02\x95\x9a\xfb\x42\x5e\x59\x62\xb8\xa8\x42\xb0\xc2\x03\x4c\x25\x3a\x80\x90\x68\x3f\xe9\x2c\x75\x97\xf9\xee\xba\x5b\x4a\x0f\x87\x22\xbc\x29\x4c\x81\x58\x29\xdf\x28\x5c\xe4\xea\xc1\x48\x19\xce\x73\xdb\x30\x9b\x97\x17\xa3\x22\x85\xe0\x32\x70\x60\xf4\xe0\x4c\x89\xb3\x98\xc5\xd7\x14\x03\xe6\x4c\x59\x8c\xd9\x95\xb8\x29\x83\x81\x18\x4f\xab\xd6\xc8\x8d\x7d\x95\xf8\x05\xa4\x10\x3e\x44\xcc\xbf\x42\x18\x6f\x66\xcb\xca\x52\x99\xb1\x6f\x1c\x41\x9d\x27\x71\xf0\xad\xf5\x39\x62\x4b\x7b\xd0\x10\xe6\x21\x0e\xa0\xe2\x4e\x8f\xd8\xa5\x45\x8f\x27\x79\x6a\x95\x34\x0a\x98\x05\xe8\x0f\x06\x21\xaf\x21\x35\x41\x0f\x78\x1f\xf4\xcc\x00\x11\xba\x88\xe5\x38\xbe\x7d\xf8\xa2\x9b\x2e\x82\xbc\x52\xe8\x38\x7e\x1a\x12\xdb\x41\x07\x19\x60\x68\x3c\x20\x57\x5f\xaa\x09\xc7\x22\x35\x0c\x03\x5c\x1f\x33\xc8\x17\x62\x25\x83\x4e\x7a\x77\x9e\xe4\x40\xca\xea\x00\x0e\xb9\x8c\x03\xb6\x8c\x84\x16\xf6\x5b\xe5\x1e\x3a\x15\x88\x43\x68\x4a\x1d\x48\x58\xd5\xb5\x37\x2e\x4b\xbb\xfc\x44\x5e\x84\xd4\xec\xf0\x80\x8f\xf0\x68\x4b\x84\xa2\x0a\xaa\xc6\x58\x1d\x16\x60\xf3\x40\x94\x6c\xa8\x58\x0c\x6c\x10\x69\xdd\x3b\x9d\xda\x53\x1a\xf8\x83\x55\x32\x3c\x69\xa1\xc8\x25\x42\xa0\x4b\x88\xe5\x90\xce\xb0\x4f\x6a\x68\x11\xc4\xdd\x8b\xe1\xcd\x4a\x1b\x11\xa9\x64\x41\x39\x12\xcc\x14\x54\x56\xbd\xc6\xee\xc8\x0f\x21\x51\x27\x1b\x0a\xe9\x10\x58\xa5\x38\x75\xf7\x61\x57\xd0\x31\x53\xad\xbb\x3f\xd2\x78\x88\xe0\x22\x20\x29\x3c\x84\x0d\xd7\xdd\xb1\xd0\xd0\x61\x22\x72\x06\x0c\xa6\xf4\x1b\x42\xff\x9a\xb9\x77\xe2\xd7\xb6\xd2\x4d\x3f\x67\x21\xbf\xd7\x9d\x11\x36\xdd\xfd\xd3\x7f\x03\xe6\x62\x84\xa1\x89\x2e\xc7\xee\x9e\x48\xde\x7e\x73\x5a\x6f\x1f\x6c\x8b\x07\xc0\xc7\xdb\xcc\x5c\xa9\x4e\x70\x7f\x47\x62\x85\xee\xf8\x6c\x91\x6b\xd9\x1d\xb7\x07\xda\xa1\x0c\x47\x02\xf0\x53\x0a\x14\xf7\x26\xaa\x4e\x87\x1c\x48\xa1\x50\xa1\x95\x56\x83\x93\xec\x24\x83\x52\x3b\x40\x0c\xf3\xbd\xe8\xa2\x87\x0d\x69\x8a\x00\x35\xac\x98\x58\x43\x57\xfc\xaa\xf6\x21\x12\x51\xd3\x00\x6e\x34\x77\x3d\x74\xe4\x74\xed\x9a\x0b\xd1\x10\xfd\x66\x06\xd6\x95\xe6\x35\x22\xe2\xa9\x00\x68\x68\xc0\xda\xa0\xa4\x36\x8e\x0c\x85\x26\xd5\x06\x16\x3c\xc1\x8b\x7c\xf8\x87\x18\x6d\x75\x59\x6c\x49\x7c\x02\x84\x61\x11\xfd\xd8\x1d\xb1\xbc\xef\x91\x8a\x5e\xa6\x6f\x93\xc1\xb8\x63\x86\x02\x1c\xff\x6e\x22\x1c\xd0\xb5\x6d\x72\x17\x73\x0a\x14\x8a\x21\x10\x4a\x3d\x04\x9a\xc2\x06\xd9\xe7\x8f\x84\x15\xba\x10\x17\x80\xa8\x9f\x2b\x9b\xd4\xcf\xc5\x22\x74\x27\xde\x1c\x8b\x3b\x7b\xb8\xd2\x9f\xb8\x65\xcd\xba\xfa\x85\x80\x2e\x53\xcf\xff\x89\xc2\x1e\x39\x9f\x89\x80\x0f\x4e\x63\x3b\x46\x40\xac\x5d\xf3\x2a\x47\xa3\x79\xec\x6a\x0c\x3a\x1d\x42\x38\xd7\xbd\x12\x6e\x25\x5a\x40\xdd\x42\x85\x63\x53\x5f\x8b\xee\x86\xdf\x90\x8d\xb0\xac\xed\x5c\x79\xec\x9c\x7c\x96\xd1\xd9\xa8\xca\x73\x7a\xc0\x0e\xeb\xa8\xa4\x47\x03\xf2\xb7\x50\x1f\x43\xff\x6c\x34\x54\x1d\xc2\x2e\xbc\x6d\x54\x77\xfc\x77\x35\xf9\xb9\x17\x33\x35\xce\x88\x88\xf2\xad\x89\xc6\x47\xb7\x90\xfb\xc2\xc9\xb3\x39\xa9\xef\x96\xf2\x8f\x25\x32\x79\x63\x9f\x3d\xda\x98\xe1\xf9\x06\x49\xc2\xba\x07\xd6\xef\x69\xd6\x76\x11\x31\xe7\xaa\x1a\x5b\xd7\xf4\x51\xca\x15\x02\x18\xc8\x3b\xe0\x83\x71\x8f\xa1\xea\x0c\x6a\x72\xa6\x20\xc1\xae\xc8\x4d\x67\x43\x5d\x68\x57\x26\x29\x30\x94\x50\x21\xb0\xe1\xa8\x13\x98\x42\xc0\xe2\xeb\xe6\x42\xa7\x00\x49\x94\x58\xb0\x5a\x42\x10\xe3\x20\xdf\x1b\xd2\xb6\x34\xfb\x45\xb5\xa9\x17\x91\xff\x28\xbc\xd8\xfc\xf0\xc3\xd2\x86\xbd\xcc\x7e\xc4\x3f\x02\x01\x9b\x3a\x4c\x14\x3a\xf1\x64\x27\xfe\x1e\x11\x21\x92\xd1\xc9\x1b\x95\x73\xf2\xb6\x85\xac\xc7\xf6\xf0\x1e\x9c\x38\x7f\x03\xf0\x3e\xb3\x52\x93\xf0\xb8\x18\x90\x0a\x24\xb1\x8d\x6d\x68\xe7\x48\x77\x91\x7a\x49\x6e\x8a\x1b\x8a\x1a\x02\x90\x3a\x09\x66\x82\xae\xf7\xab\x0d\x3d\x93\xe5\x11\xbf\x98\xe8\x55\xe9\xa4\xe6\x89\x7c\x68\x39\xc7\x3b\x74\x70\xba\xcd\x99\x6d\x22\x67\x71\x2d\x19\xfa\x49\x7a\x64\x84\xfc\x53\x16\x64\x78\xc7\xe9\x86\x96\x69\x62\x58\x1f\x96\x35\x4b\xbd\xe1\xac\x65\x11\x03\x34\x6b\xa1\xfe\x81\x4e\x93\xf0\x18\xe4\xf9\x80\x0c\xc8\x9a\x25\x3f\xf1\x65\x1f\x91\xd4\xa8\xd2\xbd\x22\x86\x42\x70\x4a\xf2\x05\xdb\x46\x63\x81\x86\x1c\x88\x5e\x23\x7a\x1b\xce\x45\x3b\x50\x84\xb0\x97\x6e\x5a\x47\xa9\x7d\xf2\xe9\x54\x84\x3f\x50\x28\x3e\x75\xa2\x78\xee\xc0\x00\xf6\x11\x60\xc1\x8c\x3b\x07\xd4\x30\x03\xcc\x52\x12\xd1\xc2\x96\xa3\xf8\xe7\x56\x9b\x40\x08\x9d\x85\x06\x9e\x4d\x51\x24\x44\xc0\x0d\xfe\xd4\x43\x54\xb3\xc3\x49\x89\x63\x5f\x04\x06\x41\x34\x44\x95\x84\x91\xa1\x53\x77\x48\x9e\x4f\xba\x91\x43\xaa\x1d\xb1\x38\x01\xf4\xab\xc6\x7e\xd1\xc5\x00\xa6\xf6\x78\x58\xdb\x53\xb7\x19\xec\x9d\x86\x24\x8f\x82\x00\x1a\xfd\x53\xfe\xc0\x0e\x64\xcd\xda\x23\x19\x1d\x64\xea\xb4\xd1\x3d\x3d\x19\xb7\x6a\x20\x2d\x7a\x97\xe3\x78\xab\x2a\x99\x1a\xc4\x1d\x04\x83\x58\xa1\xfe\x59\x75\x16\xa4\x13\x2c\x42\x47\x48\x9c\xc0\x1c\xe7\x81\x5d\x3c\x0d\x28\xf3\x6c\x85\xa7\xf1\x0b\xa4\xaf\x66\x24\xe9\xeb\xab\xca\xe9\xd3\xd7\x7f\x5e\x26\x09\x51\xbc\x2a\xfd\xbc\xe9\x3e\xff\x58\x67\x3e\x50\x09\x8d\xa0\x90\x16\xa1\xb4\x06\x2d\x0c\x54\x9b\xf4\x48\x93\x7d\xec\x24\x98\x4e\xd1\x2b\xfb\xda\x2c\x35\x2a\xce\x10\x26\xa1\xcb\xcf\xda\x8f\x26\x77\x86\x0e\xb7\xd4\x0d\xb4\x38\xa7\x74\x76\xc1\x7d\x87\xd0\x03\x4e\x2d\xac\x89\x49\x66\xc4\xec\x72\x2e\xff\xa2\x1d\x7d\x55\xfe\xef\x96\x72\x89\xbd\x4b\x77\x02\xc3\x14\xe6\x28\xed\xd1\x1a\x97\x24\xc4\x5c\xda\xa4\x34\x69\x13\x0f\xf3\xc7\x84\x61\x25\x45\x18\x20\x69\xab\x21\x48\xa3\x18\xb5\xa4\x44\x6d\x04\x71\x50\xd1\xe2\x48\x2f\x1e\xc4\x78\x46\xd0\x7e\x2f\xfc\xfd\x76\xdd\x2c\xcc\x38\x67\x8d\xdc\xf0\xbd\x7c\xe8\xf2\xd8\xfd\x7a\xe8\xc0\xf9\xa7\x82\xa2\x00\x36\x08\x61\x71\xdd\xdf\x43\x05\xfd\x01\x6c\xcf\xd0\x32\x81\x1c\xd0\xa9\xdf\x0c\x9a\x3d\x43\xf3\xc4\x79\x16\x1d\xdb\x07\xcc\x9b\xdc\x24\xf1\x90\xd6\x73\xaf\x21\x6b\x72\xb0\x7d\x18\x90\x72\xcc\xaa\xd0\x78\xad\x83\x4a\x0e\x85\x4a\x1f\xcb\xd9\xc9\x59\x9d\x96\xed\xa6\x5c\x0d\x9c\x6b\xfc\x27\x08\x5e\xf8\xda\xb1\x36\x9a\xb3\xbf\x41\x7b\x02\x94\x52\x41\x6b\x27\x4f\x3c\x42\x42\xfc\x0d\x99\x15\xeb\x97\xd0\xf7\x93\x24\x01\x0a\x31\x7c\xff\x89\x07\x0d\x72\xc1\x27\x15\x7e\x3e\x2e\x45\xe2\xb2\x5d\x60\xb7\x47\xe1\x51\x16\x0e\xc8\xa5\x94\x86\x66\xec\xa4\x01\x8c\xc4\x5e\xa3\x41\x41\x11\x09\xae\xa7\x42\x57\x27\xc2\xd3\xf4\xe8\xba\x5b\x9a\x23\xf6\x0c\xa9\xa6\x9d\xba\xc1\x07\x04\x2b\x19\xdf\x63\x76\x3c\xe5\x05\xbe\x9f\x77\x71\x13\xea\xfb\x86\xfb\x77\x99\x2b\x79\x14\xbe\x20\xdc\xf7\x8f\xfd\x7b\x6b\x5d\xdf\xa5\x47\x50\xae\xb7\xd7\xf1\xbb\xca\x7e\xf9\x16\x92\xb3\x7c\x45\x8e\x83\xe5\x60\x9e\x04\xc9\xd9\x59\xe6\x6d\x5b\x0c\x73\x01\x92\xd0\x84\xfc\x16\x24\xf5\x70\x37\xd6\xec\x47\x72\x19\x7d\x41\xd4\xe5\x17\x73\x8e\xc3\x55\xc1\x19\xdf\x2c\xb5\x2e\x48\x94\x78\x3b\x80\x32\x49\xf6\x72\xed\xb4\x70\xf0\x75\x5a\x96\x98\xcd\x7f\xb3\x67\xaa\xfc\x47\xd1\x12\x1e\xca\x5a\x33\xde\xfb\x0b\xd9\x26\xaa\x99\x19\x94\xb6\x08\xc5\x07\xbf\x69\xde\xbc\x9b\x06\xe0\x55\x40\xa0\xe0\x8f\xfb\x9b\x7a\x2e\xba\x7f\x93\xdb\xe8\x3c\xde\xcc\xc1\x84\x87\xf9\xb9\x23\xbf\xf2\x73\x63\x55\x8b\xa3\x25\xf4\x47\x7c\x4a\xf4\x21\x73\xc1\x49\x48\x43\xf1\xc3\xf1\xfb\x83\x55\x60\x7f\xdc\x9f\x7a\x3c\x79\x04\xed\x11\xe8\x93\x64\xe9\x93\x90\x85\xe4\x93\xa5\x28\xf5\xc9\x52\xc3\xf8\xd8\xc8\xc9\x16\x0a\x44\xcb\xe1\x13\x4c\xd1\x9f\x4e\xb1\x22\x1f\x1b\x0f\x2f\xa6\xc7\x7d\x12\x39\x77\x3e\x69\xd3\xf6\xc6\x88\x95\x8f\xba\x7f\xf0\x64\x7f\x19\x1b\x05\xe8\x55\x84\xd7\xda\xca\x7f\xf0\x62\x78\xef\xf4\xfe\x7c\xd9\xe8\xdf\x1f\x59\x7c\xef\x8f\x9b\x69\xef\x8f\x34\x2e\x6e\xc5\x4e\xbc\x95\x19\xf7\xbe\xb5\x04\x69\xa0\x93\x52\x87\xe7\x4f\x33\xd6\xc5\xec\x54\x51\xcc\x19\x62\xbe\x91\x01\x4d\x0f\xde\xa2\x86\x81\x86\xca\x19\x6a\x2a\xc3\x41\x2b\x16\x90\x97\x06\x90\xfc\x44\xdd\xc8\x4f\xf5\x0e\x29\x87\x77\x5d\xcc\x58\x67\x68\xa0\xe1\x85\x2d\xf0\xfd\xcb\x63\x30\xa8\xd5\xc0\x77\x7d\x5c\x7a\x16\x0e\x09\xe6\x65\x0c\x6d\x93\x0a\x0f\x8f\x83\xce\x7a\xa4\x4b\x2a\x29\xbc\x39\x28\x92\x28\x92\xfa\xed\xcc\x06\x5e\x33\xfb\x4e\xf1\x38\x84\xb7\xf0\xe0\xbe\x63\xdd\xf5\x5d\x0e\xc9\xaa\x44\x5a\xc3\xbb\x6c\x3f\x1d\x94\x75\xf7\x09\xdb\xbb\x98\xed\xc7\xab\x2c\xd7\xa9\xb3\x2d\xcc\x63\x77\x90\x0e\x21\x29\xcf\x60\x4d\x69\x38\x25\xf6\xb2\x0c\xb3\x08\x10\x81\x13\x7f\xad\x98\x04\xeb\x09\xde\x7c\xf8\x25\x37\xc1\x99\x7c\x79\x3b\xff\x2f\x54\x5c\x02\xcc\xaa\x32\x98\x5f\x3d\xfa\xe0\x5d\x62\x95\xf3\x5d\x86\x4d\xf5\x1a\x56\x12\xb1\x82\x48\x47\xef\xac\x38\xb3\x20\x6b\x16\x32\xab\xef\xf9\xe2\xcb\x86\xe7\xac\xa1\x36\x19\xc5\x86\x38\x51\x5d\xd7\xc5\xcc\x20\x1f\x4a\x20\xe0\xb2\x37\xdd\x16\x69\x35\x1b\xca\x12\x0a\x71\x74\x36\xc4\xff\xda\x20\x2e\xad\x9d\xfc\x09\xe9\x13\x91\x9f\xba\xe6\x8b\xa7\xa3\x02\xed\x88\xaf\xdf\xb4\xc1\xb6\x05\x10\x3f\x09\x5e\x04\x43\x55\x5e\xd4\x77\xfe\xed\x93\x7c\x89\xcc\x8d\x37\xed\x43\x08\xc8\x88\x92\xd0\xe0\x73\x56\x0e\x2c\xe6\x8c\xe0\x97\x7e\x0a\xc7\xf3\xc9\x4b\x34\xfd\xdc\x16\xc8\xc1\x11\x7f\x4e\xf9\xa7\x2c\x83\x04\x0c\xde\x8e\x84\x55\xb2\x9e\x94\xe7\xf2\xf1\xa0\x26\xcb\xe7\xaa\x32\x7c\x38\x30\xf5\xa5\xc3\x13\xca\x32\x6a\x30\x8d\x49\xf7\x9d\xae\x23\x94\x5c\xce\xd3\xc7\x6a\x89\xcd\x08\xf9\xc2\xca\x3b\x39\x95\x30\x87\x38\xdb\x90\xa9\x13\x8c\xcc\x6f\x0f\x10\x95\x13\xfe\x8d\xf8\x68\x2f\xd7\x35\xa4\x68\x56\xa8\x45\xfa\x1d\xfc\xd1\x12\x83\x2e\xc8\x9f\x5f\x99\xdd\xd9\xe6\xe1\xef\x1f\x95\xd4\x3b\x3d\x9b\x26\x0c\xab\x29\x72\xb7\xd7\xdd\xb7\x0c\xdb\x57\xad\x93\x6b\xae\x54\xe5\xf1\xbc\xea\x53\x0a\x2f\xcc\xf9\xb3\x32\x2f\x41\xe3\xf9\xaa\x83\xd2\xc7\x5e\x0c\xbb\xa6\x90\x4c\xd9\x19\x18\x86\x80\xb9\x42\xb5\x16\xfb\xac\x16\x2e\xac\xbc\xca\x4f\x17\xe3\x15\x43\x95\x01\x2e\xef\xbe\x10\x99\xd1\xfe\x2b\x59\x91\xec\xd3\x88\x42\x78\xba\xd9\xfe\xca\x4c\xf6\x7a\x79\x0c\xc5\x49\x94\x7b\xc9\xba\x80\xf5\x51\x48\x01\x47\xaf\x6c\x1f\xf3\x5d\xa8\x1c\xf9\xb2\x17\xeb\x3f\xc1\x7b\x90\x02\x8a\xbd\x9e\xba\xd7\x9b\xe9\x28\x2f\x64\x66\xf6\xb7\xa3\xe3\x25\x95\x93\x83\xea\x38\xf0\xa3\x9e\x01\x78\x9b\x5a\xd9\x02\x0f\xd1\x49\x65\xae\x57\xda\xde\x1f\x6f\xd4\x40\xf6\x3d\x0d\x3f\xfd\x97\xd2\xd4\x5f\x36\x2d\x5f\x43\x08\xe6\x7e\xc5\x11\x4b\xad\x02\x08\x16\x54\x77\xf3\x02\x8d\xee\xfa\x53\x8a\x71\x36\xbd\x97\x6b\xf3\xee\x4b\x9c\x6f\xaa\xc7\xde\x50\xbb\xa2\x7c\x2f\x2f\xb7\x1c\x4f\xc9\xd8\x40\x96\x4a\x20\x7f\x94\x39\x4f\x8d\x19\x84\x96\xc7\x31\xf9\x75\xc6\x59\x06\xe7\xc4\x5f\xda\x86\xd4\xf0\xb9\x11\xcd\x21\x31\xd2\x9f\x3f\x59\x9e\xbc\x8f\x05\x71\x37\x3e\x04\x02\x87\xa2\xec\x2b\x85\xf6\x0c\xc8\xa2\x93\x10\xca\x9b\xbe\xb6\xbb\x09\x9f\xdf\x10\x55\x3e\x08\x2a\x77\x30\x9c\xfe\xde\xaf\x39\x87\xf2\x3b\x96\x1f\xff\x28\xca\x78\x55\x6f\x39\x17\xee\xb5\x05\xc7\x63\x8d\xce\x0b\x04\xbf\xfa\xc1\x74\x38\xdd\x8b\xb2\x5e\xee\x79\x71\x89\xa5\x7b\xa0\x8c\xdb\xf5\x91\x5f\xe6\xfa\xac\x21\xe3\xf1\x61\x57\x7b\xd9\x68\x34\xd0\xd7\x7d\xbd\xb3\xbe\x26\x20\x92\xa9\x5f\xc1\xf5\x74\xc9\x4f\x8b\x52\xda\x30\x9e\x11\x76\xdd\x92\x7c\x41\xe2\x7f\x48\xc3\xdb\x44\x8b\x3d\x11\x64\x3a\x77\x99\x6b\xc0\x1d\x27\xff\x88\x01\x96\x6e\xc9\x51\x25\xe2\x52\x9b\xc2\x4b\x79\xc1\xc0\xa5\x0e\x08\xa8\xff\x1a\xd0\x2f\xca\x15\x3a\x31\xc8\x04\xff\x10\x82\x79\xa3\x38\x44\xdc\x01\xcd\x66\xc3\xbc\xd7\x23\x3f\xfc\x9b\xb8\x10\x1a\xa0\xc8\x98\xeb\x68\xc1\xa2\xd7\x61\xb3\x48\x84\xf6\x13\xbf\xe2\x4c\x8a\x03\x03\x80\xf6\x12\x5b\x18\x22\x85\x4e\x17\x51\x00\xca\x2a\xfd\x51\xd8\x4b\xf4\xab\x54\xfa\x19\x2e\x36\x65\x48\x59\x44\x14\xd4\xd5\x44\x5d\x2a\x48\x3a\xfc\xce\xaa\xbf\xc2\x4b\xec\xf4\xd6\x01\xaa\x5c\xa1\x6c\xab\x97\x55\x57\x2e\x4e\x41\xce\xa2\x48\x39\xef\x0a\x52\xa7\xab\x3e\xd9\xf1\x5d\x55\x62\x3e\x55\xbc\xb8\xae\x49\xe1\xe5\x2a\x59\xbe\xcb\x75\xb1\xfc\x54\x05\x16\x35\x8f\xea\x16\x0e\x0c\xd7\xfc\xd1\x67\x70\xc1\x03\x48\x15\x9e\xf9\x0e\x3d\x31\x40\xd7\xbc\x99\x8f\x3b\x74\x68\xd0\x47\xe7\x41\x90\x7d\xf3\x05\x92\x5d\x9e\xae\x4a\x9c\xa6\x84\xaa\x4e\x0b\xd5\xc5\x1c\x9b\x7b\xd2\xb6\xa7\xcc\x57\xe2\x41\xfc\xaf\x6a\xa3\x61\xe2\x66\xc8\xdd\xe4\x7f\x85\xde\x24\xa0\x81\x0f\x2c\xbf\x7e\x39\xf0\x36\xf5\xa2\x78\x92\xbd\x27\x7d\x0c\x57\xde\x45\xae\x68\xc8\x6f\x9d\x54\x8f\x17\x06\x96\x85\x63\xeb\xe5\xac\xad\x7c\x76\x08\xf2\xe2\x4c\xcf\x2c\x46\xde\x79\x7e\xe4\xb8\x56\xb9\x9a\x4f\xf5\x02\x11\xae\x86\xd7\x4b\x66\xd1\x95\xa7\x66\x00\x5e\x59\xea\x38\x6e\xc4\x5f\x94\x5a\xb9\xd2\xad\xe0\x37\x43\xf2\xfb\x5c\xe9\x0c\x66\x4e\x17\xbf\x59\xd5\xcb\xd9\x86\xf3\x3a\x56\x62\x68\x80\xb3\x15\x60\x8d\x2a\x16\x34\x6c\xa3\x3c\x78\xf4\xc6\x61\x19\x5a\x39\x69\xa6\x2d\x70\x21\x6f\xc2\xe6\x0c\x54\xb1\x59\xd2\xfc\xb9\xf2\x9b\x47\x3f\xd3\x29\x75\xfc\x2b\x85\x2f\xf9\xf2\x09\x0d\x81\x64\x75\x3a\x55\xf7\xfc\x7e\xd6\x1f\x1f\xf9\x17\x6b\xb7\x6d\x0b\x1a\x60\x92\x01\xf8\x1c\x92\x5c\xf8\x6c\x9b\x74\x30\x3e\x83\xb8\xd2\xcd\x92\x75\xf2\xf2\x77\x0e\x25\x1b\x04\x7a\x4c\xa1\x74\x63\xb7\x2e\xe1\x94\xf7\x4f\x3d\xfb\x7c\x65\x76\x5d\xe7\x7d\x7c\x24\x68\xb3\xe3\x85\x66\xc2\x4d\x6a\x36\xb5\x63\xb6\xb1\xcb\xdd\xf8\xc9\xc1\xcf\x97\x04\xba\xc4\xa3\x16\x8e\x99\xe7\x8d\xac\x6b\x0a\x3c\xdc\x4f\x5f\x0f\x3b\xef\xa9\xd1\xb7\xdf\xd6\x85\xe8\xce\xee\xe1\xad\xb8\x16\x83\xa1\x45\xe1\xbc\xff\x3a\xe0\xba\x2f\x99\x61\x50\xbf\x19\xab\xc4\x60\x9c\xbe\xce\xd1\x71\xbb\xfc\x1d\x00\x09\xff\xbd\x2b\xa4\xb6\xcd\x51\xdf\xcd\x2b\xe4\xe4\x67\x8a\xf0\x03\x66\x3a\x12\xd0\xec\xfd\x7d\xec\x1f\xc7\x70\xe1\x9c\x2e\x90\x15\x97\xc9\x2f\x89\xce\x1c\x9a\x20\x03\x79\x58\x80\xf0\x1c\x47\x26\x26\xaf\x03\xad\x2a\xfb\x50\xc4\xb1\x89\xbe\x62\xa9\xa1\xb6\xc3\x1b\xbf\xaa\x44\x7d\x20\xa8\x63\x06\x78\x28\xbc\x54\xa9\xca\x54\x7e\x5d\x06\xc6\xf8\x4f\xff\x9c\x75\x6e\x83\xa3\x32\x35\xcf\x0b\x19\xa8\x3c\x77\x09\x21\x72\x83\x71\xcf\xe4\xd3\x3c\x03\xa7\x98\xde\xdb\x96\xbc\xd4\xae\x8e\x93\xfa\x80\xbc\x0b\x64\x91\x12\x6c\x3f\x45\xa1\xbc\x35\x69\x9d\x65\x89\x0b\x64\x05\xdd\x38\x8a\x1e\x43\x1b\x7d\xa8\x06\x99\x11\x1d\xcf\x0c\x9e\x41\x3e\xd3\x2c\x05\x2f\x08\xe7\x14\x70\xf0\x09\xeb\x37\xe9\xbc\xf4\xb6\xa0\x32\xce\x6a\x35\xf6\x2a\xc0\x45\x74\xb1\xc4\xac\x8d\x19\x44\x32\xf2\x81\xe3\xdf\xb0\x6b\x02\x85\x08\x03\x70\xfa\x61\x09\x2a\xba\x2a\x49\x04\x56\x9c\xd7\x2f\x71\x07\x7a\x3b\xf1\xb2\x5b\xd0\xbe\xc1\x41\x55\x1c\xae\x96\xd8\x6e\xc6\xcc\x87\x7d\xd0\xb9\xc3\x10\x61\x85\xf7\x83\xf2\xa9\xae\xaf\x13\x92\x37\xd5\x2c\x5e\xb9\xec\x4f\x50\x29\xfb\x4d\xec\x85\xa4\x9e\x66\xe7\x32\x5e\xca\xa3\xeb\x4e\x01\x18\x66\xda\xd9\x6b\x90\xc3\x64\x47\xda\x28\xbb\xe2\xb8\x5c\x43\x87\xd1\x9e\x06\xed\x46\xd5\xba\xcd\x8a\xf7\x53\x83\x01\x81\xfa\x4f\x08\xd5\x39\x04\xe2\x20\x5d\xcd\x4a\xea\x2a\xd4\xa3\x6b\x87\x47\x1b\x40\xd6\x8b\xdf\xbb\x02\x5f\x6d\xda\x56\x25\x68\x54\xa5\x4b\x54\x5b\xd8\xb0\x2b\xee\x60\x89\xcc\x31\x7b\xc1\x73\x2b\x4a\x63\xb6\xc9\xbb\x04\x25\x56\x3a\x3c\xa0\xc1\xb3\x85\xf6\x4e\xad\xee\xa6\x35\xc0\x79\x0d\xde\xce\x57\xa5\x3d\x66\xf6\x18\x6b\x38\xd5\x0d\x71\x79\xe7\x04\x39\x53\x48\xf2\xdc\x3e\x7e\x21\x80\x7a\x63\xf9\xd2\xd9\x97\x2a\x12\xa1\xf3\xa7\xec\xb1\x14\x8f\xc4\xb2\xc9\x67\xa8\x78\x2c\x29\xc4\x7d\x9e\xf7\xc8\xef\x12\xcc\x19\x7e\x99\x67\xf8\xad\xce\xa7\xd3\x23\x9d\xcf\x47\xe6\x66\x51\x92\x9c\x0d\x9e\x94\xc2\x35\x40\x06\x0e\x00\x76\x17\x4f\xaa\xec\x9d\xe5\xdf\xb3\x35\x1f\x99\x15\x67\xd1\xd5\x8b\x54\x61\x4a\x74\xa5\xe5\xa0\xfa\x49\x09\xb6\x58\x20\xfe\x67\x93\x1c\x2e\x50\x6e\x5f\xa3\x0d\x11\x75\xe5\x4f\x40\xa8\x28\x19\xa1\xe5\xc5\x55\x87\xb3\x55\x14\x4b\xab\x7a\x87\xe5\xf9\xa4\x25\x73\xc2\x36\x08\x31\xa1\x2c\x01\xa5\xa2\xb0\x6b\x00\x55\x32\x8f\xcf\x40\x3f\x45\xa1\x4e\x2d\x41\xf4\x47\x67\xe9\xef\x58\xe9\x3d\x9b\x72\x88\xf3\x20\x01\xcc\xf7\xaa\xda\x1b\xb2\xd9\x16\x1f\xcd\x7c\xff\x15\x0b\xba\xc1\xbf\xcf\x0b\xcd\x37\xd7\x1f\xcf\xf9\x88\x43\x0f\xac\xb4\x39\x82\x95\xc8\x53\x55\xd1\xc2\x01\xf1\x77\xe5\x15\x6a\x3e\x65\xb3\xa3\x6e\x41\x4a\x7f\xd8\xf0\x5d\x25\x22\x69\xb8\xb8\x8f\x0e\x1c\x25\x54\xb4\x42\x3a\xed\x4d\x51\xac\x39\xfa\xc8\xd9\x19\x1d\x98\x6c\x07\x81\xa1\x97\x64\x8a\x6c\x16\x7c\xa5\xd8\xb9\xb3\x2c\x71\x94\x26\x76\xd0\x21\x92\x42\xc9\xec\xeb\x5e\x42\x7b\xec\x92\xca\xdb\x6c\xd6\xc9\x47\x40\xe2\x41\x20\x2f\xd0\xe1\x0c\x34\x3c\xf3\x27\x9a\x50\x16\xad\xe0\x09\x5f\x37\x85\x7e\x14\x11\x7f\x62\x1e\xa1\x1e\xc4\x03\x7f\x09\xb8\x2d\x46\x0d\x00\x9d\xa7\xd9\x1b\x19\xa2\x8c\x7a\x3b\x79\xe3\xe3\xce\x5a\x7a\x38\xf3\xba\x8b\xac\xff\x44\xc3\xd0\x3e\x04\x28\x38\x5a\x9c\xdd\xef\x8c\x17\x9f\x97\xce\xdd\x6b\x67\x48\x7d\x42\xab\x88\x05\x3f\x70\x9b\x7c\xb3\x8c\xf4\x62\x43\xf6\x1b\xb9\x6c\xce\x3c\x30\x7c\xfe\x8c\x8c\x87\x33\x27\x24\xa2\x13\xf5\xea\xfe\x73\x12\x6f\xd7\xd9\xdf\x1b\xe3\x83\x5d\xbf\x68\x62\x07\xd8\x1f\xf0\x24\xb6\xd7\x06\x0e\xc5\x5d\x54\x34\xb6\x91\xa2\xd7\xb6\xb3\xf1\x7b\xef\x6b\xc7\xe7\x67\xb3\xf3\x44\x85\x4b\x48\x1b\xdd\x54\x42\x05\xa4\xd8\x86\x23\xcd\x02\x5d\x06\xe9\x88\x43\xc5\x89\x4e\x41\x24\xa7\xdb\xb8\x79\x35\xb3\xfb\x25\x5a\x74\xd3\x94\xc3\x7c\xd7\xff\x3d\x69\x2b\x64\x8b\x6e\xa7\xe6\xd6\xc1\x87\x7a\x7a\x2c\xf1\x35\x4d\xa2\x2a\xe2\x11\xc0\xed\x8f\xaa\x52\x65\x3a\x68\x3b\x2c\x6e\xcf\x50\x47\xb0\x95\xeb\xdb\x64\x90\xa2\xf3\x35\x94\xee\x90\x54\x22\xaf\x08\x40\xfe\x49\x2e\xad\x2e\x5c\xb1\x70\xc3\xba\xdc\xfc\x93\x47\x6a\x5a\x2e\xbe\xd1\xd5\x59\x37\xb7\x48\x80\x0f\x28\x78\xd4\x7c\xa3\xfc\x95\x53\x0a\xd1\x0c\x6e\xc4\x13\x58\x9a\xda\x1e\x16\xcf\x55\xc7\x12\x8f\xe4\x27\x0c\xe6\x12\x4b\x85\x28\xdf\xb1\x0f\x8d\x53\x52\x55\x73\xfe\xa9\x2b\x2d\x7a\x04\x0c\x63\x76\x60\x0f\xcb\x1d\x15\xda\x6e\x62\x51\xbf\x27\x9a\x8e\x5f\xd5\x53\x17\x2a\xa0\x67\x4f\x93\xa6\xc7\x44\x4b\x48\x52\x6a\x06\xc6\xb6\x6f\xd1\x97\x93\x3e\xd2\x4c\xfa\xf8\x34\x0f\xea\x4c\x7c\xdc\xce\x50\x2d\x6a\x05\x6c\x24\xac\x9e\x10\xb3\x27\x42\x28\x3b\x7f\xca\x5e\x2d\x1d\xc8\xcf\xbd\x08\x25\xa7\xe4\xdc\xd5\x7e\xbf\x58\x5c\xfc\x34\x24\x01\x28\x04\xad\x13\xfc\xd1\x44\xda\x46\x9e\xc3\xba\xc3\x77\x80\x2c\x20\x29\xa0\xf3\x8f\x19\x15\xf2\x1e\x0e\x24\xda\x84\x5c\x71\xf7\xcb\x19\x94\xf6\xd3\xca\x81\xde\x7a\x3d\x1d\x9c\x24\xea\x64\x7d\x83\xd4\x91\x0d\x5f\xa2\x8f\x30\x78\x4e\xf2\x82\x9d\xa1\x5b\x0f\x6e\x7e\x49\x3a\x85\x08\x94\x0d\xa3\x2a\xbd\xb0\xde\x7c\xa9\xb7\xf4\x9e\x28\x13\x72\x5a\xcf\x40\x6d\xb5\x34\x4d\xf1\xcc\xa7\x84\x69\x05\x71\x08\x4d\x85\x12\x94\x35\x07\x5e\x24\x2d\xae\x17\x28\xcc\x62\x70\x3d\xc3\xe3\x43\x59\x9d\x8f\xb4\x87\x3e\x54\x8b\xf9\xb8\xcf\xf4\xc0\xfa\x90\x8c\xc9\xe3\xfe\x4a\x10\xe9\xfe\x48\x72\xe5\x7e\x55\x2f\x48\xcb\x74\xdc\x9c\x05\x98\x69\x38\x28\x5e\x07\x30\xab\x4c\x92\x6e\x62\x48\xda\x61\x46\x8c\x52\xb4\x11\x0f\x27\xbb\xf4\xb8\x3d\x53\xf5\xb8\x7d\x69\xf5\xf0\xe8\x3b\xa9\x40\x31\x07\x0f\xd3\x21\xc4\x6a\x51\x7a\x48\xb1\x5a\x2d\x32\x0e\xd3\x23\xb8\xb8\x63\xef\x6c\x83\xd1\x4f\x73\x0a\x29\x09\x1e\x56\x41\xb4\x09\x25\x96\x3c\xbb\x8d\xed\x92\x7a\x62\x60\x2a\xd4\x9c\x36\x70\x77\x9d\xb1\x11\xe7\xca\x5b\x8f\x35\xf7\xef\xdf\xad\x38\x88\xd6\xe5\x51\x15\x4e\xe2\x6a\x82\x17\x17\x59\x91\x5f\xcd\x7f\x82\x5f\x80\x79\xcd\xc0\x52\x5e\x7a\x4a\x09\x6a\x86\x7f\x8d\x57\xca\xd7\x1c\x37\x64\xf3\xdc\xb8\x97\xa1\x69\x4c\x0d\x91\x26\x7c\xd4\xa1\x71\x3d\x00\x8f\x71\x68\x92\xe4\x33\x6c\xbb\x78\x50\x36\xfd\x92\xe2\x57\x24\xe2\x03\xa8\xba\xdd\x22\x99\xaa\x6e\x91\xfa\x13\xe7\x90\x9e\x45\xc3\x43\x7c\x30\x3c\xb4\xc8\x6b\xa5\x77\x4f\x56\xfa\xc5\xcb\x3f\x0a\xfb\x58\xa3\x2f\x3e\x18\x1f\xb4\xcd\x10\x99\x18\x82\x78\x86\x0f\xcc\xb0\xf9\x6f\x4a\x67\x61\xbd\xc2\x4b\x84\xda\x3a\xa0\x83\x0b\x2e\x3b\x35\x4f\x8f\x0a\x8b\xd8\x32\xcf\x63\x2a\x52\xf7\xc1\x24\x91\x8f\xb6\x84\x8e\x56\xa1\x2b\xef\x28\xf9\x19\xa5\x8e\xcd\xfd\x1c\x72\x50\xf0\x5e\xf2\x68\x0d\xb6\x98\x94\xfd\xc4\xae\x4a\xdf\xd6\x42\x80\xb3\x34\xd0\xf2\xc7\x0c\x78\x3f\x69\xfe\xc7\x9e\x13\xc1\x18\x59\x32\x4c\xfb\x1e\xd2\x64\x79\x27\xd1\x21\xc8\x19\x6f\x2e\x6f\x1f\x59\x1a\x36\x47\xf6\x4c\x7c\x4a\x8a\x21\xf4\x4a\x7b\xed\x69\x48\x60\x69\xb4\x69\xc5\x10\x7b\xc7\x00\xdd\x29\x65\xaa\x5c\x64\x33\xd8\xd4\x5d\x9a\x4a\xe1\x6d\x32\xdb\x71\x90\x60\xd3\xa0\x50\xd9\x23\xf7\x9c\xa1\x18\xb8\x65\x77\x19\xd4\x0f\x7b\xc5\x28\x1c\x41\x37\x69\xd3\xf8\xa5\x63\x7c\xce\xa1\x68\xab\x23\xe2\xf1\xe1\x04\x3d\x92\xf7\xad\x06\x7d\x7d\xe0\x48\x6f\xb6\x91\x04\xbd\xfb\xc2\x5e\xf9\xf0\x44\xfa\x2a\xb4\x85\x92\x9b\x9c\xa5\x56\x52\x69\xe9\xba\xc4\x3b\xe3\x50\x02\x4b\xd7\x3c\x4a\x73\xe9\x4a\x0f\x2f\xed\x61\xf4\x0e\x28\xdb\x94\x88\x11\x80\xcd\x8a\x6c\x41\x23\x74\xe8\x19\x78\x2f\x7e\x26\xee\x5a\x29\x95\x96\xc0\x63\x7d\xe8\x2e\xca\x36\x27\x81\xc8\x6b\x3f\x22\xcc\x02\x40\x72\x6b\x50\x30\xe5\xed\x20\xc5\x91\xd5\x1b\xee\x5e\xbf\x1d\x48\x05\x76\x84\x78\x26\xf4\x8b\xd8\x2f\xa4\xfe\xfb\x47\x93\xca\xa6\x0f\xe4\x2a\xfb\x9f\x13\x4d\xbb\x63\x16\xce\x3b\x85\x2f\x82\x01\x9c\x0b\x3a\x20\x00\x6f\xde\xad\x3d\xc8\x9c\xf6\x7b\xf7\x48\xd2\x3d\xb4\xf3\x76\xd9\xda\xfb\x3d\x49\x3c\x8a\xfa\x30\x07\x09\xd5\x76\xeb\x2b\x39\x84\x42\xfa\x49\x7e\x0d\x83\x3e\x0a\xc0\xc2\x7d\xc6\xca\x34\x36\xd4\x3d\xef\xf8\x8c\x78\xa0\x07\x61\xd0\x2a\xdb\xdd\x03\x25\x19\x29\x10\xe5\x52\xdb\xe5\xc8\x14\xd8\x39\x22\x2b\x17\x68\x8b\x13\x21\xb3\x9a\x2a\x36\x58\x86\x39\x03\x78\x19\x52\x30\x1e\xfe\x7b\x0a\x95\x10\xb1\x12\x37\x82\x01\xaf\xaa\xd2\x40\x77\x4f\xe7\xa1\x0e\x0d\xb2\x74\xf2\x3b\xb9\x53\x8d\x1b\x04\xbd\x14\xa4\xa0\x5a\x4e\x24\x09\x9b\xba\x37\x21\xa9\x9d\xd3\x2b\x03\x08\x02\xf1\x1b\x80\x1d\x75\x85\xd0\x4e\x0d\x57\x03\x10\xcf\xbb\xc8\x55\xba\xbb\x0a\x82\x8e\x6a\x3f\x7e\xc2\x51\xcf\x6a\xd9\x98\x3d\xe4\x7f\xa1\x50\x85\x90\x17\xe9\x2a\x99\xf9\xf8\xf5\x56\xbc\x2f\x12\x28\x5a\xb2\xf4\xa4\xf2\xa5\x6a\x23\xf1\x65\x21\xb0\xc9\x32\xff\x99\x3e\x6a\xd2\x06\xff\xb9\x15\x02\x49\x29\xaa\xe0\x2c\x29\xa4\x6f\x77\x68\x0d\x78\x53\x35\xd4\x17\xef\x05\xf7\x72\x86\x07\x72\x2f\xdb\x9d\xb9\x8a\xb7\x97\x46\xa1\xb1\x17\xd9\xc5\x7b\x51\x06\xd1\x8e\xf5\xcb\x10\x8d\xda\xf8\x86\x68\x8d\x5a\x71\xa9\x94\xa0\x0d\xe4\xa7\x20\x4e\x45\xfc\xbc\x79\x30\x48\x5b\x64\xe9\xdb\x86\x6c\x5e\x43\x21\x2a\x55\x32\x52\x7f\x99\xc9\xbe\xa3\x13\x96\xb7\x01\xac\x9c\xad\x12\x08\x21\x3f\xe5\xfa\xdf\xa5\x1e\x04\x12\x80\xc8\xad\xdb\xcd\xcc\x77\x0f\x1a\x34\xaa\x96\xb2\x4b\xf8\x68\xf6\xd8\x60\x7f\xb6\x20\x53\x98\x78\xa8\x58\x42\x77\xcc\x21\xa5\x7f\x94\xaf\x43\x52\x63\x40\x2b\x17\xb4\x1c\xc3\x3f\xe6\xd8\xa7\x39\xbb\xe7\x60\x73\xe4\xda\x99\x56\x7a\x85\x56\xd4\xa1\x06\x91\x0f\xc9\x3b\xa3\x3f\xbd\x58\x86\xc2\x93\x9d\xaf\x48\xd3\x6a\x8b\xd0\x00\x83\xdb\xa7\xe7\x14\x68\xa7\xde\x01\xef\xd3\x70\x92\x03\x0c\x8e\xfb\xd6\x88\x6c\x44\x91\x52\xbc\x19\x59\xf4\x7d\xef\x31\x61\x31\x40\x49\x36\xe6\x8d\xec\x59\xca\x5b\x45\xf4\xe8\x7b\xd6\xd0\xb6\x5b\x87\xcf\x8a\x88\xa2\x6e\x87\xe4\x2e\x4f\x91\x8a\x8f\xe8\x7b\x52\x86\x96\x01\xda\x62\x7b\xb2\x4f\x86\x72\x4b\x2f\x49\xaf\x52\x84\x8a\x72\x4e\xaf\x06\xa4\xc9\x74\x6b\xdd\x10\xfa\x54\x14\x48\x4b\x97\xbc\x81\xbb\x33\x68\x27\x21\xed\x09\xc3\x17\xe9\x1b\x4d\x99\xea\xa4\xd5\x4d\x8d\x2a\xbf\x59\xa7\x41\x91\xd2\x94\x3d\x5a\x5e\xc1\xf5\xff\x1c\xed\x2d\x6a\x0c\x92\x53\xe4\xf4\xdb\xc5\x50\xef\xe2\x53\xda\x31\xdc\x87\x50\x08\x76\x91\xce\x68\x87\xf6\x2a\xcb\x45\xfa\x4f\x2e\x47\x35\x11\x24\xe5\x06\xed\x52\x6f\x4b\x8f\x8b\xdf\x91\x59\xe4\x58\xc5\xa2\x30\x58\x8a\xf6\x8d\x6c\x76\x96\xe8\x43\xde\x29\x36\xa4\xc8\x35\x51\x62\x2c\xe9\xd3\x4f\xda\x8c\xb7\x94\xfa\xc5\xe7\xaf\xd0\xb7\xd2\x2b\x45\x0a\x53\x88\x64\x71\xca\x5e\x15\x78\x5b\xbf\x85\xd3\x90\xfa\x4d\xbe\x5c\x53\xdf\xec\x85\xea\x2d\xaf\xbd\x4d\x1e\x96\x50\x6d\xa9\xb7\x47\x5d\xfb\xf1\x18\x59\x38\x64\x79\x2e\x5e\xf3\xf4\x56\xd1\x6b\x6c\x81\x97\x3a\x07\x14\xfb\x52\x75\x6e\x31\x8e\xb7\x66\x32\x1f\xfe\xb9\x40\x23\xcb\xdf\x55\x0d\xfe\x63\x9f\xb7\x67\x27\xfc\x74\x32\x10\x49\x67\x55\x3a\x0e\x99\x1e\xa1\x03\xf3\xe3\x66\xec\x82\x75\x73\x95\xd3\xc7\xba\x9f\xd2\xb3\xda\xf5\xd5\xd4\xad\x8e\xde\x90\xea\xc6\x60\x58\x33\x98\xe7\xea\xfe\xf4\xba\x9c\xdf\xfa\xf6\x6f\xdc\x20\x57\xd8\xaa\x22\x9e\xaa\xac\x8a\x2a\x27\xa1\xf5\xde\xff\xf8\x9b\x21\x96\x54\x0c\x8e\x49\x86\x97\x75\xe9\x74\x55\x9b\x15\xbe\xb1\x08\x19\xae\x27\x1c\xf9\xbd\x23\x8a\x6f\x31\x14\xbe\x62\xce\x1f\xeb\x02\x20\xba\xcc\x8a\x76\xaf\xc3\x46\xa6\x52\xf0\xc9\xf8\xf7\x05\x97\xf1\x93\xca\x00\x75\xa0\x6b\xbc\xf6\xcc\x77\xa9\x1d\xa2\x5a\xf5\x3d\xd5\xc4\x20\xb0\xed\x96\x8e\x9b\xe7\x19\xd3\x4c\x36\x58\xbf\x2c\x37\x9b\x95\x90\x4b\xd0\x36\xa8\xac\xb3\xc1\x1b\xce\x1e\x72\x73\xc2\x60\x4a\x6a\x41\x79\x2b\xd4\xb6\xcc\xc2\xf1\x40\x9d\xad\x6a\x2d\x6e\xa3\x90\x91\xd7\x1f\x22\x5c\x54\xce\xaa\xc7\x94\x68\x0c\x6e\x48\x5f\x4d\x02\xdc\xd1\x41\xd3\x13\xa8\x7c\x8b\x62\x3d\x37\x0c\x2a\x21\x83\x55\xf2\xcb\xbf\x10\x70\x13\x41\x92\x93\xd0\xbf\xa7\x0d\x7c\xcb\x4d\x6a\x4c\x5b\xa9\x68\x0b\x69\xa6\xfe\xc3\xfc\x6e\xda\x5a\x3d\x0d\x5d\x43\x6d\x1a\xb7\x65\x44\x0e\xf0\xc0\x17\x07\xbd\x4d\x0b\x5b\x10\xdc\x8a\xc6\x1c\xcc\xfa\x5b\x8b\xc5\x42\xce\xa7\x57\xdc\x86\xd9\xcb\x4b\x32\xe9\x62\xdc\x69\x40\x47\x96\xd0\xe8\x2a\x74\x8e\x6d\x61\x7d\x6f\x8c\xaa\x40\x82\x1e\xfb\x08\x43\x21\xad\xb4\x31\x20\xd8\x8a\x21\xce\x83\x5a\x73\x7c\x40\x7b\x70\x33\x66\x03\x8f\x94\x37\x4b\x43\x63\x0b\x80\xdd\x12\xe3\x9d\xb7\x14\x32\x5f\x20\x5c\x63\xf7\x89\x4c\x44\xbd\xc2\x44\x2f\xed\x96\x1a\xa9\xe3\x06\xc3\x96\xcb\x75\x1e\x5f\xe3\x5f\x05\x8c\xb0\xc2\x1f\x3c\xb9\xce\xb3\x29\xfd\x6f\x6b\x91\xf3\x5b\xea\xd0\xd9\xac\x9f\x23\x31\x77\x72\x85\x9a\x9b\xab\x5d\xbc\xd3\xb3\x5c\x6f\xfa\x1c\x20\xea\xf5\xf1\x12\xec\xed\x12\xcb\xb8\x19\xa9\x84\x52\xf2\x0e\x80\x14\xb9\x00\xa0\x40\xc6\xfd\x4b\xf0\x5c\x29\xe5\xef\xb2\x60\x3e\xf6\x1a\x1a\x29\xa5\x62\xc6\x30\xcf\xbf\xe1\x05\x08\x4a\x58\xe3\xde\x44\x60\x03\x39\x5b\x69\x88\xdc\x41\x35\x6b\x28\x49\x64\x0c\xcb\x25\x5b\xfe\xd7\xb0\x9c\x30\xd0\x0e\x9b\x75\x26\x68\x29\xe8\x80\xd0\xfa\xb9\x75\x1a\x30\x43\x52\xb6\xe8\x6e\x6b\x3c\xeb\x3d\xb0\xb7\x76\xc0\x3d\xc8\x11\x54\x2c\xb2\x6d\xcc\xa1\xf4\xf5\xe5\x27\xb2\x56\xad\x40\xac\xf5\x5e\xb8\x20\x8d\xee\x83\x2a\x2a\x35\x46\xb6\x55\x1e\x87\xd5\xdd\x04\x5e\x49\x52\x2c\xad\xf8\x26\xff\xa8\x8f\xcd\x44\xa1\xc5\x75\x14\x1d\x3b\x29\x59\x1e\x6d\x43\x6f\xa1\x1e\xd4\xc0\x01\x0b\x14\xff\x55\xcf\x10\x3a\xb3\x31\xb1\xea\xc2\xb0\xd6\x6a\xa0\x09\x71\x17\x1f\x6d\x51\x19\xc6\x85\xc6\x4a\x6d\x90\x00\x4e\x2d\x5e\x7a\xfb\xfb\x9b\x29\xe9\xff\x43\x88\x6e\xd5\x0d\xce\xe4\x38\x55\x08\x8b\xb9\x7c\x9c\x23\x8a\xd3\xb8\xa8\xd8\x9c\x6e\x9d\x1e\x89\xce\xab\x50\x0d\x55\x97\xaa\xd1\x61\xad\xcf\x78\xc6\xe5\x94\xfa\x4b\x05\x5d\xbc\xa4\xd5\xe6\x50\xee\xaa\x60\x6b\xe4\xf5\x42\x8d\x8d\x53\xa2\x35\xf2\x86\x1d\xa8\xec\x59\xfa\xec\x6d\x45\x62\x3a\xe5\xb5\xdc\xa1\x08\x29\x32\x32\xd4\x03\x49\x9f\xcb\xe9\xdb\x2e\x66\x64\xdb\xc7\x86\xb1\xf0\x22\x94\x3b\xc8\xe9\x3d\xb0\x02\x4b\x2d\x9c\x72\x84\xce\xe4\x5a\x2a\x15\xf8\x0d\x70\xc8\x35\x7b\xe2\xca\x02\x3c\x62\x83\xfd\x13\x0a\x64\x92\x46\x5b\x43\x23\xac\x49\x8b\xd5\x8f\x40\x69\x72\x63\xfc\xa0\x0d\x68\x40\x86\x72\x98\x8d\x24\x84\x60\xda\x97\xda\xd9\x33\x64\xc3\x16\x49\x99\xd9\xdd\xf4\x7c\x0a\x05\xd2\x56\xf2\xbe\xc4\x86\xc3\xd0\xf3\x2a\x03\x17\x8f\x3c\xbf\x5a\x02\x70\xee\x22\xd7\x4e\x49\x18\xe5\xaf\xc4\xbc\xde\x27\x0b\x89\x7c\xc1\xed\xeb\xf5\xc9\x4d\x39\xeb\x54\xb5\x6c\x7a\xa8\x81\x73\x85\x9a\x2a\x9b\xb7\x7d\x98\x7a\xa5\x88\x16\x39\x24\x46\xe6\xaa\xae\x14\xcc\x70\xcc\x45\x9c\xb5\x31\xbd\x80\x3b\x85\x24\x7d\xab\x13\x93\xeb\x04\xc8\xe7\xae\x84\x24\xb2\x43\x3e\x0c\x4d\x68\x20\x3e\x62\x74\x5f\xda\x53\xaf\x38\x8a\xbf\xda\x26\xdd\x1c\x18\xf4\x24\x3e\x16\x9c\x08\xae\x3a\xa6\x6a\xe0\x41\xf3\xbd\x21\x55\x82\x02\x58\x88\x28\x1e\x42\xea\x0c\x3c\xfe\xca\x1d\x5d\x73\x5b\x98\x58\xf3\x7c\xa9\xc1\x60\x89\x28\x54\xc7\x42\xfe\xc7\x06\xc7\x22\xf9\x20\x84\xde\x38\xe8\x2f\x26\x86\x3b\xf0\x72\x6f\x51\x99\x6b\xef\xe4\x23\x44\x39\x94\x89\x5c\x11\xec\x2d\xa5\xaf\x25\x4b\x58\x2b\xa4\xbf\x96\xf4\x0a\xe9\xaf\xa7\x7d\xe5\x4d\x25\x6c\xd3\xeb\xec\x9f\xb1\x2b\xc7\x45\x9e\x7a\xe3\x7d\x59\xde\x36\x2a\x49\xd2\xac\x80\x42\xd9\xd1\x74\xd0\xf0\x81\x2c\xd8\xad\x4f\xbf\x87\xef\xa0\xb4\x8d\x26\xd4\x35\xfa\x92\x34\xef\xcc\x1e\x1d\xe3\xf3\xd6\x7e\x50\x3a\x85\xab\x7e\xfd\x50\xa7\x5b\xef\xb9\x38\xe6\x60\x69\xaa\x61\x55\x9a\xb8\x84\x29\x8e\xa0\x6b\xce\x35\xc3\x42\x49\x0c\x43\x45\x08\x8c\xb9\xe9\x17\xd8\x5a\x61\x53\x10\x13\xfb\x16\x25\xc6\xd8\x40\x00\xd5\xeb\xf5\xbd\x8b\x83\xeb\xd2\x18\x80\x75\x15\xad\xa5\x01\x51\xfc\xaf\x47\x34\x4c\x08\xa5\xa1\xe3\x0a\xf4\xd3\x28\x43\x36\x5c\x08\xa4\x21\x84\x83\x07\x4b\x7b\xd8\x4a\x6d\xde\x8d\x25\xd2\x36\x0a\x19\x74\x21\x66\x16\x12\x53\x1f\x89\x17\xa6\x7f\x91\xc6\xb6\xa6\x7b\x09\x31\x31\x9b\x19\x95\xd4\x94\xcc\x42\xa8\x2c\x6e\xd8\xec\xb4\x10\x0a\x83\x9c\x59\xfb\x3f\xf5\xfe\x92\xbc\x29\x50\x36\xe3\x6c\x7a\x45\xf2\xa4\x14\xb7\x6c\x38\xe3\x39\xce\x10\x0f\xc3\xc2\xa4\xbb\x06\xa1\x61\x56\x34\x2c\x3b\x97\x83\x1e\x2a\x74\x52\x34\xd5\x06\xd6\xd4\x10\xba\x65\xf7\xa0\xbb\x39\x14\x0b\xb0\x46\x42\x27\x72\x05\x42\x0f\x4d\x12\x6a\x47\x0e\xdd\xb2\xdc\xc4\xcc\x3c\xb9\x48\x34\x37\x2e\x68\xc6\x77\x07\x4e\xfe\x68\x80\x69\xfb\xde\xf9\x4a\x82\x09\x19\xd8\xda\x40\x44\xa0\x1a\x4c\xda\xa2\x6f\x49\x1b\x1c\x73\xbc\xd0\x56\x43\xec\x2c\xe4\xcc\x7e\xe2\xa1\x69\x7b\xa0\xa9\xb0\x8a\xdb\xa4\x47\xb8\x85\xf2\xd7\xf6\x1b\xde\x52\x48\x19\x82\x13\x52\xf7\x1b\x7e\xfb\x35\xad\x0c\x57\x59\x11\xef\xce\xbb\x58\xe2\x51\x35\x0d\xb0\xa8\xb1\x9a\x50\xfa\x29\xf2\x00\x4b\xbb\xd2\xd0\xa4\x9e\x1d\x3a\xd0\xf3\xaf\xa6\x5e\x69\xbe\xb4\xa7\x34\x6e\x10\x86\xb0\x67\xc6\x4d\xad\xe9\xf1\xe7\xb6\x1e\xd4\xeb\x4b\x0f\x78\x27\x79\x68\x39\xd5\x6c\x8a\x88\x0b\x5d\x32\xad\x34\xf9\xb4\x29\x94\xd7\xe6\x25\x04\xeb\x38\xd8\xa6\x09\x6b\x67\xdc\x33\xed\x66\x12\xf2\x79\x4c\x5b\x68\x9f\x4d\x21\xa8\x36\x65\x1b\x4c\x79\xfb\xbf\xbc\x30\x60\x44\x29\xf3\xd8\x88\xdf\x5a\xa1\x94\xa3\x87\x37\x0c\xea\x5b\x10\x24\x24\xe6\x21\x9b\xa0\x6d\x3f\xea\x01\xdb\x5a\x83\xc2\x0e\xab\x2e\x71\x2b\xfd\x73\x0b\xa9\x46\xc5\x87\x58\x69\x56\x87\xa7\x6e\x01\xe6\x87\xd6\xc1\xb0\x91\xd8\x34\x30\xd6\xe8\x53\xeb\x67\x91\x26\x1a\x9c\xee\x22\x71\xc0\x9e\x94\x50\xc4\x3d\xe4\xca\x54\x51\xeb\x20\x3a\x1e\xd2\x75\x1a\xce\x68\x8e\x9b\x3d\xc2\xed\xe5\xd3\x4b\x8d\xed\x22\x71\x34\x58\x3a\xc5\xc5\xb7\xc8\xfe\xb6\x12\xfc\x25\x8e\x38\xb9\x59\xee\xe0\xfe\xc4\x6a\x6b\xf8\xc3\xa1\xe8\x76\x7a\xc9\x06\xb1\xdc\x90\xd8\xa2\xf4\xd1\xed\x02\xe4\x22\xf3\x5a\xcc\xd8\x4d\x92\x6b\x1b\xf8\xcb\x7e\x0e\xc7\xd9\x72\x77\xce\xeb\xb7\xd4\x2f\x5b\x32\x74\x18\xa5\x9b\x04\xe2\xa6\xe8\x77\x20\xd7\x36\x1f\xb9\xc1\xa4\xbd\x0a\x4d\x5d\xea\x19\x0a\x6b\x48\x7e\x95\x30\x95\x99\xc3\xd2\x66\xc3\x7a\x32\xe5\xc2\x2a\xd3\xc1\x16\xb0\x22\xd1\xc6\x5e\x14\x3e\x65\xe5\x49\x49\xa6\x5a\xd9\xc4\xa0\xef\x76\x5e\x8c\x3f\x02\xae\x5d\x3c\x19\x08\xbf\xc5\x92\xe1\x52\xb9\x64\x8b\xf2\xdc\x54\xc5\x96\x00\x63\xb0\xcd\x1f\x97\x6a\x13\xb7\x8e\xd5\xc8\xaa\x06\x42\xfc\x16\x47\x83\xc4\xbf\x17\xae\xbe\xb1\x26\xfd\x93\xb6\x2c\xce\xe0\x95\x05\x47\x11\xab\x6d\xb6\x24\x47\x11\xa0\xb8\x5a\x89\xe7\x80\xd8\x74\x96\x9b\x76\xfc\xe6\xd3\x70\x45\x85\xbe\x5b\x5e\xb9\x6e\xe2\x98\x1a\x52\x91\xdc\xb5\x94\x10\xeb\x2b\xf9\x06\xd9\x6c\x26\x3e\xdb\x69\xb2\x2c\x2b\xf8\x42\xf8\xf6\x4a\x08\x0c\xc2\x80\x59\x4a\x48\xa8\x7d\x38\x7f\x37\x10\x22\x6a\x6f\x7f\x4e\xf9\xee\x54\x3d\x4c\xa9\xa9\xf7\x95\xcf\x2d\xe4\xd3\x90\xb1\x59\xc8\xf9\x66\xf7\x4f\x19\x2c\xa4\x27\x53\x4d\x0b\xa4\x79\x89\x80\xdd\xc4\x02\xb2\x11\xfe\x6b\xa3\x99\xb7\xe4\x95\xba\x52\x0b\x98\x5a\x37\x01\x16\x12\x21\xcb\x25\x58\x1a\x16\x04\x6a\x44\x75\x4a\x13\x48\x2b\x9d\x6e\x32\xcf\xab\xd6\x08\x97\x1c\xba\x38\xe0\x14\x1d\x78\x01\x2c\x46\x89\xea\xc2\x36\x34\x59\x01\xbb\xb6\x62\xaf\x16\x1c\x70\x85\x12\xd8\x2b\x49\xb9\xeb\x0e\x9d\x39\x9b\xc3\xfb\xf2\x13\x18\x92\xdd\xd1\x0c\x25\x34\xe9\x72\x9d\x73\xfc\xee\x14\xb5\x24\x84\xcf\xb0\xe4\xe3\x35\xc3\x98\xa8\x16\x83\x01\x8f\xa9\x60\x4b\x62\x38\x8d\x95\x76\x6e\x5d\x6d\x57\x1c\x2b\x44\xd0\xa8\x3b\xb6\x9d\x4a\xba\x70\xb9\x33\x55\x65\xab\xd2\x5e\x8b\x2c\x7d\xe4\xd1\xe8\x03\x45\x66\x8c\x7a\x72\x60\x59\xa7\x80\x11\x2b\xe4\x58\x13\x9a\x45\xc4\xa5\x74\x09\xe9\x49\x7a\xaa\x35\x09\x36\x21\x98\x16\xa5\xb4\xdd\xd6\x90\xa1\xd3\xcc\xd0\xd7\x24\x04\x10\x8d\xc0\x4b\x78\x1e\x81\xb4\xca\xca\xd9\x04\xd6\xf4\xe4\x26\x29\xf9\xa5\xe9\x77\xd1\x20\x75\x5d\xbc\xfb\xf7\xb7\x97\xfa\x7a\x4a\xc1\x0d\xfc\x56\xbb\xa6\xcf\x2e\x75\xb6\x09\x70\x5c\x86\xc0\x59\xf2\xd2\x7b\x52\x2b\x3c\xe8\xfd\x79\x1f\x1f\x37\x5a\x9e\x3f\x5b\xca\xa0\x96\xd4\x9f\xf7\x6e\x63\xa4\x83\x45\x12\x5f\xf7\xc2\xf5\x2a\x07\x5e\xce\x2a\x78\x99\x50\x46\x23\x43\x1e\xc4\xc5\x24\x2d\x56\x9b\xf8\xd0\x51\xd7\xd8\xc7\x78\x8d\xe7\x21\x22\x30\x03\x48\x56\x12\xdc\x38\x5f\x75\x09\x31\x9e\x2c\x5d\x75\x64\xb5\x0f\x4a\xb5\x5b\xd9\x06\xee\x67\xc4\x63\x3f\xeb\x57\xe2\x63\x55\xda\x39\xcf\xca\xe5\x02\x17\x10\xcb\xa1\xc0\x75\x99\x71\xc6\x06\xfa\xac\xe2\x09\x86\x44\x98\x46\x7f\x68\x84\x29\x19\xf7\x59\x19\x6e\x63\x65\x27\x41\x2e\xc4\xd2\xf3\xa8\x06\x28\x62\x54\xb7\x0f\x37\x37\x69\x54\x3f\xab\xbb\x24\xad\xf0\x07\x09\x46\x55\x9e\x62\xe1\x82\x0b\xc0\xf3\x27\x51\xe6\x21\x54\xcf\x3a\xa9\x0e\xf9\x54\x3c\x87\x41\x91\x55\x43\x1f\x8c\xea\x45\xb5\x97\x14\x5a\x3f\xcf\x91\xd9\xfc\xac\x5d\x1c\xd6\xd1\xe5\xf4\x04\x91\x8a\x3c\xa9\x4f\x38\xed\xfc\x01\x6e\xc9\x5e\x2d\xe9\xd9\x9e\xf2\x7a\x3d\x97\x5b\x1c\x4c\x50\xd5\xd6\x65\x97\xf6\x1a\x96\x62\xf3\x53\xc9\x84\xf9\x37\xa8\x54\xc2\xe7\xa2\xb8\x37\x03\xeb\x53\xa0\x6c\xa1\xdf\xc4\x0e\x8a\x22\x51\xa1\x10\x49\x3c\x8e\x71\x8d\xdc\xb7\x73\x25\x29\x84\x9d\x3e\x91\x7f\x82\x2f\x56\x3a\x5f\xa0\x90\xd0\x3a\xda\xb3\xc0\x99\xae\xba\x16\xc6\xdb\xa3\xd4\xf9\x0c\xf1\x6c\x70\x41\xc4\x51\x5b\x24\x57\x19\xdc\x6e\xbd\x63\x48\xba\x7c\x02\x48\x56\xaf\x80\x38\x8c\x3b\x97\x2b\x4a\x5e\x01\x09\xd0\x1f\x5d\xc3\x06\x19\x72\xfd\x02\x26\x1e\x47\x1a\x95\x27\x08\x64\x79\xaa\x1c\x72\x6b\xa5\xe9\xc6\xcd\x69\xf1\x1e\xe0\x99\xad\x71\x7a\x79\x86\x06\x5e\x16\x9f\xdf\x33\x1c\x02\xcf\xc6\x7c\x88\x75\x0a\xc5\xe1\x3c\x3d\x11\x96\x0d\x32\x4b\x48\x0d\x41\xe3\xd2\x2b\xab\xeb\x6d\xdd\x17\xe3\xbe\x9e\x11\x55\xf1\xcc\x5b\xd3\xc8\x7e\x86\x0e\x35\xd8\xbd\xbe\xc8\x47\x66\xd3\xb3\xa1\x46\xcf\x0f\xf9\x0f\x27\x41\x3e\x9a\xfe\xd8\xc2\x49\xcd\x13\x53\xf7\x38\x90\x6a\x7a\x08\xd3\xa0\xde\x57\x2e\x6c\x09\x79\xe2\x6f\x74\x58\xe2\x9c\xea\x99\x3e\x71\x3b\x89\x92\x37\x4f\x9b\x87\x4b\x5e\xea\x69\xf3\xa7\xae\x36\x29\xb2\x0b\x8c\x3e\x52\xc8\xf3\xc5\x30\x82\xfd\xa0\xc1\xf9\x84\x2b\x58\x82\x6e\xc8\xca\x1c\xe3\x87\xea\x2d\x9f\x29\xd4\xd4\xa4\x22\xf9\x6c\xac\x87\x4f\x10\xd9\x35\x8d\xb0\x7d\x9f\x19\x76\xf7\xc4\x04\xc6\x5f\x88\x4d\x37\x98\xf1\xfe\x24\x9d\x1c\x51\x6a\xea\x66\xcb\xcd\xd3\x70\xf9\xd7\xca\xdd\x3e\x60\xbe\x0f\x9b\x0b\x82\x08\x2c\x7e\xe4\x81\xc7\xcf\x54\xfc\xeb\x4a\xb1\xe2\xfb\x4c\xad\xb9\x2b\xb5\x1c\x09\x1e\xd5\x4b\xce\xf2\x51\x52\xa5\x8b\x2a\x63\xde\x2a\x0c\xfb\xe4\xe7\x71\x33\x2a\xf8\x71\xcb\x8c\x7e\x20\x7c\x4c\xe7\x99\x78\x1a\x2d\xfa\x3e\xaa\x56\xf8\x1f\x15\xb6\x2d\xd5\x12\x1f\x35\x7a\xbb\x87\x75\x52\x6e\xd7\x3c\xaa\x77\x28\x8f\x3a\x6f\xbe\x58\x48\x81\x32\xfe\x67\xa8\x85\xc7\x3a\xe9\xb6\x23\x7e\xcd\x8f\xb2\x35\x51\xf7\x07\x3a\x4d\xd6\xae\x44\x86\xe4\xc3\x99\xa4\x2e\x22\x2d\xc5\x3f\x82\x53\xd8\x41\xfe\x8f\x6a\x66\xc1\xeb\xfd\x80\x7f\x88\x15\x32\x03\xc4\xf5\x01\x48\xde\xf9\x48\x5f\x5f\xce\x7b\x24\x90\xe5\x39\x90\xd5\x61\xf3\xcb\x2f\x26\x00\x54\x30\xb3\x47\xcf\x75\x9f\x87\xdd\x2d\x43\x51\x1e\xe9\xe9\x6a\x8e\x8f\x04\x0d\x4b\x52\x78\x3c\x6c\xd8\xec\x28\x1f\xfa\xe0\xdc\xb6\x7c\x13\xcc\x32\x4a\x95\xbd\x13\xa5\xff\x6d\x2c\x62\xd0\x45\xb9\x90\xe4\x01\x70\x1e\x29\x8b\x4b\xa1\x9c\x92\x1f\x43\x44\x21\xbd\x03\x98\x1a\xa1\x22\x25\xfc\x4f\x2e\x88\xa6\x10\x0e\xe4\x22\x4e\x12\x37\x9b\xf2\x24\xb6\x4d\xcf\xbb\x3c\x79\x72\xd4\xdd\xbf\xb5\x02\x07\x31\xe5\xd7\x7a\x9b\xcf\xd3\xe5\x36\x7f\xf8\x30\xad\xa4\xa2\x90\x98\x04\xe7\x9b\x2e\x3a\x94\x14\xef\xb9\x2f\x2e\x7d\x40\xf2\x8c\x2a\x54\xf7\x21\xb1\x9f\x3b\xb8\x21\xe6\x9b\x44\x31\xf3\x2d\x6d\xcb\xf9\xde\xb8\x8c\x07\x90\x75\xb4\xa4\x9c\xee\x26\x98\x36\x5f\xc9\xee\xf1\xe0\xf5\xa4\x00\x75\x8f\xd2\x40\x0b\x49\xa8\xc3\x1e\xae\x7f\x2a\xb3\xd4\x84\xaa\x84\x7c\xe6\xfa\x3a\xf3\x4e\xbf\xae\xa7\xf2\xbb\x53\x79\x46\xc4\x5b\x88\x93\x61\x49\xd6\x01\x33\x24\xa0\x8c\x26\x55\x35\x43\x4d\x4e\x0c\xba\xbb\x3e\xfd\xf2\xd0\xff\x4d\x80\x05\x0f\x56\x06\xf2\x5c\xa3\x0a\x75\x2f\xfc\x81\x84\xc7\xea\xa4\x77\x34\x8b\x52\x76\x46\xca\xac\xce\xbf\x66\xf5\x53\x73\x5d\xa4\xcf\x54\x97\x6b\x3a\xf2\x3b\x0b\xeb\x1e\x9a\x2c\xbb\x43\xd2\x02\x18\xfc\xfd\xc8\xa9\x09\xe6\xac\x73\x2d\xce\x0a\xf8\xd4\x46\x92\xbc\x9b\x87\x68\xa8\x5a\x0a\x49\x9a\xe1\xab\x8f\xfa\x8d\x4a\x32\x98\x6d\xd2\x15\x12\x6a\xba\xab\x34\x85\x36\x5b\x39\x68\xca\x20\xe1\x01\xeb\x89\x4d\x8b\x0a\xf3\xa6\x8d\x20\xb4\xa8\x1c\xc5\x7f\xcd\xd8\xf6\x5a\x43\x63\x73\xb4\xae\x91\x58\x8a\x62\x45\x66\x9f\x07\x95\x48\xe5\x2c\x78\x32\x1c\x51\xf8\x0f\xe4\xac\x4d\xec\xab\x4c\xe1\x35\x30\xa8\xe1\x17\x32\xc4\x88\x6b\xe7\x11\x99\xec\x50\x60\xa0\x90\x48\x1b\x5c\xe1\xd2\x1f\x3b\xbe\xf1\x9a\x0d\xea\xf8\x03\x19\x18\x92\xcc\xc2\x86\x6c\x08\xa9\xa1\x55\x42\x90\xac\x4c\x65\x89\xcd\x76\x3e\x29\x3a\x00\x0d\x02\x9d\x74\xc7\x0e\x26\x33\x02\xf0\x5d\xe4\x9d\x47\xb8\x90\xda\x42\x88\xae\x58\xa2\x7d\x59\x1c\x85\x0e\x7e\xb2\x58\x1e\xd4\x23\xd3\x04\x1b\x2a\x87\x43\x35\xde\x86\x26\x91\x32\xe7\x95\xa4\x84\x00\x2a\x9d\x83\x38\xd4\xd6\xd4\xda\x91\x63\xc2\x7f\x2f\xab\xe4\xdb\x96\xb5\x49\x5d\xcf\x39\xde\x46\x0e\x09\xb5\x65\xa4\x77\x01\xb1\xee\xba\x80\xcd\x26\x0e\xa2\xf2\x0d\xf9\xb5\x98\x5f\x23\x33\xf2\xa3\x32\xfc\x0d\x4e\xe9\xd5\xe4\xde\x1c\x13\xfd\xb9\xd3\x50\x7d\xcb\x8c\x92\x37\xc0\x6a\x64\xd9\x72\x73\xfe\x31\x3b\x38\x8e\x7c\xdb\x39\xa7\x97\xaa\x9a\x86\x10\x0c\x43\x78\x4d\xa4\x05\xdb\x96\x22\x6a\x0c\xa5\x27\xe3\x37\xe6\xf4\x7e\x9e\xa1\x1f\xf6\x72\xf9\xd5\x50\x79\xbb\x58\xe8\xc1\xa5\x9b\x5d\x55\xba\x3b\x7d\xc4\x49\x4b\x55\x0e\xda\x2d\x9a\x29\x11\x9a\x89\x66\x7e\xbb\x6b\xc2\x25\xe0\x82\x2b\x03\x29\x3a\x25\xd0\x1e\x00\x61\xad\xa1\xf2\xb6\x96\xa6\xdd\xa6\xfc\x29\xa7\x3a\x8a\x7d\x85\x9d\x63\x3a\xa8\x6b\xe3\x60\x15\xc0\xbf\x59\xfb\xed\x1b\xda\x6d\x2f\xdd\x9c\x3a\x21\x97\x7a\xcb\x42\x7f\x84\xd7\x36\xb5\xaa\xa4\x9c\xf3\x39\xb5\xdc\x0f\x83\x23\x0b\xad\x20\x52\xb2\x6d\x09\x75\x36\x11\x0f\x1a\x3a\x93\x74\xec\x16\x56\x6d\x59\x22\xf3\x73\x6e\x72\x47\x33\x99\x71\xad\x50\xf2\x83\xa1\xc4\x43\x1e\x74\x44\xcf\x88\x00\xfd\xbd\x35\xdd\xd1\xcc\x9b\x9c\xa2\xc2\x13\x97\x05\xe6\x24\x9d\xc6\x34\xe8\x8e\x87\x21\x5e\xa1\x07\x5e\xf3\x9a\x29\x04\xee\x9c\x00\x6e\xba\xbf\x5f\x79\xec\x0c\x7e\xbc\xb8\xfe\x48\xb8\x85\xb7\xc8\x50\x9b\x39\x41\x0e\x8e\xcb\x9a\xd3\x7d\x70\xf8\x71\x01\xb8\xc3\x81\x75\x1e\xb2\x7e\xa7\xbb\x89\x8e\xdd\xb4\x07\xa7\xbb\x2c\x2b\x1d\x11\x80\x85\xeb\x4f\x06\xf5\x5b\xf6\x76\x28\x25\xc6\x75\x87\xe7\xcd\x90\xe6\x58\xa0\x23\x2b\x49\xe2\x6a\x77\xa8\x8e\x21\xda\x9e\x86\xa1\xc1\x53\xfd\x39\xe0\xcc\xd2\x67\x8c\x13\x32\x95\x55\xc6\x7d\x1d\x35\x6b\x58\x9e\x0e\xb2\x93\x4e\x1e\x56\x3e\x8e\xc2\x3f\x15\x0d\x97\x8a\xd3\x5e\xe6\x15\x18\x50\xda\xed\xe4\x5c\x0e\x3c\x2a\x6f\xbf\x5f\x64\x7a\x19\x26\xb0\x39\xc8\xfa\x07\x8e\xff\x4e\xbc\x8d\xfc\x47\xb3\x13\x72\x06\xdc\x1b\x9f\x95\x6b\xc8\xf1\x22\xd2\xbd\x83\x82\xf7\x87\x60\xd0\xfa\xc1\x54\xf9\xcd\x4f\x88\xbf\xca\x2b\x19\x4b\x6c\x83\x8b\xae\x93\x8d\x58\xfe\x83\x1a\x22\xc7\x56\x1d\xbe\x24\x33\x52\xf4\xea\x6a\x15\xf5\x01\x5c\x53\xef\x24\xa9\x35\x68\x9c\xb2\x9a\x36\xdf\xae\x2c\x25\x1e\x86\x65\xf8\x85\x44\x12\x53\x5d\x5b\x6c\xa6\xe1\x8e\xcf\xbb\x2e\x75\xd3\xa1\x91\xe3\x0c\xa9\xb9\xeb\x48\xbb\x60\x70\x2b\x4f\x35\x2a\xba\xb8\x0d\x39\x55\xdd\xd5\xa4\x5f\xb9\xba\xb2\x23\x4a\x61\xe8\x57\xc3\x53\x77\x3d\x84\x62\xda\x22\xfd\xb0\x85\xa9\xa8\x13\x1c\x5a\x3c\xd8\x65\xeb\x3e\x42\xda\x57\x5e\x45\x92\x7a\xc5\x8c\xab\xa3\x48\x7c\xee\x64\x80\x30\x54\xe8\x9a\x18\xc1\x54\xb6\xca\x37\x53\x36\x29\xcd\xf9\x2a\xdc\xde\xde\x5c\x41\x52\x0f\x1b\xbc\x73\x57\x10\xc4\x3f\x27\x6a\x1c\x4f\x25\x77\x71\xf1\xae\x93\xd8\x5a\x31\x33\xd9\x9d\x16\x8e\x16\x86\xdc\x01\xf7\x7f\xe0\xdc\xb4\xec\x78\x87\x1c\x4b\x25\x75\xa7\x0d\xc0\x31\x02\x89\xb0\xee\xe9\x15\xb5\xb9\x6d\x91\x28\xdd\xa1\x66\x82\x0e\x9e\x2a\x8e\x59\x91\x30\x06\x32\x33\x8c\x26\x2c\x5e\xbb\xca\x9b\x02\x0c\xac\xec\xdb\x32\x08\x04\xed\x24\x9a\xd7\x5c\xd7\x54\xb3\xe3\xb5\xe8\x89\x9b\x72\x34\xa0\xf4\x66\x3c\xa6\xeb\xd6\xf1\x0e\xb0\x02\x97\x08\x0e\xad\x17\x39\x04\xb9\xf2\xc5\x8d\x3a\x52\x13\xc0\x60\xf9\x09\x3e\xa6\x83\x52\x5e\xc4\x79\xf9\x89\xd1\x29\x92\x17\xc2\x73\xa3\xda\x4e\xa2\x5f\xdb\x5a\x90\x1c\x3b\x40\x73\xa0\xc9\x89\x05\xbd\xc7\x80\x58\x06\xfb\x96\x14\x59\xa6\x93\x96\x52\x51\xaa\xf6\xcb\x12\x72\x77\x8b\x19\x6d\x3a\x9c\xd7\x44\xcb\x22\x2a\x13\xeb\x36\x90\x91\x64\x4a\x1d\x0d\x20\x68\xce\xb9\xd8\xd6\x87\x03\x03\xc4\xe6\x28\x48\x76\x73\x32\x07\x6d\x39\xe5\x5a\x18\x94\x8c\xd8\xfd\xbc\x15\x71\x38\xde\x8f\xa2\x81\x7a\x04\x0f\x44\xfe\x8f\xea\x72\xcc\xc6\x1d\xc9\x7e\x38\x1e\x1f\xfd\x10\x04\x0e\x5e\x5a\xb7\xf8\xd3\x75\x3b\x82\x50\x06\xa8\xd7\x64\x89\x4a\x74\xb1\x5b\xe6\xde\x88\x0c\x1b\x3f\xb3\x67\x76\x4a\xe9\xec\x28\x21\xd4\x76\x20\x92\xba\x19\x6b\xbe\x19\xf2\x70\xae\x6e\xc3\x7b\x3c\x42\x9a\xee\x94\xd0\x5d\x0b\x80\x18\xb5\x78\x6a\x25\xfd\x87\xd0\xb1\xd3\xf2\x82\x4b\xda\xc5\x51\x22\x2d\x01\xf2\x07\xea\x80\x39\xc3\x06\x21\x30\x24\x64\x66\xdf\x33\x6a\x93\xb5\x3c\x31\x1e\x4d\x31\xed\x48\x1f\x29\xad\x1d\xa1\x99\x38\x92\xfc\xbb\xfc\x27\xa1\x3c\xed\xdb\x42\x95\x0f\xab\x18\x67\xaf\xe7\xa9\xd5\x35\x03\x53\x3c\x0c\xce\x2e\xc6\xfa\xcf\x7f\x58\xdf\x8b\xa8\x66\xc7\x96\xaa\x89\xc0\x18\x1f\xa8\x0c\x6c\xe9\x92\x3a\x5f\x70\x45\x8d\x5a\x4c\x1a\xa5\x53\x3a\xd6\xe9\x62\xc1\x05\xd7\x11\xc1\x44\x97\xfe\x13\x53\xe1\x71\xf9\x4c\x94\x9e\x19\xed\xc1\xb1\x2c\x72\x82\x8c\xec\x72\xc6\x85\x2e\x15\x94\xda\x9f\x60\xd1\xf1\xe7\xde\xba\xc7\x07\xed\xfe\xb1\x20\x04\x84\x29\xfe\x23\xd4\x22\x78\x7c\xf9\x2d\x8c\x8d\xee\xfe\x53\xf3\x28\xb2\xa5\x46\x84\xee\x27\x21\x1a\x1f\x63\x59\x98\x68\x04\x2d\xbd\x5e\xc1\x8f\x86\xf9\xd2\xe0\xf9\xba\x04\x24\xd4\x07\xbf\xcc\x46\xc4\x4f\x12\xfd\x47\x13\xd2\x43\x22\x1e\x1b\x08\x30\x73\x99\x46\xda\x04\x23\x9c\x87\x0c\xb7\x31\xf8\xd4\x2e\xef\xcf\x38\x3f\x1c\x95\x6a\x3a\x4a\x1f\x09\x25\x8b\xad\x84\x54\x63\xe6\x4a\xc3\x98\x49\x1f\x69\x3d\xa6\x0b\x02\x8d\xe1\x3a\xc4\xbc\x48\xf9\x99\x23\xe6\x77\xb3\xc8\x5a\x6d\xe3\x51\x79\xc9\xe2\x5c\xde\x0e\xe7\xa6\x0a\x48\xb1\xbc\x9c\xa3\xd9\x59\x63\x4d\x21\xe6\xa7\x00\x00\x43\xfa\xcc\x73\x38\xf7\x46\x31\x36\x8c\x29\xbe\x5f\x18\xe8\xfe\x1f\xd7\x08\xfa\x47\x74\x46\x6b\x4d\x5c\xc2\xb0\xb2\xd7\x36\xe7\x90\x23\x1a\xb4\x57\xc9\xfa\xb3\x5b\x3a\x4e\xc0\xf4\x08\x19\x4a\xfa\xc1\xd6\x4e\xb5\x91\xff\xde\x00\x9f\x77\xf2\xa4\x00\x1e\x2e\xa7\xd7\x88\x05\xff\x37\x41\x28\x0a\x3a\xe9\x5d\xe2\xcc\x7f\x4c\x0f\x95\x73\x48\x21\xa6\x4e\xbf\x6c\xb4\x25\xf9\x83\x30\x36\x89\xca\x7d\x34\x63\xce\xff\xe4\x23\xc9\xff\xfc\xf8\xfc\xd2\x88\xe5\xa1\xb5\xec\x89\xb3\x73\xb1\x01\x80\xd6\xcb\xdb\x55\xd6\xfd\xe6\xab\x2f\xa4\xf8\xcd\xd1\x76\xf3\xa9\x46\x94\x7f\x76\x9b\x0d\xd1\x0b\x8d\x4e\x0c\xd6\xdb\x09\x03\x99\x1b\x88\x1b\xf0\x06\x90\x91\xb3\xde\x71\x90\xc9\x9e\xa7\xee\x9f\xe0\xdf\xac\x8b\xe6\x62\x73\xa9\x58\xfe\x77\x09\xf2\x11\x98\xa9\xf2\x23\x1a\x14\x9d\x64\x10\x21\x3a\x63\x76\x48\x10\x36\x73\x3e\x07\x6b\x5a\xe6\x93\xcf\x72\x1e\x90\x9b\x95\x40\x24\x1f\x40\x4d\x90\xcf\x3a\xee\x8d\x61\x1b\x79\xe3\xe2\x84\xf2\x76\xf2\xf2\xf5\x79\x2c\xf8\x02\x19\x2c\x18\xad\x19\xf6\x00\x14\x12\x7d\x42\x8b\x8c\x14\xee\x1c\xe3\x8b\x01\xd1\x8d\xce\xbe\x64\xe5\xda\x01\xf1\x7f\x58\x62\xe6\xd9\x44\x87\x01\x32\xc7\x3d\xb9\x58\x56\xa6\x16\x8a\x75\xd8\x48\xa8\xf7\x33\x94\x48\xf2\x64\x2e\x7b\x0e\x84\x72\xa6\x46\x73\x9e\x6e\xf2\x82\xf9\xda\xa8\x9f\x72\xa8\xb7\x74\x1d\x07\x33\x2b\x98\xdd\x12\x71\x67\x59\xf9\xa0\xb9\xfb\x49\x0d\xbe\xc2\x49\x61\x9f\x0e\x2d\x1a\x10\xb6\x4b\xa7\x50\x69\x10\x59\x13\xa2\xe1\x7b\x73\xf0\x1d\x3e\xb4\x95\x87\x4f\xd4\x71\x78\x73\xde\x3e\x40\x88\xea\x4d\xc0\xb8\xe3\xe1\x3e\xdd\xd8\xb3\x32\x04\xf5\xee\xb3\x09\x15\x7e\xa8\x1b\x77\x1f\xf7\xae\xff\x1d\x97\xb8\x08\x05\xf5\x7f\xbe\xe2\xe1\x66\x5c\x34\x4a\x29\xc3\x0f\xb7\xa6\x97\x03\x79\x0a\x20\x63\xe8\x75\xbc\xf9\x89\xa1\x5c\x54\x25\x05\x58\x1a\x28\x8b\xaf\x11\xba\xd6\x21\xaf\x10\x92\x87\xf4\xdf\x0f\xf7\x4f\xf8\x76\x40\x34\x53\xe1\xde\xfe\x19\xd2\x7e\x58\xf1\x25\x27\xdf\x70\x77\x71\xcf\x64\x5f\x41\x29\x31\xc2\xdb\xed\x9b\xe1\xb8\x29\x9c\x06\x9d\x10\x3d\x84\x23\x9c\x5c\x03\x5c\x74\xbc\xf8\x21\x6e\xd6\xe1\xf8\x85\x17\x0e\x48\xe9\x8c\xdf\x24\xa6\x0e\x0e\x9e\xc0\xa8\x5d\x1d\x4d\xbd\xa1\x7e\xb8\xa7\xbe\x07\x3d\xde\x7a\x77\x5e\x1c\x21\xa7\x88\x21\x48\x92\x7b\xf5\xcf\x17\x39\x44\xe2\xdb\x50\x5b\x1c\xff\xa0\xf5\x43\x2b\x7b\xfe\x6b\xa3\x16\xfa\x50\x23\xbc\xdb\x91\x97\x88\x8f\xf2\xa5\xf0\xa1\x2e\x3c\xc6\xda\x07\x48\x5c\x89\xa5\x7a\x56\xe9\xe7\x1a\x6a\x91\x1e\x5b\x0b\xfc\x35\xa4\x82\x81\x75\x66\x84\x32\x25\x71\xa8\x14\xfd\x47\xf9\x53\x80\xec\x24\x8a\x08\x9e\xce\x2c\x4d\xb6\xc2\xd1\x95\x75\x2f\xf6\xbc\x4f\xee\x3e\x6a\xdf\x13\x85\xb2\xee\x50\xea\xee\xc5\x26\x9e\x41\x84\x16\x37\xc9\xc4\x35\x98\x11\x5d\x4e\x88\x3d\x91\x41\x24\x39\xf9\xe4\xde\xa7\x89\x2f\xe7\x02\x34\x18\x2a\x71\x65\x54\x24\x0f\x34\x1b\x55\x3b\xbc\xa1\x01\x19\x37\x47\x6c\xf2\xb4\x63\xd6\x5a\xa4\xc1\xd4\x49\xf3\x31\x87\x5c\xbc\xcb\x3b\x36\x88\x34\x3c\x31\xf3\xfa\xca\x92\x6c\x43\x17\x6e\xdc\xdd\x66\x1e\x4a\x68\xea\x95\xf4\x35\x6b\x2f\x4b\x3a\x32\xa9\x66\x59\x13\x16\x00\x69\x15\x86\xe6\x25\x00\x4b\x7f\x8e\x97\x30\xeb\x8b\x81\x23\xe4\x22\xf3\x8b\x0e\x96\x21\xe8\x77\x87\x3f\x49\x76\xd0\x7c\xac\x21\x5b\x78\x85\xab\x70\x08\x96\x5c\x17\xf8\x31\xa3\x2d\x24\x1f\x53\x68\x2d\xb6\x17\x03\x2f\x28\x8f\x3c\xa4\x2a\x18\x42\x94\xd0\xa8\x5d\xdb\x3f\x53\xa8\x4d\xfe\xef\xb6\xe1\x39\x84\x1d\x93\xf4\x0c\xf7\x34\xdc\xac\xce\xf6\x91\x60\xe1\x26\xf1\x40\x1f\x36\x78\xf8\xd6\xf8\x94\x86\xac\xcc\x9e\x21\x2b\x70\x1f\xa0\x31\xa9\x62\xc3\x7e\x36\x6d\x9f\xb6\xc1\xdb\x5a\x33\x7b\x33\xd8\x91\xfc\xf9\x02\xf2\x01\x9e\x7e\xd9\xcb\x25\x90\x76\x1d\x56\x7f\x9a\x8f\x52\x48\xcd\x7a\x33\x0b\x52\x20\x02\x4a\x1b\x14\xeb\x7d\x7b\xaa\x8a\x3c\xb2\x4d\x4e\x29\x1d\x34\xb9\x4a\xbc\x64\xcc\x51\x4f\x6d\x29\x76\xc7\x20\xd4\xb2\x6a\x40\x06\x79\x08\x12\xa5\x77\x3c\x13\x04\xad\xf4\xba\x46\x5a\xee\xaf\xd0\x7c\xab\x1d\x20\x9c\x03\xd7\xe0\x21\xcf\x2c\xab\xdf\x20\x45\x62\xf3\x23\xe5\x78\x92\x0f\x88\x3c\x48\x8d\x72\xd6\xbf\xe7\x78\x31\x13\xfb\x2a\xcc\x6c\xb8\xfd\xd3\x27\x8d\x1e\xdc\x85\x48\x08\x86\x23\xee\x05\xd9\xa3\x90\x02\xe1\xc6\x5c\xd4\x58\xfa\x1c\xcd\x06\xba\x63\xbc\x44\xfb\x44\x72\x53\x2e\x85\xf0\x86\xc4\x7c\x29\x3f\xa9\xb7\x6a\x66\x14\x0f\x80\x00\x65\x28\x4f\x62\x0a\x4b\x85\x58\x17\x28\xa1\xef\x62\x48\x5a\x4f\x19\xd2\x4b\x2d\xcf\xe6\xdd\x7e\x42\x30\x26\x7b\x79\x4e\xf7\xce\x5e\x21\x35\xb5\x52\xcc\x80\x45\x3e\x3d\x84\x47\x75\x48\xf5\xe6\xa9\xb6\x53\x1a\xea\x83\x2f\xdd\xf2\x9f\x5b\xd3\x5f\x33\x9c\x67\xfd\xbb\xd7\x45\x57\x49\x7e\x42\xdf\x80\xd7\x5a\xfa\xd8\x35\x2f\x8d\x5c\x73\x48\x43\x30\xd5\x0c\xa9\xbf\x99\xda\x6d\x28\x49\xd2\x7b\x60\xa0\x62\xff\x39\x94\xd6\xd9\x7f\x10\x7a\x84\x7a\xf6\x6f\xee\xb8\xe5\xb6\xea\x6f\xa5\xab\x18\xf0\x06\x6d\xa5\xcf\x3f\x50\x56\x2f\x29\xf0\x8e\xd2\x8d\x0d\x00\xa9\x9f\xd9\x84\x59\x2a\x8b\xb7\x35\x3c\x9f\xcd\xf7\x66\x5e\x6f\x4a\xca\x84\x7e\xa4\x9f\xe2\x94\x2d\xd1\x43\x31\xae\xf0\x2c\x3f\x71\x2d\xc0\x95\x19\xd6\x80\xa1\x21\x59\xef\x36\x83\x80\xb2\x3c\xd5\x05\x1b\xed\x86\x99\x9e\x67\x72\x77\x23\x88\x93\xa8\x52\x07\x53\xb7\x0a\xc4\x60\xd1\x3b\x61\x83\xe4\xf8\x40\xb0\x20\xd5\x4a\x48\xa6\x90\x62\xa1\xaf\xdf\x6f\x96\xde\xe2\xcb\xbb\x09\x2a\x4e\xc6\xda\x31\xb6\x7a\x05\x2e\x19\x8e\xfc\xc6\x1e\x22\x00\xb3\x64\x14\xef\x58\x2d\xb3\xd6\x70\x84\xb4\xe3\x39\x81\x40\xc1\xa1\x8d\xb9\x14\x2d\xe9\xab\xd2\x84\xc0\x5b\x51\x29\x52\x07\x99\x49\x5e\xc8\x97\x9a\x43\x53\xb1\xd6\x2d\x02\xbe\x6c\x42\x1d\xd1\x21\x14\x94\xd4\x15\xa0\xc7\xc1\x3b\xae\x5b\x88\x65\x6e\x87\xa4\x28\xb1\x5c\xa8\x5f\x04\xff\x30\x1c\x63\x12\xd7\xc4\x4a\x36\x91\x52\x95\x0d\x34\x3d\xcd\xc5\x66\xc5\xaa\xe5\x22\x82\x0d\x50\xa5\xbd\xa4\x46\x57\x17\x09\x50\x16\x5d\x60\x9a\xf4\xc3\xbc\x49\x44\x32\x28\xfb\x7b\xd2\x77\xc2\x08\x56\x80\xb9\x43\xbe\x55\x5f\xb2\x0f\xfd\x49\x6a\xf0\x80\xe4\x4a\x34\xb3\xfd\x82\xd5\xd6\x8d\xc8\x5f\xcf\xa2\x47\xb7\x80\x62\x44\x69\x2c\xfd\xd2\x84\x19\x97\x18\x40\x30\xc1\x49\x43\xd3\x93\x0c\x41\x44\xb3\x5a\xd9\x44\x8b\x34\x5d\x9b\x40\x24\xf7\x42\x23\xac\x49\x47\xaa\x73\x05\x18\x14\x37\x0f\x71\x48\xc5\xc3\xf6\x33\x69\x73\xac\xaf\x3a\xa4\xea\x58\xec\x49\xf9\xb4\x08\xa2\x8f\x89\xa9\x5f\x98\xbc\xd1\x42\x75\x62\x7c\x21\x3e\xf7\xd9\x17\x95\x1f\x92\x8c\x4c\x1a\x6d\x81\xd2\xb4\x71\x60\x76\xa9\xc8\xa2\xdd\xfb\x7e\x4b\xa2\x12\xbd\x89\x4e\xb1\xc6\x24\x0d\xe4\x0c\xf7\xce\x75\x05\xe0\x31\xf6\x8e\x63\x9c\x6a\x90\x96\x25\xf4\x47\x42\x1c\x35\x9f\x21\x75\xe8\x4f\xb1\x0a\x49\xfe\x35\xab\x2b\xed\x7d\xf1\x92\xff\xdc\x94\x1d\xd7\x43\x27\x4a\x2a\x89\xd0\xbe\x08\xf9\xc7\x97\x74\x11\x41\xb2\x1c\x4a\x87\x27\x73\x2d\x7b\x10\x46\x95\x3e\x7e\x05\x26\xd2\x1c\xaa\x92\x21\x1a\x09\x22\xcc\x90\x28\x3c\x29\xfb\xa5\x8d\xf3\x8a\xd4\x51\x17\xa8\x44\xba\x2c\xf1\xae\xda\x26\x91\xa7\x01\x24\xa9\x28\xd2\x50\xf3\xd1\xe3\xd4\xe1\x89\xaa\x89\x8d\xcb\x1a\x39\x24\xf1\x49\x23\xe1\x61\xe2\xda\x09\xd2\x49\xf8\x94\x93\xf2\x6e\x7b\xef\xf7\x6b\x20\xc9\x3e\x1e\xbb\x27\x87\xe9\x4e\x8f\x75\x89\x1f\x85\x67\xcb\xe1\x19\xb0\x0c\x43\x11\xea\xeb\xa8\xeb\x4b\x1b\x92\xf2\x20\x28\xef\x26\x82\xd9\x69\x97\x8f\x5b\xbc\xc6\xee\xc9\x54\x25\x70\x12\x10\xc1\xbb\xc1\xa6\x48\x79\xf3\xbc\xdb\x25\x31\xcc\x2d\x64\x72\x95\x71\x6a\xe5\x64\xc6\x63\xe5\x57\x61\xc3\xd1\xae\xe3\x86\xf6\x40\xcc\xae\xd0\xd9\xd6\x9d\x47\x21\xe7\x91\x20\x1e\xc6\xda\xba\x29\x74\xd7\xda\x97\x8e\xa6\x73\x99\xf2\x4c\xb4\xbc\x42\x7f\x93\x92\xb5\x84\xc3\x4f\xef\xd5\x46\xbb\x3b\xf4\x2f\xfb\x38\xb6\x48\x7f\xb2\x17\xc7\x5c\x8f\x40\x7c\x0a\xbf\xa6\xae\x5e\x4c\xda\x31\xc8\x65\xe5\xee\x13\x22\x94\x5f\xea\xca\xfd\x59\x83\x83\x94\xa5\xf4\xeb\xee\x93\x46\x06\x44\x2d\xeb\xab\xf0\xc3\xb1\x8d\x4e\xb2\x93\xa7\xc4\xb3\x6e\x70\x7d\xf5\x9c\xa4\xda\x68\x7e\x35\x85\x4b\xc9\xb3\x00\x29\x2d\x1d\x50\x27\x67\x28\x75\x77\x87\x88\xe5\x31\x85\x24\xd8\xed\x4e\x77\xa1\x12\x87\x83\x57\x57\xd7\xdb\xf8\x25\x18\x08\xe5\xcb\x6d\x90\x0a\xe4\xbd\xea\x8e\x5c\xf3\x84\xa8\x34\x31\xcc\x45\x35\xc3\xa9\xb8\x07\x9c\x38\xfa\xa7\x99\xdb\x7c\x3a\xb7\xce\x4e\xa7\x5b\x67\x33\xdf\xbf\x72\x9a\x12\xc1\x3b\x3c\x84\xcd\x8a\x21\xb4\x33\x3f\x52\x53\x3b\xee\xed\x7c\x71\x01\x1b\x38\x94\xef\x40\x2c\xcb\x7b\x31\x14\xad\x01\xf2\x99\x7a\x27\xc7\xcd\x02\x6a\xcf\x89\xa8\xc9\x8b\x82\x7b\xeb\x43\x50\x9f\xfc\xc0\x0d\x7a\x52\x21\x61\x98\x89\x6e\xf9\xfd\xb4\x3b\x9d\x0d\x8b\x1d\x0b\x54\xb2\xf8\x02\x9d\x21\x27\x50\x9f\x7f\x55\x29\x10\x51\xf0\x8f\xa6\x73\x6a\x8a\x4b\xbf\x63\x07\x04\x30\x68\x8f\x2b\x63\xd2\x8f\xdb\xe1\xca\x71\x8b\x52\xff\x46\xf8\x9c\x6a\x80\x14\xe4\x9f\xa2\xe6\x65\xa3\x1a\x63\x8b\x7d\xab\x93\x32\xe1\xd1\x22\x5d\x00\xb7\xd0\x05\x85\x26\x7b\x3b\x8f\x3c\xf7\x1d\x18\xa1\x36\x01\x4e\x8e\x3d\x13\x6d\x10\x78\x86\x16\x69\xfa\x96\x40\x9f\x96\xfc\x00\x7d\xce\x55\x25\x8b\x50\x5b\x75\x42\x7b\xfd\x6b\x6b\x4a\x61\xd8\xe8\xd3\x15\x50\x29\xbf\xdd\xc1\x74\x8c\xce\x55\xb1\x59\xd7\xd4\x94\x4b\x81\x36\x19\xb5\xee\x1b\x8b\xfd\x5a\x1f\xef\x10\x49\xb5\x11\x78\x27\x0e\x21\xcf\x2d\x54\x3a\xdf\xd2\x38\x84\xd3\xe2\xd2\xf1\xf7\xe5\x0c\x2c\x00\xf3\x8f\xf9\x02\xca\xf7\x67\xf9\xdf\x1d\xff\x3b\x1e\x95\x6e\x08\xe0\xac\x9d\xd0\x69\xe8\x75\x34\xeb\x81\xc8\xfc\x22\x62\x00\x6e\xf0\xdf\x21\x57\x5a\xc1\x02\xed\x7d\x11\x02\x39\x55\x86\xd0\xe8\xf1\x61\xe5\x0e\x15\x12\x03\xb5\x4b\xf3\xb7\xc7\xc4\x4e\xa0\x1e\x89\x55\xaf\xfa\x52\xab\x04\x0f\xeb\xe6\x33\xab\x08\x68\xef\x6a\x48\x43\x75\x10\x55\xe3\xd9\xb6\xa4\x29\xba\x6b\x87\x52\x35\x4f\x64\xfa\x5d\x0d\x51\xbe\x16\x7a\xe5\x88\x65\x61\x6d\x4b\xd0\xe1\x19\x94\x1a\xa9\xe2\x01\xa0\x3d\x7a\x48\xc3\xa2\xab\x13\x62\xd0\x42\x30\x35\x9f\xfb\xb8\xdc\x93\xb0\x2e\xa6\x0e\xa0\x86\xea\xe6\xef\x33\xf3\xe5\x61\x9e\xdb\xb5\x66\xb3\x1e\xde\x10\x42\xa8\x7d\x84\xab\x1b\xec\x79\x6d\x26\x19\x41\xa2\x54\xe5\xcc\xdf\xa4\x81\x91\x66\x1d\xb2\x99\x58\x86\x0a\x29\x65\x11\xe0\xac\x55\xeb\x5a\x62\x7c\x87\xfa\x12\x13\x82\x0d\x35\x39\xd4\x05\xd1\x38\x3c\x57\xd2\xa7\x88\x60\x6c\x8e\x84\x2e\x70\x4a\x85\x4c\x28\x9a\xea\xcb\x7a\xd4\xe3\x19\x11\x24\xdd\x83\x4c\x2a\x5d\xf9\xba\xa7\xac\x43\x48\x4c\x25\xa0\xb3\xcb\x40\x6a\xad\xa7\x78\x9c\x9e\x15\x14\xfa\xea\x8a\xa4\x1c\x6d\xf2\x72\x25\x0f\xf1\x07\x94\x8a\xa1\x3a\x35\xfc\x98\x8f\xb0\xfc\x51\x35\x8e\x6c\x1f\x0a\xa2\x3a\x98\x34\xdb\x34\x44\x67\x0b\x54\x50\xe5\x45\xec\x4a\x04\xa0\x74\x66\x9d\xf2\x8b\x2e\x69\x54\x1b\x9b\x13\x73\x13\x3b\x7a\x26\xba\xfc\x61\x63\x0c\x57\x4e\x07\x56\x0d\xaf\x9d\xf5\x45\xfe\x8b\x1c\x4a\xae\xf6\xa4\x3c\x1c\x49\x1b\xb3\xf4\x50\xaf\x18\x79\x9a\x38\x33\x32\xbb\x6d\x06\x20\xc8\x79\x2b\xd2\xc4\x62\x98\x43\xa2\xd0\x25\x90\x9a\x12\xab\xcd\x38\x0b\xe1\xb3\xc9\xaf\x42\xb1\x87\xad\x1d\x3c\x2a\x92\x26\x85\xe6\x6e\xd6\x01\x64\x6b\x80\x68\xeb\x97\xdd\x5d\x3e\x98\xf2\xdf\x65\x24\xa1\xa9\xae\x1b\x96\x63\x89\xe6\x54\x24\xd3\x6a\x56\x1a\xdf\xbc\xc1\x90\x44\x5d\x99\x87\xd1\x99\x11\x92\x74\xf7\xcb\x22\x5b\x4a\xca\xaa\x01\x43\xf6\xd4\x90\xbb\x65\x5c\x61\xb5\x1c\xf1\x23\x9b\x59\x86\x8c\x69\x7c\x0c\x59\x51\xa7\x5d\xe6\x2c\xa4\xcb\xb3\x9c\xd1\x90\x54\x65\xef\x94\x07\x9d\x0c\xc3\x46\x00\x2f\x43\x1c\x34\x43\x8f\x32\x85\x84\xac\x6d\x68\x6c\xcf\x69\x68\x75\x6a\xfd\x6a\xfa\x4a\x73\xf3\x73\xba\x03\xe3\xff\xff\x3f\xff\xdf\xff\x0d\x00\x00\xff\xff\x9b\xc6\xef\xe7\x7d\x0c\x06\x00") - -func dataSurnamesJsonBytes() ([]byte, error) { - return bindataRead( - _dataSurnamesJson, - "data/Surnames.json", - ) -} - -func dataSurnamesJson() (*asset, error) { - bytes, err := dataSurnamesJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "data/Surnames.json", size: 396413, mode: os.FileMode(420), modTime: time.Unix(1452717629, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "data/Dvorak.json": dataDvorakJson, - "data/English.json": dataEnglishJson, - "data/FemaleNames.json": dataFemalenamesJson, - "data/Keypad.json": dataKeypadJson, - "data/L33t.json": dataL33tJson, - "data/MacKeypad.json": dataMackeypadJson, - "data/MaleNames.json": dataMalenamesJson, - "data/Passwords.json": dataPasswordsJson, - "data/Qwerty.json": dataQwertyJson, - "data/Surnames.json": dataSurnamesJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "data": &bintree{nil, map[string]*bintree{ - "Dvorak.json": &bintree{dataDvorakJson, map[string]*bintree{}}, - "English.json": &bintree{dataEnglishJson, map[string]*bintree{}}, - "FemaleNames.json": &bintree{dataFemalenamesJson, map[string]*bintree{}}, - "Keypad.json": &bintree{dataKeypadJson, map[string]*bintree{}}, - "L33t.json": &bintree{dataL33tJson, map[string]*bintree{}}, - "MacKeypad.json": &bintree{dataMackeypadJson, map[string]*bintree{}}, - "MaleNames.json": &bintree{dataMalenamesJson, map[string]*bintree{}}, - "Passwords.json": &bintree{dataPasswordsJson, map[string]*bintree{}}, - "Qwerty.json": &bintree{dataQwertyJson, map[string]*bintree{}}, - "Surnames.json": &bintree{dataSurnamesJson, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/entropy/entropyCalculator.go b/vendor/github.com/ccojocar/zxcvbn-go/entropy/entropyCalculator.go deleted file mode 100644 index 80432572bd..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/entropy/entropyCalculator.go +++ /dev/null @@ -1,217 +0,0 @@ -package entropy - -import ( - "math" - "regexp" - "unicode" - - "github.com/ccojocar/zxcvbn-go/adjacency" - "github.com/ccojocar/zxcvbn-go/match" - zxcvbnmath "github.com/ccojocar/zxcvbn-go/utils/math" -) - -const ( - numYears = float64(119) // years match against 1900 - 2019 - numMonths = float64(12) - numDays = float64(31) -) - -var ( - startUpperRx = regexp.MustCompile(`^[A-Z][^A-Z]+$`) - endUpperRx = regexp.MustCompile(`^[^A-Z]+[A-Z]$'`) - allUpperRx = regexp.MustCompile(`^[A-Z]+$`) - keyPadStartingPositions = len(adjacency.GraphMap["keypad"].Graph) - keyPadAvgDegree = adjacency.GraphMap["keypad"].CalculateAvgDegree() -) - -// DictionaryEntropy calculates the entropy of a dictionary match -func DictionaryEntropy(match match.Match, rank float64) float64 { - baseEntropy := math.Log2(rank) - upperCaseEntropy := extraUpperCaseEntropy(match) - // TODO: L33t - return baseEntropy + upperCaseEntropy -} - -func extraUpperCaseEntropy(match match.Match) float64 { - word := match.Token - - allLower := true - - for _, char := range word { - if unicode.IsUpper(char) { - allLower = false - break - } - } - if allLower { - return float64(0) - } - - // a capitalized word is the most common capitalization scheme, - // so it only doubles the search space (uncapitalized + capitalized): 1 extra bit of entropy. - // allcaps and end-capitalized are common enough too, underestimate as 1 extra bit to be safe. - - for _, matcher := range []*regexp.Regexp{startUpperRx, endUpperRx, allUpperRx} { - if matcher.MatchString(word) { - return float64(1) - } - } - // Otherwise calculate the number of ways to capitalize U+L uppercase+lowercase letters with U uppercase letters or - // less. Or, if there's more uppercase than lower (for e.g. PASSwORD), the number of ways to lowercase U+L letters - // with L lowercase letters or less. - - countUpper, countLower := float64(0), float64(0) - for _, char := range word { - if unicode.IsUpper(char) { - countUpper++ - } else if unicode.IsLower(char) { - countLower++ - } - } - totalLenght := countLower + countUpper - var possibililities float64 - - for i := float64(0); i <= math.Min(countUpper, countLower); i++ { - possibililities += zxcvbnmath.NChoseK(totalLenght, i) - } - - if possibililities < 1 { - return float64(1) - } - - return (math.Log2(possibililities)) -} - -// SpatialEntropy calculates the entropy for spatial matches -func SpatialEntropy(match match.Match, turns int, shiftCount int) float64 { - var s, d float64 - if match.DictionaryName == "qwerty" || match.DictionaryName == "dvorak" { - // todo: verify qwerty and dvorak have the same length and degree - s = float64(len(adjacency.BuildQwerty().Graph)) - d = adjacency.BuildQwerty().CalculateAvgDegree() - } else { - s = float64(keyPadStartingPositions) - d = keyPadAvgDegree - } - - possibilities := float64(0) - - length := float64(len(match.Token)) - - // TODO: Should this be <= or just < ? - // Estimate the number of possible patterns w/ length L or less with t turns or less - for i := float64(2); i <= length+1; i++ { - possibleTurns := math.Min(float64(turns), i-1) - for j := float64(1); j <= possibleTurns+1; j++ { - x := zxcvbnmath.NChoseK(i-1, j-1) * s * math.Pow(d, j) - possibilities += x - } - } - - entropy := math.Log2(possibilities) - // add extra entropu for shifted keys. ( % instead of 5 A instead of a) - // Math is similar to extra entropy for uppercase letters in dictionary matches. - - if S := float64(shiftCount); S > float64(0) { - possibilities = float64(0) - U := length - S - - for i := float64(0); i < math.Min(S, U)+1; i++ { - possibilities += zxcvbnmath.NChoseK(S+U, i) - } - - entropy += math.Log2(possibilities) - } - - return entropy -} - -// RepeatEntropy calculates the entropy for repeating entropy -func RepeatEntropy(match match.Match) float64 { - cardinality := CalcBruteForceCardinality(match.Token) - entropy := math.Log2(cardinality * float64(len(match.Token))) - - return entropy -} - -// CalcBruteForceCardinality calculates the brute force cardinality -// TODO: Validate against python -func CalcBruteForceCardinality(password string) float64 { - lower, upper, digits, symbols := float64(0), float64(0), float64(0), float64(0) - - for _, char := range password { - if unicode.IsLower(char) { - lower = float64(26) - } else if unicode.IsDigit(char) { - digits = float64(10) - } else if unicode.IsUpper(char) { - upper = float64(26) - } else { - symbols = float64(33) - } - } - - cardinality := lower + upper + digits + symbols - return cardinality -} - -// SequenceEntropy calculates the entropy for sequences such as 4567 or cdef -func SequenceEntropy(match match.Match, dictionaryLength int, ascending bool) float64 { - firstChar := match.Token[0] - var baseEntropy float64 - if string(firstChar) == "a" || string(firstChar) == "1" { - baseEntropy = float64(0) - } else { - baseEntropy = math.Log2(float64(dictionaryLength)) - // TODO: should this be just the first or any char? - if unicode.IsUpper(rune(firstChar)) { - baseEntropy++ - } - } - - if !ascending { - baseEntropy++ - } - return baseEntropy + math.Log2(float64(len(match.Token))) -} - -// ExtraLeetEntropy calulates the added entropy provied by l33t substitustions -func ExtraLeetEntropy(match match.Match, password string) float64 { - var subsitutions float64 - var unsub float64 - subPassword := password[match.I:match.J] - for index, char := range subPassword { - if string(char) != string(match.Token[index]) { - subsitutions++ - } else { - // TODO: Make this only true for 1337 chars that are not subs? - unsub++ - } - } - - var possibilities float64 - - for i := float64(0); i <= math.Min(subsitutions, unsub)+1; i++ { - possibilities += zxcvbnmath.NChoseK(subsitutions+unsub, i) - } - - if possibilities <= 1 { - return float64(1) - } - return math.Log2(possibilities) -} - -// DateEntropy calculates the entropy provided by a date -func DateEntropy(dateMatch match.DateMatch) float64 { - var entropy float64 - if dateMatch.Year < 100 { - entropy = math.Log2(numDays * numMonths * 100) - } else { - entropy = math.Log2(numDays * numMonths * numYears) - } - - if dateMatch.Separator != "" { - entropy += 2 // add two bits for separator selection [/,-,.,etc] - } - return entropy -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/frequency/frequency.go b/vendor/github.com/ccojocar/zxcvbn-go/frequency/frequency.go deleted file mode 100644 index 4f51369e1f..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/frequency/frequency.go +++ /dev/null @@ -1,50 +0,0 @@ -package frequency - -import ( - "encoding/json" - "log" - - "github.com/ccojocar/zxcvbn-go/data" -) - -// List holds a frequency list -type List struct { - Name string - List []string -} - -// Lists holds all the frequency list in a map -var Lists = make(map[string]List) - -func init() { - maleFilePath := getAsset("data/MaleNames.json") - femaleFilePath := getAsset("data/FemaleNames.json") - surnameFilePath := getAsset("data/Surnames.json") - englishFilePath := getAsset("data/English.json") - passwordsFilePath := getAsset("data/Passwords.json") - - Lists["MaleNames"] = getStringListFromAsset(maleFilePath, "MaleNames") - Lists["FemaleNames"] = getStringListFromAsset(femaleFilePath, "FemaleNames") - Lists["Surname"] = getStringListFromAsset(surnameFilePath, "Surname") - Lists["English"] = getStringListFromAsset(englishFilePath, "English") - Lists["Passwords"] = getStringListFromAsset(passwordsFilePath, "Passwords") -} - -func getAsset(name string) []byte { - data, err := data.Asset(name) - if err != nil { - panic("Error getting asset " + name) - } - - return data -} - -func getStringListFromAsset(data []byte, name string) List { - var tempList List - err := json.Unmarshal(data, &tempList) - if err != nil { - log.Fatal(err) - } - tempList.Name = name - return tempList -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/match/match.go b/vendor/github.com/ccojocar/zxcvbn-go/match/match.go deleted file mode 100644 index da3e894ece..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/match/match.go +++ /dev/null @@ -1,45 +0,0 @@ -package match - -// Matches is an alies for []Match used for sorting -type Matches []Match - -func (s Matches) Len() int { - return len(s) -} - -func (s Matches) Swap(i, j int) { - s[i], s[j] = s[j], s[i] -} - -func (s Matches) Less(i, j int) bool { - if s[i].I < s[j].I { - return true - } else if s[i].I == s[j].I { - return s[i].J < s[j].J - } - return false -} - -// Match represents different matches -type Match struct { - Pattern string - I, J int - Token string - DictionaryName string - Entropy float64 -} - -// DateMatch is specifilly a match for type date -type DateMatch struct { - Pattern string - I, J int - Token string - Separator string - Day, Month, Year int64 -} - -// Matcher are a func and ID that can be used to match different passwords -type Matcher struct { - MatchingFunc func(password string) []Match - ID string -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/dateMatchers.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/dateMatchers.go deleted file mode 100644 index fd7f383320..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/dateMatchers.go +++ /dev/null @@ -1,206 +0,0 @@ -package matching - -import ( - "regexp" - "strconv" - "strings" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -const ( - dateSepMatcherName = "DATESEP" - dateWithOutSepMatcherName = "DATEWITHOUT" -) - -var ( - dateRxYearSuffix = regexp.MustCompile(`((\d{1,2})(\s|-|\/|\\|_|\.)(\d{1,2})(\s|-|\/|\\|_|\.)(19\d{2}|200\d|201\d|\d{2}))`) - dateRxYearPrefix = regexp.MustCompile(`((19\d{2}|200\d|201\d|\d{2})(\s|-|/|\\|_|\.)(\d{1,2})(\s|-|/|\\|_|\.)(\d{1,2}))`) - dateWithOutSepMatch = regexp.MustCompile(`\d{4,8}`) -) - -// FilterDateSepMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterDateSepMatcher(m match.Matcher) bool { - return m.ID == dateSepMatcherName -} - -// FilterDateWithoutSepMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterDateWithoutSepMatcher(m match.Matcher) bool { - return m.ID == dateWithOutSepMatcherName -} - -func checkDate(day, month, year int64) (bool, int64, int64, int64) { - if (12 <= month && month <= 31) && day <= 12 { - day, month = month, day - } - - if day > 31 || month > 12 { - return false, 0, 0, 0 - } - - if !((1900 <= year && year <= 2019) || (0 <= year && year <= 99)) { - return false, 0, 0, 0 - } - - return true, day, month, year -} - -func dateSepMatcher(password string) []match.Match { - dateMatches := dateSepMatchHelper(password) - - var matches []match.Match - for _, dateMatch := range dateMatches { - match := match.Match{ - I: dateMatch.I, - J: dateMatch.J, - Entropy: entropy.DateEntropy(dateMatch), - DictionaryName: "date_match", - Token: dateMatch.Token, - } - - matches = append(matches, match) - } - - return matches -} - -func dateSepMatchHelper(password string) []match.DateMatch { - var matches []match.DateMatch - - for _, v := range dateRxYearSuffix.FindAllString(password, len(password)) { - splitV := dateRxYearSuffix.FindAllStringSubmatch(v, len(v)) - i := strings.Index(password, v) - j := i + len(v) - day, _ := strconv.ParseInt(splitV[0][4], 10, 16) - month, _ := strconv.ParseInt(splitV[0][2], 10, 16) - year, _ := strconv.ParseInt(splitV[0][6], 10, 16) - match := match.DateMatch{Day: day, Month: month, Year: year, Separator: splitV[0][5], I: i, J: j, Token: password[i:j]} - matches = append(matches, match) - } - - for _, v := range dateRxYearPrefix.FindAllString(password, len(password)) { - splitV := dateRxYearPrefix.FindAllStringSubmatch(v, len(v)) - i := strings.Index(password, v) - j := i + len(v) - day, _ := strconv.ParseInt(splitV[0][4], 10, 16) - month, _ := strconv.ParseInt(splitV[0][6], 10, 16) - year, _ := strconv.ParseInt(splitV[0][2], 10, 16) - match := match.DateMatch{Day: day, Month: month, Year: year, Separator: splitV[0][5], I: i, J: j, Token: password[i:j]} - matches = append(matches, match) - } - - var out []match.DateMatch - for _, match := range matches { - if valid, day, month, year := checkDate(match.Day, match.Month, match.Year); valid { - match.Pattern = "date" - match.Day = day - match.Month = month - match.Year = year - out = append(out, match) - } - } - return out -} - -type dateMatchCandidate struct { - DayMonth string - Year string - I, J int -} - -type dateMatchCandidateTwo struct { - Day string - Month string - Year string - I, J int -} - -func dateWithoutSepMatch(password string) []match.Match { - dateMatches := dateWithoutSepMatchHelper(password) - - var matches []match.Match - for _, dateMatch := range dateMatches { - match := match.Match{ - I: dateMatch.I, - J: dateMatch.J, - Entropy: entropy.DateEntropy(dateMatch), - DictionaryName: "date_match", - Token: dateMatch.Token, - } - - matches = append(matches, match) - } - - return matches -} - -// TODO Has issues with 6 digit dates -func dateWithoutSepMatchHelper(password string) (matches []match.DateMatch) { - for _, v := range dateWithOutSepMatch.FindAllString(password, len(password)) { - i := strings.Index(password, v) - j := i + len(v) - length := len(v) - lastIndex := length - 1 - var candidatesRoundOne []dateMatchCandidate - - if length <= 6 { - // 2-digit year prefix - candidatesRoundOne = append(candidatesRoundOne, buildDateMatchCandidate(v[2:], v[0:2], i, j)) - - // 2-digityear suffix - candidatesRoundOne = append(candidatesRoundOne, buildDateMatchCandidate(v[0:lastIndex-2], v[lastIndex-2:], i, j)) - } - if length >= 6 { - // 4-digit year prefix - candidatesRoundOne = append(candidatesRoundOne, buildDateMatchCandidate(v[4:], v[0:4], i, j)) - - // 4-digit year sufix - candidatesRoundOne = append(candidatesRoundOne, buildDateMatchCandidate(v[0:lastIndex-3], v[lastIndex-3:], i, j)) - } - - var candidatesRoundTwo []dateMatchCandidateTwo - for _, c := range candidatesRoundOne { - if len(c.DayMonth) == 2 { - candidatesRoundTwo = append(candidatesRoundTwo, buildDateMatchCandidateTwo(c.DayMonth[0:0], c.DayMonth[1:1], c.Year, c.I, c.J)) - } else if len(c.DayMonth) == 3 { - candidatesRoundTwo = append(candidatesRoundTwo, buildDateMatchCandidateTwo(c.DayMonth[0:2], c.DayMonth[2:2], c.Year, c.I, c.J)) - candidatesRoundTwo = append(candidatesRoundTwo, buildDateMatchCandidateTwo(c.DayMonth[0:0], c.DayMonth[1:3], c.Year, c.I, c.J)) - } else if len(c.DayMonth) == 4 { - candidatesRoundTwo = append(candidatesRoundTwo, buildDateMatchCandidateTwo(c.DayMonth[0:2], c.DayMonth[2:4], c.Year, c.I, c.J)) - } - } - - for _, candidate := range candidatesRoundTwo { - intDay, err := strconv.ParseInt(candidate.Day, 10, 16) - if err != nil { - continue - } - - intMonth, err := strconv.ParseInt(candidate.Month, 10, 16) - if err != nil { - continue - } - - intYear, err := strconv.ParseInt(candidate.Year, 10, 16) - if err != nil { - continue - } - - if ok, _, _, _ := checkDate(intDay, intMonth, intYear); ok { - matches = append(matches, match.DateMatch{Token: password, Pattern: "date", Day: intDay, Month: intMonth, Year: intYear, I: i, J: j}) - } - - } - } - - return matches -} - -func buildDateMatchCandidate(dayMonth, year string, i, j int) dateMatchCandidate { - return dateMatchCandidate{DayMonth: dayMonth, Year: year, I: i, J: j} -} - -func buildDateMatchCandidateTwo(day, month string, year string, i, j int) dateMatchCandidateTwo { - return dateMatchCandidateTwo{Day: day, Month: month, Year: year, I: i, J: j} -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/dictionaryMatch.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/dictionaryMatch.go deleted file mode 100644 index d0d4501880..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/dictionaryMatch.go +++ /dev/null @@ -1,56 +0,0 @@ -package matching - -import ( - "strings" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -func buildDictMatcher(dictName string, rankedDict map[string]int) func(password string) []match.Match { - return func(password string) []match.Match { - matches := dictionaryMatch(password, dictName, rankedDict) - for _, v := range matches { - v.DictionaryName = dictName - } - return matches - } -} - -func dictionaryMatch(password string, dictionaryName string, rankedDict map[string]int) []match.Match { - var results []match.Match - pwLower := strings.ToLower(password) - - pwLowerRunes := []rune(pwLower) - length := len(pwLowerRunes) - - for i := 0; i < length; i++ { - for j := i; j < length; j++ { - word := pwLowerRunes[i : j+1] - if val, ok := rankedDict[string(word)]; ok { - matchDic := match.Match{ - Pattern: "dictionary", - DictionaryName: dictionaryName, - I: i, - J: j, - Token: string([]rune(password)[i : j+1]), - } - matchDic.Entropy = entropy.DictionaryEntropy(matchDic, float64(val)) - - results = append(results, matchDic) - } - } - } - - return results -} - -func buildRankedDict(unrankedList []string) map[string]int { - result := make(map[string]int) - - for i, v := range unrankedList { - result[strings.ToLower(v)] = i + 1 - } - - return result -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/leet.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/leet.go deleted file mode 100644 index 1f303aa6ea..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/leet.go +++ /dev/null @@ -1,234 +0,0 @@ -package matching - -import ( - "strings" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -// L33TMatcherName id -const L33TMatcherName = "l33t" - -// FilterL33tMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterL33tMatcher(m match.Matcher) bool { - return m.ID == L33TMatcherName -} - -func l33tMatch(password string) []match.Match { - permutations := getPermutations(password) - - var matches []match.Match - - for _, permutation := range permutations { - for _, mather := range dictionaryMatchers { - matches = append(matches, mather.MatchingFunc(permutation)...) - } - } - - for _, match := range matches { - match.Entropy += entropy.ExtraLeetEntropy(match, password) - match.DictionaryName = match.DictionaryName + "_3117" - } - - return matches -} - -// This function creates a list of permutations based on a fixed table stored on data. The table -// will be reduced in order to proceed in the function using only relevant values (see -// relevantL33tSubtable). -func getPermutations(password string) []string { - substitutions := relevantL33tSubtable(password) - permutations := getAllPermutationsOfLeetSubstitutions(password, substitutions) - return permutations -} - -// This function loads the table from data but only keep in memory the values that are present -// inside the provided password. -func relevantL33tSubtable(password string) map[string][]string { - relevantSubs := make(map[string][]string) - for key, values := range l33tTable.Graph { - for _, value := range values { - if strings.Contains(password, value) { - relevantSubs[key] = append(relevantSubs[key], value) - } - } - } - - return relevantSubs -} - -// This function creates the list of permutations of a given password using the provided table as -// reference for its operation. -func getAllPermutationsOfLeetSubstitutions(password string, table map[string][]string) []string { - result := []string{} - - // create a list of tables without conflicting keys/values (this happens for "|", "7" and "1") - noConflictsTables := createListOfMapsWithoutConflicts(table) - for _, noConflictsTable := range noConflictsTables { - substitutionsMaps := createSubstitutionsMapsFromTable(noConflictsTable) - for _, substitutionsMap := range substitutionsMaps { - newValue := createWordForSubstitutionMap(password, substitutionsMap) - if !stringSliceContainsValue(result, newValue) { - result = append(result, newValue) - } - } - } - - return result -} - -// Create the possible list of maps removing the conflicts from it. As an example, the value "|" -// may represent "i" and "l". For each representation of the conflicting value, a new map is -// created. This may grow exponencialy according to the number of conflicts. The number of maps -// returned by this function may be reduced if the relevantL33tSubtable function was called to -// identify only relevant items. -func createListOfMapsWithoutConflicts(table map[string][]string) []map[string][]string { - // the resulting list starts with the provided table - result := []map[string][]string{} - result = append(result, table) - - // iterate over the list of conflicts in order to expand the maps for each one - conflicts := retrieveConflictsListFromTable(table) - for _, value := range conflicts { - newMapList := []map[string][]string{} - - // for each conflict a new list of maps will be created for every already known map - for _, currentMap := range result { - newMaps := createDifferentMapsForLeetChar(currentMap, value) - newMapList = append(newMapList, newMaps...) - } - - result = newMapList - } - - return result -} - -// This function retrieves the list of values that appear for one or more keys. This is useful to -// know which l33t chars can represent more than one letter. -func retrieveConflictsListFromTable(table map[string][]string) []string { - result := []string{} - foundValues := []string{} - - for _, values := range table { - for _, value := range values { - if stringSliceContainsValue(foundValues, value) { - // only add on results if it was not identified as conflict before - if !stringSliceContainsValue(result, value) { - result = append(result, value) - } - } else { - foundValues = append(foundValues, value) - } - } - } - - return result -} - -// This function aims to create different maps for a given char if this char represents a conflict. -// If the specified char is not a conflict one, the same map will be returned. In scenarios which -// the provided char can not be found on map, an empty list will be returned. This function was -// designed to be used on conflicts situations. -func createDifferentMapsForLeetChar(table map[string][]string, leetChar string) []map[string][]string { - result := []map[string][]string{} - - keysWithSameValue := retrieveListOfKeysWithSpecificValueFromTable(table, leetChar) - for _, key := range keysWithSameValue { - newMap := copyMapRemovingSameValueFromOtherKeys(table, key, leetChar) - result = append(result, newMap) - } - - return result -} - -// This function retrieves the list of keys that can be represented using the given value. -func retrieveListOfKeysWithSpecificValueFromTable(table map[string][]string, valueToFind string) []string { - result := []string{} - - for key, values := range table { - for _, value := range values { - if value == valueToFind && !stringSliceContainsValue(result, key) { - result = append(result, key) - } - } - } - - return result -} - -// This function returns a list of substitution map from a given table. Each map in the result will -// provide only one representation for each value. As an example, if the provided map contains the -// values "@" and "4" in the possibilities to represent "a", two maps will be created where one -// will contain "a" mapping to "@" and the other one will provide "a" mapping to "4". -func createSubstitutionsMapsFromTable(table map[string][]string) []map[string]string { - result := []map[string]string{{"": ""}} - - for key, values := range table { - newResult := []map[string]string{} - - for _, mapInCurrentResult := range result { - for _, value := range values { - newMapForValue := copyMap(mapInCurrentResult) - newMapForValue[key] = value - newResult = append(newResult, newMapForValue) - } - } - - result = newResult - } - - // verification to make sure that the slice was filled - if len(result) == 1 && len(result[0]) == 1 && result[0][""] == "" { - return []map[string]string{} - } - - return result -} - -// This function replaces the values provided on substitution map over the provided word. -func createWordForSubstitutionMap(word string, substitutionMap map[string]string) string { - result := word - for key, value := range substitutionMap { - result = strings.Replace(result, value, key, -1) - } - - return result -} - -func stringSliceContainsValue(slice []string, value string) bool { - for _, valueInSlice := range slice { - if valueInSlice == value { - return true - } - } - - return false -} - -func copyMap(table map[string]string) map[string]string { - result := make(map[string]string) - - for key, value := range table { - result[key] = value - } - - return result -} - -// This function creates a new map based on the one provided but excluding possible representations -// of the same value on other keys. -func copyMapRemovingSameValueFromOtherKeys(table map[string][]string, keyToFix string, valueToFix string) map[string][]string { - result := make(map[string][]string) - - for key, values := range table { - for _, value := range values { - if !(value == valueToFix && key != keyToFix) { - result[key] = append(result[key], value) - } - } - } - - return result -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/matching.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/matching.go deleted file mode 100644 index c6948067bc..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/matching.go +++ /dev/null @@ -1,79 +0,0 @@ -package matching - -import ( - "sort" - - "github.com/ccojocar/zxcvbn-go/adjacency" - "github.com/ccojocar/zxcvbn-go/frequency" - "github.com/ccojocar/zxcvbn-go/match" -) - -var ( - dictionaryMatchers []match.Matcher - matchers []match.Matcher - adjacencyGraphs []adjacency.Graph - l33tTable adjacency.Graph - - sequences map[string]string -) - -func init() { - loadFrequencyList() -} - -// Omnimatch runs all matchers against the password -func Omnimatch(password string, userInputs []string, filters ...func(match.Matcher) bool) (matches []match.Match) { - // Can I run into the issue where nil is not equal to nil? - if dictionaryMatchers == nil || adjacencyGraphs == nil { - loadFrequencyList() - } - - if userInputs != nil { - userInputMatcher := buildDictMatcher("user_inputs", buildRankedDict(userInputs)) - matches = userInputMatcher(password) - } - - for _, matcher := range matchers { - shouldBeFiltered := false - for i := range filters { - if filters[i](matcher) { - shouldBeFiltered = true - break - } - } - if !shouldBeFiltered { - matches = append(matches, matcher.MatchingFunc(password)...) - } - } - sort.Sort(match.Matches(matches)) - return matches -} - -func loadFrequencyList() { - for n, list := range frequency.Lists { - dictionaryMatchers = append(dictionaryMatchers, match.Matcher{MatchingFunc: buildDictMatcher(n, buildRankedDict(list.List)), ID: n}) - } - - l33tTable = adjacency.GraphMap["l33t"] - - adjacencyGraphs = append(adjacencyGraphs, adjacency.GraphMap["qwerty"]) - adjacencyGraphs = append(adjacencyGraphs, adjacency.GraphMap["dvorak"]) - adjacencyGraphs = append(adjacencyGraphs, adjacency.GraphMap["keypad"]) - adjacencyGraphs = append(adjacencyGraphs, adjacency.GraphMap["macKeypad"]) - - // l33tFilePath, _ := filepath.Abs("adjacency/L33t.json") - // L33T_TABLE = adjacency.GetAdjancencyGraphFromFile(l33tFilePath, "l33t") - - sequences = make(map[string]string) - sequences["lower"] = "abcdefghijklmnopqrstuvwxyz" - sequences["upper"] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - sequences["digits"] = "0123456789" - - matchers = append(matchers, dictionaryMatchers...) - matchers = append(matchers, match.Matcher{MatchingFunc: spatialMatch, ID: spatialMatcherName}) - matchers = append(matchers, match.Matcher{MatchingFunc: repeatMatch, ID: repeatMatcherName}) - matchers = append(matchers, match.Matcher{MatchingFunc: sequenceMatch, ID: sequenceMatcherName}) - matchers = append(matchers, match.Matcher{MatchingFunc: l33tMatch, ID: L33TMatcherName}) - matchers = append(matchers, match.Matcher{MatchingFunc: dateSepMatcher, ID: dateSepMatcherName}) - matchers = append(matchers, match.Matcher{MatchingFunc: dateWithoutSepMatch, ID: dateWithOutSepMatcherName}) -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/repeatMatch.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/repeatMatch.go deleted file mode 100644 index d52ba4254b..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/repeatMatch.go +++ /dev/null @@ -1,68 +0,0 @@ -package matching - -import ( - "strings" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -const repeatMatcherName = "REPEAT" - -// FilterRepeatMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterRepeatMatcher(m match.Matcher) bool { - return m.ID == repeatMatcherName -} - -func repeatMatch(password string) []match.Match { - var matches []match.Match - - // Loop through password. if current == prev currentStreak++ else if currentStreak > 2 {buildMatch; currentStreak = 1} prev = current - var current, prev string - currentStreak := 1 - var i int - var char rune - for i, char = range password { - current = string(char) - if i == 0 { - prev = current - continue - } - - if strings.EqualFold(current, prev) { - currentStreak++ - } else if currentStreak > 2 { - iPos := i - currentStreak - jPos := i - 1 - matchRepeat := match.Match{ - Pattern: "repeat", - I: iPos, - J: jPos, - Token: password[iPos : jPos+1], - DictionaryName: prev, - } - matchRepeat.Entropy = entropy.RepeatEntropy(matchRepeat) - matches = append(matches, matchRepeat) - currentStreak = 1 - } else { - currentStreak = 1 - } - - prev = current - } - - if currentStreak > 2 { - iPos := i - currentStreak + 1 - jPos := i - matchRepeat := match.Match{ - Pattern: "repeat", - I: iPos, - J: jPos, - Token: password[iPos : jPos+1], - DictionaryName: prev, - } - matchRepeat.Entropy = entropy.RepeatEntropy(matchRepeat) - matches = append(matches, matchRepeat) - } - return matches -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/sequenceMatch.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/sequenceMatch.go deleted file mode 100644 index 6971945838..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/sequenceMatch.go +++ /dev/null @@ -1,74 +0,0 @@ -package matching - -import ( - "strings" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -const sequenceMatcherName = "SEQ" - -// FilterSequenceMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterSequenceMatcher(m match.Matcher) bool { - return m.ID == sequenceMatcherName -} - -func sequenceMatch(password string) []match.Match { - var matches []match.Match - for i := 0; i < len(password); { - j := i + 1 - var seq string - var seqName string - seqDirection := 0 - for seqCandidateName, seqCandidate := range sequences { - iN := strings.Index(seqCandidate, string(password[i])) - var jN int - if j < len(password) { - jN = strings.Index(seqCandidate, string(password[j])) - } else { - jN = -1 - } - - if iN > -1 && jN > -1 { - direction := jN - iN - if direction == 1 || direction == -1 { - seq = seqCandidate - seqName = seqCandidateName - seqDirection = direction - break - } - } - - } - - if seq != "" { - for { - var prevN, curN int - if j < len(password) { - prevChar, curChar := password[j-1], password[j] - prevN, curN = strings.Index(seq, string(prevChar)), strings.Index(seq, string(curChar)) - } - - if j == len(password) || curN-prevN != seqDirection { - if j-i > 2 { - matchSequence := match.Match{ - Pattern: "sequence", - I: i, - J: j - 1, - Token: password[i:j], - DictionaryName: seqName, - } - - matchSequence.Entropy = entropy.SequenceEntropy(matchSequence, len(seq), (seqDirection == 1)) - matches = append(matches, matchSequence) - } - break - } - j++ - } - } - i = j - } - return matches -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/matching/spatialMatch.go b/vendor/github.com/ccojocar/zxcvbn-go/matching/spatialMatch.go deleted file mode 100644 index 101ccea5e5..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/matching/spatialMatch.go +++ /dev/null @@ -1,87 +0,0 @@ -package matching - -import ( - "strings" - - "github.com/ccojocar/zxcvbn-go/adjacency" - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" -) - -const spatialMatcherName = "SPATIAL" - -// FilterSpatialMatcher can be pass to zxcvbn-go.PasswordStrength to skip that matcher -func FilterSpatialMatcher(m match.Matcher) bool { - return m.ID == spatialMatcherName -} - -func spatialMatch(password string) (matches []match.Match) { - for _, graph := range adjacencyGraphs { - if graph.Graph != nil { - matches = append(matches, spatialMatchHelper(password, graph)...) - } - } - return matches -} - -func spatialMatchHelper(password string, graph adjacency.Graph) (matches []match.Match) { - for i := 0; i < len(password)-1; { - j := i + 1 - lastDirection := -99 // an int that it should never be! - turns := 0 - shiftedCount := 0 - - for { - prevChar := password[j-1] - found := false - var foundDirection int - curDirection := -1 - // My graphs seem to be wrong. . . and where the hell is qwerty - adjacents := graph.Graph[string(prevChar)] - // Consider growing pattern by one character if j hasn't gone over the edge - if j < len(password) { - curChar := password[j] - for _, adj := range adjacents { - curDirection++ - - if strings.Contains(adj, string(curChar)) { - found = true - foundDirection = curDirection - - if strings.Index(adj, string(curChar)) == 1 { - // index 1 in the adjacency means the key is shifted, 0 means unshifted: A vs a, % vs 5, etc. - // for example, 'q' is adjacent to the entry '2@'. @ is shifted w/ index 1, 2 is unshifted. - shiftedCount++ - } - - if lastDirection != foundDirection { - // adding a turn is correct even in the initial case when last_direction is null: - // every spatial pattern starts with a turn. - turns++ - lastDirection = foundDirection - } - break - } - } - } - - // if the current pattern continued, extend j and try to grow again - if found { - j++ - } else { - // otherwise push the pattern discovered so far, if any... - // don't consider length 1 or 2 chains. - if j-i > 2 { - matchSpc := match.Match{Pattern: "spatial", I: i, J: j - 1, Token: password[i:j], DictionaryName: graph.Name} - matchSpc.Entropy = entropy.SpatialEntropy(matchSpc, turns, shiftedCount) - matches = append(matches, matchSpc) - } - //. . . and then start a new search from the rest of the password - i = j - break - } - } - - } - return matches -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/renovate.json b/vendor/github.com/ccojocar/zxcvbn-go/renovate.json deleted file mode 100644 index 58ee1e0ea8..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/renovate.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "dependencyDashboard": true, - "dependencyDashboardTitle" : "Renovate(bot) : dependency dashboard", - "vulnerabilityAlerts": { - "enabled": true - }, - "extends": [ - ":preserveSemverRanges", - "group:all", - "schedule:weekly" - ], - "lockFileMaintenance": { - "commitMessageAction": "Update", - "enabled": true, - "extends": [ - "group:all", - "schedule:weekly" - ] - }, - "postUpdateOptions": [ - "gomodTidy", - "gomodUpdateImportPaths" - ], - "separateMajorMinor": false -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/scoring/scoring.go b/vendor/github.com/ccojocar/zxcvbn-go/scoring/scoring.go deleted file mode 100644 index f25606a8d6..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/scoring/scoring.go +++ /dev/null @@ -1,180 +0,0 @@ -package scoring - -import ( - "fmt" - "math" - "sort" - - "github.com/ccojocar/zxcvbn-go/entropy" - "github.com/ccojocar/zxcvbn-go/match" - zxcvbnmath "github.com/ccojocar/zxcvbn-go/utils/math" -) - -const ( - //for a hash function like bcrypt/scrypt/PBKDF2, 10ms per guess is a safe lower bound. - //(usually a guess would take longer -- this assumes fast hardware and a small work factor.) - //adjust for your site accordingly if you use another hash function, possibly by - //several orders of magnitude! - singleGuess float64 = 0.010 - numAttackers float64 = 100 // Cores used to make guesses - secondsPerGuess float64 = singleGuess / numAttackers -) - -// MinEntropyMatch is the lowest entropy match found -type MinEntropyMatch struct { - Password string - Entropy float64 - MatchSequence []match.Match - CrackTime float64 - CrackTimeDisplay string - Score int - CalcTime float64 -} - -/* -MinimumEntropyMatchSequence returns the minimum entropy - - Takes a list of overlapping matches, returns the non-overlapping sublist with - minimum entropy. O(nm) dp alg for length-n password with m candidate matches. -*/ -func MinimumEntropyMatchSequence(password string, matches []match.Match) MinEntropyMatch { - bruteforceCardinality := entropy.CalcBruteForceCardinality(password) - upToK := make([]float64, len(password)) - backPointers := make([]match.Match, len(password)) - - for k := 0; k < len(password); k++ { - upToK[k] = get(upToK, k-1) + math.Log2(bruteforceCardinality) - - for _, match := range matches { - if match.J != k { - continue - } - - i, j := match.I, match.J - // see if best entropy up to i-1 + entropy of match is less that current min at j - upTo := get(upToK, i-1) - candidateEntropy := upTo + match.Entropy - - if candidateEntropy < upToK[j] { - upToK[j] = candidateEntropy - match.Entropy = candidateEntropy - backPointers[j] = match - } - } - } - - // walk backwards and decode the best sequence - var matchSequence []match.Match - passwordLen := len(password) - passwordLen-- - for k := passwordLen; k >= 0; { - match := backPointers[k] - if match.Pattern != "" { - matchSequence = append(matchSequence, match) - k = match.I - 1 - - } else { - k-- - } - - } - sort.Sort(match.Matches(matchSequence)) - - makeBruteForceMatch := func(i, j int) match.Match { - return match.Match{ - Pattern: "bruteforce", - I: i, - J: j, - Token: password[i : j+1], - Entropy: math.Log2(math.Pow(bruteforceCardinality, float64(j-i))), - } - } - - k := 0 - var matchSequenceCopy []match.Match - for _, match := range matchSequence { - i, j := match.I, match.J - if i-k > 0 { - matchSequenceCopy = append(matchSequenceCopy, makeBruteForceMatch(k, i-1)) - } - k = j + 1 - matchSequenceCopy = append(matchSequenceCopy, match) - } - - if k < len(password) { - matchSequenceCopy = append(matchSequenceCopy, makeBruteForceMatch(k, len(password)-1)) - } - var minEntropy float64 - if len(password) == 0 { - minEntropy = float64(0) - } else { - minEntropy = upToK[len(password)-1] - } - - crackTime := roundToXDigits(entropyToCrackTime(minEntropy), 3) - return MinEntropyMatch{ - Password: password, - Entropy: roundToXDigits(minEntropy, 3), - MatchSequence: matchSequenceCopy, - CrackTime: crackTime, - CrackTimeDisplay: displayTime(crackTime), - Score: crackTimeToScore(crackTime), - } -} - -func get(a []float64, i int) float64 { - if i < 0 || i >= len(a) { - return float64(0) - } - - return a[i] -} - -func entropyToCrackTime(entropy float64) float64 { - crackTime := (0.5 * math.Pow(float64(2), entropy)) * secondsPerGuess - - return crackTime -} - -func roundToXDigits(number float64, digits int) float64 { - return zxcvbnmath.Round(number, .5, digits) -} - -func displayTime(seconds float64) string { - formater := "%.1f %s" - minute := float64(60) - hour := minute * float64(60) - day := hour * float64(24) - month := day * float64(31) - year := month * float64(12) - century := year * float64(100) - - if seconds < minute { - return "instant" - } else if seconds < hour { - return fmt.Sprintf(formater, (1 + math.Ceil(seconds/minute)), "minutes") - } else if seconds < day { - return fmt.Sprintf(formater, (1 + math.Ceil(seconds/hour)), "hours") - } else if seconds < month { - return fmt.Sprintf(formater, (1 + math.Ceil(seconds/day)), "days") - } else if seconds < year { - return fmt.Sprintf(formater, (1 + math.Ceil(seconds/month)), "months") - } else if seconds < century { - return fmt.Sprintf(formater, (1 + math.Ceil(seconds/century)), "years") - } - return "centuries" -} - -func crackTimeToScore(seconds float64) int { - if seconds < math.Pow(10, 2) { - return 0 - } else if seconds < math.Pow(10, 4) { - return 1 - } else if seconds < math.Pow(10, 6) { - return 2 - } else if seconds < math.Pow(10, 8) { - return 3 - } - - return 4 -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/utils/math/mathutils.go b/vendor/github.com/ccojocar/zxcvbn-go/utils/math/mathutils.go deleted file mode 100644 index 1b989d194d..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/utils/math/mathutils.go +++ /dev/null @@ -1,40 +0,0 @@ -package zxcvbnmath - -import "math" - -/* -NChoseK http://blog.plover.com/math/choose.html -I am surprised that I have to define these. . . Maybe i just didn't look hard enough for a lib. -*/ -func NChoseK(n, k float64) float64 { - if k > n { - return 0 - } else if k == 0 { - return 1 - } - - var r float64 = 1 - - for d := float64(1); d <= k; d++ { - r *= n - r /= d - n-- - } - - return r -} - -// Round a number -func Round(val float64, roundOn float64, places int) (newVal float64) { - var round float64 - pow := math.Pow(10, float64(places)) - digit := pow * val - _, div := math.Modf(digit) - if div >= roundOn { - round = math.Ceil(digit) - } else { - round = math.Floor(digit) - } - newVal = round / pow - return -} diff --git a/vendor/github.com/ccojocar/zxcvbn-go/zxcvbn.go b/vendor/github.com/ccojocar/zxcvbn-go/zxcvbn.go deleted file mode 100644 index f3dc19e4c5..0000000000 --- a/vendor/github.com/ccojocar/zxcvbn-go/zxcvbn.go +++ /dev/null @@ -1,22 +0,0 @@ -package zxcvbn - -import ( - "time" - - "github.com/ccojocar/zxcvbn-go/match" - "github.com/ccojocar/zxcvbn-go/matching" - "github.com/ccojocar/zxcvbn-go/scoring" - zxcvbnmath "github.com/ccojocar/zxcvbn-go/utils/math" -) - -// PasswordStrength takes a password, userInputs and optional filters and returns a MinEntropyMatch -func PasswordStrength(password string, userInputs []string, filters ...func(match.Matcher) bool) scoring.MinEntropyMatch { - start := time.Now() - matches := matching.Omnimatch(password, userInputs, filters...) - result := scoring.MinimumEntropyMatchSequence(password, matches) - end := time.Now() - - calcTime := end.Nanosecond() - start.Nanosecond() - result.CalcTime = zxcvbnmath.Round(float64(calcTime)*time.Nanosecond.Seconds(), .5, 3) - return result -} diff --git a/vendor/github.com/charithe/durationcheck/.gitignore b/vendor/github.com/charithe/durationcheck/.gitignore deleted file mode 100644 index c2b126a846..0000000000 --- a/vendor/github.com/charithe/durationcheck/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/durationcheck diff --git a/vendor/github.com/charithe/durationcheck/LICENSE b/vendor/github.com/charithe/durationcheck/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/charithe/durationcheck/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/charithe/durationcheck/Makefile b/vendor/github.com/charithe/durationcheck/Makefile deleted file mode 100644 index 8e2f81ae87..0000000000 --- a/vendor/github.com/charithe/durationcheck/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -build: - @GO111MODULE=on go build -ldflags '-s -w' -o durationcheck ./cmd/durationcheck/main.go - -install: - @GO111MODULE=on go install -ldflags '-s -w' ./cmd/durationcheck diff --git a/vendor/github.com/charithe/durationcheck/README.md b/vendor/github.com/charithe/durationcheck/README.md deleted file mode 100644 index 6f4279bd38..0000000000 --- a/vendor/github.com/charithe/durationcheck/README.md +++ /dev/null @@ -1,51 +0,0 @@ -[![CircleCI](https://circleci.com/gh/charithe/durationcheck.svg?style=svg)](https://circleci.com/gh/charithe/durationcheck) - - - -Duration Check -=============== - -A Go linter to detect cases where two `time.Duration` values are being multiplied in possibly erroneous ways. - -Consider the following (highly contrived) code: - -```go -func waitForSeconds(someDuration time.Duration) { - timeToWait := someDuration * time.Second - fmt.Printf("Waiting for %s\n", timeToWait) -} - -func main() { - waitForSeconds(5) // waits for 5 seconds - waitForSeconds(5 * time.Second) // waits for 1388888h 53m 20s -} -``` - -Both invocations of the function are syntactically correct but the second one is probably not what most people want. -In this contrived example it is quite easy to spot the mistake. However, if the incorrect `waitForSeconds` invocation is -nested deep within a complex piece of code that runs in the background, the mistake could go unnoticed for months (which -is exactly what happened in a production backend system of fairly well-known software service). - - -See the [test cases](testdata/src/a/a.go) for more examples of the types of errors detected by the linter. - - -Installation -------------- - -Requires Go 1.11 or above. - -``` -go get -u github.com/charithe/durationcheck/cmd/durationcheck -``` - -Usage ------ - -Invoke `durationcheck` with your package name - -``` -durationcheck ./... -# or -durationcheck github.com/you/yourproject/... -``` diff --git a/vendor/github.com/charithe/durationcheck/durationcheck.go b/vendor/github.com/charithe/durationcheck/durationcheck.go deleted file mode 100644 index c47b3a7613..0000000000 --- a/vendor/github.com/charithe/durationcheck/durationcheck.go +++ /dev/null @@ -1,191 +0,0 @@ -package durationcheck - -import ( - "bytes" - "fmt" - "go/ast" - "go/format" - "go/token" - "go/types" - "log" - "os" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -var Analyzer = &analysis.Analyzer{ - Name: "durationcheck", - Doc: "check for two durations multiplied together", - Run: run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, -} - -func run(pass *analysis.Pass) (interface{}, error) { - // if the package does not import time, it can be skipped from analysis - if !hasImport(pass.Pkg, "time") { - return nil, nil - } - - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeTypes := []ast.Node{ - (*ast.BinaryExpr)(nil), - } - - inspect.Preorder(nodeTypes, check(pass)) - - return nil, nil -} - -func hasImport(pkg *types.Package, importPath string) bool { - for _, imp := range pkg.Imports() { - if imp.Path() == importPath { - return true - } - } - - return false -} - -// check contains the logic for checking that time.Duration is used correctly in the code being analysed -func check(pass *analysis.Pass) func(ast.Node) { - return func(node ast.Node) { - expr := node.(*ast.BinaryExpr) - // we are only interested in multiplication - if expr.Op != token.MUL { - return - } - - // get the types of the two operands - x, xOK := pass.TypesInfo.Types[expr.X] - y, yOK := pass.TypesInfo.Types[expr.Y] - - if !xOK || !yOK { - return - } - - if isDuration(x.Type) && isDuration(y.Type) { - // check that both sides are acceptable expressions - if isUnacceptableExpr(pass, expr.X) && isUnacceptableExpr(pass, expr.Y) { - pass.Reportf(expr.Pos(), "Multiplication of durations: `%s`", formatNode(expr)) - } - } - } -} - -func isDuration(x types.Type) bool { - return x.String() == "time.Duration" || x.String() == "*time.Duration" -} - -// isUnacceptableExpr returns true if the argument is not an acceptable time.Duration expression -func isUnacceptableExpr(pass *analysis.Pass, expr ast.Expr) bool { - switch e := expr.(type) { - case *ast.BasicLit: - return false - case *ast.Ident: - return !isAcceptableNestedExpr(pass, e) - case *ast.CallExpr: - return !isAcceptableCast(pass, e) - case *ast.BinaryExpr: - return !isAcceptableNestedExpr(pass, e) - case *ast.UnaryExpr: - return !isAcceptableNestedExpr(pass, e) - case *ast.SelectorExpr: - return !isAcceptableNestedExpr(pass, e) - case *ast.StarExpr: - return !isAcceptableNestedExpr(pass, e) - case *ast.ParenExpr: - return !isAcceptableNestedExpr(pass, e) - case *ast.IndexExpr: - return !isAcceptableNestedExpr(pass, e) - default: - return true - } -} - -// isAcceptableCast returns true if the argument is an acceptable expression cast to time.Duration -func isAcceptableCast(pass *analysis.Pass, e *ast.CallExpr) bool { - // check that there's a single argument - if len(e.Args) != 1 { - return false - } - - // check that the argument is acceptable - if !isAcceptableNestedExpr(pass, e.Args[0]) { - return false - } - - // check for time.Duration cast - selector, ok := e.Fun.(*ast.SelectorExpr) - if !ok { - return false - } - - return isDurationCast(selector) -} - -func isDurationCast(selector *ast.SelectorExpr) bool { - pkg, ok := selector.X.(*ast.Ident) - if !ok { - return false - } - - if pkg.Name != "time" { - return false - } - - return selector.Sel.Name == "Duration" -} - -func isAcceptableNestedExpr(pass *analysis.Pass, n ast.Expr) bool { - switch e := n.(type) { - case *ast.BasicLit: - return true - case *ast.BinaryExpr: - return isAcceptableNestedExpr(pass, e.X) && isAcceptableNestedExpr(pass, e.Y) - case *ast.UnaryExpr: - return isAcceptableNestedExpr(pass, e.X) - case *ast.Ident: - return isAcceptableIdent(pass, e) - case *ast.CallExpr: - if isAcceptableCast(pass, e) { - return true - } - t := pass.TypesInfo.TypeOf(e) - return !isDuration(t) - case *ast.SelectorExpr: - return isAcceptableNestedExpr(pass, e.X) && isAcceptableIdent(pass, e.Sel) - case *ast.StarExpr: - return isAcceptableNestedExpr(pass, e.X) - case *ast.ParenExpr: - return isAcceptableNestedExpr(pass, e.X) - case *ast.IndexExpr: - t := pass.TypesInfo.TypeOf(e) - return !isDuration(t) - default: - return false - } -} - -func isAcceptableIdent(pass *analysis.Pass, ident *ast.Ident) bool { - obj := pass.TypesInfo.ObjectOf(ident) - return !isDuration(obj.Type()) -} - -func formatNode(node ast.Node) string { - buf := new(bytes.Buffer) - if err := format.Node(buf, token.NewFileSet(), node); err != nil { - log.Printf("Error formatting expression: %v", err) - return "" - } - - return buf.String() -} - -func printAST(msg string, node ast.Node) { - fmt.Printf(">>> %s:\n%s\n\n\n", msg, formatNode(node)) - ast.Fprint(os.Stdout, nil, node, nil) - fmt.Println("--------------") -} diff --git a/vendor/github.com/charmbracelet/lipgloss/.gitignore b/vendor/github.com/charmbracelet/lipgloss/.gitignore deleted file mode 100644 index a170af09c4..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/.gitignore +++ /dev/null @@ -1 +0,0 @@ -ssh_example_ed25519* \ No newline at end of file diff --git a/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml b/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml deleted file mode 100644 index ef456e0605..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml +++ /dev/null @@ -1,47 +0,0 @@ -run: - tests: false - -issues: - include: - - EXC0001 - - EXC0005 - - EXC0011 - - EXC0012 - - EXC0013 - - max-issues-per-linter: 0 - max-same-issues: 0 - -linters: - enable: - # - dupl - - exhaustive - # - exhaustivestruct - - goconst - - godot - - godox - - gomnd - - gomoddirectives - - goprintffuncname - - ifshort - # - lll - - misspell - - nakedret - - nestif - - noctx - - nolintlint - - prealloc - - wrapcheck - - # disable default linters, they are already enabled in .golangci.yml - disable: - - deadcode - - errcheck - - gosimple - - govet - - ineffassign - - staticcheck - - structcheck - - typecheck - - unused - - varcheck diff --git a/vendor/github.com/charmbracelet/lipgloss/.golangci.yml b/vendor/github.com/charmbracelet/lipgloss/.golangci.yml deleted file mode 100644 index a5a91d0d91..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/.golangci.yml +++ /dev/null @@ -1,29 +0,0 @@ -run: - tests: false - -issues: - include: - - EXC0001 - - EXC0005 - - EXC0011 - - EXC0012 - - EXC0013 - - max-issues-per-linter: 0 - max-same-issues: 0 - -linters: - enable: - - bodyclose - - exportloopref - - goimports - - gosec - - nilerr - - predeclared - - revive - - rowserrcheck - - sqlclosecheck - - tparallel - - unconvert - - unparam - - whitespace diff --git a/vendor/github.com/charmbracelet/lipgloss/LICENSE b/vendor/github.com/charmbracelet/lipgloss/LICENSE deleted file mode 100644 index ece3536f7c..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Charmbracelet, Inc - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/charmbracelet/lipgloss/README.md b/vendor/github.com/charmbracelet/lipgloss/README.md deleted file mode 100644 index a071564ecb..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/README.md +++ /dev/null @@ -1,458 +0,0 @@ -Lip Gloss -========= - -

- Lip Gloss Title Treatment
- Latest Release - GoDoc - Build Status -

- -Style definitions for nice terminal layouts. Built with TUIs in mind. - -![Lip Gloss example](https://stuff.charm.sh/lipgloss/lipgloss-example.png) - -Lip Gloss takes an expressive, declarative approach to terminal rendering. -Users familiar with CSS will feel at home with Lip Gloss. - -```go - -import "github.com/charmbracelet/lipgloss" - -var style = lipgloss.NewStyle(). - Bold(true). - Foreground(lipgloss.Color("#FAFAFA")). - Background(lipgloss.Color("#7D56F4")). - PaddingTop(2). - PaddingLeft(4). - Width(22) - -fmt.Println(style.Render("Hello, kitty")) -``` - -## Colors - -Lip Gloss supports the following color profiles: - -### ANSI 16 colors (4-bit) - -```go -lipgloss.Color("5") // magenta -lipgloss.Color("9") // red -lipgloss.Color("12") // light blue -``` - -### ANSI 256 Colors (8-bit) - -```go -lipgloss.Color("86") // aqua -lipgloss.Color("201") // hot pink -lipgloss.Color("202") // orange -``` - -### True Color (16,777,216 colors; 24-bit) - -```go -lipgloss.Color("#0000FF") // good ol' 100% blue -lipgloss.Color("#04B575") // a green -lipgloss.Color("#3C3C3C") // a dark gray -``` - -...as well as a 1-bit ASCII profile, which is black and white only. - -The terminal's color profile will be automatically detected, and colors outside -the gamut of the current palette will be automatically coerced to their closest -available value. - - -### Adaptive Colors - -You can also specify color options for light and dark backgrounds: - -```go -lipgloss.AdaptiveColor{Light: "236", Dark: "248"} -``` - -The terminal's background color will automatically be detected and the -appropriate color will be chosen at runtime. - -### Complete Colors - -CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color -profiles. - -```go -lipgloss.CompleteColor{True: "#0000FF", ANSI256: "86", ANSI: "5"} -``` - -Automatic color degradation will not be performed in this case and it will be -based on the color specified. - -### Complete Adaptive Colors - -You can use CompleteColor with AdaptiveColor to specify the exact values for -light and dark backgrounds without automatic color degradation. - -```go -lipgloss.CompleteAdaptiveColor{ - Light: CompleteColor{TrueColor: "#d7ffae", ANSI256: "193", ANSI: "11"}, - Dark: CompleteColor{TrueColor: "#d75fee", ANSI256: "163", ANSI: "5"}, -} -``` - -## Inline Formatting - -Lip Gloss supports the usual ANSI text formatting options: - -```go -var style = lipgloss.NewStyle(). - Bold(true). - Italic(true). - Faint(true). - Blink(true). - Strikethrough(true). - Underline(true). - Reverse(true) -``` - - -## Block-Level Formatting - -Lip Gloss also supports rules for block-level formatting: - -```go -// Padding -var style = lipgloss.NewStyle(). - PaddingTop(2). - PaddingRight(4). - PaddingBottom(2). - PaddingLeft(4) - -// Margins -var style = lipgloss.NewStyle(). - MarginTop(2). - MarginRight(4). - MarginBottom(2). - MarginLeft(4) -``` - -There is also shorthand syntax for margins and padding, which follows the same -format as CSS: - -```go -// 2 cells on all sides -lipgloss.NewStyle().Padding(2) - -// 2 cells on the top and bottom, 4 cells on the left and right -lipgloss.NewStyle().Margin(2, 4) - -// 1 cell on the top, 4 cells on the sides, 2 cells on the bottom -lipgloss.NewStyle().Padding(1, 4, 2) - -// Clockwise, starting from the top: 2 cells on the top, 4 on the right, 3 on -// the bottom, and 1 on the left -lipgloss.NewStyle().Margin(2, 4, 3, 1) -``` - - -## Aligning Text - -You can align paragraphs of text to the left, right, or center. - -```go -var style = lipgloss.NewStyle(). - Width(24). - Align(lipgloss.Left). // align it left - Align(lipgloss.Right). // no wait, align it right - Align(lipgloss.Center) // just kidding, align it in the center -``` - - -## Width and Height - -Setting a minimum width and height is simple and straightforward. - -```go -var style = lipgloss.NewStyle(). - SetString("What’s for lunch?"). - Width(24). - Height(32). - Foreground(lipgloss.Color("63")) -``` - - -## Borders - -Adding borders is easy: - -```go -// Add a purple, rectangular border -var style = lipgloss.NewStyle(). - BorderStyle(lipgloss.NormalBorder()). - BorderForeground(lipgloss.Color("63")) - -// Set a rounded, yellow-on-purple border to the top and left -var anotherStyle = lipgloss.NewStyle(). - BorderStyle(lipgloss.RoundedBorder()). - BorderForeground(lipgloss.Color("228")). - BorderBackground(lipgloss.Color("63")). - BorderTop(true). - BorderLeft(true) - -// Make your own border -var myCuteBorder = lipgloss.Border{ - Top: "._.:*:", - Bottom: "._.:*:", - Left: "|*", - Right: "|*", - TopLeft: "*", - TopRight: "*", - BottomLeft: "*", - BottomRight: "*", -} -``` - -There are also shorthand functions for defining borders, which follow a similar -pattern to the margin and padding shorthand functions. - -```go -// Add a thick border to the top and bottom -lipgloss.NewStyle(). - Border(lipgloss.ThickBorder(), true, false) - -// Add a thick border to the right and bottom sides. Rules are set clockwise -// from top. -lipgloss.NewStyle(). - Border(lipgloss.DoubleBorder(), true, false, false, true) -``` - -For more on borders see [the docs][docs]. - - -## Copying Styles - -Just use `Copy()`: - -```go -var style = lipgloss.NewStyle().Foreground(lipgloss.Color("219")) - -var wildStyle = style.Copy().Blink(true) -``` - -`Copy()` performs a copy on the underlying data structure ensuring that you get -a true, dereferenced copy of a style. Without copying, it's possible to mutate -styles. - - -## Inheritance - -Styles can inherit rules from other styles. When inheriting, only unset rules -on the receiver are inherited. - -```go -var styleA = lipgloss.NewStyle(). - Foreground(lipgloss.Color("229")). - Background(lipgloss.Color("63")) - -// Only the background color will be inherited here, because the foreground -// color will have been already set: -var styleB = lipgloss.NewStyle(). - Foreground(lipgloss.Color("201")). - Inherit(styleA) -``` - - -## Unsetting Rules - -All rules can be unset: - -```go -var style = lipgloss.NewStyle(). - Bold(true). // make it bold - UnsetBold(). // jk don't make it bold - Background(lipgloss.Color("227")). // yellow background - UnsetBackground() // never mind -``` - -When a rule is unset, it won't be inherited or copied. - - -## Enforcing Rules - -Sometimes, such as when developing a component, you want to make sure style -definitions respect their intended purpose in the UI. This is where `Inline` -and `MaxWidth`, and `MaxHeight` come in: - -```go -// Force rendering onto a single line, ignoring margins, padding, and borders. -someStyle.Inline(true).Render("yadda yadda") - -// Also limit rendering to five cells -someStyle.Inline(true).MaxWidth(5).Render("yadda yadda") - -// Limit rendering to a 5x5 cell block -someStyle.MaxWidth(5).MaxHeight(5).Render("yadda yadda") -``` - -## Rendering - -Generally, you just call the `Render(string...)` method on a `lipgloss.Style`: - -```go -style := lipgloss.NewStyle().Bold(true).SetString("Hello,") -fmt.Println(style.Render("kitty.")) // Hello, kitty. -fmt.Println(style.Render("puppy.")) // Hello, puppy. -``` - -But you could also use the Stringer interface: - -```go -var style = lipgloss.NewStyle().SetString("你好,猫咪。").Bold(true) -fmt.Println(style) // 你好,猫咪。 -``` - -### Custom Renderers - -Custom renderers allow you to render to a specific outputs. This is -particularly important when you want to render to different outputs and -correctly detect the color profile and dark background status for each, such as -in a server-client situation. - -```go -func myLittleHandler(sess ssh.Session) { - // Create a renderer for the client. - renderer := lipgloss.NewRenderer(sess) - - // Create a new style on the renderer. - style := renderer.NewStyle().Background(lipgloss.AdaptiveColor{Light: "63", Dark: "228"}) - - // Render. The color profile and dark background state will be correctly detected. - io.WriteString(sess, style.Render("Heyyyyyyy")) -} -``` - -For an example on using a custom renderer over SSH with [Wish][wish] see the -[SSH example][ssh-example]. - -## Utilities - -In addition to pure styling, Lip Gloss also ships with some utilities to help -assemble your layouts. - - -### Joining Paragraphs - -Horizontally and vertically joining paragraphs is a cinch. - -```go -// Horizontally join three paragraphs along their bottom edges -lipgloss.JoinHorizontal(lipgloss.Bottom, paragraphA, paragraphB, paragraphC) - -// Vertically join two paragraphs along their center axes -lipgloss.JoinVertical(lipgloss.Center, paragraphA, paragraphB) - -// Horizontally join three paragraphs, with the shorter ones aligning 20% -// from the top of the tallest -lipgloss.JoinHorizontal(0.2, paragraphA, paragraphB, paragraphC) -``` - - -### Measuring Width and Height - -Sometimes you’ll want to know the width and height of text blocks when building -your layouts. - -```go -// Render a block of text. -var style = lipgloss.NewStyle(). - Width(40). - Padding(2) -var block string = style.Render(someLongString) - -// Get the actual, physical dimensions of the text block. -width := lipgloss.Width(block) -height := lipgloss.Height(block) - -// Here's a shorthand function. -w, h := lipgloss.Size(block) -``` - - -### Placing Text in Whitespace - -Sometimes you’ll simply want to place a block of text in whitespace. - -```go -// Center a paragraph horizontally in a space 80 cells wide. The height of -// the block returned will be as tall as the input paragraph. -block := lipgloss.PlaceHorizontal(80, lipgloss.Center, fancyStyledParagraph) - -// Place a paragraph at the bottom of a space 30 cells tall. The width of -// the text block returned will be as wide as the input paragraph. -block := lipgloss.PlaceVertical(30, lipgloss.Bottom, fancyStyledParagraph) - -// Place a paragraph in the bottom right corner of a 30x80 cell space. -block := lipgloss.Place(30, 80, lipgloss.Right, lipgloss.Bottom, fancyStyledParagraph) -``` - -You can also style the whitespace. For details, see [the docs][docs]. - - -*** - - -## What about [Bubble Tea][tea]? - -Lip Gloss doesn’t replace Bubble Tea. Rather, it is an excellent Bubble Tea -companion. It was designed to make assembling terminal user interface views as -simple and fun as possible so that you can focus on building your application -instead of concerning yourself with low-level layout details. - -In simple terms, you can use Lip Gloss to help build your Bubble Tea views. - -[tea]: https://github.com/charmbracelet/tea - - -## Under the Hood - -Lip Gloss is built on the excellent [Termenv][termenv] and [Reflow][reflow] -libraries which deal with color and ANSI-aware text operations, respectively. -For many use cases Termenv and Reflow will be sufficient for your needs. - -[termenv]: https://github.com/muesli/termenv -[reflow]: https://github.com/muesli/reflow - - -## Rendering Markdown - -For a more document-centric rendering solution with support for things like -lists, tables, and syntax-highlighted code have a look at [Glamour][glamour], -the stylesheet-based Markdown renderer. - -[glamour]: https://github.com/charmbracelet/glamour - - -## Feedback - -We’d love to hear your thoughts on this project. Feel free to drop us a note! - -* [Twitter](https://twitter.com/charmcli) -* [The Fediverse](https://mastodon.social/@charmcli) -* [Discord](https://charm.sh/chat) - -## License - -[MIT](https://github.com/charmbracelet/lipgloss/raw/master/LICENSE) - -*** - -Part of [Charm](https://charm.sh). - -The Charm logo - -Charm热爱开源 • Charm loves open source - - -[docs]: https://pkg.go.dev/github.com/charmbracelet/lipgloss?tab=doc -[wish]: https://github.com/charmbracelet/wish -[ssh-example]: examples/ssh diff --git a/vendor/github.com/charmbracelet/lipgloss/align.go b/vendor/github.com/charmbracelet/lipgloss/align.go deleted file mode 100644 index c399703827..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/align.go +++ /dev/null @@ -1,82 +0,0 @@ -package lipgloss - -import ( - "strings" - - "github.com/muesli/reflow/ansi" - "github.com/muesli/termenv" -) - -// Perform text alignment. If the string is multi-lined, we also make all lines -// the same width by padding them with spaces. If a termenv style is passed, -// use that to style the spaces added. -func alignTextHorizontal(str string, pos Position, width int, style *termenv.Style) string { - lines, widestLine := getLines(str) - var b strings.Builder - - for i, l := range lines { - lineWidth := ansi.PrintableRuneWidth(l) - - shortAmount := widestLine - lineWidth // difference from the widest line - shortAmount += max(0, width-(shortAmount+lineWidth)) // difference from the total width, if set - - if shortAmount > 0 { - switch pos { - case Right: - s := strings.Repeat(" ", shortAmount) - if style != nil { - s = style.Styled(s) - } - l = s + l - case Center: - left := shortAmount / 2 - right := left + shortAmount%2 // note that we put the remainder on the right - - leftSpaces := strings.Repeat(" ", left) - rightSpaces := strings.Repeat(" ", right) - - if style != nil { - leftSpaces = style.Styled(leftSpaces) - rightSpaces = style.Styled(rightSpaces) - } - l = leftSpaces + l + rightSpaces - default: // Left - s := strings.Repeat(" ", shortAmount) - if style != nil { - s = style.Styled(s) - } - l += s - } - } - - b.WriteString(l) - if i < len(lines)-1 { - b.WriteRune('\n') - } - } - - return b.String() -} - -func alignTextVertical(str string, pos Position, height int, _ *termenv.Style) string { - strHeight := strings.Count(str, "\n") + 1 - if height < strHeight { - return str - } - - switch pos { - case Top: - return str + strings.Repeat("\n", height-strHeight) - case Center: - var topPadding, bottomPadding = (height - strHeight) / 2, (height - strHeight) / 2 - if strHeight+topPadding+bottomPadding > height { - topPadding-- - } else if strHeight+topPadding+bottomPadding < height { - bottomPadding++ - } - return strings.Repeat("\n", topPadding) + str + strings.Repeat("\n", bottomPadding) - case Bottom: - return strings.Repeat("\n", height-strHeight) + str - } - return str -} diff --git a/vendor/github.com/charmbracelet/lipgloss/ansi_unix.go b/vendor/github.com/charmbracelet/lipgloss/ansi_unix.go deleted file mode 100644 index d416b8c99b..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/ansi_unix.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !windows -// +build !windows - -package lipgloss - -// enableLegacyWindowsANSI is only needed on Windows. -func enableLegacyWindowsANSI() {} diff --git a/vendor/github.com/charmbracelet/lipgloss/ansi_windows.go b/vendor/github.com/charmbracelet/lipgloss/ansi_windows.go deleted file mode 100644 index 0cf56e4c70..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/ansi_windows.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build windows -// +build windows - -package lipgloss - -import ( - "sync" - - "github.com/muesli/termenv" -) - -var enableANSI sync.Once - -// enableANSIColors enables support for ANSI color sequences in the Windows -// default console (cmd.exe and the PowerShell application). Note that this -// only works with Windows 10. Also note that Windows Terminal supports colors -// by default. -func enableLegacyWindowsANSI() { - enableANSI.Do(func() { - _, _ = termenv.EnableWindowsANSIConsole() - }) -} diff --git a/vendor/github.com/charmbracelet/lipgloss/borders.go b/vendor/github.com/charmbracelet/lipgloss/borders.go deleted file mode 100644 index 18964221a8..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/borders.go +++ /dev/null @@ -1,412 +0,0 @@ -package lipgloss - -import ( - "strings" - - "github.com/mattn/go-runewidth" - "github.com/muesli/reflow/ansi" - "github.com/muesli/termenv" -) - -// Border contains a series of values which comprise the various parts of a -// border. -type Border struct { - Top string - Bottom string - Left string - Right string - TopLeft string - TopRight string - BottomRight string - BottomLeft string -} - -// GetTopSize returns the width of the top border. If borders contain runes of -// varying widths, the widest rune is returned. If no border exists on the top -// edge, 0 is returned. -func (b Border) GetTopSize() int { - return getBorderEdgeWidth(b.TopLeft, b.Top, b.TopRight) -} - -// GetRightSize returns the width of the right border. If borders contain -// runes of varying widths, the widest rune is returned. If no border exists on -// the right edge, 0 is returned. -func (b Border) GetRightSize() int { - return getBorderEdgeWidth(b.TopRight, b.Top, b.BottomRight) -} - -// GetBottomSize returns the width of the bottom border. If borders contain -// runes of varying widths, the widest rune is returned. If no border exists on -// the bottom edge, 0 is returned. -func (b Border) GetBottomSize() int { - return getBorderEdgeWidth(b.BottomLeft, b.Bottom, b.BottomRight) -} - -// GetLeftSize returns the width of the left border. If borders contain runes -// of varying widths, the widest rune is returned. If no border exists on the -// left edge, 0 is returned. -func (b Border) GetLeftSize() int { - return getBorderEdgeWidth(b.TopLeft, b.Left, b.TopRight) -} - -func getBorderEdgeWidth(borderParts ...string) (maxWidth int) { - for _, piece := range borderParts { - w := maxRuneWidth(piece) - if w > maxWidth { - maxWidth = w - } - } - return maxWidth -} - -var ( - noBorder = Border{} - - normalBorder = Border{ - Top: "─", - Bottom: "─", - Left: "│", - Right: "│", - TopLeft: "┌", - TopRight: "┐", - BottomLeft: "└", - BottomRight: "┘", - } - - roundedBorder = Border{ - Top: "─", - Bottom: "─", - Left: "│", - Right: "│", - TopLeft: "╭", - TopRight: "╮", - BottomLeft: "╰", - BottomRight: "╯", - } - - blockBorder = Border{ - Top: "█", - Bottom: "█", - Left: "█", - Right: "█", - TopLeft: "█", - TopRight: "█", - BottomLeft: "█", - BottomRight: "█", - } - - outerHalfBlockBorder = Border{ - Top: "▀", - Bottom: "▄", - Left: "▌", - Right: "▐", - TopLeft: "▛", - TopRight: "▜", - BottomLeft: "▙", - BottomRight: "▟", - } - - innerHalfBlockBorder = Border{ - Top: "▄", - Bottom: "▀", - Left: "▐", - Right: "▌", - TopLeft: "▗", - TopRight: "▖", - BottomLeft: "▝", - BottomRight: "▘", - } - - thickBorder = Border{ - Top: "━", - Bottom: "━", - Left: "┃", - Right: "┃", - TopLeft: "┏", - TopRight: "┓", - BottomLeft: "┗", - BottomRight: "┛", - } - - doubleBorder = Border{ - Top: "═", - Bottom: "═", - Left: "║", - Right: "║", - TopLeft: "╔", - TopRight: "╗", - BottomLeft: "╚", - BottomRight: "╝", - } - - hiddenBorder = Border{ - Top: " ", - Bottom: " ", - Left: " ", - Right: " ", - TopLeft: " ", - TopRight: " ", - BottomLeft: " ", - BottomRight: " ", - } -) - -// NormalBorder returns a standard-type border with a normal weight and 90 -// degree corners. -func NormalBorder() Border { - return normalBorder -} - -// RoundedBorder returns a border with rounded corners. -func RoundedBorder() Border { - return roundedBorder -} - -// BlockBorder returns a border that takes the whole block. -func BlockBorder() Border { - return blockBorder -} - -// OuterHalfBlockBorder returns a half-block border that sits outside the frame. -func OuterHalfBlockBorder() Border { - return outerHalfBlockBorder -} - -// InnerHalfBlockBorder returns a half-block border that sits inside the frame. -func InnerHalfBlockBorder() Border { - return innerHalfBlockBorder -} - -// ThickBorder returns a border that's thicker than the one returned by -// NormalBorder. -func ThickBorder() Border { - return thickBorder -} - -// DoubleBorder returns a border comprised of two thin strokes. -func DoubleBorder() Border { - return doubleBorder -} - -// HiddenBorder returns a border that renders as a series of single-cell -// spaces. It's useful for cases when you want to remove a standard border but -// maintain layout positioning. This said, you can still apply a background -// color to a hidden border. -func HiddenBorder() Border { - return hiddenBorder -} - -func (s Style) applyBorder(str string) string { - var ( - topSet = s.isSet(borderTopKey) - rightSet = s.isSet(borderRightKey) - bottomSet = s.isSet(borderBottomKey) - leftSet = s.isSet(borderLeftKey) - - border = s.getBorderStyle() - hasTop = s.getAsBool(borderTopKey, false) - hasRight = s.getAsBool(borderRightKey, false) - hasBottom = s.getAsBool(borderBottomKey, false) - hasLeft = s.getAsBool(borderLeftKey, false) - - topFG = s.getAsColor(borderTopForegroundKey) - rightFG = s.getAsColor(borderRightForegroundKey) - bottomFG = s.getAsColor(borderBottomForegroundKey) - leftFG = s.getAsColor(borderLeftForegroundKey) - - topBG = s.getAsColor(borderTopBackgroundKey) - rightBG = s.getAsColor(borderRightBackgroundKey) - bottomBG = s.getAsColor(borderBottomBackgroundKey) - leftBG = s.getAsColor(borderLeftBackgroundKey) - ) - - // If a border is set and no sides have been specifically turned on or off - // render borders on all sides. - if border != noBorder && !(topSet || rightSet || bottomSet || leftSet) { - hasTop = true - hasRight = true - hasBottom = true - hasLeft = true - } - - // If no border is set or all borders are been disabled, abort. - if border == noBorder || (!hasTop && !hasRight && !hasBottom && !hasLeft) { - return str - } - - lines, width := getLines(str) - - if hasLeft { - if border.Left == "" { - border.Left = " " - } - width += maxRuneWidth(border.Left) - } - - if hasRight && border.Right == "" { - border.Right = " " - } - - // If corners should be rendered but are set with the empty string, fill them - // with a single space. - if hasTop && hasLeft && border.TopLeft == "" { - border.TopLeft = " " - } - if hasTop && hasRight && border.TopRight == "" { - border.TopRight = " " - } - if hasBottom && hasLeft && border.BottomLeft == "" { - border.BottomLeft = " " - } - if hasBottom && hasRight && border.BottomRight == "" { - border.BottomRight = " " - } - - // Figure out which corners we should actually be using based on which - // sides are set to show. - if hasTop { - switch { - case !hasLeft && !hasRight: - border.TopLeft = "" - border.TopRight = "" - case !hasLeft: - border.TopLeft = "" - case !hasRight: - border.TopRight = "" - } - } - if hasBottom { - switch { - case !hasLeft && !hasRight: - border.BottomLeft = "" - border.BottomRight = "" - case !hasLeft: - border.BottomLeft = "" - case !hasRight: - border.BottomRight = "" - } - } - - // For now, limit corners to one rune. - border.TopLeft = getFirstRuneAsString(border.TopLeft) - border.TopRight = getFirstRuneAsString(border.TopRight) - border.BottomRight = getFirstRuneAsString(border.BottomRight) - border.BottomLeft = getFirstRuneAsString(border.BottomLeft) - - var out strings.Builder - - // Render top - if hasTop { - top := renderHorizontalEdge(border.TopLeft, border.Top, border.TopRight, width) - top = s.styleBorder(top, topFG, topBG) - out.WriteString(top) - out.WriteRune('\n') - } - - leftRunes := []rune(border.Left) - leftIndex := 0 - - rightRunes := []rune(border.Right) - rightIndex := 0 - - // Render sides - for i, l := range lines { - if hasLeft { - r := string(leftRunes[leftIndex]) - leftIndex++ - if leftIndex >= len(leftRunes) { - leftIndex = 0 - } - out.WriteString(s.styleBorder(r, leftFG, leftBG)) - } - out.WriteString(l) - if hasRight { - r := string(rightRunes[rightIndex]) - rightIndex++ - if rightIndex >= len(rightRunes) { - rightIndex = 0 - } - out.WriteString(s.styleBorder(r, rightFG, rightBG)) - } - if i < len(lines)-1 { - out.WriteRune('\n') - } - } - - // Render bottom - if hasBottom { - bottom := renderHorizontalEdge(border.BottomLeft, border.Bottom, border.BottomRight, width) - bottom = s.styleBorder(bottom, bottomFG, bottomBG) - out.WriteRune('\n') - out.WriteString(bottom) - } - - return out.String() -} - -// Render the horizontal (top or bottom) portion of a border. -func renderHorizontalEdge(left, middle, right string, width int) string { - if width < 1 { - return "" - } - - if middle == "" { - middle = " " - } - - leftWidth := ansi.PrintableRuneWidth(left) - rightWidth := ansi.PrintableRuneWidth(right) - - runes := []rune(middle) - j := 0 - - out := strings.Builder{} - out.WriteString(left) - for i := leftWidth + rightWidth; i < width+rightWidth; { - out.WriteRune(runes[j]) - j++ - if j >= len(runes) { - j = 0 - } - i += ansi.PrintableRuneWidth(string(runes[j])) - } - out.WriteString(right) - - return out.String() -} - -// Apply foreground and background styling to a border. -func (s Style) styleBorder(border string, fg, bg TerminalColor) string { - if fg == noColor && bg == noColor { - return border - } - - var style = termenv.Style{} - - if fg != noColor { - style = style.Foreground(fg.color(s.r)) - } - if bg != noColor { - style = style.Background(bg.color(s.r)) - } - - return style.Styled(border) -} - -func maxRuneWidth(str string) (width int) { - for _, r := range str { - w := runewidth.RuneWidth(r) - if w > width { - width = w - } - } - return width -} - -func getFirstRuneAsString(str string) string { - if str == "" { - return str - } - r := []rune(str) - return string(r[0]) -} diff --git a/vendor/github.com/charmbracelet/lipgloss/color.go b/vendor/github.com/charmbracelet/lipgloss/color.go deleted file mode 100644 index ef7fd2796a..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/color.go +++ /dev/null @@ -1,172 +0,0 @@ -package lipgloss - -import ( - "strconv" - - "github.com/muesli/termenv" -) - -// TerminalColor is a color intended to be rendered in the terminal. -type TerminalColor interface { - color(*Renderer) termenv.Color - RGBA() (r, g, b, a uint32) -} - -var noColor = NoColor{} - -// NoColor is used to specify the absence of color styling. When this is active -// foreground colors will be rendered with the terminal's default text color, -// and background colors will not be drawn at all. -// -// Example usage: -// -// var style = someStyle.Copy().Background(lipgloss.NoColor{}) -type NoColor struct{} - -func (NoColor) color(*Renderer) termenv.Color { - return termenv.NoColor{} -} - -// RGBA returns the RGBA value of this color. Because we have to return -// something, despite this color being the absence of color, we're returning -// black with 100% opacity. -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// -// Deprecated. -func (n NoColor) RGBA() (r, g, b, a uint32) { - return 0x0, 0x0, 0x0, 0xFFFF -} - -// Color specifies a color by hex or ANSI value. For example: -// -// ansiColor := lipgloss.Color("21") -// hexColor := lipgloss.Color("#0000ff") -type Color string - -func (c Color) color(r *Renderer) termenv.Color { - return r.ColorProfile().Color(string(c)) -} - -// RGBA returns the RGBA value of this color. This satisfies the Go Color -// interface. Note that on error we return black with 100% opacity, or: -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// -// Deprecated. -func (c Color) RGBA() (r, g, b, a uint32) { - return termenv.ConvertToRGB(c.color(renderer)).RGBA() -} - -// ANSIColor is a color specified by an ANSI color value. It's merely syntactic -// sugar for the more general Color function. Invalid colors will render as -// black. -// -// Example usage: -// -// // These two statements are equivalent. -// colorA := lipgloss.ANSIColor(21) -// colorB := lipgloss.Color("21") -type ANSIColor uint - -func (ac ANSIColor) color(r *Renderer) termenv.Color { - return Color(strconv.FormatUint(uint64(ac), 10)).color(r) -} - -// RGBA returns the RGBA value of this color. This satisfies the Go Color -// interface. Note that on error we return black with 100% opacity, or: -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// -// Deprecated. -func (ac ANSIColor) RGBA() (r, g, b, a uint32) { - cf := Color(strconv.FormatUint(uint64(ac), 10)) - return cf.RGBA() -} - -// AdaptiveColor provides color options for light and dark backgrounds. The -// appropriate color will be returned at runtime based on the darkness of the -// terminal background color. -// -// Example usage: -// -// color := lipgloss.AdaptiveColor{Light: "#0000ff", Dark: "#000099"} -type AdaptiveColor struct { - Light string - Dark string -} - -func (ac AdaptiveColor) color(r *Renderer) termenv.Color { - if r.HasDarkBackground() { - return Color(ac.Dark).color(r) - } - return Color(ac.Light).color(r) -} - -// RGBA returns the RGBA value of this color. This satisfies the Go Color -// interface. Note that on error we return black with 100% opacity, or: -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// -// Deprecated. -func (ac AdaptiveColor) RGBA() (r, g, b, a uint32) { - return termenv.ConvertToRGB(ac.color(renderer)).RGBA() -} - -// CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color -// profiles. Automatic color degradation will not be performed. -type CompleteColor struct { - TrueColor string - ANSI256 string - ANSI string -} - -func (c CompleteColor) color(r *Renderer) termenv.Color { - p := r.ColorProfile() - switch p { - case termenv.TrueColor: - return p.Color(c.TrueColor) - case termenv.ANSI256: - return p.Color(c.ANSI256) - case termenv.ANSI: - return p.Color(c.ANSI) - default: - return termenv.NoColor{} - } -} - -// RGBA returns the RGBA value of this color. This satisfies the Go Color -// interface. Note that on error we return black with 100% opacity, or: -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// CompleteAdaptiveColor specifies exact values for truecolor, ANSI256, and ANSI color -// -// Deprecated. -func (c CompleteColor) RGBA() (r, g, b, a uint32) { - return termenv.ConvertToRGB(c.color(renderer)).RGBA() -} - -// CompleteColor specifies exact values for truecolor, ANSI256, and ANSI color -// profiles, with separate options for light and dark backgrounds. Automatic -// color degradation will not be performed. -type CompleteAdaptiveColor struct { - Light CompleteColor - Dark CompleteColor -} - -func (cac CompleteAdaptiveColor) color(r *Renderer) termenv.Color { - if r.HasDarkBackground() { - return cac.Dark.color(r) - } - return cac.Light.color(r) -} - -// RGBA returns the RGBA value of this color. This satisfies the Go Color -// interface. Note that on error we return black with 100% opacity, or: -// -// Red: 0x0, Green: 0x0, Blue: 0x0, Alpha: 0xFFFF. -// -// Deprecated. -func (cac CompleteAdaptiveColor) RGBA() (r, g, b, a uint32) { - return termenv.ConvertToRGB(cac.color(renderer)).RGBA() -} diff --git a/vendor/github.com/charmbracelet/lipgloss/get.go b/vendor/github.com/charmbracelet/lipgloss/get.go deleted file mode 100644 index eb24a4ede3..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/get.go +++ /dev/null @@ -1,481 +0,0 @@ -package lipgloss - -import ( - "strings" - - "github.com/muesli/reflow/ansi" -) - -// GetBold returns the style's bold value. If no value is set false is returned. -func (s Style) GetBold() bool { - return s.getAsBool(boldKey, false) -} - -// GetItalic returns the style's italic value. If no value is set false is -// returned. -func (s Style) GetItalic() bool { - return s.getAsBool(italicKey, false) -} - -// GetUnderline returns the style's underline value. If no value is set false is -// returned. -func (s Style) GetUnderline() bool { - return s.getAsBool(underlineKey, false) -} - -// GetStrikethrough returns the style's strikethrough value. If no value is set false -// is returned. -func (s Style) GetStrikethrough() bool { - return s.getAsBool(strikethroughKey, false) -} - -// GetReverse returns the style's reverse value. If no value is set false is -// returned. -func (s Style) GetReverse() bool { - return s.getAsBool(reverseKey, false) -} - -// GetBlink returns the style's blink value. If no value is set false is -// returned. -func (s Style) GetBlink() bool { - return s.getAsBool(blinkKey, false) -} - -// GetFaint returns the style's faint value. If no value is set false is -// returned. -func (s Style) GetFaint() bool { - return s.getAsBool(faintKey, false) -} - -// GetForeground returns the style's foreground color. If no value is set -// NoColor{} is returned. -func (s Style) GetForeground() TerminalColor { - return s.getAsColor(foregroundKey) -} - -// GetBackground returns the style's back color. If no value is set -// NoColor{} is returned. -func (s Style) GetBackground() TerminalColor { - return s.getAsColor(backgroundKey) -} - -// GetWidth returns the style's width setting. If no width is set 0 is -// returned. -func (s Style) GetWidth() int { - return s.getAsInt(widthKey) -} - -// GetHeight returns the style's height setting. If no height is set 0 is -// returned. -func (s Style) GetHeight() int { - return s.getAsInt(heightKey) -} - -// GetAlign returns the style's implicit horizontal alignment setting. -// If no alignment is set Position.Left is returned. -func (s Style) GetAlign() Position { - v := s.getAsPosition(alignHorizontalKey) - if v == Position(0) { - return Left - } - return v -} - -// GetAlignHorizontal returns the style's implicit horizontal alignment setting. -// If no alignment is set Position.Left is returned. -func (s Style) GetAlignHorizontal() Position { - v := s.getAsPosition(alignHorizontalKey) - if v == Position(0) { - return Left - } - return v -} - -// GetAlignVertical returns the style's implicit vertical alignment setting. -// If no alignment is set Position.Top is returned. -func (s Style) GetAlignVertical() Position { - v := s.getAsPosition(alignVerticalKey) - if v == Position(0) { - return Top - } - return v -} - -// GetPadding returns the style's top, right, bottom, and left padding values, -// in that order. 0 is returned for unset values. -func (s Style) GetPadding() (top, right, bottom, left int) { - return s.getAsInt(paddingTopKey), - s.getAsInt(paddingRightKey), - s.getAsInt(paddingBottomKey), - s.getAsInt(paddingLeftKey) -} - -// GetPaddingTop returns the style's top padding. If no value is set 0 is -// returned. -func (s Style) GetPaddingTop() int { - return s.getAsInt(paddingTopKey) -} - -// GetPaddingRight returns the style's right padding. If no value is set 0 is -// returned. -func (s Style) GetPaddingRight() int { - return s.getAsInt(paddingRightKey) -} - -// GetPaddingBottom returns the style's bottom padding. If no value is set 0 is -// returned. -func (s Style) GetPaddingBottom() int { - return s.getAsInt(paddingBottomKey) -} - -// GetPaddingLeft returns the style's left padding. If no value is set 0 is -// returned. -func (s Style) GetPaddingLeft() int { - return s.getAsInt(paddingLeftKey) -} - -// GetHorizontalPadding returns the style's left and right padding. Unset -// values are measured as 0. -func (s Style) GetHorizontalPadding() int { - return s.getAsInt(paddingLeftKey) + s.getAsInt(paddingRightKey) -} - -// GetVerticalPadding returns the style's top and bottom padding. Unset values -// are measured as 0. -func (s Style) GetVerticalPadding() int { - return s.getAsInt(paddingTopKey) + s.getAsInt(paddingBottomKey) -} - -// GetColorWhitespace returns the style's whitespace coloring setting. If no -// value is set false is returned. -func (s Style) GetColorWhitespace() bool { - return s.getAsBool(colorWhitespaceKey, false) -} - -// GetMargin returns the style's top, right, bottom, and left margins, in that -// order. 0 is returned for unset values. -func (s Style) GetMargin() (top, right, bottom, left int) { - return s.getAsInt(marginTopKey), - s.getAsInt(marginRightKey), - s.getAsInt(marginBottomKey), - s.getAsInt(marginLeftKey) -} - -// GetMarginTop returns the style's top margin. If no value is set 0 is -// returned. -func (s Style) GetMarginTop() int { - return s.getAsInt(marginTopKey) -} - -// GetMarginRight returns the style's right margin. If no value is set 0 is -// returned. -func (s Style) GetMarginRight() int { - return s.getAsInt(marginRightKey) -} - -// GetMarginBottom returns the style's bottom margin. If no value is set 0 is -// returned. -func (s Style) GetMarginBottom() int { - return s.getAsInt(marginBottomKey) -} - -// GetMarginLeft returns the style's left margin. If no value is set 0 is -// returned. -func (s Style) GetMarginLeft() int { - return s.getAsInt(marginLeftKey) -} - -// GetHorizontalMargins returns the style's left and right margins. Unset -// values are measured as 0. -func (s Style) GetHorizontalMargins() int { - return s.getAsInt(marginLeftKey) + s.getAsInt(marginRightKey) -} - -// GetVerticalMargins returns the style's top and bottom padding. Unset values -// are measured as 0. -func (s Style) GetVerticalMargins() int { - return s.getAsInt(marginTopKey) + s.getAsInt(marginBottomKey) -} - -// GetBorder returns the style's border style (type Border) and value for the -// top, right, bottom, and left in that order. If no value is set for the -// border style, Border{} is returned. For all other unset values false is -// returned. -func (s Style) GetBorder() (b Border, top, right, bottom, left bool) { - return s.getBorderStyle(), - s.getAsBool(borderTopKey, false), - s.getAsBool(borderRightKey, false), - s.getAsBool(borderBottomKey, false), - s.getAsBool(borderLeftKey, false) -} - -// GetBorderStyle returns the style's border style (type Border). If no value -// is set Border{} is returned. -func (s Style) GetBorderStyle() Border { - return s.getBorderStyle() -} - -// GetBorderTop returns the style's top border setting. If no value is set -// false is returned. -func (s Style) GetBorderTop() bool { - return s.getAsBool(borderTopKey, false) -} - -// GetBorderRight returns the style's right border setting. If no value is set -// false is returned. -func (s Style) GetBorderRight() bool { - return s.getAsBool(borderRightKey, false) -} - -// GetBorderBottom returns the style's bottom border setting. If no value is -// set false is returned. -func (s Style) GetBorderBottom() bool { - return s.getAsBool(borderBottomKey, false) -} - -// GetBorderLeft returns the style's left border setting. If no value is -// set false is returned. -func (s Style) GetBorderLeft() bool { - return s.getAsBool(borderLeftKey, false) -} - -// GetBorderTopForeground returns the style's border top foreground color. If -// no value is set NoColor{} is returned. -func (s Style) GetBorderTopForeground() TerminalColor { - return s.getAsColor(borderTopForegroundKey) -} - -// GetBorderRightForeground returns the style's border right foreground color. -// If no value is set NoColor{} is returned. -func (s Style) GetBorderRightForeground() TerminalColor { - return s.getAsColor(borderRightForegroundKey) -} - -// GetBorderBottomForeground returns the style's border bottom foreground -// color. If no value is set NoColor{} is returned. -func (s Style) GetBorderBottomForeground() TerminalColor { - return s.getAsColor(borderBottomForegroundKey) -} - -// GetBorderLeftForeground returns the style's border bottom foreground -// color. If no value is set NoColor{} is returned. -func (s Style) GetBorderLeftForeground() TerminalColor { - return s.getAsColor(borderLeftForegroundKey) -} - -// GetBorderTopBackground returns the style's border top background color. If -// no value is set NoColor{} is returned. -func (s Style) GetBorderTopBackground() TerminalColor { - return s.getAsColor(borderTopBackgroundKey) -} - -// GetBorderRightBackground returns the style's border right background color. -// If no value is set NoColor{} is returned. -func (s Style) GetBorderRightBackground() TerminalColor { - return s.getAsColor(borderRightBackgroundKey) -} - -// GetBorderBottomBackground returns the style's border bottom background -// color. If no value is set NoColor{} is returned. -func (s Style) GetBorderBottomBackground() TerminalColor { - return s.getAsColor(borderBottomBackgroundKey) -} - -// GetBorderLeftBackground returns the style's border bottom background -// color. If no value is set NoColor{} is returned. -func (s Style) GetBorderLeftBackground() TerminalColor { - return s.getAsColor(borderLeftBackgroundKey) -} - -// GetBorderTopWidth returns the width of the top border. If borders contain -// runes of varying widths, the widest rune is returned. If no border exists on -// the top edge, 0 is returned. -// -// Deprecated: This function simply calls Style.GetBorderTopSize. -func (s Style) GetBorderTopWidth() int { - return s.GetBorderTopSize() -} - -// GetBorderTopSize returns the width of the top border. If borders contain -// runes of varying widths, the widest rune is returned. If no border exists on -// the top edge, 0 is returned. -func (s Style) GetBorderTopSize() int { - if !s.getAsBool(borderTopKey, false) { - return 0 - } - return s.getBorderStyle().GetTopSize() -} - -// GetBorderLeftSize returns the width of the left border. If borders contain -// runes of varying widths, the widest rune is returned. If no border exists on -// the left edge, 0 is returned. -func (s Style) GetBorderLeftSize() int { - if !s.getAsBool(borderLeftKey, false) { - return 0 - } - return s.getBorderStyle().GetLeftSize() -} - -// GetBorderBottomSize returns the width of the bottom border. If borders -// contain runes of varying widths, the widest rune is returned. If no border -// exists on the left edge, 0 is returned. -func (s Style) GetBorderBottomSize() int { - if !s.getAsBool(borderBottomKey, false) { - return 0 - } - return s.getBorderStyle().GetBottomSize() -} - -// GetBorderRightSize returns the width of the right border. If borders -// contain runes of varying widths, the widest rune is returned. If no border -// exists on the right edge, 0 is returned. -func (s Style) GetBorderRightSize() int { - if !s.getAsBool(borderRightKey, false) { - return 0 - } - return s.getBorderStyle().GetBottomSize() -} - -// GetHorizontalBorderSize returns the width of the horizontal borders. If -// borders contain runes of varying widths, the widest rune is returned. If no -// border exists on the horizontal edges, 0 is returned. -func (s Style) GetHorizontalBorderSize() int { - b := s.getBorderStyle() - return b.GetLeftSize() + b.GetRightSize() -} - -// GetVerticalBorderSize returns the width of the horizontal borders. If -// borders contain runes of varying widths, the widest rune is returned. If no -// border exists on the horizontal edges, 0 is returned. -func (s Style) GetVerticalBorderSize() int { - b := s.getBorderStyle() - return b.GetTopSize() + b.GetBottomSize() -} - -// GetInline returns the style's inline setting. If no value is set false is -// returned. -func (s Style) GetInline() bool { - return s.getAsBool(inlineKey, false) -} - -// GetMaxWidth returns the style's max width setting. If no value is set 0 is -// returned. -func (s Style) GetMaxWidth() int { - return s.getAsInt(maxWidthKey) -} - -// GetMaxHeight returns the style's max width setting. If no value is set 0 is -// returned. -func (s Style) GetMaxHeight() int { - return s.getAsInt(maxHeightKey) -} - -// GetUnderlineSpaces returns whether or not the style is set to underline -// spaces. If not value is set false is returned. -func (s Style) GetUnderlineSpaces() bool { - return s.getAsBool(underlineSpacesKey, false) -} - -// GetStrikethroughSpaces returns whether or not the style is set to underline -// spaces. If not value is set false is returned. -func (s Style) GetStrikethroughSpaces() bool { - return s.getAsBool(strikethroughSpacesKey, false) -} - -// GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding -// and border widths. -// -// Provisional: this method may be renamed. -func (s Style) GetHorizontalFrameSize() int { - return s.GetHorizontalMargins() + s.GetHorizontalPadding() + s.GetHorizontalBorderSize() -} - -// GetVerticalFrameSize returns the sum of the style's horizontal margins, padding -// and border widths. -// -// Provisional: this method may be renamed. -func (s Style) GetVerticalFrameSize() int { - return s.GetVerticalMargins() + s.GetVerticalPadding() + s.GetVerticalBorderSize() -} - -// GetFrameSize returns the sum of the margins, padding and border width for -// both the horizontal and vertical margins. -func (s Style) GetFrameSize() (x, y int) { - return s.GetHorizontalFrameSize(), s.GetVerticalFrameSize() -} - -// Returns whether or not the given property is set. -func (s Style) isSet(k propKey) bool { - _, exists := s.rules[k] - return exists -} - -func (s Style) getAsBool(k propKey, defaultVal bool) bool { - v, ok := s.rules[k] - if !ok { - return defaultVal - } - if b, ok := v.(bool); ok { - return b - } - return defaultVal -} - -func (s Style) getAsColor(k propKey) TerminalColor { - v, ok := s.rules[k] - if !ok { - return noColor - } - if c, ok := v.(TerminalColor); ok { - return c - } - return noColor -} - -func (s Style) getAsInt(k propKey) int { - v, ok := s.rules[k] - if !ok { - return 0 - } - if i, ok := v.(int); ok { - return i - } - return 0 -} - -func (s Style) getAsPosition(k propKey) Position { - v, ok := s.rules[k] - if !ok { - return Position(0) - } - if p, ok := v.(Position); ok { - return p - } - return Position(0) -} - -func (s Style) getBorderStyle() Border { - v, ok := s.rules[borderStyleKey] - if !ok { - return noBorder - } - if b, ok := v.(Border); ok { - return b - } - return noBorder -} - -// Split a string into lines, additionally returning the size of the widest -// line. -func getLines(s string) (lines []string, widest int) { - lines = strings.Split(s, "\n") - - for _, l := range lines { - w := ansi.PrintableRuneWidth(l) - if widest < w { - widest = w - } - } - - return lines, widest -} diff --git a/vendor/github.com/charmbracelet/lipgloss/join.go b/vendor/github.com/charmbracelet/lipgloss/join.go deleted file mode 100644 index cc16600ac6..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/join.go +++ /dev/null @@ -1,175 +0,0 @@ -package lipgloss - -import ( - "math" - "strings" - - "github.com/muesli/reflow/ansi" -) - -// JoinHorizontal is a utility function for horizontally joining two -// potentially multi-lined strings along a vertical axis. The first argument is -// the position, with 0 being all the way at the top and 1 being all the way -// at the bottom. -// -// If you just want to align to the left, right or center you may as well just -// use the helper constants Top, Center, and Bottom. -// -// Example: -// -// blockB := "...\n...\n..." -// blockA := "...\n...\n...\n...\n..." -// -// // Join 20% from the top -// str := lipgloss.JoinHorizontal(0.2, blockA, blockB) -// -// // Join on the top edge -// str := lipgloss.JoinHorizontal(lipgloss.Top, blockA, blockB) -func JoinHorizontal(pos Position, strs ...string) string { - if len(strs) == 0 { - return "" - } - if len(strs) == 1 { - return strs[0] - } - - var ( - // Groups of strings broken into multiple lines - blocks = make([][]string, len(strs)) - - // Max line widths for the above text blocks - maxWidths = make([]int, len(strs)) - - // Height of the tallest block - maxHeight int - ) - - // Break text blocks into lines and get max widths for each text block - for i, str := range strs { - blocks[i], maxWidths[i] = getLines(str) - if len(blocks[i]) > maxHeight { - maxHeight = len(blocks[i]) - } - } - - // Add extra lines to make each side the same height - for i := range blocks { - if len(blocks[i]) >= maxHeight { - continue - } - - extraLines := make([]string, maxHeight-len(blocks[i])) - - switch pos { - case Top: - blocks[i] = append(blocks[i], extraLines...) - - case Bottom: - blocks[i] = append(extraLines, blocks[i]...) - - default: // Somewhere in the middle - n := len(extraLines) - split := int(math.Round(float64(n) * pos.value())) - top := n - split - bottom := n - top - - blocks[i] = append(extraLines[top:], blocks[i]...) - blocks[i] = append(blocks[i], extraLines[bottom:]...) - } - } - - // Merge lines - var b strings.Builder - for i := range blocks[0] { // remember, all blocks have the same number of members now - for j, block := range blocks { - b.WriteString(block[i]) - - // Also make lines the same length - b.WriteString(strings.Repeat(" ", maxWidths[j]-ansi.PrintableRuneWidth(block[i]))) - } - if i < len(blocks[0])-1 { - b.WriteRune('\n') - } - } - - return b.String() -} - -// JoinVertical is a utility function for vertically joining two potentially -// multi-lined strings along a horizontal axis. The first argument is the -// position, with 0 being all the way to the left and 1 being all the way to -// the right. -// -// If you just want to align to the left, right or center you may as well just -// use the helper constants Left, Center, and Right. -// -// Example: -// -// blockB := "...\n...\n..." -// blockA := "...\n...\n...\n...\n..." -// -// // Join 20% from the top -// str := lipgloss.JoinVertical(0.2, blockA, blockB) -// -// // Join on the right edge -// str := lipgloss.JoinVertical(lipgloss.Right, blockA, blockB) -func JoinVertical(pos Position, strs ...string) string { - if len(strs) == 0 { - return "" - } - if len(strs) == 1 { - return strs[0] - } - - var ( - blocks = make([][]string, len(strs)) - maxWidth int - ) - - for i := range strs { - var w int - blocks[i], w = getLines(strs[i]) - if w > maxWidth { - maxWidth = w - } - } - - var b strings.Builder - for i, block := range blocks { - for j, line := range block { - w := maxWidth - ansi.PrintableRuneWidth(line) - - switch pos { - case Left: - b.WriteString(line) - b.WriteString(strings.Repeat(" ", w)) - - case Right: - b.WriteString(strings.Repeat(" ", w)) - b.WriteString(line) - - default: // Somewhere in the middle - if w < 1 { - b.WriteString(line) - break - } - - split := int(math.Round(float64(w) * pos.value())) - right := w - split - left := w - right - - b.WriteString(strings.Repeat(" ", left)) - b.WriteString(line) - b.WriteString(strings.Repeat(" ", right)) - } - - // Write a newline as long as we're not on the last line of the - // last block. - if !(i == len(blocks)-1 && j == len(block)-1) { - b.WriteRune('\n') - } - } - } - - return b.String() -} diff --git a/vendor/github.com/charmbracelet/lipgloss/position.go b/vendor/github.com/charmbracelet/lipgloss/position.go deleted file mode 100644 index 28f5ccbd69..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/position.go +++ /dev/null @@ -1,154 +0,0 @@ -package lipgloss - -import ( - "math" - "strings" - - "github.com/muesli/reflow/ansi" -) - -// Position represents a position along a horizontal or vertical axis. It's in -// situations where an axis is involved, like alignment, joining, placement and -// so on. -// -// A value of 0 represents the start (the left or top) and 1 represents the end -// (the right or bottom). 0.5 represents the center. -// -// There are constants Top, Bottom, Center, Left and Right in this package that -// can be used to aid readability. -type Position float64 - -func (p Position) value() float64 { - return math.Min(1, math.Max(0, float64(p))) -} - -// Position aliases. -const ( - Top Position = 0.0 - Bottom Position = 1.0 - Center Position = 0.5 - Left Position = 0.0 - Right Position = 1.0 -) - -// Place places a string or text block vertically in an unstyled box of a given -// width or height. -func Place(width, height int, hPos, vPos Position, str string, opts ...WhitespaceOption) string { - return renderer.Place(width, height, hPos, vPos, str, opts...) -} - -// Place places a string or text block vertically in an unstyled box of a given -// width or height. -func (r *Renderer) Place(width, height int, hPos, vPos Position, str string, opts ...WhitespaceOption) string { - return r.PlaceVertical(height, vPos, r.PlaceHorizontal(width, hPos, str, opts...), opts...) -} - -// PlaceHorizontal places a string or text block horizontally in an unstyled -// block of a given width. If the given width is shorter than the max width of -// the string (measured by its longest line) this will be a noop. -func PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOption) string { - return renderer.PlaceHorizontal(width, pos, str, opts...) -} - -// PlaceHorizontal places a string or text block horizontally in an unstyled -// block of a given width. If the given width is shorter than the max width of -// the string (measured by it's longest line) this will be a noöp. -func (r *Renderer) PlaceHorizontal(width int, pos Position, str string, opts ...WhitespaceOption) string { - lines, contentWidth := getLines(str) - gap := width - contentWidth - - if gap <= 0 { - return str - } - - ws := newWhitespace(r, opts...) - - var b strings.Builder - for i, l := range lines { - // Is this line shorter than the longest line? - short := max(0, contentWidth-ansi.PrintableRuneWidth(l)) - - switch pos { - case Left: - b.WriteString(l) - b.WriteString(ws.render(gap + short)) - - case Right: - b.WriteString(ws.render(gap + short)) - b.WriteString(l) - - default: // somewhere in the middle - totalGap := gap + short - - split := int(math.Round(float64(totalGap) * pos.value())) - left := totalGap - split - right := totalGap - left - - b.WriteString(ws.render(left)) - b.WriteString(l) - b.WriteString(ws.render(right)) - } - - if i < len(lines)-1 { - b.WriteRune('\n') - } - } - - return b.String() -} - -// PlaceVertical places a string or text block vertically in an unstyled block -// of a given height. If the given height is shorter than the height of the -// string (measured by its newlines) then this will be a noop. -func PlaceVertical(height int, pos Position, str string, opts ...WhitespaceOption) string { - return renderer.PlaceVertical(height, pos, str, opts...) -} - -// PlaceVertical places a string or text block vertically in an unstyled block -// of a given height. If the given height is shorter than the height of the -// string (measured by it's newlines) then this will be a noöp. -func (r *Renderer) PlaceVertical(height int, pos Position, str string, opts ...WhitespaceOption) string { - contentHeight := strings.Count(str, "\n") + 1 - gap := height - contentHeight - - if gap <= 0 { - return str - } - - ws := newWhitespace(r, opts...) - - _, width := getLines(str) - emptyLine := ws.render(width) - b := strings.Builder{} - - switch pos { - case Top: - b.WriteString(str) - b.WriteRune('\n') - for i := 0; i < gap; i++ { - b.WriteString(emptyLine) - if i < gap-1 { - b.WriteRune('\n') - } - } - - case Bottom: - b.WriteString(strings.Repeat(emptyLine+"\n", gap)) - b.WriteString(str) - - default: // Somewhere in the middle - split := int(math.Round(float64(gap) * pos.value())) - top := gap - split - bottom := gap - top - - b.WriteString(strings.Repeat(emptyLine+"\n", top)) - b.WriteString(str) - - for i := 0; i < bottom; i++ { - b.WriteRune('\n') - b.WriteString(emptyLine) - } - } - - return b.String() -} diff --git a/vendor/github.com/charmbracelet/lipgloss/renderer.go b/vendor/github.com/charmbracelet/lipgloss/renderer.go deleted file mode 100644 index 4bea8374d7..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/renderer.go +++ /dev/null @@ -1,143 +0,0 @@ -package lipgloss - -import ( - "io" - - "github.com/muesli/termenv" -) - -// We're manually creating the struct here to avoid initializing the output and -// query the terminal multiple times. -var renderer = &Renderer{ - output: termenv.DefaultOutput(), -} - -// Renderer is a lipgloss terminal renderer. -type Renderer struct { - output *termenv.Output - hasDarkBackground *bool -} - -// RendererOption is a function that can be used to configure a [Renderer]. -type RendererOption func(r *Renderer) - -// DefaultRenderer returns the default renderer. -func DefaultRenderer() *Renderer { - return renderer -} - -// SetDefaultRenderer sets the default global renderer. -func SetDefaultRenderer(r *Renderer) { - renderer = r -} - -// NewRenderer creates a new Renderer. -// -// w will be used to determine the terminal's color capabilities. -func NewRenderer(w io.Writer, opts ...termenv.OutputOption) *Renderer { - r := &Renderer{ - output: termenv.NewOutput(w, opts...), - } - return r -} - -// Output returns the termenv output. -func (r *Renderer) Output() *termenv.Output { - return r.output -} - -// SetOutput sets the termenv output. -func (r *Renderer) SetOutput(o *termenv.Output) { - r.output = o -} - -// ColorProfile returns the detected termenv color profile. -func (r *Renderer) ColorProfile() termenv.Profile { - return r.output.Profile -} - -// ColorProfile returns the detected termenv color profile. -func ColorProfile() termenv.Profile { - return renderer.ColorProfile() -} - -// SetColorProfile sets the color profile on the renderer. This function exists -// mostly for testing purposes so that you can assure you're testing against -// a specific profile. -// -// Outside of testing you likely won't want to use this function as the color -// profile will detect and cache the terminal's color capabilities and choose -// the best available profile. -// -// Available color profiles are: -// -// termenv.Ascii // no color, 1-bit -// termenv.ANSI //16 colors, 4-bit -// termenv.ANSI256 // 256 colors, 8-bit -// termenv.TrueColor // 16,777,216 colors, 24-bit -// -// This function is thread-safe. -func (r *Renderer) SetColorProfile(p termenv.Profile) { - r.output.Profile = p -} - -// SetColorProfile sets the color profile on the default renderer. This -// function exists mostly for testing purposes so that you can assure you're -// testing against a specific profile. -// -// Outside of testing you likely won't want to use this function as the color -// profile will detect and cache the terminal's color capabilities and choose -// the best available profile. -// -// Available color profiles are: -// -// termenv.Ascii // no color, 1-bit -// termenv.ANSI //16 colors, 4-bit -// termenv.ANSI256 // 256 colors, 8-bit -// termenv.TrueColor // 16,777,216 colors, 24-bit -// -// This function is thread-safe. -func SetColorProfile(p termenv.Profile) { - renderer.SetColorProfile(p) -} - -// HasDarkBackground returns whether or not the terminal has a dark background. -func HasDarkBackground() bool { - return renderer.HasDarkBackground() -} - -// HasDarkBackground returns whether or not the renderer will render to a dark -// background. A dark background can either be auto-detected, or set explicitly -// on the renderer. -func (r *Renderer) HasDarkBackground() bool { - if r.hasDarkBackground != nil { - return *r.hasDarkBackground - } - return r.output.HasDarkBackground() -} - -// SetHasDarkBackground sets the background color detection value for the -// default renderer. This function exists mostly for testing purposes so that -// you can assure you're testing against a specific background color setting. -// -// Outside of testing you likely won't want to use this function as the -// backgrounds value will be automatically detected and cached against the -// terminal's current background color setting. -// -// This function is thread-safe. -func SetHasDarkBackground(b bool) { - renderer.SetHasDarkBackground(b) -} - -// SetHasDarkBackground sets the background color detection value on the -// renderer. This function exists mostly for testing purposes so that you can -// assure you're testing against a specific background color setting. -// -// Outside of testing you likely won't want to use this function as the -// backgrounds value will be automatically detected and cached against the -// terminal's current background color setting. -// -// This function is thread-safe. -func (r *Renderer) SetHasDarkBackground(b bool) { - r.hasDarkBackground = &b -} diff --git a/vendor/github.com/charmbracelet/lipgloss/runes.go b/vendor/github.com/charmbracelet/lipgloss/runes.go deleted file mode 100644 index 7a49e326cc..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/runes.go +++ /dev/null @@ -1,43 +0,0 @@ -package lipgloss - -import ( - "strings" -) - -// StyleRunes apply a given style to runes at the given indices in the string. -// Note that you must provide styling options for both matched and unmatched -// runes. Indices out of bounds will be ignored. -func StyleRunes(str string, indices []int, matched, unmatched Style) string { - // Convert slice of indices to a map for easier lookups - m := make(map[int]struct{}) - for _, i := range indices { - m[i] = struct{}{} - } - - var ( - out strings.Builder - group strings.Builder - style Style - runes = []rune(str) - ) - - for i, r := range runes { - group.WriteRune(r) - - _, matches := m[i] - _, nextMatches := m[i+1] - - if matches != nextMatches || i == len(runes)-1 { - // Flush - if matches { - style = matched - } else { - style = unmatched - } - out.WriteString(style.Render(group.String())) - group.Reset() - } - } - - return out.String() -} diff --git a/vendor/github.com/charmbracelet/lipgloss/set.go b/vendor/github.com/charmbracelet/lipgloss/set.go deleted file mode 100644 index f8bf9a22d6..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/set.go +++ /dev/null @@ -1,634 +0,0 @@ -package lipgloss - -// This could (should) probably just be moved into NewStyle(). We've broken it -// out, so we can call it in a lazy way. -func (s *Style) init() { - if s.rules == nil { - s.rules = make(rules) - } -} - -// Set a value on the underlying rules map. -func (s *Style) set(key propKey, value interface{}) { - s.init() - - switch v := value.(type) { - case int: - // We don't allow negative integers on any of our values, so just keep - // them at zero or above. We could use uints instead, but the - // conversions are a little tedious, so we're sticking with ints for - // sake of usability. - s.rules[key] = max(0, v) - default: - s.rules[key] = v - } -} - -// Bold sets a bold formatting rule. -func (s Style) Bold(v bool) Style { - s.set(boldKey, v) - return s -} - -// Italic sets an italic formatting rule. In some terminal emulators this will -// render with "reverse" coloring if not italic font variant is available. -func (s Style) Italic(v bool) Style { - s.set(italicKey, v) - return s -} - -// Underline sets an underline rule. By default, underlines will not be drawn on -// whitespace like margins and padding. To change this behavior set -// UnderlineSpaces. -func (s Style) Underline(v bool) Style { - s.set(underlineKey, v) - return s -} - -// Strikethrough sets a strikethrough rule. By default, strikes will not be -// drawn on whitespace like margins and padding. To change this behavior set -// StrikethroughSpaces. -func (s Style) Strikethrough(v bool) Style { - s.set(strikethroughKey, v) - return s -} - -// Reverse sets a rule for inverting foreground and background colors. -func (s Style) Reverse(v bool) Style { - s.set(reverseKey, v) - return s -} - -// Blink sets a rule for blinking foreground text. -func (s Style) Blink(v bool) Style { - s.set(blinkKey, v) - return s -} - -// Faint sets a rule for rendering the foreground color in a dimmer shade. -func (s Style) Faint(v bool) Style { - s.set(faintKey, v) - return s -} - -// Foreground sets a foreground color. -// -// // Sets the foreground to blue -// s := lipgloss.NewStyle().Foreground(lipgloss.Color("#0000ff")) -// -// // Removes the foreground color -// s.Foreground(lipgloss.NoColor) -func (s Style) Foreground(c TerminalColor) Style { - s.set(foregroundKey, c) - return s -} - -// Background sets a background color. -func (s Style) Background(c TerminalColor) Style { - s.set(backgroundKey, c) - return s -} - -// Width sets the width of the block before applying margins. The width, if -// set, also determines where text will wrap. -func (s Style) Width(i int) Style { - s.set(widthKey, i) - return s -} - -// Height sets the height of the block before applying margins. If the height of -// the text block is less than this value after applying padding (or not), the -// block will be set to this height. -func (s Style) Height(i int) Style { - s.set(heightKey, i) - return s -} - -// Align is a shorthand method for setting horizontal and vertical alignment. -// -// With one argument, the position value is applied to the horizontal alignment. -// -// With two arguments, the value is applied to the vertical and horizontal -// alignments, in that order. -func (s Style) Align(p ...Position) Style { - if len(p) > 0 { - s.set(alignHorizontalKey, p[0]) - } - if len(p) > 1 { - s.set(alignVerticalKey, p[1]) - } - return s -} - -// AlignHorizontal sets a horizontal text alignment rule. -func (s Style) AlignHorizontal(p Position) Style { - s.set(alignHorizontalKey, p) - return s -} - -// AlignVertical sets a text alignment rule. -func (s Style) AlignVertical(p Position) Style { - s.set(alignVerticalKey, p) - return s -} - -// Padding is a shorthand method for setting padding on all sides at once. -// -// With one argument, the value is applied to all sides. -// -// With two arguments, the value is applied to the vertical and horizontal -// sides, in that order. -// -// With three arguments, the value is applied to the top side, the horizontal -// sides, and the bottom side, in that order. -// -// With four arguments, the value is applied clockwise starting from the top -// side, followed by the right side, then the bottom, and finally the left. -// -// With more than four arguments no padding will be added. -func (s Style) Padding(i ...int) Style { - top, right, bottom, left, ok := whichSidesInt(i...) - if !ok { - return s - } - - s.set(paddingTopKey, top) - s.set(paddingRightKey, right) - s.set(paddingBottomKey, bottom) - s.set(paddingLeftKey, left) - return s -} - -// PaddingLeft adds padding on the left. -func (s Style) PaddingLeft(i int) Style { - s.set(paddingLeftKey, i) - return s -} - -// PaddingRight adds padding on the right. -func (s Style) PaddingRight(i int) Style { - s.set(paddingRightKey, i) - return s -} - -// PaddingTop adds padding to the top of the block. -func (s Style) PaddingTop(i int) Style { - s.set(paddingTopKey, i) - return s -} - -// PaddingBottom adds padding to the bottom of the block. -func (s Style) PaddingBottom(i int) Style { - s.set(paddingBottomKey, i) - return s -} - -// ColorWhitespace determines whether or not the background color should be -// applied to the padding. This is true by default as it's more than likely the -// desired and expected behavior, but it can be disabled for certain graphic -// effects. -func (s Style) ColorWhitespace(v bool) Style { - s.set(colorWhitespaceKey, v) - return s -} - -// Margin is a shorthand method for setting margins on all sides at once. -// -// With one argument, the value is applied to all sides. -// -// With two arguments, the value is applied to the vertical and horizontal -// sides, in that order. -// -// With three arguments, the value is applied to the top side, the horizontal -// sides, and the bottom side, in that order. -// -// With four arguments, the value is applied clockwise starting from the top -// side, followed by the right side, then the bottom, and finally the left. -// -// With more than four arguments no margin will be added. -func (s Style) Margin(i ...int) Style { - top, right, bottom, left, ok := whichSidesInt(i...) - if !ok { - return s - } - - s.set(marginTopKey, top) - s.set(marginRightKey, right) - s.set(marginBottomKey, bottom) - s.set(marginLeftKey, left) - return s -} - -// MarginLeft sets the value of the left margin. -func (s Style) MarginLeft(i int) Style { - s.set(marginLeftKey, i) - return s -} - -// MarginRight sets the value of the right margin. -func (s Style) MarginRight(i int) Style { - s.set(marginRightKey, i) - return s -} - -// MarginTop sets the value of the top margin. -func (s Style) MarginTop(i int) Style { - s.set(marginTopKey, i) - return s -} - -// MarginBottom sets the value of the bottom margin. -func (s Style) MarginBottom(i int) Style { - s.set(marginBottomKey, i) - return s -} - -// MarginBackground sets the background color of the margin. Note that this is -// also set when inheriting from a style with a background color. In that case -// the background color on that style will set the margin color on this style. -func (s Style) MarginBackground(c TerminalColor) Style { - s.set(marginBackgroundKey, c) - return s -} - -// Border is shorthand for setting the border style and which sides should -// have a border at once. The variadic argument sides works as follows: -// -// With one value, the value is applied to all sides. -// -// With two values, the values are applied to the vertical and horizontal -// sides, in that order. -// -// With three values, the values are applied to the top side, the horizontal -// sides, and the bottom side, in that order. -// -// With four values, the values are applied clockwise starting from the top -// side, followed by the right side, then the bottom, and finally the left. -// -// With more than four arguments the border will be applied to all sides. -// -// Examples: -// -// // Applies borders to the top and bottom only -// lipgloss.NewStyle().Border(lipgloss.NormalBorder(), true, false) -// -// // Applies rounded borders to the right and bottom only -// lipgloss.NewStyle().Border(lipgloss.RoundedBorder(), false, true, true, false) -func (s Style) Border(b Border, sides ...bool) Style { - s.set(borderStyleKey, b) - - top, right, bottom, left, ok := whichSidesBool(sides...) - if !ok { - top = true - right = true - bottom = true - left = true - } - - s.set(borderTopKey, top) - s.set(borderRightKey, right) - s.set(borderBottomKey, bottom) - s.set(borderLeftKey, left) - - return s -} - -// BorderStyle defines the Border on a style. A Border contains a series of -// definitions for the sides and corners of a border. -// -// Note that if border visibility has not been set for any sides when setting -// the border style, the border will be enabled for all sides during rendering. -// -// You can define border characters as you'd like, though several default -// styles are included: NormalBorder(), RoundedBorder(), BlockBorder(), -// OuterHalfBlockBorder(), InnerHalfBlockBorder(), ThickBorder(), -// and DoubleBorder(). -// -// Example: -// -// lipgloss.NewStyle().BorderStyle(lipgloss.ThickBorder()) -func (s Style) BorderStyle(b Border) Style { - s.set(borderStyleKey, b) - return s -} - -// BorderTop determines whether or not to draw a top border. -func (s Style) BorderTop(v bool) Style { - s.set(borderTopKey, v) - return s -} - -// BorderRight determines whether or not to draw a right border. -func (s Style) BorderRight(v bool) Style { - s.set(borderRightKey, v) - return s -} - -// BorderBottom determines whether or not to draw a bottom border. -func (s Style) BorderBottom(v bool) Style { - s.set(borderBottomKey, v) - return s -} - -// BorderLeft determines whether or not to draw a left border. -func (s Style) BorderLeft(v bool) Style { - s.set(borderLeftKey, v) - return s -} - -// BorderForeground is a shorthand function for setting all of the -// foreground colors of the borders at once. The arguments work as follows: -// -// With one argument, the argument is applied to all sides. -// -// With two arguments, the arguments are applied to the vertical and horizontal -// sides, in that order. -// -// With three arguments, the arguments are applied to the top side, the -// horizontal sides, and the bottom side, in that order. -// -// With four arguments, the arguments are applied clockwise starting from the -// top side, followed by the right side, then the bottom, and finally the left. -// -// With more than four arguments nothing will be set. -func (s Style) BorderForeground(c ...TerminalColor) Style { - if len(c) == 0 { - return s - } - - top, right, bottom, left, ok := whichSidesColor(c...) - if !ok { - return s - } - - s.set(borderTopForegroundKey, top) - s.set(borderRightForegroundKey, right) - s.set(borderBottomForegroundKey, bottom) - s.set(borderLeftForegroundKey, left) - - return s -} - -// BorderTopForeground set the foreground color for the top of the border. -func (s Style) BorderTopForeground(c TerminalColor) Style { - s.set(borderTopForegroundKey, c) - return s -} - -// BorderRightForeground sets the foreground color for the right side of the -// border. -func (s Style) BorderRightForeground(c TerminalColor) Style { - s.set(borderRightForegroundKey, c) - return s -} - -// BorderBottomForeground sets the foreground color for the bottom of the -// border. -func (s Style) BorderBottomForeground(c TerminalColor) Style { - s.set(borderBottomForegroundKey, c) - return s -} - -// BorderLeftForeground sets the foreground color for the left side of the -// border. -func (s Style) BorderLeftForeground(c TerminalColor) Style { - s.set(borderLeftForegroundKey, c) - return s -} - -// BorderBackground is a shorthand function for setting all of the -// background colors of the borders at once. The arguments work as follows: -// -// With one argument, the argument is applied to all sides. -// -// With two arguments, the arguments are applied to the vertical and horizontal -// sides, in that order. -// -// With three arguments, the arguments are applied to the top side, the -// horizontal sides, and the bottom side, in that order. -// -// With four arguments, the arguments are applied clockwise starting from the -// top side, followed by the right side, then the bottom, and finally the left. -// -// With more than four arguments nothing will be set. -func (s Style) BorderBackground(c ...TerminalColor) Style { - if len(c) == 0 { - return s - } - - top, right, bottom, left, ok := whichSidesColor(c...) - if !ok { - return s - } - - s.set(borderTopBackgroundKey, top) - s.set(borderRightBackgroundKey, right) - s.set(borderBottomBackgroundKey, bottom) - s.set(borderLeftBackgroundKey, left) - - return s -} - -// BorderTopBackground sets the background color of the top of the border. -func (s Style) BorderTopBackground(c TerminalColor) Style { - s.set(borderTopBackgroundKey, c) - return s -} - -// BorderRightBackground sets the background color of right side the border. -func (s Style) BorderRightBackground(c TerminalColor) Style { - s.set(borderRightBackgroundKey, c) - return s -} - -// BorderBottomBackground sets the background color of the bottom of the -// border. -func (s Style) BorderBottomBackground(c TerminalColor) Style { - s.set(borderBottomBackgroundKey, c) - return s -} - -// BorderLeftBackground set the background color of the left side of the -// border. -func (s Style) BorderLeftBackground(c TerminalColor) Style { - s.set(borderLeftBackgroundKey, c) - return s -} - -// Inline makes rendering output one line and disables the rendering of -// margins, padding and borders. This is useful when you need a style to apply -// only to font rendering and don't want it to change any physical dimensions. -// It works well with Style.MaxWidth. -// -// Because this in intended to be used at the time of render, this method will -// not mutate the style and instead return a copy. -// -// Example: -// -// var userInput string = "..." -// var userStyle = text.Style{ /* ... */ } -// fmt.Println(userStyle.Inline(true).Render(userInput)) -func (s Style) Inline(v bool) Style { - o := s.Copy() - o.set(inlineKey, v) - return o -} - -// MaxWidth applies a max width to a given style. This is useful in enforcing -// a certain width at render time, particularly with arbitrary strings and -// styles. -// -// Because this in intended to be used at the time of render, this method will -// not mutate the style and instead return a copy. -// -// Example: -// -// var userInput string = "..." -// var userStyle = text.Style{ /* ... */ } -// fmt.Println(userStyle.MaxWidth(16).Render(userInput)) -func (s Style) MaxWidth(n int) Style { - o := s.Copy() - o.set(maxWidthKey, n) - return o -} - -// MaxHeight applies a max height to a given style. This is useful in enforcing -// a certain height at render time, particularly with arbitrary strings and -// styles. -// -// Because this in intended to be used at the time of render, this method will -// not mutate the style and instead return a copy. -func (s Style) MaxHeight(n int) Style { - o := s.Copy() - o.set(maxHeightKey, n) - return o -} - -// UnderlineSpaces determines whether to underline spaces between words. By -// default, this is true. Spaces can also be underlined without underlining the -// text itself. -func (s Style) UnderlineSpaces(v bool) Style { - s.set(underlineSpacesKey, v) - return s -} - -// StrikethroughSpaces determines whether to apply strikethroughs to spaces -// between words. By default, this is true. Spaces can also be struck without -// underlining the text itself. -func (s Style) StrikethroughSpaces(v bool) Style { - s.set(strikethroughSpacesKey, v) - return s -} - -// Renderer sets the renderer for the style. This is useful for changing the -// renderer for a style that is being used in a different context. -func (s Style) Renderer(r *Renderer) Style { - s.r = r - return s -} - -// whichSidesInt is a helper method for setting values on sides of a block based -// on the number of arguments. It follows the CSS shorthand rules for blocks -// like margin, padding. and borders. Here are how the rules work: -// -// 0 args: do nothing -// 1 arg: all sides -// 2 args: top -> bottom -// 3 args: top -> horizontal -> bottom -// 4 args: top -> right -> bottom -> left -// 5+ args: do nothing. -func whichSidesInt(i ...int) (top, right, bottom, left int, ok bool) { - switch len(i) { - case 1: - top = i[0] - bottom = i[0] - left = i[0] - right = i[0] - ok = true - case 2: - top = i[0] - bottom = i[0] - left = i[1] - right = i[1] - ok = true - case 3: - top = i[0] - left = i[1] - right = i[1] - bottom = i[2] - ok = true - case 4: - top = i[0] - right = i[1] - bottom = i[2] - left = i[3] - ok = true - } - return top, right, bottom, left, ok -} - -// whichSidesBool is like whichSidesInt, except it operates on a series of -// boolean values. See the comment on whichSidesInt for details on how this -// works. -func whichSidesBool(i ...bool) (top, right, bottom, left bool, ok bool) { - switch len(i) { - case 1: - top = i[0] - bottom = i[0] - left = i[0] - right = i[0] - ok = true - case 2: - top = i[0] - bottom = i[0] - left = i[1] - right = i[1] - ok = true - case 3: - top = i[0] - left = i[1] - right = i[1] - bottom = i[2] - ok = true - case 4: - top = i[0] - right = i[1] - bottom = i[2] - left = i[3] - ok = true - } - return top, right, bottom, left, ok -} - -// whichSidesColor is like whichSides, except it operates on a series of -// boolean values. See the comment on whichSidesInt for details on how this -// works. -func whichSidesColor(i ...TerminalColor) (top, right, bottom, left TerminalColor, ok bool) { - switch len(i) { - case 1: - top = i[0] - bottom = i[0] - left = i[0] - right = i[0] - ok = true - case 2: - top = i[0] - bottom = i[0] - left = i[1] - right = i[1] - ok = true - case 3: - top = i[0] - left = i[1] - right = i[1] - bottom = i[2] - ok = true - case 4: - top = i[0] - right = i[1] - bottom = i[2] - left = i[3] - ok = true - } - return top, right, bottom, left, ok -} diff --git a/vendor/github.com/charmbracelet/lipgloss/size.go b/vendor/github.com/charmbracelet/lipgloss/size.go deleted file mode 100644 index 439a5cb892..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/size.go +++ /dev/null @@ -1,41 +0,0 @@ -package lipgloss - -import ( - "strings" - - "github.com/muesli/reflow/ansi" -) - -// Width returns the cell width of characters in the string. ANSI sequences are -// ignored and characters wider than one cell (such as Chinese characters and -// emojis) are appropriately measured. -// -// You should use this instead of len(string) len([]rune(string) as neither -// will give you accurate results. -func Width(str string) (width int) { - for _, l := range strings.Split(str, "\n") { - w := ansi.PrintableRuneWidth(l) - if w > width { - width = w - } - } - - return width -} - -// Height returns height of a string in cells. This is done simply by -// counting \n characters. If your strings use \r\n for newlines you should -// convert them to \n first, or simply write a separate function for measuring -// height. -func Height(str string) int { - return strings.Count(str, "\n") + 1 -} - -// Size returns the width and height of the string in cells. ANSI sequences are -// ignored and characters wider than one cell (such as Chinese characters and -// emojis) are appropriately measured. -func Size(str string) (width, height int) { - width = Width(str) - height = Height(str) - return width, height -} diff --git a/vendor/github.com/charmbracelet/lipgloss/style.go b/vendor/github.com/charmbracelet/lipgloss/style.go deleted file mode 100644 index e94b86702d..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/style.go +++ /dev/null @@ -1,497 +0,0 @@ -package lipgloss - -import ( - "strings" - "unicode" - - "github.com/muesli/reflow/truncate" - "github.com/muesli/reflow/wordwrap" - "github.com/muesli/reflow/wrap" - "github.com/muesli/termenv" -) - -// Property for a key. -type propKey int - -// Available properties. -const ( - boldKey propKey = iota - italicKey - underlineKey - strikethroughKey - reverseKey - blinkKey - faintKey - foregroundKey - backgroundKey - widthKey - heightKey - alignHorizontalKey - alignVerticalKey - - // Padding. - paddingTopKey - paddingRightKey - paddingBottomKey - paddingLeftKey - - colorWhitespaceKey - - // Margins. - marginTopKey - marginRightKey - marginBottomKey - marginLeftKey - marginBackgroundKey - - // Border runes. - borderStyleKey - - // Border edges. - borderTopKey - borderRightKey - borderBottomKey - borderLeftKey - - // Border foreground colors. - borderTopForegroundKey - borderRightForegroundKey - borderBottomForegroundKey - borderLeftForegroundKey - - // Border background colors. - borderTopBackgroundKey - borderRightBackgroundKey - borderBottomBackgroundKey - borderLeftBackgroundKey - - inlineKey - maxWidthKey - maxHeightKey - underlineSpacesKey - strikethroughSpacesKey -) - -// A set of properties. -type rules map[propKey]interface{} - -// NewStyle returns a new, empty Style. While it's syntactic sugar for the -// Style{} primitive, it's recommended to use this function for creating styles -// in case the underlying implementation changes. It takes an optional string -// value to be set as the underlying string value for this style. -func NewStyle() Style { - return renderer.NewStyle() -} - -// NewStyle returns a new, empty Style. While it's syntactic sugar for the -// Style{} primitive, it's recommended to use this function for creating styles -// in case the underlying implementation changes. It takes an optional string -// value to be set as the underlying string value for this style. -func (r *Renderer) NewStyle() Style { - s := Style{r: r} - return s -} - -// Style contains a set of rules that comprise a style as a whole. -type Style struct { - r *Renderer - rules map[propKey]interface{} - value string -} - -// joinString joins a list of strings into a single string separated with a -// space. -func joinString(strs ...string) string { - return strings.Join(strs, " ") -} - -// SetString sets the underlying string value for this style. To render once -// the underlying string is set, use the Style.String. This method is -// a convenience for cases when having a stringer implementation is handy, such -// as when using fmt.Sprintf. You can also simply define a style and render out -// strings directly with Style.Render. -func (s Style) SetString(strs ...string) Style { - s.value = joinString(strs...) - return s -} - -// Value returns the raw, unformatted, underlying string value for this style. -func (s Style) Value() string { - return s.value -} - -// String implements stringer for a Style, returning the rendered result based -// on the rules in this style. An underlying string value must be set with -// Style.SetString prior to using this method. -func (s Style) String() string { - return s.Render() -} - -// Copy returns a copy of this style, including any underlying string values. -func (s Style) Copy() Style { - o := NewStyle() - o.init() - for k, v := range s.rules { - o.rules[k] = v - } - o.r = s.r - o.value = s.value - return o -} - -// Inherit overlays the style in the argument onto this style by copying each explicitly -// set value from the argument style onto this style if it is not already explicitly set. -// Existing set values are kept intact and not overwritten. -// -// Margins, padding, and underlying string values are not inherited. -func (s Style) Inherit(i Style) Style { - s.init() - - for k, v := range i.rules { - switch k { - case marginTopKey, marginRightKey, marginBottomKey, marginLeftKey: - // Margins are not inherited - continue - case paddingTopKey, paddingRightKey, paddingBottomKey, paddingLeftKey: - // Padding is not inherited - continue - case backgroundKey: - // The margins also inherit the background color - if !s.isSet(marginBackgroundKey) && !i.isSet(marginBackgroundKey) { - s.rules[marginBackgroundKey] = v - } - } - - if _, exists := s.rules[k]; exists { - continue - } - s.rules[k] = v - } - return s -} - -// Render applies the defined style formatting to a given string. -func (s Style) Render(strs ...string) string { - if s.r == nil { - s.r = renderer - } - if s.value != "" { - strs = append([]string{s.value}, strs...) - } - - var ( - str = joinString(strs...) - - te = s.r.ColorProfile().String() - teSpace = s.r.ColorProfile().String() - teWhitespace = s.r.ColorProfile().String() - - bold = s.getAsBool(boldKey, false) - italic = s.getAsBool(italicKey, false) - underline = s.getAsBool(underlineKey, false) - strikethrough = s.getAsBool(strikethroughKey, false) - reverse = s.getAsBool(reverseKey, false) - blink = s.getAsBool(blinkKey, false) - faint = s.getAsBool(faintKey, false) - - fg = s.getAsColor(foregroundKey) - bg = s.getAsColor(backgroundKey) - - width = s.getAsInt(widthKey) - height = s.getAsInt(heightKey) - horizontalAlign = s.getAsPosition(alignHorizontalKey) - verticalAlign = s.getAsPosition(alignVerticalKey) - - topPadding = s.getAsInt(paddingTopKey) - rightPadding = s.getAsInt(paddingRightKey) - bottomPadding = s.getAsInt(paddingBottomKey) - leftPadding = s.getAsInt(paddingLeftKey) - - colorWhitespace = s.getAsBool(colorWhitespaceKey, true) - inline = s.getAsBool(inlineKey, false) - maxWidth = s.getAsInt(maxWidthKey) - maxHeight = s.getAsInt(maxHeightKey) - - underlineSpaces = underline && s.getAsBool(underlineSpacesKey, true) - strikethroughSpaces = strikethrough && s.getAsBool(strikethroughSpacesKey, true) - - // Do we need to style whitespace (padding and space outside - // paragraphs) separately? - styleWhitespace = reverse - - // Do we need to style spaces separately? - useSpaceStyler = underlineSpaces || strikethroughSpaces - ) - - if len(s.rules) == 0 { - return str - } - - // Enable support for ANSI on the legacy Windows cmd.exe console. This is a - // no-op on non-Windows systems and on Windows runs only once. - enableLegacyWindowsANSI() - - if bold { - te = te.Bold() - } - if italic { - te = te.Italic() - } - if underline { - te = te.Underline() - } - if reverse { - if reverse { - teWhitespace = teWhitespace.Reverse() - } - te = te.Reverse() - } - if blink { - te = te.Blink() - } - if faint { - te = te.Faint() - } - - if fg != noColor { - te = te.Foreground(fg.color(s.r)) - if styleWhitespace { - teWhitespace = teWhitespace.Foreground(fg.color(s.r)) - } - if useSpaceStyler { - teSpace = teSpace.Foreground(fg.color(s.r)) - } - } - - if bg != noColor { - te = te.Background(bg.color(s.r)) - if colorWhitespace { - teWhitespace = teWhitespace.Background(bg.color(s.r)) - } - if useSpaceStyler { - teSpace = teSpace.Background(bg.color(s.r)) - } - } - - if underline { - te = te.Underline() - } - if strikethrough { - te = te.CrossOut() - } - - if underlineSpaces { - teSpace = teSpace.Underline() - } - if strikethroughSpaces { - teSpace = teSpace.CrossOut() - } - - // Strip newlines in single line mode - if inline { - str = strings.ReplaceAll(str, "\n", "") - } - - // Word wrap - if !inline && width > 0 { - wrapAt := width - leftPadding - rightPadding - str = wordwrap.String(str, wrapAt) - str = wrap.String(str, wrapAt) // force-wrap long strings - } - - // Render core text - { - var b strings.Builder - - l := strings.Split(str, "\n") - for i := range l { - if useSpaceStyler { - // Look for spaces and apply a different styler - for _, r := range l[i] { - if unicode.IsSpace(r) { - b.WriteString(teSpace.Styled(string(r))) - continue - } - b.WriteString(te.Styled(string(r))) - } - } else { - b.WriteString(te.Styled(l[i])) - } - if i != len(l)-1 { - b.WriteRune('\n') - } - } - - str = b.String() - } - - // Padding - if !inline { - if leftPadding > 0 { - var st *termenv.Style - if colorWhitespace || styleWhitespace { - st = &teWhitespace - } - str = padLeft(str, leftPadding, st) - } - - if rightPadding > 0 { - var st *termenv.Style - if colorWhitespace || styleWhitespace { - st = &teWhitespace - } - str = padRight(str, rightPadding, st) - } - - if topPadding > 0 { - str = strings.Repeat("\n", topPadding) + str - } - - if bottomPadding > 0 { - str += strings.Repeat("\n", bottomPadding) - } - } - - // Height - if height > 0 { - str = alignTextVertical(str, verticalAlign, height, nil) - } - - // Set alignment. This will also pad short lines with spaces so that all - // lines are the same length, so we run it under a few different conditions - // beyond alignment. - { - numLines := strings.Count(str, "\n") - - if !(numLines == 0 && width == 0) { - var st *termenv.Style - if colorWhitespace || styleWhitespace { - st = &teWhitespace - } - str = alignTextHorizontal(str, horizontalAlign, width, st) - } - } - - if !inline { - str = s.applyBorder(str) - str = s.applyMargins(str, inline) - } - - // Truncate according to MaxWidth - if maxWidth > 0 { - lines := strings.Split(str, "\n") - - for i := range lines { - lines[i] = truncate.String(lines[i], uint(maxWidth)) - } - - str = strings.Join(lines, "\n") - } - - // Truncate according to MaxHeight - if maxHeight > 0 { - lines := strings.Split(str, "\n") - str = strings.Join(lines[:min(maxHeight, len(lines))], "\n") - } - - return str -} - -func (s Style) applyMargins(str string, inline bool) string { - var ( - topMargin = s.getAsInt(marginTopKey) - rightMargin = s.getAsInt(marginRightKey) - bottomMargin = s.getAsInt(marginBottomKey) - leftMargin = s.getAsInt(marginLeftKey) - - styler termenv.Style - ) - - bgc := s.getAsColor(marginBackgroundKey) - if bgc != noColor { - styler = styler.Background(bgc.color(s.r)) - } - - // Add left and right margin - str = padLeft(str, leftMargin, &styler) - str = padRight(str, rightMargin, &styler) - - // Top/bottom margin - if !inline { - _, width := getLines(str) - spaces := strings.Repeat(" ", width) - - if topMargin > 0 { - str = styler.Styled(strings.Repeat(spaces+"\n", topMargin)) + str - } - if bottomMargin > 0 { - str += styler.Styled(strings.Repeat("\n"+spaces, bottomMargin)) - } - } - - return str -} - -// Apply left padding. -func padLeft(str string, n int, style *termenv.Style) string { - if n == 0 { - return str - } - - sp := strings.Repeat(" ", n) - if style != nil { - sp = style.Styled(sp) - } - - b := strings.Builder{} - l := strings.Split(str, "\n") - - for i := range l { - b.WriteString(sp) - b.WriteString(l[i]) - if i != len(l)-1 { - b.WriteRune('\n') - } - } - - return b.String() -} - -// Apply right padding. -func padRight(str string, n int, style *termenv.Style) string { - if n == 0 || str == "" { - return str - } - - sp := strings.Repeat(" ", n) - if style != nil { - sp = style.Styled(sp) - } - - b := strings.Builder{} - l := strings.Split(str, "\n") - - for i := range l { - b.WriteString(l[i]) - b.WriteString(sp) - if i != len(l)-1 { - b.WriteRune('\n') - } - } - - return b.String() -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/vendor/github.com/charmbracelet/lipgloss/unset.go b/vendor/github.com/charmbracelet/lipgloss/unset.go deleted file mode 100644 index a8367898b8..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/unset.go +++ /dev/null @@ -1,306 +0,0 @@ -package lipgloss - -// UnsetBold removes the bold style rule, if set. -func (s Style) UnsetBold() Style { - delete(s.rules, boldKey) - return s -} - -// UnsetItalic removes the italic style rule, if set. -func (s Style) UnsetItalic() Style { - delete(s.rules, italicKey) - return s -} - -// UnsetUnderline removes the underline style rule, if set. -func (s Style) UnsetUnderline() Style { - delete(s.rules, underlineKey) - return s -} - -// UnsetStrikethrough removes the strikethrough style rule, if set. -func (s Style) UnsetStrikethrough() Style { - delete(s.rules, strikethroughKey) - return s -} - -// UnsetReverse removes the reverse style rule, if set. -func (s Style) UnsetReverse() Style { - delete(s.rules, reverseKey) - return s -} - -// UnsetBlink removes the bold style rule, if set. -func (s Style) UnsetBlink() Style { - delete(s.rules, blinkKey) - return s -} - -// UnsetFaint removes the faint style rule, if set. -func (s Style) UnsetFaint() Style { - delete(s.rules, faintKey) - return s -} - -// UnsetForeground removes the foreground style rule, if set. -func (s Style) UnsetForeground() Style { - delete(s.rules, foregroundKey) - return s -} - -// UnsetBackground removes the background style rule, if set. -func (s Style) UnsetBackground() Style { - delete(s.rules, backgroundKey) - return s -} - -// UnsetWidth removes the width style rule, if set. -func (s Style) UnsetWidth() Style { - delete(s.rules, widthKey) - return s -} - -// UnsetHeight removes the height style rule, if set. -func (s Style) UnsetHeight() Style { - delete(s.rules, heightKey) - return s -} - -// UnsetAlign removes the horizontal and vertical text alignment style rule, if set. -func (s Style) UnsetAlign() Style { - delete(s.rules, alignHorizontalKey) - delete(s.rules, alignVerticalKey) - return s -} - -// UnsetAlignHorizontal removes the horizontal text alignment style rule, if set. -func (s Style) UnsetAlignHorizontal() Style { - delete(s.rules, alignHorizontalKey) - return s -} - -// UnsetAlignVertical removes the vertical text alignment style rule, if set. -func (s Style) UnsetAlignVertical() Style { - delete(s.rules, alignVerticalKey) - return s -} - -// UnsetPadding removes all padding style rules. -func (s Style) UnsetPadding() Style { - delete(s.rules, paddingLeftKey) - delete(s.rules, paddingRightKey) - delete(s.rules, paddingTopKey) - delete(s.rules, paddingBottomKey) - return s -} - -// UnsetPaddingLeft removes the left padding style rule, if set. -func (s Style) UnsetPaddingLeft() Style { - delete(s.rules, paddingLeftKey) - return s -} - -// UnsetPaddingRight removes the right padding style rule, if set. -func (s Style) UnsetPaddingRight() Style { - delete(s.rules, paddingRightKey) - return s -} - -// UnsetPaddingTop removes the top padding style rule, if set. -func (s Style) UnsetPaddingTop() Style { - delete(s.rules, paddingTopKey) - return s -} - -// UnsetPaddingBottom removes the bottom style rule, if set. -func (s Style) UnsetPaddingBottom() Style { - delete(s.rules, paddingBottomKey) - return s -} - -// UnsetColorWhitespace removes the rule for coloring padding, if set. -func (s Style) UnsetColorWhitespace() Style { - delete(s.rules, colorWhitespaceKey) - return s -} - -// UnsetMargins removes all margin style rules. -func (s Style) UnsetMargins() Style { - delete(s.rules, marginLeftKey) - delete(s.rules, marginRightKey) - delete(s.rules, marginTopKey) - delete(s.rules, marginBottomKey) - return s -} - -// UnsetMarginLeft removes the left margin style rule, if set. -func (s Style) UnsetMarginLeft() Style { - delete(s.rules, marginLeftKey) - return s -} - -// UnsetMarginRight removes the right margin style rule, if set. -func (s Style) UnsetMarginRight() Style { - delete(s.rules, marginRightKey) - return s -} - -// UnsetMarginTop removes the top margin style rule, if set. -func (s Style) UnsetMarginTop() Style { - delete(s.rules, marginTopKey) - return s -} - -// UnsetMarginBottom removes the bottom margin style rule, if set. -func (s Style) UnsetMarginBottom() Style { - delete(s.rules, marginBottomKey) - return s -} - -// UnsetMarginBackground removes the margin's background color. Note that the -// margin's background color can be set from the background color of another -// style during inheritance. -func (s Style) UnsetMarginBackground() Style { - delete(s.rules, marginBackgroundKey) - return s -} - -// UnsetBorderStyle removes the border style rule, if set. -func (s Style) UnsetBorderStyle() Style { - delete(s.rules, borderStyleKey) - return s -} - -// UnsetBorderTop removes the border top style rule, if set. -func (s Style) UnsetBorderTop() Style { - delete(s.rules, borderTopKey) - return s -} - -// UnsetBorderRight removes the border right style rule, if set. -func (s Style) UnsetBorderRight() Style { - delete(s.rules, borderRightKey) - return s -} - -// UnsetBorderBottom removes the border bottom style rule, if set. -func (s Style) UnsetBorderBottom() Style { - delete(s.rules, borderBottomKey) - return s -} - -// UnsetBorderLeft removes the border left style rule, if set. -func (s Style) UnsetBorderLeft() Style { - delete(s.rules, borderLeftKey) - return s -} - -// UnsetBorderForeground removes all border foreground color styles, if set. -func (s Style) UnsetBorderForeground() Style { - delete(s.rules, borderTopForegroundKey) - delete(s.rules, borderRightForegroundKey) - delete(s.rules, borderBottomForegroundKey) - delete(s.rules, borderLeftForegroundKey) - return s -} - -// UnsetBorderTopForeground removes the top border foreground color rule, -// if set. -func (s Style) UnsetBorderTopForeground() Style { - delete(s.rules, borderTopForegroundKey) - return s -} - -// UnsetBorderRightForeground removes the right border foreground color rule, -// if set. -func (s Style) UnsetBorderRightForeground() Style { - delete(s.rules, borderRightForegroundKey) - return s -} - -// UnsetBorderBottomForeground removes the bottom border foreground color -// rule, if set. -func (s Style) UnsetBorderBottomForeground() Style { - delete(s.rules, borderBottomForegroundKey) - return s -} - -// UnsetBorderLeftForeground removes the left border foreground color rule, -// if set. -func (s Style) UnsetBorderLeftForeground() Style { - delete(s.rules, borderLeftForegroundKey) - return s -} - -// UnsetBorderBackground removes all border background color styles, if -// set. -func (s Style) UnsetBorderBackground() Style { - delete(s.rules, borderTopBackgroundKey) - delete(s.rules, borderRightBackgroundKey) - delete(s.rules, borderBottomBackgroundKey) - delete(s.rules, borderLeftBackgroundKey) - return s -} - -// UnsetBorderTopBackgroundColor removes the top border background color rule, -// if set. -func (s Style) UnsetBorderTopBackgroundColor() Style { - delete(s.rules, borderTopBackgroundKey) - return s -} - -// UnsetBorderRightBackground removes the right border background color -// rule, if set. -func (s Style) UnsetBorderRightBackground() Style { - delete(s.rules, borderRightBackgroundKey) - return s -} - -// UnsetBorderBottomBackground removes the bottom border background color -// rule, if set. -func (s Style) UnsetBorderBottomBackground() Style { - delete(s.rules, borderBottomBackgroundKey) - return s -} - -// UnsetBorderLeftBackground removes the left border color rule, if set. -func (s Style) UnsetBorderLeftBackground() Style { - delete(s.rules, borderLeftBackgroundKey) - return s -} - -// UnsetInline removes the inline style rule, if set. -func (s Style) UnsetInline() Style { - delete(s.rules, inlineKey) - return s -} - -// UnsetMaxWidth removes the max width style rule, if set. -func (s Style) UnsetMaxWidth() Style { - delete(s.rules, maxWidthKey) - return s -} - -// UnsetMaxHeight removes the max height style rule, if set. -func (s Style) UnsetMaxHeight() Style { - delete(s.rules, maxHeightKey) - return s -} - -// UnsetUnderlineSpaces removes the value set by UnderlineSpaces. -func (s Style) UnsetUnderlineSpaces() Style { - delete(s.rules, underlineSpacesKey) - return s -} - -// UnsetStrikethroughSpaces removes the value set by StrikethroughSpaces. -func (s Style) UnsetStrikethroughSpaces() Style { - delete(s.rules, strikethroughSpacesKey) - return s -} - -// UnsetString sets the underlying string value to the empty string. -func (s Style) UnsetString() Style { - s.value = "" - return s -} diff --git a/vendor/github.com/charmbracelet/lipgloss/whitespace.go b/vendor/github.com/charmbracelet/lipgloss/whitespace.go deleted file mode 100644 index b043e5652f..0000000000 --- a/vendor/github.com/charmbracelet/lipgloss/whitespace.go +++ /dev/null @@ -1,83 +0,0 @@ -package lipgloss - -import ( - "strings" - - "github.com/muesli/reflow/ansi" - "github.com/muesli/termenv" -) - -// whitespace is a whitespace renderer. -type whitespace struct { - re *Renderer - style termenv.Style - chars string -} - -// newWhitespace creates a new whitespace renderer. The order of the options -// matters, it you'r using WithWhitespaceRenderer, make sure it comes first as -// other options might depend on it. -func newWhitespace(r *Renderer, opts ...WhitespaceOption) *whitespace { - w := &whitespace{ - re: r, - style: r.ColorProfile().String(), - } - for _, opt := range opts { - opt(w) - } - return w -} - -// Render whitespaces. -func (w whitespace) render(width int) string { - if w.chars == "" { - w.chars = " " - } - - r := []rune(w.chars) - j := 0 - b := strings.Builder{} - - // Cycle through runes and print them into the whitespace. - for i := 0; i < width; { - b.WriteRune(r[j]) - j++ - if j >= len(r) { - j = 0 - } - i += ansi.PrintableRuneWidth(string(r[j])) - } - - // Fill any extra gaps white spaces. This might be necessary if any runes - // are more than one cell wide, which could leave a one-rune gap. - short := width - ansi.PrintableRuneWidth(b.String()) - if short > 0 { - b.WriteString(strings.Repeat(" ", short)) - } - - return w.style.Styled(b.String()) -} - -// WhitespaceOption sets a styling rule for rendering whitespace. -type WhitespaceOption func(*whitespace) - -// WithWhitespaceForeground sets the color of the characters in the whitespace. -func WithWhitespaceForeground(c TerminalColor) WhitespaceOption { - return func(w *whitespace) { - w.style = w.style.Foreground(c.color(w.re)) - } -} - -// WithWhitespaceBackground sets the background color of the whitespace. -func WithWhitespaceBackground(c TerminalColor) WhitespaceOption { - return func(w *whitespace) { - w.style = w.style.Background(c.color(w.re)) - } -} - -// WithWhitespaceChars sets the characters to be rendered in the whitespace. -func WithWhitespaceChars(s string) WhitespaceOption { - return func(w *whitespace) { - w.chars = s - } -} diff --git a/vendor/github.com/chavacava/garif/.gitignore b/vendor/github.com/chavacava/garif/.gitignore deleted file mode 100644 index 5dee1052c2..0000000000 --- a/vendor/github.com/chavacava/garif/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.test -*.out -.devcontainer/ \ No newline at end of file diff --git a/vendor/github.com/chavacava/garif/LICENSE b/vendor/github.com/chavacava/garif/LICENSE deleted file mode 100644 index 2bba73fb78..0000000000 --- a/vendor/github.com/chavacava/garif/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Salvador Cavadini - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/chavacava/garif/README.md b/vendor/github.com/chavacava/garif/README.md deleted file mode 100644 index 6a19c61473..0000000000 --- a/vendor/github.com/chavacava/garif/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# garif - -A GO package to create and manipulate SARIF logs. - -SARIF, from _Static Analysis Results Interchange Format_, is a standard JSON-based format for the output of static analysis tools defined and promoted by [OASIS](https://www.oasis-open.org/). - -Current supported version of the standard is [SARIF-v2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/csprd01/sarif-v2.1.0-csprd01.html -). - -## Usage - -The package provides access to every element of the SARIF model, therefore you are free to manipulate it at every detail. - -The package also provides constructors functions (`New...`) and decorators methods (`With...`) that simplify the creation of SARIF files for common use cases. - -Using these constructors and decorators we can easily create the example SARIF file of the [Microsoft SARIF pages](https://github.com/microsoft/sarif-tutorials/blob/master/docs/1-Introduction.md) - - -```go -import to `github.com/chavacava/garif` - -// ... - -rule := garif.NewRule("no-unused-vars"). - WithHelpUri("https://eslint.org/docs/rules/no-unused-vars"). - WithShortDescription("disallow unused variables"). - WithProperties("category", "Variables") - -driver := garif.NewDriver("ESLint"). - WithInformationUri("https://eslint.org"). - WithRules(rule) - -run := garif.NewRun(NewTool(driver)). - WithArtifactsURIs("file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js") - -run.WithResult(rule.Id, "'x' is assigned a value but never used.", "file:///C:/dev/sarif/sarif-tutorials/samples/Introduction/simple-example.js", 1, 5) - -logFile := garif.NewLogFile([]*Run{run}, Version210) - -logFile.Write(os.Stdout) -``` - -## Why this package? -This package was initiated during my works on adding to [`revive`](https://github.com/mgechev/revive) a SARIF output formatter. -I've tried to use [go-sarif](https://github.com/owenrumney/go-sarif) by [Owen Rumney](https://github.com/owenrumney) but it is too focused in the use case of the static analyzer [tfsec](https://tfsec.dev) so I've decided to create a package flexible enough to generate SARIF files in broader cases. - -## More information about SARIF -For more information about SARIF, you can visit the [Oasis Open](https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=sarif) site. - - -## Contributing -Of course, contributions are welcome! \ No newline at end of file diff --git a/vendor/github.com/chavacava/garif/constructors.go b/vendor/github.com/chavacava/garif/constructors.go deleted file mode 100644 index 8910e396e9..0000000000 --- a/vendor/github.com/chavacava/garif/constructors.go +++ /dev/null @@ -1,338 +0,0 @@ -package garif - -// NewAddress creates a valid Address -func NewAddress() *Address { - return &Address{} -} - -// NewArtifact creates a valid Artifact -func NewArtifact() *Artifact { - return &Artifact{} -} - -// NewArtifactChange creates a valid ArtifactChange -func NewArtifactChange(location *ArtifactLocation, replacements ...*Replacement) *ArtifactChange { - return &ArtifactChange{ - ArtifactLocation: location, - Replacements: replacements, - } -} - -// NewArtifactContent creates a valid ArtifactContent -func NewArtifactContent() *ArtifactContent { - return &ArtifactContent{} -} - -// NewArtifactLocation creates a valid ArtifactLocation -func NewArtifactLocation() *ArtifactLocation { - return &ArtifactLocation{} -} - -// NewAttachment creates a valid Attachment -func NewAttachment(location *ArtifactLocation) *Attachment { - return &Attachment{ArtifactLocation: location} -} - -// NewCodeFlow creates a valid CodeFlow -func NewCodeFlow(threadFlows ...*ThreadFlow) *CodeFlow { - return &CodeFlow{ThreadFlows: threadFlows} -} - -// NewConfigurationOverride creates a valid ConfigurationOverride -func NewConfigurationOverride(configuration *ReportingConfiguration, descriptor *ReportingDescriptorReference) *ConfigurationOverride { - return &ConfigurationOverride{ - Configuration: configuration, - Descriptor: descriptor, - } -} - -// NewConversion creates a valid Conversion -func NewConversion(tool *Tool) *Conversion { - return &Conversion{Tool: tool} -} - -// NewEdge creates a valid Edge -func NewEdge(id, sourceNodeId, targetNodeId string) *Edge { - return &Edge{ - Id: id, - SourceNodeId: sourceNodeId, - TargetNodeId: targetNodeId, - } -} - -// NewEdgeTraversal creates a valid EdgeTraversal -func NewEdgeTraversal(edgeId string) *EdgeTraversal { - return &EdgeTraversal{ - EdgeId: edgeId, - } -} - -// NewException creates a valid Exception -func NewException() *Exception { - return &Exception{} -} - -// NewExternalProperties creates a valid ExternalProperties -func NewExternalProperties() *ExternalProperties { - return &ExternalProperties{} -} - -// NewExternalPropertyFileReference creates a valid ExternalPropertyFileReference -func NewExternalPropertyFileReference() *ExternalPropertyFileReference { - return &ExternalPropertyFileReference{} -} - -// NewExternalPropertyFileReferences creates a valid ExternalPropertyFileReferences -func NewExternalPropertyFileReferences() *ExternalPropertyFileReferences { - return &ExternalPropertyFileReferences{} -} - -// NewFix creates a valid Fix -func NewFix(artifactChanges ...*ArtifactChange) *Fix { - return &Fix{ - ArtifactChanges: artifactChanges, - } -} - -// NewGraph creates a valid Graph -func NewGraph() *Graph { - return &Graph{} -} - -// NewGraphTraversal creates a valid GraphTraversal -func NewGraphTraversal() *GraphTraversal { - return &GraphTraversal{} -} - -// NewInvocation creates a valid Invocation -func NewInvocation(executionSuccessful bool) *Invocation { - return &Invocation{ - ExecutionSuccessful: executionSuccessful, - } -} - -// NewLocation creates a valid Location -func NewLocation() *Location { - return &Location{} -} - -// NewLocationRelationship creates a valid LocationRelationship -func NewLocationRelationship(target int) *LocationRelationship { - return &LocationRelationship{ - Target: target, - } -} - -type LogFileVersion string - -const Version210 LogFileVersion = "2.1.0" - -// NewLogFile creates a valid LogFile -func NewLogFile(runs []*Run, version LogFileVersion) *LogFile { - return &LogFile{ - Runs: runs, - Version: version, - } -} - -// NewLogicalLocation creates a valid LogicalLocation -func NewLogicalLocation() *LogicalLocation { - return &LogicalLocation{} -} - -// NewMessage creates a valid Message -func NewMessage() *Message { - return &Message{} -} - -// NewMessageFromText creates a valid Message with the given text -func NewMessageFromText(text string) *Message { - return &Message{ - Text: text, - } -} - -// NewMultiformatMessageString creates a valid MultiformatMessageString -func NewMultiformatMessageString(text string) *MultiformatMessageString { - return &MultiformatMessageString{ - Text: text, - } -} - -// NewNode creates a valid Node -func NewNode(id string) *Node { - return &Node{ - Id: id, - } -} - -// NewNotification creates a valid Notification -func NewNotification(message *Message) *Notification { - return &Notification{ - Message: message, - } -} - -// NewPhysicalLocation creates a valid PhysicalLocation -func NewPhysicalLocation() *PhysicalLocation { - return &PhysicalLocation{} -} - -// NewPropertyBag creates a valid PropertyBag -func NewPropertyBag() *PropertyBag { - return &PropertyBag{} -} - -// NewRectangle creates a valid Rectangle -func NewRectangle() *Rectangle { - return &Rectangle{} -} - -// NewRegion creates a valid Region -func NewRegion() *Region { - return &Region{} -} - -// NewReplacement creates a valid Replacement -func NewReplacement(deletedRegion *Region) *Replacement { - return &Replacement{ - DeletedRegion: deletedRegion, - } -} - -// NewReportingConfiguration creates a valid ReportingConfiguration -func NewReportingConfiguration() *ReportingConfiguration { - return &ReportingConfiguration{} -} - -// NewReportingDescriptor creates a valid ReportingDescriptor -func NewReportingDescriptor(id string) *ReportingDescriptor { - return &ReportingDescriptor{ - Id: id, - } -} - -// NewRule is an alias for NewReportingDescriptor -func NewRule(id string) *ReportingDescriptor { - return NewReportingDescriptor(id) -} - -// NewReportingDescriptorReference creates a valid ReportingDescriptorReference -func NewReportingDescriptorReference() *ReportingDescriptorReference { - return &ReportingDescriptorReference{} -} - -// NewReportingDescriptorRelationship creates a valid ReportingDescriptorRelationship -func NewReportingDescriptorRelationship(target *ReportingDescriptorReference) *ReportingDescriptorRelationship { - return &ReportingDescriptorRelationship{ - Target: target, - } -} - -// NewResult creates a valid Result -func NewResult(message *Message) *Result { - return &Result{ - Message: message, - } -} - -// NewResultProvenance creates a valid ResultProvenance -func NewResultProvenance() *ResultProvenance { - return &ResultProvenance{} -} - -// NewRun creates a valid Run -func NewRun(tool *Tool) *Run { - return &Run{ - Tool: tool, - } -} - -// NewRunAutomationDetails creates a valid RunAutomationDetails -func NewRunAutomationDetails() *RunAutomationDetails { - return &RunAutomationDetails{} -} - -// New creates a valid -func NewSpecialLocations() *SpecialLocations { - return &SpecialLocations{} -} - -// NewStack creates a valid Stack -func NewStack(frames ...*StackFrame) *Stack { - return &Stack{ - Frames: frames, - } -} - -// NewStackFrame creates a valid StackFrame -func NewStackFrame() *StackFrame { - return &StackFrame{} -} - -// NewSuppression creates a valid Suppression -func NewSuppression(kind string) *Suppression { - return &Suppression{ - Kind: kind, - } -} - -// NewThreadFlow creates a valid ThreadFlow -func NewThreadFlow(locations []*ThreadFlowLocation) *ThreadFlow { - return &ThreadFlow{ - Locations: locations, - } -} - -// NewThreadFlowLocation creates a valid ThreadFlowLocation -func NewThreadFlowLocation() *ThreadFlowLocation { - return &ThreadFlowLocation{} -} - -// NewTool creates a valid Tool -func NewTool(driver *ToolComponent) *Tool { - return &Tool{ - Driver: driver, - } -} - -// NewToolComponent creates a valid ToolComponent -func NewToolComponent(name string) *ToolComponent { - return &ToolComponent{ - Name: name, - } -} - -// NewDriver is an alias for NewToolComponent -func NewDriver(name string) *ToolComponent { - return NewToolComponent(name) -} - -// NewToolComponentReference creates a valid ToolComponentReference -func NewToolComponentReference() *ToolComponentReference { - return &ToolComponentReference{} -} - -// NewTranslationMetadata creates a valid TranslationMetadata -func NewTranslationMetadata(name string) *TranslationMetadata { - return &TranslationMetadata{ - Name: name, - } -} - -// NewVersionControlDetails creates a valid VersionControlDetails -func NewVersionControlDetails(repositoryUri string) *VersionControlDetails { - return &VersionControlDetails{ - RepositoryUri: repositoryUri, - } -} - -// NewWebRequest creates a valid WebRequest -func NewWebRequest() *WebRequest { - return &WebRequest{} -} - -// NewWebResponse creates a valid WebResponse -func NewWebResponse() *WebResponse { - return &WebResponse{} -} diff --git a/vendor/github.com/chavacava/garif/decorators.go b/vendor/github.com/chavacava/garif/decorators.go deleted file mode 100644 index 00b599fb82..0000000000 --- a/vendor/github.com/chavacava/garif/decorators.go +++ /dev/null @@ -1,94 +0,0 @@ -package garif - -// WithLineColumn sets a physical location with the given line and column -func (l *Location) WithLineColumn(line, column int) *Location { - if l.PhysicalLocation == nil { - l.PhysicalLocation = NewPhysicalLocation() - } - - l.PhysicalLocation.Region = NewRegion() - l.PhysicalLocation.Region.StartLine = line - l.PhysicalLocation.Region.StartColumn = column - - return l -} - -// WithURI sets a physical location with the given URI -func (l *Location) WithURI(uri string) *Location { - if l.PhysicalLocation == nil { - l.PhysicalLocation = NewPhysicalLocation() - } - - l.PhysicalLocation.ArtifactLocation = NewArtifactLocation() - l.PhysicalLocation.ArtifactLocation.Uri = uri - - return l -} - -// WithKeyValue sets (overwrites) the value of the given key -func (b PropertyBag) WithKeyValue(key string, value interface{}) PropertyBag { - b[key] = value - return b -} - -// WithHelpUri sets the help URI for this ReportingDescriptor -func (r *ReportingDescriptor) WithHelpUri(uri string) *ReportingDescriptor { - r.HelpUri = uri - return r -} - -// WithProperties adds the key & value to the properties of this ReportingDescriptor -func (r *ReportingDescriptor) WithProperties(key string, value interface{}) *ReportingDescriptor { - if r.Properties == nil { - r.Properties = NewPropertyBag() - } - - r.Properties.WithKeyValue(key, value) - - return r -} - -// WithArtifactsURIs adds the given URI as artifacts of this Run -func (r *Run) WithArtifactsURIs(uris ...string) *Run { - if r.Artifacts == nil { - r.Artifacts = []*Artifact{} - } - - for _, uri := range uris { - a := NewArtifact() - a.Location = NewArtifactLocation() - a.Location.Uri = uri - r.Artifacts = append(r.Artifacts, a) - } - - return r -} - -// WithResult adds a result to this Run -func (r *Run) WithResult(ruleId string, message string, uri string, line int, column int) *Run { - if r.Results == nil { - r.Results = []*Result{} - } - - msg := NewMessage() - msg.Text = message - result := NewResult(msg) - location := NewLocation().WithURI(uri).WithLineColumn(line, column) - - result.Locations = append(result.Locations, location) - result.RuleId = ruleId - r.Results = append(r.Results, result) - return r -} - -// WithInformationUri sets the information URI -func (t *ToolComponent) WithInformationUri(uri string) *ToolComponent { - t.InformationUri = uri - return t -} - -// WithRules sets (overwrites) the rules -func (t *ToolComponent) WithRules(rules ...*ReportingDescriptor) *ToolComponent { - t.Rules = rules - return t -} diff --git a/vendor/github.com/chavacava/garif/doc.go b/vendor/github.com/chavacava/garif/doc.go deleted file mode 100644 index 50fa6dfe5b..0000000000 --- a/vendor/github.com/chavacava/garif/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Package garif defines all the GO structures required to model a SARIF log file. -// These structures were created using the JSON-schema sarif-schema-2.1.0.json of SARIF logfiles -// available at https://github.com/oasis-tcs/sarif-spec/tree/master/Schemata. -// -// The package provides constructors for all structures (see constructors.go) These constructors -// ensure that the returned structure instantiation is valid with respect to the JSON schema and -// should be used in place of plain structure instantiation. -// The root structure is LogFile. -// -// The package provides utility decorators for the most commonly used structures (see decorators.go) -package garif diff --git a/vendor/github.com/chavacava/garif/enums.go b/vendor/github.com/chavacava/garif/enums.go deleted file mode 100644 index dea2daf131..0000000000 --- a/vendor/github.com/chavacava/garif/enums.go +++ /dev/null @@ -1,41 +0,0 @@ -package garif - -type ResultKind string - -// declare JSON values -const ( - _pass ResultKind = "pass" - _open ResultKind = "open" - _informational ResultKind = "informational" - _notApplicable ResultKind = "notApplicable" - _review ResultKind = "review" - _fail ResultKind = "fail" -) - -// create public visible constants with a namespace as enums -const ( - ResultKind_Pass ResultKind = _pass - ResultKind_Open ResultKind = _open - ResultKind_Informational ResultKind = _informational - ResultKind_NotApplicable ResultKind = _notApplicable - ResultKind_Review ResultKind = _review - ResultKind_Fail ResultKind = _fail -) - -type ResultLevel string - -// declare JSON values -const ( - _warning ResultLevel = "warning" - _error ResultLevel = "error" - _note ResultLevel = "note" - _none ResultLevel = "none" -) - -// create public visible constants with a namespace as enums -const ( - ResultLevel_Warning ResultLevel = _warning - ResultLevel_Error ResultLevel = _error - ResultLevel_Note ResultLevel = _note - ResultLevel_None ResultLevel = _none -) diff --git a/vendor/github.com/chavacava/garif/io.go b/vendor/github.com/chavacava/garif/io.go deleted file mode 100644 index ce5719c96d..0000000000 --- a/vendor/github.com/chavacava/garif/io.go +++ /dev/null @@ -1,26 +0,0 @@ -package garif - -import ( - "encoding/json" - "io" -) - -// Write writes the JSON -func (l *LogFile) Write(w io.Writer) error { - marshal, err := json.Marshal(l) - if err != nil { - return err - } - _, err = w.Write(marshal) - return err -} - -// PrettyWrite writes indented JSON -func (l *LogFile) PrettyWrite(w io.Writer) error { - marshal, err := json.MarshalIndent(l, "", " ") - if err != nil { - return err - } - _, err = w.Write(marshal) - return err -} diff --git a/vendor/github.com/chavacava/garif/models.go b/vendor/github.com/chavacava/garif/models.go deleted file mode 100644 index f16a86136e..0000000000 --- a/vendor/github.com/chavacava/garif/models.go +++ /dev/null @@ -1,1486 +0,0 @@ -package garif - -// Address A physical or virtual address, or a range of addresses, in an 'addressable region' (memory or a binary file). -type Address struct { - - // The address expressed as a byte offset from the start of the addressable region. - AbsoluteAddress int `json:"absoluteAddress,omitempty"` - - // A human-readable fully qualified name that is associated with the address. - FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` - - // The index within run.addresses of the cached object for this address. - Index int `json:"index,omitempty"` - - // An open-ended string that identifies the address kind. - // 'data', 'function', 'header','instruction', 'module', 'page', 'section', - // 'segment', 'stack', 'stackFrame', 'table' are well-known values. - Kind string `json:"kind,omitempty"` - - // The number of bytes in this range of addresses. - Length int `json:"length,omitempty"` - - // A name that is associated with the address, e.g., '.text'. - Name string `json:"name,omitempty"` - - // The byte offset of this address from the absolute or relative address of the parent object. - OffsetFromParent int `json:"offsetFromParent,omitempty"` - - // The index within run.addresses of the parent object. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the address. - Properties *PropertyBag `json:"properties,omitempty"` - - // The address expressed as a byte offset from the absolute address of the top-most parent object. - RelativeAddress int `json:"relativeAddress,omitempty"` -} - -// Artifact A single artifact. In some cases, this artifact might be nested within another artifact. -type Artifact struct { - - // The contents of the artifact. - Contents *ArtifactContent `json:"contents,omitempty"` - - // A short description of the artifact. - Description *Message `json:"description,omitempty"` - - // Specifies the encoding for an artifact object that refers to a text file. - Encoding string `json:"encoding,omitempty"` - - // A dictionary, each of whose keys is the name of a hash function and each of whose values is - // the hashed value of the artifact produced by the specified hash function. - Hashes map[string]string `json:"hashes,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. - // See "Date/time properties" in the SARIF spec for the required format. - LastModifiedTimeUtc string `json:"lastModifiedTimeUtc,omitempty"` - - // The length of the artifact in bytes. - Length int `json:"length,omitempty"` - - // The location of the artifact. - Location *ArtifactLocation `json:"location,omitempty"` - - // The MIME type (RFC 2045) of the artifact. - MimeType string `json:"mimeType,omitempty"` - - // The offset in bytes of the artifact within its containing artifact. - Offset int `json:"offset,omitempty"` - - // Identifies the index of the immediate parent of the artifact, if this artifact is nested. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the artifact. - Properties *PropertyBag `json:"properties,omitempty"` - - // The role or roles played by the artifact in the analysis. - Roles []interface{} `json:"roles,omitempty"` - - // Specifies the source language for any artifact object that refers to a text file that contains source code. - SourceLanguage string `json:"sourceLanguage,omitempty"` -} - -// ArtifactChange A change to a single artifact. -type ArtifactChange struct { - - // The location of the artifact to change. - ArtifactLocation *ArtifactLocation `json:"artifactLocation"` - - // Key/value pairs that provide additional information about the change. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of replacement objects, each of which represents the replacement of a single region in a - // single artifact specified by 'artifactLocation'. - Replacements []*Replacement `json:"replacements"` -} - -// ArtifactContent Represents the contents of an artifact. -type ArtifactContent struct { - - // MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. - Binary string `json:"binary,omitempty"` - - // Key/value pairs that provide additional information about the artifact content. - Properties *PropertyBag `json:"properties,omitempty"` - - // An alternate rendered representation of the artifact (e.g., a decompiled representation of a binary region). - Rendered *MultiformatMessageString `json:"rendered,omitempty"` - - // UTF-8-encoded content from a text artifact. - Text string `json:"text,omitempty"` -} - -// ArtifactLocation Specifies the location of an artifact. -type ArtifactLocation struct { - - // A short description of the artifact location. - Description *Message `json:"description,omitempty"` - - // The index within the run artifacts array of the artifact object associated with the artifact location. - Index int `json:"index,omitempty"` - - // Key/value pairs that provide additional information about the artifact location. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string containing a valid relative or absolute URI. - Uri string `json:"uri,omitempty"` - - // A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. - UriBaseId string `json:"uriBaseId,omitempty"` -} - -// Attachment An artifact relevant to a result. -type Attachment struct { - - // The location of the attachment. - ArtifactLocation *ArtifactLocation `json:"artifactLocation"` - - // A message describing the role played by the attachment. - Description *Message `json:"description,omitempty"` - - // Key/value pairs that provide additional information about the attachment. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of rectangles specifying areas of interest within the image. - Rectangles []*Rectangle `json:"rectangles,omitempty"` - - // An array of regions of interest within the attachment. - Regions []*Region `json:"regions,omitempty"` -} - -// CodeFlow A set of threadFlows which together describe a pattern of code execution relevant to detecting a result. -type CodeFlow struct { - - // A message relevant to the code flow. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the code flow. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of one or more unique threadFlow objects, each of which describes the progress of a program - // through a thread of execution. - ThreadFlows []*ThreadFlow `json:"threadFlows"` -} - -// ConfigurationOverride Information about how a specific rule or notification was reconfigured at runtime. -type ConfigurationOverride struct { - - // Specifies how the rule or notification was configured during the scan. - Configuration *ReportingConfiguration `json:"configuration"` - - // A reference used to locate the descriptor whose configuration was overridden. - Descriptor *ReportingDescriptorReference `json:"descriptor"` - - // Key/value pairs that provide additional information about the configuration override. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Conversion Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. -type Conversion struct { - - // The locations of the analysis tool's per-run log files. - AnalysisToolLogFiles []*ArtifactLocation `json:"analysisToolLogFiles,omitempty"` - - // An invocation object that describes the invocation of the converter. - Invocation *Invocation `json:"invocation,omitempty"` - - // Key/value pairs that provide additional information about the conversion. - Properties *PropertyBag `json:"properties,omitempty"` - - // A tool object that describes the converter. - Tool *Tool `json:"tool"` -} - -// Edge Represents a directed edge in a graph. -type Edge struct { - - // A string that uniquely identifies the edge within its graph. - Id string `json:"id"` - - // A short description of the edge. - Label *Message `json:"label,omitempty"` - - // Key/value pairs that provide additional information about the edge. - Properties *PropertyBag `json:"properties,omitempty"` - - // Identifies the source node (the node at which the edge starts). - SourceNodeId string `json:"sourceNodeId"` - - // Identifies the target node (the node at which the edge ends). - TargetNodeId string `json:"targetNodeId"` -} - -// EdgeTraversal Represents the traversal of a single edge during a graph traversal. -type EdgeTraversal struct { - - // Identifies the edge being traversed. - EdgeId string `json:"edgeId"` - - // The values of relevant expressions after the edge has been traversed. - FinalState map[string]*MultiformatMessageString `json:"finalState,omitempty"` - - // A message to display to the user as the edge is traversed. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the edge traversal. - Properties *PropertyBag `json:"properties,omitempty"` - - // The number of edge traversals necessary to return from a nested graph. - StepOverEdgeCount int `json:"stepOverEdgeCount,omitempty"` -} - -// Exception Describes a runtime exception encountered during the execution of an analysis tool. -type Exception struct { - - // An array of exception objects each of which is considered a cause of this exception. - InnerExceptions []*Exception `json:"innerExceptions,omitempty"` - - // A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. - Kind string `json:"kind,omitempty"` - - // A message that describes the exception. - Message string `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the exception. - Properties *PropertyBag `json:"properties,omitempty"` - - // The sequence of function calls leading to the exception. - Stack *Stack `json:"stack,omitempty"` -} - -// ExternalProperties The top-level element of an external property file. -type ExternalProperties struct { - - // Addresses that will be merged with a separate run. - Addresses []*Address `json:"addresses,omitempty"` - - // An array of artifact objects that will be merged with a separate run. - Artifacts []*Artifact `json:"artifacts,omitempty"` - - // A conversion object that will be merged with a separate run. - Conversion *Conversion `json:"conversion,omitempty"` - - // The analysis tool object that will be merged with a separate run. - Driver *ToolComponent `json:"driver,omitempty"` - - // Tool extensions that will be merged with a separate run. - Extensions []*ToolComponent `json:"extensions,omitempty"` - - // Key/value pairs that provide additional information that will be merged with a separate run. - ExternalizedProperties *PropertyBag `json:"externalizedProperties,omitempty"` - - // An array of graph objects that will be merged with a separate run. - Graphs []*Graph `json:"graphs,omitempty"` - - // A stable, unique identifer for this external properties object, in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // Describes the invocation of the analysis tool that will be merged with a separate run. - Invocations []*Invocation `json:"invocations,omitempty"` - - // An array of logical locations such as namespaces, types or functions that will be merged with a separate run. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // Tool policies that will be merged with a separate run. - Policies []*ToolComponent `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the external properties. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of result objects that will be merged with a separate run. - Results []*Result `json:"results,omitempty"` - - // A stable, unique identifer for the run associated with this external properties object, in the form of a GUID. - RunGuid string `json:"runGuid,omitempty"` - - // The URI of the JSON schema corresponding to the version of the external property file format. - Schema string `json:"schema,omitempty"` - - // Tool taxonomies that will be merged with a separate run. - Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` - - // An array of threadFlowLocation objects that will be merged with a separate run. - ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` - - // Tool translations that will be merged with a separate run. - Translations []*ToolComponent `json:"translations,omitempty"` - - // The SARIF format version of this external properties object. - Version interface{} `json:"version,omitempty"` - - // Requests that will be merged with a separate run. - WebRequests []*WebRequest `json:"webRequests,omitempty"` - - // Responses that will be merged with a separate run. - WebResponses []*WebResponse `json:"webResponses,omitempty"` -} - -// ExternalPropertyFileReference Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. -type ExternalPropertyFileReference struct { - - // A stable, unique identifer for the external property file in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A non-negative integer specifying the number of items contained in the external property file. - ItemCount int `json:"itemCount,omitempty"` - - // The location of the external property file. - Location *ArtifactLocation `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the external property file. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ExternalPropertyFileReferences References to external property files that should be inlined with the content of a root log file. -type ExternalPropertyFileReferences struct { - - // An array of external property files containing run.addresses arrays to be merged with the root log file. - Addresses []*ExternalPropertyFileReference `json:"addresses,omitempty"` - - // An array of external property files containing run.artifacts arrays to be merged with the root log file. - Artifacts []*ExternalPropertyFileReference `json:"artifacts,omitempty"` - - // An external property file containing a run.conversion object to be merged with the root log file. - Conversion *ExternalPropertyFileReference `json:"conversion,omitempty"` - - // An external property file containing a run.driver object to be merged with the root log file. - Driver *ExternalPropertyFileReference `json:"driver,omitempty"` - - // An array of external property files containing run.extensions arrays to be merged with the root log file. - Extensions []*ExternalPropertyFileReference `json:"extensions,omitempty"` - - // An external property file containing a run.properties object to be merged with the root log file. - ExternalizedProperties *ExternalPropertyFileReference `json:"externalizedProperties,omitempty"` - - // An array of external property files containing a run.graphs object to be merged with the root log file. - Graphs []*ExternalPropertyFileReference `json:"graphs,omitempty"` - - // An array of external property files containing run.invocations arrays to be merged with the root log file. - Invocations []*ExternalPropertyFileReference `json:"invocations,omitempty"` - - // An array of external property files containing run.logicalLocations arrays to be merged with the root log file. - LogicalLocations []*ExternalPropertyFileReference `json:"logicalLocations,omitempty"` - - // An array of external property files containing run.policies arrays to be merged with the root log file. - Policies []*ExternalPropertyFileReference `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the external property files. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of external property files containing run.results arrays to be merged with the root log file. - Results []*ExternalPropertyFileReference `json:"results,omitempty"` - - // An array of external property files containing run.taxonomies arrays to be merged with the root log file. - Taxonomies []*ExternalPropertyFileReference `json:"taxonomies,omitempty"` - - // An array of external property files containing run.threadFlowLocations arrays to be merged with the root log file. - ThreadFlowLocations []*ExternalPropertyFileReference `json:"threadFlowLocations,omitempty"` - - // An array of external property files containing run.translations arrays to be merged with the root log file. - Translations []*ExternalPropertyFileReference `json:"translations,omitempty"` - - // An array of external property files containing run.requests arrays to be merged with the root log file. - WebRequests []*ExternalPropertyFileReference `json:"webRequests,omitempty"` - - // An array of external property files containing run.responses arrays to be merged with the root log file. - WebResponses []*ExternalPropertyFileReference `json:"webResponses,omitempty"` -} - -// Fix A proposed fix for the problem represented by a result object. -// A fix specifies a set of artifacts to modify. For each artifact, -// it specifies a set of bytes to remove, and provides a set of new bytes to replace them. -type Fix struct { - - // One or more artifact changes that comprise a fix for a result. - ArtifactChanges []*ArtifactChange `json:"artifactChanges"` - - // A message that describes the proposed fix, enabling viewers to present the proposed change to an end user. - Description *Message `json:"description,omitempty"` - - // Key/value pairs that provide additional information about the fix. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Graph A network of nodes and directed edges that describes some aspect of the -// structure of the code (for example, a call graph). -type Graph struct { - - // A description of the graph. - Description *Message `json:"description,omitempty"` - - // An array of edge objects representing the edges of the graph. - Edges []*Edge `json:"edges,omitempty"` - - // An array of node objects representing the nodes of the graph. - Nodes []*Node `json:"nodes,omitempty"` - - // Key/value pairs that provide additional information about the graph. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// GraphTraversal Represents a path through a graph. -type GraphTraversal struct { - - // A description of this graph traversal. - Description *Message `json:"description,omitempty"` - - // The sequences of edges traversed by this graph traversal. - EdgeTraversals []*EdgeTraversal `json:"edgeTraversals,omitempty"` - - // Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. - ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` - - // Values of relevant expressions at the start of the graph traversal that may change during graph traversal. - InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` - - // Key/value pairs that provide additional information about the graph traversal. - Properties *PropertyBag `json:"properties,omitempty"` - - // The index within the result.graphs to be associated with the result. - ResultGraphIndex int `json:"resultGraphIndex,omitempty"` - - // The index within the run.graphs to be associated with the result. - RunGraphIndex int `json:"runGraphIndex,omitempty"` -} - -// Invocation The runtime environment of the analysis tool run. -type Invocation struct { - - // The account under which the invocation occurred. - Account string `json:"account,omitempty"` - - // An array of strings, containing in order the command line arguments passed to the tool from the operating system. - Arguments []string `json:"arguments,omitempty"` - - // The command line used to invoke the tool. - CommandLine string `json:"commandLine,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the required format. - EndTimeUtc string `json:"endTimeUtc,omitempty"` - - // The environment variables associated with the analysis tool process, expressed as key/value pairs. - EnvironmentVariables map[string]string `json:"environmentVariables,omitempty"` - - // An absolute URI specifying the location of the executable that was invoked. - ExecutableLocation *ArtifactLocation `json:"executableLocation,omitempty"` - - // Specifies whether the tool's execution completed successfully. - ExecutionSuccessful bool `json:"executionSuccessful"` - - // The process exit code. - ExitCode int `json:"exitCode,omitempty"` - - // The reason for the process exit. - ExitCodeDescription string `json:"exitCodeDescription,omitempty"` - - // The name of the signal that caused the process to exit. - ExitSignalName string `json:"exitSignalName,omitempty"` - - // The numeric value of the signal that caused the process to exit. - ExitSignalNumber int `json:"exitSignalNumber,omitempty"` - - // The machine on which the invocation occurred. - Machine string `json:"machine,omitempty"` - - // An array of configurationOverride objects that describe notifications related runtime overrides. - NotificationConfigurationOverrides []*ConfigurationOverride `json:"notificationConfigurationOverrides,omitempty"` - - // The id of the process in which the invocation occurred. - ProcessId int `json:"processId,omitempty"` - - // The reason given by the operating system that the process failed to start. - ProcessStartFailureMessage string `json:"processStartFailureMessage,omitempty"` - - // Key/value pairs that provide additional information about the invocation. - Properties *PropertyBag `json:"properties,omitempty"` - - // The locations of any response files specified on the tool's command line. - ResponseFiles []*ArtifactLocation `json:"responseFiles,omitempty"` - - // An array of configurationOverride objects that describe rules related runtime overrides. - RuleConfigurationOverrides []*ConfigurationOverride `json:"ruleConfigurationOverrides,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for the required format. - StartTimeUtc string `json:"startTimeUtc,omitempty"` - - // A file containing the standard error stream from the process that was invoked. - Stderr *ArtifactLocation `json:"stderr,omitempty"` - - // A file containing the standard input stream to the process that was invoked. - Stdin *ArtifactLocation `json:"stdin,omitempty"` - - // A file containing the standard output stream from the process that was invoked. - Stdout *ArtifactLocation `json:"stdout,omitempty"` - - // A file containing the interleaved standard output and standard error stream from the process that was invoked. - StdoutStderr *ArtifactLocation `json:"stdoutStderr,omitempty"` - - // A list of conditions detected by the tool that are relevant to the tool's configuration. - ToolConfigurationNotifications []*Notification `json:"toolConfigurationNotifications,omitempty"` - - // A list of runtime conditions detected by the tool during the analysis. - ToolExecutionNotifications []*Notification `json:"toolExecutionNotifications,omitempty"` - - // The working directory for the invocation. - WorkingDirectory *ArtifactLocation `json:"workingDirectory,omitempty"` -} - -// Location A location within a programming artifact. -type Location struct { - - // A set of regions relevant to the location. - Annotations []*Region `json:"annotations,omitempty"` - - // Value that distinguishes this location from all other locations within a single result object. - Id int `json:"id,omitempty"` - - // The logical locations associated with the result. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // A message relevant to the location. - Message *Message `json:"message,omitempty"` - - // Identifies the artifact and region. - PhysicalLocation *PhysicalLocation `json:"physicalLocation,omitempty"` - - // Key/value pairs that provide additional information about the location. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of objects that describe relationships between this location and others. - Relationships []*LocationRelationship `json:"relationships,omitempty"` -} - -// LocationRelationship Information about the relation of one location to another. -type LocationRelationship struct { - - // A description of the location relationship. - Description *Message `json:"description,omitempty"` - - // A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. - Kinds []string `json:"kinds,omitempty"` - - // Key/value pairs that provide additional information about the location relationship. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference to the related location. - Target int `json:"target"` -} - -// LogFile Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema. -type LogFile struct { - - // References to external property files that share data between runs. - InlineExternalProperties []*ExternalProperties `json:"inlineExternalProperties,omitempty"` - - // Key/value pairs that provide additional information about the log file. - Properties *PropertyBag `json:"properties,omitempty"` - - // The set of runs contained in this log file. - Runs []*Run `json:"runs"` - - // The URI of the JSON schema corresponding to the version. - Schema string `json:"$schema,omitempty"` - - // The SARIF format version of this log file. - Version interface{} `json:"version"` -} - -// LogicalLocation A logical location of a construct that produced a result. -type LogicalLocation struct { - - // The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling convention, return type and other details along with the function name. - DecoratedName string `json:"decoratedName,omitempty"` - - // The human-readable fully qualified name of the logical location. - FullyQualifiedName string `json:"fullyQualifiedName,omitempty"` - - // The index within the logical locations array. - Index int `json:"index,omitempty"` - - // The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those accurately describe the construct. - Kind string `json:"kind,omitempty"` - - // Identifies the construct in which the result occurred. For example, this property might contain the name of a class or a method. - Name string `json:"name,omitempty"` - - // Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a logical location that represents the namespace that holds a type. - ParentIndex int `json:"parentIndex,omitempty"` - - // Key/value pairs that provide additional information about the logical location. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Message Encapsulates a message intended to be read by the end user. -type Message struct { - - // An array of strings to substitute into the message string. - Arguments []string `json:"arguments,omitempty"` - - // The identifier for this message. - Id string `json:"id,omitempty"` - - // A Markdown message string. - Markdown string `json:"markdown,omitempty"` - - // Key/value pairs that provide additional information about the message. - Properties *PropertyBag `json:"properties,omitempty"` - - // A plain text message string. - Text string `json:"text,omitempty"` -} - -// MultiformatMessageString A message string or message format string rendered in multiple formats. -type MultiformatMessageString struct { - - // A Markdown message string or format string. - Markdown string `json:"markdown,omitempty"` - - // Key/value pairs that provide additional information about the message. - Properties *PropertyBag `json:"properties,omitempty"` - - // A plain text message string or format string. - Text string `json:"text"` -} - -// Node Represents a node in a graph. -type Node struct { - - // Array of child nodes. - Children []*Node `json:"children,omitempty"` - - // A string that uniquely identifies the node within its graph. - Id string `json:"id"` - - // A short description of the node. - Label *Message `json:"label,omitempty"` - - // A code location associated with the node. - Location *Location `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the node. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Notification Describes a condition relevant to the tool itself, as opposed to being relevant to a target being analyzed by the tool. -type Notification struct { - - // A reference used to locate the rule descriptor associated with this notification. - AssociatedRule *ReportingDescriptorReference `json:"associatedRule,omitempty"` - - // A reference used to locate the descriptor relevant to this notification. - Descriptor *ReportingDescriptorReference `json:"descriptor,omitempty"` - - // The runtime exception, if any, relevant to this notification. - Exception *Exception `json:"exception,omitempty"` - - // A value specifying the severity level of the notification. - Level interface{} `json:"level,omitempty"` - - // The locations relevant to this notification. - Locations []*Location `json:"locations,omitempty"` - - // A message that describes the condition that was encountered. - Message *Message `json:"message"` - - // Key/value pairs that provide additional information about the notification. - Properties *PropertyBag `json:"properties,omitempty"` - - // The thread identifier of the code that generated the notification. - ThreadId int `json:"threadId,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the analysis tool generated the notification. - TimeUtc string `json:"timeUtc,omitempty"` -} - -// PhysicalLocation A physical location relevant to a result. Specifies a reference to a programming artifact together with a range of bytes or characters within that artifact. -type PhysicalLocation struct { - - // The address of the location. - Address *Address `json:"address,omitempty"` - - // The location of the artifact. - ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` - - // Specifies a portion of the artifact that encloses the region. Allows a viewer to display additional context around the region. - ContextRegion *Region `json:"contextRegion,omitempty"` - - // Key/value pairs that provide additional information about the physical location. - Properties *PropertyBag `json:"properties,omitempty"` - - // Specifies a portion of the artifact. - Region *Region `json:"region,omitempty"` -} - -type PropertyBag map[string]interface{} - -/* -// PropertyBag Key/value pairs that provide additional information about the object. -type PropertyBag struct { - AdditionalProperties map[string]interface{} `json:"-,omitempty"` - - // A set of distinct strings that provide additional information. - Tags []string `json:"tags,omitempty"` -} -*/ -// Rectangle An area within an image. -type Rectangle struct { - - // The Y coordinate of the bottom edge of the rectangle, measured in the image's natural units. - Bottom float64 `json:"bottom,omitempty"` - - // The X coordinate of the left edge of the rectangle, measured in the image's natural units. - Left float64 `json:"left,omitempty"` - - // A message relevant to the rectangle. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the rectangle. - Properties *PropertyBag `json:"properties,omitempty"` - - // The X coordinate of the right edge of the rectangle, measured in the image's natural units. - Right float64 `json:"right,omitempty"` - - // The Y coordinate of the top edge of the rectangle, measured in the image's natural units. - Top float64 `json:"top,omitempty"` -} - -// Region A region within an artifact where a result was detected. -type Region struct { - - // The length of the region in bytes. - ByteLength int `json:"byteLength,omitempty"` - - // The zero-based offset from the beginning of the artifact of the first byte in the region. - ByteOffset int `json:"byteOffset,omitempty"` - - // The length of the region in characters. - CharLength int `json:"charLength,omitempty"` - - // The zero-based offset from the beginning of the artifact of the first character in the region. - CharOffset int `json:"charOffset,omitempty"` - - // The column number of the character following the end of the region. - EndColumn int `json:"endColumn,omitempty"` - - // The line number of the last character in the region. - EndLine int `json:"endLine,omitempty"` - - // A message relevant to the region. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the region. - Properties *PropertyBag `json:"properties,omitempty"` - - // The portion of the artifact contents within the specified region. - Snippet *ArtifactContent `json:"snippet,omitempty"` - - // Specifies the source language, if any, of the portion of the artifact specified by the region object. - SourceLanguage string `json:"sourceLanguage,omitempty"` - - // The column number of the first character in the region. - StartColumn int `json:"startColumn,omitempty"` - - // The line number of the first character in the region. - StartLine int `json:"startLine,omitempty"` -} - -// Replacement The replacement of a single region of an artifact. -type Replacement struct { - - // The region of the artifact to delete. - DeletedRegion *Region `json:"deletedRegion"` - - // The content to insert at the location specified by the 'deletedRegion' property. - InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` - - // Key/value pairs that provide additional information about the replacement. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ReportingConfiguration Information about a rule or notification that can be configured at runtime. -type ReportingConfiguration struct { - - // Specifies whether the report may be produced during the scan. - Enabled bool `json:"enabled,omitempty"` - - // Specifies the failure level for the report. - Level interface{} `json:"level,omitempty"` - - // Contains configuration information specific to a report. - Parameters *PropertyBag `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the reporting configuration. - Properties *PropertyBag `json:"properties,omitempty"` - - // Specifies the relative priority of the report. Used for analysis output only. - Rank float64 `json:"rank,omitempty"` -} - -// ReportingDescriptor Metadata that describes a specific report produced by the tool, as part of the analysis it provides or its runtime reporting. -type ReportingDescriptor struct { - - // Default reporting configuration information. - DefaultConfiguration *ReportingConfiguration `json:"defaultConfiguration,omitempty"` - - // An array of unique identifies in the form of a GUID by which this report was known in some previous version of the analysis tool. - DeprecatedGuids []string `json:"deprecatedGuids,omitempty"` - - // An array of stable, opaque identifiers by which this report was known in some previous version of the analysis tool. - DeprecatedIds []string `json:"deprecatedIds,omitempty"` - - // An array of readable identifiers by which this report was known in some previous version of the analysis tool. - DeprecatedNames []string `json:"deprecatedNames,omitempty"` - - // A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // A unique identifer for the reporting descriptor in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // Provides the primary documentation for the report, useful when there is no online documentation. - Help *MultiformatMessageString `json:"help,omitempty"` - - // A URI where the primary documentation for the report can be found. - HelpUri string `json:"helpUri,omitempty"` - - // A stable, opaque identifier for the report. - Id string `json:"id"` - - // A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - MessageStrings map[string]*MultiformatMessageString `json:"messageStrings,omitempty"` - - // A report identifier that is understandable to an end user. - Name string `json:"name,omitempty"` - - // Key/value pairs that provide additional information about the report. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of objects that describe relationships between this reporting descriptor and others. - Relationships []*ReportingDescriptorRelationship `json:"relationships,omitempty"` - - // A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of text. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` -} - -// ReportingDescriptorReference Information about how to locate a relevant reporting descriptor. -type ReportingDescriptorReference struct { - - // A guid that uniquely identifies the descriptor. - Guid string `json:"guid,omitempty"` - - // The id of the descriptor. - Id string `json:"id,omitempty"` - - // The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. - Index int `json:"index,omitempty"` - - // Key/value pairs that provide additional information about the reporting descriptor reference. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference used to locate the toolComponent associated with the descriptor. - ToolComponent *ToolComponentReference `json:"toolComponent,omitempty"` -} - -// ReportingDescriptorRelationship Information about the relation of one reporting descriptor to another. -type ReportingDescriptorRelationship struct { - - // A description of the reporting descriptor relationship. - Description *Message `json:"description,omitempty"` - - // A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. - Kinds []string `json:"kinds,omitempty"` - - // Key/value pairs that provide additional information about the reporting descriptor reference. - Properties *PropertyBag `json:"properties,omitempty"` - - // A reference to the related reporting descriptor. - Target *ReportingDescriptorReference `json:"target"` -} - -// Result A result produced by an analysis tool. -type Result struct { - - // Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually occurred. - AnalysisTarget *ArtifactLocation `json:"analysisTarget,omitempty"` - - // A set of artifacts relevant to the result. - Attachments []*Attachment `json:"attachments,omitempty"` - - // The state of a result relative to a baseline of a previous run. - BaselineState interface{} `json:"baselineState,omitempty"` - - // An array of 'codeFlow' objects relevant to the result. - CodeFlows []*CodeFlow `json:"codeFlows,omitempty"` - - // A stable, unique identifier for the equivalence class of logically identical results to which this result belongs, in the form of a GUID. - CorrelationGuid string `json:"correlationGuid,omitempty"` - - // A set of strings each of which individually defines a stable, unique identity for the result. - Fingerprints map[string]string `json:"fingerprints,omitempty"` - - // An array of 'fix' objects, each of which represents a proposed fix to the problem indicated by the result. - Fixes []*Fix `json:"fixes,omitempty"` - - // An array of one or more unique 'graphTraversal' objects. - GraphTraversals []*GraphTraversal `json:"graphTraversals,omitempty"` - - // An array of zero or more unique graph objects associated with the result. - Graphs []*Graph `json:"graphs,omitempty"` - - // A stable, unique identifer for the result in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // An absolute URI at which the result can be viewed. - HostedViewerUri string `json:"hostedViewerUri,omitempty"` - - // A value that categorizes results by evaluation state. - Kind ResultKind `json:"kind,omitempty"` - - // A value specifying the severity level of the result. - Level ResultLevel `json:"level,omitempty"` - - // The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location. - Locations []*Location `json:"locations,omitempty"` - - // A message that describes the result. The first sentence of the message only will be displayed when visible space is limited. - Message *Message `json:"message"` - - // A positive integer specifying the number of times this logically unique result was observed in this run. - OccurrenceCount int `json:"occurrenceCount,omitempty"` - - // A set of strings that contribute to the stable, unique identity of the result. - PartialFingerprints map[string]string `json:"partialFingerprints,omitempty"` - - // Key/value pairs that provide additional information about the result. - Properties *PropertyBag `json:"properties,omitempty"` - - // Information about how and when the result was detected. - Provenance *ResultProvenance `json:"provenance,omitempty"` - - // A number representing the priority or importance of the result. - Rank float64 `json:"rank,omitempty"` - - // A set of locations relevant to this result. - RelatedLocations []*Location `json:"relatedLocations,omitempty"` - - // A reference used to locate the rule descriptor relevant to this result. - Rule *ReportingDescriptorReference `json:"rule,omitempty"` - - // The stable, unique identifier of the rule, if any, to which this result is relevant. - RuleId string `json:"ruleId,omitempty"` - - // The index within the tool component rules array of the rule object associated with this result. - RuleIndex int `json:"ruleIndex,omitempty"` - - // An array of 'stack' objects relevant to the result. - Stacks []*Stack `json:"stacks,omitempty"` - - // A set of suppressions relevant to this result. - Suppressions []*Suppression `json:"suppressions,omitempty"` - - // An array of references to taxonomy reporting descriptors that are applicable to the result. - Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` - - // A web request associated with this result. - WebRequest *WebRequest `json:"webRequest,omitempty"` - - // A web response associated with this result. - WebResponse *WebResponse `json:"webResponse,omitempty"` - - // The URIs of the work items associated with this result. - WorkItemUris []string `json:"workItemUris,omitempty"` -} - -// ResultProvenance Contains information about how and when a result was detected. -type ResultProvenance struct { - - // An array of physicalLocation objects which specify the portions of an analysis tool's output that a converter transformed into the result. - ConversionSources []*PhysicalLocation `json:"conversionSources,omitempty"` - - // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was first detected. - FirstDetectionRunGuid string `json:"firstDetectionRunGuid,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for the required format. - FirstDetectionTimeUtc string `json:"firstDetectionTimeUtc,omitempty"` - - // The index within the run.invocations array of the invocation object which describes the tool invocation that detected the result. - InvocationIndex int `json:"invocationIndex,omitempty"` - - // A GUID-valued string equal to the automationDetails.guid property of the run in which the result was most recently detected. - LastDetectionRunGuid string `json:"lastDetectionRunGuid,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF spec for the required format. - LastDetectionTimeUtc string `json:"lastDetectionTimeUtc,omitempty"` - - // Key/value pairs that provide additional information about the result. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Run Describes a single run of an analysis tool, and contains the reported output of that run. -type Run struct { - - // Addresses associated with this run instance, if any. - Addresses []*Address `json:"addresses,omitempty"` - - // An array of artifact objects relevant to the run. - Artifacts []*Artifact `json:"artifacts,omitempty"` - - // Automation details that describe this run. - AutomationDetails *RunAutomationDetails `json:"automationDetails,omitempty"` - - // The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for the run. - BaselineGuid string `json:"baselineGuid,omitempty"` - - // Specifies the unit in which the tool measures columns. - ColumnKind interface{} `json:"columnKind,omitempty"` - - // A conversion object that describes how a converter transformed an analysis tool's native reporting format into the SARIF format. - Conversion *Conversion `json:"conversion,omitempty"` - - // Specifies the default encoding for any artifact object that refers to a text file. - DefaultEncoding string `json:"defaultEncoding,omitempty"` - - // Specifies the default source language for any artifact object that refers to a text file that contains source code. - DefaultSourceLanguage string `json:"defaultSourceLanguage,omitempty"` - - // References to external property files that should be inlined with the content of a root log file. - ExternalPropertyFileReferences *ExternalPropertyFileReferences `json:"externalPropertyFileReferences,omitempty"` - - // An array of zero or more unique graph objects associated with the run. - Graphs []*Graph `json:"graphs,omitempty"` - - // Describes the invocation of the analysis tool. - Invocations []*Invocation `json:"invocations,omitempty"` - - // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - Language string `json:"language,omitempty"` - - // An array of logical locations such as namespaces, types or functions. - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` - - // An ordered list of character sequences that were treated as line breaks when computing region information for the run. - NewlineSequences []string `json:"newlineSequences,omitempty"` - - // The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. - OriginalUriBaseIds map[string]*ArtifactLocation `json:"originalUriBaseIds,omitempty"` - - // Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities established at run-time from the command line). - Policies []*ToolComponent `json:"policies,omitempty"` - - // Key/value pairs that provide additional information about the run. - Properties *PropertyBag `json:"properties,omitempty"` - - // An array of strings used to replace sensitive information in a redaction-aware property. - RedactionTokens []string `json:"redactionTokens,omitempty"` - - // The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan. - Results []*Result `json:"results,omitempty"` - - // Automation details that describe the aggregate of runs to which this run belongs. - RunAggregates []*RunAutomationDetails `json:"runAggregates,omitempty"` - - // A specialLocations object that defines locations of special significance to SARIF consumers. - SpecialLocations *SpecialLocations `json:"specialLocations,omitempty"` - - // An array of toolComponent objects relevant to a taxonomy in which results are categorized. - Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` - - // An array of threadFlowLocation objects cached at run level. - ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` - - // Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and the like) is identical for all aggregated files. - Tool *Tool `json:"tool"` - - // The set of available translations of the localized data provided by the tool. - Translations []*ToolComponent `json:"translations,omitempty"` - - // Specifies the revision in version control of the artifacts that were scanned. - VersionControlProvenance []*VersionControlDetails `json:"versionControlProvenance,omitempty"` - - // An array of request objects cached at run level. - WebRequests []*WebRequest `json:"webRequests,omitempty"` - - // An array of response objects cached at run level. - WebResponses []*WebResponse `json:"webResponses,omitempty"` -} - -// RunAutomationDetails Information that describes a run's identity and role within an engineering system process. -type RunAutomationDetails struct { - - // A stable, unique identifier for the equivalence class of runs to which this object's containing run object belongs in the form of a GUID. - CorrelationGuid string `json:"correlationGuid,omitempty"` - - // A description of the identity and role played within the engineering system by this object's containing run object. - Description *Message `json:"description,omitempty"` - - // A stable, unique identifer for this object's containing run object in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A hierarchical string that uniquely identifies this object's containing run object. - Id string `json:"id,omitempty"` - - // Key/value pairs that provide additional information about the run automation details. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// SpecialLocations Defines locations of special significance to SARIF consumers. -type SpecialLocations struct { - - // Provides a suggestion to SARIF consumers to display file paths relative to the specified location. - DisplayBase *ArtifactLocation `json:"displayBase,omitempty"` - - // Key/value pairs that provide additional information about the special locations. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// Stack A call stack that is relevant to a result. -type Stack struct { - - // An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. - Frames []*StackFrame `json:"frames"` - - // A message relevant to this call stack. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the stack. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// StackFrame A function call within a stack trace. -type StackFrame struct { - - // The location to which this stack frame refers. - Location *Location `json:"location,omitempty"` - - // The name of the module that contains the code of this stack frame. - Module string `json:"module,omitempty"` - - // The parameters of the call that is executing. - Parameters []string `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the stack frame. - Properties *PropertyBag `json:"properties,omitempty"` - - // The thread identifier of the stack frame. - ThreadId int `json:"threadId,omitempty"` -} - -// Suppression A suppression that is relevant to a result. -type Suppression struct { - - // A stable, unique identifer for the supression in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // A string representing the justification for the suppression. - Justification string `json:"justification,omitempty"` - - // A string that indicates where the suppression is persisted. - Kind string `json:"kind"` - - // Identifies the location associated with the suppression. - Location *Location `json:"location,omitempty"` - - // Key/value pairs that provide additional information about the suppression. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string that indicates the review status of the suppression. - Status interface{} `json:"status,omitempty"` -} - -// ThreadFlow Describes a sequence of code locations that specify a path through a single thread of execution such as an operating system or fiber. -type ThreadFlow struct { - - // An string that uniquely identifies the threadFlow within the codeFlow in which it occurs. - Id string `json:"id,omitempty"` - - // Values of relevant expressions at the start of the thread flow that remain constant. - ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` - - // Values of relevant expressions at the start of the thread flow that may change during thread flow execution. - InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` - - // A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result. - Locations []*ThreadFlowLocation `json:"locations"` - - // A message relevant to the thread flow. - Message *Message `json:"message,omitempty"` - - // Key/value pairs that provide additional information about the thread flow. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ThreadFlowLocation A location visited by an analysis tool while simulating or monitoring the execution of a program. -type ThreadFlowLocation struct { - - // An integer representing the temporal order in which execution reached this location. - ExecutionOrder int `json:"executionOrder,omitempty"` - - // The Coordinated Universal Time (UTC) date and time at which this location was executed. - ExecutionTimeUtc string `json:"executionTimeUtc,omitempty"` - - // Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is "essential", "important", "unimportant". Default: "important". - Importance interface{} `json:"importance,omitempty"` - - // The index within the run threadFlowLocations array. - Index int `json:"index,omitempty"` - - // A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', 'memory', 'resource', 'scope' and 'value'. - Kinds []string `json:"kinds,omitempty"` - - // The code location. - Location *Location `json:"location,omitempty"` - - // The name of the module that contains the code that is executing. - Module string `json:"module,omitempty"` - - // An integer representing a containment hierarchy within the thread flow. - NestingLevel int `json:"nestingLevel,omitempty"` - - // Key/value pairs that provide additional information about the threadflow location. - Properties *PropertyBag `json:"properties,omitempty"` - - // The call stack leading to this location. - Stack *Stack `json:"stack,omitempty"` - - // A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. - State map[string]*MultiformatMessageString `json:"state,omitempty"` - - // An array of references to rule or taxonomy reporting descriptors that are applicable to the thread flow location. - Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` - - // A web request associated with this thread flow location. - WebRequest *WebRequest `json:"webRequest,omitempty"` - - // A web response associated with this thread flow location. - WebResponse *WebResponse `json:"webResponse,omitempty"` -} - -// Tool The analysis tool that was run. -type Tool struct { - - // The analysis tool that was run. - Driver *ToolComponent `json:"driver"` - - // Tool extensions that contributed to or reconfigured the analysis tool that was run. - Extensions []*ToolComponent `json:"extensions,omitempty"` - - // Key/value pairs that provide additional information about the tool. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// ToolComponent A component, such as a plug-in or the driver, of the analysis tool that was run. -type ToolComponent struct { - - // The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's plugin model. - AssociatedComponent *ToolComponentReference `json:"associatedComponent,omitempty"` - - // The kinds of data contained in this object. - Contents []interface{} `json:"contents,omitempty"` - - // The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for operating systems that express file versions in this way). - DottedQuadFileVersion string `json:"dottedQuadFileVersion,omitempty"` - - // The absolute URI from which the tool component can be downloaded. - DownloadUri string `json:"downloadUri,omitempty"` - - // A comprehensive description of the tool component. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // The name of the tool component along with its version and any other useful identifying information, such as its locale. - FullName string `json:"fullName,omitempty"` - - // A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. - GlobalMessageStrings map[string]*MultiformatMessageString `json:"globalMessageStrings,omitempty"` - - // A unique identifer for the tool component in the form of a GUID. - Guid string `json:"guid,omitempty"` - - // The absolute URI at which information about this version of the tool component can be found. - InformationUri string `json:"informationUri,omitempty"` - - // Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to this log file. - IsComprehensive bool `json:"isComprehensive,omitempty"` - - // The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646). - Language string `json:"language,omitempty"` - - // The semantic version of the localized strings defined in this component; maintained by components that provide translations. - LocalizedDataSemanticVersion string `json:"localizedDataSemanticVersion,omitempty"` - - // An array of the artifactLocation objects associated with the tool component. - Locations []*ArtifactLocation `json:"locations,omitempty"` - - // The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that consume translations. - MinimumRequiredLocalizedDataSemanticVersion string `json:"minimumRequiredLocalizedDataSemanticVersion,omitempty"` - - // The name of the tool component. - Name string `json:"name"` - - // An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool component. - Notifications []*ReportingDescriptor `json:"notifications,omitempty"` - - // The organization or company that produced the tool component. - Organization string `json:"organization,omitempty"` - - // A product suite to which the tool component belongs. - Product string `json:"product,omitempty"` - - // A localizable string containing the name of the suite of products to which the tool component belongs. - ProductSuite string `json:"productSuite,omitempty"` - - // Key/value pairs that provide additional information about the tool component. - Properties *PropertyBag `json:"properties,omitempty"` - - // A string specifying the UTC date (and optionally, the time) of the component's release. - ReleaseDateUtc string `json:"releaseDateUtc,omitempty"` - - // An array of reportingDescriptor objects relevant to the analysis performed by the tool component. - Rules []*ReportingDescriptor `json:"rules,omitempty"` - - // The tool component version in the format specified by Semantic Versioning 2.0. - SemanticVersion string `json:"semanticVersion,omitempty"` - - // A brief description of the tool component. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` - - // An array of toolComponentReference objects to declare the taxonomies supported by the tool component. - SupportedTaxonomies []*ToolComponentReference `json:"supportedTaxonomies,omitempty"` - - // An array of reportingDescriptor objects relevant to the definitions of both standalone and tool-defined taxonomies. - Taxa []*ReportingDescriptor `json:"taxa,omitempty"` - - // Translation metadata, required for a translation, not populated by other component types. - TranslationMetadata *TranslationMetadata `json:"translationMetadata,omitempty"` - - // The tool component version, in whatever format the component natively provides. - Version string `json:"version,omitempty"` -} - -// ToolComponentReference Identifies a particular toolComponent object, either the driver or an extension. -type ToolComponentReference struct { - - // The 'guid' property of the referenced toolComponent. - Guid string `json:"guid,omitempty"` - - // An index into the referenced toolComponent in tool.extensions. - Index int `json:"index,omitempty"` - - // The 'name' property of the referenced toolComponent. - Name string `json:"name,omitempty"` - - // Key/value pairs that provide additional information about the toolComponentReference. - Properties *PropertyBag `json:"properties,omitempty"` -} - -// TranslationMetadata Provides additional metadata related to translation. -type TranslationMetadata struct { - - // The absolute URI from which the translation metadata can be downloaded. - DownloadUri string `json:"downloadUri,omitempty"` - - // A comprehensive description of the translation metadata. - FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` - - // The full name associated with the translation metadata. - FullName string `json:"fullName,omitempty"` - - // The absolute URI from which information related to the translation metadata can be downloaded. - InformationUri string `json:"informationUri,omitempty"` - - // The name associated with the translation metadata. - Name string `json:"name"` - - // Key/value pairs that provide additional information about the translation metadata. - Properties *PropertyBag `json:"properties,omitempty"` - - // A brief description of the translation metadata. - ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` -} - -// VersionControlDetails Specifies the information necessary to retrieve a desired revision from a version control system. -type VersionControlDetails struct { - - // A Coordinated Universal Time (UTC) date and time that can be used to synchronize an enlistment to the state of the repository at that time. - AsOfTimeUtc string `json:"asOfTimeUtc,omitempty"` - - // The name of a branch containing the revision. - Branch string `json:"branch,omitempty"` - - // The location in the local file system to which the root of the repository was mapped at the time of the analysis. - MappedTo *ArtifactLocation `json:"mappedTo,omitempty"` - - // Key/value pairs that provide additional information about the version control details. - Properties *PropertyBag `json:"properties,omitempty"` - - // The absolute URI of the repository. - RepositoryUri string `json:"repositoryUri"` - - // A string that uniquely and permanently identifies the revision within the repository. - RevisionId string `json:"revisionId,omitempty"` - - // A tag that has been applied to the revision. - RevisionTag string `json:"revisionTag,omitempty"` -} - -// WebRequest Describes an HTTP request. -type WebRequest struct { - - // The body of the request. - Body *ArtifactContent `json:"body,omitempty"` - - // The request headers. - Headers map[string]string `json:"headers,omitempty"` - - // The index within the run.webRequests array of the request object associated with this result. - Index int `json:"index,omitempty"` - - // The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. - Method string `json:"method,omitempty"` - - // The request parameters. - Parameters map[string]string `json:"parameters,omitempty"` - - // Key/value pairs that provide additional information about the request. - Properties *PropertyBag `json:"properties,omitempty"` - - // The request protocol. Example: 'http'. - Protocol string `json:"protocol,omitempty"` - - // The target of the request. - Target string `json:"target,omitempty"` - - // The request version. Example: '1.1'. - Version string `json:"version,omitempty"` -} - -// WebResponse Describes the response to an HTTP request. -type WebResponse struct { - - // The body of the response. - Body *ArtifactContent `json:"body,omitempty"` - - // The response headers. - Headers map[string]string `json:"headers,omitempty"` - - // The index within the run.webResponses array of the response object associated with this result. - Index int `json:"index,omitempty"` - - // Specifies whether a response was received from the server. - NoResponseReceived bool `json:"noResponseReceived,omitempty"` - - // Key/value pairs that provide additional information about the response. - Properties *PropertyBag `json:"properties,omitempty"` - - // The response protocol. Example: 'http'. - Protocol string `json:"protocol,omitempty"` - - // The response reason. Example: 'Not found'. - ReasonPhrase string `json:"reasonPhrase,omitempty"` - - // The response status code. Example: 451. - StatusCode int `json:"statusCode,omitempty"` - - // The response version. Example: '1.1'. - Version string `json:"version,omitempty"` -} diff --git a/vendor/github.com/cloudflare/circl/LICENSE b/vendor/github.com/cloudflare/circl/LICENSE deleted file mode 100644 index 67edaa90a0..0000000000 --- a/vendor/github.com/cloudflare/circl/LICENSE +++ /dev/null @@ -1,57 +0,0 @@ -Copyright (c) 2019 Cloudflare. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Cloudflare nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -======================================================================== - -Copyright (c) 2009 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve.go deleted file mode 100644 index f9057c2b86..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve.go +++ /dev/null @@ -1,96 +0,0 @@ -package x25519 - -import ( - fp "github.com/cloudflare/circl/math/fp25519" -) - -// ladderJoye calculates a fixed-point multiplication with the generator point. -// The algorithm is the right-to-left Joye's ladder as described -// in "How to precompute a ladder" in SAC'2017. -func ladderJoye(k *Key) { - w := [5]fp.Elt{} // [mu,x1,z1,x2,z2] order must be preserved. - fp.SetOne(&w[1]) // x1 = 1 - fp.SetOne(&w[2]) // z1 = 1 - w[3] = fp.Elt{ // x2 = G-S - 0xbd, 0xaa, 0x2f, 0xc8, 0xfe, 0xe1, 0x94, 0x7e, - 0xf8, 0xed, 0xb2, 0x14, 0xae, 0x95, 0xf0, 0xbb, - 0xe2, 0x48, 0x5d, 0x23, 0xb9, 0xa0, 0xc7, 0xad, - 0x34, 0xab, 0x7c, 0xe2, 0xee, 0xcd, 0xae, 0x1e, - } - fp.SetOne(&w[4]) // z2 = 1 - - const n = 255 - const h = 3 - swap := uint(1) - for s := 0; s < n-h; s++ { - i := (s + h) / 8 - j := (s + h) % 8 - bit := uint((k[i] >> uint(j)) & 1) - copy(w[0][:], tableGenerator[s*Size:(s+1)*Size]) - diffAdd(&w, swap^bit) - swap = bit - } - for s := 0; s < h; s++ { - double(&w[1], &w[2]) - } - toAffine((*[fp.Size]byte)(k), &w[1], &w[2]) -} - -// ladderMontgomery calculates a generic scalar point multiplication -// The algorithm implemented is the left-to-right Montgomery's ladder. -func ladderMontgomery(k, xP *Key) { - w := [5]fp.Elt{} // [x1, x2, z2, x3, z3] order must be preserved. - w[0] = *(*fp.Elt)(xP) // x1 = xP - fp.SetOne(&w[1]) // x2 = 1 - w[3] = *(*fp.Elt)(xP) // x3 = xP - fp.SetOne(&w[4]) // z3 = 1 - - move := uint(0) - for s := 255 - 1; s >= 0; s-- { - i := s / 8 - j := s % 8 - bit := uint((k[i] >> uint(j)) & 1) - ladderStep(&w, move^bit) - move = bit - } - toAffine((*[fp.Size]byte)(k), &w[1], &w[2]) -} - -func toAffine(k *[fp.Size]byte, x, z *fp.Elt) { - fp.Inv(z, z) - fp.Mul(x, x, z) - _ = fp.ToBytes(k[:], x) -} - -var lowOrderPoints = [5]fp.Elt{ - { /* (0,_,1) point of order 2 on Curve25519 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { /* (1,_,1) point of order 4 on Curve25519 */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { /* (x,_,1) first point of order 8 on Curve25519 */ - 0xe0, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae, - 0x16, 0x56, 0xe3, 0xfa, 0xf1, 0x9f, 0xc4, 0x6a, - 0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd, - 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00, - }, - { /* (x,_,1) second point of order 8 on Curve25519 */ - 0x5f, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24, - 0xb1, 0xd0, 0xb1, 0x55, 0x9c, 0x83, 0xef, 0x5b, - 0x04, 0x44, 0x5c, 0xc4, 0x58, 0x1c, 0x8e, 0x86, - 0xd8, 0x22, 0x4e, 0xdd, 0xd0, 0x9f, 0x11, 0x57, - }, - { /* (-1,_,1) a point of order 4 on the twist of Curve25519 */ - 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, - }, -} diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go deleted file mode 100644 index 8a3d54c570..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build amd64 && !purego -// +build amd64,!purego - -package x25519 - -import ( - fp "github.com/cloudflare/circl/math/fp25519" - "golang.org/x/sys/cpu" -) - -var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX - -var _ = hasBmi2Adx - -func double(x, z *fp.Elt) { doubleAmd64(x, z) } -func diffAdd(w *[5]fp.Elt, b uint) { diffAddAmd64(w, b) } -func ladderStep(w *[5]fp.Elt, b uint) { ladderStepAmd64(w, b) } -func mulA24(z, x *fp.Elt) { mulA24Amd64(z, x) } - -//go:noescape -func ladderStepAmd64(w *[5]fp.Elt, b uint) - -//go:noescape -func diffAddAmd64(w *[5]fp.Elt, b uint) - -//go:noescape -func doubleAmd64(x, z *fp.Elt) - -//go:noescape -func mulA24Amd64(z, x *fp.Elt) diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h deleted file mode 100644 index 8c1ae4d0fb..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.h +++ /dev/null @@ -1,111 +0,0 @@ -#define ladderStepLeg \ - addSub(x2,z2) \ - addSub(x3,z3) \ - integerMulLeg(b0,x2,z3) \ - integerMulLeg(b1,x3,z2) \ - reduceFromDoubleLeg(t0,b0) \ - reduceFromDoubleLeg(t1,b1) \ - addSub(t0,t1) \ - cselect(x2,x3,regMove) \ - cselect(z2,z3,regMove) \ - integerSqrLeg(b0,t0) \ - integerSqrLeg(b1,t1) \ - reduceFromDoubleLeg(x3,b0) \ - reduceFromDoubleLeg(z3,b1) \ - integerMulLeg(b0,x1,z3) \ - reduceFromDoubleLeg(z3,b0) \ - integerSqrLeg(b0,x2) \ - integerSqrLeg(b1,z2) \ - reduceFromDoubleLeg(x2,b0) \ - reduceFromDoubleLeg(z2,b1) \ - subtraction(t0,x2,z2) \ - multiplyA24Leg(t1,t0) \ - additionLeg(t1,t1,z2) \ - integerMulLeg(b0,x2,z2) \ - integerMulLeg(b1,t0,t1) \ - reduceFromDoubleLeg(x2,b0) \ - reduceFromDoubleLeg(z2,b1) - -#define ladderStepBmi2Adx \ - addSub(x2,z2) \ - addSub(x3,z3) \ - integerMulAdx(b0,x2,z3) \ - integerMulAdx(b1,x3,z2) \ - reduceFromDoubleAdx(t0,b0) \ - reduceFromDoubleAdx(t1,b1) \ - addSub(t0,t1) \ - cselect(x2,x3,regMove) \ - cselect(z2,z3,regMove) \ - integerSqrAdx(b0,t0) \ - integerSqrAdx(b1,t1) \ - reduceFromDoubleAdx(x3,b0) \ - reduceFromDoubleAdx(z3,b1) \ - integerMulAdx(b0,x1,z3) \ - reduceFromDoubleAdx(z3,b0) \ - integerSqrAdx(b0,x2) \ - integerSqrAdx(b1,z2) \ - reduceFromDoubleAdx(x2,b0) \ - reduceFromDoubleAdx(z2,b1) \ - subtraction(t0,x2,z2) \ - multiplyA24Adx(t1,t0) \ - additionAdx(t1,t1,z2) \ - integerMulAdx(b0,x2,z2) \ - integerMulAdx(b1,t0,t1) \ - reduceFromDoubleAdx(x2,b0) \ - reduceFromDoubleAdx(z2,b1) - -#define difAddLeg \ - addSub(x1,z1) \ - integerMulLeg(b0,z1,ui) \ - reduceFromDoubleLeg(z1,b0) \ - addSub(x1,z1) \ - integerSqrLeg(b0,x1) \ - integerSqrLeg(b1,z1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) \ - integerMulLeg(b0,x1,z2) \ - integerMulLeg(b1,z1,x2) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) - -#define difAddBmi2Adx \ - addSub(x1,z1) \ - integerMulAdx(b0,z1,ui) \ - reduceFromDoubleAdx(z1,b0) \ - addSub(x1,z1) \ - integerSqrAdx(b0,x1) \ - integerSqrAdx(b1,z1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) \ - integerMulAdx(b0,x1,z2) \ - integerMulAdx(b1,z1,x2) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) - -#define doubleLeg \ - addSub(x1,z1) \ - integerSqrLeg(b0,x1) \ - integerSqrLeg(b1,z1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) \ - subtraction(t0,x1,z1) \ - multiplyA24Leg(t1,t0) \ - additionLeg(t1,t1,z1) \ - integerMulLeg(b0,x1,z1) \ - integerMulLeg(b1,t0,t1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) - -#define doubleBmi2Adx \ - addSub(x1,z1) \ - integerSqrAdx(b0,x1) \ - integerSqrAdx(b1,z1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) \ - subtraction(t0,x1,z1) \ - multiplyA24Adx(t1,t0) \ - additionAdx(t1,t1,z1) \ - integerMulAdx(b0,x1,z1) \ - integerMulAdx(b1,t0,t1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s b/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s deleted file mode 100644 index b7723185b6..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve_amd64.s +++ /dev/null @@ -1,156 +0,0 @@ -// +build amd64 - -#include "textflag.h" - -// Depends on circl/math/fp25519 package -#include "../../math/fp25519/fp_amd64.h" -#include "curve_amd64.h" - -// CTE_A24 is (A+2)/4 from Curve25519 -#define CTE_A24 121666 - -#define Size 32 - -// multiplyA24Leg multiplies x times CTE_A24 and stores in z -// Uses: AX, DX, R8-R13, FLAGS -// Instr: x86_64, cmov -#define multiplyA24Leg(z,x) \ - MOVL $CTE_A24, AX; MULQ 0+x; MOVQ AX, R8; MOVQ DX, R9; \ - MOVL $CTE_A24, AX; MULQ 8+x; MOVQ AX, R12; MOVQ DX, R10; \ - MOVL $CTE_A24, AX; MULQ 16+x; MOVQ AX, R13; MOVQ DX, R11; \ - MOVL $CTE_A24, AX; MULQ 24+x; \ - ADDQ R12, R9; \ - ADCQ R13, R10; \ - ADCQ AX, R11; \ - ADCQ $0, DX; \ - MOVL $38, AX; /* 2*C = 38 = 2^256 MOD 2^255-19*/ \ - IMULQ AX, DX; \ - ADDQ DX, R8; \ - ADCQ $0, R9; MOVQ R9, 8+z; \ - ADCQ $0, R10; MOVQ R10, 16+z; \ - ADCQ $0, R11; MOVQ R11, 24+z; \ - MOVQ $0, DX; \ - CMOVQCS AX, DX; \ - ADDQ DX, R8; MOVQ R8, 0+z; - -// multiplyA24Adx multiplies x times CTE_A24 and stores in z -// Uses: AX, DX, R8-R12, FLAGS -// Instr: x86_64, cmov, bmi2 -#define multiplyA24Adx(z,x) \ - MOVQ $CTE_A24, DX; \ - MULXQ 0+x, R8, R10; \ - MULXQ 8+x, R9, R11; ADDQ R10, R9; \ - MULXQ 16+x, R10, AX; ADCQ R11, R10; \ - MULXQ 24+x, R11, R12; ADCQ AX, R11; \ - ;;;;;;;;;;;;;;;;;;;;; ADCQ $0, R12; \ - MOVL $38, DX; /* 2*C = 38 = 2^256 MOD 2^255-19*/ \ - IMULQ DX, R12; \ - ADDQ R12, R8; \ - ADCQ $0, R9; MOVQ R9, 8+z; \ - ADCQ $0, R10; MOVQ R10, 16+z; \ - ADCQ $0, R11; MOVQ R11, 24+z; \ - MOVQ $0, R12; \ - CMOVQCS DX, R12; \ - ADDQ R12, R8; MOVQ R8, 0+z; - -#define mulA24Legacy \ - multiplyA24Leg(0(DI),0(SI)) -#define mulA24Bmi2Adx \ - multiplyA24Adx(0(DI),0(SI)) - -// func mulA24Amd64(z, x *fp255.Elt) -TEXT ·mulA24Amd64(SB),NOSPLIT,$0-16 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - CHECK_BMI2ADX(LMA24, mulA24Legacy, mulA24Bmi2Adx) - - -// func ladderStepAmd64(w *[5]fp255.Elt, b uint) -// ladderStepAmd64 calculates a point addition and doubling as follows: -// (x2,z2) = 2*(x2,z2) and (x3,z3) = (x2,z2)+(x3,z3) using as a difference (x1,-). -// work = (x1,x2,z2,x3,z3) are five fp255.Elt of 32 bytes. -// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and -// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -TEXT ·ladderStepAmd64(SB),NOSPLIT,$192-16 - // Parameters - #define regWork DI - #define regMove SI - #define x1 0*Size(regWork) - #define x2 1*Size(regWork) - #define z2 2*Size(regWork) - #define x3 3*Size(regWork) - #define z3 4*Size(regWork) - // Local variables - #define t0 0*Size(SP) - #define t1 1*Size(SP) - #define b0 2*Size(SP) - #define b1 4*Size(SP) - MOVQ w+0(FP), regWork - MOVQ b+8(FP), regMove - CHECK_BMI2ADX(LLADSTEP, ladderStepLeg, ladderStepBmi2Adx) - #undef regWork - #undef regMove - #undef x1 - #undef x2 - #undef z2 - #undef x3 - #undef z3 - #undef t0 - #undef t1 - #undef b0 - #undef b1 - -// func diffAddAmd64(w *[5]fp255.Elt, b uint) -// diffAddAmd64 calculates a differential point addition using a precomputed point. -// (x1,z1) = (x1,z1)+(mu) using a difference point (x2,z2) -// w = (mu,x1,z1,x2,z2) are five fp.Elt, and -// stack = (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -TEXT ·diffAddAmd64(SB),NOSPLIT,$128-16 - // Parameters - #define regWork DI - #define regSwap SI - #define ui 0*Size(regWork) - #define x1 1*Size(regWork) - #define z1 2*Size(regWork) - #define x2 3*Size(regWork) - #define z2 4*Size(regWork) - // Local variables - #define b0 0*Size(SP) - #define b1 2*Size(SP) - MOVQ w+0(FP), regWork - MOVQ b+8(FP), regSwap - cswap(x1,x2,regSwap) - cswap(z1,z2,regSwap) - CHECK_BMI2ADX(LDIFADD, difAddLeg, difAddBmi2Adx) - #undef regWork - #undef regSwap - #undef ui - #undef x1 - #undef z1 - #undef x2 - #undef z2 - #undef b0 - #undef b1 - -// func doubleAmd64(x, z *fp255.Elt) -// doubleAmd64 calculates a point doubling (x1,z1) = 2*(x1,z1). -// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and -// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -TEXT ·doubleAmd64(SB),NOSPLIT,$192-16 - // Parameters - #define x1 0(DI) - #define z1 0(SI) - // Local variables - #define t0 0*Size(SP) - #define t1 1*Size(SP) - #define b0 2*Size(SP) - #define b1 4*Size(SP) - MOVQ x+0(FP), DI - MOVQ z+8(FP), SI - CHECK_BMI2ADX(LDOUB,doubleLeg,doubleBmi2Adx) - #undef x1 - #undef z1 - #undef t0 - #undef t1 - #undef b0 - #undef b1 diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go deleted file mode 100644 index dae67ea37d..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve_generic.go +++ /dev/null @@ -1,85 +0,0 @@ -package x25519 - -import ( - "encoding/binary" - "math/bits" - - fp "github.com/cloudflare/circl/math/fp25519" -) - -func doubleGeneric(x, z *fp.Elt) { - t0, t1 := &fp.Elt{}, &fp.Elt{} - fp.AddSub(x, z) - fp.Sqr(x, x) - fp.Sqr(z, z) - fp.Sub(t0, x, z) - mulA24Generic(t1, t0) - fp.Add(t1, t1, z) - fp.Mul(x, x, z) - fp.Mul(z, t0, t1) -} - -func diffAddGeneric(w *[5]fp.Elt, b uint) { - mu, x1, z1, x2, z2 := &w[0], &w[1], &w[2], &w[3], &w[4] - fp.Cswap(x1, x2, b) - fp.Cswap(z1, z2, b) - fp.AddSub(x1, z1) - fp.Mul(z1, z1, mu) - fp.AddSub(x1, z1) - fp.Sqr(x1, x1) - fp.Sqr(z1, z1) - fp.Mul(x1, x1, z2) - fp.Mul(z1, z1, x2) -} - -func ladderStepGeneric(w *[5]fp.Elt, b uint) { - x1, x2, z2, x3, z3 := &w[0], &w[1], &w[2], &w[3], &w[4] - t0 := &fp.Elt{} - t1 := &fp.Elt{} - fp.AddSub(x2, z2) - fp.AddSub(x3, z3) - fp.Mul(t0, x2, z3) - fp.Mul(t1, x3, z2) - fp.AddSub(t0, t1) - fp.Cmov(x2, x3, b) - fp.Cmov(z2, z3, b) - fp.Sqr(x3, t0) - fp.Sqr(z3, t1) - fp.Mul(z3, x1, z3) - fp.Sqr(x2, x2) - fp.Sqr(z2, z2) - fp.Sub(t0, x2, z2) - mulA24Generic(t1, t0) - fp.Add(t1, t1, z2) - fp.Mul(x2, x2, z2) - fp.Mul(z2, t0, t1) -} - -func mulA24Generic(z, x *fp.Elt) { - const A24 = 121666 - const n = 8 - var xx [4]uint64 - for i := range xx { - xx[i] = binary.LittleEndian.Uint64(x[i*n : (i+1)*n]) - } - - h0, l0 := bits.Mul64(xx[0], A24) - h1, l1 := bits.Mul64(xx[1], A24) - h2, l2 := bits.Mul64(xx[2], A24) - h3, l3 := bits.Mul64(xx[3], A24) - - var c3 uint64 - l1, c0 := bits.Add64(h0, l1, 0) - l2, c1 := bits.Add64(h1, l2, c0) - l3, c2 := bits.Add64(h2, l3, c1) - l4, _ := bits.Add64(h3, 0, c2) - _, l4 = bits.Mul64(l4, 38) - l0, c0 = bits.Add64(l0, l4, 0) - xx[1], c1 = bits.Add64(l1, 0, c0) - xx[2], c2 = bits.Add64(l2, 0, c1) - xx[3], c3 = bits.Add64(l3, 0, c2) - xx[0], _ = bits.Add64(l0, (-c3)&38, 0) - for i := range xx { - binary.LittleEndian.PutUint64(z[i*n:(i+1)*n], xx[i]) - } -} diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go b/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go deleted file mode 100644 index 07fab97d2a..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/curve_noasm.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build !amd64 || purego -// +build !amd64 purego - -package x25519 - -import fp "github.com/cloudflare/circl/math/fp25519" - -func double(x, z *fp.Elt) { doubleGeneric(x, z) } -func diffAdd(w *[5]fp.Elt, b uint) { diffAddGeneric(w, b) } -func ladderStep(w *[5]fp.Elt, b uint) { ladderStepGeneric(w, b) } -func mulA24(z, x *fp.Elt) { mulA24Generic(z, x) } diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/doc.go b/vendor/github.com/cloudflare/circl/dh/x25519/doc.go deleted file mode 100644 index 3ce102d145..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Package x25519 provides Diffie-Hellman functions as specified in RFC-7748. - -Validation of public keys. - -The Diffie-Hellman function, as described in RFC-7748 [1], works for any -public key. However, if a different protocol requires contributory -behaviour [2,3], then the public keys must be validated against low-order -points [3,4]. To do that, the Shared function performs this validation -internally and returns false when the public key is invalid (i.e., it -is a low-order point). - -References: - - [1] RFC7748 by Langley, Hamburg, Turner (https://rfc-editor.org/rfc/rfc7748.txt) - - [2] Curve25519 by Bernstein (https://cr.yp.to/ecdh.html) - - [3] Bernstein (https://cr.yp.to/ecdh.html#validate) - - [4] Cremers&Jackson (https://eprint.iacr.org/2019/526) -*/ -package x25519 diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/key.go b/vendor/github.com/cloudflare/circl/dh/x25519/key.go deleted file mode 100644 index c76f72ac7f..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/key.go +++ /dev/null @@ -1,47 +0,0 @@ -package x25519 - -import ( - "crypto/subtle" - - fp "github.com/cloudflare/circl/math/fp25519" -) - -// Size is the length in bytes of a X25519 key. -const Size = 32 - -// Key represents a X25519 key. -type Key [Size]byte - -func (k *Key) clamp(in *Key) *Key { - *k = *in - k[0] &= 248 - k[31] = (k[31] & 127) | 64 - return k -} - -// isValidPubKey verifies if the public key is not a low-order point. -func (k *Key) isValidPubKey() bool { - fp.Modp((*fp.Elt)(k)) - var isLowOrder int - for _, P := range lowOrderPoints { - isLowOrder |= subtle.ConstantTimeCompare(P[:], k[:]) - } - return isLowOrder == 0 -} - -// KeyGen obtains a public key given a secret key. -func KeyGen(public, secret *Key) { - ladderJoye(public.clamp(secret)) -} - -// Shared calculates Alice's shared key from Alice's secret key and Bob's -// public key returning true on success. A failure case happens when the public -// key is a low-order point, thus the shared key is all-zeros and the function -// returns false. -func Shared(shared, secret, public *Key) bool { - validPk := *public - validPk[31] &= (1 << (255 % 8)) - 1 - ok := validPk.isValidPubKey() - ladderMontgomery(shared.clamp(secret), &validPk) - return ok -} diff --git a/vendor/github.com/cloudflare/circl/dh/x25519/table.go b/vendor/github.com/cloudflare/circl/dh/x25519/table.go deleted file mode 100644 index 28c8c4ac03..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x25519/table.go +++ /dev/null @@ -1,268 +0,0 @@ -package x25519 - -import "github.com/cloudflare/circl/math/fp25519" - -// tableGenerator contains the set of points: -// -// t[i] = (xi+1)/(xi-1), -// -// where (xi,yi) = 2^iG and G is the generator point -// Size = (256)*(256/8) = 8192 bytes. -var tableGenerator = [256 * fp25519.Size]byte{ - /* (2^ 0)P */ 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5f, - /* (2^ 1)P */ 0x96, 0xfe, 0xaa, 0x16, 0xf4, 0x20, 0x82, 0x6b, 0x34, 0x6a, 0x56, 0x4f, 0x2b, 0xeb, 0xeb, 0x82, 0x0f, 0x95, 0xa5, 0x75, 0xb0, 0xa5, 0xa9, 0xd5, 0xf4, 0x88, 0x24, 0x4b, 0xcf, 0xb2, 0x42, 0x51, - /* (2^ 2)P */ 0x0c, 0x68, 0x69, 0x00, 0x75, 0xbc, 0xae, 0x6a, 0x41, 0x9c, 0xf9, 0xa0, 0x20, 0x78, 0xcf, 0x89, 0xf4, 0xd0, 0x56, 0x3b, 0x18, 0xd9, 0x58, 0x2a, 0xa4, 0x11, 0x60, 0xe3, 0x80, 0xca, 0x5a, 0x4b, - /* (2^ 3)P */ 0x5d, 0x74, 0x29, 0x8c, 0x34, 0x32, 0x91, 0x32, 0xd7, 0x2f, 0x64, 0xe1, 0x16, 0xe6, 0xa2, 0xf4, 0x34, 0xbc, 0x67, 0xff, 0x03, 0xbb, 0x45, 0x1e, 0x4a, 0x9b, 0x2a, 0xf4, 0xd0, 0x12, 0x69, 0x30, - /* (2^ 4)P */ 0x54, 0x71, 0xaf, 0xe6, 0x07, 0x65, 0x88, 0xff, 0x2f, 0xc8, 0xee, 0xdf, 0x13, 0x0e, 0xf5, 0x04, 0xce, 0xb5, 0xba, 0x2a, 0xe8, 0x2f, 0x51, 0xaa, 0x22, 0xf2, 0xd5, 0x68, 0x1a, 0x25, 0x4e, 0x17, - /* (2^ 5)P */ 0x98, 0x88, 0x02, 0x82, 0x0d, 0x70, 0x96, 0xcf, 0xc5, 0x02, 0x2c, 0x0a, 0x37, 0xe3, 0x43, 0x17, 0xaa, 0x6e, 0xe8, 0xb4, 0x98, 0xec, 0x9e, 0x37, 0x2e, 0x48, 0xe0, 0x51, 0x8a, 0x88, 0x59, 0x0c, - /* (2^ 6)P */ 0x89, 0xd1, 0xb5, 0x99, 0xd6, 0xf1, 0xcb, 0xfb, 0x84, 0xdc, 0x9f, 0x8e, 0xd5, 0xf0, 0xae, 0xac, 0x14, 0x76, 0x1f, 0x23, 0x06, 0x0d, 0xc2, 0xc1, 0x72, 0xf9, 0x74, 0xa2, 0x8d, 0x21, 0x38, 0x29, - /* (2^ 7)P */ 0x18, 0x7f, 0x1d, 0xff, 0xbe, 0x49, 0xaf, 0xf6, 0xc2, 0xc9, 0x7a, 0x38, 0x22, 0x1c, 0x54, 0xcc, 0x6b, 0xc5, 0x15, 0x40, 0xef, 0xc9, 0xfc, 0x96, 0xa9, 0x13, 0x09, 0x69, 0x7c, 0x62, 0xc1, 0x69, - /* (2^ 8)P */ 0x0e, 0xdb, 0x33, 0x47, 0x2f, 0xfd, 0x86, 0x7a, 0xe9, 0x7d, 0x08, 0x9e, 0xf2, 0xc4, 0xb8, 0xfd, 0x29, 0xa2, 0xa2, 0x8e, 0x1a, 0x4b, 0x5e, 0x09, 0x79, 0x7a, 0xb3, 0x29, 0xc8, 0xa7, 0xd7, 0x1a, - /* (2^ 9)P */ 0xc0, 0xa0, 0x7e, 0xd1, 0xca, 0x89, 0x2d, 0x34, 0x51, 0x20, 0xed, 0xcc, 0xa6, 0xdd, 0xbe, 0x67, 0x74, 0x2f, 0xb4, 0x2b, 0xbf, 0x31, 0xca, 0x19, 0xbb, 0xac, 0x80, 0x49, 0xc8, 0xb4, 0xf7, 0x3d, - /* (2^ 10)P */ 0x83, 0xd8, 0x0a, 0xc8, 0x4d, 0x44, 0xc6, 0xa8, 0x85, 0xab, 0xe3, 0x66, 0x03, 0x44, 0x1e, 0xb9, 0xd8, 0xf6, 0x64, 0x01, 0xa0, 0xcd, 0x15, 0xc2, 0x68, 0xe6, 0x47, 0xf2, 0x6e, 0x7c, 0x86, 0x3d, - /* (2^ 11)P */ 0x8c, 0x65, 0x3e, 0xcc, 0x2b, 0x58, 0xdd, 0xc7, 0x28, 0x55, 0x0e, 0xee, 0x48, 0x47, 0x2c, 0xfd, 0x71, 0x4f, 0x9f, 0xcc, 0x95, 0x9b, 0xfd, 0xa0, 0xdf, 0x5d, 0x67, 0xb0, 0x71, 0xd8, 0x29, 0x75, - /* (2^ 12)P */ 0x78, 0xbd, 0x3c, 0x2d, 0xb4, 0x68, 0xf5, 0xb8, 0x82, 0xda, 0xf3, 0x91, 0x1b, 0x01, 0x33, 0x12, 0x62, 0x3b, 0x7c, 0x4a, 0xcd, 0x6c, 0xce, 0x2d, 0x03, 0x86, 0x49, 0x9e, 0x8e, 0xfc, 0xe7, 0x75, - /* (2^ 13)P */ 0xec, 0xb6, 0xd0, 0xfc, 0xf1, 0x13, 0x4f, 0x2f, 0x45, 0x7a, 0xff, 0x29, 0x1f, 0xca, 0xa8, 0xf1, 0x9b, 0xe2, 0x81, 0x29, 0xa7, 0xc1, 0x49, 0xc2, 0x6a, 0xb5, 0x83, 0x8c, 0xbb, 0x0d, 0xbe, 0x6e, - /* (2^ 14)P */ 0x22, 0xb2, 0x0b, 0x17, 0x8d, 0xfa, 0x14, 0x71, 0x5f, 0x93, 0x93, 0xbf, 0xd5, 0xdc, 0xa2, 0x65, 0x9a, 0x97, 0x9c, 0xb5, 0x68, 0x1f, 0xc4, 0xbd, 0x89, 0x92, 0xce, 0xa2, 0x79, 0xef, 0x0e, 0x2f, - /* (2^ 15)P */ 0xce, 0x37, 0x3c, 0x08, 0x0c, 0xbf, 0xec, 0x42, 0x22, 0x63, 0x49, 0xec, 0x09, 0xbc, 0x30, 0x29, 0x0d, 0xac, 0xfe, 0x9c, 0xc1, 0xb0, 0x94, 0xf2, 0x80, 0xbb, 0xfa, 0xed, 0x4b, 0xaa, 0x80, 0x37, - /* (2^ 16)P */ 0x29, 0xd9, 0xea, 0x7c, 0x3e, 0x7d, 0xc1, 0x56, 0xc5, 0x22, 0x57, 0x2e, 0xeb, 0x4b, 0xcb, 0xe7, 0x5a, 0xe1, 0xbf, 0x2d, 0x73, 0x31, 0xe9, 0x0c, 0xf8, 0x52, 0x10, 0x62, 0xc7, 0x83, 0xb8, 0x41, - /* (2^ 17)P */ 0x50, 0x53, 0xd2, 0xc3, 0xa0, 0x5c, 0xf7, 0xdb, 0x51, 0xe3, 0xb1, 0x6e, 0x08, 0xbe, 0x36, 0x29, 0x12, 0xb2, 0xa9, 0xb4, 0x3c, 0xe0, 0x36, 0xc9, 0xaa, 0x25, 0x22, 0x32, 0x82, 0xbf, 0x45, 0x1d, - /* (2^ 18)P */ 0xc5, 0x4c, 0x02, 0x6a, 0x03, 0xb1, 0x1a, 0xe8, 0x72, 0x9a, 0x4c, 0x30, 0x1c, 0x20, 0x12, 0xe2, 0xfc, 0xb1, 0x32, 0x68, 0xba, 0x3f, 0xd7, 0xc5, 0x81, 0x95, 0x83, 0x4d, 0x5a, 0xdb, 0xff, 0x20, - /* (2^ 19)P */ 0xad, 0x0f, 0x5d, 0xbe, 0x67, 0xd3, 0x83, 0xa2, 0x75, 0x44, 0x16, 0x8b, 0xca, 0x25, 0x2b, 0x6c, 0x2e, 0xf2, 0xaa, 0x7c, 0x46, 0x35, 0x49, 0x9d, 0x49, 0xff, 0x85, 0xee, 0x8e, 0x40, 0x66, 0x51, - /* (2^ 20)P */ 0x61, 0xe3, 0xb4, 0xfa, 0xa2, 0xba, 0x67, 0x3c, 0xef, 0x5c, 0xf3, 0x7e, 0xc6, 0x33, 0xe4, 0xb3, 0x1c, 0x9b, 0x15, 0x41, 0x92, 0x72, 0x59, 0x52, 0x33, 0xab, 0xb0, 0xd5, 0x92, 0x18, 0x62, 0x6a, - /* (2^ 21)P */ 0xcb, 0xcd, 0x55, 0x75, 0x38, 0x4a, 0xb7, 0x20, 0x3f, 0x92, 0x08, 0x12, 0x0e, 0xa1, 0x2a, 0x53, 0xd1, 0x1d, 0x28, 0x62, 0x77, 0x7b, 0xa1, 0xea, 0xbf, 0x44, 0x5c, 0xf0, 0x43, 0x34, 0xab, 0x61, - /* (2^ 22)P */ 0xf8, 0xde, 0x24, 0x23, 0x42, 0x6c, 0x7a, 0x25, 0x7f, 0xcf, 0xe3, 0x17, 0x10, 0x6c, 0x1c, 0x13, 0x57, 0xa2, 0x30, 0xf6, 0x39, 0x87, 0x75, 0x23, 0x80, 0x85, 0xa7, 0x01, 0x7a, 0x40, 0x5a, 0x29, - /* (2^ 23)P */ 0xd9, 0xa8, 0x5d, 0x6d, 0x24, 0x43, 0xc4, 0xf8, 0x5d, 0xfa, 0x52, 0x0c, 0x45, 0x75, 0xd7, 0x19, 0x3d, 0xf8, 0x1b, 0x73, 0x92, 0xfc, 0xfc, 0x2a, 0x00, 0x47, 0x2b, 0x1b, 0xe8, 0xc8, 0x10, 0x7d, - /* (2^ 24)P */ 0x0b, 0xa2, 0xba, 0x70, 0x1f, 0x27, 0xe0, 0xc8, 0x57, 0x39, 0xa6, 0x7c, 0x86, 0x48, 0x37, 0x99, 0xbb, 0xd4, 0x7e, 0xcb, 0xb3, 0xef, 0x12, 0x54, 0x75, 0x29, 0xe6, 0x73, 0x61, 0xd3, 0x96, 0x31, - /* (2^ 25)P */ 0xfc, 0xdf, 0xc7, 0x41, 0xd1, 0xca, 0x5b, 0xde, 0x48, 0xc8, 0x95, 0xb3, 0xd2, 0x8c, 0xcc, 0x47, 0xcb, 0xf3, 0x1a, 0xe1, 0x42, 0xd9, 0x4c, 0xa3, 0xc2, 0xce, 0x4e, 0xd0, 0xf2, 0xdb, 0x56, 0x02, - /* (2^ 26)P */ 0x7f, 0x66, 0x0e, 0x4b, 0xe9, 0xb7, 0x5a, 0x87, 0x10, 0x0d, 0x85, 0xc0, 0x83, 0xdd, 0xd4, 0xca, 0x9f, 0xc7, 0x72, 0x4e, 0x8f, 0x2e, 0xf1, 0x47, 0x9b, 0xb1, 0x85, 0x8c, 0xbb, 0x87, 0x1a, 0x5f, - /* (2^ 27)P */ 0xb8, 0x51, 0x7f, 0x43, 0xb6, 0xd0, 0xe9, 0x7a, 0x65, 0x90, 0x87, 0x18, 0x55, 0xce, 0xc7, 0x12, 0xee, 0x7a, 0xf7, 0x5c, 0xfe, 0x09, 0xde, 0x2a, 0x27, 0x56, 0x2c, 0x7d, 0x2f, 0x5a, 0xa0, 0x23, - /* (2^ 28)P */ 0x9a, 0x16, 0x7c, 0xf1, 0x28, 0xe1, 0x08, 0x59, 0x2d, 0x85, 0xd0, 0x8a, 0xdd, 0x98, 0x74, 0xf7, 0x64, 0x2f, 0x10, 0xab, 0xce, 0xc4, 0xb4, 0x74, 0x45, 0x98, 0x13, 0x10, 0xdd, 0xba, 0x3a, 0x18, - /* (2^ 29)P */ 0xac, 0xaa, 0x92, 0xaa, 0x8d, 0xba, 0x65, 0xb1, 0x05, 0x67, 0x38, 0x99, 0x95, 0xef, 0xc5, 0xd5, 0xd1, 0x40, 0xfc, 0xf8, 0x0c, 0x8f, 0x2f, 0xbe, 0x14, 0x45, 0x20, 0xee, 0x35, 0xe6, 0x01, 0x27, - /* (2^ 30)P */ 0x14, 0x65, 0x15, 0x20, 0x00, 0xa8, 0x9f, 0x62, 0xce, 0xc1, 0xa8, 0x64, 0x87, 0x86, 0x23, 0xf2, 0x0e, 0x06, 0x3f, 0x0b, 0xff, 0x4f, 0x89, 0x5b, 0xfa, 0xa3, 0x08, 0xf7, 0x4c, 0x94, 0xd9, 0x60, - /* (2^ 31)P */ 0x1f, 0x20, 0x7a, 0x1c, 0x1a, 0x00, 0xea, 0xae, 0x63, 0xce, 0xe2, 0x3e, 0x63, 0x6a, 0xf1, 0xeb, 0xe1, 0x07, 0x7a, 0x4c, 0x59, 0x09, 0x77, 0x6f, 0xcb, 0x08, 0x02, 0x0d, 0x15, 0x58, 0xb9, 0x79, - /* (2^ 32)P */ 0xe7, 0x10, 0xd4, 0x01, 0x53, 0x5e, 0xb5, 0x24, 0x4d, 0xc8, 0xfd, 0xf3, 0xdf, 0x4e, 0xa3, 0xe3, 0xd8, 0x32, 0x40, 0x90, 0xe4, 0x68, 0x87, 0xd8, 0xec, 0xae, 0x3a, 0x7b, 0x42, 0x84, 0x13, 0x13, - /* (2^ 33)P */ 0x14, 0x4f, 0x23, 0x86, 0x12, 0xe5, 0x05, 0x84, 0x29, 0xc5, 0xb4, 0xad, 0x39, 0x47, 0xdc, 0x14, 0xfd, 0x4f, 0x63, 0x50, 0xb2, 0xb5, 0xa2, 0xb8, 0x93, 0xff, 0xa7, 0xd8, 0x4a, 0xa9, 0xe2, 0x2f, - /* (2^ 34)P */ 0xdd, 0xfa, 0x43, 0xe8, 0xef, 0x57, 0x5c, 0xec, 0x18, 0x99, 0xbb, 0xf0, 0x40, 0xce, 0x43, 0x28, 0x05, 0x63, 0x3d, 0xcf, 0xd6, 0x61, 0xb5, 0xa4, 0x7e, 0x77, 0xfb, 0xe8, 0xbd, 0x29, 0x36, 0x74, - /* (2^ 35)P */ 0x8f, 0x73, 0xaf, 0xbb, 0x46, 0xdd, 0x3e, 0x34, 0x51, 0xa6, 0x01, 0xb1, 0x28, 0x18, 0x98, 0xed, 0x7a, 0x79, 0x2c, 0x88, 0x0b, 0x76, 0x01, 0xa4, 0x30, 0x87, 0xc8, 0x8d, 0xe2, 0x23, 0xc2, 0x1f, - /* (2^ 36)P */ 0x0e, 0xba, 0x0f, 0xfc, 0x91, 0x4e, 0x60, 0x48, 0xa4, 0x6f, 0x2c, 0x05, 0x8f, 0xf7, 0x37, 0xb6, 0x9c, 0x23, 0xe9, 0x09, 0x3d, 0xac, 0xcc, 0x91, 0x7c, 0x68, 0x7a, 0x43, 0xd4, 0xee, 0xf7, 0x23, - /* (2^ 37)P */ 0x00, 0xd8, 0x9b, 0x8d, 0x11, 0xb1, 0x73, 0x51, 0xa7, 0xd4, 0x89, 0x31, 0xb6, 0x41, 0xd6, 0x29, 0x86, 0xc5, 0xbb, 0x88, 0x79, 0x17, 0xbf, 0xfd, 0xf5, 0x1d, 0xd8, 0xca, 0x4f, 0x89, 0x59, 0x29, - /* (2^ 38)P */ 0x99, 0xc8, 0xbb, 0xb4, 0xf3, 0x8e, 0xbc, 0xae, 0xb9, 0x92, 0x69, 0xb2, 0x5a, 0x99, 0x48, 0x41, 0xfb, 0x2c, 0xf9, 0x34, 0x01, 0x0b, 0xe2, 0x24, 0xe8, 0xde, 0x05, 0x4a, 0x89, 0x58, 0xd1, 0x40, - /* (2^ 39)P */ 0xf6, 0x76, 0xaf, 0x85, 0x11, 0x0b, 0xb0, 0x46, 0x79, 0x7a, 0x18, 0x73, 0x78, 0xc7, 0xba, 0x26, 0x5f, 0xff, 0x8f, 0xab, 0x95, 0xbf, 0xc0, 0x3d, 0xd7, 0x24, 0x55, 0x94, 0xd8, 0x8b, 0x60, 0x2a, - /* (2^ 40)P */ 0x02, 0x63, 0x44, 0xbd, 0x88, 0x95, 0x44, 0x26, 0x9c, 0x43, 0x88, 0x03, 0x1c, 0xc2, 0x4b, 0x7c, 0xb2, 0x11, 0xbd, 0x83, 0xf3, 0xa4, 0x98, 0x8e, 0xb9, 0x76, 0xd8, 0xc9, 0x7b, 0x8d, 0x21, 0x26, - /* (2^ 41)P */ 0x8a, 0x17, 0x7c, 0x99, 0x42, 0x15, 0x08, 0xe3, 0x6f, 0x60, 0xb6, 0x6f, 0xa8, 0x29, 0x2d, 0x3c, 0x74, 0x93, 0x27, 0xfa, 0x36, 0x77, 0x21, 0x5c, 0xfa, 0xb1, 0xfe, 0x4a, 0x73, 0x05, 0xde, 0x7d, - /* (2^ 42)P */ 0xab, 0x2b, 0xd4, 0x06, 0x39, 0x0e, 0xf1, 0x3b, 0x9c, 0x64, 0x80, 0x19, 0x3e, 0x80, 0xf7, 0xe4, 0x7a, 0xbf, 0x95, 0x95, 0xf8, 0x3b, 0x05, 0xe6, 0x30, 0x55, 0x24, 0xda, 0x38, 0xaf, 0x4f, 0x39, - /* (2^ 43)P */ 0xf4, 0x28, 0x69, 0x89, 0x58, 0xfb, 0x8e, 0x7a, 0x3c, 0x11, 0x6a, 0xcc, 0xe9, 0x78, 0xc7, 0xfb, 0x6f, 0x59, 0xaf, 0x30, 0xe3, 0x0c, 0x67, 0x72, 0xf7, 0x6c, 0x3d, 0x1d, 0xa8, 0x22, 0xf2, 0x48, - /* (2^ 44)P */ 0xa7, 0xca, 0x72, 0x0d, 0x41, 0xce, 0x1f, 0xf0, 0x95, 0x55, 0x3b, 0x21, 0xc7, 0xec, 0x20, 0x5a, 0x83, 0x14, 0xfa, 0xc1, 0x65, 0x11, 0xc2, 0x7b, 0x41, 0xa7, 0xa8, 0x1d, 0xe3, 0x9a, 0xf8, 0x07, - /* (2^ 45)P */ 0xf9, 0x0f, 0x83, 0xc6, 0xb4, 0xc2, 0xd2, 0x05, 0x93, 0x62, 0x31, 0xc6, 0x0f, 0x33, 0x3e, 0xd4, 0x04, 0xa9, 0xd3, 0x96, 0x0a, 0x59, 0xa5, 0xa5, 0xb6, 0x33, 0x53, 0xa6, 0x91, 0xdb, 0x5e, 0x70, - /* (2^ 46)P */ 0xf7, 0xa5, 0xb9, 0x0b, 0x5e, 0xe1, 0x8e, 0x04, 0x5d, 0xaf, 0x0a, 0x9e, 0xca, 0xcf, 0x40, 0x32, 0x0b, 0xa4, 0xc4, 0xed, 0xce, 0x71, 0x4b, 0x8f, 0x6d, 0x4a, 0x54, 0xde, 0xa3, 0x0d, 0x1c, 0x62, - /* (2^ 47)P */ 0x91, 0x40, 0x8c, 0xa0, 0x36, 0x28, 0x87, 0x92, 0x45, 0x14, 0xc9, 0x10, 0xb0, 0x75, 0x83, 0xce, 0x94, 0x63, 0x27, 0x4f, 0x52, 0xeb, 0x72, 0x8a, 0x35, 0x36, 0xc8, 0x7e, 0xfa, 0xfc, 0x67, 0x26, - /* (2^ 48)P */ 0x2a, 0x75, 0xe8, 0x45, 0x33, 0x17, 0x4c, 0x7f, 0xa5, 0x79, 0x70, 0xee, 0xfe, 0x47, 0x1b, 0x06, 0x34, 0xff, 0x86, 0x9f, 0xfa, 0x9a, 0xdd, 0x25, 0x9c, 0xc8, 0x5d, 0x42, 0xf5, 0xce, 0x80, 0x37, - /* (2^ 49)P */ 0xe9, 0xb4, 0x3b, 0x51, 0x5a, 0x03, 0x46, 0x1a, 0xda, 0x5a, 0x57, 0xac, 0x79, 0xf3, 0x1e, 0x3e, 0x50, 0x4b, 0xa2, 0x5f, 0x1c, 0x5f, 0x8c, 0xc7, 0x22, 0x9f, 0xfd, 0x34, 0x76, 0x96, 0x1a, 0x32, - /* (2^ 50)P */ 0xfa, 0x27, 0x6e, 0x82, 0xb8, 0x07, 0x67, 0x94, 0xd0, 0x6f, 0x50, 0x4c, 0xd6, 0x84, 0xca, 0x3d, 0x36, 0x14, 0xe9, 0x75, 0x80, 0x21, 0x89, 0xc1, 0x84, 0x84, 0x3b, 0x9b, 0x16, 0x84, 0x92, 0x6d, - /* (2^ 51)P */ 0xdf, 0x2d, 0x3f, 0x38, 0x40, 0xe8, 0x67, 0x3a, 0x75, 0x9b, 0x4f, 0x0c, 0xa3, 0xc9, 0xee, 0x33, 0x47, 0xef, 0x83, 0xa7, 0x6f, 0xc8, 0xc7, 0x3e, 0xc4, 0xfb, 0xc9, 0xba, 0x9f, 0x44, 0xec, 0x26, - /* (2^ 52)P */ 0x7d, 0x9e, 0x9b, 0xa0, 0xcb, 0x38, 0x0f, 0x5c, 0x8c, 0x47, 0xa3, 0x62, 0xc7, 0x8c, 0x16, 0x81, 0x1c, 0x12, 0xfc, 0x06, 0xd3, 0xb0, 0x23, 0x3e, 0xdd, 0xdc, 0xef, 0xa5, 0xa0, 0x8a, 0x23, 0x5a, - /* (2^ 53)P */ 0xff, 0x43, 0xea, 0xc4, 0x21, 0x61, 0xa2, 0x1b, 0xb5, 0x32, 0x88, 0x7c, 0x7f, 0xc7, 0xf8, 0x36, 0x9a, 0xf9, 0xdc, 0x0a, 0x0b, 0xea, 0xfb, 0x88, 0xf9, 0xeb, 0x5b, 0xc2, 0x8e, 0x93, 0xa9, 0x5c, - /* (2^ 54)P */ 0xa0, 0xcd, 0xfc, 0x51, 0x5e, 0x6a, 0x43, 0xd5, 0x3b, 0x89, 0xcd, 0xc2, 0x97, 0x47, 0xbc, 0x1d, 0x08, 0x4a, 0x22, 0xd3, 0x65, 0x6a, 0x34, 0x19, 0x66, 0xf4, 0x9a, 0x9b, 0xe4, 0x34, 0x50, 0x0f, - /* (2^ 55)P */ 0x6e, 0xb9, 0xe0, 0xa1, 0x67, 0x39, 0x3c, 0xf2, 0x88, 0x4d, 0x7a, 0x86, 0xfa, 0x08, 0x8b, 0xe5, 0x79, 0x16, 0x34, 0xa7, 0xc6, 0xab, 0x2f, 0xfb, 0x46, 0x69, 0x02, 0xb6, 0x1e, 0x38, 0x75, 0x2a, - /* (2^ 56)P */ 0xac, 0x20, 0x94, 0xc1, 0xe4, 0x3b, 0x0a, 0xc8, 0xdc, 0xb6, 0xf2, 0x81, 0xc6, 0xf6, 0xb1, 0x66, 0x88, 0x33, 0xe9, 0x61, 0x67, 0x03, 0xf7, 0x7c, 0xc4, 0xa4, 0x60, 0xa6, 0xd8, 0xbb, 0xab, 0x25, - /* (2^ 57)P */ 0x98, 0x51, 0xfd, 0x14, 0xba, 0x12, 0xea, 0x91, 0xa9, 0xff, 0x3c, 0x4a, 0xfc, 0x50, 0x49, 0x68, 0x28, 0xad, 0xf5, 0x30, 0x21, 0x84, 0x26, 0xf8, 0x41, 0xa4, 0x01, 0x53, 0xf7, 0x88, 0xa9, 0x3e, - /* (2^ 58)P */ 0x6f, 0x8c, 0x5f, 0x69, 0x9a, 0x10, 0x78, 0xc9, 0xf3, 0xc3, 0x30, 0x05, 0x4a, 0xeb, 0x46, 0x17, 0x95, 0x99, 0x45, 0xb4, 0x77, 0x6d, 0x4d, 0x44, 0xc7, 0x5c, 0x4e, 0x05, 0x8c, 0x2b, 0x95, 0x75, - /* (2^ 59)P */ 0xaa, 0xd6, 0xf4, 0x15, 0x79, 0x3f, 0x70, 0xa3, 0xd8, 0x47, 0x26, 0x2f, 0x20, 0x46, 0xc3, 0x66, 0x4b, 0x64, 0x1d, 0x81, 0xdf, 0x69, 0x14, 0xd0, 0x1f, 0xd7, 0xa5, 0x81, 0x7d, 0xa4, 0xfe, 0x77, - /* (2^ 60)P */ 0x81, 0xa3, 0x7c, 0xf5, 0x9e, 0x52, 0xe9, 0xc5, 0x1a, 0x88, 0x2f, 0xce, 0xb9, 0xb4, 0xee, 0x6e, 0xd6, 0x9b, 0x00, 0xe8, 0x28, 0x1a, 0xe9, 0xb6, 0xec, 0x3f, 0xfc, 0x9a, 0x3e, 0xbe, 0x80, 0x4b, - /* (2^ 61)P */ 0xc5, 0xd2, 0xae, 0x26, 0xc5, 0x73, 0x37, 0x7e, 0x9d, 0xa4, 0xc9, 0x53, 0xb4, 0xfc, 0x4a, 0x1b, 0x4d, 0xb2, 0xff, 0xba, 0xd7, 0xbd, 0x20, 0xa9, 0x0e, 0x40, 0x2d, 0x12, 0x9f, 0x69, 0x54, 0x7c, - /* (2^ 62)P */ 0xc8, 0x4b, 0xa9, 0x4f, 0xe1, 0xc8, 0x46, 0xef, 0x5e, 0xed, 0x52, 0x29, 0xce, 0x74, 0xb0, 0xe0, 0xd5, 0x85, 0xd8, 0xdb, 0xe1, 0x50, 0xa4, 0xbe, 0x2c, 0x71, 0x0f, 0x32, 0x49, 0x86, 0xb6, 0x61, - /* (2^ 63)P */ 0xd1, 0xbd, 0xcc, 0x09, 0x73, 0x5f, 0x48, 0x8a, 0x2d, 0x1a, 0x4d, 0x7d, 0x0d, 0x32, 0x06, 0xbd, 0xf4, 0xbe, 0x2d, 0x32, 0x73, 0x29, 0x23, 0x25, 0x70, 0xf7, 0x17, 0x8c, 0x75, 0xc4, 0x5d, 0x44, - /* (2^ 64)P */ 0x3c, 0x93, 0xc8, 0x7c, 0x17, 0x34, 0x04, 0xdb, 0x9f, 0x05, 0xea, 0x75, 0x21, 0xe8, 0x6f, 0xed, 0x34, 0xdb, 0x53, 0xc0, 0xfd, 0xbe, 0xfe, 0x1e, 0x99, 0xaf, 0x5d, 0xc6, 0x67, 0xe8, 0xdb, 0x4a, - /* (2^ 65)P */ 0xdf, 0x09, 0x06, 0xa9, 0xa2, 0x71, 0xcd, 0x3a, 0x50, 0x40, 0xd0, 0x6d, 0x85, 0x91, 0xe9, 0xe5, 0x3c, 0xc2, 0x57, 0x81, 0x68, 0x9b, 0xc6, 0x1e, 0x4d, 0xfe, 0x5c, 0x88, 0xf6, 0x27, 0x74, 0x69, - /* (2^ 66)P */ 0x51, 0xa8, 0xe1, 0x65, 0x9b, 0x7b, 0xbe, 0xd7, 0xdd, 0x36, 0xc5, 0x22, 0xd5, 0x28, 0x3d, 0xa0, 0x45, 0xb6, 0xd2, 0x8f, 0x65, 0x9d, 0x39, 0x28, 0xe1, 0x41, 0x26, 0x7c, 0xe1, 0xb7, 0xe5, 0x49, - /* (2^ 67)P */ 0xa4, 0x57, 0x04, 0x70, 0x98, 0x3a, 0x8c, 0x6f, 0x78, 0x67, 0xbb, 0x5e, 0xa2, 0xf0, 0x78, 0x50, 0x0f, 0x96, 0x82, 0xc3, 0xcb, 0x3c, 0x3c, 0xd1, 0xb1, 0x84, 0xdf, 0xa7, 0x58, 0x32, 0x00, 0x2e, - /* (2^ 68)P */ 0x1c, 0x6a, 0x29, 0xe6, 0x9b, 0xf3, 0xd1, 0x8a, 0xb2, 0xbf, 0x5f, 0x2a, 0x65, 0xaa, 0xee, 0xc1, 0xcb, 0xf3, 0x26, 0xfd, 0x73, 0x06, 0xee, 0x33, 0xcc, 0x2c, 0x9d, 0xa6, 0x73, 0x61, 0x25, 0x59, - /* (2^ 69)P */ 0x41, 0xfc, 0x18, 0x4e, 0xaa, 0x07, 0xea, 0x41, 0x1e, 0xa5, 0x87, 0x7c, 0x52, 0x19, 0xfc, 0xd9, 0x6f, 0xca, 0x31, 0x58, 0x80, 0xcb, 0xaa, 0xbd, 0x4f, 0x69, 0x16, 0xc9, 0x2d, 0x65, 0x5b, 0x44, - /* (2^ 70)P */ 0x15, 0x23, 0x17, 0xf2, 0xa7, 0xa3, 0x92, 0xce, 0x64, 0x99, 0x1b, 0xe1, 0x2d, 0x28, 0xdc, 0x1e, 0x4a, 0x31, 0x4c, 0xe0, 0xaf, 0x3a, 0x82, 0xa1, 0x86, 0xf5, 0x7c, 0x43, 0x94, 0x2d, 0x0a, 0x79, - /* (2^ 71)P */ 0x09, 0xe0, 0xf6, 0x93, 0xfb, 0x47, 0xc4, 0x71, 0x76, 0x52, 0x84, 0x22, 0x67, 0xa5, 0x22, 0x89, 0x69, 0x51, 0x4f, 0x20, 0x3b, 0x90, 0x70, 0xbf, 0xfe, 0x19, 0xa3, 0x1b, 0x89, 0x89, 0x7a, 0x2f, - /* (2^ 72)P */ 0x0c, 0x14, 0xe2, 0x77, 0xb5, 0x8e, 0xa0, 0x02, 0xf4, 0xdc, 0x7b, 0x42, 0xd4, 0x4e, 0x9a, 0xed, 0xd1, 0x3c, 0x32, 0xe4, 0x44, 0xec, 0x53, 0x52, 0x5b, 0x35, 0xe9, 0x14, 0x3c, 0x36, 0x88, 0x3e, - /* (2^ 73)P */ 0x8c, 0x0b, 0x11, 0x77, 0x42, 0xc1, 0x66, 0xaa, 0x90, 0x33, 0xa2, 0x10, 0x16, 0x39, 0xe0, 0x1a, 0xa2, 0xc2, 0x3f, 0xc9, 0x12, 0xbd, 0x30, 0x20, 0xab, 0xc7, 0x55, 0x95, 0x57, 0x41, 0xe1, 0x3e, - /* (2^ 74)P */ 0x41, 0x7d, 0x6e, 0x6d, 0x3a, 0xde, 0x14, 0x92, 0xfe, 0x7e, 0xf1, 0x07, 0x86, 0xd8, 0xcd, 0x3c, 0x17, 0x12, 0xe1, 0xf8, 0x88, 0x12, 0x4f, 0x67, 0xd0, 0x93, 0x9f, 0x32, 0x0f, 0x25, 0x82, 0x56, - /* (2^ 75)P */ 0x6e, 0x39, 0x2e, 0x6d, 0x13, 0x0b, 0xf0, 0x6c, 0xbf, 0xde, 0x14, 0x10, 0x6f, 0xf8, 0x4c, 0x6e, 0x83, 0x4e, 0xcc, 0xbf, 0xb5, 0xb1, 0x30, 0x59, 0xb6, 0x16, 0xba, 0x8a, 0xb4, 0x69, 0x70, 0x04, - /* (2^ 76)P */ 0x93, 0x07, 0xb2, 0x69, 0xab, 0xe4, 0x4c, 0x0d, 0x9e, 0xfb, 0xd0, 0x97, 0x1a, 0xb9, 0x4d, 0xb2, 0x1d, 0xd0, 0x00, 0x4e, 0xf5, 0x50, 0xfa, 0xcd, 0xb5, 0xdd, 0x8b, 0x36, 0x85, 0x10, 0x1b, 0x22, - /* (2^ 77)P */ 0xd2, 0xd8, 0xe3, 0xb1, 0x68, 0x94, 0xe5, 0xe7, 0x93, 0x2f, 0x12, 0xbd, 0x63, 0x65, 0xc5, 0x53, 0x09, 0x3f, 0x66, 0xe0, 0x03, 0xa9, 0xe8, 0xee, 0x42, 0x3d, 0xbe, 0xcb, 0x62, 0xa6, 0xef, 0x61, - /* (2^ 78)P */ 0x2a, 0xab, 0x6e, 0xde, 0xdd, 0xdd, 0xf8, 0x2c, 0x31, 0xf2, 0x35, 0x14, 0xd5, 0x0a, 0xf8, 0x9b, 0x73, 0x49, 0xf0, 0xc9, 0xce, 0xda, 0xea, 0x5d, 0x27, 0x9b, 0xd2, 0x41, 0x5d, 0x5b, 0x27, 0x29, - /* (2^ 79)P */ 0x4f, 0xf1, 0xeb, 0x95, 0x08, 0x0f, 0xde, 0xcf, 0xa7, 0x05, 0x49, 0x05, 0x6b, 0xb9, 0xaa, 0xb9, 0xfd, 0x20, 0xc4, 0xa1, 0xd9, 0x0d, 0xe8, 0xca, 0xc7, 0xbb, 0x73, 0x16, 0x2f, 0xbf, 0x63, 0x0a, - /* (2^ 80)P */ 0x8c, 0xbc, 0x8f, 0x95, 0x11, 0x6e, 0x2f, 0x09, 0xad, 0x2f, 0x82, 0x04, 0xe8, 0x81, 0x2a, 0x67, 0x17, 0x25, 0xd5, 0x60, 0x15, 0x35, 0xc8, 0xca, 0xf8, 0x92, 0xf1, 0xc8, 0x22, 0x77, 0x3f, 0x6f, - /* (2^ 81)P */ 0xb7, 0x94, 0xe8, 0xc2, 0xcc, 0x90, 0xba, 0xf8, 0x0d, 0x9f, 0xff, 0x38, 0xa4, 0x57, 0x75, 0x2c, 0x59, 0x23, 0xe5, 0x5a, 0x85, 0x1d, 0x4d, 0x89, 0x69, 0x3d, 0x74, 0x7b, 0x15, 0x22, 0xe1, 0x68, - /* (2^ 82)P */ 0xf3, 0x19, 0xb9, 0xcf, 0x70, 0x55, 0x7e, 0xd8, 0xb9, 0x8d, 0x79, 0x95, 0xcd, 0xde, 0x2c, 0x3f, 0xce, 0xa2, 0xc0, 0x10, 0x47, 0x15, 0x21, 0x21, 0xb2, 0xc5, 0x6d, 0x24, 0x15, 0xa1, 0x66, 0x3c, - /* (2^ 83)P */ 0x72, 0xcb, 0x4e, 0x29, 0x62, 0xc5, 0xed, 0xcb, 0x16, 0x0b, 0x28, 0x6a, 0xc3, 0x43, 0x71, 0xba, 0x67, 0x8b, 0x07, 0xd4, 0xef, 0xc2, 0x10, 0x96, 0x1e, 0x4b, 0x6a, 0x94, 0x5d, 0x73, 0x44, 0x61, - /* (2^ 84)P */ 0x50, 0x33, 0x5b, 0xd7, 0x1e, 0x11, 0x6f, 0x53, 0x1b, 0xd8, 0x41, 0x20, 0x8c, 0xdb, 0x11, 0x02, 0x3c, 0x41, 0x10, 0x0e, 0x00, 0xb1, 0x3c, 0xf9, 0x76, 0x88, 0x9e, 0x03, 0x3c, 0xfd, 0x9d, 0x14, - /* (2^ 85)P */ 0x5b, 0x15, 0x63, 0x6b, 0xe4, 0xdd, 0x79, 0xd4, 0x76, 0x79, 0x83, 0x3c, 0xe9, 0x15, 0x6e, 0xb6, 0x38, 0xe0, 0x13, 0x1f, 0x3b, 0xe4, 0xfd, 0xda, 0x35, 0x0b, 0x4b, 0x2e, 0x1a, 0xda, 0xaf, 0x5f, - /* (2^ 86)P */ 0x81, 0x75, 0x19, 0x17, 0xdf, 0xbb, 0x00, 0x36, 0xc2, 0xd2, 0x3c, 0xbe, 0x0b, 0x05, 0x72, 0x39, 0x86, 0xbe, 0xd5, 0xbd, 0x6d, 0x90, 0x38, 0x59, 0x0f, 0x86, 0x9b, 0x3f, 0xe4, 0xe5, 0xfc, 0x34, - /* (2^ 87)P */ 0x02, 0x4d, 0xd1, 0x42, 0xcd, 0xa4, 0xa8, 0x75, 0x65, 0xdf, 0x41, 0x34, 0xc5, 0xab, 0x8d, 0x82, 0xd3, 0x31, 0xe1, 0xd2, 0xed, 0xab, 0xdc, 0x33, 0x5f, 0xd2, 0x14, 0xb8, 0x6f, 0xd7, 0xba, 0x3e, - /* (2^ 88)P */ 0x0f, 0xe1, 0x70, 0x6f, 0x56, 0x6f, 0x90, 0xd4, 0x5a, 0x0f, 0x69, 0x51, 0xaa, 0xf7, 0x12, 0x5d, 0xf2, 0xfc, 0xce, 0x76, 0x6e, 0xb1, 0xad, 0x45, 0x99, 0x29, 0x23, 0xad, 0xae, 0x68, 0xf7, 0x01, - /* (2^ 89)P */ 0xbd, 0xfe, 0x48, 0x62, 0x7b, 0xc7, 0x6c, 0x2b, 0xfd, 0xaf, 0x3a, 0xec, 0x28, 0x06, 0xd3, 0x3c, 0x6a, 0x48, 0xef, 0xd4, 0x80, 0x0b, 0x1c, 0xce, 0x23, 0x6c, 0xf6, 0xa6, 0x2e, 0xff, 0x3b, 0x4c, - /* (2^ 90)P */ 0x5f, 0xeb, 0xea, 0x4a, 0x09, 0xc4, 0x2e, 0x3f, 0xa7, 0x2c, 0x37, 0x6e, 0x28, 0x9b, 0xb1, 0x61, 0x1d, 0x70, 0x2a, 0xde, 0x66, 0xa9, 0xef, 0x5e, 0xef, 0xe3, 0x55, 0xde, 0x65, 0x05, 0xb2, 0x23, - /* (2^ 91)P */ 0x57, 0x85, 0xd5, 0x79, 0x52, 0xca, 0x01, 0xe3, 0x4f, 0x87, 0xc2, 0x27, 0xce, 0xd4, 0xb2, 0x07, 0x67, 0x1d, 0xcf, 0x9d, 0x8a, 0xcd, 0x32, 0xa5, 0x56, 0xff, 0x2b, 0x3f, 0xe2, 0xfe, 0x52, 0x2a, - /* (2^ 92)P */ 0x3d, 0x66, 0xd8, 0x7c, 0xb3, 0xef, 0x24, 0x86, 0x94, 0x75, 0xbd, 0xff, 0x20, 0xac, 0xc7, 0xbb, 0x45, 0x74, 0xd3, 0x82, 0x9c, 0x5e, 0xb8, 0x57, 0x66, 0xec, 0xa6, 0x86, 0xcb, 0x52, 0x30, 0x7b, - /* (2^ 93)P */ 0x1e, 0xe9, 0x25, 0x25, 0xad, 0xf0, 0x82, 0x34, 0xa0, 0xdc, 0x8e, 0xd2, 0x43, 0x80, 0xb6, 0x2c, 0x3a, 0x00, 0x1b, 0x2e, 0x05, 0x6d, 0x4f, 0xaf, 0x0a, 0x1b, 0x78, 0x29, 0x25, 0x8c, 0x5f, 0x18, - /* (2^ 94)P */ 0xd6, 0xe0, 0x0c, 0xd8, 0x5b, 0xde, 0x41, 0xaa, 0xd6, 0xe9, 0x53, 0x68, 0x41, 0xb2, 0x07, 0x94, 0x3a, 0x4c, 0x7f, 0x35, 0x6e, 0xc3, 0x3e, 0x56, 0xce, 0x7b, 0x29, 0x0e, 0xdd, 0xb8, 0xc4, 0x4c, - /* (2^ 95)P */ 0x0e, 0x73, 0xb8, 0xff, 0x52, 0x1a, 0xfc, 0xa2, 0x37, 0x8e, 0x05, 0x67, 0x6e, 0xf1, 0x11, 0x18, 0xe1, 0x4e, 0xdf, 0xcd, 0x66, 0xa3, 0xf9, 0x10, 0x99, 0xf0, 0xb9, 0xa0, 0xc4, 0xa0, 0xf4, 0x72, - /* (2^ 96)P */ 0xa7, 0x4e, 0x3f, 0x66, 0x6f, 0xc0, 0x16, 0x8c, 0xba, 0x0f, 0x97, 0x4e, 0xf7, 0x3a, 0x3b, 0x69, 0x45, 0xc3, 0x9e, 0xd6, 0xf1, 0xe7, 0x02, 0x21, 0x89, 0x80, 0x8a, 0x96, 0xbc, 0x3c, 0xa5, 0x0b, - /* (2^ 97)P */ 0x37, 0x55, 0xa1, 0xfe, 0xc7, 0x9d, 0x3d, 0xca, 0x93, 0x64, 0x53, 0x51, 0xbb, 0x24, 0x68, 0x4c, 0xb1, 0x06, 0x40, 0x84, 0x14, 0x63, 0x88, 0xb9, 0x60, 0xcc, 0x54, 0xb4, 0x2a, 0xa7, 0xd2, 0x40, - /* (2^ 98)P */ 0x75, 0x09, 0x57, 0x12, 0xb7, 0xa1, 0x36, 0x59, 0x57, 0xa6, 0xbd, 0xde, 0x48, 0xd6, 0xb9, 0x91, 0xea, 0x30, 0x43, 0xb6, 0x4b, 0x09, 0x44, 0x33, 0xd0, 0x51, 0xee, 0x12, 0x0d, 0xa1, 0x6b, 0x00, - /* (2^ 99)P */ 0x58, 0x5d, 0xde, 0xf5, 0x68, 0x84, 0x22, 0x19, 0xb0, 0x05, 0xcc, 0x38, 0x4c, 0x2f, 0xb1, 0x0e, 0x90, 0x19, 0x60, 0xd5, 0x9d, 0x9f, 0x03, 0xa1, 0x0b, 0x0e, 0xff, 0x4f, 0xce, 0xd4, 0x02, 0x45, - /* (2^100)P */ 0x89, 0xc1, 0x37, 0x68, 0x10, 0x54, 0x20, 0xeb, 0x3c, 0xb9, 0xd3, 0x6d, 0x4c, 0x54, 0xf6, 0xd0, 0x4f, 0xd7, 0x16, 0xc4, 0x64, 0x70, 0x72, 0x40, 0xf0, 0x2e, 0x50, 0x4b, 0x11, 0xc6, 0x15, 0x6e, - /* (2^101)P */ 0x6b, 0xa7, 0xb1, 0xcf, 0x98, 0xa3, 0xf2, 0x4d, 0xb1, 0xf6, 0xf2, 0x19, 0x74, 0x6c, 0x25, 0x11, 0x43, 0x60, 0x6e, 0x06, 0x62, 0x79, 0x49, 0x4a, 0x44, 0x5b, 0x35, 0x41, 0xab, 0x3a, 0x5b, 0x70, - /* (2^102)P */ 0xd8, 0xb1, 0x97, 0xd7, 0x36, 0xf5, 0x5e, 0x36, 0xdb, 0xf0, 0xdd, 0x22, 0xd6, 0x6b, 0x07, 0x00, 0x88, 0x5a, 0x57, 0xe0, 0xb0, 0x33, 0xbf, 0x3b, 0x4d, 0xca, 0xe4, 0xc8, 0x05, 0xaa, 0x77, 0x37, - /* (2^103)P */ 0x5f, 0xdb, 0x78, 0x55, 0xc8, 0x45, 0x27, 0x39, 0xe2, 0x5a, 0xae, 0xdb, 0x49, 0x41, 0xda, 0x6f, 0x67, 0x98, 0xdc, 0x8a, 0x0b, 0xb0, 0xf0, 0xb1, 0xa3, 0x1d, 0x6f, 0xd3, 0x37, 0x34, 0x96, 0x09, - /* (2^104)P */ 0x53, 0x38, 0xdc, 0xa5, 0x90, 0x4e, 0x82, 0x7e, 0xbd, 0x5c, 0x13, 0x1f, 0x64, 0xf6, 0xb5, 0xcc, 0xcc, 0x8f, 0xce, 0x87, 0x6c, 0xd8, 0x36, 0x67, 0x9f, 0x24, 0x04, 0x66, 0xe2, 0x3c, 0x5f, 0x62, - /* (2^105)P */ 0x3f, 0xf6, 0x02, 0x95, 0x05, 0xc8, 0x8a, 0xaf, 0x69, 0x14, 0x35, 0x2e, 0x0a, 0xe7, 0x05, 0x0c, 0x05, 0x63, 0x4b, 0x76, 0x9c, 0x2e, 0x29, 0x35, 0xc3, 0x3a, 0xe2, 0xc7, 0x60, 0x43, 0x39, 0x1a, - /* (2^106)P */ 0x64, 0x32, 0x18, 0x51, 0x32, 0xd5, 0xc6, 0xd5, 0x4f, 0xb7, 0xc2, 0x43, 0xbd, 0x5a, 0x06, 0x62, 0x9b, 0x3f, 0x97, 0x3b, 0xd0, 0xf5, 0xfb, 0xb5, 0x5e, 0x6e, 0x20, 0x61, 0x36, 0xda, 0xa3, 0x13, - /* (2^107)P */ 0xe5, 0x94, 0x5d, 0x72, 0x37, 0x58, 0xbd, 0xc6, 0xc5, 0x16, 0x50, 0x20, 0x12, 0x09, 0xe3, 0x18, 0x68, 0x3c, 0x03, 0x70, 0x15, 0xce, 0x88, 0x20, 0x87, 0x79, 0x83, 0x5c, 0x49, 0x1f, 0xba, 0x7f, - /* (2^108)P */ 0x9d, 0x07, 0xf9, 0xf2, 0x23, 0x74, 0x8c, 0x5a, 0xc5, 0x3f, 0x02, 0x34, 0x7b, 0x15, 0x35, 0x17, 0x51, 0xb3, 0xfa, 0xd2, 0x9a, 0xb4, 0xf9, 0xe4, 0x3c, 0xe3, 0x78, 0xc8, 0x72, 0xff, 0x91, 0x66, - /* (2^109)P */ 0x3e, 0xff, 0x5e, 0xdc, 0xde, 0x2a, 0x2c, 0x12, 0xf4, 0x6c, 0x95, 0xd8, 0xf1, 0x4b, 0xdd, 0xf8, 0xda, 0x5b, 0x9e, 0x9e, 0x5d, 0x20, 0x86, 0xeb, 0x43, 0xc7, 0x75, 0xd9, 0xb9, 0x92, 0x9b, 0x04, - /* (2^110)P */ 0x5a, 0xc0, 0xf6, 0xb0, 0x30, 0x97, 0x37, 0xa5, 0x53, 0xa5, 0xf3, 0xc6, 0xac, 0xff, 0xa0, 0x72, 0x6d, 0xcd, 0x0d, 0xb2, 0x34, 0x2c, 0x03, 0xb0, 0x4a, 0x16, 0xd5, 0x88, 0xbc, 0x9d, 0x0e, 0x47, - /* (2^111)P */ 0x47, 0xc0, 0x37, 0xa2, 0x0c, 0xf1, 0x9c, 0xb1, 0xa2, 0x81, 0x6c, 0x1f, 0x71, 0x66, 0x54, 0xb6, 0x43, 0x0b, 0xd8, 0x6d, 0xd1, 0x1b, 0x32, 0xb3, 0x8e, 0xbe, 0x5f, 0x0c, 0x60, 0x4f, 0xc1, 0x48, - /* (2^112)P */ 0x03, 0xc8, 0xa6, 0x4a, 0x26, 0x1c, 0x45, 0x66, 0xa6, 0x7d, 0xfa, 0xa4, 0x04, 0x39, 0x6e, 0xb6, 0x95, 0x83, 0x12, 0xb3, 0xb0, 0x19, 0x5f, 0xd4, 0x10, 0xbc, 0xc9, 0xc3, 0x27, 0x26, 0x60, 0x31, - /* (2^113)P */ 0x0d, 0xe1, 0xe4, 0x32, 0x48, 0xdc, 0x20, 0x31, 0xf7, 0x17, 0xc7, 0x56, 0x67, 0xc4, 0x20, 0xeb, 0x94, 0x02, 0x28, 0x67, 0x3f, 0x2e, 0xf5, 0x00, 0x09, 0xc5, 0x30, 0x47, 0xc1, 0x4f, 0x6d, 0x56, - /* (2^114)P */ 0x06, 0x72, 0x83, 0xfd, 0x40, 0x5d, 0x3a, 0x7e, 0x7a, 0x54, 0x59, 0x71, 0xdc, 0x26, 0xe9, 0xc1, 0x95, 0x60, 0x8d, 0xa6, 0xfb, 0x30, 0x67, 0x21, 0xa7, 0xce, 0x69, 0x3f, 0x84, 0xc3, 0xe8, 0x22, - /* (2^115)P */ 0x2b, 0x4b, 0x0e, 0x93, 0xe8, 0x74, 0xd0, 0x33, 0x16, 0x58, 0xd1, 0x84, 0x0e, 0x35, 0xe4, 0xb6, 0x65, 0x23, 0xba, 0xd6, 0x6a, 0xc2, 0x34, 0x55, 0xf3, 0xf3, 0xf1, 0x89, 0x2f, 0xc1, 0x73, 0x77, - /* (2^116)P */ 0xaa, 0x62, 0x79, 0xa5, 0x4d, 0x40, 0xba, 0x8c, 0x56, 0xce, 0x99, 0x19, 0xa8, 0x97, 0x98, 0x5b, 0xfc, 0x92, 0x16, 0x12, 0x2f, 0x86, 0x8e, 0x50, 0x91, 0xc2, 0x93, 0xa0, 0x7f, 0x90, 0x81, 0x3a, - /* (2^117)P */ 0x10, 0xa5, 0x25, 0x47, 0xff, 0xd0, 0xde, 0x0d, 0x03, 0xc5, 0x3f, 0x67, 0x10, 0xcc, 0xd8, 0x10, 0x89, 0x4e, 0x1f, 0x9f, 0x1c, 0x15, 0x9d, 0x5b, 0x4c, 0xa4, 0x09, 0xcb, 0xd5, 0xc1, 0xa5, 0x32, - /* (2^118)P */ 0xfb, 0x41, 0x05, 0xb9, 0x42, 0xa4, 0x0a, 0x1e, 0xdb, 0x85, 0xb4, 0xc1, 0x7c, 0xeb, 0x85, 0x5f, 0xe5, 0xf2, 0x9d, 0x8a, 0xce, 0x95, 0xe5, 0xbe, 0x36, 0x22, 0x42, 0x22, 0xc7, 0x96, 0xe4, 0x25, - /* (2^119)P */ 0xb9, 0xe5, 0x0f, 0xcd, 0x46, 0x3c, 0xdf, 0x5e, 0x88, 0x33, 0xa4, 0xd2, 0x7e, 0x5a, 0xe7, 0x34, 0x52, 0xe3, 0x61, 0xd7, 0x11, 0xde, 0x88, 0xe4, 0x5c, 0x54, 0x85, 0xa0, 0x01, 0x8a, 0x87, 0x0e, - /* (2^120)P */ 0x04, 0xbb, 0x21, 0xe0, 0x77, 0x3c, 0x49, 0xba, 0x9a, 0x89, 0xdf, 0xc7, 0x43, 0x18, 0x4d, 0x2b, 0x67, 0x0d, 0xe8, 0x7a, 0x48, 0x7a, 0xa3, 0x9e, 0x94, 0x17, 0xe4, 0x11, 0x80, 0x95, 0xa9, 0x67, - /* (2^121)P */ 0x65, 0xb0, 0x97, 0x66, 0x1a, 0x05, 0x58, 0x4b, 0xd4, 0xa6, 0x6b, 0x8d, 0x7d, 0x3f, 0xe3, 0x47, 0xc1, 0x46, 0xca, 0x83, 0xd4, 0xa8, 0x4d, 0xbb, 0x0d, 0xdb, 0xc2, 0x81, 0xa1, 0xca, 0xbe, 0x68, - /* (2^122)P */ 0xa5, 0x9a, 0x98, 0x0b, 0xe9, 0x80, 0x89, 0x8d, 0x9b, 0xc9, 0x93, 0x2c, 0x4a, 0xb1, 0x5e, 0xf9, 0xa2, 0x73, 0x6e, 0x79, 0xc4, 0xc7, 0xc6, 0x51, 0x69, 0xb5, 0xef, 0xb5, 0x63, 0x83, 0x22, 0x6e, - /* (2^123)P */ 0xc8, 0x24, 0xd6, 0x2d, 0xb0, 0xc0, 0xbb, 0xc6, 0xee, 0x70, 0x81, 0xec, 0x7d, 0xb4, 0x7e, 0x77, 0xa9, 0xaf, 0xcf, 0x04, 0xa0, 0x15, 0xde, 0x3c, 0x9b, 0xbf, 0x60, 0x71, 0x08, 0xbc, 0xc6, 0x1d, - /* (2^124)P */ 0x02, 0x40, 0xc3, 0xee, 0x43, 0xe0, 0x07, 0x2e, 0x7f, 0xdc, 0x68, 0x7a, 0x67, 0xfc, 0xe9, 0x18, 0x9a, 0x5b, 0xd1, 0x8b, 0x18, 0x03, 0xda, 0xd8, 0x53, 0x82, 0x56, 0x00, 0xbb, 0xc3, 0xfb, 0x48, - /* (2^125)P */ 0xe1, 0x4c, 0x65, 0xfb, 0x4c, 0x7d, 0x54, 0x57, 0xad, 0xe2, 0x58, 0xa0, 0x82, 0x5b, 0x56, 0xd3, 0x78, 0x44, 0x15, 0xbf, 0x0b, 0xaf, 0x3e, 0xf6, 0x18, 0xbb, 0xdf, 0x14, 0xf1, 0x1e, 0x53, 0x47, - /* (2^126)P */ 0x87, 0xc5, 0x78, 0x42, 0x0a, 0x63, 0xec, 0xe1, 0xf3, 0x83, 0x8e, 0xca, 0x46, 0xd5, 0x07, 0x55, 0x2b, 0x0c, 0xdc, 0x3a, 0xc6, 0x35, 0xe1, 0x85, 0x4e, 0x84, 0x82, 0x56, 0xa8, 0xef, 0xa7, 0x0a, - /* (2^127)P */ 0x15, 0xf6, 0xe1, 0xb3, 0xa8, 0x1b, 0x69, 0x72, 0xfa, 0x3f, 0xbe, 0x1f, 0x70, 0xe9, 0xb4, 0x32, 0x68, 0x78, 0xbb, 0x39, 0x2e, 0xd9, 0xb6, 0x97, 0xe8, 0x39, 0x2e, 0xa0, 0xde, 0x53, 0xfe, 0x2c, - /* (2^128)P */ 0xb0, 0x52, 0xcd, 0x85, 0xcd, 0x92, 0x73, 0x68, 0x31, 0x98, 0xe2, 0x10, 0xc9, 0x66, 0xff, 0x27, 0x06, 0x2d, 0x83, 0xa9, 0x56, 0x45, 0x13, 0x97, 0xa0, 0xf8, 0x84, 0x0a, 0x36, 0xb0, 0x9b, 0x26, - /* (2^129)P */ 0x5c, 0xf8, 0x43, 0x76, 0x45, 0x55, 0x6e, 0x70, 0x1b, 0x7d, 0x59, 0x9b, 0x8c, 0xa4, 0x34, 0x37, 0x72, 0xa4, 0xef, 0xc6, 0xe8, 0x91, 0xee, 0x7a, 0xe0, 0xd9, 0xa9, 0x98, 0xc1, 0xab, 0xd6, 0x5c, - /* (2^130)P */ 0x1a, 0xe4, 0x3c, 0xcb, 0x06, 0xde, 0x04, 0x0e, 0x38, 0xe1, 0x02, 0x34, 0x89, 0xeb, 0xc6, 0xd8, 0x72, 0x37, 0x6e, 0x68, 0xbb, 0x59, 0x46, 0x90, 0xc8, 0xa8, 0x6b, 0x74, 0x71, 0xc3, 0x15, 0x72, - /* (2^131)P */ 0xd9, 0xa2, 0xe4, 0xea, 0x7e, 0xa9, 0x12, 0xfd, 0xc5, 0xf2, 0x94, 0x63, 0x51, 0xb7, 0x14, 0x95, 0x94, 0xf2, 0x08, 0x92, 0x80, 0xd5, 0x6f, 0x26, 0xb9, 0x26, 0x9a, 0x61, 0x85, 0x70, 0x84, 0x5c, - /* (2^132)P */ 0xea, 0x94, 0xd6, 0xfe, 0x10, 0x54, 0x98, 0x52, 0x54, 0xd2, 0x2e, 0x4a, 0x93, 0x5b, 0x90, 0x3c, 0x67, 0xe4, 0x3b, 0x2d, 0x69, 0x47, 0xbb, 0x10, 0xe1, 0xe9, 0xe5, 0x69, 0x2d, 0x3d, 0x3b, 0x06, - /* (2^133)P */ 0xeb, 0x7d, 0xa5, 0xdd, 0xee, 0x26, 0x27, 0x47, 0x91, 0x18, 0xf4, 0x10, 0xae, 0xc4, 0xb6, 0xef, 0x14, 0x76, 0x30, 0x7b, 0x91, 0x41, 0x16, 0x2b, 0x7c, 0x5b, 0xf4, 0xc4, 0x4f, 0x55, 0x7c, 0x11, - /* (2^134)P */ 0x12, 0x88, 0x9d, 0x8f, 0x11, 0xf3, 0x7c, 0xc0, 0x39, 0x79, 0x01, 0x50, 0x20, 0xd8, 0xdb, 0x01, 0x27, 0x28, 0x1b, 0x17, 0xf4, 0x03, 0xe8, 0xd7, 0xea, 0x25, 0xd2, 0x87, 0x74, 0xe8, 0x15, 0x10, - /* (2^135)P */ 0x4d, 0xcc, 0x3a, 0xd2, 0xfe, 0xe3, 0x8d, 0xc5, 0x2d, 0xbe, 0xa7, 0x94, 0xc2, 0x91, 0xdb, 0x50, 0x57, 0xf4, 0x9c, 0x1c, 0x3d, 0xd4, 0x94, 0x0b, 0x4a, 0x52, 0x37, 0x6e, 0xfa, 0x40, 0x16, 0x6b, - /* (2^136)P */ 0x09, 0x0d, 0xda, 0x5f, 0x6c, 0x34, 0x2f, 0x69, 0x51, 0x31, 0x4d, 0xfa, 0x59, 0x1c, 0x0b, 0x20, 0x96, 0xa2, 0x77, 0x07, 0x76, 0x6f, 0xc4, 0xb8, 0xcf, 0xfb, 0xfd, 0x3f, 0x5f, 0x39, 0x38, 0x4b, - /* (2^137)P */ 0x71, 0xd6, 0x54, 0xbe, 0x00, 0x5e, 0xd2, 0x18, 0xa6, 0xab, 0xc8, 0xbe, 0x82, 0x05, 0xd5, 0x60, 0x82, 0xb9, 0x78, 0x3b, 0x26, 0x8f, 0xad, 0x87, 0x32, 0x04, 0xda, 0x9c, 0x4e, 0xf6, 0xfd, 0x50, - /* (2^138)P */ 0xf0, 0xdc, 0x78, 0xc5, 0xaa, 0x67, 0xf5, 0x90, 0x3b, 0x13, 0xa3, 0xf2, 0x0e, 0x9b, 0x1e, 0xef, 0x71, 0xde, 0xd9, 0x42, 0x92, 0xba, 0xeb, 0x0e, 0xc7, 0x01, 0x31, 0xf0, 0x9b, 0x3c, 0x47, 0x15, - /* (2^139)P */ 0x95, 0x80, 0xb7, 0x56, 0xae, 0xe8, 0x77, 0x7c, 0x8e, 0x07, 0x6f, 0x6e, 0x66, 0xe7, 0x78, 0xb6, 0x1f, 0xba, 0x48, 0x53, 0x61, 0xb9, 0xa0, 0x2d, 0x0b, 0x3f, 0x73, 0xff, 0xc1, 0x31, 0xf9, 0x7c, - /* (2^140)P */ 0x6c, 0x36, 0x0a, 0x0a, 0xf5, 0x57, 0xb3, 0x26, 0x32, 0xd7, 0x87, 0x2b, 0xf4, 0x8c, 0x70, 0xe9, 0xc0, 0xb2, 0x1c, 0xf9, 0xa5, 0xee, 0x3a, 0xc1, 0x4c, 0xbb, 0x43, 0x11, 0x99, 0x0c, 0xd9, 0x35, - /* (2^141)P */ 0xdc, 0xd9, 0xa0, 0xa9, 0x04, 0xc4, 0xc1, 0x47, 0x51, 0xd2, 0x72, 0x19, 0x45, 0x58, 0x9e, 0x65, 0x31, 0x8c, 0xb3, 0x73, 0xc4, 0xa8, 0x75, 0x38, 0x24, 0x1f, 0x56, 0x79, 0xd3, 0x9e, 0xbd, 0x1f, - /* (2^142)P */ 0x8d, 0xc2, 0x1e, 0xd4, 0x6f, 0xbc, 0xfa, 0x11, 0xca, 0x2d, 0x2a, 0xcd, 0xe3, 0xdf, 0xf8, 0x7e, 0x95, 0x45, 0x40, 0x8c, 0x5d, 0x3b, 0xe7, 0x72, 0x27, 0x2f, 0xb7, 0x54, 0x49, 0xfa, 0x35, 0x61, - /* (2^143)P */ 0x9c, 0xb6, 0x24, 0xde, 0xa2, 0x32, 0xfc, 0xcc, 0x88, 0x5d, 0x09, 0x1f, 0x8c, 0x69, 0x55, 0x3f, 0x29, 0xf9, 0xc3, 0x5a, 0xed, 0x50, 0x33, 0xbe, 0xeb, 0x7e, 0x47, 0xca, 0x06, 0xf8, 0x9b, 0x5e, - /* (2^144)P */ 0x68, 0x9f, 0x30, 0x3c, 0xb6, 0x8f, 0xce, 0xe9, 0xf4, 0xf9, 0xe1, 0x65, 0x35, 0xf6, 0x76, 0x53, 0xf1, 0x93, 0x63, 0x5a, 0xb3, 0xcf, 0xaf, 0xd1, 0x06, 0x35, 0x62, 0xe5, 0xed, 0xa1, 0x32, 0x66, - /* (2^145)P */ 0x4c, 0xed, 0x2d, 0x0c, 0x39, 0x6c, 0x7d, 0x0b, 0x1f, 0xcb, 0x04, 0xdf, 0x81, 0x32, 0xcb, 0x56, 0xc7, 0xc3, 0xec, 0x49, 0x12, 0x5a, 0x30, 0x66, 0x2a, 0xa7, 0x8c, 0xa3, 0x60, 0x8b, 0x58, 0x5d, - /* (2^146)P */ 0x2d, 0xf4, 0xe5, 0xe8, 0x78, 0xbf, 0xec, 0xa6, 0xec, 0x3e, 0x8a, 0x3c, 0x4b, 0xb4, 0xee, 0x86, 0x04, 0x16, 0xd2, 0xfb, 0x48, 0x9c, 0x21, 0xec, 0x31, 0x67, 0xc3, 0x17, 0xf5, 0x1a, 0xaf, 0x1a, - /* (2^147)P */ 0xe7, 0xbd, 0x69, 0x67, 0x83, 0xa2, 0x06, 0xc3, 0xdb, 0x2a, 0x1e, 0x2b, 0x62, 0x80, 0x82, 0x20, 0xa6, 0x94, 0xff, 0xfb, 0x1f, 0xf5, 0x27, 0x80, 0x6b, 0xf2, 0x24, 0x11, 0xce, 0xa1, 0xcf, 0x76, - /* (2^148)P */ 0xb6, 0xab, 0x22, 0x24, 0x56, 0x00, 0xeb, 0x18, 0xc3, 0x29, 0x8c, 0x8f, 0xd5, 0xc4, 0x77, 0xf3, 0x1a, 0x56, 0x31, 0xf5, 0x07, 0xc2, 0xbb, 0x4d, 0x27, 0x8a, 0x12, 0x82, 0xf0, 0xb7, 0x53, 0x02, - /* (2^149)P */ 0xe0, 0x17, 0x2c, 0xb6, 0x1c, 0x09, 0x1f, 0x3d, 0xa9, 0x28, 0x46, 0xd6, 0xab, 0xe1, 0x60, 0x48, 0x53, 0x42, 0x9d, 0x30, 0x36, 0x74, 0xd1, 0x52, 0x76, 0xe5, 0xfa, 0x3e, 0xe1, 0x97, 0x6f, 0x35, - /* (2^150)P */ 0x5b, 0x53, 0x50, 0xa1, 0x1a, 0xe1, 0x51, 0xd3, 0xcc, 0x78, 0xd8, 0x1d, 0xbb, 0x45, 0x6b, 0x3e, 0x98, 0x2c, 0xd9, 0xbe, 0x28, 0x61, 0x77, 0x0c, 0xb8, 0x85, 0x28, 0x03, 0x93, 0xae, 0x34, 0x1d, - /* (2^151)P */ 0xc3, 0xa4, 0x5b, 0xa8, 0x8c, 0x48, 0xa0, 0x4b, 0xce, 0xe6, 0x9c, 0x3c, 0xc3, 0x48, 0x53, 0x98, 0x70, 0xa7, 0xbd, 0x97, 0x6f, 0x4c, 0x12, 0x66, 0x4a, 0x12, 0x54, 0x06, 0x29, 0xa0, 0x81, 0x0f, - /* (2^152)P */ 0xfd, 0x86, 0x9b, 0x56, 0xa6, 0x9c, 0xd0, 0x9e, 0x2d, 0x9a, 0xaf, 0x18, 0xfd, 0x09, 0x10, 0x81, 0x0a, 0xc2, 0xd8, 0x93, 0x3f, 0xd0, 0x08, 0xff, 0x6b, 0xf2, 0xae, 0x9f, 0x19, 0x48, 0xa1, 0x52, - /* (2^153)P */ 0x73, 0x1b, 0x8d, 0x2d, 0xdc, 0xf9, 0x03, 0x3e, 0x70, 0x1a, 0x96, 0x73, 0x18, 0x80, 0x05, 0x42, 0x70, 0x59, 0xa3, 0x41, 0xf0, 0x87, 0xd9, 0xc0, 0x49, 0xd5, 0xc0, 0xa1, 0x15, 0x1f, 0xaa, 0x07, - /* (2^154)P */ 0x24, 0x72, 0xd2, 0x8c, 0xe0, 0x6c, 0xd4, 0xdf, 0x39, 0x42, 0x4e, 0x93, 0x4f, 0x02, 0x0a, 0x6d, 0x59, 0x7b, 0x89, 0x99, 0x63, 0x7a, 0x8a, 0x80, 0xa2, 0x95, 0x3d, 0xe1, 0xe9, 0x56, 0x45, 0x0a, - /* (2^155)P */ 0x45, 0x30, 0xc1, 0xe9, 0x1f, 0x99, 0x1a, 0xd2, 0xb8, 0x51, 0x77, 0xfe, 0x48, 0x85, 0x0e, 0x9b, 0x35, 0x00, 0xf3, 0x4b, 0xcb, 0x43, 0xa6, 0x5d, 0x21, 0xf7, 0x40, 0x39, 0xd6, 0x28, 0xdb, 0x77, - /* (2^156)P */ 0x11, 0x90, 0xdc, 0x4a, 0x61, 0xeb, 0x5e, 0xfc, 0xeb, 0x11, 0xc4, 0xe8, 0x9a, 0x41, 0x29, 0x52, 0x74, 0xcf, 0x1d, 0x7d, 0x78, 0xe7, 0xc3, 0x9e, 0xb5, 0x4c, 0x6e, 0x21, 0x3e, 0x05, 0x0d, 0x34, - /* (2^157)P */ 0xb4, 0xf2, 0x8d, 0xb4, 0x39, 0xaf, 0xc7, 0xca, 0x94, 0x0a, 0xa1, 0x71, 0x28, 0xec, 0xfa, 0xc0, 0xed, 0x75, 0xa5, 0x5c, 0x24, 0x69, 0x0a, 0x14, 0x4c, 0x3a, 0x27, 0x34, 0x71, 0xc3, 0xf1, 0x0c, - /* (2^158)P */ 0xa5, 0xb8, 0x24, 0xc2, 0x6a, 0x30, 0xee, 0xc8, 0xb0, 0x30, 0x49, 0xcb, 0x7c, 0xee, 0xea, 0x57, 0x4f, 0xe7, 0xcb, 0xaa, 0xbd, 0x06, 0xe8, 0xa1, 0x7d, 0x65, 0xeb, 0x2e, 0x74, 0x62, 0x9a, 0x7d, - /* (2^159)P */ 0x30, 0x48, 0x6c, 0x54, 0xef, 0xb6, 0xb6, 0x9e, 0x2e, 0x6e, 0xb3, 0xdd, 0x1f, 0xca, 0x5c, 0x88, 0x05, 0x71, 0x0d, 0xef, 0x83, 0xf3, 0xb9, 0xe6, 0x12, 0x04, 0x2e, 0x9d, 0xef, 0x4f, 0x65, 0x58, - /* (2^160)P */ 0x26, 0x8e, 0x0e, 0xbe, 0xff, 0xc4, 0x05, 0xa9, 0x6e, 0x81, 0x31, 0x9b, 0xdf, 0xe5, 0x2d, 0x94, 0xe1, 0x88, 0x2e, 0x80, 0x3f, 0x72, 0x7d, 0x49, 0x8d, 0x40, 0x2f, 0x60, 0xea, 0x4d, 0x68, 0x30, - /* (2^161)P */ 0x34, 0xcb, 0xe6, 0xa3, 0x78, 0xa2, 0xe5, 0x21, 0xc4, 0x1d, 0x15, 0x5b, 0x6f, 0x6e, 0xfb, 0xae, 0x15, 0xca, 0x77, 0x9d, 0x04, 0x8e, 0x0b, 0xb3, 0x81, 0x89, 0xb9, 0x53, 0xcf, 0xc9, 0xc3, 0x28, - /* (2^162)P */ 0x2a, 0xdd, 0x6c, 0x55, 0x21, 0xb7, 0x7f, 0x28, 0x74, 0x22, 0x02, 0x97, 0xa8, 0x7c, 0x31, 0x0d, 0x58, 0x32, 0x54, 0x3a, 0x42, 0xc7, 0x68, 0x74, 0x2f, 0x64, 0xb5, 0x4e, 0x46, 0x11, 0x7f, 0x4a, - /* (2^163)P */ 0xa6, 0x3a, 0x19, 0x4d, 0x77, 0xa4, 0x37, 0xa2, 0xa1, 0x29, 0x21, 0xa9, 0x6e, 0x98, 0x65, 0xd8, 0x88, 0x1a, 0x7c, 0xf8, 0xec, 0x15, 0xc5, 0x24, 0xeb, 0xf5, 0x39, 0x5f, 0x57, 0x03, 0x40, 0x60, - /* (2^164)P */ 0x27, 0x9b, 0x0a, 0x57, 0x89, 0xf1, 0xb9, 0x47, 0x78, 0x4b, 0x5e, 0x46, 0xde, 0xce, 0x98, 0x2b, 0x20, 0x5c, 0xb8, 0xdb, 0x51, 0xf5, 0x6d, 0x02, 0x01, 0x19, 0xe2, 0x47, 0x10, 0xd9, 0xfc, 0x74, - /* (2^165)P */ 0xa3, 0xbf, 0xc1, 0x23, 0x0a, 0xa9, 0xe2, 0x13, 0xf6, 0x19, 0x85, 0x47, 0x4e, 0x07, 0xb0, 0x0c, 0x44, 0xcf, 0xf6, 0x3a, 0xbe, 0xcb, 0xf1, 0x5f, 0xbe, 0x2d, 0x81, 0xbe, 0x38, 0x54, 0xfe, 0x67, - /* (2^166)P */ 0xb0, 0x05, 0x0f, 0xa4, 0x4f, 0xf6, 0x3c, 0xd1, 0x87, 0x37, 0x28, 0x32, 0x2f, 0xfb, 0x4d, 0x05, 0xea, 0x2a, 0x0d, 0x7f, 0x5b, 0x91, 0x73, 0x41, 0x4e, 0x0d, 0x61, 0x1f, 0x4f, 0x14, 0x2f, 0x48, - /* (2^167)P */ 0x34, 0x82, 0x7f, 0xb4, 0x01, 0x02, 0x21, 0xf6, 0x90, 0xb9, 0x70, 0x9e, 0x92, 0xe1, 0x0a, 0x5d, 0x7c, 0x56, 0x49, 0xb0, 0x55, 0xf4, 0xd7, 0xdc, 0x01, 0x6f, 0x91, 0xf0, 0xf1, 0xd0, 0x93, 0x7e, - /* (2^168)P */ 0xfa, 0xb4, 0x7d, 0x8a, 0xf1, 0xcb, 0x79, 0xdd, 0x2f, 0xc6, 0x74, 0x6f, 0xbf, 0x91, 0x83, 0xbe, 0xbd, 0x91, 0x82, 0x4b, 0xd1, 0x45, 0x71, 0x02, 0x05, 0x17, 0xbf, 0x2c, 0xea, 0x73, 0x5a, 0x58, - /* (2^169)P */ 0xb2, 0x0d, 0x8a, 0x92, 0x3e, 0xa0, 0x5c, 0x48, 0xe7, 0x57, 0x28, 0x74, 0xa5, 0x01, 0xfc, 0x10, 0xa7, 0x51, 0xd5, 0xd6, 0xdb, 0x2e, 0x48, 0x2f, 0x8a, 0xdb, 0x8f, 0x04, 0xb5, 0x33, 0x04, 0x0f, - /* (2^170)P */ 0x47, 0x62, 0xdc, 0xd7, 0x8d, 0x2e, 0xda, 0x60, 0x9a, 0x81, 0xd4, 0x8c, 0xd3, 0xc9, 0xb4, 0x88, 0x97, 0x66, 0xf6, 0x01, 0xc0, 0x3a, 0x03, 0x13, 0x75, 0x7d, 0x36, 0x3b, 0xfe, 0x24, 0x3b, 0x27, - /* (2^171)P */ 0xd4, 0xb9, 0xb3, 0x31, 0x6a, 0xf6, 0xe8, 0xc6, 0xd5, 0x49, 0xdf, 0x94, 0xa4, 0x14, 0x15, 0x28, 0xa7, 0x3d, 0xb2, 0xc8, 0xdf, 0x6f, 0x72, 0xd1, 0x48, 0xe5, 0xde, 0x03, 0xd1, 0xe7, 0x3a, 0x4b, - /* (2^172)P */ 0x7e, 0x9d, 0x4b, 0xce, 0x19, 0x6e, 0x25, 0xc6, 0x1c, 0xc6, 0xe3, 0x86, 0xf1, 0x5c, 0x5c, 0xff, 0x45, 0xc1, 0x8e, 0x4b, 0xa3, 0x3c, 0xc6, 0xac, 0x74, 0x65, 0xe6, 0xfe, 0x88, 0x18, 0x62, 0x74, - /* (2^173)P */ 0x1e, 0x0a, 0x29, 0x45, 0x96, 0x40, 0x6f, 0x95, 0x2e, 0x96, 0x3a, 0x26, 0xe3, 0xf8, 0x0b, 0xef, 0x7b, 0x64, 0xc2, 0x5e, 0xeb, 0x50, 0x6a, 0xed, 0x02, 0x75, 0xca, 0x9d, 0x3a, 0x28, 0x94, 0x06, - /* (2^174)P */ 0xd1, 0xdc, 0xa2, 0x43, 0x36, 0x96, 0x9b, 0x76, 0x53, 0x53, 0xfc, 0x09, 0xea, 0xc8, 0xb7, 0x42, 0xab, 0x7e, 0x39, 0x13, 0xee, 0x2a, 0x00, 0x4f, 0x3a, 0xd6, 0xb7, 0x19, 0x2c, 0x5e, 0x00, 0x63, - /* (2^175)P */ 0xea, 0x3b, 0x02, 0x63, 0xda, 0x36, 0x67, 0xca, 0xb7, 0x99, 0x2a, 0xb1, 0x6d, 0x7f, 0x6c, 0x96, 0xe1, 0xc5, 0x37, 0xc5, 0x90, 0x93, 0xe0, 0xac, 0xee, 0x89, 0xaa, 0xa1, 0x63, 0x60, 0x69, 0x0b, - /* (2^176)P */ 0xe5, 0x56, 0x8c, 0x28, 0x97, 0x3e, 0xb0, 0xeb, 0xe8, 0x8b, 0x8c, 0x93, 0x9f, 0x9f, 0x2a, 0x43, 0x71, 0x7f, 0x71, 0x5b, 0x3d, 0xa9, 0xa5, 0xa6, 0x97, 0x9d, 0x8f, 0xe1, 0xc3, 0xb4, 0x5f, 0x1a, - /* (2^177)P */ 0xce, 0xcd, 0x60, 0x1c, 0xad, 0xe7, 0x94, 0x1c, 0xa0, 0xc4, 0x02, 0xfc, 0x43, 0x2a, 0x20, 0xee, 0x20, 0x6a, 0xc4, 0x67, 0xd8, 0xe4, 0xaf, 0x8d, 0x58, 0x7b, 0xc2, 0x8a, 0x3c, 0x26, 0x10, 0x0a, - /* (2^178)P */ 0x4a, 0x2a, 0x43, 0xe4, 0xdf, 0xa9, 0xde, 0xd0, 0xc5, 0x77, 0x92, 0xbe, 0x7b, 0xf8, 0x6a, 0x85, 0x1a, 0xc7, 0x12, 0xc2, 0xac, 0x72, 0x84, 0xce, 0x91, 0x1e, 0xbb, 0x9b, 0x6d, 0x1b, 0x15, 0x6f, - /* (2^179)P */ 0x6a, 0xd5, 0xee, 0x7c, 0x52, 0x6c, 0x77, 0x26, 0xec, 0xfa, 0xf8, 0xfb, 0xb7, 0x1c, 0x21, 0x7d, 0xcc, 0x09, 0x46, 0xfd, 0xa6, 0x66, 0xae, 0x37, 0x42, 0x0c, 0x77, 0xd2, 0x02, 0xb7, 0x81, 0x1f, - /* (2^180)P */ 0x92, 0x83, 0xc5, 0xea, 0x57, 0xb0, 0xb0, 0x2f, 0x9d, 0x4e, 0x74, 0x29, 0xfe, 0x89, 0xdd, 0xe1, 0xf8, 0xb4, 0xbe, 0x17, 0xeb, 0xf8, 0x64, 0xc9, 0x1e, 0xd4, 0xa2, 0xc9, 0x73, 0x10, 0x57, 0x29, - /* (2^181)P */ 0x54, 0xe2, 0xc0, 0x81, 0x89, 0xa1, 0x48, 0xa9, 0x30, 0x28, 0xb2, 0x65, 0x9b, 0x36, 0xf6, 0x2d, 0xc6, 0xd3, 0xcf, 0x5f, 0xd7, 0xb2, 0x3e, 0xa3, 0x1f, 0xa0, 0x99, 0x41, 0xec, 0xd6, 0x8c, 0x07, - /* (2^182)P */ 0x2f, 0x0d, 0x90, 0xad, 0x41, 0x4a, 0x58, 0x4a, 0x52, 0x4c, 0xc7, 0xe2, 0x78, 0x2b, 0x14, 0x32, 0x78, 0xc9, 0x31, 0x84, 0x33, 0xe8, 0xc4, 0x68, 0xc2, 0x9f, 0x68, 0x08, 0x90, 0xea, 0x69, 0x7f, - /* (2^183)P */ 0x65, 0x82, 0xa3, 0x46, 0x1e, 0xc8, 0xf2, 0x52, 0xfd, 0x32, 0xa8, 0x04, 0x2d, 0x07, 0x78, 0xfd, 0x94, 0x9e, 0x35, 0x25, 0xfa, 0xd5, 0xd7, 0x8c, 0xd2, 0x29, 0xcc, 0x54, 0x74, 0x1b, 0xe7, 0x4d, - /* (2^184)P */ 0xc9, 0x6a, 0xda, 0x1e, 0xad, 0x60, 0xeb, 0x42, 0x3a, 0x9c, 0xc0, 0xdb, 0xdf, 0x37, 0xad, 0x0a, 0x91, 0xc1, 0x3c, 0xe3, 0x71, 0x4b, 0x00, 0x81, 0x3c, 0x80, 0x22, 0x51, 0x34, 0xbe, 0xe6, 0x44, - /* (2^185)P */ 0xdb, 0x20, 0x19, 0xba, 0x88, 0x83, 0xfe, 0x03, 0x08, 0xb0, 0x0d, 0x15, 0x32, 0x7c, 0xd5, 0xf5, 0x29, 0x0c, 0xf6, 0x1a, 0x28, 0xc4, 0xc8, 0x49, 0xee, 0x1a, 0x70, 0xde, 0x18, 0xb5, 0xed, 0x21, - /* (2^186)P */ 0x99, 0xdc, 0x06, 0x8f, 0x41, 0x3e, 0xb6, 0x7f, 0xb8, 0xd7, 0x66, 0xc1, 0x99, 0x0d, 0x46, 0xa4, 0x83, 0x0a, 0x52, 0xce, 0x48, 0x52, 0xdd, 0x24, 0x58, 0x83, 0x92, 0x2b, 0x71, 0xad, 0xc3, 0x5e, - /* (2^187)P */ 0x0f, 0x93, 0x17, 0xbd, 0x5f, 0x2a, 0x02, 0x15, 0xe3, 0x70, 0x25, 0xd8, 0x77, 0x4a, 0xf6, 0xa4, 0x12, 0x37, 0x78, 0x15, 0x69, 0x8d, 0xbc, 0x12, 0xbb, 0x0a, 0x62, 0xfc, 0xc0, 0x94, 0x81, 0x49, - /* (2^188)P */ 0x82, 0x6c, 0x68, 0x55, 0xd2, 0xd9, 0xa2, 0x38, 0xf0, 0x21, 0x3e, 0x19, 0xd9, 0x6b, 0x5c, 0x78, 0x84, 0x54, 0x4a, 0xb2, 0x1a, 0xc8, 0xd5, 0xe4, 0x89, 0x09, 0xe2, 0xb2, 0x60, 0x78, 0x30, 0x56, - /* (2^189)P */ 0xc4, 0x74, 0x4d, 0x8b, 0xf7, 0x55, 0x9d, 0x42, 0x31, 0x01, 0x35, 0x43, 0x46, 0x83, 0xf1, 0x22, 0xff, 0x1f, 0xc7, 0x98, 0x45, 0xc2, 0x60, 0x1e, 0xef, 0x83, 0x99, 0x97, 0x14, 0xf0, 0xf2, 0x59, - /* (2^190)P */ 0x44, 0x4a, 0x49, 0xeb, 0x56, 0x7d, 0xa4, 0x46, 0x8e, 0xa1, 0x36, 0xd6, 0x54, 0xa8, 0x22, 0x3e, 0x3b, 0x1c, 0x49, 0x74, 0x52, 0xe1, 0x46, 0xb3, 0xe7, 0xcd, 0x90, 0x53, 0x4e, 0xfd, 0xea, 0x2c, - /* (2^191)P */ 0x75, 0x66, 0x0d, 0xbe, 0x38, 0x85, 0x8a, 0xba, 0x23, 0x8e, 0x81, 0x50, 0xbb, 0x74, 0x90, 0x4b, 0xc3, 0x04, 0xd3, 0x85, 0x90, 0xb8, 0xda, 0xcb, 0xc4, 0x92, 0x61, 0xe5, 0xe0, 0x4f, 0xa2, 0x61, - /* (2^192)P */ 0xcb, 0x5b, 0x52, 0xdb, 0xe6, 0x15, 0x76, 0xcb, 0xca, 0xe4, 0x67, 0xa5, 0x35, 0x8c, 0x7d, 0xdd, 0x69, 0xdd, 0xfc, 0xca, 0x3a, 0x15, 0xb4, 0xe6, 0x66, 0x97, 0x3c, 0x7f, 0x09, 0x8e, 0x66, 0x2d, - /* (2^193)P */ 0xf0, 0x5e, 0xe5, 0x5c, 0x26, 0x7e, 0x7e, 0xa5, 0x67, 0xb9, 0xd4, 0x7c, 0x52, 0x4e, 0x9f, 0x5d, 0xe5, 0xd1, 0x2f, 0x49, 0x06, 0x36, 0xc8, 0xfb, 0xae, 0xf7, 0xc3, 0xb7, 0xbe, 0x52, 0x0d, 0x09, - /* (2^194)P */ 0x7c, 0x4d, 0x7b, 0x1e, 0x5a, 0x51, 0xb9, 0x09, 0xc0, 0x44, 0xda, 0x99, 0x25, 0x6a, 0x26, 0x1f, 0x04, 0x55, 0xc5, 0xe2, 0x48, 0x95, 0xc4, 0xa1, 0xcc, 0x15, 0x6f, 0x12, 0x87, 0x42, 0xf0, 0x7e, - /* (2^195)P */ 0x15, 0xef, 0x30, 0xbd, 0x9d, 0x65, 0xd1, 0xfe, 0x7b, 0x27, 0xe0, 0xc4, 0xee, 0xb9, 0x4a, 0x8b, 0x91, 0x32, 0xdf, 0xa5, 0x36, 0x62, 0x4d, 0x88, 0x88, 0xf7, 0x5c, 0xbf, 0xa6, 0x6e, 0xd9, 0x1f, - /* (2^196)P */ 0x9a, 0x0d, 0x19, 0x1f, 0x98, 0x61, 0xa1, 0x42, 0xc1, 0x52, 0x60, 0x7e, 0x50, 0x49, 0xd8, 0x61, 0xd5, 0x2c, 0x5a, 0x28, 0xbf, 0x13, 0xe1, 0x9f, 0xd8, 0x85, 0xad, 0xdb, 0x76, 0xd6, 0x22, 0x7c, - /* (2^197)P */ 0x7d, 0xd2, 0xfb, 0x2b, 0xed, 0x70, 0xe7, 0x82, 0xa5, 0xf5, 0x96, 0xe9, 0xec, 0xb2, 0x05, 0x4c, 0x50, 0x01, 0x90, 0xb0, 0xc2, 0xa9, 0x40, 0xcd, 0x64, 0xbf, 0xd9, 0x13, 0x92, 0x31, 0x95, 0x58, - /* (2^198)P */ 0x08, 0x2e, 0xea, 0x3f, 0x70, 0x5d, 0xcc, 0xe7, 0x8c, 0x18, 0xe2, 0x58, 0x12, 0x49, 0x0c, 0xb5, 0xf0, 0x5b, 0x20, 0x48, 0xaa, 0x0b, 0xe3, 0xcc, 0x62, 0x2d, 0xa3, 0xcf, 0x9c, 0x65, 0x7c, 0x53, - /* (2^199)P */ 0x88, 0xc0, 0xcf, 0x98, 0x3a, 0x62, 0xb6, 0x37, 0xa4, 0xac, 0xd6, 0xa4, 0x1f, 0xed, 0x9b, 0xfe, 0xb0, 0xd1, 0xa8, 0x56, 0x8e, 0x9b, 0xd2, 0x04, 0x75, 0x95, 0x51, 0x0b, 0xc4, 0x71, 0x5f, 0x72, - /* (2^200)P */ 0xe6, 0x9c, 0x33, 0xd0, 0x9c, 0xf8, 0xc7, 0x28, 0x8b, 0xc1, 0xdd, 0x69, 0x44, 0xb1, 0x67, 0x83, 0x2c, 0x65, 0xa1, 0xa6, 0x83, 0xda, 0x3a, 0x88, 0x17, 0x6c, 0x4d, 0x03, 0x74, 0x19, 0x5f, 0x58, - /* (2^201)P */ 0x88, 0x91, 0xb1, 0xf1, 0x66, 0xb2, 0xcf, 0x89, 0x17, 0x52, 0xc3, 0xe7, 0x63, 0x48, 0x3b, 0xe6, 0x6a, 0x52, 0xc0, 0xb4, 0xa6, 0x9d, 0x8c, 0xd8, 0x35, 0x46, 0x95, 0xf0, 0x9d, 0x5c, 0x03, 0x3e, - /* (2^202)P */ 0x9d, 0xde, 0x45, 0xfb, 0x12, 0x54, 0x9d, 0xdd, 0x0d, 0xf4, 0xcf, 0xe4, 0x32, 0x45, 0x68, 0xdd, 0x1c, 0x67, 0x1d, 0x15, 0x9b, 0x99, 0x5c, 0x4b, 0x90, 0xf6, 0xe7, 0x11, 0xc8, 0x2c, 0x8c, 0x2d, - /* (2^203)P */ 0x40, 0x5d, 0x05, 0x90, 0x1d, 0xbe, 0x54, 0x7f, 0x40, 0xaf, 0x4a, 0x46, 0xdf, 0xc5, 0x64, 0xa4, 0xbe, 0x17, 0xe9, 0xf0, 0x24, 0x96, 0x97, 0x33, 0x30, 0x6b, 0x35, 0x27, 0xc5, 0x8d, 0x01, 0x2c, - /* (2^204)P */ 0xd4, 0xb3, 0x30, 0xe3, 0x24, 0x50, 0x41, 0xa5, 0xd3, 0x52, 0x16, 0x69, 0x96, 0x3d, 0xff, 0x73, 0xf1, 0x59, 0x9b, 0xef, 0xc4, 0x42, 0xec, 0x94, 0x5a, 0x8e, 0xd0, 0x18, 0x16, 0x20, 0x47, 0x07, - /* (2^205)P */ 0x53, 0x1c, 0x41, 0xca, 0x8a, 0xa4, 0x6c, 0x4d, 0x19, 0x61, 0xa6, 0xcf, 0x2f, 0x5f, 0x41, 0x66, 0xff, 0x27, 0xe2, 0x51, 0x00, 0xd4, 0x4d, 0x9c, 0xeb, 0xf7, 0x02, 0x9a, 0xc0, 0x0b, 0x81, 0x59, - /* (2^206)P */ 0x1d, 0x10, 0xdc, 0xb3, 0x71, 0xb1, 0x7e, 0x2a, 0x8e, 0xf6, 0xfe, 0x9f, 0xb9, 0x5a, 0x1c, 0x44, 0xea, 0x59, 0xb3, 0x93, 0x9b, 0x5c, 0x02, 0x32, 0x2f, 0x11, 0x9d, 0x1e, 0xa7, 0xe0, 0x8c, 0x5e, - /* (2^207)P */ 0xfd, 0x03, 0x95, 0x42, 0x92, 0xcb, 0xcc, 0xbf, 0x55, 0x5d, 0x09, 0x2f, 0x75, 0xba, 0x71, 0xd2, 0x1e, 0x09, 0x2d, 0x97, 0x5e, 0xad, 0x5e, 0x34, 0xba, 0x03, 0x31, 0xa8, 0x11, 0xdf, 0xc8, 0x18, - /* (2^208)P */ 0x4c, 0x0f, 0xed, 0x9a, 0x9a, 0x94, 0xcd, 0x90, 0x7e, 0xe3, 0x60, 0x66, 0xcb, 0xf4, 0xd1, 0xc5, 0x0b, 0x2e, 0xc5, 0x56, 0x2d, 0xc5, 0xca, 0xb8, 0x0d, 0x8e, 0x80, 0xc5, 0x00, 0xe4, 0x42, 0x6e, - /* (2^209)P */ 0x23, 0xfd, 0xae, 0xee, 0x66, 0x69, 0xb4, 0xa3, 0xca, 0xcd, 0x9e, 0xe3, 0x0b, 0x1f, 0x4f, 0x0c, 0x1d, 0xa5, 0x83, 0xd6, 0xc9, 0xc8, 0x9d, 0x18, 0x1b, 0x35, 0x09, 0x4c, 0x05, 0x7f, 0xf2, 0x51, - /* (2^210)P */ 0x82, 0x06, 0x32, 0x2a, 0xcd, 0x7c, 0x48, 0x4c, 0x96, 0x1c, 0xdf, 0xb3, 0x5b, 0xa9, 0x7e, 0x58, 0xe8, 0xb8, 0x5c, 0x55, 0x9e, 0xf7, 0xcc, 0xc8, 0x3d, 0xd7, 0x06, 0xa2, 0x29, 0xc8, 0x7d, 0x54, - /* (2^211)P */ 0x06, 0x9b, 0xc3, 0x80, 0xcd, 0xa6, 0x22, 0xb8, 0xc6, 0xd4, 0x00, 0x20, 0x73, 0x54, 0x6d, 0xe9, 0x4d, 0x3b, 0x46, 0x91, 0x6f, 0x5b, 0x53, 0x28, 0x1d, 0x6e, 0x48, 0xe2, 0x60, 0x46, 0x8f, 0x22, - /* (2^212)P */ 0xbf, 0x3a, 0x8d, 0xde, 0x38, 0x95, 0x79, 0x98, 0x6e, 0xca, 0xeb, 0x45, 0x00, 0x33, 0xd8, 0x8c, 0x38, 0xe7, 0x21, 0x82, 0x00, 0x2a, 0x95, 0x79, 0xbb, 0xd2, 0x5c, 0x53, 0xa7, 0xe1, 0x22, 0x43, - /* (2^213)P */ 0x1c, 0x80, 0xd1, 0x19, 0x18, 0xc1, 0x14, 0xb1, 0xc7, 0x5e, 0x3f, 0x4f, 0xd8, 0xe4, 0x16, 0x20, 0x4c, 0x0f, 0x26, 0x09, 0xf4, 0x2d, 0x0e, 0xdd, 0x66, 0x72, 0x5f, 0xae, 0xc0, 0x62, 0xc3, 0x5e, - /* (2^214)P */ 0xee, 0xb4, 0xb2, 0xb8, 0x18, 0x2b, 0x46, 0xc0, 0xfb, 0x1a, 0x4d, 0x27, 0x50, 0xd9, 0xc8, 0x7c, 0xd2, 0x02, 0x6b, 0x43, 0x05, 0x71, 0x5f, 0xf2, 0xd3, 0xcc, 0xf9, 0xbf, 0xdc, 0xf8, 0xbb, 0x43, - /* (2^215)P */ 0xdf, 0xe9, 0x39, 0xa0, 0x67, 0x17, 0xad, 0xb6, 0x83, 0x35, 0x9d, 0xf6, 0xa8, 0x4d, 0x71, 0xb0, 0xf5, 0x31, 0x29, 0xb4, 0x18, 0xfa, 0x55, 0x5e, 0x61, 0x09, 0xc6, 0x33, 0x8f, 0x55, 0xd5, 0x4e, - /* (2^216)P */ 0xdd, 0xa5, 0x47, 0xc6, 0x01, 0x79, 0xe3, 0x1f, 0x57, 0xd3, 0x81, 0x80, 0x1f, 0xdf, 0x3d, 0x59, 0xa6, 0xd7, 0x3f, 0x81, 0xfd, 0xa4, 0x49, 0x02, 0x61, 0xaf, 0x9c, 0x4e, 0x27, 0xca, 0xac, 0x69, - /* (2^217)P */ 0xc9, 0x21, 0x07, 0x33, 0xea, 0xa3, 0x7b, 0x04, 0xa0, 0x1e, 0x7e, 0x0e, 0xc2, 0x3f, 0x42, 0x83, 0x60, 0x4a, 0x31, 0x01, 0xaf, 0xc0, 0xf4, 0x1d, 0x27, 0x95, 0x28, 0x89, 0xab, 0x2d, 0xa6, 0x09, - /* (2^218)P */ 0x00, 0xcb, 0xc6, 0x9c, 0xa4, 0x25, 0xb3, 0xa5, 0xb6, 0x6c, 0xb5, 0x54, 0xc6, 0x5d, 0x4b, 0xe9, 0xa0, 0x94, 0xc9, 0xad, 0x79, 0x87, 0xe2, 0x3b, 0xad, 0x4a, 0x3a, 0xba, 0xf8, 0xe8, 0x96, 0x42, - /* (2^219)P */ 0xab, 0x1e, 0x45, 0x1e, 0x76, 0x89, 0x86, 0x32, 0x4a, 0x59, 0x59, 0xff, 0x8b, 0x59, 0x4d, 0x2e, 0x4a, 0x08, 0xa7, 0xd7, 0x53, 0x68, 0xb9, 0x49, 0xa8, 0x20, 0x14, 0x60, 0x19, 0xa3, 0x80, 0x49, - /* (2^220)P */ 0x42, 0x2c, 0x55, 0x2f, 0xe1, 0xb9, 0x65, 0x95, 0x96, 0xfe, 0x00, 0x71, 0xdb, 0x18, 0x53, 0x8a, 0xd7, 0xd0, 0xad, 0x43, 0x4d, 0x0b, 0xc9, 0x05, 0xda, 0x4e, 0x5d, 0x6a, 0xd6, 0x4c, 0x8b, 0x53, - /* (2^221)P */ 0x9f, 0x03, 0x9f, 0xe8, 0xc3, 0x4f, 0xe9, 0xf4, 0x45, 0x80, 0x61, 0x6f, 0xf2, 0x9a, 0x2c, 0x59, 0x50, 0x95, 0x4b, 0xfd, 0xb5, 0x6e, 0xa3, 0x08, 0x19, 0x14, 0xed, 0xc2, 0xf6, 0xfa, 0xff, 0x25, - /* (2^222)P */ 0x54, 0xd3, 0x79, 0xcc, 0x59, 0x44, 0x43, 0x34, 0x6b, 0x47, 0xd5, 0xb1, 0xb4, 0xbf, 0xec, 0xee, 0x99, 0x5d, 0x61, 0x61, 0xa0, 0x34, 0xeb, 0xdd, 0x73, 0xb7, 0x64, 0xeb, 0xcc, 0xce, 0x29, 0x51, - /* (2^223)P */ 0x20, 0x35, 0x99, 0x94, 0x58, 0x21, 0x43, 0xee, 0x3b, 0x0b, 0x4c, 0xf1, 0x7c, 0x9c, 0x2f, 0x77, 0xd5, 0xda, 0xbe, 0x06, 0xe3, 0xfc, 0xe2, 0xd2, 0x97, 0x6a, 0xf0, 0x46, 0xb5, 0x42, 0x5f, 0x71, - /* (2^224)P */ 0x1a, 0x5f, 0x5b, 0xda, 0xce, 0xcd, 0x4e, 0x43, 0xa9, 0x41, 0x97, 0xa4, 0x15, 0x71, 0xa1, 0x0d, 0x2e, 0xad, 0xed, 0x73, 0x7c, 0xd7, 0x0b, 0x68, 0x41, 0x90, 0xdd, 0x4e, 0x35, 0x02, 0x7c, 0x48, - /* (2^225)P */ 0xc4, 0xd9, 0x0e, 0xa7, 0xf3, 0xef, 0xef, 0xb8, 0x02, 0xe3, 0x57, 0xe8, 0xa3, 0x2a, 0xa3, 0x56, 0xa0, 0xa5, 0xa2, 0x48, 0xbd, 0x68, 0x3a, 0xdf, 0x44, 0xc4, 0x76, 0x31, 0xb7, 0x50, 0xf6, 0x07, - /* (2^226)P */ 0xb1, 0xcc, 0xe0, 0x26, 0x16, 0x9b, 0x8b, 0xe3, 0x36, 0xfb, 0x09, 0x8b, 0xc1, 0x53, 0xe0, 0x79, 0x64, 0x49, 0xf9, 0xc9, 0x19, 0x03, 0xd9, 0x56, 0xc4, 0xf5, 0x9f, 0xac, 0xe7, 0x41, 0xa9, 0x1c, - /* (2^227)P */ 0xbb, 0xa0, 0x2f, 0x16, 0x29, 0xdf, 0xc4, 0x49, 0x05, 0x33, 0xb3, 0x82, 0x32, 0xcf, 0x88, 0x84, 0x7d, 0x43, 0xbb, 0xca, 0x14, 0xda, 0xdf, 0x95, 0x86, 0xad, 0xd5, 0x64, 0x82, 0xf7, 0x91, 0x33, - /* (2^228)P */ 0x5d, 0x09, 0xb5, 0xe2, 0x6a, 0xe0, 0x9a, 0x72, 0x46, 0xa9, 0x59, 0x32, 0xd7, 0x58, 0x8a, 0xd5, 0xed, 0x21, 0x39, 0xd1, 0x62, 0x42, 0x83, 0xe9, 0x92, 0xb5, 0x4b, 0xa5, 0xfa, 0xda, 0xfe, 0x27, - /* (2^229)P */ 0xbb, 0x48, 0xad, 0x29, 0xb8, 0xc5, 0x9d, 0xa9, 0x60, 0xe2, 0x9e, 0x49, 0x42, 0x57, 0x02, 0x5f, 0xfd, 0x13, 0x75, 0x5d, 0xcd, 0x8e, 0x2c, 0x80, 0x38, 0xd9, 0x6d, 0x3f, 0xef, 0xb3, 0xce, 0x78, - /* (2^230)P */ 0x94, 0x5d, 0x13, 0x8a, 0x4f, 0xf4, 0x42, 0xc3, 0xa3, 0xdd, 0x8c, 0x82, 0x44, 0xdb, 0x9e, 0x7b, 0xe7, 0xcf, 0x37, 0x05, 0x1a, 0xd1, 0x36, 0x94, 0xc8, 0xb4, 0x1a, 0xec, 0x64, 0xb1, 0x64, 0x50, - /* (2^231)P */ 0xfc, 0xb2, 0x7e, 0xd3, 0xcf, 0xec, 0x20, 0x70, 0xfc, 0x25, 0x0d, 0xd9, 0x3e, 0xea, 0x31, 0x1f, 0x34, 0xbb, 0xa1, 0xdf, 0x7b, 0x0d, 0x93, 0x1b, 0x44, 0x30, 0x11, 0x48, 0x7a, 0x46, 0x44, 0x53, - /* (2^232)P */ 0xfb, 0x6d, 0x5e, 0xf2, 0x70, 0x31, 0x07, 0x70, 0xc8, 0x4c, 0x11, 0x50, 0x1a, 0xdc, 0x85, 0xe3, 0x00, 0x4f, 0xfc, 0xc8, 0x8a, 0x69, 0x48, 0x23, 0xd8, 0x40, 0xdd, 0x84, 0x52, 0xa5, 0x77, 0x2a, - /* (2^233)P */ 0xe4, 0x6c, 0x8c, 0xc9, 0xe0, 0xaf, 0x06, 0xfe, 0xe4, 0xd6, 0xdf, 0xdd, 0x96, 0xdf, 0x35, 0xc2, 0xd3, 0x1e, 0xbf, 0x33, 0x1e, 0xd0, 0x28, 0x14, 0xaf, 0xbd, 0x00, 0x93, 0xec, 0x68, 0x57, 0x78, - /* (2^234)P */ 0x3b, 0xb6, 0xde, 0x91, 0x7a, 0xe5, 0x02, 0x97, 0x80, 0x8b, 0xce, 0xe5, 0xbf, 0xb8, 0xbd, 0x61, 0xac, 0x58, 0x1d, 0x3d, 0x6f, 0x42, 0x5b, 0x64, 0xbc, 0x57, 0xa5, 0x27, 0x22, 0xa8, 0x04, 0x48, - /* (2^235)P */ 0x01, 0x26, 0x4d, 0xb4, 0x8a, 0x04, 0x57, 0x8e, 0x35, 0x69, 0x3a, 0x4b, 0x1a, 0x50, 0xd6, 0x68, 0x93, 0xc2, 0xe1, 0xf9, 0xc3, 0x9e, 0x9c, 0xc3, 0xe2, 0x63, 0xde, 0xd4, 0x57, 0xf2, 0x72, 0x41, - /* (2^236)P */ 0x01, 0x64, 0x0c, 0x33, 0x50, 0xb4, 0x68, 0xd3, 0x91, 0x23, 0x8f, 0x41, 0x17, 0x30, 0x0d, 0x04, 0x0d, 0xd9, 0xb7, 0x90, 0x60, 0xbb, 0x34, 0x2c, 0x1f, 0xd5, 0xdf, 0x8f, 0x22, 0x49, 0xf6, 0x16, - /* (2^237)P */ 0xf5, 0x8e, 0x92, 0x2b, 0x8e, 0x81, 0xa6, 0xbe, 0x72, 0x1e, 0xc1, 0xcd, 0x91, 0xcf, 0x8c, 0xe2, 0xcd, 0x36, 0x7a, 0xe7, 0x68, 0xaa, 0x4a, 0x59, 0x0f, 0xfd, 0x7f, 0x6c, 0x80, 0x34, 0x30, 0x31, - /* (2^238)P */ 0x65, 0xbd, 0x49, 0x22, 0xac, 0x27, 0x9d, 0x8a, 0x12, 0x95, 0x8e, 0x01, 0x64, 0xb4, 0xa3, 0x19, 0xc7, 0x7e, 0xb3, 0x52, 0xf3, 0xcf, 0x6c, 0xc2, 0x21, 0x7b, 0x79, 0x1d, 0x34, 0x68, 0x6f, 0x05, - /* (2^239)P */ 0x27, 0x23, 0xfd, 0x7e, 0x75, 0xd6, 0x79, 0x5e, 0x15, 0xfe, 0x3a, 0x55, 0xb6, 0xbc, 0xbd, 0xfa, 0x60, 0x5a, 0xaf, 0x6e, 0x2c, 0x22, 0xe7, 0xd3, 0x3b, 0x74, 0xae, 0x4d, 0x6d, 0xc7, 0x46, 0x70, - /* (2^240)P */ 0x55, 0x4a, 0x8d, 0xb1, 0x72, 0xe8, 0x0b, 0x66, 0x96, 0x14, 0x4e, 0x57, 0x18, 0x25, 0x99, 0x19, 0xbb, 0xdc, 0x2b, 0x30, 0x3a, 0x05, 0x03, 0xc1, 0x8e, 0x8e, 0x21, 0x0b, 0x80, 0xe9, 0xd8, 0x3e, - /* (2^241)P */ 0x3e, 0xe0, 0x75, 0xfa, 0x39, 0x92, 0x0b, 0x7b, 0x83, 0xc0, 0x33, 0x46, 0x68, 0xfb, 0xe9, 0xef, 0x93, 0x77, 0x1a, 0x39, 0xbe, 0x5f, 0xa3, 0x98, 0x34, 0xfe, 0xd0, 0xe2, 0x0f, 0x51, 0x65, 0x60, - /* (2^242)P */ 0x0c, 0xad, 0xab, 0x48, 0x85, 0x66, 0xcb, 0x55, 0x27, 0xe5, 0x87, 0xda, 0x48, 0x45, 0x58, 0xb4, 0xdd, 0xc1, 0x07, 0x01, 0xea, 0xec, 0x43, 0x2c, 0x35, 0xde, 0x72, 0x93, 0x80, 0x28, 0x60, 0x52, - /* (2^243)P */ 0x1f, 0x3b, 0x21, 0xf9, 0x6a, 0xc5, 0x15, 0x34, 0xdb, 0x98, 0x7e, 0x01, 0x4d, 0x1a, 0xee, 0x5b, 0x9b, 0x70, 0xcf, 0xb5, 0x05, 0xb1, 0xf6, 0x13, 0xb6, 0x9a, 0xb2, 0x82, 0x34, 0x0e, 0xf2, 0x5f, - /* (2^244)P */ 0x90, 0x6c, 0x2e, 0xcc, 0x75, 0x9c, 0xa2, 0x0a, 0x06, 0xe2, 0x70, 0x3a, 0xca, 0x73, 0x7d, 0xfc, 0x15, 0xc5, 0xb5, 0xc4, 0x8f, 0xc3, 0x9f, 0x89, 0x07, 0xc2, 0xff, 0x24, 0xb1, 0x86, 0x03, 0x25, - /* (2^245)P */ 0x56, 0x2b, 0x3d, 0xae, 0xd5, 0x28, 0xea, 0x54, 0xce, 0x60, 0xde, 0xd6, 0x9d, 0x14, 0x13, 0x99, 0xc1, 0xd6, 0x06, 0x8f, 0xc5, 0x4f, 0x69, 0x16, 0xc7, 0x8f, 0x01, 0xeb, 0x75, 0x39, 0xb2, 0x46, - /* (2^246)P */ 0xe2, 0xb4, 0xb7, 0xb4, 0x0f, 0x6a, 0x0a, 0x47, 0xde, 0x53, 0x72, 0x8f, 0x5a, 0x47, 0x92, 0x5d, 0xdb, 0x3a, 0xbd, 0x2f, 0xb5, 0xe5, 0xee, 0xab, 0x68, 0x69, 0x80, 0xa0, 0x01, 0x08, 0xa2, 0x7f, - /* (2^247)P */ 0xd2, 0x14, 0x77, 0x9f, 0xf1, 0xfa, 0xf3, 0x76, 0xc3, 0x60, 0x46, 0x2f, 0xc1, 0x40, 0xe8, 0xb3, 0x4e, 0x74, 0x12, 0xf2, 0x8d, 0xcd, 0xb4, 0x0f, 0xd2, 0x2d, 0x3a, 0x1d, 0x25, 0x5a, 0x06, 0x4b, - /* (2^248)P */ 0x4a, 0xcd, 0x77, 0x3d, 0x38, 0xde, 0xeb, 0x5c, 0xb1, 0x9c, 0x2c, 0x88, 0xdf, 0x39, 0xdf, 0x6a, 0x59, 0xf7, 0x9a, 0xb0, 0x2e, 0x24, 0xdd, 0xa2, 0x22, 0x64, 0x5f, 0x0e, 0xe5, 0xc0, 0x47, 0x31, - /* (2^249)P */ 0xdb, 0x50, 0x13, 0x1d, 0x10, 0xa5, 0x4c, 0x16, 0x62, 0xc9, 0x3f, 0xc3, 0x79, 0x34, 0xd1, 0xf8, 0x08, 0xda, 0xe5, 0x13, 0x4d, 0xce, 0x40, 0xe6, 0xba, 0xf8, 0x61, 0x50, 0xc4, 0xe0, 0xde, 0x4b, - /* (2^250)P */ 0xc9, 0xb1, 0xed, 0xa4, 0xc1, 0x6d, 0xc4, 0xd7, 0x8a, 0xd9, 0x7f, 0x43, 0xb6, 0xd7, 0x14, 0x55, 0x0b, 0xc0, 0xa1, 0xb2, 0x6b, 0x2f, 0x94, 0x58, 0x0e, 0x71, 0x70, 0x1d, 0xab, 0xb2, 0xff, 0x2d, - /* (2^251)P */ 0x68, 0x6d, 0x8b, 0xc1, 0x2f, 0xcf, 0xdf, 0xcc, 0x67, 0x61, 0x80, 0xb7, 0xa8, 0xcb, 0xeb, 0xa8, 0xe3, 0x37, 0x29, 0x5e, 0xf9, 0x97, 0x06, 0x98, 0x8c, 0x6e, 0x12, 0xd0, 0x1c, 0xba, 0xfb, 0x02, - /* (2^252)P */ 0x65, 0x45, 0xff, 0xad, 0x60, 0xc3, 0x98, 0xcb, 0x19, 0x15, 0xdb, 0x4b, 0xd2, 0x01, 0x71, 0x44, 0xd5, 0x15, 0xfb, 0x75, 0x74, 0xc8, 0xc4, 0x98, 0x7d, 0xa2, 0x22, 0x6e, 0x6d, 0xc7, 0xf8, 0x05, - /* (2^253)P */ 0x94, 0xf4, 0xb9, 0xfe, 0xdf, 0xe5, 0x69, 0xab, 0x75, 0x6b, 0x40, 0x18, 0x9d, 0xc7, 0x09, 0xae, 0x1d, 0x2d, 0xa4, 0x94, 0xfb, 0x45, 0x9b, 0x19, 0x84, 0xfa, 0x2a, 0xae, 0xeb, 0x0a, 0x71, 0x79, - /* (2^254)P */ 0xdf, 0xd2, 0x34, 0xf3, 0xa7, 0xed, 0xad, 0xa6, 0xb4, 0x57, 0x2a, 0xaf, 0x51, 0x9c, 0xde, 0x7b, 0xa8, 0xea, 0xdc, 0x86, 0x4f, 0xc6, 0x8f, 0xa9, 0x7b, 0xd0, 0x0e, 0xc2, 0x35, 0x03, 0xbe, 0x6b, - /* (2^255)P */ 0x44, 0x43, 0x98, 0x53, 0xbe, 0xdc, 0x7f, 0x66, 0xa8, 0x49, 0x59, 0x00, 0x1c, 0xbc, 0x72, 0x07, 0x8e, 0xd6, 0xbe, 0x4e, 0x9f, 0xa4, 0x07, 0xba, 0xbf, 0x30, 0xdf, 0xba, 0x85, 0xb0, 0xa7, 0x1f, -} diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve.go b/vendor/github.com/cloudflare/circl/dh/x448/curve.go deleted file mode 100644 index d59564e4b4..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve.go +++ /dev/null @@ -1,104 +0,0 @@ -package x448 - -import ( - fp "github.com/cloudflare/circl/math/fp448" -) - -// ladderJoye calculates a fixed-point multiplication with the generator point. -// The algorithm is the right-to-left Joye's ladder as described -// in "How to precompute a ladder" in SAC'2017. -func ladderJoye(k *Key) { - w := [5]fp.Elt{} // [mu,x1,z1,x2,z2] order must be preserved. - w[1] = fp.Elt{ // x1 = S - 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - } - fp.SetOne(&w[2]) // z1 = 1 - w[3] = fp.Elt{ // x2 = G-S - 0x20, 0x27, 0x9d, 0xc9, 0x7d, 0x19, 0xb1, 0xac, - 0xf8, 0xba, 0x69, 0x1c, 0xff, 0x33, 0xac, 0x23, - 0x51, 0x1b, 0xce, 0x3a, 0x64, 0x65, 0xbd, 0xf1, - 0x23, 0xf8, 0xc1, 0x84, 0x9d, 0x45, 0x54, 0x29, - 0x67, 0xb9, 0x81, 0x1c, 0x03, 0xd1, 0xcd, 0xda, - 0x7b, 0xeb, 0xff, 0x1a, 0x88, 0x03, 0xcf, 0x3a, - 0x42, 0x44, 0x32, 0x01, 0x25, 0xb7, 0xfa, 0xf0, - } - fp.SetOne(&w[4]) // z2 = 1 - - const n = 448 - const h = 2 - swap := uint(1) - for s := 0; s < n-h; s++ { - i := (s + h) / 8 - j := (s + h) % 8 - bit := uint((k[i] >> uint(j)) & 1) - copy(w[0][:], tableGenerator[s*Size:(s+1)*Size]) - diffAdd(&w, swap^bit) - swap = bit - } - for s := 0; s < h; s++ { - double(&w[1], &w[2]) - } - toAffine((*[fp.Size]byte)(k), &w[1], &w[2]) -} - -// ladderMontgomery calculates a generic scalar point multiplication -// The algorithm implemented is the left-to-right Montgomery's ladder. -func ladderMontgomery(k, xP *Key) { - w := [5]fp.Elt{} // [x1, x2, z2, x3, z3] order must be preserved. - w[0] = *(*fp.Elt)(xP) // x1 = xP - fp.SetOne(&w[1]) // x2 = 1 - w[3] = *(*fp.Elt)(xP) // x3 = xP - fp.SetOne(&w[4]) // z3 = 1 - - move := uint(0) - for s := 448 - 1; s >= 0; s-- { - i := s / 8 - j := s % 8 - bit := uint((k[i] >> uint(j)) & 1) - ladderStep(&w, move^bit) - move = bit - } - toAffine((*[fp.Size]byte)(k), &w[1], &w[2]) -} - -func toAffine(k *[fp.Size]byte, x, z *fp.Elt) { - fp.Inv(z, z) - fp.Mul(x, x, z) - _ = fp.ToBytes(k[:], x) -} - -var lowOrderPoints = [3]fp.Elt{ - { /* (0,_,1) point of order 2 on Curve448 */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { /* (1,_,1) a point of order 4 on the twist of Curve448 */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - }, - { /* (-1,_,1) point of order 4 on Curve448 */ - 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - }, -} diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go deleted file mode 100644 index a062266613..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build amd64 && !purego -// +build amd64,!purego - -package x448 - -import ( - fp "github.com/cloudflare/circl/math/fp448" - "golang.org/x/sys/cpu" -) - -var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX - -var _ = hasBmi2Adx - -func double(x, z *fp.Elt) { doubleAmd64(x, z) } -func diffAdd(w *[5]fp.Elt, b uint) { diffAddAmd64(w, b) } -func ladderStep(w *[5]fp.Elt, b uint) { ladderStepAmd64(w, b) } -func mulA24(z, x *fp.Elt) { mulA24Amd64(z, x) } - -//go:noescape -func doubleAmd64(x, z *fp.Elt) - -//go:noescape -func diffAddAmd64(w *[5]fp.Elt, b uint) - -//go:noescape -func ladderStepAmd64(w *[5]fp.Elt, b uint) - -//go:noescape -func mulA24Amd64(z, x *fp.Elt) diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h deleted file mode 100644 index 8c1ae4d0fb..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.h +++ /dev/null @@ -1,111 +0,0 @@ -#define ladderStepLeg \ - addSub(x2,z2) \ - addSub(x3,z3) \ - integerMulLeg(b0,x2,z3) \ - integerMulLeg(b1,x3,z2) \ - reduceFromDoubleLeg(t0,b0) \ - reduceFromDoubleLeg(t1,b1) \ - addSub(t0,t1) \ - cselect(x2,x3,regMove) \ - cselect(z2,z3,regMove) \ - integerSqrLeg(b0,t0) \ - integerSqrLeg(b1,t1) \ - reduceFromDoubleLeg(x3,b0) \ - reduceFromDoubleLeg(z3,b1) \ - integerMulLeg(b0,x1,z3) \ - reduceFromDoubleLeg(z3,b0) \ - integerSqrLeg(b0,x2) \ - integerSqrLeg(b1,z2) \ - reduceFromDoubleLeg(x2,b0) \ - reduceFromDoubleLeg(z2,b1) \ - subtraction(t0,x2,z2) \ - multiplyA24Leg(t1,t0) \ - additionLeg(t1,t1,z2) \ - integerMulLeg(b0,x2,z2) \ - integerMulLeg(b1,t0,t1) \ - reduceFromDoubleLeg(x2,b0) \ - reduceFromDoubleLeg(z2,b1) - -#define ladderStepBmi2Adx \ - addSub(x2,z2) \ - addSub(x3,z3) \ - integerMulAdx(b0,x2,z3) \ - integerMulAdx(b1,x3,z2) \ - reduceFromDoubleAdx(t0,b0) \ - reduceFromDoubleAdx(t1,b1) \ - addSub(t0,t1) \ - cselect(x2,x3,regMove) \ - cselect(z2,z3,regMove) \ - integerSqrAdx(b0,t0) \ - integerSqrAdx(b1,t1) \ - reduceFromDoubleAdx(x3,b0) \ - reduceFromDoubleAdx(z3,b1) \ - integerMulAdx(b0,x1,z3) \ - reduceFromDoubleAdx(z3,b0) \ - integerSqrAdx(b0,x2) \ - integerSqrAdx(b1,z2) \ - reduceFromDoubleAdx(x2,b0) \ - reduceFromDoubleAdx(z2,b1) \ - subtraction(t0,x2,z2) \ - multiplyA24Adx(t1,t0) \ - additionAdx(t1,t1,z2) \ - integerMulAdx(b0,x2,z2) \ - integerMulAdx(b1,t0,t1) \ - reduceFromDoubleAdx(x2,b0) \ - reduceFromDoubleAdx(z2,b1) - -#define difAddLeg \ - addSub(x1,z1) \ - integerMulLeg(b0,z1,ui) \ - reduceFromDoubleLeg(z1,b0) \ - addSub(x1,z1) \ - integerSqrLeg(b0,x1) \ - integerSqrLeg(b1,z1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) \ - integerMulLeg(b0,x1,z2) \ - integerMulLeg(b1,z1,x2) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) - -#define difAddBmi2Adx \ - addSub(x1,z1) \ - integerMulAdx(b0,z1,ui) \ - reduceFromDoubleAdx(z1,b0) \ - addSub(x1,z1) \ - integerSqrAdx(b0,x1) \ - integerSqrAdx(b1,z1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) \ - integerMulAdx(b0,x1,z2) \ - integerMulAdx(b1,z1,x2) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) - -#define doubleLeg \ - addSub(x1,z1) \ - integerSqrLeg(b0,x1) \ - integerSqrLeg(b1,z1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) \ - subtraction(t0,x1,z1) \ - multiplyA24Leg(t1,t0) \ - additionLeg(t1,t1,z1) \ - integerMulLeg(b0,x1,z1) \ - integerMulLeg(b1,t0,t1) \ - reduceFromDoubleLeg(x1,b0) \ - reduceFromDoubleLeg(z1,b1) - -#define doubleBmi2Adx \ - addSub(x1,z1) \ - integerSqrAdx(b0,x1) \ - integerSqrAdx(b1,z1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) \ - subtraction(t0,x1,z1) \ - multiplyA24Adx(t1,t0) \ - additionAdx(t1,t1,z1) \ - integerMulAdx(b0,x1,z1) \ - integerMulAdx(b1,t0,t1) \ - reduceFromDoubleAdx(x1,b0) \ - reduceFromDoubleAdx(z1,b1) diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s b/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s deleted file mode 100644 index 810aa9e648..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve_amd64.s +++ /dev/null @@ -1,193 +0,0 @@ -// +build amd64 - -#include "textflag.h" - -// Depends on circl/math/fp448 package -#include "../../math/fp448/fp_amd64.h" -#include "curve_amd64.h" - -// CTE_A24 is (A+2)/4 from Curve448 -#define CTE_A24 39082 - -#define Size 56 - -// multiplyA24Leg multiplies x times CTE_A24 and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64, cmov, adx -#define multiplyA24Leg(z,x) \ - MOVQ $CTE_A24, R15; \ - MOVQ 0+x, AX; MULQ R15; MOVQ AX, R8; ;;;;;;;;;;;; MOVQ DX, R9; \ - MOVQ 8+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \ - MOVQ 32+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \ - MOVQ 40+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \ - MOVQ 48+x, AX; MULQ R15; ADDQ AX, R14; ADCQ $0, DX; \ - MOVQ DX, AX; \ - SHLQ $32, AX; \ - ADDQ DX, R8; MOVQ $0, DX; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ AX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - ADCQ $0, DX; \ - MOVQ DX, AX; \ - SHLQ $32, AX; \ - ADDQ DX, R8; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ AX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - MOVQ R8, 0+z; \ - MOVQ R9, 8+z; \ - MOVQ R10, 16+z; \ - MOVQ R11, 24+z; \ - MOVQ R12, 32+z; \ - MOVQ R13, 40+z; \ - MOVQ R14, 48+z; - -// multiplyA24Adx multiplies x times CTE_A24 and stores in z -// Uses: AX, DX, R8-R14, FLAGS -// Instr: x86_64, bmi2 -#define multiplyA24Adx(z,x) \ - MOVQ $CTE_A24, DX; \ - MULXQ 0+x, R8, R9; \ - MULXQ 8+x, AX, R10; ADDQ AX, R9; \ - MULXQ 16+x, AX, R11; ADCQ AX, R10; \ - MULXQ 24+x, AX, R12; ADCQ AX, R11; \ - MULXQ 32+x, AX, R13; ADCQ AX, R12; \ - MULXQ 40+x, AX, R14; ADCQ AX, R13; \ - MULXQ 48+x, AX, DX; ADCQ AX, R14; \ - ;;;;;;;;;;;;;;;;;;;; ADCQ $0, DX; \ - MOVQ DX, AX; \ - SHLQ $32, AX; \ - ADDQ DX, R8; MOVQ $0, DX; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ AX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - ADCQ $0, DX; \ - MOVQ DX, AX; \ - SHLQ $32, AX; \ - ADDQ DX, R8; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ AX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - MOVQ R8, 0+z; \ - MOVQ R9, 8+z; \ - MOVQ R10, 16+z; \ - MOVQ R11, 24+z; \ - MOVQ R12, 32+z; \ - MOVQ R13, 40+z; \ - MOVQ R14, 48+z; - -#define mulA24Legacy \ - multiplyA24Leg(0(DI),0(SI)) -#define mulA24Bmi2Adx \ - multiplyA24Adx(0(DI),0(SI)) - -// func mulA24Amd64(z, x *fp448.Elt) -TEXT ·mulA24Amd64(SB),NOSPLIT,$0-16 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - CHECK_BMI2ADX(LMA24, mulA24Legacy, mulA24Bmi2Adx) - -// func ladderStepAmd64(w *[5]fp448.Elt, b uint) -// ladderStepAmd64 calculates a point addition and doubling as follows: -// (x2,z2) = 2*(x2,z2) and (x3,z3) = (x2,z2)+(x3,z3) using as a difference (x1,-). -// w = {x1,x2,z2,x3,z4} are five fp255.Elt of 56 bytes. -// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and -// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -TEXT ·ladderStepAmd64(SB),NOSPLIT,$336-16 - // Parameters - #define regWork DI - #define regMove SI - #define x1 0*Size(regWork) - #define x2 1*Size(regWork) - #define z2 2*Size(regWork) - #define x3 3*Size(regWork) - #define z3 4*Size(regWork) - // Local variables - #define t0 0*Size(SP) - #define t1 1*Size(SP) - #define b0 2*Size(SP) - #define b1 4*Size(SP) - MOVQ w+0(FP), regWork - MOVQ b+8(FP), regMove - CHECK_BMI2ADX(LLADSTEP, ladderStepLeg, ladderStepBmi2Adx) - #undef regWork - #undef regMove - #undef x1 - #undef x2 - #undef z2 - #undef x3 - #undef z3 - #undef t0 - #undef t1 - #undef b0 - #undef b1 - -// func diffAddAmd64(work *[5]fp.Elt, swap uint) -// diffAddAmd64 calculates a differential point addition using a precomputed point. -// (x1,z1) = (x1,z1)+(mu) using a difference point (x2,z2) -// work = {mu,x1,z1,x2,z2} are five fp448.Elt of 56 bytes, and -// stack = (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -// This is Equation 7 at https://eprint.iacr.org/2017/264. -TEXT ·diffAddAmd64(SB),NOSPLIT,$224-16 - // Parameters - #define regWork DI - #define regSwap SI - #define ui 0*Size(regWork) - #define x1 1*Size(regWork) - #define z1 2*Size(regWork) - #define x2 3*Size(regWork) - #define z2 4*Size(regWork) - // Local variables - #define b0 0*Size(SP) - #define b1 2*Size(SP) - MOVQ w+0(FP), regWork - MOVQ b+8(FP), regSwap - cswap(x1,x2,regSwap) - cswap(z1,z2,regSwap) - CHECK_BMI2ADX(LDIFADD, difAddLeg, difAddBmi2Adx) - #undef regWork - #undef regSwap - #undef ui - #undef x1 - #undef z1 - #undef x2 - #undef z2 - #undef b0 - #undef b1 - -// func doubleAmd64(x, z *fp448.Elt) -// doubleAmd64 calculates a point doubling (x1,z1) = 2*(x1,z1). -// stack = (t0,t1) are two fp.Elt of fp.Size bytes, and -// (b0,b1) are two-double precision fp.Elt of 2*fp.Size bytes. -TEXT ·doubleAmd64(SB),NOSPLIT,$336-16 - // Parameters - #define x1 0(DI) - #define z1 0(SI) - // Local variables - #define t0 0*Size(SP) - #define t1 1*Size(SP) - #define b0 2*Size(SP) - #define b1 4*Size(SP) - MOVQ x+0(FP), DI - MOVQ z+8(FP), SI - CHECK_BMI2ADX(LDOUB,doubleLeg,doubleBmi2Adx) - #undef x1 - #undef z1 - #undef t0 - #undef t1 - #undef b0 - #undef b1 diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go deleted file mode 100644 index b0b65ccf7e..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve_generic.go +++ /dev/null @@ -1,100 +0,0 @@ -package x448 - -import ( - "encoding/binary" - "math/bits" - - "github.com/cloudflare/circl/math/fp448" -) - -func doubleGeneric(x, z *fp448.Elt) { - t0, t1 := &fp448.Elt{}, &fp448.Elt{} - fp448.AddSub(x, z) - fp448.Sqr(x, x) - fp448.Sqr(z, z) - fp448.Sub(t0, x, z) - mulA24Generic(t1, t0) - fp448.Add(t1, t1, z) - fp448.Mul(x, x, z) - fp448.Mul(z, t0, t1) -} - -func diffAddGeneric(w *[5]fp448.Elt, b uint) { - mu, x1, z1, x2, z2 := &w[0], &w[1], &w[2], &w[3], &w[4] - fp448.Cswap(x1, x2, b) - fp448.Cswap(z1, z2, b) - fp448.AddSub(x1, z1) - fp448.Mul(z1, z1, mu) - fp448.AddSub(x1, z1) - fp448.Sqr(x1, x1) - fp448.Sqr(z1, z1) - fp448.Mul(x1, x1, z2) - fp448.Mul(z1, z1, x2) -} - -func ladderStepGeneric(w *[5]fp448.Elt, b uint) { - x1, x2, z2, x3, z3 := &w[0], &w[1], &w[2], &w[3], &w[4] - t0 := &fp448.Elt{} - t1 := &fp448.Elt{} - fp448.AddSub(x2, z2) - fp448.AddSub(x3, z3) - fp448.Mul(t0, x2, z3) - fp448.Mul(t1, x3, z2) - fp448.AddSub(t0, t1) - fp448.Cmov(x2, x3, b) - fp448.Cmov(z2, z3, b) - fp448.Sqr(x3, t0) - fp448.Sqr(z3, t1) - fp448.Mul(z3, x1, z3) - fp448.Sqr(x2, x2) - fp448.Sqr(z2, z2) - fp448.Sub(t0, x2, z2) - mulA24Generic(t1, t0) - fp448.Add(t1, t1, z2) - fp448.Mul(x2, x2, z2) - fp448.Mul(z2, t0, t1) -} - -func mulA24Generic(z, x *fp448.Elt) { - const A24 = 39082 - const n = 8 - var xx [7]uint64 - for i := range xx { - xx[i] = binary.LittleEndian.Uint64(x[i*n : (i+1)*n]) - } - h0, l0 := bits.Mul64(xx[0], A24) - h1, l1 := bits.Mul64(xx[1], A24) - h2, l2 := bits.Mul64(xx[2], A24) - h3, l3 := bits.Mul64(xx[3], A24) - h4, l4 := bits.Mul64(xx[4], A24) - h5, l5 := bits.Mul64(xx[5], A24) - h6, l6 := bits.Mul64(xx[6], A24) - - l1, c0 := bits.Add64(h0, l1, 0) - l2, c1 := bits.Add64(h1, l2, c0) - l3, c2 := bits.Add64(h2, l3, c1) - l4, c3 := bits.Add64(h3, l4, c2) - l5, c4 := bits.Add64(h4, l5, c3) - l6, c5 := bits.Add64(h5, l6, c4) - l7, _ := bits.Add64(h6, 0, c5) - - l0, c0 = bits.Add64(l0, l7, 0) - l1, c1 = bits.Add64(l1, 0, c0) - l2, c2 = bits.Add64(l2, 0, c1) - l3, c3 = bits.Add64(l3, l7<<32, c2) - l4, c4 = bits.Add64(l4, 0, c3) - l5, c5 = bits.Add64(l5, 0, c4) - l6, l7 = bits.Add64(l6, 0, c5) - - xx[0], c0 = bits.Add64(l0, l7, 0) - xx[1], c1 = bits.Add64(l1, 0, c0) - xx[2], c2 = bits.Add64(l2, 0, c1) - xx[3], c3 = bits.Add64(l3, l7<<32, c2) - xx[4], c4 = bits.Add64(l4, 0, c3) - xx[5], c5 = bits.Add64(l5, 0, c4) - xx[6], _ = bits.Add64(l6, 0, c5) - - for i := range xx { - binary.LittleEndian.PutUint64(z[i*n:(i+1)*n], xx[i]) - } -} diff --git a/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go b/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go deleted file mode 100644 index 3755b7c83b..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/curve_noasm.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build !amd64 || purego -// +build !amd64 purego - -package x448 - -import fp "github.com/cloudflare/circl/math/fp448" - -func double(x, z *fp.Elt) { doubleGeneric(x, z) } -func diffAdd(w *[5]fp.Elt, b uint) { diffAddGeneric(w, b) } -func ladderStep(w *[5]fp.Elt, b uint) { ladderStepGeneric(w, b) } -func mulA24(z, x *fp.Elt) { mulA24Generic(z, x) } diff --git a/vendor/github.com/cloudflare/circl/dh/x448/doc.go b/vendor/github.com/cloudflare/circl/dh/x448/doc.go deleted file mode 100644 index c02904feda..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/doc.go +++ /dev/null @@ -1,19 +0,0 @@ -/* -Package x448 provides Diffie-Hellman functions as specified in RFC-7748. - -Validation of public keys. - -The Diffie-Hellman function, as described in RFC-7748 [1], works for any -public key. However, if a different protocol requires contributory -behaviour [2,3], then the public keys must be validated against low-order -points [3,4]. To do that, the Shared function performs this validation -internally and returns false when the public key is invalid (i.e., it -is a low-order point). - -References: - - [1] RFC7748 by Langley, Hamburg, Turner (https://rfc-editor.org/rfc/rfc7748.txt) - - [2] Curve25519 by Bernstein (https://cr.yp.to/ecdh.html) - - [3] Bernstein (https://cr.yp.to/ecdh.html#validate) - - [4] Cremers&Jackson (https://eprint.iacr.org/2019/526) -*/ -package x448 diff --git a/vendor/github.com/cloudflare/circl/dh/x448/key.go b/vendor/github.com/cloudflare/circl/dh/x448/key.go deleted file mode 100644 index 2fdde51168..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/key.go +++ /dev/null @@ -1,46 +0,0 @@ -package x448 - -import ( - "crypto/subtle" - - fp "github.com/cloudflare/circl/math/fp448" -) - -// Size is the length in bytes of a X448 key. -const Size = 56 - -// Key represents a X448 key. -type Key [Size]byte - -func (k *Key) clamp(in *Key) *Key { - *k = *in - k[0] &= 252 - k[55] |= 128 - return k -} - -// isValidPubKey verifies if the public key is not a low-order point. -func (k *Key) isValidPubKey() bool { - fp.Modp((*fp.Elt)(k)) - var isLowOrder int - for _, P := range lowOrderPoints { - isLowOrder |= subtle.ConstantTimeCompare(P[:], k[:]) - } - return isLowOrder == 0 -} - -// KeyGen obtains a public key given a secret key. -func KeyGen(public, secret *Key) { - ladderJoye(public.clamp(secret)) -} - -// Shared calculates Alice's shared key from Alice's secret key and Bob's -// public key returning true on success. A failure case happens when the public -// key is a low-order point, thus the shared key is all-zeros and the function -// returns false. -func Shared(shared, secret, public *Key) bool { - validPk := *public - ok := validPk.isValidPubKey() - ladderMontgomery(shared.clamp(secret), &validPk) - return ok -} diff --git a/vendor/github.com/cloudflare/circl/dh/x448/table.go b/vendor/github.com/cloudflare/circl/dh/x448/table.go deleted file mode 100644 index eef53c30f8..0000000000 --- a/vendor/github.com/cloudflare/circl/dh/x448/table.go +++ /dev/null @@ -1,460 +0,0 @@ -package x448 - -import fp "github.com/cloudflare/circl/math/fp448" - -// tableGenerator contains the set of points: -// -// t[i] = (xi+1)/(xi-1), -// -// where (xi,yi) = 2^iG and G is the generator point -// Size = (448)*(448/8) = 25088 bytes. -var tableGenerator = [448 * fp.Size]byte{ - /* (2^ 0)P */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, - /* (2^ 1)P */ 0x37, 0xfa, 0xaa, 0x0d, 0x86, 0xa6, 0x24, 0xe9, 0x6c, 0x95, 0x08, 0x34, 0xba, 0x1a, 0x81, 0x3a, 0xae, 0x01, 0xa5, 0xa7, 0x05, 0x85, 0x96, 0x00, 0x06, 0x5a, 0xd7, 0xff, 0xee, 0x8e, 0x8f, 0x94, 0xd2, 0xdc, 0xd7, 0xfc, 0xe7, 0xe5, 0x99, 0x1d, 0x05, 0x46, 0x43, 0xe8, 0xbc, 0x12, 0xb7, 0xeb, 0x30, 0x5e, 0x7a, 0x85, 0x68, 0xed, 0x9d, 0x28, - /* (2^ 2)P */ 0xf1, 0x7d, 0x08, 0x2b, 0x32, 0x4a, 0x62, 0x80, 0x36, 0xe7, 0xa4, 0x76, 0x5a, 0x2a, 0x1e, 0xf7, 0x9e, 0x3c, 0x40, 0x46, 0x9a, 0x1b, 0x61, 0xc1, 0xbf, 0x1a, 0x1b, 0xae, 0x91, 0x80, 0xa3, 0x76, 0x6c, 0xd4, 0x8f, 0xa4, 0xee, 0x26, 0x39, 0x23, 0xa4, 0x80, 0xf4, 0x66, 0x92, 0xe4, 0xe1, 0x18, 0x76, 0xc5, 0xe2, 0x19, 0x87, 0xd5, 0xc3, 0xe8, - /* (2^ 3)P */ 0xfb, 0xc9, 0xf0, 0x07, 0xf2, 0x93, 0xd8, 0x50, 0x36, 0xed, 0xfb, 0xbd, 0xb2, 0xd3, 0xfc, 0xdf, 0xd5, 0x2a, 0x6e, 0x26, 0x09, 0xce, 0xd4, 0x07, 0x64, 0x9f, 0x40, 0x74, 0xad, 0x98, 0x2f, 0x1c, 0xb6, 0xdc, 0x2d, 0x42, 0xff, 0xbf, 0x97, 0xd8, 0xdb, 0xef, 0x99, 0xca, 0x73, 0x99, 0x1a, 0x04, 0x3b, 0x56, 0x2c, 0x1f, 0x87, 0x9d, 0x9f, 0x03, - /* (2^ 4)P */ 0x4c, 0x35, 0x97, 0xf7, 0x81, 0x2c, 0x84, 0xa6, 0xe0, 0xcb, 0xce, 0x37, 0x4c, 0x21, 0x1c, 0x67, 0xfa, 0xab, 0x18, 0x4d, 0xef, 0xd0, 0xf0, 0x44, 0xa9, 0xfb, 0xc0, 0x8e, 0xda, 0x57, 0xa1, 0xd8, 0xeb, 0x87, 0xf4, 0x17, 0xea, 0x66, 0x0f, 0x16, 0xea, 0xcd, 0x5f, 0x3e, 0x88, 0xea, 0x09, 0x68, 0x40, 0xdf, 0x43, 0xcc, 0x54, 0x61, 0x58, 0xaa, - /* (2^ 5)P */ 0x8d, 0xe7, 0x59, 0xd7, 0x5e, 0x63, 0x37, 0xa7, 0x3f, 0xd1, 0x49, 0x85, 0x01, 0xdd, 0x5e, 0xb3, 0xe6, 0x29, 0xcb, 0x25, 0x93, 0xdd, 0x08, 0x96, 0x83, 0x52, 0x76, 0x85, 0xf5, 0x5d, 0x02, 0xbf, 0xe9, 0x6d, 0x15, 0x27, 0xc1, 0x09, 0xd1, 0x14, 0x4d, 0x6e, 0xe8, 0xaf, 0x59, 0x58, 0x34, 0x9d, 0x2a, 0x99, 0x85, 0x26, 0xbe, 0x4b, 0x1e, 0xb9, - /* (2^ 6)P */ 0x8d, 0xce, 0x94, 0xe2, 0x18, 0x56, 0x0d, 0x82, 0x8e, 0xdf, 0x85, 0x01, 0x8f, 0x93, 0x3c, 0xc6, 0xbd, 0x61, 0xfb, 0xf4, 0x22, 0xc5, 0x16, 0x87, 0xd1, 0xb1, 0x9e, 0x09, 0xc5, 0x83, 0x2e, 0x4a, 0x07, 0x88, 0xee, 0xe0, 0x29, 0x8d, 0x2e, 0x1f, 0x88, 0xad, 0xfd, 0x18, 0x93, 0xb7, 0xed, 0x42, 0x86, 0x78, 0xf0, 0xb8, 0x70, 0xbe, 0x01, 0x67, - /* (2^ 7)P */ 0xdf, 0x62, 0x2d, 0x94, 0xc7, 0x35, 0x23, 0xda, 0x27, 0xbb, 0x2b, 0xdb, 0x30, 0x80, 0x68, 0x16, 0xa3, 0xae, 0xd7, 0xd2, 0xa7, 0x7c, 0xbf, 0x6a, 0x1d, 0x83, 0xde, 0x96, 0x0a, 0x43, 0xb6, 0x30, 0x37, 0xd6, 0xee, 0x63, 0x59, 0x9a, 0xbf, 0xa3, 0x30, 0x6c, 0xaf, 0x0c, 0xee, 0x3d, 0xcb, 0x35, 0x4b, 0x55, 0x5f, 0x84, 0x85, 0xcb, 0x4f, 0x1e, - /* (2^ 8)P */ 0x9d, 0x04, 0x68, 0x89, 0xa4, 0xa9, 0x0d, 0x87, 0xc1, 0x70, 0xf1, 0xeb, 0xfb, 0x47, 0x0a, 0xf0, 0xde, 0x67, 0xb7, 0x94, 0xcd, 0x36, 0x43, 0xa5, 0x49, 0x43, 0x67, 0xc3, 0xee, 0x3c, 0x6b, 0xec, 0xd0, 0x1a, 0xf4, 0xad, 0xef, 0x06, 0x4a, 0xe8, 0x46, 0x24, 0xd7, 0x93, 0xbf, 0xf0, 0xe3, 0x81, 0x61, 0xec, 0xea, 0x64, 0xfe, 0x67, 0xeb, 0xc7, - /* (2^ 9)P */ 0x95, 0x45, 0x79, 0xcf, 0x2c, 0xfd, 0x9b, 0xfe, 0x84, 0x46, 0x4b, 0x8f, 0xa1, 0xcf, 0xc3, 0x04, 0x94, 0x78, 0xdb, 0xc9, 0xa6, 0x01, 0x75, 0xa4, 0xb4, 0x93, 0x72, 0x43, 0xa7, 0x7d, 0xda, 0x31, 0x38, 0x54, 0xab, 0x4e, 0x3f, 0x89, 0xa6, 0xab, 0x57, 0xc0, 0x16, 0x65, 0xdb, 0x92, 0x96, 0xe4, 0xc8, 0xae, 0xe7, 0x4c, 0x7a, 0xeb, 0xbb, 0x5a, - /* (2^ 10)P */ 0xbe, 0xfe, 0x86, 0xc3, 0x97, 0xe0, 0x6a, 0x18, 0x20, 0x21, 0xca, 0x22, 0x55, 0xa1, 0xeb, 0xf5, 0x74, 0xe5, 0xc9, 0x59, 0xa7, 0x92, 0x65, 0x15, 0x08, 0x71, 0xd1, 0x09, 0x7e, 0x83, 0xfc, 0xbc, 0x5a, 0x93, 0x38, 0x0d, 0x43, 0x42, 0xfd, 0x76, 0x30, 0xe8, 0x63, 0x60, 0x09, 0x8d, 0x6c, 0xd3, 0xf8, 0x56, 0x3d, 0x68, 0x47, 0xab, 0xa0, 0x1d, - /* (2^ 11)P */ 0x38, 0x50, 0x1c, 0xb1, 0xac, 0x88, 0x8f, 0x38, 0xe3, 0x69, 0xe6, 0xfc, 0x4f, 0x8f, 0xe1, 0x9b, 0xb1, 0x1a, 0x09, 0x39, 0x19, 0xdf, 0xcd, 0x98, 0x7b, 0x64, 0x42, 0xf6, 0x11, 0xea, 0xc7, 0xe8, 0x92, 0x65, 0x00, 0x2c, 0x75, 0xb5, 0x94, 0x1e, 0x5b, 0xa6, 0x66, 0x81, 0x77, 0xf3, 0x39, 0x94, 0xac, 0xbd, 0xe4, 0x2a, 0x66, 0x84, 0x9c, 0x60, - /* (2^ 12)P */ 0xb5, 0xb6, 0xd9, 0x03, 0x67, 0xa4, 0xa8, 0x0a, 0x4a, 0x2b, 0x9d, 0xfa, 0x13, 0xe1, 0x99, 0x25, 0x4a, 0x5c, 0x67, 0xb9, 0xb2, 0xb7, 0xdd, 0x1e, 0xaf, 0xeb, 0x63, 0x41, 0xb6, 0xb9, 0xa0, 0x87, 0x0a, 0xe0, 0x06, 0x07, 0xaa, 0x97, 0xf8, 0xf9, 0x38, 0x4f, 0xdf, 0x0c, 0x40, 0x7c, 0xc3, 0x98, 0xa9, 0x74, 0xf1, 0x5d, 0xda, 0xd1, 0xc0, 0x0a, - /* (2^ 13)P */ 0xf2, 0x0a, 0xab, 0xab, 0x94, 0x50, 0xf0, 0xa3, 0x6f, 0xc6, 0x66, 0xba, 0xa6, 0xdc, 0x44, 0xdd, 0xd6, 0x08, 0xf4, 0xd3, 0xed, 0xb1, 0x40, 0x93, 0xee, 0xf6, 0xb8, 0x8e, 0xb4, 0x7c, 0xb9, 0x82, 0xc9, 0x9d, 0x45, 0x3b, 0x8e, 0x10, 0xcb, 0x70, 0x1e, 0xba, 0x3c, 0x62, 0x50, 0xda, 0xa9, 0x93, 0xb5, 0xd7, 0xd0, 0x6f, 0x29, 0x52, 0x95, 0xae, - /* (2^ 14)P */ 0x14, 0x68, 0x69, 0x23, 0xa8, 0x44, 0x87, 0x9e, 0x22, 0x91, 0xe8, 0x92, 0xdf, 0xf7, 0xae, 0xba, 0x1c, 0x96, 0xe1, 0xc3, 0x94, 0xed, 0x6c, 0x95, 0xae, 0x96, 0xa7, 0x15, 0x9f, 0xf1, 0x17, 0x11, 0x92, 0x42, 0xd5, 0xcd, 0x18, 0xe7, 0xa9, 0xb5, 0x2f, 0xcd, 0xde, 0x6c, 0xc9, 0x7d, 0xfc, 0x7e, 0xbd, 0x7f, 0x10, 0x3d, 0x01, 0x00, 0x8d, 0x95, - /* (2^ 15)P */ 0x3b, 0x76, 0x72, 0xae, 0xaf, 0x84, 0xf2, 0xf7, 0xd1, 0x6d, 0x13, 0x9c, 0x47, 0xe1, 0xb7, 0xa3, 0x19, 0x16, 0xee, 0x75, 0x45, 0xf6, 0x1a, 0x7b, 0x78, 0x49, 0x79, 0x05, 0x86, 0xf0, 0x7f, 0x9f, 0xfc, 0xc4, 0xbd, 0x86, 0xf3, 0x41, 0xa7, 0xfe, 0x01, 0xd5, 0x67, 0x16, 0x10, 0x5b, 0xa5, 0x16, 0xf3, 0x7f, 0x60, 0xce, 0xd2, 0x0c, 0x8e, 0x4b, - /* (2^ 16)P */ 0x4a, 0x07, 0x99, 0x4a, 0x0f, 0x74, 0x91, 0x14, 0x68, 0xb9, 0x48, 0xb7, 0x44, 0x77, 0x9b, 0x4a, 0xe0, 0x68, 0x0e, 0x43, 0x4d, 0x98, 0x98, 0xbf, 0xa8, 0x3a, 0xb7, 0x6d, 0x2a, 0x9a, 0x77, 0x5f, 0x62, 0xf5, 0x6b, 0x4a, 0xb7, 0x7d, 0xe5, 0x09, 0x6b, 0xc0, 0x8b, 0x9c, 0x88, 0x37, 0x33, 0xf2, 0x41, 0xac, 0x22, 0x1f, 0xcf, 0x3b, 0x82, 0x34, - /* (2^ 17)P */ 0x00, 0xc3, 0x78, 0x42, 0x32, 0x2e, 0xdc, 0xda, 0xb1, 0x96, 0x21, 0xa4, 0xe4, 0xbb, 0xe9, 0x9d, 0xbb, 0x0f, 0x93, 0xed, 0x26, 0x3d, 0xb5, 0xdb, 0x94, 0x31, 0x37, 0x07, 0xa2, 0xb2, 0xd5, 0x99, 0x0d, 0x93, 0xe1, 0xce, 0x3f, 0x0b, 0x96, 0x82, 0x47, 0xfe, 0x60, 0x6f, 0x8f, 0x61, 0x88, 0xd7, 0x05, 0x95, 0x0b, 0x46, 0x06, 0xb7, 0x32, 0x06, - /* (2^ 18)P */ 0x44, 0xf5, 0x34, 0xdf, 0x2f, 0x9c, 0x5d, 0x9f, 0x53, 0x5c, 0x42, 0x8f, 0xc9, 0xdc, 0xd8, 0x40, 0xa2, 0xe7, 0x6a, 0x4a, 0x05, 0xf7, 0x86, 0x77, 0x2b, 0xae, 0x37, 0xed, 0x48, 0xfb, 0xf7, 0x62, 0x7c, 0x17, 0x59, 0x92, 0x41, 0x61, 0x93, 0x38, 0x30, 0xd1, 0xef, 0x54, 0x54, 0x03, 0x17, 0x57, 0x91, 0x15, 0x11, 0x33, 0xb5, 0xfa, 0xfb, 0x17, - /* (2^ 19)P */ 0x29, 0xbb, 0xd4, 0xb4, 0x9c, 0xf1, 0x72, 0x94, 0xce, 0x6a, 0x29, 0xa8, 0x89, 0x18, 0x19, 0xf7, 0xb7, 0xcc, 0xee, 0x9a, 0x02, 0xe3, 0xc0, 0xb1, 0xe0, 0xee, 0x83, 0x78, 0xb4, 0x9e, 0x07, 0x87, 0xdf, 0xb0, 0x82, 0x26, 0x4e, 0xa4, 0x0c, 0x33, 0xaf, 0x40, 0x59, 0xb6, 0xdd, 0x52, 0x45, 0xf0, 0xb4, 0xf6, 0xe8, 0x4e, 0x4e, 0x79, 0x1a, 0x5d, - /* (2^ 20)P */ 0x27, 0x33, 0x4d, 0x4c, 0x6b, 0x4f, 0x75, 0xb1, 0xbc, 0x1f, 0xab, 0x5b, 0x2b, 0xf0, 0x1c, 0x57, 0x86, 0xdd, 0xfd, 0x60, 0xb0, 0x8c, 0xe7, 0x9a, 0xe5, 0x5c, 0xeb, 0x11, 0x3a, 0xda, 0x22, 0x25, 0x99, 0x06, 0x8d, 0xf4, 0xaf, 0x29, 0x7a, 0xc9, 0xe5, 0xd2, 0x16, 0x9e, 0xd4, 0x63, 0x1d, 0x64, 0xa6, 0x47, 0x96, 0x37, 0x6f, 0x93, 0x2c, 0xcc, - /* (2^ 21)P */ 0xc1, 0x94, 0x74, 0x86, 0x75, 0xf2, 0x91, 0x58, 0x23, 0x85, 0x63, 0x76, 0x54, 0xc7, 0xb4, 0x8c, 0xbc, 0x4e, 0xc4, 0xa7, 0xba, 0xa0, 0x55, 0x26, 0x71, 0xd5, 0x33, 0x72, 0xc9, 0xad, 0x1e, 0xf9, 0x5d, 0x78, 0x70, 0x93, 0x4e, 0x85, 0xfc, 0x39, 0x06, 0x73, 0x76, 0xff, 0xe8, 0x64, 0x69, 0x42, 0x45, 0xb2, 0x69, 0xb5, 0x32, 0xe7, 0x2c, 0xde, - /* (2^ 22)P */ 0xde, 0x16, 0xd8, 0x33, 0x49, 0x32, 0xe9, 0x0e, 0x3a, 0x60, 0xee, 0x2e, 0x24, 0x75, 0xe3, 0x9c, 0x92, 0x07, 0xdb, 0xad, 0x92, 0xf5, 0x11, 0xdf, 0xdb, 0xb0, 0x17, 0x5c, 0xd6, 0x1a, 0x70, 0x00, 0xb7, 0xe2, 0x18, 0xec, 0xdc, 0xc2, 0x02, 0x93, 0xb3, 0xc8, 0x3f, 0x4f, 0x1b, 0x96, 0xe6, 0x33, 0x8c, 0xfb, 0xcc, 0xa5, 0x4e, 0xe8, 0xe7, 0x11, - /* (2^ 23)P */ 0x05, 0x7a, 0x74, 0x52, 0xf8, 0xdf, 0x0d, 0x7c, 0x6a, 0x1a, 0x4e, 0x9a, 0x02, 0x1d, 0xae, 0x77, 0xf8, 0x8e, 0xf9, 0xa2, 0x38, 0x54, 0x50, 0xb2, 0x2c, 0x08, 0x9d, 0x9b, 0x9f, 0xfb, 0x2b, 0x06, 0xde, 0x9d, 0xc2, 0x03, 0x0b, 0x22, 0x2b, 0x10, 0x5b, 0x3a, 0x73, 0x29, 0x8e, 0x3e, 0x37, 0x08, 0x2c, 0x3b, 0xf8, 0x80, 0xc1, 0x66, 0x1e, 0x98, - /* (2^ 24)P */ 0xd8, 0xd6, 0x3e, 0xcd, 0x63, 0x8c, 0x2b, 0x41, 0x81, 0xc0, 0x0c, 0x06, 0x87, 0xd6, 0xe7, 0x92, 0xfe, 0xf1, 0x0c, 0x4a, 0x84, 0x5b, 0xaf, 0x40, 0x53, 0x6f, 0x60, 0xd6, 0x6b, 0x76, 0x4b, 0xc2, 0xad, 0xc9, 0xb6, 0xb6, 0x6a, 0xa2, 0xb3, 0xf5, 0xf5, 0xc2, 0x55, 0x83, 0xb2, 0xd3, 0xe9, 0x41, 0x6c, 0x63, 0x51, 0xb8, 0x81, 0x74, 0xc8, 0x2c, - /* (2^ 25)P */ 0xb2, 0xaf, 0x1c, 0xee, 0x07, 0xb0, 0x58, 0xa8, 0x2c, 0x6a, 0xc9, 0x2d, 0x62, 0x28, 0x75, 0x0c, 0x40, 0xb6, 0x11, 0x33, 0x96, 0x80, 0x28, 0x6d, 0xd5, 0x9e, 0x87, 0x90, 0x01, 0x66, 0x1d, 0x1c, 0xf8, 0xb4, 0x92, 0xac, 0x38, 0x18, 0x05, 0xc2, 0x4c, 0x4b, 0x54, 0x7d, 0x80, 0x46, 0x87, 0x2d, 0x99, 0x8e, 0x70, 0x80, 0x69, 0x71, 0x8b, 0xed, - /* (2^ 26)P */ 0x37, 0xa7, 0x6b, 0x71, 0x36, 0x75, 0x8e, 0xff, 0x0f, 0x42, 0xda, 0x5a, 0x46, 0xa6, 0x97, 0x79, 0x7e, 0x30, 0xb3, 0x8f, 0xc7, 0x3a, 0xa0, 0xcb, 0x1d, 0x9c, 0x78, 0x77, 0x36, 0xc2, 0xe7, 0xf4, 0x2f, 0x29, 0x07, 0xb1, 0x07, 0xfd, 0xed, 0x1b, 0x39, 0x77, 0x06, 0x38, 0x77, 0x0f, 0x50, 0x31, 0x12, 0xbf, 0x92, 0xbf, 0x72, 0x79, 0x54, 0xa9, - /* (2^ 27)P */ 0xbd, 0x4d, 0x46, 0x6b, 0x1a, 0x80, 0x46, 0x2d, 0xed, 0xfd, 0x64, 0x6d, 0x94, 0xbc, 0x4a, 0x6e, 0x0c, 0x12, 0xf6, 0x12, 0xab, 0x54, 0x88, 0xd3, 0x85, 0xac, 0x51, 0xae, 0x6f, 0xca, 0xc4, 0xb7, 0xec, 0x22, 0x54, 0x6d, 0x80, 0xb2, 0x1c, 0x63, 0x33, 0x76, 0x6b, 0x8e, 0x6d, 0x59, 0xcd, 0x73, 0x92, 0x5f, 0xff, 0xad, 0x10, 0x35, 0x70, 0x5f, - /* (2^ 28)P */ 0xb3, 0x84, 0xde, 0xc8, 0x04, 0x43, 0x63, 0xfa, 0x29, 0xd9, 0xf0, 0x69, 0x65, 0x5a, 0x0c, 0xe8, 0x2e, 0x0b, 0xfe, 0xb0, 0x7a, 0x42, 0xb3, 0xc3, 0xfc, 0xe6, 0xb8, 0x92, 0x29, 0xae, 0xed, 0xec, 0xd5, 0xe8, 0x4a, 0xa1, 0xbd, 0x3b, 0xd3, 0xc0, 0x07, 0xab, 0x65, 0x65, 0x35, 0x9a, 0xa6, 0x5e, 0x78, 0x18, 0x76, 0x1c, 0x15, 0x49, 0xe6, 0x75, - /* (2^ 29)P */ 0x45, 0xb3, 0x92, 0xa9, 0xc3, 0xb8, 0x11, 0x68, 0x64, 0x3a, 0x83, 0x5d, 0xa8, 0x94, 0x6a, 0x9d, 0xaa, 0x27, 0x9f, 0x98, 0x5d, 0xc0, 0x29, 0xf0, 0xc0, 0x4b, 0x14, 0x3c, 0x05, 0xe7, 0xf8, 0xbd, 0x38, 0x22, 0x96, 0x75, 0x65, 0x5e, 0x0d, 0x3f, 0xbb, 0x6f, 0xe8, 0x3f, 0x96, 0x76, 0x9f, 0xba, 0xd9, 0x44, 0x92, 0x96, 0x22, 0xe7, 0x52, 0xe7, - /* (2^ 30)P */ 0xf4, 0xa3, 0x95, 0x90, 0x47, 0xdf, 0x7d, 0xdc, 0xf4, 0x13, 0x87, 0x67, 0x7d, 0x4f, 0x9d, 0xa0, 0x00, 0x46, 0x72, 0x08, 0xc3, 0xa2, 0x7a, 0x3e, 0xe7, 0x6d, 0x52, 0x7c, 0x11, 0x36, 0x50, 0x83, 0x89, 0x64, 0xcb, 0x1f, 0x08, 0x83, 0x46, 0xcb, 0xac, 0xa6, 0xd8, 0x9c, 0x1b, 0xe8, 0x05, 0x47, 0xc7, 0x26, 0x06, 0x83, 0x39, 0xe9, 0xb1, 0x1c, - /* (2^ 31)P */ 0x11, 0xe8, 0xc8, 0x42, 0xbf, 0x30, 0x9c, 0xa3, 0xf1, 0x85, 0x96, 0x95, 0x4f, 0x4f, 0x52, 0xa2, 0xf5, 0x8b, 0x68, 0x24, 0x16, 0xac, 0x9b, 0xa9, 0x27, 0x28, 0x0e, 0x84, 0x03, 0x46, 0x22, 0x5f, 0xf7, 0x0d, 0xa6, 0x85, 0x88, 0xc1, 0x45, 0x4b, 0x85, 0x1a, 0x10, 0x7f, 0xc9, 0x94, 0x20, 0xb0, 0x04, 0x28, 0x12, 0x30, 0xb9, 0xe6, 0x40, 0x6b, - /* (2^ 32)P */ 0xac, 0x1b, 0x57, 0xb6, 0x42, 0xdb, 0x81, 0x8d, 0x76, 0xfd, 0x9b, 0x1c, 0x29, 0x30, 0xd5, 0x3a, 0xcc, 0x53, 0xd9, 0x26, 0x7a, 0x0f, 0x9c, 0x2e, 0x79, 0xf5, 0x62, 0xeb, 0x61, 0x9d, 0x9b, 0x80, 0x39, 0xcd, 0x60, 0x2e, 0x1f, 0x08, 0x22, 0xbc, 0x19, 0xb3, 0x2a, 0x43, 0x44, 0xf2, 0x4e, 0x66, 0xf4, 0x36, 0xa6, 0xa7, 0xbc, 0xa4, 0x15, 0x7e, - /* (2^ 33)P */ 0xc1, 0x90, 0x8a, 0xde, 0xff, 0x78, 0xc3, 0x73, 0x16, 0xee, 0x76, 0xa0, 0x84, 0x60, 0x8d, 0xe6, 0x82, 0x0f, 0xde, 0x4e, 0xc5, 0x99, 0x34, 0x06, 0x90, 0x44, 0x55, 0xf8, 0x91, 0xd8, 0xe1, 0xe4, 0x2c, 0x8a, 0xde, 0x94, 0x1e, 0x78, 0x25, 0x3d, 0xfd, 0xd8, 0x59, 0x7d, 0xaf, 0x6e, 0xbe, 0x96, 0xbe, 0x3c, 0x16, 0x23, 0x0f, 0x4c, 0xa4, 0x28, - /* (2^ 34)P */ 0xba, 0x11, 0x35, 0x57, 0x03, 0xb6, 0xf4, 0x24, 0x89, 0xb8, 0x5a, 0x0d, 0x50, 0x9c, 0xaa, 0x51, 0x7f, 0xa4, 0x0e, 0xfc, 0x71, 0xb3, 0x3b, 0xf1, 0x96, 0x50, 0x23, 0x15, 0xf5, 0xf5, 0xd4, 0x23, 0xdc, 0x8b, 0x26, 0x9e, 0xae, 0xb7, 0x50, 0xcd, 0xc4, 0x25, 0xf6, 0x75, 0x40, 0x9c, 0x37, 0x79, 0x33, 0x60, 0xd4, 0x4b, 0x13, 0x32, 0xee, 0xe2, - /* (2^ 35)P */ 0x43, 0xb8, 0x56, 0x59, 0xf0, 0x68, 0x23, 0xb3, 0xea, 0x70, 0x58, 0x4c, 0x1e, 0x5a, 0x16, 0x54, 0x03, 0xb2, 0xf4, 0x73, 0xb6, 0xd9, 0x5c, 0x9c, 0x6f, 0xcf, 0x82, 0x2e, 0x54, 0x15, 0x46, 0x2c, 0xa3, 0xda, 0x4e, 0x87, 0xf5, 0x2b, 0xba, 0x91, 0xa3, 0xa0, 0x89, 0xba, 0x48, 0x2b, 0xfa, 0x64, 0x02, 0x7f, 0x78, 0x03, 0xd1, 0xe8, 0x3b, 0xe9, - /* (2^ 36)P */ 0x15, 0xa4, 0x71, 0xd4, 0x0c, 0x24, 0xe9, 0x07, 0xa1, 0x43, 0xf4, 0x7f, 0xbb, 0xa2, 0xa6, 0x6b, 0xfa, 0xb7, 0xea, 0x58, 0xd1, 0x96, 0xb0, 0x24, 0x5c, 0xc7, 0x37, 0x4e, 0x60, 0x0f, 0x40, 0xf2, 0x2f, 0x44, 0x70, 0xea, 0x80, 0x63, 0xfe, 0xfc, 0x46, 0x59, 0x12, 0x27, 0xb5, 0x27, 0xfd, 0xb7, 0x73, 0x0b, 0xca, 0x8b, 0xc2, 0xd3, 0x71, 0x08, - /* (2^ 37)P */ 0x26, 0x0e, 0xd7, 0x52, 0x6f, 0xf1, 0xf2, 0x9d, 0xb8, 0x3d, 0xbd, 0xd4, 0x75, 0x97, 0xd8, 0xbf, 0xa8, 0x86, 0x96, 0xa5, 0x80, 0xa0, 0x45, 0x75, 0xf6, 0x77, 0x71, 0xdb, 0x77, 0x96, 0x55, 0x99, 0x31, 0xd0, 0x4f, 0x34, 0xf4, 0x35, 0x39, 0x41, 0xd3, 0x7d, 0xf7, 0xe2, 0x74, 0xde, 0xbe, 0x5b, 0x1f, 0x39, 0x10, 0x21, 0xa3, 0x4d, 0x3b, 0xc8, - /* (2^ 38)P */ 0x04, 0x00, 0x2a, 0x45, 0xb2, 0xaf, 0x9b, 0x18, 0x6a, 0xeb, 0x96, 0x28, 0xa4, 0x77, 0xd0, 0x13, 0xcf, 0x17, 0x65, 0xe8, 0xc5, 0x81, 0x28, 0xad, 0x39, 0x7a, 0x0b, 0xaa, 0x55, 0x2b, 0xf3, 0xfc, 0x86, 0x40, 0xad, 0x0d, 0x1e, 0x28, 0xa2, 0x2d, 0xc5, 0xd6, 0x04, 0x15, 0xa2, 0x30, 0x3d, 0x12, 0x8e, 0xd6, 0xb5, 0xf7, 0x69, 0xbb, 0x84, 0x20, - /* (2^ 39)P */ 0xd7, 0x7a, 0x77, 0x2c, 0xfb, 0x81, 0x80, 0xe9, 0x1e, 0xc6, 0x36, 0x31, 0x79, 0xc3, 0x7c, 0xa9, 0x57, 0x6b, 0xb5, 0x70, 0xfb, 0xe4, 0xa1, 0xff, 0xfd, 0x21, 0xa5, 0x7c, 0xfa, 0x44, 0xba, 0x0d, 0x96, 0x3d, 0xc4, 0x5c, 0x39, 0x52, 0x87, 0xd7, 0x22, 0x0f, 0x52, 0x88, 0x91, 0x87, 0x96, 0xac, 0xfa, 0x3b, 0xdf, 0xdc, 0x83, 0x8c, 0x99, 0x29, - /* (2^ 40)P */ 0x98, 0x6b, 0x3a, 0x8d, 0x83, 0x17, 0xe1, 0x62, 0xd8, 0x80, 0x4c, 0x97, 0xce, 0x6b, 0xaa, 0x10, 0xa7, 0xc4, 0xe9, 0xeb, 0xa5, 0xfb, 0xc9, 0xdd, 0x2d, 0xeb, 0xfc, 0x9a, 0x71, 0xcd, 0x68, 0x6e, 0xc0, 0x35, 0x64, 0x62, 0x1b, 0x95, 0x12, 0xe8, 0x53, 0xec, 0xf0, 0xf4, 0x86, 0x86, 0x78, 0x18, 0xc4, 0xc6, 0xbc, 0x5a, 0x59, 0x8f, 0x7c, 0x7e, - /* (2^ 41)P */ 0x7f, 0xd7, 0x1e, 0xc5, 0x83, 0xdc, 0x1f, 0xbe, 0x0b, 0xcf, 0x2e, 0x01, 0x01, 0xed, 0xac, 0x17, 0x3b, 0xed, 0xa4, 0x30, 0x96, 0x0e, 0x14, 0x7e, 0x19, 0x2b, 0xa5, 0x67, 0x1e, 0xb3, 0x34, 0x03, 0xa8, 0xbb, 0x0a, 0x7d, 0x08, 0x2d, 0xd5, 0x53, 0x19, 0x6f, 0x13, 0xd5, 0xc0, 0x90, 0x8a, 0xcc, 0xc9, 0x5c, 0xab, 0x24, 0xd7, 0x03, 0xf6, 0x57, - /* (2^ 42)P */ 0x49, 0xcb, 0xb4, 0x96, 0x5f, 0xa6, 0xf8, 0x71, 0x6f, 0x59, 0xad, 0x05, 0x24, 0x2d, 0xaf, 0x67, 0xa8, 0xbe, 0x95, 0xdf, 0x0d, 0x28, 0x5a, 0x7f, 0x6e, 0x87, 0x8c, 0x6e, 0x67, 0x0c, 0xf4, 0xe0, 0x1c, 0x30, 0xc2, 0x66, 0xae, 0x20, 0xa1, 0x34, 0xec, 0x9c, 0xbc, 0xae, 0x3d, 0xa1, 0x28, 0x28, 0x95, 0x1d, 0xc9, 0x3a, 0xa8, 0xfd, 0xfc, 0xa1, - /* (2^ 43)P */ 0xe2, 0x2b, 0x9d, 0xed, 0x02, 0x99, 0x67, 0xbb, 0x2e, 0x16, 0x62, 0x05, 0x70, 0xc7, 0x27, 0xb9, 0x1c, 0x3f, 0xf2, 0x11, 0x01, 0xd8, 0x51, 0xa4, 0x18, 0x92, 0xa9, 0x5d, 0xfb, 0xa9, 0xe4, 0x42, 0xba, 0x38, 0x34, 0x1a, 0x4a, 0xc5, 0x6a, 0x37, 0xde, 0xa7, 0x0c, 0xb4, 0x7e, 0x7f, 0xde, 0xa6, 0xee, 0xcd, 0x55, 0x57, 0x05, 0x06, 0xfd, 0x5d, - /* (2^ 44)P */ 0x2f, 0x32, 0xcf, 0x2e, 0x2c, 0x7b, 0xbe, 0x9a, 0x0c, 0x57, 0x35, 0xf8, 0x87, 0xda, 0x9c, 0xec, 0x48, 0xf2, 0xbb, 0xe2, 0xda, 0x10, 0x58, 0x20, 0xc6, 0xd3, 0x87, 0xe9, 0xc7, 0x26, 0xd1, 0x9a, 0x46, 0x87, 0x90, 0xda, 0xdc, 0xde, 0xc3, 0xb3, 0xf2, 0xe8, 0x6f, 0x4a, 0xe6, 0xe8, 0x9d, 0x98, 0x36, 0x20, 0x03, 0x47, 0x15, 0x3f, 0x64, 0x59, - /* (2^ 45)P */ 0xd4, 0x71, 0x49, 0x0a, 0x67, 0x97, 0xaa, 0x3f, 0xf4, 0x1b, 0x3a, 0x6e, 0x5e, 0x17, 0xcc, 0x0a, 0x8f, 0x81, 0x6a, 0x41, 0x38, 0x77, 0x40, 0x8a, 0x11, 0x42, 0x62, 0xd2, 0x50, 0x32, 0x79, 0x78, 0x28, 0xc2, 0x2e, 0x10, 0x01, 0x94, 0x30, 0x4f, 0x7f, 0x18, 0x17, 0x56, 0x85, 0x4e, 0xad, 0xf7, 0xcb, 0x87, 0x3c, 0x3f, 0x50, 0x2c, 0xc0, 0xba, - /* (2^ 46)P */ 0xbc, 0x30, 0x8e, 0x65, 0x8e, 0x57, 0x5b, 0x38, 0x7a, 0xd4, 0x95, 0x52, 0x7a, 0x32, 0x59, 0x69, 0xcd, 0x9d, 0x47, 0x34, 0x5b, 0x55, 0xa5, 0x24, 0x60, 0xdd, 0xc0, 0xc1, 0x62, 0x73, 0x44, 0xae, 0x4c, 0x9c, 0x65, 0x55, 0x1b, 0x9d, 0x8a, 0x29, 0xb0, 0x1a, 0x52, 0xa8, 0xf1, 0xe6, 0x9a, 0xb3, 0xf6, 0xa3, 0xc9, 0x0a, 0x70, 0x7d, 0x0f, 0xee, - /* (2^ 47)P */ 0x77, 0xd3, 0xe5, 0x8e, 0xfa, 0x00, 0xeb, 0x1b, 0x7f, 0xdc, 0x68, 0x3f, 0x92, 0xbd, 0xb7, 0x0b, 0xb7, 0xb5, 0x24, 0xdf, 0xc5, 0x67, 0x53, 0xd4, 0x36, 0x79, 0xc4, 0x7b, 0x57, 0xbc, 0x99, 0x97, 0x60, 0xef, 0xe4, 0x01, 0xa1, 0xa7, 0xaa, 0x12, 0x36, 0x29, 0xb1, 0x03, 0xc2, 0x83, 0x1c, 0x2b, 0x83, 0xef, 0x2e, 0x2c, 0x23, 0x92, 0xfd, 0xd1, - /* (2^ 48)P */ 0x94, 0xef, 0x03, 0x59, 0xfa, 0x8a, 0x18, 0x76, 0xee, 0x58, 0x08, 0x4d, 0x44, 0xce, 0xf1, 0x52, 0x33, 0x49, 0xf6, 0x69, 0x71, 0xe3, 0xa9, 0xbc, 0x86, 0xe3, 0x43, 0xde, 0x33, 0x7b, 0x90, 0x8b, 0x3e, 0x7d, 0xd5, 0x4a, 0xf0, 0x23, 0x99, 0xa6, 0xea, 0x5f, 0x08, 0xe5, 0xb9, 0x49, 0x8b, 0x0d, 0x6a, 0x21, 0xab, 0x07, 0x62, 0xcd, 0xc4, 0xbe, - /* (2^ 49)P */ 0x61, 0xbf, 0x70, 0x14, 0xfa, 0x4e, 0x9e, 0x7c, 0x0c, 0xf8, 0xb2, 0x48, 0x71, 0x62, 0x83, 0xd6, 0xd1, 0xdc, 0x9c, 0x29, 0x66, 0xb1, 0x34, 0x9c, 0x8d, 0xe6, 0x88, 0xaf, 0xbe, 0xdc, 0x4d, 0xeb, 0xb0, 0xe7, 0x28, 0xae, 0xb2, 0x05, 0x56, 0xc6, 0x0e, 0x10, 0x26, 0xab, 0x2c, 0x59, 0x72, 0x03, 0x66, 0xfe, 0x8f, 0x2c, 0x51, 0x2d, 0xdc, 0xae, - /* (2^ 50)P */ 0xdc, 0x63, 0xf1, 0x8b, 0x5c, 0x65, 0x0b, 0xf1, 0xa6, 0x22, 0xe2, 0xd9, 0xdb, 0x49, 0xb1, 0x3c, 0x47, 0xc2, 0xfe, 0xac, 0x86, 0x07, 0x52, 0xec, 0xb0, 0x08, 0x69, 0xfb, 0xd1, 0x06, 0xdc, 0x48, 0x5c, 0x3d, 0xb2, 0x4d, 0xb8, 0x1a, 0x4e, 0xda, 0xb9, 0xc1, 0x2b, 0xab, 0x4b, 0x62, 0x81, 0x21, 0x9a, 0xfc, 0x3d, 0x39, 0x83, 0x11, 0x36, 0xeb, - /* (2^ 51)P */ 0x94, 0xf3, 0x17, 0xef, 0xf9, 0x60, 0x54, 0xc3, 0xd7, 0x27, 0x35, 0xc5, 0x98, 0x5e, 0xf6, 0x63, 0x6c, 0xa0, 0x4a, 0xd3, 0xa3, 0x98, 0xd9, 0x42, 0xe3, 0xf1, 0xf8, 0x81, 0x96, 0xa9, 0xea, 0x6d, 0x4b, 0x8e, 0x33, 0xca, 0x94, 0x0d, 0xa0, 0xf7, 0xbb, 0x64, 0xa3, 0x36, 0x6f, 0xdc, 0x5a, 0x94, 0x42, 0xca, 0x06, 0xb2, 0x2b, 0x9a, 0x9f, 0x71, - /* (2^ 52)P */ 0xec, 0xdb, 0xa6, 0x1f, 0xdf, 0x15, 0x36, 0xa3, 0xda, 0x8a, 0x7a, 0xb6, 0xa7, 0xe3, 0xaf, 0x52, 0xe0, 0x8d, 0xe8, 0xf2, 0x44, 0x20, 0xeb, 0xa1, 0x20, 0xc4, 0x65, 0x3c, 0x7c, 0x6c, 0x49, 0xed, 0x2f, 0x66, 0x23, 0x68, 0x61, 0x91, 0x40, 0x9f, 0x50, 0x19, 0xd1, 0x84, 0xa7, 0xe2, 0xed, 0x34, 0x37, 0xe3, 0xe4, 0x11, 0x7f, 0x87, 0x55, 0x0f, - /* (2^ 53)P */ 0xb3, 0xa1, 0x0f, 0xb0, 0x48, 0xc0, 0x4d, 0x96, 0xa7, 0xcf, 0x5a, 0x81, 0xb8, 0x4a, 0x46, 0xef, 0x0a, 0xd3, 0x40, 0x7e, 0x02, 0xe3, 0x63, 0xaa, 0x50, 0xd1, 0x2a, 0x37, 0x22, 0x4a, 0x7f, 0x4f, 0xb6, 0xf9, 0x01, 0x82, 0x78, 0x3d, 0x93, 0x14, 0x11, 0x8a, 0x90, 0x60, 0xcd, 0x45, 0x4e, 0x7b, 0x42, 0xb9, 0x3e, 0x6e, 0x68, 0x1f, 0x36, 0x41, - /* (2^ 54)P */ 0x13, 0x73, 0x0e, 0x4f, 0x79, 0x93, 0x9e, 0x29, 0x70, 0x7b, 0x4a, 0x59, 0x1a, 0x9a, 0xf4, 0x55, 0x08, 0xf0, 0xdb, 0x17, 0x58, 0xec, 0x64, 0xad, 0x7f, 0x29, 0xeb, 0x3f, 0x85, 0x4e, 0x60, 0x28, 0x98, 0x1f, 0x73, 0x4e, 0xe6, 0xa8, 0xab, 0xd5, 0xd6, 0xfc, 0xa1, 0x36, 0x6d, 0x15, 0xc6, 0x13, 0x83, 0xa0, 0xc2, 0x6e, 0xd9, 0xdb, 0xc9, 0xcc, - /* (2^ 55)P */ 0xff, 0xd8, 0x52, 0xa3, 0xdc, 0x99, 0xcf, 0x3e, 0x19, 0xb3, 0x68, 0xd0, 0xb5, 0x0d, 0xb8, 0xee, 0x3f, 0xef, 0x6e, 0xc0, 0x38, 0x28, 0x44, 0x92, 0x78, 0x91, 0x1a, 0x08, 0x78, 0x6c, 0x65, 0x24, 0xf3, 0xa2, 0x3d, 0xf2, 0xe5, 0x79, 0x62, 0x69, 0x29, 0xf4, 0x22, 0xc5, 0xdb, 0x6a, 0xae, 0xf4, 0x44, 0xa3, 0x6f, 0xc7, 0x86, 0xab, 0xef, 0xef, - /* (2^ 56)P */ 0xbf, 0x54, 0x9a, 0x09, 0x5d, 0x17, 0xd0, 0xde, 0xfb, 0xf5, 0xca, 0xff, 0x13, 0x20, 0x88, 0x82, 0x3a, 0xe2, 0xd0, 0x3b, 0xfb, 0x05, 0x76, 0xd1, 0xc0, 0x02, 0x71, 0x3b, 0x94, 0xe8, 0xc9, 0x84, 0xcf, 0xa4, 0xe9, 0x28, 0x7b, 0xf5, 0x09, 0xc3, 0x2b, 0x22, 0x40, 0xf1, 0x68, 0x24, 0x24, 0x7d, 0x9f, 0x6e, 0xcd, 0xfe, 0xb0, 0x19, 0x61, 0xf5, - /* (2^ 57)P */ 0xe8, 0x63, 0x51, 0xb3, 0x95, 0x6b, 0x7b, 0x74, 0x92, 0x52, 0x45, 0xa4, 0xed, 0xea, 0x0e, 0x0d, 0x2b, 0x01, 0x1e, 0x2c, 0xbc, 0x91, 0x06, 0x69, 0xdb, 0x1f, 0xb5, 0x77, 0x1d, 0x56, 0xf5, 0xb4, 0x02, 0x80, 0x49, 0x56, 0x12, 0xce, 0x86, 0x05, 0xc9, 0xd9, 0xae, 0xf3, 0x6d, 0xe6, 0x3f, 0x40, 0x52, 0xe9, 0x49, 0x2b, 0x31, 0x06, 0x86, 0x14, - /* (2^ 58)P */ 0xf5, 0x09, 0x3b, 0xd2, 0xff, 0xdf, 0x11, 0xa5, 0x1c, 0x99, 0xe8, 0x1b, 0xa4, 0x2c, 0x7d, 0x8e, 0xc8, 0xf7, 0x03, 0x46, 0xfa, 0xb6, 0xde, 0x73, 0x91, 0x7e, 0x5a, 0x7a, 0xd7, 0x9a, 0x5b, 0x80, 0x24, 0x62, 0x5e, 0x92, 0xf1, 0xa3, 0x45, 0xa3, 0x43, 0x92, 0x8a, 0x2a, 0x5b, 0x0c, 0xb4, 0xc8, 0xad, 0x1c, 0xb6, 0x6c, 0x5e, 0x81, 0x18, 0x91, - /* (2^ 59)P */ 0x96, 0xb3, 0xca, 0x2b, 0xe3, 0x7a, 0x59, 0x72, 0x17, 0x74, 0x29, 0x21, 0xe7, 0x78, 0x07, 0xad, 0xda, 0xb6, 0xcd, 0xf9, 0x27, 0x4d, 0xc8, 0xf2, 0x98, 0x22, 0xca, 0xf2, 0x33, 0x74, 0x7a, 0xdd, 0x1e, 0x71, 0xec, 0xe3, 0x3f, 0xe2, 0xa2, 0xd2, 0x38, 0x75, 0xb0, 0xd0, 0x0a, 0xcf, 0x7d, 0x36, 0xdc, 0x49, 0x38, 0x25, 0x34, 0x4f, 0x20, 0x9a, - /* (2^ 60)P */ 0x2b, 0x6e, 0x04, 0x0d, 0x4f, 0x3d, 0x3b, 0x24, 0xf6, 0x4e, 0x5e, 0x0a, 0xbd, 0x48, 0x96, 0xba, 0x81, 0x8f, 0x39, 0x82, 0x13, 0xe6, 0x72, 0xf3, 0x0f, 0xb6, 0x94, 0xf4, 0xc5, 0x90, 0x74, 0x91, 0xa8, 0xf2, 0xc9, 0xca, 0x9a, 0x4d, 0x98, 0xf2, 0xdf, 0x52, 0x4e, 0x97, 0x2f, 0xeb, 0x84, 0xd3, 0xaf, 0xc2, 0xcc, 0xfb, 0x4c, 0x26, 0x4b, 0xe4, - /* (2^ 61)P */ 0x12, 0x9e, 0xfb, 0x9d, 0x78, 0x79, 0x99, 0xdd, 0xb3, 0x0b, 0x2e, 0x56, 0x41, 0x8e, 0x3f, 0x39, 0xb8, 0x97, 0x89, 0x53, 0x9b, 0x8a, 0x3c, 0x40, 0x9d, 0xa4, 0x6c, 0x2e, 0x31, 0x71, 0xc6, 0x0a, 0x41, 0xd4, 0x95, 0x06, 0x5e, 0xc1, 0xab, 0xc2, 0x14, 0xc4, 0xc7, 0x15, 0x08, 0x3a, 0xad, 0x7a, 0xb4, 0x62, 0xa3, 0x0c, 0x90, 0xf4, 0x47, 0x08, - /* (2^ 62)P */ 0x7f, 0xec, 0x09, 0x82, 0xf5, 0x94, 0x09, 0x93, 0x32, 0xd3, 0xdc, 0x56, 0x80, 0x7b, 0x5b, 0x22, 0x80, 0x6a, 0x96, 0x72, 0xb1, 0xc2, 0xd9, 0xa1, 0x8b, 0x66, 0x42, 0x16, 0xe2, 0x07, 0xb3, 0x2d, 0xf1, 0x75, 0x35, 0x72, 0xc7, 0x98, 0xbe, 0x63, 0x3b, 0x20, 0x75, 0x05, 0xc1, 0x3e, 0x31, 0x5a, 0xf7, 0xaa, 0xae, 0x4b, 0xdb, 0x1d, 0xd0, 0x74, - /* (2^ 63)P */ 0x36, 0x5c, 0x74, 0xe6, 0x5d, 0x59, 0x3f, 0x15, 0x4b, 0x4d, 0x4e, 0x67, 0x41, 0xfe, 0x98, 0x1f, 0x49, 0x76, 0x91, 0x0f, 0x9b, 0xf4, 0xaf, 0x86, 0xaf, 0x66, 0x19, 0xed, 0x46, 0xf1, 0x05, 0x9a, 0xcc, 0xd1, 0x14, 0x1f, 0x82, 0x12, 0x8e, 0xe6, 0xf4, 0xc3, 0x42, 0x5c, 0x4e, 0x33, 0x93, 0xbe, 0x30, 0xe7, 0x64, 0xa9, 0x35, 0x00, 0x4d, 0xf9, - /* (2^ 64)P */ 0x1f, 0xc1, 0x1e, 0xb7, 0xe3, 0x7c, 0xfa, 0xa3, 0x6b, 0x76, 0xaf, 0x9c, 0x05, 0x85, 0x4a, 0xa9, 0xfb, 0xe3, 0x7e, 0xf2, 0x49, 0x56, 0xdc, 0x2f, 0x57, 0x10, 0xba, 0x37, 0xb2, 0x62, 0xf5, 0x6b, 0xe5, 0x8f, 0x0a, 0x87, 0xd1, 0x6a, 0xcb, 0x9d, 0x07, 0xd0, 0xf6, 0x38, 0x99, 0x2c, 0x61, 0x4a, 0x4e, 0xd8, 0xd2, 0x88, 0x29, 0x99, 0x11, 0x95, - /* (2^ 65)P */ 0x6f, 0xdc, 0xd5, 0xd6, 0xd6, 0xa7, 0x4c, 0x46, 0x93, 0x65, 0x62, 0x23, 0x95, 0x32, 0x9c, 0xde, 0x40, 0x41, 0x68, 0x2c, 0x18, 0x4e, 0x5a, 0x8c, 0xc0, 0xc5, 0xc5, 0xea, 0x5c, 0x45, 0x0f, 0x60, 0x78, 0x39, 0xb6, 0x36, 0x23, 0x12, 0xbc, 0x21, 0x9a, 0xf8, 0x91, 0xac, 0xc4, 0x70, 0xdf, 0x85, 0x8e, 0x3c, 0xec, 0x22, 0x04, 0x98, 0xa8, 0xaa, - /* (2^ 66)P */ 0xcc, 0x52, 0x10, 0x5b, 0x4b, 0x6c, 0xc5, 0xfa, 0x3e, 0xd4, 0xf8, 0x1c, 0x04, 0x14, 0x48, 0x33, 0xd9, 0xfc, 0x5f, 0xb0, 0xa5, 0x48, 0x8c, 0x45, 0x8a, 0xee, 0x3e, 0xa7, 0xc1, 0x2e, 0x34, 0xca, 0xf6, 0xc9, 0xeb, 0x10, 0xbb, 0xe1, 0x59, 0x84, 0x25, 0xe8, 0x81, 0x70, 0xc0, 0x09, 0x42, 0xa7, 0x3b, 0x0d, 0x33, 0x00, 0xb5, 0x77, 0xbe, 0x25, - /* (2^ 67)P */ 0xcd, 0x1f, 0xbc, 0x7d, 0xef, 0xe5, 0xca, 0x91, 0xaf, 0xa9, 0x59, 0x6a, 0x09, 0xca, 0xd6, 0x1b, 0x3d, 0x55, 0xde, 0xa2, 0x6a, 0x80, 0xd6, 0x95, 0x47, 0xe4, 0x5f, 0x68, 0x54, 0x08, 0xdf, 0x29, 0xba, 0x2a, 0x02, 0x84, 0xe8, 0xe9, 0x00, 0x77, 0x99, 0x36, 0x03, 0xf6, 0x4a, 0x3e, 0x21, 0x81, 0x7d, 0xb8, 0xa4, 0x8a, 0xa2, 0x05, 0xef, 0xbc, - /* (2^ 68)P */ 0x7c, 0x59, 0x5f, 0x66, 0xd9, 0xb7, 0x83, 0x43, 0x8a, 0xa1, 0x8d, 0x51, 0x70, 0xba, 0xf2, 0x9b, 0x95, 0xc0, 0x4b, 0x4c, 0xa0, 0x14, 0xd3, 0xa4, 0x5d, 0x4a, 0x37, 0x36, 0x97, 0x31, 0x1e, 0x12, 0xe7, 0xbb, 0x08, 0x67, 0xa5, 0x23, 0xd7, 0xfb, 0x97, 0xd8, 0x6a, 0x03, 0xb1, 0xf8, 0x7f, 0xda, 0x58, 0xd9, 0x3f, 0x73, 0x4a, 0x53, 0xe1, 0x7b, - /* (2^ 69)P */ 0x55, 0x83, 0x98, 0x78, 0x6c, 0x56, 0x5e, 0xed, 0xf7, 0x23, 0x3e, 0x4c, 0x7d, 0x09, 0x2d, 0x09, 0x9c, 0x58, 0x8b, 0x32, 0xca, 0xfe, 0xbf, 0x47, 0x03, 0xeb, 0x4d, 0xe7, 0xeb, 0x9c, 0x83, 0x05, 0x68, 0xaa, 0x80, 0x89, 0x44, 0xf9, 0xd4, 0xdc, 0xdb, 0xb1, 0xdb, 0x77, 0xac, 0xf9, 0x2a, 0xae, 0x35, 0xac, 0x74, 0xb5, 0x95, 0x62, 0x18, 0x85, - /* (2^ 70)P */ 0xab, 0x82, 0x7e, 0x10, 0xd7, 0xe6, 0x57, 0xd1, 0x66, 0x12, 0x31, 0x9c, 0x9c, 0xa6, 0x27, 0x59, 0x71, 0x2e, 0xeb, 0xa0, 0x68, 0xc5, 0x87, 0x51, 0xf4, 0xca, 0x3f, 0x98, 0x56, 0xb0, 0x89, 0xb1, 0xc7, 0x7b, 0x46, 0xb3, 0xae, 0x36, 0xf2, 0xee, 0x15, 0x1a, 0x60, 0xf4, 0x50, 0x76, 0x4f, 0xc4, 0x53, 0x0d, 0x36, 0x4d, 0x31, 0xb1, 0x20, 0x51, - /* (2^ 71)P */ 0xf7, 0x1d, 0x8c, 0x1b, 0x5e, 0xe5, 0x02, 0x6f, 0xc5, 0xa5, 0xe0, 0x5f, 0xc6, 0xb6, 0x63, 0x43, 0xaf, 0x3c, 0x19, 0x6c, 0xf4, 0xaf, 0xa4, 0x33, 0xb1, 0x0a, 0x37, 0x3d, 0xd9, 0x4d, 0xe2, 0x29, 0x24, 0x26, 0x94, 0x7c, 0x02, 0xe4, 0xe2, 0xf2, 0xbe, 0xbd, 0xac, 0x1b, 0x48, 0xb8, 0xdd, 0xe9, 0x0d, 0x9a, 0x50, 0x1a, 0x98, 0x71, 0x6e, 0xdc, - /* (2^ 72)P */ 0x9f, 0x40, 0xb1, 0xb3, 0x66, 0x28, 0x6c, 0xfe, 0xa6, 0x7d, 0xf8, 0x3e, 0xb8, 0xf3, 0xde, 0x52, 0x76, 0x52, 0xa3, 0x92, 0x98, 0x23, 0xab, 0x4f, 0x88, 0x97, 0xfc, 0x22, 0xe1, 0x6b, 0x67, 0xcd, 0x13, 0x95, 0xda, 0x65, 0xdd, 0x3b, 0x67, 0x3f, 0x5f, 0x4c, 0xf2, 0x8a, 0xad, 0x98, 0xa7, 0x94, 0x24, 0x45, 0x87, 0x11, 0x7c, 0x75, 0x79, 0x85, - /* (2^ 73)P */ 0x70, 0xbf, 0xf9, 0x3b, 0xa9, 0x44, 0x57, 0x72, 0x96, 0xc9, 0xa4, 0x98, 0x65, 0xbf, 0x87, 0xb3, 0x3a, 0x39, 0x12, 0xde, 0xe5, 0x39, 0x01, 0x4f, 0xf7, 0xc0, 0x71, 0x52, 0x36, 0x85, 0xb3, 0x18, 0xf8, 0x14, 0xc0, 0x6d, 0xae, 0x9e, 0x4f, 0xb0, 0x72, 0x87, 0xac, 0x5c, 0xd1, 0x6c, 0x41, 0x6c, 0x90, 0x9d, 0x22, 0x81, 0xe4, 0x2b, 0xea, 0xe5, - /* (2^ 74)P */ 0xfc, 0xea, 0x1a, 0x65, 0xd9, 0x49, 0x6a, 0x39, 0xb5, 0x96, 0x72, 0x7b, 0x32, 0xf1, 0xd0, 0xe9, 0x45, 0xd9, 0x31, 0x55, 0xc7, 0x34, 0xe9, 0x5a, 0xec, 0x73, 0x0b, 0x03, 0xc4, 0xb3, 0xe6, 0xc9, 0x5e, 0x0a, 0x17, 0xfe, 0x53, 0x66, 0x7f, 0x21, 0x18, 0x74, 0x54, 0x1b, 0xc9, 0x49, 0x16, 0xd2, 0x48, 0xaf, 0x5b, 0x47, 0x7b, 0xeb, 0xaa, 0xc9, - /* (2^ 75)P */ 0x47, 0x04, 0xf5, 0x5a, 0x87, 0x77, 0x9e, 0x21, 0x34, 0x4e, 0x83, 0x88, 0xaf, 0x02, 0x1d, 0xb0, 0x5a, 0x1d, 0x1d, 0x7d, 0x8d, 0x2c, 0xd3, 0x8d, 0x63, 0xa9, 0x45, 0xfb, 0x15, 0x6d, 0x86, 0x45, 0xcd, 0x38, 0x0e, 0xf7, 0x37, 0x79, 0xed, 0x6d, 0x5a, 0xbc, 0x32, 0xcc, 0x66, 0xf1, 0x3a, 0xb2, 0x87, 0x6f, 0x70, 0x71, 0xd9, 0xf2, 0xfa, 0x7b, - /* (2^ 76)P */ 0x68, 0x07, 0xdc, 0x61, 0x40, 0xe4, 0xec, 0x32, 0xc8, 0xbe, 0x66, 0x30, 0x54, 0x80, 0xfd, 0x13, 0x7a, 0xef, 0xae, 0xed, 0x2e, 0x00, 0x6d, 0x3f, 0xbd, 0xfc, 0x91, 0x24, 0x53, 0x7f, 0x63, 0x9d, 0x2e, 0xe3, 0x76, 0xe0, 0xf3, 0xe1, 0x8f, 0x7a, 0xc4, 0x77, 0x0c, 0x91, 0xc0, 0xc2, 0x18, 0x6b, 0x04, 0xad, 0xb6, 0x70, 0x9a, 0x64, 0xc5, 0x82, - /* (2^ 77)P */ 0x7f, 0xea, 0x13, 0xd8, 0x9e, 0xfc, 0x5b, 0x06, 0xb5, 0x4f, 0xda, 0x38, 0xe0, 0x9c, 0xd2, 0x3a, 0xc1, 0x1c, 0x62, 0x70, 0x7f, 0xc6, 0x24, 0x0a, 0x47, 0x04, 0x01, 0xc4, 0x55, 0x09, 0xd1, 0x7a, 0x07, 0xba, 0xa3, 0x80, 0x4f, 0xc1, 0x65, 0x36, 0x6d, 0xc0, 0x10, 0xcf, 0x94, 0xa9, 0xa2, 0x01, 0x44, 0xd1, 0xf9, 0x1c, 0x4c, 0xfb, 0xf8, 0x99, - /* (2^ 78)P */ 0x6c, 0xb9, 0x6b, 0xee, 0x43, 0x5b, 0xb9, 0xbb, 0xee, 0x2e, 0x52, 0xc1, 0xc6, 0xb9, 0x61, 0xd2, 0x93, 0xa5, 0xaf, 0x52, 0xf4, 0xa4, 0x1a, 0x51, 0x61, 0xa7, 0xcb, 0x9e, 0xbb, 0x56, 0x65, 0xe2, 0xbf, 0x75, 0xb9, 0x9c, 0x50, 0x96, 0x60, 0x81, 0x74, 0x47, 0xc0, 0x04, 0x88, 0x71, 0x76, 0x39, 0x9a, 0xa7, 0xb1, 0x4e, 0x43, 0x15, 0xe0, 0xbb, - /* (2^ 79)P */ 0xbb, 0xce, 0xe2, 0xbb, 0xf9, 0x17, 0x0f, 0x82, 0x40, 0xad, 0x73, 0xe3, 0xeb, 0x3b, 0x06, 0x1a, 0xcf, 0x8e, 0x6e, 0x28, 0xb8, 0x26, 0xd9, 0x5b, 0xb7, 0xb3, 0xcf, 0xb4, 0x6a, 0x1c, 0xbf, 0x7f, 0xb8, 0xb5, 0x79, 0xcf, 0x45, 0x68, 0x7d, 0xc5, 0xeb, 0xf3, 0xbe, 0x39, 0x40, 0xfc, 0x07, 0x90, 0x7a, 0x62, 0xad, 0x86, 0x08, 0x71, 0x25, 0xe1, - /* (2^ 80)P */ 0x9b, 0x46, 0xac, 0xef, 0xc1, 0x4e, 0xa1, 0x97, 0x95, 0x76, 0xf9, 0x1b, 0xc2, 0xb2, 0x6a, 0x41, 0xea, 0x80, 0x3d, 0xe9, 0x08, 0x52, 0x5a, 0xe3, 0xf2, 0x08, 0xc5, 0xea, 0x39, 0x3f, 0x44, 0x71, 0x4d, 0xea, 0x0d, 0x05, 0x23, 0xe4, 0x2e, 0x3c, 0x89, 0xfe, 0x12, 0x8a, 0x95, 0x42, 0x0a, 0x68, 0xea, 0x5a, 0x28, 0x06, 0x9e, 0xe3, 0x5f, 0xe0, - /* (2^ 81)P */ 0x00, 0x61, 0x6c, 0x98, 0x9b, 0xe7, 0xb9, 0x06, 0x1c, 0xc5, 0x1b, 0xed, 0xbe, 0xc8, 0xb3, 0xea, 0x87, 0xf0, 0xc4, 0x24, 0x7d, 0xbb, 0x5d, 0xa4, 0x1d, 0x7a, 0x16, 0x00, 0x55, 0x94, 0x67, 0x78, 0xbd, 0x58, 0x02, 0x82, 0x90, 0x53, 0x76, 0xd4, 0x72, 0x99, 0x51, 0x6f, 0x7b, 0xcf, 0x80, 0x30, 0x31, 0x3b, 0x01, 0xc7, 0xc1, 0xef, 0xe6, 0x42, - /* (2^ 82)P */ 0xe2, 0x35, 0xaf, 0x4b, 0x79, 0xc6, 0x12, 0x24, 0x99, 0xc0, 0x68, 0xb0, 0x43, 0x3e, 0xe5, 0xef, 0xe2, 0x29, 0xea, 0xb8, 0xb3, 0xbc, 0x6a, 0x53, 0x2c, 0x69, 0x18, 0x5a, 0xf9, 0x15, 0xae, 0x66, 0x58, 0x18, 0xd3, 0x2d, 0x4b, 0x00, 0xfd, 0x84, 0xab, 0x4f, 0xae, 0x70, 0x6b, 0x9e, 0x9a, 0xdf, 0x83, 0xfd, 0x2e, 0x3c, 0xcf, 0xf8, 0x88, 0x5b, - /* (2^ 83)P */ 0xa4, 0x90, 0x31, 0x85, 0x13, 0xcd, 0xdf, 0x64, 0xc9, 0xa1, 0x0b, 0xe7, 0xb6, 0x73, 0x8a, 0x1b, 0x22, 0x78, 0x4c, 0xd4, 0xae, 0x48, 0x18, 0x00, 0x00, 0xa8, 0x9f, 0x06, 0xf9, 0xfb, 0x2d, 0xc3, 0xb1, 0x2a, 0xbc, 0x13, 0x99, 0x57, 0xaf, 0xf0, 0x8d, 0x61, 0x54, 0x29, 0xd5, 0xf2, 0x72, 0x00, 0x96, 0xd1, 0x85, 0x12, 0x8a, 0xf0, 0x23, 0xfb, - /* (2^ 84)P */ 0x69, 0xc7, 0xdb, 0xd9, 0x92, 0x75, 0x08, 0x9b, 0xeb, 0xa5, 0x93, 0xd1, 0x1a, 0xf4, 0xf5, 0xaf, 0xe6, 0xc4, 0x4a, 0x0d, 0x35, 0x26, 0x39, 0x9d, 0xd3, 0x17, 0x3e, 0xae, 0x2d, 0xbf, 0x73, 0x9f, 0xb7, 0x74, 0x91, 0xd1, 0xd8, 0x5c, 0x14, 0xf9, 0x75, 0xdf, 0xeb, 0xc2, 0x22, 0xd8, 0x14, 0x8d, 0x86, 0x23, 0x4d, 0xd1, 0x2d, 0xdb, 0x6b, 0x42, - /* (2^ 85)P */ 0x8c, 0xda, 0xc6, 0xf8, 0x71, 0xba, 0x2b, 0x06, 0x78, 0xae, 0xcc, 0x3a, 0xe3, 0xe3, 0xa1, 0x8b, 0xe2, 0x34, 0x6d, 0x28, 0x9e, 0x46, 0x13, 0x4d, 0x9e, 0xa6, 0x73, 0x49, 0x65, 0x79, 0x88, 0xb9, 0x3a, 0xd1, 0x6d, 0x2f, 0x48, 0x2b, 0x0a, 0x7f, 0x58, 0x20, 0x37, 0xf4, 0x0e, 0xbb, 0x4a, 0x95, 0x58, 0x0c, 0x88, 0x30, 0xc4, 0x74, 0xdd, 0xfd, - /* (2^ 86)P */ 0x6d, 0x13, 0x4e, 0x89, 0x2d, 0xa9, 0xa3, 0xed, 0x09, 0xe3, 0x0e, 0x71, 0x3e, 0x4a, 0xab, 0x90, 0xde, 0x03, 0xeb, 0x56, 0x46, 0x60, 0x06, 0xf5, 0x71, 0xe5, 0xee, 0x9b, 0xef, 0xff, 0xc4, 0x2c, 0x9f, 0x37, 0x48, 0x45, 0x94, 0x12, 0x41, 0x81, 0x15, 0x70, 0x91, 0x99, 0x5e, 0x56, 0x6b, 0xf4, 0xa6, 0xc9, 0xf5, 0x69, 0x9d, 0x78, 0x37, 0x57, - /* (2^ 87)P */ 0xf3, 0x51, 0x57, 0x7e, 0x43, 0x6f, 0xc6, 0x67, 0x59, 0x0c, 0xcf, 0x94, 0xe6, 0x3d, 0xb5, 0x07, 0xc9, 0x77, 0x48, 0xc9, 0x68, 0x0d, 0x98, 0x36, 0x62, 0x35, 0x38, 0x1c, 0xf5, 0xc5, 0xec, 0x66, 0x78, 0xfe, 0x47, 0xab, 0x26, 0xd6, 0x44, 0xb6, 0x06, 0x0f, 0x89, 0xe3, 0x19, 0x40, 0x1a, 0xe7, 0xd8, 0x65, 0x55, 0xf7, 0x1a, 0xfc, 0xa3, 0x0e, - /* (2^ 88)P */ 0x0e, 0x30, 0xa6, 0xb7, 0x58, 0x60, 0x62, 0x2a, 0x6c, 0x13, 0xa8, 0x14, 0x9b, 0xb8, 0xf2, 0x70, 0xd8, 0xb1, 0x71, 0x88, 0x8c, 0x18, 0x31, 0x25, 0x93, 0x90, 0xb4, 0xc7, 0x49, 0xd8, 0xd4, 0xdb, 0x1e, 0x1e, 0x7f, 0xaa, 0xba, 0xc9, 0xf2, 0x5d, 0xa9, 0x3a, 0x43, 0xb4, 0x5c, 0xee, 0x7b, 0xc7, 0x97, 0xb7, 0x66, 0xd7, 0x23, 0xd9, 0x22, 0x59, - /* (2^ 89)P */ 0x28, 0x19, 0xa6, 0xf9, 0x89, 0x20, 0x78, 0xd4, 0x6d, 0xcb, 0x79, 0x8f, 0x61, 0x6f, 0xb2, 0x5c, 0x4f, 0xa6, 0x54, 0x84, 0x95, 0x24, 0x36, 0x64, 0xcb, 0x39, 0xe7, 0x8f, 0x97, 0x9c, 0x5c, 0x3c, 0xfb, 0x51, 0x11, 0x01, 0x17, 0xdb, 0xc9, 0x9b, 0x51, 0x03, 0x9a, 0xe9, 0xe5, 0x24, 0x1e, 0xf5, 0xda, 0xe0, 0x48, 0x02, 0x23, 0xd0, 0x2c, 0x81, - /* (2^ 90)P */ 0x42, 0x1b, 0xe4, 0x91, 0x85, 0x2a, 0x0c, 0xd2, 0x28, 0x66, 0x57, 0x9e, 0x33, 0x8d, 0x25, 0x71, 0x10, 0x65, 0x76, 0xa2, 0x8c, 0x21, 0x86, 0x81, 0x15, 0xc2, 0x27, 0xeb, 0x54, 0x2d, 0x4f, 0x6c, 0xe6, 0xd6, 0x24, 0x9c, 0x1a, 0x12, 0xb8, 0x81, 0xe2, 0x0a, 0xf3, 0xd3, 0xf0, 0xd3, 0xe1, 0x74, 0x1f, 0x9b, 0x11, 0x47, 0xd0, 0xcf, 0xb6, 0x54, - /* (2^ 91)P */ 0x26, 0x45, 0xa2, 0x10, 0xd4, 0x2d, 0xae, 0xc0, 0xb0, 0xe8, 0x86, 0xb3, 0xc7, 0xea, 0x70, 0x87, 0x61, 0xb5, 0xa5, 0x55, 0xbe, 0x88, 0x1d, 0x7a, 0xd9, 0x6f, 0xeb, 0x83, 0xe2, 0x44, 0x7f, 0x98, 0x04, 0xd6, 0x50, 0x9d, 0xa7, 0x86, 0x66, 0x09, 0x63, 0xe1, 0xed, 0x72, 0xb1, 0xe4, 0x1d, 0x3a, 0xfd, 0x47, 0xce, 0x1c, 0xaa, 0x3b, 0x8f, 0x1b, - /* (2^ 92)P */ 0xf4, 0x3c, 0x4a, 0xb6, 0xc2, 0x9c, 0xe0, 0x2e, 0xb7, 0x38, 0xea, 0x61, 0x35, 0x97, 0x10, 0x90, 0xae, 0x22, 0x48, 0xb3, 0xa9, 0xc6, 0x7a, 0xbb, 0x23, 0xf2, 0xf8, 0x1b, 0xa7, 0xa1, 0x79, 0xcc, 0xc4, 0xf8, 0x08, 0x76, 0x8a, 0x5a, 0x1c, 0x1b, 0xc5, 0x33, 0x91, 0xa9, 0xb8, 0xb9, 0xd3, 0xf8, 0x49, 0xcd, 0xe5, 0x82, 0x43, 0xf7, 0xca, 0x68, - /* (2^ 93)P */ 0x38, 0xba, 0xae, 0x44, 0xfe, 0x57, 0x64, 0x56, 0x7c, 0x0e, 0x9c, 0xca, 0xff, 0xa9, 0x82, 0xbb, 0x38, 0x4a, 0xa7, 0xf7, 0x47, 0xab, 0xbe, 0x6d, 0x23, 0x0b, 0x8a, 0xed, 0xc2, 0xb9, 0x8f, 0xf1, 0xec, 0x91, 0x44, 0x73, 0x64, 0xba, 0xd5, 0x8f, 0x37, 0x38, 0x0d, 0xd5, 0xf8, 0x73, 0x57, 0xb6, 0xc2, 0x45, 0xdc, 0x25, 0xb2, 0xb6, 0xea, 0xd9, - /* (2^ 94)P */ 0xbf, 0xe9, 0x1a, 0x40, 0x4d, 0xcc, 0xe6, 0x1d, 0x70, 0x1a, 0x65, 0xcc, 0x34, 0x2c, 0x37, 0x2c, 0x2d, 0x6b, 0x6d, 0xe5, 0x2f, 0x19, 0x9e, 0xe4, 0xe1, 0xaa, 0xd4, 0xab, 0x54, 0xf4, 0xa8, 0xe4, 0x69, 0x2d, 0x8e, 0x4d, 0xd7, 0xac, 0xb0, 0x5b, 0xfe, 0xe3, 0x26, 0x07, 0xc3, 0xf8, 0x1b, 0x43, 0xa8, 0x1d, 0x64, 0xa5, 0x25, 0x88, 0xbb, 0x77, - /* (2^ 95)P */ 0x92, 0xcd, 0x6e, 0xa0, 0x79, 0x04, 0x18, 0xf4, 0x11, 0x58, 0x48, 0xb5, 0x3c, 0x7b, 0xd1, 0xcc, 0xd3, 0x14, 0x2c, 0xa0, 0xdd, 0x04, 0x44, 0x11, 0xb3, 0x6d, 0x2f, 0x0d, 0xf5, 0x2a, 0x75, 0x5d, 0x1d, 0xda, 0x86, 0x8d, 0x7d, 0x6b, 0x32, 0x68, 0xb6, 0x6c, 0x64, 0x9e, 0xde, 0x80, 0x88, 0xce, 0x08, 0xbf, 0x0b, 0xe5, 0x8e, 0x4f, 0x1d, 0xfb, - /* (2^ 96)P */ 0xaf, 0xe8, 0x85, 0xbf, 0x7f, 0x37, 0x8d, 0x66, 0x7c, 0xd5, 0xd3, 0x96, 0xa5, 0x81, 0x67, 0x95, 0xff, 0x48, 0xde, 0xde, 0xd7, 0x7a, 0x46, 0x34, 0xb1, 0x13, 0x70, 0x29, 0xed, 0x87, 0x90, 0xb0, 0x40, 0x2c, 0xa6, 0x43, 0x6e, 0xb6, 0xbc, 0x48, 0x8a, 0xc1, 0xae, 0xb8, 0xd4, 0xe2, 0xc0, 0x32, 0xb2, 0xa6, 0x2a, 0x8f, 0xb5, 0x16, 0x9e, 0xc3, - /* (2^ 97)P */ 0xff, 0x4d, 0xd2, 0xd6, 0x74, 0xef, 0x2c, 0x96, 0xc1, 0x11, 0xa8, 0xb8, 0xfe, 0x94, 0x87, 0x3e, 0xa0, 0xfb, 0x57, 0xa3, 0xfc, 0x7a, 0x7e, 0x6a, 0x59, 0x6c, 0x54, 0xbb, 0xbb, 0xa2, 0x25, 0x38, 0x1b, 0xdf, 0x5d, 0x7b, 0x94, 0x14, 0xde, 0x07, 0x6e, 0xd3, 0xab, 0x02, 0x26, 0x74, 0x16, 0x12, 0xdf, 0x2e, 0x2a, 0xa7, 0xb0, 0xe8, 0x29, 0xc0, - /* (2^ 98)P */ 0x6a, 0x38, 0x0b, 0xd3, 0xba, 0x45, 0x23, 0xe0, 0x04, 0x3b, 0x83, 0x39, 0xc5, 0x11, 0xe6, 0xcf, 0x39, 0x0a, 0xb3, 0xb0, 0x3b, 0x27, 0x29, 0x63, 0x1c, 0xf3, 0x00, 0xe6, 0xd2, 0x55, 0x21, 0x1f, 0x84, 0x97, 0x9f, 0x01, 0x49, 0x43, 0x30, 0x5f, 0xe0, 0x1d, 0x24, 0xc4, 0x4e, 0xa0, 0x2b, 0x0b, 0x12, 0x55, 0xc3, 0x27, 0xae, 0x08, 0x83, 0x7c, - /* (2^ 99)P */ 0x5d, 0x1a, 0xb7, 0xa9, 0xf5, 0xfd, 0xec, 0xad, 0xb7, 0x87, 0x02, 0x5f, 0x0d, 0x30, 0x4d, 0xe2, 0x65, 0x87, 0xa4, 0x41, 0x45, 0x1d, 0x67, 0xe0, 0x30, 0x5c, 0x13, 0x87, 0xf6, 0x2e, 0x08, 0xc1, 0xc7, 0x12, 0x45, 0xc8, 0x9b, 0xad, 0xb8, 0xd5, 0x57, 0xbb, 0x5c, 0x48, 0x3a, 0xe1, 0x91, 0x5e, 0xf6, 0x4d, 0x8a, 0x63, 0x75, 0x69, 0x0c, 0x01, - /* (2^100)P */ 0x8f, 0x53, 0x2d, 0xa0, 0x71, 0x3d, 0xfc, 0x45, 0x10, 0x96, 0xcf, 0x56, 0xf9, 0xbb, 0x40, 0x3c, 0x86, 0x52, 0x76, 0xbe, 0x84, 0xf9, 0xa6, 0x9d, 0x3d, 0x27, 0xbe, 0xb4, 0x00, 0x49, 0x94, 0xf5, 0x5d, 0xe1, 0x62, 0x85, 0x66, 0xe5, 0xb8, 0x20, 0x2c, 0x09, 0x7d, 0x9d, 0x3d, 0x6e, 0x74, 0x39, 0xab, 0xad, 0xa0, 0x90, 0x97, 0x5f, 0xbb, 0xa7, - /* (2^101)P */ 0xdb, 0x2d, 0x99, 0x08, 0x16, 0x46, 0x83, 0x7a, 0xa8, 0xea, 0x3d, 0x28, 0x5b, 0x49, 0xfc, 0xb9, 0x6d, 0x00, 0x9e, 0x54, 0x4f, 0x47, 0x64, 0x9b, 0x58, 0x4d, 0x07, 0x0c, 0x6f, 0x29, 0x56, 0x0b, 0x00, 0x14, 0x85, 0x96, 0x41, 0x04, 0xb9, 0x5c, 0xa4, 0xf6, 0x16, 0x73, 0x6a, 0xc7, 0x62, 0x0c, 0x65, 0x2f, 0x93, 0xbf, 0xf7, 0xb9, 0xb7, 0xf1, - /* (2^102)P */ 0xeb, 0x6d, 0xb3, 0x46, 0x32, 0xd2, 0xcb, 0x08, 0x94, 0x14, 0xbf, 0x3f, 0xc5, 0xcb, 0x5f, 0x9f, 0x8a, 0x89, 0x0c, 0x1b, 0x45, 0xad, 0x4c, 0x50, 0xb4, 0xe1, 0xa0, 0x6b, 0x11, 0x92, 0xaf, 0x1f, 0x00, 0xcc, 0xe5, 0x13, 0x7e, 0xe4, 0x2e, 0xa0, 0x57, 0xf3, 0xa7, 0x84, 0x79, 0x7a, 0xc2, 0xb7, 0xb7, 0xfc, 0x5d, 0xa5, 0xa9, 0x64, 0xcc, 0xd8, - /* (2^103)P */ 0xa9, 0xc4, 0x12, 0x8b, 0x34, 0x78, 0x3e, 0x38, 0xfd, 0x3f, 0x87, 0xfa, 0x88, 0x94, 0xd5, 0xd9, 0x7f, 0xeb, 0x58, 0xff, 0xb9, 0x45, 0xdb, 0xa1, 0xed, 0x22, 0x28, 0x1d, 0x00, 0x6d, 0x79, 0x85, 0x7a, 0x75, 0x5d, 0xf0, 0xb1, 0x9e, 0x47, 0x28, 0x8c, 0x62, 0xdf, 0xfb, 0x4c, 0x7b, 0xc5, 0x1a, 0x42, 0x95, 0xef, 0x9a, 0xb7, 0x27, 0x7e, 0xda, - /* (2^104)P */ 0xca, 0xd5, 0xc0, 0x17, 0xa1, 0x66, 0x79, 0x9c, 0x2a, 0xb7, 0x0a, 0xfe, 0x62, 0xe4, 0x26, 0x78, 0x90, 0xa7, 0xcb, 0xb0, 0x4f, 0x6d, 0xf9, 0x8f, 0xf7, 0x7d, 0xac, 0xb8, 0x78, 0x1f, 0x41, 0xea, 0x97, 0x1e, 0x62, 0x97, 0x43, 0x80, 0x58, 0x80, 0xb6, 0x69, 0x7d, 0xee, 0x16, 0xd2, 0xa1, 0x81, 0xd7, 0xb1, 0x27, 0x03, 0x48, 0xda, 0xab, 0xec, - /* (2^105)P */ 0x5b, 0xed, 0x40, 0x8e, 0x8c, 0xc1, 0x66, 0x90, 0x7f, 0x0c, 0xb2, 0xfc, 0xbd, 0x16, 0xac, 0x7d, 0x4c, 0x6a, 0xf9, 0xae, 0xe7, 0x4e, 0x11, 0x12, 0xe9, 0xbe, 0x17, 0x09, 0xc6, 0xc1, 0x5e, 0xb5, 0x7b, 0x50, 0x5c, 0x27, 0xfb, 0x80, 0xab, 0x01, 0xfa, 0x5b, 0x9b, 0x75, 0x16, 0x6e, 0xb2, 0x5c, 0x8c, 0x2f, 0xa5, 0x6a, 0x1a, 0x68, 0xa6, 0x90, - /* (2^106)P */ 0x75, 0xfe, 0xb6, 0x96, 0x96, 0x87, 0x4c, 0x12, 0xa9, 0xd1, 0xd8, 0x03, 0xa3, 0xc1, 0x15, 0x96, 0xe8, 0xa0, 0x75, 0x82, 0xa0, 0x6d, 0xea, 0x54, 0xdc, 0x5f, 0x0d, 0x7e, 0xf6, 0x70, 0xb5, 0xdc, 0x7a, 0xf6, 0xc4, 0xd4, 0x21, 0x49, 0xf5, 0xd4, 0x14, 0x6d, 0x48, 0x1d, 0x7c, 0x99, 0x42, 0xdf, 0x78, 0x6b, 0x9d, 0xb9, 0x30, 0x3c, 0xd0, 0x29, - /* (2^107)P */ 0x85, 0xd6, 0xd8, 0xf3, 0x91, 0x74, 0xdd, 0xbd, 0x72, 0x96, 0x10, 0xe4, 0x76, 0x02, 0x5a, 0x72, 0x67, 0xd3, 0x17, 0x72, 0x14, 0x9a, 0x20, 0x5b, 0x0f, 0x8d, 0xed, 0x6d, 0x4e, 0xe3, 0xd9, 0x82, 0xc2, 0x99, 0xee, 0x39, 0x61, 0x69, 0x8a, 0x24, 0x01, 0x92, 0x15, 0xe7, 0xfc, 0xf9, 0x4d, 0xac, 0xf1, 0x30, 0x49, 0x01, 0x0b, 0x6e, 0x0f, 0x20, - /* (2^108)P */ 0xd8, 0x25, 0x94, 0x5e, 0x43, 0x29, 0xf5, 0xcc, 0xe8, 0xe3, 0x55, 0x41, 0x3c, 0x9f, 0x58, 0x5b, 0x00, 0xeb, 0xc5, 0xdf, 0xcf, 0xfb, 0xfd, 0x6e, 0x92, 0xec, 0x99, 0x30, 0xd6, 0x05, 0xdd, 0x80, 0x7a, 0x5d, 0x6d, 0x16, 0x85, 0xd8, 0x9d, 0x43, 0x65, 0xd8, 0x2c, 0x33, 0x2f, 0x5c, 0x41, 0xea, 0xb7, 0x95, 0x77, 0xf2, 0x9e, 0x59, 0x09, 0xe8, - /* (2^109)P */ 0x00, 0xa0, 0x03, 0x80, 0xcd, 0x60, 0xe5, 0x17, 0xd4, 0x15, 0x99, 0xdd, 0x4f, 0xbf, 0x66, 0xb8, 0xc0, 0xf5, 0xf9, 0xfc, 0x6d, 0x42, 0x18, 0x34, 0x1c, 0x7d, 0x5b, 0xb5, 0x09, 0xd0, 0x99, 0x57, 0x81, 0x0b, 0x62, 0xb3, 0xa2, 0xf9, 0x0b, 0xae, 0x95, 0xb8, 0xc2, 0x3b, 0x0d, 0x5b, 0x00, 0xf1, 0xed, 0xbc, 0x05, 0x9d, 0x61, 0xbc, 0x73, 0x9d, - /* (2^110)P */ 0xd4, 0xdb, 0x29, 0xe5, 0x85, 0xe9, 0xc6, 0x89, 0x2a, 0xa8, 0x54, 0xab, 0xb3, 0x7f, 0x88, 0xc0, 0x4d, 0xe0, 0xd1, 0x74, 0x6e, 0xa3, 0xa7, 0x39, 0xd5, 0xcc, 0xa1, 0x8a, 0xcb, 0x5b, 0x34, 0xad, 0x92, 0xb4, 0xd8, 0xd5, 0x17, 0xf6, 0x77, 0x18, 0x9e, 0xaf, 0x45, 0x3b, 0x03, 0xe2, 0xf8, 0x52, 0x60, 0xdc, 0x15, 0x20, 0x9e, 0xdf, 0xd8, 0x5d, - /* (2^111)P */ 0x02, 0xc1, 0xac, 0x1a, 0x15, 0x8e, 0x6c, 0xf5, 0x1e, 0x1e, 0xba, 0x7e, 0xc2, 0xda, 0x7d, 0x02, 0xda, 0x43, 0xae, 0x04, 0x70, 0x28, 0x54, 0x78, 0x94, 0xf5, 0x4f, 0x07, 0x84, 0x8f, 0xed, 0xaa, 0xc0, 0xb8, 0xcd, 0x7f, 0x7e, 0x33, 0xa3, 0xbe, 0x21, 0x29, 0xc8, 0x56, 0x34, 0xc0, 0x76, 0x87, 0x8f, 0xc7, 0x73, 0x58, 0x90, 0x16, 0xfc, 0xd6, - /* (2^112)P */ 0xb8, 0x3f, 0xe1, 0xdf, 0x3a, 0x91, 0x25, 0x0c, 0xf6, 0x47, 0xa8, 0x89, 0xc4, 0xc6, 0x61, 0xec, 0x86, 0x2c, 0xfd, 0xbe, 0xa4, 0x6f, 0xc2, 0xd4, 0x46, 0x19, 0x70, 0x5d, 0x09, 0x02, 0x86, 0xd3, 0x4b, 0xe9, 0x16, 0x7b, 0xf0, 0x0d, 0x6c, 0xff, 0x91, 0x05, 0xbf, 0x55, 0xb4, 0x00, 0x8d, 0xe5, 0x6d, 0x68, 0x20, 0x90, 0x12, 0xb5, 0x5c, 0x32, - /* (2^113)P */ 0x80, 0x45, 0xc8, 0x51, 0x87, 0xba, 0x1c, 0x5c, 0xcf, 0x5f, 0x4b, 0x3c, 0x9e, 0x3b, 0x36, 0xd2, 0x26, 0xa2, 0x7f, 0xab, 0xb7, 0xbf, 0xda, 0x68, 0x23, 0x8f, 0xc3, 0xa0, 0xfd, 0xad, 0xf1, 0x56, 0x3b, 0xd0, 0x75, 0x2b, 0x44, 0x61, 0xd8, 0xf4, 0xf1, 0x05, 0x49, 0x53, 0x07, 0xee, 0x47, 0xef, 0xc0, 0x7c, 0x9d, 0xe4, 0x15, 0x88, 0xc5, 0x47, - /* (2^114)P */ 0x2d, 0xb5, 0x09, 0x80, 0xb9, 0xd3, 0xd8, 0xfe, 0x4c, 0xd2, 0xa6, 0x6e, 0xd3, 0x75, 0xcf, 0xb0, 0x99, 0xcb, 0x50, 0x8d, 0xe9, 0x67, 0x9b, 0x20, 0xe8, 0x57, 0xd8, 0x14, 0x85, 0x73, 0x6a, 0x74, 0xe0, 0x99, 0xf0, 0x6b, 0x6e, 0x59, 0x30, 0x31, 0x33, 0x96, 0x5f, 0xa1, 0x0c, 0x1b, 0xf4, 0xca, 0x09, 0xe1, 0x9b, 0xb5, 0xcf, 0x6d, 0x0b, 0xeb, - /* (2^115)P */ 0x1a, 0xde, 0x50, 0xa9, 0xac, 0x3e, 0x10, 0x43, 0x4f, 0x82, 0x4f, 0xc0, 0xfe, 0x3f, 0x33, 0xd2, 0x64, 0x86, 0x50, 0xa9, 0x51, 0x76, 0x5e, 0x50, 0x97, 0x6c, 0x73, 0x8d, 0x77, 0xa3, 0x75, 0x03, 0xbc, 0xc9, 0xfb, 0x50, 0xd9, 0x6d, 0x16, 0xad, 0x5d, 0x32, 0x3d, 0xac, 0x44, 0xdf, 0x51, 0xf7, 0x19, 0xd4, 0x0b, 0x57, 0x78, 0x0b, 0x81, 0x4e, - /* (2^116)P */ 0x32, 0x24, 0xf1, 0x6c, 0x55, 0x62, 0x1d, 0xb3, 0x1f, 0xda, 0xfa, 0x6a, 0x8f, 0x98, 0x01, 0x16, 0xde, 0x44, 0x50, 0x0d, 0x2e, 0x6c, 0x0b, 0xa2, 0xd3, 0x74, 0x0e, 0xa9, 0xbf, 0x8d, 0xa9, 0xc8, 0xc8, 0x2f, 0x62, 0xc1, 0x35, 0x5e, 0xfd, 0x3a, 0xb3, 0x83, 0x2d, 0xee, 0x4e, 0xfd, 0x5c, 0x5e, 0xad, 0x85, 0xa5, 0x10, 0xb5, 0x4f, 0x34, 0xa7, - /* (2^117)P */ 0xd1, 0x58, 0x6f, 0xe6, 0x54, 0x2c, 0xc2, 0xcd, 0xcf, 0x83, 0xdc, 0x88, 0x0c, 0xb9, 0xb4, 0x62, 0x18, 0x89, 0x65, 0x28, 0xe9, 0x72, 0x4b, 0x65, 0xcf, 0xd6, 0x90, 0x88, 0xd7, 0x76, 0x17, 0x4f, 0x74, 0x64, 0x1e, 0xcb, 0xd3, 0xf5, 0x4b, 0xaa, 0x2e, 0x4d, 0x2d, 0x7c, 0x13, 0x1f, 0xfd, 0xd9, 0x60, 0x83, 0x7e, 0xda, 0x64, 0x1c, 0xdc, 0x9f, - /* (2^118)P */ 0xad, 0xef, 0xac, 0x1b, 0xc1, 0x30, 0x5a, 0x15, 0xc9, 0x1f, 0xac, 0xf1, 0xca, 0x44, 0x95, 0x95, 0xea, 0xf2, 0x22, 0xe7, 0x8d, 0x25, 0xf0, 0xff, 0xd8, 0x71, 0xf7, 0xf8, 0x8f, 0x8f, 0xcd, 0xf4, 0x1e, 0xfe, 0x6c, 0x68, 0x04, 0xb8, 0x78, 0xa1, 0x5f, 0xa6, 0x5d, 0x5e, 0xf9, 0x8d, 0xea, 0x80, 0xcb, 0xf3, 0x17, 0xa6, 0x03, 0xc9, 0x38, 0xd5, - /* (2^119)P */ 0x79, 0x14, 0x31, 0xc3, 0x38, 0xe5, 0xaa, 0xbf, 0x17, 0xa3, 0x04, 0x4e, 0x80, 0x59, 0x9c, 0x9f, 0x19, 0x39, 0xe4, 0x2d, 0x23, 0x54, 0x4a, 0x7f, 0x3e, 0xf3, 0xd9, 0xc7, 0xba, 0x6c, 0x8f, 0x6b, 0xfa, 0x34, 0xb5, 0x23, 0x17, 0x1d, 0xff, 0x1d, 0xea, 0x1f, 0xd7, 0xba, 0x61, 0xb2, 0xe0, 0x38, 0x6a, 0xe9, 0xcf, 0x48, 0x5d, 0x6a, 0x10, 0x9c, - /* (2^120)P */ 0xc8, 0xbb, 0x13, 0x1c, 0x3f, 0x3c, 0x34, 0xfd, 0xac, 0x37, 0x52, 0x44, 0x25, 0xa8, 0xde, 0x1d, 0x63, 0xf4, 0x81, 0x9a, 0xbe, 0x0b, 0x74, 0x2e, 0xc8, 0x51, 0x16, 0xd3, 0xac, 0x4a, 0xaf, 0xe2, 0x5f, 0x3a, 0x89, 0x32, 0xd1, 0x9b, 0x7c, 0x90, 0x0d, 0xac, 0xdc, 0x8b, 0x73, 0x45, 0x45, 0x97, 0xb1, 0x90, 0x2c, 0x1b, 0x31, 0xca, 0xb1, 0x94, - /* (2^121)P */ 0x07, 0x28, 0xdd, 0x10, 0x14, 0xa5, 0x95, 0x7e, 0xf3, 0xe4, 0xd4, 0x14, 0xb4, 0x7e, 0x76, 0xdb, 0x42, 0xd6, 0x94, 0x3e, 0xeb, 0x44, 0x64, 0x88, 0x0d, 0xec, 0xc1, 0x21, 0xf0, 0x79, 0xe0, 0x83, 0x67, 0x55, 0x53, 0xc2, 0xf6, 0xc5, 0xc5, 0x89, 0x39, 0xe8, 0x42, 0xd0, 0x17, 0xbd, 0xff, 0x35, 0x59, 0x0e, 0xc3, 0x06, 0x86, 0xd4, 0x64, 0xcf, - /* (2^122)P */ 0x91, 0xa8, 0xdb, 0x57, 0x9b, 0xe2, 0x96, 0x31, 0x10, 0x6e, 0xd7, 0x9a, 0x97, 0xb3, 0xab, 0xb5, 0x15, 0x66, 0xbe, 0xcc, 0x6d, 0x9a, 0xac, 0x06, 0xb3, 0x0d, 0xaa, 0x4b, 0x9c, 0x96, 0x79, 0x6c, 0x34, 0xee, 0x9e, 0x53, 0x4d, 0x6e, 0xbd, 0x88, 0x02, 0xbf, 0x50, 0x54, 0x12, 0x5d, 0x01, 0x02, 0x46, 0xc6, 0x74, 0x02, 0x8c, 0x24, 0xae, 0xb1, - /* (2^123)P */ 0xf5, 0x22, 0xea, 0xac, 0x7d, 0x9c, 0x33, 0x8a, 0xa5, 0x36, 0x79, 0x6a, 0x4f, 0xa4, 0xdc, 0xa5, 0x73, 0x64, 0xc4, 0x6f, 0x43, 0x02, 0x3b, 0x94, 0x66, 0xd2, 0x4b, 0x4f, 0xf6, 0x45, 0x33, 0x5d, 0x10, 0x33, 0x18, 0x1e, 0xa3, 0xfc, 0xf7, 0xd2, 0xb8, 0xc8, 0xa7, 0xe0, 0x76, 0x8a, 0xcd, 0xff, 0x4f, 0x99, 0x34, 0x47, 0x84, 0x91, 0x96, 0x9f, - /* (2^124)P */ 0x8a, 0x48, 0x3b, 0x48, 0x4a, 0xbc, 0xac, 0xe2, 0x80, 0xd6, 0xd2, 0x35, 0xde, 0xd0, 0x56, 0x42, 0x33, 0xb3, 0x56, 0x5a, 0xcd, 0xb8, 0x3d, 0xb5, 0x25, 0xc1, 0xed, 0xff, 0x87, 0x0b, 0x79, 0xff, 0xf2, 0x62, 0xe1, 0x76, 0xc6, 0xa2, 0x0f, 0xa8, 0x9b, 0x0d, 0xcc, 0x3f, 0x3d, 0x35, 0x27, 0x8d, 0x0b, 0x74, 0xb0, 0xc3, 0x78, 0x8c, 0xcc, 0xc8, - /* (2^125)P */ 0xfc, 0x9a, 0x0c, 0xa8, 0x49, 0x42, 0xb8, 0xdf, 0xcf, 0xb3, 0x19, 0xa6, 0x64, 0x57, 0xfe, 0xe8, 0xf8, 0xa6, 0x4b, 0x86, 0xa1, 0xd5, 0x83, 0x7f, 0x14, 0x99, 0x18, 0x0c, 0x7d, 0x5b, 0xf7, 0x3d, 0xf9, 0x4b, 0x79, 0xb1, 0x86, 0x30, 0xb4, 0x5e, 0x6a, 0xe8, 0x9d, 0xfa, 0x8a, 0x41, 0xc4, 0x30, 0xfc, 0x56, 0x74, 0x14, 0x42, 0xc8, 0x96, 0x0e, - /* (2^126)P */ 0xdf, 0x66, 0xec, 0xbc, 0x44, 0xdb, 0x19, 0xce, 0xd4, 0xb5, 0x49, 0x40, 0x07, 0x49, 0xe0, 0x3a, 0x61, 0x10, 0xfb, 0x7d, 0xba, 0xb1, 0xe0, 0x28, 0x5b, 0x99, 0x59, 0x96, 0xa2, 0xee, 0xe0, 0x23, 0x37, 0x39, 0x1f, 0xe6, 0x57, 0x9f, 0xf8, 0xf8, 0xdc, 0x74, 0xf6, 0x8f, 0x4f, 0x5e, 0x51, 0xa4, 0x12, 0xac, 0xbe, 0xe4, 0xf3, 0xd1, 0xf0, 0x24, - /* (2^127)P */ 0x1e, 0x3e, 0x9a, 0x5f, 0xdf, 0x9f, 0xd6, 0x4e, 0x8a, 0x28, 0xc3, 0xcd, 0x96, 0x9d, 0x57, 0xc7, 0x61, 0x81, 0x90, 0xff, 0xae, 0xb1, 0x4f, 0xc2, 0x96, 0x8b, 0x1a, 0x18, 0xf4, 0x50, 0xcb, 0x31, 0xe1, 0x57, 0xf4, 0x90, 0xa8, 0xea, 0xac, 0xe7, 0x61, 0x98, 0xb6, 0x15, 0xc1, 0x7b, 0x29, 0xa4, 0xc3, 0x18, 0xef, 0xb9, 0xd8, 0xdf, 0xf6, 0xac, - /* (2^128)P */ 0xca, 0xa8, 0x6c, 0xf1, 0xb4, 0xca, 0xfe, 0x31, 0xee, 0x48, 0x38, 0x8b, 0x0e, 0xbb, 0x7a, 0x30, 0xaa, 0xf9, 0xee, 0x27, 0x53, 0x24, 0xdc, 0x2e, 0x15, 0xa6, 0x48, 0x8f, 0xa0, 0x7e, 0xf1, 0xdc, 0x93, 0x87, 0x39, 0xeb, 0x7f, 0x38, 0x92, 0x92, 0x4c, 0x29, 0xe9, 0x57, 0xd8, 0x59, 0xfc, 0xe9, 0x9c, 0x44, 0xc0, 0x65, 0xcf, 0xac, 0x4b, 0xdc, - /* (2^129)P */ 0xa3, 0xd0, 0x37, 0x8f, 0x86, 0x2f, 0xc6, 0x47, 0x55, 0x46, 0x65, 0x26, 0x4b, 0x91, 0xe2, 0x18, 0x5c, 0x4f, 0x23, 0xc1, 0x37, 0x29, 0xb9, 0xc1, 0x27, 0xc5, 0x3c, 0xbf, 0x7e, 0x23, 0xdb, 0x73, 0x99, 0xbd, 0x1b, 0xb2, 0x31, 0x68, 0x3a, 0xad, 0xb7, 0xb0, 0x10, 0xc5, 0xe5, 0x11, 0x51, 0xba, 0xa7, 0x60, 0x66, 0x54, 0xf0, 0x08, 0xd7, 0x69, - /* (2^130)P */ 0x89, 0x41, 0x79, 0xcc, 0xeb, 0x0a, 0xf5, 0x4b, 0xa3, 0x4c, 0xce, 0x52, 0xb0, 0xa7, 0xe4, 0x41, 0x75, 0x7d, 0x04, 0xbb, 0x09, 0x4c, 0x50, 0x9f, 0xdf, 0xea, 0x74, 0x61, 0x02, 0xad, 0xb4, 0x9d, 0xb7, 0x05, 0xb9, 0xea, 0xeb, 0x91, 0x35, 0xe7, 0x49, 0xea, 0xd3, 0x4f, 0x3c, 0x60, 0x21, 0x7a, 0xde, 0xc7, 0xe2, 0x5a, 0xee, 0x8e, 0x93, 0xc7, - /* (2^131)P */ 0x00, 0xe8, 0xed, 0xd0, 0xb3, 0x0d, 0xaf, 0xb2, 0xde, 0x2c, 0xf6, 0x00, 0xe2, 0xea, 0x6d, 0xf8, 0x0e, 0xd9, 0x67, 0x59, 0xa9, 0x50, 0xbb, 0x17, 0x8f, 0xff, 0xb1, 0x9f, 0x17, 0xb6, 0xf2, 0xb5, 0xba, 0x80, 0xf7, 0x0f, 0xba, 0xd5, 0x09, 0x43, 0xaa, 0x4e, 0x3a, 0x67, 0x6a, 0x89, 0x9b, 0x18, 0x65, 0x35, 0xf8, 0x3a, 0x49, 0x91, 0x30, 0x51, - /* (2^132)P */ 0x8d, 0x25, 0xe9, 0x0e, 0x7d, 0x50, 0x76, 0xe4, 0x58, 0x7e, 0xb9, 0x33, 0xe6, 0x65, 0x90, 0xc2, 0x50, 0x9d, 0x50, 0x2e, 0x11, 0xad, 0xd5, 0x43, 0x52, 0x32, 0x41, 0x4f, 0x7b, 0xb6, 0xa0, 0xec, 0x81, 0x75, 0x36, 0x7c, 0x77, 0x85, 0x59, 0x70, 0xe4, 0xf9, 0xef, 0x66, 0x8d, 0x35, 0xc8, 0x2a, 0x6e, 0x5b, 0xc6, 0x0d, 0x0b, 0x29, 0x60, 0x68, - /* (2^133)P */ 0xf8, 0xce, 0xb0, 0x3a, 0x56, 0x7d, 0x51, 0x9a, 0x25, 0x73, 0xea, 0xdd, 0xe4, 0xe0, 0x0e, 0xf0, 0x07, 0xc0, 0x31, 0x00, 0x73, 0x35, 0xd0, 0x39, 0xc4, 0x9b, 0xb7, 0x95, 0xe0, 0x62, 0x70, 0x36, 0x0b, 0xcb, 0xa0, 0x42, 0xde, 0x51, 0xcf, 0x41, 0xe0, 0xb8, 0xb4, 0xc0, 0xe5, 0x46, 0x99, 0x9f, 0x02, 0x7f, 0x14, 0x8c, 0xc1, 0x4e, 0xef, 0xe8, - /* (2^134)P */ 0x10, 0x01, 0x57, 0x0a, 0xbe, 0x8b, 0x18, 0xc8, 0xca, 0x00, 0x28, 0x77, 0x4a, 0x9a, 0xc7, 0x55, 0x2a, 0xcc, 0x0c, 0x7b, 0xb9, 0xe9, 0xc8, 0x97, 0x7c, 0x02, 0xe3, 0x09, 0x2f, 0x62, 0x30, 0xb8, 0x40, 0x09, 0x65, 0xe9, 0x55, 0x63, 0xb5, 0x07, 0xca, 0x9f, 0x00, 0xdf, 0x9d, 0x5c, 0xc7, 0xee, 0x57, 0xa5, 0x90, 0x15, 0x1e, 0x22, 0xa0, 0x12, - /* (2^135)P */ 0x71, 0x2d, 0xc9, 0xef, 0x27, 0xb9, 0xd8, 0x12, 0x43, 0x6b, 0xa8, 0xce, 0x3b, 0x6d, 0x6e, 0x91, 0x43, 0x23, 0xbc, 0x32, 0xb3, 0xbf, 0xe1, 0xc7, 0x39, 0xcf, 0x7c, 0x42, 0x4c, 0xb1, 0x30, 0xe2, 0xdd, 0x69, 0x06, 0xe5, 0xea, 0xf0, 0x2a, 0x16, 0x50, 0x71, 0xca, 0x92, 0xdf, 0xc1, 0xcc, 0xec, 0xe6, 0x54, 0x07, 0xf3, 0x18, 0x8d, 0xd8, 0x29, - /* (2^136)P */ 0x98, 0x51, 0x48, 0x8f, 0xfa, 0x2e, 0x5e, 0x67, 0xb0, 0xc6, 0x17, 0x12, 0xb6, 0x7d, 0xc9, 0xad, 0x81, 0x11, 0xad, 0x0c, 0x1c, 0x2d, 0x45, 0xdf, 0xac, 0x66, 0xbd, 0x08, 0x6f, 0x7c, 0xc7, 0x06, 0x6e, 0x19, 0x08, 0x39, 0x64, 0xd7, 0xe4, 0xd1, 0x11, 0x5f, 0x1c, 0xf4, 0x67, 0xc3, 0x88, 0x6a, 0xe6, 0x07, 0xa3, 0x83, 0xd7, 0xfd, 0x2a, 0xf9, - /* (2^137)P */ 0x87, 0xed, 0xeb, 0xd9, 0xdf, 0xff, 0x43, 0x8b, 0xaa, 0x20, 0x58, 0xb0, 0xb4, 0x6b, 0x14, 0xb8, 0x02, 0xc5, 0x40, 0x20, 0x22, 0xbb, 0xf7, 0xb4, 0xf3, 0x05, 0x1e, 0x4d, 0x94, 0xff, 0xe3, 0xc5, 0x22, 0x82, 0xfe, 0xaf, 0x90, 0x42, 0x98, 0x6b, 0x76, 0x8b, 0x3e, 0x89, 0x3f, 0x42, 0x2a, 0xa7, 0x26, 0x00, 0xda, 0x5c, 0xa2, 0x2b, 0xec, 0xdd, - /* (2^138)P */ 0x5c, 0x21, 0x16, 0x0d, 0x46, 0xb8, 0xd0, 0xa7, 0x88, 0xe7, 0x25, 0xcb, 0x3e, 0x50, 0x73, 0x61, 0xe7, 0xaf, 0x5a, 0x3f, 0x47, 0x8b, 0x3d, 0x97, 0x79, 0x2c, 0xe6, 0x6d, 0x95, 0x74, 0x65, 0x70, 0x36, 0xfd, 0xd1, 0x9e, 0x13, 0x18, 0x63, 0xb1, 0x2d, 0x0b, 0xb5, 0x36, 0x3e, 0xe7, 0x35, 0x42, 0x3b, 0xe6, 0x1f, 0x4d, 0x9d, 0x59, 0xa2, 0x43, - /* (2^139)P */ 0x8c, 0x0c, 0x7c, 0x24, 0x9e, 0xe0, 0xf8, 0x05, 0x1c, 0x9e, 0x1f, 0x31, 0xc0, 0x70, 0xb3, 0xfb, 0x4e, 0xf8, 0x0a, 0x57, 0xb7, 0x49, 0xb5, 0x73, 0xa1, 0x5f, 0x9b, 0x6a, 0x07, 0x6c, 0x87, 0x71, 0x87, 0xd4, 0xbe, 0x98, 0x1e, 0x98, 0xee, 0x52, 0xc1, 0x7b, 0x95, 0x0f, 0x28, 0x32, 0x36, 0x28, 0xd0, 0x3a, 0x0f, 0x7d, 0x2a, 0xa9, 0x62, 0xb9, - /* (2^140)P */ 0x97, 0xe6, 0x18, 0x77, 0xf9, 0x34, 0xac, 0xbc, 0xe0, 0x62, 0x9f, 0x42, 0xde, 0xbd, 0x2f, 0xf7, 0x1f, 0xb7, 0x14, 0x52, 0x8a, 0x79, 0xb2, 0x3f, 0xd2, 0x95, 0x71, 0x01, 0xe8, 0xaf, 0x8c, 0xa4, 0xa4, 0xa7, 0x27, 0xf3, 0x5c, 0xdf, 0x3e, 0x57, 0x7a, 0xf1, 0x76, 0x49, 0xe6, 0x42, 0x3f, 0x8f, 0x1e, 0x63, 0x4a, 0x65, 0xb5, 0x41, 0xf5, 0x02, - /* (2^141)P */ 0x72, 0x85, 0xc5, 0x0b, 0xe1, 0x47, 0x64, 0x02, 0xc5, 0x4d, 0x81, 0x69, 0xb2, 0xcf, 0x0f, 0x6c, 0xd4, 0x6d, 0xd0, 0xc7, 0xb4, 0x1c, 0xd0, 0x32, 0x59, 0x89, 0xe2, 0xe0, 0x96, 0x8b, 0x12, 0x98, 0xbf, 0x63, 0x7a, 0x4c, 0x76, 0x7e, 0x58, 0x17, 0x8f, 0x5b, 0x0a, 0x59, 0x65, 0x75, 0xbc, 0x61, 0x1f, 0xbe, 0xc5, 0x6e, 0x0a, 0x57, 0x52, 0x70, - /* (2^142)P */ 0x92, 0x1c, 0x77, 0xbb, 0x62, 0x02, 0x6c, 0x25, 0x9c, 0x66, 0x07, 0x83, 0xab, 0xcc, 0x80, 0x5d, 0xd2, 0x76, 0x0c, 0xa4, 0xc5, 0xb4, 0x8a, 0x68, 0x23, 0x31, 0x32, 0x29, 0x8a, 0x47, 0x92, 0x12, 0x80, 0xb3, 0xfa, 0x18, 0xe4, 0x8d, 0xc0, 0x4d, 0xfe, 0x97, 0x5f, 0x72, 0x41, 0xb5, 0x5c, 0x7a, 0xbd, 0xf0, 0xcf, 0x5e, 0x97, 0xaa, 0x64, 0x32, - /* (2^143)P */ 0x35, 0x3f, 0x75, 0xc1, 0x7a, 0x75, 0x7e, 0xa9, 0xc6, 0x0b, 0x4e, 0x32, 0x62, 0xec, 0xe3, 0x5c, 0xfb, 0x01, 0x43, 0xb6, 0xd4, 0x5b, 0x75, 0xd2, 0xee, 0x7f, 0x5d, 0x23, 0x2b, 0xb3, 0x54, 0x34, 0x4c, 0xd3, 0xb4, 0x32, 0x84, 0x81, 0xb5, 0x09, 0x76, 0x19, 0xda, 0x58, 0xda, 0x7c, 0xdb, 0x2e, 0xdd, 0x4c, 0x8e, 0xdd, 0x5d, 0x89, 0x10, 0x10, - /* (2^144)P */ 0x57, 0x25, 0x6a, 0x08, 0x37, 0x92, 0xa8, 0xdf, 0x24, 0xef, 0x8f, 0x33, 0x34, 0x52, 0xa4, 0x4c, 0xf0, 0x77, 0x9f, 0x69, 0x77, 0xd5, 0x8f, 0xd2, 0x9a, 0xb3, 0xb6, 0x1d, 0x2d, 0xa6, 0xf7, 0x1f, 0xda, 0xd7, 0xcb, 0x75, 0x11, 0xc3, 0x6b, 0xc0, 0x38, 0xb1, 0xd5, 0x2d, 0x96, 0x84, 0x16, 0xfa, 0x26, 0xb9, 0xcc, 0x3f, 0x16, 0x47, 0x23, 0x74, - /* (2^145)P */ 0x9b, 0x61, 0x2a, 0x1c, 0xdd, 0x39, 0xa5, 0xfa, 0x1c, 0x7d, 0x63, 0x50, 0xca, 0xe6, 0x9d, 0xfa, 0xb7, 0xc4, 0x4c, 0x6a, 0x97, 0x5f, 0x36, 0x4e, 0x47, 0xdd, 0x17, 0xf7, 0xf9, 0x19, 0xce, 0x75, 0x17, 0xad, 0xce, 0x2a, 0xf3, 0xfe, 0x27, 0x8f, 0x3e, 0x48, 0xc0, 0x60, 0x87, 0x24, 0x19, 0xae, 0x59, 0xe4, 0x5a, 0x00, 0x2a, 0xba, 0xa2, 0x1f, - /* (2^146)P */ 0x26, 0x88, 0x42, 0x60, 0x9f, 0x6e, 0x2c, 0x7c, 0x39, 0x0f, 0x47, 0x6a, 0x0e, 0x02, 0xbb, 0x4b, 0x34, 0x29, 0x55, 0x18, 0x36, 0xcf, 0x3b, 0x47, 0xf1, 0x2e, 0xfc, 0x6e, 0x94, 0xff, 0xe8, 0x6b, 0x06, 0xd2, 0xba, 0x77, 0x5e, 0x60, 0xd7, 0x19, 0xef, 0x02, 0x9d, 0x3a, 0xc2, 0xb7, 0xa9, 0xd8, 0x57, 0xee, 0x7e, 0x2b, 0xf2, 0x6d, 0x28, 0xda, - /* (2^147)P */ 0xdf, 0xd9, 0x92, 0x11, 0x98, 0x23, 0xe2, 0x45, 0x2f, 0x74, 0x70, 0xee, 0x0e, 0x55, 0x65, 0x79, 0x86, 0x38, 0x17, 0x92, 0x85, 0x87, 0x99, 0x50, 0xd9, 0x7c, 0xdb, 0xa1, 0x10, 0xec, 0x30, 0xb7, 0x40, 0xa3, 0x23, 0x9b, 0x0e, 0x27, 0x49, 0x29, 0x03, 0x94, 0xff, 0x53, 0xdc, 0xd7, 0xed, 0x49, 0xa9, 0x5a, 0x3b, 0xee, 0xd7, 0xc7, 0x65, 0xaf, - /* (2^148)P */ 0xa0, 0xbd, 0xbe, 0x03, 0xee, 0x0c, 0xbe, 0x32, 0x00, 0x7b, 0x52, 0xcb, 0x92, 0x29, 0xbf, 0xa0, 0xc6, 0xd9, 0xd2, 0xd6, 0x15, 0xe8, 0x3a, 0x75, 0x61, 0x65, 0x56, 0xae, 0xad, 0x3c, 0x2a, 0x64, 0x14, 0x3f, 0x8e, 0xc1, 0x2d, 0x0c, 0x8d, 0x20, 0xdb, 0x58, 0x4b, 0xe5, 0x40, 0x15, 0x4b, 0xdc, 0xa8, 0xbd, 0xef, 0x08, 0xa7, 0xd1, 0xf4, 0xb0, - /* (2^149)P */ 0xa9, 0x0f, 0x05, 0x94, 0x66, 0xac, 0x1f, 0x65, 0x3f, 0xe1, 0xb8, 0xe1, 0x34, 0x5e, 0x1d, 0x8f, 0xe3, 0x93, 0x03, 0x15, 0xff, 0xb6, 0x65, 0xb6, 0x6e, 0xc0, 0x2f, 0xd4, 0x2e, 0xb9, 0x2c, 0x13, 0x3c, 0x99, 0x1c, 0xb5, 0x87, 0xba, 0x79, 0xcb, 0xf0, 0x18, 0x06, 0x86, 0x04, 0x14, 0x25, 0x09, 0xcd, 0x1c, 0x14, 0xda, 0x35, 0xd0, 0x38, 0x3b, - /* (2^150)P */ 0x1b, 0x04, 0xa3, 0x27, 0xb4, 0xd3, 0x37, 0x48, 0x1e, 0x8f, 0x69, 0xd3, 0x5a, 0x2f, 0x20, 0x02, 0x36, 0xbe, 0x06, 0x7b, 0x6b, 0x6c, 0x12, 0x5b, 0x80, 0x74, 0x44, 0xe6, 0xf8, 0xf5, 0x95, 0x59, 0x29, 0xab, 0x51, 0x47, 0x83, 0x28, 0xe0, 0xad, 0xde, 0xaa, 0xd3, 0xb1, 0x1a, 0xcb, 0xa3, 0xcd, 0x8b, 0x6a, 0xb1, 0xa7, 0x0a, 0xd1, 0xf9, 0xbe, - /* (2^151)P */ 0xce, 0x2f, 0x85, 0xca, 0x74, 0x6d, 0x49, 0xb8, 0xce, 0x80, 0x44, 0xe0, 0xda, 0x5b, 0xcf, 0x2f, 0x79, 0x74, 0xfe, 0xb4, 0x2c, 0x99, 0x20, 0x6e, 0x09, 0x04, 0xfb, 0x6d, 0x57, 0x5b, 0x95, 0x0c, 0x45, 0xda, 0x4f, 0x7f, 0x63, 0xcc, 0x85, 0x5a, 0x67, 0x50, 0x68, 0x71, 0xb4, 0x67, 0xb1, 0x2e, 0xc1, 0x1c, 0xdc, 0xff, 0x2a, 0x7c, 0x10, 0x5e, - /* (2^152)P */ 0xa6, 0xde, 0xf3, 0xd4, 0x22, 0x30, 0x24, 0x9e, 0x0b, 0x30, 0x54, 0x59, 0x7e, 0xa2, 0xeb, 0x89, 0x54, 0x65, 0x3e, 0x40, 0xd1, 0xde, 0xe6, 0xee, 0x4d, 0xbf, 0x5e, 0x40, 0x1d, 0xee, 0x4f, 0x68, 0xd9, 0xa7, 0x2f, 0xb3, 0x64, 0xb3, 0xf5, 0xc8, 0xd3, 0xaa, 0x70, 0x70, 0x3d, 0xef, 0xd3, 0x95, 0x54, 0xdb, 0x3e, 0x94, 0x95, 0x92, 0x1f, 0x45, - /* (2^153)P */ 0x22, 0x80, 0x1d, 0x9d, 0x96, 0xa5, 0x78, 0x6f, 0xe0, 0x1e, 0x1b, 0x66, 0x42, 0xc8, 0xae, 0x9e, 0x46, 0x45, 0x08, 0x41, 0xdf, 0x80, 0xae, 0x6f, 0xdb, 0x15, 0x5a, 0x21, 0x31, 0x7a, 0xd0, 0xf2, 0x54, 0x15, 0x88, 0xd3, 0x0f, 0x7f, 0x14, 0x5a, 0x14, 0x97, 0xab, 0xf4, 0x58, 0x6a, 0x9f, 0xea, 0x74, 0xe5, 0x6b, 0x90, 0x59, 0x2b, 0x48, 0xd9, - /* (2^154)P */ 0x12, 0x24, 0x04, 0xf5, 0x50, 0xc2, 0x8c, 0xb0, 0x7c, 0x46, 0x98, 0xd5, 0x24, 0xad, 0xf6, 0x72, 0xdc, 0x82, 0x1a, 0x60, 0xc1, 0xeb, 0x48, 0xef, 0x7f, 0x6e, 0xe6, 0xcc, 0xdb, 0x7b, 0xae, 0xbe, 0x5e, 0x1e, 0x5c, 0xe6, 0x0a, 0x70, 0xdf, 0xa4, 0xa3, 0x85, 0x1b, 0x1b, 0x7f, 0x72, 0xb9, 0x96, 0x6f, 0xdc, 0x03, 0x76, 0x66, 0xfb, 0xa0, 0x33, - /* (2^155)P */ 0x37, 0x40, 0xbb, 0xbc, 0x68, 0x58, 0x86, 0xca, 0xbb, 0xa5, 0x24, 0x76, 0x3d, 0x48, 0xd1, 0xad, 0xb4, 0xa8, 0xcf, 0xc3, 0xb6, 0xa8, 0xba, 0x1a, 0x3a, 0xbe, 0x33, 0x75, 0x04, 0x5c, 0x13, 0x8c, 0x0d, 0x70, 0x8d, 0xa6, 0x4e, 0x2a, 0xeb, 0x17, 0x3c, 0x22, 0xdd, 0x3e, 0x96, 0x40, 0x11, 0x9e, 0x4e, 0xae, 0x3d, 0xf8, 0x91, 0xd7, 0x50, 0xc8, - /* (2^156)P */ 0xd8, 0xca, 0xde, 0x19, 0xcf, 0x00, 0xe4, 0x73, 0x18, 0x7f, 0x9b, 0x9f, 0xf4, 0x5b, 0x49, 0x49, 0x99, 0xdc, 0xa4, 0x46, 0x21, 0xb5, 0xd7, 0x3e, 0xb7, 0x47, 0x1b, 0xa9, 0x9f, 0x4c, 0x69, 0x7d, 0xec, 0x33, 0xd6, 0x1c, 0x51, 0x7f, 0x47, 0x74, 0x7a, 0x6c, 0xf3, 0xd2, 0x2e, 0xbf, 0xdf, 0x6c, 0x9e, 0x77, 0x3b, 0x34, 0xf6, 0x73, 0x80, 0xed, - /* (2^157)P */ 0x16, 0xfb, 0x16, 0xc3, 0xc2, 0x83, 0xe4, 0xf4, 0x03, 0x7f, 0x52, 0xb0, 0x67, 0x51, 0x7b, 0x24, 0x5a, 0x51, 0xd3, 0xb6, 0x4e, 0x59, 0x76, 0xcd, 0x08, 0x7b, 0x1d, 0x7a, 0x9c, 0x65, 0xae, 0xce, 0xaa, 0xd2, 0x1c, 0x85, 0x66, 0x68, 0x06, 0x15, 0xa8, 0x06, 0xe6, 0x16, 0x37, 0xf4, 0x49, 0x9e, 0x0f, 0x50, 0x37, 0xb1, 0xb2, 0x93, 0x70, 0x43, - /* (2^158)P */ 0x18, 0x3a, 0x16, 0xe5, 0x8d, 0xc8, 0x35, 0xd6, 0x7b, 0x09, 0xec, 0x61, 0x5f, 0x5c, 0x2a, 0x19, 0x96, 0x2e, 0xc3, 0xfd, 0xab, 0xe6, 0x23, 0xae, 0xab, 0xc5, 0xcb, 0xb9, 0x7b, 0x2d, 0x34, 0x51, 0xb9, 0x41, 0x9e, 0x7d, 0xca, 0xda, 0x25, 0x45, 0x14, 0xb0, 0xc7, 0x4d, 0x26, 0x2b, 0xfe, 0x43, 0xb0, 0x21, 0x5e, 0xfa, 0xdc, 0x7c, 0xf9, 0x5a, - /* (2^159)P */ 0x94, 0xad, 0x42, 0x17, 0xf5, 0xcd, 0x1c, 0x0d, 0xf6, 0x41, 0xd2, 0x55, 0xbb, 0x50, 0xf1, 0xc6, 0xbc, 0xa6, 0xc5, 0x3a, 0xfd, 0x9b, 0x75, 0x3e, 0xf6, 0x1a, 0xa7, 0xb2, 0x6e, 0x64, 0x12, 0xdc, 0x3c, 0xe5, 0xf6, 0xfc, 0x3b, 0xfa, 0x43, 0x81, 0xd4, 0xa5, 0xee, 0xf5, 0x9c, 0x47, 0x2f, 0xd0, 0x9c, 0xde, 0xa1, 0x48, 0x91, 0x9a, 0x34, 0xc1, - /* (2^160)P */ 0x37, 0x1b, 0xb3, 0x88, 0xc9, 0x98, 0x4e, 0xfb, 0x84, 0x4f, 0x2b, 0x0a, 0xb6, 0x8f, 0x35, 0x15, 0xcd, 0x61, 0x7a, 0x5f, 0x5c, 0xa0, 0xca, 0x23, 0xa0, 0x93, 0x1f, 0xcc, 0x3c, 0x39, 0x3a, 0x24, 0xa7, 0x49, 0xad, 0x8d, 0x59, 0xcc, 0x94, 0x5a, 0x16, 0xf5, 0x70, 0xe8, 0x52, 0x1e, 0xee, 0x20, 0x30, 0x17, 0x7e, 0xf0, 0x4c, 0x93, 0x06, 0x5a, - /* (2^161)P */ 0x81, 0xba, 0x3b, 0xd7, 0x3e, 0xb4, 0x32, 0x3a, 0x22, 0x39, 0x2a, 0xfc, 0x19, 0xd9, 0xd2, 0xf6, 0xc5, 0x79, 0x6c, 0x0e, 0xde, 0xda, 0x01, 0xff, 0x52, 0xfb, 0xb6, 0x95, 0x4e, 0x7a, 0x10, 0xb8, 0x06, 0x86, 0x3c, 0xcd, 0x56, 0xd6, 0x15, 0xbf, 0x6e, 0x3e, 0x4f, 0x35, 0x5e, 0xca, 0xbc, 0xa5, 0x95, 0xa2, 0xdf, 0x2d, 0x1d, 0xaf, 0x59, 0xf9, - /* (2^162)P */ 0x69, 0xe5, 0xe2, 0xfa, 0xc9, 0x7f, 0xdd, 0x09, 0xf5, 0x6b, 0x4e, 0x2e, 0xbe, 0xb4, 0xbf, 0x3e, 0xb2, 0xf2, 0x81, 0x30, 0xe1, 0x07, 0xa8, 0x0d, 0x2b, 0xd2, 0x5a, 0x55, 0xbe, 0x4b, 0x86, 0x5d, 0xb0, 0x5e, 0x7c, 0x8f, 0xc1, 0x3c, 0x81, 0x4c, 0xf7, 0x6d, 0x7d, 0xe6, 0x4f, 0x8a, 0x85, 0xc2, 0x2f, 0x28, 0xef, 0x8c, 0x69, 0xc2, 0xc2, 0x1a, - /* (2^163)P */ 0xd9, 0xe4, 0x0e, 0x1e, 0xc2, 0xf7, 0x2f, 0x9f, 0xa1, 0x40, 0xfe, 0x46, 0x16, 0xaf, 0x2e, 0xd1, 0xec, 0x15, 0x9b, 0x61, 0x92, 0xce, 0xfc, 0x10, 0x43, 0x1d, 0x00, 0xf6, 0xbe, 0x20, 0x80, 0x80, 0x6f, 0x3c, 0x16, 0x94, 0x59, 0xba, 0x03, 0x53, 0x6e, 0xb6, 0xdd, 0x25, 0x7b, 0x86, 0xbf, 0x96, 0xf4, 0x2f, 0xa1, 0x96, 0x8d, 0xf9, 0xb3, 0x29, - /* (2^164)P */ 0x3b, 0x04, 0x60, 0x6e, 0xce, 0xab, 0xd2, 0x63, 0x18, 0x53, 0x88, 0x16, 0x4a, 0x6a, 0xab, 0x72, 0x03, 0x68, 0xa5, 0xd4, 0x0d, 0xb2, 0x82, 0x81, 0x1f, 0x2b, 0x5c, 0x75, 0xe8, 0xd2, 0x1d, 0x7f, 0xe7, 0x1b, 0x35, 0x02, 0xde, 0xec, 0xbd, 0xcb, 0xc7, 0x01, 0xd3, 0x95, 0x61, 0xfe, 0xb2, 0x7a, 0x66, 0x09, 0x4c, 0x6d, 0xfd, 0x39, 0xf7, 0x52, - /* (2^165)P */ 0x42, 0xc1, 0x5f, 0xf8, 0x35, 0x52, 0xc1, 0xfe, 0xc5, 0x11, 0x80, 0x1c, 0x11, 0x46, 0x31, 0x11, 0xbe, 0xd0, 0xc4, 0xb6, 0x07, 0x13, 0x38, 0xa0, 0x8d, 0x65, 0xf0, 0x56, 0x9e, 0x16, 0xbf, 0x9d, 0xcd, 0x51, 0x34, 0xf9, 0x08, 0x48, 0x7b, 0x76, 0x0c, 0x7b, 0x30, 0x07, 0xa8, 0x76, 0xaf, 0xa3, 0x29, 0x38, 0xb0, 0x58, 0xde, 0x72, 0x4b, 0x45, - /* (2^166)P */ 0xd4, 0x16, 0xa7, 0xc0, 0xb4, 0x9f, 0xdf, 0x1a, 0x37, 0xc8, 0x35, 0xed, 0xc5, 0x85, 0x74, 0x64, 0x09, 0x22, 0xef, 0xe9, 0x0c, 0xaf, 0x12, 0x4c, 0x9e, 0xf8, 0x47, 0x56, 0xe0, 0x7f, 0x4e, 0x24, 0x6b, 0x0c, 0xe7, 0xad, 0xc6, 0x47, 0x1d, 0xa4, 0x0d, 0x86, 0x89, 0x65, 0xe8, 0x5f, 0x71, 0xc7, 0xe9, 0xcd, 0xec, 0x6c, 0x62, 0xc7, 0xe3, 0xb3, - /* (2^167)P */ 0xb5, 0xea, 0x86, 0xe3, 0x15, 0x18, 0x3f, 0x6d, 0x7b, 0x05, 0x95, 0x15, 0x53, 0x26, 0x1c, 0xeb, 0xbe, 0x7e, 0x16, 0x42, 0x4b, 0xa2, 0x3d, 0xdd, 0x0e, 0xff, 0xba, 0x67, 0xb5, 0xae, 0x7a, 0x17, 0xde, 0x23, 0xad, 0x14, 0xcc, 0xd7, 0xaf, 0x57, 0x01, 0xe0, 0xdd, 0x48, 0xdd, 0xd7, 0xe3, 0xdf, 0xe9, 0x2d, 0xda, 0x67, 0xa4, 0x9f, 0x29, 0x04, - /* (2^168)P */ 0x16, 0x53, 0xe6, 0x9c, 0x4e, 0xe5, 0x1e, 0x70, 0x81, 0x25, 0x02, 0x9b, 0x47, 0x6d, 0xd2, 0x08, 0x73, 0xbe, 0x0a, 0xf1, 0x7b, 0xeb, 0x24, 0xeb, 0x38, 0x23, 0x5c, 0xb6, 0x3e, 0xce, 0x1e, 0xe3, 0xbc, 0x82, 0x35, 0x1f, 0xaf, 0x3a, 0x3a, 0xe5, 0x4e, 0xc1, 0xca, 0xbf, 0x47, 0xb4, 0xbb, 0xbc, 0x5f, 0xea, 0xc6, 0xca, 0xf3, 0xa0, 0xa2, 0x73, - /* (2^169)P */ 0xef, 0xa4, 0x7a, 0x4e, 0xe4, 0xc7, 0xb6, 0x43, 0x2e, 0xa5, 0xe4, 0xa5, 0xba, 0x1e, 0xa5, 0xfe, 0x9e, 0xce, 0xa9, 0x80, 0x04, 0xcb, 0x4f, 0xd8, 0x74, 0x05, 0x48, 0xfa, 0x99, 0x11, 0x5d, 0x97, 0x3b, 0x07, 0x0d, 0xdd, 0xe6, 0xb1, 0x74, 0x87, 0x1a, 0xd3, 0x26, 0xb7, 0x8f, 0xe1, 0x63, 0x3d, 0xec, 0x53, 0x93, 0xb0, 0x81, 0x78, 0x34, 0xa4, - /* (2^170)P */ 0xe1, 0xe7, 0xd4, 0x58, 0x9d, 0x0e, 0x8b, 0x65, 0x66, 0x37, 0x16, 0x48, 0x6f, 0xaa, 0x42, 0x37, 0x77, 0xad, 0xb1, 0x56, 0x48, 0xdf, 0x65, 0x36, 0x30, 0xb8, 0x00, 0x12, 0xd8, 0x32, 0x28, 0x7f, 0xc1, 0x71, 0xeb, 0x93, 0x0f, 0x48, 0x04, 0xe1, 0x5a, 0x6a, 0x96, 0xc1, 0xca, 0x89, 0x6d, 0x1b, 0x82, 0x4c, 0x18, 0x6d, 0x55, 0x4b, 0xea, 0xfd, - /* (2^171)P */ 0x62, 0x1a, 0x53, 0xb4, 0xb1, 0xbe, 0x6f, 0x15, 0x18, 0x88, 0xd4, 0x66, 0x61, 0xc7, 0x12, 0x69, 0x02, 0xbd, 0x03, 0x23, 0x2b, 0xef, 0xf9, 0x54, 0xa4, 0x85, 0xa8, 0xe3, 0xb7, 0xbd, 0xa9, 0xa3, 0xf3, 0x2a, 0xdd, 0xf1, 0xd4, 0x03, 0x0f, 0xa9, 0xa1, 0xd8, 0xa3, 0xcd, 0xb2, 0x71, 0x90, 0x4b, 0x35, 0x62, 0xf2, 0x2f, 0xce, 0x67, 0x1f, 0xaa, - /* (2^172)P */ 0x9e, 0x1e, 0xcd, 0x43, 0x7e, 0x87, 0x37, 0x94, 0x3a, 0x97, 0x4c, 0x7e, 0xee, 0xc9, 0x37, 0x85, 0xf1, 0xd9, 0x4f, 0xbf, 0xf9, 0x6f, 0x39, 0x9a, 0x39, 0x87, 0x2e, 0x25, 0x84, 0x42, 0xc3, 0x80, 0xcb, 0x07, 0x22, 0xae, 0x30, 0xd5, 0x50, 0xa1, 0x23, 0xcc, 0x31, 0x81, 0x9d, 0xf1, 0x30, 0xd9, 0x2b, 0x73, 0x41, 0x16, 0x50, 0xab, 0x2d, 0xa2, - /* (2^173)P */ 0xa4, 0x69, 0x4f, 0xa1, 0x4e, 0xb9, 0xbf, 0x14, 0xe8, 0x2b, 0x04, 0x93, 0xb7, 0x6e, 0x9f, 0x7d, 0x73, 0x0a, 0xc5, 0x14, 0xb8, 0xde, 0x8c, 0xc1, 0xfe, 0xc0, 0xa7, 0xa4, 0xcc, 0x42, 0x42, 0x81, 0x15, 0x65, 0x8a, 0x80, 0xb9, 0xde, 0x1f, 0x60, 0x33, 0x0e, 0xcb, 0xfc, 0xe0, 0xdb, 0x83, 0xa1, 0xe5, 0xd0, 0x16, 0x86, 0x2c, 0xe2, 0x87, 0xed, - /* (2^174)P */ 0x7a, 0xc0, 0xeb, 0x6b, 0xf6, 0x0d, 0x4c, 0x6d, 0x1e, 0xdb, 0xab, 0xe7, 0x19, 0x45, 0xc6, 0xe3, 0xb2, 0x06, 0xbb, 0xbc, 0x70, 0x99, 0x83, 0x33, 0xeb, 0x28, 0xc8, 0x77, 0xf6, 0x4d, 0x01, 0xb7, 0x59, 0xa0, 0xd2, 0xb3, 0x2a, 0x72, 0x30, 0xe7, 0x11, 0x39, 0xb6, 0x41, 0x29, 0x65, 0x5a, 0x14, 0xb9, 0x86, 0x08, 0xe0, 0x7d, 0x32, 0x8c, 0xf0, - /* (2^175)P */ 0x5c, 0x11, 0x30, 0x9e, 0x05, 0x27, 0xf5, 0x45, 0x0f, 0xb3, 0xc9, 0x75, 0xc3, 0xd7, 0xe1, 0x82, 0x3b, 0x8e, 0x87, 0x23, 0x00, 0x15, 0x19, 0x07, 0xd9, 0x21, 0x53, 0xc7, 0xf1, 0xa3, 0xbf, 0x70, 0x64, 0x15, 0x18, 0xca, 0x23, 0x9e, 0xd3, 0x08, 0xc3, 0x2a, 0x8b, 0xe5, 0x83, 0x04, 0x89, 0x14, 0xfd, 0x28, 0x25, 0x1c, 0xe3, 0x26, 0xa7, 0x22, - /* (2^176)P */ 0xdc, 0xd4, 0x75, 0x60, 0x99, 0x94, 0xea, 0x09, 0x8e, 0x8a, 0x3c, 0x1b, 0xf9, 0xbd, 0x33, 0x0d, 0x51, 0x3d, 0x12, 0x6f, 0x4e, 0x72, 0xe0, 0x17, 0x20, 0xe9, 0x75, 0xe6, 0x3a, 0xb2, 0x13, 0x83, 0x4e, 0x7a, 0x08, 0x9e, 0xd1, 0x04, 0x5f, 0x6b, 0x42, 0x0b, 0x76, 0x2a, 0x2d, 0x77, 0x53, 0x6c, 0x65, 0x6d, 0x8e, 0x25, 0x3c, 0xb6, 0x8b, 0x69, - /* (2^177)P */ 0xb9, 0x49, 0x28, 0xd0, 0xdc, 0x6c, 0x8f, 0x4c, 0xc9, 0x14, 0x8a, 0x38, 0xa3, 0xcb, 0xc4, 0x9d, 0x53, 0xcf, 0xe9, 0xe3, 0xcf, 0xe0, 0xb1, 0xf2, 0x1b, 0x4c, 0x7f, 0x83, 0x2a, 0x7a, 0xe9, 0x8b, 0x3b, 0x86, 0x61, 0x30, 0xe9, 0x99, 0xbd, 0xba, 0x19, 0x6e, 0x65, 0x2a, 0x12, 0x3e, 0x9c, 0xa8, 0xaf, 0xc3, 0xcf, 0xf8, 0x1f, 0x77, 0x86, 0xea, - /* (2^178)P */ 0x30, 0xde, 0xe7, 0xff, 0x54, 0xf7, 0xa2, 0x59, 0xf6, 0x0b, 0xfb, 0x7a, 0xf2, 0x39, 0xf0, 0xdb, 0x39, 0xbc, 0xf0, 0xfa, 0x60, 0xeb, 0x6b, 0x4f, 0x47, 0x17, 0xc8, 0x00, 0x65, 0x6d, 0x25, 0x1c, 0xd0, 0x48, 0x56, 0x53, 0x45, 0x11, 0x30, 0x02, 0x49, 0x20, 0x27, 0xac, 0xf2, 0x4c, 0xac, 0x64, 0x3d, 0x52, 0xb8, 0x89, 0xe0, 0x93, 0x16, 0x0f, - /* (2^179)P */ 0x84, 0x09, 0xba, 0x40, 0xb2, 0x2f, 0xa3, 0xa8, 0xc2, 0xba, 0x46, 0x33, 0x05, 0x9d, 0x62, 0xad, 0xa1, 0x3c, 0x33, 0xef, 0x0d, 0xeb, 0xf0, 0x77, 0x11, 0x5a, 0xb0, 0x21, 0x9c, 0xdf, 0x55, 0x24, 0x25, 0x35, 0x51, 0x61, 0x92, 0xf0, 0xb1, 0xce, 0xf5, 0xd4, 0x7b, 0x6c, 0x21, 0x9d, 0x56, 0x52, 0xf8, 0xa1, 0x4c, 0xe9, 0x27, 0x55, 0xac, 0x91, - /* (2^180)P */ 0x03, 0x3e, 0x30, 0xd2, 0x0a, 0xfa, 0x7d, 0x82, 0x3d, 0x1f, 0x8b, 0xcb, 0xb6, 0x04, 0x5c, 0xcc, 0x8b, 0xda, 0xe2, 0x68, 0x74, 0x08, 0x8c, 0x44, 0x83, 0x57, 0x6d, 0x6f, 0x80, 0xb0, 0x7e, 0xa9, 0x82, 0x91, 0x7b, 0x4c, 0x37, 0x97, 0xd1, 0x63, 0xd1, 0xbd, 0x45, 0xe6, 0x8a, 0x86, 0xd6, 0x89, 0x54, 0xfd, 0xd2, 0xb1, 0xd7, 0x54, 0xad, 0xaf, - /* (2^181)P */ 0x8b, 0x33, 0x62, 0x49, 0x9f, 0x63, 0xf9, 0x87, 0x42, 0x58, 0xbf, 0xb3, 0xe6, 0x68, 0x02, 0x60, 0x5c, 0x76, 0x62, 0xf7, 0x61, 0xd7, 0x36, 0x31, 0xf7, 0x9c, 0xb5, 0xe5, 0x13, 0x6c, 0xea, 0x78, 0xae, 0xcf, 0xde, 0xbf, 0xb6, 0xeb, 0x4f, 0xc8, 0x2a, 0xb4, 0x9a, 0x9f, 0xf3, 0xd1, 0x6a, 0xec, 0x0c, 0xbd, 0x85, 0x98, 0x40, 0x06, 0x1c, 0x2a, - /* (2^182)P */ 0x74, 0x3b, 0xe7, 0x81, 0xd5, 0xae, 0x54, 0x56, 0x03, 0xe8, 0x97, 0x16, 0x76, 0xcf, 0x24, 0x96, 0x96, 0x5b, 0xcc, 0x09, 0xab, 0x23, 0x6f, 0x54, 0xae, 0x8f, 0xe4, 0x12, 0xcb, 0xfd, 0xbc, 0xac, 0x93, 0x45, 0x3d, 0x68, 0x08, 0x22, 0x59, 0xc6, 0xf0, 0x47, 0x19, 0x8c, 0x79, 0x93, 0x1e, 0x0e, 0x30, 0xb0, 0x94, 0xfb, 0x17, 0x1d, 0x5a, 0x12, - /* (2^183)P */ 0x85, 0xff, 0x40, 0x18, 0x85, 0xff, 0x44, 0x37, 0x69, 0x23, 0x4d, 0x34, 0xe1, 0xeb, 0xa3, 0x1b, 0x55, 0x40, 0xc1, 0x64, 0xf4, 0xd4, 0x13, 0x0a, 0x9f, 0xb9, 0x19, 0xfc, 0x88, 0x7d, 0xc0, 0x72, 0xcf, 0x69, 0x2f, 0xd2, 0x0c, 0x82, 0x0f, 0xda, 0x08, 0xba, 0x0f, 0xaa, 0x3b, 0xe9, 0xe5, 0x83, 0x7a, 0x06, 0xe8, 0x1b, 0x38, 0x43, 0xc3, 0x54, - /* (2^184)P */ 0x14, 0xaa, 0xb3, 0x6e, 0xe6, 0x28, 0xee, 0xc5, 0x22, 0x6c, 0x7c, 0xf9, 0xa8, 0x71, 0xcc, 0xfe, 0x68, 0x7e, 0xd3, 0xb8, 0x37, 0x96, 0xca, 0x0b, 0xd9, 0xb6, 0x06, 0xa9, 0xf6, 0x71, 0xe8, 0x31, 0xf7, 0xd8, 0xf1, 0x5d, 0xab, 0xb9, 0xf0, 0x5c, 0x98, 0xcf, 0x22, 0xa2, 0x2a, 0xf6, 0xd0, 0x59, 0xf0, 0x9d, 0xd9, 0x6a, 0x4f, 0x59, 0x57, 0xad, - /* (2^185)P */ 0xd7, 0x2b, 0x3d, 0x38, 0x4c, 0x2e, 0x23, 0x4d, 0x49, 0xa2, 0x62, 0x62, 0xf9, 0x0f, 0xde, 0x08, 0xf3, 0x86, 0x71, 0xb6, 0xc7, 0xf9, 0x85, 0x9c, 0x33, 0xa1, 0xcf, 0x16, 0xaa, 0x60, 0xb9, 0xb7, 0xea, 0xed, 0x01, 0x1c, 0x59, 0xdb, 0x3f, 0x3f, 0x97, 0x2e, 0xf0, 0x09, 0x9f, 0x10, 0x85, 0x5f, 0x53, 0x39, 0xf3, 0x13, 0x40, 0x56, 0x95, 0xf9, - /* (2^186)P */ 0xb4, 0xe3, 0xda, 0xc6, 0x1f, 0x78, 0x8e, 0xac, 0xd4, 0x20, 0x1d, 0xa0, 0xbf, 0x4c, 0x09, 0x16, 0xa7, 0x30, 0xb5, 0x8d, 0x9e, 0xa1, 0x5f, 0x6d, 0x52, 0xf4, 0x71, 0xb6, 0x32, 0x2d, 0x21, 0x51, 0xc6, 0xfc, 0x2f, 0x08, 0xf4, 0x13, 0x6c, 0x55, 0xba, 0x72, 0x81, 0x24, 0x49, 0x0e, 0x4f, 0x06, 0x36, 0x39, 0x6a, 0xc5, 0x81, 0xfc, 0xeb, 0xb2, - /* (2^187)P */ 0x7d, 0x8d, 0xc8, 0x6c, 0xea, 0xb4, 0xb9, 0xe8, 0x40, 0xc9, 0x69, 0xc9, 0x30, 0x05, 0xfd, 0x34, 0x46, 0xfd, 0x94, 0x05, 0x16, 0xf5, 0x4b, 0x13, 0x3d, 0x24, 0x1a, 0xd6, 0x64, 0x2b, 0x9c, 0xe2, 0xa5, 0xd9, 0x98, 0xe0, 0xe8, 0xf4, 0xbc, 0x2c, 0xbd, 0xa2, 0x56, 0xe3, 0x9e, 0x14, 0xdb, 0xbf, 0x05, 0xbf, 0x9a, 0x13, 0x5d, 0xf7, 0x91, 0xa3, - /* (2^188)P */ 0x8b, 0xcb, 0x27, 0xf3, 0x15, 0x26, 0x05, 0x40, 0x0f, 0xa6, 0x15, 0x13, 0x71, 0x95, 0xa2, 0xc6, 0x38, 0x04, 0x67, 0xf8, 0x9a, 0x83, 0x06, 0xaa, 0x25, 0x36, 0x72, 0x01, 0x6f, 0x74, 0x5f, 0xe5, 0x6e, 0x44, 0x99, 0xce, 0x13, 0xbc, 0x82, 0xc2, 0x0d, 0xa4, 0x98, 0x50, 0x38, 0xf3, 0xa2, 0xc5, 0xe5, 0x24, 0x1f, 0x6f, 0x56, 0x3e, 0x07, 0xb2, - /* (2^189)P */ 0xbd, 0x0f, 0x32, 0x60, 0x07, 0xb1, 0xd7, 0x0b, 0x11, 0x07, 0x57, 0x02, 0x89, 0xe8, 0x8b, 0xe8, 0x5a, 0x1f, 0xee, 0x54, 0x6b, 0xff, 0xb3, 0x04, 0x07, 0x57, 0x13, 0x0b, 0x94, 0xa8, 0x4d, 0x81, 0xe2, 0x17, 0x16, 0x45, 0xd4, 0x4b, 0xf7, 0x7e, 0x64, 0x66, 0x20, 0xe8, 0x0b, 0x26, 0xfd, 0xa9, 0x8a, 0x47, 0x52, 0x89, 0x14, 0xd0, 0xd1, 0xa1, - /* (2^190)P */ 0xdc, 0x03, 0xe6, 0x20, 0x44, 0x47, 0x8f, 0x04, 0x16, 0x24, 0x22, 0xc1, 0x55, 0x5c, 0xbe, 0x43, 0xc3, 0x92, 0xc5, 0x54, 0x3d, 0x5d, 0xd1, 0x05, 0x9c, 0xc6, 0x7c, 0xbf, 0x23, 0x84, 0x1a, 0xba, 0x4f, 0x1f, 0xfc, 0xa1, 0xae, 0x1a, 0x64, 0x02, 0x51, 0xf1, 0xcb, 0x7a, 0x20, 0xce, 0xb2, 0x34, 0x3c, 0xca, 0xe0, 0xe4, 0xba, 0x22, 0xd4, 0x7b, - /* (2^191)P */ 0xca, 0xfd, 0xca, 0xd7, 0xde, 0x61, 0xae, 0xf0, 0x79, 0x0c, 0x20, 0xab, 0xbc, 0x6f, 0x4d, 0x61, 0xf0, 0xc7, 0x9c, 0x8d, 0x4b, 0x52, 0xf3, 0xb9, 0x48, 0x63, 0x0b, 0xb6, 0xd2, 0x25, 0x9a, 0x96, 0x72, 0xc1, 0x6b, 0x0c, 0xb5, 0xfb, 0x71, 0xaa, 0xad, 0x47, 0x5b, 0xe7, 0xc0, 0x0a, 0x55, 0xb2, 0xd4, 0x16, 0x2f, 0xb1, 0x01, 0xfd, 0xce, 0x27, - /* (2^192)P */ 0x64, 0x11, 0x4b, 0xab, 0x57, 0x09, 0xc6, 0x49, 0x4a, 0x37, 0xc3, 0x36, 0xc4, 0x7b, 0x81, 0x1f, 0x42, 0xed, 0xbb, 0xe0, 0xa0, 0x8d, 0x51, 0xe6, 0xca, 0x8b, 0xb9, 0xcd, 0x99, 0x2d, 0x91, 0x53, 0xa9, 0x47, 0xcb, 0x32, 0xc7, 0xa4, 0x92, 0xec, 0x46, 0x74, 0x44, 0x6d, 0x71, 0x9f, 0x6d, 0x0c, 0x69, 0xa4, 0xf8, 0xbe, 0x9f, 0x7f, 0xa0, 0xd7, - /* (2^193)P */ 0x5f, 0x33, 0xb6, 0x91, 0xc8, 0xa5, 0x3f, 0x5d, 0x7f, 0x38, 0x6e, 0x74, 0x20, 0x4a, 0xd6, 0x2b, 0x98, 0x2a, 0x41, 0x4b, 0x83, 0x64, 0x0b, 0x92, 0x7a, 0x06, 0x1e, 0xc6, 0x2c, 0xf6, 0xe4, 0x91, 0xe5, 0xb1, 0x2e, 0x6e, 0x4e, 0xa8, 0xc8, 0x14, 0x32, 0x57, 0x44, 0x1c, 0xe4, 0xb9, 0x7f, 0x54, 0x51, 0x08, 0x81, 0xaa, 0x4e, 0xce, 0xa1, 0x5d, - /* (2^194)P */ 0x5c, 0xd5, 0x9b, 0x5e, 0x7c, 0xb5, 0xb1, 0x52, 0x73, 0x00, 0x41, 0x56, 0x79, 0x08, 0x7e, 0x07, 0x28, 0x06, 0xa6, 0xfb, 0x7f, 0x69, 0xbd, 0x7a, 0x3c, 0xae, 0x9f, 0x39, 0xbb, 0x54, 0xa2, 0x79, 0xb9, 0x0e, 0x7f, 0xbb, 0xe0, 0xe6, 0xb7, 0x27, 0x64, 0x38, 0x45, 0xdb, 0x84, 0xe4, 0x61, 0x72, 0x3f, 0xe2, 0x24, 0xfe, 0x7a, 0x31, 0x9a, 0xc9, - /* (2^195)P */ 0xa1, 0xd2, 0xa4, 0xee, 0x24, 0x96, 0xe5, 0x5b, 0x79, 0x78, 0x3c, 0x7b, 0x82, 0x3b, 0x8b, 0x58, 0x0b, 0xa3, 0x63, 0x2d, 0xbc, 0x75, 0x46, 0xe8, 0x83, 0x1a, 0xc0, 0x2a, 0x92, 0x61, 0xa8, 0x75, 0x37, 0x3c, 0xbf, 0x0f, 0xef, 0x8f, 0x6c, 0x97, 0x75, 0x10, 0x05, 0x7a, 0xde, 0x23, 0xe8, 0x2a, 0x35, 0xeb, 0x41, 0x64, 0x7d, 0xcf, 0xe0, 0x52, - /* (2^196)P */ 0x4a, 0xd0, 0x49, 0x93, 0xae, 0xf3, 0x24, 0x8c, 0xe1, 0x09, 0x98, 0x45, 0xd8, 0xb9, 0xfe, 0x8e, 0x8c, 0xa8, 0x2c, 0xc9, 0x9f, 0xce, 0x01, 0xdc, 0x38, 0x11, 0xab, 0x85, 0xb9, 0xe8, 0x00, 0x51, 0xfd, 0x82, 0xe1, 0x9b, 0x4e, 0xfc, 0xb5, 0x2a, 0x0f, 0x8b, 0xda, 0x4e, 0x02, 0xca, 0xcc, 0xe3, 0x91, 0xc4, 0xe0, 0xcf, 0x7b, 0xd6, 0xe6, 0x6a, - /* (2^197)P */ 0xfe, 0x11, 0xd7, 0xaa, 0xe3, 0x0c, 0x52, 0x2e, 0x04, 0xe0, 0xe0, 0x61, 0xc8, 0x05, 0xd7, 0x31, 0x4c, 0xc3, 0x9b, 0x2d, 0xce, 0x59, 0xbe, 0x12, 0xb7, 0x30, 0x21, 0xfc, 0x81, 0xb8, 0x5e, 0x57, 0x73, 0xd0, 0xad, 0x8e, 0x9e, 0xe4, 0xeb, 0xcd, 0xcf, 0xd2, 0x0f, 0x01, 0x35, 0x16, 0xed, 0x7a, 0x43, 0x8e, 0x42, 0xdc, 0xea, 0x4c, 0xa8, 0x7c, - /* (2^198)P */ 0x37, 0x26, 0xcc, 0x76, 0x0b, 0xe5, 0x76, 0xdd, 0x3e, 0x19, 0x3c, 0xc4, 0x6c, 0x7f, 0xd0, 0x03, 0xc1, 0xb8, 0x59, 0x82, 0xca, 0x36, 0xc1, 0xe4, 0xc8, 0xb2, 0x83, 0x69, 0x9c, 0xc5, 0x9d, 0x12, 0x82, 0x1c, 0xea, 0xb2, 0x84, 0x9f, 0xf3, 0x52, 0x6b, 0xbb, 0xd8, 0x81, 0x56, 0x83, 0x04, 0x66, 0x05, 0x22, 0x49, 0x37, 0x93, 0xb1, 0xfd, 0xd5, - /* (2^199)P */ 0xaf, 0x96, 0xbf, 0x03, 0xbe, 0xe6, 0x5d, 0x78, 0x19, 0xba, 0x37, 0x46, 0x0a, 0x2b, 0x52, 0x7c, 0xd8, 0x51, 0x9e, 0x3d, 0x29, 0x42, 0xdb, 0x0e, 0x31, 0x20, 0x94, 0xf8, 0x43, 0x9a, 0x2d, 0x22, 0xd3, 0xe3, 0xa1, 0x79, 0x68, 0xfb, 0x2d, 0x7e, 0xd6, 0x79, 0xda, 0x0b, 0xc6, 0x5b, 0x76, 0x68, 0xf0, 0xfe, 0x72, 0x59, 0xbb, 0xa1, 0x9c, 0x74, - /* (2^200)P */ 0x0a, 0xd9, 0xec, 0xc5, 0xbd, 0xf0, 0xda, 0xcf, 0x82, 0xab, 0x46, 0xc5, 0x32, 0x13, 0xdc, 0x5b, 0xac, 0xc3, 0x53, 0x9a, 0x7f, 0xef, 0xa5, 0x40, 0x5a, 0x1f, 0xc1, 0x12, 0x91, 0x54, 0x83, 0x6a, 0xb0, 0x9a, 0x85, 0x4d, 0xbf, 0x36, 0x8e, 0xd3, 0xa2, 0x2b, 0xe5, 0xd6, 0xc6, 0xe1, 0x58, 0x5b, 0x82, 0x9b, 0xc8, 0xf2, 0x03, 0xba, 0xf5, 0x92, - /* (2^201)P */ 0xfb, 0x21, 0x7e, 0xde, 0xe7, 0xb4, 0xc0, 0x56, 0x86, 0x3a, 0x5b, 0x78, 0xf8, 0xf0, 0xf4, 0xe7, 0x5c, 0x00, 0xd2, 0xd7, 0xd6, 0xf8, 0x75, 0x5e, 0x0f, 0x3e, 0xd1, 0x4b, 0x77, 0xd8, 0xad, 0xb0, 0xc9, 0x8b, 0x59, 0x7d, 0x30, 0x76, 0x64, 0x7a, 0x76, 0xd9, 0x51, 0x69, 0xfc, 0xbd, 0x8e, 0xb5, 0x55, 0xe0, 0xd2, 0x07, 0x15, 0xa9, 0xf7, 0xa4, - /* (2^202)P */ 0xaa, 0x2d, 0x2f, 0x2b, 0x3c, 0x15, 0xdd, 0xcd, 0xe9, 0x28, 0x82, 0x4f, 0xa2, 0xaa, 0x31, 0x48, 0xcc, 0xfa, 0x07, 0x73, 0x8a, 0x34, 0x74, 0x0d, 0xab, 0x1a, 0xca, 0xd2, 0xbf, 0x3a, 0xdb, 0x1a, 0x5f, 0x50, 0x62, 0xf4, 0x6b, 0x83, 0x38, 0x43, 0x96, 0xee, 0x6b, 0x39, 0x1e, 0xf0, 0x17, 0x80, 0x1e, 0x9b, 0xed, 0x2b, 0x2f, 0xcc, 0x65, 0xf7, - /* (2^203)P */ 0x03, 0xb3, 0x23, 0x9c, 0x0d, 0xd1, 0xeb, 0x7e, 0x34, 0x17, 0x8a, 0x4c, 0xde, 0x54, 0x39, 0xc4, 0x11, 0x82, 0xd3, 0xa4, 0x00, 0x32, 0x95, 0x9c, 0xa6, 0x64, 0x76, 0x6e, 0xd6, 0x53, 0x27, 0xb4, 0x6a, 0x14, 0x8c, 0x54, 0xf6, 0x58, 0x9e, 0x22, 0x4a, 0x55, 0x18, 0x77, 0xd0, 0x08, 0x6b, 0x19, 0x8a, 0xb5, 0xe7, 0x19, 0xb8, 0x60, 0x92, 0xb1, - /* (2^204)P */ 0x66, 0xec, 0xf3, 0x12, 0xde, 0x67, 0x7f, 0xd4, 0x5b, 0xf6, 0x70, 0x64, 0x0a, 0xb5, 0xc2, 0xf9, 0xb3, 0x64, 0xab, 0x56, 0x46, 0xc7, 0x93, 0xc2, 0x8b, 0x2d, 0xd0, 0xd6, 0x39, 0x3b, 0x1f, 0xcd, 0xb3, 0xac, 0xcc, 0x2c, 0x27, 0x6a, 0xbc, 0xb3, 0x4b, 0xa8, 0x3c, 0x69, 0x20, 0xe2, 0x18, 0x35, 0x17, 0xe1, 0x8a, 0xd3, 0x11, 0x74, 0xaa, 0x4d, - /* (2^205)P */ 0x96, 0xc4, 0x16, 0x7e, 0xfd, 0xf5, 0xd0, 0x7d, 0x1f, 0x32, 0x1b, 0xdb, 0xa6, 0xfd, 0x51, 0x75, 0x4d, 0xd7, 0x00, 0xe5, 0x7f, 0x58, 0x5b, 0xeb, 0x4b, 0x6a, 0x78, 0xfe, 0xe5, 0xd6, 0x8f, 0x99, 0x17, 0xca, 0x96, 0x45, 0xf7, 0x52, 0xdf, 0x84, 0x06, 0x77, 0xb9, 0x05, 0x63, 0x5d, 0xe9, 0x91, 0xb1, 0x4b, 0x82, 0x5a, 0xdb, 0xd7, 0xca, 0x69, - /* (2^206)P */ 0x02, 0xd3, 0x38, 0x38, 0x87, 0xea, 0xbd, 0x9f, 0x11, 0xca, 0xf3, 0x21, 0xf1, 0x9b, 0x35, 0x97, 0x98, 0xff, 0x8e, 0x6d, 0x3d, 0xd6, 0xb2, 0xfa, 0x68, 0xcb, 0x7e, 0x62, 0x85, 0xbb, 0xc7, 0x5d, 0xee, 0x32, 0x30, 0x2e, 0x71, 0x96, 0x63, 0x43, 0x98, 0xc4, 0xa7, 0xde, 0x60, 0xb2, 0xd9, 0x43, 0x4a, 0xfa, 0x97, 0x2d, 0x5f, 0x21, 0xd4, 0xfe, - /* (2^207)P */ 0x3b, 0x20, 0x29, 0x07, 0x07, 0xb5, 0x78, 0xc3, 0xc7, 0xab, 0x56, 0xba, 0x40, 0xde, 0x1d, 0xcf, 0xc3, 0x00, 0x56, 0x21, 0x0c, 0xc8, 0x42, 0xd9, 0x0e, 0xcd, 0x02, 0x7c, 0x07, 0xb9, 0x11, 0xd7, 0x96, 0xaf, 0xff, 0xad, 0xc5, 0xba, 0x30, 0x6d, 0x82, 0x3a, 0xbf, 0xef, 0x7b, 0xf7, 0x0a, 0x74, 0xbd, 0x31, 0x0c, 0xe4, 0xec, 0x1a, 0xe5, 0xc5, - /* (2^208)P */ 0xcc, 0xf2, 0x28, 0x16, 0x12, 0xbf, 0xef, 0x85, 0xbc, 0xf7, 0xcb, 0x9f, 0xdb, 0xa8, 0xb2, 0x49, 0x53, 0x48, 0xa8, 0x24, 0xa8, 0x68, 0x8d, 0xbb, 0x21, 0x0a, 0x5a, 0xbd, 0xb2, 0x91, 0x61, 0x47, 0xc4, 0x43, 0x08, 0xa6, 0x19, 0xef, 0x8e, 0x88, 0x39, 0xc6, 0x33, 0x30, 0xf3, 0x0e, 0xc5, 0x92, 0x66, 0xd6, 0xfe, 0xc5, 0x12, 0xd9, 0x4c, 0x2d, - /* (2^209)P */ 0x30, 0x34, 0x07, 0xbf, 0x9c, 0x5a, 0x4e, 0x65, 0xf1, 0x39, 0x35, 0x38, 0xae, 0x7b, 0x55, 0xac, 0x6a, 0x92, 0x24, 0x7e, 0x50, 0xd3, 0xba, 0x78, 0x51, 0xfe, 0x4d, 0x32, 0x05, 0x11, 0xf5, 0x52, 0xf1, 0x31, 0x45, 0x39, 0x98, 0x7b, 0x28, 0x56, 0xc3, 0x5d, 0x4f, 0x07, 0x6f, 0x84, 0xb8, 0x1a, 0x58, 0x0b, 0xc4, 0x7c, 0xc4, 0x8d, 0x32, 0x8e, - /* (2^210)P */ 0x7e, 0xaf, 0x98, 0xce, 0xc5, 0x2b, 0x9d, 0xf6, 0xfa, 0x2c, 0xb6, 0x2a, 0x5a, 0x1d, 0xc0, 0x24, 0x8d, 0xa4, 0xce, 0xb1, 0x12, 0x01, 0xf9, 0x79, 0xc6, 0x79, 0x38, 0x0c, 0xd4, 0x07, 0xc9, 0xf7, 0x37, 0xa1, 0x0b, 0xfe, 0x72, 0xec, 0x5d, 0xd6, 0xb0, 0x1c, 0x70, 0xbe, 0x70, 0x01, 0x13, 0xe0, 0x86, 0x95, 0xc7, 0x2e, 0x12, 0x3b, 0xe6, 0xa6, - /* (2^211)P */ 0x24, 0x82, 0x67, 0xe0, 0x14, 0x7b, 0x56, 0x08, 0x38, 0x44, 0xdb, 0xa0, 0x3a, 0x05, 0x47, 0xb2, 0xc0, 0xac, 0xd1, 0xcc, 0x3f, 0x82, 0xb8, 0x8a, 0x88, 0xbc, 0xf5, 0x33, 0xa1, 0x35, 0x0f, 0xf6, 0xe2, 0xef, 0x6c, 0xf7, 0x37, 0x9e, 0xe8, 0x10, 0xca, 0xb0, 0x8e, 0x80, 0x86, 0x00, 0x23, 0xd0, 0x4a, 0x76, 0x9f, 0xf7, 0x2c, 0x52, 0x15, 0x0e, - /* (2^212)P */ 0x5e, 0x49, 0xe1, 0x2c, 0x9a, 0x01, 0x76, 0xa6, 0xb3, 0x07, 0x5b, 0xa4, 0x07, 0xef, 0x1d, 0xc3, 0x6a, 0xbb, 0x64, 0xbe, 0x71, 0x15, 0x6e, 0x32, 0x31, 0x46, 0x9a, 0x9e, 0x8f, 0x45, 0x73, 0xce, 0x0b, 0x94, 0x1a, 0x52, 0x07, 0xf4, 0x50, 0x30, 0x49, 0x53, 0x50, 0xfb, 0x71, 0x1f, 0x5a, 0x03, 0xa9, 0x76, 0xf2, 0x8f, 0x42, 0xff, 0xed, 0xed, - /* (2^213)P */ 0xed, 0x08, 0xdb, 0x91, 0x1c, 0xee, 0xa2, 0xb4, 0x47, 0xa2, 0xfa, 0xcb, 0x03, 0xd1, 0xff, 0x8c, 0xad, 0x64, 0x50, 0x61, 0xcd, 0xfc, 0x88, 0xa0, 0x31, 0x95, 0x30, 0xb9, 0x58, 0xdd, 0xd7, 0x43, 0xe4, 0x46, 0xc2, 0x16, 0xd9, 0x72, 0x4a, 0x56, 0x51, 0x70, 0x85, 0xf1, 0xa1, 0x80, 0x40, 0xd5, 0xba, 0x67, 0x81, 0xda, 0xcd, 0x03, 0xea, 0x51, - /* (2^214)P */ 0x42, 0x50, 0xf0, 0xef, 0x37, 0x61, 0x72, 0x85, 0xe1, 0xf1, 0xff, 0x6f, 0x3d, 0xe8, 0x7b, 0x21, 0x5c, 0xe5, 0x50, 0x03, 0xde, 0x00, 0xc1, 0xf7, 0x3a, 0x55, 0x12, 0x1c, 0x9e, 0x1e, 0xce, 0xd1, 0x2f, 0xaf, 0x05, 0x70, 0x5b, 0x47, 0xf2, 0x04, 0x7a, 0x89, 0xbc, 0x78, 0xa6, 0x65, 0x6c, 0xaa, 0x3c, 0xa2, 0x3c, 0x8b, 0x5c, 0xa9, 0x22, 0x48, - /* (2^215)P */ 0x7e, 0x8c, 0x8f, 0x2f, 0x60, 0xe3, 0x5a, 0x94, 0xd4, 0xce, 0xdd, 0x9d, 0x83, 0x3b, 0x77, 0x78, 0x43, 0x1d, 0xfd, 0x8f, 0xc8, 0xe8, 0x02, 0x90, 0xab, 0xf6, 0xc9, 0xfc, 0xf1, 0x63, 0xaa, 0x5f, 0x42, 0xf1, 0x78, 0x34, 0x64, 0x16, 0x75, 0x9c, 0x7d, 0xd0, 0xe4, 0x74, 0x5a, 0xa8, 0xfb, 0xcb, 0xac, 0x20, 0xa3, 0xc2, 0xa6, 0x20, 0xf8, 0x1b, - /* (2^216)P */ 0x00, 0x4f, 0x1e, 0x56, 0xb5, 0x34, 0xb2, 0x87, 0x31, 0xe5, 0xee, 0x8d, 0xf1, 0x41, 0x67, 0xb7, 0x67, 0x3a, 0x54, 0x86, 0x5c, 0xf0, 0x0b, 0x37, 0x2f, 0x1b, 0x92, 0x5d, 0x58, 0x93, 0xdc, 0xd8, 0x58, 0xcc, 0x9e, 0x67, 0xd0, 0x97, 0x3a, 0xaf, 0x49, 0x39, 0x2d, 0x3b, 0xd8, 0x98, 0xfb, 0x76, 0x6b, 0xe7, 0xaf, 0xc3, 0x45, 0x44, 0x53, 0x94, - /* (2^217)P */ 0x30, 0xbd, 0x90, 0x75, 0xd3, 0xbd, 0x3b, 0x58, 0x27, 0x14, 0x9f, 0x6b, 0xd4, 0x31, 0x99, 0xcd, 0xde, 0x3a, 0x21, 0x1e, 0xb4, 0x02, 0xe4, 0x33, 0x04, 0x02, 0xb0, 0x50, 0x66, 0x68, 0x90, 0xdd, 0x7b, 0x69, 0x31, 0xd9, 0xcf, 0x68, 0x73, 0xf1, 0x60, 0xdd, 0xc8, 0x1d, 0x5d, 0xe3, 0xd6, 0x5b, 0x2a, 0xa4, 0xea, 0xc4, 0x3f, 0x08, 0xcd, 0x9c, - /* (2^218)P */ 0x6b, 0x1a, 0xbf, 0x55, 0xc1, 0x1b, 0x0c, 0x05, 0x09, 0xdf, 0xf5, 0x5e, 0xa3, 0x77, 0x95, 0xe9, 0xdf, 0x19, 0xdd, 0xc7, 0x94, 0xcb, 0x06, 0x73, 0xd0, 0x88, 0x02, 0x33, 0x94, 0xca, 0x7a, 0x2f, 0x8e, 0x3d, 0x72, 0x61, 0x2d, 0x4d, 0xa6, 0x61, 0x1f, 0x32, 0x5e, 0x87, 0x53, 0x36, 0x11, 0x15, 0x20, 0xb3, 0x5a, 0x57, 0x51, 0x93, 0x20, 0xd8, - /* (2^219)P */ 0xb7, 0x56, 0xf4, 0xab, 0x7d, 0x0c, 0xfb, 0x99, 0x1a, 0x30, 0x29, 0xb0, 0x75, 0x2a, 0xf8, 0x53, 0x71, 0x23, 0xbd, 0xa7, 0xd8, 0x0a, 0xe2, 0x27, 0x65, 0xe9, 0x74, 0x26, 0x98, 0x4a, 0x69, 0x19, 0xb2, 0x4d, 0x0a, 0x17, 0x98, 0xb2, 0xa9, 0x57, 0x4e, 0xf6, 0x86, 0xc8, 0x01, 0xa4, 0xc6, 0x98, 0xad, 0x5a, 0x90, 0x2c, 0x05, 0x46, 0x64, 0xb7, - /* (2^220)P */ 0x7b, 0x91, 0xdf, 0xfc, 0xf8, 0x1c, 0x8c, 0x15, 0x9e, 0xf7, 0xd5, 0xa8, 0xe8, 0xe7, 0xe3, 0xa3, 0xb0, 0x04, 0x74, 0xfa, 0x78, 0xfb, 0x26, 0xbf, 0x67, 0x42, 0xf9, 0x8c, 0x9b, 0xb4, 0x69, 0x5b, 0x02, 0x13, 0x6d, 0x09, 0x6c, 0xd6, 0x99, 0x61, 0x7b, 0x89, 0x4a, 0x67, 0x75, 0xa3, 0x98, 0x13, 0x23, 0x1d, 0x18, 0x24, 0x0e, 0xef, 0x41, 0x79, - /* (2^221)P */ 0x86, 0x33, 0xab, 0x08, 0xcb, 0xbf, 0x1e, 0x76, 0x3c, 0x0b, 0xbd, 0x30, 0xdb, 0xe9, 0xa3, 0x35, 0x87, 0x1b, 0xe9, 0x07, 0x00, 0x66, 0x7f, 0x3b, 0x35, 0x0c, 0x8a, 0x3f, 0x61, 0xbc, 0xe0, 0xae, 0xf6, 0xcc, 0x54, 0xe1, 0x72, 0x36, 0x2d, 0xee, 0x93, 0x24, 0xf8, 0xd7, 0xc5, 0xf9, 0xcb, 0xb0, 0xe5, 0x88, 0x0d, 0x23, 0x4b, 0x76, 0x15, 0xa2, - /* (2^222)P */ 0x37, 0xdb, 0x83, 0xd5, 0x6d, 0x06, 0x24, 0x37, 0x1b, 0x15, 0x85, 0x15, 0xe2, 0xc0, 0x4e, 0x02, 0xa9, 0x6d, 0x0a, 0x3a, 0x94, 0x4a, 0x6f, 0x49, 0x00, 0x01, 0x72, 0xbb, 0x60, 0x14, 0x35, 0xae, 0xb4, 0xc6, 0x01, 0x0a, 0x00, 0x9e, 0xc3, 0x58, 0xc5, 0xd1, 0x5e, 0x30, 0x73, 0x96, 0x24, 0x85, 0x9d, 0xf0, 0xf9, 0xec, 0x09, 0xd3, 0xe7, 0x70, - /* (2^223)P */ 0xf3, 0xbd, 0x96, 0x87, 0xe9, 0x71, 0xbd, 0xd6, 0xa2, 0x45, 0xeb, 0x0a, 0xcd, 0x2c, 0xf1, 0x72, 0xa6, 0x31, 0xa9, 0x6f, 0x09, 0xa1, 0x5e, 0xdd, 0xc8, 0x8d, 0x0d, 0xbc, 0x5a, 0x8d, 0xb1, 0x2c, 0x9a, 0xcc, 0x37, 0x74, 0xc2, 0xa9, 0x4e, 0xd6, 0xc0, 0x3c, 0xa0, 0x23, 0xb0, 0xa0, 0x77, 0x14, 0x80, 0x45, 0x71, 0x6a, 0x2d, 0x41, 0xc3, 0x82, - /* (2^224)P */ 0x37, 0x44, 0xec, 0x8a, 0x3e, 0xc1, 0x0c, 0xa9, 0x12, 0x9c, 0x08, 0x88, 0xcb, 0xd9, 0xf8, 0xba, 0x00, 0xd6, 0xc3, 0xdf, 0xef, 0x7a, 0x44, 0x7e, 0x25, 0x69, 0xc9, 0xc1, 0x46, 0xe5, 0x20, 0x9e, 0xcc, 0x0b, 0x05, 0x3e, 0xf4, 0x78, 0x43, 0x0c, 0xa6, 0x2f, 0xc1, 0xfa, 0x70, 0xb2, 0x3c, 0x31, 0x7a, 0x63, 0x58, 0xab, 0x17, 0xcf, 0x4c, 0x4f, - /* (2^225)P */ 0x2b, 0x08, 0x31, 0x59, 0x75, 0x8b, 0xec, 0x0a, 0xa9, 0x79, 0x70, 0xdd, 0xf1, 0x11, 0xc3, 0x11, 0x1f, 0xab, 0x37, 0xaa, 0x26, 0xea, 0x53, 0xc4, 0x79, 0xa7, 0x91, 0x00, 0xaa, 0x08, 0x42, 0xeb, 0x8b, 0x8b, 0xe8, 0xc3, 0x2f, 0xb8, 0x78, 0x90, 0x38, 0x0e, 0x8a, 0x42, 0x0c, 0x0f, 0xbf, 0x3e, 0xf8, 0xd8, 0x07, 0xcf, 0x6a, 0x34, 0xc9, 0xfa, - /* (2^226)P */ 0x11, 0xe0, 0x76, 0x4d, 0x23, 0xc5, 0xa6, 0xcc, 0x9f, 0x9a, 0x2a, 0xde, 0x3a, 0xb5, 0x92, 0x39, 0x19, 0x8a, 0xf1, 0x8d, 0xf9, 0x4d, 0xc9, 0xb4, 0x39, 0x9f, 0x57, 0xd8, 0x72, 0xab, 0x1d, 0x61, 0x6a, 0xb2, 0xff, 0x52, 0xba, 0x54, 0x0e, 0xfb, 0x83, 0x30, 0x8a, 0xf7, 0x3b, 0xf4, 0xd8, 0xae, 0x1a, 0x94, 0x3a, 0xec, 0x63, 0xfe, 0x6e, 0x7c, - /* (2^227)P */ 0xdc, 0x70, 0x8e, 0x55, 0x44, 0xbf, 0xd2, 0x6a, 0xa0, 0x14, 0x61, 0x89, 0xd5, 0x55, 0x45, 0x3c, 0xf6, 0x40, 0x0d, 0x83, 0x85, 0x44, 0xb4, 0x62, 0x56, 0xfe, 0x60, 0xd7, 0x07, 0x1d, 0x47, 0x30, 0x3b, 0x73, 0xa4, 0xb5, 0xb7, 0xea, 0xac, 0xda, 0xf1, 0x17, 0xaa, 0x60, 0xdf, 0xe9, 0x84, 0xda, 0x31, 0x32, 0x61, 0xbf, 0xd0, 0x7e, 0x8a, 0x02, - /* (2^228)P */ 0xb9, 0x51, 0xb3, 0x89, 0x21, 0x5d, 0xa2, 0xfe, 0x79, 0x2a, 0xb3, 0x2a, 0x3b, 0xe6, 0x6f, 0x2b, 0x22, 0x03, 0xea, 0x7b, 0x1f, 0xaf, 0x85, 0xc3, 0x38, 0x55, 0x5b, 0x8e, 0xb4, 0xaa, 0x77, 0xfe, 0x03, 0x6e, 0xda, 0x91, 0x24, 0x0c, 0x48, 0x39, 0x27, 0x43, 0x16, 0xd2, 0x0a, 0x0d, 0x43, 0xa3, 0x0e, 0xca, 0x45, 0xd1, 0x7f, 0xf5, 0xd3, 0x16, - /* (2^229)P */ 0x3d, 0x32, 0x9b, 0x38, 0xf8, 0x06, 0x93, 0x78, 0x5b, 0x50, 0x2b, 0x06, 0xd8, 0x66, 0xfe, 0xab, 0x9b, 0x58, 0xc7, 0xd1, 0x4d, 0xd5, 0xf8, 0x3b, 0x10, 0x7e, 0x85, 0xde, 0x58, 0x4e, 0xdf, 0x53, 0xd9, 0x58, 0xe0, 0x15, 0x81, 0x9f, 0x1a, 0x78, 0xfc, 0x9f, 0x10, 0xc2, 0x23, 0xd6, 0x78, 0xd1, 0x9d, 0xd2, 0xd5, 0x1c, 0x53, 0xe2, 0xc9, 0x76, - /* (2^230)P */ 0x98, 0x1e, 0x38, 0x7b, 0x71, 0x18, 0x4b, 0x15, 0xaf, 0xa1, 0xa6, 0x98, 0xcb, 0x26, 0xa3, 0xc8, 0x07, 0x46, 0xda, 0x3b, 0x70, 0x65, 0xec, 0x7a, 0x2b, 0x34, 0x94, 0xa8, 0xb6, 0x14, 0xf8, 0x1a, 0xce, 0xf7, 0xc8, 0x60, 0xf3, 0x88, 0xf4, 0x33, 0x60, 0x7b, 0xd1, 0x02, 0xe7, 0xda, 0x00, 0x4a, 0xea, 0xd2, 0xfd, 0x88, 0xd2, 0x99, 0x28, 0xf3, - /* (2^231)P */ 0x28, 0x24, 0x1d, 0x26, 0xc2, 0xeb, 0x8b, 0x3b, 0xb4, 0x6b, 0xbe, 0x6b, 0x77, 0xff, 0xf3, 0x21, 0x3b, 0x26, 0x6a, 0x8c, 0x8e, 0x2a, 0x44, 0xa8, 0x01, 0x2b, 0x71, 0xea, 0x64, 0x30, 0xfd, 0xfd, 0x95, 0xcb, 0x39, 0x38, 0x48, 0xfa, 0x96, 0x97, 0x8c, 0x2f, 0x33, 0xca, 0x03, 0xe6, 0xd7, 0x94, 0x55, 0x6c, 0xc3, 0xb3, 0xa8, 0xf7, 0xae, 0x8c, - /* (2^232)P */ 0xea, 0x62, 0x8a, 0xb4, 0xeb, 0x74, 0xf7, 0xb8, 0xae, 0xc5, 0x20, 0x71, 0x06, 0xd6, 0x7c, 0x62, 0x9b, 0x69, 0x74, 0xef, 0xa7, 0x6d, 0xd6, 0x8c, 0x37, 0xb9, 0xbf, 0xcf, 0xeb, 0xe4, 0x2f, 0x04, 0x02, 0x21, 0x7d, 0x75, 0x6b, 0x92, 0x48, 0xf8, 0x70, 0xad, 0x69, 0xe2, 0xea, 0x0e, 0x88, 0x67, 0x72, 0xcc, 0x2d, 0x10, 0xce, 0x2d, 0xcf, 0x65, - /* (2^233)P */ 0x49, 0xf3, 0x57, 0x64, 0xe5, 0x5c, 0xc5, 0x65, 0x49, 0x97, 0xc4, 0x8a, 0xcc, 0xa9, 0xca, 0x94, 0x7b, 0x86, 0x88, 0xb6, 0x51, 0x27, 0x69, 0xa5, 0x0f, 0x8b, 0x06, 0x59, 0xa0, 0x94, 0xef, 0x63, 0x1a, 0x01, 0x9e, 0x4f, 0xd2, 0x5a, 0x93, 0xc0, 0x7c, 0xe6, 0x61, 0x77, 0xb6, 0xf5, 0x40, 0xd9, 0x98, 0x43, 0x5b, 0x56, 0x68, 0xe9, 0x37, 0x8f, - /* (2^234)P */ 0xee, 0x87, 0xd2, 0x05, 0x1b, 0x39, 0x89, 0x10, 0x07, 0x6d, 0xe8, 0xfd, 0x8b, 0x4d, 0xb2, 0xa7, 0x7b, 0x1e, 0xa0, 0x6c, 0x0d, 0x3d, 0x3d, 0x49, 0xba, 0x61, 0x36, 0x1f, 0xc2, 0x84, 0x4a, 0xcc, 0x87, 0xa9, 0x1b, 0x23, 0x04, 0xe2, 0x3e, 0x97, 0xe1, 0xdb, 0xd5, 0x5a, 0xe8, 0x41, 0x6b, 0xe5, 0x5a, 0xa1, 0x99, 0xe5, 0x7b, 0xa7, 0xe0, 0x3b, - /* (2^235)P */ 0xea, 0xa3, 0x6a, 0xdd, 0x77, 0x7f, 0x77, 0x41, 0xc5, 0x6a, 0xe4, 0xaf, 0x11, 0x5f, 0x88, 0xa5, 0x10, 0xee, 0xd0, 0x8c, 0x0c, 0xb4, 0xa5, 0x2a, 0xd0, 0xd8, 0x1d, 0x47, 0x06, 0xc0, 0xd5, 0xce, 0x51, 0x54, 0x9b, 0x2b, 0xe6, 0x2f, 0xe7, 0xe7, 0x31, 0x5f, 0x5c, 0x23, 0x81, 0x3e, 0x03, 0x93, 0xaa, 0x2d, 0x71, 0x84, 0xa0, 0x89, 0x32, 0xa6, - /* (2^236)P */ 0x55, 0xa3, 0x13, 0x92, 0x4e, 0x93, 0x7d, 0xec, 0xca, 0x57, 0xfb, 0x37, 0xae, 0xd2, 0x18, 0x2e, 0x54, 0x05, 0x6c, 0xd1, 0x28, 0xca, 0x90, 0x40, 0x82, 0x2e, 0x79, 0xc6, 0x5a, 0xc7, 0xdd, 0x84, 0x93, 0xdf, 0x15, 0xb8, 0x1f, 0xb1, 0xf9, 0xaf, 0x2c, 0xe5, 0x32, 0xcd, 0xc2, 0x99, 0x6d, 0xac, 0x85, 0x5c, 0x63, 0xd3, 0xe2, 0xff, 0x24, 0xda, - /* (2^237)P */ 0x2d, 0x8d, 0xfd, 0x65, 0xcc, 0xe5, 0x02, 0xa0, 0xe5, 0xb9, 0xec, 0x59, 0x09, 0x50, 0x27, 0xb7, 0x3d, 0x2a, 0x79, 0xb2, 0x76, 0x5d, 0x64, 0x95, 0xf8, 0xc5, 0xaf, 0x8a, 0x62, 0x11, 0x5c, 0x56, 0x1c, 0x05, 0x64, 0x9e, 0x5e, 0xbd, 0x54, 0x04, 0xe6, 0x9e, 0xab, 0xe6, 0x22, 0x7e, 0x42, 0x54, 0xb5, 0xa5, 0xd0, 0x8d, 0x28, 0x6b, 0x0f, 0x0b, - /* (2^238)P */ 0x2d, 0xb2, 0x8c, 0x59, 0x10, 0x37, 0x84, 0x3b, 0x9b, 0x65, 0x1b, 0x0f, 0x10, 0xf9, 0xea, 0x60, 0x1b, 0x02, 0xf5, 0xee, 0x8b, 0xe6, 0x32, 0x7d, 0x10, 0x7f, 0x5f, 0x8c, 0x72, 0x09, 0x4e, 0x1f, 0x29, 0xff, 0x65, 0xcb, 0x3e, 0x3a, 0xd2, 0x96, 0x50, 0x1e, 0xea, 0x64, 0x99, 0xb5, 0x4c, 0x7a, 0x69, 0xb8, 0x95, 0xae, 0x48, 0xc0, 0x7c, 0xb1, - /* (2^239)P */ 0xcd, 0x7c, 0x4f, 0x3e, 0xea, 0xf3, 0x90, 0xcb, 0x12, 0x76, 0xd1, 0x17, 0xdc, 0x0d, 0x13, 0x0f, 0xfd, 0x4d, 0xb5, 0x1f, 0xe4, 0xdd, 0xf2, 0x4d, 0x58, 0xea, 0xa5, 0x66, 0x92, 0xcf, 0xe5, 0x54, 0xea, 0x9b, 0x35, 0x83, 0x1a, 0x44, 0x8e, 0x62, 0x73, 0x45, 0x98, 0xa3, 0x89, 0x95, 0x52, 0x93, 0x1a, 0x8d, 0x63, 0x0f, 0xc2, 0x57, 0x3c, 0xb1, - /* (2^240)P */ 0x72, 0xb4, 0xdf, 0x51, 0xb7, 0xf6, 0x52, 0xa2, 0x14, 0x56, 0xe5, 0x0a, 0x2e, 0x75, 0x81, 0x02, 0xee, 0x93, 0x48, 0x0a, 0x92, 0x4e, 0x0c, 0x0f, 0xdf, 0x09, 0x89, 0x99, 0xf6, 0xf9, 0x22, 0xa2, 0x32, 0xf8, 0xb0, 0x76, 0x0c, 0xb2, 0x4d, 0x6e, 0xbe, 0x83, 0x35, 0x61, 0x44, 0xd2, 0x58, 0xc7, 0xdd, 0x14, 0xcf, 0xc3, 0x4b, 0x7c, 0x07, 0xee, - /* (2^241)P */ 0x8b, 0x03, 0xee, 0xcb, 0xa7, 0x2e, 0x28, 0xbd, 0x97, 0xd1, 0x4c, 0x2b, 0xd1, 0x92, 0x67, 0x5b, 0x5a, 0x12, 0xbf, 0x29, 0x17, 0xfc, 0x50, 0x09, 0x74, 0x76, 0xa2, 0xd4, 0x82, 0xfd, 0x2c, 0x0c, 0x90, 0xf7, 0xe7, 0xe5, 0x9a, 0x2c, 0x16, 0x40, 0xb9, 0x6c, 0xd9, 0xe0, 0x22, 0x9e, 0xf8, 0xdd, 0x73, 0xe4, 0x7b, 0x9e, 0xbe, 0x4f, 0x66, 0x22, - /* (2^242)P */ 0xa4, 0x10, 0xbe, 0xb8, 0x83, 0x3a, 0x77, 0x8e, 0xea, 0x0a, 0xc4, 0x97, 0x3e, 0xb6, 0x6c, 0x81, 0xd7, 0x65, 0xd9, 0xf7, 0xae, 0xe6, 0xbe, 0xab, 0x59, 0x81, 0x29, 0x4b, 0xff, 0xe1, 0x0f, 0xc3, 0x2b, 0xad, 0x4b, 0xef, 0xc4, 0x50, 0x9f, 0x88, 0x31, 0xf2, 0xde, 0x80, 0xd6, 0xf4, 0x20, 0x9c, 0x77, 0x9b, 0xbe, 0xbe, 0x08, 0xf5, 0xf0, 0x95, - /* (2^243)P */ 0x0e, 0x7c, 0x7b, 0x7c, 0xb3, 0xd8, 0x83, 0xfc, 0x8c, 0x75, 0x51, 0x74, 0x1b, 0xe1, 0x6d, 0x11, 0x05, 0x46, 0x24, 0x0d, 0xa4, 0x2b, 0x32, 0xfd, 0x2c, 0x4e, 0x21, 0xdf, 0x39, 0x6b, 0x96, 0xfc, 0xff, 0x92, 0xfc, 0x35, 0x0d, 0x9a, 0x4b, 0xc0, 0x70, 0x46, 0x32, 0x7d, 0xc0, 0xc4, 0x04, 0xe0, 0x2d, 0x83, 0xa7, 0x00, 0xc7, 0xcb, 0xb4, 0x8f, - /* (2^244)P */ 0xa9, 0x5a, 0x7f, 0x0e, 0xdd, 0x2c, 0x85, 0xaa, 0x4d, 0xac, 0xde, 0xb3, 0xb6, 0xaf, 0xe6, 0xd1, 0x06, 0x7b, 0x2c, 0xa4, 0x01, 0x19, 0x22, 0x7d, 0x78, 0xf0, 0x3a, 0xea, 0x89, 0xfe, 0x21, 0x61, 0x6d, 0xb8, 0xfe, 0xa5, 0x2a, 0xab, 0x0d, 0x7b, 0x51, 0x39, 0xb6, 0xde, 0xbc, 0xf0, 0xc5, 0x48, 0xd7, 0x09, 0x82, 0x6e, 0x66, 0x75, 0xc5, 0xcd, - /* (2^245)P */ 0xee, 0xdf, 0x2b, 0x6c, 0xa8, 0xde, 0x61, 0xe1, 0x27, 0xfa, 0x2a, 0x0f, 0x68, 0xe7, 0x7a, 0x9b, 0x13, 0xe9, 0x56, 0xd2, 0x1c, 0x3d, 0x2f, 0x3c, 0x7a, 0xf6, 0x6f, 0x45, 0xee, 0xe8, 0xf4, 0xa0, 0xa6, 0xe8, 0xa5, 0x27, 0xee, 0xf2, 0x85, 0xa9, 0xd5, 0x0e, 0xa9, 0x26, 0x60, 0xfe, 0xee, 0xc7, 0x59, 0x99, 0x5e, 0xa3, 0xdf, 0x23, 0x36, 0xd5, - /* (2^246)P */ 0x15, 0x66, 0x6f, 0xd5, 0x78, 0xa4, 0x0a, 0xf7, 0xb1, 0xe8, 0x75, 0x6b, 0x48, 0x7d, 0xa6, 0x4d, 0x3d, 0x36, 0x9b, 0xc7, 0xcc, 0x68, 0x9a, 0xfe, 0x2f, 0x39, 0x2a, 0x51, 0x31, 0x39, 0x7d, 0x73, 0x6f, 0xc8, 0x74, 0x72, 0x6f, 0x6e, 0xda, 0x5f, 0xad, 0x48, 0xc8, 0x40, 0xe1, 0x06, 0x01, 0x36, 0xa1, 0x88, 0xc8, 0x99, 0x9c, 0xd1, 0x11, 0x8f, - /* (2^247)P */ 0xab, 0xc5, 0xcb, 0xcf, 0xbd, 0x73, 0x21, 0xd0, 0x82, 0xb1, 0x2e, 0x2d, 0xd4, 0x36, 0x1b, 0xed, 0xa9, 0x8a, 0x26, 0x79, 0xc4, 0x17, 0xae, 0xe5, 0x09, 0x0a, 0x0c, 0xa4, 0x21, 0xa0, 0x6e, 0xdd, 0x62, 0x8e, 0x44, 0x62, 0xcc, 0x50, 0xff, 0x93, 0xb3, 0x9a, 0x72, 0x8c, 0x3f, 0xa1, 0xa6, 0x4d, 0x87, 0xd5, 0x1c, 0x5a, 0xc0, 0x0b, 0x1a, 0xd6, - /* (2^248)P */ 0x67, 0x36, 0x6a, 0x1f, 0x96, 0xe5, 0x80, 0x20, 0xa9, 0xe8, 0x0b, 0x0e, 0x21, 0x29, 0x3f, 0xc8, 0x0a, 0x6d, 0x27, 0x47, 0xca, 0xd9, 0x05, 0x55, 0xbf, 0x11, 0xcf, 0x31, 0x7a, 0x37, 0xc7, 0x90, 0xa9, 0xf4, 0x07, 0x5e, 0xd5, 0xc3, 0x92, 0xaa, 0x95, 0xc8, 0x23, 0x2a, 0x53, 0x45, 0xe3, 0x3a, 0x24, 0xe9, 0x67, 0x97, 0x3a, 0x82, 0xf9, 0xa6, - /* (2^249)P */ 0x92, 0x9e, 0x6d, 0x82, 0x67, 0xe9, 0xf9, 0x17, 0x96, 0x2c, 0xa7, 0xd3, 0x89, 0xf9, 0xdb, 0xd8, 0x20, 0xc6, 0x2e, 0xec, 0x4a, 0x76, 0x64, 0xbf, 0x27, 0x40, 0xe2, 0xb4, 0xdf, 0x1f, 0xa0, 0xef, 0x07, 0x80, 0xfb, 0x8e, 0x12, 0xf8, 0xb8, 0xe1, 0xc6, 0xdf, 0x7c, 0x69, 0x35, 0x5a, 0xe1, 0x8e, 0x5d, 0x69, 0x84, 0x56, 0xb6, 0x31, 0x1c, 0x0b, - /* (2^250)P */ 0xd6, 0x94, 0x5c, 0xef, 0xbb, 0x46, 0x45, 0x44, 0x5b, 0xa1, 0xae, 0x03, 0x65, 0xdd, 0xb5, 0x66, 0x88, 0x35, 0x29, 0x95, 0x16, 0x54, 0xa6, 0xf5, 0xc9, 0x78, 0x34, 0xe6, 0x0f, 0xc4, 0x2b, 0x5b, 0x79, 0x51, 0x68, 0x48, 0x3a, 0x26, 0x87, 0x05, 0x70, 0xaf, 0x8b, 0xa6, 0xc7, 0x2e, 0xb3, 0xa9, 0x10, 0x01, 0xb0, 0xb9, 0x31, 0xfd, 0xdc, 0x80, - /* (2^251)P */ 0x25, 0xf2, 0xad, 0xd6, 0x75, 0xa3, 0x04, 0x05, 0x64, 0x8a, 0x97, 0x60, 0x27, 0x2a, 0xe5, 0x6d, 0xb0, 0x73, 0xf4, 0x07, 0x2a, 0x9d, 0xe9, 0x46, 0xb4, 0x1c, 0x51, 0xf8, 0x63, 0x98, 0x7e, 0xe5, 0x13, 0x51, 0xed, 0x98, 0x65, 0x98, 0x4f, 0x8f, 0xe7, 0x7e, 0x72, 0xd7, 0x64, 0x11, 0x2f, 0xcd, 0x12, 0xf8, 0xc4, 0x63, 0x52, 0x0f, 0x7f, 0xc4, - /* (2^252)P */ 0x5c, 0xd9, 0x85, 0x63, 0xc7, 0x8a, 0x65, 0x9a, 0x25, 0x83, 0x31, 0x73, 0x49, 0xf0, 0x93, 0x96, 0x70, 0x67, 0x6d, 0xb1, 0xff, 0x95, 0x54, 0xe4, 0xf8, 0x15, 0x6c, 0x5f, 0xbd, 0xf6, 0x0f, 0x38, 0x7b, 0x68, 0x7d, 0xd9, 0x3d, 0xf0, 0xa9, 0xa0, 0xe4, 0xd1, 0xb6, 0x34, 0x6d, 0x14, 0x16, 0xc2, 0x4c, 0x30, 0x0e, 0x67, 0xd3, 0xbe, 0x2e, 0xc0, - /* (2^253)P */ 0x06, 0x6b, 0x52, 0xc8, 0x14, 0xcd, 0xae, 0x03, 0x93, 0xea, 0xc1, 0xf2, 0xf6, 0x8b, 0xc5, 0xb6, 0xdc, 0x82, 0x42, 0x29, 0x94, 0xe0, 0x25, 0x6c, 0x3f, 0x9f, 0x5d, 0xe4, 0x96, 0xf6, 0x8e, 0x3f, 0xf9, 0x72, 0xc4, 0x77, 0x60, 0x8b, 0xa4, 0xf9, 0xa8, 0xc3, 0x0a, 0x81, 0xb1, 0x97, 0x70, 0x18, 0xab, 0xea, 0x37, 0x8a, 0x08, 0xc7, 0xe2, 0x95, - /* (2^254)P */ 0x94, 0x49, 0xd9, 0x5f, 0x76, 0x72, 0x82, 0xad, 0x2d, 0x50, 0x1a, 0x7a, 0x5b, 0xe6, 0x95, 0x1e, 0x95, 0x65, 0x87, 0x1c, 0x52, 0xd7, 0x44, 0xe6, 0x9b, 0x56, 0xcd, 0x6f, 0x05, 0xff, 0x67, 0xc5, 0xdb, 0xa2, 0xac, 0xe4, 0xa2, 0x28, 0x63, 0x5f, 0xfb, 0x0c, 0x3b, 0xf1, 0x87, 0xc3, 0x36, 0x78, 0x3f, 0x77, 0xfa, 0x50, 0x85, 0xf9, 0xd7, 0x82, - /* (2^255)P */ 0x64, 0xc0, 0xe0, 0xd8, 0x2d, 0xed, 0xcb, 0x6a, 0xfd, 0xcd, 0xbc, 0x7e, 0x9f, 0xc8, 0x85, 0xe9, 0xc1, 0x7c, 0x0f, 0xe5, 0x18, 0xea, 0xd4, 0x51, 0xad, 0x59, 0x13, 0x75, 0xd9, 0x3d, 0xd4, 0x8a, 0xb2, 0xbe, 0x78, 0x52, 0x2b, 0x52, 0x94, 0x37, 0x41, 0xd6, 0xb4, 0xb6, 0x45, 0x20, 0x76, 0xe0, 0x1f, 0x31, 0xdb, 0xb1, 0xa1, 0x43, 0xf0, 0x18, - /* (2^256)P */ 0x74, 0xa9, 0xa4, 0xa9, 0xdd, 0x6e, 0x3e, 0x68, 0xe5, 0xc3, 0x2e, 0x92, 0x17, 0xa4, 0xcb, 0x80, 0xb1, 0xf0, 0x06, 0x93, 0xef, 0xe6, 0x00, 0xe6, 0x3b, 0xb1, 0x32, 0x65, 0x7b, 0x83, 0xb6, 0x8a, 0x49, 0x1b, 0x14, 0x89, 0xee, 0xba, 0xf5, 0x6a, 0x8d, 0x36, 0xef, 0xb0, 0xd8, 0xb2, 0x16, 0x99, 0x17, 0x35, 0x02, 0x16, 0x55, 0x58, 0xdd, 0x82, - /* (2^257)P */ 0x36, 0x95, 0xe8, 0xf4, 0x36, 0x42, 0xbb, 0xc5, 0x3e, 0xfa, 0x30, 0x84, 0x9e, 0x59, 0xfd, 0xd2, 0x95, 0x42, 0xf8, 0x64, 0xd9, 0xb9, 0x0e, 0x9f, 0xfa, 0xd0, 0x7b, 0x20, 0x31, 0x77, 0x48, 0x29, 0x4d, 0xd0, 0x32, 0x57, 0x56, 0x30, 0xa6, 0x17, 0x53, 0x04, 0xbf, 0x08, 0x28, 0xec, 0xb8, 0x46, 0xc1, 0x03, 0x89, 0xdc, 0xed, 0xa0, 0x35, 0x53, - /* (2^258)P */ 0xc5, 0x7f, 0x9e, 0xd8, 0xc5, 0xba, 0x5f, 0x68, 0xc8, 0x23, 0x75, 0xea, 0x0d, 0xd9, 0x5a, 0xfd, 0x61, 0x1a, 0xa3, 0x2e, 0x45, 0x63, 0x14, 0x55, 0x86, 0x21, 0x29, 0xbe, 0xef, 0x5e, 0x50, 0xe5, 0x18, 0x59, 0xe7, 0xe3, 0xce, 0x4d, 0x8c, 0x15, 0x8f, 0x89, 0x66, 0x44, 0x52, 0x3d, 0xfa, 0xc7, 0x9a, 0x59, 0x90, 0x8e, 0xc0, 0x06, 0x3f, 0xc9, - /* (2^259)P */ 0x8e, 0x04, 0xd9, 0x16, 0x50, 0x1d, 0x8c, 0x9f, 0xd5, 0xe3, 0xce, 0xfd, 0x47, 0x04, 0x27, 0x4d, 0xc2, 0xfa, 0x71, 0xd9, 0x0b, 0xb8, 0x65, 0xf4, 0x11, 0xf3, 0x08, 0xee, 0x81, 0xc8, 0x67, 0x99, 0x0b, 0x8d, 0x77, 0xa3, 0x4f, 0xb5, 0x9b, 0xdb, 0x26, 0xf1, 0x97, 0xeb, 0x04, 0x54, 0xeb, 0x80, 0x08, 0x1d, 0x1d, 0xf6, 0x3d, 0x1f, 0x5a, 0xb8, - /* (2^260)P */ 0xb7, 0x9c, 0x9d, 0xee, 0xb9, 0x5c, 0xad, 0x0d, 0x9e, 0xfd, 0x60, 0x3c, 0x27, 0x4e, 0xa2, 0x95, 0xfb, 0x64, 0x7e, 0x79, 0x64, 0x87, 0x10, 0xb4, 0x73, 0xe0, 0x9d, 0x46, 0x4d, 0x3d, 0xee, 0x83, 0xe4, 0x16, 0x88, 0x97, 0xe6, 0x4d, 0xba, 0x70, 0xb6, 0x96, 0x7b, 0xff, 0x4b, 0xc8, 0xcf, 0x72, 0x83, 0x3e, 0x5b, 0x24, 0x2e, 0x57, 0xf1, 0x82, - /* (2^261)P */ 0x30, 0x71, 0x40, 0x51, 0x4f, 0x44, 0xbb, 0xc7, 0xf0, 0x54, 0x6e, 0x9d, 0xeb, 0x15, 0xad, 0xf8, 0x61, 0x43, 0x5a, 0xef, 0xc0, 0xb1, 0x57, 0xae, 0x03, 0x40, 0xe8, 0x68, 0x6f, 0x03, 0x20, 0x4f, 0x8a, 0x51, 0x2a, 0x9e, 0xd2, 0x45, 0xaf, 0xb4, 0xf5, 0xd4, 0x95, 0x7f, 0x3d, 0x3d, 0xb7, 0xb6, 0x28, 0xc5, 0x08, 0x8b, 0x44, 0xd6, 0x3f, 0xe7, - /* (2^262)P */ 0xa9, 0x52, 0x04, 0x67, 0xcb, 0x20, 0x63, 0xf8, 0x18, 0x01, 0x44, 0x21, 0x6a, 0x8a, 0x83, 0x48, 0xd4, 0xaf, 0x23, 0x0f, 0x35, 0x8d, 0xe5, 0x5a, 0xc4, 0x7c, 0x55, 0x46, 0x19, 0x5f, 0x35, 0xe0, 0x5d, 0x97, 0x4c, 0x2d, 0x04, 0xed, 0x59, 0xd4, 0xb0, 0xb2, 0xc6, 0xe3, 0x51, 0xe1, 0x38, 0xc6, 0x30, 0x49, 0x8f, 0xae, 0x61, 0x64, 0xce, 0xa8, - /* (2^263)P */ 0x9b, 0x64, 0x83, 0x3c, 0xd3, 0xdf, 0xb9, 0x27, 0xe7, 0x5b, 0x7f, 0xeb, 0xf3, 0x26, 0xcf, 0xb1, 0x8f, 0xaf, 0x26, 0xc8, 0x48, 0xce, 0xa1, 0xac, 0x7d, 0x10, 0x34, 0x28, 0xe1, 0x1f, 0x69, 0x03, 0x64, 0x77, 0x61, 0xdd, 0x4a, 0x9b, 0x18, 0x47, 0xf8, 0xca, 0x63, 0xc9, 0x03, 0x2d, 0x20, 0x2a, 0x69, 0x6e, 0x42, 0xd0, 0xe7, 0xaa, 0xb5, 0xf3, - /* (2^264)P */ 0xea, 0x31, 0x0c, 0x57, 0x0f, 0x3e, 0xe3, 0x35, 0xd8, 0x30, 0xa5, 0x6f, 0xdd, 0x95, 0x43, 0xc6, 0x66, 0x07, 0x4f, 0x34, 0xc3, 0x7e, 0x04, 0x10, 0x2d, 0xc4, 0x1c, 0x94, 0x52, 0x2e, 0x5b, 0x9a, 0x65, 0x2f, 0x91, 0xaa, 0x4f, 0x3c, 0xdc, 0x23, 0x18, 0xe1, 0x4f, 0x85, 0xcd, 0xf4, 0x8c, 0x51, 0xf7, 0xab, 0x4f, 0xdc, 0x15, 0x5c, 0x9e, 0xc5, - /* (2^265)P */ 0x54, 0x57, 0x23, 0x17, 0xe7, 0x82, 0x2f, 0x04, 0x7d, 0xfe, 0xe7, 0x1f, 0xa2, 0x57, 0x79, 0xe9, 0x58, 0x9b, 0xbe, 0xc6, 0x16, 0x4a, 0x17, 0x50, 0x90, 0x4a, 0x34, 0x70, 0x87, 0x37, 0x01, 0x26, 0xd8, 0xa3, 0x5f, 0x07, 0x7c, 0xd0, 0x7d, 0x05, 0x8a, 0x93, 0x51, 0x2f, 0x99, 0xea, 0xcf, 0x00, 0xd8, 0xc7, 0xe6, 0x9b, 0x8c, 0x62, 0x45, 0x87, - /* (2^266)P */ 0xc3, 0xfd, 0x29, 0x66, 0xe7, 0x30, 0x29, 0x77, 0xe0, 0x0d, 0x63, 0x5b, 0xe6, 0x90, 0x1a, 0x1e, 0x99, 0xc2, 0xa7, 0xab, 0xff, 0xa7, 0xbd, 0x79, 0x01, 0x97, 0xfd, 0x27, 0x1b, 0x43, 0x2b, 0xe6, 0xfe, 0x5e, 0xf1, 0xb9, 0x35, 0x38, 0x08, 0x25, 0x55, 0x90, 0x68, 0x2e, 0xc3, 0x67, 0x39, 0x9f, 0x2b, 0x2c, 0x70, 0x48, 0x8c, 0x47, 0xee, 0x56, - /* (2^267)P */ 0xf7, 0x32, 0x70, 0xb5, 0xe6, 0x42, 0xfd, 0x0a, 0x39, 0x9b, 0x07, 0xfe, 0x0e, 0xf4, 0x47, 0xba, 0x6a, 0x3f, 0xf5, 0x2c, 0x15, 0xf3, 0x60, 0x3f, 0xb1, 0x83, 0x7b, 0x2e, 0x34, 0x58, 0x1a, 0x6e, 0x4a, 0x49, 0x05, 0x45, 0xca, 0xdb, 0x00, 0x01, 0x0c, 0x42, 0x5e, 0x60, 0x40, 0x5f, 0xd9, 0xc7, 0x3a, 0x9e, 0x1c, 0x8d, 0xab, 0x11, 0x55, 0x65, - /* (2^268)P */ 0x87, 0x40, 0xb7, 0x0d, 0xaa, 0x34, 0x89, 0x90, 0x75, 0x6d, 0xa2, 0xfe, 0x3b, 0x6d, 0x5c, 0x39, 0x98, 0x10, 0x9e, 0x15, 0xc5, 0x35, 0xa2, 0x27, 0x23, 0x0a, 0x2d, 0x60, 0xe2, 0xa8, 0x7f, 0x3e, 0x77, 0x8f, 0xcc, 0x44, 0xcc, 0x30, 0x28, 0xe2, 0xf0, 0x04, 0x8c, 0xee, 0xe4, 0x5f, 0x68, 0x8c, 0xdf, 0x70, 0xbf, 0x31, 0xee, 0x2a, 0xfc, 0xce, - /* (2^269)P */ 0x92, 0xf2, 0xa0, 0xd9, 0x58, 0x3b, 0x7c, 0x1a, 0x99, 0x46, 0x59, 0x54, 0x60, 0x06, 0x8d, 0x5e, 0xf0, 0x22, 0xa1, 0xed, 0x92, 0x8a, 0x4d, 0x76, 0x95, 0x05, 0x0b, 0xff, 0xfc, 0x9a, 0xd1, 0xcc, 0x05, 0xb9, 0x5e, 0x99, 0xe8, 0x2a, 0x76, 0x7b, 0xfd, 0xa6, 0xe2, 0xd1, 0x1a, 0xd6, 0x76, 0x9f, 0x2f, 0x0e, 0xd1, 0xa8, 0x77, 0x5a, 0x40, 0x5a, - /* (2^270)P */ 0xff, 0xf9, 0x3f, 0xa9, 0xa6, 0x6c, 0x6d, 0x03, 0x8b, 0xa7, 0x10, 0x5d, 0x3f, 0xec, 0x3e, 0x1c, 0x0b, 0x6b, 0xa2, 0x6a, 0x22, 0xa9, 0x28, 0xd0, 0x66, 0xc9, 0xc2, 0x3d, 0x47, 0x20, 0x7d, 0xa6, 0x1d, 0xd8, 0x25, 0xb5, 0xf2, 0xf9, 0x70, 0x19, 0x6b, 0xf8, 0x43, 0x36, 0xc5, 0x1f, 0xe4, 0x5a, 0x4c, 0x13, 0xe4, 0x6d, 0x08, 0x0b, 0x1d, 0xb1, - /* (2^271)P */ 0x3f, 0x20, 0x9b, 0xfb, 0xec, 0x7d, 0x31, 0xc5, 0xfc, 0x88, 0x0b, 0x30, 0xed, 0x36, 0xc0, 0x63, 0xb1, 0x7d, 0x10, 0xda, 0xb6, 0x2e, 0xad, 0xf3, 0xec, 0x94, 0xe7, 0xec, 0xb5, 0x9c, 0xfe, 0xf5, 0x35, 0xf0, 0xa2, 0x2d, 0x7f, 0xca, 0x6b, 0x67, 0x1a, 0xf6, 0xb3, 0xda, 0x09, 0x2a, 0xaa, 0xdf, 0xb1, 0xca, 0x9b, 0xfb, 0xeb, 0xb3, 0xcd, 0xc0, - /* (2^272)P */ 0xcd, 0x4d, 0x89, 0x00, 0xa4, 0x3b, 0x48, 0xf0, 0x76, 0x91, 0x35, 0xa5, 0xf8, 0xc9, 0xb6, 0x46, 0xbc, 0xf6, 0x9a, 0x45, 0x47, 0x17, 0x96, 0x80, 0x5b, 0x3a, 0x28, 0x33, 0xf9, 0x5a, 0xef, 0x43, 0x07, 0xfe, 0x3b, 0xf4, 0x8e, 0x19, 0xce, 0xd2, 0x94, 0x4b, 0x6d, 0x8e, 0x67, 0x20, 0xc7, 0x4f, 0x2f, 0x59, 0x8e, 0xe1, 0xa1, 0xa9, 0xf9, 0x0e, - /* (2^273)P */ 0xdc, 0x7b, 0xb5, 0x50, 0x2e, 0xe9, 0x7e, 0x8b, 0x78, 0xa1, 0x38, 0x96, 0x22, 0xc3, 0x61, 0x67, 0x6d, 0xc8, 0x58, 0xed, 0x41, 0x1d, 0x5d, 0x86, 0x98, 0x7f, 0x2f, 0x1b, 0x8d, 0x3e, 0xaa, 0xc1, 0xd2, 0x0a, 0xf3, 0xbf, 0x95, 0x04, 0xf3, 0x10, 0x3c, 0x2b, 0x7f, 0x90, 0x46, 0x04, 0xaa, 0x6a, 0xa9, 0x35, 0x76, 0xac, 0x49, 0xb5, 0x00, 0x45, - /* (2^274)P */ 0xb1, 0x93, 0x79, 0x84, 0x4a, 0x2a, 0x30, 0x78, 0x16, 0xaa, 0xc5, 0x74, 0x06, 0xce, 0xa5, 0xa7, 0x32, 0x86, 0xe0, 0xf9, 0x10, 0xd2, 0x58, 0x76, 0xfb, 0x66, 0x49, 0x76, 0x3a, 0x90, 0xba, 0xb5, 0xcc, 0x99, 0xcd, 0x09, 0xc1, 0x9a, 0x74, 0x23, 0xdf, 0x0c, 0xfe, 0x99, 0x52, 0x80, 0xa3, 0x7c, 0x1c, 0x71, 0x5f, 0x2c, 0x49, 0x57, 0xf4, 0xf9, - /* (2^275)P */ 0x6d, 0xbf, 0x52, 0xe6, 0x25, 0x98, 0xed, 0xcf, 0xe3, 0xbc, 0x08, 0xa2, 0x1a, 0x90, 0xae, 0xa0, 0xbf, 0x07, 0x15, 0xad, 0x0a, 0x9f, 0x3e, 0x47, 0x44, 0xc2, 0x10, 0x46, 0xa6, 0x7a, 0x9e, 0x2f, 0x57, 0xbc, 0xe2, 0xf0, 0x1d, 0xd6, 0x9a, 0x06, 0xed, 0xfc, 0x54, 0x95, 0x92, 0x15, 0xa2, 0xf7, 0x8d, 0x6b, 0xef, 0xb2, 0x05, 0xed, 0x5c, 0x63, - /* (2^276)P */ 0xbc, 0x0b, 0x27, 0x3a, 0x3a, 0xf8, 0xe1, 0x48, 0x02, 0x7e, 0x27, 0xe6, 0x81, 0x62, 0x07, 0x73, 0x74, 0xe5, 0x52, 0xd7, 0xf8, 0x26, 0xca, 0x93, 0x4d, 0x3e, 0x9b, 0x55, 0x09, 0x8e, 0xe3, 0xd7, 0xa6, 0xe3, 0xb6, 0x2a, 0xa9, 0xb3, 0xb0, 0xa0, 0x8c, 0x01, 0xbb, 0x07, 0x90, 0x78, 0x6d, 0x6d, 0xe9, 0xf0, 0x7a, 0x90, 0xbd, 0xdc, 0x0c, 0x36, - /* (2^277)P */ 0x7f, 0x20, 0x12, 0x0f, 0x40, 0x00, 0x53, 0xd8, 0x0c, 0x27, 0x47, 0x47, 0x22, 0x80, 0xfb, 0x62, 0xe4, 0xa7, 0xf7, 0xbd, 0x42, 0xa5, 0xc3, 0x2b, 0xb2, 0x7f, 0x50, 0xcc, 0xe2, 0xfb, 0xd5, 0xc0, 0x63, 0xdd, 0x24, 0x5f, 0x7c, 0x08, 0x91, 0xbf, 0x6e, 0x47, 0x44, 0xd4, 0x6a, 0xc0, 0xc3, 0x09, 0x39, 0x27, 0xdd, 0xc7, 0xca, 0x06, 0x29, 0x55, - /* (2^278)P */ 0x76, 0x28, 0x58, 0xb0, 0xd2, 0xf3, 0x0f, 0x04, 0xe9, 0xc9, 0xab, 0x66, 0x5b, 0x75, 0x51, 0xdc, 0xe5, 0x8f, 0xe8, 0x1f, 0xdb, 0x03, 0x0f, 0xb0, 0x7d, 0xf9, 0x20, 0x64, 0x89, 0xe9, 0xdc, 0xe6, 0x24, 0xc3, 0xd5, 0xd2, 0x41, 0xa6, 0xe4, 0xe3, 0xc4, 0x79, 0x7c, 0x0f, 0xa1, 0x61, 0x2f, 0xda, 0xa4, 0xc9, 0xfd, 0xad, 0x5c, 0x65, 0x6a, 0xf3, - /* (2^279)P */ 0xd5, 0xab, 0x72, 0x7a, 0x3b, 0x59, 0xea, 0xcf, 0xd5, 0x17, 0xd2, 0xb2, 0x5f, 0x2d, 0xab, 0xad, 0x9e, 0x88, 0x64, 0x55, 0x96, 0x6e, 0xf3, 0x44, 0xa9, 0x11, 0xf5, 0xf8, 0x3a, 0xf1, 0xcd, 0x79, 0x4c, 0x99, 0x6d, 0x23, 0x6a, 0xa0, 0xc2, 0x1a, 0x19, 0x45, 0xb5, 0xd8, 0x95, 0x2f, 0x49, 0xe9, 0x46, 0x39, 0x26, 0x60, 0x04, 0x15, 0x8b, 0xcc, - /* (2^280)P */ 0x66, 0x0c, 0xf0, 0x54, 0x41, 0x02, 0x91, 0xab, 0xe5, 0x85, 0x8a, 0x44, 0xa6, 0x34, 0x96, 0x32, 0xc0, 0xdf, 0x6c, 0x41, 0x39, 0xd4, 0xc6, 0xe1, 0xe3, 0x81, 0xb0, 0x4c, 0x34, 0x4f, 0xe5, 0xf4, 0x35, 0x46, 0x1f, 0xeb, 0x75, 0xfd, 0x43, 0x37, 0x50, 0x99, 0xab, 0xad, 0xb7, 0x8c, 0xa1, 0x57, 0xcb, 0xe6, 0xce, 0x16, 0x2e, 0x85, 0xcc, 0xf9, - /* (2^281)P */ 0x63, 0xd1, 0x3f, 0x9e, 0xa2, 0x17, 0x2e, 0x1d, 0x3e, 0xce, 0x48, 0x2d, 0xbb, 0x8f, 0x69, 0xc9, 0xa6, 0x3d, 0x4e, 0xfe, 0x09, 0x56, 0xb3, 0x02, 0x5f, 0x99, 0x97, 0x0c, 0x54, 0xda, 0x32, 0x97, 0x9b, 0xf4, 0x95, 0xf1, 0xad, 0xe3, 0x2b, 0x04, 0xa7, 0x9b, 0x3f, 0xbb, 0xe7, 0x87, 0x2e, 0x1f, 0x8b, 0x4b, 0x7a, 0xa4, 0x43, 0x0c, 0x0f, 0x35, - /* (2^282)P */ 0x05, 0xdc, 0xe0, 0x2c, 0xa1, 0xc1, 0xd0, 0xf1, 0x1f, 0x4e, 0xc0, 0x6c, 0x35, 0x7b, 0xca, 0x8f, 0x8b, 0x02, 0xb1, 0xf7, 0xd6, 0x2e, 0xe7, 0x93, 0x80, 0x85, 0x18, 0x88, 0x19, 0xb9, 0xb4, 0x4a, 0xbc, 0xeb, 0x5a, 0x78, 0x38, 0xed, 0xc6, 0x27, 0x2a, 0x74, 0x76, 0xf0, 0x1b, 0x79, 0x92, 0x2f, 0xd2, 0x81, 0x98, 0xdf, 0xa9, 0x50, 0x19, 0xeb, - /* (2^283)P */ 0xb5, 0xe7, 0xb4, 0x11, 0x3a, 0x81, 0xb6, 0xb4, 0xf8, 0xa2, 0xb3, 0x6c, 0xfc, 0x9d, 0xe0, 0xc0, 0xe0, 0x59, 0x7f, 0x05, 0x37, 0xef, 0x2c, 0xa9, 0x3a, 0x24, 0xac, 0x7b, 0x25, 0xa0, 0x55, 0xd2, 0x44, 0x82, 0x82, 0x6e, 0x64, 0xa3, 0x58, 0xc8, 0x67, 0xae, 0x26, 0xa7, 0x0f, 0x42, 0x63, 0xe1, 0x93, 0x01, 0x52, 0x19, 0xaf, 0x49, 0x3e, 0x33, - /* (2^284)P */ 0x05, 0x85, 0xe6, 0x66, 0xaf, 0x5f, 0xdf, 0xbf, 0x9d, 0x24, 0x62, 0x60, 0x90, 0xe2, 0x4c, 0x7d, 0x4e, 0xc3, 0x74, 0x5d, 0x4f, 0x53, 0xf3, 0x63, 0x13, 0xf4, 0x74, 0x28, 0x6b, 0x7d, 0x57, 0x0c, 0x9d, 0x84, 0xa7, 0x1a, 0xff, 0xa0, 0x79, 0xdf, 0xfc, 0x65, 0x98, 0x8e, 0x22, 0x0d, 0x62, 0x7e, 0xf2, 0x34, 0x60, 0x83, 0x05, 0x14, 0xb1, 0xc1, - /* (2^285)P */ 0x64, 0x22, 0xcc, 0xdf, 0x5c, 0xbc, 0x88, 0x68, 0x4c, 0xd9, 0xbc, 0x0e, 0xc9, 0x8b, 0xb4, 0x23, 0x52, 0xad, 0xb0, 0xb3, 0xf1, 0x17, 0xd8, 0x15, 0x04, 0x6b, 0x99, 0xf0, 0xc4, 0x7d, 0x48, 0x22, 0x4a, 0xf8, 0x6f, 0xaa, 0x88, 0x0d, 0xc5, 0x5e, 0xa9, 0x1c, 0x61, 0x3d, 0x95, 0xa9, 0x7b, 0x6a, 0x79, 0x33, 0x0a, 0x2b, 0x99, 0xe3, 0x4e, 0x48, - /* (2^286)P */ 0x6b, 0x9b, 0x6a, 0x2a, 0xf1, 0x60, 0x31, 0xb4, 0x73, 0xd1, 0x87, 0x45, 0x9c, 0x15, 0x58, 0x4b, 0x91, 0x6d, 0x94, 0x1c, 0x41, 0x11, 0x4a, 0x83, 0xec, 0xaf, 0x65, 0xbc, 0x34, 0xaa, 0x26, 0xe2, 0xaf, 0xed, 0x46, 0x05, 0x4e, 0xdb, 0xc6, 0x4e, 0x10, 0x28, 0x4e, 0x72, 0xe5, 0x31, 0xa3, 0x20, 0xd7, 0xb1, 0x96, 0x64, 0xf6, 0xce, 0x08, 0x08, - /* (2^287)P */ 0x16, 0xa9, 0x5c, 0x9f, 0x9a, 0xb4, 0xb8, 0xc8, 0x32, 0x78, 0xc0, 0x3a, 0xd9, 0x5f, 0x94, 0xac, 0x3a, 0x42, 0x1f, 0x43, 0xd6, 0x80, 0x47, 0x2c, 0xdc, 0x76, 0x27, 0xfa, 0x50, 0xe5, 0xa1, 0xe4, 0xc3, 0xcb, 0x61, 0x31, 0xe1, 0x2e, 0xde, 0x81, 0x3b, 0x77, 0x1c, 0x39, 0x3c, 0xdb, 0xda, 0x87, 0x4b, 0x84, 0x12, 0xeb, 0xdd, 0x54, 0xbf, 0xe7, - /* (2^288)P */ 0xbf, 0xcb, 0x73, 0x21, 0x3d, 0x7e, 0x13, 0x8c, 0xa6, 0x34, 0x21, 0x2b, 0xa5, 0xe4, 0x9f, 0x8e, 0x9c, 0x01, 0x9c, 0x43, 0xd9, 0xc7, 0xb9, 0xf1, 0xbe, 0x7f, 0x45, 0x51, 0x97, 0xa1, 0x8e, 0x01, 0xf8, 0xbd, 0xd2, 0xbf, 0x81, 0x3a, 0x8b, 0xab, 0xe4, 0x89, 0xb7, 0xbd, 0xf2, 0xcd, 0xa9, 0x8a, 0x8a, 0xde, 0xfb, 0x8a, 0x55, 0x12, 0x7b, 0x17, - /* (2^289)P */ 0x1b, 0x95, 0x58, 0x4d, 0xe6, 0x51, 0x31, 0x52, 0x1c, 0xd8, 0x15, 0x84, 0xb1, 0x0d, 0x36, 0x25, 0x88, 0x91, 0x46, 0x71, 0x42, 0x56, 0xe2, 0x90, 0x08, 0x9e, 0x77, 0x1b, 0xee, 0x22, 0x3f, 0xec, 0xee, 0x8c, 0x7b, 0x2e, 0x79, 0xc4, 0x6c, 0x07, 0xa1, 0x7e, 0x52, 0xf5, 0x26, 0x5c, 0x84, 0x2a, 0x50, 0x6e, 0x82, 0xb3, 0x76, 0xda, 0x35, 0x16, - /* (2^290)P */ 0x0a, 0x6f, 0x99, 0x87, 0xc0, 0x7d, 0x8a, 0xb2, 0xca, 0xae, 0xe8, 0x65, 0x98, 0x0f, 0xb3, 0x44, 0xe1, 0xdc, 0x52, 0x79, 0x75, 0xec, 0x8f, 0x95, 0x87, 0x45, 0xd1, 0x32, 0x18, 0x55, 0x15, 0xce, 0x64, 0x9b, 0x08, 0x4f, 0x2c, 0xea, 0xba, 0x1c, 0x57, 0x06, 0x63, 0xc8, 0xb1, 0xfd, 0xc5, 0x67, 0xe7, 0x1f, 0x87, 0x9e, 0xde, 0x72, 0x7d, 0xec, - /* (2^291)P */ 0x36, 0x8b, 0x4d, 0x2c, 0xc2, 0x46, 0xe8, 0x96, 0xac, 0x0b, 0x8c, 0xc5, 0x09, 0x10, 0xfc, 0xf2, 0xda, 0xea, 0x22, 0xb2, 0xd3, 0x89, 0xeb, 0xb2, 0x85, 0x0f, 0xff, 0x59, 0x50, 0x2c, 0x99, 0x5a, 0x1f, 0xec, 0x2a, 0x6f, 0xec, 0xcf, 0xe9, 0xce, 0x12, 0x6b, 0x19, 0xd8, 0xde, 0x9b, 0xce, 0x0e, 0x6a, 0xaa, 0xe1, 0x32, 0xea, 0x4c, 0xfe, 0x92, - /* (2^292)P */ 0x5f, 0x17, 0x70, 0x53, 0x26, 0x03, 0x0b, 0xab, 0xd1, 0xc1, 0x42, 0x0b, 0xab, 0x2b, 0x3d, 0x31, 0xa4, 0xd5, 0x2b, 0x5e, 0x00, 0xd5, 0x9a, 0x22, 0x34, 0xe0, 0x53, 0x3f, 0x59, 0x7f, 0x2c, 0x6d, 0x72, 0x9a, 0xa4, 0xbe, 0x3d, 0x42, 0x05, 0x1b, 0xf2, 0x7f, 0x88, 0x56, 0xd1, 0x7c, 0x7d, 0x6b, 0x9f, 0x43, 0xfe, 0x65, 0x19, 0xae, 0x9c, 0x4c, - /* (2^293)P */ 0xf3, 0x7c, 0x20, 0xa9, 0xfc, 0xf2, 0xf2, 0x3b, 0x3c, 0x57, 0x41, 0x94, 0xe5, 0xcc, 0x6a, 0x37, 0x5d, 0x09, 0xf2, 0xab, 0xc2, 0xca, 0x60, 0x38, 0x6b, 0x7a, 0xe1, 0x78, 0x2b, 0xc1, 0x1d, 0xe8, 0xfd, 0xbc, 0x3d, 0x5c, 0xa2, 0xdb, 0x49, 0x20, 0x79, 0xe6, 0x1b, 0x9b, 0x65, 0xd9, 0x6d, 0xec, 0x57, 0x1d, 0xd2, 0xe9, 0x90, 0xeb, 0x43, 0x7b, - /* (2^294)P */ 0x2a, 0x8b, 0x2e, 0x19, 0x18, 0x10, 0xb8, 0x83, 0xe7, 0x7d, 0x2d, 0x9a, 0x3a, 0xe5, 0xd1, 0xe4, 0x7c, 0x38, 0xe5, 0x59, 0x2a, 0x6e, 0xd9, 0x01, 0x29, 0x3d, 0x23, 0xf7, 0x52, 0xba, 0x61, 0x04, 0x9a, 0xde, 0xc4, 0x31, 0x50, 0xeb, 0x1b, 0xaa, 0xde, 0x39, 0x58, 0xd8, 0x1b, 0x1e, 0xfc, 0x57, 0x9a, 0x28, 0x43, 0x9e, 0x97, 0x5e, 0xaa, 0xa3, - /* (2^295)P */ 0x97, 0x0a, 0x74, 0xc4, 0x39, 0x99, 0x6b, 0x40, 0xc7, 0x3e, 0x8c, 0xa7, 0xb1, 0x4e, 0x9a, 0x59, 0x6e, 0x1c, 0xfe, 0xfc, 0x2a, 0x5e, 0x73, 0x2b, 0x8c, 0xa9, 0x71, 0xf5, 0xda, 0x6b, 0x15, 0xab, 0xf7, 0xbe, 0x2a, 0x44, 0x5f, 0xba, 0xae, 0x67, 0x93, 0xc5, 0x86, 0xc1, 0xb8, 0xdf, 0xdc, 0xcb, 0xd7, 0xff, 0xb1, 0x71, 0x7c, 0x6f, 0x88, 0xf8, - /* (2^296)P */ 0x3f, 0x89, 0xb1, 0xbf, 0x24, 0x16, 0xac, 0x56, 0xfe, 0xdf, 0x94, 0x71, 0xbf, 0xd6, 0x57, 0x0c, 0xb4, 0x77, 0x37, 0xaa, 0x2a, 0x70, 0x76, 0x49, 0xaf, 0x0c, 0x97, 0x8e, 0x78, 0x2a, 0x67, 0xc9, 0x3b, 0x3d, 0x5b, 0x01, 0x2f, 0xda, 0xd5, 0xa8, 0xde, 0x02, 0xa9, 0xac, 0x76, 0x00, 0x0b, 0x46, 0xc6, 0x2d, 0xdc, 0x08, 0xf4, 0x10, 0x2c, 0xbe, - /* (2^297)P */ 0xcb, 0x07, 0xf9, 0x91, 0xc6, 0xd5, 0x3e, 0x54, 0x63, 0xae, 0xfc, 0x10, 0xbe, 0x3a, 0x20, 0x73, 0x4e, 0x65, 0x0e, 0x2d, 0x86, 0x77, 0x83, 0x9d, 0xe2, 0x0a, 0xe9, 0xac, 0x22, 0x52, 0x76, 0xd4, 0x6e, 0xfa, 0xe0, 0x09, 0xef, 0x78, 0x82, 0x9f, 0x26, 0xf9, 0x06, 0xb5, 0xe7, 0x05, 0x0e, 0xf2, 0x46, 0x72, 0x93, 0xd3, 0x24, 0xbd, 0x87, 0x60, - /* (2^298)P */ 0x14, 0x55, 0x84, 0x7b, 0x6c, 0x60, 0x80, 0x73, 0x8c, 0xbe, 0x2d, 0xd6, 0x69, 0xd6, 0x17, 0x26, 0x44, 0x9f, 0x88, 0xa2, 0x39, 0x7c, 0x89, 0xbc, 0x6d, 0x9e, 0x46, 0xb6, 0x68, 0x66, 0xea, 0xdc, 0x31, 0xd6, 0x21, 0x51, 0x9f, 0x28, 0x28, 0xaf, 0x9e, 0x47, 0x2c, 0x4c, 0x8f, 0xf3, 0xaf, 0x1f, 0xe4, 0xab, 0xac, 0xe9, 0x0c, 0x91, 0x3a, 0x61, - /* (2^299)P */ 0xb0, 0x37, 0x55, 0x4b, 0xe9, 0xc3, 0xb1, 0xce, 0x42, 0xe6, 0xc5, 0x11, 0x7f, 0x2c, 0x11, 0xfc, 0x4e, 0x71, 0x17, 0x00, 0x74, 0x7f, 0xbf, 0x07, 0x4d, 0xfd, 0x40, 0xb2, 0x87, 0xb0, 0xef, 0x1f, 0x35, 0x2c, 0x2d, 0xd7, 0xe1, 0xe4, 0xad, 0x0e, 0x7f, 0x63, 0x66, 0x62, 0x23, 0x41, 0xf6, 0xc1, 0x14, 0xa6, 0xd7, 0xa9, 0x11, 0x56, 0x9d, 0x1b, - /* (2^300)P */ 0x02, 0x82, 0x42, 0x18, 0x4f, 0x1b, 0xc9, 0x5d, 0x78, 0x5f, 0xee, 0xed, 0x01, 0x49, 0x8f, 0xf2, 0xa0, 0xe2, 0x6e, 0xbb, 0x6b, 0x04, 0x8d, 0xb2, 0x41, 0xae, 0xc8, 0x1b, 0x59, 0x34, 0xb8, 0x2a, 0xdb, 0x1f, 0xd2, 0x52, 0xdf, 0x3f, 0x35, 0x00, 0x8b, 0x61, 0xbc, 0x97, 0xa0, 0xc4, 0x77, 0xd1, 0xe4, 0x2c, 0x59, 0x68, 0xff, 0x30, 0xf2, 0xe2, - /* (2^301)P */ 0x79, 0x08, 0xb1, 0xdb, 0x55, 0xae, 0xd0, 0xed, 0xda, 0xa0, 0xec, 0x6c, 0xae, 0x68, 0xf2, 0x0b, 0x61, 0xb3, 0xf5, 0x21, 0x69, 0x87, 0x0b, 0x03, 0xea, 0x8a, 0x15, 0xd9, 0x7e, 0xca, 0xf7, 0xcd, 0xf3, 0x33, 0xb3, 0x4c, 0x5b, 0x23, 0x4e, 0x6f, 0x90, 0xad, 0x91, 0x4b, 0x4f, 0x46, 0x37, 0xe5, 0xe8, 0xb7, 0xeb, 0xd5, 0xca, 0x34, 0x4e, 0x23, - /* (2^302)P */ 0x09, 0x02, 0xdd, 0xfd, 0x70, 0xac, 0x56, 0x80, 0x36, 0x5e, 0x49, 0xd0, 0x3f, 0xc2, 0xe0, 0xba, 0x46, 0x7f, 0x5c, 0xf7, 0xc5, 0xbd, 0xd5, 0x55, 0x7d, 0x3f, 0xd5, 0x7d, 0x06, 0xdf, 0x27, 0x20, 0x4f, 0xe9, 0x30, 0xec, 0x1b, 0xa0, 0x0c, 0xd4, 0x2c, 0xe1, 0x2b, 0x65, 0x73, 0xea, 0x75, 0x35, 0xe8, 0xe6, 0x56, 0xd6, 0x07, 0x15, 0x99, 0xdf, - /* (2^303)P */ 0x4e, 0x10, 0xb7, 0xd0, 0x63, 0x8c, 0xcf, 0x16, 0x00, 0x7c, 0x58, 0xdf, 0x86, 0xdc, 0x4e, 0xca, 0x9c, 0x40, 0x5a, 0x42, 0xfd, 0xec, 0x98, 0xa4, 0x42, 0x53, 0xae, 0x16, 0x9d, 0xfd, 0x75, 0x5a, 0x12, 0x56, 0x1e, 0xc6, 0x57, 0xcc, 0x79, 0x27, 0x96, 0x00, 0xcf, 0x80, 0x4f, 0x8a, 0x36, 0x5c, 0xbb, 0xe9, 0x12, 0xdb, 0xb6, 0x2b, 0xad, 0x96, - /* (2^304)P */ 0x92, 0x32, 0x1f, 0xfd, 0xc6, 0x02, 0x94, 0x08, 0x1b, 0x60, 0x6a, 0x9f, 0x8b, 0xd6, 0xc8, 0xad, 0xd5, 0x1b, 0x27, 0x4e, 0xa4, 0x4d, 0x4a, 0x00, 0x10, 0x5f, 0x86, 0x11, 0xf5, 0xe3, 0x14, 0x32, 0x43, 0xee, 0xb9, 0xc7, 0xab, 0xf4, 0x6f, 0xe5, 0x66, 0x0c, 0x06, 0x0d, 0x96, 0x79, 0x28, 0xaf, 0x45, 0x2b, 0x56, 0xbe, 0xe4, 0x4a, 0x52, 0xd6, - /* (2^305)P */ 0x15, 0x16, 0x69, 0xef, 0x60, 0xca, 0x82, 0x25, 0x0f, 0xc6, 0x30, 0xa0, 0x0a, 0xd1, 0x83, 0x29, 0xcd, 0xb6, 0x89, 0x6c, 0xf5, 0xb2, 0x08, 0x38, 0xe6, 0xca, 0x6b, 0x19, 0x93, 0xc6, 0x5f, 0x75, 0x8e, 0x60, 0x34, 0x23, 0xc4, 0x13, 0x17, 0x69, 0x55, 0xcc, 0x72, 0x9c, 0x2b, 0x6c, 0x80, 0xf4, 0x4b, 0x8b, 0xb6, 0x97, 0x65, 0x07, 0xb6, 0xfb, - /* (2^306)P */ 0x01, 0x99, 0x74, 0x28, 0xa6, 0x67, 0xa3, 0xe5, 0x25, 0xfb, 0xdf, 0x82, 0x93, 0xe7, 0x35, 0x74, 0xce, 0xe3, 0x15, 0x1c, 0x1d, 0x79, 0x52, 0x84, 0x08, 0x04, 0x2f, 0x5c, 0xb8, 0xcd, 0x7f, 0x89, 0xb0, 0x39, 0x93, 0x63, 0xc9, 0x5d, 0x06, 0x01, 0x59, 0xf7, 0x7e, 0xf1, 0x4c, 0x3d, 0x12, 0x8d, 0x69, 0x1d, 0xb7, 0x21, 0x5e, 0x88, 0x82, 0xa2, - /* (2^307)P */ 0x8e, 0x69, 0xaf, 0x9a, 0x41, 0x0d, 0x9d, 0xcf, 0x8e, 0x8d, 0x5c, 0x51, 0x6e, 0xde, 0x0e, 0x48, 0x23, 0x89, 0xe5, 0x37, 0x80, 0xd6, 0x9d, 0x72, 0x32, 0x26, 0x38, 0x2d, 0x63, 0xa0, 0xfa, 0xd3, 0x40, 0xc0, 0x8c, 0x68, 0x6f, 0x2b, 0x1e, 0x9a, 0x39, 0x51, 0x78, 0x74, 0x9a, 0x7b, 0x4a, 0x8f, 0x0c, 0xa0, 0x88, 0x60, 0xa5, 0x21, 0xcd, 0xc7, - /* (2^308)P */ 0x3a, 0x7f, 0x73, 0x14, 0xbf, 0x89, 0x6a, 0x4c, 0x09, 0x5d, 0xf2, 0x93, 0x20, 0x2d, 0xc4, 0x29, 0x86, 0x06, 0x95, 0xab, 0x22, 0x76, 0x4c, 0x54, 0xe1, 0x7e, 0x80, 0x6d, 0xab, 0x29, 0x61, 0x87, 0x77, 0xf6, 0xc0, 0x3e, 0xda, 0xab, 0x65, 0x7e, 0x39, 0x12, 0xa1, 0x6b, 0x42, 0xf7, 0xc5, 0x97, 0x77, 0xec, 0x6f, 0x22, 0xbe, 0x44, 0xc7, 0x03, - /* (2^309)P */ 0xa5, 0x23, 0x90, 0x41, 0xa3, 0xc5, 0x3e, 0xe0, 0xa5, 0x32, 0x49, 0x1f, 0x39, 0x78, 0xb1, 0xd8, 0x24, 0xea, 0xd4, 0x87, 0x53, 0x42, 0x51, 0xf4, 0xd9, 0x46, 0x25, 0x2f, 0x62, 0xa9, 0x90, 0x9a, 0x4a, 0x25, 0x8a, 0xd2, 0x10, 0xe7, 0x3c, 0xbc, 0x58, 0x8d, 0x16, 0x14, 0x96, 0xa4, 0x6f, 0xf8, 0x12, 0x69, 0x91, 0x73, 0xe2, 0xfa, 0xf4, 0x57, - /* (2^310)P */ 0x51, 0x45, 0x3f, 0x96, 0xdc, 0x97, 0x38, 0xa6, 0x01, 0x63, 0x09, 0xea, 0xc2, 0x13, 0x30, 0xb0, 0x00, 0xb8, 0x0a, 0xce, 0xd1, 0x8f, 0x3e, 0x69, 0x62, 0x46, 0x33, 0x9c, 0xbf, 0x4b, 0xcb, 0x0c, 0x90, 0x1c, 0x45, 0xcf, 0x37, 0x5b, 0xf7, 0x4b, 0x5e, 0x95, 0xc3, 0x28, 0x9f, 0x08, 0x83, 0x53, 0x74, 0xab, 0x0c, 0xb4, 0xc0, 0xa1, 0xbc, 0x89, - /* (2^311)P */ 0x06, 0xb1, 0x51, 0x15, 0x65, 0x60, 0x21, 0x17, 0x7a, 0x20, 0x65, 0xee, 0x12, 0x35, 0x4d, 0x46, 0xf4, 0xf8, 0xd0, 0xb1, 0xca, 0x09, 0x30, 0x08, 0x89, 0x23, 0x3b, 0xe7, 0xab, 0x8b, 0x77, 0xa6, 0xad, 0x25, 0xdd, 0xea, 0x3c, 0x7d, 0xa5, 0x24, 0xb3, 0xe8, 0xfa, 0xfb, 0xc9, 0xf2, 0x71, 0xe9, 0xfa, 0xf2, 0xdc, 0x54, 0xdd, 0x55, 0x2e, 0x2f, - /* (2^312)P */ 0x7f, 0x96, 0x96, 0xfb, 0x52, 0x86, 0xcf, 0xea, 0x62, 0x18, 0xf1, 0x53, 0x1f, 0x61, 0x2a, 0x9f, 0x8c, 0x51, 0xca, 0x2c, 0xde, 0x6d, 0xce, 0xab, 0x58, 0x32, 0x0b, 0x33, 0x9b, 0x99, 0xb4, 0x5c, 0x88, 0x2a, 0x76, 0xcc, 0x3e, 0x54, 0x1e, 0x9d, 0xa2, 0x89, 0xe4, 0x19, 0xba, 0x80, 0xc8, 0x39, 0x32, 0x7f, 0x0f, 0xc7, 0x84, 0xbb, 0x43, 0x56, - /* (2^313)P */ 0x9b, 0x07, 0xb4, 0x42, 0xa9, 0xa0, 0x78, 0x4f, 0x28, 0x70, 0x2b, 0x7e, 0x61, 0xe0, 0xdd, 0x02, 0x98, 0xfc, 0xed, 0x31, 0x80, 0xf1, 0x15, 0x52, 0x89, 0x23, 0xcd, 0x5d, 0x2b, 0xc5, 0x19, 0x32, 0xfb, 0x70, 0x50, 0x7a, 0x97, 0x6b, 0x42, 0xdb, 0xca, 0xdb, 0xc4, 0x59, 0x99, 0xe0, 0x12, 0x1f, 0x17, 0xba, 0x8b, 0xf0, 0xc4, 0x38, 0x5d, 0x27, - /* (2^314)P */ 0x29, 0x1d, 0xdc, 0x2b, 0xf6, 0x5b, 0x04, 0x61, 0x36, 0x76, 0xa0, 0x56, 0x36, 0x6e, 0xd7, 0x24, 0x4d, 0xe7, 0xef, 0x44, 0xd2, 0xd5, 0x07, 0xcd, 0xc4, 0x9d, 0x80, 0x48, 0xc3, 0x38, 0xcf, 0xd8, 0xa3, 0xdd, 0xb2, 0x5e, 0xb5, 0x70, 0x15, 0xbb, 0x36, 0x85, 0x8a, 0xd7, 0xfb, 0x56, 0x94, 0x73, 0x9c, 0x81, 0xbe, 0xb1, 0x44, 0x28, 0xf1, 0x37, - /* (2^315)P */ 0xbf, 0xcf, 0x5c, 0xd2, 0xe2, 0xea, 0xc2, 0xcd, 0x70, 0x7a, 0x9d, 0xcb, 0x81, 0xc1, 0xe9, 0xf1, 0x56, 0x71, 0x52, 0xf7, 0x1b, 0x87, 0xc6, 0xd8, 0xcc, 0xb2, 0x69, 0xf3, 0xb0, 0xbd, 0xba, 0x83, 0x12, 0x26, 0xc4, 0xce, 0x72, 0xde, 0x3b, 0x21, 0x28, 0x9e, 0x5a, 0x94, 0xf5, 0x04, 0xa3, 0xc8, 0x0f, 0x5e, 0xbc, 0x71, 0xf9, 0x0d, 0xce, 0xf5, - /* (2^316)P */ 0x93, 0x97, 0x00, 0x85, 0xf4, 0xb4, 0x40, 0xec, 0xd9, 0x2b, 0x6c, 0xd6, 0x63, 0x9e, 0x93, 0x0a, 0x5a, 0xf4, 0xa7, 0x9a, 0xe3, 0x3c, 0xf0, 0x55, 0xd1, 0x96, 0x6c, 0xf5, 0x2a, 0xce, 0xd7, 0x95, 0x72, 0xbf, 0xc5, 0x0c, 0xce, 0x79, 0xa2, 0x0a, 0x78, 0xe0, 0x72, 0xd0, 0x66, 0x28, 0x05, 0x75, 0xd3, 0x23, 0x09, 0x91, 0xed, 0x7e, 0xc4, 0xbc, - /* (2^317)P */ 0x77, 0xc2, 0x9a, 0xf7, 0xa6, 0xe6, 0x18, 0xb4, 0xe7, 0xf6, 0xda, 0xec, 0x44, 0x6d, 0xfb, 0x08, 0xee, 0x65, 0xa8, 0x92, 0x85, 0x1f, 0xba, 0x38, 0x93, 0x20, 0x5c, 0x4d, 0xd2, 0x18, 0x0f, 0x24, 0xbe, 0x1a, 0x96, 0x44, 0x7d, 0xeb, 0xb3, 0xda, 0x95, 0xf4, 0xaf, 0x6c, 0x06, 0x0f, 0x47, 0x37, 0xc8, 0x77, 0x63, 0xe1, 0x29, 0xef, 0xff, 0xa5, - /* (2^318)P */ 0x16, 0x12, 0xd9, 0x47, 0x90, 0x22, 0x9b, 0x05, 0xf2, 0xa5, 0x9a, 0xae, 0x83, 0x98, 0xb5, 0xac, 0xab, 0x29, 0xaa, 0xdc, 0x5f, 0xde, 0xcd, 0xf7, 0x42, 0xad, 0x3b, 0x96, 0xd6, 0x3e, 0x6e, 0x52, 0x47, 0xb1, 0xab, 0x51, 0xde, 0x49, 0x7c, 0x87, 0x8d, 0x86, 0xe2, 0x70, 0x13, 0x21, 0x51, 0x1c, 0x0c, 0x25, 0xc1, 0xb0, 0xe6, 0x19, 0xcf, 0x12, - /* (2^319)P */ 0xf0, 0xbc, 0x97, 0x8f, 0x4b, 0x2f, 0xd1, 0x1f, 0x8c, 0x57, 0xed, 0x3c, 0xf4, 0x26, 0x19, 0xbb, 0x60, 0xca, 0x24, 0xc5, 0xd9, 0x97, 0xe2, 0x5f, 0x76, 0x49, 0x39, 0x7e, 0x2d, 0x12, 0x21, 0x98, 0xda, 0xe6, 0xdb, 0xd2, 0xd8, 0x9f, 0x18, 0xd8, 0x83, 0x6c, 0xba, 0x89, 0x8d, 0x29, 0xfa, 0x46, 0x33, 0x8c, 0x28, 0xdf, 0x6a, 0xb3, 0x69, 0x28, - /* (2^320)P */ 0x86, 0x17, 0xbc, 0xd6, 0x7c, 0xba, 0x1e, 0x83, 0xbb, 0x84, 0xb5, 0x8c, 0xad, 0xdf, 0xa1, 0x24, 0x81, 0x70, 0x40, 0x0f, 0xad, 0xad, 0x3b, 0x23, 0xd0, 0x93, 0xa0, 0x49, 0x5c, 0x4b, 0x51, 0xbe, 0x20, 0x49, 0x4e, 0xda, 0x2d, 0xd3, 0xad, 0x1b, 0x74, 0x08, 0x41, 0xf0, 0xef, 0x19, 0xe9, 0x45, 0x5d, 0x02, 0xae, 0x26, 0x25, 0xd9, 0xd1, 0xc2, - /* (2^321)P */ 0x48, 0x81, 0x3e, 0xb2, 0x83, 0xf8, 0x4d, 0xb3, 0xd0, 0x4c, 0x75, 0xb3, 0xa0, 0x52, 0x26, 0xf2, 0xaf, 0x5d, 0x36, 0x70, 0x72, 0xd6, 0xb7, 0x88, 0x08, 0x69, 0xbd, 0x15, 0x25, 0xb1, 0x45, 0x1b, 0xb7, 0x0b, 0x5f, 0x71, 0x5d, 0x83, 0x49, 0xb9, 0x84, 0x3b, 0x7c, 0xc1, 0x50, 0x93, 0x05, 0x53, 0xe0, 0x61, 0xea, 0xc1, 0xef, 0xdb, 0x82, 0x97, - /* (2^322)P */ 0x00, 0xd5, 0xc3, 0x3a, 0x4d, 0x8a, 0x23, 0x7a, 0xef, 0xff, 0x37, 0xef, 0xf3, 0xbc, 0xa9, 0xb6, 0xae, 0xd7, 0x3a, 0x7b, 0xfd, 0x3e, 0x8e, 0x9b, 0xab, 0x44, 0x54, 0x60, 0x28, 0x6c, 0xbf, 0x15, 0x24, 0x4a, 0x56, 0x60, 0x7f, 0xa9, 0x7a, 0x28, 0x59, 0x2c, 0x8a, 0xd1, 0x7d, 0x6b, 0x00, 0xfd, 0xa5, 0xad, 0xbc, 0x19, 0x3f, 0xcb, 0x73, 0xe0, - /* (2^323)P */ 0xcf, 0x9e, 0x66, 0x06, 0x4d, 0x2b, 0xf5, 0x9c, 0xc2, 0x9d, 0x9e, 0xed, 0x5a, 0x5c, 0x2d, 0x00, 0xbf, 0x29, 0x90, 0x88, 0xe4, 0x5d, 0xfd, 0xe2, 0xf0, 0x38, 0xec, 0x4d, 0x26, 0xea, 0x54, 0xf0, 0x3c, 0x84, 0x10, 0x6a, 0xf9, 0x66, 0x9c, 0xe7, 0x21, 0xfd, 0x0f, 0xc7, 0x13, 0x50, 0x81, 0xb6, 0x50, 0xf9, 0x04, 0x7f, 0xa4, 0x37, 0x85, 0x14, - /* (2^324)P */ 0xdb, 0x87, 0x49, 0xc7, 0xa8, 0x39, 0x0c, 0x32, 0x98, 0x0c, 0xb9, 0x1a, 0x1b, 0x4d, 0xe0, 0x8a, 0x9a, 0x8e, 0x8f, 0xab, 0x5a, 0x17, 0x3d, 0x04, 0x21, 0xce, 0x3e, 0x2c, 0xf9, 0xa3, 0x97, 0xe4, 0x77, 0x95, 0x0e, 0xb6, 0xa5, 0x15, 0xad, 0x3a, 0x1e, 0x46, 0x53, 0x17, 0x09, 0x83, 0x71, 0x4e, 0x86, 0x38, 0xd5, 0x23, 0x44, 0x16, 0x8d, 0xc8, - /* (2^325)P */ 0x05, 0x5e, 0x99, 0x08, 0xbb, 0xc3, 0xc0, 0xb7, 0x6c, 0x12, 0xf2, 0xf3, 0xf4, 0x7c, 0x6a, 0x4d, 0x9e, 0xeb, 0x3d, 0xb9, 0x63, 0x94, 0xce, 0x81, 0xd8, 0x11, 0xcb, 0x55, 0x69, 0x4a, 0x20, 0x0b, 0x4c, 0x2e, 0x14, 0xb8, 0xd4, 0x6a, 0x7c, 0xf0, 0xed, 0xfc, 0x8f, 0xef, 0xa0, 0xeb, 0x6c, 0x01, 0xe2, 0xdc, 0x10, 0x22, 0xa2, 0x01, 0x85, 0x64, - /* (2^326)P */ 0x58, 0xe1, 0x9c, 0x27, 0x55, 0xc6, 0x25, 0xa6, 0x7d, 0x67, 0x88, 0x65, 0x99, 0x6c, 0xcb, 0xdb, 0x27, 0x4f, 0x44, 0x29, 0xf5, 0x4a, 0x23, 0x10, 0xbc, 0x03, 0x3f, 0x36, 0x1e, 0xef, 0xb0, 0xba, 0x75, 0xe8, 0x74, 0x5f, 0x69, 0x3e, 0x26, 0x40, 0xb4, 0x2f, 0xdc, 0x43, 0xbf, 0xa1, 0x8b, 0xbd, 0xca, 0x6e, 0xc1, 0x6e, 0x21, 0x79, 0xa0, 0xd0, - /* (2^327)P */ 0x78, 0x93, 0x4a, 0x2d, 0x22, 0x6e, 0x6e, 0x7d, 0x74, 0xd2, 0x66, 0x58, 0xce, 0x7b, 0x1d, 0x97, 0xb1, 0xf2, 0xda, 0x1c, 0x79, 0xfb, 0xba, 0xd1, 0xc0, 0xc5, 0x6e, 0xc9, 0x11, 0x89, 0xd2, 0x41, 0x8d, 0x70, 0xb9, 0xcc, 0xea, 0x6a, 0xb3, 0x45, 0xb6, 0x05, 0x2e, 0xf2, 0x17, 0xf1, 0x27, 0xb8, 0xed, 0x06, 0x1f, 0xdb, 0x9d, 0x1f, 0x69, 0x28, - /* (2^328)P */ 0x93, 0x12, 0xa8, 0x11, 0xe1, 0x92, 0x30, 0x8d, 0xac, 0xe1, 0x1c, 0x60, 0x7c, 0xed, 0x2d, 0x2e, 0xd3, 0x03, 0x5c, 0x9c, 0xc5, 0xbd, 0x64, 0x4a, 0x8c, 0xba, 0x76, 0xfe, 0xc6, 0xc1, 0xea, 0xc2, 0x4f, 0xbe, 0x70, 0x3d, 0x64, 0xcf, 0x8e, 0x18, 0xcb, 0xcd, 0x57, 0xa7, 0xf7, 0x36, 0xa9, 0x6b, 0x3e, 0xb8, 0x69, 0xee, 0x47, 0xa2, 0x7e, 0xb2, - /* (2^329)P */ 0x96, 0xaf, 0x3a, 0xf5, 0xed, 0xcd, 0xaf, 0xf7, 0x82, 0xaf, 0x59, 0x62, 0x0b, 0x36, 0x85, 0xf9, 0xaf, 0xd6, 0x38, 0xff, 0x87, 0x2e, 0x1d, 0x6c, 0x8b, 0xaf, 0x3b, 0xdf, 0x28, 0xa2, 0xd6, 0x4d, 0x80, 0x92, 0xc3, 0x0f, 0x34, 0xa8, 0xae, 0x69, 0x5d, 0x7b, 0x9d, 0xbc, 0xf5, 0xfd, 0x1d, 0xb1, 0x96, 0x55, 0x86, 0xe1, 0x5c, 0xb6, 0xac, 0xb9, - /* (2^330)P */ 0x50, 0x9e, 0x37, 0x28, 0x7d, 0xa8, 0x33, 0x63, 0xda, 0x3f, 0x20, 0x98, 0x0e, 0x09, 0xa8, 0x77, 0x3b, 0x7a, 0xfc, 0x16, 0x85, 0x44, 0x64, 0x77, 0x65, 0x68, 0x92, 0x41, 0xc6, 0x1f, 0xdf, 0x27, 0xf9, 0xec, 0xa0, 0x61, 0x22, 0xea, 0x19, 0xe7, 0x75, 0x8b, 0x4e, 0xe5, 0x0f, 0xb7, 0xf7, 0xd2, 0x53, 0xf4, 0xdd, 0x4a, 0xaa, 0x78, 0x40, 0xb7, - /* (2^331)P */ 0xd4, 0x89, 0xe3, 0x79, 0xba, 0xb6, 0xc3, 0xda, 0xe6, 0x78, 0x65, 0x7d, 0x6e, 0x22, 0x62, 0xb1, 0x3d, 0xea, 0x90, 0x84, 0x30, 0x5e, 0xd4, 0x39, 0x84, 0x78, 0xd9, 0x75, 0xd6, 0xce, 0x2a, 0x11, 0x29, 0x69, 0xa4, 0x5e, 0xaa, 0x2a, 0x98, 0x5a, 0xe5, 0x91, 0x8f, 0xb2, 0xfb, 0xda, 0x97, 0xe8, 0x83, 0x6f, 0x04, 0xb9, 0x5d, 0xaf, 0xe1, 0x9b, - /* (2^332)P */ 0x8b, 0xe4, 0xe1, 0x48, 0x9c, 0xc4, 0x83, 0x89, 0xdf, 0x65, 0xd3, 0x35, 0x55, 0x13, 0xf4, 0x1f, 0x36, 0x92, 0x33, 0x38, 0xcb, 0xed, 0x15, 0xe6, 0x60, 0x2d, 0x25, 0xf5, 0x36, 0x60, 0x3a, 0x37, 0x9b, 0x71, 0x9d, 0x42, 0xb0, 0x14, 0xc8, 0xba, 0x62, 0xa3, 0x49, 0xb0, 0x88, 0xc1, 0x72, 0x73, 0xdd, 0x62, 0x40, 0xa9, 0x62, 0x88, 0x99, 0xca, - /* (2^333)P */ 0x47, 0x7b, 0xea, 0xda, 0x46, 0x2f, 0x45, 0xc6, 0xe3, 0xb4, 0x4d, 0x8d, 0xac, 0x0b, 0x54, 0x22, 0x06, 0x31, 0x16, 0x66, 0x3e, 0xe4, 0x38, 0x12, 0xcd, 0xf3, 0xe7, 0x99, 0x37, 0xd9, 0x62, 0x24, 0x4b, 0x05, 0xf2, 0x58, 0xe6, 0x29, 0x4b, 0x0d, 0xf6, 0xc1, 0xba, 0xa0, 0x1e, 0x0f, 0xcb, 0x1f, 0xc6, 0x2b, 0x19, 0xfc, 0x82, 0x01, 0xd0, 0x86, - /* (2^334)P */ 0xa2, 0xae, 0x77, 0x20, 0xfb, 0xa8, 0x18, 0xb4, 0x61, 0xef, 0xe8, 0x52, 0x79, 0xbb, 0x86, 0x90, 0x5d, 0x2e, 0x76, 0xed, 0x66, 0x60, 0x5d, 0x00, 0xb5, 0xa4, 0x00, 0x40, 0x89, 0xec, 0xd1, 0xd2, 0x0d, 0x26, 0xb9, 0x30, 0xb2, 0xd2, 0xb8, 0xe8, 0x0e, 0x56, 0xf9, 0x67, 0x94, 0x2e, 0x62, 0xe1, 0x79, 0x48, 0x2b, 0xa9, 0xfa, 0xea, 0xdb, 0x28, - /* (2^335)P */ 0x35, 0xf1, 0xb0, 0x43, 0xbd, 0x27, 0xef, 0x18, 0x44, 0xa2, 0x04, 0xb4, 0x69, 0xa1, 0x97, 0x1f, 0x8c, 0x04, 0x82, 0x9b, 0x00, 0x6d, 0xf8, 0xbf, 0x7d, 0xc1, 0x5b, 0xab, 0xe8, 0xb2, 0x34, 0xbd, 0xaf, 0x7f, 0xb2, 0x0d, 0xf3, 0xed, 0xfc, 0x5b, 0x50, 0xee, 0xe7, 0x4a, 0x20, 0xd9, 0xf5, 0xc6, 0x9a, 0x97, 0x6d, 0x07, 0x2f, 0xb9, 0x31, 0x02, - /* (2^336)P */ 0xf9, 0x54, 0x4a, 0xc5, 0x61, 0x7e, 0x1d, 0xa6, 0x0e, 0x1a, 0xa8, 0xd3, 0x8c, 0x36, 0x7d, 0xf1, 0x06, 0xb1, 0xac, 0x93, 0xcd, 0xe9, 0x8f, 0x61, 0x6c, 0x5d, 0x03, 0x23, 0xdf, 0x85, 0x53, 0x39, 0x63, 0x5e, 0xeb, 0xf3, 0xd3, 0xd3, 0x75, 0x97, 0x9b, 0x62, 0x9b, 0x01, 0xb3, 0x19, 0xd8, 0x2b, 0x36, 0xf2, 0x2c, 0x2c, 0x6f, 0x36, 0xc6, 0x3c, - /* (2^337)P */ 0x05, 0x74, 0x43, 0x10, 0xb6, 0xb0, 0xf8, 0xbf, 0x02, 0x46, 0x9a, 0xee, 0xc1, 0xaf, 0xc1, 0xe5, 0x5a, 0x2e, 0xbb, 0xe1, 0xdc, 0xc6, 0xce, 0x51, 0x29, 0x50, 0xbf, 0x1b, 0xde, 0xff, 0xba, 0x4d, 0x8d, 0x8b, 0x7e, 0xe7, 0xbd, 0x5b, 0x8f, 0xbe, 0xe3, 0x75, 0x71, 0xff, 0x37, 0x05, 0x5a, 0x10, 0xeb, 0x54, 0x7e, 0x44, 0x72, 0x2c, 0xd4, 0xfc, - /* (2^338)P */ 0x03, 0x12, 0x1c, 0xb2, 0x08, 0x90, 0xa1, 0x2d, 0x50, 0xa0, 0xad, 0x7f, 0x8d, 0xa6, 0x97, 0xc1, 0xbd, 0xdc, 0xc3, 0xa7, 0xad, 0x31, 0xdf, 0xb8, 0x03, 0x84, 0xc3, 0xb9, 0x29, 0x3d, 0x92, 0x2e, 0xc3, 0x90, 0x07, 0xe8, 0xa7, 0xc7, 0xbc, 0x61, 0xe9, 0x3e, 0xa0, 0x35, 0xda, 0x1d, 0xab, 0x48, 0xfe, 0x50, 0xc9, 0x25, 0x59, 0x23, 0x69, 0x3f, - /* (2^339)P */ 0x8e, 0x91, 0xab, 0x6b, 0x91, 0x4f, 0x89, 0x76, 0x67, 0xad, 0xb2, 0x65, 0x9d, 0xad, 0x02, 0x36, 0xdc, 0xac, 0x96, 0x93, 0x97, 0x21, 0x14, 0xd0, 0xe8, 0x11, 0x60, 0x1e, 0xeb, 0x96, 0x06, 0xf2, 0x53, 0xf2, 0x6d, 0xb7, 0x93, 0x6f, 0x26, 0x91, 0x23, 0xe3, 0x34, 0x04, 0x92, 0x91, 0x37, 0x08, 0x50, 0xd6, 0x28, 0x09, 0x27, 0xa1, 0x0c, 0x00, - /* (2^340)P */ 0x1f, 0xbb, 0x21, 0x26, 0x33, 0xcb, 0xa4, 0xd1, 0xee, 0x85, 0xf9, 0xd9, 0x3c, 0x90, 0xc3, 0xd1, 0x26, 0xa2, 0x25, 0x93, 0x43, 0x61, 0xed, 0x91, 0x6e, 0x54, 0x03, 0x2e, 0x42, 0x9d, 0xf7, 0xa6, 0x02, 0x0f, 0x2f, 0x9c, 0x7a, 0x8d, 0x12, 0xc2, 0x18, 0xfc, 0x41, 0xff, 0x85, 0x26, 0x1a, 0x44, 0x55, 0x0b, 0x89, 0xab, 0x6f, 0x62, 0x33, 0x8c, - /* (2^341)P */ 0xe0, 0x3c, 0x5d, 0x70, 0x64, 0x87, 0x81, 0x35, 0xf2, 0x37, 0xa6, 0x24, 0x3e, 0xe0, 0x62, 0xd5, 0x71, 0xe7, 0x93, 0xfb, 0xac, 0xc3, 0xe7, 0xc7, 0x04, 0xe2, 0x70, 0xd3, 0x29, 0x5b, 0x21, 0xbf, 0xf4, 0x26, 0x5d, 0xf3, 0x95, 0xb4, 0x2a, 0x6a, 0x07, 0x55, 0xa6, 0x4b, 0x3b, 0x15, 0xf2, 0x25, 0x8a, 0x95, 0x3f, 0x63, 0x2f, 0x7a, 0x23, 0x96, - /* (2^342)P */ 0x0d, 0x3d, 0xd9, 0x13, 0xa7, 0xb3, 0x5e, 0x67, 0xf7, 0x02, 0x23, 0xee, 0x84, 0xff, 0x99, 0xda, 0xb9, 0x53, 0xf8, 0xf0, 0x0e, 0x39, 0x2f, 0x3c, 0x64, 0x34, 0xe3, 0x09, 0xfd, 0x2b, 0x33, 0xc7, 0xfe, 0x62, 0x2b, 0x84, 0xdf, 0x2b, 0xd2, 0x7c, 0x26, 0x01, 0x70, 0x66, 0x5b, 0x85, 0xc2, 0xbe, 0x88, 0x37, 0xf1, 0x30, 0xac, 0xb8, 0x76, 0xa3, - /* (2^343)P */ 0x6e, 0x01, 0xf0, 0x55, 0x35, 0xe4, 0xbd, 0x43, 0x62, 0x9d, 0xd6, 0x11, 0xef, 0x6f, 0xb8, 0x8c, 0xaa, 0x98, 0x87, 0xc6, 0x6d, 0xc4, 0xcc, 0x74, 0x92, 0x53, 0x4a, 0xdf, 0xe4, 0x08, 0x89, 0x17, 0xd0, 0x0f, 0xf4, 0x00, 0x60, 0x78, 0x08, 0x44, 0xb5, 0xda, 0x18, 0xed, 0x98, 0xc8, 0x61, 0x3d, 0x39, 0xdb, 0xcf, 0x1d, 0x49, 0x40, 0x65, 0x75, - /* (2^344)P */ 0x8e, 0x10, 0xae, 0x5f, 0x06, 0xd2, 0x95, 0xfd, 0x20, 0x16, 0x49, 0x5b, 0x57, 0xbe, 0x22, 0x8b, 0x43, 0xfb, 0xe6, 0xcc, 0x26, 0xa5, 0x5d, 0xd3, 0x68, 0xc5, 0xf9, 0x5a, 0x86, 0x24, 0x87, 0x27, 0x05, 0xfd, 0xe2, 0xff, 0xb3, 0xa3, 0x7b, 0x37, 0x59, 0xc5, 0x4e, 0x14, 0x94, 0xf9, 0x3b, 0xcb, 0x7c, 0xed, 0xca, 0x1d, 0xb2, 0xac, 0x05, 0x4a, - /* (2^345)P */ 0xf4, 0xd1, 0x81, 0xeb, 0x89, 0xbf, 0xfe, 0x1e, 0x41, 0x92, 0x29, 0xee, 0xe1, 0x43, 0xf5, 0x86, 0x1d, 0x2f, 0xbb, 0x1e, 0x84, 0x5d, 0x7b, 0x8d, 0xd5, 0xda, 0xee, 0x1e, 0x8a, 0xd0, 0x27, 0xf2, 0x60, 0x51, 0x59, 0x82, 0xf4, 0x84, 0x2b, 0x5b, 0x14, 0x2d, 0x81, 0x82, 0x3e, 0x2b, 0xb4, 0x6d, 0x51, 0x4f, 0xc5, 0xcb, 0xbf, 0x74, 0xe3, 0xb4, - /* (2^346)P */ 0x19, 0x2f, 0x22, 0xb3, 0x04, 0x5f, 0x81, 0xca, 0x05, 0x60, 0xb9, 0xaa, 0xee, 0x0e, 0x2f, 0x48, 0x38, 0xf9, 0x91, 0xb4, 0x66, 0xe4, 0x57, 0x28, 0x54, 0x10, 0xe9, 0x61, 0x9d, 0xd4, 0x90, 0x75, 0xb1, 0x39, 0x23, 0xb6, 0xfc, 0x82, 0xe0, 0xfa, 0xbb, 0x5c, 0x6e, 0xc3, 0x44, 0x13, 0x00, 0x83, 0x55, 0x9e, 0x8e, 0x10, 0x61, 0x81, 0x91, 0x04, - /* (2^347)P */ 0x5f, 0x2a, 0xd7, 0x81, 0xd9, 0x9c, 0xbb, 0x79, 0xbc, 0x62, 0x56, 0x98, 0x03, 0x5a, 0x18, 0x85, 0x2a, 0x9c, 0xd0, 0xfb, 0xd2, 0xb1, 0xaf, 0xef, 0x0d, 0x24, 0xc5, 0xfa, 0x39, 0xbb, 0x6b, 0xed, 0xa4, 0xdf, 0xe4, 0x87, 0xcd, 0x41, 0xd3, 0x72, 0x32, 0xc6, 0x28, 0x21, 0xb1, 0xba, 0x8b, 0xa3, 0x91, 0x79, 0x76, 0x22, 0x25, 0x10, 0x61, 0xd1, - /* (2^348)P */ 0x73, 0xb5, 0x32, 0x97, 0xdd, 0xeb, 0xdd, 0x22, 0x22, 0xf1, 0x33, 0x3c, 0x77, 0x56, 0x7d, 0x6b, 0x48, 0x2b, 0x05, 0x81, 0x03, 0x03, 0x91, 0x9a, 0xe3, 0x5e, 0xd4, 0xee, 0x3f, 0xf8, 0xbb, 0x50, 0x21, 0x32, 0x4c, 0x4a, 0x58, 0x49, 0xde, 0x0c, 0xde, 0x30, 0x82, 0x3d, 0x92, 0xf0, 0x6c, 0xcc, 0x32, 0x3e, 0xd2, 0x78, 0x8a, 0x6e, 0x2c, 0xd0, - /* (2^349)P */ 0xf0, 0xf7, 0xa1, 0x0b, 0xc1, 0x74, 0x85, 0xa8, 0xe9, 0xdd, 0x48, 0xa1, 0xc0, 0x16, 0xd8, 0x2b, 0x61, 0x08, 0xc2, 0x2b, 0x30, 0x26, 0x79, 0xce, 0x9e, 0xfd, 0x39, 0xd7, 0x81, 0xa4, 0x63, 0x8c, 0xd5, 0x74, 0xa0, 0x88, 0xfa, 0x03, 0x30, 0xe9, 0x7f, 0x2b, 0xc6, 0x02, 0xc9, 0x5e, 0xe4, 0xd5, 0x4d, 0x92, 0xd0, 0xf6, 0xf2, 0x5b, 0x79, 0x08, - /* (2^350)P */ 0x34, 0x89, 0x81, 0x43, 0xd1, 0x94, 0x2c, 0x10, 0x54, 0x9b, 0xa0, 0xe5, 0x44, 0xe8, 0xc2, 0x2f, 0x3e, 0x0e, 0x74, 0xae, 0xba, 0xe2, 0xac, 0x85, 0x6b, 0xd3, 0x5c, 0x97, 0xf7, 0x90, 0xf1, 0x12, 0xc0, 0x03, 0xc8, 0x1f, 0x37, 0x72, 0x8c, 0x9b, 0x9c, 0x17, 0x96, 0x9d, 0xc7, 0xbf, 0xa3, 0x3f, 0x44, 0x3d, 0x87, 0x81, 0xbd, 0x81, 0xa6, 0x5f, - /* (2^351)P */ 0xe4, 0xff, 0x78, 0x62, 0x82, 0x5b, 0x76, 0x58, 0xf5, 0x5b, 0xa6, 0xc4, 0x53, 0x11, 0x3b, 0x7b, 0xaa, 0x67, 0xf8, 0xea, 0x3b, 0x5d, 0x9a, 0x2e, 0x04, 0xeb, 0x4a, 0x24, 0xfb, 0x56, 0xf0, 0xa8, 0xd4, 0x14, 0xed, 0x0f, 0xfd, 0xc5, 0x26, 0x17, 0x2a, 0xf0, 0xb9, 0x13, 0x8c, 0xbd, 0x65, 0x14, 0x24, 0x95, 0x27, 0x12, 0x63, 0x2a, 0x09, 0x18, - /* (2^352)P */ 0xe1, 0x5c, 0xe7, 0xe0, 0x00, 0x6a, 0x96, 0xf2, 0x49, 0x6a, 0x39, 0xa5, 0xe0, 0x17, 0x79, 0x4a, 0x63, 0x07, 0x62, 0x09, 0x61, 0x1b, 0x6e, 0xa9, 0xb5, 0x62, 0xb7, 0xde, 0xdf, 0x80, 0x4c, 0x5a, 0x99, 0x73, 0x59, 0x9d, 0xfb, 0xb1, 0x5e, 0xbe, 0xb8, 0xb7, 0x63, 0x93, 0xe8, 0xad, 0x5e, 0x1f, 0xae, 0x59, 0x1c, 0xcd, 0xb4, 0xc2, 0xb3, 0x8a, - /* (2^353)P */ 0x78, 0x53, 0xa1, 0x4c, 0x70, 0x9c, 0x63, 0x7e, 0xb3, 0x12, 0x40, 0x5f, 0xbb, 0x23, 0xa7, 0xf7, 0x77, 0x96, 0x5b, 0x4d, 0x91, 0x10, 0x52, 0x85, 0x9e, 0xa5, 0x38, 0x0b, 0xfd, 0x25, 0x01, 0x4b, 0xfa, 0x4d, 0xd3, 0x3f, 0x78, 0x74, 0x42, 0xff, 0x62, 0x2d, 0x27, 0xdc, 0x9d, 0xd1, 0x29, 0x76, 0x2e, 0x78, 0xb3, 0x35, 0xfa, 0x15, 0xd5, 0x38, - /* (2^354)P */ 0x8b, 0xc7, 0x43, 0xce, 0xf0, 0x5e, 0xf1, 0x0d, 0x02, 0x38, 0xe8, 0x82, 0xc9, 0x25, 0xad, 0x2d, 0x27, 0xa4, 0x54, 0x18, 0xb2, 0x30, 0x73, 0xa4, 0x41, 0x08, 0xe4, 0x86, 0xe6, 0x8c, 0xe9, 0x2a, 0x34, 0xb3, 0xd6, 0x61, 0x8f, 0x66, 0x26, 0x08, 0xb6, 0x06, 0x33, 0xaa, 0x12, 0xac, 0x72, 0xec, 0x2e, 0x52, 0xa3, 0x25, 0x3e, 0xd7, 0x62, 0xe8, - /* (2^355)P */ 0xc4, 0xbb, 0x89, 0xc8, 0x40, 0xcc, 0x84, 0xec, 0x4a, 0xd9, 0xc4, 0x55, 0x78, 0x00, 0xcf, 0xd8, 0xe9, 0x24, 0x59, 0xdc, 0x5e, 0xf0, 0x66, 0xa1, 0x83, 0xae, 0x97, 0x18, 0xc5, 0x54, 0x27, 0xa2, 0x21, 0x52, 0x03, 0x31, 0x5b, 0x11, 0x67, 0xf6, 0x12, 0x00, 0x87, 0x2f, 0xff, 0x59, 0x70, 0x8f, 0x6d, 0x71, 0xab, 0xab, 0x24, 0xb8, 0xba, 0x35, - /* (2^356)P */ 0x69, 0x43, 0xa7, 0x14, 0x06, 0x96, 0xe9, 0xc2, 0xe3, 0x2b, 0x45, 0x22, 0xc0, 0xd0, 0x2f, 0x34, 0xd1, 0x01, 0x99, 0xfc, 0x99, 0x38, 0xa1, 0x25, 0x2e, 0x59, 0x6c, 0x27, 0xc9, 0xeb, 0x7b, 0xdc, 0x4e, 0x26, 0x68, 0xba, 0xfa, 0xec, 0x02, 0x05, 0x64, 0x80, 0x30, 0x20, 0x5c, 0x26, 0x7f, 0xaf, 0x95, 0x17, 0x3d, 0x5c, 0x9e, 0x96, 0x96, 0xaf, - /* (2^357)P */ 0xa6, 0xba, 0x21, 0x29, 0x32, 0xe2, 0x98, 0xde, 0x9b, 0x6d, 0x0b, 0x44, 0x91, 0xa8, 0x3e, 0xd4, 0xb8, 0x04, 0x6c, 0xf6, 0x04, 0x39, 0xbd, 0x52, 0x05, 0x15, 0x27, 0x78, 0x8e, 0x55, 0xac, 0x79, 0xc5, 0xe6, 0x00, 0x7f, 0x90, 0xa2, 0xdd, 0x07, 0x13, 0xe0, 0x24, 0x70, 0x5c, 0x0f, 0x4d, 0xa9, 0xf9, 0xae, 0xcb, 0x34, 0x10, 0x9d, 0x89, 0x9d, - /* (2^358)P */ 0x12, 0xe0, 0xb3, 0x9f, 0xc4, 0x96, 0x1d, 0xcf, 0xed, 0x99, 0x64, 0x28, 0x8d, 0xc7, 0x31, 0x82, 0xee, 0x5e, 0x75, 0x48, 0xff, 0x3a, 0xf2, 0x09, 0x34, 0x03, 0x93, 0x52, 0x19, 0xb2, 0xc5, 0x81, 0x93, 0x45, 0x5e, 0x59, 0x21, 0x2b, 0xec, 0x89, 0xba, 0x36, 0x6e, 0xf9, 0x82, 0x75, 0x7e, 0x82, 0x3f, 0xaa, 0xe2, 0xe3, 0x3b, 0x94, 0xfd, 0x98, - /* (2^359)P */ 0x7c, 0xdb, 0x75, 0x31, 0x61, 0xfb, 0x15, 0x28, 0x94, 0xd7, 0xc3, 0x5a, 0xa9, 0xa1, 0x0a, 0x66, 0x0f, 0x2b, 0x13, 0x3e, 0x42, 0xb5, 0x28, 0x3a, 0xca, 0x83, 0xf3, 0x61, 0x22, 0xf4, 0x40, 0xc5, 0xdf, 0xe7, 0x31, 0x9f, 0x7e, 0x51, 0x75, 0x06, 0x9d, 0x51, 0xc8, 0xe7, 0x9f, 0xc3, 0x71, 0x4f, 0x3d, 0x5b, 0xfb, 0xe9, 0x8e, 0x08, 0x40, 0x8e, - /* (2^360)P */ 0xf7, 0x31, 0xad, 0x50, 0x5d, 0x25, 0x93, 0x73, 0x68, 0xf6, 0x7c, 0x89, 0x5a, 0x3d, 0x9f, 0x9b, 0x05, 0x82, 0xe7, 0x70, 0x4b, 0x19, 0xaa, 0xcf, 0xff, 0xde, 0x50, 0x8f, 0x2f, 0x69, 0xd3, 0xf0, 0x99, 0x51, 0x6b, 0x9d, 0xb6, 0x56, 0x6f, 0xf8, 0x4c, 0x74, 0x8b, 0x4c, 0x91, 0xf9, 0xa9, 0xb1, 0x3e, 0x07, 0xdf, 0x0b, 0x27, 0x8a, 0xb1, 0xed, - /* (2^361)P */ 0xfb, 0x67, 0xd9, 0x48, 0xd2, 0xe4, 0x44, 0x9b, 0x43, 0x15, 0x8a, 0xeb, 0x00, 0x53, 0xad, 0x25, 0xc7, 0x7e, 0x19, 0x30, 0x87, 0xb7, 0xd5, 0x5f, 0x04, 0xf8, 0xaa, 0xdd, 0x57, 0xae, 0x34, 0x75, 0xe2, 0x84, 0x4b, 0x54, 0x60, 0x37, 0x95, 0xe4, 0xd3, 0xec, 0xac, 0xef, 0x47, 0x31, 0xa3, 0xc8, 0x31, 0x22, 0xdb, 0x26, 0xe7, 0x6a, 0xb5, 0xad, - /* (2^362)P */ 0x44, 0x09, 0x5c, 0x95, 0xe4, 0x72, 0x3c, 0x1a, 0xd1, 0xac, 0x42, 0x51, 0x99, 0x6f, 0xfa, 0x1f, 0xf2, 0x22, 0xbe, 0xff, 0x7b, 0x66, 0xf5, 0x6c, 0xb3, 0x66, 0xc7, 0x4d, 0x78, 0x31, 0x83, 0x80, 0xf5, 0x41, 0xe9, 0x7f, 0xbe, 0xf7, 0x23, 0x49, 0x6b, 0x84, 0x4e, 0x7e, 0x47, 0x07, 0x6e, 0x74, 0xdf, 0xe5, 0x9d, 0x9e, 0x56, 0x2a, 0xc0, 0xbc, - /* (2^363)P */ 0xac, 0x10, 0x80, 0x8c, 0x7c, 0xfa, 0x83, 0xdf, 0xb3, 0xd0, 0xc4, 0xbe, 0xfb, 0x9f, 0xac, 0xc9, 0xc3, 0x40, 0x95, 0x0b, 0x09, 0x23, 0xda, 0x63, 0x67, 0xcf, 0xe7, 0x9f, 0x7d, 0x7b, 0x6b, 0xe2, 0xe6, 0x6d, 0xdb, 0x87, 0x9e, 0xa6, 0xff, 0x6d, 0xab, 0xbd, 0xfb, 0x54, 0x84, 0x68, 0xcf, 0x89, 0xf1, 0xd0, 0xe2, 0x85, 0x61, 0xdc, 0x22, 0xd1, - /* (2^364)P */ 0xa8, 0x48, 0xfb, 0x8c, 0x6a, 0x63, 0x01, 0x72, 0x43, 0x43, 0xeb, 0x21, 0xa3, 0x00, 0x8a, 0xc0, 0x87, 0x51, 0x9e, 0x86, 0x75, 0x16, 0x79, 0xf9, 0x6b, 0x11, 0x80, 0x62, 0xc2, 0x9d, 0xb8, 0x8c, 0x30, 0x8e, 0x8d, 0x03, 0x52, 0x7e, 0x31, 0x59, 0x38, 0xf9, 0x25, 0xc7, 0x0f, 0xc7, 0xa8, 0x2b, 0x5c, 0x80, 0xfa, 0x90, 0xa2, 0x63, 0xca, 0xe7, - /* (2^365)P */ 0xf1, 0x5d, 0xb5, 0xd9, 0x20, 0x10, 0x7d, 0x0f, 0xc5, 0x50, 0x46, 0x07, 0xff, 0x02, 0x75, 0x2b, 0x4a, 0xf3, 0x39, 0x91, 0x72, 0xb7, 0xd5, 0xcc, 0x38, 0xb8, 0xe7, 0x36, 0x26, 0x5e, 0x11, 0x97, 0x25, 0xfb, 0x49, 0x68, 0xdc, 0xb4, 0x46, 0x87, 0x5c, 0xc2, 0x7f, 0xaa, 0x7d, 0x36, 0x23, 0xa6, 0xc6, 0x53, 0xec, 0xbc, 0x57, 0x47, 0xc1, 0x2b, - /* (2^366)P */ 0x25, 0x5d, 0x7d, 0x95, 0xda, 0x0b, 0x8f, 0x78, 0x1e, 0x19, 0x09, 0xfa, 0x67, 0xe0, 0xa0, 0x17, 0x24, 0x76, 0x6c, 0x30, 0x1f, 0x62, 0x3d, 0xbe, 0x45, 0x70, 0xcc, 0xb6, 0x1e, 0x68, 0x06, 0x25, 0x68, 0x16, 0x1a, 0x33, 0x3f, 0x90, 0xc7, 0x78, 0x2d, 0x98, 0x3c, 0x2f, 0xb9, 0x2d, 0x94, 0x0b, 0xfb, 0x49, 0x56, 0x30, 0xd7, 0xc1, 0xe6, 0x48, - /* (2^367)P */ 0x7a, 0xd1, 0xe0, 0x8e, 0x67, 0xfc, 0x0b, 0x50, 0x1f, 0x84, 0x98, 0xfa, 0xaf, 0xae, 0x2e, 0x31, 0x27, 0xcf, 0x3f, 0xf2, 0x6e, 0x8d, 0x81, 0x8f, 0xd2, 0x5f, 0xde, 0xd3, 0x5e, 0xe9, 0xe7, 0x13, 0x48, 0x83, 0x5a, 0x4e, 0x84, 0xd1, 0x58, 0xcf, 0x6b, 0x84, 0xdf, 0x13, 0x1d, 0x91, 0x85, 0xe8, 0xcb, 0x29, 0x79, 0xd2, 0xca, 0xac, 0x6a, 0x93, - /* (2^368)P */ 0x53, 0x82, 0xce, 0x61, 0x96, 0x88, 0x6f, 0xe1, 0x4a, 0x4c, 0x1e, 0x30, 0x73, 0xe8, 0x74, 0xde, 0x40, 0x2b, 0xe0, 0xc4, 0xb5, 0xd8, 0x7c, 0x15, 0xe7, 0xe1, 0xb1, 0xe0, 0xd6, 0x88, 0xb1, 0x6a, 0x57, 0x19, 0x6a, 0x22, 0x66, 0x57, 0xf6, 0x8d, 0xfd, 0xc0, 0xf2, 0xa3, 0x03, 0x56, 0xfb, 0x2e, 0x75, 0x5e, 0xc7, 0x8e, 0x22, 0x96, 0x5c, 0x06, - /* (2^369)P */ 0x98, 0x7e, 0xbf, 0x3e, 0xbf, 0x24, 0x9d, 0x15, 0xd3, 0xf6, 0xd3, 0xd2, 0xf0, 0x11, 0xf2, 0xdb, 0x36, 0x23, 0x38, 0xf7, 0x1d, 0x71, 0x20, 0xd2, 0x54, 0x7f, 0x1e, 0x24, 0x8f, 0xe2, 0xaa, 0xf7, 0x3f, 0x6b, 0x41, 0x4e, 0xdc, 0x0e, 0xec, 0xe8, 0x35, 0x0a, 0x08, 0x6d, 0x89, 0x5b, 0x32, 0x91, 0x01, 0xb6, 0xe0, 0x2c, 0xc6, 0xa1, 0xbe, 0xb4, - /* (2^370)P */ 0x29, 0xf2, 0x1e, 0x1c, 0xdc, 0x68, 0x8a, 0x43, 0x87, 0x2c, 0x48, 0xb3, 0x9e, 0xed, 0xd2, 0x82, 0x46, 0xac, 0x2f, 0xef, 0x93, 0x34, 0x37, 0xca, 0x64, 0x8d, 0xc9, 0x06, 0x90, 0xbb, 0x78, 0x0a, 0x3c, 0x4c, 0xcf, 0x35, 0x7a, 0x0f, 0xf7, 0xa7, 0xf4, 0x2f, 0x45, 0x69, 0x3f, 0xa9, 0x5d, 0xce, 0x7b, 0x8a, 0x84, 0xc3, 0xae, 0xf4, 0xda, 0xd5, - /* (2^371)P */ 0xca, 0xba, 0x95, 0x43, 0x05, 0x7b, 0x06, 0xd9, 0x5c, 0x0a, 0x18, 0x5f, 0x6a, 0x6a, 0xce, 0xc0, 0x3d, 0x95, 0x51, 0x0e, 0x1a, 0xbe, 0x85, 0x7a, 0xf2, 0x69, 0xec, 0xc0, 0x8c, 0xca, 0xa3, 0x32, 0x0a, 0x76, 0x50, 0xc6, 0x76, 0x61, 0x00, 0x89, 0xbf, 0x6e, 0x0f, 0x48, 0x90, 0x31, 0x93, 0xec, 0x34, 0x70, 0xf0, 0xc3, 0x8d, 0xf0, 0x0f, 0xb5, - /* (2^372)P */ 0xbe, 0x23, 0xe2, 0x18, 0x99, 0xf1, 0xed, 0x8a, 0xf6, 0xc9, 0xac, 0xb8, 0x1e, 0x9a, 0x3c, 0x15, 0xae, 0xd7, 0x6d, 0xb3, 0x04, 0xee, 0x5b, 0x0d, 0x1e, 0x79, 0xb7, 0xf9, 0xf9, 0x8d, 0xad, 0xf9, 0x8f, 0x5a, 0x6a, 0x7b, 0xd7, 0x9b, 0xca, 0x62, 0xfe, 0x9c, 0xc0, 0x6f, 0x6d, 0x9d, 0x76, 0xa3, 0x69, 0xb9, 0x4c, 0xa1, 0xc4, 0x0c, 0x76, 0xaa, - /* (2^373)P */ 0x1c, 0x06, 0xfe, 0x3f, 0x45, 0x70, 0xcd, 0x97, 0xa9, 0xa2, 0xb1, 0xd3, 0xf2, 0xa5, 0x0c, 0x49, 0x2c, 0x75, 0x73, 0x1f, 0xcf, 0x00, 0xaf, 0xd5, 0x2e, 0xde, 0x0d, 0x8f, 0x8f, 0x7c, 0xc4, 0x58, 0xce, 0xd4, 0xf6, 0x24, 0x19, 0x2e, 0xd8, 0xc5, 0x1d, 0x1a, 0x3f, 0xb8, 0x4f, 0xbc, 0x7d, 0xbd, 0x68, 0xe3, 0x81, 0x98, 0x1b, 0xa8, 0xc9, 0xd9, - /* (2^374)P */ 0x39, 0x95, 0x78, 0x24, 0x6c, 0x38, 0xe4, 0xe7, 0xd0, 0x8d, 0xb9, 0x38, 0x71, 0x5e, 0xc1, 0x62, 0x80, 0xcc, 0xcb, 0x8c, 0x97, 0xca, 0xf8, 0xb9, 0xd9, 0x9c, 0xce, 0x72, 0x7b, 0x70, 0xee, 0x5f, 0xea, 0xa2, 0xdf, 0xa9, 0x14, 0x10, 0xf9, 0x6e, 0x59, 0x9f, 0x9c, 0xe0, 0x0c, 0xb2, 0x07, 0x97, 0xcd, 0xd2, 0x89, 0x16, 0xfd, 0x9c, 0xa8, 0xa5, - /* (2^375)P */ 0x5a, 0x61, 0xf1, 0x59, 0x7c, 0x38, 0xda, 0xe2, 0x85, 0x99, 0x68, 0xe9, 0xc9, 0xf7, 0x32, 0x7e, 0xc4, 0xca, 0xb7, 0x11, 0x08, 0x69, 0x2b, 0x66, 0x02, 0xf7, 0x2e, 0x18, 0xc3, 0x8e, 0xe1, 0xf9, 0xc5, 0x19, 0x9a, 0x0a, 0x9c, 0x07, 0xba, 0xc7, 0x9c, 0x03, 0x34, 0x89, 0x99, 0x67, 0x0b, 0x16, 0x4b, 0x07, 0x36, 0x16, 0x36, 0x2c, 0xe2, 0xa1, - /* (2^376)P */ 0x70, 0x10, 0x91, 0x27, 0xa8, 0x24, 0x8e, 0x29, 0x04, 0x6f, 0x79, 0x1f, 0xd3, 0xa5, 0x68, 0xd3, 0x0b, 0x7d, 0x56, 0x4d, 0x14, 0x57, 0x7b, 0x2e, 0x00, 0x9f, 0x9a, 0xfd, 0x6c, 0x63, 0x18, 0x81, 0xdb, 0x9d, 0xb7, 0xd7, 0xa4, 0x1e, 0xe8, 0x40, 0xf1, 0x4c, 0xa3, 0x01, 0xd5, 0x4b, 0x75, 0xea, 0xdd, 0x97, 0xfd, 0x5b, 0xb2, 0x66, 0x6a, 0x24, - /* (2^377)P */ 0x72, 0x11, 0xfe, 0x73, 0x1b, 0xd3, 0xea, 0x7f, 0x93, 0x15, 0x15, 0x05, 0xfe, 0x40, 0xe8, 0x28, 0xd8, 0x50, 0x47, 0x66, 0xfa, 0xb7, 0xb5, 0x04, 0xba, 0x35, 0x1e, 0x32, 0x9f, 0x5f, 0x32, 0xba, 0x3d, 0xd1, 0xed, 0x9a, 0x76, 0xca, 0xa3, 0x3e, 0x77, 0xd8, 0xd8, 0x7c, 0x5f, 0x68, 0x42, 0xb5, 0x86, 0x7f, 0x3b, 0xc9, 0xc1, 0x89, 0x64, 0xda, - /* (2^378)P */ 0xd5, 0xd4, 0x17, 0x31, 0xfc, 0x6a, 0xfd, 0xb8, 0xe8, 0xe5, 0x3e, 0x39, 0x06, 0xe4, 0xd1, 0x90, 0x2a, 0xca, 0xf6, 0x54, 0x6c, 0x1b, 0x2f, 0x49, 0x97, 0xb1, 0x2a, 0x82, 0x43, 0x3d, 0x1f, 0x8b, 0xe2, 0x47, 0xc5, 0x24, 0xa8, 0xd5, 0x53, 0x29, 0x7d, 0xc6, 0x87, 0xa6, 0x25, 0x3a, 0x64, 0xdd, 0x71, 0x08, 0x9e, 0xcd, 0xe9, 0x45, 0xc7, 0xba, - /* (2^379)P */ 0x37, 0x72, 0x6d, 0x13, 0x7a, 0x8d, 0x04, 0x31, 0xe6, 0xe3, 0x9e, 0x36, 0x71, 0x3e, 0xc0, 0x1e, 0xe3, 0x71, 0xd3, 0x49, 0x4e, 0x4a, 0x36, 0x42, 0x68, 0x68, 0x61, 0xc7, 0x3c, 0xdb, 0x81, 0x49, 0xf7, 0x91, 0x4d, 0xea, 0x4c, 0x4f, 0x98, 0xc6, 0x7e, 0x60, 0x84, 0x4b, 0x6a, 0x37, 0xbb, 0x52, 0xf7, 0xce, 0x02, 0xe4, 0xad, 0xd1, 0x3c, 0xa7, - /* (2^380)P */ 0x51, 0x06, 0x2d, 0xf8, 0x08, 0xe8, 0xf1, 0x0c, 0xe5, 0xa9, 0xac, 0x29, 0x73, 0x3b, 0xed, 0x98, 0x5f, 0x55, 0x08, 0x38, 0x51, 0x44, 0x36, 0x5d, 0xea, 0xc3, 0xb8, 0x0e, 0xa0, 0x4f, 0xd2, 0x79, 0xe9, 0x98, 0xc3, 0xf5, 0x00, 0xb9, 0x26, 0x27, 0x42, 0xa8, 0x07, 0xc1, 0x12, 0x31, 0xc1, 0xc3, 0x3c, 0x3b, 0x7a, 0x72, 0x97, 0xc2, 0x70, 0x3a, - /* (2^381)P */ 0xf4, 0xb2, 0xba, 0x32, 0xbc, 0xa9, 0x2f, 0x87, 0xc7, 0x3c, 0x45, 0xcd, 0xae, 0xe2, 0x13, 0x6d, 0x3a, 0xf2, 0xf5, 0x66, 0x97, 0x29, 0xaf, 0x53, 0x9f, 0xda, 0xea, 0x14, 0xdf, 0x04, 0x98, 0x19, 0x95, 0x9e, 0x2a, 0x00, 0x5c, 0x9d, 0x1d, 0xf0, 0x39, 0x23, 0xff, 0xfc, 0xca, 0x36, 0xb7, 0xde, 0xdf, 0x37, 0x78, 0x52, 0x21, 0xfa, 0x19, 0x10, - /* (2^382)P */ 0x50, 0x20, 0x73, 0x74, 0x62, 0x21, 0xf2, 0xf7, 0x9b, 0x66, 0x85, 0x34, 0x74, 0xd4, 0x9d, 0x60, 0xd7, 0xbc, 0xc8, 0x46, 0x3b, 0xb8, 0x80, 0x42, 0x15, 0x0a, 0x6c, 0x35, 0x1a, 0x69, 0xf0, 0x1d, 0x4b, 0x29, 0x54, 0x5a, 0x9a, 0x48, 0xec, 0x9f, 0x37, 0x74, 0x91, 0xd0, 0xd1, 0x9e, 0x00, 0xc2, 0x76, 0x56, 0xd6, 0xa0, 0x15, 0x14, 0x83, 0x59, - /* (2^383)P */ 0xc2, 0xf8, 0x22, 0x20, 0x23, 0x07, 0xbd, 0x1d, 0x6f, 0x1e, 0x8c, 0x56, 0x06, 0x6a, 0x4b, 0x9f, 0xe2, 0xa9, 0x92, 0x46, 0x4b, 0x46, 0x59, 0xd7, 0xe1, 0xda, 0x14, 0x98, 0x07, 0x65, 0x7e, 0x28, 0x20, 0xf2, 0x9d, 0x4f, 0x36, 0x5c, 0x92, 0xe0, 0x9d, 0xfe, 0x3e, 0xda, 0xe4, 0x47, 0x19, 0x3c, 0x00, 0x7f, 0x22, 0xf2, 0x9e, 0x51, 0xae, 0x4d, - /* (2^384)P */ 0xbe, 0x8c, 0x1b, 0x10, 0xb6, 0xad, 0xcc, 0xcc, 0xd8, 0x5e, 0x21, 0xa6, 0xfb, 0xf1, 0xf6, 0xbd, 0x0a, 0x24, 0x67, 0xb4, 0x57, 0x7a, 0xbc, 0xe8, 0xe9, 0xff, 0xee, 0x0a, 0x1f, 0xee, 0xbd, 0xc8, 0x44, 0xed, 0x2b, 0xbb, 0x55, 0x1f, 0xdd, 0x7c, 0xb3, 0xeb, 0x3f, 0x63, 0xa1, 0x28, 0x91, 0x21, 0xab, 0x71, 0xc6, 0x4c, 0xd0, 0xe9, 0xb0, 0x21, - /* (2^385)P */ 0xad, 0xc9, 0x77, 0x2b, 0xee, 0x89, 0xa4, 0x7b, 0xfd, 0xf9, 0xf6, 0x14, 0xe4, 0xed, 0x1a, 0x16, 0x9b, 0x78, 0x41, 0x43, 0xa8, 0x83, 0x72, 0x06, 0x2e, 0x7c, 0xdf, 0xeb, 0x7e, 0xdd, 0xd7, 0x8b, 0xea, 0x9a, 0x2b, 0x03, 0xba, 0x57, 0xf3, 0xf1, 0xd9, 0xe5, 0x09, 0xc5, 0x98, 0x61, 0x1c, 0x51, 0x6d, 0x5d, 0x6e, 0xfb, 0x5e, 0x95, 0x9f, 0xb5, - /* (2^386)P */ 0x23, 0xe2, 0x1e, 0x95, 0xa3, 0x5e, 0x42, 0x10, 0xc7, 0xc3, 0x70, 0xbf, 0x4b, 0x6b, 0x83, 0x36, 0x93, 0xb7, 0x68, 0x47, 0x88, 0x3a, 0x10, 0x88, 0x48, 0x7f, 0x8c, 0xae, 0x54, 0x10, 0x02, 0xa4, 0x52, 0x8f, 0x8d, 0xf7, 0x26, 0x4f, 0x50, 0xc3, 0x6a, 0xe2, 0x4e, 0x3b, 0x4c, 0xb9, 0x8a, 0x14, 0x15, 0x6d, 0x21, 0x29, 0xb3, 0x6e, 0x4e, 0xd0, - /* (2^387)P */ 0x4c, 0x8a, 0x18, 0x3f, 0xb7, 0x20, 0xfd, 0x3e, 0x54, 0xca, 0x68, 0x3c, 0xea, 0x6f, 0xf4, 0x6b, 0xa2, 0xbd, 0x01, 0xbd, 0xfe, 0x08, 0xa8, 0xd8, 0xc2, 0x20, 0x36, 0x05, 0xcd, 0xe9, 0xf3, 0x9e, 0xfa, 0x85, 0x66, 0x8f, 0x4b, 0x1d, 0x8c, 0x64, 0x4f, 0xb8, 0xc6, 0x0f, 0x5b, 0x57, 0xd8, 0x24, 0x19, 0x5a, 0x14, 0x4b, 0x92, 0xd3, 0x96, 0xbc, - /* (2^388)P */ 0xa9, 0x3f, 0xc9, 0x6c, 0xca, 0x64, 0x1e, 0x6f, 0xdf, 0x65, 0x7f, 0x9a, 0x47, 0x6b, 0x8a, 0x60, 0x31, 0xa6, 0x06, 0xac, 0x69, 0x30, 0xe6, 0xea, 0x63, 0x42, 0x26, 0x5f, 0xdb, 0xd0, 0xf2, 0x8e, 0x34, 0x0a, 0x3a, 0xeb, 0xf3, 0x79, 0xc8, 0xb7, 0x60, 0x56, 0x5c, 0x37, 0x95, 0x71, 0xf8, 0x7f, 0x49, 0x3e, 0x9e, 0x01, 0x26, 0x1e, 0x80, 0x9f, - /* (2^389)P */ 0xf8, 0x16, 0x9a, 0xaa, 0xb0, 0x28, 0xb5, 0x8e, 0xd0, 0x60, 0xe5, 0x26, 0xa9, 0x47, 0xc4, 0x5c, 0xa9, 0x39, 0xfe, 0x0a, 0xd8, 0x07, 0x2b, 0xb3, 0xce, 0xf1, 0xea, 0x1a, 0xf4, 0x7b, 0x98, 0x31, 0x3d, 0x13, 0x29, 0x80, 0xe8, 0x0d, 0xcf, 0x56, 0x39, 0x86, 0x50, 0x0c, 0xb3, 0x18, 0xf4, 0xc5, 0xca, 0xf2, 0x6f, 0xcd, 0x8d, 0xd5, 0x02, 0xb0, - /* (2^390)P */ 0xbf, 0x39, 0x3f, 0xac, 0x6d, 0x1a, 0x6a, 0xe4, 0x42, 0x24, 0xd6, 0x41, 0x9d, 0xb9, 0x5b, 0x46, 0x73, 0x93, 0x76, 0xaa, 0xb7, 0x37, 0x36, 0xa6, 0x09, 0xe5, 0x04, 0x3b, 0x66, 0xc4, 0x29, 0x3e, 0x41, 0xc2, 0xcb, 0xe5, 0x17, 0xd7, 0x34, 0x67, 0x1d, 0x2c, 0x12, 0xec, 0x24, 0x7a, 0x40, 0xa2, 0x45, 0x41, 0xf0, 0x75, 0xed, 0x43, 0x30, 0xc9, - /* (2^391)P */ 0x80, 0xf6, 0x47, 0x5b, 0xad, 0x54, 0x02, 0xbc, 0xdd, 0xa4, 0xb2, 0xd7, 0x42, 0x95, 0xf2, 0x0d, 0x1b, 0xef, 0x37, 0xa7, 0xb4, 0x34, 0x04, 0x08, 0x71, 0x1b, 0xd3, 0xdf, 0xa1, 0xf0, 0x2b, 0xfa, 0xc0, 0x1f, 0xf3, 0x44, 0xb5, 0xc6, 0x47, 0x3d, 0x65, 0x67, 0x45, 0x4d, 0x2f, 0xde, 0x52, 0x73, 0xfc, 0x30, 0x01, 0x6b, 0xc1, 0x03, 0xd8, 0xd7, - /* (2^392)P */ 0x1c, 0x67, 0x55, 0x3e, 0x01, 0x17, 0x0f, 0x3e, 0xe5, 0x34, 0x58, 0xfc, 0xcb, 0x71, 0x24, 0x74, 0x5d, 0x36, 0x1e, 0x89, 0x2a, 0x63, 0xf8, 0xf8, 0x9f, 0x50, 0x9f, 0x32, 0x92, 0x29, 0xd8, 0x1a, 0xec, 0x76, 0x57, 0x6c, 0x67, 0x12, 0x6a, 0x6e, 0xef, 0x97, 0x1f, 0xc3, 0x77, 0x60, 0x3c, 0x22, 0xcb, 0xc7, 0x04, 0x1a, 0x89, 0x2d, 0x10, 0xa6, - /* (2^393)P */ 0x12, 0xf5, 0xa9, 0x26, 0x16, 0xd9, 0x3c, 0x65, 0x5d, 0x83, 0xab, 0xd1, 0x70, 0x6b, 0x1c, 0xdb, 0xe7, 0x86, 0x0d, 0xfb, 0xe7, 0xf8, 0x2a, 0x58, 0x6e, 0x7a, 0x66, 0x13, 0x53, 0x3a, 0x6f, 0x8d, 0x43, 0x5f, 0x14, 0x23, 0x14, 0xff, 0x3d, 0x52, 0x7f, 0xee, 0xbd, 0x7a, 0x34, 0x8b, 0x35, 0x24, 0xc3, 0x7a, 0xdb, 0xcf, 0x22, 0x74, 0x9a, 0x8f, - /* (2^394)P */ 0xdb, 0x20, 0xfc, 0xe5, 0x39, 0x4e, 0x7d, 0x78, 0xee, 0x0b, 0xbf, 0x1d, 0x80, 0xd4, 0x05, 0x4f, 0xb9, 0xd7, 0x4e, 0x94, 0x88, 0x9a, 0x50, 0x78, 0x1a, 0x70, 0x8c, 0xcc, 0x25, 0xb6, 0x61, 0x09, 0xdc, 0x7b, 0xea, 0x3f, 0x7f, 0xea, 0x2a, 0x0d, 0x47, 0x1c, 0x8e, 0xa6, 0x5b, 0xd2, 0xa3, 0x61, 0x93, 0x3c, 0x68, 0x9f, 0x8b, 0xea, 0xb0, 0xcb, - /* (2^395)P */ 0xff, 0x54, 0x02, 0x19, 0xae, 0x8b, 0x4c, 0x2c, 0x3a, 0xe0, 0xe4, 0xac, 0x87, 0xf7, 0x51, 0x45, 0x41, 0x43, 0xdc, 0xaa, 0xcd, 0xcb, 0xdc, 0x40, 0xe3, 0x44, 0x3b, 0x1d, 0x9e, 0x3d, 0xb9, 0x82, 0xcc, 0x7a, 0xc5, 0x12, 0xf8, 0x1e, 0xdd, 0xdb, 0x8d, 0xb0, 0x2a, 0xe8, 0xe6, 0x6c, 0x94, 0x3b, 0xb7, 0x2d, 0xba, 0x79, 0x3b, 0xb5, 0x86, 0xfb, - /* (2^396)P */ 0x82, 0x88, 0x13, 0xdd, 0x6c, 0xcd, 0x85, 0x2b, 0x90, 0x86, 0xb7, 0xac, 0x16, 0xa6, 0x6e, 0x6a, 0x94, 0xd8, 0x1e, 0x4e, 0x41, 0x0f, 0xce, 0x81, 0x6a, 0xa8, 0x26, 0x56, 0x43, 0x52, 0x52, 0xe6, 0xff, 0x88, 0xcf, 0x47, 0x05, 0x1d, 0xff, 0xf3, 0xa0, 0x10, 0xb2, 0x97, 0x87, 0xeb, 0x47, 0xbb, 0xfa, 0x1f, 0xe8, 0x4c, 0xce, 0xc4, 0xcd, 0x93, - /* (2^397)P */ 0xf4, 0x11, 0xf5, 0x8d, 0x89, 0x29, 0x79, 0xb3, 0x59, 0x0b, 0x29, 0x7d, 0x9c, 0x12, 0x4a, 0x65, 0x72, 0x3a, 0xf9, 0xec, 0x37, 0x18, 0x86, 0xef, 0x44, 0x07, 0x25, 0x74, 0x76, 0x53, 0xed, 0x51, 0x01, 0xc6, 0x28, 0xc5, 0xc3, 0x4a, 0x0f, 0x99, 0xec, 0xc8, 0x40, 0x5a, 0x83, 0x30, 0x79, 0xa2, 0x3e, 0x63, 0x09, 0x2d, 0x6f, 0x23, 0x54, 0x1c, - /* (2^398)P */ 0x5c, 0x6f, 0x3b, 0x1c, 0x30, 0x77, 0x7e, 0x87, 0x66, 0x83, 0x2e, 0x7e, 0x85, 0x50, 0xfd, 0xa0, 0x7a, 0xc2, 0xf5, 0x0f, 0xc1, 0x64, 0xe7, 0x0b, 0xbd, 0x59, 0xa7, 0xe7, 0x65, 0x53, 0xc3, 0xf5, 0x55, 0x5b, 0xe1, 0x82, 0x30, 0x5a, 0x61, 0xcd, 0xa0, 0x89, 0x32, 0xdb, 0x87, 0xfc, 0x21, 0x8a, 0xab, 0x6d, 0x82, 0xa8, 0x42, 0x81, 0x4f, 0xf2, - /* (2^399)P */ 0xb3, 0xeb, 0x88, 0x18, 0xf6, 0x56, 0x96, 0xbf, 0xba, 0x5d, 0x71, 0xa1, 0x5a, 0xd1, 0x04, 0x7b, 0xd5, 0x46, 0x01, 0x74, 0xfe, 0x15, 0x25, 0xb7, 0xff, 0x0c, 0x24, 0x47, 0xac, 0xfd, 0xab, 0x47, 0x32, 0xe1, 0x6a, 0x4e, 0xca, 0xcf, 0x7f, 0xdd, 0xf8, 0xd2, 0x4b, 0x3b, 0xf5, 0x17, 0xba, 0xba, 0x8b, 0xa1, 0xec, 0x28, 0x3f, 0x97, 0xab, 0x2a, - /* (2^400)P */ 0x51, 0x38, 0xc9, 0x5e, 0xc6, 0xb3, 0x64, 0xf2, 0x24, 0x4d, 0x04, 0x7d, 0xc8, 0x39, 0x0c, 0x4a, 0xc9, 0x73, 0x74, 0x1b, 0x5c, 0xb2, 0xc5, 0x41, 0x62, 0xa0, 0x4c, 0x6d, 0x8d, 0x91, 0x9a, 0x7b, 0x88, 0xab, 0x9c, 0x7e, 0x23, 0xdb, 0x6f, 0xb5, 0x72, 0xd6, 0x47, 0x40, 0xef, 0x22, 0x58, 0x62, 0x19, 0x6c, 0x38, 0xba, 0x5b, 0x00, 0x30, 0x9f, - /* (2^401)P */ 0x65, 0xbb, 0x3b, 0x9b, 0xe9, 0xae, 0xbf, 0xbe, 0xe4, 0x13, 0x95, 0xf3, 0xe3, 0x77, 0xcb, 0xe4, 0x9a, 0x22, 0xb5, 0x4a, 0x08, 0x9d, 0xb3, 0x9e, 0x27, 0xe0, 0x15, 0x6c, 0x9f, 0x7e, 0x9a, 0x5e, 0x15, 0x45, 0x25, 0x8d, 0x01, 0x0a, 0xd2, 0x2b, 0xbd, 0x48, 0x06, 0x0d, 0x18, 0x97, 0x4b, 0xdc, 0xbc, 0xf0, 0xcd, 0xb2, 0x52, 0x3c, 0xac, 0xf5, - /* (2^402)P */ 0x3e, 0xed, 0x47, 0x6b, 0x5c, 0xf6, 0x76, 0xd0, 0xe9, 0x15, 0xa3, 0xcb, 0x36, 0x00, 0x21, 0xa3, 0x79, 0x20, 0xa5, 0x3e, 0x88, 0x03, 0xcb, 0x7e, 0x63, 0xbb, 0xed, 0xa9, 0x13, 0x35, 0x16, 0xaf, 0x2e, 0xb4, 0x70, 0x14, 0x93, 0xfb, 0xc4, 0x9b, 0xd8, 0xb1, 0xbe, 0x43, 0xd1, 0x85, 0xb8, 0x97, 0xef, 0xea, 0x88, 0xa1, 0x25, 0x52, 0x62, 0x75, - /* (2^403)P */ 0x8e, 0x4f, 0xaa, 0x23, 0x62, 0x7e, 0x2b, 0x37, 0x89, 0x00, 0x11, 0x30, 0xc5, 0x33, 0x4a, 0x89, 0x8a, 0xe2, 0xfc, 0x5c, 0x6a, 0x75, 0xe5, 0xf7, 0x02, 0x4a, 0x9b, 0xf7, 0xb5, 0x6a, 0x85, 0x31, 0xd3, 0x5a, 0xcf, 0xc3, 0xf8, 0xde, 0x2f, 0xcf, 0xb5, 0x24, 0xf4, 0xe3, 0xa1, 0xad, 0x42, 0xae, 0x09, 0xb9, 0x2e, 0x04, 0x2d, 0x01, 0x22, 0x3f, - /* (2^404)P */ 0x41, 0x16, 0xfb, 0x7d, 0x50, 0xfd, 0xb5, 0xba, 0x88, 0x24, 0xba, 0xfd, 0x3d, 0xb2, 0x90, 0x15, 0xb7, 0xfa, 0xa2, 0xe1, 0x4c, 0x7d, 0xb9, 0xc6, 0xff, 0x81, 0x57, 0xb6, 0xc2, 0x9e, 0xcb, 0xc4, 0x35, 0xbd, 0x01, 0xb7, 0xaa, 0xce, 0xd0, 0xe9, 0xb5, 0xd6, 0x72, 0xbf, 0xd2, 0xee, 0xc7, 0xac, 0x94, 0xff, 0x29, 0x57, 0x02, 0x49, 0x09, 0xad, - /* (2^405)P */ 0x27, 0xa5, 0x78, 0x1b, 0xbf, 0x6b, 0xaf, 0x0b, 0x8c, 0xd9, 0xa8, 0x37, 0xb0, 0x67, 0x18, 0xb6, 0xc7, 0x05, 0x8a, 0x67, 0x03, 0x30, 0x62, 0x6e, 0x56, 0x82, 0xa9, 0x54, 0x3e, 0x0c, 0x4e, 0x07, 0xe1, 0x5a, 0x38, 0xed, 0xfa, 0xc8, 0x55, 0x6b, 0x08, 0xa3, 0x6b, 0x64, 0x2a, 0x15, 0xd6, 0x39, 0x6f, 0x47, 0x99, 0x42, 0x3f, 0x33, 0x84, 0x8f, - /* (2^406)P */ 0xbc, 0x45, 0x29, 0x81, 0x0e, 0xa4, 0xc5, 0x72, 0x3a, 0x10, 0xe1, 0xc4, 0x1e, 0xda, 0xc3, 0xfe, 0xb0, 0xce, 0xd2, 0x13, 0x34, 0x67, 0x21, 0xc6, 0x7e, 0xf9, 0x8c, 0xff, 0x39, 0x50, 0xae, 0x92, 0x60, 0x35, 0x2f, 0x8b, 0x6e, 0xc9, 0xc1, 0x27, 0x3a, 0x94, 0x66, 0x3e, 0x26, 0x84, 0x93, 0xc8, 0x6c, 0xcf, 0xd2, 0x03, 0xa1, 0x10, 0xcf, 0xb7, - /* (2^407)P */ 0x64, 0xda, 0x19, 0xf6, 0xc5, 0x73, 0x17, 0x44, 0x88, 0x81, 0x07, 0x0d, 0x34, 0xb2, 0x75, 0xf9, 0xd9, 0xe2, 0xe0, 0x8b, 0x71, 0xcf, 0x72, 0x34, 0x83, 0xb4, 0xce, 0xfc, 0xd7, 0x29, 0x09, 0x5a, 0x98, 0xbf, 0x14, 0xac, 0x77, 0x55, 0x38, 0x47, 0x5b, 0x0f, 0x40, 0x24, 0xe5, 0xa5, 0xa6, 0xac, 0x2d, 0xa6, 0xff, 0x9c, 0x73, 0xfe, 0x5c, 0x7e, - /* (2^408)P */ 0x1e, 0x33, 0xcc, 0x68, 0xb2, 0xbc, 0x8c, 0x93, 0xaf, 0xcc, 0x38, 0xf8, 0xd9, 0x16, 0x72, 0x50, 0xac, 0xd9, 0xb5, 0x0b, 0x9a, 0xbe, 0x46, 0x7a, 0xf1, 0xee, 0xf1, 0xad, 0xec, 0x5b, 0x59, 0x27, 0x9c, 0x05, 0xa3, 0x87, 0xe0, 0x37, 0x2c, 0x83, 0xce, 0xb3, 0x65, 0x09, 0x8e, 0xc3, 0x9c, 0xbf, 0x6a, 0xa2, 0x00, 0xcc, 0x12, 0x36, 0xc5, 0x95, - /* (2^409)P */ 0x36, 0x11, 0x02, 0x14, 0x9c, 0x3c, 0xeb, 0x2f, 0x23, 0x5b, 0x6b, 0x2b, 0x08, 0x54, 0x53, 0xac, 0xb2, 0xa3, 0xe0, 0x26, 0x62, 0x3c, 0xe4, 0xe1, 0x81, 0xee, 0x13, 0x3e, 0xa4, 0x97, 0xef, 0xf9, 0x92, 0x27, 0x01, 0xce, 0x54, 0x8b, 0x3e, 0x31, 0xbe, 0xa7, 0x88, 0xcf, 0x47, 0x99, 0x3c, 0x10, 0x6f, 0x60, 0xb3, 0x06, 0x4e, 0xee, 0x1b, 0xf0, - /* (2^410)P */ 0x59, 0x49, 0x66, 0xcf, 0x22, 0xe6, 0xf6, 0x73, 0xfe, 0xa3, 0x1c, 0x09, 0xfa, 0x5f, 0x65, 0xa8, 0xf0, 0x82, 0xc2, 0xef, 0x16, 0x63, 0x6e, 0x79, 0x69, 0x51, 0x39, 0x07, 0x65, 0xc4, 0x81, 0xec, 0x73, 0x0f, 0x15, 0x93, 0xe1, 0x30, 0x33, 0xe9, 0x37, 0x86, 0x42, 0x4c, 0x1f, 0x9b, 0xad, 0xee, 0x3f, 0xf1, 0x2a, 0x8e, 0x6a, 0xa3, 0xc8, 0x35, - /* (2^411)P */ 0x1e, 0x49, 0xf1, 0xdd, 0xd2, 0x9c, 0x8e, 0x78, 0xb2, 0x06, 0xe4, 0x6a, 0xab, 0x3a, 0xdc, 0xcd, 0xf4, 0xeb, 0xe1, 0xe7, 0x2f, 0xaa, 0xeb, 0x40, 0x31, 0x9f, 0xb9, 0xab, 0x13, 0xa9, 0x78, 0xbf, 0x38, 0x89, 0x0e, 0x85, 0x14, 0x8b, 0x46, 0x76, 0x14, 0xda, 0xcf, 0x33, 0xc8, 0x79, 0xd3, 0xd5, 0xa3, 0x6a, 0x69, 0x45, 0x70, 0x34, 0xc3, 0xe9, - /* (2^412)P */ 0x5e, 0xe7, 0x78, 0xe9, 0x24, 0xcc, 0xe9, 0xf4, 0xc8, 0x6b, 0xe0, 0xfb, 0x3a, 0xbe, 0xcc, 0x42, 0x4a, 0x00, 0x22, 0xf8, 0xe6, 0x32, 0xbe, 0x6d, 0x18, 0x55, 0x60, 0xe9, 0x72, 0x69, 0x50, 0x56, 0xca, 0x04, 0x18, 0x38, 0xa1, 0xee, 0xd8, 0x38, 0x3c, 0xa7, 0x70, 0xe2, 0xb9, 0x4c, 0xa0, 0xc8, 0x89, 0x72, 0xcf, 0x49, 0x7f, 0xdf, 0xbc, 0x67, - /* (2^413)P */ 0x1d, 0x17, 0xcb, 0x0b, 0xbd, 0xb2, 0x36, 0xe3, 0xa8, 0x99, 0x31, 0xb6, 0x26, 0x9c, 0x0c, 0x74, 0xaf, 0x4d, 0x24, 0x61, 0xcf, 0x31, 0x7b, 0xed, 0xdd, 0xc3, 0xf6, 0x32, 0x70, 0xfe, 0x17, 0xf6, 0x51, 0x37, 0x65, 0xce, 0x5d, 0xaf, 0xa5, 0x2f, 0x2a, 0xfe, 0x00, 0x71, 0x7c, 0x50, 0xbe, 0x21, 0xc7, 0xed, 0xc6, 0xfc, 0x67, 0xcf, 0x9c, 0xdd, - /* (2^414)P */ 0x26, 0x3e, 0xf8, 0xbb, 0xd0, 0xb1, 0x01, 0xd8, 0xeb, 0x0b, 0x62, 0x87, 0x35, 0x4c, 0xde, 0xca, 0x99, 0x9c, 0x6d, 0xf7, 0xb6, 0xf0, 0x57, 0x0a, 0x52, 0x29, 0x6a, 0x3f, 0x26, 0x31, 0x04, 0x07, 0x2a, 0xc9, 0xfa, 0x9b, 0x0e, 0x62, 0x8e, 0x72, 0xf2, 0xad, 0xce, 0xb6, 0x35, 0x7a, 0xc1, 0xae, 0x35, 0xc7, 0xa3, 0x14, 0xcf, 0x0c, 0x28, 0xb7, - /* (2^415)P */ 0xa6, 0xf1, 0x32, 0x3a, 0x20, 0xd2, 0x24, 0x97, 0xcf, 0x5d, 0x37, 0x99, 0xaf, 0x33, 0x7a, 0x5b, 0x7a, 0xcc, 0x4e, 0x41, 0x38, 0xb1, 0x4e, 0xad, 0xc9, 0xd9, 0x71, 0x7e, 0xb2, 0xf5, 0xd5, 0x01, 0x6c, 0x4d, 0xfd, 0xa1, 0xda, 0x03, 0x38, 0x9b, 0x3d, 0x92, 0x92, 0xf2, 0xca, 0xbf, 0x1f, 0x24, 0xa4, 0xbb, 0x30, 0x6a, 0x74, 0x56, 0xc8, 0xce, - /* (2^416)P */ 0x27, 0xf4, 0xed, 0xc9, 0xc3, 0xb1, 0x79, 0x85, 0xbe, 0xf6, 0xeb, 0xf3, 0x55, 0xc7, 0xaa, 0xa6, 0xe9, 0x07, 0x5d, 0xf4, 0xeb, 0xa6, 0x81, 0xe3, 0x0e, 0xcf, 0xa3, 0xc1, 0xef, 0xe7, 0x34, 0xb2, 0x03, 0x73, 0x8a, 0x91, 0xf1, 0xad, 0x05, 0xc7, 0x0b, 0x43, 0x99, 0x12, 0x31, 0xc8, 0xc7, 0xc5, 0xa4, 0x3d, 0xcd, 0xe5, 0x4e, 0x6d, 0x24, 0xdd, - /* (2^417)P */ 0x61, 0x54, 0xd0, 0x95, 0x2c, 0x45, 0x75, 0xac, 0xb5, 0x1a, 0x9d, 0x11, 0xeb, 0xed, 0x6b, 0x57, 0xa3, 0xe6, 0xcd, 0x77, 0xd4, 0x83, 0x8e, 0x39, 0xf1, 0x0f, 0x98, 0xcb, 0x40, 0x02, 0x6e, 0x10, 0x82, 0x9e, 0xb4, 0x93, 0x76, 0xd7, 0x97, 0xa3, 0x53, 0x12, 0x86, 0xc6, 0x15, 0x78, 0x73, 0x93, 0xe7, 0x7f, 0xcf, 0x1f, 0xbf, 0xcd, 0xd2, 0x7a, - /* (2^418)P */ 0xc2, 0x21, 0xdc, 0xd5, 0x69, 0xff, 0xca, 0x49, 0x3a, 0xe1, 0xc3, 0x69, 0x41, 0x56, 0xc1, 0x76, 0x63, 0x24, 0xbd, 0x64, 0x1b, 0x3d, 0x92, 0xf9, 0x13, 0x04, 0x25, 0xeb, 0x27, 0xa6, 0xef, 0x39, 0x3a, 0x80, 0xe0, 0xf8, 0x27, 0xee, 0xc9, 0x49, 0x77, 0xef, 0x3f, 0x29, 0x3d, 0x5e, 0xe6, 0x66, 0x83, 0xd1, 0xf6, 0xfe, 0x9d, 0xbc, 0xf1, 0x96, - /* (2^419)P */ 0x6b, 0xc6, 0x99, 0x26, 0x3c, 0xf3, 0x63, 0xf9, 0xc7, 0x29, 0x8c, 0x52, 0x62, 0x2d, 0xdc, 0x8a, 0x66, 0xce, 0x2c, 0xa7, 0xe4, 0xf0, 0xd7, 0x37, 0x17, 0x1e, 0xe4, 0xa3, 0x53, 0x7b, 0x29, 0x8e, 0x60, 0x99, 0xf9, 0x0c, 0x7c, 0x6f, 0xa2, 0xcc, 0x9f, 0x80, 0xdd, 0x5e, 0x46, 0xaa, 0x0d, 0x6c, 0xc9, 0x6c, 0xf7, 0x78, 0x5b, 0x38, 0xe3, 0x24, - /* (2^420)P */ 0x4b, 0x75, 0x6a, 0x2f, 0x08, 0xe1, 0x72, 0x76, 0xab, 0x82, 0x96, 0xdf, 0x3b, 0x1f, 0x9b, 0xd8, 0xed, 0xdb, 0xcd, 0x15, 0x09, 0x5a, 0x1e, 0xb7, 0xc5, 0x26, 0x72, 0x07, 0x0c, 0x50, 0xcd, 0x3b, 0x4d, 0x3f, 0xa2, 0x67, 0xc2, 0x02, 0x61, 0x2e, 0x68, 0xe9, 0x6f, 0xf0, 0x21, 0x2a, 0xa7, 0x3b, 0x88, 0x04, 0x11, 0x64, 0x49, 0x0d, 0xb4, 0x46, - /* (2^421)P */ 0x63, 0x85, 0xf3, 0xc5, 0x2b, 0x5a, 0x9f, 0xf0, 0x17, 0xcb, 0x45, 0x0a, 0xf3, 0x6e, 0x7e, 0xb0, 0x7c, 0xbc, 0xf0, 0x4f, 0x3a, 0xb0, 0xbc, 0x36, 0x36, 0x52, 0x51, 0xcb, 0xfe, 0x9a, 0xcb, 0xe8, 0x7e, 0x4b, 0x06, 0x7f, 0xaa, 0x35, 0xc8, 0x0e, 0x7a, 0x30, 0xa3, 0xb1, 0x09, 0xbb, 0x86, 0x4c, 0xbe, 0xb8, 0xbd, 0xe0, 0x32, 0xa5, 0xd4, 0xf7, - /* (2^422)P */ 0x7d, 0x50, 0x37, 0x68, 0x4e, 0x22, 0xb2, 0x2c, 0xd5, 0x0f, 0x2b, 0x6d, 0xb1, 0x51, 0xf2, 0x82, 0xe9, 0x98, 0x7c, 0x50, 0xc7, 0x96, 0x7e, 0x0e, 0xdc, 0xb1, 0x0e, 0xb2, 0x63, 0x8c, 0x30, 0x37, 0x72, 0x21, 0x9c, 0x61, 0xc2, 0xa7, 0x33, 0xd9, 0xb2, 0x63, 0x93, 0xd1, 0x6b, 0x6a, 0x73, 0xa5, 0x58, 0x80, 0xff, 0x04, 0xc7, 0x83, 0x21, 0x29, - /* (2^423)P */ 0x29, 0x04, 0xbc, 0x99, 0x39, 0xc9, 0x58, 0xc9, 0x6b, 0x17, 0xe8, 0x90, 0xb3, 0xe6, 0xa9, 0xb6, 0x28, 0x9b, 0xcb, 0x3b, 0x28, 0x90, 0x68, 0x71, 0xff, 0xcf, 0x08, 0x78, 0xc9, 0x8d, 0xa8, 0x4e, 0x43, 0xd1, 0x1c, 0x9e, 0xa4, 0xe3, 0xdf, 0xbf, 0x92, 0xf4, 0xf9, 0x41, 0xba, 0x4d, 0x1c, 0xf9, 0xdd, 0x74, 0x76, 0x1c, 0x6e, 0x3e, 0x94, 0x87, - /* (2^424)P */ 0xe4, 0xda, 0xc5, 0xd7, 0xfb, 0x87, 0xc5, 0x4d, 0x6b, 0x19, 0xaa, 0xb9, 0xbc, 0x8c, 0xf2, 0x8a, 0xd8, 0x5d, 0xdb, 0x4d, 0xef, 0xa6, 0xf2, 0x65, 0xf1, 0x22, 0x9c, 0xf1, 0x46, 0x30, 0x71, 0x7c, 0xe4, 0x53, 0x8e, 0x55, 0x2e, 0x9c, 0x9a, 0x31, 0x2a, 0xc3, 0xab, 0x0f, 0xde, 0xe4, 0xbe, 0xd8, 0x96, 0x50, 0x6e, 0x0c, 0x54, 0x49, 0xe6, 0xec, - /* (2^425)P */ 0x3c, 0x1d, 0x5a, 0xa5, 0xda, 0xad, 0xdd, 0xc2, 0xae, 0xac, 0x6f, 0x86, 0x75, 0x31, 0x91, 0x64, 0x45, 0x9d, 0xa4, 0xf0, 0x81, 0xf1, 0x0e, 0xba, 0x74, 0xaf, 0x7b, 0xcd, 0x6f, 0xfe, 0xac, 0x4e, 0xdb, 0x4e, 0x45, 0x35, 0x36, 0xc5, 0xc0, 0x6c, 0x3d, 0x64, 0xf4, 0xd8, 0x07, 0x62, 0xd1, 0xec, 0xf3, 0xfc, 0x93, 0xc9, 0x28, 0x0c, 0x2c, 0xf3, - /* (2^426)P */ 0x0c, 0x69, 0x2b, 0x5c, 0xb6, 0x41, 0x69, 0xf1, 0xa4, 0xf1, 0x5b, 0x75, 0x4c, 0x42, 0x8b, 0x47, 0xeb, 0x69, 0xfb, 0xa8, 0xe6, 0xf9, 0x7b, 0x48, 0x50, 0xaf, 0xd3, 0xda, 0xb2, 0x35, 0x10, 0xb5, 0x5b, 0x40, 0x90, 0x39, 0xc9, 0x07, 0x06, 0x73, 0x26, 0x20, 0x95, 0x01, 0xa4, 0x2d, 0xf0, 0xe7, 0x2e, 0x00, 0x7d, 0x41, 0x09, 0x68, 0x13, 0xc4, - /* (2^427)P */ 0xbe, 0x38, 0x78, 0xcf, 0xc9, 0x4f, 0x36, 0xca, 0x09, 0x61, 0x31, 0x3c, 0x57, 0x2e, 0xec, 0x17, 0xa4, 0x7d, 0x19, 0x2b, 0x9b, 0x5b, 0xbe, 0x8f, 0xd6, 0xc5, 0x2f, 0x86, 0xf2, 0x64, 0x76, 0x17, 0x00, 0x6e, 0x1a, 0x8c, 0x67, 0x1b, 0x68, 0xeb, 0x15, 0xa2, 0xd6, 0x09, 0x91, 0xdd, 0x23, 0x0d, 0x98, 0xb2, 0x10, 0x19, 0x55, 0x9b, 0x63, 0xf2, - /* (2^428)P */ 0x51, 0x1f, 0x93, 0xea, 0x2a, 0x3a, 0xfa, 0x41, 0xc0, 0x57, 0xfb, 0x74, 0xa6, 0x65, 0x09, 0x56, 0x14, 0xb6, 0x12, 0xaa, 0xb3, 0x1a, 0x8d, 0x3b, 0x76, 0x91, 0x7a, 0x23, 0x56, 0x9c, 0x6a, 0xc0, 0xe0, 0x3c, 0x3f, 0xb5, 0x1a, 0xf4, 0x57, 0x71, 0x93, 0x2b, 0xb1, 0xa7, 0x70, 0x57, 0x22, 0x80, 0xf5, 0xb8, 0x07, 0x77, 0x87, 0x0c, 0xbe, 0x83, - /* (2^429)P */ 0x07, 0x9b, 0x0e, 0x52, 0x38, 0x63, 0x13, 0x86, 0x6a, 0xa6, 0xb4, 0xd2, 0x60, 0x68, 0x9a, 0x99, 0x82, 0x0a, 0x04, 0x5f, 0x89, 0x7a, 0x1a, 0x2a, 0xae, 0x2d, 0x35, 0x0c, 0x1e, 0xad, 0xef, 0x4f, 0x9a, 0xfc, 0xc8, 0xd9, 0xcf, 0x9d, 0x48, 0x71, 0xa5, 0x55, 0x79, 0x73, 0x39, 0x1b, 0xd8, 0x73, 0xec, 0x9b, 0x03, 0x16, 0xd8, 0x82, 0xf7, 0x67, - /* (2^430)P */ 0x52, 0x67, 0x42, 0x21, 0xc9, 0x40, 0x78, 0x82, 0x2b, 0x95, 0x2d, 0x20, 0x92, 0xd1, 0xe2, 0x61, 0x25, 0xb0, 0xc6, 0x9c, 0x20, 0x59, 0x8e, 0x28, 0x6f, 0xf3, 0xfd, 0xd3, 0xc1, 0x32, 0x43, 0xc9, 0xa6, 0x08, 0x7a, 0x77, 0x9c, 0x4c, 0x8c, 0x33, 0x71, 0x13, 0x69, 0xe3, 0x52, 0x30, 0xa7, 0xf5, 0x07, 0x67, 0xac, 0xad, 0x46, 0x8a, 0x26, 0x25, - /* (2^431)P */ 0xda, 0x86, 0xc4, 0xa2, 0x71, 0x56, 0xdd, 0xd2, 0x48, 0xd3, 0xde, 0x42, 0x63, 0x01, 0xa7, 0x2c, 0x92, 0x83, 0x6f, 0x2e, 0xd8, 0x1e, 0x3f, 0xc1, 0xc5, 0x42, 0x4e, 0x34, 0x19, 0x54, 0x6e, 0x35, 0x2c, 0x51, 0x2e, 0xfd, 0x0f, 0x9a, 0x45, 0x66, 0x5e, 0x4a, 0x83, 0xda, 0x0a, 0x53, 0x68, 0x63, 0xfa, 0xce, 0x47, 0x20, 0xd3, 0x34, 0xba, 0x0d, - /* (2^432)P */ 0xd0, 0xe9, 0x64, 0xa4, 0x61, 0x4b, 0x86, 0xe5, 0x93, 0x6f, 0xda, 0x0e, 0x31, 0x7e, 0x6e, 0xe3, 0xc6, 0x73, 0xd8, 0xa3, 0x08, 0x57, 0x52, 0xcd, 0x51, 0x63, 0x1d, 0x9f, 0x93, 0x00, 0x62, 0x91, 0x26, 0x21, 0xa7, 0xdd, 0x25, 0x0f, 0x09, 0x0d, 0x35, 0xad, 0xcf, 0x11, 0x8e, 0x6e, 0xe8, 0xae, 0x1d, 0x95, 0xcb, 0x88, 0xf8, 0x70, 0x7b, 0x91, - /* (2^433)P */ 0x0c, 0x19, 0x5c, 0xd9, 0x8d, 0xda, 0x9d, 0x2c, 0x90, 0x54, 0x65, 0xe8, 0xb6, 0x35, 0x50, 0xae, 0xea, 0xae, 0x43, 0xb7, 0x1e, 0x99, 0x8b, 0x4c, 0x36, 0x4e, 0xe4, 0x1e, 0xc4, 0x64, 0x43, 0xb6, 0xeb, 0xd4, 0xe9, 0x60, 0x22, 0xee, 0xcf, 0xb8, 0x52, 0x1b, 0xf0, 0x04, 0xce, 0xbc, 0x2b, 0xf0, 0xbe, 0xcd, 0x44, 0x74, 0x1e, 0x1f, 0x63, 0xf9, - /* (2^434)P */ 0xe1, 0x3f, 0x95, 0x94, 0xb2, 0xb6, 0x31, 0xa9, 0x1b, 0xdb, 0xfd, 0x0e, 0xdb, 0xdd, 0x1a, 0x22, 0x78, 0x60, 0x9f, 0x75, 0x5f, 0x93, 0x06, 0x0c, 0xd8, 0xbb, 0xa2, 0x85, 0x2b, 0x5e, 0xc0, 0x9b, 0xa8, 0x5d, 0xaf, 0x93, 0x91, 0x91, 0x47, 0x41, 0x1a, 0xfc, 0xb4, 0x51, 0x85, 0xad, 0x69, 0x4d, 0x73, 0x69, 0xd5, 0x4e, 0x82, 0xfb, 0x66, 0xcb, - /* (2^435)P */ 0x7c, 0xbe, 0xc7, 0x51, 0xc4, 0x74, 0x6e, 0xab, 0xfd, 0x41, 0x4f, 0x76, 0x4f, 0x24, 0x03, 0xd6, 0x2a, 0xb7, 0x42, 0xb4, 0xda, 0x41, 0x2c, 0x82, 0x48, 0x4c, 0x7f, 0x6f, 0x25, 0x5d, 0x36, 0xd4, 0x69, 0xf5, 0xef, 0x02, 0x81, 0xea, 0x6f, 0x19, 0x69, 0xe8, 0x6f, 0x5b, 0x2f, 0x14, 0x0e, 0x6f, 0x89, 0xb4, 0xb5, 0xd8, 0xae, 0xef, 0x7b, 0x87, - /* (2^436)P */ 0xe9, 0x91, 0xa0, 0x8b, 0xc9, 0xe0, 0x01, 0x90, 0x37, 0xc1, 0x6f, 0xdc, 0x5e, 0xf7, 0xbf, 0x43, 0x00, 0xaa, 0x10, 0x76, 0x76, 0x18, 0x6e, 0x19, 0x1e, 0x94, 0x50, 0x11, 0x0a, 0xd1, 0xe2, 0xdb, 0x08, 0x21, 0xa0, 0x1f, 0xdb, 0x54, 0xfe, 0xea, 0x6e, 0xa3, 0x68, 0x56, 0x87, 0x0b, 0x22, 0x4e, 0x66, 0xf3, 0x82, 0x82, 0x00, 0xcd, 0xd4, 0x12, - /* (2^437)P */ 0x25, 0x8e, 0x24, 0x77, 0x64, 0x4c, 0xe0, 0xf8, 0x18, 0xc0, 0xdc, 0xc7, 0x1b, 0x35, 0x65, 0xde, 0x67, 0x41, 0x5e, 0x6f, 0x90, 0x82, 0xa7, 0x2e, 0x6d, 0xf1, 0x47, 0xb4, 0x92, 0x9c, 0xfd, 0x6a, 0x9a, 0x41, 0x36, 0x20, 0x24, 0x58, 0xc3, 0x59, 0x07, 0x9a, 0xfa, 0x9f, 0x03, 0xcb, 0xc7, 0x69, 0x37, 0x60, 0xe1, 0xab, 0x13, 0x72, 0xee, 0xa2, - /* (2^438)P */ 0x74, 0x78, 0xfb, 0x13, 0xcb, 0x8e, 0x37, 0x1a, 0xf6, 0x1d, 0x17, 0x83, 0x06, 0xd4, 0x27, 0x06, 0x21, 0xe8, 0xda, 0xdf, 0x6b, 0xf3, 0x83, 0x6b, 0x34, 0x8a, 0x8c, 0xee, 0x01, 0x05, 0x5b, 0xed, 0xd3, 0x1b, 0xc9, 0x64, 0x83, 0xc9, 0x49, 0xc2, 0x57, 0x1b, 0xdd, 0xcf, 0xf1, 0x9d, 0x63, 0xee, 0x1c, 0x0d, 0xa0, 0x0a, 0x73, 0x1f, 0x5b, 0x32, - /* (2^439)P */ 0x29, 0xce, 0x1e, 0xc0, 0x6a, 0xf5, 0xeb, 0x99, 0x5a, 0x39, 0x23, 0xe9, 0xdd, 0xac, 0x44, 0x88, 0xbc, 0x80, 0x22, 0xde, 0x2c, 0xcb, 0xa8, 0x3b, 0xff, 0xf7, 0x6f, 0xc7, 0x71, 0x72, 0xa8, 0xa3, 0xf6, 0x4d, 0xc6, 0x75, 0xda, 0x80, 0xdc, 0xd9, 0x30, 0xd9, 0x07, 0x50, 0x5a, 0x54, 0x7d, 0xda, 0x39, 0x6f, 0x78, 0x94, 0xbf, 0x25, 0x98, 0xdc, - /* (2^440)P */ 0x01, 0x26, 0x62, 0x44, 0xfb, 0x0f, 0x11, 0x72, 0x73, 0x0a, 0x16, 0xc7, 0x16, 0x9c, 0x9b, 0x37, 0xd8, 0xff, 0x4f, 0xfe, 0x57, 0xdb, 0xae, 0xef, 0x7d, 0x94, 0x30, 0x04, 0x70, 0x83, 0xde, 0x3c, 0xd4, 0xb5, 0x70, 0xda, 0xa7, 0x55, 0xc8, 0x19, 0xe1, 0x36, 0x15, 0x61, 0xe7, 0x3b, 0x7d, 0x85, 0xbb, 0xf3, 0x42, 0x5a, 0x94, 0xf4, 0x53, 0x2a, - /* (2^441)P */ 0x14, 0x60, 0xa6, 0x0b, 0x83, 0xe1, 0x23, 0x77, 0xc0, 0xce, 0x50, 0xed, 0x35, 0x8d, 0x98, 0x99, 0x7d, 0xf5, 0x8d, 0xce, 0x94, 0x25, 0xc8, 0x0f, 0x6d, 0xfa, 0x4a, 0xa4, 0x3a, 0x1f, 0x66, 0xfb, 0x5a, 0x64, 0xaf, 0x8b, 0x54, 0x54, 0x44, 0x3f, 0x5b, 0x88, 0x61, 0xe4, 0x48, 0x45, 0x26, 0x20, 0xbe, 0x0d, 0x06, 0xbb, 0x65, 0x59, 0xe1, 0x36, - /* (2^442)P */ 0xb7, 0x98, 0xce, 0xa3, 0xe3, 0xee, 0x11, 0x1b, 0x9e, 0x24, 0x59, 0x75, 0x31, 0x37, 0x44, 0x6f, 0x6b, 0x9e, 0xec, 0xb7, 0x44, 0x01, 0x7e, 0xab, 0xbb, 0x69, 0x5d, 0x11, 0xb0, 0x30, 0x64, 0xea, 0x91, 0xb4, 0x7a, 0x8c, 0x02, 0x4c, 0xb9, 0x10, 0xa7, 0xc7, 0x79, 0xe6, 0xdc, 0x77, 0xe3, 0xc8, 0xef, 0x3e, 0xf9, 0x38, 0x81, 0xce, 0x9a, 0xb2, - /* (2^443)P */ 0x91, 0x12, 0x76, 0xd0, 0x10, 0xb4, 0xaf, 0xe1, 0x89, 0x3a, 0x93, 0x6b, 0x5c, 0x19, 0x5f, 0x24, 0xed, 0x04, 0x92, 0xc7, 0xf0, 0x00, 0x08, 0xc1, 0x92, 0xff, 0x90, 0xdb, 0xb2, 0xbf, 0xdf, 0x49, 0xcd, 0xbd, 0x5c, 0x6e, 0xbf, 0x16, 0xbb, 0x61, 0xf9, 0x20, 0x33, 0x35, 0x93, 0x11, 0xbc, 0x59, 0x69, 0xce, 0x18, 0x9f, 0xf8, 0x7b, 0xa1, 0x6e, - /* (2^444)P */ 0xa1, 0xf4, 0xaf, 0xad, 0xf8, 0xe6, 0x99, 0xd2, 0xa1, 0x4d, 0xde, 0x56, 0xc9, 0x7b, 0x0b, 0x11, 0x3e, 0xbf, 0x89, 0x1a, 0x9a, 0x90, 0xe5, 0xe2, 0xa6, 0x37, 0x88, 0xa1, 0x68, 0x59, 0xae, 0x8c, 0xec, 0x02, 0x14, 0x8d, 0xb7, 0x2e, 0x25, 0x75, 0x7f, 0x76, 0x1a, 0xd3, 0x4d, 0xad, 0x8a, 0x00, 0x6c, 0x96, 0x49, 0xa4, 0xc3, 0x2e, 0x5c, 0x7b, - /* (2^445)P */ 0x26, 0x53, 0xf7, 0xda, 0xa8, 0x01, 0x14, 0xb1, 0x63, 0xe3, 0xc3, 0x89, 0x88, 0xb0, 0x85, 0x40, 0x2b, 0x26, 0x9a, 0x10, 0x1a, 0x70, 0x33, 0xf4, 0x50, 0x9d, 0x4d, 0xd8, 0x64, 0xc6, 0x0f, 0xe1, 0x17, 0xc8, 0x10, 0x4b, 0xfc, 0xa0, 0xc9, 0xba, 0x2c, 0x98, 0x09, 0xf5, 0x84, 0xb6, 0x7c, 0x4e, 0xa3, 0xe3, 0x81, 0x1b, 0x32, 0x60, 0x02, 0xdd, - /* (2^446)P */ 0xa3, 0xe5, 0x86, 0xd4, 0x43, 0xa8, 0xd1, 0x98, 0x9d, 0x9d, 0xdb, 0x04, 0xcf, 0x6e, 0x35, 0x05, 0x30, 0x53, 0x3b, 0xbc, 0x90, 0x00, 0x4a, 0xc5, 0x40, 0x2a, 0x0f, 0xde, 0x1a, 0xd7, 0x36, 0x27, 0x44, 0x62, 0xa6, 0xac, 0x9d, 0xd2, 0x70, 0x69, 0x14, 0x39, 0x9b, 0xd1, 0xc3, 0x0a, 0x3a, 0x82, 0x0e, 0xf1, 0x94, 0xd7, 0x42, 0x94, 0xd5, 0x7d, - /* (2^447)P */ 0x04, 0xc0, 0x6e, 0x12, 0x90, 0x70, 0xf9, 0xdf, 0xf7, 0xc9, 0x86, 0xc0, 0xe6, 0x92, 0x8b, 0x0a, 0xa1, 0xc1, 0x3b, 0xcc, 0x33, 0xb7, 0xf0, 0xeb, 0x51, 0x50, 0x80, 0x20, 0x69, 0x1c, 0x4f, 0x89, 0x05, 0x1e, 0xe4, 0x7a, 0x0a, 0xc2, 0xf0, 0xf5, 0x78, 0x91, 0x76, 0x34, 0x45, 0xdc, 0x24, 0x53, 0x24, 0x98, 0xe2, 0x73, 0x6f, 0xe6, 0x46, 0x67, -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go deleted file mode 100644 index b6b236e5d3..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/constants.go +++ /dev/null @@ -1,71 +0,0 @@ -package goldilocks - -import fp "github.com/cloudflare/circl/math/fp448" - -var ( - // genX is the x-coordinate of the generator of Goldilocks curve. - genX = fp.Elt{ - 0x5e, 0xc0, 0x0c, 0xc7, 0x2b, 0xa8, 0x26, 0x26, - 0x8e, 0x93, 0x00, 0x8b, 0xe1, 0x80, 0x3b, 0x43, - 0x11, 0x65, 0xb6, 0x2a, 0xf7, 0x1a, 0xae, 0x12, - 0x64, 0xa4, 0xd3, 0xa3, 0x24, 0xe3, 0x6d, 0xea, - 0x67, 0x17, 0x0f, 0x47, 0x70, 0x65, 0x14, 0x9e, - 0xda, 0x36, 0xbf, 0x22, 0xa6, 0x15, 0x1d, 0x22, - 0xed, 0x0d, 0xed, 0x6b, 0xc6, 0x70, 0x19, 0x4f, - } - // genY is the y-coordinate of the generator of Goldilocks curve. - genY = fp.Elt{ - 0x14, 0xfa, 0x30, 0xf2, 0x5b, 0x79, 0x08, 0x98, - 0xad, 0xc8, 0xd7, 0x4e, 0x2c, 0x13, 0xbd, 0xfd, - 0xc4, 0x39, 0x7c, 0xe6, 0x1c, 0xff, 0xd3, 0x3a, - 0xd7, 0xc2, 0xa0, 0x05, 0x1e, 0x9c, 0x78, 0x87, - 0x40, 0x98, 0xa3, 0x6c, 0x73, 0x73, 0xea, 0x4b, - 0x62, 0xc7, 0xc9, 0x56, 0x37, 0x20, 0x76, 0x88, - 0x24, 0xbc, 0xb6, 0x6e, 0x71, 0x46, 0x3f, 0x69, - } - // paramD is -39081 in Fp. - paramD = fp.Elt{ - 0x56, 0x67, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - } - // order is 2^446-0x8335dc163bb124b65129c96fde933d8d723a70aadc873d6d54a7bb0d, - // which is the number of points in the prime subgroup. - order = Scalar{ - 0xf3, 0x44, 0x58, 0xab, 0x92, 0xc2, 0x78, 0x23, - 0x55, 0x8f, 0xc5, 0x8d, 0x72, 0xc2, 0x6c, 0x21, - 0x90, 0x36, 0xd6, 0xae, 0x49, 0xdb, 0x4e, 0xc4, - 0xe9, 0x23, 0xca, 0x7c, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, - } - // residue448 is 2^448 mod order. - residue448 = [4]uint64{ - 0x721cf5b5529eec34, 0x7a4cf635c8e9c2ab, 0xeec492d944a725bf, 0x20cd77058, - } - // invFour is 1/4 mod order. - invFour = Scalar{ - 0x3d, 0x11, 0xd6, 0xaa, 0xa4, 0x30, 0xde, 0x48, - 0xd5, 0x63, 0x71, 0xa3, 0x9c, 0x30, 0x5b, 0x08, - 0xa4, 0x8d, 0xb5, 0x6b, 0xd2, 0xb6, 0x13, 0x71, - 0xfa, 0x88, 0x32, 0xdf, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, - } - // paramDTwist is -39082 in Fp. The D parameter of the twist curve. - paramDTwist = fp.Elt{ - 0x55, 0x67, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - } -) diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go deleted file mode 100644 index 5a939100d2..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/curve.go +++ /dev/null @@ -1,80 +0,0 @@ -// Package goldilocks provides elliptic curve operations over the goldilocks curve. -package goldilocks - -import fp "github.com/cloudflare/circl/math/fp448" - -// Curve is the Goldilocks curve x^2+y^2=z^2-39081x^2y^2. -type Curve struct{} - -// Identity returns the identity point. -func (Curve) Identity() *Point { - return &Point{ - y: fp.One(), - z: fp.One(), - } -} - -// IsOnCurve returns true if the point lies on the curve. -func (Curve) IsOnCurve(P *Point) bool { - x2, y2, t, t2, z2 := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{} - rhs, lhs := &fp.Elt{}, &fp.Elt{} - fp.Mul(t, &P.ta, &P.tb) // t = ta*tb - fp.Sqr(x2, &P.x) // x^2 - fp.Sqr(y2, &P.y) // y^2 - fp.Sqr(z2, &P.z) // z^2 - fp.Sqr(t2, t) // t^2 - fp.Add(lhs, x2, y2) // x^2 + y^2 - fp.Mul(rhs, t2, ¶mD) // dt^2 - fp.Add(rhs, rhs, z2) // z^2 + dt^2 - fp.Sub(lhs, lhs, rhs) // x^2 + y^2 - (z^2 + dt^2) - eq0 := fp.IsZero(lhs) - - fp.Mul(lhs, &P.x, &P.y) // xy - fp.Mul(rhs, t, &P.z) // tz - fp.Sub(lhs, lhs, rhs) // xy - tz - eq1 := fp.IsZero(lhs) - return eq0 && eq1 -} - -// Generator returns the generator point. -func (Curve) Generator() *Point { - return &Point{ - x: genX, - y: genY, - z: fp.One(), - ta: genX, - tb: genY, - } -} - -// Order returns the number of points in the prime subgroup. -func (Curve) Order() Scalar { return order } - -// Double returns 2P. -func (Curve) Double(P *Point) *Point { R := *P; R.Double(); return &R } - -// Add returns P+Q. -func (Curve) Add(P, Q *Point) *Point { R := *P; R.Add(Q); return &R } - -// ScalarMult returns kP. This function runs in constant time. -func (e Curve) ScalarMult(k *Scalar, P *Point) *Point { - k4 := &Scalar{} - k4.divBy4(k) - return e.pull(twistCurve{}.ScalarMult(k4, e.push(P))) -} - -// ScalarBaseMult returns kG where G is the generator point. This function runs in constant time. -func (e Curve) ScalarBaseMult(k *Scalar) *Point { - k4 := &Scalar{} - k4.divBy4(k) - return e.pull(twistCurve{}.ScalarBaseMult(k4)) -} - -// CombinedMult returns mG+nP, where G is the generator point. This function is non-constant time. -func (e Curve) CombinedMult(m, n *Scalar, P *Point) *Point { - m4 := &Scalar{} - n4 := &Scalar{} - m4.divBy4(m) - n4.divBy4(n) - return e.pull(twistCurve{}.CombinedMult(m4, n4, twistCurve{}.pull(P))) -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go deleted file mode 100644 index b1daab851c..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/isogeny.go +++ /dev/null @@ -1,52 +0,0 @@ -package goldilocks - -import fp "github.com/cloudflare/circl/math/fp448" - -func (Curve) pull(P *twistPoint) *Point { return twistCurve{}.push(P) } -func (twistCurve) pull(P *Point) *twistPoint { return Curve{}.push(P) } - -// push sends a point on the Goldilocks curve to a point on the twist curve. -func (Curve) push(P *Point) *twistPoint { - Q := &twistPoint{} - Px, Py, Pz := &P.x, &P.y, &P.z - a, b, c, d, e, f, g, h := &Q.x, &Q.y, &Q.z, &fp.Elt{}, &Q.ta, &Q.x, &Q.y, &Q.tb - fp.Add(e, Px, Py) // x+y - fp.Sqr(a, Px) // A = x^2 - fp.Sqr(b, Py) // B = y^2 - fp.Sqr(c, Pz) // z^2 - fp.Add(c, c, c) // C = 2*z^2 - *d = *a // D = A - fp.Sqr(e, e) // (x+y)^2 - fp.Sub(e, e, a) // (x+y)^2-A - fp.Sub(e, e, b) // E = (x+y)^2-A-B - fp.Add(h, b, d) // H = B+D - fp.Sub(g, b, d) // G = B-D - fp.Sub(f, c, h) // F = C-H - fp.Mul(&Q.z, f, g) // Z = F * G - fp.Mul(&Q.x, e, f) // X = E * F - fp.Mul(&Q.y, g, h) // Y = G * H, // T = E * H - return Q -} - -// push sends a point on the twist curve to a point on the Goldilocks curve. -func (twistCurve) push(P *twistPoint) *Point { - Q := &Point{} - Px, Py, Pz := &P.x, &P.y, &P.z - a, b, c, d, e, f, g, h := &Q.x, &Q.y, &Q.z, &fp.Elt{}, &Q.ta, &Q.x, &Q.y, &Q.tb - fp.Add(e, Px, Py) // x+y - fp.Sqr(a, Px) // A = x^2 - fp.Sqr(b, Py) // B = y^2 - fp.Sqr(c, Pz) // z^2 - fp.Add(c, c, c) // C = 2*z^2 - fp.Neg(d, a) // D = -A - fp.Sqr(e, e) // (x+y)^2 - fp.Sub(e, e, a) // (x+y)^2-A - fp.Sub(e, e, b) // E = (x+y)^2-A-B - fp.Add(h, b, d) // H = B+D - fp.Sub(g, b, d) // G = B-D - fp.Sub(f, c, h) // F = C-H - fp.Mul(&Q.z, f, g) // Z = F * G - fp.Mul(&Q.x, e, f) // X = E * F - fp.Mul(&Q.y, g, h) // Y = G * H, // T = E * H - return Q -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go deleted file mode 100644 index 11f73de054..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/point.go +++ /dev/null @@ -1,171 +0,0 @@ -package goldilocks - -import ( - "errors" - "fmt" - - fp "github.com/cloudflare/circl/math/fp448" -) - -// Point is a point on the Goldilocks Curve. -type Point struct{ x, y, z, ta, tb fp.Elt } - -func (P Point) String() string { - return fmt.Sprintf("x: %v\ny: %v\nz: %v\nta: %v\ntb: %v", P.x, P.y, P.z, P.ta, P.tb) -} - -// FromAffine creates a point from affine coordinates. -func FromAffine(x, y *fp.Elt) (*Point, error) { - P := &Point{ - x: *x, - y: *y, - z: fp.One(), - ta: *x, - tb: *y, - } - if !(Curve{}).IsOnCurve(P) { - return P, errors.New("point not on curve") - } - return P, nil -} - -// isLessThan returns true if 0 <= x < y, and assumes that slices are of the -// same length and are interpreted in little-endian order. -func isLessThan(x, y []byte) bool { - i := len(x) - 1 - for i > 0 && x[i] == y[i] { - i-- - } - return x[i] < y[i] -} - -// FromBytes returns a point from the input buffer. -func FromBytes(in []byte) (*Point, error) { - if len(in) < fp.Size+1 { - return nil, errors.New("wrong input length") - } - err := errors.New("invalid decoding") - P := &Point{} - signX := in[fp.Size] >> 7 - copy(P.y[:], in[:fp.Size]) - p := fp.P() - if !isLessThan(P.y[:], p[:]) { - return nil, err - } - - u, v := &fp.Elt{}, &fp.Elt{} - one := fp.One() - fp.Sqr(u, &P.y) // u = y^2 - fp.Mul(v, u, ¶mD) // v = dy^2 - fp.Sub(u, u, &one) // u = y^2-1 - fp.Sub(v, v, &one) // v = dy^2-1 - isQR := fp.InvSqrt(&P.x, u, v) // x = sqrt(u/v) - if !isQR { - return nil, err - } - fp.Modp(&P.x) // x = x mod p - if fp.IsZero(&P.x) && signX == 1 { - return nil, err - } - if signX != (P.x[0] & 1) { - fp.Neg(&P.x, &P.x) - } - P.ta = P.x - P.tb = P.y - P.z = fp.One() - return P, nil -} - -// IsIdentity returns true is P is the identity Point. -func (P *Point) IsIdentity() bool { - return fp.IsZero(&P.x) && !fp.IsZero(&P.y) && !fp.IsZero(&P.z) && P.y == P.z -} - -// IsEqual returns true if P is equivalent to Q. -func (P *Point) IsEqual(Q *Point) bool { - l, r := &fp.Elt{}, &fp.Elt{} - fp.Mul(l, &P.x, &Q.z) - fp.Mul(r, &Q.x, &P.z) - fp.Sub(l, l, r) - b := fp.IsZero(l) - fp.Mul(l, &P.y, &Q.z) - fp.Mul(r, &Q.y, &P.z) - fp.Sub(l, l, r) - b = b && fp.IsZero(l) - fp.Mul(l, &P.ta, &P.tb) - fp.Mul(l, l, &Q.z) - fp.Mul(r, &Q.ta, &Q.tb) - fp.Mul(r, r, &P.z) - fp.Sub(l, l, r) - b = b && fp.IsZero(l) - return b -} - -// Neg obtains the inverse of the Point. -func (P *Point) Neg() { fp.Neg(&P.x, &P.x); fp.Neg(&P.ta, &P.ta) } - -// ToAffine returns the x,y affine coordinates of P. -func (P *Point) ToAffine() (x, y fp.Elt) { - fp.Inv(&P.z, &P.z) // 1/z - fp.Mul(&P.x, &P.x, &P.z) // x/z - fp.Mul(&P.y, &P.y, &P.z) // y/z - fp.Modp(&P.x) - fp.Modp(&P.y) - fp.SetOne(&P.z) - P.ta = P.x - P.tb = P.y - return P.x, P.y -} - -// ToBytes stores P into a slice of bytes. -func (P *Point) ToBytes(out []byte) error { - if len(out) < fp.Size+1 { - return errors.New("invalid decoding") - } - x, y := P.ToAffine() - out[fp.Size] = (x[0] & 1) << 7 - return fp.ToBytes(out[:fp.Size], &y) -} - -// MarshalBinary encodes the receiver into a binary form and returns the result. -func (P *Point) MarshalBinary() (data []byte, err error) { - data = make([]byte, fp.Size+1) - err = P.ToBytes(data[:fp.Size+1]) - return data, err -} - -// UnmarshalBinary must be able to decode the form generated by MarshalBinary. -func (P *Point) UnmarshalBinary(data []byte) error { Q, err := FromBytes(data); *P = *Q; return err } - -// Double sets P = 2Q. -func (P *Point) Double() { P.Add(P) } - -// Add sets P =P+Q.. -func (P *Point) Add(Q *Point) { - // This is formula (5) from "Twisted Edwards Curves Revisited" by - // Hisil H., Wong K.KH., Carter G., Dawson E. (2008) - // https://doi.org/10.1007/978-3-540-89255-7_20 - x1, y1, z1, ta1, tb1 := &P.x, &P.y, &P.z, &P.ta, &P.tb - x2, y2, z2, ta2, tb2 := &Q.x, &Q.y, &Q.z, &Q.ta, &Q.tb - x3, y3, z3, E, H := &P.x, &P.y, &P.z, &P.ta, &P.tb - A, B, C, D := &fp.Elt{}, &fp.Elt{}, &fp.Elt{}, &fp.Elt{} - t1, t2, F, G := C, D, &fp.Elt{}, &fp.Elt{} - fp.Mul(t1, ta1, tb1) // t1 = ta1*tb1 - fp.Mul(t2, ta2, tb2) // t2 = ta2*tb2 - fp.Mul(A, x1, x2) // A = x1*x2 - fp.Mul(B, y1, y2) // B = y1*y2 - fp.Mul(C, t1, t2) // t1*t2 - fp.Mul(C, C, ¶mD) // C = d*t1*t2 - fp.Mul(D, z1, z2) // D = z1*z2 - fp.Add(F, x1, y1) // x1+y1 - fp.Add(E, x2, y2) // x2+y2 - fp.Mul(E, E, F) // (x1+y1)*(x2+y2) - fp.Sub(E, E, A) // (x1+y1)*(x2+y2)-A - fp.Sub(E, E, B) // E = (x1+y1)*(x2+y2)-A-B - fp.Sub(F, D, C) // F = D-C - fp.Add(G, D, C) // G = D+C - fp.Sub(H, B, A) // H = B-A - fp.Mul(z3, F, G) // Z = F * G - fp.Mul(x3, E, F) // X = E * F - fp.Mul(y3, G, H) // Y = G * H, T = E * H -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go deleted file mode 100644 index f98117b252..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/scalar.go +++ /dev/null @@ -1,203 +0,0 @@ -package goldilocks - -import ( - "encoding/binary" - "math/bits" -) - -// ScalarSize is the size (in bytes) of scalars. -const ScalarSize = 56 // 448 / 8 - -// _N is the number of 64-bit words to store scalars. -const _N = 7 // 448 / 64 - -// Scalar represents a positive integer stored in little-endian order. -type Scalar [ScalarSize]byte - -type scalar64 [_N]uint64 - -func (z *scalar64) fromScalar(x *Scalar) { - z[0] = binary.LittleEndian.Uint64(x[0*8 : 1*8]) - z[1] = binary.LittleEndian.Uint64(x[1*8 : 2*8]) - z[2] = binary.LittleEndian.Uint64(x[2*8 : 3*8]) - z[3] = binary.LittleEndian.Uint64(x[3*8 : 4*8]) - z[4] = binary.LittleEndian.Uint64(x[4*8 : 5*8]) - z[5] = binary.LittleEndian.Uint64(x[5*8 : 6*8]) - z[6] = binary.LittleEndian.Uint64(x[6*8 : 7*8]) -} - -func (z *scalar64) toScalar(x *Scalar) { - binary.LittleEndian.PutUint64(x[0*8:1*8], z[0]) - binary.LittleEndian.PutUint64(x[1*8:2*8], z[1]) - binary.LittleEndian.PutUint64(x[2*8:3*8], z[2]) - binary.LittleEndian.PutUint64(x[3*8:4*8], z[3]) - binary.LittleEndian.PutUint64(x[4*8:5*8], z[4]) - binary.LittleEndian.PutUint64(x[5*8:6*8], z[5]) - binary.LittleEndian.PutUint64(x[6*8:7*8], z[6]) -} - -// add calculates z = x + y. Assumes len(z) > max(len(x),len(y)). -func add(z, x, y []uint64) uint64 { - l, L, zz := len(x), len(y), y - if l > L { - l, L, zz = L, l, x - } - c := uint64(0) - for i := 0; i < l; i++ { - z[i], c = bits.Add64(x[i], y[i], c) - } - for i := l; i < L; i++ { - z[i], c = bits.Add64(zz[i], 0, c) - } - return c -} - -// sub calculates z = x - y. Assumes len(z) > max(len(x),len(y)). -func sub(z, x, y []uint64) uint64 { - l, L, zz := len(x), len(y), y - if l > L { - l, L, zz = L, l, x - } - c := uint64(0) - for i := 0; i < l; i++ { - z[i], c = bits.Sub64(x[i], y[i], c) - } - for i := l; i < L; i++ { - z[i], c = bits.Sub64(zz[i], 0, c) - } - return c -} - -// mulWord calculates z = x * y. Assumes len(z) >= len(x)+1. -func mulWord(z, x []uint64, y uint64) { - for i := range z { - z[i] = 0 - } - carry := uint64(0) - for i := range x { - hi, lo := bits.Mul64(x[i], y) - lo, cc := bits.Add64(lo, z[i], 0) - hi, _ = bits.Add64(hi, 0, cc) - z[i], cc = bits.Add64(lo, carry, 0) - carry, _ = bits.Add64(hi, 0, cc) - } - z[len(x)] = carry -} - -// Cmov moves x into z if b=1. -func (z *scalar64) Cmov(b uint64, x *scalar64) { - m := uint64(0) - b - for i := range z { - z[i] = (z[i] &^ m) | (x[i] & m) - } -} - -// leftShift shifts to the left the words of z returning the more significant word. -func (z *scalar64) leftShift(low uint64) uint64 { - high := z[_N-1] - for i := _N - 1; i > 0; i-- { - z[i] = z[i-1] - } - z[0] = low - return high -} - -// reduceOneWord calculates z = z + 2^448*x such that the result fits in a Scalar. -func (z *scalar64) reduceOneWord(x uint64) { - prod := (&scalar64{})[:] - mulWord(prod, residue448[:], x) - cc := add(z[:], z[:], prod) - mulWord(prod, residue448[:], cc) - add(z[:], z[:], prod) -} - -// modOrder reduces z mod order. -func (z *scalar64) modOrder() { - var o64, x scalar64 - o64.fromScalar(&order) - // Performs: while (z >= order) { z = z-order } - // At most 8 (eight) iterations reduce 3 bits by subtracting. - for i := 0; i < 8; i++ { - c := sub(x[:], z[:], o64[:]) // (c || x) = z-order - z.Cmov(1-c, &x) // if c != 0 { z = x } - } -} - -// FromBytes stores z = x mod order, where x is a number stored in little-endian order. -func (z *Scalar) FromBytes(x []byte) { - n := len(x) - nCeil := (n + 7) >> 3 - for i := range z { - z[i] = 0 - } - if nCeil < _N { - copy(z[:], x) - return - } - copy(z[:], x[8*(nCeil-_N):]) - var z64 scalar64 - z64.fromScalar(z) - for i := nCeil - _N - 1; i >= 0; i-- { - low := binary.LittleEndian.Uint64(x[8*i:]) - high := z64.leftShift(low) - z64.reduceOneWord(high) - } - z64.modOrder() - z64.toScalar(z) -} - -// divBy4 calculates z = x/4 mod order. -func (z *Scalar) divBy4(x *Scalar) { z.Mul(x, &invFour) } - -// Red reduces z mod order. -func (z *Scalar) Red() { var t scalar64; t.fromScalar(z); t.modOrder(); t.toScalar(z) } - -// Neg calculates z = -z mod order. -func (z *Scalar) Neg() { z.Sub(&order, z) } - -// Add calculates z = x+y mod order. -func (z *Scalar) Add(x, y *Scalar) { - var z64, x64, y64, t scalar64 - x64.fromScalar(x) - y64.fromScalar(y) - c := add(z64[:], x64[:], y64[:]) - add(t[:], z64[:], residue448[:]) - z64.Cmov(c, &t) - z64.modOrder() - z64.toScalar(z) -} - -// Sub calculates z = x-y mod order. -func (z *Scalar) Sub(x, y *Scalar) { - var z64, x64, y64, t scalar64 - x64.fromScalar(x) - y64.fromScalar(y) - c := sub(z64[:], x64[:], y64[:]) - sub(t[:], z64[:], residue448[:]) - z64.Cmov(c, &t) - z64.modOrder() - z64.toScalar(z) -} - -// Mul calculates z = x*y mod order. -func (z *Scalar) Mul(x, y *Scalar) { - var z64, x64, y64 scalar64 - prod := (&[_N + 1]uint64{})[:] - x64.fromScalar(x) - y64.fromScalar(y) - mulWord(prod, x64[:], y64[_N-1]) - copy(z64[:], prod[:_N]) - z64.reduceOneWord(prod[_N]) - for i := _N - 2; i >= 0; i-- { - h := z64.leftShift(0) - z64.reduceOneWord(h) - mulWord(prod, x64[:], y64[i]) - c := add(z64[:], z64[:], prod[:_N]) - z64.reduceOneWord(prod[_N] + c) - } - z64.modOrder() - z64.toScalar(z) -} - -// IsZero returns true if z=0. -func (z *Scalar) IsZero() bool { z.Red(); return *z == Scalar{} } diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go deleted file mode 100644 index 83d7cdadd3..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist.go +++ /dev/null @@ -1,138 +0,0 @@ -package goldilocks - -import ( - "crypto/subtle" - "math/bits" - - "github.com/cloudflare/circl/internal/conv" - "github.com/cloudflare/circl/math" - fp "github.com/cloudflare/circl/math/fp448" -) - -// twistCurve is -x^2+y^2=1-39082x^2y^2 and is 4-isogenous to Goldilocks. -type twistCurve struct{} - -// Identity returns the identity point. -func (twistCurve) Identity() *twistPoint { - return &twistPoint{ - y: fp.One(), - z: fp.One(), - } -} - -// subYDiv16 update x = (x - y) / 16. -func subYDiv16(x *scalar64, y int64) { - s := uint64(y >> 63) - x0, b0 := bits.Sub64((*x)[0], uint64(y), 0) - x1, b1 := bits.Sub64((*x)[1], s, b0) - x2, b2 := bits.Sub64((*x)[2], s, b1) - x3, b3 := bits.Sub64((*x)[3], s, b2) - x4, b4 := bits.Sub64((*x)[4], s, b3) - x5, b5 := bits.Sub64((*x)[5], s, b4) - x6, _ := bits.Sub64((*x)[6], s, b5) - x[0] = (x0 >> 4) | (x1 << 60) - x[1] = (x1 >> 4) | (x2 << 60) - x[2] = (x2 >> 4) | (x3 << 60) - x[3] = (x3 >> 4) | (x4 << 60) - x[4] = (x4 >> 4) | (x5 << 60) - x[5] = (x5 >> 4) | (x6 << 60) - x[6] = (x6 >> 4) -} - -func recodeScalar(d *[113]int8, k *Scalar) { - var k64 scalar64 - k64.fromScalar(k) - for i := 0; i < 112; i++ { - d[i] = int8((k64[0] & 0x1f) - 16) - subYDiv16(&k64, int64(d[i])) - } - d[112] = int8(k64[0]) -} - -// ScalarMult returns kP. -func (e twistCurve) ScalarMult(k *Scalar, P *twistPoint) *twistPoint { - var TabP [8]preTwistPointProy - var S preTwistPointProy - var d [113]int8 - - var isZero int - if k.IsZero() { - isZero = 1 - } - subtle.ConstantTimeCopy(isZero, k[:], order[:]) - - minusK := *k - isEven := 1 - int(k[0]&0x1) - minusK.Neg() - subtle.ConstantTimeCopy(isEven, k[:], minusK[:]) - recodeScalar(&d, k) - - P.oddMultiples(TabP[:]) - Q := e.Identity() - for i := 112; i >= 0; i-- { - Q.Double() - Q.Double() - Q.Double() - Q.Double() - mask := d[i] >> 7 - absDi := (d[i] + mask) ^ mask - inx := int32((absDi - 1) >> 1) - sig := int((d[i] >> 7) & 0x1) - for j := range TabP { - S.cmov(&TabP[j], uint(subtle.ConstantTimeEq(inx, int32(j)))) - } - S.cneg(sig) - Q.mixAdd(&S) - } - Q.cneg(uint(isEven)) - return Q -} - -const ( - omegaFix = 7 - omegaVar = 5 -) - -// CombinedMult returns mG+nP. -func (e twistCurve) CombinedMult(m, n *Scalar, P *twistPoint) *twistPoint { - nafFix := math.OmegaNAF(conv.BytesLe2BigInt(m[:]), omegaFix) - nafVar := math.OmegaNAF(conv.BytesLe2BigInt(n[:]), omegaVar) - - if len(nafFix) > len(nafVar) { - nafVar = append(nafVar, make([]int32, len(nafFix)-len(nafVar))...) - } else if len(nafFix) < len(nafVar) { - nafFix = append(nafFix, make([]int32, len(nafVar)-len(nafFix))...) - } - - var TabQ [1 << (omegaVar - 2)]preTwistPointProy - P.oddMultiples(TabQ[:]) - Q := e.Identity() - for i := len(nafFix) - 1; i >= 0; i-- { - Q.Double() - // Generator point - if nafFix[i] != 0 { - idxM := absolute(nafFix[i]) >> 1 - R := tabVerif[idxM] - if nafFix[i] < 0 { - R.neg() - } - Q.mixAddZ1(&R) - } - // Variable input point - if nafVar[i] != 0 { - idxN := absolute(nafVar[i]) >> 1 - S := TabQ[idxN] - if nafVar[i] < 0 { - S.neg() - } - Q.mixAdd(&S) - } - } - return Q -} - -// absolute returns always a positive value. -func absolute(x int32) int32 { - mask := x >> 31 - return (x + mask) ^ mask -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go deleted file mode 100644 index c55db77b06..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistPoint.go +++ /dev/null @@ -1,135 +0,0 @@ -package goldilocks - -import ( - "fmt" - - fp "github.com/cloudflare/circl/math/fp448" -) - -type twistPoint struct{ x, y, z, ta, tb fp.Elt } - -type preTwistPointAffine struct{ addYX, subYX, dt2 fp.Elt } - -type preTwistPointProy struct { - preTwistPointAffine - z2 fp.Elt -} - -func (P *twistPoint) String() string { - return fmt.Sprintf("x: %v\ny: %v\nz: %v\nta: %v\ntb: %v", P.x, P.y, P.z, P.ta, P.tb) -} - -// cneg conditionally negates the point if b=1. -func (P *twistPoint) cneg(b uint) { - t := &fp.Elt{} - fp.Neg(t, &P.x) - fp.Cmov(&P.x, t, b) - fp.Neg(t, &P.ta) - fp.Cmov(&P.ta, t, b) -} - -// Double updates P with 2P. -func (P *twistPoint) Double() { - // This is formula (7) from "Twisted Edwards Curves Revisited" by - // Hisil H., Wong K.KH., Carter G., Dawson E. (2008) - // https://doi.org/10.1007/978-3-540-89255-7_20 - Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb - a, b, c, e, f, g, h := Px, Py, Pz, Pta, Px, Py, Ptb - fp.Add(e, Px, Py) // x+y - fp.Sqr(a, Px) // A = x^2 - fp.Sqr(b, Py) // B = y^2 - fp.Sqr(c, Pz) // z^2 - fp.Add(c, c, c) // C = 2*z^2 - fp.Add(h, a, b) // H = A+B - fp.Sqr(e, e) // (x+y)^2 - fp.Sub(e, e, h) // E = (x+y)^2-A-B - fp.Sub(g, b, a) // G = B-A - fp.Sub(f, c, g) // F = C-G - fp.Mul(Pz, f, g) // Z = F * G - fp.Mul(Px, e, f) // X = E * F - fp.Mul(Py, g, h) // Y = G * H, T = E * H -} - -// mixAdd calculates P= P+Q, where Q is a precomputed point with Z_Q = 1. -func (P *twistPoint) mixAddZ1(Q *preTwistPointAffine) { - fp.Add(&P.z, &P.z, &P.z) // D = 2*z1 (z2=1) - P.coreAddition(Q) -} - -// coreAddition calculates P=P+Q for curves with A=-1. -func (P *twistPoint) coreAddition(Q *preTwistPointAffine) { - // This is the formula following (5) from "Twisted Edwards Curves Revisited" by - // Hisil H., Wong K.KH., Carter G., Dawson E. (2008) - // https://doi.org/10.1007/978-3-540-89255-7_20 - Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb - addYX2, subYX2, dt2 := &Q.addYX, &Q.subYX, &Q.dt2 - a, b, c, d, e, f, g, h := Px, Py, &fp.Elt{}, Pz, Pta, Px, Py, Ptb - fp.Mul(c, Pta, Ptb) // t1 = ta*tb - fp.Sub(h, Py, Px) // y1-x1 - fp.Add(b, Py, Px) // y1+x1 - fp.Mul(a, h, subYX2) // A = (y1-x1)*(y2-x2) - fp.Mul(b, b, addYX2) // B = (y1+x1)*(y2+x2) - fp.Mul(c, c, dt2) // C = 2*D*t1*t2 - fp.Sub(e, b, a) // E = B-A - fp.Add(h, b, a) // H = B+A - fp.Sub(f, d, c) // F = D-C - fp.Add(g, d, c) // G = D+C - fp.Mul(Pz, f, g) // Z = F * G - fp.Mul(Px, e, f) // X = E * F - fp.Mul(Py, g, h) // Y = G * H, T = E * H -} - -func (P *preTwistPointAffine) neg() { - P.addYX, P.subYX = P.subYX, P.addYX - fp.Neg(&P.dt2, &P.dt2) -} - -func (P *preTwistPointAffine) cneg(b int) { - t := &fp.Elt{} - fp.Cswap(&P.addYX, &P.subYX, uint(b)) - fp.Neg(t, &P.dt2) - fp.Cmov(&P.dt2, t, uint(b)) -} - -func (P *preTwistPointAffine) cmov(Q *preTwistPointAffine, b uint) { - fp.Cmov(&P.addYX, &Q.addYX, b) - fp.Cmov(&P.subYX, &Q.subYX, b) - fp.Cmov(&P.dt2, &Q.dt2, b) -} - -// mixAdd calculates P= P+Q, where Q is a precomputed point with Z_Q != 1. -func (P *twistPoint) mixAdd(Q *preTwistPointProy) { - fp.Mul(&P.z, &P.z, &Q.z2) // D = 2*z1*z2 - P.coreAddition(&Q.preTwistPointAffine) -} - -// oddMultiples calculates T[i] = (2*i-1)P for 0 < i < len(T). -func (P *twistPoint) oddMultiples(T []preTwistPointProy) { - if n := len(T); n > 0 { - T[0].FromTwistPoint(P) - _2P := *P - _2P.Double() - R := &preTwistPointProy{} - R.FromTwistPoint(&_2P) - for i := 1; i < n; i++ { - P.mixAdd(R) - T[i].FromTwistPoint(P) - } - } -} - -// cmov conditionally moves Q into P if b=1. -func (P *preTwistPointProy) cmov(Q *preTwistPointProy, b uint) { - P.preTwistPointAffine.cmov(&Q.preTwistPointAffine, b) - fp.Cmov(&P.z2, &Q.z2, b) -} - -// FromTwistPoint precomputes some coordinates of Q for missed addition. -func (P *preTwistPointProy) FromTwistPoint(Q *twistPoint) { - fp.Add(&P.addYX, &Q.y, &Q.x) // addYX = X + Y - fp.Sub(&P.subYX, &Q.y, &Q.x) // subYX = Y - X - fp.Mul(&P.dt2, &Q.ta, &Q.tb) // T = ta*tb - fp.Mul(&P.dt2, &P.dt2, ¶mDTwist) // D*T - fp.Add(&P.dt2, &P.dt2, &P.dt2) // dt2 = 2*D*T - fp.Add(&P.z2, &Q.z, &Q.z) // z2 = 2*Z -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go deleted file mode 100644 index ed432e02c7..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twistTables.go +++ /dev/null @@ -1,216 +0,0 @@ -package goldilocks - -import fp "github.com/cloudflare/circl/math/fp448" - -var tabFixMult = [fxV][fx2w1]preTwistPointAffine{ - { - { - addYX: fp.Elt{0x65, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2b, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05}, - subYX: fp.Elt{0x64, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2d, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05}, - dt2: fp.Elt{0x1a, 0x33, 0xea, 0x64, 0x45, 0x1c, 0xdf, 0x17, 0x1d, 0x16, 0x34, 0x28, 0xd6, 0x61, 0x19, 0x67, 0x79, 0xb4, 0x13, 0xcf, 0x3e, 0x7c, 0x0e, 0x72, 0xda, 0xf1, 0x5f, 0xda, 0xe6, 0xcf, 0x42, 0xd3, 0xb6, 0x17, 0xc2, 0x68, 0x13, 0x2d, 0xd9, 0x60, 0x3e, 0xae, 0xf0, 0x5b, 0x96, 0xf0, 0xcd, 0xaf, 0xea, 0xb7, 0x0d, 0x59, 0x16, 0xa7, 0xff, 0x55}, - }, - { - addYX: fp.Elt{0xca, 0xd8, 0x7d, 0x86, 0x1a, 0xef, 0xad, 0x11, 0xe3, 0x27, 0x41, 0x7e, 0x7f, 0x3e, 0xa9, 0xd2, 0xb5, 0x4e, 0x50, 0xe0, 0x77, 0x91, 0xc2, 0x13, 0x52, 0x73, 0x41, 0x09, 0xa6, 0x57, 0x9a, 0xc8, 0xa8, 0x90, 0x9d, 0x26, 0x14, 0xbb, 0xa1, 0x2a, 0xf7, 0x45, 0x43, 0x4e, 0xea, 0x35, 0x62, 0xe1, 0x08, 0x85, 0x46, 0xb8, 0x24, 0x05, 0x2d, 0xab}, - subYX: fp.Elt{0x9b, 0xe6, 0xd3, 0xe5, 0xfe, 0x50, 0x36, 0x3c, 0x3c, 0x6d, 0x74, 0x1d, 0x74, 0xc0, 0xde, 0x5b, 0x45, 0x27, 0xe5, 0x12, 0xee, 0x63, 0x35, 0x6b, 0x13, 0xe2, 0x41, 0x6b, 0x3a, 0x05, 0x2b, 0xb1, 0x89, 0x26, 0xb6, 0xc6, 0xd1, 0x84, 0xff, 0x0e, 0x9b, 0xa3, 0xfb, 0x21, 0x36, 0x6b, 0x01, 0xf7, 0x9f, 0x7c, 0xeb, 0xf5, 0x18, 0x7a, 0x2a, 0x70}, - dt2: fp.Elt{0x09, 0xad, 0x99, 0x1a, 0x38, 0xd3, 0xdf, 0x22, 0x37, 0x32, 0x61, 0x8b, 0xf3, 0x19, 0x48, 0x08, 0xe8, 0x49, 0xb6, 0x4a, 0xa7, 0xed, 0xa4, 0xa2, 0xee, 0x86, 0xd7, 0x31, 0x5e, 0xce, 0x95, 0x76, 0x86, 0x42, 0x1c, 0x9d, 0x07, 0x14, 0x8c, 0x34, 0x18, 0x9c, 0x6d, 0x3a, 0xdf, 0xa9, 0xe8, 0x36, 0x7e, 0xe4, 0x95, 0xbe, 0xb5, 0x09, 0xf8, 0x9c}, - }, - { - addYX: fp.Elt{0x51, 0xdb, 0x49, 0xa8, 0x9f, 0xe3, 0xd7, 0xec, 0x0d, 0x0f, 0x49, 0xe8, 0xb6, 0xc5, 0x0f, 0x5a, 0x1c, 0xce, 0x54, 0x0d, 0xb1, 0x8d, 0x5b, 0xbf, 0xf4, 0xaa, 0x34, 0x77, 0xc4, 0x5d, 0x59, 0xb6, 0xc5, 0x0e, 0x5a, 0xd8, 0x5b, 0x30, 0xc2, 0x1d, 0xec, 0x85, 0x1c, 0x42, 0xbe, 0x24, 0x2e, 0x50, 0x55, 0x44, 0xb2, 0x3a, 0x01, 0xaa, 0x98, 0xfb}, - subYX: fp.Elt{0xe7, 0x29, 0xb7, 0xd0, 0xaa, 0x4f, 0x32, 0x53, 0x56, 0xde, 0xbc, 0xd1, 0x92, 0x5d, 0x19, 0xbe, 0xa3, 0xe3, 0x75, 0x48, 0xe0, 0x7a, 0x1b, 0x54, 0x7a, 0xb7, 0x41, 0x77, 0x84, 0x38, 0xdd, 0x14, 0x9f, 0xca, 0x3f, 0xa3, 0xc8, 0xa7, 0x04, 0x70, 0xf1, 0x4d, 0x3d, 0xb3, 0x84, 0x79, 0xcb, 0xdb, 0xe4, 0xc5, 0x42, 0x9b, 0x57, 0x19, 0xf1, 0x2d}, - dt2: fp.Elt{0x20, 0xb4, 0x94, 0x9e, 0xdf, 0x31, 0x44, 0x0b, 0xc9, 0x7b, 0x75, 0x40, 0x9d, 0xd1, 0x96, 0x39, 0x70, 0x71, 0x15, 0xc8, 0x93, 0xd5, 0xc5, 0xe5, 0xba, 0xfe, 0xee, 0x08, 0x6a, 0x98, 0x0a, 0x1b, 0xb2, 0xaa, 0x3a, 0xf4, 0xa4, 0x79, 0xf9, 0x8e, 0x4d, 0x65, 0x10, 0x9b, 0x3a, 0x6e, 0x7c, 0x87, 0x94, 0x92, 0x11, 0x65, 0xbf, 0x1a, 0x09, 0xde}, - }, - { - addYX: fp.Elt{0xf3, 0x84, 0x76, 0x77, 0xa5, 0x6b, 0x27, 0x3b, 0x83, 0x3d, 0xdf, 0xa0, 0xeb, 0x32, 0x6d, 0x58, 0x81, 0x57, 0x64, 0xc2, 0x21, 0x7c, 0x9b, 0xea, 0xe6, 0xb0, 0x93, 0xf9, 0xe7, 0xc3, 0xed, 0x5a, 0x8e, 0xe2, 0xb4, 0x72, 0x76, 0x66, 0x0f, 0x22, 0x29, 0x94, 0x3e, 0x63, 0x48, 0x5e, 0x80, 0xcb, 0xac, 0xfa, 0x95, 0xb6, 0x4b, 0xc4, 0x95, 0x33}, - subYX: fp.Elt{0x0c, 0x55, 0xd1, 0x5e, 0x5f, 0xbf, 0xbf, 0xe2, 0x4c, 0xfc, 0x37, 0x4a, 0xc4, 0xb1, 0xf4, 0x83, 0x61, 0x93, 0x60, 0x8e, 0x9f, 0x31, 0xf0, 0xa0, 0x41, 0xff, 0x1d, 0xe2, 0x7f, 0xca, 0x40, 0xd6, 0x88, 0xe8, 0x91, 0x61, 0xe2, 0x11, 0x18, 0x83, 0xf3, 0x25, 0x2f, 0x3f, 0x49, 0x40, 0xd4, 0x83, 0xe2, 0xd7, 0x74, 0x6a, 0x16, 0x86, 0x4e, 0xab}, - dt2: fp.Elt{0xdd, 0x58, 0x65, 0xd8, 0x9f, 0xdd, 0x70, 0x7f, 0x0f, 0xec, 0xbd, 0x5c, 0x5c, 0x9b, 0x7e, 0x1b, 0x9f, 0x79, 0x36, 0x1f, 0xfd, 0x79, 0x10, 0x1c, 0x52, 0xf3, 0x22, 0xa4, 0x1f, 0x71, 0x6e, 0x63, 0x14, 0xf4, 0xa7, 0x3e, 0xbe, 0xad, 0x43, 0x30, 0x38, 0x8c, 0x29, 0xc6, 0xcf, 0x50, 0x75, 0x21, 0xe5, 0x78, 0xfd, 0xb0, 0x9a, 0xc4, 0x6d, 0xd4}, - }, - }, - { - { - addYX: fp.Elt{0x7a, 0xa1, 0x38, 0xa6, 0xfd, 0x0e, 0x96, 0xd5, 0x26, 0x76, 0x86, 0x70, 0x80, 0x30, 0xa6, 0x67, 0xeb, 0xf4, 0x39, 0xdb, 0x22, 0xf5, 0x9f, 0x98, 0xe4, 0xb5, 0x3a, 0x0c, 0x59, 0xbf, 0x85, 0xc6, 0xf0, 0x0b, 0x1c, 0x41, 0x38, 0x09, 0x01, 0xdb, 0xd6, 0x3c, 0xb7, 0xf1, 0x08, 0x6b, 0x4b, 0x9e, 0x63, 0x53, 0x83, 0xd3, 0xab, 0xa3, 0x72, 0x0d}, - subYX: fp.Elt{0x84, 0x68, 0x25, 0xe8, 0xe9, 0x8f, 0x91, 0xbf, 0xf7, 0xa4, 0x30, 0xae, 0xea, 0x9f, 0xdd, 0x56, 0x64, 0x09, 0xc9, 0x54, 0x68, 0x4e, 0x33, 0xc5, 0x6f, 0x7b, 0x2d, 0x52, 0x2e, 0x42, 0xbe, 0xbe, 0xf5, 0x64, 0xbf, 0x77, 0x54, 0xdf, 0xb0, 0x10, 0xd2, 0x16, 0x5d, 0xce, 0xaf, 0x9f, 0xfb, 0xa3, 0x63, 0x50, 0xcb, 0xc0, 0xd0, 0x88, 0x44, 0xa3}, - dt2: fp.Elt{0xc3, 0x8b, 0xa5, 0xf1, 0x44, 0xe4, 0x41, 0xcd, 0x75, 0xe3, 0x17, 0x69, 0x5b, 0xb9, 0xbb, 0xee, 0x82, 0xbb, 0xce, 0x57, 0xdf, 0x2a, 0x9c, 0x12, 0xab, 0x66, 0x08, 0x68, 0x05, 0x1b, 0x87, 0xee, 0x5d, 0x1e, 0x18, 0x14, 0x22, 0x4b, 0x99, 0x61, 0x75, 0x28, 0xe7, 0x65, 0x1c, 0x36, 0xb6, 0x18, 0x09, 0xa8, 0xdf, 0xef, 0x30, 0x35, 0xbc, 0x58}, - }, - { - addYX: fp.Elt{0xc5, 0xd3, 0x0e, 0x6f, 0xaf, 0x06, 0x69, 0xc4, 0x07, 0x9e, 0x58, 0x6e, 0x3f, 0x49, 0xd9, 0x0a, 0x3c, 0x2c, 0x37, 0xcd, 0x27, 0x4d, 0x87, 0x91, 0x7a, 0xb0, 0x28, 0xad, 0x2f, 0x68, 0x92, 0x05, 0x97, 0xf1, 0x30, 0x5f, 0x4c, 0x10, 0x20, 0x30, 0xd3, 0x08, 0x3f, 0xc1, 0xc6, 0xb7, 0xb5, 0xd1, 0x71, 0x7b, 0xa8, 0x0a, 0xd8, 0xf5, 0x17, 0xcf}, - subYX: fp.Elt{0x64, 0xd4, 0x8f, 0x91, 0x40, 0xab, 0x6e, 0x1a, 0x62, 0x83, 0xdc, 0xd7, 0x30, 0x1a, 0x4a, 0x2a, 0x4c, 0x54, 0x86, 0x19, 0x81, 0x5d, 0x04, 0x52, 0xa3, 0xca, 0x82, 0x38, 0xdc, 0x1e, 0xf0, 0x7a, 0x78, 0x76, 0x49, 0x4f, 0x71, 0xc4, 0x74, 0x2f, 0xf0, 0x5b, 0x2e, 0x5e, 0xac, 0xef, 0x17, 0xe4, 0x8e, 0x6e, 0xed, 0x43, 0x23, 0x61, 0x99, 0x49}, - dt2: fp.Elt{0x64, 0x90, 0x72, 0x76, 0xf8, 0x2c, 0x7d, 0x57, 0xf9, 0x30, 0x5e, 0x7a, 0x10, 0x74, 0x19, 0x39, 0xd9, 0xaf, 0x0a, 0xf1, 0x43, 0xed, 0x88, 0x9c, 0x8b, 0xdc, 0x9b, 0x1c, 0x90, 0xe7, 0xf7, 0xa3, 0xa5, 0x0d, 0xc6, 0xbc, 0x30, 0xfb, 0x91, 0x1a, 0x51, 0xba, 0x2d, 0xbe, 0x89, 0xdf, 0x1d, 0xdc, 0x53, 0xa8, 0x82, 0x8a, 0xd3, 0x8d, 0x16, 0x68}, - }, - { - addYX: fp.Elt{0xef, 0x5c, 0xe3, 0x74, 0xbf, 0x13, 0x4a, 0xbf, 0x66, 0x73, 0x64, 0xb7, 0xd4, 0xce, 0x98, 0x82, 0x05, 0xfa, 0x98, 0x0c, 0x0a, 0xae, 0xe5, 0x6b, 0x9f, 0xac, 0xbb, 0x6e, 0x1f, 0xcf, 0xff, 0xa6, 0x71, 0x9a, 0xa8, 0x7a, 0x9e, 0x64, 0x1f, 0x20, 0x4a, 0x61, 0xa2, 0xd6, 0x50, 0xe3, 0xba, 0x81, 0x0c, 0x50, 0x59, 0x69, 0x59, 0x15, 0x55, 0xdb}, - subYX: fp.Elt{0xe8, 0x77, 0x4d, 0xe8, 0x66, 0x3d, 0xc1, 0x00, 0x3c, 0xf2, 0x25, 0x00, 0xdc, 0xb2, 0xe5, 0x9b, 0x12, 0x89, 0xf3, 0xd6, 0xea, 0x85, 0x60, 0xfe, 0x67, 0x91, 0xfd, 0x04, 0x7c, 0xe0, 0xf1, 0x86, 0x06, 0x11, 0x66, 0xee, 0xd4, 0xd5, 0xbe, 0x3b, 0x0f, 0xe3, 0x59, 0xb3, 0x4f, 0x00, 0xb6, 0xce, 0x80, 0xc1, 0x61, 0xf7, 0xaf, 0x04, 0x6a, 0x3c}, - dt2: fp.Elt{0x00, 0xd7, 0x32, 0x93, 0x67, 0x70, 0x6f, 0xd7, 0x69, 0xab, 0xb1, 0xd3, 0xdc, 0xd6, 0xa8, 0xdd, 0x35, 0x25, 0xca, 0xd3, 0x8a, 0x6d, 0xce, 0xfb, 0xfd, 0x2b, 0x83, 0xf0, 0xd4, 0xac, 0x66, 0xfb, 0x72, 0x87, 0x7e, 0x55, 0xb7, 0x91, 0x58, 0x10, 0xc3, 0x11, 0x7e, 0x15, 0xfe, 0x7c, 0x55, 0x90, 0xa3, 0x9e, 0xed, 0x9a, 0x7f, 0xa7, 0xb7, 0xeb}, - }, - { - addYX: fp.Elt{0x25, 0x0f, 0xc2, 0x09, 0x9c, 0x10, 0xc8, 0x7c, 0x93, 0xa7, 0xbe, 0xe9, 0x26, 0x25, 0x7c, 0x21, 0xfe, 0xe7, 0x5f, 0x3c, 0x02, 0x83, 0xa7, 0x9e, 0xdf, 0xc0, 0x94, 0x2b, 0x7d, 0x1a, 0xd0, 0x1d, 0xcc, 0x2e, 0x7d, 0xd4, 0x85, 0xe7, 0xc1, 0x15, 0x66, 0xd6, 0xd6, 0x32, 0xb8, 0xf7, 0x63, 0xaa, 0x3b, 0xa5, 0xea, 0x49, 0xad, 0x88, 0x9b, 0x66}, - subYX: fp.Elt{0x09, 0x97, 0x79, 0x36, 0x41, 0x56, 0x9b, 0xdf, 0x15, 0xd8, 0x43, 0x28, 0x17, 0x5b, 0x96, 0xc9, 0xcf, 0x39, 0x1f, 0x13, 0xf7, 0x4d, 0x1d, 0x1f, 0xda, 0x51, 0x56, 0xe7, 0x0a, 0x5a, 0x65, 0xb6, 0x2a, 0x87, 0x49, 0x86, 0xc2, 0x2b, 0xcd, 0xfe, 0x07, 0xf6, 0x4c, 0xe2, 0x1d, 0x9b, 0xd8, 0x82, 0x09, 0x5b, 0x11, 0x10, 0x62, 0x56, 0x89, 0xbd}, - dt2: fp.Elt{0xd9, 0x15, 0x73, 0xf2, 0x96, 0x35, 0x53, 0xb0, 0xe7, 0xa8, 0x0b, 0x93, 0x35, 0x0b, 0x3a, 0x00, 0xf5, 0x18, 0xb1, 0xc3, 0x12, 0x3f, 0x91, 0x17, 0xc1, 0x4c, 0x15, 0x5a, 0x86, 0x92, 0x11, 0xbd, 0x44, 0x40, 0x5a, 0x7b, 0x15, 0x89, 0xba, 0xc1, 0xc1, 0xbc, 0x43, 0x45, 0xe6, 0x52, 0x02, 0x73, 0x0a, 0xd0, 0x2a, 0x19, 0xda, 0x47, 0xa8, 0xff}, - }, - }, -} - -// tabVerif contains the odd multiples of P. The entry T[i] = (2i+1)P, where -// P = phi(G) and G is the generator of the Goldilocks curve, and phi is a -// 4-degree isogeny. -var tabVerif = [1 << (omegaFix - 2)]preTwistPointAffine{ - { /* 1P*/ - addYX: fp.Elt{0x65, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2b, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05}, - subYX: fp.Elt{0x64, 0x4a, 0xdd, 0xdf, 0xb4, 0x79, 0x60, 0xc8, 0xa1, 0x70, 0xb4, 0x3a, 0x1e, 0x0c, 0x9b, 0x19, 0xe5, 0x48, 0x3f, 0xd7, 0x44, 0x18, 0x18, 0x14, 0x14, 0x27, 0x45, 0xd0, 0x2d, 0x24, 0xd5, 0x93, 0xc3, 0x74, 0x4c, 0x50, 0x70, 0x43, 0x26, 0x05, 0x08, 0x24, 0xca, 0x78, 0x30, 0xc1, 0x06, 0x8d, 0xd4, 0x86, 0x42, 0xf0, 0x14, 0xde, 0x08, 0x05}, - dt2: fp.Elt{0x1a, 0x33, 0xea, 0x64, 0x45, 0x1c, 0xdf, 0x17, 0x1d, 0x16, 0x34, 0x28, 0xd6, 0x61, 0x19, 0x67, 0x79, 0xb4, 0x13, 0xcf, 0x3e, 0x7c, 0x0e, 0x72, 0xda, 0xf1, 0x5f, 0xda, 0xe6, 0xcf, 0x42, 0xd3, 0xb6, 0x17, 0xc2, 0x68, 0x13, 0x2d, 0xd9, 0x60, 0x3e, 0xae, 0xf0, 0x5b, 0x96, 0xf0, 0xcd, 0xaf, 0xea, 0xb7, 0x0d, 0x59, 0x16, 0xa7, 0xff, 0x55}, - }, - { /* 3P*/ - addYX: fp.Elt{0xd1, 0xe9, 0xa8, 0x33, 0x20, 0x76, 0x18, 0x08, 0x45, 0x2a, 0xc9, 0x67, 0x2a, 0xc3, 0x15, 0x24, 0xf9, 0x74, 0x21, 0x30, 0x99, 0x59, 0x8b, 0xb2, 0xf0, 0xa4, 0x07, 0xe2, 0x6a, 0x36, 0x8d, 0xd9, 0xd2, 0x4a, 0x7f, 0x73, 0x50, 0x39, 0x3d, 0xaa, 0xa7, 0x51, 0x73, 0x0d, 0x2b, 0x8b, 0x96, 0x47, 0xac, 0x3c, 0x5d, 0xaa, 0x39, 0x9c, 0xcf, 0xd5}, - subYX: fp.Elt{0x6b, 0x11, 0x5d, 0x1a, 0xf9, 0x41, 0x9d, 0xc5, 0x30, 0x3e, 0xad, 0x25, 0x2c, 0x04, 0x45, 0xea, 0xcc, 0x67, 0x07, 0x85, 0xe9, 0xda, 0x0e, 0xb5, 0x40, 0xb7, 0x32, 0xb4, 0x49, 0xdd, 0xff, 0xaa, 0xfc, 0xbb, 0x19, 0xca, 0x8b, 0x79, 0x2b, 0x8f, 0x8d, 0x00, 0x33, 0xc2, 0xad, 0xe9, 0xd3, 0x12, 0xa8, 0xaa, 0x87, 0x62, 0xad, 0x2d, 0xff, 0xa4}, - dt2: fp.Elt{0xb0, 0xaf, 0x3b, 0xea, 0xf0, 0x42, 0x0b, 0x5e, 0x88, 0xd3, 0x98, 0x08, 0x87, 0x59, 0x72, 0x0a, 0xc2, 0xdf, 0xcb, 0x7f, 0x59, 0xb5, 0x4c, 0x63, 0x68, 0xe8, 0x41, 0x38, 0x67, 0x4f, 0xe9, 0xc6, 0xb2, 0x6b, 0x08, 0xa7, 0xf7, 0x0e, 0xcd, 0xea, 0xca, 0x3d, 0xaf, 0x8e, 0xda, 0x4b, 0x2e, 0xd2, 0x88, 0x64, 0x8d, 0xc5, 0x5f, 0x76, 0x0f, 0x3d}, - }, - { /* 5P*/ - addYX: fp.Elt{0xe5, 0x65, 0xc9, 0xe2, 0x75, 0xf0, 0x7d, 0x1a, 0xba, 0xa4, 0x40, 0x4b, 0x93, 0x12, 0xa2, 0x80, 0x95, 0x0d, 0x03, 0x93, 0xe8, 0xa5, 0x4d, 0xe2, 0x3d, 0x81, 0xf5, 0xce, 0xd4, 0x2d, 0x25, 0x59, 0x16, 0x5c, 0xe7, 0xda, 0xc7, 0x45, 0xd2, 0x7e, 0x2c, 0x38, 0xd4, 0x37, 0x64, 0xb2, 0xc2, 0x28, 0xc5, 0x72, 0x16, 0x32, 0x45, 0x36, 0x6f, 0x9f}, - subYX: fp.Elt{0x09, 0xf4, 0x7e, 0xbd, 0x89, 0xdb, 0x19, 0x58, 0xe1, 0x08, 0x00, 0x8a, 0xf4, 0x5f, 0x2a, 0x32, 0x40, 0xf0, 0x2c, 0x3f, 0x5d, 0xe4, 0xfc, 0x89, 0x11, 0x24, 0xb4, 0x2f, 0x97, 0xad, 0xac, 0x8f, 0x19, 0xab, 0xfa, 0x12, 0xe5, 0xf9, 0x50, 0x4e, 0x50, 0x6f, 0x32, 0x30, 0x88, 0xa6, 0xe5, 0x48, 0x28, 0xa2, 0x1b, 0x9f, 0xcd, 0xe2, 0x43, 0x38}, - dt2: fp.Elt{0xa9, 0xcc, 0x53, 0x39, 0x86, 0x02, 0x60, 0x75, 0x34, 0x99, 0x57, 0xbd, 0xfc, 0x5a, 0x8e, 0xce, 0x5e, 0x98, 0x22, 0xd0, 0xa5, 0x24, 0xff, 0x90, 0x28, 0x9f, 0x58, 0xf3, 0x39, 0xe9, 0xba, 0x36, 0x23, 0xfb, 0x7f, 0x41, 0xcc, 0x2b, 0x5a, 0x25, 0x3f, 0x4c, 0x2a, 0xf1, 0x52, 0x6f, 0x2f, 0x07, 0xe3, 0x88, 0x81, 0x77, 0xdd, 0x7c, 0x88, 0x82}, - }, - { /* 7P*/ - addYX: fp.Elt{0xf7, 0xee, 0x88, 0xfd, 0x3a, 0xbf, 0x7e, 0x28, 0x39, 0x23, 0x79, 0xe6, 0x5c, 0x56, 0xcb, 0xb5, 0x48, 0x6a, 0x80, 0x6d, 0x37, 0x60, 0x6c, 0x10, 0x35, 0x49, 0x4b, 0x46, 0x60, 0xd4, 0x79, 0xd4, 0x53, 0xd3, 0x67, 0x88, 0xd0, 0x41, 0xd5, 0x43, 0x85, 0xc8, 0x71, 0xe3, 0x1c, 0xb6, 0xda, 0x22, 0x64, 0x8f, 0x80, 0xac, 0xad, 0x7d, 0xd5, 0x82}, - subYX: fp.Elt{0x92, 0x40, 0xc1, 0x83, 0x21, 0x9b, 0xd5, 0x7d, 0x3f, 0x29, 0xb6, 0x26, 0xef, 0x12, 0xb9, 0x27, 0x39, 0x42, 0x37, 0x97, 0x09, 0x9a, 0x08, 0xe1, 0x68, 0xb6, 0x7a, 0x3f, 0x9f, 0x45, 0xf8, 0x37, 0x19, 0x83, 0x97, 0xe6, 0x73, 0x30, 0x32, 0x35, 0xcf, 0xae, 0x5c, 0x12, 0x68, 0xdf, 0x6e, 0x2b, 0xde, 0x83, 0xa0, 0x44, 0x74, 0x2e, 0x4a, 0xe9}, - dt2: fp.Elt{0xcb, 0x22, 0x0a, 0xda, 0x6b, 0xc1, 0x8a, 0x29, 0xa1, 0xac, 0x8b, 0x5b, 0x8b, 0x32, 0x20, 0xf2, 0x21, 0xae, 0x0c, 0x43, 0xc4, 0xd7, 0x19, 0x37, 0x3d, 0x79, 0x25, 0x98, 0x6c, 0x9c, 0x22, 0x31, 0x2a, 0x55, 0x9f, 0xda, 0x5e, 0xa8, 0x13, 0xdb, 0x8e, 0x2e, 0x16, 0x39, 0xf4, 0x91, 0x6f, 0xec, 0x71, 0x71, 0xc9, 0x10, 0xf2, 0xa4, 0x8f, 0x11}, - }, - { /* 9P*/ - addYX: fp.Elt{0x85, 0xdd, 0x37, 0x62, 0x74, 0x8e, 0x33, 0x5b, 0x25, 0x12, 0x1b, 0xe7, 0xdf, 0x47, 0xe5, 0x12, 0xfd, 0x3a, 0x3a, 0xf5, 0x5d, 0x4c, 0xa2, 0x29, 0x3c, 0x5c, 0x2f, 0xee, 0x18, 0x19, 0x0a, 0x2b, 0xef, 0x67, 0x50, 0x7a, 0x0d, 0x29, 0xae, 0x55, 0x82, 0xcd, 0xd6, 0x41, 0x90, 0xb4, 0x13, 0x31, 0x5d, 0x11, 0xb8, 0xaa, 0x12, 0x86, 0x08, 0xac}, - subYX: fp.Elt{0xcc, 0x37, 0x8d, 0x83, 0x5f, 0xfd, 0xde, 0xd5, 0xf7, 0xf1, 0xae, 0x0a, 0xa7, 0x0b, 0xeb, 0x6d, 0x19, 0x8a, 0xb6, 0x1a, 0x59, 0xd8, 0xff, 0x3c, 0xbc, 0xbc, 0xef, 0x9c, 0xda, 0x7b, 0x75, 0x12, 0xaf, 0x80, 0x8f, 0x2c, 0x3c, 0xaa, 0x0b, 0x17, 0x86, 0x36, 0x78, 0x18, 0xc8, 0x8a, 0xf6, 0xb8, 0x2c, 0x2f, 0x57, 0x2c, 0x62, 0x57, 0xf6, 0x90}, - dt2: fp.Elt{0x83, 0xbc, 0xa2, 0x07, 0xa5, 0x38, 0x96, 0xea, 0xfe, 0x11, 0x46, 0x1d, 0x3b, 0xcd, 0x42, 0xc5, 0xee, 0x67, 0x04, 0x72, 0x08, 0xd8, 0xd9, 0x96, 0x07, 0xf7, 0xac, 0xc3, 0x64, 0xf1, 0x98, 0x2c, 0x55, 0xd7, 0x7d, 0xc8, 0x6c, 0xbd, 0x2c, 0xff, 0x15, 0xd6, 0x6e, 0xb8, 0x17, 0x8e, 0xa8, 0x27, 0x66, 0xb1, 0x73, 0x79, 0x96, 0xff, 0x29, 0x10}, - }, - { /* 11P*/ - addYX: fp.Elt{0x76, 0xcb, 0x9b, 0x0c, 0x5b, 0xfe, 0xe1, 0x2a, 0xdd, 0x6f, 0x6c, 0xdd, 0x6f, 0xb4, 0xc0, 0xc2, 0x1b, 0x4b, 0x38, 0xe8, 0x66, 0x8c, 0x1e, 0x31, 0x63, 0xb9, 0x94, 0xcd, 0xc3, 0x8c, 0x44, 0x25, 0x7b, 0xd5, 0x39, 0x80, 0xfc, 0x01, 0xaa, 0xf7, 0x2a, 0x61, 0x8a, 0x25, 0xd2, 0x5f, 0xc5, 0x66, 0x38, 0xa4, 0x17, 0xcf, 0x3e, 0x11, 0x0f, 0xa3}, - subYX: fp.Elt{0xe0, 0xb6, 0xd1, 0x9c, 0x71, 0x49, 0x2e, 0x7b, 0xde, 0x00, 0xda, 0x6b, 0xf1, 0xec, 0xe6, 0x7a, 0x15, 0x38, 0x71, 0xe9, 0x7b, 0xdb, 0xf8, 0x98, 0xc0, 0x91, 0x2e, 0x53, 0xee, 0x92, 0x87, 0x25, 0xc9, 0xb0, 0xbb, 0x33, 0x15, 0x46, 0x7f, 0xfd, 0x4f, 0x8b, 0x77, 0x05, 0x96, 0xb6, 0xe2, 0x08, 0xdb, 0x0d, 0x09, 0xee, 0x5b, 0xd1, 0x2a, 0x63}, - dt2: fp.Elt{0x8f, 0x7b, 0x57, 0x8c, 0xbf, 0x06, 0x0d, 0x43, 0x21, 0x92, 0x94, 0x2d, 0x6a, 0x38, 0x07, 0x0f, 0xa0, 0xf1, 0xe3, 0xd8, 0x2a, 0xbf, 0x46, 0xc6, 0x9e, 0x1f, 0x8f, 0x2b, 0x46, 0x84, 0x0b, 0x74, 0xed, 0xff, 0xf8, 0xa5, 0x94, 0xae, 0xf1, 0x67, 0xb1, 0x9b, 0xdd, 0x4a, 0xd0, 0xdb, 0xc2, 0xb5, 0x58, 0x49, 0x0c, 0xa9, 0x1d, 0x7d, 0xa9, 0xd3}, - }, - { /* 13P*/ - addYX: fp.Elt{0x73, 0x84, 0x2e, 0x31, 0x1f, 0xdc, 0xed, 0x9f, 0x74, 0xfa, 0xe0, 0x35, 0xb1, 0x85, 0x6a, 0x8d, 0x86, 0xd0, 0xff, 0xd6, 0x08, 0x43, 0x73, 0x1a, 0xd5, 0xf8, 0x43, 0xd4, 0xb3, 0xe5, 0x3f, 0xa8, 0x84, 0x17, 0x59, 0x65, 0x4e, 0xe6, 0xee, 0x54, 0x9c, 0xda, 0x5e, 0x7e, 0x98, 0x29, 0x6d, 0x73, 0x34, 0x1f, 0x99, 0x80, 0x54, 0x54, 0x81, 0x0b}, - subYX: fp.Elt{0xb1, 0xe5, 0xbb, 0x80, 0x22, 0x9c, 0x81, 0x6d, 0xaf, 0x27, 0x65, 0x6f, 0x7e, 0x9c, 0xb6, 0x8d, 0x35, 0x5c, 0x2e, 0x20, 0x48, 0x7a, 0x28, 0xf0, 0x97, 0xfe, 0xb7, 0x71, 0xce, 0xd6, 0xad, 0x3a, 0x81, 0xf6, 0x74, 0x5e, 0xf3, 0xfd, 0x1b, 0xd4, 0x1e, 0x7c, 0xc2, 0xb7, 0xc8, 0xa6, 0xc9, 0x89, 0x03, 0x47, 0xec, 0x24, 0xd6, 0x0e, 0xec, 0x9c}, - dt2: fp.Elt{0x91, 0x0a, 0x43, 0x34, 0x20, 0xc2, 0x64, 0xf7, 0x4e, 0x48, 0xc8, 0xd2, 0x95, 0x83, 0xd1, 0xa4, 0xfb, 0x4e, 0x41, 0x3b, 0x0d, 0xd5, 0x07, 0xd9, 0xf1, 0x13, 0x16, 0x78, 0x54, 0x57, 0xd0, 0xf1, 0x4f, 0x20, 0xac, 0xcf, 0x9c, 0x3b, 0x33, 0x0b, 0x99, 0x54, 0xc3, 0x7f, 0x3e, 0x57, 0x26, 0x86, 0xd5, 0xa5, 0x2b, 0x8d, 0xe3, 0x19, 0x36, 0xf7}, - }, - { /* 15P*/ - addYX: fp.Elt{0x23, 0x69, 0x47, 0x14, 0xf9, 0x9a, 0x50, 0xff, 0x64, 0xd1, 0x50, 0x35, 0xc3, 0x11, 0xd3, 0x19, 0xcf, 0x87, 0xda, 0x30, 0x0b, 0x50, 0xda, 0xc0, 0xe0, 0x25, 0x00, 0xe5, 0x68, 0x93, 0x04, 0xc2, 0xaf, 0xbd, 0x2f, 0x36, 0x5f, 0x47, 0x96, 0x10, 0xa8, 0xbd, 0xe4, 0x88, 0xac, 0x80, 0x52, 0x61, 0x73, 0xe9, 0x63, 0xdd, 0x99, 0xad, 0x20, 0x5b}, - subYX: fp.Elt{0x1b, 0x5e, 0xa2, 0x2a, 0x25, 0x0f, 0x86, 0xc0, 0xb1, 0x2e, 0x0c, 0x13, 0x40, 0x8d, 0xf0, 0xe6, 0x00, 0x55, 0x08, 0xc5, 0x7d, 0xf4, 0xc9, 0x31, 0x25, 0x3a, 0x99, 0x69, 0xdd, 0x67, 0x63, 0x9a, 0xd6, 0x89, 0x2e, 0xa1, 0x19, 0xca, 0x2c, 0xd9, 0x59, 0x5f, 0x5d, 0xc3, 0x6e, 0x62, 0x36, 0x12, 0x59, 0x15, 0xe1, 0xdc, 0xa4, 0xad, 0xc9, 0xd0}, - dt2: fp.Elt{0xbc, 0xea, 0xfc, 0xaf, 0x66, 0x23, 0xb7, 0x39, 0x6b, 0x2a, 0x96, 0xa8, 0x54, 0x43, 0xe9, 0xaa, 0x32, 0x40, 0x63, 0x92, 0x5e, 0xdf, 0x35, 0xc2, 0x9f, 0x24, 0x0c, 0xed, 0xfc, 0xde, 0x73, 0x8f, 0xa7, 0xd5, 0xa3, 0x2b, 0x18, 0x1f, 0xb0, 0xf8, 0xeb, 0x55, 0xd9, 0xc3, 0xfd, 0x28, 0x7c, 0x4f, 0xce, 0x0d, 0xf7, 0xae, 0xc2, 0x83, 0xc3, 0x78}, - }, - { /* 17P*/ - addYX: fp.Elt{0x71, 0xe6, 0x60, 0x93, 0x37, 0xdb, 0x01, 0xa5, 0x4c, 0xba, 0xe8, 0x8e, 0xd5, 0xf9, 0xd3, 0x98, 0xe5, 0xeb, 0xab, 0x3a, 0x15, 0x8b, 0x35, 0x60, 0xbe, 0xe5, 0x9c, 0x2d, 0x10, 0x9b, 0x2e, 0xcf, 0x65, 0x64, 0xea, 0x8f, 0x72, 0xce, 0xf5, 0x18, 0xe5, 0xe2, 0xf0, 0x0e, 0xae, 0x04, 0xec, 0xa0, 0x20, 0x65, 0x63, 0x07, 0xb1, 0x9f, 0x03, 0x97}, - subYX: fp.Elt{0x9e, 0x41, 0x64, 0x30, 0x95, 0x7f, 0x3a, 0x89, 0x7b, 0x0a, 0x79, 0x59, 0x23, 0x9a, 0x3b, 0xfe, 0xa4, 0x13, 0x08, 0xb2, 0x2e, 0x04, 0x50, 0x10, 0x30, 0xcd, 0x2e, 0xa4, 0x91, 0x71, 0x50, 0x36, 0x4a, 0x02, 0xf4, 0x8d, 0xa3, 0x36, 0x1b, 0xf4, 0x52, 0xba, 0x15, 0x04, 0x8b, 0x80, 0x25, 0xd9, 0xae, 0x67, 0x20, 0xd9, 0x88, 0x8f, 0x97, 0xa6}, - dt2: fp.Elt{0xb5, 0xe7, 0x46, 0xbd, 0x55, 0x23, 0xa0, 0x68, 0xc0, 0x12, 0xd9, 0xf1, 0x0a, 0x75, 0xe2, 0xda, 0xf4, 0x6b, 0xca, 0x14, 0xe4, 0x9f, 0x0f, 0xb5, 0x3c, 0xa6, 0xa5, 0xa2, 0x63, 0x94, 0xd1, 0x1c, 0x39, 0x58, 0x57, 0x02, 0x27, 0x98, 0xb6, 0x47, 0xc6, 0x61, 0x4b, 0x5c, 0xab, 0x6f, 0x2d, 0xab, 0xe3, 0xc1, 0x69, 0xf9, 0x12, 0xb0, 0xc8, 0xd5}, - }, - { /* 19P*/ - addYX: fp.Elt{0x19, 0x7d, 0xd5, 0xac, 0x79, 0xa2, 0x82, 0x9b, 0x28, 0x31, 0x22, 0xc0, 0x73, 0x02, 0x76, 0x17, 0x10, 0x70, 0x79, 0x57, 0xc9, 0x84, 0x62, 0x8e, 0x04, 0x04, 0x61, 0x67, 0x08, 0x48, 0xb4, 0x4b, 0xde, 0x53, 0x8c, 0xff, 0x36, 0x1b, 0x62, 0x86, 0x5d, 0xe1, 0x9b, 0xb1, 0xe5, 0xe8, 0x44, 0x64, 0xa1, 0x68, 0x3f, 0xa8, 0x45, 0x52, 0x91, 0xed}, - subYX: fp.Elt{0x42, 0x1a, 0x36, 0x1f, 0x90, 0x15, 0x24, 0x8d, 0x24, 0x80, 0xe6, 0xfe, 0x1e, 0xf0, 0xad, 0xaf, 0x6a, 0x93, 0xf0, 0xa6, 0x0d, 0x5d, 0xea, 0xf6, 0x62, 0x96, 0x7a, 0x05, 0x76, 0x85, 0x74, 0x32, 0xc7, 0xc8, 0x64, 0x53, 0x62, 0xe7, 0x54, 0x84, 0xe0, 0x40, 0x66, 0x19, 0x70, 0x40, 0x95, 0x35, 0x68, 0x64, 0x43, 0xcd, 0xba, 0x29, 0x32, 0xa8}, - dt2: fp.Elt{0x3e, 0xf6, 0xd6, 0xe4, 0x99, 0xeb, 0x20, 0x66, 0x08, 0x2e, 0x26, 0x64, 0xd7, 0x76, 0xf3, 0xb4, 0xc5, 0xa4, 0x35, 0x92, 0xd2, 0x99, 0x70, 0x5a, 0x1a, 0xe9, 0xe9, 0x3d, 0x3b, 0xe1, 0xcd, 0x0e, 0xee, 0x24, 0x13, 0x03, 0x22, 0xd6, 0xd6, 0x72, 0x08, 0x2b, 0xde, 0xfd, 0x93, 0xed, 0x0c, 0x7f, 0x5e, 0x31, 0x22, 0x4d, 0x80, 0x78, 0xc0, 0x48}, - }, - { /* 21P*/ - addYX: fp.Elt{0x8f, 0x72, 0xd2, 0x9e, 0xc4, 0xcd, 0x2c, 0xbf, 0xa8, 0xd3, 0x24, 0x62, 0x28, 0xee, 0x39, 0x0a, 0x19, 0x3a, 0x58, 0xff, 0x21, 0x2e, 0x69, 0x6c, 0x6e, 0x18, 0xd0, 0xcd, 0x61, 0xc1, 0x18, 0x02, 0x5a, 0xe9, 0xe3, 0xef, 0x1f, 0x8e, 0x10, 0xe8, 0x90, 0x2b, 0x48, 0xcd, 0xee, 0x38, 0xbd, 0x3a, 0xca, 0xbc, 0x2d, 0xe2, 0x3a, 0x03, 0x71, 0x02}, - subYX: fp.Elt{0xf8, 0xa4, 0x32, 0x26, 0x66, 0xaf, 0x3b, 0x53, 0xe7, 0xb0, 0x91, 0x92, 0xf5, 0x3c, 0x74, 0xce, 0xf2, 0xdd, 0x68, 0xa9, 0xf4, 0xcd, 0x5f, 0x60, 0xab, 0x71, 0xdf, 0xcd, 0x5c, 0x5d, 0x51, 0x72, 0x3a, 0x96, 0xea, 0xd6, 0xde, 0x54, 0x8e, 0x55, 0x4c, 0x08, 0x4c, 0x60, 0xdd, 0x34, 0xa9, 0x6f, 0xf3, 0x04, 0x02, 0xa8, 0xa6, 0x4e, 0x4d, 0x62}, - dt2: fp.Elt{0x76, 0x4a, 0xae, 0x38, 0x62, 0x69, 0x72, 0xdc, 0xe8, 0x43, 0xbe, 0x1d, 0x61, 0xde, 0x31, 0xc3, 0x42, 0x8f, 0x33, 0x9d, 0xca, 0xc7, 0x9c, 0xec, 0x6a, 0xe2, 0xaa, 0x01, 0x49, 0x78, 0x8d, 0x72, 0x4f, 0x38, 0xea, 0x52, 0xc2, 0xd3, 0xc9, 0x39, 0x71, 0xba, 0xb9, 0x09, 0x9b, 0xa3, 0x7f, 0x45, 0x43, 0x65, 0x36, 0x29, 0xca, 0xe7, 0x5c, 0x5f}, - }, - { /* 23P*/ - addYX: fp.Elt{0x89, 0x42, 0x35, 0x48, 0x6d, 0x74, 0xe5, 0x1f, 0xc3, 0xdd, 0x28, 0x5b, 0x84, 0x41, 0x33, 0x9f, 0x42, 0xf3, 0x1d, 0x5d, 0x15, 0x6d, 0x76, 0x33, 0x36, 0xaf, 0xe9, 0xdd, 0xfa, 0x63, 0x4f, 0x7a, 0x9c, 0xeb, 0x1c, 0x4f, 0x34, 0x65, 0x07, 0x54, 0xbb, 0x4c, 0x8b, 0x62, 0x9d, 0xd0, 0x06, 0x99, 0xb3, 0xe9, 0xda, 0x85, 0x19, 0xb0, 0x3d, 0x3c}, - subYX: fp.Elt{0xbb, 0x99, 0xf6, 0xbf, 0xaf, 0x2c, 0x22, 0x0d, 0x7a, 0xaa, 0x98, 0x6f, 0x01, 0x82, 0x99, 0xcf, 0x88, 0xbd, 0x0e, 0x3a, 0x89, 0xe0, 0x9c, 0x8c, 0x17, 0x20, 0xc4, 0xe0, 0xcf, 0x43, 0x7a, 0xef, 0x0d, 0x9f, 0x87, 0xd4, 0xfb, 0xf2, 0x96, 0xb8, 0x03, 0xe8, 0xcb, 0x5c, 0xec, 0x65, 0x5f, 0x49, 0xa4, 0x7c, 0x85, 0xb4, 0xf6, 0xc7, 0xdb, 0xa3}, - dt2: fp.Elt{0x11, 0xf3, 0x32, 0xa3, 0xa7, 0xb2, 0x7d, 0x51, 0x82, 0x44, 0xeb, 0xa2, 0x7d, 0x72, 0xcb, 0xc6, 0xf6, 0xc7, 0xb2, 0x38, 0x0e, 0x0f, 0x4f, 0x29, 0x00, 0xe4, 0x5b, 0x94, 0x46, 0x86, 0x66, 0xa1, 0x83, 0xb3, 0xeb, 0x15, 0xb6, 0x31, 0x50, 0x28, 0xeb, 0xed, 0x0d, 0x32, 0x39, 0xe9, 0x23, 0x81, 0x99, 0x3e, 0xff, 0x17, 0x4c, 0x11, 0x43, 0xd1}, - }, - { /* 25P*/ - addYX: fp.Elt{0xce, 0xe7, 0xf8, 0x94, 0x8f, 0x96, 0xf8, 0x96, 0xe6, 0x72, 0x20, 0x44, 0x2c, 0xa7, 0xfc, 0xba, 0xc8, 0xe1, 0xbb, 0xc9, 0x16, 0x85, 0xcd, 0x0b, 0xe5, 0xb5, 0x5a, 0x7f, 0x51, 0x43, 0x63, 0x8b, 0x23, 0x8e, 0x1d, 0x31, 0xff, 0x46, 0x02, 0x66, 0xcc, 0x9e, 0x4d, 0xa2, 0xca, 0xe2, 0xc7, 0xfd, 0x22, 0xb1, 0xdb, 0xdf, 0x6f, 0xe6, 0xa5, 0x82}, - subYX: fp.Elt{0xd0, 0xf5, 0x65, 0x40, 0xec, 0x8e, 0x65, 0x42, 0x78, 0xc1, 0x65, 0xe4, 0x10, 0xc8, 0x0b, 0x1b, 0xdd, 0x96, 0x68, 0xce, 0xee, 0x45, 0x55, 0xd8, 0x6e, 0xd3, 0xe6, 0x77, 0x19, 0xae, 0xc2, 0x8d, 0x8d, 0x3e, 0x14, 0x3f, 0x6d, 0x00, 0x2f, 0x9b, 0xd1, 0x26, 0x60, 0x28, 0x0f, 0x3a, 0x47, 0xb3, 0xe6, 0x68, 0x28, 0x24, 0x25, 0xca, 0xc8, 0x06}, - dt2: fp.Elt{0x54, 0xbb, 0x60, 0x92, 0xdb, 0x8f, 0x0f, 0x38, 0xe0, 0xe6, 0xe4, 0xc9, 0xcc, 0x14, 0x62, 0x01, 0xc4, 0x2b, 0x0f, 0xcf, 0xed, 0x7d, 0x8e, 0xa4, 0xd9, 0x73, 0x0b, 0xba, 0x0c, 0xaf, 0x0c, 0xf9, 0xe2, 0xeb, 0x29, 0x2a, 0x53, 0xdf, 0x2c, 0x5a, 0xfa, 0x8f, 0xc1, 0x01, 0xd7, 0xb1, 0x45, 0x73, 0x92, 0x32, 0x83, 0x85, 0x12, 0x74, 0x89, 0x44}, - }, - { /* 27P*/ - addYX: fp.Elt{0x0b, 0x73, 0x3c, 0xc2, 0xb1, 0x2e, 0xe1, 0xa7, 0xf5, 0xc9, 0x7a, 0xfb, 0x3d, 0x2d, 0xac, 0x59, 0xdb, 0xfa, 0x36, 0x11, 0xd1, 0x13, 0x04, 0x51, 0x1d, 0xab, 0x9b, 0x6b, 0x93, 0xfe, 0xda, 0xb0, 0x8e, 0xb4, 0x79, 0x11, 0x21, 0x0f, 0x65, 0xb9, 0xbb, 0x79, 0x96, 0x2a, 0xfd, 0x30, 0xe0, 0xb4, 0x2d, 0x9a, 0x55, 0x25, 0x5d, 0xd4, 0xad, 0x2a}, - subYX: fp.Elt{0x9e, 0xc5, 0x04, 0xfe, 0xec, 0x3c, 0x64, 0x1c, 0xed, 0x95, 0xed, 0xae, 0xaf, 0x5c, 0x6e, 0x08, 0x9e, 0x02, 0x29, 0x59, 0x7e, 0x5f, 0xc4, 0x9a, 0xd5, 0x32, 0x72, 0x86, 0xe1, 0x4e, 0x3c, 0xce, 0x99, 0x69, 0x3b, 0xc4, 0xdd, 0x4d, 0xb7, 0xbb, 0xda, 0x3b, 0x1a, 0x99, 0xaa, 0x62, 0x15, 0xc1, 0xf0, 0xb6, 0x6c, 0xec, 0x56, 0xc1, 0xff, 0x0c}, - dt2: fp.Elt{0x2f, 0xf1, 0x3f, 0x7a, 0x2d, 0x56, 0x19, 0x7f, 0xea, 0xbe, 0x59, 0x2e, 0x13, 0x67, 0x81, 0xfb, 0xdb, 0xc8, 0xa3, 0x1d, 0xd5, 0xe9, 0x13, 0x8b, 0x29, 0xdf, 0xcf, 0x9f, 0xe7, 0xd9, 0x0b, 0x70, 0xd3, 0x15, 0x57, 0x4a, 0xe9, 0x50, 0x12, 0x1b, 0x81, 0x4b, 0x98, 0x98, 0xa8, 0x31, 0x1d, 0x27, 0x47, 0x38, 0xed, 0x57, 0x99, 0x26, 0xb2, 0xee}, - }, - { /* 29P*/ - addYX: fp.Elt{0x1c, 0xb2, 0xb2, 0x67, 0x3b, 0x8b, 0x3d, 0x5a, 0x30, 0x7e, 0x38, 0x7e, 0x3c, 0x3d, 0x28, 0x56, 0x59, 0xd8, 0x87, 0x53, 0x8b, 0xe6, 0x6c, 0x5d, 0xe5, 0x0a, 0x33, 0x10, 0xce, 0xa2, 0x17, 0x0d, 0xe8, 0x76, 0xee, 0x68, 0xa8, 0x72, 0x54, 0xbd, 0xa6, 0x24, 0x94, 0x6e, 0x77, 0xc7, 0x53, 0xb7, 0x89, 0x1c, 0x7a, 0xe9, 0x78, 0x9a, 0x74, 0x5f}, - subYX: fp.Elt{0x76, 0x96, 0x1c, 0xcf, 0x08, 0x55, 0xd8, 0x1e, 0x0d, 0xa3, 0x59, 0x95, 0x32, 0xf4, 0xc2, 0x8e, 0x84, 0x5e, 0x4b, 0x04, 0xda, 0x71, 0xc9, 0x78, 0x52, 0xde, 0x14, 0xb4, 0x31, 0xf4, 0xd4, 0xb8, 0x58, 0xc5, 0x20, 0xe8, 0xdd, 0x15, 0xb5, 0xee, 0xea, 0x61, 0xe0, 0xf5, 0xd6, 0xae, 0x55, 0x59, 0x05, 0x3e, 0xaf, 0x74, 0xac, 0x1f, 0x17, 0x82}, - dt2: fp.Elt{0x59, 0x24, 0xcd, 0xfc, 0x11, 0x7e, 0x85, 0x18, 0x3d, 0x69, 0xf7, 0x71, 0x31, 0x66, 0x98, 0x42, 0x95, 0x00, 0x8c, 0xb2, 0xae, 0x39, 0x7e, 0x85, 0xd6, 0xb0, 0x02, 0xec, 0xce, 0xfc, 0x25, 0xb2, 0xe3, 0x99, 0x8e, 0x5b, 0x61, 0x96, 0x2e, 0x6d, 0x96, 0x57, 0x71, 0xa5, 0x93, 0x41, 0x0e, 0x6f, 0xfd, 0x0a, 0xbf, 0xa9, 0xf7, 0x56, 0xa9, 0x3e}, - }, - { /* 31P*/ - addYX: fp.Elt{0xa2, 0x2e, 0x0c, 0x17, 0x4d, 0xcc, 0x85, 0x2c, 0x18, 0xa0, 0xd2, 0x08, 0xba, 0x11, 0xfa, 0x47, 0x71, 0x86, 0xaf, 0x36, 0x6a, 0xd7, 0xfe, 0xb9, 0xb0, 0x2f, 0x89, 0x98, 0x49, 0x69, 0xf8, 0x6a, 0xad, 0x27, 0x5e, 0x0a, 0x22, 0x60, 0x5e, 0x5d, 0xca, 0x06, 0x51, 0x27, 0x99, 0x29, 0x85, 0x68, 0x98, 0xe1, 0xc4, 0x21, 0x50, 0xa0, 0xe9, 0xc1}, - subYX: fp.Elt{0x4d, 0x70, 0xee, 0x91, 0x92, 0x3f, 0xb7, 0xd3, 0x1d, 0xdb, 0x8d, 0x6e, 0x16, 0xf5, 0x65, 0x7d, 0x5f, 0xb5, 0x6c, 0x59, 0x26, 0x70, 0x4b, 0xf2, 0xfc, 0xe7, 0xdf, 0x86, 0xfe, 0xa5, 0xa7, 0xa6, 0x5d, 0xfb, 0x06, 0xe9, 0xf9, 0xcc, 0xc0, 0x37, 0xcc, 0xd8, 0x09, 0x04, 0xd2, 0xa5, 0x1d, 0xd7, 0xb7, 0xce, 0x92, 0xac, 0x3c, 0xad, 0xfb, 0xae}, - dt2: fp.Elt{0x17, 0xa3, 0x9a, 0xc7, 0x86, 0x2a, 0x51, 0xf7, 0x96, 0x79, 0x49, 0x22, 0x2e, 0x5a, 0x01, 0x5c, 0xb5, 0x95, 0xd4, 0xe8, 0xcb, 0x00, 0xca, 0x2d, 0x55, 0xb6, 0x34, 0x36, 0x0b, 0x65, 0x46, 0xf0, 0x49, 0xfc, 0x87, 0x86, 0xe5, 0xc3, 0x15, 0xdb, 0x32, 0xcd, 0xf2, 0xd3, 0x82, 0x4c, 0xe6, 0x61, 0x8a, 0xaf, 0xd4, 0x9e, 0x0f, 0x5a, 0xf2, 0x81}, - }, - { /* 33P*/ - addYX: fp.Elt{0x88, 0x10, 0xc0, 0xcb, 0xf5, 0x77, 0xae, 0xa5, 0xbe, 0xf6, 0xcd, 0x2e, 0x8b, 0x7e, 0xbd, 0x79, 0x62, 0x4a, 0xeb, 0x69, 0xc3, 0x28, 0xaa, 0x72, 0x87, 0xa9, 0x25, 0x87, 0x46, 0xea, 0x0e, 0x62, 0xa3, 0x6a, 0x1a, 0xe2, 0xba, 0xdc, 0x81, 0x10, 0x33, 0x01, 0xf6, 0x16, 0x89, 0x80, 0xc6, 0xcd, 0xdb, 0xdc, 0xba, 0x0e, 0x09, 0x4a, 0x35, 0x4a}, - subYX: fp.Elt{0x86, 0xb2, 0x2b, 0xd0, 0xb8, 0x4a, 0x6d, 0x66, 0x7b, 0x32, 0xdf, 0x3b, 0x1a, 0x19, 0x1f, 0x63, 0xee, 0x1f, 0x3d, 0x1c, 0x5c, 0x14, 0x60, 0x5b, 0x72, 0x49, 0x07, 0xb1, 0x0d, 0x72, 0xc6, 0x35, 0xf0, 0xbc, 0x5e, 0xda, 0x80, 0x6b, 0x64, 0x5b, 0xe5, 0x34, 0x54, 0x39, 0xdd, 0xe6, 0x3c, 0xcb, 0xe5, 0x29, 0x32, 0x06, 0xc6, 0xb1, 0x96, 0x34}, - dt2: fp.Elt{0x85, 0x86, 0xf5, 0x84, 0x86, 0xe6, 0x77, 0x8a, 0x71, 0x85, 0x0c, 0x4f, 0x81, 0x5b, 0x29, 0x06, 0xb5, 0x2e, 0x26, 0x71, 0x07, 0x78, 0x07, 0xae, 0xbc, 0x95, 0x46, 0xc3, 0x65, 0xac, 0xe3, 0x76, 0x51, 0x7d, 0xd4, 0x85, 0x31, 0xe3, 0x43, 0xf3, 0x1b, 0x7c, 0xf7, 0x6b, 0x2c, 0xf8, 0x1c, 0xbb, 0x8d, 0xca, 0xab, 0x4b, 0xba, 0x7f, 0xa4, 0xe2}, - }, - { /* 35P*/ - addYX: fp.Elt{0x1a, 0xee, 0xe7, 0xa4, 0x8a, 0x9d, 0x53, 0x80, 0xc6, 0xb8, 0x4e, 0xdc, 0x89, 0xe0, 0xc4, 0x2b, 0x60, 0x52, 0x6f, 0xec, 0x81, 0xd2, 0x55, 0x6b, 0x1b, 0x6f, 0x17, 0x67, 0x8e, 0x42, 0x26, 0x4c, 0x65, 0x23, 0x29, 0xc6, 0x7b, 0xcd, 0x9f, 0xad, 0x4b, 0x42, 0xd3, 0x0c, 0x75, 0xc3, 0x8a, 0xf5, 0xbe, 0x9e, 0x55, 0xf7, 0x47, 0x5d, 0xbd, 0x3a}, - subYX: fp.Elt{0x0d, 0xa8, 0x3b, 0xf9, 0xc7, 0x7e, 0xc6, 0x86, 0x94, 0xc0, 0x01, 0xff, 0x27, 0xce, 0x43, 0xac, 0xe5, 0xe1, 0xd2, 0x8d, 0xc1, 0x22, 0x31, 0xbe, 0xe1, 0xaf, 0xf9, 0x4a, 0x78, 0xa1, 0x0c, 0xaa, 0xd4, 0x80, 0xe4, 0x09, 0x8d, 0xfb, 0x1d, 0x52, 0xc8, 0x60, 0x2d, 0xf2, 0xa2, 0x89, 0x02, 0x56, 0x3d, 0x56, 0x27, 0x85, 0xc7, 0xf0, 0x2b, 0x9a}, - dt2: fp.Elt{0x62, 0x7c, 0xc7, 0x6b, 0x2c, 0x9d, 0x0a, 0x7c, 0xe5, 0x50, 0x3c, 0xe6, 0x87, 0x1c, 0x82, 0x30, 0x67, 0x3c, 0x39, 0xb6, 0xa0, 0x31, 0xfb, 0x03, 0x7b, 0xa1, 0x58, 0xdf, 0x12, 0x76, 0x5d, 0x5d, 0x0a, 0x8f, 0x9b, 0x37, 0x32, 0xc3, 0x60, 0x33, 0xea, 0x9f, 0x0a, 0x99, 0xfa, 0x20, 0xd0, 0x33, 0x21, 0xc3, 0x94, 0xd4, 0x86, 0x49, 0x7c, 0x4e}, - }, - { /* 37P*/ - addYX: fp.Elt{0xc7, 0x0c, 0x71, 0xfe, 0x55, 0xd1, 0x95, 0x8f, 0x43, 0xbb, 0x6b, 0x74, 0x30, 0xbd, 0xe8, 0x6f, 0x1c, 0x1b, 0x06, 0x62, 0xf5, 0xfc, 0x65, 0xa0, 0xeb, 0x81, 0x12, 0xc9, 0x64, 0x66, 0x61, 0xde, 0xf3, 0x6d, 0xd4, 0xae, 0x8e, 0xb1, 0x72, 0xe0, 0xcd, 0x37, 0x01, 0x28, 0x52, 0xd7, 0x39, 0x46, 0x0c, 0x55, 0xcf, 0x47, 0x70, 0xef, 0xa1, 0x17}, - subYX: fp.Elt{0x8d, 0x58, 0xde, 0x83, 0x88, 0x16, 0x0e, 0x12, 0x42, 0x03, 0x50, 0x60, 0x4b, 0xdf, 0xbf, 0x95, 0xcc, 0x7d, 0x18, 0x17, 0x7e, 0x31, 0x5d, 0x8a, 0x66, 0xc1, 0xcf, 0x14, 0xea, 0xf4, 0xf4, 0xe5, 0x63, 0x2d, 0x32, 0x86, 0x9b, 0xed, 0x1f, 0x4f, 0x03, 0xaf, 0x33, 0x92, 0xcb, 0xaf, 0x9c, 0x05, 0x0d, 0x47, 0x1b, 0x42, 0xba, 0x13, 0x22, 0x98}, - dt2: fp.Elt{0xb5, 0x48, 0xeb, 0x7d, 0x3d, 0x10, 0x9f, 0x59, 0xde, 0xf8, 0x1c, 0x4f, 0x7d, 0x9d, 0x40, 0x4d, 0x9e, 0x13, 0x24, 0xb5, 0x21, 0x09, 0xb7, 0xee, 0x98, 0x5c, 0x56, 0xbc, 0x5e, 0x2b, 0x78, 0x38, 0x06, 0xac, 0xe3, 0xe0, 0xfa, 0x2e, 0xde, 0x4f, 0xd2, 0xb3, 0xfb, 0x2d, 0x71, 0x84, 0xd1, 0x9d, 0x12, 0x5b, 0x35, 0xc8, 0x03, 0x68, 0x67, 0xc7}, - }, - { /* 39P*/ - addYX: fp.Elt{0xb6, 0x65, 0xfb, 0xa7, 0x06, 0x35, 0xbb, 0xe0, 0x31, 0x8d, 0x91, 0x40, 0x98, 0xab, 0x30, 0xe4, 0xca, 0x12, 0x59, 0x89, 0xed, 0x65, 0x5d, 0x7f, 0xae, 0x69, 0xa0, 0xa4, 0xfa, 0x78, 0xb4, 0xf7, 0xed, 0xae, 0x86, 0x78, 0x79, 0x64, 0x24, 0xa6, 0xd4, 0xe1, 0xf6, 0xd3, 0xa0, 0x89, 0xba, 0x20, 0xf4, 0x54, 0x0d, 0x8f, 0xdb, 0x1a, 0x79, 0xdb}, - subYX: fp.Elt{0xe1, 0x82, 0x0c, 0x4d, 0xde, 0x9f, 0x40, 0xf0, 0xc1, 0xbd, 0x8b, 0xd3, 0x24, 0x03, 0xcd, 0xf2, 0x92, 0x7d, 0xe2, 0x68, 0x7f, 0xf1, 0xbe, 0x69, 0xde, 0x34, 0x67, 0x4c, 0x85, 0x3b, 0xec, 0x98, 0xcc, 0x4d, 0x3e, 0xc0, 0x96, 0x27, 0xe6, 0x75, 0xfc, 0xdf, 0x37, 0xc0, 0x1e, 0x27, 0xe0, 0xf6, 0xc2, 0xbd, 0xbc, 0x3d, 0x9b, 0x39, 0xdc, 0xe2}, - dt2: fp.Elt{0xd8, 0x29, 0xa7, 0x39, 0xe3, 0x9f, 0x2f, 0x0e, 0x4b, 0x24, 0x21, 0x70, 0xef, 0xfd, 0x91, 0xea, 0xbf, 0xe1, 0x72, 0x90, 0xcc, 0xc9, 0x84, 0x0e, 0xad, 0xd5, 0xe6, 0xbb, 0xc5, 0x99, 0x7f, 0xa4, 0xf0, 0x2e, 0xcc, 0x95, 0x64, 0x27, 0x19, 0xd8, 0x4c, 0x27, 0x0d, 0xff, 0xb6, 0x29, 0xe2, 0x6c, 0xfa, 0xbb, 0x4d, 0x9c, 0xbb, 0xaf, 0xa5, 0xec}, - }, - { /* 41P*/ - addYX: fp.Elt{0xd6, 0x33, 0x3f, 0x9f, 0xcf, 0xfd, 0x4c, 0xd1, 0xfe, 0xe5, 0xeb, 0x64, 0x27, 0xae, 0x7a, 0xa2, 0x82, 0x50, 0x6d, 0xaa, 0xe3, 0x5d, 0xe2, 0x48, 0x60, 0xb3, 0x76, 0x04, 0xd9, 0x19, 0xa7, 0xa1, 0x73, 0x8d, 0x38, 0xa9, 0xaf, 0x45, 0xb5, 0xb2, 0x62, 0x9b, 0xf1, 0x35, 0x7b, 0x84, 0x66, 0xeb, 0x06, 0xef, 0xf1, 0xb2, 0x2d, 0x6a, 0x61, 0x15}, - subYX: fp.Elt{0x86, 0x50, 0x42, 0xf7, 0xda, 0x59, 0xb2, 0xcf, 0x0d, 0x3d, 0xee, 0x8e, 0x53, 0x5d, 0xf7, 0x9e, 0x6a, 0x26, 0x2d, 0xc7, 0x8c, 0x8e, 0x18, 0x50, 0x6d, 0xb7, 0x51, 0x4c, 0xa7, 0x52, 0x6e, 0x0e, 0x0a, 0x16, 0x74, 0xb2, 0x81, 0x8b, 0x56, 0x27, 0x22, 0x84, 0xf4, 0x56, 0xc5, 0x06, 0xe1, 0x8b, 0xca, 0x2d, 0xdb, 0x9a, 0xf6, 0x10, 0x9c, 0x51}, - dt2: fp.Elt{0x1f, 0x16, 0xa2, 0x78, 0x96, 0x1b, 0x85, 0x9c, 0x76, 0x49, 0xd4, 0x0f, 0xac, 0xb0, 0xf4, 0xd0, 0x06, 0x2c, 0x7e, 0x6d, 0x6e, 0x8e, 0xc7, 0x9f, 0x18, 0xad, 0xfc, 0x88, 0x0c, 0x0c, 0x09, 0x05, 0x05, 0xa0, 0x79, 0x72, 0x32, 0x72, 0x87, 0x0f, 0x49, 0x87, 0x0c, 0xb4, 0x12, 0xc2, 0x09, 0xf8, 0x9f, 0x30, 0x72, 0xa9, 0x47, 0x13, 0x93, 0x49}, - }, - { /* 43P*/ - addYX: fp.Elt{0xcc, 0xb1, 0x4c, 0xd3, 0xc0, 0x9e, 0x9e, 0x4d, 0x6d, 0x28, 0x0b, 0xa5, 0x94, 0xa7, 0x2e, 0xc2, 0xc7, 0xaf, 0x29, 0x73, 0xc9, 0x68, 0xea, 0x0f, 0x34, 0x37, 0x8d, 0x96, 0x8f, 0x3a, 0x3d, 0x73, 0x1e, 0x6d, 0x9f, 0xcf, 0x8d, 0x83, 0xb5, 0x71, 0xb9, 0xe1, 0x4b, 0x67, 0x71, 0xea, 0xcf, 0x56, 0xe5, 0xeb, 0x72, 0x15, 0x2f, 0x9e, 0xa8, 0xaa}, - subYX: fp.Elt{0xf4, 0x3e, 0x85, 0x1c, 0x1a, 0xef, 0x50, 0xd1, 0xb4, 0x20, 0xb2, 0x60, 0x05, 0x98, 0xfe, 0x47, 0x3b, 0xc1, 0x76, 0xca, 0x2c, 0x4e, 0x5a, 0x42, 0xa3, 0xf7, 0x20, 0xaa, 0x57, 0x39, 0xee, 0x34, 0x1f, 0xe1, 0x68, 0xd3, 0x7e, 0x06, 0xc4, 0x6c, 0xc7, 0x76, 0x2b, 0xe4, 0x1c, 0x48, 0x44, 0xe6, 0xe5, 0x44, 0x24, 0x8d, 0xb3, 0xb6, 0x88, 0x32}, - dt2: fp.Elt{0x18, 0xa7, 0xba, 0xd0, 0x44, 0x6f, 0x33, 0x31, 0x00, 0xf8, 0xf6, 0x12, 0xe3, 0xc5, 0xc7, 0xb5, 0x91, 0x9c, 0x91, 0xb5, 0x75, 0x18, 0x18, 0x8a, 0xab, 0xed, 0x24, 0x11, 0x2e, 0xce, 0x5a, 0x0f, 0x94, 0x5f, 0x2e, 0xca, 0xd3, 0x80, 0xea, 0xe5, 0x34, 0x96, 0x67, 0x8b, 0x6a, 0x26, 0x5e, 0xc8, 0x9d, 0x2c, 0x5e, 0x6c, 0xa2, 0x0c, 0xbf, 0xf0}, - }, - { /* 45P*/ - addYX: fp.Elt{0xb3, 0xbf, 0xa3, 0x85, 0xee, 0xf6, 0x58, 0x02, 0x78, 0xc4, 0x30, 0xd6, 0x57, 0x59, 0x8c, 0x88, 0x08, 0x7c, 0xbc, 0xbe, 0x0a, 0x74, 0xa9, 0xde, 0x69, 0xe7, 0x41, 0xd8, 0xbf, 0x66, 0x8d, 0x3d, 0x28, 0x00, 0x8c, 0x47, 0x65, 0x34, 0xfe, 0x86, 0x9e, 0x6a, 0xf2, 0x41, 0x6a, 0x94, 0xc4, 0x88, 0x75, 0x23, 0x0d, 0x52, 0x69, 0xee, 0x07, 0x89}, - subYX: fp.Elt{0x22, 0x3c, 0xa1, 0x70, 0x58, 0x97, 0x93, 0xbe, 0x59, 0xa8, 0x0b, 0x8a, 0x46, 0x2a, 0x38, 0x1e, 0x08, 0x6b, 0x61, 0x9f, 0xf2, 0x4a, 0x8b, 0x80, 0x68, 0x6e, 0xc8, 0x92, 0x60, 0xf3, 0xc9, 0x89, 0xb2, 0x6d, 0x63, 0xb0, 0xeb, 0x83, 0x15, 0x63, 0x0e, 0x64, 0xbb, 0xb8, 0xfe, 0xb4, 0x81, 0x90, 0x01, 0x28, 0x10, 0xb9, 0x74, 0x6e, 0xde, 0xa4}, - dt2: fp.Elt{0x1a, 0x23, 0x45, 0xa8, 0x6f, 0x4e, 0xa7, 0x4a, 0x0c, 0xeb, 0xb0, 0x43, 0xf9, 0xef, 0x99, 0x60, 0x5b, 0xdb, 0x66, 0xc0, 0x86, 0x71, 0x43, 0xb1, 0x22, 0x7b, 0x1c, 0xe7, 0x8d, 0x09, 0x1d, 0x83, 0x76, 0x9c, 0xd3, 0x5a, 0xdd, 0x42, 0xd9, 0x2f, 0x2d, 0xba, 0x7a, 0xc2, 0xd9, 0x6b, 0xd4, 0x7a, 0xf1, 0xd5, 0x5f, 0x6b, 0x85, 0xbf, 0x0b, 0xf1}, - }, - { /* 47P*/ - addYX: fp.Elt{0xb2, 0x83, 0xfa, 0x1f, 0xd2, 0xce, 0xb6, 0xf2, 0x2d, 0xea, 0x1b, 0xe5, 0x29, 0xa5, 0x72, 0xf9, 0x25, 0x48, 0x4e, 0xf2, 0x50, 0x1b, 0x39, 0xda, 0x34, 0xc5, 0x16, 0x13, 0xb4, 0x0c, 0xa1, 0x00, 0x79, 0x7a, 0xf5, 0x8b, 0xf3, 0x70, 0x14, 0xb6, 0xfc, 0x9a, 0x47, 0x68, 0x1e, 0x42, 0x70, 0x64, 0x2a, 0x84, 0x3e, 0x3d, 0x20, 0x58, 0xf9, 0x6a}, - subYX: fp.Elt{0xd9, 0xee, 0xc0, 0xc4, 0xf5, 0xc2, 0x86, 0xaf, 0x45, 0xd2, 0xd2, 0x87, 0x1b, 0x64, 0xd5, 0xe0, 0x8c, 0x44, 0x00, 0x4f, 0x43, 0x89, 0x04, 0x48, 0x4a, 0x0b, 0xca, 0x94, 0x06, 0x2f, 0x23, 0x5b, 0x6c, 0x8d, 0x44, 0x66, 0x53, 0xf5, 0x5a, 0x20, 0x72, 0x28, 0x58, 0x84, 0xcc, 0x73, 0x22, 0x5e, 0xd1, 0x0b, 0x56, 0x5e, 0x6a, 0xa3, 0x11, 0x91}, - dt2: fp.Elt{0x6e, 0x9f, 0x88, 0xa8, 0x68, 0x2f, 0x12, 0x37, 0x88, 0xfc, 0x92, 0x8f, 0x24, 0xeb, 0x5b, 0x2a, 0x2a, 0xd0, 0x14, 0x40, 0x4c, 0xa9, 0xa4, 0x03, 0x0c, 0x45, 0x48, 0x13, 0xe8, 0xa6, 0x37, 0xab, 0xc0, 0x06, 0x38, 0x6c, 0x96, 0x73, 0x40, 0x6c, 0xc6, 0xea, 0x56, 0xc6, 0xe9, 0x1a, 0x69, 0xeb, 0x7a, 0xd1, 0x33, 0x69, 0x58, 0x2b, 0xea, 0x2f}, - }, - { /* 49P*/ - addYX: fp.Elt{0x58, 0xa8, 0x05, 0x41, 0x00, 0x9d, 0xaa, 0xd9, 0x98, 0xcf, 0xb9, 0x41, 0xb5, 0x4a, 0x8d, 0xe2, 0xe7, 0xc0, 0x72, 0xef, 0xc8, 0x28, 0x6b, 0x68, 0x9d, 0xc9, 0xdf, 0x05, 0x8b, 0xd0, 0x04, 0x74, 0x79, 0x45, 0x52, 0x05, 0xa3, 0x6e, 0x35, 0x3a, 0xe3, 0xef, 0xb2, 0xdc, 0x08, 0x6f, 0x4e, 0x76, 0x85, 0x67, 0xba, 0x23, 0x8f, 0xdd, 0xaf, 0x09}, - subYX: fp.Elt{0xb4, 0x38, 0xc8, 0xff, 0x4f, 0x65, 0x2a, 0x7e, 0xad, 0xb1, 0xc6, 0xb9, 0x3d, 0xd6, 0xf7, 0x14, 0xcf, 0xf6, 0x98, 0x75, 0xbb, 0x47, 0x83, 0x90, 0xe7, 0xe1, 0xf6, 0x14, 0x99, 0x7e, 0xfa, 0xe4, 0x77, 0x24, 0xe3, 0xe7, 0xf0, 0x1e, 0xdb, 0x27, 0x4e, 0x16, 0x04, 0xf2, 0x08, 0x52, 0xfc, 0xec, 0x55, 0xdb, 0x2e, 0x67, 0xe1, 0x94, 0x32, 0x89}, - dt2: fp.Elt{0x00, 0xad, 0x03, 0x35, 0x1a, 0xb1, 0x88, 0xf0, 0xc9, 0x11, 0xe4, 0x12, 0x52, 0x61, 0xfd, 0x8a, 0x1b, 0x6a, 0x0a, 0x4c, 0x42, 0x46, 0x22, 0x0e, 0xa5, 0xf9, 0xe2, 0x50, 0xf2, 0xb2, 0x1f, 0x20, 0x78, 0x10, 0xf6, 0xbf, 0x7f, 0x0c, 0x9c, 0xad, 0x40, 0x8b, 0x82, 0xd4, 0xba, 0x69, 0x09, 0xac, 0x4b, 0x6d, 0xc4, 0x49, 0x17, 0x81, 0x57, 0x3b}, - }, - { /* 51P*/ - addYX: fp.Elt{0x0d, 0xfe, 0xb4, 0x35, 0x11, 0xbd, 0x1d, 0x6b, 0xc2, 0xc5, 0x3b, 0xd2, 0x23, 0x2c, 0x72, 0xe3, 0x48, 0xb1, 0x48, 0x73, 0xfb, 0xa3, 0x21, 0x6e, 0xc0, 0x09, 0x69, 0xac, 0xe1, 0x60, 0xbc, 0x24, 0x03, 0x99, 0x63, 0x0a, 0x00, 0xf0, 0x75, 0xf6, 0x92, 0xc5, 0xd6, 0xdb, 0x51, 0xd4, 0x7d, 0xe6, 0xf4, 0x11, 0x79, 0xd7, 0xc3, 0xaf, 0x48, 0xd0}, - subYX: fp.Elt{0xf4, 0x4f, 0xaf, 0x31, 0xe3, 0x10, 0x89, 0x95, 0xf0, 0x8a, 0xf6, 0x31, 0x9f, 0x48, 0x02, 0xba, 0x42, 0x2b, 0x3c, 0x22, 0x8b, 0xcc, 0x12, 0x98, 0x6e, 0x7a, 0x64, 0x3a, 0xc4, 0xca, 0x32, 0x2a, 0x72, 0xf8, 0x2c, 0xcf, 0x78, 0x5e, 0x7a, 0x75, 0x6e, 0x72, 0x46, 0x48, 0x62, 0x28, 0xac, 0x58, 0x1a, 0xc6, 0x59, 0x88, 0x2a, 0x44, 0x9e, 0x83}, - dt2: fp.Elt{0xb3, 0xde, 0x36, 0xfd, 0xeb, 0x1b, 0xd4, 0x24, 0x1b, 0x08, 0x8c, 0xfe, 0xa9, 0x41, 0xa1, 0x64, 0xf2, 0x6d, 0xdb, 0xf9, 0x94, 0xae, 0x86, 0x71, 0xab, 0x10, 0xbf, 0xa3, 0xb2, 0xa0, 0xdf, 0x10, 0x8c, 0x74, 0xce, 0xb3, 0xfc, 0xdb, 0xba, 0x15, 0xf6, 0x91, 0x7a, 0x9c, 0x36, 0x1e, 0x45, 0x07, 0x3c, 0xec, 0x1a, 0x61, 0x26, 0x93, 0xe3, 0x50}, - }, - { /* 53P*/ - addYX: fp.Elt{0xc5, 0x50, 0xc5, 0x83, 0xb0, 0xbd, 0xd9, 0xf6, 0x6d, 0x15, 0x5e, 0xc1, 0x1a, 0x33, 0xa0, 0xce, 0x13, 0x70, 0x3b, 0xe1, 0x31, 0xc6, 0xc4, 0x02, 0xec, 0x8c, 0xd5, 0x9c, 0x97, 0xd3, 0x12, 0xc4, 0xa2, 0xf9, 0xd5, 0xfb, 0x22, 0x69, 0x94, 0x09, 0x2f, 0x59, 0xce, 0xdb, 0xf2, 0xf2, 0x00, 0xe0, 0xa9, 0x08, 0x44, 0x2e, 0x8b, 0x6b, 0xf5, 0xb3}, - subYX: fp.Elt{0x90, 0xdd, 0xec, 0xa2, 0x65, 0xb7, 0x61, 0xbc, 0xaa, 0x70, 0xa2, 0x15, 0xd8, 0xb0, 0xf8, 0x8e, 0x23, 0x3d, 0x9f, 0x46, 0xa3, 0x29, 0x20, 0xd1, 0xa1, 0x15, 0x81, 0xc6, 0xb6, 0xde, 0xbe, 0x60, 0x63, 0x24, 0xac, 0x15, 0xfb, 0xeb, 0xd3, 0xea, 0x57, 0x13, 0x86, 0x38, 0x1e, 0x22, 0xf4, 0x8c, 0x5d, 0xaf, 0x1b, 0x27, 0x21, 0x4f, 0xa3, 0x63}, - dt2: fp.Elt{0x07, 0x15, 0x87, 0xc4, 0xfd, 0xa1, 0x97, 0x7a, 0x07, 0x1f, 0x56, 0xcc, 0xe3, 0x6a, 0x01, 0x90, 0xce, 0xf9, 0xfa, 0x50, 0xb2, 0xe0, 0x87, 0x8b, 0x6c, 0x63, 0x6c, 0xf6, 0x2a, 0x09, 0xef, 0xef, 0xd2, 0x31, 0x40, 0x25, 0xf6, 0x84, 0xcb, 0xe0, 0xc4, 0x23, 0xc1, 0xcb, 0xe2, 0x02, 0x83, 0x2d, 0xed, 0x74, 0x74, 0x8b, 0xf8, 0x7c, 0x81, 0x18}, - }, - { /* 55P*/ - addYX: fp.Elt{0x9e, 0xe5, 0x59, 0x95, 0x63, 0x2e, 0xac, 0x8b, 0x03, 0x3c, 0xc1, 0x8e, 0xe1, 0x5b, 0x56, 0x3c, 0x16, 0x41, 0xe4, 0xc2, 0x60, 0x0c, 0x6d, 0x65, 0x9f, 0xfc, 0x27, 0x68, 0x43, 0x44, 0x05, 0x12, 0x6c, 0xda, 0x04, 0xef, 0xcf, 0xcf, 0xdc, 0x0a, 0x1a, 0x7f, 0x12, 0xd3, 0xeb, 0x02, 0xb6, 0x04, 0xca, 0xd6, 0xcb, 0xf0, 0x22, 0xba, 0x35, 0x6d}, - subYX: fp.Elt{0x09, 0x6d, 0xf9, 0x64, 0x4c, 0xe6, 0x41, 0xff, 0x01, 0x4d, 0xce, 0x1e, 0xfa, 0x38, 0xa2, 0x25, 0x62, 0xff, 0x03, 0x39, 0x18, 0x91, 0xbb, 0x9d, 0xce, 0x02, 0xf0, 0xf1, 0x3c, 0x55, 0x18, 0xa9, 0xab, 0x4d, 0xd2, 0x35, 0xfd, 0x8d, 0xa9, 0xb2, 0xad, 0xb7, 0x06, 0x6e, 0xc6, 0x69, 0x49, 0xd6, 0x98, 0x98, 0x0b, 0x22, 0x81, 0x6b, 0xbd, 0xa0}, - dt2: fp.Elt{0x22, 0xf4, 0x85, 0x5d, 0x2b, 0xf1, 0x55, 0xa5, 0xd6, 0x27, 0x86, 0x57, 0x12, 0x1f, 0x16, 0x0a, 0x5a, 0x9b, 0xf2, 0x38, 0xb6, 0x28, 0xd8, 0x99, 0x0c, 0x89, 0x1d, 0x7f, 0xca, 0x21, 0x17, 0x1a, 0x0b, 0x02, 0x5f, 0x77, 0x2f, 0x73, 0x30, 0x7c, 0xc8, 0xd7, 0x2b, 0xcc, 0xe7, 0xf3, 0x21, 0xac, 0x53, 0xa7, 0x11, 0x5d, 0xd8, 0x1d, 0x9b, 0xf5}, - }, - { /* 57P*/ - addYX: fp.Elt{0x94, 0x63, 0x5d, 0xef, 0xfd, 0x6d, 0x25, 0x4e, 0x6d, 0x29, 0x03, 0xed, 0x24, 0x28, 0x27, 0x57, 0x47, 0x3e, 0x6a, 0x1a, 0xfe, 0x37, 0xee, 0x5f, 0x83, 0x29, 0x14, 0xfd, 0x78, 0x25, 0x8a, 0xe1, 0x02, 0x38, 0xd8, 0xca, 0x65, 0x55, 0x40, 0x7d, 0x48, 0x2c, 0x7c, 0x7e, 0x60, 0xb6, 0x0c, 0x6d, 0xf7, 0xe8, 0xb3, 0x62, 0x53, 0xd6, 0x9c, 0x2b}, - subYX: fp.Elt{0x47, 0x25, 0x70, 0x62, 0xf5, 0x65, 0x93, 0x62, 0x08, 0xac, 0x59, 0x66, 0xdb, 0x08, 0xd9, 0x1a, 0x19, 0xaf, 0xf4, 0xef, 0x02, 0xa2, 0x78, 0xa9, 0x55, 0x1c, 0xfa, 0x08, 0x11, 0xcb, 0xa3, 0x71, 0x74, 0xb1, 0x62, 0xe7, 0xc7, 0xf3, 0x5a, 0xb5, 0x8b, 0xd4, 0xf6, 0x10, 0x57, 0x79, 0x72, 0x2f, 0x13, 0x86, 0x7b, 0x44, 0x5f, 0x48, 0xfd, 0x88}, - dt2: fp.Elt{0x10, 0x02, 0xcd, 0x05, 0x9a, 0xc3, 0x32, 0x6d, 0x10, 0x3a, 0x74, 0xba, 0x06, 0xc4, 0x3b, 0x34, 0xbc, 0x36, 0xed, 0xa3, 0xba, 0x9a, 0xdb, 0x6d, 0xd4, 0x69, 0x99, 0x97, 0xd0, 0xe4, 0xdd, 0xf5, 0xd4, 0x7c, 0xd3, 0x4e, 0xab, 0xd1, 0x3b, 0xbb, 0xe9, 0xc7, 0x6a, 0x94, 0x25, 0x61, 0xf0, 0x06, 0xc5, 0x12, 0xa8, 0x86, 0xe5, 0x35, 0x46, 0xeb}, - }, - { /* 59P*/ - addYX: fp.Elt{0x9e, 0x95, 0x11, 0xc6, 0xc7, 0xe8, 0xee, 0x5a, 0x26, 0xa0, 0x72, 0x72, 0x59, 0x91, 0x59, 0x16, 0x49, 0x99, 0x7e, 0xbb, 0xd7, 0x15, 0xb4, 0xf2, 0x40, 0xf9, 0x5a, 0x4d, 0xc8, 0xa0, 0xe2, 0x34, 0x7b, 0x34, 0xf3, 0x99, 0xbf, 0xa9, 0xf3, 0x79, 0xc1, 0x1a, 0x0c, 0xf4, 0x86, 0x74, 0x4e, 0xcb, 0xbc, 0x90, 0xad, 0xb6, 0x51, 0x6d, 0xaa, 0x33}, - subYX: fp.Elt{0x9f, 0xd1, 0xc5, 0xa2, 0x6c, 0x24, 0x88, 0x15, 0x71, 0x68, 0xf6, 0x07, 0x45, 0x02, 0xc4, 0x73, 0x7e, 0x75, 0x87, 0xca, 0x7c, 0xf0, 0x92, 0x00, 0x75, 0xd6, 0x5a, 0xdd, 0xe0, 0x64, 0x16, 0x9d, 0x62, 0x80, 0x33, 0x9f, 0xf4, 0x8e, 0x1a, 0x15, 0x1c, 0xd3, 0x0f, 0x4d, 0x4f, 0x62, 0x2d, 0xd7, 0xa5, 0x77, 0xe3, 0xea, 0xf0, 0xfb, 0x1a, 0xdb}, - dt2: fp.Elt{0x6a, 0xa2, 0xb1, 0xaa, 0xfb, 0x5a, 0x32, 0x4e, 0xff, 0x47, 0x06, 0xd5, 0x9a, 0x4f, 0xce, 0x83, 0x5b, 0x82, 0x34, 0x3e, 0x47, 0xb8, 0xf8, 0xe9, 0x7c, 0x67, 0x69, 0x8d, 0x9c, 0xb7, 0xde, 0x57, 0xf4, 0x88, 0x41, 0x56, 0x0c, 0x87, 0x1e, 0xc9, 0x2f, 0x54, 0xbf, 0x5c, 0x68, 0x2c, 0xd9, 0xc4, 0xef, 0x53, 0x73, 0x1e, 0xa6, 0x38, 0x02, 0x10}, - }, - { /* 61P*/ - addYX: fp.Elt{0x08, 0x80, 0x4a, 0xc9, 0xb7, 0xa8, 0x88, 0xd9, 0xfc, 0x6a, 0xc0, 0x3e, 0xc2, 0x33, 0x4d, 0x2b, 0x2a, 0xa3, 0x6d, 0x72, 0x3e, 0xdc, 0x34, 0x68, 0x08, 0xbf, 0x27, 0xef, 0xf4, 0xff, 0xe2, 0x0c, 0x31, 0x0c, 0xa2, 0x0a, 0x1f, 0x65, 0xc1, 0x4c, 0x61, 0xd3, 0x1b, 0xbc, 0x25, 0xb1, 0xd0, 0xd4, 0x89, 0xb2, 0x53, 0xfb, 0x43, 0xa5, 0xaf, 0x04}, - subYX: fp.Elt{0xe3, 0xe1, 0x37, 0xad, 0x58, 0xa9, 0x55, 0x81, 0xee, 0x64, 0x21, 0xb9, 0xf5, 0x4c, 0x35, 0xea, 0x4a, 0xd3, 0x26, 0xaa, 0x90, 0xd4, 0x60, 0x46, 0x09, 0x4b, 0x4a, 0x62, 0xf9, 0xcd, 0xe1, 0xee, 0xbb, 0xc2, 0x09, 0x0b, 0xb0, 0x96, 0x8e, 0x43, 0x77, 0xaf, 0x25, 0x20, 0x5e, 0x47, 0xe4, 0x1d, 0x50, 0x69, 0x74, 0x08, 0xd7, 0xb9, 0x90, 0x13}, - dt2: fp.Elt{0x51, 0x91, 0x95, 0x64, 0x03, 0x16, 0xfd, 0x6e, 0x26, 0x94, 0x6b, 0x61, 0xe7, 0xd9, 0xe0, 0x4a, 0x6d, 0x7c, 0xfa, 0xc0, 0xe2, 0x43, 0x23, 0x53, 0x70, 0xf5, 0x6f, 0x73, 0x8b, 0x81, 0xb0, 0x0c, 0xee, 0x2e, 0x46, 0xf2, 0x8d, 0xa6, 0xfb, 0xb5, 0x1c, 0x33, 0xbf, 0x90, 0x59, 0xc9, 0x7c, 0xb8, 0x6f, 0xad, 0x75, 0x02, 0x90, 0x8e, 0x59, 0x75}, - }, - { /* 63P*/ - addYX: fp.Elt{0x36, 0x4d, 0x77, 0x04, 0xb8, 0x7d, 0x4a, 0xd1, 0xc5, 0xbb, 0x7b, 0x50, 0x5f, 0x8d, 0x9d, 0x62, 0x0f, 0x66, 0x71, 0xec, 0x87, 0xc5, 0x80, 0x82, 0xc8, 0xf4, 0x6a, 0x94, 0x92, 0x5b, 0xb0, 0x16, 0x9b, 0xb2, 0xc9, 0x6f, 0x2b, 0x2d, 0xee, 0x95, 0x73, 0x2e, 0xc2, 0x1b, 0xc5, 0x55, 0x36, 0x86, 0x24, 0xf8, 0x20, 0x05, 0x0d, 0x93, 0xd7, 0x76}, - subYX: fp.Elt{0x7f, 0x01, 0xeb, 0x2e, 0x48, 0x4d, 0x1d, 0xf1, 0x06, 0x7e, 0x7c, 0x2a, 0x43, 0xbf, 0x28, 0xac, 0xe9, 0x58, 0x13, 0xc8, 0xbf, 0x8e, 0xc0, 0xef, 0xe8, 0x4f, 0x46, 0x8a, 0xe7, 0xc0, 0xf6, 0x0f, 0x0a, 0x03, 0x48, 0x91, 0x55, 0x39, 0x2a, 0xe3, 0xdc, 0xf6, 0x22, 0x9d, 0x4d, 0x71, 0x55, 0x68, 0x25, 0x6e, 0x95, 0x52, 0xee, 0x4c, 0xd9, 0x01}, - dt2: fp.Elt{0xac, 0x33, 0x3f, 0x7c, 0x27, 0x35, 0x15, 0x91, 0x33, 0x8d, 0xf9, 0xc4, 0xf4, 0xf3, 0x90, 0x09, 0x75, 0x69, 0x62, 0x9f, 0x61, 0x35, 0x83, 0x92, 0x04, 0xef, 0x96, 0x38, 0x80, 0x9e, 0x88, 0xb3, 0x67, 0x95, 0xbe, 0x79, 0x3c, 0x35, 0xd8, 0xdc, 0xb2, 0x3e, 0x2d, 0xe6, 0x46, 0xbe, 0x81, 0xf3, 0x32, 0x0e, 0x37, 0x23, 0x75, 0x2a, 0x3d, 0xa0}, - }, -} diff --git a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go b/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go deleted file mode 100644 index f6ac5edbbb..0000000000 --- a/vendor/github.com/cloudflare/circl/ecc/goldilocks/twist_basemult.go +++ /dev/null @@ -1,62 +0,0 @@ -package goldilocks - -import ( - "crypto/subtle" - - mlsb "github.com/cloudflare/circl/math/mlsbset" -) - -const ( - // MLSBRecoding parameters - fxT = 448 - fxV = 2 - fxW = 3 - fx2w1 = 1 << (uint(fxW) - 1) -) - -// ScalarBaseMult returns kG where G is the generator point. -func (e twistCurve) ScalarBaseMult(k *Scalar) *twistPoint { - m, err := mlsb.New(fxT, fxV, fxW) - if err != nil { - panic(err) - } - if m.IsExtended() { - panic("not extended") - } - - var isZero int - if k.IsZero() { - isZero = 1 - } - subtle.ConstantTimeCopy(isZero, k[:], order[:]) - - minusK := *k - isEven := 1 - int(k[0]&0x1) - minusK.Neg() - subtle.ConstantTimeCopy(isEven, k[:], minusK[:]) - c, err := m.Encode(k[:]) - if err != nil { - panic(err) - } - - gP := c.Exp(groupMLSB{}) - P := gP.(*twistPoint) - P.cneg(uint(isEven)) - return P -} - -type groupMLSB struct{} - -func (e groupMLSB) ExtendedEltP() mlsb.EltP { return nil } -func (e groupMLSB) Sqr(x mlsb.EltG) { x.(*twistPoint).Double() } -func (e groupMLSB) Mul(x mlsb.EltG, y mlsb.EltP) { x.(*twistPoint).mixAddZ1(y.(*preTwistPointAffine)) } -func (e groupMLSB) Identity() mlsb.EltG { return twistCurve{}.Identity() } -func (e groupMLSB) NewEltP() mlsb.EltP { return &preTwistPointAffine{} } -func (e groupMLSB) Lookup(a mlsb.EltP, v uint, s, u int32) { - Tabj := &tabFixMult[v] - P := a.(*preTwistPointAffine) - for k := range Tabj { - P.cmov(&Tabj[k], uint(subtle.ConstantTimeEq(int32(k), u))) - } - P.cneg(int(s >> 31)) -} diff --git a/vendor/github.com/cloudflare/circl/internal/conv/conv.go b/vendor/github.com/cloudflare/circl/internal/conv/conv.go deleted file mode 100644 index 649a8e931d..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/conv/conv.go +++ /dev/null @@ -1,140 +0,0 @@ -package conv - -import ( - "encoding/binary" - "fmt" - "math/big" - "strings" -) - -// BytesLe2Hex returns an hexadecimal string of a number stored in a -// little-endian order slice x. -func BytesLe2Hex(x []byte) string { - b := &strings.Builder{} - b.Grow(2*len(x) + 2) - fmt.Fprint(b, "0x") - if len(x) == 0 { - fmt.Fprint(b, "00") - } - for i := len(x) - 1; i >= 0; i-- { - fmt.Fprintf(b, "%02x", x[i]) - } - return b.String() -} - -// BytesLe2BigInt converts a little-endian slice x into a big-endian -// math/big.Int. -func BytesLe2BigInt(x []byte) *big.Int { - n := len(x) - b := new(big.Int) - if len(x) > 0 { - y := make([]byte, n) - for i := 0; i < n; i++ { - y[n-1-i] = x[i] - } - b.SetBytes(y) - } - return b -} - -// BytesBe2Uint64Le converts a big-endian slice x to a little-endian slice of uint64. -func BytesBe2Uint64Le(x []byte) []uint64 { - l := len(x) - z := make([]uint64, (l+7)/8) - blocks := l / 8 - for i := 0; i < blocks; i++ { - z[i] = binary.BigEndian.Uint64(x[l-8*(i+1):]) - } - remBytes := l % 8 - for i := 0; i < remBytes; i++ { - z[blocks] |= uint64(x[l-1-8*blocks-i]) << uint(8*i) - } - return z -} - -// BigInt2BytesLe stores a positive big.Int number x into a little-endian slice z. -// The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros). -// If x does not fit in the slice or is negative, z is not modified. -func BigInt2BytesLe(z []byte, x *big.Int) { - xLen := (x.BitLen() + 7) >> 3 - zLen := len(z) - if zLen >= xLen && x.Sign() >= 0 { - y := x.Bytes() - for i := 0; i < xLen; i++ { - z[i] = y[xLen-1-i] - } - for i := xLen; i < zLen; i++ { - z[i] = 0 - } - } -} - -// Uint64Le2BigInt converts a little-endian slice x into a big number. -func Uint64Le2BigInt(x []uint64) *big.Int { - n := len(x) - b := new(big.Int) - var bi big.Int - for i := n - 1; i >= 0; i-- { - bi.SetUint64(x[i]) - b.Lsh(b, 64) - b.Add(b, &bi) - } - return b -} - -// Uint64Le2BytesLe converts a little-endian slice x to a little-endian slice of bytes. -func Uint64Le2BytesLe(x []uint64) []byte { - b := make([]byte, 8*len(x)) - n := len(x) - for i := 0; i < n; i++ { - binary.LittleEndian.PutUint64(b[i*8:], x[i]) - } - return b -} - -// Uint64Le2BytesBe converts a little-endian slice x to a big-endian slice of bytes. -func Uint64Le2BytesBe(x []uint64) []byte { - b := make([]byte, 8*len(x)) - n := len(x) - for i := 0; i < n; i++ { - binary.BigEndian.PutUint64(b[i*8:], x[n-1-i]) - } - return b -} - -// Uint64Le2Hex returns an hexadecimal string of a number stored in a -// little-endian order slice x. -func Uint64Le2Hex(x []uint64) string { - b := new(strings.Builder) - b.Grow(16*len(x) + 2) - fmt.Fprint(b, "0x") - if len(x) == 0 { - fmt.Fprint(b, "00") - } - for i := len(x) - 1; i >= 0; i-- { - fmt.Fprintf(b, "%016x", x[i]) - } - return b.String() -} - -// BigInt2Uint64Le stores a positive big.Int number x into a little-endian slice z. -// The slice is modified if the bitlength of x <= 8*len(z) (padding with zeros). -// If x does not fit in the slice or is negative, z is not modified. -func BigInt2Uint64Le(z []uint64, x *big.Int) { - xLen := (x.BitLen() + 63) >> 6 // number of 64-bit words - zLen := len(z) - if zLen >= xLen && x.Sign() > 0 { - var y, yi big.Int - y.Set(x) - two64 := big.NewInt(1) - two64.Lsh(two64, 64).Sub(two64, big.NewInt(1)) - for i := 0; i < xLen; i++ { - yi.And(&y, two64) - z[i] = yi.Uint64() - y.Rsh(&y, 64) - } - } - for i := xLen; i < zLen; i++ { - z[i] = 0 - } -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/doc.go b/vendor/github.com/cloudflare/circl/internal/sha3/doc.go deleted file mode 100644 index 7e02309070..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/doc.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package sha3 implements the SHA-3 fixed-output-length hash functions and -// the SHAKE variable-output-length hash functions defined by FIPS-202. -// -// Both types of hash function use the "sponge" construction and the Keccak -// permutation. For a detailed specification see http://keccak.noekeon.org/ -// -// # Guidance -// -// If you aren't sure what function you need, use SHAKE256 with at least 64 -// bytes of output. The SHAKE instances are faster than the SHA3 instances; -// the latter have to allocate memory to conform to the hash.Hash interface. -// -// If you need a secret-key MAC (message authentication code), prepend the -// secret key to the input, hash with SHAKE256 and read at least 32 bytes of -// output. -// -// # Security strengths -// -// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security -// strength against preimage attacks of x bits. Since they only produce "x" -// bits of output, their collision-resistance is only "x/2" bits. -// -// The SHAKE-256 and -128 functions have a generic security strength of 256 and -// 128 bits against all attacks, provided that at least 2x bits of their output -// is used. Requesting more than 64 or 32 bytes of output, respectively, does -// not increase the collision-resistance of the SHAKE functions. -// -// # The sponge construction -// -// A sponge builds a pseudo-random function from a public pseudo-random -// permutation, by applying the permutation to a state of "rate + capacity" -// bytes, but hiding "capacity" of the bytes. -// -// A sponge starts out with a zero state. To hash an input using a sponge, up -// to "rate" bytes of the input are XORed into the sponge's state. The sponge -// is then "full" and the permutation is applied to "empty" it. This process is -// repeated until all the input has been "absorbed". The input is then padded. -// The digest is "squeezed" from the sponge in the same way, except that output -// is copied out instead of input being XORed in. -// -// A sponge is parameterized by its generic security strength, which is equal -// to half its capacity; capacity + rate is equal to the permutation's width. -// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means -// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2. -// -// # Recommendations -// -// The SHAKE functions are recommended for most new uses. They can produce -// output of arbitrary length. SHAKE256, with an output length of at least -// 64 bytes, provides 256-bit security against all attacks. The Keccak team -// recommends it for most applications upgrading from SHA2-512. (NIST chose a -// much stronger, but much slower, sponge instance for SHA3-512.) -// -// The SHA-3 functions are "drop-in" replacements for the SHA-2 functions. -// They produce output of the same length, with the same security strengths -// against all attacks. This means, in particular, that SHA3-256 only has -// 128-bit collision resistance, because its output length is 32 bytes. -package sha3 diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go b/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go deleted file mode 100644 index 7d2365a76e..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/hashes.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sha3 - -// This file provides functions for creating instances of the SHA-3 -// and SHAKE hash functions, as well as utility functions for hashing -// bytes. - -// New224 creates a new SHA3-224 hash. -// Its generic security strength is 224 bits against preimage attacks, -// and 112 bits against collision attacks. -func New224() State { - return State{rate: 144, outputLen: 28, dsbyte: 0x06} -} - -// New256 creates a new SHA3-256 hash. -// Its generic security strength is 256 bits against preimage attacks, -// and 128 bits against collision attacks. -func New256() State { - return State{rate: 136, outputLen: 32, dsbyte: 0x06} -} - -// New384 creates a new SHA3-384 hash. -// Its generic security strength is 384 bits against preimage attacks, -// and 192 bits against collision attacks. -func New384() State { - return State{rate: 104, outputLen: 48, dsbyte: 0x06} -} - -// New512 creates a new SHA3-512 hash. -// Its generic security strength is 512 bits against preimage attacks, -// and 256 bits against collision attacks. -func New512() State { - return State{rate: 72, outputLen: 64, dsbyte: 0x06} -} - -// Sum224 returns the SHA3-224 digest of the data. -func Sum224(data []byte) (digest [28]byte) { - h := New224() - _, _ = h.Write(data) - h.Sum(digest[:0]) - return -} - -// Sum256 returns the SHA3-256 digest of the data. -func Sum256(data []byte) (digest [32]byte) { - h := New256() - _, _ = h.Write(data) - h.Sum(digest[:0]) - return -} - -// Sum384 returns the SHA3-384 digest of the data. -func Sum384(data []byte) (digest [48]byte) { - h := New384() - _, _ = h.Write(data) - h.Sum(digest[:0]) - return -} - -// Sum512 returns the SHA3-512 digest of the data. -func Sum512(data []byte) (digest [64]byte) { - h := New512() - _, _ = h.Write(data) - h.Sum(digest[:0]) - return -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go b/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go deleted file mode 100644 index 1755fd1e6d..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/keccakf.go +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sha3 - -// KeccakF1600 applies the Keccak permutation to a 1600b-wide -// state represented as a slice of 25 uint64s. -// If turbo is true, applies the 12-round variant instead of the -// regular 24-round variant. -// nolint:funlen -func KeccakF1600(a *[25]uint64, turbo bool) { - // Implementation translated from Keccak-inplace.c - // in the keccak reference code. - var t, bc0, bc1, bc2, bc3, bc4, d0, d1, d2, d3, d4 uint64 - - i := 0 - - if turbo { - i = 12 - } - - for ; i < 24; i += 4 { - // Combines the 5 steps in each round into 2 steps. - // Unrolls 4 rounds per loop and spreads some steps across rounds. - - // Round 1 - bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20] - bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21] - bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22] - bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23] - bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24] - d0 = bc4 ^ (bc1<<1 | bc1>>63) - d1 = bc0 ^ (bc2<<1 | bc2>>63) - d2 = bc1 ^ (bc3<<1 | bc3>>63) - d3 = bc2 ^ (bc4<<1 | bc4>>63) - d4 = bc3 ^ (bc0<<1 | bc0>>63) - - bc0 = a[0] ^ d0 - t = a[6] ^ d1 - bc1 = t<<44 | t>>(64-44) - t = a[12] ^ d2 - bc2 = t<<43 | t>>(64-43) - t = a[18] ^ d3 - bc3 = t<<21 | t>>(64-21) - t = a[24] ^ d4 - bc4 = t<<14 | t>>(64-14) - a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i] - a[6] = bc1 ^ (bc3 &^ bc2) - a[12] = bc2 ^ (bc4 &^ bc3) - a[18] = bc3 ^ (bc0 &^ bc4) - a[24] = bc4 ^ (bc1 &^ bc0) - - t = a[10] ^ d0 - bc2 = t<<3 | t>>(64-3) - t = a[16] ^ d1 - bc3 = t<<45 | t>>(64-45) - t = a[22] ^ d2 - bc4 = t<<61 | t>>(64-61) - t = a[3] ^ d3 - bc0 = t<<28 | t>>(64-28) - t = a[9] ^ d4 - bc1 = t<<20 | t>>(64-20) - a[10] = bc0 ^ (bc2 &^ bc1) - a[16] = bc1 ^ (bc3 &^ bc2) - a[22] = bc2 ^ (bc4 &^ bc3) - a[3] = bc3 ^ (bc0 &^ bc4) - a[9] = bc4 ^ (bc1 &^ bc0) - - t = a[20] ^ d0 - bc4 = t<<18 | t>>(64-18) - t = a[1] ^ d1 - bc0 = t<<1 | t>>(64-1) - t = a[7] ^ d2 - bc1 = t<<6 | t>>(64-6) - t = a[13] ^ d3 - bc2 = t<<25 | t>>(64-25) - t = a[19] ^ d4 - bc3 = t<<8 | t>>(64-8) - a[20] = bc0 ^ (bc2 &^ bc1) - a[1] = bc1 ^ (bc3 &^ bc2) - a[7] = bc2 ^ (bc4 &^ bc3) - a[13] = bc3 ^ (bc0 &^ bc4) - a[19] = bc4 ^ (bc1 &^ bc0) - - t = a[5] ^ d0 - bc1 = t<<36 | t>>(64-36) - t = a[11] ^ d1 - bc2 = t<<10 | t>>(64-10) - t = a[17] ^ d2 - bc3 = t<<15 | t>>(64-15) - t = a[23] ^ d3 - bc4 = t<<56 | t>>(64-56) - t = a[4] ^ d4 - bc0 = t<<27 | t>>(64-27) - a[5] = bc0 ^ (bc2 &^ bc1) - a[11] = bc1 ^ (bc3 &^ bc2) - a[17] = bc2 ^ (bc4 &^ bc3) - a[23] = bc3 ^ (bc0 &^ bc4) - a[4] = bc4 ^ (bc1 &^ bc0) - - t = a[15] ^ d0 - bc3 = t<<41 | t>>(64-41) - t = a[21] ^ d1 - bc4 = t<<2 | t>>(64-2) - t = a[2] ^ d2 - bc0 = t<<62 | t>>(64-62) - t = a[8] ^ d3 - bc1 = t<<55 | t>>(64-55) - t = a[14] ^ d4 - bc2 = t<<39 | t>>(64-39) - a[15] = bc0 ^ (bc2 &^ bc1) - a[21] = bc1 ^ (bc3 &^ bc2) - a[2] = bc2 ^ (bc4 &^ bc3) - a[8] = bc3 ^ (bc0 &^ bc4) - a[14] = bc4 ^ (bc1 &^ bc0) - - // Round 2 - bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20] - bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21] - bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22] - bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23] - bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24] - d0 = bc4 ^ (bc1<<1 | bc1>>63) - d1 = bc0 ^ (bc2<<1 | bc2>>63) - d2 = bc1 ^ (bc3<<1 | bc3>>63) - d3 = bc2 ^ (bc4<<1 | bc4>>63) - d4 = bc3 ^ (bc0<<1 | bc0>>63) - - bc0 = a[0] ^ d0 - t = a[16] ^ d1 - bc1 = t<<44 | t>>(64-44) - t = a[7] ^ d2 - bc2 = t<<43 | t>>(64-43) - t = a[23] ^ d3 - bc3 = t<<21 | t>>(64-21) - t = a[14] ^ d4 - bc4 = t<<14 | t>>(64-14) - a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+1] - a[16] = bc1 ^ (bc3 &^ bc2) - a[7] = bc2 ^ (bc4 &^ bc3) - a[23] = bc3 ^ (bc0 &^ bc4) - a[14] = bc4 ^ (bc1 &^ bc0) - - t = a[20] ^ d0 - bc2 = t<<3 | t>>(64-3) - t = a[11] ^ d1 - bc3 = t<<45 | t>>(64-45) - t = a[2] ^ d2 - bc4 = t<<61 | t>>(64-61) - t = a[18] ^ d3 - bc0 = t<<28 | t>>(64-28) - t = a[9] ^ d4 - bc1 = t<<20 | t>>(64-20) - a[20] = bc0 ^ (bc2 &^ bc1) - a[11] = bc1 ^ (bc3 &^ bc2) - a[2] = bc2 ^ (bc4 &^ bc3) - a[18] = bc3 ^ (bc0 &^ bc4) - a[9] = bc4 ^ (bc1 &^ bc0) - - t = a[15] ^ d0 - bc4 = t<<18 | t>>(64-18) - t = a[6] ^ d1 - bc0 = t<<1 | t>>(64-1) - t = a[22] ^ d2 - bc1 = t<<6 | t>>(64-6) - t = a[13] ^ d3 - bc2 = t<<25 | t>>(64-25) - t = a[4] ^ d4 - bc3 = t<<8 | t>>(64-8) - a[15] = bc0 ^ (bc2 &^ bc1) - a[6] = bc1 ^ (bc3 &^ bc2) - a[22] = bc2 ^ (bc4 &^ bc3) - a[13] = bc3 ^ (bc0 &^ bc4) - a[4] = bc4 ^ (bc1 &^ bc0) - - t = a[10] ^ d0 - bc1 = t<<36 | t>>(64-36) - t = a[1] ^ d1 - bc2 = t<<10 | t>>(64-10) - t = a[17] ^ d2 - bc3 = t<<15 | t>>(64-15) - t = a[8] ^ d3 - bc4 = t<<56 | t>>(64-56) - t = a[24] ^ d4 - bc0 = t<<27 | t>>(64-27) - a[10] = bc0 ^ (bc2 &^ bc1) - a[1] = bc1 ^ (bc3 &^ bc2) - a[17] = bc2 ^ (bc4 &^ bc3) - a[8] = bc3 ^ (bc0 &^ bc4) - a[24] = bc4 ^ (bc1 &^ bc0) - - t = a[5] ^ d0 - bc3 = t<<41 | t>>(64-41) - t = a[21] ^ d1 - bc4 = t<<2 | t>>(64-2) - t = a[12] ^ d2 - bc0 = t<<62 | t>>(64-62) - t = a[3] ^ d3 - bc1 = t<<55 | t>>(64-55) - t = a[19] ^ d4 - bc2 = t<<39 | t>>(64-39) - a[5] = bc0 ^ (bc2 &^ bc1) - a[21] = bc1 ^ (bc3 &^ bc2) - a[12] = bc2 ^ (bc4 &^ bc3) - a[3] = bc3 ^ (bc0 &^ bc4) - a[19] = bc4 ^ (bc1 &^ bc0) - - // Round 3 - bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20] - bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21] - bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22] - bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23] - bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24] - d0 = bc4 ^ (bc1<<1 | bc1>>63) - d1 = bc0 ^ (bc2<<1 | bc2>>63) - d2 = bc1 ^ (bc3<<1 | bc3>>63) - d3 = bc2 ^ (bc4<<1 | bc4>>63) - d4 = bc3 ^ (bc0<<1 | bc0>>63) - - bc0 = a[0] ^ d0 - t = a[11] ^ d1 - bc1 = t<<44 | t>>(64-44) - t = a[22] ^ d2 - bc2 = t<<43 | t>>(64-43) - t = a[8] ^ d3 - bc3 = t<<21 | t>>(64-21) - t = a[19] ^ d4 - bc4 = t<<14 | t>>(64-14) - a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+2] - a[11] = bc1 ^ (bc3 &^ bc2) - a[22] = bc2 ^ (bc4 &^ bc3) - a[8] = bc3 ^ (bc0 &^ bc4) - a[19] = bc4 ^ (bc1 &^ bc0) - - t = a[15] ^ d0 - bc2 = t<<3 | t>>(64-3) - t = a[1] ^ d1 - bc3 = t<<45 | t>>(64-45) - t = a[12] ^ d2 - bc4 = t<<61 | t>>(64-61) - t = a[23] ^ d3 - bc0 = t<<28 | t>>(64-28) - t = a[9] ^ d4 - bc1 = t<<20 | t>>(64-20) - a[15] = bc0 ^ (bc2 &^ bc1) - a[1] = bc1 ^ (bc3 &^ bc2) - a[12] = bc2 ^ (bc4 &^ bc3) - a[23] = bc3 ^ (bc0 &^ bc4) - a[9] = bc4 ^ (bc1 &^ bc0) - - t = a[5] ^ d0 - bc4 = t<<18 | t>>(64-18) - t = a[16] ^ d1 - bc0 = t<<1 | t>>(64-1) - t = a[2] ^ d2 - bc1 = t<<6 | t>>(64-6) - t = a[13] ^ d3 - bc2 = t<<25 | t>>(64-25) - t = a[24] ^ d4 - bc3 = t<<8 | t>>(64-8) - a[5] = bc0 ^ (bc2 &^ bc1) - a[16] = bc1 ^ (bc3 &^ bc2) - a[2] = bc2 ^ (bc4 &^ bc3) - a[13] = bc3 ^ (bc0 &^ bc4) - a[24] = bc4 ^ (bc1 &^ bc0) - - t = a[20] ^ d0 - bc1 = t<<36 | t>>(64-36) - t = a[6] ^ d1 - bc2 = t<<10 | t>>(64-10) - t = a[17] ^ d2 - bc3 = t<<15 | t>>(64-15) - t = a[3] ^ d3 - bc4 = t<<56 | t>>(64-56) - t = a[14] ^ d4 - bc0 = t<<27 | t>>(64-27) - a[20] = bc0 ^ (bc2 &^ bc1) - a[6] = bc1 ^ (bc3 &^ bc2) - a[17] = bc2 ^ (bc4 &^ bc3) - a[3] = bc3 ^ (bc0 &^ bc4) - a[14] = bc4 ^ (bc1 &^ bc0) - - t = a[10] ^ d0 - bc3 = t<<41 | t>>(64-41) - t = a[21] ^ d1 - bc4 = t<<2 | t>>(64-2) - t = a[7] ^ d2 - bc0 = t<<62 | t>>(64-62) - t = a[18] ^ d3 - bc1 = t<<55 | t>>(64-55) - t = a[4] ^ d4 - bc2 = t<<39 | t>>(64-39) - a[10] = bc0 ^ (bc2 &^ bc1) - a[21] = bc1 ^ (bc3 &^ bc2) - a[7] = bc2 ^ (bc4 &^ bc3) - a[18] = bc3 ^ (bc0 &^ bc4) - a[4] = bc4 ^ (bc1 &^ bc0) - - // Round 4 - bc0 = a[0] ^ a[5] ^ a[10] ^ a[15] ^ a[20] - bc1 = a[1] ^ a[6] ^ a[11] ^ a[16] ^ a[21] - bc2 = a[2] ^ a[7] ^ a[12] ^ a[17] ^ a[22] - bc3 = a[3] ^ a[8] ^ a[13] ^ a[18] ^ a[23] - bc4 = a[4] ^ a[9] ^ a[14] ^ a[19] ^ a[24] - d0 = bc4 ^ (bc1<<1 | bc1>>63) - d1 = bc0 ^ (bc2<<1 | bc2>>63) - d2 = bc1 ^ (bc3<<1 | bc3>>63) - d3 = bc2 ^ (bc4<<1 | bc4>>63) - d4 = bc3 ^ (bc0<<1 | bc0>>63) - - bc0 = a[0] ^ d0 - t = a[1] ^ d1 - bc1 = t<<44 | t>>(64-44) - t = a[2] ^ d2 - bc2 = t<<43 | t>>(64-43) - t = a[3] ^ d3 - bc3 = t<<21 | t>>(64-21) - t = a[4] ^ d4 - bc4 = t<<14 | t>>(64-14) - a[0] = bc0 ^ (bc2 &^ bc1) ^ RC[i+3] - a[1] = bc1 ^ (bc3 &^ bc2) - a[2] = bc2 ^ (bc4 &^ bc3) - a[3] = bc3 ^ (bc0 &^ bc4) - a[4] = bc4 ^ (bc1 &^ bc0) - - t = a[5] ^ d0 - bc2 = t<<3 | t>>(64-3) - t = a[6] ^ d1 - bc3 = t<<45 | t>>(64-45) - t = a[7] ^ d2 - bc4 = t<<61 | t>>(64-61) - t = a[8] ^ d3 - bc0 = t<<28 | t>>(64-28) - t = a[9] ^ d4 - bc1 = t<<20 | t>>(64-20) - a[5] = bc0 ^ (bc2 &^ bc1) - a[6] = bc1 ^ (bc3 &^ bc2) - a[7] = bc2 ^ (bc4 &^ bc3) - a[8] = bc3 ^ (bc0 &^ bc4) - a[9] = bc4 ^ (bc1 &^ bc0) - - t = a[10] ^ d0 - bc4 = t<<18 | t>>(64-18) - t = a[11] ^ d1 - bc0 = t<<1 | t>>(64-1) - t = a[12] ^ d2 - bc1 = t<<6 | t>>(64-6) - t = a[13] ^ d3 - bc2 = t<<25 | t>>(64-25) - t = a[14] ^ d4 - bc3 = t<<8 | t>>(64-8) - a[10] = bc0 ^ (bc2 &^ bc1) - a[11] = bc1 ^ (bc3 &^ bc2) - a[12] = bc2 ^ (bc4 &^ bc3) - a[13] = bc3 ^ (bc0 &^ bc4) - a[14] = bc4 ^ (bc1 &^ bc0) - - t = a[15] ^ d0 - bc1 = t<<36 | t>>(64-36) - t = a[16] ^ d1 - bc2 = t<<10 | t>>(64-10) - t = a[17] ^ d2 - bc3 = t<<15 | t>>(64-15) - t = a[18] ^ d3 - bc4 = t<<56 | t>>(64-56) - t = a[19] ^ d4 - bc0 = t<<27 | t>>(64-27) - a[15] = bc0 ^ (bc2 &^ bc1) - a[16] = bc1 ^ (bc3 &^ bc2) - a[17] = bc2 ^ (bc4 &^ bc3) - a[18] = bc3 ^ (bc0 &^ bc4) - a[19] = bc4 ^ (bc1 &^ bc0) - - t = a[20] ^ d0 - bc3 = t<<41 | t>>(64-41) - t = a[21] ^ d1 - bc4 = t<<2 | t>>(64-2) - t = a[22] ^ d2 - bc0 = t<<62 | t>>(64-62) - t = a[23] ^ d3 - bc1 = t<<55 | t>>(64-55) - t = a[24] ^ d4 - bc2 = t<<39 | t>>(64-39) - a[20] = bc0 ^ (bc2 &^ bc1) - a[21] = bc1 ^ (bc3 &^ bc2) - a[22] = bc2 ^ (bc4 &^ bc3) - a[23] = bc3 ^ (bc0 &^ bc4) - a[24] = bc4 ^ (bc1 &^ bc0) - } -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/rc.go b/vendor/github.com/cloudflare/circl/internal/sha3/rc.go deleted file mode 100644 index 6a3df42f30..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/rc.go +++ /dev/null @@ -1,29 +0,0 @@ -package sha3 - -// RC stores the round constants for use in the ι step. -var RC = [24]uint64{ - 0x0000000000000001, - 0x0000000000008082, - 0x800000000000808A, - 0x8000000080008000, - 0x000000000000808B, - 0x0000000080000001, - 0x8000000080008081, - 0x8000000000008009, - 0x000000000000008A, - 0x0000000000000088, - 0x0000000080008009, - 0x000000008000000A, - 0x000000008000808B, - 0x800000000000008B, - 0x8000000000008089, - 0x8000000000008003, - 0x8000000000008002, - 0x8000000000000080, - 0x000000000000800A, - 0x800000008000000A, - 0x8000000080008081, - 0x8000000000008080, - 0x0000000080000001, - 0x8000000080008008, -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go b/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go deleted file mode 100644 index a0df5aa6c5..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/sha3.go +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sha3 - -// spongeDirection indicates the direction bytes are flowing through the sponge. -type spongeDirection int - -const ( - // spongeAbsorbing indicates that the sponge is absorbing input. - spongeAbsorbing spongeDirection = iota - // spongeSqueezing indicates that the sponge is being squeezed. - spongeSqueezing -) - -const ( - // maxRate is the maximum size of the internal buffer. SHAKE-256 - // currently needs the largest buffer. - maxRate = 168 -) - -func (d *State) buf() []byte { - return d.storage.asBytes()[d.bufo:d.bufe] -} - -type State struct { - // Generic sponge components. - a [25]uint64 // main state of the hash - rate int // the number of bytes of state to use - - bufo int // offset of buffer in storage - bufe int // end of buffer in storage - - // dsbyte contains the "domain separation" bits and the first bit of - // the padding. Sections 6.1 and 6.2 of [1] separate the outputs of the - // SHA-3 and SHAKE functions by appending bitstrings to the message. - // Using a little-endian bit-ordering convention, these are "01" for SHA-3 - // and "1111" for SHAKE, or 00000010b and 00001111b, respectively. Then the - // padding rule from section 5.1 is applied to pad the message to a multiple - // of the rate, which involves adding a "1" bit, zero or more "0" bits, and - // a final "1" bit. We merge the first "1" bit from the padding into dsbyte, - // giving 00000110b (0x06) and 00011111b (0x1f). - // [1] http://csrc.nist.gov/publications/drafts/fips-202/fips_202_draft.pdf - // "Draft FIPS 202: SHA-3 Standard: Permutation-Based Hash and - // Extendable-Output Functions (May 2014)" - dsbyte byte - - storage storageBuf - - // Specific to SHA-3 and SHAKE. - outputLen int // the default output size in bytes - state spongeDirection // whether the sponge is absorbing or squeezing - turbo bool // Whether we're using 12 rounds instead of 24 -} - -// BlockSize returns the rate of sponge underlying this hash function. -func (d *State) BlockSize() int { return d.rate } - -// Size returns the output size of the hash function in bytes. -func (d *State) Size() int { return d.outputLen } - -// Reset clears the internal state by zeroing the sponge state and -// the byte buffer, and setting Sponge.state to absorbing. -func (d *State) Reset() { - // Zero the permutation's state. - for i := range d.a { - d.a[i] = 0 - } - d.state = spongeAbsorbing - d.bufo = 0 - d.bufe = 0 -} - -func (d *State) clone() *State { - ret := *d - return &ret -} - -// permute applies the KeccakF-1600 permutation. It handles -// any input-output buffering. -func (d *State) permute() { - switch d.state { - case spongeAbsorbing: - // If we're absorbing, we need to xor the input into the state - // before applying the permutation. - xorIn(d, d.buf()) - d.bufe = 0 - d.bufo = 0 - KeccakF1600(&d.a, d.turbo) - case spongeSqueezing: - // If we're squeezing, we need to apply the permutation before - // copying more output. - KeccakF1600(&d.a, d.turbo) - d.bufe = d.rate - d.bufo = 0 - copyOut(d, d.buf()) - } -} - -// pads appends the domain separation bits in dsbyte, applies -// the multi-bitrate 10..1 padding rule, and permutes the state. -func (d *State) padAndPermute(dsbyte byte) { - // Pad with this instance's domain-separator bits. We know that there's - // at least one byte of space in d.buf() because, if it were full, - // permute would have been called to empty it. dsbyte also contains the - // first one bit for the padding. See the comment in the state struct. - zerosStart := d.bufe + 1 - d.bufe = d.rate - buf := d.buf() - buf[zerosStart-1] = dsbyte - for i := zerosStart; i < d.rate; i++ { - buf[i] = 0 - } - // This adds the final one bit for the padding. Because of the way that - // bits are numbered from the LSB upwards, the final bit is the MSB of - // the last byte. - buf[d.rate-1] ^= 0x80 - // Apply the permutation - d.permute() - d.state = spongeSqueezing - d.bufe = d.rate - copyOut(d, buf) -} - -// Write absorbs more data into the hash's state. It produces an error -// if more data is written to the ShakeHash after writing -func (d *State) Write(p []byte) (written int, err error) { - if d.state != spongeAbsorbing { - panic("sha3: write to sponge after read") - } - written = len(p) - - for len(p) > 0 { - bufl := d.bufe - d.bufo - if bufl == 0 && len(p) >= d.rate { - // The fast path; absorb a full "rate" bytes of input and apply the permutation. - xorIn(d, p[:d.rate]) - p = p[d.rate:] - KeccakF1600(&d.a, d.turbo) - } else { - // The slow path; buffer the input until we can fill the sponge, and then xor it in. - todo := d.rate - bufl - if todo > len(p) { - todo = len(p) - } - d.bufe += todo - buf := d.buf() - copy(buf[bufl:], p[:todo]) - p = p[todo:] - - // If the sponge is full, apply the permutation. - if d.bufe == d.rate { - d.permute() - } - } - } - - return written, nil -} - -// Read squeezes an arbitrary number of bytes from the sponge. -func (d *State) Read(out []byte) (n int, err error) { - // If we're still absorbing, pad and apply the permutation. - if d.state == spongeAbsorbing { - d.padAndPermute(d.dsbyte) - } - - n = len(out) - - // Now, do the squeezing. - for len(out) > 0 { - buf := d.buf() - n := copy(out, buf) - d.bufo += n - out = out[n:] - - // Apply the permutation if we've squeezed the sponge dry. - if d.bufo == d.bufe { - d.permute() - } - } - - return -} - -// Sum applies padding to the hash state and then squeezes out the desired -// number of output bytes. -func (d *State) Sum(in []byte) []byte { - // Make a copy of the original hash so that caller can keep writing - // and summing. - dup := d.clone() - hash := make([]byte, dup.outputLen) - _, _ = dup.Read(hash) - return append(in, hash...) -} - -func (d *State) IsAbsorbing() bool { - return d.state == spongeAbsorbing -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s b/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s deleted file mode 100644 index 8a4458f63f..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/sha3_s390x.s +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !gccgo,!appengine - -#include "textflag.h" - -// func kimd(function code, chain *[200]byte, src []byte) -TEXT ·kimd(SB), NOFRAME|NOSPLIT, $0-40 - MOVD function+0(FP), R0 - MOVD chain+8(FP), R1 - LMG src+16(FP), R2, R3 // R2=base, R3=len - -continue: - WORD $0xB93E0002 // KIMD --, R2 - BVS continue // continue if interrupted - MOVD $0, R0 // reset R0 for pre-go1.8 compilers - RET - -// func klmd(function code, chain *[200]byte, dst, src []byte) -TEXT ·klmd(SB), NOFRAME|NOSPLIT, $0-64 - // TODO: SHAKE support - MOVD function+0(FP), R0 - MOVD chain+8(FP), R1 - LMG dst+16(FP), R2, R3 // R2=base, R3=len - LMG src+40(FP), R4, R5 // R4=base, R5=len - -continue: - WORD $0xB93F0024 // KLMD R2, R4 - BVS continue // continue if interrupted - MOVD $0, R0 // reset R0 for pre-go1.8 compilers - RET diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/shake.go b/vendor/github.com/cloudflare/circl/internal/sha3/shake.go deleted file mode 100644 index 77817f758c..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/shake.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sha3 - -// This file defines the ShakeHash interface, and provides -// functions for creating SHAKE and cSHAKE instances, as well as utility -// functions for hashing bytes to arbitrary-length output. -// -// -// SHAKE implementation is based on FIPS PUB 202 [1] -// cSHAKE implementations is based on NIST SP 800-185 [2] -// -// [1] https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf -// [2] https://doi.org/10.6028/NIST.SP.800-185 - -import ( - "io" -) - -// ShakeHash defines the interface to hash functions that -// support arbitrary-length output. -type ShakeHash interface { - // Write absorbs more data into the hash's state. It panics if input is - // written to it after output has been read from it. - io.Writer - - // Read reads more output from the hash; reading affects the hash's - // state. (ShakeHash.Read is thus very different from Hash.Sum) - // It never returns an error. - io.Reader - - // Clone returns a copy of the ShakeHash in its current state. - Clone() ShakeHash - - // Reset resets the ShakeHash to its initial state. - Reset() -} - -// Consts for configuring initial SHA-3 state -const ( - dsbyteShake = 0x1f - rate128 = 168 - rate256 = 136 -) - -// Clone returns copy of SHAKE context within its current state. -func (d *State) Clone() ShakeHash { - return d.clone() -} - -// NewShake128 creates a new SHAKE128 variable-output-length ShakeHash. -// Its generic security strength is 128 bits against all attacks if at -// least 32 bytes of its output are used. -func NewShake128() State { - return State{rate: rate128, dsbyte: dsbyteShake} -} - -// NewTurboShake128 creates a new TurboSHAKE128 variable-output-length ShakeHash. -// Its generic security strength is 128 bits against all attacks if at -// least 32 bytes of its output are used. -// D is the domain separation byte and must be between 0x01 and 0x7f inclusive. -func NewTurboShake128(D byte) State { - if D == 0 || D > 0x7f { - panic("turboshake: D out of range") - } - return State{rate: rate128, dsbyte: D, turbo: true} -} - -// NewShake256 creates a new SHAKE256 variable-output-length ShakeHash. -// Its generic security strength is 256 bits against all attacks if -// at least 64 bytes of its output are used. -func NewShake256() State { - return State{rate: rate256, dsbyte: dsbyteShake} -} - -// NewTurboShake256 creates a new TurboSHAKE256 variable-output-length ShakeHash. -// Its generic security strength is 256 bits against all attacks if -// at least 64 bytes of its output are used. -// D is the domain separation byte and must be between 0x01 and 0x7f inclusive. -func NewTurboShake256(D byte) State { - if D == 0 || D > 0x7f { - panic("turboshake: D out of range") - } - return State{rate: rate256, dsbyte: D, turbo: true} -} - -// ShakeSum128 writes an arbitrary-length digest of data into hash. -func ShakeSum128(hash, data []byte) { - h := NewShake128() - _, _ = h.Write(data) - _, _ = h.Read(hash) -} - -// ShakeSum256 writes an arbitrary-length digest of data into hash. -func ShakeSum256(hash, data []byte) { - h := NewShake256() - _, _ = h.Write(data) - _, _ = h.Read(hash) -} - -// TurboShakeSum128 writes an arbitrary-length digest of data into hash. -func TurboShakeSum128(hash, data []byte, D byte) { - h := NewTurboShake128(D) - _, _ = h.Write(data) - _, _ = h.Read(hash) -} - -// TurboShakeSum256 writes an arbitrary-length digest of data into hash. -func TurboShakeSum256(hash, data []byte, D byte) { - h := NewTurboShake256(D) - _, _ = h.Write(data) - _, _ = h.Read(hash) -} - -func (d *State) SwitchDS(D byte) { - d.dsbyte = D -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor.go deleted file mode 100644 index 1e21337454..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/xor.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (!amd64 && !386 && !ppc64le) || appengine -// +build !amd64,!386,!ppc64le appengine - -package sha3 - -// A storageBuf is an aligned array of maxRate bytes. -type storageBuf [maxRate]byte - -func (b *storageBuf) asBytes() *[maxRate]byte { - return (*[maxRate]byte)(b) -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go deleted file mode 100644 index 2b0c661790..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/xor_generic.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (!amd64 || appengine) && (!386 || appengine) && (!ppc64le || appengine) -// +build !amd64 appengine -// +build !386 appengine -// +build !ppc64le appengine - -package sha3 - -import "encoding/binary" - -// xorIn xors the bytes in buf into the state; it -// makes no non-portable assumptions about memory layout -// or alignment. -func xorIn(d *State, buf []byte) { - n := len(buf) / 8 - - for i := 0; i < n; i++ { - a := binary.LittleEndian.Uint64(buf) - d.a[i] ^= a - buf = buf[8:] - } -} - -// copyOut copies ulint64s to a byte buffer. -func copyOut(d *State, b []byte) { - for i := 0; len(b) >= 8; i++ { - binary.LittleEndian.PutUint64(b, d.a[i]) - b = b[8:] - } -} diff --git a/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go b/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go deleted file mode 100644 index 052fc8d32d..0000000000 --- a/vendor/github.com/cloudflare/circl/internal/sha3/xor_unaligned.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build (amd64 || 386 || ppc64le) && !appengine -// +build amd64 386 ppc64le -// +build !appengine - -package sha3 - -import "unsafe" - -// A storageBuf is an aligned array of maxRate bytes. -type storageBuf [maxRate / 8]uint64 - -func (b *storageBuf) asBytes() *[maxRate]byte { - return (*[maxRate]byte)(unsafe.Pointer(b)) -} - -// xorInuses unaligned reads and writes to update d.a to contain d.a -// XOR buf. -func xorIn(d *State, buf []byte) { - n := len(buf) - bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0]))[: n/8 : n/8] - if n >= 72 { - d.a[0] ^= bw[0] - d.a[1] ^= bw[1] - d.a[2] ^= bw[2] - d.a[3] ^= bw[3] - d.a[4] ^= bw[4] - d.a[5] ^= bw[5] - d.a[6] ^= bw[6] - d.a[7] ^= bw[7] - d.a[8] ^= bw[8] - } - if n >= 104 { - d.a[9] ^= bw[9] - d.a[10] ^= bw[10] - d.a[11] ^= bw[11] - d.a[12] ^= bw[12] - } - if n >= 136 { - d.a[13] ^= bw[13] - d.a[14] ^= bw[14] - d.a[15] ^= bw[15] - d.a[16] ^= bw[16] - } - if n >= 144 { - d.a[17] ^= bw[17] - } - if n >= 168 { - d.a[18] ^= bw[18] - d.a[19] ^= bw[19] - d.a[20] ^= bw[20] - } -} - -func copyOut(d *State, buf []byte) { - ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) - copy(buf, ab[:]) -} diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp.go deleted file mode 100644 index 57a50ff5e9..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp25519/fp.go +++ /dev/null @@ -1,205 +0,0 @@ -// Package fp25519 provides prime field arithmetic over GF(2^255-19). -package fp25519 - -import ( - "errors" - - "github.com/cloudflare/circl/internal/conv" -) - -// Size in bytes of an element. -const Size = 32 - -// Elt is a prime field element. -type Elt [Size]byte - -func (e Elt) String() string { return conv.BytesLe2Hex(e[:]) } - -// p is the prime modulus 2^255-19. -var p = Elt{ - 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, -} - -// P returns the prime modulus 2^255-19. -func P() Elt { return p } - -// ToBytes stores in b the little-endian byte representation of x. -func ToBytes(b []byte, x *Elt) error { - if len(b) != Size { - return errors.New("wrong size") - } - Modp(x) - copy(b, x[:]) - return nil -} - -// IsZero returns true if x is equal to 0. -func IsZero(x *Elt) bool { Modp(x); return *x == Elt{} } - -// SetOne assigns x=1. -func SetOne(x *Elt) { *x = Elt{}; x[0] = 1 } - -// Neg calculates z = -x. -func Neg(z, x *Elt) { Sub(z, &p, x) } - -// InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue, which is -// indicated by returning isQR = true. Otherwise, when x/y is a quadratic -// non-residue, z will have an undetermined value and isQR = false. -func InvSqrt(z, x, y *Elt) (isQR bool) { - sqrtMinusOne := &Elt{ - 0xb0, 0xa0, 0x0e, 0x4a, 0x27, 0x1b, 0xee, 0xc4, - 0x78, 0xe4, 0x2f, 0xad, 0x06, 0x18, 0x43, 0x2f, - 0xa7, 0xd7, 0xfb, 0x3d, 0x99, 0x00, 0x4d, 0x2b, - 0x0b, 0xdf, 0xc1, 0x4f, 0x80, 0x24, 0x83, 0x2b, - } - t0, t1, t2, t3 := &Elt{}, &Elt{}, &Elt{}, &Elt{} - - Mul(t0, x, y) // t0 = u*v - Sqr(t1, y) // t1 = v^2 - Mul(t2, t0, t1) // t2 = u*v^3 - Sqr(t0, t1) // t0 = v^4 - Mul(t1, t0, t2) // t1 = u*v^7 - - var Tab [4]*Elt - Tab[0] = &Elt{} - Tab[1] = &Elt{} - Tab[2] = t3 - Tab[3] = t1 - - *Tab[0] = *t1 - Sqr(Tab[0], Tab[0]) - Sqr(Tab[1], Tab[0]) - Sqr(Tab[1], Tab[1]) - Mul(Tab[1], Tab[1], Tab[3]) - Mul(Tab[0], Tab[0], Tab[1]) - Sqr(Tab[0], Tab[0]) - Mul(Tab[0], Tab[0], Tab[1]) - Sqr(Tab[1], Tab[0]) - for i := 0; i < 4; i++ { - Sqr(Tab[1], Tab[1]) - } - Mul(Tab[1], Tab[1], Tab[0]) - Sqr(Tab[2], Tab[1]) - for i := 0; i < 4; i++ { - Sqr(Tab[2], Tab[2]) - } - Mul(Tab[2], Tab[2], Tab[0]) - Sqr(Tab[1], Tab[2]) - for i := 0; i < 14; i++ { - Sqr(Tab[1], Tab[1]) - } - Mul(Tab[1], Tab[1], Tab[2]) - Sqr(Tab[2], Tab[1]) - for i := 0; i < 29; i++ { - Sqr(Tab[2], Tab[2]) - } - Mul(Tab[2], Tab[2], Tab[1]) - Sqr(Tab[1], Tab[2]) - for i := 0; i < 59; i++ { - Sqr(Tab[1], Tab[1]) - } - Mul(Tab[1], Tab[1], Tab[2]) - for i := 0; i < 5; i++ { - Sqr(Tab[1], Tab[1]) - } - Mul(Tab[1], Tab[1], Tab[0]) - Sqr(Tab[2], Tab[1]) - for i := 0; i < 124; i++ { - Sqr(Tab[2], Tab[2]) - } - Mul(Tab[2], Tab[2], Tab[1]) - Sqr(Tab[2], Tab[2]) - Sqr(Tab[2], Tab[2]) - Mul(Tab[2], Tab[2], Tab[3]) - - Mul(z, t3, t2) // z = xy^(p+3)/8 = xy^3*(xy^7)^(p-5)/8 - // Checking whether y z^2 == x - Sqr(t0, z) // t0 = z^2 - Mul(t0, t0, y) // t0 = yz^2 - Sub(t1, t0, x) // t1 = t0-u - Add(t2, t0, x) // t2 = t0+u - if IsZero(t1) { - return true - } else if IsZero(t2) { - Mul(z, z, sqrtMinusOne) // z = z*sqrt(-1) - return true - } else { - return false - } -} - -// Inv calculates z = 1/x mod p. -func Inv(z, x *Elt) { - x0, x1, x2 := &Elt{}, &Elt{}, &Elt{} - Sqr(x1, x) - Sqr(x0, x1) - Sqr(x0, x0) - Mul(x0, x0, x) - Mul(z, x0, x1) - Sqr(x1, z) - Mul(x0, x0, x1) - Sqr(x1, x0) - for i := 0; i < 4; i++ { - Sqr(x1, x1) - } - Mul(x0, x0, x1) - Sqr(x1, x0) - for i := 0; i < 9; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, x0) - Sqr(x2, x1) - for i := 0; i < 19; i++ { - Sqr(x2, x2) - } - Mul(x2, x2, x1) - for i := 0; i < 10; i++ { - Sqr(x2, x2) - } - Mul(x2, x2, x0) - Sqr(x0, x2) - for i := 0; i < 49; i++ { - Sqr(x0, x0) - } - Mul(x0, x0, x2) - Sqr(x1, x0) - for i := 0; i < 99; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, x0) - for i := 0; i < 50; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, x2) - for i := 0; i < 5; i++ { - Sqr(x1, x1) - } - Mul(z, z, x1) -} - -// Cmov assigns y to x if n is 1. -func Cmov(x, y *Elt, n uint) { cmov(x, y, n) } - -// Cswap interchanges x and y if n is 1. -func Cswap(x, y *Elt, n uint) { cswap(x, y, n) } - -// Add calculates z = x+y mod p. -func Add(z, x, y *Elt) { add(z, x, y) } - -// Sub calculates z = x-y mod p. -func Sub(z, x, y *Elt) { sub(z, x, y) } - -// AddSub calculates (x,y) = (x+y mod p, x-y mod p). -func AddSub(x, y *Elt) { addsub(x, y) } - -// Mul calculates z = x*y mod p. -func Mul(z, x, y *Elt) { mul(z, x, y) } - -// Sqr calculates z = x^2 mod p. -func Sqr(z, x *Elt) { sqr(z, x) } - -// Modp ensures that z is between [0,p-1]. -func Modp(z *Elt) { modp(z) } diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go deleted file mode 100644 index 057f0d2803..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build amd64 && !purego -// +build amd64,!purego - -package fp25519 - -import ( - "golang.org/x/sys/cpu" -) - -var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX - -var _ = hasBmi2Adx - -func cmov(x, y *Elt, n uint) { cmovAmd64(x, y, n) } -func cswap(x, y *Elt, n uint) { cswapAmd64(x, y, n) } -func add(z, x, y *Elt) { addAmd64(z, x, y) } -func sub(z, x, y *Elt) { subAmd64(z, x, y) } -func addsub(x, y *Elt) { addsubAmd64(x, y) } -func mul(z, x, y *Elt) { mulAmd64(z, x, y) } -func sqr(z, x *Elt) { sqrAmd64(z, x) } -func modp(z *Elt) { modpAmd64(z) } - -//go:noescape -func cmovAmd64(x, y *Elt, n uint) - -//go:noescape -func cswapAmd64(x, y *Elt, n uint) - -//go:noescape -func addAmd64(z, x, y *Elt) - -//go:noescape -func subAmd64(z, x, y *Elt) - -//go:noescape -func addsubAmd64(x, y *Elt) - -//go:noescape -func mulAmd64(z, x, y *Elt) - -//go:noescape -func sqrAmd64(z, x *Elt) - -//go:noescape -func modpAmd64(z *Elt) diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h b/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h deleted file mode 100644 index b884b584ab..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp25519/fp_amd64.h +++ /dev/null @@ -1,351 +0,0 @@ -// This code was imported from https://github.com/armfazh/rfc7748_precomputed - -// CHECK_BMI2ADX triggers bmi2adx if supported, -// otherwise it fallbacks to legacy code. -#define CHECK_BMI2ADX(label, legacy, bmi2adx) \ - CMPB ·hasBmi2Adx(SB), $0 \ - JE label \ - bmi2adx \ - RET \ - label: \ - legacy \ - RET - -// cselect is a conditional move -// if b=1: it copies y into x; -// if b=0: x remains with the same value; -// if b<> 0,1: undefined. -// Uses: AX, DX, FLAGS -// Instr: x86_64, cmov -#define cselect(x,y,b) \ - TESTQ b, b \ - MOVQ 0+x, AX; MOVQ 0+y, DX; CMOVQNE DX, AX; MOVQ AX, 0+x; \ - MOVQ 8+x, AX; MOVQ 8+y, DX; CMOVQNE DX, AX; MOVQ AX, 8+x; \ - MOVQ 16+x, AX; MOVQ 16+y, DX; CMOVQNE DX, AX; MOVQ AX, 16+x; \ - MOVQ 24+x, AX; MOVQ 24+y, DX; CMOVQNE DX, AX; MOVQ AX, 24+x; - -// cswap is a conditional swap -// if b=1: x,y <- y,x; -// if b=0: x,y remain with the same values; -// if b<> 0,1: undefined. -// Uses: AX, DX, R8, FLAGS -// Instr: x86_64, cmov -#define cswap(x,y,b) \ - TESTQ b, b \ - MOVQ 0+x, AX; MOVQ AX, R8; MOVQ 0+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 0+x; MOVQ DX, 0+y; \ - MOVQ 8+x, AX; MOVQ AX, R8; MOVQ 8+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 8+x; MOVQ DX, 8+y; \ - MOVQ 16+x, AX; MOVQ AX, R8; MOVQ 16+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 16+x; MOVQ DX, 16+y; \ - MOVQ 24+x, AX; MOVQ AX, R8; MOVQ 24+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 24+x; MOVQ DX, 24+y; - -// additionLeg adds x and y and stores in z -// Uses: AX, DX, R8-R11, FLAGS -// Instr: x86_64, cmov -#define additionLeg(z,x,y) \ - MOVL $38, AX; \ - MOVL $0, DX; \ - MOVQ 0+x, R8; ADDQ 0+y, R8; \ - MOVQ 8+x, R9; ADCQ 8+y, R9; \ - MOVQ 16+x, R10; ADCQ 16+y, R10; \ - MOVQ 24+x, R11; ADCQ 24+y, R11; \ - CMOVQCS AX, DX; \ - ADDQ DX, R8; \ - ADCQ $0, R9; MOVQ R9, 8+z; \ - ADCQ $0, R10; MOVQ R10, 16+z; \ - ADCQ $0, R11; MOVQ R11, 24+z; \ - MOVL $0, DX; \ - CMOVQCS AX, DX; \ - ADDQ DX, R8; MOVQ R8, 0+z; - -// additionAdx adds x and y and stores in z -// Uses: AX, DX, R8-R11, FLAGS -// Instr: x86_64, cmov, adx -#define additionAdx(z,x,y) \ - MOVL $38, AX; \ - XORL DX, DX; \ - MOVQ 0+x, R8; ADCXQ 0+y, R8; \ - MOVQ 8+x, R9; ADCXQ 8+y, R9; \ - MOVQ 16+x, R10; ADCXQ 16+y, R10; \ - MOVQ 24+x, R11; ADCXQ 24+y, R11; \ - CMOVQCS AX, DX ; \ - XORL AX, AX; \ - ADCXQ DX, R8; \ - ADCXQ AX, R9; MOVQ R9, 8+z; \ - ADCXQ AX, R10; MOVQ R10, 16+z; \ - ADCXQ AX, R11; MOVQ R11, 24+z; \ - MOVL $38, DX; \ - CMOVQCS DX, AX; \ - ADDQ AX, R8; MOVQ R8, 0+z; - -// subtraction subtracts y from x and stores in z -// Uses: AX, DX, R8-R11, FLAGS -// Instr: x86_64, cmov -#define subtraction(z,x,y) \ - MOVL $38, AX; \ - MOVQ 0+x, R8; SUBQ 0+y, R8; \ - MOVQ 8+x, R9; SBBQ 8+y, R9; \ - MOVQ 16+x, R10; SBBQ 16+y, R10; \ - MOVQ 24+x, R11; SBBQ 24+y, R11; \ - MOVL $0, DX; \ - CMOVQCS AX, DX; \ - SUBQ DX, R8; \ - SBBQ $0, R9; MOVQ R9, 8+z; \ - SBBQ $0, R10; MOVQ R10, 16+z; \ - SBBQ $0, R11; MOVQ R11, 24+z; \ - MOVL $0, DX; \ - CMOVQCS AX, DX; \ - SUBQ DX, R8; MOVQ R8, 0+z; - -// integerMulAdx multiplies x and y and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64, bmi2, adx -#define integerMulAdx(z,x,y) \ - MOVL $0,R15; \ - MOVQ 0+y, DX; XORL AX, AX; \ - MULXQ 0+x, AX, R8; MOVQ AX, 0+z; \ - MULXQ 8+x, AX, R9; ADCXQ AX, R8; \ - MULXQ 16+x, AX, R10; ADCXQ AX, R9; \ - MULXQ 24+x, AX, R11; ADCXQ AX, R10; \ - MOVL $0, AX;;;;;;;;; ADCXQ AX, R11; \ - MOVQ 8+y, DX; XORL AX, AX; \ - MULXQ 0+x, AX, R12; ADCXQ R8, AX; MOVQ AX, 8+z; \ - MULXQ 8+x, AX, R13; ADCXQ R9, R12; ADOXQ AX, R12; \ - MULXQ 16+x, AX, R14; ADCXQ R10, R13; ADOXQ AX, R13; \ - MULXQ 24+x, AX, R15; ADCXQ R11, R14; ADOXQ AX, R14; \ - MOVL $0, AX;;;;;;;;; ADCXQ AX, R15; ADOXQ AX, R15; \ - MOVQ 16+y, DX; XORL AX, AX; \ - MULXQ 0+x, AX, R8; ADCXQ R12, AX; MOVQ AX, 16+z; \ - MULXQ 8+x, AX, R9; ADCXQ R13, R8; ADOXQ AX, R8; \ - MULXQ 16+x, AX, R10; ADCXQ R14, R9; ADOXQ AX, R9; \ - MULXQ 24+x, AX, R11; ADCXQ R15, R10; ADOXQ AX, R10; \ - MOVL $0, AX;;;;;;;;; ADCXQ AX, R11; ADOXQ AX, R11; \ - MOVQ 24+y, DX; XORL AX, AX; \ - MULXQ 0+x, AX, R12; ADCXQ R8, AX; MOVQ AX, 24+z; \ - MULXQ 8+x, AX, R13; ADCXQ R9, R12; ADOXQ AX, R12; MOVQ R12, 32+z; \ - MULXQ 16+x, AX, R14; ADCXQ R10, R13; ADOXQ AX, R13; MOVQ R13, 40+z; \ - MULXQ 24+x, AX, R15; ADCXQ R11, R14; ADOXQ AX, R14; MOVQ R14, 48+z; \ - MOVL $0, AX;;;;;;;;; ADCXQ AX, R15; ADOXQ AX, R15; MOVQ R15, 56+z; - -// integerMulLeg multiplies x and y and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64 -#define integerMulLeg(z,x,y) \ - MOVQ 0+y, R8; \ - MOVQ 0+x, AX; MULQ R8; MOVQ AX, 0+z; MOVQ DX, R15; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R8; \ - ADDQ R13, R15; \ - ADCQ R14, R10; MOVQ R10, 16+z; \ - ADCQ AX, R11; MOVQ R11, 24+z; \ - ADCQ $0, DX; MOVQ DX, 32+z; \ - MOVQ 8+y, R8; \ - MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R8; \ - ADDQ R12, R15; MOVQ R15, 8+z; \ - ADCQ R13, R9; \ - ADCQ R14, R10; \ - ADCQ AX, R11; \ - ADCQ $0, DX; \ - ADCQ 16+z, R9; MOVQ R9, R15; \ - ADCQ 24+z, R10; MOVQ R10, 24+z; \ - ADCQ 32+z, R11; MOVQ R11, 32+z; \ - ADCQ $0, DX; MOVQ DX, 40+z; \ - MOVQ 16+y, R8; \ - MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R8; \ - ADDQ R12, R15; MOVQ R15, 16+z; \ - ADCQ R13, R9; \ - ADCQ R14, R10; \ - ADCQ AX, R11; \ - ADCQ $0, DX; \ - ADCQ 24+z, R9; MOVQ R9, R15; \ - ADCQ 32+z, R10; MOVQ R10, 32+z; \ - ADCQ 40+z, R11; MOVQ R11, 40+z; \ - ADCQ $0, DX; MOVQ DX, 48+z; \ - MOVQ 24+y, R8; \ - MOVQ 0+x, AX; MULQ R8; MOVQ AX, R12; MOVQ DX, R9; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, R13; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R8; \ - ADDQ R12, R15; MOVQ R15, 24+z; \ - ADCQ R13, R9; \ - ADCQ R14, R10; \ - ADCQ AX, R11; \ - ADCQ $0, DX; \ - ADCQ 32+z, R9; MOVQ R9, 32+z; \ - ADCQ 40+z, R10; MOVQ R10, 40+z; \ - ADCQ 48+z, R11; MOVQ R11, 48+z; \ - ADCQ $0, DX; MOVQ DX, 56+z; - -// integerSqrLeg squares x and stores in z -// Uses: AX, CX, DX, R8-R15, FLAGS -// Instr: x86_64 -#define integerSqrLeg(z,x) \ - MOVQ 0+x, R8; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, R9; MOVQ DX, R10; /* A[0]*A[1] */ \ - MOVQ 16+x, AX; MULQ R8; MOVQ AX, R14; MOVQ DX, R11; /* A[0]*A[2] */ \ - MOVQ 24+x, AX; MULQ R8; MOVQ AX, R15; MOVQ DX, R12; /* A[0]*A[3] */ \ - MOVQ 24+x, R8; \ - MOVQ 8+x, AX; MULQ R8; MOVQ AX, CX; MOVQ DX, R13; /* A[3]*A[1] */ \ - MOVQ 16+x, AX; MULQ R8; /* A[3]*A[2] */ \ - \ - ADDQ R14, R10;\ - ADCQ R15, R11; MOVL $0, R15;\ - ADCQ CX, R12;\ - ADCQ AX, R13;\ - ADCQ $0, DX; MOVQ DX, R14;\ - MOVQ 8+x, AX; MULQ 16+x;\ - \ - ADDQ AX, R11;\ - ADCQ DX, R12;\ - ADCQ $0, R13;\ - ADCQ $0, R14;\ - ADCQ $0, R15;\ - \ - SHLQ $1, R14, R15; MOVQ R15, 56+z;\ - SHLQ $1, R13, R14; MOVQ R14, 48+z;\ - SHLQ $1, R12, R13; MOVQ R13, 40+z;\ - SHLQ $1, R11, R12; MOVQ R12, 32+z;\ - SHLQ $1, R10, R11; MOVQ R11, 24+z;\ - SHLQ $1, R9, R10; MOVQ R10, 16+z;\ - SHLQ $1, R9; MOVQ R9, 8+z;\ - \ - MOVQ 0+x,AX; MULQ AX; MOVQ AX, 0+z; MOVQ DX, R9;\ - MOVQ 8+x,AX; MULQ AX; MOVQ AX, R10; MOVQ DX, R11;\ - MOVQ 16+x,AX; MULQ AX; MOVQ AX, R12; MOVQ DX, R13;\ - MOVQ 24+x,AX; MULQ AX; MOVQ AX, R14; MOVQ DX, R15;\ - \ - ADDQ 8+z, R9; MOVQ R9, 8+z;\ - ADCQ 16+z, R10; MOVQ R10, 16+z;\ - ADCQ 24+z, R11; MOVQ R11, 24+z;\ - ADCQ 32+z, R12; MOVQ R12, 32+z;\ - ADCQ 40+z, R13; MOVQ R13, 40+z;\ - ADCQ 48+z, R14; MOVQ R14, 48+z;\ - ADCQ 56+z, R15; MOVQ R15, 56+z; - -// integerSqrAdx squares x and stores in z -// Uses: AX, CX, DX, R8-R15, FLAGS -// Instr: x86_64, bmi2, adx -#define integerSqrAdx(z,x) \ - MOVQ 0+x, DX; /* A[0] */ \ - MULXQ 8+x, R8, R14; /* A[1]*A[0] */ XORL R15, R15; \ - MULXQ 16+x, R9, R10; /* A[2]*A[0] */ ADCXQ R14, R9; \ - MULXQ 24+x, AX, CX; /* A[3]*A[0] */ ADCXQ AX, R10; \ - MOVQ 24+x, DX; /* A[3] */ \ - MULXQ 8+x, R11, R12; /* A[1]*A[3] */ ADCXQ CX, R11; \ - MULXQ 16+x, AX, R13; /* A[2]*A[3] */ ADCXQ AX, R12; \ - MOVQ 8+x, DX; /* A[1] */ ADCXQ R15, R13; \ - MULXQ 16+x, AX, CX; /* A[2]*A[1] */ MOVL $0, R14; \ - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADCXQ R15, R14; \ - XORL R15, R15; \ - ADOXQ AX, R10; ADCXQ R8, R8; \ - ADOXQ CX, R11; ADCXQ R9, R9; \ - ADOXQ R15, R12; ADCXQ R10, R10; \ - ADOXQ R15, R13; ADCXQ R11, R11; \ - ADOXQ R15, R14; ADCXQ R12, R12; \ - ;;;;;;;;;;;;;;; ADCXQ R13, R13; \ - ;;;;;;;;;;;;;;; ADCXQ R14, R14; \ - MOVQ 0+x, DX; MULXQ DX, AX, CX; /* A[0]^2 */ \ - ;;;;;;;;;;;;;;; MOVQ AX, 0+z; \ - ADDQ CX, R8; MOVQ R8, 8+z; \ - MOVQ 8+x, DX; MULXQ DX, AX, CX; /* A[1]^2 */ \ - ADCQ AX, R9; MOVQ R9, 16+z; \ - ADCQ CX, R10; MOVQ R10, 24+z; \ - MOVQ 16+x, DX; MULXQ DX, AX, CX; /* A[2]^2 */ \ - ADCQ AX, R11; MOVQ R11, 32+z; \ - ADCQ CX, R12; MOVQ R12, 40+z; \ - MOVQ 24+x, DX; MULXQ DX, AX, CX; /* A[3]^2 */ \ - ADCQ AX, R13; MOVQ R13, 48+z; \ - ADCQ CX, R14; MOVQ R14, 56+z; - -// reduceFromDouble finds z congruent to x modulo p such that 0> 63) - // PUT BIT 255 IN CARRY FLAG AND CLEAR - x3 &^= 1 << 63 - - x0, c0 := bits.Add64(x0, cx, 0) - x1, c1 := bits.Add64(x1, 0, c0) - x2, c2 := bits.Add64(x2, 0, c1) - x3, _ = bits.Add64(x3, 0, c2) - - // TEST FOR BIT 255 AGAIN; ONLY TRIGGERED ON OVERFLOW MODULO 2^255-19 - // cx = C[255] ? 0 : 19 - cx = uint64(19) &^ (-(x3 >> 63)) - // CLEAR BIT 255 - x3 &^= 1 << 63 - - x0, c0 = bits.Sub64(x0, cx, 0) - x1, c1 = bits.Sub64(x1, 0, c0) - x2, c2 = bits.Sub64(x2, 0, c1) - x3, _ = bits.Sub64(x3, 0, c2) - - binary.LittleEndian.PutUint64(x[0*8:1*8], x0) - binary.LittleEndian.PutUint64(x[1*8:2*8], x1) - binary.LittleEndian.PutUint64(x[2*8:3*8], x2) - binary.LittleEndian.PutUint64(x[3*8:4*8], x3) -} - -func red64(z *Elt, x0, x1, x2, x3, x4, x5, x6, x7 uint64) { - h0, l0 := bits.Mul64(x4, 38) - h1, l1 := bits.Mul64(x5, 38) - h2, l2 := bits.Mul64(x6, 38) - h3, l3 := bits.Mul64(x7, 38) - - l1, c0 := bits.Add64(h0, l1, 0) - l2, c1 := bits.Add64(h1, l2, c0) - l3, c2 := bits.Add64(h2, l3, c1) - l4, _ := bits.Add64(h3, 0, c2) - - l0, c0 = bits.Add64(l0, x0, 0) - l1, c1 = bits.Add64(l1, x1, c0) - l2, c2 = bits.Add64(l2, x2, c1) - l3, c3 := bits.Add64(l3, x3, c2) - l4, _ = bits.Add64(l4, 0, c3) - - _, l4 = bits.Mul64(l4, 38) - l0, c0 = bits.Add64(l0, l4, 0) - z1, c1 := bits.Add64(l1, 0, c0) - z2, c2 := bits.Add64(l2, 0, c1) - z3, c3 := bits.Add64(l3, 0, c2) - z0, _ := bits.Add64(l0, (-c3)&38, 0) - - binary.LittleEndian.PutUint64(z[0*8:1*8], z0) - binary.LittleEndian.PutUint64(z[1*8:2*8], z1) - binary.LittleEndian.PutUint64(z[2*8:3*8], z2) - binary.LittleEndian.PutUint64(z[3*8:4*8], z3) -} diff --git a/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go b/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go deleted file mode 100644 index 26ca4d01b7..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp25519/fp_noasm.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !amd64 || purego -// +build !amd64 purego - -package fp25519 - -func cmov(x, y *Elt, n uint) { cmovGeneric(x, y, n) } -func cswap(x, y *Elt, n uint) { cswapGeneric(x, y, n) } -func add(z, x, y *Elt) { addGeneric(z, x, y) } -func sub(z, x, y *Elt) { subGeneric(z, x, y) } -func addsub(x, y *Elt) { addsubGeneric(x, y) } -func mul(z, x, y *Elt) { mulGeneric(z, x, y) } -func sqr(z, x *Elt) { sqrGeneric(z, x) } -func modp(z *Elt) { modpGeneric(z) } diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp.go b/vendor/github.com/cloudflare/circl/math/fp448/fp.go deleted file mode 100644 index a5e36600bb..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp.go +++ /dev/null @@ -1,164 +0,0 @@ -// Package fp448 provides prime field arithmetic over GF(2^448-2^224-1). -package fp448 - -import ( - "errors" - - "github.com/cloudflare/circl/internal/conv" -) - -// Size in bytes of an element. -const Size = 56 - -// Elt is a prime field element. -type Elt [Size]byte - -func (e Elt) String() string { return conv.BytesLe2Hex(e[:]) } - -// p is the prime modulus 2^448-2^224-1. -var p = Elt{ - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, -} - -// P returns the prime modulus 2^448-2^224-1. -func P() Elt { return p } - -// ToBytes stores in b the little-endian byte representation of x. -func ToBytes(b []byte, x *Elt) error { - if len(b) != Size { - return errors.New("wrong size") - } - Modp(x) - copy(b, x[:]) - return nil -} - -// IsZero returns true if x is equal to 0. -func IsZero(x *Elt) bool { Modp(x); return *x == Elt{} } - -// IsOne returns true if x is equal to 1. -func IsOne(x *Elt) bool { Modp(x); return *x == Elt{1} } - -// SetOne assigns x=1. -func SetOne(x *Elt) { *x = Elt{1} } - -// One returns the 1 element. -func One() (x Elt) { x = Elt{1}; return } - -// Neg calculates z = -x. -func Neg(z, x *Elt) { Sub(z, &p, x) } - -// Modp ensures that z is between [0,p-1]. -func Modp(z *Elt) { Sub(z, z, &p) } - -// InvSqrt calculates z = sqrt(x/y) iff x/y is a quadratic-residue. If so, -// isQR = true; otherwise, isQR = false, since x/y is a quadratic non-residue, -// and z = sqrt(-x/y). -func InvSqrt(z, x, y *Elt) (isQR bool) { - // First note that x^(2(k+1)) = x^(p-1)/2 * x = legendre(x) * x - // so that's x if x is a quadratic residue and -x otherwise. - // Next, y^(6k+3) = y^(4k+2) * y^(2k+1) = y^(p-1) * y^((p-1)/2) = legendre(y). - // So the z we compute satisfies z^2 y = x^(2(k+1)) y^(6k+3) = legendre(x)*legendre(y). - // Thus if x and y are quadratic residues, then z is indeed sqrt(x/y). - t0, t1 := &Elt{}, &Elt{} - Mul(t0, x, y) // x*y - Sqr(t1, y) // y^2 - Mul(t1, t0, t1) // x*y^3 - powPminus3div4(z, t1) // (x*y^3)^k - Mul(z, z, t0) // z = x*y*(x*y^3)^k = x^(k+1) * y^(3k+1) - - // Check if x/y is a quadratic residue - Sqr(t0, z) // z^2 - Mul(t0, t0, y) // y*z^2 - Sub(t0, t0, x) // y*z^2-x - return IsZero(t0) -} - -// Inv calculates z = 1/x mod p. -func Inv(z, x *Elt) { - // Calculates z = x^(4k+1) = x^(p-3+1) = x^(p-2) = x^-1, where k = (p-3)/4. - t := &Elt{} - powPminus3div4(t, x) // t = x^k - Sqr(t, t) // t = x^2k - Sqr(t, t) // t = x^4k - Mul(z, t, x) // z = x^(4k+1) -} - -// powPminus3div4 calculates z = x^k mod p, where k = (p-3)/4. -func powPminus3div4(z, x *Elt) { - x0, x1 := &Elt{}, &Elt{} - Sqr(z, x) - Mul(z, z, x) - Sqr(x0, z) - Mul(x0, x0, x) - Sqr(z, x0) - Sqr(z, z) - Sqr(z, z) - Mul(z, z, x0) - Sqr(x1, z) - for i := 0; i < 5; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, z) - Sqr(z, x1) - for i := 0; i < 11; i++ { - Sqr(z, z) - } - Mul(z, z, x1) - Sqr(z, z) - Sqr(z, z) - Sqr(z, z) - Mul(z, z, x0) - Sqr(x1, z) - for i := 0; i < 26; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, z) - Sqr(z, x1) - for i := 0; i < 53; i++ { - Sqr(z, z) - } - Mul(z, z, x1) - Sqr(z, z) - Sqr(z, z) - Sqr(z, z) - Mul(z, z, x0) - Sqr(x1, z) - for i := 0; i < 110; i++ { - Sqr(x1, x1) - } - Mul(x1, x1, z) - Sqr(z, x1) - Mul(z, z, x) - for i := 0; i < 223; i++ { - Sqr(z, z) - } - Mul(z, z, x1) -} - -// Cmov assigns y to x if n is 1. -func Cmov(x, y *Elt, n uint) { cmov(x, y, n) } - -// Cswap interchanges x and y if n is 1. -func Cswap(x, y *Elt, n uint) { cswap(x, y, n) } - -// Add calculates z = x+y mod p. -func Add(z, x, y *Elt) { add(z, x, y) } - -// Sub calculates z = x-y mod p. -func Sub(z, x, y *Elt) { sub(z, x, y) } - -// AddSub calculates (x,y) = (x+y mod p, x-y mod p). -func AddSub(x, y *Elt) { addsub(x, y) } - -// Mul calculates z = x*y mod p. -func Mul(z, x, y *Elt) { mul(z, x, y) } - -// Sqr calculates z = x^2 mod p. -func Sqr(z, x *Elt) { sqr(z, x) } diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go deleted file mode 100644 index 6a12209a70..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build amd64 && !purego -// +build amd64,!purego - -package fp448 - -import ( - "golang.org/x/sys/cpu" -) - -var hasBmi2Adx = cpu.X86.HasBMI2 && cpu.X86.HasADX - -var _ = hasBmi2Adx - -func cmov(x, y *Elt, n uint) { cmovAmd64(x, y, n) } -func cswap(x, y *Elt, n uint) { cswapAmd64(x, y, n) } -func add(z, x, y *Elt) { addAmd64(z, x, y) } -func sub(z, x, y *Elt) { subAmd64(z, x, y) } -func addsub(x, y *Elt) { addsubAmd64(x, y) } -func mul(z, x, y *Elt) { mulAmd64(z, x, y) } -func sqr(z, x *Elt) { sqrAmd64(z, x) } - -/* Functions defined in fp_amd64.s */ - -//go:noescape -func cmovAmd64(x, y *Elt, n uint) - -//go:noescape -func cswapAmd64(x, y *Elt, n uint) - -//go:noescape -func addAmd64(z, x, y *Elt) - -//go:noescape -func subAmd64(z, x, y *Elt) - -//go:noescape -func addsubAmd64(x, y *Elt) - -//go:noescape -func mulAmd64(z, x, y *Elt) - -//go:noescape -func sqrAmd64(z, x *Elt) diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h deleted file mode 100644 index 536fe5bdfe..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.h +++ /dev/null @@ -1,591 +0,0 @@ -// This code was imported from https://github.com/armfazh/rfc7748_precomputed - -// CHECK_BMI2ADX triggers bmi2adx if supported, -// otherwise it fallbacks to legacy code. -#define CHECK_BMI2ADX(label, legacy, bmi2adx) \ - CMPB ·hasBmi2Adx(SB), $0 \ - JE label \ - bmi2adx \ - RET \ - label: \ - legacy \ - RET - -// cselect is a conditional move -// if b=1: it copies y into x; -// if b=0: x remains with the same value; -// if b<> 0,1: undefined. -// Uses: AX, DX, FLAGS -// Instr: x86_64, cmov -#define cselect(x,y,b) \ - TESTQ b, b \ - MOVQ 0+x, AX; MOVQ 0+y, DX; CMOVQNE DX, AX; MOVQ AX, 0+x; \ - MOVQ 8+x, AX; MOVQ 8+y, DX; CMOVQNE DX, AX; MOVQ AX, 8+x; \ - MOVQ 16+x, AX; MOVQ 16+y, DX; CMOVQNE DX, AX; MOVQ AX, 16+x; \ - MOVQ 24+x, AX; MOVQ 24+y, DX; CMOVQNE DX, AX; MOVQ AX, 24+x; \ - MOVQ 32+x, AX; MOVQ 32+y, DX; CMOVQNE DX, AX; MOVQ AX, 32+x; \ - MOVQ 40+x, AX; MOVQ 40+y, DX; CMOVQNE DX, AX; MOVQ AX, 40+x; \ - MOVQ 48+x, AX; MOVQ 48+y, DX; CMOVQNE DX, AX; MOVQ AX, 48+x; - -// cswap is a conditional swap -// if b=1: x,y <- y,x; -// if b=0: x,y remain with the same values; -// if b<> 0,1: undefined. -// Uses: AX, DX, R8, FLAGS -// Instr: x86_64, cmov -#define cswap(x,y,b) \ - TESTQ b, b \ - MOVQ 0+x, AX; MOVQ AX, R8; MOVQ 0+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 0+x; MOVQ DX, 0+y; \ - MOVQ 8+x, AX; MOVQ AX, R8; MOVQ 8+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 8+x; MOVQ DX, 8+y; \ - MOVQ 16+x, AX; MOVQ AX, R8; MOVQ 16+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 16+x; MOVQ DX, 16+y; \ - MOVQ 24+x, AX; MOVQ AX, R8; MOVQ 24+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 24+x; MOVQ DX, 24+y; \ - MOVQ 32+x, AX; MOVQ AX, R8; MOVQ 32+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 32+x; MOVQ DX, 32+y; \ - MOVQ 40+x, AX; MOVQ AX, R8; MOVQ 40+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 40+x; MOVQ DX, 40+y; \ - MOVQ 48+x, AX; MOVQ AX, R8; MOVQ 48+y, DX; CMOVQNE DX, AX; CMOVQNE R8, DX; MOVQ AX, 48+x; MOVQ DX, 48+y; - -// additionLeg adds x and y and stores in z -// Uses: AX, DX, R8-R14, FLAGS -// Instr: x86_64 -#define additionLeg(z,x,y) \ - MOVQ 0+x, R8; ADDQ 0+y, R8; \ - MOVQ 8+x, R9; ADCQ 8+y, R9; \ - MOVQ 16+x, R10; ADCQ 16+y, R10; \ - MOVQ 24+x, R11; ADCQ 24+y, R11; \ - MOVQ 32+x, R12; ADCQ 32+y, R12; \ - MOVQ 40+x, R13; ADCQ 40+y, R13; \ - MOVQ 48+x, R14; ADCQ 48+y, R14; \ - MOVQ $0, AX; ADCQ $0, AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - ADDQ AX, R8; MOVQ $0, AX; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ DX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - ADCQ $0, AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - ADDQ AX, R8; MOVQ R8, 0+z; \ - ADCQ $0, R9; MOVQ R9, 8+z; \ - ADCQ $0, R10; MOVQ R10, 16+z; \ - ADCQ DX, R11; MOVQ R11, 24+z; \ - ADCQ $0, R12; MOVQ R12, 32+z; \ - ADCQ $0, R13; MOVQ R13, 40+z; \ - ADCQ $0, R14; MOVQ R14, 48+z; - - -// additionAdx adds x and y and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64, adx -#define additionAdx(z,x,y) \ - MOVL $32, R15; \ - XORL DX, DX; \ - MOVQ 0+x, R8; ADCXQ 0+y, R8; \ - MOVQ 8+x, R9; ADCXQ 8+y, R9; \ - MOVQ 16+x, R10; ADCXQ 16+y, R10; \ - MOVQ 24+x, R11; ADCXQ 24+y, R11; \ - MOVQ 32+x, R12; ADCXQ 32+y, R12; \ - MOVQ 40+x, R13; ADCXQ 40+y, R13; \ - MOVQ 48+x, R14; ADCXQ 48+y, R14; \ - ;;;;;;;;;;;;;;; ADCXQ DX, DX; \ - XORL AX, AX; \ - ADCXQ DX, R8; SHLXQ R15, DX, DX; \ - ADCXQ AX, R9; \ - ADCXQ AX, R10; \ - ADCXQ DX, R11; \ - ADCXQ AX, R12; \ - ADCXQ AX, R13; \ - ADCXQ AX, R14; \ - ADCXQ AX, AX; \ - XORL DX, DX; \ - ADCXQ AX, R8; MOVQ R8, 0+z; SHLXQ R15, AX, AX; \ - ADCXQ DX, R9; MOVQ R9, 8+z; \ - ADCXQ DX, R10; MOVQ R10, 16+z; \ - ADCXQ AX, R11; MOVQ R11, 24+z; \ - ADCXQ DX, R12; MOVQ R12, 32+z; \ - ADCXQ DX, R13; MOVQ R13, 40+z; \ - ADCXQ DX, R14; MOVQ R14, 48+z; - -// subtraction subtracts y from x and stores in z -// Uses: AX, DX, R8-R14, FLAGS -// Instr: x86_64 -#define subtraction(z,x,y) \ - MOVQ 0+x, R8; SUBQ 0+y, R8; \ - MOVQ 8+x, R9; SBBQ 8+y, R9; \ - MOVQ 16+x, R10; SBBQ 16+y, R10; \ - MOVQ 24+x, R11; SBBQ 24+y, R11; \ - MOVQ 32+x, R12; SBBQ 32+y, R12; \ - MOVQ 40+x, R13; SBBQ 40+y, R13; \ - MOVQ 48+x, R14; SBBQ 48+y, R14; \ - MOVQ $0, AX; SETCS AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - SUBQ AX, R8; MOVQ $0, AX; \ - SBBQ $0, R9; \ - SBBQ $0, R10; \ - SBBQ DX, R11; \ - SBBQ $0, R12; \ - SBBQ $0, R13; \ - SBBQ $0, R14; \ - SETCS AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - SUBQ AX, R8; MOVQ R8, 0+z; \ - SBBQ $0, R9; MOVQ R9, 8+z; \ - SBBQ $0, R10; MOVQ R10, 16+z; \ - SBBQ DX, R11; MOVQ R11, 24+z; \ - SBBQ $0, R12; MOVQ R12, 32+z; \ - SBBQ $0, R13; MOVQ R13, 40+z; \ - SBBQ $0, R14; MOVQ R14, 48+z; - -// maddBmi2Adx multiplies x and y and accumulates in z -// Uses: AX, DX, R15, FLAGS -// Instr: x86_64, bmi2, adx -#define maddBmi2Adx(z,x,y,i,r0,r1,r2,r3,r4,r5,r6) \ - MOVQ i+y, DX; XORL AX, AX; \ - MULXQ 0+x, AX, R8; ADOXQ AX, r0; ADCXQ R8, r1; MOVQ r0,i+z; \ - MULXQ 8+x, AX, r0; ADOXQ AX, r1; ADCXQ r0, r2; MOVQ $0, R8; \ - MULXQ 16+x, AX, r0; ADOXQ AX, r2; ADCXQ r0, r3; \ - MULXQ 24+x, AX, r0; ADOXQ AX, r3; ADCXQ r0, r4; \ - MULXQ 32+x, AX, r0; ADOXQ AX, r4; ADCXQ r0, r5; \ - MULXQ 40+x, AX, r0; ADOXQ AX, r5; ADCXQ r0, r6; \ - MULXQ 48+x, AX, r0; ADOXQ AX, r6; ADCXQ R8, r0; \ - ;;;;;;;;;;;;;;;;;;; ADOXQ R8, r0; - -// integerMulAdx multiplies x and y and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64, bmi2, adx -#define integerMulAdx(z,x,y) \ - MOVL $0,R15; \ - MOVQ 0+y, DX; XORL AX, AX; MOVQ $0, R8; \ - MULXQ 0+x, AX, R9; MOVQ AX, 0+z; \ - MULXQ 8+x, AX, R10; ADCXQ AX, R9; \ - MULXQ 16+x, AX, R11; ADCXQ AX, R10; \ - MULXQ 24+x, AX, R12; ADCXQ AX, R11; \ - MULXQ 32+x, AX, R13; ADCXQ AX, R12; \ - MULXQ 40+x, AX, R14; ADCXQ AX, R13; \ - MULXQ 48+x, AX, R15; ADCXQ AX, R14; \ - ;;;;;;;;;;;;;;;;;;;; ADCXQ R8, R15; \ - maddBmi2Adx(z,x,y, 8, R9,R10,R11,R12,R13,R14,R15) \ - maddBmi2Adx(z,x,y,16,R10,R11,R12,R13,R14,R15, R9) \ - maddBmi2Adx(z,x,y,24,R11,R12,R13,R14,R15, R9,R10) \ - maddBmi2Adx(z,x,y,32,R12,R13,R14,R15, R9,R10,R11) \ - maddBmi2Adx(z,x,y,40,R13,R14,R15, R9,R10,R11,R12) \ - maddBmi2Adx(z,x,y,48,R14,R15, R9,R10,R11,R12,R13) \ - MOVQ R15, 56+z; \ - MOVQ R9, 64+z; \ - MOVQ R10, 72+z; \ - MOVQ R11, 80+z; \ - MOVQ R12, 88+z; \ - MOVQ R13, 96+z; \ - MOVQ R14, 104+z; - -// maddLegacy multiplies x and y and accumulates in z -// Uses: AX, DX, R15, FLAGS -// Instr: x86_64 -#define maddLegacy(z,x,y,i) \ - MOVQ i+y, R15; \ - MOVQ 0+x, AX; MULQ R15; MOVQ AX, R8; ;;;;;;;;;;;; MOVQ DX, R9; \ - MOVQ 8+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \ - MOVQ 16+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \ - MOVQ 24+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \ - MOVQ 32+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \ - MOVQ 40+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \ - MOVQ 48+x, AX; MULQ R15; ADDQ AX, R14; ADCQ $0, DX; \ - ADDQ 0+i+z, R8; MOVQ R8, 0+i+z; \ - ADCQ 8+i+z, R9; MOVQ R9, 8+i+z; \ - ADCQ 16+i+z, R10; MOVQ R10, 16+i+z; \ - ADCQ 24+i+z, R11; MOVQ R11, 24+i+z; \ - ADCQ 32+i+z, R12; MOVQ R12, 32+i+z; \ - ADCQ 40+i+z, R13; MOVQ R13, 40+i+z; \ - ADCQ 48+i+z, R14; MOVQ R14, 48+i+z; \ - ADCQ $0, DX; MOVQ DX, 56+i+z; - -// integerMulLeg multiplies x and y and stores in z -// Uses: AX, DX, R8-R15, FLAGS -// Instr: x86_64 -#define integerMulLeg(z,x,y) \ - MOVQ 0+y, R15; \ - MOVQ 0+x, AX; MULQ R15; MOVQ AX, 0+z; ;;;;;;;;;;;; MOVQ DX, R8; \ - MOVQ 8+x, AX; MULQ R15; ADDQ AX, R8; ADCQ $0, DX; MOVQ DX, R9; MOVQ R8, 8+z; \ - MOVQ 16+x, AX; MULQ R15; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; MOVQ R9, 16+z; \ - MOVQ 24+x, AX; MULQ R15; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; MOVQ R10, 24+z; \ - MOVQ 32+x, AX; MULQ R15; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; MOVQ R11, 32+z; \ - MOVQ 40+x, AX; MULQ R15; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; MOVQ R12, 40+z; \ - MOVQ 48+x, AX; MULQ R15; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX,56+z; MOVQ R13, 48+z; \ - maddLegacy(z,x,y, 8) \ - maddLegacy(z,x,y,16) \ - maddLegacy(z,x,y,24) \ - maddLegacy(z,x,y,32) \ - maddLegacy(z,x,y,40) \ - maddLegacy(z,x,y,48) - -// integerSqrLeg squares x and stores in z -// Uses: AX, CX, DX, R8-R15, FLAGS -// Instr: x86_64 -#define integerSqrLeg(z,x) \ - XORL R15, R15; \ - MOVQ 0+x, CX; \ - MOVQ CX, AX; MULQ CX; MOVQ AX, 0+z; MOVQ DX, R8; \ - ADDQ CX, CX; ADCQ $0, R15; \ - MOVQ 8+x, AX; MULQ CX; ADDQ AX, R8; ADCQ $0, DX; MOVQ DX, R9; MOVQ R8, 8+z; \ - MOVQ 16+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ DX, R10; \ - MOVQ 24+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; MOVQ DX, R11; \ - MOVQ 32+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ DX, R12; \ - MOVQ 40+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; MOVQ DX, R13; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ DX, R14; \ - \ - MOVQ 8+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ R9,16+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 8+x, AX; ADDQ AX, DX; ADCQ $0, R11; MOVQ DX, R8; \ - ADDQ 8+x, CX; ADCQ $0, R15; \ - MOVQ 16+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX, R8; MOVQ R10, 24+z; \ - MOVQ 24+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; ADDQ R8, R11; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 32+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 40+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; ADDQ R8, R13; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R9; \ - \ - MOVQ 16+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ R11, 32+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 16+x,AX; ADDQ AX, DX; ADCQ $0, R13; MOVQ DX, R8; \ - ADDQ 16+x, CX; ADCQ $0, R15; \ - MOVQ 24+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; MOVQ R12, 40+z; \ - MOVQ 32+x, AX; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; ADDQ R8, R13; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 40+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; ADDQ R8, R9; ADCQ $0, DX; MOVQ DX,R10; \ - \ - MOVQ 24+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ R13, 48+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 24+x,AX; ADDQ AX, DX; ADCQ $0, R9; MOVQ DX, R8; \ - ADDQ 24+x, CX; ADCQ $0, R15; \ - MOVQ 32+x, AX; MULQ CX; ADDQ AX, R14; ADCQ $0, DX; ADDQ R8, R14; ADCQ $0, DX; MOVQ DX, R8; MOVQ R14, 56+z; \ - MOVQ 40+x, AX; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; ADDQ R8, R9; ADCQ $0, DX; MOVQ DX, R8; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX,R11; \ - \ - MOVQ 32+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R9; ADCQ $0, DX; MOVQ R9, 64+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 32+x,AX; ADDQ AX, DX; ADCQ $0, R11; MOVQ DX, R8; \ - ADDQ 32+x, CX; ADCQ $0, R15; \ - MOVQ 40+x, AX; MULQ CX; ADDQ AX, R10; ADCQ $0, DX; ADDQ R8, R10; ADCQ $0, DX; MOVQ DX, R8; MOVQ R10, 72+z; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; ADDQ R8, R11; ADCQ $0, DX; MOVQ DX,R12; \ - \ - XORL R13, R13; \ - XORL R14, R14; \ - MOVQ 40+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R11; ADCQ $0, DX; MOVQ R11, 80+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 40+x,AX; ADDQ AX, DX; ADCQ $0, R13; MOVQ DX, R8; \ - ADDQ 40+x, CX; ADCQ $0, R15; \ - MOVQ 48+x, AX; MULQ CX; ADDQ AX, R12; ADCQ $0, DX; ADDQ R8, R12; ADCQ $0, DX; MOVQ DX, R8; MOVQ R12, 88+z; \ - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADDQ R8, R13; ADCQ $0,R14; \ - \ - XORL R9, R9; \ - MOVQ 48+x, CX; \ - MOVQ CX, AX; ADDQ R15, CX; MOVQ $0, R15; ADCQ $0, R15; \ - ;;;;;;;;;;;;;; MULQ CX; ADDQ AX, R13; ADCQ $0, DX; MOVQ R13, 96+z; \ - MOVQ R15, AX; NEGQ AX; ANDQ 48+x,AX; ADDQ AX, DX; ADCQ $0, R9; MOVQ DX, R8; \ - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADDQ R8,R14; ADCQ $0, R9; MOVQ R14, 104+z; - - -// integerSqrAdx squares x and stores in z -// Uses: AX, CX, DX, R8-R15, FLAGS -// Instr: x86_64, bmi2, adx -#define integerSqrAdx(z,x) \ - XORL R15, R15; \ - MOVQ 0+x, DX; \ - ;;;;;;;;;;;;;; MULXQ DX, AX, R8; MOVQ AX, 0+z; \ - ADDQ DX, DX; ADCQ $0, R15; CLC; \ - MULXQ 8+x, AX, R9; ADCXQ AX, R8; MOVQ R8, 8+z; \ - MULXQ 16+x, AX, R10; ADCXQ AX, R9; MOVQ $0, R8;\ - MULXQ 24+x, AX, R11; ADCXQ AX, R10; \ - MULXQ 32+x, AX, R12; ADCXQ AX, R11; \ - MULXQ 40+x, AX, R13; ADCXQ AX, R12; \ - MULXQ 48+x, AX, R14; ADCXQ AX, R13; \ - ;;;;;;;;;;;;;;;;;;;; ADCXQ R8, R14; \ - \ - MOVQ 8+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 8+x, R8; \ - ADDQ AX, R9; MOVQ R9, 16+z; \ - ADCQ CX, R8; \ - ADCQ $0, R11; \ - ADDQ 8+x, DX; \ - ADCQ $0, R15; \ - XORL R9, R9; ;;;;;;;;;;;;;;;;;;;;; ADOXQ R8, R10; \ - MULXQ 16+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; MOVQ R10, 24+z; \ - MULXQ 24+x, AX, CX; ADCXQ AX, R11; ADOXQ CX, R12; MOVQ $0, R10; \ - MULXQ 32+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; \ - MULXQ 40+x, AX, CX; ADCXQ AX, R13; ADOXQ CX, R14; \ - MULXQ 48+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; \ - ;;;;;;;;;;;;;;;;;;; ADCXQ R10, R9; \ - \ - MOVQ 16+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 16+x, R8; \ - ADDQ AX, R11; MOVQ R11, 32+z; \ - ADCQ CX, R8; \ - ADCQ $0, R13; \ - ADDQ 16+x, DX; \ - ADCQ $0, R15; \ - XORL R11, R11; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R12; \ - MULXQ 24+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; MOVQ R12, 40+z; \ - MULXQ 32+x, AX, CX; ADCXQ AX, R13; ADOXQ CX, R14; MOVQ $0, R12; \ - MULXQ 40+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; \ - MULXQ 48+x, AX, CX; ADCXQ AX, R9; ADOXQ CX, R10; \ - ;;;;;;;;;;;;;;;;;;; ADCXQ R11,R10; \ - \ - MOVQ 24+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 24+x, R8; \ - ADDQ AX, R13; MOVQ R13, 48+z; \ - ADCQ CX, R8; \ - ADCQ $0, R9; \ - ADDQ 24+x, DX; \ - ADCQ $0, R15; \ - XORL R13, R13; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R14; \ - MULXQ 32+x, AX, CX; ADCXQ AX, R14; ADOXQ CX, R9; MOVQ R14, 56+z; \ - MULXQ 40+x, AX, CX; ADCXQ AX, R9; ADOXQ CX, R10; MOVQ $0, R14; \ - MULXQ 48+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; \ - ;;;;;;;;;;;;;;;;;;; ADCXQ R12,R11; \ - \ - MOVQ 32+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 32+x, R8; \ - ADDQ AX, R9; MOVQ R9, 64+z; \ - ADCQ CX, R8; \ - ADCQ $0, R11; \ - ADDQ 32+x, DX; \ - ADCQ $0, R15; \ - XORL R9, R9; ;;;;;;;;;;;;;;;;;;;;; ADOXQ R8, R10; \ - MULXQ 40+x, AX, CX; ADCXQ AX, R10; ADOXQ CX, R11; MOVQ R10, 72+z; \ - MULXQ 48+x, AX, CX; ADCXQ AX, R11; ADOXQ CX, R12; \ - ;;;;;;;;;;;;;;;;;;; ADCXQ R13,R12; \ - \ - MOVQ 40+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 40+x, R8; \ - ADDQ AX, R11; MOVQ R11, 80+z; \ - ADCQ CX, R8; \ - ADCQ $0, R13; \ - ADDQ 40+x, DX; \ - ADCQ $0, R15; \ - XORL R11, R11; ;;;;;;;;;;;;;;;;;;; ADOXQ R8, R12; \ - MULXQ 48+x, AX, CX; ADCXQ AX, R12; ADOXQ CX, R13; MOVQ R12, 88+z; \ - ;;;;;;;;;;;;;;;;;;; ADCXQ R14,R13; \ - \ - MOVQ 48+x, DX; \ - MOVQ DX, AX; ADDQ R15, DX; MOVQ $0, R15; ADCQ $0, R15; \ - MULXQ AX, AX, CX; \ - MOVQ R15, R8; NEGQ R8; ANDQ 48+x, R8; \ - XORL R10, R10; ;;;;;;;;;;;;;; ADOXQ CX, R14; \ - ;;;;;;;;;;;;;; ADCXQ AX, R13; ;;;;;;;;;;;;;; MOVQ R13, 96+z; \ - ;;;;;;;;;;;;;; ADCXQ R8, R14; MOVQ R14, 104+z; - -// reduceFromDoubleLeg finds a z=x modulo p such that z<2^448 and stores in z -// Uses: AX, R8-R15, FLAGS -// Instr: x86_64 -#define reduceFromDoubleLeg(z,x) \ - /* ( ,2C13,2C12,2C11,2C10|C10,C9,C8, C7) + (C6,...,C0) */ \ - /* (r14, r13, r12, r11, r10,r9,r8,r15) */ \ - MOVQ 80+x,AX; MOVQ AX,R10; \ - MOVQ $0xFFFFFFFF00000000, R8; \ - ANDQ R8,R10; \ - \ - MOVQ $0,R14; \ - MOVQ 104+x,R13; SHLQ $1,R13,R14; \ - MOVQ 96+x,R12; SHLQ $1,R12,R13; \ - MOVQ 88+x,R11; SHLQ $1,R11,R12; \ - MOVQ 72+x, R9; SHLQ $1,R10,R11; \ - MOVQ 64+x, R8; SHLQ $1,R10; \ - MOVQ $0xFFFFFFFF,R15; ANDQ R15,AX; ORQ AX,R10; \ - MOVQ 56+x,R15; \ - \ - ADDQ 0+x,R15; MOVQ R15, 0+z; MOVQ 56+x,R15; \ - ADCQ 8+x, R8; MOVQ R8, 8+z; MOVQ 64+x, R8; \ - ADCQ 16+x, R9; MOVQ R9,16+z; MOVQ 72+x, R9; \ - ADCQ 24+x,R10; MOVQ R10,24+z; MOVQ 80+x,R10; \ - ADCQ 32+x,R11; MOVQ R11,32+z; MOVQ 88+x,R11; \ - ADCQ 40+x,R12; MOVQ R12,40+z; MOVQ 96+x,R12; \ - ADCQ 48+x,R13; MOVQ R13,48+z; MOVQ 104+x,R13; \ - ADCQ $0,R14; \ - /* (c10c9,c9c8,c8c7,c7c13,c13c12,c12c11,c11c10) + (c6,...,c0) */ \ - /* ( r9, r8, r15, r13, r12, r11, r10) */ \ - MOVQ R10, AX; \ - SHRQ $32,R11,R10; \ - SHRQ $32,R12,R11; \ - SHRQ $32,R13,R12; \ - SHRQ $32,R15,R13; \ - SHRQ $32, R8,R15; \ - SHRQ $32, R9, R8; \ - SHRQ $32, AX, R9; \ - \ - ADDQ 0+z,R10; \ - ADCQ 8+z,R11; \ - ADCQ 16+z,R12; \ - ADCQ 24+z,R13; \ - ADCQ 32+z,R15; \ - ADCQ 40+z, R8; \ - ADCQ 48+z, R9; \ - ADCQ $0,R14; \ - /* ( c7) + (c6,...,c0) */ \ - /* (r14) */ \ - MOVQ R14, AX; SHLQ $32, AX; \ - ADDQ R14,R10; MOVQ $0,R14; \ - ADCQ $0,R11; \ - ADCQ $0,R12; \ - ADCQ AX,R13; \ - ADCQ $0,R15; \ - ADCQ $0, R8; \ - ADCQ $0, R9; \ - ADCQ $0,R14; \ - /* ( c7) + (c6,...,c0) */ \ - /* (r14) */ \ - MOVQ R14, AX; SHLQ $32,AX; \ - ADDQ R14,R10; MOVQ R10, 0+z; \ - ADCQ $0,R11; MOVQ R11, 8+z; \ - ADCQ $0,R12; MOVQ R12,16+z; \ - ADCQ AX,R13; MOVQ R13,24+z; \ - ADCQ $0,R15; MOVQ R15,32+z; \ - ADCQ $0, R8; MOVQ R8,40+z; \ - ADCQ $0, R9; MOVQ R9,48+z; - -// reduceFromDoubleAdx finds a z=x modulo p such that z<2^448 and stores in z -// Uses: AX, R8-R15, FLAGS -// Instr: x86_64, adx -#define reduceFromDoubleAdx(z,x) \ - /* ( ,2C13,2C12,2C11,2C10|C10,C9,C8, C7) + (C6,...,C0) */ \ - /* (r14, r13, r12, r11, r10,r9,r8,r15) */ \ - MOVQ 80+x,AX; MOVQ AX,R10; \ - MOVQ $0xFFFFFFFF00000000, R8; \ - ANDQ R8,R10; \ - \ - MOVQ $0,R14; \ - MOVQ 104+x,R13; SHLQ $1,R13,R14; \ - MOVQ 96+x,R12; SHLQ $1,R12,R13; \ - MOVQ 88+x,R11; SHLQ $1,R11,R12; \ - MOVQ 72+x, R9; SHLQ $1,R10,R11; \ - MOVQ 64+x, R8; SHLQ $1,R10; \ - MOVQ $0xFFFFFFFF,R15; ANDQ R15,AX; ORQ AX,R10; \ - MOVQ 56+x,R15; \ - \ - XORL AX,AX; \ - ADCXQ 0+x,R15; MOVQ R15, 0+z; MOVQ 56+x,R15; \ - ADCXQ 8+x, R8; MOVQ R8, 8+z; MOVQ 64+x, R8; \ - ADCXQ 16+x, R9; MOVQ R9,16+z; MOVQ 72+x, R9; \ - ADCXQ 24+x,R10; MOVQ R10,24+z; MOVQ 80+x,R10; \ - ADCXQ 32+x,R11; MOVQ R11,32+z; MOVQ 88+x,R11; \ - ADCXQ 40+x,R12; MOVQ R12,40+z; MOVQ 96+x,R12; \ - ADCXQ 48+x,R13; MOVQ R13,48+z; MOVQ 104+x,R13; \ - ADCXQ AX,R14; \ - /* (c10c9,c9c8,c8c7,c7c13,c13c12,c12c11,c11c10) + (c6,...,c0) */ \ - /* ( r9, r8, r15, r13, r12, r11, r10) */ \ - MOVQ R10, AX; \ - SHRQ $32,R11,R10; \ - SHRQ $32,R12,R11; \ - SHRQ $32,R13,R12; \ - SHRQ $32,R15,R13; \ - SHRQ $32, R8,R15; \ - SHRQ $32, R9, R8; \ - SHRQ $32, AX, R9; \ - \ - XORL AX,AX; \ - ADCXQ 0+z,R10; \ - ADCXQ 8+z,R11; \ - ADCXQ 16+z,R12; \ - ADCXQ 24+z,R13; \ - ADCXQ 32+z,R15; \ - ADCXQ 40+z, R8; \ - ADCXQ 48+z, R9; \ - ADCXQ AX,R14; \ - /* ( c7) + (c6,...,c0) */ \ - /* (r14) */ \ - MOVQ R14, AX; SHLQ $32, AX; \ - CLC; \ - ADCXQ R14,R10; MOVQ $0,R14; \ - ADCXQ R14,R11; \ - ADCXQ R14,R12; \ - ADCXQ AX,R13; \ - ADCXQ R14,R15; \ - ADCXQ R14, R8; \ - ADCXQ R14, R9; \ - ADCXQ R14,R14; \ - /* ( c7) + (c6,...,c0) */ \ - /* (r14) */ \ - MOVQ R14, AX; SHLQ $32, AX; \ - CLC; \ - ADCXQ R14,R10; MOVQ R10, 0+z; MOVQ $0,R14; \ - ADCXQ R14,R11; MOVQ R11, 8+z; \ - ADCXQ R14,R12; MOVQ R12,16+z; \ - ADCXQ AX,R13; MOVQ R13,24+z; \ - ADCXQ R14,R15; MOVQ R15,32+z; \ - ADCXQ R14, R8; MOVQ R8,40+z; \ - ADCXQ R14, R9; MOVQ R9,48+z; - -// addSub calculates two operations: x,y = x+y,x-y -// Uses: AX, DX, R8-R15, FLAGS -#define addSub(x,y) \ - MOVQ 0+x, R8; ADDQ 0+y, R8; \ - MOVQ 8+x, R9; ADCQ 8+y, R9; \ - MOVQ 16+x, R10; ADCQ 16+y, R10; \ - MOVQ 24+x, R11; ADCQ 24+y, R11; \ - MOVQ 32+x, R12; ADCQ 32+y, R12; \ - MOVQ 40+x, R13; ADCQ 40+y, R13; \ - MOVQ 48+x, R14; ADCQ 48+y, R14; \ - MOVQ $0, AX; ADCQ $0, AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - ADDQ AX, R8; MOVQ $0, AX; \ - ADCQ $0, R9; \ - ADCQ $0, R10; \ - ADCQ DX, R11; \ - ADCQ $0, R12; \ - ADCQ $0, R13; \ - ADCQ $0, R14; \ - ADCQ $0, AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - ADDQ AX, R8; MOVQ 0+x,AX; MOVQ R8, 0+x; MOVQ AX, R8; \ - ADCQ $0, R9; MOVQ 8+x,AX; MOVQ R9, 8+x; MOVQ AX, R9; \ - ADCQ $0, R10; MOVQ 16+x,AX; MOVQ R10, 16+x; MOVQ AX, R10; \ - ADCQ DX, R11; MOVQ 24+x,AX; MOVQ R11, 24+x; MOVQ AX, R11; \ - ADCQ $0, R12; MOVQ 32+x,AX; MOVQ R12, 32+x; MOVQ AX, R12; \ - ADCQ $0, R13; MOVQ 40+x,AX; MOVQ R13, 40+x; MOVQ AX, R13; \ - ADCQ $0, R14; MOVQ 48+x,AX; MOVQ R14, 48+x; MOVQ AX, R14; \ - SUBQ 0+y, R8; \ - SBBQ 8+y, R9; \ - SBBQ 16+y, R10; \ - SBBQ 24+y, R11; \ - SBBQ 32+y, R12; \ - SBBQ 40+y, R13; \ - SBBQ 48+y, R14; \ - MOVQ $0, AX; SETCS AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - SUBQ AX, R8; MOVQ $0, AX; \ - SBBQ $0, R9; \ - SBBQ $0, R10; \ - SBBQ DX, R11; \ - SBBQ $0, R12; \ - SBBQ $0, R13; \ - SBBQ $0, R14; \ - SETCS AX; \ - MOVQ AX, DX; \ - SHLQ $32, DX; \ - SUBQ AX, R8; MOVQ R8, 0+y; \ - SBBQ $0, R9; MOVQ R9, 8+y; \ - SBBQ $0, R10; MOVQ R10, 16+y; \ - SBBQ DX, R11; MOVQ R11, 24+y; \ - SBBQ $0, R12; MOVQ R12, 32+y; \ - SBBQ $0, R13; MOVQ R13, 40+y; \ - SBBQ $0, R14; MOVQ R14, 48+y; diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s b/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s deleted file mode 100644 index 435addf5e6..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp_amd64.s +++ /dev/null @@ -1,74 +0,0 @@ -// +build amd64 - -#include "textflag.h" -#include "fp_amd64.h" - -// func cmovAmd64(x, y *Elt, n uint) -TEXT ·cmovAmd64(SB),NOSPLIT,$0-24 - MOVQ x+0(FP), DI - MOVQ y+8(FP), SI - MOVQ n+16(FP), BX - cselect(0(DI),0(SI),BX) - RET - -// func cswapAmd64(x, y *Elt, n uint) -TEXT ·cswapAmd64(SB),NOSPLIT,$0-24 - MOVQ x+0(FP), DI - MOVQ y+8(FP), SI - MOVQ n+16(FP), BX - cswap(0(DI),0(SI),BX) - RET - -// func subAmd64(z, x, y *Elt) -TEXT ·subAmd64(SB),NOSPLIT,$0-24 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - MOVQ y+16(FP), BX - subtraction(0(DI),0(SI),0(BX)) - RET - -// func addsubAmd64(x, y *Elt) -TEXT ·addsubAmd64(SB),NOSPLIT,$0-16 - MOVQ x+0(FP), DI - MOVQ y+8(FP), SI - addSub(0(DI),0(SI)) - RET - -#define addLegacy \ - additionLeg(0(DI),0(SI),0(BX)) -#define addBmi2Adx \ - additionAdx(0(DI),0(SI),0(BX)) - -#define mulLegacy \ - integerMulLeg(0(SP),0(SI),0(BX)) \ - reduceFromDoubleLeg(0(DI),0(SP)) -#define mulBmi2Adx \ - integerMulAdx(0(SP),0(SI),0(BX)) \ - reduceFromDoubleAdx(0(DI),0(SP)) - -#define sqrLegacy \ - integerSqrLeg(0(SP),0(SI)) \ - reduceFromDoubleLeg(0(DI),0(SP)) -#define sqrBmi2Adx \ - integerSqrAdx(0(SP),0(SI)) \ - reduceFromDoubleAdx(0(DI),0(SP)) - -// func addAmd64(z, x, y *Elt) -TEXT ·addAmd64(SB),NOSPLIT,$0-24 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - MOVQ y+16(FP), BX - CHECK_BMI2ADX(LADD, addLegacy, addBmi2Adx) - -// func mulAmd64(z, x, y *Elt) -TEXT ·mulAmd64(SB),NOSPLIT,$112-24 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - MOVQ y+16(FP), BX - CHECK_BMI2ADX(LMUL, mulLegacy, mulBmi2Adx) - -// func sqrAmd64(z, x *Elt) -TEXT ·sqrAmd64(SB),NOSPLIT,$112-16 - MOVQ z+0(FP), DI - MOVQ x+8(FP), SI - CHECK_BMI2ADX(LSQR, sqrLegacy, sqrBmi2Adx) diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go deleted file mode 100644 index 47a0b63205..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp_generic.go +++ /dev/null @@ -1,339 +0,0 @@ -package fp448 - -import ( - "encoding/binary" - "math/bits" -) - -func cmovGeneric(x, y *Elt, n uint) { - m := -uint64(n & 0x1) - x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8]) - x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8]) - x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8]) - x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8]) - x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8]) - x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8]) - x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8]) - - y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8]) - y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8]) - y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8]) - y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8]) - y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8]) - y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8]) - y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8]) - - x0 = (x0 &^ m) | (y0 & m) - x1 = (x1 &^ m) | (y1 & m) - x2 = (x2 &^ m) | (y2 & m) - x3 = (x3 &^ m) | (y3 & m) - x4 = (x4 &^ m) | (y4 & m) - x5 = (x5 &^ m) | (y5 & m) - x6 = (x6 &^ m) | (y6 & m) - - binary.LittleEndian.PutUint64(x[0*8:1*8], x0) - binary.LittleEndian.PutUint64(x[1*8:2*8], x1) - binary.LittleEndian.PutUint64(x[2*8:3*8], x2) - binary.LittleEndian.PutUint64(x[3*8:4*8], x3) - binary.LittleEndian.PutUint64(x[4*8:5*8], x4) - binary.LittleEndian.PutUint64(x[5*8:6*8], x5) - binary.LittleEndian.PutUint64(x[6*8:7*8], x6) -} - -func cswapGeneric(x, y *Elt, n uint) { - m := -uint64(n & 0x1) - x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8]) - x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8]) - x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8]) - x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8]) - x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8]) - x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8]) - x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8]) - - y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8]) - y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8]) - y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8]) - y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8]) - y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8]) - y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8]) - y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8]) - - t0 := m & (x0 ^ y0) - t1 := m & (x1 ^ y1) - t2 := m & (x2 ^ y2) - t3 := m & (x3 ^ y3) - t4 := m & (x4 ^ y4) - t5 := m & (x5 ^ y5) - t6 := m & (x6 ^ y6) - x0 ^= t0 - x1 ^= t1 - x2 ^= t2 - x3 ^= t3 - x4 ^= t4 - x5 ^= t5 - x6 ^= t6 - y0 ^= t0 - y1 ^= t1 - y2 ^= t2 - y3 ^= t3 - y4 ^= t4 - y5 ^= t5 - y6 ^= t6 - - binary.LittleEndian.PutUint64(x[0*8:1*8], x0) - binary.LittleEndian.PutUint64(x[1*8:2*8], x1) - binary.LittleEndian.PutUint64(x[2*8:3*8], x2) - binary.LittleEndian.PutUint64(x[3*8:4*8], x3) - binary.LittleEndian.PutUint64(x[4*8:5*8], x4) - binary.LittleEndian.PutUint64(x[5*8:6*8], x5) - binary.LittleEndian.PutUint64(x[6*8:7*8], x6) - - binary.LittleEndian.PutUint64(y[0*8:1*8], y0) - binary.LittleEndian.PutUint64(y[1*8:2*8], y1) - binary.LittleEndian.PutUint64(y[2*8:3*8], y2) - binary.LittleEndian.PutUint64(y[3*8:4*8], y3) - binary.LittleEndian.PutUint64(y[4*8:5*8], y4) - binary.LittleEndian.PutUint64(y[5*8:6*8], y5) - binary.LittleEndian.PutUint64(y[6*8:7*8], y6) -} - -func addGeneric(z, x, y *Elt) { - x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8]) - x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8]) - x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8]) - x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8]) - x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8]) - x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8]) - x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8]) - - y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8]) - y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8]) - y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8]) - y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8]) - y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8]) - y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8]) - y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8]) - - z0, c0 := bits.Add64(x0, y0, 0) - z1, c1 := bits.Add64(x1, y1, c0) - z2, c2 := bits.Add64(x2, y2, c1) - z3, c3 := bits.Add64(x3, y3, c2) - z4, c4 := bits.Add64(x4, y4, c3) - z5, c5 := bits.Add64(x5, y5, c4) - z6, z7 := bits.Add64(x6, y6, c5) - - z0, c0 = bits.Add64(z0, z7, 0) - z1, c1 = bits.Add64(z1, 0, c0) - z2, c2 = bits.Add64(z2, 0, c1) - z3, c3 = bits.Add64(z3, z7<<32, c2) - z4, c4 = bits.Add64(z4, 0, c3) - z5, c5 = bits.Add64(z5, 0, c4) - z6, z7 = bits.Add64(z6, 0, c5) - - z0, c0 = bits.Add64(z0, z7, 0) - z1, c1 = bits.Add64(z1, 0, c0) - z2, c2 = bits.Add64(z2, 0, c1) - z3, c3 = bits.Add64(z3, z7<<32, c2) - z4, c4 = bits.Add64(z4, 0, c3) - z5, c5 = bits.Add64(z5, 0, c4) - z6, _ = bits.Add64(z6, 0, c5) - - binary.LittleEndian.PutUint64(z[0*8:1*8], z0) - binary.LittleEndian.PutUint64(z[1*8:2*8], z1) - binary.LittleEndian.PutUint64(z[2*8:3*8], z2) - binary.LittleEndian.PutUint64(z[3*8:4*8], z3) - binary.LittleEndian.PutUint64(z[4*8:5*8], z4) - binary.LittleEndian.PutUint64(z[5*8:6*8], z5) - binary.LittleEndian.PutUint64(z[6*8:7*8], z6) -} - -func subGeneric(z, x, y *Elt) { - x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8]) - x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8]) - x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8]) - x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8]) - x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8]) - x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8]) - x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8]) - - y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8]) - y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8]) - y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8]) - y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8]) - y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8]) - y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8]) - y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8]) - - z0, c0 := bits.Sub64(x0, y0, 0) - z1, c1 := bits.Sub64(x1, y1, c0) - z2, c2 := bits.Sub64(x2, y2, c1) - z3, c3 := bits.Sub64(x3, y3, c2) - z4, c4 := bits.Sub64(x4, y4, c3) - z5, c5 := bits.Sub64(x5, y5, c4) - z6, z7 := bits.Sub64(x6, y6, c5) - - z0, c0 = bits.Sub64(z0, z7, 0) - z1, c1 = bits.Sub64(z1, 0, c0) - z2, c2 = bits.Sub64(z2, 0, c1) - z3, c3 = bits.Sub64(z3, z7<<32, c2) - z4, c4 = bits.Sub64(z4, 0, c3) - z5, c5 = bits.Sub64(z5, 0, c4) - z6, z7 = bits.Sub64(z6, 0, c5) - - z0, c0 = bits.Sub64(z0, z7, 0) - z1, c1 = bits.Sub64(z1, 0, c0) - z2, c2 = bits.Sub64(z2, 0, c1) - z3, c3 = bits.Sub64(z3, z7<<32, c2) - z4, c4 = bits.Sub64(z4, 0, c3) - z5, c5 = bits.Sub64(z5, 0, c4) - z6, _ = bits.Sub64(z6, 0, c5) - - binary.LittleEndian.PutUint64(z[0*8:1*8], z0) - binary.LittleEndian.PutUint64(z[1*8:2*8], z1) - binary.LittleEndian.PutUint64(z[2*8:3*8], z2) - binary.LittleEndian.PutUint64(z[3*8:4*8], z3) - binary.LittleEndian.PutUint64(z[4*8:5*8], z4) - binary.LittleEndian.PutUint64(z[5*8:6*8], z5) - binary.LittleEndian.PutUint64(z[6*8:7*8], z6) -} - -func addsubGeneric(x, y *Elt) { - z := &Elt{} - addGeneric(z, x, y) - subGeneric(y, x, y) - *x = *z -} - -func mulGeneric(z, x, y *Elt) { - x0 := binary.LittleEndian.Uint64(x[0*8 : 1*8]) - x1 := binary.LittleEndian.Uint64(x[1*8 : 2*8]) - x2 := binary.LittleEndian.Uint64(x[2*8 : 3*8]) - x3 := binary.LittleEndian.Uint64(x[3*8 : 4*8]) - x4 := binary.LittleEndian.Uint64(x[4*8 : 5*8]) - x5 := binary.LittleEndian.Uint64(x[5*8 : 6*8]) - x6 := binary.LittleEndian.Uint64(x[6*8 : 7*8]) - - y0 := binary.LittleEndian.Uint64(y[0*8 : 1*8]) - y1 := binary.LittleEndian.Uint64(y[1*8 : 2*8]) - y2 := binary.LittleEndian.Uint64(y[2*8 : 3*8]) - y3 := binary.LittleEndian.Uint64(y[3*8 : 4*8]) - y4 := binary.LittleEndian.Uint64(y[4*8 : 5*8]) - y5 := binary.LittleEndian.Uint64(y[5*8 : 6*8]) - y6 := binary.LittleEndian.Uint64(y[6*8 : 7*8]) - - yy := [7]uint64{y0, y1, y2, y3, y4, y5, y6} - zz := [7]uint64{} - - yi := yy[0] - h0, l0 := bits.Mul64(x0, yi) - h1, l1 := bits.Mul64(x1, yi) - h2, l2 := bits.Mul64(x2, yi) - h3, l3 := bits.Mul64(x3, yi) - h4, l4 := bits.Mul64(x4, yi) - h5, l5 := bits.Mul64(x5, yi) - h6, l6 := bits.Mul64(x6, yi) - - zz[0] = l0 - a0, c0 := bits.Add64(h0, l1, 0) - a1, c1 := bits.Add64(h1, l2, c0) - a2, c2 := bits.Add64(h2, l3, c1) - a3, c3 := bits.Add64(h3, l4, c2) - a4, c4 := bits.Add64(h4, l5, c3) - a5, c5 := bits.Add64(h5, l6, c4) - a6, _ := bits.Add64(h6, 0, c5) - - for i := 1; i < 7; i++ { - yi = yy[i] - h0, l0 = bits.Mul64(x0, yi) - h1, l1 = bits.Mul64(x1, yi) - h2, l2 = bits.Mul64(x2, yi) - h3, l3 = bits.Mul64(x3, yi) - h4, l4 = bits.Mul64(x4, yi) - h5, l5 = bits.Mul64(x5, yi) - h6, l6 = bits.Mul64(x6, yi) - - zz[i], c0 = bits.Add64(a0, l0, 0) - a0, c1 = bits.Add64(a1, l1, c0) - a1, c2 = bits.Add64(a2, l2, c1) - a2, c3 = bits.Add64(a3, l3, c2) - a3, c4 = bits.Add64(a4, l4, c3) - a4, c5 = bits.Add64(a5, l5, c4) - a5, a6 = bits.Add64(a6, l6, c5) - - a0, c0 = bits.Add64(a0, h0, 0) - a1, c1 = bits.Add64(a1, h1, c0) - a2, c2 = bits.Add64(a2, h2, c1) - a3, c3 = bits.Add64(a3, h3, c2) - a4, c4 = bits.Add64(a4, h4, c3) - a5, c5 = bits.Add64(a5, h5, c4) - a6, _ = bits.Add64(a6, h6, c5) - } - red64(z, &zz, &[7]uint64{a0, a1, a2, a3, a4, a5, a6}) -} - -func sqrGeneric(z, x *Elt) { mulGeneric(z, x, x) } - -func red64(z *Elt, l, h *[7]uint64) { - /* (2C13, 2C12, 2C11, 2C10|C10, C9, C8, C7) + (C6,...,C0) */ - h0 := h[0] - h1 := h[1] - h2 := h[2] - h3 := ((h[3] & (0xFFFFFFFF << 32)) << 1) | (h[3] & 0xFFFFFFFF) - h4 := (h[3] >> 63) | (h[4] << 1) - h5 := (h[4] >> 63) | (h[5] << 1) - h6 := (h[5] >> 63) | (h[6] << 1) - h7 := (h[6] >> 63) - - l0, c0 := bits.Add64(h0, l[0], 0) - l1, c1 := bits.Add64(h1, l[1], c0) - l2, c2 := bits.Add64(h2, l[2], c1) - l3, c3 := bits.Add64(h3, l[3], c2) - l4, c4 := bits.Add64(h4, l[4], c3) - l5, c5 := bits.Add64(h5, l[5], c4) - l6, c6 := bits.Add64(h6, l[6], c5) - l7, _ := bits.Add64(h7, 0, c6) - - /* (C10C9, C9C8,C8C7,C7C13,C13C12,C12C11,C11C10) + (C6,...,C0) */ - h0 = (h[3] >> 32) | (h[4] << 32) - h1 = (h[4] >> 32) | (h[5] << 32) - h2 = (h[5] >> 32) | (h[6] << 32) - h3 = (h[6] >> 32) | (h[0] << 32) - h4 = (h[0] >> 32) | (h[1] << 32) - h5 = (h[1] >> 32) | (h[2] << 32) - h6 = (h[2] >> 32) | (h[3] << 32) - - l0, c0 = bits.Add64(l0, h0, 0) - l1, c1 = bits.Add64(l1, h1, c0) - l2, c2 = bits.Add64(l2, h2, c1) - l3, c3 = bits.Add64(l3, h3, c2) - l4, c4 = bits.Add64(l4, h4, c3) - l5, c5 = bits.Add64(l5, h5, c4) - l6, c6 = bits.Add64(l6, h6, c5) - l7, _ = bits.Add64(l7, 0, c6) - - /* (C7) + (C6,...,C0) */ - l0, c0 = bits.Add64(l0, l7, 0) - l1, c1 = bits.Add64(l1, 0, c0) - l2, c2 = bits.Add64(l2, 0, c1) - l3, c3 = bits.Add64(l3, l7<<32, c2) - l4, c4 = bits.Add64(l4, 0, c3) - l5, c5 = bits.Add64(l5, 0, c4) - l6, l7 = bits.Add64(l6, 0, c5) - - /* (C7) + (C6,...,C0) */ - l0, c0 = bits.Add64(l0, l7, 0) - l1, c1 = bits.Add64(l1, 0, c0) - l2, c2 = bits.Add64(l2, 0, c1) - l3, c3 = bits.Add64(l3, l7<<32, c2) - l4, c4 = bits.Add64(l4, 0, c3) - l5, c5 = bits.Add64(l5, 0, c4) - l6, _ = bits.Add64(l6, 0, c5) - - binary.LittleEndian.PutUint64(z[0*8:1*8], l0) - binary.LittleEndian.PutUint64(z[1*8:2*8], l1) - binary.LittleEndian.PutUint64(z[2*8:3*8], l2) - binary.LittleEndian.PutUint64(z[3*8:4*8], l3) - binary.LittleEndian.PutUint64(z[4*8:5*8], l4) - binary.LittleEndian.PutUint64(z[5*8:6*8], l5) - binary.LittleEndian.PutUint64(z[6*8:7*8], l6) -} diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go b/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go deleted file mode 100644 index a62225d296..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fp_noasm.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !amd64 || purego -// +build !amd64 purego - -package fp448 - -func cmov(x, y *Elt, n uint) { cmovGeneric(x, y, n) } -func cswap(x, y *Elt, n uint) { cswapGeneric(x, y, n) } -func add(z, x, y *Elt) { addGeneric(z, x, y) } -func sub(z, x, y *Elt) { subGeneric(z, x, y) } -func addsub(x, y *Elt) { addsubGeneric(x, y) } -func mul(z, x, y *Elt) { mulGeneric(z, x, y) } -func sqr(z, x *Elt) { sqrGeneric(z, x) } diff --git a/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go b/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go deleted file mode 100644 index 2d7afc8059..0000000000 --- a/vendor/github.com/cloudflare/circl/math/fp448/fuzzer.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build gofuzz -// +build gofuzz - -// How to run the fuzzer: -// -// $ go get -u github.com/dvyukov/go-fuzz/go-fuzz -// $ go get -u github.com/dvyukov/go-fuzz/go-fuzz-build -// $ go-fuzz-build -libfuzzer -func FuzzReduction -o lib.a -// $ clang -fsanitize=fuzzer lib.a -o fu.exe -// $ ./fu.exe -package fp448 - -import ( - "encoding/binary" - "fmt" - "math/big" - - "github.com/cloudflare/circl/internal/conv" -) - -// FuzzReduction is a fuzzer target for red64 function, which reduces t -// (112 bits) to a number t' (56 bits) congruent modulo p448. -func FuzzReduction(data []byte) int { - if len(data) != 2*Size { - return -1 - } - var got, want Elt - var lo, hi [7]uint64 - a := data[:Size] - b := data[Size:] - lo[0] = binary.LittleEndian.Uint64(a[0*8 : 1*8]) - lo[1] = binary.LittleEndian.Uint64(a[1*8 : 2*8]) - lo[2] = binary.LittleEndian.Uint64(a[2*8 : 3*8]) - lo[3] = binary.LittleEndian.Uint64(a[3*8 : 4*8]) - lo[4] = binary.LittleEndian.Uint64(a[4*8 : 5*8]) - lo[5] = binary.LittleEndian.Uint64(a[5*8 : 6*8]) - lo[6] = binary.LittleEndian.Uint64(a[6*8 : 7*8]) - - hi[0] = binary.LittleEndian.Uint64(b[0*8 : 1*8]) - hi[1] = binary.LittleEndian.Uint64(b[1*8 : 2*8]) - hi[2] = binary.LittleEndian.Uint64(b[2*8 : 3*8]) - hi[3] = binary.LittleEndian.Uint64(b[3*8 : 4*8]) - hi[4] = binary.LittleEndian.Uint64(b[4*8 : 5*8]) - hi[5] = binary.LittleEndian.Uint64(b[5*8 : 6*8]) - hi[6] = binary.LittleEndian.Uint64(b[6*8 : 7*8]) - - red64(&got, &lo, &hi) - - t := conv.BytesLe2BigInt(data[:2*Size]) - - two448 := big.NewInt(1) - two448.Lsh(two448, 448) // 2^448 - mask448 := big.NewInt(1) - mask448.Sub(two448, mask448) // 2^448-1 - two224plus1 := big.NewInt(1) - two224plus1.Lsh(two224plus1, 224) - two224plus1.Add(two224plus1, big.NewInt(1)) // 2^224+1 - - var loBig, hiBig big.Int - for t.Cmp(two448) >= 0 { - loBig.And(t, mask448) - hiBig.Rsh(t, 448) - t.Mul(&hiBig, two224plus1) - t.Add(t, &loBig) - } - conv.BigInt2BytesLe(want[:], t) - - if got != want { - fmt.Printf("in: %v\n", conv.BytesLe2BigInt(data[:2*Size])) - fmt.Printf("got: %v\n", got) - fmt.Printf("want: %v\n", want) - panic("error found") - } - return 1 -} diff --git a/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go b/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go deleted file mode 100644 index a43851b8bb..0000000000 --- a/vendor/github.com/cloudflare/circl/math/mlsbset/mlsbset.go +++ /dev/null @@ -1,122 +0,0 @@ -// Package mlsbset provides a constant-time exponentiation method with precomputation. -// -// References: "Efficient and secure algorithms for GLV-based scalar -// multiplication and their implementation on GLV–GLS curves" by (Faz-Hernandez et al.) -// - https://doi.org/10.1007/s13389-014-0085-7 -// - https://eprint.iacr.org/2013/158 -package mlsbset - -import ( - "errors" - "fmt" - "math/big" - - "github.com/cloudflare/circl/internal/conv" -) - -// EltG is a group element. -type EltG interface{} - -// EltP is a precomputed group element. -type EltP interface{} - -// Group defines the operations required by MLSBSet exponentiation method. -type Group interface { - Identity() EltG // Returns the identity of the group. - Sqr(x EltG) // Calculates x = x^2. - Mul(x EltG, y EltP) // Calculates x = x*y. - NewEltP() EltP // Returns an arbitrary precomputed element. - ExtendedEltP() EltP // Returns the precomputed element x^(2^(w*d)). - Lookup(a EltP, v uint, s, u int32) // Sets a = s*T[v][u]. -} - -// Params contains the parameters of the encoding. -type Params struct { - T uint // T is the maximum size (in bits) of exponents. - V uint // V is the number of tables. - W uint // W is the window size. - E uint // E is the number of digits per table. - D uint // D is the number of digits in total. - L uint // L is the length of the code. -} - -// Encoder allows to convert integers into valid powers. -type Encoder struct{ p Params } - -// New produces an encoder of the MLSBSet algorithm. -func New(t, v, w uint) (Encoder, error) { - if !(t > 1 && v >= 1 && w >= 2) { - return Encoder{}, errors.New("t>1, v>=1, w>=2") - } - e := (t + w*v - 1) / (w * v) - d := e * v - l := d * w - return Encoder{Params{t, v, w, e, d, l}}, nil -} - -// Encode converts an odd integer k into a valid power for exponentiation. -func (m Encoder) Encode(k []byte) (*Power, error) { - if len(k) == 0 { - return nil, errors.New("empty slice") - } - if !(len(k) <= int(m.p.L+7)>>3) { - return nil, errors.New("k too big") - } - if k[0]%2 == 0 { - return nil, errors.New("k must be odd") - } - ap := int((m.p.L+7)/8) - len(k) - k = append(k, make([]byte, ap)...) - s := m.signs(k) - b := make([]int32, m.p.L-m.p.D) - c := conv.BytesLe2BigInt(k) - c.Rsh(c, m.p.D) - var bi big.Int - for i := m.p.D; i < m.p.L; i++ { - c0 := int32(c.Bit(0)) - b[i-m.p.D] = s[i%m.p.D] * c0 - bi.SetInt64(int64(b[i-m.p.D] >> 1)) - c.Rsh(c, 1) - c.Sub(c, &bi) - } - carry := int(c.Int64()) - return &Power{m, s, b, carry}, nil -} - -// signs calculates the set of signs. -func (m Encoder) signs(k []byte) []int32 { - s := make([]int32, m.p.D) - s[m.p.D-1] = 1 - for i := uint(1); i < m.p.D; i++ { - ki := int32((k[i>>3] >> (i & 0x7)) & 0x1) - s[i-1] = 2*ki - 1 - } - return s -} - -// GetParams returns the complementary parameters of the encoding. -func (m Encoder) GetParams() Params { return m.p } - -// tableSize returns the size of each table. -func (m Encoder) tableSize() uint { return 1 << (m.p.W - 1) } - -// Elts returns the total number of elements that must be precomputed. -func (m Encoder) Elts() uint { return m.p.V * m.tableSize() } - -// IsExtended returns true if the element x^(2^(wd)) must be calculated. -func (m Encoder) IsExtended() bool { q := m.p.T / (m.p.V * m.p.W); return m.p.T == q*m.p.V*m.p.W } - -// Ops returns the number of squares and multiplications executed during an exponentiation. -func (m Encoder) Ops() (S uint, M uint) { - S = m.p.E - M = m.p.E * m.p.V - if m.IsExtended() { - M++ - } - return -} - -func (m Encoder) String() string { - return fmt.Sprintf("T: %v W: %v V: %v e: %v d: %v l: %v wv|t: %v", - m.p.T, m.p.W, m.p.V, m.p.E, m.p.D, m.p.L, m.IsExtended()) -} diff --git a/vendor/github.com/cloudflare/circl/math/mlsbset/power.go b/vendor/github.com/cloudflare/circl/math/mlsbset/power.go deleted file mode 100644 index 3f214c3046..0000000000 --- a/vendor/github.com/cloudflare/circl/math/mlsbset/power.go +++ /dev/null @@ -1,64 +0,0 @@ -package mlsbset - -import "fmt" - -// Power is a valid exponent produced by the MLSBSet encoding algorithm. -type Power struct { - set Encoder // parameters of code. - s []int32 // set of signs. - b []int32 // set of digits. - c int // carry is {0,1}. -} - -// Exp is calculates x^k, where x is a predetermined element of a group G. -func (p *Power) Exp(G Group) EltG { - a, b := G.Identity(), G.NewEltP() - for e := int(p.set.p.E - 1); e >= 0; e-- { - G.Sqr(a) - for v := uint(0); v < p.set.p.V; v++ { - sgnElt, idElt := p.Digit(v, uint(e)) - G.Lookup(b, v, sgnElt, idElt) - G.Mul(a, b) - } - } - if p.set.IsExtended() && p.c == 1 { - G.Mul(a, G.ExtendedEltP()) - } - return a -} - -// Digit returns the (v,e)-th digit and its sign. -func (p *Power) Digit(v, e uint) (sgn, dig int32) { - sgn = p.bit(0, v, e) - dig = 0 - for i := p.set.p.W - 1; i > 0; i-- { - dig = 2*dig + p.bit(i, v, e) - } - mask := dig >> 31 - dig = (dig + mask) ^ mask - return sgn, dig -} - -// bit returns the (w,v,e)-th bit of the code. -func (p *Power) bit(w, v, e uint) int32 { - if !(w < p.set.p.W && - v < p.set.p.V && - e < p.set.p.E) { - panic(fmt.Errorf("indexes outside (%v,%v,%v)", w, v, e)) - } - if w == 0 { - return p.s[p.set.p.E*v+e] - } - return p.b[p.set.p.D*(w-1)+p.set.p.E*v+e] -} - -func (p *Power) String() string { - dig := "" - for j := uint(0); j < p.set.p.V; j++ { - for i := uint(0); i < p.set.p.E; i++ { - s, d := p.Digit(j, i) - dig += fmt.Sprintf("(%2v,%2v) = %+2v %+2v\n", j, i, s, d) - } - } - return fmt.Sprintf("len: %v\ncarry: %v\ndigits:\n%v", len(p.b)+len(p.s), p.c, dig) -} diff --git a/vendor/github.com/cloudflare/circl/math/primes.go b/vendor/github.com/cloudflare/circl/math/primes.go deleted file mode 100644 index 158fd83a7a..0000000000 --- a/vendor/github.com/cloudflare/circl/math/primes.go +++ /dev/null @@ -1,34 +0,0 @@ -package math - -import ( - "crypto/rand" - "io" - "math/big" -) - -// IsSafePrime reports whether p is (probably) a safe prime. -// The prime p=2*q+1 is safe prime if both p and q are primes. -// Note that ProbablyPrime is not suitable for judging primes -// that an adversary may have crafted to fool the test. -func IsSafePrime(p *big.Int) bool { - pdiv2 := new(big.Int).Rsh(p, 1) - return p.ProbablyPrime(20) && pdiv2.ProbablyPrime(20) -} - -// SafePrime returns a number of the given bit length that is a safe prime with high probability. -// The number returned p=2*q+1 is a safe prime if both p and q are primes. -// SafePrime will return error for any error returned by rand.Read or if bits < 2. -func SafePrime(random io.Reader, bits int) (*big.Int, error) { - one := big.NewInt(1) - p := new(big.Int) - for { - q, err := rand.Prime(random, bits-1) - if err != nil { - return nil, err - } - p.Lsh(q, 1).Add(p, one) - if p.ProbablyPrime(20) { - return p, nil - } - } -} diff --git a/vendor/github.com/cloudflare/circl/math/wnaf.go b/vendor/github.com/cloudflare/circl/math/wnaf.go deleted file mode 100644 index 94a1ec5042..0000000000 --- a/vendor/github.com/cloudflare/circl/math/wnaf.go +++ /dev/null @@ -1,84 +0,0 @@ -// Package math provides some utility functions for big integers. -package math - -import "math/big" - -// SignedDigit obtains the signed-digit recoding of n and returns a list L of -// digits such that n = sum( L[i]*2^(i*(w-1)) ), and each L[i] is an odd number -// in the set {±1, ±3, ..., ±2^(w-1)-1}. The third parameter ensures that the -// output has ceil(l/(w-1)) digits. -// -// Restrictions: -// - n is odd and n > 0. -// - 1 < w < 32. -// - l >= bit length of n. -// -// References: -// - Alg.6 in "Exponent Recoding and Regular Exponentiation Algorithms" -// by Joye-Tunstall. http://doi.org/10.1007/978-3-642-02384-2_21 -// - Alg.6 in "Selecting Elliptic Curves for Cryptography: An Efficiency and -// Security Analysis" by Bos et al. http://doi.org/10.1007/s13389-015-0097-y -func SignedDigit(n *big.Int, w, l uint) []int32 { - if n.Sign() <= 0 || n.Bit(0) == 0 { - panic("n must be non-zero, odd, and positive") - } - if w <= 1 || w >= 32 { - panic("Verify that 1 < w < 32") - } - if uint(n.BitLen()) > l { - panic("n is too big to fit in l digits") - } - lenN := (l + (w - 1) - 1) / (w - 1) // ceil(l/(w-1)) - L := make([]int32, lenN+1) - var k, v big.Int - k.Set(n) - - var i uint - for i = 0; i < lenN; i++ { - words := k.Bits() - value := int32(words[0] & ((1 << w) - 1)) - value -= int32(1) << (w - 1) - L[i] = value - v.SetInt64(int64(value)) - k.Sub(&k, &v) - k.Rsh(&k, w-1) - } - L[i] = int32(k.Int64()) - return L -} - -// OmegaNAF obtains the window-w Non-Adjacent Form of a positive number n and -// 1 < w < 32. The returned slice L holds n = sum( L[i]*2^i ). -// -// Reference: -// - Alg.9 "Efficient arithmetic on Koblitz curves" by Solinas. -// http://doi.org/10.1023/A:1008306223194 -func OmegaNAF(n *big.Int, w uint) (L []int32) { - if n.Sign() < 0 { - panic("n must be positive") - } - if w <= 1 || w >= 32 { - panic("Verify that 1 < w < 32") - } - - L = make([]int32, n.BitLen()+1) - var k, v big.Int - k.Set(n) - - i := 0 - for ; k.Sign() > 0; i++ { - value := int32(0) - if k.Bit(0) == 1 { - words := k.Bits() - value = int32(words[0] & ((1 << w) - 1)) - if value >= (int32(1) << (w - 1)) { - value -= int32(1) << w - } - v.SetInt64(int64(value)) - k.Sub(&k, &v) - } - L[i] = value - k.Rsh(&k, 1) - } - return L[:i] -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go b/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go deleted file mode 100644 index 2c73c26fb1..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/ed25519.go +++ /dev/null @@ -1,453 +0,0 @@ -// Package ed25519 implements Ed25519 signature scheme as described in RFC-8032. -// -// This package provides optimized implementations of the three signature -// variants and maintaining closer compatibility with crypto/ed25519. -// -// | Scheme Name | Sign Function | Verification | Context | -// |-------------|-------------------|---------------|-------------------| -// | Ed25519 | Sign | Verify | None | -// | Ed25519Ph | SignPh | VerifyPh | Yes, can be empty | -// | Ed25519Ctx | SignWithCtx | VerifyWithCtx | Yes, non-empty | -// | All above | (PrivateKey).Sign | VerifyAny | As above | -// -// Specific functions for sign and verify are defined. A generic signing -// function for all schemes is available through the crypto.Signer interface, -// which is implemented by the PrivateKey type. A correspond all-in-one -// verification method is provided by the VerifyAny function. -// -// Signing with Ed25519Ph or Ed25519Ctx requires a context string for domain -// separation. This parameter is passed using a SignerOptions struct defined -// in this package. While Ed25519Ph accepts an empty context, Ed25519Ctx -// enforces non-empty context strings. -// -// # Compatibility with crypto.ed25519 -// -// These functions are compatible with the “Ed25519” function defined in -// RFC-8032. However, unlike RFC 8032's formulation, this package's private -// key representation includes a public key suffix to make multiple signing -// operations with the same key more efficient. This package refers to the -// RFC-8032 private key as the “seed”. -// -// References -// -// - RFC-8032: https://rfc-editor.org/rfc/rfc8032.txt -// - Ed25519: https://ed25519.cr.yp.to/ -// - EdDSA: High-speed high-security signatures. https://doi.org/10.1007/s13389-012-0027-1 -package ed25519 - -import ( - "bytes" - "crypto" - cryptoRand "crypto/rand" - "crypto/sha512" - "crypto/subtle" - "errors" - "fmt" - "io" - "strconv" - - "github.com/cloudflare/circl/sign" -) - -const ( - // ContextMaxSize is the maximum length (in bytes) allowed for context. - ContextMaxSize = 255 - // PublicKeySize is the size, in bytes, of public keys as used in this package. - PublicKeySize = 32 - // PrivateKeySize is the size, in bytes, of private keys as used in this package. - PrivateKeySize = 64 - // SignatureSize is the size, in bytes, of signatures generated and verified by this package. - SignatureSize = 64 - // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. - SeedSize = 32 -) - -const ( - paramB = 256 / 8 // Size of keys in bytes. -) - -// SignerOptions implements crypto.SignerOpts and augments with parameters -// that are specific to the Ed25519 signature schemes. -type SignerOptions struct { - // Hash must be crypto.Hash(0) for Ed25519/Ed25519ctx, or crypto.SHA512 - // for Ed25519ph. - crypto.Hash - - // Context is an optional domain separation string for Ed25519ph and a - // must for Ed25519ctx. Its length must be less or equal than 255 bytes. - Context string - - // Scheme is an identifier for choosing a signature scheme. The zero value - // is ED25519. - Scheme SchemeID -} - -// SchemeID is an identifier for each signature scheme. -type SchemeID uint - -const ( - ED25519 SchemeID = iota - ED25519Ph - ED25519Ctx -) - -// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer. -type PrivateKey []byte - -// Equal reports whether priv and x have the same value. -func (priv PrivateKey) Equal(x crypto.PrivateKey) bool { - xx, ok := x.(PrivateKey) - return ok && subtle.ConstantTimeCompare(priv, xx) == 1 -} - -// Public returns the PublicKey corresponding to priv. -func (priv PrivateKey) Public() crypto.PublicKey { - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, priv[SeedSize:]) - return publicKey -} - -// Seed returns the private key seed corresponding to priv. It is provided for -// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds -// in this package. -func (priv PrivateKey) Seed() []byte { - seed := make([]byte, SeedSize) - copy(seed, priv[:SeedSize]) - return seed -} - -func (priv PrivateKey) Scheme() sign.Scheme { return sch } - -func (pub PublicKey) Scheme() sign.Scheme { return sch } - -func (priv PrivateKey) MarshalBinary() (data []byte, err error) { - privateKey := make(PrivateKey, PrivateKeySize) - copy(privateKey, priv) - return privateKey, nil -} - -func (pub PublicKey) MarshalBinary() (data []byte, err error) { - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, pub) - return publicKey, nil -} - -// Equal reports whether pub and x have the same value. -func (pub PublicKey) Equal(x crypto.PublicKey) bool { - xx, ok := x.(PublicKey) - return ok && bytes.Equal(pub, xx) -} - -// Sign creates a signature of a message with priv key. -// This function is compatible with crypto.ed25519 and also supports the -// three signature variants defined in RFC-8032, namely Ed25519 (or pure -// EdDSA), Ed25519Ph, and Ed25519Ctx. -// The opts.HashFunc() must return zero to specify either Ed25519 or Ed25519Ctx -// variant. This can be achieved by passing crypto.Hash(0) as the value for -// opts. -// The opts.HashFunc() must return SHA512 to specify the Ed25519Ph variant. -// This can be achieved by passing crypto.SHA512 as the value for opts. -// Use a SignerOptions struct (defined in this package) to pass a context -// string for signing. -func (priv PrivateKey) Sign( - rand io.Reader, - message []byte, - opts crypto.SignerOpts, -) (signature []byte, err error) { - var ctx string - var scheme SchemeID - if o, ok := opts.(SignerOptions); ok { - ctx = o.Context - scheme = o.Scheme - } - - switch true { - case scheme == ED25519 && opts.HashFunc() == crypto.Hash(0): - return Sign(priv, message), nil - case scheme == ED25519Ph && opts.HashFunc() == crypto.SHA512: - return SignPh(priv, message, ctx), nil - case scheme == ED25519Ctx && opts.HashFunc() == crypto.Hash(0) && len(ctx) > 0: - return SignWithCtx(priv, message, ctx), nil - default: - return nil, errors.New("ed25519: bad hash algorithm") - } -} - -// GenerateKey generates a public/private key pair using entropy from rand. -// If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { - if rand == nil { - rand = cryptoRand.Reader - } - - seed := make([]byte, SeedSize) - if _, err := io.ReadFull(rand, seed); err != nil { - return nil, nil, err - } - - privateKey := NewKeyFromSeed(seed) - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, privateKey[SeedSize:]) - - return publicKey, privateKey, nil -} - -// NewKeyFromSeed calculates a private key from a seed. It will panic if -// len(seed) is not SeedSize. This function is provided for interoperability -// with RFC 8032. RFC 8032's private keys correspond to seeds in this -// package. -func NewKeyFromSeed(seed []byte) PrivateKey { - privateKey := make(PrivateKey, PrivateKeySize) - newKeyFromSeed(privateKey, seed) - return privateKey -} - -func newKeyFromSeed(privateKey, seed []byte) { - if l := len(seed); l != SeedSize { - panic("ed25519: bad seed length: " + strconv.Itoa(l)) - } - var P pointR1 - k := sha512.Sum512(seed) - clamp(k[:]) - reduceModOrder(k[:paramB], false) - P.fixedMult(k[:paramB]) - copy(privateKey[:SeedSize], seed) - _ = P.ToBytes(privateKey[SeedSize:]) -} - -func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) { - if l := len(privateKey); l != PrivateKeySize { - panic("ed25519: bad private key length: " + strconv.Itoa(l)) - } - - H := sha512.New() - var PHM []byte - - if preHash { - _, _ = H.Write(message) - PHM = H.Sum(nil) - H.Reset() - } else { - PHM = message - } - - // 1. Hash the 32-byte private key using SHA-512. - _, _ = H.Write(privateKey[:SeedSize]) - h := H.Sum(nil) - clamp(h[:]) - prefix, s := h[paramB:], h[:paramB] - - // 2. Compute SHA-512(dom2(F, C) || prefix || PH(M)) - H.Reset() - - writeDom(H, ctx, preHash) - - _, _ = H.Write(prefix) - _, _ = H.Write(PHM) - r := H.Sum(nil) - reduceModOrder(r[:], true) - - // 3. Compute the point [r]B. - var P pointR1 - P.fixedMult(r[:paramB]) - R := (&[paramB]byte{})[:] - if err := P.ToBytes(R); err != nil { - panic(err) - } - - // 4. Compute SHA512(dom2(F, C) || R || A || PH(M)). - H.Reset() - - writeDom(H, ctx, preHash) - - _, _ = H.Write(R) - _, _ = H.Write(privateKey[SeedSize:]) - _, _ = H.Write(PHM) - hRAM := H.Sum(nil) - - reduceModOrder(hRAM[:], true) - - // 5. Compute S = (r + k * s) mod order. - S := (&[paramB]byte{})[:] - calculateS(S, r[:paramB], hRAM[:paramB], s) - - // 6. The signature is the concatenation of R and S. - copy(signature[:paramB], R[:]) - copy(signature[paramB:], S[:]) -} - -// Sign signs the message with privateKey and returns a signature. -// This function supports the signature variant defined in RFC-8032: Ed25519, -// also known as the pure version of EdDSA. -// It will panic if len(privateKey) is not PrivateKeySize. -func Sign(privateKey PrivateKey, message []byte) []byte { - signature := make([]byte, SignatureSize) - signAll(signature, privateKey, message, []byte(""), false) - return signature -} - -// SignPh creates a signature of a message with private key and context. -// This function supports the signature variant defined in RFC-8032: Ed25519ph, -// meaning it internally hashes the message using SHA-512, and optionally -// accepts a context string. -// It will panic if len(privateKey) is not PrivateKeySize. -// Context could be passed to this function, which length should be no more than -// ContextMaxSize=255. It can be empty. -func SignPh(privateKey PrivateKey, message []byte, ctx string) []byte { - if len(ctx) > ContextMaxSize { - panic(fmt.Errorf("ed25519: bad context length: %v", len(ctx))) - } - - signature := make([]byte, SignatureSize) - signAll(signature, privateKey, message, []byte(ctx), true) - return signature -} - -// SignWithCtx creates a signature of a message with private key and context. -// This function supports the signature variant defined in RFC-8032: Ed25519ctx, -// meaning it accepts a non-empty context string. -// It will panic if len(privateKey) is not PrivateKeySize. -// Context must be passed to this function, which length should be no more than -// ContextMaxSize=255 and cannot be empty. -func SignWithCtx(privateKey PrivateKey, message []byte, ctx string) []byte { - if len(ctx) == 0 || len(ctx) > ContextMaxSize { - panic(fmt.Errorf("ed25519: bad context length: %v > %v", len(ctx), ContextMaxSize)) - } - - signature := make([]byte, SignatureSize) - signAll(signature, privateKey, message, []byte(ctx), false) - return signature -} - -func verify(public PublicKey, message, signature, ctx []byte, preHash bool) bool { - if len(public) != PublicKeySize || - len(signature) != SignatureSize || - !isLessThanOrder(signature[paramB:]) { - return false - } - - var P pointR1 - if ok := P.FromBytes(public); !ok { - return false - } - - H := sha512.New() - var PHM []byte - - if preHash { - _, _ = H.Write(message) - PHM = H.Sum(nil) - H.Reset() - } else { - PHM = message - } - - R := signature[:paramB] - - writeDom(H, ctx, preHash) - - _, _ = H.Write(R) - _, _ = H.Write(public) - _, _ = H.Write(PHM) - hRAM := H.Sum(nil) - reduceModOrder(hRAM[:], true) - - var Q pointR1 - encR := (&[paramB]byte{})[:] - P.neg() - Q.doubleMult(&P, signature[paramB:], hRAM[:paramB]) - _ = Q.ToBytes(encR) - return bytes.Equal(R, encR) -} - -// VerifyAny returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports all the three signature variants defined in RFC-8032, -// namely Ed25519 (or pure EdDSA), Ed25519Ph, and Ed25519Ctx. -// The opts.HashFunc() must return zero to specify either Ed25519 or Ed25519Ctx -// variant. This can be achieved by passing crypto.Hash(0) as the value for opts. -// The opts.HashFunc() must return SHA512 to specify the Ed25519Ph variant. -// This can be achieved by passing crypto.SHA512 as the value for opts. -// Use a SignerOptions struct to pass a context string for signing. -func VerifyAny(public PublicKey, message, signature []byte, opts crypto.SignerOpts) bool { - var ctx string - var scheme SchemeID - if o, ok := opts.(SignerOptions); ok { - ctx = o.Context - scheme = o.Scheme - } - - switch true { - case scheme == ED25519 && opts.HashFunc() == crypto.Hash(0): - return Verify(public, message, signature) - case scheme == ED25519Ph && opts.HashFunc() == crypto.SHA512: - return VerifyPh(public, message, signature, ctx) - case scheme == ED25519Ctx && opts.HashFunc() == crypto.Hash(0) && len(ctx) > 0: - return VerifyWithCtx(public, message, signature, ctx) - default: - return false - } -} - -// Verify returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports the signature variant defined in RFC-8032: Ed25519, -// also known as the pure version of EdDSA. -func Verify(public PublicKey, message, signature []byte) bool { - return verify(public, message, signature, []byte(""), false) -} - -// VerifyPh returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports the signature variant defined in RFC-8032: Ed25519ph, -// meaning it internally hashes the message using SHA-512. -// Context could be passed to this function, which length should be no more than -// 255. It can be empty. -func VerifyPh(public PublicKey, message, signature []byte, ctx string) bool { - return verify(public, message, signature, []byte(ctx), true) -} - -// VerifyWithCtx returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded, or when context is -// not provided. -// This function supports the signature variant defined in RFC-8032: Ed25519ctx, -// meaning it does not handle prehashed messages. Non-empty context string must be -// provided, and must not be more than 255 of length. -func VerifyWithCtx(public PublicKey, message, signature []byte, ctx string) bool { - if len(ctx) == 0 || len(ctx) > ContextMaxSize { - return false - } - - return verify(public, message, signature, []byte(ctx), false) -} - -func clamp(k []byte) { - k[0] &= 248 - k[paramB-1] = (k[paramB-1] & 127) | 64 -} - -// isLessThanOrder returns true if 0 <= x < order. -func isLessThanOrder(x []byte) bool { - i := len(order) - 1 - for i > 0 && x[i] == order[i] { - i-- - } - return x[i] < order[i] -} - -func writeDom(h io.Writer, ctx []byte, preHash bool) { - dom2 := "SigEd25519 no Ed25519 collisions" - - if len(ctx) > 0 { - _, _ = h.Write([]byte(dom2)) - if preHash { - _, _ = h.Write([]byte{byte(0x01), byte(len(ctx))}) - } else { - _, _ = h.Write([]byte{byte(0x00), byte(len(ctx))}) - } - _, _ = h.Write(ctx) - } else if preHash { - _, _ = h.Write([]byte(dom2)) - _, _ = h.Write([]byte{0x01, 0x00}) - } -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go b/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go deleted file mode 100644 index 10efafdcaf..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/modular.go +++ /dev/null @@ -1,175 +0,0 @@ -package ed25519 - -import ( - "encoding/binary" - "math/bits" -) - -var order = [paramB]byte{ - 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, -} - -// isLessThan returns true if 0 <= x < y, and assumes that slices have the same length. -func isLessThan(x, y []byte) bool { - i := len(x) - 1 - for i > 0 && x[i] == y[i] { - i-- - } - return x[i] < y[i] -} - -// reduceModOrder calculates k = k mod order of the curve. -func reduceModOrder(k []byte, is512Bit bool) { - var X [((2 * paramB) * 8) / 64]uint64 - numWords := len(k) >> 3 - for i := 0; i < numWords; i++ { - X[i] = binary.LittleEndian.Uint64(k[i*8 : (i+1)*8]) - } - red512(&X, is512Bit) - for i := 0; i < numWords; i++ { - binary.LittleEndian.PutUint64(k[i*8:(i+1)*8], X[i]) - } -} - -// red512 calculates x = x mod Order of the curve. -func red512(x *[8]uint64, full bool) { - // Implementation of Algs.(14.47)+(14.52) of Handbook of Applied - // Cryptography, by A. Menezes, P. van Oorschot, and S. Vanstone. - const ( - ell0 = uint64(0x5812631a5cf5d3ed) - ell1 = uint64(0x14def9dea2f79cd6) - ell160 = uint64(0x812631a5cf5d3ed0) - ell161 = uint64(0x4def9dea2f79cd65) - ell162 = uint64(0x0000000000000001) - ) - - var c0, c1, c2, c3 uint64 - r0, r1, r2, r3, r4 := x[0], x[1], x[2], x[3], uint64(0) - - if full { - q0, q1, q2, q3 := x[4], x[5], x[6], x[7] - - for i := 0; i < 3; i++ { - h0, s0 := bits.Mul64(q0, ell160) - h1, s1 := bits.Mul64(q1, ell160) - h2, s2 := bits.Mul64(q2, ell160) - h3, s3 := bits.Mul64(q3, ell160) - - s1, c0 = bits.Add64(h0, s1, 0) - s2, c1 = bits.Add64(h1, s2, c0) - s3, c2 = bits.Add64(h2, s3, c1) - s4, _ := bits.Add64(h3, 0, c2) - - h0, l0 := bits.Mul64(q0, ell161) - h1, l1 := bits.Mul64(q1, ell161) - h2, l2 := bits.Mul64(q2, ell161) - h3, l3 := bits.Mul64(q3, ell161) - - l1, c0 = bits.Add64(h0, l1, 0) - l2, c1 = bits.Add64(h1, l2, c0) - l3, c2 = bits.Add64(h2, l3, c1) - l4, _ := bits.Add64(h3, 0, c2) - - s1, c0 = bits.Add64(s1, l0, 0) - s2, c1 = bits.Add64(s2, l1, c0) - s3, c2 = bits.Add64(s3, l2, c1) - s4, c3 = bits.Add64(s4, l3, c2) - s5, s6 := bits.Add64(l4, 0, c3) - - s2, c0 = bits.Add64(s2, q0, 0) - s3, c1 = bits.Add64(s3, q1, c0) - s4, c2 = bits.Add64(s4, q2, c1) - s5, c3 = bits.Add64(s5, q3, c2) - s6, s7 := bits.Add64(s6, 0, c3) - - q := q0 | q1 | q2 | q3 - m := -((q | -q) >> 63) // if q=0 then m=0...0 else m=1..1 - s0 &= m - s1 &= m - s2 &= m - s3 &= m - q0, q1, q2, q3 = s4, s5, s6, s7 - - if (i+1)%2 == 0 { - r0, c0 = bits.Add64(r0, s0, 0) - r1, c1 = bits.Add64(r1, s1, c0) - r2, c2 = bits.Add64(r2, s2, c1) - r3, c3 = bits.Add64(r3, s3, c2) - r4, _ = bits.Add64(r4, 0, c3) - } else { - r0, c0 = bits.Sub64(r0, s0, 0) - r1, c1 = bits.Sub64(r1, s1, c0) - r2, c2 = bits.Sub64(r2, s2, c1) - r3, c3 = bits.Sub64(r3, s3, c2) - r4, _ = bits.Sub64(r4, 0, c3) - } - } - - m := -(r4 >> 63) - r0, c0 = bits.Add64(r0, m&ell160, 0) - r1, c1 = bits.Add64(r1, m&ell161, c0) - r2, c2 = bits.Add64(r2, m&ell162, c1) - r3, c3 = bits.Add64(r3, 0, c2) - r4, _ = bits.Add64(r4, m&1, c3) - x[4], x[5], x[6], x[7] = 0, 0, 0, 0 - } - - q0 := (r4 << 4) | (r3 >> 60) - r3 &= (uint64(1) << 60) - 1 - - h0, s0 := bits.Mul64(ell0, q0) - h1, s1 := bits.Mul64(ell1, q0) - s1, c0 = bits.Add64(h0, s1, 0) - s2, _ := bits.Add64(h1, 0, c0) - - r0, c0 = bits.Sub64(r0, s0, 0) - r1, c1 = bits.Sub64(r1, s1, c0) - r2, c2 = bits.Sub64(r2, s2, c1) - r3, _ = bits.Sub64(r3, 0, c2) - - x[0], x[1], x[2], x[3] = r0, r1, r2, r3 -} - -// calculateS performs s = r+k*a mod Order of the curve. -func calculateS(s, r, k, a []byte) { - K := [4]uint64{ - binary.LittleEndian.Uint64(k[0*8 : 1*8]), - binary.LittleEndian.Uint64(k[1*8 : 2*8]), - binary.LittleEndian.Uint64(k[2*8 : 3*8]), - binary.LittleEndian.Uint64(k[3*8 : 4*8]), - } - S := [8]uint64{ - binary.LittleEndian.Uint64(r[0*8 : 1*8]), - binary.LittleEndian.Uint64(r[1*8 : 2*8]), - binary.LittleEndian.Uint64(r[2*8 : 3*8]), - binary.LittleEndian.Uint64(r[3*8 : 4*8]), - } - var c3 uint64 - for i := range K { - ai := binary.LittleEndian.Uint64(a[i*8 : (i+1)*8]) - - h0, l0 := bits.Mul64(K[0], ai) - h1, l1 := bits.Mul64(K[1], ai) - h2, l2 := bits.Mul64(K[2], ai) - h3, l3 := bits.Mul64(K[3], ai) - - l1, c0 := bits.Add64(h0, l1, 0) - l2, c1 := bits.Add64(h1, l2, c0) - l3, c2 := bits.Add64(h2, l3, c1) - l4, _ := bits.Add64(h3, 0, c2) - - S[i+0], c0 = bits.Add64(S[i+0], l0, 0) - S[i+1], c1 = bits.Add64(S[i+1], l1, c0) - S[i+2], c2 = bits.Add64(S[i+2], l2, c1) - S[i+3], c3 = bits.Add64(S[i+3], l3, c2) - S[i+4], _ = bits.Add64(S[i+4], l4, c3) - } - red512(&S, true) - binary.LittleEndian.PutUint64(s[0*8:1*8], S[0]) - binary.LittleEndian.PutUint64(s[1*8:2*8], S[1]) - binary.LittleEndian.PutUint64(s[2*8:3*8], S[2]) - binary.LittleEndian.PutUint64(s[3*8:4*8], S[3]) -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go b/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go deleted file mode 100644 index 3216aae303..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/mult.go +++ /dev/null @@ -1,180 +0,0 @@ -package ed25519 - -import ( - "crypto/subtle" - "encoding/binary" - "math/bits" - - "github.com/cloudflare/circl/internal/conv" - "github.com/cloudflare/circl/math" - fp "github.com/cloudflare/circl/math/fp25519" -) - -var paramD = fp.Elt{ - 0xa3, 0x78, 0x59, 0x13, 0xca, 0x4d, 0xeb, 0x75, - 0xab, 0xd8, 0x41, 0x41, 0x4d, 0x0a, 0x70, 0x00, - 0x98, 0xe8, 0x79, 0x77, 0x79, 0x40, 0xc7, 0x8c, - 0x73, 0xfe, 0x6f, 0x2b, 0xee, 0x6c, 0x03, 0x52, -} - -// mLSBRecoding parameters. -const ( - fxT = 257 - fxV = 2 - fxW = 3 - fx2w1 = 1 << (uint(fxW) - 1) - numWords64 = (paramB * 8 / 64) -) - -// mLSBRecoding is the odd-only modified LSB-set. -// -// Reference: -// -// "Efficient and secure algorithms for GLV-based scalar multiplication and -// their implementation on GLV–GLS curves" by (Faz-Hernandez et al.) -// http://doi.org/10.1007/s13389-014-0085-7. -func mLSBRecoding(L []int8, k []byte) { - const ee = (fxT + fxW*fxV - 1) / (fxW * fxV) - const dd = ee * fxV - const ll = dd * fxW - if len(L) == (ll + 1) { - var m [numWords64 + 1]uint64 - for i := 0; i < numWords64; i++ { - m[i] = binary.LittleEndian.Uint64(k[8*i : 8*i+8]) - } - condAddOrderN(&m) - L[dd-1] = 1 - for i := 0; i < dd-1; i++ { - kip1 := (m[(i+1)/64] >> (uint(i+1) % 64)) & 0x1 - L[i] = int8(kip1<<1) - 1 - } - { // right-shift by d - right := uint(dd % 64) - left := uint(64) - right - lim := ((numWords64+1)*64 - dd) / 64 - j := dd / 64 - for i := 0; i < lim; i++ { - m[i] = (m[i+j] >> right) | (m[i+j+1] << left) - } - m[lim] = m[lim+j] >> right - } - for i := dd; i < ll; i++ { - L[i] = L[i%dd] * int8(m[0]&0x1) - div2subY(m[:], int64(L[i]>>1), numWords64) - } - L[ll] = int8(m[0]) - } -} - -// absolute returns always a positive value. -func absolute(x int32) int32 { - mask := x >> 31 - return (x + mask) ^ mask -} - -// condAddOrderN updates x = x+order if x is even, otherwise x remains unchanged. -func condAddOrderN(x *[numWords64 + 1]uint64) { - isOdd := (x[0] & 0x1) - 1 - c := uint64(0) - for i := 0; i < numWords64; i++ { - orderWord := binary.LittleEndian.Uint64(order[8*i : 8*i+8]) - o := isOdd & orderWord - x0, c0 := bits.Add64(x[i], o, c) - x[i] = x0 - c = c0 - } - x[numWords64], _ = bits.Add64(x[numWords64], 0, c) -} - -// div2subY update x = (x/2) - y. -func div2subY(x []uint64, y int64, l int) { - s := uint64(y >> 63) - for i := 0; i < l-1; i++ { - x[i] = (x[i] >> 1) | (x[i+1] << 63) - } - x[l-1] = (x[l-1] >> 1) - - b := uint64(0) - x0, b0 := bits.Sub64(x[0], uint64(y), b) - x[0] = x0 - b = b0 - for i := 1; i < l-1; i++ { - x0, b0 := bits.Sub64(x[i], s, b) - x[i] = x0 - b = b0 - } - x[l-1], _ = bits.Sub64(x[l-1], s, b) -} - -func (P *pointR1) fixedMult(scalar []byte) { - if len(scalar) != paramB { - panic("wrong scalar size") - } - const ee = (fxT + fxW*fxV - 1) / (fxW * fxV) - const dd = ee * fxV - const ll = dd * fxW - - L := make([]int8, ll+1) - mLSBRecoding(L[:], scalar) - S := &pointR3{} - P.SetIdentity() - for ii := ee - 1; ii >= 0; ii-- { - P.double() - for j := 0; j < fxV; j++ { - dig := L[fxW*dd-j*ee+ii-ee] - for i := (fxW-1)*dd - j*ee + ii - ee; i >= (2*dd - j*ee + ii - ee); i = i - dd { - dig = 2*dig + L[i] - } - idx := absolute(int32(dig)) - sig := L[dd-j*ee+ii-ee] - Tabj := &tabSign[fxV-j-1] - for k := 0; k < fx2w1; k++ { - S.cmov(&Tabj[k], subtle.ConstantTimeEq(int32(k), idx)) - } - S.cneg(subtle.ConstantTimeEq(int32(sig), -1)) - P.mixAdd(S) - } - } -} - -const ( - omegaFix = 7 - omegaVar = 5 -) - -// doubleMult returns P=mG+nQ. -func (P *pointR1) doubleMult(Q *pointR1, m, n []byte) { - nafFix := math.OmegaNAF(conv.BytesLe2BigInt(m), omegaFix) - nafVar := math.OmegaNAF(conv.BytesLe2BigInt(n), omegaVar) - - if len(nafFix) > len(nafVar) { - nafVar = append(nafVar, make([]int32, len(nafFix)-len(nafVar))...) - } else if len(nafFix) < len(nafVar) { - nafFix = append(nafFix, make([]int32, len(nafVar)-len(nafFix))...) - } - - var TabQ [1 << (omegaVar - 2)]pointR2 - Q.oddMultiples(TabQ[:]) - P.SetIdentity() - for i := len(nafFix) - 1; i >= 0; i-- { - P.double() - // Generator point - if nafFix[i] != 0 { - idxM := absolute(nafFix[i]) >> 1 - R := tabVerif[idxM] - if nafFix[i] < 0 { - R.neg() - } - P.mixAdd(&R) - } - // Variable input point - if nafVar[i] != 0 { - idxN := absolute(nafVar[i]) >> 1 - S := TabQ[idxN] - if nafVar[i] < 0 { - S.neg() - } - P.add(&S) - } - } -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/point.go b/vendor/github.com/cloudflare/circl/sign/ed25519/point.go deleted file mode 100644 index 374a69503c..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/point.go +++ /dev/null @@ -1,195 +0,0 @@ -package ed25519 - -import fp "github.com/cloudflare/circl/math/fp25519" - -type ( - pointR1 struct{ x, y, z, ta, tb fp.Elt } - pointR2 struct { - pointR3 - z2 fp.Elt - } -) -type pointR3 struct{ addYX, subYX, dt2 fp.Elt } - -func (P *pointR1) neg() { - fp.Neg(&P.x, &P.x) - fp.Neg(&P.ta, &P.ta) -} - -func (P *pointR1) SetIdentity() { - P.x = fp.Elt{} - fp.SetOne(&P.y) - fp.SetOne(&P.z) - P.ta = fp.Elt{} - P.tb = fp.Elt{} -} - -func (P *pointR1) toAffine() { - fp.Inv(&P.z, &P.z) - fp.Mul(&P.x, &P.x, &P.z) - fp.Mul(&P.y, &P.y, &P.z) - fp.Modp(&P.x) - fp.Modp(&P.y) - fp.SetOne(&P.z) - P.ta = P.x - P.tb = P.y -} - -func (P *pointR1) ToBytes(k []byte) error { - P.toAffine() - var x [fp.Size]byte - err := fp.ToBytes(k[:fp.Size], &P.y) - if err != nil { - return err - } - err = fp.ToBytes(x[:], &P.x) - if err != nil { - return err - } - b := x[0] & 1 - k[paramB-1] = k[paramB-1] | (b << 7) - return nil -} - -func (P *pointR1) FromBytes(k []byte) bool { - if len(k) != paramB { - panic("wrong size") - } - signX := k[paramB-1] >> 7 - copy(P.y[:], k[:fp.Size]) - P.y[fp.Size-1] &= 0x7F - p := fp.P() - if !isLessThan(P.y[:], p[:]) { - return false - } - - one, u, v := &fp.Elt{}, &fp.Elt{}, &fp.Elt{} - fp.SetOne(one) - fp.Sqr(u, &P.y) // u = y^2 - fp.Mul(v, u, ¶mD) // v = dy^2 - fp.Sub(u, u, one) // u = y^2-1 - fp.Add(v, v, one) // v = dy^2+1 - isQR := fp.InvSqrt(&P.x, u, v) // x = sqrt(u/v) - if !isQR { - return false - } - fp.Modp(&P.x) // x = x mod p - if fp.IsZero(&P.x) && signX == 1 { - return false - } - if signX != (P.x[0] & 1) { - fp.Neg(&P.x, &P.x) - } - P.ta = P.x - P.tb = P.y - fp.SetOne(&P.z) - return true -} - -// double calculates 2P for curves with A=-1. -func (P *pointR1) double() { - Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb - a, b, c, e, f, g, h := Px, Py, Pz, Pta, Px, Py, Ptb - fp.Add(e, Px, Py) // x+y - fp.Sqr(a, Px) // A = x^2 - fp.Sqr(b, Py) // B = y^2 - fp.Sqr(c, Pz) // z^2 - fp.Add(c, c, c) // C = 2*z^2 - fp.Add(h, a, b) // H = A+B - fp.Sqr(e, e) // (x+y)^2 - fp.Sub(e, e, h) // E = (x+y)^2-A-B - fp.Sub(g, b, a) // G = B-A - fp.Sub(f, c, g) // F = C-G - fp.Mul(Pz, f, g) // Z = F * G - fp.Mul(Px, e, f) // X = E * F - fp.Mul(Py, g, h) // Y = G * H, T = E * H -} - -func (P *pointR1) mixAdd(Q *pointR3) { - fp.Add(&P.z, &P.z, &P.z) // D = 2*z1 - P.coreAddition(Q) -} - -func (P *pointR1) add(Q *pointR2) { - fp.Mul(&P.z, &P.z, &Q.z2) // D = 2*z1*z2 - P.coreAddition(&Q.pointR3) -} - -// coreAddition calculates P=P+Q for curves with A=-1. -func (P *pointR1) coreAddition(Q *pointR3) { - Px, Py, Pz, Pta, Ptb := &P.x, &P.y, &P.z, &P.ta, &P.tb - addYX2, subYX2, dt2 := &Q.addYX, &Q.subYX, &Q.dt2 - a, b, c, d, e, f, g, h := Px, Py, &fp.Elt{}, Pz, Pta, Px, Py, Ptb - fp.Mul(c, Pta, Ptb) // t1 = ta*tb - fp.Sub(h, Py, Px) // y1-x1 - fp.Add(b, Py, Px) // y1+x1 - fp.Mul(a, h, subYX2) // A = (y1-x1)*(y2-x2) - fp.Mul(b, b, addYX2) // B = (y1+x1)*(y2+x2) - fp.Mul(c, c, dt2) // C = 2*D*t1*t2 - fp.Sub(e, b, a) // E = B-A - fp.Add(h, b, a) // H = B+A - fp.Sub(f, d, c) // F = D-C - fp.Add(g, d, c) // G = D+C - fp.Mul(Pz, f, g) // Z = F * G - fp.Mul(Px, e, f) // X = E * F - fp.Mul(Py, g, h) // Y = G * H, T = E * H -} - -func (P *pointR1) oddMultiples(T []pointR2) { - var R pointR2 - n := len(T) - T[0].fromR1(P) - _2P := *P - _2P.double() - R.fromR1(&_2P) - for i := 1; i < n; i++ { - P.add(&R) - T[i].fromR1(P) - } -} - -func (P *pointR1) isEqual(Q *pointR1) bool { - l, r := &fp.Elt{}, &fp.Elt{} - fp.Mul(l, &P.x, &Q.z) - fp.Mul(r, &Q.x, &P.z) - fp.Sub(l, l, r) - b := fp.IsZero(l) - fp.Mul(l, &P.y, &Q.z) - fp.Mul(r, &Q.y, &P.z) - fp.Sub(l, l, r) - b = b && fp.IsZero(l) - fp.Mul(l, &P.ta, &P.tb) - fp.Mul(l, l, &Q.z) - fp.Mul(r, &Q.ta, &Q.tb) - fp.Mul(r, r, &P.z) - fp.Sub(l, l, r) - b = b && fp.IsZero(l) - return b -} - -func (P *pointR3) neg() { - P.addYX, P.subYX = P.subYX, P.addYX - fp.Neg(&P.dt2, &P.dt2) -} - -func (P *pointR2) fromR1(Q *pointR1) { - fp.Add(&P.addYX, &Q.y, &Q.x) - fp.Sub(&P.subYX, &Q.y, &Q.x) - fp.Mul(&P.dt2, &Q.ta, &Q.tb) - fp.Mul(&P.dt2, &P.dt2, ¶mD) - fp.Add(&P.dt2, &P.dt2, &P.dt2) - fp.Add(&P.z2, &Q.z, &Q.z) -} - -func (P *pointR3) cneg(b int) { - t := &fp.Elt{} - fp.Cswap(&P.addYX, &P.subYX, uint(b)) - fp.Neg(t, &P.dt2) - fp.Cmov(&P.dt2, t, uint(b)) -} - -func (P *pointR3) cmov(Q *pointR3, b int) { - fp.Cmov(&P.addYX, &Q.addYX, uint(b)) - fp.Cmov(&P.subYX, &Q.subYX, uint(b)) - fp.Cmov(&P.dt2, &Q.dt2, uint(b)) -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go deleted file mode 100644 index c3505b67ac..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build go1.13 -// +build go1.13 - -package ed25519 - -import cryptoEd25519 "crypto/ed25519" - -// PublicKey is the type of Ed25519 public keys. -type PublicKey cryptoEd25519.PublicKey diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go b/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go deleted file mode 100644 index d57d86eff0..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/pubkey112.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !go1.13 -// +build !go1.13 - -package ed25519 - -// PublicKey is the type of Ed25519 public keys. -type PublicKey []byte diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go b/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go deleted file mode 100644 index e4520f5203..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/signapi.go +++ /dev/null @@ -1,87 +0,0 @@ -package ed25519 - -import ( - "crypto/rand" - "encoding/asn1" - - "github.com/cloudflare/circl/sign" -) - -var sch sign.Scheme = &scheme{} - -// Scheme returns a signature interface. -func Scheme() sign.Scheme { return sch } - -type scheme struct{} - -func (*scheme) Name() string { return "Ed25519" } -func (*scheme) PublicKeySize() int { return PublicKeySize } -func (*scheme) PrivateKeySize() int { return PrivateKeySize } -func (*scheme) SignatureSize() int { return SignatureSize } -func (*scheme) SeedSize() int { return SeedSize } -func (*scheme) TLSIdentifier() uint { return 0x0807 } -func (*scheme) SupportsContext() bool { return false } -func (*scheme) Oid() asn1.ObjectIdentifier { - return asn1.ObjectIdentifier{1, 3, 101, 112} -} - -func (*scheme) GenerateKey() (sign.PublicKey, sign.PrivateKey, error) { - return GenerateKey(rand.Reader) -} - -func (*scheme) Sign( - sk sign.PrivateKey, - message []byte, - opts *sign.SignatureOpts, -) []byte { - priv, ok := sk.(PrivateKey) - if !ok { - panic(sign.ErrTypeMismatch) - } - if opts != nil && opts.Context != "" { - panic(sign.ErrContextNotSupported) - } - return Sign(priv, message) -} - -func (*scheme) Verify( - pk sign.PublicKey, - message, signature []byte, - opts *sign.SignatureOpts, -) bool { - pub, ok := pk.(PublicKey) - if !ok { - panic(sign.ErrTypeMismatch) - } - if opts != nil { - if opts.Context != "" { - panic(sign.ErrContextNotSupported) - } - } - return Verify(pub, message, signature) -} - -func (*scheme) DeriveKey(seed []byte) (sign.PublicKey, sign.PrivateKey) { - privateKey := NewKeyFromSeed(seed) - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, privateKey[SeedSize:]) - return publicKey, privateKey -} - -func (*scheme) UnmarshalBinaryPublicKey(buf []byte) (sign.PublicKey, error) { - if len(buf) < PublicKeySize { - return nil, sign.ErrPubKeySize - } - pub := make(PublicKey, PublicKeySize) - copy(pub, buf[:PublicKeySize]) - return pub, nil -} - -func (*scheme) UnmarshalBinaryPrivateKey(buf []byte) (sign.PrivateKey, error) { - if len(buf) < PrivateKeySize { - return nil, sign.ErrPrivKeySize - } - priv := make(PrivateKey, PrivateKeySize) - copy(priv, buf[:PrivateKeySize]) - return priv, nil -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go b/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go deleted file mode 100644 index 8763b426fc..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed25519/tables.go +++ /dev/null @@ -1,213 +0,0 @@ -package ed25519 - -import fp "github.com/cloudflare/circl/math/fp25519" - -var tabSign = [fxV][fx2w1]pointR3{ - { - pointR3{ - addYX: fp.Elt{0x85, 0x3b, 0x8c, 0xf5, 0xc6, 0x93, 0xbc, 0x2f, 0x19, 0x0e, 0x8c, 0xfb, 0xc6, 0x2d, 0x93, 0xcf, 0xc2, 0x42, 0x3d, 0x64, 0x98, 0x48, 0x0b, 0x27, 0x65, 0xba, 0xd4, 0x33, 0x3a, 0x9d, 0xcf, 0x07}, - subYX: fp.Elt{0x3e, 0x91, 0x40, 0xd7, 0x05, 0x39, 0x10, 0x9d, 0xb3, 0xbe, 0x40, 0xd1, 0x05, 0x9f, 0x39, 0xfd, 0x09, 0x8a, 0x8f, 0x68, 0x34, 0x84, 0xc1, 0xa5, 0x67, 0x12, 0xf8, 0x98, 0x92, 0x2f, 0xfd, 0x44}, - dt2: fp.Elt{0x68, 0xaa, 0x7a, 0x87, 0x05, 0x12, 0xc9, 0xab, 0x9e, 0xc4, 0xaa, 0xcc, 0x23, 0xe8, 0xd9, 0x26, 0x8c, 0x59, 0x43, 0xdd, 0xcb, 0x7d, 0x1b, 0x5a, 0xa8, 0x65, 0x0c, 0x9f, 0x68, 0x7b, 0x11, 0x6f}, - }, - { - addYX: fp.Elt{0x7c, 0xb0, 0x9e, 0xe6, 0xc5, 0xbf, 0xfa, 0x13, 0x8e, 0x0d, 0x22, 0xde, 0xc8, 0xd1, 0xce, 0x52, 0x02, 0xd5, 0x62, 0x31, 0x71, 0x0e, 0x8e, 0x9d, 0xb0, 0xd6, 0x00, 0xa5, 0x5a, 0x0e, 0xce, 0x72}, - subYX: fp.Elt{0x1a, 0x8e, 0x5c, 0xdc, 0xa4, 0xb3, 0x6c, 0x51, 0x18, 0xa0, 0x09, 0x80, 0x9a, 0x46, 0x33, 0xd5, 0xe0, 0x3c, 0x4d, 0x3b, 0xfc, 0x49, 0xa2, 0x43, 0x29, 0xe1, 0x29, 0xa9, 0x93, 0xea, 0x7c, 0x35}, - dt2: fp.Elt{0x08, 0x46, 0x6f, 0x68, 0x7f, 0x0b, 0x7c, 0x9e, 0xad, 0xba, 0x07, 0x61, 0x74, 0x83, 0x2f, 0xfc, 0x26, 0xd6, 0x09, 0xb9, 0x00, 0x34, 0x36, 0x4f, 0x01, 0xf3, 0x48, 0xdb, 0x43, 0xba, 0x04, 0x44}, - }, - { - addYX: fp.Elt{0x4c, 0xda, 0x0d, 0x13, 0x66, 0xfd, 0x82, 0x84, 0x9f, 0x75, 0x5b, 0xa2, 0x17, 0xfe, 0x34, 0xbf, 0x1f, 0xcb, 0xba, 0x90, 0x55, 0x80, 0x83, 0xfd, 0x63, 0xb9, 0x18, 0xf8, 0x5b, 0x5d, 0x94, 0x1e}, - subYX: fp.Elt{0xb9, 0xdb, 0x6c, 0x04, 0x88, 0x22, 0xd8, 0x79, 0x83, 0x2f, 0x8d, 0x65, 0x6b, 0xd2, 0xab, 0x1b, 0xdd, 0x65, 0xe5, 0x93, 0x63, 0xf8, 0xa2, 0xd8, 0x3c, 0xf1, 0x4b, 0xc5, 0x99, 0xd1, 0xf2, 0x12}, - dt2: fp.Elt{0x05, 0x4c, 0xb8, 0x3b, 0xfe, 0xf5, 0x9f, 0x2e, 0xd1, 0xb2, 0xb8, 0xff, 0xfe, 0x6d, 0xd9, 0x37, 0xe0, 0xae, 0xb4, 0x5a, 0x51, 0x80, 0x7e, 0x9b, 0x1d, 0xd1, 0x8d, 0x8c, 0x56, 0xb1, 0x84, 0x35}, - }, - { - addYX: fp.Elt{0x39, 0x71, 0x43, 0x34, 0xe3, 0x42, 0x45, 0xa1, 0xf2, 0x68, 0x71, 0xa7, 0xe8, 0x23, 0xfd, 0x9f, 0x86, 0x48, 0xff, 0xe5, 0x96, 0x74, 0xcf, 0x05, 0x49, 0xe2, 0xb3, 0x6c, 0x17, 0x77, 0x2f, 0x6d}, - subYX: fp.Elt{0x73, 0x3f, 0xc1, 0xc7, 0x6a, 0x66, 0xa1, 0x20, 0xdd, 0x11, 0xfb, 0x7a, 0x6e, 0xa8, 0x51, 0xb8, 0x3f, 0x9d, 0xa2, 0x97, 0x84, 0xb5, 0xc7, 0x90, 0x7c, 0xab, 0x48, 0xd6, 0x84, 0xa3, 0xd5, 0x1a}, - dt2: fp.Elt{0x63, 0x27, 0x3c, 0x49, 0x4b, 0xfc, 0x22, 0xf2, 0x0b, 0x50, 0xc2, 0x0f, 0xb4, 0x1f, 0x31, 0x0c, 0x2f, 0x53, 0xab, 0xaa, 0x75, 0x6f, 0xe0, 0x69, 0x39, 0x56, 0xe0, 0x3b, 0xb7, 0xa8, 0xbf, 0x45}, - }, - }, - { - { - addYX: fp.Elt{0x00, 0x45, 0xd9, 0x0d, 0x58, 0x03, 0xfc, 0x29, 0x93, 0xec, 0xbb, 0x6f, 0xa4, 0x7a, 0xd2, 0xec, 0xf8, 0xa7, 0xe2, 0xc2, 0x5f, 0x15, 0x0a, 0x13, 0xd5, 0xa1, 0x06, 0xb7, 0x1a, 0x15, 0x6b, 0x41}, - subYX: fp.Elt{0x85, 0x8c, 0xb2, 0x17, 0xd6, 0x3b, 0x0a, 0xd3, 0xea, 0x3b, 0x77, 0x39, 0xb7, 0x77, 0xd3, 0xc5, 0xbf, 0x5c, 0x6a, 0x1e, 0x8c, 0xe7, 0xc6, 0xc6, 0xc4, 0xb7, 0x2a, 0x8b, 0xf7, 0xb8, 0x61, 0x0d}, - dt2: fp.Elt{0xb0, 0x36, 0xc1, 0xe9, 0xef, 0xd7, 0xa8, 0x56, 0x20, 0x4b, 0xe4, 0x58, 0xcd, 0xe5, 0x07, 0xbd, 0xab, 0xe0, 0x57, 0x1b, 0xda, 0x2f, 0xe6, 0xaf, 0xd2, 0xe8, 0x77, 0x42, 0xf7, 0x2a, 0x1a, 0x19}, - }, - { - addYX: fp.Elt{0x6a, 0x6d, 0x6d, 0xd1, 0xfa, 0xf5, 0x03, 0x30, 0xbd, 0x6d, 0xc2, 0xc8, 0xf5, 0x38, 0x80, 0x4f, 0xb2, 0xbe, 0xa1, 0x76, 0x50, 0x1a, 0x73, 0xf2, 0x78, 0x2b, 0x8e, 0x3a, 0x1e, 0x34, 0x47, 0x7b}, - subYX: fp.Elt{0xc3, 0x2c, 0x36, 0xdc, 0xc5, 0x45, 0xbc, 0xef, 0x1b, 0x64, 0xd6, 0x65, 0x28, 0xe9, 0xda, 0x84, 0x13, 0xbe, 0x27, 0x8e, 0x3f, 0x98, 0x2a, 0x37, 0xee, 0x78, 0x97, 0xd6, 0xc0, 0x6f, 0xb4, 0x53}, - dt2: fp.Elt{0x58, 0x5d, 0xa7, 0xa3, 0x68, 0xbb, 0x20, 0x30, 0x2e, 0x03, 0xe9, 0xb1, 0xd4, 0x90, 0x72, 0xe3, 0x71, 0xb2, 0x36, 0x3e, 0x73, 0xa0, 0x2e, 0x3d, 0xd1, 0x85, 0x33, 0x62, 0x4e, 0xa7, 0x7b, 0x31}, - }, - { - addYX: fp.Elt{0xbf, 0xc4, 0x38, 0x53, 0xfb, 0x68, 0xa9, 0x77, 0xce, 0x55, 0xf9, 0x05, 0xcb, 0xeb, 0xfb, 0x8c, 0x46, 0xc2, 0x32, 0x7c, 0xf0, 0xdb, 0xd7, 0x2c, 0x62, 0x8e, 0xdd, 0x54, 0x75, 0xcf, 0x3f, 0x33}, - subYX: fp.Elt{0x49, 0x50, 0x1f, 0x4e, 0x6e, 0x55, 0x55, 0xde, 0x8c, 0x4e, 0x77, 0x96, 0x38, 0x3b, 0xfe, 0xb6, 0x43, 0x3c, 0x86, 0x69, 0xc2, 0x72, 0x66, 0x1f, 0x6b, 0xf9, 0x87, 0xbc, 0x4f, 0x37, 0x3e, 0x3c}, - dt2: fp.Elt{0xd2, 0x2f, 0x06, 0x6b, 0x08, 0x07, 0x69, 0x77, 0xc0, 0x94, 0xcc, 0xae, 0x43, 0x00, 0x59, 0x6e, 0xa3, 0x63, 0xa8, 0xdd, 0xfa, 0x24, 0x18, 0xd0, 0x35, 0xc7, 0x78, 0xf7, 0x0d, 0xd4, 0x5a, 0x1e}, - }, - { - addYX: fp.Elt{0x45, 0xc1, 0x17, 0x51, 0xf8, 0xed, 0x7e, 0xc7, 0xa9, 0x1a, 0x11, 0x6e, 0x2d, 0xef, 0x0b, 0xd5, 0x3f, 0x98, 0xb0, 0xa3, 0x9d, 0x65, 0xf1, 0xcd, 0x53, 0x4a, 0x8a, 0x18, 0x70, 0x0a, 0x7f, 0x23}, - subYX: fp.Elt{0xdd, 0xef, 0xbe, 0x3a, 0x31, 0xe0, 0xbc, 0xbe, 0x6d, 0x5d, 0x79, 0x87, 0xd6, 0xbe, 0x68, 0xe3, 0x59, 0x76, 0x8c, 0x86, 0x0e, 0x7a, 0x92, 0x13, 0x14, 0x8f, 0x67, 0xb3, 0xcb, 0x1a, 0x76, 0x76}, - dt2: fp.Elt{0x56, 0x7a, 0x1c, 0x9d, 0xca, 0x96, 0xf9, 0xf9, 0x03, 0x21, 0xd4, 0xe8, 0xb3, 0xd5, 0xe9, 0x52, 0xc8, 0x54, 0x1e, 0x1b, 0x13, 0xb6, 0xfd, 0x47, 0x7d, 0x02, 0x32, 0x33, 0x27, 0xe2, 0x1f, 0x19}, - }, - }, -} - -var tabVerif = [1 << (omegaFix - 2)]pointR3{ - { /* 1P */ - addYX: fp.Elt{0x85, 0x3b, 0x8c, 0xf5, 0xc6, 0x93, 0xbc, 0x2f, 0x19, 0x0e, 0x8c, 0xfb, 0xc6, 0x2d, 0x93, 0xcf, 0xc2, 0x42, 0x3d, 0x64, 0x98, 0x48, 0x0b, 0x27, 0x65, 0xba, 0xd4, 0x33, 0x3a, 0x9d, 0xcf, 0x07}, - subYX: fp.Elt{0x3e, 0x91, 0x40, 0xd7, 0x05, 0x39, 0x10, 0x9d, 0xb3, 0xbe, 0x40, 0xd1, 0x05, 0x9f, 0x39, 0xfd, 0x09, 0x8a, 0x8f, 0x68, 0x34, 0x84, 0xc1, 0xa5, 0x67, 0x12, 0xf8, 0x98, 0x92, 0x2f, 0xfd, 0x44}, - dt2: fp.Elt{0x68, 0xaa, 0x7a, 0x87, 0x05, 0x12, 0xc9, 0xab, 0x9e, 0xc4, 0xaa, 0xcc, 0x23, 0xe8, 0xd9, 0x26, 0x8c, 0x59, 0x43, 0xdd, 0xcb, 0x7d, 0x1b, 0x5a, 0xa8, 0x65, 0x0c, 0x9f, 0x68, 0x7b, 0x11, 0x6f}, - }, - { /* 3P */ - addYX: fp.Elt{0x30, 0x97, 0xee, 0x4c, 0xa8, 0xb0, 0x25, 0xaf, 0x8a, 0x4b, 0x86, 0xe8, 0x30, 0x84, 0x5a, 0x02, 0x32, 0x67, 0x01, 0x9f, 0x02, 0x50, 0x1b, 0xc1, 0xf4, 0xf8, 0x80, 0x9a, 0x1b, 0x4e, 0x16, 0x7a}, - subYX: fp.Elt{0x65, 0xd2, 0xfc, 0xa4, 0xe8, 0x1f, 0x61, 0x56, 0x7d, 0xba, 0xc1, 0xe5, 0xfd, 0x53, 0xd3, 0x3b, 0xbd, 0xd6, 0x4b, 0x21, 0x1a, 0xf3, 0x31, 0x81, 0x62, 0xda, 0x5b, 0x55, 0x87, 0x15, 0xb9, 0x2a}, - dt2: fp.Elt{0x89, 0xd8, 0xd0, 0x0d, 0x3f, 0x93, 0xae, 0x14, 0x62, 0xda, 0x35, 0x1c, 0x22, 0x23, 0x94, 0x58, 0x4c, 0xdb, 0xf2, 0x8c, 0x45, 0xe5, 0x70, 0xd1, 0xc6, 0xb4, 0xb9, 0x12, 0xaf, 0x26, 0x28, 0x5a}, - }, - { /* 5P */ - addYX: fp.Elt{0x33, 0xbb, 0xa5, 0x08, 0x44, 0xbc, 0x12, 0xa2, 0x02, 0xed, 0x5e, 0xc7, 0xc3, 0x48, 0x50, 0x8d, 0x44, 0xec, 0xbf, 0x5a, 0x0c, 0xeb, 0x1b, 0xdd, 0xeb, 0x06, 0xe2, 0x46, 0xf1, 0xcc, 0x45, 0x29}, - subYX: fp.Elt{0xba, 0xd6, 0x47, 0xa4, 0xc3, 0x82, 0x91, 0x7f, 0xb7, 0x29, 0x27, 0x4b, 0xd1, 0x14, 0x00, 0xd5, 0x87, 0xa0, 0x64, 0xb8, 0x1c, 0xf1, 0x3c, 0xe3, 0xf3, 0x55, 0x1b, 0xeb, 0x73, 0x7e, 0x4a, 0x15}, - dt2: fp.Elt{0x85, 0x82, 0x2a, 0x81, 0xf1, 0xdb, 0xbb, 0xbc, 0xfc, 0xd1, 0xbd, 0xd0, 0x07, 0x08, 0x0e, 0x27, 0x2d, 0xa7, 0xbd, 0x1b, 0x0b, 0x67, 0x1b, 0xb4, 0x9a, 0xb6, 0x3b, 0x6b, 0x69, 0xbe, 0xaa, 0x43}, - }, - { /* 7P */ - addYX: fp.Elt{0xbf, 0xa3, 0x4e, 0x94, 0xd0, 0x5c, 0x1a, 0x6b, 0xd2, 0xc0, 0x9d, 0xb3, 0x3a, 0x35, 0x70, 0x74, 0x49, 0x2e, 0x54, 0x28, 0x82, 0x52, 0xb2, 0x71, 0x7e, 0x92, 0x3c, 0x28, 0x69, 0xea, 0x1b, 0x46}, - subYX: fp.Elt{0xb1, 0x21, 0x32, 0xaa, 0x9a, 0x2c, 0x6f, 0xba, 0xa7, 0x23, 0xba, 0x3b, 0x53, 0x21, 0xa0, 0x6c, 0x3a, 0x2c, 0x19, 0x92, 0x4f, 0x76, 0xea, 0x9d, 0xe0, 0x17, 0x53, 0x2e, 0x5d, 0xdd, 0x6e, 0x1d}, - dt2: fp.Elt{0xa2, 0xb3, 0xb8, 0x01, 0xc8, 0x6d, 0x83, 0xf1, 0x9a, 0xa4, 0x3e, 0x05, 0x47, 0x5f, 0x03, 0xb3, 0xf3, 0xad, 0x77, 0x58, 0xba, 0x41, 0x9c, 0x52, 0xa7, 0x90, 0x0f, 0x6a, 0x1c, 0xbb, 0x9f, 0x7a}, - }, - { /* 9P */ - addYX: fp.Elt{0x2f, 0x63, 0xa8, 0xa6, 0x8a, 0x67, 0x2e, 0x9b, 0xc5, 0x46, 0xbc, 0x51, 0x6f, 0x9e, 0x50, 0xa6, 0xb5, 0xf5, 0x86, 0xc6, 0xc9, 0x33, 0xb2, 0xce, 0x59, 0x7f, 0xdd, 0x8a, 0x33, 0xed, 0xb9, 0x34}, - subYX: fp.Elt{0x64, 0x80, 0x9d, 0x03, 0x7e, 0x21, 0x6e, 0xf3, 0x9b, 0x41, 0x20, 0xf5, 0xb6, 0x81, 0xa0, 0x98, 0x44, 0xb0, 0x5e, 0xe7, 0x08, 0xc6, 0xcb, 0x96, 0x8f, 0x9c, 0xdc, 0xfa, 0x51, 0x5a, 0xc0, 0x49}, - dt2: fp.Elt{0x1b, 0xaf, 0x45, 0x90, 0xbf, 0xe8, 0xb4, 0x06, 0x2f, 0xd2, 0x19, 0xa7, 0xe8, 0x83, 0xff, 0xe2, 0x16, 0xcf, 0xd4, 0x93, 0x29, 0xfc, 0xf6, 0xaa, 0x06, 0x8b, 0x00, 0x1b, 0x02, 0x72, 0xc1, 0x73}, - }, - { /* 11P */ - addYX: fp.Elt{0xde, 0x2a, 0x80, 0x8a, 0x84, 0x00, 0xbf, 0x2f, 0x27, 0x2e, 0x30, 0x02, 0xcf, 0xfe, 0xd9, 0xe5, 0x06, 0x34, 0x70, 0x17, 0x71, 0x84, 0x3e, 0x11, 0xaf, 0x8f, 0x6d, 0x54, 0xe2, 0xaa, 0x75, 0x42}, - subYX: fp.Elt{0x48, 0x43, 0x86, 0x49, 0x02, 0x5b, 0x5f, 0x31, 0x81, 0x83, 0x08, 0x77, 0x69, 0xb3, 0xd6, 0x3e, 0x95, 0xeb, 0x8d, 0x6a, 0x55, 0x75, 0xa0, 0xa3, 0x7f, 0xc7, 0xd5, 0x29, 0x80, 0x59, 0xab, 0x18}, - dt2: fp.Elt{0xe9, 0x89, 0x60, 0xfd, 0xc5, 0x2c, 0x2b, 0xd8, 0xa4, 0xe4, 0x82, 0x32, 0xa1, 0xb4, 0x1e, 0x03, 0x22, 0x86, 0x1a, 0xb5, 0x99, 0x11, 0x31, 0x44, 0x48, 0xf9, 0x3d, 0xb5, 0x22, 0x55, 0xc6, 0x3d}, - }, - { /* 13P */ - addYX: fp.Elt{0x6d, 0x7f, 0x00, 0xa2, 0x22, 0xc2, 0x70, 0xbf, 0xdb, 0xde, 0xbc, 0xb5, 0x9a, 0xb3, 0x84, 0xbf, 0x07, 0xba, 0x07, 0xfb, 0x12, 0x0e, 0x7a, 0x53, 0x41, 0xf2, 0x46, 0xc3, 0xee, 0xd7, 0x4f, 0x23}, - subYX: fp.Elt{0x93, 0xbf, 0x7f, 0x32, 0x3b, 0x01, 0x6f, 0x50, 0x6b, 0x6f, 0x77, 0x9b, 0xc9, 0xeb, 0xfc, 0xae, 0x68, 0x59, 0xad, 0xaa, 0x32, 0xb2, 0x12, 0x9d, 0xa7, 0x24, 0x60, 0x17, 0x2d, 0x88, 0x67, 0x02}, - dt2: fp.Elt{0x78, 0xa3, 0x2e, 0x73, 0x19, 0xa1, 0x60, 0x53, 0x71, 0xd4, 0x8d, 0xdf, 0xb1, 0xe6, 0x37, 0x24, 0x33, 0xe5, 0xa7, 0x91, 0xf8, 0x37, 0xef, 0xa2, 0x63, 0x78, 0x09, 0xaa, 0xfd, 0xa6, 0x7b, 0x49}, - }, - { /* 15P */ - addYX: fp.Elt{0xa0, 0xea, 0xcf, 0x13, 0x03, 0xcc, 0xce, 0x24, 0x6d, 0x24, 0x9c, 0x18, 0x8d, 0xc2, 0x48, 0x86, 0xd0, 0xd4, 0xf2, 0xc1, 0xfa, 0xbd, 0xbd, 0x2d, 0x2b, 0xe7, 0x2d, 0xf1, 0x17, 0x29, 0xe2, 0x61}, - subYX: fp.Elt{0x0b, 0xcf, 0x8c, 0x46, 0x86, 0xcd, 0x0b, 0x04, 0xd6, 0x10, 0x99, 0x2a, 0xa4, 0x9b, 0x82, 0xd3, 0x92, 0x51, 0xb2, 0x07, 0x08, 0x30, 0x08, 0x75, 0xbf, 0x5e, 0xd0, 0x18, 0x42, 0xcd, 0xb5, 0x43}, - dt2: fp.Elt{0x16, 0xb5, 0xd0, 0x9b, 0x2f, 0x76, 0x9a, 0x5d, 0xee, 0xde, 0x3f, 0x37, 0x4e, 0xaf, 0x38, 0xeb, 0x70, 0x42, 0xd6, 0x93, 0x7d, 0x5a, 0x2e, 0x03, 0x42, 0xd8, 0xe4, 0x0a, 0x21, 0x61, 0x1d, 0x51}, - }, - { /* 17P */ - addYX: fp.Elt{0x81, 0x9d, 0x0e, 0x95, 0xef, 0x76, 0xc6, 0x92, 0x4f, 0x04, 0xd7, 0xc0, 0xcd, 0x20, 0x46, 0xa5, 0x48, 0x12, 0x8f, 0x6f, 0x64, 0x36, 0x9b, 0xaa, 0xe3, 0x55, 0xb8, 0xdd, 0x24, 0x59, 0x32, 0x6d}, - subYX: fp.Elt{0x87, 0xde, 0x20, 0x44, 0x48, 0x86, 0x13, 0x08, 0xb4, 0xed, 0x92, 0xb5, 0x16, 0xf0, 0x1c, 0x8a, 0x25, 0x2d, 0x94, 0x29, 0x27, 0x4e, 0xfa, 0x39, 0x10, 0x28, 0x48, 0xe2, 0x6f, 0xfe, 0xa7, 0x71}, - dt2: fp.Elt{0x54, 0xc8, 0xc8, 0xa5, 0xb8, 0x82, 0x71, 0x6c, 0x03, 0x2a, 0x5f, 0xfe, 0x79, 0x14, 0xfd, 0x33, 0x0c, 0x8d, 0x77, 0x83, 0x18, 0x59, 0xcf, 0x72, 0xa9, 0xea, 0x9e, 0x55, 0xb6, 0xc4, 0x46, 0x47}, - }, - { /* 19P */ - addYX: fp.Elt{0x2b, 0x9a, 0xc6, 0x6d, 0x3c, 0x7b, 0x77, 0xd3, 0x17, 0xf6, 0x89, 0x6f, 0x27, 0xb2, 0xfa, 0xde, 0xb5, 0x16, 0x3a, 0xb5, 0xf7, 0x1c, 0x65, 0x45, 0xb7, 0x9f, 0xfe, 0x34, 0xde, 0x51, 0x9a, 0x5c}, - subYX: fp.Elt{0x47, 0x11, 0x74, 0x64, 0xc8, 0x46, 0x85, 0x34, 0x49, 0xc8, 0xfc, 0x0e, 0xdd, 0xae, 0x35, 0x7d, 0x32, 0xa3, 0x72, 0x06, 0x76, 0x9a, 0x93, 0xff, 0xd6, 0xe6, 0xb5, 0x7d, 0x49, 0x63, 0x96, 0x21}, - dt2: fp.Elt{0x67, 0x0e, 0xf1, 0x79, 0xcf, 0xf1, 0x10, 0xf5, 0x5b, 0x51, 0x58, 0xe6, 0xa1, 0xda, 0xdd, 0xff, 0x77, 0x22, 0x14, 0x10, 0x17, 0xa7, 0xc3, 0x09, 0xbb, 0x23, 0x82, 0x60, 0x3c, 0x50, 0x04, 0x48}, - }, - { /* 21P */ - addYX: fp.Elt{0xc7, 0x7f, 0xa3, 0x2c, 0xd0, 0x9e, 0x24, 0xc4, 0xab, 0xac, 0x15, 0xa6, 0xe3, 0xa0, 0x59, 0xa0, 0x23, 0x0e, 0x6e, 0xc9, 0xd7, 0x6e, 0xa9, 0x88, 0x6d, 0x69, 0x50, 0x16, 0xa5, 0x98, 0x33, 0x55}, - subYX: fp.Elt{0x75, 0xd1, 0x36, 0x3a, 0xd2, 0x21, 0x68, 0x3b, 0x32, 0x9e, 0x9b, 0xe9, 0xa7, 0x0a, 0xb4, 0xbb, 0x47, 0x8a, 0x83, 0x20, 0xe4, 0x5c, 0x9e, 0x5d, 0x5e, 0x4c, 0xde, 0x58, 0x88, 0x09, 0x1e, 0x77}, - dt2: fp.Elt{0xdf, 0x1e, 0x45, 0x78, 0xd2, 0xf5, 0x12, 0x9a, 0xcb, 0x9c, 0x89, 0x85, 0x79, 0x5d, 0xda, 0x3a, 0x08, 0x95, 0xa5, 0x9f, 0x2d, 0x4a, 0x7f, 0x47, 0x11, 0xa6, 0xf5, 0x8f, 0xd6, 0xd1, 0x5e, 0x5a}, - }, - { /* 23P */ - addYX: fp.Elt{0x83, 0x0e, 0x15, 0xfe, 0x2a, 0x12, 0x95, 0x11, 0xd8, 0x35, 0x4b, 0x7e, 0x25, 0x9a, 0x20, 0xcf, 0x20, 0x1e, 0x71, 0x1e, 0x29, 0xf8, 0x87, 0x73, 0xf0, 0x92, 0xbf, 0xd8, 0x97, 0xb8, 0xac, 0x44}, - subYX: fp.Elt{0x59, 0x73, 0x52, 0x58, 0xc5, 0xe0, 0xe5, 0xba, 0x7e, 0x9d, 0xdb, 0xca, 0x19, 0x5c, 0x2e, 0x39, 0xe9, 0xab, 0x1c, 0xda, 0x1e, 0x3c, 0x65, 0x28, 0x44, 0xdc, 0xef, 0x5f, 0x13, 0x60, 0x9b, 0x01}, - dt2: fp.Elt{0x83, 0x4b, 0x13, 0x5e, 0x14, 0x68, 0x60, 0x1e, 0x16, 0x4c, 0x30, 0x24, 0x4f, 0xe6, 0xf5, 0xc4, 0xd7, 0x3e, 0x1a, 0xfc, 0xa8, 0x88, 0x6e, 0x50, 0x92, 0x2f, 0xad, 0xe6, 0xfd, 0x49, 0x0c, 0x15}, - }, - { /* 25P */ - addYX: fp.Elt{0x38, 0x11, 0x47, 0x09, 0x95, 0xf2, 0x7b, 0x8e, 0x51, 0xa6, 0x75, 0x4f, 0x39, 0xef, 0x6f, 0x5d, 0xad, 0x08, 0xa7, 0x25, 0xc4, 0x79, 0xaf, 0x10, 0x22, 0x99, 0xb9, 0x5b, 0x07, 0x5a, 0x2b, 0x6b}, - subYX: fp.Elt{0x68, 0xa8, 0xdc, 0x9c, 0x3c, 0x86, 0x49, 0xb8, 0xd0, 0x4a, 0x71, 0xb8, 0xdb, 0x44, 0x3f, 0xc8, 0x8d, 0x16, 0x36, 0x0c, 0x56, 0xe3, 0x3e, 0xfe, 0xc1, 0xfb, 0x05, 0x1e, 0x79, 0xd7, 0xa6, 0x78}, - dt2: fp.Elt{0x76, 0xb9, 0xa0, 0x47, 0x4b, 0x70, 0xbf, 0x58, 0xd5, 0x48, 0x17, 0x74, 0x55, 0xb3, 0x01, 0xa6, 0x90, 0xf5, 0x42, 0xd5, 0xb1, 0x1f, 0x2b, 0xaa, 0x00, 0x5d, 0xd5, 0x4a, 0xfc, 0x7f, 0x5c, 0x72}, - }, - { /* 27P */ - addYX: fp.Elt{0xb2, 0x99, 0xcf, 0xd1, 0x15, 0x67, 0x42, 0xe4, 0x34, 0x0d, 0xa2, 0x02, 0x11, 0xd5, 0x52, 0x73, 0x9f, 0x10, 0x12, 0x8b, 0x7b, 0x15, 0xd1, 0x23, 0xa3, 0xf3, 0xb1, 0x7c, 0x27, 0xc9, 0x4c, 0x79}, - subYX: fp.Elt{0xc0, 0x98, 0xd0, 0x1c, 0xf7, 0x2b, 0x80, 0x91, 0x66, 0x63, 0x5e, 0xed, 0xa4, 0x6c, 0x41, 0xfe, 0x4c, 0x99, 0x02, 0x49, 0x71, 0x5d, 0x58, 0xdf, 0xe7, 0xfa, 0x55, 0xf8, 0x25, 0x46, 0xd5, 0x4c}, - dt2: fp.Elt{0x53, 0x50, 0xac, 0xc2, 0x26, 0xc4, 0xf6, 0x4a, 0x58, 0x72, 0xf6, 0x32, 0xad, 0xed, 0x9a, 0xbc, 0x21, 0x10, 0x31, 0x0a, 0xf1, 0x32, 0xd0, 0x2a, 0x85, 0x8e, 0xcc, 0x6f, 0x7b, 0x35, 0x08, 0x70}, - }, - { /* 29P */ - addYX: fp.Elt{0x01, 0x3f, 0x77, 0x38, 0x27, 0x67, 0x88, 0x0b, 0xfb, 0xcc, 0xfb, 0x95, 0xfa, 0xc8, 0xcc, 0xb8, 0xb6, 0x29, 0xad, 0xb9, 0xa3, 0xd5, 0x2d, 0x8d, 0x6a, 0x0f, 0xad, 0x51, 0x98, 0x7e, 0xef, 0x06}, - subYX: fp.Elt{0x34, 0x4a, 0x58, 0x82, 0xbb, 0x9f, 0x1b, 0xd0, 0x2b, 0x79, 0xb4, 0xd2, 0x63, 0x64, 0xab, 0x47, 0x02, 0x62, 0x53, 0x48, 0x9c, 0x63, 0x31, 0xb6, 0x28, 0xd4, 0xd6, 0x69, 0x36, 0x2a, 0xa9, 0x13}, - dt2: fp.Elt{0xe5, 0x7d, 0x57, 0xc0, 0x1c, 0x77, 0x93, 0xca, 0x5c, 0xdc, 0x35, 0x50, 0x1e, 0xe4, 0x40, 0x75, 0x71, 0xe0, 0x02, 0xd8, 0x01, 0x0f, 0x68, 0x24, 0x6a, 0xf8, 0x2a, 0x8a, 0xdf, 0x6d, 0x29, 0x3c}, - }, - { /* 31P */ - addYX: fp.Elt{0x13, 0xa7, 0x14, 0xd9, 0xf9, 0x15, 0xad, 0xae, 0x12, 0xf9, 0x8f, 0x8c, 0xf9, 0x7b, 0x2f, 0xa9, 0x30, 0xd7, 0x53, 0x9f, 0x17, 0x23, 0xf8, 0xaf, 0xba, 0x77, 0x0c, 0x49, 0x93, 0xd3, 0x99, 0x7a}, - subYX: fp.Elt{0x41, 0x25, 0x1f, 0xbb, 0x2e, 0x4d, 0xeb, 0xfc, 0x1f, 0xb9, 0xad, 0x40, 0xc7, 0x10, 0x95, 0xb8, 0x05, 0xad, 0xa1, 0xd0, 0x7d, 0xa3, 0x71, 0xfc, 0x7b, 0x71, 0x47, 0x07, 0x70, 0x2c, 0x89, 0x0a}, - dt2: fp.Elt{0xe8, 0xa3, 0xbd, 0x36, 0x24, 0xed, 0x52, 0x8f, 0x94, 0x07, 0xe8, 0x57, 0x41, 0xc8, 0xa8, 0x77, 0xe0, 0x9c, 0x2f, 0x26, 0x63, 0x65, 0xa9, 0xa5, 0xd2, 0xf7, 0x02, 0x83, 0xd2, 0x62, 0x67, 0x28}, - }, - { /* 33P */ - addYX: fp.Elt{0x25, 0x5b, 0xe3, 0x3c, 0x09, 0x36, 0x78, 0x4e, 0x97, 0xaa, 0x6b, 0xb2, 0x1d, 0x18, 0xe1, 0x82, 0x3f, 0xb8, 0xc7, 0xcb, 0xd3, 0x92, 0xc1, 0x0c, 0x3a, 0x9d, 0x9d, 0x6a, 0x04, 0xda, 0xf1, 0x32}, - subYX: fp.Elt{0xbd, 0xf5, 0x2e, 0xce, 0x2b, 0x8e, 0x55, 0x7c, 0x63, 0xbc, 0x47, 0x67, 0xb4, 0x6c, 0x98, 0xe4, 0xb8, 0x89, 0xbb, 0x3b, 0x9f, 0x17, 0x4a, 0x15, 0x7a, 0x76, 0xf1, 0xd6, 0xa3, 0xf2, 0x86, 0x76}, - dt2: fp.Elt{0x6a, 0x7c, 0x59, 0x6d, 0xa6, 0x12, 0x8d, 0xaa, 0x2b, 0x85, 0xd3, 0x04, 0x03, 0x93, 0x11, 0x8f, 0x22, 0xb0, 0x09, 0xc2, 0x73, 0xdc, 0x91, 0x3f, 0xa6, 0x28, 0xad, 0xa9, 0xf8, 0x05, 0x13, 0x56}, - }, - { /* 35P */ - addYX: fp.Elt{0xd1, 0xae, 0x92, 0xec, 0x8d, 0x97, 0x0c, 0x10, 0xe5, 0x73, 0x6d, 0x4d, 0x43, 0xd5, 0x43, 0xca, 0x48, 0xba, 0x47, 0xd8, 0x22, 0x1b, 0x13, 0x83, 0x2c, 0x4d, 0x5d, 0xe3, 0x53, 0xec, 0xaa}, - subYX: fp.Elt{0xd5, 0xc0, 0xb0, 0xe7, 0x28, 0xcc, 0x22, 0x67, 0x53, 0x5c, 0x07, 0xdb, 0xbb, 0xe9, 0x9d, 0x70, 0x61, 0x0a, 0x01, 0xd7, 0xa7, 0x8d, 0xf6, 0xca, 0x6c, 0xcc, 0x57, 0x2c, 0xef, 0x1a, 0x0a, 0x03}, - dt2: fp.Elt{0xaa, 0xd2, 0x3a, 0x00, 0x73, 0xf7, 0xb1, 0x7b, 0x08, 0x66, 0x21, 0x2b, 0x80, 0x29, 0x3f, 0x0b, 0x3e, 0xd2, 0x0e, 0x52, 0x86, 0xdc, 0x21, 0x78, 0x80, 0x54, 0x06, 0x24, 0x1c, 0x9c, 0xbe, 0x20}, - }, - { /* 37P */ - addYX: fp.Elt{0xa6, 0x73, 0x96, 0x24, 0xd8, 0x87, 0x53, 0xe1, 0x93, 0xe4, 0x46, 0xf5, 0x2d, 0xbc, 0x43, 0x59, 0xb5, 0x63, 0x6f, 0xc3, 0x81, 0x9a, 0x7f, 0x1c, 0xde, 0xc1, 0x0a, 0x1f, 0x36, 0xb3, 0x0a, 0x75}, - subYX: fp.Elt{0x60, 0x5e, 0x02, 0xe2, 0x4a, 0xe4, 0xe0, 0x20, 0x38, 0xb9, 0xdc, 0xcb, 0x2f, 0x3b, 0x3b, 0xb0, 0x1c, 0x0d, 0x5a, 0xf9, 0x9c, 0x63, 0x5d, 0x10, 0x11, 0xe3, 0x67, 0x50, 0x54, 0x4c, 0x76, 0x69}, - dt2: fp.Elt{0x37, 0x10, 0xf8, 0xa2, 0x83, 0x32, 0x8a, 0x1e, 0xf1, 0xcb, 0x7f, 0xbd, 0x23, 0xda, 0x2e, 0x6f, 0x63, 0x25, 0x2e, 0xac, 0x5b, 0xd1, 0x2f, 0xb7, 0x40, 0x50, 0x07, 0xb7, 0x3f, 0x6b, 0xf9, 0x54}, - }, - { /* 39P */ - addYX: fp.Elt{0x79, 0x92, 0x66, 0x29, 0x04, 0xf2, 0xad, 0x0f, 0x4a, 0x72, 0x7d, 0x7d, 0x04, 0xa2, 0xdd, 0x3a, 0xf1, 0x60, 0x57, 0x8c, 0x82, 0x94, 0x3d, 0x6f, 0x9e, 0x53, 0xb7, 0x2b, 0xc5, 0xe9, 0x7f, 0x3d}, - subYX: fp.Elt{0xcd, 0x1e, 0xb1, 0x16, 0xc6, 0xaf, 0x7d, 0x17, 0x79, 0x64, 0x57, 0xfa, 0x9c, 0x4b, 0x76, 0x89, 0x85, 0xe7, 0xec, 0xe6, 0x10, 0xa1, 0xa8, 0xb7, 0xf0, 0xdb, 0x85, 0xbe, 0x9f, 0x83, 0xe6, 0x78}, - dt2: fp.Elt{0x6b, 0x85, 0xb8, 0x37, 0xf7, 0x2d, 0x33, 0x70, 0x8a, 0x17, 0x1a, 0x04, 0x43, 0x5d, 0xd0, 0x75, 0x22, 0x9e, 0xe5, 0xa0, 0x4a, 0xf7, 0x0f, 0x32, 0x42, 0x82, 0x08, 0x50, 0xf3, 0x68, 0xf2, 0x70}, - }, - { /* 41P */ - addYX: fp.Elt{0x47, 0x5f, 0x80, 0xb1, 0x83, 0x45, 0x86, 0x66, 0x19, 0x7c, 0xdd, 0x60, 0xd1, 0xc5, 0x35, 0xf5, 0x06, 0xb0, 0x4c, 0x1e, 0xb7, 0x4e, 0x87, 0xe9, 0xd9, 0x89, 0xd8, 0xfa, 0x5c, 0x34, 0x0d, 0x7c}, - subYX: fp.Elt{0x55, 0xf3, 0xdc, 0x70, 0x20, 0x11, 0x24, 0x23, 0x17, 0xe1, 0xfc, 0xe7, 0x7e, 0xc9, 0x0c, 0x38, 0x98, 0xb6, 0x52, 0x35, 0xed, 0xde, 0x1d, 0xb3, 0xb9, 0xc4, 0xb8, 0x39, 0xc0, 0x56, 0x4e, 0x40}, - dt2: fp.Elt{0x8a, 0x33, 0x78, 0x8c, 0x4b, 0x1f, 0x1f, 0x59, 0xe1, 0xb5, 0xe0, 0x67, 0xb1, 0x6a, 0x36, 0xa0, 0x44, 0x3d, 0x5f, 0xb4, 0x52, 0x41, 0xbc, 0x5c, 0x77, 0xc7, 0xae, 0x2a, 0x76, 0x54, 0xd7, 0x20}, - }, - { /* 43P */ - addYX: fp.Elt{0x58, 0xb7, 0x3b, 0xc7, 0x6f, 0xc3, 0x8f, 0x5e, 0x9a, 0xbb, 0x3c, 0x36, 0xa5, 0x43, 0xe5, 0xac, 0x22, 0xc9, 0x3b, 0x90, 0x7d, 0x4a, 0x93, 0xa9, 0x62, 0xec, 0xce, 0xf3, 0x46, 0x1e, 0x8f, 0x2b}, - subYX: fp.Elt{0x43, 0xf5, 0xb9, 0x35, 0xb1, 0xfe, 0x74, 0x9d, 0x6c, 0x95, 0x8c, 0xde, 0xf1, 0x7d, 0xb3, 0x84, 0xa9, 0x8b, 0x13, 0x57, 0x07, 0x2b, 0x32, 0xe9, 0xe1, 0x4c, 0x0b, 0x79, 0xa8, 0xad, 0xb8, 0x38}, - dt2: fp.Elt{0x5d, 0xf9, 0x51, 0xdf, 0x9c, 0x4a, 0xc0, 0xb5, 0xac, 0xde, 0x1f, 0xcb, 0xae, 0x52, 0x39, 0x2b, 0xda, 0x66, 0x8b, 0x32, 0x8b, 0x6d, 0x10, 0x1d, 0x53, 0x19, 0xba, 0xce, 0x32, 0xeb, 0x9a, 0x04}, - }, - { /* 45P */ - addYX: fp.Elt{0x31, 0x79, 0xfc, 0x75, 0x0b, 0x7d, 0x50, 0xaa, 0xd3, 0x25, 0x67, 0x7a, 0x4b, 0x92, 0xef, 0x0f, 0x30, 0x39, 0x6b, 0x39, 0x2b, 0x54, 0x82, 0x1d, 0xfc, 0x74, 0xf6, 0x30, 0x75, 0xe1, 0x5e, 0x79}, - subYX: fp.Elt{0x7e, 0xfe, 0xdc, 0x63, 0x3c, 0x7d, 0x76, 0xd7, 0x40, 0x6e, 0x85, 0x97, 0x48, 0x59, 0x9c, 0x20, 0x13, 0x7c, 0x4f, 0xe1, 0x61, 0x68, 0x67, 0xb6, 0xfc, 0x25, 0xd6, 0xc8, 0xe0, 0x65, 0xc6, 0x51}, - dt2: fp.Elt{0x81, 0xbd, 0xec, 0x52, 0x0a, 0x5b, 0x4a, 0x25, 0xe7, 0xaf, 0x34, 0xe0, 0x6e, 0x1f, 0x41, 0x5d, 0x31, 0x4a, 0xee, 0xca, 0x0d, 0x4d, 0xa2, 0xe6, 0x77, 0x44, 0xc5, 0x9d, 0xf4, 0x9b, 0xd1, 0x6c}, - }, - { /* 47P */ - addYX: fp.Elt{0x86, 0xc3, 0xaf, 0x65, 0x21, 0x61, 0xfe, 0x1f, 0x10, 0x1b, 0xd5, 0xb8, 0x88, 0x2a, 0x2a, 0x08, 0xaa, 0x0b, 0x99, 0x20, 0x7e, 0x62, 0xf6, 0x76, 0xe7, 0x43, 0x9e, 0x42, 0xa7, 0xb3, 0x01, 0x5e}, - subYX: fp.Elt{0xa3, 0x9c, 0x17, 0x52, 0x90, 0x61, 0x87, 0x7e, 0x85, 0x9f, 0x2c, 0x0b, 0x06, 0x0a, 0x1d, 0x57, 0x1e, 0x71, 0x99, 0x84, 0xa8, 0xba, 0xa2, 0x80, 0x38, 0xe6, 0xb2, 0x40, 0xdb, 0xf3, 0x20, 0x75}, - dt2: fp.Elt{0xa1, 0x57, 0x93, 0xd3, 0xe3, 0x0b, 0xb5, 0x3d, 0xa5, 0x94, 0x9e, 0x59, 0xdd, 0x6c, 0x7b, 0x96, 0x6e, 0x1e, 0x31, 0xdf, 0x64, 0x9a, 0x30, 0x1a, 0x86, 0xc9, 0xf3, 0xce, 0x9c, 0x2c, 0x09, 0x71}, - }, - { /* 49P */ - addYX: fp.Elt{0xcf, 0x1d, 0x05, 0x74, 0xac, 0xd8, 0x6b, 0x85, 0x1e, 0xaa, 0xb7, 0x55, 0x08, 0xa4, 0xf6, 0x03, 0xeb, 0x3c, 0x74, 0xc9, 0xcb, 0xe7, 0x4a, 0x3a, 0xde, 0xab, 0x37, 0x71, 0xbb, 0xa5, 0x73, 0x41}, - subYX: fp.Elt{0x8c, 0x91, 0x64, 0x03, 0x3f, 0x52, 0xd8, 0x53, 0x1c, 0x6b, 0xab, 0x3f, 0xf4, 0x04, 0xb4, 0xa2, 0xa4, 0xe5, 0x81, 0x66, 0x9e, 0x4a, 0x0b, 0x08, 0xa7, 0x7b, 0x25, 0xd0, 0x03, 0x5b, 0xa1, 0x0e}, - dt2: fp.Elt{0x8a, 0x21, 0xf9, 0xf0, 0x31, 0x6e, 0xc5, 0x17, 0x08, 0x47, 0xfc, 0x1a, 0x2b, 0x6e, 0x69, 0x5a, 0x76, 0xf1, 0xb2, 0xf4, 0x68, 0x16, 0x93, 0xf7, 0x67, 0x3a, 0x4e, 0x4a, 0x61, 0x65, 0xc5, 0x5f}, - }, - { /* 51P */ - addYX: fp.Elt{0x8e, 0x98, 0x90, 0x77, 0xe6, 0xe1, 0x92, 0x48, 0x22, 0xd7, 0x5c, 0x1c, 0x0f, 0x95, 0xd5, 0x01, 0xed, 0x3e, 0x92, 0xe5, 0x9a, 0x81, 0xb0, 0xe3, 0x1b, 0x65, 0x46, 0x9d, 0x40, 0xc7, 0x14, 0x32}, - subYX: fp.Elt{0xe5, 0x7a, 0x6d, 0xc4, 0x0d, 0x57, 0x6e, 0x13, 0x8f, 0xdc, 0xf8, 0x54, 0xcc, 0xaa, 0xd0, 0x0f, 0x86, 0xad, 0x0d, 0x31, 0x03, 0x9f, 0x54, 0x59, 0xa1, 0x4a, 0x45, 0x4c, 0x41, 0x1c, 0x71, 0x62}, - dt2: fp.Elt{0x70, 0x17, 0x65, 0x06, 0x74, 0x82, 0x29, 0x13, 0x36, 0x94, 0x27, 0x8a, 0x66, 0xa0, 0xa4, 0x3b, 0x3c, 0x22, 0x5d, 0x18, 0xec, 0xb8, 0xb6, 0xd9, 0x3c, 0x83, 0xcb, 0x3e, 0x07, 0x94, 0xea, 0x5b}, - }, - { /* 53P */ - addYX: fp.Elt{0xf8, 0xd2, 0x43, 0xf3, 0x63, 0xce, 0x70, 0xb4, 0xf1, 0xe8, 0x43, 0x05, 0x8f, 0xba, 0x67, 0x00, 0x6f, 0x7b, 0x11, 0xa2, 0xa1, 0x51, 0xda, 0x35, 0x2f, 0xbd, 0xf1, 0x44, 0x59, 0x78, 0xd0, 0x4a}, - subYX: fp.Elt{0xe4, 0x9b, 0xc8, 0x12, 0x09, 0xbf, 0x1d, 0x64, 0x9c, 0x57, 0x6e, 0x7d, 0x31, 0x8b, 0xf3, 0xac, 0x65, 0xb0, 0x97, 0xf6, 0x02, 0x9e, 0xfe, 0xab, 0xec, 0x1e, 0xf6, 0x48, 0xc1, 0xd5, 0xac, 0x3a}, - dt2: fp.Elt{0x01, 0x83, 0x31, 0xc3, 0x34, 0x3b, 0x8e, 0x85, 0x26, 0x68, 0x31, 0x07, 0x47, 0xc0, 0x99, 0xdc, 0x8c, 0xa8, 0x9d, 0xd3, 0x2e, 0x5b, 0x08, 0x34, 0x3d, 0x85, 0x02, 0xd9, 0xb1, 0x0c, 0xff, 0x3a}, - }, - { /* 55P */ - addYX: fp.Elt{0x05, 0x35, 0xc5, 0xf4, 0x0b, 0x43, 0x26, 0x92, 0x83, 0x22, 0x1f, 0x26, 0x13, 0x9c, 0xe4, 0x68, 0xc6, 0x27, 0xd3, 0x8f, 0x78, 0x33, 0xef, 0x09, 0x7f, 0x9e, 0xd9, 0x2b, 0x73, 0x9f, 0xcf, 0x2c}, - subYX: fp.Elt{0x5e, 0x40, 0x20, 0x3a, 0xeb, 0xc7, 0xc5, 0x87, 0xc9, 0x56, 0xad, 0xed, 0xef, 0x11, 0xe3, 0x8e, 0xf9, 0xd5, 0x29, 0xad, 0x48, 0x2e, 0x25, 0x29, 0x1d, 0x25, 0xcd, 0xf4, 0x86, 0x7e, 0x0e, 0x11}, - dt2: fp.Elt{0xe4, 0xf5, 0x03, 0xd6, 0x9e, 0xd8, 0xc0, 0x57, 0x0c, 0x20, 0xb0, 0xf0, 0x28, 0x86, 0x88, 0x12, 0xb7, 0x3b, 0x2e, 0xa0, 0x09, 0x27, 0x17, 0x53, 0x37, 0x3a, 0x69, 0xb9, 0xe0, 0x57, 0xc5, 0x05}, - }, - { /* 57P */ - addYX: fp.Elt{0xb0, 0x0e, 0xc2, 0x89, 0xb0, 0xbb, 0x76, 0xf7, 0x5c, 0xd8, 0x0f, 0xfa, 0xf6, 0x5b, 0xf8, 0x61, 0xfb, 0x21, 0x44, 0x63, 0x4e, 0x3f, 0xb9, 0xb6, 0x05, 0x12, 0x86, 0x41, 0x08, 0xef, 0x9f, 0x28}, - subYX: fp.Elt{0x6f, 0x7e, 0xc9, 0x1f, 0x31, 0xce, 0xf9, 0xd8, 0xae, 0xfd, 0xf9, 0x11, 0x30, 0x26, 0x3f, 0x7a, 0xdd, 0x25, 0xed, 0x8b, 0xa0, 0x7e, 0x5b, 0xe1, 0x5a, 0x87, 0xe9, 0x8f, 0x17, 0x4c, 0x15, 0x6e}, - dt2: fp.Elt{0xbf, 0x9a, 0xd6, 0xfe, 0x36, 0x63, 0x61, 0xcf, 0x4f, 0xc9, 0x35, 0x83, 0xe7, 0xe4, 0x16, 0x9b, 0xe7, 0x7f, 0x3a, 0x75, 0x65, 0x97, 0x78, 0x13, 0x19, 0xa3, 0x5c, 0xa9, 0x42, 0xf6, 0xfb, 0x6a}, - }, - { /* 59P */ - addYX: fp.Elt{0xcc, 0xa8, 0x13, 0xf9, 0x70, 0x50, 0xe5, 0x5d, 0x61, 0xf5, 0x0c, 0x2b, 0x7b, 0x16, 0x1d, 0x7d, 0x89, 0xd4, 0xea, 0x90, 0xb6, 0x56, 0x29, 0xda, 0xd9, 0x1e, 0x80, 0xdb, 0xce, 0x93, 0xc0, 0x12}, - subYX: fp.Elt{0xc1, 0xd2, 0xf5, 0x62, 0x0c, 0xde, 0xa8, 0x7d, 0x9a, 0x7b, 0x0e, 0xb0, 0xa4, 0x3d, 0xfc, 0x98, 0xe0, 0x70, 0xad, 0x0d, 0xda, 0x6a, 0xeb, 0x7d, 0xc4, 0x38, 0x50, 0xb9, 0x51, 0xb8, 0xb4, 0x0d}, - dt2: fp.Elt{0x0f, 0x19, 0xb8, 0x08, 0x93, 0x7f, 0x14, 0xfc, 0x10, 0xe3, 0x1a, 0xa1, 0xa0, 0x9d, 0x96, 0x06, 0xfd, 0xd7, 0xc7, 0xda, 0x72, 0x55, 0xe7, 0xce, 0xe6, 0x5c, 0x63, 0xc6, 0x99, 0x87, 0xaa, 0x33}, - }, - { /* 61P */ - addYX: fp.Elt{0xb1, 0x6c, 0x15, 0xfc, 0x88, 0xf5, 0x48, 0x83, 0x27, 0x6d, 0x0a, 0x1a, 0x9b, 0xba, 0xa2, 0x6d, 0xb6, 0x5a, 0xca, 0x87, 0x5c, 0x2d, 0x26, 0xe2, 0xa6, 0x89, 0xd5, 0xc8, 0xc1, 0xd0, 0x2c, 0x21}, - subYX: fp.Elt{0xf2, 0x5c, 0x08, 0xbd, 0x1e, 0xf5, 0x0f, 0xaf, 0x1f, 0x3f, 0xd3, 0x67, 0x89, 0x1a, 0xf5, 0x78, 0x3c, 0x03, 0x60, 0x50, 0xe1, 0xbf, 0xc2, 0x6e, 0x86, 0x1a, 0xe2, 0xe8, 0x29, 0x6f, 0x3c, 0x23}, - dt2: fp.Elt{0x81, 0xc7, 0x18, 0x7f, 0x10, 0xd5, 0xf4, 0xd2, 0x28, 0x9d, 0x7e, 0x52, 0xf2, 0xcd, 0x2e, 0x12, 0x41, 0x33, 0x3d, 0x3d, 0x2a, 0x86, 0x0a, 0xa7, 0xe3, 0x4c, 0x91, 0x11, 0x89, 0x77, 0xb7, 0x1d}, - }, - { /* 63P */ - addYX: fp.Elt{0xb6, 0x1a, 0x70, 0xdd, 0x69, 0x47, 0x39, 0xb3, 0xa5, 0x8d, 0xcf, 0x19, 0xd4, 0xde, 0xb8, 0xe2, 0x52, 0xc8, 0x2a, 0xfd, 0x61, 0x41, 0xdf, 0x15, 0xbe, 0x24, 0x7d, 0x01, 0x8a, 0xca, 0xe2, 0x7a}, - subYX: fp.Elt{0x6f, 0xc2, 0x6b, 0x7c, 0x39, 0x52, 0xf3, 0xdd, 0x13, 0x01, 0xd5, 0x53, 0xcc, 0xe2, 0x97, 0x7a, 0x30, 0xa3, 0x79, 0xbf, 0x3a, 0xf4, 0x74, 0x7c, 0xfc, 0xad, 0xe2, 0x26, 0xad, 0x97, 0xad, 0x31}, - dt2: fp.Elt{0x62, 0xb9, 0x20, 0x09, 0xed, 0x17, 0xe8, 0xb7, 0x9d, 0xda, 0x19, 0x3f, 0xcc, 0x18, 0x85, 0x1e, 0x64, 0x0a, 0x56, 0x25, 0x4f, 0xc1, 0x91, 0xe4, 0x83, 0x2c, 0x62, 0xa6, 0x53, 0xfc, 0xd1, 0x1e}, - }, -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go b/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go deleted file mode 100644 index 324bd8f334..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed448/ed448.go +++ /dev/null @@ -1,411 +0,0 @@ -// Package ed448 implements Ed448 signature scheme as described in RFC-8032. -// -// This package implements two signature variants. -// -// | Scheme Name | Sign Function | Verification | Context | -// |-------------|-------------------|---------------|-------------------| -// | Ed448 | Sign | Verify | Yes, can be empty | -// | Ed448Ph | SignPh | VerifyPh | Yes, can be empty | -// | All above | (PrivateKey).Sign | VerifyAny | As above | -// -// Specific functions for sign and verify are defined. A generic signing -// function for all schemes is available through the crypto.Signer interface, -// which is implemented by the PrivateKey type. A correspond all-in-one -// verification method is provided by the VerifyAny function. -// -// Both schemes require a context string for domain separation. This parameter -// is passed using a SignerOptions struct defined in this package. -// -// References: -// -// - RFC8032: https://rfc-editor.org/rfc/rfc8032.txt -// - EdDSA for more curves: https://eprint.iacr.org/2015/677 -// - High-speed high-security signatures: https://doi.org/10.1007/s13389-012-0027-1 -package ed448 - -import ( - "bytes" - "crypto" - cryptoRand "crypto/rand" - "crypto/subtle" - "errors" - "fmt" - "io" - "strconv" - - "github.com/cloudflare/circl/ecc/goldilocks" - "github.com/cloudflare/circl/internal/sha3" - "github.com/cloudflare/circl/sign" -) - -const ( - // ContextMaxSize is the maximum length (in bytes) allowed for context. - ContextMaxSize = 255 - // PublicKeySize is the length in bytes of Ed448 public keys. - PublicKeySize = 57 - // PrivateKeySize is the length in bytes of Ed448 private keys. - PrivateKeySize = 114 - // SignatureSize is the length in bytes of signatures. - SignatureSize = 114 - // SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032. - SeedSize = 57 -) - -const ( - paramB = 456 / 8 // Size of keys in bytes. - hashSize = 2 * paramB // Size of the hash function's output. -) - -// SignerOptions implements crypto.SignerOpts and augments with parameters -// that are specific to the Ed448 signature schemes. -type SignerOptions struct { - // Hash must be crypto.Hash(0) for both Ed448 and Ed448Ph. - crypto.Hash - - // Context is an optional domain separation string for signing. - // Its length must be less or equal than 255 bytes. - Context string - - // Scheme is an identifier for choosing a signature scheme. - Scheme SchemeID -} - -// SchemeID is an identifier for each signature scheme. -type SchemeID uint - -const ( - ED448 SchemeID = iota - ED448Ph -) - -// PublicKey is the type of Ed448 public keys. -type PublicKey []byte - -// Equal reports whether pub and x have the same value. -func (pub PublicKey) Equal(x crypto.PublicKey) bool { - xx, ok := x.(PublicKey) - return ok && bytes.Equal(pub, xx) -} - -// PrivateKey is the type of Ed448 private keys. It implements crypto.Signer. -type PrivateKey []byte - -// Equal reports whether priv and x have the same value. -func (priv PrivateKey) Equal(x crypto.PrivateKey) bool { - xx, ok := x.(PrivateKey) - return ok && subtle.ConstantTimeCompare(priv, xx) == 1 -} - -// Public returns the PublicKey corresponding to priv. -func (priv PrivateKey) Public() crypto.PublicKey { - publicKey := make([]byte, PublicKeySize) - copy(publicKey, priv[SeedSize:]) - return PublicKey(publicKey) -} - -// Seed returns the private key seed corresponding to priv. It is provided for -// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds -// in this package. -func (priv PrivateKey) Seed() []byte { - seed := make([]byte, SeedSize) - copy(seed, priv[:SeedSize]) - return seed -} - -func (priv PrivateKey) Scheme() sign.Scheme { return sch } - -func (pub PublicKey) Scheme() sign.Scheme { return sch } - -func (priv PrivateKey) MarshalBinary() (data []byte, err error) { - privateKey := make(PrivateKey, PrivateKeySize) - copy(privateKey, priv) - return privateKey, nil -} - -func (pub PublicKey) MarshalBinary() (data []byte, err error) { - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, pub) - return publicKey, nil -} - -// Sign creates a signature of a message given a key pair. -// This function supports all the two signature variants defined in RFC-8032, -// namely Ed448 (or pure EdDSA) and Ed448Ph. -// The opts.HashFunc() must return zero to the specify Ed448 variant. This can -// be achieved by passing crypto.Hash(0) as the value for opts. -// Use an Options struct to pass a bool indicating that the ed448Ph variant -// should be used. -// The struct can also be optionally used to pass a context string for signing. -func (priv PrivateKey) Sign( - rand io.Reader, - message []byte, - opts crypto.SignerOpts, -) (signature []byte, err error) { - var ctx string - var scheme SchemeID - - if o, ok := opts.(SignerOptions); ok { - ctx = o.Context - scheme = o.Scheme - } - - switch true { - case scheme == ED448 && opts.HashFunc() == crypto.Hash(0): - return Sign(priv, message, ctx), nil - case scheme == ED448Ph && opts.HashFunc() == crypto.Hash(0): - return SignPh(priv, message, ctx), nil - default: - return nil, errors.New("ed448: bad hash algorithm") - } -} - -// GenerateKey generates a public/private key pair using entropy from rand. -// If rand is nil, crypto/rand.Reader will be used. -func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) { - if rand == nil { - rand = cryptoRand.Reader - } - - seed := make(PrivateKey, SeedSize) - if _, err := io.ReadFull(rand, seed); err != nil { - return nil, nil, err - } - - privateKey := NewKeyFromSeed(seed) - publicKey := make([]byte, PublicKeySize) - copy(publicKey, privateKey[SeedSize:]) - - return publicKey, privateKey, nil -} - -// NewKeyFromSeed calculates a private key from a seed. It will panic if -// len(seed) is not SeedSize. This function is provided for interoperability -// with RFC 8032. RFC 8032's private keys correspond to seeds in this -// package. -func NewKeyFromSeed(seed []byte) PrivateKey { - privateKey := make([]byte, PrivateKeySize) - newKeyFromSeed(privateKey, seed) - return privateKey -} - -func newKeyFromSeed(privateKey, seed []byte) { - if l := len(seed); l != SeedSize { - panic("ed448: bad seed length: " + strconv.Itoa(l)) - } - - var h [hashSize]byte - H := sha3.NewShake256() - _, _ = H.Write(seed) - _, _ = H.Read(h[:]) - s := &goldilocks.Scalar{} - deriveSecretScalar(s, h[:paramB]) - - copy(privateKey[:SeedSize], seed) - _ = goldilocks.Curve{}.ScalarBaseMult(s).ToBytes(privateKey[SeedSize:]) -} - -func signAll(signature []byte, privateKey PrivateKey, message, ctx []byte, preHash bool) { - if len(ctx) > ContextMaxSize { - panic(fmt.Errorf("ed448: bad context length: " + strconv.Itoa(len(ctx)))) - } - - H := sha3.NewShake256() - var PHM []byte - - if preHash { - var h [64]byte - _, _ = H.Write(message) - _, _ = H.Read(h[:]) - PHM = h[:] - H.Reset() - } else { - PHM = message - } - - // 1. Hash the 57-byte private key using SHAKE256(x, 114). - var h [hashSize]byte - _, _ = H.Write(privateKey[:SeedSize]) - _, _ = H.Read(h[:]) - s := &goldilocks.Scalar{} - deriveSecretScalar(s, h[:paramB]) - prefix := h[paramB:] - - // 2. Compute SHAKE256(dom4(F, C) || prefix || PH(M), 114). - var rPM [hashSize]byte - H.Reset() - - writeDom(&H, ctx, preHash) - - _, _ = H.Write(prefix) - _, _ = H.Write(PHM) - _, _ = H.Read(rPM[:]) - - // 3. Compute the point [r]B. - r := &goldilocks.Scalar{} - r.FromBytes(rPM[:]) - R := (&[paramB]byte{})[:] - if err := (goldilocks.Curve{}.ScalarBaseMult(r).ToBytes(R)); err != nil { - panic(err) - } - // 4. Compute SHAKE256(dom4(F, C) || R || A || PH(M), 114) - var hRAM [hashSize]byte - H.Reset() - - writeDom(&H, ctx, preHash) - - _, _ = H.Write(R) - _, _ = H.Write(privateKey[SeedSize:]) - _, _ = H.Write(PHM) - _, _ = H.Read(hRAM[:]) - - // 5. Compute S = (r + k * s) mod order. - k := &goldilocks.Scalar{} - k.FromBytes(hRAM[:]) - S := &goldilocks.Scalar{} - S.Mul(k, s) - S.Add(S, r) - - // 6. The signature is the concatenation of R and S. - copy(signature[:paramB], R[:]) - copy(signature[paramB:], S[:]) -} - -// Sign signs the message with privateKey and returns a signature. -// This function supports the signature variant defined in RFC-8032: Ed448, -// also known as the pure version of EdDSA. -// It will panic if len(privateKey) is not PrivateKeySize. -func Sign(priv PrivateKey, message []byte, ctx string) []byte { - signature := make([]byte, SignatureSize) - signAll(signature, priv, message, []byte(ctx), false) - return signature -} - -// SignPh creates a signature of a message given a keypair. -// This function supports the signature variant defined in RFC-8032: Ed448ph, -// meaning it internally hashes the message using SHAKE-256. -// Context could be passed to this function, which length should be no more than -// 255. It can be empty. -func SignPh(priv PrivateKey, message []byte, ctx string) []byte { - signature := make([]byte, SignatureSize) - signAll(signature, priv, message, []byte(ctx), true) - return signature -} - -func verify(public PublicKey, message, signature, ctx []byte, preHash bool) bool { - if len(public) != PublicKeySize || - len(signature) != SignatureSize || - len(ctx) > ContextMaxSize || - !isLessThanOrder(signature[paramB:]) { - return false - } - - P, err := goldilocks.FromBytes(public) - if err != nil { - return false - } - - H := sha3.NewShake256() - var PHM []byte - - if preHash { - var h [64]byte - _, _ = H.Write(message) - _, _ = H.Read(h[:]) - PHM = h[:] - H.Reset() - } else { - PHM = message - } - - var hRAM [hashSize]byte - R := signature[:paramB] - - writeDom(&H, ctx, preHash) - - _, _ = H.Write(R) - _, _ = H.Write(public) - _, _ = H.Write(PHM) - _, _ = H.Read(hRAM[:]) - - k := &goldilocks.Scalar{} - k.FromBytes(hRAM[:]) - S := &goldilocks.Scalar{} - S.FromBytes(signature[paramB:]) - - encR := (&[paramB]byte{})[:] - P.Neg() - _ = goldilocks.Curve{}.CombinedMult(S, k, P).ToBytes(encR) - return bytes.Equal(R, encR) -} - -// VerifyAny returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports all the two signature variants defined in RFC-8032, -// namely Ed448 (or pure EdDSA) and Ed448Ph. -// The opts.HashFunc() must return zero, this can be achieved by passing -// crypto.Hash(0) as the value for opts. -// Use a SignerOptions struct to pass a context string for signing. -func VerifyAny(public PublicKey, message, signature []byte, opts crypto.SignerOpts) bool { - var ctx string - var scheme SchemeID - if o, ok := opts.(SignerOptions); ok { - ctx = o.Context - scheme = o.Scheme - } - - switch true { - case scheme == ED448 && opts.HashFunc() == crypto.Hash(0): - return Verify(public, message, signature, ctx) - case scheme == ED448Ph && opts.HashFunc() == crypto.Hash(0): - return VerifyPh(public, message, signature, ctx) - default: - return false - } -} - -// Verify returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports the signature variant defined in RFC-8032: Ed448, -// also known as the pure version of EdDSA. -func Verify(public PublicKey, message, signature []byte, ctx string) bool { - return verify(public, message, signature, []byte(ctx), false) -} - -// VerifyPh returns true if the signature is valid. Failure cases are invalid -// signature, or when the public key cannot be decoded. -// This function supports the signature variant defined in RFC-8032: Ed448ph, -// meaning it internally hashes the message using SHAKE-256. -// Context could be passed to this function, which length should be no more than -// 255. It can be empty. -func VerifyPh(public PublicKey, message, signature []byte, ctx string) bool { - return verify(public, message, signature, []byte(ctx), true) -} - -func deriveSecretScalar(s *goldilocks.Scalar, h []byte) { - h[0] &= 0xFC // The two least significant bits of the first octet are cleared, - h[paramB-1] = 0x00 // all eight bits the last octet are cleared, and - h[paramB-2] |= 0x80 // the highest bit of the second to last octet is set. - s.FromBytes(h[:paramB]) -} - -// isLessThanOrder returns true if 0 <= x < order and if the last byte of x is zero. -func isLessThanOrder(x []byte) bool { - order := goldilocks.Curve{}.Order() - i := len(order) - 1 - for i > 0 && x[i] == order[i] { - i-- - } - return x[paramB-1] == 0 && x[i] < order[i] -} - -func writeDom(h io.Writer, ctx []byte, preHash bool) { - dom4 := "SigEd448" - _, _ = h.Write([]byte(dom4)) - - if preHash { - _, _ = h.Write([]byte{byte(0x01), byte(len(ctx))}) - } else { - _, _ = h.Write([]byte{byte(0x00), byte(len(ctx))}) - } - _, _ = h.Write(ctx) -} diff --git a/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go b/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go deleted file mode 100644 index 22da8bc0a5..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/ed448/signapi.go +++ /dev/null @@ -1,87 +0,0 @@ -package ed448 - -import ( - "crypto/rand" - "encoding/asn1" - - "github.com/cloudflare/circl/sign" -) - -var sch sign.Scheme = &scheme{} - -// Scheme returns a signature interface. -func Scheme() sign.Scheme { return sch } - -type scheme struct{} - -func (*scheme) Name() string { return "Ed448" } -func (*scheme) PublicKeySize() int { return PublicKeySize } -func (*scheme) PrivateKeySize() int { return PrivateKeySize } -func (*scheme) SignatureSize() int { return SignatureSize } -func (*scheme) SeedSize() int { return SeedSize } -func (*scheme) TLSIdentifier() uint { return 0x0808 } -func (*scheme) SupportsContext() bool { return true } -func (*scheme) Oid() asn1.ObjectIdentifier { - return asn1.ObjectIdentifier{1, 3, 101, 113} -} - -func (*scheme) GenerateKey() (sign.PublicKey, sign.PrivateKey, error) { - return GenerateKey(rand.Reader) -} - -func (*scheme) Sign( - sk sign.PrivateKey, - message []byte, - opts *sign.SignatureOpts, -) []byte { - priv, ok := sk.(PrivateKey) - if !ok { - panic(sign.ErrTypeMismatch) - } - ctx := "" - if opts != nil { - ctx = opts.Context - } - return Sign(priv, message, ctx) -} - -func (*scheme) Verify( - pk sign.PublicKey, - message, signature []byte, - opts *sign.SignatureOpts, -) bool { - pub, ok := pk.(PublicKey) - if !ok { - panic(sign.ErrTypeMismatch) - } - ctx := "" - if opts != nil { - ctx = opts.Context - } - return Verify(pub, message, signature, ctx) -} - -func (*scheme) DeriveKey(seed []byte) (sign.PublicKey, sign.PrivateKey) { - privateKey := NewKeyFromSeed(seed) - publicKey := make(PublicKey, PublicKeySize) - copy(publicKey, privateKey[SeedSize:]) - return publicKey, privateKey -} - -func (*scheme) UnmarshalBinaryPublicKey(buf []byte) (sign.PublicKey, error) { - if len(buf) < PublicKeySize { - return nil, sign.ErrPubKeySize - } - pub := make(PublicKey, PublicKeySize) - copy(pub, buf[:PublicKeySize]) - return pub, nil -} - -func (*scheme) UnmarshalBinaryPrivateKey(buf []byte) (sign.PrivateKey, error) { - if len(buf) < PrivateKeySize { - return nil, sign.ErrPrivKeySize - } - priv := make(PrivateKey, PrivateKeySize) - copy(priv, buf[:PrivateKeySize]) - return priv, nil -} diff --git a/vendor/github.com/cloudflare/circl/sign/sign.go b/vendor/github.com/cloudflare/circl/sign/sign.go deleted file mode 100644 index 13b20fa4b0..0000000000 --- a/vendor/github.com/cloudflare/circl/sign/sign.go +++ /dev/null @@ -1,110 +0,0 @@ -// Package sign provides unified interfaces for signature schemes. -// -// A register of schemes is available in the package -// -// github.com/cloudflare/circl/sign/schemes -package sign - -import ( - "crypto" - "encoding" - "errors" -) - -type SignatureOpts struct { - // If non-empty, includes the given context in the signature if supported - // and will cause an error during signing otherwise. - Context string -} - -// A public key is used to verify a signature set by the corresponding private -// key. -type PublicKey interface { - // Returns the signature scheme for this public key. - Scheme() Scheme - Equal(crypto.PublicKey) bool - encoding.BinaryMarshaler - crypto.PublicKey -} - -// A private key allows one to create signatures. -type PrivateKey interface { - // Returns the signature scheme for this private key. - Scheme() Scheme - Equal(crypto.PrivateKey) bool - // For compatibility with Go standard library - crypto.Signer - crypto.PrivateKey - encoding.BinaryMarshaler -} - -// A Scheme represents a specific instance of a signature scheme. -type Scheme interface { - // Name of the scheme. - Name() string - - // GenerateKey creates a new key-pair. - GenerateKey() (PublicKey, PrivateKey, error) - - // Creates a signature using the PrivateKey on the given message and - // returns the signature. opts are additional options which can be nil. - // - // Panics if key is nil or wrong type or opts context is not supported. - Sign(sk PrivateKey, message []byte, opts *SignatureOpts) []byte - - // Checks whether the given signature is a valid signature set by - // the private key corresponding to the given public key on the - // given message. opts are additional options which can be nil. - // - // Panics if key is nil or wrong type or opts context is not supported. - Verify(pk PublicKey, message []byte, signature []byte, opts *SignatureOpts) bool - - // Deterministically derives a keypair from a seed. If you're unsure, - // you're better off using GenerateKey(). - // - // Panics if seed is not of length SeedSize(). - DeriveKey(seed []byte) (PublicKey, PrivateKey) - - // Unmarshals a PublicKey from the provided buffer. - UnmarshalBinaryPublicKey([]byte) (PublicKey, error) - - // Unmarshals a PublicKey from the provided buffer. - UnmarshalBinaryPrivateKey([]byte) (PrivateKey, error) - - // Size of binary marshalled public keys. - PublicKeySize() int - - // Size of binary marshalled public keys. - PrivateKeySize() int - - // Size of signatures. - SignatureSize() int - - // Size of seeds. - SeedSize() int - - // Returns whether contexts are supported. - SupportsContext() bool -} - -var ( - // ErrTypeMismatch is the error used if types of, for instance, private - // and public keys don't match. - ErrTypeMismatch = errors.New("types mismatch") - - // ErrSeedSize is the error used if the provided seed is of the wrong - // size. - ErrSeedSize = errors.New("wrong seed size") - - // ErrPubKeySize is the error used if the provided public key is of - // the wrong size. - ErrPubKeySize = errors.New("wrong size for public key") - - // ErrPrivKeySize is the error used if the provided private key is of - // the wrong size. - ErrPrivKeySize = errors.New("wrong size for private key") - - // ErrContextNotSupported is the error used if a context is not - // supported. - ErrContextNotSupported = errors.New("context not supported") -) diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE b/vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go deleted file mode 100644 index b071cea51d..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/build.go +++ /dev/null @@ -1,690 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Copyright 2019 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. -*/ - -package estargz - -import ( - "archive/tar" - "bytes" - "compress/gzip" - "context" - "errors" - "fmt" - "io" - "os" - "path" - "runtime" - "strings" - "sync" - - "github.com/containerd/stargz-snapshotter/estargz/errorutil" - "github.com/klauspost/compress/zstd" - digest "github.com/opencontainers/go-digest" - "golang.org/x/sync/errgroup" -) - -type options struct { - chunkSize int - compressionLevel int - prioritizedFiles []string - missedPrioritizedFiles *[]string - compression Compression - ctx context.Context - minChunkSize int -} - -type Option func(o *options) error - -// WithChunkSize option specifies the chunk size of eStargz blob to build. -func WithChunkSize(chunkSize int) Option { - return func(o *options) error { - o.chunkSize = chunkSize - return nil - } -} - -// WithCompressionLevel option specifies the gzip compression level. -// The default is gzip.BestCompression. -// This option will be ignored if WithCompression option is used. -// See also: https://godoc.org/compress/gzip#pkg-constants -func WithCompressionLevel(level int) Option { - return func(o *options) error { - o.compressionLevel = level - return nil - } -} - -// WithPrioritizedFiles option specifies the list of prioritized files. -// These files must be complete paths that are absolute or relative to "/" -// For example, all of "foo/bar", "/foo/bar", "./foo/bar" and "../foo/bar" -// are treated as "/foo/bar". -func WithPrioritizedFiles(files []string) Option { - return func(o *options) error { - o.prioritizedFiles = files - return nil - } -} - -// WithAllowPrioritizeNotFound makes Build continue the execution even if some -// of prioritized files specified by WithPrioritizedFiles option aren't found -// in the input tar. Instead, this records all missed file names to the passed -// slice. -func WithAllowPrioritizeNotFound(missedFiles *[]string) Option { - return func(o *options) error { - if missedFiles == nil { - return fmt.Errorf("WithAllowPrioritizeNotFound: slice must be passed") - } - o.missedPrioritizedFiles = missedFiles - return nil - } -} - -// WithCompression specifies compression algorithm to be used. -// Default is gzip. -func WithCompression(compression Compression) Option { - return func(o *options) error { - o.compression = compression - return nil - } -} - -// WithContext specifies a context that can be used for clean canceleration. -func WithContext(ctx context.Context) Option { - return func(o *options) error { - o.ctx = ctx - return nil - } -} - -// WithMinChunkSize option specifies the minimal number of bytes of data -// must be written in one gzip stream. -// By increasing this number, one gzip stream can contain multiple files -// and it hopefully leads to smaller result blob. -// NOTE: This adds a TOC property that old reader doesn't understand. -func WithMinChunkSize(minChunkSize int) Option { - return func(o *options) error { - o.minChunkSize = minChunkSize - return nil - } -} - -// Blob is an eStargz blob. -type Blob struct { - io.ReadCloser - diffID digest.Digester - tocDigest digest.Digest -} - -// DiffID returns the digest of uncompressed blob. -// It is only valid to call DiffID after Close. -func (b *Blob) DiffID() digest.Digest { - return b.diffID.Digest() -} - -// TOCDigest returns the digest of uncompressed TOC JSON. -func (b *Blob) TOCDigest() digest.Digest { - return b.tocDigest -} - -// Build builds an eStargz blob which is an extended version of stargz, from a blob (gzip, zstd -// or plain tar) passed through the argument. If there are some prioritized files are listed in -// the option, these files are grouped as "prioritized" and can be used for runtime optimization -// (e.g. prefetch). This function builds a blob in parallel, with dividing that blob into several -// (at least the number of runtime.GOMAXPROCS(0)) sub-blobs. -func Build(tarBlob *io.SectionReader, opt ...Option) (_ *Blob, rErr error) { - var opts options - opts.compressionLevel = gzip.BestCompression // BestCompression by default - for _, o := range opt { - if err := o(&opts); err != nil { - return nil, err - } - } - if opts.compression == nil { - opts.compression = newGzipCompressionWithLevel(opts.compressionLevel) - } - layerFiles := newTempFiles() - ctx := opts.ctx - if ctx == nil { - ctx = context.Background() - } - done := make(chan struct{}) - defer close(done) - go func() { - select { - case <-done: - // nop - case <-ctx.Done(): - layerFiles.CleanupAll() - } - }() - defer func() { - if rErr != nil { - if err := layerFiles.CleanupAll(); err != nil { - rErr = fmt.Errorf("failed to cleanup tmp files: %v: %w", err, rErr) - } - } - if cErr := ctx.Err(); cErr != nil { - rErr = fmt.Errorf("error from context %q: %w", cErr, rErr) - } - }() - tarBlob, err := decompressBlob(tarBlob, layerFiles) - if err != nil { - return nil, err - } - entries, err := sortEntries(tarBlob, opts.prioritizedFiles, opts.missedPrioritizedFiles) - if err != nil { - return nil, err - } - var tarParts [][]*entry - if opts.minChunkSize > 0 { - // Each entry needs to know the size of the current gzip stream so they - // cannot be processed in parallel. - tarParts = [][]*entry{entries} - } else { - tarParts = divideEntries(entries, runtime.GOMAXPROCS(0)) - } - writers := make([]*Writer, len(tarParts)) - payloads := make([]*os.File, len(tarParts)) - var mu sync.Mutex - var eg errgroup.Group - for i, parts := range tarParts { - i, parts := i, parts - // builds verifiable stargz sub-blobs - eg.Go(func() error { - esgzFile, err := layerFiles.TempFile("", "esgzdata") - if err != nil { - return err - } - sw := NewWriterWithCompressor(esgzFile, opts.compression) - sw.ChunkSize = opts.chunkSize - sw.MinChunkSize = opts.minChunkSize - if sw.needsOpenGzEntries == nil { - sw.needsOpenGzEntries = make(map[string]struct{}) - } - for _, f := range []string{PrefetchLandmark, NoPrefetchLandmark} { - sw.needsOpenGzEntries[f] = struct{}{} - } - if err := sw.AppendTar(readerFromEntries(parts...)); err != nil { - return err - } - mu.Lock() - writers[i] = sw - payloads[i] = esgzFile - mu.Unlock() - return nil - }) - } - if err := eg.Wait(); err != nil { - rErr = err - return nil, err - } - tocAndFooter, tocDgst, err := closeWithCombine(writers...) - if err != nil { - rErr = err - return nil, err - } - var rs []io.Reader - for _, p := range payloads { - fs, err := fileSectionReader(p) - if err != nil { - return nil, err - } - rs = append(rs, fs) - } - diffID := digest.Canonical.Digester() - pr, pw := io.Pipe() - go func() { - r, err := opts.compression.Reader(io.TeeReader(io.MultiReader(append(rs, tocAndFooter)...), pw)) - if err != nil { - pw.CloseWithError(err) - return - } - defer r.Close() - if _, err := io.Copy(diffID.Hash(), r); err != nil { - pw.CloseWithError(err) - return - } - pw.Close() - }() - return &Blob{ - ReadCloser: readCloser{ - Reader: pr, - closeFunc: layerFiles.CleanupAll, - }, - tocDigest: tocDgst, - diffID: diffID, - }, nil -} - -// closeWithCombine takes unclosed Writers and close them. This also returns the -// toc that combined all Writers into. -// Writers doesn't write TOC and footer to the underlying writers so they can be -// combined into a single eStargz and tocAndFooter returned by this function can -// be appended at the tail of that combined blob. -func closeWithCombine(ws ...*Writer) (tocAndFooterR io.Reader, tocDgst digest.Digest, err error) { - if len(ws) == 0 { - return nil, "", fmt.Errorf("at least one writer must be passed") - } - for _, w := range ws { - if w.closed { - return nil, "", fmt.Errorf("writer must be unclosed") - } - defer func(w *Writer) { w.closed = true }(w) - if err := w.closeGz(); err != nil { - return nil, "", err - } - if err := w.bw.Flush(); err != nil { - return nil, "", err - } - } - var ( - mtoc = new(JTOC) - currentOffset int64 - ) - mtoc.Version = ws[0].toc.Version - for _, w := range ws { - for _, e := range w.toc.Entries { - // Recalculate Offset of non-empty files/chunks - if (e.Type == "reg" && e.Size > 0) || e.Type == "chunk" { - e.Offset += currentOffset - } - mtoc.Entries = append(mtoc.Entries, e) - } - if w.toc.Version > mtoc.Version { - mtoc.Version = w.toc.Version - } - currentOffset += w.cw.n - } - - return tocAndFooter(ws[0].compressor, mtoc, currentOffset) -} - -func tocAndFooter(compressor Compressor, toc *JTOC, offset int64) (io.Reader, digest.Digest, error) { - buf := new(bytes.Buffer) - tocDigest, err := compressor.WriteTOCAndFooter(buf, offset, toc, nil) - if err != nil { - return nil, "", err - } - return buf, tocDigest, nil -} - -// divideEntries divides passed entries to the parts at least the number specified by the -// argument. -func divideEntries(entries []*entry, minPartsNum int) (set [][]*entry) { - var estimatedSize int64 - for _, e := range entries { - estimatedSize += e.header.Size - } - unitSize := estimatedSize / int64(minPartsNum) - var ( - nextEnd = unitSize - offset int64 - ) - set = append(set, []*entry{}) - for _, e := range entries { - set[len(set)-1] = append(set[len(set)-1], e) - offset += e.header.Size - if offset > nextEnd { - set = append(set, []*entry{}) - nextEnd += unitSize - } - } - return -} - -var errNotFound = errors.New("not found") - -// sortEntries reads the specified tar blob and returns a list of tar entries. -// If some of prioritized files are specified, the list starts from these -// files with keeping the order specified by the argument. -func sortEntries(in io.ReaderAt, prioritized []string, missedPrioritized *[]string) ([]*entry, error) { - - // Import tar file. - intar, err := importTar(in) - if err != nil { - return nil, fmt.Errorf("failed to sort: %w", err) - } - - // Sort the tar file respecting to the prioritized files list. - sorted := &tarFile{} - for _, l := range prioritized { - if err := moveRec(l, intar, sorted); err != nil { - if errors.Is(err, errNotFound) && missedPrioritized != nil { - *missedPrioritized = append(*missedPrioritized, l) - continue // allow not found - } - return nil, fmt.Errorf("failed to sort tar entries: %w", err) - } - } - if len(prioritized) == 0 { - sorted.add(&entry{ - header: &tar.Header{ - Name: NoPrefetchLandmark, - Typeflag: tar.TypeReg, - Size: int64(len([]byte{landmarkContents})), - }, - payload: bytes.NewReader([]byte{landmarkContents}), - }) - } else { - sorted.add(&entry{ - header: &tar.Header{ - Name: PrefetchLandmark, - Typeflag: tar.TypeReg, - Size: int64(len([]byte{landmarkContents})), - }, - payload: bytes.NewReader([]byte{landmarkContents}), - }) - } - - // Dump all entry and concatinate them. - return append(sorted.dump(), intar.dump()...), nil -} - -// readerFromEntries returns a reader of tar archive that contains entries passed -// through the arguments. -func readerFromEntries(entries ...*entry) io.Reader { - pr, pw := io.Pipe() - go func() { - tw := tar.NewWriter(pw) - defer tw.Close() - for _, entry := range entries { - if err := tw.WriteHeader(entry.header); err != nil { - pw.CloseWithError(fmt.Errorf("Failed to write tar header: %v", err)) - return - } - if _, err := io.Copy(tw, entry.payload); err != nil { - pw.CloseWithError(fmt.Errorf("Failed to write tar payload: %v", err)) - return - } - } - pw.Close() - }() - return pr -} - -func importTar(in io.ReaderAt) (*tarFile, error) { - tf := &tarFile{} - pw, err := newCountReadSeeker(in) - if err != nil { - return nil, fmt.Errorf("failed to make position watcher: %w", err) - } - tr := tar.NewReader(pw) - - // Walk through all nodes. - for { - // Fetch and parse next header. - h, err := tr.Next() - if err != nil { - if err == io.EOF { - break - } else { - return nil, fmt.Errorf("failed to parse tar file, %w", err) - } - } - switch cleanEntryName(h.Name) { - case PrefetchLandmark, NoPrefetchLandmark: - // Ignore existing landmark - continue - } - - // Add entry. If it already exists, replace it. - if _, ok := tf.get(h.Name); ok { - tf.remove(h.Name) - } - tf.add(&entry{ - header: h, - payload: io.NewSectionReader(in, pw.currentPos(), h.Size), - }) - } - - return tf, nil -} - -func moveRec(name string, in *tarFile, out *tarFile) error { - name = cleanEntryName(name) - if name == "" { // root directory. stop recursion. - if e, ok := in.get(name); ok { - // entry of the root directory exists. we should move it as well. - // this case will occur if tar entries are prefixed with "./", "/", etc. - out.add(e) - in.remove(name) - } - return nil - } - - _, okIn := in.get(name) - _, okOut := out.get(name) - if !okIn && !okOut { - return fmt.Errorf("file: %q: %w", name, errNotFound) - } - - parent, _ := path.Split(strings.TrimSuffix(name, "/")) - if err := moveRec(parent, in, out); err != nil { - return err - } - if e, ok := in.get(name); ok && e.header.Typeflag == tar.TypeLink { - if err := moveRec(e.header.Linkname, in, out); err != nil { - return err - } - } - if e, ok := in.get(name); ok { - out.add(e) - in.remove(name) - } - return nil -} - -type entry struct { - header *tar.Header - payload io.ReadSeeker -} - -type tarFile struct { - index map[string]*entry - stream []*entry -} - -func (f *tarFile) add(e *entry) { - if f.index == nil { - f.index = make(map[string]*entry) - } - f.index[cleanEntryName(e.header.Name)] = e - f.stream = append(f.stream, e) -} - -func (f *tarFile) remove(name string) { - name = cleanEntryName(name) - if f.index != nil { - delete(f.index, name) - } - var filtered []*entry - for _, e := range f.stream { - if cleanEntryName(e.header.Name) == name { - continue - } - filtered = append(filtered, e) - } - f.stream = filtered -} - -func (f *tarFile) get(name string) (e *entry, ok bool) { - if f.index == nil { - return nil, false - } - e, ok = f.index[cleanEntryName(name)] - return -} - -func (f *tarFile) dump() []*entry { - return f.stream -} - -type readCloser struct { - io.Reader - closeFunc func() error -} - -func (rc readCloser) Close() error { - return rc.closeFunc() -} - -func fileSectionReader(file *os.File) (*io.SectionReader, error) { - info, err := file.Stat() - if err != nil { - return nil, err - } - return io.NewSectionReader(file, 0, info.Size()), nil -} - -func newTempFiles() *tempFiles { - return &tempFiles{} -} - -type tempFiles struct { - files []*os.File - filesMu sync.Mutex - cleanupOnce sync.Once -} - -func (tf *tempFiles) TempFile(dir, pattern string) (*os.File, error) { - f, err := os.CreateTemp(dir, pattern) - if err != nil { - return nil, err - } - tf.filesMu.Lock() - tf.files = append(tf.files, f) - tf.filesMu.Unlock() - return f, nil -} - -func (tf *tempFiles) CleanupAll() (err error) { - tf.cleanupOnce.Do(func() { - err = tf.cleanupAll() - }) - return -} - -func (tf *tempFiles) cleanupAll() error { - tf.filesMu.Lock() - defer tf.filesMu.Unlock() - var allErr []error - for _, f := range tf.files { - if err := f.Close(); err != nil { - allErr = append(allErr, err) - } - if err := os.Remove(f.Name()); err != nil { - allErr = append(allErr, err) - } - } - tf.files = nil - return errorutil.Aggregate(allErr) -} - -func newCountReadSeeker(r io.ReaderAt) (*countReadSeeker, error) { - pos := int64(0) - return &countReadSeeker{r: r, cPos: &pos}, nil -} - -type countReadSeeker struct { - r io.ReaderAt - cPos *int64 - - mu sync.Mutex -} - -func (cr *countReadSeeker) Read(p []byte) (int, error) { - cr.mu.Lock() - defer cr.mu.Unlock() - - n, err := cr.r.ReadAt(p, *cr.cPos) - if err == nil { - *cr.cPos += int64(n) - } - return n, err -} - -func (cr *countReadSeeker) Seek(offset int64, whence int) (int64, error) { - cr.mu.Lock() - defer cr.mu.Unlock() - - switch whence { - default: - return 0, fmt.Errorf("Unknown whence: %v", whence) - case io.SeekStart: - case io.SeekCurrent: - offset += *cr.cPos - case io.SeekEnd: - return 0, fmt.Errorf("Unsupported whence: %v", whence) - } - - if offset < 0 { - return 0, fmt.Errorf("invalid offset") - } - *cr.cPos = offset - return offset, nil -} - -func (cr *countReadSeeker) currentPos() int64 { - cr.mu.Lock() - defer cr.mu.Unlock() - - return *cr.cPos -} - -func decompressBlob(org *io.SectionReader, tmp *tempFiles) (*io.SectionReader, error) { - if org.Size() < 4 { - return org, nil - } - src := make([]byte, 4) - if _, err := org.Read(src); err != nil && err != io.EOF { - return nil, err - } - var dR io.Reader - if bytes.Equal([]byte{0x1F, 0x8B, 0x08}, src[:3]) { - // gzip - dgR, err := gzip.NewReader(io.NewSectionReader(org, 0, org.Size())) - if err != nil { - return nil, err - } - defer dgR.Close() - dR = io.Reader(dgR) - } else if bytes.Equal([]byte{0x28, 0xb5, 0x2f, 0xfd}, src[:4]) { - // zstd - dzR, err := zstd.NewReader(io.NewSectionReader(org, 0, org.Size())) - if err != nil { - return nil, err - } - defer dzR.Close() - dR = io.Reader(dzR) - } else { - // uncompressed - return io.NewSectionReader(org, 0, org.Size()), nil - } - b, err := tmp.TempFile("", "uncompresseddata") - if err != nil { - return nil, err - } - if _, err := io.Copy(b, dR); err != nil { - return nil, err - } - return fileSectionReader(b) -} diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go deleted file mode 100644 index 6de78b02dc..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/errorutil/errors.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package errorutil - -import ( - "errors" - "fmt" - "strings" -) - -// Aggregate combines a list of errors into a single new error. -func Aggregate(errs []error) error { - switch len(errs) { - case 0: - return nil - case 1: - return errs[0] - default: - points := make([]string, len(errs)+1) - points[0] = fmt.Sprintf("%d error(s) occurred:", len(errs)) - for i, err := range errs { - points[i+1] = fmt.Sprintf("* %s", err) - } - return errors.New(strings.Join(points, "\n\t")) - } -} diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go deleted file mode 100644 index f4d5546558..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/estargz.go +++ /dev/null @@ -1,1223 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Copyright 2019 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. -*/ - -package estargz - -import ( - "bufio" - "bytes" - "compress/gzip" - "crypto/sha256" - "errors" - "fmt" - "hash" - "io" - "os" - "path" - "sort" - "strings" - "sync" - "time" - - "github.com/containerd/stargz-snapshotter/estargz/errorutil" - digest "github.com/opencontainers/go-digest" - "github.com/vbatts/tar-split/archive/tar" -) - -// A Reader permits random access reads from a stargz file. -type Reader struct { - sr *io.SectionReader - toc *JTOC - tocDigest digest.Digest - - // m stores all non-chunk entries, keyed by name. - m map[string]*TOCEntry - - // chunks stores all TOCEntry values for regular files that - // are split up. For a file with a single chunk, it's only - // stored in m. - chunks map[string][]*TOCEntry - - decompressor Decompressor -} - -type openOpts struct { - tocOffset int64 - decompressors []Decompressor - telemetry *Telemetry -} - -// OpenOption is an option used during opening the layer -type OpenOption func(o *openOpts) error - -// WithTOCOffset option specifies the offset of TOC -func WithTOCOffset(tocOffset int64) OpenOption { - return func(o *openOpts) error { - o.tocOffset = tocOffset - return nil - } -} - -// WithDecompressors option specifies decompressors to use. -// Default is gzip-based decompressor. -func WithDecompressors(decompressors ...Decompressor) OpenOption { - return func(o *openOpts) error { - o.decompressors = decompressors - return nil - } -} - -// WithTelemetry option specifies the telemetry hooks -func WithTelemetry(telemetry *Telemetry) OpenOption { - return func(o *openOpts) error { - o.telemetry = telemetry - return nil - } -} - -// MeasureLatencyHook is a func which takes start time and records the diff -type MeasureLatencyHook func(time.Time) - -// Telemetry is a struct which defines telemetry hooks. By implementing these hooks you should be able to record -// the latency metrics of the respective steps of estargz open operation. To be used with estargz.OpenWithTelemetry(...) -type Telemetry struct { - GetFooterLatency MeasureLatencyHook // measure time to get stargz footer (in milliseconds) - GetTocLatency MeasureLatencyHook // measure time to GET TOC JSON (in milliseconds) - DeserializeTocLatency MeasureLatencyHook // measure time to deserialize TOC JSON (in milliseconds) -} - -// Open opens a stargz file for reading. -// The behavior is configurable using options. -// -// Note that each entry name is normalized as the path that is relative to root. -func Open(sr *io.SectionReader, opt ...OpenOption) (*Reader, error) { - var opts openOpts - for _, o := range opt { - if err := o(&opts); err != nil { - return nil, err - } - } - - gzipCompressors := []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)} - decompressors := append(gzipCompressors, opts.decompressors...) - - // Determine the size to fetch. Try to fetch as many bytes as possible. - fetchSize := maxFooterSize(sr.Size(), decompressors...) - if maybeTocOffset := opts.tocOffset; maybeTocOffset > fetchSize { - if maybeTocOffset > sr.Size() { - return nil, fmt.Errorf("blob size %d is smaller than the toc offset", sr.Size()) - } - fetchSize = sr.Size() - maybeTocOffset - } - - start := time.Now() // before getting layer footer - footer := make([]byte, fetchSize) - if _, err := sr.ReadAt(footer, sr.Size()-fetchSize); err != nil { - return nil, fmt.Errorf("error reading footer: %v", err) - } - if opts.telemetry != nil && opts.telemetry.GetFooterLatency != nil { - opts.telemetry.GetFooterLatency(start) - } - - var allErr []error - var found bool - var r *Reader - for _, d := range decompressors { - fSize := d.FooterSize() - fOffset := positive(int64(len(footer)) - fSize) - maybeTocBytes := footer[:fOffset] - _, tocOffset, tocSize, err := d.ParseFooter(footer[fOffset:]) - if err != nil { - allErr = append(allErr, err) - continue - } - if tocOffset >= 0 && tocSize <= 0 { - tocSize = sr.Size() - tocOffset - fSize - } - if tocOffset >= 0 && tocSize < int64(len(maybeTocBytes)) { - maybeTocBytes = maybeTocBytes[:tocSize] - } - r, err = parseTOC(d, sr, tocOffset, tocSize, maybeTocBytes, opts) - if err == nil { - found = true - break - } - allErr = append(allErr, err) - } - if !found { - return nil, errorutil.Aggregate(allErr) - } - if err := r.initFields(); err != nil { - return nil, fmt.Errorf("failed to initialize fields of entries: %v", err) - } - return r, nil -} - -// OpenFooter extracts and parses footer from the given blob. -// only supports gzip-based eStargz. -func OpenFooter(sr *io.SectionReader) (tocOffset int64, footerSize int64, rErr error) { - if sr.Size() < FooterSize && sr.Size() < legacyFooterSize { - return 0, 0, fmt.Errorf("blob size %d is smaller than the footer size", sr.Size()) - } - var footer [FooterSize]byte - if _, err := sr.ReadAt(footer[:], sr.Size()-FooterSize); err != nil { - return 0, 0, fmt.Errorf("error reading footer: %v", err) - } - var allErr []error - for _, d := range []Decompressor{new(GzipDecompressor), new(LegacyGzipDecompressor)} { - fSize := d.FooterSize() - fOffset := positive(int64(len(footer)) - fSize) - _, tocOffset, _, err := d.ParseFooter(footer[fOffset:]) - if err == nil { - return tocOffset, fSize, err - } - allErr = append(allErr, err) - } - return 0, 0, errorutil.Aggregate(allErr) -} - -// initFields populates the Reader from r.toc after decoding it from -// JSON. -// -// Unexported fields are populated and TOCEntry fields that were -// implicit in the JSON are populated. -func (r *Reader) initFields() error { - r.m = make(map[string]*TOCEntry, len(r.toc.Entries)) - r.chunks = make(map[string][]*TOCEntry) - var lastPath string - uname := map[int]string{} - gname := map[int]string{} - var lastRegEnt *TOCEntry - var chunkTopIndex int - for i, ent := range r.toc.Entries { - ent.Name = cleanEntryName(ent.Name) - switch ent.Type { - case "reg", "chunk": - if ent.Offset != r.toc.Entries[chunkTopIndex].Offset { - chunkTopIndex = i - } - ent.chunkTopIndex = chunkTopIndex - } - if ent.Type == "reg" { - lastRegEnt = ent - } - if ent.Type == "chunk" { - ent.Name = lastPath - r.chunks[ent.Name] = append(r.chunks[ent.Name], ent) - if ent.ChunkSize == 0 && lastRegEnt != nil { - ent.ChunkSize = lastRegEnt.Size - ent.ChunkOffset - } - } else { - lastPath = ent.Name - - if ent.Uname != "" { - uname[ent.UID] = ent.Uname - } else { - ent.Uname = uname[ent.UID] - } - if ent.Gname != "" { - gname[ent.GID] = ent.Gname - } else { - ent.Gname = uname[ent.GID] - } - - ent.modTime, _ = time.Parse(time.RFC3339, ent.ModTime3339) - - if ent.Type == "dir" { - ent.NumLink++ // Parent dir links to this directory - } - r.m[ent.Name] = ent - } - if ent.Type == "reg" && ent.ChunkSize > 0 && ent.ChunkSize < ent.Size { - r.chunks[ent.Name] = make([]*TOCEntry, 0, ent.Size/ent.ChunkSize+1) - r.chunks[ent.Name] = append(r.chunks[ent.Name], ent) - } - if ent.ChunkSize == 0 && ent.Size != 0 { - ent.ChunkSize = ent.Size - } - } - - // Populate children, add implicit directories: - for _, ent := range r.toc.Entries { - if ent.Type == "chunk" { - continue - } - // add "foo/": - // add "foo" child to "" (creating "" if necessary) - // - // add "foo/bar/": - // add "bar" child to "foo" (creating "foo" if necessary) - // - // add "foo/bar.txt": - // add "bar.txt" child to "foo" (creating "foo" if necessary) - // - // add "a/b/c/d/e/f.txt": - // create "a/b/c/d/e" node - // add "f.txt" child to "e" - - name := ent.Name - pdirName := parentDir(name) - if name == pdirName { - // This entry and its parent are the same. - // Ignore this for avoiding infinite loop of the reference. - // The example case where this can occur is when tar contains the root - // directory itself (e.g. "./", "/"). - continue - } - pdir := r.getOrCreateDir(pdirName) - ent.NumLink++ // at least one name(ent.Name) references this entry. - if ent.Type == "hardlink" { - org, err := r.getSource(ent) - if err != nil { - return err - } - org.NumLink++ // original entry is referenced by this ent.Name. - ent = org - } - pdir.addChild(path.Base(name), ent) - } - - lastOffset := r.sr.Size() - for i := len(r.toc.Entries) - 1; i >= 0; i-- { - e := r.toc.Entries[i] - if e.isDataType() { - e.nextOffset = lastOffset - } - if e.Offset != 0 && e.InnerOffset == 0 { - lastOffset = e.Offset - } - } - - return nil -} - -func (r *Reader) getSource(ent *TOCEntry) (_ *TOCEntry, err error) { - if ent.Type == "hardlink" { - org, ok := r.m[cleanEntryName(ent.LinkName)] - if !ok { - return nil, fmt.Errorf("%q is a hardlink but the linkname %q isn't found", ent.Name, ent.LinkName) - } - ent, err = r.getSource(org) - if err != nil { - return nil, err - } - } - return ent, nil -} - -func parentDir(p string) string { - dir, _ := path.Split(p) - return strings.TrimSuffix(dir, "/") -} - -func (r *Reader) getOrCreateDir(d string) *TOCEntry { - e, ok := r.m[d] - if !ok { - e = &TOCEntry{ - Name: d, - Type: "dir", - Mode: 0755, - NumLink: 2, // The directory itself(.) and the parent link to this directory. - } - r.m[d] = e - if d != "" { - pdir := r.getOrCreateDir(parentDir(d)) - pdir.addChild(path.Base(d), e) - } - } - return e -} - -func (r *Reader) TOCDigest() digest.Digest { - return r.tocDigest -} - -// VerifyTOC checks that the TOC JSON in the passed blob matches the -// passed digests and that the TOC JSON contains digests for all chunks -// contained in the blob. If the verification succceeds, this function -// returns TOCEntryVerifier which holds all chunk digests in the stargz blob. -func (r *Reader) VerifyTOC(tocDigest digest.Digest) (TOCEntryVerifier, error) { - // Verify the digest of TOC JSON - if r.tocDigest != tocDigest { - return nil, fmt.Errorf("invalid TOC JSON %q; want %q", r.tocDigest, tocDigest) - } - return r.Verifiers() -} - -// Verifiers returns TOCEntryVerifier of this chunk. Use VerifyTOC instead in most cases -// because this doesn't verify TOC. -func (r *Reader) Verifiers() (TOCEntryVerifier, error) { - chunkDigestMap := make(map[int64]digest.Digest) // map from chunk offset to the chunk digest - regDigestMap := make(map[int64]digest.Digest) // map from chunk offset to the reg file digest - var chunkDigestMapIncomplete bool - var regDigestMapIncomplete bool - var containsChunk bool - for _, e := range r.toc.Entries { - if e.Type != "reg" && e.Type != "chunk" { - continue - } - - // offset must be unique in stargz blob - _, dOK := chunkDigestMap[e.Offset] - _, rOK := regDigestMap[e.Offset] - if dOK || rOK { - return nil, fmt.Errorf("offset %d found twice", e.Offset) - } - - if e.Type == "reg" { - if e.Size == 0 { - continue // ignores empty file - } - - // record the digest of regular file payload - if e.Digest != "" { - d, err := digest.Parse(e.Digest) - if err != nil { - return nil, fmt.Errorf("failed to parse regular file digest %q: %w", e.Digest, err) - } - regDigestMap[e.Offset] = d - } else { - regDigestMapIncomplete = true - } - } else { - containsChunk = true // this layer contains "chunk" entries. - } - - // "reg" also can contain ChunkDigest (e.g. when "reg" is the first entry of - // chunked file) - if e.ChunkDigest != "" { - d, err := digest.Parse(e.ChunkDigest) - if err != nil { - return nil, fmt.Errorf("failed to parse chunk digest %q: %w", e.ChunkDigest, err) - } - chunkDigestMap[e.Offset] = d - } else { - chunkDigestMapIncomplete = true - } - } - - if chunkDigestMapIncomplete { - // Though some chunk digests are not found, if this layer doesn't contain - // "chunk"s and all digest of "reg" files are recorded, we can use them instead. - if !containsChunk && !regDigestMapIncomplete { - return &verifier{digestMap: regDigestMap}, nil - } - return nil, fmt.Errorf("some ChunkDigest not found in TOC JSON") - } - - return &verifier{digestMap: chunkDigestMap}, nil -} - -// verifier is an implementation of TOCEntryVerifier which holds verifiers keyed by -// offset of the chunk. -type verifier struct { - digestMap map[int64]digest.Digest - digestMapMu sync.Mutex -} - -// Verifier returns a content verifier specified by TOCEntry. -func (v *verifier) Verifier(ce *TOCEntry) (digest.Verifier, error) { - v.digestMapMu.Lock() - defer v.digestMapMu.Unlock() - d, ok := v.digestMap[ce.Offset] - if !ok { - return nil, fmt.Errorf("verifier for offset=%d,size=%d hasn't been registered", - ce.Offset, ce.ChunkSize) - } - return d.Verifier(), nil -} - -// ChunkEntryForOffset returns the TOCEntry containing the byte of the -// named file at the given offset within the file. -// Name must be absolute path or one that is relative to root. -func (r *Reader) ChunkEntryForOffset(name string, offset int64) (e *TOCEntry, ok bool) { - name = cleanEntryName(name) - e, ok = r.Lookup(name) - if !ok || !e.isDataType() { - return nil, false - } - ents := r.chunks[name] - if len(ents) < 2 { - if offset >= e.ChunkSize { - return nil, false - } - return e, true - } - i := sort.Search(len(ents), func(i int) bool { - e := ents[i] - return e.ChunkOffset >= offset || (offset > e.ChunkOffset && offset < e.ChunkOffset+e.ChunkSize) - }) - if i == len(ents) { - return nil, false - } - return ents[i], true -} - -// Lookup returns the Table of Contents entry for the given path. -// -// To get the root directory, use the empty string. -// Path must be absolute path or one that is relative to root. -func (r *Reader) Lookup(path string) (e *TOCEntry, ok bool) { - path = cleanEntryName(path) - if r == nil { - return - } - e, ok = r.m[path] - if ok && e.Type == "hardlink" { - var err error - e, err = r.getSource(e) - if err != nil { - return nil, false - } - } - return -} - -// OpenFile returns the reader of the specified file payload. -// -// Name must be absolute path or one that is relative to root. -func (r *Reader) OpenFile(name string) (*io.SectionReader, error) { - fr, err := r.newFileReader(name) - if err != nil { - return nil, err - } - return io.NewSectionReader(fr, 0, fr.size), nil -} - -func (r *Reader) newFileReader(name string) (*fileReader, error) { - name = cleanEntryName(name) - ent, ok := r.Lookup(name) - if !ok { - // TODO: come up with some error plan. This is lazy: - return nil, &os.PathError{ - Path: name, - Op: "OpenFile", - Err: os.ErrNotExist, - } - } - if ent.Type != "reg" { - return nil, &os.PathError{ - Path: name, - Op: "OpenFile", - Err: errors.New("not a regular file"), - } - } - return &fileReader{ - r: r, - size: ent.Size, - ents: r.getChunks(ent), - }, nil -} - -func (r *Reader) OpenFileWithPreReader(name string, preRead func(*TOCEntry, io.Reader) error) (*io.SectionReader, error) { - fr, err := r.newFileReader(name) - if err != nil { - return nil, err - } - fr.preRead = preRead - return io.NewSectionReader(fr, 0, fr.size), nil -} - -func (r *Reader) getChunks(ent *TOCEntry) []*TOCEntry { - if ents, ok := r.chunks[ent.Name]; ok { - return ents - } - return []*TOCEntry{ent} -} - -type fileReader struct { - r *Reader - size int64 - ents []*TOCEntry // 1 or more reg/chunk entries - preRead func(*TOCEntry, io.Reader) error -} - -func (fr *fileReader) ReadAt(p []byte, off int64) (n int, err error) { - if off >= fr.size { - return 0, io.EOF - } - if off < 0 { - return 0, errors.New("invalid offset") - } - var i int - if len(fr.ents) > 1 { - i = sort.Search(len(fr.ents), func(i int) bool { - return fr.ents[i].ChunkOffset >= off - }) - if i == len(fr.ents) { - i = len(fr.ents) - 1 - } - } - ent := fr.ents[i] - if ent.ChunkOffset > off { - if i == 0 { - return 0, errors.New("internal error; first chunk offset is non-zero") - } - ent = fr.ents[i-1] - } - - // If ent is a chunk of a large file, adjust the ReadAt - // offset by the chunk's offset. - off -= ent.ChunkOffset - - finalEnt := fr.ents[len(fr.ents)-1] - compressedOff := ent.Offset - // compressedBytesRemain is the number of compressed bytes in this - // file remaining, over 1+ chunks. - compressedBytesRemain := finalEnt.NextOffset() - compressedOff - - sr := io.NewSectionReader(fr.r.sr, compressedOff, compressedBytesRemain) - - const maxRead = 2 << 20 - var bufSize = maxRead - if compressedBytesRemain < maxRead { - bufSize = int(compressedBytesRemain) - } - - br := bufio.NewReaderSize(sr, bufSize) - if _, err := br.Peek(bufSize); err != nil { - return 0, fmt.Errorf("fileReader.ReadAt.peek: %v", err) - } - - dr, err := fr.r.decompressor.Reader(br) - if err != nil { - return 0, fmt.Errorf("fileReader.ReadAt.decompressor.Reader: %v", err) - } - defer dr.Close() - - if fr.preRead == nil { - if n, err := io.CopyN(io.Discard, dr, ent.InnerOffset+off); n != ent.InnerOffset+off || err != nil { - return 0, fmt.Errorf("discard of %d bytes != %v, %v", ent.InnerOffset+off, n, err) - } - return io.ReadFull(dr, p) - } - - var retN int - var retErr error - var found bool - var nr int64 - for _, e := range fr.r.toc.Entries[ent.chunkTopIndex:] { - if !e.isDataType() { - continue - } - if e.Offset != fr.r.toc.Entries[ent.chunkTopIndex].Offset { - break - } - if in, err := io.CopyN(io.Discard, dr, e.InnerOffset-nr); err != nil || in != e.InnerOffset-nr { - return 0, fmt.Errorf("discard of remaining %d bytes != %v, %v", e.InnerOffset-nr, in, err) - } - nr = e.InnerOffset - if e == ent { - found = true - if n, err := io.CopyN(io.Discard, dr, off); n != off || err != nil { - return 0, fmt.Errorf("discard of offset %d bytes != %v, %v", off, n, err) - } - retN, retErr = io.ReadFull(dr, p) - nr += off + int64(retN) - continue - } - cr := &countReader{r: io.LimitReader(dr, e.ChunkSize)} - if err := fr.preRead(e, cr); err != nil { - return 0, fmt.Errorf("failed to pre read: %w", err) - } - nr += cr.n - } - if !found { - return 0, fmt.Errorf("fileReader.ReadAt: target entry not found") - } - return retN, retErr -} - -// A Writer writes stargz files. -// -// Use NewWriter to create a new Writer. -type Writer struct { - bw *bufio.Writer - cw *countWriter - toc *JTOC - diffHash hash.Hash // SHA-256 of uncompressed tar - - closed bool - gz io.WriteCloser - lastUsername map[int]string - lastGroupname map[int]string - compressor Compressor - - uncompressedCounter *countWriteFlusher - - // ChunkSize optionally controls the maximum number of bytes - // of data of a regular file that can be written in one gzip - // stream before a new gzip stream is started. - // Zero means to use a default, currently 4 MiB. - ChunkSize int - - // MinChunkSize optionally controls the minimum number of bytes - // of data must be written in one gzip stream before a new gzip - // NOTE: This adds a TOC property that stargz snapshotter < v0.13.0 doesn't understand. - MinChunkSize int - - needsOpenGzEntries map[string]struct{} -} - -// currentCompressionWriter writes to the current w.gz field, which can -// change throughout writing a tar entry. -// -// Additionally, it updates w's SHA-256 of the uncompressed bytes -// of the tar file. -type currentCompressionWriter struct{ w *Writer } - -func (ccw currentCompressionWriter) Write(p []byte) (int, error) { - ccw.w.diffHash.Write(p) - if ccw.w.gz == nil { - if err := ccw.w.condOpenGz(); err != nil { - return 0, err - } - } - return ccw.w.gz.Write(p) -} - -func (w *Writer) chunkSize() int { - if w.ChunkSize <= 0 { - return 4 << 20 - } - return w.ChunkSize -} - -// Unpack decompresses the given estargz blob and returns a ReadCloser of the tar blob. -// TOC JSON and footer are removed. -func Unpack(sr *io.SectionReader, c Decompressor) (io.ReadCloser, error) { - footerSize := c.FooterSize() - if sr.Size() < footerSize { - return nil, fmt.Errorf("blob is too small; %d < %d", sr.Size(), footerSize) - } - footerOffset := sr.Size() - footerSize - footer := make([]byte, footerSize) - if _, err := sr.ReadAt(footer, footerOffset); err != nil { - return nil, err - } - blobPayloadSize, _, _, err := c.ParseFooter(footer) - if err != nil { - return nil, fmt.Errorf("failed to parse footer: %w", err) - } - if blobPayloadSize < 0 { - blobPayloadSize = sr.Size() - } - return c.Reader(io.LimitReader(sr, blobPayloadSize)) -} - -// NewWriter returns a new stargz writer (gzip-based) writing to w. -// -// The writer must be closed to write its trailing table of contents. -func NewWriter(w io.Writer) *Writer { - return NewWriterLevel(w, gzip.BestCompression) -} - -// NewWriterLevel returns a new stargz writer (gzip-based) writing to w. -// The compression level is configurable. -// -// The writer must be closed to write its trailing table of contents. -func NewWriterLevel(w io.Writer, compressionLevel int) *Writer { - return NewWriterWithCompressor(w, NewGzipCompressorWithLevel(compressionLevel)) -} - -// NewWriterWithCompressor returns a new stargz writer writing to w. -// The compression method is configurable. -// -// The writer must be closed to write its trailing table of contents. -func NewWriterWithCompressor(w io.Writer, c Compressor) *Writer { - bw := bufio.NewWriter(w) - cw := &countWriter{w: bw} - return &Writer{ - bw: bw, - cw: cw, - toc: &JTOC{Version: 1}, - diffHash: sha256.New(), - compressor: c, - uncompressedCounter: &countWriteFlusher{}, - } -} - -// Close writes the stargz's table of contents and flushes all the -// buffers, returning any error. -func (w *Writer) Close() (digest.Digest, error) { - if w.closed { - return "", nil - } - defer func() { w.closed = true }() - - if err := w.closeGz(); err != nil { - return "", err - } - - // Write the TOC index and footer. - tocDigest, err := w.compressor.WriteTOCAndFooter(w.cw, w.cw.n, w.toc, w.diffHash) - if err != nil { - return "", err - } - if err := w.bw.Flush(); err != nil { - return "", err - } - - return tocDigest, nil -} - -func (w *Writer) closeGz() error { - if w.closed { - return errors.New("write on closed Writer") - } - if w.gz != nil { - if err := w.gz.Close(); err != nil { - return err - } - w.gz = nil - } - return nil -} - -func (w *Writer) flushGz() error { - if w.closed { - return errors.New("flush on closed Writer") - } - if w.gz != nil { - if f, ok := w.gz.(interface { - Flush() error - }); ok { - return f.Flush() - } - } - return nil -} - -// nameIfChanged returns name, unless it was the already the value of (*mp)[id], -// in which case it returns the empty string. -func (w *Writer) nameIfChanged(mp *map[int]string, id int, name string) string { - if name == "" { - return "" - } - if *mp == nil { - *mp = make(map[int]string) - } - if (*mp)[id] == name { - return "" - } - (*mp)[id] = name - return name -} - -func (w *Writer) condOpenGz() (err error) { - if w.gz == nil { - w.gz, err = w.compressor.Writer(w.cw) - if w.gz != nil { - w.gz = w.uncompressedCounter.register(w.gz) - } - } - return -} - -// AppendTar reads the tar or tar.gz file from r and appends -// each of its contents to w. -// -// The input r can optionally be gzip compressed but the output will -// always be compressed by the specified compressor. -func (w *Writer) AppendTar(r io.Reader) error { - return w.appendTar(r, false) -} - -// AppendTarLossLess reads the tar or tar.gz file from r and appends -// each of its contents to w. -// -// The input r can optionally be gzip compressed but the output will -// always be compressed by the specified compressor. -// -// The difference of this func with AppendTar is that this writes -// the input tar stream into w without any modification (e.g. to header bytes). -// -// Note that if the input tar stream already contains TOC JSON, this returns -// error because w cannot overwrite the TOC JSON to the one generated by w without -// lossy modification. To avoid this error, if the input stream is known to be stargz/estargz, -// you shoud decompress it and remove TOC JSON in advance. -func (w *Writer) AppendTarLossLess(r io.Reader) error { - return w.appendTar(r, true) -} - -func (w *Writer) appendTar(r io.Reader, lossless bool) error { - var src io.Reader - br := bufio.NewReader(r) - if isGzip(br) { - zr, _ := gzip.NewReader(br) - src = zr - } else { - src = io.Reader(br) - } - dst := currentCompressionWriter{w} - var tw *tar.Writer - if !lossless { - tw = tar.NewWriter(dst) // use tar writer only when this isn't lossless mode. - } - tr := tar.NewReader(src) - if lossless { - tr.RawAccounting = true - } - prevOffset := w.cw.n - var prevOffsetUncompressed int64 - for { - h, err := tr.Next() - if err == io.EOF { - if lossless { - if remain := tr.RawBytes(); len(remain) > 0 { - // Collect the remaining null bytes. - // https://github.com/vbatts/tar-split/blob/80a436fd6164c557b131f7c59ed69bd81af69761/concept/main.go#L49-L53 - if _, err := dst.Write(remain); err != nil { - return err - } - } - } - break - } - if err != nil { - return fmt.Errorf("error reading from source tar: tar.Reader.Next: %v", err) - } - if cleanEntryName(h.Name) == TOCTarName { - // It is possible for a layer to be "stargzified" twice during the - // distribution lifecycle. So we reserve "TOCTarName" here to avoid - // duplicated entries in the resulting layer. - if lossless { - // We cannot handle this in lossless way. - return fmt.Errorf("existing TOC JSON is not allowed; decompress layer before append") - } - continue - } - - xattrs := make(map[string][]byte) - const xattrPAXRecordsPrefix = "SCHILY.xattr." - if h.PAXRecords != nil { - for k, v := range h.PAXRecords { - if strings.HasPrefix(k, xattrPAXRecordsPrefix) { - xattrs[k[len(xattrPAXRecordsPrefix):]] = []byte(v) - } - } - } - ent := &TOCEntry{ - Name: h.Name, - Mode: h.Mode, - UID: h.Uid, - GID: h.Gid, - Uname: w.nameIfChanged(&w.lastUsername, h.Uid, h.Uname), - Gname: w.nameIfChanged(&w.lastGroupname, h.Gid, h.Gname), - ModTime3339: formatModtime(h.ModTime), - Xattrs: xattrs, - } - if err := w.condOpenGz(); err != nil { - return err - } - if tw != nil { - if err := tw.WriteHeader(h); err != nil { - return err - } - } else { - if _, err := dst.Write(tr.RawBytes()); err != nil { - return err - } - } - switch h.Typeflag { - case tar.TypeLink: - ent.Type = "hardlink" - ent.LinkName = h.Linkname - case tar.TypeSymlink: - ent.Type = "symlink" - ent.LinkName = h.Linkname - case tar.TypeDir: - ent.Type = "dir" - case tar.TypeReg: - ent.Type = "reg" - ent.Size = h.Size - case tar.TypeChar: - ent.Type = "char" - ent.DevMajor = int(h.Devmajor) - ent.DevMinor = int(h.Devminor) - case tar.TypeBlock: - ent.Type = "block" - ent.DevMajor = int(h.Devmajor) - ent.DevMinor = int(h.Devminor) - case tar.TypeFifo: - ent.Type = "fifo" - default: - return fmt.Errorf("unsupported input tar entry %q", h.Typeflag) - } - - // We need to keep a reference to the TOC entry for regular files, so that we - // can fill the digest later. - var regFileEntry *TOCEntry - var payloadDigest digest.Digester - if h.Typeflag == tar.TypeReg { - regFileEntry = ent - payloadDigest = digest.Canonical.Digester() - } - - if h.Typeflag == tar.TypeReg && ent.Size > 0 { - var written int64 - totalSize := ent.Size // save it before we destroy ent - tee := io.TeeReader(tr, payloadDigest.Hash()) - for written < totalSize { - chunkSize := int64(w.chunkSize()) - remain := totalSize - written - if remain < chunkSize { - chunkSize = remain - } else { - ent.ChunkSize = chunkSize - } - - // We flush the underlying compression writer here to correctly calculate "w.cw.n". - if err := w.flushGz(); err != nil { - return err - } - if w.needsOpenGz(ent) || w.cw.n-prevOffset >= int64(w.MinChunkSize) { - if err := w.closeGz(); err != nil { - return err - } - ent.Offset = w.cw.n - prevOffset = ent.Offset - prevOffsetUncompressed = w.uncompressedCounter.n - } else { - ent.Offset = prevOffset - ent.InnerOffset = w.uncompressedCounter.n - prevOffsetUncompressed - } - - ent.ChunkOffset = written - chunkDigest := digest.Canonical.Digester() - - if err := w.condOpenGz(); err != nil { - return err - } - - teeChunk := io.TeeReader(tee, chunkDigest.Hash()) - var out io.Writer - if tw != nil { - out = tw - } else { - out = dst - } - if _, err := io.CopyN(out, teeChunk, chunkSize); err != nil { - return fmt.Errorf("error copying %q: %v", h.Name, err) - } - ent.ChunkDigest = chunkDigest.Digest().String() - w.toc.Entries = append(w.toc.Entries, ent) - written += chunkSize - ent = &TOCEntry{ - Name: h.Name, - Type: "chunk", - } - } - } else { - w.toc.Entries = append(w.toc.Entries, ent) - } - if payloadDigest != nil { - regFileEntry.Digest = payloadDigest.Digest().String() - } - if tw != nil { - if err := tw.Flush(); err != nil { - return err - } - } - } - remainDest := io.Discard - if lossless { - remainDest = dst // Preserve the remaining bytes in lossless mode - } - _, err := io.Copy(remainDest, src) - return err -} - -func (w *Writer) needsOpenGz(ent *TOCEntry) bool { - if ent.Type != "reg" { - return false - } - if w.needsOpenGzEntries == nil { - return false - } - _, ok := w.needsOpenGzEntries[ent.Name] - return ok -} - -// DiffID returns the SHA-256 of the uncompressed tar bytes. -// It is only valid to call DiffID after Close. -func (w *Writer) DiffID() string { - return fmt.Sprintf("sha256:%x", w.diffHash.Sum(nil)) -} - -func maxFooterSize(blobSize int64, decompressors ...Decompressor) (res int64) { - for _, d := range decompressors { - if s := d.FooterSize(); res < s && s <= blobSize { - res = s - } - } - return -} - -func parseTOC(d Decompressor, sr *io.SectionReader, tocOff, tocSize int64, tocBytes []byte, opts openOpts) (*Reader, error) { - if tocOff < 0 { - // This means that TOC isn't contained in the blob. - // We pass nil reader to ParseTOC and expect that ParseTOC acquire TOC from - // the external location. - start := time.Now() - toc, tocDgst, err := d.ParseTOC(nil) - if err != nil { - return nil, err - } - if opts.telemetry != nil && opts.telemetry.GetTocLatency != nil { - opts.telemetry.GetTocLatency(start) - } - if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { - opts.telemetry.DeserializeTocLatency(start) - } - return &Reader{ - sr: sr, - toc: toc, - tocDigest: tocDgst, - decompressor: d, - }, nil - } - if len(tocBytes) > 0 { - start := time.Now() - toc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes)) - if err == nil { - if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { - opts.telemetry.DeserializeTocLatency(start) - } - return &Reader{ - sr: sr, - toc: toc, - tocDigest: tocDgst, - decompressor: d, - }, nil - } - } - - start := time.Now() - tocBytes = make([]byte, tocSize) - if _, err := sr.ReadAt(tocBytes, tocOff); err != nil { - return nil, fmt.Errorf("error reading %d byte TOC targz: %v", len(tocBytes), err) - } - if opts.telemetry != nil && opts.telemetry.GetTocLatency != nil { - opts.telemetry.GetTocLatency(start) - } - start = time.Now() - toc, tocDgst, err := d.ParseTOC(bytes.NewReader(tocBytes)) - if err != nil { - return nil, err - } - if opts.telemetry != nil && opts.telemetry.DeserializeTocLatency != nil { - opts.telemetry.DeserializeTocLatency(start) - } - return &Reader{ - sr: sr, - toc: toc, - tocDigest: tocDgst, - decompressor: d, - }, nil -} - -func formatModtime(t time.Time) string { - if t.IsZero() || t.Unix() == 0 { - return "" - } - return t.UTC().Round(time.Second).Format(time.RFC3339) -} - -func cleanEntryName(name string) string { - // Use path.Clean to consistently deal with path separators across platforms. - return strings.TrimPrefix(path.Clean("/"+name), "/") -} - -// countWriter counts how many bytes have been written to its wrapped -// io.Writer. -type countWriter struct { - w io.Writer - n int64 -} - -func (cw *countWriter) Write(p []byte) (n int, err error) { - n, err = cw.w.Write(p) - cw.n += int64(n) - return -} - -type countWriteFlusher struct { - io.WriteCloser - n int64 -} - -func (wc *countWriteFlusher) register(w io.WriteCloser) io.WriteCloser { - wc.WriteCloser = w - return wc -} - -func (wc *countWriteFlusher) Write(p []byte) (n int, err error) { - n, err = wc.WriteCloser.Write(p) - wc.n += int64(n) - return -} - -func (wc *countWriteFlusher) Flush() error { - if f, ok := wc.WriteCloser.(interface { - Flush() error - }); ok { - return f.Flush() - } - return nil -} - -func (wc *countWriteFlusher) Close() error { - err := wc.WriteCloser.Close() - wc.WriteCloser = nil - return err -} - -// isGzip reports whether br is positioned right before an upcoming gzip stream. -// It does not consume any bytes from br. -func isGzip(br *bufio.Reader) bool { - const ( - gzipID1 = 0x1f - gzipID2 = 0x8b - gzipDeflate = 8 - ) - peek, _ := br.Peek(3) - return len(peek) >= 3 && peek[0] == gzipID1 && peek[1] == gzipID2 && peek[2] == gzipDeflate -} - -func positive(n int64) int64 { - if n < 0 { - return 0 - } - return n -} - -type countReader struct { - r io.Reader - n int64 -} - -func (cr *countReader) Read(p []byte) (n int, err error) { - n, err = cr.r.Read(p) - cr.n += int64(n) - return -} diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go deleted file mode 100644 index f24afe32f4..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/gzip.go +++ /dev/null @@ -1,237 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Copyright 2019 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. -*/ - -package estargz - -import ( - "archive/tar" - "bytes" - "compress/gzip" - "encoding/binary" - "encoding/json" - "fmt" - "hash" - "io" - "strconv" - - digest "github.com/opencontainers/go-digest" -) - -type gzipCompression struct { - *GzipCompressor - *GzipDecompressor -} - -func newGzipCompressionWithLevel(level int) Compression { - return &gzipCompression{ - &GzipCompressor{level}, - &GzipDecompressor{}, - } -} - -func NewGzipCompressor() *GzipCompressor { - return &GzipCompressor{gzip.BestCompression} -} - -func NewGzipCompressorWithLevel(level int) *GzipCompressor { - return &GzipCompressor{level} -} - -type GzipCompressor struct { - compressionLevel int -} - -func (gc *GzipCompressor) Writer(w io.Writer) (WriteFlushCloser, error) { - return gzip.NewWriterLevel(w, gc.compressionLevel) -} - -func (gc *GzipCompressor) WriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (digest.Digest, error) { - tocJSON, err := json.MarshalIndent(toc, "", "\t") - if err != nil { - return "", err - } - gz, _ := gzip.NewWriterLevel(w, gc.compressionLevel) - gw := io.Writer(gz) - if diffHash != nil { - gw = io.MultiWriter(gz, diffHash) - } - tw := tar.NewWriter(gw) - if err := tw.WriteHeader(&tar.Header{ - Typeflag: tar.TypeReg, - Name: TOCTarName, - Size: int64(len(tocJSON)), - }); err != nil { - return "", err - } - if _, err := tw.Write(tocJSON); err != nil { - return "", err - } - - if err := tw.Close(); err != nil { - return "", err - } - if err := gz.Close(); err != nil { - return "", err - } - if _, err := w.Write(gzipFooterBytes(off)); err != nil { - return "", err - } - return digest.FromBytes(tocJSON), nil -} - -// gzipFooterBytes returns the 51 bytes footer. -func gzipFooterBytes(tocOff int64) []byte { - buf := bytes.NewBuffer(make([]byte, 0, FooterSize)) - gz, _ := gzip.NewWriterLevel(buf, gzip.NoCompression) // MUST be NoCompression to keep 51 bytes - - // Extra header indicating the offset of TOCJSON - // https://tools.ietf.org/html/rfc1952#section-2.3.1.1 - header := make([]byte, 4) - header[0], header[1] = 'S', 'G' - subfield := fmt.Sprintf("%016xSTARGZ", tocOff) - binary.LittleEndian.PutUint16(header[2:4], uint16(len(subfield))) // little-endian per RFC1952 - gz.Header.Extra = append(header, []byte(subfield)...) - gz.Close() - if buf.Len() != FooterSize { - panic(fmt.Sprintf("footer buffer = %d, not %d", buf.Len(), FooterSize)) - } - return buf.Bytes() -} - -type GzipDecompressor struct{} - -func (gz *GzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) { - return gzip.NewReader(r) -} - -func (gz *GzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { - return parseTOCEStargz(r) -} - -func (gz *GzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) { - if len(p) != FooterSize { - return 0, 0, 0, fmt.Errorf("invalid length %d cannot be parsed", len(p)) - } - zr, err := gzip.NewReader(bytes.NewReader(p)) - if err != nil { - return 0, 0, 0, err - } - defer zr.Close() - extra := zr.Header.Extra - si1, si2, subfieldlen, subfield := extra[0], extra[1], extra[2:4], extra[4:] - if si1 != 'S' || si2 != 'G' { - return 0, 0, 0, fmt.Errorf("invalid subfield IDs: %q, %q; want E, S", si1, si2) - } - if slen := binary.LittleEndian.Uint16(subfieldlen); slen != uint16(16+len("STARGZ")) { - return 0, 0, 0, fmt.Errorf("invalid length of subfield %d; want %d", slen, 16+len("STARGZ")) - } - if string(subfield[16:]) != "STARGZ" { - return 0, 0, 0, fmt.Errorf("STARGZ magic string must be included in the footer subfield") - } - tocOffset, err = strconv.ParseInt(string(subfield[:16]), 16, 64) - if err != nil { - return 0, 0, 0, fmt.Errorf("legacy: failed to parse toc offset: %w", err) - } - return tocOffset, tocOffset, 0, nil -} - -func (gz *GzipDecompressor) FooterSize() int64 { - return FooterSize -} - -func (gz *GzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) { - return decompressTOCEStargz(r) -} - -type LegacyGzipDecompressor struct{} - -func (gz *LegacyGzipDecompressor) Reader(r io.Reader) (io.ReadCloser, error) { - return gzip.NewReader(r) -} - -func (gz *LegacyGzipDecompressor) ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { - return parseTOCEStargz(r) -} - -func (gz *LegacyGzipDecompressor) ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) { - if len(p) != legacyFooterSize { - return 0, 0, 0, fmt.Errorf("legacy: invalid length %d cannot be parsed", len(p)) - } - zr, err := gzip.NewReader(bytes.NewReader(p)) - if err != nil { - return 0, 0, 0, fmt.Errorf("legacy: failed to get footer gzip reader: %w", err) - } - defer zr.Close() - extra := zr.Header.Extra - if len(extra) != 16+len("STARGZ") { - return 0, 0, 0, fmt.Errorf("legacy: invalid stargz's extra field size") - } - if string(extra[16:]) != "STARGZ" { - return 0, 0, 0, fmt.Errorf("legacy: magic string STARGZ not found") - } - tocOffset, err = strconv.ParseInt(string(extra[:16]), 16, 64) - if err != nil { - return 0, 0, 0, fmt.Errorf("legacy: failed to parse toc offset: %w", err) - } - return tocOffset, tocOffset, 0, nil -} - -func (gz *LegacyGzipDecompressor) FooterSize() int64 { - return legacyFooterSize -} - -func (gz *LegacyGzipDecompressor) DecompressTOC(r io.Reader) (tocJSON io.ReadCloser, err error) { - return decompressTOCEStargz(r) -} - -func parseTOCEStargz(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) { - tr, err := decompressTOCEStargz(r) - if err != nil { - return nil, "", err - } - dgstr := digest.Canonical.Digester() - toc = new(JTOC) - if err := json.NewDecoder(io.TeeReader(tr, dgstr.Hash())).Decode(&toc); err != nil { - return nil, "", fmt.Errorf("error decoding TOC JSON: %v", err) - } - if err := tr.Close(); err != nil { - return nil, "", err - } - return toc, dgstr.Digest(), nil -} - -func decompressTOCEStargz(r io.Reader) (tocJSON io.ReadCloser, err error) { - zr, err := gzip.NewReader(r) - if err != nil { - return nil, fmt.Errorf("malformed TOC gzip header: %v", err) - } - zr.Multistream(false) - tr := tar.NewReader(zr) - h, err := tr.Next() - if err != nil { - return nil, fmt.Errorf("failed to find tar header in TOC gzip stream: %v", err) - } - if h.Name != TOCTarName { - return nil, fmt.Errorf("TOC tar entry had name %q; expected %q", h.Name, TOCTarName) - } - return readCloser{tr, zr.Close}, nil -} diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go deleted file mode 100644 index 0ca6fd75f2..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/testutil.go +++ /dev/null @@ -1,2366 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Copyright 2019 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. -*/ - -package estargz - -import ( - "archive/tar" - "bytes" - "compress/gzip" - "crypto/sha256" - "encoding/json" - "errors" - "fmt" - "io" - "math/rand" - "os" - "path/filepath" - "reflect" - "sort" - "strings" - "testing" - "time" - - "github.com/containerd/stargz-snapshotter/estargz/errorutil" - "github.com/klauspost/compress/zstd" - digest "github.com/opencontainers/go-digest" -) - -func init() { - rand.Seed(time.Now().UnixNano()) -} - -// TestingController is Compression with some helper methods necessary for testing. -type TestingController interface { - Compression - TestStreams(t *testing.T, b []byte, streams []int64) - DiffIDOf(*testing.T, []byte) string - String() string -} - -// CompressionTestSuite tests this pkg with controllers can build valid eStargz blobs and parse them. -func CompressionTestSuite(t *testing.T, controllers ...TestingControllerFactory) { - t.Run("testBuild", func(t *testing.T) { t.Parallel(); testBuild(t, controllers...) }) - t.Run("testDigestAndVerify", func(t *testing.T) { t.Parallel(); testDigestAndVerify(t, controllers...) }) - t.Run("testWriteAndOpen", func(t *testing.T) { t.Parallel(); testWriteAndOpen(t, controllers...) }) -} - -type TestingControllerFactory func() TestingController - -const ( - uncompressedType int = iota - gzipType - zstdType -) - -var srcCompressions = []int{ - uncompressedType, - gzipType, - zstdType, -} - -var allowedPrefix = [4]string{"", "./", "/", "../"} - -// testBuild tests the resulting stargz blob built by this pkg has the same -// contents as the normal stargz blob. -func testBuild(t *testing.T, controllers ...TestingControllerFactory) { - tests := []struct { - name string - chunkSize int - minChunkSize []int - in []tarEntry - }{ - { - name: "regfiles and directories", - chunkSize: 4, - in: tarOf( - file("foo", "test1"), - dir("foo2/"), - file("foo2/bar", "test2", xAttr(map[string]string{"test": "sample"})), - ), - }, - { - name: "empty files", - chunkSize: 4, - in: tarOf( - file("foo", "tttttt"), - file("foo_empty", ""), - file("foo2", "tttttt"), - file("foo_empty2", ""), - file("foo3", "tttttt"), - file("foo_empty3", ""), - file("foo4", "tttttt"), - file("foo_empty4", ""), - file("foo5", "tttttt"), - file("foo_empty5", ""), - file("foo6", "tttttt"), - ), - }, - { - name: "various files", - chunkSize: 4, - minChunkSize: []int{0, 64000}, - in: tarOf( - file("baz.txt", "bazbazbazbazbazbazbaz"), - file("foo1.txt", "a"), - file("bar/foo2.txt", "b"), - file("foo3.txt", "c"), - symlink("barlink", "test/bar.txt"), - dir("test/"), - dir("dev/"), - blockdev("dev/testblock", 3, 4), - fifo("dev/testfifo"), - chardev("dev/testchar1", 5, 6), - file("test/bar.txt", "testbartestbar", xAttr(map[string]string{"test2": "sample2"})), - dir("test2/"), - link("test2/bazlink", "baz.txt"), - chardev("dev/testchar2", 1, 2), - ), - }, - { - name: "no contents", - chunkSize: 4, - in: tarOf( - file("baz.txt", ""), - symlink("barlink", "test/bar.txt"), - dir("test/"), - dir("dev/"), - blockdev("dev/testblock", 3, 4), - fifo("dev/testfifo"), - chardev("dev/testchar1", 5, 6), - file("test/bar.txt", "", xAttr(map[string]string{"test2": "sample2"})), - dir("test2/"), - link("test2/bazlink", "baz.txt"), - chardev("dev/testchar2", 1, 2), - ), - }, - } - for _, tt := range tests { - if len(tt.minChunkSize) == 0 { - tt.minChunkSize = []int{0} - } - for _, srcCompression := range srcCompressions { - srcCompression := srcCompression - for _, newCL := range controllers { - newCL := newCL - for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { - srcTarFormat := srcTarFormat - for _, prefix := range allowedPrefix { - prefix := prefix - for _, minChunkSize := range tt.minChunkSize { - minChunkSize := minChunkSize - t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,src=%d,format=%s,minChunkSize=%d", newCL(), prefix, srcCompression, srcTarFormat, minChunkSize), func(t *testing.T) { - tarBlob := buildTar(t, tt.in, prefix, srcTarFormat) - // Test divideEntries() - entries, err := sortEntries(tarBlob, nil, nil) // identical order - if err != nil { - t.Fatalf("failed to parse tar: %v", err) - } - var merged []*entry - for _, part := range divideEntries(entries, 4) { - merged = append(merged, part...) - } - if !reflect.DeepEqual(entries, merged) { - for _, e := range entries { - t.Logf("Original: %v", e.header) - } - for _, e := range merged { - t.Logf("Merged: %v", e.header) - } - t.Errorf("divided entries couldn't be merged") - return - } - - // Prepare sample data - cl1 := newCL() - wantBuf := new(bytes.Buffer) - sw := NewWriterWithCompressor(wantBuf, cl1) - sw.MinChunkSize = minChunkSize - sw.ChunkSize = tt.chunkSize - if err := sw.AppendTar(tarBlob); err != nil { - t.Fatalf("failed to append tar to want stargz: %v", err) - } - if _, err := sw.Close(); err != nil { - t.Fatalf("failed to prepare want stargz: %v", err) - } - wantData := wantBuf.Bytes() - want, err := Open(io.NewSectionReader( - bytes.NewReader(wantData), 0, int64(len(wantData))), - WithDecompressors(cl1), - ) - if err != nil { - t.Fatalf("failed to parse the want stargz: %v", err) - } - - // Prepare testing data - var opts []Option - if minChunkSize > 0 { - opts = append(opts, WithMinChunkSize(minChunkSize)) - } - cl2 := newCL() - rc, err := Build(compressBlob(t, tarBlob, srcCompression), - append(opts, WithChunkSize(tt.chunkSize), WithCompression(cl2))...) - if err != nil { - t.Fatalf("failed to build stargz: %v", err) - } - defer rc.Close() - gotBuf := new(bytes.Buffer) - if _, err := io.Copy(gotBuf, rc); err != nil { - t.Fatalf("failed to copy built stargz blob: %v", err) - } - gotData := gotBuf.Bytes() - got, err := Open(io.NewSectionReader( - bytes.NewReader(gotBuf.Bytes()), 0, int64(len(gotData))), - WithDecompressors(cl2), - ) - if err != nil { - t.Fatalf("failed to parse the got stargz: %v", err) - } - - // Check DiffID is properly calculated - rc.Close() - diffID := rc.DiffID() - wantDiffID := cl2.DiffIDOf(t, gotData) - if diffID.String() != wantDiffID { - t.Errorf("DiffID = %q; want %q", diffID, wantDiffID) - } - - // Compare as stargz - if !isSameVersion(t, cl1, wantData, cl2, gotData) { - t.Errorf("built stargz hasn't same json") - return - } - if !isSameEntries(t, want, got) { - t.Errorf("built stargz isn't same as the original") - return - } - - // Compare as tar.gz - if !isSameTarGz(t, cl1, wantData, cl2, gotData) { - t.Errorf("built stargz isn't same tar.gz") - return - } - }) - } - } - } - } - } - } -} - -func isSameTarGz(t *testing.T, cla TestingController, a []byte, clb TestingController, b []byte) bool { - aGz, err := cla.Reader(bytes.NewReader(a)) - if err != nil { - t.Fatalf("failed to read A") - } - defer aGz.Close() - bGz, err := clb.Reader(bytes.NewReader(b)) - if err != nil { - t.Fatalf("failed to read B") - } - defer bGz.Close() - - // Same as tar's Next() method but ignores landmarks and TOCJSON file - next := func(r *tar.Reader) (h *tar.Header, err error) { - for { - if h, err = r.Next(); err != nil { - return - } - if h.Name != PrefetchLandmark && - h.Name != NoPrefetchLandmark && - h.Name != TOCTarName { - return - } - } - } - - aTar := tar.NewReader(aGz) - bTar := tar.NewReader(bGz) - for { - // Fetch and parse next header. - aH, aErr := next(aTar) - bH, bErr := next(bTar) - if aErr != nil || bErr != nil { - if aErr == io.EOF && bErr == io.EOF { - break - } - t.Fatalf("Failed to parse tar file: A: %v, B: %v", aErr, bErr) - } - if !reflect.DeepEqual(aH, bH) { - t.Logf("different header (A = %v; B = %v)", aH, bH) - return false - - } - aFile, err := io.ReadAll(aTar) - if err != nil { - t.Fatal("failed to read tar payload of A") - } - bFile, err := io.ReadAll(bTar) - if err != nil { - t.Fatal("failed to read tar payload of B") - } - if !bytes.Equal(aFile, bFile) { - t.Logf("different tar payload (A = %q; B = %q)", string(a), string(b)) - return false - } - } - - return true -} - -func isSameVersion(t *testing.T, cla TestingController, a []byte, clb TestingController, b []byte) bool { - aJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(a), 0, int64(len(a))), cla) - if err != nil { - t.Fatalf("failed to parse A: %v", err) - } - bJTOC, _, err := parseStargz(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), clb) - if err != nil { - t.Fatalf("failed to parse B: %v", err) - } - t.Logf("A: TOCJSON: %v", dumpTOCJSON(t, aJTOC)) - t.Logf("B: TOCJSON: %v", dumpTOCJSON(t, bJTOC)) - return aJTOC.Version == bJTOC.Version -} - -func isSameEntries(t *testing.T, a, b *Reader) bool { - aroot, ok := a.Lookup("") - if !ok { - t.Fatalf("failed to get root of A") - } - broot, ok := b.Lookup("") - if !ok { - t.Fatalf("failed to get root of B") - } - aEntry := stargzEntry{aroot, a} - bEntry := stargzEntry{broot, b} - return contains(t, aEntry, bEntry) && contains(t, bEntry, aEntry) -} - -func compressBlob(t *testing.T, src *io.SectionReader, srcCompression int) *io.SectionReader { - buf := new(bytes.Buffer) - var w io.WriteCloser - var err error - if srcCompression == gzipType { - w = gzip.NewWriter(buf) - } else if srcCompression == zstdType { - w, err = zstd.NewWriter(buf) - if err != nil { - t.Fatalf("failed to init zstd writer: %v", err) - } - } else { - return src - } - src.Seek(0, io.SeekStart) - if _, err := io.Copy(w, src); err != nil { - t.Fatalf("failed to compress source") - } - if err := w.Close(); err != nil { - t.Fatalf("failed to finalize compress source") - } - data := buf.Bytes() - return io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data))) - -} - -type stargzEntry struct { - e *TOCEntry - r *Reader -} - -// contains checks if all child entries in "b" are also contained in "a". -// This function also checks if the files/chunks contain the same contents among "a" and "b". -func contains(t *testing.T, a, b stargzEntry) bool { - ae, ar := a.e, a.r - be, br := b.e, b.r - t.Logf("Comparing: %q vs %q", ae.Name, be.Name) - if !equalEntry(ae, be) { - t.Logf("%q != %q: entry: a: %v, b: %v", ae.Name, be.Name, ae, be) - return false - } - if ae.Type == "dir" { - t.Logf("Directory: %q vs %q: %v vs %v", ae.Name, be.Name, - allChildrenName(ae), allChildrenName(be)) - iscontain := true - ae.ForeachChild(func(aBaseName string, aChild *TOCEntry) bool { - // Walk through all files on this stargz file. - - if aChild.Name == PrefetchLandmark || - aChild.Name == NoPrefetchLandmark { - return true // Ignore landmarks - } - - // Ignore a TOCEntry of "./" (formated as "" by stargz lib) on root directory - // because this points to the root directory itself. - if aChild.Name == "" && ae.Name == "" { - return true - } - - bChild, ok := be.LookupChild(aBaseName) - if !ok { - t.Logf("%q (base: %q): not found in b: %v", - ae.Name, aBaseName, allChildrenName(be)) - iscontain = false - return false - } - - childcontain := contains(t, stargzEntry{aChild, a.r}, stargzEntry{bChild, b.r}) - if !childcontain { - t.Logf("%q != %q: non-equal dir", ae.Name, be.Name) - iscontain = false - return false - } - return true - }) - return iscontain - } else if ae.Type == "reg" { - af, err := ar.OpenFile(ae.Name) - if err != nil { - t.Fatalf("failed to open file %q on A: %v", ae.Name, err) - } - bf, err := br.OpenFile(be.Name) - if err != nil { - t.Fatalf("failed to open file %q on B: %v", be.Name, err) - } - - var nr int64 - for nr < ae.Size { - abytes, anext, aok := readOffset(t, af, nr, a) - bbytes, bnext, bok := readOffset(t, bf, nr, b) - if !aok && !bok { - break - } else if !(aok && bok) || anext != bnext { - t.Logf("%q != %q (offset=%d): chunk existence a=%v vs b=%v, anext=%v vs bnext=%v", - ae.Name, be.Name, nr, aok, bok, anext, bnext) - return false - } - nr = anext - if !bytes.Equal(abytes, bbytes) { - t.Logf("%q != %q: different contents %v vs %v", - ae.Name, be.Name, string(abytes), string(bbytes)) - return false - } - } - return true - } - - return true -} - -func allChildrenName(e *TOCEntry) (children []string) { - e.ForeachChild(func(baseName string, _ *TOCEntry) bool { - children = append(children, baseName) - return true - }) - return -} - -func equalEntry(a, b *TOCEntry) bool { - // Here, we selectively compare fileds that we are interested in. - return a.Name == b.Name && - a.Type == b.Type && - a.Size == b.Size && - a.ModTime3339 == b.ModTime3339 && - a.Stat().ModTime().Equal(b.Stat().ModTime()) && // modTime time.Time - a.LinkName == b.LinkName && - a.Mode == b.Mode && - a.UID == b.UID && - a.GID == b.GID && - a.Uname == b.Uname && - a.Gname == b.Gname && - (a.Offset >= 0) == (b.Offset >= 0) && - (a.NextOffset() > 0) == (b.NextOffset() > 0) && - a.DevMajor == b.DevMajor && - a.DevMinor == b.DevMinor && - a.NumLink == b.NumLink && - reflect.DeepEqual(a.Xattrs, b.Xattrs) && - // chunk-related infomations aren't compared in this function. - // ChunkOffset int64 `json:"chunkOffset,omitempty"` - // ChunkSize int64 `json:"chunkSize,omitempty"` - // children map[string]*TOCEntry - a.Digest == b.Digest -} - -func readOffset(t *testing.T, r *io.SectionReader, offset int64, e stargzEntry) ([]byte, int64, bool) { - ce, ok := e.r.ChunkEntryForOffset(e.e.Name, offset) - if !ok { - return nil, 0, false - } - data := make([]byte, ce.ChunkSize) - t.Logf("Offset: %v, NextOffset: %v", ce.Offset, ce.NextOffset()) - n, err := r.ReadAt(data, ce.ChunkOffset) - if err != nil { - t.Fatalf("failed to read file payload of %q (offset:%d,size:%d): %v", - e.e.Name, ce.ChunkOffset, ce.ChunkSize, err) - } - if int64(n) != ce.ChunkSize { - t.Fatalf("unexpected copied data size %d; want %d", - n, ce.ChunkSize) - } - return data[:n], offset + ce.ChunkSize, true -} - -func dumpTOCJSON(t *testing.T, tocJSON *JTOC) string { - jtocData, err := json.Marshal(*tocJSON) - if err != nil { - t.Fatalf("failed to marshal TOC JSON: %v", err) - } - buf := new(bytes.Buffer) - if _, err := io.Copy(buf, bytes.NewReader(jtocData)); err != nil { - t.Fatalf("failed to read toc json blob: %v", err) - } - return buf.String() -} - -const chunkSize = 3 - -// type check func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, compressionLevel int) -type check func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) - -// testDigestAndVerify runs specified checks against sample stargz blobs. -func testDigestAndVerify(t *testing.T, controllers ...TestingControllerFactory) { - tests := []struct { - name string - tarInit func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) - checks []check - minChunkSize []int - }{ - { - name: "no-regfile", - tarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) { - return tarOf( - dir("test/"), - ) - }, - checks: []check{ - checkStargzTOC, - checkVerifyTOC, - checkVerifyInvalidStargzFail(buildTar(t, tarOf( - dir("test2/"), // modified - ), allowedPrefix[0])), - }, - }, - { - name: "small-files", - tarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) { - return tarOf( - regDigest(t, "baz.txt", "", dgstMap), - regDigest(t, "foo.txt", "a", dgstMap), - dir("test/"), - regDigest(t, "test/bar.txt", "bbb", dgstMap), - ) - }, - minChunkSize: []int{0, 64000}, - checks: []check{ - checkStargzTOC, - checkVerifyTOC, - checkVerifyInvalidStargzFail(buildTar(t, tarOf( - file("baz.txt", ""), - file("foo.txt", "M"), // modified - dir("test/"), - file("test/bar.txt", "bbb"), - ), allowedPrefix[0])), - // checkVerifyInvalidTOCEntryFail("foo.txt"), // TODO - checkVerifyBrokenContentFail("foo.txt"), - }, - }, - { - name: "big-files", - tarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) { - return tarOf( - regDigest(t, "baz.txt", "bazbazbazbazbazbazbaz", dgstMap), - regDigest(t, "foo.txt", "a", dgstMap), - dir("test/"), - regDigest(t, "test/bar.txt", "testbartestbar", dgstMap), - ) - }, - checks: []check{ - checkStargzTOC, - checkVerifyTOC, - checkVerifyInvalidStargzFail(buildTar(t, tarOf( - file("baz.txt", "bazbazbazMMMbazbazbaz"), // modified - file("foo.txt", "a"), - dir("test/"), - file("test/bar.txt", "testbartestbar"), - ), allowedPrefix[0])), - checkVerifyInvalidTOCEntryFail("test/bar.txt"), - checkVerifyBrokenContentFail("test/bar.txt"), - }, - }, - { - name: "with-non-regfiles", - minChunkSize: []int{0, 64000}, - tarInit: func(t *testing.T, dgstMap map[string]digest.Digest) (blob []tarEntry) { - return tarOf( - regDigest(t, "baz.txt", "bazbazbazbazbazbazbaz", dgstMap), - regDigest(t, "foo.txt", "a", dgstMap), - regDigest(t, "bar/foo2.txt", "b", dgstMap), - regDigest(t, "foo3.txt", "c", dgstMap), - symlink("barlink", "test/bar.txt"), - dir("test/"), - regDigest(t, "test/bar.txt", "testbartestbar", dgstMap), - dir("test2/"), - link("test2/bazlink", "baz.txt"), - ) - }, - checks: []check{ - checkStargzTOC, - checkVerifyTOC, - checkVerifyInvalidStargzFail(buildTar(t, tarOf( - file("baz.txt", "bazbazbazbazbazbazbaz"), - file("foo.txt", "a"), - file("bar/foo2.txt", "b"), - file("foo3.txt", "c"), - symlink("barlink", "test/bar.txt"), - dir("test/"), - file("test/bar.txt", "testbartestbar"), - dir("test2/"), - link("test2/bazlink", "foo.txt"), // modified - ), allowedPrefix[0])), - checkVerifyInvalidTOCEntryFail("test/bar.txt"), - checkVerifyBrokenContentFail("test/bar.txt"), - }, - }, - } - - for _, tt := range tests { - if len(tt.minChunkSize) == 0 { - tt.minChunkSize = []int{0} - } - for _, srcCompression := range srcCompressions { - srcCompression := srcCompression - for _, newCL := range controllers { - newCL := newCL - for _, prefix := range allowedPrefix { - prefix := prefix - for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { - srcTarFormat := srcTarFormat - for _, minChunkSize := range tt.minChunkSize { - minChunkSize := minChunkSize - t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,format=%s,minChunkSize=%d", newCL(), prefix, srcTarFormat, minChunkSize), func(t *testing.T) { - // Get original tar file and chunk digests - dgstMap := make(map[string]digest.Digest) - tarBlob := buildTar(t, tt.tarInit(t, dgstMap), prefix, srcTarFormat) - - cl := newCL() - rc, err := Build(compressBlob(t, tarBlob, srcCompression), - WithChunkSize(chunkSize), WithCompression(cl)) - if err != nil { - t.Fatalf("failed to convert stargz: %v", err) - } - tocDigest := rc.TOCDigest() - defer rc.Close() - buf := new(bytes.Buffer) - if _, err := io.Copy(buf, rc); err != nil { - t.Fatalf("failed to copy built stargz blob: %v", err) - } - newStargz := buf.Bytes() - // NoPrefetchLandmark is added during `Bulid`, which is expected behaviour. - dgstMap[chunkID(NoPrefetchLandmark, 0, int64(len([]byte{landmarkContents})))] = digest.FromBytes([]byte{landmarkContents}) - - for _, check := range tt.checks { - check(t, newStargz, tocDigest, dgstMap, cl, newCL) - } - }) - } - } - } - } - } - } -} - -// checkStargzTOC checks the TOC JSON of the passed stargz has the expected -// digest and contains valid chunks. It walks all entries in the stargz and -// checks all chunk digests stored to the TOC JSON match the actual contents. -func checkStargzTOC(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { - sgz, err := Open( - io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), - WithDecompressors(controller), - ) - if err != nil { - t.Errorf("failed to parse converted stargz: %v", err) - return - } - digestMapTOC, err := listDigests(io.NewSectionReader( - bytes.NewReader(sgzData), 0, int64(len(sgzData))), - controller, - ) - if err != nil { - t.Fatalf("failed to list digest: %v", err) - } - found := make(map[string]bool) - for id := range dgstMap { - found[id] = false - } - zr, err := controller.Reader(bytes.NewReader(sgzData)) - if err != nil { - t.Fatalf("failed to decompress converted stargz: %v", err) - } - defer zr.Close() - tr := tar.NewReader(zr) - for { - h, err := tr.Next() - if err != nil { - if err != io.EOF { - t.Errorf("failed to read tar entry: %v", err) - return - } - break - } - if h.Name == TOCTarName { - // Check the digest of TOC JSON based on the actual contents - // It's sure that TOC JSON exists in this archive because - // Open succeeded. - dgstr := digest.Canonical.Digester() - if _, err := io.Copy(dgstr.Hash(), tr); err != nil { - t.Fatalf("failed to calculate digest of TOC JSON: %v", - err) - } - if dgstr.Digest() != tocDigest { - t.Errorf("invalid TOC JSON %q; want %q", tocDigest, dgstr.Digest()) - } - continue - } - if _, ok := sgz.Lookup(h.Name); !ok { - t.Errorf("lost stargz entry %q in the converted TOC", h.Name) - return - } - var n int64 - for n < h.Size { - ce, ok := sgz.ChunkEntryForOffset(h.Name, n) - if !ok { - t.Errorf("lost chunk %q(offset=%d) in the converted TOC", - h.Name, n) - return - } - - // Get the original digest to make sure the file contents are kept unchanged - // from the original tar, during the whole conversion steps. - id := chunkID(h.Name, n, ce.ChunkSize) - want, ok := dgstMap[id] - if !ok { - t.Errorf("Unexpected chunk %q(offset=%d,size=%d): %v", - h.Name, n, ce.ChunkSize, dgstMap) - return - } - found[id] = true - - // Check the file contents - dgstr := digest.Canonical.Digester() - if _, err := io.CopyN(dgstr.Hash(), tr, ce.ChunkSize); err != nil { - t.Fatalf("failed to calculate digest of %q (offset=%d,size=%d)", - h.Name, n, ce.ChunkSize) - } - if want != dgstr.Digest() { - t.Errorf("Invalid contents in converted stargz %q: %q; want %q", - h.Name, dgstr.Digest(), want) - return - } - - // Check the digest stored in TOC JSON - dgstTOC, ok := digestMapTOC[ce.Offset] - if !ok { - t.Errorf("digest of %q(offset=%d,size=%d,chunkOffset=%d) isn't registered", - h.Name, ce.Offset, ce.ChunkSize, ce.ChunkOffset) - } - if want != dgstTOC { - t.Errorf("Invalid digest in TOCEntry %q: %q; want %q", - h.Name, dgstTOC, want) - return - } - - n += ce.ChunkSize - } - } - - for id, ok := range found { - if !ok { - t.Errorf("required chunk %q not found in the converted stargz: %v", id, found) - } - } -} - -// checkVerifyTOC checks the verification works for the TOC JSON of the passed -// stargz. It walks all entries in the stargz and checks the verifications for -// all chunks work. -func checkVerifyTOC(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { - sgz, err := Open( - io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), - WithDecompressors(controller), - ) - if err != nil { - t.Errorf("failed to parse converted stargz: %v", err) - return - } - ev, err := sgz.VerifyTOC(tocDigest) - if err != nil { - t.Errorf("failed to verify stargz: %v", err) - return - } - - found := make(map[string]bool) - for id := range dgstMap { - found[id] = false - } - zr, err := controller.Reader(bytes.NewReader(sgzData)) - if err != nil { - t.Fatalf("failed to decompress converted stargz: %v", err) - } - defer zr.Close() - tr := tar.NewReader(zr) - for { - h, err := tr.Next() - if err != nil { - if err != io.EOF { - t.Errorf("failed to read tar entry: %v", err) - return - } - break - } - if h.Name == TOCTarName { - continue - } - if _, ok := sgz.Lookup(h.Name); !ok { - t.Errorf("lost stargz entry %q in the converted TOC", h.Name) - return - } - var n int64 - for n < h.Size { - ce, ok := sgz.ChunkEntryForOffset(h.Name, n) - if !ok { - t.Errorf("lost chunk %q(offset=%d) in the converted TOC", - h.Name, n) - return - } - - v, err := ev.Verifier(ce) - if err != nil { - t.Errorf("failed to get verifier for %q(offset=%d)", h.Name, n) - } - - found[chunkID(h.Name, n, ce.ChunkSize)] = true - - // Check the file contents - if _, err := io.CopyN(v, tr, ce.ChunkSize); err != nil { - t.Fatalf("failed to get chunk of %q (offset=%d,size=%d)", - h.Name, n, ce.ChunkSize) - } - if !v.Verified() { - t.Errorf("Invalid contents in converted stargz %q (should be succeeded)", - h.Name) - return - } - n += ce.ChunkSize - } - } - - for id, ok := range found { - if !ok { - t.Errorf("required chunk %q not found in the converted stargz: %v", id, found) - } - } -} - -// checkVerifyInvalidTOCEntryFail checks if misconfigured TOC JSON can be -// detected during the verification and the verification returns an error. -func checkVerifyInvalidTOCEntryFail(filename string) check { - return func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { - funcs := map[string]rewriteFunc{ - "lost digest in a entry": func(t *testing.T, toc *JTOC, sgz *io.SectionReader) { - var found bool - for _, e := range toc.Entries { - if cleanEntryName(e.Name) == filename { - if e.Type != "reg" && e.Type != "chunk" { - t.Fatalf("entry %q to break must be regfile or chunk", filename) - } - if e.ChunkDigest == "" { - t.Fatalf("entry %q is already invalid", filename) - } - e.ChunkDigest = "" - found = true - } - } - if !found { - t.Fatalf("rewrite target not found") - } - }, - "duplicated entry offset": func(t *testing.T, toc *JTOC, sgz *io.SectionReader) { - var ( - sampleEntry *TOCEntry - targetEntry *TOCEntry - ) - for _, e := range toc.Entries { - if e.Type == "reg" || e.Type == "chunk" { - if cleanEntryName(e.Name) == filename { - targetEntry = e - } else { - sampleEntry = e - } - } - } - if sampleEntry == nil { - t.Fatalf("TOC must contain at least one regfile or chunk entry other than the rewrite target") - } - if targetEntry == nil { - t.Fatalf("rewrite target not found") - } - targetEntry.Offset = sampleEntry.Offset - }, - } - - for name, rFunc := range funcs { - t.Run(name, func(t *testing.T) { - newSgz, newTocDigest := rewriteTOCJSON(t, io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), rFunc, controller) - buf := new(bytes.Buffer) - if _, err := io.Copy(buf, newSgz); err != nil { - t.Fatalf("failed to get converted stargz") - } - isgz := buf.Bytes() - - sgz, err := Open( - io.NewSectionReader(bytes.NewReader(isgz), 0, int64(len(isgz))), - WithDecompressors(controller), - ) - if err != nil { - t.Fatalf("failed to parse converted stargz: %v", err) - return - } - _, err = sgz.VerifyTOC(newTocDigest) - if err == nil { - t.Errorf("must fail for invalid TOC") - return - } - }) - } - } -} - -// checkVerifyInvalidStargzFail checks if the verification detects that the -// given stargz file doesn't match to the expected digest and returns error. -func checkVerifyInvalidStargzFail(invalid *io.SectionReader) check { - return func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { - cl := newController() - rc, err := Build(invalid, WithChunkSize(chunkSize), WithCompression(cl)) - if err != nil { - t.Fatalf("failed to convert stargz: %v", err) - } - defer rc.Close() - buf := new(bytes.Buffer) - if _, err := io.Copy(buf, rc); err != nil { - t.Fatalf("failed to copy built stargz blob: %v", err) - } - mStargz := buf.Bytes() - - sgz, err := Open( - io.NewSectionReader(bytes.NewReader(mStargz), 0, int64(len(mStargz))), - WithDecompressors(cl), - ) - if err != nil { - t.Fatalf("failed to parse converted stargz: %v", err) - return - } - _, err = sgz.VerifyTOC(tocDigest) - if err == nil { - t.Errorf("must fail for invalid TOC") - return - } - } -} - -// checkVerifyBrokenContentFail checks if the verifier detects broken contents -// that doesn't match to the expected digest and returns error. -func checkVerifyBrokenContentFail(filename string) check { - return func(t *testing.T, sgzData []byte, tocDigest digest.Digest, dgstMap map[string]digest.Digest, controller TestingController, newController TestingControllerFactory) { - // Parse stargz file - sgz, err := Open( - io.NewSectionReader(bytes.NewReader(sgzData), 0, int64(len(sgzData))), - WithDecompressors(controller), - ) - if err != nil { - t.Fatalf("failed to parse converted stargz: %v", err) - return - } - ev, err := sgz.VerifyTOC(tocDigest) - if err != nil { - t.Fatalf("failed to verify stargz: %v", err) - return - } - - // Open the target file - sr, err := sgz.OpenFile(filename) - if err != nil { - t.Fatalf("failed to open file %q", filename) - } - ce, ok := sgz.ChunkEntryForOffset(filename, 0) - if !ok { - t.Fatalf("lost chunk %q(offset=%d) in the converted TOC", filename, 0) - return - } - if ce.ChunkSize == 0 { - t.Fatalf("file mustn't be empty") - return - } - data := make([]byte, ce.ChunkSize) - if _, err := sr.ReadAt(data, ce.ChunkOffset); err != nil { - t.Errorf("failed to get data of a chunk of %q(offset=%q)", - filename, ce.ChunkOffset) - } - - // Check the broken chunk (must fail) - v, err := ev.Verifier(ce) - if err != nil { - t.Fatalf("failed to get verifier for %q", filename) - } - broken := append([]byte{^data[0]}, data[1:]...) - if _, err := io.CopyN(v, bytes.NewReader(broken), ce.ChunkSize); err != nil { - t.Fatalf("failed to get chunk of %q (offset=%d,size=%d)", - filename, ce.ChunkOffset, ce.ChunkSize) - } - if v.Verified() { - t.Errorf("verification must fail for broken file chunk %q(org:%q,broken:%q)", - filename, data, broken) - } - } -} - -func chunkID(name string, offset, size int64) string { - return fmt.Sprintf("%s-%d-%d", cleanEntryName(name), offset, size) -} - -type rewriteFunc func(t *testing.T, toc *JTOC, sgz *io.SectionReader) - -func rewriteTOCJSON(t *testing.T, sgz *io.SectionReader, rewrite rewriteFunc, controller TestingController) (newSgz io.Reader, tocDigest digest.Digest) { - decodedJTOC, jtocOffset, err := parseStargz(sgz, controller) - if err != nil { - t.Fatalf("failed to extract TOC JSON: %v", err) - } - - rewrite(t, decodedJTOC, sgz) - - tocFooter, tocDigest, err := tocAndFooter(controller, decodedJTOC, jtocOffset) - if err != nil { - t.Fatalf("failed to create toc and footer: %v", err) - } - - // Reconstruct stargz file with the modified TOC JSON - if _, err := sgz.Seek(0, io.SeekStart); err != nil { - t.Fatalf("failed to reset the seek position of stargz: %v", err) - } - return io.MultiReader( - io.LimitReader(sgz, jtocOffset), // Original stargz (before TOC JSON) - tocFooter, // Rewritten TOC and footer - ), tocDigest -} - -func listDigests(sgz *io.SectionReader, controller TestingController) (map[int64]digest.Digest, error) { - decodedJTOC, _, err := parseStargz(sgz, controller) - if err != nil { - return nil, err - } - digestMap := make(map[int64]digest.Digest) - for _, e := range decodedJTOC.Entries { - if e.Type == "reg" || e.Type == "chunk" { - if e.Type == "reg" && e.Size == 0 { - continue // ignores empty file - } - if e.ChunkDigest == "" { - return nil, fmt.Errorf("ChunkDigest of %q(off=%d) not found in TOC JSON", - e.Name, e.Offset) - } - d, err := digest.Parse(e.ChunkDigest) - if err != nil { - return nil, err - } - digestMap[e.Offset] = d - } - } - return digestMap, nil -} - -func parseStargz(sgz *io.SectionReader, controller TestingController) (decodedJTOC *JTOC, jtocOffset int64, err error) { - fSize := controller.FooterSize() - footer := make([]byte, fSize) - if _, err := sgz.ReadAt(footer, sgz.Size()-fSize); err != nil { - return nil, 0, fmt.Errorf("error reading footer: %w", err) - } - _, tocOffset, _, err := controller.ParseFooter(footer[positive(int64(len(footer))-fSize):]) - if err != nil { - return nil, 0, fmt.Errorf("failed to parse footer: %w", err) - } - - // Decode the TOC JSON - var tocReader io.Reader - if tocOffset >= 0 { - tocReader = io.NewSectionReader(sgz, tocOffset, sgz.Size()-tocOffset-fSize) - } - decodedJTOC, _, err = controller.ParseTOC(tocReader) - if err != nil { - return nil, 0, fmt.Errorf("failed to parse TOC: %w", err) - } - return decodedJTOC, tocOffset, nil -} - -func testWriteAndOpen(t *testing.T, controllers ...TestingControllerFactory) { - const content = "Some contents" - invalidUtf8 := "\xff\xfe\xfd" - - xAttrFile := xAttr{"foo": "bar", "invalid-utf8": invalidUtf8} - sampleOwner := owner{uid: 50, gid: 100} - - data64KB := randomContents(64000) - - tests := []struct { - name string - chunkSize int - minChunkSize int - in []tarEntry - want []stargzCheck - wantNumGz int // expected number of streams - - wantNumGzLossLess int // expected number of streams (> 0) in lossless mode if it's different from wantNumGz - wantFailOnLossLess bool - wantTOCVersion int // default = 1 - }{ - { - name: "empty", - in: tarOf(), - wantNumGz: 2, // (empty tar) + TOC + footer - want: checks( - numTOCEntries(0), - ), - }, - { - name: "1dir_1empty_file", - in: tarOf( - dir("foo/"), - file("foo/bar.txt", ""), - ), - wantNumGz: 3, // dir, TOC, footer - want: checks( - numTOCEntries(2), - hasDir("foo/"), - hasFileLen("foo/bar.txt", 0), - entryHasChildren("foo", "bar.txt"), - hasFileDigest("foo/bar.txt", digestFor("")), - ), - }, - { - name: "1dir_1file", - in: tarOf( - dir("foo/"), - file("foo/bar.txt", content, xAttrFile), - ), - wantNumGz: 4, // var dir, foo.txt alone, TOC, footer - want: checks( - numTOCEntries(2), - hasDir("foo/"), - hasFileLen("foo/bar.txt", len(content)), - hasFileDigest("foo/bar.txt", digestFor(content)), - hasFileContentsRange("foo/bar.txt", 0, content), - hasFileContentsRange("foo/bar.txt", 1, content[1:]), - entryHasChildren("", "foo"), - entryHasChildren("foo", "bar.txt"), - hasFileXattrs("foo/bar.txt", "foo", "bar"), - hasFileXattrs("foo/bar.txt", "invalid-utf8", invalidUtf8), - ), - }, - { - name: "2meta_2file", - in: tarOf( - dir("bar/", sampleOwner), - dir("foo/", sampleOwner), - file("foo/bar.txt", content, sampleOwner), - ), - wantNumGz: 4, // both dirs, foo.txt alone, TOC, footer - want: checks( - numTOCEntries(3), - hasDir("bar/"), - hasDir("foo/"), - hasFileLen("foo/bar.txt", len(content)), - entryHasChildren("", "bar", "foo"), - entryHasChildren("foo", "bar.txt"), - hasChunkEntries("foo/bar.txt", 1), - hasEntryOwner("bar/", sampleOwner), - hasEntryOwner("foo/", sampleOwner), - hasEntryOwner("foo/bar.txt", sampleOwner), - ), - }, - { - name: "3dir", - in: tarOf( - dir("bar/"), - dir("foo/"), - dir("foo/bar/"), - ), - wantNumGz: 3, // 3 dirs, TOC, footer - want: checks( - hasDirLinkCount("bar/", 2), - hasDirLinkCount("foo/", 3), - hasDirLinkCount("foo/bar/", 2), - ), - }, - { - name: "symlink", - in: tarOf( - dir("foo/"), - symlink("foo/bar", "../../x"), - ), - wantNumGz: 3, // metas + TOC + footer - want: checks( - numTOCEntries(2), - hasSymlink("foo/bar", "../../x"), - entryHasChildren("", "foo"), - entryHasChildren("foo", "bar"), - ), - }, - { - name: "chunked_file", - chunkSize: 4, - in: tarOf( - dir("foo/"), - file("foo/big.txt", "This "+"is s"+"uch "+"a bi"+"g fi"+"le"), - ), - wantNumGz: 9, // dir + big.txt(6 chunks) + TOC + footer - want: checks( - numTOCEntries(7), // 1 for foo dir, 6 for the foo/big.txt file - hasDir("foo/"), - hasFileLen("foo/big.txt", len("This is such a big file")), - hasFileDigest("foo/big.txt", digestFor("This is such a big file")), - hasFileContentsRange("foo/big.txt", 0, "This is such a big file"), - hasFileContentsRange("foo/big.txt", 1, "his is such a big file"), - hasFileContentsRange("foo/big.txt", 2, "is is such a big file"), - hasFileContentsRange("foo/big.txt", 3, "s is such a big file"), - hasFileContentsRange("foo/big.txt", 4, " is such a big file"), - hasFileContentsRange("foo/big.txt", 5, "is such a big file"), - hasFileContentsRange("foo/big.txt", 6, "s such a big file"), - hasFileContentsRange("foo/big.txt", 7, " such a big file"), - hasFileContentsRange("foo/big.txt", 8, "such a big file"), - hasFileContentsRange("foo/big.txt", 9, "uch a big file"), - hasFileContentsRange("foo/big.txt", 10, "ch a big file"), - hasFileContentsRange("foo/big.txt", 11, "h a big file"), - hasFileContentsRange("foo/big.txt", 12, " a big file"), - hasFileContentsRange("foo/big.txt", len("This is such a big file")-1, ""), - hasChunkEntries("foo/big.txt", 6), - ), - }, - { - name: "recursive", - in: tarOf( - dir("/", sampleOwner), - dir("bar/", sampleOwner), - dir("foo/", sampleOwner), - file("foo/bar.txt", content, sampleOwner), - ), - wantNumGz: 4, // dirs, bar.txt alone, TOC, footer - want: checks( - maxDepth(2), // 0: root directory, 1: "foo/", 2: "bar.txt" - ), - }, - { - name: "block_char_fifo", - in: tarOf( - tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Name: prefix + "b", - Typeflag: tar.TypeBlock, - Devmajor: 123, - Devminor: 456, - Format: format, - }) - }), - tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Name: prefix + "c", - Typeflag: tar.TypeChar, - Devmajor: 111, - Devminor: 222, - Format: format, - }) - }), - tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Name: prefix + "f", - Typeflag: tar.TypeFifo, - Format: format, - }) - }), - ), - wantNumGz: 3, - want: checks( - lookupMatch("b", &TOCEntry{Name: "b", Type: "block", DevMajor: 123, DevMinor: 456, NumLink: 1}), - lookupMatch("c", &TOCEntry{Name: "c", Type: "char", DevMajor: 111, DevMinor: 222, NumLink: 1}), - lookupMatch("f", &TOCEntry{Name: "f", Type: "fifo", NumLink: 1}), - ), - }, - { - name: "modes", - in: tarOf( - dir("foo1/", 0755|os.ModeDir|os.ModeSetgid), - file("foo1/bar1", content, 0700|os.ModeSetuid), - file("foo1/bar2", content, 0755|os.ModeSetgid), - dir("foo2/", 0755|os.ModeDir|os.ModeSticky), - file("foo2/bar3", content, 0755|os.ModeSticky), - dir("foo3/", 0755|os.ModeDir), - file("foo3/bar4", content, os.FileMode(0700)), - file("foo3/bar5", content, os.FileMode(0755)), - ), - wantNumGz: 8, // dir, bar1 alone, bar2 alone + dir, bar3 alone + dir, bar4 alone, bar5 alone, TOC, footer - want: checks( - hasMode("foo1/", 0755|os.ModeDir|os.ModeSetgid), - hasMode("foo1/bar1", 0700|os.ModeSetuid), - hasMode("foo1/bar2", 0755|os.ModeSetgid), - hasMode("foo2/", 0755|os.ModeDir|os.ModeSticky), - hasMode("foo2/bar3", 0755|os.ModeSticky), - hasMode("foo3/", 0755|os.ModeDir), - hasMode("foo3/bar4", os.FileMode(0700)), - hasMode("foo3/bar5", os.FileMode(0755)), - ), - }, - { - name: "lossy", - in: tarOf( - dir("bar/", sampleOwner), - dir("foo/", sampleOwner), - file("foo/bar.txt", content, sampleOwner), - file(TOCTarName, "dummy"), // ignored by the writer. (lossless write returns error) - ), - wantNumGz: 4, // both dirs, foo.txt alone, TOC, footer - want: checks( - numTOCEntries(3), - hasDir("bar/"), - hasDir("foo/"), - hasFileLen("foo/bar.txt", len(content)), - entryHasChildren("", "bar", "foo"), - entryHasChildren("foo", "bar.txt"), - hasChunkEntries("foo/bar.txt", 1), - hasEntryOwner("bar/", sampleOwner), - hasEntryOwner("foo/", sampleOwner), - hasEntryOwner("foo/bar.txt", sampleOwner), - ), - wantFailOnLossLess: true, - }, - { - name: "hardlink should be replaced to the destination entry", - in: tarOf( - dir("foo/"), - file("foo/foo1", "test"), - link("foolink", "foo/foo1"), - ), - wantNumGz: 4, // dir, foo1 + link, TOC, footer - want: checks( - mustSameEntry("foo/foo1", "foolink"), - ), - }, - { - name: "several_files_in_chunk", - minChunkSize: 8000, - in: tarOf( - dir("foo/"), - file("foo/foo1", data64KB), - file("foo2", "bb"), - file("foo22", "ccc"), - dir("bar/"), - file("bar/bar.txt", "aaa"), - file("foo3", data64KB), - ), - // NOTE: we assume that the compressed "data64KB" is still larger than 8KB - wantNumGz: 4, // dir+foo1, foo2+foo22+dir+bar.txt+foo3, TOC, footer - want: checks( - numTOCEntries(7), // dir, foo1, foo2, foo22, dir, bar.txt, foo3 - hasDir("foo/"), - hasDir("bar/"), - hasFileLen("foo/foo1", len(data64KB)), - hasFileLen("foo2", len("bb")), - hasFileLen("foo22", len("ccc")), - hasFileLen("bar/bar.txt", len("aaa")), - hasFileLen("foo3", len(data64KB)), - hasFileDigest("foo/foo1", digestFor(data64KB)), - hasFileDigest("foo2", digestFor("bb")), - hasFileDigest("foo22", digestFor("ccc")), - hasFileDigest("bar/bar.txt", digestFor("aaa")), - hasFileDigest("foo3", digestFor(data64KB)), - hasFileContentsWithPreRead("foo22", 0, "ccc", chunkInfo{"foo2", "bb"}, chunkInfo{"bar/bar.txt", "aaa"}, chunkInfo{"foo3", data64KB}), - hasFileContentsRange("foo/foo1", 0, data64KB), - hasFileContentsRange("foo2", 0, "bb"), - hasFileContentsRange("foo2", 1, "b"), - hasFileContentsRange("foo22", 0, "ccc"), - hasFileContentsRange("foo22", 1, "cc"), - hasFileContentsRange("foo22", 2, "c"), - hasFileContentsRange("bar/bar.txt", 0, "aaa"), - hasFileContentsRange("bar/bar.txt", 1, "aa"), - hasFileContentsRange("bar/bar.txt", 2, "a"), - hasFileContentsRange("foo3", 0, data64KB), - hasFileContentsRange("foo3", 1, data64KB[1:]), - hasFileContentsRange("foo3", 2, data64KB[2:]), - hasFileContentsRange("foo3", len(data64KB)/2, data64KB[len(data64KB)/2:]), - hasFileContentsRange("foo3", len(data64KB)-1, data64KB[len(data64KB)-1:]), - ), - }, - { - name: "several_files_in_chunk_chunked", - minChunkSize: 8000, - chunkSize: 32000, - in: tarOf( - dir("foo/"), - file("foo/foo1", data64KB), - file("foo2", "bb"), - dir("bar/"), - file("foo3", data64KB), - ), - // NOTE: we assume that the compressed chunk of "data64KB" is still larger than 8KB - wantNumGz: 6, // dir+foo1(1), foo1(2), foo2+dir+foo3(1), foo3(2), TOC, footer - want: checks( - numTOCEntries(7), // dir, foo1(2 chunks), foo2, dir, foo3(2 chunks) - hasDir("foo/"), - hasDir("bar/"), - hasFileLen("foo/foo1", len(data64KB)), - hasFileLen("foo2", len("bb")), - hasFileLen("foo3", len(data64KB)), - hasFileDigest("foo/foo1", digestFor(data64KB)), - hasFileDigest("foo2", digestFor("bb")), - hasFileDigest("foo3", digestFor(data64KB)), - hasFileContentsWithPreRead("foo2", 0, "bb", chunkInfo{"foo3", data64KB[:32000]}), - hasFileContentsRange("foo/foo1", 0, data64KB), - hasFileContentsRange("foo/foo1", 1, data64KB[1:]), - hasFileContentsRange("foo/foo1", 2, data64KB[2:]), - hasFileContentsRange("foo/foo1", len(data64KB)/2, data64KB[len(data64KB)/2:]), - hasFileContentsRange("foo/foo1", len(data64KB)-1, data64KB[len(data64KB)-1:]), - hasFileContentsRange("foo2", 0, "bb"), - hasFileContentsRange("foo2", 1, "b"), - hasFileContentsRange("foo3", 0, data64KB), - hasFileContentsRange("foo3", 1, data64KB[1:]), - hasFileContentsRange("foo3", 2, data64KB[2:]), - hasFileContentsRange("foo3", len(data64KB)/2, data64KB[len(data64KB)/2:]), - hasFileContentsRange("foo3", len(data64KB)-1, data64KB[len(data64KB)-1:]), - ), - }, - } - - for _, tt := range tests { - for _, newCL := range controllers { - newCL := newCL - for _, prefix := range allowedPrefix { - prefix := prefix - for _, srcTarFormat := range []tar.Format{tar.FormatUSTAR, tar.FormatPAX, tar.FormatGNU} { - srcTarFormat := srcTarFormat - for _, lossless := range []bool{true, false} { - t.Run(tt.name+"-"+fmt.Sprintf("compression=%v,prefix=%q,lossless=%v,format=%s", newCL(), prefix, lossless, srcTarFormat), func(t *testing.T) { - var tr io.Reader = buildTar(t, tt.in, prefix, srcTarFormat) - origTarDgstr := digest.Canonical.Digester() - tr = io.TeeReader(tr, origTarDgstr.Hash()) - var stargzBuf bytes.Buffer - cl1 := newCL() - w := NewWriterWithCompressor(&stargzBuf, cl1) - w.ChunkSize = tt.chunkSize - w.MinChunkSize = tt.minChunkSize - if lossless { - err := w.AppendTarLossLess(tr) - if tt.wantFailOnLossLess { - if err != nil { - return // expected to fail - } - t.Fatalf("Append wanted to fail on lossless") - } - if err != nil { - t.Fatalf("Append(lossless): %v", err) - } - } else { - if err := w.AppendTar(tr); err != nil { - t.Fatalf("Append: %v", err) - } - } - if _, err := w.Close(); err != nil { - t.Fatalf("Writer.Close: %v", err) - } - b := stargzBuf.Bytes() - - if lossless { - // Check if the result blob reserves original tar metadata - rc, err := Unpack(io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))), cl1) - if err != nil { - t.Errorf("failed to decompress blob: %v", err) - return - } - defer rc.Close() - resultDgstr := digest.Canonical.Digester() - if _, err := io.Copy(resultDgstr.Hash(), rc); err != nil { - t.Errorf("failed to read result decompressed blob: %v", err) - return - } - if resultDgstr.Digest() != origTarDgstr.Digest() { - t.Errorf("lossy compression occurred: digest=%v; want %v", - resultDgstr.Digest(), origTarDgstr.Digest()) - return - } - } - - diffID := w.DiffID() - wantDiffID := cl1.DiffIDOf(t, b) - if diffID != wantDiffID { - t.Errorf("DiffID = %q; want %q", diffID, wantDiffID) - } - - telemetry, checkCalled := newCalledTelemetry() - sr := io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b))) - r, err := Open( - sr, - WithDecompressors(cl1), - WithTelemetry(telemetry), - ) - if err != nil { - t.Fatalf("stargz.Open: %v", err) - } - wantTOCVersion := 1 - if tt.wantTOCVersion > 0 { - wantTOCVersion = tt.wantTOCVersion - } - if r.toc.Version != wantTOCVersion { - t.Fatalf("invalid TOC Version %d; wanted %d", r.toc.Version, wantTOCVersion) - } - - footerSize := cl1.FooterSize() - footerOffset := sr.Size() - footerSize - footer := make([]byte, footerSize) - if _, err := sr.ReadAt(footer, footerOffset); err != nil { - t.Errorf("failed to read footer: %v", err) - } - _, tocOffset, _, err := cl1.ParseFooter(footer) - if err != nil { - t.Errorf("failed to parse footer: %v", err) - } - if err := checkCalled(tocOffset >= 0); err != nil { - t.Errorf("telemetry failure: %v", err) - } - - wantNumGz := tt.wantNumGz - if lossless && tt.wantNumGzLossLess > 0 { - wantNumGz = tt.wantNumGzLossLess - } - streamOffsets := []int64{0} - prevOffset := int64(-1) - streams := 0 - for _, e := range r.toc.Entries { - if e.Offset > prevOffset { - streamOffsets = append(streamOffsets, e.Offset) - prevOffset = e.Offset - streams++ - } - } - streams++ // TOC - if tocOffset >= 0 { - // toc is in the blob - streamOffsets = append(streamOffsets, tocOffset) - } - streams++ // footer - streamOffsets = append(streamOffsets, footerOffset) - if streams != wantNumGz { - t.Errorf("number of streams in TOC = %d; want %d", streams, wantNumGz) - } - - t.Logf("testing streams: %+v", streamOffsets) - cl1.TestStreams(t, b, streamOffsets) - - for _, want := range tt.want { - want.check(t, r) - } - }) - } - } - } - } - } -} - -type chunkInfo struct { - name string - data string -} - -func newCalledTelemetry() (telemetry *Telemetry, check func(needsGetTOC bool) error) { - var getFooterLatencyCalled bool - var getTocLatencyCalled bool - var deserializeTocLatencyCalled bool - return &Telemetry{ - func(time.Time) { getFooterLatencyCalled = true }, - func(time.Time) { getTocLatencyCalled = true }, - func(time.Time) { deserializeTocLatencyCalled = true }, - }, func(needsGetTOC bool) error { - var allErr []error - if !getFooterLatencyCalled { - allErr = append(allErr, fmt.Errorf("metrics GetFooterLatency isn't called")) - } - if needsGetTOC { - if !getTocLatencyCalled { - allErr = append(allErr, fmt.Errorf("metrics GetTocLatency isn't called")) - } - } - if !deserializeTocLatencyCalled { - allErr = append(allErr, fmt.Errorf("metrics DeserializeTocLatency isn't called")) - } - return errorutil.Aggregate(allErr) - } -} - -func digestFor(content string) string { - sum := sha256.Sum256([]byte(content)) - return fmt.Sprintf("sha256:%x", sum) -} - -type numTOCEntries int - -func (n numTOCEntries) check(t *testing.T, r *Reader) { - if r.toc == nil { - t.Fatal("nil TOC") - } - if got, want := len(r.toc.Entries), int(n); got != want { - t.Errorf("got %d TOC entries; want %d", got, want) - } - t.Logf("got TOC entries:") - for i, ent := range r.toc.Entries { - entj, _ := json.Marshal(ent) - t.Logf(" [%d]: %s\n", i, entj) - } - if t.Failed() { - t.FailNow() - } -} - -func checks(s ...stargzCheck) []stargzCheck { return s } - -type stargzCheck interface { - check(t *testing.T, r *Reader) -} - -type stargzCheckFn func(*testing.T, *Reader) - -func (f stargzCheckFn) check(t *testing.T, r *Reader) { f(t, r) } - -func maxDepth(max int) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - e, ok := r.Lookup("") - if !ok { - t.Fatal("root directory not found") - } - d, err := getMaxDepth(t, e, 0, 10*max) - if err != nil { - t.Errorf("failed to get max depth (wanted %d): %v", max, err) - return - } - if d != max { - t.Errorf("invalid depth %d; want %d", d, max) - return - } - }) -} - -func getMaxDepth(t *testing.T, e *TOCEntry, current, limit int) (max int, rErr error) { - if current > limit { - return -1, fmt.Errorf("walkMaxDepth: exceeds limit: current:%d > limit:%d", - current, limit) - } - max = current - e.ForeachChild(func(baseName string, ent *TOCEntry) bool { - t.Logf("%q(basename:%q) is child of %q\n", ent.Name, baseName, e.Name) - d, err := getMaxDepth(t, ent, current+1, limit) - if err != nil { - rErr = err - return false - } - if d > max { - max = d - } - return true - }) - return -} - -func hasFileLen(file string, wantLen int) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == file { - if ent.Type != "reg" { - t.Errorf("file type of %q is %q; want \"reg\"", file, ent.Type) - } else if ent.Size != int64(wantLen) { - t.Errorf("file size of %q = %d; want %d", file, ent.Size, wantLen) - } - return - } - } - t.Errorf("file %q not found", file) - }) -} - -func hasFileXattrs(file, name, value string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == file { - if ent.Type != "reg" { - t.Errorf("file type of %q is %q; want \"reg\"", file, ent.Type) - } - if ent.Xattrs == nil { - t.Errorf("file %q has no xattrs", file) - return - } - valueFound, found := ent.Xattrs[name] - if !found { - t.Errorf("file %q has no xattr %q", file, name) - return - } - if string(valueFound) != value { - t.Errorf("file %q has xattr %q with value %q instead of %q", file, name, valueFound, value) - } - - return - } - } - t.Errorf("file %q not found", file) - }) -} - -func hasFileDigest(file string, digest string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - ent, ok := r.Lookup(file) - if !ok { - t.Fatalf("didn't find TOCEntry for file %q", file) - } - if ent.Digest != digest { - t.Fatalf("Digest(%q) = %q, want %q", file, ent.Digest, digest) - } - }) -} - -func hasFileContentsWithPreRead(file string, offset int, want string, extra ...chunkInfo) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - extraMap := make(map[string]chunkInfo) - for _, e := range extra { - extraMap[e.name] = e - } - var extraNames []string - for n := range extraMap { - extraNames = append(extraNames, n) - } - f, err := r.OpenFileWithPreReader(file, func(e *TOCEntry, cr io.Reader) error { - t.Logf("On %q: got preread of %q", file, e.Name) - ex, ok := extraMap[e.Name] - if !ok { - t.Fatalf("fail on %q: unexpected entry %q: %+v, %+v", file, e.Name, e, extraNames) - } - got, err := io.ReadAll(cr) - if err != nil { - t.Fatalf("fail on %q: failed to read %q: %v", file, e.Name, err) - } - if ex.data != string(got) { - t.Fatalf("fail on %q: unexpected contents of %q: len=%d; want=%d", file, e.Name, len(got), len(ex.data)) - } - delete(extraMap, e.Name) - return nil - }) - if err != nil { - t.Fatal(err) - } - got := make([]byte, len(want)) - n, err := f.ReadAt(got, int64(offset)) - if err != nil { - t.Fatalf("ReadAt(len %d, offset %d, size %d) = %v, %v", len(got), offset, f.Size(), n, err) - } - if string(got) != want { - t.Fatalf("ReadAt(len %d, offset %d) = %q, want %q", len(got), offset, viewContent(got), viewContent([]byte(want))) - } - if len(extraMap) != 0 { - var exNames []string - for _, ex := range extraMap { - exNames = append(exNames, ex.name) - } - t.Fatalf("fail on %q: some entries aren't read: %+v", file, exNames) - } - }) -} - -func hasFileContentsRange(file string, offset int, want string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - f, err := r.OpenFile(file) - if err != nil { - t.Fatal(err) - } - got := make([]byte, len(want)) - n, err := f.ReadAt(got, int64(offset)) - if err != nil { - t.Fatalf("ReadAt(len %d, offset %d) = %v, %v", len(got), offset, n, err) - } - if string(got) != want { - t.Fatalf("ReadAt(len %d, offset %d) = %q, want %q", len(got), offset, viewContent(got), viewContent([]byte(want))) - } - }) -} - -func hasChunkEntries(file string, wantChunks int) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - ent, ok := r.Lookup(file) - if !ok { - t.Fatalf("no file for %q", file) - } - if ent.Type != "reg" { - t.Fatalf("file %q has unexpected type %q; want reg", file, ent.Type) - } - chunks := r.getChunks(ent) - if len(chunks) != wantChunks { - t.Errorf("len(r.getChunks(%q)) = %d; want %d", file, len(chunks), wantChunks) - return - } - f := chunks[0] - - var gotChunks []*TOCEntry - var last *TOCEntry - for off := int64(0); off < f.Size; off++ { - e, ok := r.ChunkEntryForOffset(file, off) - if !ok { - t.Errorf("no ChunkEntryForOffset at %d", off) - return - } - if last != e { - gotChunks = append(gotChunks, e) - last = e - } - } - if !reflect.DeepEqual(chunks, gotChunks) { - t.Errorf("gotChunks=%d, want=%d; contents mismatch", len(gotChunks), wantChunks) - } - - // And verify the NextOffset - for i := 0; i < len(gotChunks)-1; i++ { - ci := gotChunks[i] - cnext := gotChunks[i+1] - if ci.NextOffset() != cnext.Offset { - t.Errorf("chunk %d NextOffset %d != next chunk's Offset of %d", i, ci.NextOffset(), cnext.Offset) - } - } - }) -} - -func entryHasChildren(dir string, want ...string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - want := append([]string(nil), want...) - var got []string - ent, ok := r.Lookup(dir) - if !ok { - t.Fatalf("didn't find TOCEntry for dir node %q", dir) - } - for baseName := range ent.children { - got = append(got, baseName) - } - sort.Strings(got) - sort.Strings(want) - if !reflect.DeepEqual(got, want) { - t.Errorf("children of %q = %q; want %q", dir, got, want) - } - }) -} - -func hasDir(file string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == cleanEntryName(file) { - if ent.Type != "dir" { - t.Errorf("file type of %q is %q; want \"dir\"", file, ent.Type) - } - return - } - } - t.Errorf("directory %q not found", file) - }) -} - -func hasDirLinkCount(file string, count int) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == cleanEntryName(file) { - if ent.Type != "dir" { - t.Errorf("file type of %q is %q; want \"dir\"", file, ent.Type) - return - } - if ent.NumLink != count { - t.Errorf("link count of %q = %d; want %d", file, ent.NumLink, count) - } - return - } - } - t.Errorf("directory %q not found", file) - }) -} - -func hasMode(file string, mode os.FileMode) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == cleanEntryName(file) { - if ent.Stat().Mode() != mode { - t.Errorf("invalid mode: got %v; want %v", ent.Stat().Mode(), mode) - return - } - return - } - } - t.Errorf("file %q not found", file) - }) -} - -func hasSymlink(file, target string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - for _, ent := range r.toc.Entries { - if ent.Name == file { - if ent.Type != "symlink" { - t.Errorf("file type of %q is %q; want \"symlink\"", file, ent.Type) - } else if ent.LinkName != target { - t.Errorf("link target of symlink %q is %q; want %q", file, ent.LinkName, target) - } - return - } - } - t.Errorf("symlink %q not found", file) - }) -} - -func lookupMatch(name string, want *TOCEntry) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - e, ok := r.Lookup(name) - if !ok { - t.Fatalf("failed to Lookup entry %q", name) - } - if !reflect.DeepEqual(e, want) { - t.Errorf("entry %q mismatch.\n got: %+v\nwant: %+v\n", name, e, want) - } - - }) -} - -func hasEntryOwner(entry string, owner owner) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - ent, ok := r.Lookup(strings.TrimSuffix(entry, "/")) - if !ok { - t.Errorf("entry %q not found", entry) - return - } - if ent.UID != owner.uid || ent.GID != owner.gid { - t.Errorf("entry %q has invalid owner (uid:%d, gid:%d) instead of (uid:%d, gid:%d)", entry, ent.UID, ent.GID, owner.uid, owner.gid) - return - } - }) -} - -func mustSameEntry(files ...string) stargzCheck { - return stargzCheckFn(func(t *testing.T, r *Reader) { - var first *TOCEntry - for _, f := range files { - if first == nil { - var ok bool - first, ok = r.Lookup(f) - if !ok { - t.Errorf("unknown first file on Lookup: %q", f) - return - } - } - - // Test Lookup - e, ok := r.Lookup(f) - if !ok { - t.Errorf("unknown file on Lookup: %q", f) - return - } - if e != first { - t.Errorf("Lookup: %+v(%p) != %+v(%p)", e, e, first, first) - return - } - - // Test LookupChild - pe, ok := r.Lookup(filepath.Dir(filepath.Clean(f))) - if !ok { - t.Errorf("failed to get parent of %q", f) - return - } - e, ok = pe.LookupChild(filepath.Base(filepath.Clean(f))) - if !ok { - t.Errorf("failed to get %q as the child of %+v", f, pe) - return - } - if e != first { - t.Errorf("LookupChild: %+v(%p) != %+v(%p)", e, e, first, first) - return - } - - // Test ForeachChild - pe.ForeachChild(func(baseName string, e *TOCEntry) bool { - if baseName == filepath.Base(filepath.Clean(f)) { - if e != first { - t.Errorf("ForeachChild: %+v(%p) != %+v(%p)", e, e, first, first) - return false - } - } - return true - }) - } - }) -} - -func viewContent(c []byte) string { - if len(c) < 100 { - return string(c) - } - return string(c[:50]) + "...(omit)..." + string(c[50:100]) -} - -func tarOf(s ...tarEntry) []tarEntry { return s } - -type tarEntry interface { - appendTar(tw *tar.Writer, prefix string, format tar.Format) error -} - -type tarEntryFunc func(*tar.Writer, string, tar.Format) error - -func (f tarEntryFunc) appendTar(tw *tar.Writer, prefix string, format tar.Format) error { - return f(tw, prefix, format) -} - -func buildTar(t *testing.T, ents []tarEntry, prefix string, opts ...interface{}) *io.SectionReader { - format := tar.FormatUnknown - for _, opt := range opts { - switch v := opt.(type) { - case tar.Format: - format = v - default: - panic(fmt.Errorf("unsupported opt for buildTar: %v", opt)) - } - } - buf := new(bytes.Buffer) - tw := tar.NewWriter(buf) - for _, ent := range ents { - if err := ent.appendTar(tw, prefix, format); err != nil { - t.Fatalf("building input tar: %v", err) - } - } - if err := tw.Close(); err != nil { - t.Errorf("closing write of input tar: %v", err) - } - data := append(buf.Bytes(), make([]byte, 100)...) // append empty bytes at the tail to see lossless works - return io.NewSectionReader(bytes.NewReader(data), 0, int64(len(data))) -} - -func dir(name string, opts ...interface{}) tarEntry { - return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { - var o owner - mode := os.FileMode(0755) - for _, opt := range opts { - switch v := opt.(type) { - case owner: - o = v - case os.FileMode: - mode = v - default: - return errors.New("unsupported opt") - } - } - if !strings.HasSuffix(name, "/") { - panic(fmt.Sprintf("missing trailing slash in dir %q ", name)) - } - tm, err := fileModeToTarMode(mode) - if err != nil { - return err - } - return tw.WriteHeader(&tar.Header{ - Typeflag: tar.TypeDir, - Name: prefix + name, - Mode: tm, - Uid: o.uid, - Gid: o.gid, - Format: format, - }) - }) -} - -// xAttr are extended attributes to set on test files created with the file func. -type xAttr map[string]string - -// owner is owner ot set on test files and directories with the file and dir functions. -type owner struct { - uid int - gid int -} - -func file(name, contents string, opts ...interface{}) tarEntry { - return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { - var xattrs xAttr - var o owner - mode := os.FileMode(0644) - for _, opt := range opts { - switch v := opt.(type) { - case xAttr: - xattrs = v - case owner: - o = v - case os.FileMode: - mode = v - default: - return errors.New("unsupported opt") - } - } - if strings.HasSuffix(name, "/") { - return fmt.Errorf("bogus trailing slash in file %q", name) - } - tm, err := fileModeToTarMode(mode) - if err != nil { - return err - } - if len(xattrs) > 0 { - format = tar.FormatPAX // only PAX supports xattrs - } - if err := tw.WriteHeader(&tar.Header{ - Typeflag: tar.TypeReg, - Name: prefix + name, - Mode: tm, - Xattrs: xattrs, - Size: int64(len(contents)), - Uid: o.uid, - Gid: o.gid, - Format: format, - }); err != nil { - return err - } - _, err = io.WriteString(tw, contents) - return err - }) -} - -func symlink(name, target string) tarEntry { - return tarEntryFunc(func(tw *tar.Writer, prefix string, format tar.Format) error { - return tw.WriteHeader(&tar.Header{ - Typeflag: tar.TypeSymlink, - Name: prefix + name, - Linkname: target, - Mode: 0644, - Format: format, - }) - }) -} - -func link(name string, linkname string) tarEntry { - now := time.Now() - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Typeflag: tar.TypeLink, - Name: prefix + name, - Linkname: linkname, - ModTime: now, - Format: format, - }) - }) -} - -func chardev(name string, major, minor int64) tarEntry { - now := time.Now() - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Typeflag: tar.TypeChar, - Name: prefix + name, - Devmajor: major, - Devminor: minor, - ModTime: now, - Format: format, - }) - }) -} - -func blockdev(name string, major, minor int64) tarEntry { - now := time.Now() - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Typeflag: tar.TypeBlock, - Name: prefix + name, - Devmajor: major, - Devminor: minor, - ModTime: now, - Format: format, - }) - }) -} -func fifo(name string) tarEntry { - now := time.Now() - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - return w.WriteHeader(&tar.Header{ - Typeflag: tar.TypeFifo, - Name: prefix + name, - ModTime: now, - Format: format, - }) - }) -} - -func prefetchLandmark() tarEntry { - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - if err := w.WriteHeader(&tar.Header{ - Name: PrefetchLandmark, - Typeflag: tar.TypeReg, - Size: int64(len([]byte{landmarkContents})), - Format: format, - }); err != nil { - return err - } - contents := []byte{landmarkContents} - if _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil { - return err - } - return nil - }) -} - -func noPrefetchLandmark() tarEntry { - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - if err := w.WriteHeader(&tar.Header{ - Name: NoPrefetchLandmark, - Typeflag: tar.TypeReg, - Size: int64(len([]byte{landmarkContents})), - Format: format, - }); err != nil { - return err - } - contents := []byte{landmarkContents} - if _, err := io.CopyN(w, bytes.NewReader(contents), int64(len(contents))); err != nil { - return err - } - return nil - }) -} - -func regDigest(t *testing.T, name string, contentStr string, digestMap map[string]digest.Digest) tarEntry { - if digestMap == nil { - t.Fatalf("digest map mustn't be nil") - } - content := []byte(contentStr) - - var n int64 - for n < int64(len(content)) { - size := int64(chunkSize) - remain := int64(len(content)) - n - if remain < size { - size = remain - } - dgstr := digest.Canonical.Digester() - if _, err := io.CopyN(dgstr.Hash(), bytes.NewReader(content[n:n+size]), size); err != nil { - t.Fatalf("failed to calculate digest of %q (name=%q,offset=%d,size=%d)", - string(content[n:n+size]), name, n, size) - } - digestMap[chunkID(name, n, size)] = dgstr.Digest() - n += size - } - - return tarEntryFunc(func(w *tar.Writer, prefix string, format tar.Format) error { - if err := w.WriteHeader(&tar.Header{ - Typeflag: tar.TypeReg, - Name: prefix + name, - Size: int64(len(content)), - Format: format, - }); err != nil { - return err - } - if _, err := io.CopyN(w, bytes.NewReader(content), int64(len(content))); err != nil { - return err - } - return nil - }) -} - -var runes = []rune("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") - -func randomContents(n int) string { - b := make([]rune, n) - for i := range b { - b[i] = runes[rand.Intn(len(runes))] - } - return string(b) -} - -func fileModeToTarMode(mode os.FileMode) (int64, error) { - h, err := tar.FileInfoHeader(fileInfoOnlyMode(mode), "") - if err != nil { - return 0, err - } - return h.Mode, nil -} - -// fileInfoOnlyMode is os.FileMode that populates only file mode. -type fileInfoOnlyMode os.FileMode - -func (f fileInfoOnlyMode) Name() string { return "" } -func (f fileInfoOnlyMode) Size() int64 { return 0 } -func (f fileInfoOnlyMode) Mode() os.FileMode { return os.FileMode(f) } -func (f fileInfoOnlyMode) ModTime() time.Time { return time.Now() } -func (f fileInfoOnlyMode) IsDir() bool { return os.FileMode(f).IsDir() } -func (f fileInfoOnlyMode) Sys() interface{} { return nil } - -func CheckGzipHasStreams(t *testing.T, b []byte, streams []int64) { - if len(streams) == 0 { - return // nop - } - - wants := map[int64]struct{}{} - for _, s := range streams { - wants[s] = struct{}{} - } - - len0 := len(b) - br := bytes.NewReader(b) - zr := new(gzip.Reader) - t.Logf("got gzip streams:") - numStreams := 0 - for { - zoff := len0 - br.Len() - if err := zr.Reset(br); err != nil { - if err == io.EOF { - return - } - t.Fatalf("countStreams(gzip), Reset: %v", err) - } - zr.Multistream(false) - n, err := io.Copy(io.Discard, zr) - if err != nil { - t.Fatalf("countStreams(gzip), Copy: %v", err) - } - var extra string - if len(zr.Header.Extra) > 0 { - extra = fmt.Sprintf("; extra=%q", zr.Header.Extra) - } - t.Logf(" [%d] at %d in stargz, uncompressed length %d%s", numStreams, zoff, n, extra) - delete(wants, int64(zoff)) - numStreams++ - } -} - -func GzipDiffIDOf(t *testing.T, b []byte) string { - h := sha256.New() - zr, err := gzip.NewReader(bytes.NewReader(b)) - if err != nil { - t.Fatalf("diffIDOf(gzip): %v", err) - } - defer zr.Close() - if _, err := io.Copy(h, zr); err != nil { - t.Fatalf("diffIDOf(gzip).Copy: %v", err) - } - return fmt.Sprintf("sha256:%x", h.Sum(nil)) -} diff --git a/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go b/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go deleted file mode 100644 index 57e0aa614e..0000000000 --- a/vendor/github.com/containerd/stargz-snapshotter/estargz/types.go +++ /dev/null @@ -1,342 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* - Copyright 2019 The Go Authors. All rights reserved. - Use of this source code is governed by a BSD-style - license that can be found in the LICENSE file. -*/ - -package estargz - -import ( - "archive/tar" - "hash" - "io" - "os" - "path" - "time" - - digest "github.com/opencontainers/go-digest" -) - -const ( - // TOCTarName is the name of the JSON file in the tar archive in the - // table of contents gzip stream. - TOCTarName = "stargz.index.json" - - // FooterSize is the number of bytes in the footer - // - // The footer is an empty gzip stream with no compression and an Extra - // header of the form "%016xSTARGZ", where the 64 bit hex-encoded - // number is the offset to the gzip stream of JSON TOC. - // - // 51 comes from: - // - // 10 bytes gzip header - // 2 bytes XLEN (length of Extra field) = 26 (4 bytes header + 16 hex digits + len("STARGZ")) - // 2 bytes Extra: SI1 = 'S', SI2 = 'G' - // 2 bytes Extra: LEN = 22 (16 hex digits + len("STARGZ")) - // 22 bytes Extra: subfield = fmt.Sprintf("%016xSTARGZ", offsetOfTOC) - // 5 bytes flate header - // 8 bytes gzip footer - // (End of the eStargz blob) - // - // NOTE: For Extra fields, subfield IDs SI1='S' SI2='G' is used for eStargz. - FooterSize = 51 - - // legacyFooterSize is the number of bytes in the legacy stargz footer. - // - // 47 comes from: - // - // 10 byte gzip header + - // 2 byte (LE16) length of extra, encoding 22 (16 hex digits + len("STARGZ")) == "\x16\x00" + - // 22 bytes of extra (fmt.Sprintf("%016xSTARGZ", tocGzipOffset)) - // 5 byte flate header - // 8 byte gzip footer (two little endian uint32s: digest, size) - legacyFooterSize = 47 - - // TOCJSONDigestAnnotation is an annotation for an image layer. This stores the - // digest of the TOC JSON. - // This annotation is valid only when it is specified in `.[]layers.annotations` - // of an image manifest. - TOCJSONDigestAnnotation = "containerd.io/snapshot/stargz/toc.digest" - - // StoreUncompressedSizeAnnotation is an additional annotation key for eStargz to enable lazy - // pulling on containers/storage. Stargz Store is required to expose the layer's uncompressed size - // to the runtime but current OCI image doesn't ship this information by default. So we store this - // to the special annotation. - StoreUncompressedSizeAnnotation = "io.containers.estargz.uncompressed-size" - - // PrefetchLandmark is a file entry which indicates the end position of - // prefetch in the stargz file. - PrefetchLandmark = ".prefetch.landmark" - - // NoPrefetchLandmark is a file entry which indicates that no prefetch should - // occur in the stargz file. - NoPrefetchLandmark = ".no.prefetch.landmark" - - landmarkContents = 0xf -) - -// JTOC is the JSON-serialized table of contents index of the files in the stargz file. -type JTOC struct { - Version int `json:"version"` - Entries []*TOCEntry `json:"entries"` -} - -// TOCEntry is an entry in the stargz file's TOC (Table of Contents). -type TOCEntry struct { - // Name is the tar entry's name. It is the complete path - // stored in the tar file, not just the base name. - Name string `json:"name"` - - // Type is one of "dir", "reg", "symlink", "hardlink", "char", - // "block", "fifo", or "chunk". - // The "chunk" type is used for regular file data chunks past the first - // TOCEntry; the 2nd chunk and on have only Type ("chunk"), Offset, - // ChunkOffset, and ChunkSize populated. - Type string `json:"type"` - - // Size, for regular files, is the logical size of the file. - Size int64 `json:"size,omitempty"` - - // ModTime3339 is the modification time of the tar entry. Empty - // means zero or unknown. Otherwise it's in UTC RFC3339 - // format. Use the ModTime method to access the time.Time value. - ModTime3339 string `json:"modtime,omitempty"` - modTime time.Time - - // LinkName, for symlinks and hardlinks, is the link target. - LinkName string `json:"linkName,omitempty"` - - // Mode is the permission and mode bits. - Mode int64 `json:"mode,omitempty"` - - // UID is the user ID of the owner. - UID int `json:"uid,omitempty"` - - // GID is the group ID of the owner. - GID int `json:"gid,omitempty"` - - // Uname is the username of the owner. - // - // In the serialized JSON, this field may only be present for - // the first entry with the same UID. - Uname string `json:"userName,omitempty"` - - // Gname is the group name of the owner. - // - // In the serialized JSON, this field may only be present for - // the first entry with the same GID. - Gname string `json:"groupName,omitempty"` - - // Offset, for regular files, provides the offset in the - // stargz file to the file's data bytes. See ChunkOffset and - // ChunkSize. - Offset int64 `json:"offset,omitempty"` - - // InnerOffset is an optional field indicates uncompressed offset - // of this "reg" or "chunk" payload in a stream starts from Offset. - // This field enables to put multiple "reg" or "chunk" payloads - // in one chunk with having the same Offset but different InnerOffset. - InnerOffset int64 `json:"innerOffset,omitempty"` - - nextOffset int64 // the Offset of the next entry with a non-zero Offset - - // DevMajor is the major device number for "char" and "block" types. - DevMajor int `json:"devMajor,omitempty"` - - // DevMinor is the major device number for "char" and "block" types. - DevMinor int `json:"devMinor,omitempty"` - - // NumLink is the number of entry names pointing to this entry. - // Zero means one name references this entry. - // This field is calculated during runtime and not recorded in TOC JSON. - NumLink int `json:"-"` - - // Xattrs are the extended attribute for the entry. - Xattrs map[string][]byte `json:"xattrs,omitempty"` - - // Digest stores the OCI checksum for regular files payload. - // It has the form "sha256:abcdef01234....". - Digest string `json:"digest,omitempty"` - - // ChunkOffset is non-zero if this is a chunk of a large, - // regular file. If so, the Offset is where the gzip header of - // ChunkSize bytes at ChunkOffset in Name begin. - // - // In serialized form, a "chunkSize" JSON field of zero means - // that the chunk goes to the end of the file. After reading - // from the stargz TOC, though, the ChunkSize is initialized - // to a non-zero file for when Type is either "reg" or - // "chunk". - ChunkOffset int64 `json:"chunkOffset,omitempty"` - ChunkSize int64 `json:"chunkSize,omitempty"` - - // ChunkDigest stores an OCI digest of the chunk. This must be formed - // as "sha256:0123abcd...". - ChunkDigest string `json:"chunkDigest,omitempty"` - - children map[string]*TOCEntry - - // chunkTopIndex is index of the entry where Offset starts in the blob. - chunkTopIndex int -} - -// ModTime returns the entry's modification time. -func (e *TOCEntry) ModTime() time.Time { return e.modTime } - -// NextOffset returns the position (relative to the start of the -// stargz file) of the next gzip boundary after e.Offset. -func (e *TOCEntry) NextOffset() int64 { return e.nextOffset } - -func (e *TOCEntry) addChild(baseName string, child *TOCEntry) { - if e.children == nil { - e.children = make(map[string]*TOCEntry) - } - if child.Type == "dir" { - e.NumLink++ // Entry ".." in the subdirectory links to this directory - } - e.children[baseName] = child -} - -// isDataType reports whether TOCEntry is a regular file or chunk (something that -// contains regular file data). -func (e *TOCEntry) isDataType() bool { return e.Type == "reg" || e.Type == "chunk" } - -// Stat returns a FileInfo value representing e. -func (e *TOCEntry) Stat() os.FileInfo { return fileInfo{e} } - -// ForeachChild calls f for each child item. If f returns false, iteration ends. -// If e is not a directory, f is not called. -func (e *TOCEntry) ForeachChild(f func(baseName string, ent *TOCEntry) bool) { - for name, ent := range e.children { - if !f(name, ent) { - return - } - } -} - -// LookupChild returns the directory e's child by its base name. -func (e *TOCEntry) LookupChild(baseName string) (child *TOCEntry, ok bool) { - child, ok = e.children[baseName] - return -} - -// fileInfo implements os.FileInfo using the wrapped *TOCEntry. -type fileInfo struct{ e *TOCEntry } - -var _ os.FileInfo = fileInfo{} - -func (fi fileInfo) Name() string { return path.Base(fi.e.Name) } -func (fi fileInfo) IsDir() bool { return fi.e.Type == "dir" } -func (fi fileInfo) Size() int64 { return fi.e.Size } -func (fi fileInfo) ModTime() time.Time { return fi.e.ModTime() } -func (fi fileInfo) Sys() interface{} { return fi.e } -func (fi fileInfo) Mode() (m os.FileMode) { - // TOCEntry.Mode is tar.Header.Mode so we can understand the these bits using `tar` pkg. - m = (&tar.Header{Mode: fi.e.Mode}).FileInfo().Mode() & - (os.ModePerm | os.ModeSetuid | os.ModeSetgid | os.ModeSticky) - switch fi.e.Type { - case "dir": - m |= os.ModeDir - case "symlink": - m |= os.ModeSymlink - case "char": - m |= os.ModeDevice | os.ModeCharDevice - case "block": - m |= os.ModeDevice - case "fifo": - m |= os.ModeNamedPipe - } - return m -} - -// TOCEntryVerifier holds verifiers that are usable for verifying chunks contained -// in a eStargz blob. -type TOCEntryVerifier interface { - - // Verifier provides a content verifier that can be used for verifying the - // contents of the specified TOCEntry. - Verifier(ce *TOCEntry) (digest.Verifier, error) -} - -// Compression provides the compression helper to be used creating and parsing eStargz. -// This package provides gzip-based Compression by default, but any compression -// algorithm (e.g. zstd) can be used as long as it implements Compression. -type Compression interface { - Compressor - Decompressor -} - -// Compressor represents the helper mothods to be used for creating eStargz. -type Compressor interface { - // Writer returns WriteCloser to be used for writing a chunk to eStargz. - // Everytime a chunk is written, the WriteCloser is closed and Writer is - // called again for writing the next chunk. - // - // The returned writer should implement "Flush() error" function that flushes - // any pending compressed data to the underlying writer. - Writer(w io.Writer) (WriteFlushCloser, error) - - // WriteTOCAndFooter is called to write JTOC to the passed Writer. - // diffHash calculates the DiffID (uncompressed sha256 hash) of the blob - // WriteTOCAndFooter can optionally write anything that affects DiffID calculation - // (e.g. uncompressed TOC JSON). - // - // This function returns tocDgst that represents the digest of TOC that will be used - // to verify this blob when it's parsed. - WriteTOCAndFooter(w io.Writer, off int64, toc *JTOC, diffHash hash.Hash) (tocDgst digest.Digest, err error) -} - -// Decompressor represents the helper mothods to be used for parsing eStargz. -type Decompressor interface { - // Reader returns ReadCloser to be used for decompressing file payload. - Reader(r io.Reader) (io.ReadCloser, error) - - // FooterSize returns the size of the footer of this blob. - FooterSize() int64 - - // ParseFooter parses the footer and returns the offset and (compressed) size of TOC. - // payloadBlobSize is the (compressed) size of the blob payload (i.e. the size between - // the top until the TOC JSON). - // - // If tocOffset < 0, we assume that TOC isn't contained in the blob and pass nil reader - // to ParseTOC. We expect that ParseTOC acquire TOC from the external location and return it. - // - // tocSize is optional. If tocSize <= 0, it's by default the size of the range from tocOffset until the beginning of the - // footer (blob size - tocOff - FooterSize). - // If blobPayloadSize < 0, blobPayloadSize become the blob size. - ParseFooter(p []byte) (blobPayloadSize, tocOffset, tocSize int64, err error) - - // ParseTOC parses TOC from the passed reader. The reader provides the partial contents - // of the underlying blob that has the range specified by ParseFooter method. - // - // This function returns tocDgst that represents the digest of TOC that will be used - // to verify this blob. This must match to the value returned from - // Compressor.WriteTOCAndFooter that is used when creating this blob. - // - // If tocOffset returned by ParseFooter is < 0, we assume that TOC isn't contained in the blob. - // Pass nil reader to ParseTOC then we expect that ParseTOC acquire TOC from the external location - // and return it. - ParseTOC(r io.Reader) (toc *JTOC, tocDgst digest.Digest, err error) -} - -type WriteFlushCloser interface { - io.WriteCloser - Flush() error -} diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md b/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md deleted file mode 100644 index 1cade6cef6..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Brian Goff - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go deleted file mode 100644 index 42bf32aab0..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go +++ /dev/null @@ -1,16 +0,0 @@ -package md2man - -import ( - "github.com/russross/blackfriday/v2" -) - -// Render converts a markdown document into a roff formatted document. -func Render(doc []byte) []byte { - renderer := NewRoffRenderer() - - return blackfriday.Run(doc, - []blackfriday.Option{ - blackfriday.WithRenderer(renderer), - blackfriday.WithExtensions(renderer.GetExtensions()), - }...) -} diff --git a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go b/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go deleted file mode 100644 index 4b19188d90..0000000000 --- a/vendor/github.com/cpuguy83/go-md2man/v2/md2man/roff.go +++ /dev/null @@ -1,348 +0,0 @@ -package md2man - -import ( - "bytes" - "fmt" - "io" - "os" - "strings" - - "github.com/russross/blackfriday/v2" -) - -// roffRenderer implements the blackfriday.Renderer interface for creating -// roff format (manpages) from markdown text -type roffRenderer struct { - extensions blackfriday.Extensions - listCounters []int - firstHeader bool - firstDD bool - listDepth int -} - -const ( - titleHeader = ".TH " - topLevelHeader = "\n\n.SH " - secondLevelHdr = "\n.SH " - otherHeader = "\n.SS " - crTag = "\n" - emphTag = "\\fI" - emphCloseTag = "\\fP" - strongTag = "\\fB" - strongCloseTag = "\\fP" - breakTag = "\n.br\n" - paraTag = "\n.PP\n" - hruleTag = "\n.ti 0\n\\l'\\n(.lu'\n" - linkTag = "\n\\[la]" - linkCloseTag = "\\[ra]" - codespanTag = "\\fB" - codespanCloseTag = "\\fR" - codeTag = "\n.EX\n" - codeCloseTag = "\n.EE\n" - quoteTag = "\n.PP\n.RS\n" - quoteCloseTag = "\n.RE\n" - listTag = "\n.RS\n" - listCloseTag = "\n.RE\n" - dtTag = "\n.TP\n" - dd2Tag = "\n" - tableStart = "\n.TS\nallbox;\n" - tableEnd = ".TE\n" - tableCellStart = "T{\n" - tableCellEnd = "\nT}\n" -) - -// NewRoffRenderer creates a new blackfriday Renderer for generating roff documents -// from markdown -func NewRoffRenderer() *roffRenderer { // nolint: golint - var extensions blackfriday.Extensions - - extensions |= blackfriday.NoIntraEmphasis - extensions |= blackfriday.Tables - extensions |= blackfriday.FencedCode - extensions |= blackfriday.SpaceHeadings - extensions |= blackfriday.Footnotes - extensions |= blackfriday.Titleblock - extensions |= blackfriday.DefinitionLists - return &roffRenderer{ - extensions: extensions, - } -} - -// GetExtensions returns the list of extensions used by this renderer implementation -func (r *roffRenderer) GetExtensions() blackfriday.Extensions { - return r.extensions -} - -// RenderHeader handles outputting the header at document start -func (r *roffRenderer) RenderHeader(w io.Writer, ast *blackfriday.Node) { - // disable hyphenation - out(w, ".nh\n") -} - -// RenderFooter handles outputting the footer at the document end; the roff -// renderer has no footer information -func (r *roffRenderer) RenderFooter(w io.Writer, ast *blackfriday.Node) { -} - -// RenderNode is called for each node in a markdown document; based on the node -// type the equivalent roff output is sent to the writer -func (r *roffRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { - walkAction := blackfriday.GoToNext - - switch node.Type { - case blackfriday.Text: - escapeSpecialChars(w, node.Literal) - case blackfriday.Softbreak: - out(w, crTag) - case blackfriday.Hardbreak: - out(w, breakTag) - case blackfriday.Emph: - if entering { - out(w, emphTag) - } else { - out(w, emphCloseTag) - } - case blackfriday.Strong: - if entering { - out(w, strongTag) - } else { - out(w, strongCloseTag) - } - case blackfriday.Link: - // Don't render the link text for automatic links, because this - // will only duplicate the URL in the roff output. - // See https://daringfireball.net/projects/markdown/syntax#autolink - if !bytes.Equal(node.LinkData.Destination, node.FirstChild.Literal) { - out(w, string(node.FirstChild.Literal)) - } - // Hyphens in a link must be escaped to avoid word-wrap in the rendered man page. - escapedLink := strings.ReplaceAll(string(node.LinkData.Destination), "-", "\\-") - out(w, linkTag+escapedLink+linkCloseTag) - walkAction = blackfriday.SkipChildren - case blackfriday.Image: - // ignore images - walkAction = blackfriday.SkipChildren - case blackfriday.Code: - out(w, codespanTag) - escapeSpecialChars(w, node.Literal) - out(w, codespanCloseTag) - case blackfriday.Document: - break - case blackfriday.Paragraph: - // roff .PP markers break lists - if r.listDepth > 0 { - return blackfriday.GoToNext - } - if entering { - out(w, paraTag) - } else { - out(w, crTag) - } - case blackfriday.BlockQuote: - if entering { - out(w, quoteTag) - } else { - out(w, quoteCloseTag) - } - case blackfriday.Heading: - r.handleHeading(w, node, entering) - case blackfriday.HorizontalRule: - out(w, hruleTag) - case blackfriday.List: - r.handleList(w, node, entering) - case blackfriday.Item: - r.handleItem(w, node, entering) - case blackfriday.CodeBlock: - out(w, codeTag) - escapeSpecialChars(w, node.Literal) - out(w, codeCloseTag) - case blackfriday.Table: - r.handleTable(w, node, entering) - case blackfriday.TableHead: - case blackfriday.TableBody: - case blackfriday.TableRow: - // no action as cell entries do all the nroff formatting - return blackfriday.GoToNext - case blackfriday.TableCell: - r.handleTableCell(w, node, entering) - case blackfriday.HTMLSpan: - // ignore other HTML tags - case blackfriday.HTMLBlock: - if bytes.HasPrefix(node.Literal, []byte(" httpResponse). - - - -## func [ToGoCase](./strcase.go#L79) -``` go -func ToGoCase(s string, wordCase WordCase, delimiter rune) string -``` -ToGoCase returns words in given case and delimiter. - -Respects Go's common initialisms (e.g. httpResponse -> HTTPResponse). - - - -## func [ToGoKebab](./strcase.go#L31) -``` go -func ToGoKebab(s string) string -``` -ToGoKebab returns words in kebab-case (lower case words with dashes). -Also known as dash-case. - -Respects Go's common initialisms (e.g. http-response -> HTTP-response). - - - -## func [ToGoPascal](./strcase.go#L51) -``` go -func ToGoPascal(s string) string -``` -ToGoPascal returns words in PascalCase (capitalized words concatenated together). -Also known as UpperPascalCase. - -Respects Go's common initialisms (e.g. HttpResponse -> HTTPResponse). - - - -## func [ToGoSnake](./strcase.go#L11) -``` go -func ToGoSnake(s string) string -``` -ToGoSnake returns words in snake_case (lower case words with underscores). - -Respects Go's common initialisms (e.g. http_response -> HTTP_response). - - - -## func [ToKEBAB](./strcase.go#L37) -``` go -func ToKEBAB(s string) string -``` -ToKEBAB returns words in KEBAB-CASE (upper case words with dashes). -Also known as SCREAMING-KEBAB-CASE or SCREAMING-DASH-CASE. - - - -## func [ToKebab](./strcase.go#L23) -``` go -func ToKebab(s string) string -``` -ToKebab returns words in kebab-case (lower case words with dashes). -Also known as dash-case. - - - -## func [ToPascal](./strcase.go#L43) -``` go -func ToPascal(s string) string -``` -ToPascal returns words in PascalCase (capitalized words concatenated together). -Also known as UpperPascalCase. - - - -## func [ToSNAKE](./strcase.go#L17) -``` go -func ToSNAKE(s string) string -``` -ToSNAKE returns words in SNAKE_CASE (upper case words with underscores). -Also known as SCREAMING_SNAKE_CASE or UPPER_CASE. - - - -## func [ToSnake](./strcase.go#L4) -``` go -func ToSnake(s string) string -``` -ToSnake returns words in snake_case (lower case words with underscores). - - - - -## type [Caser](./caser.go#L4-L7) -``` go -type Caser struct { - // contains filtered or unexported fields -} - -``` -Caser allows for customization of parsing and intialisms - - - - - - - -### func [NewCaser](./caser.go#L24) -``` go -func NewCaser(goInitialisms bool, initialismOverrides map[string]bool, splitFn SplitFn) *Caser -``` -NewCaser returns a configured Caser. - -A Caser should be created when you want fine grained control over how the words are split. - - - Notes on function arguments - - goInitialisms: Whether to use Golint's intialisms - - initialismOverrides: A mapping of extra initialisms - Keys must be in ALL CAPS. Merged with Golint's if goInitialisms is set. - Setting a key to false will override Golint's. - - splitFn: How to separate words - Override the default split function. Consider using NewSplitFn to - configure one instead of writing your own. - - - - - -### func (\*Caser) [ToCamel](./caser.go#L80) -``` go -func (c *Caser) ToCamel(s string) string -``` -ToCamel returns words in camelCase (capitalized words concatenated together, with first word lower case). -Also known as lowerCamelCase or mixedCase. - - - - -### func (\*Caser) [ToCase](./caser.go#L85) -``` go -func (c *Caser) ToCase(s string, wordCase WordCase, delimiter rune) string -``` -ToCase returns words with a given case and delimiter. - - - - -### func (\*Caser) [ToKEBAB](./caser.go#L68) -``` go -func (c *Caser) ToKEBAB(s string) string -``` -ToKEBAB returns words in KEBAB-CASE (upper case words with dashes). -Also known as SCREAMING-KEBAB-CASE or SCREAMING-DASH-CASE. - - - - -### func (\*Caser) [ToKebab](./caser.go#L62) -``` go -func (c *Caser) ToKebab(s string) string -``` -ToKebab returns words in kebab-case (lower case words with dashes). -Also known as dash-case. - - - - -### func (\*Caser) [ToPascal](./caser.go#L74) -``` go -func (c *Caser) ToPascal(s string) string -``` -ToPascal returns words in PascalCase (capitalized words concatenated together). -Also known as UpperPascalCase. - - - - -### func (\*Caser) [ToSNAKE](./caser.go#L56) -``` go -func (c *Caser) ToSNAKE(s string) string -``` -ToSNAKE returns words in SNAKE_CASE (upper case words with underscores). -Also known as SCREAMING_SNAKE_CASE or UPPER_CASE. - - - - -### func (\*Caser) [ToSnake](./caser.go#L50) -``` go -func (c *Caser) ToSnake(s string) string -``` -ToSnake returns words in snake_case (lower case words with underscores). - - - - -## type [SplitAction](./split.go#L111) -``` go -type SplitAction int -``` -SplitAction defines if and how to split a string - - -``` go -const ( - // Noop - Continue to next character - Noop SplitAction = iota - // Split - Split between words - // e.g. to split between wordsWithoutDelimiters - Split - // SkipSplit - Split the word and drop the character - // e.g. to split words with delimiters - SkipSplit - // Skip - Remove the character completely - Skip -) -``` - - - - - - - - - -## type [SplitFn](./split.go#L6) -``` go -type SplitFn func(prev, curr, next rune) SplitAction -``` -SplitFn defines how to split a string into words - - - - - - - -### func [NewSplitFn](./split.go#L15-L18) -``` go -func NewSplitFn( - delimiters []rune, - splitOptions ...SplitOption, -) SplitFn -``` -NewSplitFn returns a SplitFn based on the options provided. - -NewSplitFn covers the majority of common options that other strcase -libraries provide and should allow you to simply create a custom caser. -For more complicated use cases, feel free to write your own SplitFn - - - - - -## type [SplitOption](./split.go#L94) -``` go -type SplitOption int -``` -SplitOption are options that allow for configuring NewSplitFn - - -``` go -const ( - // SplitCase - FooBar -> Foo_Bar - SplitCase SplitOption = iota - // SplitAcronym - FOOBar -> Foo_Bar - // It won't preserve FOO's case. If you want, you can set the Caser's initialisms so FOO will be in all caps - SplitAcronym - // SplitBeforeNumber - port80 -> port_80 - SplitBeforeNumber - // SplitAfterNumber - 200status -> 200_status - SplitAfterNumber - // PreserveNumberFormatting - a.b.2,000.3.c -> a_b_2,000.3_c - PreserveNumberFormatting -) -``` - - - - - - - - - -## type [WordCase](./convert.go#L6) -``` go -type WordCase int -``` -WordCase is an enumeration of the ways to format a word. - - -``` go -const ( - // Original - Preserve the original input strcase - Original WordCase = iota - // LowerCase - All letters lower cased (example) - LowerCase - // UpperCase - All letters upper cased (EXAMPLE) - UpperCase - // TitleCase - Only first letter upper cased (Example) - TitleCase - // CamelCase - TitleCase except lower case first word (exampleText) - // Notably, even if the first word is an initialism, it will be lower - // cased. This is important for code generators where capital letters - // mean exported functions. i.e. jsonString(), not JSONString() - CamelCase -) -``` - - - - - - - - - - - - - diff --git a/vendor/github.com/ettle/strcase/assert.go b/vendor/github.com/ettle/strcase/assert.go deleted file mode 100644 index 09344e40f2..0000000000 --- a/vendor/github.com/ettle/strcase/assert.go +++ /dev/null @@ -1,24 +0,0 @@ -package strcase - -// We use a lightweight replacement for testify/assert to reduce dependencies - -// testingT interface allows us to test our assert functions -type testingT interface { - Logf(format string, args ...interface{}) - Fail() -} - -// assertTrue will fail if the value is not true -func assertTrue(t testingT, value bool) { - if !value { - t.Fail() - } -} - -// assertEqual will fail if the two strings are not equal -func assertEqual(t testingT, expected, actual string) { - if expected != actual { - t.Logf("Expected: %s Actual: %s", expected, actual) - t.Fail() - } -} diff --git a/vendor/github.com/ettle/strcase/caser.go b/vendor/github.com/ettle/strcase/caser.go deleted file mode 100644 index 2e7eb955ba..0000000000 --- a/vendor/github.com/ettle/strcase/caser.go +++ /dev/null @@ -1,87 +0,0 @@ -package strcase - -// Caser allows for customization of parsing and intialisms -type Caser struct { - initialisms map[string]bool - splitFn SplitFn -} - -// NewCaser returns a configured Caser. -// -// A Caser should be created when you want fine grained control over how the words are split. -// -// Notes on function arguments -// -// goInitialisms: Whether to use Golint's intialisms -// -// initialismOverrides: A mapping of extra initialisms -// Keys must be in ALL CAPS. Merged with Golint's if goInitialisms is set. -// Setting a key to false will override Golint's. -// -// splitFn: How to separate words -// Override the default split function. Consider using NewSplitFn to -// configure one instead of writing your own. -func NewCaser(goInitialisms bool, initialismOverrides map[string]bool, splitFn SplitFn) *Caser { - c := &Caser{ - initialisms: golintInitialisms, - splitFn: splitFn, - } - - if c.splitFn == nil { - c.splitFn = defaultSplitFn - } - - if goInitialisms && initialismOverrides != nil { - c.initialisms = map[string]bool{} - for k, v := range golintInitialisms { - c.initialisms[k] = v - } - for k, v := range initialismOverrides { - c.initialisms[k] = v - } - } else if !goInitialisms { - c.initialisms = initialismOverrides - } - - return c -} - -// ToSnake returns words in snake_case (lower case words with underscores). -func (c *Caser) ToSnake(s string) string { - return convert(s, c.splitFn, '_', LowerCase, c.initialisms) -} - -// ToSNAKE returns words in SNAKE_CASE (upper case words with underscores). -// Also known as SCREAMING_SNAKE_CASE or UPPER_CASE. -func (c *Caser) ToSNAKE(s string) string { - return convert(s, c.splitFn, '_', UpperCase, c.initialisms) -} - -// ToKebab returns words in kebab-case (lower case words with dashes). -// Also known as dash-case. -func (c *Caser) ToKebab(s string) string { - return convert(s, c.splitFn, '-', LowerCase, c.initialisms) -} - -// ToKEBAB returns words in KEBAB-CASE (upper case words with dashes). -// Also known as SCREAMING-KEBAB-CASE or SCREAMING-DASH-CASE. -func (c *Caser) ToKEBAB(s string) string { - return convert(s, c.splitFn, '-', UpperCase, c.initialisms) -} - -// ToPascal returns words in PascalCase (capitalized words concatenated together). -// Also known as UpperPascalCase. -func (c *Caser) ToPascal(s string) string { - return convert(s, c.splitFn, '\x00', TitleCase, c.initialisms) -} - -// ToCamel returns words in camelCase (capitalized words concatenated together, with first word lower case). -// Also known as lowerCamelCase or mixedCase. -func (c *Caser) ToCamel(s string) string { - return convert(s, c.splitFn, '\x00', CamelCase, c.initialisms) -} - -// ToCase returns words with a given case and delimiter. -func (c *Caser) ToCase(s string, wordCase WordCase, delimiter rune) string { - return convert(s, c.splitFn, delimiter, wordCase, c.initialisms) -} diff --git a/vendor/github.com/ettle/strcase/convert.go b/vendor/github.com/ettle/strcase/convert.go deleted file mode 100644 index cb901d079d..0000000000 --- a/vendor/github.com/ettle/strcase/convert.go +++ /dev/null @@ -1,306 +0,0 @@ -package strcase - -import "strings" - -// WordCase is an enumeration of the ways to format a word. -type WordCase int - -const ( - // Original - Preserve the original input strcase - Original WordCase = iota - // LowerCase - All letters lower cased (example) - LowerCase - // UpperCase - All letters upper cased (EXAMPLE) - UpperCase - // TitleCase - Only first letter upper cased (Example) - TitleCase - // CamelCase - TitleCase except lower case first word (exampleText) - // Notably, even if the first word is an initialism, it will be lower - // cased. This is important for code generators where capital letters - // mean exported functions. i.e. jsonString(), not JSONString() - CamelCase -) - -// We have 3 convert functions for performance reasons -// The general convert could handle everything, but is not optimized -// -// The other two functions are optimized for the general use cases - that is the non-custom caser functions -// Case 1: Any Case and supports Go Initialisms -// Case 2: UpperCase words, which don't need to support initialisms since everything is in upper case - -// convertWithoutInitialims only works for to UpperCase and LowerCase -// -//nolint:gocyclo -func convertWithoutInitialisms(input string, delimiter rune, wordCase WordCase) string { - input = strings.TrimSpace(input) - runes := []rune(input) - if len(runes) == 0 { - return "" - } - - var b strings.Builder - b.Grow(len(input) + 4) // In case we need to write delimiters where they weren't before - - var prev, curr rune - next := runes[0] // 0 length will have already returned so safe to index - inWord := false - firstWord := true - for i := 0; i < len(runes); i++ { - prev = curr - curr = next - if i+1 == len(runes) { - next = 0 - } else { - next = runes[i+1] - } - - switch defaultSplitFn(prev, curr, next) { - case SkipSplit: - if inWord && delimiter != 0 { - b.WriteRune(delimiter) - } - inWord = false - continue - case Split: - if inWord && delimiter != 0 { - b.WriteRune(delimiter) - } - inWord = false - } - switch wordCase { - case UpperCase: - b.WriteRune(toUpper(curr)) - case LowerCase: - b.WriteRune(toLower(curr)) - case TitleCase: - if inWord { - b.WriteRune(toLower(curr)) - } else { - b.WriteRune(toUpper(curr)) - } - case CamelCase: - if inWord { - b.WriteRune(toLower(curr)) - } else if firstWord { - b.WriteRune(toLower(curr)) - firstWord = false - } else { - b.WriteRune(toUpper(curr)) - } - default: - // Must be original case - b.WriteRune(curr) - } - inWord = true - } - return b.String() -} - -// convertWithGoInitialisms changes a input string to a certain case with a -// delimiter, respecting go initialisms but not skip runes -// -//nolint:gocyclo -func convertWithGoInitialisms(input string, delimiter rune, wordCase WordCase) string { - input = strings.TrimSpace(input) - runes := []rune(input) - if len(runes) == 0 { - return "" - } - - var b strings.Builder - b.Grow(len(input) + 4) // In case we need to write delimiters where they weren't before - - firstWord := true - - addWord := func(start, end int) { - if start == end { - return - } - - if !firstWord && delimiter != 0 { - b.WriteRune(delimiter) - } - - // Don't bother with initialisms if the word is longer than 5 - // A quick proxy to avoid the extra memory allocations - if end-start <= 5 { - var word strings.Builder - word.Grow(end - start) - for i := start; i < end; i++ { - word.WriteRune(toUpper(runes[i])) - } - w := word.String() - if golintInitialisms[w] { - if !firstWord || wordCase != CamelCase { - b.WriteString(w) - firstWord = false - return - } - } - } - - for i := start; i < end; i++ { - r := runes[i] - switch wordCase { - case UpperCase: - panic("use convertWithoutInitialisms instead") - case LowerCase: - b.WriteRune(toLower(r)) - case TitleCase: - if i == start { - b.WriteRune(toUpper(r)) - } else { - b.WriteRune(toLower(r)) - } - case CamelCase: - if !firstWord && i == start { - b.WriteRune(toUpper(r)) - } else { - b.WriteRune(toLower(r)) - } - default: - b.WriteRune(r) - } - } - firstWord = false - } - - var prev, curr rune - next := runes[0] // 0 length will have already returned so safe to index - wordStart := 0 - for i := 0; i < len(runes); i++ { - prev = curr - curr = next - if i+1 == len(runes) { - next = 0 - } else { - next = runes[i+1] - } - - switch defaultSplitFn(prev, curr, next) { - case Split: - addWord(wordStart, i) - wordStart = i - case SkipSplit: - addWord(wordStart, i) - wordStart = i + 1 - } - } - - if wordStart != len(runes) { - addWord(wordStart, len(runes)) - } - return b.String() -} - -// convert changes a input string to a certain case with a delimiter, -// respecting arbitrary initialisms and skip characters -// -//nolint:gocyclo -func convert(input string, fn SplitFn, delimiter rune, wordCase WordCase, - initialisms map[string]bool) string { - input = strings.TrimSpace(input) - runes := []rune(input) - if len(runes) == 0 { - return "" - } - - var b strings.Builder - b.Grow(len(input) + 4) // In case we need to write delimiters where they weren't before - - firstWord := true - var skipIndexes []int - - addWord := func(start, end int) { - // If you have nothing good to say, say nothing at all - if start == end || len(skipIndexes) == end-start { - skipIndexes = nil - return - } - - // If you have something to say, start with a delimiter - if !firstWord && delimiter != 0 { - b.WriteRune(delimiter) - } - - // Check if you're an initialism - // Note - we don't check skip characters here since initialisms - // will probably never have junk characters in between - // I'm open to it if there is a use case - if initialisms != nil { - var word strings.Builder - word.Grow(end - start) - for i := start; i < end; i++ { - word.WriteRune(toUpper(runes[i])) - } - w := word.String() - if initialisms[w] { - if !firstWord || wordCase != CamelCase { - b.WriteString(w) - firstWord = false - return - } - } - } - - skipIdx := 0 - for i := start; i < end; i++ { - if len(skipIndexes) > 0 && skipIdx < len(skipIndexes) && i == skipIndexes[skipIdx] { - skipIdx++ - continue - } - r := runes[i] - switch wordCase { - case UpperCase: - b.WriteRune(toUpper(r)) - case LowerCase: - b.WriteRune(toLower(r)) - case TitleCase: - if i == start { - b.WriteRune(toUpper(r)) - } else { - b.WriteRune(toLower(r)) - } - case CamelCase: - if !firstWord && i == start { - b.WriteRune(toUpper(r)) - } else { - b.WriteRune(toLower(r)) - } - default: - b.WriteRune(r) - } - } - firstWord = false - skipIndexes = nil - } - - var prev, curr rune - next := runes[0] // 0 length will have already returned so safe to index - wordStart := 0 - for i := 0; i < len(runes); i++ { - prev = curr - curr = next - if i+1 == len(runes) { - next = 0 - } else { - next = runes[i+1] - } - - switch fn(prev, curr, next) { - case Skip: - skipIndexes = append(skipIndexes, i) - case Split: - addWord(wordStart, i) - wordStart = i - case SkipSplit: - addWord(wordStart, i) - wordStart = i + 1 - } - } - - if wordStart != len(runes) { - addWord(wordStart, len(runes)) - } - return b.String() -} diff --git a/vendor/github.com/ettle/strcase/doc.go b/vendor/github.com/ettle/strcase/doc.go deleted file mode 100644 index c3bf14a8f5..0000000000 --- a/vendor/github.com/ettle/strcase/doc.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Package strcase is a package for converting strings into various word cases -(e.g. snake_case, camelCase) - - go get -u github.com/ettle/strcase - -Example usage - - strcase.ToSnake("Hello World") // hello_world - strcase.ToSNAKE("Hello World") // HELLO_WORLD - - strcase.ToKebab("helloWorld") // hello-world - strcase.ToKEBAB("helloWorld") // HELLO-WORLD - - strcase.ToPascal("hello-world") // HelloWorld - strcase.ToCamel("hello-world") // helloWorld - - // Handle odd cases - strcase.ToSnake("FOOBar") // foo_bar - - // Support Go initialisms - strcase.ToGoPascal("http_response") // HTTPResponse - - // Specify case and delimiter - strcase.ToCase("HelloWorld", strcase.UpperCase, '.') // HELLO.WORLD - -## Why this package - -String strcase is pretty straight forward and there are a number of methods to -do it. This package is fully featured, more customizable, better tested, and -faster than other packages and what you would probably whip up yourself. - -### Unicode support - -We work for with unicode strings and pay very little performance penalty for it -as we optimized for the common use case of ASCII only strings. - -### Customization - -You can create a custom caser that changes the behavior to what you want. This -customization also reduces the pressure for us to change the default behavior -which means that things are more stable for everyone involved. The goal is to -make the common path easy and fast, while making the uncommon path possible. - - c := NewCaser( - // Use Go's default initialisms e.g. ID, HTML - true, - // Override initialisms (e.g. don't initialize HTML but initialize SSL - map[string]bool{"SSL": true, "HTML": false}, - // Write your own custom SplitFn - // - NewSplitFn( - []rune{'*', '.', ','}, - SplitCase, - SplitAcronym, - PreserveNumberFormatting, - SplitBeforeNumber, - SplitAfterNumber, - )) - assert.Equal(t, "http_200", c.ToSnake("http200")) - -### Initialism support - -By default, we use the golint intialisms list. You can customize and override -the initialisms if you wish to add additional ones, such as "SSL" or "CMS" or -domain specific ones to your industry. - - ToGoPascal("http_response") // HTTPResponse - ToGoSnake("http_response") // HTTP_response - -### Test coverage - -We have a wide ranging test suite to make sure that we understand our behavior. -Test coverage isn't everything, but we aim for 100% coverage. - -### Fast - -Optimized to reduce memory allocations with Builder. Benchmarked and optimized -around common cases. - -We're on par with the fastest packages (that have less features) and much -faster than others. We also benchmarked against code snippets. Using string -builders to reduce memory allocation and reordering boolean checks for the -common cases have a large performance impact. - -Hopefully I was fair to each library and happy to rerun benchmarks differently -or reword my commentary based on suggestions or updates. - - // This package - faster then almost all libraries - // Initialisms are more complicated and slightly slower, but still fast - BenchmarkToTitle-96 9617142 125.7 ns/op 16 B/op 1 allocs/op - BenchmarkToSnake-96 10659919 120.7 ns/op 16 B/op 1 allocs/op - BenchmarkToSNAKE-96 9018282 126.4 ns/op 16 B/op 1 allocs/op - BenchmarkToGoSnake-96 4903687 254.5 ns/op 26 B/op 4 allocs/op - BenchmarkToCustomCaser-96 4434489 265.0 ns/op 28 B/op 4 allocs/op - - // Segment has very fast snake case and camel case libraries - // No features or customization, but very very fast - BenchmarkSegment-96 33625734 35.54 ns/op 16 B/op 1 allocs/op - - // Iancoleman has gotten some performance improvements, but remains - // without unicode support and lacks fine-grained customization - BenchmarkToSnakeIan-96 13141522 92.99 ns/op 16 B/op 1 allocs/op - - // Stdlib strings.Title is deprecated; using golang.org/x.text - BenchmarkGolangOrgXTextCases-96 4665676 262.5 ns/op 272 B/op 2 allocs/op - - // Other libraries or code snippets - // - Most are slower, by up to an order of magnitude - // - No support for initialisms or customization - // - Some generate only camelCase or snake_case - // - Many lack unicode support - BenchmarkToSnakeStoewer-96 8095468 148.9 ns/op 64 B/op 2 allocs/op - // Copying small rune arrays is slow - BenchmarkToSnakeSiongui-96 2912593 401.7 ns/op 112 B/op 19 allocs/op - BenchmarkGoValidator-96 3493800 342.6 ns/op 184 B/op 9 allocs/op - // String alloction is slow - BenchmarkToSnakeFatih-96 1282648 945.1 ns/op 616 B/op 26 allocs/op - // Regexp is slow - BenchmarkToSnakeGolangPrograms-96 778674 1495 ns/op 227 B/op 11 allocs/op - - // These results aren't a surprise - my initial version of this library was - // painfully slow. I think most of us, without spending some time with - // profilers and benchmarks, would write also something on the slower side. - -### Zero dependencies - -That's right - zero. We only import the Go standard library. No hassles with -dependencies, licensing, security alerts. - -## Why not this package - -If every nanosecond matters and this is used in a tight loop, use segment.io's -libraries (https://github.com/segmentio/go-snakecase and -https://github.com/segmentio/go-camelcase). They lack features, but make up for -it by being blazing fast. - -## Migrating from other packages - -If you are migrating from from another package, you may find slight differences -in output. To reduce the delta, you may find it helpful to use the following -custom casers to mimic the behavior of the other package. - - // From https://github.com/iancoleman/strcase - var c = NewCaser(false, nil, NewSplitFn([]rune{'_', '-', '.'}, SplitCase, SplitAcronym, SplitBeforeNumber)) - - // From https://github.com/stoewer/go-strcase - var c = NewCaser(false, nil, NewSplitFn([]rune{'_', '-'}, SplitCase), SplitAcronym) -*/ -package strcase diff --git a/vendor/github.com/ettle/strcase/initialism.go b/vendor/github.com/ettle/strcase/initialism.go deleted file mode 100644 index 3c313d3e9a..0000000000 --- a/vendor/github.com/ettle/strcase/initialism.go +++ /dev/null @@ -1,43 +0,0 @@ -package strcase - -// golintInitialisms are the golint initialisms -var golintInitialisms = map[string]bool{ - "ACL": true, - "API": true, - "ASCII": true, - "CPU": true, - "CSS": true, - "DNS": true, - "EOF": true, - "GUID": true, - "HTML": true, - "HTTP": true, - "HTTPS": true, - "ID": true, - "IP": true, - "JSON": true, - "LHS": true, - "QPS": true, - "RAM": true, - "RHS": true, - "RPC": true, - "SLA": true, - "SMTP": true, - "SQL": true, - "SSH": true, - "TCP": true, - "TLS": true, - "TTL": true, - "UDP": true, - "UI": true, - "UID": true, - "UUID": true, - "URI": true, - "URL": true, - "UTF8": true, - "VM": true, - "XML": true, - "XMPP": true, - "XSRF": true, - "XSS": true, -} diff --git a/vendor/github.com/ettle/strcase/split.go b/vendor/github.com/ettle/strcase/split.go deleted file mode 100644 index 32bc29759a..0000000000 --- a/vendor/github.com/ettle/strcase/split.go +++ /dev/null @@ -1,165 +0,0 @@ -package strcase - -import "unicode" - -// SplitFn defines how to split a string into words -type SplitFn func(prev, curr, next rune) SplitAction - -// NewSplitFn returns a SplitFn based on the options provided. -// -// NewSplitFn covers the majority of common options that other strcase -// libraries provide and should allow you to simply create a custom caser. -// For more complicated use cases, feel free to write your own SplitFn -// -//nolint:gocyclo -func NewSplitFn( - delimiters []rune, - splitOptions ...SplitOption, -) SplitFn { - var splitCase, splitAcronym, splitBeforeNumber, splitAfterNumber, preserveNumberFormatting bool - - for _, option := range splitOptions { - switch option { - case SplitCase: - splitCase = true - case SplitAcronym: - splitAcronym = true - case SplitBeforeNumber: - splitBeforeNumber = true - case SplitAfterNumber: - splitAfterNumber = true - case PreserveNumberFormatting: - preserveNumberFormatting = true - } - } - - return func(prev, curr, next rune) SplitAction { - // The most common case will be that it's just a letter - // There are safe cases to process - if isLower(curr) && !isNumber(prev) { - return Noop - } - if isUpper(prev) && isUpper(curr) && isUpper(next) { - return Noop - } - - if preserveNumberFormatting { - if (curr == '.' || curr == ',') && - isNumber(prev) && isNumber(next) { - return Noop - } - } - - if unicode.IsSpace(curr) { - return SkipSplit - } - for _, d := range delimiters { - if curr == d { - return SkipSplit - } - } - - if splitBeforeNumber { - if isNumber(curr) && !isNumber(prev) { - if preserveNumberFormatting && (prev == '.' || prev == ',') { - return Noop - } - return Split - } - } - - if splitAfterNumber { - if isNumber(prev) && !isNumber(curr) { - return Split - } - } - - if splitCase { - if !isUpper(prev) && isUpper(curr) { - return Split - } - } - - if splitAcronym { - if isUpper(prev) && isUpper(curr) && isLower(next) { - return Split - } - } - - return Noop - } -} - -// SplitOption are options that allow for configuring NewSplitFn -type SplitOption int - -const ( - // SplitCase - FooBar -> Foo_Bar - SplitCase SplitOption = iota - // SplitAcronym - FOOBar -> Foo_Bar - // It won't preserve FOO's case. If you want, you can set the Caser's initialisms so FOO will be in all caps - SplitAcronym - // SplitBeforeNumber - port80 -> port_80 - SplitBeforeNumber - // SplitAfterNumber - 200status -> 200_status - SplitAfterNumber - // PreserveNumberFormatting - a.b.2,000.3.c -> a_b_2,000.3_c - PreserveNumberFormatting -) - -// SplitAction defines if and how to split a string -type SplitAction int - -const ( - // Noop - Continue to next character - Noop SplitAction = iota - // Split - Split between words - // e.g. to split between wordsWithoutDelimiters - Split - // SkipSplit - Split the word and drop the character - // e.g. to split words with delimiters - SkipSplit - // Skip - Remove the character completely - Skip -) - -//nolint:gocyclo -func defaultSplitFn(prev, curr, next rune) SplitAction { - // The most common case will be that it's just a letter so let lowercase letters return early since we know what they should do - if isLower(curr) { - return Noop - } - // Delimiters are _, -, ., and unicode spaces - // Handle . lower down as it needs to happen after number exceptions - if curr == '_' || curr == '-' || isSpace(curr) { - return SkipSplit - } - - if isUpper(curr) { - if isLower(prev) { - // fooBar - return Split - } else if isUpper(prev) && isLower(next) { - // FOOBar - return Split - } - } - - // Do numeric exceptions last to avoid perf penalty - if unicode.IsNumber(prev) { - // v4.3 is not split - if (curr == '.' || curr == ',') && unicode.IsNumber(next) { - return Noop - } - if !unicode.IsNumber(curr) && curr != '.' { - return Split - } - } - // While period is a default delimiter, keep it down here to avoid - // penalty for other delimiters - if curr == '.' { - return SkipSplit - } - - return Noop -} diff --git a/vendor/github.com/ettle/strcase/strcase.go b/vendor/github.com/ettle/strcase/strcase.go deleted file mode 100644 index 46b4f7a684..0000000000 --- a/vendor/github.com/ettle/strcase/strcase.go +++ /dev/null @@ -1,81 +0,0 @@ -package strcase - -// ToSnake returns words in snake_case (lower case words with underscores). -func ToSnake(s string) string { - return convertWithoutInitialisms(s, '_', LowerCase) -} - -// ToGoSnake returns words in snake_case (lower case words with underscores). -// -// Respects Go's common initialisms (e.g. http_response -> HTTP_response). -func ToGoSnake(s string) string { - return convertWithGoInitialisms(s, '_', LowerCase) -} - -// ToSNAKE returns words in SNAKE_CASE (upper case words with underscores). -// Also known as SCREAMING_SNAKE_CASE or UPPER_CASE. -func ToSNAKE(s string) string { - return convertWithoutInitialisms(s, '_', UpperCase) -} - -// ToKebab returns words in kebab-case (lower case words with dashes). -// Also known as dash-case. -func ToKebab(s string) string { - return convertWithoutInitialisms(s, '-', LowerCase) -} - -// ToGoKebab returns words in kebab-case (lower case words with dashes). -// Also known as dash-case. -// -// Respects Go's common initialisms (e.g. http-response -> HTTP-response). -func ToGoKebab(s string) string { - return convertWithGoInitialisms(s, '-', LowerCase) -} - -// ToKEBAB returns words in KEBAB-CASE (upper case words with dashes). -// Also known as SCREAMING-KEBAB-CASE or SCREAMING-DASH-CASE. -func ToKEBAB(s string) string { - return convertWithoutInitialisms(s, '-', UpperCase) -} - -// ToPascal returns words in PascalCase (capitalized words concatenated together). -// Also known as UpperPascalCase. -func ToPascal(s string) string { - return convertWithoutInitialisms(s, 0, TitleCase) -} - -// ToGoPascal returns words in PascalCase (capitalized words concatenated together). -// Also known as UpperPascalCase. -// -// Respects Go's common initialisms (e.g. HttpResponse -> HTTPResponse). -func ToGoPascal(s string) string { - return convertWithGoInitialisms(s, 0, TitleCase) -} - -// ToCamel returns words in camelCase (capitalized words concatenated together, with first word lower case). -// Also known as lowerCamelCase or mixedCase. -func ToCamel(s string) string { - return convertWithoutInitialisms(s, 0, CamelCase) -} - -// ToGoCamel returns words in camelCase (capitalized words concatenated together, with first word lower case). -// Also known as lowerCamelCase or mixedCase. -// -// Respects Go's common initialisms, but first word remains lowercased which is -// important for code generator use cases (e.g. toJson -> toJSON, httpResponse -// -> httpResponse). -func ToGoCamel(s string) string { - return convertWithGoInitialisms(s, 0, CamelCase) -} - -// ToCase returns words in given case and delimiter. -func ToCase(s string, wordCase WordCase, delimiter rune) string { - return convertWithoutInitialisms(s, delimiter, wordCase) -} - -// ToGoCase returns words in given case and delimiter. -// -// Respects Go's common initialisms (e.g. httpResponse -> HTTPResponse). -func ToGoCase(s string, wordCase WordCase, delimiter rune) string { - return convertWithGoInitialisms(s, delimiter, wordCase) -} diff --git a/vendor/github.com/ettle/strcase/unicode.go b/vendor/github.com/ettle/strcase/unicode.go deleted file mode 100644 index b75e25a512..0000000000 --- a/vendor/github.com/ettle/strcase/unicode.go +++ /dev/null @@ -1,48 +0,0 @@ -package strcase - -import "unicode" - -// Unicode functions, optimized for the common case of ascii -// No performance lost by wrapping since these functions get inlined by the compiler - -func isUpper(r rune) bool { - return unicode.IsUpper(r) -} - -func isLower(r rune) bool { - return unicode.IsLower(r) -} - -func isNumber(r rune) bool { - if r >= '0' && r <= '9' { - return true - } - return unicode.IsNumber(r) -} - -func isSpace(r rune) bool { - if r == ' ' || r == '\t' || r == '\n' || r == '\r' { - return true - } else if r < 128 { - return false - } - return unicode.IsSpace(r) -} - -func toUpper(r rune) rune { - if r >= 'a' && r <= 'z' { - return r - 32 - } else if r < 128 { - return r - } - return unicode.ToUpper(r) -} - -func toLower(r rune) rune { - if r >= 'A' && r <= 'Z' { - return r + 32 - } else if r < 128 { - return r - } - return unicode.ToLower(r) -} diff --git a/vendor/github.com/evilmartians/lefthook/.gitignore b/vendor/github.com/evilmartians/lefthook/.gitignore deleted file mode 100644 index bfd1d16a26..0000000000 --- a/vendor/github.com/evilmartians/lefthook/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -.vscode/ -.idea/ -.lefthook-local/ -.lefthook/ -/lefthook-local.yml -/lefthook.yml -/lefthook - -tmp/ -dist/ -packaging/rubygems/pkg/ -packaging/rubygems/libexec/ -packaging/npm-bundled/bin/ -packaging/npm-*/README.md -packaging/npm/*/bin/ -!packaging/npm/lefthook/bin/index.js -packaging/npm/*/README.md -package.json -!packaging/npm/*/package.json -node_modules/ -yarn.lock -package-lock.json diff --git a/vendor/github.com/evilmartians/lefthook/.golangci.yml b/vendor/github.com/evilmartians/lefthook/.golangci.yml deleted file mode 100644 index 6b6f1b0f80..0000000000 --- a/vendor/github.com/evilmartians/lefthook/.golangci.yml +++ /dev/null @@ -1,57 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - misspell: - locale: US - gci: - local-prefixes: github.com/evilmartians/lefthook - -linters: - disable-all: true - enable: - - asasalint - - asciicheck - - bidichk - - bodyclose - - containedctx - - contextcheck - - decorder - - depguard - - dogsled - - dupl - - dupword - - durationcheck - - errcheck - - errchkjson - - errname - - errorlint - - exhaustive - - exportloopref - - forbidigo - - gci - - gochecknoinits - - goconst - - gocritic - - gocyclo - - godot - - godox - - gofmt - - gofumpt - - goheader - - goimports - - gomnd - - goprintffuncname - - gosimple - - govet - - ineffassign - - misspell - - nestif - - noctx - - nolintlint - - revive - - staticcheck - - typecheck - - unconvert - - unparam - - unused - - whitespace diff --git a/vendor/github.com/evilmartians/lefthook/.goreleaser.yml b/vendor/github.com/evilmartians/lefthook/.goreleaser.yml deleted file mode 100644 index f8e5c7ca89..0000000000 --- a/vendor/github.com/evilmartians/lefthook/.goreleaser.yml +++ /dev/null @@ -1,88 +0,0 @@ -project_name: lefthook -before: - hooks: - - go generate ./... -builds: -- env: - - CGO_ENABLED=0 - goos: - - linux - - darwin - - windows - - freebsd - goarch: - - amd64 - - arm64 - - 386 - ignore: - - goos: darwin - goarch: 386 - - goos: linux - goarch: 386 - - goos: freebsd - goarch: 386 - ldflags: - - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} -archives: - - id: lefthook - format: binary - files: - - none* - name_template: >- - {{ .ProjectName }}_ - {{- .Version }}_ - {{- if eq .Os "darwin" }}MacOS - {{- else }}{{ title .Os }}{{ end }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - - id: lefthook-gz - format: gz - files: - - none* - name_template: >- - {{ .ProjectName }}_ - {{- .Version }}_ - {{- if eq .Os "darwin" }}MacOS - {{- else }}{{ title .Os }}{{ end }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} -checksum: - name_template: '{{ .ProjectName }}_checksums.txt' -snapshot: - name_template: "{{ .Tag }}" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' - - '^spec:' - - '^tmp:' - - '^context:' - - '^\d\.\d\.\d:' - -snapcrafts: - - - summary: Fast and powerful Git hooks manager for any type of projects. - description: | - Lefthook is a single dependency-free binary to manage all your git hooks. It works with any language in any environment, and in all common team workflows. - grade: stable - confinement: classic - publish: true - license: MIT - -nfpms: - - - file_name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - homepage: https://github.com/evilmartians/lefthook - description: Lefthook a single dependency-free binary to manage all your git hooks that works with any language in any environment, and in all common team workflows - maintainer: Alexander Abroskin - license: MIT - vendor: Evil Martians - formats: - - deb - - rpm - dependencies: - - git diff --git a/vendor/github.com/evilmartians/lefthook/CHANGELOG.md b/vendor/github.com/evilmartians/lefthook/CHANGELOG.md deleted file mode 100644 index 5c38f842b1..0000000000 --- a/vendor/github.com/evilmartians/lefthook/CHANGELOG.md +++ /dev/null @@ -1,403 +0,0 @@ -# Change log - -## master (unreleased) - -## 1.4.5 (2024-07-12) - -- docs: improve documentation and examples ([#517](https://github.com/evilmartians/lefthook/pull/517)) by @hyperupcall -- fix: improve hook template ([#516](https://github.com/evilmartians/lefthook/pull/516)) by @hyperupcall - -## 1.4.4 (2023-07-10) - -- fix: don't render bold ANSI sequence when colors are disabled ([#515](https://github.com/evilmartians/lefthook/pull/515)) by @adam12 -- deps: July 2023 ([#514](https://github.com/evilmartians/lefthook/pull/514)) by @mrexox - -## 1.4.3 (2023-06-19) - -- fix: auto stage non-standard files ([#506](https://github.com/evilmartians/lefthook/pull/506)) by @mrexox - -## 1.4.2 (2023-06-13) - -- deps: June 2023 ([#499](https://github.com/evilmartians/lefthook/pull/499)) -- feat: support toml dumpint ([#490](https://github.com/evilmartians/lefthook/pull/490)) by @mrexox -- feat: support json configs ([#489](https://github.com/evilmartians/lefthook/pull/489)) by @mrexox - -## 1.4.1 (2023-05-22) - -- fix: add win32 binary to artifacts (by @mrexox) -- feat: allow dumping with JSON ([#485](https://github.com/evilmartians/lefthook/pull/485) by @mrexox -- feat: add skip execution_info option ([#484](https://github.com/evilmartians/lefthook/pull/484)) by @mrexox -- deps: from 05.2023 ([#487](https://github.com/evilmartians/lefthook/pull/487)) by @mrexox - -## 1.4.0 (2023-05-18) - -- feat: add adaptive colors ([#482](https://github.com/evilmartians/lefthook/pull/482)) by @mrexox -- fix: skip output for interactive commands if configured ([#483](https://github.com/evilmartians/lefthook/pull/483)) by @mrexox -- feat: add dump command ([#481](https://github.com/evilmartians/lefthook/pull/481)) by @mrexox - -## 1.3.13 (2023-05-11) - -- feat: add only option ([#478](https://github.com/evilmartians/lefthook/pull/478)) by @mrexox - -## 1.3.12 (2023-04-28) - -- fix: allow skipping execution_out with interactive mode ([#476](https://github.com/evilmartians/lefthook/pull/476)) by @mrexox - -## 1.3.11 (2023-04-27) - -- feat: add execution_out to skip output settings ([#475](https://github.com/evilmartians/lefthook/pull/475)) by @mrexox -- chore: add debug logs when hook is skipped ([#474](https://github.com/evilmartians/lefthook/pull/474)) by @mrexox - -## 1.3.10 - -- feat: don't show when commands are skipped because of no matched files ([#468](https://github.com/evilmartians/lefthook/pull/468)) by @technicalpickles - -## 1.3.9 (2023-04-04) - -- feat: allow extra hooks in local config ([#462](https://github.com/evilmartians/lefthook/pull/462)) by @fabn -- feat: pass numeric placeholders to files command ([#461](https://github.com/evilmartians/lefthook/pull/461)) by @fabn - -## 1.3.8 (2023-03-23) - -- fix: make hook template compatible with shells without source command ([#458](https://github.com/evilmartians/lefthook/pull/458)) by @mdesantis - -## 1.3.7 (2023-03-20) - -- fix: allow globs in skip option ([#457](https://github.com/evilmartians/lefthook/pull/457)) by @mrexox -- deps: dependencies update (March 2023) ([#455](https://github.com/evilmartians/lefthook/pull/455)) by @mrexox -- fix: don't fail on missing config file ([#450](https://github.com/evilmartians/lefthook/pull/450)) by @mrexox - -## 1.3.6 (2023-03-16) - -- fix: stage fixed when root specified ([#449](https://github.com/evilmartians/lefthook/pull/449)) by @mrexox -- feat: implitic skip on missing files for pre-commit and pre-push hooks ([#448](https://github.com/evilmartians/lefthook/pull/448)) by @mrexox - -## 1.3.5 (2023-03-15) - -- feat: add stage_fixed option ([#445](https://github.com/evilmartians/lefthook/pull/445)) by @mrexox - -## 1.3.4 (2023-03-13) - -- fix: don't extra extend config if lefthook-local.yml is missing ([#444](https://github.com/evilmartians/lefthook/pull/444)) by @mrexox - -## 1.3.3 (2023-03-01) - -- fix: restore release assets name ([#437](https://github.com/evilmartians/lefthook/pull/437)) by @watarukura - -## 1.3.2 (2023-02-27) - -- fix: Allow sh syntax in files ([#435](https://github.com/evilmartians/lefthook/pull/435)) by @mrexox - -## 1.3.1 (2023-02-27) - -- fix: Force creation of git hooks folder ([#434](https://github.com/evilmartians/lefthook/pull/434)) by @mrexox - -## 1.3.0 (2023-02-22) - -- fix: Use correct branch for {push_files} template ([#429](https://github.com/evilmartians/lefthook/pull/429)) by @mrexox -- feature: Skip unstaged changes for pre-commit hook ([#402](https://github.com/evilmartians/lefthook/pull/402)) by @mrexox - -## 1.2.9 (2023-02-13) - -- fix: memory leak dependency ([#426](https://github.com/evilmartians/lefthook/pull/426)) by @strpc - -## 1.2.8 (2023-01-23) - -- fix: Don't join info path with root ([#418](https://github.com/evilmartians/lefthook/pull/418)) by @mrexox - -## 1.2.7 (2023-01-10) - -- fix: Make info dir when it is absent ([#414](https://github.com/evilmartians/lefthook/pull/414)) by @sato11 -- deps: bump github.com/mattn/go-isatty from 0.0.16 to 0.0.17 ([#409](https://github.com/evilmartians/lefthook/pull/409)) by @dependabot -- deps: bump github.com/briandowns/spinner from 1.19.0 to 1.20.0 ([#406](https://github.com/evilmartians/lefthook/pull/406)) by @dependabot -- fix: Double quote eval statements with $dir ([#404](https://github.com/evilmartians/lefthook/pull/404)) by @jrfoell -- chore: Add PR template ([#401](https://github.com/evilmartians/lefthook/pull/401)) by @mrexox -- chore: Fix yml syntax missing colon ([#399](https://github.com/evilmartians/lefthook/pull/399)) by @aaronkelton - -## 1.2.6 (2022-12-14) - -- feature: Allow following output ([#397](https://github.com/evilmartians/lefthook/pull/397)) by @mrexox -- fix: Remove quotes for rc in template ([#398](https://github.com/evilmartians/lefthook/pull/398)) by @mrexox - -## 1.2.5 (2022-12-13) - -- feature: Add an option to disable spinner ([#396](https://github.com/evilmartians/lefthook/pull/396)) by @mrexox -- feature: Use pnpm before npx ([#393](https://github.com/evilmartians/lefthook/pull/393)) by @mrexox -- chore: Use lipgloss for output ([#395](https://github.com/evilmartians/lefthook/pull/395)) by @mrexox - -## 1.2.4 (2022-12-05) - -- feature: Allow providing rc file ([PR #392](https://github.com/evilmartians/lefthook/pull/392) by @mrexox) - -## 1.2.3 (2022-11-30) - -- feature: Expand env variables ([PR #391](https://github.com/evilmartians/lefthook/pull/391) by @mrexox) -- deps: Update important dependencies ([PR #389](https://github.com/evilmartians/lefthook/pull/389) by @mrexox) - -## 1.2.2 (2022-11-23) - -- chore: Add FreeBSD OS to packages ([PR #377](https://github.com/evilmartians/lefthook/pull/377) by @mrexox) -- feature: Skip based on branch name and allow global skip rules ([PR #376](https://github.com/evilmartians/lefthook/pull/376) by @mrexox) -- fix: Omit LFS output unless it is required ([PR #373](https://github.com/evilmartians/lefthook/pull/373) by @mrexox) - -## 1.2.1 (2022-11-17) - -- fix: Remove quoting for scripts ([PR #371](https://github.com/evilmartians/lefthook/pull/371) by @stonesbg + @mrexox) -- fix: remove lefthook.checksum on uninstall ([PR #370](https://github.com/evilmartians/lefthook/pull/370) by @JuliusHenke) -- fix: Print prepare-commit-msg hook if it exists in config ([PR #368](https://github.com/evilmartians/lefthook/pull/368) by @mrexox) -- fix: Allow changing refs for remote ([PR #363](https://github.com/evilmartians/lefthook/pull/363) by @mrexox) - -## 1.2.0 (2022-11-7) - -- fix: Full support for interactive commands and scripts ([PR #352](https://github.com/evilmartians/lefthook/pull/352) by @mrexox) -- chore: Remove deprecated config options ([PR #351](https://github.com/evilmartians/lefthook/pull/351) by @mrexox) -- feature: Add remote config support ([PR #343](https://github.com/evilmartians/lefthook/pull/343) by @oatovar and @mrexox) - -## 1.1.4 (2022-11-1) - -- feature: Add `LEFTHOOK_VERBOSE` env ([PR #346](https://github.com/evilmartians/lefthook/pull/346) by @mrexox) - -## 1.1.3 (2022-10-15) - -- ci: Fix snapcraft trying to create dirs in parallel by @mrexox -- feature: Allow setting env vars ([PR #337](https://github.com/evilmartians/lefthook/pull/337) by @mrexox) -- feature: Show current running command and script name(s) ([PR #338](https://github.com/evilmartians/lefthook/pull/338) by @mrexox) -- feature: Exclude by command names too ([PR #335](https://github.com/evilmartians/lefthook/pull/335) by @mrexox) -- fix: Don't uninstall lefthook.yml and lefthook-local.yml by default ([PR #334](https://github.com/evilmartians/lefthook/pull/334) by @mrexox) -- fix: Fixing typo in gemspec ([PR #333](https://github.com/evilmartians/lefthook/pull/333) by @kerrizor) - -## 1.1.2 (2022-10-10) - -- Fix regression from #314 (chmod missed fix) ([PR #330](https://github.com/evilmartians/lefthook/pull/330) by @ariccio) -- Pass stdin by default ([PR #324](https://github.com/evilmartians/lefthook/pull/324) by @mrexox) - -## 1.1.1 (2022-08-22) - -- Quote path to script ([PR #321](https://github.com/evilmartians/lefthook/pull/321) by @mrexox) - -## 1.1.0 (2022-08-13) - -- Add goreleaser action ([PR #307](https://github.com/evilmartians/lefthook/pull/307) by @mrexox) -- Windows escaping issues ([PR #314](https://github.com/evilmartians/lefthook/pull/314) by @mrexox) -- Check for lefthook.bat in hook template ([PR #316](https://github.com/evilmartians/lefthook/pull/316) by @mrexox) -- Update node.md docs ([PR #312](https://github.com/evilmartians/lefthook/pull/312) by @fantua) -- Move postinstall script to main lefthook NPM package ([PR #311](https://github.com/evilmartians/lefthook/pull/311) by @mrexox) -- Allow suppressing execution output ([PR #309](https://github.com/evilmartians/lefthook/pull/309) by @mrexox) -- Update dependencies ([PR #308](https://github.com/evilmartians/lefthook/pull/308) by @mrexox) -- Add support for Git LFS ([PR #306](https://github.com/evilmartians/lefthook/pull/306) by @mrexox) -- Bump Go version to 1.19 ([PR #305](https://github.com/evilmartians/lefthook/pull/305) by @mrexox) -- Add tests on runner ([PR #304](https://github.com/evilmartians/lefthook/pull/304) by @mrexox) -- Add fail text option ([PR #301](https://github.com/evilmartians/lefthook/pull/301) by @mrexox) -- Store lefthook checksum in non-hook file ([PR #280](https://github.com/evilmartians/lefthook/pull/280) by @mrexox) - -## 1.0.5 (2022-07-19) - -- Submodules issue ([PR #300](https://github.com/evilmartians/lefthook/pull/300) by @mrexox) -- Remove rspec tests ([PR #299](https://github.com/evilmartians/lefthook/pull/299) by @mrexox) -- Add `when "mingw" then "windows"` case ([PR #297](https://github.com/evilmartians/lefthook/pull/297) by @ariccio) -- Define security policy and contact method ([PR #293](https://github.com/evilmartians/lefthook/pull/293) by @Envek) - -# 1.0.4 (2022-06-27) - -- Support skipping on rebase ([PR #289](https://github.com/evilmartians/lefthook/pull/289) by @mrexox) - -# 1.0.3 (2022-06-25) - -- Fix NPM package -- Update email information - -# 1.0.2 (2022-06-24) - -- Bring auto install back ([PR #286](https://github.com/evilmartians/lefthook/pull/286) by @mrexox) -- Move main.go to root ([PR #285](https://github.com/evilmartians/lefthook/pull/285) by @mrexox) -- Panic on commands structure misuse ([PR #284](https://github.com/evilmartians/lefthook/pull/284) by @mrexox) -- Split npm package by os and cpu ([PR #281](https://github.com/evilmartians/lefthook/pull/281) by @mrexox) - -# 1.0.1 (2022-06-20) Ruby gem and NPM package fix - -- Fix folders structure for `@evilmartians/lefthook` and `@evilmartians/lefthook-installer` packages -- Fix folders structure for `lefthook` gem - -# 1.0.0 (2022-06-19) - -- Refactoring ([PR #275](https://github.com/evilmartians/lefthook/pull/275) by @mrexox, @skryukov, @markovichecha) -- Replace deprecated `File.exists?` with `exist?` for Ruby script ([PR #263](https://github.com/evilmartians/lefthook/pull/263) by @pocke) - -# 0.8.0 (2022-06-07) - -- Allow skipping hooks in certain git states: merge and/or rebase ([PR #173](https://github.com/evilmartians/lefthook/pull/173) by @DmitryTsepelev) -- NPM: installer package that downloads the required binaries during installation ([PR #188](https://github.com/evilmartians/lefthook/pull/188) by @aminya, [PR #273](https://github.com/evilmartians/lefthook/pull/273) by @Envek) -- Add ability to skip summary output. Also support a `LEFTHOOK_QUIET` env variable ([PR #187](https://github.com/evilmartians/lefthook/pull/187) by @washtubs) -- Make filename globs case-insensitive ([PR #196](https://github.com/evilmartians/lefthook/pull/196) by @skryukov) -- Fix lefthook binary extension on Windows ([PR #188](https://github.com/evilmartians/lefthook/pull/188) by @aminya) -- Stop building 32-bit binaries for releases due to low usage (@Envek) -- Allow lefthook to work when node_modules is not in root folder for npx ([PR #224](https://github.com/evilmartians/lefthook/pull/224) by @spearmootz) -- Fix unreachable conditional in hook template ([PR #242](https://github.com/evilmartians/lefthook/pull/242) by @dannobytes) -- Add cpu arch and os arch to lefthook's filepath in hook template ([PR #260](https://github.com/evilmartians/lefthook/pull/260) by @rmachado-studocu) - -# 0.7.7 (2021-10-02) - -- Fix incorrect npx command in git hook script template ([PR #236](https://github.com/evilmartians/lefthook/pull/236)) @PikachuEXE -- Update project URLs in NPM package.json ([PR #235](https://github.com/evilmartians/lefthook/pull/235)) @PikachuEXE -- Pass all arguments to downstream hooks ([PR #231](https://github.com/evilmartians/lefthook/pull/231)) @pablobirukov -- Allows lefthook to work when node_modules is not in root folder for npx ([PR #224](https://github.com/evilmartians/lefthook/pull/224)) @spearmootz -- Do not initialize git config on `help` and `version` commands ([PR #209](https://github.com/evilmartians/lefthook/pull/209)) @pwinckles -- node: fix postinstall: process.cwd is a function and should be called @Envek - -# 0.7.6 (2021-06-02) - -- Fix lefthook binary extension on Windows. @aminya -- [PR #193](https://github.com/evilmartians/lefthook/pull/193) Fix path for searching npm-installed binary when in worktree. @Envek -- NPM, RPM, and DEB packaging fixes. @Envek - -# 0.7.5 (2021-05-14) - -- [PR #179](https://github.com/evilmartians/lefthook/pull/179) Fix running on Windows under MSYS and MINGW64 when run from Ruby gem or JS npm package. @akiver, @Envek -- [PR #177](https://github.com/evilmartians/lefthook/pull/177) Support non-default git hooks path. @charlie-wasp -- [PR #182](https://github.com/evilmartians/lefthook/pull/182) Support git workspaces and submodules. @skryukov -- [PR #184](https://github.com/evilmartians/lefthook/pull/184) Rewrite npm's scripts in JavaScript to support running on Windows without `sh`. @aminya - -# 0.7.4 (2021-04-30) - -- [PR](https://github.com/evilmartians/lefthook/pull/171) Improve check for installed git @DmitryTsepelev -- [PR](https://github.com/evilmartians/lefthook/pull/169) Create .git/hooks directory when it does not exist @DmitryTsepelev - -# 0.7.3 (2021-04-23) - -- [PR](https://github.com/evilmartians/lefthook/pull/168) Package versions for all architectures (x86_64, ARM64, x86) into Ruby gem and NPM package @Envek -- [PR](https://github.com/evilmartians/lefthook/pull/167) Fix golang 15+ build @skryukov - -# 0.7.2 (2020-02-02) - -- [PR](https://github.com/evilmartians/lefthook/pull/126) Feature multiple extends. Thanks @Evilweed - -- [PR](https://github.com/evilmartians/lefthook/pull/124) Fix `npx` when only `yarn` exists. Thanks @dotterian - -- [PR](https://github.com/evilmartians/lefthook/pull/116) Fix use '-h' for robust lefthook. Thanks @fahrinh - -# 0.7.1 (2020-02-02) - -- [PR](https://github.com/evilmartians/lefthook/pull/108) Fix `sh` dependency on windows when executing `git`. Thanks @lionskape - -- [PR](https://github.com/evilmartians/lefthook/pull/103) Add possibility for using `yaml` and `yml` extension for config. Thanks @rbUUbr - -# 0.7.0 (2019-12-14) - -- [PR](https://github.com/evilmartians/lefthook/pull/98) Support relative roots for monorepos. Thanks @jsmestad - -# 0.6.7 (2019-12-14) - -- [Commit](https://github.com/evilmartians/lefthook/commit/e898b5c8ba56c4d6f29a4d1f433baa1779a0845b) -Skip before executing command - -- [PR](https://github.com/evilmartians/lefthook/pull/94) Add option --keep-config. Thanks @justinasposiunas - -- [Commit](https://github.com/evilmartians/lefthook/commit/d79a3a46e7d1ee709b97e97f823bfd27e9466eff) -Check if shell is non interactive - -# 0.6.6 (2019-12-03) - -- [PR](https://github.com/evilmartians/lefthook/pull/94) Use eval instead of exec; Enable tty for the shell. Thanks @ssnickolay - -# 0.6.5 (2019-11-15) - -- [PR](https://github.com/evilmartians/lefthook/pull/89) Add support for git-worktree. Thanks @f440 - -- [Commit](https://github.com/evilmartians/lefthook/commit/48702a0806d2b2eab13636ba56b0e0b99f346f1c) -Commands and Scripts now can catch Stdin - -- [Commit](https://github.com/evilmartians/lefthook/commit/9a226842292ff1dda0f2273b66a0799988aa5289) -Add partial support for monorepos and command execution not from project root - -# 0.6.4 (2019-11-08) - -- [PR](https://github.com/evilmartians/lefthook/pull/84) Fix return value from shell exit. Thanks @HaiD84 - -- [PR](https://github.com/evilmartians/lefthook/pull/86) Support postinstall script for npm installation for monorepos. Thanks @sHooKDT - -- [PR](https://github.com/evilmartians/lefthook/pull/82) Now relative path to scripts supported. Thanks @AlexeyMatskevich - -- [Commit](https://github.com/evilmartians/lefthook/pull/80/commits/1a4b0ee155eb66ae6f3c365164012bee9332605a) -Option `extends` for top level config added. Now you can merge some settings from different places: -```yml -extends: $HOME/work/lefthook-extend.yml -``` - -- [Commit](https://github.com/evilmartians/lefthook/commit/83cf818106dbf222ea33ba86aafce8f30d7cb5a9) -Add examples to generated lefthook.yml - -## 0.6.3 (2019-07-15) - -- [Commit](https://github.com/evilmartians/lefthook/commit/0426936f48f248221126f15619932b0dc8c54d7a) Add `-a` means `aggressive` strategy for `install` command -```bash -lefthook install -a # clear .git/hooks dir and reinstall lefthook hooks -``` - -- [Commit](https://github.com/evilmartians/lefthook/commit/5efb0677a4a9ec1728d3cf1a083075e23315a796) Add Lefthook version indicator for commands and script execution - -- [Commit](https://github.com/evilmartians/lefthook/commit/8b55d91eed46643a1674bd4ad96fa211a177e159) Remove `npx` as dependency from node wrapper - -Now we will call directly binary from `./node_modules` - -- [Commit](https://github.com/evilmartians/lefthook/commit/76ffed4c698bc074984e91f5610c0b98784bd10b) Add `-f` means `force` strategy for `install` command - -```bash -lefthook install -f # reinstall lefthook hooks without sync info check -``` - -- PR [#27](https://github.com/evilmartians/lefthook/pull/27) Move LEFTHOOK env check in hooks files - -Now if LEFTHOOK=0 we will not call the binary file - -- PR [#26](https://github.com/evilmartians/lefthook/pull/26) + [commit](https://github.com/evilmartians/lefthook/commit/afd67f94631a10975209ed4c5fabc763f44280eb) Add `{push_files}` shortcut - -Add shortcut `{push_files}` - -``` -pre-commit: - commands: - rubocop: - run: rubocop {push_files} -``` -It same as: -``` -pre-commit: - commands: - rubocop: - files: git diff --name-only HEAD @{push} || git diff --name-only HEAD master - run: rubocop {push_files} -``` - -- [Commit](https://github.com/evilmartians/lefthook/commit/af087b032a14952aa1dd235a3d0b5a51bc760a10) Add `min_version` option - -You can mark your config for minimum Lefthook version: -``` -min_version: 0.6.1 -``` - -## 0.6.0 (2019-07-10) - -- PR [#24](https://github.com/palkan/logidze/pull/110) Wrap `run` command in shell context. - -Now in `run` option available `sh` syntax. - -``` -pre-commit: - commands: - bashed: - run: rubocop -a && git add -``` -Will be executed in this way: -``` -sh -c "rubocop -a && git add" -``` - -- PR [#23](https://github.com/evilmartians/lefthook/pull/24) Search Lefthook in Gemfile. - -Now it's possible to use Lefthook from Gemfile. - -```ruby -# Gemfile - -gem 'lefthook' -``` diff --git a/vendor/github.com/evilmartians/lefthook/CONTRIBUTING.md b/vendor/github.com/evilmartians/lefthook/CONTRIBUTING.md deleted file mode 100644 index 29c8cf0856..0000000000 --- a/vendor/github.com/evilmartians/lefthook/CONTRIBUTING.md +++ /dev/null @@ -1,14 +0,0 @@ -# Contributing - -First off, thanks for taking the time to contribute! Feel free to make Pull Request with your changes. - -# Requirements - -Go >= 1.20.0 - -# Process - -1. Fork repo -2. git clone -3. Make changes -4. Push your changes in diff --git a/vendor/github.com/evilmartians/lefthook/LICENSE b/vendor/github.com/evilmartians/lefthook/LICENSE deleted file mode 100644 index bf519ae206..0000000000 --- a/vendor/github.com/evilmartians/lefthook/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ - -The MIT License (MIT) - -Copyright (c) 2019 Arkweid - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/evilmartians/lefthook/Makefile b/vendor/github.com/evilmartians/lefthook/Makefile deleted file mode 100644 index 85075b3d0c..0000000000 --- a/vendor/github.com/evilmartians/lefthook/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -COMMIT_HASH = $(shell git rev-parse HEAD) - -build: - go build -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook - -build-with-coverage: - go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook - -install: build - cp lefthook $(GOPATH)/bin/ - -test: - go test -cpu 24 -race -count=1 -timeout=30s ./... - -test-integrity: install - go test -cpu 24 -race -count=1 -timeout=30s -tags=integrity integrity_test.go - -bench: - go test -cpu 24 -race -run=Bench -bench=. ./... - -bin/golangci-lint: - @test -x $$(go env GOPATH)/bin/golangci-lint || \ - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.50.1 - -lint: bin/golangci-lint - $$(go env GOPATH)/bin/golangci-lint run - -.ONESHELL: -version: - @read -p "New version: " version - sed -i "s/const version = .*/const version = \"$$version\"/" internal/version/version.go - sed -i "s/VERSION := .*/VERSION := $$version/" packaging/Makefile - make -C packaging clean set-version - git add internal/version/version.go packaging/* diff --git a/vendor/github.com/evilmartians/lefthook/README.md b/vendor/github.com/evilmartians/lefthook/README.md deleted file mode 100644 index c68dfdc38d..0000000000 --- a/vendor/github.com/evilmartians/lefthook/README.md +++ /dev/null @@ -1,228 +0,0 @@ -![Build Status](https://github.com/evilmartians/lefthook/actions/workflows/test.yml/badge.svg?branch=master) -[![Coverage Status](https://coveralls.io/repos/github/evilmartians/lefthook/badge.svg?branch=master)](https://coveralls.io/github/evilmartians/lefthook?branch=master) - -# Lefthook - -> The fastest polyglot Git hooks manager out there - - - -Fast and powerful Git hooks manager for Node.js, Ruby or any other type of projects. - -* **Fast.** It is written in Go. Can run commands in parallel. -* **Powerful.** It allows to control execution and files you pass to your commands. -* **Simple.** It is single dependency-free binary which can work in any environment. - -📖 [Read the introduction post](https://evilmartians.com/chronicles/lefthook-knock-your-teams-code-back-into-shape?utm_source=lefthook) - - -Sponsored by Evil Martians - -## Install - -With **Go** (>= 1.20): - -```bash -go install github.com/evilmartians/lefthook@latest -``` - -With **NPM**: - -```bash -npm install lefthook --save-dev -``` - -With **Ruby**: - -```bash -gem install lefthook -``` - -**[Installation guide](./docs/install.md)** with more different installation instructions. - -## Usage - -Lefthook is easy to use. Once you configure and setup you can forget that it even exists and rely on the magic underneath. - -See: - -- [**Usage**](./docs/usage.md) of **lefthook** CLI utility. -- [**Configuration**](./docs/configuration.md) details for `lefthook.yml` -- [**Wiki**](https://github.com/evilmartians/lefthook/wiki) for other information. -- [**Discussions**](https://github.com/evilmartians/lefthook/discussions) if you want to ask a question, suggest a feature, or report a bug. - -*** - -## Why Lefthook - -* ### **Parallel execution** -Gives you more speed. [Example](./docs/configuration.md#parallel) - -```yml -pre-push: - parallel: true -``` - -* ### **Flexible list of files** -If you want your own list. [Custom](./docs/configuration.md#files) and [prebuilt](./docs/configuration.md#run) examples. - -```yml -pre-commit: - commands: - frontend-linter: - run: yarn eslint {staged_files} - backend-linter: - run: bundle exec rubocop --force-exclusion {all_files} - frontend-style: - files: git diff --name-only HEAD @{push} - run: yarn stylelint {files} -``` - -* ### **Glob and regexp filters** -If you want to filter list of files. You could find more glob pattern examples [here](https://github.com/gobwas/glob#example). - -```yml -pre-commit: - commands: - backend-linter: - glob: "*.rb" # glob filter - exclude: "application.rb|routes.rb" # regexp filter - run: bundle exec rubocop --force-exclusion {all_files} -``` - -* ### **Execute in sub-directory** -If you want to execute the commands in a relative path - -```yml -pre-commit: - commands: - backend-linter: - root: "api/" # Careful to have only trailing slash - glob: "*.rb" # glob filter - run: bundle exec rubocop {all_files} -``` - -* ### **Run scripts** - -If oneline commands are not enough, you can execute files. [Example](./docs/configuration.md#script). - -```yml -commit-msg: - scripts: - "template_checker": - runner: bash -``` - -* ### **Tags** -If you want to control a group of commands. [Example](./docs/configuration.md#tags). - -```yml -pre-push: - commands: - packages-audit: - tags: frontend security - run: yarn audit - gems-audit: - tags: backend security - run: bundle audit -``` - -* ### **Support Docker** - -If you are in the Docker environment. [Example](./docs/configuration.md#cmd-template). - -```yml -pre-commit: - scripts: - "good_job.js": - runner: docker run -it --rm {cmd} -``` - -* ### **Local config** - -If you a frontend/backend developer and want to skip unnecessary commands or override something into Docker. [Description](./docs/usage.md#local-config). - -```yml -# lefthook-local.yml -pre-push: - exclude_tags: - - frontend - commands: - packages-audit: - skip: true -``` - -* ### **Direct control** - -If you want to run hooks group directly. - -```bash -$ lefthook run pre-commit -``` - -* ### **Your own tasks** - -If you want to run specific group of commands directly. - -```yml -fixer: - commands: - ruby-fixer: - run: bundle exec rubocop --force-exclusion --safe-auto-correct {staged_files} - js-fixer: - run: yarn eslint --fix {staged_files} -``` -```bash -$ lefthook run fixer -``` - -* ### **Optional output** - -If you [don't want to see](./docs/configuration.md#skip_output) supporting information: - -```yml -skip_output: - - meta #(version and which hook running) - - success #(output from runners with exit code 0) -``` - ---- - -## Table of contents: - -### Guides - -* [Install with Node.js](./docs/install.md#node) -* [Install with Ruby](./docs/install.md#ruby) -* [Install with Homebrew](./docs/install.md#homebrew) -* [Install for Debian-based Linux](./docs/install.md#deb) -* [Install for RPM-based Linux](./docs/install.md#rpm) -* [Install for Arch Linux](./docs/install.md#arch) -* [Usage](./docs/usage.md) -* [Configuration](./docs/configuration.md) -* [Troubleshooting](https://github.com/evilmartians/lefthook/wiki/Troubleshooting) - -### Migrate from -* [Husky](https://github.com/evilmartians/lefthook/wiki/Migration-from-husky) -* [Husky and lint-staged](https://github.com/evilmartians/lefthook/wiki/Migration-from-husky-with-lint-staged) -* [Overcommit](https://github.com/evilmartians/lefthook/wiki/Migration-from-overcommit) - -### Examples -* [Simple script](https://github.com/evilmartians/lefthook/tree/master/examples/with_scripts) -* [Full features](https://github.com/evilmartians/lefthook/tree/master/examples/complete) - -### Benchmarks -* [vs Overcommit](https://github.com/evilmartians/lefthook/wiki/Benchmark-lefthook-vs-overcommit) -* [vs pre-commit](https://github.com/evilmartians/lefthook/wiki/Benchmark-lefthook-vs-pre-commit) - -### Comparison list -* [vs Overcommit, Husky, pre-commit](https://github.com/evilmartians/lefthook/wiki/Comparison-with-other-solutions) - -### Articles -* [Lefthook: Knock your team’s code back into shape](https://evilmartians.com/chronicles/lefthook-knock-your-teams-code-back-into-shape?utm_source=lefthook) -* [Lefthook + Crystalball](https://evilmartians.com/chronicles/lefthook-crystalball-and-git-magic?utm_source=lefthook) -* [Keeping OSS documentation in check with docsify, Lefthook, and friends](https://evilmartians.com/chronicles/keeping-oss-documentation-in-check-with-docsify-lefthook-and-friends?utm_source=lefthook) -* [Automatically linting docker containers](https://dev.to/nitzano/linting-docker-containers-2lo6?utm_source=lefthook) -* [Smooth PostgreSQL upgrades in DockerDev environments with Lefthook](https://dev.to/palkan_tula/smooth-postgresql-upgrades-in-dockerdev-environments-with-lefthook-203k?utm_source=lefthook) -* [Lefthook for React/React Native apps](https://blog.logrocket.com/deep-dive-into-lefthook-react-native?utm_source=lefthook) diff --git a/vendor/github.com/evilmartians/lefthook/SECURITY.md b/vendor/github.com/evilmartians/lefthook/SECURITY.md deleted file mode 100644 index 0e37011811..0000000000 --- a/vendor/github.com/evilmartians/lefthook/SECURITY.md +++ /dev/null @@ -1,16 +0,0 @@ -# Security Policy - -## Supported Versions - -Latest major version of Lefthook is being supported with security updates. - -| Version | Supported | -| ------- | ------------------ | -| 1.x | :white_check_mark: | -| 0.x | :x: | - -## Reporting a Vulnerability - -If you have found a security issue in Lefthook, please **do not** create a new issue in the GitHub repository. Instead, please send an email to [lefthook@evilmartians.com](mailto:lefthook@evilmartians.com?subject=Lefthook%3A%20security%20issue) describing what the problem is and how to reproduce it. We will get in touch with you! - -Please note that Lefthook, as a CLI tool, executes arbitrary commands and scripts from its configuration file by design. This is intended behavior. Feel free to join the discussion on [issue #229](https://github.com/evilmartians/lefthook/issues/229). diff --git a/vendor/github.com/evilmartians/lefthook/cmd/add-doc.txt b/vendor/github.com/evilmartians/lefthook/cmd/add-doc.txt deleted file mode 100644 index fcc73c5f1f..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/add-doc.txt +++ /dev/null @@ -1,11 +0,0 @@ -This command will try to build the following structure in repository: -├───.git -│ └───hooks -│ └───pre-commit // this executable will be added. Existed file with -│ // same name will be renamed to pre-commit.old -(lefthook add this dirs if you run command with -d option) -│ -├───.lefthook // directory for project level hooks -│ └───pre-commit // directory with hooks executables -└───.lefthook-local // directory for personal hooks add it in .gitignore - └───pre-commit diff --git a/vendor/github.com/evilmartians/lefthook/cmd/add.go b/vendor/github.com/evilmartians/lefthook/cmd/add.go deleted file mode 100644 index fa8a662ec0..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/add.go +++ /dev/null @@ -1,37 +0,0 @@ -package cmd - -import ( - _ "embed" - - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -//go:embed add-doc.txt -var addDoc string - -func newAddCmd(opts *lefthook.Options) *cobra.Command { - args := lefthook.AddArgs{} - - addCmd := cobra.Command{ - Use: "add hook-name", - Short: "This command add a hook directory to a repository", - Long: addDoc, - Example: "lefthook add pre-commit", - Args: cobra.MinimumNArgs(1), - RunE: func(_cmd *cobra.Command, hooks []string) error { - args.Hook = hooks[0] - return lefthook.Add(opts, &args) - }, - } - - addCmd.Flags().BoolVarP( - &args.CreateDirs, "dirs", "d", false, "create directory for scripts", - ) - addCmd.Flags().BoolVarP( - &args.Force, "force", "f", false, "overwrite .old hooks", - ) - - return &addCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/dump.go b/vendor/github.com/evilmartians/lefthook/cmd/dump.go deleted file mode 100644 index 1dfbc02ea0..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/dump.go +++ /dev/null @@ -1,31 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -func newDumpCmd(opts *lefthook.Options) *cobra.Command { - dumpArgs := lefthook.DumpArgs{} - dumpCmd := cobra.Command{ - Use: "dump", - Short: "Prints config merged from all extensions (in YAML format by default)", - Example: "lefthook dump", - Run: func(cmd *cobra.Command, args []string) { - lefthook.Dump(opts, dumpArgs) - }, - } - - dumpCmd.Flags().BoolVarP( - &dumpArgs.JSON, "json", "j", false, - "dump in JSON format", - ) - - dumpCmd.Flags().BoolVarP( - &dumpArgs.TOML, "toml", "t", false, - "dump in TOML format", - ) - - return &dumpCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/install.go b/vendor/github.com/evilmartians/lefthook/cmd/install.go deleted file mode 100644 index 6863e415e8..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/install.go +++ /dev/null @@ -1,30 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -func newInstallCmd(opts *lefthook.Options) *cobra.Command { - args := lefthook.InstallArgs{} - - installCmd := cobra.Command{ - Use: "install", - Short: "Write basic configuration file in your project repository. Or initialize existed config", - RunE: func(cmd *cobra.Command, _args []string) error { - return lefthook.Install(opts, &args) - }, - } - - installCmd.Flags().BoolVarP( - &args.Force, "force", "f", false, - "reinstall hooks without checking config version", - ) - installCmd.Flags().BoolVarP( - &args.Aggressive, "aggressive", "a", false, - "remove all hooks from .git/hooks dir and install lefthook hooks", - ) - - return &installCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/lefthook.go b/vendor/github.com/evilmartians/lefthook/cmd/lefthook.go deleted file mode 100644 index b31b67446d..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/lefthook.go +++ /dev/null @@ -1,16 +0,0 @@ -package cmd - -import "github.com/evilmartians/lefthook/internal/log" - -func Lefthook() int { - rootCmd := newRootCmd() - - if err := rootCmd.Execute(); err != nil { - if err.Error() != "" { - log.Errorf("Error: %s", err) - } - return 1 - } - - return 0 -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/root.go b/vendor/github.com/evilmartians/lefthook/cmd/root.go deleted file mode 100644 index 12949eb1dc..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/root.go +++ /dev/null @@ -1,58 +0,0 @@ -package cmd - -import ( - "github.com/MakeNowJust/heredoc" - "github.com/spf13/afero" - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -var commands = [...]func(*lefthook.Options) *cobra.Command{ - newVersionCmd, - newAddCmd, - newInstallCmd, - newUninstallCmd, - newRunCmd, - newDumpCmd, -} - -func newRootCmd() *cobra.Command { - options := lefthook.Options{ - Fs: afero.NewOsFs(), - } - - rootCmd := &cobra.Command{ - Use: "lefthook", - Short: "CLI tool to manage Git hooks", - Long: heredoc.Doc(` - After installation go to your project directory - and execute the following command: - lefthook install - `), - SilenceUsage: true, - SilenceErrors: true, - } - - rootCmd.PersistentFlags().BoolVarP( - &options.Verbose, "verbose", "v", false, "verbose output", - ) - rootCmd.PersistentFlags().BoolVar( - &options.NoColors, "no-colors", false, "disable colored output", - ) - - rootCmd.Flags().BoolVarP( - &options.Force, "force", "f", false, - "DEPRECATED: reinstall hooks without checking config version", - ) - rootCmd.Flags().BoolVarP( - &options.Aggressive, "aggressive", "a", false, - "DEPRECATED: remove all hooks from .git/hooks dir and install lefthook hooks", - ) - - for _, subcommand := range commands { - rootCmd.AddCommand(subcommand(&options)) - } - - return rootCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/run.go b/vendor/github.com/evilmartians/lefthook/cmd/run.go deleted file mode 100644 index e896f481bd..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/run.go +++ /dev/null @@ -1,30 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -func newRunCmd(opts *lefthook.Options) *cobra.Command { - runArgs := lefthook.RunArgs{} - - runCmd := cobra.Command{ - Use: "run hook-name [git args...]", - Short: "Execute group of hooks", - Example: "lefthook run pre-commit", - Args: cobra.MinimumNArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - // args[0] - hook name - // args[1:] - git hook arguments, number and value depends on the hook - return lefthook.Run(opts, runArgs, args[0], args[1:]) - }, - } - - runCmd.Flags().BoolVarP( - &runArgs.NoTTY, "no-tty", "n", false, - "run hook non-interactively, disable spinner", - ) - - return &runCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/uninstall.go b/vendor/github.com/evilmartians/lefthook/cmd/uninstall.go deleted file mode 100644 index e1d67a256f..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/uninstall.go +++ /dev/null @@ -1,36 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" -) - -func newUninstallCmd(opts *lefthook.Options) *cobra.Command { - args := lefthook.UninstallArgs{} - - uninstallCmd := cobra.Command{ - Use: "uninstall", - Short: "Revert install command", - RunE: func(cmd *cobra.Command, _args []string) error { - return lefthook.Uninstall(opts, &args) - }, - } - - uninstallCmd.Flags().BoolVarP( - &args.Force, "aggressive", "a", false, - "DEPRECATED: will behave like -f/--force option", - ) - - uninstallCmd.Flags().BoolVarP( - &args.Force, "force", "f", false, - "remove all git hooks even not lefthook-related", - ) - - uninstallCmd.Flags().BoolVarP( - &args.RemoveConfig, "remove-configs", "c", false, - "remove lefthook.yml and lefthook-local.yml", - ) - - return &uninstallCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/cmd/version.go b/vendor/github.com/evilmartians/lefthook/cmd/version.go deleted file mode 100644 index bf475f595a..0000000000 --- a/vendor/github.com/evilmartians/lefthook/cmd/version.go +++ /dev/null @@ -1,28 +0,0 @@ -package cmd - -import ( - "github.com/spf13/cobra" - - "github.com/evilmartians/lefthook/internal/lefthook" - "github.com/evilmartians/lefthook/internal/log" - "github.com/evilmartians/lefthook/internal/version" -) - -func newVersionCmd(opts *lefthook.Options) *cobra.Command { - var verbose bool - - versionCmd := cobra.Command{ - Use: "version", - Short: "Show lefthook version", - Run: func(cmd *cobra.Command, args []string) { - log.Println(version.Version(verbose)) - }, - } - - versionCmd.Flags().BoolVarP( - &verbose, "full", "f", false, - "full version with commit hash", - ) - - return &versionCmd -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/available_hooks.go b/vendor/github.com/evilmartians/lefthook/internal/config/available_hooks.go deleted file mode 100644 index cdd46157ac..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/available_hooks.go +++ /dev/null @@ -1,58 +0,0 @@ -package config - -// ChecksumFileName - the file, which is used just to store the current config checksum version. -const ChecksumFileName = "lefthook.checksum" - -// GhostHookName - the hook which logs are not shown and which is used for synchronizing hooks. -const GhostHookName = "prepare-commit-msg" - -// AvailableHooks - list of hooks taken from https://git-scm.com/docs/githooks. -var AvailableHooks = [...]string{ - "pre-applypatch", - "applypatch-msg", - "post-applypatch", - "commit-msg", - "fsmonitor-watchman", - "p4-changelist", - "p4-post-changelist", - "p4-pre-submit", - "p4-prepare-changelist", - "pre-commit", - "post-commit", - "pre-receive", - "proc-receive", - "post-receive", - "post-merge", - "pre-rebase", - "rebase", - "update", - "post-update", - "post-rewrite", - "post-checkout", - "post-index-change", - "pre-auto-gc", - "pre-merge-commit", - "pre-push", - "prepare-commit-msg", - "push-to-checkout", - "reference-transaction", - "sendemail-validate", -} - -func HookUsesStagedFiles(hook string) bool { - return hook == "pre-commit" -} - -func HookUsesPushFiles(hook string) bool { - return hook == "pre-push" -} - -func HookAvailable(hook string) bool { - for _, name := range AvailableHooks { - if name == hook { - return true - } - } - - return false -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/command.go b/vendor/github.com/evilmartians/lefthook/internal/config/command.go deleted file mode 100644 index c671589c4b..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/command.go +++ /dev/null @@ -1,116 +0,0 @@ -package config - -import ( - "errors" - "strings" - - "github.com/spf13/viper" - - "github.com/evilmartians/lefthook/internal/git" -) - -var errFilesIncompatible = errors.New("One of your runners contains incompatible file types") - -type Command struct { - Run string `mapstructure:"run" yaml:"run" json:"run" toml:"run"` - - Skip interface{} `mapstructure:"skip" yaml:",omitempty" json:"skip,omitempty" toml:"skip,omitempty,inline"` - Only interface{} `mapstructure:"only" yaml:",omitempty" json:"only,omitempty" toml:"only,omitempty,inline"` - Tags []string `mapstructure:"tags" yaml:",omitempty" json:"tags,omitempty" toml:"tags,omitempty"` - Glob string `mapstructure:"glob" yaml:",omitempty" json:"glob,omitempty" toml:"glob,omitempty"` - Files string `mapstructure:"files" yaml:",omitempty" json:"files,omitempty" toml:"files,omitempty"` - Env map[string]string `mapstructure:"env" yaml:",omitempty" json:"env,omitempty" toml:"env,omitempty"` - - Root string `mapstructure:"root" yaml:",omitempty" json:"root,omitempty" toml:"root,omitempty"` - Exclude string `mapstructure:"exclude" yaml:",omitempty" json:"exclude,omitempty" toml:"exclude,omitempty"` - - FailText string `mapstructure:"fail_text" yaml:"fail_text,omitempty" json:"fail_text,omitempty" toml:"fail_text,omitempty"` - Interactive bool `mapstructure:"interactive" yaml:",omitempty" json:"interactive,omitempty" toml:"interactive,omitempty"` - StageFixed bool `mapstructure:"stage_fixed" yaml:"stage_fixed,omitempty" json:"stage_fixed,omitempty" toml:"stage_fixed,omitempty"` -} - -func (c Command) Validate() error { - if !isRunnerFilesCompatible(c.Run) { - return errFilesIncompatible - } - - return nil -} - -func (c Command) DoSkip(gitState git.State) bool { - return doSkip(gitState, c.Skip, c.Only) -} - -type commandRunReplace struct { - Run string `mapstructure:"run"` -} - -func mergeCommands(base, extra *viper.Viper) (map[string]*Command, error) { - if base == nil && extra == nil { - return nil, nil - } - - if base == nil { - return unmarshalCommands(extra.Sub("commands")) - } - - if extra == nil { - return unmarshalCommands(base.Sub("commands")) - } - - commandsOrigin := base.Sub("commands") - commandsOverride := extra.Sub("commands") - if commandsOrigin == nil { - return unmarshalCommands(commandsOverride) - } - if commandsOverride == nil { - return unmarshalCommands(commandsOrigin) - } - - runReplaces := make(map[string]*commandRunReplace) - for key := range commandsOrigin.AllSettings() { - var replace commandRunReplace - - substructure := commandsOrigin.Sub(key) - if substructure == nil { - continue - } - - if err := substructure.Unmarshal(&replace); err != nil { - return nil, err - } - - runReplaces[key] = &replace - } - - err := commandsOrigin.MergeConfigMap(commandsOverride.AllSettings()) - if err != nil { - return nil, err - } - - commands, err := unmarshalCommands(commandsOrigin) - if err != nil { - return nil, err - } - - for key, replace := range runReplaces { - if replace.Run != "" { - commands[key].Run = strings.ReplaceAll(commands[key].Run, CMD, replace.Run) - } - } - - return commands, nil -} - -func unmarshalCommands(v *viper.Viper) (map[string]*Command, error) { - if v == nil { - return nil, nil - } - - commands := make(map[string]*Command) - if err := v.Unmarshal(&commands); err != nil { - return nil, err - } - - return commands, nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/config.go b/vendor/github.com/evilmartians/lefthook/internal/config/config.go deleted file mode 100644 index 52fc5c8b3b..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/config.go +++ /dev/null @@ -1,95 +0,0 @@ -package config - -import ( - "encoding/json" - "os" - - "github.com/mitchellh/mapstructure" - toml "github.com/pelletier/go-toml/v2" - "gopkg.in/yaml.v3" - - "github.com/evilmartians/lefthook/internal/log" - "github.com/evilmartians/lefthook/internal/version" -) - -const dumpIndent = 2 - -type Config struct { - MinVersion string `mapstructure:"min_version,omitempty"` - SourceDir string `mapstructure:"source_dir"` - SourceDirLocal string `mapstructure:"source_dir_local"` - Rc string `mapstructure:"rc,omitempty"` - SkipOutput []string `mapstructure:"skip_output,omitempty"` - Extends []string `mapstructure:"extends,omitempty"` - NoTTY bool `mapstructure:"no_tty,omitempty"` - Colors interface{} `mapstructure:"colors,omitempty"` - Remote *Remote `mapstructure:"remote,omitempty" ` - - Hooks map[string]*Hook `mapstructure:"-"` -} - -func (c *Config) Validate() error { - return version.CheckCovered(c.MinVersion) -} - -func (c *Config) Dump(asJSON bool, asTOML bool) error { - res := make(map[string]interface{}) - if err := mapstructure.Decode(c, &res); err != nil { - return err - } - - if c.SourceDir == DefaultSourceDir { - delete(res, "source_dir") - } - if c.SourceDirLocal == DefaultSourceDirLocal { - delete(res, "source_dir_local") - } - - for hookName, hook := range c.Hooks { - res[hookName] = hook - } - - if asJSON { - return dumpJSON(res) - } - - if asTOML { - return dumpTOML(res) - } - - return dumpYAML(res) -} - -func dumpYAML(input map[string]interface{}) error { - encoder := yaml.NewEncoder(os.Stdout) - encoder.SetIndent(dumpIndent) - defer encoder.Close() - - err := encoder.Encode(input) - if err != nil { - return err - } - - return nil -} - -func dumpJSON(input map[string]interface{}) error { - res, err := json.MarshalIndent(input, "", " ") - if err != nil { - return err - } - - log.Info(string(res)) - - return nil -} - -func dumpTOML(input map[string]interface{}) error { - encoder := toml.NewEncoder(os.Stdout) - err := encoder.Encode(input) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/files.go b/vendor/github.com/evilmartians/lefthook/internal/config/files.go deleted file mode 100644 index ba9f1da565..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/files.go +++ /dev/null @@ -1,17 +0,0 @@ -package config - -import "strings" - -const ( - SubFiles string = "{files}" - SubAllFiles string = "{all_files}" - SubStagedFiles string = "{staged_files}" - PushFiles string = "{push_files}" -) - -func isRunnerFilesCompatible(runner string) bool { - if strings.Contains(runner, SubStagedFiles) && strings.Contains(runner, PushFiles) { - return false - } - return true -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/hook.go b/vendor/github.com/evilmartians/lefthook/internal/config/hook.go deleted file mode 100644 index fcb092a450..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/hook.go +++ /dev/null @@ -1,86 +0,0 @@ -package config - -import ( - "errors" - "os" - "strings" - - "github.com/spf13/viper" - - "github.com/evilmartians/lefthook/internal/git" -) - -const CMD = "{cmd}" - -var errPipedAndParallelSet = errors.New("conflicting options 'piped' and 'parallel' are set to 'true', remove one of this option from hook group") - -type Hook struct { - // Should be unmarshalled with `mapstructure:"commands"` - // But replacing '{cmd}' is still an issue - // Unmarshaling it manually, so omit auto unmarshaling - Commands map[string]*Command `mapstructure:"-" yaml:",omitempty" json:"commands,omitempty" toml:"commands,omitempty"` - - // Should be unmarshalled with `mapstructure:"scripts"` - // But parsing keys with dots in it is still an issue: https://github.com/spf13/viper/issues/324 - // Unmarshaling it manually, so omit auto unmarshaling - Scripts map[string]*Script `mapstructure:"-" yaml:",omitempty" json:"scripts,omitempty" toml:"scripts,omitempty"` - - Files string `mapstructure:"files" yaml:",omitempty" json:"files,omitempty" toml:"files,omitempty"` - Parallel bool `mapstructure:"parallel" yaml:",omitempty" json:"parallel,omitempty" toml:"parallel,omitempty"` - Piped bool `mapstructure:"piped" yaml:",omitempty" json:"piped,omitempty" toml:"piped,omitempty"` - Follow bool `mapstructure:"follow" yaml:",omitempty" json:"follow,omitempty" toml:"follow,omitempty"` - ExcludeTags []string `mapstructure:"exclude_tags" yaml:"exclude_tags,omitempty" json:"exclude_tags,omitempty" toml:"exclude_tags,omitempty"` - Skip interface{} `mapstructure:"skip" yaml:",omitempty" json:"skip,omitempty" toml:"skip,omitempty,inline"` - Only interface{} `mapstructure:"only" yaml:",omitempty" json:"only,omitempty" toml:"only,omitempty,inline"` -} - -func (h *Hook) Validate() error { - if h.Parallel && h.Piped { - return errPipedAndParallelSet - } - - return nil -} - -func (h *Hook) DoSkip(gitState git.State) bool { - return doSkip(gitState, h.Skip, h.Only) -} - -func unmarshalHooks(base, extra *viper.Viper) (*Hook, error) { - if base == nil && extra == nil { - return nil, nil - } - - commands, err := mergeCommands(base, extra) - if err != nil { - return nil, err - } - - scripts, err := mergeScripts(base, extra) - if err != nil { - return nil, err - } - - hook := Hook{ - Commands: commands, - Scripts: scripts, - } - - if base == nil { - base = extra - } else if extra != nil { - if err = base.MergeConfigMap(extra.AllSettings()); err != nil { - return nil, err - } - } - - if err := base.Unmarshal(&hook); err != nil { - return nil, err - } - - if tags := os.Getenv("LEFTHOOK_EXCLUDE"); tags != "" { - hook.ExcludeTags = append(hook.ExcludeTags, strings.Split(tags, ",")...) - } - - return &hook, nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/load.go b/vendor/github.com/evilmartians/lefthook/internal/config/load.go deleted file mode 100644 index ae9ea4aa42..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/load.go +++ /dev/null @@ -1,231 +0,0 @@ -package config - -import ( - "errors" - "fmt" - "path/filepath" - "regexp" - "strings" - - "github.com/spf13/afero" - "github.com/spf13/viper" - - "github.com/evilmartians/lefthook/internal/git" - "github.com/evilmartians/lefthook/internal/log" -) - -const ( - DefaultConfigName = "lefthook.yml" - DefaultSourceDir = ".lefthook" - DefaultSourceDirLocal = ".lefthook-local" -) - -var hookKeyRegexp = regexp.MustCompile(`^(?P[^.]+)\.(scripts|commands)`) - -// NotFoundError wraps viper.ConfigFileNotFoundError for lefthook. -type NotFoundError struct { - message string -} - -// Error returns message of viper.ConfigFileNotFoundError. -func (err NotFoundError) Error() string { - return err.message -} - -// Loads configs from the given directory with extensions. -func Load(fs afero.Fs, repo *git.Repository) (*Config, error) { - global, err := read(fs, repo.RootPath, "lefthook") - if err != nil { - var notFoundErr viper.ConfigFileNotFoundError - if ok := errors.As(err, ¬FoundErr); ok { - return nil, NotFoundError{err.Error()} - } - - return nil, err - } - - extends, err := mergeAll(fs, repo) - if err != nil { - return nil, err - } - - var config Config - - config.SourceDir = DefaultSourceDir - config.SourceDirLocal = DefaultSourceDirLocal - - err = unmarshalConfigs(global, extends, &config) - if err != nil { - return nil, err - } - - log.SetColors(config.Colors) - return &config, nil -} - -func read(fs afero.Fs, path string, name string) (*viper.Viper, error) { - v := viper.New() - v.SetFs(fs) - v.AddConfigPath(path) - v.SetConfigName(name) - - // Allow overwriting settings with ENV variables - v.SetEnvPrefix("LEFTHOOK") - v.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) - v.AutomaticEnv() - - if err := v.ReadInConfig(); err != nil { - return nil, err - } - - return v, nil -} - -// mergeAll merges remotes and extends from .lefthook and .lefthook-local. -func mergeAll(fs afero.Fs, repo *git.Repository) (*viper.Viper, error) { - extends, err := read(fs, repo.RootPath, "lefthook") - if err != nil { - return nil, err - } - - if err := extend(extends, repo.RootPath); err != nil { - return nil, err - } - - if err := mergeRemote(fs, repo, extends); err != nil { - return nil, err - } - - if err := merge("lefthook-local", "", extends); err == nil { - if err = extend(extends, repo.RootPath); err != nil { - return nil, err - } - } else { - var notFoundErr viper.ConfigFileNotFoundError - if ok := errors.As(err, ¬FoundErr); !ok { - return nil, err - } - } - - return extends, nil -} - -// mergeRemote merges remote config to the current one. -func mergeRemote(fs afero.Fs, repo *git.Repository, v *viper.Viper) error { - var remote Remote - err := v.UnmarshalKey("remote", &remote) - if err != nil { - return err - } - - if !remote.Configured() { - return nil - } - - remotePath := repo.RemoteFolder(remote.GitURL) - configFile := DefaultConfigName - if len(remote.Config) > 0 { - configFile = remote.Config - } - configPath := filepath.Join(remotePath, configFile) - - log.Debugf("Merging remote config: %s", configPath) - - _, err = fs.Stat(configPath) - if err != nil { - return nil - } - - if err := merge("remote", configPath, v); err != nil { - return err - } - - if err := extend(v, filepath.Dir(configPath)); err != nil { - return err - } - - return nil -} - -// extend merges all files listed in 'extends' option into the config. -func extend(v *viper.Viper, root string) error { - for i, path := range v.GetStringSlice("extends") { - if !filepath.IsAbs(path) { - path = filepath.Join(root, path) - } - if err := merge(fmt.Sprintf("extend_%d", i), path, v); err != nil { - return err - } - } - return nil -} - -// merge merges the configuration using viper builtin MergeInConfig. -func merge(name, path string, v *viper.Viper) error { - v.SetConfigName(name) - if len(path) > 0 { - v.SetConfigFile(path) - } - if err := v.MergeInConfig(); err != nil { - return err - } - - return nil -} - -func unmarshalConfigs(base, extra *viper.Viper, c *Config) error { - c.Hooks = make(map[string]*Hook) - - for _, hookName := range AvailableHooks { - if err := addHook(hookName, base, extra, c); err != nil { - return err - } - } - - // For extra non-git hooks. - // This behavior may be deprecated in next versions. - // Notice that with append we're allowing extra hooks to be added in local config - for _, maybeHook := range append(base.AllKeys(), extra.AllKeys()...) { - if !hookKeyRegexp.MatchString(maybeHook) { - continue - } - - matches := hookKeyRegexp.FindStringSubmatch(maybeHook) - hookName := matches[hookKeyRegexp.SubexpIndex("hookName")] - if _, ok := c.Hooks[hookName]; ok { - continue - } - - if err := addHook(hookName, base, extra, c); err != nil { - return err - } - } - - // Merge config and unmarshal it - if err := base.MergeConfigMap(extra.AllSettings()); err != nil { - return err - } - if err := base.Unmarshal(c); err != nil { - return err - } - - return nil -} - -func addHook(hookName string, base, extra *viper.Viper, c *Config) error { - baseHook := base.Sub(hookName) - extraHook := extra.Sub(hookName) - - resultHook, err := unmarshalHooks(baseHook, extraHook) - if err != nil { - return err - } - - if resultHook == nil { - return nil - } - - c.Hooks[hookName] = resultHook - - return nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/remote.go b/vendor/github.com/evilmartians/lefthook/internal/config/remote.go deleted file mode 100644 index b81555294d..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/remote.go +++ /dev/null @@ -1,15 +0,0 @@ -package config - -type Remote struct { - GitURL string `mapstructure:"git_url" yaml:"git_url" json:"git_url,omitempty" toml:"git_url"` - Ref string `mapstructure:"ref,omitempty" yaml:",omitempty" json:"ref,omitempty" toml:"ref,omitempty"` - Config string `mapstructure:"config,omitempty" yaml:",omitempty" json:"config,omitempty" toml:"config,omitempty"` -} - -func (r *Remote) Configured() bool { - if r == nil { - return false - } - - return len(r.GitURL) > 0 -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/script.go b/vendor/github.com/evilmartians/lefthook/internal/config/script.go deleted file mode 100644 index 3cad3604bf..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/script.go +++ /dev/null @@ -1,136 +0,0 @@ -package config - -import ( - "strings" - - "github.com/mitchellh/mapstructure" - "github.com/spf13/viper" - - "github.com/evilmartians/lefthook/internal/git" -) - -type Script struct { - Runner string `mapstructure:"runner" yaml:"runner" json:"runner" toml:"runner"` - - Skip interface{} `mapstructure:"skip" yaml:",omitempty" json:"skip,omitempty" toml:"skip,omitempty,inline"` - Only interface{} `mapstructure:"only" yaml:",omitempty" json:"only,omitempty" toml:"only,omitempty,inline"` - Tags []string `mapstructure:"tags" yaml:",omitempty" json:"tags,omitempty" toml:"tags,omitempty"` - Env map[string]string `mapstructure:"env" yaml:",omitempty" json:"env,omitempty" toml:"env,omitempty"` - - FailText string `mapstructure:"fail_text" yaml:"fail_text,omitempty" json:"fail_text,omitempty" toml:"fail_text,omitempty"` - Interactive bool `mapstructure:"interactive" yaml:",omitempty" json:"interactive,omitempty" toml:"interactive,omitempty"` - StageFixed bool `mapstructure:"stage_fixed" yaml:"stage_fixed,omitempty" json:"stage_fixed,omitempty" toml:"stage_fixed,omitempty"` -} - -func (s Script) DoSkip(gitState git.State) bool { - return doSkip(gitState, s.Skip, s.Only) -} - -type scriptRunnerReplace struct { - Runner string `mapstructure:"runner"` -} - -func mergeScripts(base, extra *viper.Viper) (map[string]*Script, error) { - if base == nil && extra == nil { - return nil, nil - } - - if base == nil { - return unmarshalScripts(extra.GetStringMap("scripts")) - } - - if extra == nil { - return unmarshalScripts(base.GetStringMap("scripts")) - } - - scriptsOrigin := base.GetStringMap("scripts") - scriptsOverride := extra.GetStringMap("scripts") - if scriptsOrigin == nil { - return unmarshalScripts(scriptsOverride) - } - if scriptsOverride == nil { - return unmarshalScripts(scriptsOrigin) - } - - runReplaces := make(map[string]*scriptRunnerReplace) - for key, originConfig := range scriptsOrigin { - var runReplace scriptRunnerReplace - - if err := unmarshal(originConfig, &runReplace); err != nil { - return nil, err - } - - runReplaces[key] = &runReplace - } - - err := base.MergeConfigMap(map[string]interface{}{ - "scripts": scriptsOverride, - }) - if err != nil { - return nil, err - } - - scripts, err := unmarshalScripts(base.GetStringMap("scripts")) - if err != nil { - return nil, err - } - - for key, replace := range runReplaces { - if replace.Runner != "" { - scripts[key].Runner = strings.ReplaceAll(scripts[key].Runner, CMD, replace.Runner) - } - } - - return scripts, nil -} - -func unmarshalScripts(s map[string]interface{}) (map[string]*Script, error) { - if len(s) == 0 { - return nil, nil - } - - scripts := make(map[string]*Script) - for name, scriptConfig := range s { - var script Script - - if err := unmarshal(scriptConfig, &script); err != nil { - return nil, err - } - - scripts[name] = &script - } - - return scripts, nil -} - -// `scripts` are unmarshalled manually because viper -// uses "." as a key delimiter. So, this definition: -// -// ```yaml -// scripts: -// -// "example.sh": -// runner: bash -// -// ``` -// -// Unmarshals into this: -// -// ```yaml -// scripts: -// -// example: -// sh: -// runner: bash -// -// ``` -// -// This is not an expected behavior and cannot be controlled yet -// Working with GetStringMap is the only way to get the structure "as is". -func unmarshal(input, output interface{}) error { - if err := mapstructure.WeakDecode(input, &output); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/config/skip.go b/vendor/github.com/evilmartians/lefthook/internal/config/skip.go deleted file mode 100644 index 9b52f3bdc7..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/config/skip.go +++ /dev/null @@ -1,50 +0,0 @@ -package config - -import ( - "github.com/gobwas/glob" - - "github.com/evilmartians/lefthook/internal/git" -) - -func doSkip(gitState git.State, skip, only interface{}) bool { - if skip != nil { - if matches(gitState, skip) { - return true - } - } - - if only != nil { - return !matches(gitState, only) - } - - return false -} - -func matches(gitState git.State, value interface{}) bool { - switch typedValue := value.(type) { - case bool: - return typedValue - case string: - return typedValue == gitState.Step - case []interface{}: - for _, state := range typedValue { - switch typedState := state.(type) { - case string: - if typedState == gitState.Step { - return true - } - case map[string]interface{}: - ref := typedState["ref"].(string) - if ref == gitState.Branch { - return true - } - - g := glob.MustCompile(ref) - if g.Match(gitState.Branch) { - return true - } - } - } - } - return false -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/git/exec.go b/vendor/github.com/evilmartians/lefthook/internal/git/exec.go deleted file mode 100644 index 45fd06de0a..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/git/exec.go +++ /dev/null @@ -1,81 +0,0 @@ -package git - -import ( - "os" - "os/exec" - "runtime" - "strings" - - "github.com/evilmartians/lefthook/internal/log" -) - -type Exec interface { - Cmd(cmd string) (string, error) - CmdArgs(args ...string) (string, error) - CmdLines(cmd string) ([]string, error) - RawCmd(cmd string) (string, error) -} - -type OsExec struct{} - -// NewOsExec returns an object that executes given commands -// in the OS. -func NewOsExec() *OsExec { - return &OsExec{} -} - -// Cmd runs plain string command. Trims spaces around output. -func (o *OsExec) Cmd(cmd string) (string, error) { - args := strings.Split(cmd, " ") - return o.CmdArgs(args...) -} - -// CmdLines runs plain string command, returns its output split by newline. -func (o *OsExec) CmdLines(cmd string) ([]string, error) { - out, err := o.RawCmd(cmd) - if err != nil { - return nil, err - } - - return strings.Split(out, "\n"), nil -} - -// CmdArgs runs a command provided with separted words. Trims spaces around output. -func (o *OsExec) CmdArgs(args ...string) (string, error) { - out, err := o.rawExecArgs(args...) - if err != nil { - return "", err - } - - return strings.TrimSpace(out), nil -} - -// RawCmd runs a plain string command returning unprocessed output as string. -func (o *OsExec) RawCmd(cmd string) (string, error) { - var args []string - if runtime.GOOS == "windows" { - args = strings.Split(cmd, " ") - } else { - args = []string{"sh", "-c", cmd} - } - - return o.rawExecArgs(args...) -} - -// rawExecArgs executes git command with LEFTHOOK=0 in order -// to prevent calling subsequent lefthook hooks. -func (o *OsExec) rawExecArgs(args ...string) (string, error) { - log.Debug("[lefthook] cmd: ", args) - - cmd := exec.Command(args[0], args[1:]...) - cmd.Env = append(os.Environ(), "LEFTHOOK=0") - - out, err := cmd.CombinedOutput() - log.Debug("[lefthook] err: ", err) - log.Debug("[lefthook] out: ", string(out)) - if err != nil { - return "", err - } - - return string(out), nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/git/lfs.go b/vendor/github.com/evilmartians/lefthook/internal/git/lfs.go deleted file mode 100644 index 142e8bf823..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/git/lfs.go +++ /dev/null @@ -1,35 +0,0 @@ -package git - -import ( - "os/exec" -) - -const ( - LFSRequiredFile = ".lfs-required" - LFSConfigFile = ".lfsconfig" -) - -var lfsHooks = [...]string{ - "post-checkout", - "post-commit", - "post-merge", - "pre-push", -} - -// IsLFSAvailable returns 'true' if git-lfs is installed. -func IsLFSAvailable() bool { - _, err := exec.LookPath("git-lfs") - - return err == nil -} - -// IsLFSHook returns whether the hookName is supported by Git LFS. -func IsLFSHook(hookName string) bool { - for _, lfsHookName := range lfsHooks { - if lfsHookName == hookName { - return true - } - } - - return false -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/git/remote.go b/vendor/github.com/evilmartians/lefthook/internal/git/remote.go deleted file mode 100644 index 11c31e1e61..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/git/remote.go +++ /dev/null @@ -1,110 +0,0 @@ -package git - -import ( - "errors" - "os" - "path/filepath" - "strings" - - "github.com/evilmartians/lefthook/internal/log" -) - -const ( - remotesFolder = "lefthook-remotes" - remotesFolderMode = 0o755 -) - -// RemoteFolder returns the path to the folder where the remote -// repository is located. -func (r *Repository) RemoteFolder(url string) string { - return filepath.Join( - r.RemotesFolder(), - filepath.Base( - strings.TrimSuffix(url, filepath.Ext(url)), - ), - ) -} - -// RemotesFolder returns the path to the lefthook remotes folder. -func (r *Repository) RemotesFolder() string { - return filepath.Join(r.InfoPath, remotesFolder) -} - -// SyncRemote clones or pulls the latest changes for a git repository that was -// specified as a remote config repository. If successful, the path to the root -// of the repository will be returned. -func (r *Repository) SyncRemote(url, ref string) error { - remotesPath := filepath.Join(r.InfoPath, remotesFolder) - - err := r.Fs.MkdirAll(remotesPath, remotesFolderMode) - if err != nil && !errors.Is(err, os.ErrExist) { - return err - } - - remotePath := filepath.Join( - remotesPath, - filepath.Base( - strings.TrimSuffix(url, filepath.Ext(url)), - ), - ) - - _, err = r.Fs.Stat(remotePath) - if err == nil { - if err := r.updateRemote(remotePath, ref); err != nil { - return err - } - - return nil - } - - if err := r.cloneRemote(remotesPath, url, ref); err != nil { - return err - } - - return nil -} - -func (r *Repository) updateRemote(path, ref string) error { - log.Debugf("Updating remote config repository: %s", path) - - if len(ref) != 0 { - _, err := r.Git.CmdArgs( - "git", "-C", path, "fetch", "--quiet", "--depth", "1", - "origin", ref, - ) - if err != nil { - return err - } - - _, err = r.Git.CmdArgs( - "git", "-C", path, "checkout", "FETCH_HEAD", - ) - if err != nil { - return err - } - } else { - _, err := r.Git.CmdArgs("git", "-C", path, "pull", "--quiet") - if err != nil { - return err - } - } - - return nil -} - -func (r *Repository) cloneRemote(path, url, ref string) error { - log.Debugf("Cloning remote config repository: %v", path) - - cmdClone := []string{"git", "-C", path, "clone", "--quiet", "--depth", "1"} - if len(ref) > 0 { - cmdClone = append(cmdClone, "--branch", ref) - } - cmdClone = append(cmdClone, url) - - _, err := r.Git.CmdArgs(cmdClone...) - if err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/git/repository.go b/vendor/github.com/evilmartians/lefthook/internal/git/repository.go deleted file mode 100644 index 224ce91c13..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/git/repository.go +++ /dev/null @@ -1,328 +0,0 @@ -package git - -import ( - "fmt" - "os" - "path/filepath" - "regexp" - "strings" - - "github.com/spf13/afero" -) - -const ( - cmdRootPath = "git rev-parse --show-toplevel" - cmdHooksPath = "git rev-parse --git-path hooks" - cmdInfoPath = "git rev-parse --git-path info" - cmdGitPath = "git rev-parse --git-dir" - cmdStagedFiles = "git diff --name-only --cached --diff-filter=ACMR" - cmdAllFiles = "git ls-files --cached" - cmdPushFilesBase = "git diff --name-only HEAD @{push}" - cmdPushFilesHead = "git diff --name-only HEAD %s" - cmdStatusShort = "git status --short" - cmdCreateStash = "git stash create" - cmdListStash = "git stash list" - - stashMessage = "lefthook auto backup" - unstagedPatchName = "lefthook-unstaged.patch" - infoDirMode = 0o775 - minStatusLen = 3 -) - -var headBranchRegexp = regexp.MustCompile(`HEAD -> (?P.*)$`) - -// Repository represents a git repository. -type Repository struct { - Fs afero.Fs - Git Exec - HooksPath string - RootPath string - GitPath string - InfoPath string - unstagedPatchPath string - headBranch string -} - -// NewRepository returns a Repository or an error, if git repository it not initialized. -func NewRepository(fs afero.Fs, git Exec) (*Repository, error) { - rootPath, err := git.Cmd(cmdRootPath) - if err != nil { - return nil, err - } - - hooksPath, err := git.Cmd(cmdHooksPath) - if err != nil { - return nil, err - } - if exists, _ := afero.DirExists(fs, filepath.Join(rootPath, hooksPath)); exists { - hooksPath = filepath.Join(rootPath, hooksPath) - } - - infoPath, err := git.Cmd(cmdInfoPath) - if err != nil { - return nil, err - } - infoPath = filepath.Clean(infoPath) - if exists, _ := afero.DirExists(fs, infoPath); !exists { - err = fs.Mkdir(infoPath, infoDirMode) - if err != nil { - return nil, err - } - } - - gitPath, err := git.Cmd(cmdGitPath) - if err != nil { - return nil, err - } - if !filepath.IsAbs(gitPath) { - gitPath = filepath.Join(rootPath, gitPath) - } - - return &Repository{ - Fs: fs, - Git: git, - HooksPath: hooksPath, - RootPath: rootPath, - GitPath: gitPath, - InfoPath: infoPath, - unstagedPatchPath: filepath.Join(infoPath, unstagedPatchName), - }, nil -} - -// StagedFiles returns a list of staged files -// or an error if git command fails. -func (r *Repository) StagedFiles() ([]string, error) { - return r.FilesByCommand(cmdStagedFiles) -} - -// StagedFiles returns a list of all files in repository -// or an error if git command fails. -func (r *Repository) AllFiles() ([]string, error) { - return r.FilesByCommand(cmdAllFiles) -} - -// PushFiles returns a list of files that are ready to be pushed -// or an error if git command fails. -func (r *Repository) PushFiles() ([]string, error) { - res, err := r.FilesByCommand(cmdPushFilesBase) - if err == nil { - return res, nil - } - - if len(r.headBranch) == 0 { - branches, err := r.Git.CmdLines("git branch --remotes") - if err != nil { - return nil, err - } - for _, branch := range branches { - if !headBranchRegexp.MatchString(branch) { - continue - } - - matches := headBranchRegexp.FindStringSubmatch(branch) - r.headBranch = matches[headBranchRegexp.SubexpIndex("name")] - break - } - } - return r.FilesByCommand(fmt.Sprintf(cmdPushFilesHead, r.headBranch)) -} - -// PartiallyStagedFiles returns the list of files that have both staged and -// unstaged changes. -// See https://git-scm.com/docs/git-status#_short_format. -func (r *Repository) PartiallyStagedFiles() ([]string, error) { - lines, err := r.Git.CmdLines(cmdStatusShort) - if err != nil { - return []string{}, err - } - - partiallyStaged := make([]string, 0) - - for _, line := range lines { - if len(line) < minStatusLen { - continue - } - - index := line[0] - workingTree := line[1] - - filename := line[3:] - idx := strings.Index(filename, "->") - if idx != -1 { - filename = filename[idx+3:] - } - - if index != ' ' && index != '?' && workingTree != ' ' && workingTree != '?' && len(filename) > 0 { - partiallyStaged = append(partiallyStaged, filename) - } - } - - return partiallyStaged, nil -} - -func (r *Repository) SaveUnstaged(files []string) error { - _, err := r.Git.CmdArgs( - append([]string{ - "git", - "diff", - "--binary", // support binary files - "--unified=0", // do not add lines around diff for consistent behavior - "--no-color", // disable colors for consistent behavior - "--no-ext-diff", // disable external diff tools for consistent behavior - "--src-prefix=a/", // force prefix for consistent behavior - "--dst-prefix=b/", // force prefix for consistent behavior - "--patch", // output a patch that can be applied - "--submodule=short", // always use the default short format for submodules - "--output", - r.unstagedPatchPath, - "--", - }, files...)..., - ) - - return err -} - -func (r *Repository) HideUnstaged(files []string) error { - _, err := r.Git.CmdArgs( - append([]string{ - "git", - "checkout", - "--force", - "--", - }, files...)..., - ) - - return err -} - -func (r *Repository) RestoreUnstaged() error { - if ok, _ := afero.Exists(r.Fs, r.unstagedPatchPath); !ok { - return nil - } - - _, err := r.Git.CmdArgs( - "git", - "apply", - "-v", - "--whitespace=nowarn", - "--recount", - "--unidiff-zero", - r.unstagedPatchPath, - ) - - if err == nil { - err = r.Fs.Remove(r.unstagedPatchPath) - } - - return err -} - -func (r *Repository) StashUnstaged() error { - stashHash, err := r.Git.Cmd(cmdCreateStash) - if err != nil { - return err - } - - _, err = r.Git.CmdArgs( - "git", - "stash", - "store", - "--quiet", - "--message", - stashMessage, - stashHash, - ) - if err != nil { - return err - } - - return nil -} - -func (r *Repository) DropUnstagedStash() error { - lines, err := r.Git.CmdLines(cmdListStash) - if err != nil { - return err - } - - stashRegexp := regexp.MustCompile(`^(?P[^ ]+):\s*` + stashMessage) - for i := range lines { - line := lines[len(lines)-i-1] - matches := stashRegexp.FindStringSubmatch(line) - if len(matches) == 0 { - continue - } - - stashID := stashRegexp.SubexpIndex("stash") - - if len(matches[stashID]) > 0 { - _, err := r.Git.CmdArgs( - "git", - "stash", - "drop", - "--quiet", - matches[stashID], - ) - if err != nil { - return err - } - } - } - - return nil -} - -func (r *Repository) AddFiles(files []string) error { - if len(files) == 0 { - return nil - } - - _, err := r.Git.CmdArgs( - append([]string{"git", "add"}, files...)..., - ) - - return err -} - -// FilesByCommand accepts git command and returns its result as a list of filepaths. -func (r *Repository) FilesByCommand(command string) ([]string, error) { - lines, err := r.Git.CmdLines(command) - if err != nil { - return nil, err - } - - return r.extractFiles(lines) -} - -func (r *Repository) extractFiles(lines []string) ([]string, error) { - var files []string - - for _, line := range lines { - file := strings.TrimSpace(line) - if len(file) == 0 { - continue - } - - isFile, err := r.isFile(file) - if err != nil { - return nil, err - } - if isFile { - files = append(files, file) - } - } - - return files, nil -} - -func (r *Repository) isFile(path string) (bool, error) { - stat, err := r.Fs.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return false, nil - } - return false, err - } - - return !stat.IsDir(), nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/git/state.go b/vendor/github.com/evilmartians/lefthook/internal/git/state.go deleted file mode 100644 index 69d6dfbfd7..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/git/state.go +++ /dev/null @@ -1,83 +0,0 @@ -package git - -import ( - "bufio" - "os" - "path/filepath" - "regexp" -) - -type State struct { - Branch, Step string -} - -const ( - NilStep string = "" - MergeStep string = "merge" - RebaseStep string = "rebase" -) - -var refBranchRegexp = regexp.MustCompile(`^ref:\s*refs/heads/(.+)$`) - -func (r *Repository) State() State { - branch := r.Branch() - if r.isMergeState() { - return State{ - Branch: branch, - Step: MergeStep, - } - } - if r.isRebaseState() { - return State{ - Branch: branch, - Step: RebaseStep, - } - } - return State{ - Branch: branch, - Step: NilStep, - } -} - -func (r *Repository) Branch() string { - headFile := filepath.Join(r.GitPath, "HEAD") - if _, err := r.Fs.Stat(headFile); os.IsNotExist(err) { - return "" - } - - file, err := r.Fs.Open(headFile) - if err != nil { - return "" - } - defer file.Close() - - scanner := bufio.NewScanner(file) - scanner.Split(bufio.ScanLines) - - for scanner.Scan() { - match := refBranchRegexp.FindStringSubmatch(scanner.Text()) - - if len(match) > 1 { - return match[1] - } - } - - return "" -} - -func (r *Repository) isMergeState() bool { - if _, err := r.Fs.Stat(filepath.Join(r.GitPath, "MERGE_HEAD")); os.IsNotExist(err) { - return false - } - return true -} - -func (r *Repository) isRebaseState() bool { - if _, mergeErr := r.Fs.Stat(filepath.Join(r.GitPath, "rebase-merge")); os.IsNotExist(mergeErr) { - if _, applyErr := r.Fs.Stat(filepath.Join(r.GitPath, "rebase-apply")); os.IsNotExist(applyErr) { - return false - } - } - - return true -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/add.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/add.go deleted file mode 100644 index adbe1d9eb5..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/add.go +++ /dev/null @@ -1,79 +0,0 @@ -package lefthook - -import ( - "fmt" - "path/filepath" - - "github.com/evilmartians/lefthook/internal/config" -) - -const defaultDirMode = 0o755 - -type AddArgs struct { - Hook string - - CreateDirs, Force bool -} - -func Add(opts *Options, args *AddArgs) error { - lefthook, err := initialize(opts) - if err != nil { - return err - } - - return lefthook.Add(args) -} - -// Creates a hook, given in args. The hook is a Lefthook hook. -func (l *Lefthook) Add(args *AddArgs) error { - if !config.HookAvailable(args.Hook) { - return fmt.Errorf("Skip adding, hook is unavailable: %s", args.Hook) - } - - err := l.cleanHook(args.Hook, args.Force || l.Options.Force) - if err != nil { - return err - } - - if err = l.ensureHooksDirExists(); err != nil { - return err - } - - err = l.addHook(args.Hook, "") - if err != nil { - return err - } - - if args.CreateDirs { - global, local := l.getSourceDirs() - - sourceDir := filepath.Join(l.repo.RootPath, global, args.Hook) - sourceDirLocal := filepath.Join(l.repo.RootPath, local, args.Hook) - - if err = l.Fs.MkdirAll(sourceDir, defaultDirMode); err != nil { - return err - } - if err = l.Fs.MkdirAll(sourceDirLocal, defaultDirMode); err != nil { - return err - } - } - - return nil -} - -func (l *Lefthook) getSourceDirs() (global, local string) { - global = config.DefaultSourceDir - local = config.DefaultSourceDirLocal - - cfg, err := config.Load(l.Fs, l.repo) - if err == nil { - if len(cfg.SourceDir) > 0 { - global = cfg.SourceDir - } - if len(cfg.SourceDirLocal) > 0 { - local = cfg.SourceDirLocal - } - } - - return -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/dump.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/dump.go deleted file mode 100644 index be96fda749..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/dump.go +++ /dev/null @@ -1,30 +0,0 @@ -package lefthook - -import ( - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/log" -) - -type DumpArgs struct { - JSON bool - TOML bool -} - -func Dump(opts *Options, args DumpArgs) { - lefthook, err := initialize(opts) - if err != nil { - log.Errorf("couldn't initialize lefthook: %s\n", err) - return - } - - cfg, err := config.Load(lefthook.Fs, lefthook.repo) - if err != nil { - log.Errorf("couldn't load config: %s\n", err) - return - } - - if err := cfg.Dump(args.JSON, args.TOML); err != nil { - log.Errorf("couldn't dump config: %s\n", err) - return - } -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/install.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/install.go deleted file mode 100644 index 32504ab24d..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/install.go +++ /dev/null @@ -1,287 +0,0 @@ -package lefthook - -import ( - "bufio" - "crypto/md5" - "encoding/hex" - "fmt" - "io" - "os" - "path/filepath" - "regexp" - "strconv" - "strings" - - "github.com/gobwas/glob" - "github.com/spf13/afero" - - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/log" - "github.com/evilmartians/lefthook/internal/templates" -) - -const ( - configFileMode = 0o666 - checksumFileMode = 0o644 - hooksDirMode = 0o755 - timestampBase = 10 - timestampBitsize = 64 -) - -var ( - lefthookChecksumRegexp = regexp.MustCompile(`(\w+)\s+(\d+)`) - configGlob = glob.MustCompile("lefthook.{yml,yaml,json,toml}") - errNoConfig = fmt.Errorf("no lefthook config found") -) - -type InstallArgs struct { - Force, Aggressive bool -} - -// Install installs the hooks from config file to the .git/hooks. -func Install(opts *Options, args *InstallArgs) error { - lefthook, err := initialize(opts) - if err != nil { - return err - } - - return lefthook.Install(args) -} - -func (l *Lefthook) Install(args *InstallArgs) error { - cfg, err := l.readOrCreateConfig() - if err != nil { - return err - } - - if cfg.Remote.Configured() { - if err := l.repo.SyncRemote(cfg.Remote.GitURL, cfg.Remote.Ref); err != nil { - log.Warnf("Couldn't sync remotes. Will continue without them: %s", err) - } else { - // Reread the config file with synced remotes - cfg, err = l.readOrCreateConfig() - if err != nil { - return err - } - } - } - - return l.createHooksIfNeeded(cfg, - args.Force || args.Aggressive || l.Options.Force || l.Options.Aggressive) -} - -func (l *Lefthook) readOrCreateConfig() (*config.Config, error) { - log.Debug("Searching config in:", l.repo.RootPath) - - if !l.configExists(l.repo.RootPath) { - log.Info("Config not found, creating...") - if err := l.createConfig(l.repo.RootPath); err != nil { - return nil, err - } - } - - return config.Load(l.Fs, l.repo) -} - -func (l *Lefthook) configExists(path string) bool { - paths, err := afero.ReadDir(l.Fs, path) - if err != nil { - return false - } - - for _, file := range paths { - if ok := configGlob.Match(file.Name()); ok { - return true - } - } - - return false -} - -func (l *Lefthook) createConfig(path string) error { - file := filepath.Join(path, config.DefaultConfigName) - - err := afero.WriteFile(l.Fs, file, templates.Config(), configFileMode) - if err != nil { - return err - } - - log.Info("Added config:", file) - - return nil -} - -func (l *Lefthook) createHooksIfNeeded(cfg *config.Config, force bool) error { - if !force && l.hooksSynchronized() { - return nil - } - - log.Info(log.Cyan("SYNCING")) - - checksum, err := l.configChecksum() - if err != nil { - return err - } - - if err = l.ensureHooksDirExists(); err != nil { - return err - } - - hookNames := make([]string, 0, len(cfg.Hooks)+1) - for hook := range cfg.Hooks { - hookNames = append(hookNames, hook) - - if err = l.cleanHook(hook, force); err != nil { - return err - } - - if err = l.addHook(hook, cfg.Rc); err != nil { - return err - } - } - - if err = l.addHook(config.GhostHookName, cfg.Rc); err != nil { - return nil - } - - if err = l.addChecksumFile(checksum); err != nil { - return err - } - - if len(hookNames) > 0 { - log.Info(log.Cyan("SERVED HOOKS:"), log.Bold(strings.Join(hookNames, ", "))) - } - - return nil -} - -func (l *Lefthook) hooksSynchronized() bool { - // Check checksum in a checksum file - file, err := l.Fs.Open(l.checksumFilePath()) - if err != nil { - return false - } - defer file.Close() - - scanner := bufio.NewScanner(file) - scanner.Split(bufio.ScanLines) - - var storedChecksum string - var storedTimestamp int64 - - for scanner.Scan() { - match := lefthookChecksumRegexp.FindStringSubmatch(scanner.Text()) - if len(match) > 1 { - storedChecksum = match[1] - storedTimestamp, err = strconv.ParseInt(match[2], timestampBase, timestampBitsize) - if err != nil { - return false - } - - break - } - } - - if len(storedChecksum) == 0 { - return false - } - - configTimestamp, err := l.configLastUpdateTimestamp() - if err != nil { - return false - } - - if storedTimestamp == configTimestamp { - return true - } - - configChecksum, err := l.configChecksum() - if err != nil { - return false - } - - return storedChecksum == configChecksum -} - -func (l *Lefthook) configLastUpdateTimestamp() (timestamp int64, err error) { - paths, err := afero.ReadDir(l.Fs, l.repo.RootPath) - if err != nil { - return - } - var config os.FileInfo - for _, file := range paths { - if ok := configGlob.Match(file.Name()); ok { - config = file - break - } - } - - if config == nil { - err = errNoConfig - return - } - - timestamp = config.ModTime().Unix() - return -} - -func (l *Lefthook) configChecksum() (checksum string, err error) { - paths, err := afero.ReadDir(l.Fs, l.repo.RootPath) - if err != nil { - return - } - - var config string - for _, file := range paths { - if ok := configGlob.Match(file.Name()); ok { - config = file.Name() - break - } - } - if len(config) == 0 { - err = errNoConfig - return - } - - file, err := l.Fs.Open(filepath.Join(l.repo.RootPath, config)) - if err != nil { - return - } - defer file.Close() - - hash := md5.New() - _, err = io.Copy(hash, file) - if err != nil { - return - } - - checksum = hex.EncodeToString(hash.Sum(nil)[:16]) - return -} - -func (l *Lefthook) addChecksumFile(checksum string) error { - timestamp, err := l.configLastUpdateTimestamp() - if err != nil { - return err - } - - return afero.WriteFile( - l.Fs, l.checksumFilePath(), templates.Checksum(checksum, timestamp), checksumFileMode, - ) -} - -func (l *Lefthook) checksumFilePath() string { - return filepath.Join(l.repo.InfoPath, config.ChecksumFileName) -} - -func (l *Lefthook) ensureHooksDirExists() error { - exists, err := afero.Exists(l.Fs, l.repo.HooksPath) - if !exists || err != nil { - err = l.Fs.MkdirAll(l.repo.HooksPath, hooksDirMode) - if err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/lefthook.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/lefthook.go deleted file mode 100644 index 236efc666d..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/lefthook.go +++ /dev/null @@ -1,121 +0,0 @@ -package lefthook - -import ( - "bufio" - "fmt" - "path/filepath" - "regexp" - - "github.com/spf13/afero" - - "github.com/evilmartians/lefthook/internal/git" - "github.com/evilmartians/lefthook/internal/log" - "github.com/evilmartians/lefthook/internal/templates" -) - -const hookFileMode = 0o755 - -var lefthookContentRegexp = regexp.MustCompile("LEFTHOOK") - -type Options struct { - Fs afero.Fs - Verbose, NoColors bool - - // DEPRECATED. Will be removed in 1.3.0. - Force, Aggressive bool -} - -type Lefthook struct { - // Since we need to support deprecated global options Force and Aggressive - // we need to store these fields. After their removal we need just to copy fs. - *Options - - repo *git.Repository -} - -// New returns an instance of Lefthook. -func initialize(opts *Options) (*Lefthook, error) { - if opts.Verbose { - log.SetLevel(log.DebugLevel) - } - - log.SetColors(!opts.NoColors) - - repo, err := git.NewRepository(opts.Fs, git.NewOsExec()) - if err != nil { - return nil, err - } - - return &Lefthook{Options: opts, repo: repo}, nil -} - -// Tests a file whether it is a lefthook-created file. -func (l *Lefthook) isLefthookFile(path string) bool { - file, err := l.Fs.Open(path) - if err != nil { - return false - } - defer file.Close() - - scanner := bufio.NewScanner(file) - scanner.Split(bufio.ScanLines) - - for scanner.Scan() { - if lefthookContentRegexp.MatchString(scanner.Text()) { - return true - } - } - - return false -} - -// Removes the hook from hooks path, saving non-lefthook hooks with .old suffix. -func (l *Lefthook) cleanHook(hook string, force bool) error { - hookPath := filepath.Join(l.repo.HooksPath, hook) - exists, err := afero.Exists(l.Fs, hookPath) - if err != nil { - return err - } - if !exists { - return nil - } - - // Just remove lefthook hook - if l.isLefthookFile(hookPath) { - if err = l.Fs.Remove(hookPath); err != nil { - return err - } - - return nil - } - - // Check if .old file already exists before renaming. - exists, err = afero.Exists(l.Fs, hookPath+".old") - if err != nil { - return err - } - if exists { - if force { - log.Infof("File %s.old already exists, overwriting\n", hook) - } else { - log.Errorf("Can't rename %s to %s.old - file already exists\n", hook, hook) - return fmt.Errorf("file %s.old already exists", hook) - } - } - - err = l.Fs.Rename(hookPath, hookPath+".old") - if err != nil { - return err - } - - log.Infof("Renamed %s to %s.old\n", hookPath, hookPath) - return nil -} - -// Creates a hook file using hook template. -func (l *Lefthook) addHook(hook, rc string) error { - hookPath := filepath.Join(l.repo.HooksPath, hook) - return afero.WriteFile( - l.Fs, hookPath, templates.Hook(hook, rc), hookFileMode, - ) -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/run.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/run.go deleted file mode 100644 index e1844c9586..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/run.go +++ /dev/null @@ -1,198 +0,0 @@ -package lefthook - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "strings" - "time" - - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/lefthook/runner" - "github.com/evilmartians/lefthook/internal/log" - "github.com/evilmartians/lefthook/internal/version" -) - -const ( - envEnabled = "LEFTHOOK" // "0", "false" - envSkipOutput = "LEFTHOOK_QUIET" // "meta,success,failure,summary,skips,execution,execution_out,execution_info" - envVerbose = "LEFTHOOK_VERBOSE" // keep all output -) - -type RunArgs struct { - NoTTY bool -} - -func Run(opts *Options, args RunArgs, hookName string, gitArgs []string) error { - lefthook, err := initialize(opts) - if err != nil { - return err - } - - return lefthook.Run(hookName, args, gitArgs) -} - -func (l *Lefthook) Run(hookName string, args RunArgs, gitArgs []string) error { - if os.Getenv(envEnabled) == "0" || os.Getenv(envEnabled) == "false" { - return nil - } - - var verbose bool - if l.Verbose || os.Getenv(envVerbose) == "1" || os.Getenv(envVerbose) == "true" { - log.SetLevel(log.DebugLevel) - verbose = true - } - - // Load config - cfg, err := config.Load(l.Fs, l.repo) - if err != nil { - var notFoundErr config.NotFoundError - if ok := errors.As(err, ¬FoundErr); ok { - log.Warn(err.Error()) - return nil - } - - return err - } - if err = cfg.Validate(); err != nil { - return err - } - - // Suppress prepare-commit-msg output if the hook doesn't exists in config. - // prepare-commit-msg hook is used for seemless synchronization of hooks with config. - // See: internal/lefthook/install.go - _, ok := cfg.Hooks[hookName] - if hookName == config.GhostHookName && !ok && !verbose { - log.SetLevel(log.WarnLevel) - } - - if tags := os.Getenv(envSkipOutput); tags != "" { - cfg.SkipOutput = append(cfg.SkipOutput, strings.Split(tags, ",")...) - } - - var logSettings log.SkipSettings - for _, skipOption := range cfg.SkipOutput { - (&logSettings).ApplySetting(skipOption) - } - - if !logSettings.SkipMeta() { - log.Info(log.Cyan("Lefthook v" + version.Version(false))) - } - - // This line controls updating the git hook if config has changed - if err = l.createHooksIfNeeded(cfg, false); err != nil { - log.Warn( - `⚠️ There was a problem with synchronizing git hooks. -Run 'lefthook install' manually.`, - ) - } - - if !logSettings.SkipMeta() { - log.Info(log.Cyan("RUNNING HOOK:"), log.Bold(hookName)) - } - - // Find the hook - hook, ok := cfg.Hooks[hookName] - if !ok { - log.Debugf("[lefthook] skip: Hook %s doesn't exist in the config", hookName) - return nil - } - if err := hook.Validate(); err != nil { - return err - } - - startTime := time.Now() - resultChan := make(chan runner.Result, len(hook.Commands)+len(hook.Scripts)) - - run := runner.NewRunner( - runner.Opts{ - Fs: l.Fs, - Repo: l.repo, - Hook: hook, - HookName: hookName, - GitArgs: gitArgs, - ResultChan: resultChan, - SkipSettings: logSettings, - DisableTTY: cfg.NoTTY || args.NoTTY, - }, - ) - - sourceDirs := []string{ - filepath.Join(l.repo.RootPath, cfg.SourceDir), - filepath.Join(l.repo.RootPath, cfg.SourceDirLocal), - } - - if cfg.Remote.Configured() { - // Apend only source_dir, because source_dir_local doesn't make sense - sourceDirs = append( - sourceDirs, - filepath.Join( - l.repo.RemoteFolder(cfg.Remote.GitURL), - cfg.SourceDir, - ), - ) - } - - go func() { - run.RunAll(sourceDirs) - close(resultChan) - }() - - var results []runner.Result - for res := range resultChan { - results = append(results, res) - } - - if !logSettings.SkipSummary() { - printSummary(time.Since(startTime), results, logSettings) - } - - for _, result := range results { - if result.Status == runner.StatusErr { - return errors.New("") // No error should be printed - } - } - - return nil -} - -func printSummary( - duration time.Duration, - results []runner.Result, - logSettings log.SkipSettings, -) { - if len(results) == 0 { - log.Info(log.Cyan("\nSUMMARY: (SKIP EMPTY)")) - return - } - - log.Info(log.Cyan( - fmt.Sprintf("\nSUMMARY: (done in %.2f seconds)", duration.Seconds()), - )) - - if !logSettings.SkipSuccess() { - for _, result := range results { - if result.Status != runner.StatusOk { - continue - } - - log.Infof("✔️ %s\n", log.Green(result.Name)) - } - } - - if !logSettings.SkipFailure() { - for _, result := range results { - if result.Status != runner.StatusErr { - continue - } - - var failText string - if len(result.Text) != 0 { - failText = fmt.Sprintf(": %s", result.Text) - } - - log.Infof("🥊 %s%s\n", log.Red(result.Name), log.Red(failText)) - } - } -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_unix.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_unix.go deleted file mode 100644 index e74594e312..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_unix.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build !windows -// +build !windows - -package runner - -import ( - "fmt" - "io" - "os" - "os/exec" - "path/filepath" - "strings" - - "github.com/creack/pty" - "github.com/mattn/go-isatty" - - "github.com/evilmartians/lefthook/internal/log" -) - -type CommandExecutor struct{} - -func (e CommandExecutor) Execute(opts ExecuteOptions, out io.Writer) error { - stdin := os.Stdin - if opts.interactive && !isatty.IsTerminal(os.Stdin.Fd()) { - tty, err := os.Open("/dev/tty") - if err == nil { - defer tty.Close() - stdin = tty - } else { - log.Errorf("Couldn't enable TTY input: %s\n", err) - } - } - - command := exec.Command("sh", "-c", strings.Join(opts.args, " ")) - - rootDir, _ := filepath.Abs(opts.root) - command.Dir = rootDir - - envList := make([]string, len(opts.env)) - for name, value := range opts.env { - envList = append( - envList, - fmt.Sprintf("%s=%s", strings.ToUpper(name), os.ExpandEnv(value)), - ) - } - - command.Env = append(os.Environ(), envList...) - - if opts.interactive { - command.Stdout = out - command.Stdin = stdin - command.Stderr = os.Stderr - err := command.Start() - if err != nil { - return err - } - } else { - p, err := pty.Start(command) - if err != nil { - return err - } - - defer func() { _ = p.Close() }() - - go func() { _, _ = io.Copy(p, stdin) }() - - _, _ = io.Copy(out, p) - } - - defer func() { _ = command.Process.Kill() }() - - return command.Wait() -} - -func (e CommandExecutor) RawExecute(command []string, out io.Writer) error { - cmd := exec.Command(command[0], command[1:]...) - - cmd.Stdout = out - cmd.Stderr = os.Stderr - - return cmd.Run() -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_windows.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_windows.go deleted file mode 100644 index d443ccf340..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/execute_windows.go +++ /dev/null @@ -1,59 +0,0 @@ -package runner - -import ( - "fmt" - "io" - "os" - "os/exec" - "path/filepath" - "strings" - "syscall" -) - -type CommandExecutor struct{} - -func (e CommandExecutor) Execute(opts ExecuteOptions, out io.Writer) error { - command := exec.Command(opts.args[0]) - command.SysProcAttr = &syscall.SysProcAttr{ - CmdLine: strings.Join(opts.args, " "), - } - - rootDir, _ := filepath.Abs(opts.root) - command.Dir = rootDir - - envList := make([]string, len(opts.env)) - for name, value := range opts.env { - envList = append( - envList, - fmt.Sprintf("%s=%s", strings.ToUpper(name), os.ExpandEnv(value)), - ) - } - - command.Env = append(os.Environ(), envList...) - - if opts.interactive { - command.Stdout = os.Stdout - } else { - command.Stdout = out - } - - command.Stdin = os.Stdin - command.Stderr = os.Stderr - err := command.Start() - if err != nil { - return err - } - - defer func() { _ = command.Process.Kill() }() - - return command.Wait() -} - -func (e CommandExecutor) RawExecute(command []string, out io.Writer) error { - cmd := exec.Command(command[0], command[1:]...) - - cmd.Stdout = out - cmd.Stderr = os.Stderr - - return cmd.Run() -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/executor.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/executor.go deleted file mode 100644 index c3eca880ac..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/executor.go +++ /dev/null @@ -1,20 +0,0 @@ -package runner - -import ( - "io" -) - -// ExecutorOptions contains the options that control the execution. -type ExecuteOptions struct { - name, root, failText string - args []string - env map[string]string - interactive bool -} - -// Executor provides an interface for command execution. -// It is used here for testing purpose mostly. -type Executor interface { - Execute(opts ExecuteOptions, out io.Writer) error - RawExecute(command []string, out io.Writer) error -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/filters.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/filters.go deleted file mode 100644 index 1efbd431b1..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/filters.go +++ /dev/null @@ -1,52 +0,0 @@ -package runner - -import ( - "regexp" - "strings" - - "github.com/gobwas/glob" -) - -func filterGlob(vs []string, matcher string) []string { - if matcher == "" { - return vs - } - - g := glob.MustCompile(strings.ToLower(matcher)) - - vsf := make([]string, 0) - for _, v := range vs { - if res := g.Match(strings.ToLower(v)); res { - vsf = append(vsf, v) - } - } - return vsf -} - -func filterExclude(vs []string, matcher string) []string { - if matcher == "" { - return vs - } - - vsf := make([]string, 0) - for _, v := range vs { - if res, _ := regexp.MatchString(matcher, v); !res { - vsf = append(vsf, v) - } - } - return vsf -} - -func filterRelative(vs []string, matcher string) []string { - if matcher == "" { - return vs - } - - vsf := make([]string, 0) - for _, v := range vs { - if strings.HasPrefix(v, matcher) { - vsf = append(vsf, strings.Replace(v, matcher, "./", 1)) - } - } - return vsf -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_command.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_command.go deleted file mode 100644 index 67dbfe1049..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_command.go +++ /dev/null @@ -1,187 +0,0 @@ -package runner - -import ( - "errors" - "fmt" - "strings" - - "gopkg.in/alessio/shellescape.v1" - - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/log" -) - -type commandArgs struct { - all []string - files []string -} - -func (r *Runner) prepareCommand(name string, command *config.Command) (*commandArgs, error) { - if command.DoSkip(r.Repo.State()) { - return nil, errors.New("settings") - } - - if intersect(r.Hook.ExcludeTags, command.Tags) { - return nil, errors.New("tags") - } - - if intersect(r.Hook.ExcludeTags, []string{name}) { - return nil, errors.New("name") - } - - if err := command.Validate(); err != nil { - r.fail(name, "") - return nil, errors.New("invalid config") - } - - args, err, skipReason := r.buildCommandArgs(command) - if err != nil { - log.Error(err) - return nil, errors.New("error") - } - if skipReason != nil { - return nil, skipReason - } - - return args, nil -} - -func (r *Runner) buildCommandArgs(command *config.Command) (*commandArgs, error, error) { - filesCommand := r.Hook.Files - if command.Files != "" { - filesCommand = command.Files - } - - filesTypeToFn := map[string]func() ([]string, error){ - config.SubStagedFiles: r.Repo.StagedFiles, - config.PushFiles: r.Repo.PushFiles, - config.SubAllFiles: r.Repo.AllFiles, - config.SubFiles: func() ([]string, error) { - filesCommand = r.replacePositionalArguments(filesCommand) - return r.Repo.FilesByCommand(filesCommand) - }, - } - - filesFiltered := make([]string, 0) - runString := command.Run - for filesType, filesFn := range filesTypeToFn { - // Checking substitutions and skipping execution if it is empty. - // - // Special case - `files` option: return if the result of files - // command is empty. - if strings.Contains(runString, filesType) || - filesCommand != "" && filesType == config.SubFiles { - files, err := filesFn() - if err != nil { - return nil, fmt.Errorf("error replacing %s: %w", filesType, err), nil - } - if len(files) == 0 { - return nil, nil, errors.New("no files for inspection") - } - - filtered := filterFiles(command, files) - filesFiltered = append(filesFiltered, filtered...) - - prepared := escapeFiles(filtered) - if len(prepared) == 0 { - return nil, nil, errors.New("no files for inspection") - } - - runString = replaceQuoted(runString, filesType, prepared) - } - } - - if len(filesFiltered) == 0 && config.HookUsesStagedFiles(r.HookName) { - files, err := r.Repo.StagedFiles() - if err == nil { - if len(filterFiles(command, files)) == 0 { - return nil, nil, errors.New("no matching staged files") - } - } - } - - if len(filesFiltered) == 0 && config.HookUsesPushFiles(r.HookName) { - files, err := r.Repo.PushFiles() - if err == nil { - if len(filterFiles(command, files)) == 0 { - return nil, nil, errors.New("no matching push files") - } - } - } - - runString = r.replacePositionalArguments(runString) - - log.Debug("[lefthook] executing: ", runString) - - return &commandArgs{ - files: filesFiltered, - all: strings.Split(runString, " "), - }, nil, nil -} - -func (r *Runner) replacePositionalArguments(runString string) string { - runString = strings.ReplaceAll(runString, "{0}", strings.Join(r.GitArgs, " ")) - for i, gitArg := range r.GitArgs { - runString = strings.ReplaceAll(runString, fmt.Sprintf("{%d}", i+1), gitArg) - } - return runString -} - -func filterFiles(command *config.Command, files []string) []string { - if files == nil { - return []string{} - } - - log.Debug("[lefthook] files before filters:\n", files) - - files = filterGlob(files, command.Glob) - files = filterExclude(files, command.Exclude) - files = filterRelative(files, command.Root) - - log.Debug("[lefthook] files after filters:\n", files) - - return files -} - -// Escape file names to prevent unexpected bugs. -func escapeFiles(files []string) []string { - var filesEsc []string - for _, fileName := range files { - if len(fileName) > 0 { - filesEsc = append(filesEsc, shellescape.Quote(fileName)) - } - } - - log.Debug("[lefthook] files after escaping:\n", filesEsc) - - return filesEsc -} - -func replaceQuoted(source, substitution string, files []string) string { - for _, elem := range [][]string{ - {"\"", "\"" + substitution + "\""}, - {"'", "'" + substitution + "'"}, - {"", substitution}, - } { - quote := elem[0] - sub := elem[1] - if !strings.Contains(source, sub) { - continue - } - - quotedFiles := files - if len(quote) != 0 { - quotedFiles = make([]string, 0, len(files)) - for _, fileName := range files { - quotedFiles = append(quotedFiles, - quote+surroundingQuotesRegexp.ReplaceAllString(fileName, "$1")+quote) - } - } - - source = strings.ReplaceAll( - source, sub, strings.Join(quotedFiles, " "), - ) - } - - return source -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_script.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_script.go deleted file mode 100644 index c275e14eda..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/prepare_script.go +++ /dev/null @@ -1,45 +0,0 @@ -package runner - -import ( - "errors" - "os" - "strings" - - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/log" -) - -func (r *Runner) prepareScript(script *config.Script, path string, file os.FileInfo) ([]string, error) { - if script.DoSkip(r.Repo.State()) { - return nil, errors.New("settings") - } - - if intersect(r.Hook.ExcludeTags, script.Tags) { - return nil, errors.New("excluded tags") - } - - // Skip non-regular files (dirs, symlinks, sockets, etc.) - if !file.Mode().IsRegular() { - log.Debugf("[lefthook] file %s is not a regular file, skipping", file.Name()) - return nil, errors.New("not a regular file") - } - - // Make sure file is executable - if (file.Mode() & executableMask) == 0 { - if err := r.Fs.Chmod(path, executableFileMode); err != nil { - log.Errorf("Couldn't change file mode to make file executable: %s", err) - r.fail(file.Name(), "") - return nil, errors.New("system error") - } - } - - var args []string - if len(script.Runner) > 0 { - args = strings.Split(script.Runner, " ") - } - - args = append(args, path) - args = append(args, r.GitArgs...) - - return args, nil -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/result.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/result.go deleted file mode 100644 index c2b0442543..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/result.go +++ /dev/null @@ -1,20 +0,0 @@ -package runner - -const ( - StatusOk status = iota - StatusErr -) - -type Result struct { - Name string - Text string - Status status -} - -func resultSuccess(name string) Result { - return Result{Name: name, Status: StatusOk} -} - -func resultFail(name, text string) Result { - return Result{Name: name, Text: text, Status: StatusErr} -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/runner.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/runner.go deleted file mode 100644 index 81d423880e..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/runner/runner.go +++ /dev/null @@ -1,501 +0,0 @@ -package runner - -import ( - "bytes" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "regexp" - "sort" - "strings" - "sync" - "sync/atomic" - - "github.com/spf13/afero" - - "github.com/evilmartians/lefthook/internal/config" - "github.com/evilmartians/lefthook/internal/git" - "github.com/evilmartians/lefthook/internal/log" -) - -type status int8 - -const ( - executableFileMode os.FileMode = 0o751 - executableMask os.FileMode = 0o111 -) - -var surroundingQuotesRegexp = regexp.MustCompile(`^'(.*)'$`) - -type Opts struct { - Fs afero.Fs - Repo *git.Repository - Hook *config.Hook - HookName string - GitArgs []string - ResultChan chan Result - SkipSettings log.SkipSettings - DisableTTY bool -} - -// Runner responds for actual execution and handling the results. -type Runner struct { - Opts - - partiallyStagedFiles []string - failed atomic.Bool - executor Executor -} - -func NewRunner(opts Opts) *Runner { - return &Runner{ - Opts: opts, - executor: CommandExecutor{}, - } -} - -// RunAll runs scripts and commands. -// LFS hook is executed at first if needed. -func (r *Runner) RunAll(sourceDirs []string) { - if err := r.runLFSHook(); err != nil { - log.Error(err) - } - - if r.Hook.DoSkip(r.Repo.State()) { - r.logSkip(r.HookName, "hook setting") - return - } - - if !r.DisableTTY && !r.Hook.Follow { - log.StartSpinner() - defer log.StopSpinner() - } - - scriptDirs := make([]string, len(sourceDirs)) - for _, sourceDir := range sourceDirs { - scriptDirs = append(scriptDirs, filepath.Join( - sourceDir, r.HookName, - )) - } - - r.preHook() - - for _, dir := range scriptDirs { - r.runScripts(dir) - } - - r.runCommands() - - r.postHook() -} - -func (r *Runner) fail(name, text string) { - r.ResultChan <- resultFail(name, text) - r.failed.Store(true) -} - -func (r *Runner) success(name string) { - r.ResultChan <- resultSuccess(name) -} - -func (r *Runner) runLFSHook() error { - if !git.IsLFSHook(r.HookName) { - return nil - } - - lfsRequiredFile := filepath.Join(r.Repo.RootPath, git.LFSRequiredFile) - lfsConfigFile := filepath.Join(r.Repo.RootPath, git.LFSConfigFile) - - requiredExists, err := afero.Exists(r.Fs, lfsRequiredFile) - if err != nil { - return err - } - configExists, err := afero.Exists(r.Fs, lfsConfigFile) - if err != nil { - return err - } - - if git.IsLFSAvailable() { - log.Debugf( - "[git-lfs] executing hook: git lfs %s %s", r.HookName, strings.Join(r.GitArgs, " "), - ) - out := bytes.NewBuffer(make([]byte, 0)) - err := r.executor.RawExecute( - append( - []string{"git", "lfs", r.HookName}, - r.GitArgs..., - ), - out, - ) - - output := strings.Trim(out.String(), "\n") - if output != "" { - log.Debug("[git-lfs] output: ", output) - } - if err != nil { - log.Debug("[git-lfs] error: ", err) - } - - if err == nil && output != "" { - log.Info(output) - } - - if err != nil && (requiredExists || configExists) { - log.Warnf("git-lfs command failed: %s\n", output) - return err - } - - return nil - } - - if requiredExists || configExists { - log.Errorf( - "This Repository requires Git LFS, but 'git-lfs' wasn't found.\n"+ - "Install 'git-lfs' or consider reviewing the files:\n"+ - " - %s\n"+ - " - %s\n", - lfsRequiredFile, lfsConfigFile, - ) - return errors.New("git-lfs is required") - } - - return nil -} - -func (r *Runner) preHook() { - if !config.HookUsesStagedFiles(r.HookName) { - return - } - - partiallyStagedFiles, err := r.Repo.PartiallyStagedFiles() - if err != nil { - log.Warnf("Couldn't find partially staged files: %s\n", err) - return - } - - if len(partiallyStagedFiles) == 0 { - return - } - - log.Debug("[lefthook] saving partially staged files") - - r.partiallyStagedFiles = partiallyStagedFiles - err = r.Repo.SaveUnstaged(r.partiallyStagedFiles) - if err != nil { - log.Warnf("Couldn't save unstaged changes: %s\n", err) - return - } - - err = r.Repo.StashUnstaged() - if err != nil { - log.Warnf("Couldn't stash partially staged files: %s\n", err) - return - } - - err = r.Repo.HideUnstaged(r.partiallyStagedFiles) - if err != nil { - log.Warnf("Couldn't hide unstaged files: %s\n", err) - return - } - - log.Debugf("[lefthook] hide partially staged files: %v\n", r.partiallyStagedFiles) -} - -func (r *Runner) postHook() { - if !config.HookUsesStagedFiles(r.HookName) { - return - } - - if err := r.Repo.RestoreUnstaged(); err != nil { - log.Warnf("Couldn't restore hidden unstaged files: %s\n", err) - return - } - - if err := r.Repo.DropUnstagedStash(); err != nil { - log.Warnf("Couldn't remove unstaged files backup: %s\n", err) - } -} - -func (r *Runner) runScripts(dir string) { - files, err := afero.ReadDir(r.Fs, dir) // ReadDir already sorts files by .Name() - if err != nil || len(files) == 0 { - return - } - - interactiveScripts := make([]os.FileInfo, 0) - var wg sync.WaitGroup - - for _, file := range files { - script, ok := r.Hook.Scripts[file.Name()] - if !ok { - r.logSkip(file.Name(), "not specified in config file") - continue - } - - if r.failed.Load() && r.Hook.Piped { - r.logSkip(file.Name(), "broken pipe") - continue - } - - if script.Interactive { - interactiveScripts = append(interactiveScripts, file) - continue - } - - path := filepath.Join(dir, file.Name()) - - if r.Hook.Parallel { - wg.Add(1) - go func(script *config.Script, path string, file os.FileInfo) { - defer wg.Done() - r.runScript(script, path, file) - }(script, path, file) - } else { - r.runScript(script, path, file) - } - } - - wg.Wait() - - for _, file := range interactiveScripts { - script := r.Hook.Scripts[file.Name()] - if r.failed.Load() { - r.logSkip(file.Name(), "non-interactive scripts failed") - continue - } - - path := filepath.Join(dir, file.Name()) - - r.runScript(script, path, file) - } -} - -func (r *Runner) runScript(script *config.Script, path string, file os.FileInfo) { - args, err := r.prepareScript(script, path, file) - if err != nil { - r.logSkip(file.Name(), err.Error()) - return - } - - if script.Interactive && !r.DisableTTY && !r.Hook.Follow { - log.StopSpinner() - defer log.StartSpinner() - } - - finished := r.run(ExecuteOptions{ - name: file.Name(), - root: r.Repo.RootPath, - args: args, - failText: script.FailText, - interactive: script.Interactive && !r.DisableTTY, - env: script.Env, - }, r.Hook.Follow) - - if finished && config.HookUsesStagedFiles(r.HookName) && script.StageFixed { - files, err := r.Repo.StagedFiles() - if err != nil { - log.Warn("Couldn't stage fixed files:", err) - return - } - - r.addStagedFiles(files) - } -} - -func (r *Runner) runCommands() { - commands := make([]string, 0, len(r.Hook.Commands)) - for name := range r.Hook.Commands { - commands = append(commands, name) - } - - sort.Strings(commands) - - interactiveCommands := make([]string, 0) - var wg sync.WaitGroup - - for _, name := range commands { - if r.failed.Load() && r.Hook.Piped { - r.logSkip(name, "broken pipe") - continue - } - - if r.Hook.Commands[name].Interactive { - interactiveCommands = append(interactiveCommands, name) - continue - } - - if r.Hook.Parallel { - wg.Add(1) - go func(name string, command *config.Command) { - defer wg.Done() - r.runCommand(name, command) - }(name, r.Hook.Commands[name]) - } else { - r.runCommand(name, r.Hook.Commands[name]) - } - } - - wg.Wait() - - for _, name := range interactiveCommands { - if r.failed.Load() { - r.logSkip(name, "non-interactive commands failed") - continue - } - - r.runCommand(name, r.Hook.Commands[name]) - } -} - -func (r *Runner) runCommand(name string, command *config.Command) { - args, err := r.prepareCommand(name, command) - if err != nil { - r.logSkip(name, err.Error()) - return - } - - if command.Interactive && !r.DisableTTY && !r.Hook.Follow { - log.StopSpinner() - defer log.StartSpinner() - } - - finished := r.run(ExecuteOptions{ - name: name, - root: filepath.Join(r.Repo.RootPath, command.Root), - args: args.all, - failText: command.FailText, - interactive: command.Interactive && !r.DisableTTY, - env: command.Env, - }, r.Hook.Follow) - - if finished && config.HookUsesStagedFiles(r.HookName) && command.StageFixed { - files := args.files - - if len(files) == 0 { - var err error - files, err = r.Repo.StagedFiles() - if err != nil { - log.Warn("Couldn't stage fixed files:", err) - return - } - - files = filterFiles(command, files) - } - - if len(command.Root) > 0 { - for i, file := range files { - files[i] = filepath.Join(command.Root, file) - } - } - - r.addStagedFiles(files) - } -} - -func (r *Runner) addStagedFiles(files []string) { - if err := r.Repo.AddFiles(files); err != nil { - log.Warn("Couldn't stage fixed files:", err) - } -} - -func (r *Runner) run(opts ExecuteOptions, follow bool) bool { - log.SetName(opts.name) - defer log.UnsetName(opts.name) - - if (follow || opts.interactive) && !r.SkipSettings.SkipExecution() { - r.logExecute(opts.name, nil, nil) - - var out io.Writer - if r.SkipSettings.SkipExecutionOutput() { - out = io.Discard - } else { - out = os.Stdout - } - - err := r.executor.Execute(opts, out) - if err != nil { - r.fail(opts.name, opts.failText) - } else { - r.success(opts.name) - } - - return err == nil - } - - out := bytes.NewBuffer(make([]byte, 0)) - err := r.executor.Execute(opts, out) - - if err != nil { - r.fail(opts.name, opts.failText) - } else { - r.success(opts.name) - } - - r.logExecute(opts.name, err, out) - - return err == nil -} - -// Returns whether two arrays have at least one similar element. -func intersect(a, b []string) bool { - intersections := make(map[string]struct{}, len(a)) - - for _, v := range a { - intersections[v] = struct{}{} - } - - for _, v := range b { - if _, ok := intersections[v]; ok { - return true - } - } - - return false -} - -func (r *Runner) logSkip(name, reason string) { - if r.SkipSettings.SkipSkips() { - return - } - - log.Info( - fmt.Sprintf( - "%s: %s %s", - log.Bold(name), - log.Gray("(skip)"), - log.Yellow(reason), - ), - ) -} - -func (r *Runner) logExecute(name string, err error, out io.Reader) { - if err == nil && r.SkipSettings.SkipExecution() { - return - } - - var execLog string - switch { - case r.SkipSettings.SkipExecutionInfo(): - execLog = "\n" - case err != nil: - execLog = fmt.Sprint(log.Red("\n EXECUTE > "), log.Bold(name)) - default: - execLog = fmt.Sprint(log.Cyan("\n EXECUTE > "), log.Bold(name)) - } - - if err == nil && r.SkipSettings.SkipExecutionOutput() { - log.Info(execLog) - return - } - - log.Info(execLog) - if out != nil { - log.Info(out) - } - - if err != nil { - log.Infof("%s", err) - } -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/lefthook/uninstall.go b/vendor/github.com/evilmartians/lefthook/internal/lefthook/uninstall.go deleted file mode 100644 index 21e8aa4366..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/lefthook/uninstall.go +++ /dev/null @@ -1,101 +0,0 @@ -package lefthook - -import ( - "path/filepath" - - "github.com/spf13/afero" - - "github.com/evilmartians/lefthook/internal/log" -) - -type UninstallArgs struct { - Force, RemoveConfig bool -} - -func Uninstall(opts *Options, args *UninstallArgs) error { - lefthook, err := initialize(opts) - if err != nil { - return err - } - - return lefthook.Uninstall(args) -} - -func (l *Lefthook) Uninstall(args *UninstallArgs) error { - if err := l.deleteHooks(args.Force || l.Options.Aggressive); err != nil { - return err - } - - if err := l.Fs.Remove(l.checksumFilePath()); err == nil { - log.Debugf("%s removed", l.checksumFilePath()) - } else { - log.Errorf("Failed removing %s: %s\n", l.checksumFilePath(), err) - } - - if args.RemoveConfig { - for _, glob := range []string{ - "lefthook.y*ml", - "lefthook-local.y*ml", - } { - l.removeFile(filepath.Join(l.repo.RootPath, glob)) - } - } - - if err := l.Fs.RemoveAll(l.repo.RemotesFolder()); err != nil { - return err - } - - return nil -} - -func (l *Lefthook) deleteHooks(force bool) error { - hooks, err := afero.ReadDir(l.Fs, l.repo.HooksPath) - if err != nil { - return err - } - - for _, file := range hooks { - hookFile := filepath.Join(l.repo.HooksPath, file.Name()) - - // Skip non-lefthook files if removal not forced - if !l.isLefthookFile(hookFile) && !force { - continue - } - - if err := l.Fs.Remove(hookFile); err == nil { - log.Debugf("%s removed", hookFile) - } else { - log.Errorf("Failed removing %s: %s\n", hookFile, err) - } - - // Recover .old file if exists - oldHookFile := filepath.Join(l.repo.HooksPath, file.Name()+".old") - if exists, _ := afero.Exists(l.Fs, oldHookFile); !exists { - continue - } - - if err := l.Fs.Rename(oldHookFile, hookFile); err == nil { - log.Debug(oldHookFile, "renamed to", file.Name()) - } else { - log.Errorf("Failed renaming %s: %s\n", oldHookFile, err) - } - } - - return nil -} - -func (l *Lefthook) removeFile(glob string) { - paths, err := afero.Glob(l.Fs, glob) - if err != nil { - log.Errorf("Failed removing configuration files: %s\n", err) - return - } - - for _, fileName := range paths { - if err := l.Fs.Remove(fileName); err == nil { - log.Debugf("%s removed", fileName) - } else { - log.Errorf("Failed removing file %s: %s\n", fileName, err) - } - } -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/log/log.go b/vendor/github.com/evilmartians/lefthook/internal/log/log.go deleted file mode 100644 index f3e4d383bc..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/log/log.go +++ /dev/null @@ -1,357 +0,0 @@ -package log - -import ( - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/briandowns/spinner" - "github.com/charmbracelet/lipgloss" -) - -var ( - colorRed lipgloss.TerminalColor = lipgloss.CompleteAdaptiveColor{ - Dark: lipgloss.CompleteColor{TrueColor: "#ff6347", ANSI256: "196", ANSI: "9"}, - Light: lipgloss.CompleteColor{TrueColor: "#d70000", ANSI256: "160", ANSI: "1"}, - } - - colorGreen lipgloss.TerminalColor = lipgloss.CompleteAdaptiveColor{ - Dark: lipgloss.CompleteColor{TrueColor: "#76ff7a", ANSI256: "155", ANSI: "10"}, - Light: lipgloss.CompleteColor{TrueColor: "#afd700", ANSI256: "148", ANSI: "2"}, - } - - colorYellow lipgloss.TerminalColor = lipgloss.CompleteAdaptiveColor{ - Dark: lipgloss.CompleteColor{TrueColor: "#fada5e", ANSI256: "191", ANSI: "11"}, - Light: lipgloss.CompleteColor{TrueColor: "#ffaf00", ANSI256: "214", ANSI: "3"}, - } - - colorCyan lipgloss.TerminalColor = lipgloss.CompleteAdaptiveColor{ - Dark: lipgloss.CompleteColor{TrueColor: "#70C0BA", ANSI256: "37", ANSI: "14"}, - Light: lipgloss.CompleteColor{TrueColor: "#00af87", ANSI256: "36", ANSI: "6"}, - } - - colorGray lipgloss.TerminalColor = lipgloss.CompleteAdaptiveColor{ - Dark: lipgloss.CompleteColor{TrueColor: "#808080", ANSI256: "244", ANSI: "7"}, - Light: lipgloss.CompleteColor{TrueColor: "#4e4e4e", ANSI256: "239", ANSI: "8"}, - } - - std = New() -) - -type Level uint32 - -const ( - ErrorLevel Level = iota - WarnLevel - InfoLevel - DebugLevel - - spinnerCharSet = 14 - spinnerRefreshRate = 100 * time.Millisecond - spinnerText = " waiting" -) - -type Logger struct { - level Level - out io.Writer - mu sync.Mutex - colors bool - names []string - spinner *spinner.Spinner -} - -func New() *Logger { - return &Logger{ - level: InfoLevel, - out: os.Stdout, - colors: true, - spinner: spinner.New( - spinner.CharSets[spinnerCharSet], - spinnerRefreshRate, - spinner.WithSuffix(spinnerText), - ), - } -} - -func StartSpinner() { - std.spinner.Start() -} - -func StopSpinner() { - std.spinner.Stop() -} - -func Debug(args ...interface{}) { - res := fmt.Sprint(args...) - std.Debug(color(colorGray).Render(res)) -} - -func Debugf(format string, args ...interface{}) { - Debug(fmt.Sprintf(format, args...)) -} - -func Info(args ...interface{}) { - std.Info(args...) -} - -func Infof(format string, args ...interface{}) { - std.Infof(format, args...) -} - -func Error(args ...interface{}) { - res := fmt.Sprint(args...) - std.Error(Red(res)) -} - -func Errorf(format string, args ...interface{}) { - Error(fmt.Sprintf(format, args...)) -} - -func Warn(args ...interface{}) { - res := fmt.Sprint(args...) - std.Warn(Yellow(res)) -} - -func Warnf(format string, args ...interface{}) { - Warn(fmt.Sprintf(format, args...)) -} - -func Println(args ...interface{}) { - std.Println(args...) -} - -func Printf(format string, args ...interface{}) { - std.Printf(format, args...) -} - -func SetLevel(level Level) { - std.SetLevel(level) -} - -func SetColors(colors interface{}) { - switch typedColors := colors.(type) { - case bool: - std.colors = typedColors - return - case map[string]interface{}: - std.colors = true - setColor(typedColors["red"], &colorRed) - setColor(typedColors["green"], &colorGreen) - setColor(typedColors["yellow"], &colorYellow) - setColor(typedColors["cyan"], &colorCyan) - setColor(typedColors["gray"], &colorGray) - return - default: - std.colors = true - } -} - -func setColor(colorCode interface{}, adaptiveColor *lipgloss.TerminalColor) { - if colorCode == nil { - return - } - - var code string - switch typedCode := colorCode.(type) { - case int: - code = strconv.Itoa(typedCode) - case string: - code = typedCode - default: - return - } - - if len(code) == 0 { - return - } - - *adaptiveColor = lipgloss.Color(code) -} - -func Cyan(s string) string { - return color(colorCyan).Render(s) -} - -func Green(s string) string { - return color(colorGreen).Render(s) -} - -func Red(s string) string { - return color(colorRed).Render(s) -} - -func Yellow(s string) string { - return color(colorYellow).Render(s) -} - -func Gray(s string) string { - return color(colorGray).Render(s) -} - -func Bold(s string) string { - if !std.colors { - return lipgloss.NewStyle().Render(s) - } - - return lipgloss.NewStyle().Bold(true).Render(s) -} - -func color(clr lipgloss.TerminalColor) lipgloss.Style { - if !std.colors { - return lipgloss.NewStyle() - } - - return lipgloss.NewStyle().Foreground(clr) -} - -func SetOutput(out io.Writer) { - std.SetOutput(out) -} - -func ParseLevel(lvl string) (Level, error) { - switch strings.ToLower(lvl) { - case "error": - return ErrorLevel, nil - case "info": - return InfoLevel, nil - case "debug": - return DebugLevel, nil - } - - var l Level - return l, fmt.Errorf("not a valid Level: %q", lvl) -} - -func (l *Logger) SetLevel(level Level) { - l.mu.Lock() - defer l.mu.Unlock() - l.level = level -} - -func (l *Logger) SetOutput(out io.Writer) { - l.mu.Lock() - defer l.mu.Unlock() - l.out = out -} - -func (l *Logger) Info(args ...interface{}) { - l.Log(InfoLevel, args...) -} - -func (l *Logger) Debug(args ...interface{}) { - l.Log(DebugLevel, args...) -} - -func (l *Logger) Error(args ...interface{}) { - l.Log(ErrorLevel, args...) -} - -func (l *Logger) Warn(args ...interface{}) { - l.Log(WarnLevel, args...) -} - -func (l *Logger) Infof(format string, args ...interface{}) { - l.Logf(InfoLevel, format, args...) -} - -func (l *Logger) Debugf(format string, args ...interface{}) { - l.Logf(DebugLevel, format, args...) -} - -func (l *Logger) Errorf(format string, args ...interface{}) { - l.Logf(ErrorLevel, format, args...) -} - -func (l *Logger) Warnf(format string, args ...interface{}) { - l.Logf(WarnLevel, format, args...) -} - -func (l *Logger) Log(level Level, args ...interface{}) { - if l.IsLevelEnabled(level) { - l.Println(args...) - } -} - -func SetName(name string) { - std.SetName(name) -} - -func UnsetName(name string) { - std.UnsetName(name) -} - -func (l *Logger) SetName(name string) { - l.mu.Lock() - defer l.mu.Unlock() - - if l.spinner.Active() { - l.spinner.Stop() - defer l.spinner.Start() - } - - l.names = append(l.names, name) - l.spinner.Suffix = fmt.Sprintf("%s: %s", spinnerText, strings.Join(l.names, ", ")) -} - -func (l *Logger) UnsetName(name string) { - l.mu.Lock() - defer l.mu.Unlock() - - if l.spinner.Active() { - l.spinner.Stop() - defer l.spinner.Start() - } - - newNames := make([]string, 0, len(l.names)-1) - for _, n := range l.names { - if n != name { - newNames = append(newNames, n) - } - } - - l.names = newNames - - if len(l.names) != 0 { - l.spinner.Suffix = fmt.Sprintf("%s: %s", spinnerText, strings.Join(l.names, ", ")) - } else { - l.spinner.Suffix = spinnerText - } -} - -func (l *Logger) Logf(level Level, format string, args ...interface{}) { - if l.IsLevelEnabled(level) { - l.Printf(format, args...) - } -} - -func (l *Logger) Println(args ...interface{}) { - l.mu.Lock() - defer l.mu.Unlock() - - if l.spinner.Active() { - l.spinner.Stop() - defer l.spinner.Start() - } - - _, _ = fmt.Fprintln(l.out, args...) -} - -func (l *Logger) Printf(format string, args ...interface{}) { - l.mu.Lock() - defer l.mu.Unlock() - - if l.spinner.Active() { - l.spinner.Stop() - defer l.spinner.Start() - } - - _, _ = fmt.Fprintf(l.out, format, args...) -} - -func (l *Logger) IsLevelEnabled(level Level) bool { - return l.level >= level -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/log/skip_settings.go b/vendor/github.com/evilmartians/lefthook/internal/log/skip_settings.go deleted file mode 100644 index fe736659d9..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/log/skip_settings.go +++ /dev/null @@ -1,71 +0,0 @@ -package log - -const ( - skipMeta = 1 << iota - skipSuccess - skipFailure - skipSummary - skipSkips - skipExecution - skipExecutionOutput - skipExecutionInfo -) - -type SkipSettings int16 - -func (s *SkipSettings) ApplySetting(setting string) { - switch setting { - case "meta": - *s |= skipMeta - case "success": - *s |= skipSuccess - case "failure": - *s |= skipFailure - case "summary": - *s |= skipSummary - case "skips": - *s |= skipSkips - case "execution": - *s |= skipExecution - case "execution_out": - *s |= skipExecutionOutput - case "execution_info": - *s |= skipExecutionInfo - } -} - -func (s SkipSettings) SkipSuccess() bool { - return s.doSkip(skipSuccess) -} - -func (s SkipSettings) SkipFailure() bool { - return s.doSkip(skipFailure) -} - -func (s SkipSettings) SkipSummary() bool { - return s.doSkip(skipSummary) -} - -func (s SkipSettings) SkipMeta() bool { - return s.doSkip(skipMeta) -} - -func (s SkipSettings) SkipExecution() bool { - return s.doSkip(skipExecution) -} - -func (s SkipSettings) SkipExecutionOutput() bool { - return s.doSkip(skipExecutionOutput) -} - -func (s SkipSettings) SkipExecutionInfo() bool { - return s.doSkip(skipExecutionInfo) -} - -func (s SkipSettings) SkipSkips() bool { - return s.doSkip(skipSkips) -} - -func (s SkipSettings) doSkip(option int16) bool { - return int16(s)&option != 0 -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/templates/config.tmpl b/vendor/github.com/evilmartians/lefthook/internal/templates/config.tmpl deleted file mode 100644 index 0f013f5699..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/templates/config.tmpl +++ /dev/null @@ -1,35 +0,0 @@ -# EXAMPLE USAGE: -# -# Refer for explanation to following link: -# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md -# -# pre-push: -# commands: -# packages-audit: -# tags: frontend security -# run: yarn audit -# gems-audit: -# tags: backend security -# run: bundle audit -# -# pre-commit: -# parallel: true -# commands: -# eslint: -# glob: "*.{js,ts,jsx,tsx}" -# run: yarn eslint {staged_files} -# rubocop: -# tags: backend style -# glob: "*.rb" -# exclude: "application.rb|routes.rb" -# run: bundle exec rubocop --force-exclusion {all_files} -# govet: -# tags: backend style -# files: git ls-files -m -# glob: "*.go" -# run: go vet {files} -# scripts: -# "hello.js": -# runner: node -# "any.go": -# runner: go run diff --git a/vendor/github.com/evilmartians/lefthook/internal/templates/hook.tmpl b/vendor/github.com/evilmartians/lefthook/internal/templates/hook.tmpl deleted file mode 100644 index 6432a74e00..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/templates/hook.tmpl +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -if [ "$LEFTHOOK" = "0" ]; then - exit 0 -fi - -{{- if .Rc}} -{{/* Load rc file and export all ENV vars defined in it */}} -set -a -[ -f {{.Rc}} ] && . {{.Rc}} -{{- end}} - -call_lefthook() -{ - dir="$(git rev-parse --show-toplevel)" - osArch=$(uname | tr '[:upper:]' '[:lower:]') - cpuArch=$(uname -m | sed 's/aarch64/arm64/') - - if lefthook{{.Extension}} -h >/dev/null 2>&1 - then - lefthook{{.Extension}} "$@" - {{if .Extension -}} - {{/* Check if lefthook.bat exists. Ruby bundler creates such a wrapper */ -}} - elif lefthook.bat -h >/dev/null 2>&1 - then - lefthook.bat "$@" - {{end -}} - elif test -f "$dir/node_modules/lefthook/bin/index.js" - then - "$dir/node_modules/lefthook/bin/index.js" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}" - then - "$dir/node_modules/@evilmartians/lefthook/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}" "$@" - elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}" - then - "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook_${osArch}_${cpuArch}/lefthook{{.Extension}}" "$@" - elif bundle exec lefthook -h >/dev/null 2>&1 - then - bundle exec lefthook "$@" - elif yarn lefthook -h >/dev/null 2>&1 - then - yarn lefthook "$@" - elif pnpm lefthook -h >/dev/null 2>&1 - then - pnpm lefthook "$@" - elif command -v npx >/dev/null 2>&1 - then - npx @evilmartians/lefthook "$@" - else - echo "Can't find lefthook in PATH" - fi -} - -call_lefthook run "{{.HookName}}" "$@" diff --git a/vendor/github.com/evilmartians/lefthook/internal/templates/templates.go b/vendor/github.com/evilmartians/lefthook/internal/templates/templates.go deleted file mode 100644 index 0a1112dbb8..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/templates/templates.go +++ /dev/null @@ -1,55 +0,0 @@ -package templates - -import ( - "bytes" - "embed" - "fmt" - "runtime" - "text/template" -) - -const checksumFormat = "%s %d\n" - -//go:embed * -var templatesFS embed.FS - -type hookTmplData struct { - HookName string - Extension string - Rc string -} - -func Hook(hookName, rc string) []byte { - buf := &bytes.Buffer{} - t := template.Must(template.ParseFS(templatesFS, "hook.tmpl")) - err := t.Execute(buf, hookTmplData{ - HookName: hookName, - Extension: getExtension(), - Rc: rc, - }) - if err != nil { - panic(err) - } - - return buf.Bytes() -} - -func Config() []byte { - tmpl, err := templatesFS.ReadFile("config.tmpl") - if err != nil { - panic(err) - } - - return tmpl -} - -func Checksum(checksum string, timestamp int64) []byte { - return []byte(fmt.Sprintf(checksumFormat, checksum, timestamp)) -} - -func getExtension() string { - if runtime.GOOS == "windows" { - return ".exe" - } - return "" -} diff --git a/vendor/github.com/evilmartians/lefthook/internal/version/version.go b/vendor/github.com/evilmartians/lefthook/internal/version/version.go deleted file mode 100644 index beec472068..0000000000 --- a/vendor/github.com/evilmartians/lefthook/internal/version/version.go +++ /dev/null @@ -1,88 +0,0 @@ -package version - -import ( - "errors" - "regexp" - "strconv" -) - -const version = "1.4.5" - -var ( - // Is set via -X github.com/evilmartians/lefthook/internal/version.commit={commit}. - commit string - - versionRegexp = regexp.MustCompile( - `^(?P\d+)(?:\.(?P\d+)(?:\.(?P\d+))?)?$`, - ) - - errIncorrectVersion = errors.New("format of 'min_version' setting is incorrect") - errUncovered = errors.New("required Lefthook version is higher than current") -) - -func Version(verbose bool) string { - if verbose { - return version + " " + commit - } - - return version -} - -// CheckCovered returns true if given version is less or equal than current -// and false otherwise. -func CheckCovered(targetVersion string) error { - if len(targetVersion) == 0 { - return nil - } - - if !versionRegexp.MatchString(targetVersion) { - return errIncorrectVersion - } - - major, minor, patch, err := parseVersion(version) - if err != nil { - return err - } - - tMajor, tMinor, tPatch, err := parseVersion(targetVersion) - if err != nil { - return err - } - - switch { - case major > tMajor: - return nil - case major < tMajor: - return errUncovered - case minor > tMinor: - return nil - case minor < tMinor: - return errUncovered - case patch >= tPatch: - return nil - default: - return errUncovered - } -} - -// parseVersion parses the version string of "1.2.3", "1.2", or just "1" and -// returns the major, minor and patch versions accordingly. -func parseVersion(version string) (major, minor, patch int, err error) { - matches := versionRegexp.FindStringSubmatch(version) - - majorID := versionRegexp.SubexpIndex("major") - minorID := versionRegexp.SubexpIndex("minor") - patchID := versionRegexp.SubexpIndex("patch") - - major, err = strconv.Atoi(matches[majorID]) - - if len(matches[minorID]) > 0 { - minor, err = strconv.Atoi(matches[minorID]) - } - - if len(matches[patchID]) > 0 { - patch, err = strconv.Atoi(matches[patchID]) - } - - return -} diff --git a/vendor/github.com/evilmartians/lefthook/logo.svg b/vendor/github.com/evilmartians/lefthook/logo.svg deleted file mode 100644 index 25a03a1604..0000000000 --- a/vendor/github.com/evilmartians/lefthook/logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/github.com/evilmartians/lefthook/logo_sign.svg b/vendor/github.com/evilmartians/lefthook/logo_sign.svg deleted file mode 100644 index 33c10ed137..0000000000 --- a/vendor/github.com/evilmartians/lefthook/logo_sign.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/vendor/github.com/evilmartians/lefthook/main.go b/vendor/github.com/evilmartians/lefthook/main.go deleted file mode 100644 index 25b3d8e3b3..0000000000 --- a/vendor/github.com/evilmartians/lefthook/main.go +++ /dev/null @@ -1,11 +0,0 @@ -package main - -import ( - "os" - - "github.com/evilmartians/lefthook/cmd" -) - -func main() { - os.Exit(cmd.Lefthook()) -} diff --git a/vendor/github.com/fatih/color/LICENSE.md b/vendor/github.com/fatih/color/LICENSE.md deleted file mode 100644 index 25fdaf639d..0000000000 --- a/vendor/github.com/fatih/color/LICENSE.md +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Fatih Arslan - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/fatih/color/README.md b/vendor/github.com/fatih/color/README.md deleted file mode 100644 index be82827cac..0000000000 --- a/vendor/github.com/fatih/color/README.md +++ /dev/null @@ -1,176 +0,0 @@ -# color [![](https://github.com/fatih/color/workflows/build/badge.svg)](https://github.com/fatih/color/actions) [![PkgGoDev](https://pkg.go.dev/badge/github.com/fatih/color)](https://pkg.go.dev/github.com/fatih/color) - -Color lets you use colorized outputs in terms of [ANSI Escape -Codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors) in Go (Golang). It -has support for Windows too! The API can be used in several ways, pick one that -suits you. - -![Color](https://user-images.githubusercontent.com/438920/96832689-03b3e000-13f4-11eb-9803-46f4c4de3406.jpg) - -## Install - -```bash -go get github.com/fatih/color -``` - -## Examples - -### Standard colors - -```go -// Print with default helper functions -color.Cyan("Prints text in cyan.") - -// A newline will be appended automatically -color.Blue("Prints %s in blue.", "text") - -// These are using the default foreground colors -color.Red("We have red") -color.Magenta("And many others ..") - -``` - -### Mix and reuse colors - -```go -// Create a new color object -c := color.New(color.FgCyan).Add(color.Underline) -c.Println("Prints cyan text with an underline.") - -// Or just add them to New() -d := color.New(color.FgCyan, color.Bold) -d.Printf("This prints bold cyan %s\n", "too!.") - -// Mix up foreground and background colors, create new mixes! -red := color.New(color.FgRed) - -boldRed := red.Add(color.Bold) -boldRed.Println("This will print text in bold red.") - -whiteBackground := red.Add(color.BgWhite) -whiteBackground.Println("Red text with white background.") -``` - -### Use your own output (io.Writer) - -```go -// Use your own io.Writer output -color.New(color.FgBlue).Fprintln(myWriter, "blue color!") - -blue := color.New(color.FgBlue) -blue.Fprint(writer, "This will print text in blue.") -``` - -### Custom print functions (PrintFunc) - -```go -// Create a custom print function for convenience -red := color.New(color.FgRed).PrintfFunc() -red("Warning") -red("Error: %s", err) - -// Mix up multiple attributes -notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() -notice("Don't forget this...") -``` - -### Custom fprint functions (FprintFunc) - -```go -blue := color.New(color.FgBlue).FprintfFunc() -blue(myWriter, "important notice: %s", stars) - -// Mix up with multiple attributes -success := color.New(color.Bold, color.FgGreen).FprintlnFunc() -success(myWriter, "Don't forget this...") -``` - -### Insert into noncolor strings (SprintFunc) - -```go -// Create SprintXxx functions to mix strings with other non-colorized strings: -yellow := color.New(color.FgYellow).SprintFunc() -red := color.New(color.FgRed).SprintFunc() -fmt.Printf("This is a %s and this is %s.\n", yellow("warning"), red("error")) - -info := color.New(color.FgWhite, color.BgGreen).SprintFunc() -fmt.Printf("This %s rocks!\n", info("package")) - -// Use helper functions -fmt.Println("This", color.RedString("warning"), "should be not neglected.") -fmt.Printf("%v %v\n", color.GreenString("Info:"), "an important message.") - -// Windows supported too! Just don't forget to change the output to color.Output -fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) -``` - -### Plug into existing code - -```go -// Use handy standard colors -color.Set(color.FgYellow) - -fmt.Println("Existing text will now be in yellow") -fmt.Printf("This one %s\n", "too") - -color.Unset() // Don't forget to unset - -// You can mix up parameters -color.Set(color.FgMagenta, color.Bold) -defer color.Unset() // Use it in your function - -fmt.Println("All text will now be bold magenta.") -``` - -### Disable/Enable color - -There might be a case where you want to explicitly disable/enable color output. the -`go-isatty` package will automatically disable color output for non-tty output streams -(for example if the output were piped directly to `less`). - -The `color` package also disables color output if the [`NO_COLOR`](https://no-color.org) environment -variable is set to a non-empty string. - -`Color` has support to disable/enable colors programmatically both globally and -for single color definitions. For example suppose you have a CLI app and a -`-no-color` bool flag. You can easily disable the color output with: - -```go -var flagNoColor = flag.Bool("no-color", false, "Disable color output") - -if *flagNoColor { - color.NoColor = true // disables colorized output -} -``` - -It also has support for single color definitions (local). You can -disable/enable color output on the fly: - -```go -c := color.New(color.FgCyan) -c.Println("Prints cyan text") - -c.DisableColor() -c.Println("This is printed without any color") - -c.EnableColor() -c.Println("This prints again cyan...") -``` - -## GitHub Actions - -To output color in GitHub Actions (or other CI systems that support ANSI colors), make sure to set `color.NoColor = false` so that it bypasses the check for non-tty output streams. - -## Todo - -* Save/Return previous values -* Evaluate fmt.Formatter interface - -## Credits - -* [Fatih Arslan](https://github.com/fatih) -* Windows support via @mattn: [colorable](https://github.com/mattn/go-colorable) - -## License - -The MIT License (MIT) - see [`LICENSE.md`](https://github.com/fatih/color/blob/master/LICENSE.md) for more details diff --git a/vendor/github.com/fatih/color/color.go b/vendor/github.com/fatih/color/color.go deleted file mode 100644 index c4234287dc..0000000000 --- a/vendor/github.com/fatih/color/color.go +++ /dev/null @@ -1,650 +0,0 @@ -package color - -import ( - "fmt" - "io" - "os" - "strconv" - "strings" - "sync" - - "github.com/mattn/go-colorable" - "github.com/mattn/go-isatty" -) - -var ( - // NoColor defines if the output is colorized or not. It's dynamically set to - // false or true based on the stdout's file descriptor referring to a terminal - // or not. It's also set to true if the NO_COLOR environment variable is - // set (regardless of its value). This is a global option and affects all - // colors. For more control over each color block use the methods - // DisableColor() individually. - NoColor = noColorIsSet() || os.Getenv("TERM") == "dumb" || - (!isatty.IsTerminal(os.Stdout.Fd()) && !isatty.IsCygwinTerminal(os.Stdout.Fd())) - - // Output defines the standard output of the print functions. By default, - // os.Stdout is used. - Output = colorable.NewColorableStdout() - - // Error defines a color supporting writer for os.Stderr. - Error = colorable.NewColorableStderr() - - // colorsCache is used to reduce the count of created Color objects and - // allows to reuse already created objects with required Attribute. - colorsCache = make(map[Attribute]*Color) - colorsCacheMu sync.Mutex // protects colorsCache -) - -// noColorIsSet returns true if the environment variable NO_COLOR is set to a non-empty string. -func noColorIsSet() bool { - return os.Getenv("NO_COLOR") != "" -} - -// Color defines a custom color object which is defined by SGR parameters. -type Color struct { - params []Attribute - noColor *bool -} - -// Attribute defines a single SGR Code -type Attribute int - -const escape = "\x1b" - -// Base attributes -const ( - Reset Attribute = iota - Bold - Faint - Italic - Underline - BlinkSlow - BlinkRapid - ReverseVideo - Concealed - CrossedOut -) - -const ( - ResetBold Attribute = iota + 22 - ResetItalic - ResetUnderline - ResetBlinking - _ - ResetReversed - ResetConcealed - ResetCrossedOut -) - -var mapResetAttributes map[Attribute]Attribute = map[Attribute]Attribute{ - Bold: ResetBold, - Faint: ResetBold, - Italic: ResetItalic, - Underline: ResetUnderline, - BlinkSlow: ResetBlinking, - BlinkRapid: ResetBlinking, - ReverseVideo: ResetReversed, - Concealed: ResetConcealed, - CrossedOut: ResetCrossedOut, -} - -// Foreground text colors -const ( - FgBlack Attribute = iota + 30 - FgRed - FgGreen - FgYellow - FgBlue - FgMagenta - FgCyan - FgWhite -) - -// Foreground Hi-Intensity text colors -const ( - FgHiBlack Attribute = iota + 90 - FgHiRed - FgHiGreen - FgHiYellow - FgHiBlue - FgHiMagenta - FgHiCyan - FgHiWhite -) - -// Background text colors -const ( - BgBlack Attribute = iota + 40 - BgRed - BgGreen - BgYellow - BgBlue - BgMagenta - BgCyan - BgWhite -) - -// Background Hi-Intensity text colors -const ( - BgHiBlack Attribute = iota + 100 - BgHiRed - BgHiGreen - BgHiYellow - BgHiBlue - BgHiMagenta - BgHiCyan - BgHiWhite -) - -// New returns a newly created color object. -func New(value ...Attribute) *Color { - c := &Color{ - params: make([]Attribute, 0), - } - - if noColorIsSet() { - c.noColor = boolPtr(true) - } - - c.Add(value...) - return c -} - -// Set sets the given parameters immediately. It will change the color of -// output with the given SGR parameters until color.Unset() is called. -func Set(p ...Attribute) *Color { - c := New(p...) - c.Set() - return c -} - -// Unset resets all escape attributes and clears the output. Usually should -// be called after Set(). -func Unset() { - if NoColor { - return - } - - fmt.Fprintf(Output, "%s[%dm", escape, Reset) -} - -// Set sets the SGR sequence. -func (c *Color) Set() *Color { - if c.isNoColorSet() { - return c - } - - fmt.Fprint(Output, c.format()) - return c -} - -func (c *Color) unset() { - if c.isNoColorSet() { - return - } - - Unset() -} - -// SetWriter is used to set the SGR sequence with the given io.Writer. This is -// a low-level function, and users should use the higher-level functions, such -// as color.Fprint, color.Print, etc. -func (c *Color) SetWriter(w io.Writer) *Color { - if c.isNoColorSet() { - return c - } - - fmt.Fprint(w, c.format()) - return c -} - -// UnsetWriter resets all escape attributes and clears the output with the give -// io.Writer. Usually should be called after SetWriter(). -func (c *Color) UnsetWriter(w io.Writer) { - if c.isNoColorSet() { - return - } - - if NoColor { - return - } - - fmt.Fprintf(w, "%s[%dm", escape, Reset) -} - -// Add is used to chain SGR parameters. Use as many as parameters to combine -// and create custom color objects. Example: Add(color.FgRed, color.Underline). -func (c *Color) Add(value ...Attribute) *Color { - c.params = append(c.params, value...) - return c -} - -// Fprint formats using the default formats for its operands and writes to w. -// Spaces are added between operands when neither is a string. -// It returns the number of bytes written and any write error encountered. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprint(w io.Writer, a ...interface{}) (n int, err error) { - c.SetWriter(w) - defer c.UnsetWriter(w) - - return fmt.Fprint(w, a...) -} - -// Print formats using the default formats for its operands and writes to -// standard output. Spaces are added between operands when neither is a -// string. It returns the number of bytes written and any write error -// encountered. This is the standard fmt.Print() method wrapped with the given -// color. -func (c *Color) Print(a ...interface{}) (n int, err error) { - c.Set() - defer c.unset() - - return fmt.Fprint(Output, a...) -} - -// Fprintf formats according to a format specifier and writes to w. -// It returns the number of bytes written and any write error encountered. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) { - c.SetWriter(w) - defer c.UnsetWriter(w) - - return fmt.Fprintf(w, format, a...) -} - -// Printf formats according to a format specifier and writes to standard output. -// It returns the number of bytes written and any write error encountered. -// This is the standard fmt.Printf() method wrapped with the given color. -func (c *Color) Printf(format string, a ...interface{}) (n int, err error) { - c.Set() - defer c.unset() - - return fmt.Fprintf(Output, format, a...) -} - -// Fprintln formats using the default formats for its operands and writes to w. -// Spaces are always added between operands and a newline is appended. -// On Windows, users should wrap w with colorable.NewColorable() if w is of -// type *os.File. -func (c *Color) Fprintln(w io.Writer, a ...interface{}) (n int, err error) { - return fmt.Fprintln(w, c.wrap(fmt.Sprint(a...))) -} - -// Println formats using the default formats for its operands and writes to -// standard output. Spaces are always added between operands and a newline is -// appended. It returns the number of bytes written and any write error -// encountered. This is the standard fmt.Print() method wrapped with the given -// color. -func (c *Color) Println(a ...interface{}) (n int, err error) { - return fmt.Fprintln(Output, c.wrap(fmt.Sprint(a...))) -} - -// Sprint is just like Print, but returns a string instead of printing it. -func (c *Color) Sprint(a ...interface{}) string { - return c.wrap(fmt.Sprint(a...)) -} - -// Sprintln is just like Println, but returns a string instead of printing it. -func (c *Color) Sprintln(a ...interface{}) string { - return fmt.Sprintln(c.Sprint(a...)) -} - -// Sprintf is just like Printf, but returns a string instead of printing it. -func (c *Color) Sprintf(format string, a ...interface{}) string { - return c.wrap(fmt.Sprintf(format, a...)) -} - -// FprintFunc returns a new function that prints the passed arguments as -// colorized with color.Fprint(). -func (c *Color) FprintFunc() func(w io.Writer, a ...interface{}) { - return func(w io.Writer, a ...interface{}) { - c.Fprint(w, a...) - } -} - -// PrintFunc returns a new function that prints the passed arguments as -// colorized with color.Print(). -func (c *Color) PrintFunc() func(a ...interface{}) { - return func(a ...interface{}) { - c.Print(a...) - } -} - -// FprintfFunc returns a new function that prints the passed arguments as -// colorized with color.Fprintf(). -func (c *Color) FprintfFunc() func(w io.Writer, format string, a ...interface{}) { - return func(w io.Writer, format string, a ...interface{}) { - c.Fprintf(w, format, a...) - } -} - -// PrintfFunc returns a new function that prints the passed arguments as -// colorized with color.Printf(). -func (c *Color) PrintfFunc() func(format string, a ...interface{}) { - return func(format string, a ...interface{}) { - c.Printf(format, a...) - } -} - -// FprintlnFunc returns a new function that prints the passed arguments as -// colorized with color.Fprintln(). -func (c *Color) FprintlnFunc() func(w io.Writer, a ...interface{}) { - return func(w io.Writer, a ...interface{}) { - c.Fprintln(w, a...) - } -} - -// PrintlnFunc returns a new function that prints the passed arguments as -// colorized with color.Println(). -func (c *Color) PrintlnFunc() func(a ...interface{}) { - return func(a ...interface{}) { - c.Println(a...) - } -} - -// SprintFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprint(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output, example: -// -// put := New(FgYellow).SprintFunc() -// fmt.Fprintf(color.Output, "This is a %s", put("warning")) -func (c *Color) SprintFunc() func(a ...interface{}) string { - return func(a ...interface{}) string { - return c.wrap(fmt.Sprint(a...)) - } -} - -// SprintfFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprintf(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output. -func (c *Color) SprintfFunc() func(format string, a ...interface{}) string { - return func(format string, a ...interface{}) string { - return c.wrap(fmt.Sprintf(format, a...)) - } -} - -// SprintlnFunc returns a new function that returns colorized strings for the -// given arguments with fmt.Sprintln(). Useful to put into or mix into other -// string. Windows users should use this in conjunction with color.Output. -func (c *Color) SprintlnFunc() func(a ...interface{}) string { - return func(a ...interface{}) string { - return fmt.Sprintln(c.Sprint(a...)) - } -} - -// sequence returns a formatted SGR sequence to be plugged into a "\x1b[...m" -// an example output might be: "1;36" -> bold cyan -func (c *Color) sequence() string { - format := make([]string, len(c.params)) - for i, v := range c.params { - format[i] = strconv.Itoa(int(v)) - } - - return strings.Join(format, ";") -} - -// wrap wraps the s string with the colors attributes. The string is ready to -// be printed. -func (c *Color) wrap(s string) string { - if c.isNoColorSet() { - return s - } - - return c.format() + s + c.unformat() -} - -func (c *Color) format() string { - return fmt.Sprintf("%s[%sm", escape, c.sequence()) -} - -func (c *Color) unformat() string { - //return fmt.Sprintf("%s[%dm", escape, Reset) - //for each element in sequence let's use the speficic reset escape, ou the generic one if not found - format := make([]string, len(c.params)) - for i, v := range c.params { - format[i] = strconv.Itoa(int(Reset)) - ra, ok := mapResetAttributes[v] - if ok { - format[i] = strconv.Itoa(int(ra)) - } - } - - return fmt.Sprintf("%s[%sm", escape, strings.Join(format, ";")) -} - -// DisableColor disables the color output. Useful to not change any existing -// code and still being able to output. Can be used for flags like -// "--no-color". To enable back use EnableColor() method. -func (c *Color) DisableColor() { - c.noColor = boolPtr(true) -} - -// EnableColor enables the color output. Use it in conjunction with -// DisableColor(). Otherwise, this method has no side effects. -func (c *Color) EnableColor() { - c.noColor = boolPtr(false) -} - -func (c *Color) isNoColorSet() bool { - // check first if we have user set action - if c.noColor != nil { - return *c.noColor - } - - // if not return the global option, which is disabled by default - return NoColor -} - -// Equals returns a boolean value indicating whether two colors are equal. -func (c *Color) Equals(c2 *Color) bool { - if c == nil && c2 == nil { - return true - } - if c == nil || c2 == nil { - return false - } - if len(c.params) != len(c2.params) { - return false - } - - for _, attr := range c.params { - if !c2.attrExists(attr) { - return false - } - } - - return true -} - -func (c *Color) attrExists(a Attribute) bool { - for _, attr := range c.params { - if attr == a { - return true - } - } - - return false -} - -func boolPtr(v bool) *bool { - return &v -} - -func getCachedColor(p Attribute) *Color { - colorsCacheMu.Lock() - defer colorsCacheMu.Unlock() - - c, ok := colorsCache[p] - if !ok { - c = New(p) - colorsCache[p] = c - } - - return c -} - -func colorPrint(format string, p Attribute, a ...interface{}) { - c := getCachedColor(p) - - if !strings.HasSuffix(format, "\n") { - format += "\n" - } - - if len(a) == 0 { - c.Print(format) - } else { - c.Printf(format, a...) - } -} - -func colorString(format string, p Attribute, a ...interface{}) string { - c := getCachedColor(p) - - if len(a) == 0 { - return c.SprintFunc()(format) - } - - return c.SprintfFunc()(format, a...) -} - -// Black is a convenient helper function to print with black foreground. A -// newline is appended to format by default. -func Black(format string, a ...interface{}) { colorPrint(format, FgBlack, a...) } - -// Red is a convenient helper function to print with red foreground. A -// newline is appended to format by default. -func Red(format string, a ...interface{}) { colorPrint(format, FgRed, a...) } - -// Green is a convenient helper function to print with green foreground. A -// newline is appended to format by default. -func Green(format string, a ...interface{}) { colorPrint(format, FgGreen, a...) } - -// Yellow is a convenient helper function to print with yellow foreground. -// A newline is appended to format by default. -func Yellow(format string, a ...interface{}) { colorPrint(format, FgYellow, a...) } - -// Blue is a convenient helper function to print with blue foreground. A -// newline is appended to format by default. -func Blue(format string, a ...interface{}) { colorPrint(format, FgBlue, a...) } - -// Magenta is a convenient helper function to print with magenta foreground. -// A newline is appended to format by default. -func Magenta(format string, a ...interface{}) { colorPrint(format, FgMagenta, a...) } - -// Cyan is a convenient helper function to print with cyan foreground. A -// newline is appended to format by default. -func Cyan(format string, a ...interface{}) { colorPrint(format, FgCyan, a...) } - -// White is a convenient helper function to print with white foreground. A -// newline is appended to format by default. -func White(format string, a ...interface{}) { colorPrint(format, FgWhite, a...) } - -// BlackString is a convenient helper function to return a string with black -// foreground. -func BlackString(format string, a ...interface{}) string { return colorString(format, FgBlack, a...) } - -// RedString is a convenient helper function to return a string with red -// foreground. -func RedString(format string, a ...interface{}) string { return colorString(format, FgRed, a...) } - -// GreenString is a convenient helper function to return a string with green -// foreground. -func GreenString(format string, a ...interface{}) string { return colorString(format, FgGreen, a...) } - -// YellowString is a convenient helper function to return a string with yellow -// foreground. -func YellowString(format string, a ...interface{}) string { return colorString(format, FgYellow, a...) } - -// BlueString is a convenient helper function to return a string with blue -// foreground. -func BlueString(format string, a ...interface{}) string { return colorString(format, FgBlue, a...) } - -// MagentaString is a convenient helper function to return a string with magenta -// foreground. -func MagentaString(format string, a ...interface{}) string { - return colorString(format, FgMagenta, a...) -} - -// CyanString is a convenient helper function to return a string with cyan -// foreground. -func CyanString(format string, a ...interface{}) string { return colorString(format, FgCyan, a...) } - -// WhiteString is a convenient helper function to return a string with white -// foreground. -func WhiteString(format string, a ...interface{}) string { return colorString(format, FgWhite, a...) } - -// HiBlack is a convenient helper function to print with hi-intensity black foreground. A -// newline is appended to format by default. -func HiBlack(format string, a ...interface{}) { colorPrint(format, FgHiBlack, a...) } - -// HiRed is a convenient helper function to print with hi-intensity red foreground. A -// newline is appended to format by default. -func HiRed(format string, a ...interface{}) { colorPrint(format, FgHiRed, a...) } - -// HiGreen is a convenient helper function to print with hi-intensity green foreground. A -// newline is appended to format by default. -func HiGreen(format string, a ...interface{}) { colorPrint(format, FgHiGreen, a...) } - -// HiYellow is a convenient helper function to print with hi-intensity yellow foreground. -// A newline is appended to format by default. -func HiYellow(format string, a ...interface{}) { colorPrint(format, FgHiYellow, a...) } - -// HiBlue is a convenient helper function to print with hi-intensity blue foreground. A -// newline is appended to format by default. -func HiBlue(format string, a ...interface{}) { colorPrint(format, FgHiBlue, a...) } - -// HiMagenta is a convenient helper function to print with hi-intensity magenta foreground. -// A newline is appended to format by default. -func HiMagenta(format string, a ...interface{}) { colorPrint(format, FgHiMagenta, a...) } - -// HiCyan is a convenient helper function to print with hi-intensity cyan foreground. A -// newline is appended to format by default. -func HiCyan(format string, a ...interface{}) { colorPrint(format, FgHiCyan, a...) } - -// HiWhite is a convenient helper function to print with hi-intensity white foreground. A -// newline is appended to format by default. -func HiWhite(format string, a ...interface{}) { colorPrint(format, FgHiWhite, a...) } - -// HiBlackString is a convenient helper function to return a string with hi-intensity black -// foreground. -func HiBlackString(format string, a ...interface{}) string { - return colorString(format, FgHiBlack, a...) -} - -// HiRedString is a convenient helper function to return a string with hi-intensity red -// foreground. -func HiRedString(format string, a ...interface{}) string { return colorString(format, FgHiRed, a...) } - -// HiGreenString is a convenient helper function to return a string with hi-intensity green -// foreground. -func HiGreenString(format string, a ...interface{}) string { - return colorString(format, FgHiGreen, a...) -} - -// HiYellowString is a convenient helper function to return a string with hi-intensity yellow -// foreground. -func HiYellowString(format string, a ...interface{}) string { - return colorString(format, FgHiYellow, a...) -} - -// HiBlueString is a convenient helper function to return a string with hi-intensity blue -// foreground. -func HiBlueString(format string, a ...interface{}) string { return colorString(format, FgHiBlue, a...) } - -// HiMagentaString is a convenient helper function to return a string with hi-intensity magenta -// foreground. -func HiMagentaString(format string, a ...interface{}) string { - return colorString(format, FgHiMagenta, a...) -} - -// HiCyanString is a convenient helper function to return a string with hi-intensity cyan -// foreground. -func HiCyanString(format string, a ...interface{}) string { return colorString(format, FgHiCyan, a...) } - -// HiWhiteString is a convenient helper function to return a string with hi-intensity white -// foreground. -func HiWhiteString(format string, a ...interface{}) string { - return colorString(format, FgHiWhite, a...) -} diff --git a/vendor/github.com/fatih/color/color_windows.go b/vendor/github.com/fatih/color/color_windows.go deleted file mode 100644 index be01c558e5..0000000000 --- a/vendor/github.com/fatih/color/color_windows.go +++ /dev/null @@ -1,19 +0,0 @@ -package color - -import ( - "os" - - "golang.org/x/sys/windows" -) - -func init() { - // Opt-in for ansi color support for current process. - // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences - var outMode uint32 - out := windows.Handle(os.Stdout.Fd()) - if err := windows.GetConsoleMode(out, &outMode); err != nil { - return - } - outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING - _ = windows.SetConsoleMode(out, outMode) -} diff --git a/vendor/github.com/fatih/color/doc.go b/vendor/github.com/fatih/color/doc.go deleted file mode 100644 index 9491ad5413..0000000000 --- a/vendor/github.com/fatih/color/doc.go +++ /dev/null @@ -1,134 +0,0 @@ -/* -Package color is an ANSI color package to output colorized or SGR defined -output to the standard output. The API can be used in several way, pick one -that suits you. - -Use simple and default helper functions with predefined foreground colors: - - color.Cyan("Prints text in cyan.") - - // a newline will be appended automatically - color.Blue("Prints %s in blue.", "text") - - // More default foreground colors.. - color.Red("We have red") - color.Yellow("Yellow color too!") - color.Magenta("And many others ..") - - // Hi-intensity colors - color.HiGreen("Bright green color.") - color.HiBlack("Bright black means gray..") - color.HiWhite("Shiny white color!") - -However, there are times when custom color mixes are required. Below are some -examples to create custom color objects and use the print functions of each -separate color object. - - // Create a new color object - c := color.New(color.FgCyan).Add(color.Underline) - c.Println("Prints cyan text with an underline.") - - // Or just add them to New() - d := color.New(color.FgCyan, color.Bold) - d.Printf("This prints bold cyan %s\n", "too!.") - - - // Mix up foreground and background colors, create new mixes! - red := color.New(color.FgRed) - - boldRed := red.Add(color.Bold) - boldRed.Println("This will print text in bold red.") - - whiteBackground := red.Add(color.BgWhite) - whiteBackground.Println("Red text with White background.") - - // Use your own io.Writer output - color.New(color.FgBlue).Fprintln(myWriter, "blue color!") - - blue := color.New(color.FgBlue) - blue.Fprint(myWriter, "This will print text in blue.") - -You can create PrintXxx functions to simplify even more: - - // Create a custom print function for convenient - red := color.New(color.FgRed).PrintfFunc() - red("warning") - red("error: %s", err) - - // Mix up multiple attributes - notice := color.New(color.Bold, color.FgGreen).PrintlnFunc() - notice("don't forget this...") - -You can also FprintXxx functions to pass your own io.Writer: - - blue := color.New(FgBlue).FprintfFunc() - blue(myWriter, "important notice: %s", stars) - - // Mix up with multiple attributes - success := color.New(color.Bold, color.FgGreen).FprintlnFunc() - success(myWriter, don't forget this...") - -Or create SprintXxx functions to mix strings with other non-colorized strings: - - yellow := New(FgYellow).SprintFunc() - red := New(FgRed).SprintFunc() - - fmt.Printf("this is a %s and this is %s.\n", yellow("warning"), red("error")) - - info := New(FgWhite, BgGreen).SprintFunc() - fmt.Printf("this %s rocks!\n", info("package")) - -Windows support is enabled by default. All Print functions work as intended. -However, only for color.SprintXXX functions, user should use fmt.FprintXXX and -set the output to color.Output: - - fmt.Fprintf(color.Output, "Windows support: %s", color.GreenString("PASS")) - - info := New(FgWhite, BgGreen).SprintFunc() - fmt.Fprintf(color.Output, "this %s rocks!\n", info("package")) - -Using with existing code is possible. Just use the Set() method to set the -standard output to the given parameters. That way a rewrite of an existing -code is not required. - - // Use handy standard colors. - color.Set(color.FgYellow) - - fmt.Println("Existing text will be now in Yellow") - fmt.Printf("This one %s\n", "too") - - color.Unset() // don't forget to unset - - // You can mix up parameters - color.Set(color.FgMagenta, color.Bold) - defer color.Unset() // use it in your function - - fmt.Println("All text will be now bold magenta.") - -There might be a case where you want to disable color output (for example to -pipe the standard output of your app to somewhere else). `Color` has support to -disable colors both globally and for single color definition. For example -suppose you have a CLI app and a `--no-color` bool flag. You can easily disable -the color output with: - - var flagNoColor = flag.Bool("no-color", false, "Disable color output") - - if *flagNoColor { - color.NoColor = true // disables colorized output - } - -You can also disable the color by setting the NO_COLOR environment variable to any value. - -It also has support for single color definitions (local). You can -disable/enable color output on the fly: - - c := color.New(color.FgCyan) - c.Println("Prints cyan text") - - c.DisableColor() - c.Println("This is printed without any color") - - c.EnableColor() - c.Println("This prints again cyan...") -*/ -package color diff --git a/vendor/github.com/fatih/structtag/LICENSE b/vendor/github.com/fatih/structtag/LICENSE deleted file mode 100644 index 4fd15f9f8f..0000000000 --- a/vendor/github.com/fatih/structtag/LICENSE +++ /dev/null @@ -1,60 +0,0 @@ -Copyright (c) 2017, Fatih Arslan -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of structtag nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -This software includes some portions from Go. Go is used under the terms of the -BSD like license. - -Copyright (c) 2012 The Go Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The Go gopher was designed by Renee French. http://reneefrench.blogspot.com/ The design is licensed under the Creative Commons 3.0 Attributions license. Read this article for more details: https://blog.golang.org/gopher diff --git a/vendor/github.com/fatih/structtag/README.md b/vendor/github.com/fatih/structtag/README.md deleted file mode 100644 index c4e8b1e86e..0000000000 --- a/vendor/github.com/fatih/structtag/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# structtag [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/fatih/structtag) - -structtag provides an easy way of parsing and manipulating struct tag fields. -Please vendor the library as it might change in future versions. - -# Install - -```bash -go get github.com/fatih/structtag -``` - -# Example - -```go -package main - -import ( - "fmt" - "reflect" - "sort" - - "github.com/fatih/structtag" -) - -func main() { - type t struct { - t string `json:"foo,omitempty,string" xml:"foo"` - } - - // get field tag - tag := reflect.TypeOf(t{}).Field(0).Tag - - // ... and start using structtag by parsing the tag - tags, err := structtag.Parse(string(tag)) - if err != nil { - panic(err) - } - - // iterate over all tags - for _, t := range tags.Tags() { - fmt.Printf("tag: %+v\n", t) - } - - // get a single tag - jsonTag, err := tags.Get("json") - if err != nil { - panic(err) - } - fmt.Println(jsonTag) // Output: json:"foo,omitempty,string" - fmt.Println(jsonTag.Key) // Output: json - fmt.Println(jsonTag.Name) // Output: foo - fmt.Println(jsonTag.Options) // Output: [omitempty string] - - // change existing tag - jsonTag.Name = "foo_bar" - jsonTag.Options = nil - tags.Set(jsonTag) - - // add new tag - tags.Set(&structtag.Tag{ - Key: "hcl", - Name: "foo", - Options: []string{"squash"}, - }) - - // print the tags - fmt.Println(tags) // Output: json:"foo_bar" xml:"foo" hcl:"foo,squash" - - // sort tags according to keys - sort.Sort(tags) - fmt.Println(tags) // Output: hcl:"foo,squash" json:"foo_bar" xml:"foo" -} -``` diff --git a/vendor/github.com/fatih/structtag/tags.go b/vendor/github.com/fatih/structtag/tags.go deleted file mode 100644 index c168fb21c6..0000000000 --- a/vendor/github.com/fatih/structtag/tags.go +++ /dev/null @@ -1,315 +0,0 @@ -package structtag - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "strings" -) - -var ( - errTagSyntax = errors.New("bad syntax for struct tag pair") - errTagKeySyntax = errors.New("bad syntax for struct tag key") - errTagValueSyntax = errors.New("bad syntax for struct tag value") - - errKeyNotSet = errors.New("tag key does not exist") - errTagNotExist = errors.New("tag does not exist") - errTagKeyMismatch = errors.New("mismatch between key and tag.key") -) - -// Tags represent a set of tags from a single struct field -type Tags struct { - tags []*Tag -} - -// Tag defines a single struct's string literal tag -type Tag struct { - // Key is the tag key, such as json, xml, etc.. - // i.e: `json:"foo,omitempty". Here key is: "json" - Key string - - // Name is a part of the value - // i.e: `json:"foo,omitempty". Here name is: "foo" - Name string - - // Options is a part of the value. It contains a slice of tag options i.e: - // `json:"foo,omitempty". Here options is: ["omitempty"] - Options []string -} - -// Parse parses a single struct field tag and returns the set of tags. -func Parse(tag string) (*Tags, error) { - var tags []*Tag - - hasTag := tag != "" - - // NOTE(arslan) following code is from reflect and vet package with some - // modifications to collect all necessary information and extend it with - // usable methods - for tag != "" { - // Skip leading space. - i := 0 - for i < len(tag) && tag[i] == ' ' { - i++ - } - tag = tag[i:] - if tag == "" { - break - } - - // Scan to colon. A space, a quote or a control character is a syntax - // error. Strictly speaking, control chars include the range [0x7f, - // 0x9f], not just [0x00, 0x1f], but in practice, we ignore the - // multi-byte control characters as it is simpler to inspect the tag's - // bytes than the tag's runes. - i = 0 - for i < len(tag) && tag[i] > ' ' && tag[i] != ':' && tag[i] != '"' && tag[i] != 0x7f { - i++ - } - - if i == 0 { - return nil, errTagKeySyntax - } - if i+1 >= len(tag) || tag[i] != ':' { - return nil, errTagSyntax - } - if tag[i+1] != '"' { - return nil, errTagValueSyntax - } - - key := string(tag[:i]) - tag = tag[i+1:] - - // Scan quoted string to find value. - i = 1 - for i < len(tag) && tag[i] != '"' { - if tag[i] == '\\' { - i++ - } - i++ - } - if i >= len(tag) { - return nil, errTagValueSyntax - } - - qvalue := string(tag[:i+1]) - tag = tag[i+1:] - - value, err := strconv.Unquote(qvalue) - if err != nil { - return nil, errTagValueSyntax - } - - res := strings.Split(value, ",") - name := res[0] - options := res[1:] - if len(options) == 0 { - options = nil - } - - tags = append(tags, &Tag{ - Key: key, - Name: name, - Options: options, - }) - } - - if hasTag && len(tags) == 0 { - return nil, nil - } - - return &Tags{ - tags: tags, - }, nil -} - -// Get returns the tag associated with the given key. If the key is present -// in the tag the value (which may be empty) is returned. Otherwise the -// returned value will be the empty string. The ok return value reports whether -// the tag exists or not (which the return value is nil). -func (t *Tags) Get(key string) (*Tag, error) { - for _, tag := range t.tags { - if tag.Key == key { - return tag, nil - } - } - - return nil, errTagNotExist -} - -// Set sets the given tag. If the tag key already exists it'll override it -func (t *Tags) Set(tag *Tag) error { - if tag.Key == "" { - return errKeyNotSet - } - - added := false - for i, tg := range t.tags { - if tg.Key == tag.Key { - added = true - t.tags[i] = tag - } - } - - if !added { - // this means this is a new tag, add it - t.tags = append(t.tags, tag) - } - - return nil -} - -// AddOptions adds the given option for the given key. If the option already -// exists it doesn't add it again. -func (t *Tags) AddOptions(key string, options ...string) { - for i, tag := range t.tags { - if tag.Key != key { - continue - } - - for _, opt := range options { - if !tag.HasOption(opt) { - tag.Options = append(tag.Options, opt) - } - } - - t.tags[i] = tag - } -} - -// DeleteOptions deletes the given options for the given key -func (t *Tags) DeleteOptions(key string, options ...string) { - hasOption := func(option string) bool { - for _, opt := range options { - if opt == option { - return true - } - } - return false - } - - for i, tag := range t.tags { - if tag.Key != key { - continue - } - - var updated []string - for _, opt := range tag.Options { - if !hasOption(opt) { - updated = append(updated, opt) - } - } - - tag.Options = updated - t.tags[i] = tag - } -} - -// Delete deletes the tag for the given keys -func (t *Tags) Delete(keys ...string) { - hasKey := func(key string) bool { - for _, k := range keys { - if k == key { - return true - } - } - return false - } - - var updated []*Tag - for _, tag := range t.tags { - if !hasKey(tag.Key) { - updated = append(updated, tag) - } - } - - t.tags = updated -} - -// Tags returns a slice of tags. The order is the original tag order unless it -// was changed. -func (t *Tags) Tags() []*Tag { - return t.tags -} - -// Tags returns a slice of tags. The order is the original tag order unless it -// was changed. -func (t *Tags) Keys() []string { - var keys []string - for _, tag := range t.tags { - keys = append(keys, tag.Key) - } - return keys -} - -// String reassembles the tags into a valid literal tag field representation -func (t *Tags) String() string { - tags := t.Tags() - if len(tags) == 0 { - return "" - } - - var buf bytes.Buffer - for i, tag := range t.Tags() { - buf.WriteString(tag.String()) - if i != len(tags)-1 { - buf.WriteString(" ") - } - } - return buf.String() -} - -// HasOption returns true if the given option is available in options -func (t *Tag) HasOption(opt string) bool { - for _, tagOpt := range t.Options { - if tagOpt == opt { - return true - } - } - - return false -} - -// Value returns the raw value of the tag, i.e. if the tag is -// `json:"foo,omitempty", the Value is "foo,omitempty" -func (t *Tag) Value() string { - options := strings.Join(t.Options, ",") - if options != "" { - return fmt.Sprintf(`%s,%s`, t.Name, options) - } - return t.Name -} - -// String reassembles the tag into a valid tag field representation -func (t *Tag) String() string { - return fmt.Sprintf(`%s:%q`, t.Key, t.Value()) -} - -// GoString implements the fmt.GoStringer interface -func (t *Tag) GoString() string { - template := `{ - Key: '%s', - Name: '%s', - Option: '%s', - }` - - if t.Options == nil { - return fmt.Sprintf(template, t.Key, t.Name, "nil") - } - - options := strings.Join(t.Options, ",") - return fmt.Sprintf(template, t.Key, t.Name, options) -} - -func (t *Tags) Len() int { - return len(t.tags) -} - -func (t *Tags) Less(i int, j int) bool { - return t.tags[i].Key < t.tags[j].Key -} - -func (t *Tags) Swap(i int, j int) { - t.tags[i], t.tags[j] = t.tags[j], t.tags[i] -} diff --git a/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt b/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt deleted file mode 100644 index f90fadc355..0000000000 --- a/vendor/github.com/felixge/fgprof/BenchmarkProfilerGoroutines.txt +++ /dev/null @@ -1,25 +0,0 @@ -$ go test -bench=BenchmarkProfilerGoroutines -goos: darwin -goarch: amd64 -pkg: github.com/felixge/fgprof -BenchmarkProfilerGoroutines/1_goroutines-8 43431 26860 ns/op -BenchmarkProfilerGoroutines/2_goroutines-8 42590 27648 ns/op -BenchmarkProfilerGoroutines/4_goroutines-8 40725 28694 ns/op -BenchmarkProfilerGoroutines/8_goroutines-8 37874 31067 ns/op -BenchmarkProfilerGoroutines/16_goroutines-8 32778 37302 ns/op -BenchmarkProfilerGoroutines/32_goroutines-8 25447 47171 ns/op -BenchmarkProfilerGoroutines/64_goroutines-8 17937 66803 ns/op -BenchmarkProfilerGoroutines/128_goroutines-8 11138 108283 ns/op -BenchmarkProfilerGoroutines/256_goroutines-8 5232 191830 ns/op -BenchmarkProfilerGoroutines/512_goroutines-8 2848 351686 ns/op -BenchmarkProfilerGoroutines/1024_goroutines-8 1611 681412 ns/op -BenchmarkProfilerGoroutines/2048_goroutines-8 846 1396125 ns/op -BenchmarkProfilerGoroutines/4096_goroutines-8 358 3286943 ns/op -BenchmarkProfilerGoroutines/8192_goroutines-8 153 7813804 ns/op -BenchmarkProfilerGoroutines/16384_goroutines-8 70 16440643 ns/op -BenchmarkProfilerGoroutines/32768_goroutines-8 33 34101649 ns/op -BenchmarkProfilerGoroutines/65536_goroutines-8 16 68460458 ns/op -BenchmarkProfilerGoroutines/131072_goroutines-8 8 134481118 ns/op -BenchmarkProfilerGoroutines/262144_goroutines-8 4 270522885 ns/op -BenchmarkProfilerGoroutines/524288_goroutines-8 2 567821104 ns/op -BenchmarkProfilerGoroutines/1048576_goroutines-8 1 1202184643 ns/op diff --git a/vendor/github.com/felixge/fgprof/LICENSE.txt b/vendor/github.com/felixge/fgprof/LICENSE.txt deleted file mode 100644 index 3e424911bd..0000000000 --- a/vendor/github.com/felixge/fgprof/LICENSE.txt +++ /dev/null @@ -1,8 +0,0 @@ -The MIT License (MIT) -Copyright © 2020 Felix Geisendörfer - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/felixge/fgprof/README.md b/vendor/github.com/felixge/fgprof/README.md deleted file mode 100644 index 15b16794b9..0000000000 --- a/vendor/github.com/felixge/fgprof/README.md +++ /dev/null @@ -1,204 +0,0 @@ -[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go)](https://pkg.go.dev/github.com/felixge/fgprof) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/felixge/fgprof/Go) -![GitHub](https://img.shields.io/github/license/felixge/fgprof) - -# :rocket: fgprof - The Full Go Profiler - -fgprof is a sampling [Go](https://golang.org/) profiler that allows you to analyze On-CPU as well as [Off-CPU](http://www.brendangregg.com/offcpuanalysis.html) (e.g. I/O) time together. - -Go's builtin sampling CPU profiler can only show On-CPU time, but it's better than fgprof at that. Go also includes tracing profilers that can analyze I/O, but they can't be combined with the CPU profiler. - -fgprof is designed for analyzing applications with mixed I/O and CPU workloads. This kind of profiling is also known as wall-clock profiling. - -⚠️ Please upgrade to Go 1.19 or newer. In older versions of Go fgprof can cause significant STW latencies in applications with a lot of goroutines (> 1-10k). See [CL 387415](https://go-review.googlesource.com/c/go/+/387415) for more details. - -## Quick Start - -If this is the first time you hear about fgprof, you should start by reading about [The Problem](#the-problem) & [How it Works](#how-it-works). - -There is no need to choose between fgprof and the builtin profiler. Here is how to add both to your application: - -```go -package main - -import( - _ "net/http/pprof" - "github.com/felixge/fgprof" -) - -func main() { - http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler()) - go func() { - log.Println(http.ListenAndServe(":6060", nil)) - }() - - // -} -``` - -fgprof is compatible with the `go tool pprof` visualizer, so taking and analyzing a 3s profile is as simple as: - -``` -go tool pprof --http=:6061 http://localhost:6060/debug/fgprof?seconds=3 -``` - -![](./assets/fgprof_pprof.png) - -Additionally fgprof supports the plain text format used by Brendan Gregg's [FlameGraph](http://www.brendangregg.com/flamegraphs.html) utility: - -``` -git clone https://github.com/brendangregg/FlameGraph -cd FlameGraph -curl -s 'localhost:6060/debug/fgprof?seconds=3&format=folded' > fgprof.folded -./flamegraph.pl fgprof.folded > fgprof.svg -``` - -![](./assets/fgprof_gregg.png) - -Which tool you prefer is up to you, but one thing I like about Gregg's tool is that you can filter the plaintext files using grep which can be very useful when analyzing large programs. - -If you don't have a program to profile right now, you can `go run ./example` which should allow you to reproduce the graphs you see above. If you've never seen such graphs before, and are unsure how to read them, head over to Brendan Gregg's [Flame Graph](http://www.brendangregg.com/flamegraphs.html) page. - -## The Problem - -Let's say you've been tasked to optimize a simple program that has a loop calling out to three functions: - -```go -func main() { - for { - // Http request to a web service that might be slow. - slowNetworkRequest() - // Some heavy CPU computation. - cpuIntensiveTask() - // Poorly named function that you don't understand yet. - weirdFunction() - } -} -``` - -One way to decide which of these three functions you should focus your attention on would be to wrap each function call like this: - -```go -start := time.Start() -slowNetworkRequest() -fmt.Printf("slowNetworkRequest: %s\n", time.Since(start)) -// ... -``` - -However, this can be very tedious for large programs. You'll also have to figure out how to average the numbers in case they fluctuate. And once you've done that, you'll have to repeat the process for the functions called by the function you decide to focus on. - -### /debug/pprof/profile - -So, this seems like a perfect use case for a profiler. Let's try the `/debug/pprof/profile` endpoint of the builtin `net/http/pprof` pkg to analyze our program for 10s: - -```go -import _ "net/http/pprof" - -func main() { - go func() { - log.Println(http.ListenAndServe(":6060", nil)) - }() - - // -} -``` - -``` -go tool pprof -http=:6061 http://localhost:6060/debug/pprof/profile?seconds=10 -``` - -That was easy! Looks like we're spending all our time in `cpuIntensiveTask()`, so let's focus on that? - -![](./assets/pprof_cpu.png) - -But before we get carried away, let's quickly double check this assumption by manually timing our function calls with `time.Since()` as described above: - -``` -slowNetworkRequest: 66.815041ms -cpuIntensiveTask: 30.000672ms -weirdFunction: 10.64764ms -slowNetworkRequest: 67.194516ms -cpuIntensiveTask: 30.000912ms -weirdFunction: 10.105371ms -// ... -``` - -Oh no, the builtin CPU profiler is misleading us! How is that possible? Well, it turns out the builtin profiler only shows On-CPU time. Time spent waiting on I/O is completely hidden from us. - -### /debug/pprof/trace - -Let's try something else. The `/debug/pprof/trace` endpoint includes a "synchronization blocking profile", maybe that's what we need? - -``` -curl -so pprof.trace http://localhost:6060/debug/pprof/trace?seconds=10 -go tool trace --pprof=sync pprof.trace > sync.pprof -go tool pprof --http=:6061 sync.pprof -``` - -Oh no, we're being mislead again. This profiler thinks all our time is spent on `slowNetworkRequest()`. It's completely missing `cpuIntensiveTask()`. And what about `weirdFunction()`? It seems like no builtin profiler can see it? - -![](./assets/pprof_trace.png) - -### /debug/fgprof - -So what can we do? Let's try fgprof, which is designed to analyze mixed I/O and CPU workloads like the one we're dealing with here. We can easily add it alongside the builtin profilers. - -```go -import( - _ "net/http/pprof" - "github.com/felixge/fgprof" -) - -func main() { - http.DefaultServeMux.Handle("/debug/fgprof", fgprof.Handler()) - go func() { - log.Println(http.ListenAndServe(":6060", nil)) - }() - - // -} -``` - - - -``` -go tool pprof --http=:6061 http://localhost:6060/debug/fgprof?seconds=10 -``` - -Finally, a profile that shows all three of our functions and how much time we're spending on them. It also turns out our `weirdFunction()` was simply calling `time.Sleep()`, how weird indeed! - -![](./assets/fgprof_pprof.png) - -## How it Works - -### fgprof - -fgprof is implemented as a background goroutine that wakes up 99 times per second and calls `runtime.GoroutineProfile`. This returns a list of all goroutines regardless of their current On/Off CPU scheduling status and their call stacks. - -This data is used to maintain an in-memory stack counter which can be converted to the pprof or folded output format. The meat of the implementation is super simple and < 100 lines of code, you should [check it out](./fgprof.go). - -The overhead of fgprof increases with the number of active goroutines (including those waiting on I/O, Channels, Locks, etc.) executed by your program. If your program typically has less than 1000 active goroutines, you shouldn't have much to worry about. However, at 10k or more goroutines fgprof might start to cause some noticeable overhead. - -### Go's builtin CPU Profiler - -The builtin Go CPU profiler uses the [setitimer(2)](https://linux.die.net/man/2/setitimer) system call to ask the operating system to be sent a `SIGPROF` signal 100 times a second. Each signal stops the Go process and gets delivered to a random thread's `sigtrampgo()` function. This function then proceeds to call `sigprof()` or `sigprofNonGo()` to record the thread's current stack. - -Since Go uses non-blocking I/O, Goroutines that wait on I/O are parked and not running on any threads. Therefore they end up being largely invisible to Go's builtin CPU profiler. - -## Known Issues - -There is no perfect approach to profiling, and fgprof is no exception. Below is a list of known issues that will hopefully not be of practical concern for most users, but are important to highlight. - -- Internal C functions are not showing up in the stack traces, e.g. `runtime.nanotime` which is called by `time.Since` in the example program. -- The current implementation is relying on the Go scheduler to schedule the internal goroutine at a fixed sample rate. Scheduler delays, especially biased ones, might cause inaccuracies. - -## Credits - -The following articles helped me to learn more about how profilers in general, and the Go profiler in particular work. - -- [How do Ruby & Python profilers work?](https://jvns.ca/blog/2017/12/17/how-do-ruby---python-profilers-work-/) by Julia Evans -- [Profiling Go programs with pprof](https://jvns.ca/blog/2017/09/24/profiling-go-with-pprof/) by Julia Evans - -## License - -fgprof is licensed under the MIT License. diff --git a/vendor/github.com/felixge/fgprof/fgprof.go b/vendor/github.com/felixge/fgprof/fgprof.go deleted file mode 100644 index 18f7d6f5fe..0000000000 --- a/vendor/github.com/felixge/fgprof/fgprof.go +++ /dev/null @@ -1,307 +0,0 @@ -// fgprof is a sampling Go profiler that allows you to analyze On-CPU as well -// as [Off-CPU](http://www.brendangregg.com/offcpuanalysis.html) (e.g. I/O) -// time together. -package fgprof - -import ( - "fmt" - "io" - "runtime" - "sort" - "strings" - "time" - - "github.com/google/pprof/profile" -) - -// Format decides how the output is rendered to the user. -type Format string - -const ( - // FormatFolded is used by Brendan Gregg's FlameGraph utility, see - // https://github.com/brendangregg/FlameGraph#2-fold-stacks. - FormatFolded Format = "folded" - // FormatPprof is used by Google's pprof utility, see - // https://github.com/google/pprof/blob/master/proto/README.md. - FormatPprof Format = "pprof" -) - -// Start begins profiling the goroutines of the program and returns a function -// that needs to be invoked by the caller to stop the profiling and write the -// results to w using the given format. -func Start(w io.Writer, format Format) func() error { - startTime := time.Now() - - // Go's CPU profiler uses 100hz, but 99hz might be less likely to result in - // accidental synchronization with the program we're profiling. - const hz = 99 - ticker := time.NewTicker(time.Second / hz) - stopCh := make(chan struct{}) - - prof := &profiler{} - profile := newWallclockProfile() - - go func() { - defer ticker.Stop() - - for { - select { - case <-ticker.C: - stacks := prof.GoroutineProfile() - profile.Add(stacks) - case <-stopCh: - return - } - } - }() - - return func() error { - stopCh <- struct{}{} - endTime := time.Now() - profile.Ignore(prof.SelfFrames()...) - return profile.Export(w, format, hz, startTime, endTime) - } -} - -// profiler provides a convenient and performant way to access -// runtime.GoroutineProfile(). -type profiler struct { - stacks []runtime.StackRecord - selfFrame *runtime.Frame -} - -// GoroutineProfile returns the stacks of all goroutines currently managed by -// the scheduler. This includes both goroutines that are currently running -// (On-CPU), as well as waiting (Off-CPU). -func (p *profiler) GoroutineProfile() []runtime.StackRecord { - if p.selfFrame == nil { - // Determine the runtime.Frame of this func so we can hide it from our - // profiling output. - rpc := make([]uintptr, 1) - n := runtime.Callers(1, rpc) - if n < 1 { - panic("could not determine selfFrame") - } - selfFrame, _ := runtime.CallersFrames(rpc).Next() - p.selfFrame = &selfFrame - } - - // We don't know how many goroutines exist, so we have to grow p.stacks - // dynamically. We overshoot by 10% since it's possible that more goroutines - // are launched in between two calls to GoroutineProfile. Once p.stacks - // reaches the maximum number of goroutines used by the program, it will get - // reused indefinitely, eliminating GoroutineProfile calls and allocations. - // - // TODO(fg) There might be workloads where it would be nice to shrink - // p.stacks dynamically as well, but let's not over-engineer this until we - // understand those cases better. - for { - n, ok := runtime.GoroutineProfile(p.stacks) - if !ok { - p.stacks = make([]runtime.StackRecord, int(float64(n)*1.1)) - } else { - return p.stacks[0:n] - } - } -} - -// SelfFrames returns frames that belong to the profiler so that we can ignore -// them when exporting the final profile. -func (p *profiler) SelfFrames() []*runtime.Frame { - if p.selfFrame != nil { - return []*runtime.Frame{p.selfFrame} - } - return nil -} - -func newWallclockProfile() *wallclockProfile { - return &wallclockProfile{stacks: map[[32]uintptr]*wallclockStack{}} -} - -// wallclockProfile holds a wallclock profile that can be exported in different -// formats. -type wallclockProfile struct { - stacks map[[32]uintptr]*wallclockStack - ignore []*runtime.Frame -} - -// wallclockStack holds the symbolized frames of a stack trace and the number -// of times it has been seen. -type wallclockStack struct { - frames []*runtime.Frame - count int -} - -// Ignore sets a list of frames that should be ignored when exporting the -// profile. -func (p *wallclockProfile) Ignore(frames ...*runtime.Frame) { - p.ignore = frames -} - -// Add adds the given stack traces to the profile. -func (p *wallclockProfile) Add(stackRecords []runtime.StackRecord) { - for _, stackRecord := range stackRecords { - if _, ok := p.stacks[stackRecord.Stack0]; !ok { - ws := &wallclockStack{} - // symbolize pcs into frames - frames := runtime.CallersFrames(stackRecord.Stack()) - for { - frame, more := frames.Next() - ws.frames = append(ws.frames, &frame) - if !more { - break - } - } - p.stacks[stackRecord.Stack0] = ws - } - p.stacks[stackRecord.Stack0].count++ - } -} - -func (p *wallclockProfile) Export(w io.Writer, f Format, hz int, startTime, endTime time.Time) error { - switch f { - case FormatFolded: - return p.exportFolded(w) - case FormatPprof: - return p.exportPprof(hz, startTime, endTime).Write(w) - default: - return fmt.Errorf("unknown format: %q", f) - } -} - -// exportStacks returns the stacks in this profile except those that have been -// set to Ignore(). -func (p *wallclockProfile) exportStacks() []*wallclockStack { - stacks := make([]*wallclockStack, 0, len(p.stacks)) -nextStack: - for _, ws := range p.stacks { - for _, f := range ws.frames { - for _, igf := range p.ignore { - if f.Entry == igf.Entry { - continue nextStack - } - } - } - stacks = append(stacks, ws) - } - return stacks -} - -func (p *wallclockProfile) exportFolded(w io.Writer) error { - var lines []string - stacks := p.exportStacks() - for _, ws := range stacks { - var foldedStack []string - for _, f := range ws.frames { - foldedStack = append(foldedStack, f.Function) - } - line := fmt.Sprintf("%s %d", strings.Join(foldedStack, ";"), ws.count) - lines = append(lines, line) - } - sort.Strings(lines) - _, err := io.WriteString(w, strings.Join(lines, "\n")+"\n") - return err -} - -func (p *wallclockProfile) exportPprof(hz int, startTime, endTime time.Time) *profile.Profile { - prof := &profile.Profile{} - m := &profile.Mapping{ID: 1, HasFunctions: true} - prof.Period = int64(1e9 / hz) // Number of nanoseconds between samples. - prof.TimeNanos = startTime.UnixNano() - prof.DurationNanos = int64(endTime.Sub(startTime)) - prof.Mapping = []*profile.Mapping{m} - prof.SampleType = []*profile.ValueType{ - { - Type: "samples", - Unit: "count", - }, - { - Type: "time", - Unit: "nanoseconds", - }, - } - prof.PeriodType = &profile.ValueType{ - Type: "wallclock", - Unit: "nanoseconds", - } - - type functionKey struct { - Name string - Filename string - } - funcIdx := map[functionKey]*profile.Function{} - - type locationKey struct { - Function functionKey - Line int - } - locationIdx := map[locationKey]*profile.Location{} - for _, ws := range p.exportStacks() { - sample := &profile.Sample{ - Value: []int64{ - int64(ws.count), - int64(1000 * 1000 * 1000 / hz * ws.count), - }, - } - - for _, frame := range ws.frames { - fnKey := functionKey{Name: frame.Function, Filename: frame.File} - function, ok := funcIdx[fnKey] - if !ok { - function = &profile.Function{ - ID: uint64(len(prof.Function)) + 1, - Name: frame.Function, - SystemName: frame.Function, - Filename: frame.File, - } - funcIdx[fnKey] = function - prof.Function = append(prof.Function, function) - } - - locKey := locationKey{Function: fnKey, Line: frame.Line} - location, ok := locationIdx[locKey] - if !ok { - location = &profile.Location{ - ID: uint64(len(prof.Location)) + 1, - Mapping: m, - Line: []profile.Line{{ - Function: function, - Line: int64(frame.Line), - }}, - } - locationIdx[locKey] = location - prof.Location = append(prof.Location, location) - } - sample.Location = append(sample.Location, location) - } - prof.Sample = append(prof.Sample, sample) - } - return prof -} - -type symbolizedStacks map[[32]uintptr][]frameCount - -func (w wallclockProfile) Symbolize(exclude *runtime.Frame) symbolizedStacks { - m := make(symbolizedStacks) -outer: - for stack0, ws := range w.stacks { - frames := runtime.CallersFrames((&runtime.StackRecord{Stack0: stack0}).Stack()) - - for { - frame, more := frames.Next() - if frame.Entry == exclude.Entry { - continue outer - } - m[stack0] = append(m[stack0], frameCount{Frame: &frame, Count: ws.count}) - if !more { - break - } - } - } - return m -} - -type frameCount struct { - *runtime.Frame - Count int -} diff --git a/vendor/github.com/felixge/fgprof/handler.go b/vendor/github.com/felixge/fgprof/handler.go deleted file mode 100644 index ce28f01344..0000000000 --- a/vendor/github.com/felixge/fgprof/handler.go +++ /dev/null @@ -1,35 +0,0 @@ -package fgprof - -import ( - "fmt" - "net/http" - "strconv" - "time" -) - -// Handler returns an http handler that takes an optional "seconds" query -// argument that defaults to "30" and produces a profile over this duration. -// The optional "format" parameter controls if the output is written in -// Google's "pprof" format (default) or Brendan Gregg's "folded" stack format. -func Handler() http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var seconds int - var err error - if s := r.URL.Query().Get("seconds"); s == "" { - seconds = 30 - } else if seconds, err = strconv.Atoi(s); err != nil || seconds <= 0 { - w.WriteHeader(http.StatusBadRequest) - fmt.Fprintf(w, "bad seconds: %d: %s\n", seconds, err) - return - } - - format := Format(r.URL.Query().Get("format")) - if format == "" { - format = FormatPprof - } - - stop := Start(w, format) - defer stop() - time.Sleep(time.Duration(seconds) * time.Second) - }) -} diff --git a/vendor/github.com/felixge/httpsnoop/.gitignore b/vendor/github.com/felixge/httpsnoop/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/github.com/felixge/httpsnoop/LICENSE.txt b/vendor/github.com/felixge/httpsnoop/LICENSE.txt deleted file mode 100644 index e028b46a9b..0000000000 --- a/vendor/github.com/felixge/httpsnoop/LICENSE.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2016 Felix Geisendörfer (felix@debuggable.com) - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. diff --git a/vendor/github.com/felixge/httpsnoop/Makefile b/vendor/github.com/felixge/httpsnoop/Makefile deleted file mode 100644 index 4e12afdd90..0000000000 --- a/vendor/github.com/felixge/httpsnoop/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -.PHONY: ci generate clean - -ci: clean generate - go test -race -v ./... - -generate: - go generate . - -clean: - rm -rf *_generated*.go diff --git a/vendor/github.com/felixge/httpsnoop/README.md b/vendor/github.com/felixge/httpsnoop/README.md deleted file mode 100644 index cf6b42f3d7..0000000000 --- a/vendor/github.com/felixge/httpsnoop/README.md +++ /dev/null @@ -1,95 +0,0 @@ -# httpsnoop - -Package httpsnoop provides an easy way to capture http related metrics (i.e. -response time, bytes written, and http status code) from your application's -http.Handlers. - -Doing this requires non-trivial wrapping of the http.ResponseWriter interface, -which is also exposed for users interested in a more low-level API. - -[![Go Reference](https://pkg.go.dev/badge/github.com/felixge/httpsnoop.svg)](https://pkg.go.dev/github.com/felixge/httpsnoop) -[![Build Status](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml/badge.svg)](https://github.com/felixge/httpsnoop/actions/workflows/main.yaml) - -## Usage Example - -```go -// myH is your app's http handler, perhaps a http.ServeMux or similar. -var myH http.Handler -// wrappedH wraps myH in order to log every request. -wrappedH := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - m := httpsnoop.CaptureMetrics(myH, w, r) - log.Printf( - "%s %s (code=%d dt=%s written=%d)", - r.Method, - r.URL, - m.Code, - m.Duration, - m.Written, - ) -}) -http.ListenAndServe(":8080", wrappedH) -``` - -## Why this package exists - -Instrumenting an application's http.Handler is surprisingly difficult. - -However if you google for e.g. "capture ResponseWriter status code" you'll find -lots of advise and code examples that suggest it to be a fairly trivial -undertaking. Unfortunately everything I've seen so far has a high chance of -breaking your application. - -The main problem is that a `http.ResponseWriter` often implements additional -interfaces such as `http.Flusher`, `http.CloseNotifier`, `http.Hijacker`, `http.Pusher`, and -`io.ReaderFrom`. So the naive approach of just wrapping `http.ResponseWriter` -in your own struct that also implements the `http.ResponseWriter` interface -will hide the additional interfaces mentioned above. This has a high change of -introducing subtle bugs into any non-trivial application. - -Another approach I've seen people take is to return a struct that implements -all of the interfaces above. However, that's also problematic, because it's -difficult to fake some of these interfaces behaviors when the underlying -`http.ResponseWriter` doesn't have an implementation. It's also dangerous, -because an application may choose to operate differently, merely because it -detects the presence of these additional interfaces. - -This package solves this problem by checking which additional interfaces a -`http.ResponseWriter` implements, returning a wrapped version implementing the -exact same set of interfaces. - -Additionally this package properly handles edge cases such as `WriteHeader` not -being called, or called more than once, as well as concurrent calls to -`http.ResponseWriter` methods, and even calls happening after the wrapped -`ServeHTTP` has already returned. - -Unfortunately this package is not perfect either. It's possible that it is -still missing some interfaces provided by the go core (let me know if you find -one), and it won't work for applications adding their own interfaces into the -mix. You can however use `httpsnoop.Unwrap(w)` to access the underlying -`http.ResponseWriter` and type-assert the result to its other interfaces. - -However, hopefully the explanation above has sufficiently scared you of rolling -your own solution to this problem. httpsnoop may still break your application, -but at least it tries to avoid it as much as possible. - -Anyway, the real problem here is that smuggling additional interfaces inside -`http.ResponseWriter` is a problematic design choice, but it probably goes as -deep as the Go language specification itself. But that's okay, I still prefer -Go over the alternatives ;). - -## Performance - -``` -BenchmarkBaseline-8 20000 94912 ns/op -BenchmarkCaptureMetrics-8 20000 95461 ns/op -``` - -As you can see, using `CaptureMetrics` on a vanilla http.Handler introduces an -overhead of ~500 ns per http request on my machine. However, the margin of -error appears to be larger than that, therefor it should be reasonable to -assume that the overhead introduced by `CaptureMetrics` is absolutely -negligible. - -## License - -MIT diff --git a/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/vendor/github.com/felixge/httpsnoop/capture_metrics.go deleted file mode 100644 index bec7b71b39..0000000000 --- a/vendor/github.com/felixge/httpsnoop/capture_metrics.go +++ /dev/null @@ -1,86 +0,0 @@ -package httpsnoop - -import ( - "io" - "net/http" - "time" -) - -// Metrics holds metrics captured from CaptureMetrics. -type Metrics struct { - // Code is the first http response code passed to the WriteHeader func of - // the ResponseWriter. If no such call is made, a default code of 200 is - // assumed instead. - Code int - // Duration is the time it took to execute the handler. - Duration time.Duration - // Written is the number of bytes successfully written by the Write or - // ReadFrom function of the ResponseWriter. ResponseWriters may also write - // data to their underlaying connection directly (e.g. headers), but those - // are not tracked. Therefor the number of Written bytes will usually match - // the size of the response body. - Written int64 -} - -// CaptureMetrics wraps the given hnd, executes it with the given w and r, and -// returns the metrics it captured from it. -func CaptureMetrics(hnd http.Handler, w http.ResponseWriter, r *http.Request) Metrics { - return CaptureMetricsFn(w, func(ww http.ResponseWriter) { - hnd.ServeHTTP(ww, r) - }) -} - -// CaptureMetricsFn wraps w and calls fn with the wrapped w and returns the -// resulting metrics. This is very similar to CaptureMetrics (which is just -// sugar on top of this func), but is a more usable interface if your -// application doesn't use the Go http.Handler interface. -func CaptureMetricsFn(w http.ResponseWriter, fn func(http.ResponseWriter)) Metrics { - m := Metrics{Code: http.StatusOK} - m.CaptureMetrics(w, fn) - return m -} - -// CaptureMetrics wraps w and calls fn with the wrapped w and updates -// Metrics m with the resulting metrics. This is similar to CaptureMetricsFn, -// but allows one to customize starting Metrics object. -func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWriter)) { - var ( - start = time.Now() - headerWritten bool - hooks = Hooks{ - WriteHeader: func(next WriteHeaderFunc) WriteHeaderFunc { - return func(code int) { - next(code) - - if !(code >= 100 && code <= 199) && !headerWritten { - m.Code = code - headerWritten = true - } - } - }, - - Write: func(next WriteFunc) WriteFunc { - return func(p []byte) (int, error) { - n, err := next(p) - - m.Written += int64(n) - headerWritten = true - return n, err - } - }, - - ReadFrom: func(next ReadFromFunc) ReadFromFunc { - return func(src io.Reader) (int64, error) { - n, err := next(src) - - headerWritten = true - m.Written += n - return n, err - } - }, - } - ) - - fn(Wrap(w, hooks)) - m.Duration += time.Since(start) -} diff --git a/vendor/github.com/felixge/httpsnoop/docs.go b/vendor/github.com/felixge/httpsnoop/docs.go deleted file mode 100644 index 203c35b3c6..0000000000 --- a/vendor/github.com/felixge/httpsnoop/docs.go +++ /dev/null @@ -1,10 +0,0 @@ -// Package httpsnoop provides an easy way to capture http related metrics (i.e. -// response time, bytes written, and http status code) from your application's -// http.Handlers. -// -// Doing this requires non-trivial wrapping of the http.ResponseWriter -// interface, which is also exposed for users interested in a more low-level -// API. -package httpsnoop - -//go:generate go run codegen/main.go diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go deleted file mode 100644 index 101cedde67..0000000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go +++ /dev/null @@ -1,436 +0,0 @@ -// +build go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// PushFunc is part of the http.Pusher interface. -type PushFunc func(target string, opts *http.PushOptions) error - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc - Push func(PushFunc) PushFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// - http.Pusher -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - _, i4 := w.(http.Pusher) - switch { - // combination 1/32 - case !i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/32 - case !i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Pusher - }{rw, rw, rw} - // combination 3/32 - case !i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 4/32 - case !i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw} - // combination 5/32 - case !i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 6/32 - case !i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - http.Pusher - }{rw, rw, rw, rw} - // combination 7/32 - case !i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 8/32 - case !i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 9/32 - case !i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 10/32 - case !i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw} - // combination 11/32 - case !i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 12/32 - case !i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 13/32 - case !i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 14/32 - case !i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 15/32 - case !i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 16/32 - case !i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 17/32 - case i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 18/32 - case i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Pusher - }{rw, rw, rw, rw} - // combination 19/32 - case i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 20/32 - case i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 21/32 - case i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 22/32 - case i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 23/32 - case i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 24/32 - case i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 25/32 - case i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 26/32 - case i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 27/32 - case i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 28/32 - case i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 29/32 - case i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 30/32 - case i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 31/32 - case i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - // combination 32/32 - case i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -func (w *rw) Push(target string, opts *http.PushOptions) error { - f := w.w.(http.Pusher).Push - if w.h.Push != nil { - f = w.h.Push(f) - } - return f(target, opts) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go deleted file mode 100644 index e0951df152..0000000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go +++ /dev/null @@ -1,278 +0,0 @@ -// +build !go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - switch { - // combination 1/16 - case !i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/16 - case !i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 3/16 - case !i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 4/16 - case !i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 5/16 - case !i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 6/16 - case !i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 7/16 - case !i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 8/16 - case !i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 9/16 - case i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 10/16 - case i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 11/16 - case i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 12/16 - case i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 13/16 - case i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 14/16 - case i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 15/16 - case i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 16/16 - case i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/firefart/nonamedreturns/LICENSE b/vendor/github.com/firefart/nonamedreturns/LICENSE deleted file mode 100644 index f288702d2f..0000000000 --- a/vendor/github.com/firefart/nonamedreturns/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/github.com/firefart/nonamedreturns/analyzer/analyzer.go b/vendor/github.com/firefart/nonamedreturns/analyzer/analyzer.go deleted file mode 100644 index 6ad97ab491..0000000000 --- a/vendor/github.com/firefart/nonamedreturns/analyzer/analyzer.go +++ /dev/null @@ -1,134 +0,0 @@ -package analyzer - -import ( - "flag" - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const FlagReportErrorInDefer = "report-error-in-defer" - -var Analyzer = &analysis.Analyzer{ - Name: "nonamedreturns", - Doc: "Reports all named returns", - Flags: flags(), - Run: run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, -} - -func flags() flag.FlagSet { - fs := flag.FlagSet{} - fs.Bool(FlagReportErrorInDefer, false, "report named error if it is assigned inside defer") - return fs -} - -func run(pass *analysis.Pass) (interface{}, error) { - reportErrorInDefer := pass.Analyzer.Flags.Lookup(FlagReportErrorInDefer).Value.String() == "true" - errorType := types.Universe.Lookup("error").Type() - - inspector := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - // only filter function defintions - nodeFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - (*ast.FuncLit)(nil), - } - - inspector.Preorder(nodeFilter, func(node ast.Node) { - var funcResults *ast.FieldList - var funcBody *ast.BlockStmt - - switch n := node.(type) { - case *ast.FuncLit: - funcResults = n.Type.Results - funcBody = n.Body - case *ast.FuncDecl: - funcResults = n.Type.Results - funcBody = n.Body - default: - return - } - - // no return values - if funcResults == nil { - return - } - - resultsList := funcResults.List - - for _, p := range resultsList { - if len(p.Names) == 0 { - // all good, the parameter is not named - continue - } - - for _, n := range p.Names { - if n.Name == "_" { - continue - } - - if !reportErrorInDefer && - types.Identical(pass.TypesInfo.TypeOf(p.Type), errorType) && - findDeferWithVariableAssignment(funcBody, pass.TypesInfo, pass.TypesInfo.ObjectOf(n)) { - continue - } - - pass.Reportf(node.Pos(), "named return %q with type %q found", n.Name, types.ExprString(p.Type)) - } - } - }) - - return nil, nil -} - -func findDeferWithVariableAssignment(body *ast.BlockStmt, info *types.Info, variable types.Object) bool { - found := false - - ast.Inspect(body, func(node ast.Node) bool { - if found { - return false // stop inspection - } - - if d, ok := node.(*ast.DeferStmt); ok { - if fn, ok2 := d.Call.Fun.(*ast.FuncLit); ok2 { - if findVariableAssignment(fn.Body, info, variable) { - found = true - return false - } - } - } - - return true - }) - - return found -} - -func findVariableAssignment(body *ast.BlockStmt, info *types.Info, variable types.Object) bool { - found := false - - ast.Inspect(body, func(node ast.Node) bool { - if found { - return false // stop inspection - } - - if a, ok := node.(*ast.AssignStmt); ok { - for _, lh := range a.Lhs { - if i, ok2 := lh.(*ast.Ident); ok2 { - if info.ObjectOf(i) == variable { - found = true - return false - } - } - } - } - - return true - }) - - return found -} diff --git a/vendor/github.com/fzipp/gocyclo/CHANGELOG.md b/vendor/github.com/fzipp/gocyclo/CHANGELOG.md deleted file mode 100644 index c9bedfb3b0..0000000000 --- a/vendor/github.com/fzipp/gocyclo/CHANGELOG.md +++ /dev/null @@ -1,58 +0,0 @@ -# Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [0.6.0] - 2022-06-15 -### Changed -- Breaking: remove meaningless `-total` and `-total-short` options - -## [0.5.1] - 2022-04-06 -### Fixed -- Don't skip directories `.` and `..` - -## [0.5.0] - 2022-03-22 -### Changed -- Ignore `vendor` and `testdata` directories and directories with names - that begin with `.` or `_` - -## [0.4.0] - 2021-12-19 -### Added -- Support method receivers with type parameters introduced in Go 1.18 - -### Changed -- Use more efficient filepath.WalkDir instead of filepath.Walk - -## [0.3.1] - 2020-10-20 -### Added -- Test coverage - -### Fixed -- Fix cyclomatic complexity for function literals (base complexity of 1 was missing) - -## [0.3.0] - 2020-10-17 -### Added -- New `-avg-short` and `-total-short` options for printing average and total cyclomatic complexities without label -- Export the `AnalyzeASTFile` function in package API -- Doc comments for exported functions and types - -### Fixed -- Ignore `default` cases - -## [0.2.0] - 2020-10-17 -### Added -- Support for gocyclo as a package -- Support for ignoring of individual functions via a new `gocyclo:ignore` directive -- New `-total` option to compute total cyclomatic complexity -- New `-ignore` option to ignore files matching a regular expression -- Analysis of function literals at declaration level - -### Changed -- Breaking: installation changed to `go get github.com/fzipp/gocyclo/cmd/gocyclo` - -## [0.1.0] - 2020-10-17 - -### Added -- `go.mod` file; beginning of versioning - diff --git a/vendor/github.com/fzipp/gocyclo/CONTRIBUTORS b/vendor/github.com/fzipp/gocyclo/CONTRIBUTORS deleted file mode 100644 index 1c09f1a06a..0000000000 --- a/vendor/github.com/fzipp/gocyclo/CONTRIBUTORS +++ /dev/null @@ -1,7 +0,0 @@ -# Names should be added to this file like so: -# Name - -# Please keep the list sorted. - -Frederik Zipp -Harshavardhana diff --git a/vendor/github.com/fzipp/gocyclo/LICENSE b/vendor/github.com/fzipp/gocyclo/LICENSE deleted file mode 100644 index 45f88d6cb3..0000000000 --- a/vendor/github.com/fzipp/gocyclo/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) 2013 Frederik Zipp. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of the copyright owner nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/fzipp/gocyclo/README.md b/vendor/github.com/fzipp/gocyclo/README.md deleted file mode 100644 index d357b8ef71..0000000000 --- a/vendor/github.com/fzipp/gocyclo/README.md +++ /dev/null @@ -1,106 +0,0 @@ -# gocyclo - -[![PkgGoDev](https://pkg.go.dev/badge/github.com/fzipp/gocyclo)](https://pkg.go.dev/github.com/fzipp/gocyclo) -![Build Status](https://github.com/fzipp/gocyclo/workflows/build/badge.svg) -[![Go Report Card](https://goreportcard.com/badge/github.com/fzipp/gocyclo)](https://goreportcard.com/report/github.com/fzipp/gocyclo) - -Gocyclo calculates -[cyclomatic complexities](https://en.wikipedia.org/wiki/Cyclomatic_complexity) -of functions in Go source code. - -Cyclomatic complexity is a -[code quality metric](https://en.wikipedia.org/wiki/Software_metric) -which can be used to identify code that needs refactoring. -It measures the number of linearly independent paths through a function's -source code. - -The cyclomatic complexity of a function is calculated according to the -following rules: - -``` - 1 is the base complexity of a function -+1 for each 'if', 'for', 'case', '&&' or '||' -``` - -A function with a higher cyclomatic complexity requires more test cases to -cover all possible paths and is potentially harder to understand. The -complexity can be reduced by applying common refactoring techniques that lead -to smaller functions. - -## Installation - -To install the `gocyclo` command, run - -``` -$ go install github.com/fzipp/gocyclo/cmd/gocyclo@latest -``` - -and put the resulting binary in one of your PATH directories if -`$GOPATH/bin` isn't already in your PATH. - -## Usage - -``` -Calculate cyclomatic complexities of Go functions. -Usage: - gocyclo [flags] ... - -Flags: - -over N show functions with complexity > N only and - return exit code 1 if the set is non-empty - -top N show the top N most complex functions only - -avg, -avg-short show the average complexity over all functions; - the short option prints the value without a label - -ignore REGEX exclude files matching the given regular expression - -The output fields for each line are: - -``` - -## Examples - -``` -$ gocyclo . -$ gocyclo main.go -$ gocyclo -top 10 src/ -$ gocyclo -over 25 docker -$ gocyclo -avg . -$ gocyclo -top 20 -ignore "_test|Godeps|vendor/" . -$ gocyclo -over 3 -avg gocyclo/ -``` - -Example output: - -``` -9 gocyclo (*complexityVisitor).Visit complexity.go:30:1 -8 main main cmd/gocyclo/main.go:53:1 -7 gocyclo (*fileAnalyzer).analyzeDecl analyze.go:96:1 -4 gocyclo Analyze analyze.go:24:1 -4 gocyclo parseDirectives directives.go:27:1 -4 gocyclo (Stats).SortAndFilter stats.go:52:1 -Average: 2.72 -``` - -Note that the average is calculated over all analyzed functions, -not just the printed ones. - -### Ignoring individual functions - -Individual functions can be ignored with a `gocyclo:ignore` directive: - -``` -//gocyclo:ignore -func f1() { - // ... -} - -//gocyclo:ignore -var f2 = func() { - // ... -} -``` - -## License - -This project is free and open source software licensed under the -[BSD 3-Clause License](LICENSE). diff --git a/vendor/github.com/fzipp/gocyclo/analyze.go b/vendor/github.com/fzipp/gocyclo/analyze.go deleted file mode 100644 index 2d8bcff257..0000000000 --- a/vendor/github.com/fzipp/gocyclo/analyze.go +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright 2020 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocyclo - -import ( - "fmt" - "go/ast" - "go/parser" - "go/token" - "io/fs" - "log" - "os" - "path/filepath" - "regexp" - "strings" -) - -// Analyze calculates the cyclomatic complexities of the functions and methods -// in the Go source code files in the given paths. If a path is a directory -// all Go files under that directory are analyzed recursively. -// Files with paths matching the 'ignore' regular expressions are skipped. -// The 'ignore' parameter can be nil, meaning that no files are skipped. -func Analyze(paths []string, ignore *regexp.Regexp) Stats { - var stats Stats - for _, path := range paths { - info, err := os.Stat(path) - if err != nil { - log.Printf("could not get file info for path %q: %s\n", path, err) - continue - } - if info.IsDir() { - stats = analyzeDir(path, ignore, stats) - } else { - stats = analyzeFile(path, ignore, stats) - } - } - return stats -} - -func analyzeDir(dirname string, ignore *regexp.Regexp, stats Stats) Stats { - filepath.WalkDir(dirname, func(path string, entry fs.DirEntry, err error) error { - if isSkipDir(entry) { - return filepath.SkipDir - } - if err == nil && isGoFile(entry) { - stats = analyzeFile(path, ignore, stats) - } - return err - }) - return stats -} - -var skipDirs = map[string]bool{ - "testdata": true, - "vendor": true, -} - -func isSkipDir(entry fs.DirEntry) bool { - return entry.IsDir() && (skipDirs[entry.Name()] || - (strings.HasPrefix(entry.Name(), ".") && entry.Name() != "." && entry.Name() != "..") || - strings.HasPrefix(entry.Name(), "_")) -} - -func isGoFile(entry fs.DirEntry) bool { - return !entry.IsDir() && strings.HasSuffix(entry.Name(), ".go") -} - -func analyzeFile(path string, ignore *regexp.Regexp, stats Stats) Stats { - if isIgnored(path, ignore) { - return stats - } - fset := token.NewFileSet() - f, err := parser.ParseFile(fset, path, nil, parser.ParseComments) - if err != nil { - log.Fatal(err) - } - return AnalyzeASTFile(f, fset, stats) -} - -func isIgnored(path string, ignore *regexp.Regexp) bool { - return ignore != nil && ignore.MatchString(path) -} - -// AnalyzeASTFile calculates the cyclomatic complexities of the functions -// and methods in the abstract syntax tree (AST) of a parsed Go file and -// appends the results to the given Stats slice. -func AnalyzeASTFile(f *ast.File, fs *token.FileSet, s Stats) Stats { - analyzer := &fileAnalyzer{ - file: f, - fileSet: fs, - stats: s, - } - return analyzer.analyze() -} - -type fileAnalyzer struct { - file *ast.File - fileSet *token.FileSet - stats Stats -} - -func (a *fileAnalyzer) analyze() Stats { - for _, decl := range a.file.Decls { - a.analyzeDecl(decl) - } - return a.stats -} - -func (a *fileAnalyzer) analyzeDecl(d ast.Decl) { - switch decl := d.(type) { - case *ast.FuncDecl: - a.addStatIfNotIgnored(decl, funcName(decl), decl.Doc) - case *ast.GenDecl: - for _, spec := range decl.Specs { - valueSpec, ok := spec.(*ast.ValueSpec) - if !ok { - continue - } - for _, value := range valueSpec.Values { - funcLit, ok := value.(*ast.FuncLit) - if !ok { - continue - } - a.addStatIfNotIgnored(funcLit, valueSpec.Names[0].Name, decl.Doc) - } - } - } -} - -func (a *fileAnalyzer) addStatIfNotIgnored(node ast.Node, funcName string, doc *ast.CommentGroup) { - if parseDirectives(doc).HasIgnore() { - return - } - a.stats = append(a.stats, Stat{ - PkgName: a.file.Name.Name, - FuncName: funcName, - Complexity: Complexity(node), - Pos: a.fileSet.Position(node.Pos()), - }) -} - -// funcName returns the name representation of a function or method: -// "(Type).Name" for methods or simply "Name" for functions. -func funcName(fn *ast.FuncDecl) string { - if fn.Recv != nil { - if fn.Recv.NumFields() > 0 { - typ := fn.Recv.List[0].Type - return fmt.Sprintf("(%s).%s", recvString(typ), fn.Name) - } - } - return fn.Name.Name -} diff --git a/vendor/github.com/fzipp/gocyclo/complexity.go b/vendor/github.com/fzipp/gocyclo/complexity.go deleted file mode 100644 index 65f5077e82..0000000000 --- a/vendor/github.com/fzipp/gocyclo/complexity.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2020 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gocyclo calculates the cyclomatic complexities of functions and -// methods in Go source code. -package gocyclo - -import ( - "go/ast" - "go/token" -) - -// Complexity calculates the cyclomatic complexity of a function. -// The 'fn' node is either a *ast.FuncDecl or a *ast.FuncLit. -func Complexity(fn ast.Node) int { - v := complexityVisitor{ - complexity: 1, - } - ast.Walk(&v, fn) - return v.complexity -} - -type complexityVisitor struct { - // complexity is the cyclomatic complexity - complexity int -} - -// Visit implements the ast.Visitor interface. -func (v *complexityVisitor) Visit(n ast.Node) ast.Visitor { - switch n := n.(type) { - case *ast.IfStmt, *ast.ForStmt, *ast.RangeStmt: - v.complexity++ - case *ast.CaseClause: - if n.List != nil { // ignore default case - v.complexity++ - } - case *ast.CommClause: - if n.Comm != nil { // ignore default case - v.complexity++ - } - case *ast.BinaryExpr: - if n.Op == token.LAND || n.Op == token.LOR { - v.complexity++ - } - } - return v -} diff --git a/vendor/github.com/fzipp/gocyclo/directives.go b/vendor/github.com/fzipp/gocyclo/directives.go deleted file mode 100644 index b4ee3c4488..0000000000 --- a/vendor/github.com/fzipp/gocyclo/directives.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2020 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocyclo - -import ( - "go/ast" - "strings" -) - -type directives []string - -func (ds directives) HasIgnore() bool { - return ds.isPresent("ignore") -} - -func (ds directives) isPresent(name string) bool { - for _, d := range ds { - if d == name { - return true - } - } - return false -} - -func parseDirectives(doc *ast.CommentGroup) directives { - if doc == nil { - return directives{} - } - const prefix = "//gocyclo:" - var ds directives - for _, comment := range doc.List { - if strings.HasPrefix(comment.Text, prefix) { - ds = append(ds, strings.TrimSpace(strings.TrimPrefix(comment.Text, prefix))) - } - } - return ds -} diff --git a/vendor/github.com/fzipp/gocyclo/recv.go b/vendor/github.com/fzipp/gocyclo/recv.go deleted file mode 100644 index a5c82fef5a..0000000000 --- a/vendor/github.com/fzipp/gocyclo/recv.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2021 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.18 -// +build go1.18 - -package gocyclo - -import "go/ast" - -// recvString returns a string representation of recv of the -// form "T", "*T", or "BADRECV" (if not a proper receiver type). -func recvString(recv ast.Expr) string { - switch t := recv.(type) { - case *ast.Ident: - return t.Name - case *ast.StarExpr: - return "*" + recvString(t.X) - case *ast.IndexExpr: - return recvString(t.X) - case *ast.IndexListExpr: - return recvString(t.X) - } - return "BADRECV" -} diff --git a/vendor/github.com/fzipp/gocyclo/recv_pre118.go b/vendor/github.com/fzipp/gocyclo/recv_pre118.go deleted file mode 100644 index 2fe2d0cdbd..0000000000 --- a/vendor/github.com/fzipp/gocyclo/recv_pre118.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2021 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.18 -// +build !go1.18 - -package gocyclo - -import "go/ast" - -// recvString returns a string representation of recv of the -// form "T", "*T", or "BADRECV" (if not a proper receiver type). -func recvString(recv ast.Expr) string { - switch t := recv.(type) { - case *ast.Ident: - return t.Name - case *ast.StarExpr: - return "*" + recvString(t.X) - case *ast.IndexExpr: - return recvString(t.X) - } - return "BADRECV" -} diff --git a/vendor/github.com/fzipp/gocyclo/stats.go b/vendor/github.com/fzipp/gocyclo/stats.go deleted file mode 100644 index 0a377e4b68..0000000000 --- a/vendor/github.com/fzipp/gocyclo/stats.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2020 Frederik Zipp. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gocyclo - -import ( - "fmt" - "go/token" - "sort" -) - -// Stat holds the cyclomatic complexity of a function, along with its package -// and and function name and its position in the source code. -type Stat struct { - PkgName string - FuncName string - Complexity int - Pos token.Position -} - -// String formats the cyclomatic complexity information of a function in -// the following format: " " -func (s Stat) String() string { - return fmt.Sprintf("%d %s %s %s", s.Complexity, s.PkgName, s.FuncName, s.Pos) -} - -// Stats hold the cyclomatic complexities of many functions. -type Stats []Stat - -// AverageComplexity calculates the average cyclomatic complexity of the -// cyclomatic complexities in s. -func (s Stats) AverageComplexity() float64 { - return float64(s.TotalComplexity()) / float64(len(s)) -} - -// TotalComplexity calculates the total sum of all cyclomatic -// complexities in s. -func (s Stats) TotalComplexity() uint64 { - total := uint64(0) - for _, stat := range s { - total += uint64(stat.Complexity) - } - return total -} - -// SortAndFilter sorts the cyclomatic complexities in s in descending order -// and returns a slice of s limited to the 'top' N entries with a cyclomatic -// complexity greater than 'over'. If 'top' is negative, i.e. -1, it does -// not limit the result. If 'over' is <= 0 it does not limit the result either, -// because a function has a base cyclomatic complexity of at least 1. -func (s Stats) SortAndFilter(top, over int) Stats { - result := make(Stats, len(s)) - copy(result, s) - sort.Stable(byComplexityDesc(result)) - for i, stat := range result { - if i == top { - return result[:i] - } - if stat.Complexity <= over { - return result[:i] - } - } - return result -} - -type byComplexityDesc Stats - -func (s byComplexityDesc) Len() int { return len(s) } -func (s byComplexityDesc) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byComplexityDesc) Less(i, j int) bool { - return s[i].Complexity >= s[j].Complexity -} diff --git a/vendor/github.com/ghostiam/protogetter/.goreleaser.yaml b/vendor/github.com/ghostiam/protogetter/.goreleaser.yaml deleted file mode 100644 index a70d0fb006..0000000000 --- a/vendor/github.com/ghostiam/protogetter/.goreleaser.yaml +++ /dev/null @@ -1,24 +0,0 @@ -before: - hooks: - - go mod tidy -builds: - - id: protogetter - main: ./cmd/protogetter - binary: protogetter - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ incpatch .Version }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' - - '^ci:' \ No newline at end of file diff --git a/vendor/github.com/ghostiam/protogetter/LICENSE b/vendor/github.com/ghostiam/protogetter/LICENSE deleted file mode 100644 index b4449661b7..0000000000 --- a/vendor/github.com/ghostiam/protogetter/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Vladislav Fursov (GhostIAm) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/ghostiam/protogetter/Makefile b/vendor/github.com/ghostiam/protogetter/Makefile deleted file mode 100644 index 4c2a62af18..0000000000 --- a/vendor/github.com/ghostiam/protogetter/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -.PHONY: test -test: - $(MAKE) -C testdata vendor - go test -v ./... - -.PHONY: install -install: - go install ./cmd/protogetter - @echo "Installed in $(shell which protogetter)" diff --git a/vendor/github.com/ghostiam/protogetter/README.md b/vendor/github.com/ghostiam/protogetter/README.md deleted file mode 100644 index c033e9597f..0000000000 --- a/vendor/github.com/ghostiam/protogetter/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Protogetter -Welcome to the Protogetter project! - -## Overview -Protogetter is a linter developed specifically for Go programmers working with nested `protobuf` types.\ -It's designed to aid developers in preventing `invalid memory address or nil pointer dereference` errors arising from direct access of nested `protobuf` fields. - -When working with `protobuf`, it's quite common to have complex structures where a message field is contained within another message, which itself can be part of another message, and so on. -If these fields are accessed directly and some field in the call chain will not be initialized, it can result in application panic. - -Protogetter addresses this issue by suggesting use of getter methods for field access. - -## How does it work? -Protogetter analyzes your Go code and helps detect direct `protobuf` field accesses that could give rise to panic.\ -The linter suggests using getters: -```go -m.GetFoo().GetBar().GetBaz() -``` -instead of direct field access: -```go -m.Foo.Bar.Baz -``` - -And you will then only need to perform a nil check after the final call: -```go -if m.GetFoo().GetBar().GetBaz() != nil { - // Do something with m.GetFoo().GetBar().GetBaz() -} -``` -instead of: -```go -if m.Foo != nil { - if m.Foo.Bar != nil { - if m.Foo.Bar.Baz != nil { - // Do something with m.Foo.Bar.Baz - } - } -} -``` - -or use zero values: - -```go -// If one of the methods returns `nil` we will receive 0 instead of panic. -v := m.GetFoo().GetBar().GetBaz().GetInt() -``` - -instead of panic: - -```go -// If at least one structure in the chains is not initialized, we will get a panic. -v := m.Foo.Bar.Baz.Int -``` - -which simplifies the code and makes it more reliable. - -## Installation - -```bash -go install github.com/ghostiam/protogetter/cmd/protogetter@latest -``` - -## Usage - -To run the linter: -```bash -protogetter ./... -``` - -Or to apply suggested fixes directly: -```bash -protogetter --fix ./... -``` diff --git a/vendor/github.com/ghostiam/protogetter/posfilter.go b/vendor/github.com/ghostiam/protogetter/posfilter.go deleted file mode 100644 index 82075ccb16..0000000000 --- a/vendor/github.com/ghostiam/protogetter/posfilter.go +++ /dev/null @@ -1,65 +0,0 @@ -package protogetter - -import ( - "go/token" -) - -type PosFilter struct { - positions map[token.Pos]struct{} - alreadyReplaced map[string]map[int][2]int // map[filename][line][start, end] -} - -func NewPosFilter() *PosFilter { - return &PosFilter{ - positions: make(map[token.Pos]struct{}), - alreadyReplaced: make(map[string]map[int][2]int), - } -} - -func (f *PosFilter) IsFiltered(pos token.Pos) bool { - _, ok := f.positions[pos] - return ok -} - -func (f *PosFilter) AddPos(pos token.Pos) { - f.positions[pos] = struct{}{} -} - -func (f *PosFilter) IsAlreadyReplaced(fset *token.FileSet, pos, end token.Pos) bool { - filePos := fset.Position(pos) - fileEnd := fset.Position(end) - - lines, ok := f.alreadyReplaced[filePos.Filename] - if !ok { - return false - } - - lineRange, ok := lines[filePos.Line] - if !ok { - return false - } - - if lineRange[0] <= filePos.Offset && fileEnd.Offset <= lineRange[1] { - return true - } - - return false -} - -func (f *PosFilter) AddAlreadyReplaced(fset *token.FileSet, pos, end token.Pos) { - filePos := fset.Position(pos) - fileEnd := fset.Position(end) - - lines, ok := f.alreadyReplaced[filePos.Filename] - if !ok { - lines = make(map[int][2]int) - f.alreadyReplaced[filePos.Filename] = lines - } - - lineRange, ok := lines[filePos.Line] - if ok && lineRange[0] <= filePos.Offset && fileEnd.Offset <= lineRange[1] { - return - } - - lines[filePos.Line] = [2]int{filePos.Offset, fileEnd.Offset} -} diff --git a/vendor/github.com/ghostiam/protogetter/processor.go b/vendor/github.com/ghostiam/protogetter/processor.go deleted file mode 100644 index d65199dd2e..0000000000 --- a/vendor/github.com/ghostiam/protogetter/processor.go +++ /dev/null @@ -1,353 +0,0 @@ -package protogetter - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "reflect" - "strings" -) - -type processor struct { - info *types.Info - filter *PosFilter - cfg *Config - - to strings.Builder - from strings.Builder - err error -} - -func Process(info *types.Info, filter *PosFilter, n ast.Node, cfg *Config) (*Result, error) { - p := &processor{ - info: info, - filter: filter, - cfg: cfg, - } - - return p.process(n) -} - -func (c *processor) process(n ast.Node) (*Result, error) { - switch x := n.(type) { - case *ast.AssignStmt: - // Skip any assignment to the field. - for _, s := range x.Lhs { - c.filter.AddPos(s.Pos()) - - if se, ok := s.(*ast.StarExpr); ok { - c.filter.AddPos(se.X.Pos()) - } - } - - case *ast.IncDecStmt: - // Skip any increment/decrement to the field. - c.filter.AddPos(x.X.Pos()) - - case *ast.UnaryExpr: - if x.Op == token.AND { - // Skip all expressions when the field is used as a pointer. - // Because this is not direct reading, but most likely writing by pointer (for example like sql.Scan). - c.filter.AddPos(x.X.Pos()) - } - - case *ast.CallExpr: - if !c.cfg.ReplaceFirstArgInAppend && len(x.Args) > 0 { - if v, ok := x.Fun.(*ast.Ident); ok && v.Name == "append" { - // Skip first argument of append function. - c.filter.AddPos(x.Args[0].Pos()) - break - } - } - - f, ok := x.Fun.(*ast.SelectorExpr) - if !ok { - return &Result{}, nil - } - - if !isProtoMessage(c.info, f.X) { - return &Result{}, nil - } - - c.processInner(x) - - case *ast.SelectorExpr: - if !isProtoMessage(c.info, x.X) { - // If the selector is not on a proto message, skip it. - return &Result{}, nil - } - - c.processInner(x) - - case *ast.StarExpr: - f, ok := x.X.(*ast.SelectorExpr) - if !ok { - return &Result{}, nil - } - - if !isProtoMessage(c.info, f.X) { - return &Result{}, nil - } - - // proto2 generates fields as pointers. Hence, the indirection - // must be removed when generating the fix for the case. - // The `*` is retained in `c.from`, but excluded from the fix - // present in the `c.to`. - c.writeFrom("*") - c.processInner(x.X) - - case *ast.BinaryExpr: - // Check if the expression is a comparison. - if x.Op != token.EQL && x.Op != token.NEQ { - return &Result{}, nil - } - - // Check if one of the operands is nil. - - xIdent, xOk := x.X.(*ast.Ident) - yIdent, yOk := x.Y.(*ast.Ident) - - xIsNil := xOk && xIdent.Name == "nil" - yIsNil := yOk && yIdent.Name == "nil" - - if !xIsNil && !yIsNil { - return &Result{}, nil - } - - // Extract the non-nil operand for further checks - - var expr ast.Expr - if xIsNil { - expr = x.Y - } else { - expr = x.X - } - - se, ok := expr.(*ast.SelectorExpr) - if !ok { - return &Result{}, nil - } - - if !isProtoMessage(c.info, se.X) { - return &Result{}, nil - } - - // Check if the Getter function of the protobuf message returns a pointer. - hasPointer, ok := getterResultHasPointer(c.info, se.X, se.Sel.Name) - if !ok || hasPointer { - return &Result{}, nil - } - - c.filter.AddPos(x.X.Pos()) - - default: - return nil, fmt.Errorf("not implemented for type: %s (%s)", reflect.TypeOf(x), formatNode(n)) - } - - if c.err != nil { - return nil, c.err - } - - return &Result{ - From: c.from.String(), - To: c.to.String(), - }, nil -} - -func (c *processor) processInner(expr ast.Expr) { - switch x := expr.(type) { - case *ast.Ident: - c.write(x.Name) - - case *ast.BasicLit: - c.write(x.Value) - - case *ast.UnaryExpr: - if x.Op == token.AND { - c.write(formatNode(x)) - return - } - - c.write(x.Op.String()) - c.processInner(x.X) - - case *ast.SelectorExpr: - c.processInner(x.X) - c.write(".") - - // If getter exists, use it. - if methodIsExists(c.info, x.X, "Get"+x.Sel.Name) { - c.writeFrom(x.Sel.Name) - c.writeTo("Get" + x.Sel.Name + "()") - return - } - - // If the selector is not a proto-message or the method has already been called, we leave it unchanged. - // This approach is significantly more efficient than verifying the presence of methods in all cases. - c.write(x.Sel.Name) - - case *ast.CallExpr: - c.processInner(x.Fun) - c.write("(") - for i, arg := range x.Args { - if i > 0 { - c.write(",") - } - c.processInner(arg) - } - c.write(")") - - case *ast.IndexExpr: - c.processInner(x.X) - c.write("[") - c.processInner(x.Index) - c.write("]") - - case *ast.BinaryExpr: - c.processInner(x.X) - c.write(x.Op.String()) - c.processInner(x.Y) - - case *ast.ParenExpr: - c.write("(") - c.processInner(x.X) - c.write(")") - - case *ast.StarExpr: - c.write("*") - c.processInner(x.X) - - case *ast.CompositeLit: - c.write(formatNode(x)) - - case *ast.TypeAssertExpr: - c.write(formatNode(x)) - - default: - c.err = fmt.Errorf("processInner: not implemented for type: %s", reflect.TypeOf(x)) - } -} - -func (c *processor) write(s string) { - c.writeTo(s) - c.writeFrom(s) -} - -func (c *processor) writeTo(s string) { - c.to.WriteString(s) -} - -func (c *processor) writeFrom(s string) { - c.from.WriteString(s) -} - -// Result contains source code (from) and suggested change (to) -type Result struct { - From string - To string -} - -func (r *Result) Skipped() bool { - // If from and to are the same, skip it. - return r.From == r.To -} - -func isProtoMessage(info *types.Info, expr ast.Expr) bool { - // First, we are checking for the presence of the ProtoReflect method which is currently being generated - // and corresponds to v2 version. - // https://pkg.go.dev/google.golang.org/protobuf@v1.31.0/proto#Message - const protoV2Method = "ProtoReflect" - ok := methodIsExists(info, expr, protoV2Method) - if ok { - return true - } - - // Afterwards, we are checking the ProtoMessage method. All the structures that implement the proto.Message interface - // have a ProtoMessage method and are proto-structures. This interface has been generated since version 1.0.0 and - // continues to exist for compatibility. - // https://pkg.go.dev/github.com/golang/protobuf/proto?utm_source=godoc#Message - const protoV1Method = "ProtoMessage" - ok = methodIsExists(info, expr, protoV1Method) - if ok { - // Since there is a protoc-gen-gogo generator that implements the proto.Message interface, but may not generate - // getters or generate from without checking for nil, so even if getters exist, we skip them. - const protocGenGoGoMethod = "MarshalToSizedBuffer" - return !methodIsExists(info, expr, protocGenGoGoMethod) - } - - return false -} - -func typesNamed(info *types.Info, x ast.Expr) (*types.Named, bool) { - if info == nil { - return nil, false - } - - t := info.TypeOf(x) - if t == nil { - return nil, false - } - - ptr, ok := t.Underlying().(*types.Pointer) - if ok { - t = ptr.Elem() - } - - named, ok := t.(*types.Named) - if !ok { - return nil, false - } - - return named, true -} - -func methodIsExists(info *types.Info, x ast.Expr, name string) bool { - named, ok := typesNamed(info, x) - if !ok { - return false - } - - for i := 0; i < named.NumMethods(); i++ { - if named.Method(i).Name() == name { - return true - } - } - - return false -} - -func getterResultHasPointer(info *types.Info, x ast.Expr, name string) (hasPointer, ok bool) { - named, ok := typesNamed(info, x) - if !ok { - return false, false - } - - for i := 0; i < named.NumMethods(); i++ { - method := named.Method(i) - if method.Name() != "Get"+name { - continue - } - - var sig *types.Signature - sig, ok = method.Type().(*types.Signature) - if !ok { - return false, false - } - - results := sig.Results() - if results.Len() == 0 { - return false, false - } - - firstType := results.At(0) - _, ok = firstType.Type().(*types.Pointer) - if !ok { - return false, true - } - - return true, true - } - - return false, false -} diff --git a/vendor/github.com/ghostiam/protogetter/protogetter.go b/vendor/github.com/ghostiam/protogetter/protogetter.go deleted file mode 100644 index 31eee8572a..0000000000 --- a/vendor/github.com/ghostiam/protogetter/protogetter.go +++ /dev/null @@ -1,279 +0,0 @@ -package protogetter - -import ( - "bytes" - "flag" - "fmt" - "go/ast" - "go/format" - "go/token" - "log" - "path/filepath" - "strings" - - "github.com/gobwas/glob" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ast/inspector" -) - -type Mode int - -const ( - StandaloneMode Mode = iota - GolangciLintMode -) - -const msgFormat = "avoid direct access to proto field %s, use %s instead" - -func NewAnalyzer(cfg *Config) *analysis.Analyzer { - if cfg == nil { - cfg = &Config{} - } - - return &analysis.Analyzer{ - Name: "protogetter", - Doc: "Reports direct reads from proto message fields when getters should be used", - Flags: flags(cfg), - Run: func(pass *analysis.Pass) (any, error) { - _, err := Run(pass, cfg) - return nil, err - }, - } -} - -func flags(opts *Config) flag.FlagSet { - fs := flag.NewFlagSet("protogetter", flag.ContinueOnError) - - fs.Func("skip-generated-by", "skip files generated with the given prefixes", func(s string) error { - for _, prefix := range strings.Split(s, ",") { - opts.SkipGeneratedBy = append(opts.SkipGeneratedBy, prefix) - } - return nil - }) - fs.Func("skip-files", "skip files with the given glob patterns", func(s string) error { - for _, pattern := range strings.Split(s, ",") { - opts.SkipFiles = append(opts.SkipFiles, pattern) - } - return nil - }) - fs.BoolVar(&opts.SkipAnyGenerated, "skip-any-generated", false, "skip any generated files") - - return *fs -} - -type Config struct { - Mode Mode // Zero value is StandaloneMode. - SkipGeneratedBy []string - SkipFiles []string - SkipAnyGenerated bool - ReplaceFirstArgInAppend bool -} - -func Run(pass *analysis.Pass, cfg *Config) ([]Issue, error) { - skipGeneratedBy := make([]string, 0, len(cfg.SkipGeneratedBy)+3) - // Always skip files generated by protoc-gen-go, protoc-gen-go-grpc and protoc-gen-grpc-gateway. - skipGeneratedBy = append(skipGeneratedBy, "protoc-gen-go", "protoc-gen-go-grpc", "protoc-gen-grpc-gateway") - for _, s := range cfg.SkipGeneratedBy { - s = strings.TrimSpace(s) - if s == "" { - continue - } - skipGeneratedBy = append(skipGeneratedBy, s) - } - - skipFilesGlobPatterns := make([]glob.Glob, 0, len(cfg.SkipFiles)) - for _, s := range cfg.SkipFiles { - s = strings.TrimSpace(s) - if s == "" { - continue - } - - compile, err := glob.Compile(s) - if err != nil { - return nil, fmt.Errorf("invalid glob pattern: %w", err) - } - - skipFilesGlobPatterns = append(skipFilesGlobPatterns, compile) - } - - nodeTypes := []ast.Node{ - (*ast.AssignStmt)(nil), - (*ast.BinaryExpr)(nil), - (*ast.CallExpr)(nil), - (*ast.SelectorExpr)(nil), - (*ast.StarExpr)(nil), - (*ast.IncDecStmt)(nil), - (*ast.UnaryExpr)(nil), - } - - // Skip filtered files. - var files []*ast.File - for _, f := range pass.Files { - if skipGeneratedFile(f, skipGeneratedBy, cfg.SkipAnyGenerated) { - continue - } - - if skipFilesByGlob(pass.Fset.File(f.Pos()).Name(), skipFilesGlobPatterns) { - continue - } - - files = append(files, f) - - // ast.Print(pass.Fset, f) - } - - ins := inspector.New(files) - - var issues []Issue - - filter := NewPosFilter() - ins.Preorder(nodeTypes, func(node ast.Node) { - report := analyse(pass, filter, node, cfg) - if report == nil { - return - } - - switch cfg.Mode { - case StandaloneMode: - pass.Report(report.ToDiagReport()) - case GolangciLintMode: - issues = append(issues, report.ToIssue(pass.Fset)) - } - }) - - return issues, nil -} - -func analyse(pass *analysis.Pass, filter *PosFilter, n ast.Node, cfg *Config) *Report { - // fmt.Printf("\n>>> check: %s\n", formatNode(n)) - // ast.Print(pass.Fset, n) - if filter.IsFiltered(n.Pos()) { - // fmt.Printf(">>> filtered\n") - return nil - } - - result, err := Process(pass.TypesInfo, filter, n, cfg) - if err != nil { - pass.Report(analysis.Diagnostic{ - Pos: n.Pos(), - End: n.End(), - Message: fmt.Sprintf("error: %v", err), - }) - - return nil - } - - // If existing in filter, skip it. - if filter.IsFiltered(n.Pos()) { - return nil - } - - if result.Skipped() { - return nil - } - - // If the expression has already been replaced, skip it. - if filter.IsAlreadyReplaced(pass.Fset, n.Pos(), n.End()) { - return nil - } - // Add the expression to the filter. - filter.AddAlreadyReplaced(pass.Fset, n.Pos(), n.End()) - - return &Report{ - node: n, - result: result, - } -} - -// Issue is used to integrate with golangci-lint's inline auto fix. -type Issue struct { - Pos token.Position - Message string - InlineFix InlineFix -} - -type InlineFix struct { - StartCol int // zero-based - Length int - NewString string -} - -type Report struct { - node ast.Node - result *Result -} - -func (r *Report) ToDiagReport() analysis.Diagnostic { - msg := fmt.Sprintf(msgFormat, r.result.From, r.result.To) - - return analysis.Diagnostic{ - Pos: r.node.Pos(), - End: r.node.End(), - Message: msg, - SuggestedFixes: []analysis.SuggestedFix{ - { - Message: msg, - TextEdits: []analysis.TextEdit{ - { - Pos: r.node.Pos(), - End: r.node.End(), - NewText: []byte(r.result.To), - }, - }, - }, - }, - } -} - -func (r *Report) ToIssue(fset *token.FileSet) Issue { - msg := fmt.Sprintf(msgFormat, r.result.From, r.result.To) - return Issue{ - Pos: fset.Position(r.node.Pos()), - Message: msg, - InlineFix: InlineFix{ - StartCol: fset.Position(r.node.Pos()).Column - 1, - Length: len(r.result.From), - NewString: r.result.To, - }, - } -} - -func skipGeneratedFile(f *ast.File, prefixes []string, skipAny bool) bool { - if len(f.Comments) == 0 { - return false - } - firstComment := f.Comments[0].Text() - - // https://golang.org/s/generatedcode - if skipAny && strings.HasPrefix(firstComment, "Code generated") { - return true - } - - for _, prefix := range prefixes { - if strings.HasPrefix(firstComment, "Code generated by "+prefix) { - return true - } - } - - return false -} - -func skipFilesByGlob(filename string, patterns []glob.Glob) bool { - for _, pattern := range patterns { - if pattern.Match(filename) || pattern.Match(filepath.Base(filename)) { - return true - } - } - - return false -} - -func formatNode(node ast.Node) string { - buf := new(bytes.Buffer) - if err := format.Node(buf, token.NewFileSet(), node); err != nil { - log.Printf("Error formatting expression: %v", err) - return "" - } - - return buf.String() -} diff --git a/vendor/github.com/go-chi/chi/v5/.gitignore b/vendor/github.com/go-chi/chi/v5/.gitignore deleted file mode 100644 index ba22c99a99..0000000000 --- a/vendor/github.com/go-chi/chi/v5/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.idea -*.sw? -.vscode diff --git a/vendor/github.com/go-chi/chi/v5/CHANGELOG.md b/vendor/github.com/go-chi/chi/v5/CHANGELOG.md deleted file mode 100644 index a1feeec055..0000000000 --- a/vendor/github.com/go-chi/chi/v5/CHANGELOG.md +++ /dev/null @@ -1,320 +0,0 @@ -# Changelog - -## v5.0.8 (2022-12-07) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.7...v5.0.8 - - -## v5.0.7 (2021-11-18) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.6...v5.0.7 - - -## v5.0.6 (2021-11-15) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.5...v5.0.6 - - -## v5.0.5 (2021-10-27) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.4...v5.0.5 - - -## v5.0.4 (2021-08-29) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.3...v5.0.4 - - -## v5.0.3 (2021-04-29) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.2...v5.0.3 - - -## v5.0.2 (2021-03-25) - -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.1...v5.0.2 - - -## v5.0.1 (2021-03-10) - -- Small improvements -- History of changes: see https://github.com/go-chi/chi/compare/v5.0.0...v5.0.1 - - -## v5.0.0 (2021-02-27) - -- chi v5, `github.com/go-chi/chi/v5` introduces the adoption of Go's SIV to adhere to the current state-of-the-tools in Go. -- chi v1.5.x did not work out as planned, as the Go tooling is too powerful and chi's adoption is too wide. - The most responsible thing to do for everyone's benefit is to just release v5 with SIV, so I present to you all, - chi v5 at `github.com/go-chi/chi/v5`. I hope someday the developer experience and ergonomics I've been seeking - will still come to fruition in some form, see https://github.com/golang/go/issues/44550 -- History of changes: see https://github.com/go-chi/chi/compare/v1.5.4...v5.0.0 - - -## v1.5.4 (2021-02-27) - -- Undo prior retraction in v1.5.3 as we prepare for v5.0.0 release -- History of changes: see https://github.com/go-chi/chi/compare/v1.5.3...v1.5.4 - - -## v1.5.3 (2021-02-21) - -- Update go.mod to go 1.16 with new retract directive marking all versions without prior go.mod support -- History of changes: see https://github.com/go-chi/chi/compare/v1.5.2...v1.5.3 - - -## v1.5.2 (2021-02-10) - -- Reverting allocation optimization as a precaution as go test -race fails. -- Minor improvements, see history below -- History of changes: see https://github.com/go-chi/chi/compare/v1.5.1...v1.5.2 - - -## v1.5.1 (2020-12-06) - -- Performance improvement: removing 1 allocation by foregoing context.WithValue, thank you @bouk for - your contribution (https://github.com/go-chi/chi/pull/555). Note: new benchmarks posted in README. -- `middleware.CleanPath`: new middleware that clean's request path of double slashes -- deprecate & remove `chi.ServerBaseContext` in favour of stdlib `http.Server#BaseContext` -- plus other tiny improvements, see full commit history below -- History of changes: see https://github.com/go-chi/chi/compare/v4.1.2...v1.5.1 - - -## v1.5.0 (2020-11-12) - now with go.mod support - -`chi` dates back to 2016 with it's original implementation as one of the first routers to adopt the newly introduced -context.Context api to the stdlib -- set out to design a router that is faster, more modular and simpler than anything -else out there -- while not introducing any custom handler types or dependencies. Today, `chi` still has zero dependencies, -and in many ways is future proofed from changes, given it's minimal nature. Between versions, chi's iterations have been very -incremental, with the architecture and api being the same today as it was originally designed in 2016. For this reason it -makes chi a pretty easy project to maintain, as well thanks to the many amazing community contributions over the years -to who all help make chi better (total of 86 contributors to date -- thanks all!). - -Chi has been an labour of love, art and engineering, with the goals to offer beautiful ergonomics, flexibility, performance -and simplicity when building HTTP services with Go. I've strived to keep the router very minimal in surface area / code size, -and always improving the code wherever possible -- and as of today the `chi` package is just 1082 lines of code (not counting -middlewares, which are all optional). As well, I don't have the exact metrics, but from my analysis and email exchanges from -companies and developers, chi is used by thousands of projects around the world -- thank you all as there is no better form of -joy for me than to have art I had started be helpful and enjoyed by others. And of course I use chi in all of my own projects too :) - -For me, the asthetics of chi's code and usage are very important. With the introduction of Go's module support -(which I'm a big fan of), chi's past versioning scheme choice to v2, v3 and v4 would mean I'd require the import path -of "github.com/go-chi/chi/v4", leading to the lengthy discussion at https://github.com/go-chi/chi/issues/462. -Haha, to some, you may be scratching your head why I've spent > 1 year stalling to adopt "/vXX" convention in the import -path -- which isn't horrible in general -- but for chi, I'm unable to accept it as I strive for perfection in it's API design, -aesthetics and simplicity. It just doesn't feel good to me given chi's simple nature -- I do not foresee a "v5" or "v6", -and upgrading between versions in the future will also be just incremental. - -I do understand versioning is a part of the API design as well, which is why the solution for a while has been to "do nothing", -as Go supports both old and new import paths with/out go.mod. However, now that Go module support has had time to iron out kinks and -is adopted everywhere, it's time for chi to get with the times. Luckily, I've discovered a path forward that will make me happy, -while also not breaking anyone's app who adopted a prior versioning from tags in v2/v3/v4. I've made an experimental release of -v1.5.0 with go.mod silently, and tested it with new and old projects, to ensure the developer experience is preserved, and it's -largely unnoticed. Fortunately, Go's toolchain will check the tags of a repo and consider the "latest" tag the one with go.mod. -However, you can still request a specific older tag such as v4.1.2, and everything will "just work". But new users can just -`go get github.com/go-chi/chi` or `go get github.com/go-chi/chi@latest` and they will get the latest version which contains -go.mod support, which is v1.5.0+. `chi` will not change very much over the years, just like it hasn't changed much from 4 years ago. -Therefore, we will stay on v1.x from here on, starting from v1.5.0. Any breaking changes will bump a "minor" release and -backwards-compatible improvements/fixes will bump a "tiny" release. - -For existing projects who want to upgrade to the latest go.mod version, run: `go get -u github.com/go-chi/chi@v1.5.0`, -which will get you on the go.mod version line (as Go's mod cache may still remember v4.x). Brand new systems can run -`go get -u github.com/go-chi/chi` or `go get -u github.com/go-chi/chi@latest` to install chi, which will install v1.5.0+ -built with go.mod support. - -My apologies to the developers who will disagree with the decisions above, but, hope you'll try it and see it's a very -minor request which is backwards compatible and won't break your existing installations. - -Cheers all, happy coding! - - ---- - - -## v4.1.2 (2020-06-02) - -- fix that handles MethodNotAllowed with path variables, thank you @caseyhadden for your contribution -- fix to replace nested wildcards correctly in RoutePattern, thank you @@unmultimedio for your contribution -- History of changes: see https://github.com/go-chi/chi/compare/v4.1.1...v4.1.2 - - -## v4.1.1 (2020-04-16) - -- fix for issue https://github.com/go-chi/chi/issues/411 which allows for overlapping regexp - route to the correct handler through a recursive tree search, thanks to @Jahaja for the PR/fix! -- new middleware.RouteHeaders as a simple router for request headers with wildcard support -- History of changes: see https://github.com/go-chi/chi/compare/v4.1.0...v4.1.1 - - -## v4.1.0 (2020-04-1) - -- middleware.LogEntry: Write method on interface now passes the response header - and an extra interface type useful for custom logger implementations. -- middleware.WrapResponseWriter: minor fix -- middleware.Recoverer: a bit prettier -- History of changes: see https://github.com/go-chi/chi/compare/v4.0.4...v4.1.0 - -## v4.0.4 (2020-03-24) - -- middleware.Recoverer: new pretty stack trace printing (https://github.com/go-chi/chi/pull/496) -- a few minor improvements and fixes -- History of changes: see https://github.com/go-chi/chi/compare/v4.0.3...v4.0.4 - - -## v4.0.3 (2020-01-09) - -- core: fix regexp routing to include default value when param is not matched -- middleware: rewrite of middleware.Compress -- middleware: suppress http.ErrAbortHandler in middleware.Recoverer -- History of changes: see https://github.com/go-chi/chi/compare/v4.0.2...v4.0.3 - - -## v4.0.2 (2019-02-26) - -- Minor fixes -- History of changes: see https://github.com/go-chi/chi/compare/v4.0.1...v4.0.2 - - -## v4.0.1 (2019-01-21) - -- Fixes issue with compress middleware: #382 #385 -- History of changes: see https://github.com/go-chi/chi/compare/v4.0.0...v4.0.1 - - -## v4.0.0 (2019-01-10) - -- chi v4 requires Go 1.10.3+ (or Go 1.9.7+) - we have deprecated support for Go 1.7 and 1.8 -- router: respond with 404 on router with no routes (#362) -- router: additional check to ensure wildcard is at the end of a url pattern (#333) -- middleware: deprecate use of http.CloseNotifier (#347) -- middleware: fix RedirectSlashes to include query params on redirect (#334) -- History of changes: see https://github.com/go-chi/chi/compare/v3.3.4...v4.0.0 - - -## v3.3.4 (2019-01-07) - -- Minor middleware improvements. No changes to core library/router. Moving v3 into its -- own branch as a version of chi for Go 1.7, 1.8, 1.9, 1.10, 1.11 -- History of changes: see https://github.com/go-chi/chi/compare/v3.3.3...v3.3.4 - - -## v3.3.3 (2018-08-27) - -- Minor release -- See https://github.com/go-chi/chi/compare/v3.3.2...v3.3.3 - - -## v3.3.2 (2017-12-22) - -- Support to route trailing slashes on mounted sub-routers (#281) -- middleware: new `ContentCharset` to check matching charsets. Thank you - @csucu for your community contribution! - - -## v3.3.1 (2017-11-20) - -- middleware: new `AllowContentType` handler for explicit whitelist of accepted request Content-Types -- middleware: new `SetHeader` handler for short-hand middleware to set a response header key/value -- Minor bug fixes - - -## v3.3.0 (2017-10-10) - -- New chi.RegisterMethod(method) to add support for custom HTTP methods, see _examples/custom-method for usage -- Deprecated LINK and UNLINK methods from the default list, please use `chi.RegisterMethod("LINK")` and `chi.RegisterMethod("UNLINK")` in an `init()` function - - -## v3.2.1 (2017-08-31) - -- Add new `Match(rctx *Context, method, path string) bool` method to `Routes` interface - and `Mux`. Match searches the mux's routing tree for a handler that matches the method/path -- Add new `RouteMethod` to `*Context` -- Add new `Routes` pointer to `*Context` -- Add new `middleware.GetHead` to route missing HEAD requests to GET handler -- Updated benchmarks (see README) - - -## v3.1.5 (2017-08-02) - -- Setup golint and go vet for the project -- As per golint, we've redefined `func ServerBaseContext(h http.Handler, baseCtx context.Context) http.Handler` - to `func ServerBaseContext(baseCtx context.Context, h http.Handler) http.Handler` - - -## v3.1.0 (2017-07-10) - -- Fix a few minor issues after v3 release -- Move `docgen` sub-pkg to https://github.com/go-chi/docgen -- Move `render` sub-pkg to https://github.com/go-chi/render -- Add new `URLFormat` handler to chi/middleware sub-pkg to make working with url mime - suffixes easier, ie. parsing `/articles/1.json` and `/articles/1.xml`. See comments in - https://github.com/go-chi/chi/blob/master/middleware/url_format.go for example usage. - - -## v3.0.0 (2017-06-21) - -- Major update to chi library with many exciting updates, but also some *breaking changes* -- URL parameter syntax changed from `/:id` to `/{id}` for even more flexible routing, such as - `/articles/{month}-{day}-{year}-{slug}`, `/articles/{id}`, and `/articles/{id}.{ext}` on the - same router -- Support for regexp for routing patterns, in the form of `/{paramKey:regExp}` for example: - `r.Get("/articles/{name:[a-z]+}", h)` and `chi.URLParam(r, "name")` -- Add `Method` and `MethodFunc` to `chi.Router` to allow routing definitions such as - `r.Method("GET", "/", h)` which provides a cleaner interface for custom handlers like - in `_examples/custom-handler` -- Deprecating `mux#FileServer` helper function. Instead, we encourage users to create their - own using file handler with the stdlib, see `_examples/fileserver` for an example -- Add support for LINK/UNLINK http methods via `r.Method()` and `r.MethodFunc()` -- Moved the chi project to its own organization, to allow chi-related community packages to - be easily discovered and supported, at: https://github.com/go-chi -- *NOTE:* please update your import paths to `"github.com/go-chi/chi"` -- *NOTE:* chi v2 is still available at https://github.com/go-chi/chi/tree/v2 - - -## v2.1.0 (2017-03-30) - -- Minor improvements and update to the chi core library -- Introduced a brand new `chi/render` sub-package to complete the story of building - APIs to offer a pattern for managing well-defined request / response payloads. Please - check out the updated `_examples/rest` example for how it works. -- Added `MethodNotAllowed(h http.HandlerFunc)` to chi.Router interface - - -## v2.0.0 (2017-01-06) - -- After many months of v2 being in an RC state with many companies and users running it in - production, the inclusion of some improvements to the middlewares, we are very pleased to - announce v2.0.0 of chi. - - -## v2.0.0-rc1 (2016-07-26) - -- Huge update! chi v2 is a large refactor targetting Go 1.7+. As of Go 1.7, the popular - community `"net/context"` package has been included in the standard library as `"context"` and - utilized by `"net/http"` and `http.Request` to managing deadlines, cancelation signals and other - request-scoped values. We're very excited about the new context addition and are proud to - introduce chi v2, a minimal and powerful routing package for building large HTTP services, - with zero external dependencies. Chi focuses on idiomatic design and encourages the use of - stdlib HTTP handlers and middlwares. -- chi v2 deprecates its `chi.Handler` interface and requires `http.Handler` or `http.HandlerFunc` -- chi v2 stores URL routing parameters and patterns in the standard request context: `r.Context()` -- chi v2 lower-level routing context is accessible by `chi.RouteContext(r.Context()) *chi.Context`, - which provides direct access to URL routing parameters, the routing path and the matching - routing patterns. -- Users upgrading from chi v1 to v2, need to: - 1. Update the old chi.Handler signature, `func(ctx context.Context, w http.ResponseWriter, r *http.Request)` to - the standard http.Handler: `func(w http.ResponseWriter, r *http.Request)` - 2. Use `chi.URLParam(r *http.Request, paramKey string) string` - or `URLParamFromCtx(ctx context.Context, paramKey string) string` to access a url parameter value - - -## v1.0.0 (2016-07-01) - -- Released chi v1 stable https://github.com/go-chi/chi/tree/v1.0.0 for Go 1.6 and older. - - -## v0.9.0 (2016-03-31) - -- Reuse context objects via sync.Pool for zero-allocation routing [#33](https://github.com/go-chi/chi/pull/33) -- BREAKING NOTE: due to subtle API changes, previously `chi.URLParams(ctx)["id"]` used to access url parameters - has changed to: `chi.URLParam(ctx, "id")` diff --git a/vendor/github.com/go-chi/chi/v5/CONTRIBUTING.md b/vendor/github.com/go-chi/chi/v5/CONTRIBUTING.md deleted file mode 100644 index c0ac2dfe85..0000000000 --- a/vendor/github.com/go-chi/chi/v5/CONTRIBUTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Contributing - -## Prerequisites - -1. [Install Go][go-install]. -2. Download the sources and switch the working directory: - - ```bash - go get -u -d github.com/go-chi/chi - cd $GOPATH/src/github.com/go-chi/chi - ``` - -## Submitting a Pull Request - -A typical workflow is: - -1. [Fork the repository.][fork] [This tip maybe also helpful.][go-fork-tip] -2. [Create a topic branch.][branch] -3. Add tests for your change. -4. Run `go test`. If your tests pass, return to the step 3. -5. Implement the change and ensure the steps from the previous step pass. -6. Run `goimports -w .`, to ensure the new code conforms to Go formatting guideline. -7. [Add, commit and push your changes.][git-help] -8. [Submit a pull request.][pull-req] - -[go-install]: https://golang.org/doc/install -[go-fork-tip]: http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html -[fork]: https://help.github.com/articles/fork-a-repo -[branch]: http://learn.github.com/p/branching.html -[git-help]: https://guides.github.com -[pull-req]: https://help.github.com/articles/using-pull-requests diff --git a/vendor/github.com/go-chi/chi/v5/LICENSE b/vendor/github.com/go-chi/chi/v5/LICENSE deleted file mode 100644 index d99f02ffac..0000000000 --- a/vendor/github.com/go-chi/chi/v5/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2015-present Peter Kieltyka (https://github.com/pkieltyka), Google Inc. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/go-chi/chi/v5/Makefile b/vendor/github.com/go-chi/chi/v5/Makefile deleted file mode 100644 index e0f18c7da2..0000000000 --- a/vendor/github.com/go-chi/chi/v5/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -.PHONY: all -all: - @echo "**********************************************************" - @echo "** chi build tool **" - @echo "**********************************************************" - - -.PHONY: test -test: - go clean -testcache && $(MAKE) test-router && $(MAKE) test-middleware - -.PHONY: test-router -test-router: - go test -race -v . - -.PHONY: test-middleware -test-middleware: - go test -race -v ./middleware - -.PHONY: docs -docs: - npx docsify-cli serve ./docs diff --git a/vendor/github.com/go-chi/chi/v5/README.md b/vendor/github.com/go-chi/chi/v5/README.md deleted file mode 100644 index 3e4cc4a2e1..0000000000 --- a/vendor/github.com/go-chi/chi/v5/README.md +++ /dev/null @@ -1,500 +0,0 @@ -# chi - - -[![GoDoc Widget]][GoDoc] [![Travis Widget]][Travis] - -`chi` is a lightweight, idiomatic and composable router for building Go HTTP services. It's -especially good at helping you write large REST API services that are kept maintainable as your -project grows and changes. `chi` is built on the new `context` package introduced in Go 1.7 to -handle signaling, cancelation and request-scoped values across a handler chain. - -The focus of the project has been to seek out an elegant and comfortable design for writing -REST API servers, written during the development of the Pressly API service that powers our -public API service, which in turn powers all of our client-side applications. - -The key considerations of chi's design are: project structure, maintainability, standard http -handlers (stdlib-only), developer productivity, and deconstructing a large system into many small -parts. The core router `github.com/go-chi/chi` is quite small (less than 1000 LOC), but we've also -included some useful/optional subpackages: [middleware](/middleware), [render](https://github.com/go-chi/render) -and [docgen](https://github.com/go-chi/docgen). We hope you enjoy it too! - -## Install - -`go get -u github.com/go-chi/chi/v5` - - -## Features - -* **Lightweight** - cloc'd in ~1000 LOC for the chi router -* **Fast** - yes, see [benchmarks](#benchmarks) -* **100% compatible with net/http** - use any http or middleware pkg in the ecosystem that is also compatible with `net/http` -* **Designed for modular/composable APIs** - middlewares, inline middlewares, route groups and sub-router mounting -* **Context control** - built on new `context` package, providing value chaining, cancellations and timeouts -* **Robust** - in production at Pressly, Cloudflare, Heroku, 99Designs, and many others (see [discussion](https://github.com/go-chi/chi/issues/91)) -* **Doc generation** - `docgen` auto-generates routing documentation from your source to JSON or Markdown -* **Go.mod support** - as of v5, go.mod support (see [CHANGELOG](https://github.com/go-chi/chi/blob/master/CHANGELOG.md)) -* **No external dependencies** - plain ol' Go stdlib + net/http - - -## Examples - -See [_examples/](https://github.com/go-chi/chi/blob/master/_examples/) for a variety of examples. - - -**As easy as:** - -```go -package main - -import ( - "net/http" - - "github.com/go-chi/chi/v5" - "github.com/go-chi/chi/v5/middleware" -) - -func main() { - r := chi.NewRouter() - r.Use(middleware.Logger) - r.Get("/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("welcome")) - }) - http.ListenAndServe(":3000", r) -} -``` - -**REST Preview:** - -Here is a little preview of how routing looks like with chi. Also take a look at the generated routing docs -in JSON ([routes.json](https://github.com/go-chi/chi/blob/master/_examples/rest/routes.json)) and in -Markdown ([routes.md](https://github.com/go-chi/chi/blob/master/_examples/rest/routes.md)). - -I highly recommend reading the source of the [examples](https://github.com/go-chi/chi/blob/master/_examples/) listed -above, they will show you all the features of chi and serve as a good form of documentation. - -```go -import ( - //... - "context" - "github.com/go-chi/chi/v5" - "github.com/go-chi/chi/v5/middleware" -) - -func main() { - r := chi.NewRouter() - - // A good base middleware stack - r.Use(middleware.RequestID) - r.Use(middleware.RealIP) - r.Use(middleware.Logger) - r.Use(middleware.Recoverer) - - // Set a timeout value on the request context (ctx), that will signal - // through ctx.Done() that the request has timed out and further - // processing should be stopped. - r.Use(middleware.Timeout(60 * time.Second)) - - r.Get("/", func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("hi")) - }) - - // RESTy routes for "articles" resource - r.Route("/articles", func(r chi.Router) { - r.With(paginate).Get("/", listArticles) // GET /articles - r.With(paginate).Get("/{month}-{day}-{year}", listArticlesByDate) // GET /articles/01-16-2017 - - r.Post("/", createArticle) // POST /articles - r.Get("/search", searchArticles) // GET /articles/search - - // Regexp url parameters: - r.Get("/{articleSlug:[a-z-]+}", getArticleBySlug) // GET /articles/home-is-toronto - - // Subrouters: - r.Route("/{articleID}", func(r chi.Router) { - r.Use(ArticleCtx) - r.Get("/", getArticle) // GET /articles/123 - r.Put("/", updateArticle) // PUT /articles/123 - r.Delete("/", deleteArticle) // DELETE /articles/123 - }) - }) - - // Mount the admin sub-router - r.Mount("/admin", adminRouter()) - - http.ListenAndServe(":3333", r) -} - -func ArticleCtx(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - articleID := chi.URLParam(r, "articleID") - article, err := dbGetArticle(articleID) - if err != nil { - http.Error(w, http.StatusText(404), 404) - return - } - ctx := context.WithValue(r.Context(), "article", article) - next.ServeHTTP(w, r.WithContext(ctx)) - }) -} - -func getArticle(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - article, ok := ctx.Value("article").(*Article) - if !ok { - http.Error(w, http.StatusText(422), 422) - return - } - w.Write([]byte(fmt.Sprintf("title:%s", article.Title))) -} - -// A completely separate router for administrator routes -func adminRouter() http.Handler { - r := chi.NewRouter() - r.Use(AdminOnly) - r.Get("/", adminIndex) - r.Get("/accounts", adminListAccounts) - return r -} - -func AdminOnly(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := r.Context() - perm, ok := ctx.Value("acl.permission").(YourPermissionType) - if !ok || !perm.IsAdmin() { - http.Error(w, http.StatusText(403), 403) - return - } - next.ServeHTTP(w, r) - }) -} -``` - - -## Router interface - -chi's router is based on a kind of [Patricia Radix trie](https://en.wikipedia.org/wiki/Radix_tree). -The router is fully compatible with `net/http`. - -Built on top of the tree is the `Router` interface: - -```go -// Router consisting of the core routing methods used by chi's Mux, -// using only the standard net/http. -type Router interface { - http.Handler - Routes - - // Use appends one or more middlewares onto the Router stack. - Use(middlewares ...func(http.Handler) http.Handler) - - // With adds inline middlewares for an endpoint handler. - With(middlewares ...func(http.Handler) http.Handler) Router - - // Group adds a new inline-Router along the current routing - // path, with a fresh middleware stack for the inline-Router. - Group(fn func(r Router)) Router - - // Route mounts a sub-Router along a `pattern`` string. - Route(pattern string, fn func(r Router)) Router - - // Mount attaches another http.Handler along ./pattern/* - Mount(pattern string, h http.Handler) - - // Handle and HandleFunc adds routes for `pattern` that matches - // all HTTP methods. - Handle(pattern string, h http.Handler) - HandleFunc(pattern string, h http.HandlerFunc) - - // Method and MethodFunc adds routes for `pattern` that matches - // the `method` HTTP method. - Method(method, pattern string, h http.Handler) - MethodFunc(method, pattern string, h http.HandlerFunc) - - // HTTP-method routing along `pattern` - Connect(pattern string, h http.HandlerFunc) - Delete(pattern string, h http.HandlerFunc) - Get(pattern string, h http.HandlerFunc) - Head(pattern string, h http.HandlerFunc) - Options(pattern string, h http.HandlerFunc) - Patch(pattern string, h http.HandlerFunc) - Post(pattern string, h http.HandlerFunc) - Put(pattern string, h http.HandlerFunc) - Trace(pattern string, h http.HandlerFunc) - - // NotFound defines a handler to respond whenever a route could - // not be found. - NotFound(h http.HandlerFunc) - - // MethodNotAllowed defines a handler to respond whenever a method is - // not allowed. - MethodNotAllowed(h http.HandlerFunc) -} - -// Routes interface adds two methods for router traversal, which is also -// used by the github.com/go-chi/docgen package to generate documentation for Routers. -type Routes interface { - // Routes returns the routing tree in an easily traversable structure. - Routes() []Route - - // Middlewares returns the list of middlewares in use by the router. - Middlewares() Middlewares - - // Match searches the routing tree for a handler that matches - // the method/path - similar to routing a http request, but without - // executing the handler thereafter. - Match(rctx *Context, method, path string) bool -} -``` - -Each routing method accepts a URL `pattern` and chain of `handlers`. The URL pattern -supports named params (ie. `/users/{userID}`) and wildcards (ie. `/admin/*`). URL parameters -can be fetched at runtime by calling `chi.URLParam(r, "userID")` for named parameters -and `chi.URLParam(r, "*")` for a wildcard parameter. - - -### Middleware handlers - -chi's middlewares are just stdlib net/http middleware handlers. There is nothing special -about them, which means the router and all the tooling is designed to be compatible and -friendly with any middleware in the community. This offers much better extensibility and reuse -of packages and is at the heart of chi's purpose. - -Here is an example of a standard net/http middleware where we assign a context key `"user"` -the value of `"123"`. This middleware sets a hypothetical user identifier on the request -context and calls the next handler in the chain. - -```go -// HTTP middleware setting a value on the request context -func MyMiddleware(next http.Handler) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // create new context from `r` request context, and assign key `"user"` - // to value of `"123"` - ctx := context.WithValue(r.Context(), "user", "123") - - // call the next handler in the chain, passing the response writer and - // the updated request object with the new context value. - // - // note: context.Context values are nested, so any previously set - // values will be accessible as well, and the new `"user"` key - // will be accessible from this point forward. - next.ServeHTTP(w, r.WithContext(ctx)) - }) -} -``` - - -### Request handlers - -chi uses standard net/http request handlers. This little snippet is an example of a http.Handler -func that reads a user identifier from the request context - hypothetically, identifying -the user sending an authenticated request, validated+set by a previous middleware handler. - -```go -// HTTP handler accessing data from the request context. -func MyRequestHandler(w http.ResponseWriter, r *http.Request) { - // here we read from the request context and fetch out `"user"` key set in - // the MyMiddleware example above. - user := r.Context().Value("user").(string) - - // respond to the client - w.Write([]byte(fmt.Sprintf("hi %s", user))) -} -``` - - -### URL parameters - -chi's router parses and stores URL parameters right onto the request context. Here is -an example of how to access URL params in your net/http handlers. And of course, middlewares -are able to access the same information. - -```go -// HTTP handler accessing the url routing parameters. -func MyRequestHandler(w http.ResponseWriter, r *http.Request) { - // fetch the url parameter `"userID"` from the request of a matching - // routing pattern. An example routing pattern could be: /users/{userID} - userID := chi.URLParam(r, "userID") - - // fetch `"key"` from the request context - ctx := r.Context() - key := ctx.Value("key").(string) - - // respond to the client - w.Write([]byte(fmt.Sprintf("hi %v, %v", userID, key))) -} -``` - - -## Middlewares - -chi comes equipped with an optional `middleware` package, providing a suite of standard -`net/http` middlewares. Please note, any middleware in the ecosystem that is also compatible -with `net/http` can be used with chi's mux. - -### Core middlewares - ----------------------------------------------------------------------------------------------------- -| chi/middleware Handler | description | -| :--------------------- | :---------------------------------------------------------------------- | -| [AllowContentEncoding] | Enforces a whitelist of request Content-Encoding headers | -| [AllowContentType] | Explicit whitelist of accepted request Content-Types | -| [BasicAuth] | Basic HTTP authentication | -| [Compress] | Gzip compression for clients that accept compressed responses | -| [ContentCharset] | Ensure charset for Content-Type request headers | -| [CleanPath] | Clean double slashes from request path | -| [GetHead] | Automatically route undefined HEAD requests to GET handlers | -| [Heartbeat] | Monitoring endpoint to check the servers pulse | -| [Logger] | Logs the start and end of each request with the elapsed processing time | -| [NoCache] | Sets response headers to prevent clients from caching | -| [Profiler] | Easily attach net/http/pprof to your routers | -| [RealIP] | Sets a http.Request's RemoteAddr to either X-Real-IP or X-Forwarded-For | -| [Recoverer] | Gracefully absorb panics and prints the stack trace | -| [RequestID] | Injects a request ID into the context of each request | -| [RedirectSlashes] | Redirect slashes on routing paths | -| [RouteHeaders] | Route handling for request headers | -| [SetHeader] | Short-hand middleware to set a response header key/value | -| [StripSlashes] | Strip slashes on routing paths | -| [Throttle] | Puts a ceiling on the number of concurrent requests | -| [Timeout] | Signals to the request context when the timeout deadline is reached | -| [URLFormat] | Parse extension from url and put it on request context | -| [WithValue] | Short-hand middleware to set a key/value on the request context | ----------------------------------------------------------------------------------------------------- - -[AllowContentEncoding]: https://pkg.go.dev/github.com/go-chi/chi/middleware#AllowContentEncoding -[AllowContentType]: https://pkg.go.dev/github.com/go-chi/chi/middleware#AllowContentType -[BasicAuth]: https://pkg.go.dev/github.com/go-chi/chi/middleware#BasicAuth -[Compress]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Compress -[ContentCharset]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ContentCharset -[CleanPath]: https://pkg.go.dev/github.com/go-chi/chi/middleware#CleanPath -[GetHead]: https://pkg.go.dev/github.com/go-chi/chi/middleware#GetHead -[GetReqID]: https://pkg.go.dev/github.com/go-chi/chi/middleware#GetReqID -[Heartbeat]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Heartbeat -[Logger]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Logger -[NoCache]: https://pkg.go.dev/github.com/go-chi/chi/middleware#NoCache -[Profiler]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Profiler -[RealIP]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RealIP -[Recoverer]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Recoverer -[RedirectSlashes]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RedirectSlashes -[RequestLogger]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RequestLogger -[RequestID]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RequestID -[RouteHeaders]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RouteHeaders -[SetHeader]: https://pkg.go.dev/github.com/go-chi/chi/middleware#SetHeader -[StripSlashes]: https://pkg.go.dev/github.com/go-chi/chi/middleware#StripSlashes -[Throttle]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Throttle -[ThrottleBacklog]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleBacklog -[ThrottleWithOpts]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleWithOpts -[Timeout]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Timeout -[URLFormat]: https://pkg.go.dev/github.com/go-chi/chi/middleware#URLFormat -[WithLogEntry]: https://pkg.go.dev/github.com/go-chi/chi/middleware#WithLogEntry -[WithValue]: https://pkg.go.dev/github.com/go-chi/chi/middleware#WithValue -[Compressor]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Compressor -[DefaultLogFormatter]: https://pkg.go.dev/github.com/go-chi/chi/middleware#DefaultLogFormatter -[EncoderFunc]: https://pkg.go.dev/github.com/go-chi/chi/middleware#EncoderFunc -[HeaderRoute]: https://pkg.go.dev/github.com/go-chi/chi/middleware#HeaderRoute -[HeaderRouter]: https://pkg.go.dev/github.com/go-chi/chi/middleware#HeaderRouter -[LogEntry]: https://pkg.go.dev/github.com/go-chi/chi/middleware#LogEntry -[LogFormatter]: https://pkg.go.dev/github.com/go-chi/chi/middleware#LogFormatter -[LoggerInterface]: https://pkg.go.dev/github.com/go-chi/chi/middleware#LoggerInterface -[ThrottleOpts]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleOpts -[WrapResponseWriter]: https://pkg.go.dev/github.com/go-chi/chi/middleware#WrapResponseWriter - -### Extra middlewares & packages - -Please see https://github.com/go-chi for additional packages. - --------------------------------------------------------------------------------------------------------------------- -| package | description | -|:---------------------------------------------------|:------------------------------------------------------------- -| [cors](https://github.com/go-chi/cors) | Cross-origin resource sharing (CORS) | -| [docgen](https://github.com/go-chi/docgen) | Print chi.Router routes at runtime | -| [jwtauth](https://github.com/go-chi/jwtauth) | JWT authentication | -| [hostrouter](https://github.com/go-chi/hostrouter) | Domain/host based request routing | -| [httplog](https://github.com/go-chi/httplog) | Small but powerful structured HTTP request logging | -| [httprate](https://github.com/go-chi/httprate) | HTTP request rate limiter | -| [httptracer](https://github.com/go-chi/httptracer) | HTTP request performance tracing library | -| [httpvcr](https://github.com/go-chi/httpvcr) | Write deterministic tests for external sources | -| [stampede](https://github.com/go-chi/stampede) | HTTP request coalescer | --------------------------------------------------------------------------------------------------------------------- - - -## context? - -`context` is a tiny pkg that provides simple interface to signal context across call stacks -and goroutines. It was originally written by [Sameer Ajmani](https://github.com/Sajmani) -and is available in stdlib since go1.7. - -Learn more at https://blog.golang.org/context - -and.. -* Docs: https://golang.org/pkg/context -* Source: https://github.com/golang/go/tree/master/src/context - - -## Benchmarks - -The benchmark suite: https://github.com/pkieltyka/go-http-routing-benchmark - -Results as of Nov 29, 2020 with Go 1.15.5 on Linux AMD 3950x - -```shell -BenchmarkChi_Param 3075895 384 ns/op 400 B/op 2 allocs/op -BenchmarkChi_Param5 2116603 566 ns/op 400 B/op 2 allocs/op -BenchmarkChi_Param20 964117 1227 ns/op 400 B/op 2 allocs/op -BenchmarkChi_ParamWrite 2863413 420 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GithubStatic 3045488 395 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GithubParam 2204115 540 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GithubAll 10000 113811 ns/op 81203 B/op 406 allocs/op -BenchmarkChi_GPlusStatic 3337485 359 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GPlusParam 2825853 423 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GPlus2Params 2471697 483 ns/op 400 B/op 2 allocs/op -BenchmarkChi_GPlusAll 194220 5950 ns/op 5200 B/op 26 allocs/op -BenchmarkChi_ParseStatic 3365324 356 ns/op 400 B/op 2 allocs/op -BenchmarkChi_ParseParam 2976614 404 ns/op 400 B/op 2 allocs/op -BenchmarkChi_Parse2Params 2638084 439 ns/op 400 B/op 2 allocs/op -BenchmarkChi_ParseAll 109567 11295 ns/op 10400 B/op 52 allocs/op -BenchmarkChi_StaticAll 16846 71308 ns/op 62802 B/op 314 allocs/op -``` - -Comparison with other routers: https://gist.github.com/pkieltyka/123032f12052520aaccab752bd3e78cc - -NOTE: the allocs in the benchmark above are from the calls to http.Request's -`WithContext(context.Context)` method that clones the http.Request, sets the `Context()` -on the duplicated (alloc'd) request and returns it the new request object. This is just -how setting context on a request in Go works. - - -## Credits - -* Carl Jackson for https://github.com/zenazn/goji - * Parts of chi's thinking comes from goji, and chi's middleware package - sources from goji. -* Armon Dadgar for https://github.com/armon/go-radix -* Contributions: [@VojtechVitek](https://github.com/VojtechVitek) - -We'll be more than happy to see [your contributions](./CONTRIBUTING.md)! - - -## Beyond REST - -chi is just a http router that lets you decompose request handling into many smaller layers. -Many companies use chi to write REST services for their public APIs. But, REST is just a convention -for managing state via HTTP, and there's a lot of other pieces required to write a complete client-server -system or network of microservices. - -Looking beyond REST, I also recommend some newer works in the field: -* [webrpc](https://github.com/webrpc/webrpc) - Web-focused RPC client+server framework with code-gen -* [gRPC](https://github.com/grpc/grpc-go) - Google's RPC framework via protobufs -* [graphql](https://github.com/99designs/gqlgen) - Declarative query language -* [NATS](https://nats.io) - lightweight pub-sub - - -## License - -Copyright (c) 2015-present [Peter Kieltyka](https://github.com/pkieltyka) - -Licensed under [MIT License](./LICENSE) - -[GoDoc]: https://pkg.go.dev/github.com/go-chi/chi?tab=versions -[GoDoc Widget]: https://godoc.org/github.com/go-chi/chi?status.svg -[Travis]: https://travis-ci.org/go-chi/chi -[Travis Widget]: https://travis-ci.org/go-chi/chi.svg?branch=master diff --git a/vendor/github.com/go-chi/chi/v5/chain.go b/vendor/github.com/go-chi/chi/v5/chain.go deleted file mode 100644 index a2278414f4..0000000000 --- a/vendor/github.com/go-chi/chi/v5/chain.go +++ /dev/null @@ -1,49 +0,0 @@ -package chi - -import "net/http" - -// Chain returns a Middlewares type from a slice of middleware handlers. -func Chain(middlewares ...func(http.Handler) http.Handler) Middlewares { - return Middlewares(middlewares) -} - -// Handler builds and returns a http.Handler from the chain of middlewares, -// with `h http.Handler` as the final handler. -func (mws Middlewares) Handler(h http.Handler) http.Handler { - return &ChainHandler{h, chain(mws, h), mws} -} - -// HandlerFunc builds and returns a http.Handler from the chain of middlewares, -// with `h http.Handler` as the final handler. -func (mws Middlewares) HandlerFunc(h http.HandlerFunc) http.Handler { - return &ChainHandler{h, chain(mws, h), mws} -} - -// ChainHandler is a http.Handler with support for handler composition and -// execution. -type ChainHandler struct { - Endpoint http.Handler - chain http.Handler - Middlewares Middlewares -} - -func (c *ChainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { - c.chain.ServeHTTP(w, r) -} - -// chain builds a http.Handler composed of an inline middleware stack and endpoint -// handler in the order they are passed. -func chain(middlewares []func(http.Handler) http.Handler, endpoint http.Handler) http.Handler { - // Return ahead of time if there aren't any middlewares for the chain - if len(middlewares) == 0 { - return endpoint - } - - // Wrap the end handler with the middleware chain - h := middlewares[len(middlewares)-1](endpoint) - for i := len(middlewares) - 2; i >= 0; i-- { - h = middlewares[i](h) - } - - return h -} diff --git a/vendor/github.com/go-chi/chi/v5/chi.go b/vendor/github.com/go-chi/chi/v5/chi.go deleted file mode 100644 index a1691bbeb1..0000000000 --- a/vendor/github.com/go-chi/chi/v5/chi.go +++ /dev/null @@ -1,134 +0,0 @@ -// Package chi is a small, idiomatic and composable router for building HTTP services. -// -// chi requires Go 1.14 or newer. -// -// Example: -// -// package main -// -// import ( -// "net/http" -// -// "github.com/go-chi/chi/v5" -// "github.com/go-chi/chi/v5/middleware" -// ) -// -// func main() { -// r := chi.NewRouter() -// r.Use(middleware.Logger) -// r.Use(middleware.Recoverer) -// -// r.Get("/", func(w http.ResponseWriter, r *http.Request) { -// w.Write([]byte("root.")) -// }) -// -// http.ListenAndServe(":3333", r) -// } -// -// See github.com/go-chi/chi/_examples/ for more in-depth examples. -// -// URL patterns allow for easy matching of path components in HTTP -// requests. The matching components can then be accessed using -// chi.URLParam(). All patterns must begin with a slash. -// -// A simple named placeholder {name} matches any sequence of characters -// up to the next / or the end of the URL. Trailing slashes on paths must -// be handled explicitly. -// -// A placeholder with a name followed by a colon allows a regular -// expression match, for example {number:\\d+}. The regular expression -// syntax is Go's normal regexp RE2 syntax, except that regular expressions -// including { or } are not supported, and / will never be -// matched. An anonymous regexp pattern is allowed, using an empty string -// before the colon in the placeholder, such as {:\\d+} -// -// The special placeholder of asterisk matches the rest of the requested -// URL. Any trailing characters in the pattern are ignored. This is the only -// placeholder which will match / characters. -// -// Examples: -// -// "/user/{name}" matches "/user/jsmith" but not "/user/jsmith/info" or "/user/jsmith/" -// "/user/{name}/info" matches "/user/jsmith/info" -// "/page/*" matches "/page/intro/latest" -// "/page/{other}/index" also matches "/page/intro/latest" -// "/date/{yyyy:\\d\\d\\d\\d}/{mm:\\d\\d}/{dd:\\d\\d}" matches "/date/2017/04/01" -package chi - -import "net/http" - -// NewRouter returns a new Mux object that implements the Router interface. -func NewRouter() *Mux { - return NewMux() -} - -// Router consisting of the core routing methods used by chi's Mux, -// using only the standard net/http. -type Router interface { - http.Handler - Routes - - // Use appends one or more middlewares onto the Router stack. - Use(middlewares ...func(http.Handler) http.Handler) - - // With adds inline middlewares for an endpoint handler. - With(middlewares ...func(http.Handler) http.Handler) Router - - // Group adds a new inline-Router along the current routing - // path, with a fresh middleware stack for the inline-Router. - Group(fn func(r Router)) Router - - // Route mounts a sub-Router along a `pattern`` string. - Route(pattern string, fn func(r Router)) Router - - // Mount attaches another http.Handler along ./pattern/* - Mount(pattern string, h http.Handler) - - // Handle and HandleFunc adds routes for `pattern` that matches - // all HTTP methods. - Handle(pattern string, h http.Handler) - HandleFunc(pattern string, h http.HandlerFunc) - - // Method and MethodFunc adds routes for `pattern` that matches - // the `method` HTTP method. - Method(method, pattern string, h http.Handler) - MethodFunc(method, pattern string, h http.HandlerFunc) - - // HTTP-method routing along `pattern` - Connect(pattern string, h http.HandlerFunc) - Delete(pattern string, h http.HandlerFunc) - Get(pattern string, h http.HandlerFunc) - Head(pattern string, h http.HandlerFunc) - Options(pattern string, h http.HandlerFunc) - Patch(pattern string, h http.HandlerFunc) - Post(pattern string, h http.HandlerFunc) - Put(pattern string, h http.HandlerFunc) - Trace(pattern string, h http.HandlerFunc) - - // NotFound defines a handler to respond whenever a route could - // not be found. - NotFound(h http.HandlerFunc) - - // MethodNotAllowed defines a handler to respond whenever a method is - // not allowed. - MethodNotAllowed(h http.HandlerFunc) -} - -// Routes interface adds two methods for router traversal, which is also -// used by the `docgen` subpackage to generation documentation for Routers. -type Routes interface { - // Routes returns the routing tree in an easily traversable structure. - Routes() []Route - - // Middlewares returns the list of middlewares in use by the router. - Middlewares() Middlewares - - // Match searches the routing tree for a handler that matches - // the method/path - similar to routing a http request, but without - // executing the handler thereafter. - Match(rctx *Context, method, path string) bool -} - -// Middlewares type is a slice of standard middleware handlers with methods -// to compose middleware chains and http.Handler's. -type Middlewares []func(http.Handler) http.Handler diff --git a/vendor/github.com/go-chi/chi/v5/context.go b/vendor/github.com/go-chi/chi/v5/context.go deleted file mode 100644 index e78a2385d8..0000000000 --- a/vendor/github.com/go-chi/chi/v5/context.go +++ /dev/null @@ -1,159 +0,0 @@ -package chi - -import ( - "context" - "net/http" - "strings" -) - -// URLParam returns the url parameter from a http.Request object. -func URLParam(r *http.Request, key string) string { - if rctx := RouteContext(r.Context()); rctx != nil { - return rctx.URLParam(key) - } - return "" -} - -// URLParamFromCtx returns the url parameter from a http.Request Context. -func URLParamFromCtx(ctx context.Context, key string) string { - if rctx := RouteContext(ctx); rctx != nil { - return rctx.URLParam(key) - } - return "" -} - -// RouteContext returns chi's routing Context object from a -// http.Request Context. -func RouteContext(ctx context.Context) *Context { - val, _ := ctx.Value(RouteCtxKey).(*Context) - return val -} - -// NewRouteContext returns a new routing Context object. -func NewRouteContext() *Context { - return &Context{} -} - -var ( - // RouteCtxKey is the context.Context key to store the request context. - RouteCtxKey = &contextKey{"RouteContext"} -) - -// Context is the default routing context set on the root node of a -// request context to track route patterns, URL parameters and -// an optional routing path. -type Context struct { - Routes Routes - - // parentCtx is the parent of this one, for using Context as a - // context.Context directly. This is an optimization that saves - // 1 allocation. - parentCtx context.Context - - // Routing path/method override used during the route search. - // See Mux#routeHTTP method. - RoutePath string - RouteMethod string - - // URLParams are the stack of routeParams captured during the - // routing lifecycle across a stack of sub-routers. - URLParams RouteParams - - // Route parameters matched for the current sub-router. It is - // intentionally unexported so it cant be tampered. - routeParams RouteParams - - // The endpoint routing pattern that matched the request URI path - // or `RoutePath` of the current sub-router. This value will update - // during the lifecycle of a request passing through a stack of - // sub-routers. - routePattern string - - // Routing pattern stack throughout the lifecycle of the request, - // across all connected routers. It is a record of all matching - // patterns across a stack of sub-routers. - RoutePatterns []string - - // methodNotAllowed hint - methodNotAllowed bool -} - -// Reset a routing context to its initial state. -func (x *Context) Reset() { - x.Routes = nil - x.RoutePath = "" - x.RouteMethod = "" - x.RoutePatterns = x.RoutePatterns[:0] - x.URLParams.Keys = x.URLParams.Keys[:0] - x.URLParams.Values = x.URLParams.Values[:0] - - x.routePattern = "" - x.routeParams.Keys = x.routeParams.Keys[:0] - x.routeParams.Values = x.routeParams.Values[:0] - x.methodNotAllowed = false - x.parentCtx = nil -} - -// URLParam returns the corresponding URL parameter value from the request -// routing context. -func (x *Context) URLParam(key string) string { - for k := len(x.URLParams.Keys) - 1; k >= 0; k-- { - if x.URLParams.Keys[k] == key { - return x.URLParams.Values[k] - } - } - return "" -} - -// RoutePattern builds the routing pattern string for the particular -// request, at the particular point during routing. This means, the value -// will change throughout the execution of a request in a router. That is -// why its advised to only use this value after calling the next handler. -// -// For example, -// -// func Instrument(next http.Handler) http.Handler { -// return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { -// next.ServeHTTP(w, r) -// routePattern := chi.RouteContext(r.Context()).RoutePattern() -// measure(w, r, routePattern) -// }) -// } -func (x *Context) RoutePattern() string { - routePattern := strings.Join(x.RoutePatterns, "") - routePattern = replaceWildcards(routePattern) - routePattern = strings.TrimSuffix(routePattern, "//") - routePattern = strings.TrimSuffix(routePattern, "/") - return routePattern -} - -// replaceWildcards takes a route pattern and recursively replaces all -// occurrences of "/*/" to "/". -func replaceWildcards(p string) string { - if strings.Contains(p, "/*/") { - return replaceWildcards(strings.Replace(p, "/*/", "/", -1)) - } - return p -} - -// RouteParams is a structure to track URL routing parameters efficiently. -type RouteParams struct { - Keys, Values []string -} - -// Add will append a URL parameter to the end of the route param -func (s *RouteParams) Add(key, value string) { - s.Keys = append(s.Keys, key) - s.Values = append(s.Values, value) -} - -// contextKey is a value for use with context.WithValue. It's used as -// a pointer so it fits in an interface{} without allocation. This technique -// for defining context keys was copied from Go 1.7's new use of context in net/http. -type contextKey struct { - name string -} - -func (k *contextKey) String() string { - return "chi context value " + k.name -} diff --git a/vendor/github.com/go-chi/chi/v5/mux.go b/vendor/github.com/go-chi/chi/v5/mux.go deleted file mode 100644 index 47e64cf296..0000000000 --- a/vendor/github.com/go-chi/chi/v5/mux.go +++ /dev/null @@ -1,487 +0,0 @@ -package chi - -import ( - "context" - "fmt" - "net/http" - "strings" - "sync" -) - -var _ Router = &Mux{} - -// Mux is a simple HTTP route multiplexer that parses a request path, -// records any URL params, and executes an end handler. It implements -// the http.Handler interface and is friendly with the standard library. -// -// Mux is designed to be fast, minimal and offer a powerful API for building -// modular and composable HTTP services with a large set of handlers. It's -// particularly useful for writing large REST API services that break a handler -// into many smaller parts composed of middlewares and end handlers. -type Mux struct { - // The computed mux handler made of the chained middleware stack and - // the tree router - handler http.Handler - - // The radix trie router - tree *node - - // Custom method not allowed handler - methodNotAllowedHandler http.HandlerFunc - - // A reference to the parent mux used by subrouters when mounting - // to a parent mux - parent *Mux - - // Routing context pool - pool *sync.Pool - - // Custom route not found handler - notFoundHandler http.HandlerFunc - - // The middleware stack - middlewares []func(http.Handler) http.Handler - - // Controls the behaviour of middleware chain generation when a mux - // is registered as an inline group inside another mux. - inline bool -} - -// NewMux returns a newly initialized Mux object that implements the Router -// interface. -func NewMux() *Mux { - mux := &Mux{tree: &node{}, pool: &sync.Pool{}} - mux.pool.New = func() interface{} { - return NewRouteContext() - } - return mux -} - -// ServeHTTP is the single method of the http.Handler interface that makes -// Mux interoperable with the standard library. It uses a sync.Pool to get and -// reuse routing contexts for each request. -func (mx *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // Ensure the mux has some routes defined on the mux - if mx.handler == nil { - mx.NotFoundHandler().ServeHTTP(w, r) - return - } - - // Check if a routing context already exists from a parent router. - rctx, _ := r.Context().Value(RouteCtxKey).(*Context) - if rctx != nil { - mx.handler.ServeHTTP(w, r) - return - } - - // Fetch a RouteContext object from the sync pool, and call the computed - // mx.handler that is comprised of mx.middlewares + mx.routeHTTP. - // Once the request is finished, reset the routing context and put it back - // into the pool for reuse from another request. - rctx = mx.pool.Get().(*Context) - rctx.Reset() - rctx.Routes = mx - rctx.parentCtx = r.Context() - - // NOTE: r.WithContext() causes 2 allocations and context.WithValue() causes 1 allocation - r = r.WithContext(context.WithValue(r.Context(), RouteCtxKey, rctx)) - - // Serve the request and once its done, put the request context back in the sync pool - mx.handler.ServeHTTP(w, r) - mx.pool.Put(rctx) -} - -// Use appends a middleware handler to the Mux middleware stack. -// -// The middleware stack for any Mux will execute before searching for a matching -// route to a specific handler, which provides opportunity to respond early, -// change the course of the request execution, or set request-scoped values for -// the next http.Handler. -func (mx *Mux) Use(middlewares ...func(http.Handler) http.Handler) { - if mx.handler != nil { - panic("chi: all middlewares must be defined before routes on a mux") - } - mx.middlewares = append(mx.middlewares, middlewares...) -} - -// Handle adds the route `pattern` that matches any http method to -// execute the `handler` http.Handler. -func (mx *Mux) Handle(pattern string, handler http.Handler) { - mx.handle(mALL, pattern, handler) -} - -// HandleFunc adds the route `pattern` that matches any http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) HandleFunc(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mALL, pattern, handlerFn) -} - -// Method adds the route `pattern` that matches `method` http method to -// execute the `handler` http.Handler. -func (mx *Mux) Method(method, pattern string, handler http.Handler) { - m, ok := methodMap[strings.ToUpper(method)] - if !ok { - panic(fmt.Sprintf("chi: '%s' http method is not supported.", method)) - } - mx.handle(m, pattern, handler) -} - -// MethodFunc adds the route `pattern` that matches `method` http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) MethodFunc(method, pattern string, handlerFn http.HandlerFunc) { - mx.Method(method, pattern, handlerFn) -} - -// Connect adds the route `pattern` that matches a CONNECT http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Connect(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mCONNECT, pattern, handlerFn) -} - -// Delete adds the route `pattern` that matches a DELETE http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Delete(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mDELETE, pattern, handlerFn) -} - -// Get adds the route `pattern` that matches a GET http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Get(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mGET, pattern, handlerFn) -} - -// Head adds the route `pattern` that matches a HEAD http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Head(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mHEAD, pattern, handlerFn) -} - -// Options adds the route `pattern` that matches a OPTIONS http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Options(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mOPTIONS, pattern, handlerFn) -} - -// Patch adds the route `pattern` that matches a PATCH http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Patch(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mPATCH, pattern, handlerFn) -} - -// Post adds the route `pattern` that matches a POST http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Post(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mPOST, pattern, handlerFn) -} - -// Put adds the route `pattern` that matches a PUT http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Put(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mPUT, pattern, handlerFn) -} - -// Trace adds the route `pattern` that matches a TRACE http method to -// execute the `handlerFn` http.HandlerFunc. -func (mx *Mux) Trace(pattern string, handlerFn http.HandlerFunc) { - mx.handle(mTRACE, pattern, handlerFn) -} - -// NotFound sets a custom http.HandlerFunc for routing paths that could -// not be found. The default 404 handler is `http.NotFound`. -func (mx *Mux) NotFound(handlerFn http.HandlerFunc) { - // Build NotFound handler chain - m := mx - hFn := handlerFn - if mx.inline && mx.parent != nil { - m = mx.parent - hFn = Chain(mx.middlewares...).HandlerFunc(hFn).ServeHTTP - } - - // Update the notFoundHandler from this point forward - m.notFoundHandler = hFn - m.updateSubRoutes(func(subMux *Mux) { - if subMux.notFoundHandler == nil { - subMux.NotFound(hFn) - } - }) -} - -// MethodNotAllowed sets a custom http.HandlerFunc for routing paths where the -// method is unresolved. The default handler returns a 405 with an empty body. -func (mx *Mux) MethodNotAllowed(handlerFn http.HandlerFunc) { - // Build MethodNotAllowed handler chain - m := mx - hFn := handlerFn - if mx.inline && mx.parent != nil { - m = mx.parent - hFn = Chain(mx.middlewares...).HandlerFunc(hFn).ServeHTTP - } - - // Update the methodNotAllowedHandler from this point forward - m.methodNotAllowedHandler = hFn - m.updateSubRoutes(func(subMux *Mux) { - if subMux.methodNotAllowedHandler == nil { - subMux.MethodNotAllowed(hFn) - } - }) -} - -// With adds inline middlewares for an endpoint handler. -func (mx *Mux) With(middlewares ...func(http.Handler) http.Handler) Router { - // Similarly as in handle(), we must build the mux handler once additional - // middleware registration isn't allowed for this stack, like now. - if !mx.inline && mx.handler == nil { - mx.updateRouteHandler() - } - - // Copy middlewares from parent inline muxs - var mws Middlewares - if mx.inline { - mws = make(Middlewares, len(mx.middlewares)) - copy(mws, mx.middlewares) - } - mws = append(mws, middlewares...) - - im := &Mux{ - pool: mx.pool, inline: true, parent: mx, tree: mx.tree, middlewares: mws, - notFoundHandler: mx.notFoundHandler, methodNotAllowedHandler: mx.methodNotAllowedHandler, - } - - return im -} - -// Group creates a new inline-Mux with a fresh middleware stack. It's useful -// for a group of handlers along the same routing path that use an additional -// set of middlewares. See _examples/. -func (mx *Mux) Group(fn func(r Router)) Router { - im := mx.With().(*Mux) - if fn != nil { - fn(im) - } - return im -} - -// Route creates a new Mux with a fresh middleware stack and mounts it -// along the `pattern` as a subrouter. Effectively, this is a short-hand -// call to Mount. See _examples/. -func (mx *Mux) Route(pattern string, fn func(r Router)) Router { - if fn == nil { - panic(fmt.Sprintf("chi: attempting to Route() a nil subrouter on '%s'", pattern)) - } - subRouter := NewRouter() - fn(subRouter) - mx.Mount(pattern, subRouter) - return subRouter -} - -// Mount attaches another http.Handler or chi Router as a subrouter along a routing -// path. It's very useful to split up a large API as many independent routers and -// compose them as a single service using Mount. See _examples/. -// -// Note that Mount() simply sets a wildcard along the `pattern` that will continue -// routing at the `handler`, which in most cases is another chi.Router. As a result, -// if you define two Mount() routes on the exact same pattern the mount will panic. -func (mx *Mux) Mount(pattern string, handler http.Handler) { - if handler == nil { - panic(fmt.Sprintf("chi: attempting to Mount() a nil handler on '%s'", pattern)) - } - - // Provide runtime safety for ensuring a pattern isn't mounted on an existing - // routing pattern. - if mx.tree.findPattern(pattern+"*") || mx.tree.findPattern(pattern+"/*") { - panic(fmt.Sprintf("chi: attempting to Mount() a handler on an existing path, '%s'", pattern)) - } - - // Assign sub-Router's with the parent not found & method not allowed handler if not specified. - subr, ok := handler.(*Mux) - if ok && subr.notFoundHandler == nil && mx.notFoundHandler != nil { - subr.NotFound(mx.notFoundHandler) - } - if ok && subr.methodNotAllowedHandler == nil && mx.methodNotAllowedHandler != nil { - subr.MethodNotAllowed(mx.methodNotAllowedHandler) - } - - mountHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - rctx := RouteContext(r.Context()) - - // shift the url path past the previous subrouter - rctx.RoutePath = mx.nextRoutePath(rctx) - - // reset the wildcard URLParam which connects the subrouter - n := len(rctx.URLParams.Keys) - 1 - if n >= 0 && rctx.URLParams.Keys[n] == "*" && len(rctx.URLParams.Values) > n { - rctx.URLParams.Values[n] = "" - } - - handler.ServeHTTP(w, r) - }) - - if pattern == "" || pattern[len(pattern)-1] != '/' { - mx.handle(mALL|mSTUB, pattern, mountHandler) - mx.handle(mALL|mSTUB, pattern+"/", mountHandler) - pattern += "/" - } - - method := mALL - subroutes, _ := handler.(Routes) - if subroutes != nil { - method |= mSTUB - } - n := mx.handle(method, pattern+"*", mountHandler) - - if subroutes != nil { - n.subroutes = subroutes - } -} - -// Routes returns a slice of routing information from the tree, -// useful for traversing available routes of a router. -func (mx *Mux) Routes() []Route { - return mx.tree.routes() -} - -// Middlewares returns a slice of middleware handler functions. -func (mx *Mux) Middlewares() Middlewares { - return mx.middlewares -} - -// Match searches the routing tree for a handler that matches the method/path. -// It's similar to routing a http request, but without executing the handler -// thereafter. -// -// Note: the *Context state is updated during execution, so manage -// the state carefully or make a NewRouteContext(). -func (mx *Mux) Match(rctx *Context, method, path string) bool { - m, ok := methodMap[method] - if !ok { - return false - } - - node, _, h := mx.tree.FindRoute(rctx, m, path) - - if node != nil && node.subroutes != nil { - rctx.RoutePath = mx.nextRoutePath(rctx) - return node.subroutes.Match(rctx, method, rctx.RoutePath) - } - - return h != nil -} - -// NotFoundHandler returns the default Mux 404 responder whenever a route -// cannot be found. -func (mx *Mux) NotFoundHandler() http.HandlerFunc { - if mx.notFoundHandler != nil { - return mx.notFoundHandler - } - return http.NotFound -} - -// MethodNotAllowedHandler returns the default Mux 405 responder whenever -// a method cannot be resolved for a route. -func (mx *Mux) MethodNotAllowedHandler() http.HandlerFunc { - if mx.methodNotAllowedHandler != nil { - return mx.methodNotAllowedHandler - } - return methodNotAllowedHandler -} - -// handle registers a http.Handler in the routing tree for a particular http method -// and routing pattern. -func (mx *Mux) handle(method methodTyp, pattern string, handler http.Handler) *node { - if len(pattern) == 0 || pattern[0] != '/' { - panic(fmt.Sprintf("chi: routing pattern must begin with '/' in '%s'", pattern)) - } - - // Build the computed routing handler for this routing pattern. - if !mx.inline && mx.handler == nil { - mx.updateRouteHandler() - } - - // Build endpoint handler with inline middlewares for the route - var h http.Handler - if mx.inline { - mx.handler = http.HandlerFunc(mx.routeHTTP) - h = Chain(mx.middlewares...).Handler(handler) - } else { - h = handler - } - - // Add the endpoint to the tree and return the node - return mx.tree.InsertRoute(method, pattern, h) -} - -// routeHTTP routes a http.Request through the Mux routing tree to serve -// the matching handler for a particular http method. -func (mx *Mux) routeHTTP(w http.ResponseWriter, r *http.Request) { - // Grab the route context object - rctx := r.Context().Value(RouteCtxKey).(*Context) - - // The request routing path - routePath := rctx.RoutePath - if routePath == "" { - if r.URL.RawPath != "" { - routePath = r.URL.RawPath - } else { - routePath = r.URL.Path - } - if routePath == "" { - routePath = "/" - } - } - - // Check if method is supported by chi - if rctx.RouteMethod == "" { - rctx.RouteMethod = r.Method - } - method, ok := methodMap[rctx.RouteMethod] - if !ok { - mx.MethodNotAllowedHandler().ServeHTTP(w, r) - return - } - - // Find the route - if _, _, h := mx.tree.FindRoute(rctx, method, routePath); h != nil { - h.ServeHTTP(w, r) - return - } - if rctx.methodNotAllowed { - mx.MethodNotAllowedHandler().ServeHTTP(w, r) - } else { - mx.NotFoundHandler().ServeHTTP(w, r) - } -} - -func (mx *Mux) nextRoutePath(rctx *Context) string { - routePath := "/" - nx := len(rctx.routeParams.Keys) - 1 // index of last param in list - if nx >= 0 && rctx.routeParams.Keys[nx] == "*" && len(rctx.routeParams.Values) > nx { - routePath = "/" + rctx.routeParams.Values[nx] - } - return routePath -} - -// Recursively update data on child routers. -func (mx *Mux) updateSubRoutes(fn func(subMux *Mux)) { - for _, r := range mx.tree.routes() { - subMux, ok := r.SubRoutes.(*Mux) - if !ok { - continue - } - fn(subMux) - } -} - -// updateRouteHandler builds the single mux handler that is a chain of the middleware -// stack, as defined by calls to Use(), and the tree router (Mux) itself. After this -// point, no other middlewares can be registered on this Mux's stack. But you can still -// compose additional middlewares via Group()'s or using a chained middleware handler. -func (mx *Mux) updateRouteHandler() { - mx.handler = chain(mx.middlewares, http.HandlerFunc(mx.routeHTTP)) -} - -// methodNotAllowedHandler is a helper function to respond with a 405, -// method not allowed. -func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(405) - w.Write(nil) -} diff --git a/vendor/github.com/go-chi/chi/v5/tree.go b/vendor/github.com/go-chi/chi/v5/tree.go deleted file mode 100644 index 4189b5228b..0000000000 --- a/vendor/github.com/go-chi/chi/v5/tree.go +++ /dev/null @@ -1,866 +0,0 @@ -package chi - -// Radix tree implementation below is a based on the original work by -// Armon Dadgar in https://github.com/armon/go-radix/blob/master/radix.go -// (MIT licensed). It's been heavily modified for use as a HTTP routing tree. - -import ( - "fmt" - "net/http" - "regexp" - "sort" - "strconv" - "strings" -) - -type methodTyp uint - -const ( - mSTUB methodTyp = 1 << iota - mCONNECT - mDELETE - mGET - mHEAD - mOPTIONS - mPATCH - mPOST - mPUT - mTRACE -) - -var mALL = mCONNECT | mDELETE | mGET | mHEAD | - mOPTIONS | mPATCH | mPOST | mPUT | mTRACE - -var methodMap = map[string]methodTyp{ - http.MethodConnect: mCONNECT, - http.MethodDelete: mDELETE, - http.MethodGet: mGET, - http.MethodHead: mHEAD, - http.MethodOptions: mOPTIONS, - http.MethodPatch: mPATCH, - http.MethodPost: mPOST, - http.MethodPut: mPUT, - http.MethodTrace: mTRACE, -} - -// RegisterMethod adds support for custom HTTP method handlers, available -// via Router#Method and Router#MethodFunc -func RegisterMethod(method string) { - if method == "" { - return - } - method = strings.ToUpper(method) - if _, ok := methodMap[method]; ok { - return - } - n := len(methodMap) - if n > strconv.IntSize-2 { - panic(fmt.Sprintf("chi: max number of methods reached (%d)", strconv.IntSize)) - } - mt := methodTyp(2 << n) - methodMap[method] = mt - mALL |= mt -} - -type nodeTyp uint8 - -const ( - ntStatic nodeTyp = iota // /home - ntRegexp // /{id:[0-9]+} - ntParam // /{user} - ntCatchAll // /api/v1/* -) - -type node struct { - // subroutes on the leaf node - subroutes Routes - - // regexp matcher for regexp nodes - rex *regexp.Regexp - - // HTTP handler endpoints on the leaf node - endpoints endpoints - - // prefix is the common prefix we ignore - prefix string - - // child nodes should be stored in-order for iteration, - // in groups of the node type. - children [ntCatchAll + 1]nodes - - // first byte of the child prefix - tail byte - - // node type: static, regexp, param, catchAll - typ nodeTyp - - // first byte of the prefix - label byte -} - -// endpoints is a mapping of http method constants to handlers -// for a given route. -type endpoints map[methodTyp]*endpoint - -type endpoint struct { - // endpoint handler - handler http.Handler - - // pattern is the routing pattern for handler nodes - pattern string - - // parameter keys recorded on handler nodes - paramKeys []string -} - -func (s endpoints) Value(method methodTyp) *endpoint { - mh, ok := s[method] - if !ok { - mh = &endpoint{} - s[method] = mh - } - return mh -} - -func (n *node) InsertRoute(method methodTyp, pattern string, handler http.Handler) *node { - var parent *node - search := pattern - - for { - // Handle key exhaustion - if len(search) == 0 { - // Insert or update the node's leaf handler - n.setEndpoint(method, handler, pattern) - return n - } - - // We're going to be searching for a wild node next, - // in this case, we need to get the tail - var label = search[0] - var segTail byte - var segEndIdx int - var segTyp nodeTyp - var segRexpat string - if label == '{' || label == '*' { - segTyp, _, segRexpat, segTail, _, segEndIdx = patNextSegment(search) - } - - var prefix string - if segTyp == ntRegexp { - prefix = segRexpat - } - - // Look for the edge to attach to - parent = n - n = n.getEdge(segTyp, label, segTail, prefix) - - // No edge, create one - if n == nil { - child := &node{label: label, tail: segTail, prefix: search} - hn := parent.addChild(child, search) - hn.setEndpoint(method, handler, pattern) - - return hn - } - - // Found an edge to match the pattern - - if n.typ > ntStatic { - // We found a param node, trim the param from the search path and continue. - // This param/wild pattern segment would already be on the tree from a previous - // call to addChild when creating a new node. - search = search[segEndIdx:] - continue - } - - // Static nodes fall below here. - // Determine longest prefix of the search key on match. - commonPrefix := longestPrefix(search, n.prefix) - if commonPrefix == len(n.prefix) { - // the common prefix is as long as the current node's prefix we're attempting to insert. - // keep the search going. - search = search[commonPrefix:] - continue - } - - // Split the node - child := &node{ - typ: ntStatic, - prefix: search[:commonPrefix], - } - parent.replaceChild(search[0], segTail, child) - - // Restore the existing node - n.label = n.prefix[commonPrefix] - n.prefix = n.prefix[commonPrefix:] - child.addChild(n, n.prefix) - - // If the new key is a subset, set the method/handler on this node and finish. - search = search[commonPrefix:] - if len(search) == 0 { - child.setEndpoint(method, handler, pattern) - return child - } - - // Create a new edge for the node - subchild := &node{ - typ: ntStatic, - label: search[0], - prefix: search, - } - hn := child.addChild(subchild, search) - hn.setEndpoint(method, handler, pattern) - return hn - } -} - -// addChild appends the new `child` node to the tree using the `pattern` as the trie key. -// For a URL router like chi's, we split the static, param, regexp and wildcard segments -// into different nodes. In addition, addChild will recursively call itself until every -// pattern segment is added to the url pattern tree as individual nodes, depending on type. -func (n *node) addChild(child *node, prefix string) *node { - search := prefix - - // handler leaf node added to the tree is the child. - // this may be overridden later down the flow - hn := child - - // Parse next segment - segTyp, _, segRexpat, segTail, segStartIdx, segEndIdx := patNextSegment(search) - - // Add child depending on next up segment - switch segTyp { - - case ntStatic: - // Search prefix is all static (that is, has no params in path) - // noop - - default: - // Search prefix contains a param, regexp or wildcard - - if segTyp == ntRegexp { - rex, err := regexp.Compile(segRexpat) - if err != nil { - panic(fmt.Sprintf("chi: invalid regexp pattern '%s' in route param", segRexpat)) - } - child.prefix = segRexpat - child.rex = rex - } - - if segStartIdx == 0 { - // Route starts with a param - child.typ = segTyp - - if segTyp == ntCatchAll { - segStartIdx = -1 - } else { - segStartIdx = segEndIdx - } - if segStartIdx < 0 { - segStartIdx = len(search) - } - child.tail = segTail // for params, we set the tail - - if segStartIdx != len(search) { - // add static edge for the remaining part, split the end. - // its not possible to have adjacent param nodes, so its certainly - // going to be a static node next. - - search = search[segStartIdx:] // advance search position - - nn := &node{ - typ: ntStatic, - label: search[0], - prefix: search, - } - hn = child.addChild(nn, search) - } - - } else if segStartIdx > 0 { - // Route has some param - - // starts with a static segment - child.typ = ntStatic - child.prefix = search[:segStartIdx] - child.rex = nil - - // add the param edge node - search = search[segStartIdx:] - - nn := &node{ - typ: segTyp, - label: search[0], - tail: segTail, - } - hn = child.addChild(nn, search) - - } - } - - n.children[child.typ] = append(n.children[child.typ], child) - n.children[child.typ].Sort() - return hn -} - -func (n *node) replaceChild(label, tail byte, child *node) { - for i := 0; i < len(n.children[child.typ]); i++ { - if n.children[child.typ][i].label == label && n.children[child.typ][i].tail == tail { - n.children[child.typ][i] = child - n.children[child.typ][i].label = label - n.children[child.typ][i].tail = tail - return - } - } - panic("chi: replacing missing child") -} - -func (n *node) getEdge(ntyp nodeTyp, label, tail byte, prefix string) *node { - nds := n.children[ntyp] - for i := 0; i < len(nds); i++ { - if nds[i].label == label && nds[i].tail == tail { - if ntyp == ntRegexp && nds[i].prefix != prefix { - continue - } - return nds[i] - } - } - return nil -} - -func (n *node) setEndpoint(method methodTyp, handler http.Handler, pattern string) { - // Set the handler for the method type on the node - if n.endpoints == nil { - n.endpoints = make(endpoints) - } - - paramKeys := patParamKeys(pattern) - - if method&mSTUB == mSTUB { - n.endpoints.Value(mSTUB).handler = handler - } - if method&mALL == mALL { - h := n.endpoints.Value(mALL) - h.handler = handler - h.pattern = pattern - h.paramKeys = paramKeys - for _, m := range methodMap { - h := n.endpoints.Value(m) - h.handler = handler - h.pattern = pattern - h.paramKeys = paramKeys - } - } else { - h := n.endpoints.Value(method) - h.handler = handler - h.pattern = pattern - h.paramKeys = paramKeys - } -} - -func (n *node) FindRoute(rctx *Context, method methodTyp, path string) (*node, endpoints, http.Handler) { - // Reset the context routing pattern and params - rctx.routePattern = "" - rctx.routeParams.Keys = rctx.routeParams.Keys[:0] - rctx.routeParams.Values = rctx.routeParams.Values[:0] - - // Find the routing handlers for the path - rn := n.findRoute(rctx, method, path) - if rn == nil { - return nil, nil, nil - } - - // Record the routing params in the request lifecycle - rctx.URLParams.Keys = append(rctx.URLParams.Keys, rctx.routeParams.Keys...) - rctx.URLParams.Values = append(rctx.URLParams.Values, rctx.routeParams.Values...) - - // Record the routing pattern in the request lifecycle - if rn.endpoints[method].pattern != "" { - rctx.routePattern = rn.endpoints[method].pattern - rctx.RoutePatterns = append(rctx.RoutePatterns, rctx.routePattern) - } - - return rn, rn.endpoints, rn.endpoints[method].handler -} - -// Recursive edge traversal by checking all nodeTyp groups along the way. -// It's like searching through a multi-dimensional radix trie. -func (n *node) findRoute(rctx *Context, method methodTyp, path string) *node { - nn := n - search := path - - for t, nds := range nn.children { - ntyp := nodeTyp(t) - if len(nds) == 0 { - continue - } - - var xn *node - xsearch := search - - var label byte - if search != "" { - label = search[0] - } - - switch ntyp { - case ntStatic: - xn = nds.findEdge(label) - if xn == nil || !strings.HasPrefix(xsearch, xn.prefix) { - continue - } - xsearch = xsearch[len(xn.prefix):] - - case ntParam, ntRegexp: - // short-circuit and return no matching route for empty param values - if xsearch == "" { - continue - } - - // serially loop through each node grouped by the tail delimiter - for idx := 0; idx < len(nds); idx++ { - xn = nds[idx] - - // label for param nodes is the delimiter byte - p := strings.IndexByte(xsearch, xn.tail) - - if p < 0 { - if xn.tail == '/' { - p = len(xsearch) - } else { - continue - } - } else if ntyp == ntRegexp && p == 0 { - continue - } - - if ntyp == ntRegexp && xn.rex != nil { - if !xn.rex.MatchString(xsearch[:p]) { - continue - } - } else if strings.IndexByte(xsearch[:p], '/') != -1 { - // avoid a match across path segments - continue - } - - prevlen := len(rctx.routeParams.Values) - rctx.routeParams.Values = append(rctx.routeParams.Values, xsearch[:p]) - xsearch = xsearch[p:] - - if len(xsearch) == 0 { - if xn.isLeaf() { - h := xn.endpoints[method] - if h != nil && h.handler != nil { - rctx.routeParams.Keys = append(rctx.routeParams.Keys, h.paramKeys...) - return xn - } - - // flag that the routing context found a route, but not a corresponding - // supported method - rctx.methodNotAllowed = true - } - } - - // recursively find the next node on this branch - fin := xn.findRoute(rctx, method, xsearch) - if fin != nil { - return fin - } - - // not found on this branch, reset vars - rctx.routeParams.Values = rctx.routeParams.Values[:prevlen] - xsearch = search - } - - rctx.routeParams.Values = append(rctx.routeParams.Values, "") - - default: - // catch-all nodes - rctx.routeParams.Values = append(rctx.routeParams.Values, search) - xn = nds[0] - xsearch = "" - } - - if xn == nil { - continue - } - - // did we find it yet? - if len(xsearch) == 0 { - if xn.isLeaf() { - h := xn.endpoints[method] - if h != nil && h.handler != nil { - rctx.routeParams.Keys = append(rctx.routeParams.Keys, h.paramKeys...) - return xn - } - - // flag that the routing context found a route, but not a corresponding - // supported method - rctx.methodNotAllowed = true - } - } - - // recursively find the next node.. - fin := xn.findRoute(rctx, method, xsearch) - if fin != nil { - return fin - } - - // Did not find final handler, let's remove the param here if it was set - if xn.typ > ntStatic { - if len(rctx.routeParams.Values) > 0 { - rctx.routeParams.Values = rctx.routeParams.Values[:len(rctx.routeParams.Values)-1] - } - } - - } - - return nil -} - -func (n *node) findEdge(ntyp nodeTyp, label byte) *node { - nds := n.children[ntyp] - num := len(nds) - idx := 0 - - switch ntyp { - case ntStatic, ntParam, ntRegexp: - i, j := 0, num-1 - for i <= j { - idx = i + (j-i)/2 - if label > nds[idx].label { - i = idx + 1 - } else if label < nds[idx].label { - j = idx - 1 - } else { - i = num // breaks cond - } - } - if nds[idx].label != label { - return nil - } - return nds[idx] - - default: // catch all - return nds[idx] - } -} - -func (n *node) isLeaf() bool { - return n.endpoints != nil -} - -func (n *node) findPattern(pattern string) bool { - nn := n - for _, nds := range nn.children { - if len(nds) == 0 { - continue - } - - n = nn.findEdge(nds[0].typ, pattern[0]) - if n == nil { - continue - } - - var idx int - var xpattern string - - switch n.typ { - case ntStatic: - idx = longestPrefix(pattern, n.prefix) - if idx < len(n.prefix) { - continue - } - - case ntParam, ntRegexp: - idx = strings.IndexByte(pattern, '}') + 1 - - case ntCatchAll: - idx = longestPrefix(pattern, "*") - - default: - panic("chi: unknown node type") - } - - xpattern = pattern[idx:] - if len(xpattern) == 0 { - return true - } - - return n.findPattern(xpattern) - } - return false -} - -func (n *node) routes() []Route { - rts := []Route{} - - n.walk(func(eps endpoints, subroutes Routes) bool { - if eps[mSTUB] != nil && eps[mSTUB].handler != nil && subroutes == nil { - return false - } - - // Group methodHandlers by unique patterns - pats := make(map[string]endpoints) - - for mt, h := range eps { - if h.pattern == "" { - continue - } - p, ok := pats[h.pattern] - if !ok { - p = endpoints{} - pats[h.pattern] = p - } - p[mt] = h - } - - for p, mh := range pats { - hs := make(map[string]http.Handler) - if mh[mALL] != nil && mh[mALL].handler != nil { - hs["*"] = mh[mALL].handler - } - - for mt, h := range mh { - if h.handler == nil { - continue - } - m := methodTypString(mt) - if m == "" { - continue - } - hs[m] = h.handler - } - - rt := Route{subroutes, hs, p} - rts = append(rts, rt) - } - - return false - }) - - return rts -} - -func (n *node) walk(fn func(eps endpoints, subroutes Routes) bool) bool { - // Visit the leaf values if any - if (n.endpoints != nil || n.subroutes != nil) && fn(n.endpoints, n.subroutes) { - return true - } - - // Recurse on the children - for _, ns := range n.children { - for _, cn := range ns { - if cn.walk(fn) { - return true - } - } - } - return false -} - -// patNextSegment returns the next segment details from a pattern: -// node type, param key, regexp string, param tail byte, param starting index, param ending index -func patNextSegment(pattern string) (nodeTyp, string, string, byte, int, int) { - ps := strings.Index(pattern, "{") - ws := strings.Index(pattern, "*") - - if ps < 0 && ws < 0 { - return ntStatic, "", "", 0, 0, len(pattern) // we return the entire thing - } - - // Sanity check - if ps >= 0 && ws >= 0 && ws < ps { - panic("chi: wildcard '*' must be the last pattern in a route, otherwise use a '{param}'") - } - - var tail byte = '/' // Default endpoint tail to / byte - - if ps >= 0 { - // Param/Regexp pattern is next - nt := ntParam - - // Read to closing } taking into account opens and closes in curl count (cc) - cc := 0 - pe := ps - for i, c := range pattern[ps:] { - if c == '{' { - cc++ - } else if c == '}' { - cc-- - if cc == 0 { - pe = ps + i - break - } - } - } - if pe == ps { - panic("chi: route param closing delimiter '}' is missing") - } - - key := pattern[ps+1 : pe] - pe++ // set end to next position - - if pe < len(pattern) { - tail = pattern[pe] - } - - var rexpat string - if idx := strings.Index(key, ":"); idx >= 0 { - nt = ntRegexp - rexpat = key[idx+1:] - key = key[:idx] - } - - if len(rexpat) > 0 { - if rexpat[0] != '^' { - rexpat = "^" + rexpat - } - if rexpat[len(rexpat)-1] != '$' { - rexpat += "$" - } - } - - return nt, key, rexpat, tail, ps, pe - } - - // Wildcard pattern as finale - if ws < len(pattern)-1 { - panic("chi: wildcard '*' must be the last value in a route. trim trailing text or use a '{param}' instead") - } - return ntCatchAll, "*", "", 0, ws, len(pattern) -} - -func patParamKeys(pattern string) []string { - pat := pattern - paramKeys := []string{} - for { - ptyp, paramKey, _, _, _, e := patNextSegment(pat) - if ptyp == ntStatic { - return paramKeys - } - for i := 0; i < len(paramKeys); i++ { - if paramKeys[i] == paramKey { - panic(fmt.Sprintf("chi: routing pattern '%s' contains duplicate param key, '%s'", pattern, paramKey)) - } - } - paramKeys = append(paramKeys, paramKey) - pat = pat[e:] - } -} - -// longestPrefix finds the length of the shared prefix -// of two strings -func longestPrefix(k1, k2 string) int { - max := len(k1) - if l := len(k2); l < max { - max = l - } - var i int - for i = 0; i < max; i++ { - if k1[i] != k2[i] { - break - } - } - return i -} - -func methodTypString(method methodTyp) string { - for s, t := range methodMap { - if method == t { - return s - } - } - return "" -} - -type nodes []*node - -// Sort the list of nodes by label -func (ns nodes) Sort() { sort.Sort(ns); ns.tailSort() } -func (ns nodes) Len() int { return len(ns) } -func (ns nodes) Swap(i, j int) { ns[i], ns[j] = ns[j], ns[i] } -func (ns nodes) Less(i, j int) bool { return ns[i].label < ns[j].label } - -// tailSort pushes nodes with '/' as the tail to the end of the list for param nodes. -// The list order determines the traversal order. -func (ns nodes) tailSort() { - for i := len(ns) - 1; i >= 0; i-- { - if ns[i].typ > ntStatic && ns[i].tail == '/' { - ns.Swap(i, len(ns)-1) - return - } - } -} - -func (ns nodes) findEdge(label byte) *node { - num := len(ns) - idx := 0 - i, j := 0, num-1 - for i <= j { - idx = i + (j-i)/2 - if label > ns[idx].label { - i = idx + 1 - } else if label < ns[idx].label { - j = idx - 1 - } else { - i = num // breaks cond - } - } - if ns[idx].label != label { - return nil - } - return ns[idx] -} - -// Route describes the details of a routing handler. -// Handlers map key is an HTTP method -type Route struct { - SubRoutes Routes - Handlers map[string]http.Handler - Pattern string -} - -// WalkFunc is the type of the function called for each method and route visited by Walk. -type WalkFunc func(method string, route string, handler http.Handler, middlewares ...func(http.Handler) http.Handler) error - -// Walk walks any router tree that implements Routes interface. -func Walk(r Routes, walkFn WalkFunc) error { - return walk(r, walkFn, "") -} - -func walk(r Routes, walkFn WalkFunc, parentRoute string, parentMw ...func(http.Handler) http.Handler) error { - for _, route := range r.Routes() { - mws := make([]func(http.Handler) http.Handler, len(parentMw)) - copy(mws, parentMw) - mws = append(mws, r.Middlewares()...) - - if route.SubRoutes != nil { - if err := walk(route.SubRoutes, walkFn, parentRoute+route.Pattern, mws...); err != nil { - return err - } - continue - } - - for method, handler := range route.Handlers { - if method == "*" { - // Ignore a "catchAll" method, since we pass down all the specific methods for each route. - continue - } - - fullRoute := parentRoute + route.Pattern - fullRoute = strings.Replace(fullRoute, "/*/", "/", -1) - - if chain, ok := handler.(*ChainHandler); ok { - if err := walkFn(method, fullRoute, chain.Endpoint, append(mws, chain.Middlewares...)...); err != nil { - return err - } - } else { - if err := walkFn(method, fullRoute, handler, mws...); err != nil { - return err - } - } - } - } - - return nil -} diff --git a/vendor/github.com/go-critic/go-critic/LICENSE b/vendor/github.com/go-critic/go-critic/LICENSE deleted file mode 100644 index 5198a4a942..0000000000 --- a/vendor/github.com/go-critic/go-critic/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018-2021 go-critic team - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go b/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go deleted file mode 100644 index 2a67dccec8..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/appendAssign_checker.go +++ /dev/null @@ -1,103 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/astp" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "appendAssign" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects suspicious append result assignments" - info.Before = ` -p.positives = append(p.negatives, x) -p.negatives = append(p.negatives, y)` - info.After = ` -p.positives = append(p.positives, x) -p.negatives = append(p.negatives, y)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&appendAssignChecker{ctx: ctx}), nil - }) -} - -type appendAssignChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *appendAssignChecker) VisitStmt(stmt ast.Stmt) { - assign, ok := stmt.(*ast.AssignStmt) - if !ok || (assign.Tok != token.ASSIGN && assign.Tok != token.DEFINE) || len(assign.Lhs) != len(assign.Rhs) { - return - } - for i, rhs := range assign.Rhs { - call, ok := rhs.(*ast.CallExpr) - if !ok || qualifiedName(call.Fun) != "append" { - continue - } - c.checkAppend(assign.Lhs[i], call) - } -} - -func (c *appendAssignChecker) checkAppend(x ast.Expr, call *ast.CallExpr) { - if call.Ellipsis != token.NoPos { - // Try to detect `xs = append(ys, xs...)` idiom. - for _, arg := range call.Args[1:] { - y := arg - if arg, ok := arg.(*ast.SliceExpr); ok { - y = arg.X - } - if astequal.Expr(x, y) { - return - } - } - } - - switch x := x.(type) { - case *ast.Ident: - if x.Name == "_" { - return // Don't check assignments to blank ident - } - case *ast.IndexExpr: - if !astp.IsIndexExpr(call.Args[0]) { - // Most likely `m[k] = append(x, ...)` - // pattern, where x was retrieved by m[k] before. - // - // TODO: it's possible to record such map/slice reads - // and check whether it was done before this call. - // But for now, treat it like x belongs to m[k]. - return - } - } - - switch y := call.Args[0].(type) { - case *ast.SliceExpr: - if _, ok := c.ctx.TypeOf(y.X).(*types.Array); ok { - // Arrays are frequently used as scratch storages. - return - } - c.matchSlices(call, x, y.X) - case *ast.IndexExpr, *ast.Ident, *ast.SelectorExpr: - c.matchSlices(call, x, y) - } -} - -func (c *appendAssignChecker) matchSlices(cause ast.Node, x, y ast.Expr) { - if !astequal.Expr(x, astutil.Unparen(y)) { - c.warn(cause) - } -} - -func (c *appendAssignChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "append result not assigned to the same slice") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go b/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go deleted file mode 100644 index 81a7aa30b3..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/appendCombine_checker.go +++ /dev/null @@ -1,103 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" -) - -func init() { - var info linter.CheckerInfo - info.Name = "appendCombine" - info.Tags = []string{linter.PerformanceTag} - info.Summary = "Detects `append` chains to the same slice that can be done in a single `append` call" - info.Before = ` -xs = append(xs, 1) -xs = append(xs, 2)` - info.After = `xs = append(xs, 1, 2)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmtList(&appendCombineChecker{ctx: ctx}), nil - }) -} - -type appendCombineChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *appendCombineChecker) VisitStmtList(_ ast.Node, list []ast.Stmt) { - var cause ast.Node // First append - var slice ast.Expr // Slice being appended to - chain := 0 // How much appends in a row we've seen - - // Break the chain. - // If enough appends are in chain, print warning. - flush := func() { - if chain > 1 { - c.warn(cause, chain) - } - chain = 0 - slice = nil - } - - for _, stmt := range list { - call := c.matchAppend(stmt, slice) - if call == nil { - flush() - continue - } - - if chain == 0 { - // First append in a chain. - chain = 1 - slice = call.Args[0] - cause = stmt - } else { - chain++ - } - } - - // Required for printing chains that consist of trailing - // statements from the list. - flush() -} - -func (c *appendCombineChecker) matchAppend(stmt ast.Stmt, slice ast.Expr) *ast.CallExpr { - // Seeking for: - // slice = append(slice, xs...) - // xs are 0-N append arguments, but not variadic argument, - // because it makes append combining impossible. - - assign := astcast.ToAssignStmt(stmt) - if len(assign.Lhs) != 1 || len(assign.Rhs) != 1 { - return nil - } - - call, ok := assign.Rhs[0].(*ast.CallExpr) - { - cond := ok && - qualifiedName(call.Fun) == "append" && - call.Ellipsis == token.NoPos && - astequal.Expr(assign.Lhs[0], call.Args[0]) - if !cond { - return nil - } - } - - // Check that current append slice match previous append slice. - // Otherwise we should break the chain. - if slice == nil || astequal.Expr(slice, call.Args[0]) { - return call - } - return nil -} - -func (c *appendCombineChecker) warn(cause ast.Node, chain int) { - c.ctx.Warn(cause, "can combine chain of %d appends into one", chain) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go b/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go deleted file mode 100644 index 9be45ccc78..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/badCond_checker.go +++ /dev/null @@ -1,161 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/constant" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "badCond" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects suspicious condition expressions" - info.Before = ` -for i := 0; i > n; i++ { - xs[i] = 0 -}` - info.After = ` -for i := 0; i < n; i++ { - xs[i] = 0 -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&badCondChecker{ctx: ctx}), nil - }) -} - -type badCondChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *badCondChecker) VisitFuncDecl(decl *ast.FuncDecl) { - ast.Inspect(decl.Body, func(n ast.Node) bool { - switch n := n.(type) { - case *ast.ForStmt: - c.checkForStmt(n) - case ast.Expr: - c.checkExpr(n) - } - return true - }) -} - -func (c *badCondChecker) checkExpr(expr ast.Expr) { - // TODO(quasilyte): recognize more patterns. - - cond := astcast.ToBinaryExpr(expr) - lhs := astcast.ToBinaryExpr(astutil.Unparen(cond.X)) - rhs := astcast.ToBinaryExpr(astutil.Unparen(cond.Y)) - - if cond.Op != token.LAND { - return - } - - // Notes: - // `x != a || x != b` handled by go vet. - - // Pattern 1. - // `x < a && x > b`; Where `a` is less than `b`. - if c.lessAndGreater(lhs, rhs) { - c.warnCond(cond, "always false") - return - } - - // Pattern 2. - // `x == a && x == b` - // - // Valid when `b == a` is intended, but still reported. - // We can disable "just suspicious" warnings by default - // is users are upset with the current behavior. - if c.equalToBoth(lhs, rhs) { - c.warnCond(cond, "suspicious") - return - } -} - -func (c *badCondChecker) equalToBoth(lhs, rhs *ast.BinaryExpr) bool { - return lhs.Op == token.EQL && rhs.Op == token.EQL && - astequal.Expr(lhs.X, rhs.X) -} - -func (c *badCondChecker) lessAndGreater(lhs, rhs *ast.BinaryExpr) bool { - if lhs.Op != token.LSS || rhs.Op != token.GTR { - return false - } - if !astequal.Expr(lhs.X, rhs.X) { - return false - } - a := c.ctx.TypesInfo.Types[lhs.Y].Value - b := c.ctx.TypesInfo.Types[rhs.Y].Value - return a != nil && b != nil && constant.Compare(a, token.LSS, b) -} - -func (c *badCondChecker) checkForStmt(stmt *ast.ForStmt) { - // TODO(quasilyte): handle other kinds of bad conditionals. - - init := astcast.ToAssignStmt(stmt.Init) - if init.Tok != token.DEFINE || len(init.Lhs) != 1 || len(init.Rhs) != 1 { - return - } - if astcast.ToBasicLit(init.Rhs[0]).Value != "0" { - return - } - - iter := astcast.ToIdent(init.Lhs[0]) - cond := astcast.ToBinaryExpr(stmt.Cond) - - var i, n ast.Expr - var op token.Token - switch { - case cond.Op == token.GTR && astequal.Expr(iter, cond.X): - i = cond.X - n = cond.Y - op = token.LSS - case cond.Op == token.LSS && astequal.Expr(iter, cond.Y): - i = cond.Y - n = cond.X - op = token.GTR - default: - return - } - - if !typep.SideEffectFree(c.ctx.TypesInfo, n) { - return - } - - post := astcast.ToIncDecStmt(stmt.Post) - if post.Tok != token.INC || !astequal.Expr(iter, i) { - return - } - - mutated := lintutil.CouldBeMutated(c.ctx.TypesInfo, stmt.Body, n) || - lintutil.CouldBeMutated(c.ctx.TypesInfo, stmt.Body, iter) - if mutated { - return - } - - c.warnForStmt(stmt, op, cond) -} - -func (c *badCondChecker) warnForStmt(cause ast.Node, op token.Token, cond *ast.BinaryExpr) { - suggest := astcopy.BinaryExpr(cond) - suggest.Op = op - c.ctx.Warn(cause, "`%s` in loop; probably meant `%s`?", - cond, suggest) -} - -func (c *badCondChecker) warnCond(cond *ast.BinaryExpr, tag string) { - c.ctx.Warn(cond, "`%s` condition is %s", cond, tag) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go deleted file mode 100644 index 6c6845053d..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/badRegexp_checker.go +++ /dev/null @@ -1,446 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/constant" - "sort" - "strconv" - "unicode" - "unicode/utf8" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/quasilyte/regex/syntax" -) - -func init() { - var info linter.CheckerInfo - info.Name = "badRegexp" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects suspicious regexp patterns" - info.Before = "regexp.MustCompile(`(?:^aa|bb|cc)foo[aba]`)" - info.After = "regexp.MustCompile(`^(?:aa|bb|cc)foo[ab]`)" - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - opts := &syntax.ParserOptions{} - c := &badRegexpChecker{ - ctx: ctx, - parser: syntax.NewParser(opts), - } - return astwalk.WalkerForExpr(c), nil - }) -} - -type badRegexpChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - parser *syntax.Parser - cause ast.Expr - - flagStates []regexpFlagState - goodAnchors []syntax.Position -} - -type regexpFlagState [utf8.RuneSelf]bool - -func (c *badRegexpChecker) VisitExpr(x ast.Expr) { - call, ok := x.(*ast.CallExpr) - if !ok { - return - } - - switch qualifiedName(call.Fun) { - case "regexp.Compile", "regexp.MustCompile": - cv := c.ctx.TypesInfo.Types[call.Args[0]].Value - if cv == nil || cv.Kind() != constant.String { - return - } - pat := constant.StringVal(cv) - c.cause = call.Args[0] - c.checkPattern(pat) - } -} - -func (c *badRegexpChecker) checkPattern(pat string) { - re, err := c.parser.Parse(pat) - if err != nil { - return - } - - c.flagStates = c.flagStates[:0] - c.goodAnchors = c.goodAnchors[:0] - - // In Go all flags (modifiers) are set to false by default, - // so we start from the empty flag set. - c.flagStates = append(c.flagStates, regexpFlagState{}) - - c.markGoodCarets(re.Expr) - c.walk(re.Expr) -} - -func (c *badRegexpChecker) markGoodCarets(e syntax.Expr) { - canSkip := func(e syntax.Expr) bool { - switch e.Op { - case syntax.OpFlagOnlyGroup: - return true - case syntax.OpGroup: - x := e.Args[0] - return x.Op == syntax.OpConcat && len(x.Args) == 0 - } - return false - } - - if e.Op == syntax.OpConcat && len(e.Args) > 1 { - i := 0 - for i < len(e.Args) && canSkip(e.Args[i]) { - i++ - } - if i < len(e.Args) { - c.markGoodCarets(e.Args[i]) - } - return - } - if e.Op == syntax.OpCaret { - c.addGoodAnchor(e.Pos) - } - for _, a := range e.Args { - c.markGoodCarets(a) - } -} - -func (c *badRegexpChecker) walk(e syntax.Expr) { - switch e.Op { - case syntax.OpAlt: - c.checkAltAnchor(e) - c.checkAltDups(e) - for _, a := range e.Args { - c.walk(a) - } - - case syntax.OpCharClass, syntax.OpNegCharClass: - if c.checkCharClassRanges(e) { - c.checkCharClassDups(e) - } - - case syntax.OpStar, syntax.OpPlus: - c.checkNestedQuantifier(e) - c.walk(e.Args[0]) - - case syntax.OpFlagOnlyGroup: - c.updateFlagState(c.currentFlagState(), e, e.Args[0].Value) - case syntax.OpGroupWithFlags: - // Creates a new context using the current context copy. - // New flags are evaluated inside a new context. - // After nested expressions are processed, previous context is restored. - nflags := len(c.flagStates) - c.flagStates = append(c.flagStates, *c.currentFlagState()) - c.updateFlagState(c.currentFlagState(), e, e.Args[1].Value) - c.walk(e.Args[0]) - c.flagStates = c.flagStates[:nflags] - case syntax.OpGroup, syntax.OpCapture, syntax.OpNamedCapture: - // Like with OpGroupWithFlags, but doesn't evaluate any new flags. - nflags := len(c.flagStates) - c.flagStates = append(c.flagStates, *c.currentFlagState()) - c.walk(e.Args[0]) - c.flagStates = c.flagStates[:nflags] - - case syntax.OpCaret: - if !c.isGoodAnchor(e) { - c.warn("dangling or redundant ^, maybe \\^ is intended?") - } - - default: - for _, a := range e.Args { - c.walk(a) - } - } -} - -func (c *badRegexpChecker) currentFlagState() *regexpFlagState { - return &c.flagStates[len(c.flagStates)-1] -} - -func (c *badRegexpChecker) updateFlagState(state *regexpFlagState, e syntax.Expr, flagString string) { - clearing := false - for i := 0; i < len(flagString); i++ { - ch := flagString[i] - if ch == '-' { - clearing = true - continue - } - if int(ch) >= len(state) { - continue // Should never happen in practice, but we don't want a panic - } - - if clearing { - if !state[ch] { - c.warn("clearing unset flag %c in %s", ch, e.Value) - } - } else { - if state[ch] { - c.warn("redundant flag %c in %s", ch, e.Value) - } - } - state[ch] = !clearing - } -} - -func (c *badRegexpChecker) checkNestedQuantifier(e syntax.Expr) { - x := e.Args[0] - switch x.Op { - case syntax.OpGroup, syntax.OpCapture, syntax.OpGroupWithFlags: - if len(e.Args) == 1 { - x = x.Args[0] - } - } - - switch x.Op { - case syntax.OpPlus, syntax.OpStar: - c.warn("repeated greedy quantifier in %s", e.Value) - } -} - -func (c *badRegexpChecker) checkAltDups(alt syntax.Expr) { - // Seek duplicated alternation expressions. - - set := make(map[string]struct{}, len(alt.Args)) - for _, a := range alt.Args { - if _, ok := set[a.Value]; ok { - c.warn("`%s` is duplicated in %s", a.Value, alt.Value) - } - set[a.Value] = struct{}{} - } -} - -func (c *badRegexpChecker) isCharOrLit(e syntax.Expr) bool { - return e.Op == syntax.OpChar || e.Op == syntax.OpLiteral -} - -func (c *badRegexpChecker) checkAltAnchor(alt syntax.Expr) { - // Seek suspicious anchors. - - // Case 1: an alternation of literals where 1st expr begins with ^ anchor. - first := alt.Args[0] - if first.Op == syntax.OpConcat && len(first.Args) == 2 && first.Args[0].Op == syntax.OpCaret && c.isCharOrLit(first.Args[1]) { - matched := true - for _, a := range alt.Args[1:] { - if !c.isCharOrLit(a) { - matched = false - break - } - } - if matched { - c.warn("^ applied only to `%s` in %s", first.Value[len(`^`):], alt.Value) - } - } - - // Case 2: an alternation of literals where last expr ends with $ anchor. - last := alt.Args[len(alt.Args)-1] - if last.Op == syntax.OpConcat && len(last.Args) == 2 && last.Args[1].Op == syntax.OpDollar && c.isCharOrLit(last.Args[0]) { - matched := true - for _, a := range alt.Args[:len(alt.Args)-1] { - if !c.isCharOrLit(a) { - matched = false - break - } - } - if matched { - c.warn("$ applied only to `%s` in %s", last.Value[:len(last.Value)-len(`$`)], alt.Value) - } - } -} - -func (c *badRegexpChecker) checkCharClassRanges(cc syntax.Expr) bool { - // Seek for suspicious ranges like `!-_`. - // - // We permit numerical ranges (0-9, hex and octal literals) - // and simple ascii letter ranges. - - for _, e := range cc.Args { - if e.Op != syntax.OpCharRange { - continue - } - switch e.Args[0].Op { - case syntax.OpEscapeOctal, syntax.OpEscapeHex: - continue - } - ch := c.charClassBoundRune(e.Args[0]) - if ch == 0 { - return false - } - good := unicode.IsLetter(ch) || (ch >= '0' && ch <= '9') - if !good { - c.warnSloppyCharRange(e.Value, cc.Value) - } - } - - return true -} - -func (c *badRegexpChecker) checkCharClassDups(cc syntax.Expr) { - // Seek for excessive elements inside a character class. - // Report them as intersections. - - if len(cc.Args) == 1 { - return // Can't had duplicates. - } - - type charRange struct { - low rune - high rune - source string - } - ranges := make([]charRange, 0, 8) - addRange := func(source string, low, high rune) { - ranges = append(ranges, charRange{source: source, low: low, high: high}) - } - addRange1 := func(source string, ch rune) { - addRange(source, ch, ch) - } - - // 1. Collect ranges, O(n). - for _, e := range cc.Args { - switch e.Op { - case syntax.OpEscapeOctal: - addRange1(e.Value, c.octalToRune(e)) - case syntax.OpEscapeHex: - addRange1(e.Value, c.hexToRune(e)) - case syntax.OpChar: - addRange1(e.Value, c.stringToRune(e.Value)) - case syntax.OpCharRange: - addRange(e.Value, c.charClassBoundRune(e.Args[0]), c.charClassBoundRune(e.Args[1])) - case syntax.OpEscapeMeta: - addRange1(e.Value, rune(e.Value[1])) - case syntax.OpEscapeChar: - ch := c.stringToRune(e.Value[len(`\`):]) - if unicode.IsPunct(ch) { - addRange1(e.Value, ch) - break - } - switch e.Value { - case `\|`, `\<`, `\>`, `\+`, `\=`: // How to cover all symbols? - addRange1(e.Value, c.stringToRune(e.Value[len(`\`):])) - case `\t`: - addRange1(e.Value, '\t') - case `\n`: - addRange1(e.Value, '\n') - case `\r`: - addRange1(e.Value, '\r') - case `\v`: - addRange1(e.Value, '\v') - case `\d`: - addRange(e.Value, '0', '9') - case `\D`: - addRange(e.Value, 0, '0'-1) - addRange(e.Value, '9'+1, utf8.MaxRune) - case `\s`: - addRange(e.Value, '\t', '\n') // 9-10 - addRange(e.Value, '\f', '\r') // 12-13 - addRange1(e.Value, ' ') // 32 - case `\S`: - addRange(e.Value, 0, '\t'-1) - addRange(e.Value, '\n'+1, '\f'-1) - addRange(e.Value, '\r'+1, ' '-1) - addRange(e.Value, ' '+1, utf8.MaxRune) - case `\w`: - addRange(e.Value, '0', '9') // 48-57 - addRange(e.Value, 'A', 'Z') // 65-90 - addRange1(e.Value, '_') // 95 - addRange(e.Value, 'a', 'z') // 97-122 - case `\W`: - addRange(e.Value, 0, '0'-1) - addRange(e.Value, '9'+1, 'A'-1) - addRange(e.Value, 'Z'+1, '_'-1) - addRange(e.Value, '_'+1, 'a'-1) - addRange(e.Value, 'z'+1, utf8.MaxRune) - default: - // Give up: unknown escape sequence. - return - } - default: - // Give up: unexpected operation inside char class. - return - } - } - - // 2. Sort ranges, O(nlogn). - sort.SliceStable(ranges, func(i, j int) bool { - return ranges[i].low < ranges[j].low - }) - - // 3. Search for duplicates, O(n). - for i := 0; i < len(ranges)-1; i++ { - x := ranges[i+0] - y := ranges[i+1] - if x.high >= y.low { - c.warnCharClassDup(x.source, y.source, cc.Value) - break - } - } -} - -func (c *badRegexpChecker) charClassBoundRune(e syntax.Expr) rune { - switch e.Op { - case syntax.OpChar: - return c.stringToRune(e.Value) - case syntax.OpEscapeHex: - return c.hexToRune(e) - case syntax.OpEscapeOctal: - return c.octalToRune(e) - default: - return 0 - } -} - -func (c *badRegexpChecker) octalToRune(e syntax.Expr) rune { - v, _ := strconv.ParseInt(e.Value[len(`\`):], 8, 32) - return rune(v) -} - -func (c *badRegexpChecker) hexToRune(e syntax.Expr) rune { - var s string - switch e.Form { - case syntax.FormEscapeHexFull: - s = e.Value[len(`\x{`) : len(e.Value)-len(`}`)] - default: - s = e.Value[len(`\x`):] - } - v, _ := strconv.ParseInt(s, 16, 32) - return rune(v) -} - -func (c *badRegexpChecker) stringToRune(s string) rune { - ch, _ := utf8.DecodeRuneInString(s) - return ch -} - -func (c *badRegexpChecker) addGoodAnchor(pos syntax.Position) { - c.goodAnchors = append(c.goodAnchors, pos) -} - -func (c *badRegexpChecker) isGoodAnchor(e syntax.Expr) bool { - for _, pos := range c.goodAnchors { - if e.Pos == pos { - return true - } - } - return false -} - -func (c *badRegexpChecker) warn(format string, args ...interface{}) { - c.ctx.Warn(c.cause, format, args...) -} - -func (c *badRegexpChecker) warnSloppyCharRange(rng, charClass string) { - c.ctx.Warn(c.cause, "suspicious char range `%s` in %s", rng, charClass) -} - -func (c *badRegexpChecker) warnCharClassDup(x, y, charClass string) { - if x == y { - c.ctx.Warn(c.cause, "`%s` is duplicated in %s", x, charClass) - } else { - c.ctx.Warn(c.cause, "`%s` intersects with `%s` in %s", x, y, charClass) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go b/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go deleted file mode 100644 index a1c69cb7ab..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/boolExprSimplify_checker.go +++ /dev/null @@ -1,346 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "strconv" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/astp" - "github.com/go-toolsmith/typep" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "boolExprSimplify" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects bool expressions that can be simplified" - info.Before = ` -a := !(elapsed >= expectElapsedMin) -b := !(x) == !(y)` - info.After = ` -a := elapsed < expectElapsedMin -b := (x) == (y)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&boolExprSimplifyChecker{ctx: ctx}), nil - }) -} - -type boolExprSimplifyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - hasFloats bool -} - -func (c *boolExprSimplifyChecker) VisitExpr(x ast.Expr) { - if !astp.IsBinaryExpr(x) && !astp.IsUnaryExpr(x) { - return - } - - // Throw away non-bool expressions and avoid redundant - // AST copying below. - if typ := c.ctx.TypeOf(x); typ == nil || !typep.HasBoolKind(typ.Underlying()) { - return - } - - // We'll loose all types info after a copy, - // this is why we record valuable info before doing it. - c.hasFloats = lintutil.ContainsNode(x, func(n ast.Node) bool { - if x, ok := n.(*ast.BinaryExpr); ok { - return typep.HasFloatProp(c.ctx.TypeOf(x.X).Underlying()) || - typep.HasFloatProp(c.ctx.TypeOf(x.Y).Underlying()) - } - return false - }) - - y := c.simplifyBool(astcopy.Expr(x)) - if !astequal.Expr(x, y) { - c.warn(x, y) - } -} - -func (c *boolExprSimplifyChecker) simplifyBool(x ast.Expr) ast.Expr { - return astutil.Apply(x, nil, func(cur *astutil.Cursor) bool { - return c.doubleNegation(cur) || - c.negatedEquals(cur) || - c.invertComparison(cur) || - c.combineChecks(cur) || - c.removeIncDec(cur) || - c.foldRanges(cur) || - true - }).(ast.Expr) -} - -func (c *boolExprSimplifyChecker) doubleNegation(cur *astutil.Cursor) bool { - neg1 := astcast.ToUnaryExpr(cur.Node()) - neg2 := astcast.ToUnaryExpr(astutil.Unparen(neg1.X)) - if neg1.Op == token.NOT && neg2.Op == token.NOT { - cur.Replace(astutil.Unparen(neg2.X)) - return true - } - return false -} - -func (c *boolExprSimplifyChecker) negatedEquals(cur *astutil.Cursor) bool { - x, ok := cur.Node().(*ast.BinaryExpr) - if !ok || x.Op != token.EQL { - return false - } - neg1 := astcast.ToUnaryExpr(x.X) - neg2 := astcast.ToUnaryExpr(x.Y) - if neg1.Op == token.NOT && neg2.Op == token.NOT { - x.X = neg1.X - x.Y = neg2.X - return true - } - return false -} - -func (c *boolExprSimplifyChecker) invertComparison(cur *astutil.Cursor) bool { - if c.hasFloats { // See #673 - return false - } - - neg := astcast.ToUnaryExpr(cur.Node()) - cmp := astcast.ToBinaryExpr(astutil.Unparen(neg.X)) - if neg.Op != token.NOT { - return false - } - - // Replace operator to its negated form. - switch cmp.Op { - case token.EQL: - cmp.Op = token.NEQ - case token.NEQ: - cmp.Op = token.EQL - case token.LSS: - cmp.Op = token.GEQ - case token.GTR: - cmp.Op = token.LEQ - case token.LEQ: - cmp.Op = token.GTR - case token.GEQ: - cmp.Op = token.LSS - - default: - return false - } - cur.Replace(cmp) - return true -} - -func (c *boolExprSimplifyChecker) isSafe(x ast.Expr) bool { - return typep.SideEffectFree(c.ctx.TypesInfo, x) -} - -func (c *boolExprSimplifyChecker) combineChecks(cur *astutil.Cursor) bool { - or, ok := cur.Node().(*ast.BinaryExpr) - if !ok || or.Op != token.LOR { - return false - } - - lhs := astcast.ToBinaryExpr(astutil.Unparen(or.X)) - rhs := astcast.ToBinaryExpr(astutil.Unparen(or.Y)) - - if !astequal.Expr(lhs.X, rhs.X) || !astequal.Expr(lhs.Y, rhs.Y) { - return false - } - if !c.isSafe(lhs.X) || !c.isSafe(lhs.Y) { - return false - } - - combTable := [...]struct { - x token.Token - y token.Token - result token.Token - }{ - {token.GTR, token.EQL, token.GEQ}, - {token.EQL, token.GTR, token.GEQ}, - {token.LSS, token.EQL, token.LEQ}, - {token.EQL, token.LSS, token.LEQ}, - } - for _, comb := range &combTable { - if comb.x == lhs.Op && comb.y == rhs.Op { - lhs.Op = comb.result - cur.Replace(lhs) - return true - } - } - return false -} - -func (c *boolExprSimplifyChecker) removeIncDec(cur *astutil.Cursor) bool { - cmp := astcast.ToBinaryExpr(cur.Node()) - - matchOneWay := func(op token.Token, x, y *ast.BinaryExpr) bool { - if x.Op != op || astcast.ToBasicLit(x.Y).Value != "1" { - return false - } - if y.Op == op && astcast.ToBasicLit(y.Y).Value == "1" { - return false - } - return true - } - replace := func(lhsOp, rhsOp, replacement token.Token) bool { - lhs := astcast.ToBinaryExpr(cmp.X) - rhs := astcast.ToBinaryExpr(cmp.Y) - switch { - case matchOneWay(lhsOp, lhs, rhs): - cmp.X = lhs.X - cmp.Op = replacement - cur.Replace(cmp) - return true - case matchOneWay(rhsOp, rhs, lhs): - cmp.Y = rhs.X - cmp.Op = replacement - cur.Replace(cmp) - return true - default: - return false - } - } - - switch cmp.Op { - case token.GTR: - // `x > y-1` => `x >= y` - // `x+1 > y` => `x >= y` - return replace(token.ADD, token.SUB, token.GEQ) - - case token.GEQ: - // `x >= y+1` => `x > y` - // `x-1 >= y` => `x > y` - return replace(token.SUB, token.ADD, token.GTR) - - case token.LSS: - // `x < y+1` => `x <= y` - // `x-1 < y` => `x <= y` - return replace(token.SUB, token.ADD, token.LEQ) - - case token.LEQ: - // `x <= y-1` => `x < y` - // `x+1 <= y` => `x < y` - return replace(token.ADD, token.SUB, token.LSS) - - default: - return false - } -} - -func (c *boolExprSimplifyChecker) foldRanges(cur *astutil.Cursor) bool { - if c.hasFloats { // See #848 - return false - } - - e, ok := cur.Node().(*ast.BinaryExpr) - if !ok { - return false - } - lhs := astcast.ToBinaryExpr(e.X) - rhs := astcast.ToBinaryExpr(e.Y) - if !c.isSafe(lhs.X) || !c.isSafe(rhs.X) { - return false - } - if !astequal.Expr(lhs.X, rhs.X) { - return false - } - - c1, ok := c.int64val(lhs.Y) - if !ok { - return false - } - c2, ok := c.int64val(rhs.Y) - if !ok { - return false - } - - type combination struct { - lhsOp token.Token - rhsOp token.Token - rhsDiff int64 - resDelta int64 - } - match := func(comb *combination) bool { - if lhs.Op != comb.lhsOp || rhs.Op != comb.rhsOp { - return false - } - if c2-c1 != comb.rhsDiff { - return false - } - return true - } - - switch e.Op { - case token.LAND: - combTable := [...]combination{ - // `x > c && x < c+2` => `x == c+1` - {token.GTR, token.LSS, 2, 1}, - // `x >= c && x < c+1` => `x == c` - {token.GEQ, token.LSS, 1, 0}, - // `x > c && x <= c+1` => `x == c+1` - {token.GTR, token.LEQ, 1, 1}, - // `x >= c && x <= c` => `x == c` - {token.GEQ, token.LEQ, 0, 0}, - } - for i := range combTable { - comb := combTable[i] - if match(&comb) { - lhs.Op = token.EQL - v := c1 + comb.resDelta - lhs.Y.(*ast.BasicLit).Value = strconv.FormatInt(v, 10) - cur.Replace(lhs) - return true - } - } - - case token.LOR: - combTable := [...]combination{ - // `x < c || x > c` => `x != c` - {token.LSS, token.GTR, 0, 0}, - // `x <= c || x > c+1` => `x != c+1` - {token.LEQ, token.GTR, 1, 1}, - // `x < c || x >= c+1` => `x != c` - {token.LSS, token.GEQ, 1, 0}, - // `x <= c || x >= c+2` => `x != c+1` - {token.LEQ, token.GEQ, 2, 1}, - } - for i := range combTable { - comb := combTable[i] - if match(&comb) { - lhs.Op = token.NEQ - v := c1 + comb.resDelta - lhs.Y.(*ast.BasicLit).Value = strconv.FormatInt(v, 10) - cur.Replace(lhs) - return true - } - } - } - - return false -} - -func (c *boolExprSimplifyChecker) int64val(x ast.Expr) (int64, bool) { - // TODO(quasilyte): if we had types info, we could use TypesInfo.Types[x].Value, - // but since copying erases leaves us without it, only basic literals are handled. - lit, ok := x.(*ast.BasicLit) - if !ok { - return 0, false - } - v, err := strconv.ParseInt(lit.Value, 10, 64) - if err != nil { - return 0, false - } - return v, true -} - -func (c *boolExprSimplifyChecker) warn(cause, suggestion ast.Expr) { - c.SkipChilds = true - c.ctx.Warn(cause, "can simplify `%s` to `%s`", cause, suggestion) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/builtinShadowDecl_checker.go b/vendor/github.com/go-critic/go-critic/checkers/builtinShadowDecl_checker.go deleted file mode 100644 index d8be10ce9c..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/builtinShadowDecl_checker.go +++ /dev/null @@ -1,63 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "builtinShadowDecl" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects top-level declarations that shadow the predeclared identifiers" - info.Before = `type int struct {}` - info.After = `type myInt struct {}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return &builtinShadowDeclChecker{ctx: ctx}, nil - }) -} - -type builtinShadowDeclChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *builtinShadowDeclChecker) WalkFile(f *ast.File) { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: - // Don't check methods. They can shadow anything safely. - if decl.Recv == nil { - c.checkName(decl.Name) - } - case *ast.GenDecl: - c.visitGenDecl(decl) - } - } -} - -func (c *builtinShadowDeclChecker) visitGenDecl(decl *ast.GenDecl) { - for _, spec := range decl.Specs { - switch spec := spec.(type) { - case *ast.ValueSpec: - for _, name := range spec.Names { - c.checkName(name) - } - case *ast.TypeSpec: - c.checkName(spec.Name) - } - } -} - -func (c *builtinShadowDeclChecker) checkName(name *ast.Ident) { - if isBuiltin(name.Name) { - c.warn(name) - } -} - -func (c *builtinShadowDeclChecker) warn(ident *ast.Ident) { - c.ctx.Warn(ident, "shadowing of predeclared identifier: %s", ident) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go b/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go deleted file mode 100644 index 0b4b7bafb8..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/builtinShadow_checker.go +++ /dev/null @@ -1,36 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "builtinShadow" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag} - info.Summary = "Detects when predeclared identifiers are shadowed in assignments" - info.Before = `len := 10` - info.After = `length := 10` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForLocalDef(&builtinShadowChecker{ctx: ctx}, ctx.TypesInfo), nil - }) -} - -type builtinShadowChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *builtinShadowChecker) VisitLocalDef(name astwalk.Name, _ ast.Expr) { - if isBuiltin(name.ID.Name) { - c.warn(name.ID) - } -} - -func (c *builtinShadowChecker) warn(ident *ast.Ident) { - c.ctx.Warn(ident, "shadowing of predeclared identifier: %s", ident) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go b/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go deleted file mode 100644 index b31a6f7fd3..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/captLocal_checker.go +++ /dev/null @@ -1,49 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "captLocal" - info.Tags = []string{linter.StyleTag} - info.Params = linter.CheckerParams{ - "paramsOnly": { - Value: true, - Usage: "whether to restrict checker to params only", - }, - } - info.Summary = "Detects capitalized names for local variables" - info.Before = `func f(IN int, OUT *int) (ERR error) {}` - info.After = `func f(in int, out *int) (err error) {}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &captLocalChecker{ctx: ctx} - c.paramsOnly = info.Params.Bool("paramsOnly") - return astwalk.WalkerForLocalDef(c, ctx.TypesInfo), nil - }) -} - -type captLocalChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - paramsOnly bool -} - -func (c *captLocalChecker) VisitLocalDef(def astwalk.Name, _ ast.Expr) { - if c.paramsOnly && def.Kind != astwalk.NameParam { - return - } - if ast.IsExported(def.ID.Name) { - c.warn(def.ID) - } -} - -func (c *captLocalChecker) warn(id ast.Node) { - c.ctx.Warn(id, "`%s' should not be capitalized", id) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go deleted file mode 100644 index 306756834b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/caseOrder_checker.go +++ /dev/null @@ -1,88 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "caseOrder" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects erroneous case order inside switch statements" - info.Before = ` -switch x.(type) { -case ast.Expr: - fmt.Println("expr") -case *ast.BasicLit: - fmt.Println("basic lit") // Never executed -}` - info.After = ` -switch x.(type) { -case *ast.BasicLit: - fmt.Println("basic lit") // Now reachable -case ast.Expr: - fmt.Println("expr") -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&caseOrderChecker{ctx: ctx}), nil - }) -} - -type caseOrderChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *caseOrderChecker) VisitStmt(stmt ast.Stmt) { - switch stmt := stmt.(type) { - case *ast.TypeSwitchStmt: - c.checkTypeSwitch(stmt) - case *ast.SwitchStmt: - c.checkSwitch(stmt) - } -} - -func (c *caseOrderChecker) checkTypeSwitch(s *ast.TypeSwitchStmt) { - type ifaceType struct { - node ast.Node - typ *types.Interface - } - var ifaces []ifaceType // Interfaces seen so far - for _, cc := range s.Body.List { - cc := cc.(*ast.CaseClause) - for _, x := range cc.List { - typ := c.ctx.TypeOf(x) - if typ == linter.UnknownType { - c.warnUnknownType(cc, x) - return - } - for _, iface := range ifaces { - if types.Implements(typ, iface.typ) { - c.warnTypeSwitch(cc, x, iface.node) - break - } - } - if iface, ok := typ.Underlying().(*types.Interface); ok { - ifaces = append(ifaces, ifaceType{node: x, typ: iface}) - } - } - } -} - -func (c *caseOrderChecker) warnTypeSwitch(cause, concrete, iface ast.Node) { - c.ctx.Warn(cause, "case %s must go before the %s case", concrete, iface) -} - -func (c *caseOrderChecker) warnUnknownType(cause, concrete ast.Node) { - c.ctx.Warn(cause, "type is not defined %s", concrete) -} - -func (c *caseOrderChecker) checkSwitch(s *ast.SwitchStmt) { - // TODO(quasilyte): can handle expression cases that overlap. - // Cases that have narrower value range should go before wider ones. -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/checkers.go b/vendor/github.com/go-critic/go-critic/checkers/checkers.go deleted file mode 100644 index 5797dafdf4..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/checkers.go +++ /dev/null @@ -1,19 +0,0 @@ -// Package checkers is a gocritic linter main checkers collection. -package checkers - -import ( - "os" - - "github.com/go-critic/go-critic/linter" -) - -var collection = &linter.CheckerCollection{ - URL: "https://github.com/go-critic/go-critic/checkers", -} - -var debug = func() func() bool { - v := os.Getenv("DEBUG") != "" - return func() bool { - return v - } -}() diff --git a/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go b/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go deleted file mode 100644 index 6eeb0bb5db..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/codegenComment_checker.go +++ /dev/null @@ -1,61 +0,0 @@ -package checkers - -import ( - "go/ast" - "regexp" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "codegenComment" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects malformed 'code generated' file comments" - info.Before = `// This file was automatically generated by foogen` - info.After = `// Code generated by foogen. DO NOT EDIT.` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - patterns := []string{ - "this (?:file|code) (?:was|is) auto(?:matically)? generated", - "this (?:file|code) (?:was|is) generated automatically", - "this (?:file|code) (?:was|is) generated by", - "this (?:file|code) (?:was|is) (?:auto(?:matically)? )?generated", - "this (?:file|code) (?:was|is) generated", - "code in this file (?:was|is) auto(?:matically)? generated", - "generated (?:file|code) - do not edit", - // TODO(quasilyte): more of these. - } - re := regexp.MustCompile("(?i)" + strings.Join(patterns, "|")) - return &codegenCommentChecker{ - ctx: ctx, - badCommentRE: re, - }, nil - }) -} - -type codegenCommentChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - badCommentRE *regexp.Regexp -} - -func (c *codegenCommentChecker) WalkFile(f *ast.File) { - if f.Doc == nil { - return - } - - for _, comment := range f.Doc.List { - if c.badCommentRE.MatchString(comment.Text) { - c.warn(comment) - return - } - } -} - -func (c *codegenCommentChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "comment should match `Code generated .* DO NOT EDIT.` regexp") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go deleted file mode 100644 index 5a9564a0f9..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/commentFormatting_checker.go +++ /dev/null @@ -1,119 +0,0 @@ -package checkers - -import ( - "go/ast" - "regexp" - "strings" - "unicode" - "unicode/utf8" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "commentFormatting" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects comments with non-idiomatic formatting" - info.Before = `//This is a comment` - info.After = `// This is a comment` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - regexpPatterns := []*regexp.Regexp{ - regexp.MustCompile(`^//[\w-]+:.*$`), // e.g.: key: value - } - equalPatterns := []string{ - "//nolint", - } - parts := []string{ - "//go:generate ", // e.g.: go:generate value - "//line /", // e.g.: line /path/to/file:123 - "//nolint ", // e.g.: nolint - "//noinspection ", // e.g.: noinspection ALL, some GoLand and friends versions - "//export ", // e.g.: export Foo - "///", // e.g.: vertical breaker ///////////// - "//+", - "//#", - "//-", - "//!", - } - - return astwalk.WalkerForComment(&commentFormattingChecker{ - ctx: ctx, - partPatterns: parts, - equalPatterns: equalPatterns, - regexpPatterns: regexpPatterns, - }), nil - }) -} - -type commentFormattingChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - partPatterns []string - equalPatterns []string - regexpPatterns []*regexp.Regexp -} - -func (c *commentFormattingChecker) VisitComment(cg *ast.CommentGroup) { - if strings.HasPrefix(cg.List[0].Text, "/*") { - return - } - -outerLoop: - for _, comment := range cg.List { - commentLen := len(comment.Text) - if commentLen <= len("// ") { - continue - } - - for _, p := range c.partPatterns { - if commentLen < len(p) { - continue - } - - if strings.EqualFold(comment.Text[:len(p)], p) { - continue outerLoop - } - } - - for _, p := range c.equalPatterns { - if strings.EqualFold(comment.Text, p) { - continue outerLoop - } - } - - for _, p := range c.regexpPatterns { - if p.MatchString(comment.Text) { - continue outerLoop - } - } - - // Make a decision based on a first comment text rune. - r, _ := utf8.DecodeRuneInString(comment.Text[len("//"):]) - if !c.specialChar(r) && !unicode.IsSpace(r) { - c.warn(comment) - return - } - } -} - -func (c *commentFormattingChecker) specialChar(r rune) bool { - // Permitted list to avoid false-positives. - switch r { - case '+', '-', '#', '!': - return true - default: - return false - } -} - -func (c *commentFormattingChecker) warn(comment *ast.Comment) { - c.ctx.WarnFixable(comment, linter.QuickFix{ - From: comment.Pos(), - To: comment.End(), - Replacement: []byte(strings.Replace(comment.Text, "//", "// ", 1)), - }, "put a space between `//` and comment text") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go deleted file mode 100644 index 8595b79515..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/commentedOutCode_checker.go +++ /dev/null @@ -1,167 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/token" - "regexp" - "strings" - "unicode/utf8" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/strparse" -) - -func init() { - var info linter.CheckerInfo - info.Name = "commentedOutCode" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects commented-out code inside function bodies" - info.Params = linter.CheckerParams{ - "minLength": { - Value: 15, - Usage: "min length of the comment that triggers a warning", - }, - } - info.Before = ` -// fmt.Println("Debugging hard") -foo(1, 2)` - info.After = `foo(1, 2)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForLocalComment(&commentedOutCodeChecker{ - ctx: ctx, - notQuiteFuncCall: regexp.MustCompile(`\w+\s+\([^)]*\)\s*$`), - minLength: info.Params.Int("minLength"), - }), nil - }) -} - -type commentedOutCodeChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - fn *ast.FuncDecl - - notQuiteFuncCall *regexp.Regexp - minLength int -} - -func (c *commentedOutCodeChecker) EnterFunc(fn *ast.FuncDecl) bool { - c.fn = fn // Need to store current function inside checker context - return fn.Body != nil -} - -func (c *commentedOutCodeChecker) VisitLocalComment(cg *ast.CommentGroup) { - s := cg.Text() // Collect text once - - // We do multiple heuristics to avoid false positives. - // Many things can be improved here. - - markers := []string{ - "TODO", // TODO comments with code are permitted. - - // "http://" is interpreted as a label with comment. - // There are other protocols we might want to include. - "http://", - "https://", - - "e.g. ", // Clearly not a "selector expr" (mostly due to extra space) - } - for _, m := range markers { - if strings.Contains(s, m) { - return - } - } - - // Some very short comment that can be skipped. - // Usually triggering on these results in false positive. - // Unless there is a very popular call like print/println. - cond := utf8.RuneCountInString(s) < c.minLength && - !strings.Contains(s, "print") && - !strings.Contains(s, "fmt.") && - !strings.Contains(s, "log.") - if cond { - return - } - - // Almost looks like a commented-out function call, - // but there is a whitespace between function name and - // parameters list. Skip these to avoid false positives. - if c.notQuiteFuncCall.MatchString(s) { - return - } - - stmt := strparse.Stmt(s) - - if c.isPermittedStmt(stmt) { - return - } - - if stmt != strparse.BadStmt { - c.warn(cg) - return - } - - // Don't try to parse one-liner as block statement - if len(cg.List) == 1 && !strings.Contains(s, "\n") { - return - } - - // Some attempts to avoid false positives. - if c.skipBlock(s) { - return - } - - // Add braces to make block statement from - // multiple statements. - stmt = strparse.Stmt(fmt.Sprintf("{ %s }", s)) - - if stmt, ok := stmt.(*ast.BlockStmt); ok && len(stmt.List) != 0 { - c.warn(cg) - } -} - -func (c *commentedOutCodeChecker) skipBlock(s string) bool { - lines := strings.Split(s, "\n") // There is at least 1 line, that's invariant - - // Special example test block. - if isExampleTestFunc(c.fn) && strings.Contains(lines[0], "Output:") { - return true - } - - return false -} - -func (c *commentedOutCodeChecker) isPermittedStmt(stmt ast.Stmt) bool { - switch stmt := stmt.(type) { - case *ast.ExprStmt: - return c.isPermittedExpr(stmt.X) - case *ast.LabeledStmt: - return c.isPermittedStmt(stmt.Stmt) - case *ast.DeclStmt: - decl := stmt.Decl.(*ast.GenDecl) - return decl.Tok == token.TYPE - default: - return false - } -} - -func (c *commentedOutCodeChecker) isPermittedExpr(x ast.Expr) bool { - // Permit anything except expressions that can be used - // with complete result discarding. - switch x := x.(type) { - case *ast.CallExpr: - return false - case *ast.UnaryExpr: - // "<-" channel receive is not permitted. - return x.Op != token.ARROW - default: - return true - } -} - -func (c *commentedOutCodeChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "may want to remove commented-out code") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go b/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go deleted file mode 100644 index e0855da812..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/commentedOutImport_checker.go +++ /dev/null @@ -1,76 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "regexp" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "commentedOutImport" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects commented-out imports" - info.Before = ` -import ( - "fmt" - //"os" -)` - info.After = ` -import ( - "fmt" -)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - const pattern = `(?m)^(?://|/\*)?\s*"([a-zA-Z0-9_/]+)"\s*(?:\*/)?$` - return &commentedOutImportChecker{ - ctx: ctx, - importStringRE: regexp.MustCompile(pattern), - }, nil - }) -} - -type commentedOutImportChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - importStringRE *regexp.Regexp -} - -func (c *commentedOutImportChecker) WalkFile(f *ast.File) { - // TODO(quasilyte): handle commented-out import spec, - // for example: // import "errors". - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.GenDecl) - if !ok || decl.Tok != token.IMPORT { - // Import decls can only be in the beginning of the file. - // If we've met some other decl, there will be no more - // import decls. - break - } - - // Find comments inside this import decl span. - for _, cg := range f.Comments { - if cg.Pos() > decl.Rparen { - break // Below the decl, stop. - } - if cg.Pos() < decl.Lparen { - continue // Before the decl, skip. - } - - for _, comment := range cg.List { - for _, m := range c.importStringRE.FindAllStringSubmatch(comment.Text, -1) { - c.warn(comment, m[1]) - } - } - } - } -} - -func (c *commentedOutImportChecker) warn(cause ast.Node, path string) { - c.ctx.Warn(cause, "remove commented-out %q import", path) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go deleted file mode 100644 index cdebaef987..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/defaultCaseOrder_checker.go +++ /dev/null @@ -1,65 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "defaultCaseOrder" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects when default case in switch isn't on 1st or last position" - info.Before = ` -switch { -case x > y: - // ... -default: // <- not the best position - // ... -case x == 10: - // ... -}` - info.After = ` -switch { -case x > y: - // ... -case x == 10: - // ... -default: // <- last case (could also be the first one) - // ... -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&defaultCaseOrderChecker{ctx: ctx}), nil - }) -} - -type defaultCaseOrderChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *defaultCaseOrderChecker) VisitStmt(stmt ast.Stmt) { - swtch, ok := stmt.(*ast.SwitchStmt) - if !ok { - return - } - for i, stmt := range swtch.Body.List { - caseStmt, ok := stmt.(*ast.CaseClause) - if !ok { - continue - } - // is `default` case - if caseStmt.List == nil { - if i != 0 && i != len(swtch.Body.List)-1 { - c.warn(caseStmt) - } - } - } -} - -func (c *defaultCaseOrderChecker) warn(cause *ast.CaseClause) { - c.ctx.Warn(cause, "consider to make `default` case as first or as last case") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/deferInLoop_checker.go b/vendor/github.com/go-critic/go-critic/checkers/deferInLoop_checker.go deleted file mode 100644 index 37c80c864a..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/deferInLoop_checker.go +++ /dev/null @@ -1,70 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "deferInLoop" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects loops inside functions that use defer" - info.Before = ` -for _, filename := range []string{"foo", "bar"} { - f, err := os.Open(filename) - - defer f.Close() -} -` - info.After = ` -func process(filename string) { - f, err := os.Open(filename) - - defer f.Close() -} -/* ... */ -for _, filename := range []string{"foo", "bar"} { - process(filename) -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&deferInLoopChecker{ctx: ctx}), nil - }) -} - -type deferInLoopChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - inFor bool -} - -func (c *deferInLoopChecker) VisitFuncDecl(fn *ast.FuncDecl) { - ast.Inspect(fn.Body, c.traversalFunc) -} - -func (c deferInLoopChecker) traversalFunc(cur ast.Node) bool { - switch n := cur.(type) { - case *ast.DeferStmt: - if c.inFor { - c.warn(n) - } - case *ast.RangeStmt, *ast.ForStmt: - if !c.inFor { - ast.Inspect(cur, deferInLoopChecker{ctx: c.ctx, inFor: true}.traversalFunc) - return false - } - case *ast.FuncLit: - ast.Inspect(n.Body, deferInLoopChecker{ctx: c.ctx, inFor: false}.traversalFunc) - return false - case nil: - return false - } - return true -} - -func (c *deferInLoopChecker) warn(cause *ast.DeferStmt) { - c.ctx.Warn(cause, "Possible resource leak, 'defer' is called in the 'for' loop") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go b/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go deleted file mode 100644 index c61d773da6..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/deprecatedComment_checker.go +++ /dev/null @@ -1,156 +0,0 @@ -package checkers - -import ( - "go/ast" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "deprecatedComment" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects malformed 'deprecated' doc-comments" - info.Before = ` -// deprecated, use FuncNew instead -func FuncOld() int` - info.After = ` -// Deprecated: use FuncNew instead -func FuncOld() int` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &deprecatedCommentChecker{ctx: ctx} - - c.commonPatterns = []string{ - "this type is deprecated", - "this function is deprecated", - "[[deprecated]]", - "note: deprecated", - "deprecated in", - "deprecated. use", - "deprecated! use", - "deprecated use", - // TODO(quasilyte): more of these? - } - - // TODO(quasilyte): may want to generate this list programmatically. - // - // TODO(quasilyte): currently it only handles a single missing letter. - // Might want to handle other kinds of common misspell/typo kinds. - c.commonTypos = []string{ - "Dprecated: ", - "Derecated: ", - "Depecated: ", - "Depekated: ", - "Deprcated: ", - "Depreated: ", - "Deprected: ", - "Deprecaed: ", - "Deprecatd: ", - "Deprecate: ", - "Derpecate: ", - "Derpecated: ", - "Depreacted: ", - } - for i := range c.commonTypos { - c.commonTypos[i] = strings.ToUpper(c.commonTypos[i]) - } - - return astwalk.WalkerForDocComment(c), nil - }) -} - -type deprecatedCommentChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - commonPatterns []string - commonTypos []string -} - -func (c *deprecatedCommentChecker) VisitDocComment(doc *ast.CommentGroup) { - // There are 3 accepted forms of deprecation comments: - // - // 1. inline, that can't be handled with a DocCommentVisitor. - // Note that "Deprecated: " may not even be the comment prefix there. - // Example: "The line number in the input. Deprecated: Kept for compatibility." - // TODO(quasilyte): fix it. - // - // 2. Longer form-1. It's a doc-comment that only contains "deprecation" notice. - // - // 3. Like form-2, but may also include doc-comment text. - // Distinguished by an empty line. - // - // See https://github.com/golang/go/issues/10909#issuecomment-136492606. - // - // It's desirable to see how people make mistakes with the format, - // this is why there is currently no special treatment for these cases. - // TODO(quasilyte): do more audits and grow the negative tests suite. - // - // TODO(quasilyte): there are also multi-line deprecation comments. - - for _, comment := range doc.List { - if strings.HasPrefix(comment.Text, "/*") { - // TODO(quasilyte): handle multi-line doc comments. - continue - } - l := comment.Text[len("//"):] - if len(l) < len("Deprecated: ") { - continue - } - l = strings.TrimSpace(l) - - // Check whether someone messed up with a prefix casing. - upcase := strings.ToUpper(l) - if strings.HasPrefix(upcase, "DEPRECATED: ") && !strings.HasPrefix(l, "Deprecated: ") { - c.warnCasing(comment, l) - return - } - - // Check is someone used comma instead of a colon. - if strings.HasPrefix(l, "Deprecated, ") { - c.warnComma(comment) - return - } - - // Check for other commonly used patterns. - for _, pat := range c.commonPatterns { - if len(l) < len(pat) { - continue - } - - if strings.EqualFold(l[:len(pat)], pat) { - c.warnPattern(comment) - return - } - } - - // Detect some simple typos. - for _, prefixWithTypo := range c.commonTypos { - if strings.HasPrefix(upcase, prefixWithTypo) { - c.warnTypo(comment, l) - return - } - } - } -} - -func (c *deprecatedCommentChecker) warnCasing(cause ast.Node, line string) { - prefix := line[:len("DEPRECATED: ")] - c.ctx.Warn(cause, "use `Deprecated: ` (note the casing) instead of `%s`", prefix) -} - -func (c *deprecatedCommentChecker) warnPattern(cause ast.Node) { - c.ctx.Warn(cause, "the proper format is `Deprecated: `") -} - -func (c *deprecatedCommentChecker) warnComma(cause ast.Node) { - c.ctx.Warn(cause, "use `:` instead of `,` in `Deprecated, `") -} - -func (c *deprecatedCommentChecker) warnTypo(cause ast.Node, line string) { - word := strings.Split(line, ":")[0] - c.ctx.Warn(cause, "typo in `%s`; should be `Deprecated`", word) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go b/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go deleted file mode 100644 index aa23de42c4..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/docStub_checker.go +++ /dev/null @@ -1,95 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "regexp" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "docStub" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects comments that silence go lint complaints about doc-comment" - info.Before = ` -// Foo ... -func Foo() { -}` - info.After = ` -// (A) - remove the doc-comment stub -func Foo() {} -// (B) - replace it with meaningful comment -// Foo is a demonstration-only function. -func Foo() {}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - re := `(?i)^\.\.\.$|^\.$|^xxx\.?$|^whatever\.?$` - c := &docStubChecker{ - ctx: ctx, - stubCommentRE: regexp.MustCompile(re), - } - return c, nil - }) -} - -type docStubChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - stubCommentRE *regexp.Regexp -} - -func (c *docStubChecker) WalkFile(f *ast.File) { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: - c.visitDoc(decl, decl.Name, decl.Doc, false) - case *ast.GenDecl: - if decl.Tok != token.TYPE { - continue - } - if len(decl.Specs) == 1 { - spec := decl.Specs[0].(*ast.TypeSpec) - // Only 1 spec, use doc from the decl itself. - c.visitDoc(spec, spec.Name, decl.Doc, true) - } - // N specs, use per-spec doc. - for _, spec := range decl.Specs { - spec := spec.(*ast.TypeSpec) - c.visitDoc(spec, spec.Name, spec.Doc, true) - } - } - } -} - -func (c *docStubChecker) visitDoc(decl ast.Node, sym *ast.Ident, doc *ast.CommentGroup, article bool) { - if !sym.IsExported() || doc == nil { - return - } - line := strings.TrimSpace(doc.List[0].Text[len("//"):]) - if article { - // Skip optional article. - for _, a := range []string{"The ", "An ", "A "} { - if strings.HasPrefix(line, a) { - line = line[len(a):] - break - } - } - } - if !strings.HasPrefix(line, sym.Name) { - return - } - line = strings.TrimSpace(line[len(sym.Name):]) - // Now try to detect the "stub" part. - if c.stubCommentRE.MatchString(line) { - c.warn(decl) - } -} - -func (c *docStubChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "silencing go lint doc-comment warnings is unadvised") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go deleted file mode 100644 index c4f0183878..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/dupBranchBody_checker.go +++ /dev/null @@ -1,59 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astequal" -) - -func init() { - var info linter.CheckerInfo - info.Name = "dupBranchBody" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects duplicated branch bodies inside conditional statements" - info.Before = ` -if cond { - println("cond=true") -} else { - println("cond=true") -}` - info.After = ` -if cond { - println("cond=true") -} else { - println("cond=false") -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&dupBranchBodyChecker{ctx: ctx}), nil - }) -} - -type dupBranchBodyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *dupBranchBodyChecker) VisitStmt(stmt ast.Stmt) { - // TODO(quasilyte): extend to check switch statements as well. - // Should be very careful with type switches. - - if stmt, ok := stmt.(*ast.IfStmt); ok { - c.checkIf(stmt) - } -} - -func (c *dupBranchBodyChecker) checkIf(stmt *ast.IfStmt) { - thenBody := stmt.Body - elseBody, ok := stmt.Else.(*ast.BlockStmt) - if ok && astequal.Stmt(thenBody, elseBody) { - c.warnIf(stmt) - } -} - -func (c *dupBranchBodyChecker) warnIf(cause ast.Node) { - c.ctx.Warn(cause, "both branches in if statement have same body") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go deleted file mode 100644 index 381bad68b8..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/dupCase_checker.go +++ /dev/null @@ -1,70 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "dupCase" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects duplicated case clauses inside switch or select statements" - info.Before = ` -switch x { -case ys[0], ys[1], ys[2], ys[0], ys[4]: -}` - info.After = ` -switch x { -case ys[0], ys[1], ys[2], ys[3], ys[4]: -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&dupCaseChecker{ctx: ctx}), nil - }) -} - -type dupCaseChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - astSet lintutil.AstSet -} - -func (c *dupCaseChecker) VisitStmt(stmt ast.Stmt) { - switch stmt := stmt.(type) { - case *ast.SwitchStmt: - c.checkSwitch(stmt) - case *ast.SelectStmt: - c.checkSelect(stmt) - } -} - -func (c *dupCaseChecker) checkSwitch(stmt *ast.SwitchStmt) { - c.astSet.Clear() - for i := range stmt.Body.List { - cc := stmt.Body.List[i].(*ast.CaseClause) - for _, x := range cc.List { - if !c.astSet.Insert(x) { - c.warn(x) - } - } - } -} - -func (c *dupCaseChecker) checkSelect(stmt *ast.SelectStmt) { - c.astSet.Clear() - for i := range stmt.Body.List { - x := stmt.Body.List[i].(*ast.CommClause).Comm - if !c.astSet.Insert(x) { - c.warn(x) - } - } -} - -func (c *dupCaseChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "'case %s' is duplicated", cause) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go deleted file mode 100644 index ed674eb85c..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/dupImports_checker.go +++ /dev/null @@ -1,63 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "dupImport" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects multiple imports of the same package under different aliases" - info.Before = ` -import ( - "fmt" - printing "fmt" // Imported the second time -)` - info.After = ` -import( - "fmt" -)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return &dupImportChecker{ctx: ctx}, nil - }) -} - -type dupImportChecker struct { - ctx *linter.CheckerContext -} - -func (c *dupImportChecker) WalkFile(f *ast.File) { - imports := make(map[string][]*ast.ImportSpec) - for _, importDcl := range f.Imports { - pkg := importDcl.Path.Value - imports[pkg] = append(imports[pkg], importDcl) - } - - for _, importList := range imports { - if len(importList) == 1 { - continue - } - c.warn(importList) - } -} - -func (c *dupImportChecker) warn(importList []*ast.ImportSpec) { - msg := fmt.Sprintf("package is imported %d times under different aliases on lines", len(importList)) - for idx, importDcl := range importList { - switch { - case idx == len(importList)-1: - msg += " and" - case idx > 0: - msg += "," - } - msg += fmt.Sprintf(" %d", c.ctx.FileSet.Position(importDcl.Pos()).Line) - } - for _, importDcl := range importList { - c.ctx.Warn(importDcl, msg) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go b/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go deleted file mode 100644 index 9ab75945cd..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/dupSubExpr_checker.go +++ /dev/null @@ -1,103 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "dupSubExpr" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects suspicious duplicated sub-expressions" - info.Before = ` -sort.Slice(xs, func(i, j int) bool { - return xs[i].v < xs[i].v // Duplicated index -})` - info.After = ` -sort.Slice(xs, func(i, j int) bool { - return xs[i].v < xs[j].v -})` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &dupSubExprChecker{ctx: ctx} - - ops := []struct { - op token.Token - float bool // Whether float args require special care - }{ - {op: token.LOR}, // x || x - {op: token.LAND}, // x && x - {op: token.OR}, // x | x - {op: token.AND}, // x & x - {op: token.XOR}, // x ^ x - {op: token.LSS}, // x < x - {op: token.GTR}, // x > x - {op: token.AND_NOT}, // x &^ x - {op: token.REM}, // x % x - - {op: token.EQL, float: true}, // x == x - {op: token.NEQ, float: true}, // x != x - {op: token.LEQ, float: true}, // x <= x - {op: token.GEQ, float: true}, // x >= x - {op: token.QUO, float: true}, // x / x - {op: token.SUB, float: true}, // x - x - } - - c.opSet = make(map[token.Token]bool) - c.floatOpsSet = make(map[token.Token]bool) - for _, opInfo := range ops { - c.opSet[opInfo.op] = true - if opInfo.float { - c.floatOpsSet[opInfo.op] = true - } - } - - return astwalk.WalkerForExpr(c), nil - }) -} - -type dupSubExprChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - // opSet is a set of binary operations that do not make - // sense with duplicated (same) RHS and LHS. - opSet map[token.Token]bool - - floatOpsSet map[token.Token]bool -} - -func (c *dupSubExprChecker) VisitExpr(expr ast.Expr) { - if expr, ok := expr.(*ast.BinaryExpr); ok { - c.checkBinaryExpr(expr) - } -} - -func (c *dupSubExprChecker) checkBinaryExpr(expr *ast.BinaryExpr) { - if !c.opSet[expr.Op] { - return - } - if c.resultIsFloat(expr.X) && c.floatOpsSet[expr.Op] { - return - } - if typep.SideEffectFree(c.ctx.TypesInfo, expr) && c.opSet[expr.Op] && astequal.Expr(expr.X, expr.Y) { - c.warn(expr) - } -} - -func (c *dupSubExprChecker) resultIsFloat(expr ast.Expr) bool { - typ, ok := c.ctx.TypeOf(expr).(*types.Basic) - return ok && typ.Info()&types.IsFloat != 0 -} - -func (c *dupSubExprChecker) warn(cause *ast.BinaryExpr) { - c.ctx.Warn(cause, "suspicious identical LHS and RHS for `%s` operator", cause.Op) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go b/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go deleted file mode 100644 index 857d09fa0e..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/elseif_checker.go +++ /dev/null @@ -1,72 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "elseif" - info.Tags = []string{linter.StyleTag} - info.Params = linter.CheckerParams{ - "skipBalanced": { - Value: true, - Usage: "whether to skip balanced if-else pairs", - }, - } - info.Summary = "Detects else with nested if statement that can be replaced with else-if" - info.Before = ` -if cond1 { -} else { - if x := cond2; x { - } -}` - info.After = ` -if cond1 { -} else if x := cond2; x { -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &elseifChecker{ctx: ctx} - c.skipBalanced = info.Params.Bool("skipBalanced") - return astwalk.WalkerForStmt(c), nil - }) -} - -type elseifChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - skipBalanced bool -} - -func (c *elseifChecker) VisitStmt(stmt ast.Stmt) { - if stmt, ok := stmt.(*ast.IfStmt); ok { - elseBody, ok := stmt.Else.(*ast.BlockStmt) - if !ok || len(elseBody.List) != 1 { - return - } - innerIfStmt, ok := elseBody.List[0].(*ast.IfStmt) - if !ok { - return - } - balanced := len(stmt.Body.List) == 1 && - astp.IsIfStmt(stmt.Body.List[0]) - if balanced && c.skipBalanced { - return // Configured to skip balanced statements - } - if innerIfStmt.Else != nil || innerIfStmt.Init != nil { - return - } - c.warn(stmt.Else) - } -} - -func (c *elseifChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "can replace 'else {if cond {}}' with 'else if cond {}'") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/embedded_rules.go b/vendor/github.com/go-critic/go-critic/checkers/embedded_rules.go deleted file mode 100644 index ad507425e6..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/embedded_rules.go +++ /dev/null @@ -1,108 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/build" - "go/token" - "os" - - "github.com/go-critic/go-critic/checkers/rulesdata" - "github.com/go-critic/go-critic/linter" - - "github.com/quasilyte/go-ruleguard/ruleguard" -) - -//go:generate go run ./rules/precompile.go -rules ./rules/rules.go -o ./rulesdata/rulesdata.go - -func InitEmbeddedRules() error { - filename := "rules/rules.go" - - fset := token.NewFileSet() - var groups []ruleguard.GoRuleGroup - - var buildContext *build.Context - - ruleguardDebug := os.Getenv("GOCRITIC_RULEGUARD_DEBUG") != "" - - // First we create an Engine to parse all rules. - // We need it to get the structured info about our rules - // that will be used to generate checkers. - // We introduce an extra scope in hope that rootEngine - // will be garbage-collected after we don't need it. - // LoadedGroups() returns a slice copy and that's all what we need. - { - rootEngine := ruleguard.NewEngine() - rootEngine.InferBuildContext() - buildContext = rootEngine.BuildContext - - loadContext := &ruleguard.LoadContext{ - Fset: fset, - DebugImports: ruleguardDebug, - DebugPrint: func(s string) { - fmt.Println("debug:", s) - }, - } - if err := rootEngine.LoadFromIR(loadContext, filename, rulesdata.PrecompiledRules); err != nil { - return fmt.Errorf("load embedded ruleguard rules: %w", err) - } - groups = rootEngine.LoadedGroups() - } - - // For every rules group we create a new checker and a separate engine. - // That dedicated ruleguard engine will contain rules only from one group. - for i := range groups { - g := groups[i] - info := &linter.CheckerInfo{ - Name: g.Name, - Summary: g.DocSummary, - Before: g.DocBefore, - After: g.DocAfter, - Note: g.DocNote, - Tags: g.DocTags, - - EmbeddedRuleguard: true, - } - collection.AddChecker(info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - parseContext := &ruleguard.LoadContext{ - Fset: fset, - GroupFilter: func(gr *ruleguard.GoRuleGroup) bool { - return gr.Name == g.Name - }, - DebugImports: ruleguardDebug, - DebugPrint: func(s string) { - fmt.Println("debug:", s) - }, - } - engine := ruleguard.NewEngine() - engine.BuildContext = buildContext - err := engine.LoadFromIR(parseContext, filename, rulesdata.PrecompiledRules) - if err != nil { - return nil, err - } - c := &embeddedRuleguardChecker{ - ctx: ctx, - engine: engine, - } - return c, nil - }) - } - - return nil -} - -type embeddedRuleguardChecker struct { - ctx *linter.CheckerContext - engine *ruleguard.Engine -} - -func (c *embeddedRuleguardChecker) WalkFile(f *ast.File) { - runRuleguardEngine(c.ctx, f, c.engine, &ruleguard.RunContext{ - Pkg: c.ctx.Pkg, - Types: c.ctx.TypesInfo, - Sizes: c.ctx.SizesInfo, - GoVersion: ruleguard.GoVersion(c.ctx.GoVersion), - Fset: c.ctx.FileSet, - TruncateLen: 100, - }) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go b/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go deleted file mode 100644 index a008c61870..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/emptyFallthrough_checker.go +++ /dev/null @@ -1,70 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "emptyFallthrough" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects fallthrough that can be avoided by using multi case values" - info.Before = `switch kind { -case reflect.Int: - fallthrough -case reflect.Int32: - return Int -}` - info.After = `switch kind { -case reflect.Int, reflect.Int32: - return Int -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&emptyFallthroughChecker{ctx: ctx}), nil - }) -} - -type emptyFallthroughChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *emptyFallthroughChecker) VisitStmt(stmt ast.Stmt) { - ss, ok := stmt.(*ast.SwitchStmt) - if !ok { - return - } - - prevCaseDefault := false - for i := len(ss.Body.List) - 1; i >= 0; i-- { - if cc, ok := ss.Body.List[i].(*ast.CaseClause); ok { - warn := false - if len(cc.Body) == 1 { - if bs, ok := cc.Body[0].(*ast.BranchStmt); ok && bs.Tok == token.FALLTHROUGH { - warn = true - if prevCaseDefault { - c.warnDefault(bs) - } else if cc.List != nil { - c.warn(bs) - } - } - } - if !warn { - prevCaseDefault = cc.List == nil - } - } - } -} - -func (c *emptyFallthroughChecker) warnDefault(cause ast.Node) { - c.ctx.Warn(cause, "remove empty case containing only fallthrough to default case") -} - -func (c *emptyFallthroughChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "replace empty case containing only fallthrough with expression list") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go b/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go deleted file mode 100644 index f8c5ae5423..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/evalOrder_checker.go +++ /dev/null @@ -1,88 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "evalOrder" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects unwanted dependencies on the evaluation order" - info.Before = `return x, f(&x)` - info.After = ` -err := f(&x) -return x, err -` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&evalOrderChecker{ctx: ctx}), nil - }) -} - -type evalOrderChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *evalOrderChecker) VisitStmt(stmt ast.Stmt) { - ret := astcast.ToReturnStmt(stmt) - if len(ret.Results) < 2 { - return - } - - // TODO(quasilyte): handle selector expressions like o.val in addition - // to bare identifiers. - addrTake := &ast.UnaryExpr{Op: token.AND} - for _, res := range ret.Results { - id, ok := res.(*ast.Ident) - if !ok { - continue - } - addrTake.X = id // addrTake is &id now - for _, res := range ret.Results { - call, ok := res.(*ast.CallExpr) - if !ok { - continue - } - - // 1. Check if there is a call in form of id.method() where - // method takes id by a pointer. - if sel, ok := call.Fun.(*ast.SelectorExpr); ok { - if astequal.Node(sel.X, id) && c.hasPtrRecv(sel.Sel) { - c.warn(call) - } - } - - // 2. Check that there is no call that uses &id as an argument. - dependency := lintutil.ContainsNode(call, func(n ast.Node) bool { - return astequal.Node(addrTake, n) - }) - if dependency { - c.warn(call) - } - } - } -} - -func (c *evalOrderChecker) hasPtrRecv(fn *ast.Ident) bool { - sig, ok := c.ctx.TypeOf(fn).(*types.Signature) - if !ok { - return false - } - return typep.IsPointer(sig.Recv().Type()) -} - -func (c *evalOrderChecker) warn(call *ast.CallExpr) { - c.ctx.Warn(call, "may want to evaluate %s before the return statement", call) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go b/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go deleted file mode 100644 index 9889f48e8e..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/exitAfterDefer_checker.go +++ /dev/null @@ -1,85 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astfmt" - "github.com/go-toolsmith/astp" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "exitAfterDefer" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects calls to exit/fatal inside functions that use defer" - info.Before = ` -defer os.Remove(filename) -if bad { - log.Fatalf("something bad happened") -}` - info.After = ` -defer os.Remove(filename) -if bad { - log.Printf("something bad happened") - return -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&exitAfterDeferChecker{ctx: ctx}), nil - }) -} - -type exitAfterDeferChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *exitAfterDeferChecker) VisitFuncDecl(fn *ast.FuncDecl) { - // TODO(quasilyte): handle goto and other kinds of flow that break - // the algorithm below that expects the latter statement to be - // executed after the ones that come before it. - - var deferStmt *ast.DeferStmt - pre := func(cur *astutil.Cursor) bool { - // Don't recurse into local anonymous functions. - return !astp.IsFuncLit(cur.Node()) - } - post := func(cur *astutil.Cursor) bool { - switch n := cur.Node().(type) { - case *ast.DeferStmt: - deferStmt = n - case *ast.CallExpr: - // See #995. We allow `defer os.Exit()` calls - // as it's harder to determine whether they're going - // to clutter anything without actually trying to - // simulate the defer stack + understanding the control flow. - // TODO: can we use CFG here? - if _, ok := cur.Parent().(*ast.DeferStmt); ok { - return true - } - if deferStmt != nil { - switch qualifiedName(n.Fun) { - case "log.Fatal", "log.Fatalf", "log.Fatalln", "os.Exit": - c.warn(n, deferStmt) - return false - } - } - } - return true - } - astutil.Apply(fn.Body, pre, post) -} - -func (c *exitAfterDeferChecker) warn(cause *ast.CallExpr, deferStmt *ast.DeferStmt) { - s := astfmt.Sprint(deferStmt) - if fnlit, ok := deferStmt.Call.Fun.(*ast.FuncLit); ok { - // To avoid long and multi-line warning messages, - // collapse the function literals. - s = "defer " + astfmt.Sprint(fnlit.Type) + "{...}(...)" - } - c.ctx.Warn(cause, "%s will exit, and `%s` will not run", cause.Fun, s) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go b/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go deleted file mode 100644 index 17ab0ea83f..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/filepathJoin_checker.go +++ /dev/null @@ -1,51 +0,0 @@ -package checkers - -import ( - "go/ast" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "filepathJoin" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects problems in filepath.Join() function calls" - info.Before = `filepath.Join("dir/", filename)` - info.After = `filepath.Join("dir", filename)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&filepathJoinChecker{ctx: ctx}), nil - }) -} - -type filepathJoinChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *filepathJoinChecker) VisitExpr(expr ast.Expr) { - call := astcast.ToCallExpr(expr) - if qualifiedName(call.Fun) != "filepath.Join" { - return - } - - for _, arg := range call.Args { - arg, ok := arg.(*ast.BasicLit) - if ok && c.hasSeparator(arg) { - c.warnSeparator(arg) - } - } -} - -func (c *filepathJoinChecker) hasSeparator(v *ast.BasicLit) bool { - return strings.ContainsAny(v.Value, `/\`) -} - -func (c *filepathJoinChecker) warnSeparator(sep ast.Expr) { - c.ctx.Warn(sep, "%s contains a path separator", sep) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go b/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go deleted file mode 100644 index 7010668608..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/flagName_checker.go +++ /dev/null @@ -1,89 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/constant" - "go/types" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "flagName" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects suspicious flag names" - info.Before = `b := flag.Bool(" foo ", false, "description")` - info.After = `b := flag.Bool("foo", false, "description")` - info.Note = "https://github.com/golang/go/issues/41792" - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&flagNameChecker{ctx: ctx}), nil - }) -} - -type flagNameChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *flagNameChecker) VisitExpr(expr ast.Expr) { - call := astcast.ToCallExpr(expr) - calledExpr := astcast.ToSelectorExpr(call.Fun) - obj, ok := c.ctx.TypesInfo.ObjectOf(astcast.ToIdent(calledExpr.X)).(*types.PkgName) - if !ok { - return - } - sym := calledExpr.Sel - pkg := obj.Imported() - if pkg.Path() != "flag" { - return - } - - switch sym.Name { - case "Bool", "Duration", "Float64", "String", - "Int", "Int64", "Uint", "Uint64": - c.checkFlagName(call, call.Args[0]) - case "BoolVar", "DurationVar", "Float64Var", "StringVar", - "IntVar", "Int64Var", "UintVar", "Uint64Var": - c.checkFlagName(call, call.Args[1]) - } -} - -func (c *flagNameChecker) checkFlagName(call *ast.CallExpr, arg ast.Expr) { - cv := c.ctx.TypesInfo.Types[arg].Value - if cv == nil { - return // Non-constant name - } - name := constant.StringVal(cv) - switch { - case name == "": - c.warnEmpty(call) - case strings.HasPrefix(name, "-"): - c.warnHyphenPrefix(call, name) - case strings.Contains(name, "="): - c.warnEq(call, name) - case strings.Contains(name, " "): - c.warnWhitespace(call, name) - } -} - -func (c *flagNameChecker) warnEmpty(cause ast.Node) { - c.ctx.Warn(cause, "empty flag name") -} - -func (c *flagNameChecker) warnHyphenPrefix(cause ast.Node, name string) { - c.ctx.Warn(cause, "flag name %q should not start with a hyphen", name) -} - -func (c *flagNameChecker) warnEq(cause ast.Node, name string) { - c.ctx.Warn(cause, "flag name %q should not contain '='", name) -} - -func (c *flagNameChecker) warnWhitespace(cause ast.Node, name string) { - c.ctx.Warn(cause, "flag name %q contains whitespace", name) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go b/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go deleted file mode 100644 index 7301bd325a..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/hexLiteral_checker.go +++ /dev/null @@ -1,61 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "hexLiteral" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects hex literals that have mixed case letter digits" - info.Before = ` -x := 0X12 -y := 0xfF` - info.After = ` -x := 0x12 -// (A) -y := 0xff -// (B) -y := 0xFF` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&hexLiteralChecker{ctx: ctx}), nil - }) -} - -type hexLiteralChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *hexLiteralChecker) warn0X(lit *ast.BasicLit) { - suggest := "0x" + lit.Value[len("0X"):] - c.ctx.Warn(lit, "prefer 0x over 0X, s/%s/%s/", lit.Value, suggest) -} - -func (c *hexLiteralChecker) warnMixedDigits(lit *ast.BasicLit) { - c.ctx.Warn(lit, "don't mix hex literal letter digits casing") -} - -func (c *hexLiteralChecker) VisitExpr(expr ast.Expr) { - lit := astcast.ToBasicLit(expr) - if lit.Kind != token.INT || len(lit.Value) < 3 { - return - } - if strings.HasPrefix(lit.Value, "0X") { - c.warn0X(lit) - return - } - digits := lit.Value[len("0x"):] - if strings.ToLower(digits) != digits && strings.ToUpper(digits) != digits { - c.warnMixedDigits(lit) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go b/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go deleted file mode 100644 index 7b7a3c538b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/hugeParam_checker.go +++ /dev/null @@ -1,83 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "hugeParam" - info.Tags = []string{linter.PerformanceTag} - info.Params = linter.CheckerParams{ - "sizeThreshold": { - Value: 80, - Usage: "size in bytes that makes the warning trigger", - }, - } - info.Summary = "Detects params that incur excessive amount of copying" - info.Before = `func f(x [1024]int) {}` - info.After = `func f(x *[1024]int) {}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&hugeParamChecker{ - ctx: ctx, - sizeThreshold: int64(info.Params.Int("sizeThreshold")), - }), nil - }) -} - -type hugeParamChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - sizeThreshold int64 -} - -func (c *hugeParamChecker) VisitFuncDecl(decl *ast.FuncDecl) { - // TODO(quasilyte): maybe it's worthwhile to permit skipping - // test files for this checker? - if c.isImplementStringer(decl) { - return - } - - if decl.Recv != nil { - c.checkParams(decl.Recv.List) - } - c.checkParams(decl.Type.Params.List) -} - -// isImplementStringer check method signature is: String() string. -func (*hugeParamChecker) isImplementStringer(decl *ast.FuncDecl) bool { - if decl.Recv != nil && - decl.Name.Name == "String" && - decl.Type != nil && - len(decl.Type.Params.List) == 0 && - len(decl.Type.Results.List) == 1 && - astcast.ToIdent(decl.Type.Results.List[0].Type).Name == "string" { - return true - } - - return false -} - -func (c *hugeParamChecker) checkParams(params []*ast.Field) { - for _, p := range params { - for _, id := range p.Names { - typ := c.ctx.TypeOf(id) - size, ok := c.ctx.SizeOf(typ) - if ok && size >= c.sizeThreshold { - c.warn(id, size) - } - } - } -} - -func (c *hugeParamChecker) warn(cause *ast.Ident, size int64) { - c.ctx.Warn(cause, "%s is heavy (%d bytes); consider passing it by pointer", - cause, size) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go deleted file mode 100644 index e73c609d5c..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/ifElseChain_checker.go +++ /dev/null @@ -1,110 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "ifElseChain" - info.Tags = []string{linter.StyleTag} - info.Params = linter.CheckerParams{ - "minThreshold": { - Value: 2, - Usage: "min number of if-else blocks that makes the warning trigger", - }, - } - info.Summary = "Detects repeated if-else statements and suggests to replace them with switch statement" - info.Before = ` -if cond1 { - // Code A. -} else if cond2 { - // Code B. -} else { - // Code C. -}` - info.After = ` -switch { -case cond1: - // Code A. -case cond2: - // Code B. -default: - // Code C. -}` - info.Note = ` -Permits single else or else-if; repeated else-if or else + else-if -will trigger suggestion to use switch statement. -See [EffectiveGo#switch](https://golang.org/doc/effective_go.html#switch).` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&ifElseChainChecker{ - ctx: ctx, - minThreshold: info.Params.Int("minThreshold"), - }), nil - }) -} - -type ifElseChainChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - cause *ast.IfStmt - visited map[*ast.IfStmt]bool - - minThreshold int -} - -func (c *ifElseChainChecker) EnterFunc(fn *ast.FuncDecl) bool { - if fn.Body == nil { - return false - } - c.visited = make(map[*ast.IfStmt]bool) - return true -} - -func (c *ifElseChainChecker) VisitStmt(stmt ast.Stmt) { - if stmt, ok := stmt.(*ast.IfStmt); ok { - if c.visited[stmt] { - return - } - c.cause = stmt - c.checkIfStmt(stmt) - } -} - -func (c *ifElseChainChecker) checkIfStmt(stmt *ast.IfStmt) { - if c.countIfelseLen(stmt) >= c.minThreshold { - c.warn() - } -} - -func (c *ifElseChainChecker) countIfelseLen(stmt *ast.IfStmt) int { - count := 0 - for { - if stmt.Init != nil { - return 0 // Give up - } - - switch e := stmt.Else.(type) { - case *ast.IfStmt: - // Else if. - stmt = e - count++ - c.visited[e] = true - case *ast.BlockStmt: - // Else branch. - return count + 1 - default: - // No else or else if. - return count - } - } -} - -func (c *ifElseChainChecker) warn() { - c.ctx.Warn(c.cause, "rewrite if-else to switch statement") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go b/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go deleted file mode 100644 index b690487b7b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/importShadow_checker.go +++ /dev/null @@ -1,47 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "importShadow" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag} - info.Summary = "Detects when imported package names shadowed in the assignments" - info.Before = ` -// "path/filepath" is imported. -filepath := "foo.txt"` - info.After = ` -filename := "foo.txt"` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - ctx.Require.PkgObjects = true - return astwalk.WalkerForLocalDef(&importShadowChecker{ctx: ctx}, ctx.TypesInfo), nil - }) -} - -type importShadowChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *importShadowChecker) VisitLocalDef(def astwalk.Name, _ ast.Expr) { - for pkgObj, name := range c.ctx.PkgObjects { - if name == def.ID.Name && name != "_" { - c.warn(def.ID, name, pkgObj.Imported()) - } - } -} - -func (c *importShadowChecker) warn(id ast.Node, importedName string, pkg *types.Package) { - if isStdlibPkg(pkg) { - c.ctx.Warn(id, "shadow of imported package '%s'", importedName) - } else { - c.ctx.Warn(id, "shadow of imported from '%s' package '%s'", pkg.Path(), importedName) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go b/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go deleted file mode 100644 index 8612717b27..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/initClause_checker.go +++ /dev/null @@ -1,57 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "initClause" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Summary = "Detects non-assignment statements inside if/switch init clause" - info.Before = `if sideEffect(); cond { -}` - info.After = `sideEffect() -if cond { -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&initClauseChecker{ctx: ctx}), nil - }) -} - -type initClauseChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *initClauseChecker) VisitStmt(stmt ast.Stmt) { - initClause := c.getInitClause(stmt) - if initClause != nil && !astp.IsAssignStmt(initClause) { - c.warn(stmt, initClause) - } -} - -func (c *initClauseChecker) getInitClause(x ast.Stmt) ast.Stmt { - switch x := x.(type) { - case *ast.IfStmt: - return x.Init - case *ast.SwitchStmt: - return x.Init - default: - return nil - } -} - -func (c *initClauseChecker) warn(stmt, clause ast.Stmt) { - name := "if" - if astp.IsSwitchStmt(stmt) { - name = "switch" - } - c.ctx.Warn(stmt, "consider to move `%s` before %s", clause, name) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go deleted file mode 100644 index 6c60e3fede..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/comment_walker.go +++ /dev/null @@ -1,41 +0,0 @@ -package astwalk - -import ( - "go/ast" - "strings" -) - -type commentWalker struct { - visitor CommentVisitor -} - -func (w *commentWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, cg := range f.Comments { - visitCommentGroups(cg, w.visitor.VisitComment) - } -} - -func visitCommentGroups(cg *ast.CommentGroup, visit func(*ast.CommentGroup)) { - var group []*ast.Comment - visitGroup := func(list []*ast.Comment) { - if len(list) == 0 { - return - } - cg := &ast.CommentGroup{List: list} - visit(cg) - } - for _, comment := range cg.List { - if strings.HasPrefix(comment.Text, "/*") { - visitGroup(group) - group = group[:0] - visitGroup([]*ast.Comment{comment}) - } else { - group = append(group, comment) - } - } - visitGroup(group) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go deleted file mode 100644 index 39b5365083..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/doc_comment_walker.go +++ /dev/null @@ -1,48 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type docCommentWalker struct { - visitor DocCommentVisitor -} - -func (w *docCommentWalker) WalkFile(f *ast.File) { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: - if decl.Doc != nil { - w.visitor.VisitDocComment(decl.Doc) - } - case *ast.GenDecl: - if decl.Doc != nil { - w.visitor.VisitDocComment(decl.Doc) - } - for _, spec := range decl.Specs { - switch spec := spec.(type) { - case *ast.ImportSpec: - if spec.Doc != nil { - w.visitor.VisitDocComment(spec.Doc) - } - case *ast.ValueSpec: - if spec.Doc != nil { - w.visitor.VisitDocComment(spec.Doc) - } - case *ast.TypeSpec: - if spec.Doc != nil { - w.visitor.VisitDocComment(spec.Doc) - } - ast.Inspect(spec.Type, func(n ast.Node) bool { - if n, ok := n.(*ast.Field); ok { - if n.Doc != nil { - w.visitor.VisitDocComment(n.Doc) - } - } - return true - }) - } - } - } - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go deleted file mode 100644 index de66c1081b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/expr_walker.go +++ /dev/null @@ -1,31 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type exprWalker struct { - visitor ExprVisitor -} - -func (w *exprWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - if decl, ok := decl.(*ast.FuncDecl); ok { - if !w.visitor.EnterFunc(decl) { - continue - } - } - - ast.Inspect(decl, func(x ast.Node) bool { - if x, ok := x.(ast.Expr); ok { - w.visitor.VisitExpr(x) - return !w.visitor.skipChilds() - } - return true - }) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go deleted file mode 100644 index c7e3a4371e..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/func_decl_walker.go +++ /dev/null @@ -1,23 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type funcDeclWalker struct { - visitor FuncDeclVisitor -} - -func (w *funcDeclWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - w.visitor.VisitFuncDecl(decl) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go deleted file mode 100644 index e042f0d5ef..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_comment_walker.go +++ /dev/null @@ -1,32 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type localCommentWalker struct { - visitor LocalCommentVisitor -} - -func (w *localCommentWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - - for _, cg := range f.Comments { - // Not sure that decls/comments are sorted - // by positions, so do a naive full scan for now. - if cg.Pos() < decl.Pos() || cg.Pos() > decl.End() { - continue - } - - visitCommentGroups(cg, w.visitor.VisitLocalComment) - } - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go deleted file mode 100644 index 0c9c14955e..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_visitor.go +++ /dev/null @@ -1,49 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -// LocalDefVisitor visits every name definitions inside a function. -// -// Next elements are considered as name definitions: -// - Function parameters (input, output, receiver) -// - Every LHS of ":=" assignment that defines a new name -// - Every local var/const declaration. -// -// NOTE: this visitor is experimental. -// This is also why it lives in a separate file. -type LocalDefVisitor interface { - walkerEvents - VisitLocalDef(Name, ast.Expr) -} - -// NameKind describes what kind of name Name object holds. -type NameKind int - -// Name holds ver/const/param definition symbol info. -type Name struct { - ID *ast.Ident - Kind NameKind - - // Index is NameVar-specific field that is used to - // specify nth tuple element being assigned to the name. - Index int -} - -// NOTE: set of name kinds is not stable and may change over time. -// -// TODO(quasilyte): is NameRecv/NameParam/NameResult granularity desired? -// TODO(quasilyte): is NameVar/NameBind (var vs :=) granularity desired? -const ( - // NameParam is function/method receiver/input/output name. - // Initializing expression is always nil. - NameParam NameKind = iota - // NameVar is var or ":=" declared name. - // Initializing expression may be nil for var-declared names - // without explicit initializing expression. - NameVar - // NameConst is const-declared name. - // Initializing expression is never nil. - NameConst -) diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go deleted file mode 100644 index f6808cbb49..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_def_walker.go +++ /dev/null @@ -1,118 +0,0 @@ -package astwalk - -import ( - "go/ast" - "go/token" - "go/types" -) - -type localDefWalker struct { - visitor LocalDefVisitor - info *types.Info -} - -func (w *localDefWalker) WalkFile(f *ast.File) { - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - w.walkFunc(decl) - } -} - -func (w *localDefWalker) walkFunc(decl *ast.FuncDecl) { - w.walkSignature(decl) - w.walkFuncBody(decl) -} - -func (w *localDefWalker) walkFuncBody(decl *ast.FuncDecl) { - ast.Inspect(decl.Body, func(x ast.Node) bool { - switch x := x.(type) { - case *ast.AssignStmt: - if x.Tok != token.DEFINE { - return false - } - if len(x.Lhs) != len(x.Rhs) { - // Multi-value assignment. - // Invariant: there is only 1 RHS. - for i, lhs := range x.Lhs { - id, ok := lhs.(*ast.Ident) - if !ok || w.info.Defs[id] == nil { - continue - } - def := Name{ID: id, Kind: NameVar, Index: i} - w.visitor.VisitLocalDef(def, x.Rhs[0]) - } - } else { - // Simple 1-1 assignments. - for i, lhs := range x.Lhs { - id, ok := lhs.(*ast.Ident) - if !ok || w.info.Defs[id] == nil { - continue - } - def := Name{ID: id, Kind: NameVar} - w.visitor.VisitLocalDef(def, x.Rhs[i]) - } - } - return false - - case *ast.GenDecl: - // Decls always introduce new names. - for _, spec := range x.Specs { - spec, ok := spec.(*ast.ValueSpec) - if !ok { // Ignore type/import specs - return false - } - switch { - case len(spec.Values) == 0: - // var-specific decls without explicit init. - for _, id := range spec.Names { - def := Name{ID: id, Kind: NameVar} - w.visitor.VisitLocalDef(def, nil) - } - case len(spec.Names) != len(spec.Values): - // var-specific decls that assign tuple results. - for i, id := range spec.Names { - def := Name{ID: id, Kind: NameVar, Index: i} - w.visitor.VisitLocalDef(def, spec.Values[0]) - } - default: - // Can be either var or const decl. - kind := NameVar - if x.Tok == token.CONST { - kind = NameConst - } - for i, id := range spec.Names { - def := Name{ID: id, Kind: kind} - w.visitor.VisitLocalDef(def, spec.Values[i]) - } - } - } - return false - } - - return true - }) -} - -func (w *localDefWalker) walkSignature(decl *ast.FuncDecl) { - for _, p := range decl.Type.Params.List { - for _, id := range p.Names { - def := Name{ID: id, Kind: NameParam} - w.visitor.VisitLocalDef(def, nil) - } - } - if decl.Type.Results != nil { - for _, p := range decl.Type.Results.List { - for _, id := range p.Names { - def := Name{ID: id, Kind: NameParam} - w.visitor.VisitLocalDef(def, nil) - } - } - } - if decl.Recv != nil && len(decl.Recv.List[0].Names) != 0 { - def := Name{ID: decl.Recv.List[0].Names[0], Kind: NameParam} - w.visitor.VisitLocalDef(def, nil) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go deleted file mode 100644 index e455b3f8b6..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/local_expr_walker.go +++ /dev/null @@ -1,29 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type localExprWalker struct { - visitor LocalExprVisitor -} - -func (w *localExprWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - ast.Inspect(decl.Body, func(x ast.Node) bool { - if x, ok := x.(ast.Expr); ok { - w.visitor.VisitLocalExpr(x) - return !w.visitor.skipChilds() - } - return true - }) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go deleted file mode 100644 index 403292f669..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_list_walker.go +++ /dev/null @@ -1,33 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type stmtListWalker struct { - visitor StmtListVisitor -} - -func (w *stmtListWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - ast.Inspect(decl.Body, func(x ast.Node) bool { - switch x := x.(type) { - case *ast.BlockStmt: - w.visitor.VisitStmtList(x, x.List) - case *ast.CaseClause: - w.visitor.VisitStmtList(x, x.Body) - case *ast.CommClause: - w.visitor.VisitStmtList(x, x.Body) - } - return !w.visitor.skipChilds() - }) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go deleted file mode 100644 index 912de867dd..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/stmt_walker.go +++ /dev/null @@ -1,29 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -type stmtWalker struct { - visitor StmtVisitor -} - -func (w *stmtWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - decl, ok := decl.(*ast.FuncDecl) - if !ok || !w.visitor.EnterFunc(decl) { - continue - } - ast.Inspect(decl.Body, func(x ast.Node) bool { - if x, ok := x.(ast.Stmt); ok { - w.visitor.VisitStmt(x) - return !w.visitor.skipChilds() - } - return true - }) - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go deleted file mode 100644 index bc9bdef47b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/type_expr_walker.go +++ /dev/null @@ -1,119 +0,0 @@ -package astwalk - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-toolsmith/astp" - "github.com/go-toolsmith/typep" -) - -type typeExprWalker struct { - visitor TypeExprVisitor - info *types.Info -} - -func (w *typeExprWalker) WalkFile(f *ast.File) { - if !w.visitor.EnterFile(f) { - return - } - - for _, decl := range f.Decls { - if decl, ok := decl.(*ast.FuncDecl); ok { - if !w.visitor.EnterFunc(decl) { - continue - } - } - switch decl := decl.(type) { - case *ast.FuncDecl: - if !w.visitor.EnterFunc(decl) { - continue - } - w.walkSignature(decl.Type) - ast.Inspect(decl.Body, w.walk) - case *ast.GenDecl: - if decl.Tok == token.IMPORT { - continue - } - ast.Inspect(decl, w.walk) - } - } -} - -func (w *typeExprWalker) visit(x ast.Expr) bool { - w.visitor.VisitTypeExpr(x) - return !w.visitor.skipChilds() -} - -func (w *typeExprWalker) walk(x ast.Node) bool { - switch x := x.(type) { - case *ast.ChanType: - return w.visit(x) - case *ast.ParenExpr: - if typep.IsTypeExpr(w.info, x.X) { - return w.visit(x) - } - return true - case *ast.CallExpr: - // Pointer conversions require parenthesis around pointer type. - // These casts are represented as call expressions. - // Because it's impossible for the visitor to distinguish such - // "required" parenthesis, walker skips outmost parenthesis in such cases. - return w.inspectInner(x.Fun) - case *ast.SelectorExpr: - // Like with conversions, method expressions are another special. - return w.inspectInner(x.X) - case *ast.StarExpr: - if typep.IsTypeExpr(w.info, x.X) { - return w.visit(x) - } - return true - case *ast.MapType: - return w.visit(x) - case *ast.FuncType: - return w.visit(x) - case *ast.StructType: - return w.visit(x) - case *ast.InterfaceType: - if !w.visit(x) { - return false - } - for _, method := range x.Methods.List { - switch x := method.Type.(type) { - case *ast.FuncType: - w.walkSignature(x) - default: - // Embedded interface. - w.walk(x) - } - } - return false - case *ast.ArrayType: - return w.visit(x) - } - return true -} - -func (w *typeExprWalker) inspectInner(x ast.Expr) bool { - parens, ok := x.(*ast.ParenExpr) - shouldInspect := ok && - typep.IsTypeExpr(w.info, parens.X) && - (astp.IsStarExpr(parens.X) || astp.IsFuncType(parens.X)) - if shouldInspect { - ast.Inspect(parens.X, w.walk) - return false - } - return true -} - -func (w *typeExprWalker) walkSignature(typ *ast.FuncType) { - for _, p := range typ.Params.List { - ast.Inspect(p.Type, w.walk) - } - if typ.Results != nil { - for _, p := range typ.Results.List { - ast.Inspect(p.Type, w.walk) - } - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go deleted file mode 100644 index 3486a8e622..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/visitor.go +++ /dev/null @@ -1,77 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -// DocCommentVisitor visits every doc-comment. -// Does not visit doc-comments for function-local definitions (types, etc). -// Also does not visit package doc-comment (file-level doc-comments). -type DocCommentVisitor interface { - VisitDocComment(*ast.CommentGroup) -} - -// FuncDeclVisitor visits every top-level function declaration. -type FuncDeclVisitor interface { - walkerEvents - VisitFuncDecl(*ast.FuncDecl) -} - -// ExprVisitor visits every expression inside AST file. -type ExprVisitor interface { - walkerEvents - VisitExpr(ast.Expr) -} - -// LocalExprVisitor visits every expression inside function body. -type LocalExprVisitor interface { - walkerEvents - VisitLocalExpr(ast.Expr) -} - -// StmtListVisitor visits every statement list inside function body. -// This includes block statement bodies as well as implicit blocks -// introduced by case clauses and alike. -type StmtListVisitor interface { - walkerEvents - VisitStmtList(ast.Node, []ast.Stmt) -} - -// StmtVisitor visits every statement inside function body. -type StmtVisitor interface { - walkerEvents - VisitStmt(ast.Stmt) -} - -// TypeExprVisitor visits every type describing expression. -// It also traverses struct types and interface types to run -// checker over their fields/method signatures. -type TypeExprVisitor interface { - walkerEvents - VisitTypeExpr(ast.Expr) -} - -// LocalCommentVisitor visits every comment inside function body. -type LocalCommentVisitor interface { - walkerEvents - VisitLocalComment(*ast.CommentGroup) -} - -// CommentVisitor visits every comment. -type CommentVisitor interface { - walkerEvents - VisitComment(*ast.CommentGroup) -} - -// walkerEvents describes common hooks available for most visitor types. -type walkerEvents interface { - // EnterFile is called for every file that is about to be traversed. - // If false is returned, file is not visited. - EnterFile(*ast.File) bool - - // EnterFunc is called for every function declaration that is about - // to be traversed. If false is returned, function is not visited. - EnterFunc(*ast.FuncDecl) bool - - skipChilds() bool -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go deleted file mode 100644 index 1f6e948d5c..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walk_handler.go +++ /dev/null @@ -1,34 +0,0 @@ -package astwalk - -import ( - "go/ast" -) - -// WalkHandler is a type to be embedded into every checker -// that uses astwalk walkers. -type WalkHandler struct { - // SkipChilds controls whether currently analyzed - // node childs should be traversed. - // - // Value is reset after each visitor invocation, - // so there is no need to set value back to false. - SkipChilds bool -} - -// EnterFile is a default walkerEvents.EnterFile implementation -// that reports every file as accepted candidate for checking. -func (w *WalkHandler) EnterFile(f *ast.File) bool { - return true -} - -// EnterFunc is a default walkerEvents.EnterFunc implementation -// that skips extern function (ones that do not have body). -func (w *WalkHandler) EnterFunc(decl *ast.FuncDecl) bool { - return decl.Body != nil -} - -func (w *WalkHandler) skipChilds() bool { - v := w.SkipChilds - w.SkipChilds = false - return v -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go b/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go deleted file mode 100644 index f838a64c15..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/astwalk/walker.go +++ /dev/null @@ -1,57 +0,0 @@ -package astwalk - -import ( - "go/types" - - "github.com/go-critic/go-critic/linter" -) - -// WalkerForFuncDecl returns file walker implementation for FuncDeclVisitor. -func WalkerForFuncDecl(v FuncDeclVisitor) linter.FileWalker { - return &funcDeclWalker{visitor: v} -} - -// WalkerForExpr returns file walker implementation for ExprVisitor. -func WalkerForExpr(v ExprVisitor) linter.FileWalker { - return &exprWalker{visitor: v} -} - -// WalkerForLocalExpr returns file walker implementation for LocalExprVisitor. -func WalkerForLocalExpr(v LocalExprVisitor) linter.FileWalker { - return &localExprWalker{visitor: v} -} - -// WalkerForStmtList returns file walker implementation for StmtListVisitor. -func WalkerForStmtList(v StmtListVisitor) linter.FileWalker { - return &stmtListWalker{visitor: v} -} - -// WalkerForStmt returns file walker implementation for StmtVisitor. -func WalkerForStmt(v StmtVisitor) linter.FileWalker { - return &stmtWalker{visitor: v} -} - -// WalkerForTypeExpr returns file walker implementation for TypeExprVisitor. -func WalkerForTypeExpr(v TypeExprVisitor, info *types.Info) linter.FileWalker { - return &typeExprWalker{visitor: v, info: info} -} - -// WalkerForLocalComment returns file walker implementation for LocalCommentVisitor. -func WalkerForLocalComment(v LocalCommentVisitor) linter.FileWalker { - return &localCommentWalker{visitor: v} -} - -// WalkerForComment returns file walker implementation for CommentVisitor. -func WalkerForComment(v CommentVisitor) linter.FileWalker { - return &commentWalker{visitor: v} -} - -// WalkerForDocComment returns file walker implementation for DocCommentVisitor. -func WalkerForDocComment(v DocCommentVisitor) linter.FileWalker { - return &docCommentWalker{visitor: v} -} - -// WalkerForLocalDef returns file walker implementation for LocalDefVisitor. -func WalkerForLocalDef(v LocalDefVisitor, info *types.Info) linter.FileWalker { - return &localDefWalker{visitor: v, info: info} -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astfind.go b/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astfind.go deleted file mode 100644 index a6d0ad7c45..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astfind.go +++ /dev/null @@ -1,41 +0,0 @@ -package lintutil - -import ( - "go/ast" - - "golang.org/x/tools/go/ast/astutil" -) - -// FindNode applies pred for root and all it's childs until it returns true. -// If followFunc is defined, it's called before following any node to check whether it needs to be followed. -// followFunc has to return true in order to continuing traversing the node and return false otherwise. -// Matched node is returned. -// If none of the nodes matched predicate, nil is returned. -func FindNode(root ast.Node, followFunc, pred func(ast.Node) bool) ast.Node { - var ( - found ast.Node - preFunc func(*astutil.Cursor) bool - ) - - if followFunc != nil { - preFunc = func(cur *astutil.Cursor) bool { - return followFunc(cur.Node()) - } - } - - astutil.Apply(root, - preFunc, - func(cur *astutil.Cursor) bool { - if pred(cur.Node()) { - found = cur.Node() - return false - } - return true - }) - return found -} - -// ContainsNode reports whether `FindNode(root, pred)!=nil`. -func ContainsNode(root ast.Node, pred func(ast.Node) bool) bool { - return FindNode(root, nil, pred) != nil -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astflow.go b/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astflow.go deleted file mode 100644 index f64907d69b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astflow.go +++ /dev/null @@ -1,86 +0,0 @@ -package lintutil - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/astp" - "github.com/go-toolsmith/typep" -) - -// Different utilities to make simple analysis over typed ast values flow. -// -// It's primitive and can't replace SSA, but the bright side is that -// it does not require building an additional IR eagerly. -// Expected to be used sparingly inside a few checkers. -// -// If proven really useful, can be moved to go-toolsmith library. - -// IsImmutable reports whether n can be modified through any operation. -func IsImmutable(info *types.Info, n ast.Expr) bool { - if astp.IsBasicLit(n) { - return true - } - tv, ok := info.Types[n] - return ok && !tv.Assignable() && !tv.Addressable() -} - -// CouldBeMutated reports whether dst can be modified inside body. -// -// Note that it does not take already existing pointers to dst. -// An example of safe and correct usage is checking of something -// that was just defined, so the dst is a result of that definition. -func CouldBeMutated(info *types.Info, body ast.Node, dst ast.Expr) bool { - if IsImmutable(info, dst) { // Fast path. - return false - } - - // We don't track pass-by-value. - // If it's already a pointer, passing it by value - // means that there can be a potential indirect modification. - // - // It's possible to be less conservative here and find at least - // one such value pass before giving up. - if typep.IsPointer(info.TypeOf(dst)) { - return true - } - - var isDst func(x ast.Expr) bool - if dst, ok := dst.(*ast.Ident); ok { - // Identifier can be shadowed, - // so we need to check the object as well. - obj := info.ObjectOf(dst) - if obj == nil { - return true // Being conservative - } - isDst = func(x ast.Expr) bool { - id, ok := x.(*ast.Ident) - return ok && id.Name == dst.Name && info.ObjectOf(id) == obj - } - } else { - isDst = func(x ast.Expr) bool { - return astequal.Expr(dst, x) - } - } - - return ContainsNode(body, func(n ast.Node) bool { - switch n := n.(type) { - case *ast.UnaryExpr: - if n.Op == token.AND && isDst(n.X) { - return true // Address taken - } - case *ast.AssignStmt: - for _, lhs := range n.Lhs { - if isDst(lhs) { - return true - } - } - case *ast.IncDecStmt: - // Incremented or decremented. - return isDst(n.X) - } - return false - }) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astset.go b/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astset.go deleted file mode 100644 index ebe7835e51..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/astset.go +++ /dev/null @@ -1,44 +0,0 @@ -package lintutil - -import ( - "go/ast" - - "github.com/go-toolsmith/astequal" -) - -// AstSet is a simple ast.Node set. -// Zero value is ready to use set. -// Can be reused after Clear call. -type AstSet struct { - items []ast.Node -} - -// Contains reports whether s contains x. -func (s *AstSet) Contains(x ast.Node) bool { - for i := range s.items { - if astequal.Node(s.items[i], x) { - return true - } - } - return false -} - -// Insert pushes x in s if it's not already there. -// Returns true if element was inserted. -func (s *AstSet) Insert(x ast.Node) bool { - if s.Contains(x) { - return false - } - s.items = append(s.items, x) - return true -} - -// Clear removes all element from set. -func (s *AstSet) Clear() { - s.items = s.items[:0] -} - -// Len returns the number of elements contained inside s. -func (s *AstSet) Len() int { - return len(s.items) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/zero_value.go b/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/zero_value.go deleted file mode 100644 index 4370f58185..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/zero_value.go +++ /dev/null @@ -1,94 +0,0 @@ -package lintutil - -import ( - "go/ast" - "go/constant" - "go/token" - "go/types" -) - -// IsZeroValue reports whether x represents zero value of its type. -// -// The functions is conservative and may return false for zero values -// if some cases are not handled in a comprehensive way -// but is should never return true for something that's not a proper zv. -func IsZeroValue(info *types.Info, x ast.Expr) bool { - switch x := x.(type) { - case *ast.BasicLit: - typ := info.TypeOf(x).Underlying().(*types.Basic) - v := info.Types[x].Value - var z constant.Value - switch { - case typ.Kind() == types.String: - z = constant.MakeString("") - case typ.Info()&types.IsInteger != 0: - z = constant.MakeInt64(0) - case typ.Info()&types.IsUnsigned != 0: - z = constant.MakeUint64(0) - case typ.Info()&types.IsFloat != 0: - z = constant.MakeFloat64(0) - default: - return false - } - return constant.Compare(v, token.EQL, z) - - case *ast.CompositeLit: - return len(x.Elts) == 0 - - default: - // Note that this function is not comprehensive. - return false - } -} - -// ZeroValueOf returns a zero value expression for typeExpr of type typ. -// If function can't find such a value, nil is returned. -func ZeroValueOf(typeExpr ast.Expr, typ types.Type) ast.Expr { - switch utyp := typ.Underlying().(type) { - case *types.Basic: - info := utyp.Info() - var zv ast.Expr - switch { - case info&types.IsInteger != 0: - zv = &ast.BasicLit{Kind: token.INT, Value: "0"} - case info&types.IsFloat != 0: - zv = &ast.BasicLit{Kind: token.FLOAT, Value: "0.0"} - case info&types.IsString != 0: - zv = &ast.BasicLit{Kind: token.STRING, Value: `""`} - case info&types.IsBoolean != 0: - zv = &ast.Ident{Name: "false"} - } - if isDefaultLiteralType(typ) { - return zv - } - return &ast.CallExpr{ - Fun: typeExpr, - Args: []ast.Expr{zv}, - } - - case *types.Slice, *types.Map, *types.Pointer, *types.Interface: - return &ast.CallExpr{ - Fun: typeExpr, - Args: []ast.Expr{&ast.Ident{Name: "nil"}}, - } - - case *types.Array, *types.Struct: - return &ast.CompositeLit{Type: typeExpr} - - default: - return nil - } -} - -func isDefaultLiteralType(typ types.Type) bool { - btyp, ok := typ.(*types.Basic) - if !ok { - return false - } - switch btyp.Kind() { - case types.Bool, types.Int, types.Float64, types.String: - return true - default: - return false - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go b/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go deleted file mode 100644 index 2885dc7254..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go +++ /dev/null @@ -1,125 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astp" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "mapKey" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects suspicious map literal keys" - info.Before = ` -_ = map[string]int{ - "foo": 1, - "bar ": 2, -}` - info.After = ` -_ = map[string]int{ - "foo": 1, - "bar": 2, -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&mapKeyChecker{ctx: ctx}), nil - }) -} - -type mapKeyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - astSet lintutil.AstSet -} - -func (c *mapKeyChecker) VisitExpr(expr ast.Expr) { - lit := astcast.ToCompositeLit(expr) - if len(lit.Elts) < 2 { - return - } - - typ, ok := c.ctx.TypeOf(lit).Underlying().(*types.Map) - if !ok { - return - } - if !typep.HasStringKind(typ.Key().Underlying()) { - return - } - - c.checkWhitespace(lit) - c.checkDuplicates(lit) -} - -func (c *mapKeyChecker) checkDuplicates(lit *ast.CompositeLit) { - c.astSet.Clear() - - for _, elt := range lit.Elts { - kv := astcast.ToKeyValueExpr(elt) - if astp.IsBasicLit(kv.Key) { - // Basic lits are handled by the compiler. - continue - } - if !typep.SideEffectFree(c.ctx.TypesInfo, kv.Key) { - continue - } - if !c.astSet.Insert(kv.Key) { - c.warnDupKey(kv.Key) - } - } -} - -func (c *mapKeyChecker) checkWhitespace(lit *ast.CompositeLit) { - var whitespaceKey ast.Node - for _, elt := range lit.Elts { - key := astcast.ToBasicLit(astcast.ToKeyValueExpr(elt).Key) - if len(key.Value) < len(`" "`) { - continue - } - // s is unquoted string literal value. - s := key.Value[len(`"`) : len(key.Value)-len(`"`)] - if !strings.Contains(s, " ") { - continue - } - if whitespaceKey != nil { - // Already seen something with a whitespace. - // More than one entry => not suspicious. - return - } - if s == " " { - // If space is used as a key, maybe this map - // has something to do with spaces. Give up. - return - } - // Check if it has exactly 1 space prefix or suffix. - bad := strings.HasPrefix(s, " ") && !strings.HasPrefix(s, " ") || - strings.HasSuffix(s, " ") && !strings.HasSuffix(s, " ") - if !bad { - // These spaces can be a padding, - // or a legitimate part of a key. Give up. - return - } - whitespaceKey = key - } - - if whitespaceKey != nil { - c.warnWhitespace(whitespaceKey) - } -} - -func (c *mapKeyChecker) warnWhitespace(key ast.Node) { - c.ctx.Warn(key, "suspicious whitespace in %s key", key) -} - -func (c *mapKeyChecker) warnDupKey(key ast.Node) { - c.ctx.Warn(key, "suspicious duplicate %s key", key) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go b/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go deleted file mode 100644 index 755d3b4722..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/methodExprCall_checker.go +++ /dev/null @@ -1,58 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "methodExprCall" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects method expression call that can be replaced with a method call" - info.Before = `f := foo{} -foo.bar(f)` - info.After = `f := foo{} -f.bar()` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&methodExprCallChecker{ctx: ctx}), nil - }) -} - -type methodExprCallChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *methodExprCallChecker) VisitExpr(x ast.Expr) { - call := astcast.ToCallExpr(x) - s := astcast.ToSelectorExpr(call.Fun) - - if len(call.Args) < 1 || astcast.ToIdent(call.Args[0]).Name == "nil" { - return - } - - if typep.IsTypeExpr(c.ctx.TypesInfo, s.X) { - c.warn(call, s) - } -} - -func (c *methodExprCallChecker) warn(cause *ast.CallExpr, s *ast.SelectorExpr) { - selector := astcopy.SelectorExpr(s) - selector.X = cause.Args[0] - - // Remove "&" from the receiver (if any). - if u, ok := selector.X.(*ast.UnaryExpr); ok && u.Op == token.AND { - selector.X = u.X - } - - c.ctx.Warn(cause, "consider to change `%s` to `%s`", cause.Fun, selector) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go b/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go deleted file mode 100644 index dfe73018c8..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/nestingReduce_checker.go +++ /dev/null @@ -1,73 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "nestingReduce" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Params = linter.CheckerParams{ - "bodyWidth": { - Value: 5, - Usage: "min number of statements inside a branch to trigger a warning", - }, - } - info.Summary = "Finds where nesting level could be reduced" - info.Before = ` -for _, v := range a { - if v.Bool { - body() - } -}` - info.After = ` -for _, v := range a { - if !v.Bool { - continue - } - body() -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &nestingReduceChecker{ctx: ctx} - c.bodyWidth = info.Params.Int("bodyWidth") - return astwalk.WalkerForStmt(c), nil - }) -} - -type nestingReduceChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - bodyWidth int -} - -func (c *nestingReduceChecker) VisitStmt(stmt ast.Stmt) { - switch stmt := stmt.(type) { - case *ast.ForStmt: - c.checkLoopBody(stmt.Body.List) - case *ast.RangeStmt: - c.checkLoopBody(stmt.Body.List) - } -} - -func (c *nestingReduceChecker) checkLoopBody(body []ast.Stmt) { - if len(body) != 1 { - return - } - stmt, ok := body[0].(*ast.IfStmt) - if !ok { - return - } - if len(stmt.Body.List) >= c.bodyWidth && stmt.Else == nil { - c.warnLoop(stmt) - } -} - -func (c *nestingReduceChecker) warnLoop(cause ast.Node) { - c.ctx.Warn(cause, "invert if cond, replace body with `continue`, move old body after the statement") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go b/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go deleted file mode 100644 index 1a1b05e0df..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/newDeref_checker.go +++ /dev/null @@ -1,51 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "newDeref" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects immediate dereferencing of `new` expressions" - info.Before = `x := *new(bool)` - info.After = `x := false` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&newDerefChecker{ctx: ctx}), nil - }) -} - -type newDerefChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *newDerefChecker) VisitExpr(expr ast.Expr) { - deref := astcast.ToStarExpr(expr) - call := astcast.ToCallExpr(deref.X) - if astcast.ToIdent(call.Fun).Name == "new" { - typ := c.ctx.TypeOf(call.Args[0]) - // allow *new(T) if T is a type parameter, see #1272 for details - if _, ok := typ.(*types.TypeParam); ok { - return - } - zv := lintutil.ZeroValueOf(astutil.Unparen(call.Args[0]), typ) - if zv != nil { - c.warn(expr, zv) - } - } -} - -func (c *newDerefChecker) warn(cause, suggestion ast.Expr) { - c.ctx.Warn(cause, "replace `%s` with `%s`", cause, suggestion) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go b/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go deleted file mode 100644 index 9a1213f5c2..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/nilValReturn_checker.go +++ /dev/null @@ -1,72 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "nilValReturn" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects return statements those results evaluate to nil" - info.Before = ` -if err == nil { - return err -}` - info.After = ` -// (A) - return nil explicitly -if err == nil { - return nil -} -// (B) - typo in "==", change to "!=" -if err != nil { - return err -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&nilValReturnChecker{ctx: ctx}), nil - }) -} - -type nilValReturnChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *nilValReturnChecker) VisitStmt(stmt ast.Stmt) { - ifStmt, ok := stmt.(*ast.IfStmt) - if !ok || len(ifStmt.Body.List) != 1 { - return - } - ret, ok := ifStmt.Body.List[0].(*ast.ReturnStmt) - if !ok { - return - } - expr, ok := ifStmt.Cond.(*ast.BinaryExpr) - if !ok { - return - } - xIsNil := expr.Op == token.EQL && - typep.SideEffectFree(c.ctx.TypesInfo, expr.X) && - qualifiedName(expr.Y) == "nil" - if !xIsNil { - return - } - for _, res := range ret.Results { - if astequal.Expr(expr.X, res) { - c.warn(ret, expr.X) - break - } - } -} - -func (c *nilValReturnChecker) warn(cause, val ast.Node) { - c.ctx.Warn(cause, "returned expr is always nil; replace %s with nil", val) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go b/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go deleted file mode 100644 index a25fac85cc..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/octalLiteral_checker.go +++ /dev/null @@ -1,51 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "strings" - "unicode" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "octalLiteral" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag, linter.OpinionatedTag} - info.Summary = "Detects old-style octal literals" - info.Before = `foo(02)` - info.After = `foo(0o2)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&octalLiteralChecker{ctx: ctx}), nil - }) -} - -type octalLiteralChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *octalLiteralChecker) VisitExpr(expr ast.Expr) { - if !c.ctx.GoVersion.GreaterOrEqual(linter.GoVersion{Major: 1, Minor: 13}) { - return - } - lit := astcast.ToBasicLit(expr) - if lit.Kind != token.INT { - return - } - if !strings.HasPrefix(lit.Value, "0") || len(lit.Value) == 1 { - return - } - if unicode.IsDigit(rune(lit.Value[1])) { - c.warn(lit) - } -} - -func (c *octalLiteralChecker) warn(lit *ast.BasicLit) { - c.ctx.Warn(lit, "use new octal literal style, 0o%s", lit.Value[len("0"):]) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go b/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go deleted file mode 100644 index c777fec9e6..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/paramTypeCombine_checker.go +++ /dev/null @@ -1,97 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/astequal" -) - -func init() { - var info linter.CheckerInfo - info.Name = "paramTypeCombine" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag} - info.Summary = "Detects if function parameters could be combined by type and suggest the way to do it" - info.Before = `func foo(a, b int, c, d int, e, f int, g int) {}` - info.After = `func foo(a, b, c, d, e, f, g int) {}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(¶mTypeCombineChecker{ctx: ctx}), nil - }) -} - -type paramTypeCombineChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *paramTypeCombineChecker) EnterFunc(*ast.FuncDecl) bool { - return true -} - -func (c *paramTypeCombineChecker) VisitFuncDecl(decl *ast.FuncDecl) { - typ := c.optimizeFuncType(decl.Type) - if !astequal.Expr(typ, decl.Type) { - c.warn(decl.Type, typ) - } -} - -func (c *paramTypeCombineChecker) optimizeFuncType(f *ast.FuncType) *ast.FuncType { - optimizedParamFunc := astcopy.FuncType(f) - - optimizedParamFunc.Params = c.optimizeParams(f.Params) - optimizedParamFunc.Results = c.optimizeParams(f.Results) - - return optimizedParamFunc -} - -func (c *paramTypeCombineChecker) optimizeParams(params *ast.FieldList) *ast.FieldList { - // To avoid false positives, skip unnamed param lists. - // - // We're using a property that Go only permits unnamed params - // for the whole list, so it's enough to check whether any of - // ast.Field have empty name list. - skip := params == nil || - len(params.List) < 2 || - len(params.List[0].Names) == 0 || - c.paramsAreMultiLine(params) - if skip { - return params - } - - list := []*ast.Field{} - names := make([]*ast.Ident, len(params.List[0].Names)) - copy(names, params.List[0].Names) - list = append(list, &ast.Field{ - Names: names, - Type: params.List[0].Type, - }) - for i, p := range params.List[1:] { - names = make([]*ast.Ident, len(p.Names)) - copy(names, p.Names) - if astequal.Expr(p.Type, params.List[i].Type) { - list[len(list)-1].Names = append(list[len(list)-1].Names, names...) - } else { - list = append(list, &ast.Field{ - Names: names, - Type: params.List[i+1].Type, - }) - } - } - return &ast.FieldList{ - List: list, - } -} - -func (c *paramTypeCombineChecker) warn(f1, f2 *ast.FuncType) { - c.ctx.Warn(f1, "%s could be replaced with %s", f1, f2) -} - -func (c *paramTypeCombineChecker) paramsAreMultiLine(params *ast.FieldList) bool { - startPos := c.ctx.FileSet.Position(params.Opening) - endPos := c.ctx.FileSet.Position(params.Closing) - return startPos.Line != endPos.Line -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go deleted file mode 100644 index 172a4acb58..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/ptrToRefParam_checker.go +++ /dev/null @@ -1,70 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "ptrToRefParam" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Summary = "Detects input and output parameters that have a type of pointer to referential type" - info.Before = `func f(m *map[string]int) (*chan *int)` - info.After = `func f(m map[string]int) (chan *int)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&ptrToRefParamChecker{ctx: ctx}), nil - }) -} - -type ptrToRefParamChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *ptrToRefParamChecker) VisitFuncDecl(fn *ast.FuncDecl) { - c.checkParams(fn.Type.Params.List) - if fn.Type.Results != nil { - c.checkParams(fn.Type.Results.List) - } -} - -func (c *ptrToRefParamChecker) checkParams(params []*ast.Field) { - for _, param := range params { - ptr, ok := c.ctx.TypeOf(param.Type).(*types.Pointer) - if !ok { - continue - } - - if c.isRefType(ptr.Elem()) { - if len(param.Names) == 0 { - c.ctx.Warn(param, "consider to make non-pointer type for `%s`", param.Type) - } else { - for i := range param.Names { - c.warn(param.Names[i]) - } - } - } - } -} - -func (c *ptrToRefParamChecker) isRefType(x types.Type) bool { - switch typ := x.(type) { - case *types.Map, *types.Chan, *types.Interface: - return true - case *types.Named: - // Handle underlying type only for interfaces. - if _, ok := typ.Underlying().(*types.Interface); ok { - return true - } - } - return false -} - -func (c *ptrToRefParamChecker) warn(id *ast.Ident) { - c.ctx.Warn(id, "consider `%s' to be of non-pointer type", id) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go b/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go deleted file mode 100644 index 3f61ee0bda..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/rangeExprCopy_checker.go +++ /dev/null @@ -1,80 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "rangeExprCopy" - info.Tags = []string{linter.PerformanceTag} - info.Params = linter.CheckerParams{ - "sizeThreshold": { - Value: 512, - Usage: "size in bytes that makes the warning trigger", - }, - "skipTestFuncs": { - Value: true, - Usage: "whether to check test functions", - }, - } - info.Summary = "Detects expensive copies of `for` loop range expressions" - info.Details = "Suggests to use pointer to array to avoid the copy using `&` on range expression." - info.Before = ` -var xs [2048]byte -for _, x := range xs { // Copies 2048 bytes - // Loop body. -}` - info.After = ` -var xs [2048]byte -for _, x := range &xs { // No copy - // Loop body. -}` - info.Note = "See Go issue for details: https://github.com/golang/go/issues/15812." - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &rangeExprCopyChecker{ctx: ctx} - c.sizeThreshold = int64(info.Params.Int("sizeThreshold")) - c.skipTestFuncs = info.Params.Bool("skipTestFuncs") - return astwalk.WalkerForStmt(c), nil - }) -} - -type rangeExprCopyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - sizeThreshold int64 - skipTestFuncs bool -} - -func (c *rangeExprCopyChecker) EnterFunc(fn *ast.FuncDecl) bool { - return fn.Body != nil && - !(c.skipTestFuncs && isUnitTestFunc(c.ctx, fn)) -} - -func (c *rangeExprCopyChecker) VisitStmt(stmt ast.Stmt) { - rng, ok := stmt.(*ast.RangeStmt) - if !ok || rng.Key == nil || rng.Value == nil { - return - } - tv := c.ctx.TypesInfo.Types[rng.X] - if !tv.Addressable() { - return - } - if _, ok := tv.Type.(*types.Array); !ok { - return - } - if size, ok := c.ctx.SizeOf(tv.Type); ok && size >= c.sizeThreshold { - c.warn(rng, size) - } -} - -func (c *rangeExprCopyChecker) warn(rng *ast.RangeStmt, size int64) { - c.ctx.Warn(rng, "copy of %s (%d bytes) can be avoided with &%s", - rng.X, size, rng.X) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go b/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go deleted file mode 100644 index 6d15c30cd1..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/rangeValCopy_checker.go +++ /dev/null @@ -1,76 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "rangeValCopy" - info.Tags = []string{linter.PerformanceTag} - info.Params = linter.CheckerParams{ - "sizeThreshold": { - Value: 128, - Usage: "size in bytes that makes the warning trigger", - }, - "skipTestFuncs": { - Value: true, - Usage: "whether to check test functions", - }, - } - info.Summary = "Detects loops that copy big objects during each iteration" - info.Details = "Suggests to use index access or take address and make use pointer instead." - info.Before = ` -xs := make([][1024]byte, length) -for _, x := range xs { - // Loop body. -}` - info.After = ` -xs := make([][1024]byte, length) -for i := range xs { - x := &xs[i] - // Loop body. -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &rangeValCopyChecker{ctx: ctx} - c.sizeThreshold = int64(info.Params.Int("sizeThreshold")) - c.skipTestFuncs = info.Params.Bool("skipTestFuncs") - return astwalk.WalkerForStmt(c), nil - }) -} - -type rangeValCopyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - sizeThreshold int64 - skipTestFuncs bool -} - -func (c *rangeValCopyChecker) EnterFunc(fn *ast.FuncDecl) bool { - return fn.Body != nil && - !(c.skipTestFuncs && isUnitTestFunc(c.ctx, fn)) -} - -func (c *rangeValCopyChecker) VisitStmt(stmt ast.Stmt) { - rng, ok := stmt.(*ast.RangeStmt) - if !ok || rng.Value == nil { - return - } - typ := c.ctx.TypeOf(rng.Value) - if typ == nil { - return - } - size, ok := c.ctx.SizeOf(typ) - if ok && size >= c.sizeThreshold { - c.warn(rng, size) - } -} - -func (c *rangeValCopyChecker) warn(n ast.Node, size int64) { - c.ctx.Warn(n, "each iteration copies %d bytes (consider pointers or indexing)", size) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go b/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go deleted file mode 100644 index 45aba261ba..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/regexpPattern_checker.go +++ /dev/null @@ -1,68 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/constant" - "regexp" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "regexpPattern" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects suspicious regexp patterns" - info.Before = "regexp.MustCompile(`google.com|yandex.ru`)" - info.After = "regexp.MustCompile(`google\\.com|yandex\\.ru`)" - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - domains := []string{ - "com", - "org", - "info", - "net", - "ru", - "de", - } - - allDomains := strings.Join(domains, "|") - domainRE := regexp.MustCompile(`[^\\]\.(` + allDomains + `)\b`) - return astwalk.WalkerForExpr(®expPatternChecker{ - ctx: ctx, - domainRE: domainRE, - }), nil - }) -} - -type regexpPatternChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - domainRE *regexp.Regexp -} - -func (c *regexpPatternChecker) VisitExpr(x ast.Expr) { - call, ok := x.(*ast.CallExpr) - if !ok { - return - } - - switch qualifiedName(call.Fun) { - case "regexp.Compile", "regexp.CompilePOSIX", "regexp.MustCompile", "regexp.MustCompilePosix": - cv := c.ctx.TypesInfo.Types[call.Args[0]].Value - if cv == nil || cv.Kind() != constant.String { - return - } - s := constant.StringVal(cv) - if m := c.domainRE.FindStringSubmatch(s); m != nil { - c.warnDomain(call.Args[0], m[1]) - } - } -} - -func (c *regexpPatternChecker) warnDomain(cause ast.Expr, domain string) { - c.ctx.Warn(cause, "'.%s' should probably be '\\.%s'", domain, domain) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go b/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go deleted file mode 100644 index f500f43500..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/regexpSimplify_checker.go +++ /dev/null @@ -1,512 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - "go/constant" - "log" - "strings" - "unicode/utf8" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/quasilyte/regex/syntax" -) - -func init() { - var info linter.CheckerInfo - info.Name = "regexpSimplify" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag, linter.OpinionatedTag} - info.Summary = "Detects regexp patterns that can be simplified" - info.Before = "regexp.MustCompile(`(?:a|b|c) [a-z][a-z]*`)" - info.After = "regexp.MustCompile(`[abc] {3}[a-z]+`)" - - // TODO(quasilyte): add params to control most opinionated replacements - // like `[0-9] -> \d` - // `[[:digit:]] -> \d` - // `[A-Za-z0-9_]` -> `\w` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - opts := &syntax.ParserOptions{ - NoLiterals: true, - } - c := ®expSimplifyChecker{ - ctx: ctx, - parser: syntax.NewParser(opts), - out: &strings.Builder{}, - } - return astwalk.WalkerForExpr(c), nil - }) -} - -type regexpSimplifyChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - parser *syntax.Parser - - // out is a tmp buffer where we build a simplified regexp pattern. - out *strings.Builder - // score is a number of applied simplifications - score int -} - -func (c *regexpSimplifyChecker) VisitExpr(x ast.Expr) { - call, ok := x.(*ast.CallExpr) - if !ok { - return - } - - switch qualifiedName(call.Fun) { - case "regexp.Compile", "regexp.MustCompile": - cv := c.ctx.TypesInfo.Types[call.Args[0]].Value - if cv == nil || cv.Kind() != constant.String { - return - } - pat := constant.StringVal(cv) - if len(pat) > 60 { - // Skip scary regexp patterns for now. - break - } - - // Only do 2 passes. - simplified := pat - for pass := 0; pass < 2; pass++ { - candidate := c.simplify(pass, simplified) - if candidate == "" { - break - } - simplified = candidate - } - if simplified != "" && simplified != pat { - c.warn(call.Args[0], pat, simplified) - } - } -} - -func (c *regexpSimplifyChecker) simplify(pass int, pat string) string { - re, err := c.parser.Parse(pat) - if err != nil { - return "" - } - - c.score = 0 - c.out.Reset() - - // TODO(quasilyte): suggest char ranges for things like [012345689]? - // TODO(quasilyte): evaluate char range to suggest better replacements. - // TODO(quasilyte): (?:ab|ac) -> a[bc] - // TODO(quasilyte): suggest "s" and "." flag if things like [\w\W] are used. - // TODO(quasilyte): x{n}x? -> x{n,n+1} - - c.walk(re.Expr) - - if debug() { - // This happens only in one of two cases: - // 1. Parser has a bug and we got invalid AST for the given pattern. - // 2. Simplifier incorrectly built a replacement string from the AST. - if c.score == 0 && c.out.String() != pat { - log.Printf("pass %d: unexpected pattern diff:\n\thave: %q\n\twant: %q", - pass, c.out.String(), pat) - } - } - - if c.score > 0 { - return c.out.String() - } - return "" -} - -func (c *regexpSimplifyChecker) walk(e syntax.Expr) { - out := c.out - - switch e.Op { - case syntax.OpConcat: - c.walkConcat(e) - - case syntax.OpAlt: - c.walkAlt(e) - - case syntax.OpCharRange: - s := c.simplifyCharRange(e) - if s != "" { - out.WriteString(s) - c.score++ - } else { - out.WriteString(e.Value) - } - - case syntax.OpGroupWithFlags: - out.WriteString("(") - out.WriteString(e.Args[1].Value) - out.WriteString(":") - c.walk(e.Args[0]) - out.WriteString(")") - case syntax.OpGroup: - c.walkGroup(e) - case syntax.OpCapture: - out.WriteString("(") - c.walk(e.Args[0]) - out.WriteString(")") - case syntax.OpNamedCapture: - out.WriteString("(?P<") - out.WriteString(e.Args[1].Value) - out.WriteString(">") - c.walk(e.Args[0]) - out.WriteString(")") - - case syntax.OpRepeat: - // TODO(quasilyte): is it worth it to analyze repeat argument - // more closely and handle `{n,n} -> {n}` cases? - rep := e.Args[1].Value - switch rep { - case "{0,1}": - c.walk(e.Args[0]) - out.WriteString("?") - c.score++ - case "{1,}": - c.walk(e.Args[0]) - out.WriteString("+") - c.score++ - case "{0,}": - c.walk(e.Args[0]) - out.WriteString("*") - c.score++ - case "{0}": - // Maybe {0} should be reported by another check, regexpLint? - c.score++ - case "{1}": - c.walk(e.Args[0]) - c.score++ - default: - c.walk(e.Args[0]) - out.WriteString(rep) - } - - case syntax.OpPosixClass: - out.WriteString(e.Value) - - case syntax.OpNegCharClass: - s := c.simplifyNegCharClass(e) - if s != "" { - c.out.WriteString(s) - c.score++ - } else { - out.WriteString("[^") - for _, e := range e.Args { - c.walk(e) - } - out.WriteString("]") - } - - case syntax.OpCharClass: - s := c.simplifyCharClass(e) - if s != "" { - c.out.WriteString(s) - c.score++ - } else { - out.WriteString("[") - for _, e := range e.Args { - c.walk(e) - } - out.WriteString("]") - } - - case syntax.OpEscapeChar: - switch e.Value { - case `\&`, `\#`, `\!`, `\@`, `\%`, `\<`, `\>`, `\:`, `\;`, `\/`, `\,`, `\=`, `\.`: - c.score++ - out.WriteString(e.Value[len(`\`):]) - default: - out.WriteString(e.Value) - } - - case syntax.OpQuestion, syntax.OpNonGreedy: - c.walk(e.Args[0]) - out.WriteString("?") - case syntax.OpStar: - c.walk(e.Args[0]) - out.WriteString("*") - case syntax.OpPlus: - c.walk(e.Args[0]) - out.WriteString("+") - - default: - out.WriteString(e.Value) - } -} - -func (c *regexpSimplifyChecker) walkGroup(g syntax.Expr) { - switch g.Args[0].Op { - case syntax.OpChar, syntax.OpEscapeChar, syntax.OpEscapeMeta, syntax.OpCharClass: - c.walk(g.Args[0]) - c.score++ - return - } - - c.out.WriteString("(?:") - c.walk(g.Args[0]) - c.out.WriteString(")") -} - -func (c *regexpSimplifyChecker) simplifyNegCharClass(e syntax.Expr) string { - switch e.Value { - case `[^0-9]`: - return `\D` - case `[^\s]`: - return `\S` - case `[^\S]`: - return `\s` - case `[^\w]`: - return `\W` - case `[^\W]`: - return `\w` - case `[^\d]`: - return `\D` - case `[^\D]`: - return `\d` - case `[^[:^space:]]`: - return `\s` - case `[^[:space:]]`: - return `\S` - case `[^[:^word:]]`: - return `\w` - case `[^[:word:]]`: - return `\W` - case `[^[:^digit:]]`: - return `\d` - case `[^[:digit:]]`: - return `\D` - } - - return "" -} - -func (c *regexpSimplifyChecker) simplifyCharClass(e syntax.Expr) string { - switch e.Value { - case `[0-9]`: - return `\d` - case `[[:word:]]`: - return `\w` - case `[[:^word:]]`: - return `\W` - case `[[:digit:]]`: - return `\d` - case `[[:^digit:]]`: - return `\D` - case `[[:space:]]`: - return `\s` - case `[[:^space:]]`: - return `\S` - case `[][]`: - return `\]\[` - case `[]]`: - return `\]` - } - - if len(e.Args) == 1 { - switch e.Args[0].Op { - case syntax.OpChar: - switch v := e.Args[0].Value; v { - case "|", "*", "+", "?", ".", "[", "^", "$", "(", ")": - // Can't take outside of the char group without escaping. - default: - return v - } - case syntax.OpEscapeChar: - return e.Args[0].Value - } - } - - return "" -} - -func (c *regexpSimplifyChecker) canMerge(x, y syntax.Expr) bool { - if x.Op != y.Op { - return false - } - switch x.Op { - case syntax.OpChar, syntax.OpCharClass, syntax.OpEscapeMeta, syntax.OpEscapeChar, syntax.OpNegCharClass, syntax.OpGroup: - return x.Value == y.Value - default: - return false - } -} - -func (c *regexpSimplifyChecker) canCombine(x, y syntax.Expr) (threshold int, ok bool) { - if x.Op != y.Op { - return 0, false - } - - switch x.Op { - case syntax.OpDot: - return 3, true - - case syntax.OpChar: - if x.Value != y.Value { - return 0, false - } - if x.Value == " " { - return 1, true - } - return 4, true - - case syntax.OpEscapeMeta, syntax.OpEscapeChar: - if x.Value == y.Value { - return 2, true - } - - case syntax.OpCharClass, syntax.OpNegCharClass, syntax.OpGroup: - if x.Value == y.Value { - return 1, true - } - } - - return 0, false -} - -func (c *regexpSimplifyChecker) concatLiteral(e syntax.Expr) string { - if e.Op == syntax.OpConcat && c.allChars(e) { - return e.Value - } - return "" -} - -func (c *regexpSimplifyChecker) allChars(e syntax.Expr) bool { - for _, a := range e.Args { - if a.Op != syntax.OpChar { - return false - } - } - return true -} - -func (c *regexpSimplifyChecker) factorPrefixSuffix(alt syntax.Expr) bool { - // TODO: more forms of prefixes/suffixes? - // - // A more generalized algorithm could handle `fo|fo1|fo2` -> `fo[12]?`. - // but it's an open question whether the latter form universally better. - // - // Right now it handles only the simplest cases: - // `http|https` -> `https?` - // `xfoo|foo` -> `x?foo` - if len(alt.Args) != 2 { - return false - } - x := c.concatLiteral(alt.Args[0]) - y := c.concatLiteral(alt.Args[1]) - if x == y { - return false // Reject non-literals and identical strings early - } - - // Let x be a shorter string. - if len(x) > len(y) { - x, y = y, x - } - // Do we have a common prefix? - tail := strings.TrimPrefix(y, x) - if len(tail) <= utf8.UTFMax && utf8.RuneCountInString(tail) == 1 { - c.out.WriteString(x + tail + "?") - c.score++ - return true - } - // Do we have a common suffix? - head := strings.TrimSuffix(y, x) - if len(head) <= utf8.UTFMax && utf8.RuneCountInString(head) == 1 { - c.out.WriteString(head + "?" + x) - c.score++ - return true - } - return false -} - -func (c *regexpSimplifyChecker) walkAlt(alt syntax.Expr) { - // `x|y|z` -> `[xyz]`. - if c.allChars(alt) { - c.score++ - c.out.WriteString("[") - for _, e := range alt.Args { - c.out.WriteString(e.Value) - } - c.out.WriteString("]") - return - } - - if c.factorPrefixSuffix(alt) { - return - } - - for i, e := range alt.Args { - c.walk(e) - if i != len(alt.Args)-1 { - c.out.WriteString("|") - } - } -} - -func (c *regexpSimplifyChecker) walkConcat(concat syntax.Expr) { - i := 0 - for i < len(concat.Args) { - x := concat.Args[i] - c.walk(x) - i++ - - if i >= len(concat.Args) { - break - } - - // Try merging `xy*` into `x+` where x=y. - if concat.Args[i].Op == syntax.OpStar { - if c.canMerge(x, concat.Args[i].Args[0]) { - c.out.WriteString("+") - c.score++ - i++ - continue - } - } - - // Try combining `xy` into `x{2}` where x=y. - threshold, ok := c.canCombine(x, concat.Args[i]) - if !ok { - continue - } - n := 1 // Can combine at least 1 pair. - for j := i + 1; j < len(concat.Args); j++ { - _, ok := c.canCombine(x, concat.Args[j]) - if !ok { - break - } - n++ - } - if n >= threshold { - fmt.Fprintf(c.out, "{%d}", n+1) - c.score++ - i += n - } - } -} - -func (c *regexpSimplifyChecker) simplifyCharRange(rng syntax.Expr) string { - if rng.Args[0].Op != syntax.OpChar || rng.Args[1].Op != syntax.OpChar { - return "" - } - - lo := rng.Args[0].Value - hi := rng.Args[1].Value - if len(lo) == 1 && len(hi) == 1 { - switch hi[0] - lo[0] { - case 0: - return lo - case 1: - return lo + hi - case 2: - return lo + string(lo[0]+1) + hi - } - } - - return "" -} - -func (c *regexpSimplifyChecker) warn(cause ast.Expr, orig, suggest string) { - c.ctx.Warn(cause, "can re-write `%s` as `%s`", orig, suggest) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go b/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go deleted file mode 100644 index 29723a69a9..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/ruleguard_checker.go +++ /dev/null @@ -1,322 +0,0 @@ -package checkers - -import ( - "bytes" - "errors" - "fmt" - "go/ast" - "go/token" - "log" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/go-critic/go-critic/linter" - - "github.com/quasilyte/go-ruleguard/ruleguard" -) - -func init() { - var info linter.CheckerInfo - info.Name = "ruleguard" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Params = linter.CheckerParams{ - "rules": { - Value: "", - Usage: "comma-separated list of gorule file paths. Glob patterns such as 'rules-*.go' may be specified", - }, - "debug": { - Value: "", - Usage: "enable debug for the specified named rules group", - }, - "failOnError": { - Value: false, - Usage: "deprecated, use failOn param; if set to true, identical to failOn='all', otherwise failOn=''", - }, - "failOn": { - Value: "", - Usage: `Determines the behavior when an error occurs while parsing ruleguard files. -If flag is not set, log error and skip rule files that contain an error. -If flag is set, the value must be a comma-separated list of error conditions. -* 'import': rule refers to a package that cannot be loaded. -* 'dsl': gorule file does not comply with the ruleguard DSL.`, - }, - "enable": { - Value: "", - Usage: "comma-separated list of enabled groups or skip empty to enable everything", - }, - "disable": { - Value: "", - Usage: "comma-separated list of disabled groups or skip empty to enable everything", - }, - } - info.Summary = "Runs user-defined rules using ruleguard linter" - info.Details = "Reads a rules file and turns them into go-critic checkers." - info.Before = `N/A` - info.After = `N/A` - info.Note = "See https://github.com/quasilyte/go-ruleguard." - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return newRuleguardChecker(&info, ctx) - }) -} - -// parseErrorHandler is used to determine whether to ignore or fail ruleguard parsing errors. -type parseErrorHandler struct { - // failureConditions is a map of predicates which are evaluated against a ruleguard parsing error. - // If at least one predicate returns true, then an error is returned. - // Otherwise, the ruleguard file is skipped. - failureConditions map[string]func(err error) bool -} - -// failOnParseError returns true if a parseError occurred and that error should be not be ignored. -func (e parseErrorHandler) failOnParseError(parseError error) bool { - for _, p := range e.failureConditions { - if p(parseError) { - return true - } - } - return false -} - -func newErrorHandler(failOnErrorFlag string) (*parseErrorHandler, error) { - h := parseErrorHandler{ - failureConditions: make(map[string]func(err error) bool), - } - failOnErrorPredicates := map[string]func(error) bool{ - "dsl": func(err error) bool { var e *ruleguard.ImportError; return !errors.As(err, &e) }, - "import": func(err error) bool { var e *ruleguard.ImportError; return errors.As(err, &e) }, - "all": func(err error) bool { return true }, - } - for _, k := range strings.Split(failOnErrorFlag, ",") { - if k == "" { - continue - } - if p, ok := failOnErrorPredicates[k]; ok { - h.failureConditions[k] = p - } else { - // Wrong flag value. - supportedValues := []string{} - for key := range failOnErrorPredicates { - supportedValues = append(supportedValues, key) - } - return nil, fmt.Errorf("ruleguard init error: 'failOnError' flag '%s' is invalid. It must be a comma-separated list and supported values are '%s'", - k, strings.Join(supportedValues, ",")) - } - } - return &h, nil -} - -func newRuleguardChecker(info *linter.CheckerInfo, ctx *linter.CheckerContext) (*ruleguardChecker, error) { - c := &ruleguardChecker{ - ctx: ctx, - debugGroup: info.Params.String("debug"), - } - rulesFlag := info.Params.String("rules") - if rulesFlag == "" { - return c, nil - } - failOn := info.Params.String("failOn") - if failOn == "" { - if info.Params.Bool("failOnError") { - failOn = "all" - } - } - h, err := newErrorHandler(failOn) - if err != nil { - return nil, err - } - - engine := ruleguard.NewEngine() - engine.InferBuildContext() - fset := token.NewFileSet() - filePatterns := strings.Split(rulesFlag, ",") - - enabledGroups := make(map[string]bool) - disabledGroups := make(map[string]bool) - enabledTags := make(map[string]bool) - disabledTags := make(map[string]bool) - - for _, g := range strings.Split(info.Params.String("disable"), ",") { - g = strings.TrimSpace(g) - if strings.HasPrefix(g, "#") { - disabledTags[strings.TrimPrefix(g, "#")] = true - continue - } - - disabledGroups[g] = true - } - flagEnable := info.Params.String("enable") - if flagEnable != "" { - for _, g := range strings.Split(flagEnable, ",") { - g = strings.TrimSpace(g) - if strings.HasPrefix(g, "#") { - enabledTags[strings.TrimPrefix(g, "#")] = true - continue - } - - enabledGroups[g] = true - } - } - - if !enabledTags[linter.ExperimentalTag] { - disabledTags[linter.ExperimentalTag] = true - } - ruleguardDebug := os.Getenv("GOCRITIC_RULEGUARD_DEBUG") != "" - - inEnabledTags := func(g *ruleguard.GoRuleGroup) bool { - for _, t := range g.DocTags { - if enabledTags[t] { - return true - } - } - return false - } - inDisabledTags := func(g *ruleguard.GoRuleGroup) string { - for _, t := range g.DocTags { - if disabledTags[t] { - return t - } - } - return "" - } - - loadContext := &ruleguard.LoadContext{ - Fset: fset, - DebugImports: ruleguardDebug, - DebugPrint: debugPrint, - GroupFilter: func(g *ruleguard.GoRuleGroup) bool { - enabled := flagEnable == "" || enabledGroups[g.Name] || inEnabledTags(g) - whyDisabled := "" - - switch { - case !enabled: - whyDisabled = "not enabled by name or tag (-enable flag)" - case disabledGroups[g.Name]: - whyDisabled = "disabled by name (-disable flag)" - default: - if tag := inDisabledTags(g); tag != "" { - whyDisabled = fmt.Sprintf("disabled by %s tag (-disable flag)", tag) - } - } - - if ruleguardDebug { - if whyDisabled != "" { - debugPrint(fmt.Sprintf("(-) %s is %s", g.Name, whyDisabled)) - } else { - debugPrint(fmt.Sprintf("(+) %s is enabled", g.Name)) - } - } - return whyDisabled == "" - }, - } - - loaded := 0 - for _, filePattern := range filePatterns { - filenames, err := filepath.Glob(strings.TrimSpace(filePattern)) - if err != nil { - // The only possible returned error is ErrBadPattern, when pattern is malformed. - log.Printf("ruleguard init error: %+v", err) - continue - } - if len(filenames) == 0 { - return nil, fmt.Errorf("ruleguard init error: no file matching '%s'", strings.TrimSpace(filePattern)) - } - for _, filename := range filenames { - data, err := os.ReadFile(filename) - if err != nil { - if h.failOnParseError(err) { - return nil, fmt.Errorf("ruleguard init error: %+v", err) - } - log.Printf("ruleguard init error, skip %s: %+v", filename, err) - } - if err := engine.Load(loadContext, filename, bytes.NewReader(data)); err != nil { - if h.failOnParseError(err) { - return nil, fmt.Errorf("ruleguard init error: %+v", err) - } - log.Printf("ruleguard init error, skip %s: %+v", filename, err) - } - loaded++ - } - } - - if loaded != 0 { - c.engine = engine - } - return c, nil -} - -type ruleguardChecker struct { - ctx *linter.CheckerContext - - debugGroup string - engine *ruleguard.Engine -} - -func (c *ruleguardChecker) WalkFile(f *ast.File) { - if c.engine == nil { - return - } - - runRuleguardEngine(c.ctx, f, c.engine, &ruleguard.RunContext{ - Debug: c.debugGroup, - DebugPrint: func(s string) { - fmt.Fprintln(os.Stderr, s) - }, - Pkg: c.ctx.Pkg, - Types: c.ctx.TypesInfo, - Sizes: c.ctx.SizesInfo, - Fset: c.ctx.FileSet, - TruncateLen: 100, - }) -} - -func runRuleguardEngine(ctx *linter.CheckerContext, f *ast.File, e *ruleguard.Engine, runCtx *ruleguard.RunContext) { - type ruleguardReport struct { - pos token.Pos - message string - fix linter.QuickFix - } - var reports []ruleguardReport - - runCtx.Report = func(data *ruleguard.ReportData) { - // TODO(quasilyte): investigate whether we should add a rule name as - // a message prefix here. - r := ruleguardReport{ - pos: data.Node.Pos(), - message: data.Message, - } - fix := data.Suggestion - if fix != nil { - r.fix = linter.QuickFix{ - From: fix.From, - To: fix.To, - Replacement: fix.Replacement, - } - } - reports = append(reports, r) - } - - if err := e.Run(runCtx, f); err != nil { - // Normally this should never happen, but since - // we don't have a better mechanism to report errors, - // emit a warning. - ctx.Warn(f, "execution error: %v", err) - } - - sort.Slice(reports, func(i, j int) bool { - return reports[i].message < reports[j].message - }) - for _, report := range reports { - if report.fix.Replacement != nil { - ctx.WarnFixableWithPos(report.pos, report.fix, "%s", report.message) - } else { - ctx.WarnWithPos(report.pos, "%s", report.message) - } - } -} - -func debugPrint(s string) { - fmt.Println("debug:", s) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/rulesdata/rulesdata.go b/vendor/github.com/go-critic/go-critic/checkers/rulesdata/rulesdata.go deleted file mode 100644 index c568df3998..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/rulesdata/rulesdata.go +++ /dev/null @@ -1,2586 +0,0 @@ -// Code generated by "precompile.go". DO NOT EDIT. - -package rulesdata - -import "github.com/quasilyte/go-ruleguard/ruleguard/ir" - -var PrecompiledRules = &ir.File{ - PkgPath: "gorules", - CustomDecls: []string{}, - BundleImports: []ir.BundleImport{}, - RuleGroups: []ir.RuleGroup{ - { - Line: 11, - Name: "redundantSprint", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects redundant fmt.Sprint calls", - DocBefore: "fmt.Sprint(x)", - DocAfter: "x.String()", - Rules: []ir.Rule{ - { - Line: 12, - SyntaxPatterns: []ir.PatternString{ - {Line: 12, Value: "fmt.Sprint($x)"}, - {Line: 12, Value: "fmt.Sprintf(\"%s\", $x)"}, - {Line: 12, Value: "fmt.Sprintf(\"%v\", $x)"}, - }, - ReportTemplate: "use $x.String() instead", - SuggestTemplate: "$x.String()", - WhereExpr: ir.FilterExpr{ - Line: 13, - Op: ir.FilterAndOp, - Src: "!m[\"x\"].Type.Is(`reflect.Value`) && m[\"x\"].Type.Implements(`fmt.Stringer`)", - Args: []ir.FilterExpr{ - { - Line: 13, - Op: ir.FilterNotOp, - Src: "!m[\"x\"].Type.Is(`reflect.Value`)", - Args: []ir.FilterExpr{{ - Line: 13, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`reflect.Value`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 13, Op: ir.FilterStringOp, Src: "`reflect.Value`", Value: "reflect.Value"}}, - }}, - }, - { - Line: 13, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"x\"].Type.Implements(`fmt.Stringer`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 13, Op: ir.FilterStringOp, Src: "`fmt.Stringer`", Value: "fmt.Stringer"}}, - }, - }, - }, - }, - { - Line: 17, - SyntaxPatterns: []ir.PatternString{ - {Line: 17, Value: "fmt.Sprint($x)"}, - {Line: 17, Value: "fmt.Sprintf(\"%s\", $x)"}, - {Line: 17, Value: "fmt.Sprintf(\"%v\", $x)"}, - }, - ReportTemplate: "$x is already string", - SuggestTemplate: "$x", - WhereExpr: ir.FilterExpr{ - Line: 18, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`string`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 18, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }, - { - Line: 27, - Name: "deferUnlambda", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects deferred function literals that can be simplified", - DocBefore: "defer func() { f() }()", - DocAfter: "defer f()", - Rules: []ir.Rule{ - { - Line: 28, - SyntaxPatterns: []ir.PatternString{{Line: 28, Value: "defer func() { $f($*args) }()"}}, - ReportTemplate: "can rewrite as `defer $f($args)`", - WhereExpr: ir.FilterExpr{ - Line: 29, - Op: ir.FilterAndOp, - Src: "m[\"f\"].Node.Is(`Ident`) && m[\"f\"].Text != \"panic\" && m[\"f\"].Text != \"recover\" && m[\"args\"].Const", - Args: []ir.FilterExpr{ - { - Line: 29, - Op: ir.FilterAndOp, - Src: "m[\"f\"].Node.Is(`Ident`) && m[\"f\"].Text != \"panic\" && m[\"f\"].Text != \"recover\"", - Args: []ir.FilterExpr{ - { - Line: 29, - Op: ir.FilterAndOp, - Src: "m[\"f\"].Node.Is(`Ident`) && m[\"f\"].Text != \"panic\"", - Args: []ir.FilterExpr{ - { - Line: 29, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"f\"].Node.Is(`Ident`)", - Value: "f", - Args: []ir.FilterExpr{{Line: 29, Op: ir.FilterStringOp, Src: "`Ident`", Value: "Ident"}}, - }, - { - Line: 29, - Op: ir.FilterNeqOp, - Src: "m[\"f\"].Text != \"panic\"", - Args: []ir.FilterExpr{ - {Line: 29, Op: ir.FilterVarTextOp, Src: "m[\"f\"].Text", Value: "f"}, - {Line: 29, Op: ir.FilterStringOp, Src: "\"panic\"", Value: "panic"}, - }, - }, - }, - }, - { - Line: 29, - Op: ir.FilterNeqOp, - Src: "m[\"f\"].Text != \"recover\"", - Args: []ir.FilterExpr{ - {Line: 29, Op: ir.FilterVarTextOp, Src: "m[\"f\"].Text", Value: "f"}, - {Line: 29, Op: ir.FilterStringOp, Src: "\"recover\"", Value: "recover"}, - }, - }, - }, - }, - { - Line: 29, - Op: ir.FilterVarConstOp, - Src: "m[\"args\"].Const", - Value: "args", - }, - }, - }, - }, - { - Line: 32, - SyntaxPatterns: []ir.PatternString{{Line: 32, Value: "defer func() { $pkg.$f($*args) }()"}}, - ReportTemplate: "can rewrite as `defer $pkg.$f($args)`", - WhereExpr: ir.FilterExpr{ - Line: 33, - Op: ir.FilterAndOp, - Src: "m[\"f\"].Node.Is(`Ident`) && m[\"args\"].Const && m[\"pkg\"].Object.Is(`PkgName`)", - Args: []ir.FilterExpr{ - { - Line: 33, - Op: ir.FilterAndOp, - Src: "m[\"f\"].Node.Is(`Ident`) && m[\"args\"].Const", - Args: []ir.FilterExpr{ - { - Line: 33, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"f\"].Node.Is(`Ident`)", - Value: "f", - Args: []ir.FilterExpr{{Line: 33, Op: ir.FilterStringOp, Src: "`Ident`", Value: "Ident"}}, - }, - { - Line: 33, - Op: ir.FilterVarConstOp, - Src: "m[\"args\"].Const", - Value: "args", - }, - }, - }, - { - Line: 33, - Op: ir.FilterVarObjectIsOp, - Src: "m[\"pkg\"].Object.Is(`PkgName`)", - Value: "pkg", - Args: []ir.FilterExpr{{Line: 33, Op: ir.FilterStringOp, Src: "`PkgName`", Value: "PkgName"}}, - }, - }, - }, - }, - }, - }, - { - Line: 41, - Name: "badLock", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects suspicious mutex lock/unlock operations", - DocBefore: "mu.Lock(); mu.Unlock()", - DocAfter: "mu.Lock(); defer mu.Unlock()", - Rules: []ir.Rule{ - { - Line: 45, - SyntaxPatterns: []ir.PatternString{{Line: 45, Value: "$mu1.Lock(); $mu2.Unlock()"}}, - ReportTemplate: "defer is missing, mutex is unlocked immediately", - WhereExpr: ir.FilterExpr{ - Line: 46, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 46, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 46, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - { - Line: 50, - SyntaxPatterns: []ir.PatternString{{Line: 50, Value: "$mu1.RLock(); $mu2.RUnlock()"}}, - ReportTemplate: "defer is missing, mutex is unlocked immediately", - WhereExpr: ir.FilterExpr{ - Line: 51, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 51, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 51, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - { - Line: 56, - SyntaxPatterns: []ir.PatternString{{Line: 56, Value: "$mu1.Lock(); defer $mu2.RUnlock()"}}, - ReportTemplate: "suspicious unlock, maybe Unlock was intended?", - WhereExpr: ir.FilterExpr{ - Line: 57, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 57, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 57, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - { - Line: 61, - SyntaxPatterns: []ir.PatternString{{Line: 61, Value: "$mu1.RLock(); defer $mu2.Unlock()"}}, - ReportTemplate: "suspicious unlock, maybe RUnlock was intended?", - WhereExpr: ir.FilterExpr{ - Line: 62, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 62, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 62, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - { - Line: 67, - SyntaxPatterns: []ir.PatternString{{Line: 67, Value: "$mu1.Lock(); defer $mu2.Lock()"}}, - ReportTemplate: "maybe defer $mu1.Unlock() was intended?", - WhereExpr: ir.FilterExpr{ - Line: 68, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 68, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 68, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - { - Line: 72, - SyntaxPatterns: []ir.PatternString{{Line: 72, Value: "$mu1.RLock(); defer $mu2.RLock()"}}, - ReportTemplate: "maybe defer $mu1.RUnlock() was intended?", - WhereExpr: ir.FilterExpr{ - Line: 73, - Op: ir.FilterEqOp, - Src: "m[\"mu1\"].Text == m[\"mu2\"].Text", - Args: []ir.FilterExpr{ - {Line: 73, Op: ir.FilterVarTextOp, Src: "m[\"mu1\"].Text", Value: "mu1"}, - {Line: 73, Op: ir.FilterVarTextOp, Src: "m[\"mu2\"].Text", Value: "mu2"}, - }, - }, - LocationVar: "mu2", - }, - }, - }, - { - Line: 82, - Name: "httpNoBody", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects nil usages in http.NewRequest calls, suggesting http.NoBody as an alternative", - DocBefore: "http.NewRequest(\"GET\", url, nil)", - DocAfter: "http.NewRequest(\"GET\", url, http.NoBody)", - Rules: []ir.Rule{ - { - Line: 83, - SyntaxPatterns: []ir.PatternString{{Line: 83, Value: "http.NewRequest($method, $url, $nil)"}}, - ReportTemplate: "http.NoBody should be preferred to the nil request body", - SuggestTemplate: "http.NewRequest($method, $url, http.NoBody)", - WhereExpr: ir.FilterExpr{ - Line: 84, - Op: ir.FilterEqOp, - Src: "m[\"nil\"].Text == \"nil\"", - Args: []ir.FilterExpr{ - {Line: 84, Op: ir.FilterVarTextOp, Src: "m[\"nil\"].Text", Value: "nil"}, - {Line: 84, Op: ir.FilterStringOp, Src: "\"nil\"", Value: "nil"}, - }, - }, - }, - { - Line: 88, - SyntaxPatterns: []ir.PatternString{{Line: 88, Value: "http.NewRequestWithContext($ctx, $method, $url, $nil)"}}, - ReportTemplate: "http.NoBody should be preferred to the nil request body", - SuggestTemplate: "http.NewRequestWithContext($ctx, $method, $url, http.NoBody)", - WhereExpr: ir.FilterExpr{ - Line: 89, - Op: ir.FilterEqOp, - Src: "m[\"nil\"].Text == \"nil\"", - Args: []ir.FilterExpr{ - {Line: 89, Op: ir.FilterVarTextOp, Src: "m[\"nil\"].Text", Value: "nil"}, - {Line: 89, Op: ir.FilterStringOp, Src: "\"nil\"", Value: "nil"}, - }, - }, - }, - { - Line: 93, - SyntaxPatterns: []ir.PatternString{{Line: 93, Value: "httptest.NewRequest($method, $url, $nil)"}}, - ReportTemplate: "http.NoBody should be preferred to the nil request body", - SuggestTemplate: "httptest.NewRequest($method, $url, http.NoBody)", - WhereExpr: ir.FilterExpr{ - Line: 94, - Op: ir.FilterEqOp, - Src: "m[\"nil\"].Text == \"nil\"", - Args: []ir.FilterExpr{ - {Line: 94, Op: ir.FilterVarTextOp, Src: "m[\"nil\"].Text", Value: "nil"}, - {Line: 94, Op: ir.FilterStringOp, Src: "\"nil\"", Value: "nil"}, - }, - }, - }, - }, - }, - { - Line: 104, - Name: "preferDecodeRune", - MatcherName: "m", - DocTags: []string{"performance", "experimental"}, - DocSummary: "Detects expressions like []rune(s)[0] that may cause unwanted rune slice allocation", - DocBefore: "r := []rune(s)[0]", - DocAfter: "r, _ := utf8.DecodeRuneInString(s)", - DocNote: "See Go issue for details: https://github.com/golang/go/issues/45260", - Rules: []ir.Rule{{ - Line: 105, - SyntaxPatterns: []ir.PatternString{{Line: 105, Value: "[]rune($s)[0]"}}, - ReportTemplate: "consider replacing $$ with utf8.DecodeRuneInString($s)", - WhereExpr: ir.FilterExpr{ - Line: 106, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 106, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }}, - }, - { - Line: 114, - Name: "sloppyLen", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects usage of `len` when result is obvious or doesn't make sense", - DocBefore: "len(arr) <= 0", - DocAfter: "len(arr) == 0", - Rules: []ir.Rule{ - { - Line: 115, - SyntaxPatterns: []ir.PatternString{{Line: 115, Value: "len($_) >= 0"}}, - ReportTemplate: "$$ is always true", - }, - { - Line: 116, - SyntaxPatterns: []ir.PatternString{{Line: 116, Value: "len($_) < 0"}}, - ReportTemplate: "$$ is always false", - }, - { - Line: 117, - SyntaxPatterns: []ir.PatternString{{Line: 117, Value: "len($x) <= 0"}}, - ReportTemplate: "$$ can be len($x) == 0", - }, - }, - }, - { - Line: 124, - Name: "valSwap", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects value swapping code that are not using parallel assignment", - DocBefore: "*tmp = *x; *x = *y; *y = *tmp", - DocAfter: "*x, *y = *y, *x", - Rules: []ir.Rule{{ - Line: 125, - SyntaxPatterns: []ir.PatternString{{Line: 125, Value: "$tmp := $y; $y = $x; $x = $tmp"}}, - ReportTemplate: "can re-write as `$y, $x = $x, $y`", - }}, - }, - { - Line: 133, - Name: "switchTrue", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects switch-over-bool statements that use explicit `true` tag value", - DocBefore: "switch true {...}", - DocAfter: "switch {...}", - Rules: []ir.Rule{ - { - Line: 134, - SyntaxPatterns: []ir.PatternString{{Line: 134, Value: "switch true { $*_ }"}}, - ReportTemplate: "replace 'switch true {}' with 'switch {}'", - }, - { - Line: 136, - SyntaxPatterns: []ir.PatternString{{Line: 136, Value: "switch $x; true { $*_ }"}}, - ReportTemplate: "replace 'switch $x; true {}' with 'switch $x; {}'", - }, - }, - }, - { - Line: 144, - Name: "flagDeref", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects immediate dereferencing of `flag` package pointers", - DocBefore: "b := *flag.Bool(\"b\", false, \"b docs\")", - DocAfter: "var b bool; flag.BoolVar(&b, \"b\", false, \"b docs\")", - Rules: []ir.Rule{ - { - Line: 145, - SyntaxPatterns: []ir.PatternString{{Line: 145, Value: "*flag.Bool($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.BoolVar", - }, - { - Line: 146, - SyntaxPatterns: []ir.PatternString{{Line: 146, Value: "*flag.Duration($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.DurationVar", - }, - { - Line: 147, - SyntaxPatterns: []ir.PatternString{{Line: 147, Value: "*flag.Float64($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.Float64Var", - }, - { - Line: 148, - SyntaxPatterns: []ir.PatternString{{Line: 148, Value: "*flag.Int($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.IntVar", - }, - { - Line: 149, - SyntaxPatterns: []ir.PatternString{{Line: 149, Value: "*flag.Int64($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.Int64Var", - }, - { - Line: 150, - SyntaxPatterns: []ir.PatternString{{Line: 150, Value: "*flag.String($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.StringVar", - }, - { - Line: 151, - SyntaxPatterns: []ir.PatternString{{Line: 151, Value: "*flag.Uint($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.UintVar", - }, - { - Line: 152, - SyntaxPatterns: []ir.PatternString{{Line: 152, Value: "*flag.Uint64($*_)"}}, - ReportTemplate: "immediate deref in $$ is most likely an error; consider using flag.Uint64Var", - }, - }, - }, - { - Line: 159, - Name: "emptyStringTest", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects empty string checks that can be written more idiomatically", - DocBefore: "len(s) == 0", - DocAfter: "s == \"\"", - Rules: []ir.Rule{ - { - Line: 160, - SyntaxPatterns: []ir.PatternString{{Line: 160, Value: "len($s) != 0"}}, - ReportTemplate: "replace `$$` with `$s != \"\"`", - WhereExpr: ir.FilterExpr{ - Line: 161, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 161, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - { - Line: 163, - SyntaxPatterns: []ir.PatternString{{Line: 163, Value: "len($s) > 0"}}, - ReportTemplate: "replace `$$` with `$s != \"\"`", - WhereExpr: ir.FilterExpr{ - Line: 164, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 164, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - { - Line: 167, - SyntaxPatterns: []ir.PatternString{{Line: 167, Value: "len($s) == 0"}}, - ReportTemplate: "replace `$$` with `$s == \"\"`", - WhereExpr: ir.FilterExpr{ - Line: 168, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 168, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - { - Line: 170, - SyntaxPatterns: []ir.PatternString{{Line: 170, Value: "len($s) <= 0"}}, - ReportTemplate: "replace `$$` with `$s == \"\"`", - WhereExpr: ir.FilterExpr{ - Line: 171, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 171, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }, - { - Line: 179, - Name: "stringXbytes", - MatcherName: "m", - DocTags: []string{"performance"}, - DocSummary: "Detects redundant conversions between string and []byte", - DocBefore: "copy(b, []byte(s))", - DocAfter: "copy(b, s)", - Rules: []ir.Rule{ - { - Line: 180, - SyntaxPatterns: []ir.PatternString{{Line: 180, Value: "copy($_, []byte($s))"}}, - ReportTemplate: "can simplify `[]byte($s)` to `$s`", - }, - { - Line: 182, - SyntaxPatterns: []ir.PatternString{{Line: 182, Value: "string($b) == \"\""}}, - ReportTemplate: "suggestion: len($b) == 0", - SuggestTemplate: "len($b) == 0", - WhereExpr: ir.FilterExpr{ - Line: 182, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"b\"].Type.Is(`[]byte`)", - Value: "b", - Args: []ir.FilterExpr{{Line: 182, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - }, - { - Line: 183, - SyntaxPatterns: []ir.PatternString{{Line: 183, Value: "string($b) != \"\""}}, - ReportTemplate: "suggestion: len($b) != 0", - SuggestTemplate: "len($b) != 0", - WhereExpr: ir.FilterExpr{ - Line: 183, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"b\"].Type.Is(`[]byte`)", - Value: "b", - Args: []ir.FilterExpr{{Line: 183, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - }, - { - Line: 185, - SyntaxPatterns: []ir.PatternString{{Line: 185, Value: "len(string($b))"}}, - ReportTemplate: "suggestion: len($b)", - SuggestTemplate: "len($b)", - WhereExpr: ir.FilterExpr{ - Line: 185, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"b\"].Type.Is(`[]byte`)", - Value: "b", - Args: []ir.FilterExpr{{Line: 185, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - }, - { - Line: 187, - SyntaxPatterns: []ir.PatternString{{Line: 187, Value: "string($x) == string($y)"}}, - ReportTemplate: "suggestion: bytes.Equal($x, $y)", - SuggestTemplate: "bytes.Equal($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 188, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Type.Is(`[]byte`) && m[\"y\"].Type.Is(`[]byte`)", - Args: []ir.FilterExpr{ - { - Line: 188, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]byte`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 188, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - { - Line: 188, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"y\"].Type.Is(`[]byte`)", - Value: "y", - Args: []ir.FilterExpr{{Line: 188, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - }, - }, - }, - { - Line: 191, - SyntaxPatterns: []ir.PatternString{{Line: 191, Value: "string($x) != string($y)"}}, - ReportTemplate: "suggestion: !bytes.Equal($x, $y)", - SuggestTemplate: "!bytes.Equal($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 192, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Type.Is(`[]byte`) && m[\"y\"].Type.Is(`[]byte`)", - Args: []ir.FilterExpr{ - { - Line: 192, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]byte`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 192, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - { - Line: 192, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"y\"].Type.Is(`[]byte`)", - Value: "y", - Args: []ir.FilterExpr{{Line: 192, Op: ir.FilterStringOp, Src: "`[]byte`", Value: "[]byte"}}, - }, - }, - }, - }, - { - Line: 195, - SyntaxPatterns: []ir.PatternString{{Line: 195, Value: "$re.Match([]byte($s))"}}, - ReportTemplate: "suggestion: $re.MatchString($s)", - SuggestTemplate: "$re.MatchString($s)", - WhereExpr: ir.FilterExpr{ - Line: 196, - Op: ir.FilterAndOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`) && m[\"s\"].Type.Is(`string`)", - Args: []ir.FilterExpr{ - { - Line: 196, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`)", - Value: "re", - Args: []ir.FilterExpr{{Line: 196, Op: ir.FilterStringOp, Src: "`*regexp.Regexp`", Value: "*regexp.Regexp"}}, - }, - { - Line: 196, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 196, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }, - { - Line: 199, - SyntaxPatterns: []ir.PatternString{{Line: 199, Value: "$re.FindIndex([]byte($s))"}}, - ReportTemplate: "suggestion: $re.FindStringIndex($s)", - SuggestTemplate: "$re.FindStringIndex($s)", - WhereExpr: ir.FilterExpr{ - Line: 200, - Op: ir.FilterAndOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`) && m[\"s\"].Type.Is(`string`)", - Args: []ir.FilterExpr{ - { - Line: 200, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`)", - Value: "re", - Args: []ir.FilterExpr{{Line: 200, Op: ir.FilterStringOp, Src: "`*regexp.Regexp`", Value: "*regexp.Regexp"}}, - }, - { - Line: 200, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 200, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }, - { - Line: 203, - SyntaxPatterns: []ir.PatternString{{Line: 203, Value: "$re.FindAllIndex([]byte($s), $n)"}}, - ReportTemplate: "suggestion: $re.FindAllStringIndex($s, $n)", - SuggestTemplate: "$re.FindAllStringIndex($s, $n)", - WhereExpr: ir.FilterExpr{ - Line: 204, - Op: ir.FilterAndOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`) && m[\"s\"].Type.Is(`string`)", - Args: []ir.FilterExpr{ - { - Line: 204, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"re\"].Type.Is(`*regexp.Regexp`)", - Value: "re", - Args: []ir.FilterExpr{{Line: 204, Op: ir.FilterStringOp, Src: "`*regexp.Regexp`", Value: "*regexp.Regexp"}}, - }, - { - Line: 204, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 204, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }, - }, - }, - { - Line: 213, - Name: "indexAlloc", - MatcherName: "m", - DocTags: []string{"performance"}, - DocSummary: "Detects strings.Index calls that may cause unwanted allocs", - DocBefore: "strings.Index(string(x), y)", - DocAfter: "bytes.Index(x, []byte(y))", - DocNote: "See Go issue for details: https://github.com/golang/go/issues/25864", - Rules: []ir.Rule{{ - Line: 214, - SyntaxPatterns: []ir.PatternString{{Line: 214, Value: "strings.Index(string($x), $y)"}}, - ReportTemplate: "consider replacing $$ with bytes.Index($x, []byte($y))", - WhereExpr: ir.FilterExpr{ - Line: 215, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure", - Args: []ir.FilterExpr{ - {Line: 215, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - {Line: 215, Op: ir.FilterVarPureOp, Src: "m[\"y\"].Pure", Value: "y"}, - }, - }, - }}, - }, - { - Line: 223, - Name: "wrapperFunc", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects function calls that can be replaced with convenience wrappers", - DocBefore: "wg.Add(-1)", - DocAfter: "wg.Done()", - Rules: []ir.Rule{ - { - Line: 224, - SyntaxPatterns: []ir.PatternString{{Line: 224, Value: "$wg.Add(-1)"}}, - ReportTemplate: "use WaitGroup.Done method in `$$`", - WhereExpr: ir.FilterExpr{ - Line: 225, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"wg\"].Type.Is(`sync.WaitGroup`)", - Value: "wg", - Args: []ir.FilterExpr{{Line: 225, Op: ir.FilterStringOp, Src: "`sync.WaitGroup`", Value: "sync.WaitGroup"}}, - }, - }, - { - Line: 228, - SyntaxPatterns: []ir.PatternString{{Line: 228, Value: "$buf.Truncate(0)"}}, - ReportTemplate: "use Buffer.Reset method in `$$`", - WhereExpr: ir.FilterExpr{ - Line: 229, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"buf\"].Type.Is(`bytes.Buffer`)", - Value: "buf", - Args: []ir.FilterExpr{{Line: 229, Op: ir.FilterStringOp, Src: "`bytes.Buffer`", Value: "bytes.Buffer"}}, - }, - }, - { - Line: 232, - SyntaxPatterns: []ir.PatternString{{Line: 232, Value: "http.HandlerFunc(http.NotFound)"}}, - ReportTemplate: "use http.NotFoundHandler method in `$$`", - }, - { - Line: 234, - SyntaxPatterns: []ir.PatternString{{Line: 234, Value: "strings.SplitN($_, $_, -1)"}}, - ReportTemplate: "use strings.Split method in `$$`", - }, - { - Line: 235, - SyntaxPatterns: []ir.PatternString{{Line: 235, Value: "strings.Replace($_, $_, $_, -1)"}}, - ReportTemplate: "use strings.ReplaceAll method in `$$`", - }, - { - Line: 236, - SyntaxPatterns: []ir.PatternString{{Line: 236, Value: "strings.Map(unicode.ToTitle, $_)"}}, - ReportTemplate: "use strings.ToTitle method in `$$`", - }, - { - Line: 237, - SyntaxPatterns: []ir.PatternString{ - {Line: 237, Value: "strings.Index($s1, $s2) >= 0"}, - {Line: 237, Value: "strings.Index($s1, $s2) != -1"}, - }, - ReportTemplate: "suggestion: strings.Contains($s1, $s2)", - SuggestTemplate: "strings.Contains($s1, $s2)", - }, - { - Line: 238, - SyntaxPatterns: []ir.PatternString{ - {Line: 238, Value: "strings.IndexAny($s1, $s2) >= 0"}, - {Line: 238, Value: "strings.IndexAny($s1, $s2) != -1"}, - }, - ReportTemplate: "suggestion: strings.ContainsAny($s1, $s2)", - SuggestTemplate: "strings.ContainsAny($s1, $s2)", - }, - { - Line: 239, - SyntaxPatterns: []ir.PatternString{ - {Line: 239, Value: "strings.IndexRune($s1, $s2) >= 0"}, - {Line: 239, Value: "strings.IndexRune($s1, $s2) != -1"}, - }, - ReportTemplate: "suggestion: strings.ContainsRune($s1, $s2)", - SuggestTemplate: "strings.ContainsRune($s1, $s2)", - }, - { - Line: 241, - SyntaxPatterns: []ir.PatternString{ - {Line: 241, Value: "$i := strings.Index($s, $sep); $*_; $x, $y = $s[:$i], $s[$i+1:]"}, - {Line: 242, Value: "$i := strings.Index($s, $sep); $*_; $x = $s[:$i]; $*_; $y = $s[$i+1:]"}, - }, - ReportTemplate: "suggestion: $x, $y, _ = strings.Cut($s, $sep)", - SuggestTemplate: "$x, $y, _ = strings.Cut($s, $sep)", - WhereExpr: ir.FilterExpr{ - Line: 243, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.18\")", - Value: "1.18", - }, - }, - { - Line: 246, - SyntaxPatterns: []ir.PatternString{ - {Line: 247, Value: "if $i := strings.Index($s, $sep); $i != -1 { $*_; $x, $y = $s[:$i], $s[$i+1:]; $*_ }"}, - {Line: 248, Value: "if $i := strings.Index($s, $sep); $i != -1 { $*_; $x = $s[:$i]; $*_; $y = $s[$i+1:]; $*_ }"}, - {Line: 249, Value: "if $i := strings.Index($s, $sep); $i >= 0 { $*_; $x, $y = $s[:$i], $s[$i+1:]; $*_ }"}, - {Line: 250, Value: "if $i := strings.Index($s, $sep); $i >= 0 { $*_; $x = $s[:$i]; $*_; $y = $s[$i+1:]; $*_ }"}, - }, - ReportTemplate: "suggestion: if $x, $y, ok = strings.Cut($s, $sep); ok { ... }", - SuggestTemplate: "if $x, $y, ok = strings.Cut($s, $sep); ok { ... }", - WhereExpr: ir.FilterExpr{ - Line: 251, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.18\")", - Value: "1.18", - }, - }, - { - Line: 254, - SyntaxPatterns: []ir.PatternString{{Line: 254, Value: "bytes.SplitN(b, []byte(\".\"), -1)"}}, - ReportTemplate: "use bytes.Split method in `$$`", - }, - { - Line: 255, - SyntaxPatterns: []ir.PatternString{{Line: 255, Value: "bytes.Replace($_, $_, $_, -1)"}}, - ReportTemplate: "use bytes.ReplaceAll method in `$$`", - }, - { - Line: 256, - SyntaxPatterns: []ir.PatternString{{Line: 256, Value: "bytes.Map(unicode.ToUpper, $_)"}}, - ReportTemplate: "use bytes.ToUpper method in `$$`", - }, - { - Line: 257, - SyntaxPatterns: []ir.PatternString{{Line: 257, Value: "bytes.Map(unicode.ToLower, $_)"}}, - ReportTemplate: "use bytes.ToLower method in `$$`", - }, - { - Line: 258, - SyntaxPatterns: []ir.PatternString{{Line: 258, Value: "bytes.Map(unicode.ToTitle, $_)"}}, - ReportTemplate: "use bytes.ToTitle method in `$$`", - }, - { - Line: 259, - SyntaxPatterns: []ir.PatternString{ - {Line: 259, Value: "bytes.Index($b1, $b2) >= 0"}, - {Line: 259, Value: "bytes.Index($b1, $b2) != -1"}, - }, - ReportTemplate: "suggestion: bytes.Contains($b1, $b2)", - SuggestTemplate: "bytes.Contains($b1, $b2)", - }, - { - Line: 260, - SyntaxPatterns: []ir.PatternString{ - {Line: 260, Value: "bytes.IndexAny($b1, $b2) >= 0"}, - {Line: 260, Value: "bytes.IndexAny($b1, $b2) != -1"}, - }, - ReportTemplate: "suggestion: bytes.ContainsAny($b1, $b2)", - SuggestTemplate: "bytes.ContainsAny($b1, $b2)", - }, - { - Line: 261, - SyntaxPatterns: []ir.PatternString{ - {Line: 261, Value: "bytes.IndexRune($b1, $b2) >= 0"}, - {Line: 261, Value: "bytes.IndexRune($b1, $b2) != -1"}, - }, - ReportTemplate: "suggestion: bytes.ContainsRune($b1, $b2)", - SuggestTemplate: "bytes.ContainsRune($b1, $b2)", - }, - { - Line: 263, - SyntaxPatterns: []ir.PatternString{{Line: 263, Value: "draw.DrawMask($_, $_, $_, $_, nil, image.Point{}, $_)"}}, - ReportTemplate: "use draw.Draw method in `$$`", - }, - }, - }, - { - Line: 271, - Name: "regexpMust", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects `regexp.Compile*` that can be replaced with `regexp.MustCompile*`", - DocBefore: "re, _ := regexp.Compile(\"const pattern\")", - DocAfter: "re := regexp.MustCompile(\"const pattern\")", - Rules: []ir.Rule{ - { - Line: 272, - SyntaxPatterns: []ir.PatternString{{Line: 272, Value: "regexp.Compile($pat)"}}, - ReportTemplate: "for const patterns like $pat, use regexp.MustCompile", - WhereExpr: ir.FilterExpr{ - Line: 273, - Op: ir.FilterVarConstOp, - Src: "m[\"pat\"].Const", - Value: "pat", - }, - }, - { - Line: 276, - SyntaxPatterns: []ir.PatternString{{Line: 276, Value: "regexp.CompilePOSIX($pat)"}}, - ReportTemplate: "for const patterns like $pat, use regexp.MustCompilePOSIX", - WhereExpr: ir.FilterExpr{ - Line: 277, - Op: ir.FilterVarConstOp, - Src: "m[\"pat\"].Const", - Value: "pat", - }, - }, - }, - }, - { - Line: 285, - Name: "badCall", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects suspicious function calls", - DocBefore: "strings.Replace(s, from, to, 0)", - DocAfter: "strings.Replace(s, from, to, -1)", - Rules: []ir.Rule{ - { - Line: 286, - SyntaxPatterns: []ir.PatternString{{Line: 286, Value: "strings.Replace($_, $_, $_, $zero)"}}, - ReportTemplate: "suspicious arg 0, probably meant -1", - WhereExpr: ir.FilterExpr{ - Line: 287, - Op: ir.FilterEqOp, - Src: "m[\"zero\"].Value.Int() == 0", - Args: []ir.FilterExpr{ - { - Line: 287, - Op: ir.FilterVarValueIntOp, - Src: "m[\"zero\"].Value.Int()", - Value: "zero", - }, - { - Line: 287, - Op: ir.FilterIntOp, - Src: "0", - Value: int64(0), - }, - }, - }, - LocationVar: "zero", - }, - { - Line: 289, - SyntaxPatterns: []ir.PatternString{{Line: 289, Value: "bytes.Replace($_, $_, $_, $zero)"}}, - ReportTemplate: "suspicious arg 0, probably meant -1", - WhereExpr: ir.FilterExpr{ - Line: 290, - Op: ir.FilterEqOp, - Src: "m[\"zero\"].Value.Int() == 0", - Args: []ir.FilterExpr{ - { - Line: 290, - Op: ir.FilterVarValueIntOp, - Src: "m[\"zero\"].Value.Int()", - Value: "zero", - }, - { - Line: 290, - Op: ir.FilterIntOp, - Src: "0", - Value: int64(0), - }, - }, - }, - LocationVar: "zero", - }, - { - Line: 293, - SyntaxPatterns: []ir.PatternString{{Line: 293, Value: "strings.SplitN($_, $_, $zero)"}}, - ReportTemplate: "suspicious arg 0, probably meant -1", - WhereExpr: ir.FilterExpr{ - Line: 294, - Op: ir.FilterEqOp, - Src: "m[\"zero\"].Value.Int() == 0", - Args: []ir.FilterExpr{ - { - Line: 294, - Op: ir.FilterVarValueIntOp, - Src: "m[\"zero\"].Value.Int()", - Value: "zero", - }, - { - Line: 294, - Op: ir.FilterIntOp, - Src: "0", - Value: int64(0), - }, - }, - }, - LocationVar: "zero", - }, - { - Line: 296, - SyntaxPatterns: []ir.PatternString{{Line: 296, Value: "bytes.SplitN($_, $_, $zero)"}}, - ReportTemplate: "suspicious arg 0, probably meant -1", - WhereExpr: ir.FilterExpr{ - Line: 297, - Op: ir.FilterEqOp, - Src: "m[\"zero\"].Value.Int() == 0", - Args: []ir.FilterExpr{ - { - Line: 297, - Op: ir.FilterVarValueIntOp, - Src: "m[\"zero\"].Value.Int()", - Value: "zero", - }, - { - Line: 297, - Op: ir.FilterIntOp, - Src: "0", - Value: int64(0), - }, - }, - }, - LocationVar: "zero", - }, - { - Line: 300, - SyntaxPatterns: []ir.PatternString{{Line: 300, Value: "append($_)"}}, - ReportTemplate: "no-op append call, probably missing arguments", - }, - { - Line: 302, - SyntaxPatterns: []ir.PatternString{{Line: 302, Value: "filepath.Join($_)"}}, - ReportTemplate: "suspicious Join on 1 argument", - }, - }, - }, - { - Line: 309, - Name: "assignOp", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects assignments that can be simplified by using assignment operators", - DocBefore: "x = x * 2", - DocAfter: "x *= 2", - Rules: []ir.Rule{ - { - Line: 310, - SyntaxPatterns: []ir.PatternString{{Line: 310, Value: "$x = $x + 1"}}, - ReportTemplate: "replace `$$` with `$x++`", - WhereExpr: ir.FilterExpr{Line: 310, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 311, - SyntaxPatterns: []ir.PatternString{{Line: 311, Value: "$x = $x - 1"}}, - ReportTemplate: "replace `$$` with `$x--`", - WhereExpr: ir.FilterExpr{Line: 311, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 313, - SyntaxPatterns: []ir.PatternString{{Line: 313, Value: "$x = $x + $y"}}, - ReportTemplate: "replace `$$` with `$x += $y`", - WhereExpr: ir.FilterExpr{Line: 313, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 314, - SyntaxPatterns: []ir.PatternString{{Line: 314, Value: "$x = $x - $y"}}, - ReportTemplate: "replace `$$` with `$x -= $y`", - WhereExpr: ir.FilterExpr{Line: 314, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 316, - SyntaxPatterns: []ir.PatternString{{Line: 316, Value: "$x = $x * $y"}}, - ReportTemplate: "replace `$$` with `$x *= $y`", - WhereExpr: ir.FilterExpr{Line: 316, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 317, - SyntaxPatterns: []ir.PatternString{{Line: 317, Value: "$x = $x / $y"}}, - ReportTemplate: "replace `$$` with `$x /= $y`", - WhereExpr: ir.FilterExpr{Line: 317, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 318, - SyntaxPatterns: []ir.PatternString{{Line: 318, Value: "$x = $x % $y"}}, - ReportTemplate: "replace `$$` with `$x %= $y`", - WhereExpr: ir.FilterExpr{Line: 318, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 319, - SyntaxPatterns: []ir.PatternString{{Line: 319, Value: "$x = $x & $y"}}, - ReportTemplate: "replace `$$` with `$x &= $y`", - WhereExpr: ir.FilterExpr{Line: 319, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 320, - SyntaxPatterns: []ir.PatternString{{Line: 320, Value: "$x = $x | $y"}}, - ReportTemplate: "replace `$$` with `$x |= $y`", - WhereExpr: ir.FilterExpr{Line: 320, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 321, - SyntaxPatterns: []ir.PatternString{{Line: 321, Value: "$x = $x ^ $y"}}, - ReportTemplate: "replace `$$` with `$x ^= $y`", - WhereExpr: ir.FilterExpr{Line: 321, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 322, - SyntaxPatterns: []ir.PatternString{{Line: 322, Value: "$x = $x << $y"}}, - ReportTemplate: "replace `$$` with `$x <<= $y`", - WhereExpr: ir.FilterExpr{Line: 322, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 323, - SyntaxPatterns: []ir.PatternString{{Line: 323, Value: "$x = $x >> $y"}}, - ReportTemplate: "replace `$$` with `$x >>= $y`", - WhereExpr: ir.FilterExpr{Line: 323, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 324, - SyntaxPatterns: []ir.PatternString{{Line: 324, Value: "$x = $x &^ $y"}}, - ReportTemplate: "replace `$$` with `$x &^= $y`", - WhereExpr: ir.FilterExpr{Line: 324, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - }, - }, - { - Line: 331, - Name: "preferWriteByte", - MatcherName: "m", - DocTags: []string{"performance", "experimental", "opinionated"}, - DocSummary: "Detects WriteRune calls with rune literal argument that is single byte and reports to use WriteByte instead", - DocBefore: "w.WriteRune('\\n')", - DocAfter: "w.WriteByte('\\n')", - Rules: []ir.Rule{{ - Line: 335, - SyntaxPatterns: []ir.PatternString{{Line: 335, Value: "$w.WriteRune($c)"}}, - ReportTemplate: "consider writing single byte rune $c with $w.WriteByte($c)", - WhereExpr: ir.FilterExpr{ - Line: 336, - Op: ir.FilterAndOp, - Src: "m[\"w\"].Type.Implements(\"io.ByteWriter\") && (m[\"c\"].Const && m[\"c\"].Value.Int() < runeSelf)", - Args: []ir.FilterExpr{ - { - Line: 336, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.ByteWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 336, Op: ir.FilterStringOp, Src: "\"io.ByteWriter\"", Value: "io.ByteWriter"}}, - }, - { - Line: 336, - Op: ir.FilterAndOp, - Src: "(m[\"c\"].Const && m[\"c\"].Value.Int() < runeSelf)", - Args: []ir.FilterExpr{ - { - Line: 336, - Op: ir.FilterVarConstOp, - Src: "m[\"c\"].Const", - Value: "c", - }, - { - Line: 336, - Op: ir.FilterLtOp, - Src: "m[\"c\"].Value.Int() < runeSelf", - Args: []ir.FilterExpr{ - { - Line: 336, - Op: ir.FilterVarValueIntOp, - Src: "m[\"c\"].Value.Int()", - Value: "c", - }, - { - Line: 336, - Op: ir.FilterIntOp, - Src: "runeSelf", - Value: int64(128), - }, - }, - }, - }, - }, - }, - }, - }}, - }, - { - Line: 344, - Name: "preferFprint", - MatcherName: "m", - DocTags: []string{"performance", "experimental"}, - DocSummary: "Detects fmt.Sprint(f/ln) calls which can be replaced with fmt.Fprint(f/ln)", - DocBefore: "w.Write([]byte(fmt.Sprintf(\"%x\", 10)))", - DocAfter: "fmt.Fprintf(w, \"%x\", 10)", - Rules: []ir.Rule{ - { - Line: 345, - SyntaxPatterns: []ir.PatternString{{Line: 345, Value: "$w.Write([]byte(fmt.Sprint($*args)))"}}, - ReportTemplate: "fmt.Fprint($w, $args) should be preferred to the $$", - SuggestTemplate: "fmt.Fprint($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 346, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 346, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - }, - { - Line: 350, - SyntaxPatterns: []ir.PatternString{{Line: 350, Value: "$w.Write([]byte(fmt.Sprintf($*args)))"}}, - ReportTemplate: "fmt.Fprintf($w, $args) should be preferred to the $$", - SuggestTemplate: "fmt.Fprintf($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 351, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 351, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - }, - { - Line: 355, - SyntaxPatterns: []ir.PatternString{{Line: 355, Value: "$w.Write([]byte(fmt.Sprintln($*args)))"}}, - ReportTemplate: "fmt.Fprintln($w, $args) should be preferred to the $$", - SuggestTemplate: "fmt.Fprintln($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 356, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 356, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - }, - { - Line: 360, - SyntaxPatterns: []ir.PatternString{{Line: 360, Value: "io.WriteString($w, fmt.Sprint($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprint($w, $args)", - SuggestTemplate: "fmt.Fprint($w, $args)", - }, - { - Line: 361, - SyntaxPatterns: []ir.PatternString{{Line: 361, Value: "io.WriteString($w, fmt.Sprintf($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprintf($w, $args)", - SuggestTemplate: "fmt.Fprintf($w, $args)", - }, - { - Line: 362, - SyntaxPatterns: []ir.PatternString{{Line: 362, Value: "io.WriteString($w, fmt.Sprintln($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprintln($w, $args)", - SuggestTemplate: "fmt.Fprintln($w, $args)", - }, - { - Line: 364, - SyntaxPatterns: []ir.PatternString{{Line: 364, Value: "$w.WriteString(fmt.Sprint($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprint($w, $args)", - SuggestTemplate: "fmt.Fprint($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 365, - Op: ir.FilterAndOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\") && m[\"w\"].Type.Implements(\"io.StringWriter\")", - Args: []ir.FilterExpr{ - { - Line: 365, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 365, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - { - Line: 365, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.StringWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 365, Op: ir.FilterStringOp, Src: "\"io.StringWriter\"", Value: "io.StringWriter"}}, - }, - }, - }, - }, - { - Line: 367, - SyntaxPatterns: []ir.PatternString{{Line: 367, Value: "$w.WriteString(fmt.Sprintf($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprintf($w, $args)", - SuggestTemplate: "fmt.Fprintf($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 368, - Op: ir.FilterAndOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\") && m[\"w\"].Type.Implements(\"io.StringWriter\")", - Args: []ir.FilterExpr{ - { - Line: 368, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 368, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - { - Line: 368, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.StringWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 368, Op: ir.FilterStringOp, Src: "\"io.StringWriter\"", Value: "io.StringWriter"}}, - }, - }, - }, - }, - { - Line: 370, - SyntaxPatterns: []ir.PatternString{{Line: 370, Value: "$w.WriteString(fmt.Sprintln($*args))"}}, - ReportTemplate: "suggestion: fmt.Fprintln($w, $args)", - SuggestTemplate: "fmt.Fprintln($w, $args)", - WhereExpr: ir.FilterExpr{ - Line: 371, - Op: ir.FilterAndOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\") && m[\"w\"].Type.Implements(\"io.StringWriter\")", - Args: []ir.FilterExpr{ - { - Line: 371, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.Writer\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 371, Op: ir.FilterStringOp, Src: "\"io.Writer\"", Value: "io.Writer"}}, - }, - { - Line: 371, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.StringWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 371, Op: ir.FilterStringOp, Src: "\"io.StringWriter\"", Value: "io.StringWriter"}}, - }, - }, - }, - }, - }, - }, - { - Line: 379, - Name: "dupArg", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects suspicious duplicated arguments", - DocBefore: "copy(dst, dst)", - DocAfter: "copy(dst, src)", - Rules: []ir.Rule{ - { - Line: 380, - SyntaxPatterns: []ir.PatternString{ - {Line: 380, Value: "$x.Equal($x)"}, - {Line: 380, Value: "$x.Equals($x)"}, - {Line: 380, Value: "$x.Compare($x)"}, - {Line: 380, Value: "$x.Cmp($x)"}, - }, - ReportTemplate: "suspicious method call with the same argument and receiver", - WhereExpr: ir.FilterExpr{Line: 381, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - { - Line: 384, - SyntaxPatterns: []ir.PatternString{ - {Line: 384, Value: "copy($x, $x)"}, - {Line: 385, Value: "math.Max($x, $x)"}, - {Line: 386, Value: "math.Min($x, $x)"}, - {Line: 387, Value: "reflect.Copy($x, $x)"}, - {Line: 388, Value: "reflect.DeepEqual($x, $x)"}, - {Line: 389, Value: "strings.Contains($x, $x)"}, - {Line: 390, Value: "strings.Compare($x, $x)"}, - {Line: 391, Value: "strings.EqualFold($x, $x)"}, - {Line: 392, Value: "strings.HasPrefix($x, $x)"}, - {Line: 393, Value: "strings.HasSuffix($x, $x)"}, - {Line: 394, Value: "strings.Index($x, $x)"}, - {Line: 395, Value: "strings.LastIndex($x, $x)"}, - {Line: 396, Value: "strings.Split($x, $x)"}, - {Line: 397, Value: "strings.SplitAfter($x, $x)"}, - {Line: 398, Value: "strings.SplitAfterN($x, $x, $_)"}, - {Line: 399, Value: "strings.SplitN($x, $x, $_)"}, - {Line: 400, Value: "strings.Replace($_, $x, $x, $_)"}, - {Line: 401, Value: "strings.ReplaceAll($_, $x, $x)"}, - {Line: 402, Value: "bytes.Contains($x, $x)"}, - {Line: 403, Value: "bytes.Compare($x, $x)"}, - {Line: 404, Value: "bytes.Equal($x, $x)"}, - {Line: 405, Value: "bytes.EqualFold($x, $x)"}, - {Line: 406, Value: "bytes.HasPrefix($x, $x)"}, - {Line: 407, Value: "bytes.HasSuffix($x, $x)"}, - {Line: 408, Value: "bytes.Index($x, $x)"}, - {Line: 409, Value: "bytes.LastIndex($x, $x)"}, - {Line: 410, Value: "bytes.Split($x, $x)"}, - {Line: 411, Value: "bytes.SplitAfter($x, $x)"}, - {Line: 412, Value: "bytes.SplitAfterN($x, $x, $_)"}, - {Line: 413, Value: "bytes.SplitN($x, $x, $_)"}, - {Line: 414, Value: "bytes.Replace($_, $x, $x, $_)"}, - {Line: 415, Value: "bytes.ReplaceAll($_, $x, $x)"}, - {Line: 416, Value: "types.Identical($x, $x)"}, - {Line: 417, Value: "types.IdenticalIgnoreTags($x, $x)"}, - {Line: 418, Value: "draw.Draw($x, $_, $x, $_, $_)"}, - }, - ReportTemplate: "suspicious duplicated args in $$", - WhereExpr: ir.FilterExpr{Line: 419, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - }, - }, - }, - { - Line: 427, - Name: "returnAfterHttpError", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects suspicious http.Error call without following return", - DocBefore: "if err != nil { http.Error(...); }", - DocAfter: "if err != nil { http.Error(...); return; }", - Rules: []ir.Rule{{ - Line: 428, - SyntaxPatterns: []ir.PatternString{{Line: 428, Value: "if $_ { $*_; http.Error($w, $err, $code) }"}}, - ReportTemplate: "Possibly return is missed after the http.Error call", - LocationVar: "w", - }}, - }, - { - Line: 437, - Name: "preferFilepathJoin", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects concatenation with os.PathSeparator which can be replaced with filepath.Join", - DocBefore: "x + string(os.PathSeparator) + y", - DocAfter: "filepath.Join(x, y)", - Rules: []ir.Rule{{ - Line: 438, - SyntaxPatterns: []ir.PatternString{{Line: 438, Value: "$x + string(os.PathSeparator) + $y"}}, - ReportTemplate: "filepath.Join($x, $y) should be preferred to the $$", - SuggestTemplate: "filepath.Join($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 439, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Type.Is(`string`) && m[\"y\"].Type.Is(`string`)", - Args: []ir.FilterExpr{ - { - Line: 439, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`string`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 439, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - { - Line: 439, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"y\"].Type.Is(`string`)", - Value: "y", - Args: []ir.FilterExpr{{Line: 439, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - }, - }, - }}, - }, - { - Line: 448, - Name: "preferStringWriter", - MatcherName: "m", - DocTags: []string{"performance", "experimental"}, - DocSummary: "Detects w.Write or io.WriteString calls which can be replaced with w.WriteString", - DocBefore: "w.Write([]byte(\"foo\"))", - DocAfter: "w.WriteString(\"foo\")", - Rules: []ir.Rule{ - { - Line: 449, - SyntaxPatterns: []ir.PatternString{{Line: 449, Value: "$w.Write([]byte($s))"}}, - ReportTemplate: "$w.WriteString($s) should be preferred to the $$", - SuggestTemplate: "$w.WriteString($s)", - WhereExpr: ir.FilterExpr{ - Line: 450, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.StringWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 450, Op: ir.FilterStringOp, Src: "\"io.StringWriter\"", Value: "io.StringWriter"}}, - }, - }, - { - Line: 454, - SyntaxPatterns: []ir.PatternString{{Line: 454, Value: "io.WriteString($w, $s)"}}, - ReportTemplate: "$w.WriteString($s) should be preferred to the $$", - SuggestTemplate: "$w.WriteString($s)", - WhereExpr: ir.FilterExpr{ - Line: 455, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"w\"].Type.Implements(\"io.StringWriter\")", - Value: "w", - Args: []ir.FilterExpr{{Line: 455, Op: ir.FilterStringOp, Src: "\"io.StringWriter\"", Value: "io.StringWriter"}}, - }, - }, - }, - }, - { - Line: 464, - Name: "sliceClear", - MatcherName: "m", - DocTags: []string{"performance", "experimental"}, - DocSummary: "Detects slice clear loops, suggests an idiom that is recognized by the Go compiler", - DocBefore: "for i := 0; i < len(buf); i++ { buf[i] = 0 }", - DocAfter: "for i := range buf { buf[i] = 0 }", - Rules: []ir.Rule{{ - Line: 465, - SyntaxPatterns: []ir.PatternString{{Line: 465, Value: "for $i := 0; $i < len($xs); $i++ { $xs[$i] = $zero }"}}, - ReportTemplate: "rewrite as for-range so compiler can recognize this pattern", - WhereExpr: ir.FilterExpr{ - Line: 466, - Op: ir.FilterEqOp, - Src: "m[\"zero\"].Value.Int() == 0", - Args: []ir.FilterExpr{ - { - Line: 466, - Op: ir.FilterVarValueIntOp, - Src: "m[\"zero\"].Value.Int()", - Value: "zero", - }, - { - Line: 466, - Op: ir.FilterIntOp, - Src: "0", - Value: int64(0), - }, - }, - }, - }}, - }, - { - Line: 474, - Name: "syncMapLoadAndDelete", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects sync.Map load+delete operations that can be replaced with LoadAndDelete", - DocBefore: "v, ok := m.Load(k); if ok { m.Delete($k); f(v); }", - DocAfter: "v, deleted := m.LoadAndDelete(k); if deleted { f(v) }", - Rules: []ir.Rule{{ - Line: 475, - SyntaxPatterns: []ir.PatternString{{Line: 475, Value: "$_, $ok := $m.Load($k); if $ok { $m.Delete($k); $*_ }"}}, - ReportTemplate: "use $m.LoadAndDelete to perform load+delete operations atomically", - WhereExpr: ir.FilterExpr{ - Line: 476, - Op: ir.FilterAndOp, - Src: "m.GoVersion().GreaterEqThan(\"1.15\") &&\n\tm[\"m\"].Type.Is(`*sync.Map`)", - Args: []ir.FilterExpr{ - { - Line: 476, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.15\")", - Value: "1.15", - }, - { - Line: 477, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"m\"].Type.Is(`*sync.Map`)", - Value: "m", - Args: []ir.FilterExpr{{Line: 477, Op: ir.FilterStringOp, Src: "`*sync.Map`", Value: "*sync.Map"}}, - }, - }, - }, - }}, - }, - { - Line: 485, - Name: "sprintfQuotedString", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects \"%s\" formatting directives that can be replaced with %q", - DocBefore: "fmt.Sprintf(`\"%s\"`, s)", - DocAfter: "fmt.Sprintf(`%q`, s)", - Rules: []ir.Rule{{ - Line: 486, - SyntaxPatterns: []ir.PatternString{{Line: 486, Value: "fmt.Sprintf($s, $*_)"}}, - ReportTemplate: "use %q instead of \"%s\" for quoted strings", - WhereExpr: ir.FilterExpr{ - Line: 487, - Op: ir.FilterOrOp, - Src: "m[\"s\"].Text.Matches(\"^`.*\\\"%s\\\".*`$\") ||\n\tm[\"s\"].Text.Matches(`^\".*\\\\\"%s\\\\\".*\"$`)", - Args: []ir.FilterExpr{ - { - Line: 487, - Op: ir.FilterVarTextMatchesOp, - Src: "m[\"s\"].Text.Matches(\"^`.*\\\"%s\\\".*`$\")", - Value: "s", - Args: []ir.FilterExpr{{Line: 487, Op: ir.FilterStringOp, Src: "\"^`.*\\\"%s\\\".*`$\"", Value: "^`.*\"%s\".*`$"}}, - }, - { - Line: 488, - Op: ir.FilterVarTextMatchesOp, - Src: "m[\"s\"].Text.Matches(`^\".*\\\\\"%s\\\\\".*\"$`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 488, Op: ir.FilterStringOp, Src: "`^\".*\\\\\"%s\\\\\".*\"$`", Value: "^\".*\\\\\"%s\\\\\".*\"$"}}, - }, - }, - }, - }}, - }, - { - Line: 496, - Name: "offBy1", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects various off-by-one kind of errors", - DocBefore: "xs[len(xs)]", - DocAfter: "xs[len(xs)-1]", - Rules: []ir.Rule{ - { - Line: 497, - SyntaxPatterns: []ir.PatternString{{Line: 497, Value: "$x[len($x)]"}}, - ReportTemplate: "index expr always panics; maybe you wanted $x[len($x)-1]?", - SuggestTemplate: "$x[len($x)-1]", - WhereExpr: ir.FilterExpr{ - Line: 498, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"x\"].Type.Is(`[]$_`)", - Args: []ir.FilterExpr{ - {Line: 498, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - { - Line: 498, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]$_`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 498, Op: ir.FilterStringOp, Src: "`[]$_`", Value: "[]$_"}}, - }, - }, - }, - }, - { - Line: 505, - SyntaxPatterns: []ir.PatternString{ - {Line: 506, Value: "$i := strings.Index($s, $_); $_ := $slicing[$i:]"}, - {Line: 507, Value: "$i := strings.Index($s, $_); $_ = $slicing[$i:]"}, - {Line: 508, Value: "$i := bytes.Index($s, $_); $_ := $slicing[$i:]"}, - {Line: 509, Value: "$i := bytes.Index($s, $_); $_ = $slicing[$i:]"}, - }, - ReportTemplate: "Index() can return -1; maybe you wanted to do $s[$i+1:]", - WhereExpr: ir.FilterExpr{ - Line: 510, - Op: ir.FilterEqOp, - Src: "m[\"s\"].Text == m[\"slicing\"].Text", - Args: []ir.FilterExpr{ - {Line: 510, Op: ir.FilterVarTextOp, Src: "m[\"s\"].Text", Value: "s"}, - {Line: 510, Op: ir.FilterVarTextOp, Src: "m[\"slicing\"].Text", Value: "slicing"}, - }, - }, - LocationVar: "slicing", - }, - { - Line: 514, - SyntaxPatterns: []ir.PatternString{ - {Line: 515, Value: "$i := strings.Index($s, $_); $_ := $slicing[:$i]"}, - {Line: 516, Value: "$i := strings.Index($s, $_); $_ = $slicing[:$i]"}, - {Line: 517, Value: "$i := bytes.Index($s, $_); $_ := $slicing[:$i]"}, - {Line: 518, Value: "$i := bytes.Index($s, $_); $_ = $slicing[:$i]"}, - }, - ReportTemplate: "Index() can return -1; maybe you wanted to do $s[:$i+1]", - WhereExpr: ir.FilterExpr{ - Line: 519, - Op: ir.FilterEqOp, - Src: "m[\"s\"].Text == m[\"slicing\"].Text", - Args: []ir.FilterExpr{ - {Line: 519, Op: ir.FilterVarTextOp, Src: "m[\"s\"].Text", Value: "s"}, - {Line: 519, Op: ir.FilterVarTextOp, Src: "m[\"slicing\"].Text", Value: "slicing"}, - }, - }, - LocationVar: "slicing", - }, - { - Line: 523, - SyntaxPatterns: []ir.PatternString{ - {Line: 524, Value: "$s[strings.Index($s, $_):]"}, - {Line: 525, Value: "$s[:strings.Index($s, $_)]"}, - {Line: 526, Value: "$s[bytes.Index($s, $_):]"}, - {Line: 527, Value: "$s[:bytes.Index($s, $_)]"}, - }, - ReportTemplate: "Index() can return -1; maybe you wanted to do Index()+1", - }, - }, - }, - { - Line: 535, - Name: "unslice", - MatcherName: "m", - DocTags: []string{"style"}, - DocSummary: "Detects slice expressions that can be simplified to sliced expression itself", - DocBefore: "copy(b[:], values...)", - DocAfter: "copy(b, values...)", - Rules: []ir.Rule{{ - Line: 536, - SyntaxPatterns: []ir.PatternString{{Line: 536, Value: "$s[:]"}}, - ReportTemplate: "could simplify $$ to $s", - SuggestTemplate: "$s", - WhereExpr: ir.FilterExpr{ - Line: 537, - Op: ir.FilterOrOp, - Src: "m[\"s\"].Type.Is(`string`) || m[\"s\"].Type.Is(`[]$_`)", - Args: []ir.FilterExpr{ - { - Line: 537, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`string`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 537, Op: ir.FilterStringOp, Src: "`string`", Value: "string"}}, - }, - { - Line: 537, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"s\"].Type.Is(`[]$_`)", - Value: "s", - Args: []ir.FilterExpr{{Line: 537, Op: ir.FilterStringOp, Src: "`[]$_`", Value: "[]$_"}}, - }, - }, - }, - }}, - }, - { - Line: 546, - Name: "yodaStyleExpr", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects Yoda style expressions and suggests to replace them", - DocBefore: "return nil != ptr", - DocAfter: "return ptr != nil", - Rules: []ir.Rule{ - { - Line: 547, - SyntaxPatterns: []ir.PatternString{{Line: 547, Value: "$constval != $x"}}, - ReportTemplate: "consider to change order in expression to $x != $constval", - WhereExpr: ir.FilterExpr{ - Line: 547, - Op: ir.FilterAndOp, - Src: "m[\"constval\"].Node.Is(`BasicLit`) && !m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{ - { - Line: 547, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"constval\"].Node.Is(`BasicLit`)", - Value: "constval", - Args: []ir.FilterExpr{{Line: 547, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }, - { - Line: 547, - Op: ir.FilterNotOp, - Src: "!m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{{ - Line: 547, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"x\"].Node.Is(`BasicLit`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 547, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }}, - }, - }, - }, - }, - { - Line: 549, - SyntaxPatterns: []ir.PatternString{{Line: 549, Value: "$constval == $x"}}, - ReportTemplate: "consider to change order in expression to $x == $constval", - WhereExpr: ir.FilterExpr{ - Line: 549, - Op: ir.FilterAndOp, - Src: "m[\"constval\"].Node.Is(`BasicLit`) && !m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{ - { - Line: 549, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"constval\"].Node.Is(`BasicLit`)", - Value: "constval", - Args: []ir.FilterExpr{{Line: 549, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }, - { - Line: 549, - Op: ir.FilterNotOp, - Src: "!m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{{ - Line: 549, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"x\"].Node.Is(`BasicLit`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 549, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }}, - }, - }, - }, - }, - { - Line: 552, - SyntaxPatterns: []ir.PatternString{{Line: 552, Value: "nil != $x"}}, - ReportTemplate: "consider to change order in expression to $x != nil", - WhereExpr: ir.FilterExpr{ - Line: 552, - Op: ir.FilterNotOp, - Src: "!m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{{ - Line: 552, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"x\"].Node.Is(`BasicLit`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 552, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }}, - }, - }, - { - Line: 554, - SyntaxPatterns: []ir.PatternString{{Line: 554, Value: "nil == $x"}}, - ReportTemplate: "consider to change order in expression to $x == nil", - WhereExpr: ir.FilterExpr{ - Line: 554, - Op: ir.FilterNotOp, - Src: "!m[\"x\"].Node.Is(`BasicLit`)", - Args: []ir.FilterExpr{{ - Line: 554, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"x\"].Node.Is(`BasicLit`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 554, Op: ir.FilterStringOp, Src: "`BasicLit`", Value: "BasicLit"}}, - }}, - }, - }, - }, - }, - { - Line: 562, - Name: "equalFold", - MatcherName: "m", - DocTags: []string{"performance", "experimental"}, - DocSummary: "Detects unoptimal strings/bytes case-insensitive comparison", - DocBefore: "strings.ToLower(x) == strings.ToLower(y)", - DocAfter: "strings.EqualFold(x, y)", - Rules: []ir.Rule{ - { - Line: 571, - SyntaxPatterns: []ir.PatternString{ - {Line: 572, Value: "strings.ToLower($x) == $y"}, - {Line: 573, Value: "strings.ToLower($x) == strings.ToLower($y)"}, - {Line: 574, Value: "$x == strings.ToLower($y)"}, - {Line: 575, Value: "strings.ToUpper($x) == $y"}, - {Line: 576, Value: "strings.ToUpper($x) == strings.ToUpper($y)"}, - {Line: 577, Value: "$x == strings.ToUpper($y)"}, - }, - ReportTemplate: "consider replacing with strings.EqualFold($x, $y)", - SuggestTemplate: "strings.EqualFold($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 578, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure && m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - { - Line: 578, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure", - Args: []ir.FilterExpr{ - {Line: 578, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - {Line: 578, Op: ir.FilterVarPureOp, Src: "m[\"y\"].Pure", Value: "y"}, - }, - }, - { - Line: 578, - Op: ir.FilterNeqOp, - Src: "m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - {Line: 578, Op: ir.FilterVarTextOp, Src: "m[\"x\"].Text", Value: "x"}, - {Line: 578, Op: ir.FilterVarTextOp, Src: "m[\"y\"].Text", Value: "y"}, - }, - }, - }, - }, - }, - { - Line: 583, - SyntaxPatterns: []ir.PatternString{ - {Line: 584, Value: "strings.ToLower($x) != $y"}, - {Line: 585, Value: "strings.ToLower($x) != strings.ToLower($y)"}, - {Line: 586, Value: "$x != strings.ToLower($y)"}, - {Line: 587, Value: "strings.ToUpper($x) != $y"}, - {Line: 588, Value: "strings.ToUpper($x) != strings.ToUpper($y)"}, - {Line: 589, Value: "$x != strings.ToUpper($y)"}, - }, - ReportTemplate: "consider replacing with !strings.EqualFold($x, $y)", - SuggestTemplate: "!strings.EqualFold($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 590, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure && m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - { - Line: 590, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure", - Args: []ir.FilterExpr{ - {Line: 590, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - {Line: 590, Op: ir.FilterVarPureOp, Src: "m[\"y\"].Pure", Value: "y"}, - }, - }, - { - Line: 590, - Op: ir.FilterNeqOp, - Src: "m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - {Line: 590, Op: ir.FilterVarTextOp, Src: "m[\"x\"].Text", Value: "x"}, - {Line: 590, Op: ir.FilterVarTextOp, Src: "m[\"y\"].Text", Value: "y"}, - }, - }, - }, - }, - }, - { - Line: 595, - SyntaxPatterns: []ir.PatternString{ - {Line: 596, Value: "bytes.Equal(bytes.ToLower($x), $y)"}, - {Line: 597, Value: "bytes.Equal(bytes.ToLower($x), bytes.ToLower($y))"}, - {Line: 598, Value: "bytes.Equal($x, bytes.ToLower($y))"}, - {Line: 599, Value: "bytes.Equal(bytes.ToUpper($x), $y)"}, - {Line: 600, Value: "bytes.Equal(bytes.ToUpper($x), bytes.ToUpper($y))"}, - {Line: 601, Value: "bytes.Equal($x, bytes.ToUpper($y))"}, - }, - ReportTemplate: "consider replacing with bytes.EqualFold($x, $y)", - SuggestTemplate: "bytes.EqualFold($x, $y)", - WhereExpr: ir.FilterExpr{ - Line: 602, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure && m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - { - Line: 602, - Op: ir.FilterAndOp, - Src: "m[\"x\"].Pure && m[\"y\"].Pure", - Args: []ir.FilterExpr{ - {Line: 602, Op: ir.FilterVarPureOp, Src: "m[\"x\"].Pure", Value: "x"}, - {Line: 602, Op: ir.FilterVarPureOp, Src: "m[\"y\"].Pure", Value: "y"}, - }, - }, - { - Line: 602, - Op: ir.FilterNeqOp, - Src: "m[\"x\"].Text != m[\"y\"].Text", - Args: []ir.FilterExpr{ - {Line: 602, Op: ir.FilterVarTextOp, Src: "m[\"x\"].Text", Value: "x"}, - {Line: 602, Op: ir.FilterVarTextOp, Src: "m[\"y\"].Text", Value: "y"}, - }, - }, - }, - }, - }, - }, - }, - { - Line: 611, - Name: "argOrder", - MatcherName: "m", - DocTags: []string{"diagnostic"}, - DocSummary: "Detects suspicious arguments order", - DocBefore: "strings.HasPrefix(\"#\", userpass)", - DocAfter: "strings.HasPrefix(userpass, \"#\")", - Rules: []ir.Rule{{ - Line: 612, - SyntaxPatterns: []ir.PatternString{ - {Line: 613, Value: "strings.HasPrefix($lit, $s)"}, - {Line: 614, Value: "bytes.HasPrefix($lit, $s)"}, - {Line: 615, Value: "strings.HasSuffix($lit, $s)"}, - {Line: 616, Value: "bytes.HasSuffix($lit, $s)"}, - {Line: 617, Value: "strings.Contains($lit, $s)"}, - {Line: 618, Value: "bytes.Contains($lit, $s)"}, - {Line: 619, Value: "strings.TrimPrefix($lit, $s)"}, - {Line: 620, Value: "bytes.TrimPrefix($lit, $s)"}, - {Line: 621, Value: "strings.TrimSuffix($lit, $s)"}, - {Line: 622, Value: "bytes.TrimSuffix($lit, $s)"}, - {Line: 623, Value: "strings.Split($lit, $s)"}, - {Line: 624, Value: "bytes.Split($lit, $s)"}, - }, - ReportTemplate: "$lit and $s arguments order looks reversed", - WhereExpr: ir.FilterExpr{ - Line: 625, - Op: ir.FilterAndOp, - Src: "(m[\"lit\"].Const || m[\"lit\"].ConstSlice) &&\n\t!(m[\"s\"].Const || m[\"s\"].ConstSlice) &&\n\t!m[\"lit\"].Node.Is(`Ident`)", - Args: []ir.FilterExpr{ - { - Line: 625, - Op: ir.FilterAndOp, - Src: "(m[\"lit\"].Const || m[\"lit\"].ConstSlice) &&\n\t!(m[\"s\"].Const || m[\"s\"].ConstSlice)", - Args: []ir.FilterExpr{ - { - Line: 625, - Op: ir.FilterOrOp, - Src: "(m[\"lit\"].Const || m[\"lit\"].ConstSlice)", - Args: []ir.FilterExpr{ - { - Line: 625, - Op: ir.FilterVarConstOp, - Src: "m[\"lit\"].Const", - Value: "lit", - }, - { - Line: 625, - Op: ir.FilterVarConstSliceOp, - Src: "m[\"lit\"].ConstSlice", - Value: "lit", - }, - }, - }, - { - Line: 626, - Op: ir.FilterNotOp, - Src: "!(m[\"s\"].Const || m[\"s\"].ConstSlice)", - Args: []ir.FilterExpr{{ - Line: 626, - Op: ir.FilterOrOp, - Src: "(m[\"s\"].Const || m[\"s\"].ConstSlice)", - Args: []ir.FilterExpr{ - { - Line: 626, - Op: ir.FilterVarConstOp, - Src: "m[\"s\"].Const", - Value: "s", - }, - { - Line: 626, - Op: ir.FilterVarConstSliceOp, - Src: "m[\"s\"].ConstSlice", - Value: "s", - }, - }, - }}, - }, - }, - }, - { - Line: 627, - Op: ir.FilterNotOp, - Src: "!m[\"lit\"].Node.Is(`Ident`)", - Args: []ir.FilterExpr{{ - Line: 627, - Op: ir.FilterVarNodeIsOp, - Src: "m[\"lit\"].Node.Is(`Ident`)", - Value: "lit", - Args: []ir.FilterExpr{{Line: 627, Op: ir.FilterStringOp, Src: "`Ident`", Value: "Ident"}}, - }}, - }, - }, - }, - }}, - }, - { - Line: 635, - Name: "stringConcatSimplify", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects string concat operations that can be simplified", - DocBefore: "strings.Join([]string{x, y}, \"_\")", - DocAfter: "x + \"_\" + y", - Rules: []ir.Rule{ - { - Line: 636, - SyntaxPatterns: []ir.PatternString{{Line: 636, Value: "strings.Join([]string{$x, $y}, \"\")"}}, - ReportTemplate: "suggestion: $x + $y", - SuggestTemplate: "$x + $y", - }, - { - Line: 637, - SyntaxPatterns: []ir.PatternString{{Line: 637, Value: "strings.Join([]string{$x, $y, $z}, \"\")"}}, - ReportTemplate: "suggestion: $x + $y + $z", - SuggestTemplate: "$x + $y + $z", - }, - { - Line: 638, - SyntaxPatterns: []ir.PatternString{{Line: 638, Value: "strings.Join([]string{$x, $y}, $glue)"}}, - ReportTemplate: "suggestion: $x + $glue + $y", - SuggestTemplate: "$x + $glue + $y", - }, - }, - }, - { - Line: 645, - Name: "timeExprSimplify", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects manual conversion to milli- or microseconds", - DocBefore: "t.Unix() / 1000", - DocAfter: "t.UnixMilli()", - Rules: []ir.Rule{ - { - Line: 650, - SyntaxPatterns: []ir.PatternString{{Line: 650, Value: "$t.Unix() / 1000"}}, - ReportTemplate: "use $t.UnixMilli() instead of $$", - SuggestTemplate: "$t.UnixMilli()", - WhereExpr: ir.FilterExpr{ - Line: 651, - Op: ir.FilterAndOp, - Src: "m.GoVersion().GreaterEqThan(\"1.17\") && isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 651, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.17\")", - Value: "1.17", - }, - { - Line: 651, - Op: ir.FilterOrOp, - Src: "isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 651, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 647, Op: ir.FilterStringOp, Src: "`time.Time`", Value: "time.Time"}}, - }, - { - Line: 651, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`*time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 647, Op: ir.FilterStringOp, Src: "`*time.Time`", Value: "*time.Time"}}, - }, - }, - }, - }, - }, - }, - { - Line: 655, - SyntaxPatterns: []ir.PatternString{{Line: 655, Value: "$t.UnixNano() * 1000"}}, - ReportTemplate: "use $t.UnixMicro() instead of $$", - SuggestTemplate: "$t.UnixMicro()", - WhereExpr: ir.FilterExpr{ - Line: 656, - Op: ir.FilterAndOp, - Src: "m.GoVersion().GreaterEqThan(\"1.17\") && isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 656, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.17\")", - Value: "1.17", - }, - { - Line: 656, - Op: ir.FilterOrOp, - Src: "isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 656, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 647, Op: ir.FilterStringOp, Src: "`time.Time`", Value: "time.Time"}}, - }, - { - Line: 656, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`*time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 647, Op: ir.FilterStringOp, Src: "`*time.Time`", Value: "*time.Time"}}, - }, - }, - }, - }, - }, - }, - }, - }, - { - Line: 665, - Name: "timeCmpSimplify", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects Before/After call of time.Time that can be simplified", - DocBefore: "!t.Before(tt)", - DocAfter: "t.After(tt)", - Rules: []ir.Rule{ - { - Line: 670, - SyntaxPatterns: []ir.PatternString{{Line: 670, Value: "!$t.Before($tt)"}}, - ReportTemplate: "suggestion: $t.After($tt)", - SuggestTemplate: "$t.After($tt)", - WhereExpr: ir.FilterExpr{ - Line: 671, - Op: ir.FilterOrOp, - Src: "isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 671, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 667, Op: ir.FilterStringOp, Src: "`time.Time`", Value: "time.Time"}}, - }, - { - Line: 671, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`*time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 667, Op: ir.FilterStringOp, Src: "`*time.Time`", Value: "*time.Time"}}, - }, - }, - }, - }, - { - Line: 674, - SyntaxPatterns: []ir.PatternString{{Line: 674, Value: "!$t.After($tt)"}}, - ReportTemplate: "suggestion: $t.Before($tt)", - SuggestTemplate: "$t.Before($tt)", - WhereExpr: ir.FilterExpr{ - Line: 675, - Op: ir.FilterOrOp, - Src: "isTime(m[\"t\"])", - Args: []ir.FilterExpr{ - { - Line: 675, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 667, Op: ir.FilterStringOp, Src: "`time.Time`", Value: "time.Time"}}, - }, - { - Line: 675, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"t\"].Type.Is(`*time.Time`)", - Value: "t", - Args: []ir.FilterExpr{{Line: 667, Op: ir.FilterStringOp, Src: "`*time.Time`", Value: "*time.Time"}}, - }, - }, - }, - }, - }, - }, - { - Line: 683, - Name: "exposedSyncMutex", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects exposed methods from sync.Mutex and sync.RWMutex", - DocBefore: "type Foo struct{ ...; sync.Mutex; ... }", - DocAfter: "type Foo struct{ ...; mu sync.Mutex; ... }", - Rules: []ir.Rule{ - { - Line: 688, - SyntaxPatterns: []ir.PatternString{{Line: 688, Value: "type $x struct { $*_; sync.Mutex; $*_ }"}}, - ReportTemplate: "don't embed sync.Mutex", - WhereExpr: ir.FilterExpr{ - Line: 689, - Op: ir.FilterVarTextMatchesOp, - Src: "isExported(m[\"x\"])", - Value: "x", - Args: []ir.FilterExpr{{Line: 685, Op: ir.FilterStringOp, Src: "`^\\p{Lu}`", Value: "^\\p{Lu}"}}, - }, - }, - { - Line: 692, - SyntaxPatterns: []ir.PatternString{{Line: 692, Value: "type $x struct { $*_; *sync.Mutex; $*_ }"}}, - ReportTemplate: "don't embed *sync.Mutex", - WhereExpr: ir.FilterExpr{ - Line: 693, - Op: ir.FilterVarTextMatchesOp, - Src: "isExported(m[\"x\"])", - Value: "x", - Args: []ir.FilterExpr{{Line: 685, Op: ir.FilterStringOp, Src: "`^\\p{Lu}`", Value: "^\\p{Lu}"}}, - }, - }, - { - Line: 696, - SyntaxPatterns: []ir.PatternString{{Line: 696, Value: "type $x struct { $*_; sync.RWMutex; $*_ }"}}, - ReportTemplate: "don't embed sync.RWMutex", - WhereExpr: ir.FilterExpr{ - Line: 697, - Op: ir.FilterVarTextMatchesOp, - Src: "isExported(m[\"x\"])", - Value: "x", - Args: []ir.FilterExpr{{Line: 685, Op: ir.FilterStringOp, Src: "`^\\p{Lu}`", Value: "^\\p{Lu}"}}, - }, - }, - { - Line: 700, - SyntaxPatterns: []ir.PatternString{{Line: 700, Value: "type $x struct { $*_; *sync.RWMutex; $*_ }"}}, - ReportTemplate: "don't embed *sync.RWMutex", - WhereExpr: ir.FilterExpr{ - Line: 701, - Op: ir.FilterVarTextMatchesOp, - Src: "isExported(m[\"x\"])", - Value: "x", - Args: []ir.FilterExpr{{Line: 685, Op: ir.FilterStringOp, Src: "`^\\p{Lu}`", Value: "^\\p{Lu}"}}, - }, - }, - }, - }, - { - Line: 709, - Name: "badSorting", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects bad usage of sort package", - DocBefore: "xs = sort.StringSlice(xs)", - DocAfter: "sort.Strings(xs)", - Rules: []ir.Rule{ - { - Line: 710, - SyntaxPatterns: []ir.PatternString{{Line: 710, Value: "$x = sort.IntSlice($x)"}}, - ReportTemplate: "suspicious sort.IntSlice usage, maybe sort.Ints was intended?", - SuggestTemplate: "sort.Ints($x)", - WhereExpr: ir.FilterExpr{ - Line: 711, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]int`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 711, Op: ir.FilterStringOp, Src: "`[]int`", Value: "[]int"}}, - }, - }, - { - Line: 715, - SyntaxPatterns: []ir.PatternString{{Line: 715, Value: "$x = sort.Float64Slice($x)"}}, - ReportTemplate: "suspicious sort.Float64s usage, maybe sort.Float64s was intended?", - SuggestTemplate: "sort.Float64s($x)", - WhereExpr: ir.FilterExpr{ - Line: 716, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]float64`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 716, Op: ir.FilterStringOp, Src: "`[]float64`", Value: "[]float64"}}, - }, - }, - { - Line: 720, - SyntaxPatterns: []ir.PatternString{{Line: 720, Value: "$x = sort.StringSlice($x)"}}, - ReportTemplate: "suspicious sort.StringSlice usage, maybe sort.Strings was intended?", - SuggestTemplate: "sort.Strings($x)", - WhereExpr: ir.FilterExpr{ - Line: 721, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"x\"].Type.Is(`[]string`)", - Value: "x", - Args: []ir.FilterExpr{{Line: 721, Op: ir.FilterStringOp, Src: "`[]string`", Value: "[]string"}}, - }, - }, - }, - }, - { - Line: 730, - Name: "externalErrorReassign", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects suspicious reassignment of error from another package", - DocBefore: "io.EOF = nil", - DocAfter: "/* don't do it */", - Rules: []ir.Rule{{ - Line: 731, - SyntaxPatterns: []ir.PatternString{{Line: 731, Value: "$pkg.$err = $x"}}, - ReportTemplate: "suspicious reassignment of error from another package", - WhereExpr: ir.FilterExpr{ - Line: 732, - Op: ir.FilterAndOp, - Src: "m[\"err\"].Type.Is(`error`) && m[\"pkg\"].Object.Is(`PkgName`)", - Args: []ir.FilterExpr{ - { - Line: 732, - Op: ir.FilterVarTypeIsOp, - Src: "m[\"err\"].Type.Is(`error`)", - Value: "err", - Args: []ir.FilterExpr{{Line: 732, Op: ir.FilterStringOp, Src: "`error`", Value: "error"}}, - }, - { - Line: 732, - Op: ir.FilterVarObjectIsOp, - Src: "m[\"pkg\"].Object.Is(`PkgName`)", - Value: "pkg", - Args: []ir.FilterExpr{{Line: 732, Op: ir.FilterStringOp, Src: "`PkgName`", Value: "PkgName"}}, - }, - }, - }, - }}, - }, - { - Line: 740, - Name: "emptyDecl", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects suspicious empty declarations blocks", - DocBefore: "var()", - DocAfter: "/* nothing */", - Rules: []ir.Rule{ - { - Line: 741, - SyntaxPatterns: []ir.PatternString{{Line: 741, Value: "var()"}}, - ReportTemplate: "empty var() block", - }, - { - Line: 742, - SyntaxPatterns: []ir.PatternString{{Line: 742, Value: "const()"}}, - ReportTemplate: "empty const() block", - }, - { - Line: 743, - SyntaxPatterns: []ir.PatternString{{Line: 743, Value: "type()"}}, - ReportTemplate: "empty type() block", - }, - }, - }, - { - Line: 750, - Name: "dynamicFmtString", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects suspicious formatting strings usage", - DocBefore: "fmt.Errorf(msg)", - DocAfter: "fmt.Errorf(\"%s\", msg)", - Rules: []ir.Rule{ - { - Line: 751, - SyntaxPatterns: []ir.PatternString{{Line: 751, Value: "fmt.Errorf($f)"}}, - ReportTemplate: "use errors.New($f) or fmt.Errorf(\"%s\", $f) instead", - SuggestTemplate: "errors.New($f)", - WhereExpr: ir.FilterExpr{ - Line: 752, - Op: ir.FilterNotOp, - Src: "!m[\"f\"].Const", - Args: []ir.FilterExpr{{ - Line: 752, - Op: ir.FilterVarConstOp, - Src: "m[\"f\"].Const", - Value: "f", - }}, - }, - }, - { - Line: 756, - SyntaxPatterns: []ir.PatternString{{Line: 756, Value: "fmt.Errorf($f($*args))"}}, - ReportTemplate: "use errors.New($f($*args)) or fmt.Errorf(\"%s\", $f($*args)) instead", - SuggestTemplate: "errors.New($f($*args))", - }, - }, - }, - { - Line: 765, - Name: "stringsCompare", - MatcherName: "m", - DocTags: []string{"style", "experimental"}, - DocSummary: "Detects strings.Compare usage", - DocBefore: "strings.Compare(x, y)", - DocAfter: "x < y", - Rules: []ir.Rule{ - { - Line: 766, - SyntaxPatterns: []ir.PatternString{{Line: 766, Value: "strings.Compare($s1, $s2) == 0"}}, - ReportTemplate: "suggestion: $s1 == $s2", - SuggestTemplate: "$s1 == $s2", - }, - { - Line: 769, - SyntaxPatterns: []ir.PatternString{ - {Line: 769, Value: "strings.Compare($s1, $s2) == -1"}, - {Line: 770, Value: "strings.Compare($s1, $s2) < 0"}, - }, - ReportTemplate: "suggestion: $s1 < $s2", - SuggestTemplate: "$s1 < $s2", - }, - { - Line: 773, - SyntaxPatterns: []ir.PatternString{ - {Line: 773, Value: "strings.Compare($s1, $s2) == 1"}, - {Line: 774, Value: "strings.Compare($s1, $s2) > 0"}, - }, - ReportTemplate: "suggestion: $s1 > $s2", - SuggestTemplate: "$s1 > $s2", - }, - }, - }, - { - Line: 782, - Name: "uncheckedInlineErr", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects unchecked errors in if statements", - DocBefore: "if err := expr(); err2 != nil { /*...*/ }", - DocAfter: "if err := expr(); err != nil { /*...*/ }", - Rules: []ir.Rule{{ - Line: 783, - SyntaxPatterns: []ir.PatternString{ - {Line: 784, Value: "if $err := $_($*_); $err2 != nil { $*_ }"}, - {Line: 785, Value: "if $err = $_($*_); $err2 != nil { $*_ }"}, - {Line: 786, Value: "if $*_, $err := $_($*_); $err2 != nil { $*_ }"}, - {Line: 787, Value: "if $*_, $err = $_($*_); $err2 != nil { $*_ }"}, - }, - ReportTemplate: "$err error is unchecked, maybe intended to check it instead of $err2", - WhereExpr: ir.FilterExpr{ - Line: 788, - Op: ir.FilterAndOp, - Src: "m[\"err\"].Type.Implements(\"error\") && m[\"err2\"].Type.Implements(\"error\") &&\n\tm[\"err\"].Text != m[\"err2\"].Text", - Args: []ir.FilterExpr{ - { - Line: 788, - Op: ir.FilterAndOp, - Src: "m[\"err\"].Type.Implements(\"error\") && m[\"err2\"].Type.Implements(\"error\")", - Args: []ir.FilterExpr{ - { - Line: 788, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"err\"].Type.Implements(\"error\")", - Value: "err", - Args: []ir.FilterExpr{{Line: 788, Op: ir.FilterStringOp, Src: "\"error\"", Value: "error"}}, - }, - { - Line: 788, - Op: ir.FilterVarTypeImplementsOp, - Src: "m[\"err2\"].Type.Implements(\"error\")", - Value: "err2", - Args: []ir.FilterExpr{{Line: 788, Op: ir.FilterStringOp, Src: "\"error\"", Value: "error"}}, - }, - }, - }, - { - Line: 789, - Op: ir.FilterNeqOp, - Src: "m[\"err\"].Text != m[\"err2\"].Text", - Args: []ir.FilterExpr{ - {Line: 789, Op: ir.FilterVarTextOp, Src: "m[\"err\"].Text", Value: "err"}, - {Line: 789, Op: ir.FilterVarTextOp, Src: "m[\"err2\"].Text", Value: "err2"}, - }, - }, - }, - }, - LocationVar: "err", - }}, - }, - { - Line: 798, - Name: "badSyncOnceFunc", - MatcherName: "m", - DocTags: []string{"diagnostic", "experimental"}, - DocSummary: "Detects bad usage of sync.OnceFunc", - DocBefore: "sync.OnceFunc(foo)()", - DocAfter: "fooOnce := sync.OnceFunc(foo); ...; fooOnce()", - Rules: []ir.Rule{ - { - Line: 799, - SyntaxPatterns: []ir.PatternString{{Line: 799, Value: "$*_; sync.OnceFunc($x); $*_;"}}, - ReportTemplate: "possible sync.OnceFunc misuse, sync.OnceFunc($x) result is not used", - WhereExpr: ir.FilterExpr{ - Line: 801, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.21\")", - Value: "1.21", - }, - }, - { - Line: 803, - SyntaxPatterns: []ir.PatternString{{Line: 803, Value: "sync.OnceFunc($x)()"}}, - ReportTemplate: "possible sync.OnceFunc misuse, consider to assign sync.OnceFunc($x) to a variable", - WhereExpr: ir.FilterExpr{ - Line: 805, - Op: ir.FilterGoVersionGreaterEqThanOp, - Src: "m.GoVersion().GreaterEqThan(\"1.21\")", - Value: "1.21", - }, - }, - }, - }, - }, -} - diff --git a/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go b/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go deleted file mode 100644 index a1a399fdaa..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/singleCaseSwitch_checker.go +++ /dev/null @@ -1,85 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "singleCaseSwitch" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects switch statements that could be better written as if statement" - info.Before = ` -switch x := x.(type) { -case int: - body() -}` - info.After = ` -if x, ok := x.(int); ok { - body() -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&singleCaseSwitchChecker{ctx: ctx}), nil - }) -} - -type singleCaseSwitchChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *singleCaseSwitchChecker) VisitStmt(stmt ast.Stmt) { - switch stmt := stmt.(type) { - case *ast.SwitchStmt: - c.checkSwitchStmt(stmt, stmt.Body) - case *ast.TypeSwitchStmt: - c.checkSwitchStmt(stmt, stmt.Body) - } -} - -func (c *singleCaseSwitchChecker) checkSwitchStmt(stmt ast.Stmt, body *ast.BlockStmt) { - if len(body.List) != 1 { - return - } - cc := body.List[0].(*ast.CaseClause) - if c.hasBreak(cc) { - return - } - switch { - case cc.List == nil: - c.warnDefault(stmt) - case len(cc.List) == 1: - c.warn(stmt) - } -} - -func (c *singleCaseSwitchChecker) hasBreak(stmt ast.Stmt) bool { - found := false - astutil.Apply(stmt, func(cur *astutil.Cursor) bool { - switch n := cur.Node().(type) { - case *ast.BranchStmt: - if n.Tok == token.BREAK { - found = true - } - case *ast.ForStmt, *ast.RangeStmt, *ast.SelectStmt, *ast.SwitchStmt: - return false - } - return true - }, nil) - return found -} - -func (c *singleCaseSwitchChecker) warn(stmt ast.Stmt) { - c.ctx.Warn(stmt, "should rewrite switch statement to if statement") -} - -func (c *singleCaseSwitchChecker) warnDefault(stmt ast.Stmt) { - c.ctx.Warn(stmt, "found switch with default case only") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go deleted file mode 100644 index d83d7fd5a1..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/sloppyReassign_checker.go +++ /dev/null @@ -1,81 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/astequal" -) - -func init() { - var info linter.CheckerInfo - info.Name = "sloppyReassign" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects suspicious/confusing re-assignments" - info.Before = `if err = f(); err != nil { return err }` - info.After = `if err := f(); err != nil { return err }` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&sloppyReassignChecker{ctx: ctx}), nil - }) -} - -type sloppyReassignChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *sloppyReassignChecker) VisitStmt(stmt ast.Stmt) { - // Right now only check assignments in if statements init. - ifStmt := astcast.ToIfStmt(stmt) - assign := astcast.ToAssignStmt(ifStmt.Init) - if assign.Tok != token.ASSIGN { - return - } - - // TODO(quasilyte): is handling of multi-value assignments worthwhile? - if len(assign.Lhs) != 1 || len(assign.Rhs) != 1 { - return - } - - // TODO(quasilyte): handle not only the simplest, return-only case. - body := ifStmt.Body.List - if len(body) != 1 { - return - } - - // Variable that is being re-assigned. - reAssigned := astcast.ToIdent(assign.Lhs[0]) - if reAssigned.Name == "" { - return - } - - // TODO(quasilyte): handle not only nil comparisons. - eqToNil := &ast.BinaryExpr{ - Op: token.NEQ, - X: reAssigned, - Y: &ast.Ident{Name: "nil"}, - } - if !astequal.Expr(ifStmt.Cond, eqToNil) { - return - } - - results := astcast.ToReturnStmt(body[0]).Results - for _, res := range results { - if astequal.Expr(reAssigned, res) { - c.warnAssignToDefine(assign, reAssigned.Name) - break - } - } -} - -func (c *sloppyReassignChecker) warnAssignToDefine(assign *ast.AssignStmt, name string) { - suggest := astcopy.AssignStmt(assign) - suggest.Tok = token.DEFINE - c.ctx.Warn(assign, "re-assignment to `%s` can be replaced with `%s`", name, suggest) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go deleted file mode 100644 index 454ab78b19..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/sloppyTypeAssert_checker.go +++ /dev/null @@ -1,56 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "sloppyTypeAssert" - info.Tags = []string{linter.DiagnosticTag} - info.Summary = "Detects redundant type assertions" - info.Before = ` -func f(r io.Reader) interface{} { - return r.(interface{}) -} -` - info.After = ` -func f(r io.Reader) interface{} { - return r -} -` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&sloppyTypeAssertChecker{ctx: ctx}), nil - }) -} - -type sloppyTypeAssertChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *sloppyTypeAssertChecker) VisitExpr(expr ast.Expr) { - assert := astcast.ToTypeAssertExpr(expr) - if assert.Type == nil { - return - } - - toType := c.ctx.TypeOf(expr) - fromType := c.ctx.TypeOf(assert.X) - - if types.Identical(toType, fromType) { - c.warnIdentical(expr) - return - } -} - -func (c *sloppyTypeAssertChecker) warnIdentical(cause ast.Expr) { - c.ctx.Warn(cause, "type assertion from/to types are identical") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go deleted file mode 100644 index 22ef3b16a7..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/sortSlice_checker.go +++ /dev/null @@ -1,136 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "sortSlice" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects suspicious sort.Slice calls" - info.Before = `sort.Slice(xs, func(i, j) bool { return keys[i] < keys[j] })` - info.After = `sort.Slice(kv, func(i, j) bool { return kv[i].key < kv[j].key })` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&sortSliceChecker{ctx: ctx}), nil - }) -} - -type sortSliceChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *sortSliceChecker) VisitExpr(expr ast.Expr) { - call := astcast.ToCallExpr(expr) - if len(call.Args) != 2 { - return - } - switch qualifiedName(call.Fun) { - case "sort.Slice", "sort.SliceStable": - // OK. - default: - return - } - - slice := c.unwrapSlice(call.Args[0]) - lessFunc, ok := call.Args[1].(*ast.FuncLit) - if !ok { - return - } - if !typep.SideEffectFree(c.ctx.TypesInfo, slice) { - return // Don't check unpredictable slice values - } - - ivar, jvar := c.paramIdents(lessFunc.Type) - if ivar == nil || jvar == nil { - return - } - - if len(lessFunc.Body.List) != 1 { - return - } - ret, ok := lessFunc.Body.List[0].(*ast.ReturnStmt) - if !ok { - return - } - cmp := astcast.ToBinaryExpr(astutil.Unparen(ret.Results[0])) - if !typep.SideEffectFree(c.ctx.TypesInfo, cmp) { - return - } - switch cmp.Op { - case token.LSS, token.LEQ, token.GTR, token.GEQ: - // Both cmp.X and cmp.Y are expected to be some expressions - // over the `slice` expression. In the simplest case, - // it's a `slice[i] slice[j]`. - if !c.containsSlice(cmp.X, slice) && !c.containsSlice(cmp.Y, slice) { - c.warnSlice(cmp, slice) - } - - // This one is more about the style, but can reveal potential issue - // or misprint in sorting condition. - // We give a warn if X contains indexing with `i` index and Y - // contains indexing with `j`. - if c.containsIndex(cmp.X, jvar) && c.containsIndex(cmp.Y, ivar) { - c.warnIndex(cmp, ivar, jvar) - } - } -} - -func (c *sortSliceChecker) paramIdents(e *ast.FuncType) (ivar, jvar *ast.Ident) { - // Covers both `i, j int` and `i int, j int`. - idents := make([]*ast.Ident, 0, 2) - for _, field := range e.Params.List { - idents = append(idents, field.Names...) - } - if len(idents) == 2 { - return idents[0], idents[1] - } - return nil, nil -} - -func (c *sortSliceChecker) unwrapSlice(e ast.Expr) ast.Expr { - switch e := e.(type) { - case *ast.ParenExpr: - return c.unwrapSlice(e.X) - case *ast.SliceExpr: - return e.X - default: - return e - } -} - -func (c *sortSliceChecker) containsIndex(e, index ast.Expr) bool { - return lintutil.ContainsNode(e, func(n ast.Node) bool { - indexing, ok := n.(*ast.IndexExpr) - if !ok { - return false - } - return astequal.Expr(indexing.Index, index) - }) -} - -func (c *sortSliceChecker) containsSlice(e, slice ast.Expr) bool { - return lintutil.ContainsNode(e, func(n ast.Node) bool { - return astequal.Node(n, slice) - }) -} - -func (c *sortSliceChecker) warnSlice(cause ast.Node, slice ast.Expr) { - c.ctx.Warn(cause, "cmp func must use %s slice in comparison", slice) -} - -func (c *sortSliceChecker) warnIndex(cause ast.Node, ivar, jvar *ast.Ident) { - c.ctx.Warn(cause, "unusual order of {%s,%s} params in comparison", ivar, jvar) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go b/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go deleted file mode 100644 index 8a132b5860..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/sqlQuery_checker.go +++ /dev/null @@ -1,168 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" -) - -func init() { - var info linter.CheckerInfo - info.Name = "sqlQuery" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects issue in Query() and Exec() calls" - info.Before = `_, err := db.Query("UPDATE ...")` - info.After = `_, err := db.Exec("UPDATE ...")` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&sqlQueryChecker{ctx: ctx}), nil - }) -} - -type sqlQueryChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *sqlQueryChecker) VisitStmt(stmt ast.Stmt) { - assign := astcast.ToAssignStmt(stmt) - if len(assign.Lhs) != 2 { // Query() has 2 return values. - return - } - if len(assign.Rhs) != 1 { - return - } - - // If Query() is called, but first return value is ignored, - // there is no way to close/read the returned rows. - // This can cause a connection leak. - if id, ok := assign.Lhs[0].(*ast.Ident); ok && id.Name != "_" { - return - } - - call := astcast.ToCallExpr(assign.Rhs[0]) - funcExpr := astcast.ToSelectorExpr(call.Fun) - if !c.funcIsQuery(funcExpr) { - return - } - - if c.typeHasExecMethod(c.ctx.TypeOf(funcExpr.X)) { - c.warnAndSuggestExec(funcExpr) - } else { - c.warnRowsIgnored(funcExpr) - } -} - -func (c *sqlQueryChecker) funcIsQuery(funcExpr *ast.SelectorExpr) bool { - if funcExpr.Sel == nil { - return false - } - switch funcExpr.Sel.Name { - case "Query", "QueryContext": - // Stdlib and friends. - case "Queryx", "QueryxContext": - // sqlx. - default: - return false - } - - // To avoid false positives (unrelated types can have Query method) - // check that the 1st returned type has Row-like name. - typ, ok := c.ctx.TypeOf(funcExpr).Underlying().(*types.Signature) - if !ok || typ.Results() == nil || typ.Results().Len() != 2 { - return false - } - if !c.typeIsRowsLike(typ.Results().At(0).Type()) { - return false - } - - return true -} - -func (c *sqlQueryChecker) typeIsRowsLike(typ types.Type) bool { - switch typ := typ.(type) { - case *types.Pointer: - return c.typeIsRowsLike(typ.Elem()) - case *types.Named: - return typ.Obj().Name() == "Rows" - default: - return false - } -} - -func (c *sqlQueryChecker) funcIsExec(fn *types.Func) bool { - if fn.Name() != "Exec" { - return false - } - - // Expect exactly 2 results. - sig := fn.Type().(*types.Signature) - if sig.Results() == nil || sig.Results().Len() != 2 { - return false - } - - // Expect at least 1 param and it should be a string (query). - params := sig.Params() - if params == nil || params.Len() == 0 { - return false - } - if typ, ok := params.At(0).Type().(*types.Basic); !ok || typ.Kind() != types.String { - return false - } - - return true -} - -func (c *sqlQueryChecker) typeHasExecMethod(typ types.Type) bool { - switch typ := typ.(type) { - case *types.Struct: - for i := 0; i < typ.NumFields(); i++ { - if c.typeHasExecMethod(typ.Field(i).Type()) { - return true - } - } - case *types.Interface: - for i := 0; i < typ.NumMethods(); i++ { - if c.funcIsExec(typ.Method(i)) { - return true - } - } - case *types.Pointer: - return c.typeHasExecMethod(typ.Elem()) - case *types.Named: - for i := 0; i < typ.NumMethods(); i++ { - if c.funcIsExec(typ.Method(i)) { - return true - } - } - switch ut := typ.Underlying().(type) { - case *types.Interface: - return c.typeHasExecMethod(ut) - case *types.Struct: - // Check embedded types. - for i := 0; i < ut.NumFields(); i++ { - field := ut.Field(i) - if !field.Embedded() { - continue - } - if c.typeHasExecMethod(field.Type()) { - return true - } - } - } - } - - return false -} - -func (c *sqlQueryChecker) warnAndSuggestExec(funcExpr *ast.SelectorExpr) { - c.ctx.Warn(funcExpr, "use %s.Exec() if returned result is not needed", funcExpr.X) -} - -func (c *sqlQueryChecker) warnRowsIgnored(funcExpr *ast.SelectorExpr) { - c.ctx.Warn(funcExpr, "ignoring Query() rows result may lead to a connection leak") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/todoCommentWithoutDetail_checker.go b/vendor/github.com/go-critic/go-critic/checkers/todoCommentWithoutDetail_checker.go deleted file mode 100644 index f8e4b9b3c0..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/todoCommentWithoutDetail_checker.go +++ /dev/null @@ -1,50 +0,0 @@ -package checkers - -import ( - "go/ast" - "regexp" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "todoCommentWithoutDetail" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Summary = "Detects TODO comments without detail/assignee" - info.Before = ` -// TODO -fiiWithCtx(nil, a, b) -` - info.After = ` -// TODO(admin): pass context.TODO() instead of nil -fiiWithCtx(nil, a, b) -` - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - visitor := &todoCommentWithoutCodeChecker{ - ctx: ctx, - regex: regexp.MustCompile(`^(//|/\*)?\s*(TODO|FIX|FIXME|BUG)\s*(\*/)?$`), - } - return astwalk.WalkerForComment(visitor), nil - }) -} - -type todoCommentWithoutCodeChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - regex *regexp.Regexp -} - -func (c *todoCommentWithoutCodeChecker) VisitComment(cg *ast.CommentGroup) { - for _, comment := range cg.List { - if c.regex.MatchString(comment.Text) { - c.warn(cg) - break - } - } -} - -func (c *todoCommentWithoutCodeChecker) warn(cause ast.Node) { - c.ctx.Warn(cause, "may want to add detail/assignee to this TODO/FIXME/BUG comment") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/tooManyResults_checker.go b/vendor/github.com/go-critic/go-critic/checkers/tooManyResults_checker.go deleted file mode 100644 index 57411ba249..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/tooManyResults_checker.go +++ /dev/null @@ -1,54 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "tooManyResultsChecker" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Params = linter.CheckerParams{ - "maxResults": { - Value: 5, - Usage: "maximum number of results", - }, - } - info.Summary = "Detects function with too many results" - info.Before = `func fn() (a, b, c, d float32, _ int, _ bool)` - info.After = `func fn() (resultStruct, bool)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := astwalk.WalkerForFuncDecl(&tooManyResultsChecker{ - ctx: ctx, - maxParams: info.Params.Int("maxResults"), - }) - return c, nil - }) -} - -type tooManyResultsChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - maxParams int -} - -func (c *tooManyResultsChecker) VisitFuncDecl(decl *ast.FuncDecl) { - typ := c.ctx.TypeOf(decl.Name) - sig, ok := typ.(*types.Signature) - if !ok { - return - } - - if count := sig.Results().Len(); count > c.maxParams { - c.warn(decl) - } -} - -func (c *tooManyResultsChecker) warn(n ast.Node) { - c.ctx.Warn(n, "function has more than %d results, consider to simplify the function", c.maxParams) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go deleted file mode 100644 index b369025267..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go +++ /dev/null @@ -1,124 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "truncateCmp" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Params = linter.CheckerParams{ - "skipArchDependent": { - Value: true, - Usage: "whether to skip int/uint/uintptr types", - }, - } - info.Summary = "Detects potential truncation issues when comparing ints of different sizes" - info.Before = ` -func f(x int32, y int16) bool { - return int16(x) < y -}` - info.After = ` -func f(x int32, int16) bool { - return x < int32(y) -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &truncateCmpChecker{ctx: ctx} - c.skipArchDependent = info.Params.Bool("skipArchDependent") - return astwalk.WalkerForExpr(c), nil - }) -} - -type truncateCmpChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - skipArchDependent bool -} - -func (c *truncateCmpChecker) VisitExpr(expr ast.Expr) { - cmp := astcast.ToBinaryExpr(expr) - switch cmp.Op { - case token.LSS, token.GTR, token.LEQ, token.GEQ, token.EQL, token.NEQ: - if astp.IsBasicLit(cmp.X) || astp.IsBasicLit(cmp.Y) { - return // Don't bother about untyped consts - } - leftCast := c.isTruncCast(cmp.X) - rightCast := c.isTruncCast(cmp.Y) - switch { - case leftCast && rightCast: - return - case leftCast: - c.checkCmp(cmp.X, cmp.Y) - case rightCast: - c.checkCmp(cmp.Y, cmp.X) - } - default: - return - } -} - -func (c *truncateCmpChecker) isTruncCast(x ast.Expr) bool { - switch astcast.ToIdent(astcast.ToCallExpr(x).Fun).Name { - case "int8", "int16", "int32", "uint8", "uint16", "uint32": - return true - default: - return false - } -} - -func (c *truncateCmpChecker) checkCmp(cmpX, cmpY ast.Expr) { - // Check if we have a cast to a type that can truncate. - xcast := astcast.ToCallExpr(cmpX) - if len(xcast.Args) != 1 { - return // Just in case of the shadowed builtin - } - - x := xcast.Args[0] - y := cmpY - - // Check that both x and y are signed or unsigned int-typed. - xtyp, ok := c.ctx.TypeOf(x).Underlying().(*types.Basic) - if !ok || xtyp.Info()&types.IsInteger == 0 { - return - } - ytyp, ok := c.ctx.TypeOf(y).Underlying().(*types.Basic) - if !ok || xtyp.Info() != ytyp.Info() { - return - } - - xsize, ok := c.ctx.SizeOf(xtyp) - if !ok { - return - } - ysize, ok := c.ctx.SizeOf(ytyp) - if !ok { - return - } - if xsize <= ysize { - return - } - - if c.skipArchDependent { - switch xtyp.Kind() { - case types.Int, types.Uint, types.Uintptr: - return - } - } - - c.warn(xcast, xsize*8, ysize*8, xtyp.String()) -} - -func (c *truncateCmpChecker) warn(cause ast.Expr, xsize, ysize int64, suggest string) { - c.ctx.Warn(cause, "truncation in comparison %d->%d bit; cast the other operand to %s instead", xsize, ysize, suggest) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go deleted file mode 100644 index e0d20fd4c5..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/typeAssertChain_checker.go +++ /dev/null @@ -1,133 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "typeAssertChain" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects repeated type assertions and suggests to replace them with type switch statement" - info.Before = ` -if x, ok := v.(T1); ok { - // Code A, uses x. -} else if x, ok := v.(T2); ok { - // Code B, uses x. -} else if x, ok := v.(T3); ok { - // Code C, uses x. -}` - info.After = ` -switch x := v.(T1) { -case cond1: - // Code A, uses x. -case cond2: - // Code B, uses x. -default: - // Code C, uses x. -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&typeAssertChainChecker{ctx: ctx}), nil - }) -} - -type typeAssertChainChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - cause *ast.IfStmt - visited map[*ast.IfStmt]bool - typeSet lintutil.AstSet -} - -func (c *typeAssertChainChecker) EnterFunc(fn *ast.FuncDecl) bool { - if fn.Body == nil { - return false - } - c.visited = make(map[*ast.IfStmt]bool) - return true -} - -func (c *typeAssertChainChecker) VisitStmt(stmt ast.Stmt) { - ifstmt, ok := stmt.(*ast.IfStmt) - if !ok || c.visited[ifstmt] || ifstmt.Init == nil { - return - } - assertion := c.getTypeAssert(ifstmt) - if assertion == nil { - return - } - c.cause = ifstmt - c.checkIfStmt(ifstmt, assertion) -} - -func (c *typeAssertChainChecker) getTypeAssert(ifstmt *ast.IfStmt) *ast.TypeAssertExpr { - assign := astcast.ToAssignStmt(ifstmt.Init) - if len(assign.Lhs) != 2 || len(assign.Rhs) != 1 { - return nil - } - if !astp.IsIdent(assign.Lhs[0]) || assign.Tok != token.DEFINE { - return nil - } - if !astequal.Expr(assign.Lhs[1], ifstmt.Cond) { - return nil - } - - assertion, ok := assign.Rhs[0].(*ast.TypeAssertExpr) - if !ok { - return nil - } - return assertion -} - -func (c *typeAssertChainChecker) checkIfStmt(stmt *ast.IfStmt, assertion *ast.TypeAssertExpr) { - if c.countTypeAssertions(stmt, assertion) >= 2 { - c.warn() - } -} - -func (c *typeAssertChainChecker) countTypeAssertions(stmt *ast.IfStmt, assertion *ast.TypeAssertExpr) int { - c.typeSet.Clear() - - count := 1 - x := assertion.X - c.typeSet.Insert(assertion.Type) - for { - e, ok := stmt.Else.(*ast.IfStmt) - if !ok { - return count - } - assertion = c.getTypeAssert(e) - if assertion == nil { - return count - } - if !c.typeSet.Insert(assertion.Type) { - // Asserted type is duplicated. - // Type switch does not permit duplicate cases, - // so give up. - return 0 - } - if !astequal.Expr(x, assertion.X) { - // Mixed type asserting chain. - // Can't be easily translated to a type switch. - return 0 - } - stmt = e - count++ - c.visited[e] = true - } -} - -func (c *typeAssertChainChecker) warn() { - c.ctx.Warn(c.cause, "rewrite if-else to type switch statement") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeDefFirst_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeDefFirst_checker.go deleted file mode 100644 index 11381c4014..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/typeDefFirst_checker.go +++ /dev/null @@ -1,92 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "typeDefFirst" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects method declarations preceding the type definition itself" - info.Before = ` -func (r rec) Method() {} -type rec struct{} -` - info.After = ` -type rec struct{} -func (r rec) Method() {} -` - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return &typeDefFirstChecker{ - ctx: ctx, - }, nil - }) -} - -type typeDefFirstChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - trackedTypes map[string]bool -} - -func (c *typeDefFirstChecker) WalkFile(f *ast.File) { - if len(f.Decls) == 0 { - return - } - - c.trackedTypes = make(map[string]bool) - for _, decl := range f.Decls { - c.walkDecl(decl) - } -} - -func (c *typeDefFirstChecker) walkDecl(decl ast.Decl) { - switch decl := decl.(type) { - case *ast.FuncDecl: - if decl.Recv == nil { - return - } - receiver := decl.Recv.List[0] - typeName := c.receiverType(receiver.Type) - c.trackedTypes[typeName] = true - - case *ast.GenDecl: - if decl.Tok != token.TYPE { - return - } - for _, spec := range decl.Specs { - spec, ok := spec.(*ast.TypeSpec) - if !ok { - return - } - typeName := spec.Name.Name - if val, ok := c.trackedTypes[typeName]; ok && val { - c.warn(decl, typeName) - } - } - } -} - -func (c *typeDefFirstChecker) receiverType(e ast.Expr) string { - switch e := e.(type) { - case *ast.StarExpr: - return c.receiverType(e.X) - case *ast.Ident: - return e.Name - case *ast.IndexExpr: - return c.receiverType(e.X) - case *ast.IndexListExpr: - return c.receiverType(e.X) - default: - panic("unreachable") - } -} - -func (c *typeDefFirstChecker) warn(cause ast.Node, typeName string) { - c.ctx.Warn(cause, "definition of type '%s' should appear before its methods", typeName) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go deleted file mode 100644 index 4b27b17928..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/typeSwitchVar_checker.go +++ /dev/null @@ -1,98 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "typeSwitchVar" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects type switches that can benefit from type guard clause with variable" - info.Before = ` -switch v.(type) { -case int: - return v.(int) -case point: - return v.(point).x + v.(point).y -default: - return 0 -}` - info.After = ` -switch v := v.(type) { -case int: - return v -case point: - return v.x + v.y -default: - return 0 -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&typeSwitchVarChecker{ctx: ctx}), nil - }) -} - -type typeSwitchVarChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - count int -} - -func (c *typeSwitchVarChecker) VisitStmt(stmt ast.Stmt) { - if stmt, ok := stmt.(*ast.TypeSwitchStmt); ok { - c.count = 0 - c.checkTypeSwitch(stmt) - } -} - -func (c *typeSwitchVarChecker) checkTypeSwitch(root *ast.TypeSwitchStmt) { - if astp.IsAssignStmt(root.Assign) { - return // Already with type guard - } - // Must be a *ast.ExprStmt then. - expr := root.Assign.(*ast.ExprStmt).X.(*ast.TypeAssertExpr).X - object := c.ctx.TypesInfo.ObjectOf(identOf(expr)) - if object == nil { - return // Give up: can't handle shadowing without object - } - - for _, clause := range root.Body.List { - clause := clause.(*ast.CaseClause) - // Multiple types in a list mean that assert.X will have - // a type of interface{} inside clause body. - // We are looking for precise type case. - if len(clause.List) != 1 { - continue - } - // Create artificial node just for matching. - assert1 := ast.TypeAssertExpr{X: expr, Type: clause.List[0]} - for _, stmt := range clause.Body { - assert2 := lintutil.FindNode(stmt, nil, func(x ast.Node) bool { - return astequal.Node(&assert1, x) - }) - if object == c.ctx.TypesInfo.ObjectOf(identOf(assert2)) { - c.count++ - break - } - } - } - if c.count > 0 { - c.warn(root) - } -} - -func (c *typeSwitchVarChecker) warn(n ast.Node) { - msg := "case" - if c.count > 1 { - msg = "cases" - } - c.ctx.Warn(n, "%d "+msg+" can benefit from type switch with assignment", c.count) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go b/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go deleted file mode 100644 index e2e225ebf2..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/typeUnparen_checker.go +++ /dev/null @@ -1,96 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcopy" - "github.com/go-toolsmith/astequal" -) - -func init() { - var info linter.CheckerInfo - info.Name = "typeUnparen" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag} - info.Summary = "Detects unneeded parenthesis inside type expressions and suggests to remove them" - info.Before = `type foo [](func([](func())))` - info.After = `type foo []func([]func())` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForTypeExpr(&typeUnparenChecker{ctx: ctx}, ctx.TypesInfo), nil - }) -} - -type typeUnparenChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *typeUnparenChecker) VisitTypeExpr(e ast.Expr) { - switch e := e.(type) { - case *ast.ParenExpr: - switch e.X.(type) { - case *ast.StructType: - c.ctx.Warn(e, "could simplify (struct{...}) to struct{...}") - case *ast.InterfaceType: - c.ctx.Warn(e, "could simplify (interface{...}) to interface{...}") - default: - c.checkType(e) - } - case *ast.StructType, *ast.InterfaceType: - // Only nested fields are to be reported. - default: - c.checkType(e) - } -} - -func (c *typeUnparenChecker) checkType(e ast.Expr) { - noParens := c.removeRedundantParens(astcopy.Expr(e)) - if !astequal.Expr(e, noParens) { - c.warn(e, noParens) - } - c.SkipChilds = true -} - -func (c *typeUnparenChecker) removeRedundantParens(e ast.Expr) ast.Expr { - switch e := e.(type) { - case *ast.ParenExpr: - return c.removeRedundantParens(e.X) - case *ast.ArrayType: - e.Elt = c.removeRedundantParens(e.Elt) - case *ast.StarExpr: - e.X = c.removeRedundantParens(e.X) - case *ast.TypeAssertExpr: - e.Type = c.removeRedundantParens(e.Type) - case *ast.FuncType: - for _, field := range e.Params.List { - field.Type = c.removeRedundantParens(field.Type) - } - if e.Results != nil { - for _, field := range e.Results.List { - field.Type = c.removeRedundantParens(field.Type) - } - } - case *ast.MapType: - e.Key = c.removeRedundantParens(e.Key) - e.Value = c.removeRedundantParens(e.Value) - case *ast.ChanType: - if valueWithParens, ok := e.Value.(*ast.ParenExpr); ok { - if nestedChan, ok := valueWithParens.X.(*ast.ChanType); ok { - const anyDir = ast.SEND | ast.RECV - if nestedChan.Dir != anyDir || e.Dir != anyDir { - valueWithParens.X = c.removeRedundantParens(valueWithParens.X) - return e - } - } - } - e.Value = c.removeRedundantParens(e.Value) - } - return e -} - -func (c *typeUnparenChecker) warn(cause, noParens ast.Expr) { - c.ctx.Warn(cause, "could simplify %s to %s", cause, noParens) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go b/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go deleted file mode 100644 index 0ce2c89ba7..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/underef_checker.go +++ /dev/null @@ -1,128 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "underef" - info.Tags = []string{linter.StyleTag} - info.Params = linter.CheckerParams{ - "skipRecvDeref": { - Value: true, - Usage: "whether to skip (*x).method() calls where x is a pointer receiver", - }, - } - info.Summary = "Detects dereference expressions that can be omitted" - info.Before = ` -(*k).field = 5 -v := (*a)[5] // only if a is array` - info.After = ` -k.field = 5 -v := a[5]` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &underefChecker{ctx: ctx} - c.skipRecvDeref = info.Params.Bool("skipRecvDeref") - return astwalk.WalkerForExpr(c), nil - }) -} - -type underefChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - skipRecvDeref bool -} - -func (c *underefChecker) VisitExpr(expr ast.Expr) { - switch n := expr.(type) { - case *ast.SelectorExpr: - expr := astcast.ToParenExpr(n.X) - if c.skipRecvDeref && c.isPtrRecvMethodCall(n.Sel) { - return - } - - if expr, ok := expr.X.(*ast.StarExpr); ok { - if c.checkStarExpr(expr) { - c.warnSelect(n) - } - } - case *ast.IndexExpr: - expr := astcast.ToParenExpr(n.X) - if expr, ok := expr.X.(*ast.StarExpr); ok { - if !c.checkStarExpr(expr) { - return - } - if c.checkArray(expr) { - c.warnArray(n) - } - } - } -} - -func (c *underefChecker) isPtrRecvMethodCall(fn *ast.Ident) bool { - typ, ok := c.ctx.TypeOf(fn).(*types.Signature) - if ok && typ != nil && typ.Recv() != nil { - _, ok := typ.Recv().Type().(*types.Pointer) - return ok - } - return false -} - -func (c *underefChecker) underef(x *ast.ParenExpr) ast.Expr { - // If there is only 1 deref, can remove parenthesis, - // otherwise can remove StarExpr only. - dereferenced := x.X.(*ast.StarExpr).X - if astp.IsStarExpr(dereferenced) { - return &ast.ParenExpr{X: dereferenced} - } - return dereferenced -} - -func (c *underefChecker) warnSelect(expr *ast.SelectorExpr) { - // TODO: add () to function output. - c.ctx.Warn(expr, "could simplify %s to %s.%s", - expr, - c.underef(expr.X.(*ast.ParenExpr)), - expr.Sel.Name) -} - -func (c *underefChecker) warnArray(expr *ast.IndexExpr) { - c.ctx.Warn(expr, "could simplify %s to %s[%s]", - expr, - c.underef(expr.X.(*ast.ParenExpr)), - expr.Index) -} - -// checkStarExpr checks if ast.StarExpr could be simplified. -func (c *underefChecker) checkStarExpr(expr *ast.StarExpr) bool { - typ, ok := c.ctx.TypeOf(expr.X).Underlying().(*types.Pointer) - if !ok { - return false - } - - switch typ.Elem().Underlying().(type) { - case *types.Pointer, *types.Interface: - return false - default: - return true - } -} - -func (c *underefChecker) checkArray(expr *ast.StarExpr) bool { - typ, ok := c.ctx.TypeOf(expr.X).(*types.Pointer) - if !ok { - return false - } - _, ok = typ.Elem().(*types.Array) - return ok -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go deleted file mode 100644 index d0e83f3c2e..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/unlabelStmt_checker.go +++ /dev/null @@ -1,181 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "unlabelStmt" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Detects redundant statement labels" - info.Before = ` -derp: -for x := range xs { - if x == 0 { - break derp - } -}` - info.After = ` -for x := range xs { - if x == 0 { - break - } -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmt(&unlabelStmtChecker{ctx: ctx}), nil - }) -} - -type unlabelStmtChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *unlabelStmtChecker) EnterFunc(fn *ast.FuncDecl) bool { - if fn.Body == nil { - return false - } - // TODO(quasilyte): should not do additional traversal here. - // For now, skip all functions that contain goto statement. - return !lintutil.ContainsNode(fn.Body, func(n ast.Node) bool { - br, ok := n.(*ast.BranchStmt) - return ok && br.Tok == token.GOTO - }) -} - -func (c *unlabelStmtChecker) VisitStmt(stmt ast.Stmt) { - labeled, ok := stmt.(*ast.LabeledStmt) - if !ok || !c.canBreakFrom(labeled.Stmt) { - return - } - - // We have a labeled statement from that have labeled continue/break. - // This is an invariant, since unused label is a compile-time error - // and we're currently skipping functions containing goto. - // - // Also note that Go labels are function-scoped and there - // can be no re-definitions. This means that we don't - // need to care about label shadowing or things like that. - // - // The task is to find cases where labeled branch (continue/break) - // is redundant and can be re-written, decreasing the label usages - // and potentially leading to its redundancy, - // or finding the redundant labels right away. - - name := labeled.Label.Name - - // Simplest case that can prove that label is redundant. - // - // If labeled branch is somewhere inside the statement block itself - // and none of the nested break'able statements refer to that label, - // the label can be removed. - matchUsage := func(n ast.Node) bool { - return c.canBreakFrom(n) && c.usesLabel(c.blockStmtOf(n), name) - } - if !lintutil.ContainsNode(c.blockStmtOf(labeled.Stmt), matchUsage) { - c.warnRedundant(labeled) - return - } - - // Only for loops: if last stmt in list is a loop - // that contains labeled "continue" to the outer loop label, - // it can be refactored to use "break" instead. - // Exceptions: select statements with a labeled "continue" are ignored. - if c.isLoop(labeled.Stmt) { - body := c.blockStmtOf(labeled.Stmt) - if len(body.List) == 0 { - return - } - last := body.List[len(body.List)-1] - if !c.isLoop(last) { - return - } - br := lintutil.FindNode(c.blockStmtOf(last), - func(n ast.Node) bool { - switch n.(type) { - case *ast.SelectStmt: - return false - default: - return true - } - }, - func(n ast.Node) bool { - br, ok := n.(*ast.BranchStmt) - return ok && br.Label != nil && - br.Label.Name == name && br.Tok == token.CONTINUE - }) - - if br != nil { - c.warnLabeledContinue(br, name) - } - } -} - -// isLoop reports whether n is a loop of some kind. -// In other words, it tells whether n body can contain "continue" -// associated with n. -func (c *unlabelStmtChecker) isLoop(n ast.Node) bool { - switch n.(type) { - case *ast.ForStmt, *ast.RangeStmt: - return true - default: - return false - } -} - -// canBreakFrom reports whether it is possible to "break" or "continue" from n body. -func (c *unlabelStmtChecker) canBreakFrom(n ast.Node) bool { - switch n.(type) { - case *ast.RangeStmt, *ast.ForStmt, *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt: - return true - default: - return false - } -} - -// blockStmtOf returns body of specified node. -// -// TODO(quasilyte): handle other statements and see if it can be useful -// in other checkers. -func (c *unlabelStmtChecker) blockStmtOf(n ast.Node) *ast.BlockStmt { - switch n := n.(type) { - case *ast.RangeStmt: - return n.Body - case *ast.ForStmt: - return n.Body - case *ast.SwitchStmt: - return n.Body - case *ast.TypeSwitchStmt: - return n.Body - case *ast.SelectStmt: - return n.Body - - default: - return nil - } -} - -// usesLabel reports whether n contains a usage of label. -func (c *unlabelStmtChecker) usesLabel(n *ast.BlockStmt, label string) bool { - return lintutil.ContainsNode(n, func(n ast.Node) bool { - branch, ok := n.(*ast.BranchStmt) - return ok && branch.Label != nil && - branch.Label.Name == label && - (branch.Tok == token.CONTINUE || branch.Tok == token.BREAK) - }) -} - -func (c *unlabelStmtChecker) warnRedundant(cause *ast.LabeledStmt) { - c.ctx.Warn(cause, "label %s is redundant", cause.Label) -} - -func (c *unlabelStmtChecker) warnLabeledContinue(cause ast.Node, label string) { - c.ctx.Warn(cause, "change `continue %s` to `break`", label) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go deleted file mode 100644 index 0401bf5d37..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go +++ /dev/null @@ -1,118 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" -) - -func init() { - var info linter.CheckerInfo - info.Name = "unlambda" - info.Tags = []string{linter.StyleTag} - info.Summary = "Detects function literals that can be simplified" - info.Before = `func(x int) int { return fn(x) }` - info.After = `fn` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&unlambdaChecker{ctx: ctx}), nil - }) -} - -type unlambdaChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *unlambdaChecker) VisitExpr(x ast.Expr) { - fn, ok := x.(*ast.FuncLit) - if !ok || len(fn.Body.List) != 1 { - return - } - - ret, ok := fn.Body.List[0].(*ast.ReturnStmt) - if !ok || len(ret.Results) != 1 { - return - } - - result := astcast.ToCallExpr(ret.Results[0]) - callable := qualifiedName(result.Fun) - if callable == "" { - return // Skip tricky cases; only handle simple calls - } - if isBuiltin(callable) { - return // See #762 - } - hasVars := lintutil.ContainsNode(result.Fun, func(n ast.Node) bool { - id, ok := n.(*ast.Ident) - if !ok { - return false - } - obj, ok := c.ctx.TypesInfo.ObjectOf(id).(*types.Var) - if !ok { - return false - } - // Permit only non-pointer struct method values. - return !typep.IsStruct(obj.Type().Underlying()) - }) - if hasVars { - return // See #888 #1007 - } - - fnType := c.ctx.TypeOf(fn) - resultType := c.ctx.TypeOf(result.Fun) - if !types.Identical(fnType, resultType) { - return - } - // Now check that all arguments match the parameters. - n := 0 - for _, params := range fn.Type.Params.List { - if _, ok := params.Type.(*ast.Ellipsis); ok { - if result.Ellipsis == token.NoPos { - return - } - n++ - continue - } - - for _, id := range params.Names { - if !astequal.Expr(id, result.Args[n]) { - return - } - n++ - } - } - - if c.lenArgs(result.Args) == n { - c.warn(fn, callable) - } -} - -func (c *unlambdaChecker) warn(cause ast.Node, suggestion string) { - c.ctx.Warn(cause, "replace `%s` with `%s`", cause, suggestion) -} - -func (c *unlambdaChecker) lenArgs(args []ast.Expr) int { - lenArgs := len(args) - - for _, arg := range args { - callExp, ok := arg.(*ast.CallExpr) - if !ok { - continue - } - - // Don't count function call. only args. - lenArgs-- - lenArgs += c.lenArgs(callExp.Args) - } - - return lenArgs -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go deleted file mode 100644 index 0d40addf75..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/unnamedResult_checker.go +++ /dev/null @@ -1,103 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "unnamedResult" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Params = linter.CheckerParams{ - "checkExported": { - Value: false, - Usage: "whether to check exported functions", - }, - } - info.Summary = "Detects unnamed results that may benefit from names" - info.Before = `func f() (float64, float64)` - info.After = `func f() (x, y float64)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - c := &unnamedResultChecker{ctx: ctx} - c.checkExported = info.Params.Bool("checkExported") - return astwalk.WalkerForFuncDecl(c), nil - }) -} - -type unnamedResultChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - - checkExported bool -} - -func (c *unnamedResultChecker) VisitFuncDecl(decl *ast.FuncDecl) { - if c.checkExported && !ast.IsExported(decl.Name.Name) { - return - } - results := decl.Type.Results - switch { - case results == nil: - return // Function has no results - case len(results.List) != 0 && results.List[0].Names != nil: - return // Skip named results - } - - typeName := func(x ast.Expr) string { return c.typeName(c.ctx.TypeOf(x)) } - isError := func(x ast.Expr) bool { return qualifiedName(x) == "error" } - isBool := func(x ast.Expr) bool { return qualifiedName(x) == "bool" } - - // Main difference with case of len=2 is that we permit any - // typ1 as long as second type is either error or bool. - if results.NumFields() == 2 { - typ1, typ2 := results.List[0].Type, results.List[1].Type - name1, name2 := typeName(typ1), typeName(typ2) - cond := (name1 != name2 && name2 != "") || - (!isError(typ1) && isError(typ2)) || - (!isBool(typ1) && isBool(typ2)) - if !cond { - c.warn(decl) - } - return - } - - seen := make(map[string]bool, len(results.List)) - for i := range results.List { - typ := results.List[i].Type - name := typeName(typ) - isLast := i == len(results.List)-1 - - cond := !seen[name] || - (isLast && (isError(typ) || isBool(typ))) - if !cond { - c.warn(decl) - return - } - - seen[name] = true - } -} - -func (c *unnamedResultChecker) typeName(typ types.Type) string { - switch typ := typ.(type) { - case *types.Array: - return c.typeName(typ.Elem()) - case *types.Pointer: - return c.typeName(typ.Elem()) - case *types.Slice: - return c.typeName(typ.Elem()) - case *types.Named: - return typ.Obj().Name() - default: - return "" - } -} - -func (c *unnamedResultChecker) warn(n ast.Node) { - c.ctx.Warn(n, "consider giving a name to these results") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go deleted file mode 100644 index b577ff4219..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryBlock_checker.go +++ /dev/null @@ -1,78 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astp" -) - -func init() { - var info linter.CheckerInfo - info.Name = "unnecessaryBlock" - info.Tags = []string{linter.StyleTag, linter.OpinionatedTag, linter.ExperimentalTag} - info.Summary = "Detects unnecessary braced statement blocks" - info.Before = ` -x := 1 -{ - print(x) -}` - info.After = ` -x := 1 -print(x)` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForStmtList(&unnecessaryBlockChecker{ctx: ctx}), nil - }) -} - -type unnecessaryBlockChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *unnecessaryBlockChecker) VisitStmtList(x ast.Node, statements []ast.Stmt) { - // Using StmtListVisitor instead of StmtVisitor makes it easier to avoid - // false positives on IfStmt, RangeStmt, ForStmt and alike. - // We only inspect BlockStmt inside statement lists, so this method is not - // called for IfStmt itself, for example. - - if (astp.IsCaseClause(x) || astp.IsCommClause(x)) && len(statements) == 1 { - if _, ok := statements[0].(*ast.BlockStmt); ok { - c.ctx.Warn(statements[0], "case statement doesn't require a block statement") - return - } - } - - for _, stmt := range statements { - stmt, ok := stmt.(*ast.BlockStmt) - if ok && !c.hasDefinitions(stmt) { - c.warn(stmt) - } - } -} - -func (c *unnecessaryBlockChecker) hasDefinitions(stmt *ast.BlockStmt) bool { - for _, bs := range stmt.List { - switch stmt := bs.(type) { - case *ast.AssignStmt: - if stmt.Tok == token.DEFINE { - return true - } - case *ast.DeclStmt: - decl := stmt.Decl.(*ast.GenDecl) - if len(decl.Specs) != 0 { - return true - } - } - } - - return false -} - -func (c *unnecessaryBlockChecker) warn(expr ast.Stmt) { - c.ctx.Warn(expr, "block doesn't have definitions, can be simply deleted") -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go deleted file mode 100644 index 4c1ed41f6f..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/unnecessaryDefer_checker.go +++ /dev/null @@ -1,112 +0,0 @@ -package checkers - -import ( - "go/ast" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astfmt" -) - -func init() { - var info linter.CheckerInfo - info.Name = "unnecessaryDefer" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects redundantly deferred calls" - info.Before = ` -func() { - defer os.Remove(filename) -}` - info.After = ` -func() { - os.Remove(filename) -}` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForFuncDecl(&unnecessaryDeferChecker{ctx: ctx}), nil - }) -} - -type unnecessaryDeferChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext - isFunc bool -} - -// Visit implements the ast.Visitor. This visitor keeps track of the block -// statement belongs to a function or any other block. If the block is not a -// function and ends with a defer statement that should be OK since it's -// deferring the outer function. -func (c *unnecessaryDeferChecker) Visit(node ast.Node) ast.Visitor { - switch n := node.(type) { - case *ast.FuncDecl, *ast.FuncLit: - c.isFunc = true - case *ast.BlockStmt: - c.checkDeferBeforeReturn(n) - default: - c.isFunc = false - } - - return c -} - -func (c *unnecessaryDeferChecker) VisitFuncDecl(funcDecl *ast.FuncDecl) { - // We always start as a function (*ast.FuncDecl.Body passed) - c.isFunc = true - - ast.Walk(c, funcDecl.Body) -} - -func (c *unnecessaryDeferChecker) checkDeferBeforeReturn(funcDecl *ast.BlockStmt) { - // Check if we have an explicit return or if it's just the end of the scope. - explicitReturn := false - retIndex := len(funcDecl.List) - for i, stmt := range funcDecl.List { - retStmt, ok := stmt.(*ast.ReturnStmt) - if !ok { - continue - } - explicitReturn = true - if !c.isTrivialReturn(retStmt) { - continue - } - retIndex = i - break - } - if retIndex == 0 { - return - } - - if deferStmt, ok := funcDecl.List[retIndex-1].(*ast.DeferStmt); ok { - // If the block is a function and ending with return or if we have an - // explicit return in any other block we should warn about - // unnecessary defer. - if c.isFunc || explicitReturn { - c.warn(deferStmt) - } - } -} - -func (c *unnecessaryDeferChecker) isTrivialReturn(ret *ast.ReturnStmt) bool { - for _, e := range ret.Results { - if !c.isConstExpr(e) { - return false - } - } - return true -} - -func (c *unnecessaryDeferChecker) isConstExpr(e ast.Expr) bool { - return c.ctx.TypesInfo.Types[e].Value != nil -} - -func (c *unnecessaryDeferChecker) warn(deferStmt *ast.DeferStmt) { - s := astfmt.Sprint(deferStmt) - if fnlit, ok := deferStmt.Call.Fun.(*ast.FuncLit); ok { - // To avoid long and multi-line warning messages, - // collapse the function literals. - s = "defer " + astfmt.Sprint(fnlit.Type) + "{...}(...)" - } - c.ctx.Warn(deferStmt, "%s is placed just before return", s) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/utils.go b/vendor/github.com/go-critic/go-critic/checkers/utils.go deleted file mode 100644 index 4757bbf5f3..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/utils.go +++ /dev/null @@ -1,309 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - "strings" - - "github.com/go-critic/go-critic/linter" -) - -// goStdlib contains `go list std` command output list. -// Used to detect packages that belong to standard Go packages distribution. -var goStdlib = map[string]bool{ - "archive/tar": true, - "archive/zip": true, - "bufio": true, - "bytes": true, - "compress/bzip2": true, - "compress/flate": true, - "compress/gzip": true, - "compress/lzw": true, - "compress/zlib": true, - "container/heap": true, - "container/list": true, - "container/ring": true, - "context": true, - "crypto": true, - "crypto/aes": true, - "crypto/cipher": true, - "crypto/des": true, - "crypto/dsa": true, - "crypto/ecdsa": true, - "crypto/elliptic": true, - "crypto/hmac": true, - "crypto/internal/randutil": true, - "crypto/internal/subtle": true, - "crypto/md5": true, - "crypto/rand": true, - "crypto/rc4": true, - "crypto/rsa": true, - "crypto/sha1": true, - "crypto/sha256": true, - "crypto/sha512": true, - "crypto/subtle": true, - "crypto/tls": true, - "crypto/x509": true, - "crypto/x509/pkix": true, - "database/sql": true, - "database/sql/driver": true, - "debug/dwarf": true, - "debug/elf": true, - "debug/gosym": true, - "debug/macho": true, - "debug/pe": true, - "debug/plan9obj": true, - "encoding": true, - "encoding/ascii85": true, - "encoding/asn1": true, - "encoding/base32": true, - "encoding/base64": true, - "encoding/binary": true, - "encoding/csv": true, - "encoding/gob": true, - "encoding/hex": true, - "encoding/json": true, - "encoding/pem": true, - "encoding/xml": true, - "errors": true, - "expvar": true, - "flag": true, - "fmt": true, - "go/ast": true, - "go/build": true, - "go/constant": true, - "go/doc": true, - "go/format": true, - "go/importer": true, - "go/internal/gccgoimporter": true, - "go/internal/gcimporter": true, - "go/internal/srcimporter": true, - "go/parser": true, - "go/printer": true, - "go/scanner": true, - "go/token": true, - "go/types": true, - "hash": true, - "hash/adler32": true, - "hash/crc32": true, - "hash/crc64": true, - "hash/fnv": true, - "html": true, - "html/template": true, - "image": true, - "image/color": true, - "image/color/palette": true, - "image/draw": true, - "image/gif": true, - "image/internal/imageutil": true, - "image/jpeg": true, - "image/png": true, - "index/suffixarray": true, - "internal/bytealg": true, - "internal/cpu": true, - "internal/nettrace": true, - "internal/poll": true, - "internal/race": true, - "internal/singleflight": true, - "internal/syscall/unix": true, - "internal/syscall/windows": true, - "internal/syscall/windows/registry": true, - "internal/syscall/windows/sysdll": true, - "internal/testenv": true, - "internal/testlog": true, - "internal/trace": true, - "io": true, - "io/ioutil": true, - "log": true, - "log/syslog": true, - "math": true, - "math/big": true, - "math/bits": true, - "math/cmplx": true, - "math/rand": true, - "mime": true, - "mime/multipart": true, - "mime/quotedprintable": true, - "net": true, - "net/http": true, - "net/http/cgi": true, - "net/http/cookiejar": true, - "net/http/fcgi": true, - "net/http/httptest": true, - "net/http/httptrace": true, - "net/http/httputil": true, - "net/http/internal": true, - "net/http/pprof": true, - "net/internal/socktest": true, - "net/mail": true, - "net/rpc": true, - "net/rpc/jsonrpc": true, - "net/smtp": true, - "net/textproto": true, - "net/url": true, - "os": true, - "os/exec": true, - "os/signal": true, - "os/signal/internal/pty": true, - "os/user": true, - "path": true, - "path/filepath": true, - "plugin": true, - "reflect": true, - "regexp": true, - "regexp/syntax": true, - "runtime": true, - "runtime/cgo": true, - "runtime/debug": true, - "runtime/internal/atomic": true, - "runtime/internal/sys": true, - "runtime/pprof": true, - "runtime/pprof/internal/profile": true, - "runtime/race": true, - "runtime/trace": true, - "sort": true, - "strconv": true, - "strings": true, - "sync": true, - "sync/atomic": true, - "syscall": true, - "testing": true, - "testing/internal/testdeps": true, - "testing/iotest": true, - "testing/quick": true, - "text/scanner": true, - "text/tabwriter": true, - "text/template": true, - "text/template/parse": true, - "time": true, - "unicode": true, - "unicode/utf16": true, - "unicode/utf8": true, - "unsafe": true, -} - -var goBuiltins = map[string]bool{ - // Types - "bool": true, - "byte": true, - "complex64": true, - "complex128": true, - "error": true, - "float32": true, - "float64": true, - "int": true, - "int8": true, - "int16": true, - "int32": true, - "int64": true, - "rune": true, - "string": true, - "uint": true, - "uint8": true, - "uint16": true, - "uint32": true, - "uint64": true, - "uintptr": true, - - // Constants - "true": true, - "false": true, - "iota": true, - - // Zero value - "nil": true, - - // Functions - "append": true, - "cap": true, - "close": true, - "complex": true, - "copy": true, - "delete": true, - "imag": true, - "len": true, - "make": true, - "new": true, - "panic": true, - "print": true, - "println": true, - "real": true, - "recover": true, -} - -// isBuiltin reports whether sym belongs to a predefined identifier set. -func isBuiltin(sym string) bool { - return goBuiltins[sym] -} - -// isStdlibPkg reports whether pkg is a package from the Go standard library. -func isStdlibPkg(pkg *types.Package) bool { - return pkg != nil && goStdlib[pkg.Path()] -} - -// isExampleTestFunc reports whether FuncDecl looks like a testable example function. -func isExampleTestFunc(fn *ast.FuncDecl) bool { - return len(fn.Type.Params.List) == 0 && strings.HasPrefix(fn.Name.String(), "Example") -} - -// isUnitTestFunc reports whether FuncDecl declares testing function. -func isUnitTestFunc(ctx *linter.CheckerContext, fn *ast.FuncDecl) bool { - if !strings.HasPrefix(fn.Name.Name, "Test") { - return false - } - typ := ctx.TypesInfo.TypeOf(fn.Name) - if sig, ok := typ.(*types.Signature); ok { - return sig.Results().Len() == 0 && - sig.Params().Len() == 1 && - sig.Params().At(0).Type().String() == "*testing.T" - } - return false -} - -// qualifiedName returns called expr fully-qualified name. -// -// It works for simple identifiers like f => "f" and identifiers -// from other package like pkg.f => "pkg.f". -// -// For all unexpected expressions returns empty string. -func qualifiedName(x ast.Expr) string { - switch x := x.(type) { - case *ast.SelectorExpr: - pkg, ok := x.X.(*ast.Ident) - if !ok { - return "" - } - return pkg.Name + "." + x.Sel.Name - case *ast.Ident: - return x.Name - default: - return "" - } -} - -// identOf returns identifier for x that can be used to obtain associated types.Object. -// Returns nil for expressions that yield temporary results, like `f().field`. -func identOf(x ast.Node) *ast.Ident { - switch x := x.(type) { - case *ast.Ident: - return x - case *ast.SelectorExpr: - return identOf(x.Sel) - case *ast.TypeAssertExpr: - // x.(type) - x may contain ident. - return identOf(x.X) - case *ast.IndexExpr: - // x[i] - x may contain ident. - return identOf(x.X) - case *ast.StarExpr: - // *x - x may contain ident. - return identOf(x.X) - case *ast.SliceExpr: - // x[:] - x may contain ident. - return identOf(x.X) - - default: - // Note that this function is not comprehensive. - return nil - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go b/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go deleted file mode 100644 index 3d7c9c1225..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/weakCond_checker.go +++ /dev/null @@ -1,78 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/token" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/checkers/internal/lintutil" - "github.com/go-critic/go-critic/linter" - - "github.com/go-toolsmith/astcast" - "github.com/go-toolsmith/astequal" - "github.com/go-toolsmith/typep" - "golang.org/x/tools/go/ast/astutil" -) - -func init() { - var info linter.CheckerInfo - info.Name = "weakCond" - info.Tags = []string{linter.DiagnosticTag, linter.ExperimentalTag} - info.Summary = "Detects conditions that are unsafe due to not being exhaustive" - info.Before = `xs != nil && xs[0] != nil` - info.After = `len(xs) != 0 && xs[0] != nil` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForExpr(&weakCondChecker{ctx: ctx}), nil - }) -} - -type weakCondChecker struct { - astwalk.WalkHandler - ctx *linter.CheckerContext -} - -func (c *weakCondChecker) VisitExpr(expr ast.Expr) { - // TODO(Quasilyte): more patterns. - // TODO(Quasilyte): analyze and fix false positives. - - cond := astcast.ToBinaryExpr(expr) - lhs := astcast.ToBinaryExpr(astutil.Unparen(cond.X)) - rhs := astutil.Unparen(cond.Y) - - // Pattern 1. - // `x != nil && usageOf(x[i])` - // Pattern 2. - // `x == nil || usageOf(x[i])` - - // lhs is `x nil` - x := lhs.X - if !typep.IsSlice(c.ctx.TypeOf(x)) { - return - } - if astcast.ToIdent(lhs.Y).Name != "nil" { - return - } - - pat1prefix := cond.Op == token.LAND && lhs.Op == token.NEQ - pat2prefix := cond.Op == token.LOR && lhs.Op == token.EQL - if !pat1prefix && !pat2prefix { - return - } - - if c.isIndexed(rhs, x) { - c.warn(expr, "nil check may not be enough, check for len") - } -} - -// isIndexed reports whether x is indexed inside given expr tree. -func (c *weakCondChecker) isIndexed(tree, x ast.Expr) bool { - return lintutil.ContainsNode(tree, func(n ast.Node) bool { - indexing := astcast.ToIndexExpr(n) - return astequal.Expr(x, indexing.X) - }) -} - -func (c *weakCondChecker) warn(cause ast.Node, suggest string) { - c.ctx.Warn(cause, "suspicious `%s`; %s", cause, suggest) -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go b/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go deleted file mode 100644 index eaa53e5d5b..0000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go +++ /dev/null @@ -1,50 +0,0 @@ -package checkers - -import ( - "go/ast" - "regexp" - "strings" - - "github.com/go-critic/go-critic/checkers/internal/astwalk" - "github.com/go-critic/go-critic/linter" -) - -func init() { - var info linter.CheckerInfo - info.Name = "whyNoLint" - info.Tags = []string{linter.StyleTag, linter.ExperimentalTag} - info.Summary = "Ensures that `//nolint` comments include an explanation" - info.Before = `//nolint` - info.After = `//nolint // reason` - - collection.AddChecker(&info, func(ctx *linter.CheckerContext) (linter.FileWalker, error) { - return astwalk.WalkerForComment(&whyNoLintChecker{ - ctx: ctx, - re: regexp.MustCompile(`^// *nolint(?::[^ ]+)? *(.*)$`), - }), nil - }) -} - -type whyNoLintChecker struct { - astwalk.WalkHandler - - ctx *linter.CheckerContext - re *regexp.Regexp -} - -func (c whyNoLintChecker) VisitComment(cg *ast.CommentGroup) { - if strings.HasPrefix(cg.List[0].Text, "/*") { - return - } - for _, comment := range cg.List { - sl := c.re.FindStringSubmatch(comment.Text) - if len(sl) < 2 { - continue - } - - if s := sl[1]; !strings.HasPrefix(s, "//") || strings.TrimPrefix(s, "//") == "" { - c.ctx.Warn(cg, "include an explanation for nolint directive") - return - } - } -} diff --git a/vendor/github.com/go-critic/go-critic/linter/go_version.go b/vendor/github.com/go-critic/go-critic/linter/go_version.go deleted file mode 100644 index b5ef2f75ff..0000000000 --- a/vendor/github.com/go-critic/go-critic/linter/go_version.go +++ /dev/null @@ -1,52 +0,0 @@ -package linter - -import ( - "fmt" - "strconv" - "strings" -) - -type GoVersion struct { - Major int - Minor int -} - -// GreaterOrEqual performs $v >= $other operation. -// -// In other words, it reports whether $v version constraint can use -// a feature from the $other Go version. -// -// As a special case, Major=0 covers all versions. -func (v GoVersion) GreaterOrEqual(other GoVersion) bool { - switch { - case v.Major == 0: - return true - case v.Major == other.Major: - return v.Minor >= other.Minor - default: - return v.Major >= other.Major - } -} - -func ParseGoVersion(version string) (GoVersion, error) { - var result GoVersion - version = strings.TrimPrefix(version, "go") - if version == "" { - return result, nil - } - parts := strings.Split(version, ".") - if len(parts) != 2 { - return result, fmt.Errorf("invalid Go version format: %s", version) - } - major, err := strconv.Atoi(parts[0]) - if err != nil { - return result, fmt.Errorf("invalid major version part: %s: %w", parts[0], err) - } - minor, err := strconv.Atoi(parts[1]) - if err != nil { - return result, fmt.Errorf("invalid minor version part: %s: %w", parts[1], err) - } - result.Major = major - result.Minor = minor - return result, nil -} diff --git a/vendor/github.com/go-critic/go-critic/linter/helpers.go b/vendor/github.com/go-critic/go-critic/linter/helpers.go deleted file mode 100644 index 0a3fc0292f..0000000000 --- a/vendor/github.com/go-critic/go-critic/linter/helpers.go +++ /dev/null @@ -1,136 +0,0 @@ -package linter - -import ( - "fmt" - "regexp" - "sort" - "strings" - - "github.com/go-toolsmith/astfmt" -) - -type checkerProto struct { - info *CheckerInfo - constructor func(*Context) (*Checker, error) -} - -// prototypes is a set of registered checkers that are not yet instantiated. -// Registration should be done with AddChecker function. -// Initialized checkers can be obtained with NewChecker function. -var prototypes = make(map[string]checkerProto) - -func getCheckersInfo() []*CheckerInfo { - infoList := make([]*CheckerInfo, 0, len(prototypes)) - for _, proto := range prototypes { - infoCopy := *proto.info - infoList = append(infoList, &infoCopy) - } - sort.Slice(infoList, func(i, j int) bool { - return infoList[i].Name < infoList[j].Name - }) - return infoList -} - -func addChecker(info *CheckerInfo, constructor func(*CheckerContext) (FileWalker, error)) { - if _, ok := prototypes[info.Name]; ok { - panic(fmt.Sprintf("checker with name %q already registered", info.Name)) - } - - // Validate param value type. - for pname, param := range info.Params { - switch param.Value.(type) { - case string, int, bool: - // OK. - default: - panic(fmt.Sprintf("unsupported %q param type value: %T", - pname, param.Value)) - } - } - - trimDocumentation := func(info *CheckerInfo) { - fields := []*string{ - &info.Summary, - &info.Details, - &info.Before, - &info.After, - &info.Note, - } - for _, f := range fields { - *f = strings.TrimSpace(*f) - } - } - - trimDocumentation(info) - - if err := validateCheckerInfo(info); err != nil { - panic(err) - } - - proto := checkerProto{ - info: info, - constructor: func(ctx *Context) (*Checker, error) { - var c Checker - c.Info = info - c.ctx = CheckerContext{ - Context: ctx, - printer: astfmt.NewPrinter(ctx.FileSet), - } - var err error - c.fileWalker, err = constructor(&c.ctx) - return &c, err - }, - } - - prototypes[info.Name] = proto -} - -func newChecker(ctx *Context, info *CheckerInfo) (*Checker, error) { - proto, ok := prototypes[info.Name] - if !ok { - panic(fmt.Sprintf("checker with name %q not registered", info.Name)) - } - return proto.constructor(ctx) -} - -func validateCheckerInfo(info *CheckerInfo) error { - steps := []func(*CheckerInfo) error{ - validateCheckerName, - validateCheckerDocumentation, - validateCheckerTags, - } - - for _, step := range steps { - if err := step(info); err != nil { - return fmt.Errorf("%q validation error: %v", info.Name, err) - } - } - return nil -} - -var validIdentRE = regexp.MustCompile(`^\w+$`) - -func validateCheckerName(info *CheckerInfo) error { - if !validIdentRE.MatchString(info.Name) { - return fmt.Errorf("checker name contains illegal chars") - } - return nil -} - -func validateCheckerDocumentation(info *CheckerInfo) error { - // TODO(quasilyte): validate documentation. - return nil -} - -func validateCheckerTags(info *CheckerInfo) error { - tagSet := make(map[string]bool) - for _, tag := range info.Tags { - if tagSet[tag] { - return fmt.Errorf("duplicated tag %q", tag) - } - if !validIdentRE.MatchString(tag) { - return fmt.Errorf("checker tag %q contains illegal chars", tag) - } - tagSet[tag] = true - } - return nil -} diff --git a/vendor/github.com/go-critic/go-critic/linter/linter.go b/vendor/github.com/go-critic/go-critic/linter/linter.go deleted file mode 100644 index d4bc17536e..0000000000 --- a/vendor/github.com/go-critic/go-critic/linter/linter.go +++ /dev/null @@ -1,401 +0,0 @@ -package linter - -import ( - "go/ast" - "go/token" - "go/types" - "strconv" - "strings" - - "github.com/go-toolsmith/astfmt" -) - -const ( - DiagnosticTag = "diagnostic" - ExperimentalTag = "experimental" - OpinionatedTag = "opinionated" - PerformanceTag = "performance" - SecurityTag = "security" - StyleTag = "style" -) - -// UnknownType is a special sentinel value that is returned from the CheckerContext.TypeOf -// method instead of the nil type. -var UnknownType types.Type = types.Typ[types.Invalid] - -// FileWalker is an interface every checker should implement. -// -// The WalkFile method is executed for every Go file inside the -// package that is being checked. -type FileWalker interface { - WalkFile(*ast.File) -} - -// CheckerCollection provides additional information for a group of checkers. -type CheckerCollection struct { - // URL is a link for a main source of information on the collection. - URL string -} - -// AddChecker registers a new checker into a checkers pool. -// Constructor is used to create a new checker instance. -// Checker name (defined in CheckerInfo.Name) must be unique. -// -// CheckerInfo.Collection is automatically set to the coll (the receiver). -// -// If checker is never needed, for example if it is disabled, -// constructor will not be called. -func (coll *CheckerCollection) AddChecker(info *CheckerInfo, constructor func(*CheckerContext) (FileWalker, error)) { - if coll == nil { - panic("adding checker to a nil collection") - } - info.Collection = coll - addChecker(info, constructor) -} - -// CheckerParam describes a single checker customizable parameter. -type CheckerParam struct { - // Value holds parameter bound value. - // It might be overwritten by the integrating linter. - // - // Permitted types include: - // - int - // - bool - // - string - Value interface{} - - // Usage gives an overview about what parameter does. - Usage string -} - -// CheckerParams holds all checker-specific parameters. -// -// Provides convenient access to the loosely typed underlying map. -type CheckerParams map[string]*CheckerParam - -// Int lookups pname key in underlying map and type-asserts it to int. -func (params CheckerParams) Int(pname string) int { return params[pname].Value.(int) } - -// Bool lookups pname key in underlying map and type-asserts it to bool. -func (params CheckerParams) Bool(pname string) bool { return params[pname].Value.(bool) } - -// String lookups pname key in underlying map and type-asserts it to string. -func (params CheckerParams) String(pname string) string { return params[pname].Value.(string) } - -// CheckerInfo holds checker metadata and structured documentation. -type CheckerInfo struct { - // Name is a checker name. - Name string - - // Tags is a list of labels that can be used to enable or disable checker. - // Common tags are "experimental" and "performance". - Tags []string - - // Params declares checker-specific parameters. Optional. - Params CheckerParams - - // Summary is a short one sentence description. - // Should not end with a period. - Summary string - - // Details extends summary with additional info. Optional. - Details string - - // Before is a code snippet of code that will violate rule. - Before string - - // After is a code snippet of fixed code that complies to the rule. - After string - - // Note is an optional caution message or advice. - Note string - - // EmbeddedRuleguard tells whether this checker is auto-generated - // from the embedded ruleguard rules. - EmbeddedRuleguard bool - - // Collection establishes a checker-to-collection relationship. - Collection *CheckerCollection -} - -// GetCheckersInfo returns a checkers info list for all registered checkers. -// The slice is sorted by a checker name. -// -// Info objects can be used to instantiate checkers with NewChecker function. -func GetCheckersInfo() []*CheckerInfo { - return getCheckersInfo() -} - -// HasTag reports whether checker described by the info has specified tag. -func (info *CheckerInfo) HasTag(tag string) bool { - for i := range info.Tags { - if info.Tags[i] == tag { - return true - } - } - return false -} - -// Checker is an implementation of a check that is described by the associated info. -type Checker struct { - // Info is an info object that was used to instantiate this checker. - Info *CheckerInfo - - ctx CheckerContext - - fileWalker FileWalker -} - -// NewChecker returns initialized checker identified by an info. -// info must be non-nil. -// Returns an error if info describes a checker that was not properly registered, -// or if checker fails to initialize. -func NewChecker(ctx *Context, info *CheckerInfo) (*Checker, error) { - return newChecker(ctx, info) -} - -// Check runs rule checker over file f. -func (c *Checker) Check(f *ast.File) []Warning { - c.ctx.warnings = c.ctx.warnings[:0] - c.fileWalker.WalkFile(f) - return c.ctx.warnings -} - -// QuickFix is our analysis.TextEdit; we're using it here to avoid -// direct analysis package dependency for now. -type QuickFix struct { - From token.Pos - To token.Pos - Replacement []byte -} - -// Warning represents issue that is found by checker. -type Warning struct { - Pos token.Pos - - // Text is warning message without source location info. - Text string - - // Suggestion is a quick fix for a given problem. - // QuickFix is analysis.TextEdit and can be used to - // construct an analysis.SuggestedFix object. - // - // For convenience, there is Warning.HasQuickFix() method - // that reports whether Suggestion has something meaningful. - Suggestion QuickFix -} - -// HasQuickFix reports whether this warning has a suggested fix. -func (warn Warning) HasQuickFix() bool { - return warn.Suggestion.Replacement != nil -} - -// Context is a readonly state shared among every checker. -type Context struct { - // TypesInfo carries parsed packages types information. - TypesInfo *types.Info - - // SizesInfo carries alignment and type size information. - // Arch-dependent. - SizesInfo types.Sizes - - // GoVersion is a target Go version. - GoVersion GoVersion - - // FileSet is a file set that was used during the program loading. - FileSet *token.FileSet - - // Pkg describes package that is being checked. - Pkg *types.Package - - // Filename is a currently checked file name. - Filename string - - // Require records what optional resources are required - // by the checkers set that use this context. - // - // Every require fields makes associated context field - // to be properly initialized. - // For example, Context.require.PkgObjects => Context.PkgObjects. - Require struct { - PkgObjects bool - PkgRenames bool - } - - // PkgObjects stores all imported packages and their local names. - PkgObjects map[*types.PkgName]string - - // PkgRenames maps package path to its local renaming. - // Contains no entries for packages that were imported without - // explicit local names. - PkgRenames map[string]string -} - -// NewContext returns new shared context to be used by every checker. -// -// All data carried by the context is readonly for checkers, -// but can be modified by the integrating application. -func NewContext(fset *token.FileSet, sizes types.Sizes) *Context { - return &Context{ - FileSet: fset, - SizesInfo: sizes, - TypesInfo: &types.Info{}, - } -} - -// SetGoVersion adjust the target Go language version. -// -// The format is like "1.5", "1.8", etc. -// It's permitted to have "go" prefix (e.g. "go1.5"). -// -// Empty string (the default) means that we make no -// Go version assumptions and (like gocritic does) behave -// like all features are available. To make gocritic -// more conservative, the upper Go version level should be adjusted. -func (c *Context) SetGoVersion(version string) { - v, err := ParseGoVersion(version) - if err != nil { - panic(err) - } - c.GoVersion = v -} - -// SetPackageInfo sets package-related metadata. -// -// Must be called for every package being checked. -func (c *Context) SetPackageInfo(info *types.Info, pkg *types.Package) { - if info != nil { - // We do this kind of assignment to avoid - // changing c.typesInfo field address after - // every re-assignment. - *c.TypesInfo = *info - } - c.Pkg = pkg -} - -// SetFileInfo sets file-related metadata. -// -// Must be called for every source code file being checked. -func (c *Context) SetFileInfo(name string, f *ast.File) { - c.Filename = name - if c.Require.PkgObjects { - resolvePkgObjects(c, f) - } - if c.Require.PkgRenames { - resolvePkgRenames(c, f) - } -} - -// CheckerContext is checker-local context copy. -// Fields that are not from Context itself are writeable. -type CheckerContext struct { - *Context - - // printer used to format warning text. - printer *astfmt.Printer - - warnings []Warning -} - -// Warn adds a Warning to checker output. -func (ctx *CheckerContext) Warn(node ast.Node, format string, args ...interface{}) { - ctx.WarnWithPos(node.Pos(), format, args...) -} - -// WarnFixable emits a warning with a fix suggestion provided by the caller. -func (ctx *CheckerContext) WarnFixable(node ast.Node, fix QuickFix, format string, args ...interface{}) { - ctx.WarnFixableWithPos(node.Pos(), fix, format, args...) -} - -// WarnWithPos adds a Warning to checker output. Useful for ruleguard's Report func. -func (ctx *CheckerContext) WarnWithPos(pos token.Pos, format string, args ...interface{}) { - ctx.warnings = append(ctx.warnings, Warning{ - Text: ctx.printer.Sprintf(format, args...), - Pos: pos, - }) -} - -// WarnFixableWithPos adds a Warning to checker output. Useful for ruleguard's Report func. -func (ctx *CheckerContext) WarnFixableWithPos(pos token.Pos, fix QuickFix, format string, args ...interface{}) { - ctx.warnings = append(ctx.warnings, Warning{ - Text: ctx.printer.Sprintf(format, args...), - Pos: pos, - Suggestion: fix, - }) -} - -// TypeOf returns the type of expression x. -// -// Unlike TypesInfo.TypeOf, it never returns nil. -// Instead, it returns the Invalid type as a sentinel UnknownType value. -func (ctx *CheckerContext) TypeOf(x ast.Expr) types.Type { - typ := ctx.TypesInfo.TypeOf(x) - if typ != nil { - return typ - } - // Usually it means that some incorrect type info was loaded - // or the analyzed package was only partially (?) correct. - // To avoid nil pointer panics we can return a sentinel value - // that will fail most type assertions as well as kind checks - // (if the call side expects a *types.Basic). - return UnknownType -} - -// SizeOf returns the size of the typ in bytes. -// -// Unlike SizesInfo.SizeOf, it will not panic on generic types. -func (ctx *CheckerContext) SizeOf(typ types.Type) (int64, bool) { - if _, ok := typ.(*types.TypeParam); ok { - return 0, false - } - if named, ok := typ.(*types.Named); ok && named.TypeParams() != nil { - return 0, false - } - return ctx.safeSizesInfoSizeof(typ) -} - -// safeSizesInfoSizeof unlike SizesInfo.Sizeof will not panic on struct with generic fields. -// it will catch a panic and recover from it, see https://github.com/go-critic/go-critic/issues/1354 -func (ctx *CheckerContext) safeSizesInfoSizeof(typ types.Type) (size int64, ok bool) { - ok = true - defer func() { - if r := recover(); r != nil { - if strings.Contains(r.(string), "assertion failed") { - size, ok = 0, false - } else { - panic(r) - } - } - }() - - size = ctx.SizesInfo.Sizeof(typ) - return size, ok -} - -func resolvePkgObjects(ctx *Context, f *ast.File) { - ctx.PkgObjects = make(map[*types.PkgName]string, len(f.Imports)) - - for _, spec := range f.Imports { - if spec.Name != nil { - obj := ctx.TypesInfo.ObjectOf(spec.Name) - ctx.PkgObjects[obj.(*types.PkgName)] = spec.Name.Name - } else { - obj := ctx.TypesInfo.Implicits[spec] - ctx.PkgObjects[obj.(*types.PkgName)] = obj.Name() - } - } -} - -func resolvePkgRenames(ctx *Context, f *ast.File) { - ctx.PkgRenames = make(map[string]string) - - for _, spec := range f.Imports { - if spec.Name != nil { - path, err := strconv.Unquote(spec.Path.Value) - if err != nil { - panic(err) - } - ctx.PkgRenames[path] = spec.Name.Name - } - } -} diff --git a/vendor/github.com/go-git/gcfg/.gitignore b/vendor/github.com/go-git/gcfg/.gitignore deleted file mode 100644 index 2d830686d4..0000000000 --- a/vendor/github.com/go-git/gcfg/.gitignore +++ /dev/null @@ -1 +0,0 @@ -coverage.out diff --git a/vendor/github.com/go-git/gcfg/LICENSE b/vendor/github.com/go-git/gcfg/LICENSE deleted file mode 100644 index 87a5cede33..0000000000 --- a/vendor/github.com/go-git/gcfg/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 Péter Surányi. Portions Copyright (c) 2009 The Go -Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/go-git/gcfg/Makefile b/vendor/github.com/go-git/gcfg/Makefile deleted file mode 100644 index 73604da6b6..0000000000 --- a/vendor/github.com/go-git/gcfg/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# General -WORKDIR = $(PWD) - -# Go parameters -GOCMD = go -GOTEST = $(GOCMD) test - -# Coverage -COVERAGE_REPORT = coverage.out -COVERAGE_MODE = count - -test: - $(GOTEST) ./... - -test-coverage: - echo "" > $(COVERAGE_REPORT); \ - $(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./... diff --git a/vendor/github.com/go-git/gcfg/README b/vendor/github.com/go-git/gcfg/README deleted file mode 100644 index 1ff233a529..0000000000 --- a/vendor/github.com/go-git/gcfg/README +++ /dev/null @@ -1,4 +0,0 @@ -Gcfg reads INI-style configuration files into Go structs; -supports user-defined types and subsections. - -Package docs: https://godoc.org/gopkg.in/gcfg.v1 diff --git a/vendor/github.com/go-git/gcfg/doc.go b/vendor/github.com/go-git/gcfg/doc.go deleted file mode 100644 index 7bdefbf020..0000000000 --- a/vendor/github.com/go-git/gcfg/doc.go +++ /dev/null @@ -1,145 +0,0 @@ -// Package gcfg reads "INI-style" text-based configuration files with -// "name=value" pairs grouped into sections (gcfg files). -// -// This package is still a work in progress; see the sections below for planned -// changes. -// -// Syntax -// -// The syntax is based on that used by git config: -// http://git-scm.com/docs/git-config#_syntax . -// There are some (planned) differences compared to the git config format: -// - improve data portability: -// - must be encoded in UTF-8 (for now) and must not contain the 0 byte -// - include and "path" type is not supported -// (path type may be implementable as a user-defined type) -// - internationalization -// - section and variable names can contain unicode letters, unicode digits -// (as defined in http://golang.org/ref/spec#Characters ) and hyphens -// (U+002D), starting with a unicode letter -// - disallow potentially ambiguous or misleading definitions: -// - `[sec.sub]` format is not allowed (deprecated in gitconfig) -// - `[sec ""]` is not allowed -// - use `[sec]` for section name "sec" and empty subsection name -// - (planned) within a single file, definitions must be contiguous for each: -// - section: '[secA]' -> '[secB]' -> '[secA]' is an error -// - subsection: '[sec "A"]' -> '[sec "B"]' -> '[sec "A"]' is an error -// - multivalued variable: 'multi=a' -> 'other=x' -> 'multi=b' is an error -// -// Data structure -// -// The functions in this package read values into a user-defined struct. -// Each section corresponds to a struct field in the config struct, and each -// variable in a section corresponds to a data field in the section struct. -// The mapping of each section or variable name to fields is done either based -// on the "gcfg" struct tag or by matching the name of the section or variable, -// ignoring case. In the latter case, hyphens '-' in section and variable names -// correspond to underscores '_' in field names. -// Fields must be exported; to use a section or variable name starting with a -// letter that is neither upper- or lower-case, prefix the field name with 'X'. -// (See https://code.google.com/p/go/issues/detail?id=5763#c4 .) -// -// For sections with subsections, the corresponding field in config must be a -// map, rather than a struct, with string keys and pointer-to-struct values. -// Values for subsection variables are stored in the map with the subsection -// name used as the map key. -// (Note that unlike section and variable names, subsection names are case -// sensitive.) -// When using a map, and there is a section with the same section name but -// without a subsection name, its values are stored with the empty string used -// as the key. -// It is possible to provide default values for subsections in the section -// "default-" (or by setting values in the corresponding struct -// field "Default_"). -// -// The functions in this package panic if config is not a pointer to a struct, -// or when a field is not of a suitable type (either a struct or a map with -// string keys and pointer-to-struct values). -// -// Parsing of values -// -// The section structs in the config struct may contain single-valued or -// multi-valued variables. Variables of unnamed slice type (that is, a type -// starting with `[]`) are treated as multi-value; all others (including named -// slice types) are treated as single-valued variables. -// -// Single-valued variables are handled based on the type as follows. -// Unnamed pointer types (that is, types starting with `*`) are dereferenced, -// and if necessary, a new instance is allocated. -// -// For types implementing the encoding.TextUnmarshaler interface, the -// UnmarshalText method is used to set the value. Implementing this method is -// the recommended way for parsing user-defined types. -// -// For fields of string kind, the value string is assigned to the field, after -// unquoting and unescaping as needed. -// For fields of bool kind, the field is set to true if the value is "true", -// "yes", "on" or "1", and set to false if the value is "false", "no", "off" or -// "0", ignoring case. In addition, single-valued bool fields can be specified -// with a "blank" value (variable name without equals sign and value); in such -// case the value is set to true. -// -// Predefined integer types [u]int(|8|16|32|64) and big.Int are parsed as -// decimal or hexadecimal (if having '0x' prefix). (This is to prevent -// unintuitively handling zero-padded numbers as octal.) Other types having -// [u]int* as the underlying type, such as os.FileMode and uintptr allow -// decimal, hexadecimal, or octal values. -// Parsing mode for integer types can be overridden using the struct tag option -// ",int=mode" where mode is a combination of the 'd', 'h', and 'o' characters -// (each standing for decimal, hexadecimal, and octal, respectively.) -// -// All other types are parsed using fmt.Sscanf with the "%v" verb. -// -// For multi-valued variables, each individual value is parsed as above and -// appended to the slice. If the first value is specified as a "blank" value -// (variable name without equals sign and value), a new slice is allocated; -// that is any values previously set in the slice will be ignored. -// -// The types subpackage for provides helpers for parsing "enum-like" and integer -// types. -// -// Error handling -// -// There are 3 types of errors: -// -// - programmer errors / panics: -// - invalid configuration structure -// - data errors: -// - fatal errors: -// - invalid configuration syntax -// - warnings: -// - data that doesn't belong to any part of the config structure -// -// Programmer errors trigger panics. These are should be fixed by the programmer -// before releasing code that uses gcfg. -// -// Data errors cause gcfg to return a non-nil error value. This includes the -// case when there are extra unknown key-value definitions in the configuration -// data (extra data). -// However, in some occasions it is desirable to be able to proceed in -// situations when the only data error is that of extra data. -// These errors are handled at a different (warning) priority and can be -// filtered out programmatically. To ignore extra data warnings, wrap the -// gcfg.Read*Into invocation into a call to gcfg.FatalOnly. -// -// TODO -// -// The following is a list of changes under consideration: -// - documentation -// - self-contained syntax documentation -// - more practical examples -// - move TODOs to issue tracker (eventually) -// - syntax -// - reconsider valid escape sequences -// (gitconfig doesn't support \r in value, \t in subsection name, etc.) -// - reading / parsing gcfg files -// - define internal representation structure -// - support multiple inputs (readers, strings, files) -// - support declaring encoding (?) -// - support varying fields sets for subsections (?) -// - writing gcfg files -// - error handling -// - make error context accessible programmatically? -// - limit input size? -// -package gcfg // import "github.com/go-git/gcfg" diff --git a/vendor/github.com/go-git/gcfg/errors.go b/vendor/github.com/go-git/gcfg/errors.go deleted file mode 100644 index 853c76021d..0000000000 --- a/vendor/github.com/go-git/gcfg/errors.go +++ /dev/null @@ -1,41 +0,0 @@ -package gcfg - -import ( - "gopkg.in/warnings.v0" -) - -// FatalOnly filters the results of a Read*Into invocation and returns only -// fatal errors. That is, errors (warnings) indicating data for unknown -// sections / variables is ignored. Example invocation: -// -// err := gcfg.FatalOnly(gcfg.ReadFileInto(&cfg, configFile)) -// if err != nil { -// ... -// -func FatalOnly(err error) error { - return warnings.FatalOnly(err) -} - -func isFatal(err error) bool { - _, ok := err.(extraData) - return !ok -} - -type extraData struct { - section string - subsection *string - variable *string -} - -func (e extraData) Error() string { - s := "can't store data at section \"" + e.section + "\"" - if e.subsection != nil { - s += ", subsection \"" + *e.subsection + "\"" - } - if e.variable != nil { - s += ", variable \"" + *e.variable + "\"" - } - return s -} - -var _ error = extraData{} diff --git a/vendor/github.com/go-git/gcfg/read.go b/vendor/github.com/go-git/gcfg/read.go deleted file mode 100644 index ea5d2edd06..0000000000 --- a/vendor/github.com/go-git/gcfg/read.go +++ /dev/null @@ -1,273 +0,0 @@ -package gcfg - -import ( - "fmt" - "io" - "os" - "strings" - - "gopkg.in/warnings.v0" - - "github.com/go-git/gcfg/scanner" - "github.com/go-git/gcfg/token" -) - -var unescape = map[rune]rune{'\\': '\\', '"': '"', 'n': '\n', 't': '\t', 'b': '\b', '\n': '\n'} - -// no error: invalid literals should be caught by scanner -func unquote(s string) string { - u, q, esc := make([]rune, 0, len(s)), false, false - for _, c := range s { - if esc { - uc, ok := unescape[c] - switch { - case ok: - u = append(u, uc) - fallthrough - case !q && c == '\n': - esc = false - continue - } - panic("invalid escape sequence") - } - switch c { - case '"': - q = !q - case '\\': - esc = true - default: - u = append(u, c) - } - } - if q { - panic("missing end quote") - } - if esc { - panic("invalid escape sequence") - } - return string(u) -} - -func read(c *warnings.Collector, callback func(string, string, string, string, bool) error, - fset *token.FileSet, file *token.File, src []byte) error { - // - var s scanner.Scanner - var errs scanner.ErrorList - s.Init(file, src, func(p token.Position, m string) { errs.Add(p, m) }, 0) - sect, sectsub := "", "" - pos, tok, lit := s.Scan() - errfn := func(msg string) error { - return fmt.Errorf("%s: %s", fset.Position(pos), msg) - } - for { - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - switch tok { - case token.EOF: - return nil - case token.EOL, token.COMMENT: - pos, tok, lit = s.Scan() - case token.LBRACK: - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - if tok != token.IDENT { - if err := c.Collect(errfn("expected section name")); err != nil { - return err - } - } - sect, sectsub = lit, "" - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - if tok == token.STRING { - sectsub = unquote(lit) - if sectsub == "" { - if err := c.Collect(errfn("empty subsection name")); err != nil { - return err - } - } - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - } - if tok != token.RBRACK { - if sectsub == "" { - if err := c.Collect(errfn("expected subsection name or right bracket")); err != nil { - return err - } - } - if err := c.Collect(errfn("expected right bracket")); err != nil { - return err - } - } - pos, tok, lit = s.Scan() - if tok != token.EOL && tok != token.EOF && tok != token.COMMENT { - if err := c.Collect(errfn("expected EOL, EOF, or comment")); err != nil { - return err - } - } - // If a section/subsection header was found, ensure a - // container object is created, even if there are no - // variables further down. - err := c.Collect(callback(sect, sectsub, "", "", true)) - if err != nil { - return err - } - case token.IDENT: - if sect == "" { - if err := c.Collect(errfn("expected section header")); err != nil { - return err - } - } - n := lit - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - return errs.Err() - } - blank, v := tok == token.EOF || tok == token.EOL || tok == token.COMMENT, "" - if !blank { - if tok != token.ASSIGN { - if err := c.Collect(errfn("expected '='")); err != nil { - return err - } - } - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - if tok != token.STRING { - if err := c.Collect(errfn("expected value")); err != nil { - return err - } - } - v = unquote(lit) - pos, tok, lit = s.Scan() - if errs.Len() > 0 { - if err := c.Collect(errs.Err()); err != nil { - return err - } - } - if tok != token.EOL && tok != token.EOF && tok != token.COMMENT { - if err := c.Collect(errfn("expected EOL, EOF, or comment")); err != nil { - return err - } - } - } - err := c.Collect(callback(sect, sectsub, n, v, blank)) - if err != nil { - return err - } - default: - if sect == "" { - if err := c.Collect(errfn("expected section header")); err != nil { - return err - } - } - if err := c.Collect(errfn("expected section header or variable declaration")); err != nil { - return err - } - } - } - panic("never reached") -} - -func readInto(config interface{}, fset *token.FileSet, file *token.File, - src []byte) error { - // - c := warnings.NewCollector(isFatal) - firstPassCallback := func(s string, ss string, k string, v string, bv bool) error { - return set(c, config, s, ss, k, v, bv, false) - } - err := read(c, firstPassCallback, fset, file, src) - if err != nil { - return err - } - secondPassCallback := func(s string, ss string, k string, v string, bv bool) error { - return set(c, config, s, ss, k, v, bv, true) - } - err = read(c, secondPassCallback, fset, file, src) - if err != nil { - return err - } - return c.Done() -} - -// ReadWithCallback reads gcfg formatted data from reader and calls -// callback with each section and option found. -// -// Callback is called with section, subsection, option key, option value -// and blank value flag as arguments. -// -// When a section is found, callback is called with nil subsection, option key -// and option value. -// -// When a subsection is found, callback is called with nil option key and -// option value. -// -// If blank value flag is true, it means that the value was not set for an option -// (as opposed to set to empty string). -// -// If callback returns an error, ReadWithCallback terminates with an error too. -func ReadWithCallback(reader io.Reader, callback func(string, string, string, string, bool) error) error { - src, err := io.ReadAll(reader) - if err != nil { - return err - } - - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(src)) - c := warnings.NewCollector(isFatal) - - return read(c, callback, fset, file, src) -} - -// ReadInto reads gcfg formatted data from reader and sets the values into the -// corresponding fields in config. -func ReadInto(config interface{}, reader io.Reader) error { - src, err := io.ReadAll(reader) - if err != nil { - return err - } - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(src)) - return readInto(config, fset, file, src) -} - -// ReadStringInto reads gcfg formatted data from str and sets the values into -// the corresponding fields in config. -func ReadStringInto(config interface{}, str string) error { - r := strings.NewReader(str) - return ReadInto(config, r) -} - -// ReadFileInto reads gcfg formatted data from the file filename and sets the -// values into the corresponding fields in config. -func ReadFileInto(config interface{}, filename string) error { - f, err := os.Open(filename) - if err != nil { - return err - } - defer f.Close() - src, err := io.ReadAll(f) - if err != nil { - return err - } - fset := token.NewFileSet() - file := fset.AddFile(filename, fset.Base(), len(src)) - return readInto(config, fset, file, src) -} diff --git a/vendor/github.com/go-git/gcfg/scanner/errors.go b/vendor/github.com/go-git/gcfg/scanner/errors.go deleted file mode 100644 index a6e00f5c64..0000000000 --- a/vendor/github.com/go-git/gcfg/scanner/errors.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package scanner - -import ( - "fmt" - "io" - "sort" -) - -import ( - "github.com/go-git/gcfg/token" -) - -// In an ErrorList, an error is represented by an *Error. -// The position Pos, if valid, points to the beginning of -// the offending token, and the error condition is described -// by Msg. -// -type Error struct { - Pos token.Position - Msg string -} - -// Error implements the error interface. -func (e Error) Error() string { - if e.Pos.Filename != "" || e.Pos.IsValid() { - // don't print "" - // TODO(gri) reconsider the semantics of Position.IsValid - return e.Pos.String() + ": " + e.Msg - } - return e.Msg -} - -// ErrorList is a list of *Errors. -// The zero value for an ErrorList is an empty ErrorList ready to use. -// -type ErrorList []*Error - -// Add adds an Error with given position and error message to an ErrorList. -func (p *ErrorList) Add(pos token.Position, msg string) { - *p = append(*p, &Error{pos, msg}) -} - -// Reset resets an ErrorList to no errors. -func (p *ErrorList) Reset() { *p = (*p)[0:0] } - -// ErrorList implements the sort Interface. -func (p ErrorList) Len() int { return len(p) } -func (p ErrorList) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -func (p ErrorList) Less(i, j int) bool { - e := &p[i].Pos - f := &p[j].Pos - if e.Filename < f.Filename { - return true - } - if e.Filename == f.Filename { - return e.Offset < f.Offset - } - return false -} - -// Sort sorts an ErrorList. *Error entries are sorted by position, -// other errors are sorted by error message, and before any *Error -// entry. -// -func (p ErrorList) Sort() { - sort.Sort(p) -} - -// RemoveMultiples sorts an ErrorList and removes all but the first error per line. -func (p *ErrorList) RemoveMultiples() { - sort.Sort(p) - var last token.Position // initial last.Line is != any legal error line - i := 0 - for _, e := range *p { - if e.Pos.Filename != last.Filename || e.Pos.Line != last.Line { - last = e.Pos - (*p)[i] = e - i++ - } - } - (*p) = (*p)[0:i] -} - -// An ErrorList implements the error interface. -func (p ErrorList) Error() string { - switch len(p) { - case 0: - return "no errors" - case 1: - return p[0].Error() - } - return fmt.Sprintf("%s (and %d more errors)", p[0], len(p)-1) -} - -// Err returns an error equivalent to this error list. -// If the list is empty, Err returns nil. -func (p ErrorList) Err() error { - if len(p) == 0 { - return nil - } - return p -} - -// PrintError is a utility function that prints a list of errors to w, -// one error per line, if the err parameter is an ErrorList. Otherwise -// it prints the err string. -// -func PrintError(w io.Writer, err error) { - if list, ok := err.(ErrorList); ok { - for _, e := range list { - fmt.Fprintf(w, "%s\n", e) - } - } else if err != nil { - fmt.Fprintf(w, "%s\n", err) - } -} diff --git a/vendor/github.com/go-git/gcfg/scanner/scanner.go b/vendor/github.com/go-git/gcfg/scanner/scanner.go deleted file mode 100644 index b3da03d0eb..0000000000 --- a/vendor/github.com/go-git/gcfg/scanner/scanner.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package scanner implements a scanner for gcfg configuration text. -// It takes a []byte as source which can then be tokenized -// through repeated calls to the Scan method. -// -// Note that the API for the scanner package may change to accommodate new -// features or implementation changes in gcfg. -package scanner - -import ( - "fmt" - "path/filepath" - "unicode" - "unicode/utf8" - - "github.com/go-git/gcfg/token" -) - -// An ErrorHandler may be provided to Scanner.Init. If a syntax error is -// encountered and a handler was installed, the handler is called with a -// position and an error message. The position points to the beginning of -// the offending token. -type ErrorHandler func(pos token.Position, msg string) - -// A Scanner holds the scanner's internal state while processing -// a given text. It can be allocated as part of another data -// structure but must be initialized via Init before use. -type Scanner struct { - // immutable state - file *token.File // source file handle - dir string // directory portion of file.Name() - src []byte // source - err ErrorHandler // error reporting; or nil - mode Mode // scanning mode - - // scanning state - ch rune // current character - offset int // character offset - rdOffset int // reading offset (position after current character) - lineOffset int // current line offset - nextVal bool // next token is expected to be a value - - // public state - ok to modify - ErrorCount int // number of errors encountered -} - -// Read the next Unicode char into s.ch. -// s.ch < 0 means end-of-file. -func (s *Scanner) next() { - if s.rdOffset < len(s.src) { - s.offset = s.rdOffset - if s.ch == '\n' { - s.lineOffset = s.offset - s.file.AddLine(s.offset) - } - r, w := rune(s.src[s.rdOffset]), 1 - switch { - case r == 0: - s.error(s.offset, "illegal character NUL") - case r >= 0x80: - // not ASCII - r, w = utf8.DecodeRune(s.src[s.rdOffset:]) - if r == utf8.RuneError && w == 1 { - s.error(s.offset, "illegal UTF-8 encoding") - } - } - s.rdOffset += w - s.ch = r - } else { - s.offset = len(s.src) - if s.ch == '\n' { - s.lineOffset = s.offset - s.file.AddLine(s.offset) - } - s.ch = -1 // eof - } -} - -// A mode value is a set of flags (or 0). -// They control scanner behavior. -type Mode uint - -const ( - ScanComments Mode = 1 << iota // return comments as COMMENT tokens -) - -// Init prepares the scanner s to tokenize the text src by setting the -// scanner at the beginning of src. The scanner uses the file set file -// for position information and it adds line information for each line. -// It is ok to re-use the same file when re-scanning the same file as -// line information which is already present is ignored. Init causes a -// panic if the file size does not match the src size. -// -// Calls to Scan will invoke the error handler err if they encounter a -// syntax error and err is not nil. Also, for each error encountered, -// the Scanner field ErrorCount is incremented by one. The mode parameter -// determines how comments are handled. -// -// Note that Init may call err if there is an error in the first character -// of the file. -func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode) { - // Explicitly initialize all fields since a scanner may be reused. - if file.Size() != len(src) { - panic(fmt.Sprintf("file size (%d) does not match src len (%d)", file.Size(), len(src))) - } - s.file = file - s.dir, _ = filepath.Split(file.Name()) - s.src = src - s.err = err - s.mode = mode - - s.ch = ' ' - s.offset = 0 - s.rdOffset = 0 - s.lineOffset = 0 - s.ErrorCount = 0 - s.nextVal = false - - s.next() -} - -func (s *Scanner) error(offs int, msg string) { - if s.err != nil { - s.err(s.file.Position(s.file.Pos(offs)), msg) - } - s.ErrorCount++ -} - -func (s *Scanner) scanComment() string { - // initial [;#] already consumed - offs := s.offset - 1 // position of initial [;#] - - for s.ch != '\n' && s.ch >= 0 { - s.next() - } - return string(s.src[offs:s.offset]) -} - -func isLetter(ch rune) bool { - return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch >= 0x80 && unicode.IsLetter(ch) -} - -func isDigit(ch rune) bool { - return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch) -} - -func (s *Scanner) scanIdentifier() string { - offs := s.offset - for isLetter(s.ch) || isDigit(s.ch) || s.ch == '-' { - s.next() - } - return string(s.src[offs:s.offset]) -} - -// val indicate if we are scanning a value (vs a header) -func (s *Scanner) scanEscape(val bool) { - offs := s.offset - ch := s.ch - s.next() // always make progress - switch ch { - case '\\', '"', '\n': - // ok - case 'n', 't', 'b': - if val { - break // ok - } - fallthrough - default: - s.error(offs, "unknown escape sequence") - } -} - -func (s *Scanner) scanString() string { - // '"' opening already consumed - offs := s.offset - 1 - - for s.ch != '"' { - ch := s.ch - s.next() - if ch == '\n' || ch < 0 { - s.error(offs, "string not terminated") - break - } - if ch == '\\' { - s.scanEscape(false) - } - } - - s.next() - - return string(s.src[offs:s.offset]) -} - -func stripCR(b []byte) []byte { - c := make([]byte, len(b)) - i := 0 - for _, ch := range b { - if ch != '\r' { - c[i] = ch - i++ - } - } - return c[:i] -} - -func (s *Scanner) scanValString() string { - offs := s.offset - - hasCR := false - end := offs - inQuote := false -loop: - for inQuote || s.ch >= 0 && s.ch != '\n' && s.ch != ';' && s.ch != '#' { - ch := s.ch - s.next() - switch { - case inQuote && ch == '\\': - s.scanEscape(true) - case !inQuote && ch == '\\': - if s.ch == '\r' { - hasCR = true - s.next() - } - if s.ch != '\n' { - s.scanEscape(true) - } else { - s.next() - } - case ch == '"': - inQuote = !inQuote - case ch == '\r': - hasCR = true - case ch < 0 || inQuote && ch == '\n': - s.error(offs, "string not terminated") - break loop - } - if inQuote || !isWhiteSpace(ch) { - end = s.offset - } - } - - lit := s.src[offs:end] - if hasCR { - lit = stripCR(lit) - } - - return string(lit) -} - -func isWhiteSpace(ch rune) bool { - return ch == ' ' || ch == '\t' || ch == '\r' -} - -func (s *Scanner) skipWhitespace() { - for isWhiteSpace(s.ch) { - s.next() - } -} - -// Scan scans the next token and returns the token position, the token, -// and its literal string if applicable. The source end is indicated by -// token.EOF. -// -// If the returned token is a literal (token.IDENT, token.STRING) or -// token.COMMENT, the literal string has the corresponding value. -// -// If the returned token is token.ILLEGAL, the literal string is the -// offending character. -// -// In all other cases, Scan returns an empty literal string. -// -// For more tolerant parsing, Scan will return a valid token if -// possible even if a syntax error was encountered. Thus, even -// if the resulting token sequence contains no illegal tokens, -// a client may not assume that no error occurred. Instead it -// must check the scanner's ErrorCount or the number of calls -// of the error handler, if there was one installed. -// -// Scan adds line information to the file added to the file -// set with Init. Token positions are relative to that file -// and thus relative to the file set. -func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) { -scanAgain: - s.skipWhitespace() - - // current token start - pos = s.file.Pos(s.offset) - - // determine token value - switch ch := s.ch; { - case s.nextVal: - lit = s.scanValString() - tok = token.STRING - s.nextVal = false - case isLetter(ch): - lit = s.scanIdentifier() - tok = token.IDENT - default: - s.next() // always make progress - switch ch { - case -1: - tok = token.EOF - case '\n': - tok = token.EOL - case '"': - tok = token.STRING - lit = s.scanString() - case '[': - tok = token.LBRACK - case ']': - tok = token.RBRACK - case ';', '#': - // comment - lit = s.scanComment() - if s.mode&ScanComments == 0 { - // skip comment - goto scanAgain - } - tok = token.COMMENT - case '=': - tok = token.ASSIGN - s.nextVal = true - default: - s.error(s.file.Offset(pos), fmt.Sprintf("illegal character %#U", ch)) - tok = token.ILLEGAL - lit = string(ch) - } - } - - return -} diff --git a/vendor/github.com/go-git/gcfg/set.go b/vendor/github.com/go-git/gcfg/set.go deleted file mode 100644 index dc9795dbdb..0000000000 --- a/vendor/github.com/go-git/gcfg/set.go +++ /dev/null @@ -1,334 +0,0 @@ -package gcfg - -import ( - "bytes" - "encoding" - "encoding/gob" - "fmt" - "math/big" - "reflect" - "strings" - "unicode" - "unicode/utf8" - - "gopkg.in/warnings.v0" - - "github.com/go-git/gcfg/types" -) - -type tag struct { - ident string - intMode string -} - -func newTag(ts string) tag { - t := tag{} - s := strings.Split(ts, ",") - t.ident = s[0] - for _, tse := range s[1:] { - if strings.HasPrefix(tse, "int=") { - t.intMode = tse[len("int="):] - } - } - return t -} - -func fieldFold(v reflect.Value, name string) (reflect.Value, tag) { - var n string - r0, _ := utf8.DecodeRuneInString(name) - if unicode.IsLetter(r0) && !unicode.IsLower(r0) && !unicode.IsUpper(r0) { - n = "X" - } - n += strings.Replace(name, "-", "_", -1) - f, ok := v.Type().FieldByNameFunc(func(fieldName string) bool { - if !v.FieldByName(fieldName).CanSet() { - return false - } - f, _ := v.Type().FieldByName(fieldName) - t := newTag(f.Tag.Get("gcfg")) - if t.ident != "" { - return strings.EqualFold(t.ident, name) - } - return strings.EqualFold(n, fieldName) - }) - if !ok { - return reflect.Value{}, tag{} - } - return v.FieldByName(f.Name), newTag(f.Tag.Get("gcfg")) -} - -type setter func(destp interface{}, blank bool, val string, t tag) error - -var errUnsupportedType = fmt.Errorf("unsupported type") -var errBlankUnsupported = fmt.Errorf("blank value not supported for type") - -var setters = []setter{ - typeSetter, textUnmarshalerSetter, kindSetter, scanSetter, -} - -func textUnmarshalerSetter(d interface{}, blank bool, val string, t tag) error { - dtu, ok := d.(encoding.TextUnmarshaler) - if !ok { - return errUnsupportedType - } - if blank { - return errBlankUnsupported - } - return dtu.UnmarshalText([]byte(val)) -} - -func boolSetter(d interface{}, blank bool, val string, t tag) error { - if blank { - reflect.ValueOf(d).Elem().Set(reflect.ValueOf(true)) - return nil - } - b, err := types.ParseBool(val) - if err == nil { - reflect.ValueOf(d).Elem().Set(reflect.ValueOf(b)) - } - return err -} - -func intMode(mode string) types.IntMode { - var m types.IntMode - if strings.ContainsAny(mode, "dD") { - m |= types.Dec - } - if strings.ContainsAny(mode, "hH") { - m |= types.Hex - } - if strings.ContainsAny(mode, "oO") { - m |= types.Oct - } - return m -} - -var typeModes = map[reflect.Type]types.IntMode{ - reflect.TypeOf(int(0)): types.Dec | types.Hex, - reflect.TypeOf(int8(0)): types.Dec | types.Hex, - reflect.TypeOf(int16(0)): types.Dec | types.Hex, - reflect.TypeOf(int32(0)): types.Dec | types.Hex, - reflect.TypeOf(int64(0)): types.Dec | types.Hex, - reflect.TypeOf(uint(0)): types.Dec | types.Hex, - reflect.TypeOf(uint8(0)): types.Dec | types.Hex, - reflect.TypeOf(uint16(0)): types.Dec | types.Hex, - reflect.TypeOf(uint32(0)): types.Dec | types.Hex, - reflect.TypeOf(uint64(0)): types.Dec | types.Hex, - // use default mode (allow dec/hex/oct) for uintptr type - reflect.TypeOf(big.Int{}): types.Dec | types.Hex, -} - -func intModeDefault(t reflect.Type) types.IntMode { - m, ok := typeModes[t] - if !ok { - m = types.Dec | types.Hex | types.Oct - } - return m -} - -func intSetter(d interface{}, blank bool, val string, t tag) error { - if blank { - return errBlankUnsupported - } - mode := intMode(t.intMode) - if mode == 0 { - mode = intModeDefault(reflect.TypeOf(d).Elem()) - } - return types.ParseInt(d, val, mode) -} - -func stringSetter(d interface{}, blank bool, val string, t tag) error { - if blank { - return errBlankUnsupported - } - dsp, ok := d.(*string) - if !ok { - return errUnsupportedType - } - *dsp = val - return nil -} - -var kindSetters = map[reflect.Kind]setter{ - reflect.String: stringSetter, - reflect.Bool: boolSetter, - reflect.Int: intSetter, - reflect.Int8: intSetter, - reflect.Int16: intSetter, - reflect.Int32: intSetter, - reflect.Int64: intSetter, - reflect.Uint: intSetter, - reflect.Uint8: intSetter, - reflect.Uint16: intSetter, - reflect.Uint32: intSetter, - reflect.Uint64: intSetter, - reflect.Uintptr: intSetter, -} - -var typeSetters = map[reflect.Type]setter{ - reflect.TypeOf(big.Int{}): intSetter, -} - -func typeSetter(d interface{}, blank bool, val string, tt tag) error { - t := reflect.ValueOf(d).Type().Elem() - setter, ok := typeSetters[t] - if !ok { - return errUnsupportedType - } - return setter(d, blank, val, tt) -} - -func kindSetter(d interface{}, blank bool, val string, tt tag) error { - k := reflect.ValueOf(d).Type().Elem().Kind() - setter, ok := kindSetters[k] - if !ok { - return errUnsupportedType - } - return setter(d, blank, val, tt) -} - -func scanSetter(d interface{}, blank bool, val string, tt tag) error { - if blank { - return errBlankUnsupported - } - return types.ScanFully(d, val, 'v') -} - -func newValue(c *warnings.Collector, sect string, vCfg reflect.Value, - vType reflect.Type) (reflect.Value, error) { - // - pv := reflect.New(vType) - dfltName := "default-" + sect - dfltField, _ := fieldFold(vCfg, dfltName) - var err error - if dfltField.IsValid() { - b := bytes.NewBuffer(nil) - ge := gob.NewEncoder(b) - if err = c.Collect(ge.EncodeValue(dfltField)); err != nil { - return pv, err - } - gd := gob.NewDecoder(bytes.NewReader(b.Bytes())) - if err = c.Collect(gd.DecodeValue(pv.Elem())); err != nil { - return pv, err - } - } - return pv, nil -} - -func set(c *warnings.Collector, cfg interface{}, sect, sub, name string, - value string, blankValue bool, subsectPass bool) error { - // - vPCfg := reflect.ValueOf(cfg) - if vPCfg.Kind() != reflect.Ptr || vPCfg.Elem().Kind() != reflect.Struct { - panic(fmt.Errorf("config must be a pointer to a struct")) - } - vCfg := vPCfg.Elem() - vSect, _ := fieldFold(vCfg, sect) - if !vSect.IsValid() { - err := extraData{section: sect} - return c.Collect(err) - } - isSubsect := vSect.Kind() == reflect.Map - if subsectPass != isSubsect { - return nil - } - if isSubsect { - vst := vSect.Type() - if vst.Key().Kind() != reflect.String || - vst.Elem().Kind() != reflect.Ptr || - vst.Elem().Elem().Kind() != reflect.Struct { - panic(fmt.Errorf("map field for section must have string keys and "+ - " pointer-to-struct values: section %q", sect)) - } - if vSect.IsNil() { - vSect.Set(reflect.MakeMap(vst)) - } - k := reflect.ValueOf(sub) - pv := vSect.MapIndex(k) - if !pv.IsValid() { - vType := vSect.Type().Elem().Elem() - var err error - if pv, err = newValue(c, sect, vCfg, vType); err != nil { - return err - } - vSect.SetMapIndex(k, pv) - } - vSect = pv.Elem() - } else if vSect.Kind() != reflect.Struct { - panic(fmt.Errorf("field for section must be a map or a struct: "+ - "section %q", sect)) - } else if sub != "" { - err := extraData{section: sect, subsection: &sub} - return c.Collect(err) - } - // Empty name is a special value, meaning that only the - // section/subsection object is to be created, with no values set. - if name == "" { - return nil - } - vVar, t := fieldFold(vSect, name) - if !vVar.IsValid() { - var err error - if isSubsect { - err = extraData{section: sect, subsection: &sub, variable: &name} - } else { - err = extraData{section: sect, variable: &name} - } - return c.Collect(err) - } - // vVal is either single-valued var, or newly allocated value within multi-valued var - var vVal reflect.Value - // multi-value if unnamed slice type - isMulti := vVar.Type().Name() == "" && vVar.Kind() == reflect.Slice || - vVar.Type().Name() == "" && vVar.Kind() == reflect.Ptr && vVar.Type().Elem().Name() == "" && vVar.Type().Elem().Kind() == reflect.Slice - if isMulti && vVar.Kind() == reflect.Ptr { - if vVar.IsNil() { - vVar.Set(reflect.New(vVar.Type().Elem())) - } - vVar = vVar.Elem() - } - if isMulti && blankValue { - vVar.Set(reflect.Zero(vVar.Type())) - return nil - } - if isMulti { - vVal = reflect.New(vVar.Type().Elem()).Elem() - } else { - vVal = vVar - } - isDeref := vVal.Type().Name() == "" && vVal.Type().Kind() == reflect.Ptr - isNew := isDeref && vVal.IsNil() - // vAddr is address of value to set (dereferenced & allocated as needed) - var vAddr reflect.Value - switch { - case isNew: - vAddr = reflect.New(vVal.Type().Elem()) - case isDeref && !isNew: - vAddr = vVal - default: - vAddr = vVal.Addr() - } - vAddrI := vAddr.Interface() - err, ok := error(nil), false - for _, s := range setters { - err = s(vAddrI, blankValue, value, t) - if err == nil { - ok = true - break - } - if err != errUnsupportedType { - return err - } - } - if !ok { - // in case all setters returned errUnsupportedType - return err - } - if isNew { // set reference if it was dereferenced and newly allocated - vVal.Set(vAddr) - } - if isMulti { // append if multi-valued - vVar.Set(reflect.Append(vVar, vVal)) - } - return nil -} diff --git a/vendor/github.com/go-git/gcfg/token/position.go b/vendor/github.com/go-git/gcfg/token/position.go deleted file mode 100644 index fc45c1e769..0000000000 --- a/vendor/github.com/go-git/gcfg/token/position.go +++ /dev/null @@ -1,435 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// TODO(gri) consider making this a separate package outside the go directory. - -package token - -import ( - "fmt" - "sort" - "sync" -) - -// ----------------------------------------------------------------------------- -// Positions - -// Position describes an arbitrary source position -// including the file, line, and column location. -// A Position is valid if the line number is > 0. -// -type Position struct { - Filename string // filename, if any - Offset int // offset, starting at 0 - Line int // line number, starting at 1 - Column int // column number, starting at 1 (character count) -} - -// IsValid returns true if the position is valid. -func (pos *Position) IsValid() bool { return pos.Line > 0 } - -// String returns a string in one of several forms: -// -// file:line:column valid position with file name -// line:column valid position without file name -// file invalid position with file name -// - invalid position without file name -// -func (pos Position) String() string { - s := pos.Filename - if pos.IsValid() { - if s != "" { - s += ":" - } - s += fmt.Sprintf("%d:%d", pos.Line, pos.Column) - } - if s == "" { - s = "-" - } - return s -} - -// Pos is a compact encoding of a source position within a file set. -// It can be converted into a Position for a more convenient, but much -// larger, representation. -// -// The Pos value for a given file is a number in the range [base, base+size], -// where base and size are specified when adding the file to the file set via -// AddFile. -// -// To create the Pos value for a specific source offset, first add -// the respective file to the current file set (via FileSet.AddFile) -// and then call File.Pos(offset) for that file. Given a Pos value p -// for a specific file set fset, the corresponding Position value is -// obtained by calling fset.Position(p). -// -// Pos values can be compared directly with the usual comparison operators: -// If two Pos values p and q are in the same file, comparing p and q is -// equivalent to comparing the respective source file offsets. If p and q -// are in different files, p < q is true if the file implied by p was added -// to the respective file set before the file implied by q. -// -type Pos int - -// The zero value for Pos is NoPos; there is no file and line information -// associated with it, and NoPos().IsValid() is false. NoPos is always -// smaller than any other Pos value. The corresponding Position value -// for NoPos is the zero value for Position. -// -const NoPos Pos = 0 - -// IsValid returns true if the position is valid. -func (p Pos) IsValid() bool { - return p != NoPos -} - -// ----------------------------------------------------------------------------- -// File - -// A File is a handle for a file belonging to a FileSet. -// A File has a name, size, and line offset table. -// -type File struct { - set *FileSet - name string // file name as provided to AddFile - base int // Pos value range for this file is [base...base+size] - size int // file size as provided to AddFile - - // lines and infos are protected by set.mutex - lines []int - infos []lineInfo -} - -// Name returns the file name of file f as registered with AddFile. -func (f *File) Name() string { - return f.name -} - -// Base returns the base offset of file f as registered with AddFile. -func (f *File) Base() int { - return f.base -} - -// Size returns the size of file f as registered with AddFile. -func (f *File) Size() int { - return f.size -} - -// LineCount returns the number of lines in file f. -func (f *File) LineCount() int { - f.set.mutex.RLock() - n := len(f.lines) - f.set.mutex.RUnlock() - return n -} - -// AddLine adds the line offset for a new line. -// The line offset must be larger than the offset for the previous line -// and smaller than the file size; otherwise the line offset is ignored. -// -func (f *File) AddLine(offset int) { - f.set.mutex.Lock() - if i := len(f.lines); (i == 0 || f.lines[i-1] < offset) && offset < f.size { - f.lines = append(f.lines, offset) - } - f.set.mutex.Unlock() -} - -// SetLines sets the line offsets for a file and returns true if successful. -// The line offsets are the offsets of the first character of each line; -// for instance for the content "ab\nc\n" the line offsets are {0, 3}. -// An empty file has an empty line offset table. -// Each line offset must be larger than the offset for the previous line -// and smaller than the file size; otherwise SetLines fails and returns -// false. -// -func (f *File) SetLines(lines []int) bool { - // verify validity of lines table - size := f.size - for i, offset := range lines { - if i > 0 && offset <= lines[i-1] || size <= offset { - return false - } - } - - // set lines table - f.set.mutex.Lock() - f.lines = lines - f.set.mutex.Unlock() - return true -} - -// SetLinesForContent sets the line offsets for the given file content. -func (f *File) SetLinesForContent(content []byte) { - var lines []int - line := 0 - for offset, b := range content { - if line >= 0 { - lines = append(lines, line) - } - line = -1 - if b == '\n' { - line = offset + 1 - } - } - - // set lines table - f.set.mutex.Lock() - f.lines = lines - f.set.mutex.Unlock() -} - -// A lineInfo object describes alternative file and line number -// information (such as provided via a //line comment in a .go -// file) for a given file offset. -type lineInfo struct { - // fields are exported to make them accessible to gob - Offset int - Filename string - Line int -} - -// AddLineInfo adds alternative file and line number information for -// a given file offset. The offset must be larger than the offset for -// the previously added alternative line info and smaller than the -// file size; otherwise the information is ignored. -// -// AddLineInfo is typically used to register alternative position -// information for //line filename:line comments in source files. -// -func (f *File) AddLineInfo(offset int, filename string, line int) { - f.set.mutex.Lock() - if i := len(f.infos); i == 0 || f.infos[i-1].Offset < offset && offset < f.size { - f.infos = append(f.infos, lineInfo{offset, filename, line}) - } - f.set.mutex.Unlock() -} - -// Pos returns the Pos value for the given file offset; -// the offset must be <= f.Size(). -// f.Pos(f.Offset(p)) == p. -// -func (f *File) Pos(offset int) Pos { - if offset > f.size { - panic("illegal file offset") - } - return Pos(f.base + offset) -} - -// Offset returns the offset for the given file position p; -// p must be a valid Pos value in that file. -// f.Offset(f.Pos(offset)) == offset. -// -func (f *File) Offset(p Pos) int { - if int(p) < f.base || int(p) > f.base+f.size { - panic("illegal Pos value") - } - return int(p) - f.base -} - -// Line returns the line number for the given file position p; -// p must be a Pos value in that file or NoPos. -// -func (f *File) Line(p Pos) int { - // TODO(gri) this can be implemented much more efficiently - return f.Position(p).Line -} - -func searchLineInfos(a []lineInfo, x int) int { - return sort.Search(len(a), func(i int) bool { return a[i].Offset > x }) - 1 -} - -// info returns the file name, line, and column number for a file offset. -func (f *File) info(offset int) (filename string, line, column int) { - filename = f.name - if i := searchInts(f.lines, offset); i >= 0 { - line, column = i+1, offset-f.lines[i]+1 - } - if len(f.infos) > 0 { - // almost no files have extra line infos - if i := searchLineInfos(f.infos, offset); i >= 0 { - alt := &f.infos[i] - filename = alt.Filename - if i := searchInts(f.lines, alt.Offset); i >= 0 { - line += alt.Line - i - 1 - } - } - } - return -} - -func (f *File) position(p Pos) (pos Position) { - offset := int(p) - f.base - pos.Offset = offset - pos.Filename, pos.Line, pos.Column = f.info(offset) - return -} - -// Position returns the Position value for the given file position p; -// p must be a Pos value in that file or NoPos. -// -func (f *File) Position(p Pos) (pos Position) { - if p != NoPos { - if int(p) < f.base || int(p) > f.base+f.size { - panic("illegal Pos value") - } - pos = f.position(p) - } - return -} - -// ----------------------------------------------------------------------------- -// FileSet - -// A FileSet represents a set of source files. -// Methods of file sets are synchronized; multiple goroutines -// may invoke them concurrently. -// -type FileSet struct { - mutex sync.RWMutex // protects the file set - base int // base offset for the next file - files []*File // list of files in the order added to the set - last *File // cache of last file looked up -} - -// NewFileSet creates a new file set. -func NewFileSet() *FileSet { - s := new(FileSet) - s.base = 1 // 0 == NoPos - return s -} - -// Base returns the minimum base offset that must be provided to -// AddFile when adding the next file. -// -func (s *FileSet) Base() int { - s.mutex.RLock() - b := s.base - s.mutex.RUnlock() - return b - -} - -// AddFile adds a new file with a given filename, base offset, and file size -// to the file set s and returns the file. Multiple files may have the same -// name. The base offset must not be smaller than the FileSet's Base(), and -// size must not be negative. -// -// Adding the file will set the file set's Base() value to base + size + 1 -// as the minimum base value for the next file. The following relationship -// exists between a Pos value p for a given file offset offs: -// -// int(p) = base + offs -// -// with offs in the range [0, size] and thus p in the range [base, base+size]. -// For convenience, File.Pos may be used to create file-specific position -// values from a file offset. -// -func (s *FileSet) AddFile(filename string, base, size int) *File { - s.mutex.Lock() - defer s.mutex.Unlock() - if base < s.base || size < 0 { - panic("illegal base or size") - } - // base >= s.base && size >= 0 - f := &File{s, filename, base, size, []int{0}, nil} - base += size + 1 // +1 because EOF also has a position - if base < 0 { - panic("token.Pos offset overflow (> 2G of source code in file set)") - } - // add the file to the file set - s.base = base - s.files = append(s.files, f) - s.last = f - return f -} - -// Iterate calls f for the files in the file set in the order they were added -// until f returns false. -// -func (s *FileSet) Iterate(f func(*File) bool) { - for i := 0; ; i++ { - var file *File - s.mutex.RLock() - if i < len(s.files) { - file = s.files[i] - } - s.mutex.RUnlock() - if file == nil || !f(file) { - break - } - } -} - -func searchFiles(a []*File, x int) int { - return sort.Search(len(a), func(i int) bool { return a[i].base > x }) - 1 -} - -func (s *FileSet) file(p Pos) *File { - // common case: p is in last file - if f := s.last; f != nil && f.base <= int(p) && int(p) <= f.base+f.size { - return f - } - // p is not in last file - search all files - if i := searchFiles(s.files, int(p)); i >= 0 { - f := s.files[i] - // f.base <= int(p) by definition of searchFiles - if int(p) <= f.base+f.size { - s.last = f - return f - } - } - return nil -} - -// File returns the file that contains the position p. -// If no such file is found (for instance for p == NoPos), -// the result is nil. -// -func (s *FileSet) File(p Pos) (f *File) { - if p != NoPos { - s.mutex.RLock() - f = s.file(p) - s.mutex.RUnlock() - } - return -} - -// Position converts a Pos in the fileset into a general Position. -func (s *FileSet) Position(p Pos) (pos Position) { - if p != NoPos { - s.mutex.RLock() - if f := s.file(p); f != nil { - pos = f.position(p) - } - s.mutex.RUnlock() - } - return -} - -// ----------------------------------------------------------------------------- -// Helper functions - -func searchInts(a []int, x int) int { - // This function body is a manually inlined version of: - // - // return sort.Search(len(a), func(i int) bool { return a[i] > x }) - 1 - // - // With better compiler optimizations, this may not be needed in the - // future, but at the moment this change improves the go/printer - // benchmark performance by ~30%. This has a direct impact on the - // speed of gofmt and thus seems worthwhile (2011-04-29). - // TODO(gri): Remove this when compilers have caught up. - i, j := 0, len(a) - for i < j { - h := i + (j-i)/2 // avoid overflow when computing h - // i ≤ h < j - if a[h] <= x { - i = h + 1 - } else { - j = h - } - } - return i - 1 -} diff --git a/vendor/github.com/go-git/gcfg/token/serialize.go b/vendor/github.com/go-git/gcfg/token/serialize.go deleted file mode 100644 index 4adc8f9e33..0000000000 --- a/vendor/github.com/go-git/gcfg/token/serialize.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package token - -type serializedFile struct { - // fields correspond 1:1 to fields with same (lower-case) name in File - Name string - Base int - Size int - Lines []int - Infos []lineInfo -} - -type serializedFileSet struct { - Base int - Files []serializedFile -} - -// Read calls decode to deserialize a file set into s; s must not be nil. -func (s *FileSet) Read(decode func(interface{}) error) error { - var ss serializedFileSet - if err := decode(&ss); err != nil { - return err - } - - s.mutex.Lock() - s.base = ss.Base - files := make([]*File, len(ss.Files)) - for i := 0; i < len(ss.Files); i++ { - f := &ss.Files[i] - files[i] = &File{s, f.Name, f.Base, f.Size, f.Lines, f.Infos} - } - s.files = files - s.last = nil - s.mutex.Unlock() - - return nil -} - -// Write calls encode to serialize the file set s. -func (s *FileSet) Write(encode func(interface{}) error) error { - var ss serializedFileSet - - s.mutex.Lock() - ss.Base = s.base - files := make([]serializedFile, len(s.files)) - for i, f := range s.files { - files[i] = serializedFile{f.name, f.base, f.size, f.lines, f.infos} - } - ss.Files = files - s.mutex.Unlock() - - return encode(ss) -} diff --git a/vendor/github.com/go-git/gcfg/token/token.go b/vendor/github.com/go-git/gcfg/token/token.go deleted file mode 100644 index b3c7c83fa9..0000000000 --- a/vendor/github.com/go-git/gcfg/token/token.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package token defines constants representing the lexical tokens of the gcfg -// configuration syntax and basic operations on tokens (printing, predicates). -// -// Note that the API for the token package may change to accommodate new -// features or implementation changes in gcfg. -// -package token - -import "strconv" - -// Token is the set of lexical tokens of the gcfg configuration syntax. -type Token int - -// The list of tokens. -const ( - // Special tokens - ILLEGAL Token = iota - EOF - COMMENT - - literal_beg - // Identifiers and basic type literals - // (these tokens stand for classes of literals) - IDENT // section-name, variable-name - STRING // "subsection-name", variable value - literal_end - - operator_beg - // Operators and delimiters - ASSIGN // = - LBRACK // [ - RBRACK // ] - EOL // \n - operator_end -) - -var tokens = [...]string{ - ILLEGAL: "ILLEGAL", - - EOF: "EOF", - COMMENT: "COMMENT", - - IDENT: "IDENT", - STRING: "STRING", - - ASSIGN: "=", - LBRACK: "[", - RBRACK: "]", - EOL: "\n", -} - -// String returns the string corresponding to the token tok. -// For operators and delimiters, the string is the actual token character -// sequence (e.g., for the token ASSIGN, the string is "="). For all other -// tokens the string corresponds to the token constant name (e.g. for the -// token IDENT, the string is "IDENT"). -// -func (tok Token) String() string { - s := "" - if 0 <= tok && tok < Token(len(tokens)) { - s = tokens[tok] - } - if s == "" { - s = "token(" + strconv.Itoa(int(tok)) + ")" - } - return s -} - -// Predicates - -// IsLiteral returns true for tokens corresponding to identifiers -// and basic type literals; it returns false otherwise. -// -func (tok Token) IsLiteral() bool { return literal_beg < tok && tok < literal_end } - -// IsOperator returns true for tokens corresponding to operators and -// delimiters; it returns false otherwise. -// -func (tok Token) IsOperator() bool { return operator_beg < tok && tok < operator_end } diff --git a/vendor/github.com/go-git/gcfg/types/bool.go b/vendor/github.com/go-git/gcfg/types/bool.go deleted file mode 100644 index 8dcae0d8cf..0000000000 --- a/vendor/github.com/go-git/gcfg/types/bool.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -// BoolValues defines the name and value mappings for ParseBool. -var BoolValues = map[string]interface{}{ - "true": true, "yes": true, "on": true, "1": true, - "false": false, "no": false, "off": false, "0": false, -} - -var boolParser = func() *EnumParser { - ep := &EnumParser{} - ep.AddVals(BoolValues) - return ep -}() - -// ParseBool parses bool values according to the definitions in BoolValues. -// Parsing is case-insensitive. -func ParseBool(s string) (bool, error) { - v, err := boolParser.Parse(s) - if err != nil { - return false, err - } - return v.(bool), nil -} diff --git a/vendor/github.com/go-git/gcfg/types/doc.go b/vendor/github.com/go-git/gcfg/types/doc.go deleted file mode 100644 index 9f9c345f6e..0000000000 --- a/vendor/github.com/go-git/gcfg/types/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package types defines helpers for type conversions. -// -// The API for this package is not finalized yet. -package types diff --git a/vendor/github.com/go-git/gcfg/types/enum.go b/vendor/github.com/go-git/gcfg/types/enum.go deleted file mode 100644 index 1a0c7ef453..0000000000 --- a/vendor/github.com/go-git/gcfg/types/enum.go +++ /dev/null @@ -1,44 +0,0 @@ -package types - -import ( - "fmt" - "reflect" - "strings" -) - -// EnumParser parses "enum" values; i.e. a predefined set of strings to -// predefined values. -type EnumParser struct { - Type string // type name; if not set, use type of first value added - CaseMatch bool // if true, matching of strings is case-sensitive - // PrefixMatch bool - vals map[string]interface{} -} - -// AddVals adds strings and values to an EnumParser. -func (ep *EnumParser) AddVals(vals map[string]interface{}) { - if ep.vals == nil { - ep.vals = make(map[string]interface{}) - } - for k, v := range vals { - if ep.Type == "" { - ep.Type = reflect.TypeOf(v).Name() - } - if !ep.CaseMatch { - k = strings.ToLower(k) - } - ep.vals[k] = v - } -} - -// Parse parses the string and returns the value or an error. -func (ep EnumParser) Parse(s string) (interface{}, error) { - if !ep.CaseMatch { - s = strings.ToLower(s) - } - v, ok := ep.vals[s] - if !ok { - return false, fmt.Errorf("failed to parse %s %#q", ep.Type, s) - } - return v, nil -} diff --git a/vendor/github.com/go-git/gcfg/types/int.go b/vendor/github.com/go-git/gcfg/types/int.go deleted file mode 100644 index af7e75c125..0000000000 --- a/vendor/github.com/go-git/gcfg/types/int.go +++ /dev/null @@ -1,86 +0,0 @@ -package types - -import ( - "fmt" - "strings" -) - -// An IntMode is a mode for parsing integer values, representing a set of -// accepted bases. -type IntMode uint8 - -// IntMode values for ParseInt; can be combined using binary or. -const ( - Dec IntMode = 1 << iota - Hex - Oct -) - -// String returns a string representation of IntMode; e.g. `IntMode(Dec|Hex)`. -func (m IntMode) String() string { - var modes []string - if m&Dec != 0 { - modes = append(modes, "Dec") - } - if m&Hex != 0 { - modes = append(modes, "Hex") - } - if m&Oct != 0 { - modes = append(modes, "Oct") - } - return "IntMode(" + strings.Join(modes, "|") + ")" -} - -var errIntAmbig = fmt.Errorf("ambiguous integer value; must include '0' prefix") - -func prefix0(val string) bool { - return strings.HasPrefix(val, "0") || strings.HasPrefix(val, "-0") -} - -func prefix0x(val string) bool { - return strings.HasPrefix(val, "0x") || strings.HasPrefix(val, "-0x") -} - -// ParseInt parses val using mode into intptr, which must be a pointer to an -// integer kind type. Non-decimal value require prefix `0` or `0x` in the cases -// when mode permits ambiguity of base; otherwise the prefix can be omitted. -func ParseInt(intptr interface{}, val string, mode IntMode) error { - val = strings.TrimSpace(val) - verb := byte(0) - switch mode { - case Dec: - verb = 'd' - case Dec + Hex: - if prefix0x(val) { - verb = 'v' - } else { - verb = 'd' - } - case Dec + Oct: - if prefix0(val) && !prefix0x(val) { - verb = 'v' - } else { - verb = 'd' - } - case Dec + Hex + Oct: - verb = 'v' - case Hex: - if prefix0x(val) { - verb = 'v' - } else { - verb = 'x' - } - case Oct: - verb = 'o' - case Hex + Oct: - if prefix0(val) { - verb = 'v' - } else { - return errIntAmbig - } - } - if verb == 0 { - panic("unsupported mode") - } - return ScanFully(intptr, val, verb) -} diff --git a/vendor/github.com/go-git/gcfg/types/scan.go b/vendor/github.com/go-git/gcfg/types/scan.go deleted file mode 100644 index db2f6ed3ca..0000000000 --- a/vendor/github.com/go-git/gcfg/types/scan.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import ( - "fmt" - "io" - "reflect" -) - -// ScanFully uses fmt.Sscanf with verb to fully scan val into ptr. -func ScanFully(ptr interface{}, val string, verb byte) error { - t := reflect.ValueOf(ptr).Elem().Type() - // attempt to read extra bytes to make sure the value is consumed - var b []byte - n, err := fmt.Sscanf(val, "%"+string(verb)+"%s", ptr, &b) - switch { - case n < 1 || n == 1 && err != io.EOF: - return fmt.Errorf("failed to parse %q as %v: %v", val, t, err) - case n > 1: - return fmt.Errorf("failed to parse %q as %v: extra characters %q", val, t, string(b)) - } - // n == 1 && err == io.EOF - return nil -} diff --git a/vendor/github.com/go-git/go-billy/v5/.gitignore b/vendor/github.com/go-git/go-billy/v5/.gitignore deleted file mode 100644 index 7aeb46699c..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -/coverage.txt -/vendor -Gopkg.lock -Gopkg.toml diff --git a/vendor/github.com/go-git/go-billy/v5/LICENSE b/vendor/github.com/go-git/go-billy/v5/LICENSE deleted file mode 100644 index 9d60756894..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Sourced Technologies S.L. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-git/go-billy/v5/Makefile b/vendor/github.com/go-git/go-billy/v5/Makefile deleted file mode 100644 index 74dad8b491..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# Go parameters -GOCMD = go -GOTEST = $(GOCMD) test - -.PHONY: test -test: - $(GOTEST) -race ./... - -test-coverage: - echo "" > $(COVERAGE_REPORT); \ - $(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./... diff --git a/vendor/github.com/go-git/go-billy/v5/README.md b/vendor/github.com/go-git/go-billy/v5/README.md deleted file mode 100644 index da5c074782..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# go-billy [![GoDoc](https://godoc.org/gopkg.in/go-git/go-billy.v5?status.svg)](https://pkg.go.dev/github.com/go-git/go-billy/v5) [![Test](https://github.com/go-git/go-billy/workflows/Test/badge.svg)](https://github.com/go-git/go-billy/actions?query=workflow%3ATest) - -The missing interface filesystem abstraction for Go. -Billy implements an interface based on the `os` standard library, allowing to develop applications without dependency on the underlying storage. Makes it virtually free to implement mocks and testing over filesystem operations. - -Billy was born as part of [go-git/go-git](https://github.com/go-git/go-git) project. - -## Installation - -```go -import "github.com/go-git/go-billy/v5" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/go-git/go-billy" // with go modules disabled -``` - -## Usage - -Billy exposes filesystems using the -[`Filesystem` interface](https://pkg.go.dev/github.com/go-git/go-billy/v5?tab=doc#Filesystem). -Each filesystem implementation gives you a `New` method, whose arguments depend on -the implementation itself, that returns a new `Filesystem`. - -The following example caches in memory all readable files in a directory from any -billy's filesystem implementation. - -```go -func LoadToMemory(origin billy.Filesystem, path string) (*memory.Memory, error) { - memory := memory.New() - - files, err := origin.ReadDir("/") - if err != nil { - return nil, err - } - - for _, file := range files { - if file.IsDir() { - continue - } - - src, err := origin.Open(file.Name()) - if err != nil { - return nil, err - } - - dst, err := memory.Create(file.Name()) - if err != nil { - return nil, err - } - - if _, err = io.Copy(dst, src); err != nil { - return nil, err - } - - if err := dst.Close(); err != nil { - return nil, err - } - - if err := src.Close(); err != nil { - return nil, err - } - } - - return memory, nil -} -``` - -## Why billy? - -The library billy deals with storage systems and Billy is the name of a well-known, IKEA -bookcase. That's it. - -## License - -Apache License Version 2.0, see [LICENSE](LICENSE) diff --git a/vendor/github.com/go-git/go-billy/v5/fs.go b/vendor/github.com/go-git/go-billy/v5/fs.go deleted file mode 100644 index a9efccdeb2..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/fs.go +++ /dev/null @@ -1,202 +0,0 @@ -package billy - -import ( - "errors" - "io" - "os" - "time" -) - -var ( - ErrReadOnly = errors.New("read-only filesystem") - ErrNotSupported = errors.New("feature not supported") - ErrCrossedBoundary = errors.New("chroot boundary crossed") -) - -// Capability holds the supported features of a billy filesystem. This does -// not mean that the capability has to be supported by the underlying storage. -// For example, a billy filesystem may support WriteCapability but the -// storage be mounted in read only mode. -type Capability uint64 - -const ( - // WriteCapability means that the fs is writable. - WriteCapability Capability = 1 << iota - // ReadCapability means that the fs is readable. - ReadCapability - // ReadAndWriteCapability is the ability to open a file in read and write mode. - ReadAndWriteCapability - // SeekCapability means it is able to move position inside the file. - SeekCapability - // TruncateCapability means that a file can be truncated. - TruncateCapability - // LockCapability is the ability to lock a file. - LockCapability - - // DefaultCapabilities lists all capable features supported by filesystems - // without Capability interface. This list should not be changed until a - // major version is released. - DefaultCapabilities Capability = WriteCapability | ReadCapability | - ReadAndWriteCapability | SeekCapability | TruncateCapability | - LockCapability - - // AllCapabilities lists all capable features. - AllCapabilities Capability = WriteCapability | ReadCapability | - ReadAndWriteCapability | SeekCapability | TruncateCapability | - LockCapability -) - -// Filesystem abstract the operations in a storage-agnostic interface. -// Each method implementation mimics the behavior of the equivalent functions -// at the os package from the standard library. -type Filesystem interface { - Basic - TempFile - Dir - Symlink - Chroot -} - -// Basic abstract the basic operations in a storage-agnostic interface as -// an extension to the Basic interface. -type Basic interface { - // Create creates the named file with mode 0666 (before umask), truncating - // it if it already exists. If successful, methods on the returned File can - // be used for I/O; the associated file descriptor has mode O_RDWR. - Create(filename string) (File, error) - // Open opens the named file for reading. If successful, methods on the - // returned file can be used for reading; the associated file descriptor has - // mode O_RDONLY. - Open(filename string) (File, error) - // OpenFile is the generalized open call; most users will use Open or Create - // instead. It opens the named file with specified flag (O_RDONLY etc.) and - // perm, (0666 etc.) if applicable. If successful, methods on the returned - // File can be used for I/O. - OpenFile(filename string, flag int, perm os.FileMode) (File, error) - // Stat returns a FileInfo describing the named file. - Stat(filename string) (os.FileInfo, error) - // Rename renames (moves) oldpath to newpath. If newpath already exists and - // is not a directory, Rename replaces it. OS-specific restrictions may - // apply when oldpath and newpath are in different directories. - Rename(oldpath, newpath string) error - // Remove removes the named file or directory. - Remove(filename string) error - // Join joins any number of path elements into a single path, adding a - // Separator if necessary. Join calls filepath.Clean on the result; in - // particular, all empty strings are ignored. On Windows, the result is a - // UNC path if and only if the first path element is a UNC path. - Join(elem ...string) string -} - -type TempFile interface { - // TempFile creates a new temporary file in the directory dir with a name - // beginning with prefix, opens the file for reading and writing, and - // returns the resulting *os.File. If dir is the empty string, TempFile - // uses the default directory for temporary files (see os.TempDir). - // Multiple programs calling TempFile simultaneously will not choose the - // same file. The caller can use f.Name() to find the pathname of the file. - // It is the caller's responsibility to remove the file when no longer - // needed. - TempFile(dir, prefix string) (File, error) -} - -// Dir abstract the dir related operations in a storage-agnostic interface as -// an extension to the Basic interface. -type Dir interface { - // ReadDir reads the directory named by dirname and returns a list of - // directory entries sorted by filename. - ReadDir(path string) ([]os.FileInfo, error) - // MkdirAll creates a directory named path, along with any necessary - // parents, and returns nil, or else returns an error. The permission bits - // perm are used for all directories that MkdirAll creates. If path is/ - // already a directory, MkdirAll does nothing and returns nil. - MkdirAll(filename string, perm os.FileMode) error -} - -// Symlink abstract the symlink related operations in a storage-agnostic -// interface as an extension to the Basic interface. -type Symlink interface { - // Lstat returns a FileInfo describing the named file. If the file is a - // symbolic link, the returned FileInfo describes the symbolic link. Lstat - // makes no attempt to follow the link. - Lstat(filename string) (os.FileInfo, error) - // Symlink creates a symbolic-link from link to target. target may be an - // absolute or relative path, and need not refer to an existing node. - // Parent directories of link are created as necessary. - Symlink(target, link string) error - // Readlink returns the target path of link. - Readlink(link string) (string, error) -} - -// Change abstract the FileInfo change related operations in a storage-agnostic -// interface as an extension to the Basic interface -type Change interface { - // Chmod changes the mode of the named file to mode. If the file is a - // symbolic link, it changes the mode of the link's target. - Chmod(name string, mode os.FileMode) error - // Lchown changes the numeric uid and gid of the named file. If the file is - // a symbolic link, it changes the uid and gid of the link itself. - Lchown(name string, uid, gid int) error - // Chown changes the numeric uid and gid of the named file. If the file is a - // symbolic link, it changes the uid and gid of the link's target. - Chown(name string, uid, gid int) error - // Chtimes changes the access and modification times of the named file, - // similar to the Unix utime() or utimes() functions. - // - // The underlying filesystem may truncate or round the values to a less - // precise time unit. - Chtimes(name string, atime time.Time, mtime time.Time) error -} - -// Chroot abstract the chroot related operations in a storage-agnostic interface -// as an extension to the Basic interface. -type Chroot interface { - // Chroot returns a new filesystem from the same type where the new root is - // the given path. Files outside of the designated directory tree cannot be - // accessed. - Chroot(path string) (Filesystem, error) - // Root returns the root path of the filesystem. - Root() string -} - -// File represent a file, being a subset of the os.File -type File interface { - // Name returns the name of the file as presented to Open. - Name() string - io.Writer - io.Reader - io.ReaderAt - io.Seeker - io.Closer - // Lock locks the file like e.g. flock. It protects against access from - // other processes. - Lock() error - // Unlock unlocks the file. - Unlock() error - // Truncate the file. - Truncate(size int64) error -} - -// Capable interface can return the available features of a filesystem. -type Capable interface { - // Capabilities returns the capabilities of a filesystem in bit flags. - Capabilities() Capability -} - -// Capabilities returns the features supported by a filesystem. If the FS -// does not implement Capable interface it returns all features. -func Capabilities(fs Basic) Capability { - capable, ok := fs.(Capable) - if !ok { - return DefaultCapabilities - } - - return capable.Capabilities() -} - -// CapabilityCheck tests the filesystem for the provided capabilities and -// returns true in case it supports all of them. -func CapabilityCheck(fs Basic, capabilities Capability) bool { - fsCaps := Capabilities(fs) - return fsCaps&capabilities == capabilities -} diff --git a/vendor/github.com/go-git/go-billy/v5/helper/chroot/chroot.go b/vendor/github.com/go-git/go-billy/v5/helper/chroot/chroot.go deleted file mode 100644 index 8b44e784bd..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/helper/chroot/chroot.go +++ /dev/null @@ -1,242 +0,0 @@ -package chroot - -import ( - "os" - "path/filepath" - "strings" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/helper/polyfill" -) - -// ChrootHelper is a helper to implement billy.Chroot. -type ChrootHelper struct { - underlying billy.Filesystem - base string -} - -// New creates a new filesystem wrapping up the given 'fs'. -// The created filesystem has its base in the given ChrootHelperectory of the -// underlying filesystem. -func New(fs billy.Basic, base string) billy.Filesystem { - return &ChrootHelper{ - underlying: polyfill.New(fs), - base: base, - } -} - -func (fs *ChrootHelper) underlyingPath(filename string) (string, error) { - if isCrossBoundaries(filename) { - return "", billy.ErrCrossedBoundary - } - - return fs.Join(fs.Root(), filename), nil -} - -func isCrossBoundaries(path string) bool { - path = filepath.ToSlash(path) - path = filepath.Clean(path) - - return strings.HasPrefix(path, ".."+string(filepath.Separator)) -} - -func (fs *ChrootHelper) Create(filename string) (billy.File, error) { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return nil, err - } - - f, err := fs.underlying.Create(fullpath) - if err != nil { - return nil, err - } - - return newFile(fs, f, filename), nil -} - -func (fs *ChrootHelper) Open(filename string) (billy.File, error) { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return nil, err - } - - f, err := fs.underlying.Open(fullpath) - if err != nil { - return nil, err - } - - return newFile(fs, f, filename), nil -} - -func (fs *ChrootHelper) OpenFile(filename string, flag int, mode os.FileMode) (billy.File, error) { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return nil, err - } - - f, err := fs.underlying.OpenFile(fullpath, flag, mode) - if err != nil { - return nil, err - } - - return newFile(fs, f, filename), nil -} - -func (fs *ChrootHelper) Stat(filename string) (os.FileInfo, error) { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return nil, err - } - - return fs.underlying.Stat(fullpath) -} - -func (fs *ChrootHelper) Rename(from, to string) error { - var err error - from, err = fs.underlyingPath(from) - if err != nil { - return err - } - - to, err = fs.underlyingPath(to) - if err != nil { - return err - } - - return fs.underlying.Rename(from, to) -} - -func (fs *ChrootHelper) Remove(path string) error { - fullpath, err := fs.underlyingPath(path) - if err != nil { - return err - } - - return fs.underlying.Remove(fullpath) -} - -func (fs *ChrootHelper) Join(elem ...string) string { - return fs.underlying.Join(elem...) -} - -func (fs *ChrootHelper) TempFile(dir, prefix string) (billy.File, error) { - fullpath, err := fs.underlyingPath(dir) - if err != nil { - return nil, err - } - - f, err := fs.underlying.(billy.TempFile).TempFile(fullpath, prefix) - if err != nil { - return nil, err - } - - return newFile(fs, f, fs.Join(dir, filepath.Base(f.Name()))), nil -} - -func (fs *ChrootHelper) ReadDir(path string) ([]os.FileInfo, error) { - fullpath, err := fs.underlyingPath(path) - if err != nil { - return nil, err - } - - return fs.underlying.(billy.Dir).ReadDir(fullpath) -} - -func (fs *ChrootHelper) MkdirAll(filename string, perm os.FileMode) error { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return err - } - - return fs.underlying.(billy.Dir).MkdirAll(fullpath, perm) -} - -func (fs *ChrootHelper) Lstat(filename string) (os.FileInfo, error) { - fullpath, err := fs.underlyingPath(filename) - if err != nil { - return nil, err - } - - return fs.underlying.(billy.Symlink).Lstat(fullpath) -} - -func (fs *ChrootHelper) Symlink(target, link string) error { - target = filepath.FromSlash(target) - - // only rewrite target if it's already absolute - if filepath.IsAbs(target) || strings.HasPrefix(target, string(filepath.Separator)) { - target = fs.Join(fs.Root(), target) - target = filepath.Clean(filepath.FromSlash(target)) - } - - link, err := fs.underlyingPath(link) - if err != nil { - return err - } - - return fs.underlying.(billy.Symlink).Symlink(target, link) -} - -func (fs *ChrootHelper) Readlink(link string) (string, error) { - fullpath, err := fs.underlyingPath(link) - if err != nil { - return "", err - } - - target, err := fs.underlying.(billy.Symlink).Readlink(fullpath) - if err != nil { - return "", err - } - - if !filepath.IsAbs(target) && !strings.HasPrefix(target, string(filepath.Separator)) { - return target, nil - } - - target, err = filepath.Rel(fs.base, target) - if err != nil { - return "", err - } - - return string(os.PathSeparator) + target, nil -} - -func (fs *ChrootHelper) Chroot(path string) (billy.Filesystem, error) { - fullpath, err := fs.underlyingPath(path) - if err != nil { - return nil, err - } - - return New(fs.underlying, fullpath), nil -} - -func (fs *ChrootHelper) Root() string { - return fs.base -} - -func (fs *ChrootHelper) Underlying() billy.Basic { - return fs.underlying -} - -// Capabilities implements the Capable interface. -func (fs *ChrootHelper) Capabilities() billy.Capability { - return billy.Capabilities(fs.underlying) -} - -type file struct { - billy.File - name string -} - -func newFile(fs billy.Filesystem, f billy.File, filename string) billy.File { - filename = fs.Join(fs.Root(), filename) - filename, _ = filepath.Rel(fs.Root(), filename) - - return &file{ - File: f, - name: filename, - } -} - -func (f *file) Name() string { - return f.name -} diff --git a/vendor/github.com/go-git/go-billy/v5/helper/polyfill/polyfill.go b/vendor/github.com/go-git/go-billy/v5/helper/polyfill/polyfill.go deleted file mode 100644 index 1efce0e7b8..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/helper/polyfill/polyfill.go +++ /dev/null @@ -1,105 +0,0 @@ -package polyfill - -import ( - "os" - "path/filepath" - - "github.com/go-git/go-billy/v5" -) - -// Polyfill is a helper that implements all missing method from billy.Filesystem. -type Polyfill struct { - billy.Basic - c capabilities -} - -type capabilities struct{ tempfile, dir, symlink, chroot bool } - -// New creates a new filesystem wrapping up 'fs' the intercepts all the calls -// made and errors if fs doesn't implement any of the billy interfaces. -func New(fs billy.Basic) billy.Filesystem { - if original, ok := fs.(billy.Filesystem); ok { - return original - } - - h := &Polyfill{Basic: fs} - - _, h.c.tempfile = h.Basic.(billy.TempFile) - _, h.c.dir = h.Basic.(billy.Dir) - _, h.c.symlink = h.Basic.(billy.Symlink) - _, h.c.chroot = h.Basic.(billy.Chroot) - return h -} - -func (h *Polyfill) TempFile(dir, prefix string) (billy.File, error) { - if !h.c.tempfile { - return nil, billy.ErrNotSupported - } - - return h.Basic.(billy.TempFile).TempFile(dir, prefix) -} - -func (h *Polyfill) ReadDir(path string) ([]os.FileInfo, error) { - if !h.c.dir { - return nil, billy.ErrNotSupported - } - - return h.Basic.(billy.Dir).ReadDir(path) -} - -func (h *Polyfill) MkdirAll(filename string, perm os.FileMode) error { - if !h.c.dir { - return billy.ErrNotSupported - } - - return h.Basic.(billy.Dir).MkdirAll(filename, perm) -} - -func (h *Polyfill) Symlink(target, link string) error { - if !h.c.symlink { - return billy.ErrNotSupported - } - - return h.Basic.(billy.Symlink).Symlink(target, link) -} - -func (h *Polyfill) Readlink(link string) (string, error) { - if !h.c.symlink { - return "", billy.ErrNotSupported - } - - return h.Basic.(billy.Symlink).Readlink(link) -} - -func (h *Polyfill) Lstat(path string) (os.FileInfo, error) { - if !h.c.symlink { - return nil, billy.ErrNotSupported - } - - return h.Basic.(billy.Symlink).Lstat(path) -} - -func (h *Polyfill) Chroot(path string) (billy.Filesystem, error) { - if !h.c.chroot { - return nil, billy.ErrNotSupported - } - - return h.Basic.(billy.Chroot).Chroot(path) -} - -func (h *Polyfill) Root() string { - if !h.c.chroot { - return string(filepath.Separator) - } - - return h.Basic.(billy.Chroot).Root() -} - -func (h *Polyfill) Underlying() billy.Basic { - return h.Basic -} - -// Capabilities implements the Capable interface. -func (h *Polyfill) Capabilities() billy.Capability { - return billy.Capabilities(h.Basic) -} diff --git a/vendor/github.com/go-git/go-billy/v5/memfs/memory.go b/vendor/github.com/go-git/go-billy/v5/memfs/memory.go deleted file mode 100644 index dab73968b6..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/memfs/memory.go +++ /dev/null @@ -1,410 +0,0 @@ -// Package memfs provides a billy filesystem base on memory. -package memfs // import "github.com/go-git/go-billy/v5/memfs" - -import ( - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/helper/chroot" - "github.com/go-git/go-billy/v5/util" -) - -const separator = filepath.Separator - -// Memory a very convenient filesystem based on memory files -type Memory struct { - s *storage - - tempCount int -} - -//New returns a new Memory filesystem. -func New() billy.Filesystem { - fs := &Memory{s: newStorage()} - return chroot.New(fs, string(separator)) -} - -func (fs *Memory) Create(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) -} - -func (fs *Memory) Open(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDONLY, 0) -} - -func (fs *Memory) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) { - f, has := fs.s.Get(filename) - if !has { - if !isCreate(flag) { - return nil, os.ErrNotExist - } - - var err error - f, err = fs.s.New(filename, perm, flag) - if err != nil { - return nil, err - } - } else { - if isExclusive(flag) { - return nil, os.ErrExist - } - - if target, isLink := fs.resolveLink(filename, f); isLink { - return fs.OpenFile(target, flag, perm) - } - } - - if f.mode.IsDir() { - return nil, fmt.Errorf("cannot open directory: %s", filename) - } - - return f.Duplicate(filename, perm, flag), nil -} - -var errNotLink = errors.New("not a link") - -func (fs *Memory) resolveLink(fullpath string, f *file) (target string, isLink bool) { - if !isSymlink(f.mode) { - return fullpath, false - } - - target = string(f.content.bytes) - if !isAbs(target) { - target = fs.Join(filepath.Dir(fullpath), target) - } - - return target, true -} - -// On Windows OS, IsAbs validates if a path is valid based on if stars with a -// unit (eg.: `C:\`) to assert that is absolute, but in this mem implementation -// any path starting by `separator` is also considered absolute. -func isAbs(path string) bool { - return filepath.IsAbs(path) || strings.HasPrefix(path, string(separator)) -} - -func (fs *Memory) Stat(filename string) (os.FileInfo, error) { - f, has := fs.s.Get(filename) - if !has { - return nil, os.ErrNotExist - } - - fi, _ := f.Stat() - - var err error - if target, isLink := fs.resolveLink(filename, f); isLink { - fi, err = fs.Stat(target) - if err != nil { - return nil, err - } - } - - // the name of the file should always the name of the stated file, so we - // overwrite the Stat returned from the storage with it, since the - // filename may belong to a link. - fi.(*fileInfo).name = filepath.Base(filename) - return fi, nil -} - -func (fs *Memory) Lstat(filename string) (os.FileInfo, error) { - f, has := fs.s.Get(filename) - if !has { - return nil, os.ErrNotExist - } - - return f.Stat() -} - -type ByName []os.FileInfo - -func (a ByName) Len() int { return len(a) } -func (a ByName) Less(i, j int) bool { return a[i].Name() < a[j].Name() } -func (a ByName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -func (fs *Memory) ReadDir(path string) ([]os.FileInfo, error) { - if f, has := fs.s.Get(path); has { - if target, isLink := fs.resolveLink(path, f); isLink { - return fs.ReadDir(target) - } - } - - var entries []os.FileInfo - for _, f := range fs.s.Children(path) { - fi, _ := f.Stat() - entries = append(entries, fi) - } - - sort.Sort(ByName(entries)) - - return entries, nil -} - -func (fs *Memory) MkdirAll(path string, perm os.FileMode) error { - _, err := fs.s.New(path, perm|os.ModeDir, 0) - return err -} - -func (fs *Memory) TempFile(dir, prefix string) (billy.File, error) { - return util.TempFile(fs, dir, prefix) -} - -func (fs *Memory) getTempFilename(dir, prefix string) string { - fs.tempCount++ - filename := fmt.Sprintf("%s_%d_%d", prefix, fs.tempCount, time.Now().UnixNano()) - return fs.Join(dir, filename) -} - -func (fs *Memory) Rename(from, to string) error { - return fs.s.Rename(from, to) -} - -func (fs *Memory) Remove(filename string) error { - return fs.s.Remove(filename) -} - -func (fs *Memory) Join(elem ...string) string { - return filepath.Join(elem...) -} - -func (fs *Memory) Symlink(target, link string) error { - _, err := fs.Stat(link) - if err == nil { - return os.ErrExist - } - - if !os.IsNotExist(err) { - return err - } - - return util.WriteFile(fs, link, []byte(target), 0777|os.ModeSymlink) -} - -func (fs *Memory) Readlink(link string) (string, error) { - f, has := fs.s.Get(link) - if !has { - return "", os.ErrNotExist - } - - if !isSymlink(f.mode) { - return "", &os.PathError{ - Op: "readlink", - Path: link, - Err: fmt.Errorf("not a symlink"), - } - } - - return string(f.content.bytes), nil -} - -// Capabilities implements the Capable interface. -func (fs *Memory) Capabilities() billy.Capability { - return billy.WriteCapability | - billy.ReadCapability | - billy.ReadAndWriteCapability | - billy.SeekCapability | - billy.TruncateCapability -} - -type file struct { - name string - content *content - position int64 - flag int - mode os.FileMode - - isClosed bool -} - -func (f *file) Name() string { - return f.name -} - -func (f *file) Read(b []byte) (int, error) { - n, err := f.ReadAt(b, f.position) - f.position += int64(n) - - if err == io.EOF && n != 0 { - err = nil - } - - return n, err -} - -func (f *file) ReadAt(b []byte, off int64) (int, error) { - if f.isClosed { - return 0, os.ErrClosed - } - - if !isReadAndWrite(f.flag) && !isReadOnly(f.flag) { - return 0, errors.New("read not supported") - } - - n, err := f.content.ReadAt(b, off) - - return n, err -} - -func (f *file) Seek(offset int64, whence int) (int64, error) { - if f.isClosed { - return 0, os.ErrClosed - } - - switch whence { - case io.SeekCurrent: - f.position += offset - case io.SeekStart: - f.position = offset - case io.SeekEnd: - f.position = int64(f.content.Len()) + offset - } - - return f.position, nil -} - -func (f *file) Write(p []byte) (int, error) { - if f.isClosed { - return 0, os.ErrClosed - } - - if !isReadAndWrite(f.flag) && !isWriteOnly(f.flag) { - return 0, errors.New("write not supported") - } - - n, err := f.content.WriteAt(p, f.position) - f.position += int64(n) - - return n, err -} - -func (f *file) Close() error { - if f.isClosed { - return os.ErrClosed - } - - f.isClosed = true - return nil -} - -func (f *file) Truncate(size int64) error { - if size < int64(len(f.content.bytes)) { - f.content.bytes = f.content.bytes[:size] - } else if more := int(size) - len(f.content.bytes); more > 0 { - f.content.bytes = append(f.content.bytes, make([]byte, more)...) - } - - return nil -} - -func (f *file) Duplicate(filename string, mode os.FileMode, flag int) billy.File { - new := &file{ - name: filename, - content: f.content, - mode: mode, - flag: flag, - } - - if isTruncate(flag) { - new.content.Truncate() - } - - if isAppend(flag) { - new.position = int64(new.content.Len()) - } - - return new -} - -func (f *file) Stat() (os.FileInfo, error) { - return &fileInfo{ - name: f.Name(), - mode: f.mode, - size: f.content.Len(), - }, nil -} - -// Lock is a no-op in memfs. -func (f *file) Lock() error { - return nil -} - -// Unlock is a no-op in memfs. -func (f *file) Unlock() error { - return nil -} - -type fileInfo struct { - name string - size int - mode os.FileMode -} - -func (fi *fileInfo) Name() string { - return fi.name -} - -func (fi *fileInfo) Size() int64 { - return int64(fi.size) -} - -func (fi *fileInfo) Mode() os.FileMode { - return fi.mode -} - -func (*fileInfo) ModTime() time.Time { - return time.Now() -} - -func (fi *fileInfo) IsDir() bool { - return fi.mode.IsDir() -} - -func (*fileInfo) Sys() interface{} { - return nil -} - -func (c *content) Truncate() { - c.bytes = make([]byte, 0) -} - -func (c *content) Len() int { - return len(c.bytes) -} - -func isCreate(flag int) bool { - return flag&os.O_CREATE != 0 -} - -func isExclusive(flag int) bool { - return flag&os.O_EXCL != 0 -} - -func isAppend(flag int) bool { - return flag&os.O_APPEND != 0 -} - -func isTruncate(flag int) bool { - return flag&os.O_TRUNC != 0 -} - -func isReadAndWrite(flag int) bool { - return flag&os.O_RDWR != 0 -} - -func isReadOnly(flag int) bool { - return flag == os.O_RDONLY -} - -func isWriteOnly(flag int) bool { - return flag&os.O_WRONLY != 0 -} - -func isSymlink(m os.FileMode) bool { - return m&os.ModeSymlink != 0 -} diff --git a/vendor/github.com/go-git/go-billy/v5/memfs/storage.go b/vendor/github.com/go-git/go-billy/v5/memfs/storage.go deleted file mode 100644 index e3c4e38bff..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/memfs/storage.go +++ /dev/null @@ -1,238 +0,0 @@ -package memfs - -import ( - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sync" -) - -type storage struct { - files map[string]*file - children map[string]map[string]*file -} - -func newStorage() *storage { - return &storage{ - files: make(map[string]*file, 0), - children: make(map[string]map[string]*file, 0), - } -} - -func (s *storage) Has(path string) bool { - path = clean(path) - - _, ok := s.files[path] - return ok -} - -func (s *storage) New(path string, mode os.FileMode, flag int) (*file, error) { - path = clean(path) - if s.Has(path) { - if !s.MustGet(path).mode.IsDir() { - return nil, fmt.Errorf("file already exists %q", path) - } - - return nil, nil - } - - name := filepath.Base(path) - - f := &file{ - name: name, - content: &content{name: name}, - mode: mode, - flag: flag, - } - - s.files[path] = f - s.createParent(path, mode, f) - return f, nil -} - -func (s *storage) createParent(path string, mode os.FileMode, f *file) error { - base := filepath.Dir(path) - base = clean(base) - if f.Name() == string(separator) { - return nil - } - - if _, err := s.New(base, mode.Perm()|os.ModeDir, 0); err != nil { - return err - } - - if _, ok := s.children[base]; !ok { - s.children[base] = make(map[string]*file, 0) - } - - s.children[base][f.Name()] = f - return nil -} - -func (s *storage) Children(path string) []*file { - path = clean(path) - - l := make([]*file, 0) - for _, f := range s.children[path] { - l = append(l, f) - } - - return l -} - -func (s *storage) MustGet(path string) *file { - f, ok := s.Get(path) - if !ok { - panic(fmt.Errorf("couldn't find %q", path)) - } - - return f -} - -func (s *storage) Get(path string) (*file, bool) { - path = clean(path) - if !s.Has(path) { - return nil, false - } - - file, ok := s.files[path] - return file, ok -} - -func (s *storage) Rename(from, to string) error { - from = clean(from) - to = clean(to) - - if !s.Has(from) { - return os.ErrNotExist - } - - move := [][2]string{{from, to}} - - for pathFrom := range s.files { - if pathFrom == from || !filepath.HasPrefix(pathFrom, from) { - continue - } - - rel, _ := filepath.Rel(from, pathFrom) - pathTo := filepath.Join(to, rel) - - move = append(move, [2]string{pathFrom, pathTo}) - } - - for _, ops := range move { - from := ops[0] - to := ops[1] - - if err := s.move(from, to); err != nil { - return err - } - } - - return nil -} - -func (s *storage) move(from, to string) error { - s.files[to] = s.files[from] - s.files[to].name = filepath.Base(to) - s.children[to] = s.children[from] - - defer func() { - delete(s.children, from) - delete(s.files, from) - delete(s.children[filepath.Dir(from)], filepath.Base(from)) - }() - - return s.createParent(to, 0644, s.files[to]) -} - -func (s *storage) Remove(path string) error { - path = clean(path) - - f, has := s.Get(path) - if !has { - return os.ErrNotExist - } - - if f.mode.IsDir() && len(s.children[path]) != 0 { - return fmt.Errorf("dir: %s contains files", path) - } - - base, file := filepath.Split(path) - base = filepath.Clean(base) - - delete(s.children[base], file) - delete(s.files, path) - return nil -} - -func clean(path string) string { - return filepath.Clean(filepath.FromSlash(path)) -} - -type content struct { - name string - bytes []byte - - m sync.RWMutex -} - -func (c *content) WriteAt(p []byte, off int64) (int, error) { - if off < 0 { - return 0, &os.PathError{ - Op: "writeat", - Path: c.name, - Err: errors.New("negative offset"), - } - } - - c.m.Lock() - prev := len(c.bytes) - - diff := int(off) - prev - if diff > 0 { - c.bytes = append(c.bytes, make([]byte, diff)...) - } - - c.bytes = append(c.bytes[:off], p...) - if len(c.bytes) < prev { - c.bytes = c.bytes[:prev] - } - c.m.Unlock() - - return len(p), nil -} - -func (c *content) ReadAt(b []byte, off int64) (n int, err error) { - if off < 0 { - return 0, &os.PathError{ - Op: "readat", - Path: c.name, - Err: errors.New("negative offset"), - } - } - - c.m.RLock() - size := int64(len(c.bytes)) - if off >= size { - c.m.RUnlock() - return 0, io.EOF - } - - l := int64(len(b)) - if off+l > size { - l = size - off - } - - btr := c.bytes[off : off+l] - n = copy(b, btr) - - if len(btr) < len(b) { - err = io.EOF - } - c.m.RUnlock() - - return -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os.go b/vendor/github.com/go-git/go-billy/v5/osfs/os.go deleted file mode 100644 index a7fe79f2f6..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build !js -// +build !js - -// Package osfs provides a billy filesystem for the OS. -package osfs - -import ( - "fmt" - "io/fs" - "os" - "sync" - - "github.com/go-git/go-billy/v5" -) - -const ( - defaultDirectoryMode = 0o755 - defaultCreateMode = 0o666 -) - -// Default Filesystem representing the root of the os filesystem. -var Default = &ChrootOS{} - -// New returns a new OS filesystem. -// By default paths are deduplicated, but still enforced -// under baseDir. For more info refer to WithDeduplicatePath. -func New(baseDir string, opts ...Option) billy.Filesystem { - o := &options{ - deduplicatePath: true, - } - for _, opt := range opts { - opt(o) - } - - if o.Type == BoundOSFS { - return newBoundOS(baseDir, o.deduplicatePath) - } - - return newChrootOS(baseDir) -} - -// WithBoundOS returns the option of using a Bound filesystem OS. -func WithBoundOS() Option { - return func(o *options) { - o.Type = BoundOSFS - } -} - -// WithChrootOS returns the option of using a Chroot filesystem OS. -func WithChrootOS() Option { - return func(o *options) { - o.Type = ChrootOSFS - } -} - -// WithDeduplicatePath toggles the deduplication of the base dir in the path. -// This occurs when absolute links are being used. -// Assuming base dir /base/dir and an absolute symlink /base/dir/target: -// -// With DeduplicatePath (default): /base/dir/target -// Without DeduplicatePath: /base/dir/base/dir/target -// -// This option is only used by the BoundOS OS type. -func WithDeduplicatePath(enabled bool) Option { - return func(o *options) { - o.deduplicatePath = enabled - } -} - -type options struct { - Type - deduplicatePath bool -} - -type Type int - -const ( - ChrootOSFS Type = iota - BoundOSFS -) - -func readDir(dir string) ([]os.FileInfo, error) { - entries, err := os.ReadDir(dir) - if err != nil { - return nil, err - } - infos := make([]fs.FileInfo, 0, len(entries)) - for _, entry := range entries { - fi, err := entry.Info() - if err != nil { - return nil, err - } - infos = append(infos, fi) - } - return infos, nil -} - -func tempFile(dir, prefix string) (billy.File, error) { - f, err := os.CreateTemp(dir, prefix) - if err != nil { - return nil, err - } - return &file{File: f}, nil -} - -func openFile(fn string, flag int, perm os.FileMode, createDir func(string) error) (billy.File, error) { - if flag&os.O_CREATE != 0 { - if createDir == nil { - return nil, fmt.Errorf("createDir func cannot be nil if file needs to be opened in create mode") - } - if err := createDir(fn); err != nil { - return nil, err - } - } - - f, err := os.OpenFile(fn, flag, perm) - if err != nil { - return nil, err - } - return &file{File: f}, err -} - -// file is a wrapper for an os.File which adds support for file locking. -type file struct { - *os.File - m sync.Mutex -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_bound.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_bound.go deleted file mode 100644 index b4b6dbc07a..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_bound.go +++ /dev/null @@ -1,261 +0,0 @@ -//go:build !js -// +build !js - -/* - Copyright 2022 The Flux authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -package osfs - -import ( - "fmt" - "os" - "path/filepath" - "strings" - - securejoin "github.com/cyphar/filepath-securejoin" - "github.com/go-git/go-billy/v5" -) - -// BoundOS is a fs implementation based on the OS filesystem which is bound to -// a base dir. -// Prefer this fs implementation over ChrootOS. -// -// Behaviours of note: -// 1. Read and write operations can only be directed to files which descends -// from the base dir. -// 2. Symlinks don't have their targets modified, and therefore can point -// to locations outside the base dir or to non-existent paths. -// 3. Readlink and Lstat ensures that the link file is located within the base -// dir, evaluating any symlinks that file or base dir may contain. -type BoundOS struct { - baseDir string - deduplicatePath bool -} - -func newBoundOS(d string, deduplicatePath bool) billy.Filesystem { - return &BoundOS{baseDir: d, deduplicatePath: deduplicatePath} -} - -func (fs *BoundOS) Create(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, defaultCreateMode) -} - -func (fs *BoundOS) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) { - fn, err := fs.abs(filename) - if err != nil { - return nil, err - } - return openFile(fn, flag, perm, fs.createDir) -} - -func (fs *BoundOS) ReadDir(path string) ([]os.FileInfo, error) { - dir, err := fs.abs(path) - if err != nil { - return nil, err - } - - return readDir(dir) -} - -func (fs *BoundOS) Rename(from, to string) error { - f, err := fs.abs(from) - if err != nil { - return err - } - t, err := fs.abs(to) - if err != nil { - return err - } - - // MkdirAll for target name. - if err := fs.createDir(t); err != nil { - return err - } - - return os.Rename(f, t) -} - -func (fs *BoundOS) MkdirAll(path string, perm os.FileMode) error { - dir, err := fs.abs(path) - if err != nil { - return err - } - return os.MkdirAll(dir, perm) -} - -func (fs *BoundOS) Open(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDONLY, 0) -} - -func (fs *BoundOS) Stat(filename string) (os.FileInfo, error) { - filename, err := fs.abs(filename) - if err != nil { - return nil, err - } - return os.Stat(filename) -} - -func (fs *BoundOS) Remove(filename string) error { - fn, err := fs.abs(filename) - if err != nil { - return err - } - return os.Remove(fn) -} - -// TempFile creates a temporary file. If dir is empty, the file -// will be created within the OS Temporary dir. If dir is provided -// it must descend from the current base dir. -func (fs *BoundOS) TempFile(dir, prefix string) (billy.File, error) { - if dir != "" { - var err error - dir, err = fs.abs(dir) - if err != nil { - return nil, err - } - } - - return tempFile(dir, prefix) -} - -func (fs *BoundOS) Join(elem ...string) string { - return filepath.Join(elem...) -} - -func (fs *BoundOS) RemoveAll(path string) error { - dir, err := fs.abs(path) - if err != nil { - return err - } - return os.RemoveAll(dir) -} - -func (fs *BoundOS) Symlink(target, link string) error { - ln, err := fs.abs(link) - if err != nil { - return err - } - // MkdirAll for containing dir. - if err := fs.createDir(ln); err != nil { - return err - } - return os.Symlink(target, ln) -} - -func (fs *BoundOS) Lstat(filename string) (os.FileInfo, error) { - filename = filepath.Clean(filename) - if !filepath.IsAbs(filename) { - filename = filepath.Join(fs.baseDir, filename) - } - if ok, err := fs.insideBaseDirEval(filename); !ok { - return nil, err - } - return os.Lstat(filename) -} - -func (fs *BoundOS) Readlink(link string) (string, error) { - if !filepath.IsAbs(link) { - link = filepath.Clean(filepath.Join(fs.baseDir, link)) - } - if ok, err := fs.insideBaseDirEval(link); !ok { - return "", err - } - return os.Readlink(link) -} - -// Chroot returns a new OS filesystem, with the base dir set to the -// result of joining the provided path with the underlying base dir. -func (fs *BoundOS) Chroot(path string) (billy.Filesystem, error) { - joined, err := securejoin.SecureJoin(fs.baseDir, path) - if err != nil { - return nil, err - } - return New(joined), nil -} - -// Root returns the current base dir of the billy.Filesystem. -// This is required in order for this implementation to be a drop-in -// replacement for other upstream implementations (e.g. memory and osfs). -func (fs *BoundOS) Root() string { - return fs.baseDir -} - -func (fs *BoundOS) createDir(fullpath string) error { - dir := filepath.Dir(fullpath) - if dir != "." { - if err := os.MkdirAll(dir, defaultDirectoryMode); err != nil { - return err - } - } - - return nil -} - -// abs transforms filename to an absolute path, taking into account the base dir. -// Relative paths won't be allowed to ascend the base dir, so `../file` will become -// `/working-dir/file`. -// -// Note that if filename is a symlink, the returned address will be the target of the -// symlink. -func (fs *BoundOS) abs(filename string) (string, error) { - if filename == fs.baseDir { - filename = string(filepath.Separator) - } - - path, err := securejoin.SecureJoin(fs.baseDir, filename) - if err != nil { - return "", nil - } - - if fs.deduplicatePath { - vol := filepath.VolumeName(fs.baseDir) - dup := filepath.Join(fs.baseDir, fs.baseDir[len(vol):]) - if strings.HasPrefix(path, dup+string(filepath.Separator)) { - return fs.abs(path[len(dup):]) - } - } - return path, nil -} - -// insideBaseDir checks whether filename is located within -// the fs.baseDir. -func (fs *BoundOS) insideBaseDir(filename string) (bool, error) { - if filename == fs.baseDir { - return true, nil - } - if !strings.HasPrefix(filename, fs.baseDir+string(filepath.Separator)) { - return false, fmt.Errorf("path outside base dir") - } - return true, nil -} - -// insideBaseDirEval checks whether filename is contained within -// a dir that is within the fs.baseDir, by first evaluating any symlinks -// that either filename or fs.baseDir may contain. -func (fs *BoundOS) insideBaseDirEval(filename string) (bool, error) { - dir, err := filepath.EvalSymlinks(filepath.Dir(filename)) - if dir == "" || os.IsNotExist(err) { - dir = filepath.Dir(filename) - } - wd, err := filepath.EvalSymlinks(fs.baseDir) - if wd == "" || os.IsNotExist(err) { - wd = fs.baseDir - } - if filename != wd && dir != wd && !strings.HasPrefix(dir, wd+string(filepath.Separator)) { - return false, fmt.Errorf("path outside base dir") - } - return true, nil -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_chroot.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_chroot.go deleted file mode 100644 index fd65e773c4..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_chroot.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build !js -// +build !js - -package osfs - -import ( - "os" - "path/filepath" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/helper/chroot" -) - -// ChrootOS is a legacy filesystem based on a "soft chroot" of the os filesystem. -// Although this is still the default os filesystem, consider using BoundOS instead. -// -// Behaviours of note: -// 1. A "soft chroot" translates the base dir to "/" for the purposes of the -// fs abstraction. -// 2. Symlinks targets may be modified to be kept within the chroot bounds. -// 3. Some file modes does not pass-through the fs abstraction. -// 4. The combination of 1 and 2 may cause go-git to think that a Git repository -// is dirty, when in fact it isn't. -type ChrootOS struct{} - -func newChrootOS(baseDir string) billy.Filesystem { - return chroot.New(&ChrootOS{}, baseDir) -} - -func (fs *ChrootOS) Create(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, defaultCreateMode) -} - -func (fs *ChrootOS) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) { - return openFile(filename, flag, perm, fs.createDir) -} - -func (fs *ChrootOS) createDir(fullpath string) error { - dir := filepath.Dir(fullpath) - if dir != "." { - if err := os.MkdirAll(dir, defaultDirectoryMode); err != nil { - return err - } - } - - return nil -} - -func (fs *ChrootOS) ReadDir(dir string) ([]os.FileInfo, error) { - return readDir(dir) -} - -func (fs *ChrootOS) Rename(from, to string) error { - if err := fs.createDir(to); err != nil { - return err - } - - return rename(from, to) -} - -func (fs *ChrootOS) MkdirAll(path string, perm os.FileMode) error { - return os.MkdirAll(path, defaultDirectoryMode) -} - -func (fs *ChrootOS) Open(filename string) (billy.File, error) { - return fs.OpenFile(filename, os.O_RDONLY, 0) -} - -func (fs *ChrootOS) Stat(filename string) (os.FileInfo, error) { - return os.Stat(filename) -} - -func (fs *ChrootOS) Remove(filename string) error { - return os.Remove(filename) -} - -func (fs *ChrootOS) TempFile(dir, prefix string) (billy.File, error) { - if err := fs.createDir(dir + string(os.PathSeparator)); err != nil { - return nil, err - } - - return tempFile(dir, prefix) -} - -func (fs *ChrootOS) Join(elem ...string) string { - return filepath.Join(elem...) -} - -func (fs *ChrootOS) RemoveAll(path string) error { - return os.RemoveAll(filepath.Clean(path)) -} - -func (fs *ChrootOS) Lstat(filename string) (os.FileInfo, error) { - return os.Lstat(filepath.Clean(filename)) -} - -func (fs *ChrootOS) Symlink(target, link string) error { - if err := fs.createDir(link); err != nil { - return err - } - - return os.Symlink(target, link) -} - -func (fs *ChrootOS) Readlink(link string) (string, error) { - return os.Readlink(link) -} - -// Capabilities implements the Capable interface. -func (fs *ChrootOS) Capabilities() billy.Capability { - return billy.DefaultCapabilities -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_js.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_js.go deleted file mode 100644 index 2e58aa5c61..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_js.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build js -// +build js - -package osfs - -import ( - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/helper/chroot" - "github.com/go-git/go-billy/v5/memfs" -) - -// globalMemFs is the global memory fs -var globalMemFs = memfs.New() - -// Default Filesystem representing the root of in-memory filesystem for a -// js/wasm environment. -var Default = memfs.New() - -// New returns a new OS filesystem. -func New(baseDir string, _ ...Option) billy.Filesystem { - return chroot.New(Default, Default.Join("/", baseDir)) -} - -type options struct { -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_options.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_options.go deleted file mode 100644 index 2f235c6ddc..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_options.go +++ /dev/null @@ -1,3 +0,0 @@ -package osfs - -type Option func(*options) diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_plan9.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_plan9.go deleted file mode 100644 index 84020b52f1..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_plan9.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build plan9 -// +build plan9 - -package osfs - -import ( - "io" - "os" - "path/filepath" - "syscall" -) - -func (f *file) Lock() error { - // Plan 9 uses a mode bit instead of explicit lock/unlock syscalls. - // - // Per http://man.cat-v.org/plan_9/5/stat: “Exclusive use files may be open - // for I/O by only one fid at a time across all clients of the server. If a - // second open is attempted, it draws an error.” - // - // There is no obvious way to implement this function using the exclusive use bit. - // See https://golang.org/src/cmd/go/internal/lockedfile/lockedfile_plan9.go - // for how file locking is done by the go tool on Plan 9. - return nil -} - -func (f *file) Unlock() error { - return nil -} - -func rename(from, to string) error { - // If from and to are in different directories, copy the file - // since Plan 9 does not support cross-directory rename. - if filepath.Dir(from) != filepath.Dir(to) { - fi, err := os.Stat(from) - if err != nil { - return &os.LinkError{"rename", from, to, err} - } - if fi.Mode().IsDir() { - return &os.LinkError{"rename", from, to, syscall.EISDIR} - } - fromFile, err := os.Open(from) - if err != nil { - return &os.LinkError{"rename", from, to, err} - } - toFile, err := os.OpenFile(to, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, fi.Mode()) - if err != nil { - return &os.LinkError{"rename", from, to, err} - } - _, err = io.Copy(toFile, fromFile) - if err != nil { - return &os.LinkError{"rename", from, to, err} - } - - // Copy mtime and mode from original file. - // We need only one syscall if we avoid os.Chmod and os.Chtimes. - dir := fi.Sys().(*syscall.Dir) - var d syscall.Dir - d.Null() - d.Mtime = dir.Mtime - d.Mode = dir.Mode - if err = dirwstat(to, &d); err != nil { - return &os.LinkError{"rename", from, to, err} - } - - // Remove original file. - err = os.Remove(from) - if err != nil { - return &os.LinkError{"rename", from, to, err} - } - return nil - } - return os.Rename(from, to) -} - -func dirwstat(name string, d *syscall.Dir) error { - var buf [syscall.STATFIXLEN]byte - - n, err := d.Marshal(buf[:]) - if err != nil { - return &os.PathError{"dirwstat", name, err} - } - if err = syscall.Wstat(name, buf[:n]); err != nil { - return &os.PathError{"dirwstat", name, err} - } - return nil -} - -func umask(new int) func() { - return func() { - } -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_posix.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_posix.go deleted file mode 100644 index d834a1145a..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_posix.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build !plan9 && !windows && !js -// +build !plan9,!windows,!js - -package osfs - -import ( - "os" - "syscall" - - "golang.org/x/sys/unix" -) - -func (f *file) Lock() error { - f.m.Lock() - defer f.m.Unlock() - - return unix.Flock(int(f.File.Fd()), unix.LOCK_EX) -} - -func (f *file) Unlock() error { - f.m.Lock() - defer f.m.Unlock() - - return unix.Flock(int(f.File.Fd()), unix.LOCK_UN) -} - -func rename(from, to string) error { - return os.Rename(from, to) -} - -// umask sets umask to a new value, and returns a func which allows the -// caller to reset it back to what it was originally. -func umask(new int) func() { - old := syscall.Umask(new) - return func() { - syscall.Umask(old) - } -} diff --git a/vendor/github.com/go-git/go-billy/v5/osfs/os_windows.go b/vendor/github.com/go-git/go-billy/v5/osfs/os_windows.go deleted file mode 100644 index e54df748e5..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/osfs/os_windows.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build windows -// +build windows - -package osfs - -import ( - "os" - "runtime" - "unsafe" - - "golang.org/x/sys/windows" -) - -var ( - kernel32DLL = windows.NewLazySystemDLL("kernel32.dll") - lockFileExProc = kernel32DLL.NewProc("LockFileEx") - unlockFileProc = kernel32DLL.NewProc("UnlockFile") -) - -const ( - lockfileExclusiveLock = 0x2 -) - -func (f *file) Lock() error { - f.m.Lock() - defer f.m.Unlock() - - var overlapped windows.Overlapped - // err is always non-nil as per sys/windows semantics. - ret, _, err := lockFileExProc.Call(f.File.Fd(), lockfileExclusiveLock, 0, 0xFFFFFFFF, 0, - uintptr(unsafe.Pointer(&overlapped))) - runtime.KeepAlive(&overlapped) - if ret == 0 { - return err - } - return nil -} - -func (f *file) Unlock() error { - f.m.Lock() - defer f.m.Unlock() - - // err is always non-nil as per sys/windows semantics. - ret, _, err := unlockFileProc.Call(f.File.Fd(), 0, 0, 0xFFFFFFFF, 0) - if ret == 0 { - return err - } - return nil -} - -func rename(from, to string) error { - return os.Rename(from, to) -} - -func umask(new int) func() { - return func() { - } -} diff --git a/vendor/github.com/go-git/go-billy/v5/util/glob.go b/vendor/github.com/go-git/go-billy/v5/util/glob.go deleted file mode 100644 index f7cb1de896..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/util/glob.go +++ /dev/null @@ -1,111 +0,0 @@ -package util - -import ( - "path/filepath" - "sort" - "strings" - - "github.com/go-git/go-billy/v5" -) - -// Glob returns the names of all files matching pattern or nil -// if there is no matching file. The syntax of patterns is the same -// as in Match. The pattern may describe hierarchical names such as -// /usr/*/bin/ed (assuming the Separator is '/'). -// -// Glob ignores file system errors such as I/O errors reading directories. -// The only possible returned error is ErrBadPattern, when pattern -// is malformed. -// -// Function originally from https://golang.org/src/path/filepath/match_test.go -func Glob(fs billy.Filesystem, pattern string) (matches []string, err error) { - if !hasMeta(pattern) { - if _, err = fs.Lstat(pattern); err != nil { - return nil, nil - } - return []string{pattern}, nil - } - - dir, file := filepath.Split(pattern) - // Prevent infinite recursion. See issue 15879. - if dir == pattern { - return nil, filepath.ErrBadPattern - } - - var m []string - m, err = Glob(fs, cleanGlobPath(dir)) - if err != nil { - return - } - for _, d := range m { - matches, err = glob(fs, d, file, matches) - if err != nil { - return - } - } - return -} - -// cleanGlobPath prepares path for glob matching. -func cleanGlobPath(path string) string { - switch path { - case "": - return "." - case string(filepath.Separator): - // do nothing to the path - return path - default: - return path[0 : len(path)-1] // chop off trailing separator - } -} - -// glob searches for files matching pattern in the directory dir -// and appends them to matches. If the directory cannot be -// opened, it returns the existing matches. New matches are -// added in lexicographical order. -func glob(fs billy.Filesystem, dir, pattern string, matches []string) (m []string, e error) { - m = matches - fi, err := fs.Stat(dir) - if err != nil { - return - } - - if !fi.IsDir() { - return - } - - names, _ := readdirnames(fs, dir) - sort.Strings(names) - - for _, n := range names { - matched, err := filepath.Match(pattern, n) - if err != nil { - return m, err - } - if matched { - m = append(m, filepath.Join(dir, n)) - } - } - return -} - -// hasMeta reports whether path contains any of the magic characters -// recognized by Match. -func hasMeta(path string) bool { - // TODO(niemeyer): Should other magic characters be added here? - return strings.ContainsAny(path, "*?[") -} - -func readdirnames(fs billy.Filesystem, dir string) ([]string, error) { - files, err := fs.ReadDir(dir) - if err != nil { - return nil, err - } - - var names []string - for _, file := range files { - names = append(names, file.Name()) - } - - return names, nil -} diff --git a/vendor/github.com/go-git/go-billy/v5/util/util.go b/vendor/github.com/go-git/go-billy/v5/util/util.go deleted file mode 100644 index 5c77128c3c..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/util/util.go +++ /dev/null @@ -1,282 +0,0 @@ -package util - -import ( - "io" - "os" - "path/filepath" - "strconv" - "sync" - "time" - - "github.com/go-git/go-billy/v5" -) - -// RemoveAll removes path and any children it contains. It removes everything it -// can but returns the first error it encounters. If the path does not exist, -// RemoveAll returns nil (no error). -func RemoveAll(fs billy.Basic, path string) error { - fs, path = getUnderlyingAndPath(fs, path) - - if r, ok := fs.(removerAll); ok { - return r.RemoveAll(path) - } - - return removeAll(fs, path) -} - -type removerAll interface { - RemoveAll(string) error -} - -func removeAll(fs billy.Basic, path string) error { - // This implementation is adapted from os.RemoveAll. - - // Simple case: if Remove works, we're done. - err := fs.Remove(path) - if err == nil || os.IsNotExist(err) { - return nil - } - - // Otherwise, is this a directory we need to recurse into? - dir, serr := fs.Stat(path) - if serr != nil { - if os.IsNotExist(serr) { - return nil - } - - return serr - } - - if !dir.IsDir() { - // Not a directory; return the error from Remove. - return err - } - - dirfs, ok := fs.(billy.Dir) - if !ok { - return billy.ErrNotSupported - } - - // Directory. - fis, err := dirfs.ReadDir(path) - if err != nil { - if os.IsNotExist(err) { - // Race. It was deleted between the Lstat and Open. - // Return nil per RemoveAll's docs. - return nil - } - - return err - } - - // Remove contents & return first error. - err = nil - for _, fi := range fis { - cpath := fs.Join(path, fi.Name()) - err1 := removeAll(fs, cpath) - if err == nil { - err = err1 - } - } - - // Remove directory. - err1 := fs.Remove(path) - if err1 == nil || os.IsNotExist(err1) { - return nil - } - - if err == nil { - err = err1 - } - - return err - -} - -// WriteFile writes data to a file named by filename in the given filesystem. -// If the file does not exist, WriteFile creates it with permissions perm; -// otherwise WriteFile truncates it before writing. -func WriteFile(fs billy.Basic, filename string, data []byte, perm os.FileMode) error { - f, err := fs.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm) - if err != nil { - return err - } - - n, err := f.Write(data) - if err == nil && n < len(data) { - err = io.ErrShortWrite - } - - if err1 := f.Close(); err == nil { - err = err1 - } - - return err -} - -// Random number state. -// We generate random temporary file names so that there's a good -// chance the file doesn't exist yet - keeps the number of tries in -// TempFile to a minimum. -var rand uint32 -var randmu sync.Mutex - -func reseed() uint32 { - return uint32(time.Now().UnixNano() + int64(os.Getpid())) -} - -func nextSuffix() string { - randmu.Lock() - r := rand - if r == 0 { - r = reseed() - } - r = r*1664525 + 1013904223 // constants from Numerical Recipes - rand = r - randmu.Unlock() - return strconv.Itoa(int(1e9 + r%1e9))[1:] -} - -// TempFile creates a new temporary file in the directory dir with a name -// beginning with prefix, opens the file for reading and writing, and returns -// the resulting *os.File. If dir is the empty string, TempFile uses the default -// directory for temporary files (see os.TempDir). Multiple programs calling -// TempFile simultaneously will not choose the same file. The caller can use -// f.Name() to find the pathname of the file. It is the caller's responsibility -// to remove the file when no longer needed. -func TempFile(fs billy.Basic, dir, prefix string) (f billy.File, err error) { - // This implementation is based on stdlib ioutil.TempFile. - if dir == "" { - dir = getTempDir(fs) - } - - nconflict := 0 - for i := 0; i < 10000; i++ { - name := filepath.Join(dir, prefix+nextSuffix()) - f, err = fs.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600) - if os.IsExist(err) { - if nconflict++; nconflict > 10 { - randmu.Lock() - rand = reseed() - randmu.Unlock() - } - continue - } - break - } - return -} - -// TempDir creates a new temporary directory in the directory dir -// with a name beginning with prefix and returns the path of the -// new directory. If dir is the empty string, TempDir uses the -// default directory for temporary files (see os.TempDir). -// Multiple programs calling TempDir simultaneously -// will not choose the same directory. It is the caller's responsibility -// to remove the directory when no longer needed. -func TempDir(fs billy.Dir, dir, prefix string) (name string, err error) { - // This implementation is based on stdlib ioutil.TempDir - - if dir == "" { - dir = getTempDir(fs.(billy.Basic)) - } - - nconflict := 0 - for i := 0; i < 10000; i++ { - try := filepath.Join(dir, prefix+nextSuffix()) - err = fs.MkdirAll(try, 0700) - if os.IsExist(err) { - if nconflict++; nconflict > 10 { - randmu.Lock() - rand = reseed() - randmu.Unlock() - } - continue - } - if os.IsNotExist(err) { - if _, err := os.Stat(dir); os.IsNotExist(err) { - return "", err - } - } - if err == nil { - name = try - } - break - } - return -} - -func getTempDir(fs billy.Basic) string { - ch, ok := fs.(billy.Chroot) - if !ok || ch.Root() == "" || ch.Root() == "/" || ch.Root() == string(filepath.Separator) { - return os.TempDir() - } - - return ".tmp" -} - -type underlying interface { - Underlying() billy.Basic -} - -func getUnderlyingAndPath(fs billy.Basic, path string) (billy.Basic, string) { - u, ok := fs.(underlying) - if !ok { - return fs, path - } - if ch, ok := fs.(billy.Chroot); ok { - path = fs.Join(ch.Root(), path) - } - - return u.Underlying(), path -} - -// ReadFile reads the named file and returns the contents from the given filesystem. -// A successful call returns err == nil, not err == EOF. -// Because ReadFile reads the whole file, it does not treat an EOF from Read -// as an error to be reported. -func ReadFile(fs billy.Basic, name string) ([]byte, error) { - f, err := fs.Open(name) - if err != nil { - return nil, err - } - - defer f.Close() - - var size int - if info, err := fs.Stat(name); err == nil { - size64 := info.Size() - if int64(int(size64)) == size64 { - size = int(size64) - } - } - - size++ // one byte for final read at EOF - // If a file claims a small size, read at least 512 bytes. - // In particular, files in Linux's /proc claim size 0 but - // then do not work right if read in small pieces, - // so an initial read of 1 byte would not work correctly. - - if size < 512 { - size = 512 - } - - data := make([]byte, 0, size) - for { - if len(data) >= cap(data) { - d := append(data[:cap(data)], 0) - data = d[:len(data)] - } - - n, err := f.Read(data[len(data):cap(data)]) - data = data[:len(data)+n] - - if err != nil { - if err == io.EOF { - err = nil - } - - return data, err - } - } -} diff --git a/vendor/github.com/go-git/go-billy/v5/util/walk.go b/vendor/github.com/go-git/go-billy/v5/util/walk.go deleted file mode 100644 index 1531bcaaae..0000000000 --- a/vendor/github.com/go-git/go-billy/v5/util/walk.go +++ /dev/null @@ -1,72 +0,0 @@ -package util - -import ( - "os" - "path/filepath" - - "github.com/go-git/go-billy/v5" -) - -// walk recursively descends path, calling walkFn -// adapted from https://golang.org/src/path/filepath/path.go -func walk(fs billy.Filesystem, path string, info os.FileInfo, walkFn filepath.WalkFunc) error { - if !info.IsDir() { - return walkFn(path, info, nil) - } - - names, err := readdirnames(fs, path) - err1 := walkFn(path, info, err) - // If err != nil, walk can't walk into this directory. - // err1 != nil means walkFn want walk to skip this directory or stop walking. - // Therefore, if one of err and err1 isn't nil, walk will return. - if err != nil || err1 != nil { - // The caller's behavior is controlled by the return value, which is decided - // by walkFn. walkFn may ignore err and return nil. - // If walkFn returns SkipDir, it will be handled by the caller. - // So walk should return whatever walkFn returns. - return err1 - } - - for _, name := range names { - filename := filepath.Join(path, name) - fileInfo, err := fs.Lstat(filename) - if err != nil { - if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir { - return err - } - } else { - err = walk(fs, filename, fileInfo, walkFn) - if err != nil { - if !fileInfo.IsDir() || err != filepath.SkipDir { - return err - } - } - } - } - return nil -} - -// Walk walks the file tree rooted at root, calling fn for each file or -// directory in the tree, including root. All errors that arise visiting files -// and directories are filtered by fn: see the WalkFunc documentation for -// details. -// -// The files are walked in lexical order, which makes the output deterministic -// but requires Walk to read an entire directory into memory before proceeding -// to walk that directory. Walk does not follow symbolic links. -// -// Function adapted from https://github.com/golang/go/blob/3b770f2ccb1fa6fecc22ea822a19447b10b70c5c/src/path/filepath/path.go#L500 -func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error { - info, err := fs.Lstat(root) - if err != nil { - err = walkFn(root, nil, err) - } else { - err = walk(fs, root, info, walkFn) - } - - if err == filepath.SkipDir { - return nil - } - - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/.gitignore b/vendor/github.com/go-git/go-git/v5/.gitignore deleted file mode 100644 index b7f2c5807c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -coverage.out -*~ -coverage.txt -profile.out -.tmp/ -.git-dist/ -.vscode diff --git a/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md b/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md deleted file mode 100644 index a689fa3c34..0000000000 --- a/vendor/github.com/go-git/go-git/v5/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -education, socio-economic status, nationality, personal appearance, race, -religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at conduct@sourced.tech. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - diff --git a/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md b/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md deleted file mode 100644 index c1f280d4d0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/COMPATIBILITY.md +++ /dev/null @@ -1,233 +0,0 @@ -# Supported Features - -Here is a non-comprehensive table of git commands and features and their -compatibility status with go-git. - -## Getting and creating repositories - -| Feature | Sub-feature | Status | Notes | Examples | -| ------- | ------------------------------------------------------------------------------------------------------------------ | ------ | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `init` | | ✅ | | | -| `init` | `--bare` | ✅ | | | -| `init` | `--template`
`--separate-git-dir`
`--shared` | ❌ | | | -| `clone` | | ✅ | | - [PlainClone](_examples/clone/main.go) | -| `clone` | Authentication:
- none
- access token
- username + password
- ssh | ✅ | | - [clone ssh](_examples/clone/auth/ssh/main.go)
- [clone access token](_examples/clone/auth/basic/access_token/main.go)
- [clone user + password](_examples/clone/auth/basic/username_password/main.go) | -| `clone` | `--progress`
`--single-branch`
`--depth`
`--origin`
`--recurse-submodules`
`--shared` | ✅ | | - [recurse submodules](_examples/clone/main.go)
- [progress](_examples/progress/main.go) | - -## Basic snapshotting - -| Feature | Sub-feature | Status | Notes | Examples | -| -------- | ----------- | ------ | -------------------------------------------------------- | ------------------------------------ | -| `add` | | ✅ | Plain add is supported. Any other flags aren't supported | | -| `status` | | ✅ | | | -| `commit` | | ✅ | | - [commit](_examples/commit/main.go) | -| `reset` | | ✅ | | | -| `rm` | | ✅ | | | -| `mv` | | ✅ | | | - -## Branching and merging - -| Feature | Sub-feature | Status | Notes | Examples | -| ----------- | ----------- | ------ | --------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `branch` | | ✅ | | - [branch](_examples/branch/main.go) | -| `checkout` | | ✅ | Basic usages of checkout are supported. | - [checkout](_examples/checkout/main.go) | -| `merge` | | ❌ | | | -| `mergetool` | | ❌ | | | -| `stash` | | ❌ | | | -| `tag` | | ✅ | | - [tag](_examples/tag/main.go)
- [tag create and push](_examples/tag-create-push/main.go) | - -## Sharing and updating projects - -| Feature | Sub-feature | Status | Notes | Examples | -| ----------- | ----------- | ------ | ----------------------------------------------------------------------- | ------------------------------------------ | -| `fetch` | | ✅ | | | -| `pull` | | ✅ | Only supports merges where the merge can be resolved as a fast-forward. | - [pull](_examples/pull/main.go) | -| `push` | | ✅ | | - [push](_examples/push/main.go) | -| `remote` | | ✅ | | - [remotes](_examples/remotes/main.go) | -| `submodule` | | ✅ | | - [submodule](_examples/submodule/main.go) | -| `submodule` | deinit | ❌ | | | - -## Inspection and comparison - -| Feature | Sub-feature | Status | Notes | Examples | -| ---------- | ----------- | --------- | ----- | ------------------------------ | -| `show` | | ✅ | | | -| `log` | | ✅ | | - [log](_examples/log/main.go) | -| `shortlog` | | (see log) | | | -| `describe` | | ❌ | | | - -## Patching - -| Feature | Sub-feature | Status | Notes | Examples | -| ------------- | ----------- | ------ | ---------------------------------------------------- | -------- | -| `apply` | | ❌ | | | -| `cherry-pick` | | ❌ | | | -| `diff` | | ✅ | Patch object with UnifiedDiff output representation. | | -| `rebase` | | ❌ | | | -| `revert` | | ❌ | | | - -## Debugging - -| Feature | Sub-feature | Status | Notes | Examples | -| -------- | ----------- | ------ | ----- | ---------------------------------- | -| `bisect` | | ❌ | | | -| `blame` | | ✅ | | - [blame](_examples/blame/main.go) | -| `grep` | | ✅ | | | - -## Email - -| Feature | Sub-feature | Status | Notes | Examples | -| -------------- | ----------- | ------ | ----- | -------- | -| `am` | | ❌ | | | -| `apply` | | ❌ | | | -| `format-patch` | | ❌ | | | -| `send-email` | | ❌ | | | -| `request-pull` | | ❌ | | | - -## External systems - -| Feature | Sub-feature | Status | Notes | Examples | -| ------------- | ----------- | ------ | ----- | -------- | -| `svn` | | ❌ | | | -| `fast-import` | | ❌ | | | -| `lfs` | | ❌ | | | - -## Administration - -| Feature | Sub-feature | Status | Notes | Examples | -| --------------- | ----------- | ------ | ----- | -------- | -| `clean` | | ✅ | | | -| `gc` | | ❌ | | | -| `fsck` | | ❌ | | | -| `reflog` | | ❌ | | | -| `filter-branch` | | ❌ | | | -| `instaweb` | | ❌ | | | -| `archive` | | ❌ | | | -| `bundle` | | ❌ | | | -| `prune` | | ❌ | | | -| `repack` | | ❌ | | | - -## Server admin - -| Feature | Sub-feature | Status | Notes | Examples | -| -------------------- | ----------- | ------ | ----- | ----------------------------------------- | -| `daemon` | | ❌ | | | -| `update-server-info` | | ✅ | | [cli](./cli/go-git/update_server_info.go) | - -## Advanced - -| Feature | Sub-feature | Status | Notes | Examples | -| ---------- | ----------- | ----------- | ----- | -------- | -| `notes` | | ❌ | | | -| `replace` | | ❌ | | | -| `worktree` | | ❌ | | | -| `annotate` | | (see blame) | | | - -## GPG - -| Feature | Sub-feature | Status | Notes | Examples | -| ------------------- | ----------- | ------ | ----- | -------- | -| `git-verify-commit` | | ✅ | | | -| `git-verify-tag` | | ✅ | | | - -## Plumbing commands - -| Feature | Sub-feature | Status | Notes | Examples | -| --------------- | ------------------------------------- | ------------ | --------------------------------------------------- | -------------------------------------------- | -| `cat-file` | | ✅ | | | -| `check-ignore` | | ❌ | | | -| `commit-tree` | | ❌ | | | -| `count-objects` | | ❌ | | | -| `diff-index` | | ❌ | | | -| `for-each-ref` | | ✅ | | | -| `hash-object` | | ✅ | | | -| `ls-files` | | ✅ | | | -| `ls-remote` | | ✅ | | - [ls-remote](_examples/ls-remote/main.go) | -| `merge-base` | `--independent`
`--is-ancestor` | ⚠️ (partial) | Calculates the merge-base only between two commits. | - [merge-base](_examples/merge_base/main.go) | -| `merge-base` | `--fork-point`
`--octopus` | ❌ | | | -| `read-tree` | | ❌ | | | -| `rev-list` | | ✅ | | | -| `rev-parse` | | ❌ | | | -| `show-ref` | | ✅ | | | -| `symbolic-ref` | | ✅ | | | -| `update-index` | | ❌ | | | -| `update-ref` | | ❌ | | | -| `verify-pack` | | ❌ | | | -| `write-tree` | | ❌ | | | - -## Indexes and Git Protocols - -| Feature | Version | Status | Notes | -| -------------------- | ------------------------------------------------------------------------------- | ------ | ----- | -| index | [v1](https://github.com/git/git/blob/master/Documentation/gitformat-index.txt) | ❌ | | -| index | [v2](https://github.com/git/git/blob/master/Documentation/gitformat-index.txt) | ✅ | | -| index | [v3](https://github.com/git/git/blob/master/Documentation/gitformat-index.txt) | ❌ | | -| pack-protocol | [v1](https://github.com/git/git/blob/master/Documentation/gitprotocol-pack.txt) | ✅ | | -| pack-protocol | [v2](https://github.com/git/git/blob/master/Documentation/gitprotocol-v2.txt) | ❌ | | -| multi-pack-index | [v1](https://github.com/git/git/blob/master/Documentation/gitformat-pack.txt) | ❌ | | -| pack-\*.rev files | [v1](https://github.com/git/git/blob/master/Documentation/gitformat-pack.txt) | ❌ | | -| pack-\*.mtimes files | [v1](https://github.com/git/git/blob/master/Documentation/gitformat-pack.txt) | ❌ | | -| cruft packs | | ❌ | | - -## Capabilities - -| Feature | Status | Notes | -| ------------------------------ | ------------ | ----- | -| `multi_ack` | ❌ | | -| `multi_ack_detailed` | ❌ | | -| `no-done` | ❌ | | -| `thin-pack` | ❌ | | -| `side-band` | ⚠️ (partial) | | -| `side-band-64k` | ⚠️ (partial) | | -| `ofs-delta` | ✅ | | -| `agent` | ✅ | | -| `object-format` | ❌ | | -| `symref` | ✅ | | -| `shallow` | ✅ | | -| `deepen-since` | ✅ | | -| `deepen-not` | ❌ | | -| `deepen-relative` | ❌ | | -| `no-progress` | ✅ | | -| `include-tag` | ✅ | | -| `report-status` | ✅ | | -| `report-status-v2` | ❌ | | -| `delete-refs` | ✅ | | -| `quiet` | ❌ | | -| `atomic` | ✅ | | -| `push-options` | ✅ | | -| `allow-tip-sha1-in-want` | ✅ | | -| `allow-reachable-sha1-in-want` | ❌ | | -| `push-cert=` | ❌ | | -| `filter` | ❌ | | -| `session-id=` | ❌ | | - -## Transport Schemes - -| Scheme | Status | Notes | Examples | -| -------------------- | ------------ | ---------------------------------------------------------------------- | ---------------------------------------------- | -| `http(s)://` (dumb) | ❌ | | | -| `http(s)://` (smart) | ✅ | | | -| `git://` | ✅ | | | -| `ssh://` | ✅ | | | -| `file://` | ⚠️ (partial) | Warning: this is not pure Golang. This shells out to the `git` binary. | | -| Custom | ✅ | All existing schemes can be replaced by custom implementations. | - [custom_http](_examples/custom_http/main.go) | - -## SHA256 - -| Feature | Sub-feature | Status | Notes | Examples | -| -------- | ----------- | ------ | ---------------------------------- | ------------------------------------ | -| `init` | | ✅ | Requires building with tag sha256. | - [init](_examples/sha256/main.go) | -| `commit` | | ✅ | Requires building with tag sha256. | - [commit](_examples/sha256/main.go) | -| `pull` | | ❌ | | | -| `fetch` | | ❌ | | | -| `push` | | ❌ | | | - -## Other features - -| Feature | Sub-feature | Status | Notes | Examples | -| --------------- | --------------------------- | ------ | ---------------------------------------------- | -------- | -| `config` | `--local` | ✅ | Read and write per-repository (`.git/config`). | | -| `config` | `--global`
`--system` | ✅ | Read-only. | | -| `gitignore` | | ✅ | | | -| `gitattributes` | | ✅ | | | -| `git-worktree` | | ❌ | Multiple worktrees are not supported. | | diff --git a/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md b/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md deleted file mode 100644 index fce25328a7..0000000000 --- a/vendor/github.com/go-git/go-git/v5/CONTRIBUTING.md +++ /dev/null @@ -1,46 +0,0 @@ -# Contributing Guidelines - -source{d} go-git project is [Apache 2.0 licensed](LICENSE) and accepts -contributions via GitHub pull requests. This document outlines some of the -conventions on development workflow, commit message formatting, contact points, -and other resources to make it easier to get your contribution accepted. - -## Support Channels - -The official support channels, for both users and contributors, are: - -- [StackOverflow go-git tag](https://stackoverflow.com/questions/tagged/go-git) for user questions. -- GitHub [Issues](https://github.com/src-d/go-git/issues)* for bug reports and feature requests. - -*Before opening a new issue or submitting a new pull request, it's helpful to -search the project - it's likely that another user has already reported the -issue you're facing, or it's a known issue that we're already aware of. - - -## How to Contribute - -Pull Requests (PRs) are the main and exclusive way to contribute to the official go-git project. -In order for a PR to be accepted it needs to pass a list of requirements: - -- You should be able to run the same query using `git`. We don't accept features that are not implemented in the official git implementation. -- The expected behavior must match the [official git implementation](https://github.com/git/git). -- The actual behavior must be correctly explained with natural language and providing a minimum working example in Go that reproduces it. -- All PRs must be written in idiomatic Go, formatted according to [gofmt](https://golang.org/cmd/gofmt/), and without any warnings from [go lint](https://github.com/golang/lint) nor [go vet](https://golang.org/cmd/vet/). -- They should in general include tests, and those shall pass. -- If the PR is a bug fix, it has to include a suite of unit tests for the new functionality. -- If the PR is a new feature, it has to come with a suite of unit tests, that tests the new functionality. -- In any case, all the PRs have to pass the personal evaluation of at least one of the maintainers of go-git. - -### Format of the commit message - -Every commit message should describe what was changed, under which context and, if applicable, the GitHub issue it relates to: - -``` -plumbing: packp, Skip argument validations for unknown capabilities. Fixes #623 -``` - -The format can be described more formally as follows: - -``` -: , . [Fixes #] -``` diff --git a/vendor/github.com/go-git/go-git/v5/EXTENDING.md b/vendor/github.com/go-git/go-git/v5/EXTENDING.md deleted file mode 100644 index a2778e34ab..0000000000 --- a/vendor/github.com/go-git/go-git/v5/EXTENDING.md +++ /dev/null @@ -1,78 +0,0 @@ -# Extending go-git - -`go-git` was built in a highly extensible manner, which enables some of its functionalities to be changed or extended without the need of changing its codebase. Here are the key extensibility features: - -## Dot Git Storers - -Dot git storers are the components responsible for storing the Git internal files, including objects and references. - -The built-in storer implementations include [memory](storage/memory) and [filesystem](storage/filesystem). The `memory` storer stores all the data in memory, and its use look like this: - -```go - r, err := git.Init(memory.NewStorage(), nil) -``` - -The `filesystem` storer stores the data in the OS filesystem, and can be used as follows: - -```go - r, err := git.Init(filesystem.NewStorage(osfs.New("/tmp/foo")), nil) -``` - -New implementations can be created by implementing the [storage.Storer interface](storage/storer.go#L16). - -## Filesystem - -Git repository worktrees are managed using a filesystem abstraction based on [go-billy](https://github.com/go-git/go-billy). The Git operations will take place against the specific filesystem implementation. Initialising a repository in Memory can be done as follows: - -```go - fs := memfs.New() - r, err := git.Init(memory.NewStorage(), fs) -``` - -The same operation can be done against the OS filesystem: - -```go - fs := osfs.New("/tmp/foo") - r, err := git.Init(memory.NewStorage(), fs) -``` - -New filesystems (e.g. cloud based storage) could be created by implementing `go-billy`'s [Filesystem interface](https://github.com/go-git/go-billy/blob/326c59f064021b821a55371d57794fbfb86d4cb3/fs.go#L52). - -## Transport Schemes - -Git supports various transport schemes, including `http`, `https`, `ssh`, `git`, `file`. `go-git` defines the [transport.Transport interface](plumbing/transport/common.go#L48) to represent them. - -The built-in implementations can be replaced by calling `client.InstallProtocol`. - -An example of changing the built-in `https` implementation to skip TLS could look like this: - -```go - customClient := &http.Client{ - Transport: &http.Transport{ - TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - }, - } - - client.InstallProtocol("https", githttp.NewClient(customClient)) -``` - -Some internal implementations enables code reuse amongst the different transport implementations. Some of these may be made public in the future (e.g. `plumbing/transport/internal/common`). - -## Cache - -Several different operations across `go-git` lean on caching of objects in order to achieve optimal performance. The caching functionality is defined by the [cache.Object interface](plumbing/cache/common.go#L17). - -Two built-in implementations are `cache.ObjectLRU` and `cache.BufferLRU`. However, the caching functionality can be customized by implementing the interface `cache.Object` interface. - -## Hash - -`go-git` uses the `crypto.Hash` interface to represent hash functions. The built-in implementations are `github.com/pjbgf/sha1cd` for SHA1 and Go's `crypto/SHA256`. - -The default hash functions can be changed by calling `hash.RegisterHash`. -```go - func init() { - hash.RegisterHash(crypto.SHA1, sha1.New) - } -``` - -New `SHA1` or `SHA256` hash functions that implement the `hash.RegisterHash` interface can be registered by calling `RegisterHash`. diff --git a/vendor/github.com/go-git/go-git/v5/LICENSE b/vendor/github.com/go-git/go-git/v5/LICENSE deleted file mode 100644 index 8aa3d854cf..0000000000 --- a/vendor/github.com/go-git/go-git/v5/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 Sourced Technologies, S.L. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-git/go-git/v5/Makefile b/vendor/github.com/go-git/go-git/v5/Makefile deleted file mode 100644 index 1e10396747..0000000000 --- a/vendor/github.com/go-git/go-git/v5/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# General -WORKDIR = $(PWD) - -# Go parameters -GOCMD = go -GOTEST = $(GOCMD) test - -# Git config -GIT_VERSION ?= -GIT_DIST_PATH ?= $(PWD)/.git-dist -GIT_REPOSITORY = http://github.com/git/git.git - -# Coverage -COVERAGE_REPORT = coverage.out -COVERAGE_MODE = count - -build-git: - @if [ -f $(GIT_DIST_PATH)/git ]; then \ - echo "nothing to do, using cache $(GIT_DIST_PATH)"; \ - else \ - git clone $(GIT_REPOSITORY) -b $(GIT_VERSION) --depth 1 --single-branch $(GIT_DIST_PATH); \ - cd $(GIT_DIST_PATH); \ - make configure; \ - ./configure; \ - make all; \ - fi - -test: - @echo "running against `git version`"; \ - $(GOTEST) -race ./... - -TEMP_REPO := $(shell mktemp) -test-sha256: - $(GOCMD) run -tags sha256 _examples/sha256/main.go $(TEMP_REPO) - cd $(TEMP_REPO) && git fsck - rm -rf $(TEMP_REPO) - -test-coverage: - @echo "running against `git version`"; \ - echo "" > $(COVERAGE_REPORT); \ - $(GOTEST) -coverprofile=$(COVERAGE_REPORT) -coverpkg=./... -covermode=$(COVERAGE_MODE) ./... - -clean: - rm -rf $(GIT_DIST_PATH) - -fuzz: - @go test -fuzz=FuzzParser $(PWD)/internal/revision - @go test -fuzz=FuzzDecoder $(PWD)/plumbing/format/config - @go test -fuzz=FuzzPatchDelta $(PWD)/plumbing/format/packfile - @go test -fuzz=FuzzParseSignedBytes $(PWD)/plumbing/object - @go test -fuzz=FuzzDecode $(PWD)/plumbing/object - @go test -fuzz=FuzzDecoder $(PWD)/plumbing/protocol/packp - @go test -fuzz=FuzzNewEndpoint $(PWD)/plumbing/transport diff --git a/vendor/github.com/go-git/go-git/v5/README.md b/vendor/github.com/go-git/go-git/v5/README.md deleted file mode 100644 index ff0c9b72ba..0000000000 --- a/vendor/github.com/go-git/go-git/v5/README.md +++ /dev/null @@ -1,131 +0,0 @@ -![go-git logo](https://cdn.rawgit.com/src-d/artwork/02036484/go-git/files/go-git-github-readme-header.png) -[![GoDoc](https://godoc.org/github.com/go-git/go-git/v5?status.svg)](https://pkg.go.dev/github.com/go-git/go-git/v5) [![Build Status](https://github.com/go-git/go-git/workflows/Test/badge.svg)](https://github.com/go-git/go-git/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/go-git/go-git)](https://goreportcard.com/report/github.com/go-git/go-git) - -*go-git* is a highly extensible git implementation library written in **pure Go**. - -It can be used to manipulate git repositories at low level *(plumbing)* or high level *(porcelain)*, through an idiomatic Go API. It also supports several types of storage, such as in-memory filesystems, or custom implementations, thanks to the [`Storer`](https://pkg.go.dev/github.com/go-git/go-git/v5/plumbing/storer) interface. - -It's being actively developed since 2015 and is being used extensively by [Keybase](https://keybase.io/blog/encrypted-git-for-everyone), [Gitea](https://gitea.io/en-us/) or [Pulumi](https://github.com/search?q=org%3Apulumi+go-git&type=Code), and by many other libraries and tools. - -Project Status --------------- - -After the legal issues with the [`src-d`](https://github.com/src-d) organization, the lack of update for four months and the requirement to make a hard fork, the project is **now back to normality**. - -The project is currently actively maintained by individual contributors, including several of the original authors, but also backed by a new company, [gitsight](https://github.com/gitsight), where `go-git` is a critical component used at scale. - - -Comparison with git -------------------- - -*go-git* aims to be fully compatible with [git](https://github.com/git/git), all the *porcelain* operations are implemented to work exactly as *git* does. - -*git* is a humongous project with years of development by thousands of contributors, making it challenging for *go-git* to implement all the features. You can find a comparison of *go-git* vs *git* in the [compatibility documentation](COMPATIBILITY.md). - - -Installation ------------- - -The recommended way to install *go-git* is: - -```go -import "github.com/go-git/go-git/v5" // with go modules enabled (GO111MODULE=on or outside GOPATH) -import "github.com/go-git/go-git" // with go modules disabled -``` - - -Examples --------- - -> Please note that the `CheckIfError` and `Info` functions used in the examples are from the [examples package](https://github.com/go-git/go-git/blob/master/_examples/common.go#L19) just to be used in the examples. - - -### Basic example - -A basic example that mimics the standard `git clone` command - -```go -// Clone the given repository to the given directory -Info("git clone https://github.com/go-git/go-git") - -_, err := git.PlainClone("/tmp/foo", false, &git.CloneOptions{ - URL: "https://github.com/go-git/go-git", - Progress: os.Stdout, -}) - -CheckIfError(err) -``` - -Outputs: -``` -Counting objects: 4924, done. -Compressing objects: 100% (1333/1333), done. -Total 4924 (delta 530), reused 6 (delta 6), pack-reused 3533 -``` - -### In-memory example - -Cloning a repository into memory and printing the history of HEAD, just like `git log` does - - -```go -// Clones the given repository in memory, creating the remote, the local -// branches and fetching the objects, exactly as: -Info("git clone https://github.com/go-git/go-billy") - -r, err := git.Clone(memory.NewStorage(), nil, &git.CloneOptions{ - URL: "https://github.com/go-git/go-billy", -}) - -CheckIfError(err) - -// Gets the HEAD history from HEAD, just like this command: -Info("git log") - -// ... retrieves the branch pointed by HEAD -ref, err := r.Head() -CheckIfError(err) - - -// ... retrieves the commit history -cIter, err := r.Log(&git.LogOptions{From: ref.Hash()}) -CheckIfError(err) - -// ... just iterates over the commits, printing it -err = cIter.ForEach(func(c *object.Commit) error { - fmt.Println(c) - return nil -}) -CheckIfError(err) -``` - -Outputs: -``` -commit ded8054fd0c3994453e9c8aacaf48d118d42991e -Author: Santiago M. Mola -Date: Sat Nov 12 21:18:41 2016 +0100 - - index: ReadFrom/WriteTo returns IndexReadError/IndexWriteError. (#9) - -commit df707095626f384ce2dc1a83b30f9a21d69b9dfc -Author: Santiago M. Mola -Date: Fri Nov 11 13:23:22 2016 +0100 - - readwriter: fix bug when writing index. (#10) - - When using ReadWriter on an existing siva file, absolute offset for - index entries was not being calculated correctly. -... -``` - -You can find this [example](_examples/log/main.go) and many others in the [examples](_examples) folder. - -Contribute ----------- - -[Contributions](https://github.com/go-git/go-git/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) are more than welcome, if you are interested please take a look to -our [Contributing Guidelines](CONTRIBUTING.md). - -License -------- -Apache License Version 2.0, see [LICENSE](LICENSE) diff --git a/vendor/github.com/go-git/go-git/v5/SECURITY.md b/vendor/github.com/go-git/go-git/v5/SECURITY.md deleted file mode 100644 index 0d2f8d038f..0000000000 --- a/vendor/github.com/go-git/go-git/v5/SECURITY.md +++ /dev/null @@ -1,38 +0,0 @@ -# go-git Security Policy - -The purpose of this security policy is to outline `go-git`'s process -for reporting, handling and disclosing security sensitive information. - -## Supported Versions - -The project follows a version support policy where only the latest minor -release is actively supported. Therefore, only issues that impact the latest -minor release will be fixed. Users are encouraged to upgrade to the latest -minor/patch release to benefit from the most up-to-date features, bug fixes, -and security enhancements.​ - -The supported versions policy applies to both the `go-git` library and its -associated repositories within the `go-git` org. - -## Reporting Security Issues - -Please report any security vulnerabilities or potential weaknesses in `go-git` -privately via go-git-security@googlegroups.com. Do not publicly disclose the -details of the vulnerability until a fix has been implemented and released. - -During the process the project maintainers will investigate the report, so please -provide detailed information, including steps to reproduce, affected versions, and any mitigations if known. - -The project maintainers will acknowledge the receipt of the report and work with -the reporter to validate and address the issue. - -Please note that `go-git` does not have any bounty programs, and therefore do -not provide financial compensation for disclosures. - -## Security Disclosure Process - -The project maintainers will make every effort to promptly address security issues. - -Once a security vulnerability is fixed, a security advisory will be published to notify users and provide appropriate mitigation measures. - -All `go-git` advisories can be found at https://github.com/go-git/go-git/security/advisories. diff --git a/vendor/github.com/go-git/go-git/v5/blame.go b/vendor/github.com/go-git/go-git/v5/blame.go deleted file mode 100644 index 2a877dcdf9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/blame.go +++ /dev/null @@ -1,590 +0,0 @@ -package git - -import ( - "bytes" - "container/heap" - "errors" - "fmt" - "io" - "strconv" - "time" - "unicode/utf8" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/utils/diff" - "github.com/sergi/go-diff/diffmatchpatch" -) - -// BlameResult represents the result of a Blame operation. -type BlameResult struct { - // Path is the path of the File that we're blaming. - Path string - // Rev (Revision) is the hash of the specified Commit used to generate this result. - Rev plumbing.Hash - // Lines contains every line with its authorship. - Lines []*Line -} - -// Blame returns a BlameResult with the information about the last author of -// each line from file `path` at commit `c`. -func Blame(c *object.Commit, path string) (*BlameResult, error) { - // The file to blame is identified by the input arguments: - // commit and path. commit is a Commit object obtained from a Repository. Path - // represents a path to a specific file contained in the repository. - // - // Blaming a file is done by walking the tree in reverse order trying to find where each line was last modified. - // - // When a diff is found it cannot immediately assume it came from that commit, as it may have come from 1 of its - // parents, so it will first try to resolve those diffs from its parents, if it couldn't find the change in its - // parents then it will assign the change to itself. - // - // When encountering 2 parents that have made the same change to a file it will choose the parent that was merged - // into the current branch first (this is determined by the order of the parents inside the commit). - // - // This currently works on a line by line basis, if performance becomes an issue it could be changed to work with - // hunks rather than lines. Then when encountering diff hunks it would need to split them where necessary. - - b := new(blame) - b.fRev = c - b.path = path - b.q = new(priorityQueue) - - file, err := b.fRev.File(path) - if err != nil { - return nil, err - } - finalLines, err := file.Lines() - if err != nil { - return nil, err - } - finalLength := len(finalLines) - - needsMap := make([]lineMap, finalLength) - for i := range needsMap { - needsMap[i] = lineMap{i, i, nil, -1} - } - contents, err := file.Contents() - if err != nil { - return nil, err - } - b.q.Push(&queueItem{ - nil, - nil, - c, - path, - contents, - needsMap, - 0, - false, - 0, - }) - items := make([]*queueItem, 0) - for { - items = items[:0] - for { - if b.q.Len() == 0 { - return nil, errors.New("invalid state: no items left on the blame queue") - } - item := b.q.Pop() - items = append(items, item) - next := b.q.Peek() - if next == nil || next.Hash != item.Commit.Hash { - break - } - } - finished, err := b.addBlames(items) - if err != nil { - return nil, err - } - if finished == true { - break - } - } - if err != nil { - return nil, err - } - - b.lineToCommit = make([]*object.Commit, finalLength) - for i := range needsMap { - b.lineToCommit[i] = needsMap[i].Commit - } - - lines, err := newLines(finalLines, b.lineToCommit) - if err != nil { - return nil, err - } - - return &BlameResult{ - Path: path, - Rev: c.Hash, - Lines: lines, - }, nil -} - -// Line values represent the contents and author of a line in BlamedResult values. -type Line struct { - // Author is the email address of the last author that modified the line. - Author string - // AuthorName is the name of the last author that modified the line. - AuthorName string - // Text is the original text of the line. - Text string - // Date is when the original text of the line was introduced - Date time.Time - // Hash is the commit hash that introduced the original line - Hash plumbing.Hash -} - -func newLine(author, authorName, text string, date time.Time, hash plumbing.Hash) *Line { - return &Line{ - Author: author, - AuthorName: authorName, - Text: text, - Hash: hash, - Date: date, - } -} - -func newLines(contents []string, commits []*object.Commit) ([]*Line, error) { - result := make([]*Line, 0, len(contents)) - for i := range contents { - result = append(result, newLine( - commits[i].Author.Email, commits[i].Author.Name, contents[i], - commits[i].Author.When, commits[i].Hash, - )) - } - - return result, nil -} - -// this struct is internally used by the blame function to hold its -// inputs, outputs and state. -type blame struct { - // the path of the file to blame - path string - // the commit of the final revision of the file to blame - fRev *object.Commit - // resolved lines - lineToCommit []*object.Commit - // queue of commits that need resolving - q *priorityQueue -} - -type lineMap struct { - Orig, Cur int - Commit *object.Commit - FromParentNo int -} - -func (b *blame) addBlames(curItems []*queueItem) (bool, error) { - curItem := curItems[0] - - // Simple optimisation to merge paths, there is potential to go a bit further here and check for any duplicates - // not only if they are all the same. - if len(curItems) == 1 { - curItems = nil - } else if curItem.IdenticalToChild { - allSame := true - lenCurItems := len(curItems) - lowestParentNo := curItem.ParentNo - for i := 1; i < lenCurItems; i++ { - if !curItems[i].IdenticalToChild || curItem.Child != curItems[i].Child { - allSame = false - break - } - lowestParentNo = min(lowestParentNo, curItems[i].ParentNo) - } - if allSame { - curItem.Child.numParentsNeedResolving = curItem.Child.numParentsNeedResolving - lenCurItems + 1 - curItems = nil // free the memory - curItem.ParentNo = lowestParentNo - - // Now check if we can remove the parent completely - for curItem.Child.IdenticalToChild && curItem.Child.MergedChildren == nil && curItem.Child.numParentsNeedResolving == 1 { - oldChild := curItem.Child - curItem.Child = oldChild.Child - curItem.ParentNo = oldChild.ParentNo - } - } - } - - // if we have more than 1 item for this commit, create a single needsMap - if len(curItems) > 1 { - curItem.MergedChildren = make([]childToNeedsMap, len(curItems)) - for i, c := range curItems { - curItem.MergedChildren[i] = childToNeedsMap{c.Child, c.NeedsMap, c.IdenticalToChild, c.ParentNo} - } - newNeedsMap := make([]lineMap, 0, len(curItem.NeedsMap)) - newNeedsMap = append(newNeedsMap, curItems[0].NeedsMap...) - - for i := 1; i < len(curItems); i++ { - cur := curItems[i].NeedsMap - n := 0 // position in newNeedsMap - c := 0 // position in current list - for c < len(cur) { - if n == len(newNeedsMap) { - newNeedsMap = append(newNeedsMap, cur[c:]...) - break - } else if newNeedsMap[n].Cur == cur[c].Cur { - n++ - c++ - } else if newNeedsMap[n].Cur < cur[c].Cur { - n++ - } else { - newNeedsMap = append(newNeedsMap, cur[c]) - newPos := len(newNeedsMap) - 1 - for newPos > n { - newNeedsMap[newPos-1], newNeedsMap[newPos] = newNeedsMap[newPos], newNeedsMap[newPos-1] - newPos-- - } - } - } - } - curItem.NeedsMap = newNeedsMap - curItem.IdenticalToChild = false - curItem.Child = nil - curItems = nil // free the memory - } - - parents, err := parentsContainingPath(curItem.path, curItem.Commit) - if err != nil { - return false, err - } - - anyPushed := false - for parnetNo, prev := range parents { - currentHash, err := blobHash(curItem.path, curItem.Commit) - if err != nil { - return false, err - } - prevHash, err := blobHash(prev.Path, prev.Commit) - if err != nil { - return false, err - } - if currentHash == prevHash { - if len(parents) == 1 && curItem.MergedChildren == nil && curItem.IdenticalToChild { - // commit that has 1 parent and 1 child and is the same as both, bypass it completely - b.q.Push(&queueItem{ - Child: curItem.Child, - Commit: prev.Commit, - path: prev.Path, - Contents: curItem.Contents, - NeedsMap: curItem.NeedsMap, // reuse the NeedsMap as we are throwing away this item - IdenticalToChild: true, - ParentNo: curItem.ParentNo, - }) - } else { - b.q.Push(&queueItem{ - Child: curItem, - Commit: prev.Commit, - path: prev.Path, - Contents: curItem.Contents, - NeedsMap: append([]lineMap(nil), curItem.NeedsMap...), // create new slice and copy - IdenticalToChild: true, - ParentNo: parnetNo, - }) - curItem.numParentsNeedResolving++ - } - anyPushed = true - continue - } - - // get the contents of the file - file, err := prev.Commit.File(prev.Path) - if err != nil { - return false, err - } - prevContents, err := file.Contents() - if err != nil { - return false, err - } - - hunks := diff.Do(prevContents, curItem.Contents) - prevl := -1 - curl := -1 - need := 0 - getFromParent := make([]lineMap, 0) - out: - for h := range hunks { - hLines := countLines(hunks[h].Text) - for hl := 0; hl < hLines; hl++ { - switch { - case hunks[h].Type == diffmatchpatch.DiffEqual: - prevl++ - curl++ - if curl == curItem.NeedsMap[need].Cur { - // add to needs - getFromParent = append(getFromParent, lineMap{curl, prevl, nil, -1}) - // move to next need - need++ - if need >= len(curItem.NeedsMap) { - break out - } - } - case hunks[h].Type == diffmatchpatch.DiffInsert: - curl++ - if curl == curItem.NeedsMap[need].Cur { - // the line we want is added, it may have been added here (or by another parent), skip it for now - need++ - if need >= len(curItem.NeedsMap) { - break out - } - } - case hunks[h].Type == diffmatchpatch.DiffDelete: - prevl += hLines - continue out - default: - return false, errors.New("invalid state: invalid hunk Type") - } - } - } - - if len(getFromParent) > 0 { - b.q.Push(&queueItem{ - curItem, - nil, - prev.Commit, - prev.Path, - prevContents, - getFromParent, - 0, - false, - parnetNo, - }) - curItem.numParentsNeedResolving++ - anyPushed = true - } - } - - curItem.Contents = "" // no longer need, free the memory - - if !anyPushed { - return finishNeeds(curItem) - } - - return false, nil -} - -func finishNeeds(curItem *queueItem) (bool, error) { - // any needs left in the needsMap must have come from this revision - for i := range curItem.NeedsMap { - if curItem.NeedsMap[i].Commit == nil { - curItem.NeedsMap[i].Commit = curItem.Commit - curItem.NeedsMap[i].FromParentNo = -1 - } - } - - if curItem.Child == nil && curItem.MergedChildren == nil { - return true, nil - } - - if curItem.MergedChildren == nil { - return applyNeeds(curItem.Child, curItem.NeedsMap, curItem.IdenticalToChild, curItem.ParentNo) - } - - for _, ctn := range curItem.MergedChildren { - m := 0 // position in merged needs map - p := 0 // position in parent needs map - for p < len(ctn.NeedsMap) { - if ctn.NeedsMap[p].Cur == curItem.NeedsMap[m].Cur { - ctn.NeedsMap[p].Commit = curItem.NeedsMap[m].Commit - m++ - p++ - } else if ctn.NeedsMap[p].Cur < curItem.NeedsMap[m].Cur { - p++ - } else { - m++ - } - } - finished, err := applyNeeds(ctn.Child, ctn.NeedsMap, ctn.IdenticalToChild, ctn.ParentNo) - if finished || err != nil { - return finished, err - } - } - - return false, nil -} - -func applyNeeds(child *queueItem, needsMap []lineMap, identicalToChild bool, parentNo int) (bool, error) { - if identicalToChild { - for i := range child.NeedsMap { - l := &child.NeedsMap[i] - if l.Cur != needsMap[i].Cur || l.Orig != needsMap[i].Orig { - return false, errors.New("needsMap isn't the same? Why not??") - } - if l.Commit == nil || parentNo < l.FromParentNo { - l.Commit = needsMap[i].Commit - l.FromParentNo = parentNo - } - } - } else { - i := 0 - out: - for j := range child.NeedsMap { - l := &child.NeedsMap[j] - for needsMap[i].Orig < l.Cur { - i++ - if i == len(needsMap) { - break out - } - } - if l.Cur == needsMap[i].Orig { - if l.Commit == nil || parentNo < l.FromParentNo { - l.Commit = needsMap[i].Commit - l.FromParentNo = parentNo - } - } - } - } - child.numParentsNeedResolving-- - if child.numParentsNeedResolving == 0 { - finished, err := finishNeeds(child) - if finished || err != nil { - return finished, err - } - } - - return false, nil -} - -// String prints the results of a Blame using git-blame's style. -func (b BlameResult) String() string { - var buf bytes.Buffer - - // max line number length - mlnl := len(strconv.Itoa(len(b.Lines))) - // max author length - mal := b.maxAuthorLength() - format := fmt.Sprintf("%%s (%%-%ds %%s %%%dd) %%s\n", mal, mlnl) - - for ln := range b.Lines { - _, _ = fmt.Fprintf(&buf, format, b.Lines[ln].Hash.String()[:8], - b.Lines[ln].AuthorName, b.Lines[ln].Date.Format("2006-01-02 15:04:05 -0700"), ln+1, b.Lines[ln].Text) - } - return buf.String() -} - -// utility function to calculate the number of runes needed -// to print the longest author name in the blame of a file. -func (b BlameResult) maxAuthorLength() int { - m := 0 - for ln := range b.Lines { - m = max(m, utf8.RuneCountInString(b.Lines[ln].AuthorName)) - } - return m -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -type childToNeedsMap struct { - Child *queueItem - NeedsMap []lineMap - IdenticalToChild bool - ParentNo int -} - -type queueItem struct { - Child *queueItem - MergedChildren []childToNeedsMap - Commit *object.Commit - path string - Contents string - NeedsMap []lineMap - numParentsNeedResolving int - IdenticalToChild bool - ParentNo int -} - -type priorityQueueImp []*queueItem - -func (pq *priorityQueueImp) Len() int { return len(*pq) } -func (pq *priorityQueueImp) Less(i, j int) bool { - return !(*pq)[i].Commit.Less((*pq)[j].Commit) -} -func (pq *priorityQueueImp) Swap(i, j int) { (*pq)[i], (*pq)[j] = (*pq)[j], (*pq)[i] } -func (pq *priorityQueueImp) Push(x any) { *pq = append(*pq, x.(*queueItem)) } -func (pq *priorityQueueImp) Pop() any { - n := len(*pq) - ret := (*pq)[n-1] - (*pq)[n-1] = nil // ovoid memory leak - *pq = (*pq)[0 : n-1] - - return ret -} -func (pq *priorityQueueImp) Peek() *object.Commit { - if len(*pq) == 0 { - return nil - } - return (*pq)[0].Commit -} - -type priorityQueue priorityQueueImp - -func (pq *priorityQueue) Init() { heap.Init((*priorityQueueImp)(pq)) } -func (pq *priorityQueue) Len() int { return (*priorityQueueImp)(pq).Len() } -func (pq *priorityQueue) Push(c *queueItem) { - heap.Push((*priorityQueueImp)(pq), c) -} -func (pq *priorityQueue) Pop() *queueItem { - return heap.Pop((*priorityQueueImp)(pq)).(*queueItem) -} -func (pq *priorityQueue) Peek() *object.Commit { return (*priorityQueueImp)(pq).Peek() } - -type parentCommit struct { - Commit *object.Commit - Path string -} - -func parentsContainingPath(path string, c *object.Commit) ([]parentCommit, error) { - // TODO: benchmark this method making git.object.Commit.parent public instead of using - // an iterator - var result []parentCommit - iter := c.Parents() - for { - parent, err := iter.Next() - if err == io.EOF { - return result, nil - } - if err != nil { - return nil, err - } - if _, err := parent.File(path); err == nil { - result = append(result, parentCommit{parent, path}) - } else { - // look for renames - patch, err := parent.Patch(c) - if err != nil { - return nil, err - } else if patch != nil { - for _, fp := range patch.FilePatches() { - from, to := fp.Files() - if from != nil && to != nil && to.Path() == path { - result = append(result, parentCommit{parent, from.Path()}) - break - } - } - } - } - } -} - -func blobHash(path string, commit *object.Commit) (plumbing.Hash, error) { - file, err := commit.File(path) - if err != nil { - return plumbing.ZeroHash, err - } - return file.Hash, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/common.go b/vendor/github.com/go-git/go-git/v5/common.go deleted file mode 100644 index 6174339a81..0000000000 --- a/vendor/github.com/go-git/go-git/v5/common.go +++ /dev/null @@ -1,20 +0,0 @@ -package git - -import "strings" - -// countLines returns the number of lines in a string à la git, this is -// The newline character is assumed to be '\n'. The empty string -// contains 0 lines. If the last line of the string doesn't end with a -// newline, it will still be considered a line. -func countLines(s string) int { - if s == "" { - return 0 - } - - nEOL := strings.Count(s, "\n") - if strings.HasSuffix(s, "\n") { - return nEOL - } - - return nEOL + 1 -} diff --git a/vendor/github.com/go-git/go-git/v5/config/branch.go b/vendor/github.com/go-git/go-git/v5/config/branch.go deleted file mode 100644 index db2cb499ac..0000000000 --- a/vendor/github.com/go-git/go-git/v5/config/branch.go +++ /dev/null @@ -1,123 +0,0 @@ -package config - -import ( - "errors" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - format "github.com/go-git/go-git/v5/plumbing/format/config" -) - -var ( - errBranchEmptyName = errors.New("branch config: empty name") - errBranchInvalidMerge = errors.New("branch config: invalid merge") - errBranchInvalidRebase = errors.New("branch config: rebase must be one of 'true' or 'interactive'") -) - -// Branch contains information on the -// local branches and which remote to track -type Branch struct { - // Name of branch - Name string - // Remote name of remote to track - Remote string - // Merge is the local refspec for the branch - Merge plumbing.ReferenceName - // Rebase instead of merge when pulling. Valid values are - // "true" and "interactive". "false" is undocumented and - // typically represented by the non-existence of this field - Rebase string - // Description explains what the branch is for. - // Multi-line explanations may be used. - // - // Original git command to edit: - // git branch --edit-description - Description string - - raw *format.Subsection -} - -// Validate validates fields of branch -func (b *Branch) Validate() error { - if b.Name == "" { - return errBranchEmptyName - } - - if b.Merge != "" && !b.Merge.IsBranch() { - return errBranchInvalidMerge - } - - if b.Rebase != "" && - b.Rebase != "true" && - b.Rebase != "interactive" && - b.Rebase != "false" { - return errBranchInvalidRebase - } - - return plumbing.NewBranchReferenceName(b.Name).Validate() -} - -func (b *Branch) marshal() *format.Subsection { - if b.raw == nil { - b.raw = &format.Subsection{} - } - - b.raw.Name = b.Name - - if b.Remote == "" { - b.raw.RemoveOption(remoteSection) - } else { - b.raw.SetOption(remoteSection, b.Remote) - } - - if b.Merge == "" { - b.raw.RemoveOption(mergeKey) - } else { - b.raw.SetOption(mergeKey, string(b.Merge)) - } - - if b.Rebase == "" { - b.raw.RemoveOption(rebaseKey) - } else { - b.raw.SetOption(rebaseKey, b.Rebase) - } - - if b.Description == "" { - b.raw.RemoveOption(descriptionKey) - } else { - desc := quoteDescription(b.Description) - b.raw.SetOption(descriptionKey, desc) - } - - return b.raw -} - -// hack to trigger conditional quoting in the -// plumbing/format/config/Encoder.encodeOptions -// -// Current Encoder implementation uses Go %q format if value contains a backslash character, -// which is not consistent with reference git implementation. -// git just replaces newline characters with \n, while Encoder prints them directly. -// Until value quoting fix, we should escape description value by replacing newline characters with \n. -func quoteDescription(desc string) string { - return strings.ReplaceAll(desc, "\n", `\n`) -} - -func (b *Branch) unmarshal(s *format.Subsection) error { - b.raw = s - - b.Name = b.raw.Name - b.Remote = b.raw.Options.Get(remoteSection) - b.Merge = plumbing.ReferenceName(b.raw.Options.Get(mergeKey)) - b.Rebase = b.raw.Options.Get(rebaseKey) - b.Description = unquoteDescription(b.raw.Options.Get(descriptionKey)) - - return b.Validate() -} - -// hack to enable conditional quoting in the -// plumbing/format/config/Encoder.encodeOptions -// goto quoteDescription for details. -func unquoteDescription(desc string) string { - return strings.ReplaceAll(desc, `\n`, "\n") -} diff --git a/vendor/github.com/go-git/go-git/v5/config/config.go b/vendor/github.com/go-git/go-git/v5/config/config.go deleted file mode 100644 index 6d41c15dcd..0000000000 --- a/vendor/github.com/go-git/go-git/v5/config/config.go +++ /dev/null @@ -1,696 +0,0 @@ -// Package config contains the abstraction of multiple config files -package config - -import ( - "bytes" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strconv" - - "github.com/go-git/go-billy/v5/osfs" - "github.com/go-git/go-git/v5/internal/url" - "github.com/go-git/go-git/v5/plumbing" - format "github.com/go-git/go-git/v5/plumbing/format/config" -) - -const ( - // DefaultFetchRefSpec is the default refspec used for fetch. - DefaultFetchRefSpec = "+refs/heads/*:refs/remotes/%s/*" - // DefaultPushRefSpec is the default refspec used for push. - DefaultPushRefSpec = "refs/heads/*:refs/heads/*" -) - -// ConfigStorer generic storage of Config object -type ConfigStorer interface { - Config() (*Config, error) - SetConfig(*Config) error -} - -var ( - ErrInvalid = errors.New("config invalid key in remote or branch") - ErrRemoteConfigNotFound = errors.New("remote config not found") - ErrRemoteConfigEmptyURL = errors.New("remote config: empty URL") - ErrRemoteConfigEmptyName = errors.New("remote config: empty name") -) - -// Scope defines the scope of a config file, such as local, global or system. -type Scope int - -// Available ConfigScope's -const ( - LocalScope Scope = iota - GlobalScope - SystemScope -) - -// Config contains the repository configuration -// https://www.kernel.org/pub/software/scm/git/docs/git-config.html#FILES -type Config struct { - Core struct { - // IsBare if true this repository is assumed to be bare and has no - // working directory associated with it. - IsBare bool - // Worktree is the path to the root of the working tree. - Worktree string - // CommentChar is the character indicating the start of a - // comment for commands like commit and tag - CommentChar string - // RepositoryFormatVersion identifies the repository format and layout version. - RepositoryFormatVersion format.RepositoryFormatVersion - } - - User struct { - // Name is the personal name of the author and the committer of a commit. - Name string - // Email is the email of the author and the committer of a commit. - Email string - } - - Author struct { - // Name is the personal name of the author of a commit. - Name string - // Email is the email of the author of a commit. - Email string - } - - Committer struct { - // Name is the personal name of the committer of a commit. - Name string - // Email is the email of the committer of a commit. - Email string - } - - Pack struct { - // Window controls the size of the sliding window for delta - // compression. The default is 10. A value of 0 turns off - // delta compression entirely. - Window uint - } - - Init struct { - // DefaultBranch Allows overriding the default branch name - // e.g. when initializing a new repository or when cloning - // an empty repository. - DefaultBranch string - } - - Extensions struct { - // ObjectFormat specifies the hash algorithm to use. The - // acceptable values are sha1 and sha256. If not specified, - // sha1 is assumed. It is an error to specify this key unless - // core.repositoryFormatVersion is 1. - // - // This setting must not be changed after repository initialization - // (e.g. clone or init). - ObjectFormat format.ObjectFormat - } - - // Remotes list of repository remotes, the key of the map is the name - // of the remote, should equal to RemoteConfig.Name. - Remotes map[string]*RemoteConfig - // Submodules list of repository submodules, the key of the map is the name - // of the submodule, should equal to Submodule.Name. - Submodules map[string]*Submodule - // Branches list of branches, the key is the branch name and should - // equal Branch.Name - Branches map[string]*Branch - // URLs list of url rewrite rules, if repo url starts with URL.InsteadOf value, it will be replaced with the - // key instead. - URLs map[string]*URL - // Raw contains the raw information of a config file. The main goal is - // preserve the parsed information from the original format, to avoid - // dropping unsupported fields. - Raw *format.Config -} - -// NewConfig returns a new empty Config. -func NewConfig() *Config { - config := &Config{ - Remotes: make(map[string]*RemoteConfig), - Submodules: make(map[string]*Submodule), - Branches: make(map[string]*Branch), - URLs: make(map[string]*URL), - Raw: format.New(), - } - - config.Pack.Window = DefaultPackWindow - - return config -} - -// ReadConfig reads a config file from a io.Reader. -func ReadConfig(r io.Reader) (*Config, error) { - b, err := io.ReadAll(r) - if err != nil { - return nil, err - } - - cfg := NewConfig() - if err = cfg.Unmarshal(b); err != nil { - return nil, err - } - - return cfg, nil -} - -// LoadConfig loads a config file from a given scope. The returned Config, -// contains exclusively information from the given scope. If it couldn't find a -// config file to the given scope, an empty one is returned. -func LoadConfig(scope Scope) (*Config, error) { - if scope == LocalScope { - return nil, fmt.Errorf("LocalScope should be read from the a ConfigStorer") - } - - files, err := Paths(scope) - if err != nil { - return nil, err - } - - for _, file := range files { - f, err := osfs.Default.Open(file) - if err != nil { - if os.IsNotExist(err) { - continue - } - - return nil, err - } - - defer f.Close() - return ReadConfig(f) - } - - return NewConfig(), nil -} - -// Paths returns the config file location for a given scope. -func Paths(scope Scope) ([]string, error) { - var files []string - switch scope { - case GlobalScope: - xdg := os.Getenv("XDG_CONFIG_HOME") - if xdg != "" { - files = append(files, filepath.Join(xdg, "git/config")) - } - - home, err := os.UserHomeDir() - if err != nil { - return nil, err - } - - files = append(files, - filepath.Join(home, ".gitconfig"), - filepath.Join(home, ".config/git/config"), - ) - case SystemScope: - files = append(files, "/etc/gitconfig") - } - - return files, nil -} - -// Validate validates the fields and sets the default values. -func (c *Config) Validate() error { - for name, r := range c.Remotes { - if r.Name != name { - return ErrInvalid - } - - if err := r.Validate(); err != nil { - return err - } - } - - for name, b := range c.Branches { - if b.Name != name { - return ErrInvalid - } - - if err := b.Validate(); err != nil { - return err - } - } - - return nil -} - -const ( - remoteSection = "remote" - submoduleSection = "submodule" - branchSection = "branch" - coreSection = "core" - packSection = "pack" - userSection = "user" - authorSection = "author" - committerSection = "committer" - initSection = "init" - urlSection = "url" - extensionsSection = "extensions" - fetchKey = "fetch" - urlKey = "url" - bareKey = "bare" - worktreeKey = "worktree" - commentCharKey = "commentChar" - windowKey = "window" - mergeKey = "merge" - rebaseKey = "rebase" - nameKey = "name" - emailKey = "email" - descriptionKey = "description" - defaultBranchKey = "defaultBranch" - repositoryFormatVersionKey = "repositoryformatversion" - objectFormat = "objectformat" - mirrorKey = "mirror" - - // DefaultPackWindow holds the number of previous objects used to - // generate deltas. The value 10 is the same used by git command. - DefaultPackWindow = uint(10) -) - -// Unmarshal parses a git-config file and stores it. -func (c *Config) Unmarshal(b []byte) error { - r := bytes.NewBuffer(b) - d := format.NewDecoder(r) - - c.Raw = format.New() - if err := d.Decode(c.Raw); err != nil { - return err - } - - c.unmarshalCore() - c.unmarshalUser() - c.unmarshalInit() - if err := c.unmarshalPack(); err != nil { - return err - } - unmarshalSubmodules(c.Raw, c.Submodules) - - if err := c.unmarshalBranches(); err != nil { - return err - } - - if err := c.unmarshalURLs(); err != nil { - return err - } - - return c.unmarshalRemotes() -} - -func (c *Config) unmarshalCore() { - s := c.Raw.Section(coreSection) - if s.Options.Get(bareKey) == "true" { - c.Core.IsBare = true - } - - c.Core.Worktree = s.Options.Get(worktreeKey) - c.Core.CommentChar = s.Options.Get(commentCharKey) -} - -func (c *Config) unmarshalUser() { - s := c.Raw.Section(userSection) - c.User.Name = s.Options.Get(nameKey) - c.User.Email = s.Options.Get(emailKey) - - s = c.Raw.Section(authorSection) - c.Author.Name = s.Options.Get(nameKey) - c.Author.Email = s.Options.Get(emailKey) - - s = c.Raw.Section(committerSection) - c.Committer.Name = s.Options.Get(nameKey) - c.Committer.Email = s.Options.Get(emailKey) -} - -func (c *Config) unmarshalPack() error { - s := c.Raw.Section(packSection) - window := s.Options.Get(windowKey) - if window == "" { - c.Pack.Window = DefaultPackWindow - } else { - winUint, err := strconv.ParseUint(window, 10, 32) - if err != nil { - return err - } - c.Pack.Window = uint(winUint) - } - return nil -} - -func (c *Config) unmarshalRemotes() error { - s := c.Raw.Section(remoteSection) - for _, sub := range s.Subsections { - r := &RemoteConfig{} - if err := r.unmarshal(sub); err != nil { - return err - } - - c.Remotes[r.Name] = r - } - - // Apply insteadOf url rules - for _, r := range c.Remotes { - r.applyURLRules(c.URLs) - } - - return nil -} - -func (c *Config) unmarshalURLs() error { - s := c.Raw.Section(urlSection) - for _, sub := range s.Subsections { - r := &URL{} - if err := r.unmarshal(sub); err != nil { - return err - } - - c.URLs[r.Name] = r - } - - return nil -} - -func unmarshalSubmodules(fc *format.Config, submodules map[string]*Submodule) { - s := fc.Section(submoduleSection) - for _, sub := range s.Subsections { - m := &Submodule{} - m.unmarshal(sub) - - if m.Validate() == ErrModuleBadPath { - continue - } - - submodules[m.Name] = m - } -} - -func (c *Config) unmarshalBranches() error { - bs := c.Raw.Section(branchSection) - for _, sub := range bs.Subsections { - b := &Branch{} - - if err := b.unmarshal(sub); err != nil { - return err - } - - c.Branches[b.Name] = b - } - return nil -} - -func (c *Config) unmarshalInit() { - s := c.Raw.Section(initSection) - c.Init.DefaultBranch = s.Options.Get(defaultBranchKey) -} - -// Marshal returns Config encoded as a git-config file. -func (c *Config) Marshal() ([]byte, error) { - c.marshalCore() - c.marshalExtensions() - c.marshalUser() - c.marshalPack() - c.marshalRemotes() - c.marshalSubmodules() - c.marshalBranches() - c.marshalURLs() - c.marshalInit() - - buf := bytes.NewBuffer(nil) - if err := format.NewEncoder(buf).Encode(c.Raw); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -func (c *Config) marshalCore() { - s := c.Raw.Section(coreSection) - s.SetOption(bareKey, fmt.Sprintf("%t", c.Core.IsBare)) - if string(c.Core.RepositoryFormatVersion) != "" { - s.SetOption(repositoryFormatVersionKey, string(c.Core.RepositoryFormatVersion)) - } - - if c.Core.Worktree != "" { - s.SetOption(worktreeKey, c.Core.Worktree) - } -} - -func (c *Config) marshalExtensions() { - // Extensions are only supported on Version 1, therefore - // ignore them otherwise. - if c.Core.RepositoryFormatVersion == format.Version_1 { - s := c.Raw.Section(extensionsSection) - s.SetOption(objectFormat, string(c.Extensions.ObjectFormat)) - } -} - -func (c *Config) marshalUser() { - s := c.Raw.Section(userSection) - if c.User.Name != "" { - s.SetOption(nameKey, c.User.Name) - } - - if c.User.Email != "" { - s.SetOption(emailKey, c.User.Email) - } - - s = c.Raw.Section(authorSection) - if c.Author.Name != "" { - s.SetOption(nameKey, c.Author.Name) - } - - if c.Author.Email != "" { - s.SetOption(emailKey, c.Author.Email) - } - - s = c.Raw.Section(committerSection) - if c.Committer.Name != "" { - s.SetOption(nameKey, c.Committer.Name) - } - - if c.Committer.Email != "" { - s.SetOption(emailKey, c.Committer.Email) - } -} - -func (c *Config) marshalPack() { - s := c.Raw.Section(packSection) - if c.Pack.Window != DefaultPackWindow { - s.SetOption(windowKey, fmt.Sprintf("%d", c.Pack.Window)) - } -} - -func (c *Config) marshalRemotes() { - s := c.Raw.Section(remoteSection) - newSubsections := make(format.Subsections, 0, len(c.Remotes)) - added := make(map[string]bool) - for _, subsection := range s.Subsections { - if remote, ok := c.Remotes[subsection.Name]; ok { - newSubsections = append(newSubsections, remote.marshal()) - added[subsection.Name] = true - } - } - - remoteNames := make([]string, 0, len(c.Remotes)) - for name := range c.Remotes { - remoteNames = append(remoteNames, name) - } - - sort.Strings(remoteNames) - - for _, name := range remoteNames { - if !added[name] { - newSubsections = append(newSubsections, c.Remotes[name].marshal()) - } - } - - s.Subsections = newSubsections -} - -func (c *Config) marshalSubmodules() { - s := c.Raw.Section(submoduleSection) - s.Subsections = make(format.Subsections, len(c.Submodules)) - - var i int - for _, r := range c.Submodules { - section := r.marshal() - // the submodule section at config is a subset of the .gitmodule file - // we should remove the non-valid options for the config file. - section.RemoveOption(pathKey) - s.Subsections[i] = section - i++ - } -} - -func (c *Config) marshalBranches() { - s := c.Raw.Section(branchSection) - newSubsections := make(format.Subsections, 0, len(c.Branches)) - added := make(map[string]bool) - for _, subsection := range s.Subsections { - if branch, ok := c.Branches[subsection.Name]; ok { - newSubsections = append(newSubsections, branch.marshal()) - added[subsection.Name] = true - } - } - - branchNames := make([]string, 0, len(c.Branches)) - for name := range c.Branches { - branchNames = append(branchNames, name) - } - - sort.Strings(branchNames) - - for _, name := range branchNames { - if !added[name] { - newSubsections = append(newSubsections, c.Branches[name].marshal()) - } - } - - s.Subsections = newSubsections -} - -func (c *Config) marshalURLs() { - s := c.Raw.Section(urlSection) - s.Subsections = make(format.Subsections, len(c.URLs)) - - var i int - for _, r := range c.URLs { - section := r.marshal() - // the submodule section at config is a subset of the .gitmodule file - // we should remove the non-valid options for the config file. - s.Subsections[i] = section - i++ - } -} - -func (c *Config) marshalInit() { - s := c.Raw.Section(initSection) - if c.Init.DefaultBranch != "" { - s.SetOption(defaultBranchKey, c.Init.DefaultBranch) - } -} - -// RemoteConfig contains the configuration for a given remote repository. -type RemoteConfig struct { - // Name of the remote - Name string - // URLs the URLs of a remote repository. It must be non-empty. Fetch will - // always use the first URL, while push will use all of them. - URLs []string - // Mirror indicates that the repository is a mirror of remote. - Mirror bool - - // insteadOfRulesApplied have urls been modified - insteadOfRulesApplied bool - // originalURLs are the urls before applying insteadOf rules - originalURLs []string - - // Fetch the default set of "refspec" for fetch operation - Fetch []RefSpec - - // raw representation of the subsection, filled by marshal or unmarshal are - // called - raw *format.Subsection -} - -// Validate validates the fields and sets the default values. -func (c *RemoteConfig) Validate() error { - if c.Name == "" { - return ErrRemoteConfigEmptyName - } - - if len(c.URLs) == 0 { - return ErrRemoteConfigEmptyURL - } - - for _, r := range c.Fetch { - if err := r.Validate(); err != nil { - return err - } - } - - if len(c.Fetch) == 0 { - c.Fetch = []RefSpec{RefSpec(fmt.Sprintf(DefaultFetchRefSpec, c.Name))} - } - - return plumbing.NewRemoteHEADReferenceName(c.Name).Validate() -} - -func (c *RemoteConfig) unmarshal(s *format.Subsection) error { - c.raw = s - - fetch := []RefSpec{} - for _, f := range c.raw.Options.GetAll(fetchKey) { - rs := RefSpec(f) - if err := rs.Validate(); err != nil { - return err - } - - fetch = append(fetch, rs) - } - - c.Name = c.raw.Name - c.URLs = append([]string(nil), c.raw.Options.GetAll(urlKey)...) - c.Fetch = fetch - c.Mirror = c.raw.Options.Get(mirrorKey) == "true" - - return nil -} - -func (c *RemoteConfig) marshal() *format.Subsection { - if c.raw == nil { - c.raw = &format.Subsection{} - } - - c.raw.Name = c.Name - if len(c.URLs) == 0 { - c.raw.RemoveOption(urlKey) - } else { - urls := c.URLs - if c.insteadOfRulesApplied { - urls = c.originalURLs - } - - c.raw.SetOption(urlKey, urls...) - } - - if len(c.Fetch) == 0 { - c.raw.RemoveOption(fetchKey) - } else { - var values []string - for _, rs := range c.Fetch { - values = append(values, rs.String()) - } - - c.raw.SetOption(fetchKey, values...) - } - - if c.Mirror { - c.raw.SetOption(mirrorKey, strconv.FormatBool(c.Mirror)) - } - - return c.raw -} - -func (c *RemoteConfig) IsFirstURLLocal() bool { - return url.IsLocalEndpoint(c.URLs[0]) -} - -func (c *RemoteConfig) applyURLRules(urlRules map[string]*URL) { - // save original urls - originalURLs := make([]string, len(c.URLs)) - copy(originalURLs, c.URLs) - - for i, url := range c.URLs { - if matchingURLRule := findLongestInsteadOfMatch(url, urlRules); matchingURLRule != nil { - c.URLs[i] = matchingURLRule.ApplyInsteadOf(c.URLs[i]) - c.insteadOfRulesApplied = true - } - } - - if c.insteadOfRulesApplied { - c.originalURLs = originalURLs - } -} diff --git a/vendor/github.com/go-git/go-git/v5/config/modules.go b/vendor/github.com/go-git/go-git/v5/config/modules.go deleted file mode 100644 index 1c10aa354e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/config/modules.go +++ /dev/null @@ -1,139 +0,0 @@ -package config - -import ( - "bytes" - "errors" - "regexp" - - format "github.com/go-git/go-git/v5/plumbing/format/config" -) - -var ( - ErrModuleEmptyURL = errors.New("module config: empty URL") - ErrModuleEmptyPath = errors.New("module config: empty path") - ErrModuleBadPath = errors.New("submodule has an invalid path") -) - -var ( - // Matches module paths with dotdot ".." components. - dotdotPath = regexp.MustCompile(`(^|[/\\])\.\.([/\\]|$)`) -) - -// Modules defines the submodules properties, represents a .gitmodules file -// https://www.kernel.org/pub/software/scm/git/docs/gitmodules.html -type Modules struct { - // Submodules is a map of submodules being the key the name of the submodule. - Submodules map[string]*Submodule - - raw *format.Config -} - -// NewModules returns a new empty Modules -func NewModules() *Modules { - return &Modules{ - Submodules: make(map[string]*Submodule), - raw: format.New(), - } -} - -const ( - pathKey = "path" - branchKey = "branch" -) - -// Unmarshal parses a git-config file and stores it. -func (m *Modules) Unmarshal(b []byte) error { - r := bytes.NewBuffer(b) - d := format.NewDecoder(r) - - m.raw = format.New() - if err := d.Decode(m.raw); err != nil { - return err - } - - unmarshalSubmodules(m.raw, m.Submodules) - return nil -} - -// Marshal returns Modules encoded as a git-config file. -func (m *Modules) Marshal() ([]byte, error) { - s := m.raw.Section(submoduleSection) - s.Subsections = make(format.Subsections, len(m.Submodules)) - - var i int - for _, r := range m.Submodules { - s.Subsections[i] = r.marshal() - i++ - } - - buf := bytes.NewBuffer(nil) - if err := format.NewEncoder(buf).Encode(m.raw); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -// Submodule defines a submodule. -type Submodule struct { - // Name module name - Name string - // Path defines the path, relative to the top-level directory of the Git - // working tree. - Path string - // URL defines a URL from which the submodule repository can be cloned. - URL string - // Branch is a remote branch name for tracking updates in the upstream - // submodule. Optional value. - Branch string - - // raw representation of the subsection, filled by marshal or unmarshal are - // called. - raw *format.Subsection -} - -// Validate validates the fields and sets the default values. -func (m *Submodule) Validate() error { - if m.Path == "" { - return ErrModuleEmptyPath - } - - if m.URL == "" { - return ErrModuleEmptyURL - } - - if dotdotPath.MatchString(m.Path) { - return ErrModuleBadPath - } - - return nil -} - -func (m *Submodule) unmarshal(s *format.Subsection) { - m.raw = s - - m.Name = m.raw.Name - m.Path = m.raw.Option(pathKey) - m.URL = m.raw.Option(urlKey) - m.Branch = m.raw.Option(branchKey) -} - -func (m *Submodule) marshal() *format.Subsection { - if m.raw == nil { - m.raw = &format.Subsection{} - } - - m.raw.Name = m.Name - if m.raw.Name == "" { - m.raw.Name = m.Path - } - - m.raw.SetOption(pathKey, m.Path) - m.raw.SetOption(urlKey, m.URL) - - if m.Branch != "" { - m.raw.SetOption(branchKey, m.Branch) - } - - return m.raw -} diff --git a/vendor/github.com/go-git/go-git/v5/config/refspec.go b/vendor/github.com/go-git/go-git/v5/config/refspec.go deleted file mode 100644 index e2cf8c97b1..0000000000 --- a/vendor/github.com/go-git/go-git/v5/config/refspec.go +++ /dev/null @@ -1,155 +0,0 @@ -package config - -import ( - "errors" - "strings" - - "github.com/go-git/go-git/v5/plumbing" -) - -const ( - refSpecWildcard = "*" - refSpecForce = "+" - refSpecSeparator = ":" -) - -var ( - ErrRefSpecMalformedSeparator = errors.New("malformed refspec, separators are wrong") - ErrRefSpecMalformedWildcard = errors.New("malformed refspec, mismatched number of wildcards") -) - -// RefSpec is a mapping from local branches to remote references. -// The format of the refspec is an optional +, followed by :, where -// is the pattern for references on the remote side and is where -// those references will be written locally. The + tells Git to update the -// reference even if it isn’t a fast-forward. -// eg.: "+refs/heads/*:refs/remotes/origin/*" -// -// https://git-scm.com/book/en/v2/Git-Internals-The-Refspec -type RefSpec string - -// Validate validates the RefSpec -func (s RefSpec) Validate() error { - spec := string(s) - if strings.Count(spec, refSpecSeparator) != 1 { - return ErrRefSpecMalformedSeparator - } - - sep := strings.Index(spec, refSpecSeparator) - if sep == len(spec)-1 { - return ErrRefSpecMalformedSeparator - } - - ws := strings.Count(spec[0:sep], refSpecWildcard) - wd := strings.Count(spec[sep+1:], refSpecWildcard) - if ws == wd && ws < 2 && wd < 2 { - return nil - } - - return ErrRefSpecMalformedWildcard -} - -// IsForceUpdate returns if update is allowed in non fast-forward merges. -func (s RefSpec) IsForceUpdate() bool { - return s[0] == refSpecForce[0] -} - -// IsDelete returns true if the refspec indicates a delete (empty src). -func (s RefSpec) IsDelete() bool { - return s[0] == refSpecSeparator[0] -} - -// IsExactSHA1 returns true if the source is a SHA1 hash. -func (s RefSpec) IsExactSHA1() bool { - return plumbing.IsHash(s.Src()) -} - -// Src returns the src side. -func (s RefSpec) Src() string { - spec := string(s) - - var start int - if s.IsForceUpdate() { - start = 1 - } else { - start = 0 - } - - end := strings.Index(spec, refSpecSeparator) - return spec[start:end] -} - -// Match match the given plumbing.ReferenceName against the source. -func (s RefSpec) Match(n plumbing.ReferenceName) bool { - if !s.IsWildcard() { - return s.matchExact(n) - } - - return s.matchGlob(n) -} - -// IsWildcard returns true if the RefSpec contains a wildcard. -func (s RefSpec) IsWildcard() bool { - return strings.Contains(string(s), refSpecWildcard) -} - -func (s RefSpec) matchExact(n plumbing.ReferenceName) bool { - return s.Src() == n.String() -} - -func (s RefSpec) matchGlob(n plumbing.ReferenceName) bool { - src := s.Src() - name := n.String() - wildcard := strings.Index(src, refSpecWildcard) - - var prefix, suffix string - prefix = src[0:wildcard] - if len(src) > wildcard+1 { - suffix = src[wildcard+1:] - } - - return len(name) >= len(prefix)+len(suffix) && - strings.HasPrefix(name, prefix) && - strings.HasSuffix(name, suffix) -} - -// Dst returns the destination for the given remote reference. -func (s RefSpec) Dst(n plumbing.ReferenceName) plumbing.ReferenceName { - spec := string(s) - start := strings.Index(spec, refSpecSeparator) + 1 - dst := spec[start:] - src := s.Src() - - if !s.IsWildcard() { - return plumbing.ReferenceName(dst) - } - - name := n.String() - ws := strings.Index(src, refSpecWildcard) - wd := strings.Index(dst, refSpecWildcard) - match := name[ws : len(name)-(len(src)-(ws+1))] - - return plumbing.ReferenceName(dst[0:wd] + match + dst[wd+1:]) -} - -func (s RefSpec) Reverse() RefSpec { - spec := string(s) - separator := strings.Index(spec, refSpecSeparator) - - return RefSpec(spec[separator+1:] + refSpecSeparator + spec[:separator]) -} - -func (s RefSpec) String() string { - return string(s) -} - -// MatchAny returns true if any of the RefSpec match with the given ReferenceName. -func MatchAny(l []RefSpec, n plumbing.ReferenceName) bool { - for _, r := range l { - if r.Match(n) { - return true - } - } - - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/config/url.go b/vendor/github.com/go-git/go-git/v5/config/url.go deleted file mode 100644 index 114d6b2662..0000000000 --- a/vendor/github.com/go-git/go-git/v5/config/url.go +++ /dev/null @@ -1,81 +0,0 @@ -package config - -import ( - "errors" - "strings" - - format "github.com/go-git/go-git/v5/plumbing/format/config" -) - -var ( - errURLEmptyInsteadOf = errors.New("url config: empty insteadOf") -) - -// Url defines Url rewrite rules -type URL struct { - // Name new base url - Name string - // Any URL that starts with this value will be rewritten to start, instead, with . - // When more than one insteadOf strings match a given URL, the longest match is used. - InsteadOf string - - // raw representation of the subsection, filled by marshal or unmarshal are - // called. - raw *format.Subsection -} - -// Validate validates fields of branch -func (b *URL) Validate() error { - if b.InsteadOf == "" { - return errURLEmptyInsteadOf - } - - return nil -} - -const ( - insteadOfKey = "insteadOf" -) - -func (u *URL) unmarshal(s *format.Subsection) error { - u.raw = s - - u.Name = s.Name - u.InsteadOf = u.raw.Option(insteadOfKey) - return nil -} - -func (u *URL) marshal() *format.Subsection { - if u.raw == nil { - u.raw = &format.Subsection{} - } - - u.raw.Name = u.Name - u.raw.SetOption(insteadOfKey, u.InsteadOf) - - return u.raw -} - -func findLongestInsteadOfMatch(remoteURL string, urls map[string]*URL) *URL { - var longestMatch *URL - for _, u := range urls { - if !strings.HasPrefix(remoteURL, u.InsteadOf) { - continue - } - - // according to spec if there is more than one match, take the logest - if longestMatch == nil || len(longestMatch.InsteadOf) < len(u.InsteadOf) { - longestMatch = u - } - } - - return longestMatch -} - -func (u *URL) ApplyInsteadOf(url string) string { - if !strings.HasPrefix(url, u.InsteadOf) { - return url - } - - return u.Name + url[len(u.InsteadOf):] -} diff --git a/vendor/github.com/go-git/go-git/v5/doc.go b/vendor/github.com/go-git/go-git/v5/doc.go deleted file mode 100644 index 3d817fe9c8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/doc.go +++ /dev/null @@ -1,10 +0,0 @@ -// A highly extensible git implementation in pure Go. -// -// go-git aims to reach the completeness of libgit2 or jgit, nowadays covers the -// majority of the plumbing read operations and some of the main write -// operations, but lacks the main porcelain operations such as merges. -// -// It is highly extensible, we have been following the open/close principle in -// its design to facilitate extensions, mainly focusing the efforts on the -// persistence of the objects. -package git diff --git a/vendor/github.com/go-git/go-git/v5/internal/path_util/path_util.go b/vendor/github.com/go-git/go-git/v5/internal/path_util/path_util.go deleted file mode 100644 index 48e4a3d0ec..0000000000 --- a/vendor/github.com/go-git/go-git/v5/internal/path_util/path_util.go +++ /dev/null @@ -1,29 +0,0 @@ -package path_util - -import ( - "os" - "os/user" - "strings" -) - -func ReplaceTildeWithHome(path string) (string, error) { - if strings.HasPrefix(path, "~") { - firstSlash := strings.Index(path, "/") - if firstSlash == 1 { - home, err := os.UserHomeDir() - if err != nil { - return path, err - } - return strings.Replace(path, "~", home, 1), nil - } else if firstSlash > 1 { - username := path[1:firstSlash] - userAccount, err := user.Lookup(username) - if err != nil { - return path, err - } - return strings.Replace(path, path[:firstSlash], userAccount.HomeDir, 1), nil - } - } - - return path, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/internal/revision/parser.go b/vendor/github.com/go-git/go-git/v5/internal/revision/parser.go deleted file mode 100644 index 8a2a7190e5..0000000000 --- a/vendor/github.com/go-git/go-git/v5/internal/revision/parser.go +++ /dev/null @@ -1,626 +0,0 @@ -// Package revision extracts git revision from string -// More information about revision : https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html -package revision - -import ( - "bytes" - "fmt" - "io" - "regexp" - "strconv" - "time" -) - -// ErrInvalidRevision is emitted if string doesn't match valid revision -type ErrInvalidRevision struct { - s string -} - -func (e *ErrInvalidRevision) Error() string { - return "Revision invalid : " + e.s -} - -// Revisioner represents a revision component. -// A revision is made of multiple revision components -// obtained after parsing a revision string, -// for instance revision "master~" will be converted in -// two revision components Ref and TildePath -type Revisioner interface { -} - -// Ref represents a reference name : HEAD, master, -type Ref string - -// TildePath represents ~, ~{n} -type TildePath struct { - Depth int -} - -// CaretPath represents ^, ^{n} -type CaretPath struct { - Depth int -} - -// CaretReg represents ^{/foo bar} -type CaretReg struct { - Regexp *regexp.Regexp - Negate bool -} - -// CaretType represents ^{commit} -type CaretType struct { - ObjectType string -} - -// AtReflog represents @{n} -type AtReflog struct { - Depth int -} - -// AtCheckout represents @{-n} -type AtCheckout struct { - Depth int -} - -// AtUpstream represents @{upstream}, @{u} -type AtUpstream struct { - BranchName string -} - -// AtPush represents @{push} -type AtPush struct { - BranchName string -} - -// AtDate represents @{"2006-01-02T15:04:05Z"} -type AtDate struct { - Date time.Time -} - -// ColonReg represents :/foo bar -type ColonReg struct { - Regexp *regexp.Regexp - Negate bool -} - -// ColonPath represents :./ : -type ColonPath struct { - Path string -} - -// ColonStagePath represents ::/ -type ColonStagePath struct { - Path string - Stage int -} - -// Parser represents a parser -// use to tokenize and transform to revisioner chunks -// a given string -type Parser struct { - s *scanner - currentParsedChar struct { - tok token - lit string - } - unreadLastChar bool -} - -// NewParserFromString returns a new instance of parser from a string. -func NewParserFromString(s string) *Parser { - return NewParser(bytes.NewBufferString(s)) -} - -// NewParser returns a new instance of parser. -func NewParser(r io.Reader) *Parser { - return &Parser{s: newScanner(r)} -} - -// scan returns the next token from the underlying scanner -// or the last scanned token if an unscan was requested -func (p *Parser) scan() (token, string, error) { - if p.unreadLastChar { - p.unreadLastChar = false - return p.currentParsedChar.tok, p.currentParsedChar.lit, nil - } - - tok, lit, err := p.s.scan() - - p.currentParsedChar.tok, p.currentParsedChar.lit = tok, lit - - return tok, lit, err -} - -// unscan pushes the previously read token back onto the buffer. -func (p *Parser) unscan() { p.unreadLastChar = true } - -// Parse explode a revision string into revisioner chunks -func (p *Parser) Parse() ([]Revisioner, error) { - var rev Revisioner - var revs []Revisioner - var tok token - var err error - - for { - tok, _, err = p.scan() - - if err != nil { - return nil, err - } - - switch tok { - case at: - rev, err = p.parseAt() - case tilde: - rev, err = p.parseTilde() - case caret: - rev, err = p.parseCaret() - case colon: - rev, err = p.parseColon() - case eof: - err = p.validateFullRevision(&revs) - - if err != nil { - return []Revisioner{}, err - } - - return revs, nil - default: - p.unscan() - rev, err = p.parseRef() - } - - if err != nil { - return []Revisioner{}, err - } - - revs = append(revs, rev) - } -} - -// validateFullRevision ensures all revisioner chunks make a valid revision -func (p *Parser) validateFullRevision(chunks *[]Revisioner) error { - var hasReference bool - - for i, chunk := range *chunks { - switch chunk.(type) { - case Ref: - if i == 0 { - hasReference = true - } else { - return &ErrInvalidRevision{`reference must be defined once at the beginning`} - } - case AtDate: - if len(*chunks) == 1 || hasReference && len(*chunks) == 2 { - return nil - } - - return &ErrInvalidRevision{`"@" statement is not valid, could be : @{}, @{}`} - case AtReflog: - if len(*chunks) == 1 || hasReference && len(*chunks) == 2 { - return nil - } - - return &ErrInvalidRevision{`"@" statement is not valid, could be : @{}, @{}`} - case AtCheckout: - if len(*chunks) == 1 { - return nil - } - - return &ErrInvalidRevision{`"@" statement is not valid, could be : @{-}`} - case AtUpstream: - if len(*chunks) == 1 || hasReference && len(*chunks) == 2 { - return nil - } - - return &ErrInvalidRevision{`"@" statement is not valid, could be : @{upstream}, @{upstream}, @{u}, @{u}`} - case AtPush: - if len(*chunks) == 1 || hasReference && len(*chunks) == 2 { - return nil - } - - return &ErrInvalidRevision{`"@" statement is not valid, could be : @{push}, @{push}`} - case TildePath, CaretPath, CaretReg: - if !hasReference { - return &ErrInvalidRevision{`"~" or "^" statement must have a reference defined at the beginning`} - } - case ColonReg: - if len(*chunks) == 1 { - return nil - } - - return &ErrInvalidRevision{`":" statement is not valid, could be : :/`} - case ColonPath: - if i == len(*chunks)-1 && hasReference || len(*chunks) == 1 { - return nil - } - - return &ErrInvalidRevision{`":" statement is not valid, could be : :`} - case ColonStagePath: - if len(*chunks) == 1 { - return nil - } - - return &ErrInvalidRevision{`":" statement is not valid, could be : ::`} - } - } - - return nil -} - -// parseAt extract @ statements -func (p *Parser) parseAt() (Revisioner, error) { - var tok, nextTok token - var lit, nextLit string - var err error - - tok, _, err = p.scan() - - if err != nil { - return nil, err - } - - if tok != obrace { - p.unscan() - - return Ref("HEAD"), nil - } - - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - nextTok, nextLit, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == word && (lit == "u" || lit == "upstream") && nextTok == cbrace: - return AtUpstream{}, nil - case tok == word && lit == "push" && nextTok == cbrace: - return AtPush{}, nil - case tok == number && nextTok == cbrace: - n, _ := strconv.Atoi(lit) - - return AtReflog{n}, nil - case tok == minus && nextTok == number: - n, _ := strconv.Atoi(nextLit) - - t, _, err := p.scan() - - if err != nil { - return nil, err - } - - if t != cbrace { - return nil, &ErrInvalidRevision{s: `missing "}" in @{-n} structure`} - } - - return AtCheckout{n}, nil - default: - p.unscan() - - date := lit - - for { - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == cbrace: - t, err := time.Parse("2006-01-02T15:04:05Z", date) - - if err != nil { - return nil, &ErrInvalidRevision{fmt.Sprintf(`wrong date "%s" must fit ISO-8601 format : 2006-01-02T15:04:05Z`, date)} - } - - return AtDate{t}, nil - case tok == eof: - return nil, &ErrInvalidRevision{s: `missing "}" in @{} structure`} - default: - date += lit - } - } - } -} - -// parseTilde extract ~ statements -func (p *Parser) parseTilde() (Revisioner, error) { - var tok token - var lit string - var err error - - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == number: - n, _ := strconv.Atoi(lit) - - return TildePath{n}, nil - default: - p.unscan() - return TildePath{1}, nil - } -} - -// parseCaret extract ^ statements -func (p *Parser) parseCaret() (Revisioner, error) { - var tok token - var lit string - var err error - - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == obrace: - r, err := p.parseCaretBraces() - - if err != nil { - return nil, err - } - - return r, nil - case tok == number: - n, _ := strconv.Atoi(lit) - - if n > 2 { - return nil, &ErrInvalidRevision{fmt.Sprintf(`"%s" found must be 0, 1 or 2 after "^"`, lit)} - } - - return CaretPath{n}, nil - default: - p.unscan() - return CaretPath{1}, nil - } -} - -// parseCaretBraces extract ^{} statements -func (p *Parser) parseCaretBraces() (Revisioner, error) { - var tok, nextTok token - var lit, _ string - start := true - var re string - var negate bool - var err error - - for { - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - nextTok, _, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == word && nextTok == cbrace && (lit == "commit" || lit == "tree" || lit == "blob" || lit == "tag" || lit == "object"): - return CaretType{lit}, nil - case re == "" && tok == cbrace: - return CaretType{"tag"}, nil - case re == "" && tok == emark && nextTok == emark: - re += lit - case re == "" && tok == emark && nextTok == minus: - negate = true - case re == "" && tok == emark: - return nil, &ErrInvalidRevision{s: `revision suffix brace component sequences starting with "/!" others than those defined are reserved`} - case re == "" && tok == slash: - p.unscan() - case tok != slash && start: - return nil, &ErrInvalidRevision{fmt.Sprintf(`"%s" is not a valid revision suffix brace component`, lit)} - case tok == eof: - return nil, &ErrInvalidRevision{s: `missing "}" in ^{} structure`} - case tok != cbrace: - p.unscan() - re += lit - case tok == cbrace: - p.unscan() - - reg, err := regexp.Compile(re) - - if err != nil { - return CaretReg{}, &ErrInvalidRevision{fmt.Sprintf(`revision suffix brace component, %s`, err.Error())} - } - - return CaretReg{reg, negate}, nil - } - - start = false - } -} - -// parseColon extract : statements -func (p *Parser) parseColon() (Revisioner, error) { - var tok token - var err error - - tok, _, err = p.scan() - - if err != nil { - return nil, err - } - - switch tok { - case slash: - return p.parseColonSlash() - default: - p.unscan() - return p.parseColonDefault() - } -} - -// parseColonSlash extract :/ statements -func (p *Parser) parseColonSlash() (Revisioner, error) { - var tok, nextTok token - var lit string - var re string - var negate bool - var err error - - for { - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - nextTok, _, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == emark && nextTok == emark: - re += lit - case re == "" && tok == emark && nextTok == minus: - negate = true - case re == "" && tok == emark: - return nil, &ErrInvalidRevision{s: `revision suffix brace component sequences starting with "/!" others than those defined are reserved`} - case tok == eof: - p.unscan() - reg, err := regexp.Compile(re) - - if err != nil { - return ColonReg{}, &ErrInvalidRevision{fmt.Sprintf(`revision suffix brace component, %s`, err.Error())} - } - - return ColonReg{reg, negate}, nil - default: - p.unscan() - re += lit - } - } -} - -// parseColonDefault extract : statements -func (p *Parser) parseColonDefault() (Revisioner, error) { - var tok token - var lit string - var path string - var stage int - var err error - var n = -1 - - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - nextTok, _, err := p.scan() - - if err != nil { - return nil, err - } - - if tok == number && nextTok == colon { - n, _ = strconv.Atoi(lit) - } - - switch n { - case 0, 1, 2, 3: - stage = n - default: - path += lit - p.unscan() - } - - for { - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - switch { - case tok == eof && n == -1: - return ColonPath{path}, nil - case tok == eof: - return ColonStagePath{path, stage}, nil - default: - path += lit - } - } -} - -// parseRef extract reference name -func (p *Parser) parseRef() (Revisioner, error) { - var tok, prevTok token - var lit, buf string - var endOfRef bool - var err error - - for { - tok, lit, err = p.scan() - - if err != nil { - return nil, err - } - - switch tok { - case eof, at, colon, tilde, caret: - endOfRef = true - } - - err := p.checkRefFormat(tok, lit, prevTok, buf, endOfRef) - - if err != nil { - return "", err - } - - if endOfRef { - p.unscan() - return Ref(buf), nil - } - - buf += lit - prevTok = tok - } -} - -// checkRefFormat ensure reference name follow rules defined here : -// https://git-scm.com/docs/git-check-ref-format -func (p *Parser) checkRefFormat(token token, literal string, previousToken token, buffer string, endOfRef bool) error { - switch token { - case aslash, space, control, qmark, asterisk, obracket: - return &ErrInvalidRevision{fmt.Sprintf(`must not contains "%s"`, literal)} - } - - switch { - case (token == dot || token == slash) && buffer == "": - return &ErrInvalidRevision{fmt.Sprintf(`must not start with "%s"`, literal)} - case previousToken == slash && endOfRef: - return &ErrInvalidRevision{`must not end with "/"`} - case previousToken == dot && endOfRef: - return &ErrInvalidRevision{`must not end with "."`} - case token == dot && previousToken == slash: - return &ErrInvalidRevision{`must not contains "/."`} - case previousToken == dot && token == dot: - return &ErrInvalidRevision{`must not contains ".."`} - case previousToken == slash && token == slash: - return &ErrInvalidRevision{`must not contains consecutively "/"`} - case (token == slash || endOfRef) && len(buffer) > 4 && buffer[len(buffer)-5:] == ".lock": - return &ErrInvalidRevision{"cannot end with .lock"} - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/internal/revision/scanner.go b/vendor/github.com/go-git/go-git/v5/internal/revision/scanner.go deleted file mode 100644 index c46c21b795..0000000000 --- a/vendor/github.com/go-git/go-git/v5/internal/revision/scanner.go +++ /dev/null @@ -1,117 +0,0 @@ -package revision - -import ( - "bufio" - "io" - "unicode" -) - -// runeCategoryValidator takes a rune as input and -// validates it belongs to a rune category -type runeCategoryValidator func(r rune) bool - -// tokenizeExpression aggregates a series of runes matching check predicate into a single -// string and provides given tokenType as token type -func tokenizeExpression(ch rune, tokenType token, check runeCategoryValidator, r *bufio.Reader) (token, string, error) { - var data []rune - data = append(data, ch) - - for { - c, _, err := r.ReadRune() - - if c == zeroRune { - break - } - - if err != nil { - return tokenError, "", err - } - - if check(c) { - data = append(data, c) - } else { - err := r.UnreadRune() - - if err != nil { - return tokenError, "", err - } - - return tokenType, string(data), nil - } - } - - return tokenType, string(data), nil -} - -var zeroRune = rune(0) - -// scanner represents a lexical scanner. -type scanner struct { - r *bufio.Reader -} - -// newScanner returns a new instance of scanner. -func newScanner(r io.Reader) *scanner { - return &scanner{r: bufio.NewReader(r)} -} - -// Scan extracts tokens and their strings counterpart -// from the reader -func (s *scanner) scan() (token, string, error) { - ch, _, err := s.r.ReadRune() - - if err != nil && err != io.EOF { - return tokenError, "", err - } - - switch ch { - case zeroRune: - return eof, "", nil - case ':': - return colon, string(ch), nil - case '~': - return tilde, string(ch), nil - case '^': - return caret, string(ch), nil - case '.': - return dot, string(ch), nil - case '/': - return slash, string(ch), nil - case '{': - return obrace, string(ch), nil - case '}': - return cbrace, string(ch), nil - case '-': - return minus, string(ch), nil - case '@': - return at, string(ch), nil - case '\\': - return aslash, string(ch), nil - case '?': - return qmark, string(ch), nil - case '*': - return asterisk, string(ch), nil - case '[': - return obracket, string(ch), nil - case '!': - return emark, string(ch), nil - } - - if unicode.IsSpace(ch) { - return space, string(ch), nil - } - - if unicode.IsControl(ch) { - return control, string(ch), nil - } - - if unicode.IsLetter(ch) { - return tokenizeExpression(ch, word, unicode.IsLetter, s.r) - } - - if unicode.IsNumber(ch) { - return tokenizeExpression(ch, number, unicode.IsNumber, s.r) - } - - return tokenError, string(ch), nil -} diff --git a/vendor/github.com/go-git/go-git/v5/internal/revision/token.go b/vendor/github.com/go-git/go-git/v5/internal/revision/token.go deleted file mode 100644 index abc4048869..0000000000 --- a/vendor/github.com/go-git/go-git/v5/internal/revision/token.go +++ /dev/null @@ -1,28 +0,0 @@ -package revision - -// token represents a entity extracted from string parsing -type token int - -const ( - eof token = iota - - aslash - asterisk - at - caret - cbrace - colon - control - dot - emark - minus - number - obrace - obracket - qmark - slash - space - tilde - tokenError - word -) diff --git a/vendor/github.com/go-git/go-git/v5/internal/url/url.go b/vendor/github.com/go-git/go-git/v5/internal/url/url.go deleted file mode 100644 index 2662448693..0000000000 --- a/vendor/github.com/go-git/go-git/v5/internal/url/url.go +++ /dev/null @@ -1,39 +0,0 @@ -package url - -import ( - "regexp" -) - -var ( - isSchemeRegExp = regexp.MustCompile(`^[^:]+://`) - - // Ref: https://github.com/git/git/blob/master/Documentation/urls.txt#L37 - scpLikeUrlRegExp = regexp.MustCompile(`^(?:(?P[^@]+)@)?(?P[^:\s]+):(?:(?P[0-9]{1,5}):)?(?P[^\\].*)$`) -) - -// MatchesScheme returns true if the given string matches a URL-like -// format scheme. -func MatchesScheme(url string) bool { - return isSchemeRegExp.MatchString(url) -} - -// MatchesScpLike returns true if the given string matches an SCP-like -// format scheme. -func MatchesScpLike(url string) bool { - return scpLikeUrlRegExp.MatchString(url) -} - -// FindScpLikeComponents returns the user, host, port and path of the -// given SCP-like URL. -func FindScpLikeComponents(url string) (user, host, port, path string) { - m := scpLikeUrlRegExp.FindStringSubmatch(url) - return m[1], m[2], m[3], m[4] -} - -// IsLocalEndpoint returns true if the given URL string specifies a -// local file endpoint. For example, on a Linux machine, -// `/home/user/src/go-git` would match as a local endpoint, but -// `https://github.com/src-d/go-git` would not. -func IsLocalEndpoint(url string) bool { - return !MatchesScheme(url) && !MatchesScpLike(url) -} diff --git a/vendor/github.com/go-git/go-git/v5/object_walker.go b/vendor/github.com/go-git/go-git/v5/object_walker.go deleted file mode 100644 index 3a537bd802..0000000000 --- a/vendor/github.com/go-git/go-git/v5/object_walker.go +++ /dev/null @@ -1,104 +0,0 @@ -package git - -import ( - "fmt" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/storage" -) - -type objectWalker struct { - Storer storage.Storer - // seen is the set of objects seen in the repo. - // seen map can become huge if walking over large - // repos. Thus using struct{} as the value type. - seen map[plumbing.Hash]struct{} -} - -func newObjectWalker(s storage.Storer) *objectWalker { - return &objectWalker{s, map[plumbing.Hash]struct{}{}} -} - -// walkAllRefs walks all (hash) references from the repo. -func (p *objectWalker) walkAllRefs() error { - // Walk over all the references in the repo. - it, err := p.Storer.IterReferences() - if err != nil { - return err - } - defer it.Close() - err = it.ForEach(func(ref *plumbing.Reference) error { - // Exit this iteration early for non-hash references. - if ref.Type() != plumbing.HashReference { - return nil - } - return p.walkObjectTree(ref.Hash()) - }) - return err -} - -func (p *objectWalker) isSeen(hash plumbing.Hash) bool { - _, seen := p.seen[hash] - return seen -} - -func (p *objectWalker) add(hash plumbing.Hash) { - p.seen[hash] = struct{}{} -} - -// walkObjectTree walks over all objects and remembers references -// to them in the objectWalker. This is used instead of the revlist -// walks because memory usage is tight with huge repos. -func (p *objectWalker) walkObjectTree(hash plumbing.Hash) error { - // Check if we have already seen, and mark this object - if p.isSeen(hash) { - return nil - } - p.add(hash) - // Fetch the object. - obj, err := object.GetObject(p.Storer, hash) - if err != nil { - return fmt.Errorf("getting object %s failed: %v", hash, err) - } - // Walk all children depending on object type. - switch obj := obj.(type) { - case *object.Commit: - err = p.walkObjectTree(obj.TreeHash) - if err != nil { - return err - } - for _, h := range obj.ParentHashes { - err = p.walkObjectTree(h) - if err != nil { - return err - } - } - case *object.Tree: - for i := range obj.Entries { - // Shortcut for blob objects: - // 'or' the lower bits of a mode and check that it - // it matches a filemode.Executable. The type information - // is in the higher bits, but this is the cleanest way - // to handle plain files with different modes. - // Other non-tree objects are somewhat rare, so they - // are not special-cased. - if obj.Entries[i].Mode|0755 == filemode.Executable { - p.add(obj.Entries[i].Hash) - continue - } - // Normal walk for sub-trees (and symlinks etc). - err = p.walkObjectTree(obj.Entries[i].Hash) - if err != nil { - return err - } - } - case *object.Tag: - return p.walkObjectTree(obj.Target) - default: - // Error out on unhandled object types. - return fmt.Errorf("unknown object %X %s %T", obj.ID(), obj.Type(), obj) - } - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/options.go b/vendor/github.com/go-git/go-git/v5/options.go deleted file mode 100644 index 8902b7e3e4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/options.go +++ /dev/null @@ -1,756 +0,0 @@ -package git - -import ( - "errors" - "fmt" - "regexp" - "strings" - "time" - - "github.com/ProtonMail/go-crypto/openpgp" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" - formatcfg "github.com/go-git/go-git/v5/plumbing/format/config" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" - "github.com/go-git/go-git/v5/plumbing/transport" -) - -// SubmoduleRescursivity defines how depth will affect any submodule recursive -// operation. -type SubmoduleRescursivity uint - -const ( - // DefaultRemoteName name of the default Remote, just like git command. - DefaultRemoteName = "origin" - - // NoRecurseSubmodules disables the recursion for a submodule operation. - NoRecurseSubmodules SubmoduleRescursivity = 0 - // DefaultSubmoduleRecursionDepth allow recursion in a submodule operation. - DefaultSubmoduleRecursionDepth SubmoduleRescursivity = 10 -) - -var ( - ErrMissingURL = errors.New("URL field is required") -) - -// CloneOptions describes how a clone should be performed. -type CloneOptions struct { - // The (possibly remote) repository URL to clone from. - URL string - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // Name of the remote to be added, by default `origin`. - RemoteName string - // Remote branch to clone. - ReferenceName plumbing.ReferenceName - // Fetch only ReferenceName if true. - SingleBranch bool - // Mirror clones the repository as a mirror. - // - // Compared to a bare clone, mirror not only maps local branches of the - // source to local branches of the target, it maps all refs (including - // remote-tracking branches, notes etc.) and sets up a refspec configuration - // such that all these refs are overwritten by a git remote update in the - // target repository. - Mirror bool - // No checkout of HEAD after clone if true. - NoCheckout bool - // Limit fetching to the specified number of commits. - Depth int - // RecurseSubmodules after the clone is created, initialize all submodules - // within, using their default settings. This option is ignored if the - // cloned repository does not have a worktree. - RecurseSubmodules SubmoduleRescursivity - // ShallowSubmodules limit cloning submodules to the 1 level of depth. - // It matches the git command --shallow-submodules. - ShallowSubmodules bool - // Progress is where the human readable information sent by the server is - // stored, if nil nothing is stored and the capability (if supported) - // no-progress, is sent to the server to avoid send this information. - Progress sideband.Progress - // Tags describe how the tags will be fetched from the remote repository, - // by default is AllTags. - Tags TagMode - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CABundle specify additional ca bundle with system cert pool - CABundle []byte - // ProxyOptions provides info required for connecting to a proxy. - ProxyOptions transport.ProxyOptions - // When the repository to clone is on the local machine, instead of - // using hard links, automatically setup .git/objects/info/alternates - // to share the objects with the source repository. - // The resulting repository starts out without any object of its own. - // NOTE: this is a possibly dangerous operation; do not use it unless - // you understand what it does. - // - // [Reference]: https://git-scm.com/docs/git-clone#Documentation/git-clone.txt---shared - Shared bool -} - -// Validate validates the fields and sets the default values. -func (o *CloneOptions) Validate() error { - if o.URL == "" { - return ErrMissingURL - } - - if o.RemoteName == "" { - o.RemoteName = DefaultRemoteName - } - - if o.ReferenceName == "" { - o.ReferenceName = plumbing.HEAD - } - - if o.Tags == InvalidTagMode { - o.Tags = AllTags - } - - return nil -} - -// PullOptions describes how a pull should be performed. -type PullOptions struct { - // Name of the remote to be pulled. If empty, uses the default. - RemoteName string - // RemoteURL overrides the remote repo address with a custom URL - RemoteURL string - // Remote branch to clone. If empty, uses HEAD. - ReferenceName plumbing.ReferenceName - // Fetch only ReferenceName if true. - SingleBranch bool - // Limit fetching to the specified number of commits. - Depth int - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // RecurseSubmodules controls if new commits of all populated submodules - // should be fetched too. - RecurseSubmodules SubmoduleRescursivity - // Progress is where the human readable information sent by the server is - // stored, if nil nothing is stored and the capability (if supported) - // no-progress, is sent to the server to avoid send this information. - Progress sideband.Progress - // Force allows the pull to update a local branch even when the remote - // branch does not descend from it. - Force bool - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CABundle specify additional ca bundle with system cert pool - CABundle []byte - // ProxyOptions provides info required for connecting to a proxy. - ProxyOptions transport.ProxyOptions -} - -// Validate validates the fields and sets the default values. -func (o *PullOptions) Validate() error { - if o.RemoteName == "" { - o.RemoteName = DefaultRemoteName - } - - if o.ReferenceName == "" { - o.ReferenceName = plumbing.HEAD - } - - return nil -} - -type TagMode int - -const ( - InvalidTagMode TagMode = iota - // TagFollowing any tag that points into the histories being fetched is also - // fetched. TagFollowing requires a server with `include-tag` capability - // in order to fetch the annotated tags objects. - TagFollowing - // AllTags fetch all tags from the remote (i.e., fetch remote tags - // refs/tags/* into local tags with the same name) - AllTags - //NoTags fetch no tags from the remote at all - NoTags -) - -// FetchOptions describes how a fetch should be performed -type FetchOptions struct { - // Name of the remote to fetch from. Defaults to origin. - RemoteName string - // RemoteURL overrides the remote repo address with a custom URL - RemoteURL string - RefSpecs []config.RefSpec - // Depth limit fetching to the specified number of commits from the tip of - // each remote branch history. - Depth int - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // Progress is where the human readable information sent by the server is - // stored, if nil nothing is stored and the capability (if supported) - // no-progress, is sent to the server to avoid send this information. - Progress sideband.Progress - // Tags describe how the tags will be fetched from the remote repository, - // by default is TagFollowing. - Tags TagMode - // Force allows the fetch to update a local branch even when the remote - // branch does not descend from it. - Force bool - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CABundle specify additional ca bundle with system cert pool - CABundle []byte - // ProxyOptions provides info required for connecting to a proxy. - ProxyOptions transport.ProxyOptions -} - -// Validate validates the fields and sets the default values. -func (o *FetchOptions) Validate() error { - if o.RemoteName == "" { - o.RemoteName = DefaultRemoteName - } - - if o.Tags == InvalidTagMode { - o.Tags = TagFollowing - } - - for _, r := range o.RefSpecs { - if err := r.Validate(); err != nil { - return err - } - } - - return nil -} - -// PushOptions describes how a push should be performed. -type PushOptions struct { - // RemoteName is the name of the remote to be pushed to. - RemoteName string - // RemoteURL overrides the remote repo address with a custom URL - RemoteURL string - // RefSpecs specify what destination ref to update with what source object. - // - // The format of a parameter is an optional plus +, followed by - // the source object , followed by a colon :, followed by the destination ref . - // The is often the name of the branch you would want to push, but it can be a SHA-1. - // The tells which ref on the remote side is updated with this push. - // - // A refspec with empty src can be used to delete a reference. - RefSpecs []config.RefSpec - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // Progress is where the human readable information sent by the server is - // stored, if nil nothing is stored. - Progress sideband.Progress - // Prune specify that remote refs that match given RefSpecs and that do - // not exist locally will be removed. - Prune bool - // Force allows the push to update a remote branch even when the local - // branch does not descend from it. - Force bool - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CABundle specify additional ca bundle with system cert pool - CABundle []byte - // RequireRemoteRefs only allows a remote ref to be updated if its current - // value is the one specified here. - RequireRemoteRefs []config.RefSpec - // FollowTags will send any annotated tags with a commit target reachable from - // the refs already being pushed - FollowTags bool - // ForceWithLease allows a force push as long as the remote ref adheres to a "lease" - ForceWithLease *ForceWithLease - // PushOptions sets options to be transferred to the server during push. - Options map[string]string - // Atomic sets option to be an atomic push - Atomic bool - // ProxyOptions provides info required for connecting to a proxy. - ProxyOptions transport.ProxyOptions -} - -// ForceWithLease sets fields on the lease -// If neither RefName nor Hash are set, ForceWithLease protects -// all refs in the refspec by ensuring the ref of the remote in the local repsitory -// matches the one in the ref advertisement. -type ForceWithLease struct { - // RefName, when set will protect the ref by ensuring it matches the - // hash in the ref advertisement. - RefName plumbing.ReferenceName - // Hash is the expected object id of RefName. The push will be rejected unless this - // matches the corresponding object id of RefName in the refs advertisement. - Hash plumbing.Hash -} - -// Validate validates the fields and sets the default values. -func (o *PushOptions) Validate() error { - if o.RemoteName == "" { - o.RemoteName = DefaultRemoteName - } - - if len(o.RefSpecs) == 0 { - o.RefSpecs = []config.RefSpec{ - config.RefSpec(config.DefaultPushRefSpec), - } - } - - for _, r := range o.RefSpecs { - if err := r.Validate(); err != nil { - return err - } - } - - return nil -} - -// SubmoduleUpdateOptions describes how a submodule update should be performed. -type SubmoduleUpdateOptions struct { - // Init, if true initializes the submodules recorded in the index. - Init bool - // NoFetch tell to the update command to not fetch new objects from the - // remote site. - NoFetch bool - // RecurseSubmodules the update is performed not only in the submodules of - // the current repository but also in any nested submodules inside those - // submodules (and so on). Until the SubmoduleRescursivity is reached. - RecurseSubmodules SubmoduleRescursivity - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // Depth limit fetching to the specified number of commits from the tip of - // each remote branch history. - Depth int -} - -var ( - ErrBranchHashExclusive = errors.New("Branch and Hash are mutually exclusive") - ErrCreateRequiresBranch = errors.New("Branch is mandatory when Create is used") -) - -// CheckoutOptions describes how a checkout operation should be performed. -type CheckoutOptions struct { - // Hash is the hash of the commit to be checked out. If used, HEAD will be - // in detached mode. If Create is not used, Branch and Hash are mutually - // exclusive. - Hash plumbing.Hash - // Branch to be checked out, if Branch and Hash are empty is set to `master`. - Branch plumbing.ReferenceName - // Create a new branch named Branch and start it at Hash. - Create bool - // Force, if true when switching branches, proceed even if the index or the - // working tree differs from HEAD. This is used to throw away local changes - Force bool - // Keep, if true when switching branches, local changes (the index or the - // working tree changes) will be kept so that they can be committed to the - // target branch. Force and Keep are mutually exclusive, should not be both - // set to true. - Keep bool - // SparseCheckoutDirectories - SparseCheckoutDirectories []string -} - -// Validate validates the fields and sets the default values. -func (o *CheckoutOptions) Validate() error { - if !o.Create && !o.Hash.IsZero() && o.Branch != "" { - return ErrBranchHashExclusive - } - - if o.Create && o.Branch == "" { - return ErrCreateRequiresBranch - } - - if o.Branch == "" { - o.Branch = plumbing.Master - } - - return nil -} - -// ResetMode defines the mode of a reset operation. -type ResetMode int8 - -const ( - // MixedReset resets the index but not the working tree (i.e., the changed - // files are preserved but not marked for commit) and reports what has not - // been updated. This is the default action. - MixedReset ResetMode = iota - // HardReset resets the index and working tree. Any changes to tracked files - // in the working tree are discarded. - HardReset - // MergeReset resets the index and updates the files in the working tree - // that are different between Commit and HEAD, but keeps those which are - // different between the index and working tree (i.e. which have changes - // which have not been added). - // - // If a file that is different between Commit and the index has unstaged - // changes, reset is aborted. - MergeReset - // SoftReset does not touch the index file or the working tree at all (but - // resets the head to , just like all modes do). This leaves all - // your changed files "Changes to be committed", as git status would put it. - SoftReset -) - -// ResetOptions describes how a reset operation should be performed. -type ResetOptions struct { - // Commit, if commit is present set the current branch head (HEAD) to it. - Commit plumbing.Hash - // Mode, form resets the current branch head to Commit and possibly updates - // the index (resetting it to the tree of Commit) and the working tree - // depending on Mode. If empty MixedReset is used. - Mode ResetMode -} - -// Validate validates the fields and sets the default values. -func (o *ResetOptions) Validate(r *Repository) error { - if o.Commit == plumbing.ZeroHash { - ref, err := r.Head() - if err != nil { - return err - } - - o.Commit = ref.Hash() - } - - return nil -} - -type LogOrder int8 - -const ( - LogOrderDefault LogOrder = iota - LogOrderDFS - LogOrderDFSPost - LogOrderBSF - LogOrderCommitterTime -) - -// LogOptions describes how a log action should be performed. -type LogOptions struct { - // When the From option is set the log will only contain commits - // reachable from it. If this option is not set, HEAD will be used as - // the default From. - From plumbing.Hash - - // The default traversal algorithm is Depth-first search - // set Order=LogOrderCommitterTime for ordering by committer time (more compatible with `git log`) - // set Order=LogOrderBSF for Breadth-first search - Order LogOrder - - // Show only those commits in which the specified file was inserted/updated. - // It is equivalent to running `git log -- `. - // this field is kept for compatibility, it can be replaced with PathFilter - FileName *string - - // Filter commits based on the path of files that are updated - // takes file path as argument and should return true if the file is desired - // It can be used to implement `git log -- ` - // either is a file path, or directory path, or a regexp of file/directory path - PathFilter func(string) bool - - // Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as . - // It is equivalent to running `git log --all`. - // If set on true, the From option will be ignored. - All bool - - // Show commits more recent than a specific date. - // It is equivalent to running `git log --since ` or `git log --after `. - Since *time.Time - - // Show commits older than a specific date. - // It is equivalent to running `git log --until ` or `git log --before `. - Until *time.Time -} - -var ( - ErrMissingAuthor = errors.New("author field is required") -) - -// AddOptions describes how an `add` operation should be performed -type AddOptions struct { - // All equivalent to `git add -A`, update the index not only where the - // working tree has a file matching `Path` but also where the index already - // has an entry. This adds, modifies, and removes index entries to match the - // working tree. If no `Path` nor `Glob` is given when `All` option is - // used, all files in the entire working tree are updated. - All bool - // Path is the exact filepath to the file or directory to be added. - Path string - // Glob adds all paths, matching pattern, to the index. If pattern matches a - // directory path, all directory contents are added to the index recursively. - Glob string -} - -// Validate validates the fields and sets the default values. -func (o *AddOptions) Validate(r *Repository) error { - if o.Path != "" && o.Glob != "" { - return fmt.Errorf("fields Path and Glob are mutual exclusive") - } - - return nil -} - -// CommitOptions describes how a commit operation should be performed. -type CommitOptions struct { - // All automatically stage files that have been modified and deleted, but - // new files you have not told Git about are not affected. - All bool - // AllowEmptyCommits enable empty commits to be created. An empty commit - // is when no changes to the tree were made, but a new commit message is - // provided. The default behavior is false, which results in ErrEmptyCommit. - AllowEmptyCommits bool - // Author is the author's signature of the commit. If Author is empty the - // Name and Email is read from the config, and time.Now it's used as When. - Author *object.Signature - // Committer is the committer's signature of the commit. If Committer is - // nil the Author signature is used. - Committer *object.Signature - // Parents are the parents commits for the new commit, by default when - // len(Parents) is zero, the hash of HEAD reference is used. - Parents []plumbing.Hash - // SignKey denotes a key to sign the commit with. A nil value here means the - // commit will not be signed. The private key must be present and already - // decrypted. - SignKey *openpgp.Entity - // Amend will create a new commit object and replace the commit that HEAD currently - // points to. Cannot be used with All nor Parents. - Amend bool -} - -// Validate validates the fields and sets the default values. -func (o *CommitOptions) Validate(r *Repository) error { - if o.All && o.Amend { - return errors.New("all and amend cannot be used together") - } - - if o.Amend && len(o.Parents) > 0 { - return errors.New("parents cannot be used with amend") - } - - if o.Author == nil { - if err := o.loadConfigAuthorAndCommitter(r); err != nil { - return err - } - } - - if o.Committer == nil { - o.Committer = o.Author - } - - if len(o.Parents) == 0 { - head, err := r.Head() - if err != nil && err != plumbing.ErrReferenceNotFound { - return err - } - - if head != nil { - o.Parents = []plumbing.Hash{head.Hash()} - } - } - - return nil -} - -func (o *CommitOptions) loadConfigAuthorAndCommitter(r *Repository) error { - cfg, err := r.ConfigScoped(config.SystemScope) - if err != nil { - return err - } - - if o.Author == nil && cfg.Author.Email != "" && cfg.Author.Name != "" { - o.Author = &object.Signature{ - Name: cfg.Author.Name, - Email: cfg.Author.Email, - When: time.Now(), - } - } - - if o.Committer == nil && cfg.Committer.Email != "" && cfg.Committer.Name != "" { - o.Committer = &object.Signature{ - Name: cfg.Committer.Name, - Email: cfg.Committer.Email, - When: time.Now(), - } - } - - if o.Author == nil && cfg.User.Email != "" && cfg.User.Name != "" { - o.Author = &object.Signature{ - Name: cfg.User.Name, - Email: cfg.User.Email, - When: time.Now(), - } - } - - if o.Author == nil { - return ErrMissingAuthor - } - - return nil -} - -var ( - ErrMissingName = errors.New("name field is required") - ErrMissingTagger = errors.New("tagger field is required") - ErrMissingMessage = errors.New("message field is required") -) - -// CreateTagOptions describes how a tag object should be created. -type CreateTagOptions struct { - // Tagger defines the signature of the tag creator. If Tagger is empty the - // Name and Email is read from the config, and time.Now it's used as When. - Tagger *object.Signature - // Message defines the annotation of the tag. It is canonicalized during - // validation into the format expected by git - no leading whitespace and - // ending in a newline. - Message string - // SignKey denotes a key to sign the tag with. A nil value here means the tag - // will not be signed. The private key must be present and already decrypted. - SignKey *openpgp.Entity -} - -// Validate validates the fields and sets the default values. -func (o *CreateTagOptions) Validate(r *Repository, hash plumbing.Hash) error { - if o.Tagger == nil { - if err := o.loadConfigTagger(r); err != nil { - return err - } - } - - if o.Message == "" { - return ErrMissingMessage - } - - // Canonicalize the message into the expected message format. - o.Message = strings.TrimSpace(o.Message) + "\n" - - return nil -} - -func (o *CreateTagOptions) loadConfigTagger(r *Repository) error { - cfg, err := r.ConfigScoped(config.SystemScope) - if err != nil { - return err - } - - if o.Tagger == nil && cfg.Author.Email != "" && cfg.Author.Name != "" { - o.Tagger = &object.Signature{ - Name: cfg.Author.Name, - Email: cfg.Author.Email, - When: time.Now(), - } - } - - if o.Tagger == nil && cfg.User.Email != "" && cfg.User.Name != "" { - o.Tagger = &object.Signature{ - Name: cfg.User.Name, - Email: cfg.User.Email, - When: time.Now(), - } - } - - if o.Tagger == nil { - return ErrMissingTagger - } - - return nil -} - -// ListOptions describes how a remote list should be performed. -type ListOptions struct { - // Auth credentials, if required, to use with the remote repository. - Auth transport.AuthMethod - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CABundle specify additional ca bundle with system cert pool - CABundle []byte - // PeelingOption defines how peeled objects are handled during a - // remote list. - PeelingOption PeelingOption - // ProxyOptions provides info required for connecting to a proxy. - ProxyOptions transport.ProxyOptions - // Timeout specifies the timeout in seconds for list operations - Timeout int -} - -// PeelingOption represents the different ways to handle peeled references. -// -// Peeled references represent the underlying object of an annotated -// (or signed) tag. Refer to upstream documentation for more info: -// https://github.com/git/git/blob/master/Documentation/technical/reftable.txt -type PeelingOption uint8 - -const ( - // IgnorePeeled ignores all peeled reference names. This is the default behavior. - IgnorePeeled PeelingOption = 0 - // OnlyPeeled returns only peeled reference names. - OnlyPeeled PeelingOption = 1 - // AppendPeeled appends peeled reference names to the reference list. - AppendPeeled PeelingOption = 2 -) - -// CleanOptions describes how a clean should be performed. -type CleanOptions struct { - Dir bool -} - -// GrepOptions describes how a grep should be performed. -type GrepOptions struct { - // Patterns are compiled Regexp objects to be matched. - Patterns []*regexp.Regexp - // InvertMatch selects non-matching lines. - InvertMatch bool - // CommitHash is the hash of the commit from which worktree should be derived. - CommitHash plumbing.Hash - // ReferenceName is the branch or tag name from which worktree should be derived. - ReferenceName plumbing.ReferenceName - // PathSpecs are compiled Regexp objects of pathspec to use in the matching. - PathSpecs []*regexp.Regexp -} - -var ( - ErrHashOrReference = errors.New("ambiguous options, only one of CommitHash or ReferenceName can be passed") -) - -// Validate validates the fields and sets the default values. -// -// TODO: deprecate in favor of Validate(r *Repository) in v6. -func (o *GrepOptions) Validate(w *Worktree) error { - return o.validate(w.r) -} - -func (o *GrepOptions) validate(r *Repository) error { - if !o.CommitHash.IsZero() && o.ReferenceName != "" { - return ErrHashOrReference - } - - // If none of CommitHash and ReferenceName are provided, set commit hash of - // the repository's head. - if o.CommitHash.IsZero() && o.ReferenceName == "" { - ref, err := r.Head() - if err != nil { - return err - } - o.CommitHash = ref.Hash() - } - - return nil -} - -// PlainOpenOptions describes how opening a plain repository should be -// performed. -type PlainOpenOptions struct { - // DetectDotGit defines whether parent directories should be - // walked until a .git directory or file is found. - DetectDotGit bool - // Enable .git/commondir support (see https://git-scm.com/docs/gitrepository-layout#Documentation/gitrepository-layout.txt). - // NOTE: This option will only work with the filesystem storage. - EnableDotGitCommonDir bool -} - -// Validate validates the fields and sets the default values. -func (o *PlainOpenOptions) Validate() error { return nil } - -type PlainInitOptions struct { - InitOptions - // Determines if the repository will have a worktree (non-bare) or not (bare). - Bare bool - ObjectFormat formatcfg.ObjectFormat -} - -// Validate validates the fields and sets the default values. -func (o *PlainInitOptions) Validate() error { return nil } diff --git a/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh b/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh deleted file mode 100644 index 885548f401..0000000000 --- a/vendor/github.com/go-git/go-git/v5/oss-fuzz.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -eu -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -################################################################################ - - -go mod download -go get github.com/AdamKorcz/go-118-fuzz-build/testing - -if [ "$SANITIZER" != "coverage" ]; then - sed -i '/func (s \*DecoderSuite) TestDecode(/,/^}/ s/^/\/\//' plumbing/format/config/decoder_test.go - sed -n '35,$p' plumbing/format/packfile/common_test.go >> plumbing/format/packfile/delta_test.go - sed -n '20,53p' plumbing/object/object_test.go >> plumbing/object/tree_test.go - sed -i 's|func Test|// func Test|' plumbing/transport/common_test.go -fi - -compile_native_go_fuzzer $(pwd)/internal/revision FuzzParser fuzz_parser -compile_native_go_fuzzer $(pwd)/plumbing/format/config FuzzDecoder fuzz_decoder_config -compile_native_go_fuzzer $(pwd)/plumbing/format/packfile FuzzPatchDelta fuzz_patch_delta -compile_native_go_fuzzer $(pwd)/plumbing/object FuzzParseSignedBytes fuzz_parse_signed_bytes -compile_native_go_fuzzer $(pwd)/plumbing/object FuzzDecode fuzz_decode -compile_native_go_fuzzer $(pwd)/plumbing/protocol/packp FuzzDecoder fuzz_decoder_packp -compile_native_go_fuzzer $(pwd)/plumbing/transport FuzzNewEndpoint fuzz_new_endpoint diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/cache/buffer_lru.go b/vendor/github.com/go-git/go-git/v5/plumbing/cache/buffer_lru.go deleted file mode 100644 index acaf195203..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/cache/buffer_lru.go +++ /dev/null @@ -1,98 +0,0 @@ -package cache - -import ( - "container/list" - "sync" -) - -// BufferLRU implements an object cache with an LRU eviction policy and a -// maximum size (measured in object size). -type BufferLRU struct { - MaxSize FileSize - - actualSize FileSize - ll *list.List - cache map[int64]*list.Element - mut sync.Mutex -} - -// NewBufferLRU creates a new BufferLRU with the given maximum size. The maximum -// size will never be exceeded. -func NewBufferLRU(maxSize FileSize) *BufferLRU { - return &BufferLRU{MaxSize: maxSize} -} - -// NewBufferLRUDefault creates a new BufferLRU with the default cache size. -func NewBufferLRUDefault() *BufferLRU { - return &BufferLRU{MaxSize: DefaultMaxSize} -} - -type buffer struct { - Key int64 - Slice []byte -} - -// Put puts a buffer into the cache. If the buffer is already in the cache, it -// will be marked as used. Otherwise, it will be inserted. A buffers might -// be evicted to make room for the new one. -func (c *BufferLRU) Put(key int64, slice []byte) { - c.mut.Lock() - defer c.mut.Unlock() - - if c.cache == nil { - c.actualSize = 0 - c.cache = make(map[int64]*list.Element, 1000) - c.ll = list.New() - } - - bufSize := FileSize(len(slice)) - if ee, ok := c.cache[key]; ok { - oldBuf := ee.Value.(buffer) - // in this case bufSize is a delta: new size - old size - bufSize -= FileSize(len(oldBuf.Slice)) - c.ll.MoveToFront(ee) - ee.Value = buffer{key, slice} - } else { - if bufSize > c.MaxSize { - return - } - ee := c.ll.PushFront(buffer{key, slice}) - c.cache[key] = ee - } - - c.actualSize += bufSize - for c.actualSize > c.MaxSize { - last := c.ll.Back() - lastObj := last.Value.(buffer) - lastSize := FileSize(len(lastObj.Slice)) - - c.ll.Remove(last) - delete(c.cache, lastObj.Key) - c.actualSize -= lastSize - } -} - -// Get returns a buffer by its key. It marks the buffer as used. If the buffer -// is not in the cache, (nil, false) will be returned. -func (c *BufferLRU) Get(key int64) ([]byte, bool) { - c.mut.Lock() - defer c.mut.Unlock() - - ee, ok := c.cache[key] - if !ok { - return nil, false - } - - c.ll.MoveToFront(ee) - return ee.Value.(buffer).Slice, true -} - -// Clear the content of this buffer cache. -func (c *BufferLRU) Clear() { - c.mut.Lock() - defer c.mut.Unlock() - - c.ll = nil - c.cache = nil - c.actualSize = 0 -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/cache/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/cache/common.go deleted file mode 100644 index 7b0d0c76bb..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/cache/common.go +++ /dev/null @@ -1,39 +0,0 @@ -package cache - -import "github.com/go-git/go-git/v5/plumbing" - -const ( - Byte FileSize = 1 << (iota * 10) - KiByte - MiByte - GiByte -) - -type FileSize int64 - -const DefaultMaxSize FileSize = 96 * MiByte - -// Object is an interface to a object cache. -type Object interface { - // Put puts the given object into the cache. Whether this object will - // actually be put into the cache or not is implementation specific. - Put(o plumbing.EncodedObject) - // Get gets an object from the cache given its hash. The second return value - // is true if the object was returned, and false otherwise. - Get(k plumbing.Hash) (plumbing.EncodedObject, bool) - // Clear clears every object from the cache. - Clear() -} - -// Buffer is an interface to a buffer cache. -type Buffer interface { - // Put puts a buffer into the cache. If the buffer is already in the cache, - // it will be marked as used. Otherwise, it will be inserted. Buffer might - // be evicted to make room for the new one. - Put(key int64, slice []byte) - // Get returns a buffer by its key. It marks the buffer as used. If the - // buffer is not in the cache, (nil, false) will be returned. - Get(key int64) ([]byte, bool) - // Clear clears every object from the cache. - Clear() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/cache/object_lru.go b/vendor/github.com/go-git/go-git/v5/plumbing/cache/object_lru.go deleted file mode 100644 index c50d0d1e6c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/cache/object_lru.go +++ /dev/null @@ -1,101 +0,0 @@ -package cache - -import ( - "container/list" - "sync" - - "github.com/go-git/go-git/v5/plumbing" -) - -// ObjectLRU implements an object cache with an LRU eviction policy and a -// maximum size (measured in object size). -type ObjectLRU struct { - MaxSize FileSize - - actualSize FileSize - ll *list.List - cache map[interface{}]*list.Element - mut sync.Mutex -} - -// NewObjectLRU creates a new ObjectLRU with the given maximum size. The maximum -// size will never be exceeded. -func NewObjectLRU(maxSize FileSize) *ObjectLRU { - return &ObjectLRU{MaxSize: maxSize} -} - -// NewObjectLRUDefault creates a new ObjectLRU with the default cache size. -func NewObjectLRUDefault() *ObjectLRU { - return &ObjectLRU{MaxSize: DefaultMaxSize} -} - -// Put puts an object into the cache. If the object is already in the cache, it -// will be marked as used. Otherwise, it will be inserted. A single object might -// be evicted to make room for the new object. -func (c *ObjectLRU) Put(obj plumbing.EncodedObject) { - c.mut.Lock() - defer c.mut.Unlock() - - if c.cache == nil { - c.actualSize = 0 - c.cache = make(map[interface{}]*list.Element, 1000) - c.ll = list.New() - } - - objSize := FileSize(obj.Size()) - key := obj.Hash() - if ee, ok := c.cache[key]; ok { - oldObj := ee.Value.(plumbing.EncodedObject) - // in this case objSize is a delta: new size - old size - objSize -= FileSize(oldObj.Size()) - c.ll.MoveToFront(ee) - ee.Value = obj - } else { - if objSize > c.MaxSize { - return - } - ee := c.ll.PushFront(obj) - c.cache[key] = ee - } - - c.actualSize += objSize - for c.actualSize > c.MaxSize { - last := c.ll.Back() - if last == nil { - c.actualSize = 0 - break - } - - lastObj := last.Value.(plumbing.EncodedObject) - lastSize := FileSize(lastObj.Size()) - - c.ll.Remove(last) - delete(c.cache, lastObj.Hash()) - c.actualSize -= lastSize - } -} - -// Get returns an object by its hash. It marks the object as used. If the object -// is not in the cache, (nil, false) will be returned. -func (c *ObjectLRU) Get(k plumbing.Hash) (plumbing.EncodedObject, bool) { - c.mut.Lock() - defer c.mut.Unlock() - - ee, ok := c.cache[k] - if !ok { - return nil, false - } - - c.ll.MoveToFront(ee) - return ee.Value.(plumbing.EncodedObject), true -} - -// Clear the content of this object cache. -func (c *ObjectLRU) Clear() { - c.mut.Lock() - defer c.mut.Unlock() - - c.ll = nil - c.cache = nil - c.actualSize = 0 -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/color/color.go b/vendor/github.com/go-git/go-git/v5/plumbing/color/color.go deleted file mode 100644 index 2cd74bdc1a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/color/color.go +++ /dev/null @@ -1,38 +0,0 @@ -package color - -// TODO read colors from a github.com/go-git/go-git/plumbing/format/config.Config struct -// TODO implement color parsing, see https://github.com/git/git/blob/v2.26.2/color.c - -// Colors. See https://github.com/git/git/blob/v2.26.2/color.h#L24-L53. -const ( - Normal = "" - Reset = "\033[m" - Bold = "\033[1m" - Red = "\033[31m" - Green = "\033[32m" - Yellow = "\033[33m" - Blue = "\033[34m" - Magenta = "\033[35m" - Cyan = "\033[36m" - BoldRed = "\033[1;31m" - BoldGreen = "\033[1;32m" - BoldYellow = "\033[1;33m" - BoldBlue = "\033[1;34m" - BoldMagenta = "\033[1;35m" - BoldCyan = "\033[1;36m" - FaintRed = "\033[2;31m" - FaintGreen = "\033[2;32m" - FaintYellow = "\033[2;33m" - FaintBlue = "\033[2;34m" - FaintMagenta = "\033[2;35m" - FaintCyan = "\033[2;36m" - BgRed = "\033[41m" - BgGreen = "\033[42m" - BgYellow = "\033[43m" - BgBlue = "\033[44m" - BgMagenta = "\033[45m" - BgCyan = "\033[46m" - Faint = "\033[2m" - FaintItalic = "\033[2;3m" - Reverse = "\033[7m" -) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/error.go b/vendor/github.com/go-git/go-git/v5/plumbing/error.go deleted file mode 100644 index a3ebed3f6c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/error.go +++ /dev/null @@ -1,35 +0,0 @@ -package plumbing - -import "fmt" - -type PermanentError struct { - Err error -} - -func NewPermanentError(err error) *PermanentError { - if err == nil { - return nil - } - - return &PermanentError{Err: err} -} - -func (e *PermanentError) Error() string { - return fmt.Sprintf("permanent client error: %s", e.Err.Error()) -} - -type UnexpectedError struct { - Err error -} - -func NewUnexpectedError(err error) *UnexpectedError { - if err == nil { - return nil - } - - return &UnexpectedError{Err: err} -} - -func (e *UnexpectedError) Error() string { - return fmt.Sprintf("unexpected client error: %s", e.Err.Error()) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/filemode/filemode.go b/vendor/github.com/go-git/go-git/v5/plumbing/filemode/filemode.go deleted file mode 100644 index ea1a457558..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/filemode/filemode.go +++ /dev/null @@ -1,188 +0,0 @@ -package filemode - -import ( - "encoding/binary" - "fmt" - "os" - "strconv" -) - -// A FileMode represents the kind of tree entries used by git. It -// resembles regular file systems modes, although FileModes are -// considerably simpler (there are not so many), and there are some, -// like Submodule that has no file system equivalent. -type FileMode uint32 - -const ( - // Empty is used as the FileMode of tree elements when comparing - // trees in the following situations: - // - // - the mode of tree elements before their creation. - the mode of - // tree elements after their deletion. - the mode of unmerged - // elements when checking the index. - // - // Empty has no file system equivalent. As Empty is the zero value - // of FileMode, it is also returned by New and - // NewFromOsNewFromOSFileMode along with an error, when they fail. - Empty FileMode = 0 - // Dir represent a Directory. - Dir FileMode = 0040000 - // Regular represent non-executable files. Please note this is not - // the same as golang regular files, which include executable files. - Regular FileMode = 0100644 - // Deprecated represent non-executable files with the group writable - // bit set. This mode was supported by the first versions of git, - // but it has been deprecated nowadays. This library uses them - // internally, so you can read old packfiles, but will treat them as - // Regulars when interfacing with the outside world. This is the - // standard git behaviour. - Deprecated FileMode = 0100664 - // Executable represents executable files. - Executable FileMode = 0100755 - // Symlink represents symbolic links to files. - Symlink FileMode = 0120000 - // Submodule represents git submodules. This mode has no file system - // equivalent. - Submodule FileMode = 0160000 -) - -// New takes the octal string representation of a FileMode and returns -// the FileMode and a nil error. If the string can not be parsed to a -// 32 bit unsigned octal number, it returns Empty and the parsing error. -// -// Example: "40000" means Dir, "100644" means Regular. -// -// Please note this function does not check if the returned FileMode -// is valid in git or if it is malformed. For instance, "1" will -// return the malformed FileMode(1) and a nil error. -func New(s string) (FileMode, error) { - n, err := strconv.ParseUint(s, 8, 32) - if err != nil { - return Empty, err - } - - return FileMode(n), nil -} - -// NewFromOSFileMode returns the FileMode used by git to represent -// the provided file system modes and a nil error on success. If the -// file system mode cannot be mapped to any valid git mode (as with -// sockets or named pipes), it will return Empty and an error. -// -// Note that some git modes cannot be generated from os.FileModes, like -// Deprecated and Submodule; while Empty will be returned, along with an -// error, only when the method fails. -func NewFromOSFileMode(m os.FileMode) (FileMode, error) { - if m.IsRegular() { - if isSetTemporary(m) { - return Empty, fmt.Errorf("no equivalent git mode for %s", m) - } - if isSetCharDevice(m) { - return Empty, fmt.Errorf("no equivalent git mode for %s", m) - } - if isSetUserExecutable(m) { - return Executable, nil - } - return Regular, nil - } - - if m.IsDir() { - return Dir, nil - } - - if isSetSymLink(m) { - return Symlink, nil - } - - return Empty, fmt.Errorf("no equivalent git mode for %s", m) -} - -func isSetCharDevice(m os.FileMode) bool { - return m&os.ModeCharDevice != 0 -} - -func isSetTemporary(m os.FileMode) bool { - return m&os.ModeTemporary != 0 -} - -func isSetUserExecutable(m os.FileMode) bool { - return m&0100 != 0 -} - -func isSetSymLink(m os.FileMode) bool { - return m&os.ModeSymlink != 0 -} - -// Bytes return a slice of 4 bytes with the mode in little endian -// encoding. -func (m FileMode) Bytes() []byte { - ret := make([]byte, 4) - binary.LittleEndian.PutUint32(ret, uint32(m)) - return ret -} - -// IsMalformed returns if the FileMode should not appear in a git packfile, -// this is: Empty and any other mode not mentioned as a constant in this -// package. -func (m FileMode) IsMalformed() bool { - return m != Dir && - m != Regular && - m != Deprecated && - m != Executable && - m != Symlink && - m != Submodule -} - -// String returns the FileMode as a string in the standard git format, -// this is, an octal number padded with ceros to 7 digits. Malformed -// modes are printed in that same format, for easier debugging. -// -// Example: Regular is "0100644", Empty is "0000000". -func (m FileMode) String() string { - return fmt.Sprintf("%07o", uint32(m)) -} - -// IsRegular returns if the FileMode represents that of a regular file, -// this is, either Regular or Deprecated. Please note that Executable -// are not regular even though in the UNIX tradition, they usually are: -// See the IsFile method. -func (m FileMode) IsRegular() bool { - return m == Regular || - m == Deprecated -} - -// IsFile returns if the FileMode represents that of a file, this is, -// Regular, Deprecated, Executable or Link. -func (m FileMode) IsFile() bool { - return m == Regular || - m == Deprecated || - m == Executable || - m == Symlink -} - -// ToOSFileMode returns the os.FileMode to be used when creating file -// system elements with the given git mode and a nil error on success. -// -// When the provided mode cannot be mapped to a valid file system mode -// (e.g. Submodule) it returns os.FileMode(0) and an error. -// -// The returned file mode does not take into account the umask. -func (m FileMode) ToOSFileMode() (os.FileMode, error) { - switch m { - case Dir: - return os.ModePerm | os.ModeDir, nil - case Submodule: - return os.ModePerm | os.ModeDir, nil - case Regular: - return os.FileMode(0644), nil - // Deprecated is no longer allowed: treated as a Regular instead - case Deprecated: - return os.FileMode(0644), nil - case Executable: - return os.FileMode(0755), nil - case Symlink: - return os.ModePerm | os.ModeSymlink, nil - } - - return os.FileMode(0), fmt.Errorf("malformed mode (%s)", m) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/common.go deleted file mode 100644 index 6d689ea1e0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/common.go +++ /dev/null @@ -1,109 +0,0 @@ -package config - -// New creates a new config instance. -func New() *Config { - return &Config{} -} - -// Config contains all the sections, comments and includes from a config file. -type Config struct { - Comment *Comment - Sections Sections - Includes Includes -} - -// Includes is a list of Includes in a config file. -type Includes []*Include - -// Include is a reference to an included config file. -type Include struct { - Path string - Config *Config -} - -// Comment string without the prefix '#' or ';'. -type Comment string - -const ( - // NoSubsection token is passed to Config.Section and Config.SetSection to - // represent the absence of a section. - NoSubsection = "" -) - -// Section returns a existing section with the given name or creates a new one. -func (c *Config) Section(name string) *Section { - for i := len(c.Sections) - 1; i >= 0; i-- { - s := c.Sections[i] - if s.IsName(name) { - return s - } - } - - s := &Section{Name: name} - c.Sections = append(c.Sections, s) - return s -} - -// HasSection checks if the Config has a section with the specified name. -func (c *Config) HasSection(name string) bool { - for _, s := range c.Sections { - if s.IsName(name) { - return true - } - } - return false -} - -// RemoveSection removes a section from a config file. -func (c *Config) RemoveSection(name string) *Config { - result := Sections{} - for _, s := range c.Sections { - if !s.IsName(name) { - result = append(result, s) - } - } - - c.Sections = result - return c -} - -// RemoveSubsection remove a subsection from a config file. -func (c *Config) RemoveSubsection(section string, subsection string) *Config { - for _, s := range c.Sections { - if s.IsName(section) { - result := Subsections{} - for _, ss := range s.Subsections { - if !ss.IsName(subsection) { - result = append(result, ss) - } - } - s.Subsections = result - } - } - - return c -} - -// AddOption adds an option to a given section and subsection. Use the -// NoSubsection constant for the subsection argument if no subsection is wanted. -func (c *Config) AddOption(section string, subsection string, key string, value string) *Config { - if subsection == "" { - c.Section(section).AddOption(key, value) - } else { - c.Section(section).Subsection(subsection).AddOption(key, value) - } - - return c -} - -// SetOption sets an option to a given section and subsection. Use the -// NoSubsection constant for the subsection argument if no subsection is wanted. -func (c *Config) SetOption(section string, subsection string, key string, value string) *Config { - if subsection == "" { - c.Section(section).SetOption(key, value) - } else { - c.Section(section).Subsection(subsection).SetOption(key, value) - } - - return c -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/decoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/decoder.go deleted file mode 100644 index 8e52d57f30..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/decoder.go +++ /dev/null @@ -1,37 +0,0 @@ -package config - -import ( - "io" - - "github.com/go-git/gcfg" -) - -// A Decoder reads and decodes config files from an input stream. -type Decoder struct { - io.Reader -} - -// NewDecoder returns a new decoder that reads from r. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{r} -} - -// Decode reads the whole config from its input and stores it in the -// value pointed to by config. -func (d *Decoder) Decode(config *Config) error { - cb := func(s string, ss string, k string, v string, bv bool) error { - if ss == "" && k == "" { - config.Section(s) - return nil - } - - if ss != "" && k == "" { - config.Section(s).Subsection(ss) - return nil - } - - config.AddOption(s, ss, k, v) - return nil - } - return gcfg.ReadWithCallback(d, cb) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go deleted file mode 100644 index 3986c83658..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/doc.go +++ /dev/null @@ -1,122 +0,0 @@ -// Package config implements encoding and decoding of git config files. -// -// Configuration File -// ------------------ -// -// The Git configuration file contains a number of variables that affect -// the Git commands' behavior. The `.git/config` file in each repository -// is used to store the configuration for that repository, and -// `$HOME/.gitconfig` is used to store a per-user configuration as -// fallback values for the `.git/config` file. The file `/etc/gitconfig` -// can be used to store a system-wide default configuration. -// -// The configuration variables are used by both the Git plumbing -// and the porcelains. The variables are divided into sections, wherein -// the fully qualified variable name of the variable itself is the last -// dot-separated segment and the section name is everything before the last -// dot. The variable names are case-insensitive, allow only alphanumeric -// characters and `-`, and must start with an alphabetic character. Some -// variables may appear multiple times; we say then that the variable is -// multivalued. -// -// Syntax -// ~~~~~~ -// -// The syntax is fairly flexible and permissive; whitespaces are mostly -// ignored. The '#' and ';' characters begin comments to the end of line, -// blank lines are ignored. -// -// The file consists of sections and variables. A section begins with -// the name of the section in square brackets and continues until the next -// section begins. Section names are case-insensitive. Only alphanumeric -// characters, `-` and `.` are allowed in section names. Each variable -// must belong to some section, which means that there must be a section -// header before the first setting of a variable. -// -// Sections can be further divided into subsections. To begin a subsection -// put its name in double quotes, separated by space from the section name, -// in the section header, like in the example below: -// -// -------- -// [section "subsection"] -// -// -------- -// -// Subsection names are case sensitive and can contain any characters except -// newline (doublequote `"` and backslash can be included by escaping them -// as `\"` and `\\`, respectively). Section headers cannot span multiple -// lines. Variables may belong directly to a section or to a given subsection. -// You can have `[section]` if you have `[section "subsection"]`, but you -// don't need to. -// -// There is also a deprecated `[section.subsection]` syntax. With this -// syntax, the subsection name is converted to lower-case and is also -// compared case sensitively. These subsection names follow the same -// restrictions as section names. -// -// All the other lines (and the remainder of the line after the section -// header) are recognized as setting variables, in the form -// 'name = value' (or just 'name', which is a short-hand to say that -// the variable is the boolean "true"). -// The variable names are case-insensitive, allow only alphanumeric characters -// and `-`, and must start with an alphabetic character. -// -// A line that defines a value can be continued to the next line by -// ending it with a `\`; the backquote and the end-of-line are -// stripped. Leading whitespaces after 'name =', the remainder of the -// line after the first comment character '#' or ';', and trailing -// whitespaces of the line are discarded unless they are enclosed in -// double quotes. Internal whitespaces within the value are retained -// verbatim. -// -// Inside double quotes, double quote `"` and backslash `\` characters -// must be escaped: use `\"` for `"` and `\\` for `\`. -// -// The following escape sequences (beside `\"` and `\\`) are recognized: -// `\n` for newline character (NL), `\t` for horizontal tabulation (HT, TAB) -// and `\b` for backspace (BS). Other char escape sequences (including octal -// escape sequences) are invalid. -// -// Includes -// ~~~~~~~~ -// -// You can include one config file from another by setting the special -// `include.path` variable to the name of the file to be included. The -// variable takes a pathname as its value, and is subject to tilde -// expansion. -// -// The included file is expanded immediately, as if its contents had been -// found at the location of the include directive. If the value of the -// `include.path` variable is a relative path, the path is considered to be -// relative to the configuration file in which the include directive was -// found. See below for examples. -// -// -// Example -// ~~~~~~~ -// -// # Core variables -// [core] -// ; Don't trust file modes -// filemode = false -// -// # Our diff algorithm -// [diff] -// external = /usr/local/bin/diff-wrapper -// renames = true -// -// [branch "devel"] -// remote = origin -// merge = refs/heads/devel -// -// # Proxy settings -// [core] -// gitProxy="ssh" for "kernel.org" -// gitProxy=default-proxy ; for the rest -// -// [include] -// path = /path/to/foo.inc ; include by absolute path -// path = foo ; expand "foo" relative to the current file -// path = ~/foo ; expand "foo" in your `$HOME` directory -// -package config diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go deleted file mode 100644 index de069aed5e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/encoder.go +++ /dev/null @@ -1,82 +0,0 @@ -package config - -import ( - "fmt" - "io" - "strings" -) - -// An Encoder writes config files to an output stream. -type Encoder struct { - w io.Writer -} - -var ( - subsectionReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`) - valueReplacer = strings.NewReplacer(`"`, `\"`, `\`, `\\`, "\n", `\n`, "\t", `\t`, "\b", `\b`) -) -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{w} -} - -// Encode writes the config in git config format to the stream of the encoder. -func (e *Encoder) Encode(cfg *Config) error { - for _, s := range cfg.Sections { - if err := e.encodeSection(s); err != nil { - return err - } - } - - return nil -} - -func (e *Encoder) encodeSection(s *Section) error { - if len(s.Options) > 0 { - if err := e.printf("[%s]\n", s.Name); err != nil { - return err - } - - if err := e.encodeOptions(s.Options); err != nil { - return err - } - } - - for _, ss := range s.Subsections { - if err := e.encodeSubsection(s.Name, ss); err != nil { - return err - } - } - - return nil -} - -func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error { - if err := e.printf("[%s \"%s\"]\n", sectionName, subsectionReplacer.Replace(s.Name)); err != nil { - return err - } - - return e.encodeOptions(s.Options) -} - -func (e *Encoder) encodeOptions(opts Options) error { - for _, o := range opts { - var value string - if strings.ContainsAny(o.Value, "#;\"\t\n\\") || strings.HasPrefix(o.Value, " ") || strings.HasSuffix(o.Value, " ") { - value = `"`+valueReplacer.Replace(o.Value)+`"` - } else { - value = o.Value - } - - if err := e.printf("\t%s = %s\n", o.Key, value); err != nil { - return err - } - } - - return nil -} - -func (e *Encoder) printf(msg string, args ...interface{}) error { - _, err := fmt.Fprintf(e.w, msg, args...) - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/format.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/format.go deleted file mode 100644 index 4873ea9258..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/format.go +++ /dev/null @@ -1,53 +0,0 @@ -package config - -// RepositoryFormatVersion represents the repository format version, -// as per defined at: -// -// https://git-scm.com/docs/repository-version -type RepositoryFormatVersion string - -const ( - // Version_0 is the format defined by the initial version of git, - // including but not limited to the format of the repository - // directory, the repository configuration file, and the object - // and ref storage. - // - // Specifying the complete behavior of git is beyond the scope - // of this document. - Version_0 = "0" - - // Version_1 is identical to version 0, with the following exceptions: - // - // 1. When reading the core.repositoryformatversion variable, a git - // implementation which supports version 1 MUST also read any - // configuration keys found in the extensions section of the - // configuration file. - // - // 2. If a version-1 repository specifies any extensions.* keys that - // the running git has not implemented, the operation MUST NOT proceed. - // Similarly, if the value of any known key is not understood by the - // implementation, the operation MUST NOT proceed. - // - // Note that if no extensions are specified in the config file, then - // core.repositoryformatversion SHOULD be set to 0 (setting it to 1 provides - // no benefit, and makes the repository incompatible with older - // implementations of git). - Version_1 = "1" - - // DefaultRepositoryFormatVersion holds the default repository format version. - DefaultRepositoryFormatVersion = Version_0 -) - -// ObjectFormat defines the object format. -type ObjectFormat string - -const ( - // SHA1 represents the object format used for SHA1. - SHA1 ObjectFormat = "sha1" - - // SHA256 represents the object format used for SHA256. - SHA256 ObjectFormat = "sha256" - - // DefaultObjectFormat holds the default object format. - DefaultObjectFormat = SHA1 -) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go deleted file mode 100644 index cad394810a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/option.go +++ /dev/null @@ -1,127 +0,0 @@ -package config - -import ( - "fmt" - "strings" -) - -// Option defines a key/value entity in a config file. -type Option struct { - // Key preserving original caseness. - // Use IsKey instead to compare key regardless of caseness. - Key string - // Original value as string, could be not normalized. - Value string -} - -type Options []*Option - -// IsKey returns true if the given key matches -// this option's key in a case-insensitive comparison. -func (o *Option) IsKey(key string) bool { - return strings.EqualFold(o.Key, key) -} - -func (opts Options) GoString() string { - var strs []string - for _, opt := range opts { - strs = append(strs, fmt.Sprintf("%#v", opt)) - } - - return strings.Join(strs, ", ") -} - -// Get gets the value for the given key if set, -// otherwise it returns the empty string. -// -// Note that there is no difference -// -// This matches git behaviour since git v1.8.1-rc1, -// if there are multiple definitions of a key, the -// last one wins. -// -// See: http://article.gmane.org/gmane.linux.kernel/1407184 -// -// In order to get all possible values for the same key, -// use GetAll. -func (opts Options) Get(key string) string { - for i := len(opts) - 1; i >= 0; i-- { - o := opts[i] - if o.IsKey(key) { - return o.Value - } - } - return "" -} - -// Has checks if an Option exist with the given key. -func (opts Options) Has(key string) bool { - for _, o := range opts { - if o.IsKey(key) { - return true - } - } - return false -} - -// GetAll returns all possible values for the same key. -func (opts Options) GetAll(key string) []string { - result := []string{} - for _, o := range opts { - if o.IsKey(key) { - result = append(result, o.Value) - } - } - return result -} - -func (opts Options) withoutOption(key string) Options { - result := Options{} - for _, o := range opts { - if !o.IsKey(key) { - result = append(result, o) - } - } - return result -} - -func (opts Options) withAddedOption(key string, value string) Options { - return append(opts, &Option{key, value}) -} - -func (opts Options) withSettedOption(key string, values ...string) Options { - var result Options - var added []string - for _, o := range opts { - if !o.IsKey(key) { - result = append(result, o) - continue - } - - if contains(values, o.Value) { - added = append(added, o.Value) - result = append(result, o) - continue - } - } - - for _, value := range values { - if contains(added, value) { - continue - } - - result = result.withAddedOption(key, value) - } - - return result -} - -func contains(haystack []string, needle string) bool { - for _, s := range haystack { - if s == needle { - return true - } - } - - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go deleted file mode 100644 index 4625ac5837..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/config/section.go +++ /dev/null @@ -1,181 +0,0 @@ -package config - -import ( - "fmt" - "strings" -) - -// Section is the representation of a section inside git configuration files. -// Each Section contains Options that are used by both the Git plumbing -// and the porcelains. -// Sections can be further divided into subsections. To begin a subsection -// put its name in double quotes, separated by space from the section name, -// in the section header, like in the example below: -// -// [section "subsection"] -// -// All the other lines (and the remainder of the line after the section header) -// are recognized as option variables, in the form "name = value" (or just name, -// which is a short-hand to say that the variable is the boolean "true"). -// The variable names are case-insensitive, allow only alphanumeric characters -// and -, and must start with an alphabetic character: -// -// [section "subsection1"] -// option1 = value1 -// option2 -// [section "subsection2"] -// option3 = value2 -// -type Section struct { - Name string - Options Options - Subsections Subsections -} - -type Subsection struct { - Name string - Options Options -} - -type Sections []*Section - -func (s Sections) GoString() string { - var strs []string - for _, ss := range s { - strs = append(strs, fmt.Sprintf("%#v", ss)) - } - - return strings.Join(strs, ", ") -} - -type Subsections []*Subsection - -func (s Subsections) GoString() string { - var strs []string - for _, ss := range s { - strs = append(strs, fmt.Sprintf("%#v", ss)) - } - - return strings.Join(strs, ", ") -} - -// IsName checks if the name provided is equals to the Section name, case insensitive. -func (s *Section) IsName(name string) bool { - return strings.EqualFold(s.Name, name) -} - -// Subsection returns a Subsection from the specified Section. If the -// Subsection does not exists, new one is created and added to Section. -func (s *Section) Subsection(name string) *Subsection { - for i := len(s.Subsections) - 1; i >= 0; i-- { - ss := s.Subsections[i] - if ss.IsName(name) { - return ss - } - } - - ss := &Subsection{Name: name} - s.Subsections = append(s.Subsections, ss) - return ss -} - -// HasSubsection checks if the Section has a Subsection with the specified name. -func (s *Section) HasSubsection(name string) bool { - for _, ss := range s.Subsections { - if ss.IsName(name) { - return true - } - } - - return false -} - -// RemoveSubsection removes a subsection from a Section. -func (s *Section) RemoveSubsection(name string) *Section { - result := Subsections{} - for _, s := range s.Subsections { - if !s.IsName(name) { - result = append(result, s) - } - } - - s.Subsections = result - return s -} - -// Option returns the value for the specified key. Empty string is returned if -// key does not exists. -func (s *Section) Option(key string) string { - return s.Options.Get(key) -} - -// OptionAll returns all possible values for an option with the specified key. -// If the option does not exists, an empty slice will be returned. -func (s *Section) OptionAll(key string) []string { - return s.Options.GetAll(key) -} - -// HasOption checks if the Section has an Option with the given key. -func (s *Section) HasOption(key string) bool { - return s.Options.Has(key) -} - -// AddOption adds a new Option to the Section. The updated Section is returned. -func (s *Section) AddOption(key string, value string) *Section { - s.Options = s.Options.withAddedOption(key, value) - return s -} - -// SetOption adds a new Option to the Section. If the option already exists, is replaced. -// The updated Section is returned. -func (s *Section) SetOption(key string, value string) *Section { - s.Options = s.Options.withSettedOption(key, value) - return s -} - -// Remove an option with the specified key. The updated Section is returned. -func (s *Section) RemoveOption(key string) *Section { - s.Options = s.Options.withoutOption(key) - return s -} - -// IsName checks if the name of the subsection is exactly the specified name. -func (s *Subsection) IsName(name string) bool { - return s.Name == name -} - -// Option returns an option with the specified key. If the option does not exists, -// empty spring will be returned. -func (s *Subsection) Option(key string) string { - return s.Options.Get(key) -} - -// OptionAll returns all possible values for an option with the specified key. -// If the option does not exists, an empty slice will be returned. -func (s *Subsection) OptionAll(key string) []string { - return s.Options.GetAll(key) -} - -// HasOption checks if the Subsection has an Option with the given key. -func (s *Subsection) HasOption(key string) bool { - return s.Options.Has(key) -} - -// AddOption adds a new Option to the Subsection. The updated Subsection is returned. -func (s *Subsection) AddOption(key string, value string) *Subsection { - s.Options = s.Options.withAddedOption(key, value) - return s -} - -// SetOption adds a new Option to the Subsection. If the option already exists, is replaced. -// The updated Subsection is returned. -func (s *Subsection) SetOption(key string, value ...string) *Subsection { - s.Options = s.Options.withSettedOption(key, value...) - return s -} - -// RemoveOption removes the option with the specified key. The updated Subsection is returned. -func (s *Subsection) RemoveOption(key string) *Subsection { - s.Options = s.Options.withoutOption(key) - return s -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/colorconfig.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/colorconfig.go deleted file mode 100644 index 6fd4158462..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/colorconfig.go +++ /dev/null @@ -1,97 +0,0 @@ -package diff - -import "github.com/go-git/go-git/v5/plumbing/color" - -// A ColorKey is a key into a ColorConfig map and also equal to the key in the -// diff.color subsection of the config. See -// https://github.com/git/git/blob/v2.26.2/diff.c#L83-L106. -type ColorKey string - -// ColorKeys. -const ( - Context ColorKey = "context" - Meta ColorKey = "meta" - Frag ColorKey = "frag" - Old ColorKey = "old" - New ColorKey = "new" - Commit ColorKey = "commit" - Whitespace ColorKey = "whitespace" - Func ColorKey = "func" - OldMoved ColorKey = "oldMoved" - OldMovedAlternative ColorKey = "oldMovedAlternative" - OldMovedDimmed ColorKey = "oldMovedDimmed" - OldMovedAlternativeDimmed ColorKey = "oldMovedAlternativeDimmed" - NewMoved ColorKey = "newMoved" - NewMovedAlternative ColorKey = "newMovedAlternative" - NewMovedDimmed ColorKey = "newMovedDimmed" - NewMovedAlternativeDimmed ColorKey = "newMovedAlternativeDimmed" - ContextDimmed ColorKey = "contextDimmed" - OldDimmed ColorKey = "oldDimmed" - NewDimmed ColorKey = "newDimmed" - ContextBold ColorKey = "contextBold" - OldBold ColorKey = "oldBold" - NewBold ColorKey = "newBold" -) - -// A ColorConfig is a color configuration. A nil or empty ColorConfig -// corresponds to no color. -type ColorConfig map[ColorKey]string - -// A ColorConfigOption sets an option on a ColorConfig. -type ColorConfigOption func(ColorConfig) - -// WithColor sets the color for key. -func WithColor(key ColorKey, color string) ColorConfigOption { - return func(cc ColorConfig) { - cc[key] = color - } -} - -// defaultColorConfig is the default color configuration. See -// https://github.com/git/git/blob/v2.26.2/diff.c#L57-L81. -var defaultColorConfig = ColorConfig{ - Context: color.Normal, - Meta: color.Bold, - Frag: color.Cyan, - Old: color.Red, - New: color.Green, - Commit: color.Yellow, - Whitespace: color.BgRed, - Func: color.Normal, - OldMoved: color.BoldMagenta, - OldMovedAlternative: color.BoldBlue, - OldMovedDimmed: color.Faint, - OldMovedAlternativeDimmed: color.FaintItalic, - NewMoved: color.BoldCyan, - NewMovedAlternative: color.BoldYellow, - NewMovedDimmed: color.Faint, - NewMovedAlternativeDimmed: color.FaintItalic, - ContextDimmed: color.Faint, - OldDimmed: color.FaintRed, - NewDimmed: color.FaintGreen, - ContextBold: color.Bold, - OldBold: color.BoldRed, - NewBold: color.BoldGreen, -} - -// NewColorConfig returns a new ColorConfig. -func NewColorConfig(options ...ColorConfigOption) ColorConfig { - cc := make(ColorConfig) - for key, value := range defaultColorConfig { - cc[key] = value - } - for _, option := range options { - option(cc) - } - return cc -} - -// Reset returns the ANSI escape sequence to reset the color with key set from -// cc. If no color was set then no reset is needed so it returns the empty -// string. -func (cc ColorConfig) Reset(key ColorKey) string { - if cc[key] == "" { - return "" - } - return color.Reset -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/patch.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/patch.go deleted file mode 100644 index c7678b01a4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/patch.go +++ /dev/null @@ -1,58 +0,0 @@ -package diff - -import ( - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" -) - -// Operation defines the operation of a diff item. -type Operation int - -const ( - // Equal item represents an equals diff. - Equal Operation = iota - // Add item represents an insert diff. - Add - // Delete item represents a delete diff. - Delete -) - -// Patch represents a collection of steps to transform several files. -type Patch interface { - // FilePatches returns a slice of patches per file. - FilePatches() []FilePatch - // Message returns an optional message that can be at the top of the - // Patch representation. - Message() string -} - -// FilePatch represents the necessary steps to transform one file into another. -type FilePatch interface { - // IsBinary returns true if this patch is representing a binary file. - IsBinary() bool - // Files returns the from and to Files, with all the necessary metadata - // about them. If the patch creates a new file, "from" will be nil. - // If the patch deletes a file, "to" will be nil. - Files() (from, to File) - // Chunks returns a slice of ordered changes to transform "from" File into - // "to" File. If the file is a binary one, Chunks will be empty. - Chunks() []Chunk -} - -// File contains all the file metadata necessary to print some patch formats. -type File interface { - // Hash returns the File Hash. - Hash() plumbing.Hash - // Mode returns the FileMode. - Mode() filemode.FileMode - // Path returns the complete Path to the file, including the filename. - Path() string -} - -// Chunk represents a portion of a file transformation into another. -type Chunk interface { - // Content contains the portion of the file. - Content() string - // Type contains the Operation to do with this Chunk. - Type() Operation -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go deleted file mode 100644 index fa605b1985..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/diff/unified_encoder.go +++ /dev/null @@ -1,395 +0,0 @@ -package diff - -import ( - "fmt" - "io" - "regexp" - "strconv" - "strings" - - "github.com/go-git/go-git/v5/plumbing" -) - -// DefaultContextLines is the default number of context lines. -const DefaultContextLines = 3 - -var ( - splitLinesRegexp = regexp.MustCompile(`[^\n]*(\n|$)`) - - operationChar = map[Operation]byte{ - Add: '+', - Delete: '-', - Equal: ' ', - } - - operationColorKey = map[Operation]ColorKey{ - Add: New, - Delete: Old, - Equal: Context, - } -) - -// UnifiedEncoder encodes an unified diff into the provided Writer. It does not -// support similarity index for renames or sorting hash representations. -type UnifiedEncoder struct { - io.Writer - - // contextLines is the count of unchanged lines that will appear surrounding - // a change. - contextLines int - - // srcPrefix and dstPrefix are prepended to file paths when encoding a diff. - srcPrefix string - dstPrefix string - - // colorConfig is the color configuration. The default is no color. - color ColorConfig -} - -// NewUnifiedEncoder returns a new UnifiedEncoder that writes to w. -func NewUnifiedEncoder(w io.Writer, contextLines int) *UnifiedEncoder { - return &UnifiedEncoder{ - Writer: w, - srcPrefix: "a/", - dstPrefix: "b/", - contextLines: contextLines, - } -} - -// SetColor sets e's color configuration and returns e. -func (e *UnifiedEncoder) SetColor(colorConfig ColorConfig) *UnifiedEncoder { - e.color = colorConfig - return e -} - -// SetSrcPrefix sets e's srcPrefix and returns e. -func (e *UnifiedEncoder) SetSrcPrefix(prefix string) *UnifiedEncoder { - e.srcPrefix = prefix - return e -} - -// SetDstPrefix sets e's dstPrefix and returns e. -func (e *UnifiedEncoder) SetDstPrefix(prefix string) *UnifiedEncoder { - e.dstPrefix = prefix - return e -} - -// Encode encodes patch. -func (e *UnifiedEncoder) Encode(patch Patch) error { - sb := &strings.Builder{} - - if message := patch.Message(); message != "" { - sb.WriteString(message) - if !strings.HasSuffix(message, "\n") { - sb.WriteByte('\n') - } - } - - for _, filePatch := range patch.FilePatches() { - e.writeFilePatchHeader(sb, filePatch) - g := newHunksGenerator(filePatch.Chunks(), e.contextLines) - for _, hunk := range g.Generate() { - hunk.writeTo(sb, e.color) - } - } - - _, err := e.Write([]byte(sb.String())) - return err -} - -func (e *UnifiedEncoder) writeFilePatchHeader(sb *strings.Builder, filePatch FilePatch) { - from, to := filePatch.Files() - if from == nil && to == nil { - return - } - isBinary := filePatch.IsBinary() - - var lines []string - switch { - case from != nil && to != nil: - hashEquals := from.Hash() == to.Hash() - lines = append(lines, - fmt.Sprintf("diff --git %s%s %s%s", - e.srcPrefix, from.Path(), e.dstPrefix, to.Path()), - ) - if from.Mode() != to.Mode() { - lines = append(lines, - fmt.Sprintf("old mode %o", from.Mode()), - fmt.Sprintf("new mode %o", to.Mode()), - ) - } - if from.Path() != to.Path() { - lines = append(lines, - fmt.Sprintf("rename from %s", from.Path()), - fmt.Sprintf("rename to %s", to.Path()), - ) - } - if from.Mode() != to.Mode() && !hashEquals { - lines = append(lines, - fmt.Sprintf("index %s..%s", from.Hash(), to.Hash()), - ) - } else if !hashEquals { - lines = append(lines, - fmt.Sprintf("index %s..%s %o", from.Hash(), to.Hash(), from.Mode()), - ) - } - if !hashEquals { - lines = e.appendPathLines(lines, e.srcPrefix+from.Path(), e.dstPrefix+to.Path(), isBinary) - } - case from == nil: - lines = append(lines, - fmt.Sprintf("diff --git %s %s", e.srcPrefix+to.Path(), e.dstPrefix+to.Path()), - fmt.Sprintf("new file mode %o", to.Mode()), - fmt.Sprintf("index %s..%s", plumbing.ZeroHash, to.Hash()), - ) - lines = e.appendPathLines(lines, "/dev/null", e.dstPrefix+to.Path(), isBinary) - case to == nil: - lines = append(lines, - fmt.Sprintf("diff --git %s %s", e.srcPrefix+from.Path(), e.dstPrefix+from.Path()), - fmt.Sprintf("deleted file mode %o", from.Mode()), - fmt.Sprintf("index %s..%s", from.Hash(), plumbing.ZeroHash), - ) - lines = e.appendPathLines(lines, e.srcPrefix+from.Path(), "/dev/null", isBinary) - } - - sb.WriteString(e.color[Meta]) - sb.WriteString(lines[0]) - for _, line := range lines[1:] { - sb.WriteByte('\n') - sb.WriteString(line) - } - sb.WriteString(e.color.Reset(Meta)) - sb.WriteByte('\n') -} - -func (e *UnifiedEncoder) appendPathLines(lines []string, fromPath, toPath string, isBinary bool) []string { - if isBinary { - return append(lines, - fmt.Sprintf("Binary files %s and %s differ", fromPath, toPath), - ) - } - return append(lines, - fmt.Sprintf("--- %s", fromPath), - fmt.Sprintf("+++ %s", toPath), - ) -} - -type hunksGenerator struct { - fromLine, toLine int - ctxLines int - chunks []Chunk - current *hunk - hunks []*hunk - beforeContext, afterContext []string -} - -func newHunksGenerator(chunks []Chunk, ctxLines int) *hunksGenerator { - return &hunksGenerator{ - chunks: chunks, - ctxLines: ctxLines, - } -} - -func (g *hunksGenerator) Generate() []*hunk { - for i, chunk := range g.chunks { - lines := splitLines(chunk.Content()) - nLines := len(lines) - - switch chunk.Type() { - case Equal: - g.fromLine += nLines - g.toLine += nLines - g.processEqualsLines(lines, i) - case Delete: - if nLines != 0 { - g.fromLine++ - } - - g.processHunk(i, chunk.Type()) - g.fromLine += nLines - 1 - g.current.AddOp(chunk.Type(), lines...) - case Add: - if nLines != 0 { - g.toLine++ - } - g.processHunk(i, chunk.Type()) - g.toLine += nLines - 1 - g.current.AddOp(chunk.Type(), lines...) - } - - if i == len(g.chunks)-1 && g.current != nil { - g.hunks = append(g.hunks, g.current) - } - } - - return g.hunks -} - -func (g *hunksGenerator) processHunk(i int, op Operation) { - if g.current != nil { - return - } - - var ctxPrefix string - linesBefore := len(g.beforeContext) - if linesBefore > g.ctxLines { - ctxPrefix = g.beforeContext[linesBefore-g.ctxLines-1] - g.beforeContext = g.beforeContext[linesBefore-g.ctxLines:] - linesBefore = g.ctxLines - } - - g.current = &hunk{ctxPrefix: strings.TrimSuffix(ctxPrefix, "\n")} - g.current.AddOp(Equal, g.beforeContext...) - - switch op { - case Delete: - g.current.fromLine, g.current.toLine = - g.addLineNumbers(g.fromLine, g.toLine, linesBefore, i, Add) - case Add: - g.current.toLine, g.current.fromLine = - g.addLineNumbers(g.toLine, g.fromLine, linesBefore, i, Delete) - } - - g.beforeContext = nil -} - -// addLineNumbers obtains the line numbers in a new chunk. -func (g *hunksGenerator) addLineNumbers(la, lb int, linesBefore int, i int, op Operation) (cla, clb int) { - cla = la - linesBefore - // we need to search for a reference for the next diff - switch { - case linesBefore != 0 && g.ctxLines != 0: - if lb > g.ctxLines { - clb = lb - g.ctxLines + 1 - } else { - clb = 1 - } - case g.ctxLines == 0: - clb = lb - case i != len(g.chunks)-1: - next := g.chunks[i+1] - if next.Type() == op || next.Type() == Equal { - // this diff will be into this chunk - clb = lb + 1 - } - } - - return -} - -func (g *hunksGenerator) processEqualsLines(ls []string, i int) { - if g.current == nil { - g.beforeContext = append(g.beforeContext, ls...) - return - } - - g.afterContext = append(g.afterContext, ls...) - if len(g.afterContext) <= g.ctxLines*2 && i != len(g.chunks)-1 { - g.current.AddOp(Equal, g.afterContext...) - g.afterContext = nil - } else { - ctxLines := g.ctxLines - if ctxLines > len(g.afterContext) { - ctxLines = len(g.afterContext) - } - g.current.AddOp(Equal, g.afterContext[:ctxLines]...) - g.hunks = append(g.hunks, g.current) - - g.current = nil - g.beforeContext = g.afterContext[ctxLines:] - g.afterContext = nil - } -} - -func splitLines(s string) []string { - out := splitLinesRegexp.FindAllString(s, -1) - if out[len(out)-1] == "" { - out = out[:len(out)-1] - } - return out -} - -type hunk struct { - fromLine int - toLine int - - fromCount int - toCount int - - ctxPrefix string - ops []*op -} - -func (h *hunk) writeTo(sb *strings.Builder, color ColorConfig) { - sb.WriteString(color[Frag]) - sb.WriteString("@@ -") - - if h.fromCount == 1 { - sb.WriteString(strconv.Itoa(h.fromLine)) - } else { - sb.WriteString(strconv.Itoa(h.fromLine)) - sb.WriteByte(',') - sb.WriteString(strconv.Itoa(h.fromCount)) - } - - sb.WriteString(" +") - - if h.toCount == 1 { - sb.WriteString(strconv.Itoa(h.toLine)) - } else { - sb.WriteString(strconv.Itoa(h.toLine)) - sb.WriteByte(',') - sb.WriteString(strconv.Itoa(h.toCount)) - } - - sb.WriteString(" @@") - sb.WriteString(color.Reset(Frag)) - - if h.ctxPrefix != "" { - sb.WriteByte(' ') - sb.WriteString(color[Func]) - sb.WriteString(h.ctxPrefix) - sb.WriteString(color.Reset(Func)) - } - - sb.WriteByte('\n') - - for _, op := range h.ops { - op.writeTo(sb, color) - } -} - -func (h *hunk) AddOp(t Operation, ss ...string) { - n := len(ss) - switch t { - case Add: - h.toCount += n - case Delete: - h.fromCount += n - case Equal: - h.toCount += n - h.fromCount += n - } - - for _, s := range ss { - h.ops = append(h.ops, &op{s, t}) - } -} - -type op struct { - text string - t Operation -} - -func (o *op) writeTo(sb *strings.Builder, color ColorConfig) { - colorKey := operationColorKey[o.t] - sb.WriteString(color[colorKey]) - sb.WriteByte(operationChar[o.t]) - if strings.HasSuffix(o.text, "\n") { - sb.WriteString(strings.TrimSuffix(o.text, "\n")) - } else { - sb.WriteString(o.text + "\n\\ No newline at end of file") - } - sb.WriteString(color.Reset(colorKey)) - sb.WriteByte('\n') -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/dir.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/dir.go deleted file mode 100644 index d8fb30c166..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/dir.go +++ /dev/null @@ -1,144 +0,0 @@ -package gitignore - -import ( - "bufio" - "bytes" - "io" - "os" - "strings" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-git/v5/internal/path_util" - "github.com/go-git/go-git/v5/plumbing/format/config" - gioutil "github.com/go-git/go-git/v5/utils/ioutil" -) - -const ( - commentPrefix = "#" - coreSection = "core" - excludesfile = "excludesfile" - gitDir = ".git" - gitignoreFile = ".gitignore" - gitconfigFile = ".gitconfig" - systemFile = "/etc/gitconfig" - infoExcludeFile = gitDir + "/info/exclude" -) - -// readIgnoreFile reads a specific git ignore file. -func readIgnoreFile(fs billy.Filesystem, path []string, ignoreFile string) (ps []Pattern, err error) { - - ignoreFile, _ = path_util.ReplaceTildeWithHome(ignoreFile) - - f, err := fs.Open(fs.Join(append(path, ignoreFile)...)) - if err == nil { - defer f.Close() - - scanner := bufio.NewScanner(f) - for scanner.Scan() { - s := scanner.Text() - if !strings.HasPrefix(s, commentPrefix) && len(strings.TrimSpace(s)) > 0 { - ps = append(ps, ParsePattern(s, path)) - } - } - } else if !os.IsNotExist(err) { - return nil, err - } - - return -} - -// ReadPatterns reads the .git/info/exclude and then the gitignore patterns -// recursively traversing through the directory structure. The result is in -// the ascending order of priority (last higher). -func ReadPatterns(fs billy.Filesystem, path []string) (ps []Pattern, err error) { - ps, _ = readIgnoreFile(fs, path, infoExcludeFile) - - subps, _ := readIgnoreFile(fs, path, gitignoreFile) - ps = append(ps, subps...) - - var fis []os.FileInfo - fis, err = fs.ReadDir(fs.Join(path...)) - if err != nil { - return - } - - for _, fi := range fis { - if fi.IsDir() && fi.Name() != gitDir { - var subps []Pattern - subps, err = ReadPatterns(fs, append(path, fi.Name())) - if err != nil { - return - } - - if len(subps) > 0 { - ps = append(ps, subps...) - } - } - } - - return -} - -func loadPatterns(fs billy.Filesystem, path string) (ps []Pattern, err error) { - f, err := fs.Open(path) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - return nil, err - } - - defer gioutil.CheckClose(f, &err) - - b, err := io.ReadAll(f) - if err != nil { - return - } - - d := config.NewDecoder(bytes.NewBuffer(b)) - - raw := config.New() - if err = d.Decode(raw); err != nil { - return - } - - s := raw.Section(coreSection) - efo := s.Options.Get(excludesfile) - if efo == "" { - return nil, nil - } - - ps, err = readIgnoreFile(fs, nil, efo) - if os.IsNotExist(err) { - return nil, nil - } - - return -} - -// LoadGlobalPatterns loads gitignore patterns from from the gitignore file -// declared in a user's ~/.gitconfig file. If the ~/.gitconfig file does not -// exist the function will return nil. If the core.excludesfile property -// is not declared, the function will return nil. If the file pointed to by -// the core.excludesfile property does not exist, the function will return nil. -// -// The function assumes fs is rooted at the root filesystem. -func LoadGlobalPatterns(fs billy.Filesystem) (ps []Pattern, err error) { - home, err := os.UserHomeDir() - if err != nil { - return - } - - return loadPatterns(fs, fs.Join(home, gitconfigFile)) -} - -// LoadSystemPatterns loads gitignore patterns from from the gitignore file -// declared in a system's /etc/gitconfig file. If the /etc/gitconfig file does -// not exist the function will return nil. If the core.excludesfile property -// is not declared, the function will return nil. If the file pointed to by -// the core.excludesfile property does not exist, the function will return nil. -// -// The function assumes fs is rooted at the root filesystem. -func LoadSystemPatterns(fs billy.Filesystem) (ps []Pattern, err error) { - return loadPatterns(fs, systemFile) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go deleted file mode 100644 index eecd4baccb..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/doc.go +++ /dev/null @@ -1,70 +0,0 @@ -// Package gitignore implements matching file system paths to gitignore patterns that -// can be automatically read from a git repository tree in the order of definition -// priorities. It support all pattern formats as specified in the original gitignore -// documentation, copied below: -// -// Pattern format -// ============== -// -// - A blank line matches no files, so it can serve as a separator for readability. -// -// - A line starting with # serves as a comment. Put a backslash ("\") in front of -// the first hash for patterns that begin with a hash. -// -// - Trailing spaces are ignored unless they are quoted with backslash ("\"). -// -// - An optional prefix "!" which negates the pattern; any matching file excluded -// by a previous pattern will become included again. It is not possible to -// re-include a file if a parent directory of that file is excluded. -// Git doesn’t list excluded directories for performance reasons, so -// any patterns on contained files have no effect, no matter where they are -// defined. Put a backslash ("\") in front of the first "!" for patterns -// that begin with a literal "!", for example, "\!important!.txt". -// -// - If the pattern ends with a slash, it is removed for the purpose of the -// following description, but it would only find a match with a directory. -// In other words, foo/ will match a directory foo and paths underneath it, -// but will not match a regular file or a symbolic link foo (this is consistent -// with the way how pathspec works in general in Git). -// -// - If the pattern does not contain a slash /, Git treats it as a shell glob -// pattern and checks for a match against the pathname relative to the location -// of the .gitignore file (relative to the toplevel of the work tree if not -// from a .gitignore file). -// -// - Otherwise, Git treats the pattern as a shell glob suitable for consumption -// by fnmatch(3) with the FNM_PATHNAME flag: wildcards in the pattern will -// not match a / in the pathname. For example, "Documentation/*.html" matches -// "Documentation/git.html" but not "Documentation/ppc/ppc.html" or -// "tools/perf/Documentation/perf.html". -// -// - A leading slash matches the beginning of the pathname. For example, -// "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". -// -// Two consecutive asterisks ("**") in patterns matched against full pathname -// may have special meaning: -// -// - A leading "**" followed by a slash means match in all directories. -// For example, "**/foo" matches file or directory "foo" anywhere, the same as -// pattern "foo". "**/foo/bar" matches file or directory "bar" -// anywhere that is directly under directory "foo". -// -// - A trailing "/**" matches everything inside. For example, "abc/**" matches -// all files inside directory "abc", relative to the location of the -// .gitignore file, with infinite depth. -// -// - A slash followed by two consecutive asterisks then a slash matches -// zero or more directories. For example, "a/**/b" matches "a/b", "a/x/b", -// "a/x/y/b" and so on. -// -// - Other consecutive asterisks are considered invalid. -// -// Copyright and license -// ===================== -// -// Copyright (c) Oleg Sklyar, Silvertern and source{d} -// -// The package code was donated to source{d} to include, modify and develop -// further as a part of the `go-git` project, release it on the license of -// the whole project or delete it from the project. -package gitignore diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/matcher.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/matcher.go deleted file mode 100644 index bd1e9e2d4c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/matcher.go +++ /dev/null @@ -1,30 +0,0 @@ -package gitignore - -// Matcher defines a global multi-pattern matcher for gitignore patterns -type Matcher interface { - // Match matches patterns in the order of priorities. As soon as an inclusion or - // exclusion is found, not further matching is performed. - Match(path []string, isDir bool) bool -} - -// NewMatcher constructs a new global matcher. Patterns must be given in the order of -// increasing priority. That is most generic settings files first, then the content of -// the repo .gitignore, then content of .gitignore down the path or the repo and then -// the content command line arguments. -func NewMatcher(ps []Pattern) Matcher { - return &matcher{ps} -} - -type matcher struct { - patterns []Pattern -} - -func (m *matcher) Match(path []string, isDir bool) bool { - n := len(m.patterns) - for i := n - 1; i >= 0; i-- { - if match := m.patterns[i].Match(path, isDir); match > NoMatch { - return match == Exclude - } - } - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/pattern.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/pattern.go deleted file mode 100644 index 450b3cdf72..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/gitignore/pattern.go +++ /dev/null @@ -1,155 +0,0 @@ -package gitignore - -import ( - "path/filepath" - "strings" -) - -// MatchResult defines outcomes of a match, no match, exclusion or inclusion. -type MatchResult int - -const ( - // NoMatch defines the no match outcome of a match check - NoMatch MatchResult = iota - // Exclude defines an exclusion of a file as a result of a match check - Exclude - // Include defines an explicit inclusion of a file as a result of a match check - Include -) - -const ( - inclusionPrefix = "!" - zeroToManyDirs = "**" - patternDirSep = "/" -) - -// Pattern defines a single gitignore pattern. -type Pattern interface { - // Match matches the given path to the pattern. - Match(path []string, isDir bool) MatchResult -} - -type pattern struct { - domain []string - pattern []string - inclusion bool - dirOnly bool - isGlob bool -} - -// ParsePattern parses a gitignore pattern string into the Pattern structure. -func ParsePattern(p string, domain []string) Pattern { - // storing domain, copy it to ensure it isn't changed externally - domain = append([]string(nil), domain...) - res := pattern{domain: domain} - - if strings.HasPrefix(p, inclusionPrefix) { - res.inclusion = true - p = p[1:] - } - - if !strings.HasSuffix(p, "\\ ") { - p = strings.TrimRight(p, " ") - } - - if strings.HasSuffix(p, patternDirSep) { - res.dirOnly = true - p = p[:len(p)-1] - } - - if strings.Contains(p, patternDirSep) { - res.isGlob = true - } - - res.pattern = strings.Split(p, patternDirSep) - return &res -} - -func (p *pattern) Match(path []string, isDir bool) MatchResult { - if len(path) <= len(p.domain) { - return NoMatch - } - for i, e := range p.domain { - if path[i] != e { - return NoMatch - } - } - - path = path[len(p.domain):] - if p.isGlob && !p.globMatch(path, isDir) { - return NoMatch - } else if !p.isGlob && !p.simpleNameMatch(path, isDir) { - return NoMatch - } - - if p.inclusion { - return Include - } else { - return Exclude - } -} - -func (p *pattern) simpleNameMatch(path []string, isDir bool) bool { - for i, name := range path { - if match, err := filepath.Match(p.pattern[0], name); err != nil { - return false - } else if !match { - continue - } - if p.dirOnly && !isDir && i == len(path)-1 { - return false - } - return true - } - return false -} - -func (p *pattern) globMatch(path []string, isDir bool) bool { - matched := false - canTraverse := false - for i, pattern := range p.pattern { - if pattern == "" { - canTraverse = false - continue - } - if pattern == zeroToManyDirs { - if i == len(p.pattern)-1 { - break - } - canTraverse = true - continue - } - if strings.Contains(pattern, zeroToManyDirs) { - return false - } - if len(path) == 0 { - return false - } - if canTraverse { - canTraverse = false - for len(path) > 0 { - e := path[0] - path = path[1:] - if match, err := filepath.Match(pattern, e); err != nil { - return false - } else if match { - matched = true - break - } else if len(path) == 0 { - // if nothing left then fail - matched = false - } - } - } else { - if match, err := filepath.Match(pattern, path[0]); err != nil || !match { - return false - } - matched = true - path = path[1:] - } - } - if matched && p.dirOnly && !isDir && len(path) == 0 { - matched = false - } - return matched -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/decoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/decoder.go deleted file mode 100644 index 9afdce3011..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/decoder.go +++ /dev/null @@ -1,178 +0,0 @@ -package idxfile - -import ( - "bufio" - "bytes" - "errors" - "io" - - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/utils/binary" -) - -var ( - // ErrUnsupportedVersion is returned by Decode when the idx file version - // is not supported. - ErrUnsupportedVersion = errors.New("unsupported version") - // ErrMalformedIdxFile is returned by Decode when the idx file is corrupted. - ErrMalformedIdxFile = errors.New("malformed IDX file") -) - -const ( - fanout = 256 - objectIDLength = hash.Size -) - -// Decoder reads and decodes idx files from an input stream. -type Decoder struct { - *bufio.Reader -} - -// NewDecoder builds a new idx stream decoder, that reads from r. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{bufio.NewReader(r)} -} - -// Decode reads from the stream and decode the content into the MemoryIndex struct. -func (d *Decoder) Decode(idx *MemoryIndex) error { - if err := validateHeader(d); err != nil { - return err - } - - flow := []func(*MemoryIndex, io.Reader) error{ - readVersion, - readFanout, - readObjectNames, - readCRC32, - readOffsets, - readChecksums, - } - - for _, f := range flow { - if err := f(idx, d); err != nil { - return err - } - } - - return nil -} - -func validateHeader(r io.Reader) error { - var h = make([]byte, 4) - if _, err := io.ReadFull(r, h); err != nil { - return err - } - - if !bytes.Equal(h, idxHeader) { - return ErrMalformedIdxFile - } - - return nil -} - -func readVersion(idx *MemoryIndex, r io.Reader) error { - v, err := binary.ReadUint32(r) - if err != nil { - return err - } - - if v > VersionSupported { - return ErrUnsupportedVersion - } - - idx.Version = v - return nil -} - -func readFanout(idx *MemoryIndex, r io.Reader) error { - for k := 0; k < fanout; k++ { - n, err := binary.ReadUint32(r) - if err != nil { - return err - } - - idx.Fanout[k] = n - idx.FanoutMapping[k] = noMapping - } - - return nil -} - -func readObjectNames(idx *MemoryIndex, r io.Reader) error { - for k := 0; k < fanout; k++ { - var buckets uint32 - if k == 0 { - buckets = idx.Fanout[k] - } else { - buckets = idx.Fanout[k] - idx.Fanout[k-1] - } - - if buckets == 0 { - continue - } - - idx.FanoutMapping[k] = len(idx.Names) - - nameLen := int(buckets * objectIDLength) - bin := make([]byte, nameLen) - if _, err := io.ReadFull(r, bin); err != nil { - return err - } - - idx.Names = append(idx.Names, bin) - idx.Offset32 = append(idx.Offset32, make([]byte, buckets*4)) - idx.CRC32 = append(idx.CRC32, make([]byte, buckets*4)) - } - - return nil -} - -func readCRC32(idx *MemoryIndex, r io.Reader) error { - for k := 0; k < fanout; k++ { - if pos := idx.FanoutMapping[k]; pos != noMapping { - if _, err := io.ReadFull(r, idx.CRC32[pos]); err != nil { - return err - } - } - } - - return nil -} - -func readOffsets(idx *MemoryIndex, r io.Reader) error { - var o64cnt int - for k := 0; k < fanout; k++ { - if pos := idx.FanoutMapping[k]; pos != noMapping { - if _, err := io.ReadFull(r, idx.Offset32[pos]); err != nil { - return err - } - - for p := 0; p < len(idx.Offset32[pos]); p += 4 { - if idx.Offset32[pos][p]&(byte(1)<<7) > 0 { - o64cnt++ - } - } - } - } - - if o64cnt > 0 { - idx.Offset64 = make([]byte, o64cnt*8) - if _, err := io.ReadFull(r, idx.Offset64); err != nil { - return err - } - } - - return nil -} - -func readChecksums(idx *MemoryIndex, r io.Reader) error { - if _, err := io.ReadFull(r, idx.PackfileChecksum[:]); err != nil { - return err - } - - if _, err := io.ReadFull(r, idx.IdxChecksum[:]); err != nil { - return err - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go deleted file mode 100644 index 1e628ab4a5..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/doc.go +++ /dev/null @@ -1,128 +0,0 @@ -// Package idxfile implements encoding and decoding of packfile idx files. -// -// == Original (version 1) pack-*.idx files have the following format: -// -// - The header consists of 256 4-byte network byte order -// integers. N-th entry of this table records the number of -// objects in the corresponding pack, the first byte of whose -// object name is less than or equal to N. This is called the -// 'first-level fan-out' table. -// -// - The header is followed by sorted 24-byte entries, one entry -// per object in the pack. Each entry is: -// -// 4-byte network byte order integer, recording where the -// object is stored in the packfile as the offset from the -// beginning. -// -// 20-byte object name. -// -// - The file is concluded with a trailer: -// -// A copy of the 20-byte SHA1 checksum at the end of -// corresponding packfile. -// -// 20-byte SHA1-checksum of all of the above. -// -// Pack Idx file: -// -// -- +--------------------------------+ -// fanout | fanout[0] = 2 (for example) |-. -// table +--------------------------------+ | -// | fanout[1] | | -// +--------------------------------+ | -// | fanout[2] | | -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | -// | fanout[255] = total objects |---. -// -- +--------------------------------+ | | -// main | offset | | | -// index | object name 00XXXXXXXXXXXXXXXX | | | -// tab +--------------------------------+ | | -// | offset | | | -// | object name 00XXXXXXXXXXXXXXXX | | | -// +--------------------------------+<+ | -// .-| offset | | -// | | object name 01XXXXXXXXXXXXXXXX | | -// | +--------------------------------+ | -// | | offset | | -// | | object name 01XXXXXXXXXXXXXXXX | | -// | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | -// | | offset | | -// | | object name FFXXXXXXXXXXXXXXXX | | -// --| +--------------------------------+<--+ -// trailer | | packfile checksum | -// | +--------------------------------+ -// | | idxfile checksum | -// | +--------------------------------+ -// .---------. -// | -// Pack file entry: <+ -// -// packed object header: -// 1-byte size extension bit (MSB) -// type (next 3 bit) -// size0 (lower 4-bit) -// n-byte sizeN (as long as MSB is set, each 7-bit) -// size0..sizeN form 4+7+7+..+7 bit integer, size0 -// is the least significant part, and sizeN is the -// most significant part. -// packed object data: -// If it is not DELTA, then deflated bytes (the size above -// is the size before compression). -// If it is REF_DELTA, then -// 20-byte base object name SHA1 (the size above is the -// size of the delta data that follows). -// delta data, deflated. -// If it is OFS_DELTA, then -// n-byte offset (see below) interpreted as a negative -// offset from the type-byte of the header of the -// ofs-delta entry (the size above is the size of -// the delta data that follows). -// delta data, deflated. -// -// offset encoding: -// n bytes with MSB set in all but the last one. -// The offset is then the number constructed by -// concatenating the lower 7 bit of each byte, and -// for n >= 2 adding 2^7 + 2^14 + ... + 2^(7*(n-1)) -// to the result. -// -// == Version 2 pack-*.idx files support packs larger than 4 GiB, and -// have some other reorganizations. They have the format: -// -// - A 4-byte magic number '\377tOc' which is an unreasonable -// fanout[0] value. -// -// - A 4-byte version number (= 2) -// -// - A 256-entry fan-out table just like v1. -// -// - A table of sorted 20-byte SHA1 object names. These are -// packed together without offset values to reduce the cache -// footprint of the binary search for a specific object name. -// -// - A table of 4-byte CRC32 values of the packed object data. -// This is new in v2 so compressed data can be copied directly -// from pack to pack during repacking without undetected -// data corruption. -// -// - A table of 4-byte offset values (in network byte order). -// These are usually 31-bit pack file offsets, but large -// offsets are encoded as an index into the next table with -// the msbit set. -// -// - A table of 8-byte offset entries (empty for pack files less -// than 2 GiB). Pack files are organized with heavily used -// objects toward the front, so most object references should -// not need to refer to this table. -// -// - The same trailer as a v1 pack file: -// -// A copy of the 20-byte SHA1 checksum at the end of -// corresponding packfile. -// -// 20-byte SHA1-checksum of all of the above. -// -// Source: -// https://www.kernel.org/pub/software/scm/git/docs/v1.7.5/technical/pack-format.txt -package idxfile diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/encoder.go deleted file mode 100644 index 75147376b6..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/encoder.go +++ /dev/null @@ -1,141 +0,0 @@ -package idxfile - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/utils/binary" -) - -// Encoder writes MemoryIndex structs to an output stream. -type Encoder struct { - io.Writer - hash hash.Hash -} - -// NewEncoder returns a new stream encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - h := hash.New(hash.CryptoType) - mw := io.MultiWriter(w, h) - return &Encoder{mw, h} -} - -// Encode encodes an MemoryIndex to the encoder writer. -func (e *Encoder) Encode(idx *MemoryIndex) (int, error) { - flow := []func(*MemoryIndex) (int, error){ - e.encodeHeader, - e.encodeFanout, - e.encodeHashes, - e.encodeCRC32, - e.encodeOffsets, - e.encodeChecksums, - } - - sz := 0 - for _, f := range flow { - i, err := f(idx) - sz += i - - if err != nil { - return sz, err - } - } - - return sz, nil -} - -func (e *Encoder) encodeHeader(idx *MemoryIndex) (int, error) { - c, err := e.Write(idxHeader) - if err != nil { - return c, err - } - - return c + 4, binary.WriteUint32(e, idx.Version) -} - -func (e *Encoder) encodeFanout(idx *MemoryIndex) (int, error) { - for _, c := range idx.Fanout { - if err := binary.WriteUint32(e, c); err != nil { - return 0, err - } - } - - return fanout * 4, nil -} - -func (e *Encoder) encodeHashes(idx *MemoryIndex) (int, error) { - var size int - for k := 0; k < fanout; k++ { - pos := idx.FanoutMapping[k] - if pos == noMapping { - continue - } - - n, err := e.Write(idx.Names[pos]) - if err != nil { - return size, err - } - size += n - } - return size, nil -} - -func (e *Encoder) encodeCRC32(idx *MemoryIndex) (int, error) { - var size int - for k := 0; k < fanout; k++ { - pos := idx.FanoutMapping[k] - if pos == noMapping { - continue - } - - n, err := e.Write(idx.CRC32[pos]) - if err != nil { - return size, err - } - - size += n - } - - return size, nil -} - -func (e *Encoder) encodeOffsets(idx *MemoryIndex) (int, error) { - var size int - for k := 0; k < fanout; k++ { - pos := idx.FanoutMapping[k] - if pos == noMapping { - continue - } - - n, err := e.Write(idx.Offset32[pos]) - if err != nil { - return size, err - } - - size += n - } - - if len(idx.Offset64) > 0 { - n, err := e.Write(idx.Offset64) - if err != nil { - return size, err - } - - size += n - } - - return size, nil -} - -func (e *Encoder) encodeChecksums(idx *MemoryIndex) (int, error) { - if _, err := e.Write(idx.PackfileChecksum[:]); err != nil { - return 0, err - } - - copy(idx.IdxChecksum[:], e.hash.Sum(nil)[:hash.Size]) - if _, err := e.Write(idx.IdxChecksum[:]); err != nil { - return 0, err - } - - return hash.HexSize, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/idxfile.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/idxfile.go deleted file mode 100644 index 9237a74342..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/idxfile.go +++ /dev/null @@ -1,347 +0,0 @@ -package idxfile - -import ( - "bytes" - "io" - "sort" - - encbin "encoding/binary" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/hash" -) - -const ( - // VersionSupported is the only idx version supported. - VersionSupported = 2 - - noMapping = -1 -) - -var ( - idxHeader = []byte{255, 't', 'O', 'c'} -) - -// Index represents an index of a packfile. -type Index interface { - // Contains checks whether the given hash is in the index. - Contains(h plumbing.Hash) (bool, error) - // FindOffset finds the offset in the packfile for the object with - // the given hash. - FindOffset(h plumbing.Hash) (int64, error) - // FindCRC32 finds the CRC32 of the object with the given hash. - FindCRC32(h plumbing.Hash) (uint32, error) - // FindHash finds the hash for the object with the given offset. - FindHash(o int64) (plumbing.Hash, error) - // Count returns the number of entries in the index. - Count() (int64, error) - // Entries returns an iterator to retrieve all index entries. - Entries() (EntryIter, error) - // EntriesByOffset returns an iterator to retrieve all index entries ordered - // by offset. - EntriesByOffset() (EntryIter, error) -} - -// MemoryIndex is the in memory representation of an idx file. -type MemoryIndex struct { - Version uint32 - Fanout [256]uint32 - // FanoutMapping maps the position in the fanout table to the position - // in the Names, Offset32 and CRC32 slices. This improves the memory - // usage by not needing an array with unnecessary empty slots. - FanoutMapping [256]int - Names [][]byte - Offset32 [][]byte - CRC32 [][]byte - Offset64 []byte - PackfileChecksum [hash.Size]byte - IdxChecksum [hash.Size]byte - - offsetHash map[int64]plumbing.Hash - offsetHashIsFull bool -} - -var _ Index = (*MemoryIndex)(nil) - -// NewMemoryIndex returns an instance of a new MemoryIndex. -func NewMemoryIndex() *MemoryIndex { - return &MemoryIndex{} -} - -func (idx *MemoryIndex) findHashIndex(h plumbing.Hash) (int, bool) { - k := idx.FanoutMapping[h[0]] - if k == noMapping { - return 0, false - } - - if len(idx.Names) <= k { - return 0, false - } - - data := idx.Names[k] - high := uint64(len(idx.Offset32[k])) >> 2 - if high == 0 { - return 0, false - } - - low := uint64(0) - for { - mid := (low + high) >> 1 - offset := mid * objectIDLength - - cmp := bytes.Compare(h[:], data[offset:offset+objectIDLength]) - if cmp < 0 { - high = mid - } else if cmp == 0 { - return int(mid), true - } else { - low = mid + 1 - } - - if low >= high { - break - } - } - - return 0, false -} - -// Contains implements the Index interface. -func (idx *MemoryIndex) Contains(h plumbing.Hash) (bool, error) { - _, ok := idx.findHashIndex(h) - return ok, nil -} - -// FindOffset implements the Index interface. -func (idx *MemoryIndex) FindOffset(h plumbing.Hash) (int64, error) { - if len(idx.FanoutMapping) <= int(h[0]) { - return 0, plumbing.ErrObjectNotFound - } - - k := idx.FanoutMapping[h[0]] - i, ok := idx.findHashIndex(h) - if !ok { - return 0, plumbing.ErrObjectNotFound - } - - offset := idx.getOffset(k, i) - - if !idx.offsetHashIsFull { - // Save the offset for reverse lookup - if idx.offsetHash == nil { - idx.offsetHash = make(map[int64]plumbing.Hash) - } - idx.offsetHash[int64(offset)] = h - } - - return int64(offset), nil -} - -const isO64Mask = uint64(1) << 31 - -func (idx *MemoryIndex) getOffset(firstLevel, secondLevel int) uint64 { - offset := secondLevel << 2 - ofs := encbin.BigEndian.Uint32(idx.Offset32[firstLevel][offset : offset+4]) - - if (uint64(ofs) & isO64Mask) != 0 { - offset := 8 * (uint64(ofs) & ^isO64Mask) - n := encbin.BigEndian.Uint64(idx.Offset64[offset : offset+8]) - return n - } - - return uint64(ofs) -} - -// FindCRC32 implements the Index interface. -func (idx *MemoryIndex) FindCRC32(h plumbing.Hash) (uint32, error) { - k := idx.FanoutMapping[h[0]] - i, ok := idx.findHashIndex(h) - if !ok { - return 0, plumbing.ErrObjectNotFound - } - - return idx.getCRC32(k, i), nil -} - -func (idx *MemoryIndex) getCRC32(firstLevel, secondLevel int) uint32 { - offset := secondLevel << 2 - return encbin.BigEndian.Uint32(idx.CRC32[firstLevel][offset : offset+4]) -} - -// FindHash implements the Index interface. -func (idx *MemoryIndex) FindHash(o int64) (plumbing.Hash, error) { - var hash plumbing.Hash - var ok bool - - if idx.offsetHash != nil { - if hash, ok = idx.offsetHash[o]; ok { - return hash, nil - } - } - - // Lazily generate the reverse offset/hash map if required. - if !idx.offsetHashIsFull || idx.offsetHash == nil { - if err := idx.genOffsetHash(); err != nil { - return plumbing.ZeroHash, err - } - - hash, ok = idx.offsetHash[o] - } - - if !ok { - return plumbing.ZeroHash, plumbing.ErrObjectNotFound - } - - return hash, nil -} - -// genOffsetHash generates the offset/hash mapping for reverse search. -func (idx *MemoryIndex) genOffsetHash() error { - count, err := idx.Count() - if err != nil { - return err - } - - idx.offsetHash = make(map[int64]plumbing.Hash, count) - idx.offsetHashIsFull = true - - var hash plumbing.Hash - i := uint32(0) - for firstLevel, fanoutValue := range idx.Fanout { - mappedFirstLevel := idx.FanoutMapping[firstLevel] - for secondLevel := uint32(0); i < fanoutValue; i++ { - copy(hash[:], idx.Names[mappedFirstLevel][secondLevel*objectIDLength:]) - offset := int64(idx.getOffset(mappedFirstLevel, int(secondLevel))) - idx.offsetHash[offset] = hash - secondLevel++ - } - } - - return nil -} - -// Count implements the Index interface. -func (idx *MemoryIndex) Count() (int64, error) { - return int64(idx.Fanout[fanout-1]), nil -} - -// Entries implements the Index interface. -func (idx *MemoryIndex) Entries() (EntryIter, error) { - return &idxfileEntryIter{idx, 0, 0, 0}, nil -} - -// EntriesByOffset implements the Index interface. -func (idx *MemoryIndex) EntriesByOffset() (EntryIter, error) { - count, err := idx.Count() - if err != nil { - return nil, err - } - - iter := &idxfileEntryOffsetIter{ - entries: make(entriesByOffset, count), - } - - entries, err := idx.Entries() - if err != nil { - return nil, err - } - - for pos := 0; int64(pos) < count; pos++ { - entry, err := entries.Next() - if err != nil { - return nil, err - } - - iter.entries[pos] = entry - } - - sort.Sort(iter.entries) - - return iter, nil -} - -// EntryIter is an iterator that will return the entries in a packfile index. -type EntryIter interface { - // Next returns the next entry in the packfile index. - Next() (*Entry, error) - // Close closes the iterator. - Close() error -} - -type idxfileEntryIter struct { - idx *MemoryIndex - total int - firstLevel, secondLevel int -} - -func (i *idxfileEntryIter) Next() (*Entry, error) { - for { - if i.firstLevel >= fanout { - return nil, io.EOF - } - - if i.total >= int(i.idx.Fanout[i.firstLevel]) { - i.firstLevel++ - i.secondLevel = 0 - continue - } - - mappedFirstLevel := i.idx.FanoutMapping[i.firstLevel] - entry := new(Entry) - copy(entry.Hash[:], i.idx.Names[mappedFirstLevel][i.secondLevel*objectIDLength:]) - entry.Offset = i.idx.getOffset(mappedFirstLevel, i.secondLevel) - entry.CRC32 = i.idx.getCRC32(mappedFirstLevel, i.secondLevel) - - i.secondLevel++ - i.total++ - - return entry, nil - } -} - -func (i *idxfileEntryIter) Close() error { - i.firstLevel = fanout - return nil -} - -// Entry is the in memory representation of an object entry in the idx file. -type Entry struct { - Hash plumbing.Hash - CRC32 uint32 - Offset uint64 -} - -type idxfileEntryOffsetIter struct { - entries entriesByOffset - pos int -} - -func (i *idxfileEntryOffsetIter) Next() (*Entry, error) { - if i.pos >= len(i.entries) { - return nil, io.EOF - } - - entry := i.entries[i.pos] - i.pos++ - - return entry, nil -} - -func (i *idxfileEntryOffsetIter) Close() error { - i.pos = len(i.entries) + 1 - return nil -} - -type entriesByOffset []*Entry - -func (o entriesByOffset) Len() int { - return len(o) -} - -func (o entriesByOffset) Less(i int, j int) bool { - return o[i].Offset < o[j].Offset -} - -func (o entriesByOffset) Swap(i int, j int) { - o[i], o[j] = o[j], o[i] -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/writer.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/writer.go deleted file mode 100644 index c4c21e1676..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/idxfile/writer.go +++ /dev/null @@ -1,193 +0,0 @@ -package idxfile - -import ( - "bytes" - "fmt" - "math" - "sort" - "sync" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/binary" -) - -// objects implements sort.Interface and uses hash as sorting key. -type objects []Entry - -// Writer implements a packfile Observer interface and is used to generate -// indexes. -type Writer struct { - m sync.Mutex - - count uint32 - checksum plumbing.Hash - objects objects - offset64 uint32 - finished bool - index *MemoryIndex - added map[plumbing.Hash]struct{} -} - -// Index returns a previously created MemoryIndex or creates a new one if -// needed. -func (w *Writer) Index() (*MemoryIndex, error) { - w.m.Lock() - defer w.m.Unlock() - - if w.index == nil { - return w.createIndex() - } - - return w.index, nil -} - -// Add appends new object data. -func (w *Writer) Add(h plumbing.Hash, pos uint64, crc uint32) { - w.m.Lock() - defer w.m.Unlock() - - if w.added == nil { - w.added = make(map[plumbing.Hash]struct{}) - } - - if _, ok := w.added[h]; !ok { - w.added[h] = struct{}{} - w.objects = append(w.objects, Entry{h, crc, pos}) - } - -} - -func (w *Writer) Finished() bool { - return w.finished -} - -// OnHeader implements packfile.Observer interface. -func (w *Writer) OnHeader(count uint32) error { - w.count = count - w.objects = make(objects, 0, count) - return nil -} - -// OnInflatedObjectHeader implements packfile.Observer interface. -func (w *Writer) OnInflatedObjectHeader(t plumbing.ObjectType, objSize int64, pos int64) error { - return nil -} - -// OnInflatedObjectContent implements packfile.Observer interface. -func (w *Writer) OnInflatedObjectContent(h plumbing.Hash, pos int64, crc uint32, _ []byte) error { - w.Add(h, uint64(pos), crc) - return nil -} - -// OnFooter implements packfile.Observer interface. -func (w *Writer) OnFooter(h plumbing.Hash) error { - w.checksum = h - w.finished = true - _, err := w.createIndex() - - return err -} - -// creatIndex returns a filled MemoryIndex with the information filled by -// the observer callbacks. -func (w *Writer) createIndex() (*MemoryIndex, error) { - if !w.finished { - return nil, fmt.Errorf("the index still hasn't finished building") - } - - idx := new(MemoryIndex) - w.index = idx - - sort.Sort(w.objects) - - // unmap all fans by default - for i := range idx.FanoutMapping { - idx.FanoutMapping[i] = noMapping - } - - buf := new(bytes.Buffer) - - last := -1 - bucket := -1 - for i, o := range w.objects { - fan := o.Hash[0] - - // fill the gaps between fans - for j := last + 1; j < int(fan); j++ { - idx.Fanout[j] = uint32(i) - } - - // update the number of objects for this position - idx.Fanout[fan] = uint32(i + 1) - - // we move from one bucket to another, update counters and allocate - // memory - if last != int(fan) { - bucket++ - idx.FanoutMapping[fan] = bucket - last = int(fan) - - idx.Names = append(idx.Names, make([]byte, 0)) - idx.Offset32 = append(idx.Offset32, make([]byte, 0)) - idx.CRC32 = append(idx.CRC32, make([]byte, 0)) - } - - idx.Names[bucket] = append(idx.Names[bucket], o.Hash[:]...) - - offset := o.Offset - if offset > math.MaxInt32 { - var err error - offset, err = w.addOffset64(offset) - if err != nil { - return nil, err - } - } - - buf.Truncate(0) - if err := binary.WriteUint32(buf, uint32(offset)); err != nil { - return nil, err - } - idx.Offset32[bucket] = append(idx.Offset32[bucket], buf.Bytes()...) - - buf.Truncate(0) - if err := binary.WriteUint32(buf, o.CRC32); err != nil { - return nil, err - } - idx.CRC32[bucket] = append(idx.CRC32[bucket], buf.Bytes()...) - } - - for j := last + 1; j < 256; j++ { - idx.Fanout[j] = uint32(len(w.objects)) - } - - idx.Version = VersionSupported - idx.PackfileChecksum = w.checksum - - return idx, nil -} - -func (w *Writer) addOffset64(pos uint64) (uint64, error) { - buf := new(bytes.Buffer) - if err := binary.WriteUint64(buf, pos); err != nil { - return 0, err - } - - w.index.Offset64 = append(w.index.Offset64, buf.Bytes()...) - index := uint64(w.offset64 | (1 << 31)) - w.offset64++ - - return index, nil -} - -func (o objects) Len() int { - return len(o) -} - -func (o objects) Less(i int, j int) bool { - cmp := bytes.Compare(o[i].Hash[:], o[j].Hash[:]) - return cmp < 0 -} - -func (o objects) Swap(i int, j int) { - o[i], o[j] = o[j], o[i] -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/decoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/index/decoder.go deleted file mode 100644 index 6778cf74ec..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/decoder.go +++ /dev/null @@ -1,478 +0,0 @@ -package index - -import ( - "bufio" - "bytes" - "errors" - "io" - - "strconv" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/utils/binary" -) - -var ( - // DecodeVersionSupported is the range of supported index versions - DecodeVersionSupported = struct{ Min, Max uint32 }{Min: 2, Max: 4} - - // ErrMalformedSignature is returned by Decode when the index header file is - // malformed - ErrMalformedSignature = errors.New("malformed index signature file") - // ErrInvalidChecksum is returned by Decode if the SHA1 hash mismatch with - // the read content - ErrInvalidChecksum = errors.New("invalid checksum") - - errUnknownExtension = errors.New("unknown extension") -) - -const ( - entryHeaderLength = 62 - entryExtended = 0x4000 - entryValid = 0x8000 - nameMask = 0xfff - intentToAddMask = 1 << 13 - skipWorkTreeMask = 1 << 14 -) - -// A Decoder reads and decodes index files from an input stream. -type Decoder struct { - r io.Reader - hash hash.Hash - lastEntry *Entry - - extReader *bufio.Reader -} - -// NewDecoder returns a new decoder that reads from r. -func NewDecoder(r io.Reader) *Decoder { - h := hash.New(hash.CryptoType) - return &Decoder{ - r: io.TeeReader(r, h), - hash: h, - extReader: bufio.NewReader(nil), - } -} - -// Decode reads the whole index object from its input and stores it in the -// value pointed to by idx. -func (d *Decoder) Decode(idx *Index) error { - var err error - idx.Version, err = validateHeader(d.r) - if err != nil { - return err - } - - entryCount, err := binary.ReadUint32(d.r) - if err != nil { - return err - } - - if err := d.readEntries(idx, int(entryCount)); err != nil { - return err - } - - return d.readExtensions(idx) -} - -func (d *Decoder) readEntries(idx *Index, count int) error { - for i := 0; i < count; i++ { - e, err := d.readEntry(idx) - if err != nil { - return err - } - - d.lastEntry = e - idx.Entries = append(idx.Entries, e) - } - - return nil -} - -func (d *Decoder) readEntry(idx *Index) (*Entry, error) { - e := &Entry{} - - var msec, mnsec, sec, nsec uint32 - var flags uint16 - - flow := []interface{}{ - &sec, &nsec, - &msec, &mnsec, - &e.Dev, - &e.Inode, - &e.Mode, - &e.UID, - &e.GID, - &e.Size, - &e.Hash, - &flags, - } - - if err := binary.Read(d.r, flow...); err != nil { - return nil, err - } - - read := entryHeaderLength - - if sec != 0 || nsec != 0 { - e.CreatedAt = time.Unix(int64(sec), int64(nsec)) - } - - if msec != 0 || mnsec != 0 { - e.ModifiedAt = time.Unix(int64(msec), int64(mnsec)) - } - - e.Stage = Stage(flags>>12) & 0x3 - - if flags&entryExtended != 0 { - extended, err := binary.ReadUint16(d.r) - if err != nil { - return nil, err - } - - read += 2 - e.IntentToAdd = extended&intentToAddMask != 0 - e.SkipWorktree = extended&skipWorkTreeMask != 0 - } - - if err := d.readEntryName(idx, e, flags); err != nil { - return nil, err - } - - return e, d.padEntry(idx, e, read) -} - -func (d *Decoder) readEntryName(idx *Index, e *Entry, flags uint16) error { - var name string - var err error - - switch idx.Version { - case 2, 3: - len := flags & nameMask - name, err = d.doReadEntryName(len) - case 4: - name, err = d.doReadEntryNameV4() - default: - return ErrUnsupportedVersion - } - - if err != nil { - return err - } - - e.Name = name - return nil -} - -func (d *Decoder) doReadEntryNameV4() (string, error) { - l, err := binary.ReadVariableWidthInt(d.r) - if err != nil { - return "", err - } - - var base string - if d.lastEntry != nil { - base = d.lastEntry.Name[:len(d.lastEntry.Name)-int(l)] - } - - name, err := binary.ReadUntil(d.r, '\x00') - if err != nil { - return "", err - } - - return base + string(name), nil -} - -func (d *Decoder) doReadEntryName(len uint16) (string, error) { - name := make([]byte, len) - _, err := io.ReadFull(d.r, name) - - return string(name), err -} - -// Index entries are padded out to the next 8 byte alignment -// for historical reasons related to how C Git read the files. -func (d *Decoder) padEntry(idx *Index, e *Entry, read int) error { - if idx.Version == 4 { - return nil - } - - entrySize := read + len(e.Name) - padLen := 8 - entrySize%8 - _, err := io.CopyN(io.Discard, d.r, int64(padLen)) - return err -} - -func (d *Decoder) readExtensions(idx *Index) error { - // TODO: support 'Split index' and 'Untracked cache' extensions, take in - // count that they are not supported by jgit or libgit - - var expected []byte - var err error - - var header [4]byte - for { - expected = d.hash.Sum(nil) - - var n int - if n, err = io.ReadFull(d.r, header[:]); err != nil { - if n == 0 { - err = io.EOF - } - - break - } - - err = d.readExtension(idx, header[:]) - if err != nil { - break - } - } - - if err != errUnknownExtension { - return err - } - - return d.readChecksum(expected, header) -} - -func (d *Decoder) readExtension(idx *Index, header []byte) error { - switch { - case bytes.Equal(header, treeExtSignature): - r, err := d.getExtensionReader() - if err != nil { - return err - } - - idx.Cache = &Tree{} - d := &treeExtensionDecoder{r} - if err := d.Decode(idx.Cache); err != nil { - return err - } - case bytes.Equal(header, resolveUndoExtSignature): - r, err := d.getExtensionReader() - if err != nil { - return err - } - - idx.ResolveUndo = &ResolveUndo{} - d := &resolveUndoDecoder{r} - if err := d.Decode(idx.ResolveUndo); err != nil { - return err - } - case bytes.Equal(header, endOfIndexEntryExtSignature): - r, err := d.getExtensionReader() - if err != nil { - return err - } - - idx.EndOfIndexEntry = &EndOfIndexEntry{} - d := &endOfIndexEntryDecoder{r} - if err := d.Decode(idx.EndOfIndexEntry); err != nil { - return err - } - default: - return errUnknownExtension - } - - return nil -} - -func (d *Decoder) getExtensionReader() (*bufio.Reader, error) { - len, err := binary.ReadUint32(d.r) - if err != nil { - return nil, err - } - - d.extReader.Reset(&io.LimitedReader{R: d.r, N: int64(len)}) - return d.extReader, nil -} - -func (d *Decoder) readChecksum(expected []byte, alreadyRead [4]byte) error { - var h plumbing.Hash - copy(h[:4], alreadyRead[:]) - - if _, err := io.ReadFull(d.r, h[4:]); err != nil { - return err - } - - if !bytes.Equal(h[:], expected) { - return ErrInvalidChecksum - } - - return nil -} - -func validateHeader(r io.Reader) (version uint32, err error) { - var s = make([]byte, 4) - if _, err := io.ReadFull(r, s); err != nil { - return 0, err - } - - if !bytes.Equal(s, indexSignature) { - return 0, ErrMalformedSignature - } - - version, err = binary.ReadUint32(r) - if err != nil { - return 0, err - } - - if version < DecodeVersionSupported.Min || version > DecodeVersionSupported.Max { - return 0, ErrUnsupportedVersion - } - - return -} - -type treeExtensionDecoder struct { - r *bufio.Reader -} - -func (d *treeExtensionDecoder) Decode(t *Tree) error { - for { - e, err := d.readEntry() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - if e == nil { - continue - } - - t.Entries = append(t.Entries, *e) - } -} - -func (d *treeExtensionDecoder) readEntry() (*TreeEntry, error) { - e := &TreeEntry{} - - path, err := binary.ReadUntil(d.r, '\x00') - if err != nil { - return nil, err - } - - e.Path = string(path) - - count, err := binary.ReadUntil(d.r, ' ') - if err != nil { - return nil, err - } - - i, err := strconv.Atoi(string(count)) - if err != nil { - return nil, err - } - - // An entry can be in an invalidated state and is represented by having a - // negative number in the entry_count field. - if i == -1 { - return nil, nil - } - - e.Entries = i - trees, err := binary.ReadUntil(d.r, '\n') - if err != nil { - return nil, err - } - - i, err = strconv.Atoi(string(trees)) - if err != nil { - return nil, err - } - - e.Trees = i - _, err = io.ReadFull(d.r, e.Hash[:]) - if err != nil { - return nil, err - } - return e, nil -} - -type resolveUndoDecoder struct { - r *bufio.Reader -} - -func (d *resolveUndoDecoder) Decode(ru *ResolveUndo) error { - for { - e, err := d.readEntry() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - ru.Entries = append(ru.Entries, *e) - } -} - -func (d *resolveUndoDecoder) readEntry() (*ResolveUndoEntry, error) { - e := &ResolveUndoEntry{ - Stages: make(map[Stage]plumbing.Hash), - } - - path, err := binary.ReadUntil(d.r, '\x00') - if err != nil { - return nil, err - } - - e.Path = string(path) - - for i := 0; i < 3; i++ { - if err := d.readStage(e, Stage(i+1)); err != nil { - return nil, err - } - } - - for s := range e.Stages { - var hash plumbing.Hash - if _, err := io.ReadFull(d.r, hash[:]); err != nil { - return nil, err - } - - e.Stages[s] = hash - } - - return e, nil -} - -func (d *resolveUndoDecoder) readStage(e *ResolveUndoEntry, s Stage) error { - ascii, err := binary.ReadUntil(d.r, '\x00') - if err != nil { - return err - } - - stage, err := strconv.ParseInt(string(ascii), 8, 64) - if err != nil { - return err - } - - if stage != 0 { - e.Stages[s] = plumbing.ZeroHash - } - - return nil -} - -type endOfIndexEntryDecoder struct { - r *bufio.Reader -} - -func (d *endOfIndexEntryDecoder) Decode(e *EndOfIndexEntry) error { - var err error - e.Offset, err = binary.ReadUint32(d.r) - if err != nil { - return err - } - - _, err = io.ReadFull(d.r, e.Hash[:]) - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go deleted file mode 100644 index 39ae6ad5f9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/doc.go +++ /dev/null @@ -1,360 +0,0 @@ -// Package index implements encoding and decoding of index format files. -// -// Git index format -// ================ -// -// == The Git index file has the following format -// -// All binary numbers are in network byte order. Version 2 is described -// here unless stated otherwise. -// -// - A 12-byte header consisting of -// -// 4-byte signature: -// The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache") -// -// 4-byte version number: -// The current supported versions are 2, 3 and 4. -// -// 32-bit number of index entries. -// -// - A number of sorted index entries (see below). -// -// - Extensions -// -// Extensions are identified by signature. Optional extensions can -// be ignored if Git does not understand them. -// -// Git currently supports cached tree and resolve undo extensions. -// -// 4-byte extension signature. If the first byte is 'A'..'Z' the -// extension is optional and can be ignored. -// -// 32-bit size of the extension -// -// Extension data -// -// - 160-bit SHA-1 over the content of the index file before this -// checksum. -// -// == Index entry -// -// Index entries are sorted in ascending order on the name field, -// interpreted as a string of unsigned bytes (i.e. memcmp() order, no -// localization, no special casing of directory separator '/'). Entries -// with the same name are sorted by their stage field. -// -// 32-bit ctime seconds, the last time a file's metadata changed -// this is stat(2) data -// -// 32-bit ctime nanosecond fractions -// this is stat(2) data -// -// 32-bit mtime seconds, the last time a file's data changed -// this is stat(2) data -// -// 32-bit mtime nanosecond fractions -// this is stat(2) data -// -// 32-bit dev -// this is stat(2) data -// -// 32-bit ino -// this is stat(2) data -// -// 32-bit mode, split into (high to low bits) -// -// 4-bit object type -// valid values in binary are 1000 (regular file), 1010 (symbolic link) -// and 1110 (gitlink) -// -// 3-bit unused -// -// 9-bit unix permission. Only 0755 and 0644 are valid for regular files. -// Symbolic links and gitlinks have value 0 in this field. -// -// 32-bit uid -// this is stat(2) data -// -// 32-bit gid -// this is stat(2) data -// -// 32-bit file size -// This is the on-disk size from stat(2), truncated to 32-bit. -// -// 160-bit SHA-1 for the represented object -// -// A 16-bit 'flags' field split into (high to low bits) -// -// 1-bit assume-valid flag -// -// 1-bit extended flag (must be zero in version 2) -// -// 2-bit stage (during merge) -// -// 12-bit name length if the length is less than 0xFFF; otherwise 0xFFF -// is stored in this field. -// -// (Version 3 or later) A 16-bit field, only applicable if the -// "extended flag" above is 1, split into (high to low bits). -// -// 1-bit reserved for future -// -// 1-bit skip-worktree flag (used by sparse checkout) -// -// 1-bit intent-to-add flag (used by "git add -N") -// -// 13-bit unused, must be zero -// -// Entry path name (variable length) relative to top level directory -// (without leading slash). '/' is used as path separator. The special -// path components ".", ".." and ".git" (without quotes) are disallowed. -// Trailing slash is also disallowed. -// -// The exact encoding is undefined, but the '.' and '/' characters -// are encoded in 7-bit ASCII and the encoding cannot contain a NUL -// byte (iow, this is a UNIX pathname). -// -// (Version 4) In version 4, the entry path name is prefix-compressed -// relative to the path name for the previous entry (the very first -// entry is encoded as if the path name for the previous entry is an -// empty string). At the beginning of an entry, an integer N in the -// variable width encoding (the same encoding as the offset is encoded -// for OFS_DELTA pack entries; see pack-format.txt) is stored, followed -// by a NUL-terminated string S. Removing N bytes from the end of the -// path name for the previous entry, and replacing it with the string S -// yields the path name for this entry. -// -// 1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes -// while keeping the name NUL-terminated. -// -// (Version 4) In version 4, the padding after the pathname does not -// exist. -// -// Interpretation of index entries in split index mode is completely -// different. See below for details. -// -// == Extensions -// -// === Cached tree -// -// Cached tree extension contains pre-computed hashes for trees that can -// be derived from the index. It helps speed up tree object generation -// from index for a new commit. -// -// When a path is updated in index, the path must be invalidated and -// removed from tree cache. -// -// The signature for this extension is { 'T', 'R', 'E', 'E' }. -// -// A series of entries fill the entire extension; each of which -// consists of: -// -// - NUL-terminated path component (relative to its parent directory); -// -// - ASCII decimal number of entries in the index that is covered by the -// tree this entry represents (entry_count); -// -// - A space (ASCII 32); -// -// - ASCII decimal number that represents the number of subtrees this -// tree has; -// -// - A newline (ASCII 10); and -// -// - 160-bit object name for the object that would result from writing -// this span of index as a tree. -// -// An entry can be in an invalidated state and is represented by having -// a negative number in the entry_count field. In this case, there is no -// object name and the next entry starts immediately after the newline. -// When writing an invalid entry, -1 should always be used as entry_count. -// -// The entries are written out in the top-down, depth-first order. The -// first entry represents the root level of the repository, followed by the -// first subtree--let's call this A--of the root level (with its name -// relative to the root level), followed by the first subtree of A (with -// its name relative to A), ... -// -// === Resolve undo -// -// A conflict is represented in the index as a set of higher stage entries. -// When a conflict is resolved (e.g. with "git add path"), these higher -// stage entries will be removed and a stage-0 entry with proper resolution -// is added. -// -// When these higher stage entries are removed, they are saved in the -// resolve undo extension, so that conflicts can be recreated (e.g. with -// "git checkout -m"), in case users want to redo a conflict resolution -// from scratch. -// -// The signature for this extension is { 'R', 'E', 'U', 'C' }. -// -// A series of entries fill the entire extension; each of which -// consists of: -// -// - NUL-terminated pathname the entry describes (relative to the root of -// the repository, i.e. full pathname); -// -// - Three NUL-terminated ASCII octal numbers, entry mode of entries in -// stage 1 to 3 (a missing stage is represented by "0" in this field); -// and -// -// - At most three 160-bit object names of the entry in stages from 1 to 3 -// (nothing is written for a missing stage). -// -// === Split index -// -// In split index mode, the majority of index entries could be stored -// in a separate file. This extension records the changes to be made on -// top of that to produce the final index. -// -// The signature for this extension is { 'l', 'i', 'n', 'k' }. -// -// The extension consists of: -// -// - 160-bit SHA-1 of the shared index file. The shared index file path -// is $GIT_DIR/sharedindex.. If all 160 bits are zero, the -// index does not require a shared index file. -// -// - An ewah-encoded delete bitmap, each bit represents an entry in the -// shared index. If a bit is set, its corresponding entry in the -// shared index will be removed from the final index. Note, because -// a delete operation changes index entry positions, but we do need -// original positions in replace phase, it's best to just mark -// entries for removal, then do a mass deletion after replacement. -// -// - An ewah-encoded replace bitmap, each bit represents an entry in -// the shared index. If a bit is set, its corresponding entry in the -// shared index will be replaced with an entry in this index -// file. All replaced entries are stored in sorted order in this -// index. The first "1" bit in the replace bitmap corresponds to the -// first index entry, the second "1" bit to the second entry and so -// on. Replaced entries may have empty path names to save space. -// -// The remaining index entries after replaced ones will be added to the -// final index. These added entries are also sorted by entry name then -// stage. -// -// == Untracked cache -// -// Untracked cache saves the untracked file list and necessary data to -// verify the cache. The signature for this extension is { 'U', 'N', -// 'T', 'R' }. -// -// The extension starts with -// -// - A sequence of NUL-terminated strings, preceded by the size of the -// sequence in variable width encoding. Each string describes the -// environment where the cache can be used. -// -// - Stat data of $GIT_DIR/info/exclude. See "Index entry" section from -// ctime field until "file size". -// -// - Stat data of plumbing.excludesfile -// -// - 32-bit dir_flags (see struct dir_struct) -// -// - 160-bit SHA-1 of $GIT_DIR/info/exclude. Null SHA-1 means the file -// does not exist. -// -// - 160-bit SHA-1 of plumbing.excludesfile. Null SHA-1 means the file does -// not exist. -// -// - NUL-terminated string of per-dir exclude file name. This usually -// is ".gitignore". -// -// - The number of following directory blocks, variable width -// encoding. If this number is zero, the extension ends here with a -// following NUL. -// -// - A number of directory blocks in depth-first-search order, each -// consists of -// -// - The number of untracked entries, variable width encoding. -// -// - The number of sub-directory blocks, variable width encoding. -// -// - The directory name terminated by NUL. -// -// - A number of untracked file/dir names terminated by NUL. -// -// The remaining data of each directory block is grouped by type: -// -// - An ewah bitmap, the n-th bit marks whether the n-th directory has -// valid untracked cache entries. -// -// - An ewah bitmap, the n-th bit records "check-only" bit of -// read_directory_recursive() for the n-th directory. -// -// - An ewah bitmap, the n-th bit indicates whether SHA-1 and stat data -// is valid for the n-th directory and exists in the next data. -// -// - An array of stat data. The n-th data corresponds with the n-th -// "one" bit in the previous ewah bitmap. -// -// - An array of SHA-1. The n-th SHA-1 corresponds with the n-th "one" bit -// in the previous ewah bitmap. -// -// - One NUL. -// -// == File System Monitor cache -// -// The file system monitor cache tracks files for which the core.fsmonitor -// hook has told us about changes. The signature for this extension is -// { 'F', 'S', 'M', 'N' }. -// -// The extension starts with -// -// - 32-bit version number: the current supported version is 1. -// -// - 64-bit time: the extension data reflects all changes through the given -// time which is stored as the nanoseconds elapsed since midnight, -// January 1, 1970. -// -// - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap. -// -// - An ewah bitmap, the n-th bit indicates whether the n-th index entry -// is not CE_FSMONITOR_VALID. -// -// == End of Index Entry -// -// The End of Index Entry (EOIE) is used to locate the end of the variable -// length index entries and the beginning of the extensions. Code can take -// advantage of this to quickly locate the index extensions without having -// to parse through all of the index entries. -// -// Because it must be able to be loaded before the variable length cache -// entries and other index extensions, this extension must be written last. -// The signature for this extension is { 'E', 'O', 'I', 'E' }. -// -// The extension consists of: -// -// - 32-bit offset to the end of the index entries -// -// - 160-bit SHA-1 over the extension types and their sizes (but not -// their contents). E.g. if we have "TREE" extension that is N-bytes -// long, "REUC" extension that is M-bytes long, followed by "EOIE", -// then the hash would be: -// -// SHA-1("TREE" + + -// "REUC" + ) -// -// == Index Entry Offset Table -// -// The Index Entry Offset Table (IEOT) is used to help address the CPU -// cost of loading the index by enabling multi-threading the process of -// converting cache entries from the on-disk format to the in-memory format. -// The signature for this extension is { 'I', 'E', 'O', 'T' }. -// -// The extension consists of: -// -// - 32-bit version (currently 1) -// -// - A number of index offset entries each consisting of: -// -// - 32-bit offset from the beginning of the file to the first cache entry -// in this block of entries. -// -// - 32-bit count of cache entries in this blockpackage index -package index diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/index/encoder.go deleted file mode 100644 index fa2d814454..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/encoder.go +++ /dev/null @@ -1,165 +0,0 @@ -package index - -import ( - "bytes" - "errors" - "io" - "sort" - "time" - - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/utils/binary" -) - -var ( - // EncodeVersionSupported is the range of supported index versions - EncodeVersionSupported uint32 = 3 - - // ErrInvalidTimestamp is returned by Encode if a Index with a Entry with - // negative timestamp values - ErrInvalidTimestamp = errors.New("negative timestamps are not allowed") -) - -// An Encoder writes an Index to an output stream. -type Encoder struct { - w io.Writer - hash hash.Hash -} - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - h := hash.New(hash.CryptoType) - mw := io.MultiWriter(w, h) - return &Encoder{mw, h} -} - -// Encode writes the Index to the stream of the encoder. -func (e *Encoder) Encode(idx *Index) error { - // TODO: support v4 - // TODO: support extensions - if idx.Version > EncodeVersionSupported { - return ErrUnsupportedVersion - } - - if err := e.encodeHeader(idx); err != nil { - return err - } - - if err := e.encodeEntries(idx); err != nil { - return err - } - - return e.encodeFooter() -} - -func (e *Encoder) encodeHeader(idx *Index) error { - return binary.Write(e.w, - indexSignature, - idx.Version, - uint32(len(idx.Entries)), - ) -} - -func (e *Encoder) encodeEntries(idx *Index) error { - sort.Sort(byName(idx.Entries)) - - for _, entry := range idx.Entries { - if err := e.encodeEntry(entry); err != nil { - return err - } - entryLength := entryHeaderLength - if entry.IntentToAdd || entry.SkipWorktree { - entryLength += 2 - } - - wrote := entryLength + len(entry.Name) - if err := e.padEntry(wrote); err != nil { - return err - } - } - - return nil -} - -func (e *Encoder) encodeEntry(entry *Entry) error { - sec, nsec, err := e.timeToUint32(&entry.CreatedAt) - if err != nil { - return err - } - - msec, mnsec, err := e.timeToUint32(&entry.ModifiedAt) - if err != nil { - return err - } - - flags := uint16(entry.Stage&0x3) << 12 - if l := len(entry.Name); l < nameMask { - flags |= uint16(l) - } else { - flags |= nameMask - } - - flow := []interface{}{ - sec, nsec, - msec, mnsec, - entry.Dev, - entry.Inode, - entry.Mode, - entry.UID, - entry.GID, - entry.Size, - entry.Hash[:], - } - - flagsFlow := []interface{}{flags} - - if entry.IntentToAdd || entry.SkipWorktree { - var extendedFlags uint16 - - if entry.IntentToAdd { - extendedFlags |= intentToAddMask - } - if entry.SkipWorktree { - extendedFlags |= skipWorkTreeMask - } - - flagsFlow = []interface{}{flags | entryExtended, extendedFlags} - } - - flow = append(flow, flagsFlow...) - - if err := binary.Write(e.w, flow...); err != nil { - return err - } - - return binary.Write(e.w, []byte(entry.Name)) -} - -func (e *Encoder) timeToUint32(t *time.Time) (uint32, uint32, error) { - if t.IsZero() { - return 0, 0, nil - } - - if t.Unix() < 0 || t.UnixNano() < 0 { - return 0, 0, ErrInvalidTimestamp - } - - return uint32(t.Unix()), uint32(t.Nanosecond()), nil -} - -func (e *Encoder) padEntry(wrote int) error { - padLen := 8 - wrote%8 - - _, err := e.w.Write(bytes.Repeat([]byte{'\x00'}, padLen)) - return err -} - -func (e *Encoder) encodeFooter() error { - return binary.Write(e.w, e.hash.Sum(nil)) -} - -type byName []*Entry - -func (l byName) Len() int { return len(l) } -func (l byName) Swap(i, j int) { l[i], l[j] = l[j], l[i] } -func (l byName) Less(i, j int) bool { return l[i].Name < l[j].Name } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go deleted file mode 100644 index f4c7647d34..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/index.go +++ /dev/null @@ -1,231 +0,0 @@ -package index - -import ( - "bytes" - "errors" - "fmt" - "path/filepath" - "strings" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" -) - -var ( - // ErrUnsupportedVersion is returned by Decode when the index file version - // is not supported. - ErrUnsupportedVersion = errors.New("unsupported version") - // ErrEntryNotFound is returned by Index.Entry, if an entry is not found. - ErrEntryNotFound = errors.New("entry not found") - - indexSignature = []byte{'D', 'I', 'R', 'C'} - treeExtSignature = []byte{'T', 'R', 'E', 'E'} - resolveUndoExtSignature = []byte{'R', 'E', 'U', 'C'} - endOfIndexEntryExtSignature = []byte{'E', 'O', 'I', 'E'} -) - -// Stage during merge -type Stage int - -const ( - // Merged is the default stage, fully merged - Merged Stage = 1 - // AncestorMode is the base revision - AncestorMode Stage = 1 - // OurMode is the first tree revision, ours - OurMode Stage = 2 - // TheirMode is the second tree revision, theirs - TheirMode Stage = 3 -) - -// Index contains the information about which objects are currently checked out -// in the worktree, having information about the working files. Changes in -// worktree are detected using this Index. The Index is also used during merges -type Index struct { - // Version is index version - Version uint32 - // Entries collection of entries represented by this Index. The order of - // this collection is not guaranteed - Entries []*Entry - // Cache represents the 'Cached tree' extension - Cache *Tree - // ResolveUndo represents the 'Resolve undo' extension - ResolveUndo *ResolveUndo - // EndOfIndexEntry represents the 'End of Index Entry' extension - EndOfIndexEntry *EndOfIndexEntry -} - -// Add creates a new Entry and returns it. The caller should first check that -// another entry with the same path does not exist. -func (i *Index) Add(path string) *Entry { - e := &Entry{ - Name: filepath.ToSlash(path), - } - - i.Entries = append(i.Entries, e) - return e -} - -// Entry returns the entry that match the given path, if any. -func (i *Index) Entry(path string) (*Entry, error) { - path = filepath.ToSlash(path) - for _, e := range i.Entries { - if e.Name == path { - return e, nil - } - } - - return nil, ErrEntryNotFound -} - -// Remove remove the entry that match the give path and returns deleted entry. -func (i *Index) Remove(path string) (*Entry, error) { - path = filepath.ToSlash(path) - for index, e := range i.Entries { - if e.Name == path { - i.Entries = append(i.Entries[:index], i.Entries[index+1:]...) - return e, nil - } - } - - return nil, ErrEntryNotFound -} - -// Glob returns the all entries matching pattern or nil if there is no matching -// entry. The syntax of patterns is the same as in filepath.Glob. -func (i *Index) Glob(pattern string) (matches []*Entry, err error) { - pattern = filepath.ToSlash(pattern) - for _, e := range i.Entries { - m, err := match(pattern, e.Name) - if err != nil { - return nil, err - } - - if m { - matches = append(matches, e) - } - } - - return -} - -// String is equivalent to `git ls-files --stage --debug` -func (i *Index) String() string { - buf := bytes.NewBuffer(nil) - for _, e := range i.Entries { - buf.WriteString(e.String()) - } - - return buf.String() -} - -// Entry represents a single file (or stage of a file) in the cache. An entry -// represents exactly one stage of a file. If a file path is unmerged then -// multiple Entry instances may appear for the same path name. -type Entry struct { - // Hash is the SHA1 of the represented file - Hash plumbing.Hash - // Name is the Entry path name relative to top level directory - Name string - // CreatedAt time when the tracked path was created - CreatedAt time.Time - // ModifiedAt time when the tracked path was changed - ModifiedAt time.Time - // Dev and Inode of the tracked path - Dev, Inode uint32 - // Mode of the path - Mode filemode.FileMode - // UID and GID, userid and group id of the owner - UID, GID uint32 - // Size is the length in bytes for regular files - Size uint32 - // Stage on a merge is defines what stage is representing this entry - // https://git-scm.com/book/en/v2/Git-Tools-Advanced-Merging - Stage Stage - // SkipWorktree used in sparse checkouts - // https://git-scm.com/docs/git-read-tree#_sparse_checkout - SkipWorktree bool - // IntentToAdd record only the fact that the path will be added later - // https://git-scm.com/docs/git-add ("git add -N") - IntentToAdd bool -} - -func (e Entry) String() string { - buf := bytes.NewBuffer(nil) - - fmt.Fprintf(buf, "%06o %s %d\t%s\n", e.Mode, e.Hash, e.Stage, e.Name) - fmt.Fprintf(buf, " ctime: %d:%d\n", e.CreatedAt.Unix(), e.CreatedAt.Nanosecond()) - fmt.Fprintf(buf, " mtime: %d:%d\n", e.ModifiedAt.Unix(), e.ModifiedAt.Nanosecond()) - fmt.Fprintf(buf, " dev: %d\tino: %d\n", e.Dev, e.Inode) - fmt.Fprintf(buf, " uid: %d\tgid: %d\n", e.UID, e.GID) - fmt.Fprintf(buf, " size: %d\tflags: %x\n", e.Size, 0) - - return buf.String() -} - -// Tree contains pre-computed hashes for trees that can be derived from the -// index. It helps speed up tree object generation from index for a new commit. -type Tree struct { - Entries []TreeEntry -} - -// TreeEntry entry of a cached Tree -type TreeEntry struct { - // Path component (relative to its parent directory) - Path string - // Entries is the number of entries in the index that is covered by the tree - // this entry represents. - Entries int - // Trees is the number that represents the number of subtrees this tree has - Trees int - // Hash object name for the object that would result from writing this span - // of index as a tree. - Hash plumbing.Hash -} - -// ResolveUndo is used when a conflict is resolved (e.g. with "git add path"), -// these higher stage entries are removed and a stage-0 entry with proper -// resolution is added. When these higher stage entries are removed, they are -// saved in the resolve undo extension. -type ResolveUndo struct { - Entries []ResolveUndoEntry -} - -// ResolveUndoEntry contains the information about a conflict when is resolved -type ResolveUndoEntry struct { - Path string - Stages map[Stage]plumbing.Hash -} - -// EndOfIndexEntry is the End of Index Entry (EOIE) is used to locate the end of -// the variable length index entries and the beginning of the extensions. Code -// can take advantage of this to quickly locate the index extensions without -// having to parse through all of the index entries. -// -// Because it must be able to be loaded before the variable length cache -// entries and other index extensions, this extension must be written last. -type EndOfIndexEntry struct { - // Offset to the end of the index entries - Offset uint32 - // Hash is a SHA-1 over the extension types and their sizes (but not - // their contents). - Hash plumbing.Hash -} - -// SkipUnless applies patterns in the form of A, A/B, A/B/C -// to the index to prevent the files from being checked out -func (i *Index) SkipUnless(patterns []string) { - for _, e := range i.Entries { - var include bool - for _, pattern := range patterns { - if strings.HasPrefix(e.Name, pattern) { - include = true - break - } - } - if !include { - e.SkipWorktree = true - } - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/match.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/index/match.go deleted file mode 100644 index 2891d7d34c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/index/match.go +++ /dev/null @@ -1,186 +0,0 @@ -package index - -import ( - "path/filepath" - "runtime" - "unicode/utf8" -) - -// match is filepath.Match with support to match fullpath and not only filenames -// code from: -// https://github.com/golang/go/blob/39852bf4cce6927e01d0136c7843f65a801738cb/src/path/filepath/match.go#L44-L224 -func match(pattern, name string) (matched bool, err error) { -Pattern: - for len(pattern) > 0 { - var star bool - var chunk string - star, chunk, pattern = scanChunk(pattern) - - // Look for match at current position. - t, ok, err := matchChunk(chunk, name) - // if we're the last chunk, make sure we've exhausted the name - // otherwise we'll give a false result even if we could still match - // using the star - if ok && (len(t) == 0 || len(pattern) > 0) { - name = t - continue - } - if err != nil { - return false, err - } - if star { - // Look for match skipping i+1 bytes. - // Cannot skip /. - for i := 0; i < len(name); i++ { - t, ok, err := matchChunk(chunk, name[i+1:]) - if ok { - // if we're the last chunk, make sure we exhausted the name - if len(pattern) == 0 && len(t) > 0 { - continue - } - name = t - continue Pattern - } - if err != nil { - return false, err - } - } - } - return false, nil - } - return len(name) == 0, nil -} - -// scanChunk gets the next segment of pattern, which is a non-star string -// possibly preceded by a star. -func scanChunk(pattern string) (star bool, chunk, rest string) { - for len(pattern) > 0 && pattern[0] == '*' { - pattern = pattern[1:] - star = true - } - inrange := false - var i int -Scan: - for i = 0; i < len(pattern); i++ { - switch pattern[i] { - case '\\': - if runtime.GOOS != "windows" { - // error check handled in matchChunk: bad pattern. - if i+1 < len(pattern) { - i++ - } - } - case '[': - inrange = true - case ']': - inrange = false - case '*': - if !inrange { - break Scan - } - } - } - return star, pattern[0:i], pattern[i:] -} - -// matchChunk checks whether chunk matches the beginning of s. -// If so, it returns the remainder of s (after the match). -// Chunk is all single-character operators: literals, char classes, and ?. -func matchChunk(chunk, s string) (rest string, ok bool, err error) { - for len(chunk) > 0 { - if len(s) == 0 { - return - } - switch chunk[0] { - case '[': - // character class - r, n := utf8.DecodeRuneInString(s) - s = s[n:] - chunk = chunk[1:] - // We can't end right after '[', we're expecting at least - // a closing bracket and possibly a caret. - if len(chunk) == 0 { - err = filepath.ErrBadPattern - return - } - // possibly negated - negated := chunk[0] == '^' - if negated { - chunk = chunk[1:] - } - // parse all ranges - match := false - nrange := 0 - for { - if len(chunk) > 0 && chunk[0] == ']' && nrange > 0 { - chunk = chunk[1:] - break - } - var lo, hi rune - if lo, chunk, err = getEsc(chunk); err != nil { - return - } - hi = lo - if chunk[0] == '-' { - if hi, chunk, err = getEsc(chunk[1:]); err != nil { - return - } - } - if lo <= r && r <= hi { - match = true - } - nrange++ - } - if match == negated { - return - } - - case '?': - _, n := utf8.DecodeRuneInString(s) - s = s[n:] - chunk = chunk[1:] - - case '\\': - if runtime.GOOS != "windows" { - chunk = chunk[1:] - if len(chunk) == 0 { - err = filepath.ErrBadPattern - return - } - } - fallthrough - - default: - if chunk[0] != s[0] { - return - } - s = s[1:] - chunk = chunk[1:] - } - } - return s, true, nil -} - -// getEsc gets a possibly-escaped character from chunk, for a character class. -func getEsc(chunk string) (r rune, nchunk string, err error) { - if len(chunk) == 0 || chunk[0] == '-' || chunk[0] == ']' { - err = filepath.ErrBadPattern - return - } - if chunk[0] == '\\' && runtime.GOOS != "windows" { - chunk = chunk[1:] - if len(chunk) == 0 { - err = filepath.ErrBadPattern - return - } - } - r, n := utf8.DecodeRuneInString(chunk) - if r == utf8.RuneError && n == 1 { - err = filepath.ErrBadPattern - } - nchunk = chunk[n:] - if len(nchunk) == 0 { - err = filepath.ErrBadPattern - } - return -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/doc.go deleted file mode 100644 index a7145160ae..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package objfile implements encoding and decoding of object files. -package objfile diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/reader.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/reader.go deleted file mode 100644 index d7932f4ea8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/reader.go +++ /dev/null @@ -1,117 +0,0 @@ -package objfile - -import ( - "errors" - "io" - "strconv" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - ErrClosed = errors.New("objfile: already closed") - ErrHeader = errors.New("objfile: invalid header") - ErrNegativeSize = errors.New("objfile: negative object size") -) - -// Reader reads and decodes compressed objfile data from a provided io.Reader. -// Reader implements io.ReadCloser. Close should be called when finished with -// the Reader. Close will not close the underlying io.Reader. -type Reader struct { - multi io.Reader - zlib io.Reader - zlibref sync.ZLibReader - hasher plumbing.Hasher -} - -// NewReader returns a new Reader reading from r. -func NewReader(r io.Reader) (*Reader, error) { - zlib, err := sync.GetZlibReader(r) - if err != nil { - return nil, packfile.ErrZLib.AddDetails(err.Error()) - } - - return &Reader{ - zlib: zlib.Reader, - zlibref: zlib, - }, nil -} - -// Header reads the type and the size of object, and prepares the reader for read -func (r *Reader) Header() (t plumbing.ObjectType, size int64, err error) { - var raw []byte - raw, err = r.readUntil(' ') - if err != nil { - return - } - - t, err = plumbing.ParseObjectType(string(raw)) - if err != nil { - return - } - - raw, err = r.readUntil(0) - if err != nil { - return - } - - size, err = strconv.ParseInt(string(raw), 10, 64) - if err != nil { - err = ErrHeader - return - } - - defer r.prepareForRead(t, size) - return -} - -// readSlice reads one byte at a time from r until it encounters delim or an -// error. -func (r *Reader) readUntil(delim byte) ([]byte, error) { - var buf [1]byte - value := make([]byte, 0, 16) - for { - if n, err := r.zlib.Read(buf[:]); err != nil && (err != io.EOF || n == 0) { - if err == io.EOF { - return nil, ErrHeader - } - return nil, err - } - - if buf[0] == delim { - return value, nil - } - - value = append(value, buf[0]) - } -} - -func (r *Reader) prepareForRead(t plumbing.ObjectType, size int64) { - r.hasher = plumbing.NewHasher(t, size) - r.multi = io.TeeReader(r.zlib, r.hasher) -} - -// Read reads len(p) bytes into p from the object data stream. It returns -// the number of bytes read (0 <= n <= len(p)) and any error encountered. Even -// if Read returns n < len(p), it may use all of p as scratch space during the -// call. -// -// If Read encounters the end of the data stream it will return err == io.EOF, -// either in the current call if n > 0 or in a subsequent call. -func (r *Reader) Read(p []byte) (n int, err error) { - return r.multi.Read(p) -} - -// Hash returns the hash of the object data stream that has been read so far. -func (r *Reader) Hash() plumbing.Hash { - return r.hasher.Sum() -} - -// Close releases any resources consumed by the Reader. Calling Close does not -// close the wrapped io.Reader originally passed to NewReader. -func (r *Reader) Close() error { - sync.PutZlibReader(r.zlibref) - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/writer.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/writer.go deleted file mode 100644 index 0d0f154928..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/objfile/writer.go +++ /dev/null @@ -1,112 +0,0 @@ -package objfile - -import ( - "compress/zlib" - "errors" - "io" - "strconv" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - ErrOverflow = errors.New("objfile: declared data length exceeded (overflow)") -) - -// Writer writes and encodes data in compressed objfile format to a provided -// io.Writer. Close should be called when finished with the Writer. Close will -// not close the underlying io.Writer. -type Writer struct { - raw io.Writer - hasher plumbing.Hasher - multi io.Writer - zlib *zlib.Writer - - closed bool - pending int64 // number of unwritten bytes -} - -// NewWriter returns a new Writer writing to w. -// -// The returned Writer implements io.WriteCloser. Close should be called when -// finished with the Writer. Close will not close the underlying io.Writer. -func NewWriter(w io.Writer) *Writer { - zlib := sync.GetZlibWriter(w) - return &Writer{ - raw: w, - zlib: zlib, - } -} - -// WriteHeader writes the type and the size and prepares to accept the object's -// contents. If an invalid t is provided, plumbing.ErrInvalidType is returned. If a -// negative size is provided, ErrNegativeSize is returned. -func (w *Writer) WriteHeader(t plumbing.ObjectType, size int64) error { - if !t.Valid() { - return plumbing.ErrInvalidType - } - if size < 0 { - return ErrNegativeSize - } - - b := t.Bytes() - b = append(b, ' ') - b = append(b, []byte(strconv.FormatInt(size, 10))...) - b = append(b, 0) - - defer w.prepareForWrite(t, size) - _, err := w.zlib.Write(b) - - return err -} - -func (w *Writer) prepareForWrite(t plumbing.ObjectType, size int64) { - w.pending = size - - w.hasher = plumbing.NewHasher(t, size) - w.multi = io.MultiWriter(w.zlib, w.hasher) -} - -// Write writes the object's contents. Write returns the error ErrOverflow if -// more than size bytes are written after WriteHeader. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.closed { - return 0, ErrClosed - } - - overwrite := false - if int64(len(p)) > w.pending { - p = p[0:w.pending] - overwrite = true - } - - n, err = w.multi.Write(p) - w.pending -= int64(n) - if err == nil && overwrite { - err = ErrOverflow - return - } - - return -} - -// Hash returns the hash of the object data stream that has been written so far. -// It can be called before or after Close. -func (w *Writer) Hash() plumbing.Hash { - return w.hasher.Sum() // Not yet closed, return hash of data written so far -} - -// Close releases any resources consumed by the Writer. -// -// Calling Close does not close the wrapped io.Writer originally passed to -// NewWriter. -func (w *Writer) Close() error { - defer sync.PutZlibWriter(w.zlib) - if err := w.zlib.Close(); err != nil { - return err - } - - w.closed = true - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/common.go deleted file mode 100644 index 36c5ef5b88..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/common.go +++ /dev/null @@ -1,60 +0,0 @@ -package packfile - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -var signature = []byte{'P', 'A', 'C', 'K'} - -const ( - // VersionSupported is the packfile version supported by this package - VersionSupported uint32 = 2 - - firstLengthBits = uint8(4) // the first byte into object header has 4 bits to store the length - lengthBits = uint8(7) // subsequent bytes has 7 bits to store the length - maskFirstLength = 15 // 0000 1111 - maskContinue = 0x80 // 1000 0000 - maskLength = uint8(127) // 0111 1111 - maskType = uint8(112) // 0111 0000 -) - -// UpdateObjectStorage updates the storer with the objects in the given -// packfile. -func UpdateObjectStorage(s storer.Storer, packfile io.Reader) error { - if pw, ok := s.(storer.PackfileWriter); ok { - return WritePackfileToObjectStorage(pw, packfile) - } - - p, err := NewParserWithStorage(NewScanner(packfile), s) - if err != nil { - return err - } - - _, err = p.Parse() - return err -} - -// WritePackfileToObjectStorage writes all the packfile objects into the given -// object storage. -func WritePackfileToObjectStorage( - sw storer.PackfileWriter, - packfile io.Reader, -) (err error) { - w, err := sw.PackfileWriter() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - - var n int64 - n, err = io.Copy(w, packfile) - if err == nil && n == 0 { - return ErrEmptyPackfile - } - - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_index.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_index.go deleted file mode 100644 index 07a61120e5..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_index.go +++ /dev/null @@ -1,297 +0,0 @@ -package packfile - -const blksz = 16 -const maxChainLength = 64 - -// deltaIndex is a modified version of JGit's DeltaIndex adapted to our current -// design. -type deltaIndex struct { - table []int - entries []int - mask int -} - -func (idx *deltaIndex) init(buf []byte) { - scanner := newDeltaIndexScanner(buf, len(buf)) - idx.mask = scanner.mask - idx.table = scanner.table - idx.entries = make([]int, countEntries(scanner)+1) - idx.copyEntries(scanner) -} - -// findMatch returns the offset of src where the block starting at tgtOffset -// is and the length of the match. A length of 0 means there was no match. A -// length of -1 means the src length is lower than the blksz and whatever -// other positive length is the length of the match in bytes. -func (idx *deltaIndex) findMatch(src, tgt []byte, tgtOffset int) (srcOffset, l int) { - if len(tgt) < tgtOffset+s { - return 0, len(tgt) - tgtOffset - } - - if len(src) < blksz { - return 0, -1 - } - - if len(tgt) >= tgtOffset+s && len(src) >= blksz { - h := hashBlock(tgt, tgtOffset) - tIdx := h & idx.mask - eIdx := idx.table[tIdx] - if eIdx != 0 { - srcOffset = idx.entries[eIdx] - } else { - return - } - - l = matchLength(src, tgt, tgtOffset, srcOffset) - } - - return -} - -func matchLength(src, tgt []byte, otgt, osrc int) (l int) { - lensrc := len(src) - lentgt := len(tgt) - for (osrc < lensrc && otgt < lentgt) && src[osrc] == tgt[otgt] { - l++ - osrc++ - otgt++ - } - return -} - -func countEntries(scan *deltaIndexScanner) (cnt int) { - // Figure out exactly how many entries we need. As we do the - // enumeration truncate any delta chains longer than what we - // are willing to scan during encode. This keeps the encode - // logic linear in the size of the input rather than quadratic. - for i := 0; i < len(scan.table); i++ { - h := scan.table[i] - if h == 0 { - continue - } - - size := 0 - for { - size++ - if size == maxChainLength { - scan.next[h] = 0 - break - } - h = scan.next[h] - - if h == 0 { - break - } - } - cnt += size - } - - return -} - -func (idx *deltaIndex) copyEntries(scanner *deltaIndexScanner) { - // Rebuild the entries list from the scanner, positioning all - // blocks in the same hash chain next to each other. We can - // then later discard the next list, along with the scanner. - // - next := 1 - for i := 0; i < len(idx.table); i++ { - h := idx.table[i] - if h == 0 { - continue - } - - idx.table[i] = next - for { - idx.entries[next] = scanner.entries[h] - next++ - h = scanner.next[h] - - if h == 0 { - break - } - } - } -} - -type deltaIndexScanner struct { - table []int - entries []int - next []int - mask int - count int -} - -func newDeltaIndexScanner(buf []byte, size int) *deltaIndexScanner { - size -= size % blksz - worstCaseBlockCnt := size / blksz - if worstCaseBlockCnt < 1 { - return new(deltaIndexScanner) - } - - tableSize := tableSize(worstCaseBlockCnt) - scanner := &deltaIndexScanner{ - table: make([]int, tableSize), - mask: tableSize - 1, - entries: make([]int, worstCaseBlockCnt+1), - next: make([]int, worstCaseBlockCnt+1), - } - - scanner.scan(buf, size) - return scanner -} - -// slightly modified version of JGit's DeltaIndexScanner. We store the offset on the entries -// instead of the entries and the key, so we avoid operations to retrieve the offset later, as -// we don't use the key. -// See: https://github.com/eclipse/jgit/blob/005e5feb4ecd08c4e4d141a38b9e7942accb3212/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/DeltaIndexScanner.java -func (s *deltaIndexScanner) scan(buf []byte, end int) { - lastHash := 0 - ptr := end - blksz - - for { - key := hashBlock(buf, ptr) - tIdx := key & s.mask - head := s.table[tIdx] - if head != 0 && lastHash == key { - s.entries[head] = ptr - } else { - s.count++ - eIdx := s.count - s.entries[eIdx] = ptr - s.next[eIdx] = head - s.table[tIdx] = eIdx - } - - lastHash = key - ptr -= blksz - - if 0 > ptr { - break - } - } -} - -func tableSize(worstCaseBlockCnt int) int { - shift := 32 - leadingZeros(uint32(worstCaseBlockCnt)) - sz := 1 << uint(shift-1) - if sz < worstCaseBlockCnt { - sz <<= 1 - } - return sz -} - -// use https://golang.org/pkg/math/bits/#LeadingZeros32 in the future -func leadingZeros(x uint32) (n int) { - if x >= 1<<16 { - x >>= 16 - n = 16 - } - if x >= 1<<8 { - x >>= 8 - n += 8 - } - n += int(len8tab[x]) - return 32 - n -} - -var len8tab = [256]uint8{ - 0x00, 0x01, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, -} - -func hashBlock(raw []byte, ptr int) int { - // The first 4 steps collapse out into a 4 byte big-endian decode, - // with a larger right shift as we combined shift lefts together. - // - hash := ((uint32(raw[ptr]) & 0xff) << 24) | - ((uint32(raw[ptr+1]) & 0xff) << 16) | - ((uint32(raw[ptr+2]) & 0xff) << 8) | - (uint32(raw[ptr+3]) & 0xff) - hash ^= T[hash>>31] - - hash = ((hash << 8) | (uint32(raw[ptr+4]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+5]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+6]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+7]) & 0xff)) ^ T[hash>>23] - - hash = ((hash << 8) | (uint32(raw[ptr+8]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+9]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+10]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+11]) & 0xff)) ^ T[hash>>23] - - hash = ((hash << 8) | (uint32(raw[ptr+12]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+13]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+14]) & 0xff)) ^ T[hash>>23] - hash = ((hash << 8) | (uint32(raw[ptr+15]) & 0xff)) ^ T[hash>>23] - - return int(hash) -} - -var T = []uint32{0x00000000, 0xd4c6b32d, 0x7d4bd577, - 0xa98d665a, 0x2e5119c3, 0xfa97aaee, 0x531accb4, 0x87dc7f99, - 0x5ca23386, 0x886480ab, 0x21e9e6f1, 0xf52f55dc, 0x72f32a45, - 0xa6359968, 0x0fb8ff32, 0xdb7e4c1f, 0x6d82d421, 0xb944670c, - 0x10c90156, 0xc40fb27b, 0x43d3cde2, 0x97157ecf, 0x3e981895, - 0xea5eabb8, 0x3120e7a7, 0xe5e6548a, 0x4c6b32d0, 0x98ad81fd, - 0x1f71fe64, 0xcbb74d49, 0x623a2b13, 0xb6fc983e, 0x0fc31b6f, - 0xdb05a842, 0x7288ce18, 0xa64e7d35, 0x219202ac, 0xf554b181, - 0x5cd9d7db, 0x881f64f6, 0x536128e9, 0x87a79bc4, 0x2e2afd9e, - 0xfaec4eb3, 0x7d30312a, 0xa9f68207, 0x007be45d, 0xd4bd5770, - 0x6241cf4e, 0xb6877c63, 0x1f0a1a39, 0xcbcca914, 0x4c10d68d, - 0x98d665a0, 0x315b03fa, 0xe59db0d7, 0x3ee3fcc8, 0xea254fe5, - 0x43a829bf, 0x976e9a92, 0x10b2e50b, 0xc4745626, 0x6df9307c, - 0xb93f8351, 0x1f8636de, 0xcb4085f3, 0x62cde3a9, 0xb60b5084, - 0x31d72f1d, 0xe5119c30, 0x4c9cfa6a, 0x985a4947, 0x43240558, - 0x97e2b675, 0x3e6fd02f, 0xeaa96302, 0x6d751c9b, 0xb9b3afb6, - 0x103ec9ec, 0xc4f87ac1, 0x7204e2ff, 0xa6c251d2, 0x0f4f3788, - 0xdb8984a5, 0x5c55fb3c, 0x88934811, 0x211e2e4b, 0xf5d89d66, - 0x2ea6d179, 0xfa606254, 0x53ed040e, 0x872bb723, 0x00f7c8ba, - 0xd4317b97, 0x7dbc1dcd, 0xa97aaee0, 0x10452db1, 0xc4839e9c, - 0x6d0ef8c6, 0xb9c84beb, 0x3e143472, 0xead2875f, 0x435fe105, - 0x97995228, 0x4ce71e37, 0x9821ad1a, 0x31accb40, 0xe56a786d, - 0x62b607f4, 0xb670b4d9, 0x1ffdd283, 0xcb3b61ae, 0x7dc7f990, - 0xa9014abd, 0x008c2ce7, 0xd44a9fca, 0x5396e053, 0x8750537e, - 0x2edd3524, 0xfa1b8609, 0x2165ca16, 0xf5a3793b, 0x5c2e1f61, - 0x88e8ac4c, 0x0f34d3d5, 0xdbf260f8, 0x727f06a2, 0xa6b9b58f, - 0x3f0c6dbc, 0xebcade91, 0x4247b8cb, 0x96810be6, 0x115d747f, - 0xc59bc752, 0x6c16a108, 0xb8d01225, 0x63ae5e3a, 0xb768ed17, - 0x1ee58b4d, 0xca233860, 0x4dff47f9, 0x9939f4d4, 0x30b4928e, - 0xe47221a3, 0x528eb99d, 0x86480ab0, 0x2fc56cea, 0xfb03dfc7, - 0x7cdfa05e, 0xa8191373, 0x01947529, 0xd552c604, 0x0e2c8a1b, - 0xdaea3936, 0x73675f6c, 0xa7a1ec41, 0x207d93d8, 0xf4bb20f5, - 0x5d3646af, 0x89f0f582, 0x30cf76d3, 0xe409c5fe, 0x4d84a3a4, - 0x99421089, 0x1e9e6f10, 0xca58dc3d, 0x63d5ba67, 0xb713094a, - 0x6c6d4555, 0xb8abf678, 0x11269022, 0xc5e0230f, 0x423c5c96, - 0x96faefbb, 0x3f7789e1, 0xebb13acc, 0x5d4da2f2, 0x898b11df, - 0x20067785, 0xf4c0c4a8, 0x731cbb31, 0xa7da081c, 0x0e576e46, - 0xda91dd6b, 0x01ef9174, 0xd5292259, 0x7ca44403, 0xa862f72e, - 0x2fbe88b7, 0xfb783b9a, 0x52f55dc0, 0x8633eeed, 0x208a5b62, - 0xf44ce84f, 0x5dc18e15, 0x89073d38, 0x0edb42a1, 0xda1df18c, - 0x739097d6, 0xa75624fb, 0x7c2868e4, 0xa8eedbc9, 0x0163bd93, - 0xd5a50ebe, 0x52797127, 0x86bfc20a, 0x2f32a450, 0xfbf4177d, - 0x4d088f43, 0x99ce3c6e, 0x30435a34, 0xe485e919, 0x63599680, - 0xb79f25ad, 0x1e1243f7, 0xcad4f0da, 0x11aabcc5, 0xc56c0fe8, - 0x6ce169b2, 0xb827da9f, 0x3ffba506, 0xeb3d162b, 0x42b07071, - 0x9676c35c, 0x2f49400d, 0xfb8ff320, 0x5202957a, 0x86c42657, - 0x011859ce, 0xd5deeae3, 0x7c538cb9, 0xa8953f94, 0x73eb738b, - 0xa72dc0a6, 0x0ea0a6fc, 0xda6615d1, 0x5dba6a48, 0x897cd965, - 0x20f1bf3f, 0xf4370c12, 0x42cb942c, 0x960d2701, 0x3f80415b, - 0xeb46f276, 0x6c9a8def, 0xb85c3ec2, 0x11d15898, 0xc517ebb5, - 0x1e69a7aa, 0xcaaf1487, 0x632272dd, 0xb7e4c1f0, 0x3038be69, - 0xe4fe0d44, 0x4d736b1e, 0x99b5d833, -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_selector.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_selector.go deleted file mode 100644 index 4b60ff3947..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/delta_selector.go +++ /dev/null @@ -1,369 +0,0 @@ -package packfile - -import ( - "sort" - "sync" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -const ( - // deltas based on deltas, how many steps we can do. - // 50 is the default value used in JGit - maxDepth = int64(50) -) - -// applyDelta is the set of object types that we should apply deltas -var applyDelta = map[plumbing.ObjectType]bool{ - plumbing.BlobObject: true, - plumbing.TreeObject: true, -} - -type deltaSelector struct { - storer storer.EncodedObjectStorer -} - -func newDeltaSelector(s storer.EncodedObjectStorer) *deltaSelector { - return &deltaSelector{s} -} - -// ObjectsToPack creates a list of ObjectToPack from the hashes -// provided, creating deltas if it's suitable, using an specific -// internal logic. `packWindow` specifies the size of the sliding -// window used to compare objects for delta compression; 0 turns off -// delta compression entirely. -func (dw *deltaSelector) ObjectsToPack( - hashes []plumbing.Hash, - packWindow uint, -) ([]*ObjectToPack, error) { - otp, err := dw.objectsToPack(hashes, packWindow) - if err != nil { - return nil, err - } - - if packWindow == 0 { - return otp, nil - } - - dw.sort(otp) - - var objectGroups [][]*ObjectToPack - var prev *ObjectToPack - i := -1 - for _, obj := range otp { - if prev == nil || prev.Type() != obj.Type() { - objectGroups = append(objectGroups, []*ObjectToPack{obj}) - i++ - prev = obj - } else { - objectGroups[i] = append(objectGroups[i], obj) - } - } - - var wg sync.WaitGroup - var once sync.Once - for _, objs := range objectGroups { - objs := objs - wg.Add(1) - go func() { - if walkErr := dw.walk(objs, packWindow); walkErr != nil { - once.Do(func() { - err = walkErr - }) - } - wg.Done() - }() - } - wg.Wait() - - if err != nil { - return nil, err - } - - return otp, nil -} - -func (dw *deltaSelector) objectsToPack( - hashes []plumbing.Hash, - packWindow uint, -) ([]*ObjectToPack, error) { - var objectsToPack []*ObjectToPack - for _, h := range hashes { - var o plumbing.EncodedObject - var err error - if packWindow == 0 { - o, err = dw.encodedObject(h) - } else { - o, err = dw.encodedDeltaObject(h) - } - if err != nil { - return nil, err - } - - otp := newObjectToPack(o) - if _, ok := o.(plumbing.DeltaObject); ok { - otp.CleanOriginal() - } - - objectsToPack = append(objectsToPack, otp) - } - - if packWindow == 0 { - return objectsToPack, nil - } - - if err := dw.fixAndBreakChains(objectsToPack); err != nil { - return nil, err - } - - return objectsToPack, nil -} - -func (dw *deltaSelector) encodedDeltaObject(h plumbing.Hash) (plumbing.EncodedObject, error) { - edos, ok := dw.storer.(storer.DeltaObjectStorer) - if !ok { - return dw.encodedObject(h) - } - - return edos.DeltaObject(plumbing.AnyObject, h) -} - -func (dw *deltaSelector) encodedObject(h plumbing.Hash) (plumbing.EncodedObject, error) { - return dw.storer.EncodedObject(plumbing.AnyObject, h) -} - -func (dw *deltaSelector) fixAndBreakChains(objectsToPack []*ObjectToPack) error { - m := make(map[plumbing.Hash]*ObjectToPack, len(objectsToPack)) - for _, otp := range objectsToPack { - m[otp.Hash()] = otp - } - - for _, otp := range objectsToPack { - if err := dw.fixAndBreakChainsOne(m, otp); err != nil { - return err - } - } - - return nil -} - -func (dw *deltaSelector) fixAndBreakChainsOne(objectsToPack map[plumbing.Hash]*ObjectToPack, otp *ObjectToPack) error { - if !otp.Object.Type().IsDelta() { - return nil - } - - // Initial ObjectToPack instances might have a delta assigned to Object - // but no actual base initially. Once Base is assigned to a delta, it means - // we already fixed it. - if otp.Base != nil { - return nil - } - - do, ok := otp.Object.(plumbing.DeltaObject) - if !ok { - // if this is not a DeltaObject, then we cannot retrieve its base, - // so we have to break the delta chain here. - return dw.undeltify(otp) - } - - base, ok := objectsToPack[do.BaseHash()] - if !ok { - // The base of the delta is not in our list of objects to pack, so - // we break the chain. - return dw.undeltify(otp) - } - - if err := dw.fixAndBreakChainsOne(objectsToPack, base); err != nil { - return err - } - - otp.SetDelta(base, otp.Object) - return nil -} - -func (dw *deltaSelector) restoreOriginal(otp *ObjectToPack) error { - if otp.Original != nil { - return nil - } - - if !otp.Object.Type().IsDelta() { - return nil - } - - obj, err := dw.encodedObject(otp.Hash()) - if err != nil { - return err - } - - otp.SetOriginal(obj) - - return nil -} - -// undeltify undeltifies an *ObjectToPack by retrieving the original object from -// the storer and resetting it. -func (dw *deltaSelector) undeltify(otp *ObjectToPack) error { - if err := dw.restoreOriginal(otp); err != nil { - return err - } - - otp.Object = otp.Original - otp.Depth = 0 - return nil -} - -func (dw *deltaSelector) sort(objectsToPack []*ObjectToPack) { - sort.Sort(byTypeAndSize(objectsToPack)) -} - -func (dw *deltaSelector) walk( - objectsToPack []*ObjectToPack, - packWindow uint, -) error { - indexMap := make(map[plumbing.Hash]*deltaIndex) - for i := 0; i < len(objectsToPack); i++ { - // Clean up the index map and reconstructed delta objects for anything - // outside our pack window, to save memory. - if i > int(packWindow) { - obj := objectsToPack[i-int(packWindow)] - - delete(indexMap, obj.Hash()) - - if obj.IsDelta() { - obj.SaveOriginalMetadata() - obj.CleanOriginal() - } - } - - target := objectsToPack[i] - - // If we already have a delta, we don't try to find a new one for this - // object. This happens when a delta is set to be reused from an existing - // packfile. - if target.IsDelta() { - continue - } - - // We only want to create deltas from specific types. - if !applyDelta[target.Type()] { - continue - } - - for j := i - 1; j >= 0 && i-j < int(packWindow); j-- { - base := objectsToPack[j] - // Objects must use only the same type as their delta base. - // Since objectsToPack is sorted by type and size, once we find - // a different type, we know we won't find more of them. - if base.Type() != target.Type() { - break - } - - if err := dw.tryToDeltify(indexMap, base, target); err != nil { - return err - } - } - } - - return nil -} - -func (dw *deltaSelector) tryToDeltify(indexMap map[plumbing.Hash]*deltaIndex, base, target *ObjectToPack) error { - // Original object might not be present if we're reusing a delta, so we - // ensure it is restored. - if err := dw.restoreOriginal(target); err != nil { - return err - } - - if err := dw.restoreOriginal(base); err != nil { - return err - } - - // If the sizes are radically different, this is a bad pairing. - if target.Size() < base.Size()>>4 { - return nil - } - - msz := dw.deltaSizeLimit( - target.Object.Size(), - base.Depth, - target.Depth, - target.IsDelta(), - ) - - // Nearly impossible to fit useful delta. - if msz <= 8 { - return nil - } - - // If we have to insert a lot to make this work, find another. - if base.Size()-target.Size() > msz { - return nil - } - - if _, ok := indexMap[base.Hash()]; !ok { - indexMap[base.Hash()] = new(deltaIndex) - } - - // Now we can generate the delta using originals - delta, err := getDelta(indexMap[base.Hash()], base.Original, target.Original) - if err != nil { - return err - } - - // if delta better than target - if delta.Size() < msz { - target.SetDelta(base, delta) - } - - return nil -} - -func (dw *deltaSelector) deltaSizeLimit(targetSize int64, baseDepth int, - targetDepth int, targetDelta bool) int64 { - if !targetDelta { - // Any delta should be no more than 50% of the original size - // (for text files deflate of whole form should shrink 50%). - n := targetSize >> 1 - - // Evenly distribute delta size limits over allowed depth. - // If src is non-delta (depth = 0), delta <= 50% of original. - // If src is almost at limit (9/10), delta <= 10% of original. - return n * (maxDepth - int64(baseDepth)) / maxDepth - } - - // With a delta base chosen any new delta must be "better". - // Retain the distribution described above. - d := int64(targetDepth) - n := targetSize - - // If target depth is bigger than maxDepth, this delta is not suitable to be used. - if d >= maxDepth { - return 0 - } - - // If src is whole (depth=0) and base is near limit (depth=9/10) - // any delta using src can be 10x larger and still be better. - // - // If src is near limit (depth=9/10) and base is whole (depth=0) - // a new delta dependent on src must be 1/10th the size. - return n * (maxDepth - int64(baseDepth)) / (maxDepth - d) -} - -type byTypeAndSize []*ObjectToPack - -func (a byTypeAndSize) Len() int { return len(a) } - -func (a byTypeAndSize) Swap(i, j int) { a[i], a[j] = a[j], a[i] } - -func (a byTypeAndSize) Less(i, j int) bool { - if a[i].Type() < a[j].Type() { - return false - } - - if a[i].Type() > a[j].Type() { - return true - } - - return a[i].Size() > a[j].Size() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go deleted file mode 100644 index 8898e5830e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/diff_delta.go +++ /dev/null @@ -1,204 +0,0 @@ -package packfile - -import ( - "bytes" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -// See https://github.com/jelmer/dulwich/blob/master/dulwich/pack.py and -// https://github.com/tarruda/node-git-core/blob/master/src/js/delta.js -// for more info - -const ( - // Standard chunk size used to generate fingerprints - s = 16 - - // https://github.com/git/git/blob/f7466e94375b3be27f229c78873f0acf8301c0a5/diff-delta.c#L428 - // Max size of a copy operation (64KB). - maxCopySize = 64 * 1024 - - // Min size of a copy operation. - minCopySize = 4 -) - -// GetDelta returns an EncodedObject of type OFSDeltaObject. Base and Target object, -// will be loaded into memory to be able to create the delta object. -// To generate target again, you will need the obtained object and "base" one. -// Error will be returned if base or target object cannot be read. -func GetDelta(base, target plumbing.EncodedObject) (plumbing.EncodedObject, error) { - return getDelta(new(deltaIndex), base, target) -} - -func getDelta(index *deltaIndex, base, target plumbing.EncodedObject) (o plumbing.EncodedObject, err error) { - br, err := base.Reader() - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(br, &err) - - tr, err := target.Reader() - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(tr, &err) - - bb := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(bb) - - _, err = bb.ReadFrom(br) - if err != nil { - return nil, err - } - - tb := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(tb) - - _, err = tb.ReadFrom(tr) - if err != nil { - return nil, err - } - - db := diffDelta(index, bb.Bytes(), tb.Bytes()) - delta := &plumbing.MemoryObject{} - _, err = delta.Write(db) - if err != nil { - return nil, err - } - - delta.SetSize(int64(len(db))) - delta.SetType(plumbing.OFSDeltaObject) - - return delta, nil -} - -// DiffDelta returns the delta that transforms src into tgt. -func DiffDelta(src, tgt []byte) []byte { - return diffDelta(new(deltaIndex), src, tgt) -} - -func diffDelta(index *deltaIndex, src []byte, tgt []byte) []byte { - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - buf.Write(deltaEncodeSize(len(src))) - buf.Write(deltaEncodeSize(len(tgt))) - - if len(index.entries) == 0 { - index.init(src) - } - - ibuf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(ibuf) - for i := 0; i < len(tgt); i++ { - offset, l := index.findMatch(src, tgt, i) - - if l == 0 { - // couldn't find a match, just write the current byte and continue - ibuf.WriteByte(tgt[i]) - } else if l < 0 { - // src is less than blksz, copy the rest of the target to avoid - // calls to findMatch - for ; i < len(tgt); i++ { - ibuf.WriteByte(tgt[i]) - } - } else if l < s { - // remaining target is less than blksz, copy what's left of it - // and avoid calls to findMatch - for j := i; j < i+l; j++ { - ibuf.WriteByte(tgt[j]) - } - i += l - 1 - } else { - encodeInsertOperation(ibuf, buf) - - rl := l - aOffset := offset - for rl > 0 { - if rl < maxCopySize { - buf.Write(encodeCopyOperation(aOffset, rl)) - break - } - - buf.Write(encodeCopyOperation(aOffset, maxCopySize)) - rl -= maxCopySize - aOffset += maxCopySize - } - - i += l - 1 - } - } - - encodeInsertOperation(ibuf, buf) - - // buf.Bytes() is only valid until the next modifying operation on the buffer. Copy it. - return append([]byte{}, buf.Bytes()...) -} - -func encodeInsertOperation(ibuf, buf *bytes.Buffer) { - if ibuf.Len() == 0 { - return - } - - b := ibuf.Bytes() - s := ibuf.Len() - o := 0 - for { - if s <= 127 { - break - } - buf.WriteByte(byte(127)) - buf.Write(b[o : o+127]) - s -= 127 - o += 127 - } - buf.WriteByte(byte(s)) - buf.Write(b[o : o+s]) - - ibuf.Reset() -} - -func deltaEncodeSize(size int) []byte { - var ret []byte - c := size & 0x7f - size >>= 7 - for { - if size == 0 { - break - } - - ret = append(ret, byte(c|0x80)) - c = size & 0x7f - size >>= 7 - } - ret = append(ret, byte(c)) - - return ret -} - -func encodeCopyOperation(offset, length int) []byte { - code := 0x80 - var opcodes []byte - - var i uint - for i = 0; i < 4; i++ { - f := 0xff << (i * 8) - if offset&f != 0 { - opcodes = append(opcodes, byte(offset&f>>(i*8))) - code |= 0x01 << i - } - } - - for i = 0; i < 3; i++ { - f := 0xff << (i * 8) - if length&f != 0 { - opcodes = append(opcodes, byte(length&f>>(i*8))) - code |= 0x10 << i - } - } - - return append([]byte{byte(code)}, opcodes...) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go deleted file mode 100644 index 2882a7f378..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/doc.go +++ /dev/null @@ -1,39 +0,0 @@ -// Package packfile implements encoding and decoding of packfile format. -// -// == pack-*.pack files have the following format: -// -// - A header appears at the beginning and consists of the following: -// -// 4-byte signature: -// The signature is: {'P', 'A', 'C', 'K'} -// -// 4-byte version number (network byte order): -// GIT currently accepts version number 2 or 3 but -// generates version 2 only. -// -// 4-byte number of objects contained in the pack (network byte order) -// -// Observation: we cannot have more than 4G versions ;-) and -// more than 4G objects in a pack. -// -// - The header is followed by number of object entries, each of -// which looks like this: -// -// (undeltified representation) -// n-byte type and length (3-bit type, (n-1)*7+4-bit length) -// compressed data -// -// (deltified representation) -// n-byte type and length (3-bit type, (n-1)*7+4-bit length) -// 20-byte base object name -// compressed delta data -// -// Observation: length of each object is encoded in a variable -// length format and is not constrained to 32-bit or anything. -// -// - The trailer records 20-byte SHA1 checksum of all of the above. -// -// -// Source: -// https://www.kernel.org/pub/software/scm/git/docs/v1.7.5/technical/pack-protocol.txt -package packfile diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go deleted file mode 100644 index 804f5a876b..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/encoder.go +++ /dev/null @@ -1,221 +0,0 @@ -package packfile - -import ( - "compress/zlib" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/binary" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// Encoder gets the data from the storage and write it into the writer in PACK -// format -type Encoder struct { - selector *deltaSelector - w *offsetWriter - zw *zlib.Writer - hasher plumbing.Hasher - - useRefDeltas bool -} - -// NewEncoder creates a new packfile encoder using a specific Writer and -// EncodedObjectStorer. By default deltas used to generate the packfile will be -// OFSDeltaObject. To use Reference deltas, set useRefDeltas to true. -func NewEncoder(w io.Writer, s storer.EncodedObjectStorer, useRefDeltas bool) *Encoder { - h := plumbing.Hasher{ - Hash: hash.New(hash.CryptoType), - } - mw := io.MultiWriter(w, h) - ow := newOffsetWriter(mw) - zw := zlib.NewWriter(mw) - return &Encoder{ - selector: newDeltaSelector(s), - w: ow, - zw: zw, - hasher: h, - useRefDeltas: useRefDeltas, - } -} - -// Encode creates a packfile containing all the objects referenced in -// hashes and writes it to the writer in the Encoder. `packWindow` -// specifies the size of the sliding window used to compare objects -// for delta compression; 0 turns off delta compression entirely. -func (e *Encoder) Encode( - hashes []plumbing.Hash, - packWindow uint, -) (plumbing.Hash, error) { - objects, err := e.selector.ObjectsToPack(hashes, packWindow) - if err != nil { - return plumbing.ZeroHash, err - } - - return e.encode(objects) -} - -func (e *Encoder) encode(objects []*ObjectToPack) (plumbing.Hash, error) { - if err := e.head(len(objects)); err != nil { - return plumbing.ZeroHash, err - } - - for _, o := range objects { - if err := e.entry(o); err != nil { - return plumbing.ZeroHash, err - } - } - - return e.footer() -} - -func (e *Encoder) head(numEntries int) error { - return binary.Write( - e.w, - signature, - int32(VersionSupported), - int32(numEntries), - ) -} - -func (e *Encoder) entry(o *ObjectToPack) (err error) { - if o.WantWrite() { - // A cycle exists in this delta chain. This should only occur if a - // selected object representation disappeared during writing - // (for example due to a concurrent repack) and a different base - // was chosen, forcing a cycle. Select something other than a - // delta, and write this object. - e.selector.restoreOriginal(o) - o.BackToOriginal() - } - - if o.IsWritten() { - return nil - } - - o.MarkWantWrite() - - if err := e.writeBaseIfDelta(o); err != nil { - return err - } - - // We need to check if we already write that object due a cyclic delta chain - if o.IsWritten() { - return nil - } - - o.Offset = e.w.Offset() - - if o.IsDelta() { - if err := e.writeDeltaHeader(o); err != nil { - return err - } - } else { - if err := e.entryHead(o.Type(), o.Size()); err != nil { - return err - } - } - - e.zw.Reset(e.w) - - defer ioutil.CheckClose(e.zw, &err) - - or, err := o.Object.Reader() - if err != nil { - return err - } - - defer ioutil.CheckClose(or, &err) - - _, err = io.Copy(e.zw, or) - return err -} - -func (e *Encoder) writeBaseIfDelta(o *ObjectToPack) error { - if o.IsDelta() && !o.Base.IsWritten() { - // We must write base first - return e.entry(o.Base) - } - - return nil -} - -func (e *Encoder) writeDeltaHeader(o *ObjectToPack) error { - // Write offset deltas by default - t := plumbing.OFSDeltaObject - if e.useRefDeltas { - t = plumbing.REFDeltaObject - } - - if err := e.entryHead(t, o.Object.Size()); err != nil { - return err - } - - if e.useRefDeltas { - return e.writeRefDeltaHeader(o.Base.Hash()) - } else { - return e.writeOfsDeltaHeader(o) - } -} - -func (e *Encoder) writeRefDeltaHeader(base plumbing.Hash) error { - return binary.Write(e.w, base) -} - -func (e *Encoder) writeOfsDeltaHeader(o *ObjectToPack) error { - // for OFS_DELTA, offset of the base is interpreted as negative offset - // relative to the type-byte of the header of the ofs-delta entry. - relativeOffset := o.Offset - o.Base.Offset - if relativeOffset <= 0 { - return fmt.Errorf("bad offset for OFS_DELTA entry: %d", relativeOffset) - } - - return binary.WriteVariableWidthInt(e.w, relativeOffset) -} - -func (e *Encoder) entryHead(typeNum plumbing.ObjectType, size int64) error { - t := int64(typeNum) - header := []byte{} - c := (t << firstLengthBits) | (size & maskFirstLength) - size >>= firstLengthBits - for { - if size == 0 { - break - } - header = append(header, byte(c|maskContinue)) - c = size & int64(maskLength) - size >>= lengthBits - } - - header = append(header, byte(c)) - _, err := e.w.Write(header) - - return err -} - -func (e *Encoder) footer() (plumbing.Hash, error) { - h := e.hasher.Sum() - return h, binary.Write(e.w, h) -} - -type offsetWriter struct { - w io.Writer - offset int64 -} - -func newOffsetWriter(w io.Writer) *offsetWriter { - return &offsetWriter{w: w} -} - -func (ow *offsetWriter) Write(p []byte) (n int, err error) { - n, err = ow.w.Write(p) - ow.offset += int64(n) - return n, err -} - -func (ow *offsetWriter) Offset() int64 { - return ow.offset -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/error.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/error.go deleted file mode 100644 index c0b9163313..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/error.go +++ /dev/null @@ -1,30 +0,0 @@ -package packfile - -import "fmt" - -// Error specifies errors returned during packfile parsing. -type Error struct { - reason, details string -} - -// NewError returns a new error. -func NewError(reason string) *Error { - return &Error{reason: reason} -} - -// Error returns a text representation of the error. -func (e *Error) Error() string { - if e.details == "" { - return e.reason - } - - return fmt.Sprintf("%s: %s", e.reason, e.details) -} - -// AddDetails adds details to an error, with additional text. -func (e *Error) AddDetails(format string, args ...interface{}) *Error { - return &Error{ - reason: e.reason, - details: fmt.Sprintf(format, args...), - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/fsobject.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/fsobject.go deleted file mode 100644 index 238339daf8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/fsobject.go +++ /dev/null @@ -1,119 +0,0 @@ -package packfile - -import ( - "io" - - billy "github.com/go-git/go-billy/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/format/idxfile" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// FSObject is an object from the packfile on the filesystem. -type FSObject struct { - hash plumbing.Hash - offset int64 - size int64 - typ plumbing.ObjectType - index idxfile.Index - fs billy.Filesystem - path string - cache cache.Object - largeObjectThreshold int64 -} - -// NewFSObject creates a new filesystem object. -func NewFSObject( - hash plumbing.Hash, - finalType plumbing.ObjectType, - offset int64, - contentSize int64, - index idxfile.Index, - fs billy.Filesystem, - path string, - cache cache.Object, - largeObjectThreshold int64, -) *FSObject { - return &FSObject{ - hash: hash, - offset: offset, - size: contentSize, - typ: finalType, - index: index, - fs: fs, - path: path, - cache: cache, - largeObjectThreshold: largeObjectThreshold, - } -} - -// Reader implements the plumbing.EncodedObject interface. -func (o *FSObject) Reader() (io.ReadCloser, error) { - obj, ok := o.cache.Get(o.hash) - if ok && obj != o { - reader, err := obj.Reader() - if err != nil { - return nil, err - } - - return reader, nil - } - - f, err := o.fs.Open(o.path) - if err != nil { - return nil, err - } - - p := NewPackfileWithCache(o.index, nil, f, o.cache, o.largeObjectThreshold) - if o.largeObjectThreshold > 0 && o.size > o.largeObjectThreshold { - // We have a big object - h, err := p.objectHeaderAtOffset(o.offset) - if err != nil { - return nil, err - } - - r, err := p.getReaderDirect(h) - if err != nil { - _ = f.Close() - return nil, err - } - return ioutil.NewReadCloserWithCloser(r, f.Close), nil - } - r, err := p.getObjectContent(o.offset) - if err != nil { - _ = f.Close() - return nil, err - } - - if err := f.Close(); err != nil { - return nil, err - } - - return r, nil -} - -// SetSize implements the plumbing.EncodedObject interface. This method -// is a noop. -func (o *FSObject) SetSize(int64) {} - -// SetType implements the plumbing.EncodedObject interface. This method is -// a noop. -func (o *FSObject) SetType(plumbing.ObjectType) {} - -// Hash implements the plumbing.EncodedObject interface. -func (o *FSObject) Hash() plumbing.Hash { return o.hash } - -// Size implements the plumbing.EncodedObject interface. -func (o *FSObject) Size() int64 { return o.size } - -// Type implements the plumbing.EncodedObject interface. -func (o *FSObject) Type() plumbing.ObjectType { - return o.typ -} - -// Writer implements the plumbing.EncodedObject interface. This method always -// returns a nil writer. -func (o *FSObject) Writer() (io.WriteCloser, error) { - return nil, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/object_pack.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/object_pack.go deleted file mode 100644 index 8ce29ef8ba..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/object_pack.go +++ /dev/null @@ -1,164 +0,0 @@ -package packfile - -import ( - "github.com/go-git/go-git/v5/plumbing" -) - -// ObjectToPack is a representation of an object that is going to be into a -// pack file. -type ObjectToPack struct { - // The main object to pack, it could be any object, including deltas - Object plumbing.EncodedObject - // Base is the object that a delta is based on (it could be also another delta). - // If the main object is not a delta, Base will be null - Base *ObjectToPack - // Original is the object that we can generate applying the delta to - // Base, or the same object as Object in the case of a non-delta - // object. - Original plumbing.EncodedObject - // Depth is the amount of deltas needed to resolve to obtain Original - // (delta based on delta based on ...) - Depth int - - // offset in pack when object has been already written, or 0 if it - // has not been written yet - Offset int64 - - // Information from the original object - resolvedOriginal bool - originalType plumbing.ObjectType - originalSize int64 - originalHash plumbing.Hash -} - -// newObjectToPack creates a correct ObjectToPack based on a non-delta object -func newObjectToPack(o plumbing.EncodedObject) *ObjectToPack { - return &ObjectToPack{ - Object: o, - Original: o, - } -} - -// newDeltaObjectToPack creates a correct ObjectToPack for a delta object, based on -// his base (could be another delta), the delta target (in this case called original), -// and the delta Object itself -func newDeltaObjectToPack(base *ObjectToPack, original, delta plumbing.EncodedObject) *ObjectToPack { - return &ObjectToPack{ - Object: delta, - Base: base, - Original: original, - Depth: base.Depth + 1, - } -} - -// BackToOriginal converts that ObjectToPack to a non-deltified object if it was one -func (o *ObjectToPack) BackToOriginal() { - if o.IsDelta() && o.Original != nil { - o.Object = o.Original - o.Base = nil - o.Depth = 0 - } -} - -// IsWritten returns if that ObjectToPack was -// already written into the packfile or not -func (o *ObjectToPack) IsWritten() bool { - return o.Offset > 1 -} - -// MarkWantWrite marks this ObjectToPack as WantWrite -// to avoid delta chain loops -func (o *ObjectToPack) MarkWantWrite() { - o.Offset = 1 -} - -// WantWrite checks if this ObjectToPack was marked as WantWrite before -func (o *ObjectToPack) WantWrite() bool { - return o.Offset == 1 -} - -// SetOriginal sets both Original and saves size, type and hash. If object -// is nil Original is set but previous resolved values are kept -func (o *ObjectToPack) SetOriginal(obj plumbing.EncodedObject) { - o.Original = obj - o.SaveOriginalMetadata() -} - -// SaveOriginalMetadata saves size, type and hash of Original object -func (o *ObjectToPack) SaveOriginalMetadata() { - if o.Original != nil { - o.originalSize = o.Original.Size() - o.originalType = o.Original.Type() - o.originalHash = o.Original.Hash() - o.resolvedOriginal = true - } -} - -// CleanOriginal sets Original to nil -func (o *ObjectToPack) CleanOriginal() { - o.Original = nil -} - -func (o *ObjectToPack) Type() plumbing.ObjectType { - if o.Original != nil { - return o.Original.Type() - } - - if o.resolvedOriginal { - return o.originalType - } - - if o.Base != nil { - return o.Base.Type() - } - - if o.Object != nil { - return o.Object.Type() - } - - panic("cannot get type") -} - -func (o *ObjectToPack) Hash() plumbing.Hash { - if o.Original != nil { - return o.Original.Hash() - } - - if o.resolvedOriginal { - return o.originalHash - } - - do, ok := o.Object.(plumbing.DeltaObject) - if ok { - return do.ActualHash() - } - - panic("cannot get hash") -} - -func (o *ObjectToPack) Size() int64 { - if o.Original != nil { - return o.Original.Size() - } - - if o.resolvedOriginal { - return o.originalSize - } - - do, ok := o.Object.(plumbing.DeltaObject) - if ok { - return do.ActualSize() - } - - panic("cannot get ObjectToPack size") -} - -func (o *ObjectToPack) IsDelta() bool { - return o.Base != nil -} - -func (o *ObjectToPack) SetDelta(base *ObjectToPack, delta plumbing.EncodedObject) { - o.Object = delta - o.Base = base - o.Depth = base.Depth + 1 -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go deleted file mode 100644 index 6852702257..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/packfile.go +++ /dev/null @@ -1,641 +0,0 @@ -package packfile - -import ( - "bytes" - "fmt" - "io" - "os" - - billy "github.com/go-git/go-billy/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/format/idxfile" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - // ErrInvalidObject is returned by Decode when an invalid object is - // found in the packfile. - ErrInvalidObject = NewError("invalid git object") - // ErrZLib is returned by Decode when there was an error unzipping - // the packfile contents. - ErrZLib = NewError("zlib reading error") -) - -// When reading small objects from packfile it is beneficial to do so at -// once to exploit the buffered I/O. In many cases the objects are so small -// that they were already loaded to memory when the object header was -// loaded from the packfile. Wrapping in FSObject would cause this buffered -// data to be thrown away and then re-read later, with the additional -// seeking causing reloads from disk. Objects smaller than this threshold -// are now always read into memory and stored in cache instead of being -// wrapped in FSObject. -const smallObjectThreshold = 16 * 1024 - -// Packfile allows retrieving information from inside a packfile. -type Packfile struct { - idxfile.Index - fs billy.Filesystem - file billy.File - s *Scanner - deltaBaseCache cache.Object - offsetToType map[int64]plumbing.ObjectType - largeObjectThreshold int64 -} - -// NewPackfileWithCache creates a new Packfile with the given object cache. -// If the filesystem is provided, the packfile will return FSObjects, otherwise -// it will return MemoryObjects. -func NewPackfileWithCache( - index idxfile.Index, - fs billy.Filesystem, - file billy.File, - cache cache.Object, - largeObjectThreshold int64, -) *Packfile { - s := NewScanner(file) - return &Packfile{ - index, - fs, - file, - s, - cache, - make(map[int64]plumbing.ObjectType), - largeObjectThreshold, - } -} - -// NewPackfile returns a packfile representation for the given packfile file -// and packfile idx. -// If the filesystem is provided, the packfile will return FSObjects, otherwise -// it will return MemoryObjects. -func NewPackfile(index idxfile.Index, fs billy.Filesystem, file billy.File, largeObjectThreshold int64) *Packfile { - return NewPackfileWithCache(index, fs, file, cache.NewObjectLRUDefault(), largeObjectThreshold) -} - -// Get retrieves the encoded object in the packfile with the given hash. -func (p *Packfile) Get(h plumbing.Hash) (plumbing.EncodedObject, error) { - offset, err := p.FindOffset(h) - if err != nil { - return nil, err - } - - return p.objectAtOffset(offset, h) -} - -// GetByOffset retrieves the encoded object from the packfile at the given -// offset. -func (p *Packfile) GetByOffset(o int64) (plumbing.EncodedObject, error) { - hash, err := p.FindHash(o) - if err != nil { - return nil, err - } - - return p.objectAtOffset(o, hash) -} - -// GetSizeByOffset retrieves the size of the encoded object from the -// packfile with the given offset. -func (p *Packfile) GetSizeByOffset(o int64) (size int64, err error) { - if _, err := p.s.SeekFromStart(o); err != nil { - if err == io.EOF || isInvalid(err) { - return 0, plumbing.ErrObjectNotFound - } - - return 0, err - } - - h, err := p.nextObjectHeader() - if err != nil { - return 0, err - } - return p.getObjectSize(h) -} - -func (p *Packfile) objectHeaderAtOffset(offset int64) (*ObjectHeader, error) { - h, err := p.s.SeekObjectHeader(offset) - p.s.pendingObject = nil - return h, err -} - -func (p *Packfile) nextObjectHeader() (*ObjectHeader, error) { - h, err := p.s.NextObjectHeader() - p.s.pendingObject = nil - return h, err -} - -func (p *Packfile) getDeltaObjectSize(buf *bytes.Buffer) int64 { - delta := buf.Bytes() - _, delta = decodeLEB128(delta) // skip src size - sz, _ := decodeLEB128(delta) - return int64(sz) -} - -func (p *Packfile) getObjectSize(h *ObjectHeader) (int64, error) { - switch h.Type { - case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject: - return h.Length, nil - case plumbing.REFDeltaObject, plumbing.OFSDeltaObject: - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - if _, _, err := p.s.NextObject(buf); err != nil { - return 0, err - } - - return p.getDeltaObjectSize(buf), nil - default: - return 0, ErrInvalidObject.AddDetails("type %q", h.Type) - } -} - -func (p *Packfile) getObjectType(h *ObjectHeader) (typ plumbing.ObjectType, err error) { - switch h.Type { - case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject: - return h.Type, nil - case plumbing.REFDeltaObject, plumbing.OFSDeltaObject: - var offset int64 - if h.Type == plumbing.REFDeltaObject { - offset, err = p.FindOffset(h.Reference) - if err != nil { - return - } - } else { - offset = h.OffsetReference - } - - if baseType, ok := p.offsetToType[offset]; ok { - typ = baseType - } else { - h, err = p.objectHeaderAtOffset(offset) - if err != nil { - return - } - - typ, err = p.getObjectType(h) - if err != nil { - return - } - } - default: - err = ErrInvalidObject.AddDetails("type %q", h.Type) - } - - p.offsetToType[h.Offset] = typ - - return -} - -func (p *Packfile) objectAtOffset(offset int64, hash plumbing.Hash) (plumbing.EncodedObject, error) { - if obj, ok := p.cacheGet(hash); ok { - return obj, nil - } - - h, err := p.objectHeaderAtOffset(offset) - if err != nil { - if err == io.EOF || isInvalid(err) { - return nil, plumbing.ErrObjectNotFound - } - return nil, err - } - - return p.getNextObject(h, hash) -} - -func (p *Packfile) getNextObject(h *ObjectHeader, hash plumbing.Hash) (plumbing.EncodedObject, error) { - var err error - - // If we have no filesystem, we will return a MemoryObject instead - // of an FSObject. - if p.fs == nil { - return p.getNextMemoryObject(h) - } - - // If the object is small enough then read it completely into memory now since - // it is already read from disk into buffer anyway. For delta objects we want - // to perform the optimization too, but we have to be careful about applying - // small deltas on big objects. - var size int64 - if h.Length <= smallObjectThreshold { - if h.Type != plumbing.OFSDeltaObject && h.Type != plumbing.REFDeltaObject { - return p.getNextMemoryObject(h) - } - - // For delta objects we read the delta data and apply the small object - // optimization only if the expanded version of the object still meets - // the small object threshold condition. - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - if _, _, err := p.s.NextObject(buf); err != nil { - return nil, err - } - - size = p.getDeltaObjectSize(buf) - if size <= smallObjectThreshold { - var obj = new(plumbing.MemoryObject) - obj.SetSize(size) - if h.Type == plumbing.REFDeltaObject { - err = p.fillREFDeltaObjectContentWithBuffer(obj, h.Reference, buf) - } else { - err = p.fillOFSDeltaObjectContentWithBuffer(obj, h.OffsetReference, buf) - } - return obj, err - } - } else { - size, err = p.getObjectSize(h) - if err != nil { - return nil, err - } - } - - typ, err := p.getObjectType(h) - if err != nil { - return nil, err - } - - p.offsetToType[h.Offset] = typ - - return NewFSObject( - hash, - typ, - h.Offset, - size, - p.Index, - p.fs, - p.file.Name(), - p.deltaBaseCache, - p.largeObjectThreshold, - ), nil -} - -func (p *Packfile) getObjectContent(offset int64) (io.ReadCloser, error) { - h, err := p.objectHeaderAtOffset(offset) - if err != nil { - return nil, err - } - - // getObjectContent is called from FSObject, so we have to explicitly - // get memory object here to avoid recursive cycle - obj, err := p.getNextMemoryObject(h) - if err != nil { - return nil, err - } - - return obj.Reader() -} - -func asyncReader(p *Packfile) (io.ReadCloser, error) { - reader := ioutil.NewReaderUsingReaderAt(p.file, p.s.r.offset) - zr, err := sync.GetZlibReader(reader) - if err != nil { - return nil, fmt.Errorf("zlib reset error: %s", err) - } - - return ioutil.NewReadCloserWithCloser(zr.Reader, func() error { - sync.PutZlibReader(zr) - return nil - }), nil - -} - -func (p *Packfile) getReaderDirect(h *ObjectHeader) (io.ReadCloser, error) { - switch h.Type { - case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject: - return asyncReader(p) - case plumbing.REFDeltaObject: - deltaRc, err := asyncReader(p) - if err != nil { - return nil, err - } - r, err := p.readREFDeltaObjectContent(h, deltaRc) - if err != nil { - return nil, err - } - return r, nil - case plumbing.OFSDeltaObject: - deltaRc, err := asyncReader(p) - if err != nil { - return nil, err - } - r, err := p.readOFSDeltaObjectContent(h, deltaRc) - if err != nil { - return nil, err - } - return r, nil - default: - return nil, ErrInvalidObject.AddDetails("type %q", h.Type) - } -} - -func (p *Packfile) getNextMemoryObject(h *ObjectHeader) (plumbing.EncodedObject, error) { - var obj = new(plumbing.MemoryObject) - obj.SetSize(h.Length) - obj.SetType(h.Type) - - var err error - switch h.Type { - case plumbing.CommitObject, plumbing.TreeObject, plumbing.BlobObject, plumbing.TagObject: - err = p.fillRegularObjectContent(obj) - case plumbing.REFDeltaObject: - err = p.fillREFDeltaObjectContent(obj, h.Reference) - case plumbing.OFSDeltaObject: - err = p.fillOFSDeltaObjectContent(obj, h.OffsetReference) - default: - err = ErrInvalidObject.AddDetails("type %q", h.Type) - } - - if err != nil { - return nil, err - } - - p.offsetToType[h.Offset] = obj.Type() - - return obj, nil -} - -func (p *Packfile) fillRegularObjectContent(obj plumbing.EncodedObject) (err error) { - w, err := obj.Writer() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - - _, _, err = p.s.NextObject(w) - p.cachePut(obj) - - return err -} - -func (p *Packfile) fillREFDeltaObjectContent(obj plumbing.EncodedObject, ref plumbing.Hash) error { - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - _, _, err := p.s.NextObject(buf) - if err != nil { - return err - } - - return p.fillREFDeltaObjectContentWithBuffer(obj, ref, buf) -} - -func (p *Packfile) readREFDeltaObjectContent(h *ObjectHeader, deltaRC io.Reader) (io.ReadCloser, error) { - var err error - - base, ok := p.cacheGet(h.Reference) - if !ok { - base, err = p.Get(h.Reference) - if err != nil { - return nil, err - } - } - - return ReaderFromDelta(base, deltaRC) -} - -func (p *Packfile) fillREFDeltaObjectContentWithBuffer(obj plumbing.EncodedObject, ref plumbing.Hash, buf *bytes.Buffer) error { - var err error - - base, ok := p.cacheGet(ref) - if !ok { - base, err = p.Get(ref) - if err != nil { - return err - } - } - - obj.SetType(base.Type()) - err = ApplyDelta(obj, base, buf.Bytes()) - p.cachePut(obj) - - return err -} - -func (p *Packfile) fillOFSDeltaObjectContent(obj plumbing.EncodedObject, offset int64) error { - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - _, _, err := p.s.NextObject(buf) - if err != nil { - return err - } - - return p.fillOFSDeltaObjectContentWithBuffer(obj, offset, buf) -} - -func (p *Packfile) readOFSDeltaObjectContent(h *ObjectHeader, deltaRC io.Reader) (io.ReadCloser, error) { - hash, err := p.FindHash(h.OffsetReference) - if err != nil { - return nil, err - } - - base, err := p.objectAtOffset(h.OffsetReference, hash) - if err != nil { - return nil, err - } - - return ReaderFromDelta(base, deltaRC) -} - -func (p *Packfile) fillOFSDeltaObjectContentWithBuffer(obj plumbing.EncodedObject, offset int64, buf *bytes.Buffer) error { - hash, err := p.FindHash(offset) - if err != nil { - return err - } - - base, err := p.objectAtOffset(offset, hash) - if err != nil { - return err - } - - obj.SetType(base.Type()) - err = ApplyDelta(obj, base, buf.Bytes()) - p.cachePut(obj) - - return err -} - -func (p *Packfile) cacheGet(h plumbing.Hash) (plumbing.EncodedObject, bool) { - if p.deltaBaseCache == nil { - return nil, false - } - - return p.deltaBaseCache.Get(h) -} - -func (p *Packfile) cachePut(obj plumbing.EncodedObject) { - if p.deltaBaseCache == nil { - return - } - - p.deltaBaseCache.Put(obj) -} - -// GetAll returns an iterator with all encoded objects in the packfile. -// The iterator returned is not thread-safe, it should be used in the same -// thread as the Packfile instance. -func (p *Packfile) GetAll() (storer.EncodedObjectIter, error) { - return p.GetByType(plumbing.AnyObject) -} - -// GetByType returns all the objects of the given type. -func (p *Packfile) GetByType(typ plumbing.ObjectType) (storer.EncodedObjectIter, error) { - switch typ { - case plumbing.AnyObject, - plumbing.BlobObject, - plumbing.TreeObject, - plumbing.CommitObject, - plumbing.TagObject: - entries, err := p.EntriesByOffset() - if err != nil { - return nil, err - } - - return &objectIter{ - // Easiest way to provide an object decoder is just to pass a Packfile - // instance. To not mess with the seeks, it's a new instance with a - // different scanner but the same cache and offset to hash map for - // reusing as much cache as possible. - p: p, - iter: entries, - typ: typ, - }, nil - default: - return nil, plumbing.ErrInvalidType - } -} - -// ID returns the ID of the packfile, which is the checksum at the end of it. -func (p *Packfile) ID() (plumbing.Hash, error) { - prev, err := p.file.Seek(-20, io.SeekEnd) - if err != nil { - return plumbing.ZeroHash, err - } - - var hash plumbing.Hash - if _, err := io.ReadFull(p.file, hash[:]); err != nil { - return plumbing.ZeroHash, err - } - - if _, err := p.file.Seek(prev, io.SeekStart); err != nil { - return plumbing.ZeroHash, err - } - - return hash, nil -} - -// Scanner returns the packfile's Scanner -func (p *Packfile) Scanner() *Scanner { - return p.s -} - -// Close the packfile and its resources. -func (p *Packfile) Close() error { - closer, ok := p.file.(io.Closer) - if !ok { - return nil - } - - return closer.Close() -} - -type objectIter struct { - p *Packfile - typ plumbing.ObjectType - iter idxfile.EntryIter -} - -func (i *objectIter) Next() (plumbing.EncodedObject, error) { - for { - e, err := i.iter.Next() - if err != nil { - return nil, err - } - - if i.typ != plumbing.AnyObject { - if typ, ok := i.p.offsetToType[int64(e.Offset)]; ok { - if typ != i.typ { - continue - } - } else if obj, ok := i.p.cacheGet(e.Hash); ok { - if obj.Type() != i.typ { - i.p.offsetToType[int64(e.Offset)] = obj.Type() - continue - } - return obj, nil - } else { - h, err := i.p.objectHeaderAtOffset(int64(e.Offset)) - if err != nil { - return nil, err - } - - if h.Type == plumbing.REFDeltaObject || h.Type == plumbing.OFSDeltaObject { - typ, err := i.p.getObjectType(h) - if err != nil { - return nil, err - } - if typ != i.typ { - i.p.offsetToType[int64(e.Offset)] = typ - continue - } - // getObjectType will seek in the file so we cannot use getNextObject safely - return i.p.objectAtOffset(int64(e.Offset), e.Hash) - } else { - if h.Type != i.typ { - i.p.offsetToType[int64(e.Offset)] = h.Type - continue - } - return i.p.getNextObject(h, e.Hash) - } - } - } - - obj, err := i.p.objectAtOffset(int64(e.Offset), e.Hash) - if err != nil { - return nil, err - } - - return obj, nil - } -} - -func (i *objectIter) ForEach(f func(plumbing.EncodedObject) error) error { - for { - o, err := i.Next() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if err := f(o); err != nil { - return err - } - } -} - -func (i *objectIter) Close() { - i.iter.Close() -} - -// isInvalid checks whether an error is an os.PathError with an os.ErrInvalid -// error inside. It also checks for the windows error, which is different from -// os.ErrInvalid. -func isInvalid(err error) bool { - pe, ok := err.(*os.PathError) - if !ok { - return false - } - - errstr := pe.Err.Error() - return errstr == errInvalidUnix || errstr == errInvalidWindows -} - -// errInvalidWindows is the Windows equivalent to os.ErrInvalid -const errInvalidWindows = "The parameter is incorrect." - -var errInvalidUnix = os.ErrInvalid.Error() diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go deleted file mode 100644 index 62f1d13cb8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/parser.go +++ /dev/null @@ -1,611 +0,0 @@ -package packfile - -import ( - "bytes" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - // ErrReferenceDeltaNotFound is returned when the reference delta is not - // found. - ErrReferenceDeltaNotFound = errors.New("reference delta not found") - - // ErrNotSeekableSource is returned when the source for the parser is not - // seekable and a storage was not provided, so it can't be parsed. - ErrNotSeekableSource = errors.New("parser source is not seekable and storage was not provided") - - // ErrDeltaNotCached is returned when the delta could not be found in cache. - ErrDeltaNotCached = errors.New("delta could not be found in cache") -) - -// Observer interface is implemented by index encoders. -type Observer interface { - // OnHeader is called when a new packfile is opened. - OnHeader(count uint32) error - // OnInflatedObjectHeader is called for each object header read. - OnInflatedObjectHeader(t plumbing.ObjectType, objSize int64, pos int64) error - // OnInflatedObjectContent is called for each decoded object. - OnInflatedObjectContent(h plumbing.Hash, pos int64, crc uint32, content []byte) error - // OnFooter is called when decoding is done. - OnFooter(h plumbing.Hash) error -} - -// Parser decodes a packfile and calls any observer associated to it. Is used -// to generate indexes. -type Parser struct { - storage storer.EncodedObjectStorer - scanner *Scanner - count uint32 - oi []*objectInfo - oiByHash map[plumbing.Hash]*objectInfo - oiByOffset map[int64]*objectInfo - checksum plumbing.Hash - - cache *cache.BufferLRU - // delta content by offset, only used if source is not seekable - deltas map[int64][]byte - - ob []Observer -} - -// NewParser creates a new Parser. The Scanner source must be seekable. -// If it's not, NewParserWithStorage should be used instead. -func NewParser(scanner *Scanner, ob ...Observer) (*Parser, error) { - return NewParserWithStorage(scanner, nil, ob...) -} - -// NewParserWithStorage creates a new Parser. The scanner source must either -// be seekable or a storage must be provided. -func NewParserWithStorage( - scanner *Scanner, - storage storer.EncodedObjectStorer, - ob ...Observer, -) (*Parser, error) { - if !scanner.IsSeekable && storage == nil { - return nil, ErrNotSeekableSource - } - - var deltas map[int64][]byte - if !scanner.IsSeekable { - deltas = make(map[int64][]byte) - } - - return &Parser{ - storage: storage, - scanner: scanner, - ob: ob, - count: 0, - cache: cache.NewBufferLRUDefault(), - deltas: deltas, - }, nil -} - -func (p *Parser) forEachObserver(f func(o Observer) error) error { - for _, o := range p.ob { - if err := f(o); err != nil { - return err - } - } - return nil -} - -func (p *Parser) onHeader(count uint32) error { - return p.forEachObserver(func(o Observer) error { - return o.OnHeader(count) - }) -} - -func (p *Parser) onInflatedObjectHeader( - t plumbing.ObjectType, - objSize int64, - pos int64, -) error { - return p.forEachObserver(func(o Observer) error { - return o.OnInflatedObjectHeader(t, objSize, pos) - }) -} - -func (p *Parser) onInflatedObjectContent( - h plumbing.Hash, - pos int64, - crc uint32, - content []byte, -) error { - return p.forEachObserver(func(o Observer) error { - return o.OnInflatedObjectContent(h, pos, crc, content) - }) -} - -func (p *Parser) onFooter(h plumbing.Hash) error { - return p.forEachObserver(func(o Observer) error { - return o.OnFooter(h) - }) -} - -// Parse start decoding phase of the packfile. -func (p *Parser) Parse() (plumbing.Hash, error) { - if err := p.init(); err != nil { - return plumbing.ZeroHash, err - } - - if err := p.indexObjects(); err != nil { - return plumbing.ZeroHash, err - } - - var err error - p.checksum, err = p.scanner.Checksum() - if err != nil && err != io.EOF { - return plumbing.ZeroHash, err - } - - if err := p.resolveDeltas(); err != nil { - return plumbing.ZeroHash, err - } - - if err := p.onFooter(p.checksum); err != nil { - return plumbing.ZeroHash, err - } - - return p.checksum, nil -} - -func (p *Parser) init() error { - _, c, err := p.scanner.Header() - if err != nil { - return err - } - - if err := p.onHeader(c); err != nil { - return err - } - - p.count = c - p.oiByHash = make(map[plumbing.Hash]*objectInfo, p.count) - p.oiByOffset = make(map[int64]*objectInfo, p.count) - p.oi = make([]*objectInfo, p.count) - - return nil -} - -type objectHeaderWriter func(typ plumbing.ObjectType, sz int64) error - -type lazyObjectWriter interface { - // LazyWriter enables an object to be lazily written. - // It returns: - // - w: a writer to receive the object's content. - // - lwh: a func to write the object header. - // - err: any error from the initial writer creation process. - // - // Note that if the object header is not written BEFORE the writer - // is used, this will result in an invalid object. - LazyWriter() (w io.WriteCloser, lwh objectHeaderWriter, err error) -} - -func (p *Parser) indexObjects() error { - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - for i := uint32(0); i < p.count; i++ { - oh, err := p.scanner.NextObjectHeader() - if err != nil { - return err - } - - delta := false - var ota *objectInfo - switch t := oh.Type; t { - case plumbing.OFSDeltaObject: - delta = true - - parent, ok := p.oiByOffset[oh.OffsetReference] - if !ok { - return plumbing.ErrObjectNotFound - } - - ota = newDeltaObject(oh.Offset, oh.Length, t, parent) - parent.Children = append(parent.Children, ota) - case plumbing.REFDeltaObject: - delta = true - parent, ok := p.oiByHash[oh.Reference] - if !ok { - // can't find referenced object in this pack file - // this must be a "thin" pack. - parent = &objectInfo{ //Placeholder parent - SHA1: oh.Reference, - ExternalRef: true, // mark as an external reference that must be resolved - Type: plumbing.AnyObject, - DiskType: plumbing.AnyObject, - } - p.oiByHash[oh.Reference] = parent - } - ota = newDeltaObject(oh.Offset, oh.Length, t, parent) - parent.Children = append(parent.Children, ota) - - default: - ota = newBaseObject(oh.Offset, oh.Length, t) - } - - hasher := plumbing.NewHasher(oh.Type, oh.Length) - writers := []io.Writer{hasher} - var obj *plumbing.MemoryObject - - // Lazy writing is only available for non-delta objects. - if p.storage != nil && !delta { - // When a storage is set and supports lazy writing, - // use that instead of creating a memory object. - if low, ok := p.storage.(lazyObjectWriter); ok { - ow, lwh, err := low.LazyWriter() - if err != nil { - return err - } - - if err = lwh(oh.Type, oh.Length); err != nil { - return err - } - - defer ow.Close() - writers = append(writers, ow) - } else { - obj = new(plumbing.MemoryObject) - obj.SetSize(oh.Length) - obj.SetType(oh.Type) - - writers = append(writers, obj) - } - } - if delta && !p.scanner.IsSeekable { - buf.Reset() - buf.Grow(int(oh.Length)) - writers = append(writers, buf) - } - - mw := io.MultiWriter(writers...) - - _, crc, err := p.scanner.NextObject(mw) - if err != nil { - return err - } - - // Non delta objects needs to be added into the storage. This - // is only required when lazy writing is not supported. - if obj != nil { - if _, err := p.storage.SetEncodedObject(obj); err != nil { - return err - } - } - - ota.Crc32 = crc - ota.Length = oh.Length - - if !delta { - sha1 := hasher.Sum() - - // Move children of placeholder parent into actual parent, in case this - // was a non-external delta reference. - if placeholder, ok := p.oiByHash[sha1]; ok { - ota.Children = placeholder.Children - for _, c := range ota.Children { - c.Parent = ota - } - } - - ota.SHA1 = sha1 - p.oiByHash[ota.SHA1] = ota - } - - if delta && !p.scanner.IsSeekable { - data := buf.Bytes() - p.deltas[oh.Offset] = make([]byte, len(data)) - copy(p.deltas[oh.Offset], data) - } - - p.oiByOffset[oh.Offset] = ota - p.oi[i] = ota - } - - return nil -} - -func (p *Parser) resolveDeltas() error { - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - - for _, obj := range p.oi { - buf.Reset() - buf.Grow(int(obj.Length)) - err := p.get(obj, buf) - if err != nil { - return err - } - - if err := p.onInflatedObjectHeader(obj.Type, obj.Length, obj.Offset); err != nil { - return err - } - - if err := p.onInflatedObjectContent(obj.SHA1, obj.Offset, obj.Crc32, nil); err != nil { - return err - } - - if !obj.IsDelta() && len(obj.Children) > 0 { - // Dealing with an io.ReaderAt object, means we can - // create it once and reuse across all children. - r := bytes.NewReader(buf.Bytes()) - for _, child := range obj.Children { - // Even though we are discarding the output, we still need to read it to - // so that the scanner can advance to the next object, and the SHA1 can be - // calculated. - if err := p.resolveObject(io.Discard, child, r); err != nil { - return err - } - p.resolveExternalRef(child) - } - - // Remove the delta from the cache. - if obj.DiskType.IsDelta() && !p.scanner.IsSeekable { - delete(p.deltas, obj.Offset) - } - } - } - - return nil -} - -func (p *Parser) resolveExternalRef(o *objectInfo) { - if ref, ok := p.oiByHash[o.SHA1]; ok && ref.ExternalRef { - p.oiByHash[o.SHA1] = o - o.Children = ref.Children - for _, c := range o.Children { - c.Parent = o - } - } -} - -func (p *Parser) get(o *objectInfo, buf *bytes.Buffer) (err error) { - if !o.ExternalRef { // skip cache check for placeholder parents - b, ok := p.cache.Get(o.Offset) - if ok { - _, err := buf.Write(b) - return err - } - } - - // If it's not on the cache and is not a delta we can try to find it in the - // storage, if there's one. External refs must enter here. - if p.storage != nil && !o.Type.IsDelta() { - var e plumbing.EncodedObject - e, err = p.storage.EncodedObject(plumbing.AnyObject, o.SHA1) - if err != nil { - return err - } - o.Type = e.Type() - - var r io.ReadCloser - r, err = e.Reader() - if err != nil { - return err - } - - defer ioutil.CheckClose(r, &err) - - _, err = buf.ReadFrom(io.LimitReader(r, e.Size())) - return err - } - - if o.ExternalRef { - // we were not able to resolve a ref in a thin pack - return ErrReferenceDeltaNotFound - } - - if o.DiskType.IsDelta() { - b := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(b) - buf.Grow(int(o.Length)) - err := p.get(o.Parent, b) - if err != nil { - return err - } - - err = p.resolveObject(buf, o, bytes.NewReader(b.Bytes())) - if err != nil { - return err - } - } else { - err := p.readData(buf, o) - if err != nil { - return err - } - } - - // If the scanner is seekable, caching this data into - // memory by offset seems wasteful. - // There is a trade-off to be considered here in terms - // of execution time vs memory consumption. - // - // TODO: improve seekable execution time, so that we can - // skip this cache. - if len(o.Children) > 0 { - data := make([]byte, buf.Len()) - copy(data, buf.Bytes()) - p.cache.Put(o.Offset, data) - } - return nil -} - -// resolveObject resolves an object from base, using information -// provided by o. -// -// This call has the side-effect of changing field values -// from the object info o: -// - Type: OFSDeltaObject may become the target type (e.g. Blob). -// - Size: The size may be update with the target size. -// - Hash: Zero hashes will be calculated as part of the object -// resolution. Hence why this process can't be avoided even when w -// is an io.Discard. -// -// base must be an io.ReaderAt, which is a requirement from -// patchDeltaStream. The main reason being that reversing an -// delta object may lead to going backs and forths within base, -// which is not supported by io.Reader. -func (p *Parser) resolveObject( - w io.Writer, - o *objectInfo, - base io.ReaderAt, -) error { - if !o.DiskType.IsDelta() { - return nil - } - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - err := p.readData(buf, o) - if err != nil { - return err - } - - writers := []io.Writer{w} - var obj *plumbing.MemoryObject - var lwh objectHeaderWriter - - if p.storage != nil { - if low, ok := p.storage.(lazyObjectWriter); ok { - ow, wh, err := low.LazyWriter() - if err != nil { - return err - } - lwh = wh - - defer ow.Close() - writers = append(writers, ow) - } else { - obj = new(plumbing.MemoryObject) - ow, err := obj.Writer() - if err != nil { - return err - } - - writers = append(writers, ow) - } - } - - mw := io.MultiWriter(writers...) - - err = applyPatchBase(o, base, buf, mw, lwh) - if err != nil { - return err - } - - if obj != nil { - obj.SetType(o.Type) - obj.SetSize(o.Size()) // Size here is correct as it was populated by applyPatchBase. - if _, err := p.storage.SetEncodedObject(obj); err != nil { - return err - } - } - return err -} - -func (p *Parser) readData(w io.Writer, o *objectInfo) error { - if !p.scanner.IsSeekable && o.DiskType.IsDelta() { - data, ok := p.deltas[o.Offset] - if !ok { - return ErrDeltaNotCached - } - _, err := w.Write(data) - return err - } - - if _, err := p.scanner.SeekObjectHeader(o.Offset); err != nil { - return err - } - - if _, _, err := p.scanner.NextObject(w); err != nil { - return err - } - return nil -} - -// applyPatchBase applies the patch to target. -// -// Note that ota will be updated based on the description in resolveObject. -func applyPatchBase(ota *objectInfo, base io.ReaderAt, delta io.Reader, target io.Writer, wh objectHeaderWriter) error { - if target == nil { - return fmt.Errorf("cannot apply patch against nil target") - } - - typ := ota.Type - if ota.SHA1 == plumbing.ZeroHash { - typ = ota.Parent.Type - } - - sz, h, err := patchDeltaWriter(target, base, delta, typ, wh) - if err != nil { - return err - } - - if ota.SHA1 == plumbing.ZeroHash { - ota.Type = typ - ota.Length = int64(sz) - ota.SHA1 = h - } - - return nil -} - -func getSHA1(t plumbing.ObjectType, data []byte) (plumbing.Hash, error) { - hasher := plumbing.NewHasher(t, int64(len(data))) - if _, err := hasher.Write(data); err != nil { - return plumbing.ZeroHash, err - } - - return hasher.Sum(), nil -} - -type objectInfo struct { - Offset int64 - Length int64 - Type plumbing.ObjectType - DiskType plumbing.ObjectType - ExternalRef bool // indicates this is an external reference in a thin pack file - - Crc32 uint32 - - Parent *objectInfo - Children []*objectInfo - SHA1 plumbing.Hash -} - -func newBaseObject(offset, length int64, t plumbing.ObjectType) *objectInfo { - return newDeltaObject(offset, length, t, nil) -} - -func newDeltaObject( - offset, length int64, - t plumbing.ObjectType, - parent *objectInfo, -) *objectInfo { - obj := &objectInfo{ - Offset: offset, - Length: length, - Type: t, - DiskType: t, - Crc32: 0, - Parent: parent, - } - - return obj -} - -func (o *objectInfo) IsDelta() bool { - return o.Type.IsDelta() -} - -func (o *objectInfo) Size() int64 { - return o.Length -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go deleted file mode 100644 index 960769c7c8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/patch_delta.go +++ /dev/null @@ -1,526 +0,0 @@ -package packfile - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "math" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -// See https://github.com/git/git/blob/49fa3dc76179e04b0833542fa52d0f287a4955ac/delta.h -// https://github.com/git/git/blob/c2c5f6b1e479f2c38e0e01345350620944e3527f/patch-delta.c, -// and https://github.com/tarruda/node-git-core/blob/master/src/js/delta.js -// for details about the delta format. - -var ( - ErrInvalidDelta = errors.New("invalid delta") - ErrDeltaCmd = errors.New("wrong delta command") -) - -const ( - payload = 0x7f // 0111 1111 - continuation = 0x80 // 1000 0000 -) - -type offset struct { - mask byte - shift uint -} - -var offsets = []offset{ - {mask: 0x01, shift: 0}, - {mask: 0x02, shift: 8}, - {mask: 0x04, shift: 16}, - {mask: 0x08, shift: 24}, -} - -var sizes = []offset{ - {mask: 0x10, shift: 0}, - {mask: 0x20, shift: 8}, - {mask: 0x40, shift: 16}, -} - -// ApplyDelta writes to target the result of applying the modification deltas in delta to base. -func ApplyDelta(target, base plumbing.EncodedObject, delta []byte) (err error) { - r, err := base.Reader() - if err != nil { - return err - } - - defer ioutil.CheckClose(r, &err) - - w, err := target.Writer() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - - buf := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(buf) - _, err = buf.ReadFrom(r) - if err != nil { - return err - } - src := buf.Bytes() - - dst := sync.GetBytesBuffer() - defer sync.PutBytesBuffer(dst) - err = patchDelta(dst, src, delta) - if err != nil { - return err - } - - target.SetSize(int64(dst.Len())) - - b := sync.GetByteSlice() - _, err = io.CopyBuffer(w, dst, *b) - sync.PutByteSlice(b) - return err -} - -// PatchDelta returns the result of applying the modification deltas in delta to src. -// An error will be returned if delta is corrupted (ErrDeltaLen) or an action command -// is not copy from source or copy from delta (ErrDeltaCmd). -func PatchDelta(src, delta []byte) ([]byte, error) { - b := &bytes.Buffer{} - if err := patchDelta(b, src, delta); err != nil { - return nil, err - } - return b.Bytes(), nil -} - -func ReaderFromDelta(base plumbing.EncodedObject, deltaRC io.Reader) (io.ReadCloser, error) { - deltaBuf := bufio.NewReaderSize(deltaRC, 1024) - srcSz, err := decodeLEB128ByteReader(deltaBuf) - if err != nil { - if err == io.EOF { - return nil, ErrInvalidDelta - } - return nil, err - } - if srcSz != uint(base.Size()) { - return nil, ErrInvalidDelta - } - - targetSz, err := decodeLEB128ByteReader(deltaBuf) - if err != nil { - if err == io.EOF { - return nil, ErrInvalidDelta - } - return nil, err - } - remainingTargetSz := targetSz - - dstRd, dstWr := io.Pipe() - - go func() { - baseRd, err := base.Reader() - if err != nil { - _ = dstWr.CloseWithError(ErrInvalidDelta) - return - } - defer baseRd.Close() - - baseBuf := bufio.NewReader(baseRd) - basePos := uint(0) - - for { - cmd, err := deltaBuf.ReadByte() - if err == io.EOF { - _ = dstWr.CloseWithError(ErrInvalidDelta) - return - } - if err != nil { - _ = dstWr.CloseWithError(err) - return - } - - switch { - case isCopyFromSrc(cmd): - offset, err := decodeOffsetByteReader(cmd, deltaBuf) - if err != nil { - _ = dstWr.CloseWithError(err) - return - } - sz, err := decodeSizeByteReader(cmd, deltaBuf) - if err != nil { - _ = dstWr.CloseWithError(err) - return - } - - if invalidSize(sz, targetSz) || - invalidOffsetSize(offset, sz, srcSz) { - _ = dstWr.Close() - return - } - - discard := offset - basePos - if basePos > offset { - _ = baseRd.Close() - baseRd, err = base.Reader() - if err != nil { - _ = dstWr.CloseWithError(ErrInvalidDelta) - return - } - baseBuf.Reset(baseRd) - discard = offset - } - for discard > math.MaxInt32 { - n, err := baseBuf.Discard(math.MaxInt32) - if err != nil { - _ = dstWr.CloseWithError(err) - return - } - basePos += uint(n) - discard -= uint(n) - } - for discard > 0 { - n, err := baseBuf.Discard(int(discard)) - if err != nil { - _ = dstWr.CloseWithError(err) - return - } - basePos += uint(n) - discard -= uint(n) - } - if _, err := io.Copy(dstWr, io.LimitReader(baseBuf, int64(sz))); err != nil { - _ = dstWr.CloseWithError(err) - return - } - remainingTargetSz -= sz - basePos += sz - - case isCopyFromDelta(cmd): - sz := uint(cmd) // cmd is the size itself - if invalidSize(sz, targetSz) { - _ = dstWr.CloseWithError(ErrInvalidDelta) - return - } - if _, err := io.Copy(dstWr, io.LimitReader(deltaBuf, int64(sz))); err != nil { - _ = dstWr.CloseWithError(err) - return - } - - remainingTargetSz -= sz - - default: - _ = dstWr.CloseWithError(ErrDeltaCmd) - return - } - - if remainingTargetSz <= 0 { - _ = dstWr.Close() - return - } - } - }() - - return dstRd, nil -} - -func patchDelta(dst *bytes.Buffer, src, delta []byte) error { - if len(delta) < minCopySize { - return ErrInvalidDelta - } - - srcSz, delta := decodeLEB128(delta) - if srcSz != uint(len(src)) { - return ErrInvalidDelta - } - - targetSz, delta := decodeLEB128(delta) - remainingTargetSz := targetSz - - var cmd byte - dst.Grow(int(targetSz)) - for { - if len(delta) == 0 { - return ErrInvalidDelta - } - - cmd = delta[0] - delta = delta[1:] - - switch { - case isCopyFromSrc(cmd): - var offset, sz uint - var err error - offset, delta, err = decodeOffset(cmd, delta) - if err != nil { - return err - } - - sz, delta, err = decodeSize(cmd, delta) - if err != nil { - return err - } - - if invalidSize(sz, targetSz) || - invalidOffsetSize(offset, sz, srcSz) { - break - } - dst.Write(src[offset : offset+sz]) - remainingTargetSz -= sz - - case isCopyFromDelta(cmd): - sz := uint(cmd) // cmd is the size itself - if invalidSize(sz, targetSz) { - return ErrInvalidDelta - } - - if uint(len(delta)) < sz { - return ErrInvalidDelta - } - - dst.Write(delta[0:sz]) - remainingTargetSz -= sz - delta = delta[sz:] - - default: - return ErrDeltaCmd - } - - if remainingTargetSz <= 0 { - break - } - } - - return nil -} - -func patchDeltaWriter(dst io.Writer, base io.ReaderAt, delta io.Reader, - typ plumbing.ObjectType, writeHeader objectHeaderWriter) (uint, plumbing.Hash, error) { - deltaBuf := bufio.NewReaderSize(delta, 1024) - srcSz, err := decodeLEB128ByteReader(deltaBuf) - if err != nil { - if err == io.EOF { - return 0, plumbing.ZeroHash, ErrInvalidDelta - } - return 0, plumbing.ZeroHash, err - } - - if r, ok := base.(*bytes.Reader); ok && srcSz != uint(r.Size()) { - return 0, plumbing.ZeroHash, ErrInvalidDelta - } - - targetSz, err := decodeLEB128ByteReader(deltaBuf) - if err != nil { - if err == io.EOF { - return 0, plumbing.ZeroHash, ErrInvalidDelta - } - return 0, plumbing.ZeroHash, err - } - - // If header still needs to be written, caller will provide - // a LazyObjectWriterHeader. This seems to be the case when - // dealing with thin-packs. - if writeHeader != nil { - err = writeHeader(typ, int64(targetSz)) - if err != nil { - return 0, plumbing.ZeroHash, fmt.Errorf("could not lazy write header: %w", err) - } - } - - remainingTargetSz := targetSz - - hasher := plumbing.NewHasher(typ, int64(targetSz)) - mw := io.MultiWriter(dst, hasher) - - bufp := sync.GetByteSlice() - defer sync.PutByteSlice(bufp) - - sr := io.NewSectionReader(base, int64(0), int64(srcSz)) - // Keep both the io.LimitedReader types, so we can reset N. - baselr := io.LimitReader(sr, 0).(*io.LimitedReader) - deltalr := io.LimitReader(deltaBuf, 0).(*io.LimitedReader) - - for { - buf := *bufp - cmd, err := deltaBuf.ReadByte() - if err == io.EOF { - return 0, plumbing.ZeroHash, ErrInvalidDelta - } - if err != nil { - return 0, plumbing.ZeroHash, err - } - - if isCopyFromSrc(cmd) { - offset, err := decodeOffsetByteReader(cmd, deltaBuf) - if err != nil { - return 0, plumbing.ZeroHash, err - } - sz, err := decodeSizeByteReader(cmd, deltaBuf) - if err != nil { - return 0, plumbing.ZeroHash, err - } - - if invalidSize(sz, targetSz) || - invalidOffsetSize(offset, sz, srcSz) { - return 0, plumbing.ZeroHash, err - } - - if _, err := sr.Seek(int64(offset), io.SeekStart); err != nil { - return 0, plumbing.ZeroHash, err - } - baselr.N = int64(sz) - if _, err := io.CopyBuffer(mw, baselr, buf); err != nil { - return 0, plumbing.ZeroHash, err - } - remainingTargetSz -= sz - } else if isCopyFromDelta(cmd) { - sz := uint(cmd) // cmd is the size itself - if invalidSize(sz, targetSz) { - return 0, plumbing.ZeroHash, ErrInvalidDelta - } - deltalr.N = int64(sz) - if _, err := io.CopyBuffer(mw, deltalr, buf); err != nil { - return 0, plumbing.ZeroHash, err - } - - remainingTargetSz -= sz - } else { - return 0, plumbing.ZeroHash, err - } - if remainingTargetSz <= 0 { - break - } - } - - return targetSz, hasher.Sum(), nil -} - -// Decodes a number encoded as an unsigned LEB128 at the start of some -// binary data and returns the decoded number and the rest of the -// stream. -// -// This must be called twice on the delta data buffer, first to get the -// expected source buffer size, and again to get the target buffer size. -func decodeLEB128(input []byte) (uint, []byte) { - var num, sz uint - var b byte - for { - b = input[sz] - num |= (uint(b) & payload) << (sz * 7) // concats 7 bits chunks - sz++ - - if uint(b)&continuation == 0 || sz == uint(len(input)) { - break - } - } - - return num, input[sz:] -} - -func decodeLEB128ByteReader(input io.ByteReader) (uint, error) { - var num, sz uint - for { - b, err := input.ReadByte() - if err != nil { - return 0, err - } - - num |= (uint(b) & payload) << (sz * 7) // concats 7 bits chunks - sz++ - - if uint(b)&continuation == 0 { - break - } - } - - return num, nil -} - -func isCopyFromSrc(cmd byte) bool { - return (cmd & continuation) != 0 -} - -func isCopyFromDelta(cmd byte) bool { - return (cmd&continuation) == 0 && cmd != 0 -} - -func decodeOffsetByteReader(cmd byte, delta io.ByteReader) (uint, error) { - var offset uint - for _, o := range offsets { - if (cmd & o.mask) != 0 { - next, err := delta.ReadByte() - if err != nil { - return 0, err - } - offset |= uint(next) << o.shift - } - } - - return offset, nil -} - -func decodeOffset(cmd byte, delta []byte) (uint, []byte, error) { - var offset uint - for _, o := range offsets { - if (cmd & o.mask) != 0 { - if len(delta) == 0 { - return 0, nil, ErrInvalidDelta - } - offset |= uint(delta[0]) << o.shift - delta = delta[1:] - } - } - - return offset, delta, nil -} - -func decodeSizeByteReader(cmd byte, delta io.ByteReader) (uint, error) { - var sz uint - for _, s := range sizes { - if (cmd & s.mask) != 0 { - next, err := delta.ReadByte() - if err != nil { - return 0, err - } - sz |= uint(next) << s.shift - } - } - - if sz == 0 { - sz = maxCopySize - } - - return sz, nil -} - -func decodeSize(cmd byte, delta []byte) (uint, []byte, error) { - var sz uint - for _, s := range sizes { - if (cmd & s.mask) != 0 { - if len(delta) == 0 { - return 0, nil, ErrInvalidDelta - } - sz |= uint(delta[0]) << s.shift - delta = delta[1:] - } - } - if sz == 0 { - sz = maxCopySize - } - - return sz, delta, nil -} - -func invalidSize(sz, targetSz uint) bool { - return sz > targetSz -} - -func invalidOffsetSize(offset, sz, srcSz uint) bool { - return sumOverflows(offset, sz) || - offset+sz > srcSz -} - -func sumOverflows(a, b uint) bool { - return a+b < a -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/scanner.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/scanner.go deleted file mode 100644 index 730343ee39..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/packfile/scanner.go +++ /dev/null @@ -1,474 +0,0 @@ -package packfile - -import ( - "bufio" - "bytes" - "fmt" - "hash" - "hash/crc32" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/binary" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - // ErrEmptyPackfile is returned by ReadHeader when no data is found in the packfile - ErrEmptyPackfile = NewError("empty packfile") - // ErrBadSignature is returned by ReadHeader when the signature in the packfile is incorrect. - ErrBadSignature = NewError("malformed pack file signature") - // ErrUnsupportedVersion is returned by ReadHeader when the packfile version is - // different than VersionSupported. - ErrUnsupportedVersion = NewError("unsupported packfile version") - // ErrSeekNotSupported returned if seek is not support - ErrSeekNotSupported = NewError("not seek support") -) - -// ObjectHeader contains the information related to the object, this information -// is collected from the previous bytes to the content of the object. -type ObjectHeader struct { - Type plumbing.ObjectType - Offset int64 - Length int64 - Reference plumbing.Hash - OffsetReference int64 -} - -type Scanner struct { - r *scannerReader - crc hash.Hash32 - - // pendingObject is used to detect if an object has been read, or still - // is waiting to be read - pendingObject *ObjectHeader - version, objects uint32 - - // lsSeekable says if this scanner can do Seek or not, to have a Scanner - // seekable a r implementing io.Seeker is required - IsSeekable bool -} - -// NewScanner returns a new Scanner based on a reader, if the given reader -// implements io.ReadSeeker the Scanner will be also Seekable -func NewScanner(r io.Reader) *Scanner { - _, ok := r.(io.ReadSeeker) - - crc := crc32.NewIEEE() - return &Scanner{ - r: newScannerReader(r, crc), - crc: crc, - IsSeekable: ok, - } -} - -func (s *Scanner) Reset(r io.Reader) { - _, ok := r.(io.ReadSeeker) - - s.r.Reset(r) - s.crc.Reset() - s.IsSeekable = ok - s.pendingObject = nil - s.version = 0 - s.objects = 0 -} - -// Header reads the whole packfile header (signature, version and object count). -// It returns the version and the object count and performs checks on the -// validity of the signature and the version fields. -func (s *Scanner) Header() (version, objects uint32, err error) { - if s.version != 0 { - return s.version, s.objects, nil - } - - sig, err := s.readSignature() - if err != nil { - if err == io.EOF { - err = ErrEmptyPackfile - } - - return - } - - if !s.isValidSignature(sig) { - err = ErrBadSignature - return - } - - version, err = s.readVersion() - s.version = version - if err != nil { - return - } - - if !s.isSupportedVersion(version) { - err = ErrUnsupportedVersion.AddDetails("%d", version) - return - } - - objects, err = s.readCount() - s.objects = objects - return -} - -// readSignature reads a returns the signature field in the packfile. -func (s *Scanner) readSignature() ([]byte, error) { - var sig = make([]byte, 4) - if _, err := io.ReadFull(s.r, sig); err != nil { - return []byte{}, err - } - - return sig, nil -} - -// isValidSignature returns if sig is a valid packfile signature. -func (s *Scanner) isValidSignature(sig []byte) bool { - return bytes.Equal(sig, signature) -} - -// readVersion reads and returns the version field of a packfile. -func (s *Scanner) readVersion() (uint32, error) { - return binary.ReadUint32(s.r) -} - -// isSupportedVersion returns whether version v is supported by the parser. -// The current supported version is VersionSupported, defined above. -func (s *Scanner) isSupportedVersion(v uint32) bool { - return v == VersionSupported -} - -// readCount reads and returns the count of objects field of a packfile. -func (s *Scanner) readCount() (uint32, error) { - return binary.ReadUint32(s.r) -} - -// SeekObjectHeader seeks to specified offset and returns the ObjectHeader -// for the next object in the reader -func (s *Scanner) SeekObjectHeader(offset int64) (*ObjectHeader, error) { - // if seeking we assume that you are not interested in the header - if s.version == 0 { - s.version = VersionSupported - } - - if _, err := s.r.Seek(offset, io.SeekStart); err != nil { - return nil, err - } - - h, err := s.nextObjectHeader() - if err != nil { - return nil, err - } - - h.Offset = offset - return h, nil -} - -// NextObjectHeader returns the ObjectHeader for the next object in the reader -func (s *Scanner) NextObjectHeader() (*ObjectHeader, error) { - if err := s.doPending(); err != nil { - return nil, err - } - - offset, err := s.r.Seek(0, io.SeekCurrent) - if err != nil { - return nil, err - } - - h, err := s.nextObjectHeader() - if err != nil { - return nil, err - } - - h.Offset = offset - return h, nil -} - -// nextObjectHeader returns the ObjectHeader for the next object in the reader -// without the Offset field -func (s *Scanner) nextObjectHeader() (*ObjectHeader, error) { - s.r.Flush() - s.crc.Reset() - - h := &ObjectHeader{} - s.pendingObject = h - - var err error - h.Offset, err = s.r.Seek(0, io.SeekCurrent) - if err != nil { - return nil, err - } - - h.Type, h.Length, err = s.readObjectTypeAndLength() - if err != nil { - return nil, err - } - - switch h.Type { - case plumbing.OFSDeltaObject: - no, err := binary.ReadVariableWidthInt(s.r) - if err != nil { - return nil, err - } - - h.OffsetReference = h.Offset - no - case plumbing.REFDeltaObject: - var err error - h.Reference, err = binary.ReadHash(s.r) - if err != nil { - return nil, err - } - } - - return h, nil -} - -func (s *Scanner) doPending() error { - if s.version == 0 { - var err error - s.version, s.objects, err = s.Header() - if err != nil { - return err - } - } - - return s.discardObjectIfNeeded() -} - -func (s *Scanner) discardObjectIfNeeded() error { - if s.pendingObject == nil { - return nil - } - - h := s.pendingObject - n, _, err := s.NextObject(io.Discard) - if err != nil { - return err - } - - if n != h.Length { - return fmt.Errorf( - "error discarding object, discarded %d, expected %d", - n, h.Length, - ) - } - - return nil -} - -// ReadObjectTypeAndLength reads and returns the object type and the -// length field from an object entry in a packfile. -func (s *Scanner) readObjectTypeAndLength() (plumbing.ObjectType, int64, error) { - t, c, err := s.readType() - if err != nil { - return t, 0, err - } - - l, err := s.readLength(c) - - return t, l, err -} - -func (s *Scanner) readType() (plumbing.ObjectType, byte, error) { - var c byte - var err error - if c, err = s.r.ReadByte(); err != nil { - return plumbing.ObjectType(0), 0, err - } - - typ := parseType(c) - - return typ, c, nil -} - -func parseType(b byte) plumbing.ObjectType { - return plumbing.ObjectType((b & maskType) >> firstLengthBits) -} - -// the length is codified in the last 4 bits of the first byte and in -// the last 7 bits of subsequent bytes. Last byte has a 0 MSB. -func (s *Scanner) readLength(first byte) (int64, error) { - length := int64(first & maskFirstLength) - - c := first - shift := firstLengthBits - var err error - for c&maskContinue > 0 { - if c, err = s.r.ReadByte(); err != nil { - return 0, err - } - - length += int64(c&maskLength) << shift - shift += lengthBits - } - - return length, nil -} - -// NextObject writes the content of the next object into the reader, returns -// the number of bytes written, the CRC32 of the content and an error, if any -func (s *Scanner) NextObject(w io.Writer) (written int64, crc32 uint32, err error) { - s.pendingObject = nil - written, err = s.copyObject(w) - - s.r.Flush() - crc32 = s.crc.Sum32() - s.crc.Reset() - - return -} - -// ReadObject returns a reader for the object content and an error -func (s *Scanner) ReadObject() (io.ReadCloser, error) { - s.pendingObject = nil - zr, err := sync.GetZlibReader(s.r) - - if err != nil { - return nil, fmt.Errorf("zlib reset error: %s", err) - } - - return ioutil.NewReadCloserWithCloser(zr.Reader, func() error { - sync.PutZlibReader(zr) - return nil - }), nil -} - -// ReadRegularObject reads and write a non-deltified object -// from it zlib stream in an object entry in the packfile. -func (s *Scanner) copyObject(w io.Writer) (n int64, err error) { - zr, err := sync.GetZlibReader(s.r) - defer sync.PutZlibReader(zr) - - if err != nil { - return 0, fmt.Errorf("zlib reset error: %s", err) - } - - defer ioutil.CheckClose(zr.Reader, &err) - buf := sync.GetByteSlice() - n, err = io.CopyBuffer(w, zr.Reader, *buf) - sync.PutByteSlice(buf) - return -} - -// SeekFromStart sets a new offset from start, returns the old position before -// the change. -func (s *Scanner) SeekFromStart(offset int64) (previous int64, err error) { - // if seeking we assume that you are not interested in the header - if s.version == 0 { - s.version = VersionSupported - } - - previous, err = s.r.Seek(0, io.SeekCurrent) - if err != nil { - return -1, err - } - - _, err = s.r.Seek(offset, io.SeekStart) - return previous, err -} - -// Checksum returns the checksum of the packfile -func (s *Scanner) Checksum() (plumbing.Hash, error) { - err := s.discardObjectIfNeeded() - if err != nil { - return plumbing.ZeroHash, err - } - - return binary.ReadHash(s.r) -} - -// Close reads the reader until io.EOF -func (s *Scanner) Close() error { - buf := sync.GetByteSlice() - _, err := io.CopyBuffer(io.Discard, s.r, *buf) - sync.PutByteSlice(buf) - - return err -} - -// Flush is a no-op (deprecated) -func (s *Scanner) Flush() error { - return nil -} - -// scannerReader has the following characteristics: -// - Provides an io.SeekReader impl for bufio.Reader, when the underlying -// reader supports it. -// - Keeps track of the current read position, for when the underlying reader -// isn't an io.SeekReader, but we still want to know the current offset. -// - Writes to the hash writer what it reads, with the aid of a smaller buffer. -// The buffer helps avoid a performance penalty for performing small writes -// to the crc32 hash writer. -type scannerReader struct { - reader io.Reader - crc io.Writer - rbuf *bufio.Reader - wbuf *bufio.Writer - offset int64 -} - -func newScannerReader(r io.Reader, h io.Writer) *scannerReader { - sr := &scannerReader{ - rbuf: bufio.NewReader(nil), - wbuf: bufio.NewWriterSize(nil, 64), - crc: h, - } - sr.Reset(r) - - return sr -} - -func (r *scannerReader) Reset(reader io.Reader) { - r.reader = reader - r.rbuf.Reset(r.reader) - r.wbuf.Reset(r.crc) - - r.offset = 0 - if seeker, ok := r.reader.(io.ReadSeeker); ok { - r.offset, _ = seeker.Seek(0, io.SeekCurrent) - } -} - -func (r *scannerReader) Read(p []byte) (n int, err error) { - n, err = r.rbuf.Read(p) - - r.offset += int64(n) - if _, err := r.wbuf.Write(p[:n]); err != nil { - return n, err - } - return -} - -func (r *scannerReader) ReadByte() (b byte, err error) { - b, err = r.rbuf.ReadByte() - if err == nil { - r.offset++ - return b, r.wbuf.WriteByte(b) - } - return -} - -func (r *scannerReader) Flush() error { - return r.wbuf.Flush() -} - -// Seek seeks to a location. If the underlying reader is not an io.ReadSeeker, -// then only whence=io.SeekCurrent is supported, any other operation fails. -func (r *scannerReader) Seek(offset int64, whence int) (int64, error) { - var err error - - if seeker, ok := r.reader.(io.ReadSeeker); !ok { - if whence != io.SeekCurrent || offset != 0 { - return -1, ErrSeekNotSupported - } - } else { - if whence == io.SeekCurrent && offset == 0 { - return r.offset, nil - } - - r.offset, err = seeker.Seek(offset, whence) - r.rbuf.Reset(r.reader) - } - - return r.offset, err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/encoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/encoder.go deleted file mode 100644 index b6144faf58..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/encoder.go +++ /dev/null @@ -1,126 +0,0 @@ -// Package pktline implements reading payloads form pkt-lines and encoding -// pkt-lines from payloads. -package pktline - -import ( - "bytes" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/utils/trace" -) - -// An Encoder writes pkt-lines to an output stream. -type Encoder struct { - w io.Writer -} - -const ( - // MaxPayloadSize is the maximum payload size of a pkt-line in bytes. - MaxPayloadSize = 65516 - - // For compatibility with canonical Git implementation, accept longer pkt-lines - OversizePayloadMax = 65520 -) - -var ( - // FlushPkt are the contents of a flush-pkt pkt-line. - FlushPkt = []byte{'0', '0', '0', '0'} - // Flush is the payload to use with the Encode method to encode a flush-pkt. - Flush = []byte{} - // FlushString is the payload to use with the EncodeString method to encode a flush-pkt. - FlushString = "" - // ErrPayloadTooLong is returned by the Encode methods when any of the - // provided payloads is bigger than MaxPayloadSize. - ErrPayloadTooLong = errors.New("payload is too long") -) - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - w: w, - } -} - -// Flush encodes a flush-pkt to the output stream. -func (e *Encoder) Flush() error { - defer trace.Packet.Print("packet: > 0000") - _, err := e.w.Write(FlushPkt) - return err -} - -// Encode encodes a pkt-line with the payload specified and write it to -// the output stream. If several payloads are specified, each of them -// will get streamed in their own pkt-lines. -func (e *Encoder) Encode(payloads ...[]byte) error { - for _, p := range payloads { - if err := e.encodeLine(p); err != nil { - return err - } - } - - return nil -} - -func (e *Encoder) encodeLine(p []byte) error { - if len(p) > MaxPayloadSize { - return ErrPayloadTooLong - } - - if bytes.Equal(p, Flush) { - return e.Flush() - } - - n := len(p) + 4 - defer trace.Packet.Printf("packet: > %04x %s", n, p) - if _, err := e.w.Write(asciiHex16(n)); err != nil { - return err - } - _, err := e.w.Write(p) - return err -} - -// Returns the hexadecimal ascii representation of the 16 less -// significant bits of n. The length of the returned slice will always -// be 4. Example: if n is 1234 (0x4d2), the return value will be -// []byte{'0', '4', 'd', '2'}. -func asciiHex16(n int) []byte { - var ret [4]byte - ret[0] = byteToASCIIHex(byte(n & 0xf000 >> 12)) - ret[1] = byteToASCIIHex(byte(n & 0x0f00 >> 8)) - ret[2] = byteToASCIIHex(byte(n & 0x00f0 >> 4)) - ret[3] = byteToASCIIHex(byte(n & 0x000f)) - - return ret[:] -} - -// turns a byte into its hexadecimal ascii representation. Example: -// from 11 (0xb) to 'b'. -func byteToASCIIHex(n byte) byte { - if n < 10 { - return '0' + n - } - - return 'a' - 10 + n -} - -// EncodeString works similarly as Encode but payloads are specified as strings. -func (e *Encoder) EncodeString(payloads ...string) error { - for _, p := range payloads { - if err := e.Encode([]byte(p)); err != nil { - return err - } - } - - return nil -} - -// Encodef encodes a single pkt-line with the payload formatted as -// the format specifier. The rest of the arguments will be used in -// the format string. -func (e *Encoder) Encodef(format string, a ...interface{}) error { - return e.EncodeString( - fmt.Sprintf(format, a...), - ) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/error.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/error.go deleted file mode 100644 index 2c0e5a72a9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/error.go +++ /dev/null @@ -1,51 +0,0 @@ -package pktline - -import ( - "bytes" - "errors" - "io" - "strings" -) - -var ( - // ErrInvalidErrorLine is returned by Decode when the packet line is not an - // error line. - ErrInvalidErrorLine = errors.New("expected an error-line") - - errPrefix = []byte("ERR ") -) - -// ErrorLine is a packet line that contains an error message. -// Once this packet is sent by client or server, the data transfer process is -// terminated. -// See https://git-scm.com/docs/pack-protocol#_pkt_line_format -type ErrorLine struct { - Text string -} - -// Error implements the error interface. -func (e *ErrorLine) Error() string { - return e.Text -} - -// Encode encodes the ErrorLine into a packet line. -func (e *ErrorLine) Encode(w io.Writer) error { - p := NewEncoder(w) - return p.Encodef("%s%s\n", string(errPrefix), e.Text) -} - -// Decode decodes a packet line into an ErrorLine. -func (e *ErrorLine) Decode(r io.Reader) error { - s := NewScanner(r) - if !s.Scan() { - return s.Err() - } - - line := s.Bytes() - if !bytes.HasPrefix(line, errPrefix) { - return ErrInvalidErrorLine - } - - e.Text = strings.TrimSpace(string(line[4:])) - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/scanner.go b/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/scanner.go deleted file mode 100644 index fbb137de06..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/format/pktline/scanner.go +++ /dev/null @@ -1,146 +0,0 @@ -package pktline - -import ( - "bytes" - "errors" - "io" - "strings" - - "github.com/go-git/go-git/v5/utils/trace" -) - -const ( - lenSize = 4 -) - -// ErrInvalidPktLen is returned by Err() when an invalid pkt-len is found. -var ErrInvalidPktLen = errors.New("invalid pkt-len found") - -// Scanner provides a convenient interface for reading the payloads of a -// series of pkt-lines. It takes an io.Reader providing the source, -// which then can be tokenized through repeated calls to the Scan -// method. -// -// After each Scan call, the Bytes method will return the payload of the -// corresponding pkt-line on a shared buffer, which will be 65516 bytes -// or smaller. Flush pkt-lines are represented by empty byte slices. -// -// Scanning stops at EOF or the first I/O error. -type Scanner struct { - r io.Reader // The reader provided by the client - err error // Sticky error - payload []byte // Last pkt-payload - len [lenSize]byte // Last pkt-len -} - -// NewScanner returns a new Scanner to read from r. -func NewScanner(r io.Reader) *Scanner { - return &Scanner{ - r: r, - } -} - -// Err returns the first error encountered by the Scanner. -func (s *Scanner) Err() error { - return s.err -} - -// Scan advances the Scanner to the next pkt-line, whose payload will -// then be available through the Bytes method. Scanning stops at EOF -// or the first I/O error. After Scan returns false, the Err method -// will return any error that occurred during scanning, except that if -// it was io.EOF, Err will return nil. -func (s *Scanner) Scan() bool { - var l int - l, s.err = s.readPayloadLen() - if s.err == io.EOF { - s.err = nil - return false - } - if s.err != nil { - return false - } - - if cap(s.payload) < l { - s.payload = make([]byte, 0, l) - } - - if _, s.err = io.ReadFull(s.r, s.payload[:l]); s.err != nil { - return false - } - s.payload = s.payload[:l] - trace.Packet.Printf("packet: < %04x %s", l, s.payload) - - if bytes.HasPrefix(s.payload, errPrefix) { - s.err = &ErrorLine{ - Text: strings.TrimSpace(string(s.payload[4:])), - } - return false - } - - return true -} - -// Bytes returns the most recent payload generated by a call to Scan. -// The underlying array may point to data that will be overwritten by a -// subsequent call to Scan. It does no allocation. -func (s *Scanner) Bytes() []byte { - return s.payload -} - -// Method readPayloadLen returns the payload length by reading the -// pkt-len and subtracting the pkt-len size. -func (s *Scanner) readPayloadLen() (int, error) { - if _, err := io.ReadFull(s.r, s.len[:]); err != nil { - if err == io.ErrUnexpectedEOF { - return 0, ErrInvalidPktLen - } - - return 0, err - } - - n, err := hexDecode(s.len) - if err != nil { - return 0, err - } - - switch { - case n == 0: - return 0, nil - case n <= lenSize: - return 0, ErrInvalidPktLen - case n > OversizePayloadMax+lenSize: - return 0, ErrInvalidPktLen - default: - return n - lenSize, nil - } -} - -// Turns the hexadecimal representation of a number in a byte slice into -// a number. This function substitute strconv.ParseUint(string(buf), 16, -// 16) and/or hex.Decode, to avoid generating new strings, thus helping the -// GC. -func hexDecode(buf [lenSize]byte) (int, error) { - var ret int - for i := 0; i < lenSize; i++ { - n, err := asciiHexToByte(buf[i]) - if err != nil { - return 0, ErrInvalidPktLen - } - ret = 16*ret + int(n) - } - return ret, nil -} - -// turns the hexadecimal ascii representation of a byte into its -// numerical value. Example: from 'b' to 11 (0xb). -func asciiHexToByte(b byte) (byte, error) { - switch { - case b >= '0' && b <= '9': - return b - '0', nil - case b >= 'a' && b <= 'f': - return b - 'a' + 10, nil - default: - return 0, ErrInvalidPktLen - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/hash.go b/vendor/github.com/go-git/go-git/v5/plumbing/hash.go deleted file mode 100644 index 39bb73fbb4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/hash.go +++ /dev/null @@ -1,84 +0,0 @@ -package plumbing - -import ( - "bytes" - "encoding/hex" - "sort" - "strconv" - - "github.com/go-git/go-git/v5/plumbing/hash" -) - -// Hash SHA1 hashed content -type Hash [hash.Size]byte - -// ZeroHash is Hash with value zero -var ZeroHash Hash - -// ComputeHash compute the hash for a given ObjectType and content -func ComputeHash(t ObjectType, content []byte) Hash { - h := NewHasher(t, int64(len(content))) - h.Write(content) - return h.Sum() -} - -// NewHash return a new Hash from a hexadecimal hash representation -func NewHash(s string) Hash { - b, _ := hex.DecodeString(s) - - var h Hash - copy(h[:], b) - - return h -} - -func (h Hash) IsZero() bool { - var empty Hash - return h == empty -} - -func (h Hash) String() string { - return hex.EncodeToString(h[:]) -} - -type Hasher struct { - hash.Hash -} - -func NewHasher(t ObjectType, size int64) Hasher { - h := Hasher{hash.New(hash.CryptoType)} - h.Write(t.Bytes()) - h.Write([]byte(" ")) - h.Write([]byte(strconv.FormatInt(size, 10))) - h.Write([]byte{0}) - return h -} - -func (h Hasher) Sum() (hash Hash) { - copy(hash[:], h.Hash.Sum(nil)) - return -} - -// HashesSort sorts a slice of Hashes in increasing order. -func HashesSort(a []Hash) { - sort.Sort(HashSlice(a)) -} - -// HashSlice attaches the methods of sort.Interface to []Hash, sorting in -// increasing order. -type HashSlice []Hash - -func (p HashSlice) Len() int { return len(p) } -func (p HashSlice) Less(i, j int) bool { return bytes.Compare(p[i][:], p[j][:]) < 0 } -func (p HashSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// IsHash returns true if the given string is a valid hash. -func IsHash(s string) bool { - switch len(s) { - case hash.HexSize: - _, err := hex.DecodeString(s) - return err == nil - default: - return false - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash.go b/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash.go deleted file mode 100644 index 8609848f67..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash.go +++ /dev/null @@ -1,60 +0,0 @@ -// package hash provides a way for managing the -// underlying hash implementations used across go-git. -package hash - -import ( - "crypto" - "fmt" - "hash" - - "github.com/pjbgf/sha1cd" -) - -// algos is a map of hash algorithms. -var algos = map[crypto.Hash]func() hash.Hash{} - -func init() { - reset() -} - -// reset resets the default algos value. Can be used after running tests -// that registers new algorithms to avoid side effects. -func reset() { - algos[crypto.SHA1] = sha1cd.New - algos[crypto.SHA256] = crypto.SHA256.New -} - -// RegisterHash allows for the hash algorithm used to be overridden. -// This ensures the hash selection for go-git must be explicit, when -// overriding the default value. -func RegisterHash(h crypto.Hash, f func() hash.Hash) error { - if f == nil { - return fmt.Errorf("cannot register hash: f is nil") - } - - switch h { - case crypto.SHA1: - algos[h] = f - case crypto.SHA256: - algos[h] = f - default: - return fmt.Errorf("unsupported hash function: %v", h) - } - return nil -} - -// Hash is the same as hash.Hash. This allows consumers -// to not having to import this package alongside "hash". -type Hash interface { - hash.Hash -} - -// New returns a new Hash for the given hash function. -// It panics if the hash function is not registered. -func New(h crypto.Hash) Hash { - hh, ok := algos[h] - if !ok { - panic(fmt.Sprintf("hash algorithm not registered: %v", h)) - } - return hh() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha1.go b/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha1.go deleted file mode 100644 index e3cb60fec9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha1.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build !sha256 -// +build !sha256 - -package hash - -import "crypto" - -const ( - // CryptoType defines what hash algorithm is being used. - CryptoType = crypto.SHA1 - // Size defines the amount of bytes the hash yields. - Size = 20 - // HexSize defines the strings size of the hash when represented in hexadecimal. - HexSize = 40 -) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha256.go b/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha256.go deleted file mode 100644 index 1c52b89753..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/hash/hash_sha256.go +++ /dev/null @@ -1,15 +0,0 @@ -//go:build sha256 -// +build sha256 - -package hash - -import "crypto" - -const ( - // CryptoType defines what hash algorithm is being used. - CryptoType = crypto.SHA256 - // Size defines the amount of bytes the hash yields. - Size = 32 - // HexSize defines the strings size of the hash when represented in hexadecimal. - HexSize = 64 -) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/memory.go b/vendor/github.com/go-git/go-git/v5/plumbing/memory.go deleted file mode 100644 index 6d11271dd6..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/memory.go +++ /dev/null @@ -1,72 +0,0 @@ -package plumbing - -import ( - "bytes" - "io" -) - -// MemoryObject on memory Object implementation -type MemoryObject struct { - t ObjectType - h Hash - cont []byte - sz int64 -} - -// Hash returns the object Hash, the hash is calculated on-the-fly the first -// time it's called, in all subsequent calls the same Hash is returned even -// if the type or the content have changed. The Hash is only generated if the -// size of the content is exactly the object size. -func (o *MemoryObject) Hash() Hash { - if o.h == ZeroHash && int64(len(o.cont)) == o.sz { - o.h = ComputeHash(o.t, o.cont) - } - - return o.h -} - -// Type returns the ObjectType -func (o *MemoryObject) Type() ObjectType { return o.t } - -// SetType sets the ObjectType -func (o *MemoryObject) SetType(t ObjectType) { o.t = t } - -// Size returns the size of the object -func (o *MemoryObject) Size() int64 { return o.sz } - -// SetSize set the object size, a content of the given size should be written -// afterwards -func (o *MemoryObject) SetSize(s int64) { o.sz = s } - -// Reader returns an io.ReadCloser used to read the object's content. -// -// For a MemoryObject, this reader is seekable. -func (o *MemoryObject) Reader() (io.ReadCloser, error) { - return nopCloser{bytes.NewReader(o.cont)}, nil -} - -// Writer returns a ObjectWriter used to write the object's content. -func (o *MemoryObject) Writer() (io.WriteCloser, error) { - return o, nil -} - -func (o *MemoryObject) Write(p []byte) (n int, err error) { - o.cont = append(o.cont, p...) - o.sz = int64(len(o.cont)) - - return len(p), nil -} - -// Close releases any resources consumed by the object when it is acting as a -// ObjectWriter. -func (o *MemoryObject) Close() error { return nil } - -// nopCloser exposes the extra methods of bytes.Reader while nopping Close(). -// -// This allows clients to attempt seeking in a cached Blob's Reader. -type nopCloser struct { - *bytes.Reader -} - -// Close does nothing. -func (nc nopCloser) Close() error { return nil } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object.go b/vendor/github.com/go-git/go-git/v5/plumbing/object.go deleted file mode 100644 index 3ee9de9f3e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object.go +++ /dev/null @@ -1,111 +0,0 @@ -// package plumbing implement the core interfaces and structs used by go-git -package plumbing - -import ( - "errors" - "io" -) - -var ( - ErrObjectNotFound = errors.New("object not found") - // ErrInvalidType is returned when an invalid object type is provided. - ErrInvalidType = errors.New("invalid object type") -) - -// Object is a generic representation of any git object -type EncodedObject interface { - Hash() Hash - Type() ObjectType - SetType(ObjectType) - Size() int64 - SetSize(int64) - Reader() (io.ReadCloser, error) - Writer() (io.WriteCloser, error) -} - -// DeltaObject is an EncodedObject representing a delta. -type DeltaObject interface { - EncodedObject - // BaseHash returns the hash of the object used as base for this delta. - BaseHash() Hash - // ActualHash returns the hash of the object after applying the delta. - ActualHash() Hash - // Size returns the size of the object after applying the delta. - ActualSize() int64 -} - -// ObjectType internal object type -// Integer values from 0 to 7 map to those exposed by git. -// AnyObject is used to represent any from 0 to 7. -type ObjectType int8 - -const ( - InvalidObject ObjectType = 0 - CommitObject ObjectType = 1 - TreeObject ObjectType = 2 - BlobObject ObjectType = 3 - TagObject ObjectType = 4 - // 5 reserved for future expansion - OFSDeltaObject ObjectType = 6 - REFDeltaObject ObjectType = 7 - - AnyObject ObjectType = -127 -) - -func (t ObjectType) String() string { - switch t { - case CommitObject: - return "commit" - case TreeObject: - return "tree" - case BlobObject: - return "blob" - case TagObject: - return "tag" - case OFSDeltaObject: - return "ofs-delta" - case REFDeltaObject: - return "ref-delta" - case AnyObject: - return "any" - default: - return "unknown" - } -} - -func (t ObjectType) Bytes() []byte { - return []byte(t.String()) -} - -// Valid returns true if t is a valid ObjectType. -func (t ObjectType) Valid() bool { - return t >= CommitObject && t <= REFDeltaObject -} - -// IsDelta returns true for any ObjectType that represents a delta (i.e. -// REFDeltaObject or OFSDeltaObject). -func (t ObjectType) IsDelta() bool { - return t == REFDeltaObject || t == OFSDeltaObject -} - -// ParseObjectType parses a string representation of ObjectType. It returns an -// error on parse failure. -func ParseObjectType(value string) (typ ObjectType, err error) { - switch value { - case "commit": - typ = CommitObject - case "tree": - typ = TreeObject - case "blob": - typ = BlobObject - case "tag": - typ = TagObject - case "ofs-delta": - typ = OFSDeltaObject - case "ref-delta": - typ = REFDeltaObject - default: - err = ErrInvalidType - } - return -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/blob.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/blob.go deleted file mode 100644 index 8fb7576fa3..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/blob.go +++ /dev/null @@ -1,144 +0,0 @@ -package object - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// Blob is used to store arbitrary data - it is generally a file. -type Blob struct { - // Hash of the blob. - Hash plumbing.Hash - // Size of the (uncompressed) blob. - Size int64 - - obj plumbing.EncodedObject -} - -// GetBlob gets a blob from an object storer and decodes it. -func GetBlob(s storer.EncodedObjectStorer, h plumbing.Hash) (*Blob, error) { - o, err := s.EncodedObject(plumbing.BlobObject, h) - if err != nil { - return nil, err - } - - return DecodeBlob(o) -} - -// DecodeObject decodes an encoded object into a *Blob. -func DecodeBlob(o plumbing.EncodedObject) (*Blob, error) { - b := &Blob{} - if err := b.Decode(o); err != nil { - return nil, err - } - - return b, nil -} - -// ID returns the object ID of the blob. The returned value will always match -// the current value of Blob.Hash. -// -// ID is present to fulfill the Object interface. -func (b *Blob) ID() plumbing.Hash { - return b.Hash -} - -// Type returns the type of object. It always returns plumbing.BlobObject. -// -// Type is present to fulfill the Object interface. -func (b *Blob) Type() plumbing.ObjectType { - return plumbing.BlobObject -} - -// Decode transforms a plumbing.EncodedObject into a Blob struct. -func (b *Blob) Decode(o plumbing.EncodedObject) error { - if o.Type() != plumbing.BlobObject { - return ErrUnsupportedObject - } - - b.Hash = o.Hash() - b.Size = o.Size() - b.obj = o - - return nil -} - -// Encode transforms a Blob into a plumbing.EncodedObject. -func (b *Blob) Encode(o plumbing.EncodedObject) (err error) { - o.SetType(plumbing.BlobObject) - - w, err := o.Writer() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - - r, err := b.Reader() - if err != nil { - return err - } - - defer ioutil.CheckClose(r, &err) - - _, err = io.Copy(w, r) - return err -} - -// Reader returns a reader allow the access to the content of the blob -func (b *Blob) Reader() (io.ReadCloser, error) { - return b.obj.Reader() -} - -// BlobIter provides an iterator for a set of blobs. -type BlobIter struct { - storer.EncodedObjectIter - s storer.EncodedObjectStorer -} - -// NewBlobIter takes a storer.EncodedObjectStorer and a -// storer.EncodedObjectIter and returns a *BlobIter that iterates over all -// blobs contained in the storer.EncodedObjectIter. -// -// Any non-blob object returned by the storer.EncodedObjectIter is skipped. -func NewBlobIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *BlobIter { - return &BlobIter{iter, s} -} - -// Next moves the iterator to the next blob and returns a pointer to it. If -// there are no more blobs, it returns io.EOF. -func (iter *BlobIter) Next() (*Blob, error) { - for { - obj, err := iter.EncodedObjectIter.Next() - if err != nil { - return nil, err - } - - if obj.Type() != plumbing.BlobObject { - continue - } - - return DecodeBlob(obj) - } -} - -// ForEach call the cb function for each blob contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *BlobIter) ForEach(cb func(*Blob) error) error { - return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error { - if obj.Type() != plumbing.BlobObject { - return nil - } - - b, err := DecodeBlob(obj) - if err != nil { - return err - } - - return cb(b) - }) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go deleted file mode 100644 index 3c619df868..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/change.go +++ /dev/null @@ -1,159 +0,0 @@ -package object - -import ( - "bytes" - "context" - "fmt" - "strings" - - "github.com/go-git/go-git/v5/utils/merkletrie" -) - -// Change values represent a detected change between two git trees. For -// modifications, From is the original status of the node and To is its -// final status. For insertions, From is the zero value and for -// deletions To is the zero value. -type Change struct { - From ChangeEntry - To ChangeEntry -} - -var empty ChangeEntry - -// Action returns the kind of action represented by the change, an -// insertion, a deletion or a modification. -func (c *Change) Action() (merkletrie.Action, error) { - if c.From == empty && c.To == empty { - return merkletrie.Action(0), - fmt.Errorf("malformed change: empty from and to") - } - - if c.From == empty { - return merkletrie.Insert, nil - } - - if c.To == empty { - return merkletrie.Delete, nil - } - - return merkletrie.Modify, nil -} - -// Files returns the files before and after a change. -// For insertions from will be nil. For deletions to will be nil. -func (c *Change) Files() (from, to *File, err error) { - action, err := c.Action() - if err != nil { - return - } - - if action == merkletrie.Insert || action == merkletrie.Modify { - to, err = c.To.Tree.TreeEntryFile(&c.To.TreeEntry) - if !c.To.TreeEntry.Mode.IsFile() { - return nil, nil, nil - } - - if err != nil { - return - } - } - - if action == merkletrie.Delete || action == merkletrie.Modify { - from, err = c.From.Tree.TreeEntryFile(&c.From.TreeEntry) - if !c.From.TreeEntry.Mode.IsFile() { - return nil, nil, nil - } - - if err != nil { - return - } - } - - return -} - -func (c *Change) String() string { - action, err := c.Action() - if err != nil { - return "malformed change" - } - - return fmt.Sprintf("", action, c.name()) -} - -// Patch returns a Patch with all the file changes in chunks. This -// representation can be used to create several diff outputs. -func (c *Change) Patch() (*Patch, error) { - return c.PatchContext(context.Background()) -} - -// Patch returns a Patch with all the file changes in chunks. This -// representation can be used to create several diff outputs. -// If context expires, an non-nil error will be returned -// Provided context must be non-nil -func (c *Change) PatchContext(ctx context.Context) (*Patch, error) { - return getPatchContext(ctx, "", c) -} - -func (c *Change) name() string { - if c.From != empty { - return c.From.Name - } - - return c.To.Name -} - -// ChangeEntry values represent a node that has suffered a change. -type ChangeEntry struct { - // Full path of the node using "/" as separator. - Name string - // Parent tree of the node that has changed. - Tree *Tree - // The entry of the node. - TreeEntry TreeEntry -} - -// Changes represents a collection of changes between two git trees. -// Implements sort.Interface lexicographically over the path of the -// changed files. -type Changes []*Change - -func (c Changes) Len() int { - return len(c) -} - -func (c Changes) Swap(i, j int) { - c[i], c[j] = c[j], c[i] -} - -func (c Changes) Less(i, j int) bool { - return strings.Compare(c[i].name(), c[j].name()) < 0 -} - -func (c Changes) String() string { - var buffer bytes.Buffer - buffer.WriteString("[") - comma := "" - for _, v := range c { - buffer.WriteString(comma) - buffer.WriteString(v.String()) - comma = ", " - } - buffer.WriteString("]") - - return buffer.String() -} - -// Patch returns a Patch with all the changes in chunks. This -// representation can be used to create several diff outputs. -func (c Changes) Patch() (*Patch, error) { - return c.PatchContext(context.Background()) -} - -// Patch returns a Patch with all the changes in chunks. This -// representation can be used to create several diff outputs. -// If context expires, an non-nil error will be returned -// Provided context must be non-nil -func (c Changes) PatchContext(ctx context.Context) (*Patch, error) { - return getPatchContext(ctx, "", c...) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/change_adaptor.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/change_adaptor.go deleted file mode 100644 index b96ee84d90..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/change_adaptor.go +++ /dev/null @@ -1,61 +0,0 @@ -package object - -import ( - "errors" - "fmt" - - "github.com/go-git/go-git/v5/utils/merkletrie" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// The following functions transform changes types form the merkletrie -// package to changes types from this package. - -func newChange(c merkletrie.Change) (*Change, error) { - ret := &Change{} - - var err error - if ret.From, err = newChangeEntry(c.From); err != nil { - return nil, fmt.Errorf("from field: %s", err) - } - - if ret.To, err = newChangeEntry(c.To); err != nil { - return nil, fmt.Errorf("to field: %s", err) - } - - return ret, nil -} - -func newChangeEntry(p noder.Path) (ChangeEntry, error) { - if p == nil { - return empty, nil - } - - asTreeNoder, ok := p.Last().(*treeNoder) - if !ok { - return ChangeEntry{}, errors.New("cannot transform non-TreeNoders") - } - - return ChangeEntry{ - Name: p.String(), - Tree: asTreeNoder.parent, - TreeEntry: TreeEntry{ - Name: asTreeNoder.name, - Mode: asTreeNoder.mode, - Hash: asTreeNoder.hash, - }, - }, nil -} - -func newChanges(src merkletrie.Changes) (Changes, error) { - ret := make(Changes, len(src)) - var err error - for i, e := range src { - ret[i], err = newChange(e) - if err != nil { - return nil, fmt.Errorf("change #%d: %s", i, err) - } - } - - return ret, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go deleted file mode 100644 index ceed5d01e7..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit.go +++ /dev/null @@ -1,507 +0,0 @@ -package object - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "strings" - - "github.com/ProtonMail/go-crypto/openpgp" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -const ( - beginpgp string = "-----BEGIN PGP SIGNATURE-----" - endpgp string = "-----END PGP SIGNATURE-----" - headerpgp string = "gpgsig" - headerencoding string = "encoding" - - // https://github.com/git/git/blob/bcb6cae2966cc407ca1afc77413b3ef11103c175/Documentation/gitformat-signature.txt#L153 - // When a merge commit is created from a signed tag, the tag is embedded in - // the commit with the "mergetag" header. - headermergetag string = "mergetag" - - defaultUtf8CommitMesageEncoding MessageEncoding = "UTF-8" -) - -// Hash represents the hash of an object -type Hash plumbing.Hash - -// MessageEncoding represents the encoding of a commit -type MessageEncoding string - -// Commit points to a single tree, marking it as what the project looked like -// at a certain point in time. It contains meta-information about that point -// in time, such as a timestamp, the author of the changes since the last -// commit, a pointer to the previous commit(s), etc. -// http://shafiulazam.com/gitbook/1_the_git_object_model.html -type Commit struct { - // Hash of the commit object. - Hash plumbing.Hash - // Author is the original author of the commit. - Author Signature - // Committer is the one performing the commit, might be different from - // Author. - Committer Signature - // MergeTag is the embedded tag object when a merge commit is created by - // merging a signed tag. - MergeTag string - // PGPSignature is the PGP signature of the commit. - PGPSignature string - // Message is the commit message, contains arbitrary text. - Message string - // TreeHash is the hash of the root tree of the commit. - TreeHash plumbing.Hash - // ParentHashes are the hashes of the parent commits of the commit. - ParentHashes []plumbing.Hash - // Encoding is the encoding of the commit. - Encoding MessageEncoding - - s storer.EncodedObjectStorer -} - -// GetCommit gets a commit from an object storer and decodes it. -func GetCommit(s storer.EncodedObjectStorer, h plumbing.Hash) (*Commit, error) { - o, err := s.EncodedObject(plumbing.CommitObject, h) - if err != nil { - return nil, err - } - - return DecodeCommit(s, o) -} - -// DecodeCommit decodes an encoded object into a *Commit and associates it to -// the given object storer. -func DecodeCommit(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Commit, error) { - c := &Commit{s: s} - if err := c.Decode(o); err != nil { - return nil, err - } - - return c, nil -} - -// Tree returns the Tree from the commit. -func (c *Commit) Tree() (*Tree, error) { - return GetTree(c.s, c.TreeHash) -} - -// PatchContext returns the Patch between the actual commit and the provided one. -// Error will be return if context expires. Provided context must be non-nil. -// -// NOTE: Since version 5.1.0 the renames are correctly handled, the settings -// used are the recommended options DefaultDiffTreeOptions. -func (c *Commit) PatchContext(ctx context.Context, to *Commit) (*Patch, error) { - fromTree, err := c.Tree() - if err != nil { - return nil, err - } - - var toTree *Tree - if to != nil { - toTree, err = to.Tree() - if err != nil { - return nil, err - } - } - - return fromTree.PatchContext(ctx, toTree) -} - -// Patch returns the Patch between the actual commit and the provided one. -// -// NOTE: Since version 5.1.0 the renames are correctly handled, the settings -// used are the recommended options DefaultDiffTreeOptions. -func (c *Commit) Patch(to *Commit) (*Patch, error) { - return c.PatchContext(context.Background(), to) -} - -// Parents return a CommitIter to the parent Commits. -func (c *Commit) Parents() CommitIter { - return NewCommitIter(c.s, - storer.NewEncodedObjectLookupIter(c.s, plumbing.CommitObject, c.ParentHashes), - ) -} - -// NumParents returns the number of parents in a commit. -func (c *Commit) NumParents() int { - return len(c.ParentHashes) -} - -var ErrParentNotFound = errors.New("commit parent not found") - -// Parent returns the ith parent of a commit. -func (c *Commit) Parent(i int) (*Commit, error) { - if len(c.ParentHashes) == 0 || i > len(c.ParentHashes)-1 { - return nil, ErrParentNotFound - } - - return GetCommit(c.s, c.ParentHashes[i]) -} - -// File returns the file with the specified "path" in the commit and a -// nil error if the file exists. If the file does not exist, it returns -// a nil file and the ErrFileNotFound error. -func (c *Commit) File(path string) (*File, error) { - tree, err := c.Tree() - if err != nil { - return nil, err - } - - return tree.File(path) -} - -// Files returns a FileIter allowing to iterate over the Tree -func (c *Commit) Files() (*FileIter, error) { - tree, err := c.Tree() - if err != nil { - return nil, err - } - - return tree.Files(), nil -} - -// ID returns the object ID of the commit. The returned value will always match -// the current value of Commit.Hash. -// -// ID is present to fulfill the Object interface. -func (c *Commit) ID() plumbing.Hash { - return c.Hash -} - -// Type returns the type of object. It always returns plumbing.CommitObject. -// -// Type is present to fulfill the Object interface. -func (c *Commit) Type() plumbing.ObjectType { - return plumbing.CommitObject -} - -// Decode transforms a plumbing.EncodedObject into a Commit struct. -func (c *Commit) Decode(o plumbing.EncodedObject) (err error) { - if o.Type() != plumbing.CommitObject { - return ErrUnsupportedObject - } - - c.Hash = o.Hash() - c.Encoding = defaultUtf8CommitMesageEncoding - - reader, err := o.Reader() - if err != nil { - return err - } - defer ioutil.CheckClose(reader, &err) - - r := sync.GetBufioReader(reader) - defer sync.PutBufioReader(r) - - var message bool - var mergetag bool - var pgpsig bool - var msgbuf bytes.Buffer - for { - line, err := r.ReadBytes('\n') - if err != nil && err != io.EOF { - return err - } - - if mergetag { - if len(line) > 0 && line[0] == ' ' { - line = bytes.TrimLeft(line, " ") - c.MergeTag += string(line) - continue - } else { - mergetag = false - } - } - - if pgpsig { - if len(line) > 0 && line[0] == ' ' { - line = bytes.TrimLeft(line, " ") - c.PGPSignature += string(line) - continue - } else { - pgpsig = false - } - } - - if !message { - line = bytes.TrimSpace(line) - if len(line) == 0 { - message = true - continue - } - - split := bytes.SplitN(line, []byte{' '}, 2) - - var data []byte - if len(split) == 2 { - data = split[1] - } - - switch string(split[0]) { - case "tree": - c.TreeHash = plumbing.NewHash(string(data)) - case "parent": - c.ParentHashes = append(c.ParentHashes, plumbing.NewHash(string(data))) - case "author": - c.Author.Decode(data) - case "committer": - c.Committer.Decode(data) - case headermergetag: - c.MergeTag += string(data) + "\n" - mergetag = true - case headerencoding: - c.Encoding = MessageEncoding(data) - case headerpgp: - c.PGPSignature += string(data) + "\n" - pgpsig = true - } - } else { - msgbuf.Write(line) - } - - if err == io.EOF { - break - } - } - c.Message = msgbuf.String() - return nil -} - -// Encode transforms a Commit into a plumbing.EncodedObject. -func (c *Commit) Encode(o plumbing.EncodedObject) error { - return c.encode(o, true) -} - -// EncodeWithoutSignature export a Commit into a plumbing.EncodedObject without the signature (correspond to the payload of the PGP signature). -func (c *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error { - return c.encode(o, false) -} - -func (c *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) { - o.SetType(plumbing.CommitObject) - w, err := o.Writer() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - - if _, err = fmt.Fprintf(w, "tree %s\n", c.TreeHash.String()); err != nil { - return err - } - - for _, parent := range c.ParentHashes { - if _, err = fmt.Fprintf(w, "parent %s\n", parent.String()); err != nil { - return err - } - } - - if _, err = fmt.Fprint(w, "author "); err != nil { - return err - } - - if err = c.Author.Encode(w); err != nil { - return err - } - - if _, err = fmt.Fprint(w, "\ncommitter "); err != nil { - return err - } - - if err = c.Committer.Encode(w); err != nil { - return err - } - - if c.MergeTag != "" { - if _, err = fmt.Fprint(w, "\n"+headermergetag+" "); err != nil { - return err - } - - // Split tag information lines and re-write with a left padding and - // newline. Use join for this so it's clear that a newline should not be - // added after this section. The newline will be added either as part of - // the PGP signature or the commit message. - mergetag := strings.TrimSuffix(c.MergeTag, "\n") - lines := strings.Split(mergetag, "\n") - if _, err = fmt.Fprint(w, strings.Join(lines, "\n ")); err != nil { - return err - } - } - - if string(c.Encoding) != "" && c.Encoding != defaultUtf8CommitMesageEncoding { - if _, err = fmt.Fprintf(w, "\n%s %s", headerencoding, c.Encoding); err != nil { - return err - } - } - - if c.PGPSignature != "" && includeSig { - if _, err = fmt.Fprint(w, "\n"+headerpgp+" "); err != nil { - return err - } - - // Split all the signature lines and re-write with a left padding and - // newline. Use join for this so it's clear that a newline should not be - // added after this section, as it will be added when the message is - // printed. - signature := strings.TrimSuffix(c.PGPSignature, "\n") - lines := strings.Split(signature, "\n") - if _, err = fmt.Fprint(w, strings.Join(lines, "\n ")); err != nil { - return err - } - } - - if _, err = fmt.Fprintf(w, "\n\n%s", c.Message); err != nil { - return err - } - - return err -} - -// Stats returns the stats of a commit. -func (c *Commit) Stats() (FileStats, error) { - return c.StatsContext(context.Background()) -} - -// StatsContext returns the stats of a commit. Error will be return if context -// expires. Provided context must be non-nil. -func (c *Commit) StatsContext(ctx context.Context) (FileStats, error) { - fromTree, err := c.Tree() - if err != nil { - return nil, err - } - - toTree := &Tree{} - if c.NumParents() != 0 { - firstParent, err := c.Parents().Next() - if err != nil { - return nil, err - } - - toTree, err = firstParent.Tree() - if err != nil { - return nil, err - } - } - - patch, err := toTree.PatchContext(ctx, fromTree) - if err != nil { - return nil, err - } - - return getFileStatsFromFilePatches(patch.FilePatches()), nil -} - -func (c *Commit) String() string { - return fmt.Sprintf( - "%s %s\nAuthor: %s\nDate: %s\n\n%s\n", - plumbing.CommitObject, c.Hash, c.Author.String(), - c.Author.When.Format(DateFormat), indent(c.Message), - ) -} - -// Verify performs PGP verification of the commit with a provided armored -// keyring and returns openpgp.Entity associated with verifying key on success. -func (c *Commit) Verify(armoredKeyRing string) (*openpgp.Entity, error) { - keyRingReader := strings.NewReader(armoredKeyRing) - keyring, err := openpgp.ReadArmoredKeyRing(keyRingReader) - if err != nil { - return nil, err - } - - // Extract signature. - signature := strings.NewReader(c.PGPSignature) - - encoded := &plumbing.MemoryObject{} - // Encode commit components, excluding signature and get a reader object. - if err := c.EncodeWithoutSignature(encoded); err != nil { - return nil, err - } - er, err := encoded.Reader() - if err != nil { - return nil, err - } - - return openpgp.CheckArmoredDetachedSignature(keyring, er, signature, nil) -} - -// Less defines a compare function to determine which commit is 'earlier' by: -// - First use Committer.When -// - If Committer.When are equal then use Author.When -// - If Author.When also equal then compare the string value of the hash -func (c *Commit) Less(rhs *Commit) bool { - return c.Committer.When.Before(rhs.Committer.When) || - (c.Committer.When.Equal(rhs.Committer.When) && - (c.Author.When.Before(rhs.Author.When) || - (c.Author.When.Equal(rhs.Author.When) && bytes.Compare(c.Hash[:], rhs.Hash[:]) < 0))) -} - -func indent(t string) string { - var output []string - for _, line := range strings.Split(t, "\n") { - if len(line) != 0 { - line = " " + line - } - - output = append(output, line) - } - - return strings.Join(output, "\n") -} - -// CommitIter is a generic closable interface for iterating over commits. -type CommitIter interface { - Next() (*Commit, error) - ForEach(func(*Commit) error) error - Close() -} - -// storerCommitIter provides an iterator from commits in an EncodedObjectStorer. -type storerCommitIter struct { - storer.EncodedObjectIter - s storer.EncodedObjectStorer -} - -// NewCommitIter takes a storer.EncodedObjectStorer and a -// storer.EncodedObjectIter and returns a CommitIter that iterates over all -// commits contained in the storer.EncodedObjectIter. -// -// Any non-commit object returned by the storer.EncodedObjectIter is skipped. -func NewCommitIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) CommitIter { - return &storerCommitIter{iter, s} -} - -// Next moves the iterator to the next commit and returns a pointer to it. If -// there are no more commits, it returns io.EOF. -func (iter *storerCommitIter) Next() (*Commit, error) { - obj, err := iter.EncodedObjectIter.Next() - if err != nil { - return nil, err - } - - return DecodeCommit(iter.s, obj) -} - -// ForEach call the cb function for each commit contained on this iter until -// an error appends or the end of the iter is reached. If ErrStop is sent -// the iteration is stopped but no error is returned. The iterator is closed. -func (iter *storerCommitIter) ForEach(cb func(*Commit) error) error { - return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error { - c, err := DecodeCommit(iter.s, obj) - if err != nil { - return err - } - - return cb(c) - }) -} - -func (iter *storerCommitIter) Close() { - iter.EncodedObjectIter.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker.go deleted file mode 100644 index a96b6a4cf0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker.go +++ /dev/null @@ -1,327 +0,0 @@ -package object - -import ( - "container/list" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage" -) - -type commitPreIterator struct { - seenExternal map[plumbing.Hash]bool - seen map[plumbing.Hash]bool - stack []CommitIter - start *Commit -} - -// NewCommitPreorderIter returns a CommitIter that walks the commit history, -// starting at the given commit and visiting its parents in pre-order. -// The given callback will be called for each visited commit. Each commit will -// be visited only once. If the callback returns an error, walking will stop -// and will return the error. Other errors might be returned if the history -// cannot be traversed (e.g. missing objects). Ignore allows to skip some -// commits from being iterated. -func NewCommitPreorderIter( - c *Commit, - seenExternal map[plumbing.Hash]bool, - ignore []plumbing.Hash, -) CommitIter { - seen := make(map[plumbing.Hash]bool) - for _, h := range ignore { - seen[h] = true - } - - return &commitPreIterator{ - seenExternal: seenExternal, - seen: seen, - stack: make([]CommitIter, 0), - start: c, - } -} - -func (w *commitPreIterator) Next() (*Commit, error) { - var c *Commit - for { - if w.start != nil { - c = w.start - w.start = nil - } else { - current := len(w.stack) - 1 - if current < 0 { - return nil, io.EOF - } - - var err error - c, err = w.stack[current].Next() - if err == io.EOF { - w.stack = w.stack[:current] - continue - } - - if err != nil { - return nil, err - } - } - - if w.seen[c.Hash] || w.seenExternal[c.Hash] { - continue - } - - w.seen[c.Hash] = true - - if c.NumParents() > 0 { - w.stack = append(w.stack, filteredParentIter(c, w.seen)) - } - - return c, nil - } -} - -func filteredParentIter(c *Commit, seen map[plumbing.Hash]bool) CommitIter { - var hashes []plumbing.Hash - for _, h := range c.ParentHashes { - if !seen[h] { - hashes = append(hashes, h) - } - } - - return NewCommitIter(c.s, - storer.NewEncodedObjectLookupIter(c.s, plumbing.CommitObject, hashes), - ) -} - -func (w *commitPreIterator) ForEach(cb func(*Commit) error) error { - for { - c, err := w.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - err = cb(c) - if err == storer.ErrStop { - break - } - if err != nil { - return err - } - } - - return nil -} - -func (w *commitPreIterator) Close() {} - -type commitPostIterator struct { - stack []*Commit - seen map[plumbing.Hash]bool -} - -// NewCommitPostorderIter returns a CommitIter that walks the commit -// history like WalkCommitHistory but in post-order. This means that after -// walking a merge commit, the merged commit will be walked before the base -// it was merged on. This can be useful if you wish to see the history in -// chronological order. Ignore allows to skip some commits from being iterated. -func NewCommitPostorderIter(c *Commit, ignore []plumbing.Hash) CommitIter { - seen := make(map[plumbing.Hash]bool) - for _, h := range ignore { - seen[h] = true - } - - return &commitPostIterator{ - stack: []*Commit{c}, - seen: seen, - } -} - -func (w *commitPostIterator) Next() (*Commit, error) { - for { - if len(w.stack) == 0 { - return nil, io.EOF - } - - c := w.stack[len(w.stack)-1] - w.stack = w.stack[:len(w.stack)-1] - - if w.seen[c.Hash] { - continue - } - - w.seen[c.Hash] = true - - return c, c.Parents().ForEach(func(p *Commit) error { - w.stack = append(w.stack, p) - return nil - }) - } -} - -func (w *commitPostIterator) ForEach(cb func(*Commit) error) error { - for { - c, err := w.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - err = cb(c) - if err == storer.ErrStop { - break - } - if err != nil { - return err - } - } - - return nil -} - -func (w *commitPostIterator) Close() {} - -// commitAllIterator stands for commit iterator for all refs. -type commitAllIterator struct { - // currCommit points to the current commit. - currCommit *list.Element -} - -// NewCommitAllIter returns a new commit iterator for all refs. -// repoStorer is a repo Storer used to get commits and references. -// commitIterFunc is a commit iterator function, used to iterate through ref commits in chosen order -func NewCommitAllIter(repoStorer storage.Storer, commitIterFunc func(*Commit) CommitIter) (CommitIter, error) { - commitsPath := list.New() - commitsLookup := make(map[plumbing.Hash]*list.Element) - head, err := storer.ResolveReference(repoStorer, plumbing.HEAD) - if err == nil { - err = addReference(repoStorer, commitIterFunc, head, commitsPath, commitsLookup) - } - - if err != nil && err != plumbing.ErrReferenceNotFound { - return nil, err - } - - // add all references along with the HEAD - refIter, err := repoStorer.IterReferences() - if err != nil { - return nil, err - } - defer refIter.Close() - - for { - ref, err := refIter.Next() - if err == io.EOF { - break - } - - if err == plumbing.ErrReferenceNotFound { - continue - } - - if err != nil { - return nil, err - } - - if err = addReference(repoStorer, commitIterFunc, ref, commitsPath, commitsLookup); err != nil { - return nil, err - } - } - - return &commitAllIterator{commitsPath.Front()}, nil -} - -func addReference( - repoStorer storage.Storer, - commitIterFunc func(*Commit) CommitIter, - ref *plumbing.Reference, - commitsPath *list.List, - commitsLookup map[plumbing.Hash]*list.Element) error { - - _, exists := commitsLookup[ref.Hash()] - if exists { - // we already have it - skip the reference. - return nil - } - - refCommit, _ := GetCommit(repoStorer, ref.Hash()) - if refCommit == nil { - // if it's not a commit - skip it. - return nil - } - - var ( - refCommits []*Commit - parent *list.Element - ) - // collect all ref commits to add - commitIter := commitIterFunc(refCommit) - for c, e := commitIter.Next(); e == nil; { - parent, exists = commitsLookup[c.Hash] - if exists { - break - } - refCommits = append(refCommits, c) - c, e = commitIter.Next() - } - commitIter.Close() - - if parent == nil { - // common parent - not found - // add all commits to the path from this ref (maybe it's a HEAD and we don't have anything, yet) - for _, c := range refCommits { - parent = commitsPath.PushBack(c) - commitsLookup[c.Hash] = parent - } - } else { - // add ref's commits to the path in reverse order (from the latest) - for i := len(refCommits) - 1; i >= 0; i-- { - c := refCommits[i] - // insert before found common parent - parent = commitsPath.InsertBefore(c, parent) - commitsLookup[c.Hash] = parent - } - } - - return nil -} - -func (it *commitAllIterator) Next() (*Commit, error) { - if it.currCommit == nil { - return nil, io.EOF - } - - c := it.currCommit.Value.(*Commit) - it.currCommit = it.currCommit.Next() - - return c, nil -} - -func (it *commitAllIterator) ForEach(cb func(*Commit) error) error { - for { - c, err := it.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - err = cb(c) - if err == storer.ErrStop { - break - } - if err != nil { - return err - } - } - - return nil -} - -func (it *commitAllIterator) Close() { - it.currCommit = nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs.go deleted file mode 100644 index 8047fa9bc0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs.go +++ /dev/null @@ -1,100 +0,0 @@ -package object - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -type bfsCommitIterator struct { - seenExternal map[plumbing.Hash]bool - seen map[plumbing.Hash]bool - queue []*Commit -} - -// NewCommitIterBSF returns a CommitIter that walks the commit history, -// starting at the given commit and visiting its parents in pre-order. -// The given callback will be called for each visited commit. Each commit will -// be visited only once. If the callback returns an error, walking will stop -// and will return the error. Other errors might be returned if the history -// cannot be traversed (e.g. missing objects). Ignore allows to skip some -// commits from being iterated. -func NewCommitIterBSF( - c *Commit, - seenExternal map[plumbing.Hash]bool, - ignore []plumbing.Hash, -) CommitIter { - seen := make(map[plumbing.Hash]bool) - for _, h := range ignore { - seen[h] = true - } - - return &bfsCommitIterator{ - seenExternal: seenExternal, - seen: seen, - queue: []*Commit{c}, - } -} - -func (w *bfsCommitIterator) appendHash(store storer.EncodedObjectStorer, h plumbing.Hash) error { - if w.seen[h] || w.seenExternal[h] { - return nil - } - c, err := GetCommit(store, h) - if err != nil { - return err - } - w.queue = append(w.queue, c) - return nil -} - -func (w *bfsCommitIterator) Next() (*Commit, error) { - var c *Commit - for { - if len(w.queue) == 0 { - return nil, io.EOF - } - c = w.queue[0] - w.queue = w.queue[1:] - - if w.seen[c.Hash] || w.seenExternal[c.Hash] { - continue - } - - w.seen[c.Hash] = true - - for _, h := range c.ParentHashes { - err := w.appendHash(c.s, h) - if err != nil { - return nil, err - } - } - - return c, nil - } -} - -func (w *bfsCommitIterator) ForEach(cb func(*Commit) error) error { - for { - c, err := w.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - err = cb(c) - if err == storer.ErrStop { - break - } - if err != nil { - return err - } - } - - return nil -} - -func (w *bfsCommitIterator) Close() {} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs_filtered.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs_filtered.go deleted file mode 100644 index 9d518133e2..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_bfs_filtered.go +++ /dev/null @@ -1,175 +0,0 @@ -package object - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -// NewFilterCommitIter returns a CommitIter that walks the commit history, -// starting at the passed commit and visiting its parents in Breadth-first order. -// The commits returned by the CommitIter will validate the passed CommitFilter. -// The history won't be transversed beyond a commit if isLimit is true for it. -// Each commit will be visited only once. -// If the commit history can not be traversed, or the Close() method is called, -// the CommitIter won't return more commits. -// If no isValid is passed, all ancestors of from commit will be valid. -// If no isLimit is limit, all ancestors of all commits will be visited. -func NewFilterCommitIter( - from *Commit, - isValid *CommitFilter, - isLimit *CommitFilter, -) CommitIter { - var validFilter CommitFilter - if isValid == nil { - validFilter = func(_ *Commit) bool { - return true - } - } else { - validFilter = *isValid - } - - var limitFilter CommitFilter - if isLimit == nil { - limitFilter = func(_ *Commit) bool { - return false - } - } else { - limitFilter = *isLimit - } - - return &filterCommitIter{ - isValid: validFilter, - isLimit: limitFilter, - visited: map[plumbing.Hash]struct{}{}, - queue: []*Commit{from}, - } -} - -// CommitFilter returns a boolean for the passed Commit -type CommitFilter func(*Commit) bool - -// filterCommitIter implements CommitIter -type filterCommitIter struct { - isValid CommitFilter - isLimit CommitFilter - visited map[plumbing.Hash]struct{} - queue []*Commit - lastErr error -} - -// Next returns the next commit of the CommitIter. -// It will return io.EOF if there are no more commits to visit, -// or an error if the history could not be traversed. -func (w *filterCommitIter) Next() (*Commit, error) { - var commit *Commit - var err error - for { - commit, err = w.popNewFromQueue() - if err != nil { - return nil, w.close(err) - } - - w.visited[commit.Hash] = struct{}{} - - if !w.isLimit(commit) { - err = w.addToQueue(commit.s, commit.ParentHashes...) - if err != nil { - return nil, w.close(err) - } - } - - if w.isValid(commit) { - return commit, nil - } - } -} - -// ForEach runs the passed callback over each Commit returned by the CommitIter -// until the callback returns an error or there is no more commits to traverse. -func (w *filterCommitIter) ForEach(cb func(*Commit) error) error { - for { - commit, err := w.Next() - if err == io.EOF { - break - } - - if err != nil { - return err - } - - if err := cb(commit); err == storer.ErrStop { - break - } else if err != nil { - return err - } - } - - return nil -} - -// Error returns the error that caused that the CommitIter is no longer returning commits -func (w *filterCommitIter) Error() error { - return w.lastErr -} - -// Close closes the CommitIter -func (w *filterCommitIter) Close() { - w.visited = map[plumbing.Hash]struct{}{} - w.queue = []*Commit{} - w.isLimit = nil - w.isValid = nil -} - -// close closes the CommitIter with an error -func (w *filterCommitIter) close(err error) error { - w.Close() - w.lastErr = err - return err -} - -// popNewFromQueue returns the first new commit from the internal fifo queue, -// or an io.EOF error if the queue is empty -func (w *filterCommitIter) popNewFromQueue() (*Commit, error) { - var first *Commit - for { - if len(w.queue) == 0 { - if w.lastErr != nil { - return nil, w.lastErr - } - - return nil, io.EOF - } - - first = w.queue[0] - w.queue = w.queue[1:] - if _, ok := w.visited[first.Hash]; ok { - continue - } - - return first, nil - } -} - -// addToQueue adds the passed commits to the internal fifo queue if they weren't seen -// or returns an error if the passed hashes could not be used to get valid commits -func (w *filterCommitIter) addToQueue( - store storer.EncodedObjectStorer, - hashes ...plumbing.Hash, -) error { - for _, hash := range hashes { - if _, ok := w.visited[hash]; ok { - continue - } - - commit, err := GetCommit(store, hash) - if err != nil { - return err - } - - w.queue = append(w.queue, commit) - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_ctime.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_ctime.go deleted file mode 100644 index fbddf1d238..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_ctime.go +++ /dev/null @@ -1,103 +0,0 @@ -package object - -import ( - "io" - - "github.com/emirpasic/gods/trees/binaryheap" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -type commitIteratorByCTime struct { - seenExternal map[plumbing.Hash]bool - seen map[plumbing.Hash]bool - heap *binaryheap.Heap -} - -// NewCommitIterCTime returns a CommitIter that walks the commit history, -// starting at the given commit and visiting its parents while preserving Committer Time order. -// this appears to be the closest order to `git log` -// The given callback will be called for each visited commit. Each commit will -// be visited only once. If the callback returns an error, walking will stop -// and will return the error. Other errors might be returned if the history -// cannot be traversed (e.g. missing objects). Ignore allows to skip some -// commits from being iterated. -func NewCommitIterCTime( - c *Commit, - seenExternal map[plumbing.Hash]bool, - ignore []plumbing.Hash, -) CommitIter { - seen := make(map[plumbing.Hash]bool) - for _, h := range ignore { - seen[h] = true - } - - heap := binaryheap.NewWith(func(a, b interface{}) int { - if a.(*Commit).Committer.When.Before(b.(*Commit).Committer.When) { - return 1 - } - return -1 - }) - heap.Push(c) - - return &commitIteratorByCTime{ - seenExternal: seenExternal, - seen: seen, - heap: heap, - } -} - -func (w *commitIteratorByCTime) Next() (*Commit, error) { - var c *Commit - for { - cIn, ok := w.heap.Pop() - if !ok { - return nil, io.EOF - } - c = cIn.(*Commit) - - if w.seen[c.Hash] || w.seenExternal[c.Hash] { - continue - } - - w.seen[c.Hash] = true - - for _, h := range c.ParentHashes { - if w.seen[h] || w.seenExternal[h] { - continue - } - pc, err := GetCommit(c.s, h) - if err != nil { - return nil, err - } - w.heap.Push(pc) - } - - return c, nil - } -} - -func (w *commitIteratorByCTime) ForEach(cb func(*Commit) error) error { - for { - c, err := w.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - err = cb(c) - if err == storer.ErrStop { - break - } - if err != nil { - return err - } - } - - return nil -} - -func (w *commitIteratorByCTime) Close() {} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_limit.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_limit.go deleted file mode 100644 index ac56a71c41..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_limit.go +++ /dev/null @@ -1,65 +0,0 @@ -package object - -import ( - "io" - "time" - - "github.com/go-git/go-git/v5/plumbing/storer" -) - -type commitLimitIter struct { - sourceIter CommitIter - limitOptions LogLimitOptions -} - -type LogLimitOptions struct { - Since *time.Time - Until *time.Time -} - -func NewCommitLimitIterFromIter(commitIter CommitIter, limitOptions LogLimitOptions) CommitIter { - iterator := new(commitLimitIter) - iterator.sourceIter = commitIter - iterator.limitOptions = limitOptions - return iterator -} - -func (c *commitLimitIter) Next() (*Commit, error) { - for { - commit, err := c.sourceIter.Next() - if err != nil { - return nil, err - } - - if c.limitOptions.Since != nil && commit.Committer.When.Before(*c.limitOptions.Since) { - continue - } - if c.limitOptions.Until != nil && commit.Committer.When.After(*c.limitOptions.Until) { - continue - } - return commit, nil - } -} - -func (c *commitLimitIter) ForEach(cb func(*Commit) error) error { - for { - commit, nextErr := c.Next() - if nextErr == io.EOF { - break - } - if nextErr != nil { - return nextErr - } - err := cb(commit) - if err == storer.ErrStop { - return nil - } else if err != nil { - return err - } - } - return nil -} - -func (c *commitLimitIter) Close() { - c.sourceIter.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_path.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_path.go deleted file mode 100644 index aa0ca15fd0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/commit_walker_path.go +++ /dev/null @@ -1,160 +0,0 @@ -package object - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -type commitPathIter struct { - pathFilter func(string) bool - sourceIter CommitIter - currentCommit *Commit - checkParent bool -} - -// NewCommitPathIterFromIter returns a commit iterator which performs diffTree between -// successive trees returned from the commit iterator from the argument. The purpose of this is -// to find the commits that explain how the files that match the path came to be. -// If checkParent is true then the function double checks if potential parent (next commit in a path) -// is one of the parents in the tree (it's used by `git log --all`). -// pathFilter is a function that takes path of file as argument and returns true if we want it -func NewCommitPathIterFromIter(pathFilter func(string) bool, commitIter CommitIter, checkParent bool) CommitIter { - iterator := new(commitPathIter) - iterator.sourceIter = commitIter - iterator.pathFilter = pathFilter - iterator.checkParent = checkParent - return iterator -} - -// NewCommitFileIterFromIter is kept for compatibility, can be replaced with NewCommitPathIterFromIter -func NewCommitFileIterFromIter(fileName string, commitIter CommitIter, checkParent bool) CommitIter { - return NewCommitPathIterFromIter( - func(path string) bool { - return path == fileName - }, - commitIter, - checkParent, - ) -} - -func (c *commitPathIter) Next() (*Commit, error) { - if c.currentCommit == nil { - var err error - c.currentCommit, err = c.sourceIter.Next() - if err != nil { - return nil, err - } - } - commit, commitErr := c.getNextFileCommit() - - // Setting current-commit to nil to prevent unwanted states when errors are raised - if commitErr != nil { - c.currentCommit = nil - } - return commit, commitErr -} - -func (c *commitPathIter) getNextFileCommit() (*Commit, error) { - for { - // Parent-commit can be nil if the current-commit is the initial commit - parentCommit, parentCommitErr := c.sourceIter.Next() - if parentCommitErr != nil { - // If the parent-commit is beyond the initial commit, keep it nil - if parentCommitErr != io.EOF { - return nil, parentCommitErr - } - parentCommit = nil - } - - // Fetch the trees of the current and parent commits - currentTree, currTreeErr := c.currentCommit.Tree() - if currTreeErr != nil { - return nil, currTreeErr - } - - var parentTree *Tree - if parentCommit != nil { - var parentTreeErr error - parentTree, parentTreeErr = parentCommit.Tree() - if parentTreeErr != nil { - return nil, parentTreeErr - } - } - - // Find diff between current and parent trees - changes, diffErr := DiffTree(currentTree, parentTree) - if diffErr != nil { - return nil, diffErr - } - - found := c.hasFileChange(changes, parentCommit) - - // Storing the current-commit in-case a change is found, and - // Updating the current-commit for the next-iteration - prevCommit := c.currentCommit - c.currentCommit = parentCommit - - if found { - return prevCommit, nil - } - - // If not matches found and if parent-commit is beyond the initial commit, then return with EOF - if parentCommit == nil { - return nil, io.EOF - } - } -} - -func (c *commitPathIter) hasFileChange(changes Changes, parent *Commit) bool { - for _, change := range changes { - if !c.pathFilter(change.name()) { - continue - } - - // filename matches, now check if source iterator contains all commits (from all refs) - if c.checkParent { - if parent != nil && isParentHash(parent.Hash, c.currentCommit) { - return true - } - continue - } - - return true - } - - return false -} - -func isParentHash(hash plumbing.Hash, commit *Commit) bool { - for _, h := range commit.ParentHashes { - if h == hash { - return true - } - } - return false -} - -func (c *commitPathIter) ForEach(cb func(*Commit) error) error { - for { - commit, nextErr := c.Next() - if nextErr == io.EOF { - break - } - if nextErr != nil { - return nextErr - } - err := cb(commit) - if err == storer.ErrStop { - return nil - } else if err != nil { - return err - } - } - return nil -} - -func (c *commitPathIter) Close() { - c.sourceIter.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go deleted file mode 100644 index 7c2222702c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/difftree.go +++ /dev/null @@ -1,98 +0,0 @@ -package object - -import ( - "bytes" - "context" - - "github.com/go-git/go-git/v5/utils/merkletrie" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// DiffTree compares the content and mode of the blobs found via two -// tree objects. -// DiffTree does not perform rename detection, use DiffTreeWithOptions -// instead to detect renames. -func DiffTree(a, b *Tree) (Changes, error) { - return DiffTreeContext(context.Background(), a, b) -} - -// DiffTreeContext compares the content and mode of the blobs found via two -// tree objects. Provided context must be non-nil. -// An error will be returned if context expires. -func DiffTreeContext(ctx context.Context, a, b *Tree) (Changes, error) { - return DiffTreeWithOptions(ctx, a, b, nil) -} - -// DiffTreeOptions are the configurable options when performing a diff tree. -type DiffTreeOptions struct { - // DetectRenames is whether the diff tree will use rename detection. - DetectRenames bool - // RenameScore is the threshold to of similarity between files to consider - // that a pair of delete and insert are a rename. The number must be - // exactly between 0 and 100. - RenameScore uint - // RenameLimit is the maximum amount of files that can be compared when - // detecting renames. The number of comparisons that have to be performed - // is equal to the number of deleted files * the number of added files. - // That means, that if 100 files were deleted and 50 files were added, 5000 - // file comparisons may be needed. So, if the rename limit is 50, the number - // of both deleted and added needs to be equal or less than 50. - // A value of 0 means no limit. - RenameLimit uint - // OnlyExactRenames performs only detection of exact renames and will not perform - // any detection of renames based on file similarity. - OnlyExactRenames bool -} - -// DefaultDiffTreeOptions are the default and recommended options for the -// diff tree. -var DefaultDiffTreeOptions = &DiffTreeOptions{ - DetectRenames: true, - RenameScore: 60, - RenameLimit: 0, - OnlyExactRenames: false, -} - -// DiffTreeWithOptions compares the content and mode of the blobs found -// via two tree objects with the given options. The provided context -// must be non-nil. -// If no options are passed, no rename detection will be performed. The -// recommended options are DefaultDiffTreeOptions. -// An error will be returned if the context expires. -// This function will be deprecated and removed in v6 so the default -// behaviour of DiffTree is to detect renames. -func DiffTreeWithOptions( - ctx context.Context, - a, b *Tree, - opts *DiffTreeOptions, -) (Changes, error) { - from := NewTreeRootNode(a) - to := NewTreeRootNode(b) - - hashEqual := func(a, b noder.Hasher) bool { - return bytes.Equal(a.Hash(), b.Hash()) - } - - merkletrieChanges, err := merkletrie.DiffTreeContext(ctx, from, to, hashEqual) - if err != nil { - if err == merkletrie.ErrCanceled { - return nil, ErrCanceled - } - return nil, err - } - - changes, err := newChanges(merkletrieChanges) - if err != nil { - return nil, err - } - - if opts == nil { - opts = new(DiffTreeOptions) - } - - if opts.DetectRenames { - return DetectRenames(changes, opts) - } - - return changes, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/file.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/file.go deleted file mode 100644 index 6cc5367d8d..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/file.go +++ /dev/null @@ -1,137 +0,0 @@ -package object - -import ( - "bytes" - "io" - "strings" - - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/binary" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// File represents git file objects. -type File struct { - // Name is the path of the file. It might be relative to a tree, - // depending of the function that generates it. - Name string - // Mode is the file mode. - Mode filemode.FileMode - // Blob with the contents of the file. - Blob -} - -// NewFile returns a File based on the given blob object -func NewFile(name string, m filemode.FileMode, b *Blob) *File { - return &File{Name: name, Mode: m, Blob: *b} -} - -// Contents returns the contents of a file as a string. -func (f *File) Contents() (content string, err error) { - reader, err := f.Reader() - if err != nil { - return "", err - } - defer ioutil.CheckClose(reader, &err) - - buf := new(bytes.Buffer) - if _, err := buf.ReadFrom(reader); err != nil { - return "", err - } - - return buf.String(), nil -} - -// IsBinary returns if the file is binary or not -func (f *File) IsBinary() (bin bool, err error) { - reader, err := f.Reader() - if err != nil { - return false, err - } - defer ioutil.CheckClose(reader, &err) - - return binary.IsBinary(reader) -} - -// Lines returns a slice of lines from the contents of a file, stripping -// all end of line characters. If the last line is empty (does not end -// in an end of line), it is also stripped. -func (f *File) Lines() ([]string, error) { - content, err := f.Contents() - if err != nil { - return nil, err - } - - splits := strings.Split(content, "\n") - // remove the last line if it is empty - if splits[len(splits)-1] == "" { - return splits[:len(splits)-1], nil - } - - return splits, nil -} - -// FileIter provides an iterator for the files in a tree. -type FileIter struct { - s storer.EncodedObjectStorer - w TreeWalker -} - -// NewFileIter takes a storer.EncodedObjectStorer and a Tree and returns a -// *FileIter that iterates over all files contained in the tree, recursively. -func NewFileIter(s storer.EncodedObjectStorer, t *Tree) *FileIter { - return &FileIter{s: s, w: *NewTreeWalker(t, true, nil)} -} - -// Next moves the iterator to the next file and returns a pointer to it. If -// there are no more files, it returns io.EOF. -func (iter *FileIter) Next() (*File, error) { - for { - name, entry, err := iter.w.Next() - if err != nil { - return nil, err - } - - if entry.Mode == filemode.Dir || entry.Mode == filemode.Submodule { - continue - } - - blob, err := GetBlob(iter.s, entry.Hash) - if err != nil { - return nil, err - } - - return NewFile(name, entry.Mode, blob), nil - } -} - -// ForEach call the cb function for each file contained in this iter until -// an error happens or the end of the iter is reached. If plumbing.ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *FileIter) ForEach(cb func(*File) error) error { - defer iter.Close() - - for { - f, err := iter.Next() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - if err := cb(f); err != nil { - if err == storer.ErrStop { - return nil - } - - return err - } - } -} - -func (iter *FileIter) Close() { - iter.w.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/merge_base.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/merge_base.go deleted file mode 100644 index b412361d02..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/merge_base.go +++ /dev/null @@ -1,210 +0,0 @@ -package object - -import ( - "fmt" - "sort" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -// errIsReachable is thrown when first commit is an ancestor of the second -var errIsReachable = fmt.Errorf("first is reachable from second") - -// MergeBase mimics the behavior of `git merge-base actual other`, returning the -// best common ancestor between the actual and the passed one. -// The best common ancestors can not be reached from other common ancestors. -func (c *Commit) MergeBase(other *Commit) ([]*Commit, error) { - // use sortedByCommitDateDesc strategy - sorted := sortByCommitDateDesc(c, other) - newer := sorted[0] - older := sorted[1] - - newerHistory, err := ancestorsIndex(older, newer) - if err == errIsReachable { - return []*Commit{older}, nil - } - - if err != nil { - return nil, err - } - - var res []*Commit - inNewerHistory := isInIndexCommitFilter(newerHistory) - resIter := NewFilterCommitIter(older, &inNewerHistory, &inNewerHistory) - _ = resIter.ForEach(func(commit *Commit) error { - res = append(res, commit) - return nil - }) - - return Independents(res) -} - -// IsAncestor returns true if the actual commit is ancestor of the passed one. -// It returns an error if the history is not transversable -// It mimics the behavior of `git merge --is-ancestor actual other` -func (c *Commit) IsAncestor(other *Commit) (bool, error) { - found := false - iter := NewCommitPreorderIter(other, nil, nil) - err := iter.ForEach(func(comm *Commit) error { - if comm.Hash != c.Hash { - return nil - } - - found = true - return storer.ErrStop - }) - - return found, err -} - -// ancestorsIndex returns a map with the ancestors of the starting commit if the -// excluded one is not one of them. It returns errIsReachable if the excluded commit -// is ancestor of the starting, or another error if the history is not traversable. -func ancestorsIndex(excluded, starting *Commit) (map[plumbing.Hash]struct{}, error) { - if excluded.Hash.String() == starting.Hash.String() { - return nil, errIsReachable - } - - startingHistory := map[plumbing.Hash]struct{}{} - startingIter := NewCommitIterBSF(starting, nil, nil) - err := startingIter.ForEach(func(commit *Commit) error { - if commit.Hash == excluded.Hash { - return errIsReachable - } - - startingHistory[commit.Hash] = struct{}{} - return nil - }) - - if err != nil { - return nil, err - } - - return startingHistory, nil -} - -// Independents returns a subset of the passed commits, that are not reachable the others -// It mimics the behavior of `git merge-base --independent commit...`. -func Independents(commits []*Commit) ([]*Commit, error) { - // use sortedByCommitDateDesc strategy - candidates := sortByCommitDateDesc(commits...) - candidates = removeDuplicated(candidates) - - seen := map[plumbing.Hash]struct{}{} - var isLimit CommitFilter = func(commit *Commit) bool { - _, ok := seen[commit.Hash] - return ok - } - - if len(candidates) < 2 { - return candidates, nil - } - - pos := 0 - for { - from := candidates[pos] - others := remove(candidates, from) - fromHistoryIter := NewFilterCommitIter(from, nil, &isLimit) - err := fromHistoryIter.ForEach(func(fromAncestor *Commit) error { - for _, other := range others { - if fromAncestor.Hash == other.Hash { - candidates = remove(candidates, other) - others = remove(others, other) - } - } - - if len(candidates) == 1 { - return storer.ErrStop - } - - seen[fromAncestor.Hash] = struct{}{} - return nil - }) - - if err != nil { - return nil, err - } - - nextPos := indexOf(candidates, from) + 1 - if nextPos >= len(candidates) { - break - } - - pos = nextPos - } - - return candidates, nil -} - -// sortByCommitDateDesc returns the passed commits, sorted by `committer.When desc` -// -// Following this strategy, it is tried to reduce the time needed when walking -// the history from one commit to reach the others. It is assumed that ancestors -// use to be committed before its descendant; -// That way `Independents(A^, A)` will be processed as being `Independents(A, A^)`; -// so starting by `A` it will be reached `A^` way sooner than walking from `A^` -// to the initial commit, and then from `A` to `A^`. -func sortByCommitDateDesc(commits ...*Commit) []*Commit { - sorted := make([]*Commit, len(commits)) - copy(sorted, commits) - sort.Slice(sorted, func(i, j int) bool { - return sorted[i].Committer.When.After(sorted[j].Committer.When) - }) - - return sorted -} - -// indexOf returns the first position where target was found in the passed commits -func indexOf(commits []*Commit, target *Commit) int { - for i, commit := range commits { - if target.Hash == commit.Hash { - return i - } - } - - return -1 -} - -// remove returns the passed commits excluding the commit toDelete -func remove(commits []*Commit, toDelete *Commit) []*Commit { - res := make([]*Commit, len(commits)) - j := 0 - for _, commit := range commits { - if commit.Hash == toDelete.Hash { - continue - } - - res[j] = commit - j++ - } - - return res[:j] -} - -// removeDuplicated removes duplicated commits from the passed slice of commits -func removeDuplicated(commits []*Commit) []*Commit { - seen := make(map[plumbing.Hash]struct{}, len(commits)) - res := make([]*Commit, len(commits)) - j := 0 - for _, commit := range commits { - if _, ok := seen[commit.Hash]; ok { - continue - } - - seen[commit.Hash] = struct{}{} - res[j] = commit - j++ - } - - return res[:j] -} - -// isInIndexCommitFilter returns a commitFilter that returns true -// if the commit is in the passed index. -func isInIndexCommitFilter(index map[plumbing.Hash]struct{}) CommitFilter { - return func(c *Commit) bool { - _, ok := index[c.Hash] - return ok - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go deleted file mode 100644 index 13b1e91c9c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/object.go +++ /dev/null @@ -1,239 +0,0 @@ -// Package object contains implementations of all Git objects and utility -// functions to work with them. -package object - -import ( - "bytes" - "errors" - "fmt" - "io" - "strconv" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -// ErrUnsupportedObject trigger when a non-supported object is being decoded. -var ErrUnsupportedObject = errors.New("unsupported object type") - -// Object is a generic representation of any git object. It is implemented by -// Commit, Tree, Blob, and Tag, and includes the functions that are common to -// them. -// -// Object is returned when an object can be of any type. It is frequently used -// with a type cast to acquire the specific type of object: -// -// func process(obj Object) { -// switch o := obj.(type) { -// case *Commit: -// // o is a Commit -// case *Tree: -// // o is a Tree -// case *Blob: -// // o is a Blob -// case *Tag: -// // o is a Tag -// } -// } -// -// This interface is intentionally different from plumbing.EncodedObject, which -// is a lower level interface used by storage implementations to read and write -// objects in its encoded form. -type Object interface { - ID() plumbing.Hash - Type() plumbing.ObjectType - Decode(plumbing.EncodedObject) error - Encode(plumbing.EncodedObject) error -} - -// GetObject gets an object from an object storer and decodes it. -func GetObject(s storer.EncodedObjectStorer, h plumbing.Hash) (Object, error) { - o, err := s.EncodedObject(plumbing.AnyObject, h) - if err != nil { - return nil, err - } - - return DecodeObject(s, o) -} - -// DecodeObject decodes an encoded object into an Object and associates it to -// the given object storer. -func DecodeObject(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (Object, error) { - switch o.Type() { - case plumbing.CommitObject: - return DecodeCommit(s, o) - case plumbing.TreeObject: - return DecodeTree(s, o) - case plumbing.BlobObject: - return DecodeBlob(o) - case plumbing.TagObject: - return DecodeTag(s, o) - default: - return nil, plumbing.ErrInvalidType - } -} - -// DateFormat is the format being used in the original git implementation -const DateFormat = "Mon Jan 02 15:04:05 2006 -0700" - -// Signature is used to identify who and when created a commit or tag. -type Signature struct { - // Name represents a person name. It is an arbitrary string. - Name string - // Email is an email, but it cannot be assumed to be well-formed. - Email string - // When is the timestamp of the signature. - When time.Time -} - -// Decode decodes a byte slice into a signature -func (s *Signature) Decode(b []byte) { - open := bytes.LastIndexByte(b, '<') - close := bytes.LastIndexByte(b, '>') - if open == -1 || close == -1 { - return - } - - if close < open { - return - } - - s.Name = string(bytes.Trim(b[:open], " ")) - s.Email = string(b[open+1 : close]) - - hasTime := close+2 < len(b) - if hasTime { - s.decodeTimeAndTimeZone(b[close+2:]) - } -} - -// Encode encodes a Signature into a writer. -func (s *Signature) Encode(w io.Writer) error { - if _, err := fmt.Fprintf(w, "%s <%s> ", s.Name, s.Email); err != nil { - return err - } - if err := s.encodeTimeAndTimeZone(w); err != nil { - return err - } - return nil -} - -var timeZoneLength = 5 - -func (s *Signature) decodeTimeAndTimeZone(b []byte) { - space := bytes.IndexByte(b, ' ') - if space == -1 { - space = len(b) - } - - ts, err := strconv.ParseInt(string(b[:space]), 10, 64) - if err != nil { - return - } - - s.When = time.Unix(ts, 0).In(time.UTC) - var tzStart = space + 1 - if tzStart >= len(b) || tzStart+timeZoneLength > len(b) { - return - } - - timezone := string(b[tzStart : tzStart+timeZoneLength]) - tzhours, err1 := strconv.ParseInt(timezone[0:3], 10, 64) - tzmins, err2 := strconv.ParseInt(timezone[3:], 10, 64) - if err1 != nil || err2 != nil { - return - } - if tzhours < 0 { - tzmins *= -1 - } - - tz := time.FixedZone("", int(tzhours*60*60+tzmins*60)) - - s.When = s.When.In(tz) -} - -func (s *Signature) encodeTimeAndTimeZone(w io.Writer) error { - u := s.When.Unix() - if u < 0 { - u = 0 - } - _, err := fmt.Fprintf(w, "%d %s", u, s.When.Format("-0700")) - return err -} - -func (s *Signature) String() string { - return fmt.Sprintf("%s <%s>", s.Name, s.Email) -} - -// ObjectIter provides an iterator for a set of objects. -type ObjectIter struct { - storer.EncodedObjectIter - s storer.EncodedObjectStorer -} - -// NewObjectIter takes a storer.EncodedObjectStorer and a -// storer.EncodedObjectIter and returns an *ObjectIter that iterates over all -// objects contained in the storer.EncodedObjectIter. -func NewObjectIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *ObjectIter { - return &ObjectIter{iter, s} -} - -// Next moves the iterator to the next object and returns a pointer to it. If -// there are no more objects, it returns io.EOF. -func (iter *ObjectIter) Next() (Object, error) { - for { - obj, err := iter.EncodedObjectIter.Next() - if err != nil { - return nil, err - } - - o, err := iter.toObject(obj) - if err == plumbing.ErrInvalidType { - continue - } - - if err != nil { - return nil, err - } - - return o, nil - } -} - -// ForEach call the cb function for each object contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *ObjectIter) ForEach(cb func(Object) error) error { - return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error { - o, err := iter.toObject(obj) - if err == plumbing.ErrInvalidType { - return nil - } - - if err != nil { - return err - } - - return cb(o) - }) -} - -func (iter *ObjectIter) toObject(obj plumbing.EncodedObject) (Object, error) { - switch obj.Type() { - case plumbing.BlobObject: - blob := &Blob{} - return blob, blob.Decode(obj) - case plumbing.TreeObject: - tree := &Tree{s: iter.s} - return tree, tree.Decode(obj) - case plumbing.CommitObject: - commit := &Commit{} - return commit, commit.Decode(obj) - case plumbing.TagObject: - tag := &Tag{} - return tag, tag.Decode(obj) - default: - return nil, plumbing.ErrInvalidType - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go deleted file mode 100644 index dd8fef4478..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/patch.go +++ /dev/null @@ -1,350 +0,0 @@ -package object - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "math" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - fdiff "github.com/go-git/go-git/v5/plumbing/format/diff" - "github.com/go-git/go-git/v5/utils/diff" - - dmp "github.com/sergi/go-diff/diffmatchpatch" -) - -var ( - ErrCanceled = errors.New("operation canceled") -) - -func getPatch(message string, changes ...*Change) (*Patch, error) { - ctx := context.Background() - return getPatchContext(ctx, message, changes...) -} - -func getPatchContext(ctx context.Context, message string, changes ...*Change) (*Patch, error) { - var filePatches []fdiff.FilePatch - for _, c := range changes { - select { - case <-ctx.Done(): - return nil, ErrCanceled - default: - } - - fp, err := filePatchWithContext(ctx, c) - if err != nil { - return nil, err - } - - filePatches = append(filePatches, fp) - } - - return &Patch{message, filePatches}, nil -} - -func filePatchWithContext(ctx context.Context, c *Change) (fdiff.FilePatch, error) { - from, to, err := c.Files() - if err != nil { - return nil, err - } - fromContent, fIsBinary, err := fileContent(from) - if err != nil { - return nil, err - } - - toContent, tIsBinary, err := fileContent(to) - if err != nil { - return nil, err - } - - if fIsBinary || tIsBinary { - return &textFilePatch{from: c.From, to: c.To}, nil - } - - diffs := diff.Do(fromContent, toContent) - - var chunks []fdiff.Chunk - for _, d := range diffs { - select { - case <-ctx.Done(): - return nil, ErrCanceled - default: - } - - var op fdiff.Operation - switch d.Type { - case dmp.DiffEqual: - op = fdiff.Equal - case dmp.DiffDelete: - op = fdiff.Delete - case dmp.DiffInsert: - op = fdiff.Add - } - - chunks = append(chunks, &textChunk{d.Text, op}) - } - - return &textFilePatch{ - chunks: chunks, - from: c.From, - to: c.To, - }, nil - -} - -func fileContent(f *File) (content string, isBinary bool, err error) { - if f == nil { - return - } - - isBinary, err = f.IsBinary() - if err != nil || isBinary { - return - } - - content, err = f.Contents() - - return -} - -// Patch is an implementation of fdiff.Patch interface -type Patch struct { - message string - filePatches []fdiff.FilePatch -} - -func (p *Patch) FilePatches() []fdiff.FilePatch { - return p.filePatches -} - -func (p *Patch) Message() string { - return p.message -} - -func (p *Patch) Encode(w io.Writer) error { - ue := fdiff.NewUnifiedEncoder(w, fdiff.DefaultContextLines) - - return ue.Encode(p) -} - -func (p *Patch) Stats() FileStats { - return getFileStatsFromFilePatches(p.FilePatches()) -} - -func (p *Patch) String() string { - buf := bytes.NewBuffer(nil) - err := p.Encode(buf) - if err != nil { - return fmt.Sprintf("malformed patch: %s", err.Error()) - } - - return buf.String() -} - -// changeEntryWrapper is an implementation of fdiff.File interface -type changeEntryWrapper struct { - ce ChangeEntry -} - -func (f *changeEntryWrapper) Hash() plumbing.Hash { - if !f.ce.TreeEntry.Mode.IsFile() { - return plumbing.ZeroHash - } - - return f.ce.TreeEntry.Hash -} - -func (f *changeEntryWrapper) Mode() filemode.FileMode { - return f.ce.TreeEntry.Mode -} -func (f *changeEntryWrapper) Path() string { - if !f.ce.TreeEntry.Mode.IsFile() { - return "" - } - - return f.ce.Name -} - -func (f *changeEntryWrapper) Empty() bool { - return !f.ce.TreeEntry.Mode.IsFile() -} - -// textFilePatch is an implementation of fdiff.FilePatch interface -type textFilePatch struct { - chunks []fdiff.Chunk - from, to ChangeEntry -} - -func (tf *textFilePatch) Files() (from fdiff.File, to fdiff.File) { - f := &changeEntryWrapper{tf.from} - t := &changeEntryWrapper{tf.to} - - if !f.Empty() { - from = f - } - - if !t.Empty() { - to = t - } - - return -} - -func (tf *textFilePatch) IsBinary() bool { - return len(tf.chunks) == 0 -} - -func (tf *textFilePatch) Chunks() []fdiff.Chunk { - return tf.chunks -} - -// textChunk is an implementation of fdiff.Chunk interface -type textChunk struct { - content string - op fdiff.Operation -} - -func (t *textChunk) Content() string { - return t.content -} - -func (t *textChunk) Type() fdiff.Operation { - return t.op -} - -// FileStat stores the status of changes in content of a file. -type FileStat struct { - Name string - Addition int - Deletion int -} - -func (fs FileStat) String() string { - return printStat([]FileStat{fs}) -} - -// FileStats is a collection of FileStat. -type FileStats []FileStat - -func (fileStats FileStats) String() string { - return printStat(fileStats) -} - -func printStat(fileStats []FileStat) string { - padLength := float64(len(" ")) - newlineLength := float64(len("\n")) - separatorLength := float64(len("|")) - // Soft line length limit. The text length calculation below excludes - // length of the change number. Adding that would take it closer to 80, - // but probably not more than 80, until it's a huge number. - lineLength := 72.0 - - // Get the longest filename and longest total change. - var longestLength float64 - var longestTotalChange float64 - for _, fs := range fileStats { - if int(longestLength) < len(fs.Name) { - longestLength = float64(len(fs.Name)) - } - totalChange := fs.Addition + fs.Deletion - if int(longestTotalChange) < totalChange { - longestTotalChange = float64(totalChange) - } - } - - // Parts of the output: - // |<+++/---> - // example: " main.go | 10 +++++++--- " - - // - leftTextLength := padLength + longestLength + padLength - - // <+++++/-----> - // Excluding number length here. - rightTextLength := padLength + padLength + newlineLength - - totalTextArea := leftTextLength + separatorLength + rightTextLength - heightOfHistogram := lineLength - totalTextArea - - // Scale the histogram. - var scaleFactor float64 - if longestTotalChange > heightOfHistogram { - // Scale down to heightOfHistogram. - scaleFactor = longestTotalChange / heightOfHistogram - } else { - scaleFactor = 1.0 - } - - finalOutput := "" - for _, fs := range fileStats { - addn := float64(fs.Addition) - deln := float64(fs.Deletion) - addc := int(math.Floor(addn/scaleFactor)) - delc := int(math.Floor(deln/scaleFactor)) - if addc < 0 { - addc = 0 - } - if delc < 0 { - delc = 0 - } - adds := strings.Repeat("+", addc) - dels := strings.Repeat("-", delc) - finalOutput += fmt.Sprintf(" %s | %d %s%s\n", fs.Name, (fs.Addition + fs.Deletion), adds, dels) - } - - return finalOutput -} - -func getFileStatsFromFilePatches(filePatches []fdiff.FilePatch) FileStats { - var fileStats FileStats - - for _, fp := range filePatches { - // ignore empty patches (binary files, submodule refs updates) - if len(fp.Chunks()) == 0 { - continue - } - - cs := FileStat{} - from, to := fp.Files() - if from == nil { - // New File is created. - cs.Name = to.Path() - } else if to == nil { - // File is deleted. - cs.Name = from.Path() - } else if from.Path() != to.Path() { - // File is renamed. - cs.Name = fmt.Sprintf("%s => %s", from.Path(), to.Path()) - } else { - cs.Name = from.Path() - } - - for _, chunk := range fp.Chunks() { - s := chunk.Content() - if len(s) == 0 { - continue - } - - switch chunk.Type() { - case fdiff.Add: - cs.Addition += strings.Count(s, "\n") - if s[len(s)-1] != '\n' { - cs.Addition++ - } - case fdiff.Delete: - cs.Deletion += strings.Count(s, "\n") - if s[len(s)-1] != '\n' { - cs.Deletion++ - } - } - } - - fileStats = append(fileStats, cs) - } - - return fileStats -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/rename.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/rename.go deleted file mode 100644 index ad2b902c25..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/rename.go +++ /dev/null @@ -1,816 +0,0 @@ -package object - -import ( - "errors" - "io" - "sort" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/merkletrie" -) - -// DetectRenames detects the renames in the given changes on two trees with -// the given options. It will return the given changes grouping additions and -// deletions into modifications when possible. -// If options is nil, the default diff tree options will be used. -func DetectRenames( - changes Changes, - opts *DiffTreeOptions, -) (Changes, error) { - if opts == nil { - opts = DefaultDiffTreeOptions - } - - detector := &renameDetector{ - renameScore: int(opts.RenameScore), - renameLimit: int(opts.RenameLimit), - onlyExact: opts.OnlyExactRenames, - } - - for _, c := range changes { - action, err := c.Action() - if err != nil { - return nil, err - } - - switch action { - case merkletrie.Insert: - detector.added = append(detector.added, c) - case merkletrie.Delete: - detector.deleted = append(detector.deleted, c) - default: - detector.modified = append(detector.modified, c) - } - } - - return detector.detect() -} - -// renameDetector will detect and resolve renames in a set of changes. -// see: https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java -type renameDetector struct { - added []*Change - deleted []*Change - modified []*Change - - renameScore int - renameLimit int - onlyExact bool -} - -// detectExactRenames detects matches files that were deleted with files that -// were added where the hash is the same on both. If there are multiple targets -// the one with the most similar path will be chosen as the rename and the -// rest as either deletions or additions. -func (d *renameDetector) detectExactRenames() { - added := groupChangesByHash(d.added) - deletes := groupChangesByHash(d.deleted) - var uniqueAdds []*Change - var nonUniqueAdds [][]*Change - var addedLeft []*Change - - for _, cs := range added { - if len(cs) == 1 { - uniqueAdds = append(uniqueAdds, cs[0]) - } else { - nonUniqueAdds = append(nonUniqueAdds, cs) - } - } - - for _, c := range uniqueAdds { - hash := changeHash(c) - deleted := deletes[hash] - - if len(deleted) == 1 { - if sameMode(c, deleted[0]) { - d.modified = append(d.modified, &Change{From: deleted[0].From, To: c.To}) - delete(deletes, hash) - } else { - addedLeft = append(addedLeft, c) - } - } else if len(deleted) > 1 { - bestMatch := bestNameMatch(c, deleted) - if bestMatch != nil && sameMode(c, bestMatch) { - d.modified = append(d.modified, &Change{From: bestMatch.From, To: c.To}) - delete(deletes, hash) - - var newDeletes = make([]*Change, 0, len(deleted)-1) - for _, d := range deleted { - if d != bestMatch { - newDeletes = append(newDeletes, d) - } - } - deletes[hash] = newDeletes - } - } else { - addedLeft = append(addedLeft, c) - } - } - - for _, added := range nonUniqueAdds { - hash := changeHash(added[0]) - deleted := deletes[hash] - - if len(deleted) == 1 { - deleted := deleted[0] - bestMatch := bestNameMatch(deleted, added) - if bestMatch != nil && sameMode(deleted, bestMatch) { - d.modified = append(d.modified, &Change{From: deleted.From, To: bestMatch.To}) - delete(deletes, hash) - - for _, c := range added { - if c != bestMatch { - addedLeft = append(addedLeft, c) - } - } - } else { - addedLeft = append(addedLeft, added...) - } - } else if len(deleted) > 1 { - maxSize := len(deleted) * len(added) - if d.renameLimit > 0 && d.renameLimit < maxSize { - maxSize = d.renameLimit - } - - matrix := make(similarityMatrix, 0, maxSize) - - for delIdx, del := range deleted { - deletedName := changeName(del) - - for addIdx, add := range added { - addedName := changeName(add) - - score := nameSimilarityScore(addedName, deletedName) - matrix = append(matrix, similarityPair{added: addIdx, deleted: delIdx, score: score}) - - if len(matrix) >= maxSize { - break - } - } - - if len(matrix) >= maxSize { - break - } - } - - sort.Stable(matrix) - - usedAdds := make(map[*Change]struct{}) - usedDeletes := make(map[*Change]struct{}) - for i := len(matrix) - 1; i >= 0; i-- { - del := deleted[matrix[i].deleted] - add := added[matrix[i].added] - - if add == nil || del == nil { - // it was already matched - continue - } - - usedAdds[add] = struct{}{} - usedDeletes[del] = struct{}{} - d.modified = append(d.modified, &Change{From: del.From, To: add.To}) - added[matrix[i].added] = nil - deleted[matrix[i].deleted] = nil - } - - for _, c := range added { - if _, ok := usedAdds[c]; !ok && c != nil { - addedLeft = append(addedLeft, c) - } - } - - var newDeletes = make([]*Change, 0, len(deleted)-len(usedDeletes)) - for _, c := range deleted { - if _, ok := usedDeletes[c]; !ok && c != nil { - newDeletes = append(newDeletes, c) - } - } - deletes[hash] = newDeletes - } else { - addedLeft = append(addedLeft, added...) - } - } - - d.added = addedLeft - d.deleted = nil - for _, dels := range deletes { - d.deleted = append(d.deleted, dels...) - } -} - -// detectContentRenames detects renames based on the similarity of the content -// in the files by building a matrix of pairs between sources and destinations -// and matching by the highest score. -// see: https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityRenameDetector.java -func (d *renameDetector) detectContentRenames() error { - cnt := max(len(d.added), len(d.deleted)) - if d.renameLimit > 0 && cnt > d.renameLimit { - return nil - } - - srcs, dsts := d.deleted, d.added - matrix, err := buildSimilarityMatrix(srcs, dsts, d.renameScore) - if err != nil { - return err - } - renames := make([]*Change, 0, min(len(matrix), len(dsts))) - - // Match rename pairs on a first come, first serve basis until - // we have looked at everything that is above the minimum score. - for i := len(matrix) - 1; i >= 0; i-- { - pair := matrix[i] - src := srcs[pair.deleted] - dst := dsts[pair.added] - - if dst == nil || src == nil { - // It was already matched before - continue - } - - renames = append(renames, &Change{From: src.From, To: dst.To}) - - // Claim destination and source as matched - dsts[pair.added] = nil - srcs[pair.deleted] = nil - } - - d.modified = append(d.modified, renames...) - d.added = compactChanges(dsts) - d.deleted = compactChanges(srcs) - - return nil -} - -func (d *renameDetector) detect() (Changes, error) { - if len(d.added) > 0 && len(d.deleted) > 0 { - d.detectExactRenames() - - if !d.onlyExact { - if err := d.detectContentRenames(); err != nil { - return nil, err - } - } - } - - result := make(Changes, 0, len(d.added)+len(d.deleted)+len(d.modified)) - result = append(result, d.added...) - result = append(result, d.deleted...) - result = append(result, d.modified...) - - sort.Stable(result) - - return result, nil -} - -func bestNameMatch(change *Change, changes []*Change) *Change { - var best *Change - var bestScore int - - cname := changeName(change) - - for _, c := range changes { - score := nameSimilarityScore(cname, changeName(c)) - if score > bestScore { - bestScore = score - best = c - } - } - - return best -} - -func nameSimilarityScore(a, b string) int { - aDirLen := strings.LastIndexByte(a, '/') + 1 - bDirLen := strings.LastIndexByte(b, '/') + 1 - - dirMin := min(aDirLen, bDirLen) - dirMax := max(aDirLen, bDirLen) - - var dirScoreLtr, dirScoreRtl int - if dirMax == 0 { - dirScoreLtr = 100 - dirScoreRtl = 100 - } else { - var dirSim int - - for ; dirSim < dirMin; dirSim++ { - if a[dirSim] != b[dirSim] { - break - } - } - - dirScoreLtr = dirSim * 100 / dirMax - - if dirScoreLtr == 100 { - dirScoreRtl = 100 - } else { - for dirSim = 0; dirSim < dirMin; dirSim++ { - if a[aDirLen-1-dirSim] != b[bDirLen-1-dirSim] { - break - } - } - dirScoreRtl = dirSim * 100 / dirMax - } - } - - fileMin := min(len(a)-aDirLen, len(b)-bDirLen) - fileMax := max(len(a)-aDirLen, len(b)-bDirLen) - - fileSim := 0 - for ; fileSim < fileMin; fileSim++ { - if a[len(a)-1-fileSim] != b[len(b)-1-fileSim] { - break - } - } - fileScore := fileSim * 100 / fileMax - - return (((dirScoreLtr + dirScoreRtl) * 25) + (fileScore * 50)) / 100 -} - -func changeName(c *Change) string { - if c.To != empty { - return c.To.Name - } - return c.From.Name -} - -func changeHash(c *Change) plumbing.Hash { - if c.To != empty { - return c.To.TreeEntry.Hash - } - - return c.From.TreeEntry.Hash -} - -func changeMode(c *Change) filemode.FileMode { - if c.To != empty { - return c.To.TreeEntry.Mode - } - - return c.From.TreeEntry.Mode -} - -func sameMode(a, b *Change) bool { - return changeMode(a) == changeMode(b) -} - -func groupChangesByHash(changes []*Change) map[plumbing.Hash][]*Change { - var result = make(map[plumbing.Hash][]*Change) - for _, c := range changes { - hash := changeHash(c) - result[hash] = append(result[hash], c) - } - return result -} - -type similarityMatrix []similarityPair - -func (m similarityMatrix) Len() int { return len(m) } -func (m similarityMatrix) Swap(i, j int) { m[i], m[j] = m[j], m[i] } -func (m similarityMatrix) Less(i, j int) bool { - if m[i].score == m[j].score { - if m[i].added == m[j].added { - return m[i].deleted < m[j].deleted - } - return m[i].added < m[j].added - } - return m[i].score < m[j].score -} - -type similarityPair struct { - // index of the added file - added int - // index of the deleted file - deleted int - // similarity score - score int -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -const maxMatrixSize = 10000 - -func buildSimilarityMatrix(srcs, dsts []*Change, renameScore int) (similarityMatrix, error) { - // Allocate for the worst-case scenario where every pair has a score - // that we need to consider. We might not need that many. - matrixSize := len(srcs) * len(dsts) - if matrixSize > maxMatrixSize { - matrixSize = maxMatrixSize - } - matrix := make(similarityMatrix, 0, matrixSize) - srcSizes := make([]int64, len(srcs)) - dstSizes := make([]int64, len(dsts)) - dstTooLarge := make(map[int]bool) - - // Consider each pair of files, if the score is above the minimum - // threshold we need to record that scoring in the matrix so we can - // later find the best matches. -outerLoop: - for srcIdx, src := range srcs { - if changeMode(src) != filemode.Regular { - continue - } - - // Declare the from file and the similarity index here to be able to - // reuse it inside the inner loop. The reason to not initialize them - // here is so we can skip the initialization in case they happen to - // not be needed later. They will be initialized inside the inner - // loop if and only if they're needed and reused in subsequent passes. - var from *File - var s *similarityIndex - var err error - for dstIdx, dst := range dsts { - if changeMode(dst) != filemode.Regular { - continue - } - - if dstTooLarge[dstIdx] { - continue - } - - var to *File - srcSize := srcSizes[srcIdx] - if srcSize == 0 { - from, _, err = src.Files() - if err != nil { - return nil, err - } - srcSize = from.Size + 1 - srcSizes[srcIdx] = srcSize - } - - dstSize := dstSizes[dstIdx] - if dstSize == 0 { - _, to, err = dst.Files() - if err != nil { - return nil, err - } - dstSize = to.Size + 1 - dstSizes[dstIdx] = dstSize - } - - min, max := srcSize, dstSize - if dstSize < srcSize { - min = dstSize - max = srcSize - } - - if int(min*100/max) < renameScore { - // File sizes are too different to be a match - continue - } - - if s == nil { - s, err = fileSimilarityIndex(from) - if err != nil { - if err == errIndexFull { - continue outerLoop - } - return nil, err - } - } - - if to == nil { - _, to, err = dst.Files() - if err != nil { - return nil, err - } - } - - di, err := fileSimilarityIndex(to) - if err != nil { - if err == errIndexFull { - dstTooLarge[dstIdx] = true - } - - return nil, err - } - - contentScore := s.score(di, 10000) - // The name score returns a value between 0 and 100, so we need to - // convert it to the same range as the content score. - nameScore := nameSimilarityScore(src.From.Name, dst.To.Name) * 100 - score := (contentScore*99 + nameScore*1) / 10000 - - if score < renameScore { - continue - } - - matrix = append(matrix, similarityPair{added: dstIdx, deleted: srcIdx, score: score}) - } - } - - sort.Stable(matrix) - - return matrix, nil -} - -func compactChanges(changes []*Change) []*Change { - var result []*Change - for _, c := range changes { - if c != nil { - result = append(result, c) - } - } - return result -} - -const ( - keyShift = 32 - maxCountValue = (1 << keyShift) - 1 -) - -var errIndexFull = errors.New("index is full") - -// similarityIndex is an index structure of lines/blocks in one file. -// This structure can be used to compute an approximation of the similarity -// between two files. -// To save space in memory, this index uses a space efficient encoding which -// will not exceed 1MiB per instance. The index starts out at a smaller size -// (closer to 2KiB), but may grow as more distinct blocks within the scanned -// file are discovered. -// see: https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/diff/SimilarityIndex.java -type similarityIndex struct { - hashed uint64 - // number of non-zero entries in hashes - numHashes int - growAt int - hashes []keyCountPair - hashBits int -} - -func fileSimilarityIndex(f *File) (*similarityIndex, error) { - idx := newSimilarityIndex() - if err := idx.hash(f); err != nil { - return nil, err - } - - sort.Stable(keyCountPairs(idx.hashes)) - - return idx, nil -} - -func newSimilarityIndex() *similarityIndex { - return &similarityIndex{ - hashBits: 8, - hashes: make([]keyCountPair, 1<<8), - growAt: shouldGrowAt(8), - } -} - -func (i *similarityIndex) hash(f *File) error { - isBin, err := f.IsBinary() - if err != nil { - return err - } - - r, err := f.Reader() - if err != nil { - return err - } - - defer ioutil.CheckClose(r, &err) - - return i.hashContent(r, f.Size, isBin) -} - -func (i *similarityIndex) hashContent(r io.Reader, size int64, isBin bool) error { - var buf = make([]byte, 4096) - var ptr, cnt int - remaining := size - - for 0 < remaining { - hash := 5381 - var blockHashedCnt uint64 - - // Hash one line or block, whatever happens first - n := int64(0) - for { - if ptr == cnt { - ptr = 0 - var err error - cnt, err = io.ReadFull(r, buf) - if err != nil && err != io.ErrUnexpectedEOF { - return err - } - - if cnt == 0 { - return io.EOF - } - } - n++ - c := buf[ptr] & 0xff - ptr++ - - // Ignore CR in CRLF sequence if it's text - if !isBin && c == '\r' && ptr < cnt && buf[ptr] == '\n' { - continue - } - blockHashedCnt++ - - if c == '\n' { - break - } - - hash = (hash << 5) + hash + int(c) - - if n >= 64 || n >= remaining { - break - } - } - i.hashed += blockHashedCnt - if err := i.add(hash, blockHashedCnt); err != nil { - return err - } - remaining -= n - } - - return nil -} - -// score computes the similarity score between this index and another one. -// A region of a file is defined as a line in a text file or a fixed-size -// block in a binary file. To prepare an index, each region in the file is -// hashed; the values and counts of hashes are retained in a sorted table. -// Define the similarity fraction F as the count of matching regions between -// the two files divided between the maximum count of regions in either file. -// The similarity score is F multiplied by the maxScore constant, yielding a -// range [0, maxScore]. It is defined as maxScore for the degenerate case of -// two empty files. -// The similarity score is symmetrical; i.e. a.score(b) == b.score(a). -func (i *similarityIndex) score(other *similarityIndex, maxScore int) int { - var maxHashed = i.hashed - if maxHashed < other.hashed { - maxHashed = other.hashed - } - if maxHashed == 0 { - return maxScore - } - - return int(i.common(other) * uint64(maxScore) / maxHashed) -} - -func (i *similarityIndex) common(dst *similarityIndex) uint64 { - srcIdx, dstIdx := 0, 0 - if i.numHashes == 0 || dst.numHashes == 0 { - return 0 - } - - var common uint64 - srcKey, dstKey := i.hashes[srcIdx].key(), dst.hashes[dstIdx].key() - - for { - if srcKey == dstKey { - srcCnt, dstCnt := i.hashes[srcIdx].count(), dst.hashes[dstIdx].count() - if srcCnt < dstCnt { - common += srcCnt - } else { - common += dstCnt - } - - srcIdx++ - if srcIdx == len(i.hashes) { - break - } - srcKey = i.hashes[srcIdx].key() - - dstIdx++ - if dstIdx == len(dst.hashes) { - break - } - dstKey = dst.hashes[dstIdx].key() - } else if srcKey < dstKey { - // Region of src that is not in dst - srcIdx++ - if srcIdx == len(i.hashes) { - break - } - srcKey = i.hashes[srcIdx].key() - } else { - // Region of dst that is not in src - dstIdx++ - if dstIdx == len(dst.hashes) { - break - } - dstKey = dst.hashes[dstIdx].key() - } - } - - return common -} - -func (i *similarityIndex) add(key int, cnt uint64) error { - key = int(uint32(key) * 0x9e370001 >> 1) - - j := i.slot(key) - for { - v := i.hashes[j] - if v == 0 { - // It's an empty slot, so we can store it here. - if i.growAt <= i.numHashes { - if err := i.grow(); err != nil { - return err - } - j = i.slot(key) - continue - } - - var err error - i.hashes[j], err = newKeyCountPair(key, cnt) - if err != nil { - return err - } - i.numHashes++ - return nil - } else if v.key() == key { - // It's the same key, so increment the counter. - var err error - i.hashes[j], err = newKeyCountPair(key, v.count()+cnt) - return err - } else if j+1 >= len(i.hashes) { - j = 0 - } else { - j++ - } - } -} - -type keyCountPair uint64 - -func newKeyCountPair(key int, cnt uint64) (keyCountPair, error) { - if cnt > maxCountValue { - return 0, errIndexFull - } - - return keyCountPair((uint64(key) << keyShift) | cnt), nil -} - -func (p keyCountPair) key() int { - return int(p >> keyShift) -} - -func (p keyCountPair) count() uint64 { - return uint64(p) & maxCountValue -} - -func (i *similarityIndex) slot(key int) int { - // We use 31 - hashBits because the upper bit was already forced - // to be 0 and we want the remaining high bits to be used as the - // table slot. - return int(uint32(key) >> uint(31-i.hashBits)) -} - -func shouldGrowAt(hashBits int) int { - return (1 << uint(hashBits)) * (hashBits - 3) / hashBits -} - -func (i *similarityIndex) grow() error { - if i.hashBits == 30 { - return errIndexFull - } - - old := i.hashes - - i.hashBits++ - i.growAt = shouldGrowAt(i.hashBits) - - // TODO(erizocosmico): find a way to check if it will OOM and return - // errIndexFull instead. - i.hashes = make([]keyCountPair, 1<= len(i.hashes) { - j = 0 - } - } - i.hashes[j] = v - } - } - - return nil -} - -type keyCountPairs []keyCountPair - -func (p keyCountPairs) Len() int { return len(p) } -func (p keyCountPairs) Swap(i, j int) { p[i], p[j] = p[j], p[i] } -func (p keyCountPairs) Less(i, j int) bool { return p[i] < p[j] } diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/signature.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/signature.go deleted file mode 100644 index 91cf371f0c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/signature.go +++ /dev/null @@ -1,101 +0,0 @@ -package object - -import "bytes" - -const ( - signatureTypeUnknown signatureType = iota - signatureTypeOpenPGP - signatureTypeX509 - signatureTypeSSH -) - -var ( - // openPGPSignatureFormat is the format of an OpenPGP signature. - openPGPSignatureFormat = signatureFormat{ - []byte("-----BEGIN PGP SIGNATURE-----"), - []byte("-----BEGIN PGP MESSAGE-----"), - } - // x509SignatureFormat is the format of an X509 signature, which is - // a PKCS#7 (S/MIME) signature. - x509SignatureFormat = signatureFormat{ - []byte("-----BEGIN CERTIFICATE-----"), - } - - // sshSignatureFormat is the format of an SSH signature. - sshSignatureFormat = signatureFormat{ - []byte("-----BEGIN SSH SIGNATURE-----"), - } -) - -var ( - // knownSignatureFormats is a map of known signature formats, indexed by - // their signatureType. - knownSignatureFormats = map[signatureType]signatureFormat{ - signatureTypeOpenPGP: openPGPSignatureFormat, - signatureTypeX509: x509SignatureFormat, - signatureTypeSSH: sshSignatureFormat, - } -) - -// signatureType represents the type of the signature. -type signatureType int8 - -// signatureFormat represents the beginning of a signature. -type signatureFormat [][]byte - -// typeForSignature returns the type of the signature based on its format. -func typeForSignature(b []byte) signatureType { - for t, i := range knownSignatureFormats { - for _, begin := range i { - if bytes.HasPrefix(b, begin) { - return t - } - } - } - return signatureTypeUnknown -} - -// parseSignedBytes returns the position of the last signature block found in -// the given bytes. If no signature block is found, it returns -1. -// -// When multiple signature blocks are found, the position of the last one is -// returned. Any tailing bytes after this signature block start should be -// considered part of the signature. -// -// Given this, it would be safe to use the returned position to split the bytes -// into two parts: the first part containing the message, the second part -// containing the signature. -// -// Example: -// -// message := []byte(`Message with signature -// -// -----BEGIN SSH SIGNATURE----- -// ...`) -// -// var signature string -// if pos, _ := parseSignedBytes(message); pos != -1 { -// signature = string(message[pos:]) -// message = message[:pos] -// } -// -// This logic is on par with git's gpg-interface.c:parse_signed_buffer(). -// https://github.com/git/git/blob/7c2ef319c52c4997256f5807564523dfd4acdfc7/gpg-interface.c#L668 -func parseSignedBytes(b []byte) (int, signatureType) { - var n, match = 0, -1 - var t signatureType - for n < len(b) { - var i = b[n:] - if st := typeForSignature(i); st != signatureTypeUnknown { - match = n - t = st - } - if eol := bytes.IndexByte(i, '\n'); eol >= 0 { - n += eol + 1 - continue - } - // If we reach this point, we've reached the end. - break - } - return match, t -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/tag.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/tag.go deleted file mode 100644 index cf46c08e18..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/tag.go +++ /dev/null @@ -1,330 +0,0 @@ -package object - -import ( - "bytes" - "fmt" - "io" - "strings" - - "github.com/ProtonMail/go-crypto/openpgp" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -// Tag represents an annotated tag object. It points to a single git object of -// any type, but tags typically are applied to commit or blob objects. It -// provides a reference that associates the target with a tag name. It also -// contains meta-information about the tag, including the tagger, tag date and -// message. -// -// Note that this is not used for lightweight tags. -// -// https://git-scm.com/book/en/v2/Git-Internals-Git-References#Tags -type Tag struct { - // Hash of the tag. - Hash plumbing.Hash - // Name of the tag. - Name string - // Tagger is the one who created the tag. - Tagger Signature - // Message is an arbitrary text message. - Message string - // PGPSignature is the PGP signature of the tag. - PGPSignature string - // TargetType is the object type of the target. - TargetType plumbing.ObjectType - // Target is the hash of the target object. - Target plumbing.Hash - - s storer.EncodedObjectStorer -} - -// GetTag gets a tag from an object storer and decodes it. -func GetTag(s storer.EncodedObjectStorer, h plumbing.Hash) (*Tag, error) { - o, err := s.EncodedObject(plumbing.TagObject, h) - if err != nil { - return nil, err - } - - return DecodeTag(s, o) -} - -// DecodeTag decodes an encoded object into a *Commit and associates it to the -// given object storer. -func DecodeTag(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Tag, error) { - t := &Tag{s: s} - if err := t.Decode(o); err != nil { - return nil, err - } - - return t, nil -} - -// ID returns the object ID of the tag, not the object that the tag references. -// The returned value will always match the current value of Tag.Hash. -// -// ID is present to fulfill the Object interface. -func (t *Tag) ID() plumbing.Hash { - return t.Hash -} - -// Type returns the type of object. It always returns plumbing.TagObject. -// -// Type is present to fulfill the Object interface. -func (t *Tag) Type() plumbing.ObjectType { - return plumbing.TagObject -} - -// Decode transforms a plumbing.EncodedObject into a Tag struct. -func (t *Tag) Decode(o plumbing.EncodedObject) (err error) { - if o.Type() != plumbing.TagObject { - return ErrUnsupportedObject - } - - t.Hash = o.Hash() - - reader, err := o.Reader() - if err != nil { - return err - } - defer ioutil.CheckClose(reader, &err) - - r := sync.GetBufioReader(reader) - defer sync.PutBufioReader(r) - - for { - var line []byte - line, err = r.ReadBytes('\n') - if err != nil && err != io.EOF { - return err - } - - line = bytes.TrimSpace(line) - if len(line) == 0 { - break // Start of message - } - - split := bytes.SplitN(line, []byte{' '}, 2) - switch string(split[0]) { - case "object": - t.Target = plumbing.NewHash(string(split[1])) - case "type": - t.TargetType, err = plumbing.ParseObjectType(string(split[1])) - if err != nil { - return err - } - case "tag": - t.Name = string(split[1]) - case "tagger": - t.Tagger.Decode(split[1]) - } - - if err == io.EOF { - return nil - } - } - - data, err := io.ReadAll(r) - if err != nil { - return err - } - if sm, _ := parseSignedBytes(data); sm >= 0 { - t.PGPSignature = string(data[sm:]) - data = data[:sm] - } - t.Message = string(data) - - return nil -} - -// Encode transforms a Tag into a plumbing.EncodedObject. -func (t *Tag) Encode(o plumbing.EncodedObject) error { - return t.encode(o, true) -} - -// EncodeWithoutSignature export a Tag into a plumbing.EncodedObject without the signature (correspond to the payload of the PGP signature). -func (t *Tag) EncodeWithoutSignature(o plumbing.EncodedObject) error { - return t.encode(o, false) -} - -func (t *Tag) encode(o plumbing.EncodedObject, includeSig bool) (err error) { - o.SetType(plumbing.TagObject) - w, err := o.Writer() - if err != nil { - return err - } - defer ioutil.CheckClose(w, &err) - - if _, err = fmt.Fprintf(w, - "object %s\ntype %s\ntag %s\ntagger ", - t.Target.String(), t.TargetType.Bytes(), t.Name); err != nil { - return err - } - - if err = t.Tagger.Encode(w); err != nil { - return err - } - - if _, err = fmt.Fprint(w, "\n\n"); err != nil { - return err - } - - if _, err = fmt.Fprint(w, t.Message); err != nil { - return err - } - - // Note that this is highly sensitive to what it sent along in the message. - // Message *always* needs to end with a newline, or else the message and the - // signature will be concatenated into a corrupt object. Since this is a - // lower-level method, we assume you know what you are doing and have already - // done the needful on the message in the caller. - if includeSig { - if _, err = fmt.Fprint(w, t.PGPSignature); err != nil { - return err - } - } - - return err -} - -// Commit returns the commit pointed to by the tag. If the tag points to a -// different type of object ErrUnsupportedObject will be returned. -func (t *Tag) Commit() (*Commit, error) { - if t.TargetType != plumbing.CommitObject { - return nil, ErrUnsupportedObject - } - - o, err := t.s.EncodedObject(plumbing.CommitObject, t.Target) - if err != nil { - return nil, err - } - - return DecodeCommit(t.s, o) -} - -// Tree returns the tree pointed to by the tag. If the tag points to a commit -// object the tree of that commit will be returned. If the tag does not point -// to a commit or tree object ErrUnsupportedObject will be returned. -func (t *Tag) Tree() (*Tree, error) { - switch t.TargetType { - case plumbing.CommitObject: - c, err := t.Commit() - if err != nil { - return nil, err - } - - return c.Tree() - case plumbing.TreeObject: - return GetTree(t.s, t.Target) - default: - return nil, ErrUnsupportedObject - } -} - -// Blob returns the blob pointed to by the tag. If the tag points to a -// different type of object ErrUnsupportedObject will be returned. -func (t *Tag) Blob() (*Blob, error) { - if t.TargetType != plumbing.BlobObject { - return nil, ErrUnsupportedObject - } - - return GetBlob(t.s, t.Target) -} - -// Object returns the object pointed to by the tag. -func (t *Tag) Object() (Object, error) { - o, err := t.s.EncodedObject(t.TargetType, t.Target) - if err != nil { - return nil, err - } - - return DecodeObject(t.s, o) -} - -// String returns the meta information contained in the tag as a formatted -// string. -func (t *Tag) String() string { - obj, _ := t.Object() - - return fmt.Sprintf( - "%s %s\nTagger: %s\nDate: %s\n\n%s\n%s", - plumbing.TagObject, t.Name, t.Tagger.String(), t.Tagger.When.Format(DateFormat), - t.Message, objectAsString(obj), - ) -} - -// Verify performs PGP verification of the tag with a provided armored -// keyring and returns openpgp.Entity associated with verifying key on success. -func (t *Tag) Verify(armoredKeyRing string) (*openpgp.Entity, error) { - keyRingReader := strings.NewReader(armoredKeyRing) - keyring, err := openpgp.ReadArmoredKeyRing(keyRingReader) - if err != nil { - return nil, err - } - - // Extract signature. - signature := strings.NewReader(t.PGPSignature) - - encoded := &plumbing.MemoryObject{} - // Encode tag components, excluding signature and get a reader object. - if err := t.EncodeWithoutSignature(encoded); err != nil { - return nil, err - } - er, err := encoded.Reader() - if err != nil { - return nil, err - } - - return openpgp.CheckArmoredDetachedSignature(keyring, er, signature, nil) -} - -// TagIter provides an iterator for a set of tags. -type TagIter struct { - storer.EncodedObjectIter - s storer.EncodedObjectStorer -} - -// NewTagIter takes a storer.EncodedObjectStorer and a -// storer.EncodedObjectIter and returns a *TagIter that iterates over all -// tags contained in the storer.EncodedObjectIter. -// -// Any non-tag object returned by the storer.EncodedObjectIter is skipped. -func NewTagIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TagIter { - return &TagIter{iter, s} -} - -// Next moves the iterator to the next tag and returns a pointer to it. If -// there are no more tags, it returns io.EOF. -func (iter *TagIter) Next() (*Tag, error) { - obj, err := iter.EncodedObjectIter.Next() - if err != nil { - return nil, err - } - - return DecodeTag(iter.s, obj) -} - -// ForEach call the cb function for each tag contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *TagIter) ForEach(cb func(*Tag) error) error { - return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error { - t, err := DecodeTag(iter.s, obj) - if err != nil { - return err - } - - return cb(t) - }) -} - -func objectAsString(obj Object) string { - switch o := obj.(type) { - case *Commit: - return o.String() - default: - return "" - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go deleted file mode 100644 index e9f7666b83..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/tree.go +++ /dev/null @@ -1,525 +0,0 @@ -package object - -import ( - "context" - "errors" - "fmt" - "io" - "path" - "path/filepath" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/sync" -) - -const ( - maxTreeDepth = 1024 - startingStackSize = 8 -) - -// New errors defined by this package. -var ( - ErrMaxTreeDepth = errors.New("maximum tree depth exceeded") - ErrFileNotFound = errors.New("file not found") - ErrDirectoryNotFound = errors.New("directory not found") - ErrEntryNotFound = errors.New("entry not found") -) - -// Tree is basically like a directory - it references a bunch of other trees -// and/or blobs (i.e. files and sub-directories) -type Tree struct { - Entries []TreeEntry - Hash plumbing.Hash - - s storer.EncodedObjectStorer - m map[string]*TreeEntry - t map[string]*Tree // tree path cache -} - -// GetTree gets a tree from an object storer and decodes it. -func GetTree(s storer.EncodedObjectStorer, h plumbing.Hash) (*Tree, error) { - o, err := s.EncodedObject(plumbing.TreeObject, h) - if err != nil { - return nil, err - } - - return DecodeTree(s, o) -} - -// DecodeTree decodes an encoded object into a *Tree and associates it to the -// given object storer. -func DecodeTree(s storer.EncodedObjectStorer, o plumbing.EncodedObject) (*Tree, error) { - t := &Tree{s: s} - if err := t.Decode(o); err != nil { - return nil, err - } - - return t, nil -} - -// TreeEntry represents a file -type TreeEntry struct { - Name string - Mode filemode.FileMode - Hash plumbing.Hash -} - -// File returns the hash of the file identified by the `path` argument. -// The path is interpreted as relative to the tree receiver. -func (t *Tree) File(path string) (*File, error) { - e, err := t.FindEntry(path) - if err != nil { - return nil, ErrFileNotFound - } - - blob, err := GetBlob(t.s, e.Hash) - if err != nil { - if err == plumbing.ErrObjectNotFound { - return nil, ErrFileNotFound - } - return nil, err - } - - return NewFile(path, e.Mode, blob), nil -} - -// Size returns the plaintext size of an object, without reading it -// into memory. -func (t *Tree) Size(path string) (int64, error) { - e, err := t.FindEntry(path) - if err != nil { - return 0, ErrEntryNotFound - } - - return t.s.EncodedObjectSize(e.Hash) -} - -// Tree returns the tree identified by the `path` argument. -// The path is interpreted as relative to the tree receiver. -func (t *Tree) Tree(path string) (*Tree, error) { - e, err := t.FindEntry(path) - if err != nil { - return nil, ErrDirectoryNotFound - } - - tree, err := GetTree(t.s, e.Hash) - if err == plumbing.ErrObjectNotFound { - return nil, ErrDirectoryNotFound - } - - return tree, err -} - -// TreeEntryFile returns the *File for a given *TreeEntry. -func (t *Tree) TreeEntryFile(e *TreeEntry) (*File, error) { - blob, err := GetBlob(t.s, e.Hash) - if err != nil { - return nil, err - } - - return NewFile(e.Name, e.Mode, blob), nil -} - -// FindEntry search a TreeEntry in this tree or any subtree. -func (t *Tree) FindEntry(path string) (*TreeEntry, error) { - if t.t == nil { - t.t = make(map[string]*Tree) - } - - pathParts := strings.Split(path, "/") - startingTree := t - pathCurrent := "" - - // search for the longest path in the tree path cache - for i := len(pathParts) - 1; i > 1; i-- { - path := filepath.Join(pathParts[:i]...) - - tree, ok := t.t[path] - if ok { - startingTree = tree - pathParts = pathParts[i:] - pathCurrent = path - - break - } - } - - var tree *Tree - var err error - for tree = startingTree; len(pathParts) > 1; pathParts = pathParts[1:] { - if tree, err = tree.dir(pathParts[0]); err != nil { - return nil, err - } - - pathCurrent = filepath.Join(pathCurrent, pathParts[0]) - t.t[pathCurrent] = tree - } - - return tree.entry(pathParts[0]) -} - -func (t *Tree) dir(baseName string) (*Tree, error) { - entry, err := t.entry(baseName) - if err != nil { - return nil, ErrDirectoryNotFound - } - - obj, err := t.s.EncodedObject(plumbing.TreeObject, entry.Hash) - if err != nil { - return nil, err - } - - tree := &Tree{s: t.s} - err = tree.Decode(obj) - - return tree, err -} - -func (t *Tree) entry(baseName string) (*TreeEntry, error) { - if t.m == nil { - t.buildMap() - } - - entry, ok := t.m[baseName] - if !ok { - return nil, ErrEntryNotFound - } - - return entry, nil -} - -// Files returns a FileIter allowing to iterate over the Tree -func (t *Tree) Files() *FileIter { - return NewFileIter(t.s, t) -} - -// ID returns the object ID of the tree. The returned value will always match -// the current value of Tree.Hash. -// -// ID is present to fulfill the Object interface. -func (t *Tree) ID() plumbing.Hash { - return t.Hash -} - -// Type returns the type of object. It always returns plumbing.TreeObject. -func (t *Tree) Type() plumbing.ObjectType { - return plumbing.TreeObject -} - -// Decode transform an plumbing.EncodedObject into a Tree struct -func (t *Tree) Decode(o plumbing.EncodedObject) (err error) { - if o.Type() != plumbing.TreeObject { - return ErrUnsupportedObject - } - - t.Hash = o.Hash() - if o.Size() == 0 { - return nil - } - - t.Entries = nil - t.m = nil - - reader, err := o.Reader() - if err != nil { - return err - } - defer ioutil.CheckClose(reader, &err) - - r := sync.GetBufioReader(reader) - defer sync.PutBufioReader(r) - - for { - str, err := r.ReadString(' ') - if err != nil { - if err == io.EOF { - break - } - - return err - } - str = str[:len(str)-1] // strip last byte (' ') - - mode, err := filemode.New(str) - if err != nil { - return err - } - - name, err := r.ReadString(0) - if err != nil && err != io.EOF { - return err - } - - var hash plumbing.Hash - if _, err = io.ReadFull(r, hash[:]); err != nil { - return err - } - - baseName := name[:len(name)-1] - t.Entries = append(t.Entries, TreeEntry{ - Hash: hash, - Mode: mode, - Name: baseName, - }) - } - - return nil -} - -// Encode transforms a Tree into a plumbing.EncodedObject. -func (t *Tree) Encode(o plumbing.EncodedObject) (err error) { - o.SetType(plumbing.TreeObject) - w, err := o.Writer() - if err != nil { - return err - } - - defer ioutil.CheckClose(w, &err) - for _, entry := range t.Entries { - if _, err = fmt.Fprintf(w, "%o %s", entry.Mode, entry.Name); err != nil { - return err - } - - if _, err = w.Write([]byte{0x00}); err != nil { - return err - } - - if _, err = w.Write(entry.Hash[:]); err != nil { - return err - } - } - - return err -} - -func (t *Tree) buildMap() { - t.m = make(map[string]*TreeEntry) - for i := 0; i < len(t.Entries); i++ { - t.m[t.Entries[i].Name] = &t.Entries[i] - } -} - -// Diff returns a list of changes between this tree and the provided one -func (t *Tree) Diff(to *Tree) (Changes, error) { - return t.DiffContext(context.Background(), to) -} - -// DiffContext returns a list of changes between this tree and the provided one -// Error will be returned if context expires. Provided context must be non nil. -// -// NOTE: Since version 5.1.0 the renames are correctly handled, the settings -// used are the recommended options DefaultDiffTreeOptions. -func (t *Tree) DiffContext(ctx context.Context, to *Tree) (Changes, error) { - return DiffTreeWithOptions(ctx, t, to, DefaultDiffTreeOptions) -} - -// Patch returns a slice of Patch objects with all the changes between trees -// in chunks. This representation can be used to create several diff outputs. -func (t *Tree) Patch(to *Tree) (*Patch, error) { - return t.PatchContext(context.Background(), to) -} - -// PatchContext returns a slice of Patch objects with all the changes between -// trees in chunks. This representation can be used to create several diff -// outputs. If context expires, an error will be returned. Provided context must -// be non-nil. -// -// NOTE: Since version 5.1.0 the renames are correctly handled, the settings -// used are the recommended options DefaultDiffTreeOptions. -func (t *Tree) PatchContext(ctx context.Context, to *Tree) (*Patch, error) { - changes, err := t.DiffContext(ctx, to) - if err != nil { - return nil, err - } - - return changes.PatchContext(ctx) -} - -// treeEntryIter facilitates iterating through the TreeEntry objects in a Tree. -type treeEntryIter struct { - t *Tree - pos int -} - -func (iter *treeEntryIter) Next() (TreeEntry, error) { - if iter.pos >= len(iter.t.Entries) { - return TreeEntry{}, io.EOF - } - iter.pos++ - return iter.t.Entries[iter.pos-1], nil -} - -// TreeWalker provides a means of walking through all of the entries in a Tree. -type TreeWalker struct { - stack []*treeEntryIter - base string - recursive bool - seen map[plumbing.Hash]bool - - s storer.EncodedObjectStorer - t *Tree -} - -// NewTreeWalker returns a new TreeWalker for the given tree. -// -// It is the caller's responsibility to call Close() when finished with the -// tree walker. -func NewTreeWalker(t *Tree, recursive bool, seen map[plumbing.Hash]bool) *TreeWalker { - stack := make([]*treeEntryIter, 0, startingStackSize) - stack = append(stack, &treeEntryIter{t, 0}) - - return &TreeWalker{ - stack: stack, - recursive: recursive, - seen: seen, - - s: t.s, - t: t, - } -} - -// Next returns the next object from the tree. Objects are returned in order -// and subtrees are included. After the last object has been returned further -// calls to Next() will return io.EOF. -// -// In the current implementation any objects which cannot be found in the -// underlying repository will be skipped automatically. It is possible that this -// may change in future versions. -func (w *TreeWalker) Next() (name string, entry TreeEntry, err error) { - var obj *Tree - for { - current := len(w.stack) - 1 - if current < 0 { - // Nothing left on the stack so we're finished - err = io.EOF - return - } - - if current > maxTreeDepth { - // We're probably following bad data or some self-referencing tree - err = ErrMaxTreeDepth - return - } - - entry, err = w.stack[current].Next() - if err == io.EOF { - // Finished with the current tree, move back up to the parent - w.stack = w.stack[:current] - w.base, _ = path.Split(w.base) - w.base = strings.TrimSuffix(w.base, "/") - continue - } - - if err != nil { - return - } - - if w.seen[entry.Hash] { - continue - } - - if entry.Mode == filemode.Dir { - obj, err = GetTree(w.s, entry.Hash) - } - - name = simpleJoin(w.base, entry.Name) - - if err != nil { - err = io.EOF - return - } - - break - } - - if !w.recursive { - return - } - - if obj != nil { - w.stack = append(w.stack, &treeEntryIter{obj, 0}) - w.base = simpleJoin(w.base, entry.Name) - } - - return -} - -// Tree returns the tree that the tree walker most recently operated on. -func (w *TreeWalker) Tree() *Tree { - current := len(w.stack) - 1 - if w.stack[current].pos == 0 { - current-- - } - - if current < 0 { - return nil - } - - return w.stack[current].t -} - -// Close releases any resources used by the TreeWalker. -func (w *TreeWalker) Close() { - w.stack = nil -} - -// TreeIter provides an iterator for a set of trees. -type TreeIter struct { - storer.EncodedObjectIter - s storer.EncodedObjectStorer -} - -// NewTreeIter takes a storer.EncodedObjectStorer and a -// storer.EncodedObjectIter and returns a *TreeIter that iterates over all -// tree contained in the storer.EncodedObjectIter. -// -// Any non-tree object returned by the storer.EncodedObjectIter is skipped. -func NewTreeIter(s storer.EncodedObjectStorer, iter storer.EncodedObjectIter) *TreeIter { - return &TreeIter{iter, s} -} - -// Next moves the iterator to the next tree and returns a pointer to it. If -// there are no more trees, it returns io.EOF. -func (iter *TreeIter) Next() (*Tree, error) { - for { - obj, err := iter.EncodedObjectIter.Next() - if err != nil { - return nil, err - } - - if obj.Type() != plumbing.TreeObject { - continue - } - - return DecodeTree(iter.s, obj) - } -} - -// ForEach call the cb function for each tree contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *TreeIter) ForEach(cb func(*Tree) error) error { - return iter.EncodedObjectIter.ForEach(func(obj plumbing.EncodedObject) error { - if obj.Type() != plumbing.TreeObject { - return nil - } - - t, err := DecodeTree(iter.s, obj) - if err != nil { - return err - } - - return cb(t) - }) -} - -func simpleJoin(parent, child string) string { - if len(parent) > 0 { - return parent + "/" + child - } - return child -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/object/treenoder.go b/vendor/github.com/go-git/go-git/v5/plumbing/object/treenoder.go deleted file mode 100644 index 6e7b334cbd..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/object/treenoder.go +++ /dev/null @@ -1,140 +0,0 @@ -package object - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// A treenoder is a helper type that wraps git trees into merkletrie -// noders. -// -// As a merkletrie noder doesn't understand the concept of modes (e.g. -// file permissions), the treenoder includes the mode of the git tree in -// the hash, so changes in the modes will be detected as modifications -// to the file contents by the merkletrie difftree algorithm. This is -// consistent with how the "git diff-tree" command works. -type treeNoder struct { - parent *Tree // the root node is its own parent - name string // empty string for the root node - mode filemode.FileMode - hash plumbing.Hash - children []noder.Noder // memoized -} - -// NewTreeRootNode returns the root node of a Tree -func NewTreeRootNode(t *Tree) noder.Noder { - if t == nil { - return &treeNoder{} - } - - return &treeNoder{ - parent: t, - name: "", - mode: filemode.Dir, - hash: t.Hash, - } -} - -func (t *treeNoder) Skip() bool { - return false -} - -func (t *treeNoder) isRoot() bool { - return t.name == "" -} - -func (t *treeNoder) String() string { - return "treeNoder <" + t.name + ">" -} - -func (t *treeNoder) Hash() []byte { - if t.mode == filemode.Deprecated { - return append(t.hash[:], filemode.Regular.Bytes()...) - } - return append(t.hash[:], t.mode.Bytes()...) -} - -func (t *treeNoder) Name() string { - return t.name -} - -func (t *treeNoder) IsDir() bool { - return t.mode == filemode.Dir -} - -// Children will return the children of a treenoder as treenoders, -// building them from the children of the wrapped git tree. -func (t *treeNoder) Children() ([]noder.Noder, error) { - if t.mode != filemode.Dir { - return noder.NoChildren, nil - } - - // children are memoized for efficiency - if t.children != nil { - return t.children, nil - } - - // the parent of the returned children will be ourself as a tree if - // we are a not the root treenoder. The root is special as it - // is is own parent. - parent := t.parent - if !t.isRoot() { - var err error - if parent, err = t.parent.Tree(t.name); err != nil { - return nil, err - } - } - - return transformChildren(parent) -} - -// Returns the children of a tree as treenoders. -// Efficiency is key here. -func transformChildren(t *Tree) ([]noder.Noder, error) { - var err error - var e TreeEntry - - // there will be more tree entries than children in the tree, - // due to submodules and empty directories, but I think it is still - // worth it to pre-allocate the whole array now, even if sometimes - // is bigger than needed. - ret := make([]noder.Noder, 0, len(t.Entries)) - - walker := NewTreeWalker(t, false, nil) // don't recurse - // don't defer walker.Close() for efficiency reasons. - for { - _, e, err = walker.Next() - if err == io.EOF { - break - } - if err != nil { - walker.Close() - return nil, err - } - - ret = append(ret, &treeNoder{ - parent: t, - name: e.Name, - mode: e.Mode, - hash: e.Hash, - }) - } - walker.Close() - - return ret, nil -} - -// len(t.tree.Entries) != the number of elements walked by treewalker -// for some reason because of empty directories, submodules, etc, so we -// have to walk here. -func (t *treeNoder) NumChildren() (int, error) { - children, err := t.Children() - if err != nil { - return 0, err - } - - return len(children), nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go deleted file mode 100644 index f93ad30471..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs.go +++ /dev/null @@ -1,211 +0,0 @@ -package packp - -import ( - "fmt" - "sort" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage/memory" -) - -// AdvRefs values represent the information transmitted on an -// advertised-refs message. Values from this type are not zero-value -// safe, use the New function instead. -type AdvRefs struct { - // Prefix stores prefix payloads. - // - // When using this message over (smart) HTTP, you have to add a pktline - // before the whole thing with the following payload: - // - // '# service=$servicename" LF - // - // Moreover, some (all) git HTTP smart servers will send a flush-pkt - // just after the first pkt-line. - // - // To accommodate both situations, the Prefix field allow you to store - // any data you want to send before the actual pktlines. It will also - // be filled up with whatever is found on the line. - Prefix [][]byte - // Head stores the resolved HEAD reference if present. - // This can be present with git-upload-pack, not with git-receive-pack. - Head *plumbing.Hash - // Capabilities are the capabilities. - Capabilities *capability.List - // References are the hash references. - References map[string]plumbing.Hash - // Peeled are the peeled hash references. - Peeled map[string]plumbing.Hash - // Shallows are the shallow object ids. - Shallows []plumbing.Hash -} - -// NewAdvRefs returns a pointer to a new AdvRefs value, ready to be used. -func NewAdvRefs() *AdvRefs { - return &AdvRefs{ - Prefix: [][]byte{}, - Capabilities: capability.NewList(), - References: make(map[string]plumbing.Hash), - Peeled: make(map[string]plumbing.Hash), - Shallows: []plumbing.Hash{}, - } -} - -func (a *AdvRefs) AddReference(r *plumbing.Reference) error { - switch r.Type() { - case plumbing.SymbolicReference: - v := fmt.Sprintf("%s:%s", r.Name().String(), r.Target().String()) - return a.Capabilities.Add(capability.SymRef, v) - case plumbing.HashReference: - a.References[r.Name().String()] = r.Hash() - default: - return plumbing.ErrInvalidType - } - - return nil -} - -func (a *AdvRefs) AllReferences() (memory.ReferenceStorage, error) { - s := memory.ReferenceStorage{} - if err := a.addRefs(s); err != nil { - return s, plumbing.NewUnexpectedError(err) - } - - return s, nil -} - -func (a *AdvRefs) addRefs(s storer.ReferenceStorer) error { - for name, hash := range a.References { - ref := plumbing.NewReferenceFromStrings(name, hash.String()) - if err := s.SetReference(ref); err != nil { - return err - } - } - - if a.supportSymrefs() { - return a.addSymbolicRefs(s) - } - - return a.resolveHead(s) -} - -// If the server does not support symrefs capability, -// we need to guess the reference where HEAD is pointing to. -// -// Git versions prior to 1.8.4.3 has an special procedure to get -// the reference where is pointing to HEAD: -// - Check if a reference called master exists. If exists and it -// has the same hash as HEAD hash, we can say that HEAD is pointing to master -// - If master does not exists or does not have the same hash as HEAD, -// order references and check in that order if that reference has the same -// hash than HEAD. If yes, set HEAD pointing to that branch hash -// - If no reference is found, throw an error -func (a *AdvRefs) resolveHead(s storer.ReferenceStorer) error { - if a.Head == nil { - return nil - } - - ref, err := s.Reference(plumbing.Master) - - // check first if HEAD is pointing to master - if err == nil { - ok, err := a.createHeadIfCorrectReference(ref, s) - if err != nil { - return err - } - - if ok { - return nil - } - } - - if err != nil && err != plumbing.ErrReferenceNotFound { - return err - } - - // From here we are trying to guess the branch that HEAD is pointing - refIter, err := s.IterReferences() - if err != nil { - return err - } - - var refNames []string - err = refIter.ForEach(func(r *plumbing.Reference) error { - refNames = append(refNames, string(r.Name())) - return nil - }) - if err != nil { - return err - } - - sort.Strings(refNames) - - var headSet bool - for _, refName := range refNames { - ref, err := s.Reference(plumbing.ReferenceName(refName)) - if err != nil { - return err - } - ok, err := a.createHeadIfCorrectReference(ref, s) - if err != nil { - return err - } - if ok { - headSet = true - break - } - } - - if !headSet { - return plumbing.ErrReferenceNotFound - } - - return nil -} - -func (a *AdvRefs) createHeadIfCorrectReference( - reference *plumbing.Reference, - s storer.ReferenceStorer) (bool, error) { - if reference.Hash() == *a.Head { - headRef := plumbing.NewSymbolicReference(plumbing.HEAD, reference.Name()) - if err := s.SetReference(headRef); err != nil { - return false, err - } - - return true, nil - } - - return false, nil -} - -func (a *AdvRefs) addSymbolicRefs(s storer.ReferenceStorer) error { - for _, symref := range a.Capabilities.Get(capability.SymRef) { - chunks := strings.Split(symref, ":") - if len(chunks) != 2 { - err := fmt.Errorf("bad number of `:` in symref value (%q)", symref) - return plumbing.NewUnexpectedError(err) - } - name := plumbing.ReferenceName(chunks[0]) - target := plumbing.ReferenceName(chunks[1]) - ref := plumbing.NewSymbolicReference(name, target) - if err := s.SetReference(ref); err != nil { - return nil - } - } - - return nil -} - -func (a *AdvRefs) supportSymrefs() bool { - return a.Capabilities.Supports(capability.SymRef) -} - -// IsEmpty returns true if doesn't contain any reference. -func (a *AdvRefs) IsEmpty() bool { - return a.Head == nil && - len(a.References) == 0 && - len(a.Peeled) == 0 && - len(a.Shallows) == 0 -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_decode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_decode.go deleted file mode 100644 index f8d26a28e4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_decode.go +++ /dev/null @@ -1,289 +0,0 @@ -package packp - -import ( - "bytes" - "encoding/hex" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -// Decode reads the next advertised-refs message form its input and -// stores it in the AdvRefs. -func (a *AdvRefs) Decode(r io.Reader) error { - d := newAdvRefsDecoder(r) - return d.Decode(a) -} - -type advRefsDecoder struct { - s *pktline.Scanner // a pkt-line scanner from the input stream - line []byte // current pkt-line contents, use parser.nextLine() to make it advance - nLine int // current pkt-line number for debugging, begins at 1 - hash plumbing.Hash // last hash read - err error // sticky error, use the parser.error() method to fill this out - data *AdvRefs // parsed data is stored here -} - -var ( - // ErrEmptyAdvRefs is returned by Decode if it gets an empty advertised - // references message. - ErrEmptyAdvRefs = errors.New("empty advertised-ref message") - // ErrEmptyInput is returned by Decode if the input is empty. - ErrEmptyInput = errors.New("empty input") -) - -func newAdvRefsDecoder(r io.Reader) *advRefsDecoder { - return &advRefsDecoder{ - s: pktline.NewScanner(r), - } -} - -func (d *advRefsDecoder) Decode(v *AdvRefs) error { - d.data = v - - for state := decodePrefix; state != nil; { - state = state(d) - } - - return d.err -} - -type decoderStateFn func(*advRefsDecoder) decoderStateFn - -// fills out the parser sticky error -func (d *advRefsDecoder) error(format string, a ...interface{}) { - msg := fmt.Sprintf( - "pkt-line %d: %s", d.nLine, - fmt.Sprintf(format, a...), - ) - - d.err = NewErrUnexpectedData(msg, d.line) -} - -// Reads a new pkt-line from the scanner, makes its payload available as -// p.line and increments p.nLine. A successful invocation returns true, -// otherwise, false is returned and the sticky error is filled out -// accordingly. Trims eols at the end of the payloads. -func (d *advRefsDecoder) nextLine() bool { - d.nLine++ - - if !d.s.Scan() { - if d.err = d.s.Err(); d.err != nil { - return false - } - - if d.nLine == 1 { - d.err = ErrEmptyInput - return false - } - - d.error("EOF") - return false - } - - d.line = d.s.Bytes() - d.line = bytes.TrimSuffix(d.line, eol) - - return true -} - -// The HTTP smart prefix is often followed by a flush-pkt. -func decodePrefix(d *advRefsDecoder) decoderStateFn { - if ok := d.nextLine(); !ok { - return nil - } - - if !isPrefix(d.line) { - return decodeFirstHash - } - - tmp := make([]byte, len(d.line)) - copy(tmp, d.line) - d.data.Prefix = append(d.data.Prefix, tmp) - if ok := d.nextLine(); !ok { - return nil - } - - if !isFlush(d.line) { - return decodeFirstHash - } - - d.data.Prefix = append(d.data.Prefix, pktline.Flush) - if ok := d.nextLine(); !ok { - return nil - } - - return decodeFirstHash -} - -func isPrefix(payload []byte) bool { - return len(payload) > 0 && payload[0] == '#' -} - -// If the first hash is zero, then a no-refs is coming. Otherwise, a -// list-of-refs is coming, and the hash will be followed by the first -// advertised ref. -func decodeFirstHash(p *advRefsDecoder) decoderStateFn { - // If the repository is empty, we receive a flush here (HTTP). - if isFlush(p.line) { - p.err = ErrEmptyAdvRefs - return nil - } - - // TODO: Use object-format (when available) for hash size. Git 2.41+ - if len(p.line) < hashSize { - p.error("cannot read hash, pkt-line too short") - return nil - } - - if _, err := hex.Decode(p.hash[:], p.line[:hashSize]); err != nil { - p.error("invalid hash text: %s", err) - return nil - } - - p.line = p.line[hashSize:] - - if p.hash.IsZero() { - return decodeSkipNoRefs - } - - return decodeFirstRef -} - -// Skips SP "capabilities^{}" NUL -func decodeSkipNoRefs(p *advRefsDecoder) decoderStateFn { - if len(p.line) < len(noHeadMark) { - p.error("too short zero-id ref") - return nil - } - - if !bytes.HasPrefix(p.line, noHeadMark) { - p.error("malformed zero-id ref") - return nil - } - - p.line = p.line[len(noHeadMark):] - - return decodeCaps -} - -// decode the refname, expects SP refname NULL -func decodeFirstRef(l *advRefsDecoder) decoderStateFn { - if len(l.line) < 3 { - l.error("line too short after hash") - return nil - } - - if !bytes.HasPrefix(l.line, sp) { - l.error("no space after hash") - return nil - } - l.line = l.line[1:] - - chunks := bytes.SplitN(l.line, null, 2) - if len(chunks) < 2 { - l.error("NULL not found") - return nil - } - ref := chunks[0] - l.line = chunks[1] - - if bytes.Equal(ref, []byte(head)) { - l.data.Head = &l.hash - } else { - l.data.References[string(ref)] = l.hash - } - - return decodeCaps -} - -func decodeCaps(p *advRefsDecoder) decoderStateFn { - if err := p.data.Capabilities.Decode(p.line); err != nil { - p.error("invalid capabilities: %s", err) - return nil - } - - return decodeOtherRefs -} - -// The refs are either tips (obj-id SP refname) or a peeled (obj-id SP refname^{}). -// If there are no refs, then there might be a shallow or flush-ptk. -func decodeOtherRefs(p *advRefsDecoder) decoderStateFn { - if ok := p.nextLine(); !ok { - return nil - } - - if bytes.HasPrefix(p.line, shallow) { - return decodeShallow - } - - if len(p.line) == 0 { - return nil - } - - saveTo := p.data.References - if bytes.HasSuffix(p.line, peeled) { - p.line = bytes.TrimSuffix(p.line, peeled) - saveTo = p.data.Peeled - } - - ref, hash, err := readRef(p.line) - if err != nil { - p.error("%s", err) - return nil - } - saveTo[ref] = hash - - return decodeOtherRefs -} - -// Reads a ref-name -func readRef(data []byte) (string, plumbing.Hash, error) { - chunks := bytes.Split(data, sp) - switch { - case len(chunks) == 1: - return "", plumbing.ZeroHash, fmt.Errorf("malformed ref data: no space was found") - case len(chunks) > 2: - return "", plumbing.ZeroHash, fmt.Errorf("malformed ref data: more than one space found") - default: - return string(chunks[1]), plumbing.NewHash(string(chunks[0])), nil - } -} - -// Keeps reading shallows until a flush-pkt is found -func decodeShallow(p *advRefsDecoder) decoderStateFn { - if !bytes.HasPrefix(p.line, shallow) { - p.error("malformed shallow prefix, found %q... instead", p.line[:len(shallow)]) - return nil - } - p.line = bytes.TrimPrefix(p.line, shallow) - - if len(p.line) != hashSize { - p.error(fmt.Sprintf( - "malformed shallow hash: wrong length, expected 40 bytes, read %d bytes", - len(p.line))) - return nil - } - - text := p.line[:hashSize] - var h plumbing.Hash - if _, err := hex.Decode(h[:], text); err != nil { - p.error("invalid hash text: %s", err) - return nil - } - - p.data.Shallows = append(p.data.Shallows, h) - - if ok := p.nextLine(); !ok { - return nil - } - - if len(p.line) == 0 { - return nil // successful parse of the advertised-refs message - } - - return decodeShallow -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_encode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_encode.go deleted file mode 100644 index fb9bd883fc..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/advrefs_encode.go +++ /dev/null @@ -1,176 +0,0 @@ -package packp - -import ( - "bytes" - "fmt" - "io" - "sort" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" -) - -// Encode writes the AdvRefs encoding to a writer. -// -// All the payloads will end with a newline character. Capabilities, -// references and shallows are written in alphabetical order, except for -// peeled references that always follow their corresponding references. -func (a *AdvRefs) Encode(w io.Writer) error { - e := newAdvRefsEncoder(w) - return e.Encode(a) -} - -type advRefsEncoder struct { - data *AdvRefs // data to encode - pe *pktline.Encoder // where to write the encoded data - firstRefName string // reference name to encode in the first pkt-line (HEAD if present) - firstRefHash plumbing.Hash // hash referenced to encode in the first pkt-line (HEAD if present) - sortedRefs []string // hash references to encode ordered by increasing order - err error // sticky error - -} - -func newAdvRefsEncoder(w io.Writer) *advRefsEncoder { - return &advRefsEncoder{ - pe: pktline.NewEncoder(w), - } -} - -func (e *advRefsEncoder) Encode(v *AdvRefs) error { - e.data = v - e.sortRefs() - e.setFirstRef() - - for state := encodePrefix; state != nil; { - state = state(e) - } - - return e.err -} - -func (e *advRefsEncoder) sortRefs() { - if len(e.data.References) > 0 { - refs := make([]string, 0, len(e.data.References)) - for refName := range e.data.References { - refs = append(refs, refName) - } - - sort.Strings(refs) - e.sortedRefs = refs - } -} - -func (e *advRefsEncoder) setFirstRef() { - if e.data.Head != nil { - e.firstRefName = head - e.firstRefHash = *e.data.Head - return - } - - if len(e.sortedRefs) > 0 { - refName := e.sortedRefs[0] - e.firstRefName = refName - e.firstRefHash = e.data.References[refName] - } -} - -type encoderStateFn func(*advRefsEncoder) encoderStateFn - -func encodePrefix(e *advRefsEncoder) encoderStateFn { - for _, p := range e.data.Prefix { - if bytes.Equal(p, pktline.Flush) { - if e.err = e.pe.Flush(); e.err != nil { - return nil - } - continue - } - if e.err = e.pe.Encodef("%s\n", string(p)); e.err != nil { - return nil - } - } - - return encodeFirstLine -} - -// Adds the first pkt-line payload: head hash, head ref and capabilities. -// If HEAD ref is not found, the first reference ordered in increasing order will be used. -// If there aren't HEAD neither refs, the first line will be "PKT-LINE(zero-id SP "capabilities^{}" NUL capability-list)". -// See: https://github.com/git/git/blob/master/Documentation/technical/pack-protocol.txt -// See: https://github.com/git/git/blob/master/Documentation/technical/protocol-common.txt -func encodeFirstLine(e *advRefsEncoder) encoderStateFn { - const formatFirstLine = "%s %s\x00%s\n" - var firstLine string - capabilities := formatCaps(e.data.Capabilities) - - if e.firstRefName == "" { - firstLine = fmt.Sprintf(formatFirstLine, plumbing.ZeroHash.String(), "capabilities^{}", capabilities) - } else { - firstLine = fmt.Sprintf(formatFirstLine, e.firstRefHash.String(), e.firstRefName, capabilities) - - } - - if e.err = e.pe.EncodeString(firstLine); e.err != nil { - return nil - } - - return encodeRefs -} - -func formatCaps(c *capability.List) string { - if c == nil { - return "" - } - - return c.String() -} - -// Adds the (sorted) refs: hash SP refname EOL -// and their peeled refs if any. -func encodeRefs(e *advRefsEncoder) encoderStateFn { - for _, r := range e.sortedRefs { - if r == e.firstRefName { - continue - } - - hash := e.data.References[r] - if e.err = e.pe.Encodef("%s %s\n", hash.String(), r); e.err != nil { - return nil - } - - if hash, ok := e.data.Peeled[r]; ok { - if e.err = e.pe.Encodef("%s %s^{}\n", hash.String(), r); e.err != nil { - return nil - } - } - } - - return encodeShallow -} - -// Adds the (sorted) shallows: "shallow" SP hash EOL -func encodeShallow(e *advRefsEncoder) encoderStateFn { - sorted := sortShallows(e.data.Shallows) - for _, hash := range sorted { - if e.err = e.pe.Encodef("shallow %s\n", hash); e.err != nil { - return nil - } - } - - return encodeFlush -} - -func sortShallows(c []plumbing.Hash) []string { - ret := []string{} - for _, h := range c { - ret = append(ret, h.String()) - } - sort.Strings(ret) - - return ret -} - -func encodeFlush(e *advRefsEncoder) encoderStateFn { - e.err = e.pe.Flush() - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/capability.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/capability.go deleted file mode 100644 index b52e8a49d5..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/capability.go +++ /dev/null @@ -1,272 +0,0 @@ -// Package capability defines the server and client capabilities. -package capability - -import ( - "fmt" - "os" -) - -// Capability describes a server or client capability. -type Capability string - -func (n Capability) String() string { - return string(n) -} - -const ( - // MultiACK capability allows the server to return "ACK obj-id continue" as - // soon as it finds a commit that it can use as a common base, between the - // client's wants and the client's have set. - // - // By sending this early, the server can potentially head off the client - // from walking any further down that particular branch of the client's - // repository history. The client may still need to walk down other - // branches, sending have lines for those, until the server has a - // complete cut across the DAG, or the client has said "done". - // - // Without multi_ack, a client sends have lines in --date-order until - // the server has found a common base. That means the client will send - // have lines that are already known by the server to be common, because - // they overlap in time with another branch that the server hasn't found - // a common base on yet. - // - // For example suppose the client has commits in caps that the server - // doesn't and the server has commits in lower case that the client - // doesn't, as in the following diagram: - // - // +---- u ---------------------- x - // / +----- y - // / / - // a -- b -- c -- d -- E -- F - // \ - // +--- Q -- R -- S - // - // If the client wants x,y and starts out by saying have F,S, the server - // doesn't know what F,S is. Eventually the client says "have d" and - // the server sends "ACK d continue" to let the client know to stop - // walking down that line (so don't send c-b-a), but it's not done yet, - // it needs a base for x. The client keeps going with S-R-Q, until a - // gets reached, at which point the server has a clear base and it all - // ends. - // - // Without multi_ack the client would have sent that c-b-a chain anyway, - // interleaved with S-R-Q. - MultiACK Capability = "multi_ack" - // MultiACKDetailed is an extension of multi_ack that permits client to - // better understand the server's in-memory state. - MultiACKDetailed Capability = "multi_ack_detailed" - // NoDone should only be used with the smart HTTP protocol. If - // multi_ack_detailed and no-done are both present, then the sender is - // free to immediately send a pack following its first "ACK obj-id ready" - // message. - // - // Without no-done in the smart HTTP protocol, the server session would - // end and the client has to make another trip to send "done" before - // the server can send the pack. no-done removes the last round and - // thus slightly reduces latency. - NoDone Capability = "no-done" - // ThinPack is one with deltas which reference base objects not - // contained within the pack (but are known to exist at the receiving - // end). This can reduce the network traffic significantly, but it - // requires the receiving end to know how to "thicken" these packs by - // adding the missing bases to the pack. - // - // The upload-pack server advertises 'thin-pack' when it can generate - // and send a thin pack. A client requests the 'thin-pack' capability - // when it understands how to "thicken" it, notifying the server that - // it can receive such a pack. A client MUST NOT request the - // 'thin-pack' capability if it cannot turn a thin pack into a - // self-contained pack. - // - // Receive-pack, on the other hand, is assumed by default to be able to - // handle thin packs, but can ask the client not to use the feature by - // advertising the 'no-thin' capability. A client MUST NOT send a thin - // pack if the server advertises the 'no-thin' capability. - // - // The reasons for this asymmetry are historical. The receive-pack - // program did not exist until after the invention of thin packs, so - // historically the reference implementation of receive-pack always - // understood thin packs. Adding 'no-thin' later allowed receive-pack - // to disable the feature in a backwards-compatible manner. - ThinPack Capability = "thin-pack" - // Sideband means that server can send, and client understand multiplexed - // progress reports and error info interleaved with the packfile itself. - // - // These two options are mutually exclusive. A modern client always - // favors Sideband64k. - // - // Either mode indicates that the packfile data will be streamed broken - // up into packets of up to either 1000 bytes in the case of 'side_band', - // or 65520 bytes in the case of 'side_band_64k'. Each packet is made up - // of a leading 4-byte pkt-line length of how much data is in the packet, - // followed by a 1-byte stream code, followed by the actual data. - // - // The stream code can be one of: - // - // 1 - pack data - // 2 - progress messages - // 3 - fatal error message just before stream aborts - // - // The "side-band-64k" capability came about as a way for newer clients - // that can handle much larger packets to request packets that are - // actually crammed nearly full, while maintaining backward compatibility - // for the older clients. - // - // Further, with side-band and its up to 1000-byte messages, it's actually - // 999 bytes of payload and 1 byte for the stream code. With side-band-64k, - // same deal, you have up to 65519 bytes of data and 1 byte for the stream - // code. - // - // The client MUST send only maximum of one of "side-band" and "side- - // band-64k". Server MUST diagnose it as an error if client requests - // both. - Sideband Capability = "side-band" - Sideband64k Capability = "side-band-64k" - // OFSDelta server can send, and client understand PACKv2 with delta - // referring to its base by position in pack rather than by an obj-id. That - // is, they can send/read OBJ_OFS_DELTA (aka type 6) in a packfile. - OFSDelta Capability = "ofs-delta" - // Agent the server may optionally send this capability to notify the client - // that the server is running version `X`. The client may optionally return - // its own agent string by responding with an `agent=Y` capability (but it - // MUST NOT do so if the server did not mention the agent capability). The - // `X` and `Y` strings may contain any printable ASCII characters except - // space (i.e., the byte range 32 < x < 127), and are typically of the form - // "package/version" (e.g., "git/1.8.3.1"). The agent strings are purely - // informative for statistics and debugging purposes, and MUST NOT be used - // to programmatically assume the presence or absence of particular features. - Agent Capability = "agent" - // Shallow capability adds "deepen", "shallow" and "unshallow" commands to - // the fetch-pack/upload-pack protocol so clients can request shallow - // clones. - Shallow Capability = "shallow" - // DeepenSince adds "deepen-since" command to fetch-pack/upload-pack - // protocol so the client can request shallow clones that are cut at a - // specific time, instead of depth. Internally it's equivalent of doing - // "rev-list --max-age=" on the server side. "deepen-since" - // cannot be used with "deepen". - DeepenSince Capability = "deepen-since" - // DeepenNot adds "deepen-not" command to fetch-pack/upload-pack - // protocol so the client can request shallow clones that are cut at a - // specific revision, instead of depth. Internally it's equivalent of - // doing "rev-list --not " on the server side. "deepen-not" - // cannot be used with "deepen", but can be used with "deepen-since". - DeepenNot Capability = "deepen-not" - // DeepenRelative if this capability is requested by the client, the - // semantics of "deepen" command is changed. The "depth" argument is the - // depth from the current shallow boundary, instead of the depth from - // remote refs. - DeepenRelative Capability = "deepen-relative" - // NoProgress the client was started with "git clone -q" or something, and - // doesn't want that side band 2. Basically the client just says "I do not - // wish to receive stream 2 on sideband, so do not send it to me, and if - // you did, I will drop it on the floor anyway". However, the sideband - // channel 3 is still used for error responses. - NoProgress Capability = "no-progress" - // IncludeTag capability is about sending annotated tags if we are - // sending objects they point to. If we pack an object to the client, and - // a tag object points exactly at that object, we pack the tag object too. - // In general this allows a client to get all new annotated tags when it - // fetches a branch, in a single network connection. - // - // Clients MAY always send include-tag, hardcoding it into a request when - // the server advertises this capability. The decision for a client to - // request include-tag only has to do with the client's desires for tag - // data, whether or not a server had advertised objects in the - // refs/tags/* namespace. - // - // Servers MUST pack the tags if their referrant is packed and the client - // has requested include-tags. - // - // Clients MUST be prepared for the case where a server has ignored - // include-tag and has not actually sent tags in the pack. In such - // cases the client SHOULD issue a subsequent fetch to acquire the tags - // that include-tag would have otherwise given the client. - // - // The server SHOULD send include-tag, if it supports it, regardless - // of whether or not there are tags available. - IncludeTag Capability = "include-tag" - // ReportStatus the receive-pack process can receive a 'report-status' - // capability, which tells it that the client wants a report of what - // happened after a packfile upload and reference update. If the pushing - // client requests this capability, after unpacking and updating references - // the server will respond with whether the packfile unpacked successfully - // and if each reference was updated successfully. If any of those were not - // successful, it will send back an error message. See pack-protocol.txt - // for example messages. - ReportStatus Capability = "report-status" - // DeleteRefs If the server sends back this capability, it means that - // it is capable of accepting a zero-id value as the target - // value of a reference update. It is not sent back by the client, it - // simply informs the client that it can be sent zero-id values - // to delete references - DeleteRefs Capability = "delete-refs" - // Quiet If the receive-pack server advertises this capability, it is - // capable of silencing human-readable progress output which otherwise may - // be shown when processing the received pack. A send-pack client should - // respond with the 'quiet' capability to suppress server-side progress - // reporting if the local progress reporting is also being suppressed - // (e.g., via `push -q`, or if stderr does not go to a tty). - Quiet Capability = "quiet" - // Atomic If the server sends this capability it is capable of accepting - // atomic pushes. If the pushing client requests this capability, the server - // will update the refs in one atomic transaction. Either all refs are - // updated or none. - Atomic Capability = "atomic" - // PushOptions If the server sends this capability it is able to accept - // push options after the update commands have been sent, but before the - // packfile is streamed. If the pushing client requests this capability, - // the server will pass the options to the pre- and post- receive hooks - // that process this push request. - PushOptions Capability = "push-options" - // AllowTipSHA1InWant if the upload-pack server advertises this capability, - // fetch-pack may send "want" lines with SHA-1s that exist at the server but - // are not advertised by upload-pack. - AllowTipSHA1InWant Capability = "allow-tip-sha1-in-want" - // AllowReachableSHA1InWant if the upload-pack server advertises this - // capability, fetch-pack may send "want" lines with SHA-1s that exist at - // the server but are not advertised by upload-pack. - AllowReachableSHA1InWant Capability = "allow-reachable-sha1-in-want" - // PushCert the receive-pack server that advertises this capability is - // willing to accept a signed push certificate, and asks the to be - // included in the push certificate. A send-pack client MUST NOT - // send a push-cert packet unless the receive-pack server advertises - // this capability. - PushCert Capability = "push-cert" - // SymRef symbolic reference support for better negotiation. - SymRef Capability = "symref" - // ObjectFormat takes a hash algorithm as an argument, indicates that the - // server supports the given hash algorithms. - ObjectFormat Capability = "object-format" - // Filter if present, fetch-pack may send "filter" commands to request a - // partial clone or partial fetch and request that the server omit various objects from the packfile - Filter Capability = "filter" -) - -const userAgent = "go-git/5.x" - -// DefaultAgent provides the user agent string. -func DefaultAgent() string { - if envUserAgent, ok := os.LookupEnv("GO_GIT_USER_AGENT_EXTRA"); ok { - return fmt.Sprintf("%s %s", userAgent, envUserAgent) - } - return userAgent -} - -var known = map[Capability]bool{ - MultiACK: true, MultiACKDetailed: true, NoDone: true, ThinPack: true, - Sideband: true, Sideband64k: true, OFSDelta: true, Agent: true, - Shallow: true, DeepenSince: true, DeepenNot: true, DeepenRelative: true, - NoProgress: true, IncludeTag: true, ReportStatus: true, DeleteRefs: true, - Quiet: true, Atomic: true, PushOptions: true, AllowTipSHA1InWant: true, - AllowReachableSHA1InWant: true, PushCert: true, SymRef: true, - ObjectFormat: true, Filter: true, -} - -var requiresArgument = map[Capability]bool{ - Agent: true, PushCert: true, SymRef: true, ObjectFormat: true, -} - -var multipleArgument = map[Capability]bool{ - SymRef: true, -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/list.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/list.go deleted file mode 100644 index 553d81cbe4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/capability/list.go +++ /dev/null @@ -1,195 +0,0 @@ -package capability - -import ( - "bytes" - "errors" - "fmt" - "strings" -) - -var ( - // ErrArgumentsRequired is returned if no arguments are giving with a - // capability that requires arguments - ErrArgumentsRequired = errors.New("arguments required") - // ErrArguments is returned if arguments are given with a capabilities that - // not supports arguments - ErrArguments = errors.New("arguments not allowed") - // ErrEmptyArgument is returned when an empty value is given - ErrEmptyArgument = errors.New("empty argument") - // ErrMultipleArguments multiple argument given to a capabilities that not - // support it - ErrMultipleArguments = errors.New("multiple arguments not allowed") -) - -// List represents a list of capabilities -type List struct { - m map[Capability]*entry - sort []string -} - -type entry struct { - Name Capability - Values []string -} - -// NewList returns a new List of capabilities -func NewList() *List { - return &List{ - m: make(map[Capability]*entry), - } -} - -// IsEmpty returns true if the List is empty -func (l *List) IsEmpty() bool { - return len(l.sort) == 0 -} - -// Decode decodes list of capabilities from raw into the list -func (l *List) Decode(raw []byte) error { - // git 1.x receive pack used to send a leading space on its - // git-receive-pack capabilities announcement. We just trim space to be - // tolerant to space changes in different versions. - raw = bytes.TrimSpace(raw) - - if len(raw) == 0 { - return nil - } - - for _, data := range bytes.Split(raw, []byte{' '}) { - pair := bytes.SplitN(data, []byte{'='}, 2) - - c := Capability(pair[0]) - if len(pair) == 1 { - if err := l.Add(c); err != nil { - return err - } - - continue - } - - if err := l.Add(c, string(pair[1])); err != nil { - return err - } - } - - return nil -} - -// Get returns the values for a capability -func (l *List) Get(capability Capability) []string { - if _, ok := l.m[capability]; !ok { - return nil - } - - return l.m[capability].Values -} - -// Set sets a capability removing the previous values -func (l *List) Set(capability Capability, values ...string) error { - if _, ok := l.m[capability]; ok { - l.m[capability].Values = l.m[capability].Values[:0] - } - return l.Add(capability, values...) -} - -// Add adds a capability, values are optional -func (l *List) Add(c Capability, values ...string) error { - if err := l.validate(c, values); err != nil { - return err - } - - if !l.Supports(c) { - l.m[c] = &entry{Name: c} - l.sort = append(l.sort, c.String()) - } - - if len(values) == 0 { - return nil - } - - if known[c] && !multipleArgument[c] && len(l.m[c].Values) > 0 { - return ErrMultipleArguments - } - - l.m[c].Values = append(l.m[c].Values, values...) - return nil -} - -func (l *List) validateNoEmptyArgs(values []string) error { - for _, v := range values { - if v == "" { - return ErrEmptyArgument - } - } - return nil -} - -func (l *List) validate(c Capability, values []string) error { - if !known[c] { - return l.validateNoEmptyArgs(values) - } - if requiresArgument[c] && len(values) == 0 { - return ErrArgumentsRequired - } - - if !requiresArgument[c] && len(values) != 0 { - return ErrArguments - } - - if !multipleArgument[c] && len(values) > 1 { - return ErrMultipleArguments - } - return l.validateNoEmptyArgs(values) -} - -// Supports returns true if capability is present -func (l *List) Supports(capability Capability) bool { - _, ok := l.m[capability] - return ok -} - -// Delete deletes a capability from the List -func (l *List) Delete(capability Capability) { - if !l.Supports(capability) { - return - } - - delete(l.m, capability) - for i, c := range l.sort { - if c != string(capability) { - continue - } - - l.sort = append(l.sort[:i], l.sort[i+1:]...) - return - } -} - -// All returns a slice with all defined capabilities. -func (l *List) All() []Capability { - var cs []Capability - for _, key := range l.sort { - cs = append(cs, Capability(key)) - } - - return cs -} - -// String generates the capabilities strings, the capabilities are sorted in -// insertion order -func (l *List) String() string { - var o []string - for _, key := range l.sort { - cap := l.m[Capability(key)] - if len(cap.Values) == 0 { - o = append(o, key) - continue - } - - for _, value := range cap.Values { - o = append(o, fmt.Sprintf("%s=%s", key, value)) - } - } - - return strings.Join(o, " ") -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/common.go deleted file mode 100644 index a858323e79..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/common.go +++ /dev/null @@ -1,74 +0,0 @@ -package packp - -import ( - "fmt" -) - -type stateFn func() stateFn - -const ( - // common - hashSize = 40 - - // advrefs - head = "HEAD" - noHead = "capabilities^{}" -) - -var ( - // common - sp = []byte(" ") - eol = []byte("\n") - - // advertised-refs - null = []byte("\x00") - peeled = []byte("^{}") - noHeadMark = []byte(" capabilities^{}\x00") - - // upload-request - want = []byte("want ") - shallow = []byte("shallow ") - deepen = []byte("deepen") - deepenCommits = []byte("deepen ") - deepenSince = []byte("deepen-since ") - deepenReference = []byte("deepen-not ") - - // shallow-update - unshallow = []byte("unshallow ") - - // server-response - ack = []byte("ACK") - nak = []byte("NAK") - - // updreq - shallowNoSp = []byte("shallow") -) - -func isFlush(payload []byte) bool { - return len(payload) == 0 -} - -var ( - // ErrNilWriter is returned when a nil writer is passed to the encoder. - ErrNilWriter = fmt.Errorf("nil writer") -) - -// ErrUnexpectedData represents an unexpected data decoding a message -type ErrUnexpectedData struct { - Msg string - Data []byte -} - -// NewErrUnexpectedData returns a new ErrUnexpectedData containing the data and -// the message given -func NewErrUnexpectedData(msg string, data []byte) error { - return &ErrUnexpectedData{Msg: msg, Data: data} -} - -func (err *ErrUnexpectedData) Error() string { - if len(err.Data) == 0 { - return err.Msg - } - - return fmt.Sprintf("%s (%s)", err.Msg, err.Data) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/doc.go deleted file mode 100644 index 4950d1d662..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/doc.go +++ /dev/null @@ -1,724 +0,0 @@ -package packp - -/* - -A nice way to trace the real data transmitted and received by git, use: - -GIT_TRACE_PACKET=true git ls-remote http://github.com/src-d/go-git -GIT_TRACE_PACKET=true git clone http://github.com/src-d/go-git - -Here follows a copy of the current protocol specification at the time of -this writing. - -(Please notice that most http git servers will add a flush-pkt after the -first pkt-line when using HTTP smart.) - - -Documentation Common to Pack and Http Protocols -=============================================== - -ABNF Notation -------------- - -ABNF notation as described by RFC 5234 is used within the protocol documents, -except the following replacement core rules are used: ----- - HEXDIG = DIGIT / "a" / "b" / "c" / "d" / "e" / "f" ----- - -We also define the following common rules: ----- - NUL = %x00 - zero-id = 40*"0" - obj-id = 40*(HEXDIGIT) - - refname = "HEAD" - refname /= "refs/" ----- - -A refname is a hierarchical octet string beginning with "refs/" and -not violating the 'git-check-ref-format' command's validation rules. -More specifically, they: - -. They can include slash `/` for hierarchical (directory) - grouping, but no slash-separated component can begin with a - dot `.`. - -. They must contain at least one `/`. This enforces the presence of a - category like `heads/`, `tags/` etc. but the actual names are not - restricted. - -. They cannot have two consecutive dots `..` anywhere. - -. They cannot have ASCII control characters (i.e. bytes whose - values are lower than \040, or \177 `DEL`), space, tilde `~`, - caret `^`, colon `:`, question-mark `?`, asterisk `*`, - or open bracket `[` anywhere. - -. They cannot end with a slash `/` or a dot `.`. - -. They cannot end with the sequence `.lock`. - -. They cannot contain a sequence `@{`. - -. They cannot contain a `\\`. - - -pkt-line Format ---------------- - -Much (but not all) of the payload is described around pkt-lines. - -A pkt-line is a variable length binary string. The first four bytes -of the line, the pkt-len, indicates the total length of the line, -in hexadecimal. The pkt-len includes the 4 bytes used to contain -the length's hexadecimal representation. - -A pkt-line MAY contain binary data, so implementors MUST ensure -pkt-line parsing/formatting routines are 8-bit clean. - -A non-binary line SHOULD BE terminated by an LF, which if present -MUST be included in the total length. Receivers MUST treat pkt-lines -with non-binary data the same whether or not they contain the trailing -LF (stripping the LF if present, and not complaining when it is -missing). - -The maximum length of a pkt-line's data component is 65516 bytes. -Implementations MUST NOT send pkt-line whose length exceeds 65520 -(65516 bytes of payload + 4 bytes of length data). - -Implementations SHOULD NOT send an empty pkt-line ("0004"). - -A pkt-line with a length field of 0 ("0000"), called a flush-pkt, -is a special case and MUST be handled differently than an empty -pkt-line ("0004"). - ----- - pkt-line = data-pkt / flush-pkt - - data-pkt = pkt-len pkt-payload - pkt-len = 4*(HEXDIG) - pkt-payload = (pkt-len - 4)*(OCTET) - - flush-pkt = "0000" ----- - -Examples (as C-style strings): - ----- - pkt-line actual value - --------------------------------- - "0006a\n" "a\n" - "0005a" "a" - "000bfoobar\n" "foobar\n" - "0004" "" ----- - -Packfile transfer protocols -=========================== - -Git supports transferring data in packfiles over the ssh://, git://, http:// and -file:// transports. There exist two sets of protocols, one for pushing -data from a client to a server and another for fetching data from a -server to a client. The three transports (ssh, git, file) use the same -protocol to transfer data. http is documented in http-protocol.txt. - -The processes invoked in the canonical Git implementation are 'upload-pack' -on the server side and 'fetch-pack' on the client side for fetching data; -then 'receive-pack' on the server and 'send-pack' on the client for pushing -data. The protocol functions to have a server tell a client what is -currently on the server, then for the two to negotiate the smallest amount -of data to send in order to fully update one or the other. - -pkt-line Format ---------------- - -The descriptions below build on the pkt-line format described in -protocol-common.txt. When the grammar indicate `PKT-LINE(...)`, unless -otherwise noted the usual pkt-line LF rules apply: the sender SHOULD -include a LF, but the receiver MUST NOT complain if it is not present. - -Transports ----------- -There are three transports over which the packfile protocol is -initiated. The Git transport is a simple, unauthenticated server that -takes the command (almost always 'upload-pack', though Git -servers can be configured to be globally writable, in which 'receive- -pack' initiation is also allowed) with which the client wishes to -communicate and executes it and connects it to the requesting -process. - -In the SSH transport, the client just runs the 'upload-pack' -or 'receive-pack' process on the server over the SSH protocol and then -communicates with that invoked process over the SSH connection. - -The file:// transport runs the 'upload-pack' or 'receive-pack' -process locally and communicates with it over a pipe. - -Git Transport -------------- - -The Git transport starts off by sending the command and repository -on the wire using the pkt-line format, followed by a NUL byte and a -hostname parameter, terminated by a NUL byte. - - 0032git-upload-pack /project.git\0host=myserver.com\0 - --- - git-proto-request = request-command SP pathname NUL [ host-parameter NUL ] - request-command = "git-upload-pack" / "git-receive-pack" / - "git-upload-archive" ; case sensitive - pathname = *( %x01-ff ) ; exclude NUL - host-parameter = "host=" hostname [ ":" port ] --- - -Only host-parameter is allowed in the git-proto-request. Clients -MUST NOT attempt to send additional parameters. It is used for the -git-daemon name based virtual hosting. See --interpolated-path -option to git daemon, with the %H/%CH format characters. - -Basically what the Git client is doing to connect to an 'upload-pack' -process on the server side over the Git protocol is this: - - $ echo -e -n \ - "0039git-upload-pack /schacon/gitbook.git\0host=example.com\0" | - nc -v example.com 9418 - -If the server refuses the request for some reasons, it could abort -gracefully with an error message. - ----- - error-line = PKT-LINE("ERR" SP explanation-text) ----- - - -SSH Transport -------------- - -Initiating the upload-pack or receive-pack processes over SSH is -executing the binary on the server via SSH remote execution. -It is basically equivalent to running this: - - $ ssh git.example.com "git-upload-pack '/project.git'" - -For a server to support Git pushing and pulling for a given user over -SSH, that user needs to be able to execute one or both of those -commands via the SSH shell that they are provided on login. On some -systems, that shell access is limited to only being able to run those -two commands, or even just one of them. - -In an ssh:// format URI, it's absolute in the URI, so the '/' after -the host name (or port number) is sent as an argument, which is then -read by the remote git-upload-pack exactly as is, so it's effectively -an absolute path in the remote filesystem. - - git clone ssh://user@example.com/project.git - | - v - ssh user@example.com "git-upload-pack '/project.git'" - -In a "user@host:path" format URI, its relative to the user's home -directory, because the Git client will run: - - git clone user@example.com:project.git - | - v - ssh user@example.com "git-upload-pack 'project.git'" - -The exception is if a '~' is used, in which case -we execute it without the leading '/'. - - ssh://user@example.com/~alice/project.git, - | - v - ssh user@example.com "git-upload-pack '~alice/project.git'" - -A few things to remember here: - -- The "command name" is spelled with dash (e.g. git-upload-pack), but - this can be overridden by the client; - -- The repository path is always quoted with single quotes. - -Fetching Data From a Server ---------------------------- - -When one Git repository wants to get data that a second repository -has, the first can 'fetch' from the second. This operation determines -what data the server has that the client does not then streams that -data down to the client in packfile format. - - -Reference Discovery -------------------- - -When the client initially connects the server will immediately respond -with a listing of each reference it has (all branches and tags) along -with the object name that each reference currently points to. - - $ echo -e -n "0039git-upload-pack /schacon/gitbook.git\0host=example.com\0" | - nc -v example.com 9418 - 00887217a7c7e582c46cec22a130adf4b9d7d950fba0 HEAD\0multi_ack thin-pack - side-band side-band-64k ofs-delta shallow no-progress include-tag - 00441d3fcd5ced445d1abc402225c0b8a1299641f497 refs/heads/integration - 003f7217a7c7e582c46cec22a130adf4b9d7d950fba0 refs/heads/master - 003cb88d2441cac0977faf98efc80305012112238d9d refs/tags/v0.9 - 003c525128480b96c89e6418b1e40909bf6c5b2d580f refs/tags/v1.0 - 003fe92df48743b7bc7d26bcaabfddde0a1e20cae47c refs/tags/v1.0^{} - 0000 - -The returned response is a pkt-line stream describing each ref and -its current value. The stream MUST be sorted by name according to -the C locale ordering. - -If HEAD is a valid ref, HEAD MUST appear as the first advertised -ref. If HEAD is not a valid ref, HEAD MUST NOT appear in the -advertisement list at all, but other refs may still appear. - -The stream MUST include capability declarations behind a NUL on the -first ref. The peeled value of a ref (that is "ref^{}") MUST be -immediately after the ref itself, if presented. A conforming server -MUST peel the ref if it's an annotated tag. - ----- - advertised-refs = (no-refs / list-of-refs) - *shallow - flush-pkt - - no-refs = PKT-LINE(zero-id SP "capabilities^{}" - NUL capability-list) - - list-of-refs = first-ref *other-ref - first-ref = PKT-LINE(obj-id SP refname - NUL capability-list) - - other-ref = PKT-LINE(other-tip / other-peeled) - other-tip = obj-id SP refname - other-peeled = obj-id SP refname "^{}" - - shallow = PKT-LINE("shallow" SP obj-id) - - capability-list = capability *(SP capability) - capability = 1*(LC_ALPHA / DIGIT / "-" / "_") - LC_ALPHA = %x61-7A ----- - -Server and client MUST use lowercase for obj-id, both MUST treat obj-id -as case-insensitive. - -See protocol-capabilities.txt for a list of allowed server capabilities -and descriptions. - -Packfile Negotiation --------------------- -After reference and capabilities discovery, the client can decide to -terminate the connection by sending a flush-pkt, telling the server it can -now gracefully terminate, and disconnect, when it does not need any pack -data. This can happen with the ls-remote command, and also can happen when -the client already is up-to-date. - -Otherwise, it enters the negotiation phase, where the client and -server determine what the minimal packfile necessary for transport is, -by telling the server what objects it wants, its shallow objects -(if any), and the maximum commit depth it wants (if any). The client -will also send a list of the capabilities it wants to be in effect, -out of what the server said it could do with the first 'want' line. - ----- - upload-request = want-list - *shallow-line - *1depth-request - flush-pkt - - want-list = first-want - *additional-want - - shallow-line = PKT-LINE("shallow" SP obj-id) - - depth-request = PKT-LINE("deepen" SP depth) / - PKT-LINE("deepen-since" SP timestamp) / - PKT-LINE("deepen-not" SP ref) - - first-want = PKT-LINE("want" SP obj-id SP capability-list) - additional-want = PKT-LINE("want" SP obj-id) - - depth = 1*DIGIT ----- - -Clients MUST send all the obj-ids it wants from the reference -discovery phase as 'want' lines. Clients MUST send at least one -'want' command in the request body. Clients MUST NOT mention an -obj-id in a 'want' command which did not appear in the response -obtained through ref discovery. - -The client MUST write all obj-ids which it only has shallow copies -of (meaning that it does not have the parents of a commit) as -'shallow' lines so that the server is aware of the limitations of -the client's history. - -The client now sends the maximum commit history depth it wants for -this transaction, which is the number of commits it wants from the -tip of the history, if any, as a 'deepen' line. A depth of 0 is the -same as not making a depth request. The client does not want to receive -any commits beyond this depth, nor does it want objects needed only to -complete those commits. Commits whose parents are not received as a -result are defined as shallow and marked as such in the server. This -information is sent back to the client in the next step. - -Once all the 'want's and 'shallow's (and optional 'deepen') are -transferred, clients MUST send a flush-pkt, to tell the server side -that it is done sending the list. - -Otherwise, if the client sent a positive depth request, the server -will determine which commits will and will not be shallow and -send this information to the client. If the client did not request -a positive depth, this step is skipped. - ----- - shallow-update = *shallow-line - *unshallow-line - flush-pkt - - shallow-line = PKT-LINE("shallow" SP obj-id) - - unshallow-line = PKT-LINE("unshallow" SP obj-id) ----- - -If the client has requested a positive depth, the server will compute -the set of commits which are no deeper than the desired depth. The set -of commits start at the client's wants. - -The server writes 'shallow' lines for each -commit whose parents will not be sent as a result. The server writes -an 'unshallow' line for each commit which the client has indicated is -shallow, but is no longer shallow at the currently requested depth -(that is, its parents will now be sent). The server MUST NOT mark -as unshallow anything which the client has not indicated was shallow. - -Now the client will send a list of the obj-ids it has using 'have' -lines, so the server can make a packfile that only contains the objects -that the client needs. In multi_ack mode, the canonical implementation -will send up to 32 of these at a time, then will send a flush-pkt. The -canonical implementation will skip ahead and send the next 32 immediately, -so that there is always a block of 32 "in-flight on the wire" at a time. - ----- - upload-haves = have-list - compute-end - - have-list = *have-line - have-line = PKT-LINE("have" SP obj-id) - compute-end = flush-pkt / PKT-LINE("done") ----- - -If the server reads 'have' lines, it then will respond by ACKing any -of the obj-ids the client said it had that the server also has. The -server will ACK obj-ids differently depending on which ack mode is -chosen by the client. - -In multi_ack mode: - - * the server will respond with 'ACK obj-id continue' for any common - commits. - - * once the server has found an acceptable common base commit and is - ready to make a packfile, it will blindly ACK all 'have' obj-ids - back to the client. - - * the server will then send a 'NAK' and then wait for another response - from the client - either a 'done' or another list of 'have' lines. - -In multi_ack_detailed mode: - - * the server will differentiate the ACKs where it is signaling - that it is ready to send data with 'ACK obj-id ready' lines, and - signals the identified common commits with 'ACK obj-id common' lines. - -Without either multi_ack or multi_ack_detailed: - - * upload-pack sends "ACK obj-id" on the first common object it finds. - After that it says nothing until the client gives it a "done". - - * upload-pack sends "NAK" on a flush-pkt if no common object - has been found yet. If one has been found, and thus an ACK - was already sent, it's silent on the flush-pkt. - -After the client has gotten enough ACK responses that it can determine -that the server has enough information to send an efficient packfile -(in the canonical implementation, this is determined when it has received -enough ACKs that it can color everything left in the --date-order queue -as common with the server, or the --date-order queue is empty), or the -client determines that it wants to give up (in the canonical implementation, -this is determined when the client sends 256 'have' lines without getting -any of them ACKed by the server - meaning there is nothing in common and -the server should just send all of its objects), then the client will send -a 'done' command. The 'done' command signals to the server that the client -is ready to receive its packfile data. - -However, the 256 limit *only* turns on in the canonical client -implementation if we have received at least one "ACK %s continue" -during a prior round. This helps to ensure that at least one common -ancestor is found before we give up entirely. - -Once the 'done' line is read from the client, the server will either -send a final 'ACK obj-id' or it will send a 'NAK'. 'obj-id' is the object -name of the last commit determined to be common. The server only sends -ACK after 'done' if there is at least one common base and multi_ack or -multi_ack_detailed is enabled. The server always sends NAK after 'done' -if there is no common base found. - -Then the server will start sending its packfile data. - ----- - server-response = *ack_multi ack / nak - ack_multi = PKT-LINE("ACK" SP obj-id ack_status) - ack_status = "continue" / "common" / "ready" - ack = PKT-LINE("ACK" SP obj-id) - nak = PKT-LINE("NAK") ----- - -A simple clone may look like this (with no 'have' lines): - ----- - C: 0054want 74730d410fcb6603ace96f1dc55ea6196122532d multi_ack \ - side-band-64k ofs-delta\n - C: 0032want 7d1665144a3a975c05f1f43902ddaf084e784dbe\n - C: 0032want 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a\n - C: 0032want 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01\n - C: 0032want 74730d410fcb6603ace96f1dc55ea6196122532d\n - C: 0000 - C: 0009done\n - - S: 0008NAK\n - S: [PACKFILE] ----- - -An incremental update (fetch) response might look like this: - ----- - C: 0054want 74730d410fcb6603ace96f1dc55ea6196122532d multi_ack \ - side-band-64k ofs-delta\n - C: 0032want 7d1665144a3a975c05f1f43902ddaf084e784dbe\n - C: 0032want 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a\n - C: 0000 - C: 0032have 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01\n - C: [30 more have lines] - C: 0032have 74730d410fcb6603ace96f1dc55ea6196122532d\n - C: 0000 - - S: 003aACK 7e47fe2bd8d01d481f44d7af0531bd93d3b21c01 continue\n - S: 003aACK 74730d410fcb6603ace96f1dc55ea6196122532d continue\n - S: 0008NAK\n - - C: 0009done\n - - S: 0031ACK 74730d410fcb6603ace96f1dc55ea6196122532d\n - S: [PACKFILE] ----- - - -Packfile Data -------------- - -Now that the client and server have finished negotiation about what -the minimal amount of data that needs to be sent to the client is, the server -will construct and send the required data in packfile format. - -See pack-format.txt for what the packfile itself actually looks like. - -If 'side-band' or 'side-band-64k' capabilities have been specified by -the client, the server will send the packfile data multiplexed. - -Each packet starting with the packet-line length of the amount of data -that follows, followed by a single byte specifying the sideband the -following data is coming in on. - -In 'side-band' mode, it will send up to 999 data bytes plus 1 control -code, for a total of up to 1000 bytes in a pkt-line. In 'side-band-64k' -mode it will send up to 65519 data bytes plus 1 control code, for a -total of up to 65520 bytes in a pkt-line. - -The sideband byte will be a '1', '2' or a '3'. Sideband '1' will contain -packfile data, sideband '2' will be used for progress information that the -client will generally print to stderr and sideband '3' is used for error -information. - -If no 'side-band' capability was specified, the server will stream the -entire packfile without multiplexing. - - -Pushing Data To a Server ------------------------- - -Pushing data to a server will invoke the 'receive-pack' process on the -server, which will allow the client to tell it which references it should -update and then send all the data the server will need for those new -references to be complete. Once all the data is received and validated, -the server will then update its references to what the client specified. - -Authentication --------------- - -The protocol itself contains no authentication mechanisms. That is to be -handled by the transport, such as SSH, before the 'receive-pack' process is -invoked. If 'receive-pack' is configured over the Git transport, those -repositories will be writable by anyone who can access that port (9418) as -that transport is unauthenticated. - -Reference Discovery -------------------- - -The reference discovery phase is done nearly the same way as it is in the -fetching protocol. Each reference obj-id and name on the server is sent -in packet-line format to the client, followed by a flush-pkt. The only -real difference is that the capability listing is different - the only -possible values are 'report-status', 'delete-refs', 'ofs-delta' and -'push-options'. - -Reference Update Request and Packfile Transfer ----------------------------------------------- - -Once the client knows what references the server is at, it can send a -list of reference update requests. For each reference on the server -that it wants to update, it sends a line listing the obj-id currently on -the server, the obj-id the client would like to update it to and the name -of the reference. - -This list is followed by a flush-pkt. Then the push options are transmitted -one per packet followed by another flush-pkt. After that the packfile that -should contain all the objects that the server will need to complete the new -references will be sent. - ----- - update-request = *shallow ( command-list | push-cert ) [packfile] - - shallow = PKT-LINE("shallow" SP obj-id) - - command-list = PKT-LINE(command NUL capability-list) - *PKT-LINE(command) - flush-pkt - - command = create / delete / update - create = zero-id SP new-id SP name - delete = old-id SP zero-id SP name - update = old-id SP new-id SP name - - old-id = obj-id - new-id = obj-id - - push-cert = PKT-LINE("push-cert" NUL capability-list LF) - PKT-LINE("certificate version 0.1" LF) - PKT-LINE("pusher" SP ident LF) - PKT-LINE("pushee" SP url LF) - PKT-LINE("nonce" SP nonce LF) - PKT-LINE(LF) - *PKT-LINE(command LF) - *PKT-LINE(gpg-signature-lines LF) - PKT-LINE("push-cert-end" LF) - - packfile = "PACK" 28*(OCTET) ----- - -If the receiving end does not support delete-refs, the sending end MUST -NOT ask for delete command. - -If the receiving end does not support push-cert, the sending end -MUST NOT send a push-cert command. When a push-cert command is -sent, command-list MUST NOT be sent; the commands recorded in the -push certificate is used instead. - -The packfile MUST NOT be sent if the only command used is 'delete'. - -A packfile MUST be sent if either create or update command is used, -even if the server already has all the necessary objects. In this -case the client MUST send an empty packfile. The only time this -is likely to happen is if the client is creating -a new branch or a tag that points to an existing obj-id. - -The server will receive the packfile, unpack it, then validate each -reference that is being updated that it hasn't changed while the request -was being processed (the obj-id is still the same as the old-id), and -it will run any update hooks to make sure that the update is acceptable. -If all of that is fine, the server will then update the references. - -Push Certificate ----------------- - -A push certificate begins with a set of header lines. After the -header and an empty line, the protocol commands follow, one per -line. Note that the trailing LF in push-cert PKT-LINEs is _not_ -optional; it must be present. - -Currently, the following header fields are defined: - -`pusher` ident:: - Identify the GPG key in "Human Readable Name " - format. - -`pushee` url:: - The repository URL (anonymized, if the URL contains - authentication material) the user who ran `git push` - intended to push into. - -`nonce` nonce:: - The 'nonce' string the receiving repository asked the - pushing user to include in the certificate, to prevent - replay attacks. - -The GPG signature lines are a detached signature for the contents -recorded in the push certificate before the signature block begins. -The detached signature is used to certify that the commands were -given by the pusher, who must be the signer. - -Report Status -------------- - -After receiving the pack data from the sender, the receiver sends a -report if 'report-status' capability is in effect. -It is a short listing of what happened in that update. It will first -list the status of the packfile unpacking as either 'unpack ok' or -'unpack [error]'. Then it will list the status for each of the references -that it tried to update. Each line is either 'ok [refname]' if the -update was successful, or 'ng [refname] [error]' if the update was not. - ----- - report-status = unpack-status - 1*(command-status) - flush-pkt - - unpack-status = PKT-LINE("unpack" SP unpack-result) - unpack-result = "ok" / error-msg - - command-status = command-ok / command-fail - command-ok = PKT-LINE("ok" SP refname) - command-fail = PKT-LINE("ng" SP refname SP error-msg) - - error-msg = 1*(OCTECT) ; where not "ok" ----- - -Updates can be unsuccessful for a number of reasons. The reference can have -changed since the reference discovery phase was originally sent, meaning -someone pushed in the meantime. The reference being pushed could be a -non-fast-forward reference and the update hooks or configuration could be -set to not allow that, etc. Also, some references can be updated while others -can be rejected. - -An example client/server communication might look like this: - ----- - S: 007c74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/local\0report-status delete-refs ofs-delta\n - S: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe refs/heads/debug\n - S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/master\n - S: 003f74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/team\n - S: 0000 - - C: 003e7d1665144a3a975c05f1f43902ddaf084e784dbe 74730d410fcb6603ace96f1dc55ea6196122532d refs/heads/debug\n - C: 003e74730d410fcb6603ace96f1dc55ea6196122532d 5a3f6be755bbb7deae50065988cbfa1ffa9ab68a refs/heads/master\n - C: 0000 - C: [PACKDATA] - - S: 000eunpack ok\n - S: 0018ok refs/heads/debug\n - S: 002ang refs/heads/master non-fast-forward\n ----- -*/ diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/gitproto.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/gitproto.go deleted file mode 100644 index 0b7ff8f826..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/gitproto.go +++ /dev/null @@ -1,120 +0,0 @@ -package packp - -import ( - "fmt" - "io" - "strings" - - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -var ( - // ErrInvalidGitProtoRequest is returned by Decode if the input is not a - // valid git protocol request. - ErrInvalidGitProtoRequest = fmt.Errorf("invalid git protocol request") -) - -// GitProtoRequest is a command request for the git protocol. -// It is used to send the command, endpoint, and extra parameters to the -// remote. -// See https://git-scm.com/docs/pack-protocol#_git_transport -type GitProtoRequest struct { - RequestCommand string - Pathname string - - // Optional - Host string - - // Optional - ExtraParams []string -} - -// validate validates the request. -func (g *GitProtoRequest) validate() error { - if g.RequestCommand == "" { - return fmt.Errorf("%w: empty request command", ErrInvalidGitProtoRequest) - } - - if g.Pathname == "" { - return fmt.Errorf("%w: empty pathname", ErrInvalidGitProtoRequest) - } - - return nil -} - -// Encode encodes the request into the writer. -func (g *GitProtoRequest) Encode(w io.Writer) error { - if w == nil { - return ErrNilWriter - } - - if err := g.validate(); err != nil { - return err - } - - p := pktline.NewEncoder(w) - req := fmt.Sprintf("%s %s\x00", g.RequestCommand, g.Pathname) - if host := g.Host; host != "" { - req += fmt.Sprintf("host=%s\x00", host) - } - - if len(g.ExtraParams) > 0 { - req += "\x00" - for _, param := range g.ExtraParams { - req += param + "\x00" - } - } - - if err := p.Encode([]byte(req)); err != nil { - return err - } - - return nil -} - -// Decode decodes the request from the reader. -func (g *GitProtoRequest) Decode(r io.Reader) error { - s := pktline.NewScanner(r) - if !s.Scan() { - err := s.Err() - if err == nil { - return ErrInvalidGitProtoRequest - } - return err - } - - line := string(s.Bytes()) - if len(line) == 0 { - return io.EOF - } - - if line[len(line)-1] != 0 { - return fmt.Errorf("%w: missing null terminator", ErrInvalidGitProtoRequest) - } - - parts := strings.SplitN(line, " ", 2) - if len(parts) != 2 { - return fmt.Errorf("%w: short request", ErrInvalidGitProtoRequest) - } - - g.RequestCommand = parts[0] - params := strings.Split(parts[1], string(null)) - if len(params) < 1 { - return fmt.Errorf("%w: missing pathname", ErrInvalidGitProtoRequest) - } - - g.Pathname = params[0] - if len(params) > 1 { - g.Host = strings.TrimPrefix(params[1], "host=") - } - - if len(params) > 2 { - for _, param := range params[2:] { - if param != "" { - g.ExtraParams = append(g.ExtraParams, param) - } - } - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/report_status.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/report_status.go deleted file mode 100644 index e2a0a108b2..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/report_status.go +++ /dev/null @@ -1,165 +0,0 @@ -package packp - -import ( - "bytes" - "fmt" - "io" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -const ( - ok = "ok" -) - -// ReportStatus is a report status message, as used in the git-receive-pack -// process whenever the 'report-status' capability is negotiated. -type ReportStatus struct { - UnpackStatus string - CommandStatuses []*CommandStatus -} - -// NewReportStatus creates a new ReportStatus message. -func NewReportStatus() *ReportStatus { - return &ReportStatus{} -} - -// Error returns the first error if any. -func (s *ReportStatus) Error() error { - if s.UnpackStatus != ok { - return fmt.Errorf("unpack error: %s", s.UnpackStatus) - } - - for _, s := range s.CommandStatuses { - if err := s.Error(); err != nil { - return err - } - } - - return nil -} - -// Encode writes the report status to a writer. -func (s *ReportStatus) Encode(w io.Writer) error { - e := pktline.NewEncoder(w) - if err := e.Encodef("unpack %s\n", s.UnpackStatus); err != nil { - return err - } - - for _, cs := range s.CommandStatuses { - if err := cs.encode(w); err != nil { - return err - } - } - - return e.Flush() -} - -// Decode reads from the given reader and decodes a report-status message. It -// does not read more input than what is needed to fill the report status. -func (s *ReportStatus) Decode(r io.Reader) error { - scan := pktline.NewScanner(r) - if err := s.scanFirstLine(scan); err != nil { - return err - } - - if err := s.decodeReportStatus(scan.Bytes()); err != nil { - return err - } - - flushed := false - for scan.Scan() { - b := scan.Bytes() - if isFlush(b) { - flushed = true - break - } - - if err := s.decodeCommandStatus(b); err != nil { - return err - } - } - - if !flushed { - return fmt.Errorf("missing flush") - } - - return scan.Err() -} - -func (s *ReportStatus) scanFirstLine(scan *pktline.Scanner) error { - if scan.Scan() { - return nil - } - - if scan.Err() != nil { - return scan.Err() - } - - return io.ErrUnexpectedEOF -} - -func (s *ReportStatus) decodeReportStatus(b []byte) error { - if isFlush(b) { - return fmt.Errorf("premature flush") - } - - b = bytes.TrimSuffix(b, eol) - - line := string(b) - fields := strings.SplitN(line, " ", 2) - if len(fields) != 2 || fields[0] != "unpack" { - return fmt.Errorf("malformed unpack status: %s", line) - } - - s.UnpackStatus = fields[1] - return nil -} - -func (s *ReportStatus) decodeCommandStatus(b []byte) error { - b = bytes.TrimSuffix(b, eol) - - line := string(b) - fields := strings.SplitN(line, " ", 3) - status := ok - if len(fields) == 3 && fields[0] == "ng" { - status = fields[2] - } else if len(fields) != 2 || fields[0] != "ok" { - return fmt.Errorf("malformed command status: %s", line) - } - - cs := &CommandStatus{ - ReferenceName: plumbing.ReferenceName(fields[1]), - Status: status, - } - s.CommandStatuses = append(s.CommandStatuses, cs) - return nil -} - -// CommandStatus is the status of a reference in a report status. -// See ReportStatus struct. -type CommandStatus struct { - ReferenceName plumbing.ReferenceName - Status string -} - -// Error returns the error, if any. -func (s *CommandStatus) Error() error { - if s.Status == ok { - return nil - } - - return fmt.Errorf("command error on %s: %s", - s.ReferenceName.String(), s.Status) -} - -func (s *CommandStatus) encode(w io.Writer) error { - e := pktline.NewEncoder(w) - if s.Error() == nil { - return e.Encodef("ok %s\n", s.ReferenceName.String()) - } - - return e.Encodef("ng %s %s\n", s.ReferenceName.String(), s.Status) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/shallowupd.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/shallowupd.go deleted file mode 100644 index fe4fe68879..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/shallowupd.go +++ /dev/null @@ -1,92 +0,0 @@ -package packp - -import ( - "bytes" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -const ( - shallowLineLen = 48 - unshallowLineLen = 50 -) - -type ShallowUpdate struct { - Shallows []plumbing.Hash - Unshallows []plumbing.Hash -} - -func (r *ShallowUpdate) Decode(reader io.Reader) error { - s := pktline.NewScanner(reader) - - for s.Scan() { - line := s.Bytes() - line = bytes.TrimSpace(line) - - var err error - switch { - case bytes.HasPrefix(line, shallow): - err = r.decodeShallowLine(line) - case bytes.HasPrefix(line, unshallow): - err = r.decodeUnshallowLine(line) - case bytes.Equal(line, pktline.Flush): - return nil - } - - if err != nil { - return err - } - } - - return s.Err() -} - -func (r *ShallowUpdate) decodeShallowLine(line []byte) error { - hash, err := r.decodeLine(line, shallow, shallowLineLen) - if err != nil { - return err - } - - r.Shallows = append(r.Shallows, hash) - return nil -} - -func (r *ShallowUpdate) decodeUnshallowLine(line []byte) error { - hash, err := r.decodeLine(line, unshallow, unshallowLineLen) - if err != nil { - return err - } - - r.Unshallows = append(r.Unshallows, hash) - return nil -} - -func (r *ShallowUpdate) decodeLine(line, prefix []byte, expLen int) (plumbing.Hash, error) { - if len(line) != expLen { - return plumbing.ZeroHash, fmt.Errorf("malformed %s%q", prefix, line) - } - - raw := string(line[expLen-40 : expLen]) - return plumbing.NewHash(raw), nil -} - -func (r *ShallowUpdate) Encode(w io.Writer) error { - e := pktline.NewEncoder(w) - - for _, h := range r.Shallows { - if err := e.Encodef("%s%s\n", shallow, h.String()); err != nil { - return err - } - } - - for _, h := range r.Unshallows { - if err := e.Encodef("%s%s\n", unshallow, h.String()); err != nil { - return err - } - } - - return e.Flush() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/common.go deleted file mode 100644 index de5001281f..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/common.go +++ /dev/null @@ -1,33 +0,0 @@ -package sideband - -// Type sideband type "side-band" or "side-band-64k" -type Type int8 - -const ( - // Sideband legacy sideband type up to 1000-byte messages - Sideband Type = iota - // Sideband64k sideband type up to 65519-byte messages - Sideband64k Type = iota - - // MaxPackedSize for Sideband type - MaxPackedSize = 1000 - // MaxPackedSize64k for Sideband64k type - MaxPackedSize64k = 65520 -) - -// Channel sideband channel -type Channel byte - -// WithPayload encode the payload as a message -func (ch Channel) WithPayload(payload []byte) []byte { - return append([]byte{byte(ch)}, payload...) -} - -const ( - // PackData packfile content - PackData Channel = 1 - // ProgressMessage progress messages - ProgressMessage Channel = 2 - // ErrorMessage fatal error message just before stream aborts - ErrorMessage Channel = 3 -) diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/demux.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/demux.go deleted file mode 100644 index 0116f962ef..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/demux.go +++ /dev/null @@ -1,148 +0,0 @@ -package sideband - -import ( - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -// ErrMaxPackedExceeded returned by Read, if the maximum packed size is exceeded -var ErrMaxPackedExceeded = errors.New("max. packed size exceeded") - -// Progress where the progress information is stored -type Progress interface { - io.Writer -} - -// Demuxer demultiplexes the progress reports and error info interleaved with the -// packfile itself. -// -// A sideband has three different channels the main one, called PackData, contains -// the packfile data; the ErrorMessage channel, that contains server errors; and -// the last one, ProgressMessage channel, containing information about the ongoing -// task happening in the server (optional, can be suppressed sending NoProgress -// or Quiet capabilities to the server) -// -// In order to demultiplex the data stream, method `Read` should be called to -// retrieve the PackData channel, the incoming data from the ProgressMessage is -// written at `Progress` (if any), if any message is retrieved from the -// ErrorMessage channel an error is returned and we can assume that the -// connection has been closed. -type Demuxer struct { - t Type - r io.Reader - s *pktline.Scanner - - max int - pending []byte - - // Progress is where the progress messages are stored - Progress Progress -} - -// NewDemuxer returns a new Demuxer for the given t and read from r -func NewDemuxer(t Type, r io.Reader) *Demuxer { - max := MaxPackedSize64k - if t == Sideband { - max = MaxPackedSize - } - - return &Demuxer{ - t: t, - r: r, - max: max, - s: pktline.NewScanner(r), - } -} - -// Read reads up to len(p) bytes from the PackData channel into p, an error can -// be return if an error happens when reading or if a message is sent in the -// ErrorMessage channel. -// -// When a ProgressMessage is read, is not copy to b, instead of this is written -// to the Progress -func (d *Demuxer) Read(b []byte) (n int, err error) { - var read, req int - - req = len(b) - for read < req { - n, err := d.doRead(b[read:req]) - read += n - - if err != nil { - return read, err - } - } - - return read, nil -} - -func (d *Demuxer) doRead(b []byte) (int, error) { - read, err := d.nextPackData() - size := len(read) - wanted := len(b) - - if size > wanted { - d.pending = read[wanted:] - } - - if wanted > size { - wanted = size - } - - size = copy(b, read[:wanted]) - return size, err -} - -func (d *Demuxer) nextPackData() ([]byte, error) { - content := d.getPending() - if len(content) != 0 { - return content, nil - } - - if !d.s.Scan() { - if err := d.s.Err(); err != nil { - return nil, err - } - - return nil, io.EOF - } - - content = d.s.Bytes() - - size := len(content) - if size == 0 { - return nil, nil - } else if size > d.max { - return nil, ErrMaxPackedExceeded - } - - switch Channel(content[0]) { - case PackData: - return content[1:], nil - case ProgressMessage: - if d.Progress != nil { - _, err := d.Progress.Write(content[1:]) - return nil, err - } - case ErrorMessage: - return nil, fmt.Errorf("unexpected error: %s", content[1:]) - default: - return nil, fmt.Errorf("unknown channel %s", content) - } - - return nil, nil -} - -func (d *Demuxer) getPending() (b []byte) { - if len(d.pending) == 0 { - return nil - } - - content := d.pending - d.pending = nil - - return content -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/doc.go deleted file mode 100644 index c5d2429529..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/doc.go +++ /dev/null @@ -1,31 +0,0 @@ -// Package sideband implements a sideband mutiplex/demultiplexer -package sideband - -// If 'side-band' or 'side-band-64k' capabilities have been specified by -// the client, the server will send the packfile data multiplexed. -// -// Either mode indicates that the packfile data will be streamed broken -// up into packets of up to either 1000 bytes in the case of 'side_band', -// or 65520 bytes in the case of 'side_band_64k'. Each packet is made up -// of a leading 4-byte pkt-line length of how much data is in the packet, -// followed by a 1-byte stream code, followed by the actual data. -// -// The stream code can be one of: -// -// 1 - pack data -// 2 - progress messages -// 3 - fatal error message just before stream aborts -// -// The "side-band-64k" capability came about as a way for newer clients -// that can handle much larger packets to request packets that are -// actually crammed nearly full, while maintaining backward compatibility -// for the older clients. -// -// Further, with side-band and its up to 1000-byte messages, it's actually -// 999 bytes of payload and 1 byte for the stream code. With side-band-64k, -// same deal, you have up to 65519 bytes of data and 1 byte for the stream -// code. -// -// The client MUST send only maximum of one of "side-band" and "side- -// band-64k". Server MUST diagnose it as an error if client requests -// both. diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/muxer.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/muxer.go deleted file mode 100644 index d51ac82695..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband/muxer.go +++ /dev/null @@ -1,65 +0,0 @@ -package sideband - -import ( - "io" - - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -// Muxer multiplex the packfile along with the progress messages and the error -// information. The multiplex is perform using pktline format. -type Muxer struct { - max int - e *pktline.Encoder -} - -const chLen = 1 - -// NewMuxer returns a new Muxer for the given t that writes on w. -// -// If t is equal to `Sideband` the max pack size is set to MaxPackedSize, in any -// other value is given, max pack is set to MaxPackedSize64k, that is the -// maximum length of a line in pktline format. -func NewMuxer(t Type, w io.Writer) *Muxer { - max := MaxPackedSize64k - if t == Sideband { - max = MaxPackedSize - } - - return &Muxer{ - max: max - chLen, - e: pktline.NewEncoder(w), - } -} - -// Write writes p in the PackData channel -func (m *Muxer) Write(p []byte) (int, error) { - return m.WriteChannel(PackData, p) -} - -// WriteChannel writes p in the given channel. This method can be used with any -// channel, but is recommend use it only for the ProgressMessage and -// ErrorMessage channels and use Write for the PackData channel -func (m *Muxer) WriteChannel(t Channel, p []byte) (int, error) { - wrote := 0 - size := len(p) - for wrote < size { - n, err := m.doWrite(t, p[wrote:]) - wrote += n - - if err != nil { - return wrote, err - } - } - - return wrote, nil -} - -func (m *Muxer) doWrite(ch Channel, p []byte) (int, error) { - sz := len(p) - if sz > m.max { - sz = m.max - } - - return sz, m.e.Encode(ch.WithPayload(p[:sz])) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/srvresp.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/srvresp.go deleted file mode 100644 index a9ddb538b2..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/srvresp.go +++ /dev/null @@ -1,141 +0,0 @@ -package packp - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -const ackLineLen = 44 - -// ServerResponse object acknowledgement from upload-pack service -type ServerResponse struct { - ACKs []plumbing.Hash -} - -// Decode decodes the response into the struct, isMultiACK should be true, if -// the request was done with multi_ack or multi_ack_detailed capabilities. -func (r *ServerResponse) Decode(reader *bufio.Reader, isMultiACK bool) error { - s := pktline.NewScanner(reader) - - for s.Scan() { - line := s.Bytes() - - if err := r.decodeLine(line); err != nil { - return err - } - - // we need to detect when the end of a response header and the beginning - // of a packfile header happened, some requests to the git daemon - // produces a duplicate ACK header even when multi_ack is not supported. - stop, err := r.stopReading(reader) - if err != nil { - return err - } - - if stop { - break - } - } - - // isMultiACK is true when the remote server advertises the related - // capabilities when they are not in transport.UnsupportedCapabilities. - // - // Users may decide to remove multi_ack and multi_ack_detailed from the - // unsupported capabilities list, which allows them to do initial clones - // from Azure DevOps. - // - // Follow-up fetches may error, therefore errors are wrapped with additional - // information highlighting that this capabilities are not supported by go-git. - // - // TODO: Implement support for multi_ack or multi_ack_detailed responses. - err := s.Err() - if err != nil && isMultiACK { - return fmt.Errorf("multi_ack and multi_ack_detailed are not supported: %w", err) - } - - return err -} - -// stopReading detects when a valid command such as ACK or NAK is found to be -// read in the buffer without moving the read pointer. -func (r *ServerResponse) stopReading(reader *bufio.Reader) (bool, error) { - ahead, err := reader.Peek(7) - if err == io.EOF { - return true, nil - } - - if err != nil { - return false, err - } - - if len(ahead) > 4 && r.isValidCommand(ahead[0:3]) { - return false, nil - } - - if len(ahead) == 7 && r.isValidCommand(ahead[4:]) { - return false, nil - } - - return true, nil -} - -func (r *ServerResponse) isValidCommand(b []byte) bool { - commands := [][]byte{ack, nak} - for _, c := range commands { - if bytes.Equal(b, c) { - return true - } - } - - return false -} - -func (r *ServerResponse) decodeLine(line []byte) error { - if len(line) == 0 { - return fmt.Errorf("unexpected flush") - } - - if len(line) >= 3 { - if bytes.Equal(line[0:3], ack) { - return r.decodeACKLine(line) - } - - if bytes.Equal(line[0:3], nak) { - return nil - } - } - - return fmt.Errorf("unexpected content %q", string(line)) -} - -func (r *ServerResponse) decodeACKLine(line []byte) error { - if len(line) < ackLineLen { - return fmt.Errorf("malformed ACK %q", line) - } - - sp := bytes.Index(line, []byte(" ")) - h := plumbing.NewHash(string(line[sp+1 : sp+41])) - r.ACKs = append(r.ACKs, h) - return nil -} - -// Encode encodes the ServerResponse into a writer. -func (r *ServerResponse) Encode(w io.Writer, isMultiACK bool) error { - if len(r.ACKs) > 1 && !isMultiACK { - // For further information, refer to comments in the Decode func above. - return errors.New("multi_ack and multi_ack_detailed are not supported") - } - - e := pktline.NewEncoder(w) - if len(r.ACKs) == 0 { - return e.Encodef("%s\n", nak) - } - - return e.Encodef("%s %s\n", ack, r.ACKs[0].String()) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq.go deleted file mode 100644 index 344f8c7e3a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq.go +++ /dev/null @@ -1,168 +0,0 @@ -package packp - -import ( - "fmt" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" -) - -// UploadRequest values represent the information transmitted on a -// upload-request message. Values from this type are not zero-value -// safe, use the New function instead. -// This is a low level type, use UploadPackRequest instead. -type UploadRequest struct { - Capabilities *capability.List - Wants []plumbing.Hash - Shallows []plumbing.Hash - Depth Depth -} - -// Depth values stores the desired depth of the requested packfile: see -// DepthCommit, DepthSince and DepthReference. -type Depth interface { - isDepth() - IsZero() bool -} - -// DepthCommits values stores the maximum number of requested commits in -// the packfile. Zero means infinite. A negative value will have -// undefined consequences. -type DepthCommits int - -func (d DepthCommits) isDepth() {} - -func (d DepthCommits) IsZero() bool { - return d == 0 -} - -// DepthSince values requests only commits newer than the specified time. -type DepthSince time.Time - -func (d DepthSince) isDepth() {} - -func (d DepthSince) IsZero() bool { - return time.Time(d).IsZero() -} - -// DepthReference requests only commits not to found in the specified reference. -type DepthReference string - -func (d DepthReference) isDepth() {} - -func (d DepthReference) IsZero() bool { - return string(d) == "" -} - -// NewUploadRequest returns a pointer to a new UploadRequest value, ready to be -// used. It has no capabilities, wants or shallows and an infinite depth. Please -// note that to encode an upload-request it has to have at least one wanted hash. -func NewUploadRequest() *UploadRequest { - return &UploadRequest{ - Capabilities: capability.NewList(), - Wants: []plumbing.Hash{}, - Shallows: []plumbing.Hash{}, - Depth: DepthCommits(0), - } -} - -// NewUploadRequestFromCapabilities returns a pointer to a new UploadRequest -// value, the request capabilities are filled with the most optimal ones, based -// on the adv value (advertised capabilities), the UploadRequest generated it -// has no wants or shallows and an infinite depth. -func NewUploadRequestFromCapabilities(adv *capability.List) *UploadRequest { - r := NewUploadRequest() - - if adv.Supports(capability.MultiACKDetailed) { - r.Capabilities.Set(capability.MultiACKDetailed) - } else if adv.Supports(capability.MultiACK) { - r.Capabilities.Set(capability.MultiACK) - } - - if adv.Supports(capability.Sideband64k) { - r.Capabilities.Set(capability.Sideband64k) - } else if adv.Supports(capability.Sideband) { - r.Capabilities.Set(capability.Sideband) - } - - if adv.Supports(capability.ThinPack) { - r.Capabilities.Set(capability.ThinPack) - } - - if adv.Supports(capability.OFSDelta) { - r.Capabilities.Set(capability.OFSDelta) - } - - if adv.Supports(capability.Agent) { - r.Capabilities.Set(capability.Agent, capability.DefaultAgent()) - } - - return r -} - -// Validate validates the content of UploadRequest, following the next rules: -// - Wants MUST have at least one reference -// - capability.Shallow MUST be present if Shallows is not empty -// - is a non-zero DepthCommits is given capability.Shallow MUST be present -// - is a DepthSince is given capability.Shallow MUST be present -// - is a DepthReference is given capability.DeepenNot MUST be present -// - MUST contain only maximum of one of capability.Sideband and capability.Sideband64k -// - MUST contain only maximum of one of capability.MultiACK and capability.MultiACKDetailed -func (req *UploadRequest) Validate() error { - if len(req.Wants) == 0 { - return fmt.Errorf("want can't be empty") - } - - if err := req.validateRequiredCapabilities(); err != nil { - return err - } - - if err := req.validateConflictCapabilities(); err != nil { - return err - } - - return nil -} - -func (req *UploadRequest) validateRequiredCapabilities() error { - msg := "missing capability %s" - - if len(req.Shallows) != 0 && !req.Capabilities.Supports(capability.Shallow) { - return fmt.Errorf(msg, capability.Shallow) - } - - switch req.Depth.(type) { - case DepthCommits: - if req.Depth != DepthCommits(0) { - if !req.Capabilities.Supports(capability.Shallow) { - return fmt.Errorf(msg, capability.Shallow) - } - } - case DepthSince: - if !req.Capabilities.Supports(capability.DeepenSince) { - return fmt.Errorf(msg, capability.DeepenSince) - } - case DepthReference: - if !req.Capabilities.Supports(capability.DeepenNot) { - return fmt.Errorf(msg, capability.DeepenNot) - } - } - - return nil -} - -func (req *UploadRequest) validateConflictCapabilities() error { - msg := "capabilities %s and %s are mutually exclusive" - if req.Capabilities.Supports(capability.Sideband) && - req.Capabilities.Supports(capability.Sideband64k) { - return fmt.Errorf(msg, capability.Sideband, capability.Sideband64k) - } - - if req.Capabilities.Supports(capability.MultiACK) && - req.Capabilities.Supports(capability.MultiACKDetailed) { - return fmt.Errorf(msg, capability.MultiACK, capability.MultiACKDetailed) - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_decode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_decode.go deleted file mode 100644 index 3da29985e2..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_decode.go +++ /dev/null @@ -1,257 +0,0 @@ -package packp - -import ( - "bytes" - "encoding/hex" - "fmt" - "io" - "strconv" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -// Decode reads the next upload-request form its input and -// stores it in the UploadRequest. -func (req *UploadRequest) Decode(r io.Reader) error { - d := newUlReqDecoder(r) - return d.Decode(req) -} - -type ulReqDecoder struct { - s *pktline.Scanner // a pkt-line scanner from the input stream - line []byte // current pkt-line contents, use parser.nextLine() to make it advance - nLine int // current pkt-line number for debugging, begins at 1 - err error // sticky error, use the parser.error() method to fill this out - data *UploadRequest // parsed data is stored here -} - -func newUlReqDecoder(r io.Reader) *ulReqDecoder { - return &ulReqDecoder{ - s: pktline.NewScanner(r), - } -} - -func (d *ulReqDecoder) Decode(v *UploadRequest) error { - d.data = v - - for state := d.decodeFirstWant; state != nil; { - state = state() - } - - return d.err -} - -// fills out the parser sticky error -func (d *ulReqDecoder) error(format string, a ...interface{}) { - msg := fmt.Sprintf( - "pkt-line %d: %s", d.nLine, - fmt.Sprintf(format, a...), - ) - - d.err = NewErrUnexpectedData(msg, d.line) -} - -// Reads a new pkt-line from the scanner, makes its payload available as -// p.line and increments p.nLine. A successful invocation returns true, -// otherwise, false is returned and the sticky error is filled out -// accordingly. Trims eols at the end of the payloads. -func (d *ulReqDecoder) nextLine() bool { - d.nLine++ - - if !d.s.Scan() { - if d.err = d.s.Err(); d.err != nil { - return false - } - - d.error("EOF") - return false - } - - d.line = d.s.Bytes() - d.line = bytes.TrimSuffix(d.line, eol) - - return true -} - -// Expected format: want [ capabilities] -func (d *ulReqDecoder) decodeFirstWant() stateFn { - if ok := d.nextLine(); !ok { - return nil - } - - if !bytes.HasPrefix(d.line, want) { - d.error("missing 'want ' prefix") - return nil - } - d.line = bytes.TrimPrefix(d.line, want) - - hash, ok := d.readHash() - if !ok { - return nil - } - d.data.Wants = append(d.data.Wants, hash) - - return d.decodeCaps -} - -func (d *ulReqDecoder) readHash() (plumbing.Hash, bool) { - if len(d.line) < hashSize { - d.err = fmt.Errorf("malformed hash: %v", d.line) - return plumbing.ZeroHash, false - } - - var hash plumbing.Hash - if _, err := hex.Decode(hash[:], d.line[:hashSize]); err != nil { - d.error("invalid hash text: %s", err) - return plumbing.ZeroHash, false - } - d.line = d.line[hashSize:] - - return hash, true -} - -// Expected format: sp cap1 sp cap2 sp cap3... -func (d *ulReqDecoder) decodeCaps() stateFn { - d.line = bytes.TrimPrefix(d.line, sp) - if err := d.data.Capabilities.Decode(d.line); err != nil { - d.error("invalid capabilities: %s", err) - } - - return d.decodeOtherWants -} - -// Expected format: want -func (d *ulReqDecoder) decodeOtherWants() stateFn { - if ok := d.nextLine(); !ok { - return nil - } - - if bytes.HasPrefix(d.line, shallow) { - return d.decodeShallow - } - - if bytes.HasPrefix(d.line, deepen) { - return d.decodeDeepen - } - - if len(d.line) == 0 { - return nil - } - - if !bytes.HasPrefix(d.line, want) { - d.error("unexpected payload while expecting a want: %q", d.line) - return nil - } - d.line = bytes.TrimPrefix(d.line, want) - - hash, ok := d.readHash() - if !ok { - return nil - } - d.data.Wants = append(d.data.Wants, hash) - - return d.decodeOtherWants -} - -// Expected format: shallow -func (d *ulReqDecoder) decodeShallow() stateFn { - if bytes.HasPrefix(d.line, deepen) { - return d.decodeDeepen - } - - if len(d.line) == 0 { - return nil - } - - if !bytes.HasPrefix(d.line, shallow) { - d.error("unexpected payload while expecting a shallow: %q", d.line) - return nil - } - d.line = bytes.TrimPrefix(d.line, shallow) - - hash, ok := d.readHash() - if !ok { - return nil - } - d.data.Shallows = append(d.data.Shallows, hash) - - if ok := d.nextLine(); !ok { - return nil - } - - return d.decodeShallow -} - -// Expected format: deepen / deepen-since
    / deepen-not -func (d *ulReqDecoder) decodeDeepen() stateFn { - if bytes.HasPrefix(d.line, deepenCommits) { - return d.decodeDeepenCommits - } - - if bytes.HasPrefix(d.line, deepenSince) { - return d.decodeDeepenSince - } - - if bytes.HasPrefix(d.line, deepenReference) { - return d.decodeDeepenReference - } - - if len(d.line) == 0 { - return nil - } - - d.error("unexpected deepen specification: %q", d.line) - return nil -} - -func (d *ulReqDecoder) decodeDeepenCommits() stateFn { - d.line = bytes.TrimPrefix(d.line, deepenCommits) - - var n int - if n, d.err = strconv.Atoi(string(d.line)); d.err != nil { - return nil - } - if n < 0 { - d.err = fmt.Errorf("negative depth") - return nil - } - d.data.Depth = DepthCommits(n) - - return d.decodeFlush -} - -func (d *ulReqDecoder) decodeDeepenSince() stateFn { - d.line = bytes.TrimPrefix(d.line, deepenSince) - - var secs int64 - secs, d.err = strconv.ParseInt(string(d.line), 10, 64) - if d.err != nil { - return nil - } - t := time.Unix(secs, 0).UTC() - d.data.Depth = DepthSince(t) - - return d.decodeFlush -} - -func (d *ulReqDecoder) decodeDeepenReference() stateFn { - d.line = bytes.TrimPrefix(d.line, deepenReference) - - d.data.Depth = DepthReference(string(d.line)) - - return d.decodeFlush -} - -func (d *ulReqDecoder) decodeFlush() stateFn { - if ok := d.nextLine(); !ok { - return nil - } - - if len(d.line) != 0 { - d.err = fmt.Errorf("unexpected payload while expecting a flush-pkt: %q", d.line) - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_encode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_encode.go deleted file mode 100644 index c451e23164..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/ulreq_encode.go +++ /dev/null @@ -1,145 +0,0 @@ -package packp - -import ( - "bytes" - "fmt" - "io" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -// Encode writes the UlReq encoding of u to the stream. -// -// All the payloads will end with a newline character. Wants and -// shallows are sorted alphabetically. A depth of 0 means no depth -// request is sent. -func (req *UploadRequest) Encode(w io.Writer) error { - e := newUlReqEncoder(w) - return e.Encode(req) -} - -type ulReqEncoder struct { - pe *pktline.Encoder // where to write the encoded data - data *UploadRequest // the data to encode - err error // sticky error -} - -func newUlReqEncoder(w io.Writer) *ulReqEncoder { - return &ulReqEncoder{ - pe: pktline.NewEncoder(w), - } -} - -func (e *ulReqEncoder) Encode(v *UploadRequest) error { - e.data = v - - if len(v.Wants) == 0 { - return fmt.Errorf("empty wants provided") - } - - plumbing.HashesSort(e.data.Wants) - for state := e.encodeFirstWant; state != nil; { - state = state() - } - - return e.err -} - -func (e *ulReqEncoder) encodeFirstWant() stateFn { - var err error - if e.data.Capabilities.IsEmpty() { - err = e.pe.Encodef("want %s\n", e.data.Wants[0]) - } else { - err = e.pe.Encodef( - "want %s %s\n", - e.data.Wants[0], - e.data.Capabilities.String(), - ) - } - - if err != nil { - e.err = fmt.Errorf("encoding first want line: %s", err) - return nil - } - - return e.encodeAdditionalWants -} - -func (e *ulReqEncoder) encodeAdditionalWants() stateFn { - last := e.data.Wants[0] - for _, w := range e.data.Wants[1:] { - if bytes.Equal(last[:], w[:]) { - continue - } - - if err := e.pe.Encodef("want %s\n", w); err != nil { - e.err = fmt.Errorf("encoding want %q: %s", w, err) - return nil - } - - last = w - } - - return e.encodeShallows -} - -func (e *ulReqEncoder) encodeShallows() stateFn { - plumbing.HashesSort(e.data.Shallows) - - var last plumbing.Hash - for _, s := range e.data.Shallows { - if bytes.Equal(last[:], s[:]) { - continue - } - - if err := e.pe.Encodef("shallow %s\n", s); err != nil { - e.err = fmt.Errorf("encoding shallow %q: %s", s, err) - return nil - } - - last = s - } - - return e.encodeDepth -} - -func (e *ulReqEncoder) encodeDepth() stateFn { - switch depth := e.data.Depth.(type) { - case DepthCommits: - if depth != 0 { - commits := int(depth) - if err := e.pe.Encodef("deepen %d\n", commits); err != nil { - e.err = fmt.Errorf("encoding depth %d: %s", depth, err) - return nil - } - } - case DepthSince: - when := time.Time(depth).UTC() - if err := e.pe.Encodef("deepen-since %d\n", when.Unix()); err != nil { - e.err = fmt.Errorf("encoding depth %s: %s", when, err) - return nil - } - case DepthReference: - reference := string(depth) - if err := e.pe.Encodef("deepen-not %s\n", reference); err != nil { - e.err = fmt.Errorf("encoding depth %s: %s", reference, err) - return nil - } - default: - e.err = fmt.Errorf("unsupported depth type") - return nil - } - - return e.encodeFlush -} - -func (e *ulReqEncoder) encodeFlush() stateFn { - if err := e.pe.Flush(); err != nil { - e.err = fmt.Errorf("encoding flush-pkt: %s", err) - return nil - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go deleted file mode 100644 index 8f39b39cbd..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq.go +++ /dev/null @@ -1,128 +0,0 @@ -package packp - -import ( - "errors" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" -) - -var ( - ErrEmptyCommands = errors.New("commands cannot be empty") - ErrMalformedCommand = errors.New("malformed command") -) - -// ReferenceUpdateRequest values represent reference upload requests. -// Values from this type are not zero-value safe, use the New function instead. -type ReferenceUpdateRequest struct { - Capabilities *capability.List - Commands []*Command - Options []*Option - Shallow *plumbing.Hash - // Packfile contains an optional packfile reader. - Packfile io.ReadCloser - - // Progress receives sideband progress messages from the server - Progress sideband.Progress -} - -// New returns a pointer to a new ReferenceUpdateRequest value. -func NewReferenceUpdateRequest() *ReferenceUpdateRequest { - return &ReferenceUpdateRequest{ - // TODO: Add support for push-cert - Capabilities: capability.NewList(), - Commands: nil, - } -} - -// NewReferenceUpdateRequestFromCapabilities returns a pointer to a new -// ReferenceUpdateRequest value, the request capabilities are filled with the -// most optimal ones, based on the adv value (advertised capabilities), the -// ReferenceUpdateRequest contains no commands -// -// It does set the following capabilities: -// - agent -// - report-status -// - ofs-delta -// - ref-delta -// - delete-refs -// It leaves up to the user to add the following capabilities later: -// - atomic -// - ofs-delta -// - side-band -// - side-band-64k -// - quiet -// - push-cert -func NewReferenceUpdateRequestFromCapabilities(adv *capability.List) *ReferenceUpdateRequest { - r := NewReferenceUpdateRequest() - - if adv.Supports(capability.Agent) { - r.Capabilities.Set(capability.Agent, capability.DefaultAgent()) - } - - if adv.Supports(capability.ReportStatus) { - r.Capabilities.Set(capability.ReportStatus) - } - - return r -} - -func (req *ReferenceUpdateRequest) validate() error { - if len(req.Commands) == 0 { - return ErrEmptyCommands - } - - for _, c := range req.Commands { - if err := c.validate(); err != nil { - return err - } - } - - return nil -} - -type Action string - -const ( - Create Action = "create" - Update Action = "update" - Delete Action = "delete" - Invalid Action = "invalid" -) - -type Command struct { - Name plumbing.ReferenceName - Old plumbing.Hash - New plumbing.Hash -} - -func (c *Command) Action() Action { - if c.Old == plumbing.ZeroHash && c.New == plumbing.ZeroHash { - return Invalid - } - - if c.Old == plumbing.ZeroHash { - return Create - } - - if c.New == plumbing.ZeroHash { - return Delete - } - - return Update -} - -func (c *Command) validate() error { - if c.Action() == Invalid { - return ErrMalformedCommand - } - - return nil -} - -type Option struct { - Key string - Value string -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_decode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_decode.go deleted file mode 100644 index 076de545f8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_decode.go +++ /dev/null @@ -1,249 +0,0 @@ -package packp - -import ( - "bytes" - "encoding/hex" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" -) - -var ( - shallowLineLength = len(shallow) + hashSize - minCommandLength = hashSize*2 + 2 + 1 - minCommandAndCapsLength = minCommandLength + 1 -) - -var ( - ErrEmpty = errors.New("empty update-request message") - errNoCommands = errors.New("unexpected EOF before any command") - errMissingCapabilitiesDelimiter = errors.New("capabilities delimiter not found") -) - -func errMalformedRequest(reason string) error { - return fmt.Errorf("malformed request: %s", reason) -} - -func errInvalidHashSize(got int) error { - return fmt.Errorf("invalid hash size: expected %d, got %d", - hashSize, got) -} - -func errInvalidHash(err error) error { - return fmt.Errorf("invalid hash: %s", err.Error()) -} - -func errInvalidShallowLineLength(got int) error { - return errMalformedRequest(fmt.Sprintf( - "invalid shallow line length: expected %d, got %d", - shallowLineLength, got)) -} - -func errInvalidCommandCapabilitiesLineLength(got int) error { - return errMalformedRequest(fmt.Sprintf( - "invalid command and capabilities line length: expected at least %d, got %d", - minCommandAndCapsLength, got)) -} - -func errInvalidCommandLineLength(got int) error { - return errMalformedRequest(fmt.Sprintf( - "invalid command line length: expected at least %d, got %d", - minCommandLength, got)) -} - -func errInvalidShallowObjId(err error) error { - return errMalformedRequest( - fmt.Sprintf("invalid shallow object id: %s", err.Error())) -} - -func errInvalidOldObjId(err error) error { - return errMalformedRequest( - fmt.Sprintf("invalid old object id: %s", err.Error())) -} - -func errInvalidNewObjId(err error) error { - return errMalformedRequest( - fmt.Sprintf("invalid new object id: %s", err.Error())) -} - -func errMalformedCommand(err error) error { - return errMalformedRequest(fmt.Sprintf( - "malformed command: %s", err.Error())) -} - -// Decode reads the next update-request message form the reader and wr -func (req *ReferenceUpdateRequest) Decode(r io.Reader) error { - var rc io.ReadCloser - var ok bool - rc, ok = r.(io.ReadCloser) - if !ok { - rc = io.NopCloser(r) - } - - d := &updReqDecoder{r: rc, s: pktline.NewScanner(r)} - return d.Decode(req) -} - -type updReqDecoder struct { - r io.ReadCloser - s *pktline.Scanner - req *ReferenceUpdateRequest -} - -func (d *updReqDecoder) Decode(req *ReferenceUpdateRequest) error { - d.req = req - funcs := []func() error{ - d.scanLine, - d.decodeShallow, - d.decodeCommandAndCapabilities, - d.decodeCommands, - d.setPackfile, - req.validate, - } - - for _, f := range funcs { - if err := f(); err != nil { - return err - } - } - - return nil -} - -func (d *updReqDecoder) scanLine() error { - if ok := d.s.Scan(); !ok { - return d.scanErrorOr(ErrEmpty) - } - - return nil -} - -func (d *updReqDecoder) decodeShallow() error { - b := d.s.Bytes() - - if !bytes.HasPrefix(b, shallowNoSp) { - return nil - } - - if len(b) != shallowLineLength { - return errInvalidShallowLineLength(len(b)) - } - - h, err := parseHash(string(b[len(shallow):])) - if err != nil { - return errInvalidShallowObjId(err) - } - - if ok := d.s.Scan(); !ok { - return d.scanErrorOr(errNoCommands) - } - - d.req.Shallow = &h - - return nil -} - -func (d *updReqDecoder) decodeCommands() error { - for { - b := d.s.Bytes() - if bytes.Equal(b, pktline.Flush) { - return nil - } - - c, err := parseCommand(b) - if err != nil { - return err - } - - d.req.Commands = append(d.req.Commands, c) - - if ok := d.s.Scan(); !ok { - return d.s.Err() - } - } -} - -func (d *updReqDecoder) decodeCommandAndCapabilities() error { - b := d.s.Bytes() - i := bytes.IndexByte(b, 0) - if i == -1 { - return errMissingCapabilitiesDelimiter - } - - if len(b) < minCommandAndCapsLength { - return errInvalidCommandCapabilitiesLineLength(len(b)) - } - - cmd, err := parseCommand(b[:i]) - if err != nil { - return err - } - - d.req.Commands = append(d.req.Commands, cmd) - - if err := d.req.Capabilities.Decode(b[i+1:]); err != nil { - return err - } - - if err := d.scanLine(); err != nil { - return err - } - - return nil -} - -func (d *updReqDecoder) setPackfile() error { - d.req.Packfile = d.r - - return nil -} - -func parseCommand(b []byte) (*Command, error) { - if len(b) < minCommandLength { - return nil, errInvalidCommandLineLength(len(b)) - } - - var ( - os, ns string - n plumbing.ReferenceName - ) - if _, err := fmt.Sscanf(string(b), "%s %s %s", &os, &ns, &n); err != nil { - return nil, errMalformedCommand(err) - } - - oh, err := parseHash(os) - if err != nil { - return nil, errInvalidOldObjId(err) - } - - nh, err := parseHash(ns) - if err != nil { - return nil, errInvalidNewObjId(err) - } - - return &Command{Old: oh, New: nh, Name: n}, nil -} - -func parseHash(s string) (plumbing.Hash, error) { - if len(s) != hashSize { - return plumbing.ZeroHash, errInvalidHashSize(len(s)) - } - - if _, err := hex.DecodeString(s); err != nil { - return plumbing.ZeroHash, errInvalidHash(err) - } - - h := plumbing.NewHash(s) - return h, nil -} - -func (d *updReqDecoder) scanErrorOr(origErr error) error { - if err := d.s.Err(); err != nil { - return err - } - - return origErr -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_encode.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_encode.go deleted file mode 100644 index 1205cfaf18..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/updreq_encode.go +++ /dev/null @@ -1,89 +0,0 @@ -package packp - -import ( - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" -) - -// Encode writes the ReferenceUpdateRequest encoding to the stream. -func (req *ReferenceUpdateRequest) Encode(w io.Writer) error { - if err := req.validate(); err != nil { - return err - } - - e := pktline.NewEncoder(w) - - if err := req.encodeShallow(e, req.Shallow); err != nil { - return err - } - - if err := req.encodeCommands(e, req.Commands, req.Capabilities); err != nil { - return err - } - - if req.Capabilities.Supports(capability.PushOptions) { - if err := req.encodeOptions(e, req.Options); err != nil { - return err - } - } - - if req.Packfile != nil { - if _, err := io.Copy(w, req.Packfile); err != nil { - return err - } - - return req.Packfile.Close() - } - - return nil -} - -func (req *ReferenceUpdateRequest) encodeShallow(e *pktline.Encoder, - h *plumbing.Hash) error { - - if h == nil { - return nil - } - - objId := []byte(h.String()) - return e.Encodef("%s%s", shallow, objId) -} - -func (req *ReferenceUpdateRequest) encodeCommands(e *pktline.Encoder, - cmds []*Command, cap *capability.List) error { - - if err := e.Encodef("%s\x00%s", - formatCommand(cmds[0]), cap.String()); err != nil { - return err - } - - for _, cmd := range cmds[1:] { - if err := e.Encodef(formatCommand(cmd)); err != nil { - return err - } - } - - return e.Flush() -} - -func formatCommand(cmd *Command) string { - o := cmd.Old.String() - n := cmd.New.String() - return fmt.Sprintf("%s %s %s", o, n, cmd.Name) -} - -func (req *ReferenceUpdateRequest) encodeOptions(e *pktline.Encoder, - opts []*Option) error { - - for _, opt := range opts { - if err := e.Encodef("%s=%s", opt.Key, opt.Value); err != nil { - return err - } - } - - return e.Flush() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackreq.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackreq.go deleted file mode 100644 index 48f4438564..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackreq.go +++ /dev/null @@ -1,98 +0,0 @@ -package packp - -import ( - "bytes" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" -) - -// UploadPackRequest represents a upload-pack request. -// Zero-value is not safe, use NewUploadPackRequest instead. -type UploadPackRequest struct { - UploadRequest - UploadHaves -} - -// NewUploadPackRequest creates a new UploadPackRequest and returns a pointer. -func NewUploadPackRequest() *UploadPackRequest { - ur := NewUploadRequest() - return &UploadPackRequest{ - UploadHaves: UploadHaves{}, - UploadRequest: *ur, - } -} - -// NewUploadPackRequestFromCapabilities creates a new UploadPackRequest and -// returns a pointer. The request capabilities are filled with the most optimal -// ones, based on the adv value (advertised capabilities), the UploadPackRequest -// it has no wants, haves or shallows and an infinite depth -func NewUploadPackRequestFromCapabilities(adv *capability.List) *UploadPackRequest { - ur := NewUploadRequestFromCapabilities(adv) - return &UploadPackRequest{ - UploadHaves: UploadHaves{}, - UploadRequest: *ur, - } -} - -// IsEmpty returns whether a request is empty - it is empty if Haves are contained -// in the Wants, or if Wants length is zero, and we don't have any shallows -func (r *UploadPackRequest) IsEmpty() bool { - return isSubset(r.Wants, r.Haves) && len(r.Shallows) == 0 -} - -func isSubset(needle []plumbing.Hash, haystack []plumbing.Hash) bool { - for _, h := range needle { - found := false - for _, oh := range haystack { - if h == oh { - found = true - break - } - } - - if !found { - return false - } - } - - return true -} - -// UploadHaves is a message to signal the references that a client has in a -// upload-pack. Do not use this directly. Use UploadPackRequest request instead. -type UploadHaves struct { - Haves []plumbing.Hash -} - -// Encode encodes the UploadHaves into the Writer. If flush is true, a flush -// command will be encoded at the end of the writer content. -func (u *UploadHaves) Encode(w io.Writer, flush bool) error { - e := pktline.NewEncoder(w) - - plumbing.HashesSort(u.Haves) - - var last plumbing.Hash - for _, have := range u.Haves { - if bytes.Equal(last[:], have[:]) { - continue - } - - if err := e.Encodef("have %s\n", have); err != nil { - return fmt.Errorf("sending haves for %q: %s", have, err) - } - - last = have - } - - if flush && len(u.Haves) != 0 { - if err := e.Flush(); err != nil { - return fmt.Errorf("sending flush-pkt after haves: %s", err) - } - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackresp.go b/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackresp.go deleted file mode 100644 index a485cb7b26..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/protocol/packp/uppackresp.go +++ /dev/null @@ -1,108 +0,0 @@ -package packp - -import ( - "errors" - "io" - - "bufio" - - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// ErrUploadPackResponseNotDecoded is returned if Read is called without -// decoding first -var ErrUploadPackResponseNotDecoded = errors.New("upload-pack-response should be decoded") - -// UploadPackResponse contains all the information responded by the upload-pack -// service, the response implements io.ReadCloser that allows to read the -// packfile directly from it. -type UploadPackResponse struct { - ShallowUpdate - ServerResponse - - r io.ReadCloser - isShallow bool - isMultiACK bool -} - -// NewUploadPackResponse create a new UploadPackResponse instance, the request -// being responded by the response is required. -func NewUploadPackResponse(req *UploadPackRequest) *UploadPackResponse { - isShallow := !req.Depth.IsZero() - isMultiACK := req.Capabilities.Supports(capability.MultiACK) || - req.Capabilities.Supports(capability.MultiACKDetailed) - - return &UploadPackResponse{ - isShallow: isShallow, - isMultiACK: isMultiACK, - } -} - -// NewUploadPackResponseWithPackfile creates a new UploadPackResponse instance, -// and sets its packfile reader. -func NewUploadPackResponseWithPackfile(req *UploadPackRequest, - pf io.ReadCloser) *UploadPackResponse { - - r := NewUploadPackResponse(req) - r.r = pf - return r -} - -// Decode decodes all the responses sent by upload-pack service into the struct -// and prepares it to read the packfile using the Read method -func (r *UploadPackResponse) Decode(reader io.ReadCloser) error { - buf := bufio.NewReader(reader) - - if r.isShallow { - if err := r.ShallowUpdate.Decode(buf); err != nil { - return err - } - } - - if err := r.ServerResponse.Decode(buf, r.isMultiACK); err != nil { - return err - } - - // now the reader is ready to read the packfile content - r.r = ioutil.NewReadCloser(buf, reader) - - return nil -} - -// Encode encodes an UploadPackResponse. -func (r *UploadPackResponse) Encode(w io.Writer) (err error) { - if r.isShallow { - if err := r.ShallowUpdate.Encode(w); err != nil { - return err - } - } - - if err := r.ServerResponse.Encode(w, r.isMultiACK); err != nil { - return err - } - - defer ioutil.CheckClose(r.r, &err) - _, err = io.Copy(w, r.r) - return err -} - -// Read reads the packfile data, if the request was done with any Sideband -// capability the content read should be demultiplexed. If the methods wasn't -// called before the ErrUploadPackResponseNotDecoded will be return -func (r *UploadPackResponse) Read(p []byte) (int, error) { - if r.r == nil { - return 0, ErrUploadPackResponseNotDecoded - } - - return r.r.Read(p) -} - -// Close the underlying reader, if any -func (r *UploadPackResponse) Close() error { - if r.r == nil { - return nil - } - - return r.r.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/reference.go b/vendor/github.com/go-git/go-git/v5/plumbing/reference.go deleted file mode 100644 index ddba930292..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/reference.go +++ /dev/null @@ -1,315 +0,0 @@ -package plumbing - -import ( - "errors" - "fmt" - "regexp" - "strings" -) - -const ( - refPrefix = "refs/" - refHeadPrefix = refPrefix + "heads/" - refTagPrefix = refPrefix + "tags/" - refRemotePrefix = refPrefix + "remotes/" - refNotePrefix = refPrefix + "notes/" - symrefPrefix = "ref: " -) - -// RefRevParseRules are a set of rules to parse references into short names, or expand into a full reference. -// These are the same rules as used by git in shorten_unambiguous_ref and expand_ref. -// See: https://github.com/git/git/blob/e0aaa1b6532cfce93d87af9bc813fb2e7a7ce9d7/refs.c#L417 -var RefRevParseRules = []string{ - "%s", - "refs/%s", - "refs/tags/%s", - "refs/heads/%s", - "refs/remotes/%s", - "refs/remotes/%s/HEAD", -} - -var ( - ErrReferenceNotFound = errors.New("reference not found") - - // ErrInvalidReferenceName is returned when a reference name is invalid. - ErrInvalidReferenceName = errors.New("invalid reference name") -) - -// ReferenceType reference type's -type ReferenceType int8 - -const ( - InvalidReference ReferenceType = 0 - HashReference ReferenceType = 1 - SymbolicReference ReferenceType = 2 -) - -func (r ReferenceType) String() string { - switch r { - case InvalidReference: - return "invalid-reference" - case HashReference: - return "hash-reference" - case SymbolicReference: - return "symbolic-reference" - } - - return "" -} - -// ReferenceName reference name's -type ReferenceName string - -// NewBranchReferenceName returns a reference name describing a branch based on -// his short name. -func NewBranchReferenceName(name string) ReferenceName { - return ReferenceName(refHeadPrefix + name) -} - -// NewNoteReferenceName returns a reference name describing a note based on his -// short name. -func NewNoteReferenceName(name string) ReferenceName { - return ReferenceName(refNotePrefix + name) -} - -// NewRemoteReferenceName returns a reference name describing a remote branch -// based on his short name and the remote name. -func NewRemoteReferenceName(remote, name string) ReferenceName { - return ReferenceName(refRemotePrefix + fmt.Sprintf("%s/%s", remote, name)) -} - -// NewRemoteHEADReferenceName returns a reference name describing a the HEAD -// branch of a remote. -func NewRemoteHEADReferenceName(remote string) ReferenceName { - return ReferenceName(refRemotePrefix + fmt.Sprintf("%s/%s", remote, HEAD)) -} - -// NewTagReferenceName returns a reference name describing a tag based on short -// his name. -func NewTagReferenceName(name string) ReferenceName { - return ReferenceName(refTagPrefix + name) -} - -// IsBranch check if a reference is a branch -func (r ReferenceName) IsBranch() bool { - return strings.HasPrefix(string(r), refHeadPrefix) -} - -// IsNote check if a reference is a note -func (r ReferenceName) IsNote() bool { - return strings.HasPrefix(string(r), refNotePrefix) -} - -// IsRemote check if a reference is a remote -func (r ReferenceName) IsRemote() bool { - return strings.HasPrefix(string(r), refRemotePrefix) -} - -// IsTag check if a reference is a tag -func (r ReferenceName) IsTag() bool { - return strings.HasPrefix(string(r), refTagPrefix) -} - -func (r ReferenceName) String() string { - return string(r) -} - -// Short returns the short name of a ReferenceName -func (r ReferenceName) Short() string { - s := string(r) - res := s - for _, format := range RefRevParseRules[1:] { - _, err := fmt.Sscanf(s, format, &res) - if err == nil { - continue - } - } - - return res -} - -var ( - ctrlSeqs = regexp.MustCompile(`[\000-\037\177]`) -) - -// Validate validates a reference name. -// This follows the git-check-ref-format rules. -// See https://git-scm.com/docs/git-check-ref-format -// -// It is important to note that this function does not check if the reference -// exists in the repository. -// It only checks if the reference name is valid. -// This functions does not support the --refspec-pattern, --normalize, and -// --allow-onelevel options. -// -// Git imposes the following rules on how references are named: -// -// 1. They can include slash / for hierarchical (directory) grouping, but no -// slash-separated component can begin with a dot . or end with the -// sequence .lock. -// 2. They must contain at least one /. This enforces the presence of a -// category like heads/, tags/ etc. but the actual names are not -// restricted. If the --allow-onelevel option is used, this rule is -// waived. -// 3. They cannot have two consecutive dots .. anywhere. -// 4. They cannot have ASCII control characters (i.e. bytes whose values are -// lower than \040, or \177 DEL), space, tilde ~, caret ^, or colon : -// anywhere. -// 5. They cannot have question-mark ?, asterisk *, or open bracket [ -// anywhere. See the --refspec-pattern option below for an exception to this -// rule. -// 6. They cannot begin or end with a slash / or contain multiple consecutive -// slashes (see the --normalize option below for an exception to this rule). -// 7. They cannot end with a dot .. -// 8. They cannot contain a sequence @{. -// 9. They cannot be the single character @. -// 10. They cannot contain a \. -func (r ReferenceName) Validate() error { - s := string(r) - if len(s) == 0 { - return ErrInvalidReferenceName - } - - // HEAD is a special case - if r == HEAD { - return nil - } - - // rule 7 - if strings.HasSuffix(s, ".") { - return ErrInvalidReferenceName - } - - // rule 2 - parts := strings.Split(s, "/") - if len(parts) < 2 { - return ErrInvalidReferenceName - } - - isBranch := r.IsBranch() - isTag := r.IsTag() - for _, part := range parts { - // rule 6 - if len(part) == 0 { - return ErrInvalidReferenceName - } - - if strings.HasPrefix(part, ".") || // rule 1 - strings.Contains(part, "..") || // rule 3 - ctrlSeqs.MatchString(part) || // rule 4 - strings.ContainsAny(part, "~^:?*[ \t\n") || // rule 4 & 5 - strings.Contains(part, "@{") || // rule 8 - part == "@" || // rule 9 - strings.Contains(part, "\\") || // rule 10 - strings.HasSuffix(part, ".lock") { // rule 1 - return ErrInvalidReferenceName - } - - if (isBranch || isTag) && strings.HasPrefix(part, "-") { // branches & tags can't start with - - return ErrInvalidReferenceName - } - } - - return nil -} - -const ( - HEAD ReferenceName = "HEAD" - Master ReferenceName = "refs/heads/master" - Main ReferenceName = "refs/heads/main" -) - -// Reference is a representation of git reference -type Reference struct { - t ReferenceType - n ReferenceName - h Hash - target ReferenceName -} - -// NewReferenceFromStrings creates a reference from name and target as string, -// the resulting reference can be a SymbolicReference or a HashReference base -// on the target provided -func NewReferenceFromStrings(name, target string) *Reference { - n := ReferenceName(name) - - if strings.HasPrefix(target, symrefPrefix) { - target := ReferenceName(target[len(symrefPrefix):]) - return NewSymbolicReference(n, target) - } - - return NewHashReference(n, NewHash(target)) -} - -// NewSymbolicReference creates a new SymbolicReference reference -func NewSymbolicReference(n, target ReferenceName) *Reference { - return &Reference{ - t: SymbolicReference, - n: n, - target: target, - } -} - -// NewHashReference creates a new HashReference reference -func NewHashReference(n ReferenceName, h Hash) *Reference { - return &Reference{ - t: HashReference, - n: n, - h: h, - } -} - -// Type returns the type of a reference -func (r *Reference) Type() ReferenceType { - return r.t -} - -// Name returns the name of a reference -func (r *Reference) Name() ReferenceName { - return r.n -} - -// Hash returns the hash of a hash reference -func (r *Reference) Hash() Hash { - return r.h -} - -// Target returns the target of a symbolic reference -func (r *Reference) Target() ReferenceName { - return r.target -} - -// Strings dump a reference as a [2]string -func (r *Reference) Strings() [2]string { - var o [2]string - o[0] = r.Name().String() - - switch r.Type() { - case HashReference: - o[1] = r.Hash().String() - case SymbolicReference: - o[1] = symrefPrefix + r.Target().String() - } - - return o -} - -func (r *Reference) String() string { - ref := "" - switch r.Type() { - case HashReference: - ref = r.Hash().String() - case SymbolicReference: - ref = symrefPrefix + r.Target().String() - default: - return "" - } - - name := r.Name().String() - var v strings.Builder - v.Grow(len(ref) + len(name) + 1) - v.WriteString(ref) - v.WriteString(" ") - v.WriteString(name) - return v.String() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/revision.go b/vendor/github.com/go-git/go-git/v5/plumbing/revision.go deleted file mode 100644 index 5f053b200c..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/revision.go +++ /dev/null @@ -1,11 +0,0 @@ -package plumbing - -// Revision represents a git revision -// to get more details about git revisions -// please check git manual page : -// https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html -type Revision string - -func (r Revision) String() string { - return string(r) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/revlist/revlist.go b/vendor/github.com/go-git/go-git/v5/plumbing/revlist/revlist.go deleted file mode 100644 index b9109870f0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/revlist/revlist.go +++ /dev/null @@ -1,230 +0,0 @@ -// Package revlist provides support to access the ancestors of commits, in a -// similar way as the git-rev-list command. -package revlist - -import ( - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -// Objects applies a complementary set. It gets all the hashes from all -// the reachable objects from the given objects. Ignore param are object hashes -// that we want to ignore on the result. All that objects must be accessible -// from the object storer. -func Objects( - s storer.EncodedObjectStorer, - objs, - ignore []plumbing.Hash, -) ([]plumbing.Hash, error) { - return ObjectsWithStorageForIgnores(s, s, objs, ignore) -} - -// ObjectsWithStorageForIgnores is the same as Objects, but a -// secondary storage layer can be provided, to be used to finding the -// full set of objects to be ignored while finding the reachable -// objects. This is useful when the main `s` storage layer is slow -// and/or remote, while the ignore list is available somewhere local. -func ObjectsWithStorageForIgnores( - s, ignoreStore storer.EncodedObjectStorer, - objs, - ignore []plumbing.Hash, -) ([]plumbing.Hash, error) { - ignore, err := objects(ignoreStore, ignore, nil, true) - if err != nil { - return nil, err - } - - return objects(s, objs, ignore, false) -} - -func objects( - s storer.EncodedObjectStorer, - objects, - ignore []plumbing.Hash, - allowMissingObjects bool, -) ([]plumbing.Hash, error) { - seen := hashListToSet(ignore) - result := make(map[plumbing.Hash]bool) - visited := make(map[plumbing.Hash]bool) - - walkerFunc := func(h plumbing.Hash) { - if !seen[h] { - result[h] = true - seen[h] = true - } - } - - for _, h := range objects { - if err := processObject(s, h, seen, visited, ignore, walkerFunc); err != nil { - if allowMissingObjects && err == plumbing.ErrObjectNotFound { - continue - } - - return nil, err - } - } - - return hashSetToList(result), nil -} - -// processObject obtains the object using the hash an process it depending of its type -func processObject( - s storer.EncodedObjectStorer, - h plumbing.Hash, - seen map[plumbing.Hash]bool, - visited map[plumbing.Hash]bool, - ignore []plumbing.Hash, - walkerFunc func(h plumbing.Hash), -) error { - if seen[h] { - return nil - } - - o, err := s.EncodedObject(plumbing.AnyObject, h) - if err != nil { - return err - } - - do, err := object.DecodeObject(s, o) - if err != nil { - return err - } - - switch do := do.(type) { - case *object.Commit: - return reachableObjects(do, seen, visited, ignore, walkerFunc) - case *object.Tree: - return iterateCommitTrees(seen, do, walkerFunc) - case *object.Tag: - walkerFunc(do.Hash) - return processObject(s, do.Target, seen, visited, ignore, walkerFunc) - case *object.Blob: - walkerFunc(do.Hash) - default: - return fmt.Errorf("object type not valid: %s. "+ - "Object reference: %s", o.Type(), o.Hash()) - } - - return nil -} - -// reachableObjects returns, using the callback function, all the reachable -// objects from the specified commit. To avoid to iterate over seen commits, -// if a commit hash is into the 'seen' set, we will not iterate all his trees -// and blobs objects. -func reachableObjects( - commit *object.Commit, - seen map[plumbing.Hash]bool, - visited map[plumbing.Hash]bool, - ignore []plumbing.Hash, - cb func(h plumbing.Hash), -) error { - i := object.NewCommitPreorderIter(commit, seen, ignore) - pending := make(map[plumbing.Hash]bool) - addPendingParents(pending, visited, commit) - for { - commit, err := i.Next() - if err == io.EOF { - break - } - - if err != nil { - return err - } - - if pending[commit.Hash] { - delete(pending, commit.Hash) - } - - addPendingParents(pending, visited, commit) - - if visited[commit.Hash] && len(pending) == 0 { - break - } - - if seen[commit.Hash] { - continue - } - - cb(commit.Hash) - - tree, err := commit.Tree() - if err != nil { - return err - } - - if err := iterateCommitTrees(seen, tree, cb); err != nil { - return err - } - } - - return nil -} - -func addPendingParents(pending, visited map[plumbing.Hash]bool, commit *object.Commit) { - for _, p := range commit.ParentHashes { - if !visited[p] { - pending[p] = true - } - } -} - -// iterateCommitTrees iterate all reachable trees from the given commit -func iterateCommitTrees( - seen map[plumbing.Hash]bool, - tree *object.Tree, - cb func(h plumbing.Hash), -) error { - if seen[tree.Hash] { - return nil - } - - cb(tree.Hash) - - treeWalker := object.NewTreeWalker(tree, true, seen) - - for { - _, e, err := treeWalker.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - if e.Mode == filemode.Submodule { - continue - } - - if seen[e.Hash] { - continue - } - - cb(e.Hash) - } - - return nil -} - -func hashSetToList(hashes map[plumbing.Hash]bool) []plumbing.Hash { - var result []plumbing.Hash - for key := range hashes { - result = append(result, key) - } - - return result -} - -func hashListToSet(hashes []plumbing.Hash) map[plumbing.Hash]bool { - result := make(map[plumbing.Hash]bool) - for _, h := range hashes { - result[h] = true - } - - return result -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/doc.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/doc.go deleted file mode 100644 index 4d4f179c61..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package storer defines the interfaces to store objects, references, etc. -package storer diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/index.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/index.go deleted file mode 100644 index 33113949b3..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/index.go +++ /dev/null @@ -1,9 +0,0 @@ -package storer - -import "github.com/go-git/go-git/v5/plumbing/format/index" - -// IndexStorer generic storage of index.Index -type IndexStorer interface { - SetIndex(*index.Index) error - Index() (*index.Index, error) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/object.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/object.go deleted file mode 100644 index 126b3742d8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/object.go +++ /dev/null @@ -1,289 +0,0 @@ -package storer - -import ( - "errors" - "io" - "time" - - "github.com/go-git/go-git/v5/plumbing" -) - -var ( - //ErrStop is used to stop a ForEach function in an Iter - ErrStop = errors.New("stop iter") -) - -// EncodedObjectStorer generic storage of objects -type EncodedObjectStorer interface { - // NewEncodedObject returns a new plumbing.EncodedObject, the real type - // of the object can be a custom implementation or the default one, - // plumbing.MemoryObject. - NewEncodedObject() plumbing.EncodedObject - // SetEncodedObject saves an object into the storage, the object should - // be create with the NewEncodedObject, method, and file if the type is - // not supported. - SetEncodedObject(plumbing.EncodedObject) (plumbing.Hash, error) - // EncodedObject gets an object by hash with the given - // plumbing.ObjectType. Implementors should return - // (nil, plumbing.ErrObjectNotFound) if an object doesn't exist with - // both the given hash and object type. - // - // Valid plumbing.ObjectType values are CommitObject, BlobObject, TagObject, - // TreeObject and AnyObject. If plumbing.AnyObject is given, the object must - // be looked up regardless of its type. - EncodedObject(plumbing.ObjectType, plumbing.Hash) (plumbing.EncodedObject, error) - // IterObjects returns a custom EncodedObjectStorer over all the object - // on the storage. - // - // Valid plumbing.ObjectType values are CommitObject, BlobObject, TagObject, - IterEncodedObjects(plumbing.ObjectType) (EncodedObjectIter, error) - // HasEncodedObject returns ErrObjNotFound if the object doesn't - // exist. If the object does exist, it returns nil. - HasEncodedObject(plumbing.Hash) error - // EncodedObjectSize returns the plaintext size of the encoded object. - EncodedObjectSize(plumbing.Hash) (int64, error) - AddAlternate(remote string) error -} - -// DeltaObjectStorer is an EncodedObjectStorer that can return delta -// objects. -type DeltaObjectStorer interface { - // DeltaObject is the same as EncodedObject but without resolving deltas. - // Deltas will be returned as plumbing.DeltaObject instances. - DeltaObject(plumbing.ObjectType, plumbing.Hash) (plumbing.EncodedObject, error) -} - -// Transactioner is a optional method for ObjectStorer, it enables transactional read and write -// operations. -type Transactioner interface { - // Begin starts a transaction. - Begin() Transaction -} - -// LooseObjectStorer is an optional interface for managing "loose" -// objects, i.e. those not in packfiles. -type LooseObjectStorer interface { - // ForEachObjectHash iterates over all the (loose) object hashes - // in the repository without necessarily having to read those objects. - // Objects only inside pack files may be omitted. - // If ErrStop is sent the iteration is stop but no error is returned. - ForEachObjectHash(func(plumbing.Hash) error) error - // LooseObjectTime looks up the (m)time associated with the - // loose object (that is not in a pack file). Some - // implementations (e.g. without loose objects) - // always return an error. - LooseObjectTime(plumbing.Hash) (time.Time, error) - // DeleteLooseObject deletes a loose object if it exists. - DeleteLooseObject(plumbing.Hash) error -} - -// PackedObjectStorer is an optional interface for managing objects in -// packfiles. -type PackedObjectStorer interface { - // ObjectPacks returns hashes of object packs if the underlying - // implementation has pack files. - ObjectPacks() ([]plumbing.Hash, error) - // DeleteOldObjectPackAndIndex deletes an object pack and the corresponding index file if they exist. - // Deletion is only performed if the pack is older than the supplied time (or the time is zero). - DeleteOldObjectPackAndIndex(plumbing.Hash, time.Time) error -} - -// PackfileWriter is an optional method for ObjectStorer, it enables directly writing -// a packfile to storage. -type PackfileWriter interface { - // PackfileWriter returns a writer for writing a packfile to the storage - // - // If the Storer not implements PackfileWriter the objects should be written - // using the Set method. - PackfileWriter() (io.WriteCloser, error) -} - -// EncodedObjectIter is a generic closable interface for iterating over objects. -type EncodedObjectIter interface { - Next() (plumbing.EncodedObject, error) - ForEach(func(plumbing.EncodedObject) error) error - Close() -} - -// Transaction is an in-progress storage transaction. A transaction must end -// with a call to Commit or Rollback. -type Transaction interface { - SetEncodedObject(plumbing.EncodedObject) (plumbing.Hash, error) - EncodedObject(plumbing.ObjectType, plumbing.Hash) (plumbing.EncodedObject, error) - Commit() error - Rollback() error -} - -// EncodedObjectLookupIter implements EncodedObjectIter. It iterates over a -// series of object hashes and yields their associated objects by retrieving -// each one from object storage. The retrievals are lazy and only occur when the -// iterator moves forward with a call to Next(). -// -// The EncodedObjectLookupIter must be closed with a call to Close() when it is -// no longer needed. -type EncodedObjectLookupIter struct { - storage EncodedObjectStorer - series []plumbing.Hash - t plumbing.ObjectType - pos int -} - -// NewEncodedObjectLookupIter returns an object iterator given an object storage -// and a slice of object hashes. -func NewEncodedObjectLookupIter( - storage EncodedObjectStorer, t plumbing.ObjectType, series []plumbing.Hash) *EncodedObjectLookupIter { - return &EncodedObjectLookupIter{ - storage: storage, - series: series, - t: t, - } -} - -// Next returns the next object from the iterator. If the iterator has reached -// the end it will return io.EOF as an error. If the object can't be found in -// the object storage, it will return plumbing.ErrObjectNotFound as an error. -// If the object is retrieved successfully error will be nil. -func (iter *EncodedObjectLookupIter) Next() (plumbing.EncodedObject, error) { - if iter.pos >= len(iter.series) { - return nil, io.EOF - } - - hash := iter.series[iter.pos] - obj, err := iter.storage.EncodedObject(iter.t, hash) - if err == nil { - iter.pos++ - } - - return obj, err -} - -// ForEach call the cb function for each object contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *EncodedObjectLookupIter) ForEach(cb func(plumbing.EncodedObject) error) error { - return ForEachIterator(iter, cb) -} - -// Close releases any resources used by the iterator. -func (iter *EncodedObjectLookupIter) Close() { - iter.pos = len(iter.series) -} - -// EncodedObjectSliceIter implements EncodedObjectIter. It iterates over a -// series of objects stored in a slice and yields each one in turn when Next() -// is called. -// -// The EncodedObjectSliceIter must be closed with a call to Close() when it is -// no longer needed. -type EncodedObjectSliceIter struct { - series []plumbing.EncodedObject -} - -// NewEncodedObjectSliceIter returns an object iterator for the given slice of -// objects. -func NewEncodedObjectSliceIter(series []plumbing.EncodedObject) *EncodedObjectSliceIter { - return &EncodedObjectSliceIter{ - series: series, - } -} - -// Next returns the next object from the iterator. If the iterator has reached -// the end it will return io.EOF as an error. If the object is retrieved -// successfully error will be nil. -func (iter *EncodedObjectSliceIter) Next() (plumbing.EncodedObject, error) { - if len(iter.series) == 0 { - return nil, io.EOF - } - - obj := iter.series[0] - iter.series = iter.series[1:] - - return obj, nil -} - -// ForEach call the cb function for each object contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *EncodedObjectSliceIter) ForEach(cb func(plumbing.EncodedObject) error) error { - return ForEachIterator(iter, cb) -} - -// Close releases any resources used by the iterator. -func (iter *EncodedObjectSliceIter) Close() { - iter.series = []plumbing.EncodedObject{} -} - -// MultiEncodedObjectIter implements EncodedObjectIter. It iterates over several -// EncodedObjectIter, -// -// The MultiObjectIter must be closed with a call to Close() when it is no -// longer needed. -type MultiEncodedObjectIter struct { - iters []EncodedObjectIter -} - -// NewMultiEncodedObjectIter returns an object iterator for the given slice of -// EncodedObjectIters. -func NewMultiEncodedObjectIter(iters []EncodedObjectIter) EncodedObjectIter { - return &MultiEncodedObjectIter{iters: iters} -} - -// Next returns the next object from the iterator, if one iterator reach io.EOF -// is removed and the next one is used. -func (iter *MultiEncodedObjectIter) Next() (plumbing.EncodedObject, error) { - if len(iter.iters) == 0 { - return nil, io.EOF - } - - obj, err := iter.iters[0].Next() - if err == io.EOF { - iter.iters[0].Close() - iter.iters = iter.iters[1:] - return iter.Next() - } - - return obj, err -} - -// ForEach call the cb function for each object contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *MultiEncodedObjectIter) ForEach(cb func(plumbing.EncodedObject) error) error { - return ForEachIterator(iter, cb) -} - -// Close releases any resources used by the iterator. -func (iter *MultiEncodedObjectIter) Close() { - for _, i := range iter.iters { - i.Close() - } -} - -type bareIterator interface { - Next() (plumbing.EncodedObject, error) - Close() -} - -// ForEachIterator is a helper function to build iterators without need to -// rewrite the same ForEach function each time. -func ForEachIterator(iter bareIterator, cb func(plumbing.EncodedObject) error) error { - defer iter.Close() - for { - obj, err := iter.Next() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - if err := cb(obj); err != nil { - if err == ErrStop { - return nil - } - - return err - } - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/reference.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/reference.go deleted file mode 100644 index 1d74ef3c6a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/reference.go +++ /dev/null @@ -1,240 +0,0 @@ -package storer - -import ( - "errors" - "io" - - "github.com/go-git/go-git/v5/plumbing" -) - -const MaxResolveRecursion = 1024 - -// ErrMaxResolveRecursion is returned by ResolveReference is MaxResolveRecursion -// is exceeded -var ErrMaxResolveRecursion = errors.New("max. recursion level reached") - -// ReferenceStorer is a generic storage of references. -type ReferenceStorer interface { - SetReference(*plumbing.Reference) error - // CheckAndSetReference sets the reference `new`, but if `old` is - // not `nil`, it first checks that the current stored value for - // `old.Name()` matches the given reference value in `old`. If - // not, it returns an error and doesn't update `new`. - CheckAndSetReference(new, old *plumbing.Reference) error - Reference(plumbing.ReferenceName) (*plumbing.Reference, error) - IterReferences() (ReferenceIter, error) - RemoveReference(plumbing.ReferenceName) error - CountLooseRefs() (int, error) - PackRefs() error -} - -// ReferenceIter is a generic closable interface for iterating over references. -type ReferenceIter interface { - Next() (*plumbing.Reference, error) - ForEach(func(*plumbing.Reference) error) error - Close() -} - -type referenceFilteredIter struct { - ff func(r *plumbing.Reference) bool - iter ReferenceIter -} - -// NewReferenceFilteredIter returns a reference iterator for the given reference -// Iterator. This iterator will iterate only references that accomplish the -// provided function. -func NewReferenceFilteredIter( - ff func(r *plumbing.Reference) bool, iter ReferenceIter) ReferenceIter { - return &referenceFilteredIter{ff, iter} -} - -// Next returns the next reference from the iterator. If the iterator has reached -// the end it will return io.EOF as an error. -func (iter *referenceFilteredIter) Next() (*plumbing.Reference, error) { - for { - r, err := iter.iter.Next() - if err != nil { - return nil, err - } - - if iter.ff(r) { - return r, nil - } - - continue - } -} - -// ForEach call the cb function for each reference contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stopped but no error is returned. The iterator is closed. -func (iter *referenceFilteredIter) ForEach(cb func(*plumbing.Reference) error) error { - defer iter.Close() - for { - r, err := iter.Next() - if err == io.EOF { - break - } - if err != nil { - return err - } - - if err := cb(r); err != nil { - if err == ErrStop { - break - } - - return err - } - } - - return nil -} - -// Close releases any resources used by the iterator. -func (iter *referenceFilteredIter) Close() { - iter.iter.Close() -} - -// ReferenceSliceIter implements ReferenceIter. It iterates over a series of -// references stored in a slice and yields each one in turn when Next() is -// called. -// -// The ReferenceSliceIter must be closed with a call to Close() when it is no -// longer needed. -type ReferenceSliceIter struct { - series []*plumbing.Reference - pos int -} - -// NewReferenceSliceIter returns a reference iterator for the given slice of -// objects. -func NewReferenceSliceIter(series []*plumbing.Reference) ReferenceIter { - return &ReferenceSliceIter{ - series: series, - } -} - -// Next returns the next reference from the iterator. If the iterator has -// reached the end it will return io.EOF as an error. -func (iter *ReferenceSliceIter) Next() (*plumbing.Reference, error) { - if iter.pos >= len(iter.series) { - return nil, io.EOF - } - - obj := iter.series[iter.pos] - iter.pos++ - return obj, nil -} - -// ForEach call the cb function for each reference contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *ReferenceSliceIter) ForEach(cb func(*plumbing.Reference) error) error { - return forEachReferenceIter(iter, cb) -} - -type bareReferenceIterator interface { - Next() (*plumbing.Reference, error) - Close() -} - -func forEachReferenceIter(iter bareReferenceIterator, cb func(*plumbing.Reference) error) error { - defer iter.Close() - for { - obj, err := iter.Next() - if err != nil { - if err == io.EOF { - return nil - } - - return err - } - - if err := cb(obj); err != nil { - if err == ErrStop { - return nil - } - - return err - } - } -} - -// Close releases any resources used by the iterator. -func (iter *ReferenceSliceIter) Close() { - iter.pos = len(iter.series) -} - -// MultiReferenceIter implements ReferenceIter. It iterates over several -// ReferenceIter, -// -// The MultiReferenceIter must be closed with a call to Close() when it is no -// longer needed. -type MultiReferenceIter struct { - iters []ReferenceIter -} - -// NewMultiReferenceIter returns an reference iterator for the given slice of -// EncodedObjectIters. -func NewMultiReferenceIter(iters []ReferenceIter) ReferenceIter { - return &MultiReferenceIter{iters: iters} -} - -// Next returns the next reference from the iterator, if one iterator reach -// io.EOF is removed and the next one is used. -func (iter *MultiReferenceIter) Next() (*plumbing.Reference, error) { - if len(iter.iters) == 0 { - return nil, io.EOF - } - - obj, err := iter.iters[0].Next() - if err == io.EOF { - iter.iters[0].Close() - iter.iters = iter.iters[1:] - return iter.Next() - } - - return obj, err -} - -// ForEach call the cb function for each reference contained on this iter until -// an error happens or the end of the iter is reached. If ErrStop is sent -// the iteration is stop but no error is returned. The iterator is closed. -func (iter *MultiReferenceIter) ForEach(cb func(*plumbing.Reference) error) error { - return forEachReferenceIter(iter, cb) -} - -// Close releases any resources used by the iterator. -func (iter *MultiReferenceIter) Close() { - for _, i := range iter.iters { - i.Close() - } -} - -// ResolveReference resolves a SymbolicReference to a HashReference. -func ResolveReference(s ReferenceStorer, n plumbing.ReferenceName) (*plumbing.Reference, error) { - r, err := s.Reference(n) - if err != nil || r == nil { - return r, err - } - return resolveReference(s, r, 0) -} - -func resolveReference(s ReferenceStorer, r *plumbing.Reference, recursion int) (*plumbing.Reference, error) { - if r.Type() != plumbing.SymbolicReference { - return r, nil - } - - if recursion > MaxResolveRecursion { - return nil, ErrMaxResolveRecursion - } - - t, err := s.Reference(r.Target()) - if err != nil { - return nil, err - } - - recursion++ - return resolveReference(s, t, recursion) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/shallow.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/shallow.go deleted file mode 100644 index 39ef5ea5c6..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/shallow.go +++ /dev/null @@ -1,10 +0,0 @@ -package storer - -import "github.com/go-git/go-git/v5/plumbing" - -// ShallowStorer is a storage of references to shallow commits by hash, -// meaning that these commits have missing parents because of a shallow fetch. -type ShallowStorer interface { - SetShallow([]plumbing.Hash) error - Shallow() ([]plumbing.Hash, error) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/storer/storer.go b/vendor/github.com/go-git/go-git/v5/plumbing/storer/storer.go deleted file mode 100644 index c7bc65a0c4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/storer/storer.go +++ /dev/null @@ -1,15 +0,0 @@ -package storer - -// Storer is a basic storer for encoded objects and references. -type Storer interface { - EncodedObjectStorer - ReferenceStorer -} - -// Initializer should be implemented by storers that require to perform any -// operation when creating a new repository (i.e. git init). -type Initializer interface { - // Init performs initialization of the storer and returns the error, if - // any. - Init() error -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/client/client.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/client/client.go deleted file mode 100644 index 1948c2301a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/client/client.go +++ /dev/null @@ -1,51 +0,0 @@ -// Package client contains helper function to deal with the different client -// protocols. -package client - -import ( - "fmt" - - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/file" - "github.com/go-git/go-git/v5/plumbing/transport/git" - "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/go-git/go-git/v5/plumbing/transport/ssh" -) - -// Protocols are the protocols supported by default. -var Protocols = map[string]transport.Transport{ - "http": http.DefaultClient, - "https": http.DefaultClient, - "ssh": ssh.DefaultClient, - "git": git.DefaultClient, - "file": file.DefaultClient, -} - -// InstallProtocol adds or modifies an existing protocol. -func InstallProtocol(scheme string, c transport.Transport) { - if c == nil { - delete(Protocols, scheme) - return - } - - Protocols[scheme] = c -} - -// NewClient returns the appropriate client among of the set of known protocols: -// http://, https://, ssh:// and file://. -// See `InstallProtocol` to add or modify protocols. -func NewClient(endpoint *transport.Endpoint) (transport.Transport, error) { - return getTransport(endpoint) -} - -func getTransport(endpoint *transport.Endpoint) (transport.Transport, error) { - f, ok := Protocols[endpoint.Protocol] - if !ok { - return nil, fmt.Errorf("unsupported scheme %q", endpoint.Protocol) - } - - if f == nil { - return nil, fmt.Errorf("malformed client for scheme %q, client is defined as nil", endpoint.Protocol) - } - return f, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/common.go deleted file mode 100644 index b05437fbfc..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/common.go +++ /dev/null @@ -1,320 +0,0 @@ -// Package transport includes the implementation for different transport -// protocols. -// -// `Client` can be used to fetch and send packfiles to a git server. -// The `client` package provides higher level functions to instantiate the -// appropriate `Client` based on the repository URL. -// -// go-git supports HTTP and SSH (see `Protocols`), but you can also install -// your own protocols (see the `client` package). -// -// Each protocol has its own implementation of `Client`, but you should -// generally not use them directly, use `client.NewClient` instead. -package transport - -import ( - "bytes" - "context" - "errors" - "fmt" - "io" - "net/url" - "strconv" - "strings" - - giturl "github.com/go-git/go-git/v5/internal/url" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" -) - -var ( - ErrRepositoryNotFound = errors.New("repository not found") - ErrEmptyRemoteRepository = errors.New("remote repository is empty") - ErrAuthenticationRequired = errors.New("authentication required") - ErrAuthorizationFailed = errors.New("authorization failed") - ErrEmptyUploadPackRequest = errors.New("empty git-upload-pack given") - ErrInvalidAuthMethod = errors.New("invalid auth method") - ErrAlreadyConnected = errors.New("session already established") -) - -const ( - UploadPackServiceName = "git-upload-pack" - ReceivePackServiceName = "git-receive-pack" -) - -// Transport can initiate git-upload-pack and git-receive-pack processes. -// It is implemented both by the client and the server, making this a RPC. -type Transport interface { - // NewUploadPackSession starts a git-upload-pack session for an endpoint. - NewUploadPackSession(*Endpoint, AuthMethod) (UploadPackSession, error) - // NewReceivePackSession starts a git-receive-pack session for an endpoint. - NewReceivePackSession(*Endpoint, AuthMethod) (ReceivePackSession, error) -} - -type Session interface { - // AdvertisedReferences retrieves the advertised references for a - // repository. - // If the repository does not exist, returns ErrRepositoryNotFound. - // If the repository exists, but is empty, returns ErrEmptyRemoteRepository. - AdvertisedReferences() (*packp.AdvRefs, error) - // AdvertisedReferencesContext retrieves the advertised references for a - // repository. - // If the repository does not exist, returns ErrRepositoryNotFound. - // If the repository exists, but is empty, returns ErrEmptyRemoteRepository. - AdvertisedReferencesContext(context.Context) (*packp.AdvRefs, error) - io.Closer -} - -type AuthMethod interface { - fmt.Stringer - Name() string -} - -// UploadPackSession represents a git-upload-pack session. -// A git-upload-pack session has two steps: reference discovery -// (AdvertisedReferences) and uploading pack (UploadPack). -type UploadPackSession interface { - Session - // UploadPack takes a git-upload-pack request and returns a response, - // including a packfile. Don't be confused by terminology, the client - // side of a git-upload-pack is called git-fetch-pack, although here - // the same interface is used to make it RPC-like. - UploadPack(context.Context, *packp.UploadPackRequest) (*packp.UploadPackResponse, error) -} - -// ReceivePackSession represents a git-receive-pack session. -// A git-receive-pack session has two steps: reference discovery -// (AdvertisedReferences) and receiving pack (ReceivePack). -// In that order. -type ReceivePackSession interface { - Session - // ReceivePack sends an update references request and a packfile - // reader and returns a ReportStatus and error. Don't be confused by - // terminology, the client side of a git-receive-pack is called - // git-send-pack, although here the same interface is used to make it - // RPC-like. - ReceivePack(context.Context, *packp.ReferenceUpdateRequest) (*packp.ReportStatus, error) -} - -// Endpoint represents a Git URL in any supported protocol. -type Endpoint struct { - // Protocol is the protocol of the endpoint (e.g. git, https, file). - Protocol string - // User is the user. - User string - // Password is the password. - Password string - // Host is the host. - Host string - // Port is the port to connect, if 0 the default port for the given protocol - // will be used. - Port int - // Path is the repository path. - Path string - // InsecureSkipTLS skips ssl verify if protocol is https - InsecureSkipTLS bool - // CaBundle specify additional ca bundle with system cert pool - CaBundle []byte - // Proxy provides info required for connecting to a proxy. - Proxy ProxyOptions -} - -type ProxyOptions struct { - URL string - Username string - Password string -} - -func (o *ProxyOptions) Validate() error { - if o.URL != "" { - _, err := url.Parse(o.URL) - return err - } - return nil -} - -func (o *ProxyOptions) FullURL() (*url.URL, error) { - proxyURL, err := url.Parse(o.URL) - if err != nil { - return nil, err - } - if o.Username != "" { - if o.Password != "" { - proxyURL.User = url.UserPassword(o.Username, o.Password) - } else { - proxyURL.User = url.User(o.Username) - } - } - return proxyURL, nil -} - -var defaultPorts = map[string]int{ - "http": 80, - "https": 443, - "git": 9418, - "ssh": 22, -} - -// String returns a string representation of the Git URL. -func (u *Endpoint) String() string { - var buf bytes.Buffer - if u.Protocol != "" { - buf.WriteString(u.Protocol) - buf.WriteByte(':') - } - - if u.Protocol != "" || u.Host != "" || u.User != "" || u.Password != "" { - buf.WriteString("//") - - if u.User != "" || u.Password != "" { - buf.WriteString(url.PathEscape(u.User)) - if u.Password != "" { - buf.WriteByte(':') - buf.WriteString(url.PathEscape(u.Password)) - } - - buf.WriteByte('@') - } - - if u.Host != "" { - buf.WriteString(u.Host) - - if u.Port != 0 { - port, ok := defaultPorts[strings.ToLower(u.Protocol)] - if !ok || ok && port != u.Port { - fmt.Fprintf(&buf, ":%d", u.Port) - } - } - } - } - - if u.Path != "" && u.Path[0] != '/' && u.Host != "" { - buf.WriteByte('/') - } - - buf.WriteString(u.Path) - return buf.String() -} - -func NewEndpoint(endpoint string) (*Endpoint, error) { - if e, ok := parseSCPLike(endpoint); ok { - return e, nil - } - - if e, ok := parseFile(endpoint); ok { - return e, nil - } - - return parseURL(endpoint) -} - -func parseURL(endpoint string) (*Endpoint, error) { - u, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - - if !u.IsAbs() { - return nil, plumbing.NewPermanentError(fmt.Errorf( - "invalid endpoint: %s", endpoint, - )) - } - - var user, pass string - if u.User != nil { - user = u.User.Username() - pass, _ = u.User.Password() - } - - host := u.Hostname() - if strings.Contains(host, ":") { - // IPv6 address - host = "[" + host + "]" - } - - return &Endpoint{ - Protocol: u.Scheme, - User: user, - Password: pass, - Host: host, - Port: getPort(u), - Path: getPath(u), - }, nil -} - -func getPort(u *url.URL) int { - p := u.Port() - if p == "" { - return 0 - } - - i, err := strconv.Atoi(p) - if err != nil { - return 0 - } - - return i -} - -func getPath(u *url.URL) string { - var res string = u.Path - if u.RawQuery != "" { - res += "?" + u.RawQuery - } - - if u.Fragment != "" { - res += "#" + u.Fragment - } - - return res -} - -func parseSCPLike(endpoint string) (*Endpoint, bool) { - if giturl.MatchesScheme(endpoint) || !giturl.MatchesScpLike(endpoint) { - return nil, false - } - - user, host, portStr, path := giturl.FindScpLikeComponents(endpoint) - port, err := strconv.Atoi(portStr) - if err != nil { - port = 22 - } - - return &Endpoint{ - Protocol: "ssh", - User: user, - Host: host, - Port: port, - Path: path, - }, true -} - -func parseFile(endpoint string) (*Endpoint, bool) { - if giturl.MatchesScheme(endpoint) { - return nil, false - } - - path := endpoint - return &Endpoint{ - Protocol: "file", - Path: path, - }, true -} - -// UnsupportedCapabilities are the capabilities not supported by any client -// implementation -var UnsupportedCapabilities = []capability.Capability{ - capability.MultiACK, - capability.MultiACKDetailed, - capability.ThinPack, -} - -// FilterUnsupportedCapabilities it filter out all the UnsupportedCapabilities -// from a capability.List, the intended usage is on the client implementation -// to filter the capabilities from an AdvRefs message. -func FilterUnsupportedCapabilities(list *capability.List) { - for _, c := range UnsupportedCapabilities { - list.Delete(c) - } -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/client.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/client.go deleted file mode 100644 index 38714e2ad1..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/client.go +++ /dev/null @@ -1,156 +0,0 @@ -// Package file implements the file transport protocol. -package file - -import ( - "bufio" - "errors" - "io" - "os" - "path/filepath" - "strings" - - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/internal/common" - "golang.org/x/sys/execabs" -) - -// DefaultClient is the default local client. -var DefaultClient = NewClient( - transport.UploadPackServiceName, - transport.ReceivePackServiceName, -) - -type runner struct { - UploadPackBin string - ReceivePackBin string -} - -// NewClient returns a new local client using the given git-upload-pack and -// git-receive-pack binaries. -func NewClient(uploadPackBin, receivePackBin string) transport.Transport { - return common.NewClient(&runner{ - UploadPackBin: uploadPackBin, - ReceivePackBin: receivePackBin, - }) -} - -func prefixExecPath(cmd string) (string, error) { - // Use `git --exec-path` to find the exec path. - execCmd := execabs.Command("git", "--exec-path") - - stdout, err := execCmd.StdoutPipe() - if err != nil { - return "", err - } - stdoutBuf := bufio.NewReader(stdout) - - err = execCmd.Start() - if err != nil { - return "", err - } - - execPathBytes, isPrefix, err := stdoutBuf.ReadLine() - if err != nil { - return "", err - } - if isPrefix { - return "", errors.New("couldn't read exec-path line all at once") - } - - err = execCmd.Wait() - if err != nil { - return "", err - } - execPath := string(execPathBytes) - execPath = strings.TrimSpace(execPath) - cmd = filepath.Join(execPath, cmd) - - // Make sure it actually exists. - _, err = execabs.LookPath(cmd) - if err != nil { - return "", err - } - return cmd, nil -} - -func (r *runner) Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod, -) (common.Command, error) { - - switch cmd { - case transport.UploadPackServiceName: - cmd = r.UploadPackBin - case transport.ReceivePackServiceName: - cmd = r.ReceivePackBin - } - - _, err := execabs.LookPath(cmd) - if err != nil { - if e, ok := err.(*execabs.Error); ok && e.Err == execabs.ErrNotFound { - cmd, err = prefixExecPath(cmd) - if err != nil { - return nil, err - } - } else { - return nil, err - } - } - - return &command{cmd: execabs.Command(cmd, ep.Path)}, nil -} - -type command struct { - cmd *execabs.Cmd - stderrCloser io.Closer - closed bool -} - -func (c *command) Start() error { - return c.cmd.Start() -} - -func (c *command) StderrPipe() (io.Reader, error) { - // Pipe returned by Command.StderrPipe has a race with Read + Command.Wait. - // We use an io.Pipe and close it after the command finishes. - r, w := io.Pipe() - c.cmd.Stderr = w - c.stderrCloser = r - return r, nil -} - -func (c *command) StdinPipe() (io.WriteCloser, error) { - return c.cmd.StdinPipe() -} - -func (c *command) StdoutPipe() (io.Reader, error) { - return c.cmd.StdoutPipe() -} - -func (c *command) Kill() error { - c.cmd.Process.Kill() - return c.Close() -} - -// Close waits for the command to exit. -func (c *command) Close() error { - if c.closed { - return nil - } - - defer func() { - c.closed = true - _ = c.stderrCloser.Close() - - }() - - err := c.cmd.Wait() - if _, ok := err.(*os.PathError); ok { - return nil - } - - // When a repository does not exist, the command exits with code 128. - if _, ok := err.(*execabs.ExitError); ok { - return nil - } - - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/server.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/server.go deleted file mode 100644 index b45d7a71c2..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/file/server.go +++ /dev/null @@ -1,53 +0,0 @@ -package file - -import ( - "fmt" - "os" - - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/internal/common" - "github.com/go-git/go-git/v5/plumbing/transport/server" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// ServeUploadPack serves a git-upload-pack request using standard output, input -// and error. This is meant to be used when implementing a git-upload-pack -// command. -func ServeUploadPack(path string) error { - ep, err := transport.NewEndpoint(path) - if err != nil { - return err - } - - // TODO: define and implement a server-side AuthMethod - s, err := server.DefaultServer.NewUploadPackSession(ep, nil) - if err != nil { - return fmt.Errorf("error creating session: %s", err) - } - - return common.ServeUploadPack(srvCmd, s) -} - -// ServeReceivePack serves a git-receive-pack request using standard output, -// input and error. This is meant to be used when implementing a -// git-receive-pack command. -func ServeReceivePack(path string) error { - ep, err := transport.NewEndpoint(path) - if err != nil { - return err - } - - // TODO: define and implement a server-side AuthMethod - s, err := server.DefaultServer.NewReceivePackSession(ep, nil) - if err != nil { - return fmt.Errorf("error creating session: %s", err) - } - - return common.ServeReceivePack(srvCmd, s) -} - -var srvCmd = common.ServerCommand{ - Stdin: os.Stdin, - Stdout: ioutil.WriteNopCloser(os.Stdout), - Stderr: os.Stderr, -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/git/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/git/common.go deleted file mode 100644 index 2b878b0359..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/git/common.go +++ /dev/null @@ -1,108 +0,0 @@ -// Package git implements the git transport protocol. -package git - -import ( - "io" - "net" - "strconv" - - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/internal/common" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// DefaultClient is the default git client. -var DefaultClient = common.NewClient(&runner{}) - -const DefaultPort = 9418 - -type runner struct{} - -// Command returns a new Command for the given cmd in the given Endpoint -func (r *runner) Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (common.Command, error) { - // auth not allowed since git protocol doesn't support authentication - if auth != nil { - return nil, transport.ErrInvalidAuthMethod - } - c := &command{command: cmd, endpoint: ep} - if err := c.connect(); err != nil { - return nil, err - } - return c, nil -} - -type command struct { - conn net.Conn - connected bool - command string - endpoint *transport.Endpoint -} - -// Start executes the command sending the required message to the TCP connection -func (c *command) Start() error { - req := packp.GitProtoRequest{ - RequestCommand: c.command, - Pathname: c.endpoint.Path, - } - host := c.endpoint.Host - if c.endpoint.Port != DefaultPort { - host = net.JoinHostPort(c.endpoint.Host, strconv.Itoa(c.endpoint.Port)) - } - - req.Host = host - - return req.Encode(c.conn) -} - -func (c *command) connect() error { - if c.connected { - return transport.ErrAlreadyConnected - } - - var err error - c.conn, err = net.Dial("tcp", c.getHostWithPort()) - if err != nil { - return err - } - - c.connected = true - return nil -} - -func (c *command) getHostWithPort() string { - host := c.endpoint.Host - port := c.endpoint.Port - if port <= 0 { - port = DefaultPort - } - - return net.JoinHostPort(host, strconv.Itoa(port)) -} - -// StderrPipe git protocol doesn't have any dedicated error channel -func (c *command) StderrPipe() (io.Reader, error) { - return nil, nil -} - -// StdinPipe returns the underlying connection as WriteCloser, wrapped to prevent -// call to the Close function from the connection, a command execution in git -// protocol can't be closed or killed -func (c *command) StdinPipe() (io.WriteCloser, error) { - return ioutil.WriteNopCloser(c.conn), nil -} - -// StdoutPipe returns the underlying connection as Reader -func (c *command) StdoutPipe() (io.Reader, error) { - return c.conn, nil -} - -// Close closes the TCP connection and connection. -func (c *command) Close() error { - if !c.connected { - return nil - } - - c.connected = false - return c.conn.Close() -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/common.go deleted file mode 100644 index 54126febf4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/common.go +++ /dev/null @@ -1,452 +0,0 @@ -// Package http implements the HTTP transport protocol. -package http - -import ( - "bytes" - "context" - "crypto/tls" - "crypto/x509" - "fmt" - "net" - "net/http" - "net/url" - "reflect" - "strconv" - "strings" - "sync" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/golang/groupcache/lru" -) - -// it requires a bytes.Buffer, because we need to know the length -func applyHeadersToRequest(req *http.Request, content *bytes.Buffer, host string, requestType string) { - req.Header.Add("User-Agent", "git/1.0") - req.Header.Add("Host", host) // host:port - - if content == nil { - req.Header.Add("Accept", "*/*") - return - } - - req.Header.Add("Accept", fmt.Sprintf("application/x-%s-result", requestType)) - req.Header.Add("Content-Type", fmt.Sprintf("application/x-%s-request", requestType)) - req.Header.Add("Content-Length", strconv.Itoa(content.Len())) -} - -const infoRefsPath = "/info/refs" - -func advertisedReferences(ctx context.Context, s *session, serviceName string) (ref *packp.AdvRefs, err error) { - url := fmt.Sprintf( - "%s%s?service=%s", - s.endpoint.String(), infoRefsPath, serviceName, - ) - - req, err := http.NewRequest(http.MethodGet, url, nil) - if err != nil { - return nil, err - } - - s.ApplyAuthToRequest(req) - applyHeadersToRequest(req, nil, s.endpoint.Host, serviceName) - res, err := s.client.Do(req.WithContext(ctx)) - if err != nil { - return nil, err - } - - s.ModifyEndpointIfRedirect(res) - defer ioutil.CheckClose(res.Body, &err) - - if err = NewErr(res); err != nil { - return nil, err - } - - ar := packp.NewAdvRefs() - if err = ar.Decode(res.Body); err != nil { - if err == packp.ErrEmptyAdvRefs { - err = transport.ErrEmptyRemoteRepository - } - - return nil, err - } - - // Git 2.41+ returns a zero-id plus capabilities when an empty - // repository is being cloned. This skips the existing logic within - // advrefs_decode.decodeFirstHash, which expects a flush-pkt instead. - // - // This logic aligns with plumbing/transport/internal/common/common.go. - if ar.IsEmpty() && - // Empty repositories are valid for git-receive-pack. - transport.ReceivePackServiceName != serviceName { - return nil, transport.ErrEmptyRemoteRepository - } - - transport.FilterUnsupportedCapabilities(ar.Capabilities) - s.advRefs = ar - - return ar, nil -} - -type client struct { - c *http.Client - transports *lru.Cache - m sync.RWMutex -} - -// ClientOptions holds user configurable options for the client. -type ClientOptions struct { - // CacheMaxEntries is the max no. of entries that the transport objects - // cache will hold at any given point of time. It must be a positive integer. - // Calling `client.addTransport()` after the cache has reached the specified - // size, will result in the least recently used transport getting deleted - // before the provided transport is added to the cache. - CacheMaxEntries int -} - -var ( - // defaultTransportCacheSize is the default capacity of the transport objects cache. - // Its value is 0 because transport caching is turned off by default and is an - // opt-in feature. - defaultTransportCacheSize = 0 - - // DefaultClient is the default HTTP client, which uses a net/http client configured - // with http.DefaultTransport. - DefaultClient = NewClient(nil) -) - -// NewClient creates a new client with a custom net/http client. -// See `InstallProtocol` to install and override default http client. -// If the net/http client is nil or empty, it will use a net/http client configured -// with http.DefaultTransport. -// -// Note that for HTTP client cannot distinguish between private repositories and -// unexistent repositories on GitHub. So it returns `ErrAuthorizationRequired` -// for both. -func NewClient(c *http.Client) transport.Transport { - if c == nil { - c = &http.Client{ - Transport: http.DefaultTransport, - } - } - return NewClientWithOptions(c, &ClientOptions{ - CacheMaxEntries: defaultTransportCacheSize, - }) -} - -// NewClientWithOptions returns a new client configured with the provided net/http client -// and other custom options specific to the client. -// If the net/http client is nil or empty, it will use a net/http client configured -// with http.DefaultTransport. -func NewClientWithOptions(c *http.Client, opts *ClientOptions) transport.Transport { - if c == nil { - c = &http.Client{ - Transport: http.DefaultTransport, - } - } - cl := &client{ - c: c, - } - - if opts != nil { - if opts.CacheMaxEntries > 0 { - cl.transports = lru.New(opts.CacheMaxEntries) - } - } - return cl -} - -func (c *client) NewUploadPackSession(ep *transport.Endpoint, auth transport.AuthMethod) ( - transport.UploadPackSession, error) { - - return newUploadPackSession(c, ep, auth) -} - -func (c *client) NewReceivePackSession(ep *transport.Endpoint, auth transport.AuthMethod) ( - transport.ReceivePackSession, error) { - - return newReceivePackSession(c, ep, auth) -} - -type session struct { - auth AuthMethod - client *http.Client - endpoint *transport.Endpoint - advRefs *packp.AdvRefs -} - -func transportWithInsecureTLS(transport *http.Transport) { - if transport.TLSClientConfig == nil { - transport.TLSClientConfig = &tls.Config{} - } - transport.TLSClientConfig.InsecureSkipVerify = true -} - -func transportWithCABundle(transport *http.Transport, caBundle []byte) error { - rootCAs, err := x509.SystemCertPool() - if err != nil { - return err - } - if rootCAs == nil { - rootCAs = x509.NewCertPool() - } - rootCAs.AppendCertsFromPEM(caBundle) - if transport.TLSClientConfig == nil { - transport.TLSClientConfig = &tls.Config{} - } - transport.TLSClientConfig.RootCAs = rootCAs - return nil -} - -func transportWithProxy(transport *http.Transport, proxyURL *url.URL) { - transport.Proxy = http.ProxyURL(proxyURL) -} - -func configureTransport(transport *http.Transport, ep *transport.Endpoint) error { - if len(ep.CaBundle) > 0 { - if err := transportWithCABundle(transport, ep.CaBundle); err != nil { - return err - } - } - if ep.InsecureSkipTLS { - transportWithInsecureTLS(transport) - } - - if ep.Proxy.URL != "" { - proxyURL, err := ep.Proxy.FullURL() - if err != nil { - return err - } - transportWithProxy(transport, proxyURL) - } - return nil -} - -func newSession(c *client, ep *transport.Endpoint, auth transport.AuthMethod) (*session, error) { - var httpClient *http.Client - - // We need to configure the http transport if there are transport specific - // options present in the endpoint. - if len(ep.CaBundle) > 0 || ep.InsecureSkipTLS || ep.Proxy.URL != "" { - var transport *http.Transport - // if the client wasn't configured to have a cache for transports then just configure - // the transport and use it directly, otherwise try to use the cache. - if c.transports == nil { - tr, ok := c.c.Transport.(*http.Transport) - if !ok { - return nil, fmt.Errorf("expected underlying client transport to be of type: %s; got: %s", - reflect.TypeOf(transport), reflect.TypeOf(c.c.Transport)) - } - - transport = tr.Clone() - configureTransport(transport, ep) - } else { - transportOpts := transportOptions{ - caBundle: string(ep.CaBundle), - insecureSkipTLS: ep.InsecureSkipTLS, - } - if ep.Proxy.URL != "" { - proxyURL, err := ep.Proxy.FullURL() - if err != nil { - return nil, err - } - transportOpts.proxyURL = *proxyURL - } - var found bool - transport, found = c.fetchTransport(transportOpts) - - if !found { - transport = c.c.Transport.(*http.Transport).Clone() - configureTransport(transport, ep) - c.addTransport(transportOpts, transport) - } - } - - httpClient = &http.Client{ - Transport: transport, - CheckRedirect: c.c.CheckRedirect, - Jar: c.c.Jar, - Timeout: c.c.Timeout, - } - } else { - httpClient = c.c - } - - s := &session{ - auth: basicAuthFromEndpoint(ep), - client: httpClient, - endpoint: ep, - } - if auth != nil { - a, ok := auth.(AuthMethod) - if !ok { - return nil, transport.ErrInvalidAuthMethod - } - - s.auth = a - } - - return s, nil -} - -func (s *session) ApplyAuthToRequest(req *http.Request) { - if s.auth == nil { - return - } - - s.auth.SetAuth(req) -} - -func (s *session) ModifyEndpointIfRedirect(res *http.Response) { - if res.Request == nil { - return - } - - r := res.Request - if !strings.HasSuffix(r.URL.Path, infoRefsPath) { - return - } - - h, p, err := net.SplitHostPort(r.URL.Host) - if err != nil { - h = r.URL.Host - } - if p != "" { - port, err := strconv.Atoi(p) - if err == nil { - s.endpoint.Port = port - } - } - s.endpoint.Host = h - - s.endpoint.Protocol = r.URL.Scheme - s.endpoint.Path = r.URL.Path[:len(r.URL.Path)-len(infoRefsPath)] -} - -func (*session) Close() error { - return nil -} - -// AuthMethod is concrete implementation of common.AuthMethod for HTTP services -type AuthMethod interface { - transport.AuthMethod - SetAuth(r *http.Request) -} - -func basicAuthFromEndpoint(ep *transport.Endpoint) *BasicAuth { - u := ep.User - if u == "" { - return nil - } - - return &BasicAuth{u, ep.Password} -} - -// BasicAuth represent a HTTP basic auth -type BasicAuth struct { - Username, Password string -} - -func (a *BasicAuth) SetAuth(r *http.Request) { - if a == nil { - return - } - - r.SetBasicAuth(a.Username, a.Password) -} - -// Name is name of the auth -func (a *BasicAuth) Name() string { - return "http-basic-auth" -} - -func (a *BasicAuth) String() string { - masked := "*******" - if a.Password == "" { - masked = "" - } - - return fmt.Sprintf("%s - %s:%s", a.Name(), a.Username, masked) -} - -// TokenAuth implements an http.AuthMethod that can be used with http transport -// to authenticate with HTTP token authentication (also known as bearer -// authentication). -// -// IMPORTANT: If you are looking to use OAuth tokens with popular servers (e.g. -// GitHub, Bitbucket, GitLab) you should use BasicAuth instead. These servers -// use basic HTTP authentication, with the OAuth token as user or password. -// Check the documentation of your git server for details. -type TokenAuth struct { - Token string -} - -func (a *TokenAuth) SetAuth(r *http.Request) { - if a == nil { - return - } - r.Header.Add("Authorization", fmt.Sprintf("Bearer %s", a.Token)) -} - -// Name is name of the auth -func (a *TokenAuth) Name() string { - return "http-token-auth" -} - -func (a *TokenAuth) String() string { - masked := "*******" - if a.Token == "" { - masked = "" - } - return fmt.Sprintf("%s - %s", a.Name(), masked) -} - -// Err is a dedicated error to return errors based on status code -type Err struct { - Response *http.Response - Reason string -} - -// NewErr returns a new Err based on a http response and closes response body -// if needed -func NewErr(r *http.Response) error { - if r.StatusCode >= http.StatusOK && r.StatusCode < http.StatusMultipleChoices { - return nil - } - - var reason string - - // If a response message is present, add it to error - var messageBuffer bytes.Buffer - if r.Body != nil { - messageLength, _ := messageBuffer.ReadFrom(r.Body) - if messageLength > 0 { - reason = messageBuffer.String() - } - _ = r.Body.Close() - } - - switch r.StatusCode { - case http.StatusUnauthorized: - return transport.ErrAuthenticationRequired - case http.StatusForbidden: - return transport.ErrAuthorizationFailed - case http.StatusNotFound: - return transport.ErrRepositoryNotFound - } - - return plumbing.NewUnexpectedError(&Err{r, reason}) -} - -// StatusCode returns the status code of the response -func (e *Err) StatusCode() int { - return e.Response.StatusCode -} - -func (e *Err) Error() string { - return fmt.Sprintf("unexpected requesting %q status code: %d", - e.Response.Request.URL, e.Response.StatusCode, - ) -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/receive_pack.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/receive_pack.go deleted file mode 100644 index 3e736cd95e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/receive_pack.go +++ /dev/null @@ -1,109 +0,0 @@ -package http - -import ( - "bytes" - "context" - "fmt" - "io" - "net/http" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -type rpSession struct { - *session -} - -func newReceivePackSession(c *client, ep *transport.Endpoint, auth transport.AuthMethod) (transport.ReceivePackSession, error) { - s, err := newSession(c, ep, auth) - return &rpSession{s}, err -} - -func (s *rpSession) AdvertisedReferences() (*packp.AdvRefs, error) { - return advertisedReferences(context.TODO(), s.session, transport.ReceivePackServiceName) -} - -func (s *rpSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { - return advertisedReferences(ctx, s.session, transport.ReceivePackServiceName) -} - -func (s *rpSession) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateRequest) ( - *packp.ReportStatus, error) { - url := fmt.Sprintf( - "%s/%s", - s.endpoint.String(), transport.ReceivePackServiceName, - ) - - buf := bytes.NewBuffer(nil) - if err := req.Encode(buf); err != nil { - return nil, err - } - - res, err := s.doRequest(ctx, http.MethodPost, url, buf) - if err != nil { - return nil, err - } - - r, err := ioutil.NonEmptyReader(res.Body) - if err == ioutil.ErrEmptyReader { - return nil, nil - } - - if err != nil { - return nil, err - } - - var d *sideband.Demuxer - if req.Capabilities.Supports(capability.Sideband64k) { - d = sideband.NewDemuxer(sideband.Sideband64k, r) - } else if req.Capabilities.Supports(capability.Sideband) { - d = sideband.NewDemuxer(sideband.Sideband, r) - } - if d != nil { - d.Progress = req.Progress - r = d - } - - rc := ioutil.NewReadCloser(r, res.Body) - - report := packp.NewReportStatus() - if err := report.Decode(rc); err != nil { - return nil, err - } - - return report, report.Error() -} - -func (s *rpSession) doRequest( - ctx context.Context, method, url string, content *bytes.Buffer, -) (*http.Response, error) { - - var body io.Reader - if content != nil { - body = content - } - - req, err := http.NewRequest(method, url, body) - if err != nil { - return nil, plumbing.NewPermanentError(err) - } - - applyHeadersToRequest(req, content, s.endpoint.Host, transport.ReceivePackServiceName) - s.ApplyAuthToRequest(req) - - res, err := s.client.Do(req.WithContext(ctx)) - if err != nil { - return nil, plumbing.NewUnexpectedError(err) - } - - if err := NewErr(res); err != nil { - return nil, err - } - - return res, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/transport.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/transport.go deleted file mode 100644 index 052f3c8e28..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/transport.go +++ /dev/null @@ -1,40 +0,0 @@ -package http - -import ( - "net/http" - "net/url" -) - -// transportOptions contains transport specific configuration. -type transportOptions struct { - insecureSkipTLS bool - // []byte is not comparable. - caBundle string - proxyURL url.URL -} - -func (c *client) addTransport(opts transportOptions, transport *http.Transport) { - c.m.Lock() - c.transports.Add(opts, transport) - c.m.Unlock() -} - -func (c *client) removeTransport(opts transportOptions) { - c.m.Lock() - c.transports.Remove(opts) - c.m.Unlock() -} - -func (c *client) fetchTransport(opts transportOptions) (*http.Transport, bool) { - c.m.RLock() - t, ok := c.transports.Get(opts) - c.m.RUnlock() - if !ok { - return nil, false - } - transport, ok := t.(*http.Transport) - if !ok { - return nil, false - } - return transport, true -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/upload_pack.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/upload_pack.go deleted file mode 100644 index 3432618ab9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/http/upload_pack.go +++ /dev/null @@ -1,126 +0,0 @@ -package http - -import ( - "bytes" - "context" - "fmt" - "io" - "net/http" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/pktline" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/internal/common" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -type upSession struct { - *session -} - -func newUploadPackSession(c *client, ep *transport.Endpoint, auth transport.AuthMethod) (transport.UploadPackSession, error) { - s, err := newSession(c, ep, auth) - return &upSession{s}, err -} - -func (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) { - return advertisedReferences(context.TODO(), s.session, transport.UploadPackServiceName) -} - -func (s *upSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { - return advertisedReferences(ctx, s.session, transport.UploadPackServiceName) -} - -func (s *upSession) UploadPack( - ctx context.Context, req *packp.UploadPackRequest, -) (*packp.UploadPackResponse, error) { - - if req.IsEmpty() { - return nil, transport.ErrEmptyUploadPackRequest - } - - if err := req.Validate(); err != nil { - return nil, err - } - - url := fmt.Sprintf( - "%s/%s", - s.endpoint.String(), transport.UploadPackServiceName, - ) - - content, err := uploadPackRequestToReader(req) - if err != nil { - return nil, err - } - - res, err := s.doRequest(ctx, http.MethodPost, url, content) - if err != nil { - return nil, err - } - - r, err := ioutil.NonEmptyReader(res.Body) - if err != nil { - if err == ioutil.ErrEmptyReader || err == io.ErrUnexpectedEOF { - return nil, transport.ErrEmptyUploadPackRequest - } - - return nil, err - } - - rc := ioutil.NewReadCloser(r, res.Body) - return common.DecodeUploadPackResponse(rc, req) -} - -// Close does nothing. -func (s *upSession) Close() error { - return nil -} - -func (s *upSession) doRequest( - ctx context.Context, method, url string, content *bytes.Buffer, -) (*http.Response, error) { - - var body io.Reader - if content != nil { - body = content - } - - req, err := http.NewRequest(method, url, body) - if err != nil { - return nil, plumbing.NewPermanentError(err) - } - - applyHeadersToRequest(req, content, s.endpoint.Host, transport.UploadPackServiceName) - s.ApplyAuthToRequest(req) - - res, err := s.client.Do(req.WithContext(ctx)) - if err != nil { - return nil, plumbing.NewUnexpectedError(err) - } - - if err := NewErr(res); err != nil { - return nil, err - } - - return res, nil -} - -func uploadPackRequestToReader(req *packp.UploadPackRequest) (*bytes.Buffer, error) { - buf := bytes.NewBuffer(nil) - e := pktline.NewEncoder(buf) - - if err := req.UploadRequest.Encode(buf); err != nil { - return nil, fmt.Errorf("sending upload-req message: %s", err) - } - - if err := req.UploadHaves.Encode(buf, false); err != nil { - return nil, fmt.Errorf("sending haves message: %s", err) - } - - if err := e.EncodeString("done\n"); err != nil { - return nil, err - } - - return buf, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go deleted file mode 100644 index 9e1d02357f..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/common.go +++ /dev/null @@ -1,492 +0,0 @@ -// Package common implements the git pack protocol with a pluggable transport. -// This is a low-level package to implement new transports. Use a concrete -// implementation instead (e.g. http, file, ssh). -// -// A simple example of usage can be found in the file package. -package common - -import ( - "bufio" - "context" - "errors" - "fmt" - "io" - "regexp" - "strings" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/pktline" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -const ( - readErrorSecondsTimeout = 10 -) - -var ( - ErrTimeoutExceeded = errors.New("timeout exceeded") - // stdErrSkipPattern is used for skipping lines from a command's stderr output. - // Any line matching this pattern will be skipped from further - // processing and not be returned to calling code. - stdErrSkipPattern = regexp.MustCompile("^remote:( =*){0,1}$") -) - -// Commander creates Command instances. This is the main entry point for -// transport implementations. -type Commander interface { - // Command creates a new Command for the given git command and - // endpoint. cmd can be git-upload-pack or git-receive-pack. An - // error should be returned if the endpoint is not supported or the - // command cannot be created (e.g. binary does not exist, connection - // cannot be established). - Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (Command, error) -} - -// Command is used for a single command execution. -// This interface is modeled after exec.Cmd and ssh.Session in the standard -// library. -type Command interface { - // StderrPipe returns a pipe that will be connected to the command's - // standard error when the command starts. It should not be called after - // Start. - StderrPipe() (io.Reader, error) - // StdinPipe returns a pipe that will be connected to the command's - // standard input when the command starts. It should not be called after - // Start. The pipe should be closed when no more input is expected. - StdinPipe() (io.WriteCloser, error) - // StdoutPipe returns a pipe that will be connected to the command's - // standard output when the command starts. It should not be called after - // Start. - StdoutPipe() (io.Reader, error) - // Start starts the specified command. It does not wait for it to - // complete. - Start() error - // Close closes the command and releases any resources used by it. It - // will block until the command exits. - Close() error -} - -// CommandKiller expands the Command interface, enabling it for being killed. -type CommandKiller interface { - // Kill and close the session whatever the state it is. It will block until - // the command is terminated. - Kill() error -} - -type client struct { - cmdr Commander -} - -// NewClient creates a new client using the given Commander. -func NewClient(runner Commander) transport.Transport { - return &client{runner} -} - -// NewUploadPackSession creates a new UploadPackSession. -func (c *client) NewUploadPackSession(ep *transport.Endpoint, auth transport.AuthMethod) ( - transport.UploadPackSession, error) { - - return c.newSession(transport.UploadPackServiceName, ep, auth) -} - -// NewReceivePackSession creates a new ReceivePackSession. -func (c *client) NewReceivePackSession(ep *transport.Endpoint, auth transport.AuthMethod) ( - transport.ReceivePackSession, error) { - - return c.newSession(transport.ReceivePackServiceName, ep, auth) -} - -type session struct { - Stdin io.WriteCloser - Stdout io.Reader - Command Command - - isReceivePack bool - advRefs *packp.AdvRefs - packRun bool - finished bool - firstErrLine chan string -} - -func (c *client) newSession(s string, ep *transport.Endpoint, auth transport.AuthMethod) (*session, error) { - cmd, err := c.cmdr.Command(s, ep, auth) - if err != nil { - return nil, err - } - - stdin, err := cmd.StdinPipe() - if err != nil { - return nil, err - } - - stdout, err := cmd.StdoutPipe() - if err != nil { - return nil, err - } - - stderr, err := cmd.StderrPipe() - if err != nil { - return nil, err - } - - if err := cmd.Start(); err != nil { - return nil, err - } - - return &session{ - Stdin: stdin, - Stdout: stdout, - Command: cmd, - firstErrLine: c.listenFirstError(stderr), - isReceivePack: s == transport.ReceivePackServiceName, - }, nil -} - -func (c *client) listenFirstError(r io.Reader) chan string { - if r == nil { - return nil - } - - errLine := make(chan string, 1) - go func() { - s := bufio.NewScanner(r) - for { - if s.Scan() { - line := s.Text() - if !stdErrSkipPattern.MatchString(line) { - errLine <- line - break - } - } else { - close(errLine) - break - } - } - - _, _ = io.Copy(io.Discard, r) - }() - - return errLine -} - -func (s *session) AdvertisedReferences() (*packp.AdvRefs, error) { - return s.AdvertisedReferencesContext(context.TODO()) -} - -// AdvertisedReferences retrieves the advertised references from the server. -func (s *session) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { - if s.advRefs != nil { - return s.advRefs, nil - } - - ar := packp.NewAdvRefs() - if err := ar.Decode(s.StdoutContext(ctx)); err != nil { - if err := s.handleAdvRefDecodeError(err); err != nil { - return nil, err - } - } - - // Some servers like jGit, announce capabilities instead of returning an - // packp message with a flush. This verifies that we received a empty - // adv-refs, even it contains capabilities. - if !s.isReceivePack && ar.IsEmpty() { - return nil, transport.ErrEmptyRemoteRepository - } - - transport.FilterUnsupportedCapabilities(ar.Capabilities) - s.advRefs = ar - return ar, nil -} - -func (s *session) handleAdvRefDecodeError(err error) error { - var errLine *pktline.ErrorLine - if errors.As(err, &errLine) { - if isRepoNotFoundError(errLine.Text) { - return transport.ErrRepositoryNotFound - } - - return errLine - } - - // If repository is not found, we get empty stdout and server writes an - // error to stderr. - if errors.Is(err, packp.ErrEmptyInput) { - // TODO:(v6): handle this error in a better way. - // Instead of checking the stderr output for a specific error message, - // define an ExitError and embed the stderr output and exit (if one - // exists) in the error struct. Just like exec.ExitError. - s.finished = true - if err := s.checkNotFoundError(); err != nil { - return err - } - - return io.ErrUnexpectedEOF - } - - // For empty (but existing) repositories, we get empty advertised-references - // message. But valid. That is, it includes at least a flush. - if err == packp.ErrEmptyAdvRefs { - // Empty repositories are valid for git-receive-pack. - if s.isReceivePack { - return nil - } - - if err := s.finish(); err != nil { - return err - } - - return transport.ErrEmptyRemoteRepository - } - - // Some server sends the errors as normal content (git protocol), so when - // we try to decode it fails, we need to check the content of it, to detect - // not found errors - if uerr, ok := err.(*packp.ErrUnexpectedData); ok { - if isRepoNotFoundError(string(uerr.Data)) { - return transport.ErrRepositoryNotFound - } - } - - return err -} - -// UploadPack performs a request to the server to fetch a packfile. A reader is -// returned with the packfile content. The reader must be closed after reading. -func (s *session) UploadPack(ctx context.Context, req *packp.UploadPackRequest) (*packp.UploadPackResponse, error) { - if req.IsEmpty() { - // XXX: IsEmpty means haves are a subset of wants, in that case we have - // everything we asked for. Close the connection and return nil. - if err := s.finish(); err != nil { - return nil, err - } - // TODO:(v6) return nil here - return nil, transport.ErrEmptyUploadPackRequest - } - - if err := req.Validate(); err != nil { - return nil, err - } - - if _, err := s.AdvertisedReferencesContext(ctx); err != nil { - return nil, err - } - - s.packRun = true - - in := s.StdinContext(ctx) - out := s.StdoutContext(ctx) - - if err := uploadPack(in, out, req); err != nil { - return nil, err - } - - r, err := ioutil.NonEmptyReader(out) - if err == ioutil.ErrEmptyReader { - if c, ok := s.Stdout.(io.Closer); ok { - _ = c.Close() - } - - return nil, transport.ErrEmptyUploadPackRequest - } - - if err != nil { - return nil, err - } - - rc := ioutil.NewReadCloser(r, s) - return DecodeUploadPackResponse(rc, req) -} - -func (s *session) StdinContext(ctx context.Context) io.WriteCloser { - return ioutil.NewWriteCloserOnError( - ioutil.NewContextWriteCloser(ctx, s.Stdin), - s.onError, - ) -} - -func (s *session) StdoutContext(ctx context.Context) io.Reader { - return ioutil.NewReaderOnError( - ioutil.NewContextReader(ctx, s.Stdout), - s.onError, - ) -} - -func (s *session) onError(err error) { - if k, ok := s.Command.(CommandKiller); ok { - _ = k.Kill() - } - - _ = s.Close() -} - -func (s *session) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateRequest) (*packp.ReportStatus, error) { - if _, err := s.AdvertisedReferences(); err != nil { - return nil, err - } - - s.packRun = true - - w := s.StdinContext(ctx) - if err := req.Encode(w); err != nil { - return nil, err - } - - if err := w.Close(); err != nil { - return nil, err - } - - if !req.Capabilities.Supports(capability.ReportStatus) { - // If we don't have report-status, we can only - // check return value error. - return nil, s.Command.Close() - } - - r := s.StdoutContext(ctx) - - var d *sideband.Demuxer - if req.Capabilities.Supports(capability.Sideband64k) { - d = sideband.NewDemuxer(sideband.Sideband64k, r) - } else if req.Capabilities.Supports(capability.Sideband) { - d = sideband.NewDemuxer(sideband.Sideband, r) - } - if d != nil { - d.Progress = req.Progress - r = d - } - - report := packp.NewReportStatus() - if err := report.Decode(r); err != nil { - return nil, err - } - - if err := report.Error(); err != nil { - defer s.Close() - return report, err - } - - return report, s.Command.Close() -} - -func (s *session) finish() error { - if s.finished { - return nil - } - - s.finished = true - - // If we did not run a upload/receive-pack, we close the connection - // gracefully by sending a flush packet to the server. If the server - // operates correctly, it will exit with status 0. - if !s.packRun { - _, err := s.Stdin.Write(pktline.FlushPkt) - return err - } - - return nil -} - -func (s *session) Close() (err error) { - err = s.finish() - - defer ioutil.CheckClose(s.Command, &err) - return -} - -func (s *session) checkNotFoundError() error { - t := time.NewTicker(time.Second * readErrorSecondsTimeout) - defer t.Stop() - - select { - case <-t.C: - return ErrTimeoutExceeded - case line, ok := <-s.firstErrLine: - if !ok || len(line) == 0 { - return nil - } - - if isRepoNotFoundError(line) { - return transport.ErrRepositoryNotFound - } - - // TODO:(v6): return server error just as it is without a prefix - return fmt.Errorf("unknown error: %s", line) - } -} - -const ( - githubRepoNotFoundErr = "Repository not found." - bitbucketRepoNotFoundErr = "repository does not exist." - localRepoNotFoundErr = "does not appear to be a git repository" - gitProtocolNotFoundErr = "Repository not found." - gitProtocolNoSuchErr = "no such repository" - gitProtocolAccessDeniedErr = "access denied" - gogsAccessDeniedErr = "Repository does not exist or you do not have access" - gitlabRepoNotFoundErr = "The project you were looking for could not be found" -) - -func isRepoNotFoundError(s string) bool { - for _, err := range []string{ - githubRepoNotFoundErr, - bitbucketRepoNotFoundErr, - localRepoNotFoundErr, - gitProtocolNotFoundErr, - gitProtocolNoSuchErr, - gitProtocolAccessDeniedErr, - gogsAccessDeniedErr, - gitlabRepoNotFoundErr, - } { - if strings.Contains(s, err) { - return true - } - } - - return false -} - -// uploadPack implements the git-upload-pack protocol. -func uploadPack(w io.WriteCloser, _ io.Reader, req *packp.UploadPackRequest) error { - // TODO support multi_ack mode - // TODO support multi_ack_detailed mode - // TODO support acks for common objects - // TODO build a proper state machine for all these processing options - - if err := req.UploadRequest.Encode(w); err != nil { - return fmt.Errorf("sending upload-req message: %s", err) - } - - if err := req.UploadHaves.Encode(w, true); err != nil { - return fmt.Errorf("sending haves message: %s", err) - } - - if err := sendDone(w); err != nil { - return fmt.Errorf("sending done message: %s", err) - } - - if err := w.Close(); err != nil { - return fmt.Errorf("closing input: %s", err) - } - - return nil -} - -func sendDone(w io.Writer) error { - e := pktline.NewEncoder(w) - - return e.Encodef("done\n") -} - -// DecodeUploadPackResponse decodes r into a new packp.UploadPackResponse -func DecodeUploadPackResponse(r io.ReadCloser, req *packp.UploadPackRequest) ( - *packp.UploadPackResponse, error, -) { - res := packp.NewUploadPackResponse(req) - if err := res.Decode(r); err != nil { - return nil, fmt.Errorf("error decoding upload-pack response: %s", err) - } - - return res, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/mocks.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/mocks.go deleted file mode 100644 index bc18b27e81..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/mocks.go +++ /dev/null @@ -1,46 +0,0 @@ -package common - -import ( - "bytes" - "io" - - gogitioutil "github.com/go-git/go-git/v5/utils/ioutil" - - "github.com/go-git/go-git/v5/plumbing/transport" -) - -type MockCommand struct { - stdin bytes.Buffer - stdout bytes.Buffer - stderr bytes.Buffer -} - -func (c MockCommand) StderrPipe() (io.Reader, error) { - return &c.stderr, nil -} - -func (c MockCommand) StdinPipe() (io.WriteCloser, error) { - return gogitioutil.WriteNopCloser(&c.stdin), nil -} - -func (c MockCommand) StdoutPipe() (io.Reader, error) { - return &c.stdout, nil -} - -func (c MockCommand) Start() error { - return nil -} - -func (c MockCommand) Close() error { - panic("not implemented") -} - -type MockCommander struct { - stderr string -} - -func (c MockCommander) Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (Command, error) { - return &MockCommand{ - stderr: *bytes.NewBufferString(c.stderr), - }, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/server.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/server.go deleted file mode 100644 index e2480848a4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/internal/common/server.go +++ /dev/null @@ -1,73 +0,0 @@ -package common - -import ( - "context" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// ServerCommand is used for a single server command execution. -type ServerCommand struct { - Stderr io.Writer - Stdout io.WriteCloser - Stdin io.Reader -} - -func ServeUploadPack(cmd ServerCommand, s transport.UploadPackSession) (err error) { - ioutil.CheckClose(cmd.Stdout, &err) - - ar, err := s.AdvertisedReferences() - if err != nil { - return err - } - - if err := ar.Encode(cmd.Stdout); err != nil { - return err - } - - req := packp.NewUploadPackRequest() - if err := req.Decode(cmd.Stdin); err != nil { - return err - } - - var resp *packp.UploadPackResponse - resp, err = s.UploadPack(context.TODO(), req) - if err != nil { - return err - } - - return resp.Encode(cmd.Stdout) -} - -func ServeReceivePack(cmd ServerCommand, s transport.ReceivePackSession) error { - ar, err := s.AdvertisedReferences() - if err != nil { - return fmt.Errorf("internal error in advertised references: %s", err) - } - - if err := ar.Encode(cmd.Stdout); err != nil { - return fmt.Errorf("error in advertised references encoding: %s", err) - } - - req := packp.NewReferenceUpdateRequest() - if err := req.Decode(cmd.Stdin); err != nil { - return fmt.Errorf("error decoding: %s", err) - } - - rs, err := s.ReceivePack(context.TODO(), req) - if rs != nil { - if err := rs.Encode(cmd.Stdout); err != nil { - return fmt.Errorf("error in encoding report status %s", err) - } - } - - if err != nil { - return fmt.Errorf("error in receive pack: %s", err) - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/loader.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/loader.go deleted file mode 100644 index e7e2b075e5..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/loader.go +++ /dev/null @@ -1,64 +0,0 @@ -package server - -import ( - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/storage/filesystem" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/osfs" -) - -// DefaultLoader is a filesystem loader ignoring host and resolving paths to /. -var DefaultLoader = NewFilesystemLoader(osfs.New("")) - -// Loader loads repository's storer.Storer based on an optional host and a path. -type Loader interface { - // Load loads a storer.Storer given a transport.Endpoint. - // Returns transport.ErrRepositoryNotFound if the repository does not - // exist. - Load(ep *transport.Endpoint) (storer.Storer, error) -} - -type fsLoader struct { - base billy.Filesystem -} - -// NewFilesystemLoader creates a Loader that ignores host and resolves paths -// with a given base filesystem. -func NewFilesystemLoader(base billy.Filesystem) Loader { - return &fsLoader{base} -} - -// Load looks up the endpoint's path in the base file system and returns a -// storer for it. Returns transport.ErrRepositoryNotFound if a repository does -// not exist in the given path. -func (l *fsLoader) Load(ep *transport.Endpoint) (storer.Storer, error) { - fs, err := l.base.Chroot(ep.Path) - if err != nil { - return nil, err - } - - if _, err := fs.Stat("config"); err != nil { - return nil, transport.ErrRepositoryNotFound - } - - return filesystem.NewStorage(fs, cache.NewObjectLRUDefault()), nil -} - -// MapLoader is a Loader that uses a lookup map of storer.Storer by -// transport.Endpoint. -type MapLoader map[string]storer.Storer - -// Load returns a storer.Storer for given a transport.Endpoint by looking it up -// in the map. Returns transport.ErrRepositoryNotFound if the endpoint does not -// exist. -func (l MapLoader) Load(ep *transport.Endpoint) (storer.Storer, error) { - s, ok := l[ep.String()] - if !ok { - return nil, transport.ErrRepositoryNotFound - } - - return s, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go deleted file mode 100644 index cf5d6f43fe..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/server/server.go +++ /dev/null @@ -1,432 +0,0 @@ -// Package server implements the git server protocol. For most use cases, the -// transport-specific implementations should be used. -package server - -import ( - "context" - "errors" - "fmt" - "io" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/revlist" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -var DefaultServer = NewServer(DefaultLoader) - -type server struct { - loader Loader - handler *handler -} - -// NewServer returns a transport.Transport implementing a git server, -// independent of transport. Each transport must wrap this. -func NewServer(loader Loader) transport.Transport { - return &server{ - loader, - &handler{asClient: false}, - } -} - -// NewClient returns a transport.Transport implementing a client with an -// embedded server. -func NewClient(loader Loader) transport.Transport { - return &server{ - loader, - &handler{asClient: true}, - } -} - -func (s *server) NewUploadPackSession(ep *transport.Endpoint, auth transport.AuthMethod) (transport.UploadPackSession, error) { - sto, err := s.loader.Load(ep) - if err != nil { - return nil, err - } - - return s.handler.NewUploadPackSession(sto) -} - -func (s *server) NewReceivePackSession(ep *transport.Endpoint, auth transport.AuthMethod) (transport.ReceivePackSession, error) { - sto, err := s.loader.Load(ep) - if err != nil { - return nil, err - } - - return s.handler.NewReceivePackSession(sto) -} - -type handler struct { - asClient bool -} - -func (h *handler) NewUploadPackSession(s storer.Storer) (transport.UploadPackSession, error) { - return &upSession{ - session: session{storer: s, asClient: h.asClient}, - }, nil -} - -func (h *handler) NewReceivePackSession(s storer.Storer) (transport.ReceivePackSession, error) { - return &rpSession{ - session: session{storer: s, asClient: h.asClient}, - cmdStatus: map[plumbing.ReferenceName]error{}, - }, nil -} - -type session struct { - storer storer.Storer - caps *capability.List - asClient bool -} - -func (s *session) Close() error { - return nil -} - -func (s *session) SetAuth(transport.AuthMethod) error { - //TODO: deprecate - return nil -} - -func (s *session) checkSupportedCapabilities(cl *capability.List) error { - for _, c := range cl.All() { - if !s.caps.Supports(c) { - return fmt.Errorf("unsupported capability: %s", c) - } - } - - return nil -} - -type upSession struct { - session -} - -func (s *upSession) AdvertisedReferences() (*packp.AdvRefs, error) { - return s.AdvertisedReferencesContext(context.TODO()) -} - -func (s *upSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { - ar := packp.NewAdvRefs() - - if err := s.setSupportedCapabilities(ar.Capabilities); err != nil { - return nil, err - } - - s.caps = ar.Capabilities - - if err := setReferences(s.storer, ar); err != nil { - return nil, err - } - - if err := setHEAD(s.storer, ar); err != nil { - return nil, err - } - - if s.asClient && len(ar.References) == 0 { - return nil, transport.ErrEmptyRemoteRepository - } - - return ar, nil -} - -func (s *upSession) UploadPack(ctx context.Context, req *packp.UploadPackRequest) (*packp.UploadPackResponse, error) { - if req.IsEmpty() { - return nil, transport.ErrEmptyUploadPackRequest - } - - if err := req.Validate(); err != nil { - return nil, err - } - - if s.caps == nil { - s.caps = capability.NewList() - if err := s.setSupportedCapabilities(s.caps); err != nil { - return nil, err - } - } - - if err := s.checkSupportedCapabilities(req.Capabilities); err != nil { - return nil, err - } - - s.caps = req.Capabilities - - if len(req.Shallows) > 0 { - return nil, fmt.Errorf("shallow not supported") - } - - objs, err := s.objectsToUpload(req) - if err != nil { - return nil, err - } - - pr, pw := io.Pipe() - e := packfile.NewEncoder(pw, s.storer, false) - go func() { - // TODO: plumb through a pack window. - _, err := e.Encode(objs, 10) - pw.CloseWithError(err) - }() - - return packp.NewUploadPackResponseWithPackfile(req, - ioutil.NewContextReadCloser(ctx, pr), - ), nil -} - -func (s *upSession) objectsToUpload(req *packp.UploadPackRequest) ([]plumbing.Hash, error) { - haves, err := revlist.Objects(s.storer, req.Haves, nil) - if err != nil { - return nil, err - } - - return revlist.Objects(s.storer, req.Wants, haves) -} - -func (*upSession) setSupportedCapabilities(c *capability.List) error { - if err := c.Set(capability.Agent, capability.DefaultAgent()); err != nil { - return err - } - - if err := c.Set(capability.OFSDelta); err != nil { - return err - } - - return nil -} - -type rpSession struct { - session - cmdStatus map[plumbing.ReferenceName]error - firstErr error - unpackErr error -} - -func (s *rpSession) AdvertisedReferences() (*packp.AdvRefs, error) { - return s.AdvertisedReferencesContext(context.TODO()) -} - -func (s *rpSession) AdvertisedReferencesContext(ctx context.Context) (*packp.AdvRefs, error) { - ar := packp.NewAdvRefs() - - if err := s.setSupportedCapabilities(ar.Capabilities); err != nil { - return nil, err - } - - s.caps = ar.Capabilities - - if err := setReferences(s.storer, ar); err != nil { - return nil, err - } - - if err := setHEAD(s.storer, ar); err != nil { - return nil, err - } - - return ar, nil -} - -var ( - ErrUpdateReference = errors.New("failed to update ref") -) - -func (s *rpSession) ReceivePack(ctx context.Context, req *packp.ReferenceUpdateRequest) (*packp.ReportStatus, error) { - if s.caps == nil { - s.caps = capability.NewList() - if err := s.setSupportedCapabilities(s.caps); err != nil { - return nil, err - } - } - - if err := s.checkSupportedCapabilities(req.Capabilities); err != nil { - return nil, err - } - - s.caps = req.Capabilities - - //TODO: Implement 'atomic' update of references. - - if req.Packfile != nil { - r := ioutil.NewContextReadCloser(ctx, req.Packfile) - if err := s.writePackfile(r); err != nil { - s.unpackErr = err - s.firstErr = err - return s.reportStatus(), err - } - } - - s.updateReferences(req) - return s.reportStatus(), s.firstErr -} - -func (s *rpSession) updateReferences(req *packp.ReferenceUpdateRequest) { - for _, cmd := range req.Commands { - exists, err := referenceExists(s.storer, cmd.Name) - if err != nil { - s.setStatus(cmd.Name, err) - continue - } - - switch cmd.Action() { - case packp.Create: - if exists { - s.setStatus(cmd.Name, ErrUpdateReference) - continue - } - - ref := plumbing.NewHashReference(cmd.Name, cmd.New) - err := s.storer.SetReference(ref) - s.setStatus(cmd.Name, err) - case packp.Delete: - if !exists { - s.setStatus(cmd.Name, ErrUpdateReference) - continue - } - - err := s.storer.RemoveReference(cmd.Name) - s.setStatus(cmd.Name, err) - case packp.Update: - if !exists { - s.setStatus(cmd.Name, ErrUpdateReference) - continue - } - - ref := plumbing.NewHashReference(cmd.Name, cmd.New) - err := s.storer.SetReference(ref) - s.setStatus(cmd.Name, err) - } - } -} - -func (s *rpSession) writePackfile(r io.ReadCloser) error { - if r == nil { - return nil - } - - if err := packfile.UpdateObjectStorage(s.storer, r); err != nil { - _ = r.Close() - return err - } - - return r.Close() -} - -func (s *rpSession) setStatus(ref plumbing.ReferenceName, err error) { - s.cmdStatus[ref] = err - if s.firstErr == nil && err != nil { - s.firstErr = err - } -} - -func (s *rpSession) reportStatus() *packp.ReportStatus { - if !s.caps.Supports(capability.ReportStatus) { - return nil - } - - rs := packp.NewReportStatus() - rs.UnpackStatus = "ok" - - if s.unpackErr != nil { - rs.UnpackStatus = s.unpackErr.Error() - } - - if s.cmdStatus == nil { - return rs - } - - for ref, err := range s.cmdStatus { - msg := "ok" - if err != nil { - msg = err.Error() - } - status := &packp.CommandStatus{ - ReferenceName: ref, - Status: msg, - } - rs.CommandStatuses = append(rs.CommandStatuses, status) - } - - return rs -} - -func (*rpSession) setSupportedCapabilities(c *capability.List) error { - if err := c.Set(capability.Agent, capability.DefaultAgent()); err != nil { - return err - } - - if err := c.Set(capability.OFSDelta); err != nil { - return err - } - - if err := c.Set(capability.DeleteRefs); err != nil { - return err - } - - return c.Set(capability.ReportStatus) -} - -func setHEAD(s storer.Storer, ar *packp.AdvRefs) error { - ref, err := s.Reference(plumbing.HEAD) - if err == plumbing.ErrReferenceNotFound { - return nil - } - - if err != nil { - return err - } - - if ref.Type() == plumbing.SymbolicReference { - if err := ar.AddReference(ref); err != nil { - return nil - } - - ref, err = storer.ResolveReference(s, ref.Target()) - if err == plumbing.ErrReferenceNotFound { - return nil - } - - if err != nil { - return err - } - } - - if ref.Type() != plumbing.HashReference { - return plumbing.ErrInvalidType - } - - h := ref.Hash() - ar.Head = &h - - return nil -} - -func setReferences(s storer.Storer, ar *packp.AdvRefs) error { - //TODO: add peeled references. - iter, err := s.IterReferences() - if err != nil { - return err - } - - return iter.ForEach(func(ref *plumbing.Reference) error { - if ref.Type() != plumbing.HashReference { - return nil - } - - ar.References[ref.Name().String()] = ref.Hash() - return nil - }) -} - -func referenceExists(s storer.ReferenceStorer, n plumbing.ReferenceName) (bool, error) { - _, err := s.Reference(n) - if err == plumbing.ErrReferenceNotFound { - return false, nil - } - - return err == nil, err -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/auth_method.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/auth_method.go deleted file mode 100644 index ac4e3583c8..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/auth_method.go +++ /dev/null @@ -1,313 +0,0 @@ -package ssh - -import ( - "errors" - "fmt" - "os" - "os/user" - "path/filepath" - - "github.com/go-git/go-git/v5/plumbing/transport" - - "github.com/skeema/knownhosts" - sshagent "github.com/xanzy/ssh-agent" - "golang.org/x/crypto/ssh" -) - -const DefaultUsername = "git" - -// AuthMethod is the interface all auth methods for the ssh client -// must implement. The clientConfig method returns the ssh client -// configuration needed to establish an ssh connection. -type AuthMethod interface { - transport.AuthMethod - // ClientConfig should return a valid ssh.ClientConfig to be used to create - // a connection to the SSH server. - ClientConfig() (*ssh.ClientConfig, error) -} - -// The names of the AuthMethod implementations. To be returned by the -// Name() method. Most git servers only allow PublicKeysName and -// PublicKeysCallbackName. -const ( - KeyboardInteractiveName = "ssh-keyboard-interactive" - PasswordName = "ssh-password" - PasswordCallbackName = "ssh-password-callback" - PublicKeysName = "ssh-public-keys" - PublicKeysCallbackName = "ssh-public-key-callback" -) - -// KeyboardInteractive implements AuthMethod by using a -// prompt/response sequence controlled by the server. -type KeyboardInteractive struct { - User string - Challenge ssh.KeyboardInteractiveChallenge - HostKeyCallbackHelper -} - -func (a *KeyboardInteractive) Name() string { - return KeyboardInteractiveName -} - -func (a *KeyboardInteractive) String() string { - return fmt.Sprintf("user: %s, name: %s", a.User, a.Name()) -} - -func (a *KeyboardInteractive) ClientConfig() (*ssh.ClientConfig, error) { - return a.SetHostKeyCallback(&ssh.ClientConfig{ - User: a.User, - Auth: []ssh.AuthMethod{ - a.Challenge, - }, - }) -} - -// Password implements AuthMethod by using the given password. -type Password struct { - User string - Password string - HostKeyCallbackHelper -} - -func (a *Password) Name() string { - return PasswordName -} - -func (a *Password) String() string { - return fmt.Sprintf("user: %s, name: %s", a.User, a.Name()) -} - -func (a *Password) ClientConfig() (*ssh.ClientConfig, error) { - return a.SetHostKeyCallback(&ssh.ClientConfig{ - User: a.User, - Auth: []ssh.AuthMethod{ssh.Password(a.Password)}, - }) -} - -// PasswordCallback implements AuthMethod by using a callback -// to fetch the password. -type PasswordCallback struct { - User string - Callback func() (pass string, err error) - HostKeyCallbackHelper -} - -func (a *PasswordCallback) Name() string { - return PasswordCallbackName -} - -func (a *PasswordCallback) String() string { - return fmt.Sprintf("user: %s, name: %s", a.User, a.Name()) -} - -func (a *PasswordCallback) ClientConfig() (*ssh.ClientConfig, error) { - return a.SetHostKeyCallback(&ssh.ClientConfig{ - User: a.User, - Auth: []ssh.AuthMethod{ssh.PasswordCallback(a.Callback)}, - }) -} - -// PublicKeys implements AuthMethod by using the given key pairs. -type PublicKeys struct { - User string - Signer ssh.Signer - HostKeyCallbackHelper -} - -// NewPublicKeys returns a PublicKeys from a PEM encoded private key. An -// encryption password should be given if the pemBytes contains a password -// encrypted PEM block otherwise password should be empty. It supports RSA -// (PKCS#1), PKCS#8, DSA (OpenSSL), and ECDSA private keys. -func NewPublicKeys(user string, pemBytes []byte, password string) (*PublicKeys, error) { - signer, err := ssh.ParsePrivateKey(pemBytes) - if _, ok := err.(*ssh.PassphraseMissingError); ok { - signer, err = ssh.ParsePrivateKeyWithPassphrase(pemBytes, []byte(password)) - } - if err != nil { - return nil, err - } - return &PublicKeys{User: user, Signer: signer}, nil -} - -// NewPublicKeysFromFile returns a PublicKeys from a file containing a PEM -// encoded private key. An encryption password should be given if the pemBytes -// contains a password encrypted PEM block otherwise password should be empty. -func NewPublicKeysFromFile(user, pemFile, password string) (*PublicKeys, error) { - bytes, err := os.ReadFile(pemFile) - if err != nil { - return nil, err - } - - return NewPublicKeys(user, bytes, password) -} - -func (a *PublicKeys) Name() string { - return PublicKeysName -} - -func (a *PublicKeys) String() string { - return fmt.Sprintf("user: %s, name: %s", a.User, a.Name()) -} - -func (a *PublicKeys) ClientConfig() (*ssh.ClientConfig, error) { - return a.SetHostKeyCallback(&ssh.ClientConfig{ - User: a.User, - Auth: []ssh.AuthMethod{ssh.PublicKeys(a.Signer)}, - }) -} - -func username() (string, error) { - var username string - if user, err := user.Current(); err == nil { - username = user.Username - } else { - username = os.Getenv("USER") - } - - if username == "" { - return "", errors.New("failed to get username") - } - - return username, nil -} - -// PublicKeysCallback implements AuthMethod by asking a -// ssh.agent.Agent to act as a signer. -type PublicKeysCallback struct { - User string - Callback func() (signers []ssh.Signer, err error) - HostKeyCallbackHelper -} - -// NewSSHAgentAuth returns a PublicKeysCallback based on a SSH agent, it opens -// a pipe with the SSH agent and uses the pipe as the implementer of the public -// key callback function. -func NewSSHAgentAuth(u string) (*PublicKeysCallback, error) { - var err error - if u == "" { - u, err = username() - if err != nil { - return nil, err - } - } - - a, _, err := sshagent.New() - if err != nil { - return nil, fmt.Errorf("error creating SSH agent: %q", err) - } - - return &PublicKeysCallback{ - User: u, - Callback: a.Signers, - }, nil -} - -func (a *PublicKeysCallback) Name() string { - return PublicKeysCallbackName -} - -func (a *PublicKeysCallback) String() string { - return fmt.Sprintf("user: %s, name: %s", a.User, a.Name()) -} - -func (a *PublicKeysCallback) ClientConfig() (*ssh.ClientConfig, error) { - return a.SetHostKeyCallback(&ssh.ClientConfig{ - User: a.User, - Auth: []ssh.AuthMethod{ssh.PublicKeysCallback(a.Callback)}, - }) -} - -// NewKnownHostsCallback returns ssh.HostKeyCallback based on a file based on a -// known_hosts file. http://man.openbsd.org/sshd#SSH_KNOWN_HOSTS_FILE_FORMAT -// -// If list of files is empty, then it will be read from the SSH_KNOWN_HOSTS -// environment variable, example: -// -// /home/foo/custom_known_hosts_file:/etc/custom_known/hosts_file -// -// If SSH_KNOWN_HOSTS is not set the following file locations will be used: -// -// ~/.ssh/known_hosts -// /etc/ssh/ssh_known_hosts -func NewKnownHostsCallback(files ...string) (ssh.HostKeyCallback, error) { - kh, err := newKnownHosts(files...) - return ssh.HostKeyCallback(kh), err -} - -func newKnownHosts(files ...string) (knownhosts.HostKeyCallback, error) { - var err error - - if len(files) == 0 { - if files, err = getDefaultKnownHostsFiles(); err != nil { - return nil, err - } - } - - if files, err = filterKnownHostsFiles(files...); err != nil { - return nil, err - } - - return knownhosts.New(files...) -} - -func getDefaultKnownHostsFiles() ([]string, error) { - files := filepath.SplitList(os.Getenv("SSH_KNOWN_HOSTS")) - if len(files) != 0 { - return files, nil - } - - homeDirPath, err := os.UserHomeDir() - if err != nil { - return nil, err - } - - return []string{ - filepath.Join(homeDirPath, "/.ssh/known_hosts"), - "/etc/ssh/ssh_known_hosts", - }, nil -} - -func filterKnownHostsFiles(files ...string) ([]string, error) { - var out []string - for _, file := range files { - _, err := os.Stat(file) - if err == nil { - out = append(out, file) - continue - } - - if !os.IsNotExist(err) { - return nil, err - } - } - - if len(out) == 0 { - return nil, fmt.Errorf("unable to find any valid known_hosts file, set SSH_KNOWN_HOSTS env variable") - } - - return out, nil -} - -// HostKeyCallbackHelper is a helper that provides common functionality to -// configure HostKeyCallback into a ssh.ClientConfig. -type HostKeyCallbackHelper struct { - // HostKeyCallback is the function type used for verifying server keys. - // If nil default callback will be create using NewKnownHostsCallback - // without argument. - HostKeyCallback ssh.HostKeyCallback -} - -// SetHostKeyCallback sets the field HostKeyCallback in the given cfg. If -// HostKeyCallback is empty a default callback is created using -// NewKnownHostsCallback. -func (m *HostKeyCallbackHelper) SetHostKeyCallback(cfg *ssh.ClientConfig) (*ssh.ClientConfig, error) { - var err error - if m.HostKeyCallback == nil { - if m.HostKeyCallback, err = NewKnownHostsCallback(); err != nil { - return cfg, err - } - } - - cfg.HostKeyCallback = m.HostKeyCallback - return cfg, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/common.go b/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/common.go deleted file mode 100644 index 46fda73fa4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/plumbing/transport/ssh/common.go +++ /dev/null @@ -1,274 +0,0 @@ -// Package ssh implements the SSH transport protocol. -package ssh - -import ( - "context" - "fmt" - "net" - "reflect" - "strconv" - "strings" - - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/internal/common" - "github.com/skeema/knownhosts" - - "github.com/kevinburke/ssh_config" - "golang.org/x/crypto/ssh" - "golang.org/x/net/proxy" -) - -// DefaultClient is the default SSH client. -var DefaultClient = NewClient(nil) - -// DefaultSSHConfig is the reader used to access parameters stored in the -// system's ssh_config files. If nil all the ssh_config are ignored. -var DefaultSSHConfig sshConfig = ssh_config.DefaultUserSettings - -type sshConfig interface { - Get(alias, key string) string -} - -// NewClient creates a new SSH client with an optional *ssh.ClientConfig. -func NewClient(config *ssh.ClientConfig) transport.Transport { - return common.NewClient(&runner{config: config}) -} - -// DefaultAuthBuilder is the function used to create a default AuthMethod, when -// the user doesn't provide any. -var DefaultAuthBuilder = func(user string) (AuthMethod, error) { - return NewSSHAgentAuth(user) -} - -const DefaultPort = 22 - -type runner struct { - config *ssh.ClientConfig -} - -func (r *runner) Command(cmd string, ep *transport.Endpoint, auth transport.AuthMethod) (common.Command, error) { - c := &command{command: cmd, endpoint: ep, config: r.config} - if auth != nil { - c.setAuth(auth) - } - - if err := c.connect(); err != nil { - return nil, err - } - return c, nil -} - -type command struct { - *ssh.Session - connected bool - command string - endpoint *transport.Endpoint - client *ssh.Client - auth AuthMethod - config *ssh.ClientConfig -} - -func (c *command) setAuth(auth transport.AuthMethod) error { - a, ok := auth.(AuthMethod) - if !ok { - return transport.ErrInvalidAuthMethod - } - - c.auth = a - return nil -} - -func (c *command) Start() error { - return c.Session.Start(endpointToCommand(c.command, c.endpoint)) -} - -// Close closes the SSH session and connection. -func (c *command) Close() error { - if !c.connected { - return nil - } - - c.connected = false - - //XXX: If did read the full packfile, then the session might be already - // closed. - _ = c.Session.Close() - err := c.client.Close() - - //XXX: in go1.16+ we can use errors.Is(err, net.ErrClosed) - if err != nil && strings.HasSuffix(err.Error(), "use of closed network connection") { - return nil - } - - return err -} - -// connect connects to the SSH server, unless a AuthMethod was set with -// SetAuth method, by default uses an auth method based on PublicKeysCallback, -// it connects to a SSH agent, using the address stored in the SSH_AUTH_SOCK -// environment var. -func (c *command) connect() error { - if c.connected { - return transport.ErrAlreadyConnected - } - - if c.auth == nil { - if err := c.setAuthFromEndpoint(); err != nil { - return err - } - } - - var err error - config, err := c.auth.ClientConfig() - if err != nil { - return err - } - hostWithPort := c.getHostWithPort() - if config.HostKeyCallback == nil { - kh, err := newKnownHosts() - if err != nil { - return err - } - config.HostKeyCallback = kh.HostKeyCallback() - config.HostKeyAlgorithms = kh.HostKeyAlgorithms(hostWithPort) - } else if len(config.HostKeyAlgorithms) == 0 { - // Set the HostKeyAlgorithms based on HostKeyCallback. - // For background see https://github.com/go-git/go-git/issues/411 as well as - // https://github.com/golang/go/issues/29286 for root cause. - config.HostKeyAlgorithms = knownhosts.HostKeyAlgorithms(config.HostKeyCallback, hostWithPort) - } - - overrideConfig(c.config, config) - - c.client, err = dial("tcp", hostWithPort, c.endpoint.Proxy, config) - if err != nil { - return err - } - - c.Session, err = c.client.NewSession() - if err != nil { - _ = c.client.Close() - return err - } - - c.connected = true - return nil -} - -func dial(network, addr string, proxyOpts transport.ProxyOptions, config *ssh.ClientConfig) (*ssh.Client, error) { - var ( - ctx = context.Background() - cancel context.CancelFunc - ) - if config.Timeout > 0 { - ctx, cancel = context.WithTimeout(ctx, config.Timeout) - } else { - ctx, cancel = context.WithCancel(ctx) - } - defer cancel() - - var conn net.Conn - var dialErr error - - if proxyOpts.URL != "" { - proxyUrl, err := proxyOpts.FullURL() - if err != nil { - return nil, err - } - dialer, err := proxy.FromURL(proxyUrl, proxy.Direct) - if err != nil { - return nil, err - } - - // Try to use a ContextDialer, but fall back to a Dialer if that goes south. - ctxDialer, ok := dialer.(proxy.ContextDialer) - if !ok { - return nil, fmt.Errorf("expected ssh proxy dialer to be of type %s; got %s", - reflect.TypeOf(ctxDialer), reflect.TypeOf(dialer)) - } - conn, dialErr = ctxDialer.DialContext(ctx, "tcp", addr) - } else { - conn, dialErr = proxy.Dial(ctx, network, addr) - } - if dialErr != nil { - return nil, dialErr - } - - c, chans, reqs, err := ssh.NewClientConn(conn, addr, config) - if err != nil { - return nil, err - } - return ssh.NewClient(c, chans, reqs), nil -} - -func (c *command) getHostWithPort() string { - if addr, found := c.doGetHostWithPortFromSSHConfig(); found { - return addr - } - - host := c.endpoint.Host - port := c.endpoint.Port - if port <= 0 { - port = DefaultPort - } - - return net.JoinHostPort(host, strconv.Itoa(port)) -} - -func (c *command) doGetHostWithPortFromSSHConfig() (addr string, found bool) { - if DefaultSSHConfig == nil { - return - } - - host := c.endpoint.Host - port := c.endpoint.Port - - configHost := DefaultSSHConfig.Get(c.endpoint.Host, "Hostname") - if configHost != "" { - host = configHost - found = true - } - - if !found { - return - } - - configPort := DefaultSSHConfig.Get(c.endpoint.Host, "Port") - if configPort != "" { - if i, err := strconv.Atoi(configPort); err == nil { - port = i - } - } - - addr = net.JoinHostPort(host, strconv.Itoa(port)) - return -} - -func (c *command) setAuthFromEndpoint() error { - var err error - c.auth, err = DefaultAuthBuilder(c.endpoint.User) - return err -} - -func endpointToCommand(cmd string, ep *transport.Endpoint) string { - return fmt.Sprintf("%s '%s'", cmd, ep.Path) -} - -func overrideConfig(overrides *ssh.ClientConfig, c *ssh.ClientConfig) { - if overrides == nil { - return - } - - t := reflect.TypeOf(*c) - vc := reflect.ValueOf(c).Elem() - vo := reflect.ValueOf(overrides).Elem() - - for i := 0; i < t.NumField(); i++ { - f := t.Field(i) - vcf := vc.FieldByName(f.Name) - vof := vo.FieldByName(f.Name) - vcf.Set(vof) - } - - *c = vc.Interface().(ssh.ClientConfig) -} diff --git a/vendor/github.com/go-git/go-git/v5/prune.go b/vendor/github.com/go-git/go-git/v5/prune.go deleted file mode 100644 index 8e35b994e7..0000000000 --- a/vendor/github.com/go-git/go-git/v5/prune.go +++ /dev/null @@ -1,66 +0,0 @@ -package git - -import ( - "errors" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -type PruneHandler func(unreferencedObjectHash plumbing.Hash) error -type PruneOptions struct { - // OnlyObjectsOlderThan if set to non-zero value - // selects only objects older than the time provided. - OnlyObjectsOlderThan time.Time - // Handler is called on matching objects - Handler PruneHandler -} - -var ErrLooseObjectsNotSupported = errors.New("loose objects not supported") - -// DeleteObject deletes an object from a repository. -// The type conveniently matches PruneHandler. -func (r *Repository) DeleteObject(hash plumbing.Hash) error { - los, ok := r.Storer.(storer.LooseObjectStorer) - if !ok { - return ErrLooseObjectsNotSupported - } - - return los.DeleteLooseObject(hash) -} - -func (r *Repository) Prune(opt PruneOptions) error { - los, ok := r.Storer.(storer.LooseObjectStorer) - if !ok { - return ErrLooseObjectsNotSupported - } - - pw := newObjectWalker(r.Storer) - err := pw.walkAllRefs() - if err != nil { - return err - } - // Now walk all (loose) objects in storage. - return los.ForEachObjectHash(func(hash plumbing.Hash) error { - // Get out if we have seen this object. - if pw.isSeen(hash) { - return nil - } - // Otherwise it is a candidate for pruning. - // Check out for too new objects next. - if !opt.OnlyObjectsOlderThan.IsZero() { - // Errors here are non-fatal. The object may be e.g. packed. - // Or concurrently deleted. Skip such objects. - t, err := los.LooseObjectTime(hash) - if err != nil { - return nil - } - // Skip too new objects. - if !t.Before(opt.OnlyObjectsOlderThan) { - return nil - } - } - return opt.Handler(hash) - }) -} diff --git a/vendor/github.com/go-git/go-git/v5/remote.go b/vendor/github.com/go-git/go-git/v5/remote.go deleted file mode 100644 index 0cb70bc009..0000000000 --- a/vendor/github.com/go-git/go-git/v5/remote.go +++ /dev/null @@ -1,1499 +0,0 @@ -package git - -import ( - "context" - "errors" - "fmt" - "io" - "strings" - "time" - - "github.com/go-git/go-billy/v5/osfs" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/internal/url" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/protocol/packp" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" - "github.com/go-git/go-git/v5/plumbing/protocol/packp/sideband" - "github.com/go-git/go-git/v5/plumbing/revlist" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/client" - "github.com/go-git/go-git/v5/storage" - "github.com/go-git/go-git/v5/storage/filesystem" - "github.com/go-git/go-git/v5/storage/memory" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -var ( - NoErrAlreadyUpToDate = errors.New("already up-to-date") - ErrDeleteRefNotSupported = errors.New("server does not support delete-refs") - ErrForceNeeded = errors.New("some refs were not updated") - ErrExactSHA1NotSupported = errors.New("server does not support exact SHA1 refspec") - ErrEmptyUrls = errors.New("URLs cannot be empty") -) - -type NoMatchingRefSpecError struct { - refSpec config.RefSpec -} - -func (e NoMatchingRefSpecError) Error() string { - return fmt.Sprintf("couldn't find remote ref %q", e.refSpec.Src()) -} - -func (e NoMatchingRefSpecError) Is(target error) bool { - _, ok := target.(NoMatchingRefSpecError) - return ok -} - -const ( - // This describes the maximum number of commits to walk when - // computing the haves to send to a server, for each ref in the - // repo containing this remote, when not using the multi-ack - // protocol. Setting this to 0 means there is no limit. - maxHavesToVisitPerRef = 100 - - // peeledSuffix is the suffix used to build peeled reference names. - peeledSuffix = "^{}" -) - -// Remote represents a connection to a remote repository. -type Remote struct { - c *config.RemoteConfig - s storage.Storer -} - -// NewRemote creates a new Remote. -// The intended purpose is to use the Remote for tasks such as listing remote references (like using git ls-remote). -// Otherwise Remotes should be created via the use of a Repository. -func NewRemote(s storage.Storer, c *config.RemoteConfig) *Remote { - return &Remote{s: s, c: c} -} - -// Config returns the RemoteConfig object used to instantiate this Remote. -func (r *Remote) Config() *config.RemoteConfig { - return r.c -} - -func (r *Remote) String() string { - var fetch, push string - if len(r.c.URLs) > 0 { - fetch = r.c.URLs[0] - push = r.c.URLs[0] - } - - return fmt.Sprintf("%s\t%s (fetch)\n%[1]s\t%[3]s (push)", r.c.Name, fetch, push) -} - -// Push performs a push to the remote. Returns NoErrAlreadyUpToDate if the -// remote was already up-to-date. -func (r *Remote) Push(o *PushOptions) error { - return r.PushContext(context.Background(), o) -} - -// PushContext performs a push to the remote. Returns NoErrAlreadyUpToDate if -// the remote was already up-to-date. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (r *Remote) PushContext(ctx context.Context, o *PushOptions) (err error) { - if err := o.Validate(); err != nil { - return err - } - - if o.RemoteName != r.c.Name { - return fmt.Errorf("remote names don't match: %s != %s", o.RemoteName, r.c.Name) - } - - if o.RemoteURL == "" { - o.RemoteURL = r.c.URLs[0] - } - - s, err := newSendPackSession(o.RemoteURL, o.Auth, o.InsecureSkipTLS, o.CABundle, o.ProxyOptions) - if err != nil { - return err - } - - defer ioutil.CheckClose(s, &err) - - ar, err := s.AdvertisedReferencesContext(ctx) - if err != nil { - return err - } - - remoteRefs, err := ar.AllReferences() - if err != nil { - return err - } - - if err := r.checkRequireRemoteRefs(o.RequireRemoteRefs, remoteRefs); err != nil { - return err - } - - isDelete := false - allDelete := true - for _, rs := range o.RefSpecs { - if rs.IsDelete() { - isDelete = true - } else { - allDelete = false - } - if isDelete && !allDelete { - break - } - } - - if isDelete && !ar.Capabilities.Supports(capability.DeleteRefs) { - return ErrDeleteRefNotSupported - } - - if o.Force { - for i := 0; i < len(o.RefSpecs); i++ { - rs := &o.RefSpecs[i] - if !rs.IsForceUpdate() && !rs.IsDelete() { - o.RefSpecs[i] = config.RefSpec("+" + rs.String()) - } - } - } - - localRefs, err := r.references() - if err != nil { - return err - } - - req, err := r.newReferenceUpdateRequest(o, localRefs, remoteRefs, ar) - if err != nil { - return err - } - - if len(req.Commands) == 0 { - return NoErrAlreadyUpToDate - } - - objects := objectsToPush(req.Commands) - - haves, err := referencesToHashes(remoteRefs) - if err != nil { - return err - } - - stop, err := r.s.Shallow() - if err != nil { - return err - } - - // if we have shallow we should include this as part of the objects that - // we are aware. - haves = append(haves, stop...) - - var hashesToPush []plumbing.Hash - // Avoid the expensive revlist operation if we're only doing deletes. - if !allDelete { - if url.IsLocalEndpoint(o.RemoteURL) { - // If we're are pushing to a local repo, it might be much - // faster to use a local storage layer to get the commits - // to ignore, when calculating the object revlist. - localStorer := filesystem.NewStorage( - osfs.New(o.RemoteURL), cache.NewObjectLRUDefault()) - hashesToPush, err = revlist.ObjectsWithStorageForIgnores( - r.s, localStorer, objects, haves) - } else { - hashesToPush, err = revlist.Objects(r.s, objects, haves) - } - if err != nil { - return err - } - } - - if len(hashesToPush) == 0 { - allDelete = true - for _, command := range req.Commands { - if command.Action() != packp.Delete { - allDelete = false - break - } - } - } - - rs, err := pushHashes(ctx, s, r.s, req, hashesToPush, r.useRefDeltas(ar), allDelete) - if err != nil { - return err - } - - if rs != nil { - if err = rs.Error(); err != nil { - return err - } - } - - return r.updateRemoteReferenceStorage(req) -} - -func (r *Remote) useRefDeltas(ar *packp.AdvRefs) bool { - return !ar.Capabilities.Supports(capability.OFSDelta) -} - -func (r *Remote) addReachableTags(localRefs []*plumbing.Reference, remoteRefs storer.ReferenceStorer, req *packp.ReferenceUpdateRequest) error { - tags := make(map[plumbing.Reference]struct{}) - // get a list of all tags locally - for _, ref := range localRefs { - if strings.HasPrefix(string(ref.Name()), "refs/tags") { - tags[*ref] = struct{}{} - } - } - - remoteRefIter, err := remoteRefs.IterReferences() - if err != nil { - return err - } - - // remove any that are already on the remote - if err := remoteRefIter.ForEach(func(reference *plumbing.Reference) error { - delete(tags, *reference) - return nil - }); err != nil { - return err - } - - for tag := range tags { - tagObject, err := object.GetObject(r.s, tag.Hash()) - var tagCommit *object.Commit - if err != nil { - return fmt.Errorf("get tag object: %w", err) - } - - if tagObject.Type() != plumbing.TagObject { - continue - } - - annotatedTag, ok := tagObject.(*object.Tag) - if !ok { - return errors.New("could not get annotated tag object") - } - - tagCommit, err = object.GetCommit(r.s, annotatedTag.Target) - if err != nil { - return fmt.Errorf("get annotated tag commit: %w", err) - } - - // only include tags that are reachable from one of the refs - // already being pushed - for _, cmd := range req.Commands { - if tag.Name() == cmd.Name { - continue - } - - if strings.HasPrefix(cmd.Name.String(), "refs/tags") { - continue - } - - c, err := object.GetCommit(r.s, cmd.New) - if err != nil { - return fmt.Errorf("get commit %v: %w", cmd.Name, err) - } - - if isAncestor, err := tagCommit.IsAncestor(c); err == nil && isAncestor { - req.Commands = append(req.Commands, &packp.Command{Name: tag.Name(), New: tag.Hash()}) - } - } - } - - return nil -} - -func (r *Remote) newReferenceUpdateRequest( - o *PushOptions, - localRefs []*plumbing.Reference, - remoteRefs storer.ReferenceStorer, - ar *packp.AdvRefs, -) (*packp.ReferenceUpdateRequest, error) { - req := packp.NewReferenceUpdateRequestFromCapabilities(ar.Capabilities) - - if o.Progress != nil { - req.Progress = o.Progress - if ar.Capabilities.Supports(capability.Sideband64k) { - _ = req.Capabilities.Set(capability.Sideband64k) - } else if ar.Capabilities.Supports(capability.Sideband) { - _ = req.Capabilities.Set(capability.Sideband) - } - } - - if ar.Capabilities.Supports(capability.PushOptions) { - _ = req.Capabilities.Set(capability.PushOptions) - for k, v := range o.Options { - req.Options = append(req.Options, &packp.Option{Key: k, Value: v}) - } - } - - if o.Atomic && ar.Capabilities.Supports(capability.Atomic) { - _ = req.Capabilities.Set(capability.Atomic) - } - - if err := r.addReferencesToUpdate(o.RefSpecs, localRefs, remoteRefs, req, o.Prune, o.ForceWithLease); err != nil { - - return nil, err - } - - if o.FollowTags { - if err := r.addReachableTags(localRefs, remoteRefs, req); err != nil { - return nil, err - } - } - - return req, nil -} - -func (r *Remote) updateRemoteReferenceStorage( - req *packp.ReferenceUpdateRequest, -) error { - - for _, spec := range r.c.Fetch { - for _, c := range req.Commands { - if !spec.Match(c.Name) { - continue - } - - local := spec.Dst(c.Name) - ref := plumbing.NewHashReference(local, c.New) - switch c.Action() { - case packp.Create, packp.Update: - if err := r.s.SetReference(ref); err != nil { - return err - } - case packp.Delete: - if err := r.s.RemoveReference(local); err != nil { - return err - } - } - } - } - - return nil -} - -// FetchContext fetches references along with the objects necessary to complete -// their histories. -// -// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are -// no changes to be fetched, or an error. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (r *Remote) FetchContext(ctx context.Context, o *FetchOptions) error { - _, err := r.fetch(ctx, o) - return err -} - -// Fetch fetches references along with the objects necessary to complete their -// histories. -// -// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are -// no changes to be fetched, or an error. -func (r *Remote) Fetch(o *FetchOptions) error { - return r.FetchContext(context.Background(), o) -} - -func (r *Remote) fetch(ctx context.Context, o *FetchOptions) (sto storer.ReferenceStorer, err error) { - if o.RemoteName == "" { - o.RemoteName = r.c.Name - } - - if err = o.Validate(); err != nil { - return nil, err - } - - if len(o.RefSpecs) == 0 { - o.RefSpecs = r.c.Fetch - } - - if o.RemoteURL == "" { - o.RemoteURL = r.c.URLs[0] - } - - s, err := newUploadPackSession(o.RemoteURL, o.Auth, o.InsecureSkipTLS, o.CABundle, o.ProxyOptions) - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(s, &err) - - ar, err := s.AdvertisedReferencesContext(ctx) - if err != nil { - return nil, err - } - - req, err := r.newUploadPackRequest(o, ar) - if err != nil { - return nil, err - } - - if err := r.isSupportedRefSpec(o.RefSpecs, ar); err != nil { - return nil, err - } - - remoteRefs, err := ar.AllReferences() - if err != nil { - return nil, err - } - - localRefs, err := r.references() - if err != nil { - return nil, err - } - - refs, specToRefs, err := calculateRefs(o.RefSpecs, remoteRefs, o.Tags) - if err != nil { - return nil, err - } - - if !req.Depth.IsZero() { - req.Shallows, err = r.s.Shallow() - if err != nil { - return nil, fmt.Errorf("existing checkout is not shallow") - } - } - - req.Wants, err = getWants(r.s, refs, o.Depth) - if len(req.Wants) > 0 { - req.Haves, err = getHaves(localRefs, remoteRefs, r.s, o.Depth) - if err != nil { - return nil, err - } - - if err = r.fetchPack(ctx, o, s, req); err != nil { - return nil, err - } - } - - updated, err := r.updateLocalReferenceStorage(o.RefSpecs, refs, remoteRefs, specToRefs, o.Tags, o.Force) - if err != nil { - return nil, err - } - - if !updated { - updated, err = depthChanged(req.Shallows, r.s) - if err != nil { - return nil, fmt.Errorf("error checking depth change: %v", err) - } - } - - if !updated { - return remoteRefs, NoErrAlreadyUpToDate - } - - return remoteRefs, nil -} - -func depthChanged(before []plumbing.Hash, s storage.Storer) (bool, error) { - after, err := s.Shallow() - if err != nil { - return false, err - } - - if len(before) != len(after) { - return true, nil - } - - bm := make(map[plumbing.Hash]bool, len(before)) - for _, b := range before { - bm[b] = true - } - for _, a := range after { - if _, ok := bm[a]; !ok { - return true, nil - } - } - - return false, nil -} - -func newUploadPackSession(url string, auth transport.AuthMethod, insecure bool, cabundle []byte, proxyOpts transport.ProxyOptions) (transport.UploadPackSession, error) { - c, ep, err := newClient(url, insecure, cabundle, proxyOpts) - if err != nil { - return nil, err - } - - return c.NewUploadPackSession(ep, auth) -} - -func newSendPackSession(url string, auth transport.AuthMethod, insecure bool, cabundle []byte, proxyOpts transport.ProxyOptions) (transport.ReceivePackSession, error) { - c, ep, err := newClient(url, insecure, cabundle, proxyOpts) - if err != nil { - return nil, err - } - - return c.NewReceivePackSession(ep, auth) -} - -func newClient(url string, insecure bool, cabundle []byte, proxyOpts transport.ProxyOptions) (transport.Transport, *transport.Endpoint, error) { - ep, err := transport.NewEndpoint(url) - if err != nil { - return nil, nil, err - } - ep.InsecureSkipTLS = insecure - ep.CaBundle = cabundle - ep.Proxy = proxyOpts - - c, err := client.NewClient(ep) - if err != nil { - return nil, nil, err - } - - return c, ep, err -} - -func (r *Remote) fetchPack(ctx context.Context, o *FetchOptions, s transport.UploadPackSession, - req *packp.UploadPackRequest) (err error) { - - reader, err := s.UploadPack(ctx, req) - if err != nil { - if errors.Is(err, transport.ErrEmptyUploadPackRequest) { - // XXX: no packfile provided, everything is up-to-date. - return nil - } - return err - } - - defer ioutil.CheckClose(reader, &err) - - if err = r.updateShallow(o, reader); err != nil { - return err - } - - if err = packfile.UpdateObjectStorage(r.s, - buildSidebandIfSupported(req.Capabilities, reader, o.Progress), - ); err != nil { - return err - } - - return err -} - -func (r *Remote) addReferencesToUpdate( - refspecs []config.RefSpec, - localRefs []*plumbing.Reference, - remoteRefs storer.ReferenceStorer, - req *packp.ReferenceUpdateRequest, - prune bool, - forceWithLease *ForceWithLease, -) error { - // This references dictionary will be used to search references by name. - refsDict := make(map[string]*plumbing.Reference) - for _, ref := range localRefs { - refsDict[ref.Name().String()] = ref - } - - for _, rs := range refspecs { - if rs.IsDelete() { - if err := r.deleteReferences(rs, remoteRefs, refsDict, req, false); err != nil { - return err - } - } else { - err := r.addOrUpdateReferences(rs, localRefs, refsDict, remoteRefs, req, forceWithLease) - if err != nil { - return err - } - - if prune { - if err := r.deleteReferences(rs, remoteRefs, refsDict, req, true); err != nil { - return err - } - } - } - } - - return nil -} - -func (r *Remote) addOrUpdateReferences( - rs config.RefSpec, - localRefs []*plumbing.Reference, - refsDict map[string]*plumbing.Reference, - remoteRefs storer.ReferenceStorer, - req *packp.ReferenceUpdateRequest, - forceWithLease *ForceWithLease, -) error { - // If it is not a wildcard refspec we can directly search for the reference - // in the references dictionary. - if !rs.IsWildcard() { - ref, ok := refsDict[rs.Src()] - if !ok { - commit, err := object.GetCommit(r.s, plumbing.NewHash(rs.Src())) - if err == nil { - return r.addCommit(rs, remoteRefs, commit.Hash, req) - } - return nil - } - - return r.addReferenceIfRefSpecMatches(rs, remoteRefs, ref, req, forceWithLease) - } - - for _, ref := range localRefs { - err := r.addReferenceIfRefSpecMatches(rs, remoteRefs, ref, req, forceWithLease) - if err != nil { - return err - } - } - - return nil -} - -func (r *Remote) deleteReferences(rs config.RefSpec, - remoteRefs storer.ReferenceStorer, - refsDict map[string]*plumbing.Reference, - req *packp.ReferenceUpdateRequest, - prune bool) error { - iter, err := remoteRefs.IterReferences() - if err != nil { - return err - } - - return iter.ForEach(func(ref *plumbing.Reference) error { - if ref.Type() != plumbing.HashReference { - return nil - } - - if prune { - rs := rs.Reverse() - if !rs.Match(ref.Name()) { - return nil - } - - if _, ok := refsDict[rs.Dst(ref.Name()).String()]; ok { - return nil - } - } else if rs.Dst("") != ref.Name() { - return nil - } - - cmd := &packp.Command{ - Name: ref.Name(), - Old: ref.Hash(), - New: plumbing.ZeroHash, - } - req.Commands = append(req.Commands, cmd) - return nil - }) -} - -func (r *Remote) addCommit(rs config.RefSpec, - remoteRefs storer.ReferenceStorer, localCommit plumbing.Hash, - req *packp.ReferenceUpdateRequest) error { - - if rs.IsWildcard() { - return errors.New("can't use wildcard together with hash refspecs") - } - - cmd := &packp.Command{ - Name: rs.Dst(""), - Old: plumbing.ZeroHash, - New: localCommit, - } - remoteRef, err := remoteRefs.Reference(cmd.Name) - if err == nil { - if remoteRef.Type() != plumbing.HashReference { - // TODO: check actual git behavior here - return nil - } - - cmd.Old = remoteRef.Hash() - } else if err != plumbing.ErrReferenceNotFound { - return err - } - if cmd.Old == cmd.New { - return nil - } - if !rs.IsForceUpdate() { - if err := checkFastForwardUpdate(r.s, remoteRefs, cmd); err != nil { - return err - } - } - - req.Commands = append(req.Commands, cmd) - return nil -} - -func (r *Remote) addReferenceIfRefSpecMatches(rs config.RefSpec, - remoteRefs storer.ReferenceStorer, localRef *plumbing.Reference, - req *packp.ReferenceUpdateRequest, forceWithLease *ForceWithLease) error { - - if localRef.Type() != plumbing.HashReference { - return nil - } - - if !rs.Match(localRef.Name()) { - return nil - } - - cmd := &packp.Command{ - Name: rs.Dst(localRef.Name()), - Old: plumbing.ZeroHash, - New: localRef.Hash(), - } - - remoteRef, err := remoteRefs.Reference(cmd.Name) - if err == nil { - if remoteRef.Type() != plumbing.HashReference { - // TODO: check actual git behavior here - return nil - } - - cmd.Old = remoteRef.Hash() - } else if err != plumbing.ErrReferenceNotFound { - return err - } - - if cmd.Old == cmd.New { - return nil - } - - if forceWithLease != nil { - if err = r.checkForceWithLease(localRef, cmd, forceWithLease); err != nil { - return err - } - } else if !rs.IsForceUpdate() { - if err := checkFastForwardUpdate(r.s, remoteRefs, cmd); err != nil { - return err - } - } - - req.Commands = append(req.Commands, cmd) - return nil -} - -func (r *Remote) checkForceWithLease(localRef *plumbing.Reference, cmd *packp.Command, forceWithLease *ForceWithLease) error { - remotePrefix := fmt.Sprintf("refs/remotes/%s/", r.Config().Name) - - ref, err := storer.ResolveReference( - r.s, - plumbing.ReferenceName(remotePrefix+strings.Replace(localRef.Name().String(), "refs/heads/", "", -1))) - if err != nil { - return err - } - - if forceWithLease.RefName.String() == "" || (forceWithLease.RefName == cmd.Name) { - expectedOID := ref.Hash() - - if !forceWithLease.Hash.IsZero() { - expectedOID = forceWithLease.Hash - } - - if cmd.Old != expectedOID { - return fmt.Errorf("non-fast-forward update: %s", cmd.Name.String()) - } - } - - return nil -} - -func (r *Remote) references() ([]*plumbing.Reference, error) { - var localRefs []*plumbing.Reference - - iter, err := r.s.IterReferences() - if err != nil { - return nil, err - } - - for { - ref, err := iter.Next() - if err == io.EOF { - break - } - - if err != nil { - return nil, err - } - - localRefs = append(localRefs, ref) - } - - return localRefs, nil -} - -func getRemoteRefsFromStorer(remoteRefStorer storer.ReferenceStorer) ( - map[plumbing.Hash]bool, error) { - remoteRefs := map[plumbing.Hash]bool{} - iter, err := remoteRefStorer.IterReferences() - if err != nil { - return nil, err - } - err = iter.ForEach(func(ref *plumbing.Reference) error { - if ref.Type() != plumbing.HashReference { - return nil - } - remoteRefs[ref.Hash()] = true - return nil - }) - if err != nil { - return nil, err - } - return remoteRefs, nil -} - -// getHavesFromRef populates the given `haves` map with the given -// reference, and up to `maxHavesToVisitPerRef` ancestor commits. -func getHavesFromRef( - ref *plumbing.Reference, - remoteRefs map[plumbing.Hash]bool, - s storage.Storer, - haves map[plumbing.Hash]bool, - depth int, -) error { - h := ref.Hash() - if haves[h] { - return nil - } - - // No need to load the commit if we know the remote already - // has this hash. - if remoteRefs[h] { - haves[h] = true - return nil - } - - commit, err := object.GetCommit(s, h) - if err != nil { - // Ignore the error if this isn't a commit. - haves[ref.Hash()] = true - return nil - } - - // Until go-git supports proper commit negotiation during an - // upload pack request, include up to `maxHavesToVisitPerRef` - // commits from the history of each ref. - walker := object.NewCommitPreorderIter(commit, haves, nil) - toVisit := maxHavesToVisitPerRef - // But only need up to the requested depth - if depth > 0 && depth < maxHavesToVisitPerRef { - toVisit = depth - } - // It is safe to ignore any error here as we are just trying to find the references that we already have - // An example of a legitimate failure is we have a shallow clone and don't have the previous commit(s) - _ = walker.ForEach(func(c *object.Commit) error { - haves[c.Hash] = true - toVisit-- - // If toVisit starts out at 0 (indicating there is no - // max), then it will be negative here and we won't stop - // early. - if toVisit == 0 || remoteRefs[c.Hash] { - return storer.ErrStop - } - return nil - }) - - return nil -} - -func getHaves( - localRefs []*plumbing.Reference, - remoteRefStorer storer.ReferenceStorer, - s storage.Storer, - depth int, -) ([]plumbing.Hash, error) { - haves := map[plumbing.Hash]bool{} - - // Build a map of all the remote references, to avoid loading too - // many parent commits for references we know don't need to be - // transferred. - remoteRefs, err := getRemoteRefsFromStorer(remoteRefStorer) - if err != nil { - return nil, err - } - - for _, ref := range localRefs { - if haves[ref.Hash()] { - continue - } - - if ref.Type() != plumbing.HashReference { - continue - } - - err = getHavesFromRef(ref, remoteRefs, s, haves, depth) - if err != nil { - return nil, err - } - } - - var result []plumbing.Hash - for h := range haves { - result = append(result, h) - } - - return result, nil -} - -const refspecAllTags = "+refs/tags/*:refs/tags/*" - -func calculateRefs( - spec []config.RefSpec, - remoteRefs storer.ReferenceStorer, - tagMode TagMode, -) (memory.ReferenceStorage, [][]*plumbing.Reference, error) { - if tagMode == AllTags { - spec = append(spec, refspecAllTags) - } - - refs := make(memory.ReferenceStorage) - // list of references matched for each spec - specToRefs := make([][]*plumbing.Reference, len(spec)) - for i := range spec { - var err error - specToRefs[i], err = doCalculateRefs(spec[i], remoteRefs, refs) - if err != nil { - return nil, nil, err - } - } - - return refs, specToRefs, nil -} - -func doCalculateRefs( - s config.RefSpec, - remoteRefs storer.ReferenceStorer, - refs memory.ReferenceStorage, -) ([]*plumbing.Reference, error) { - var refList []*plumbing.Reference - - if s.IsExactSHA1() { - ref := plumbing.NewHashReference(s.Dst(""), plumbing.NewHash(s.Src())) - - refList = append(refList, ref) - return refList, refs.SetReference(ref) - } - - var matched bool - onMatched := func(ref *plumbing.Reference) error { - if ref.Type() == plumbing.SymbolicReference { - target, err := storer.ResolveReference(remoteRefs, ref.Name()) - if err != nil { - return err - } - - ref = plumbing.NewHashReference(ref.Name(), target.Hash()) - } - - if ref.Type() != plumbing.HashReference { - return nil - } - - matched = true - refList = append(refList, ref) - return refs.SetReference(ref) - } - - var ret error - if s.IsWildcard() { - iter, err := remoteRefs.IterReferences() - if err != nil { - return nil, err - } - ret = iter.ForEach(func(ref *plumbing.Reference) error { - if !s.Match(ref.Name()) { - return nil - } - - return onMatched(ref) - }) - } else { - var resolvedRef *plumbing.Reference - src := s.Src() - resolvedRef, ret = expand_ref(remoteRefs, plumbing.ReferenceName(src)) - if ret == nil { - ret = onMatched(resolvedRef) - } - } - - if !matched && !s.IsWildcard() { - return nil, NoMatchingRefSpecError{refSpec: s} - } - - return refList, ret -} - -func getWants(localStorer storage.Storer, refs memory.ReferenceStorage, depth int) ([]plumbing.Hash, error) { - // If depth is anything other than 1 and the repo has shallow commits then just because we have the commit - // at the reference doesn't mean that we don't still need to fetch the parents - shallow := false - if depth != 1 { - if s, _ := localStorer.Shallow(); len(s) > 0 { - shallow = true - } - } - - wants := map[plumbing.Hash]bool{} - for _, ref := range refs { - hash := ref.Hash() - exists, err := objectExists(localStorer, ref.Hash()) - if err != nil { - return nil, err - } - - if !exists || shallow { - wants[hash] = true - } - } - - var result []plumbing.Hash - for h := range wants { - result = append(result, h) - } - - return result, nil -} - -func objectExists(s storer.EncodedObjectStorer, h plumbing.Hash) (bool, error) { - _, err := s.EncodedObject(plumbing.AnyObject, h) - if err == plumbing.ErrObjectNotFound { - return false, nil - } - - return true, err -} - -func checkFastForwardUpdate(s storer.EncodedObjectStorer, remoteRefs storer.ReferenceStorer, cmd *packp.Command) error { - if cmd.Old == plumbing.ZeroHash { - _, err := remoteRefs.Reference(cmd.Name) - if err == plumbing.ErrReferenceNotFound { - return nil - } - - if err != nil { - return err - } - - return fmt.Errorf("non-fast-forward update: %s", cmd.Name.String()) - } - - ff, err := isFastForward(s, cmd.Old, cmd.New, nil) - if err != nil { - return err - } - - if !ff { - return fmt.Errorf("non-fast-forward update: %s", cmd.Name.String()) - } - - return nil -} - -func isFastForward(s storer.EncodedObjectStorer, old, new plumbing.Hash, earliestShallow *plumbing.Hash) (bool, error) { - c, err := object.GetCommit(s, new) - if err != nil { - return false, err - } - - parentsToIgnore := []plumbing.Hash{} - if earliestShallow != nil { - earliestCommit, err := object.GetCommit(s, *earliestShallow) - if err != nil { - return false, err - } - - parentsToIgnore = earliestCommit.ParentHashes - } - - found := false - // stop iterating at the earlist shallow commit, ignoring its parents - // note: when pull depth is smaller than the number of new changes on the remote, this fails due to missing parents. - // as far as i can tell, without the commits in-between the shallow pull and the earliest shallow, there's no - // real way of telling whether it will be a fast-forward merge. - iter := object.NewCommitPreorderIter(c, nil, parentsToIgnore) - err = iter.ForEach(func(c *object.Commit) error { - if c.Hash != old { - return nil - } - - found = true - return storer.ErrStop - }) - return found, err -} - -func (r *Remote) newUploadPackRequest(o *FetchOptions, - ar *packp.AdvRefs) (*packp.UploadPackRequest, error) { - - req := packp.NewUploadPackRequestFromCapabilities(ar.Capabilities) - - if o.Depth != 0 { - req.Depth = packp.DepthCommits(o.Depth) - if err := req.Capabilities.Set(capability.Shallow); err != nil { - return nil, err - } - } - - if o.Progress == nil && ar.Capabilities.Supports(capability.NoProgress) { - if err := req.Capabilities.Set(capability.NoProgress); err != nil { - return nil, err - } - } - - isWildcard := true - for _, s := range o.RefSpecs { - if !s.IsWildcard() { - isWildcard = false - break - } - } - - if isWildcard && o.Tags == TagFollowing && ar.Capabilities.Supports(capability.IncludeTag) { - if err := req.Capabilities.Set(capability.IncludeTag); err != nil { - return nil, err - } - } - - return req, nil -} - -func (r *Remote) isSupportedRefSpec(refs []config.RefSpec, ar *packp.AdvRefs) error { - var containsIsExact bool - for _, ref := range refs { - if ref.IsExactSHA1() { - containsIsExact = true - } - } - - if !containsIsExact { - return nil - } - - if ar.Capabilities.Supports(capability.AllowReachableSHA1InWant) || - ar.Capabilities.Supports(capability.AllowTipSHA1InWant) { - return nil - } - - return ErrExactSHA1NotSupported -} - -func buildSidebandIfSupported(l *capability.List, reader io.Reader, p sideband.Progress) io.Reader { - var t sideband.Type - - switch { - case l.Supports(capability.Sideband): - t = sideband.Sideband - case l.Supports(capability.Sideband64k): - t = sideband.Sideband64k - default: - return reader - } - - d := sideband.NewDemuxer(t, reader) - d.Progress = p - - return d -} - -func (r *Remote) updateLocalReferenceStorage( - specs []config.RefSpec, - fetchedRefs, remoteRefs memory.ReferenceStorage, - specToRefs [][]*plumbing.Reference, - tagMode TagMode, - force bool, -) (updated bool, err error) { - isWildcard := true - forceNeeded := false - - for i, spec := range specs { - if !spec.IsWildcard() { - isWildcard = false - } - - for _, ref := range specToRefs[i] { - if ref.Type() != plumbing.HashReference { - continue - } - - localName := spec.Dst(ref.Name()) - // If localName doesn't start with "refs/" then treat as a branch. - if !strings.HasPrefix(localName.String(), "refs/") { - localName = plumbing.NewBranchReferenceName(localName.String()) - } - old, _ := storer.ResolveReference(r.s, localName) - new := plumbing.NewHashReference(localName, ref.Hash()) - - // If the ref exists locally as a non-tag and force is not - // specified, only update if the new ref is an ancestor of the old - if old != nil && !old.Name().IsTag() && !force && !spec.IsForceUpdate() { - ff, err := isFastForward(r.s, old.Hash(), new.Hash(), nil) - if err != nil { - return updated, err - } - - if !ff { - forceNeeded = true - continue - } - } - - refUpdated, err := checkAndUpdateReferenceStorerIfNeeded(r.s, new, old) - if err != nil { - return updated, err - } - - if refUpdated { - updated = true - } - } - } - - if tagMode == NoTags { - return updated, nil - } - - tags := fetchedRefs - if isWildcard { - tags = remoteRefs - } - tagUpdated, err := r.buildFetchedTags(tags) - if err != nil { - return updated, err - } - - if tagUpdated { - updated = true - } - - if forceNeeded { - err = ErrForceNeeded - } - - return -} - -func (r *Remote) buildFetchedTags(refs memory.ReferenceStorage) (updated bool, err error) { - for _, ref := range refs { - if !ref.Name().IsTag() { - continue - } - - _, err := r.s.EncodedObject(plumbing.AnyObject, ref.Hash()) - if err == plumbing.ErrObjectNotFound { - continue - } - - if err != nil { - return false, err - } - - refUpdated, err := updateReferenceStorerIfNeeded(r.s, ref) - if err != nil { - return updated, err - } - - if refUpdated { - updated = true - } - } - - return -} - -// List the references on the remote repository. -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects to the -// transport operations. -func (r *Remote) ListContext(ctx context.Context, o *ListOptions) (rfs []*plumbing.Reference, err error) { - return r.list(ctx, o) -} - -func (r *Remote) List(o *ListOptions) (rfs []*plumbing.Reference, err error) { - timeout := o.Timeout - // Default to the old hardcoded 10s value if a timeout is not explicitly set. - if timeout == 0 { - timeout = 10 - } - if timeout < 0 { - return nil, fmt.Errorf("invalid timeout: %d", timeout) - } - ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second) - defer cancel() - return r.ListContext(ctx, o) -} - -func (r *Remote) list(ctx context.Context, o *ListOptions) (rfs []*plumbing.Reference, err error) { - if r.c == nil || len(r.c.URLs) == 0 { - return nil, ErrEmptyUrls - } - - s, err := newUploadPackSession(r.c.URLs[0], o.Auth, o.InsecureSkipTLS, o.CABundle, o.ProxyOptions) - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(s, &err) - - ar, err := s.AdvertisedReferencesContext(ctx) - if err != nil { - return nil, err - } - - allRefs, err := ar.AllReferences() - if err != nil { - return nil, err - } - - refs, err := allRefs.IterReferences() - if err != nil { - return nil, err - } - - var resultRefs []*plumbing.Reference - if o.PeelingOption == AppendPeeled || o.PeelingOption == IgnorePeeled { - err = refs.ForEach(func(ref *plumbing.Reference) error { - resultRefs = append(resultRefs, ref) - return nil - }) - if err != nil { - return nil, err - } - } - - if o.PeelingOption == AppendPeeled || o.PeelingOption == OnlyPeeled { - for k, v := range ar.Peeled { - resultRefs = append(resultRefs, plumbing.NewReferenceFromStrings(k+"^{}", v.String())) - } - } - - return resultRefs, nil -} - -func objectsToPush(commands []*packp.Command) []plumbing.Hash { - objects := make([]plumbing.Hash, 0, len(commands)) - for _, cmd := range commands { - if cmd.New == plumbing.ZeroHash { - continue - } - objects = append(objects, cmd.New) - } - return objects -} - -func referencesToHashes(refs storer.ReferenceStorer) ([]plumbing.Hash, error) { - iter, err := refs.IterReferences() - if err != nil { - return nil, err - } - - var hs []plumbing.Hash - err = iter.ForEach(func(ref *plumbing.Reference) error { - if ref.Type() != plumbing.HashReference { - return nil - } - - hs = append(hs, ref.Hash()) - return nil - }) - if err != nil { - return nil, err - } - - return hs, nil -} - -func pushHashes( - ctx context.Context, - sess transport.ReceivePackSession, - s storage.Storer, - req *packp.ReferenceUpdateRequest, - hs []plumbing.Hash, - useRefDeltas bool, - allDelete bool, -) (*packp.ReportStatus, error) { - rd, wr := io.Pipe() - - config, err := s.Config() - if err != nil { - return nil, err - } - - // Set buffer size to 1 so the error message can be written when - // ReceivePack fails. Otherwise the goroutine will be blocked writing - // to the channel. - done := make(chan error, 1) - - if !allDelete { - req.Packfile = rd - go func() { - e := packfile.NewEncoder(wr, s, useRefDeltas) - if _, err := e.Encode(hs, config.Pack.Window); err != nil { - done <- wr.CloseWithError(err) - return - } - - done <- wr.Close() - }() - } else { - close(done) - } - - rs, err := sess.ReceivePack(ctx, req) - if err != nil { - // close the pipe to unlock encode write - _ = rd.Close() - return nil, err - } - - if err := <-done; err != nil { - return nil, err - } - - return rs, nil -} - -func (r *Remote) updateShallow(o *FetchOptions, resp *packp.UploadPackResponse) error { - if o.Depth == 0 || len(resp.Shallows) == 0 { - return nil - } - - shallows, err := r.s.Shallow() - if err != nil { - return err - } - -outer: - for _, s := range resp.Shallows { - for _, oldS := range shallows { - if s == oldS { - continue outer - } - } - shallows = append(shallows, s) - } - - return r.s.SetShallow(shallows) -} - -func (r *Remote) checkRequireRemoteRefs(requires []config.RefSpec, remoteRefs storer.ReferenceStorer) error { - for _, require := range requires { - if require.IsWildcard() { - return fmt.Errorf("wildcards not supported in RequireRemoteRefs, got %s", require.String()) - } - - name := require.Dst("") - remote, err := remoteRefs.Reference(name) - if err != nil { - return fmt.Errorf("remote ref %s required to be %s but is absent", name.String(), require.Src()) - } - - var requireHash string - if require.IsExactSHA1() { - requireHash = require.Src() - } else { - target, err := storer.ResolveReference(remoteRefs, plumbing.ReferenceName(require.Src())) - if err != nil { - return fmt.Errorf("could not resolve ref %s in RequireRemoteRefs", require.Src()) - } - requireHash = target.Hash().String() - } - - if remote.Hash().String() != requireHash { - return fmt.Errorf("remote ref %s required to be %s but is %s", name.String(), requireHash, remote.Hash().String()) - } - } - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/repository.go b/vendor/github.com/go-git/go-git/v5/repository.go deleted file mode 100644 index 1524a69130..0000000000 --- a/vendor/github.com/go-git/go-git/v5/repository.go +++ /dev/null @@ -1,1849 +0,0 @@ -package git - -import ( - "bytes" - "context" - "crypto" - "encoding/hex" - "errors" - "fmt" - "io" - "os" - "path" - "path/filepath" - "strings" - "time" - - "dario.cat/mergo" - "github.com/ProtonMail/go-crypto/openpgp" - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/osfs" - "github.com/go-git/go-billy/v5/util" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/internal/path_util" - "github.com/go-git/go-git/v5/internal/revision" - "github.com/go-git/go-git/v5/internal/url" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - formatcfg "github.com/go-git/go-git/v5/plumbing/format/config" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage" - "github.com/go-git/go-git/v5/storage/filesystem" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// GitDirName this is a special folder where all the git stuff is. -const GitDirName = ".git" - -var ( - // ErrBranchExists an error stating the specified branch already exists - ErrBranchExists = errors.New("branch already exists") - // ErrBranchNotFound an error stating the specified branch does not exist - ErrBranchNotFound = errors.New("branch not found") - // ErrTagExists an error stating the specified tag already exists - ErrTagExists = errors.New("tag already exists") - // ErrTagNotFound an error stating the specified tag does not exist - ErrTagNotFound = errors.New("tag not found") - // ErrFetching is returned when the packfile could not be downloaded - ErrFetching = errors.New("unable to fetch packfile") - - ErrInvalidReference = errors.New("invalid reference, should be a tag or a branch") - ErrRepositoryNotExists = errors.New("repository does not exist") - ErrRepositoryIncomplete = errors.New("repository's commondir path does not exist") - ErrRepositoryAlreadyExists = errors.New("repository already exists") - ErrRemoteNotFound = errors.New("remote not found") - ErrRemoteExists = errors.New("remote already exists") - ErrAnonymousRemoteName = errors.New("anonymous remote name must be 'anonymous'") - ErrWorktreeNotProvided = errors.New("worktree should be provided") - ErrIsBareRepository = errors.New("worktree not available in a bare repository") - ErrUnableToResolveCommit = errors.New("unable to resolve commit") - ErrPackedObjectsNotSupported = errors.New("packed objects not supported") - ErrSHA256NotSupported = errors.New("go-git was not compiled with SHA256 support") - ErrAlternatePathNotSupported = errors.New("alternate path must use the file scheme") -) - -// Repository represents a git repository -type Repository struct { - Storer storage.Storer - - r map[string]*Remote - wt billy.Filesystem -} - -type InitOptions struct { - // The default branch (e.g. "refs/heads/master") - DefaultBranch plumbing.ReferenceName -} - -// Init creates an empty git repository, based on the given Storer and worktree. -// The worktree Filesystem is optional, if nil a bare repository is created. If -// the given storer is not empty ErrRepositoryAlreadyExists is returned -func Init(s storage.Storer, worktree billy.Filesystem) (*Repository, error) { - options := InitOptions{ - DefaultBranch: plumbing.Master, - } - return InitWithOptions(s, worktree, options) -} - -func InitWithOptions(s storage.Storer, worktree billy.Filesystem, options InitOptions) (*Repository, error) { - if err := initStorer(s); err != nil { - return nil, err - } - - if options.DefaultBranch == "" { - options.DefaultBranch = plumbing.Master - } - - if err := options.DefaultBranch.Validate(); err != nil { - return nil, err - } - - r := newRepository(s, worktree) - _, err := r.Reference(plumbing.HEAD, false) - switch err { - case plumbing.ErrReferenceNotFound: - case nil: - return nil, ErrRepositoryAlreadyExists - default: - return nil, err - } - - h := plumbing.NewSymbolicReference(plumbing.HEAD, options.DefaultBranch) - if err := s.SetReference(h); err != nil { - return nil, err - } - - if worktree == nil { - _ = r.setIsBare(true) - return r, nil - } - - return r, setWorktreeAndStoragePaths(r, worktree) -} - -func initStorer(s storer.Storer) error { - i, ok := s.(storer.Initializer) - if !ok { - return nil - } - - return i.Init() -} - -func setWorktreeAndStoragePaths(r *Repository, worktree billy.Filesystem) error { - type fsBased interface { - Filesystem() billy.Filesystem - } - - // .git file is only created if the storage is file based and the file - // system is osfs.OS - fs, isFSBased := r.Storer.(fsBased) - if !isFSBased { - return nil - } - - if err := createDotGitFile(worktree, fs.Filesystem()); err != nil { - return err - } - - return setConfigWorktree(r, worktree, fs.Filesystem()) -} - -func createDotGitFile(worktree, storage billy.Filesystem) error { - path, err := filepath.Rel(worktree.Root(), storage.Root()) - if err != nil { - path = storage.Root() - } - - if path == GitDirName { - // not needed, since the folder is the default place - return nil - } - - f, err := worktree.Create(GitDirName) - if err != nil { - return err - } - - defer f.Close() - _, err = fmt.Fprintf(f, "gitdir: %s\n", path) - return err -} - -func setConfigWorktree(r *Repository, worktree, storage billy.Filesystem) error { - path, err := filepath.Rel(storage.Root(), worktree.Root()) - if err != nil { - path = worktree.Root() - } - - if path == ".." { - // not needed, since the folder is the default place - return nil - } - - cfg, err := r.Config() - if err != nil { - return err - } - - cfg.Core.Worktree = path - return r.Storer.SetConfig(cfg) -} - -// Open opens a git repository using the given Storer and worktree filesystem, -// if the given storer is complete empty ErrRepositoryNotExists is returned. -// The worktree can be nil when the repository being opened is bare, if the -// repository is a normal one (not bare) and worktree is nil the err -// ErrWorktreeNotProvided is returned -func Open(s storage.Storer, worktree billy.Filesystem) (*Repository, error) { - _, err := s.Reference(plumbing.HEAD) - if err == plumbing.ErrReferenceNotFound { - return nil, ErrRepositoryNotExists - } - - if err != nil { - return nil, err - } - - return newRepository(s, worktree), nil -} - -// Clone a repository into the given Storer and worktree Filesystem with the -// given options, if worktree is nil a bare repository is created. If the given -// storer is not empty ErrRepositoryAlreadyExists is returned. -func Clone(s storage.Storer, worktree billy.Filesystem, o *CloneOptions) (*Repository, error) { - return CloneContext(context.Background(), s, worktree, o) -} - -// CloneContext a repository into the given Storer and worktree Filesystem with -// the given options, if worktree is nil a bare repository is created. If the -// given storer is not empty ErrRepositoryAlreadyExists is returned. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func CloneContext( - ctx context.Context, s storage.Storer, worktree billy.Filesystem, o *CloneOptions, -) (*Repository, error) { - r, err := Init(s, worktree) - if err != nil { - return nil, err - } - - return r, r.clone(ctx, o) -} - -// PlainInit create an empty git repository at the given path. isBare defines -// if the repository will have worktree (non-bare) or not (bare), if the path -// is not empty ErrRepositoryAlreadyExists is returned. -func PlainInit(path string, isBare bool) (*Repository, error) { - return PlainInitWithOptions(path, &PlainInitOptions{ - Bare: isBare, - }) -} - -func PlainInitWithOptions(path string, opts *PlainInitOptions) (*Repository, error) { - if opts == nil { - opts = &PlainInitOptions{} - } - - var wt, dot billy.Filesystem - - if opts.Bare { - dot = osfs.New(path) - } else { - wt = osfs.New(path) - dot, _ = wt.Chroot(GitDirName) - } - - s := filesystem.NewStorage(dot, cache.NewObjectLRUDefault()) - - r, err := InitWithOptions(s, wt, opts.InitOptions) - if err != nil { - return nil, err - } - - cfg, err := r.Config() - if err != nil { - return nil, err - } - - if opts.ObjectFormat != "" { - if opts.ObjectFormat == formatcfg.SHA256 && hash.CryptoType != crypto.SHA256 { - return nil, ErrSHA256NotSupported - } - - cfg.Core.RepositoryFormatVersion = formatcfg.Version_1 - cfg.Extensions.ObjectFormat = opts.ObjectFormat - } - - err = r.Storer.SetConfig(cfg) - if err != nil { - return nil, err - } - - return r, err -} - -// PlainOpen opens a git repository from the given path. It detects if the -// repository is bare or a normal one. If the path doesn't contain a valid -// repository ErrRepositoryNotExists is returned -func PlainOpen(path string) (*Repository, error) { - return PlainOpenWithOptions(path, &PlainOpenOptions{}) -} - -// PlainOpenWithOptions opens a git repository from the given path with specific -// options. See PlainOpen for more info. -func PlainOpenWithOptions(path string, o *PlainOpenOptions) (*Repository, error) { - dot, wt, err := dotGitToOSFilesystems(path, o.DetectDotGit) - if err != nil { - return nil, err - } - - if _, err := dot.Stat(""); err != nil { - if os.IsNotExist(err) { - return nil, ErrRepositoryNotExists - } - - return nil, err - } - - var repositoryFs billy.Filesystem - - if o.EnableDotGitCommonDir { - dotGitCommon, err := dotGitCommonDirectory(dot) - if err != nil { - return nil, err - } - repositoryFs = dotgit.NewRepositoryFilesystem(dot, dotGitCommon) - } else { - repositoryFs = dot - } - - s := filesystem.NewStorage(repositoryFs, cache.NewObjectLRUDefault()) - - return Open(s, wt) -} - -func dotGitToOSFilesystems(path string, detect bool) (dot, wt billy.Filesystem, err error) { - path, err = path_util.ReplaceTildeWithHome(path) - if err != nil { - return nil, nil, err - } - - if path, err = filepath.Abs(path); err != nil { - return nil, nil, err - } - - var fs billy.Filesystem - var fi os.FileInfo - for { - fs = osfs.New(path) - - pathinfo, err := fs.Stat("/") - if !os.IsNotExist(err) { - if pathinfo == nil { - return nil, nil, err - } - if !pathinfo.IsDir() && detect { - fs = osfs.New(filepath.Dir(path)) - } - } - - fi, err = fs.Stat(GitDirName) - if err == nil { - // no error; stop - break - } - if !os.IsNotExist(err) { - // unknown error; stop - return nil, nil, err - } - if detect { - // try its parent as long as we haven't reached - // the root dir - if dir := filepath.Dir(path); dir != path { - path = dir - continue - } - } - // not detecting via parent dirs and the dir does not exist; - // stop - return fs, nil, nil - } - - if fi.IsDir() { - dot, err = fs.Chroot(GitDirName) - return dot, fs, err - } - - dot, err = dotGitFileToOSFilesystem(path, fs) - if err != nil { - return nil, nil, err - } - - return dot, fs, nil -} - -func dotGitFileToOSFilesystem(path string, fs billy.Filesystem) (bfs billy.Filesystem, err error) { - f, err := fs.Open(GitDirName) - if err != nil { - return nil, err - } - defer ioutil.CheckClose(f, &err) - - b, err := io.ReadAll(f) - if err != nil { - return nil, err - } - - line := string(b) - const prefix = "gitdir: " - if !strings.HasPrefix(line, prefix) { - return nil, fmt.Errorf(".git file has no %s prefix", prefix) - } - - gitdir := strings.Split(line[len(prefix):], "\n")[0] - gitdir = strings.TrimSpace(gitdir) - if filepath.IsAbs(gitdir) { - return osfs.New(gitdir), nil - } - - return osfs.New(fs.Join(path, gitdir)), nil -} - -func dotGitCommonDirectory(fs billy.Filesystem) (commonDir billy.Filesystem, err error) { - f, err := fs.Open("commondir") - if os.IsNotExist(err) { - return nil, nil - } - if err != nil { - return nil, err - } - - b, err := io.ReadAll(f) - if err != nil { - return nil, err - } - if len(b) > 0 { - path := strings.TrimSpace(string(b)) - if filepath.IsAbs(path) { - commonDir = osfs.New(path) - } else { - commonDir = osfs.New(filepath.Join(fs.Root(), path)) - } - if _, err := commonDir.Stat(""); err != nil { - if os.IsNotExist(err) { - return nil, ErrRepositoryIncomplete - } - - return nil, err - } - } - - return commonDir, nil -} - -// PlainClone a repository into the path with the given options, isBare defines -// if the new repository will be bare or normal. If the path is not empty -// ErrRepositoryAlreadyExists is returned. -// -// TODO(mcuadros): move isBare to CloneOptions in v5 -func PlainClone(path string, isBare bool, o *CloneOptions) (*Repository, error) { - return PlainCloneContext(context.Background(), path, isBare, o) -} - -// PlainCloneContext a repository into the path with the given options, isBare -// defines if the new repository will be bare or normal. If the path is not empty -// ErrRepositoryAlreadyExists is returned. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -// -// TODO(mcuadros): move isBare to CloneOptions in v5 -// TODO(smola): refuse upfront to clone on a non-empty directory in v5, see #1027 -func PlainCloneContext(ctx context.Context, path string, isBare bool, o *CloneOptions) (*Repository, error) { - cleanup, cleanupParent, err := checkIfCleanupIsNeeded(path) - if err != nil { - return nil, err - } - - if o.Mirror { - isBare = true - } - r, err := PlainInit(path, isBare) - if err != nil { - return nil, err - } - - err = r.clone(ctx, o) - if err != nil && err != ErrRepositoryAlreadyExists { - if cleanup { - _ = cleanUpDir(path, cleanupParent) - } - } - - return r, err -} - -func newRepository(s storage.Storer, worktree billy.Filesystem) *Repository { - return &Repository{ - Storer: s, - wt: worktree, - r: make(map[string]*Remote), - } -} - -func checkIfCleanupIsNeeded(path string) (cleanup bool, cleanParent bool, err error) { - fi, err := osfs.Default.Stat(path) - if err != nil { - if os.IsNotExist(err) { - return true, true, nil - } - - return false, false, err - } - - if !fi.IsDir() { - return false, false, fmt.Errorf("path is not a directory: %s", path) - } - - files, err := osfs.Default.ReadDir(path) - if err != nil { - return false, false, err - } - - if len(files) == 0 { - return true, false, nil - } - - return false, false, nil -} - -func cleanUpDir(path string, all bool) error { - if all { - return util.RemoveAll(osfs.Default, path) - } - - files, err := osfs.Default.ReadDir(path) - if err != nil { - return err - } - - for _, fi := range files { - if err := util.RemoveAll(osfs.Default, osfs.Default.Join(path, fi.Name())); err != nil { - return err - } - } - - return err -} - -// Config return the repository config. In a filesystem backed repository this -// means read the `.git/config`. -func (r *Repository) Config() (*config.Config, error) { - return r.Storer.Config() -} - -// SetConfig marshall and writes the repository config. In a filesystem backed -// repository this means write the `.git/config`. This function should be called -// with the result of `Repository.Config` and never with the output of -// `Repository.ConfigScoped`. -func (r *Repository) SetConfig(cfg *config.Config) error { - return r.Storer.SetConfig(cfg) -} - -// ConfigScoped returns the repository config, merged with requested scope and -// lower. For example if, config.GlobalScope is given the local and global config -// are returned merged in one config value. -func (r *Repository) ConfigScoped(scope config.Scope) (*config.Config, error) { - // TODO(mcuadros): v6, add this as ConfigOptions.Scoped - - var err error - system := config.NewConfig() - if scope >= config.SystemScope { - system, err = config.LoadConfig(config.SystemScope) - if err != nil { - return nil, err - } - } - - global := config.NewConfig() - if scope >= config.GlobalScope { - global, err = config.LoadConfig(config.GlobalScope) - if err != nil { - return nil, err - } - } - - local, err := r.Storer.Config() - if err != nil { - return nil, err - } - - _ = mergo.Merge(global, system) - _ = mergo.Merge(local, global) - return local, nil -} - -// Remote return a remote if exists -func (r *Repository) Remote(name string) (*Remote, error) { - cfg, err := r.Config() - if err != nil { - return nil, err - } - - c, ok := cfg.Remotes[name] - if !ok { - return nil, ErrRemoteNotFound - } - - return NewRemote(r.Storer, c), nil -} - -// Remotes returns a list with all the remotes -func (r *Repository) Remotes() ([]*Remote, error) { - cfg, err := r.Config() - if err != nil { - return nil, err - } - - remotes := make([]*Remote, len(cfg.Remotes)) - - var i int - for _, c := range cfg.Remotes { - remotes[i] = NewRemote(r.Storer, c) - i++ - } - - return remotes, nil -} - -// CreateRemote creates a new remote -func (r *Repository) CreateRemote(c *config.RemoteConfig) (*Remote, error) { - if err := c.Validate(); err != nil { - return nil, err - } - - remote := NewRemote(r.Storer, c) - - cfg, err := r.Config() - if err != nil { - return nil, err - } - - if _, ok := cfg.Remotes[c.Name]; ok { - return nil, ErrRemoteExists - } - - cfg.Remotes[c.Name] = c - return remote, r.Storer.SetConfig(cfg) -} - -// CreateRemoteAnonymous creates a new anonymous remote. c.Name must be "anonymous". -// It's used like 'git fetch git@github.com:src-d/go-git.git master:master'. -func (r *Repository) CreateRemoteAnonymous(c *config.RemoteConfig) (*Remote, error) { - if err := c.Validate(); err != nil { - return nil, err - } - - if c.Name != "anonymous" { - return nil, ErrAnonymousRemoteName - } - - remote := NewRemote(r.Storer, c) - - return remote, nil -} - -// DeleteRemote delete a remote from the repository and delete the config -func (r *Repository) DeleteRemote(name string) error { - cfg, err := r.Config() - if err != nil { - return err - } - - if _, ok := cfg.Remotes[name]; !ok { - return ErrRemoteNotFound - } - - delete(cfg.Remotes, name) - return r.Storer.SetConfig(cfg) -} - -// Branch return a Branch if exists -func (r *Repository) Branch(name string) (*config.Branch, error) { - cfg, err := r.Config() - if err != nil { - return nil, err - } - - b, ok := cfg.Branches[name] - if !ok { - return nil, ErrBranchNotFound - } - - return b, nil -} - -// CreateBranch creates a new Branch -func (r *Repository) CreateBranch(c *config.Branch) error { - if err := c.Validate(); err != nil { - return err - } - - cfg, err := r.Config() - if err != nil { - return err - } - - if _, ok := cfg.Branches[c.Name]; ok { - return ErrBranchExists - } - - cfg.Branches[c.Name] = c - return r.Storer.SetConfig(cfg) -} - -// DeleteBranch delete a Branch from the repository and delete the config -func (r *Repository) DeleteBranch(name string) error { - cfg, err := r.Config() - if err != nil { - return err - } - - if _, ok := cfg.Branches[name]; !ok { - return ErrBranchNotFound - } - - delete(cfg.Branches, name) - return r.Storer.SetConfig(cfg) -} - -// CreateTag creates a tag. If opts is included, the tag is an annotated tag, -// otherwise a lightweight tag is created. -func (r *Repository) CreateTag(name string, hash plumbing.Hash, opts *CreateTagOptions) (*plumbing.Reference, error) { - rname := plumbing.NewTagReferenceName(name) - if err := rname.Validate(); err != nil { - return nil, err - } - - _, err := r.Storer.Reference(rname) - switch err { - case nil: - // Tag exists, this is an error - return nil, ErrTagExists - case plumbing.ErrReferenceNotFound: - // Tag missing, available for creation, pass this - default: - // Some other error - return nil, err - } - - var target plumbing.Hash - if opts != nil { - target, err = r.createTagObject(name, hash, opts) - if err != nil { - return nil, err - } - } else { - target = hash - } - - ref := plumbing.NewHashReference(rname, target) - if err = r.Storer.SetReference(ref); err != nil { - return nil, err - } - - return ref, nil -} - -func (r *Repository) createTagObject(name string, hash plumbing.Hash, opts *CreateTagOptions) (plumbing.Hash, error) { - if err := opts.Validate(r, hash); err != nil { - return plumbing.ZeroHash, err - } - - rawobj, err := object.GetObject(r.Storer, hash) - if err != nil { - return plumbing.ZeroHash, err - } - - tag := &object.Tag{ - Name: name, - Tagger: *opts.Tagger, - Message: opts.Message, - TargetType: rawobj.Type(), - Target: hash, - } - - if opts.SignKey != nil { - sig, err := r.buildTagSignature(tag, opts.SignKey) - if err != nil { - return plumbing.ZeroHash, err - } - - tag.PGPSignature = sig - } - - obj := r.Storer.NewEncodedObject() - if err := tag.Encode(obj); err != nil { - return plumbing.ZeroHash, err - } - - return r.Storer.SetEncodedObject(obj) -} - -func (r *Repository) buildTagSignature(tag *object.Tag, signKey *openpgp.Entity) (string, error) { - encoded := &plumbing.MemoryObject{} - if err := tag.Encode(encoded); err != nil { - return "", err - } - - rdr, err := encoded.Reader() - if err != nil { - return "", err - } - - var b bytes.Buffer - if err := openpgp.ArmoredDetachSign(&b, signKey, rdr, nil); err != nil { - return "", err - } - - return b.String(), nil -} - -// Tag returns a tag from the repository. -// -// If you want to check to see if the tag is an annotated tag, you can call -// TagObject on the hash of the reference in ForEach: -// -// ref, err := r.Tag("v0.1.0") -// if err != nil { -// // Handle error -// } -// -// obj, err := r.TagObject(ref.Hash()) -// switch err { -// case nil: -// // Tag object present -// case plumbing.ErrObjectNotFound: -// // Not a tag object -// default: -// // Some other error -// } -func (r *Repository) Tag(name string) (*plumbing.Reference, error) { - ref, err := r.Reference(plumbing.ReferenceName(path.Join("refs", "tags", name)), false) - if err != nil { - if err == plumbing.ErrReferenceNotFound { - // Return a friendly error for this one, versus just ReferenceNotFound. - return nil, ErrTagNotFound - } - - return nil, err - } - - return ref, nil -} - -// DeleteTag deletes a tag from the repository. -func (r *Repository) DeleteTag(name string) error { - _, err := r.Tag(name) - if err != nil { - return err - } - - return r.Storer.RemoveReference(plumbing.ReferenceName(path.Join("refs", "tags", name))) -} - -func (r *Repository) resolveToCommitHash(h plumbing.Hash) (plumbing.Hash, error) { - obj, err := r.Storer.EncodedObject(plumbing.AnyObject, h) - if err != nil { - return plumbing.ZeroHash, err - } - switch obj.Type() { - case plumbing.TagObject: - t, err := object.DecodeTag(r.Storer, obj) - if err != nil { - return plumbing.ZeroHash, err - } - return r.resolveToCommitHash(t.Target) - case plumbing.CommitObject: - return h, nil - default: - return plumbing.ZeroHash, ErrUnableToResolveCommit - } -} - -// Clone clones a remote repository -func (r *Repository) clone(ctx context.Context, o *CloneOptions) error { - if err := o.Validate(); err != nil { - return err - } - - c := &config.RemoteConfig{ - Name: o.RemoteName, - URLs: []string{o.URL}, - Fetch: r.cloneRefSpec(o), - Mirror: o.Mirror, - } - - if _, err := r.CreateRemote(c); err != nil { - return err - } - - // When the repository to clone is on the local machine, - // instead of using hard links, automatically setup .git/objects/info/alternates - // to share the objects with the source repository - if o.Shared { - if !url.IsLocalEndpoint(o.URL) { - return ErrAlternatePathNotSupported - } - altpath := o.URL - remoteRepo, err := PlainOpen(o.URL) - if err != nil { - return fmt.Errorf("failed to open remote repository: %w", err) - } - conf, err := remoteRepo.Config() - if err != nil { - return fmt.Errorf("failed to read remote repository configuration: %w", err) - } - if !conf.Core.IsBare { - altpath = path.Join(altpath, GitDirName) - } - if err := r.Storer.AddAlternate(altpath); err != nil { - return fmt.Errorf("failed to add alternate file to git objects dir: %w", err) - } - } - - ref, err := r.fetchAndUpdateReferences(ctx, &FetchOptions{ - RefSpecs: c.Fetch, - Depth: o.Depth, - Auth: o.Auth, - Progress: o.Progress, - Tags: o.Tags, - RemoteName: o.RemoteName, - InsecureSkipTLS: o.InsecureSkipTLS, - CABundle: o.CABundle, - ProxyOptions: o.ProxyOptions, - }, o.ReferenceName) - if err != nil { - return err - } - - if r.wt != nil && !o.NoCheckout { - w, err := r.Worktree() - if err != nil { - return err - } - - head, err := r.Head() - if err != nil { - return err - } - - if err := w.Reset(&ResetOptions{ - Mode: MergeReset, - Commit: head.Hash(), - }); err != nil { - return err - } - - if o.RecurseSubmodules != NoRecurseSubmodules { - if err := w.updateSubmodules(&SubmoduleUpdateOptions{ - RecurseSubmodules: o.RecurseSubmodules, - Depth: func() int { - if o.ShallowSubmodules { - return 1 - } - return 0 - }(), - Auth: o.Auth, - }); err != nil { - return err - } - } - } - - if err := r.updateRemoteConfigIfNeeded(o, c, ref); err != nil { - return err - } - - if !o.Mirror && ref.Name().IsBranch() { - branchRef := ref.Name() - branchName := strings.Split(string(branchRef), "refs/heads/")[1] - - b := &config.Branch{ - Name: branchName, - Merge: branchRef, - } - - if o.RemoteName == "" { - b.Remote = "origin" - } else { - b.Remote = o.RemoteName - } - - if err := r.CreateBranch(b); err != nil { - return err - } - } - - return nil -} - -const ( - refspecTag = "+refs/tags/%s:refs/tags/%[1]s" - refspecSingleBranch = "+refs/heads/%s:refs/remotes/%s/%[1]s" - refspecSingleBranchHEAD = "+HEAD:refs/remotes/%s/HEAD" -) - -func (r *Repository) cloneRefSpec(o *CloneOptions) []config.RefSpec { - switch { - case o.Mirror: - return []config.RefSpec{"+refs/*:refs/*"} - case o.ReferenceName.IsTag(): - return []config.RefSpec{ - config.RefSpec(fmt.Sprintf(refspecTag, o.ReferenceName.Short())), - } - case o.SingleBranch && o.ReferenceName == plumbing.HEAD: - return []config.RefSpec{ - config.RefSpec(fmt.Sprintf(refspecSingleBranchHEAD, o.RemoteName)), - } - case o.SingleBranch: - return []config.RefSpec{ - config.RefSpec(fmt.Sprintf(refspecSingleBranch, o.ReferenceName.Short(), o.RemoteName)), - } - default: - return []config.RefSpec{ - config.RefSpec(fmt.Sprintf(config.DefaultFetchRefSpec, o.RemoteName)), - } - } -} - -func (r *Repository) setIsBare(isBare bool) error { - cfg, err := r.Config() - if err != nil { - return err - } - - cfg.Core.IsBare = isBare - return r.Storer.SetConfig(cfg) -} - -func (r *Repository) updateRemoteConfigIfNeeded(o *CloneOptions, c *config.RemoteConfig, head *plumbing.Reference) error { - if !o.SingleBranch { - return nil - } - - c.Fetch = r.cloneRefSpec(o) - - cfg, err := r.Config() - if err != nil { - return err - } - - cfg.Remotes[c.Name] = c - return r.Storer.SetConfig(cfg) -} - -func (r *Repository) fetchAndUpdateReferences( - ctx context.Context, o *FetchOptions, ref plumbing.ReferenceName, -) (*plumbing.Reference, error) { - - if err := o.Validate(); err != nil { - return nil, err - } - - remote, err := r.Remote(o.RemoteName) - if err != nil { - return nil, err - } - - objsUpdated := true - remoteRefs, err := remote.fetch(ctx, o) - if err == NoErrAlreadyUpToDate { - objsUpdated = false - } else if err == packfile.ErrEmptyPackfile { - return nil, ErrFetching - } else if err != nil { - return nil, err - } - - resolvedRef, err := expand_ref(remoteRefs, ref) - if err != nil { - return nil, err - } - - refsUpdated, err := r.updateReferences(remote.c.Fetch, resolvedRef) - if err != nil { - return nil, err - } - - if !objsUpdated && !refsUpdated { - return nil, NoErrAlreadyUpToDate - } - - return resolvedRef, nil -} - -func (r *Repository) updateReferences(spec []config.RefSpec, - resolvedRef *plumbing.Reference) (updated bool, err error) { - - if !resolvedRef.Name().IsBranch() { - // Detached HEAD mode - h, err := r.resolveToCommitHash(resolvedRef.Hash()) - if err != nil { - return false, err - } - head := plumbing.NewHashReference(plumbing.HEAD, h) - return updateReferenceStorerIfNeeded(r.Storer, head) - } - - refs := []*plumbing.Reference{ - // Create local reference for the resolved ref - resolvedRef, - // Create local symbolic HEAD - plumbing.NewSymbolicReference(plumbing.HEAD, resolvedRef.Name()), - } - - refs = append(refs, r.calculateRemoteHeadReference(spec, resolvedRef)...) - - for _, ref := range refs { - u, err := updateReferenceStorerIfNeeded(r.Storer, ref) - if err != nil { - return updated, err - } - - if u { - updated = true - } - } - - return -} - -func (r *Repository) calculateRemoteHeadReference(spec []config.RefSpec, - resolvedHead *plumbing.Reference) []*plumbing.Reference { - - var refs []*plumbing.Reference - - // Create resolved HEAD reference with remote prefix if it does not - // exist. This is needed when using single branch and HEAD. - for _, rs := range spec { - name := resolvedHead.Name() - if !rs.Match(name) { - continue - } - - name = rs.Dst(name) - _, err := r.Storer.Reference(name) - if err == plumbing.ErrReferenceNotFound { - refs = append(refs, plumbing.NewHashReference(name, resolvedHead.Hash())) - } - } - - return refs -} - -func checkAndUpdateReferenceStorerIfNeeded( - s storer.ReferenceStorer, r, old *plumbing.Reference) ( - updated bool, err error) { - p, err := s.Reference(r.Name()) - if err != nil && err != plumbing.ErrReferenceNotFound { - return false, err - } - - // we use the string method to compare references, is the easiest way - if err == plumbing.ErrReferenceNotFound || r.String() != p.String() { - if err := s.CheckAndSetReference(r, old); err != nil { - return false, err - } - - return true, nil - } - - return false, nil -} - -func updateReferenceStorerIfNeeded( - s storer.ReferenceStorer, r *plumbing.Reference) (updated bool, err error) { - return checkAndUpdateReferenceStorerIfNeeded(s, r, nil) -} - -// Fetch fetches references along with the objects necessary to complete -// their histories, from the remote named as FetchOptions.RemoteName. -// -// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are -// no changes to be fetched, or an error. -func (r *Repository) Fetch(o *FetchOptions) error { - return r.FetchContext(context.Background(), o) -} - -// FetchContext fetches references along with the objects necessary to complete -// their histories, from the remote named as FetchOptions.RemoteName. -// -// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are -// no changes to be fetched, or an error. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (r *Repository) FetchContext(ctx context.Context, o *FetchOptions) error { - if err := o.Validate(); err != nil { - return err - } - - remote, err := r.Remote(o.RemoteName) - if err != nil { - return err - } - - return remote.FetchContext(ctx, o) -} - -// Push performs a push to the remote. Returns NoErrAlreadyUpToDate if -// the remote was already up-to-date, from the remote named as -// FetchOptions.RemoteName. -func (r *Repository) Push(o *PushOptions) error { - return r.PushContext(context.Background(), o) -} - -// PushContext performs a push to the remote. Returns NoErrAlreadyUpToDate if -// the remote was already up-to-date, from the remote named as -// FetchOptions.RemoteName. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (r *Repository) PushContext(ctx context.Context, o *PushOptions) error { - if err := o.Validate(); err != nil { - return err - } - - remote, err := r.Remote(o.RemoteName) - if err != nil { - return err - } - - return remote.PushContext(ctx, o) -} - -// Log returns the commit history from the given LogOptions. -func (r *Repository) Log(o *LogOptions) (object.CommitIter, error) { - fn := commitIterFunc(o.Order) - if fn == nil { - return nil, fmt.Errorf("invalid Order=%v", o.Order) - } - - var ( - it object.CommitIter - err error - ) - if o.All { - it, err = r.logAll(fn) - } else { - it, err = r.log(o.From, fn) - } - - if err != nil { - return nil, err - } - - if o.FileName != nil { - // for `git log --all` also check parent (if the next commit comes from the real parent) - it = r.logWithFile(*o.FileName, it, o.All) - } - if o.PathFilter != nil { - it = r.logWithPathFilter(o.PathFilter, it, o.All) - } - - if o.Since != nil || o.Until != nil { - limitOptions := object.LogLimitOptions{Since: o.Since, Until: o.Until} - it = r.logWithLimit(it, limitOptions) - } - - return it, nil -} - -func (r *Repository) log(from plumbing.Hash, commitIterFunc func(*object.Commit) object.CommitIter) (object.CommitIter, error) { - h := from - if from == plumbing.ZeroHash { - head, err := r.Head() - if err != nil { - return nil, err - } - - h = head.Hash() - } - - commit, err := r.CommitObject(h) - if err != nil { - return nil, err - } - return commitIterFunc(commit), nil -} - -func (r *Repository) logAll(commitIterFunc func(*object.Commit) object.CommitIter) (object.CommitIter, error) { - return object.NewCommitAllIter(r.Storer, commitIterFunc) -} - -func (*Repository) logWithFile(fileName string, commitIter object.CommitIter, checkParent bool) object.CommitIter { - return object.NewCommitPathIterFromIter( - func(path string) bool { - return path == fileName - }, - commitIter, - checkParent, - ) -} - -func (*Repository) logWithPathFilter(pathFilter func(string) bool, commitIter object.CommitIter, checkParent bool) object.CommitIter { - return object.NewCommitPathIterFromIter( - pathFilter, - commitIter, - checkParent, - ) -} - -func (*Repository) logWithLimit(commitIter object.CommitIter, limitOptions object.LogLimitOptions) object.CommitIter { - return object.NewCommitLimitIterFromIter(commitIter, limitOptions) -} - -func commitIterFunc(order LogOrder) func(c *object.Commit) object.CommitIter { - switch order { - case LogOrderDefault: - return func(c *object.Commit) object.CommitIter { - return object.NewCommitPreorderIter(c, nil, nil) - } - case LogOrderDFS: - return func(c *object.Commit) object.CommitIter { - return object.NewCommitPreorderIter(c, nil, nil) - } - case LogOrderDFSPost: - return func(c *object.Commit) object.CommitIter { - return object.NewCommitPostorderIter(c, nil) - } - case LogOrderBSF: - return func(c *object.Commit) object.CommitIter { - return object.NewCommitIterBSF(c, nil, nil) - } - case LogOrderCommitterTime: - return func(c *object.Commit) object.CommitIter { - return object.NewCommitIterCTime(c, nil, nil) - } - } - return nil -} - -// Tags returns all the tag References in a repository. -// -// If you want to check to see if the tag is an annotated tag, you can call -// TagObject on the hash Reference passed in through ForEach: -// -// iter, err := r.Tags() -// if err != nil { -// // Handle error -// } -// -// if err := iter.ForEach(func (ref *plumbing.Reference) error { -// obj, err := r.TagObject(ref.Hash()) -// switch err { -// case nil: -// // Tag object present -// case plumbing.ErrObjectNotFound: -// // Not a tag object -// default: -// // Some other error -// return err -// } -// }); err != nil { -// // Handle outer iterator error -// } -func (r *Repository) Tags() (storer.ReferenceIter, error) { - refIter, err := r.Storer.IterReferences() - if err != nil { - return nil, err - } - - return storer.NewReferenceFilteredIter( - func(r *plumbing.Reference) bool { - return r.Name().IsTag() - }, refIter), nil -} - -// Branches returns all the References that are Branches. -func (r *Repository) Branches() (storer.ReferenceIter, error) { - refIter, err := r.Storer.IterReferences() - if err != nil { - return nil, err - } - - return storer.NewReferenceFilteredIter( - func(r *plumbing.Reference) bool { - return r.Name().IsBranch() - }, refIter), nil -} - -// Notes returns all the References that are notes. For more information: -// https://git-scm.com/docs/git-notes -func (r *Repository) Notes() (storer.ReferenceIter, error) { - refIter, err := r.Storer.IterReferences() - if err != nil { - return nil, err - } - - return storer.NewReferenceFilteredIter( - func(r *plumbing.Reference) bool { - return r.Name().IsNote() - }, refIter), nil -} - -// TreeObject return a Tree with the given hash. If not found -// plumbing.ErrObjectNotFound is returned -func (r *Repository) TreeObject(h plumbing.Hash) (*object.Tree, error) { - return object.GetTree(r.Storer, h) -} - -// TreeObjects returns an unsorted TreeIter with all the trees in the repository -func (r *Repository) TreeObjects() (*object.TreeIter, error) { - iter, err := r.Storer.IterEncodedObjects(plumbing.TreeObject) - if err != nil { - return nil, err - } - - return object.NewTreeIter(r.Storer, iter), nil -} - -// CommitObject return a Commit with the given hash. If not found -// plumbing.ErrObjectNotFound is returned. -func (r *Repository) CommitObject(h plumbing.Hash) (*object.Commit, error) { - return object.GetCommit(r.Storer, h) -} - -// CommitObjects returns an unsorted CommitIter with all the commits in the repository. -func (r *Repository) CommitObjects() (object.CommitIter, error) { - iter, err := r.Storer.IterEncodedObjects(plumbing.CommitObject) - if err != nil { - return nil, err - } - - return object.NewCommitIter(r.Storer, iter), nil -} - -// BlobObject returns a Blob with the given hash. If not found -// plumbing.ErrObjectNotFound is returned. -func (r *Repository) BlobObject(h plumbing.Hash) (*object.Blob, error) { - return object.GetBlob(r.Storer, h) -} - -// BlobObjects returns an unsorted BlobIter with all the blobs in the repository. -func (r *Repository) BlobObjects() (*object.BlobIter, error) { - iter, err := r.Storer.IterEncodedObjects(plumbing.BlobObject) - if err != nil { - return nil, err - } - - return object.NewBlobIter(r.Storer, iter), nil -} - -// TagObject returns a Tag with the given hash. If not found -// plumbing.ErrObjectNotFound is returned. This method only returns -// annotated Tags, no lightweight Tags. -func (r *Repository) TagObject(h plumbing.Hash) (*object.Tag, error) { - return object.GetTag(r.Storer, h) -} - -// TagObjects returns a unsorted TagIter that can step through all of the annotated -// tags in the repository. -func (r *Repository) TagObjects() (*object.TagIter, error) { - iter, err := r.Storer.IterEncodedObjects(plumbing.TagObject) - if err != nil { - return nil, err - } - - return object.NewTagIter(r.Storer, iter), nil -} - -// Object returns an Object with the given hash. If not found -// plumbing.ErrObjectNotFound is returned. -func (r *Repository) Object(t plumbing.ObjectType, h plumbing.Hash) (object.Object, error) { - obj, err := r.Storer.EncodedObject(t, h) - if err != nil { - return nil, err - } - - return object.DecodeObject(r.Storer, obj) -} - -// Objects returns an unsorted ObjectIter with all the objects in the repository. -func (r *Repository) Objects() (*object.ObjectIter, error) { - iter, err := r.Storer.IterEncodedObjects(plumbing.AnyObject) - if err != nil { - return nil, err - } - - return object.NewObjectIter(r.Storer, iter), nil -} - -// Head returns the reference where HEAD is pointing to. -func (r *Repository) Head() (*plumbing.Reference, error) { - return storer.ResolveReference(r.Storer, plumbing.HEAD) -} - -// Reference returns the reference for a given reference name. If resolved is -// true, any symbolic reference will be resolved. -func (r *Repository) Reference(name plumbing.ReferenceName, resolved bool) ( - *plumbing.Reference, error) { - - if resolved { - return storer.ResolveReference(r.Storer, name) - } - - return r.Storer.Reference(name) -} - -// References returns an unsorted ReferenceIter for all references. -func (r *Repository) References() (storer.ReferenceIter, error) { - return r.Storer.IterReferences() -} - -// Worktree returns a worktree based on the given fs, if nil the default -// worktree will be used. -func (r *Repository) Worktree() (*Worktree, error) { - if r.wt == nil { - return nil, ErrIsBareRepository - } - - return &Worktree{r: r, Filesystem: r.wt}, nil -} - -func expand_ref(s storer.ReferenceStorer, ref plumbing.ReferenceName) (*plumbing.Reference, error) { - // For improving troubleshooting, this preserves the error for the provided `ref`, - // and returns the error for that specific ref in case all parse rules fails. - var ret error - for _, rule := range plumbing.RefRevParseRules { - resolvedRef, err := storer.ResolveReference(s, plumbing.ReferenceName(fmt.Sprintf(rule, ref))) - - if err == nil { - return resolvedRef, nil - } else if ret == nil { - ret = err - } - } - - return nil, ret -} - -// ResolveRevision resolves revision to corresponding hash. It will always -// resolve to a commit hash, not a tree or annotated tag. -// -// Implemented resolvers : HEAD, branch, tag, heads/branch, refs/heads/branch, -// refs/tags/tag, refs/remotes/origin/branch, refs/remotes/origin/HEAD, tilde and caret (HEAD~1, master~^, tag~2, ref/heads/master~1, ...), selection by text (HEAD^{/fix nasty bug}), hash (prefix and full) -func (r *Repository) ResolveRevision(in plumbing.Revision) (*plumbing.Hash, error) { - rev := in.String() - if rev == "" { - return &plumbing.ZeroHash, plumbing.ErrReferenceNotFound - } - - p := revision.NewParserFromString(rev) - items, err := p.Parse() - - if err != nil { - return nil, err - } - - var commit *object.Commit - - for _, item := range items { - switch item := item.(type) { - case revision.Ref: - revisionRef := item - - var tryHashes []plumbing.Hash - - tryHashes = append(tryHashes, r.resolveHashPrefix(string(revisionRef))...) - - ref, err := expand_ref(r.Storer, plumbing.ReferenceName(revisionRef)) - if err == nil { - tryHashes = append(tryHashes, ref.Hash()) - } - - // in ambiguous cases, `git rev-parse` will emit a warning, but - // will always return the oid in preference to a ref; we don't have - // the ability to emit a warning here, so (for speed purposes) - // don't bother to detect the ambiguity either, just return in the - // priority that git would. - gotOne := false - for _, hash := range tryHashes { - commitObj, err := r.CommitObject(hash) - if err == nil { - commit = commitObj - gotOne = true - break - } - - tagObj, err := r.TagObject(hash) - if err == nil { - // If the tag target lookup fails here, this most likely - // represents some sort of repo corruption, so let the - // error bubble up. - tagCommit, err := tagObj.Commit() - if err != nil { - return &plumbing.ZeroHash, err - } - commit = tagCommit - gotOne = true - break - } - } - - if !gotOne { - return &plumbing.ZeroHash, plumbing.ErrReferenceNotFound - } - - case revision.CaretPath: - depth := item.Depth - - if depth == 0 { - break - } - - iter := commit.Parents() - - c, err := iter.Next() - - if err != nil { - return &plumbing.ZeroHash, err - } - - if depth == 1 { - commit = c - - break - } - - c, err = iter.Next() - - if err != nil { - return &plumbing.ZeroHash, err - } - - commit = c - case revision.TildePath: - for i := 0; i < item.Depth; i++ { - c, err := commit.Parents().Next() - - if err != nil { - return &plumbing.ZeroHash, err - } - - commit = c - } - case revision.CaretReg: - history := object.NewCommitPreorderIter(commit, nil, nil) - - re := item.Regexp - negate := item.Negate - - var c *object.Commit - - err := history.ForEach(func(hc *object.Commit) error { - if !negate && re.MatchString(hc.Message) { - c = hc - return storer.ErrStop - } - - if negate && !re.MatchString(hc.Message) { - c = hc - return storer.ErrStop - } - - return nil - }) - if err != nil { - return &plumbing.ZeroHash, err - } - - if c == nil { - return &plumbing.ZeroHash, fmt.Errorf("no commit message match regexp: %q", re.String()) - } - - commit = c - } - } - - if commit == nil { - return &plumbing.ZeroHash, plumbing.ErrReferenceNotFound - } - - return &commit.Hash, nil -} - -// resolveHashPrefix returns a list of potential hashes that the given string -// is a prefix of. It quietly swallows errors, returning nil. -func (r *Repository) resolveHashPrefix(hashStr string) []plumbing.Hash { - // Handle complete and partial hashes. - // plumbing.NewHash forces args into a full 20 byte hash, which isn't suitable - // for partial hashes since they will become zero-filled. - - if hashStr == "" { - return nil - } - if len(hashStr) == len(plumbing.ZeroHash)*2 { - // Only a full hash is possible. - hexb, err := hex.DecodeString(hashStr) - if err != nil { - return nil - } - var h plumbing.Hash - copy(h[:], hexb) - return []plumbing.Hash{h} - } - - // Partial hash. - // hex.DecodeString only decodes to complete bytes, so only works with pairs of hex digits. - evenHex := hashStr[:len(hashStr)&^1] - hexb, err := hex.DecodeString(evenHex) - if err != nil { - return nil - } - candidates := expandPartialHash(r.Storer, hexb) - if len(evenHex) == len(hashStr) { - // The prefix was an exact number of bytes. - return candidates - } - // Do another prefix check to ensure the dangling nybble is correct. - var hashes []plumbing.Hash - for _, h := range candidates { - if strings.HasPrefix(h.String(), hashStr) { - hashes = append(hashes, h) - } - } - return hashes -} - -type RepackConfig struct { - // UseRefDeltas configures whether packfile encoder will use reference deltas. - // By default OFSDeltaObject is used. - UseRefDeltas bool - // OnlyDeletePacksOlderThan if set to non-zero value - // selects only objects older than the time provided. - OnlyDeletePacksOlderThan time.Time -} - -func (r *Repository) RepackObjects(cfg *RepackConfig) (err error) { - pos, ok := r.Storer.(storer.PackedObjectStorer) - if !ok { - return ErrPackedObjectsNotSupported - } - - // Get the existing object packs. - hs, err := pos.ObjectPacks() - if err != nil { - return err - } - - // Create a new pack. - nh, err := r.createNewObjectPack(cfg) - if err != nil { - return err - } - - // Delete old packs. - for _, h := range hs { - // Skip if new hash is the same as an old one. - if h == nh { - continue - } - err = pos.DeleteOldObjectPackAndIndex(h, cfg.OnlyDeletePacksOlderThan) - if err != nil { - return err - } - } - - return nil -} - -// createNewObjectPack is a helper for RepackObjects taking care -// of creating a new pack. It is used so the the PackfileWriter -// deferred close has the right scope. -func (r *Repository) createNewObjectPack(cfg *RepackConfig) (h plumbing.Hash, err error) { - ow := newObjectWalker(r.Storer) - err = ow.walkAllRefs() - if err != nil { - return h, err - } - objs := make([]plumbing.Hash, 0, len(ow.seen)) - for h := range ow.seen { - objs = append(objs, h) - } - pfw, ok := r.Storer.(storer.PackfileWriter) - if !ok { - return h, fmt.Errorf("Repository storer is not a storer.PackfileWriter") - } - wc, err := pfw.PackfileWriter() - if err != nil { - return h, err - } - defer ioutil.CheckClose(wc, &err) - scfg, err := r.Config() - if err != nil { - return h, err - } - enc := packfile.NewEncoder(wc, r.Storer, cfg.UseRefDeltas) - h, err = enc.Encode(objs, scfg.Pack.Window) - if err != nil { - return h, err - } - - // Delete the packed, loose objects. - if los, ok := r.Storer.(storer.LooseObjectStorer); ok { - err = los.ForEachObjectHash(func(hash plumbing.Hash) error { - if ow.isSeen(hash) { - err = los.DeleteLooseObject(hash) - if err != nil { - return err - } - } - return nil - }) - if err != nil { - return h, err - } - } - - return h, err -} - -func expandPartialHash(st storer.EncodedObjectStorer, prefix []byte) (hashes []plumbing.Hash) { - // The fast version is implemented by storage/filesystem.ObjectStorage. - type fastIter interface { - HashesWithPrefix(prefix []byte) ([]plumbing.Hash, error) - } - if fi, ok := st.(fastIter); ok { - h, err := fi.HashesWithPrefix(prefix) - if err != nil { - return nil - } - return h - } - - // Slow path. - iter, err := st.IterEncodedObjects(plumbing.AnyObject) - if err != nil { - return nil - } - iter.ForEach(func(obj plumbing.EncodedObject) error { - h := obj.Hash() - if bytes.HasPrefix(h[:], prefix) { - hashes = append(hashes, h) - } - return nil - }) - return -} diff --git a/vendor/github.com/go-git/go-git/v5/status.go b/vendor/github.com/go-git/go-git/v5/status.go deleted file mode 100644 index 7f18e02278..0000000000 --- a/vendor/github.com/go-git/go-git/v5/status.go +++ /dev/null @@ -1,79 +0,0 @@ -package git - -import ( - "bytes" - "fmt" - "path/filepath" -) - -// Status represents the current status of a Worktree. -// The key of the map is the path of the file. -type Status map[string]*FileStatus - -// File returns the FileStatus for a given path, if the FileStatus doesn't -// exists a new FileStatus is added to the map using the path as key. -func (s Status) File(path string) *FileStatus { - if _, ok := (s)[path]; !ok { - s[path] = &FileStatus{Worktree: Untracked, Staging: Untracked} - } - - return s[path] -} - -// IsUntracked checks if file for given path is 'Untracked' -func (s Status) IsUntracked(path string) bool { - stat, ok := (s)[filepath.ToSlash(path)] - return ok && stat.Worktree == Untracked -} - -// IsClean returns true if all the files are in Unmodified status. -func (s Status) IsClean() bool { - for _, status := range s { - if status.Worktree != Unmodified || status.Staging != Unmodified { - return false - } - } - - return true -} - -func (s Status) String() string { - buf := bytes.NewBuffer(nil) - for path, status := range s { - if status.Staging == Unmodified && status.Worktree == Unmodified { - continue - } - - if status.Staging == Renamed { - path = fmt.Sprintf("%s -> %s", path, status.Extra) - } - - fmt.Fprintf(buf, "%c%c %s\n", status.Staging, status.Worktree, path) - } - - return buf.String() -} - -// FileStatus contains the status of a file in the worktree -type FileStatus struct { - // Staging is the status of a file in the staging area - Staging StatusCode - // Worktree is the status of a file in the worktree - Worktree StatusCode - // Extra contains extra information, such as the previous name in a rename - Extra string -} - -// StatusCode status code of a file in the Worktree -type StatusCode byte - -const ( - Unmodified StatusCode = ' ' - Untracked StatusCode = '?' - Modified StatusCode = 'M' - Added StatusCode = 'A' - Deleted StatusCode = 'D' - Renamed StatusCode = 'R' - Copied StatusCode = 'C' - UpdatedButUnmerged StatusCode = 'U' -) diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go deleted file mode 100644 index 78a646465a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/config.go +++ /dev/null @@ -1,48 +0,0 @@ -package filesystem - -import ( - "os" - - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -type ConfigStorage struct { - dir *dotgit.DotGit -} - -func (c *ConfigStorage) Config() (conf *config.Config, err error) { - f, err := c.dir.Config() - if err != nil { - if os.IsNotExist(err) { - return config.NewConfig(), nil - } - - return nil, err - } - - defer ioutil.CheckClose(f, &err) - return config.ReadConfig(f) -} - -func (c *ConfigStorage) SetConfig(cfg *config.Config) (err error) { - if err = cfg.Validate(); err != nil { - return err - } - - f, err := c.dir.ConfigWriter() - if err != nil { - return err - } - - defer ioutil.CheckClose(f, &err) - - b, err := cfg.Marshal() - if err != nil { - return err - } - - _, err = f.Write(b) - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/deltaobject.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/deltaobject.go deleted file mode 100644 index 6ab2cdf38a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/deltaobject.go +++ /dev/null @@ -1,37 +0,0 @@ -package filesystem - -import ( - "github.com/go-git/go-git/v5/plumbing" -) - -type deltaObject struct { - plumbing.EncodedObject - base plumbing.Hash - hash plumbing.Hash - size int64 -} - -func newDeltaObject( - obj plumbing.EncodedObject, - hash plumbing.Hash, - base plumbing.Hash, - size int64) plumbing.DeltaObject { - return &deltaObject{ - EncodedObject: obj, - hash: hash, - base: base, - size: size, - } -} - -func (o *deltaObject) BaseHash() plumbing.Hash { - return o.base -} - -func (o *deltaObject) ActualSize() int64 { - return o.size -} - -func (o *deltaObject) ActualHash() plumbing.Hash { - return o.hash -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go deleted file mode 100644 index 31c4694816..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit.go +++ /dev/null @@ -1,1255 +0,0 @@ -// https://github.com/git/git/blob/master/Documentation/gitrepository-layout.txt -package dotgit - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "os" - "path" - "path/filepath" - "reflect" - "runtime" - "sort" - "strings" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/hash" - "github.com/go-git/go-git/v5/storage" - "github.com/go-git/go-git/v5/utils/ioutil" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/helper/chroot" -) - -const ( - suffix = ".git" - packedRefsPath = "packed-refs" - configPath = "config" - indexPath = "index" - shallowPath = "shallow" - modulePath = "modules" - objectsPath = "objects" - packPath = "pack" - refsPath = "refs" - branchesPath = "branches" - hooksPath = "hooks" - infoPath = "info" - remotesPath = "remotes" - logsPath = "logs" - worktreesPath = "worktrees" - alternatesPath = "alternates" - - tmpPackedRefsPrefix = "._packed-refs" - - packPrefix = "pack-" - packExt = ".pack" - idxExt = ".idx" -) - -var ( - // ErrNotFound is returned by New when the path is not found. - ErrNotFound = errors.New("path not found") - // ErrIdxNotFound is returned by Idxfile when the idx file is not found - ErrIdxNotFound = errors.New("idx file not found") - // ErrPackfileNotFound is returned by Packfile when the packfile is not found - ErrPackfileNotFound = errors.New("packfile not found") - // ErrConfigNotFound is returned by Config when the config is not found - ErrConfigNotFound = errors.New("config file not found") - // ErrPackedRefsDuplicatedRef is returned when a duplicated reference is - // found in the packed-ref file. This is usually the case for corrupted git - // repositories. - ErrPackedRefsDuplicatedRef = errors.New("duplicated ref found in packed-ref file") - // ErrPackedRefsBadFormat is returned when the packed-ref file corrupt. - ErrPackedRefsBadFormat = errors.New("malformed packed-ref") - // ErrSymRefTargetNotFound is returned when a symbolic reference is - // targeting a non-existing object. This usually means the repository - // is corrupt. - ErrSymRefTargetNotFound = errors.New("symbolic reference target not found") - // ErrIsDir is returned when a reference file is attempting to be read, - // but the path specified is a directory. - ErrIsDir = errors.New("reference path is a directory") -) - -// Options holds configuration for the storage. -type Options struct { - // ExclusiveAccess means that the filesystem is not modified externally - // while the repo is open. - ExclusiveAccess bool - // KeepDescriptors makes the file descriptors to be reused but they will - // need to be manually closed calling Close(). - KeepDescriptors bool - // AlternatesFS provides the billy filesystem to be used for Git Alternates. - // If none is provided, it falls back to using the underlying instance used for - // DotGit. - AlternatesFS billy.Filesystem -} - -// The DotGit type represents a local git repository on disk. This -// type is not zero-value-safe, use the New function to initialize it. -type DotGit struct { - options Options - fs billy.Filesystem - - // incoming object directory information - incomingChecked bool - incomingDirName string - - objectList []plumbing.Hash // sorted - objectMap map[plumbing.Hash]struct{} - packList []plumbing.Hash - packMap map[plumbing.Hash]struct{} - - files map[plumbing.Hash]billy.File -} - -// New returns a DotGit value ready to be used. The path argument must -// be the absolute path of a git repository directory (e.g. -// "/foo/bar/.git"). -func New(fs billy.Filesystem) *DotGit { - return NewWithOptions(fs, Options{}) -} - -// NewWithOptions sets non default configuration options. -// See New for complete help. -func NewWithOptions(fs billy.Filesystem, o Options) *DotGit { - return &DotGit{ - options: o, - fs: fs, - } -} - -// Initialize creates all the folder scaffolding. -func (d *DotGit) Initialize() error { - mustExists := []string{ - d.fs.Join("objects", "info"), - d.fs.Join("objects", "pack"), - d.fs.Join("refs", "heads"), - d.fs.Join("refs", "tags"), - } - - for _, path := range mustExists { - _, err := d.fs.Stat(path) - if err == nil { - continue - } - - if !os.IsNotExist(err) { - return err - } - - if err := d.fs.MkdirAll(path, os.ModeDir|os.ModePerm); err != nil { - return err - } - } - - return nil -} - -// Close closes all opened files. -func (d *DotGit) Close() error { - var firstError error - if d.files != nil { - for _, f := range d.files { - err := f.Close() - if err != nil && firstError == nil { - firstError = err - continue - } - } - - d.files = nil - } - - if firstError != nil { - return firstError - } - - return nil -} - -// ConfigWriter returns a file pointer for write to the config file -func (d *DotGit) ConfigWriter() (billy.File, error) { - return d.fs.Create(configPath) -} - -// Config returns a file pointer for read to the config file -func (d *DotGit) Config() (billy.File, error) { - return d.fs.Open(configPath) -} - -// IndexWriter returns a file pointer for write to the index file -func (d *DotGit) IndexWriter() (billy.File, error) { - return d.fs.Create(indexPath) -} - -// Index returns a file pointer for read to the index file -func (d *DotGit) Index() (billy.File, error) { - return d.fs.Open(indexPath) -} - -// ShallowWriter returns a file pointer for write to the shallow file -func (d *DotGit) ShallowWriter() (billy.File, error) { - return d.fs.Create(shallowPath) -} - -// Shallow returns a file pointer for read to the shallow file -func (d *DotGit) Shallow() (billy.File, error) { - f, err := d.fs.Open(shallowPath) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - - return nil, err - } - - return f, nil -} - -// NewObjectPack return a writer for a new packfile, it saves the packfile to -// disk and also generates and save the index for the given packfile. -func (d *DotGit) NewObjectPack() (*PackWriter, error) { - d.cleanPackList() - return newPackWrite(d.fs) -} - -// ObjectPacks returns the list of availables packfiles -func (d *DotGit) ObjectPacks() ([]plumbing.Hash, error) { - if !d.options.ExclusiveAccess { - return d.objectPacks() - } - - err := d.genPackList() - if err != nil { - return nil, err - } - - return d.packList, nil -} - -func (d *DotGit) objectPacks() ([]plumbing.Hash, error) { - packDir := d.fs.Join(objectsPath, packPath) - files, err := d.fs.ReadDir(packDir) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - - return nil, err - } - - var packs []plumbing.Hash - for _, f := range files { - n := f.Name() - if !strings.HasSuffix(n, packExt) || !strings.HasPrefix(n, packPrefix) { - continue - } - - h := plumbing.NewHash(n[5 : len(n)-5]) //pack-(hash).pack - if h.IsZero() { - // Ignore files with badly-formatted names. - continue - } - packs = append(packs, h) - } - - return packs, nil -} - -func (d *DotGit) objectPackPath(hash plumbing.Hash, extension string) string { - return d.fs.Join(objectsPath, packPath, fmt.Sprintf("pack-%s.%s", hash.String(), extension)) -} - -func (d *DotGit) objectPackOpen(hash plumbing.Hash, extension string) (billy.File, error) { - if d.options.KeepDescriptors && extension == "pack" { - if d.files == nil { - d.files = make(map[plumbing.Hash]billy.File) - } - - f, ok := d.files[hash] - if ok { - return f, nil - } - } - - err := d.hasPack(hash) - if err != nil { - return nil, err - } - - path := d.objectPackPath(hash, extension) - pack, err := d.fs.Open(path) - if err != nil { - if os.IsNotExist(err) { - return nil, ErrPackfileNotFound - } - - return nil, err - } - - if d.options.KeepDescriptors && extension == "pack" { - d.files[hash] = pack - } - - return pack, nil -} - -// ObjectPack returns a fs.File of the given packfile -func (d *DotGit) ObjectPack(hash plumbing.Hash) (billy.File, error) { - err := d.hasPack(hash) - if err != nil { - return nil, err - } - - return d.objectPackOpen(hash, `pack`) -} - -// ObjectPackIdx returns a fs.File of the index file for a given packfile -func (d *DotGit) ObjectPackIdx(hash plumbing.Hash) (billy.File, error) { - err := d.hasPack(hash) - if err != nil { - return nil, err - } - - return d.objectPackOpen(hash, `idx`) -} - -func (d *DotGit) DeleteOldObjectPackAndIndex(hash plumbing.Hash, t time.Time) error { - d.cleanPackList() - - path := d.objectPackPath(hash, `pack`) - if !t.IsZero() { - fi, err := d.fs.Stat(path) - if err != nil { - return err - } - // too new, skip deletion. - if !fi.ModTime().Before(t) { - return nil - } - } - err := d.fs.Remove(path) - if err != nil { - return err - } - return d.fs.Remove(d.objectPackPath(hash, `idx`)) -} - -// NewObject return a writer for a new object file. -func (d *DotGit) NewObject() (*ObjectWriter, error) { - d.cleanObjectList() - - return newObjectWriter(d.fs) -} - -// ObjectsWithPrefix returns the hashes of objects that have the given prefix. -func (d *DotGit) ObjectsWithPrefix(prefix []byte) ([]plumbing.Hash, error) { - // Handle edge cases. - if len(prefix) < 1 { - return d.Objects() - } else if len(prefix) > len(plumbing.ZeroHash) { - return nil, nil - } - - if d.options.ExclusiveAccess { - err := d.genObjectList() - if err != nil { - return nil, err - } - - // Rely on d.objectList being sorted. - // Figure out the half-open interval defined by the prefix. - first := sort.Search(len(d.objectList), func(i int) bool { - // Same as plumbing.HashSlice.Less. - return bytes.Compare(d.objectList[i][:], prefix) >= 0 - }) - lim := len(d.objectList) - if limPrefix, overflow := incBytes(prefix); !overflow { - lim = sort.Search(len(d.objectList), func(i int) bool { - // Same as plumbing.HashSlice.Less. - return bytes.Compare(d.objectList[i][:], limPrefix) >= 0 - }) - } - return d.objectList[first:lim], nil - } - - // This is the slow path. - var objects []plumbing.Hash - var n int - err := d.ForEachObjectHash(func(hash plumbing.Hash) error { - n++ - if bytes.HasPrefix(hash[:], prefix) { - objects = append(objects, hash) - } - return nil - }) - if err != nil { - return nil, err - } - return objects, nil -} - -// Objects returns a slice with the hashes of objects found under the -// .git/objects/ directory. -func (d *DotGit) Objects() ([]plumbing.Hash, error) { - if d.options.ExclusiveAccess { - err := d.genObjectList() - if err != nil { - return nil, err - } - - return d.objectList, nil - } - - var objects []plumbing.Hash - err := d.ForEachObjectHash(func(hash plumbing.Hash) error { - objects = append(objects, hash) - return nil - }) - if err != nil { - return nil, err - } - return objects, nil -} - -// ForEachObjectHash iterates over the hashes of objects found under the -// .git/objects/ directory and executes the provided function. -func (d *DotGit) ForEachObjectHash(fun func(plumbing.Hash) error) error { - if !d.options.ExclusiveAccess { - return d.forEachObjectHash(fun) - } - - err := d.genObjectList() - if err != nil { - return err - } - - for _, h := range d.objectList { - err := fun(h) - if err != nil { - return err - } - } - - return nil -} - -func (d *DotGit) forEachObjectHash(fun func(plumbing.Hash) error) error { - files, err := d.fs.ReadDir(objectsPath) - if err != nil { - if os.IsNotExist(err) { - return nil - } - - return err - } - - for _, f := range files { - if f.IsDir() && len(f.Name()) == 2 && isHex(f.Name()) { - base := f.Name() - d, err := d.fs.ReadDir(d.fs.Join(objectsPath, base)) - if err != nil { - return err - } - - for _, o := range d { - h := plumbing.NewHash(base + o.Name()) - if h.IsZero() { - // Ignore files with badly-formatted names. - continue - } - err = fun(h) - if err != nil { - return err - } - } - } - } - - return nil -} - -func (d *DotGit) cleanObjectList() { - d.objectMap = nil - d.objectList = nil -} - -func (d *DotGit) genObjectList() error { - if d.objectMap != nil { - return nil - } - - d.objectMap = make(map[plumbing.Hash]struct{}) - populate := func(h plumbing.Hash) error { - d.objectList = append(d.objectList, h) - d.objectMap[h] = struct{}{} - - return nil - } - if err := d.forEachObjectHash(populate); err != nil { - return err - } - plumbing.HashesSort(d.objectList) - return nil -} - -func (d *DotGit) hasObject(h plumbing.Hash) error { - if !d.options.ExclusiveAccess { - return nil - } - - err := d.genObjectList() - if err != nil { - return err - } - - _, ok := d.objectMap[h] - if !ok { - return plumbing.ErrObjectNotFound - } - - return nil -} - -func (d *DotGit) cleanPackList() { - d.packMap = nil - d.packList = nil -} - -func (d *DotGit) genPackList() error { - if d.packMap != nil { - return nil - } - - op, err := d.objectPacks() - if err != nil { - return err - } - - d.packMap = make(map[plumbing.Hash]struct{}) - d.packList = nil - - for _, h := range op { - d.packList = append(d.packList, h) - d.packMap[h] = struct{}{} - } - - return nil -} - -func (d *DotGit) hasPack(h plumbing.Hash) error { - if !d.options.ExclusiveAccess { - return nil - } - - err := d.genPackList() - if err != nil { - return err - } - - _, ok := d.packMap[h] - if !ok { - return ErrPackfileNotFound - } - - return nil -} - -func (d *DotGit) objectPath(h plumbing.Hash) string { - hex := h.String() - return d.fs.Join(objectsPath, hex[0:2], hex[2:hash.HexSize]) -} - -// incomingObjectPath is intended to add support for a git pre-receive hook -// to be written it adds support for go-git to find objects in an "incoming" -// directory, so that the library can be used to write a pre-receive hook -// that deals with the incoming objects. -// -// More on git hooks found here : https://git-scm.com/docs/githooks -// More on 'quarantine'/incoming directory here: -// -// https://git-scm.com/docs/git-receive-pack -func (d *DotGit) incomingObjectPath(h plumbing.Hash) string { - hString := h.String() - - if d.incomingDirName == "" { - return d.fs.Join(objectsPath, hString[0:2], hString[2:hash.HexSize]) - } - - return d.fs.Join(objectsPath, d.incomingDirName, hString[0:2], hString[2:hash.HexSize]) -} - -// hasIncomingObjects searches for an incoming directory and keeps its name -// so it doesn't have to be found each time an object is accessed. -func (d *DotGit) hasIncomingObjects() bool { - if !d.incomingChecked { - directoryContents, err := d.fs.ReadDir(objectsPath) - if err == nil { - for _, file := range directoryContents { - if file.IsDir() && (strings.HasPrefix(file.Name(), "tmp_objdir-incoming-") || - // Before Git 2.35 incoming commits directory had another prefix - strings.HasPrefix(file.Name(), "incoming-")) { - d.incomingDirName = file.Name() - } - } - } - - d.incomingChecked = true - } - - return d.incomingDirName != "" -} - -// Object returns a fs.File pointing the object file, if exists -func (d *DotGit) Object(h plumbing.Hash) (billy.File, error) { - err := d.hasObject(h) - if err != nil { - return nil, err - } - - obj1, err1 := d.fs.Open(d.objectPath(h)) - if os.IsNotExist(err1) && d.hasIncomingObjects() { - obj2, err2 := d.fs.Open(d.incomingObjectPath(h)) - if err2 != nil { - return obj1, err1 - } - return obj2, err2 - } - return obj1, err1 -} - -// ObjectStat returns a os.FileInfo pointing the object file, if exists -func (d *DotGit) ObjectStat(h plumbing.Hash) (os.FileInfo, error) { - err := d.hasObject(h) - if err != nil { - return nil, err - } - - obj1, err1 := d.fs.Stat(d.objectPath(h)) - if os.IsNotExist(err1) && d.hasIncomingObjects() { - obj2, err2 := d.fs.Stat(d.incomingObjectPath(h)) - if err2 != nil { - return obj1, err1 - } - return obj2, err2 - } - return obj1, err1 -} - -// ObjectDelete removes the object file, if exists -func (d *DotGit) ObjectDelete(h plumbing.Hash) error { - d.cleanObjectList() - - err1 := d.fs.Remove(d.objectPath(h)) - if os.IsNotExist(err1) && d.hasIncomingObjects() { - err2 := d.fs.Remove(d.incomingObjectPath(h)) - if err2 != nil { - return err1 - } - return err2 - } - return err1 -} - -func (d *DotGit) readReferenceFrom(rd io.Reader, name string) (ref *plumbing.Reference, err error) { - b, err := io.ReadAll(rd) - if err != nil { - return nil, err - } - - line := strings.TrimSpace(string(b)) - return plumbing.NewReferenceFromStrings(name, line), nil -} - -func (d *DotGit) checkReferenceAndTruncate(f billy.File, old *plumbing.Reference) error { - if old == nil { - return nil - } - ref, err := d.readReferenceFrom(f, old.Name().String()) - if err != nil { - return err - } - if ref.Hash() != old.Hash() { - return storage.ErrReferenceHasChanged - } - _, err = f.Seek(0, io.SeekStart) - if err != nil { - return err - } - return f.Truncate(0) -} - -func (d *DotGit) SetRef(r, old *plumbing.Reference) error { - var content string - switch r.Type() { - case plumbing.SymbolicReference: - content = fmt.Sprintf("ref: %s\n", r.Target()) - case plumbing.HashReference: - content = fmt.Sprintln(r.Hash().String()) - } - - fileName := r.Name().String() - - return d.setRef(fileName, content, old) -} - -// Refs scans the git directory collecting references, which it returns. -// Symbolic references are resolved and included in the output. -func (d *DotGit) Refs() ([]*plumbing.Reference, error) { - var refs []*plumbing.Reference - var seen = make(map[plumbing.ReferenceName]bool) - if err := d.addRefsFromRefDir(&refs, seen); err != nil { - return nil, err - } - - if err := d.addRefsFromPackedRefs(&refs, seen); err != nil { - return nil, err - } - - if err := d.addRefFromHEAD(&refs); err != nil { - return nil, err - } - - return refs, nil -} - -// Ref returns the reference for a given reference name. -func (d *DotGit) Ref(name plumbing.ReferenceName) (*plumbing.Reference, error) { - ref, err := d.readReferenceFile(".", name.String()) - if err == nil { - return ref, nil - } - - return d.packedRef(name) -} - -func (d *DotGit) findPackedRefsInFile(f billy.File, recv refsRecv) error { - s := bufio.NewScanner(f) - for s.Scan() { - ref, err := d.processLine(s.Text()) - if err != nil { - return err - } - - if !recv(ref) { - // skip parse - return nil - } - } - if err := s.Err(); err != nil { - return err - } - return nil -} - -// refsRecv: returning true means that the reference continues to be resolved, otherwise it is stopped, which will speed up the lookup of a single reference. -type refsRecv func(*plumbing.Reference) bool - -func (d *DotGit) findPackedRefs(recv refsRecv) error { - f, err := d.fs.Open(packedRefsPath) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - - defer ioutil.CheckClose(f, &err) - return d.findPackedRefsInFile(f, recv) -} - -func (d *DotGit) packedRef(name plumbing.ReferenceName) (*plumbing.Reference, error) { - var ref *plumbing.Reference - if err := d.findPackedRefs(func(r *plumbing.Reference) bool { - if r != nil && r.Name() == name { - ref = r - // ref found - return false - } - return true - }); err != nil { - return nil, err - } - if ref != nil { - return ref, nil - } - return nil, plumbing.ErrReferenceNotFound -} - -// RemoveRef removes a reference by name. -func (d *DotGit) RemoveRef(name plumbing.ReferenceName) error { - path := d.fs.Join(".", name.String()) - _, err := d.fs.Stat(path) - if err == nil { - err = d.fs.Remove(path) - // Drop down to remove it from the packed refs file, too. - } - - if err != nil && !os.IsNotExist(err) { - return err - } - - return d.rewritePackedRefsWithoutRef(name) -} - -func refsRecvFunc(refs *[]*plumbing.Reference, seen map[plumbing.ReferenceName]bool) refsRecv { - return func(r *plumbing.Reference) bool { - if r != nil && !seen[r.Name()] { - *refs = append(*refs, r) - seen[r.Name()] = true - } - return true - } -} - -func (d *DotGit) addRefsFromPackedRefs(refs *[]*plumbing.Reference, seen map[plumbing.ReferenceName]bool) (err error) { - return d.findPackedRefs(refsRecvFunc(refs, seen)) -} - -func (d *DotGit) addRefsFromPackedRefsFile(refs *[]*plumbing.Reference, f billy.File, seen map[plumbing.ReferenceName]bool) (err error) { - return d.findPackedRefsInFile(f, refsRecvFunc(refs, seen)) -} - -func (d *DotGit) openAndLockPackedRefs(doCreate bool) ( - pr billy.File, err error) { - var f billy.File - defer func() { - if err != nil && f != nil { - ioutil.CheckClose(f, &err) - } - }() - - // File mode is retrieved from a constant defined in the target specific - // files (dotgit_rewrite_packed_refs_*). Some modes are not available - // in all filesystems. - openFlags := d.openAndLockPackedRefsMode() - if doCreate { - openFlags |= os.O_CREATE - } - - // Keep trying to open and lock the file until we're sure the file - // didn't change between the open and the lock. - for { - f, err = d.fs.OpenFile(packedRefsPath, openFlags, 0600) - if err != nil { - if os.IsNotExist(err) && !doCreate { - return nil, nil - } - - return nil, err - } - fi, err := d.fs.Stat(packedRefsPath) - if err != nil { - return nil, err - } - mtime := fi.ModTime() - - err = f.Lock() - if err != nil { - return nil, err - } - - fi, err = d.fs.Stat(packedRefsPath) - if err != nil { - return nil, err - } - if mtime.Equal(fi.ModTime()) { - break - } - // The file has changed since we opened it. Close and retry. - err = f.Close() - if err != nil { - return nil, err - } - } - return f, nil -} - -func (d *DotGit) rewritePackedRefsWithoutRef(name plumbing.ReferenceName) (err error) { - pr, err := d.openAndLockPackedRefs(false) - if err != nil { - return err - } - if pr == nil { - return nil - } - defer ioutil.CheckClose(pr, &err) - - // Creating the temp file in the same directory as the target file - // improves our chances for rename operation to be atomic. - tmp, err := d.fs.TempFile("", tmpPackedRefsPrefix) - if err != nil { - return err - } - tmpName := tmp.Name() - defer func() { - ioutil.CheckClose(tmp, &err) - _ = d.fs.Remove(tmpName) // don't check err, we might have renamed it - }() - - s := bufio.NewScanner(pr) - found := false - for s.Scan() { - line := s.Text() - ref, err := d.processLine(line) - if err != nil { - return err - } - - if ref != nil && ref.Name() == name { - found = true - continue - } - - if _, err := fmt.Fprintln(tmp, line); err != nil { - return err - } - } - - if err := s.Err(); err != nil { - return err - } - - if !found { - return nil - } - - return d.rewritePackedRefsWhileLocked(tmp, pr) -} - -// process lines from a packed-refs file -func (d *DotGit) processLine(line string) (*plumbing.Reference, error) { - if len(line) == 0 { - return nil, nil - } - - switch line[0] { - case '#': // comment - ignore - return nil, nil - case '^': // annotated tag commit of the previous line - ignore - return nil, nil - default: - ws := strings.Split(line, " ") // hash then ref - if len(ws) != 2 { - return nil, ErrPackedRefsBadFormat - } - - return plumbing.NewReferenceFromStrings(ws[1], ws[0]), nil - } -} - -func (d *DotGit) addRefsFromRefDir(refs *[]*plumbing.Reference, seen map[plumbing.ReferenceName]bool) error { - return d.walkReferencesTree(refs, []string{refsPath}, seen) -} - -func (d *DotGit) walkReferencesTree(refs *[]*plumbing.Reference, relPath []string, seen map[plumbing.ReferenceName]bool) error { - files, err := d.fs.ReadDir(d.fs.Join(relPath...)) - if err != nil { - if os.IsNotExist(err) { - // a race happened, and our directory is gone now - return nil - } - - return err - } - - for _, f := range files { - newRelPath := append(append([]string(nil), relPath...), f.Name()) - if f.IsDir() { - if err = d.walkReferencesTree(refs, newRelPath, seen); err != nil { - return err - } - - continue - } - - ref, err := d.readReferenceFile(".", strings.Join(newRelPath, "/")) - if os.IsNotExist(err) { - // a race happened, and our file is gone now - continue - } - if err != nil { - return err - } - - if ref != nil && !seen[ref.Name()] { - *refs = append(*refs, ref) - seen[ref.Name()] = true - } - } - - return nil -} - -func (d *DotGit) addRefFromHEAD(refs *[]*plumbing.Reference) error { - ref, err := d.readReferenceFile(".", "HEAD") - if err != nil { - if os.IsNotExist(err) { - return nil - } - - return err - } - - *refs = append(*refs, ref) - return nil -} - -func (d *DotGit) readReferenceFile(path, name string) (ref *plumbing.Reference, err error) { - path = d.fs.Join(path, d.fs.Join(strings.Split(name, "/")...)) - st, err := d.fs.Stat(path) - if err != nil { - return nil, err - } - if st.IsDir() { - return nil, ErrIsDir - } - - f, err := d.fs.Open(path) - if err != nil { - return nil, err - } - defer ioutil.CheckClose(f, &err) - - return d.readReferenceFrom(f, name) -} - -func (d *DotGit) CountLooseRefs() (int, error) { - var refs []*plumbing.Reference - var seen = make(map[plumbing.ReferenceName]bool) - if err := d.addRefsFromRefDir(&refs, seen); err != nil { - return 0, err - } - - return len(refs), nil -} - -// PackRefs packs all loose refs into the packed-refs file. -// -// This implementation only works under the assumption that the view -// of the file system won't be updated during this operation. This -// strategy would not work on a general file system though, without -// locking each loose reference and checking it again before deleting -// the file, because otherwise an updated reference could sneak in and -// then be deleted by the packed-refs process. Alternatively, every -// ref update could also lock packed-refs, so only one lock is -// required during ref-packing. But that would worsen performance in -// the common case. -// -// TODO: add an "all" boolean like the `git pack-refs --all` flag. -// When `all` is false, it would only pack refs that have already been -// packed, plus all tags. -func (d *DotGit) PackRefs() (err error) { - // Lock packed-refs, and create it if it doesn't exist yet. - f, err := d.openAndLockPackedRefs(true) - if err != nil { - return err - } - defer ioutil.CheckClose(f, &err) - - // Gather all refs using addRefsFromRefDir and addRefsFromPackedRefs. - var refs []*plumbing.Reference - seen := make(map[plumbing.ReferenceName]bool) - if err = d.addRefsFromRefDir(&refs, seen); err != nil { - return err - } - if len(refs) == 0 { - // Nothing to do! - return nil - } - numLooseRefs := len(refs) - if err = d.addRefsFromPackedRefsFile(&refs, f, seen); err != nil { - return err - } - - // Write them all to a new temp packed-refs file. - tmp, err := d.fs.TempFile("", tmpPackedRefsPrefix) - if err != nil { - return err - } - tmpName := tmp.Name() - defer func() { - ioutil.CheckClose(tmp, &err) - _ = d.fs.Remove(tmpName) // don't check err, we might have renamed it - }() - - w := bufio.NewWriter(tmp) - for _, ref := range refs { - _, err = w.WriteString(ref.String() + "\n") - if err != nil { - return err - } - } - err = w.Flush() - if err != nil { - return err - } - - // Rename the temp packed-refs file. - err = d.rewritePackedRefsWhileLocked(tmp, f) - if err != nil { - return err - } - - // Delete all the loose refs, while still holding the packed-refs - // lock. - for _, ref := range refs[:numLooseRefs] { - path := d.fs.Join(".", ref.Name().String()) - err = d.fs.Remove(path) - if err != nil && !os.IsNotExist(err) { - return err - } - } - - return nil -} - -// Module return a billy.Filesystem pointing to the module folder -func (d *DotGit) Module(name string) (billy.Filesystem, error) { - return d.fs.Chroot(d.fs.Join(modulePath, name)) -} - -func (d *DotGit) AddAlternate(remote string) error { - altpath := d.fs.Join(objectsPath, infoPath, alternatesPath) - - f, err := d.fs.OpenFile(altpath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0640) - if err != nil { - return fmt.Errorf("cannot open file: %w", err) - } - defer f.Close() - - // locking in windows throws an error, based on comments - // https://github.com/go-git/go-git/pull/860#issuecomment-1751823044 - // do not lock on windows platform. - if runtime.GOOS != "windows" { - if err = f.Lock(); err != nil { - return fmt.Errorf("cannot lock file: %w", err) - } - defer f.Unlock() - } - - line := path.Join(remote, objectsPath) + "\n" - _, err = io.WriteString(f, line) - if err != nil { - return fmt.Errorf("error writing 'alternates' file: %w", err) - } - - return nil -} - -// Alternates returns DotGit(s) based off paths in objects/info/alternates if -// available. This can be used to checks if it's a shared repository. -func (d *DotGit) Alternates() ([]*DotGit, error) { - altpath := d.fs.Join(objectsPath, infoPath, alternatesPath) - f, err := d.fs.Open(altpath) - if err != nil { - return nil, err - } - defer f.Close() - - fs := d.options.AlternatesFS - if fs == nil { - fs = d.fs - } - - var alternates []*DotGit - seen := make(map[string]struct{}) - - // Read alternate paths line-by-line and create DotGit objects. - scanner := bufio.NewScanner(f) - for scanner.Scan() { - path := scanner.Text() - - // Avoid creating multiple dotgits for the same alternative path. - if _, ok := seen[path]; ok { - continue - } - - seen[path] = struct{}{} - - if filepath.IsAbs(path) { - // Handling absolute paths should be straight-forward. However, the default osfs (Chroot) - // tries to concatenate an abs path with the root path in some operations (e.g. Stat), - // which leads to unexpected errors. Therefore, make the path relative to the current FS instead. - if reflect.TypeOf(fs) == reflect.TypeOf(&chroot.ChrootHelper{}) { - path, err = filepath.Rel(fs.Root(), path) - if err != nil { - return nil, fmt.Errorf("cannot make path %q relative: %w", path, err) - } - } - } else { - // By Git conventions, relative paths should be based on the object database (.git/objects/info) - // location as per: https://www.kernel.org/pub/software/scm/git/docs/gitrepository-layout.html - // However, due to the nature of go-git and its filesystem handling via Billy, paths cannot - // cross its "chroot boundaries". Therefore, ignore any "../" and treat the path from the - // fs root. If this is not correct based on the dotgit fs, set a different one via AlternatesFS. - abs := filepath.Join(string(filepath.Separator), filepath.ToSlash(path)) - path = filepath.FromSlash(abs) - } - - // Aligns with upstream behavior: exit if target path is not a valid directory. - if fi, err := fs.Stat(path); err != nil || !fi.IsDir() { - return nil, fmt.Errorf("invalid object directory %q: %w", path, err) - } - afs, err := fs.Chroot(filepath.Dir(path)) - if err != nil { - return nil, fmt.Errorf("cannot chroot %q: %w", path, err) - } - alternates = append(alternates, New(afs)) - } - - if err = scanner.Err(); err != nil { - return nil, err - } - - return alternates, nil -} - -// Fs returns the underlying filesystem of the DotGit folder. -func (d *DotGit) Fs() billy.Filesystem { - return d.fs -} - -func isHex(s string) bool { - for _, b := range []byte(s) { - if isNum(b) { - continue - } - if isHexAlpha(b) { - continue - } - - return false - } - - return true -} - -func isNum(b byte) bool { - return b >= '0' && b <= '9' -} - -func isHexAlpha(b byte) bool { - return b >= 'a' && b <= 'f' || b >= 'A' && b <= 'F' -} - -// incBytes increments a byte slice, which involves incrementing the -// right-most byte, and following carry leftward. -// It makes a copy so that the provided slice's underlying array is not modified. -// If the overall operation overflows (e.g. incBytes(0xff, 0xff)), the second return parameter indicates that. -func incBytes(in []byte) (out []byte, overflow bool) { - out = make([]byte, len(in)) - copy(out, in) - for i := len(out) - 1; i >= 0; i-- { - out[i]++ - if out[i] != 0 { - return // Didn't overflow. - } - } - overflow = true - return -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_rewrite_packed_refs.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_rewrite_packed_refs.go deleted file mode 100644 index 43263eadfa..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_rewrite_packed_refs.go +++ /dev/null @@ -1,81 +0,0 @@ -package dotgit - -import ( - "io" - "os" - "runtime" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -func (d *DotGit) openAndLockPackedRefsMode() int { - if billy.CapabilityCheck(d.fs, billy.ReadAndWriteCapability) { - return os.O_RDWR - } - - return os.O_RDONLY -} - -func (d *DotGit) rewritePackedRefsWhileLocked( - tmp billy.File, pr billy.File) error { - // Try plain rename. If we aren't using the bare Windows filesystem as the - // storage layer, we might be able to get away with a rename over a locked - // file. - err := d.fs.Rename(tmp.Name(), pr.Name()) - if err == nil { - return nil - } - - // If we are in a filesystem that does not support rename (e.g. sivafs) - // a full copy is done. - if err == billy.ErrNotSupported { - return d.copyNewFile(tmp, pr) - } - - if runtime.GOOS != "windows" { - return err - } - - // Otherwise, Windows doesn't let us rename over a locked file, so - // we have to do a straight copy. Unfortunately this could result - // in a partially-written file if the process fails before the - // copy completes. - return d.copyToExistingFile(tmp, pr) -} - -func (d *DotGit) copyToExistingFile(tmp, pr billy.File) error { - _, err := pr.Seek(0, io.SeekStart) - if err != nil { - return err - } - err = pr.Truncate(0) - if err != nil { - return err - } - _, err = tmp.Seek(0, io.SeekStart) - if err != nil { - return err - } - _, err = io.Copy(pr, tmp) - - return err -} - -func (d *DotGit) copyNewFile(tmp billy.File, pr billy.File) (err error) { - prWrite, err := d.fs.Create(pr.Name()) - if err != nil { - return err - } - - defer ioutil.CheckClose(prWrite, &err) - - _, err = tmp.Seek(0, io.SeekStart) - if err != nil { - return err - } - - _, err = io.Copy(prWrite, tmp) - - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_setref.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_setref.go deleted file mode 100644 index c057f5c486..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/dotgit_setref.go +++ /dev/null @@ -1,90 +0,0 @@ -package dotgit - -import ( - "fmt" - "os" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/utils/ioutil" - - "github.com/go-git/go-billy/v5" -) - -func (d *DotGit) setRef(fileName, content string, old *plumbing.Reference) (err error) { - if billy.CapabilityCheck(d.fs, billy.ReadAndWriteCapability) { - return d.setRefRwfs(fileName, content, old) - } - - return d.setRefNorwfs(fileName, content, old) -} - -func (d *DotGit) setRefRwfs(fileName, content string, old *plumbing.Reference) (err error) { - // If we are not checking an old ref, just truncate the file. - mode := os.O_RDWR | os.O_CREATE - if old == nil { - mode |= os.O_TRUNC - } - - f, err := d.fs.OpenFile(fileName, mode, 0666) - if err != nil { - return err - } - - defer ioutil.CheckClose(f, &err) - - // Lock is unlocked by the deferred Close above. This is because Unlock - // does not imply a fsync and thus there would be a race between - // Unlock+Close and other concurrent writers. Adding Sync to go-billy - // could work, but this is better (and avoids superfluous syncs). - err = f.Lock() - if err != nil { - return err - } - - // this is a no-op to call even when old is nil. - err = d.checkReferenceAndTruncate(f, old) - if err != nil { - return err - } - - _, err = f.Write([]byte(content)) - return err -} - -// There are some filesystems that don't support opening files in RDWD mode. -// In these filesystems the standard SetRef function can not be used as it -// reads the reference file to check that it's not modified before updating it. -// -// This version of the function writes the reference without extra checks -// making it compatible with these simple filesystems. This is usually not -// a problem as they should be accessed by only one process at a time. -func (d *DotGit) setRefNorwfs(fileName, content string, old *plumbing.Reference) error { - _, err := d.fs.Stat(fileName) - if err == nil && old != nil { - fRead, err := d.fs.Open(fileName) - if err != nil { - return err - } - - ref, err := d.readReferenceFrom(fRead, old.Name().String()) - fRead.Close() - - if err != nil { - return err - } - - if ref.Hash() != old.Hash() { - return fmt.Errorf("reference has changed concurrently") - } - } - - f, err := d.fs.Create(fileName) - if err != nil { - return err - } - - defer f.Close() - - _, err = f.Write([]byte(content)) - return err -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/reader.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/reader.go deleted file mode 100644 index 975f92ac6a..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/reader.go +++ /dev/null @@ -1,79 +0,0 @@ -package dotgit - -import ( - "fmt" - "io" - "os" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/objfile" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -var _ (plumbing.EncodedObject) = &EncodedObject{} - -type EncodedObject struct { - dir *DotGit - h plumbing.Hash - t plumbing.ObjectType - sz int64 -} - -func (e *EncodedObject) Hash() plumbing.Hash { - return e.h -} - -func (e *EncodedObject) Reader() (io.ReadCloser, error) { - f, err := e.dir.Object(e.h) - if err != nil { - if os.IsNotExist(err) { - return nil, plumbing.ErrObjectNotFound - } - - return nil, err - } - r, err := objfile.NewReader(f) - if err != nil { - return nil, err - } - - t, size, err := r.Header() - if err != nil { - _ = r.Close() - return nil, err - } - if t != e.t { - _ = r.Close() - return nil, objfile.ErrHeader - } - if size != e.sz { - _ = r.Close() - return nil, objfile.ErrHeader - } - return ioutil.NewReadCloserWithCloser(r, f.Close), nil -} - -func (e *EncodedObject) SetType(plumbing.ObjectType) {} - -func (e *EncodedObject) Type() plumbing.ObjectType { - return e.t -} - -func (e *EncodedObject) Size() int64 { - return e.sz -} - -func (e *EncodedObject) SetSize(int64) {} - -func (e *EncodedObject) Writer() (io.WriteCloser, error) { - return nil, fmt.Errorf("not supported") -} - -func NewEncodedObject(dir *DotGit, h plumbing.Hash, t plumbing.ObjectType, size int64) *EncodedObject { - return &EncodedObject{ - dir: dir, - h: h, - t: t, - sz: size, - } -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/repository_filesystem.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/repository_filesystem.go deleted file mode 100644 index 8d243efea1..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/repository_filesystem.go +++ /dev/null @@ -1,111 +0,0 @@ -package dotgit - -import ( - "os" - "path/filepath" - "strings" - - "github.com/go-git/go-billy/v5" -) - -// RepositoryFilesystem is a billy.Filesystem compatible object wrapper -// which handles dot-git filesystem operations and supports commondir according to git scm layout: -// https://github.com/git/git/blob/master/Documentation/gitrepository-layout.txt -type RepositoryFilesystem struct { - dotGitFs billy.Filesystem - commonDotGitFs billy.Filesystem -} - -func NewRepositoryFilesystem(dotGitFs, commonDotGitFs billy.Filesystem) *RepositoryFilesystem { - return &RepositoryFilesystem{ - dotGitFs: dotGitFs, - commonDotGitFs: commonDotGitFs, - } -} - -func (fs *RepositoryFilesystem) mapToRepositoryFsByPath(path string) billy.Filesystem { - // Nothing to decide if commondir not defined - if fs.commonDotGitFs == nil { - return fs.dotGitFs - } - - cleanPath := filepath.Clean(path) - - // Check exceptions for commondir (https://git-scm.com/docs/gitrepository-layout#Documentation/gitrepository-layout.txt) - switch cleanPath { - case fs.dotGitFs.Join(logsPath, "HEAD"): - return fs.dotGitFs - case fs.dotGitFs.Join(refsPath, "bisect"), fs.dotGitFs.Join(refsPath, "rewritten"), fs.dotGitFs.Join(refsPath, "worktree"): - return fs.dotGitFs - } - - // Determine dot-git root by first path element. - // There are some elements which should always use commondir when commondir defined. - // Usual dot-git root will be used for the rest of files. - switch strings.Split(cleanPath, string(filepath.Separator))[0] { - case objectsPath, refsPath, packedRefsPath, configPath, branchesPath, hooksPath, infoPath, remotesPath, logsPath, shallowPath, worktreesPath: - return fs.commonDotGitFs - default: - return fs.dotGitFs - } -} - -func (fs *RepositoryFilesystem) Create(filename string) (billy.File, error) { - return fs.mapToRepositoryFsByPath(filename).Create(filename) -} - -func (fs *RepositoryFilesystem) Open(filename string) (billy.File, error) { - return fs.mapToRepositoryFsByPath(filename).Open(filename) -} - -func (fs *RepositoryFilesystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error) { - return fs.mapToRepositoryFsByPath(filename).OpenFile(filename, flag, perm) -} - -func (fs *RepositoryFilesystem) Stat(filename string) (os.FileInfo, error) { - return fs.mapToRepositoryFsByPath(filename).Stat(filename) -} - -func (fs *RepositoryFilesystem) Rename(oldpath, newpath string) error { - return fs.mapToRepositoryFsByPath(oldpath).Rename(oldpath, newpath) -} - -func (fs *RepositoryFilesystem) Remove(filename string) error { - return fs.mapToRepositoryFsByPath(filename).Remove(filename) -} - -func (fs *RepositoryFilesystem) Join(elem ...string) string { - return fs.dotGitFs.Join(elem...) -} - -func (fs *RepositoryFilesystem) TempFile(dir, prefix string) (billy.File, error) { - return fs.mapToRepositoryFsByPath(dir).TempFile(dir, prefix) -} - -func (fs *RepositoryFilesystem) ReadDir(path string) ([]os.FileInfo, error) { - return fs.mapToRepositoryFsByPath(path).ReadDir(path) -} - -func (fs *RepositoryFilesystem) MkdirAll(filename string, perm os.FileMode) error { - return fs.mapToRepositoryFsByPath(filename).MkdirAll(filename, perm) -} - -func (fs *RepositoryFilesystem) Lstat(filename string) (os.FileInfo, error) { - return fs.mapToRepositoryFsByPath(filename).Lstat(filename) -} - -func (fs *RepositoryFilesystem) Symlink(target, link string) error { - return fs.mapToRepositoryFsByPath(target).Symlink(target, link) -} - -func (fs *RepositoryFilesystem) Readlink(link string) (string, error) { - return fs.mapToRepositoryFsByPath(link).Readlink(link) -} - -func (fs *RepositoryFilesystem) Chroot(path string) (billy.Filesystem, error) { - return fs.mapToRepositoryFsByPath(path).Chroot(path) -} - -func (fs *RepositoryFilesystem) Root() string { - return fs.dotGitFs.Root() -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/writers.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/writers.go deleted file mode 100644 index 849b7a1760..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/dotgit/writers.go +++ /dev/null @@ -1,285 +0,0 @@ -package dotgit - -import ( - "fmt" - "io" - "sync/atomic" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/idxfile" - "github.com/go-git/go-git/v5/plumbing/format/objfile" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/plumbing/hash" - - "github.com/go-git/go-billy/v5" -) - -// PackWriter is a io.Writer that generates the packfile index simultaneously, -// a packfile.Decoder is used with a file reader to read the file being written -// this operation is synchronized with the write operations. -// The packfile is written in a temp file, when Close is called this file -// is renamed/moved (depends on the Filesystem implementation) to the final -// location, if the PackWriter is not used, nothing is written -type PackWriter struct { - Notify func(plumbing.Hash, *idxfile.Writer) - - fs billy.Filesystem - fr, fw billy.File - synced *syncedReader - checksum plumbing.Hash - parser *packfile.Parser - writer *idxfile.Writer - result chan error -} - -func newPackWrite(fs billy.Filesystem) (*PackWriter, error) { - fw, err := fs.TempFile(fs.Join(objectsPath, packPath), "tmp_pack_") - if err != nil { - return nil, err - } - - fr, err := fs.Open(fw.Name()) - if err != nil { - return nil, err - } - - writer := &PackWriter{ - fs: fs, - fw: fw, - fr: fr, - synced: newSyncedReader(fw, fr), - result: make(chan error), - } - - go writer.buildIndex() - return writer, nil -} - -func (w *PackWriter) buildIndex() { - s := packfile.NewScanner(w.synced) - w.writer = new(idxfile.Writer) - var err error - w.parser, err = packfile.NewParser(s, w.writer) - if err != nil { - w.result <- err - return - } - - checksum, err := w.parser.Parse() - if err != nil { - w.result <- err - return - } - - w.checksum = checksum - w.result <- err -} - -// waitBuildIndex waits until buildIndex function finishes, this can terminate -// with a packfile.ErrEmptyPackfile, this means that nothing was written so we -// ignore the error -func (w *PackWriter) waitBuildIndex() error { - err := <-w.result - if err == packfile.ErrEmptyPackfile { - return nil - } - - return err -} - -func (w *PackWriter) Write(p []byte) (int, error) { - return w.synced.Write(p) -} - -// Close closes all the file descriptors and save the final packfile, if nothing -// was written, the tempfiles are deleted without writing a packfile. -func (w *PackWriter) Close() error { - defer func() { - if w.Notify != nil && w.writer != nil && w.writer.Finished() { - w.Notify(w.checksum, w.writer) - } - - close(w.result) - }() - - if err := w.synced.Close(); err != nil { - return err - } - - if err := w.waitBuildIndex(); err != nil { - return err - } - - if err := w.fr.Close(); err != nil { - return err - } - - if err := w.fw.Close(); err != nil { - return err - } - - if w.writer == nil || !w.writer.Finished() { - return w.clean() - } - - return w.save() -} - -func (w *PackWriter) clean() error { - return w.fs.Remove(w.fw.Name()) -} - -func (w *PackWriter) save() error { - base := w.fs.Join(objectsPath, packPath, fmt.Sprintf("pack-%s", w.checksum)) - idx, err := w.fs.Create(fmt.Sprintf("%s.idx", base)) - if err != nil { - return err - } - - if err := w.encodeIdx(idx); err != nil { - return err - } - - if err := idx.Close(); err != nil { - return err - } - - return w.fs.Rename(w.fw.Name(), fmt.Sprintf("%s.pack", base)) -} - -func (w *PackWriter) encodeIdx(writer io.Writer) error { - idx, err := w.writer.Index() - if err != nil { - return err - } - - e := idxfile.NewEncoder(writer) - _, err = e.Encode(idx) - return err -} - -type syncedReader struct { - w io.Writer - r io.ReadSeeker - - blocked, done uint32 - written, read uint64 - news chan bool -} - -func newSyncedReader(w io.Writer, r io.ReadSeeker) *syncedReader { - return &syncedReader{ - w: w, - r: r, - news: make(chan bool), - } -} - -func (s *syncedReader) Write(p []byte) (n int, err error) { - defer func() { - written := atomic.AddUint64(&s.written, uint64(n)) - read := atomic.LoadUint64(&s.read) - if written > read { - s.wake() - } - }() - - n, err = s.w.Write(p) - return -} - -func (s *syncedReader) Read(p []byte) (n int, err error) { - defer func() { atomic.AddUint64(&s.read, uint64(n)) }() - - for { - s.sleep() - n, err = s.r.Read(p) - if err == io.EOF && !s.isDone() && n == 0 { - continue - } - - break - } - - return -} - -func (s *syncedReader) isDone() bool { - return atomic.LoadUint32(&s.done) == 1 -} - -func (s *syncedReader) isBlocked() bool { - return atomic.LoadUint32(&s.blocked) == 1 -} - -func (s *syncedReader) wake() { - if s.isBlocked() { - atomic.StoreUint32(&s.blocked, 0) - s.news <- true - } -} - -func (s *syncedReader) sleep() { - read := atomic.LoadUint64(&s.read) - written := atomic.LoadUint64(&s.written) - if read >= written { - atomic.StoreUint32(&s.blocked, 1) - <-s.news - } - -} - -func (s *syncedReader) Seek(offset int64, whence int) (int64, error) { - if whence == io.SeekCurrent { - return s.r.Seek(offset, whence) - } - - p, err := s.r.Seek(offset, whence) - atomic.StoreUint64(&s.read, uint64(p)) - - return p, err -} - -func (s *syncedReader) Close() error { - atomic.StoreUint32(&s.done, 1) - close(s.news) - return nil -} - -type ObjectWriter struct { - objfile.Writer - fs billy.Filesystem - f billy.File -} - -func newObjectWriter(fs billy.Filesystem) (*ObjectWriter, error) { - f, err := fs.TempFile(fs.Join(objectsPath, packPath), "tmp_obj_") - if err != nil { - return nil, err - } - - return &ObjectWriter{ - Writer: (*objfile.NewWriter(f)), - fs: fs, - f: f, - }, nil -} - -func (w *ObjectWriter) Close() error { - if err := w.Writer.Close(); err != nil { - return err - } - - if err := w.f.Close(); err != nil { - return err - } - - return w.save() -} - -func (w *ObjectWriter) save() error { - hex := w.Hash().String() - file := w.fs.Join(objectsPath, hex[0:2], hex[2:hash.HexSize]) - - return w.fs.Rename(w.f.Name(), file) -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/index.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/index.go deleted file mode 100644 index a19176f83d..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/index.go +++ /dev/null @@ -1,54 +0,0 @@ -package filesystem - -import ( - "bufio" - "os" - - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -type IndexStorage struct { - dir *dotgit.DotGit -} - -func (s *IndexStorage) SetIndex(idx *index.Index) (err error) { - f, err := s.dir.IndexWriter() - if err != nil { - return err - } - - defer ioutil.CheckClose(f, &err) - bw := bufio.NewWriter(f) - defer func() { - if e := bw.Flush(); err == nil && e != nil { - err = e - } - }() - - e := index.NewEncoder(bw) - err = e.Encode(idx) - return err -} - -func (s *IndexStorage) Index() (i *index.Index, err error) { - idx := &index.Index{ - Version: 2, - } - - f, err := s.dir.Index() - if err != nil { - if os.IsNotExist(err) { - return idx, nil - } - - return nil, err - } - - defer ioutil.CheckClose(f, &err) - - d := index.NewDecoder(bufio.NewReader(f)) - err = d.Decode(idx) - return idx, err -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/module.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/module.go deleted file mode 100644 index 20336c1184..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/module.go +++ /dev/null @@ -1,20 +0,0 @@ -package filesystem - -import ( - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/storage" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" -) - -type ModuleStorage struct { - dir *dotgit.DotGit -} - -func (s *ModuleStorage) Module(name string) (storage.Storer, error) { - fs, err := s.dir.Module(name) - if err != nil { - return nil, err - } - - return NewStorage(fs, cache.NewObjectLRUDefault()), nil -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go deleted file mode 100644 index e812fe934d..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/object.go +++ /dev/null @@ -1,892 +0,0 @@ -package filesystem - -import ( - "bytes" - "io" - "os" - "sync" - "time" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/plumbing/format/idxfile" - "github.com/go-git/go-git/v5/plumbing/format/objfile" - "github.com/go-git/go-git/v5/plumbing/format/packfile" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - "github.com/go-git/go-git/v5/utils/ioutil" - - "github.com/go-git/go-billy/v5" -) - -type ObjectStorage struct { - options Options - - // objectCache is an object cache uses to cache delta's bases and also recently - // loaded loose objects - objectCache cache.Object - - dir *dotgit.DotGit - index map[plumbing.Hash]idxfile.Index - - packList []plumbing.Hash - packListIdx int - packfiles map[plumbing.Hash]*packfile.Packfile -} - -// NewObjectStorage creates a new ObjectStorage with the given .git directory and cache. -func NewObjectStorage(dir *dotgit.DotGit, objectCache cache.Object) *ObjectStorage { - return NewObjectStorageWithOptions(dir, objectCache, Options{}) -} - -// NewObjectStorageWithOptions creates a new ObjectStorage with the given .git directory, cache and extra options -func NewObjectStorageWithOptions(dir *dotgit.DotGit, objectCache cache.Object, ops Options) *ObjectStorage { - return &ObjectStorage{ - options: ops, - objectCache: objectCache, - dir: dir, - } -} - -func (s *ObjectStorage) requireIndex() error { - if s.index != nil { - return nil - } - - s.index = make(map[plumbing.Hash]idxfile.Index) - packs, err := s.dir.ObjectPacks() - if err != nil { - return err - } - - for _, h := range packs { - if err := s.loadIdxFile(h); err != nil { - return err - } - } - - return nil -} - -// Reindex indexes again all packfiles. Useful if git changed packfiles externally -func (s *ObjectStorage) Reindex() { - s.index = nil -} - -func (s *ObjectStorage) loadIdxFile(h plumbing.Hash) (err error) { - f, err := s.dir.ObjectPackIdx(h) - if err != nil { - return err - } - - defer ioutil.CheckClose(f, &err) - - idxf := idxfile.NewMemoryIndex() - d := idxfile.NewDecoder(f) - if err = d.Decode(idxf); err != nil { - return err - } - - s.index[h] = idxf - return err -} - -func (s *ObjectStorage) NewEncodedObject() plumbing.EncodedObject { - return &plumbing.MemoryObject{} -} - -func (s *ObjectStorage) PackfileWriter() (io.WriteCloser, error) { - if err := s.requireIndex(); err != nil { - return nil, err - } - - w, err := s.dir.NewObjectPack() - if err != nil { - return nil, err - } - - w.Notify = func(h plumbing.Hash, writer *idxfile.Writer) { - index, err := writer.Index() - if err == nil { - s.index[h] = index - } - } - - return w, nil -} - -// SetEncodedObject adds a new object to the storage. -func (s *ObjectStorage) SetEncodedObject(o plumbing.EncodedObject) (h plumbing.Hash, err error) { - if o.Type() == plumbing.OFSDeltaObject || o.Type() == plumbing.REFDeltaObject { - return plumbing.ZeroHash, plumbing.ErrInvalidType - } - - ow, err := s.dir.NewObject() - if err != nil { - return plumbing.ZeroHash, err - } - - defer ioutil.CheckClose(ow, &err) - - or, err := o.Reader() - if err != nil { - return plumbing.ZeroHash, err - } - - defer ioutil.CheckClose(or, &err) - - if err = ow.WriteHeader(o.Type(), o.Size()); err != nil { - return plumbing.ZeroHash, err - } - - if _, err = io.Copy(ow, or); err != nil { - return plumbing.ZeroHash, err - } - - return o.Hash(), err -} - -// LazyWriter returns a lazy ObjectWriter that is bound to a DotGit file. -// It first write the header passing on the object type and size, so -// that the object contents can be written later, without the need to -// create a MemoryObject and buffering its entire contents into memory. -func (s *ObjectStorage) LazyWriter() (w io.WriteCloser, wh func(typ plumbing.ObjectType, sz int64) error, err error) { - ow, err := s.dir.NewObject() - if err != nil { - return nil, nil, err - } - - return ow, ow.WriteHeader, nil -} - -// HasEncodedObject returns nil if the object exists, without actually -// reading the object data from storage. -func (s *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error) { - // Check unpacked objects - f, err := s.dir.Object(h) - if err != nil { - if !os.IsNotExist(err) { - return err - } - // Fall through to check packed objects. - } else { - defer ioutil.CheckClose(f, &err) - return nil - } - - // Check packed objects. - if err := s.requireIndex(); err != nil { - return err - } - _, _, offset := s.findObjectInPackfile(h) - if offset == -1 { - return plumbing.ErrObjectNotFound - } - return nil -} - -func (s *ObjectStorage) encodedObjectSizeFromUnpacked(h plumbing.Hash) ( - size int64, err error) { - f, err := s.dir.Object(h) - if err != nil { - if os.IsNotExist(err) { - return 0, plumbing.ErrObjectNotFound - } - - return 0, err - } - - r, err := objfile.NewReader(f) - if err != nil { - return 0, err - } - defer ioutil.CheckClose(r, &err) - - _, size, err = r.Header() - return size, err -} - -func (s *ObjectStorage) packfile(idx idxfile.Index, pack plumbing.Hash) (*packfile.Packfile, error) { - if p := s.packfileFromCache(pack); p != nil { - return p, nil - } - - f, err := s.dir.ObjectPack(pack) - if err != nil { - return nil, err - } - - var p *packfile.Packfile - if s.objectCache != nil { - p = packfile.NewPackfileWithCache(idx, s.dir.Fs(), f, s.objectCache, s.options.LargeObjectThreshold) - } else { - p = packfile.NewPackfile(idx, s.dir.Fs(), f, s.options.LargeObjectThreshold) - } - - return p, s.storePackfileInCache(pack, p) -} - -func (s *ObjectStorage) packfileFromCache(hash plumbing.Hash) *packfile.Packfile { - if s.packfiles == nil { - if s.options.KeepDescriptors { - s.packfiles = make(map[plumbing.Hash]*packfile.Packfile) - } else if s.options.MaxOpenDescriptors > 0 { - s.packList = make([]plumbing.Hash, s.options.MaxOpenDescriptors) - s.packfiles = make(map[plumbing.Hash]*packfile.Packfile, s.options.MaxOpenDescriptors) - } - } - - return s.packfiles[hash] -} - -func (s *ObjectStorage) storePackfileInCache(hash plumbing.Hash, p *packfile.Packfile) error { - if s.options.KeepDescriptors { - s.packfiles[hash] = p - return nil - } - - if s.options.MaxOpenDescriptors <= 0 { - return nil - } - - // start over as the limit of packList is hit - if s.packListIdx >= len(s.packList) { - s.packListIdx = 0 - } - - // close the existing packfile if open - if next := s.packList[s.packListIdx]; !next.IsZero() { - open := s.packfiles[next] - delete(s.packfiles, next) - if open != nil { - if err := open.Close(); err != nil { - return err - } - } - } - - // cache newly open packfile - s.packList[s.packListIdx] = hash - s.packfiles[hash] = p - s.packListIdx++ - - return nil -} - -func (s *ObjectStorage) encodedObjectSizeFromPackfile(h plumbing.Hash) ( - size int64, err error) { - if err := s.requireIndex(); err != nil { - return 0, err - } - - pack, _, offset := s.findObjectInPackfile(h) - if offset == -1 { - return 0, plumbing.ErrObjectNotFound - } - - idx := s.index[pack] - hash, err := idx.FindHash(offset) - if err == nil { - obj, ok := s.objectCache.Get(hash) - if ok { - return obj.Size(), nil - } - } else if err != nil && err != plumbing.ErrObjectNotFound { - return 0, err - } - - p, err := s.packfile(idx, pack) - if err != nil { - return 0, err - } - - if !s.options.KeepDescriptors && s.options.MaxOpenDescriptors == 0 { - defer ioutil.CheckClose(p, &err) - } - - return p.GetSizeByOffset(offset) -} - -// EncodedObjectSize returns the plaintext size of the given object, -// without actually reading the full object data from storage. -func (s *ObjectStorage) EncodedObjectSize(h plumbing.Hash) ( - size int64, err error) { - size, err = s.encodedObjectSizeFromUnpacked(h) - if err != nil && err != plumbing.ErrObjectNotFound { - return 0, err - } else if err == nil { - return size, nil - } - - return s.encodedObjectSizeFromPackfile(h) -} - -// EncodedObject returns the object with the given hash, by searching for it in -// the packfile and the git object directories. -func (s *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error) { - var obj plumbing.EncodedObject - var err error - - if s.index != nil { - obj, err = s.getFromPackfile(h, false) - if err == plumbing.ErrObjectNotFound { - obj, err = s.getFromUnpacked(h) - } - } else { - obj, err = s.getFromUnpacked(h) - if err == plumbing.ErrObjectNotFound { - obj, err = s.getFromPackfile(h, false) - } - } - - // If the error is still object not found, check if it's a shared object - // repository. - if err == plumbing.ErrObjectNotFound { - dotgits, e := s.dir.Alternates() - if e == nil { - // Create a new object storage with the DotGit(s) and check for the - // required hash object. Skip when not found. - for _, dg := range dotgits { - o := NewObjectStorage(dg, s.objectCache) - enobj, enerr := o.EncodedObject(t, h) - if enerr != nil { - continue - } - return enobj, nil - } - } - } - - if err != nil { - return nil, err - } - - if plumbing.AnyObject != t && obj.Type() != t { - return nil, plumbing.ErrObjectNotFound - } - - return obj, nil -} - -// DeltaObject returns the object with the given hash, by searching for -// it in the packfile and the git object directories. -func (s *ObjectStorage) DeltaObject(t plumbing.ObjectType, - h plumbing.Hash) (plumbing.EncodedObject, error) { - obj, err := s.getFromUnpacked(h) - if err == plumbing.ErrObjectNotFound { - obj, err = s.getFromPackfile(h, true) - } - - if err != nil { - return nil, err - } - - if plumbing.AnyObject != t && obj.Type() != t { - return nil, plumbing.ErrObjectNotFound - } - - return obj, nil -} - -func (s *ObjectStorage) getFromUnpacked(h plumbing.Hash) (obj plumbing.EncodedObject, err error) { - f, err := s.dir.Object(h) - if err != nil { - if os.IsNotExist(err) { - return nil, plumbing.ErrObjectNotFound - } - - return nil, err - } - defer ioutil.CheckClose(f, &err) - - if cacheObj, found := s.objectCache.Get(h); found { - return cacheObj, nil - } - - r, err := objfile.NewReader(f) - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(r, &err) - - t, size, err := r.Header() - if err != nil { - return nil, err - } - - if s.options.LargeObjectThreshold > 0 && size > s.options.LargeObjectThreshold { - obj = dotgit.NewEncodedObject(s.dir, h, t, size) - return obj, nil - } - - obj = s.NewEncodedObject() - - obj.SetType(t) - obj.SetSize(size) - w, err := obj.Writer() - if err != nil { - return nil, err - } - - defer ioutil.CheckClose(w, &err) - - s.objectCache.Put(obj) - - bufp := copyBufferPool.Get().(*[]byte) - buf := *bufp - _, err = io.CopyBuffer(w, r, buf) - copyBufferPool.Put(bufp) - - return obj, err -} - -var copyBufferPool = sync.Pool{ - New: func() interface{} { - b := make([]byte, 32*1024) - return &b - }, -} - -// Get returns the object with the given hash, by searching for it in -// the packfile. -func (s *ObjectStorage) getFromPackfile(h plumbing.Hash, canBeDelta bool) ( - plumbing.EncodedObject, error) { - - if err := s.requireIndex(); err != nil { - return nil, err - } - - pack, hash, offset := s.findObjectInPackfile(h) - if offset == -1 { - return nil, plumbing.ErrObjectNotFound - } - - idx := s.index[pack] - p, err := s.packfile(idx, pack) - if err != nil { - return nil, err - } - - if !s.options.KeepDescriptors && s.options.MaxOpenDescriptors == 0 { - defer ioutil.CheckClose(p, &err) - } - - if canBeDelta { - return s.decodeDeltaObjectAt(p, offset, hash) - } - - return s.decodeObjectAt(p, offset) -} - -func (s *ObjectStorage) decodeObjectAt( - p *packfile.Packfile, - offset int64, -) (plumbing.EncodedObject, error) { - hash, err := p.FindHash(offset) - if err == nil { - obj, ok := s.objectCache.Get(hash) - if ok { - return obj, nil - } - } - - if err != nil && err != plumbing.ErrObjectNotFound { - return nil, err - } - - return p.GetByOffset(offset) -} - -func (s *ObjectStorage) decodeDeltaObjectAt( - p *packfile.Packfile, - offset int64, - hash plumbing.Hash, -) (plumbing.EncodedObject, error) { - scan := p.Scanner() - header, err := scan.SeekObjectHeader(offset) - if err != nil { - return nil, err - } - - var ( - base plumbing.Hash - ) - - switch header.Type { - case plumbing.REFDeltaObject: - base = header.Reference - case plumbing.OFSDeltaObject: - base, err = p.FindHash(header.OffsetReference) - if err != nil { - return nil, err - } - default: - return s.decodeObjectAt(p, offset) - } - - obj := &plumbing.MemoryObject{} - obj.SetType(header.Type) - w, err := obj.Writer() - if err != nil { - return nil, err - } - - if _, _, err := scan.NextObject(w); err != nil { - return nil, err - } - - return newDeltaObject(obj, hash, base, header.Length), nil -} - -func (s *ObjectStorage) findObjectInPackfile(h plumbing.Hash) (plumbing.Hash, plumbing.Hash, int64) { - for packfile, index := range s.index { - offset, err := index.FindOffset(h) - if err == nil { - return packfile, h, offset - } - } - - return plumbing.ZeroHash, plumbing.ZeroHash, -1 -} - -// HashesWithPrefix returns all objects with a hash that starts with a prefix by searching for -// them in the packfile and the git object directories. -func (s *ObjectStorage) HashesWithPrefix(prefix []byte) ([]plumbing.Hash, error) { - hashes, err := s.dir.ObjectsWithPrefix(prefix) - if err != nil { - return nil, err - } - - seen := hashListAsMap(hashes) - - // TODO: This could be faster with some idxfile changes, - // or diving into the packfile. - if err := s.requireIndex(); err != nil { - return nil, err - } - for _, index := range s.index { - ei, err := index.Entries() - if err != nil { - return nil, err - } - for { - e, err := ei.Next() - if err == io.EOF { - break - } else if err != nil { - return nil, err - } - if bytes.HasPrefix(e.Hash[:], prefix) { - if _, ok := seen[e.Hash]; ok { - continue - } - hashes = append(hashes, e.Hash) - } - } - ei.Close() - } - - return hashes, nil -} - -// IterEncodedObjects returns an iterator for all the objects in the packfile -// with the given type. -func (s *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error) { - objects, err := s.dir.Objects() - if err != nil { - return nil, err - } - - seen := make(map[plumbing.Hash]struct{}) - var iters []storer.EncodedObjectIter - if len(objects) != 0 { - iters = append(iters, &objectsIter{s: s, t: t, h: objects}) - seen = hashListAsMap(objects) - } - - packi, err := s.buildPackfileIters(t, seen) - if err != nil { - return nil, err - } - - iters = append(iters, packi) - return storer.NewMultiEncodedObjectIter(iters), nil -} - -func (s *ObjectStorage) buildPackfileIters( - t plumbing.ObjectType, - seen map[plumbing.Hash]struct{}, -) (storer.EncodedObjectIter, error) { - if err := s.requireIndex(); err != nil { - return nil, err - } - - packs, err := s.dir.ObjectPacks() - if err != nil { - return nil, err - } - return &lazyPackfilesIter{ - hashes: packs, - open: func(h plumbing.Hash) (storer.EncodedObjectIter, error) { - pack, err := s.dir.ObjectPack(h) - if err != nil { - return nil, err - } - return newPackfileIter( - s.dir.Fs(), pack, t, seen, s.index[h], - s.objectCache, s.options.KeepDescriptors, - s.options.LargeObjectThreshold, - ) - }, - }, nil -} - -// Close closes all opened files. -func (s *ObjectStorage) Close() error { - var firstError error - if s.options.KeepDescriptors || s.options.MaxOpenDescriptors > 0 { - for _, packfile := range s.packfiles { - err := packfile.Close() - if firstError == nil && err != nil { - firstError = err - } - } - } - - s.packfiles = nil - s.dir.Close() - - return firstError -} - -type lazyPackfilesIter struct { - hashes []plumbing.Hash - open func(h plumbing.Hash) (storer.EncodedObjectIter, error) - cur storer.EncodedObjectIter -} - -func (it *lazyPackfilesIter) Next() (plumbing.EncodedObject, error) { - for { - if it.cur == nil { - if len(it.hashes) == 0 { - return nil, io.EOF - } - h := it.hashes[0] - it.hashes = it.hashes[1:] - - sub, err := it.open(h) - if err == io.EOF { - continue - } else if err != nil { - return nil, err - } - it.cur = sub - } - ob, err := it.cur.Next() - if err == io.EOF { - it.cur.Close() - it.cur = nil - continue - } else if err != nil { - return nil, err - } - return ob, nil - } -} - -func (it *lazyPackfilesIter) ForEach(cb func(plumbing.EncodedObject) error) error { - return storer.ForEachIterator(it, cb) -} - -func (it *lazyPackfilesIter) Close() { - if it.cur != nil { - it.cur.Close() - it.cur = nil - } - it.hashes = nil -} - -type packfileIter struct { - pack billy.File - iter storer.EncodedObjectIter - seen map[plumbing.Hash]struct{} - - // tells whether the pack file should be left open after iteration or not - keepPack bool -} - -// NewPackfileIter returns a new EncodedObjectIter for the provided packfile -// and object type. Packfile and index file will be closed after they're -// used. If keepPack is true the packfile won't be closed after the iteration -// finished. -func NewPackfileIter( - fs billy.Filesystem, - f billy.File, - idxFile billy.File, - t plumbing.ObjectType, - keepPack bool, - largeObjectThreshold int64, -) (storer.EncodedObjectIter, error) { - idx := idxfile.NewMemoryIndex() - if err := idxfile.NewDecoder(idxFile).Decode(idx); err != nil { - return nil, err - } - - if err := idxFile.Close(); err != nil { - return nil, err - } - - seen := make(map[plumbing.Hash]struct{}) - return newPackfileIter(fs, f, t, seen, idx, nil, keepPack, largeObjectThreshold) -} - -func newPackfileIter( - fs billy.Filesystem, - f billy.File, - t plumbing.ObjectType, - seen map[plumbing.Hash]struct{}, - index idxfile.Index, - cache cache.Object, - keepPack bool, - largeObjectThreshold int64, -) (storer.EncodedObjectIter, error) { - var p *packfile.Packfile - if cache != nil { - p = packfile.NewPackfileWithCache(index, fs, f, cache, largeObjectThreshold) - } else { - p = packfile.NewPackfile(index, fs, f, largeObjectThreshold) - } - - iter, err := p.GetByType(t) - if err != nil { - return nil, err - } - - return &packfileIter{ - pack: f, - iter: iter, - seen: seen, - keepPack: keepPack, - }, nil -} - -func (iter *packfileIter) Next() (plumbing.EncodedObject, error) { - for { - obj, err := iter.iter.Next() - if err != nil { - return nil, err - } - - if _, ok := iter.seen[obj.Hash()]; ok { - continue - } - - return obj, nil - } -} - -func (iter *packfileIter) ForEach(cb func(plumbing.EncodedObject) error) error { - for { - o, err := iter.Next() - if err != nil { - if err == io.EOF { - iter.Close() - return nil - } - return err - } - - if err := cb(o); err != nil { - return err - } - } -} - -func (iter *packfileIter) Close() { - iter.iter.Close() - if !iter.keepPack { - _ = iter.pack.Close() - } -} - -type objectsIter struct { - s *ObjectStorage - t plumbing.ObjectType - h []plumbing.Hash -} - -func (iter *objectsIter) Next() (plumbing.EncodedObject, error) { - if len(iter.h) == 0 { - return nil, io.EOF - } - - obj, err := iter.s.getFromUnpacked(iter.h[0]) - iter.h = iter.h[1:] - - if err != nil { - return nil, err - } - - if iter.t != plumbing.AnyObject && iter.t != obj.Type() { - return iter.Next() - } - - return obj, err -} - -func (iter *objectsIter) ForEach(cb func(plumbing.EncodedObject) error) error { - for { - o, err := iter.Next() - if err != nil { - if err == io.EOF { - return nil - } - return err - } - - if err := cb(o); err != nil { - return err - } - } -} - -func (iter *objectsIter) Close() { - iter.h = []plumbing.Hash{} -} - -func hashListAsMap(l []plumbing.Hash) map[plumbing.Hash]struct{} { - m := make(map[plumbing.Hash]struct{}, len(l)) - for _, h := range l { - m[h] = struct{}{} - } - return m -} - -func (s *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash) error) error { - err := s.dir.ForEachObjectHash(fun) - if err == storer.ErrStop { - return nil - } - return err -} - -func (s *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error) { - fi, err := s.dir.ObjectStat(hash) - if err != nil { - return time.Time{}, err - } - return fi.ModTime(), nil -} - -func (s *ObjectStorage) DeleteLooseObject(hash plumbing.Hash) error { - return s.dir.ObjectDelete(hash) -} - -func (s *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error) { - return s.dir.ObjectPacks() -} - -func (s *ObjectStorage) DeleteOldObjectPackAndIndex(h plumbing.Hash, t time.Time) error { - return s.dir.DeleteOldObjectPackAndIndex(h, t) -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/reference.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/reference.go deleted file mode 100644 index aabcd7308d..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/reference.go +++ /dev/null @@ -1,44 +0,0 @@ -package filesystem - -import ( - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" -) - -type ReferenceStorage struct { - dir *dotgit.DotGit -} - -func (r *ReferenceStorage) SetReference(ref *plumbing.Reference) error { - return r.dir.SetRef(ref, nil) -} - -func (r *ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error { - return r.dir.SetRef(ref, old) -} - -func (r *ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error) { - return r.dir.Ref(n) -} - -func (r *ReferenceStorage) IterReferences() (storer.ReferenceIter, error) { - refs, err := r.dir.Refs() - if err != nil { - return nil, err - } - - return storer.NewReferenceSliceIter(refs), nil -} - -func (r *ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error { - return r.dir.RemoveRef(n) -} - -func (r *ReferenceStorage) CountLooseRefs() (int, error) { - return r.dir.CountLooseRefs() -} - -func (r *ReferenceStorage) PackRefs() error { - return r.dir.PackRefs() -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/shallow.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/shallow.go deleted file mode 100644 index ac48fdfbb3..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/shallow.go +++ /dev/null @@ -1,54 +0,0 @@ -package filesystem - -import ( - "bufio" - "fmt" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - "github.com/go-git/go-git/v5/utils/ioutil" -) - -// ShallowStorage where the shallow commits are stored, an internal to -// manipulate the shallow file -type ShallowStorage struct { - dir *dotgit.DotGit -} - -// SetShallow save the shallows in the shallow file in the .git folder as one -// commit per line represented by 40-byte hexadecimal object terminated by a -// newline. -func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error { - f, err := s.dir.ShallowWriter() - if err != nil { - return err - } - - defer ioutil.CheckClose(f, &err) - for _, h := range commits { - if _, err := fmt.Fprintf(f, "%s\n", h); err != nil { - return err - } - } - - return err -} - -// Shallow returns the shallow commits reading from shallo file from .git -func (s *ShallowStorage) Shallow() ([]plumbing.Hash, error) { - f, err := s.dir.Shallow() - if f == nil || err != nil { - return nil, err - } - - defer ioutil.CheckClose(f, &err) - - var hash []plumbing.Hash - - scn := bufio.NewScanner(f) - for scn.Scan() { - hash = append(hash, plumbing.NewHash(scn.Text())) - } - - return hash, scn.Err() -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/filesystem/storage.go b/vendor/github.com/go-git/go-git/v5/storage/filesystem/storage.go deleted file mode 100644 index 951ea00c83..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/filesystem/storage.go +++ /dev/null @@ -1,85 +0,0 @@ -// Package filesystem is a storage backend base on filesystems -package filesystem - -import ( - "github.com/go-git/go-git/v5/plumbing/cache" - "github.com/go-git/go-git/v5/storage/filesystem/dotgit" - - "github.com/go-git/go-billy/v5" -) - -// Storage is an implementation of git.Storer that stores data on disk in the -// standard git format (this is, the .git directory). Zero values of this type -// are not safe to use, see the NewStorage function below. -type Storage struct { - fs billy.Filesystem - dir *dotgit.DotGit - - ObjectStorage - ReferenceStorage - IndexStorage - ShallowStorage - ConfigStorage - ModuleStorage -} - -// Options holds configuration for the storage. -type Options struct { - // ExclusiveAccess means that the filesystem is not modified externally - // while the repo is open. - ExclusiveAccess bool - // KeepDescriptors makes the file descriptors to be reused but they will - // need to be manually closed calling Close(). - KeepDescriptors bool - // MaxOpenDescriptors is the max number of file descriptors to keep - // open. If KeepDescriptors is true, all file descriptors will remain open. - MaxOpenDescriptors int - // LargeObjectThreshold maximum object size (in bytes) that will be read in to memory. - // If left unset or set to 0 there is no limit - LargeObjectThreshold int64 - // AlternatesFS provides the billy filesystem to be used for Git Alternates. - // If none is provided, it falls back to using the underlying instance used for - // DotGit. - AlternatesFS billy.Filesystem -} - -// NewStorage returns a new Storage backed by a given `fs.Filesystem` and cache. -func NewStorage(fs billy.Filesystem, cache cache.Object) *Storage { - return NewStorageWithOptions(fs, cache, Options{}) -} - -// NewStorageWithOptions returns a new Storage with extra options, -// backed by a given `fs.Filesystem` and cache. -func NewStorageWithOptions(fs billy.Filesystem, cache cache.Object, ops Options) *Storage { - dirOps := dotgit.Options{ - ExclusiveAccess: ops.ExclusiveAccess, - AlternatesFS: ops.AlternatesFS, - } - dir := dotgit.NewWithOptions(fs, dirOps) - - return &Storage{ - fs: fs, - dir: dir, - - ObjectStorage: *NewObjectStorageWithOptions(dir, cache, ops), - ReferenceStorage: ReferenceStorage{dir: dir}, - IndexStorage: IndexStorage{dir: dir}, - ShallowStorage: ShallowStorage{dir: dir}, - ConfigStorage: ConfigStorage{dir: dir}, - ModuleStorage: ModuleStorage{dir: dir}, - } -} - -// Filesystem returns the underlying filesystem -func (s *Storage) Filesystem() billy.Filesystem { - return s.fs -} - -// Init initializes .git directory -func (s *Storage) Init() error { - return s.dir.Initialize() -} - -func (s *Storage) AddAlternate(remote string) error { - return s.dir.AddAlternate(remote) -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/memory/storage.go b/vendor/github.com/go-git/go-git/v5/storage/memory/storage.go deleted file mode 100644 index 79211c7c06..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/memory/storage.go +++ /dev/null @@ -1,324 +0,0 @@ -// Package memory is a storage backend base on memory -package memory - -import ( - "fmt" - "time" - - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/storage" -) - -var ErrUnsupportedObjectType = fmt.Errorf("unsupported object type") - -// Storage is an implementation of git.Storer that stores data on memory, being -// ephemeral. The use of this storage should be done in controlled environments, -// since the representation in memory of some repository can fill the machine -// memory. in the other hand this storage has the best performance. -type Storage struct { - ConfigStorage - ObjectStorage - ShallowStorage - IndexStorage - ReferenceStorage - ModuleStorage -} - -// NewStorage returns a new Storage base on memory -func NewStorage() *Storage { - return &Storage{ - ReferenceStorage: make(ReferenceStorage), - ConfigStorage: ConfigStorage{}, - ShallowStorage: ShallowStorage{}, - ObjectStorage: ObjectStorage{ - Objects: make(map[plumbing.Hash]plumbing.EncodedObject), - Commits: make(map[plumbing.Hash]plumbing.EncodedObject), - Trees: make(map[plumbing.Hash]plumbing.EncodedObject), - Blobs: make(map[plumbing.Hash]plumbing.EncodedObject), - Tags: make(map[plumbing.Hash]plumbing.EncodedObject), - }, - ModuleStorage: make(ModuleStorage), - } -} - -type ConfigStorage struct { - config *config.Config -} - -func (c *ConfigStorage) SetConfig(cfg *config.Config) error { - if err := cfg.Validate(); err != nil { - return err - } - - c.config = cfg - return nil -} - -func (c *ConfigStorage) Config() (*config.Config, error) { - if c.config == nil { - c.config = config.NewConfig() - } - - return c.config, nil -} - -type IndexStorage struct { - index *index.Index -} - -func (c *IndexStorage) SetIndex(idx *index.Index) error { - c.index = idx - return nil -} - -func (c *IndexStorage) Index() (*index.Index, error) { - if c.index == nil { - c.index = &index.Index{Version: 2} - } - - return c.index, nil -} - -type ObjectStorage struct { - Objects map[plumbing.Hash]plumbing.EncodedObject - Commits map[plumbing.Hash]plumbing.EncodedObject - Trees map[plumbing.Hash]plumbing.EncodedObject - Blobs map[plumbing.Hash]plumbing.EncodedObject - Tags map[plumbing.Hash]plumbing.EncodedObject -} - -func (o *ObjectStorage) NewEncodedObject() plumbing.EncodedObject { - return &plumbing.MemoryObject{} -} - -func (o *ObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error) { - h := obj.Hash() - o.Objects[h] = obj - - switch obj.Type() { - case plumbing.CommitObject: - o.Commits[h] = o.Objects[h] - case plumbing.TreeObject: - o.Trees[h] = o.Objects[h] - case plumbing.BlobObject: - o.Blobs[h] = o.Objects[h] - case plumbing.TagObject: - o.Tags[h] = o.Objects[h] - default: - return h, ErrUnsupportedObjectType - } - - return h, nil -} - -func (o *ObjectStorage) HasEncodedObject(h plumbing.Hash) (err error) { - if _, ok := o.Objects[h]; !ok { - return plumbing.ErrObjectNotFound - } - return nil -} - -func (o *ObjectStorage) EncodedObjectSize(h plumbing.Hash) ( - size int64, err error) { - obj, ok := o.Objects[h] - if !ok { - return 0, plumbing.ErrObjectNotFound - } - - return obj.Size(), nil -} - -func (o *ObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error) { - obj, ok := o.Objects[h] - if !ok || (plumbing.AnyObject != t && obj.Type() != t) { - return nil, plumbing.ErrObjectNotFound - } - - return obj, nil -} - -func (o *ObjectStorage) IterEncodedObjects(t plumbing.ObjectType) (storer.EncodedObjectIter, error) { - var series []plumbing.EncodedObject - switch t { - case plumbing.AnyObject: - series = flattenObjectMap(o.Objects) - case plumbing.CommitObject: - series = flattenObjectMap(o.Commits) - case plumbing.TreeObject: - series = flattenObjectMap(o.Trees) - case plumbing.BlobObject: - series = flattenObjectMap(o.Blobs) - case plumbing.TagObject: - series = flattenObjectMap(o.Tags) - } - - return storer.NewEncodedObjectSliceIter(series), nil -} - -func flattenObjectMap(m map[plumbing.Hash]plumbing.EncodedObject) []plumbing.EncodedObject { - objects := make([]plumbing.EncodedObject, 0, len(m)) - for _, obj := range m { - objects = append(objects, obj) - } - return objects -} - -func (o *ObjectStorage) Begin() storer.Transaction { - return &TxObjectStorage{ - Storage: o, - Objects: make(map[plumbing.Hash]plumbing.EncodedObject), - } -} - -func (o *ObjectStorage) ForEachObjectHash(fun func(plumbing.Hash) error) error { - for h := range o.Objects { - err := fun(h) - if err != nil { - if err == storer.ErrStop { - return nil - } - return err - } - } - return nil -} - -func (o *ObjectStorage) ObjectPacks() ([]plumbing.Hash, error) { - return nil, nil -} -func (o *ObjectStorage) DeleteOldObjectPackAndIndex(plumbing.Hash, time.Time) error { - return nil -} - -var errNotSupported = fmt.Errorf("not supported") - -func (o *ObjectStorage) LooseObjectTime(hash plumbing.Hash) (time.Time, error) { - return time.Time{}, errNotSupported -} -func (o *ObjectStorage) DeleteLooseObject(plumbing.Hash) error { - return errNotSupported -} - -func (o *ObjectStorage) AddAlternate(remote string) error { - return errNotSupported -} - -type TxObjectStorage struct { - Storage *ObjectStorage - Objects map[plumbing.Hash]plumbing.EncodedObject -} - -func (tx *TxObjectStorage) SetEncodedObject(obj plumbing.EncodedObject) (plumbing.Hash, error) { - h := obj.Hash() - tx.Objects[h] = obj - - return h, nil -} - -func (tx *TxObjectStorage) EncodedObject(t plumbing.ObjectType, h plumbing.Hash) (plumbing.EncodedObject, error) { - obj, ok := tx.Objects[h] - if !ok || (plumbing.AnyObject != t && obj.Type() != t) { - return nil, plumbing.ErrObjectNotFound - } - - return obj, nil -} - -func (tx *TxObjectStorage) Commit() error { - for h, obj := range tx.Objects { - delete(tx.Objects, h) - if _, err := tx.Storage.SetEncodedObject(obj); err != nil { - return err - } - } - - return nil -} - -func (tx *TxObjectStorage) Rollback() error { - tx.Objects = make(map[plumbing.Hash]plumbing.EncodedObject) - return nil -} - -type ReferenceStorage map[plumbing.ReferenceName]*plumbing.Reference - -func (r ReferenceStorage) SetReference(ref *plumbing.Reference) error { - if ref != nil { - r[ref.Name()] = ref - } - - return nil -} - -func (r ReferenceStorage) CheckAndSetReference(ref, old *plumbing.Reference) error { - if ref == nil { - return nil - } - - if old != nil { - tmp := r[ref.Name()] - if tmp != nil && tmp.Hash() != old.Hash() { - return storage.ErrReferenceHasChanged - } - } - r[ref.Name()] = ref - return nil -} - -func (r ReferenceStorage) Reference(n plumbing.ReferenceName) (*plumbing.Reference, error) { - ref, ok := r[n] - if !ok { - return nil, plumbing.ErrReferenceNotFound - } - - return ref, nil -} - -func (r ReferenceStorage) IterReferences() (storer.ReferenceIter, error) { - var refs []*plumbing.Reference - for _, ref := range r { - refs = append(refs, ref) - } - - return storer.NewReferenceSliceIter(refs), nil -} - -func (r ReferenceStorage) CountLooseRefs() (int, error) { - return len(r), nil -} - -func (r ReferenceStorage) PackRefs() error { - return nil -} - -func (r ReferenceStorage) RemoveReference(n plumbing.ReferenceName) error { - delete(r, n) - return nil -} - -type ShallowStorage []plumbing.Hash - -func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error { - *s = commits - return nil -} - -func (s ShallowStorage) Shallow() ([]plumbing.Hash, error) { - return s, nil -} - -type ModuleStorage map[string]*Storage - -func (s ModuleStorage) Module(name string) (storage.Storer, error) { - if m, ok := s[name]; ok { - return m, nil - } - - m := NewStorage() - s[name] = m - - return m, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/storage/storer.go b/vendor/github.com/go-git/go-git/v5/storage/storer.go deleted file mode 100644 index 4800ac7ba0..0000000000 --- a/vendor/github.com/go-git/go-git/v5/storage/storer.go +++ /dev/null @@ -1,30 +0,0 @@ -package storage - -import ( - "errors" - - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing/storer" -) - -var ErrReferenceHasChanged = errors.New("reference has changed concurrently") - -// Storer is a generic storage of objects, references and any information -// related to a particular repository. The package github.com/go-git/go-git/v5/storage -// contains two implementation a filesystem base implementation (such as `.git`) -// and a memory implementations being ephemeral -type Storer interface { - storer.EncodedObjectStorer - storer.ReferenceStorer - storer.ShallowStorer - storer.IndexStorer - config.ConfigStorer - ModuleStorer -} - -// ModuleStorer allows interact with the modules' Storers -type ModuleStorer interface { - // Module returns a Storer representing a submodule, if not exists returns a - // new empty Storer is returned - Module(name string) (Storer, error) -} diff --git a/vendor/github.com/go-git/go-git/v5/submodule.go b/vendor/github.com/go-git/go-git/v5/submodule.go deleted file mode 100644 index 84f020dc72..0000000000 --- a/vendor/github.com/go-git/go-git/v5/submodule.go +++ /dev/null @@ -1,398 +0,0 @@ -package git - -import ( - "bytes" - "context" - "errors" - "fmt" - "path" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/plumbing/transport" -) - -var ( - ErrSubmoduleAlreadyInitialized = errors.New("submodule already initialized") - ErrSubmoduleNotInitialized = errors.New("submodule not initialized") -) - -// Submodule a submodule allows you to keep another Git repository in a -// subdirectory of your repository. -type Submodule struct { - // initialized defines if a submodule was already initialized. - initialized bool - - c *config.Submodule - w *Worktree -} - -// Config returns the submodule config -func (s *Submodule) Config() *config.Submodule { - return s.c -} - -// Init initialize the submodule reading the recorded Entry in the index for -// the given submodule -func (s *Submodule) Init() error { - cfg, err := s.w.r.Config() - if err != nil { - return err - } - - _, ok := cfg.Submodules[s.c.Name] - if ok { - return ErrSubmoduleAlreadyInitialized - } - - s.initialized = true - - cfg.Submodules[s.c.Name] = s.c - return s.w.r.Storer.SetConfig(cfg) -} - -// Status returns the status of the submodule. -func (s *Submodule) Status() (*SubmoduleStatus, error) { - idx, err := s.w.r.Storer.Index() - if err != nil { - return nil, err - } - - return s.status(idx) -} - -func (s *Submodule) status(idx *index.Index) (*SubmoduleStatus, error) { - status := &SubmoduleStatus{ - Path: s.c.Path, - } - - e, err := idx.Entry(s.c.Path) - if err != nil && err != index.ErrEntryNotFound { - return nil, err - } - - if e != nil { - status.Expected = e.Hash - } - - if !s.initialized { - return status, nil - } - - r, err := s.Repository() - if err != nil { - return nil, err - } - - head, err := r.Head() - if err == nil { - status.Current = head.Hash() - } - - if err != nil && err == plumbing.ErrReferenceNotFound { - err = nil - } - - return status, err -} - -// Repository returns the Repository represented by this submodule -func (s *Submodule) Repository() (*Repository, error) { - if !s.initialized { - return nil, ErrSubmoduleNotInitialized - } - - storer, err := s.w.r.Storer.Module(s.c.Name) - if err != nil { - return nil, err - } - - _, err = storer.Reference(plumbing.HEAD) - if err != nil && err != plumbing.ErrReferenceNotFound { - return nil, err - } - - var exists bool - if err == nil { - exists = true - } - - var worktree billy.Filesystem - if worktree, err = s.w.Filesystem.Chroot(s.c.Path); err != nil { - return nil, err - } - - if exists { - return Open(storer, worktree) - } - - r, err := Init(storer, worktree) - if err != nil { - return nil, err - } - - moduleEndpoint, err := transport.NewEndpoint(s.c.URL) - if err != nil { - return nil, err - } - - if !path.IsAbs(moduleEndpoint.Path) && moduleEndpoint.Protocol == "file" { - remotes, err := s.w.r.Remotes() - if err != nil { - return nil, err - } - - rootEndpoint, err := transport.NewEndpoint(remotes[0].c.URLs[0]) - if err != nil { - return nil, err - } - - rootEndpoint.Path = path.Join(rootEndpoint.Path, moduleEndpoint.Path) - *moduleEndpoint = *rootEndpoint - } - - _, err = r.CreateRemote(&config.RemoteConfig{ - Name: DefaultRemoteName, - URLs: []string{moduleEndpoint.String()}, - }) - - return r, err -} - -// Update the registered submodule to match what the superproject expects, the -// submodule should be initialized first calling the Init method or setting in -// the options SubmoduleUpdateOptions.Init equals true -func (s *Submodule) Update(o *SubmoduleUpdateOptions) error { - return s.UpdateContext(context.Background(), o) -} - -// UpdateContext the registered submodule to match what the superproject -// expects, the submodule should be initialized first calling the Init method or -// setting in the options SubmoduleUpdateOptions.Init equals true. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (s *Submodule) UpdateContext(ctx context.Context, o *SubmoduleUpdateOptions) error { - return s.update(ctx, o, plumbing.ZeroHash) -} - -func (s *Submodule) update(ctx context.Context, o *SubmoduleUpdateOptions, forceHash plumbing.Hash) error { - if !s.initialized && !o.Init { - return ErrSubmoduleNotInitialized - } - - if !s.initialized && o.Init { - if err := s.Init(); err != nil { - return err - } - } - - idx, err := s.w.r.Storer.Index() - if err != nil { - return err - } - - hash := forceHash - if hash.IsZero() { - e, err := idx.Entry(s.c.Path) - if err != nil { - return err - } - - hash = e.Hash - } - - r, err := s.Repository() - if err != nil { - return err - } - - if err := s.fetchAndCheckout(ctx, r, o, hash); err != nil { - return err - } - - return s.doRecursiveUpdate(r, o) -} - -func (s *Submodule) doRecursiveUpdate(r *Repository, o *SubmoduleUpdateOptions) error { - if o.RecurseSubmodules == NoRecurseSubmodules { - return nil - } - - w, err := r.Worktree() - if err != nil { - return err - } - - l, err := w.Submodules() - if err != nil { - return err - } - - new := &SubmoduleUpdateOptions{} - *new = *o - - new.RecurseSubmodules-- - return l.Update(new) -} - -func (s *Submodule) fetchAndCheckout( - ctx context.Context, r *Repository, o *SubmoduleUpdateOptions, hash plumbing.Hash, -) error { - if !o.NoFetch { - err := r.FetchContext(ctx, &FetchOptions{Auth: o.Auth, Depth: o.Depth}) - if err != nil && err != NoErrAlreadyUpToDate { - return err - } - } - - w, err := r.Worktree() - if err != nil { - return err - } - - // Handle a case when submodule refers to an orphaned commit that's still reachable - // through Git server using a special protocol capability[1]. - // - // [1]: https://git-scm.com/docs/protocol-capabilities#_allow_reachable_sha1_in_want - if !o.NoFetch { - if _, err := w.r.Object(plumbing.AnyObject, hash); err != nil { - refSpec := config.RefSpec("+" + hash.String() + ":" + hash.String()) - - err := r.FetchContext(ctx, &FetchOptions{ - Auth: o.Auth, - RefSpecs: []config.RefSpec{refSpec}, - Depth: o.Depth, - }) - if err != nil && err != NoErrAlreadyUpToDate && err != ErrExactSHA1NotSupported { - return err - } - } - } - - if err := w.Checkout(&CheckoutOptions{Hash: hash}); err != nil { - return err - } - - head := plumbing.NewHashReference(plumbing.HEAD, hash) - return r.Storer.SetReference(head) -} - -// Submodules list of several submodules from the same repository. -type Submodules []*Submodule - -// Init initializes the submodules in this list. -func (s Submodules) Init() error { - for _, sub := range s { - if err := sub.Init(); err != nil { - return err - } - } - - return nil -} - -// Update updates all the submodules in this list. -func (s Submodules) Update(o *SubmoduleUpdateOptions) error { - return s.UpdateContext(context.Background(), o) -} - -// UpdateContext updates all the submodules in this list. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (s Submodules) UpdateContext(ctx context.Context, o *SubmoduleUpdateOptions) error { - for _, sub := range s { - if err := sub.UpdateContext(ctx, o); err != nil { - return err - } - } - - return nil -} - -// Status returns the status of the submodules. -func (s Submodules) Status() (SubmodulesStatus, error) { - var list SubmodulesStatus - - var r *Repository - for _, sub := range s { - if r == nil { - r = sub.w.r - } - - idx, err := r.Storer.Index() - if err != nil { - return nil, err - } - - status, err := sub.status(idx) - if err != nil { - return nil, err - } - - list = append(list, status) - } - - return list, nil -} - -// SubmodulesStatus contains the status for all submodiles in the worktree -type SubmodulesStatus []*SubmoduleStatus - -// String is equivalent to `git submodule status` -func (s SubmodulesStatus) String() string { - buf := bytes.NewBuffer(nil) - for _, sub := range s { - fmt.Fprintln(buf, sub) - } - - return buf.String() -} - -// SubmoduleStatus contains the status for a submodule in the worktree -type SubmoduleStatus struct { - Path string - Current plumbing.Hash - Expected plumbing.Hash - Branch plumbing.ReferenceName -} - -// IsClean is the HEAD of the submodule is equals to the expected commit -func (s *SubmoduleStatus) IsClean() bool { - return s.Current == s.Expected -} - -// String is equivalent to `git submodule status ` -// -// This will print the SHA-1 of the currently checked out commit for a -// submodule, along with the submodule path and the output of git describe fo -// the SHA-1. Each SHA-1 will be prefixed with - if the submodule is not -// initialized, + if the currently checked out submodule commit does not match -// the SHA-1 found in the index of the containing repository. -func (s *SubmoduleStatus) String() string { - var extra string - var status = ' ' - - if s.Current.IsZero() { - status = '-' - } else if !s.IsClean() { - status = '+' - } - - if len(s.Branch) != 0 { - extra = string(s.Branch[5:]) - } else if !s.Current.IsZero() { - extra = s.Current.String()[:7] - } - - if extra != "" { - extra = fmt.Sprintf(" (%s)", extra) - } - - return fmt.Sprintf("%c%s %s%s", status, s.Expected, s.Path, extra) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/binary/read.go b/vendor/github.com/go-git/go-git/v5/utils/binary/read.go deleted file mode 100644 index b8f9df1a24..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/binary/read.go +++ /dev/null @@ -1,180 +0,0 @@ -// Package binary implements syntax-sugar functions on top of the standard -// library binary package -package binary - -import ( - "bufio" - "encoding/binary" - "io" - - "github.com/go-git/go-git/v5/plumbing" -) - -// Read reads structured binary data from r into data. Bytes are read and -// decoded in BigEndian order -// https://golang.org/pkg/encoding/binary/#Read -func Read(r io.Reader, data ...interface{}) error { - for _, v := range data { - if err := binary.Read(r, binary.BigEndian, v); err != nil { - return err - } - } - - return nil -} - -// ReadUntil reads from r untin delim is found -func ReadUntil(r io.Reader, delim byte) ([]byte, error) { - if bufr, ok := r.(*bufio.Reader); ok { - return ReadUntilFromBufioReader(bufr, delim) - } - - var buf [1]byte - value := make([]byte, 0, 16) - for { - if _, err := io.ReadFull(r, buf[:]); err != nil { - if err == io.EOF { - return nil, err - } - - return nil, err - } - - if buf[0] == delim { - return value, nil - } - - value = append(value, buf[0]) - } -} - -// ReadUntilFromBufioReader is like bufio.ReadBytes but drops the delimiter -// from the result. -func ReadUntilFromBufioReader(r *bufio.Reader, delim byte) ([]byte, error) { - value, err := r.ReadBytes(delim) - if err != nil || len(value) == 0 { - return nil, err - } - - return value[:len(value)-1], nil -} - -// ReadVariableWidthInt reads and returns an int in Git VLQ special format: -// -// Ordinary VLQ has some redundancies, example: the number 358 can be -// encoded as the 2-octet VLQ 0x8166 or the 3-octet VLQ 0x808166 or the -// 4-octet VLQ 0x80808166 and so forth. -// -// To avoid these redundancies, the VLQ format used in Git removes this -// prepending redundancy and extends the representable range of shorter -// VLQs by adding an offset to VLQs of 2 or more octets in such a way -// that the lowest possible value for such an (N+1)-octet VLQ becomes -// exactly one more than the maximum possible value for an N-octet VLQ. -// In particular, since a 1-octet VLQ can store a maximum value of 127, -// the minimum 2-octet VLQ (0x8000) is assigned the value 128 instead of -// 0. Conversely, the maximum value of such a 2-octet VLQ (0xff7f) is -// 16511 instead of just 16383. Similarly, the minimum 3-octet VLQ -// (0x808000) has a value of 16512 instead of zero, which means -// that the maximum 3-octet VLQ (0xffff7f) is 2113663 instead of -// just 2097151. And so forth. -// -// This is how the offset is saved in C: -// -// dheader[pos] = ofs & 127; -// while (ofs >>= 7) -// dheader[--pos] = 128 | (--ofs & 127); -// -func ReadVariableWidthInt(r io.Reader) (int64, error) { - var c byte - if err := Read(r, &c); err != nil { - return 0, err - } - - var v = int64(c & maskLength) - for c&maskContinue > 0 { - v++ - if err := Read(r, &c); err != nil { - return 0, err - } - - v = (v << lengthBits) + int64(c&maskLength) - } - - return v, nil -} - -const ( - maskContinue = uint8(128) // 1000 000 - maskLength = uint8(127) // 0111 1111 - lengthBits = uint8(7) // subsequent bytes has 7 bits to store the length -) - -// ReadUint64 reads 8 bytes and returns them as a BigEndian uint32 -func ReadUint64(r io.Reader) (uint64, error) { - var v uint64 - if err := binary.Read(r, binary.BigEndian, &v); err != nil { - return 0, err - } - - return v, nil -} - -// ReadUint32 reads 4 bytes and returns them as a BigEndian uint32 -func ReadUint32(r io.Reader) (uint32, error) { - var v uint32 - if err := binary.Read(r, binary.BigEndian, &v); err != nil { - return 0, err - } - - return v, nil -} - -// ReadUint16 reads 2 bytes and returns them as a BigEndian uint16 -func ReadUint16(r io.Reader) (uint16, error) { - var v uint16 - if err := binary.Read(r, binary.BigEndian, &v); err != nil { - return 0, err - } - - return v, nil -} - -// ReadHash reads a plumbing.Hash from r -func ReadHash(r io.Reader) (plumbing.Hash, error) { - var h plumbing.Hash - if err := binary.Read(r, binary.BigEndian, h[:]); err != nil { - return plumbing.ZeroHash, err - } - - return h, nil -} - -const sniffLen = 8000 - -// IsBinary detects if data is a binary value based on: -// http://git.kernel.org/cgit/git/git.git/tree/xdiff-interface.c?id=HEAD#n198 -func IsBinary(r io.Reader) (bool, error) { - reader := bufio.NewReader(r) - c := 0 - for { - if c == sniffLen { - break - } - - b, err := reader.ReadByte() - if err == io.EOF { - break - } - if err != nil { - return false, err - } - - if b == byte(0) { - return true, nil - } - - c++ - } - - return false, nil -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/binary/write.go b/vendor/github.com/go-git/go-git/v5/utils/binary/write.go deleted file mode 100644 index c08c73a06b..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/binary/write.go +++ /dev/null @@ -1,50 +0,0 @@ -package binary - -import ( - "encoding/binary" - "io" -) - -// Write writes the binary representation of data into w, using BigEndian order -// https://golang.org/pkg/encoding/binary/#Write -func Write(w io.Writer, data ...interface{}) error { - for _, v := range data { - if err := binary.Write(w, binary.BigEndian, v); err != nil { - return err - } - } - - return nil -} - -func WriteVariableWidthInt(w io.Writer, n int64) error { - buf := []byte{byte(n & 0x7f)} - n >>= 7 - for n != 0 { - n-- - buf = append([]byte{0x80 | (byte(n & 0x7f))}, buf...) - n >>= 7 - } - - _, err := w.Write(buf) - - return err -} - -// WriteUint64 writes the binary representation of a uint64 into w, in BigEndian -// order -func WriteUint64(w io.Writer, value uint64) error { - return binary.Write(w, binary.BigEndian, value) -} - -// WriteUint32 writes the binary representation of a uint32 into w, in BigEndian -// order -func WriteUint32(w io.Writer, value uint32) error { - return binary.Write(w, binary.BigEndian, value) -} - -// WriteUint16 writes the binary representation of a uint16 into w, in BigEndian -// order -func WriteUint16(w io.Writer, value uint16) error { - return binary.Write(w, binary.BigEndian, value) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/diff/diff.go b/vendor/github.com/go-git/go-git/v5/utils/diff/diff.go deleted file mode 100644 index 70054949fd..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/diff/diff.go +++ /dev/null @@ -1,61 +0,0 @@ -// Package diff implements line oriented diffs, similar to the ancient -// Unix diff command. -// -// The current implementation is just a wrapper around Sergi's -// go-diff/diffmatchpatch library, which is a go port of Neil -// Fraser's google-diff-match-patch code -package diff - -import ( - "bytes" - "time" - - "github.com/sergi/go-diff/diffmatchpatch" -) - -// Do computes the (line oriented) modifications needed to turn the src -// string into the dst string. The underlying algorithm is Meyers, -// its complexity is O(N*d) where N is min(lines(src), lines(dst)) and d -// is the size of the diff. -func Do(src, dst string) (diffs []diffmatchpatch.Diff) { - // the default timeout is time.Second which may be too small under heavy load - return DoWithTimeout(src, dst, time.Hour) -} - -// DoWithTimeout computes the (line oriented) modifications needed to turn the src -// string into the dst string. The `timeout` argument specifies the maximum -// amount of time it is allowed to spend in this function. If the timeout -// is exceeded, the parts of the strings which were not considered are turned into -// a bulk delete+insert and the half-baked suboptimal result is returned at once. -// The underlying algorithm is Meyers, its complexity is O(N*d) where N is -// min(lines(src), lines(dst)) and d is the size of the diff. -func DoWithTimeout(src, dst string, timeout time.Duration) (diffs []diffmatchpatch.Diff) { - dmp := diffmatchpatch.New() - dmp.DiffTimeout = timeout - wSrc, wDst, warray := dmp.DiffLinesToRunes(src, dst) - diffs = dmp.DiffMainRunes(wSrc, wDst, false) - diffs = dmp.DiffCharsToLines(diffs, warray) - return diffs -} - -// Dst computes and returns the destination text. -func Dst(diffs []diffmatchpatch.Diff) string { - var text bytes.Buffer - for _, d := range diffs { - if d.Type != diffmatchpatch.DiffDelete { - text.WriteString(d.Text) - } - } - return text.String() -} - -// Src computes and returns the source text -func Src(diffs []diffmatchpatch.Diff) string { - var text bytes.Buffer - for _, d := range diffs { - if d.Type != diffmatchpatch.DiffInsert { - text.WriteString(d.Text) - } - } - return text.String() -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/ioutil/common.go b/vendor/github.com/go-git/go-git/v5/utils/ioutil/common.go deleted file mode 100644 index 235af717bc..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/ioutil/common.go +++ /dev/null @@ -1,210 +0,0 @@ -// Package ioutil implements some I/O utility functions. -package ioutil - -import ( - "bufio" - "context" - "errors" - "io" - - ctxio "github.com/jbenet/go-context/io" -) - -type readPeeker interface { - io.Reader - Peek(int) ([]byte, error) -} - -var ( - ErrEmptyReader = errors.New("reader is empty") -) - -// NonEmptyReader takes a reader and returns it if it is not empty, or -// `ErrEmptyReader` if it is empty. If there is an error when reading the first -// byte of the given reader, it will be propagated. -func NonEmptyReader(r io.Reader) (io.Reader, error) { - pr, ok := r.(readPeeker) - if !ok { - pr = bufio.NewReader(r) - } - - _, err := pr.Peek(1) - if err == io.EOF { - return nil, ErrEmptyReader - } - - if err != nil { - return nil, err - } - - return pr, nil -} - -type readCloser struct { - io.Reader - closer io.Closer -} - -func (r *readCloser) Close() error { - return r.closer.Close() -} - -// NewReadCloser creates an `io.ReadCloser` with the given `io.Reader` and -// `io.Closer`. -func NewReadCloser(r io.Reader, c io.Closer) io.ReadCloser { - return &readCloser{Reader: r, closer: c} -} - -type readCloserCloser struct { - io.ReadCloser - closer func() error -} - -func (r *readCloserCloser) Close() (err error) { - defer func() { - if err == nil { - err = r.closer() - return - } - _ = r.closer() - }() - return r.ReadCloser.Close() -} - -// NewReadCloserWithCloser creates an `io.ReadCloser` with the given `io.ReaderCloser` and -// `io.Closer` that ensures that the closer is closed on close -func NewReadCloserWithCloser(r io.ReadCloser, c func() error) io.ReadCloser { - return &readCloserCloser{ReadCloser: r, closer: c} -} - -type writeCloser struct { - io.Writer - closer io.Closer -} - -func (r *writeCloser) Close() error { - return r.closer.Close() -} - -// NewWriteCloser creates an `io.WriteCloser` with the given `io.Writer` and -// `io.Closer`. -func NewWriteCloser(w io.Writer, c io.Closer) io.WriteCloser { - return &writeCloser{Writer: w, closer: c} -} - -type writeNopCloser struct { - io.Writer -} - -func (writeNopCloser) Close() error { return nil } - -// WriteNopCloser returns a WriteCloser with a no-op Close method wrapping -// the provided Writer w. -func WriteNopCloser(w io.Writer) io.WriteCloser { - return writeNopCloser{w} -} - -type readerAtAsReader struct { - io.ReaderAt - offset int64 -} - -func (r *readerAtAsReader) Read(bs []byte) (int, error) { - n, err := r.ReaderAt.ReadAt(bs, r.offset) - r.offset += int64(n) - return n, err -} - -func NewReaderUsingReaderAt(r io.ReaderAt, offset int64) io.Reader { - return &readerAtAsReader{ - ReaderAt: r, - offset: offset, - } -} - -// CheckClose calls Close on the given io.Closer. If the given *error points to -// nil, it will be assigned the error returned by Close. Otherwise, any error -// returned by Close will be ignored. CheckClose is usually called with defer. -func CheckClose(c io.Closer, err *error) { - if cerr := c.Close(); cerr != nil && *err == nil { - *err = cerr - } -} - -// NewContextWriter wraps a writer to make it respect given Context. -// If there is a blocking write, the returned Writer will return whenever the -// context is cancelled (the return values are n=0 and err=ctx.Err()). -func NewContextWriter(ctx context.Context, w io.Writer) io.Writer { - return ctxio.NewWriter(ctx, w) -} - -// NewContextReader wraps a reader to make it respect given Context. -// If there is a blocking read, the returned Reader will return whenever the -// context is cancelled (the return values are n=0 and err=ctx.Err()). -func NewContextReader(ctx context.Context, r io.Reader) io.Reader { - return ctxio.NewReader(ctx, r) -} - -// NewContextWriteCloser as NewContextWriter but with io.Closer interface. -func NewContextWriteCloser(ctx context.Context, w io.WriteCloser) io.WriteCloser { - ctxw := ctxio.NewWriter(ctx, w) - return NewWriteCloser(ctxw, w) -} - -// NewContextReadCloser as NewContextReader but with io.Closer interface. -func NewContextReadCloser(ctx context.Context, r io.ReadCloser) io.ReadCloser { - ctxr := ctxio.NewReader(ctx, r) - return NewReadCloser(ctxr, r) -} - -type readerOnError struct { - io.Reader - notify func(error) -} - -// NewReaderOnError returns a io.Reader that call the notify function when an -// unexpected (!io.EOF) error happens, after call Read function. -func NewReaderOnError(r io.Reader, notify func(error)) io.Reader { - return &readerOnError{r, notify} -} - -// NewReadCloserOnError returns a io.ReadCloser that call the notify function -// when an unexpected (!io.EOF) error happens, after call Read function. -func NewReadCloserOnError(r io.ReadCloser, notify func(error)) io.ReadCloser { - return NewReadCloser(NewReaderOnError(r, notify), r) -} - -func (r *readerOnError) Read(buf []byte) (n int, err error) { - n, err = r.Reader.Read(buf) - if err != nil && err != io.EOF { - r.notify(err) - } - - return -} - -type writerOnError struct { - io.Writer - notify func(error) -} - -// NewWriterOnError returns a io.Writer that call the notify function when an -// unexpected (!io.EOF) error happens, after call Write function. -func NewWriterOnError(w io.Writer, notify func(error)) io.Writer { - return &writerOnError{w, notify} -} - -// NewWriteCloserOnError returns a io.WriteCloser that call the notify function -// when an unexpected (!io.EOF) error happens, after call Write function. -func NewWriteCloserOnError(w io.WriteCloser, notify func(error)) io.WriteCloser { - return NewWriteCloser(NewWriterOnError(w, notify), w) -} - -func (r *writerOnError) Write(p []byte) (n int, err error) { - n, err = r.Writer.Write(p) - if err != nil && err != io.EOF { - r.notify(err) - } - - return -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/change.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/change.go deleted file mode 100644 index cc6dc89071..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/change.go +++ /dev/null @@ -1,149 +0,0 @@ -package merkletrie - -import ( - "fmt" - "io" - - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// Action values represent the kind of things a Change can represent: -// insertion, deletions or modifications of files. -type Action int - -// The set of possible actions in a change. -const ( - _ Action = iota - Insert - Delete - Modify -) - -// String returns the action as a human readable text. -func (a Action) String() string { - switch a { - case Insert: - return "Insert" - case Delete: - return "Delete" - case Modify: - return "Modify" - default: - panic(fmt.Sprintf("unsupported action: %d", a)) - } -} - -// A Change value represent how a noder has change between to merkletries. -type Change struct { - // The noder before the change or nil if it was inserted. - From noder.Path - // The noder after the change or nil if it was deleted. - To noder.Path -} - -// Action is convenience method that returns what Action c represents. -func (c *Change) Action() (Action, error) { - if c.From == nil && c.To == nil { - return Action(0), fmt.Errorf("malformed change: nil from and to") - } - if c.From == nil { - return Insert, nil - } - if c.To == nil { - return Delete, nil - } - - return Modify, nil -} - -// NewInsert returns a new Change representing the insertion of n. -func NewInsert(n noder.Path) Change { return Change{To: n} } - -// NewDelete returns a new Change representing the deletion of n. -func NewDelete(n noder.Path) Change { return Change{From: n} } - -// NewModify returns a new Change representing that a has been modified and -// it is now b. -func NewModify(a, b noder.Path) Change { - return Change{ - From: a, - To: b, - } -} - -// String returns a single change in human readable form, using the -// format: '<' + action + space + path + '>'. The contents of the file -// before or after the change are not included in this format. -// -// Example: inserting a file at the path a/b/c.txt will return "". -func (c Change) String() string { - action, err := c.Action() - if err != nil { - panic(err) - } - - var path string - if action == Delete { - path = c.From.String() - } else { - path = c.To.String() - } - - return fmt.Sprintf("<%s %s>", action, path) -} - -// Changes is a list of changes between to merkletries. -type Changes []Change - -// NewChanges returns an empty list of changes. -func NewChanges() Changes { - return Changes{} -} - -// Add adds the change c to the list of changes. -func (l *Changes) Add(c Change) { - *l = append(*l, c) -} - -// AddRecursiveInsert adds the required changes to insert all the -// file-like noders found in root, recursively. -func (l *Changes) AddRecursiveInsert(root noder.Path) error { - return l.addRecursive(root, NewInsert) -} - -// AddRecursiveDelete adds the required changes to delete all the -// file-like noders found in root, recursively. -func (l *Changes) AddRecursiveDelete(root noder.Path) error { - return l.addRecursive(root, NewDelete) -} - -type noderToChangeFn func(noder.Path) Change // NewInsert or NewDelete - -func (l *Changes) addRecursive(root noder.Path, ctor noderToChangeFn) error { - if !root.IsDir() { - l.Add(ctor(root)) - return nil - } - - i, err := NewIterFromPath(root) - if err != nil { - return err - } - - var current noder.Path - for { - if current, err = i.Step(); err != nil { - if err == io.EOF { - break - } - return err - } - if current.IsDir() { - continue - } - l.Add(ctor(current)) - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go deleted file mode 100644 index 8090942ddb..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/difftree.go +++ /dev/null @@ -1,453 +0,0 @@ -package merkletrie - -// The focus of this difftree implementation is to save time by -// skipping whole directories if their hash is the same in both -// trees. -// -// The diff algorithm implemented here is based on the doubleiter -// type defined in this same package; we will iterate over both -// trees at the same time, while comparing the current noders in -// each iterator. Depending on how they differ we will output the -// corresponding changes and move the iterators further over both -// trees. -// -// The table bellow show all the possible comparison results, along -// with what changes should we produce and how to advance the -// iterators. -// -// The table is implemented by the switches in this function, -// diffTwoNodes, diffTwoNodesSameName and diffTwoDirs. -// -// Many Bothans died to bring us this information, make sure you -// understand the table before modifying this code. - -// # Cases -// -// When comparing noders in both trees you will find yourself in -// one of 169 possible cases, but if we ignore moves, we can -// simplify a lot the search space into the following table: -// -// - "-": nothing, no file or directory -// - a<>: an empty file named "a". -// - a<1>: a file named "a", with "1" as its contents. -// - a<2>: a file named "a", with "2" as its contents. -// - a(): an empty dir named "a". -// - a(...): a dir named "a", with some files and/or dirs inside (possibly -// empty). -// - a(;;;): a dir named "a", with some other files and/or dirs inside -// (possibly empty), which different from the ones in "a(...)". -// -// \ to - a<> a<1> a<2> a() a(...) a(;;;) -// from \ -// - 00 01 02 03 04 05 06 -// a<> 10 11 12 13 14 15 16 -// a<1> 20 21 22 23 24 25 26 -// a<2> 30 31 32 33 34 35 36 -// a() 40 41 42 43 44 45 46 -// a(...) 50 51 52 53 54 55 56 -// a(;;;) 60 61 62 63 64 65 66 -// -// Every (from, to) combination in the table is a special case, but -// some of them can be merged into some more general cases, for -// instance 11 and 22 can be merged into the general case: both -// noders are equal. -// -// Here is a full list of all the cases that are similar and how to -// merge them together into more general cases. Each general case -// is labeled with an uppercase letter for further reference, and it -// is followed by the pseudocode of the checks you have to perform -// on both noders to see if you are in such a case, the actions to -// perform (i.e. what changes to output) and how to advance the -// iterators of each tree to continue the comparison process. -// -// ## A. Impossible: 00 -// -// ## B. Same thing on both sides: 11, 22, 33, 44, 55, 66 -// - check: `SameName() && SameHash()` -// - action: do nothing. -// - advance: `FromNext(); ToNext()` -// -// ### C. To was created: 01, 02, 03, 04, 05, 06 -// - check: `DifferentName() && ToBeforeFrom()` -// - action: insertRecursively(to) -// - advance: `ToNext()` -// -// ### D. From was deleted: 10, 20, 30, 40, 50, 60 -// - check: `DifferentName() && FromBeforeTo()` -// - action: `DeleteRecursively(from)` -// - advance: `FromNext()` -// -// ### E. Empty file to file with contents: 12, 13 -// - check: `SameName() && DifferentHash() && FromIsFile() && -// ToIsFile() && FromIsEmpty()` -// - action: `modifyFile(from, to)` -// - advance: `FromNext()` or `FromStep()` -// -// ### E'. file with contents to empty file: 21, 31 -// - check: `SameName() && DifferentHash() && FromIsFile() && -// ToIsFile() && ToIsEmpty()` -// - action: `modifyFile(from, to)` -// - advance: `FromNext()` or `FromStep()` -// -// ### F. empty file to empty dir with the same name: 14 -// - check: `SameName() && FromIsFile() && FromIsEmpty() && -// ToIsDir() && ToIsEmpty()` -// - action: `DeleteFile(from); InsertEmptyDir(to)` -// - advance: `FromNext(); ToNext()` -// -// ### F'. empty dir to empty file of the same name: 41 -// - check: `SameName() && FromIsDir() && FromIsEmpty && -// ToIsFile() && ToIsEmpty()` -// - action: `DeleteEmptyDir(from); InsertFile(to)` -// - advance: `FromNext(); ToNext()` or step for any of them. -// -// ### G. empty file to non-empty dir of the same name: 15, 16 -// - check: `SameName() && FromIsFile() && ToIsDir() && -// FromIsEmpty() && ToIsNotEmpty()` -// - action: `DeleteFile(from); InsertDirRecursively(to)` -// - advance: `FromNext(); ToNext()` -// -// ### G'. non-empty dir to empty file of the same name: 51, 61 -// - check: `SameName() && FromIsDir() && FromIsNotEmpty() && -// ToIsFile() && FromIsEmpty()` -// - action: `DeleteDirRecursively(from); InsertFile(to)` -// - advance: `FromNext(); ToNext()` -// -// ### H. modify file contents: 23, 32 -// - check: `SameName() && FromIsFile() && ToIsFile() && -// FromIsNotEmpty() && ToIsNotEmpty()` -// - action: `ModifyFile(from, to)` -// - advance: `FromNext(); ToNext()` -// -// ### I. file with contents to empty dir: 24, 34 -// - check: `SameName() && DifferentHash() && FromIsFile() && -// FromIsNotEmpty() && ToIsDir() && ToIsEmpty()` -// - action: `DeleteFile(from); InsertEmptyDir(to)` -// - advance: `FromNext(); ToNext()` -// -// ### I'. empty dir to file with contents: 42, 43 -// - check: `SameName() && DifferentHash() && FromIsDir() && -// FromIsEmpty() && ToIsFile() && ToIsEmpty()` -// - action: `DeleteDir(from); InsertFile(to)` -// - advance: `FromNext(); ToNext()` -// -// ### J. file with contents to dir with contents: 25, 26, 35, 36 -// - check: `SameName() && DifferentHash() && FromIsFile() && -// FromIsNotEmpty() && ToIsDir() && ToIsNotEmpty()` -// - action: `DeleteFile(from); InsertDirRecursively(to)` -// - advance: `FromNext(); ToNext()` -// -// ### J'. dir with contents to file with contents: 52, 62, 53, 63 -// - check: `SameName() && DifferentHash() && FromIsDir() && -// FromIsNotEmpty() && ToIsFile() && ToIsNotEmpty()` -// - action: `DeleteDirRecursively(from); InsertFile(to)` -// - advance: `FromNext(); ToNext()` -// -// ### K. empty dir to dir with contents: 45, 46 -// - check: `SameName() && DifferentHash() && FromIsDir() && -// FromIsEmpty() && ToIsDir() && ToIsNotEmpty()` -// - action: `InsertChildrenRecursively(to)` -// - advance: `FromNext(); ToNext()` -// -// ### K'. dir with contents to empty dir: 54, 64 -// - check: `SameName() && DifferentHash() && FromIsDir() && -// FromIsEmpty() && ToIsDir() && ToIsNotEmpty()` -// - action: `DeleteChildrenRecursively(from)` -// - advance: `FromNext(); ToNext()` -// -// ### L. dir with contents to dir with different contents: 56, 65 -// - check: `SameName() && DifferentHash() && FromIsDir() && -// FromIsNotEmpty() && ToIsDir() && ToIsNotEmpty()` -// - action: nothing -// - advance: `FromStep(); ToStep()` -// -// - -// All these cases can be further simplified by a truth table -// reduction process, in which we gather similar checks together to -// make the final code easier to read and understand. -// -// The first 6 columns are the outputs of the checks to perform on -// both noders. I have labeled them 1 to 6, this is what they mean: -// -// 1: SameName() -// 2: SameHash() -// 3: FromIsDir() -// 4: ToIsDir() -// 5: FromIsEmpty() -// 6: ToIsEmpty() -// -// The from and to columns are a fsnoder example of the elements -// that you will find on each tree under the specified comparison -// results (columns 1 to 6). -// -// The type column identifies the case we are into, from the list above. -// -// The type' column identifies the new set of reduced cases, using -// lowercase letters, and they are explained after the table. -// -// The last column is the set of actions and advances for each case. -// -// "---" means impossible except in case of hash collision. -// -// advance meaning: -// - NN: from.Next(); to.Next() -// - SS: from.Step(); to.Step() -// -// 1 2 3 4 5 6 | from | to |type|type'|action ; advance -// ------------+--------+--------+----+------------------------------------ -// 0 0 0 0 0 0 | | | | | if !SameName() { -// . | | | | | if FromBeforeTo() { -// . | | | D | d | delete(from); from.Next() -// . | | | | | } else { -// . | | | C | c | insert(to); to.Next() -// . | | | | | } -// 0 1 1 1 1 1 | | | | | } -// 1 0 0 0 0 0 | a<1> | a<2> | H | e | modify(from, to); NN -// 1 0 0 0 0 1 | a<1> | a<> | E' | e | modify(from, to); NN -// 1 0 0 0 1 0 | a<> | a<1> | E | e | modify(from, to); NN -// 1 0 0 0 1 1 | ---- | ---- | | e | -// 1 0 0 1 0 0 | a<1> | a(...) | J | f | delete(from); insert(to); NN -// 1 0 0 1 0 1 | a<1> | a() | I | f | delete(from); insert(to); NN -// 1 0 0 1 1 0 | a<> | a(...) | G | f | delete(from); insert(to); NN -// 1 0 0 1 1 1 | a<> | a() | F | f | delete(from); insert(to); NN -// 1 0 1 0 0 0 | a(...) | a<1> | J' | f | delete(from); insert(to); NN -// 1 0 1 0 0 1 | a(...) | a<> | G' | f | delete(from); insert(to); NN -// 1 0 1 0 1 0 | a() | a<1> | I' | f | delete(from); insert(to); NN -// 1 0 1 0 1 1 | a() | a<> | F' | f | delete(from); insert(to); NN -// 1 0 1 1 0 0 | a(...) | a(;;;) | L | g | nothing; SS -// 1 0 1 1 0 1 | a(...) | a() | K' | h | deleteChildren(from); NN -// 1 0 1 1 1 0 | a() | a(...) | K | i | insertChildren(to); NN -// 1 0 1 1 1 1 | ---- | ---- | | | -// 1 1 0 0 0 0 | a<1> | a<1> | B | b | nothing; NN -// 1 1 0 0 0 1 | ---- | ---- | | b | -// 1 1 0 0 1 0 | ---- | ---- | | b | -// 1 1 0 0 1 1 | a<> | a<> | B | b | nothing; NN -// 1 1 0 1 0 0 | ---- | ---- | | b | -// 1 1 0 1 0 1 | ---- | ---- | | b | -// 1 1 0 1 1 0 | ---- | ---- | | b | -// 1 1 0 1 1 1 | ---- | ---- | | b | -// 1 1 1 0 0 0 | ---- | ---- | | b | -// 1 1 1 0 0 1 | ---- | ---- | | b | -// 1 1 1 0 1 0 | ---- | ---- | | b | -// 1 1 1 0 1 1 | ---- | ---- | | b | -// 1 1 1 1 0 0 | a(...) | a(...) | B | b | nothing; NN -// 1 1 1 1 0 1 | ---- | ---- | | b | -// 1 1 1 1 1 0 | ---- | ---- | | b | -// 1 1 1 1 1 1 | a() | a() | B | b | nothing; NN -// -// c and d: -// if !SameName() -// d if FromBeforeTo() -// c else -// b: SameName) && sameHash() -// e: SameName() && !sameHash() && BothAreFiles() -// f: SameName() && !sameHash() && FileAndDir() -// g: SameName() && !sameHash() && BothAreDirs() && NoneIsEmpty -// i: SameName() && !sameHash() && BothAreDirs() && FromIsEmpty -// h: else of i - -import ( - "context" - "errors" - "fmt" - - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -var ( - // ErrCanceled is returned whenever the operation is canceled. - ErrCanceled = errors.New("operation canceled") -) - -// DiffTree calculates the list of changes between two merkletries. It -// uses the provided hashEqual callback to compare noders. -func DiffTree( - fromTree, - toTree noder.Noder, - hashEqual noder.Equal, -) (Changes, error) { - return DiffTreeContext(context.Background(), fromTree, toTree, hashEqual) -} - -// DiffTreeContext calculates the list of changes between two merkletries. It -// uses the provided hashEqual callback to compare noders. -// Error will be returned if context expires -// Provided context must be non nil -func DiffTreeContext(ctx context.Context, fromTree, toTree noder.Noder, - hashEqual noder.Equal) (Changes, error) { - ret := NewChanges() - - ii, err := newDoubleIter(fromTree, toTree, hashEqual) - if err != nil { - return nil, err - } - - for { - select { - case <-ctx.Done(): - return nil, ErrCanceled - default: - } - - from := ii.from.current - to := ii.to.current - - switch r := ii.remaining(); r { - case noMoreNoders: - return ret, nil - case onlyFromRemains: - if err = ret.AddRecursiveDelete(from); err != nil { - return nil, err - } - if err = ii.nextFrom(); err != nil { - return nil, err - } - case onlyToRemains: - if to.Skip() { - if err = ret.AddRecursiveDelete(to); err != nil { - return nil, err - } - } else { - if err = ret.AddRecursiveInsert(to); err != nil { - return nil, err - } - } - if err = ii.nextTo(); err != nil { - return nil, err - } - case bothHaveNodes: - if from.Skip() { - if err = ret.AddRecursiveDelete(from); err != nil { - return nil, err - } - if err := ii.nextBoth(); err != nil { - return nil, err - } - break - } - if to.Skip() { - if err = ret.AddRecursiveDelete(to); err != nil { - return nil, err - } - if err := ii.nextBoth(); err != nil { - return nil, err - } - break - } - - if err = diffNodes(&ret, ii); err != nil { - return nil, err - } - default: - panic(fmt.Sprintf("unknown remaining value: %d", r)) - } - } -} - -func diffNodes(changes *Changes, ii *doubleIter) error { - from := ii.from.current - to := ii.to.current - var err error - - // compare their full paths as strings - switch from.Compare(to) { - case -1: - if err = changes.AddRecursiveDelete(from); err != nil { - return err - } - if err = ii.nextFrom(); err != nil { - return err - } - case 1: - if err = changes.AddRecursiveInsert(to); err != nil { - return err - } - if err = ii.nextTo(); err != nil { - return err - } - default: - if err := diffNodesSameName(changes, ii); err != nil { - return err - } - } - - return nil -} - -func diffNodesSameName(changes *Changes, ii *doubleIter) error { - from := ii.from.current - to := ii.to.current - - status, err := ii.compare() - if err != nil { - return err - } - - switch { - case status.sameHash: - // do nothing - if err = ii.nextBoth(); err != nil { - return err - } - case status.bothAreFiles: - changes.Add(NewModify(from, to)) - if err = ii.nextBoth(); err != nil { - return err - } - case status.fileAndDir: - if err = changes.AddRecursiveDelete(from); err != nil { - return err - } - if err = changes.AddRecursiveInsert(to); err != nil { - return err - } - if err = ii.nextBoth(); err != nil { - return err - } - case status.bothAreDirs: - if err = diffDirs(changes, ii); err != nil { - return err - } - default: - return fmt.Errorf("bad status from double iterator") - } - - return nil -} - -func diffDirs(changes *Changes, ii *doubleIter) error { - from := ii.from.current - to := ii.to.current - - status, err := ii.compare() - if err != nil { - return err - } - - switch { - case status.fromIsEmptyDir: - if err = changes.AddRecursiveInsert(to); err != nil { - return err - } - if err = ii.nextBoth(); err != nil { - return err - } - case status.toIsEmptyDir: - if err = changes.AddRecursiveDelete(from); err != nil { - return err - } - if err = ii.nextBoth(); err != nil { - return err - } - case !status.fromIsEmptyDir && !status.toIsEmptyDir: - // do nothing - if err = ii.stepBoth(); err != nil { - return err - } - default: - return fmt.Errorf("both dirs are empty but has different hash") - } - - return nil -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doc.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doc.go deleted file mode 100644 index 5204024ad4..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doc.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Package merkletrie provides support for n-ary trees that are at the same -time Merkle trees and Radix trees (tries). - -Git trees are Radix n-ary trees in virtue of the names of their -tree entries. At the same time, git trees are Merkle trees thanks to -their hashes. - -This package defines Merkle tries as nodes that should have: - -- a hash: the Merkle part of the Merkle trie - -- a key: the Radix part of the Merkle trie - -The Merkle hash condition is not enforced by this package though. This -means that the hash of a node doesn't have to take into account the hashes of -their children, which is good for testing purposes. - -Nodes in the Merkle trie are abstracted by the Noder interface. The -intended use is that git trees implements this interface, either -directly or using a simple wrapper. - -This package provides an iterator for merkletries that can skip whole -directory-like noders and an efficient merkletrie comparison algorithm. - -When comparing git trees, the simple approach of alphabetically sorting -their elements and comparing the resulting lists is too slow as it -depends linearly on the number of files in the trees: When a directory -has lots of files but none of them has been modified, this approach is -very expensive. We can do better by prunning whole directories that -have not change, just by looking at their hashes. This package provides -the tools to do exactly that. -*/ -package merkletrie diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doubleiter.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doubleiter.go deleted file mode 100644 index 4a4341b387..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/doubleiter.go +++ /dev/null @@ -1,187 +0,0 @@ -package merkletrie - -import ( - "fmt" - "io" - - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// A doubleIter is a convenience type to keep track of the current -// noders in two merkletries that are going to be iterated in parallel. -// It has methods for: -// -// - iterating over the merkletries, both at the same time or -// individually: nextFrom, nextTo, nextBoth, stepBoth -// -// - checking if there are noders left in one or both of them with the -// remaining method and its associated returned type. -// -// - comparing the current noders of both merkletries in several ways, -// with the compare method and its associated returned type. -type doubleIter struct { - from struct { - iter *Iter - current noder.Path // nil if no more nodes - } - to struct { - iter *Iter - current noder.Path // nil if no more nodes - } - hashEqual noder.Equal -} - -// NewdoubleIter returns a new doubleIter for the merkletries "from" and -// "to". The hashEqual callback function will be used by the doubleIter -// to compare the hash of the noders in the merkletries. The doubleIter -// will be initialized to the first elements in each merkletrie if any. -func newDoubleIter(from, to noder.Noder, hashEqual noder.Equal) ( - *doubleIter, error) { - var ii doubleIter - var err error - - if ii.from.iter, err = NewIter(from); err != nil { - return nil, fmt.Errorf("from: %s", err) - } - if ii.from.current, err = ii.from.iter.Next(); turnEOFIntoNil(err) != nil { - return nil, fmt.Errorf("from: %s", err) - } - - if ii.to.iter, err = NewIter(to); err != nil { - return nil, fmt.Errorf("to: %s", err) - } - if ii.to.current, err = ii.to.iter.Next(); turnEOFIntoNil(err) != nil { - return nil, fmt.Errorf("to: %s", err) - } - - ii.hashEqual = hashEqual - - return &ii, nil -} - -func turnEOFIntoNil(e error) error { - if e != nil && e != io.EOF { - return e - } - return nil -} - -// NextBoth makes d advance to the next noder in both merkletries. If -// any of them is a directory, it skips its contents. -func (d *doubleIter) nextBoth() error { - if err := d.nextFrom(); err != nil { - return err - } - if err := d.nextTo(); err != nil { - return err - } - - return nil -} - -// NextFrom makes d advance to the next noder in the "from" merkletrie, -// skipping its contents if it is a directory. -func (d *doubleIter) nextFrom() (err error) { - d.from.current, err = d.from.iter.Next() - return turnEOFIntoNil(err) -} - -// NextTo makes d advance to the next noder in the "to" merkletrie, -// skipping its contents if it is a directory. -func (d *doubleIter) nextTo() (err error) { - d.to.current, err = d.to.iter.Next() - return turnEOFIntoNil(err) -} - -// StepBoth makes d advance to the next noder in both merkletries, -// getting deeper into directories if that is the case. -func (d *doubleIter) stepBoth() (err error) { - if d.from.current, err = d.from.iter.Step(); turnEOFIntoNil(err) != nil { - return err - } - if d.to.current, err = d.to.iter.Step(); turnEOFIntoNil(err) != nil { - return err - } - return nil -} - -// Remaining returns if there are no more noders in the tree, if both -// have noders or if one of them doesn't. -func (d *doubleIter) remaining() remaining { - if d.from.current == nil && d.to.current == nil { - return noMoreNoders - } - - if d.from.current == nil && d.to.current != nil { - return onlyToRemains - } - - if d.from.current != nil && d.to.current == nil { - return onlyFromRemains - } - - return bothHaveNodes -} - -// Remaining values tells you whether both trees still have noders, or -// only one of them or none of them. -type remaining int - -const ( - noMoreNoders remaining = iota - onlyToRemains - onlyFromRemains - bothHaveNodes -) - -// Compare returns the comparison between the current elements in the -// merkletries. -func (d *doubleIter) compare() (s comparison, err error) { - s.sameHash = d.hashEqual(d.from.current, d.to.current) - - fromIsDir := d.from.current.IsDir() - toIsDir := d.to.current.IsDir() - - s.bothAreDirs = fromIsDir && toIsDir - s.bothAreFiles = !fromIsDir && !toIsDir - s.fileAndDir = !s.bothAreDirs && !s.bothAreFiles - - fromNumChildren, err := d.from.current.NumChildren() - if err != nil { - return comparison{}, fmt.Errorf("from: %s", err) - } - - toNumChildren, err := d.to.current.NumChildren() - if err != nil { - return comparison{}, fmt.Errorf("to: %s", err) - } - - s.fromIsEmptyDir = fromIsDir && fromNumChildren == 0 - s.toIsEmptyDir = toIsDir && toNumChildren == 0 - - return -} - -// Answers to a lot of questions you can ask about how to noders are -// equal or different. -type comparison struct { - // the following are only valid if both nodes have the same name - // (i.e. nameComparison == 0) - - // Do both nodes have the same hash? - sameHash bool - // Are both nodes files? - bothAreFiles bool - - // the following are only valid if any of the noders are dirs, - // this is, if !bothAreFiles - - // Is one a file and the other a dir? - fileAndDir bool - // Are both nodes dirs? - bothAreDirs bool - // Is the from node an empty dir? - fromIsEmptyDir bool - // Is the to Node an empty dir? - toIsEmptyDir bool -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/filesystem/node.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/filesystem/node.go deleted file mode 100644 index 7bba0d03e3..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/filesystem/node.go +++ /dev/null @@ -1,203 +0,0 @@ -package filesystem - -import ( - "io" - "os" - "path" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" - - "github.com/go-git/go-billy/v5" -) - -var ignore = map[string]bool{ - ".git": true, -} - -// The node represents a file or a directory in a billy.Filesystem. It -// implements the interface noder.Noder of merkletrie package. -// -// This implementation implements a "standard" hash method being able to be -// compared with any other noder.Noder implementation inside of go-git. -type node struct { - fs billy.Filesystem - submodules map[string]plumbing.Hash - - path string - hash []byte - children []noder.Noder - isDir bool -} - -// NewRootNode returns the root node based on a given billy.Filesystem. -// -// In order to provide the submodule hash status, a map[string]plumbing.Hash -// should be provided where the key is the path of the submodule and the commit -// of the submodule HEAD -func NewRootNode( - fs billy.Filesystem, - submodules map[string]plumbing.Hash, -) noder.Noder { - return &node{fs: fs, submodules: submodules, isDir: true} -} - -// Hash the hash of a filesystem is the result of concatenating the computed -// plumbing.Hash of the file as a Blob and its plumbing.FileMode; that way the -// difftree algorithm will detect changes in the contents of files and also in -// their mode. -// -// The hash of a directory is always a 24-bytes slice of zero values -func (n *node) Hash() []byte { - return n.hash -} - -func (n *node) Name() string { - return path.Base(n.path) -} - -func (n *node) IsDir() bool { - return n.isDir -} - -func (n *node) Skip() bool { - return false -} - -func (n *node) Children() ([]noder.Noder, error) { - if err := n.calculateChildren(); err != nil { - return nil, err - } - - return n.children, nil -} - -func (n *node) NumChildren() (int, error) { - if err := n.calculateChildren(); err != nil { - return -1, err - } - - return len(n.children), nil -} - -func (n *node) calculateChildren() error { - if !n.IsDir() { - return nil - } - - if len(n.children) != 0 { - return nil - } - - files, err := n.fs.ReadDir(n.path) - if err != nil { - if os.IsNotExist(err) { - return nil - } - return err - } - - for _, file := range files { - if _, ok := ignore[file.Name()]; ok { - continue - } - - if file.Mode()&os.ModeSocket != 0 { - continue - } - - c, err := n.newChildNode(file) - if err != nil { - return err - } - - n.children = append(n.children, c) - } - - return nil -} - -func (n *node) newChildNode(file os.FileInfo) (*node, error) { - path := path.Join(n.path, file.Name()) - - hash, err := n.calculateHash(path, file) - if err != nil { - return nil, err - } - - node := &node{ - fs: n.fs, - submodules: n.submodules, - - path: path, - hash: hash, - isDir: file.IsDir(), - } - - if hash, isSubmodule := n.submodules[path]; isSubmodule { - node.hash = append(hash[:], filemode.Submodule.Bytes()...) - node.isDir = false - } - - return node, nil -} - -func (n *node) calculateHash(path string, file os.FileInfo) ([]byte, error) { - if file.IsDir() { - return make([]byte, 24), nil - } - - var hash plumbing.Hash - var err error - if file.Mode()&os.ModeSymlink != 0 { - hash, err = n.doCalculateHashForSymlink(path, file) - } else { - hash, err = n.doCalculateHashForRegular(path, file) - } - - if err != nil { - return nil, err - } - - mode, err := filemode.NewFromOSFileMode(file.Mode()) - if err != nil { - return nil, err - } - - return append(hash[:], mode.Bytes()...), nil -} - -func (n *node) doCalculateHashForRegular(path string, file os.FileInfo) (plumbing.Hash, error) { - f, err := n.fs.Open(path) - if err != nil { - return plumbing.ZeroHash, err - } - - defer f.Close() - - h := plumbing.NewHasher(plumbing.BlobObject, file.Size()) - if _, err := io.Copy(h, f); err != nil { - return plumbing.ZeroHash, err - } - - return h.Sum(), nil -} - -func (n *node) doCalculateHashForSymlink(path string, file os.FileInfo) (plumbing.Hash, error) { - target, err := n.fs.Readlink(path) - if err != nil { - return plumbing.ZeroHash, err - } - - h := plumbing.NewHasher(plumbing.BlobObject, file.Size()) - if _, err := h.Write([]byte(target)); err != nil { - return plumbing.ZeroHash, err - } - - return h.Sum(), nil -} - -func (n *node) String() string { - return n.path -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/index/node.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/index/node.go deleted file mode 100644 index c1809f7ecd..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/index/node.go +++ /dev/null @@ -1,95 +0,0 @@ -package index - -import ( - "path" - "strings" - - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// The node represents a index.Entry or a directory inferred from the path -// of all entries. It implements the interface noder.Noder of merkletrie -// package. -// -// This implementation implements a "standard" hash method being able to be -// compared with any other noder.Noder implementation inside of go-git -type node struct { - path string - entry *index.Entry - children []noder.Noder - isDir bool - skip bool -} - -// NewRootNode returns the root node of a computed tree from a index.Index, -func NewRootNode(idx *index.Index) noder.Noder { - const rootNode = "" - - m := map[string]*node{rootNode: {isDir: true}} - - for _, e := range idx.Entries { - parts := strings.Split(e.Name, string("/")) - - var fullpath string - for _, part := range parts { - parent := fullpath - fullpath = path.Join(fullpath, part) - - if _, ok := m[fullpath]; ok { - continue - } - - n := &node{path: fullpath, skip: e.SkipWorktree} - if fullpath == e.Name { - n.entry = e - } else { - n.isDir = true - } - - m[n.path] = n - m[parent].children = append(m[parent].children, n) - } - } - - return m[rootNode] -} - -func (n *node) String() string { - return n.path -} - -func (n *node) Skip() bool { - return n.skip -} - -// Hash the hash of a filesystem is a 24-byte slice, is the result of -// concatenating the computed plumbing.Hash of the file as a Blob and its -// plumbing.FileMode; that way the difftree algorithm will detect changes in the -// contents of files and also in their mode. -// -// If the node is computed and not based on a index.Entry the hash is equals -// to a 24-bytes slices of zero values. -func (n *node) Hash() []byte { - if n.entry == nil { - return make([]byte, 24) - } - - return append(n.entry.Hash[:], n.entry.Mode.Bytes()...) -} - -func (n *node) Name() string { - return path.Base(n.path) -} - -func (n *node) IsDir() bool { - return n.isDir -} - -func (n *node) Children() ([]noder.Noder, error) { - return n.children, nil -} - -func (n *node) NumChildren() (int, error) { - return len(n.children), nil -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go deleted file mode 100644 index 131878a1c7..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/internal/frame/frame.go +++ /dev/null @@ -1,91 +0,0 @@ -package frame - -import ( - "bytes" - "fmt" - "sort" - "strings" - - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// A Frame is a collection of siblings in a trie, sorted alphabetically -// by name. -type Frame struct { - // siblings, sorted in reverse alphabetical order by name - stack []noder.Noder -} - -type byName []noder.Noder - -func (a byName) Len() int { return len(a) } -func (a byName) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byName) Less(i, j int) bool { - return strings.Compare(a[i].Name(), a[j].Name()) < 0 -} - -// New returns a frame with the children of the provided node. -func New(n noder.Noder) (*Frame, error) { - children, err := n.Children() - if err != nil { - return nil, err - } - - sort.Sort(sort.Reverse(byName(children))) - return &Frame{ - stack: children, - }, nil -} - -// String returns the quoted names of the noders in the frame sorted in -// alphabetical order by name, surrounded by square brackets and -// separated by comas. -// -// Examples: -// [] -// ["a", "b"] -func (f *Frame) String() string { - var buf bytes.Buffer - _ = buf.WriteByte('[') - - sep := "" - for i := f.Len() - 1; i >= 0; i-- { - _, _ = buf.WriteString(sep) - sep = ", " - _, _ = buf.WriteString(fmt.Sprintf("%q", f.stack[i].Name())) - } - - _ = buf.WriteByte(']') - - return buf.String() -} - -// First returns, but dont extract, the noder with the alphabetically -// smaller name in the frame and true if the frame was not empty. -// Otherwise it returns nil and false. -func (f *Frame) First() (noder.Noder, bool) { - if f.Len() == 0 { - return nil, false - } - - top := f.Len() - 1 - - return f.stack[top], true -} - -// Drop extracts the noder with the alphabetically smaller name in the -// frame or does nothing if the frame was empty. -func (f *Frame) Drop() { - if f.Len() == 0 { - return - } - - top := f.Len() - 1 - f.stack[top] = nil - f.stack = f.stack[:top] -} - -// Len returns the number of noders in the frame. -func (f *Frame) Len() int { - return len(f.stack) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go deleted file mode 100644 index d75afec464..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/iter.go +++ /dev/null @@ -1,216 +0,0 @@ -package merkletrie - -import ( - "fmt" - "io" - - "github.com/go-git/go-git/v5/utils/merkletrie/internal/frame" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -// Iter is an iterator for merkletries (only the trie part of the -// merkletrie is relevant here, it does not use the Hasher interface). -// -// The iteration is performed in depth-first pre-order. Entries at each -// depth are traversed in (case-sensitive) alphabetical order. -// -// This is the kind of traversal you will expect when listing ordinary -// files and directories recursively, for example: -// -// Trie Traversal order -// ---- --------------- -// . -// / | \ c -// / | \ d/ -// d c z ===> d/a -// / \ d/b -// b a z -// -// -// This iterator is somewhat especial as you can chose to skip whole -// "directories" when iterating: -// -// - The Step method will iterate normally. -// -// - the Next method will not descend deeper into the tree. -// -// For example, if the iterator is at `d/`, the Step method will return -// `d/a` while the Next would have returned `z` instead (skipping `d/` -// and its descendants). The name of the these two methods are based on -// the well known "next" and "step" operations, quite common in -// debuggers, like gdb. -// -// The paths returned by the iterator will be relative, if the iterator -// was created from a single node, or absolute, if the iterator was -// created from the path to the node (the path will be prefixed to all -// returned paths). -type Iter struct { - // Tells if the iteration has started. - hasStarted bool - // The top of this stack has the current node and its siblings. The - // rest of the stack keeps the ancestors of the current node and - // their corresponding siblings. The current element is always the - // top element of the top frame. - // - // When "step"ping into a node, its children are pushed as a new - // frame. - // - // When "next"ing pass a node, the current element is dropped by - // popping the top frame. - frameStack []*frame.Frame - // The base path used to turn the relative paths used internally by - // the iterator into absolute paths used by external applications. - // For relative iterator this will be nil. - base noder.Path -} - -// NewIter returns a new relative iterator using the provider noder as -// its unnamed root. When iterating, all returned paths will be -// relative to node. -func NewIter(n noder.Noder) (*Iter, error) { - return newIter(n, nil) -} - -// NewIterFromPath returns a new absolute iterator from the noder at the -// end of the path p. When iterating, all returned paths will be -// absolute, using the root of the path p as their root. -func NewIterFromPath(p noder.Path) (*Iter, error) { - return newIter(p, p) // Path implements Noder -} - -func newIter(root noder.Noder, base noder.Path) (*Iter, error) { - ret := &Iter{ - base: base, - } - - if root == nil { - return ret, nil - } - - frame, err := frame.New(root) - if err != nil { - return nil, err - } - ret.push(frame) - - return ret, nil -} - -func (iter *Iter) top() (*frame.Frame, bool) { - if len(iter.frameStack) == 0 { - return nil, false - } - top := len(iter.frameStack) - 1 - - return iter.frameStack[top], true -} - -func (iter *Iter) push(f *frame.Frame) { - iter.frameStack = append(iter.frameStack, f) -} - -const ( - doDescend = true - dontDescend = false -) - -// Next returns the path of the next node without descending deeper into -// the trie and nil. If there are no more entries in the trie it -// returns nil and io.EOF. In case of error, it will return nil and the -// error. -func (iter *Iter) Next() (noder.Path, error) { - return iter.advance(dontDescend) -} - -// Step returns the path to the next node in the trie, descending deeper -// into it if needed, and nil. If there are no more nodes in the trie, -// it returns nil and io.EOF. In case of error, it will return nil and -// the error. -func (iter *Iter) Step() (noder.Path, error) { - return iter.advance(doDescend) -} - -// Advances the iterator in the desired direction: descend or -// dontDescend. -// -// Returns the new current element and a nil error on success. If there -// are no more elements in the trie below the base, it returns nil, and -// io.EOF. Returns nil and an error in case of errors. -func (iter *Iter) advance(wantDescend bool) (noder.Path, error) { - current, err := iter.current() - if err != nil { - return nil, err - } - - // The first time we just return the current node. - if !iter.hasStarted { - iter.hasStarted = true - return current, nil - } - - // Advances means getting a next current node, either its first child or - // its next sibling, depending if we must descend or not. - numChildren, err := current.NumChildren() - if err != nil { - return nil, err - } - - mustDescend := numChildren != 0 && wantDescend - if mustDescend { - // descend: add a new frame with the current's children. - frame, err := frame.New(current) - if err != nil { - return nil, err - } - iter.push(frame) - } else { - // don't descend: just drop the current node - iter.drop() - } - - return iter.current() -} - -// Returns the path to the current node, adding the base if there was -// one, and a nil error. If there were no noders left, it returns nil -// and io.EOF. If an error occurred, it returns nil and the error. -func (iter *Iter) current() (noder.Path, error) { - if topFrame, ok := iter.top(); !ok { - return nil, io.EOF - } else if _, ok := topFrame.First(); !ok { - return nil, io.EOF - } - - ret := make(noder.Path, 0, len(iter.base)+len(iter.frameStack)) - - // concat the base... - ret = append(ret, iter.base...) - // ... and the current node and all its ancestors - for i, f := range iter.frameStack { - t, ok := f.First() - if !ok { - panic(fmt.Sprintf("frame %d is empty", i)) - } - ret = append(ret, t) - } - - return ret, nil -} - -// removes the current node if any, and all the frames that become empty as a -// consequence of this action. -func (iter *Iter) drop() { - frame, ok := iter.top() - if !ok { - return - } - - frame.Drop() - // if the frame is empty, remove it and its parent, recursively - if frame.Len() == 0 { - top := len(iter.frameStack) - 1 - iter.frameStack[top] = nil - iter.frameStack = iter.frameStack[:top] - iter.drop() - } -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go deleted file mode 100644 index 6d22b8c14e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/noder.go +++ /dev/null @@ -1,60 +0,0 @@ -// Package noder provide an interface for defining nodes in a -// merkletrie, their hashes and their paths (a noders and its -// ancestors). -// -// The hasher interface is easy to implement naively by elements that -// already have a hash, like git blobs and trees. More sophisticated -// implementations can implement the Equal function in exotic ways -// though: for instance, comparing the modification time of directories -// in a filesystem. -package noder - -import "fmt" - -// Hasher interface is implemented by types that can tell you -// their hash. -type Hasher interface { - Hash() []byte -} - -// Equal functions take two hashers and return if they are equal. -// -// These functions are expected to be faster than reflect.Equal or -// reflect.DeepEqual because they can compare just the hash of the -// objects, instead of their contents, so they are expected to be O(1). -type Equal func(a, b Hasher) bool - -// The Noder interface is implemented by the elements of a Merkle Trie. -// -// There are two types of elements in a Merkle Trie: -// -// - file-like nodes: they cannot have children. -// -// - directory-like nodes: they can have 0 or more children and their -// hash is calculated by combining their children hashes. -type Noder interface { - Hasher - fmt.Stringer // for testing purposes - // Name returns the name of an element (relative, not its full - // path). - Name() string - // IsDir returns true if the element is a directory-like node or - // false if it is a file-like node. - IsDir() bool - // Children returns the children of the element. Note that empty - // directory-like noders and file-like noders will both return - // NoChildren. - Children() ([]Noder, error) - // NumChildren returns the number of children this element has. - // - // This method is an optimization: the number of children is easily - // calculated as the length of the value returned by the Children - // method (above); yet, some implementations will be able to - // implement NumChildren in O(1) while Children is usually more - // complex. - NumChildren() (int, error) - Skip() bool -} - -// NoChildren represents the children of a noder without children. -var NoChildren = []Noder{} diff --git a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/path.go b/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/path.go deleted file mode 100644 index 6c1d363320..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/merkletrie/noder/path.go +++ /dev/null @@ -1,98 +0,0 @@ -package noder - -import ( - "bytes" - "strings" -) - -// Path values represent a noder and its ancestors. The root goes first -// and the actual final noder the path is referring to will be the last. -// -// A path implements the Noder interface, redirecting all the interface -// calls to its final noder. -// -// Paths build from an empty Noder slice are not valid paths and should -// not be used. -type Path []Noder - -func (p Path) Skip() bool { - if len(p) > 0 { - return p.Last().Skip() - } - - return false -} - -// String returns the full path of the final noder as a string, using -// "/" as the separator. -func (p Path) String() string { - var buf bytes.Buffer - sep := "" - for _, e := range p { - _, _ = buf.WriteString(sep) - sep = "/" - _, _ = buf.WriteString(e.Name()) - } - - return buf.String() -} - -// Last returns the final noder in the path. -func (p Path) Last() Noder { - return p[len(p)-1] -} - -// Hash returns the hash of the final noder of the path. -func (p Path) Hash() []byte { - return p.Last().Hash() -} - -// Name returns the name of the final noder of the path. -func (p Path) Name() string { - return p.Last().Name() -} - -// IsDir returns if the final noder of the path is a directory-like -// noder. -func (p Path) IsDir() bool { - return p.Last().IsDir() -} - -// Children returns the children of the final noder in the path. -func (p Path) Children() ([]Noder, error) { - return p.Last().Children() -} - -// NumChildren returns the number of children the final noder of the -// path has. -func (p Path) NumChildren() (int, error) { - return p.Last().NumChildren() -} - -// Compare returns -1, 0 or 1 if the path p is smaller, equal or bigger -// than other, in "directory order"; for example: -// -// "a" < "b" -// "a/b/c/d/z" < "b" -// "a/b/a" > "a/b" -func (p Path) Compare(other Path) int { - i := 0 - for { - switch { - case len(other) == len(p) && i == len(p): - return 0 - case i == len(other): - return 1 - case i == len(p): - return -1 - default: - // We do *not* normalize Unicode here. CGit doesn't. - // https://github.com/src-d/go-git/issues/1057 - cmp := strings.Compare(p[i].Name(), other[i].Name()) - if cmp != 0 { - return cmp - } - } - i++ - } -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/sync/bufio.go b/vendor/github.com/go-git/go-git/v5/utils/sync/bufio.go deleted file mode 100644 index 5009ea8047..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/sync/bufio.go +++ /dev/null @@ -1,29 +0,0 @@ -package sync - -import ( - "bufio" - "io" - "sync" -) - -var bufioReader = sync.Pool{ - New: func() interface{} { - return bufio.NewReader(nil) - }, -} - -// GetBufioReader returns a *bufio.Reader that is managed by a sync.Pool. -// Returns a bufio.Reader that is resetted with reader and ready for use. -// -// After use, the *bufio.Reader should be put back into the sync.Pool -// by calling PutBufioReader. -func GetBufioReader(reader io.Reader) *bufio.Reader { - r := bufioReader.Get().(*bufio.Reader) - r.Reset(reader) - return r -} - -// PutBufioReader puts reader back into its sync.Pool. -func PutBufioReader(reader *bufio.Reader) { - bufioReader.Put(reader) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/sync/bytes.go b/vendor/github.com/go-git/go-git/v5/utils/sync/bytes.go deleted file mode 100644 index dd06fc0bc6..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/sync/bytes.go +++ /dev/null @@ -1,51 +0,0 @@ -package sync - -import ( - "bytes" - "sync" -) - -var ( - byteSlice = sync.Pool{ - New: func() interface{} { - b := make([]byte, 16*1024) - return &b - }, - } - bytesBuffer = sync.Pool{ - New: func() interface{} { - return bytes.NewBuffer(nil) - }, - } -) - -// GetByteSlice returns a *[]byte that is managed by a sync.Pool. -// The initial slice length will be 16384 (16kb). -// -// After use, the *[]byte should be put back into the sync.Pool -// by calling PutByteSlice. -func GetByteSlice() *[]byte { - buf := byteSlice.Get().(*[]byte) - return buf -} - -// PutByteSlice puts buf back into its sync.Pool. -func PutByteSlice(buf *[]byte) { - byteSlice.Put(buf) -} - -// GetBytesBuffer returns a *bytes.Buffer that is managed by a sync.Pool. -// Returns a buffer that is resetted and ready for use. -// -// After use, the *bytes.Buffer should be put back into the sync.Pool -// by calling PutBytesBuffer. -func GetBytesBuffer() *bytes.Buffer { - buf := bytesBuffer.Get().(*bytes.Buffer) - buf.Reset() - return buf -} - -// PutBytesBuffer puts buf back into its sync.Pool. -func PutBytesBuffer(buf *bytes.Buffer) { - bytesBuffer.Put(buf) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/sync/zlib.go b/vendor/github.com/go-git/go-git/v5/utils/sync/zlib.go deleted file mode 100644 index c613885957..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/sync/zlib.go +++ /dev/null @@ -1,74 +0,0 @@ -package sync - -import ( - "bytes" - "compress/zlib" - "io" - "sync" -) - -var ( - zlibInitBytes = []byte{0x78, 0x9c, 0x01, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01} - zlibReader = sync.Pool{ - New: func() interface{} { - r, _ := zlib.NewReader(bytes.NewReader(zlibInitBytes)) - return ZLibReader{ - Reader: r.(zlibReadCloser), - } - }, - } - zlibWriter = sync.Pool{ - New: func() interface{} { - return zlib.NewWriter(nil) - }, - } -) - -type zlibReadCloser interface { - io.ReadCloser - zlib.Resetter -} - -type ZLibReader struct { - dict *[]byte - Reader zlibReadCloser -} - -// GetZlibReader returns a ZLibReader that is managed by a sync.Pool. -// Returns a ZLibReader that is resetted using a dictionary that is -// also managed by a sync.Pool. -// -// After use, the ZLibReader should be put back into the sync.Pool -// by calling PutZlibReader. -func GetZlibReader(r io.Reader) (ZLibReader, error) { - z := zlibReader.Get().(ZLibReader) - z.dict = GetByteSlice() - - err := z.Reader.Reset(r, *z.dict) - - return z, err -} - -// PutZlibReader puts z back into its sync.Pool, first closing the reader. -// The Byte slice dictionary is also put back into its sync.Pool. -func PutZlibReader(z ZLibReader) { - z.Reader.Close() - PutByteSlice(z.dict) - zlibReader.Put(z) -} - -// GetZlibWriter returns a *zlib.Writer that is managed by a sync.Pool. -// Returns a writer that is resetted with w and ready for use. -// -// After use, the *zlib.Writer should be put back into the sync.Pool -// by calling PutZlibWriter. -func GetZlibWriter(w io.Writer) *zlib.Writer { - z := zlibWriter.Get().(*zlib.Writer) - z.Reset(w) - return z -} - -// PutZlibWriter puts w back into its sync.Pool. -func PutZlibWriter(w *zlib.Writer) { - zlibWriter.Put(w) -} diff --git a/vendor/github.com/go-git/go-git/v5/utils/trace/trace.go b/vendor/github.com/go-git/go-git/v5/utils/trace/trace.go deleted file mode 100644 index 3e15c5b9f9..0000000000 --- a/vendor/github.com/go-git/go-git/v5/utils/trace/trace.go +++ /dev/null @@ -1,55 +0,0 @@ -package trace - -import ( - "fmt" - "log" - "os" - "sync/atomic" -) - -var ( - // logger is the logger to use for tracing. - logger = newLogger() - - // current is the targets that are enabled for tracing. - current atomic.Int32 -) - -func newLogger() *log.Logger { - return log.New(os.Stderr, "", log.Ltime|log.Lmicroseconds|log.Lshortfile) -} - -// Target is a tracing target. -type Target int32 - -const ( - // General traces general operations. - General Target = 1 << iota - - // Packet traces git packets. - Packet -) - -// SetTarget sets the tracing targets. -func SetTarget(target Target) { - current.Store(int32(target)) -} - -// SetLogger sets the logger to use for tracing. -func SetLogger(l *log.Logger) { - logger = l -} - -// Print prints the given message only if the target is enabled. -func (t Target) Print(args ...interface{}) { - if int32(t)¤t.Load() != 0 { - logger.Output(2, fmt.Sprint(args...)) // nolint: errcheck - } -} - -// Printf prints the given message only if the target is enabled. -func (t Target) Printf(format string, args ...interface{}) { - if int32(t)¤t.Load() != 0 { - logger.Output(2, fmt.Sprintf(format, args...)) // nolint: errcheck - } -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree.go b/vendor/github.com/go-git/go-git/v5/worktree.go deleted file mode 100644 index ad525c1a49..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree.go +++ /dev/null @@ -1,1125 +0,0 @@ -package git - -import ( - "context" - "errors" - "fmt" - "io" - "os" - "path/filepath" - "runtime" - "strings" - - "github.com/go-git/go-billy/v5" - "github.com/go-git/go-billy/v5/util" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/format/gitignore" - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/storer" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/merkletrie" - "github.com/go-git/go-git/v5/utils/sync" -) - -var ( - ErrWorktreeNotClean = errors.New("worktree is not clean") - ErrSubmoduleNotFound = errors.New("submodule not found") - ErrUnstagedChanges = errors.New("worktree contains unstaged changes") - ErrGitModulesSymlink = errors.New(gitmodulesFile + " is a symlink") - ErrNonFastForwardUpdate = errors.New("non-fast-forward update") -) - -// Worktree represents a git worktree. -type Worktree struct { - // Filesystem underlying filesystem. - Filesystem billy.Filesystem - // External excludes not found in the repository .gitignore - Excludes []gitignore.Pattern - - r *Repository -} - -// Pull incorporates changes from a remote repository into the current branch. -// Returns nil if the operation is successful, NoErrAlreadyUpToDate if there are -// no changes to be fetched, or an error. -// -// Pull only supports merges where the can be resolved as a fast-forward. -func (w *Worktree) Pull(o *PullOptions) error { - return w.PullContext(context.Background(), o) -} - -// PullContext incorporates changes from a remote repository into the current -// branch. Returns nil if the operation is successful, NoErrAlreadyUpToDate if -// there are no changes to be fetched, or an error. -// -// Pull only supports merges where the can be resolved as a fast-forward. -// -// The provided Context must be non-nil. If the context expires before the -// operation is complete, an error is returned. The context only affects the -// transport operations. -func (w *Worktree) PullContext(ctx context.Context, o *PullOptions) error { - if err := o.Validate(); err != nil { - return err - } - - remote, err := w.r.Remote(o.RemoteName) - if err != nil { - return err - } - - fetchHead, err := remote.fetch(ctx, &FetchOptions{ - RemoteName: o.RemoteName, - RemoteURL: o.RemoteURL, - Depth: o.Depth, - Auth: o.Auth, - Progress: o.Progress, - Force: o.Force, - InsecureSkipTLS: o.InsecureSkipTLS, - CABundle: o.CABundle, - ProxyOptions: o.ProxyOptions, - }) - - updated := true - if err == NoErrAlreadyUpToDate { - updated = false - } else if err != nil { - return err - } - - ref, err := storer.ResolveReference(fetchHead, o.ReferenceName) - if err != nil { - return err - } - - head, err := w.r.Head() - if err == nil { - // if we don't have a shallows list, just ignore it - shallowList, _ := w.r.Storer.Shallow() - - var earliestShallow *plumbing.Hash - if len(shallowList) > 0 { - earliestShallow = &shallowList[0] - } - - headAheadOfRef, err := isFastForward(w.r.Storer, ref.Hash(), head.Hash(), earliestShallow) - if err != nil { - return err - } - - if !updated && headAheadOfRef { - return NoErrAlreadyUpToDate - } - - ff, err := isFastForward(w.r.Storer, head.Hash(), ref.Hash(), earliestShallow) - if err != nil { - return err - } - - if !ff { - return ErrNonFastForwardUpdate - } - } - - if err != nil && err != plumbing.ErrReferenceNotFound { - return err - } - - if err := w.updateHEAD(ref.Hash()); err != nil { - return err - } - - if err := w.Reset(&ResetOptions{ - Mode: MergeReset, - Commit: ref.Hash(), - }); err != nil { - return err - } - - if o.RecurseSubmodules != NoRecurseSubmodules { - return w.updateSubmodules(&SubmoduleUpdateOptions{ - RecurseSubmodules: o.RecurseSubmodules, - Auth: o.Auth, - }) - } - - return nil -} - -func (w *Worktree) updateSubmodules(o *SubmoduleUpdateOptions) error { - s, err := w.Submodules() - if err != nil { - return err - } - o.Init = true - return s.Update(o) -} - -// Checkout switch branches or restore working tree files. -func (w *Worktree) Checkout(opts *CheckoutOptions) error { - if err := opts.Validate(); err != nil { - return err - } - - if opts.Create { - if err := w.createBranch(opts); err != nil { - return err - } - } - - c, err := w.getCommitFromCheckoutOptions(opts) - if err != nil { - return err - } - - ro := &ResetOptions{Commit: c, Mode: MergeReset} - if opts.Force { - ro.Mode = HardReset - } else if opts.Keep { - ro.Mode = SoftReset - } - - if !opts.Hash.IsZero() && !opts.Create { - err = w.setHEADToCommit(opts.Hash) - } else { - err = w.setHEADToBranch(opts.Branch, c) - } - - if err != nil { - return err - } - - if len(opts.SparseCheckoutDirectories) > 0 { - return w.ResetSparsely(ro, opts.SparseCheckoutDirectories) - } - - return w.Reset(ro) -} - -func (w *Worktree) createBranch(opts *CheckoutOptions) error { - if err := opts.Branch.Validate(); err != nil { - return err - } - - _, err := w.r.Storer.Reference(opts.Branch) - if err == nil { - return fmt.Errorf("a branch named %q already exists", opts.Branch) - } - - if err != plumbing.ErrReferenceNotFound { - return err - } - - if opts.Hash.IsZero() { - ref, err := w.r.Head() - if err != nil { - return err - } - - opts.Hash = ref.Hash() - } - - return w.r.Storer.SetReference( - plumbing.NewHashReference(opts.Branch, opts.Hash), - ) -} - -func (w *Worktree) getCommitFromCheckoutOptions(opts *CheckoutOptions) (plumbing.Hash, error) { - if !opts.Hash.IsZero() { - return opts.Hash, nil - } - - b, err := w.r.Reference(opts.Branch, true) - if err != nil { - return plumbing.ZeroHash, err - } - - if !b.Name().IsTag() { - return b.Hash(), nil - } - - o, err := w.r.Object(plumbing.AnyObject, b.Hash()) - if err != nil { - return plumbing.ZeroHash, err - } - - switch o := o.(type) { - case *object.Tag: - if o.TargetType != plumbing.CommitObject { - return plumbing.ZeroHash, fmt.Errorf("unsupported tag object target %q", o.TargetType) - } - - return o.Target, nil - case *object.Commit: - return o.Hash, nil - } - - return plumbing.ZeroHash, fmt.Errorf("unsupported tag target %q", o.Type()) -} - -func (w *Worktree) setHEADToCommit(commit plumbing.Hash) error { - head := plumbing.NewHashReference(plumbing.HEAD, commit) - return w.r.Storer.SetReference(head) -} - -func (w *Worktree) setHEADToBranch(branch plumbing.ReferenceName, commit plumbing.Hash) error { - target, err := w.r.Storer.Reference(branch) - if err != nil { - return err - } - - var head *plumbing.Reference - if target.Name().IsBranch() { - head = plumbing.NewSymbolicReference(plumbing.HEAD, target.Name()) - } else { - head = plumbing.NewHashReference(plumbing.HEAD, commit) - } - - return w.r.Storer.SetReference(head) -} - -func (w *Worktree) ResetSparsely(opts *ResetOptions, dirs []string) error { - if err := opts.Validate(w.r); err != nil { - return err - } - - if opts.Mode == MergeReset { - unstaged, err := w.containsUnstagedChanges() - if err != nil { - return err - } - - if unstaged { - return ErrUnstagedChanges - } - } - - if err := w.setHEADCommit(opts.Commit); err != nil { - return err - } - - if opts.Mode == SoftReset { - return nil - } - - t, err := w.r.getTreeFromCommitHash(opts.Commit) - if err != nil { - return err - } - - if opts.Mode == MixedReset || opts.Mode == MergeReset || opts.Mode == HardReset { - if err := w.resetIndex(t, dirs); err != nil { - return err - } - } - - if opts.Mode == MergeReset || opts.Mode == HardReset { - if err := w.resetWorktree(t); err != nil { - return err - } - } - - return nil -} - -// Reset the worktree to a specified state. -func (w *Worktree) Reset(opts *ResetOptions) error { - return w.ResetSparsely(opts, nil) -} - -func (w *Worktree) resetIndex(t *object.Tree, dirs []string) error { - idx, err := w.r.Storer.Index() - if len(dirs) > 0 { - idx.SkipUnless(dirs) - } - - if err != nil { - return err - } - b := newIndexBuilder(idx) - - changes, err := w.diffTreeWithStaging(t, true) - if err != nil { - return err - } - - for _, ch := range changes { - a, err := ch.Action() - if err != nil { - return err - } - - var name string - var e *object.TreeEntry - - switch a { - case merkletrie.Modify, merkletrie.Insert: - name = ch.To.String() - e, err = t.FindEntry(name) - if err != nil { - return err - } - case merkletrie.Delete: - name = ch.From.String() - } - - b.Remove(name) - if e == nil { - continue - } - - b.Add(&index.Entry{ - Name: name, - Hash: e.Hash, - Mode: e.Mode, - }) - - } - - b.Write(idx) - return w.r.Storer.SetIndex(idx) -} - -func (w *Worktree) resetWorktree(t *object.Tree) error { - changes, err := w.diffStagingWithWorktree(true, false) - if err != nil { - return err - } - - idx, err := w.r.Storer.Index() - if err != nil { - return err - } - b := newIndexBuilder(idx) - - for _, ch := range changes { - if err := w.validChange(ch); err != nil { - return err - } - if err := w.checkoutChange(ch, t, b); err != nil { - return err - } - } - - b.Write(idx) - return w.r.Storer.SetIndex(idx) -} - -// worktreeDeny is a list of paths that are not allowed -// to be used when resetting the worktree. -var worktreeDeny = map[string]struct{}{ - // .git - GitDirName: {}, - - // For other historical reasons, file names that do not conform to the 8.3 - // format (up to eight characters for the basename, three for the file - // extension, certain characters not allowed such as `+`, etc) are associated - // with a so-called "short name", at least on the `C:` drive by default. - // Which means that `git~1/` is a valid way to refer to `.git/`. - "git~1": {}, -} - -// validPath checks whether paths are valid. -// The rules around invalid paths could differ from upstream based on how -// filesystems are managed within go-git, but they are largely the same. -// -// For upstream rules: -// https://github.com/git/git/blob/564d0252ca632e0264ed670534a51d18a689ef5d/read-cache.c#L946 -// https://github.com/git/git/blob/564d0252ca632e0264ed670534a51d18a689ef5d/path.c#L1383 -func validPath(paths ...string) error { - for _, p := range paths { - parts := strings.FieldsFunc(p, func(r rune) bool { return (r == '\\' || r == '/') }) - if _, denied := worktreeDeny[strings.ToLower(parts[0])]; denied { - return fmt.Errorf("invalid path prefix: %q", p) - } - - if runtime.GOOS == "windows" { - // Volume names are not supported, in both formats: \\ and :. - if vol := filepath.VolumeName(p); vol != "" { - return fmt.Errorf("invalid path: %q", p) - } - - if !windowsValidPath(parts[0]) { - return fmt.Errorf("invalid path: %q", p) - } - } - - for _, part := range parts { - if part == ".." { - return fmt.Errorf("invalid path %q: cannot use '..'", p) - } - } - } - return nil -} - -// windowsPathReplacer defines the chars that need to be replaced -// as part of windowsValidPath. -var windowsPathReplacer *strings.Replacer - -func init() { - windowsPathReplacer = strings.NewReplacer(" ", "", ".", "") -} - -func windowsValidPath(part string) bool { - if len(part) > 3 && strings.EqualFold(part[:4], GitDirName) { - // For historical reasons, file names that end in spaces or periods are - // automatically trimmed. Therefore, `.git . . ./` is a valid way to refer - // to `.git/`. - if windowsPathReplacer.Replace(part[4:]) == "" { - return false - } - - // For yet other historical reasons, NTFS supports so-called "Alternate Data - // Streams", i.e. metadata associated with a given file, referred to via - // `::`. There exists a default stream - // type for directories, allowing `.git/` to be accessed via - // `.git::$INDEX_ALLOCATION/`. - // - // For performance reasons, _all_ Alternate Data Streams of `.git/` are - // forbidden, not just `::$INDEX_ALLOCATION`. - if len(part) > 4 && part[4:5] == ":" { - return false - } - } - return true -} - -func (w *Worktree) validChange(ch merkletrie.Change) error { - action, err := ch.Action() - if err != nil { - return nil - } - - switch action { - case merkletrie.Delete: - return validPath(ch.From.String()) - case merkletrie.Insert: - return validPath(ch.To.String()) - case merkletrie.Modify: - return validPath(ch.From.String(), ch.To.String()) - } - - return nil -} - -func (w *Worktree) checkoutChange(ch merkletrie.Change, t *object.Tree, idx *indexBuilder) error { - a, err := ch.Action() - if err != nil { - return err - } - - var e *object.TreeEntry - var name string - var isSubmodule bool - - switch a { - case merkletrie.Modify, merkletrie.Insert: - name = ch.To.String() - e, err = t.FindEntry(name) - if err != nil { - return err - } - - isSubmodule = e.Mode == filemode.Submodule - case merkletrie.Delete: - return rmFileAndDirsIfEmpty(w.Filesystem, ch.From.String()) - } - - if isSubmodule { - return w.checkoutChangeSubmodule(name, a, e, idx) - } - - return w.checkoutChangeRegularFile(name, a, t, e, idx) -} - -func (w *Worktree) containsUnstagedChanges() (bool, error) { - ch, err := w.diffStagingWithWorktree(false, true) - if err != nil { - return false, err - } - - for _, c := range ch { - a, err := c.Action() - if err != nil { - return false, err - } - - if a == merkletrie.Insert { - continue - } - - return true, nil - } - - return false, nil -} - -func (w *Worktree) setHEADCommit(commit plumbing.Hash) error { - head, err := w.r.Reference(plumbing.HEAD, false) - if err != nil { - return err - } - - if head.Type() == plumbing.HashReference { - head = plumbing.NewHashReference(plumbing.HEAD, commit) - return w.r.Storer.SetReference(head) - } - - branch, err := w.r.Reference(head.Target(), false) - if err != nil { - return err - } - - if !branch.Name().IsBranch() { - return fmt.Errorf("invalid HEAD target should be a branch, found %s", branch.Type()) - } - - branch = plumbing.NewHashReference(branch.Name(), commit) - return w.r.Storer.SetReference(branch) -} - -func (w *Worktree) checkoutChangeSubmodule(name string, - a merkletrie.Action, - e *object.TreeEntry, - idx *indexBuilder, -) error { - switch a { - case merkletrie.Modify: - sub, err := w.Submodule(name) - if err != nil { - return err - } - - if !sub.initialized { - return nil - } - - return w.addIndexFromTreeEntry(name, e, idx) - case merkletrie.Insert: - mode, err := e.Mode.ToOSFileMode() - if err != nil { - return err - } - - if err := w.Filesystem.MkdirAll(name, mode); err != nil { - return err - } - - return w.addIndexFromTreeEntry(name, e, idx) - } - - return nil -} - -func (w *Worktree) checkoutChangeRegularFile(name string, - a merkletrie.Action, - t *object.Tree, - e *object.TreeEntry, - idx *indexBuilder, -) error { - switch a { - case merkletrie.Modify: - idx.Remove(name) - - // to apply perm changes the file is deleted, billy doesn't implement - // chmod - if err := w.Filesystem.Remove(name); err != nil { - return err - } - - fallthrough - case merkletrie.Insert: - f, err := t.File(name) - if err != nil { - return err - } - - if err := w.checkoutFile(f); err != nil { - return err - } - - return w.addIndexFromFile(name, e.Hash, idx) - } - - return nil -} - -func (w *Worktree) checkoutFile(f *object.File) (err error) { - mode, err := f.Mode.ToOSFileMode() - if err != nil { - return - } - - if mode&os.ModeSymlink != 0 { - return w.checkoutFileSymlink(f) - } - - from, err := f.Reader() - if err != nil { - return - } - - defer ioutil.CheckClose(from, &err) - - to, err := w.Filesystem.OpenFile(f.Name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode.Perm()) - if err != nil { - return - } - - defer ioutil.CheckClose(to, &err) - buf := sync.GetByteSlice() - _, err = io.CopyBuffer(to, from, *buf) - sync.PutByteSlice(buf) - return -} - -func (w *Worktree) checkoutFileSymlink(f *object.File) (err error) { - // https://github.com/git/git/commit/10ecfa76491e4923988337b2e2243b05376b40de - if strings.EqualFold(f.Name, gitmodulesFile) { - return ErrGitModulesSymlink - } - - from, err := f.Reader() - if err != nil { - return - } - - defer ioutil.CheckClose(from, &err) - - bytes, err := io.ReadAll(from) - if err != nil { - return - } - - err = w.Filesystem.Symlink(string(bytes), f.Name) - - // On windows, this might fail. - // Follow Git on Windows behavior by writing the link as it is. - if err != nil && isSymlinkWindowsNonAdmin(err) { - mode, _ := f.Mode.ToOSFileMode() - - to, err := w.Filesystem.OpenFile(f.Name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, mode.Perm()) - if err != nil { - return err - } - - defer ioutil.CheckClose(to, &err) - - _, err = to.Write(bytes) - return err - } - return -} - -func (w *Worktree) addIndexFromTreeEntry(name string, f *object.TreeEntry, idx *indexBuilder) error { - idx.Remove(name) - idx.Add(&index.Entry{ - Hash: f.Hash, - Name: name, - Mode: filemode.Submodule, - }) - return nil -} - -func (w *Worktree) addIndexFromFile(name string, h plumbing.Hash, idx *indexBuilder) error { - idx.Remove(name) - fi, err := w.Filesystem.Lstat(name) - if err != nil { - return err - } - - mode, err := filemode.NewFromOSFileMode(fi.Mode()) - if err != nil { - return err - } - - e := &index.Entry{ - Hash: h, - Name: name, - Mode: mode, - ModifiedAt: fi.ModTime(), - Size: uint32(fi.Size()), - } - - // if the FileInfo.Sys() comes from os the ctime, dev, inode, uid and gid - // can be retrieved, otherwise this doesn't apply - if fillSystemInfo != nil { - fillSystemInfo(e, fi.Sys()) - } - idx.Add(e) - return nil -} - -func (r *Repository) getTreeFromCommitHash(commit plumbing.Hash) (*object.Tree, error) { - c, err := r.CommitObject(commit) - if err != nil { - return nil, err - } - - return c.Tree() -} - -var fillSystemInfo func(e *index.Entry, sys interface{}) - -const gitmodulesFile = ".gitmodules" - -// Submodule returns the submodule with the given name -func (w *Worktree) Submodule(name string) (*Submodule, error) { - l, err := w.Submodules() - if err != nil { - return nil, err - } - - for _, m := range l { - if m.Config().Name == name { - return m, nil - } - } - - return nil, ErrSubmoduleNotFound -} - -// Submodules returns all the available submodules -func (w *Worktree) Submodules() (Submodules, error) { - l := make(Submodules, 0) - m, err := w.readGitmodulesFile() - if err != nil || m == nil { - return l, err - } - - c, err := w.r.Config() - if err != nil { - return nil, err - } - - for _, s := range m.Submodules { - l = append(l, w.newSubmodule(s, c.Submodules[s.Name])) - } - - return l, nil -} - -func (w *Worktree) newSubmodule(fromModules, fromConfig *config.Submodule) *Submodule { - m := &Submodule{w: w} - m.initialized = fromConfig != nil - - if !m.initialized { - m.c = fromModules - return m - } - - m.c = fromConfig - m.c.Path = fromModules.Path - return m -} - -func (w *Worktree) isSymlink(path string) bool { - if s, err := w.Filesystem.Lstat(path); err == nil { - return s.Mode()&os.ModeSymlink != 0 - } - return false -} - -func (w *Worktree) readGitmodulesFile() (*config.Modules, error) { - if w.isSymlink(gitmodulesFile) { - return nil, ErrGitModulesSymlink - } - - f, err := w.Filesystem.Open(gitmodulesFile) - if err != nil { - if os.IsNotExist(err) { - return nil, nil - } - - return nil, err - } - - defer f.Close() - input, err := io.ReadAll(f) - if err != nil { - return nil, err - } - - m := config.NewModules() - if err := m.Unmarshal(input); err != nil { - return m, err - } - - return m, nil -} - -// Clean the worktree by removing untracked files. -// An empty dir could be removed - this is what `git clean -f -d .` does. -func (w *Worktree) Clean(opts *CleanOptions) error { - s, err := w.Status() - if err != nil { - return err - } - - root := "" - files, err := w.Filesystem.ReadDir(root) - if err != nil { - return err - } - return w.doClean(s, opts, root, files) -} - -func (w *Worktree) doClean(status Status, opts *CleanOptions, dir string, files []os.FileInfo) error { - for _, fi := range files { - if fi.Name() == GitDirName { - continue - } - - // relative path under the root - path := filepath.Join(dir, fi.Name()) - if fi.IsDir() { - if !opts.Dir { - continue - } - - subfiles, err := w.Filesystem.ReadDir(path) - if err != nil { - return err - } - err = w.doClean(status, opts, path, subfiles) - if err != nil { - return err - } - } else { - if status.IsUntracked(path) { - if err := w.Filesystem.Remove(path); err != nil { - return err - } - } - } - } - - if opts.Dir && dir != "" { - _, err := removeDirIfEmpty(w.Filesystem, dir) - return err - } - - return nil -} - -// GrepResult is structure of a grep result. -type GrepResult struct { - // FileName is the name of file which contains match. - FileName string - // LineNumber is the line number of a file at which a match was found. - LineNumber int - // Content is the content of the file at the matching line. - Content string - // TreeName is the name of the tree (reference name/commit hash) at - // which the match was performed. - TreeName string -} - -func (gr GrepResult) String() string { - return fmt.Sprintf("%s:%s:%d:%s", gr.TreeName, gr.FileName, gr.LineNumber, gr.Content) -} - -// Grep performs grep on a repository. -func (r *Repository) Grep(opts *GrepOptions) ([]GrepResult, error) { - if err := opts.validate(r); err != nil { - return nil, err - } - - // Obtain commit hash from options (CommitHash or ReferenceName). - var commitHash plumbing.Hash - // treeName contains the value of TreeName in GrepResult. - var treeName string - - if opts.ReferenceName != "" { - ref, err := r.Reference(opts.ReferenceName, true) - if err != nil { - return nil, err - } - commitHash = ref.Hash() - treeName = opts.ReferenceName.String() - } else if !opts.CommitHash.IsZero() { - commitHash = opts.CommitHash - treeName = opts.CommitHash.String() - } - - // Obtain a tree from the commit hash and get a tracked files iterator from - // the tree. - tree, err := r.getTreeFromCommitHash(commitHash) - if err != nil { - return nil, err - } - fileiter := tree.Files() - - return findMatchInFiles(fileiter, treeName, opts) -} - -// Grep performs grep on a worktree. -func (w *Worktree) Grep(opts *GrepOptions) ([]GrepResult, error) { - return w.r.Grep(opts) -} - -// findMatchInFiles takes a FileIter, worktree name and GrepOptions, and -// returns a slice of GrepResult containing the result of regex pattern matching -// in content of all the files. -func findMatchInFiles(fileiter *object.FileIter, treeName string, opts *GrepOptions) ([]GrepResult, error) { - var results []GrepResult - - err := fileiter.ForEach(func(file *object.File) error { - var fileInPathSpec bool - - // When no pathspecs are provided, search all the files. - if len(opts.PathSpecs) == 0 { - fileInPathSpec = true - } - - // Check if the file name matches with the pathspec. Break out of the - // loop once a match is found. - for _, pathSpec := range opts.PathSpecs { - if pathSpec != nil && pathSpec.MatchString(file.Name) { - fileInPathSpec = true - break - } - } - - // If the file does not match with any of the pathspec, skip it. - if !fileInPathSpec { - return nil - } - - grepResults, err := findMatchInFile(file, treeName, opts) - if err != nil { - return err - } - results = append(results, grepResults...) - - return nil - }) - - return results, err -} - -// findMatchInFile takes a single File, worktree name and GrepOptions, -// and returns a slice of GrepResult containing the result of regex pattern -// matching in the given file. -func findMatchInFile(file *object.File, treeName string, opts *GrepOptions) ([]GrepResult, error) { - var grepResults []GrepResult - - content, err := file.Contents() - if err != nil { - return grepResults, err - } - - // Split the file content and parse line-by-line. - contentByLine := strings.Split(content, "\n") - for lineNum, cnt := range contentByLine { - addToResult := false - - // Match the patterns and content. Break out of the loop once a - // match is found. - for _, pattern := range opts.Patterns { - if pattern != nil && pattern.MatchString(cnt) { - // Add to result only if invert match is not enabled. - if !opts.InvertMatch { - addToResult = true - break - } - } else if opts.InvertMatch { - // If matching fails, and invert match is enabled, add to - // results. - addToResult = true - break - } - } - - if addToResult { - grepResults = append(grepResults, GrepResult{ - FileName: file.Name, - LineNumber: lineNum + 1, - Content: cnt, - TreeName: treeName, - }) - } - } - - return grepResults, nil -} - -// will walk up the directory tree removing all encountered empty -// directories, not just the one containing this file -func rmFileAndDirsIfEmpty(fs billy.Filesystem, name string) error { - if err := util.RemoveAll(fs, name); err != nil { - return err - } - - dir := filepath.Dir(name) - for { - removed, err := removeDirIfEmpty(fs, dir) - if err != nil { - return err - } - - if !removed { - // directory was not empty and not removed, - // stop checking parents - break - } - - // move to parent directory - dir = filepath.Dir(dir) - } - - return nil -} - -// removeDirIfEmpty will remove the supplied directory `dir` if -// `dir` is empty -// returns true if the directory was removed -func removeDirIfEmpty(fs billy.Filesystem, dir string) (bool, error) { - files, err := fs.ReadDir(dir) - if err != nil { - return false, err - } - - if len(files) > 0 { - return false, nil - } - - err = fs.Remove(dir) - if err != nil { - return false, err - } - - return true, nil -} - -type indexBuilder struct { - entries map[string]*index.Entry -} - -func newIndexBuilder(idx *index.Index) *indexBuilder { - entries := make(map[string]*index.Entry, len(idx.Entries)) - for _, e := range idx.Entries { - entries[e.Name] = e - } - return &indexBuilder{ - entries: entries, - } -} - -func (b *indexBuilder) Write(idx *index.Index) { - idx.Entries = idx.Entries[:0] - for _, e := range b.entries { - idx.Entries = append(idx.Entries, e) - } -} - -func (b *indexBuilder) Add(e *index.Entry) { - b.entries[e.Name] = e -} - -func (b *indexBuilder) Remove(name string) { - delete(b.entries, filepath.ToSlash(name)) -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_bsd.go b/vendor/github.com/go-git/go-git/v5/worktree_bsd.go deleted file mode 100644 index d4682eb83b..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_bsd.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build darwin freebsd netbsd - -package git - -import ( - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Stat_t); ok { - e.CreatedAt = time.Unix(os.Atimespec.Unix()) - e.Dev = uint32(os.Dev) - e.Inode = uint32(os.Ino) - e.GID = os.Gid - e.UID = os.Uid - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_commit.go b/vendor/github.com/go-git/go-git/v5/worktree_commit.go deleted file mode 100644 index eaa21c3f19..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_commit.go +++ /dev/null @@ -1,266 +0,0 @@ -package git - -import ( - "bytes" - "errors" - "path" - "sort" - "strings" - - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/storage" - - "github.com/ProtonMail/go-crypto/openpgp" - "github.com/go-git/go-billy/v5" -) - -var ( - // ErrEmptyCommit occurs when a commit is attempted using a clean - // working tree, with no changes to be committed. - ErrEmptyCommit = errors.New("cannot create empty commit: clean working tree") -) - -// Commit stores the current contents of the index in a new commit along with -// a log message from the user describing the changes. -func (w *Worktree) Commit(msg string, opts *CommitOptions) (plumbing.Hash, error) { - if err := opts.Validate(w.r); err != nil { - return plumbing.ZeroHash, err - } - - if opts.All { - if err := w.autoAddModifiedAndDeleted(); err != nil { - return plumbing.ZeroHash, err - } - } - - var treeHash plumbing.Hash - - if opts.Amend { - head, err := w.r.Head() - if err != nil { - return plumbing.ZeroHash, err - } - - t, err := w.r.getTreeFromCommitHash(head.Hash()) - if err != nil { - return plumbing.ZeroHash, err - } - - treeHash = t.Hash - opts.Parents = []plumbing.Hash{head.Hash()} - } else { - idx, err := w.r.Storer.Index() - if err != nil { - return plumbing.ZeroHash, err - } - - h := &buildTreeHelper{ - fs: w.Filesystem, - s: w.r.Storer, - } - - treeHash, err = h.BuildTree(idx, opts) - if err != nil { - return plumbing.ZeroHash, err - } - } - - commit, err := w.buildCommitObject(msg, opts, treeHash) - if err != nil { - return plumbing.ZeroHash, err - } - - return commit, w.updateHEAD(commit) -} - -func (w *Worktree) autoAddModifiedAndDeleted() error { - s, err := w.Status() - if err != nil { - return err - } - - idx, err := w.r.Storer.Index() - if err != nil { - return err - } - - for path, fs := range s { - if fs.Worktree != Modified && fs.Worktree != Deleted { - continue - } - - if _, _, err := w.doAddFile(idx, s, path, nil); err != nil { - return err - } - - } - - return w.r.Storer.SetIndex(idx) -} - -func (w *Worktree) updateHEAD(commit plumbing.Hash) error { - head, err := w.r.Storer.Reference(plumbing.HEAD) - if err != nil { - return err - } - - name := plumbing.HEAD - if head.Type() != plumbing.HashReference { - name = head.Target() - } - - ref := plumbing.NewHashReference(name, commit) - return w.r.Storer.SetReference(ref) -} - -func (w *Worktree) buildCommitObject(msg string, opts *CommitOptions, tree plumbing.Hash) (plumbing.Hash, error) { - commit := &object.Commit{ - Author: *opts.Author, - Committer: *opts.Committer, - Message: msg, - TreeHash: tree, - ParentHashes: opts.Parents, - } - - if opts.SignKey != nil { - sig, err := w.buildCommitSignature(commit, opts.SignKey) - if err != nil { - return plumbing.ZeroHash, err - } - commit.PGPSignature = sig - } - - obj := w.r.Storer.NewEncodedObject() - if err := commit.Encode(obj); err != nil { - return plumbing.ZeroHash, err - } - return w.r.Storer.SetEncodedObject(obj) -} - -func (w *Worktree) buildCommitSignature(commit *object.Commit, signKey *openpgp.Entity) (string, error) { - encoded := &plumbing.MemoryObject{} - if err := commit.Encode(encoded); err != nil { - return "", err - } - r, err := encoded.Reader() - if err != nil { - return "", err - } - var b bytes.Buffer - if err := openpgp.ArmoredDetachSign(&b, signKey, r, nil); err != nil { - return "", err - } - return b.String(), nil -} - -// buildTreeHelper converts a given index.Index file into multiple git objects -// reading the blobs from the given filesystem and creating the trees from the -// index structure. The created objects are pushed to a given Storer. -type buildTreeHelper struct { - fs billy.Filesystem - s storage.Storer - - trees map[string]*object.Tree - entries map[string]*object.TreeEntry -} - -// BuildTree builds the tree objects and push its to the storer, the hash -// of the root tree is returned. -func (h *buildTreeHelper) BuildTree(idx *index.Index, opts *CommitOptions) (plumbing.Hash, error) { - if len(idx.Entries) == 0 && (opts == nil || !opts.AllowEmptyCommits) { - return plumbing.ZeroHash, ErrEmptyCommit - } - - const rootNode = "" - h.trees = map[string]*object.Tree{rootNode: {}} - h.entries = map[string]*object.TreeEntry{} - - for _, e := range idx.Entries { - if err := h.commitIndexEntry(e); err != nil { - return plumbing.ZeroHash, err - } - } - - return h.copyTreeToStorageRecursive(rootNode, h.trees[rootNode]) -} - -func (h *buildTreeHelper) commitIndexEntry(e *index.Entry) error { - parts := strings.Split(e.Name, "/") - - var fullpath string - for _, part := range parts { - parent := fullpath - fullpath = path.Join(fullpath, part) - - h.doBuildTree(e, parent, fullpath) - } - - return nil -} - -func (h *buildTreeHelper) doBuildTree(e *index.Entry, parent, fullpath string) { - if _, ok := h.trees[fullpath]; ok { - return - } - - if _, ok := h.entries[fullpath]; ok { - return - } - - te := object.TreeEntry{Name: path.Base(fullpath)} - - if fullpath == e.Name { - te.Mode = e.Mode - te.Hash = e.Hash - } else { - te.Mode = filemode.Dir - h.trees[fullpath] = &object.Tree{} - } - - h.trees[parent].Entries = append(h.trees[parent].Entries, te) -} - -type sortableEntries []object.TreeEntry - -func (sortableEntries) sortName(te object.TreeEntry) string { - if te.Mode == filemode.Dir { - return te.Name + "/" - } - return te.Name -} -func (se sortableEntries) Len() int { return len(se) } -func (se sortableEntries) Less(i int, j int) bool { return se.sortName(se[i]) < se.sortName(se[j]) } -func (se sortableEntries) Swap(i int, j int) { se[i], se[j] = se[j], se[i] } - -func (h *buildTreeHelper) copyTreeToStorageRecursive(parent string, t *object.Tree) (plumbing.Hash, error) { - sort.Sort(sortableEntries(t.Entries)) - for i, e := range t.Entries { - if e.Mode != filemode.Dir && !e.Hash.IsZero() { - continue - } - - path := path.Join(parent, e.Name) - - var err error - e.Hash, err = h.copyTreeToStorageRecursive(path, h.trees[path]) - if err != nil { - return plumbing.ZeroHash, err - } - - t.Entries[i] = e - } - - o := h.s.NewEncodedObject() - if err := t.Encode(o); err != nil { - return plumbing.ZeroHash, err - } - - hash := o.Hash() - if h.s.HasEncodedObject(hash) == nil { - return hash, nil - } - return h.s.SetEncodedObject(o) -} \ No newline at end of file diff --git a/vendor/github.com/go-git/go-git/v5/worktree_js.go b/vendor/github.com/go-git/go-git/v5/worktree_js.go deleted file mode 100644 index 7267d055e7..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_js.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build js - -package git - -import ( - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Stat_t); ok { - e.CreatedAt = time.Unix(int64(os.Ctime), int64(os.CtimeNsec)) - e.Dev = uint32(os.Dev) - e.Inode = uint32(os.Ino) - e.GID = os.Gid - e.UID = os.Uid - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_linux.go b/vendor/github.com/go-git/go-git/v5/worktree_linux.go deleted file mode 100644 index 6fcace2f93..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_linux.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build linux - -package git - -import ( - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Stat_t); ok { - e.CreatedAt = time.Unix(os.Ctim.Unix()) - e.Dev = uint32(os.Dev) - e.Inode = uint32(os.Ino) - e.GID = os.Gid - e.UID = os.Uid - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_plan9.go b/vendor/github.com/go-git/go-git/v5/worktree_plan9.go deleted file mode 100644 index 8cedf71a32..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_plan9.go +++ /dev/null @@ -1,31 +0,0 @@ -package git - -import ( - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Dir); ok { - // Plan 9 doesn't have a CreatedAt field. - e.CreatedAt = time.Unix(int64(os.Mtime), 0) - - e.Dev = uint32(os.Dev) - - // Plan 9 has no Inode. - // ext2srv(4) appears to store Inode in Qid.Path. - e.Inode = uint32(os.Qid.Path) - - // Plan 9 has string UID/GID - e.GID = 0 - e.UID = 0 - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - return true -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_status.go b/vendor/github.com/go-git/go-git/v5/worktree_status.go deleted file mode 100644 index 730108754b..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_status.go +++ /dev/null @@ -1,706 +0,0 @@ -package git - -import ( - "bytes" - "errors" - "io" - "os" - "path" - "path/filepath" - "strings" - - "github.com/go-git/go-billy/v5/util" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/filemode" - "github.com/go-git/go-git/v5/plumbing/format/gitignore" - "github.com/go-git/go-git/v5/plumbing/format/index" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/utils/ioutil" - "github.com/go-git/go-git/v5/utils/merkletrie" - "github.com/go-git/go-git/v5/utils/merkletrie/filesystem" - mindex "github.com/go-git/go-git/v5/utils/merkletrie/index" - "github.com/go-git/go-git/v5/utils/merkletrie/noder" -) - -var ( - // ErrDestinationExists in an Move operation means that the target exists on - // the worktree. - ErrDestinationExists = errors.New("destination exists") - // ErrGlobNoMatches in an AddGlob if the glob pattern does not match any - // files in the worktree. - ErrGlobNoMatches = errors.New("glob pattern did not match any files") -) - -// Status returns the working tree status. -func (w *Worktree) Status() (Status, error) { - var hash plumbing.Hash - - ref, err := w.r.Head() - if err != nil && err != plumbing.ErrReferenceNotFound { - return nil, err - } - - if err == nil { - hash = ref.Hash() - } - - return w.status(hash) -} - -func (w *Worktree) status(commit plumbing.Hash) (Status, error) { - s := make(Status) - - left, err := w.diffCommitWithStaging(commit, false) - if err != nil { - return nil, err - } - - for _, ch := range left { - a, err := ch.Action() - if err != nil { - return nil, err - } - - fs := s.File(nameFromAction(&ch)) - fs.Worktree = Unmodified - - switch a { - case merkletrie.Delete: - s.File(ch.From.String()).Staging = Deleted - case merkletrie.Insert: - s.File(ch.To.String()).Staging = Added - case merkletrie.Modify: - s.File(ch.To.String()).Staging = Modified - } - } - - right, err := w.diffStagingWithWorktree(false, true) - if err != nil { - return nil, err - } - - for _, ch := range right { - a, err := ch.Action() - if err != nil { - return nil, err - } - - fs := s.File(nameFromAction(&ch)) - if fs.Staging == Untracked { - fs.Staging = Unmodified - } - - switch a { - case merkletrie.Delete: - fs.Worktree = Deleted - case merkletrie.Insert: - fs.Worktree = Untracked - fs.Staging = Untracked - case merkletrie.Modify: - fs.Worktree = Modified - } - } - - return s, nil -} - -func nameFromAction(ch *merkletrie.Change) string { - name := ch.To.String() - if name == "" { - return ch.From.String() - } - - return name -} - -func (w *Worktree) diffStagingWithWorktree(reverse, excludeIgnoredChanges bool) (merkletrie.Changes, error) { - idx, err := w.r.Storer.Index() - if err != nil { - return nil, err - } - - from := mindex.NewRootNode(idx) - submodules, err := w.getSubmodulesStatus() - if err != nil { - return nil, err - } - - to := filesystem.NewRootNode(w.Filesystem, submodules) - - var c merkletrie.Changes - if reverse { - c, err = merkletrie.DiffTree(to, from, diffTreeIsEquals) - } else { - c, err = merkletrie.DiffTree(from, to, diffTreeIsEquals) - } - - if err != nil { - return nil, err - } - - if excludeIgnoredChanges { - return w.excludeIgnoredChanges(c), nil - } - return c, nil -} - -func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.Changes { - patterns, err := gitignore.ReadPatterns(w.Filesystem, nil) - if err != nil { - return changes - } - - patterns = append(patterns, w.Excludes...) - - if len(patterns) == 0 { - return changes - } - - m := gitignore.NewMatcher(patterns) - - var res merkletrie.Changes - for _, ch := range changes { - var path []string - for _, n := range ch.To { - path = append(path, n.Name()) - } - if len(path) == 0 { - for _, n := range ch.From { - path = append(path, n.Name()) - } - } - if len(path) != 0 { - isDir := (len(ch.To) > 0 && ch.To.IsDir()) || (len(ch.From) > 0 && ch.From.IsDir()) - if m.Match(path, isDir) { - if len(ch.From) == 0 { - continue - } - } - } - res = append(res, ch) - } - return res -} - -func (w *Worktree) getSubmodulesStatus() (map[string]plumbing.Hash, error) { - o := map[string]plumbing.Hash{} - - sub, err := w.Submodules() - if err != nil { - return nil, err - } - - status, err := sub.Status() - if err != nil { - return nil, err - } - - for _, s := range status { - if s.Current.IsZero() { - o[s.Path] = s.Expected - continue - } - - o[s.Path] = s.Current - } - - return o, nil -} - -func (w *Worktree) diffCommitWithStaging(commit plumbing.Hash, reverse bool) (merkletrie.Changes, error) { - var t *object.Tree - if !commit.IsZero() { - c, err := w.r.CommitObject(commit) - if err != nil { - return nil, err - } - - t, err = c.Tree() - if err != nil { - return nil, err - } - } - - return w.diffTreeWithStaging(t, reverse) -} - -func (w *Worktree) diffTreeWithStaging(t *object.Tree, reverse bool) (merkletrie.Changes, error) { - var from noder.Noder - if t != nil { - from = object.NewTreeRootNode(t) - } - - idx, err := w.r.Storer.Index() - if err != nil { - return nil, err - } - - to := mindex.NewRootNode(idx) - - if reverse { - return merkletrie.DiffTree(to, from, diffTreeIsEquals) - } - - return merkletrie.DiffTree(from, to, diffTreeIsEquals) -} - -var emptyNoderHash = make([]byte, 24) - -// diffTreeIsEquals is a implementation of noder.Equals, used to compare -// noder.Noder, it compare the content and the length of the hashes. -// -// Since some of the noder.Noder implementations doesn't compute a hash for -// some directories, if any of the hashes is a 24-byte slice of zero values -// the comparison is not done and the hashes are take as different. -func diffTreeIsEquals(a, b noder.Hasher) bool { - hashA := a.Hash() - hashB := b.Hash() - - if bytes.Equal(hashA, emptyNoderHash) || bytes.Equal(hashB, emptyNoderHash) { - return false - } - - return bytes.Equal(hashA, hashB) -} - -// Add adds the file contents of a file in the worktree to the index. if the -// file is already staged in the index no error is returned. If a file deleted -// from the Workspace is given, the file is removed from the index. If a -// directory given, adds the files and all his sub-directories recursively in -// the worktree to the index. If any of the files is already staged in the index -// no error is returned. When path is a file, the blob.Hash is returned. -func (w *Worktree) Add(path string) (plumbing.Hash, error) { - // TODO(mcuadros): deprecate in favor of AddWithOption in v6. - return w.doAdd(path, make([]gitignore.Pattern, 0)) -} - -func (w *Worktree) doAddDirectory(idx *index.Index, s Status, directory string, ignorePattern []gitignore.Pattern) (added bool, err error) { - if len(ignorePattern) > 0 { - m := gitignore.NewMatcher(ignorePattern) - matchPath := strings.Split(directory, string(os.PathSeparator)) - if m.Match(matchPath, true) { - // ignore - return false, nil - } - } - - directory = filepath.ToSlash(filepath.Clean(directory)) - - for name := range s { - if !isPathInDirectory(name, directory) { - continue - } - - var a bool - a, _, err = w.doAddFile(idx, s, name, ignorePattern) - if err != nil { - return - } - - added = added || a - } - - return -} - -func isPathInDirectory(path, directory string) bool { - return directory == "." || strings.HasPrefix(path, directory+"/") -} - -// AddWithOptions file contents to the index, updates the index using the -// current content found in the working tree, to prepare the content staged for -// the next commit. -// -// It typically adds the current content of existing paths as a whole, but with -// some options it can also be used to add content with only part of the changes -// made to the working tree files applied, or remove paths that do not exist in -// the working tree anymore. -func (w *Worktree) AddWithOptions(opts *AddOptions) error { - if err := opts.Validate(w.r); err != nil { - return err - } - - if opts.All { - _, err := w.doAdd(".", w.Excludes) - return err - } - - if opts.Glob != "" { - return w.AddGlob(opts.Glob) - } - - _, err := w.Add(opts.Path) - return err -} - -func (w *Worktree) doAdd(path string, ignorePattern []gitignore.Pattern) (plumbing.Hash, error) { - s, err := w.Status() - if err != nil { - return plumbing.ZeroHash, err - } - - idx, err := w.r.Storer.Index() - if err != nil { - return plumbing.ZeroHash, err - } - - var h plumbing.Hash - var added bool - - fi, err := w.Filesystem.Lstat(path) - if err != nil || !fi.IsDir() { - added, h, err = w.doAddFile(idx, s, path, ignorePattern) - } else { - added, err = w.doAddDirectory(idx, s, path, ignorePattern) - } - - if err != nil { - return h, err - } - - if !added { - return h, nil - } - - return h, w.r.Storer.SetIndex(idx) -} - -// AddGlob adds all paths, matching pattern, to the index. If pattern matches a -// directory path, all directory contents are added to the index recursively. No -// error is returned if all matching paths are already staged in index. -func (w *Worktree) AddGlob(pattern string) error { - // TODO(mcuadros): deprecate in favor of AddWithOption in v6. - files, err := util.Glob(w.Filesystem, pattern) - if err != nil { - return err - } - - if len(files) == 0 { - return ErrGlobNoMatches - } - - s, err := w.Status() - if err != nil { - return err - } - - idx, err := w.r.Storer.Index() - if err != nil { - return err - } - - var saveIndex bool - for _, file := range files { - fi, err := w.Filesystem.Lstat(file) - if err != nil { - return err - } - - var added bool - if fi.IsDir() { - added, err = w.doAddDirectory(idx, s, file, make([]gitignore.Pattern, 0)) - } else { - added, _, err = w.doAddFile(idx, s, file, make([]gitignore.Pattern, 0)) - } - - if err != nil { - return err - } - - if !saveIndex && added { - saveIndex = true - } - } - - if saveIndex { - return w.r.Storer.SetIndex(idx) - } - - return nil -} - -// doAddFile create a new blob from path and update the index, added is true if -// the file added is different from the index. -func (w *Worktree) doAddFile(idx *index.Index, s Status, path string, ignorePattern []gitignore.Pattern) (added bool, h plumbing.Hash, err error) { - if s.File(path).Worktree == Unmodified { - return false, h, nil - } - if len(ignorePattern) > 0 { - m := gitignore.NewMatcher(ignorePattern) - matchPath := strings.Split(path, string(os.PathSeparator)) - if m.Match(matchPath, true) { - // ignore - return false, h, nil - } - } - - h, err = w.copyFileToStorage(path) - if err != nil { - if os.IsNotExist(err) { - added = true - h, err = w.deleteFromIndex(idx, path) - } - - return - } - - if err := w.addOrUpdateFileToIndex(idx, path, h); err != nil { - return false, h, err - } - - return true, h, err -} - -func (w *Worktree) copyFileToStorage(path string) (hash plumbing.Hash, err error) { - fi, err := w.Filesystem.Lstat(path) - if err != nil { - return plumbing.ZeroHash, err - } - - obj := w.r.Storer.NewEncodedObject() - obj.SetType(plumbing.BlobObject) - obj.SetSize(fi.Size()) - - writer, err := obj.Writer() - if err != nil { - return plumbing.ZeroHash, err - } - - defer ioutil.CheckClose(writer, &err) - - if fi.Mode()&os.ModeSymlink != 0 { - err = w.fillEncodedObjectFromSymlink(writer, path, fi) - } else { - err = w.fillEncodedObjectFromFile(writer, path, fi) - } - - if err != nil { - return plumbing.ZeroHash, err - } - - return w.r.Storer.SetEncodedObject(obj) -} - -func (w *Worktree) fillEncodedObjectFromFile(dst io.Writer, path string, fi os.FileInfo) (err error) { - src, err := w.Filesystem.Open(path) - if err != nil { - return err - } - - defer ioutil.CheckClose(src, &err) - - if _, err := io.Copy(dst, src); err != nil { - return err - } - - return err -} - -func (w *Worktree) fillEncodedObjectFromSymlink(dst io.Writer, path string, fi os.FileInfo) error { - target, err := w.Filesystem.Readlink(path) - if err != nil { - return err - } - - _, err = dst.Write([]byte(target)) - return err -} - -func (w *Worktree) addOrUpdateFileToIndex(idx *index.Index, filename string, h plumbing.Hash) error { - e, err := idx.Entry(filename) - if err != nil && err != index.ErrEntryNotFound { - return err - } - - if err == index.ErrEntryNotFound { - return w.doAddFileToIndex(idx, filename, h) - } - - return w.doUpdateFileToIndex(e, filename, h) -} - -func (w *Worktree) doAddFileToIndex(idx *index.Index, filename string, h plumbing.Hash) error { - return w.doUpdateFileToIndex(idx.Add(filename), filename, h) -} - -func (w *Worktree) doUpdateFileToIndex(e *index.Entry, filename string, h plumbing.Hash) error { - info, err := w.Filesystem.Lstat(filename) - if err != nil { - return err - } - - e.Hash = h - e.ModifiedAt = info.ModTime() - e.Mode, err = filemode.NewFromOSFileMode(info.Mode()) - if err != nil { - return err - } - - if e.Mode.IsRegular() { - e.Size = uint32(info.Size()) - } - - fillSystemInfo(e, info.Sys()) - return nil -} - -// Remove removes files from the working tree and from the index. -func (w *Worktree) Remove(path string) (plumbing.Hash, error) { - // TODO(mcuadros): remove plumbing.Hash from signature at v5. - idx, err := w.r.Storer.Index() - if err != nil { - return plumbing.ZeroHash, err - } - - var h plumbing.Hash - - fi, err := w.Filesystem.Lstat(path) - if err != nil || !fi.IsDir() { - h, err = w.doRemoveFile(idx, path) - } else { - _, err = w.doRemoveDirectory(idx, path) - } - if err != nil { - return h, err - } - - return h, w.r.Storer.SetIndex(idx) -} - -func (w *Worktree) doRemoveDirectory(idx *index.Index, directory string) (removed bool, err error) { - files, err := w.Filesystem.ReadDir(directory) - if err != nil { - return false, err - } - - for _, file := range files { - name := path.Join(directory, file.Name()) - - var r bool - if file.IsDir() { - r, err = w.doRemoveDirectory(idx, name) - } else { - _, err = w.doRemoveFile(idx, name) - if err == index.ErrEntryNotFound { - err = nil - } - } - - if err != nil { - return - } - - if !removed && r { - removed = true - } - } - - err = w.removeEmptyDirectory(directory) - return -} - -func (w *Worktree) removeEmptyDirectory(path string) error { - files, err := w.Filesystem.ReadDir(path) - if err != nil { - return err - } - - if len(files) != 0 { - return nil - } - - return w.Filesystem.Remove(path) -} - -func (w *Worktree) doRemoveFile(idx *index.Index, path string) (plumbing.Hash, error) { - hash, err := w.deleteFromIndex(idx, path) - if err != nil { - return plumbing.ZeroHash, err - } - - return hash, w.deleteFromFilesystem(path) -} - -func (w *Worktree) deleteFromIndex(idx *index.Index, path string) (plumbing.Hash, error) { - e, err := idx.Remove(path) - if err != nil { - return plumbing.ZeroHash, err - } - - return e.Hash, nil -} - -func (w *Worktree) deleteFromFilesystem(path string) error { - err := w.Filesystem.Remove(path) - if os.IsNotExist(err) { - return nil - } - - return err -} - -// RemoveGlob removes all paths, matching pattern, from the index. If pattern -// matches a directory path, all directory contents are removed from the index -// recursively. -func (w *Worktree) RemoveGlob(pattern string) error { - idx, err := w.r.Storer.Index() - if err != nil { - return err - } - - entries, err := idx.Glob(pattern) - if err != nil { - return err - } - - for _, e := range entries { - file := filepath.FromSlash(e.Name) - if _, err := w.Filesystem.Lstat(file); err != nil && !os.IsNotExist(err) { - return err - } - - if _, err := w.doRemoveFile(idx, file); err != nil { - return err - } - - dir, _ := filepath.Split(file) - if err := w.removeEmptyDirectory(dir); err != nil { - return err - } - } - - return w.r.Storer.SetIndex(idx) -} - -// Move moves or rename a file in the worktree and the index, directories are -// not supported. -func (w *Worktree) Move(from, to string) (plumbing.Hash, error) { - // TODO(mcuadros): support directories and/or implement support for glob - if _, err := w.Filesystem.Lstat(from); err != nil { - return plumbing.ZeroHash, err - } - - if _, err := w.Filesystem.Lstat(to); err == nil { - return plumbing.ZeroHash, ErrDestinationExists - } - - idx, err := w.r.Storer.Index() - if err != nil { - return plumbing.ZeroHash, err - } - - hash, err := w.deleteFromIndex(idx, from) - if err != nil { - return plumbing.ZeroHash, err - } - - if err := w.Filesystem.Rename(from, to); err != nil { - return hash, err - } - - if err := w.addOrUpdateFileToIndex(idx, to, hash); err != nil { - return hash, err - } - - return hash, w.r.Storer.SetIndex(idx) -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go b/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go deleted file mode 100644 index 5b16e70b70..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_unix_other.go +++ /dev/null @@ -1,26 +0,0 @@ -// +build openbsd dragonfly solaris - -package git - -import ( - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Stat_t); ok { - e.CreatedAt = time.Unix(os.Atim.Unix()) - e.Dev = uint32(os.Dev) - e.Inode = uint32(os.Ino) - e.GID = os.Gid - e.UID = os.Uid - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - return false -} diff --git a/vendor/github.com/go-git/go-git/v5/worktree_windows.go b/vendor/github.com/go-git/go-git/v5/worktree_windows.go deleted file mode 100644 index 1928f9712e..0000000000 --- a/vendor/github.com/go-git/go-git/v5/worktree_windows.go +++ /dev/null @@ -1,35 +0,0 @@ -// +build windows - -package git - -import ( - "os" - "syscall" - "time" - - "github.com/go-git/go-git/v5/plumbing/format/index" -) - -func init() { - fillSystemInfo = func(e *index.Entry, sys interface{}) { - if os, ok := sys.(*syscall.Win32FileAttributeData); ok { - seconds := os.CreationTime.Nanoseconds() / 1000000000 - nanoseconds := os.CreationTime.Nanoseconds() - seconds*1000000000 - e.CreatedAt = time.Unix(seconds, nanoseconds) - } - } -} - -func isSymlinkWindowsNonAdmin(err error) bool { - const ERROR_PRIVILEGE_NOT_HELD syscall.Errno = 1314 - - if err != nil { - if errLink, ok := err.(*os.LinkError); ok { - if errNo, ok := errLink.Err.(syscall.Errno); ok { - return errNo == ERROR_PRIVILEGE_NOT_HELD - } - } - } - - return false -} diff --git a/vendor/github.com/go-logr/logr/.golangci.yaml b/vendor/github.com/go-logr/logr/.golangci.yaml deleted file mode 100644 index 0cffafa7bf..0000000000 --- a/vendor/github.com/go-logr/logr/.golangci.yaml +++ /dev/null @@ -1,26 +0,0 @@ -run: - timeout: 1m - tests: true - -linters: - disable-all: true - enable: - - asciicheck - - errcheck - - forcetypeassert - - gocritic - - gofmt - - goimports - - gosimple - - govet - - ineffassign - - misspell - - revive - - staticcheck - - typecheck - - unused - -issues: - exclude-use-default: false - max-issues-per-linter: 0 - max-same-issues: 10 diff --git a/vendor/github.com/go-logr/logr/CHANGELOG.md b/vendor/github.com/go-logr/logr/CHANGELOG.md deleted file mode 100644 index c356960046..0000000000 --- a/vendor/github.com/go-logr/logr/CHANGELOG.md +++ /dev/null @@ -1,6 +0,0 @@ -# CHANGELOG - -## v1.0.0-rc1 - -This is the first logged release. Major changes (including breaking changes) -have occurred since earlier tags. diff --git a/vendor/github.com/go-logr/logr/CONTRIBUTING.md b/vendor/github.com/go-logr/logr/CONTRIBUTING.md deleted file mode 100644 index 5d37e294c5..0000000000 --- a/vendor/github.com/go-logr/logr/CONTRIBUTING.md +++ /dev/null @@ -1,17 +0,0 @@ -# Contributing - -Logr is open to pull-requests, provided they fit within the intended scope of -the project. Specifically, this library aims to be VERY small and minimalist, -with no external dependencies. - -## Compatibility - -This project intends to follow [semantic versioning](http://semver.org) and -is very strict about compatibility. Any proposed changes MUST follow those -rules. - -## Performance - -As a logging library, logr must be as light-weight as possible. Any proposed -code change must include results of running the [benchmark](./benchmark) -before and after the change. diff --git a/vendor/github.com/go-logr/logr/LICENSE b/vendor/github.com/go-logr/logr/LICENSE deleted file mode 100644 index 8dada3edaf..0000000000 --- a/vendor/github.com/go-logr/logr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-logr/logr/README.md b/vendor/github.com/go-logr/logr/README.md deleted file mode 100644 index 8969526a6e..0000000000 --- a/vendor/github.com/go-logr/logr/README.md +++ /dev/null @@ -1,406 +0,0 @@ -# A minimal logging API for Go - -[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/logr.svg)](https://pkg.go.dev/github.com/go-logr/logr) -[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-logr/logr/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org=go-logr&repo=logr) - -logr offers an(other) opinion on how Go programs and libraries can do logging -without becoming coupled to a particular logging implementation. This is not -an implementation of logging - it is an API. In fact it is two APIs with two -different sets of users. - -The `Logger` type is intended for application and library authors. It provides -a relatively small API which can be used everywhere you want to emit logs. It -defers the actual act of writing logs (to files, to stdout, or whatever) to the -`LogSink` interface. - -The `LogSink` interface is intended for logging library implementers. It is a -pure interface which can be implemented by logging frameworks to provide the actual logging -functionality. - -This decoupling allows application and library developers to write code in -terms of `logr.Logger` (which has very low dependency fan-out) while the -implementation of logging is managed "up stack" (e.g. in or near `main()`.) -Application developers can then switch out implementations as necessary. - -Many people assert that libraries should not be logging, and as such efforts -like this are pointless. Those people are welcome to convince the authors of -the tens-of-thousands of libraries that *DO* write logs that they are all -wrong. In the meantime, logr takes a more practical approach. - -## Typical usage - -Somewhere, early in an application's life, it will make a decision about which -logging library (implementation) it actually wants to use. Something like: - -``` - func main() { - // ... other setup code ... - - // Create the "root" logger. We have chosen the "logimpl" implementation, - // which takes some initial parameters and returns a logr.Logger. - logger := logimpl.New(param1, param2) - - // ... other setup code ... -``` - -Most apps will call into other libraries, create structures to govern the flow, -etc. The `logr.Logger` object can be passed to these other libraries, stored -in structs, or even used as a package-global variable, if needed. For example: - -``` - app := createTheAppObject(logger) - app.Run() -``` - -Outside of this early setup, no other packages need to know about the choice of -implementation. They write logs in terms of the `logr.Logger` that they -received: - -``` - type appObject struct { - // ... other fields ... - logger logr.Logger - // ... other fields ... - } - - func (app *appObject) Run() { - app.logger.Info("starting up", "timestamp", time.Now()) - - // ... app code ... -``` - -## Background - -If the Go standard library had defined an interface for logging, this project -probably would not be needed. Alas, here we are. - -When the Go developers started developing such an interface with -[slog](https://github.com/golang/go/issues/56345), they adopted some of the -logr design but also left out some parts and changed others: - -| Feature | logr | slog | -|---------|------|------| -| High-level API | `Logger` (passed by value) | `Logger` (passed by [pointer](https://github.com/golang/go/issues/59126)) | -| Low-level API | `LogSink` | `Handler` | -| Stack unwinding | done by `LogSink` | done by `Logger` | -| Skipping helper functions | `WithCallDepth`, `WithCallStackHelper` | [not supported by Logger](https://github.com/golang/go/issues/59145) | -| Generating a value for logging on demand | `Marshaler` | `LogValuer` | -| Log levels | >= 0, higher meaning "less important" | positive and negative, with 0 for "info" and higher meaning "more important" | -| Error log entries | always logged, don't have a verbosity level | normal log entries with level >= `LevelError` | -| Passing logger via context | `NewContext`, `FromContext` | no API | -| Adding a name to a logger | `WithName` | no API | -| Modify verbosity of log entries in a call chain | `V` | no API | -| Grouping of key/value pairs | not supported | `WithGroup`, `GroupValue` | -| Pass context for extracting additional values | no API | API variants like `InfoCtx` | - -The high-level slog API is explicitly meant to be one of many different APIs -that can be layered on top of a shared `slog.Handler`. logr is one such -alternative API, with [interoperability](#slog-interoperability) provided by -some conversion functions. - -### Inspiration - -Before you consider this package, please read [this blog post by the -inimitable Dave Cheney][warning-makes-no-sense]. We really appreciate what -he has to say, and it largely aligns with our own experiences. - -### Differences from Dave's ideas - -The main differences are: - -1. Dave basically proposes doing away with the notion of a logging API in favor -of `fmt.Printf()`. We disagree, especially when you consider things like output -locations, timestamps, file and line decorations, and structured logging. This -package restricts the logging API to just 2 types of logs: info and error. - -Info logs are things you want to tell the user which are not errors. Error -logs are, well, errors. If your code receives an `error` from a subordinate -function call and is logging that `error` *and not returning it*, use error -logs. - -2. Verbosity-levels on info logs. This gives developers a chance to indicate -arbitrary grades of importance for info logs, without assigning names with -semantic meaning such as "warning", "trace", and "debug." Superficially this -may feel very similar, but the primary difference is the lack of semantics. -Because verbosity is a numerical value, it's safe to assume that an app running -with higher verbosity means more (and less important) logs will be generated. - -## Implementations (non-exhaustive) - -There are implementations for the following logging libraries: - -- **a function** (can bridge to non-structured libraries): [funcr](https://github.com/go-logr/logr/tree/master/funcr) -- **a testing.T** (for use in Go tests, with JSON-like output): [testr](https://github.com/go-logr/logr/tree/master/testr) -- **github.com/google/glog**: [glogr](https://github.com/go-logr/glogr) -- **k8s.io/klog** (for Kubernetes): [klogr](https://git.k8s.io/klog/klogr) -- **a testing.T** (with klog-like text output): [ktesting](https://git.k8s.io/klog/ktesting) -- **go.uber.org/zap**: [zapr](https://github.com/go-logr/zapr) -- **log** (the Go standard library logger): [stdr](https://github.com/go-logr/stdr) -- **github.com/sirupsen/logrus**: [logrusr](https://github.com/bombsimon/logrusr) -- **github.com/wojas/genericr**: [genericr](https://github.com/wojas/genericr) (makes it easy to implement your own backend) -- **logfmt** (Heroku style [logging](https://www.brandur.org/logfmt)): [logfmtr](https://github.com/iand/logfmtr) -- **github.com/rs/zerolog**: [zerologr](https://github.com/go-logr/zerologr) -- **github.com/go-kit/log**: [gokitlogr](https://github.com/tonglil/gokitlogr) (also compatible with github.com/go-kit/kit/log since v0.12.0) -- **bytes.Buffer** (writing to a buffer): [bufrlogr](https://github.com/tonglil/buflogr) (useful for ensuring values were logged, like during testing) - -## slog interoperability - -Interoperability goes both ways, using the `logr.Logger` API with a `slog.Handler` -and using the `slog.Logger` API with a `logr.LogSink`. `FromSlogHandler` and -`ToSlogHandler` convert between a `logr.Logger` and a `slog.Handler`. -As usual, `slog.New` can be used to wrap such a `slog.Handler` in the high-level -slog API. - -### Using a `logr.LogSink` as backend for slog - -Ideally, a logr sink implementation should support both logr and slog by -implementing both the normal logr interface(s) and `SlogSink`. Because -of a conflict in the parameters of the common `Enabled` method, it is [not -possible to implement both slog.Handler and logr.Sink in the same -type](https://github.com/golang/go/issues/59110). - -If both are supported, log calls can go from the high-level APIs to the backend -without the need to convert parameters. `FromSlogHandler` and `ToSlogHandler` can -convert back and forth without adding additional wrappers, with one exception: -when `Logger.V` was used to adjust the verbosity for a `slog.Handler`, then -`ToSlogHandler` has to use a wrapper which adjusts the verbosity for future -log calls. - -Such an implementation should also support values that implement specific -interfaces from both packages for logging (`logr.Marshaler`, `slog.LogValuer`, -`slog.GroupValue`). logr does not convert those. - -Not supporting slog has several drawbacks: -- Recording source code locations works correctly if the handler gets called - through `slog.Logger`, but may be wrong in other cases. That's because a - `logr.Sink` does its own stack unwinding instead of using the program counter - provided by the high-level API. -- slog levels <= 0 can be mapped to logr levels by negating the level without a - loss of information. But all slog levels > 0 (e.g. `slog.LevelWarning` as - used by `slog.Logger.Warn`) must be mapped to 0 before calling the sink - because logr does not support "more important than info" levels. -- The slog group concept is supported by prefixing each key in a key/value - pair with the group names, separated by a dot. For structured output like - JSON it would be better to group the key/value pairs inside an object. -- Special slog values and interfaces don't work as expected. -- The overhead is likely to be higher. - -These drawbacks are severe enough that applications using a mixture of slog and -logr should switch to a different backend. - -### Using a `slog.Handler` as backend for logr - -Using a plain `slog.Handler` without support for logr works better than the -other direction: -- All logr verbosity levels can be mapped 1:1 to their corresponding slog level - by negating them. -- Stack unwinding is done by the `SlogSink` and the resulting program - counter is passed to the `slog.Handler`. -- Names added via `Logger.WithName` are gathered and recorded in an additional - attribute with `logger` as key and the names separated by slash as value. -- `Logger.Error` is turned into a log record with `slog.LevelError` as level - and an additional attribute with `err` as key, if an error was provided. - -The main drawback is that `logr.Marshaler` will not be supported. Types should -ideally support both `logr.Marshaler` and `slog.Valuer`. If compatibility -with logr implementations without slog support is not important, then -`slog.Valuer` is sufficient. - -### Context support for slog - -Storing a logger in a `context.Context` is not supported by -slog. `NewContextWithSlogLogger` and `FromContextAsSlogLogger` can be -used to fill this gap. They store and retrieve a `slog.Logger` pointer -under the same context key that is also used by `NewContext` and -`FromContext` for `logr.Logger` value. - -When `NewContextWithSlogLogger` is followed by `FromContext`, the latter will -automatically convert the `slog.Logger` to a -`logr.Logger`. `FromContextAsSlogLogger` does the same for the other direction. - -With this approach, binaries which use either slog or logr are as efficient as -possible with no unnecessary allocations. This is also why the API stores a -`slog.Logger` pointer: when storing a `slog.Handler`, creating a `slog.Logger` -on retrieval would need to allocate one. - -The downside is that switching back and forth needs more allocations. Because -logr is the API that is already in use by different packages, in particular -Kubernetes, the recommendation is to use the `logr.Logger` API in code which -uses contextual logging. - -An alternative to adding values to a logger and storing that logger in the -context is to store the values in the context and to configure a logging -backend to extract those values when emitting log entries. This only works when -log calls are passed the context, which is not supported by the logr API. - -With the slog API, it is possible, but not -required. https://github.com/veqryn/slog-context is a package for slog which -provides additional support code for this approach. It also contains wrappers -for the context functions in logr, so developers who prefer to not use the logr -APIs directly can use those instead and the resulting code will still be -interoperable with logr. - -## FAQ - -### Conceptual - -#### Why structured logging? - -- **Structured logs are more easily queryable**: Since you've got - key-value pairs, it's much easier to query your structured logs for - particular values by filtering on the contents of a particular key -- - think searching request logs for error codes, Kubernetes reconcilers for - the name and namespace of the reconciled object, etc. - -- **Structured logging makes it easier to have cross-referenceable logs**: - Similarly to searchability, if you maintain conventions around your - keys, it becomes easy to gather all log lines related to a particular - concept. - -- **Structured logs allow better dimensions of filtering**: if you have - structure to your logs, you've got more precise control over how much - information is logged -- you might choose in a particular configuration - to log certain keys but not others, only log lines where a certain key - matches a certain value, etc., instead of just having v-levels and names - to key off of. - -- **Structured logs better represent structured data**: sometimes, the - data that you want to log is inherently structured (think tuple-link - objects.) Structured logs allow you to preserve that structure when - outputting. - -#### Why V-levels? - -**V-levels give operators an easy way to control the chattiness of log -operations**. V-levels provide a way for a given package to distinguish -the relative importance or verbosity of a given log message. Then, if -a particular logger or package is logging too many messages, the user -of the package can simply change the v-levels for that library. - -#### Why not named levels, like Info/Warning/Error? - -Read [Dave Cheney's post][warning-makes-no-sense]. Then read [Differences -from Dave's ideas](#differences-from-daves-ideas). - -#### Why not allow format strings, too? - -**Format strings negate many of the benefits of structured logs**: - -- They're not easily searchable without resorting to fuzzy searching, - regular expressions, etc. - -- They don't store structured data well, since contents are flattened into - a string. - -- They're not cross-referenceable. - -- They don't compress easily, since the message is not constant. - -(Unless you turn positional parameters into key-value pairs with numerical -keys, at which point you've gotten key-value logging with meaningless -keys.) - -### Practical - -#### Why key-value pairs, and not a map? - -Key-value pairs are *much* easier to optimize, especially around -allocations. Zap (a structured logger that inspired logr's interface) has -[performance measurements](https://github.com/uber-go/zap#performance) -that show this quite nicely. - -While the interface ends up being a little less obvious, you get -potentially better performance, plus avoid making users type -`map[string]string{}` every time they want to log. - -#### What if my V-levels differ between libraries? - -That's fine. Control your V-levels on a per-logger basis, and use the -`WithName` method to pass different loggers to different libraries. - -Generally, you should take care to ensure that you have relatively -consistent V-levels within a given logger, however, as this makes deciding -on what verbosity of logs to request easier. - -#### But I really want to use a format string! - -That's not actually a question. Assuming your question is "how do -I convert my mental model of logging with format strings to logging with -constant messages": - -1. Figure out what the error actually is, as you'd write in a TL;DR style, - and use that as a message. - -2. For every place you'd write a format specifier, look to the word before - it, and add that as a key value pair. - -For instance, consider the following examples (all taken from spots in the -Kubernetes codebase): - -- `klog.V(4).Infof("Client is returning errors: code %v, error %v", - responseCode, err)` becomes `logger.Error(err, "client returned an - error", "code", responseCode)` - -- `klog.V(4).Infof("Got a Retry-After %ds response for attempt %d to %v", - seconds, retries, url)` becomes `logger.V(4).Info("got a retry-after - response when requesting url", "attempt", retries, "after - seconds", seconds, "url", url)` - -If you *really* must use a format string, use it in a key's value, and -call `fmt.Sprintf` yourself. For instance: `log.Printf("unable to -reflect over type %T")` becomes `logger.Info("unable to reflect over -type", "type", fmt.Sprintf("%T"))`. In general though, the cases where -this is necessary should be few and far between. - -#### How do I choose my V-levels? - -This is basically the only hard constraint: increase V-levels to denote -more verbose or more debug-y logs. - -Otherwise, you can start out with `0` as "you always want to see this", -`1` as "common logging that you might *possibly* want to turn off", and -`10` as "I would like to performance-test your log collection stack." - -Then gradually choose levels in between as you need them, working your way -down from 10 (for debug and trace style logs) and up from 1 (for chattier -info-type logs). For reference, slog pre-defines -4 for debug logs -(corresponds to 4 in logr), which matches what is -[recommended for Kubernetes](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md#what-method-to-use). - -#### How do I choose my keys? - -Keys are fairly flexible, and can hold more or less any string -value. For best compatibility with implementations and consistency -with existing code in other projects, there are a few conventions you -should consider. - -- Make your keys human-readable. -- Constant keys are generally a good idea. -- Be consistent across your codebase. -- Keys should naturally match parts of the message string. -- Use lower case for simple keys and - [lowerCamelCase](https://en.wiktionary.org/wiki/lowerCamelCase) for - more complex ones. Kubernetes is one example of a project that has - [adopted that - convention](https://github.com/kubernetes/community/blob/HEAD/contributors/devel/sig-instrumentation/migration-to-structured-logging.md#name-arguments). - -While key names are mostly unrestricted (and spaces are acceptable), -it's generally a good idea to stick to printable ascii characters, or at -least match the general character set of your log lines. - -#### Why should keys be constant values? - -The point of structured logging is to make later log processing easier. Your -keys are, effectively, the schema of each log message. If you use different -keys across instances of the same log line, you will make your structured logs -much harder to use. `Sprintf()` is for values, not for keys! - -#### Why is this not a pure interface? - -The Logger type is implemented as a struct in order to allow the Go compiler to -optimize things like high-V `Info` logs that are not triggered. Not all of -these implementations are implemented yet, but this structure was suggested as -a way to ensure they *can* be implemented. All of the real work is behind the -`LogSink` interface. - -[warning-makes-no-sense]: http://dave.cheney.net/2015/11/05/lets-talk-about-logging diff --git a/vendor/github.com/go-logr/logr/SECURITY.md b/vendor/github.com/go-logr/logr/SECURITY.md deleted file mode 100644 index 1ca756fc7b..0000000000 --- a/vendor/github.com/go-logr/logr/SECURITY.md +++ /dev/null @@ -1,18 +0,0 @@ -# Security Policy - -If you have discovered a security vulnerability in this project, please report it -privately. **Do not disclose it as a public issue.** This gives us time to work with you -to fix the issue before public exposure, reducing the chance that the exploit will be -used before a patch is released. - -You may submit the report in the following ways: - -- send an email to go-logr-security@googlegroups.com -- send us a [private vulnerability report](https://github.com/go-logr/logr/security/advisories/new) - -Please provide the following information in your report: - -- A description of the vulnerability and its impact -- How to reproduce the issue - -We ask that you give us 90 days to work on a fix before public exposure. diff --git a/vendor/github.com/go-logr/logr/context.go b/vendor/github.com/go-logr/logr/context.go deleted file mode 100644 index de8bcc3ad8..0000000000 --- a/vendor/github.com/go-logr/logr/context.go +++ /dev/null @@ -1,33 +0,0 @@ -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -// contextKey is how we find Loggers in a context.Context. With Go < 1.21, -// the value is always a Logger value. With Go >= 1.21, the value can be a -// Logger value or a slog.Logger pointer. -type contextKey struct{} - -// notFoundError exists to carry an IsNotFound method. -type notFoundError struct{} - -func (notFoundError) Error() string { - return "no logr.Logger was present" -} - -func (notFoundError) IsNotFound() bool { - return true -} diff --git a/vendor/github.com/go-logr/logr/context_noslog.go b/vendor/github.com/go-logr/logr/context_noslog.go deleted file mode 100644 index f012f9a18e..0000000000 --- a/vendor/github.com/go-logr/logr/context_noslog.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build !go1.21 -// +build !go1.21 - -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -import ( - "context" -) - -// FromContext returns a Logger from ctx or an error if no Logger is found. -func FromContext(ctx context.Context) (Logger, error) { - if v, ok := ctx.Value(contextKey{}).(Logger); ok { - return v, nil - } - - return Logger{}, notFoundError{} -} - -// FromContextOrDiscard returns a Logger from ctx. If no Logger is found, this -// returns a Logger that discards all log messages. -func FromContextOrDiscard(ctx context.Context) Logger { - if v, ok := ctx.Value(contextKey{}).(Logger); ok { - return v - } - - return Discard() -} - -// NewContext returns a new Context, derived from ctx, which carries the -// provided Logger. -func NewContext(ctx context.Context, logger Logger) context.Context { - return context.WithValue(ctx, contextKey{}, logger) -} diff --git a/vendor/github.com/go-logr/logr/context_slog.go b/vendor/github.com/go-logr/logr/context_slog.go deleted file mode 100644 index 065ef0b828..0000000000 --- a/vendor/github.com/go-logr/logr/context_slog.go +++ /dev/null @@ -1,83 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -import ( - "context" - "fmt" - "log/slog" -) - -// FromContext returns a Logger from ctx or an error if no Logger is found. -func FromContext(ctx context.Context) (Logger, error) { - v := ctx.Value(contextKey{}) - if v == nil { - return Logger{}, notFoundError{} - } - - switch v := v.(type) { - case Logger: - return v, nil - case *slog.Logger: - return FromSlogHandler(v.Handler()), nil - default: - // Not reached. - panic(fmt.Sprintf("unexpected value type for logr context key: %T", v)) - } -} - -// FromContextAsSlogLogger returns a slog.Logger from ctx or nil if no such Logger is found. -func FromContextAsSlogLogger(ctx context.Context) *slog.Logger { - v := ctx.Value(contextKey{}) - if v == nil { - return nil - } - - switch v := v.(type) { - case Logger: - return slog.New(ToSlogHandler(v)) - case *slog.Logger: - return v - default: - // Not reached. - panic(fmt.Sprintf("unexpected value type for logr context key: %T", v)) - } -} - -// FromContextOrDiscard returns a Logger from ctx. If no Logger is found, this -// returns a Logger that discards all log messages. -func FromContextOrDiscard(ctx context.Context) Logger { - if logger, err := FromContext(ctx); err == nil { - return logger - } - return Discard() -} - -// NewContext returns a new Context, derived from ctx, which carries the -// provided Logger. -func NewContext(ctx context.Context, logger Logger) context.Context { - return context.WithValue(ctx, contextKey{}, logger) -} - -// NewContextWithSlogLogger returns a new Context, derived from ctx, which carries the -// provided slog.Logger. -func NewContextWithSlogLogger(ctx context.Context, logger *slog.Logger) context.Context { - return context.WithValue(ctx, contextKey{}, logger) -} diff --git a/vendor/github.com/go-logr/logr/discard.go b/vendor/github.com/go-logr/logr/discard.go deleted file mode 100644 index 99fe8be93c..0000000000 --- a/vendor/github.com/go-logr/logr/discard.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2020 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -// Discard returns a Logger that discards all messages logged to it. It can be -// used whenever the caller is not interested in the logs. Logger instances -// produced by this function always compare as equal. -func Discard() Logger { - return New(nil) -} diff --git a/vendor/github.com/go-logr/logr/funcr/funcr.go b/vendor/github.com/go-logr/logr/funcr/funcr.go deleted file mode 100644 index fb2f866f4b..0000000000 --- a/vendor/github.com/go-logr/logr/funcr/funcr.go +++ /dev/null @@ -1,911 +0,0 @@ -/* -Copyright 2021 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package funcr implements formatting of structured log messages and -// optionally captures the call site and timestamp. -// -// The simplest way to use it is via its implementation of a -// github.com/go-logr/logr.LogSink with output through an arbitrary -// "write" function. See New and NewJSON for details. -// -// # Custom LogSinks -// -// For users who need more control, a funcr.Formatter can be embedded inside -// your own custom LogSink implementation. This is useful when the LogSink -// needs to implement additional methods, for example. -// -// # Formatting -// -// This will respect logr.Marshaler, fmt.Stringer, and error interfaces for -// values which are being logged. When rendering a struct, funcr will use Go's -// standard JSON tags (all except "string"). -package funcr - -import ( - "bytes" - "encoding" - "encoding/json" - "fmt" - "path/filepath" - "reflect" - "runtime" - "strconv" - "strings" - "time" - - "github.com/go-logr/logr" -) - -// New returns a logr.Logger which is implemented by an arbitrary function. -func New(fn func(prefix, args string), opts Options) logr.Logger { - return logr.New(newSink(fn, NewFormatter(opts))) -} - -// NewJSON returns a logr.Logger which is implemented by an arbitrary function -// and produces JSON output. -func NewJSON(fn func(obj string), opts Options) logr.Logger { - fnWrapper := func(_, obj string) { - fn(obj) - } - return logr.New(newSink(fnWrapper, NewFormatterJSON(opts))) -} - -// Underlier exposes access to the underlying logging function. Since -// callers only have a logr.Logger, they have to know which -// implementation is in use, so this interface is less of an -// abstraction and more of a way to test type conversion. -type Underlier interface { - GetUnderlying() func(prefix, args string) -} - -func newSink(fn func(prefix, args string), formatter Formatter) logr.LogSink { - l := &fnlogger{ - Formatter: formatter, - write: fn, - } - // For skipping fnlogger.Info and fnlogger.Error. - l.Formatter.AddCallDepth(1) - return l -} - -// Options carries parameters which influence the way logs are generated. -type Options struct { - // LogCaller tells funcr to add a "caller" key to some or all log lines. - // This has some overhead, so some users might not want it. - LogCaller MessageClass - - // LogCallerFunc tells funcr to also log the calling function name. This - // has no effect if caller logging is not enabled (see Options.LogCaller). - LogCallerFunc bool - - // LogTimestamp tells funcr to add a "ts" key to log lines. This has some - // overhead, so some users might not want it. - LogTimestamp bool - - // TimestampFormat tells funcr how to render timestamps when LogTimestamp - // is enabled. If not specified, a default format will be used. For more - // details, see docs for Go's time.Layout. - TimestampFormat string - - // LogInfoLevel tells funcr what key to use to log the info level. - // If not specified, the info level will be logged as "level". - // If this is set to "", the info level will not be logged at all. - LogInfoLevel *string - - // Verbosity tells funcr which V logs to produce. Higher values enable - // more logs. Info logs at or below this level will be written, while logs - // above this level will be discarded. - Verbosity int - - // RenderBuiltinsHook allows users to mutate the list of key-value pairs - // while a log line is being rendered. The kvList argument follows logr - // conventions - each pair of slice elements is comprised of a string key - // and an arbitrary value (verified and sanitized before calling this - // hook). The value returned must follow the same conventions. This hook - // can be used to audit or modify logged data. For example, you might want - // to prefix all of funcr's built-in keys with some string. This hook is - // only called for built-in (provided by funcr itself) key-value pairs. - // Equivalent hooks are offered for key-value pairs saved via - // logr.Logger.WithValues or Formatter.AddValues (see RenderValuesHook) and - // for user-provided pairs (see RenderArgsHook). - RenderBuiltinsHook func(kvList []any) []any - - // RenderValuesHook is the same as RenderBuiltinsHook, except that it is - // only called for key-value pairs saved via logr.Logger.WithValues. See - // RenderBuiltinsHook for more details. - RenderValuesHook func(kvList []any) []any - - // RenderArgsHook is the same as RenderBuiltinsHook, except that it is only - // called for key-value pairs passed directly to Info and Error. See - // RenderBuiltinsHook for more details. - RenderArgsHook func(kvList []any) []any - - // MaxLogDepth tells funcr how many levels of nested fields (e.g. a struct - // that contains a struct, etc.) it may log. Every time it finds a struct, - // slice, array, or map the depth is increased by one. When the maximum is - // reached, the value will be converted to a string indicating that the max - // depth has been exceeded. If this field is not specified, a default - // value will be used. - MaxLogDepth int -} - -// MessageClass indicates which category or categories of messages to consider. -type MessageClass int - -const ( - // None ignores all message classes. - None MessageClass = iota - // All considers all message classes. - All - // Info only considers info messages. - Info - // Error only considers error messages. - Error -) - -// fnlogger inherits some of its LogSink implementation from Formatter -// and just needs to add some glue code. -type fnlogger struct { - Formatter - write func(prefix, args string) -} - -func (l fnlogger) WithName(name string) logr.LogSink { - l.Formatter.AddName(name) - return &l -} - -func (l fnlogger) WithValues(kvList ...any) logr.LogSink { - l.Formatter.AddValues(kvList) - return &l -} - -func (l fnlogger) WithCallDepth(depth int) logr.LogSink { - l.Formatter.AddCallDepth(depth) - return &l -} - -func (l fnlogger) Info(level int, msg string, kvList ...any) { - prefix, args := l.FormatInfo(level, msg, kvList) - l.write(prefix, args) -} - -func (l fnlogger) Error(err error, msg string, kvList ...any) { - prefix, args := l.FormatError(err, msg, kvList) - l.write(prefix, args) -} - -func (l fnlogger) GetUnderlying() func(prefix, args string) { - return l.write -} - -// Assert conformance to the interfaces. -var _ logr.LogSink = &fnlogger{} -var _ logr.CallDepthLogSink = &fnlogger{} -var _ Underlier = &fnlogger{} - -// NewFormatter constructs a Formatter which emits a JSON-like key=value format. -func NewFormatter(opts Options) Formatter { - return newFormatter(opts, outputKeyValue) -} - -// NewFormatterJSON constructs a Formatter which emits strict JSON. -func NewFormatterJSON(opts Options) Formatter { - return newFormatter(opts, outputJSON) -} - -// Defaults for Options. -const defaultTimestampFormat = "2006-01-02 15:04:05.000000" -const defaultMaxLogDepth = 16 - -func newFormatter(opts Options, outfmt outputFormat) Formatter { - if opts.TimestampFormat == "" { - opts.TimestampFormat = defaultTimestampFormat - } - if opts.MaxLogDepth == 0 { - opts.MaxLogDepth = defaultMaxLogDepth - } - if opts.LogInfoLevel == nil { - opts.LogInfoLevel = new(string) - *opts.LogInfoLevel = "level" - } - f := Formatter{ - outputFormat: outfmt, - prefix: "", - values: nil, - depth: 0, - opts: &opts, - } - return f -} - -// Formatter is an opaque struct which can be embedded in a LogSink -// implementation. It should be constructed with NewFormatter. Some of -// its methods directly implement logr.LogSink. -type Formatter struct { - outputFormat outputFormat - prefix string - values []any - valuesStr string - parentValuesStr string - depth int - opts *Options - group string // for slog groups - groupDepth int -} - -// outputFormat indicates which outputFormat to use. -type outputFormat int - -const ( - // outputKeyValue emits a JSON-like key=value format, but not strict JSON. - outputKeyValue outputFormat = iota - // outputJSON emits strict JSON. - outputJSON -) - -// PseudoStruct is a list of key-value pairs that gets logged as a struct. -type PseudoStruct []any - -// render produces a log line, ready to use. -func (f Formatter) render(builtins, args []any) string { - // Empirically bytes.Buffer is faster than strings.Builder for this. - buf := bytes.NewBuffer(make([]byte, 0, 1024)) - if f.outputFormat == outputJSON { - buf.WriteByte('{') // for the whole line - } - - vals := builtins - if hook := f.opts.RenderBuiltinsHook; hook != nil { - vals = hook(f.sanitize(vals)) - } - f.flatten(buf, vals, false, false) // keys are ours, no need to escape - continuing := len(builtins) > 0 - - if f.parentValuesStr != "" { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(f.parentValuesStr) - continuing = true - } - - groupDepth := f.groupDepth - if f.group != "" { - if f.valuesStr != "" || len(args) != 0 { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys - buf.WriteByte(f.colon()) - buf.WriteByte('{') // for the group - continuing = false - } else { - // The group was empty - groupDepth-- - } - } - - if f.valuesStr != "" { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(f.valuesStr) - continuing = true - } - - vals = args - if hook := f.opts.RenderArgsHook; hook != nil { - vals = hook(f.sanitize(vals)) - } - f.flatten(buf, vals, continuing, true) // escape user-provided keys - - for i := 0; i < groupDepth; i++ { - buf.WriteByte('}') // for the groups - } - - if f.outputFormat == outputJSON { - buf.WriteByte('}') // for the whole line - } - - return buf.String() -} - -// flatten renders a list of key-value pairs into a buffer. If continuing is -// true, it assumes that the buffer has previous values and will emit a -// separator (which depends on the output format) before the first pair it -// writes. If escapeKeys is true, the keys are assumed to have -// non-JSON-compatible characters in them and must be evaluated for escapes. -// -// This function returns a potentially modified version of kvList, which -// ensures that there is a value for every key (adding a value if needed) and -// that each key is a string (substituting a key if needed). -func (f Formatter) flatten(buf *bytes.Buffer, kvList []any, continuing bool, escapeKeys bool) []any { - // This logic overlaps with sanitize() but saves one type-cast per key, - // which can be measurable. - if len(kvList)%2 != 0 { - kvList = append(kvList, noValue) - } - copied := false - for i := 0; i < len(kvList); i += 2 { - k, ok := kvList[i].(string) - if !ok { - if !copied { - newList := make([]any, len(kvList)) - copy(newList, kvList) - kvList = newList - copied = true - } - k = f.nonStringKey(kvList[i]) - kvList[i] = k - } - v := kvList[i+1] - - if i > 0 || continuing { - if f.outputFormat == outputJSON { - buf.WriteByte(f.comma()) - } else { - // In theory the format could be something we don't understand. In - // practice, we control it, so it won't be. - buf.WriteByte(' ') - } - } - - buf.WriteString(f.quoted(k, escapeKeys)) - buf.WriteByte(f.colon()) - buf.WriteString(f.pretty(v)) - } - return kvList -} - -func (f Formatter) quoted(str string, escape bool) string { - if escape { - return prettyString(str) - } - // this is faster - return `"` + str + `"` -} - -func (f Formatter) comma() byte { - if f.outputFormat == outputJSON { - return ',' - } - return ' ' -} - -func (f Formatter) colon() byte { - if f.outputFormat == outputJSON { - return ':' - } - return '=' -} - -func (f Formatter) pretty(value any) string { - return f.prettyWithFlags(value, 0, 0) -} - -const ( - flagRawStruct = 0x1 // do not print braces on structs -) - -// TODO: This is not fast. Most of the overhead goes here. -func (f Formatter) prettyWithFlags(value any, flags uint32, depth int) string { - if depth > f.opts.MaxLogDepth { - return `""` - } - - // Handle types that take full control of logging. - if v, ok := value.(logr.Marshaler); ok { - // Replace the value with what the type wants to get logged. - // That then gets handled below via reflection. - value = invokeMarshaler(v) - } - - // Handle types that want to format themselves. - switch v := value.(type) { - case fmt.Stringer: - value = invokeStringer(v) - case error: - value = invokeError(v) - } - - // Handling the most common types without reflect is a small perf win. - switch v := value.(type) { - case bool: - return strconv.FormatBool(v) - case string: - return prettyString(v) - case int: - return strconv.FormatInt(int64(v), 10) - case int8: - return strconv.FormatInt(int64(v), 10) - case int16: - return strconv.FormatInt(int64(v), 10) - case int32: - return strconv.FormatInt(int64(v), 10) - case int64: - return strconv.FormatInt(int64(v), 10) - case uint: - return strconv.FormatUint(uint64(v), 10) - case uint8: - return strconv.FormatUint(uint64(v), 10) - case uint16: - return strconv.FormatUint(uint64(v), 10) - case uint32: - return strconv.FormatUint(uint64(v), 10) - case uint64: - return strconv.FormatUint(v, 10) - case uintptr: - return strconv.FormatUint(uint64(v), 10) - case float32: - return strconv.FormatFloat(float64(v), 'f', -1, 32) - case float64: - return strconv.FormatFloat(v, 'f', -1, 64) - case complex64: - return `"` + strconv.FormatComplex(complex128(v), 'f', -1, 64) + `"` - case complex128: - return `"` + strconv.FormatComplex(v, 'f', -1, 128) + `"` - case PseudoStruct: - buf := bytes.NewBuffer(make([]byte, 0, 1024)) - v = f.sanitize(v) - if flags&flagRawStruct == 0 { - buf.WriteByte('{') - } - for i := 0; i < len(v); i += 2 { - if i > 0 { - buf.WriteByte(f.comma()) - } - k, _ := v[i].(string) // sanitize() above means no need to check success - // arbitrary keys might need escaping - buf.WriteString(prettyString(k)) - buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1)) - } - if flags&flagRawStruct == 0 { - buf.WriteByte('}') - } - return buf.String() - } - - buf := bytes.NewBuffer(make([]byte, 0, 256)) - t := reflect.TypeOf(value) - if t == nil { - return "null" - } - v := reflect.ValueOf(value) - switch t.Kind() { - case reflect.Bool: - return strconv.FormatBool(v.Bool()) - case reflect.String: - return prettyString(v.String()) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return strconv.FormatInt(int64(v.Int()), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return strconv.FormatUint(uint64(v.Uint()), 10) - case reflect.Float32: - return strconv.FormatFloat(float64(v.Float()), 'f', -1, 32) - case reflect.Float64: - return strconv.FormatFloat(v.Float(), 'f', -1, 64) - case reflect.Complex64: - return `"` + strconv.FormatComplex(complex128(v.Complex()), 'f', -1, 64) + `"` - case reflect.Complex128: - return `"` + strconv.FormatComplex(v.Complex(), 'f', -1, 128) + `"` - case reflect.Struct: - if flags&flagRawStruct == 0 { - buf.WriteByte('{') - } - printComma := false // testing i>0 is not enough because of JSON omitted fields - for i := 0; i < t.NumField(); i++ { - fld := t.Field(i) - if fld.PkgPath != "" { - // reflect says this field is only defined for non-exported fields. - continue - } - if !v.Field(i).CanInterface() { - // reflect isn't clear exactly what this means, but we can't use it. - continue - } - name := "" - omitempty := false - if tag, found := fld.Tag.Lookup("json"); found { - if tag == "-" { - continue - } - if comma := strings.Index(tag, ","); comma != -1 { - if n := tag[:comma]; n != "" { - name = n - } - rest := tag[comma:] - if strings.Contains(rest, ",omitempty,") || strings.HasSuffix(rest, ",omitempty") { - omitempty = true - } - } else { - name = tag - } - } - if omitempty && isEmpty(v.Field(i)) { - continue - } - if printComma { - buf.WriteByte(f.comma()) - } - printComma = true // if we got here, we are rendering a field - if fld.Anonymous && fld.Type.Kind() == reflect.Struct && name == "" { - buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), flags|flagRawStruct, depth+1)) - continue - } - if name == "" { - name = fld.Name - } - // field names can't contain characters which need escaping - buf.WriteString(f.quoted(name, false)) - buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(v.Field(i).Interface(), 0, depth+1)) - } - if flags&flagRawStruct == 0 { - buf.WriteByte('}') - } - return buf.String() - case reflect.Slice, reflect.Array: - // If this is outputing as JSON make sure this isn't really a json.RawMessage. - // If so just emit "as-is" and don't pretty it as that will just print - // it as [X,Y,Z,...] which isn't terribly useful vs the string form you really want. - if f.outputFormat == outputJSON { - if rm, ok := value.(json.RawMessage); ok { - // If it's empty make sure we emit an empty value as the array style would below. - if len(rm) > 0 { - buf.Write(rm) - } else { - buf.WriteString("null") - } - return buf.String() - } - } - buf.WriteByte('[') - for i := 0; i < v.Len(); i++ { - if i > 0 { - buf.WriteByte(f.comma()) - } - e := v.Index(i) - buf.WriteString(f.prettyWithFlags(e.Interface(), 0, depth+1)) - } - buf.WriteByte(']') - return buf.String() - case reflect.Map: - buf.WriteByte('{') - // This does not sort the map keys, for best perf. - it := v.MapRange() - i := 0 - for it.Next() { - if i > 0 { - buf.WriteByte(f.comma()) - } - // If a map key supports TextMarshaler, use it. - keystr := "" - if m, ok := it.Key().Interface().(encoding.TextMarshaler); ok { - txt, err := m.MarshalText() - if err != nil { - keystr = fmt.Sprintf("", err.Error()) - } else { - keystr = string(txt) - } - keystr = prettyString(keystr) - } else { - // prettyWithFlags will produce already-escaped values - keystr = f.prettyWithFlags(it.Key().Interface(), 0, depth+1) - if t.Key().Kind() != reflect.String { - // JSON only does string keys. Unlike Go's standard JSON, we'll - // convert just about anything to a string. - keystr = prettyString(keystr) - } - } - buf.WriteString(keystr) - buf.WriteByte(f.colon()) - buf.WriteString(f.prettyWithFlags(it.Value().Interface(), 0, depth+1)) - i++ - } - buf.WriteByte('}') - return buf.String() - case reflect.Ptr, reflect.Interface: - if v.IsNil() { - return "null" - } - return f.prettyWithFlags(v.Elem().Interface(), 0, depth) - } - return fmt.Sprintf(`""`, t.Kind().String()) -} - -func prettyString(s string) string { - // Avoid escaping (which does allocations) if we can. - if needsEscape(s) { - return strconv.Quote(s) - } - b := bytes.NewBuffer(make([]byte, 0, 1024)) - b.WriteByte('"') - b.WriteString(s) - b.WriteByte('"') - return b.String() -} - -// needsEscape determines whether the input string needs to be escaped or not, -// without doing any allocations. -func needsEscape(s string) bool { - for _, r := range s { - if !strconv.IsPrint(r) || r == '\\' || r == '"' { - return true - } - } - return false -} - -func isEmpty(v reflect.Value) bool { - switch v.Kind() { - case reflect.Array, reflect.Map, reflect.Slice, reflect.String: - return v.Len() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Complex64, reflect.Complex128: - return v.Complex() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - return false -} - -func invokeMarshaler(m logr.Marshaler) (ret any) { - defer func() { - if r := recover(); r != nil { - ret = fmt.Sprintf("", r) - } - }() - return m.MarshalLog() -} - -func invokeStringer(s fmt.Stringer) (ret string) { - defer func() { - if r := recover(); r != nil { - ret = fmt.Sprintf("", r) - } - }() - return s.String() -} - -func invokeError(e error) (ret string) { - defer func() { - if r := recover(); r != nil { - ret = fmt.Sprintf("", r) - } - }() - return e.Error() -} - -// Caller represents the original call site for a log line, after considering -// logr.Logger.WithCallDepth and logr.Logger.WithCallStackHelper. The File and -// Line fields will always be provided, while the Func field is optional. -// Users can set the render hook fields in Options to examine logged key-value -// pairs, one of which will be {"caller", Caller} if the Options.LogCaller -// field is enabled for the given MessageClass. -type Caller struct { - // File is the basename of the file for this call site. - File string `json:"file"` - // Line is the line number in the file for this call site. - Line int `json:"line"` - // Func is the function name for this call site, or empty if - // Options.LogCallerFunc is not enabled. - Func string `json:"function,omitempty"` -} - -func (f Formatter) caller() Caller { - // +1 for this frame, +1 for Info/Error. - pc, file, line, ok := runtime.Caller(f.depth + 2) - if !ok { - return Caller{"", 0, ""} - } - fn := "" - if f.opts.LogCallerFunc { - if fp := runtime.FuncForPC(pc); fp != nil { - fn = fp.Name() - } - } - - return Caller{filepath.Base(file), line, fn} -} - -const noValue = "" - -func (f Formatter) nonStringKey(v any) string { - return fmt.Sprintf("", f.snippet(v)) -} - -// snippet produces a short snippet string of an arbitrary value. -func (f Formatter) snippet(v any) string { - const snipLen = 16 - - snip := f.pretty(v) - if len(snip) > snipLen { - snip = snip[:snipLen] - } - return snip -} - -// sanitize ensures that a list of key-value pairs has a value for every key -// (adding a value if needed) and that each key is a string (substituting a key -// if needed). -func (f Formatter) sanitize(kvList []any) []any { - if len(kvList)%2 != 0 { - kvList = append(kvList, noValue) - } - for i := 0; i < len(kvList); i += 2 { - _, ok := kvList[i].(string) - if !ok { - kvList[i] = f.nonStringKey(kvList[i]) - } - } - return kvList -} - -// startGroup opens a new group scope (basically a sub-struct), which locks all -// the current saved values and starts them anew. This is needed to satisfy -// slog. -func (f *Formatter) startGroup(group string) { - // Unnamed groups are just inlined. - if group == "" { - return - } - - // Any saved values can no longer be changed. - buf := bytes.NewBuffer(make([]byte, 0, 1024)) - continuing := false - - if f.parentValuesStr != "" { - buf.WriteString(f.parentValuesStr) - continuing = true - } - - if f.group != "" && f.valuesStr != "" { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(f.quoted(f.group, true)) // escape user-provided keys - buf.WriteByte(f.colon()) - buf.WriteByte('{') // for the group - continuing = false - } - - if f.valuesStr != "" { - if continuing { - buf.WriteByte(f.comma()) - } - buf.WriteString(f.valuesStr) - } - - // NOTE: We don't close the scope here - that's done later, when a log line - // is actually rendered (because we have N scopes to close). - - f.parentValuesStr = buf.String() - - // Start collecting new values. - f.group = group - f.groupDepth++ - f.valuesStr = "" - f.values = nil -} - -// Init configures this Formatter from runtime info, such as the call depth -// imposed by logr itself. -// Note that this receiver is a pointer, so depth can be saved. -func (f *Formatter) Init(info logr.RuntimeInfo) { - f.depth += info.CallDepth -} - -// Enabled checks whether an info message at the given level should be logged. -func (f Formatter) Enabled(level int) bool { - return level <= f.opts.Verbosity -} - -// GetDepth returns the current depth of this Formatter. This is useful for -// implementations which do their own caller attribution. -func (f Formatter) GetDepth() int { - return f.depth -} - -// FormatInfo renders an Info log message into strings. The prefix will be -// empty when no names were set (via AddNames), or when the output is -// configured for JSON. -func (f Formatter) FormatInfo(level int, msg string, kvList []any) (prefix, argsStr string) { - args := make([]any, 0, 64) // using a constant here impacts perf - prefix = f.prefix - if f.outputFormat == outputJSON { - args = append(args, "logger", prefix) - prefix = "" - } - if f.opts.LogTimestamp { - args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) - } - if policy := f.opts.LogCaller; policy == All || policy == Info { - args = append(args, "caller", f.caller()) - } - if key := *f.opts.LogInfoLevel; key != "" { - args = append(args, key, level) - } - args = append(args, "msg", msg) - return prefix, f.render(args, kvList) -} - -// FormatError renders an Error log message into strings. The prefix will be -// empty when no names were set (via AddNames), or when the output is -// configured for JSON. -func (f Formatter) FormatError(err error, msg string, kvList []any) (prefix, argsStr string) { - args := make([]any, 0, 64) // using a constant here impacts perf - prefix = f.prefix - if f.outputFormat == outputJSON { - args = append(args, "logger", prefix) - prefix = "" - } - if f.opts.LogTimestamp { - args = append(args, "ts", time.Now().Format(f.opts.TimestampFormat)) - } - if policy := f.opts.LogCaller; policy == All || policy == Error { - args = append(args, "caller", f.caller()) - } - args = append(args, "msg", msg) - var loggableErr any - if err != nil { - loggableErr = err.Error() - } - args = append(args, "error", loggableErr) - return prefix, f.render(args, kvList) -} - -// AddName appends the specified name. funcr uses '/' characters to separate -// name elements. Callers should not pass '/' in the provided name string, but -// this library does not actually enforce that. -func (f *Formatter) AddName(name string) { - if len(f.prefix) > 0 { - f.prefix += "/" - } - f.prefix += name -} - -// AddValues adds key-value pairs to the set of saved values to be logged with -// each log line. -func (f *Formatter) AddValues(kvList []any) { - // Three slice args forces a copy. - n := len(f.values) - f.values = append(f.values[:n:n], kvList...) - - vals := f.values - if hook := f.opts.RenderValuesHook; hook != nil { - vals = hook(f.sanitize(vals)) - } - - // Pre-render values, so we don't have to do it on each Info/Error call. - buf := bytes.NewBuffer(make([]byte, 0, 1024)) - f.flatten(buf, vals, false, true) // escape user-provided keys - f.valuesStr = buf.String() -} - -// AddCallDepth increases the number of stack-frames to skip when attributing -// the log line to a file and line. -func (f *Formatter) AddCallDepth(depth int) { - f.depth += depth -} diff --git a/vendor/github.com/go-logr/logr/funcr/slogsink.go b/vendor/github.com/go-logr/logr/funcr/slogsink.go deleted file mode 100644 index 7bd84761e2..0000000000 --- a/vendor/github.com/go-logr/logr/funcr/slogsink.go +++ /dev/null @@ -1,105 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package funcr - -import ( - "context" - "log/slog" - - "github.com/go-logr/logr" -) - -var _ logr.SlogSink = &fnlogger{} - -const extraSlogSinkDepth = 3 // 2 for slog, 1 for SlogSink - -func (l fnlogger) Handle(_ context.Context, record slog.Record) error { - kvList := make([]any, 0, 2*record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - kvList = attrToKVs(attr, kvList) - return true - }) - - if record.Level >= slog.LevelError { - l.WithCallDepth(extraSlogSinkDepth).Error(nil, record.Message, kvList...) - } else { - level := l.levelFromSlog(record.Level) - l.WithCallDepth(extraSlogSinkDepth).Info(level, record.Message, kvList...) - } - return nil -} - -func (l fnlogger) WithAttrs(attrs []slog.Attr) logr.SlogSink { - kvList := make([]any, 0, 2*len(attrs)) - for _, attr := range attrs { - kvList = attrToKVs(attr, kvList) - } - l.AddValues(kvList) - return &l -} - -func (l fnlogger) WithGroup(name string) logr.SlogSink { - l.startGroup(name) - return &l -} - -// attrToKVs appends a slog.Attr to a logr-style kvList. It handle slog Groups -// and other details of slog. -func attrToKVs(attr slog.Attr, kvList []any) []any { - attrVal := attr.Value.Resolve() - if attrVal.Kind() == slog.KindGroup { - groupVal := attrVal.Group() - grpKVs := make([]any, 0, 2*len(groupVal)) - for _, attr := range groupVal { - grpKVs = attrToKVs(attr, grpKVs) - } - if attr.Key == "" { - // slog says we have to inline these - kvList = append(kvList, grpKVs...) - } else { - kvList = append(kvList, attr.Key, PseudoStruct(grpKVs)) - } - } else if attr.Key != "" { - kvList = append(kvList, attr.Key, attrVal.Any()) - } - - return kvList -} - -// levelFromSlog adjusts the level by the logger's verbosity and negates it. -// It ensures that the result is >= 0. This is necessary because the result is -// passed to a LogSink and that API did not historically document whether -// levels could be negative or what that meant. -// -// Some example usage: -// -// logrV0 := getMyLogger() -// logrV2 := logrV0.V(2) -// slogV2 := slog.New(logr.ToSlogHandler(logrV2)) -// slogV2.Debug("msg") // =~ logrV2.V(4) =~ logrV0.V(6) -// slogV2.Info("msg") // =~ logrV2.V(0) =~ logrV0.V(2) -// slogv2.Warn("msg") // =~ logrV2.V(-4) =~ logrV0.V(0) -func (l fnlogger) levelFromSlog(level slog.Level) int { - result := -level - if result < 0 { - result = 0 // because LogSink doesn't expect negative V levels - } - return int(result) -} diff --git a/vendor/github.com/go-logr/logr/logr.go b/vendor/github.com/go-logr/logr/logr.go deleted file mode 100644 index b4428e105b..0000000000 --- a/vendor/github.com/go-logr/logr/logr.go +++ /dev/null @@ -1,520 +0,0 @@ -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This design derives from Dave Cheney's blog: -// http://dave.cheney.net/2015/11/05/lets-talk-about-logging - -// Package logr defines a general-purpose logging API and abstract interfaces -// to back that API. Packages in the Go ecosystem can depend on this package, -// while callers can implement logging with whatever backend is appropriate. -// -// # Usage -// -// Logging is done using a Logger instance. Logger is a concrete type with -// methods, which defers the actual logging to a LogSink interface. The main -// methods of Logger are Info() and Error(). Arguments to Info() and Error() -// are key/value pairs rather than printf-style formatted strings, emphasizing -// "structured logging". -// -// With Go's standard log package, we might write: -// -// log.Printf("setting target value %s", targetValue) -// -// With logr's structured logging, we'd write: -// -// logger.Info("setting target", "value", targetValue) -// -// Errors are much the same. Instead of: -// -// log.Printf("failed to open the pod bay door for user %s: %v", user, err) -// -// We'd write: -// -// logger.Error(err, "failed to open the pod bay door", "user", user) -// -// Info() and Error() are very similar, but they are separate methods so that -// LogSink implementations can choose to do things like attach additional -// information (such as stack traces) on calls to Error(). Error() messages are -// always logged, regardless of the current verbosity. If there is no error -// instance available, passing nil is valid. -// -// # Verbosity -// -// Often we want to log information only when the application in "verbose -// mode". To write log lines that are more verbose, Logger has a V() method. -// The higher the V-level of a log line, the less critical it is considered. -// Log-lines with V-levels that are not enabled (as per the LogSink) will not -// be written. Level V(0) is the default, and logger.V(0).Info() has the same -// meaning as logger.Info(). Negative V-levels have the same meaning as V(0). -// Error messages do not have a verbosity level and are always logged. -// -// Where we might have written: -// -// if flVerbose >= 2 { -// log.Printf("an unusual thing happened") -// } -// -// We can write: -// -// logger.V(2).Info("an unusual thing happened") -// -// # Logger Names -// -// Logger instances can have name strings so that all messages logged through -// that instance have additional context. For example, you might want to add -// a subsystem name: -// -// logger.WithName("compactor").Info("started", "time", time.Now()) -// -// The WithName() method returns a new Logger, which can be passed to -// constructors or other functions for further use. Repeated use of WithName() -// will accumulate name "segments". These name segments will be joined in some -// way by the LogSink implementation. It is strongly recommended that name -// segments contain simple identifiers (letters, digits, and hyphen), and do -// not contain characters that could muddle the log output or confuse the -// joining operation (e.g. whitespace, commas, periods, slashes, brackets, -// quotes, etc). -// -// # Saved Values -// -// Logger instances can store any number of key/value pairs, which will be -// logged alongside all messages logged through that instance. For example, -// you might want to create a Logger instance per managed object: -// -// With the standard log package, we might write: -// -// log.Printf("decided to set field foo to value %q for object %s/%s", -// targetValue, object.Namespace, object.Name) -// -// With logr we'd write: -// -// // Elsewhere: set up the logger to log the object name. -// obj.logger = mainLogger.WithValues( -// "name", obj.name, "namespace", obj.namespace) -// -// // later on... -// obj.logger.Info("setting foo", "value", targetValue) -// -// # Best Practices -// -// Logger has very few hard rules, with the goal that LogSink implementations -// might have a lot of freedom to differentiate. There are, however, some -// things to consider. -// -// The log message consists of a constant message attached to the log line. -// This should generally be a simple description of what's occurring, and should -// never be a format string. Variable information can then be attached using -// named values. -// -// Keys are arbitrary strings, but should generally be constant values. Values -// may be any Go value, but how the value is formatted is determined by the -// LogSink implementation. -// -// Logger instances are meant to be passed around by value. Code that receives -// such a value can call its methods without having to check whether the -// instance is ready for use. -// -// The zero logger (= Logger{}) is identical to Discard() and discards all log -// entries. Code that receives a Logger by value can simply call it, the methods -// will never crash. For cases where passing a logger is optional, a pointer to Logger -// should be used. -// -// # Key Naming Conventions -// -// Keys are not strictly required to conform to any specification or regex, but -// it is recommended that they: -// - be human-readable and meaningful (not auto-generated or simple ordinals) -// - be constant (not dependent on input data) -// - contain only printable characters -// - not contain whitespace or punctuation -// - use lower case for simple keys and lowerCamelCase for more complex ones -// -// These guidelines help ensure that log data is processed properly regardless -// of the log implementation. For example, log implementations will try to -// output JSON data or will store data for later database (e.g. SQL) queries. -// -// While users are generally free to use key names of their choice, it's -// generally best to avoid using the following keys, as they're frequently used -// by implementations: -// - "caller": the calling information (file/line) of a particular log line -// - "error": the underlying error value in the `Error` method -// - "level": the log level -// - "logger": the name of the associated logger -// - "msg": the log message -// - "stacktrace": the stack trace associated with a particular log line or -// error (often from the `Error` message) -// - "ts": the timestamp for a log line -// -// Implementations are encouraged to make use of these keys to represent the -// above concepts, when necessary (for example, in a pure-JSON output form, it -// would be necessary to represent at least message and timestamp as ordinary -// named values). -// -// # Break Glass -// -// Implementations may choose to give callers access to the underlying -// logging implementation. The recommended pattern for this is: -// -// // Underlier exposes access to the underlying logging implementation. -// // Since callers only have a logr.Logger, they have to know which -// // implementation is in use, so this interface is less of an abstraction -// // and more of way to test type conversion. -// type Underlier interface { -// GetUnderlying() -// } -// -// Logger grants access to the sink to enable type assertions like this: -// -// func DoSomethingWithImpl(log logr.Logger) { -// if underlier, ok := log.GetSink().(impl.Underlier); ok { -// implLogger := underlier.GetUnderlying() -// ... -// } -// } -// -// Custom `With*` functions can be implemented by copying the complete -// Logger struct and replacing the sink in the copy: -// -// // WithFooBar changes the foobar parameter in the log sink and returns a -// // new logger with that modified sink. It does nothing for loggers where -// // the sink doesn't support that parameter. -// func WithFoobar(log logr.Logger, foobar int) logr.Logger { -// if foobarLogSink, ok := log.GetSink().(FoobarSink); ok { -// log = log.WithSink(foobarLogSink.WithFooBar(foobar)) -// } -// return log -// } -// -// Don't use New to construct a new Logger with a LogSink retrieved from an -// existing Logger. Source code attribution might not work correctly and -// unexported fields in Logger get lost. -// -// Beware that the same LogSink instance may be shared by different logger -// instances. Calling functions that modify the LogSink will affect all of -// those. -package logr - -// New returns a new Logger instance. This is primarily used by libraries -// implementing LogSink, rather than end users. Passing a nil sink will create -// a Logger which discards all log lines. -func New(sink LogSink) Logger { - logger := Logger{} - logger.setSink(sink) - if sink != nil { - sink.Init(runtimeInfo) - } - return logger -} - -// setSink stores the sink and updates any related fields. It mutates the -// logger and thus is only safe to use for loggers that are not currently being -// used concurrently. -func (l *Logger) setSink(sink LogSink) { - l.sink = sink -} - -// GetSink returns the stored sink. -func (l Logger) GetSink() LogSink { - return l.sink -} - -// WithSink returns a copy of the logger with the new sink. -func (l Logger) WithSink(sink LogSink) Logger { - l.setSink(sink) - return l -} - -// Logger is an interface to an abstract logging implementation. This is a -// concrete type for performance reasons, but all the real work is passed on to -// a LogSink. Implementations of LogSink should provide their own constructors -// that return Logger, not LogSink. -// -// The underlying sink can be accessed through GetSink and be modified through -// WithSink. This enables the implementation of custom extensions (see "Break -// Glass" in the package documentation). Normally the sink should be used only -// indirectly. -type Logger struct { - sink LogSink - level int -} - -// Enabled tests whether this Logger is enabled. For example, commandline -// flags might be used to set the logging verbosity and disable some info logs. -func (l Logger) Enabled() bool { - // Some implementations of LogSink look at the caller in Enabled (e.g. - // different verbosity levels per package or file), but we only pass one - // CallDepth in (via Init). This means that all calls from Logger to the - // LogSink's Enabled, Info, and Error methods must have the same number of - // frames. In other words, Logger methods can't call other Logger methods - // which call these LogSink methods unless we do it the same in all paths. - return l.sink != nil && l.sink.Enabled(l.level) -} - -// Info logs a non-error message with the given key/value pairs as context. -// -// The msg argument should be used to add some constant description to the log -// line. The key/value pairs can then be used to add additional variable -// information. The key/value pairs must alternate string keys and arbitrary -// values. -func (l Logger) Info(msg string, keysAndValues ...any) { - if l.sink == nil { - return - } - if l.sink.Enabled(l.level) { // see comment in Enabled - if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { - withHelper.GetCallStackHelper()() - } - l.sink.Info(l.level, msg, keysAndValues...) - } -} - -// Error logs an error, with the given message and key/value pairs as context. -// It functions similarly to Info, but may have unique behavior, and should be -// preferred for logging errors (see the package documentations for more -// information). The log message will always be emitted, regardless of -// verbosity level. -// -// The msg argument should be used to add context to any underlying error, -// while the err argument should be used to attach the actual error that -// triggered this log line, if present. The err parameter is optional -// and nil may be passed instead of an error instance. -func (l Logger) Error(err error, msg string, keysAndValues ...any) { - if l.sink == nil { - return - } - if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { - withHelper.GetCallStackHelper()() - } - l.sink.Error(err, msg, keysAndValues...) -} - -// V returns a new Logger instance for a specific verbosity level, relative to -// this Logger. In other words, V-levels are additive. A higher verbosity -// level means a log message is less important. Negative V-levels are treated -// as 0. -func (l Logger) V(level int) Logger { - if l.sink == nil { - return l - } - if level < 0 { - level = 0 - } - l.level += level - return l -} - -// GetV returns the verbosity level of the logger. If the logger's LogSink is -// nil as in the Discard logger, this will always return 0. -func (l Logger) GetV() int { - // 0 if l.sink nil because of the if check in V above. - return l.level -} - -// WithValues returns a new Logger instance with additional key/value pairs. -// See Info for documentation on how key/value pairs work. -func (l Logger) WithValues(keysAndValues ...any) Logger { - if l.sink == nil { - return l - } - l.setSink(l.sink.WithValues(keysAndValues...)) - return l -} - -// WithName returns a new Logger instance with the specified name element added -// to the Logger's name. Successive calls with WithName append additional -// suffixes to the Logger's name. It's strongly recommended that name segments -// contain only letters, digits, and hyphens (see the package documentation for -// more information). -func (l Logger) WithName(name string) Logger { - if l.sink == nil { - return l - } - l.setSink(l.sink.WithName(name)) - return l -} - -// WithCallDepth returns a Logger instance that offsets the call stack by the -// specified number of frames when logging call site information, if possible. -// This is useful for users who have helper functions between the "real" call -// site and the actual calls to Logger methods. If depth is 0 the attribution -// should be to the direct caller of this function. If depth is 1 the -// attribution should skip 1 call frame, and so on. Successive calls to this -// are additive. -// -// If the underlying log implementation supports a WithCallDepth(int) method, -// it will be called and the result returned. If the implementation does not -// support CallDepthLogSink, the original Logger will be returned. -// -// To skip one level, WithCallStackHelper() should be used instead of -// WithCallDepth(1) because it works with implementions that support the -// CallDepthLogSink and/or CallStackHelperLogSink interfaces. -func (l Logger) WithCallDepth(depth int) Logger { - if l.sink == nil { - return l - } - if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { - l.setSink(withCallDepth.WithCallDepth(depth)) - } - return l -} - -// WithCallStackHelper returns a new Logger instance that skips the direct -// caller when logging call site information, if possible. This is useful for -// users who have helper functions between the "real" call site and the actual -// calls to Logger methods and want to support loggers which depend on marking -// each individual helper function, like loggers based on testing.T. -// -// In addition to using that new logger instance, callers also must call the -// returned function. -// -// If the underlying log implementation supports a WithCallDepth(int) method, -// WithCallDepth(1) will be called to produce a new logger. If it supports a -// WithCallStackHelper() method, that will be also called. If the -// implementation does not support either of these, the original Logger will be -// returned. -func (l Logger) WithCallStackHelper() (func(), Logger) { - if l.sink == nil { - return func() {}, l - } - var helper func() - if withCallDepth, ok := l.sink.(CallDepthLogSink); ok { - l.setSink(withCallDepth.WithCallDepth(1)) - } - if withHelper, ok := l.sink.(CallStackHelperLogSink); ok { - helper = withHelper.GetCallStackHelper() - } else { - helper = func() {} - } - return helper, l -} - -// IsZero returns true if this logger is an uninitialized zero value -func (l Logger) IsZero() bool { - return l.sink == nil -} - -// RuntimeInfo holds information that the logr "core" library knows which -// LogSinks might want to know. -type RuntimeInfo struct { - // CallDepth is the number of call frames the logr library adds between the - // end-user and the LogSink. LogSink implementations which choose to print - // the original logging site (e.g. file & line) should climb this many - // additional frames to find it. - CallDepth int -} - -// runtimeInfo is a static global. It must not be changed at run time. -var runtimeInfo = RuntimeInfo{ - CallDepth: 1, -} - -// LogSink represents a logging implementation. End-users will generally not -// interact with this type. -type LogSink interface { - // Init receives optional information about the logr library for LogSink - // implementations that need it. - Init(info RuntimeInfo) - - // Enabled tests whether this LogSink is enabled at the specified V-level. - // For example, commandline flags might be used to set the logging - // verbosity and disable some info logs. - Enabled(level int) bool - - // Info logs a non-error message with the given key/value pairs as context. - // The level argument is provided for optional logging. This method will - // only be called when Enabled(level) is true. See Logger.Info for more - // details. - Info(level int, msg string, keysAndValues ...any) - - // Error logs an error, with the given message and key/value pairs as - // context. See Logger.Error for more details. - Error(err error, msg string, keysAndValues ...any) - - // WithValues returns a new LogSink with additional key/value pairs. See - // Logger.WithValues for more details. - WithValues(keysAndValues ...any) LogSink - - // WithName returns a new LogSink with the specified name appended. See - // Logger.WithName for more details. - WithName(name string) LogSink -} - -// CallDepthLogSink represents a LogSink that knows how to climb the call stack -// to identify the original call site and can offset the depth by a specified -// number of frames. This is useful for users who have helper functions -// between the "real" call site and the actual calls to Logger methods. -// Implementations that log information about the call site (such as file, -// function, or line) would otherwise log information about the intermediate -// helper functions. -// -// This is an optional interface and implementations are not required to -// support it. -type CallDepthLogSink interface { - // WithCallDepth returns a LogSink that will offset the call - // stack by the specified number of frames when logging call - // site information. - // - // If depth is 0, the LogSink should skip exactly the number - // of call frames defined in RuntimeInfo.CallDepth when Info - // or Error are called, i.e. the attribution should be to the - // direct caller of Logger.Info or Logger.Error. - // - // If depth is 1 the attribution should skip 1 call frame, and so on. - // Successive calls to this are additive. - WithCallDepth(depth int) LogSink -} - -// CallStackHelperLogSink represents a LogSink that knows how to climb -// the call stack to identify the original call site and can skip -// intermediate helper functions if they mark themselves as -// helper. Go's testing package uses that approach. -// -// This is useful for users who have helper functions between the -// "real" call site and the actual calls to Logger methods. -// Implementations that log information about the call site (such as -// file, function, or line) would otherwise log information about the -// intermediate helper functions. -// -// This is an optional interface and implementations are not required -// to support it. Implementations that choose to support this must not -// simply implement it as WithCallDepth(1), because -// Logger.WithCallStackHelper will call both methods if they are -// present. This should only be implemented for LogSinks that actually -// need it, as with testing.T. -type CallStackHelperLogSink interface { - // GetCallStackHelper returns a function that must be called - // to mark the direct caller as helper function when logging - // call site information. - GetCallStackHelper() func() -} - -// Marshaler is an optional interface that logged values may choose to -// implement. Loggers with structured output, such as JSON, should -// log the object return by the MarshalLog method instead of the -// original value. -type Marshaler interface { - // MarshalLog can be used to: - // - ensure that structs are not logged as strings when the original - // value has a String method: return a different type without a - // String method - // - select which fields of a complex type should get logged: - // return a simpler struct with fewer fields - // - log unexported fields: return a different struct - // with exported fields - // - // It may return any value of any type. - MarshalLog() any -} diff --git a/vendor/github.com/go-logr/logr/sloghandler.go b/vendor/github.com/go-logr/logr/sloghandler.go deleted file mode 100644 index 82d1ba4948..0000000000 --- a/vendor/github.com/go-logr/logr/sloghandler.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -import ( - "context" - "log/slog" -) - -type slogHandler struct { - // May be nil, in which case all logs get discarded. - sink LogSink - // Non-nil if sink is non-nil and implements SlogSink. - slogSink SlogSink - - // groupPrefix collects values from WithGroup calls. It gets added as - // prefix to value keys when handling a log record. - groupPrefix string - - // levelBias can be set when constructing the handler to influence the - // slog.Level of log records. A positive levelBias reduces the - // slog.Level value. slog has no API to influence this value after the - // handler got created, so it can only be set indirectly through - // Logger.V. - levelBias slog.Level -} - -var _ slog.Handler = &slogHandler{} - -// groupSeparator is used to concatenate WithGroup names and attribute keys. -const groupSeparator = "." - -// GetLevel is used for black box unit testing. -func (l *slogHandler) GetLevel() slog.Level { - return l.levelBias -} - -func (l *slogHandler) Enabled(_ context.Context, level slog.Level) bool { - return l.sink != nil && (level >= slog.LevelError || l.sink.Enabled(l.levelFromSlog(level))) -} - -func (l *slogHandler) Handle(ctx context.Context, record slog.Record) error { - if l.slogSink != nil { - // Only adjust verbosity level of log entries < slog.LevelError. - if record.Level < slog.LevelError { - record.Level -= l.levelBias - } - return l.slogSink.Handle(ctx, record) - } - - // No need to check for nil sink here because Handle will only be called - // when Enabled returned true. - - kvList := make([]any, 0, 2*record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - kvList = attrToKVs(attr, l.groupPrefix, kvList) - return true - }) - if record.Level >= slog.LevelError { - l.sinkWithCallDepth().Error(nil, record.Message, kvList...) - } else { - level := l.levelFromSlog(record.Level) - l.sinkWithCallDepth().Info(level, record.Message, kvList...) - } - return nil -} - -// sinkWithCallDepth adjusts the stack unwinding so that when Error or Info -// are called by Handle, code in slog gets skipped. -// -// This offset currently (Go 1.21.0) works for calls through -// slog.New(ToSlogHandler(...)). There's no guarantee that the call -// chain won't change. Wrapping the handler will also break unwinding. It's -// still better than not adjusting at all.... -// -// This cannot be done when constructing the handler because FromSlogHandler needs -// access to the original sink without this adjustment. A second copy would -// work, but then WithAttrs would have to be called for both of them. -func (l *slogHandler) sinkWithCallDepth() LogSink { - if sink, ok := l.sink.(CallDepthLogSink); ok { - return sink.WithCallDepth(2) - } - return l.sink -} - -func (l *slogHandler) WithAttrs(attrs []slog.Attr) slog.Handler { - if l.sink == nil || len(attrs) == 0 { - return l - } - - clone := *l - if l.slogSink != nil { - clone.slogSink = l.slogSink.WithAttrs(attrs) - clone.sink = clone.slogSink - } else { - kvList := make([]any, 0, 2*len(attrs)) - for _, attr := range attrs { - kvList = attrToKVs(attr, l.groupPrefix, kvList) - } - clone.sink = l.sink.WithValues(kvList...) - } - return &clone -} - -func (l *slogHandler) WithGroup(name string) slog.Handler { - if l.sink == nil { - return l - } - if name == "" { - // slog says to inline empty groups - return l - } - clone := *l - if l.slogSink != nil { - clone.slogSink = l.slogSink.WithGroup(name) - clone.sink = clone.slogSink - } else { - clone.groupPrefix = addPrefix(clone.groupPrefix, name) - } - return &clone -} - -// attrToKVs appends a slog.Attr to a logr-style kvList. It handle slog Groups -// and other details of slog. -func attrToKVs(attr slog.Attr, groupPrefix string, kvList []any) []any { - attrVal := attr.Value.Resolve() - if attrVal.Kind() == slog.KindGroup { - groupVal := attrVal.Group() - grpKVs := make([]any, 0, 2*len(groupVal)) - prefix := groupPrefix - if attr.Key != "" { - prefix = addPrefix(groupPrefix, attr.Key) - } - for _, attr := range groupVal { - grpKVs = attrToKVs(attr, prefix, grpKVs) - } - kvList = append(kvList, grpKVs...) - } else if attr.Key != "" { - kvList = append(kvList, addPrefix(groupPrefix, attr.Key), attrVal.Any()) - } - - return kvList -} - -func addPrefix(prefix, name string) string { - if prefix == "" { - return name - } - if name == "" { - return prefix - } - return prefix + groupSeparator + name -} - -// levelFromSlog adjusts the level by the logger's verbosity and negates it. -// It ensures that the result is >= 0. This is necessary because the result is -// passed to a LogSink and that API did not historically document whether -// levels could be negative or what that meant. -// -// Some example usage: -// -// logrV0 := getMyLogger() -// logrV2 := logrV0.V(2) -// slogV2 := slog.New(logr.ToSlogHandler(logrV2)) -// slogV2.Debug("msg") // =~ logrV2.V(4) =~ logrV0.V(6) -// slogV2.Info("msg") // =~ logrV2.V(0) =~ logrV0.V(2) -// slogv2.Warn("msg") // =~ logrV2.V(-4) =~ logrV0.V(0) -func (l *slogHandler) levelFromSlog(level slog.Level) int { - result := -level - result += l.levelBias // in case the original Logger had a V level - if result < 0 { - result = 0 // because LogSink doesn't expect negative V levels - } - return int(result) -} diff --git a/vendor/github.com/go-logr/logr/slogr.go b/vendor/github.com/go-logr/logr/slogr.go deleted file mode 100644 index 28a83d0243..0000000000 --- a/vendor/github.com/go-logr/logr/slogr.go +++ /dev/null @@ -1,100 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -import ( - "context" - "log/slog" -) - -// FromSlogHandler returns a Logger which writes to the slog.Handler. -// -// The logr verbosity level is mapped to slog levels such that V(0) becomes -// slog.LevelInfo and V(4) becomes slog.LevelDebug. -func FromSlogHandler(handler slog.Handler) Logger { - if handler, ok := handler.(*slogHandler); ok { - if handler.sink == nil { - return Discard() - } - return New(handler.sink).V(int(handler.levelBias)) - } - return New(&slogSink{handler: handler}) -} - -// ToSlogHandler returns a slog.Handler which writes to the same sink as the Logger. -// -// The returned logger writes all records with level >= slog.LevelError as -// error log entries with LogSink.Error, regardless of the verbosity level of -// the Logger: -// -// logger := -// slog.New(ToSlogHandler(logger.V(10))).Error(...) -> logSink.Error(...) -// -// The level of all other records gets reduced by the verbosity -// level of the Logger and the result is negated. If it happens -// to be negative, then it gets replaced by zero because a LogSink -// is not expected to handled negative levels: -// -// slog.New(ToSlogHandler(logger)).Debug(...) -> logger.GetSink().Info(level=4, ...) -// slog.New(ToSlogHandler(logger)).Warning(...) -> logger.GetSink().Info(level=0, ...) -// slog.New(ToSlogHandler(logger)).Info(...) -> logger.GetSink().Info(level=0, ...) -// slog.New(ToSlogHandler(logger.V(4))).Info(...) -> logger.GetSink().Info(level=4, ...) -func ToSlogHandler(logger Logger) slog.Handler { - if sink, ok := logger.GetSink().(*slogSink); ok && logger.GetV() == 0 { - return sink.handler - } - - handler := &slogHandler{sink: logger.GetSink(), levelBias: slog.Level(logger.GetV())} - if slogSink, ok := handler.sink.(SlogSink); ok { - handler.slogSink = slogSink - } - return handler -} - -// SlogSink is an optional interface that a LogSink can implement to support -// logging through the slog.Logger or slog.Handler APIs better. It then should -// also support special slog values like slog.Group. When used as a -// slog.Handler, the advantages are: -// -// - stack unwinding gets avoided in favor of logging the pre-recorded PC, -// as intended by slog -// - proper grouping of key/value pairs via WithGroup -// - verbosity levels > slog.LevelInfo can be recorded -// - less overhead -// -// Both APIs (Logger and slog.Logger/Handler) then are supported equally -// well. Developers can pick whatever API suits them better and/or mix -// packages which use either API in the same binary with a common logging -// implementation. -// -// This interface is necessary because the type implementing the LogSink -// interface cannot also implement the slog.Handler interface due to the -// different prototype of the common Enabled method. -// -// An implementation could support both interfaces in two different types, but then -// additional interfaces would be needed to convert between those types in FromSlogHandler -// and ToSlogHandler. -type SlogSink interface { - LogSink - - Handle(ctx context.Context, record slog.Record) error - WithAttrs(attrs []slog.Attr) SlogSink - WithGroup(name string) SlogSink -} diff --git a/vendor/github.com/go-logr/logr/slogsink.go b/vendor/github.com/go-logr/logr/slogsink.go deleted file mode 100644 index 4060fcbc2b..0000000000 --- a/vendor/github.com/go-logr/logr/slogsink.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.21 -// +build go1.21 - -/* -Copyright 2023 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package logr - -import ( - "context" - "log/slog" - "runtime" - "time" -) - -var ( - _ LogSink = &slogSink{} - _ CallDepthLogSink = &slogSink{} - _ Underlier = &slogSink{} -) - -// Underlier is implemented by the LogSink returned by NewFromLogHandler. -type Underlier interface { - // GetUnderlying returns the Handler used by the LogSink. - GetUnderlying() slog.Handler -} - -const ( - // nameKey is used to log the `WithName` values as an additional attribute. - nameKey = "logger" - - // errKey is used to log the error parameter of Error as an additional attribute. - errKey = "err" -) - -type slogSink struct { - callDepth int - name string - handler slog.Handler -} - -func (l *slogSink) Init(info RuntimeInfo) { - l.callDepth = info.CallDepth -} - -func (l *slogSink) GetUnderlying() slog.Handler { - return l.handler -} - -func (l *slogSink) WithCallDepth(depth int) LogSink { - newLogger := *l - newLogger.callDepth += depth - return &newLogger -} - -func (l *slogSink) Enabled(level int) bool { - return l.handler.Enabled(context.Background(), slog.Level(-level)) -} - -func (l *slogSink) Info(level int, msg string, kvList ...interface{}) { - l.log(nil, msg, slog.Level(-level), kvList...) -} - -func (l *slogSink) Error(err error, msg string, kvList ...interface{}) { - l.log(err, msg, slog.LevelError, kvList...) -} - -func (l *slogSink) log(err error, msg string, level slog.Level, kvList ...interface{}) { - var pcs [1]uintptr - // skip runtime.Callers, this function, Info/Error, and all helper functions above that. - runtime.Callers(3+l.callDepth, pcs[:]) - - record := slog.NewRecord(time.Now(), level, msg, pcs[0]) - if l.name != "" { - record.AddAttrs(slog.String(nameKey, l.name)) - } - if err != nil { - record.AddAttrs(slog.Any(errKey, err)) - } - record.Add(kvList...) - _ = l.handler.Handle(context.Background(), record) -} - -func (l slogSink) WithName(name string) LogSink { - if l.name != "" { - l.name += "/" - } - l.name += name - return &l -} - -func (l slogSink) WithValues(kvList ...interface{}) LogSink { - l.handler = l.handler.WithAttrs(kvListToAttrs(kvList...)) - return &l -} - -func kvListToAttrs(kvList ...interface{}) []slog.Attr { - // We don't need the record itself, only its Add method. - record := slog.NewRecord(time.Time{}, 0, "", 0) - record.Add(kvList...) - attrs := make([]slog.Attr, 0, record.NumAttrs()) - record.Attrs(func(attr slog.Attr) bool { - attrs = append(attrs, attr) - return true - }) - return attrs -} diff --git a/vendor/github.com/go-logr/stdr/LICENSE b/vendor/github.com/go-logr/stdr/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/go-logr/stdr/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-logr/stdr/README.md b/vendor/github.com/go-logr/stdr/README.md deleted file mode 100644 index 5158667890..0000000000 --- a/vendor/github.com/go-logr/stdr/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Minimal Go logging using logr and Go's standard library - -[![Go Reference](https://pkg.go.dev/badge/github.com/go-logr/stdr.svg)](https://pkg.go.dev/github.com/go-logr/stdr) - -This package implements the [logr interface](https://github.com/go-logr/logr) -in terms of Go's standard log package(https://pkg.go.dev/log). diff --git a/vendor/github.com/go-logr/stdr/stdr.go b/vendor/github.com/go-logr/stdr/stdr.go deleted file mode 100644 index 93a8aab51b..0000000000 --- a/vendor/github.com/go-logr/stdr/stdr.go +++ /dev/null @@ -1,170 +0,0 @@ -/* -Copyright 2019 The logr Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package stdr implements github.com/go-logr/logr.Logger in terms of -// Go's standard log package. -package stdr - -import ( - "log" - "os" - - "github.com/go-logr/logr" - "github.com/go-logr/logr/funcr" -) - -// The global verbosity level. See SetVerbosity(). -var globalVerbosity int - -// SetVerbosity sets the global level against which all info logs will be -// compared. If this is greater than or equal to the "V" of the logger, the -// message will be logged. A higher value here means more logs will be written. -// The previous verbosity value is returned. This is not concurrent-safe - -// callers must be sure to call it from only one goroutine. -func SetVerbosity(v int) int { - old := globalVerbosity - globalVerbosity = v - return old -} - -// New returns a logr.Logger which is implemented by Go's standard log package, -// or something like it. If std is nil, this will use a default logger -// instead. -// -// Example: stdr.New(log.New(os.Stderr, "", log.LstdFlags|log.Lshortfile))) -func New(std StdLogger) logr.Logger { - return NewWithOptions(std, Options{}) -} - -// NewWithOptions returns a logr.Logger which is implemented by Go's standard -// log package, or something like it. See New for details. -func NewWithOptions(std StdLogger, opts Options) logr.Logger { - if std == nil { - // Go's log.Default() is only available in 1.16 and higher. - std = log.New(os.Stderr, "", log.LstdFlags) - } - - if opts.Depth < 0 { - opts.Depth = 0 - } - - fopts := funcr.Options{ - LogCaller: funcr.MessageClass(opts.LogCaller), - } - - sl := &logger{ - Formatter: funcr.NewFormatter(fopts), - std: std, - } - - // For skipping our own logger.Info/Error. - sl.Formatter.AddCallDepth(1 + opts.Depth) - - return logr.New(sl) -} - -// Options carries parameters which influence the way logs are generated. -type Options struct { - // Depth biases the assumed number of call frames to the "true" caller. - // This is useful when the calling code calls a function which then calls - // stdr (e.g. a logging shim to another API). Values less than zero will - // be treated as zero. - Depth int - - // LogCaller tells stdr to add a "caller" key to some or all log lines. - // Go's log package has options to log this natively, too. - LogCaller MessageClass - - // TODO: add an option to log the date/time -} - -// MessageClass indicates which category or categories of messages to consider. -type MessageClass int - -const ( - // None ignores all message classes. - None MessageClass = iota - // All considers all message classes. - All - // Info only considers info messages. - Info - // Error only considers error messages. - Error -) - -// StdLogger is the subset of the Go stdlib log.Logger API that is needed for -// this adapter. -type StdLogger interface { - // Output is the same as log.Output and log.Logger.Output. - Output(calldepth int, logline string) error -} - -type logger struct { - funcr.Formatter - std StdLogger -} - -var _ logr.LogSink = &logger{} -var _ logr.CallDepthLogSink = &logger{} - -func (l logger) Enabled(level int) bool { - return globalVerbosity >= level -} - -func (l logger) Info(level int, msg string, kvList ...interface{}) { - prefix, args := l.FormatInfo(level, msg, kvList) - if prefix != "" { - args = prefix + ": " + args - } - _ = l.std.Output(l.Formatter.GetDepth()+1, args) -} - -func (l logger) Error(err error, msg string, kvList ...interface{}) { - prefix, args := l.FormatError(err, msg, kvList) - if prefix != "" { - args = prefix + ": " + args - } - _ = l.std.Output(l.Formatter.GetDepth()+1, args) -} - -func (l logger) WithName(name string) logr.LogSink { - l.Formatter.AddName(name) - return &l -} - -func (l logger) WithValues(kvList ...interface{}) logr.LogSink { - l.Formatter.AddValues(kvList) - return &l -} - -func (l logger) WithCallDepth(depth int) logr.LogSink { - l.Formatter.AddCallDepth(depth) - return &l -} - -// Underlier exposes access to the underlying logging implementation. Since -// callers only have a logr.Logger, they have to know which implementation is -// in use, so this interface is less of an abstraction and more of way to test -// type conversion. -type Underlier interface { - GetUnderlying() StdLogger -} - -// GetUnderlying returns the StdLogger underneath this logger. Since StdLogger -// is itself an interface, the result may or may not be a Go log.Logger. -func (l logger) GetUnderlying() StdLogger { - return l.std -} diff --git a/vendor/github.com/go-openapi/analysis/.codecov.yml b/vendor/github.com/go-openapi/analysis/.codecov.yml deleted file mode 100644 index 841c4281e2..0000000000 --- a/vendor/github.com/go-openapi/analysis/.codecov.yml +++ /dev/null @@ -1,5 +0,0 @@ -coverage: - status: - patch: - default: - target: 80% diff --git a/vendor/github.com/go-openapi/analysis/.gitattributes b/vendor/github.com/go-openapi/analysis/.gitattributes deleted file mode 100644 index d020be8ea4..0000000000 --- a/vendor/github.com/go-openapi/analysis/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.go text eol=lf - diff --git a/vendor/github.com/go-openapi/analysis/.gitignore b/vendor/github.com/go-openapi/analysis/.gitignore deleted file mode 100644 index 87c3bd3e66..0000000000 --- a/vendor/github.com/go-openapi/analysis/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -secrets.yml -coverage.out -coverage.txt -*.cov -.idea diff --git a/vendor/github.com/go-openapi/analysis/.golangci.yml b/vendor/github.com/go-openapi/analysis/.golangci.yml deleted file mode 100644 index e24a6c14e6..0000000000 --- a/vendor/github.com/go-openapi/analysis/.golangci.yml +++ /dev/null @@ -1,56 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 40 - gocognit: - min-complexity: 40 - maligned: - suggest-new: true - dupl: - threshold: 150 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - gochecknoinits - # scopelint is useful, but also reports false positives - # that unfortunately can't be disabled. So we disable the - # linter rather than changing code that works. - # see: https://github.com/kyoh86/scopelint/issues/4 - - scopelint - - godox - - gocognit - #- whitespace - - wsl - - funlen - - testpackage - - wrapcheck - #- nlreturn - - gomnd - - goerr113 - - exhaustivestruct - #- errorlint - #- nestif - - gofumpt - - godot - - gci - - dogsled - - paralleltest - - tparallel - - thelper - - ifshort - - forbidigo - - cyclop - - varnamelen - - exhaustruct - - nonamedreturns - - nosnakecase diff --git a/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/analysis/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/analysis/LICENSE b/vendor/github.com/go-openapi/analysis/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/analysis/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/analysis/README.md b/vendor/github.com/go-openapi/analysis/README.md deleted file mode 100644 index aad6da10fe..0000000000 --- a/vendor/github.com/go-openapi/analysis/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# OpenAPI initiative analysis - -[![Build Status](https://travis-ci.org/go-openapi/analysis.svg?branch=master)](https://travis-ci.org/go-openapi/analysis) -[![Build status](https://ci.appveyor.com/api/projects/status/x377t5o9ennm847o/branch/master?svg=true)](https://ci.appveyor.com/project/casualjim/go-openapi/analysis/branch/master) -[![codecov](https://codecov.io/gh/go-openapi/analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/analysis) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/analysis/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/analysis.svg)](https://pkg.go.dev/github.com/go-openapi/analysis) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/analysis)](https://goreportcard.com/report/github.com/go-openapi/analysis) - - -A foundational library to analyze an OAI specification document for easier reasoning about the content. - -## What's inside? - -* A analyzer providing methods to walk the functional content of a specification -* A spec flattener producing a self-contained document bundle, while preserving `$ref`s -* A spec merger ("mixin") to merge several spec documents into a primary spec -* A spec "fixer" ensuring that response descriptions are non empty - -[Documentation](https://godoc.org/github.com/go-openapi/analysis) - -## FAQ - -* Does this library support OpenAPI 3? - -> No. -> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). -> There is no plan to make it evolve toward supporting OpenAPI 3.x. -> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. -> diff --git a/vendor/github.com/go-openapi/analysis/analyzer.go b/vendor/github.com/go-openapi/analysis/analyzer.go deleted file mode 100644 index c17aee1b61..0000000000 --- a/vendor/github.com/go-openapi/analysis/analyzer.go +++ /dev/null @@ -1,1064 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - slashpath "path" - "strconv" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -type referenceAnalysis struct { - schemas map[string]spec.Ref - responses map[string]spec.Ref - parameters map[string]spec.Ref - items map[string]spec.Ref - headerItems map[string]spec.Ref - parameterItems map[string]spec.Ref - allRefs map[string]spec.Ref - pathItems map[string]spec.Ref -} - -func (r *referenceAnalysis) addRef(key string, ref spec.Ref) { - r.allRefs["#"+key] = ref -} - -func (r *referenceAnalysis) addItemsRef(key string, items *spec.Items, location string) { - r.items["#"+key] = items.Ref - r.addRef(key, items.Ref) - if location == "header" { - // NOTE: in swagger 2.0, headers and parameters (but not body param schemas) are simple schemas - // and $ref are not supported here. However it is possible to analyze this. - r.headerItems["#"+key] = items.Ref - } else { - r.parameterItems["#"+key] = items.Ref - } -} - -func (r *referenceAnalysis) addSchemaRef(key string, ref SchemaRef) { - r.schemas["#"+key] = ref.Schema.Ref - r.addRef(key, ref.Schema.Ref) -} - -func (r *referenceAnalysis) addResponseRef(key string, resp *spec.Response) { - r.responses["#"+key] = resp.Ref - r.addRef(key, resp.Ref) -} - -func (r *referenceAnalysis) addParamRef(key string, param *spec.Parameter) { - r.parameters["#"+key] = param.Ref - r.addRef(key, param.Ref) -} - -func (r *referenceAnalysis) addPathItemRef(key string, pathItem *spec.PathItem) { - r.pathItems["#"+key] = pathItem.Ref - r.addRef(key, pathItem.Ref) -} - -type patternAnalysis struct { - parameters map[string]string - headers map[string]string - items map[string]string - schemas map[string]string - allPatterns map[string]string -} - -func (p *patternAnalysis) addPattern(key, pattern string) { - p.allPatterns["#"+key] = pattern -} - -func (p *patternAnalysis) addParameterPattern(key, pattern string) { - p.parameters["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addHeaderPattern(key, pattern string) { - p.headers["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addItemsPattern(key, pattern string) { - p.items["#"+key] = pattern - p.addPattern(key, pattern) -} - -func (p *patternAnalysis) addSchemaPattern(key, pattern string) { - p.schemas["#"+key] = pattern - p.addPattern(key, pattern) -} - -type enumAnalysis struct { - parameters map[string][]interface{} - headers map[string][]interface{} - items map[string][]interface{} - schemas map[string][]interface{} - allEnums map[string][]interface{} -} - -func (p *enumAnalysis) addEnum(key string, enum []interface{}) { - p.allEnums["#"+key] = enum -} - -func (p *enumAnalysis) addParameterEnum(key string, enum []interface{}) { - p.parameters["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addHeaderEnum(key string, enum []interface{}) { - p.headers["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addItemsEnum(key string, enum []interface{}) { - p.items["#"+key] = enum - p.addEnum(key, enum) -} - -func (p *enumAnalysis) addSchemaEnum(key string, enum []interface{}) { - p.schemas["#"+key] = enum - p.addEnum(key, enum) -} - -// New takes a swagger spec object and returns an analyzed spec document. -// The analyzed document contains a number of indices that make it easier to -// reason about semantics of a swagger specification for use in code generation -// or validation etc. -func New(doc *spec.Swagger) *Spec { - a := &Spec{ - spec: doc, - references: referenceAnalysis{}, - patterns: patternAnalysis{}, - enums: enumAnalysis{}, - } - a.reset() - a.initialize() - - return a -} - -// Spec is an analyzed specification object. It takes a swagger spec object and turns it into a registry -// with a bunch of utility methods to act on the information in the spec. -type Spec struct { - spec *spec.Swagger - consumes map[string]struct{} - produces map[string]struct{} - authSchemes map[string]struct{} - operations map[string]map[string]*spec.Operation - references referenceAnalysis - patterns patternAnalysis - enums enumAnalysis - allSchemas map[string]SchemaRef - allOfs map[string]SchemaRef -} - -func (s *Spec) reset() { - s.consumes = make(map[string]struct{}, 150) - s.produces = make(map[string]struct{}, 150) - s.authSchemes = make(map[string]struct{}, 150) - s.operations = make(map[string]map[string]*spec.Operation, 150) - s.allSchemas = make(map[string]SchemaRef, 150) - s.allOfs = make(map[string]SchemaRef, 150) - s.references.schemas = make(map[string]spec.Ref, 150) - s.references.pathItems = make(map[string]spec.Ref, 150) - s.references.responses = make(map[string]spec.Ref, 150) - s.references.parameters = make(map[string]spec.Ref, 150) - s.references.items = make(map[string]spec.Ref, 150) - s.references.headerItems = make(map[string]spec.Ref, 150) - s.references.parameterItems = make(map[string]spec.Ref, 150) - s.references.allRefs = make(map[string]spec.Ref, 150) - s.patterns.parameters = make(map[string]string, 150) - s.patterns.headers = make(map[string]string, 150) - s.patterns.items = make(map[string]string, 150) - s.patterns.schemas = make(map[string]string, 150) - s.patterns.allPatterns = make(map[string]string, 150) - s.enums.parameters = make(map[string][]interface{}, 150) - s.enums.headers = make(map[string][]interface{}, 150) - s.enums.items = make(map[string][]interface{}, 150) - s.enums.schemas = make(map[string][]interface{}, 150) - s.enums.allEnums = make(map[string][]interface{}, 150) -} - -func (s *Spec) reload() { - s.reset() - s.initialize() -} - -func (s *Spec) initialize() { - for _, c := range s.spec.Consumes { - s.consumes[c] = struct{}{} - } - for _, c := range s.spec.Produces { - s.produces[c] = struct{}{} - } - for _, ss := range s.spec.Security { - for k := range ss { - s.authSchemes[k] = struct{}{} - } - } - for path, pathItem := range s.AllPaths() { - s.analyzeOperations(path, &pathItem) //#nosec - } - - for name, parameter := range s.spec.Parameters { - refPref := slashpath.Join("/parameters", jsonpointer.Escape(name)) - if parameter.Items != nil { - s.analyzeItems("items", parameter.Items, refPref, "parameter") - } - if parameter.In == "body" && parameter.Schema != nil { - s.analyzeSchema("schema", parameter.Schema, refPref) - } - if parameter.Pattern != "" { - s.patterns.addParameterPattern(refPref, parameter.Pattern) - } - if len(parameter.Enum) > 0 { - s.enums.addParameterEnum(refPref, parameter.Enum) - } - } - - for name, response := range s.spec.Responses { - refPref := slashpath.Join("/responses", jsonpointer.Escape(name)) - for k, v := range response.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - if v.Items != nil { - s.analyzeItems("items", v.Items, hRefPref, "header") - } - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - if len(v.Enum) > 0 { - s.enums.addHeaderEnum(hRefPref, v.Enum) - } - } - if response.Schema != nil { - s.analyzeSchema("schema", response.Schema, refPref) - } - } - - for name := range s.spec.Definitions { - schema := s.spec.Definitions[name] - s.analyzeSchema(name, &schema, "/definitions") - } - // TODO: after analyzing all things and flattening schemas etc - // resolve all the collected references to their final representations - // best put in a separate method because this could get expensive -} - -func (s *Spec) analyzeOperations(path string, pi *spec.PathItem) { - // TODO: resolve refs here? - // Currently, operations declared via pathItem $ref are known only after expansion - op := pi - if pi.Ref.String() != "" { - key := slashpath.Join("/paths", jsonpointer.Escape(path)) - s.references.addPathItemRef(key, pi) - } - s.analyzeOperation("GET", path, op.Get) - s.analyzeOperation("PUT", path, op.Put) - s.analyzeOperation("POST", path, op.Post) - s.analyzeOperation("PATCH", path, op.Patch) - s.analyzeOperation("DELETE", path, op.Delete) - s.analyzeOperation("HEAD", path, op.Head) - s.analyzeOperation("OPTIONS", path, op.Options) - for i, param := range op.Parameters { - refPref := slashpath.Join("/paths", jsonpointer.Escape(path), "parameters", strconv.Itoa(i)) - if param.Ref.String() != "" { - s.references.addParamRef(refPref, ¶m) //#nosec - } - if param.Pattern != "" { - s.patterns.addParameterPattern(refPref, param.Pattern) - } - if len(param.Enum) > 0 { - s.enums.addParameterEnum(refPref, param.Enum) - } - if param.Items != nil { - s.analyzeItems("items", param.Items, refPref, "parameter") - } - if param.Schema != nil { - s.analyzeSchema("schema", param.Schema, refPref) - } - } -} - -func (s *Spec) analyzeItems(name string, items *spec.Items, prefix, location string) { - if items == nil { - return - } - refPref := slashpath.Join(prefix, name) - s.analyzeItems(name, items.Items, refPref, location) - if items.Ref.String() != "" { - s.references.addItemsRef(refPref, items, location) - } - if items.Pattern != "" { - s.patterns.addItemsPattern(refPref, items.Pattern) - } - if len(items.Enum) > 0 { - s.enums.addItemsEnum(refPref, items.Enum) - } -} - -func (s *Spec) analyzeParameter(prefix string, i int, param spec.Parameter) { - refPref := slashpath.Join(prefix, "parameters", strconv.Itoa(i)) - if param.Ref.String() != "" { - s.references.addParamRef(refPref, ¶m) //#nosec - } - - if param.Pattern != "" { - s.patterns.addParameterPattern(refPref, param.Pattern) - } - - if len(param.Enum) > 0 { - s.enums.addParameterEnum(refPref, param.Enum) - } - - s.analyzeItems("items", param.Items, refPref, "parameter") - if param.In == "body" && param.Schema != nil { - s.analyzeSchema("schema", param.Schema, refPref) - } -} - -func (s *Spec) analyzeOperation(method, path string, op *spec.Operation) { - if op == nil { - return - } - - for _, c := range op.Consumes { - s.consumes[c] = struct{}{} - } - - for _, c := range op.Produces { - s.produces[c] = struct{}{} - } - - for _, ss := range op.Security { - for k := range ss { - s.authSchemes[k] = struct{}{} - } - } - - if _, ok := s.operations[method]; !ok { - s.operations[method] = make(map[string]*spec.Operation) - } - - s.operations[method][path] = op - prefix := slashpath.Join("/paths", jsonpointer.Escape(path), strings.ToLower(method)) - for i, param := range op.Parameters { - s.analyzeParameter(prefix, i, param) - } - - if op.Responses == nil { - return - } - - if op.Responses.Default != nil { - s.analyzeDefaultResponse(prefix, op.Responses.Default) - } - - for k, res := range op.Responses.StatusCodeResponses { - s.analyzeResponse(prefix, k, res) - } -} - -func (s *Spec) analyzeDefaultResponse(prefix string, res *spec.Response) { - refPref := slashpath.Join(prefix, "responses", "default") - if res.Ref.String() != "" { - s.references.addResponseRef(refPref, res) - } - - for k, v := range res.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - s.analyzeItems("items", v.Items, hRefPref, "header") - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - } - - if res.Schema != nil { - s.analyzeSchema("schema", res.Schema, refPref) - } -} - -func (s *Spec) analyzeResponse(prefix string, k int, res spec.Response) { - refPref := slashpath.Join(prefix, "responses", strconv.Itoa(k)) - if res.Ref.String() != "" { - s.references.addResponseRef(refPref, &res) //#nosec - } - - for k, v := range res.Headers { - hRefPref := slashpath.Join(refPref, "headers", k) - s.analyzeItems("items", v.Items, hRefPref, "header") - if v.Pattern != "" { - s.patterns.addHeaderPattern(hRefPref, v.Pattern) - } - - if len(v.Enum) > 0 { - s.enums.addHeaderEnum(hRefPref, v.Enum) - } - } - - if res.Schema != nil { - s.analyzeSchema("schema", res.Schema, refPref) - } -} - -func (s *Spec) analyzeSchema(name string, schema *spec.Schema, prefix string) { - refURI := slashpath.Join(prefix, jsonpointer.Escape(name)) - schRef := SchemaRef{ - Name: name, - Schema: schema, - Ref: spec.MustCreateRef("#" + refURI), - TopLevel: prefix == "/definitions", - } - - s.allSchemas["#"+refURI] = schRef - - if schema.Ref.String() != "" { - s.references.addSchemaRef(refURI, schRef) - } - - if schema.Pattern != "" { - s.patterns.addSchemaPattern(refURI, schema.Pattern) - } - - if len(schema.Enum) > 0 { - s.enums.addSchemaEnum(refURI, schema.Enum) - } - - for k, v := range schema.Definitions { - v := v - s.analyzeSchema(k, &v, slashpath.Join(refURI, "definitions")) - } - - for k, v := range schema.Properties { - v := v - s.analyzeSchema(k, &v, slashpath.Join(refURI, "properties")) - } - - for k, v := range schema.PatternProperties { - v := v - // NOTE: swagger 2.0 does not support PatternProperties. - // However it is possible to analyze this in a schema - s.analyzeSchema(k, &v, slashpath.Join(refURI, "patternProperties")) - } - - for i := range schema.AllOf { - v := &schema.AllOf[i] - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "allOf")) - } - - if len(schema.AllOf) > 0 { - s.allOfs["#"+refURI] = schRef - } - - for i := range schema.AnyOf { - v := &schema.AnyOf[i] - // NOTE: swagger 2.0 does not support anyOf constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "anyOf")) - } - - for i := range schema.OneOf { - v := &schema.OneOf[i] - // NOTE: swagger 2.0 does not support oneOf constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema(strconv.Itoa(i), v, slashpath.Join(refURI, "oneOf")) - } - - if schema.Not != nil { - // NOTE: swagger 2.0 does not support "not" constructs. - // However it is possible to analyze this in a schema - s.analyzeSchema("not", schema.Not, refURI) - } - - if schema.AdditionalProperties != nil && schema.AdditionalProperties.Schema != nil { - s.analyzeSchema("additionalProperties", schema.AdditionalProperties.Schema, refURI) - } - - if schema.AdditionalItems != nil && schema.AdditionalItems.Schema != nil { - // NOTE: swagger 2.0 does not support AdditionalItems. - // However it is possible to analyze this in a schema - s.analyzeSchema("additionalItems", schema.AdditionalItems.Schema, refURI) - } - - if schema.Items != nil { - if schema.Items.Schema != nil { - s.analyzeSchema("items", schema.Items.Schema, refURI) - } - - for i := range schema.Items.Schemas { - sch := &schema.Items.Schemas[i] - s.analyzeSchema(strconv.Itoa(i), sch, slashpath.Join(refURI, "items")) - } - } -} - -// SecurityRequirement is a representation of a security requirement for an operation -type SecurityRequirement struct { - Name string - Scopes []string -} - -// SecurityRequirementsFor gets the security requirements for the operation -func (s *Spec) SecurityRequirementsFor(operation *spec.Operation) [][]SecurityRequirement { - if s.spec.Security == nil && operation.Security == nil { - return nil - } - - schemes := s.spec.Security - if operation.Security != nil { - schemes = operation.Security - } - - result := [][]SecurityRequirement{} - for _, scheme := range schemes { - if len(scheme) == 0 { - // append a zero object for anonymous - result = append(result, []SecurityRequirement{{}}) - - continue - } - - var reqs []SecurityRequirement - for k, v := range scheme { - if v == nil { - v = []string{} - } - reqs = append(reqs, SecurityRequirement{Name: k, Scopes: v}) - } - - result = append(result, reqs) - } - - return result -} - -// SecurityDefinitionsForRequirements gets the matching security definitions for a set of requirements -func (s *Spec) SecurityDefinitionsForRequirements(requirements []SecurityRequirement) map[string]spec.SecurityScheme { - result := make(map[string]spec.SecurityScheme) - - for _, v := range requirements { - if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok { - if definition != nil { - result[v.Name] = *definition - } - } - } - - return result -} - -// SecurityDefinitionsFor gets the matching security definitions for a set of requirements -func (s *Spec) SecurityDefinitionsFor(operation *spec.Operation) map[string]spec.SecurityScheme { - requirements := s.SecurityRequirementsFor(operation) - if len(requirements) == 0 { - return nil - } - - result := make(map[string]spec.SecurityScheme) - for _, reqs := range requirements { - for _, v := range reqs { - if v.Name == "" { - // optional requirement - continue - } - - if _, ok := result[v.Name]; ok { - // duplicate requirement - continue - } - - if definition, ok := s.spec.SecurityDefinitions[v.Name]; ok { - if definition != nil { - result[v.Name] = *definition - } - } - } - } - - return result -} - -// ConsumesFor gets the mediatypes for the operation -func (s *Spec) ConsumesFor(operation *spec.Operation) []string { - if len(operation.Consumes) == 0 { - cons := make(map[string]struct{}, len(s.spec.Consumes)) - for _, k := range s.spec.Consumes { - cons[k] = struct{}{} - } - - return s.structMapKeys(cons) - } - - cons := make(map[string]struct{}, len(operation.Consumes)) - for _, c := range operation.Consumes { - cons[c] = struct{}{} - } - - return s.structMapKeys(cons) -} - -// ProducesFor gets the mediatypes for the operation -func (s *Spec) ProducesFor(operation *spec.Operation) []string { - if len(operation.Produces) == 0 { - prod := make(map[string]struct{}, len(s.spec.Produces)) - for _, k := range s.spec.Produces { - prod[k] = struct{}{} - } - - return s.structMapKeys(prod) - } - - prod := make(map[string]struct{}, len(operation.Produces)) - for _, c := range operation.Produces { - prod[c] = struct{}{} - } - - return s.structMapKeys(prod) -} - -func mapKeyFromParam(param *spec.Parameter) string { - return fmt.Sprintf("%s#%s", param.In, fieldNameFromParam(param)) -} - -func fieldNameFromParam(param *spec.Parameter) string { - // TODO: this should be x-go-name - if nm, ok := param.Extensions.GetString("go-name"); ok { - return nm - } - - return swag.ToGoName(param.Name) -} - -// ErrorOnParamFunc is a callback function to be invoked -// whenever an error is encountered while resolving references -// on parameters. -// -// This function takes as input the spec.Parameter which triggered the -// error and the error itself. -// -// If the callback function returns false, the calling function should bail. -// -// If it returns true, the calling function should continue evaluating parameters. -// A nil ErrorOnParamFunc must be evaluated as equivalent to panic(). -type ErrorOnParamFunc func(spec.Parameter, error) bool - -func (s *Spec) paramsAsMap(parameters []spec.Parameter, res map[string]spec.Parameter, callmeOnError ErrorOnParamFunc) { - for _, param := range parameters { - pr := param - if pr.Ref.String() == "" { - res[mapKeyFromParam(&pr)] = pr - - continue - } - - // resolve $ref - if callmeOnError == nil { - callmeOnError = func(_ spec.Parameter, err error) bool { - panic(err) - } - } - - obj, _, err := pr.Ref.GetPointer().Get(s.spec) - if err != nil { - if callmeOnError(param, fmt.Errorf("invalid reference: %q", pr.Ref.String())) { - continue - } - - break - } - - objAsParam, ok := obj.(spec.Parameter) - if !ok { - if callmeOnError(param, fmt.Errorf("resolved reference is not a parameter: %q", pr.Ref.String())) { - continue - } - - break - } - - pr = objAsParam - res[mapKeyFromParam(&pr)] = pr - } -} - -// ParametersFor the specified operation id. -// -// Assumes parameters properly resolve references if any and that -// such references actually resolve to a parameter object. -// Otherwise, panics. -func (s *Spec) ParametersFor(operationID string) []spec.Parameter { - return s.SafeParametersFor(operationID, nil) -} - -// SafeParametersFor the specified operation id. -// -// Does not assume parameters properly resolve references or that -// such references actually resolve to a parameter object. -// -// Upon error, invoke a ErrorOnParamFunc callback with the erroneous -// parameters. If the callback is set to nil, panics upon errors. -func (s *Spec) SafeParametersFor(operationID string, callmeOnError ErrorOnParamFunc) []spec.Parameter { - gatherParams := func(pi *spec.PathItem, op *spec.Operation) []spec.Parameter { - bag := make(map[string]spec.Parameter) - s.paramsAsMap(pi.Parameters, bag, callmeOnError) - s.paramsAsMap(op.Parameters, bag, callmeOnError) - - var res []spec.Parameter - for _, v := range bag { - res = append(res, v) - } - - return res - } - - for _, pi := range s.spec.Paths.Paths { - if pi.Get != nil && pi.Get.ID == operationID { - return gatherParams(&pi, pi.Get) //#nosec - } - if pi.Head != nil && pi.Head.ID == operationID { - return gatherParams(&pi, pi.Head) //#nosec - } - if pi.Options != nil && pi.Options.ID == operationID { - return gatherParams(&pi, pi.Options) //#nosec - } - if pi.Post != nil && pi.Post.ID == operationID { - return gatherParams(&pi, pi.Post) //#nosec - } - if pi.Patch != nil && pi.Patch.ID == operationID { - return gatherParams(&pi, pi.Patch) //#nosec - } - if pi.Put != nil && pi.Put.ID == operationID { - return gatherParams(&pi, pi.Put) //#nosec - } - if pi.Delete != nil && pi.Delete.ID == operationID { - return gatherParams(&pi, pi.Delete) //#nosec - } - } - - return nil -} - -// ParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that -// apply for the method and path. -// -// Assumes parameters properly resolve references if any and that -// such references actually resolve to a parameter object. -// Otherwise, panics. -func (s *Spec) ParamsFor(method, path string) map[string]spec.Parameter { - return s.SafeParamsFor(method, path, nil) -} - -// SafeParamsFor the specified method and path. Aggregates them with the defaults etc, so it's all the params that -// apply for the method and path. -// -// Does not assume parameters properly resolve references or that -// such references actually resolve to a parameter object. -// -// Upon error, invoke a ErrorOnParamFunc callback with the erroneous -// parameters. If the callback is set to nil, panics upon errors. -func (s *Spec) SafeParamsFor(method, path string, callmeOnError ErrorOnParamFunc) map[string]spec.Parameter { - res := make(map[string]spec.Parameter) - if pi, ok := s.spec.Paths.Paths[path]; ok { - s.paramsAsMap(pi.Parameters, res, callmeOnError) - s.paramsAsMap(s.operations[strings.ToUpper(method)][path].Parameters, res, callmeOnError) - } - - return res -} - -// OperationForName gets the operation for the given id -func (s *Spec) OperationForName(operationID string) (string, string, *spec.Operation, bool) { - for method, pathItem := range s.operations { - for path, op := range pathItem { - if operationID == op.ID { - return method, path, op, true - } - } - } - - return "", "", nil, false -} - -// OperationFor the given method and path -func (s *Spec) OperationFor(method, path string) (*spec.Operation, bool) { - if mp, ok := s.operations[strings.ToUpper(method)]; ok { - op, fn := mp[path] - - return op, fn - } - - return nil, false -} - -// Operations gathers all the operations specified in the spec document -func (s *Spec) Operations() map[string]map[string]*spec.Operation { - return s.operations -} - -func (s *Spec) structMapKeys(mp map[string]struct{}) []string { - if len(mp) == 0 { - return nil - } - - result := make([]string, 0, len(mp)) - for k := range mp { - result = append(result, k) - } - - return result -} - -// AllPaths returns all the paths in the swagger spec -func (s *Spec) AllPaths() map[string]spec.PathItem { - if s.spec == nil || s.spec.Paths == nil { - return nil - } - - return s.spec.Paths.Paths -} - -// OperationIDs gets all the operation ids based on method an dpath -func (s *Spec) OperationIDs() []string { - if len(s.operations) == 0 { - return nil - } - - result := make([]string, 0, len(s.operations)) - for method, v := range s.operations { - for p, o := range v { - if o.ID != "" { - result = append(result, o.ID) - } else { - result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p)) - } - } - } - - return result -} - -// OperationMethodPaths gets all the operation ids based on method an dpath -func (s *Spec) OperationMethodPaths() []string { - if len(s.operations) == 0 { - return nil - } - - result := make([]string, 0, len(s.operations)) - for method, v := range s.operations { - for p := range v { - result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p)) - } - } - - return result -} - -// RequiredConsumes gets all the distinct consumes that are specified in the specification document -func (s *Spec) RequiredConsumes() []string { - return s.structMapKeys(s.consumes) -} - -// RequiredProduces gets all the distinct produces that are specified in the specification document -func (s *Spec) RequiredProduces() []string { - return s.structMapKeys(s.produces) -} - -// RequiredSecuritySchemes gets all the distinct security schemes that are specified in the swagger spec -func (s *Spec) RequiredSecuritySchemes() []string { - return s.structMapKeys(s.authSchemes) -} - -// SchemaRef is a reference to a schema -type SchemaRef struct { - Name string - Ref spec.Ref - Schema *spec.Schema - TopLevel bool -} - -// SchemasWithAllOf returns schema references to all schemas that are defined -// with an allOf key -func (s *Spec) SchemasWithAllOf() (result []SchemaRef) { - for _, v := range s.allOfs { - result = append(result, v) - } - - return -} - -// AllDefinitions returns schema references for all the definitions that were discovered -func (s *Spec) AllDefinitions() (result []SchemaRef) { - for _, v := range s.allSchemas { - result = append(result, v) - } - - return -} - -// AllDefinitionReferences returns json refs for all the discovered schemas -func (s *Spec) AllDefinitionReferences() (result []string) { - for _, v := range s.references.schemas { - result = append(result, v.String()) - } - - return -} - -// AllParameterReferences returns json refs for all the discovered parameters -func (s *Spec) AllParameterReferences() (result []string) { - for _, v := range s.references.parameters { - result = append(result, v.String()) - } - - return -} - -// AllResponseReferences returns json refs for all the discovered responses -func (s *Spec) AllResponseReferences() (result []string) { - for _, v := range s.references.responses { - result = append(result, v.String()) - } - - return -} - -// AllPathItemReferences returns the references for all the items -func (s *Spec) AllPathItemReferences() (result []string) { - for _, v := range s.references.pathItems { - result = append(result, v.String()) - } - - return -} - -// AllItemsReferences returns the references for all the items in simple schemas (parameters or headers). -// -// NOTE: since Swagger 2.0 forbids $ref in simple params, this should always yield an empty slice for a valid -// Swagger 2.0 spec. -func (s *Spec) AllItemsReferences() (result []string) { - for _, v := range s.references.items { - result = append(result, v.String()) - } - - return -} - -// AllReferences returns all the references found in the document, with possible duplicates -func (s *Spec) AllReferences() (result []string) { - for _, v := range s.references.allRefs { - result = append(result, v.String()) - } - - return -} - -// AllRefs returns all the unique references found in the document -func (s *Spec) AllRefs() (result []spec.Ref) { - set := make(map[string]struct{}) - for _, v := range s.references.allRefs { - a := v.String() - if a == "" { - continue - } - - if _, ok := set[a]; !ok { - set[a] = struct{}{} - result = append(result, v) - } - } - - return -} - -func cloneStringMap(source map[string]string) map[string]string { - res := make(map[string]string, len(source)) - for k, v := range source { - res[k] = v - } - - return res -} - -func cloneEnumMap(source map[string][]interface{}) map[string][]interface{} { - res := make(map[string][]interface{}, len(source)) - for k, v := range source { - res[k] = v - } - - return res -} - -// ParameterPatterns returns all the patterns found in parameters -// the map is cloned to avoid accidental changes -func (s *Spec) ParameterPatterns() map[string]string { - return cloneStringMap(s.patterns.parameters) -} - -// HeaderPatterns returns all the patterns found in response headers -// the map is cloned to avoid accidental changes -func (s *Spec) HeaderPatterns() map[string]string { - return cloneStringMap(s.patterns.headers) -} - -// ItemsPatterns returns all the patterns found in simple array items -// the map is cloned to avoid accidental changes -func (s *Spec) ItemsPatterns() map[string]string { - return cloneStringMap(s.patterns.items) -} - -// SchemaPatterns returns all the patterns found in schemas -// the map is cloned to avoid accidental changes -func (s *Spec) SchemaPatterns() map[string]string { - return cloneStringMap(s.patterns.schemas) -} - -// AllPatterns returns all the patterns found in the spec -// the map is cloned to avoid accidental changes -func (s *Spec) AllPatterns() map[string]string { - return cloneStringMap(s.patterns.allPatterns) -} - -// ParameterEnums returns all the enums found in parameters -// the map is cloned to avoid accidental changes -func (s *Spec) ParameterEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.parameters) -} - -// HeaderEnums returns all the enums found in response headers -// the map is cloned to avoid accidental changes -func (s *Spec) HeaderEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.headers) -} - -// ItemsEnums returns all the enums found in simple array items -// the map is cloned to avoid accidental changes -func (s *Spec) ItemsEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.items) -} - -// SchemaEnums returns all the enums found in schemas -// the map is cloned to avoid accidental changes -func (s *Spec) SchemaEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.schemas) -} - -// AllEnums returns all the enums found in the spec -// the map is cloned to avoid accidental changes -func (s *Spec) AllEnums() map[string][]interface{} { - return cloneEnumMap(s.enums.allEnums) -} diff --git a/vendor/github.com/go-openapi/analysis/appveyor.yml b/vendor/github.com/go-openapi/analysis/appveyor.yml deleted file mode 100644 index c2f6fd733a..0000000000 --- a/vendor/github.com/go-openapi/analysis/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: "0.1.{build}" - -clone_folder: C:\go-openapi\analysis -shallow_clone: true # for startup speed -pull_requests: - do_not_increment_build_number: true - -#skip_tags: true -#skip_branch_with_pr: true - -# appveyor.yml -build: off - -environment: - GOPATH: c:\gopath - -stack: go 1.16 - -test_script: - - go test -v -timeout 20m ./... - -deploy: off - -notifications: - - provider: Slack - incoming_webhook: https://hooks.slack.com/services/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 - auth_token: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= - channel: bots - on_build_success: false - on_build_failure: true - on_build_status_changed: true diff --git a/vendor/github.com/go-openapi/analysis/debug.go b/vendor/github.com/go-openapi/analysis/debug.go deleted file mode 100644 index 33c15704ec..0000000000 --- a/vendor/github.com/go-openapi/analysis/debug.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "os" - - "github.com/go-openapi/analysis/internal/debug" -) - -var debugLog = debug.GetLogger("analysis", os.Getenv("SWAGGER_DEBUG") != "") diff --git a/vendor/github.com/go-openapi/analysis/doc.go b/vendor/github.com/go-openapi/analysis/doc.go deleted file mode 100644 index d5294c0950..0000000000 --- a/vendor/github.com/go-openapi/analysis/doc.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package analysis provides methods to work with a Swagger specification document from -package go-openapi/spec. - -Analyzing a specification - -An analysed specification object (type Spec) provides methods to work with swagger definition. - -Flattening or expanding a specification - -Flattening a specification bundles all remote $ref in the main spec document. -Depending on flattening options, additional preprocessing may take place: - - full flattening: replacing all inline complex constructs by a named entry in #/definitions - - expand: replace all $ref's in the document by their expanded content - -Merging several specifications - -Mixin several specifications merges all Swagger constructs, and warns about found conflicts. - -Fixing a specification - -Unmarshalling a specification with golang json unmarshalling may lead to -some unwanted result on present but empty fields. - -Analyzing a Swagger schema - -Swagger schemas are analyzed to determine their complexity and qualify their content. -*/ -package analysis diff --git a/vendor/github.com/go-openapi/analysis/fixer.go b/vendor/github.com/go-openapi/analysis/fixer.go deleted file mode 100644 index 7c2ca08416..0000000000 --- a/vendor/github.com/go-openapi/analysis/fixer.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import "github.com/go-openapi/spec" - -// FixEmptyResponseDescriptions replaces empty ("") response -// descriptions in the input with "(empty)" to ensure that the -// resulting Swagger is stays valid. The problem appears to arise -// from reading in valid specs that have a explicit response -// description of "" (valid, response.description is required), but -// due to zero values being omitted upon re-serializing (omitempty) we -// lose them unless we stick some chars in there. -func FixEmptyResponseDescriptions(s *spec.Swagger) { - for k, v := range s.Responses { - FixEmptyDesc(&v) //#nosec - s.Responses[k] = v - } - - if s.Paths == nil { - return - } - - for _, v := range s.Paths.Paths { - if v.Get != nil { - FixEmptyDescs(v.Get.Responses) - } - if v.Put != nil { - FixEmptyDescs(v.Put.Responses) - } - if v.Post != nil { - FixEmptyDescs(v.Post.Responses) - } - if v.Delete != nil { - FixEmptyDescs(v.Delete.Responses) - } - if v.Options != nil { - FixEmptyDescs(v.Options.Responses) - } - if v.Head != nil { - FixEmptyDescs(v.Head.Responses) - } - if v.Patch != nil { - FixEmptyDescs(v.Patch.Responses) - } - } -} - -// FixEmptyDescs adds "(empty)" as the description for any Response in -// the given Responses object that doesn't already have one. -func FixEmptyDescs(rs *spec.Responses) { - FixEmptyDesc(rs.Default) - for k, v := range rs.StatusCodeResponses { - FixEmptyDesc(&v) //#nosec - rs.StatusCodeResponses[k] = v - } -} - -// FixEmptyDesc adds "(empty)" as the description to the given -// Response object if it doesn't already have one and isn't a -// ref. No-op on nil input. -func FixEmptyDesc(rs *spec.Response) { - if rs == nil || rs.Description != "" || rs.Ref.Ref.GetURL() != nil { - return - } - rs.Description = "(empty)" -} diff --git a/vendor/github.com/go-openapi/analysis/flatten.go b/vendor/github.com/go-openapi/analysis/flatten.go deleted file mode 100644 index 0576220fb3..0000000000 --- a/vendor/github.com/go-openapi/analysis/flatten.go +++ /dev/null @@ -1,802 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - "log" - "path" - "sort" - "strings" - - "github.com/go-openapi/analysis/internal/flatten/normalize" - "github.com/go-openapi/analysis/internal/flatten/operations" - "github.com/go-openapi/analysis/internal/flatten/replace" - "github.com/go-openapi/analysis/internal/flatten/schutils" - "github.com/go-openapi/analysis/internal/flatten/sortref" - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" -) - -const definitionsPath = "#/definitions" - -// newRef stores information about refs created during the flattening process -type newRef struct { - key string - newName string - path string - isOAIGen bool - resolved bool - schema *spec.Schema - parents []string -} - -// context stores intermediary results from flatten -type context struct { - newRefs map[string]*newRef - warnings []string - resolved map[string]string -} - -func newContext() *context { - return &context{ - newRefs: make(map[string]*newRef, 150), - warnings: make([]string, 0), - resolved: make(map[string]string, 50), - } -} - -// Flatten an analyzed spec and produce a self-contained spec bundle. -// -// There is a minimal and a full flattening mode. -// -// -// Minimally flattening a spec means: -// - Expanding parameters, responses, path items, parameter items and header items (references to schemas are left -// unscathed) -// - Importing external (http, file) references so they become internal to the document -// - Moving every JSON pointer to a $ref to a named definition (i.e. the reworked spec does not contain pointers -// like "$ref": "#/definitions/myObject/allOfs/1") -// -// A minimally flattened spec thus guarantees the following properties: -// - all $refs point to a local definition (i.e. '#/definitions/...') -// - definitions are unique -// -// NOTE: arbitrary JSON pointers (other than $refs to top level definitions) are rewritten as definitions if they -// represent a complex schema or express commonality in the spec. -// Otherwise, they are simply expanded. -// Self-referencing JSON pointers cannot resolve to a type and trigger an error. -// -// -// Minimal flattening is necessary and sufficient for codegen rendering using go-swagger. -// -// Fully flattening a spec means: -// - Moving every complex inline schema to be a definition with an auto-generated name in a depth-first fashion. -// -// By complex, we mean every JSON object with some properties. -// Arrays, when they do not define a tuple, -// or empty objects with or without additionalProperties, are not considered complex and remain inline. -// -// NOTE: rewritten schemas get a vendor extension x-go-gen-location so we know from which part of the spec definitions -// have been created. -// -// Available flattening options: -// - Minimal: stops flattening after minimal $ref processing, leaving schema constructs untouched -// - Expand: expand all $ref's in the document (inoperant if Minimal set to true) -// - Verbose: croaks about name conflicts detected -// - RemoveUnused: removes unused parameters, responses and definitions after expansion/flattening -// -// NOTE: expansion removes all $ref save circular $ref, which remain in place -// -// TODO: additional options -// - ProgagateNameExtensions: ensure that created entries properly follow naming rules when their parent have set a -// x-go-name extension -// - LiftAllOfs: -// - limit the flattening of allOf members when simple objects -// - merge allOf with validation only -// - merge allOf with extensions only -// - ... -// -func Flatten(opts FlattenOpts) error { - debugLog("FlattenOpts: %#v", opts) - - opts.flattenContext = newContext() - - // 1. Recursively expand responses, parameters, path items and items in simple schemas. - // - // This simplifies the spec and leaves only the $ref's in schema objects. - if err := expand(&opts); err != nil { - return err - } - - // 2. Strip the current document from absolute $ref's that actually a in the root, - // so we can recognize them as proper definitions - // - // In particular, this works around issue go-openapi/spec#76: leading absolute file in $ref is stripped - if err := normalizeRef(&opts); err != nil { - return err - } - - // 3. Optionally remove shared parameters and responses already expanded (now unused). - // - // Operation parameters (i.e. under paths) remain. - if opts.RemoveUnused { - removeUnusedShared(&opts) - } - - // 4. Import all remote references. - if err := importReferences(&opts); err != nil { - return err - } - - // 5. full flattening: rewrite inline schemas (schemas that aren't simple types or arrays or maps) - if !opts.Minimal && !opts.Expand { - if err := nameInlinedSchemas(&opts); err != nil { - return err - } - } - - // 6. Rewrite JSON pointers other than $ref to named definitions - // and attempt to resolve conflicting names whenever possible. - if err := stripPointersAndOAIGen(&opts); err != nil { - return err - } - - // 7. Strip the spec from unused definitions - if opts.RemoveUnused { - removeUnused(&opts) - } - - // 8. Issue warning notifications, if any - opts.croak() - - // TODO: simplify known schema patterns to flat objects with properties - // examples: - // - lift simple allOf object, - // - empty allOf with validation only or extensions only - // - rework allOf arrays - // - rework allOf additionalProperties - - return nil -} - -func expand(opts *FlattenOpts) error { - if err := spec.ExpandSpec(opts.Swagger(), opts.ExpandOpts(!opts.Expand)); err != nil { - return err - } - - opts.Spec.reload() // re-analyze - - return nil -} - -// normalizeRef strips the current file from any absolute file $ref. This works around issue go-openapi/spec#76: -// leading absolute file in $ref is stripped -func normalizeRef(opts *FlattenOpts) error { - debugLog("normalizeRef") - - altered := false - for k, w := range opts.Spec.references.allRefs { - if !strings.HasPrefix(w.String(), opts.BasePath+definitionsPath) { // may be a mix of / and \, depending on OS - continue - } - - altered = true - debugLog("stripping absolute path for: %s", w.String()) - - // strip the base path from definition - if err := replace.UpdateRef(opts.Swagger(), k, - spec.MustCreateRef(path.Join(definitionsPath, path.Base(w.String())))); err != nil { - return err - } - } - - if altered { - opts.Spec.reload() // re-analyze - } - - return nil -} - -func removeUnusedShared(opts *FlattenOpts) { - opts.Swagger().Parameters = nil - opts.Swagger().Responses = nil - - opts.Spec.reload() // re-analyze -} - -func importReferences(opts *FlattenOpts) error { - var ( - imported bool - err error - ) - - for !imported && err == nil { - // iteratively import remote references until none left. - // This inlining deals with name conflicts by introducing auto-generated names ("OAIGen") - imported, err = importExternalReferences(opts) - - opts.Spec.reload() // re-analyze - } - - return err -} - -// nameInlinedSchemas replaces every complex inline construct by a named definition. -func nameInlinedSchemas(opts *FlattenOpts) error { - debugLog("nameInlinedSchemas") - - namer := &InlineSchemaNamer{ - Spec: opts.Swagger(), - Operations: operations.AllOpRefsByRef(opts.Spec, nil), - flattenContext: opts.flattenContext, - opts: opts, - } - - depthFirst := sortref.DepthFirst(opts.Spec.allSchemas) - for _, key := range depthFirst { - sch := opts.Spec.allSchemas[key] - if sch.Schema == nil || sch.Schema.Ref.String() != "" || sch.TopLevel { - continue - } - - asch, err := Schema(SchemaOpts{Schema: sch.Schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if err != nil { - return fmt.Errorf("schema analysis [%s]: %w", key, err) - } - - if asch.isAnalyzedAsComplex() { // move complex schemas to definitions - if err := namer.Name(key, sch.Schema, asch); err != nil { - return err - } - } - } - - opts.Spec.reload() // re-analyze - - return nil -} - -func removeUnused(opts *FlattenOpts) { - expected := make(map[string]struct{}) - for k := range opts.Swagger().Definitions { - expected[path.Join(definitionsPath, jsonpointer.Escape(k))] = struct{}{} - } - - for _, k := range opts.Spec.AllDefinitionReferences() { - delete(expected, k) - } - - for k := range expected { - debugLog("removing unused definition %s", path.Base(k)) - if opts.Verbose { - log.Printf("info: removing unused definition: %s", path.Base(k)) - } - delete(opts.Swagger().Definitions, path.Base(k)) - } - - opts.Spec.reload() // re-analyze -} - -func importKnownRef(entry sortref.RefRevIdx, refStr, newName string, opts *FlattenOpts) error { - // rewrite ref with already resolved external ref (useful for cyclical refs): - // rewrite external refs to local ones - debugLog("resolving known ref [%s] to %s", refStr, newName) - - for _, key := range entry.Keys { - if err := replace.UpdateRef(opts.Swagger(), key, spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil { - return err - } - } - - return nil -} - -func importNewRef(entry sortref.RefRevIdx, refStr string, opts *FlattenOpts) error { - var ( - isOAIGen bool - newName string - ) - - debugLog("resolving schema from remote $ref [%s]", refStr) - - sch, err := spec.ResolveRefWithBase(opts.Swagger(), &entry.Ref, opts.ExpandOpts(false)) - if err != nil { - return fmt.Errorf("could not resolve schema: %w", err) - } - - // at this stage only $ref analysis matters - partialAnalyzer := &Spec{ - references: referenceAnalysis{}, - patterns: patternAnalysis{}, - enums: enumAnalysis{}, - } - partialAnalyzer.reset() - partialAnalyzer.analyzeSchema("", sch, "/") - - // now rewrite those refs with rebase - for key, ref := range partialAnalyzer.references.allRefs { - if err := replace.UpdateRef(sch, key, spec.MustCreateRef(normalize.RebaseRef(entry.Ref.String(), ref.String()))); err != nil { - return fmt.Errorf("failed to rewrite ref for key %q at %s: %w", key, entry.Ref.String(), err) - } - } - - // generate a unique name - isOAIGen means that a naming conflict was resolved by changing the name - newName, isOAIGen = uniqifyName(opts.Swagger().Definitions, nameFromRef(entry.Ref)) - debugLog("new name for [%s]: %s - with name conflict:%t", strings.Join(entry.Keys, ", "), newName, isOAIGen) - - opts.flattenContext.resolved[refStr] = newName - - // rewrite the external refs to local ones - for _, key := range entry.Keys { - if err := replace.UpdateRef(opts.Swagger(), key, - spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil { - return err - } - - // keep track of created refs - resolved := false - if _, ok := opts.flattenContext.newRefs[key]; ok { - resolved = opts.flattenContext.newRefs[key].resolved - } - - debugLog("keeping track of ref: %s (%s), resolved: %t", key, newName, resolved) - opts.flattenContext.newRefs[key] = &newRef{ - key: key, - newName: newName, - path: path.Join(definitionsPath, newName), - isOAIGen: isOAIGen, - resolved: resolved, - schema: sch, - } - } - - // add the resolved schema to the definitions - schutils.Save(opts.Swagger(), newName, sch) - - return nil -} - -// importExternalReferences iteratively digs remote references and imports them into the main schema. -// -// At every iteration, new remotes may be found when digging deeper: they are rebased to the current schema before being imported. -// -// This returns true when no more remote references can be found. -func importExternalReferences(opts *FlattenOpts) (bool, error) { - debugLog("importExternalReferences") - - groupedRefs := sortref.ReverseIndex(opts.Spec.references.schemas, opts.BasePath) - sortedRefStr := make([]string, 0, len(groupedRefs)) - if opts.flattenContext == nil { - opts.flattenContext = newContext() - } - - // sort $ref resolution to ensure deterministic name conflict resolution - for refStr := range groupedRefs { - sortedRefStr = append(sortedRefStr, refStr) - } - sort.Strings(sortedRefStr) - - complete := true - - for _, refStr := range sortedRefStr { - entry := groupedRefs[refStr] - if entry.Ref.HasFragmentOnly { - continue - } - - complete = false - - newName := opts.flattenContext.resolved[refStr] - if newName != "" { - if err := importKnownRef(entry, refStr, newName, opts); err != nil { - return false, err - } - - continue - } - - // resolve schemas - if err := importNewRef(entry, refStr, opts); err != nil { - return false, err - } - } - - // maintains ref index entries - for k := range opts.flattenContext.newRefs { - r := opts.flattenContext.newRefs[k] - - // update tracking with resolved schemas - if r.schema.Ref.String() != "" { - ref := spec.MustCreateRef(r.path) - sch, err := spec.ResolveRefWithBase(opts.Swagger(), &ref, opts.ExpandOpts(false)) - if err != nil { - return false, fmt.Errorf("could not resolve schema: %w", err) - } - - r.schema = sch - } - - if r.path == k { - continue - } - - // update tracking with renamed keys: got a cascade of refs - renamed := *r - renamed.key = r.path - opts.flattenContext.newRefs[renamed.path] = &renamed - - // indirect ref - r.newName = path.Base(k) - r.schema = spec.RefSchema(r.path) - r.path = k - r.isOAIGen = strings.Contains(k, "OAIGen") - } - - return complete, nil -} - -// stripPointersAndOAIGen removes anonymous JSON pointers from spec and chain with name conflicts handler. -// This loops until the spec has no such pointer and all name conflicts have been reduced as much as possible. -func stripPointersAndOAIGen(opts *FlattenOpts) error { - // name all JSON pointers to anonymous documents - if err := namePointers(opts); err != nil { - return err - } - - // remove unnecessary OAIGen ref (created when flattening external refs creates name conflicts) - hasIntroducedPointerOrInline, ers := stripOAIGen(opts) - if ers != nil { - return ers - } - - // iterate as pointer or OAIGen resolution may introduce inline schemas or pointers - for hasIntroducedPointerOrInline { - if !opts.Minimal { - opts.Spec.reload() // re-analyze - if err := nameInlinedSchemas(opts); err != nil { - return err - } - } - - if err := namePointers(opts); err != nil { - return err - } - - // restrip and re-analyze - var err error - if hasIntroducedPointerOrInline, err = stripOAIGen(opts); err != nil { - return err - } - } - - return nil -} - -// stripOAIGen strips the spec from unnecessary OAIGen constructs, initially created to dedupe flattened definitions. -// -// A dedupe is deemed unnecessary whenever: -// - the only conflict is with its (single) parent: OAIGen is merged into its parent (reinlining) -// - there is a conflict with multiple parents: merge OAIGen in first parent, the rewrite other parents to point to -// the first parent. -// -// This function returns true whenever it re-inlined a complex schema, so the caller may chose to iterate -// pointer and name resolution again. -func stripOAIGen(opts *FlattenOpts) (bool, error) { - debugLog("stripOAIGen") - replacedWithComplex := false - - // figure out referers of OAIGen definitions (doing it before the ref start mutating) - for _, r := range opts.flattenContext.newRefs { - updateRefParents(opts.Spec.references.allRefs, r) - } - - for k := range opts.flattenContext.newRefs { - r := opts.flattenContext.newRefs[k] - debugLog("newRefs[%s]: isOAIGen: %t, resolved: %t, name: %s, path:%s, #parents: %d, parents: %v, ref: %s", - k, r.isOAIGen, r.resolved, r.newName, r.path, len(r.parents), r.parents, r.schema.Ref.String()) - - if !r.isOAIGen || len(r.parents) == 0 { - continue - } - - hasReplacedWithComplex, err := stripOAIGenForRef(opts, k, r) - if err != nil { - return replacedWithComplex, err - } - - replacedWithComplex = replacedWithComplex || hasReplacedWithComplex - } - - debugLog("replacedWithComplex: %t", replacedWithComplex) - opts.Spec.reload() // re-analyze - - return replacedWithComplex, nil -} - -// updateRefParents updates all parents of an updated $ref -func updateRefParents(allRefs map[string]spec.Ref, r *newRef) { - if !r.isOAIGen || r.resolved { // bail on already resolved entries (avoid looping) - return - } - for k, v := range allRefs { - if r.path != v.String() { - continue - } - - found := false - for _, p := range r.parents { - if p == k { - found = true - - break - } - } - if !found { - r.parents = append(r.parents, k) - } - } -} - -func stripOAIGenForRef(opts *FlattenOpts, k string, r *newRef) (bool, error) { - replacedWithComplex := false - - pr := sortref.TopmostFirst(r.parents) - - // rewrite first parent schema in hierarchical then lexicographical order - debugLog("rewrite first parent %s with schema", pr[0]) - if err := replace.UpdateRefWithSchema(opts.Swagger(), pr[0], r.schema); err != nil { - return false, err - } - - if pa, ok := opts.flattenContext.newRefs[pr[0]]; ok && pa.isOAIGen { - // update parent in ref index entry - debugLog("update parent entry: %s", pr[0]) - pa.schema = r.schema - pa.resolved = false - replacedWithComplex = true - } - - // rewrite other parents to point to first parent - if len(pr) > 1 { - for _, p := range pr[1:] { - replacingRef := spec.MustCreateRef(pr[0]) - - // set complex when replacing ref is an anonymous jsonpointer: further processing may be required - replacedWithComplex = replacedWithComplex || path.Dir(replacingRef.String()) != definitionsPath - debugLog("rewrite parent with ref: %s", replacingRef.String()) - - // NOTE: it is possible at this stage to introduce json pointers (to non-definitions places). - // Those are stripped later on. - if err := replace.UpdateRef(opts.Swagger(), p, replacingRef); err != nil { - return false, err - } - - if pa, ok := opts.flattenContext.newRefs[p]; ok && pa.isOAIGen { - // update parent in ref index - debugLog("update parent entry: %s", p) - pa.schema = r.schema - pa.resolved = false - replacedWithComplex = true - } - } - } - - // remove OAIGen definition - debugLog("removing definition %s", path.Base(r.path)) - delete(opts.Swagger().Definitions, path.Base(r.path)) - - // propagate changes in ref index for keys which have this one as a parent - for kk, value := range opts.flattenContext.newRefs { - if kk == k || !value.isOAIGen || value.resolved { - continue - } - - found := false - newParents := make([]string, 0, len(value.parents)) - for _, parent := range value.parents { - switch { - case parent == r.path: - found = true - parent = pr[0] - case strings.HasPrefix(parent, r.path+"/"): - found = true - parent = path.Join(pr[0], strings.TrimPrefix(parent, r.path)) - } - - newParents = append(newParents, parent) - } - - if found { - value.parents = newParents - } - } - - // mark naming conflict as resolved - debugLog("marking naming conflict resolved for key: %s", r.key) - opts.flattenContext.newRefs[r.key].isOAIGen = false - opts.flattenContext.newRefs[r.key].resolved = true - - // determine if the previous substitution did inline a complex schema - if r.schema != nil && r.schema.Ref.String() == "" { // inline schema - asch, err := Schema(SchemaOpts{Schema: r.schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if err != nil { - return false, err - } - - debugLog("re-inlined schema: parent: %s, %t", pr[0], asch.isAnalyzedAsComplex()) - replacedWithComplex = replacedWithComplex || !(path.Dir(pr[0]) == definitionsPath) && asch.isAnalyzedAsComplex() - } - - return replacedWithComplex, nil -} - -// namePointers replaces all JSON pointers to anonymous documents by a $ref to a new named definitions. -// -// This is carried on depth-first. Pointers to $refs which are top level definitions are replaced by the $ref itself. -// Pointers to simple types are expanded, unless they express commonality (i.e. several such $ref are used). -func namePointers(opts *FlattenOpts) error { - debugLog("name pointers") - - refsToReplace := make(map[string]SchemaRef, len(opts.Spec.references.schemas)) - for k, ref := range opts.Spec.references.allRefs { - if path.Dir(ref.String()) == definitionsPath { - // this a ref to a top-level definition: ok - continue - } - - result, err := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), ref) - if err != nil { - return fmt.Errorf("at %s, %w", k, err) - } - - replacingRef := result.Ref - sch := result.Schema - if opts.flattenContext != nil { - opts.flattenContext.warnings = append(opts.flattenContext.warnings, result.Warnings...) - } - - debugLog("planning pointer to replace at %s: %s, resolved to: %s", k, ref.String(), replacingRef.String()) - refsToReplace[k] = SchemaRef{ - Name: k, // caller - Ref: replacingRef, // called - Schema: sch, - TopLevel: path.Dir(replacingRef.String()) == definitionsPath, - } - } - - depthFirst := sortref.DepthFirst(refsToReplace) - namer := &InlineSchemaNamer{ - Spec: opts.Swagger(), - Operations: operations.AllOpRefsByRef(opts.Spec, nil), - flattenContext: opts.flattenContext, - opts: opts, - } - - for _, key := range depthFirst { - v := refsToReplace[key] - // update current replacement, which may have been updated by previous changes of deeper elements - result, erd := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), v.Ref) - if erd != nil { - return fmt.Errorf("at %s, %w", key, erd) - } - - if opts.flattenContext != nil { - opts.flattenContext.warnings = append(opts.flattenContext.warnings, result.Warnings...) - } - - v.Ref = result.Ref - v.Schema = result.Schema - v.TopLevel = path.Dir(result.Ref.String()) == definitionsPath - debugLog("replacing pointer at %s: resolved to: %s", key, v.Ref.String()) - - if v.TopLevel { - debugLog("replace pointer %s by canonical definition: %s", key, v.Ref.String()) - - // if the schema is a $ref to a top level definition, just rewrite the pointer to this $ref - if err := replace.UpdateRef(opts.Swagger(), key, v.Ref); err != nil { - return err - } - - continue - } - - if err := flattenAnonPointer(key, v, refsToReplace, namer, opts); err != nil { - return err - } - } - - opts.Spec.reload() // re-analyze - - return nil -} - -func flattenAnonPointer(key string, v SchemaRef, refsToReplace map[string]SchemaRef, namer *InlineSchemaNamer, opts *FlattenOpts) error { - // this is a JSON pointer to an anonymous document (internal or external): - // create a definition for this schema when: - // - it is a complex schema - // - or it is pointed by more than one $ref (i.e. expresses commonality) - // otherwise, expand the pointer (single reference to a simple type) - // - // The named definition for this follows the target's key, not the caller's - debugLog("namePointers at %s for %s", key, v.Ref.String()) - - // qualify the expanded schema - asch, ers := Schema(SchemaOpts{Schema: v.Schema, Root: opts.Swagger(), BasePath: opts.BasePath}) - if ers != nil { - return fmt.Errorf("schema analysis [%s]: %w", key, ers) - } - callers := make([]string, 0, 64) - - debugLog("looking for callers") - - an := New(opts.Swagger()) - for k, w := range an.references.allRefs { - r, err := replace.DeepestRef(opts.Swagger(), opts.ExpandOpts(false), w) - if err != nil { - return fmt.Errorf("at %s, %w", key, err) - } - - if opts.flattenContext != nil { - opts.flattenContext.warnings = append(opts.flattenContext.warnings, r.Warnings...) - } - - if r.Ref.String() == v.Ref.String() { - callers = append(callers, k) - } - } - - debugLog("callers for %s: %d", v.Ref.String(), len(callers)) - if len(callers) == 0 { - // has already been updated and resolved - return nil - } - - parts := sortref.KeyParts(v.Ref.String()) - debugLog("number of callers for %s: %d", v.Ref.String(), len(callers)) - - // identifying edge case when the namer did nothing because we point to a non-schema object - // no definition is created and we expand the $ref for all callers - if (!asch.IsSimpleSchema || len(callers) > 1) && !parts.IsSharedParam() && !parts.IsSharedResponse() { - debugLog("replace JSON pointer at [%s] by definition: %s", key, v.Ref.String()) - if err := namer.Name(v.Ref.String(), v.Schema, asch); err != nil { - return err - } - - // regular case: we named the $ref as a definition, and we move all callers to this new $ref - for _, caller := range callers { - if caller == key { - continue - } - - // move $ref for next to resolve - debugLog("identified caller of %s at [%s]", v.Ref.String(), caller) - c := refsToReplace[caller] - c.Ref = v.Ref - refsToReplace[caller] = c - } - - return nil - } - - debugLog("expand JSON pointer for key=%s", key) - - if err := replace.UpdateRefWithSchema(opts.Swagger(), key, v.Schema); err != nil { - return err - } - // NOTE: there is no other caller to update - - return nil -} diff --git a/vendor/github.com/go-openapi/analysis/flatten_name.go b/vendor/github.com/go-openapi/analysis/flatten_name.go deleted file mode 100644 index 3ad2ccfbfd..0000000000 --- a/vendor/github.com/go-openapi/analysis/flatten_name.go +++ /dev/null @@ -1,293 +0,0 @@ -package analysis - -import ( - "fmt" - "path" - "sort" - "strings" - - "github.com/go-openapi/analysis/internal/flatten/operations" - "github.com/go-openapi/analysis/internal/flatten/replace" - "github.com/go-openapi/analysis/internal/flatten/schutils" - "github.com/go-openapi/analysis/internal/flatten/sortref" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -// InlineSchemaNamer finds a new name for an inlined type -type InlineSchemaNamer struct { - Spec *spec.Swagger - Operations map[string]operations.OpRef - flattenContext *context - opts *FlattenOpts -} - -// Name yields a new name for the inline schema -func (isn *InlineSchemaNamer) Name(key string, schema *spec.Schema, aschema *AnalyzedSchema) error { - debugLog("naming inlined schema at %s", key) - - parts := sortref.KeyParts(key) - for _, name := range namesFromKey(parts, aschema, isn.Operations) { - if name == "" { - continue - } - - // create unique name - newName, isOAIGen := uniqifyName(isn.Spec.Definitions, swag.ToJSONName(name)) - - // clone schema - sch := schutils.Clone(schema) - - // replace values on schema - if err := replace.RewriteSchemaToRef(isn.Spec, key, - spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil { - return fmt.Errorf("error while creating definition %q from inline schema: %w", newName, err) - } - - // rewrite any dependent $ref pointing to this place, - // when not already pointing to a top-level definition. - // - // NOTE: this is important if such referers use arbitrary JSON pointers. - an := New(isn.Spec) - for k, v := range an.references.allRefs { - r, erd := replace.DeepestRef(isn.opts.Swagger(), isn.opts.ExpandOpts(false), v) - if erd != nil { - return fmt.Errorf("at %s, %w", k, erd) - } - - if isn.opts.flattenContext != nil { - isn.opts.flattenContext.warnings = append(isn.opts.flattenContext.warnings, r.Warnings...) - } - - if r.Ref.String() != key && (r.Ref.String() != path.Join(definitionsPath, newName) || path.Dir(v.String()) == definitionsPath) { - continue - } - - debugLog("found a $ref to a rewritten schema: %s points to %s", k, v.String()) - - // rewrite $ref to the new target - if err := replace.UpdateRef(isn.Spec, k, - spec.MustCreateRef(path.Join(definitionsPath, newName))); err != nil { - return err - } - } - - // NOTE: this extension is currently not used by go-swagger (provided for information only) - sch.AddExtension("x-go-gen-location", GenLocation(parts)) - - // save cloned schema to definitions - schutils.Save(isn.Spec, newName, sch) - - // keep track of created refs - if isn.flattenContext == nil { - continue - } - - debugLog("track created ref: key=%s, newName=%s, isOAIGen=%t", key, newName, isOAIGen) - resolved := false - - if _, ok := isn.flattenContext.newRefs[key]; ok { - resolved = isn.flattenContext.newRefs[key].resolved - } - - isn.flattenContext.newRefs[key] = &newRef{ - key: key, - newName: newName, - path: path.Join(definitionsPath, newName), - isOAIGen: isOAIGen, - resolved: resolved, - schema: sch, - } - } - - return nil -} - -// uniqifyName yields a unique name for a definition -func uniqifyName(definitions spec.Definitions, name string) (string, bool) { - isOAIGen := false - if name == "" { - name = "oaiGen" - isOAIGen = true - } - - if len(definitions) == 0 { - return name, isOAIGen - } - - unq := true - for k := range definitions { - if strings.EqualFold(k, name) { - unq = false - - break - } - } - - if unq { - return name, isOAIGen - } - - name += "OAIGen" - isOAIGen = true - var idx int - unique := name - _, known := definitions[unique] - - for known { - idx++ - unique = fmt.Sprintf("%s%d", name, idx) - _, known = definitions[unique] - } - - return unique, isOAIGen -} - -func namesFromKey(parts sortref.SplitKey, aschema *AnalyzedSchema, operations map[string]operations.OpRef) []string { - var ( - baseNames [][]string - startIndex int - ) - - if parts.IsOperation() { - baseNames, startIndex = namesForOperation(parts, operations) - } - - // definitions - if parts.IsDefinition() { - baseNames, startIndex = namesForDefinition(parts) - } - - result := make([]string, 0, len(baseNames)) - for _, segments := range baseNames { - nm := parts.BuildName(segments, startIndex, partAdder(aschema)) - if nm == "" { - continue - } - - result = append(result, nm) - } - sort.Strings(result) - - return result -} - -func namesForParam(parts sortref.SplitKey, operations map[string]operations.OpRef) ([][]string, int) { - var ( - baseNames [][]string - startIndex int - ) - - piref := parts.PathItemRef() - if piref.String() != "" && parts.IsOperationParam() { - if op, ok := operations[piref.String()]; ok { - startIndex = 5 - baseNames = append(baseNames, []string{op.ID, "params", "body"}) - } - } else if parts.IsSharedOperationParam() { - pref := parts.PathRef() - for k, v := range operations { - if strings.HasPrefix(k, pref.String()) { - startIndex = 4 - baseNames = append(baseNames, []string{v.ID, "params", "body"}) - } - } - } - - return baseNames, startIndex -} - -func namesForOperation(parts sortref.SplitKey, operations map[string]operations.OpRef) ([][]string, int) { - var ( - baseNames [][]string - startIndex int - ) - - // params - if parts.IsOperationParam() || parts.IsSharedOperationParam() { - baseNames, startIndex = namesForParam(parts, operations) - } - - // responses - if parts.IsOperationResponse() { - piref := parts.PathItemRef() - if piref.String() != "" { - if op, ok := operations[piref.String()]; ok { - startIndex = 6 - baseNames = append(baseNames, []string{op.ID, parts.ResponseName(), "body"}) - } - } - } - - return baseNames, startIndex -} - -func namesForDefinition(parts sortref.SplitKey) ([][]string, int) { - nm := parts.DefinitionName() - if nm != "" { - return [][]string{{parts.DefinitionName()}}, 2 - } - - return [][]string{}, 0 -} - -// partAdder knows how to interpret a schema when it comes to build a name from parts -func partAdder(aschema *AnalyzedSchema) sortref.PartAdder { - return func(part string) []string { - segments := make([]string, 0, 2) - - if part == "items" || part == "additionalItems" { - if aschema.IsTuple || aschema.IsTupleWithExtra { - segments = append(segments, "tuple") - } else { - segments = append(segments, "items") - } - - if part == "additionalItems" { - segments = append(segments, part) - } - - return segments - } - - segments = append(segments, part) - - return segments - } -} - -func nameFromRef(ref spec.Ref) string { - u := ref.GetURL() - if u.Fragment != "" { - return swag.ToJSONName(path.Base(u.Fragment)) - } - - if u.Path != "" { - bn := path.Base(u.Path) - if bn != "" && bn != "/" { - ext := path.Ext(bn) - if ext != "" { - return swag.ToJSONName(bn[:len(bn)-len(ext)]) - } - - return swag.ToJSONName(bn) - } - } - - return swag.ToJSONName(strings.ReplaceAll(u.Host, ".", " ")) -} - -// GenLocation indicates from which section of the specification (models or operations) a definition has been created. -// -// This is reflected in the output spec with a "x-go-gen-location" extension. At the moment, this is is provided -// for information only. -func GenLocation(parts sortref.SplitKey) string { - switch { - case parts.IsOperation(): - return "operations" - case parts.IsDefinition(): - return "models" - default: - return "" - } -} diff --git a/vendor/github.com/go-openapi/analysis/flatten_options.go b/vendor/github.com/go-openapi/analysis/flatten_options.go deleted file mode 100644 index c5bb97b0a6..0000000000 --- a/vendor/github.com/go-openapi/analysis/flatten_options.go +++ /dev/null @@ -1,78 +0,0 @@ -package analysis - -import ( - "log" - - "github.com/go-openapi/spec" -) - -// FlattenOpts configuration for flattening a swagger specification. -// -// The BasePath parameter is used to locate remote relative $ref found in the specification. -// This path is a file: it points to the location of the root document and may be either a local -// file path or a URL. -// -// If none specified, relative references (e.g. "$ref": "folder/schema.yaml#/definitions/...") -// found in the spec are searched from the current working directory. -type FlattenOpts struct { - Spec *Spec // The analyzed spec to work with - flattenContext *context // Internal context to track flattening activity - - BasePath string // The location of the root document for this spec to resolve relative $ref - - // Flattening options - Expand bool // When true, skip flattening the spec and expand it instead (if Minimal is false) - Minimal bool // When true, do not decompose complex structures such as allOf - Verbose bool // enable some reporting on possible name conflicts detected - RemoveUnused bool // When true, remove unused parameters, responses and definitions after expansion/flattening - ContinueOnError bool // Continue when spec expansion issues are found - - /* Extra keys */ - _ struct{} // require keys -} - -// ExpandOpts creates a spec.ExpandOptions to configure expanding a specification document. -func (f *FlattenOpts) ExpandOpts(skipSchemas bool) *spec.ExpandOptions { - return &spec.ExpandOptions{ - RelativeBase: f.BasePath, - SkipSchemas: skipSchemas, - ContinueOnError: f.ContinueOnError, - } -} - -// Swagger gets the swagger specification for this flatten operation -func (f *FlattenOpts) Swagger() *spec.Swagger { - return f.Spec.spec -} - -// croak logs notifications and warnings about valid, but possibly unwanted constructs resulting -// from flattening a spec -func (f *FlattenOpts) croak() { - if !f.Verbose { - return - } - - reported := make(map[string]bool, len(f.flattenContext.newRefs)) - for _, v := range f.Spec.references.allRefs { - // warns about duplicate handling - for _, r := range f.flattenContext.newRefs { - if r.isOAIGen && r.path == v.String() { - reported[r.newName] = true - } - } - } - - for k := range reported { - log.Printf("warning: duplicate flattened definition name resolved as %s", k) - } - - // warns about possible type mismatches - uniqueMsg := make(map[string]bool) - for _, msg := range f.flattenContext.warnings { - if _, ok := uniqueMsg[msg]; ok { - continue - } - log.Printf("warning: %s", msg) - uniqueMsg[msg] = true - } -} diff --git a/vendor/github.com/go-openapi/analysis/internal/debug/debug.go b/vendor/github.com/go-openapi/analysis/internal/debug/debug.go deleted file mode 100644 index ec0fec0229..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/debug/debug.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package debug - -import ( - "fmt" - "log" - "os" - "path/filepath" - "runtime" -) - -var ( - output = os.Stdout -) - -// GetLogger provides a prefix debug logger -func GetLogger(prefix string, debug bool) func(string, ...interface{}) { - if debug { - logger := log.New(output, fmt.Sprintf("%s:", prefix), log.LstdFlags) - - return func(msg string, args ...interface{}) { - _, file1, pos1, _ := runtime.Caller(1) - logger.Printf("%s:%d: %s", filepath.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } - } - - return func(msg string, args ...interface{}) {} -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go b/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go deleted file mode 100644 index 8c9df0580d..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/normalize/normalize.go +++ /dev/null @@ -1,87 +0,0 @@ -package normalize - -import ( - "net/url" - "path" - "path/filepath" - "strings" - - "github.com/go-openapi/spec" -) - -// RebaseRef rebases a remote ref relative to a base ref. -// -// NOTE: does not support JSONschema ID for $ref (we assume we are working with swagger specs here). -// -// NOTE(windows): -// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec) -// * "/ in paths may appear as escape sequences -func RebaseRef(baseRef string, ref string) string { - baseRef, _ = url.PathUnescape(baseRef) - ref, _ = url.PathUnescape(ref) - - if baseRef == "" || baseRef == "." || strings.HasPrefix(baseRef, "#") { - return ref - } - - parts := strings.Split(ref, "#") - - baseParts := strings.Split(baseRef, "#") - baseURL, _ := url.Parse(baseParts[0]) - if strings.HasPrefix(ref, "#") { - if baseURL.Host == "" { - return strings.Join([]string{baseParts[0], parts[1]}, "#") - } - - return strings.Join([]string{baseParts[0], parts[1]}, "#") - } - - refURL, _ := url.Parse(parts[0]) - if refURL.Host != "" || filepath.IsAbs(parts[0]) { - // not rebasing an absolute path - return ref - } - - // there is a relative path - var basePath string - if baseURL.Host != "" { - // when there is a host, standard URI rules apply (with "/") - baseURL.Path = path.Dir(baseURL.Path) - baseURL.Path = path.Join(baseURL.Path, "/"+parts[0]) - - return baseURL.String() - } - - // this is a local relative path - // basePart[0] and parts[0] are local filesystem directories/files - basePath = filepath.Dir(baseParts[0]) - relPath := filepath.Join(basePath, string(filepath.Separator)+parts[0]) - if len(parts) > 1 { - return strings.Join([]string{relPath, parts[1]}, "#") - } - - return relPath -} - -// Path renders absolute path on remote file refs -// -// NOTE(windows): -// * refs are assumed to have been normalized with drive letter lower cased (from go-openapi/spec) -// * "/ in paths may appear as escape sequences -func Path(ref spec.Ref, basePath string) string { - uri, _ := url.PathUnescape(ref.String()) - if ref.HasFragmentOnly || filepath.IsAbs(uri) { - return uri - } - - refURL, _ := url.Parse(uri) - if refURL.Host != "" { - return uri - } - - parts := strings.Split(uri, "#") - // BasePath, parts[0] are local filesystem directories, guaranteed to be absolute at this stage - parts[0] = filepath.Join(filepath.Dir(basePath), parts[0]) - - return strings.Join(parts, "#") -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go b/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go deleted file mode 100644 index 7f3a2b8717..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/operations/operations.go +++ /dev/null @@ -1,90 +0,0 @@ -package operations - -import ( - "path" - "sort" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -// AllOpRefsByRef returns an index of sortable operations -func AllOpRefsByRef(specDoc Provider, operationIDs []string) map[string]OpRef { - return OpRefsByRef(GatherOperations(specDoc, operationIDs)) -} - -// OpRefsByRef indexes a map of sortable operations -func OpRefsByRef(oprefs map[string]OpRef) map[string]OpRef { - result := make(map[string]OpRef, len(oprefs)) - for _, v := range oprefs { - result[v.Ref.String()] = v - } - - return result -} - -// OpRef is an indexable, sortable operation -type OpRef struct { - Method string - Path string - Key string - ID string - Op *spec.Operation - Ref spec.Ref -} - -// OpRefs is a sortable collection of operations -type OpRefs []OpRef - -func (o OpRefs) Len() int { return len(o) } -func (o OpRefs) Swap(i, j int) { o[i], o[j] = o[j], o[i] } -func (o OpRefs) Less(i, j int) bool { return o[i].Key < o[j].Key } - -// Provider knows how to collect operations from a spec -type Provider interface { - Operations() map[string]map[string]*spec.Operation -} - -// GatherOperations builds a map of sorted operations from a spec -func GatherOperations(specDoc Provider, operationIDs []string) map[string]OpRef { - var oprefs OpRefs - - for method, pathItem := range specDoc.Operations() { - for pth, operation := range pathItem { - vv := *operation - oprefs = append(oprefs, OpRef{ - Key: swag.ToGoName(strings.ToLower(method) + " " + pth), - Method: method, - Path: pth, - ID: vv.ID, - Op: &vv, - Ref: spec.MustCreateRef("#" + path.Join("/paths", jsonpointer.Escape(pth), method)), - }) - } - } - - sort.Sort(oprefs) - - operations := make(map[string]OpRef) - for _, opr := range oprefs { - nm := opr.ID - if nm == "" { - nm = opr.Key - } - - oo, found := operations[nm] - if found && oo.Method != opr.Method && oo.Path != opr.Path { - nm = opr.Key - } - - if len(operationIDs) == 0 || swag.ContainsStrings(operationIDs, opr.ID) || swag.ContainsStrings(operationIDs, nm) { - opr.ID = nm - opr.Op.ID = nm - operations[nm] = opr - } - } - - return operations -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go b/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go deleted file mode 100644 index 26c2a05a31..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/replace/replace.go +++ /dev/null @@ -1,434 +0,0 @@ -package replace - -import ( - "fmt" - "net/url" - "os" - "path" - "strconv" - - "github.com/go-openapi/analysis/internal/debug" - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" -) - -const definitionsPath = "#/definitions" - -var debugLog = debug.GetLogger("analysis/flatten/replace", os.Getenv("SWAGGER_DEBUG") != "") - -// RewriteSchemaToRef replaces a schema with a Ref -func RewriteSchemaToRef(sp *spec.Swagger, key string, ref spec.Ref) error { - debugLog("rewriting schema to ref for %s with %s", key, ref.String()) - _, value, err := getPointerFromKey(sp, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *spec.Schema: - return rewriteParentRef(sp, key, ref) - - case spec.Schema: - return rewriteParentRef(sp, key, ref) - - case *spec.SchemaOrArray: - if refable.Schema != nil { - refable.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - } - - case *spec.SchemaOrBool: - if refable.Schema != nil { - refable.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - } - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -func rewriteParentRef(sp *spec.Swagger, key string, ref spec.Ref) error { - parent, entry, pvalue, err := getParentFromKey(sp, key) - if err != nil { - return err - } - - debugLog("rewriting holder for %T", pvalue) - switch container := pvalue.(type) { - case spec.Response: - if err := rewriteParentRef(sp, "#"+parent, ref); err != nil { - return err - } - - case *spec.Response: - container.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case *spec.Responses: - statusCode, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", key[1:], err) - } - resp := container.StatusCodeResponses[statusCode] - resp.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - container.StatusCodeResponses[statusCode] = resp - - case map[string]spec.Response: - resp := container[entry] - resp.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - container[entry] = resp - - case spec.Parameter: - if err := rewriteParentRef(sp, "#"+parent, ref); err != nil { - return err - } - - case map[string]spec.Parameter: - param := container[entry] - param.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - container[entry] = param - - case []spec.Parameter: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", key[1:], err) - } - param := container[idx] - param.Schema = &spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - container[idx] = param - - case spec.Definitions: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case map[string]spec.Schema: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case []spec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", key[1:], err) - } - container[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case *spec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", key[1:], err) - } - container.Schemas[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case spec.SchemaProperties: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled parent schema rewrite %s (%T)", key, pvalue) - } - - return nil -} - -// getPointerFromKey retrieves the content of the JSON pointer "key" -func getPointerFromKey(sp interface{}, key string) (string, interface{}, error) { - switch sp.(type) { - case *spec.Schema: - case *spec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - if key == "#/" { - return "", sp, nil - } - // unescape chars in key, e.g. "{}" from path params - pth, _ := url.PathUnescape(key[1:]) - ptr, err := jsonpointer.New(pth) - if err != nil { - return "", nil, err - } - - value, _, err := ptr.Get(sp) - if err != nil { - debugLog("error when getting key: %s with path: %s", key, pth) - - return "", nil, err - } - - return pth, value, nil -} - -// getParentFromKey retrieves the container of the JSON pointer "key" -func getParentFromKey(sp interface{}, key string) (string, string, interface{}, error) { - switch sp.(type) { - case *spec.Schema: - case *spec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - // unescape chars in key, e.g. "{}" from path params - pth, _ := url.PathUnescape(key[1:]) - - parent, entry := path.Dir(pth), path.Base(pth) - debugLog("getting schema holder at: %s, with entry: %s", parent, entry) - - pptr, err := jsonpointer.New(parent) - if err != nil { - return "", "", nil, err - } - pvalue, _, err := pptr.Get(sp) - if err != nil { - return "", "", nil, fmt.Errorf("can't get parent for %s: %w", parent, err) - } - - return parent, entry, pvalue, nil -} - -// UpdateRef replaces a ref by another one -func UpdateRef(sp interface{}, key string, ref spec.Ref) error { - switch sp.(type) { - case *spec.Schema: - case *spec.Swagger: - default: - panic("unexpected type used in getPointerFromKey") - } - debugLog("updating ref for %s with %s", key, ref.String()) - pth, value, err := getPointerFromKey(sp, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *spec.Schema: - refable.Ref = ref - case *spec.SchemaOrArray: - if refable.Schema != nil { - refable.Schema.Ref = ref - } - case *spec.SchemaOrBool: - if refable.Schema != nil { - refable.Schema.Ref = ref - } - case spec.Schema: - debugLog("rewriting holder for %T", refable) - _, entry, pvalue, erp := getParentFromKey(sp, key) - if erp != nil { - return err - } - switch container := pvalue.(type) { - case spec.Definitions: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case map[string]spec.Schema: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case []spec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", pth, err) - } - container[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case *spec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", pth, err) - } - container.Schemas[idx] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - case spec.SchemaProperties: - container[entry] = spec.Schema{SchemaProps: spec.SchemaProps{Ref: ref}} - - // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled container type at %s: %T", key, value) - } - - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -// UpdateRefWithSchema replaces a ref with a schema (i.e. re-inline schema) -func UpdateRefWithSchema(sp *spec.Swagger, key string, sch *spec.Schema) error { - debugLog("updating ref for %s with schema", key) - pth, value, err := getPointerFromKey(sp, key) - if err != nil { - return err - } - - switch refable := value.(type) { - case *spec.Schema: - *refable = *sch - case spec.Schema: - _, entry, pvalue, erp := getParentFromKey(sp, key) - if erp != nil { - return err - } - switch container := pvalue.(type) { - case spec.Definitions: - container[entry] = *sch - - case map[string]spec.Schema: - container[entry] = *sch - - case []spec.Schema: - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", pth, err) - } - container[idx] = *sch - - case *spec.SchemaOrArray: - // NOTE: this is necessarily an array - otherwise, the parent would be *Schema - idx, err := strconv.Atoi(entry) - if err != nil { - return fmt.Errorf("%s not a number: %w", pth, err) - } - container.Schemas[idx] = *sch - - case spec.SchemaProperties: - container[entry] = *sch - - // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema - - default: - return fmt.Errorf("unhandled type for parent of [%s]: %T", key, value) - } - case *spec.SchemaOrArray: - *refable.Schema = *sch - // NOTE: can't have case *spec.SchemaOrBool = parent in this case is *Schema - case *spec.SchemaOrBool: - *refable.Schema = *sch - default: - return fmt.Errorf("no schema with ref found at %s for %T", key, value) - } - - return nil -} - -// DeepestRefResult holds the results from DeepestRef analysis -type DeepestRefResult struct { - Ref spec.Ref - Schema *spec.Schema - Warnings []string -} - -// DeepestRef finds the first definition ref, from a cascade of nested refs which are not definitions. -// - if no definition is found, returns the deepest ref. -// - pointers to external files are expanded -// -// NOTE: all external $ref's are assumed to be already expanded at this stage. -func DeepestRef(sp *spec.Swagger, opts *spec.ExpandOptions, ref spec.Ref) (*DeepestRefResult, error) { - if !ref.HasFragmentOnly { - // we found an external $ref, which is odd at this stage: - // do nothing on external $refs - return &DeepestRefResult{Ref: ref}, nil - } - - currentRef := ref - visited := make(map[string]bool, 64) - warnings := make([]string, 0, 2) - -DOWNREF: - for currentRef.String() != "" { - if path.Dir(currentRef.String()) == definitionsPath { - // this is a top-level definition: stop here and return this ref - return &DeepestRefResult{Ref: currentRef}, nil - } - - if _, beenThere := visited[currentRef.String()]; beenThere { - return nil, - fmt.Errorf("cannot resolve cyclic chain of pointers under %s", currentRef.String()) - } - - visited[currentRef.String()] = true - value, _, err := currentRef.GetPointer().Get(sp) - if err != nil { - return nil, err - } - - switch refable := value.(type) { - case *spec.Schema: - if refable.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Ref - - case spec.Schema: - if refable.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Ref - - case *spec.SchemaOrArray: - if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Schema.Ref - - case *spec.SchemaOrBool: - if refable.Schema == nil || refable.Schema != nil && refable.Schema.Ref.String() == "" { - break DOWNREF - } - currentRef = refable.Schema.Ref - - case spec.Response: - // a pointer points to a schema initially marshalled in responses section... - // Attempt to convert this to a schema. If this fails, the spec is invalid - asJSON, _ := refable.MarshalJSON() - var asSchema spec.Schema - - err := asSchema.UnmarshalJSON(asJSON) - if err != nil { - return nil, - fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T", - currentRef.String(), value) - } - warnings = append(warnings, fmt.Sprintf("found $ref %q (response) interpreted as schema", currentRef.String())) - - if asSchema.Ref.String() == "" { - break DOWNREF - } - currentRef = asSchema.Ref - - case spec.Parameter: - // a pointer points to a schema initially marshalled in parameters section... - // Attempt to convert this to a schema. If this fails, the spec is invalid - asJSON, _ := refable.MarshalJSON() - var asSchema spec.Schema - if err := asSchema.UnmarshalJSON(asJSON); err != nil { - return nil, - fmt.Errorf("invalid type for resolved JSON pointer %s. Expected a schema a, got: %T", - currentRef.String(), value) - } - - warnings = append(warnings, fmt.Sprintf("found $ref %q (parameter) interpreted as schema", currentRef.String())) - - if asSchema.Ref.String() == "" { - break DOWNREF - } - currentRef = asSchema.Ref - - default: - return nil, - fmt.Errorf("unhandled type to resolve JSON pointer %s. Expected a Schema, got: %T", - currentRef.String(), value) - } - } - - // assess what schema we're ending with - sch, erv := spec.ResolveRefWithBase(sp, ¤tRef, opts) - if erv != nil { - return nil, erv - } - - if sch == nil { - return nil, fmt.Errorf("no schema found at %s", currentRef.String()) - } - - return &DeepestRefResult{Ref: currentRef, Schema: sch, Warnings: warnings}, nil -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go b/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go deleted file mode 100644 index 4590236e68..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/schutils/flatten_schema.go +++ /dev/null @@ -1,29 +0,0 @@ -// Package schutils provides tools to save or clone a schema -// when flattening a spec. -package schutils - -import ( - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -// Save registers a schema as an entry in spec #/definitions -func Save(sp *spec.Swagger, name string, schema *spec.Schema) { - if schema == nil { - return - } - - if sp.Definitions == nil { - sp.Definitions = make(map[string]spec.Schema, 150) - } - - sp.Definitions[name] = *schema -} - -// Clone deep-clones a schema -func Clone(schema *spec.Schema) *spec.Schema { - var sch spec.Schema - _ = swag.FromDynamicJSON(schema, &sch) - - return &sch -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go b/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go deleted file mode 100644 index 18e552eadc..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/keys.go +++ /dev/null @@ -1,201 +0,0 @@ -package sortref - -import ( - "net/http" - "path" - "strconv" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/spec" -) - -const ( - paths = "paths" - responses = "responses" - parameters = "parameters" - definitions = "definitions" -) - -var ( - ignoredKeys map[string]struct{} - validMethods map[string]struct{} -) - -func init() { - ignoredKeys = map[string]struct{}{ - "schema": {}, - "properties": {}, - "not": {}, - "anyOf": {}, - "oneOf": {}, - } - - validMethods = map[string]struct{}{ - "GET": {}, - "HEAD": {}, - "OPTIONS": {}, - "PATCH": {}, - "POST": {}, - "PUT": {}, - "DELETE": {}, - } -} - -// Key represent a key item constructed from /-separated segments -type Key struct { - Segments int - Key string -} - -// Keys is a sortable collable collection of Keys -type Keys []Key - -func (k Keys) Len() int { return len(k) } -func (k Keys) Swap(i, j int) { k[i], k[j] = k[j], k[i] } -func (k Keys) Less(i, j int) bool { - return k[i].Segments > k[j].Segments || (k[i].Segments == k[j].Segments && k[i].Key < k[j].Key) -} - -// KeyParts construct a SplitKey with all its /-separated segments decomposed. It is sortable. -func KeyParts(key string) SplitKey { - var res []string - for _, part := range strings.Split(key[1:], "/") { - if part != "" { - res = append(res, jsonpointer.Unescape(part)) - } - } - - return res -} - -// SplitKey holds of the parts of a /-separated key, soi that their location may be determined. -type SplitKey []string - -// IsDefinition is true when the split key is in the #/definitions section of a spec -func (s SplitKey) IsDefinition() bool { - return len(s) > 1 && s[0] == definitions -} - -// DefinitionName yields the name of the definition -func (s SplitKey) DefinitionName() string { - if !s.IsDefinition() { - return "" - } - - return s[1] -} - -func (s SplitKey) isKeyName(i int) bool { - if i <= 0 { - return false - } - - count := 0 - for idx := i - 1; idx > 0; idx-- { - if s[idx] != "properties" { - break - } - count++ - } - - return count%2 != 0 -} - -// PartAdder know how to construct the components of a new name -type PartAdder func(string) []string - -// BuildName builds a name from segments -func (s SplitKey) BuildName(segments []string, startIndex int, adder PartAdder) string { - for i, part := range s[startIndex:] { - if _, ignored := ignoredKeys[part]; !ignored || s.isKeyName(startIndex+i) { - segments = append(segments, adder(part)...) - } - } - - return strings.Join(segments, " ") -} - -// IsOperation is true when the split key is in the operations section -func (s SplitKey) IsOperation() bool { - return len(s) > 1 && s[0] == paths -} - -// IsSharedOperationParam is true when the split key is in the parameters section of a path -func (s SplitKey) IsSharedOperationParam() bool { - return len(s) > 2 && s[0] == paths && s[2] == parameters -} - -// IsSharedParam is true when the split key is in the #/parameters section of a spec -func (s SplitKey) IsSharedParam() bool { - return len(s) > 1 && s[0] == parameters -} - -// IsOperationParam is true when the split key is in the parameters section of an operation -func (s SplitKey) IsOperationParam() bool { - return len(s) > 3 && s[0] == paths && s[3] == parameters -} - -// IsOperationResponse is true when the split key is in the responses section of an operation -func (s SplitKey) IsOperationResponse() bool { - return len(s) > 3 && s[0] == paths && s[3] == responses -} - -// IsSharedResponse is true when the split key is in the #/responses section of a spec -func (s SplitKey) IsSharedResponse() bool { - return len(s) > 1 && s[0] == responses -} - -// IsDefaultResponse is true when the split key is the default response for an operation -func (s SplitKey) IsDefaultResponse() bool { - return len(s) > 4 && s[0] == paths && s[3] == responses && s[4] == "default" -} - -// IsStatusCodeResponse is true when the split key is an operation response with a status code -func (s SplitKey) IsStatusCodeResponse() bool { - isInt := func() bool { - _, err := strconv.Atoi(s[4]) - - return err == nil - } - - return len(s) > 4 && s[0] == paths && s[3] == responses && isInt() -} - -// ResponseName yields either the status code or "Default" for a response -func (s SplitKey) ResponseName() string { - if s.IsStatusCodeResponse() { - code, _ := strconv.Atoi(s[4]) - - return http.StatusText(code) - } - - if s.IsDefaultResponse() { - return "Default" - } - - return "" -} - -// PathItemRef constructs a $ref object from a split key of the form /{path}/{method} -func (s SplitKey) PathItemRef() spec.Ref { - if len(s) < 3 { - return spec.Ref{} - } - - pth, method := s[1], s[2] - if _, isValidMethod := validMethods[strings.ToUpper(method)]; !isValidMethod && !strings.HasPrefix(method, "x-") { - return spec.Ref{} - } - - return spec.MustCreateRef("#" + path.Join("/", paths, jsonpointer.Escape(pth), strings.ToUpper(method))) -} - -// PathRef constructs a $ref object from a split key of the form /paths/{reference} -func (s SplitKey) PathRef() spec.Ref { - if !s.IsOperation() { - return spec.Ref{} - } - - return spec.MustCreateRef("#" + path.Join("/", paths, jsonpointer.Escape(s[1]))) -} diff --git a/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go b/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go deleted file mode 100644 index 73243df87f..0000000000 --- a/vendor/github.com/go-openapi/analysis/internal/flatten/sortref/sort_ref.go +++ /dev/null @@ -1,141 +0,0 @@ -package sortref - -import ( - "reflect" - "sort" - "strings" - - "github.com/go-openapi/analysis/internal/flatten/normalize" - "github.com/go-openapi/spec" -) - -var depthGroupOrder = []string{ - "sharedParam", "sharedResponse", "sharedOpParam", "opParam", "codeResponse", "defaultResponse", "definition", -} - -type mapIterator struct { - len int - mapIter *reflect.MapIter -} - -func (i *mapIterator) Next() bool { - return i.mapIter.Next() -} - -func (i *mapIterator) Len() int { - return i.len -} - -func (i *mapIterator) Key() string { - return i.mapIter.Key().String() -} - -func mustMapIterator(anyMap interface{}) *mapIterator { - val := reflect.ValueOf(anyMap) - - return &mapIterator{mapIter: val.MapRange(), len: val.Len()} -} - -// DepthFirst sorts a map of anything. It groups keys by category -// (shared params, op param, statuscode response, default response, definitions) -// sort groups internally by number of parts in the key and lexical names -// flatten groups into a single list of keys -func DepthFirst(in interface{}) []string { - iterator := mustMapIterator(in) - sorted := make([]string, 0, iterator.Len()) - grouped := make(map[string]Keys, iterator.Len()) - - for iterator.Next() { - k := iterator.Key() - split := KeyParts(k) - var pk string - - if split.IsSharedOperationParam() { - pk = "sharedOpParam" - } - if split.IsOperationParam() { - pk = "opParam" - } - if split.IsStatusCodeResponse() { - pk = "codeResponse" - } - if split.IsDefaultResponse() { - pk = "defaultResponse" - } - if split.IsDefinition() { - pk = "definition" - } - if split.IsSharedParam() { - pk = "sharedParam" - } - if split.IsSharedResponse() { - pk = "sharedResponse" - } - grouped[pk] = append(grouped[pk], Key{Segments: len(split), Key: k}) - } - - for _, pk := range depthGroupOrder { - res := grouped[pk] - sort.Sort(res) - - for _, v := range res { - sorted = append(sorted, v.Key) - } - } - - return sorted -} - -// topMostRefs is able to sort refs by hierarchical then lexicographic order, -// yielding refs ordered breadth-first. -type topmostRefs []string - -func (k topmostRefs) Len() int { return len(k) } -func (k topmostRefs) Swap(i, j int) { k[i], k[j] = k[j], k[i] } -func (k topmostRefs) Less(i, j int) bool { - li, lj := len(strings.Split(k[i], "/")), len(strings.Split(k[j], "/")) - if li == lj { - return k[i] < k[j] - } - - return li < lj -} - -// TopmostFirst sorts references by depth -func TopmostFirst(refs []string) []string { - res := topmostRefs(refs) - sort.Sort(res) - - return res -} - -// RefRevIdx is a reverse index for references -type RefRevIdx struct { - Ref spec.Ref - Keys []string -} - -// ReverseIndex builds a reverse index for references in schemas -func ReverseIndex(schemas map[string]spec.Ref, basePath string) map[string]RefRevIdx { - collected := make(map[string]RefRevIdx) - for key, schRef := range schemas { - // normalize paths before sorting, - // so we get together keys that are from the same external file - normalizedPath := normalize.Path(schRef, basePath) - - entry, ok := collected[normalizedPath] - if ok { - entry.Keys = append(entry.Keys, key) - collected[normalizedPath] = entry - - continue - } - - collected[normalizedPath] = RefRevIdx{ - Ref: schRef, - Keys: []string{key}, - } - } - - return collected -} diff --git a/vendor/github.com/go-openapi/analysis/mixin.go b/vendor/github.com/go-openapi/analysis/mixin.go deleted file mode 100644 index b253052648..0000000000 --- a/vendor/github.com/go-openapi/analysis/mixin.go +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analysis - -import ( - "fmt" - "reflect" - - "github.com/go-openapi/spec" -) - -// Mixin modifies the primary swagger spec by adding the paths and -// definitions from the mixin specs. Top level parameters and -// responses from the mixins are also carried over. Operation id -// collisions are avoided by appending "Mixin" but only if -// needed. -// -// The following parts of primary are subject to merge, filling empty details -// - Info -// - BasePath -// - Host -// - ExternalDocs -// -// Consider calling FixEmptyResponseDescriptions() on the modified primary -// if you read them from storage and they are valid to start with. -// -// Entries in "paths", "definitions", "parameters" and "responses" are -// added to the primary in the order of the given mixins. If the entry -// already exists in primary it is skipped with a warning message. -// -// The count of skipped entries (from collisions) is returned so any -// deviation from the number expected can flag a warning in your build -// scripts. Carefully review the collisions before accepting them; -// consider renaming things if possible. -// -// No key normalization takes place (paths, type defs, -// etc). Ensure they are canonical if your downstream tools do -// key normalization of any form. -// -// Merging schemes (http, https), and consumers/producers do not account for -// collisions. -func Mixin(primary *spec.Swagger, mixins ...*spec.Swagger) []string { - skipped := make([]string, 0, len(mixins)) - opIds := getOpIds(primary) - initPrimary(primary) - - for i, m := range mixins { - skipped = append(skipped, mergeSwaggerProps(primary, m)...) - - skipped = append(skipped, mergeConsumes(primary, m)...) - - skipped = append(skipped, mergeProduces(primary, m)...) - - skipped = append(skipped, mergeTags(primary, m)...) - - skipped = append(skipped, mergeSchemes(primary, m)...) - - skipped = append(skipped, mergeSecurityDefinitions(primary, m)...) - - skipped = append(skipped, mergeSecurityRequirements(primary, m)...) - - skipped = append(skipped, mergeDefinitions(primary, m)...) - - // merging paths requires a map of operationIDs to work with - skipped = append(skipped, mergePaths(primary, m, opIds, i)...) - - skipped = append(skipped, mergeParameters(primary, m)...) - - skipped = append(skipped, mergeResponses(primary, m)...) - } - - return skipped -} - -// getOpIds extracts all the paths..operationIds from the given -// spec and returns them as the keys in a map with 'true' values. -func getOpIds(s *spec.Swagger) map[string]bool { - rv := make(map[string]bool) - if s.Paths == nil { - return rv - } - - for _, v := range s.Paths.Paths { - piops := pathItemOps(v) - - for _, op := range piops { - rv[op.ID] = true - } - } - - return rv -} - -func pathItemOps(p spec.PathItem) []*spec.Operation { - var rv []*spec.Operation - rv = appendOp(rv, p.Get) - rv = appendOp(rv, p.Put) - rv = appendOp(rv, p.Post) - rv = appendOp(rv, p.Delete) - rv = appendOp(rv, p.Head) - rv = appendOp(rv, p.Patch) - - return rv -} - -func appendOp(ops []*spec.Operation, op *spec.Operation) []*spec.Operation { - if op == nil { - return ops - } - - return append(ops, op) -} - -func mergeSecurityDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.SecurityDefinitions { - if _, exists := primary.SecurityDefinitions[k]; exists { - warn := fmt.Sprintf( - "SecurityDefinitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - - continue - } - - primary.SecurityDefinitions[k] = v - } - - return -} - -func mergeSecurityRequirements(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for _, v := range m.Security { - found := false - for _, vv := range primary.Security { - if reflect.DeepEqual(v, vv) { - found = true - - break - } - } - - if found { - warn := fmt.Sprintf( - "Security requirement: '%v' already exists in primary or higher priority mixin, skipping\n", v) - skipped = append(skipped, warn) - - continue - } - primary.Security = append(primary.Security, v) - } - - return -} - -func mergeDefinitions(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Definitions { - // assume name collisions represent IDENTICAL type. careful. - if _, exists := primary.Definitions[k]; exists { - warn := fmt.Sprintf( - "definitions entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - - continue - } - primary.Definitions[k] = v - } - - return -} - -func mergePaths(primary *spec.Swagger, m *spec.Swagger, opIds map[string]bool, mixIndex int) (skipped []string) { - if m.Paths != nil { - for k, v := range m.Paths.Paths { - if _, exists := primary.Paths.Paths[k]; exists { - warn := fmt.Sprintf( - "paths entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - - continue - } - - // Swagger requires that operationIds be - // unique within a spec. If we find a - // collision we append "Mixin0" to the - // operatoinId we are adding, where 0 is mixin - // index. We assume that operationIds with - // all the proivded specs are already unique. - piops := pathItemOps(v) - for _, piop := range piops { - if opIds[piop.ID] { - piop.ID = fmt.Sprintf("%v%v%v", piop.ID, "Mixin", mixIndex) - } - opIds[piop.ID] = true - } - primary.Paths.Paths[k] = v - } - } - - return -} - -func mergeParameters(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Parameters { - // could try to rename on conflict but would - // have to fix $refs in the mixin. Complain - // for now - if _, exists := primary.Parameters[k]; exists { - warn := fmt.Sprintf( - "top level parameters entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - - continue - } - primary.Parameters[k] = v - } - - return -} - -func mergeResponses(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for k, v := range m.Responses { - // could try to rename on conflict but would - // have to fix $refs in the mixin. Complain - // for now - if _, exists := primary.Responses[k]; exists { - warn := fmt.Sprintf( - "top level responses entry '%v' already exists in primary or higher priority mixin, skipping\n", k) - skipped = append(skipped, warn) - - continue - } - primary.Responses[k] = v - } - - return skipped -} - -func mergeConsumes(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Consumes { - found := false - for _, vv := range primary.Consumes { - if v == vv { - found = true - - break - } - } - - if found { - // no warning here: we just skip it - continue - } - primary.Consumes = append(primary.Consumes, v) - } - - return []string{} -} - -func mergeProduces(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Produces { - found := false - for _, vv := range primary.Produces { - if v == vv { - found = true - - break - } - } - - if found { - // no warning here: we just skip it - continue - } - primary.Produces = append(primary.Produces, v) - } - - return []string{} -} - -func mergeTags(primary *spec.Swagger, m *spec.Swagger) (skipped []string) { - for _, v := range m.Tags { - found := false - for _, vv := range primary.Tags { - if v.Name == vv.Name { - found = true - - break - } - } - - if found { - warn := fmt.Sprintf( - "top level tags entry with name '%v' already exists in primary or higher priority mixin, skipping\n", - v.Name, - ) - skipped = append(skipped, warn) - - continue - } - - primary.Tags = append(primary.Tags, v) - } - - return -} - -func mergeSchemes(primary *spec.Swagger, m *spec.Swagger) []string { - for _, v := range m.Schemes { - found := false - for _, vv := range primary.Schemes { - if v == vv { - found = true - - break - } - } - - if found { - // no warning here: we just skip it - continue - } - primary.Schemes = append(primary.Schemes, v) - } - - return []string{} -} - -func mergeSwaggerProps(primary *spec.Swagger, m *spec.Swagger) []string { - var skipped, skippedInfo, skippedDocs []string - - primary.Extensions, skipped = mergeExtensions(primary.Extensions, m.Extensions) - - // merging details in swagger top properties - if primary.Host == "" { - primary.Host = m.Host - } - - if primary.BasePath == "" { - primary.BasePath = m.BasePath - } - - if primary.Info == nil { - primary.Info = m.Info - } else if m.Info != nil { - skippedInfo = mergeInfo(primary.Info, m.Info) - skipped = append(skipped, skippedInfo...) - } - - if primary.ExternalDocs == nil { - primary.ExternalDocs = m.ExternalDocs - } else if m != nil { - skippedDocs = mergeExternalDocs(primary.ExternalDocs, m.ExternalDocs) - skipped = append(skipped, skippedDocs...) - } - - return skipped -} - -// nolint: unparam -func mergeExternalDocs(primary *spec.ExternalDocumentation, m *spec.ExternalDocumentation) []string { - if primary.Description == "" { - primary.Description = m.Description - } - - if primary.URL == "" { - primary.URL = m.URL - } - - return nil -} - -func mergeInfo(primary *spec.Info, m *spec.Info) []string { - var sk, skipped []string - - primary.Extensions, sk = mergeExtensions(primary.Extensions, m.Extensions) - skipped = append(skipped, sk...) - - if primary.Description == "" { - primary.Description = m.Description - } - - if primary.Title == "" { - primary.Description = m.Description - } - - if primary.TermsOfService == "" { - primary.TermsOfService = m.TermsOfService - } - - if primary.Version == "" { - primary.Version = m.Version - } - - if primary.Contact == nil { - primary.Contact = m.Contact - } else if m.Contact != nil { - var csk []string - primary.Contact.Extensions, csk = mergeExtensions(primary.Contact.Extensions, m.Contact.Extensions) - skipped = append(skipped, csk...) - - if primary.Contact.Name == "" { - primary.Contact.Name = m.Contact.Name - } - - if primary.Contact.URL == "" { - primary.Contact.URL = m.Contact.URL - } - - if primary.Contact.Email == "" { - primary.Contact.Email = m.Contact.Email - } - } - - if primary.License == nil { - primary.License = m.License - } else if m.License != nil { - var lsk []string - primary.License.Extensions, lsk = mergeExtensions(primary.License.Extensions, m.License.Extensions) - skipped = append(skipped, lsk...) - - if primary.License.Name == "" { - primary.License.Name = m.License.Name - } - - if primary.License.URL == "" { - primary.License.URL = m.License.URL - } - } - - return skipped -} - -func mergeExtensions(primary spec.Extensions, m spec.Extensions) (result spec.Extensions, skipped []string) { - if primary == nil { - result = m - - return - } - - if m == nil { - result = primary - - return - } - - result = primary - for k, v := range m { - if _, found := primary[k]; found { - skipped = append(skipped, k) - - continue - } - - primary[k] = v - } - - return -} - -func initPrimary(primary *spec.Swagger) { - if primary.SecurityDefinitions == nil { - primary.SecurityDefinitions = make(map[string]*spec.SecurityScheme) - } - - if primary.Security == nil { - primary.Security = make([]map[string][]string, 0, 10) - } - - if primary.Produces == nil { - primary.Produces = make([]string, 0, 10) - } - - if primary.Consumes == nil { - primary.Consumes = make([]string, 0, 10) - } - - if primary.Tags == nil { - primary.Tags = make([]spec.Tag, 0, 10) - } - - if primary.Schemes == nil { - primary.Schemes = make([]string, 0, 10) - } - - if primary.Paths == nil { - primary.Paths = &spec.Paths{Paths: make(map[string]spec.PathItem)} - } - - if primary.Paths.Paths == nil { - primary.Paths.Paths = make(map[string]spec.PathItem) - } - - if primary.Definitions == nil { - primary.Definitions = make(spec.Definitions) - } - - if primary.Parameters == nil { - primary.Parameters = make(map[string]spec.Parameter) - } - - if primary.Responses == nil { - primary.Responses = make(map[string]spec.Response) - } -} diff --git a/vendor/github.com/go-openapi/analysis/schema.go b/vendor/github.com/go-openapi/analysis/schema.go deleted file mode 100644 index fc055095cb..0000000000 --- a/vendor/github.com/go-openapi/analysis/schema.go +++ /dev/null @@ -1,256 +0,0 @@ -package analysis - -import ( - "fmt" - - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" -) - -// SchemaOpts configures the schema analyzer -type SchemaOpts struct { - Schema *spec.Schema - Root interface{} - BasePath string - _ struct{} -} - -// Schema analysis, will classify the schema according to known -// patterns. -func Schema(opts SchemaOpts) (*AnalyzedSchema, error) { - if opts.Schema == nil { - return nil, fmt.Errorf("no schema to analyze") - } - - a := &AnalyzedSchema{ - schema: opts.Schema, - root: opts.Root, - basePath: opts.BasePath, - } - - a.initializeFlags() - a.inferKnownType() - a.inferEnum() - a.inferBaseType() - - if err := a.inferMap(); err != nil { - return nil, err - } - if err := a.inferArray(); err != nil { - return nil, err - } - - a.inferTuple() - - if err := a.inferFromRef(); err != nil { - return nil, err - } - - a.inferSimpleSchema() - - return a, nil -} - -// AnalyzedSchema indicates what the schema represents -type AnalyzedSchema struct { - schema *spec.Schema - root interface{} - basePath string - - hasProps bool - hasAllOf bool - hasItems bool - hasAdditionalProps bool - hasAdditionalItems bool - hasRef bool - - IsKnownType bool - IsSimpleSchema bool - IsArray bool - IsSimpleArray bool - IsMap bool - IsSimpleMap bool - IsExtendedObject bool - IsTuple bool - IsTupleWithExtra bool - IsBaseType bool - IsEnum bool -} - -// Inherits copies value fields from other onto this schema -func (a *AnalyzedSchema) inherits(other *AnalyzedSchema) { - if other == nil { - return - } - a.hasProps = other.hasProps - a.hasAllOf = other.hasAllOf - a.hasItems = other.hasItems - a.hasAdditionalItems = other.hasAdditionalItems - a.hasAdditionalProps = other.hasAdditionalProps - a.hasRef = other.hasRef - - a.IsKnownType = other.IsKnownType - a.IsSimpleSchema = other.IsSimpleSchema - a.IsArray = other.IsArray - a.IsSimpleArray = other.IsSimpleArray - a.IsMap = other.IsMap - a.IsSimpleMap = other.IsSimpleMap - a.IsExtendedObject = other.IsExtendedObject - a.IsTuple = other.IsTuple - a.IsTupleWithExtra = other.IsTupleWithExtra - a.IsBaseType = other.IsBaseType - a.IsEnum = other.IsEnum -} - -func (a *AnalyzedSchema) inferFromRef() error { - if a.hasRef { - sch := new(spec.Schema) - sch.Ref = a.schema.Ref - err := spec.ExpandSchema(sch, a.root, nil) - if err != nil { - return err - } - rsch, err := Schema(SchemaOpts{ - Schema: sch, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - // NOTE(fredbi): currently the only cause for errors is - // unresolved ref. Since spec.ExpandSchema() expands the - // schema recursively, there is no chance to get there, - // until we add more causes for error in this schema analysis. - return err - } - a.inherits(rsch) - } - - return nil -} - -func (a *AnalyzedSchema) inferSimpleSchema() { - a.IsSimpleSchema = a.IsKnownType || a.IsSimpleArray || a.IsSimpleMap -} - -func (a *AnalyzedSchema) inferKnownType() { - tpe := a.schema.Type - format := a.schema.Format - a.IsKnownType = tpe.Contains("boolean") || - tpe.Contains("integer") || - tpe.Contains("number") || - tpe.Contains("string") || - (format != "" && strfmt.Default.ContainsName(format)) || - (a.isObjectType() && !a.hasProps && !a.hasAllOf && !a.hasAdditionalProps && !a.hasAdditionalItems) -} - -func (a *AnalyzedSchema) inferMap() error { - if !a.isObjectType() { - return nil - } - - hasExtra := a.hasProps || a.hasAllOf - a.IsMap = a.hasAdditionalProps && !hasExtra - a.IsExtendedObject = a.hasAdditionalProps && hasExtra - - if !a.IsMap { - return nil - } - - // maps - if a.schema.AdditionalProperties.Schema != nil { - msch, err := Schema(SchemaOpts{ - Schema: a.schema.AdditionalProperties.Schema, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - return err - } - a.IsSimpleMap = msch.IsSimpleSchema - } else if a.schema.AdditionalProperties.Allows { - a.IsSimpleMap = true - } - - return nil -} - -func (a *AnalyzedSchema) inferArray() error { - // an array has Items defined as an object schema, otherwise we qualify this JSON array as a tuple - // (yes, even if the Items array contains only one element). - // arrays in JSON schema may be unrestricted (i.e no Items specified). - // Note that arrays in Swagger MUST have Items. Nonetheless, we analyze unrestricted arrays. - // - // NOTE: the spec package misses the distinction between: - // items: [] and items: {}, so we consider both arrays here. - a.IsArray = a.isArrayType() && (a.schema.Items == nil || a.schema.Items.Schemas == nil) - if a.IsArray && a.hasItems { - if a.schema.Items.Schema != nil { - itsch, err := Schema(SchemaOpts{ - Schema: a.schema.Items.Schema, - Root: a.root, - BasePath: a.basePath, - }) - if err != nil { - return err - } - - a.IsSimpleArray = itsch.IsSimpleSchema - } - } - - if a.IsArray && !a.hasItems { - a.IsSimpleArray = true - } - - return nil -} - -func (a *AnalyzedSchema) inferTuple() { - tuple := a.hasItems && a.schema.Items.Schemas != nil - a.IsTuple = tuple && !a.hasAdditionalItems - a.IsTupleWithExtra = tuple && a.hasAdditionalItems -} - -func (a *AnalyzedSchema) inferBaseType() { - if a.isObjectType() { - a.IsBaseType = a.schema.Discriminator != "" - } -} - -func (a *AnalyzedSchema) inferEnum() { - a.IsEnum = len(a.schema.Enum) > 0 -} - -func (a *AnalyzedSchema) initializeFlags() { - a.hasProps = len(a.schema.Properties) > 0 - a.hasAllOf = len(a.schema.AllOf) > 0 - a.hasRef = a.schema.Ref.String() != "" - - a.hasItems = a.schema.Items != nil && - (a.schema.Items.Schema != nil || len(a.schema.Items.Schemas) > 0) - - a.hasAdditionalProps = a.schema.AdditionalProperties != nil && - (a.schema.AdditionalProperties.Schema != nil || a.schema.AdditionalProperties.Allows) - - a.hasAdditionalItems = a.schema.AdditionalItems != nil && - (a.schema.AdditionalItems.Schema != nil || a.schema.AdditionalItems.Allows) -} - -func (a *AnalyzedSchema) isObjectType() bool { - return !a.hasRef && (a.schema.Type == nil || a.schema.Type.Contains("") || a.schema.Type.Contains("object")) -} - -func (a *AnalyzedSchema) isArrayType() bool { - return !a.hasRef && (a.schema.Type != nil && a.schema.Type.Contains("array")) -} - -// isAnalyzedAsComplex determines if an analyzed schema is eligible to flattening (i.e. it is "complex"). -// -// Complex means the schema is any of: -// - a simple type (primitive) -// - an array of something (items are possibly complex ; if this is the case, items will generate a definition) -// - a map of something (additionalProperties are possibly complex ; if this is the case, additionalProperties will -// generate a definition) -func (a *AnalyzedSchema) isAnalyzedAsComplex() bool { - return !a.IsSimpleSchema && !a.IsArray && !a.IsMap -} diff --git a/vendor/github.com/go-openapi/errors/.gitattributes b/vendor/github.com/go-openapi/errors/.gitattributes deleted file mode 100644 index a0717e4b3b..0000000000 --- a/vendor/github.com/go-openapi/errors/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf \ No newline at end of file diff --git a/vendor/github.com/go-openapi/errors/.gitignore b/vendor/github.com/go-openapi/errors/.gitignore deleted file mode 100644 index dd91ed6a04..0000000000 --- a/vendor/github.com/go-openapi/errors/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/errors/.golangci.yml b/vendor/github.com/go-openapi/errors/.golangci.yml deleted file mode 100644 index 4e1fc0c7d4..0000000000 --- a/vendor/github.com/go-openapi/errors/.golangci.yml +++ /dev/null @@ -1,48 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - paralleltest - - tparallel - - cyclop - - errname - - varnamelen - - exhaustruct - - maintidx diff --git a/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/errors/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/errors/LICENSE b/vendor/github.com/go-openapi/errors/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/errors/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md deleted file mode 100644 index 4aac049e60..0000000000 --- a/vendor/github.com/go-openapi/errors/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# OpenAPI errors - -[![Build Status](https://travis-ci.org/go-openapi/errors.svg?branch=master)](https://travis-ci.org/go-openapi/errors) -[![codecov](https://codecov.io/gh/go-openapi/errors/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/errors) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/errors/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/errors.svg)](https://pkg.go.dev/github.com/go-openapi/errors) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/errors.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/errors)](https://goreportcard.com/report/github.com/go-openapi/errors) - -Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit. diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go deleted file mode 100644 index c13f3435fa..0000000000 --- a/vendor/github.com/go-openapi/errors/api.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "net/http" - "reflect" - "strings" -) - -// DefaultHTTPCode is used when the error Code cannot be used as an HTTP code. -var DefaultHTTPCode = http.StatusUnprocessableEntity - -// Error represents a error interface all swagger framework errors implement -type Error interface { - error - Code() int32 -} - -type apiError struct { - code int32 - message string -} - -func (a *apiError) Error() string { - return a.message -} - -func (a *apiError) Code() int32 { - return a.code -} - -// MarshalJSON implements the JSON encoding interface -func (a apiError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": a.code, - "message": a.message, - }) -} - -// New creates a new API error with a code and a message -func New(code int32, message string, args ...interface{}) Error { - if len(args) > 0 { - return &apiError{code, fmt.Sprintf(message, args...)} - } - return &apiError{code, message} -} - -// NotFound creates a new not found error -func NotFound(message string, args ...interface{}) Error { - if message == "" { - message = "Not found" - } - return New(http.StatusNotFound, fmt.Sprintf(message, args...)) -} - -// NotImplemented creates a new not implemented error -func NotImplemented(message string) Error { - return New(http.StatusNotImplemented, message) -} - -// MethodNotAllowedError represents an error for when the path matches but the method doesn't -type MethodNotAllowedError struct { - code int32 - Allowed []string - message string -} - -func (m *MethodNotAllowedError) Error() string { - return m.message -} - -// Code the error code -func (m *MethodNotAllowedError) Code() int32 { - return m.code -} - -// MarshalJSON implements the JSON encoding interface -func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": m.code, - "message": m.message, - "allowed": m.Allowed, - }) -} - -func errorAsJSON(err Error) []byte { - //nolint:errchkjson - b, _ := json.Marshal(struct { - Code int32 `json:"code"` - Message string `json:"message"` - }{err.Code(), err.Error()}) - return b -} - -func flattenComposite(errs *CompositeError) *CompositeError { - var res []error - for _, er := range errs.Errors { - switch e := er.(type) { - case *CompositeError: - if e != nil && len(e.Errors) > 0 { - flat := flattenComposite(e) - if len(flat.Errors) > 0 { - res = append(res, flat.Errors...) - } - } - default: - if e != nil { - res = append(res, e) - } - } - } - return CompositeValidationError(res...) -} - -// MethodNotAllowed creates a new method not allowed error -func MethodNotAllowed(requested string, allow []string) Error { - msg := fmt.Sprintf("method %s is not allowed, but [%s] are", requested, strings.Join(allow, ",")) - return &MethodNotAllowedError{code: http.StatusMethodNotAllowed, Allowed: allow, message: msg} -} - -// ServeError the error handler interface implementation -func ServeError(rw http.ResponseWriter, r *http.Request, err error) { - rw.Header().Set("Content-Type", "application/json") - switch e := err.(type) { - case *CompositeError: - er := flattenComposite(e) - // strips composite errors to first element only - if len(er.Errors) > 0 { - ServeError(rw, r, er.Errors[0]) - } else { - // guard against empty CompositeError (invalid construct) - ServeError(rw, r, nil) - } - case *MethodNotAllowedError: - rw.Header().Add("Allow", strings.Join(e.Allowed, ",")) - rw.WriteHeader(asHTTPCode(int(e.Code()))) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(e)) - } - case Error: - value := reflect.ValueOf(e) - if value.Kind() == reflect.Ptr && value.IsNil() { - rw.WriteHeader(http.StatusInternalServerError) - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error"))) - return - } - rw.WriteHeader(asHTTPCode(int(e.Code()))) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(e)) - } - case nil: - rw.WriteHeader(http.StatusInternalServerError) - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, "Unknown error"))) - default: - rw.WriteHeader(http.StatusInternalServerError) - if r == nil || r.Method != http.MethodHead { - _, _ = rw.Write(errorAsJSON(New(http.StatusInternalServerError, err.Error()))) - } - } -} - -func asHTTPCode(input int) int { - if input >= 600 { - return DefaultHTTPCode - } - return input -} diff --git a/vendor/github.com/go-openapi/errors/auth.go b/vendor/github.com/go-openapi/errors/auth.go deleted file mode 100644 index 0545b501bd..0000000000 --- a/vendor/github.com/go-openapi/errors/auth.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import "net/http" - -// Unauthenticated returns an unauthenticated error -func Unauthenticated(scheme string) Error { - return New(http.StatusUnauthorized, "unauthenticated for %s", scheme) -} diff --git a/vendor/github.com/go-openapi/errors/doc.go b/vendor/github.com/go-openapi/errors/doc.go deleted file mode 100644 index af01190ce6..0000000000 --- a/vendor/github.com/go-openapi/errors/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package errors provides an Error interface and several concrete types -implementing this interface to manage API errors and JSON-schema validation -errors. - -A middleware handler ServeError() is provided to serve the errors types -it defines. - -It is used throughout the various go-openapi toolkit libraries -(https://github.com/go-openapi). -*/ -package errors diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go deleted file mode 100644 index dfebe8f95f..0000000000 --- a/vendor/github.com/go-openapi/errors/headers.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// Validation represents a failure of a precondition -type Validation struct { - code int32 - Name string - In string - Value interface{} - message string - Values []interface{} -} - -func (e *Validation) Error() string { - return e.message -} - -// Code the error code -func (e *Validation) Code() int32 { - return e.code -} - -// MarshalJSON implements the JSON encoding interface -func (e Validation) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": e.code, - "message": e.message, - "in": e.In, - "name": e.Name, - "value": e.Value, - "values": e.Values, - }) -} - -// ValidateName sets the name for a validation or updates it for a nested property -func (e *Validation) ValidateName(name string) *Validation { - if name != "" { - if e.Name == "" { - e.Name = name - e.message = name + e.message - } else { - e.Name = name + "." + e.Name - e.message = name + "." + e.message - } - } - return e -} - -const ( - contentTypeFail = `unsupported media type %q, only %v are allowed` - responseFormatFail = `unsupported media type requested, only %v are available` -) - -// InvalidContentType error for an invalid content type -func InvalidContentType(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) - for _, v := range allowed { - values = append(values, v) - } - return &Validation{ - code: http.StatusUnsupportedMediaType, - Name: "Content-Type", - In: "header", - Value: value, - Values: values, - message: fmt.Sprintf(contentTypeFail, value, allowed), - } -} - -// InvalidResponseFormat error for an unacceptable response format request -func InvalidResponseFormat(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) - for _, v := range allowed { - values = append(values, v) - } - return &Validation{ - code: http.StatusNotAcceptable, - Name: "Accept", - In: "header", - Value: value, - Values: values, - message: fmt.Sprintf(responseFormatFail, allowed), - } -} diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go deleted file mode 100644 index 963472d1f3..0000000000 --- a/vendor/github.com/go-openapi/errors/middleware.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "bytes" - "fmt" - "strings" -) - -// APIVerificationFailed is an error that contains all the missing info for a mismatched section -// between the api registrations and the api spec -type APIVerificationFailed struct { - Section string `json:"section,omitempty"` - MissingSpecification []string `json:"missingSpecification,omitempty"` - MissingRegistration []string `json:"missingRegistration,omitempty"` -} - -func (v *APIVerificationFailed) Error() string { - buf := bytes.NewBuffer(nil) - - hasRegMissing := len(v.MissingRegistration) > 0 - hasSpecMissing := len(v.MissingSpecification) > 0 - - if hasRegMissing { - buf.WriteString(fmt.Sprintf("missing [%s] %s registrations", strings.Join(v.MissingRegistration, ", "), v.Section)) - } - - if hasRegMissing && hasSpecMissing { - buf.WriteString("\n") - } - - if hasSpecMissing { - buf.WriteString(fmt.Sprintf("missing from spec file [%s] %s", strings.Join(v.MissingSpecification, ", "), v.Section)) - } - - return buf.String() -} diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go deleted file mode 100644 index 5096e1ea7b..0000000000 --- a/vendor/github.com/go-openapi/errors/parsing.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" -) - -// ParseError represents a parsing error -type ParseError struct { - code int32 - Name string - In string - Value string - Reason error - message string -} - -func (e *ParseError) Error() string { - return e.message -} - -// Code returns the http status code for this error -func (e *ParseError) Code() int32 { - return e.code -} - -// MarshalJSON implements the JSON encoding interface -func (e ParseError) MarshalJSON() ([]byte, error) { - var reason string - if e.Reason != nil { - reason = e.Reason.Error() - } - return json.Marshal(map[string]interface{}{ - "code": e.code, - "message": e.message, - "in": e.In, - "name": e.Name, - "value": e.Value, - "reason": reason, - }) -} - -const ( - parseErrorTemplContent = `parsing %s %s from %q failed, because %s` - parseErrorTemplContentNoIn = `parsing %s from %q failed, because %s` -) - -// NewParseError creates a new parse error -func NewParseError(name, in, value string, reason error) *ParseError { - var msg string - if in == "" { - msg = fmt.Sprintf(parseErrorTemplContentNoIn, name, value, reason) - } else { - msg = fmt.Sprintf(parseErrorTemplContent, name, in, value, reason) - } - return &ParseError{ - code: 400, - Name: name, - In: in, - Value: value, - Reason: reason, - message: msg, - } -} diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go deleted file mode 100644 index da5f6c78cb..0000000000 --- a/vendor/github.com/go-openapi/errors/schema.go +++ /dev/null @@ -1,611 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package errors - -import ( - "encoding/json" - "fmt" - "strings" -) - -const ( - invalidType = "%s is an invalid type name" - typeFail = "%s in %s must be of type %s" - typeFailWithData = "%s in %s must be of type %s: %q" - typeFailWithError = "%s in %s must be of type %s, because: %s" - requiredFail = "%s in %s is required" - readOnlyFail = "%s in %s is readOnly" - tooLongMessage = "%s in %s should be at most %d chars long" - tooShortMessage = "%s in %s should be at least %d chars long" - patternFail = "%s in %s should match '%s'" - enumFail = "%s in %s should be one of %v" - multipleOfFail = "%s in %s should be a multiple of %v" - maxIncFail = "%s in %s should be less than or equal to %v" - maxExcFail = "%s in %s should be less than %v" - minIncFail = "%s in %s should be greater than or equal to %v" - minExcFail = "%s in %s should be greater than %v" - uniqueFail = "%s in %s shouldn't contain duplicates" - maxItemsFail = "%s in %s should have at most %d items" - minItemsFail = "%s in %s should have at least %d items" - typeFailNoIn = "%s must be of type %s" - typeFailWithDataNoIn = "%s must be of type %s: %q" - typeFailWithErrorNoIn = "%s must be of type %s, because: %s" - requiredFailNoIn = "%s is required" - readOnlyFailNoIn = "%s is readOnly" - tooLongMessageNoIn = "%s should be at most %d chars long" - tooShortMessageNoIn = "%s should be at least %d chars long" - patternFailNoIn = "%s should match '%s'" - enumFailNoIn = "%s should be one of %v" - multipleOfFailNoIn = "%s should be a multiple of %v" - maxIncFailNoIn = "%s should be less than or equal to %v" - maxExcFailNoIn = "%s should be less than %v" - minIncFailNoIn = "%s should be greater than or equal to %v" - minExcFailNoIn = "%s should be greater than %v" - uniqueFailNoIn = "%s shouldn't contain duplicates" - maxItemsFailNoIn = "%s should have at most %d items" - minItemsFailNoIn = "%s should have at least %d items" - noAdditionalItems = "%s in %s can't have additional items" - noAdditionalItemsNoIn = "%s can't have additional items" - tooFewProperties = "%s in %s should have at least %d properties" - tooFewPropertiesNoIn = "%s should have at least %d properties" - tooManyProperties = "%s in %s should have at most %d properties" - tooManyPropertiesNoIn = "%s should have at most %d properties" - unallowedProperty = "%s.%s in %s is a forbidden property" - unallowedPropertyNoIn = "%s.%s is a forbidden property" - failedAllPatternProps = "%s.%s in %s failed all pattern properties" - failedAllPatternPropsNoIn = "%s.%s failed all pattern properties" - multipleOfMustBePositive = "factor MultipleOf declared for %s must be positive: %v" -) - -// All code responses can be used to differentiate errors for different handling -// by the consuming program -const ( - // CompositeErrorCode remains 422 for backwards-compatibility - // and to separate it from validation errors with cause - CompositeErrorCode = 422 - // InvalidTypeCode is used for any subclass of invalid types - InvalidTypeCode = 600 + iota - RequiredFailCode - TooLongFailCode - TooShortFailCode - PatternFailCode - EnumFailCode - MultipleOfFailCode - MaxFailCode - MinFailCode - UniqueFailCode - MaxItemsFailCode - MinItemsFailCode - NoAdditionalItemsCode - TooFewPropertiesCode - TooManyPropertiesCode - UnallowedPropertyCode - FailedAllPatternPropsCode - MultipleOfMustBePositiveCode - ReadOnlyFailCode -) - -// CompositeError is an error that groups several errors together -type CompositeError struct { - Errors []error - code int32 - message string -} - -// Code for this error -func (c *CompositeError) Code() int32 { - return c.code -} - -func (c *CompositeError) Error() string { - if len(c.Errors) > 0 { - msgs := []string{c.message + ":"} - for _, e := range c.Errors { - msgs = append(msgs, e.Error()) - } - return strings.Join(msgs, "\n") - } - return c.message -} - -// MarshalJSON implements the JSON encoding interface -func (c CompositeError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ - "code": c.code, - "message": c.message, - "errors": c.Errors, - }) -} - -// CompositeValidationError an error to wrap a bunch of other errors -func CompositeValidationError(errors ...error) *CompositeError { - return &CompositeError{ - code: CompositeErrorCode, - Errors: append([]error{}, errors...), - message: "validation failure list", - } -} - -// ValidateName recursively sets the name for all validations or updates them for nested properties -func (c *CompositeError) ValidateName(name string) *CompositeError { - for i, e := range c.Errors { - if ve, ok := e.(*Validation); ok { - c.Errors[i] = ve.ValidateName(name) - } else if ce, ok := e.(*CompositeError); ok { - c.Errors[i] = ce.ValidateName(name) - } - } - - return c -} - -// FailedAllPatternProperties an error for when the property doesn't match a pattern -func FailedAllPatternProperties(name, in, key string) *Validation { - msg := fmt.Sprintf(failedAllPatternProps, name, key, in) - if in == "" { - msg = fmt.Sprintf(failedAllPatternPropsNoIn, name, key) - } - return &Validation{ - code: FailedAllPatternPropsCode, - Name: name, - In: in, - Value: key, - message: msg, - } -} - -// PropertyNotAllowed an error for when the property doesn't match a pattern -func PropertyNotAllowed(name, in, key string) *Validation { - msg := fmt.Sprintf(unallowedProperty, name, key, in) - if in == "" { - msg = fmt.Sprintf(unallowedPropertyNoIn, name, key) - } - return &Validation{ - code: UnallowedPropertyCode, - Name: name, - In: in, - Value: key, - message: msg, - } -} - -// TooFewProperties an error for an object with too few properties -func TooFewProperties(name, in string, n int64) *Validation { - msg := fmt.Sprintf(tooFewProperties, name, in, n) - if in == "" { - msg = fmt.Sprintf(tooFewPropertiesNoIn, name, n) - } - return &Validation{ - code: TooFewPropertiesCode, - Name: name, - In: in, - Value: n, - message: msg, - } -} - -// TooManyProperties an error for an object with too many properties -func TooManyProperties(name, in string, n int64) *Validation { - msg := fmt.Sprintf(tooManyProperties, name, in, n) - if in == "" { - msg = fmt.Sprintf(tooManyPropertiesNoIn, name, n) - } - return &Validation{ - code: TooManyPropertiesCode, - Name: name, - In: in, - Value: n, - message: msg, - } -} - -// AdditionalItemsNotAllowed an error for invalid additional items -func AdditionalItemsNotAllowed(name, in string) *Validation { - msg := fmt.Sprintf(noAdditionalItems, name, in) - if in == "" { - msg = fmt.Sprintf(noAdditionalItemsNoIn, name) - } - return &Validation{ - code: NoAdditionalItemsCode, - Name: name, - In: in, - message: msg, - } -} - -// InvalidCollectionFormat another flavor of invalid type error -func InvalidCollectionFormat(name, in, format string) *Validation { - return &Validation{ - code: InvalidTypeCode, - Name: name, - In: in, - Value: format, - message: fmt.Sprintf("the collection format %q is not supported for the %s param %q", format, in, name), - } -} - -// InvalidTypeName an error for when the type is invalid -func InvalidTypeName(typeName string) *Validation { - return &Validation{ - code: InvalidTypeCode, - Value: typeName, - message: fmt.Sprintf(invalidType, typeName), - } -} - -// InvalidType creates an error for when the type is invalid -func InvalidType(name, in, typeName string, value interface{}) *Validation { - var message string - - if in != "" { - switch value.(type) { - case string: - message = fmt.Sprintf(typeFailWithData, name, in, typeName, value) - case error: - message = fmt.Sprintf(typeFailWithError, name, in, typeName, value) - default: - message = fmt.Sprintf(typeFail, name, in, typeName) - } - } else { - switch value.(type) { - case string: - message = fmt.Sprintf(typeFailWithDataNoIn, name, typeName, value) - case error: - message = fmt.Sprintf(typeFailWithErrorNoIn, name, typeName, value) - default: - message = fmt.Sprintf(typeFailNoIn, name, typeName) - } - } - - return &Validation{ - code: InvalidTypeCode, - Name: name, - In: in, - Value: value, - message: message, - } - -} - -// DuplicateItems error for when an array contains duplicates -func DuplicateItems(name, in string) *Validation { - msg := fmt.Sprintf(uniqueFail, name, in) - if in == "" { - msg = fmt.Sprintf(uniqueFailNoIn, name) - } - return &Validation{ - code: UniqueFailCode, - Name: name, - In: in, - message: msg, - } -} - -// TooManyItems error for when an array contains too many items -func TooManyItems(name, in string, max int64, value interface{}) *Validation { - msg := fmt.Sprintf(maxItemsFail, name, in, max) - if in == "" { - msg = fmt.Sprintf(maxItemsFailNoIn, name, max) - } - - return &Validation{ - code: MaxItemsFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooFewItems error for when an array contains too few items -func TooFewItems(name, in string, min int64, value interface{}) *Validation { - msg := fmt.Sprintf(minItemsFail, name, in, min) - if in == "" { - msg = fmt.Sprintf(minItemsFailNoIn, name, min) - } - return &Validation{ - code: MinItemsFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// ExceedsMaximumInt error for when maximum validation fails -func ExceedsMaximumInt(name, in string, max int64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMaximumUint error for when maximum validation fails -func ExceedsMaximumUint(name, in string, max uint64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMaximum error for when maximum validation fails -func ExceedsMaximum(name, in string, max float64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := maxIncFailNoIn - if exclusive { - m = maxExcFailNoIn - } - message = fmt.Sprintf(m, name, max) - } else { - m := maxIncFail - if exclusive { - m = maxExcFail - } - message = fmt.Sprintf(m, name, in, max) - } - return &Validation{ - code: MaxFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimumInt error for when minimum validation fails -func ExceedsMinimumInt(name, in string, min int64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimumUint error for when minimum validation fails -func ExceedsMinimumUint(name, in string, min uint64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// ExceedsMinimum error for when minimum validation fails -func ExceedsMinimum(name, in string, min float64, exclusive bool, value interface{}) *Validation { - var message string - if in == "" { - m := minIncFailNoIn - if exclusive { - m = minExcFailNoIn - } - message = fmt.Sprintf(m, name, min) - } else { - m := minIncFail - if exclusive { - m = minExcFail - } - message = fmt.Sprintf(m, name, in, min) - } - return &Validation{ - code: MinFailCode, - Name: name, - In: in, - Value: value, - message: message, - } -} - -// NotMultipleOf error for when multiple of validation fails -func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple) - } else { - msg = fmt.Sprintf(multipleOfFail, name, in, multiple) - } - return &Validation{ - code: MultipleOfFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// EnumFail error for when an enum validation fails -func EnumFail(name, in string, value interface{}, values []interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(enumFailNoIn, name, values) - } else { - msg = fmt.Sprintf(enumFail, name, in, values) - } - - return &Validation{ - code: EnumFailCode, - Name: name, - In: in, - Value: value, - Values: values, - message: msg, - } -} - -// Required error for when a value is missing -func Required(name, in string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(requiredFailNoIn, name) - } else { - msg = fmt.Sprintf(requiredFail, name, in) - } - return &Validation{ - code: RequiredFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// ReadOnly error for when a value is present in request -func ReadOnly(name, in string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(readOnlyFailNoIn, name) - } else { - msg = fmt.Sprintf(readOnlyFail, name, in) - } - return &Validation{ - code: ReadOnlyFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooLong error for when a string is too long -func TooLong(name, in string, max int64, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(tooLongMessageNoIn, name, max) - } else { - msg = fmt.Sprintf(tooLongMessage, name, in, max) - } - return &Validation{ - code: TooLongFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// TooShort error for when a string is too short -func TooShort(name, in string, min int64, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(tooShortMessageNoIn, name, min) - } else { - msg = fmt.Sprintf(tooShortMessage, name, in, min) - } - - return &Validation{ - code: TooShortFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// FailedPattern error for when a string fails a regex pattern match -// the pattern that is returned is the ECMA syntax version of the pattern not the golang version. -func FailedPattern(name, in, pattern string, value interface{}) *Validation { - var msg string - if in == "" { - msg = fmt.Sprintf(patternFailNoIn, name, pattern) - } else { - msg = fmt.Sprintf(patternFail, name, in, pattern) - } - - return &Validation{ - code: PatternFailCode, - Name: name, - In: in, - Value: value, - message: msg, - } -} - -// MultipleOfMustBePositive error for when a -// multipleOf factor is negative -func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation { - return &Validation{ - code: MultipleOfMustBePositiveCode, - Name: name, - In: in, - Value: factor, - message: fmt.Sprintf(multipleOfMustBePositive, name, factor), - } -} diff --git a/vendor/github.com/go-openapi/inflect/.hgignore b/vendor/github.com/go-openapi/inflect/.hgignore deleted file mode 100644 index 6cc3d7ce11..0000000000 --- a/vendor/github.com/go-openapi/inflect/.hgignore +++ /dev/null @@ -1 +0,0 @@ -swp$ diff --git a/vendor/github.com/go-openapi/inflect/LICENCE b/vendor/github.com/go-openapi/inflect/LICENCE deleted file mode 100644 index 8a36b944a5..0000000000 --- a/vendor/github.com/go-openapi/inflect/LICENCE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright (c) 2011 Chris Farmiloe - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/go-openapi/inflect/README b/vendor/github.com/go-openapi/inflect/README deleted file mode 100644 index 014699a222..0000000000 --- a/vendor/github.com/go-openapi/inflect/README +++ /dev/null @@ -1,168 +0,0 @@ -INSTALLATION - -go get bitbucket.org/pkg/inflect - -PACKAGE - -package inflect - - -FUNCTIONS - -func AddAcronym(word string) - -func AddHuman(suffix, replacement string) - -func AddIrregular(singular, plural string) - -func AddPlural(suffix, replacement string) - -func AddSingular(suffix, replacement string) - -func AddUncountable(word string) - -func Asciify(word string) string - -func Camelize(word string) string - -func CamelizeDownFirst(word string) string - -func Capitalize(word string) string - -func Dasherize(word string) string - -func ForeignKey(word string) string - -func ForeignKeyCondensed(word string) string - -func Humanize(word string) string - -func Ordinalize(word string) string - -func Parameterize(word string) string - -func ParameterizeJoin(word, sep string) string - -func Pluralize(word string) string - -func Singularize(word string) string - -func Tableize(word string) string - -func Titleize(word string) string - -func Typeify(word string) string - -func Uncountables() map[string]bool - -func Underscore(word string) string - - -TYPES - -type Rule struct { - // contains filtered or unexported fields -} -used by rulesets - -type Ruleset struct { - // contains filtered or unexported fields -} -a Ruleset is the config of pluralization rules -you can extend the rules with the Add* methods - -func NewDefaultRuleset() *Ruleset -create a new ruleset and load it with the default -set of common English pluralization rules - -func NewRuleset() *Ruleset -create a blank ruleset. Unless you are going to -build your own rules from scratch you probably -won't need this and can just use the defaultRuleset -via the global inflect.* methods - -func (rs *Ruleset) AddAcronym(word string) -if you use acronym you may need to add them to the ruleset -to prevent Underscored words of things like "HTML" coming out -as "h_t_m_l" - -func (rs *Ruleset) AddHuman(suffix, replacement string) -Human rules are applied by humanize to show more friendly -versions of words - -func (rs *Ruleset) AddIrregular(singular, plural string) -Add any inconsistant pluralizing/sinularizing rules -to the set here. - -func (rs *Ruleset) AddPlural(suffix, replacement string) -add a pluralization rule - -func (rs *Ruleset) AddPluralExact(suffix, replacement string, exact bool) -add a pluralization rule with full string match - -func (rs *Ruleset) AddSingular(suffix, replacement string) -add a singular rule - -func (rs *Ruleset) AddSingularExact(suffix, replacement string, exact bool) -same as AddSingular but you can set `exact` to force -a full string match - -func (rs *Ruleset) AddUncountable(word string) -add a word to this ruleset that has the same singular and plural form -for example: "rice" - -func (rs *Ruleset) Asciify(word string) string -transforms latin characters like é -> e - -func (rs *Ruleset) Camelize(word string) string -"dino_party" -> "DinoParty" - -func (rs *Ruleset) CamelizeDownFirst(word string) string -same as Camelcase but with first letter downcased - -func (rs *Ruleset) Capitalize(word string) string -uppercase first character - -func (rs *Ruleset) Dasherize(word string) string -"SomeText" -> "some-text" - -func (rs *Ruleset) ForeignKey(word string) string -an underscored foreign key name "Person" -> "person_id" - -func (rs *Ruleset) ForeignKeyCondensed(word string) string -a foreign key (with an underscore) "Person" -> "personid" - -func (rs *Ruleset) Humanize(word string) string -First letter of sentance captitilized -Uses custom friendly replacements via AddHuman() - -func (rs *Ruleset) Ordinalize(str string) string -"1031" -> "1031st" - -func (rs *Ruleset) Parameterize(word string) string -param safe dasherized names like "my-param" - -func (rs *Ruleset) ParameterizeJoin(word, sep string) string -param safe dasherized names with custom seperator - -func (rs *Ruleset) Pluralize(word string) string -returns the plural form of a singular word - -func (rs *Ruleset) Singularize(word string) string -returns the singular form of a plural word - -func (rs *Ruleset) Tableize(word string) string -Rails style pluralized table names: "SuperPerson" -> "super_people" - -func (rs *Ruleset) Titleize(word string) string -Captitilize every word in sentance "hello there" -> "Hello There" - -func (rs *Ruleset) Typeify(word string) string -"something_like_this" -> "SomethingLikeThis" - -func (rs *Ruleset) Uncountables() map[string]bool - -func (rs *Ruleset) Underscore(word string) string -lowercase underscore version "BigBen" -> "big_ben" - - diff --git a/vendor/github.com/go-openapi/inflect/inflect.go b/vendor/github.com/go-openapi/inflect/inflect.go deleted file mode 100644 index 3008844caf..0000000000 --- a/vendor/github.com/go-openapi/inflect/inflect.go +++ /dev/null @@ -1,713 +0,0 @@ -package inflect - -import ( - "fmt" - "regexp" - "strconv" - "strings" - "unicode" - "unicode/utf8" -) - -// used by rulesets -type Rule struct { - suffix string - replacement string - exact bool -} - -// a Ruleset is the config of pluralization rules -// you can extend the rules with the Add* methods -type Ruleset struct { - uncountables map[string]bool - plurals []*Rule - singulars []*Rule - humans []*Rule - acronyms []*Rule - acronymMatcher *regexp.Regexp -} - -// create a blank ruleset. Unless you are going to -// build your own rules from scratch you probably -// won't need this and can just use the defaultRuleset -// via the global inflect.* methods -func NewRuleset() *Ruleset { - rs := new(Ruleset) - rs.uncountables = make(map[string]bool) - rs.plurals = make([]*Rule, 0) - rs.singulars = make([]*Rule, 0) - rs.humans = make([]*Rule, 0) - rs.acronyms = make([]*Rule, 0) - return rs -} - -// create a new ruleset and load it with the default -// set of common English pluralization rules -func NewDefaultRuleset() *Ruleset { - rs := NewRuleset() - rs.AddPlural("s", "s") - rs.AddPlural("testis", "testes") - rs.AddPlural("axis", "axes") - rs.AddPlural("octopus", "octopi") - rs.AddPlural("virus", "viri") - rs.AddPlural("octopi", "octopi") - rs.AddPlural("viri", "viri") - rs.AddPlural("alias", "aliases") - rs.AddPlural("status", "statuses") - rs.AddPlural("bus", "buses") - rs.AddPlural("buffalo", "buffaloes") - rs.AddPlural("tomato", "tomatoes") - rs.AddPlural("tum", "ta") - rs.AddPlural("ium", "ia") - rs.AddPlural("ta", "ta") - rs.AddPlural("ia", "ia") - rs.AddPlural("sis", "ses") - rs.AddPlural("lf", "lves") - rs.AddPlural("rf", "rves") - rs.AddPlural("afe", "aves") - rs.AddPlural("bfe", "bves") - rs.AddPlural("cfe", "cves") - rs.AddPlural("dfe", "dves") - rs.AddPlural("efe", "eves") - rs.AddPlural("gfe", "gves") - rs.AddPlural("hfe", "hves") - rs.AddPlural("ife", "ives") - rs.AddPlural("jfe", "jves") - rs.AddPlural("kfe", "kves") - rs.AddPlural("lfe", "lves") - rs.AddPlural("mfe", "mves") - rs.AddPlural("nfe", "nves") - rs.AddPlural("ofe", "oves") - rs.AddPlural("pfe", "pves") - rs.AddPlural("qfe", "qves") - rs.AddPlural("rfe", "rves") - rs.AddPlural("sfe", "sves") - rs.AddPlural("tfe", "tves") - rs.AddPlural("ufe", "uves") - rs.AddPlural("vfe", "vves") - rs.AddPlural("wfe", "wves") - rs.AddPlural("xfe", "xves") - rs.AddPlural("yfe", "yves") - rs.AddPlural("zfe", "zves") - rs.AddPlural("hive", "hives") - rs.AddPlural("quy", "quies") - rs.AddPlural("by", "bies") - rs.AddPlural("cy", "cies") - rs.AddPlural("dy", "dies") - rs.AddPlural("fy", "fies") - rs.AddPlural("gy", "gies") - rs.AddPlural("hy", "hies") - rs.AddPlural("jy", "jies") - rs.AddPlural("ky", "kies") - rs.AddPlural("ly", "lies") - rs.AddPlural("my", "mies") - rs.AddPlural("ny", "nies") - rs.AddPlural("py", "pies") - rs.AddPlural("qy", "qies") - rs.AddPlural("ry", "ries") - rs.AddPlural("sy", "sies") - rs.AddPlural("ty", "ties") - rs.AddPlural("vy", "vies") - rs.AddPlural("wy", "wies") - rs.AddPlural("xy", "xies") - rs.AddPlural("zy", "zies") - rs.AddPlural("x", "xes") - rs.AddPlural("ch", "ches") - rs.AddPlural("ss", "sses") - rs.AddPlural("sh", "shes") - rs.AddPlural("matrix", "matrices") - rs.AddPlural("vertix", "vertices") - rs.AddPlural("indix", "indices") - rs.AddPlural("matrex", "matrices") - rs.AddPlural("vertex", "vertices") - rs.AddPlural("index", "indices") - rs.AddPlural("mouse", "mice") - rs.AddPlural("louse", "lice") - rs.AddPlural("mice", "mice") - rs.AddPlural("lice", "lice") - rs.AddPluralExact("ox", "oxen", true) - rs.AddPluralExact("oxen", "oxen", true) - rs.AddPluralExact("quiz", "quizzes", true) - rs.AddSingular("s", "") - rs.AddSingular("news", "news") - rs.AddSingular("ta", "tum") - rs.AddSingular("ia", "ium") - rs.AddSingular("analyses", "analysis") - rs.AddSingular("bases", "basis") - rs.AddSingular("diagnoses", "diagnosis") - rs.AddSingular("parentheses", "parenthesis") - rs.AddSingular("prognoses", "prognosis") - rs.AddSingular("synopses", "synopsis") - rs.AddSingular("theses", "thesis") - rs.AddSingular("analyses", "analysis") - rs.AddSingular("aves", "afe") - rs.AddSingular("bves", "bfe") - rs.AddSingular("cves", "cfe") - rs.AddSingular("dves", "dfe") - rs.AddSingular("eves", "efe") - rs.AddSingular("gves", "gfe") - rs.AddSingular("hves", "hfe") - rs.AddSingular("ives", "ife") - rs.AddSingular("jves", "jfe") - rs.AddSingular("kves", "kfe") - rs.AddSingular("lves", "lfe") - rs.AddSingular("mves", "mfe") - rs.AddSingular("nves", "nfe") - rs.AddSingular("oves", "ofe") - rs.AddSingular("pves", "pfe") - rs.AddSingular("qves", "qfe") - rs.AddSingular("rves", "rfe") - rs.AddSingular("sves", "sfe") - rs.AddSingular("tves", "tfe") - rs.AddSingular("uves", "ufe") - rs.AddSingular("vves", "vfe") - rs.AddSingular("wves", "wfe") - rs.AddSingular("xves", "xfe") - rs.AddSingular("yves", "yfe") - rs.AddSingular("zves", "zfe") - rs.AddSingular("hives", "hive") - rs.AddSingular("tives", "tive") - rs.AddSingular("lves", "lf") - rs.AddSingular("rves", "rf") - rs.AddSingular("quies", "quy") - rs.AddSingular("bies", "by") - rs.AddSingular("cies", "cy") - rs.AddSingular("dies", "dy") - rs.AddSingular("fies", "fy") - rs.AddSingular("gies", "gy") - rs.AddSingular("hies", "hy") - rs.AddSingular("jies", "jy") - rs.AddSingular("kies", "ky") - rs.AddSingular("lies", "ly") - rs.AddSingular("mies", "my") - rs.AddSingular("nies", "ny") - rs.AddSingular("pies", "py") - rs.AddSingular("qies", "qy") - rs.AddSingular("ries", "ry") - rs.AddSingular("sies", "sy") - rs.AddSingular("ties", "ty") - rs.AddSingular("vies", "vy") - rs.AddSingular("wies", "wy") - rs.AddSingular("xies", "xy") - rs.AddSingular("zies", "zy") - rs.AddSingular("series", "series") - rs.AddSingular("movies", "movie") - rs.AddSingular("xes", "x") - rs.AddSingular("ches", "ch") - rs.AddSingular("sses", "ss") - rs.AddSingular("shes", "sh") - rs.AddSingular("mice", "mouse") - rs.AddSingular("lice", "louse") - rs.AddSingular("buses", "bus") - rs.AddSingular("oes", "o") - rs.AddSingular("shoes", "shoe") - rs.AddSingular("crises", "crisis") - rs.AddSingular("axes", "axis") - rs.AddSingular("testes", "testis") - rs.AddSingular("octopi", "octopus") - rs.AddSingular("viri", "virus") - rs.AddSingular("statuses", "status") - rs.AddSingular("aliases", "alias") - rs.AddSingularExact("oxen", "ox", true) - rs.AddSingular("vertices", "vertex") - rs.AddSingular("indices", "index") - rs.AddSingular("matrices", "matrix") - rs.AddSingularExact("quizzes", "quiz", true) - rs.AddSingular("databases", "database") - rs.AddIrregular("person", "people") - rs.AddIrregular("man", "men") - rs.AddIrregular("child", "children") - rs.AddIrregular("sex", "sexes") - rs.AddIrregular("move", "moves") - rs.AddIrregular("zombie", "zombies") - rs.AddUncountable("equipment") - rs.AddUncountable("information") - rs.AddUncountable("rice") - rs.AddUncountable("money") - rs.AddUncountable("species") - rs.AddUncountable("series") - rs.AddUncountable("fish") - rs.AddUncountable("sheep") - rs.AddUncountable("jeans") - rs.AddUncountable("police") - return rs -} - -func (rs *Ruleset) Uncountables() map[string]bool { - return rs.uncountables -} - -// add a pluralization rule -func (rs *Ruleset) AddPlural(suffix, replacement string) { - rs.AddPluralExact(suffix, replacement, false) -} - -// add a pluralization rule with full string match -func (rs *Ruleset) AddPluralExact(suffix, replacement string, exact bool) { - // remove uncountable - delete(rs.uncountables, suffix) - // create rule - r := new(Rule) - r.suffix = suffix - r.replacement = replacement - r.exact = exact - // prepend - rs.plurals = append([]*Rule{r}, rs.plurals...) -} - -// add a singular rule -func (rs *Ruleset) AddSingular(suffix, replacement string) { - rs.AddSingularExact(suffix, replacement, false) -} - -// same as AddSingular but you can set `exact` to force -// a full string match -func (rs *Ruleset) AddSingularExact(suffix, replacement string, exact bool) { - // remove from uncountable - delete(rs.uncountables, suffix) - // create rule - r := new(Rule) - r.suffix = suffix - r.replacement = replacement - r.exact = exact - rs.singulars = append([]*Rule{r}, rs.singulars...) -} - -// Human rules are applied by humanize to show more friendly -// versions of words -func (rs *Ruleset) AddHuman(suffix, replacement string) { - r := new(Rule) - r.suffix = suffix - r.replacement = replacement - rs.humans = append([]*Rule{r}, rs.humans...) -} - -// Add any inconsistant pluralizing/sinularizing rules -// to the set here. -func (rs *Ruleset) AddIrregular(singular, plural string) { - delete(rs.uncountables, singular) - delete(rs.uncountables, plural) - rs.AddPlural(singular, plural) - rs.AddPlural(plural, plural) - rs.AddSingular(plural, singular) -} - -// if you use acronym you may need to add them to the ruleset -// to prevent Underscored words of things like "HTML" coming out -// as "h_t_m_l" -func (rs *Ruleset) AddAcronym(word string) { - r := new(Rule) - r.suffix = word - r.replacement = rs.Titleize(strings.ToLower(word)) - rs.acronyms = append(rs.acronyms, r) -} - -// add a word to this ruleset that has the same singular and plural form -// for example: "rice" -func (rs *Ruleset) AddUncountable(word string) { - rs.uncountables[strings.ToLower(word)] = true -} - -func (rs *Ruleset) isUncountable(word string) bool { - // handle multiple words by using the last one - words := strings.Split(word, " ") - if _, exists := rs.uncountables[strings.ToLower(words[len(words)-1])]; exists { - return true - } - return false -} - -// returns the plural form of a singular word -func (rs *Ruleset) Pluralize(word string) string { - if len(word) == 0 { - return word - } - if rs.isUncountable(word) { - return word - } - for _, rule := range rs.plurals { - if rule.exact { - if word == rule.suffix { - return rule.replacement - } - } else { - if strings.HasSuffix(word, rule.suffix) { - return replaceLast(word, rule.suffix, rule.replacement) - } - } - } - return word + "s" -} - -// returns the singular form of a plural word -func (rs *Ruleset) Singularize(word string) string { - if len(word) == 0 { - return word - } - if rs.isUncountable(word) { - return word - } - for _, rule := range rs.singulars { - if rule.exact { - if word == rule.suffix { - return rule.replacement - } - } else { - if strings.HasSuffix(word, rule.suffix) { - return replaceLast(word, rule.suffix, rule.replacement) - } - } - } - return word -} - -// uppercase first character -func (rs *Ruleset) Capitalize(word string) string { - return strings.ToUpper(word[:1]) + word[1:] -} - -// "dino_party" -> "DinoParty" -func (rs *Ruleset) Camelize(word string) string { - words := splitAtCaseChangeWithTitlecase(word) - return strings.Join(words, "") -} - -// same as Camelcase but with first letter downcased -func (rs *Ruleset) CamelizeDownFirst(word string) string { - word = Camelize(word) - return strings.ToLower(word[:1]) + word[1:] -} - -// Captitilize every word in sentance "hello there" -> "Hello There" -func (rs *Ruleset) Titleize(word string) string { - words := splitAtCaseChangeWithTitlecase(word) - return strings.Join(words, " ") -} - -func (rs *Ruleset) safeCaseAcronyms(word string) string { - // convert an acroymn like HTML into Html - for _, rule := range rs.acronyms { - word = strings.Replace(word, rule.suffix, rule.replacement, -1) - } - return word -} - -func (rs *Ruleset) seperatedWords(word, sep string) string { - word = rs.safeCaseAcronyms(word) - words := splitAtCaseChange(word) - return strings.Join(words, sep) -} - -// lowercase underscore version "BigBen" -> "big_ben" -func (rs *Ruleset) Underscore(word string) string { - return rs.seperatedWords(word, "_") -} - -// First letter of sentance captitilized -// Uses custom friendly replacements via AddHuman() -func (rs *Ruleset) Humanize(word string) string { - word = replaceLast(word, "_id", "") // strip foreign key kinds - // replace and strings in humans list - for _, rule := range rs.humans { - word = strings.Replace(word, rule.suffix, rule.replacement, -1) - } - sentance := rs.seperatedWords(word, " ") - return strings.ToUpper(sentance[:1]) + sentance[1:] -} - -// an underscored foreign key name "Person" -> "person_id" -func (rs *Ruleset) ForeignKey(word string) string { - return rs.Underscore(rs.Singularize(word)) + "_id" -} - -// a foreign key (with an underscore) "Person" -> "personid" -func (rs *Ruleset) ForeignKeyCondensed(word string) string { - return rs.Underscore(word) + "id" -} - -// Rails style pluralized table names: "SuperPerson" -> "super_people" -func (rs *Ruleset) Tableize(word string) string { - return rs.Pluralize(rs.Underscore(rs.Typeify(word))) -} - -var notUrlSafe *regexp.Regexp = regexp.MustCompile(`[^\w\d\-_ ]`) - -// param safe dasherized names like "my-param" -func (rs *Ruleset) Parameterize(word string) string { - return ParameterizeJoin(word, "-") -} - -// param safe dasherized names with custom seperator -func (rs *Ruleset) ParameterizeJoin(word, sep string) string { - word = strings.ToLower(word) - word = rs.Asciify(word) - word = notUrlSafe.ReplaceAllString(word, "") - word = strings.Replace(word, " ", sep, -1) - if len(sep) > 0 { - squash, err := regexp.Compile(sep + "+") - if err == nil { - word = squash.ReplaceAllString(word, sep) - } - } - word = strings.Trim(word, sep+" ") - return word -} - -var lookalikes map[string]*regexp.Regexp = map[string]*regexp.Regexp{ - "A": regexp.MustCompile(`À|Á|Â|Ã|Ä|Å`), - "AE": regexp.MustCompile(`Æ`), - "C": regexp.MustCompile(`Ç`), - "E": regexp.MustCompile(`È|É|Ê|Ë`), - "G": regexp.MustCompile(`Ğ`), - "I": regexp.MustCompile(`Ì|Í|Î|Ï|İ`), - "N": regexp.MustCompile(`Ñ`), - "O": regexp.MustCompile(`Ò|Ó|Ô|Õ|Ö|Ø`), - "S": regexp.MustCompile(`Ş`), - "U": regexp.MustCompile(`Ù|Ú|Û|Ü`), - "Y": regexp.MustCompile(`Ý`), - "ss": regexp.MustCompile(`ß`), - "a": regexp.MustCompile(`à|á|â|ã|ä|å`), - "ae": regexp.MustCompile(`æ`), - "c": regexp.MustCompile(`ç`), - "e": regexp.MustCompile(`è|é|ê|ë`), - "g": regexp.MustCompile(`ğ`), - "i": regexp.MustCompile(`ì|í|î|ï|ı`), - "n": regexp.MustCompile(`ñ`), - "o": regexp.MustCompile(`ò|ó|ô|õ|ö|ø`), - "s": regexp.MustCompile(`ş`), - "u": regexp.MustCompile(`ù|ú|û|ü|ũ|ū|ŭ|ů|ű|ų`), - "y": regexp.MustCompile(`ý|ÿ`), -} - -// transforms latin characters like é -> e -func (rs *Ruleset) Asciify(word string) string { - for repl, regex := range lookalikes { - word = regex.ReplaceAllString(word, repl) - } - return word -} - -var tablePrefix *regexp.Regexp = regexp.MustCompile(`^[^.]*\.`) - -// "something_like_this" -> "SomethingLikeThis" -func (rs *Ruleset) Typeify(word string) string { - word = tablePrefix.ReplaceAllString(word, "") - return rs.Camelize(rs.Singularize(word)) -} - -// "SomeText" -> "some-text" -func (rs *Ruleset) Dasherize(word string) string { - return rs.seperatedWords(word, "-") -} - -// "1031" -> "1031st" -func (rs *Ruleset) Ordinalize(str string) string { - number, err := strconv.Atoi(str) - if err != nil { - return str - } - switch abs(number) % 100 { - case 11, 12, 13: - return fmt.Sprintf("%dth", number) - default: - switch abs(number) % 10 { - case 1: - return fmt.Sprintf("%dst", number) - case 2: - return fmt.Sprintf("%dnd", number) - case 3: - return fmt.Sprintf("%drd", number) - } - } - return fmt.Sprintf("%dth", number) -} - -///////////////////////////////////////// -// the default global ruleset -////////////////////////////////////////// - -var defaultRuleset *Ruleset - -func init() { - defaultRuleset = NewDefaultRuleset() -} - -func Uncountables() map[string]bool { - return defaultRuleset.Uncountables() -} - -func AddPlural(suffix, replacement string) { - defaultRuleset.AddPlural(suffix, replacement) -} - -func AddSingular(suffix, replacement string) { - defaultRuleset.AddSingular(suffix, replacement) -} - -func AddHuman(suffix, replacement string) { - defaultRuleset.AddHuman(suffix, replacement) -} - -func AddIrregular(singular, plural string) { - defaultRuleset.AddIrregular(singular, plural) -} - -func AddAcronym(word string) { - defaultRuleset.AddAcronym(word) -} - -func AddUncountable(word string) { - defaultRuleset.AddUncountable(word) -} - -func Pluralize(word string) string { - return defaultRuleset.Pluralize(word) -} - -func Singularize(word string) string { - return defaultRuleset.Singularize(word) -} - -func Capitalize(word string) string { - return defaultRuleset.Capitalize(word) -} - -func Camelize(word string) string { - return defaultRuleset.Camelize(word) -} - -func CamelizeDownFirst(word string) string { - return defaultRuleset.CamelizeDownFirst(word) -} - -func Titleize(word string) string { - return defaultRuleset.Titleize(word) -} - -func Underscore(word string) string { - return defaultRuleset.Underscore(word) -} - -func Humanize(word string) string { - return defaultRuleset.Humanize(word) -} - -func ForeignKey(word string) string { - return defaultRuleset.ForeignKey(word) -} - -func ForeignKeyCondensed(word string) string { - return defaultRuleset.ForeignKeyCondensed(word) -} - -func Tableize(word string) string { - return defaultRuleset.Tableize(word) -} - -func Parameterize(word string) string { - return defaultRuleset.Parameterize(word) -} - -func ParameterizeJoin(word, sep string) string { - return defaultRuleset.ParameterizeJoin(word, sep) -} - -func Typeify(word string) string { - return defaultRuleset.Typeify(word) -} - -func Dasherize(word string) string { - return defaultRuleset.Dasherize(word) -} - -func Ordinalize(word string) string { - return defaultRuleset.Ordinalize(word) -} - -func Asciify(word string) string { - return defaultRuleset.Asciify(word) -} - -// helper funcs - -func reverse(s string) string { - o := make([]rune, utf8.RuneCountInString(s)) - i := len(o) - for _, c := range s { - i-- - o[i] = c - } - return string(o) -} - -func isSpacerChar(c rune) bool { - switch { - case c == rune("_"[0]): - return true - case c == rune(" "[0]): - return true - case c == rune(":"[0]): - return true - case c == rune("-"[0]): - return true - } - return false -} - -func splitAtCaseChange(s string) []string { - words := make([]string, 0) - word := make([]rune, 0) - for _, c := range s { - spacer := isSpacerChar(c) - if len(word) > 0 { - if unicode.IsUpper(c) || spacer { - words = append(words, string(word)) - word = make([]rune, 0) - } - } - if !spacer { - word = append(word, unicode.ToLower(c)) - } - } - words = append(words, string(word)) - return words -} - -func splitAtCaseChangeWithTitlecase(s string) []string { - words := make([]string, 0) - word := make([]rune, 0) - for _, c := range s { - spacer := isSpacerChar(c) - if len(word) > 0 { - if unicode.IsUpper(c) || spacer { - words = append(words, string(word)) - word = make([]rune, 0) - } - } - if !spacer { - if len(word) > 0 { - word = append(word, unicode.ToLower(c)) - } else { - word = append(word, unicode.ToUpper(c)) - } - } - } - words = append(words, string(word)) - return words -} - -func replaceLast(s, match, repl string) string { - // reverse strings - srev := reverse(s) - mrev := reverse(match) - rrev := reverse(repl) - // match first and reverse back - return reverse(strings.Replace(srev, mrev, rrev, 1)) -} - -func abs(x int) int { - if x < 0 { - return -x - } - return x -} diff --git a/vendor/github.com/go-openapi/jsonpointer/.editorconfig b/vendor/github.com/go-openapi/jsonpointer/.editorconfig deleted file mode 100644 index 3152da69a5..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/jsonpointer/.gitignore b/vendor/github.com/go-openapi/jsonpointer/.gitignore deleted file mode 100644 index 769c244007..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonpointer/LICENSE b/vendor/github.com/go-openapi/jsonpointer/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md deleted file mode 100644 index 813788aff1..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonpointer [![Build Status](https://travis-ci.org/go-openapi/jsonpointer.svg?branch=master)](https://travis-ci.org/go-openapi/jsonpointer) [![codecov](https://codecov.io/gh/go-openapi/jsonpointer/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonpointer) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonpointer/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonpointer?status.svg)](http://godoc.org/github.com/go-openapi/jsonpointer) -An implementation of JSON Pointer - Go language - -## Status -Completed YES - -Tested YES - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -### Note -The 4.Evaluation part of the previous reference, starting with 'If the currently referenced value is a JSON array, the reference token MUST contain either...' is not implemented. diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go deleted file mode 100644 index de60dc7dd2..0000000000 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ /dev/null @@ -1,511 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonpointer -// repository-desc An implementation of JSON Pointer - Go language -// -// description Main and unique file. -// -// created 25-02-2013 - -package jsonpointer - -import ( - "encoding/json" - "errors" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/go-openapi/swag" -) - -const ( - emptyPointer = `` - pointerSeparator = `/` - - invalidStart = `JSON pointer must be empty or start with a "` + pointerSeparator - notFound = `Can't find the pointer in the document` -) - -var jsonPointableType = reflect.TypeOf(new(JSONPointable)).Elem() -var jsonSetableType = reflect.TypeOf(new(JSONSetable)).Elem() - -// JSONPointable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONPointable interface { - JSONLookup(string) (any, error) -} - -// JSONSetable is an interface for structs to implement when they need to customize the -// json pointer process -type JSONSetable interface { - JSONSet(string, any) error -} - -// New creates a new json pointer for the given string -func New(jsonPointerString string) (Pointer, error) { - - var p Pointer - err := p.parse(jsonPointerString) - return p, err - -} - -// Pointer the json pointer reprsentation -type Pointer struct { - referenceTokens []string -} - -// "Constructor", parses the given string JSON pointer -func (p *Pointer) parse(jsonPointerString string) error { - - var err error - - if jsonPointerString != emptyPointer { - if !strings.HasPrefix(jsonPointerString, pointerSeparator) { - err = errors.New(invalidStart) - } else { - referenceTokens := strings.Split(jsonPointerString, pointerSeparator) - p.referenceTokens = append(p.referenceTokens, referenceTokens[1:]...) - } - } - - return err -} - -// Get uses the pointer to retrieve a value from a JSON document -func (p *Pointer) Get(document any) (any, reflect.Kind, error) { - return p.get(document, swag.DefaultJSONNameProvider) -} - -// Set uses the pointer to set a value from a JSON document -func (p *Pointer) Set(document any, value any) (any, error) { - return document, p.set(document, value, swag.DefaultJSONNameProvider) -} - -// GetForToken gets a value for a json pointer token 1 level deep -func GetForToken(document any, decodedToken string) (any, reflect.Kind, error) { - return getSingleImpl(document, decodedToken, swag.DefaultJSONNameProvider) -} - -// SetForToken gets a value for a json pointer token 1 level deep -func SetForToken(document any, decodedToken string, value any) (any, error) { - return document, setSingleImpl(document, value, decodedToken, swag.DefaultJSONNameProvider) -} - -func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvider) (any, reflect.Kind, error) { - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return nil, kind, err - } - return r, kind, nil - } - - switch kind { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return nil, kind, fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - return fld.Interface(), kind, nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if mv.IsValid() { - return mv.Interface(), kind, nil - } - return nil, kind, fmt.Errorf("object has no key %q", decodedToken) - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return nil, kind, err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return nil, kind, fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength-1, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - return elem.Interface(), kind, nil - - default: - return nil, kind, fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameProvider) error { - rValue := reflect.Indirect(reflect.ValueOf(node)) - - if ns, ok := node.(JSONSetable); ok { // pointer impl - return ns.JSONSet(decodedToken, data) - } - - if rValue.Type().Implements(jsonSetableType) { - return node.(JSONSetable).JSONSet(decodedToken, data) - } - - switch rValue.Kind() { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.IsValid() { - fld.Set(reflect.ValueOf(data)) - } - return nil - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - rValue.SetMapIndex(kv, reflect.ValueOf(data)) - return nil - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if !elem.CanSet() { - return fmt.Errorf("can't set slice index %s to %v", decodedToken, data) - } - elem.Set(reflect.ValueOf(data)) - return nil - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - -} - -func (p *Pointer) get(node any, nameProvider *swag.NameProvider) (any, reflect.Kind, error) { - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - kind := reflect.Invalid - - // Full document when empty - if len(p.referenceTokens) == 0 { - return node, kind, nil - } - - for _, token := range p.referenceTokens { - - decodedToken := Unescape(token) - - r, knd, err := getSingleImpl(node, decodedToken, nameProvider) - if err != nil { - return nil, knd, err - } - node, kind = r, knd - - } - - rValue := reflect.ValueOf(node) - kind = rValue.Kind() - - return node, kind, nil -} - -func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error { - knd := reflect.ValueOf(node).Kind() - - if knd != reflect.Ptr && knd != reflect.Struct && knd != reflect.Map && knd != reflect.Slice && knd != reflect.Array { - return fmt.Errorf("only structs, pointers, maps and slices are supported for setting values") - } - - if nameProvider == nil { - nameProvider = swag.DefaultJSONNameProvider - } - - // Full document when empty - if len(p.referenceTokens) == 0 { - return nil - } - - lastI := len(p.referenceTokens) - 1 - for i, token := range p.referenceTokens { - isLastToken := i == lastI - decodedToken := Unescape(token) - - if isLastToken { - - return setSingleImpl(node, data, decodedToken, nameProvider) - } - - rValue := reflect.Indirect(reflect.ValueOf(node)) - kind := rValue.Kind() - - if rValue.Type().Implements(jsonPointableType) { - r, err := node.(JSONPointable).JSONLookup(decodedToken) - if err != nil { - return err - } - fld := reflect.ValueOf(r) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = r - continue - } - - switch kind { - case reflect.Struct: - nm, ok := nameProvider.GetGoNameForType(rValue.Type(), decodedToken) - if !ok { - return fmt.Errorf("object has no field %q", decodedToken) - } - fld := rValue.FieldByName(nm) - if fld.CanAddr() && fld.Kind() != reflect.Interface && fld.Kind() != reflect.Map && fld.Kind() != reflect.Slice && fld.Kind() != reflect.Ptr { - node = fld.Addr().Interface() - continue - } - node = fld.Interface() - - case reflect.Map: - kv := reflect.ValueOf(decodedToken) - mv := rValue.MapIndex(kv) - - if !mv.IsValid() { - return fmt.Errorf("object has no key %q", decodedToken) - } - if mv.CanAddr() && mv.Kind() != reflect.Interface && mv.Kind() != reflect.Map && mv.Kind() != reflect.Slice && mv.Kind() != reflect.Ptr { - node = mv.Addr().Interface() - continue - } - node = mv.Interface() - - case reflect.Slice: - tokenIndex, err := strconv.Atoi(decodedToken) - if err != nil { - return err - } - sLength := rValue.Len() - if tokenIndex < 0 || tokenIndex >= sLength { - return fmt.Errorf("index out of bounds array[0,%d] index '%d'", sLength, tokenIndex) - } - - elem := rValue.Index(tokenIndex) - if elem.CanAddr() && elem.Kind() != reflect.Interface && elem.Kind() != reflect.Map && elem.Kind() != reflect.Slice && elem.Kind() != reflect.Ptr { - node = elem.Addr().Interface() - continue - } - node = elem.Interface() - - default: - return fmt.Errorf("invalid token reference %q", decodedToken) - } - - } - - return nil -} - -// DecodedTokens returns the decoded tokens -func (p *Pointer) DecodedTokens() []string { - result := make([]string, 0, len(p.referenceTokens)) - for _, t := range p.referenceTokens { - result = append(result, Unescape(t)) - } - return result -} - -// IsEmpty returns true if this is an empty json pointer -// this indicates that it points to the root document -func (p *Pointer) IsEmpty() bool { - return len(p.referenceTokens) == 0 -} - -// Pointer to string representation function -func (p *Pointer) String() string { - - if len(p.referenceTokens) == 0 { - return emptyPointer - } - - pointerString := pointerSeparator + strings.Join(p.referenceTokens, pointerSeparator) - - return pointerString -} - -func (p *Pointer) Offset(document string) (int64, error) { - dec := json.NewDecoder(strings.NewReader(document)) - var offset int64 - for _, ttk := range p.DecodedTokens() { - tk, err := dec.Token() - if err != nil { - return 0, err - } - switch tk := tk.(type) { - case json.Delim: - switch tk { - case '{': - offset, err = offsetSingleObject(dec, ttk) - if err != nil { - return 0, err - } - case '[': - offset, err = offsetSingleArray(dec, ttk) - if err != nil { - return 0, err - } - default: - return 0, fmt.Errorf("invalid token %#v", tk) - } - default: - return 0, fmt.Errorf("invalid token %#v", tk) - } - } - return offset, nil -} - -func offsetSingleObject(dec *json.Decoder, decodedToken string) (int64, error) { - for dec.More() { - offset := dec.InputOffset() - tk, err := dec.Token() - if err != nil { - return 0, err - } - switch tk := tk.(type) { - case json.Delim: - switch tk { - case '{': - if err := drainSingle(dec); err != nil { - return 0, err - } - case '[': - if err := drainSingle(dec); err != nil { - return 0, err - } - } - case string: - if tk == decodedToken { - return offset, nil - } - default: - return 0, fmt.Errorf("invalid token %#v", tk) - } - } - return 0, fmt.Errorf("token reference %q not found", decodedToken) -} - -func offsetSingleArray(dec *json.Decoder, decodedToken string) (int64, error) { - idx, err := strconv.Atoi(decodedToken) - if err != nil { - return 0, fmt.Errorf("token reference %q is not a number: %v", decodedToken, err) - } - var i int - for i = 0; i < idx && dec.More(); i++ { - tk, err := dec.Token() - if err != nil { - return 0, err - } - switch tk := tk.(type) { - case json.Delim: - switch tk { - case '{': - if err := drainSingle(dec); err != nil { - return 0, err - } - case '[': - if err := drainSingle(dec); err != nil { - return 0, err - } - } - } - } - if !dec.More() { - return 0, fmt.Errorf("token reference %q not found", decodedToken) - } - return dec.InputOffset(), nil -} - -// drainSingle drains a single level of object or array. -// The decoder has to guarantee the begining delim (i.e. '{' or '[') has been consumed. -func drainSingle(dec *json.Decoder) error { - for dec.More() { - tk, err := dec.Token() - if err != nil { - return err - } - switch tk := tk.(type) { - case json.Delim: - switch tk { - case '{': - if err := drainSingle(dec); err != nil { - return err - } - case '[': - if err := drainSingle(dec); err != nil { - return err - } - } - } - } - // Consumes the ending delim - if _, err := dec.Token(); err != nil { - return err - } - return nil -} - -// Specific JSON pointer encoding here -// ~0 => ~ -// ~1 => / -// ... and vice versa - -const ( - encRefTok0 = `~0` - encRefTok1 = `~1` - decRefTok0 = `~` - decRefTok1 = `/` -) - -// Unescape unescapes a json pointer reference token string to the original representation -func Unescape(token string) string { - step1 := strings.Replace(token, encRefTok1, decRefTok1, -1) - step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1) - return step2 -} - -// Escape escapes a pointer reference token string -func Escape(token string) string { - step1 := strings.Replace(token, decRefTok0, encRefTok0, -1) - step2 := strings.Replace(step1, decRefTok1, encRefTok1, -1) - return step2 -} diff --git a/vendor/github.com/go-openapi/jsonreference/.gitignore b/vendor/github.com/go-openapi/jsonreference/.gitignore deleted file mode 100644 index 769c244007..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.yml diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml deleted file mode 100644 index 013fc1943a..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ /dev/null @@ -1,50 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 - paralleltest: - ignore-missing: true -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - varcheck - - interfacer - - deadcode - - golint - - ifshort - - structcheck - - nosnakecase - - varnamelen - - exhaustruct diff --git a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/jsonreference/LICENSE b/vendor/github.com/go-openapi/jsonreference/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md deleted file mode 100644 index b94753aa52..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference) -An implementation of JSON Reference - Go language - -## Status -Feature complete. Stable API - -## Dependencies -https://github.com/go-openapi/jsonpointer - -## References -http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07 - -http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03 diff --git a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go deleted file mode 100644 index f0610cf1e5..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go +++ /dev/null @@ -1,69 +0,0 @@ -package internal - -import ( - "net/url" - "regexp" - "strings" -) - -const ( - defaultHTTPPort = ":80" - defaultHTTPSPort = ":443" -) - -// Regular expressions used by the normalizations -var rxPort = regexp.MustCompile(`(:\d+)/?$`) -var rxDupSlashes = regexp.MustCompile(`/{2,}`) - -// NormalizeURL will normalize the specified URL -// This was added to replace a previous call to the no longer maintained purell library: -// The call that was used looked like the following: -// -// url.Parse(purell.NormalizeURL(parsed, purell.FlagsSafe|purell.FlagRemoveDuplicateSlashes)) -// -// To explain all that was included in the call above, purell.FlagsSafe was really just the following: -// - FlagLowercaseScheme -// - FlagLowercaseHost -// - FlagRemoveDefaultPort -// - FlagRemoveDuplicateSlashes (and this was mixed in with the |) -// -// This also normalizes the URL into its urlencoded form by removing RawPath and RawFragment. -func NormalizeURL(u *url.URL) { - lowercaseScheme(u) - lowercaseHost(u) - removeDefaultPort(u) - removeDuplicateSlashes(u) - - u.RawPath = "" - u.RawFragment = "" -} - -func lowercaseScheme(u *url.URL) { - if len(u.Scheme) > 0 { - u.Scheme = strings.ToLower(u.Scheme) - } -} - -func lowercaseHost(u *url.URL) { - if len(u.Host) > 0 { - u.Host = strings.ToLower(u.Host) - } -} - -func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHTTPPort) || (scheme == "https" && val == defaultHTTPSPort) { - return "" - } - return val - }) - } -} - -func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") - } -} diff --git a/vendor/github.com/go-openapi/jsonreference/reference.go b/vendor/github.com/go-openapi/jsonreference/reference.go deleted file mode 100644 index cfdef03e5d..0000000000 --- a/vendor/github.com/go-openapi/jsonreference/reference.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2013 sigu-399 ( https://github.com/sigu-399 ) -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// author sigu-399 -// author-github https://github.com/sigu-399 -// author-mail sigu.399@gmail.com -// -// repository-name jsonreference -// repository-desc An implementation of JSON Reference - Go language -// -// description Main and unique file. -// -// created 26-02-2013 - -package jsonreference - -import ( - "errors" - "net/url" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/jsonreference/internal" -) - -const ( - fragmentRune = `#` -) - -// New creates a new reference for the given string -func New(jsonReferenceString string) (Ref, error) { - - var r Ref - err := r.parse(jsonReferenceString) - return r, err - -} - -// MustCreateRef parses the ref string and panics when it's invalid. -// Use the New method for a version that returns an error -func MustCreateRef(ref string) Ref { - r, err := New(ref) - if err != nil { - panic(err) - } - return r -} - -// Ref represents a json reference object -type Ref struct { - referenceURL *url.URL - referencePointer jsonpointer.Pointer - - HasFullURL bool - HasURLPathOnly bool - HasFragmentOnly bool - HasFileScheme bool - HasFullFilePath bool -} - -// GetURL gets the URL for this reference -func (r *Ref) GetURL() *url.URL { - return r.referenceURL -} - -// GetPointer gets the json pointer for this reference -func (r *Ref) GetPointer() *jsonpointer.Pointer { - return &r.referencePointer -} - -// String returns the best version of the url for this reference -func (r *Ref) String() string { - - if r.referenceURL != nil { - return r.referenceURL.String() - } - - if r.HasFragmentOnly { - return fragmentRune + r.referencePointer.String() - } - - return r.referencePointer.String() -} - -// IsRoot returns true if this reference is a root document -func (r *Ref) IsRoot() bool { - return r.referenceURL != nil && - !r.IsCanonical() && - !r.HasURLPathOnly && - r.referenceURL.Fragment == "" -} - -// IsCanonical returns true when this pointer starts with http(s):// or file:// -func (r *Ref) IsCanonical() bool { - return (r.HasFileScheme && r.HasFullFilePath) || (!r.HasFileScheme && r.HasFullURL) -} - -// "Constructor", parses the given string JSON reference -func (r *Ref) parse(jsonReferenceString string) error { - - parsed, err := url.Parse(jsonReferenceString) - if err != nil { - return err - } - - internal.NormalizeURL(parsed) - - r.referenceURL = parsed - refURL := r.referenceURL - - if refURL.Scheme != "" && refURL.Host != "" { - r.HasFullURL = true - } else { - if refURL.Path != "" { - r.HasURLPathOnly = true - } else if refURL.RawQuery == "" && refURL.Fragment != "" { - r.HasFragmentOnly = true - } - } - - r.HasFileScheme = refURL.Scheme == "file" - r.HasFullFilePath = strings.HasPrefix(refURL.Path, "/") - - // invalid json-pointer error means url has no json-pointer fragment. simply ignore error - r.referencePointer, _ = jsonpointer.New(refURL.Fragment) - - return nil -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - childURL := child.GetURL() - parentURL := r.GetURL() - if childURL == nil { - return nil, errors.New("child url is nil") - } - if parentURL == nil { - return &child, nil - } - - ref, err := New(parentURL.ResolveReference(childURL).String()) - if err != nil { - return nil, err - } - return &ref, nil -} diff --git a/vendor/github.com/go-openapi/loads/.editorconfig b/vendor/github.com/go-openapi/loads/.editorconfig deleted file mode 100644 index 3152da69a5..0000000000 --- a/vendor/github.com/go-openapi/loads/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/loads/.gitignore b/vendor/github.com/go-openapi/loads/.gitignore deleted file mode 100644 index e4f15f17bf..0000000000 --- a/vendor/github.com/go-openapi/loads/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -secrets.yml -coverage.out -profile.cov -profile.out diff --git a/vendor/github.com/go-openapi/loads/.golangci.yml b/vendor/github.com/go-openapi/loads/.golangci.yml deleted file mode 100644 index d48b4a5156..0000000000 --- a/vendor/github.com/go-openapi/loads/.golangci.yml +++ /dev/null @@ -1,44 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable-all: true - disable: - - maligned - - lll - - gochecknoglobals - - gochecknoinits - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - paralleltest diff --git a/vendor/github.com/go-openapi/loads/.travis.yml b/vendor/github.com/go-openapi/loads/.travis.yml deleted file mode 100644 index cd4a7c331b..0000000000 --- a/vendor/github.com/go-openapi/loads/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -after_success: -- bash <(curl -s https://codecov.io/bash) -go: -- 1.16.x -- 1.x -install: -- go get gotest.tools/gotestsum -language: go -arch: -- amd64 -- ppc64le -jobs: - include: - # include linting job, but only for latest go version and amd64 arch - - go: 1.x - arch: amd64 - install: - go get github.com/golangci/golangci-lint/cmd/golangci-lint - script: - - golangci-lint run --new-from-rev master -notifications: - slack: - secure: OxkPwVp35qBTUilgWC8xykSj+sGMcj0h8IIOKD+Rflx2schZVlFfdYdyVBM+s9OqeOfvtuvnR9v1Ye2rPKAvcjWdC4LpRGUsgmItZaI6Um8Aj6+K9udCw5qrtZVfOVmRu8LieH//XznWWKdOultUuniW0MLqw5+II87Gd00RWbCGi0hk0PykHe7uK+PDA2BEbqyZ2WKKYCvfB3j+0nrFOHScXqnh0V05l2E83J4+Sgy1fsPy+1WdX58ZlNBG333ibaC1FS79XvKSmTgKRkx3+YBo97u6ZtUmJa5WZjf2OdLG3KIckGWAv6R5xgxeU31N0Ng8L332w/Edpp2O/M2bZwdnKJ8hJQikXIAQbICbr+lTDzsoNzMdEIYcHpJ5hjPbiUl3Bmd+Jnsjf5McgAZDiWIfpCKZ29tPCEkVwRsOCqkyPRMNMzHHmoja495P5jR+ODS7+J8RFg5xgcnOgpP9D4Wlhztlf5WyZMpkLxTUD+bZq2SRf50HfHFXTkfq22zPl3d1eq0yrLwh/Z/fWKkfb6SyysROL8y6s8u3dpFX1YHSg0BR6i913h4aoZw9B2BG27cafLLTwKYsp2dFo1PWl4O6u9giFJIeqwloZHLKKrwh0cBFhB7RH0I58asxkZpCH6uWjJierahmHe7iS+E6i+9oCHkOZ59hmCYNimIs3hM= -script: -- gotestsum -f short-verbose -- -race -timeout=20m -coverprofile=coverage.txt -covermode=atomic ./... diff --git a/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/loads/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/loads/LICENSE b/vendor/github.com/go-openapi/loads/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/loads/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/loads/README.md b/vendor/github.com/go-openapi/loads/README.md deleted file mode 100644 index df1f626462..0000000000 --- a/vendor/github.com/go-openapi/loads/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Loads OAI specs [![Build Status](https://travis-ci.org/go-openapi/loads.svg?branch=master)](https://travis-ci.org/go-openapi/loads) [![codecov](https://codecov.io/gh/go-openapi/loads/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/loads) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) [![Actions/Go Test Status](https://github.com/go-openapi/loads/workflows/Go%20Test/badge.svg)](https://github.com/go-openapi/loads/actions?query=workflow%3A"Go+Test") - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/loads/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/loads?status.svg)](http://godoc.org/github.com/go-openapi/loads) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/loads)](https://goreportcard.com/report/github.com/go-openapi/loads) - -Loading of OAI specification documents from local or remote locations. Supports JSON and YAML documents. diff --git a/vendor/github.com/go-openapi/loads/doc.go b/vendor/github.com/go-openapi/loads/doc.go deleted file mode 100644 index 3046da4cef..0000000000 --- a/vendor/github.com/go-openapi/loads/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* -Package loads provides document loading methods for swagger (OAI) specifications. - -It is used by other go-openapi packages to load and run analysis on local or remote spec documents. - -*/ -package loads diff --git a/vendor/github.com/go-openapi/loads/fmts/yaml.go b/vendor/github.com/go-openapi/loads/fmts/yaml.go deleted file mode 100644 index 1cef2ac22b..0000000000 --- a/vendor/github.com/go-openapi/loads/fmts/yaml.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package fmts - -import "github.com/go-openapi/swag" - -var ( - // YAMLMatcher matches yaml - YAMLMatcher = swag.YAMLMatcher - // YAMLToJSON converts YAML unmarshaled data into json compatible data - YAMLToJSON = swag.YAMLToJSON - // BytesToYAMLDoc converts raw bytes to a map[string]interface{} - BytesToYAMLDoc = swag.BytesToYAMLDoc - // YAMLDoc loads a yaml document from either http or a file and converts it to json - YAMLDoc = swag.YAMLDoc - // YAMLData loads a yaml document from either http or a file - YAMLData = swag.YAMLData -) diff --git a/vendor/github.com/go-openapi/loads/loaders.go b/vendor/github.com/go-openapi/loads/loaders.go deleted file mode 100644 index 44bd32b5b8..0000000000 --- a/vendor/github.com/go-openapi/loads/loaders.go +++ /dev/null @@ -1,134 +0,0 @@ -package loads - -import ( - "encoding/json" - "errors" - "net/url" - - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -var ( - // Default chain of loaders, defined at the package level. - // - // By default this matches json and yaml documents. - // - // May be altered with AddLoader(). - loaders *loader -) - -func init() { - jsonLoader := &loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: func(pth string) bool { - return true - }, - Fn: JSONDoc, - }, - } - - loaders = jsonLoader.WithHead(&loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: swag.YAMLMatcher, - Fn: swag.YAMLDoc, - }, - }) - - // sets the global default loader for go-openapi/spec - spec.PathLoader = loaders.Load -} - -// DocLoader represents a doc loader type -type DocLoader func(string) (json.RawMessage, error) - -// DocMatcher represents a predicate to check if a loader matches -type DocMatcher func(string) bool - -// DocLoaderWithMatch describes a loading function for a given extension match. -type DocLoaderWithMatch struct { - Fn DocLoader - Match DocMatcher -} - -// NewDocLoaderWithMatch builds a DocLoaderWithMatch to be used in load options -func NewDocLoaderWithMatch(fn DocLoader, matcher DocMatcher) DocLoaderWithMatch { - return DocLoaderWithMatch{ - Fn: fn, - Match: matcher, - } -} - -type loader struct { - DocLoaderWithMatch - Next *loader -} - -// WithHead adds a loader at the head of the current stack -func (l *loader) WithHead(head *loader) *loader { - if head == nil { - return l - } - head.Next = l - return head -} - -// WithNext adds a loader at the trail of the current stack -func (l *loader) WithNext(next *loader) *loader { - l.Next = next - return next -} - -// Load the raw document from path -func (l *loader) Load(path string) (json.RawMessage, error) { - _, erp := url.Parse(path) - if erp != nil { - return nil, erp - } - - var lastErr error = errors.New("no loader matched") // default error if no match was found - for ldr := l; ldr != nil; ldr = ldr.Next { - if ldr.Match != nil && !ldr.Match(path) { - continue - } - - // try then move to next one if there is an error - b, err := ldr.Fn(path) - if err == nil { - return b, nil - } - - lastErr = err - } - - return nil, lastErr -} - -// JSONDoc loads a json document from either a file or a remote url -func JSONDoc(path string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(path) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil -} - -// AddLoader for a document, executed before other previously set loaders. -// -// This sets the configuration at the package level. -// -// NOTE: -// * this updates the default loader used by github.com/go-openapi/spec -// * since this sets package level globals, you shouln't call this concurrently -// -func AddLoader(predicate DocMatcher, load DocLoader) { - loaders = loaders.WithHead(&loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Match: predicate, - Fn: load, - }, - }) - - // sets the global default loader for go-openapi/spec - spec.PathLoader = loaders.Load -} diff --git a/vendor/github.com/go-openapi/loads/options.go b/vendor/github.com/go-openapi/loads/options.go deleted file mode 100644 index f8305d5607..0000000000 --- a/vendor/github.com/go-openapi/loads/options.go +++ /dev/null @@ -1,61 +0,0 @@ -package loads - -type options struct { - loader *loader -} - -func defaultOptions() *options { - return &options{ - loader: loaders, - } -} - -func loaderFromOptions(options []LoaderOption) *loader { - opts := defaultOptions() - for _, apply := range options { - apply(opts) - } - - return opts.loader -} - -// LoaderOption allows to fine-tune the spec loader behavior -type LoaderOption func(*options) - -// WithDocLoader sets a custom loader for loading specs -func WithDocLoader(l DocLoader) LoaderOption { - return func(opt *options) { - if l == nil { - return - } - opt.loader = &loader{ - DocLoaderWithMatch: DocLoaderWithMatch{ - Fn: l, - }, - } - } -} - -// WithDocLoaderMatches sets a chain of custom loaders for loading specs -// for different extension matches. -// -// Loaders are executed in the order of provided DocLoaderWithMatch'es. -func WithDocLoaderMatches(l ...DocLoaderWithMatch) LoaderOption { - return func(opt *options) { - var final, prev *loader - for _, ldr := range l { - if ldr.Fn == nil { - continue - } - - if prev == nil { - final = &loader{DocLoaderWithMatch: ldr} - prev = final - continue - } - - prev = prev.WithNext(&loader{DocLoaderWithMatch: ldr}) - } - opt.loader = final - } -} diff --git a/vendor/github.com/go-openapi/loads/spec.go b/vendor/github.com/go-openapi/loads/spec.go deleted file mode 100644 index 93c8d4b895..0000000000 --- a/vendor/github.com/go-openapi/loads/spec.go +++ /dev/null @@ -1,266 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package loads - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "fmt" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/spec" - "github.com/go-openapi/swag" -) - -func init() { - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// Document represents a swagger spec document -type Document struct { - // specAnalyzer - Analyzer *analysis.Spec - spec *spec.Swagger - specFilePath string - origSpec *spec.Swagger - schema *spec.Schema - raw json.RawMessage - pathLoader *loader -} - -// JSONSpec loads a spec from a json document -func JSONSpec(path string, options ...LoaderOption) (*Document, error) { - data, err := JSONDoc(path) - if err != nil { - return nil, err - } - // convert to json - return Analyzed(data, "", options...) -} - -// Embedded returns a Document based on embedded specs. No analysis is required -func Embedded(orig, flat json.RawMessage, options ...LoaderOption) (*Document, error) { - var origSpec, flatSpec spec.Swagger - if err := json.Unmarshal(orig, &origSpec); err != nil { - return nil, err - } - if err := json.Unmarshal(flat, &flatSpec); err != nil { - return nil, err - } - return &Document{ - raw: orig, - origSpec: &origSpec, - spec: &flatSpec, - pathLoader: loaderFromOptions(options), - }, nil -} - -// Spec loads a new spec document from a local or remote path -func Spec(path string, options ...LoaderOption) (*Document, error) { - - ldr := loaderFromOptions(options) - - b, err := ldr.Load(path) - if err != nil { - return nil, err - } - - document, err := Analyzed(b, "", options...) - if err != nil { - return nil, err - } - - if document != nil { - document.specFilePath = path - document.pathLoader = ldr - } - - return document, err -} - -// Analyzed creates a new analyzed spec document for a root json.RawMessage. -func Analyzed(data json.RawMessage, version string, options ...LoaderOption) (*Document, error) { - if version == "" { - version = "2.0" - } - if version != "2.0" { - return nil, fmt.Errorf("spec version %q is not supported", version) - } - - raw, err := trimData(data) // trim blanks, then convert yaml docs into json - if err != nil { - return nil, err - } - - swspec := new(spec.Swagger) - if err = json.Unmarshal(raw, swspec); err != nil { - return nil, err - } - - origsqspec, err := cloneSpec(swspec) - if err != nil { - return nil, err - } - - d := &Document{ - Analyzer: analysis.New(swspec), - schema: spec.MustLoadSwagger20Schema(), - spec: swspec, - raw: raw, - origSpec: origsqspec, - pathLoader: loaderFromOptions(options), - } - - return d, nil -} - -func trimData(in json.RawMessage) (json.RawMessage, error) { - trimmed := bytes.TrimSpace(in) - if len(trimmed) == 0 { - return in, nil - } - - if trimmed[0] == '{' || trimmed[0] == '[' { - return trimmed, nil - } - - // assume yaml doc: convert it to json - yml, err := swag.BytesToYAMLDoc(trimmed) - if err != nil { - return nil, fmt.Errorf("analyzed: %v", err) - } - - d, err := swag.YAMLToJSON(yml) - if err != nil { - return nil, fmt.Errorf("analyzed: %v", err) - } - - return d, nil -} - -// Expanded expands the ref fields in the spec document and returns a new spec document -func (d *Document) Expanded(options ...*spec.ExpandOptions) (*Document, error) { - - swspec := new(spec.Swagger) - if err := json.Unmarshal(d.raw, swspec); err != nil { - return nil, err - } - - var expandOptions *spec.ExpandOptions - if len(options) > 0 { - expandOptions = options[0] - } else { - expandOptions = &spec.ExpandOptions{ - RelativeBase: d.specFilePath, - } - } - - if expandOptions.PathLoader == nil { - if d.pathLoader != nil { - // use loader from Document options - expandOptions.PathLoader = d.pathLoader.Load - } else { - // use package level loader - expandOptions.PathLoader = loaders.Load - } - } - - if err := spec.ExpandSpec(swspec, expandOptions); err != nil { - return nil, err - } - - dd := &Document{ - Analyzer: analysis.New(swspec), - spec: swspec, - specFilePath: d.specFilePath, - schema: spec.MustLoadSwagger20Schema(), - raw: d.raw, - origSpec: d.origSpec, - } - return dd, nil -} - -// BasePath the base path for this spec -func (d *Document) BasePath() string { - return d.spec.BasePath -} - -// Version returns the version of this spec -func (d *Document) Version() string { - return d.spec.Swagger -} - -// Schema returns the swagger 2.0 schema -func (d *Document) Schema() *spec.Schema { - return d.schema -} - -// Spec returns the swagger spec object model -func (d *Document) Spec() *spec.Swagger { - return d.spec -} - -// Host returns the host for the API -func (d *Document) Host() string { - return d.spec.Host -} - -// Raw returns the raw swagger spec as json bytes -func (d *Document) Raw() json.RawMessage { - return d.raw -} - -// OrigSpec yields the original spec -func (d *Document) OrigSpec() *spec.Swagger { - return d.origSpec -} - -// ResetDefinitions gives a shallow copy with the models reset to the original spec -func (d *Document) ResetDefinitions() *Document { - defs := make(map[string]spec.Schema, len(d.origSpec.Definitions)) - for k, v := range d.origSpec.Definitions { - defs[k] = v - } - - d.spec.Definitions = defs - return d -} - -// Pristine creates a new pristine document instance based on the input data -func (d *Document) Pristine() *Document { - dd, _ := Analyzed(d.Raw(), d.Version()) - dd.pathLoader = d.pathLoader - return dd -} - -// SpecFilePath returns the file path of the spec if one is defined -func (d *Document) SpecFilePath() string { - return d.specFilePath -} - -func cloneSpec(src *spec.Swagger) (*spec.Swagger, error) { - var b bytes.Buffer - if err := gob.NewEncoder(&b).Encode(src); err != nil { - return nil, err - } - - var dst spec.Swagger - if err := gob.NewDecoder(&b).Decode(&dst); err != nil { - return nil, err - } - return &dst, nil -} diff --git a/vendor/github.com/go-openapi/runtime/.editorconfig b/vendor/github.com/go-openapi/runtime/.editorconfig deleted file mode 100644 index 3152da69a5..0000000000 --- a/vendor/github.com/go-openapi/runtime/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/runtime/.gitattributes b/vendor/github.com/go-openapi/runtime/.gitattributes deleted file mode 100644 index d207b1802b..0000000000 --- a/vendor/github.com/go-openapi/runtime/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.go text eol=lf diff --git a/vendor/github.com/go-openapi/runtime/.gitignore b/vendor/github.com/go-openapi/runtime/.gitignore deleted file mode 100644 index fea8b84eca..0000000000 --- a/vendor/github.com/go-openapi/runtime/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -secrets.yml -coverage.out -*.cov -*.out -playground diff --git a/vendor/github.com/go-openapi/runtime/.golangci.yml b/vendor/github.com/go-openapi/runtime/.golangci.yml deleted file mode 100644 index b1aa7928a7..0000000000 --- a/vendor/github.com/go-openapi/runtime/.golangci.yml +++ /dev/null @@ -1,44 +0,0 @@ -linters-settings: - govet: - # Using err repeatedly considered as shadowing. - check-shadowing: false - golint: - min-confidence: 0 - gocyclo: - min-complexity: 30 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 -linters: - disable: - - maligned - - lll - - gochecknoglobals - - godox - - gocognit - - whitespace - - wsl - - funlen - - gochecknoglobals - - gochecknoinits - - scopelint - - wrapcheck - - exhaustivestruct - - exhaustive - - nlreturn - - testpackage - - gci - - gofumpt - - goerr113 - - gomnd - - tparallel - - nestif - - godot - - errorlint - - noctx - - interfacer - - nilerr diff --git a/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/runtime/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/runtime/LICENSE b/vendor/github.com/go-openapi/runtime/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/runtime/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/runtime/README.md b/vendor/github.com/go-openapi/runtime/README.md deleted file mode 100644 index 5b1ec64945..0000000000 --- a/vendor/github.com/go-openapi/runtime/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# runtime [![Build Status](https://travis-ci.org/go-openapi/runtime.svg?branch=client-context)](https://travis-ci.org/go-openapi/runtime) [![codecov](https://codecov.io/gh/go-openapi/runtime/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/runtime) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/runtime/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/runtime?status.svg)](http://godoc.org/github.com/go-openapi/runtime) - -# golang Open-API toolkit - runtime - -The runtime component for use in codegeneration or as untyped usage. diff --git a/vendor/github.com/go-openapi/runtime/bytestream.go b/vendor/github.com/go-openapi/runtime/bytestream.go deleted file mode 100644 index 6eb6ceb5c5..0000000000 --- a/vendor/github.com/go-openapi/runtime/bytestream.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding" - "errors" - "fmt" - "io" - "reflect" - - "github.com/go-openapi/swag" -) - -func defaultCloser() error { return nil } - -type byteStreamOpt func(opts *byteStreamOpts) - -// ClosesStream when the bytestream consumer or producer is finished -func ClosesStream(opts *byteStreamOpts) { - opts.Close = true -} - -type byteStreamOpts struct { - Close bool -} - -// ByteStreamConsumer creates a consumer for byte streams, -// takes a Writer/BinaryUnmarshaler interface or binary slice by reference, -// and reads from the provided reader -func ByteStreamConsumer(opts ...byteStreamOpt) Consumer { - var vals byteStreamOpts - for _, opt := range opts { - opt(&vals) - } - - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("ByteStreamConsumer requires a reader") // early exit - } - - close := defaultCloser - if vals.Close { - if cl, ok := reader.(io.Closer); ok { - close = cl.Close - } - } - //nolint:errcheck // closing a reader wouldn't fail. - defer close() - - if wrtr, ok := data.(io.Writer); ok { - _, err := io.Copy(wrtr, reader) - return err - } - - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(reader) - if err != nil { - return err - } - b := buf.Bytes() - - if bu, ok := data.(encoding.BinaryUnmarshaler); ok { - return bu.UnmarshalBinary(b) - } - - if data != nil { - if str, ok := data.(*string); ok { - *str = string(b) - return nil - } - } - - if t := reflect.TypeOf(data); data != nil && t.Kind() == reflect.Ptr { - v := reflect.Indirect(reflect.ValueOf(data)) - if t = v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 { - v.SetBytes(b) - return nil - } - } - - return fmt.Errorf("%v (%T) is not supported by the ByteStreamConsumer, %s", - data, data, "can be resolved by supporting Writer/BinaryUnmarshaler interface") - }) -} - -// ByteStreamProducer creates a producer for byte streams, -// takes a Reader/BinaryMarshaler interface or binary slice, -// and writes to a writer (essentially a pipe) -func ByteStreamProducer(opts ...byteStreamOpt) Producer { - var vals byteStreamOpts - for _, opt := range opts { - opt(&vals) - } - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("ByteStreamProducer requires a writer") // early exit - } - close := defaultCloser - if vals.Close { - if cl, ok := writer.(io.Closer); ok { - close = cl.Close - } - } - //nolint:errcheck // TODO: closing a writer would fail. - defer close() - - if rc, ok := data.(io.ReadCloser); ok { - defer rc.Close() - } - - if rdr, ok := data.(io.Reader); ok { - _, err := io.Copy(writer, rdr) - return err - } - - if bm, ok := data.(encoding.BinaryMarshaler); ok { - bytes, err := bm.MarshalBinary() - if err != nil { - return err - } - - _, err = writer.Write(bytes) - return err - } - - if data != nil { - if str, ok := data.(string); ok { - _, err := writer.Write([]byte(str)) - return err - } - - if e, ok := data.(error); ok { - _, err := writer.Write([]byte(e.Error())) - return err - } - - v := reflect.Indirect(reflect.ValueOf(data)) - if t := v.Type(); t.Kind() == reflect.Slice && t.Elem().Kind() == reflect.Uint8 { - _, err := writer.Write(v.Bytes()) - return err - } - if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice { - b, err := swag.WriteJSON(data) - if err != nil { - return err - } - _, err = writer.Write(b) - return err - } - } - - return fmt.Errorf("%v (%T) is not supported by the ByteStreamProducer, %s", - data, data, "can be resolved by supporting Reader/BinaryMarshaler interface") - }) -} diff --git a/vendor/github.com/go-openapi/runtime/client_auth_info.go b/vendor/github.com/go-openapi/runtime/client_auth_info.go deleted file mode 100644 index c6c97d9a7c..0000000000 --- a/vendor/github.com/go-openapi/runtime/client_auth_info.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import "github.com/go-openapi/strfmt" - -// A ClientAuthInfoWriterFunc converts a function to a request writer interface -type ClientAuthInfoWriterFunc func(ClientRequest, strfmt.Registry) error - -// AuthenticateRequest adds authentication data to the request -func (fn ClientAuthInfoWriterFunc) AuthenticateRequest(req ClientRequest, reg strfmt.Registry) error { - return fn(req, reg) -} - -// A ClientAuthInfoWriter implementor knows how to write authentication info to a request -type ClientAuthInfoWriter interface { - AuthenticateRequest(ClientRequest, strfmt.Registry) error -} diff --git a/vendor/github.com/go-openapi/runtime/client_operation.go b/vendor/github.com/go-openapi/runtime/client_operation.go deleted file mode 100644 index fa21eacf33..0000000000 --- a/vendor/github.com/go-openapi/runtime/client_operation.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "context" - "net/http" -) - -// ClientOperation represents the context for a swagger operation to be submitted to the transport -type ClientOperation struct { - ID string - Method string - PathPattern string - ProducesMediaTypes []string - ConsumesMediaTypes []string - Schemes []string - AuthInfo ClientAuthInfoWriter - Params ClientRequestWriter - Reader ClientResponseReader - Context context.Context - Client *http.Client -} - -// A ClientTransport implementor knows how to submit Request objects to some destination -type ClientTransport interface { - //Submit(string, RequestWriter, ResponseReader, AuthInfoWriter) (interface{}, error) - Submit(*ClientOperation) (interface{}, error) -} diff --git a/vendor/github.com/go-openapi/runtime/client_request.go b/vendor/github.com/go-openapi/runtime/client_request.go deleted file mode 100644 index d4d2b58f2b..0000000000 --- a/vendor/github.com/go-openapi/runtime/client_request.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "io" - "net/http" - "net/url" - "time" - - "github.com/go-openapi/strfmt" -) - -// ClientRequestWriterFunc converts a function to a request writer interface -type ClientRequestWriterFunc func(ClientRequest, strfmt.Registry) error - -// WriteToRequest adds data to the request -func (fn ClientRequestWriterFunc) WriteToRequest(req ClientRequest, reg strfmt.Registry) error { - return fn(req, reg) -} - -// ClientRequestWriter is an interface for things that know how to write to a request -type ClientRequestWriter interface { - WriteToRequest(ClientRequest, strfmt.Registry) error -} - -// ClientRequest is an interface for things that know how to -// add information to a swagger client request -type ClientRequest interface { - SetHeaderParam(string, ...string) error - - GetHeaderParams() http.Header - - SetQueryParam(string, ...string) error - - SetFormParam(string, ...string) error - - SetPathParam(string, string) error - - GetQueryParams() url.Values - - SetFileParam(string, ...NamedReadCloser) error - - SetBodyParam(interface{}) error - - SetTimeout(time.Duration) error - - GetMethod() string - - GetPath() string - - GetBody() []byte - - GetBodyParam() interface{} - - GetFileParam() map[string][]NamedReadCloser -} - -// NamedReadCloser represents a named ReadCloser interface -type NamedReadCloser interface { - io.ReadCloser - Name() string -} - -// NamedReader creates a NamedReadCloser for use as file upload -func NamedReader(name string, rdr io.Reader) NamedReadCloser { - rc, ok := rdr.(io.ReadCloser) - if !ok { - rc = io.NopCloser(rdr) - } - return &namedReadCloser{ - name: name, - cr: rc, - } -} - -type namedReadCloser struct { - name string - cr io.ReadCloser -} - -func (n *namedReadCloser) Close() error { - return n.cr.Close() -} -func (n *namedReadCloser) Read(p []byte) (int, error) { - return n.cr.Read(p) -} -func (n *namedReadCloser) Name() string { - return n.name -} - -type TestClientRequest struct { - Headers http.Header - Body interface{} -} - -func (t *TestClientRequest) SetHeaderParam(name string, values ...string) error { - if t.Headers == nil { - t.Headers = make(http.Header) - } - t.Headers.Set(name, values[0]) - return nil -} - -func (t *TestClientRequest) SetQueryParam(_ string, _ ...string) error { return nil } - -func (t *TestClientRequest) SetFormParam(_ string, _ ...string) error { return nil } - -func (t *TestClientRequest) SetPathParam(_ string, _ string) error { return nil } - -func (t *TestClientRequest) SetFileParam(_ string, _ ...NamedReadCloser) error { return nil } - -func (t *TestClientRequest) SetBodyParam(body interface{}) error { - t.Body = body - return nil -} - -func (t *TestClientRequest) SetTimeout(time.Duration) error { - return nil -} - -func (t *TestClientRequest) GetQueryParams() url.Values { return nil } - -func (t *TestClientRequest) GetMethod() string { return "" } - -func (t *TestClientRequest) GetPath() string { return "" } - -func (t *TestClientRequest) GetBody() []byte { return nil } - -func (t *TestClientRequest) GetBodyParam() interface{} { - return t.Body -} - -func (t *TestClientRequest) GetFileParam() map[string][]NamedReadCloser { - return nil -} - -func (t *TestClientRequest) GetHeaderParams() http.Header { - return t.Headers -} diff --git a/vendor/github.com/go-openapi/runtime/client_response.go b/vendor/github.com/go-openapi/runtime/client_response.go deleted file mode 100644 index 0d1691149d..0000000000 --- a/vendor/github.com/go-openapi/runtime/client_response.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "encoding/json" - "fmt" - "io" -) - -// A ClientResponse represents a client response -// This bridges between responses obtained from different transports -type ClientResponse interface { - Code() int - Message() string - GetHeader(string) string - GetHeaders(string) []string - Body() io.ReadCloser -} - -// A ClientResponseReaderFunc turns a function into a ClientResponseReader interface implementation -type ClientResponseReaderFunc func(ClientResponse, Consumer) (interface{}, error) - -// ReadResponse reads the response -func (read ClientResponseReaderFunc) ReadResponse(resp ClientResponse, consumer Consumer) (interface{}, error) { - return read(resp, consumer) -} - -// A ClientResponseReader is an interface for things want to read a response. -// An application of this is to create structs from response values -type ClientResponseReader interface { - ReadResponse(ClientResponse, Consumer) (interface{}, error) -} - -// NewAPIError creates a new API error -func NewAPIError(opName string, payload interface{}, code int) *APIError { - return &APIError{ - OperationName: opName, - Response: payload, - Code: code, - } -} - -// APIError wraps an error model and captures the status code -type APIError struct { - OperationName string - Response interface{} - Code int -} - -func (o *APIError) Error() string { - var resp []byte - if err, ok := o.Response.(error); ok { - resp = []byte("'" + err.Error() + "'") - } else { - resp, _ = json.Marshal(o.Response) - } - return fmt.Sprintf("%s (status %d): %s", o.OperationName, o.Code, resp) -} - -func (o *APIError) String() string { - return o.Error() -} - -// IsSuccess returns true when this elapse o k response returns a 2xx status code -func (o *APIError) IsSuccess() bool { - return o.Code/100 == 2 -} - -// IsRedirect returns true when this elapse o k response returns a 3xx status code -func (o *APIError) IsRedirect() bool { - return o.Code/100 == 3 -} - -// IsClientError returns true when this elapse o k response returns a 4xx status code -func (o *APIError) IsClientError() bool { - return o.Code/100 == 4 -} - -// IsServerError returns true when this elapse o k response returns a 5xx status code -func (o *APIError) IsServerError() bool { - return o.Code/100 == 5 -} - -// IsCode returns true when this elapse o k response returns a 4xx status code -func (o *APIError) IsCode(code int) bool { - return o.Code == code -} - -// A ClientResponseStatus is a common interface implemented by all responses on the generated code -// You can use this to treat any client response based on status code -type ClientResponseStatus interface { - IsSuccess() bool - IsRedirect() bool - IsClientError() bool - IsServerError() bool - IsCode(int) bool -} diff --git a/vendor/github.com/go-openapi/runtime/constants.go b/vendor/github.com/go-openapi/runtime/constants.go deleted file mode 100644 index 515969242c..0000000000 --- a/vendor/github.com/go-openapi/runtime/constants.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -const ( - // HeaderContentType represents a http content-type header, it's value is supposed to be a mime type - HeaderContentType = "Content-Type" - - // HeaderTransferEncoding represents a http transfer-encoding header. - HeaderTransferEncoding = "Transfer-Encoding" - - // HeaderAccept the Accept header - HeaderAccept = "Accept" - // HeaderAuthorization the Authorization header - HeaderAuthorization = "Authorization" - - charsetKey = "charset" - - // DefaultMime the default fallback mime type - DefaultMime = "application/octet-stream" - // JSONMime the json mime type - JSONMime = "application/json" - // YAMLMime the yaml mime type - YAMLMime = "application/x-yaml" - // XMLMime the xml mime type - XMLMime = "application/xml" - // TextMime the text mime type - TextMime = "text/plain" - // HTMLMime the html mime type - HTMLMime = "text/html" - // CSVMime the csv mime type - CSVMime = "text/csv" - // MultipartFormMime the multipart form mime type - MultipartFormMime = "multipart/form-data" - // URLencodedFormMime the url encoded form mime type - URLencodedFormMime = "application/x-www-form-urlencoded" -) diff --git a/vendor/github.com/go-openapi/runtime/csv.go b/vendor/github.com/go-openapi/runtime/csv.go deleted file mode 100644 index d807bd915b..0000000000 --- a/vendor/github.com/go-openapi/runtime/csv.go +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding/csv" - "errors" - "io" -) - -// CSVConsumer creates a new CSV consumer -func CSVConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("CSVConsumer requires a reader") - } - - csvReader := csv.NewReader(reader) - writer, ok := data.(io.Writer) - if !ok { - return errors.New("data type must be io.Writer") - } - csvWriter := csv.NewWriter(writer) - records, err := csvReader.ReadAll() - if err != nil { - return err - } - for _, r := range records { - if err := csvWriter.Write(r); err != nil { - return err - } - } - csvWriter.Flush() - return nil - }) -} - -// CSVProducer creates a new CSV producer -func CSVProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("CSVProducer requires a writer") - } - - dataBytes, ok := data.([]byte) - if !ok { - return errors.New("data type must be byte array") - } - - csvReader := csv.NewReader(bytes.NewBuffer(dataBytes)) - records, err := csvReader.ReadAll() - if err != nil { - return err - } - csvWriter := csv.NewWriter(writer) - for _, r := range records { - if err := csvWriter.Write(r); err != nil { - return err - } - } - csvWriter.Flush() - return nil - }) -} diff --git a/vendor/github.com/go-openapi/runtime/discard.go b/vendor/github.com/go-openapi/runtime/discard.go deleted file mode 100644 index 0d390cfd64..0000000000 --- a/vendor/github.com/go-openapi/runtime/discard.go +++ /dev/null @@ -1,9 +0,0 @@ -package runtime - -import "io" - -// DiscardConsumer does absolutely nothing, it's a black hole. -var DiscardConsumer = ConsumerFunc(func(_ io.Reader, _ interface{}) error { return nil }) - -// DiscardProducer does absolutely nothing, it's a black hole. -var DiscardProducer = ProducerFunc(func(_ io.Writer, _ interface{}) error { return nil }) diff --git a/vendor/github.com/go-openapi/runtime/file.go b/vendor/github.com/go-openapi/runtime/file.go deleted file mode 100644 index 397d8a4593..0000000000 --- a/vendor/github.com/go-openapi/runtime/file.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import "github.com/go-openapi/swag" - -type File = swag.File diff --git a/vendor/github.com/go-openapi/runtime/headers.go b/vendor/github.com/go-openapi/runtime/headers.go deleted file mode 100644 index 4d111db4fe..0000000000 --- a/vendor/github.com/go-openapi/runtime/headers.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "mime" - "net/http" - - "github.com/go-openapi/errors" -) - -// ContentType parses a content type header -func ContentType(headers http.Header) (string, string, error) { - ct := headers.Get(HeaderContentType) - orig := ct - if ct == "" { - ct = DefaultMime - } - if ct == "" { - return "", "", nil - } - - mt, opts, err := mime.ParseMediaType(ct) - if err != nil { - return "", "", errors.NewParseError(HeaderContentType, "header", orig, err) - } - - if cs, ok := opts[charsetKey]; ok { - return mt, cs, nil - } - - return mt, "", nil -} diff --git a/vendor/github.com/go-openapi/runtime/interfaces.go b/vendor/github.com/go-openapi/runtime/interfaces.go deleted file mode 100644 index e334128683..0000000000 --- a/vendor/github.com/go-openapi/runtime/interfaces.go +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "context" - "io" - "net/http" - - "github.com/go-openapi/strfmt" -) - -// OperationHandlerFunc an adapter for a function to the OperationHandler interface -type OperationHandlerFunc func(interface{}) (interface{}, error) - -// Handle implements the operation handler interface -func (s OperationHandlerFunc) Handle(data interface{}) (interface{}, error) { - return s(data) -} - -// OperationHandler a handler for a swagger operation -type OperationHandler interface { - Handle(interface{}) (interface{}, error) -} - -// ConsumerFunc represents a function that can be used as a consumer -type ConsumerFunc func(io.Reader, interface{}) error - -// Consume consumes the reader into the data parameter -func (fn ConsumerFunc) Consume(reader io.Reader, data interface{}) error { - return fn(reader, data) -} - -// Consumer implementations know how to bind the values on the provided interface to -// data provided by the request body -type Consumer interface { - // Consume performs the binding of request values - Consume(io.Reader, interface{}) error -} - -// ProducerFunc represents a function that can be used as a producer -type ProducerFunc func(io.Writer, interface{}) error - -// Produce produces the response for the provided data -func (f ProducerFunc) Produce(writer io.Writer, data interface{}) error { - return f(writer, data) -} - -// Producer implementations know how to turn the provided interface into a valid -// HTTP response -type Producer interface { - // Produce writes to the http response - Produce(io.Writer, interface{}) error -} - -// AuthenticatorFunc turns a function into an authenticator -type AuthenticatorFunc func(interface{}) (bool, interface{}, error) - -// Authenticate authenticates the request with the provided data -func (f AuthenticatorFunc) Authenticate(params interface{}) (bool, interface{}, error) { - return f(params) -} - -// Authenticator represents an authentication strategy -// implementations of Authenticator know how to authenticate the -// request data and translate that into a valid principal object or an error -type Authenticator interface { - Authenticate(interface{}) (bool, interface{}, error) -} - -// AuthorizerFunc turns a function into an authorizer -type AuthorizerFunc func(*http.Request, interface{}) error - -// Authorize authorizes the processing of the request for the principal -func (f AuthorizerFunc) Authorize(r *http.Request, principal interface{}) error { - return f(r, principal) -} - -// Authorizer represents an authorization strategy -// implementations of Authorizer know how to authorize the principal object -// using the request data and returns error if unauthorized -type Authorizer interface { - Authorize(*http.Request, interface{}) error -} - -// Validatable types implementing this interface allow customizing their validation -// this will be used instead of the reflective validation based on the spec document. -// the implementations are assumed to have been generated by the swagger tool so they should -// contain all the validations obtained from the spec -type Validatable interface { - Validate(strfmt.Registry) error -} - -// ContextValidatable types implementing this interface allow customizing their validation -// this will be used instead of the reflective validation based on the spec document. -// the implementations are assumed to have been generated by the swagger tool so they should -// contain all the context validations obtained from the spec -type ContextValidatable interface { - ContextValidate(context.Context, strfmt.Registry) error -} diff --git a/vendor/github.com/go-openapi/runtime/json.go b/vendor/github.com/go-openapi/runtime/json.go deleted file mode 100644 index 5a690559cc..0000000000 --- a/vendor/github.com/go-openapi/runtime/json.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "encoding/json" - "io" -) - -// JSONConsumer creates a new JSON consumer -func JSONConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - dec := json.NewDecoder(reader) - dec.UseNumber() // preserve number formats - return dec.Decode(data) - }) -} - -// JSONProducer creates a new JSON producer -func JSONProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - enc := json.NewEncoder(writer) - enc.SetEscapeHTML(false) - return enc.Encode(data) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/logger/logger.go b/vendor/github.com/go-openapi/runtime/logger/logger.go deleted file mode 100644 index 6f4debcc14..0000000000 --- a/vendor/github.com/go-openapi/runtime/logger/logger.go +++ /dev/null @@ -1,20 +0,0 @@ -package logger - -import "os" - -type Logger interface { - Printf(format string, args ...interface{}) - Debugf(format string, args ...interface{}) -} - -func DebugEnabled() bool { - d := os.Getenv("SWAGGER_DEBUG") - if d != "" && d != "false" && d != "0" { - return true - } - d = os.Getenv("DEBUG") - if d != "" && d != "false" && d != "0" { - return true - } - return false -} diff --git a/vendor/github.com/go-openapi/runtime/logger/standard.go b/vendor/github.com/go-openapi/runtime/logger/standard.go deleted file mode 100644 index f7e67ebb9e..0000000000 --- a/vendor/github.com/go-openapi/runtime/logger/standard.go +++ /dev/null @@ -1,22 +0,0 @@ -package logger - -import ( - "fmt" - "os" -) - -type StandardLogger struct{} - -func (StandardLogger) Printf(format string, args ...interface{}) { - if len(format) == 0 || format[len(format)-1] != '\n' { - format += "\n" - } - fmt.Fprintf(os.Stderr, format, args...) -} - -func (StandardLogger) Debugf(format string, args ...interface{}) { - if len(format) == 0 || format[len(format)-1] != '\n' { - format += "\n" - } - fmt.Fprintf(os.Stderr, format, args...) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/context.go b/vendor/github.com/go-openapi/runtime/middleware/context.go deleted file mode 100644 index d21ae4e870..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/context.go +++ /dev/null @@ -1,635 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - stdContext "context" - "fmt" - "net/http" - "strings" - "sync" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/logger" - "github.com/go-openapi/runtime/middleware/untyped" - "github.com/go-openapi/runtime/security" -) - -// Debug when true turns on verbose logging -var Debug = logger.DebugEnabled() -var Logger logger.Logger = logger.StandardLogger{} - -func debugLog(format string, args ...interface{}) { - if Debug { - Logger.Printf(format, args...) - } -} - -// A Builder can create middlewares -type Builder func(http.Handler) http.Handler - -// PassthroughBuilder returns the handler, aka the builder identity function -func PassthroughBuilder(handler http.Handler) http.Handler { return handler } - -// RequestBinder is an interface for types to implement -// when they want to be able to bind from a request -type RequestBinder interface { - BindRequest(*http.Request, *MatchedRoute) error -} - -// Responder is an interface for types to implement -// when they want to be considered for writing HTTP responses -type Responder interface { - WriteResponse(http.ResponseWriter, runtime.Producer) -} - -// ResponderFunc wraps a func as a Responder interface -type ResponderFunc func(http.ResponseWriter, runtime.Producer) - -// WriteResponse writes to the response -func (fn ResponderFunc) WriteResponse(rw http.ResponseWriter, pr runtime.Producer) { - fn(rw, pr) -} - -// Context is a type safe wrapper around an untyped request context -// used throughout to store request context with the standard context attached -// to the http.Request -type Context struct { - spec *loads.Document - analyzer *analysis.Spec - api RoutableAPI - router Router -} - -type routableUntypedAPI struct { - api *untyped.API - hlock *sync.Mutex - handlers map[string]map[string]http.Handler - defaultConsumes string - defaultProduces string -} - -func newRoutableUntypedAPI(spec *loads.Document, api *untyped.API, context *Context) *routableUntypedAPI { - var handlers map[string]map[string]http.Handler - if spec == nil || api == nil { - return nil - } - analyzer := analysis.New(spec.Spec()) - for method, hls := range analyzer.Operations() { - um := strings.ToUpper(method) - for path, op := range hls { - schemes := analyzer.SecurityRequirementsFor(op) - - if oh, ok := api.OperationHandlerFor(method, path); ok { - if handlers == nil { - handlers = make(map[string]map[string]http.Handler) - } - if b, ok := handlers[um]; !ok || b == nil { - handlers[um] = make(map[string]http.Handler) - } - - var handler http.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // lookup route info in the context - route, rCtx, _ := context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - - // bind and validate the request using reflection - var bound interface{} - var validation error - bound, r, validation = context.BindAndValidate(r, route) - if validation != nil { - context.Respond(w, r, route.Produces, route, validation) - return - } - - // actually handle the request - result, err := oh.Handle(bound) - if err != nil { - // respond with failure - context.Respond(w, r, route.Produces, route, err) - return - } - - // respond with success - context.Respond(w, r, route.Produces, route, result) - }) - - if len(schemes) > 0 { - handler = newSecureAPI(context, handler) - } - handlers[um][path] = handler - } - } - } - - return &routableUntypedAPI{ - api: api, - hlock: new(sync.Mutex), - handlers: handlers, - defaultProduces: api.DefaultProduces, - defaultConsumes: api.DefaultConsumes, - } -} - -func (r *routableUntypedAPI) HandlerFor(method, path string) (http.Handler, bool) { - r.hlock.Lock() - paths, ok := r.handlers[strings.ToUpper(method)] - if !ok { - r.hlock.Unlock() - return nil, false - } - handler, ok := paths[path] - r.hlock.Unlock() - return handler, ok -} -func (r *routableUntypedAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return r.api.ServeError -} -func (r *routableUntypedAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - return r.api.ConsumersFor(mediaTypes) -} -func (r *routableUntypedAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - return r.api.ProducersFor(mediaTypes) -} -func (r *routableUntypedAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return r.api.AuthenticatorsFor(schemes) -} -func (r *routableUntypedAPI) Authorizer() runtime.Authorizer { - return r.api.Authorizer() -} -func (r *routableUntypedAPI) Formats() strfmt.Registry { - return r.api.Formats() -} - -func (r *routableUntypedAPI) DefaultProduces() string { - return r.defaultProduces -} - -func (r *routableUntypedAPI) DefaultConsumes() string { - return r.defaultConsumes -} - -// NewRoutableContext creates a new context for a routable API -func NewRoutableContext(spec *loads.Document, routableAPI RoutableAPI, routes Router) *Context { - var an *analysis.Spec - if spec != nil { - an = analysis.New(spec.Spec()) - } - - return NewRoutableContextWithAnalyzedSpec(spec, an, routableAPI, routes) -} - -// NewRoutableContextWithAnalyzedSpec is like NewRoutableContext but takes in input the analysed spec too -func NewRoutableContextWithAnalyzedSpec(spec *loads.Document, an *analysis.Spec, routableAPI RoutableAPI, routes Router) *Context { - // Either there are no spec doc and analysis, or both of them. - if !((spec == nil && an == nil) || (spec != nil && an != nil)) { - panic(errors.New(http.StatusInternalServerError, "routable context requires either both spec doc and analysis, or none of them")) - } - - ctx := &Context{spec: spec, api: routableAPI, analyzer: an, router: routes} - return ctx -} - -// NewContext creates a new context wrapper -func NewContext(spec *loads.Document, api *untyped.API, routes Router) *Context { - var an *analysis.Spec - if spec != nil { - an = analysis.New(spec.Spec()) - } - ctx := &Context{spec: spec, analyzer: an} - ctx.api = newRoutableUntypedAPI(spec, api, ctx) - ctx.router = routes - return ctx -} - -// Serve serves the specified spec with the specified api registrations as a http.Handler -func Serve(spec *loads.Document, api *untyped.API) http.Handler { - return ServeWithBuilder(spec, api, PassthroughBuilder) -} - -// ServeWithBuilder serves the specified spec with the specified api registrations as a http.Handler that is decorated -// by the Builder -func ServeWithBuilder(spec *loads.Document, api *untyped.API, builder Builder) http.Handler { - context := NewContext(spec, api, nil) - return context.APIHandler(builder) -} - -type contextKey int8 - -const ( - _ contextKey = iota - ctxContentType - ctxResponseFormat - ctxMatchedRoute - ctxBoundParams - ctxSecurityPrincipal - ctxSecurityScopes -) - -// MatchedRouteFrom request context value. -func MatchedRouteFrom(req *http.Request) *MatchedRoute { - mr := req.Context().Value(ctxMatchedRoute) - if mr == nil { - return nil - } - if res, ok := mr.(*MatchedRoute); ok { - return res - } - return nil -} - -// SecurityPrincipalFrom request context value. -func SecurityPrincipalFrom(req *http.Request) interface{} { - return req.Context().Value(ctxSecurityPrincipal) -} - -// SecurityScopesFrom request context value. -func SecurityScopesFrom(req *http.Request) []string { - rs := req.Context().Value(ctxSecurityScopes) - if res, ok := rs.([]string); ok { - return res - } - return nil -} - -type contentTypeValue struct { - MediaType string - Charset string -} - -// BasePath returns the base path for this API -func (c *Context) BasePath() string { - return c.spec.BasePath() -} - -// RequiredProduces returns the accepted content types for responses -func (c *Context) RequiredProduces() []string { - return c.analyzer.RequiredProduces() -} - -// BindValidRequest binds a params object to a request but only when the request is valid -// if the request is not valid an error will be returned -func (c *Context) BindValidRequest(request *http.Request, route *MatchedRoute, binder RequestBinder) error { - var res []error - var requestContentType string - - // check and validate content type, select consumer - if runtime.HasBody(request) { - ct, _, err := runtime.ContentType(request.Header) - if err != nil { - res = append(res, err) - } else { - if err := validateContentType(route.Consumes, ct); err != nil { - res = append(res, err) - } - if len(res) == 0 { - cons, ok := route.Consumers[ct] - if !ok { - res = append(res, errors.New(500, "no consumer registered for %s", ct)) - } else { - route.Consumer = cons - requestContentType = ct - } - } - } - } - - // check and validate the response format - if len(res) == 0 { - // if the route does not provide Produces and a default contentType could not be identified - // based on a body, typical for GET and DELETE requests, then default contentType to. - if len(route.Produces) == 0 && requestContentType == "" { - requestContentType = "*/*" - } - - if str := NegotiateContentType(request, route.Produces, requestContentType); str == "" { - res = append(res, errors.InvalidResponseFormat(request.Header.Get(runtime.HeaderAccept), route.Produces)) - } - } - - // now bind the request with the provided binder - // it's assumed the binder will also validate the request and return an error if the - // request is invalid - if binder != nil && len(res) == 0 { - if err := binder.BindRequest(request, route); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContentType gets the parsed value of a content type -// Returns the media type, its charset and a shallow copy of the request -// when its context doesn't contain the content type value, otherwise it returns -// the same request -// Returns the error that runtime.ContentType may retunrs. -func (c *Context) ContentType(request *http.Request) (string, string, *http.Request, error) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxContentType).(*contentTypeValue); ok { - return v.MediaType, v.Charset, request, nil - } - - mt, cs, err := runtime.ContentType(request.Header) - if err != nil { - return "", "", nil, err - } - rCtx = stdContext.WithValue(rCtx, ctxContentType, &contentTypeValue{mt, cs}) - return mt, cs, request.WithContext(rCtx), nil -} - -// LookupRoute looks a route up and returns true when it is found -func (c *Context) LookupRoute(request *http.Request) (*MatchedRoute, bool) { - if route, ok := c.router.Lookup(request.Method, request.URL.EscapedPath()); ok { - return route, ok - } - return nil, false -} - -// RouteInfo tries to match a route for this request -// Returns the matched route, a shallow copy of the request if its context -// contains the matched router, otherwise the same request, and a bool to -// indicate if it the request matches one of the routes, if it doesn't -// then it returns false and nil for the other two return values -func (c *Context) RouteInfo(request *http.Request) (*MatchedRoute, *http.Request, bool) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxMatchedRoute).(*MatchedRoute); ok { - return v, request, ok - } - - if route, ok := c.LookupRoute(request); ok { - rCtx = stdContext.WithValue(rCtx, ctxMatchedRoute, route) - return route, request.WithContext(rCtx), ok - } - - return nil, nil, false -} - -// ResponseFormat negotiates the response content type -// Returns the response format and a shallow copy of the request if its context -// doesn't contain the response format, otherwise the same request -func (c *Context) ResponseFormat(r *http.Request, offers []string) (string, *http.Request) { - var rCtx = r.Context() - - if v, ok := rCtx.Value(ctxResponseFormat).(string); ok { - debugLog("[%s %s] found response format %q in context", r.Method, r.URL.Path, v) - return v, r - } - - format := NegotiateContentType(r, offers, "") - if format != "" { - debugLog("[%s %s] set response format %q in context", r.Method, r.URL.Path, format) - r = r.WithContext(stdContext.WithValue(rCtx, ctxResponseFormat, format)) - } - debugLog("[%s %s] negotiated response format %q", r.Method, r.URL.Path, format) - return format, r -} - -// AllowedMethods gets the allowed methods for the path of this request -func (c *Context) AllowedMethods(request *http.Request) []string { - return c.router.OtherMethods(request.Method, request.URL.EscapedPath()) -} - -// ResetAuth removes the current principal from the request context -func (c *Context) ResetAuth(request *http.Request) *http.Request { - rctx := request.Context() - rctx = stdContext.WithValue(rctx, ctxSecurityPrincipal, nil) - rctx = stdContext.WithValue(rctx, ctxSecurityScopes, nil) - return request.WithContext(rctx) -} - -// Authorize authorizes the request -// Returns the principal object and a shallow copy of the request when its -// context doesn't contain the principal, otherwise the same request or an error -// (the last) if one of the authenticators returns one or an Unauthenticated error -func (c *Context) Authorize(request *http.Request, route *MatchedRoute) (interface{}, *http.Request, error) { - if route == nil || !route.HasAuth() { - return nil, nil, nil - } - - var rCtx = request.Context() - if v := rCtx.Value(ctxSecurityPrincipal); v != nil { - return v, request, nil - } - - applies, usr, err := route.Authenticators.Authenticate(request, route) - if !applies || err != nil || !route.Authenticators.AllowsAnonymous() && usr == nil { - if err != nil { - return nil, nil, err - } - return nil, nil, errors.Unauthenticated("invalid credentials") - } - if route.Authorizer != nil { - if err := route.Authorizer.Authorize(request, usr); err != nil { - if _, ok := err.(errors.Error); ok { - return nil, nil, err - } - - return nil, nil, errors.New(http.StatusForbidden, err.Error()) - } - } - - rCtx = request.Context() - - rCtx = stdContext.WithValue(rCtx, ctxSecurityPrincipal, usr) - rCtx = stdContext.WithValue(rCtx, ctxSecurityScopes, route.Authenticator.AllScopes()) - return usr, request.WithContext(rCtx), nil -} - -// BindAndValidate binds and validates the request -// Returns the validation map and a shallow copy of the request when its context -// doesn't contain the validation, otherwise it returns the same request or an -// CompositeValidationError error -func (c *Context) BindAndValidate(request *http.Request, matched *MatchedRoute) (interface{}, *http.Request, error) { - var rCtx = request.Context() - - if v, ok := rCtx.Value(ctxBoundParams).(*validation); ok { - debugLog("got cached validation (valid: %t)", len(v.result) == 0) - if len(v.result) > 0 { - return v.bound, request, errors.CompositeValidationError(v.result...) - } - return v.bound, request, nil - } - result := validateRequest(c, request, matched) - rCtx = stdContext.WithValue(rCtx, ctxBoundParams, result) - request = request.WithContext(rCtx) - if len(result.result) > 0 { - return result.bound, request, errors.CompositeValidationError(result.result...) - } - debugLog("no validation errors found") - return result.bound, request, nil -} - -// NotFound the default not found responder for when no route has been matched yet -func (c *Context) NotFound(rw http.ResponseWriter, r *http.Request) { - c.Respond(rw, r, []string{c.api.DefaultProduces()}, nil, errors.NotFound("not found")) -} - -// Respond renders the response after doing some content negotiation -func (c *Context) Respond(rw http.ResponseWriter, r *http.Request, produces []string, route *MatchedRoute, data interface{}) { - debugLog("responding to %s %s with produces: %v", r.Method, r.URL.Path, produces) - offers := []string{} - for _, mt := range produces { - if mt != c.api.DefaultProduces() { - offers = append(offers, mt) - } - } - // the default producer is last so more specific producers take precedence - offers = append(offers, c.api.DefaultProduces()) - debugLog("offers: %v", offers) - - var format string - format, r = c.ResponseFormat(r, offers) - rw.Header().Set(runtime.HeaderContentType, format) - - if resp, ok := data.(Responder); ok { - producers := route.Producers - // producers contains keys with normalized format, if a format has MIME type parameter such as `text/plain; charset=utf-8` - // then you must provide `text/plain` to get the correct producer. HOWEVER, format here is not normalized. - prod, ok := producers[normalizeOffer(format)] - if !ok { - prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()})) - pr, ok := prods[c.api.DefaultProduces()] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - prod = pr - } - resp.WriteResponse(rw, prod) - return - } - - if err, ok := data.(error); ok { - if format == "" { - rw.Header().Set(runtime.HeaderContentType, runtime.JSONMime) - } - - if realm := security.FailedBasicAuth(r); realm != "" { - rw.Header().Set("WWW-Authenticate", fmt.Sprintf("Basic realm=%q", realm)) - } - - if route == nil || route.Operation == nil { - c.api.ServeErrorFor("")(rw, r, err) - return - } - c.api.ServeErrorFor(route.Operation.ID)(rw, r, err) - return - } - - if route == nil || route.Operation == nil { - rw.WriteHeader(200) - if r.Method == "HEAD" { - return - } - producers := c.api.ProducersFor(normalizeOffers(offers)) - prod, ok := producers[format] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - if err := prod.Produce(rw, data); err != nil { - panic(err) // let the recovery middleware deal with this - } - return - } - - if _, code, ok := route.Operation.SuccessResponse(); ok { - rw.WriteHeader(code) - if code == 204 || r.Method == "HEAD" { - return - } - - producers := route.Producers - prod, ok := producers[format] - if !ok { - if !ok { - prods := c.api.ProducersFor(normalizeOffers([]string{c.api.DefaultProduces()})) - pr, ok := prods[c.api.DefaultProduces()] - if !ok { - panic(errors.New(http.StatusInternalServerError, "can't find a producer for "+format)) - } - prod = pr - } - } - if err := prod.Produce(rw, data); err != nil { - panic(err) // let the recovery middleware deal with this - } - return - } - - c.api.ServeErrorFor(route.Operation.ID)(rw, r, errors.New(http.StatusInternalServerError, "can't produce response")) -} - -func (c *Context) APIHandlerSwaggerUI(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - - var title string - sp := c.spec.Spec() - if sp != nil && sp.Info != nil && sp.Info.Title != "" { - title = sp.Info.Title - } - - swaggerUIOpts := SwaggerUIOpts{ - BasePath: c.BasePath(), - Title: title, - } - - return Spec("", c.spec.Raw(), SwaggerUI(swaggerUIOpts, c.RoutesHandler(b))) -} - -// APIHandler returns a handler to serve the API, this includes a swagger spec, router and the contract defined in the swagger spec -func (c *Context) APIHandler(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - - var title string - sp := c.spec.Spec() - if sp != nil && sp.Info != nil && sp.Info.Title != "" { - title = sp.Info.Title - } - - redocOpts := RedocOpts{ - BasePath: c.BasePath(), - Title: title, - } - - return Spec("", c.spec.Raw(), Redoc(redocOpts, c.RoutesHandler(b))) -} - -// RoutesHandler returns a handler to serve the API, just the routes and the contract defined in the swagger spec -func (c *Context) RoutesHandler(builder Builder) http.Handler { - b := builder - if b == nil { - b = PassthroughBuilder - } - return NewRouter(c, b(NewOperationExecutor(c))) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE b/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE deleted file mode 100644 index e65039ad84..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2014 Naoya Inada - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/README.md b/vendor/github.com/go-openapi/runtime/middleware/denco/README.md deleted file mode 100644 index 30109e17d5..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/README.md +++ /dev/null @@ -1,180 +0,0 @@ -# Denco [![Build Status](https://travis-ci.org/naoina/denco.png?branch=master)](https://travis-ci.org/naoina/denco) - -The fast and flexible HTTP request router for [Go](http://golang.org). - -Denco is based on Double-Array implementation of [Kocha-urlrouter](https://github.com/naoina/kocha-urlrouter). -However, Denco is optimized and some features added. - -## Features - -* Fast (See [go-http-routing-benchmark](https://github.com/naoina/go-http-routing-benchmark)) -* [URL patterns](#url-patterns) (`/foo/:bar` and `/foo/*wildcard`) -* Small (but enough) URL router API -* HTTP request multiplexer like `http.ServeMux` - -## Installation - - go get -u github.com/go-openapi/runtime/middleware/denco - -## Using as HTTP request multiplexer - -```go -package main - -import ( - "fmt" - "log" - "net/http" - - "github.com/go-openapi/runtime/middleware/denco" -) - -func Index(w http.ResponseWriter, r *http.Request, params denco.Params) { - fmt.Fprintf(w, "Welcome to Denco!\n") -} - -func User(w http.ResponseWriter, r *http.Request, params denco.Params) { - fmt.Fprintf(w, "Hello %s!\n", params.Get("name")) -} - -func main() { - mux := denco.NewMux() - handler, err := mux.Build([]denco.Handler{ - mux.GET("/", Index), - mux.GET("/user/:name", User), - mux.POST("/user/:name", User), - }) - if err != nil { - panic(err) - } - log.Fatal(http.ListenAndServe(":8080", handler)) -} -``` - -## Using as URL router - -```go -package main - -import ( - "fmt" - - "github.com/go-openapi/runtime/middleware/denco" -) - -type route struct { - name string -} - -func main() { - router := denco.New() - router.Build([]denco.Record{ - {"/", &route{"root"}}, - {"/user/:id", &route{"user"}}, - {"/user/:name/:id", &route{"username"}}, - {"/static/*filepath", &route{"static"}}, - }) - - data, params, found := router.Lookup("/") - // print `&main.route{name:"root"}, denco.Params(nil), true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/user/hoge") - // print `&main.route{name:"user"}, denco.Params{denco.Param{Name:"id", Value:"hoge"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/user/hoge/7") - // print `&main.route{name:"username"}, denco.Params{denco.Param{Name:"name", Value:"hoge"}, denco.Param{Name:"id", Value:"7"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) - - data, params, found = router.Lookup("/static/path/to/file") - // print `&main.route{name:"static"}, denco.Params{denco.Param{Name:"filepath", Value:"path/to/file"}}, true`. - fmt.Printf("%#v, %#v, %#v\n", data, params, found) -} -``` - -See [Godoc](http://godoc.org/github.com/go-openapi/runtime/middleware/denco) for more details. - -## Getting the value of path parameter - -You can get the value of path parameter by 2 ways. - -1. Using [`denco.Params.Get`](http://godoc.org/github.com/go-openapi/runtime/middleware/denco#Params.Get) method -2. Find by loop - -```go -package main - -import ( - "fmt" - - "github.com/go-openapi/runtime/middleware/denco" -) - -func main() { - router := denco.New() - if err := router.Build([]denco.Record{ - {"/user/:name/:id", "route1"}, - }); err != nil { - panic(err) - } - - // 1. Using denco.Params.Get method. - _, params, _ := router.Lookup("/user/alice/1") - name := params.Get("name") - if name != "" { - fmt.Printf("Hello %s.\n", name) // prints "Hello alice.". - } - - // 2. Find by loop. - for _, param := range params { - if param.Name == "name" { - fmt.Printf("Hello %s.\n", name) // prints "Hello alice.". - } - } -} -``` - -## URL patterns - -Denco's route matching strategy is "most nearly matching". - -When routes `/:name` and `/alice` have been built, URI `/alice` matches the route `/alice`, not `/:name`. -Because URI `/alice` is more match with the route `/alice` than `/:name`. - -For more example, when routes below have been built: - -``` -/user/alice -/user/:name -/user/:name/:id -/user/alice/:id -/user/:id/bob -``` - -Routes matching are: - -``` -/user/alice => "/user/alice" (no match with "/user/:name") -/user/bob => "/user/:name" -/user/naoina/1 => "/user/:name/1" -/user/alice/1 => "/user/alice/:id" (no match with "/user/:name/:id") -/user/1/bob => "/user/:id/bob" (no match with "/user/:name/:id") -/user/alice/bob => "/user/alice/:id" (no match with "/user/:name/:id" and "/user/:id/bob") -``` - -## Limitation - -Denco has some limitations below. - -* Number of param records (such as `/:name`) must be less than 2^22 -* Number of elements of internal slice must be less than 2^22 - -## Benchmarks - - cd $GOPATH/github.com/go-openapi/runtime/middleware/denco - go test -bench . -benchmem - -## License - -Denco is licensed under the MIT License. diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go b/vendor/github.com/go-openapi/runtime/middleware/denco/router.go deleted file mode 100644 index 5d2691ec36..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/router.go +++ /dev/null @@ -1,460 +0,0 @@ -// Package denco provides fast URL router. -package denco - -import ( - "fmt" - "sort" - "strings" -) - -const ( - // ParamCharacter is a special character for path parameter. - ParamCharacter = ':' - - // WildcardCharacter is a special character for wildcard path parameter. - WildcardCharacter = '*' - - // TerminationCharacter is a special character for end of path. - TerminationCharacter = '#' - - // SeparatorCharacter separates path segments. - SeparatorCharacter = '/' - - // PathParamCharacter indicates a RESTCONF path param - PathParamCharacter = '=' - - // MaxSize is max size of records and internal slice. - MaxSize = (1 << 22) - 1 -) - -// Router represents a URL router. -type Router struct { - // SizeHint expects the maximum number of path parameters in records to Build. - // SizeHint will be used to determine the capacity of the memory to allocate. - // By default, SizeHint will be determined from given records to Build. - SizeHint int - - static map[string]interface{} - param *doubleArray -} - -// New returns a new Router. -func New() *Router { - return &Router{ - SizeHint: -1, - static: make(map[string]interface{}), - param: newDoubleArray(), - } -} - -// Lookup returns data and path parameters that associated with path. -// params is a slice of the Param that arranged in the order in which parameters appeared. -// e.g. when built routing path is "/path/to/:id/:name" and given path is "/path/to/1/alice". params order is [{"id": "1"}, {"name": "alice"}], not [{"name": "alice"}, {"id": "1"}]. -func (rt *Router) Lookup(path string) (data interface{}, params Params, found bool) { - if data, found := rt.static[path]; found { - return data, nil, true - } - if len(rt.param.node) == 1 { - return nil, nil, false - } - nd, params, found := rt.param.lookup(path, make([]Param, 0, rt.SizeHint), 1) - if !found { - return nil, nil, false - } - for i := 0; i < len(params); i++ { - params[i].Name = nd.paramNames[i] - } - return nd.data, params, true -} - -// Build builds URL router from records. -func (rt *Router) Build(records []Record) error { - statics, params := makeRecords(records) - if len(params) > MaxSize { - return fmt.Errorf("denco: too many records") - } - if rt.SizeHint < 0 { - rt.SizeHint = 0 - for _, p := range params { - size := 0 - for _, k := range p.Key { - if k == ParamCharacter || k == WildcardCharacter { - size++ - } - } - if size > rt.SizeHint { - rt.SizeHint = size - } - } - } - for _, r := range statics { - rt.static[r.Key] = r.Value - } - if err := rt.param.build(params, 1, 0, make(map[int]struct{})); err != nil { - return err - } - return nil -} - -// Param represents name and value of path parameter. -type Param struct { - Name string - Value string -} - -// Params represents the name and value of path parameters. -type Params []Param - -// Get gets the first value associated with the given name. -// If there are no values associated with the key, Get returns "". -func (ps Params) Get(name string) string { - for _, p := range ps { - if p.Name == name { - return p.Value - } - } - return "" -} - -type doubleArray struct { - bc []baseCheck - node []*node -} - -func newDoubleArray() *doubleArray { - return &doubleArray{ - bc: []baseCheck{0}, - node: []*node{nil}, // A start index is adjusting to 1 because 0 will be used as a mark of non-existent node. - } -} - -// baseCheck contains BASE, CHECK and Extra flags. -// From the top, 22bits of BASE, 2bits of Extra flags and 8bits of CHECK. -// -// BASE (22bit) | Extra flags (2bit) | CHECK (8bit) -// |----------------------|--|--------| -// 32 10 8 0 -type baseCheck uint32 - -func (bc baseCheck) Base() int { - return int(bc >> 10) -} - -func (bc *baseCheck) SetBase(base int) { - *bc |= baseCheck(base) << 10 -} - -func (bc baseCheck) Check() byte { - return byte(bc) -} - -func (bc *baseCheck) SetCheck(check byte) { - *bc |= baseCheck(check) -} - -func (bc baseCheck) IsEmpty() bool { - return bc&0xfffffcff == 0 -} - -func (bc baseCheck) IsSingleParam() bool { - return bc¶mTypeSingle == paramTypeSingle -} - -func (bc baseCheck) IsWildcardParam() bool { - return bc¶mTypeWildcard == paramTypeWildcard -} - -func (bc baseCheck) IsAnyParam() bool { - return bc¶mTypeAny != 0 -} - -func (bc *baseCheck) SetSingleParam() { - *bc |= (1 << 8) -} - -func (bc *baseCheck) SetWildcardParam() { - *bc |= (1 << 9) -} - -const ( - paramTypeSingle = 0x0100 - paramTypeWildcard = 0x0200 - paramTypeAny = 0x0300 -) - -func (da *doubleArray) lookup(path string, params []Param, idx int) (*node, []Param, bool) { - indices := make([]uint64, 0, 1) - for i := 0; i < len(path); i++ { - if da.bc[idx].IsAnyParam() { - indices = append(indices, (uint64(i)<<32)|(uint64(idx)&0xffffffff)) - } - c := path[i] - if idx = nextIndex(da.bc[idx].Base(), c); idx >= len(da.bc) || da.bc[idx].Check() != c { - goto BACKTRACKING - } - } - if next := nextIndex(da.bc[idx].Base(), TerminationCharacter); next < len(da.bc) && da.bc[next].Check() == TerminationCharacter { - return da.node[da.bc[next].Base()], params, true - } -BACKTRACKING: - for j := len(indices) - 1; j >= 0; j-- { - i, idx := int(indices[j]>>32), int(indices[j]&0xffffffff) - if da.bc[idx].IsSingleParam() { - idx := nextIndex(da.bc[idx].Base(), ParamCharacter) - if idx >= len(da.bc) { - break - } - next := NextSeparator(path, i) - params := append(params, Param{Value: path[i:next]}) - if nd, params, found := da.lookup(path[next:], params, idx); found { - return nd, params, true - } - } - if da.bc[idx].IsWildcardParam() { - idx := nextIndex(da.bc[idx].Base(), WildcardCharacter) - params := append(params, Param{Value: path[i:]}) - return da.node[da.bc[idx].Base()], params, true - } - } - return nil, nil, false -} - -// build builds double-array from records. -func (da *doubleArray) build(srcs []*record, idx, depth int, usedBase map[int]struct{}) error { - sort.Stable(recordSlice(srcs)) - base, siblings, leaf, err := da.arrange(srcs, idx, depth, usedBase) - if err != nil { - return err - } - if leaf != nil { - nd, err := makeNode(leaf) - if err != nil { - return err - } - da.bc[idx].SetBase(len(da.node)) - da.node = append(da.node, nd) - } - for _, sib := range siblings { - da.setCheck(nextIndex(base, sib.c), sib.c) - } - for _, sib := range siblings { - records := srcs[sib.start:sib.end] - switch sib.c { - case ParamCharacter: - for _, r := range records { - next := NextSeparator(r.Key, depth+1) - name := r.Key[depth+1 : next] - r.paramNames = append(r.paramNames, name) - r.Key = r.Key[next:] - } - da.bc[idx].SetSingleParam() - if err := da.build(records, nextIndex(base, sib.c), 0, usedBase); err != nil { - return err - } - case WildcardCharacter: - r := records[0] - name := r.Key[depth+1 : len(r.Key)-1] - r.paramNames = append(r.paramNames, name) - r.Key = "" - da.bc[idx].SetWildcardParam() - if err := da.build(records, nextIndex(base, sib.c), 0, usedBase); err != nil { - return err - } - default: - if err := da.build(records, nextIndex(base, sib.c), depth+1, usedBase); err != nil { - return err - } - } - } - return nil -} - -// setBase sets BASE. -func (da *doubleArray) setBase(i, base int) { - da.bc[i].SetBase(base) -} - -// setCheck sets CHECK. -func (da *doubleArray) setCheck(i int, check byte) { - da.bc[i].SetCheck(check) -} - -// findEmptyIndex returns an index of unused BASE/CHECK node. -func (da *doubleArray) findEmptyIndex(start int) int { - i := start - for ; i < len(da.bc); i++ { - if da.bc[i].IsEmpty() { - break - } - } - return i -} - -// findBase returns good BASE. -func (da *doubleArray) findBase(siblings []sibling, start int, usedBase map[int]struct{}) (base int) { - for idx, firstChar := start+1, siblings[0].c; ; idx = da.findEmptyIndex(idx + 1) { - base = nextIndex(idx, firstChar) - if _, used := usedBase[base]; used { - continue - } - i := 0 - for ; i < len(siblings); i++ { - next := nextIndex(base, siblings[i].c) - if len(da.bc) <= next { - da.bc = append(da.bc, make([]baseCheck, next-len(da.bc)+1)...) - } - if !da.bc[next].IsEmpty() { - break - } - } - if i == len(siblings) { - break - } - } - usedBase[base] = struct{}{} - return base -} - -func (da *doubleArray) arrange(records []*record, idx, depth int, usedBase map[int]struct{}) (base int, siblings []sibling, leaf *record, err error) { - siblings, leaf, err = makeSiblings(records, depth) - if err != nil { - return -1, nil, nil, err - } - if len(siblings) < 1 { - return -1, nil, leaf, nil - } - base = da.findBase(siblings, idx, usedBase) - if base > MaxSize { - return -1, nil, nil, fmt.Errorf("denco: too many elements of internal slice") - } - da.setBase(idx, base) - return base, siblings, leaf, err -} - -// node represents a node of Double-Array. -type node struct { - data interface{} - - // Names of path parameters. - paramNames []string -} - -// makeNode returns a new node from record. -func makeNode(r *record) (*node, error) { - dups := make(map[string]bool) - for _, name := range r.paramNames { - if dups[name] { - return nil, fmt.Errorf("denco: path parameter `%v' is duplicated in the key `%v'", name, r.Key) - } - dups[name] = true - } - return &node{data: r.Value, paramNames: r.paramNames}, nil -} - -// sibling represents an intermediate data of build for Double-Array. -type sibling struct { - // An index of start of duplicated characters. - start int - - // An index of end of duplicated characters. - end int - - // A character of sibling. - c byte -} - -// nextIndex returns a next index of array of BASE/CHECK. -func nextIndex(base int, c byte) int { - return base ^ int(c) -} - -// makeSiblings returns slice of sibling. -func makeSiblings(records []*record, depth int) (sib []sibling, leaf *record, err error) { - var ( - pc byte - n int - ) - for i, r := range records { - if len(r.Key) <= depth { - leaf = r - continue - } - c := r.Key[depth] - switch { - case pc < c: - sib = append(sib, sibling{start: i, c: c}) - case pc == c: - continue - default: - return nil, nil, fmt.Errorf("denco: BUG: routing table hasn't been sorted") - } - if n > 0 { - sib[n-1].end = i - } - pc = c - n++ - } - if n == 0 { - return nil, leaf, nil - } - sib[n-1].end = len(records) - return sib, leaf, nil -} - -// Record represents a record data for router construction. -type Record struct { - // Key for router construction. - Key string - - // Result value for Key. - Value interface{} -} - -// NewRecord returns a new Record. -func NewRecord(key string, value interface{}) Record { - return Record{ - Key: key, - Value: value, - } -} - -// record represents a record that use to build the Double-Array. -type record struct { - Record - paramNames []string -} - -// makeRecords returns the records that use to build Double-Arrays. -func makeRecords(srcs []Record) (statics, params []*record) { - termChar := string(TerminationCharacter) - paramPrefix := string(SeparatorCharacter) + string(ParamCharacter) - wildcardPrefix := string(SeparatorCharacter) + string(WildcardCharacter) - restconfPrefix := string(PathParamCharacter) + string(ParamCharacter) - for _, r := range srcs { - if strings.Contains(r.Key, paramPrefix) || strings.Contains(r.Key, wildcardPrefix) ||strings.Contains(r.Key, restconfPrefix){ - r.Key += termChar - params = append(params, &record{Record: r}) - } else { - statics = append(statics, &record{Record: r}) - } - } - return statics, params -} - -// recordSlice represents a slice of Record for sort and implements the sort.Interface. -type recordSlice []*record - -// Len implements the sort.Interface.Len. -func (rs recordSlice) Len() int { - return len(rs) -} - -// Less implements the sort.Interface.Less. -func (rs recordSlice) Less(i, j int) bool { - return rs[i].Key < rs[j].Key -} - -// Swap implements the sort.Interface.Swap. -func (rs recordSlice) Swap(i, j int) { - rs[i], rs[j] = rs[j], rs[i] -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/server.go b/vendor/github.com/go-openapi/runtime/middleware/denco/server.go deleted file mode 100644 index 0886713c18..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/server.go +++ /dev/null @@ -1,106 +0,0 @@ -package denco - -import ( - "net/http" -) - -// Mux represents a multiplexer for HTTP request. -type Mux struct{} - -// NewMux returns a new Mux. -func NewMux() *Mux { - return &Mux{} -} - -// GET is shorthand of Mux.Handler("GET", path, handler). -func (m *Mux) GET(path string, handler HandlerFunc) Handler { - return m.Handler("GET", path, handler) -} - -// POST is shorthand of Mux.Handler("POST", path, handler). -func (m *Mux) POST(path string, handler HandlerFunc) Handler { - return m.Handler("POST", path, handler) -} - -// PUT is shorthand of Mux.Handler("PUT", path, handler). -func (m *Mux) PUT(path string, handler HandlerFunc) Handler { - return m.Handler("PUT", path, handler) -} - -// HEAD is shorthand of Mux.Handler("HEAD", path, handler). -func (m *Mux) HEAD(path string, handler HandlerFunc) Handler { - return m.Handler("HEAD", path, handler) -} - -// Handler returns a handler for HTTP method. -func (m *Mux) Handler(method, path string, handler HandlerFunc) Handler { - return Handler{ - Method: method, - Path: path, - Func: handler, - } -} - -// Build builds a http.Handler. -func (m *Mux) Build(handlers []Handler) (http.Handler, error) { - recordMap := make(map[string][]Record) - for _, h := range handlers { - recordMap[h.Method] = append(recordMap[h.Method], NewRecord(h.Path, h.Func)) - } - mux := newServeMux() - for m, records := range recordMap { - router := New() - if err := router.Build(records); err != nil { - return nil, err - } - mux.routers[m] = router - } - return mux, nil -} - -// Handler represents a handler of HTTP request. -type Handler struct { - // Method is an HTTP method. - Method string - - // Path is a routing path for handler. - Path string - - // Func is a function of handler of HTTP request. - Func HandlerFunc -} - -// The HandlerFunc type is aliased to type of handler function. -type HandlerFunc func(w http.ResponseWriter, r *http.Request, params Params) - -type serveMux struct { - routers map[string]*Router -} - -func newServeMux() *serveMux { - return &serveMux{ - routers: make(map[string]*Router), - } -} - -// ServeHTTP implements http.Handler interface. -func (mux *serveMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - handler, params := mux.handler(r.Method, r.URL.Path) - handler(w, r, params) -} - -func (mux *serveMux) handler(method, path string) (HandlerFunc, []Param) { - if router, found := mux.routers[method]; found { - if handler, params, found := router.Lookup(path); found { - return handler.(HandlerFunc), params - } - } - return NotFound, nil -} - -// NotFound replies to the request with an HTTP 404 not found error. -// NotFound is called when unknown HTTP method or a handler not found. -// If you want to use the your own NotFound handler, please overwrite this variable. -var NotFound = func(w http.ResponseWriter, r *http.Request, _ Params) { - http.NotFound(w, r) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/denco/util.go b/vendor/github.com/go-openapi/runtime/middleware/denco/util.go deleted file mode 100644 index edc1f6ab80..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/denco/util.go +++ /dev/null @@ -1,12 +0,0 @@ -package denco - -// NextSeparator returns an index of next separator in path. -func NextSeparator(path string, start int) int { - for start < len(path) { - if c := path[start]; c == '/' || c == TerminationCharacter { - break - } - start++ - } - return start -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/doc.go b/vendor/github.com/go-openapi/runtime/middleware/doc.go deleted file mode 100644 index eaf90606ac..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/doc.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*Package middleware provides the library with helper functions for serving swagger APIs. - -Pseudo middleware handler - - import ( - "net/http" - - "github.com/go-openapi/errors" - ) - - func newCompleteMiddleware(ctx *Context) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - // use context to lookup routes - if matched, ok := ctx.RouteInfo(r); ok { - - if matched.NeedsAuth() { - if _, err := ctx.Authorize(r, matched); err != nil { - ctx.Respond(rw, r, matched.Produces, matched, err) - return - } - } - - bound, validation := ctx.BindAndValidate(r, matched) - if validation != nil { - ctx.Respond(rw, r, matched.Produces, matched, validation) - return - } - - result, err := matched.Handler.Handle(bound) - if err != nil { - ctx.Respond(rw, r, matched.Produces, matched, err) - return - } - - ctx.Respond(rw, r, matched.Produces, matched, result) - return - } - - // Not found, check if it exists in the other methods first - if others := ctx.AllowedMethods(r); len(others) > 0 { - ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others)) - return - } - ctx.Respond(rw, r, ctx.spec.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.Path)) - }) - } -*/ -package middleware diff --git a/vendor/github.com/go-openapi/runtime/middleware/go18.go b/vendor/github.com/go-openapi/runtime/middleware/go18.go deleted file mode 100644 index 75c762c094..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build go1.8 - -package middleware - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.PathUnescape(path) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/header/header.go b/vendor/github.com/go-openapi/runtime/middleware/header/header.go deleted file mode 100644 index e069743e30..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/header/header.go +++ /dev/null @@ -1,329 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// this file was taken from the github.com/golang/gddo repository - -// Package header provides functions for parsing HTTP headers. -package header - -import ( - "net/http" - "strings" - "time" -) - -// Octet types from RFC 2616. -var octetTypes [256]octetType - -type octetType byte - -const ( - isToken octetType = 1 << iota - isSpace -) - -func init() { - // OCTET = - // CHAR = - // CTL = - // CR = - // LF = - // SP = - // HT = - // <"> = - // CRLF = CR LF - // LWS = [CRLF] 1*( SP | HT ) - // TEXT = - // separators = "(" | ")" | "<" | ">" | "@" | "," | ";" | ":" | "\" | <"> - // | "/" | "[" | "]" | "?" | "=" | "{" | "}" | SP | HT - // token = 1* - // qdtext = > - - for c := 0; c < 256; c++ { - var t octetType - isCtl := c <= 31 || c == 127 - isChar := 0 <= c && c <= 127 - isSeparator := strings.ContainsRune(" \t\"(),/:;<=>?@[]\\{}", rune(c)) - if strings.ContainsRune(" \t\r\n", rune(c)) { - t |= isSpace - } - if isChar && !isCtl && !isSeparator { - t |= isToken - } - octetTypes[c] = t - } -} - -// Copy returns a shallow copy of the header. -func Copy(header http.Header) http.Header { - h := make(http.Header) - for k, vs := range header { - h[k] = vs - } - return h -} - -var timeLayouts = []string{"Mon, 02 Jan 2006 15:04:05 GMT", time.RFC850, time.ANSIC} - -// ParseTime parses the header as time. The zero value is returned if the -// header is not present or there is an error parsing the -// header. -func ParseTime(header http.Header, key string) time.Time { - if s := header.Get(key); s != "" { - for _, layout := range timeLayouts { - if t, err := time.Parse(layout, s); err == nil { - return t.UTC() - } - } - } - return time.Time{} -} - -// ParseList parses a comma separated list of values. Commas are ignored in -// quoted strings. Quoted values are not unescaped or unquoted. Whitespace is -// trimmed. -func ParseList(header http.Header, key string) []string { - var result []string - for _, s := range header[http.CanonicalHeaderKey(key)] { - begin := 0 - end := 0 - escape := false - quote := false - for i := 0; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - end = i + 1 - case quote: - switch b { - case '\\': - escape = true - case '"': - quote = false - } - end = i + 1 - case b == '"': - quote = true - end = i + 1 - case octetTypes[b]&isSpace != 0: - if begin == end { - begin = i + 1 - end = begin - } - case b == ',': - if begin < end { - result = append(result, s[begin:end]) - } - begin = i + 1 - end = begin - default: - end = i + 1 - } - } - if begin < end { - result = append(result, s[begin:end]) - } - } - return result -} - -// ParseValueAndParams parses a comma separated list of values with optional -// semicolon separated name-value pairs. Content-Type and Content-Disposition -// headers are in this format. -func ParseValueAndParams(header http.Header, key string) (string, map[string]string) { - return parseValueAndParams(header.Get(key)) -} - -func parseValueAndParams(s string) (value string, params map[string]string) { - params = make(map[string]string) - value, s = expectTokenSlash(s) - if value == "" { - return - } - value = strings.ToLower(value) - s = skipSpace(s) - for strings.HasPrefix(s, ";") { - var pkey string - pkey, s = expectToken(skipSpace(s[1:])) - if pkey == "" { - return - } - if !strings.HasPrefix(s, "=") { - return - } - var pvalue string - pvalue, s = expectTokenOrQuoted(s[1:]) - if pvalue == "" { - return - } - pkey = strings.ToLower(pkey) - params[pkey] = pvalue - s = skipSpace(s) - } - return -} - -// AcceptSpec ... -type AcceptSpec struct { - Value string - Q float64 -} - -// ParseAccept2 ... -func ParseAccept2(header http.Header, key string) (specs []AcceptSpec) { - for _, en := range ParseList(header, key) { - v, p := parseValueAndParams(en) - var spec AcceptSpec - spec.Value = v - spec.Q = 1.0 - if p != nil { - if q, ok := p["q"]; ok { - spec.Q, _ = expectQuality(q) - } - } - if spec.Q < 0.0 { - continue - } - specs = append(specs, spec) - } - - return -} - -// ParseAccept parses Accept* headers. -func ParseAccept(header http.Header, key string) (specs []AcceptSpec) { -loop: - for _, s := range header[key] { - for { - var spec AcceptSpec - spec.Value, s = expectTokenSlash(s) - if spec.Value == "" { - continue loop - } - spec.Q = 1.0 - s = skipSpace(s) - if strings.HasPrefix(s, ";") { - s = skipSpace(s[1:]) - for !strings.HasPrefix(s, "q=") && s != "" && !strings.HasPrefix(s, ",") { - s = skipSpace(s[1:]) - } - if strings.HasPrefix(s, "q=") { - spec.Q, s = expectQuality(s[2:]) - if spec.Q < 0.0 { - continue loop - } - } - } - specs = append(specs, spec) - s = skipSpace(s) - if !strings.HasPrefix(s, ",") { - continue loop - } - s = skipSpace(s[1:]) - } - } - return -} - -func skipSpace(s string) (rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isSpace == 0 { - break - } - } - return s[i:] -} - -func expectToken(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - if octetTypes[s[i]]&isToken == 0 { - break - } - } - return s[:i], s[i:] -} - -func expectTokenSlash(s string) (token, rest string) { - i := 0 - for ; i < len(s); i++ { - b := s[i] - if (octetTypes[b]&isToken == 0) && b != '/' { - break - } - } - return s[:i], s[i:] -} - -func expectQuality(s string) (q float64, rest string) { - switch { - case len(s) == 0: - return -1, "" - case s[0] == '0': - // q is already 0 - s = s[1:] - case s[0] == '1': - s = s[1:] - q = 1 - case s[0] == '.': - // q is already 0 - default: - return -1, "" - } - if !strings.HasPrefix(s, ".") { - return q, s - } - s = s[1:] - i := 0 - n := 0 - d := 1 - for ; i < len(s); i++ { - b := s[i] - if b < '0' || b > '9' { - break - } - n = n*10 + int(b) - '0' - d *= 10 - } - return q + float64(n)/float64(d), s[i:] -} - -func expectTokenOrQuoted(s string) (value string, rest string) { - if !strings.HasPrefix(s, "\"") { - return expectToken(s) - } - s = s[1:] - for i := 0; i < len(s); i++ { - switch s[i] { - case '"': - return s[:i], s[i+1:] - case '\\': - p := make([]byte, len(s)-1) - j := copy(p, s[:i]) - escape := true - for i = i + 1; i < len(s); i++ { - b := s[i] - switch { - case escape: - escape = false - p[j] = b - j++ - case b == '\\': - escape = true - case b == '"': - return string(p[:j]), s[i+1:] - default: - p[j] = b - j++ - } - } - return "", "" - } - } - return "", "" -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/negotiate.go b/vendor/github.com/go-openapi/runtime/middleware/negotiate.go deleted file mode 100644 index a9b6f27d3d..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/negotiate.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file or at -// https://developers.google.com/open-source/licenses/bsd. - -// this file was taken from the github.com/golang/gddo repository - -package middleware - -import ( - "net/http" - "strings" - - "github.com/go-openapi/runtime/middleware/header" -) - -// NegotiateContentEncoding returns the best offered content encoding for the -// request's Accept-Encoding header. If two offers match with equal weight and -// then the offer earlier in the list is preferred. If no offers are -// acceptable, then "" is returned. -func NegotiateContentEncoding(r *http.Request, offers []string) string { - bestOffer := "identity" - bestQ := -1.0 - specs := header.ParseAccept(r.Header, "Accept-Encoding") - for _, offer := range offers { - for _, spec := range specs { - if spec.Q > bestQ && - (spec.Value == "*" || spec.Value == offer) { - bestQ = spec.Q - bestOffer = offer - } - } - } - if bestQ == 0 { - bestOffer = "" - } - return bestOffer -} - -// NegotiateContentType returns the best offered content type for the request's -// Accept header. If two offers match with equal weight, then the more specific -// offer is preferred. For example, text/* trumps */*. If two offers match -// with equal weight and specificity, then the offer earlier in the list is -// preferred. If no offers match, then defaultOffer is returned. -func NegotiateContentType(r *http.Request, offers []string, defaultOffer string) string { - bestOffer := defaultOffer - bestQ := -1.0 - bestWild := 3 - specs := header.ParseAccept(r.Header, "Accept") - for _, rawOffer := range offers { - offer := normalizeOffer(rawOffer) - // No Accept header: just return the first offer. - if len(specs) == 0 { - return rawOffer - } - for _, spec := range specs { - switch { - case spec.Q == 0.0: - // ignore - case spec.Q < bestQ: - // better match found - case spec.Value == "*/*": - if spec.Q > bestQ || bestWild > 2 { - bestQ = spec.Q - bestWild = 2 - bestOffer = rawOffer - } - case strings.HasSuffix(spec.Value, "/*"): - if strings.HasPrefix(offer, spec.Value[:len(spec.Value)-1]) && - (spec.Q > bestQ || bestWild > 1) { - bestQ = spec.Q - bestWild = 1 - bestOffer = rawOffer - } - default: - if spec.Value == offer && - (spec.Q > bestQ || bestWild > 0) { - bestQ = spec.Q - bestWild = 0 - bestOffer = rawOffer - } - } - } - } - return bestOffer -} - -func normalizeOffers(orig []string) (norm []string) { - for _, o := range orig { - norm = append(norm, normalizeOffer(o)) - } - return -} - -func normalizeOffer(orig string) string { - return strings.SplitN(orig, ";", 2)[0] -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go b/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go deleted file mode 100644 index bc6942a0f1..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/not_implemented.go +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -type errorResp struct { - code int - response interface{} - headers http.Header -} - -func (e *errorResp) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - for k, v := range e.headers { - for _, val := range v { - rw.Header().Add(k, val) - } - } - if e.code > 0 { - rw.WriteHeader(e.code) - } else { - rw.WriteHeader(http.StatusInternalServerError) - } - if err := producer.Produce(rw, e.response); err != nil { - Logger.Printf("failed to write error response: %v", err) - } -} - -// NotImplemented the error response when the response is not implemented -func NotImplemented(message string) Responder { - return Error(http.StatusNotImplemented, message) -} - -// Error creates a generic responder for returning errors, the data will be serialized -// with the matching producer for the request -func Error(code int, data interface{}, headers ...http.Header) Responder { - var hdr http.Header - for _, h := range headers { - for k, v := range h { - if hdr == nil { - hdr = make(http.Header) - } - hdr[k] = v - } - } - return &errorResp{ - code: code, - response: data, - headers: hdr, - } -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/operation.go b/vendor/github.com/go-openapi/runtime/middleware/operation.go deleted file mode 100644 index 1175a63cf2..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/operation.go +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import "net/http" - -// NewOperationExecutor creates a context aware middleware that handles the operations after routing -func NewOperationExecutor(ctx *Context) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - // use context to lookup routes - route, rCtx, _ := ctx.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - - route.Handler.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/parameter.go b/vendor/github.com/go-openapi/runtime/middleware/parameter.go deleted file mode 100644 index 9aaf65958a..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/parameter.go +++ /dev/null @@ -1,485 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "encoding" - "encoding/base64" - "fmt" - "io" - "net/http" - "reflect" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - - "github.com/go-openapi/runtime" -) - -const defaultMaxMemory = 32 << 20 - -var textUnmarshalType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem() - -func newUntypedParamBinder(param spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *untypedParamBinder { - binder := new(untypedParamBinder) - binder.Name = param.Name - binder.parameter = ¶m - binder.formats = formats - if param.In != "body" { - binder.validator = validate.NewParamValidator(¶m, formats) - } else { - binder.validator = validate.NewSchemaValidator(param.Schema, spec, param.Name, formats) - } - - return binder -} - -type untypedParamBinder struct { - parameter *spec.Parameter - formats strfmt.Registry - Name string - validator validate.EntityValidator -} - -func (p *untypedParamBinder) Type() reflect.Type { - return p.typeForSchema(p.parameter.Type, p.parameter.Format, p.parameter.Items) -} - -func (p *untypedParamBinder) typeForSchema(tpe, format string, items *spec.Items) reflect.Type { - switch tpe { - case "boolean": - return reflect.TypeOf(true) - - case "string": - if tt, ok := p.formats.GetType(format); ok { - return tt - } - return reflect.TypeOf("") - - case "integer": - switch format { - case "int8": - return reflect.TypeOf(int8(0)) - case "int16": - return reflect.TypeOf(int16(0)) - case "int32": - return reflect.TypeOf(int32(0)) - case "int64": - return reflect.TypeOf(int64(0)) - default: - return reflect.TypeOf(int64(0)) - } - - case "number": - switch format { - case "float": - return reflect.TypeOf(float32(0)) - case "double": - return reflect.TypeOf(float64(0)) - } - - case "array": - if items == nil { - return nil - } - itemsType := p.typeForSchema(items.Type, items.Format, items.Items) - if itemsType == nil { - return nil - } - return reflect.MakeSlice(reflect.SliceOf(itemsType), 0, 0).Type() - - case "file": - return reflect.TypeOf(&runtime.File{}).Elem() - - case "object": - return reflect.TypeOf(map[string]interface{}{}) - } - return nil -} - -func (p *untypedParamBinder) allowsMulti() bool { - return p.parameter.In == "query" || p.parameter.In == "formData" -} - -func (p *untypedParamBinder) readValue(values runtime.Gettable, target reflect.Value) ([]string, bool, bool, error) { - name, in, cf, tpe := p.parameter.Name, p.parameter.In, p.parameter.CollectionFormat, p.parameter.Type - if tpe == "array" { - if cf == "multi" { - if !p.allowsMulti() { - return nil, false, false, errors.InvalidCollectionFormat(name, in, cf) - } - vv, hasKey, _ := values.GetOK(name) - return vv, false, hasKey, nil - } - - v, hk, hv := values.GetOK(name) - if !hv { - return nil, false, hk, nil - } - d, c, e := p.readFormattedSliceFieldValue(v[len(v)-1], target) - return d, c, hk, e - } - - vv, hk, _ := values.GetOK(name) - return vv, false, hk, nil -} - -func (p *untypedParamBinder) Bind(request *http.Request, routeParams RouteParams, consumer runtime.Consumer, target reflect.Value) error { - // fmt.Println("binding", p.name, "as", p.Type()) - switch p.parameter.In { - case "query": - data, custom, hasKey, err := p.readValue(runtime.Values(request.URL.Query()), target) - if err != nil { - return err - } - if custom { - return nil - } - - return p.bindValue(data, hasKey, target) - - case "header": - data, custom, hasKey, err := p.readValue(runtime.Values(request.Header), target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "path": - data, custom, hasKey, err := p.readValue(routeParams, target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "formData": - var err error - var mt string - - mt, _, e := runtime.ContentType(request.Header) - if e != nil { - // because of the interface conversion go thinks the error is not nil - // so we first check for nil and then set the err var if it's not nil - err = e - } - - if err != nil { - return errors.InvalidContentType("", []string{"multipart/form-data", "application/x-www-form-urlencoded"}) - } - - if mt != "multipart/form-data" && mt != "application/x-www-form-urlencoded" { - return errors.InvalidContentType(mt, []string{"multipart/form-data", "application/x-www-form-urlencoded"}) - } - - if mt == "multipart/form-data" { - if err = request.ParseMultipartForm(defaultMaxMemory); err != nil { - return errors.NewParseError(p.Name, p.parameter.In, "", err) - } - } - - if err = request.ParseForm(); err != nil { - return errors.NewParseError(p.Name, p.parameter.In, "", err) - } - - if p.parameter.Type == "file" { - file, header, ffErr := request.FormFile(p.parameter.Name) - if ffErr != nil { - if p.parameter.Required { - return errors.NewParseError(p.Name, p.parameter.In, "", ffErr) - } else { - return nil - } - } - target.Set(reflect.ValueOf(runtime.File{Data: file, Header: header})) - return nil - } - - if request.MultipartForm != nil { - data, custom, hasKey, rvErr := p.readValue(runtime.Values(request.MultipartForm.Value), target) - if rvErr != nil { - return rvErr - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - } - data, custom, hasKey, err := p.readValue(runtime.Values(request.PostForm), target) - if err != nil { - return err - } - if custom { - return nil - } - return p.bindValue(data, hasKey, target) - - case "body": - newValue := reflect.New(target.Type()) - if !runtime.HasBody(request) { - if p.parameter.Default != nil { - target.Set(reflect.ValueOf(p.parameter.Default)) - } - - return nil - } - if err := consumer.Consume(request.Body, newValue.Interface()); err != nil { - if err == io.EOF && p.parameter.Default != nil { - target.Set(reflect.ValueOf(p.parameter.Default)) - return nil - } - tpe := p.parameter.Type - if p.parameter.Format != "" { - tpe = p.parameter.Format - } - return errors.InvalidType(p.Name, p.parameter.In, tpe, nil) - } - target.Set(reflect.Indirect(newValue)) - return nil - default: - return errors.New(500, fmt.Sprintf("invalid parameter location %q", p.parameter.In)) - } -} - -func (p *untypedParamBinder) bindValue(data []string, hasKey bool, target reflect.Value) error { - if p.parameter.Type == "array" { - return p.setSliceFieldValue(target, p.parameter.Default, data, hasKey) - } - var d string - if len(data) > 0 { - d = data[len(data)-1] - } - return p.setFieldValue(target, p.parameter.Default, d, hasKey) -} - -func (p *untypedParamBinder) setFieldValue(target reflect.Value, defaultValue interface{}, data string, hasKey bool) error { - tpe := p.parameter.Type - if p.parameter.Format != "" { - tpe = p.parameter.Format - } - - if (!hasKey || (!p.parameter.AllowEmptyValue && data == "")) && p.parameter.Required && p.parameter.Default == nil { - return errors.Required(p.Name, p.parameter.In, data) - } - - ok, err := p.tryUnmarshaler(target, defaultValue, data) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if ok { - return nil - } - - defVal := reflect.Zero(target.Type()) - if defaultValue != nil { - defVal = reflect.ValueOf(defaultValue) - } - - if tpe == "byte" { - if data == "" { - if target.CanSet() { - target.SetBytes(defVal.Bytes()) - } - return nil - } - - b, err := base64.StdEncoding.DecodeString(data) - if err != nil { - b, err = base64.URLEncoding.DecodeString(data) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - } - if target.CanSet() { - target.SetBytes(b) - } - return nil - } - - switch target.Kind() { - case reflect.Bool: - if data == "" { - if target.CanSet() { - target.SetBool(defVal.Bool()) - } - return nil - } - b, err := swag.ConvertBool(data) - if err != nil { - return err - } - if target.CanSet() { - target.SetBool(b) - } - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(int64(0))) - target.SetInt(rd.Int()) - } - return nil - } - i, err := strconv.ParseInt(data, 10, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowInt(i) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetInt(i) - } - - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(uint64(0))) - target.SetUint(rd.Uint()) - } - return nil - } - u, err := strconv.ParseUint(data, 10, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowUint(u) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetUint(u) - } - - case reflect.Float32, reflect.Float64: - if data == "" { - if target.CanSet() { - rd := defVal.Convert(reflect.TypeOf(float64(0))) - target.SetFloat(rd.Float()) - } - return nil - } - f, err := strconv.ParseFloat(data, 64) - if err != nil { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.OverflowFloat(f) { - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - if target.CanSet() { - target.SetFloat(f) - } - - case reflect.String: - value := data - if value == "" { - value = defVal.String() - } - // validate string - if target.CanSet() { - target.SetString(value) - } - - case reflect.Ptr: - if data == "" && defVal.Kind() == reflect.Ptr { - if target.CanSet() { - target.Set(defVal) - } - return nil - } - newVal := reflect.New(target.Type().Elem()) - if err := p.setFieldValue(reflect.Indirect(newVal), defVal, data, hasKey); err != nil { - return err - } - if target.CanSet() { - target.Set(newVal) - } - - default: - return errors.InvalidType(p.Name, p.parameter.In, tpe, data) - } - return nil -} - -func (p *untypedParamBinder) tryUnmarshaler(target reflect.Value, defaultValue interface{}, data string) (bool, error) { - if !target.CanSet() { - return false, nil - } - // When a type implements encoding.TextUnmarshaler we'll use that instead of reflecting some more - if reflect.PtrTo(target.Type()).Implements(textUnmarshalType) { - if defaultValue != nil && len(data) == 0 { - target.Set(reflect.ValueOf(defaultValue)) - return true, nil - } - value := reflect.New(target.Type()) - if err := value.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(data)); err != nil { - return true, err - } - target.Set(reflect.Indirect(value)) - return true, nil - } - return false, nil -} - -func (p *untypedParamBinder) readFormattedSliceFieldValue(data string, target reflect.Value) ([]string, bool, error) { - ok, err := p.tryUnmarshaler(target, p.parameter.Default, data) - if err != nil { - return nil, true, err - } - if ok { - return nil, true, nil - } - - return swag.SplitByFormat(data, p.parameter.CollectionFormat), false, nil -} - -func (p *untypedParamBinder) setSliceFieldValue(target reflect.Value, defaultValue interface{}, data []string, hasKey bool) error { - sz := len(data) - if (!hasKey || (!p.parameter.AllowEmptyValue && (sz == 0 || (sz == 1 && data[0] == "")))) && p.parameter.Required && defaultValue == nil { - return errors.Required(p.Name, p.parameter.In, data) - } - - defVal := reflect.Zero(target.Type()) - if defaultValue != nil { - defVal = reflect.ValueOf(defaultValue) - } - - if !target.CanSet() { - return nil - } - if sz == 0 { - target.Set(defVal) - return nil - } - - value := reflect.MakeSlice(reflect.SliceOf(target.Type().Elem()), sz, sz) - - for i := 0; i < sz; i++ { - if err := p.setFieldValue(value.Index(i), nil, data[i], hasKey); err != nil { - return err - } - } - - target.Set(value) - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go b/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go deleted file mode 100644 index 03385251e1..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/pre_go18.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build !go1.8 - -package middleware - -import "net/url" - -func pathUnescape(path string) (string, error) { - return url.QueryUnescape(path) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go b/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go deleted file mode 100644 index 4be330d6dc..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/rapidoc.go +++ /dev/null @@ -1,90 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// RapiDocOpts configures the RapiDoc middlewares -type RapiDocOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - // RapiDocURL for the js that generates the rapidoc site, defaults to: https://cdn.jsdelivr.net/npm/rapidoc/bundles/rapidoc.standalone.js - RapiDocURL string - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *RapiDocOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.RapiDocURL == "" { - r.RapiDocURL = rapidocLatest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// RapiDoc creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -// -func RapiDoc(opts RapiDocOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("rapidoc").Parse(rapidocTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - rapidocLatest = "https://unpkg.com/rapidoc/dist/rapidoc-min.js" - rapidocTemplate = ` - - - {{ .Title }} - - - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/redoc.go b/vendor/github.com/go-openapi/runtime/middleware/redoc.go deleted file mode 100644 index 019c854295..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/redoc.go +++ /dev/null @@ -1,103 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// RedocOpts configures the Redoc middlewares -type RedocOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - // RedocURL for the js that generates the redoc site, defaults to: https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js - RedocURL string - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *RedocOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.RedocURL == "" { - r.RedocURL = redocLatest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// Redoc creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -// -func Redoc(opts RedocOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("redoc").Parse(redocTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - redocLatest = "https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js" - redocTemplate = ` - - - {{ .Title }} - - - - - - - - - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/request.go b/vendor/github.com/go-openapi/runtime/middleware/request.go deleted file mode 100644 index 760c37861d..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/request.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - "reflect" - - "github.com/go-openapi/errors" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// UntypedRequestBinder binds and validates the data from a http request -type UntypedRequestBinder struct { - Spec *spec.Swagger - Parameters map[string]spec.Parameter - Formats strfmt.Registry - paramBinders map[string]*untypedParamBinder -} - -// NewUntypedRequestBinder creates a new binder for reading a request. -func NewUntypedRequestBinder(parameters map[string]spec.Parameter, spec *spec.Swagger, formats strfmt.Registry) *UntypedRequestBinder { - binders := make(map[string]*untypedParamBinder) - for fieldName, param := range parameters { - binders[fieldName] = newUntypedParamBinder(param, spec, formats) - } - return &UntypedRequestBinder{ - Parameters: parameters, - paramBinders: binders, - Spec: spec, - Formats: formats, - } -} - -// Bind perform the databinding and validation -func (o *UntypedRequestBinder) Bind(request *http.Request, routeParams RouteParams, consumer runtime.Consumer, data interface{}) error { - val := reflect.Indirect(reflect.ValueOf(data)) - isMap := val.Kind() == reflect.Map - var result []error - debugLog("binding %d parameters for %s %s", len(o.Parameters), request.Method, request.URL.EscapedPath()) - for fieldName, param := range o.Parameters { - binder := o.paramBinders[fieldName] - debugLog("binding parameter %s for %s %s", fieldName, request.Method, request.URL.EscapedPath()) - var target reflect.Value - if !isMap { - binder.Name = fieldName - target = val.FieldByName(fieldName) - } - - if isMap { - tpe := binder.Type() - if tpe == nil { - if param.Schema.Type.Contains("array") { - tpe = reflect.TypeOf([]interface{}{}) - } else { - tpe = reflect.TypeOf(map[string]interface{}{}) - } - } - target = reflect.Indirect(reflect.New(tpe)) - } - - if !target.IsValid() { - result = append(result, errors.New(500, "parameter name %q is an unknown field", binder.Name)) - continue - } - - if err := binder.Bind(request, routeParams, consumer, target); err != nil { - result = append(result, err) - continue - } - - if binder.validator != nil { - rr := binder.validator.Validate(target.Interface()) - if rr != nil && rr.HasErrors() { - result = append(result, rr.AsError()) - } - } - - if isMap { - val.SetMapIndex(reflect.ValueOf(param.Name), target) - } - } - - if len(result) > 0 { - return errors.CompositeValidationError(result...) - } - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/router.go b/vendor/github.com/go-openapi/runtime/middleware/router.go deleted file mode 100644 index 5052031c8d..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/router.go +++ /dev/null @@ -1,488 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "fmt" - "net/http" - fpath "path" - "regexp" - "strings" - - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/swag" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware/denco" -) - -// RouteParam is a object to capture route params in a framework agnostic way. -// implementations of the muxer should use these route params to communicate with the -// swagger framework -type RouteParam struct { - Name string - Value string -} - -// RouteParams the collection of route params -type RouteParams []RouteParam - -// Get gets the value for the route param for the specified key -func (r RouteParams) Get(name string) string { - vv, _, _ := r.GetOK(name) - if len(vv) > 0 { - return vv[len(vv)-1] - } - return "" -} - -// GetOK gets the value but also returns booleans to indicate if a key or value -// is present. This aids in validation and satisfies an interface in use there -// -// The returned values are: data, has key, has value -func (r RouteParams) GetOK(name string) ([]string, bool, bool) { - for _, p := range r { - if p.Name == name { - return []string{p.Value}, true, p.Value != "" - } - } - return nil, false, false -} - -// NewRouter creates a new context aware router middleware -func NewRouter(ctx *Context, next http.Handler) http.Handler { - if ctx.router == nil { - ctx.router = DefaultRouter(ctx.spec, ctx.api) - } - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if _, rCtx, ok := ctx.RouteInfo(r); ok { - next.ServeHTTP(rw, rCtx) - return - } - - // Not found, check if it exists in the other methods first - if others := ctx.AllowedMethods(r); len(others) > 0 { - ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.MethodNotAllowed(r.Method, others)) - return - } - - ctx.Respond(rw, r, ctx.analyzer.RequiredProduces(), nil, errors.NotFound("path %s was not found", r.URL.EscapedPath())) - }) -} - -// RoutableAPI represents an interface for things that can serve -// as a provider of implementations for the swagger router -type RoutableAPI interface { - HandlerFor(string, string) (http.Handler, bool) - ServeErrorFor(string) func(http.ResponseWriter, *http.Request, error) - ConsumersFor([]string) map[string]runtime.Consumer - ProducersFor([]string) map[string]runtime.Producer - AuthenticatorsFor(map[string]spec.SecurityScheme) map[string]runtime.Authenticator - Authorizer() runtime.Authorizer - Formats() strfmt.Registry - DefaultProduces() string - DefaultConsumes() string -} - -// Router represents a swagger aware router -type Router interface { - Lookup(method, path string) (*MatchedRoute, bool) - OtherMethods(method, path string) []string -} - -type defaultRouteBuilder struct { - spec *loads.Document - analyzer *analysis.Spec - api RoutableAPI - records map[string][]denco.Record -} - -type defaultRouter struct { - spec *loads.Document - routers map[string]*denco.Router -} - -func newDefaultRouteBuilder(spec *loads.Document, api RoutableAPI) *defaultRouteBuilder { - return &defaultRouteBuilder{ - spec: spec, - analyzer: analysis.New(spec.Spec()), - api: api, - records: make(map[string][]denco.Record), - } -} - -// DefaultRouter creates a default implemenation of the router -func DefaultRouter(spec *loads.Document, api RoutableAPI) Router { - builder := newDefaultRouteBuilder(spec, api) - if spec != nil { - for method, paths := range builder.analyzer.Operations() { - for path, operation := range paths { - fp := fpath.Join(spec.BasePath(), path) - debugLog("adding route %s %s %q", method, fp, operation.ID) - builder.AddRoute(method, fp, operation) - } - } - } - return builder.Build() -} - -// RouteAuthenticator is an authenticator that can compose several authenticators together. -// It also knows when it contains an authenticator that allows for anonymous pass through. -// Contains a group of 1 or more authenticators that have a logical AND relationship -type RouteAuthenticator struct { - Authenticator map[string]runtime.Authenticator - Schemes []string - Scopes map[string][]string - allScopes []string - commonScopes []string - allowAnonymous bool -} - -func (ra *RouteAuthenticator) AllowsAnonymous() bool { - return ra.allowAnonymous -} - -// AllScopes returns a list of unique scopes that is the combination -// of all the scopes in the requirements -func (ra *RouteAuthenticator) AllScopes() []string { - return ra.allScopes -} - -// CommonScopes returns a list of unique scopes that are common in all the -// scopes in the requirements -func (ra *RouteAuthenticator) CommonScopes() []string { - return ra.commonScopes -} - -// Authenticate Authenticator interface implementation -func (ra *RouteAuthenticator) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { - if ra.allowAnonymous { - route.Authenticator = ra - return true, nil, nil - } - // iterate in proper order - var lastResult interface{} - for _, scheme := range ra.Schemes { - if authenticator, ok := ra.Authenticator[scheme]; ok { - applies, princ, err := authenticator.Authenticate(&security.ScopedAuthRequest{ - Request: req, - RequiredScopes: ra.Scopes[scheme], - }) - if !applies { - return false, nil, nil - } - if err != nil { - route.Authenticator = ra - return true, nil, err - } - lastResult = princ - } - } - route.Authenticator = ra - return true, lastResult, nil -} - -func stringSliceUnion(slices ...[]string) []string { - unique := make(map[string]struct{}) - var result []string - for _, slice := range slices { - for _, entry := range slice { - if _, ok := unique[entry]; ok { - continue - } - unique[entry] = struct{}{} - result = append(result, entry) - } - } - return result -} - -func stringSliceIntersection(slices ...[]string) []string { - unique := make(map[string]int) - var intersection []string - - total := len(slices) - var emptyCnt int - for _, slice := range slices { - if len(slice) == 0 { - emptyCnt++ - continue - } - - for _, entry := range slice { - unique[entry]++ - if unique[entry] == total-emptyCnt { // this entry appeared in all the non-empty slices - intersection = append(intersection, entry) - } - } - } - - return intersection -} - -// RouteAuthenticators represents a group of authenticators that represent a logical OR -type RouteAuthenticators []RouteAuthenticator - -// AllowsAnonymous returns true when there is an authenticator that means optional auth -func (ras RouteAuthenticators) AllowsAnonymous() bool { - for _, ra := range ras { - if ra.AllowsAnonymous() { - return true - } - } - return false -} - -// Authenticate method implemention so this collection can be used as authenticator -func (ras RouteAuthenticators) Authenticate(req *http.Request, route *MatchedRoute) (bool, interface{}, error) { - var lastError error - var allowsAnon bool - var anonAuth RouteAuthenticator - - for _, ra := range ras { - if ra.AllowsAnonymous() { - anonAuth = ra - allowsAnon = true - continue - } - applies, usr, err := ra.Authenticate(req, route) - if !applies || err != nil || usr == nil { - if err != nil { - lastError = err - } - continue - } - return applies, usr, nil - } - - if allowsAnon && lastError == nil { - route.Authenticator = &anonAuth - return true, nil, lastError - } - return lastError != nil, nil, lastError -} - -type routeEntry struct { - PathPattern string - BasePath string - Operation *spec.Operation - Consumes []string - Consumers map[string]runtime.Consumer - Produces []string - Producers map[string]runtime.Producer - Parameters map[string]spec.Parameter - Handler http.Handler - Formats strfmt.Registry - Binder *UntypedRequestBinder - Authenticators RouteAuthenticators - Authorizer runtime.Authorizer -} - -// MatchedRoute represents the route that was matched in this request -type MatchedRoute struct { - routeEntry - Params RouteParams - Consumer runtime.Consumer - Producer runtime.Producer - Authenticator *RouteAuthenticator -} - -// HasAuth returns true when the route has a security requirement defined -func (m *MatchedRoute) HasAuth() bool { - return len(m.Authenticators) > 0 -} - -// NeedsAuth returns true when the request still -// needs to perform authentication -func (m *MatchedRoute) NeedsAuth() bool { - return m.HasAuth() && m.Authenticator == nil -} - -func (d *defaultRouter) Lookup(method, path string) (*MatchedRoute, bool) { - mth := strings.ToUpper(method) - debugLog("looking up route for %s %s", method, path) - if Debug { - if len(d.routers) == 0 { - debugLog("there are no known routers") - } - for meth := range d.routers { - debugLog("got a router for %s", meth) - } - } - if router, ok := d.routers[mth]; ok { - if m, rp, ok := router.Lookup(fpath.Clean(path)); ok && m != nil { - if entry, ok := m.(*routeEntry); ok { - debugLog("found a route for %s %s with %d parameters", method, path, len(entry.Parameters)) - var params RouteParams - for _, p := range rp { - v, err := pathUnescape(p.Value) - if err != nil { - debugLog("failed to escape %q: %v", p.Value, err) - v = p.Value - } - // a workaround to handle fragment/composing parameters until they are supported in denco router - // check if this parameter is a fragment within a path segment - if xpos := strings.Index(entry.PathPattern, fmt.Sprintf("{%s}", p.Name)) + len(p.Name) + 2; xpos < len(entry.PathPattern) && entry.PathPattern[xpos] != '/' { - // extract fragment parameters - ep := strings.Split(entry.PathPattern[xpos:], "/")[0] - pnames, pvalues := decodeCompositParams(p.Name, v, ep, nil, nil) - for i, pname := range pnames { - params = append(params, RouteParam{Name: pname, Value: pvalues[i]}) - } - } else { - // use the parameter directly - params = append(params, RouteParam{Name: p.Name, Value: v}) - } - } - return &MatchedRoute{routeEntry: *entry, Params: params}, true - } - } else { - debugLog("couldn't find a route by path for %s %s", method, path) - } - } else { - debugLog("couldn't find a route by method for %s %s", method, path) - } - return nil, false -} - -func (d *defaultRouter) OtherMethods(method, path string) []string { - mn := strings.ToUpper(method) - var methods []string - for k, v := range d.routers { - if k != mn { - if _, _, ok := v.Lookup(fpath.Clean(path)); ok { - methods = append(methods, k) - continue - } - } - } - return methods -} - -// convert swagger parameters per path segment into a denco parameter as multiple parameters per segment are not supported in denco -var pathConverter = regexp.MustCompile(`{(.+?)}([^/]*)`) - -func decodeCompositParams(name string, value string, pattern string, names []string, values []string) ([]string, []string) { - pleft := strings.Index(pattern, "{") - names = append(names, name) - if pleft < 0 { - if strings.HasSuffix(value, pattern) { - values = append(values, value[:len(value)-len(pattern)]) - } else { - values = append(values, "") - } - } else { - toskip := pattern[:pleft] - pright := strings.Index(pattern, "}") - vright := strings.Index(value, toskip) - if vright >= 0 { - values = append(values, value[:vright]) - } else { - values = append(values, "") - value = "" - } - return decodeCompositParams(pattern[pleft+1:pright], value[vright+len(toskip):], pattern[pright+1:], names, values) - } - return names, values -} - -func (d *defaultRouteBuilder) AddRoute(method, path string, operation *spec.Operation) { - mn := strings.ToUpper(method) - - bp := fpath.Clean(d.spec.BasePath()) - if len(bp) > 0 && bp[len(bp)-1] == '/' { - bp = bp[:len(bp)-1] - } - - debugLog("operation: %#v", *operation) - if handler, ok := d.api.HandlerFor(method, strings.TrimPrefix(path, bp)); ok { - consumes := d.analyzer.ConsumesFor(operation) - produces := d.analyzer.ProducesFor(operation) - parameters := d.analyzer.ParamsFor(method, strings.TrimPrefix(path, bp)) - - // add API defaults if not part of the spec - if defConsumes := d.api.DefaultConsumes(); defConsumes != "" && !swag.ContainsStringsCI(consumes, defConsumes) { - consumes = append(consumes, defConsumes) - } - - if defProduces := d.api.DefaultProduces(); defProduces != "" && !swag.ContainsStringsCI(produces, defProduces) { - produces = append(produces, defProduces) - } - - record := denco.NewRecord(pathConverter.ReplaceAllString(path, ":$1"), &routeEntry{ - BasePath: bp, - PathPattern: path, - Operation: operation, - Handler: handler, - Consumes: consumes, - Produces: produces, - Consumers: d.api.ConsumersFor(normalizeOffers(consumes)), - Producers: d.api.ProducersFor(normalizeOffers(produces)), - Parameters: parameters, - Formats: d.api.Formats(), - Binder: NewUntypedRequestBinder(parameters, d.spec.Spec(), d.api.Formats()), - Authenticators: d.buildAuthenticators(operation), - Authorizer: d.api.Authorizer(), - }) - d.records[mn] = append(d.records[mn], record) - } -} - -func (d *defaultRouteBuilder) buildAuthenticators(operation *spec.Operation) RouteAuthenticators { - requirements := d.analyzer.SecurityRequirementsFor(operation) - var auths []RouteAuthenticator - for _, reqs := range requirements { - var schemes []string - scopes := make(map[string][]string, len(reqs)) - var scopeSlices [][]string - for _, req := range reqs { - schemes = append(schemes, req.Name) - scopes[req.Name] = req.Scopes - scopeSlices = append(scopeSlices, req.Scopes) - } - - definitions := d.analyzer.SecurityDefinitionsForRequirements(reqs) - authenticators := d.api.AuthenticatorsFor(definitions) - auths = append(auths, RouteAuthenticator{ - Authenticator: authenticators, - Schemes: schemes, - Scopes: scopes, - allScopes: stringSliceUnion(scopeSlices...), - commonScopes: stringSliceIntersection(scopeSlices...), - allowAnonymous: len(reqs) == 1 && reqs[0].Name == "", - }) - } - return auths -} - -func (d *defaultRouteBuilder) Build() *defaultRouter { - routers := make(map[string]*denco.Router) - for method, records := range d.records { - router := denco.New() - _ = router.Build(records) - routers[method] = router - } - return &defaultRouter{ - spec: d.spec, - routers: routers, - } -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/security.go b/vendor/github.com/go-openapi/runtime/middleware/security.go deleted file mode 100644 index 2b061caefc..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/security.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import "net/http" - -func newSecureAPI(ctx *Context, next http.Handler) http.Handler { - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := ctx.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - if route != nil && !route.NeedsAuth() { - next.ServeHTTP(rw, r) - return - } - - _, rCtx, err := ctx.Authorize(r, route) - if err != nil { - ctx.Respond(rw, r, route.Produces, route, err) - return - } - r = rCtx - - next.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/spec.go b/vendor/github.com/go-openapi/runtime/middleware/spec.go deleted file mode 100644 index f029142980..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/spec.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "net/http" - "path" -) - -// Spec creates a middleware to serve a swagger spec. -// This allows for altering the spec before starting the http listener. -// This can be useful if you want to serve the swagger spec from another path than /swagger.json -// -func Spec(basePath string, b []byte, next http.Handler) http.Handler { - if basePath == "" { - basePath = "/" - } - pth := path.Join(basePath, "swagger.json") - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if r.URL.Path == pth { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusOK) - //#nosec - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "application/json") - rw.WriteHeader(http.StatusNotFound) - return - } - next.ServeHTTP(rw, r) - }) -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go deleted file mode 100644 index b4dea29e4b..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui.go +++ /dev/null @@ -1,168 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "html/template" - "net/http" - "path" -) - -// SwaggerUIOpts configures the Swaggerui middlewares -type SwaggerUIOpts struct { - // BasePath for the UI path, defaults to: / - BasePath string - // Path combines with BasePath for the full UI path, defaults to: docs - Path string - // SpecURL the url to find the spec for - SpecURL string - // OAuthCallbackURL the url called after OAuth2 login - OAuthCallbackURL string - - // The three components needed to embed swagger-ui - SwaggerURL string - SwaggerPresetURL string - SwaggerStylesURL string - - Favicon32 string - Favicon16 string - - // Title for the documentation site, default to: API documentation - Title string -} - -// EnsureDefaults in case some options are missing -func (r *SwaggerUIOpts) EnsureDefaults() { - if r.BasePath == "" { - r.BasePath = "/" - } - if r.Path == "" { - r.Path = "docs" - } - if r.SpecURL == "" { - r.SpecURL = "/swagger.json" - } - if r.OAuthCallbackURL == "" { - r.OAuthCallbackURL = path.Join(r.BasePath, r.Path, "oauth2-callback") - } - if r.SwaggerURL == "" { - r.SwaggerURL = swaggerLatest - } - if r.SwaggerPresetURL == "" { - r.SwaggerPresetURL = swaggerPresetLatest - } - if r.SwaggerStylesURL == "" { - r.SwaggerStylesURL = swaggerStylesLatest - } - if r.Favicon16 == "" { - r.Favicon16 = swaggerFavicon16Latest - } - if r.Favicon32 == "" { - r.Favicon32 = swaggerFavicon32Latest - } - if r.Title == "" { - r.Title = "API documentation" - } -} - -// SwaggerUI creates a middleware to serve a documentation site for a swagger spec. -// This allows for altering the spec before starting the http listener. -func SwaggerUI(opts SwaggerUIOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := path.Join(opts.BasePath, opts.Path) - tmpl := template.Must(template.New("swaggerui").Parse(swaggeruiTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, &opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if path.Join(r.URL.Path) == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - swaggerLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js" - swaggerPresetLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js" - swaggerStylesLatest = "https://unpkg.com/swagger-ui-dist/swagger-ui.css" - swaggerFavicon32Latest = "https://unpkg.com/swagger-ui-dist/favicon-32x32.png" - swaggerFavicon16Latest = "https://unpkg.com/swagger-ui-dist/favicon-16x16.png" - swaggeruiTemplate = ` - - - - - {{ .Title }} - - - - - - - - -
    - - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go b/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go deleted file mode 100644 index 576f6003f7..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/swaggerui_oauth2.go +++ /dev/null @@ -1,122 +0,0 @@ -package middleware - -import ( - "bytes" - "fmt" - "net/http" - "path" - "text/template" -) - -func SwaggerUIOAuth2Callback(opts SwaggerUIOpts, next http.Handler) http.Handler { - opts.EnsureDefaults() - - pth := opts.OAuthCallbackURL - tmpl := template.Must(template.New("swaggeroauth").Parse(swaggerOAuthTemplate)) - - buf := bytes.NewBuffer(nil) - _ = tmpl.Execute(buf, &opts) - b := buf.Bytes() - - return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { - if path.Join(r.URL.Path) == pth { - rw.Header().Set("Content-Type", "text/html; charset=utf-8") - rw.WriteHeader(http.StatusOK) - - _, _ = rw.Write(b) - return - } - - if next == nil { - rw.Header().Set("Content-Type", "text/plain") - rw.WriteHeader(http.StatusNotFound) - _, _ = rw.Write([]byte(fmt.Sprintf("%q not found", pth))) - return - } - next.ServeHTTP(rw, r) - }) -} - -const ( - swaggerOAuthTemplate = ` - - - - {{ .Title }} - - - - - -` -) diff --git a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go b/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go deleted file mode 100644 index 39a85f7d9e..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/untyped/api.go +++ /dev/null @@ -1,286 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package untyped - -import ( - "fmt" - "net/http" - "sort" - "strings" - - "github.com/go-openapi/analysis" - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - - "github.com/go-openapi/runtime" -) - -// NewAPI creates the default untyped API -func NewAPI(spec *loads.Document) *API { - var an *analysis.Spec - if spec != nil && spec.Spec() != nil { - an = analysis.New(spec.Spec()) - } - api := &API{ - spec: spec, - analyzer: an, - consumers: make(map[string]runtime.Consumer, 10), - producers: make(map[string]runtime.Producer, 10), - authenticators: make(map[string]runtime.Authenticator), - operations: make(map[string]map[string]runtime.OperationHandler), - ServeError: errors.ServeError, - Models: make(map[string]func() interface{}), - formats: strfmt.NewFormats(), - } - return api.WithJSONDefaults() -} - -// API represents an untyped mux for a swagger spec -type API struct { - spec *loads.Document - analyzer *analysis.Spec - DefaultProduces string - DefaultConsumes string - consumers map[string]runtime.Consumer - producers map[string]runtime.Producer - authenticators map[string]runtime.Authenticator - authorizer runtime.Authorizer - operations map[string]map[string]runtime.OperationHandler - ServeError func(http.ResponseWriter, *http.Request, error) - Models map[string]func() interface{} - formats strfmt.Registry -} - -// WithJSONDefaults loads the json defaults for this api -func (d *API) WithJSONDefaults() *API { - d.DefaultConsumes = runtime.JSONMime - d.DefaultProduces = runtime.JSONMime - d.consumers[runtime.JSONMime] = runtime.JSONConsumer() - d.producers[runtime.JSONMime] = runtime.JSONProducer() - return d -} - -// WithoutJSONDefaults clears the json defaults for this api -func (d *API) WithoutJSONDefaults() *API { - d.DefaultConsumes = "" - d.DefaultProduces = "" - delete(d.consumers, runtime.JSONMime) - delete(d.producers, runtime.JSONMime) - return d -} - -// Formats returns the registered string formats -func (d *API) Formats() strfmt.Registry { - if d.formats == nil { - d.formats = strfmt.NewFormats() - } - return d.formats -} - -// RegisterFormat registers a custom format validator -func (d *API) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - if d.formats == nil { - d.formats = strfmt.NewFormats() - } - d.formats.Add(name, format, validator) -} - -// RegisterAuth registers an auth handler in this api -func (d *API) RegisterAuth(scheme string, handler runtime.Authenticator) { - if d.authenticators == nil { - d.authenticators = make(map[string]runtime.Authenticator) - } - d.authenticators[scheme] = handler -} - -// RegisterAuthorizer registers an authorizer handler in this api -func (d *API) RegisterAuthorizer(handler runtime.Authorizer) { - d.authorizer = handler -} - -// RegisterConsumer registers a consumer for a media type. -func (d *API) RegisterConsumer(mediaType string, handler runtime.Consumer) { - if d.consumers == nil { - d.consumers = make(map[string]runtime.Consumer, 10) - } - d.consumers[strings.ToLower(mediaType)] = handler -} - -// RegisterProducer registers a producer for a media type -func (d *API) RegisterProducer(mediaType string, handler runtime.Producer) { - if d.producers == nil { - d.producers = make(map[string]runtime.Producer, 10) - } - d.producers[strings.ToLower(mediaType)] = handler -} - -// RegisterOperation registers an operation handler for an operation name -func (d *API) RegisterOperation(method, path string, handler runtime.OperationHandler) { - if d.operations == nil { - d.operations = make(map[string]map[string]runtime.OperationHandler, 30) - } - um := strings.ToUpper(method) - if b, ok := d.operations[um]; !ok || b == nil { - d.operations[um] = make(map[string]runtime.OperationHandler) - } - d.operations[um][path] = handler -} - -// OperationHandlerFor returns the operation handler for the specified id if it can be found -func (d *API) OperationHandlerFor(method, path string) (runtime.OperationHandler, bool) { - if d.operations == nil { - return nil, false - } - if pi, ok := d.operations[strings.ToUpper(method)]; ok { - h, ok := pi[path] - return h, ok - } - return nil, false -} - -// ConsumersFor gets the consumers for the specified media types -func (d *API) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer) - for _, mt := range mediaTypes { - if consumer, ok := d.consumers[mt]; ok { - result[mt] = consumer - } - } - return result -} - -// ProducersFor gets the producers for the specified media types -func (d *API) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer) - for _, mt := range mediaTypes { - if producer, ok := d.producers[mt]; ok { - result[mt] = producer - } - } - return result -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (d *API) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - result := make(map[string]runtime.Authenticator) - for k := range schemes { - if a, ok := d.authenticators[k]; ok { - result[k] = a - } - } - return result -} - -// Authorizer returns the registered authorizer -func (d *API) Authorizer() runtime.Authorizer { - return d.authorizer -} - -// Validate validates this API for any missing items -func (d *API) Validate() error { - return d.validate() -} - -// validateWith validates the registrations in this API against the provided spec analyzer -func (d *API) validate() error { - var consumes []string - for k := range d.consumers { - consumes = append(consumes, k) - } - - var produces []string - for k := range d.producers { - produces = append(produces, k) - } - - var authenticators []string - for k := range d.authenticators { - authenticators = append(authenticators, k) - } - - var operations []string - for m, v := range d.operations { - for p := range v { - operations = append(operations, fmt.Sprintf("%s %s", strings.ToUpper(m), p)) - } - } - - var definedAuths []string - for k := range d.spec.Spec().SecurityDefinitions { - definedAuths = append(definedAuths, k) - } - - if err := d.verify("consumes", consumes, d.analyzer.RequiredConsumes()); err != nil { - return err - } - if err := d.verify("produces", produces, d.analyzer.RequiredProduces()); err != nil { - return err - } - if err := d.verify("operation", operations, d.analyzer.OperationMethodPaths()); err != nil { - return err - } - - requiredAuths := d.analyzer.RequiredSecuritySchemes() - if err := d.verify("auth scheme", authenticators, requiredAuths); err != nil { - return err - } - if err := d.verify("security definitions", definedAuths, requiredAuths); err != nil { - return err - } - return nil -} - -func (d *API) verify(name string, registrations []string, expectations []string) error { - sort.Strings(registrations) - sort.Strings(expectations) - - expected := map[string]struct{}{} - seen := map[string]struct{}{} - - for _, v := range expectations { - expected[v] = struct{}{} - } - - var unspecified []string - for _, v := range registrations { - seen[v] = struct{}{} - if _, ok := expected[v]; !ok { - unspecified = append(unspecified, v) - } - } - - for k := range seen { - delete(expected, k) - } - - var unregistered []string - for k := range expected { - unregistered = append(unregistered, k) - } - sort.Strings(unspecified) - sort.Strings(unregistered) - - if len(unregistered) > 0 || len(unspecified) > 0 { - return &errors.APIVerificationFailed{ - Section: name, - MissingSpecification: unspecified, - MissingRegistration: unregistered, - } - } - - return nil -} diff --git a/vendor/github.com/go-openapi/runtime/middleware/validation.go b/vendor/github.com/go-openapi/runtime/middleware/validation.go deleted file mode 100644 index 1f0135b578..0000000000 --- a/vendor/github.com/go-openapi/runtime/middleware/validation.go +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package middleware - -import ( - "mime" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - - "github.com/go-openapi/runtime" -) - -type validation struct { - context *Context - result []error - request *http.Request - route *MatchedRoute - bound map[string]interface{} -} - -// ContentType validates the content type of a request -func validateContentType(allowed []string, actual string) error { - debugLog("validating content type for %q against [%s]", actual, strings.Join(allowed, ", ")) - if len(allowed) == 0 { - return nil - } - mt, _, err := mime.ParseMediaType(actual) - if err != nil { - return errors.InvalidContentType(actual, allowed) - } - if swag.ContainsStringsCI(allowed, mt) { - return nil - } - if swag.ContainsStringsCI(allowed, "*/*") { - return nil - } - parts := strings.Split(actual, "/") - if len(parts) == 2 && swag.ContainsStringsCI(allowed, parts[0]+"/*") { - return nil - } - return errors.InvalidContentType(actual, allowed) -} - -func validateRequest(ctx *Context, request *http.Request, route *MatchedRoute) *validation { - debugLog("validating request %s %s", request.Method, request.URL.EscapedPath()) - validate := &validation{ - context: ctx, - request: request, - route: route, - bound: make(map[string]interface{}), - } - - validate.contentType() - if len(validate.result) == 0 { - validate.responseFormat() - } - if len(validate.result) == 0 { - validate.parameters() - } - - return validate -} - -func (v *validation) parameters() { - debugLog("validating request parameters for %s %s", v.request.Method, v.request.URL.EscapedPath()) - if result := v.route.Binder.Bind(v.request, v.route.Params, v.route.Consumer, v.bound); result != nil { - if result.Error() == "validation failure list" { - for _, e := range result.(*errors.Validation).Value.([]interface{}) { - v.result = append(v.result, e.(error)) - } - return - } - v.result = append(v.result, result) - } -} - -func (v *validation) contentType() { - if len(v.result) == 0 && runtime.HasBody(v.request) { - debugLog("validating body content type for %s %s", v.request.Method, v.request.URL.EscapedPath()) - ct, _, req, err := v.context.ContentType(v.request) - if err != nil { - v.result = append(v.result, err) - } else { - v.request = req - } - - if len(v.result) == 0 { - if err := validateContentType(v.route.Consumes, ct); err != nil { - v.result = append(v.result, err) - } - } - if ct != "" && v.route.Consumer == nil { - cons, ok := v.route.Consumers[ct] - if !ok { - v.result = append(v.result, errors.New(500, "no consumer registered for %s", ct)) - } else { - v.route.Consumer = cons - } - } - } -} - -func (v *validation) responseFormat() { - // if the route provides values for Produces and no format could be identify then return an error. - // if the route does not specify values for Produces then treat request as valid since the API designer - // choose not to specify the format for responses. - if str, rCtx := v.context.ResponseFormat(v.request, v.route.Produces); str == "" && len(v.route.Produces) > 0 { - v.request = rCtx - v.result = append(v.result, errors.InvalidResponseFormat(v.request.Header.Get(runtime.HeaderAccept), v.route.Produces)) - } -} diff --git a/vendor/github.com/go-openapi/runtime/request.go b/vendor/github.com/go-openapi/runtime/request.go deleted file mode 100644 index 078fda1739..0000000000 --- a/vendor/github.com/go-openapi/runtime/request.go +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bufio" - "io" - "net/http" - "strings" - - "github.com/go-openapi/swag" -) - -// CanHaveBody returns true if this method can have a body -func CanHaveBody(method string) bool { - mn := strings.ToUpper(method) - return mn == "POST" || mn == "PUT" || mn == "PATCH" || mn == "DELETE" -} - -// IsSafe returns true if this is a request with a safe method -func IsSafe(r *http.Request) bool { - mn := strings.ToUpper(r.Method) - return mn == "GET" || mn == "HEAD" -} - -// AllowsBody returns true if the request allows for a body -func AllowsBody(r *http.Request) bool { - mn := strings.ToUpper(r.Method) - return mn != "HEAD" -} - -// HasBody returns true if this method needs a content-type -func HasBody(r *http.Request) bool { - // happy case: we have a content length set - if r.ContentLength > 0 { - return true - } - - if r.Header.Get("content-length") != "" { - // in this case, no Transfer-Encoding should be present - // we have a header set but it was explicitly set to 0, so we assume no body - return false - } - - rdr := newPeekingReader(r.Body) - r.Body = rdr - return rdr.HasContent() -} - -func newPeekingReader(r io.ReadCloser) *peekingReader { - if r == nil { - return nil - } - return &peekingReader{ - underlying: bufio.NewReader(r), - orig: r, - } -} - -type peekingReader struct { - underlying interface { - Buffered() int - Peek(int) ([]byte, error) - Read([]byte) (int, error) - } - orig io.ReadCloser -} - -func (p *peekingReader) HasContent() bool { - if p == nil { - return false - } - if p.underlying.Buffered() > 0 { - return true - } - b, err := p.underlying.Peek(1) - if err != nil { - return false - } - return len(b) > 0 -} - -func (p *peekingReader) Read(d []byte) (int, error) { - if p == nil { - return 0, io.EOF - } - return p.underlying.Read(d) -} - -func (p *peekingReader) Close() error { - p.underlying = nil - if p.orig != nil { - return p.orig.Close() - } - return nil -} - -// JSONRequest creates a new http request with json headers set -func JSONRequest(method, urlStr string, body io.Reader) (*http.Request, error) { - req, err := http.NewRequest(method, urlStr, body) - if err != nil { - return nil, err - } - req.Header.Add(HeaderContentType, JSONMime) - req.Header.Add(HeaderAccept, JSONMime) - return req, nil -} - -// Gettable for things with a method GetOK(string) (data string, hasKey bool, hasValue bool) -type Gettable interface { - GetOK(string) ([]string, bool, bool) -} - -// ReadSingleValue reads a single value from the source -func ReadSingleValue(values Gettable, name string) string { - vv, _, hv := values.GetOK(name) - if hv { - return vv[len(vv)-1] - } - return "" -} - -// ReadCollectionValue reads a collection value from a string data source -func ReadCollectionValue(values Gettable, name, collectionFormat string) []string { - v := ReadSingleValue(values, name) - return swag.SplitByFormat(v, collectionFormat) -} diff --git a/vendor/github.com/go-openapi/runtime/security/authenticator.go b/vendor/github.com/go-openapi/runtime/security/authenticator.go deleted file mode 100644 index c3ffdac7e8..0000000000 --- a/vendor/github.com/go-openapi/runtime/security/authenticator.go +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "context" - "net/http" - "strings" - - "github.com/go-openapi/errors" - - "github.com/go-openapi/runtime" -) - -const ( - query = "query" - header = "header" -) - -// HttpAuthenticator is a function that authenticates a HTTP request -func HttpAuthenticator(handler func(*http.Request) (bool, interface{}, error)) runtime.Authenticator { - return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { - if request, ok := params.(*http.Request); ok { - return handler(request) - } - if scoped, ok := params.(*ScopedAuthRequest); ok { - return handler(scoped.Request) - } - return false, nil, nil - }) -} - -// ScopedAuthenticator is a function that authenticates a HTTP request against a list of valid scopes -func ScopedAuthenticator(handler func(*ScopedAuthRequest) (bool, interface{}, error)) runtime.Authenticator { - return runtime.AuthenticatorFunc(func(params interface{}) (bool, interface{}, error) { - if request, ok := params.(*ScopedAuthRequest); ok { - return handler(request) - } - return false, nil, nil - }) -} - -// UserPassAuthentication authentication function -type UserPassAuthentication func(string, string) (interface{}, error) - -// UserPassAuthenticationCtx authentication function with context.Context -type UserPassAuthenticationCtx func(context.Context, string, string) (context.Context, interface{}, error) - -// TokenAuthentication authentication function -type TokenAuthentication func(string) (interface{}, error) - -// TokenAuthenticationCtx authentication function with context.Context -type TokenAuthenticationCtx func(context.Context, string) (context.Context, interface{}, error) - -// ScopedTokenAuthentication authentication function -type ScopedTokenAuthentication func(string, []string) (interface{}, error) - -// ScopedTokenAuthenticationCtx authentication function with context.Context -type ScopedTokenAuthenticationCtx func(context.Context, string, []string) (context.Context, interface{}, error) - -var DefaultRealmName = "API" - -type secCtxKey uint8 - -const ( - failedBasicAuth secCtxKey = iota - oauth2SchemeName -) - -func FailedBasicAuth(r *http.Request) string { - return FailedBasicAuthCtx(r.Context()) -} - -func FailedBasicAuthCtx(ctx context.Context) string { - v, ok := ctx.Value(failedBasicAuth).(string) - if !ok { - return "" - } - return v -} - -func OAuth2SchemeName(r *http.Request) string { - return OAuth2SchemeNameCtx(r.Context()) -} - -func OAuth2SchemeNameCtx(ctx context.Context) string { - v, ok := ctx.Value(oauth2SchemeName).(string) - if !ok { - return "" - } - return v -} - -// BasicAuth creates a basic auth authenticator with the provided authentication function -func BasicAuth(authenticate UserPassAuthentication) runtime.Authenticator { - return BasicAuthRealm(DefaultRealmName, authenticate) -} - -// BasicAuthRealm creates a basic auth authenticator with the provided authentication function and realm name -func BasicAuthRealm(realm string, authenticate UserPassAuthentication) runtime.Authenticator { - if realm == "" { - realm = DefaultRealmName - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - if usr, pass, ok := r.BasicAuth(); ok { - p, err := authenticate(usr, pass) - if err != nil { - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - } - return true, p, err - } - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - return false, nil, nil - }) -} - -// BasicAuthCtx creates a basic auth authenticator with the provided authentication function with support for context.Context -func BasicAuthCtx(authenticate UserPassAuthenticationCtx) runtime.Authenticator { - return BasicAuthRealmCtx(DefaultRealmName, authenticate) -} - -// BasicAuthRealmCtx creates a basic auth authenticator with the provided authentication function and realm name with support for context.Context -func BasicAuthRealmCtx(realm string, authenticate UserPassAuthenticationCtx) runtime.Authenticator { - if realm == "" { - realm = DefaultRealmName - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - if usr, pass, ok := r.BasicAuth(); ok { - ctx, p, err := authenticate(r.Context(), usr, pass) - if err != nil { - ctx = context.WithValue(ctx, failedBasicAuth, realm) - } - *r = *r.WithContext(ctx) - return true, p, err - } - *r = *r.WithContext(context.WithValue(r.Context(), failedBasicAuth, realm)) - return false, nil, nil - }) -} - -// APIKeyAuth creates an authenticator that uses a token for authorization. -// This token can be obtained from either a header or a query string -func APIKeyAuth(name, in string, authenticate TokenAuthentication) runtime.Authenticator { - inl := strings.ToLower(in) - if inl != query && inl != header { - // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) - } - - var getToken func(*http.Request) string - switch inl { - case header: - getToken = func(r *http.Request) string { return r.Header.Get(name) } - case query: - getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - token := getToken(r) - if token == "" { - return false, nil, nil - } - - p, err := authenticate(token) - return true, p, err - }) -} - -// APIKeyAuthCtx creates an authenticator that uses a token for authorization with support for context.Context. -// This token can be obtained from either a header or a query string -func APIKeyAuthCtx(name, in string, authenticate TokenAuthenticationCtx) runtime.Authenticator { - inl := strings.ToLower(in) - if inl != query && inl != header { - // panic because this is most likely a typo - panic(errors.New(500, "api key auth: in value needs to be either \"query\" or \"header\".")) - } - - var getToken func(*http.Request) string - switch inl { - case header: - getToken = func(r *http.Request) string { return r.Header.Get(name) } - case query: - getToken = func(r *http.Request) string { return r.URL.Query().Get(name) } - } - - return HttpAuthenticator(func(r *http.Request) (bool, interface{}, error) { - token := getToken(r) - if token == "" { - return false, nil, nil - } - - ctx, p, err := authenticate(r.Context(), token) - *r = *r.WithContext(ctx) - return true, p, err - }) -} - -// ScopedAuthRequest contains both a http request and the required scopes for a particular operation -type ScopedAuthRequest struct { - Request *http.Request - RequiredScopes []string -} - -// BearerAuth for use with oauth2 flows -func BearerAuth(name string, authenticate ScopedTokenAuthentication) runtime.Authenticator { - const prefix = "Bearer " - return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { - var token string - hdr := r.Request.Header.Get(runtime.HeaderAuthorization) - if strings.HasPrefix(hdr, prefix) { - token = strings.TrimPrefix(hdr, prefix) - } - if token == "" { - qs := r.Request.URL.Query() - token = qs.Get("access_token") - } - //#nosec - ct, _, _ := runtime.ContentType(r.Request.Header) - if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") - } - - if token == "" { - return false, nil, nil - } - - rctx := context.WithValue(r.Request.Context(), oauth2SchemeName, name) - *r.Request = *r.Request.WithContext(rctx) - p, err := authenticate(token, r.RequiredScopes) - return true, p, err - }) -} - -// BearerAuthCtx for use with oauth2 flows with support for context.Context. -func BearerAuthCtx(name string, authenticate ScopedTokenAuthenticationCtx) runtime.Authenticator { - const prefix = "Bearer " - return ScopedAuthenticator(func(r *ScopedAuthRequest) (bool, interface{}, error) { - var token string - hdr := r.Request.Header.Get(runtime.HeaderAuthorization) - if strings.HasPrefix(hdr, prefix) { - token = strings.TrimPrefix(hdr, prefix) - } - if token == "" { - qs := r.Request.URL.Query() - token = qs.Get("access_token") - } - //#nosec - ct, _, _ := runtime.ContentType(r.Request.Header) - if token == "" && (ct == "application/x-www-form-urlencoded" || ct == "multipart/form-data") { - token = r.Request.FormValue("access_token") - } - - if token == "" { - return false, nil, nil - } - - rctx := context.WithValue(r.Request.Context(), oauth2SchemeName, name) - ctx, p, err := authenticate(rctx, token, r.RequiredScopes) - *r.Request = *r.Request.WithContext(ctx) - return true, p, err - }) -} diff --git a/vendor/github.com/go-openapi/runtime/security/authorizer.go b/vendor/github.com/go-openapi/runtime/security/authorizer.go deleted file mode 100644 index 00c1a4d6a4..0000000000 --- a/vendor/github.com/go-openapi/runtime/security/authorizer.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package security - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// Authorized provides a default implementation of the Authorizer interface where all -// requests are authorized (successful) -func Authorized() runtime.Authorizer { - return runtime.AuthorizerFunc(func(_ *http.Request, _ interface{}) error { return nil }) -} diff --git a/vendor/github.com/go-openapi/runtime/statuses.go b/vendor/github.com/go-openapi/runtime/statuses.go deleted file mode 100644 index 3b011a0bff..0000000000 --- a/vendor/github.com/go-openapi/runtime/statuses.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -// Statuses lists the most common HTTP status codes to default message -// taken from https://httpstatuses.com/ -var Statuses = map[int]string{ - 100: "Continue", - 101: "Switching Protocols", - 102: "Processing", - 103: "Checkpoint", - 122: "URI too long", - 200: "OK", - 201: "Created", - 202: "Accepted", - 203: "Request Processed", - 204: "No Content", - 205: "Reset Content", - 206: "Partial Content", - 207: "Multi-Status", - 208: "Already Reported", - 226: "IM Used", - 300: "Multiple Choices", - 301: "Moved Permanently", - 302: "Found", - 303: "See Other", - 304: "Not Modified", - 305: "Use Proxy", - 306: "Switch Proxy", - 307: "Temporary Redirect", - 308: "Permanent Redirect", - 400: "Bad Request", - 401: "Unauthorized", - 402: "Payment Required", - 403: "Forbidden", - 404: "Not Found", - 405: "Method Not Allowed", - 406: "Not Acceptable", - 407: "Proxy Authentication Required", - 408: "Request Timeout", - 409: "Conflict", - 410: "Gone", - 411: "Length Required", - 412: "Precondition Failed", - 413: "Request Entity Too Large", - 414: "Request-URI Too Long", - 415: "Unsupported Media Type", - 416: "Request Range Not Satisfiable", - 417: "Expectation Failed", - 418: "I'm a teapot", - 420: "Enhance Your Calm", - 422: "Unprocessable Entity", - 423: "Locked", - 424: "Failed Dependency", - 426: "Upgrade Required", - 428: "Precondition Required", - 429: "Too Many Requests", - 431: "Request Header Fields Too Large", - 444: "No Response", - 449: "Retry With", - 450: "Blocked by Windows Parental Controls", - 451: "Wrong Exchange Server", - 499: "Client Closed Request", - 500: "Internal Server Error", - 501: "Not Implemented", - 502: "Bad Gateway", - 503: "Service Unavailable", - 504: "Gateway Timeout", - 505: "HTTP Version Not Supported", - 506: "Variant Also Negotiates", - 507: "Insufficient Storage", - 508: "Loop Detected", - 509: "Bandwidth Limit Exceeded", - 510: "Not Extended", - 511: "Network Authentication Required", - 598: "Network read timeout error", - 599: "Network connect timeout error", -} diff --git a/vendor/github.com/go-openapi/runtime/text.go b/vendor/github.com/go-openapi/runtime/text.go deleted file mode 100644 index f33320b7dd..0000000000 --- a/vendor/github.com/go-openapi/runtime/text.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "bytes" - "encoding" - "errors" - "fmt" - "io" - "reflect" - - "github.com/go-openapi/swag" -) - -// TextConsumer creates a new text consumer -func TextConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - if reader == nil { - return errors.New("TextConsumer requires a reader") // early exit - } - - buf := new(bytes.Buffer) - _, err := buf.ReadFrom(reader) - if err != nil { - return err - } - b := buf.Bytes() - - // If the buffer is empty, no need to unmarshal it, which causes a panic. - if len(b) == 0 { - return nil - } - - if tu, ok := data.(encoding.TextUnmarshaler); ok { - err := tu.UnmarshalText(b) - if err != nil { - return fmt.Errorf("text consumer: %v", err) - } - - return nil - } - - t := reflect.TypeOf(data) - if data != nil && t.Kind() == reflect.Ptr { - v := reflect.Indirect(reflect.ValueOf(data)) - if t.Elem().Kind() == reflect.String { - v.SetString(string(b)) - return nil - } - } - - return fmt.Errorf("%v (%T) is not supported by the TextConsumer, %s", - data, data, "can be resolved by supporting TextUnmarshaler interface") - }) -} - -// TextProducer creates a new text producer -func TextProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - if writer == nil { - return errors.New("TextProducer requires a writer") // early exit - } - - if data == nil { - return errors.New("no data given to produce text from") - } - - if tm, ok := data.(encoding.TextMarshaler); ok { - txt, err := tm.MarshalText() - if err != nil { - return fmt.Errorf("text producer: %v", err) - } - _, err = writer.Write(txt) - return err - } - - if str, ok := data.(error); ok { - _, err := writer.Write([]byte(str.Error())) - return err - } - - if str, ok := data.(fmt.Stringer); ok { - _, err := writer.Write([]byte(str.String())) - return err - } - - v := reflect.Indirect(reflect.ValueOf(data)) - if t := v.Type(); t.Kind() == reflect.Struct || t.Kind() == reflect.Slice { - b, err := swag.WriteJSON(data) - if err != nil { - return err - } - _, err = writer.Write(b) - return err - } - if v.Kind() != reflect.String { - return fmt.Errorf("%T is not a supported type by the TextProducer", data) - } - - _, err := writer.Write([]byte(v.String())) - return err - }) -} diff --git a/vendor/github.com/go-openapi/runtime/values.go b/vendor/github.com/go-openapi/runtime/values.go deleted file mode 100644 index 11f5732af4..0000000000 --- a/vendor/github.com/go-openapi/runtime/values.go +++ /dev/null @@ -1,19 +0,0 @@ -package runtime - -// Values typically represent parameters on a http request. -type Values map[string][]string - -// GetOK returns the values collection for the given key. -// When the key is present in the map it will return true for hasKey. -// When the value is not empty it will return true for hasValue. -func (v Values) GetOK(key string) (value []string, hasKey bool, hasValue bool) { - value, hasKey = v[key] - if !hasKey { - return - } - if len(value) == 0 { - return - } - hasValue = true - return -} diff --git a/vendor/github.com/go-openapi/runtime/xml.go b/vendor/github.com/go-openapi/runtime/xml.go deleted file mode 100644 index 821c7393df..0000000000 --- a/vendor/github.com/go-openapi/runtime/xml.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package runtime - -import ( - "encoding/xml" - "io" -) - -// XMLConsumer creates a new XML consumer -func XMLConsumer() Consumer { - return ConsumerFunc(func(reader io.Reader, data interface{}) error { - dec := xml.NewDecoder(reader) - return dec.Decode(data) - }) -} - -// XMLProducer creates a new XML producer -func XMLProducer() Producer { - return ProducerFunc(func(writer io.Writer, data interface{}) error { - enc := xml.NewEncoder(writer) - return enc.Encode(data) - }) -} diff --git a/vendor/github.com/go-openapi/spec/.editorconfig b/vendor/github.com/go-openapi/spec/.editorconfig deleted file mode 100644 index 3152da69a5..0000000000 --- a/vendor/github.com/go-openapi/spec/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/spec/.gitignore b/vendor/github.com/go-openapi/spec/.gitignore deleted file mode 100644 index dd91ed6a04..0000000000 --- a/vendor/github.com/go-openapi/spec/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/spec/.golangci.yml b/vendor/github.com/go-openapi/spec/.golangci.yml deleted file mode 100644 index 835d55e742..0000000000 --- a/vendor/github.com/go-openapi/spec/.golangci.yml +++ /dev/null @@ -1,42 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 45 - maligned: - suggest-new: true - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 2 - -linters: - enable-all: true - disable: - - maligned - - unparam - - lll - - gochecknoinits - - gochecknoglobals - - funlen - - godox - - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - gomnd - - exhaustivestruct - - goerr113 - - errorlint - - nestif - - godot - - gofumpt - - paralleltest - - tparallel - - thelper - - ifshort diff --git a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/spec/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/spec/LICENSE b/vendor/github.com/go-openapi/spec/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/spec/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/spec/README.md b/vendor/github.com/go-openapi/spec/README.md deleted file mode 100644 index 18782c6daf..0000000000 --- a/vendor/github.com/go-openapi/spec/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# OAI object model - -[![Build Status](https://travis-ci.org/go-openapi/spec.svg?branch=master)](https://travis-ci.org/go-openapi/spec) - -[![codecov](https://codecov.io/gh/go-openapi/spec/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/spec) -[![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/spec/master/LICENSE) -[![Go Reference](https://pkg.go.dev/badge/github.com/go-openapi/spec.svg)](https://pkg.go.dev/github.com/go-openapi/spec) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/spec)](https://goreportcard.com/report/github.com/go-openapi/spec) - -The object model for OpenAPI specification documents. - -### FAQ - -* What does this do? - -> 1. This package knows how to marshal and unmarshal Swagger API specifications into a golang object model -> 2. It knows how to resolve $ref and expand them to make a single root document - -* How does it play with the rest of the go-openapi packages ? - -> 1. This package is at the core of the go-openapi suite of packages and [code generator](https://github.com/go-swagger/go-swagger) -> 2. There is a [spec loading package](https://github.com/go-openapi/loads) to fetch specs as JSON or YAML from local or remote locations -> 3. There is a [spec validation package](https://github.com/go-openapi/validate) built on top of it -> 4. There is a [spec analysis package](https://github.com/go-openapi/analysis) built on top of it, to analyze, flatten, fix and merge spec documents - -* Does this library support OpenAPI 3? - -> No. -> This package currently only supports OpenAPI 2.0 (aka Swagger 2.0). -> There is no plan to make it evolve toward supporting OpenAPI 3.x. -> This [discussion thread](https://github.com/go-openapi/spec/issues/21) relates the full story. -> -> An early attempt to support Swagger 3 may be found at: https://github.com/go-openapi/spec3 diff --git a/vendor/github.com/go-openapi/spec/appveyor.yml b/vendor/github.com/go-openapi/spec/appveyor.yml deleted file mode 100644 index 0903593916..0000000000 --- a/vendor/github.com/go-openapi/spec/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: "0.1.{build}" - -clone_folder: C:\go-openapi\spec -shallow_clone: true # for startup speed -pull_requests: - do_not_increment_build_number: true - -#skip_tags: true -#skip_branch_with_pr: true - -# appveyor.yml -build: off - -environment: - GOPATH: c:\gopath - -stack: go 1.15 - -test_script: - - go test -v -timeout 20m ./... - -deploy: off - -notifications: - - provider: Slack - incoming_webhook: https://hooks.slack.com/services/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 - auth_token: - secure: Sf7kZf7ZGbnwWUMpffHwMu5A0cHkLK2MYY32LNTPj4+/3qC3Ghl7+9v4TSLOqOlCwdRNjOGblAq7s+GDJed6/xgRQl1JtCi1klzZNrYX4q01pgTPvvGcwbBkIYgeMaPeIRcK9OZnud7sRXdttozgTOpytps2U6Js32ip7uj5mHSg2ub0FwoSJwlS6dbezZ8+eDhoha0F/guY99BEwx8Bd+zROrT2TFGsSGOFGN6wFc7moCqTHO/YkWib13a2QNXqOxCCVBy/lt76Wp+JkeFppjHlzs/2lP3EAk13RIUAaesdEUHvIHrzCyNJEd3/+KO2DzsWOYfpktd+KBCvgaYOsoo7ubdT3IROeAegZdCgo/6xgCEsmFc9ZcqCfN5yNx2A+BZ2Vwmpws+bQ1E1+B5HDzzaiLcYfG4X2O210QVGVDLWsv1jqD+uPYeHY2WRfh5ZsIUFvaqgUEnwHwrK44/8REAhQavt1QAj5uJpsRd7CkRVPWRNK+yIky+wgbVUFEchRNmS55E7QWf+W4+4QZkQi7vUTMc9nbTUu2Es9NfvfudOpM2wZbn98fjpb/qq/nRv6Bk+ca+7XD5/IgNLMbWp2ouDdzbiHLCOfDUiHiDJhLfFZx9Bwo7ZwfzeOlbrQX66bx7xRKYmOe4DLrXhNcpbsMa8qbfxlZRCmYbubB/Y8h4= - channel: bots - on_build_success: false - on_build_failure: true - on_build_status_changed: true diff --git a/vendor/github.com/go-openapi/spec/bindata.go b/vendor/github.com/go-openapi/spec/bindata.go deleted file mode 100644 index afc83850c2..0000000000 --- a/vendor/github.com/go-openapi/spec/bindata.go +++ /dev/null @@ -1,297 +0,0 @@ -// Code generated by go-bindata. DO NOT EDIT. -// sources: -// schemas/jsonschema-draft-04.json (4.357kB) -// schemas/v2/schema.json (40.248kB) - -package spec - -import ( - "bytes" - "compress/gzip" - "crypto/sha256" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo - digest [sha256.Size]byte -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -func (fi bindataFileInfo) Name() string { - return fi.name -} -func (fi bindataFileInfo) Size() int64 { - return fi.size -} -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} -func (fi bindataFileInfo) IsDir() bool { - return false -} -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _jsonschemaDraft04Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x57\x3d\x6f\xdb\x3c\x10\xde\xf3\x2b\x08\x26\x63\xf2\x2a\x2f\xd0\xc9\x5b\xd1\x2e\x01\x5a\x34\x43\x37\x23\x03\x6d\x9d\x6c\x06\x14\xa9\x50\x54\x60\xc3\xd0\x7f\x2f\x28\x4a\x14\x29\x91\x92\x2d\xa7\x8d\x97\x28\xbc\xaf\xe7\x8e\xf7\xc5\xd3\x0d\x42\x08\x61\x9a\xe2\x15\xc2\x7b\xa5\x8a\x55\x92\xbc\x96\x82\x3f\x94\xdb\x3d\xe4\xe4\x3f\x21\x77\x49\x2a\x49\xa6\x1e\x1e\xbf\x24\xe6\xec\x16\xdf\x1b\xa1\x3b\xf3\xff\x02\xc9\x14\xca\xad\xa4\x85\xa2\x82\x6b\xe9\x6f\x42\x02\x32\x2c\x28\x07\x45\x5a\x15\x3d\x77\x46\x39\xd5\xcc\x25\x5e\x21\x83\xb8\x21\x18\xb6\xaf\x52\x92\xa3\x47\x68\x88\xea\x58\x80\x56\x4e\x1a\xf2\xbd\x4f\xcc\x29\x7f\x52\x90\x6b\x7d\xff\x0f\x48\xb4\x3d\x3f\x21\x7c\x27\x21\xd3\x2a\x6e\x31\xaa\x2d\x53\xdd\xf3\xe3\x42\x94\x54\xd1\x77\x78\xe2\x0a\x76\x20\xe3\x20\x68\xcb\x30\x86\x41\xf3\x2a\xc7\x2b\xf4\x78\x8e\xfe\xef\x90\x91\x8a\xa9\xc7\xb1\x1d\xc2\xd8\x2f\x0d\x75\xed\xc1\x4e\x9c\xc8\x25\x43\xac\xa8\xbe\xd7\xcc\xa9\xd1\xa9\x21\xa0\x1a\xbd\x04\x61\x94\x34\x2f\x18\xfc\x3e\x16\x50\x8e\x4d\x03\x6f\x1c\x58\xdb\x48\x23\xbc\x11\x82\x01\xe1\xfa\xd3\x3a\x8e\x30\xaf\x18\x33\x7f\xf3\x8d\x39\x11\x9b\x57\xd8\x2a\xfd\x55\x2a\x49\xf9\x0e\xc7\xec\x37\xd4\x25\xf7\xec\x5c\x66\xc7\xd7\x99\xaa\xcf\x4f\x89\x8a\xd3\xb7\x0a\x3a\xaa\x92\x15\xf4\x30\x6f\x1c\xb0\xd6\x46\xe7\x98\x39\x2d\xa4\x28\x40\x2a\x3a\x88\x9e\x29\xba\x88\x37\x2d\xca\x60\x38\xfa\xba\x5b\x20\xac\xa8\x62\xb0\x4c\xd4\xaf\xda\x45\x0a\xba\x5c\x3b\xb9\xc7\x79\xc5\x14\x2d\x18\x34\x19\x1c\x51\xdb\x25\x4d\xb4\x7e\x06\x14\x38\x6c\x59\x55\xd2\x77\xf8\x69\x59\xfc\x7b\x73\xed\x93\x43\xcb\x32\x6d\x3c\x28\xdc\x1b\x9a\xd3\x62\xab\xc2\x27\xf7\x41\xc9\x08\x2b\x23\x08\xad\x13\x57\x21\x9c\xd3\x72\x0d\x42\x72\xf8\x01\x7c\xa7\xf6\x83\xce\x39\xd7\x82\x3c\x1f\x2f\xd6\x60\x1b\xa2\xdf\x35\x89\x52\x20\xe7\x73\x74\xe0\x66\x26\x64\x4e\xb4\x97\x58\xc2\x0e\x0e\xe1\x60\x92\x34\x6d\xa0\x10\xd6\xb5\x83\x61\x27\xe6\x47\xd3\x89\xbd\x63\xfd\x3b\x8d\x03\x3d\x6c\x42\x2d\x5b\x70\xee\xe8\xdf\x4b\xf4\x66\x4e\xe1\x01\x45\x17\x80\x74\xad\x4f\xc3\xf3\xae\xc6\x1d\xc6\xd7\xc2\xce\xc9\xe1\x29\x30\x86\x2f\x4a\xa6\x4b\x15\x84\x73\xc9\x6f\xfd\x7f\xa5\x6e\x9e\xbd\xf1\xb0\xd4\xdd\x45\x5a\xc2\x3e\x4b\x78\xab\xa8\x84\x74\x4a\x91\x3b\x92\x23\x05\xf2\x1c\x1e\x7b\xf3\x09\xf8\xcf\xab\x24\xb6\x60\xa2\xe8\x4c\x9f\x75\x77\xaa\x8c\xe6\x01\x45\x36\x86\xcf\xc3\x63\x3a\xea\xd4\x8d\x7e\x06\xac\x14\x0a\xe0\x29\xf0\xed\x07\x22\x1a\x65\xda\x44\xae\xa2\x73\x1a\xe6\x90\x69\xa2\x8c\x46\xb2\x2f\xde\x49\x38\x08\xed\xfe\xfd\x41\xaf\x9f\xa9\x55\xd7\xdd\x22\x8d\xfa\x45\x63\xc5\x0f\x80\xf3\xb4\x08\xd6\x79\x30\x9e\x93\xee\x59\xa6\xd0\x4b\xee\x22\xe3\x33\xc1\x3a\x27\x68\x36\x78\x7e\x87\x0a\x06\xd5\x2e\x20\xd3\xaf\x15\xfb\xd8\x3b\x73\x14\xbb\x92\xed\x05\x5d\x2e\x29\x38\x2c\x94\xe4\x42\x45\x5e\xd3\xb5\x7d\xdf\x47\xca\x38\xb4\x5c\xaf\xfb\x7d\xdd\x6d\xf4\xa1\x2d\x77\xdd\x2f\xce\x6d\xc4\x7b\x8b\x4e\x67\xa9\x6f\xfe\x04\x00\x00\xff\xff\xb1\xd1\x27\x78\x05\x11\x00\x00") - -func jsonschemaDraft04JsonBytes() ([]byte, error) { - return bindataRead( - _jsonschemaDraft04Json, - "jsonschema-draft-04.json", - ) -} - -func jsonschemaDraft04Json() (*asset, error) { - bytes, err := jsonschemaDraft04JsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "jsonschema-draft-04.json", size: 4357, mode: os.FileMode(0640), modTime: time.Unix(1568963823, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe1, 0x48, 0x9d, 0xb, 0x47, 0x55, 0xf0, 0x27, 0x93, 0x30, 0x25, 0x91, 0xd3, 0xfc, 0xb8, 0xf0, 0x7b, 0x68, 0x93, 0xa8, 0x2a, 0x94, 0xf2, 0x48, 0x95, 0xf8, 0xe4, 0xed, 0xf1, 0x1b, 0x82, 0xe2}} - return a, nil -} - -var _v2SchemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5d\x4f\x93\xdb\x36\xb2\xbf\xfb\x53\xa0\x14\x57\xd9\xae\xd8\x92\xe3\xf7\x2e\xcf\x97\xd4\xbc\xd8\x49\x66\x37\x5e\x4f\x79\x26\xbb\x87\x78\x5c\x05\x91\x2d\x09\x09\x09\x30\x00\x38\x33\x5a\xef\x7c\xf7\x2d\xf0\x9f\x08\x02\x20\x41\x8a\xd2\xc8\x0e\x0f\xa9\x78\x28\xa0\xd1\xdd\x68\x34\x7e\xdd\xf8\xf7\xf9\x11\x42\x33\x49\x64\x04\xb3\xd7\x68\x76\x86\xfe\x76\xf9\xfe\x1f\xe8\x32\xd8\x40\x8c\xd1\x8a\x71\x74\x79\x8b\xd7\x6b\xe0\xe8\xd5\xfc\x25\x3a\xbb\x38\x9f\xcf\x9e\xab\x0a\x24\x54\xa5\x37\x52\x26\xaf\x17\x0b\x91\x17\x99\x13\xb6\xb8\x79\xb5\x10\x59\xdd\xf9\xef\x82\xd1\x6f\xf2\xc2\x8f\xf3\x4f\xb5\x1a\xea\xc7\x17\x45\x41\xc6\xd7\x8b\x90\xe3\x95\x7c\xf1\xf2\x7f\x8b\xca\x45\x3d\xb9\x4d\x32\xa6\xd8\xf2\x77\x08\x64\xfe\x8d\xc3\x9f\x29\xe1\xa0\x9a\xff\xed\x11\x42\x08\xcd\x8a\xd6\xb3\x9f\x15\x67\x74\xc5\xca\x7f\x27\x58\x6e\xc4\xec\x11\x42\xd7\x59\x5d\x1c\x86\x44\x12\x46\x71\x74\xc1\x59\x02\x5c\x12\x10\xb3\xd7\x68\x85\x23\x01\x59\x81\x04\x4b\x09\x9c\x6a\xbf\x7e\xce\x49\x7d\xba\x7b\x51\xfd\xa1\x44\xe2\xb0\x52\xac\x7d\xb3\x08\x61\x45\x68\x46\x56\x2c\x6e\x80\x86\x8c\xbf\xbd\x93\x40\x05\x61\x74\x96\x95\xbe\x7f\x84\xd0\x7d\x4e\xde\x42\xb7\xe4\xbe\x46\xbb\x14\x5b\x48\x4e\xe8\xba\x90\x05\xa1\x19\xd0\x34\xae\xc4\xce\xbe\xbc\x9a\xbf\x9c\x15\x7f\x5d\x57\xc5\x42\x10\x01\x27\x89\xe2\x48\x51\xb9\xda\x40\xd5\x87\x37\xc0\x15\x5f\x88\xad\x90\xdc\x10\x81\x42\x16\xa4\x31\x50\x39\x2f\x38\xad\xab\xb0\x53\xd8\xac\x94\x56\x6f\xc3\x84\xf4\x11\xa4\x50\xb3\xfa\xe9\xd3\x6f\x9f\x3e\xdf\x2f\xd0\xeb\x8f\x1f\x3f\x7e\xbc\xfe\xf6\xe9\xf7\xaf\x5f\x7f\xfc\x18\x7e\xfb\xec\xfb\xc7\xb3\x36\x79\x54\x43\xe8\x29\xc5\x31\x20\xc6\x11\x49\x9e\xe5\x12\x41\x66\xa0\xe8\xed\x1d\x8e\x93\x08\x5e\xa3\x27\x3b\xc3\x7c\xa2\x73\xba\xc4\x02\x2e\xb0\xdc\xf4\xe5\x76\xd1\xca\x96\xa2\x8a\x94\xcd\x21\xc9\x6c\xec\x2c\x70\x42\x9e\x34\x74\x9d\x19\x7c\xcd\x20\x9c\xea\x2e\x0a\xfe\x42\x84\xd4\x29\x04\x8c\x8a\xb4\x41\xa2\xc1\xdc\x19\x8a\x88\x90\x4a\x49\xef\xce\xdf\xbd\x45\x4a\x52\x81\x70\x10\x40\x22\x21\x44\xcb\x6d\xc5\xec\x4e\x3c\x1c\x45\xef\x57\x9a\xb5\x7d\xae\xfe\xe5\xe4\x31\x86\x90\xe0\xab\x6d\x02\x3b\x2e\xcb\x11\x90\xd9\xa8\xc6\x77\xc2\x59\x98\x06\xfd\xf9\x2e\x78\x45\x01\xa6\xa8\xa0\x71\x5c\xbe\x33\xa7\xd2\xd9\x5f\x95\xef\xd9\xd5\xac\xfd\xdc\x5d\xbf\x5e\xb8\xd1\x3e\xc7\x31\x48\xe0\x5e\x4c\x14\x65\xdf\xb8\xa8\x71\x10\x09\xa3\xc2\xc7\x02\xcb\xa2\x4e\x5a\x02\x82\x94\x13\xb9\xf5\x30\xe6\xb2\xa4\xb5\xfe\x9b\x3e\x7a\xb2\x55\xd2\xa8\x4a\xbc\x16\xb6\x71\x8e\x39\xc7\xdb\x9d\xe1\x10\x09\x71\xbd\x9c\xb3\x41\x89\xd7\xa5\x89\xdc\x57\xb5\x53\x4a\xfe\x4c\xe1\xbc\xa0\x21\x79\x0a\x1a\x0f\x70\xa7\x5c\x08\x8e\xde\xb0\xc0\x43\x24\xad\x74\x63\x0e\xb1\xd9\x90\xe1\xb0\x2d\x13\xa7\x6d\x78\xfd\x04\x14\x38\x8e\x90\xaa\xce\x63\xac\x3e\x23\xbc\x64\xa9\xb4\xf8\x03\x63\xde\xcd\xbe\x16\x13\x4a\x55\xac\x82\x12\xc6\xac\xd4\x35\xf7\x22\xd4\x3a\xff\x22\x73\x0e\x6e\x51\xa0\x75\x1e\xae\x8f\xe8\x5d\xc7\x59\xe6\xe4\x9a\x18\x8d\xd6\x1c\x53\x84\x4d\xb7\x67\x28\x37\x09\x84\x69\x88\x12\x0e\x01\x11\x80\x32\xa2\xf5\xb9\xaa\xc6\xd9\x73\x53\xab\xfb\xb4\x2e\x20\xc6\x54\x92\xa0\x9a\xf3\x69\x1a\x2f\x81\x77\x37\xae\x53\x1a\xce\x40\xc4\xa8\x82\x1c\xb5\xef\xda\x24\x7d\xb9\x61\x69\x14\xa2\x25\xa0\x90\xac\x56\xc0\x81\x4a\xb4\xe2\x2c\xce\x4a\x64\x7a\x9a\x23\xf4\x13\x91\x3f\xa7\x4b\xf4\x63\x84\x6f\x18\x87\x10\xbd\xc3\xfc\x8f\x90\xdd\x52\x44\x04\xc2\x51\xc4\x6e\x21\x74\x48\x21\x81\xc7\xe2\xfd\xea\x12\xf8\x0d\x09\xf6\xe9\x47\x35\xaf\x67\xc4\x14\xf7\x22\x27\x97\xe1\xe2\x76\x2d\x06\x8c\x4a\x1c\x48\x3f\x73\x2d\x0b\x5b\x29\x45\x24\x00\x2a\x0c\x11\xec\x94\xca\xc2\xa6\xc1\x37\x21\x43\x83\x3b\x5f\x97\xf1\x43\x5e\x53\x73\x19\xa5\x36\xd8\x2d\x05\x2e\x34\x0b\xeb\x39\xfc\x1d\x63\x51\x01\xbd\x3d\xbb\x90\x84\x40\x25\x59\x6d\x09\x5d\xa3\x1c\x37\xe6\x5c\x16\x9a\x40\x09\x70\xc1\xe8\x82\xf1\x35\xa6\xe4\xdf\x99\x5c\x8e\x9e\x4d\x79\xb4\x27\x2f\xbf\x7e\xf8\x05\x25\x8c\x50\xa9\x98\x29\x90\x62\x60\xea\x75\xae\x13\xca\xbf\x2b\x1a\x29\x27\x76\xd6\x20\xc6\x64\x5f\xe6\x32\x1a\x08\x87\x21\x07\x21\xbc\xb4\xe4\xe0\x32\x67\xa6\xcd\xf3\x1e\xcd\xd9\x6b\xb6\x6f\x8e\x27\xa7\xed\xdb\xe7\xbc\xcc\x1a\x07\xce\x6f\x87\x33\xf0\xba\x51\x17\x22\x66\x78\x79\x8e\xce\xe5\x13\x81\x80\x06\x2c\xe5\x78\x0d\xa1\xb2\xb8\x54\xa8\x79\x09\xbd\xbf\x3c\x47\x01\x8b\x13\x2c\xc9\x32\xaa\xaa\x1d\xd5\xee\xab\x36\xbd\x6c\xfd\x54\x6c\xc8\x08\x01\x3c\xbd\xe7\x07\x88\xb0\x24\x37\x79\x90\x28\x4a\x1d\x10\x1a\x92\x1b\x12\xa6\x38\x42\x40\xc3\x4c\x43\x62\x8e\xae\x36\xb0\x45\x71\x2a\xa4\x9a\x23\x79\x59\xb1\xa8\xf2\xa4\x0c\x60\x9f\xcc\x8d\x40\xf5\x80\xca\xa8\x99\xc3\xa7\x85\x1f\x31\x25\xa9\x82\xc5\x6d\xbd\xd8\x36\x76\x7c\x02\x28\x97\xf6\x1d\x74\x3b\x11\x7e\x91\xae\x32\xf8\x6c\xf4\xe6\x7b\x9a\xa5\x1f\x62\xc6\x21\xcf\x9a\xe5\xed\x8b\x02\xf3\x2c\x33\x33\xdf\x00\xca\xc9\x09\xb4\x04\xf5\xa5\x08\xd7\xc3\x02\x18\x66\xf1\xab\x1e\x83\x37\x4c\xcd\x12\xc1\x1d\x50\xf6\xaa\xbd\xfe\xe2\x73\x48\x38\x08\xa0\x32\x9b\x18\x44\x86\x0b\x6a\xc1\xaa\x26\x96\x2d\x96\x3c\xa0\x54\x65\x73\xe3\x08\xb5\x8b\x99\xbd\x82\xbc\x9e\xc2\xe8\x53\x46\x83\x3f\x33\x54\x2b\x5b\xad\x92\x79\xd9\x8f\x5d\x93\x98\xf2\xe6\xc6\x1c\xe6\x9a\x9e\xfc\x43\x82\x31\x66\x8e\x53\x77\xfe\x90\xe7\xf3\xf6\xe9\x62\x23\x3f\x10\x93\x18\xae\x72\x1a\x9d\xf9\x48\xcb\xcc\x5a\x65\xc7\x4a\x04\xf0\xf3\xd5\xd5\x05\x8a\x41\x08\xbc\x86\x86\x43\x51\x6c\xe0\x46\x57\xf6\x44\x40\x0d\xfb\xff\xa2\xc3\x7c\x3d\x39\x84\xdc\x09\x22\x64\x4f\x12\xd9\xba\xaa\xf6\xe3\xbd\x56\xdd\x91\x25\x6a\x14\x9c\x89\x34\x8e\x31\xdf\xee\x15\x7e\x2f\x39\x81\x15\x2a\x28\x95\x66\x51\xf5\xfd\x83\xc5\xfe\x15\x07\xcf\xf7\x08\xee\x1d\x8e\xb6\xc5\x52\xcc\x8c\x5a\x93\x66\xc5\xd8\x79\x38\x46\xd6\xa7\x88\x37\xc9\x2e\xe3\xd2\xa5\x7b\x4b\x3a\xdc\xa1\xdc\x9e\x29\xf1\x8c\x8a\x99\x16\x47\x8d\xd4\x78\x8b\xf6\x1c\xe9\x71\x54\x1b\x69\xa8\x4a\x93\x37\xe5\xb2\x2c\x4f\x0c\x92\xab\xa0\x73\x32\x72\x59\xd3\xf0\x2d\x8d\xed\xca\x37\x16\x19\x9e\xdb\x1c\xab\x17\x49\xc3\x0f\x37\xdc\x88\xb1\xb4\xd4\x42\xcb\x58\x5e\x6a\x52\x0b\x15\x10\x0a\xb0\x04\xe7\xf8\x58\x32\x16\x01\xa6\xcd\x01\xb2\xc2\x69\x24\x35\x38\x6f\x30\x6a\xae\x1b\xb4\x71\xaa\xad\x1d\xa0\xd6\x20\x2d\x8b\x3c\xc6\x82\x62\x27\x34\x6d\x15\x84\x7b\x43\xb1\x35\x78\xa6\x24\x77\x28\xc1\x6e\xfc\xe9\x48\x74\xf4\x15\xe3\xe1\x84\x42\x88\x40\x7a\x26\x49\x3b\x48\xb1\xa4\x19\x8e\x0c\xa7\xb5\x01\x6c\x0c\x97\x61\x8a\xc2\x32\xd8\x8c\x44\x69\x24\xbf\x65\x1d\x74\xd6\xe5\x44\xef\xec\x48\x5e\xb7\x8a\xa3\x29\x8e\x41\x64\xce\x1f\x88\xdc\x00\x47\x4b\x40\x98\x6e\xd1\x0d\x8e\x48\x98\x63\x5c\x21\xb1\x4c\x05\x0a\x58\x98\xc5\x6d\x4f\x0a\x77\x53\x4f\x8b\xc4\x44\x1f\xb2\xdf\x8d\x3b\xea\x9f\xfe\xf6\xf2\xc5\xff\x5d\x7f\xfe\x9f\xfb\x67\x8f\xff\xf3\xe9\x69\xd1\xfe\xb3\xc7\xfd\x3c\xf8\x3f\x71\x94\x82\x23\xd1\x72\x00\xb7\x42\x99\x6c\xc0\x60\x7b\x0f\x79\xea\xa8\x53\x4b\x56\x31\xfa\x0b\x52\x9f\x96\xdb\xcd\x2f\xd7\x67\xcd\x04\x19\x85\xfe\xdb\x02\x9a\x59\x03\xad\x63\x3c\xea\xff\x2e\x18\xfd\x00\xd9\xe2\x56\x60\x59\x93\xb9\xb6\xb2\x3e\x3c\x2c\xab\x0f\xa7\xb2\x89\x43\xc7\xf6\xd5\xce\x2e\xad\xa6\xa9\xed\xa6\xc6\x5a\xb4\xa6\x67\xdf\x8c\x26\x7b\x50\x5a\x91\x08\x2e\x6d\xd4\x3a\xc1\x9d\xf2\xdb\xde\x1e\xb2\x2c\x6c\xa5\x64\xc9\x16\xb4\x90\xaa\x4a\xb7\x0c\xde\x13\xc3\x2a\x9a\x11\x9b\x7a\x1b\x3d\x95\x97\x37\x31\x6b\x69\x7e\x34\xc0\x67\x1f\x66\x19\x49\xef\xf1\x25\xf5\xac\x0e\xea\x0a\x28\x8d\x4d\x7e\xd9\x57\x4b\x49\xe5\xc6\xb3\x25\xfd\xe6\x57\x42\x25\xac\xcd\xcf\x36\x74\x8e\xca\x24\x47\xe7\x80\xa8\x92\x72\xbd\x3d\x84\x2d\x65\xe2\x82\x1a\x9c\xc4\x44\x92\x1b\x10\x79\x8a\xc4\x4a\x2f\x60\x51\x04\x81\xaa\xf0\xa3\x95\x27\xd7\x12\x7b\xa3\x96\x03\x45\x96\xc1\x8a\x07\xc9\xb2\xb0\x95\x52\x8c\xef\x48\x9c\xc6\x7e\x94\xca\xc2\x0e\x07\x12\x44\xa9\x20\x37\xf0\xae\x0f\x49\xa3\x96\x9d\x4b\x42\x7b\x70\x59\x14\xee\xe0\xb2\x0f\x49\xa3\x96\x4b\x97\xbf\x00\x5d\x4b\x4f\xfc\xbb\x2b\xee\x92\xb9\x17\xb5\xaa\xb8\x0b\x97\x17\x9b\x43\xfd\xd6\xc2\xb2\xc2\x2e\x29\xcf\xfd\x87\x4a\x55\xda\x25\x63\x1f\x5a\x65\x69\x2b\x2d\x3d\x67\xe9\x41\xae\x5e\xc1\x6e\x2b\xd4\xdb\x3e\xa8\xd3\x26\xd2\x48\x92\x24\xca\x61\x86\x8f\x8c\xbb\xf2\x8e\x91\xdf\x1f\x06\x19\x33\xf3\x03\x4d\xba\xcd\xe2\x2d\xfb\x69\xe9\x16\x15\x13\xd5\x56\x85\x4e\x3c\x5b\x8a\xbf\x25\x72\x83\xee\x5e\x20\x22\xf2\xc8\xaa\x7b\xdb\x8e\xe4\x29\x58\xca\x38\xb7\x3f\x2e\x59\xb8\xbd\xa8\x16\x16\xf7\xdb\x79\x51\x9f\x5a\xb4\x8d\x87\x3a\x6e\xbc\x3e\xc5\xb4\xcd\x58\xf9\xf5\x3c\xb9\x6f\x49\xaf\x57\xc1\xfa\x1c\x5d\x6d\x88\x8a\x8b\xd3\x28\xcc\xb7\xef\x10\x8a\x4a\x74\xa9\x4a\xa7\x62\xbf\x0d\x76\x23\x6f\x59\xd9\x31\xee\x40\x11\xfb\x28\xec\x8d\x22\x1c\x13\x5a\x64\x94\x23\x16\x60\xbb\xd2\x7c\xa0\x98\xb2\xe5\x6e\xbc\x54\x33\xe0\x3e\xb9\x52\x17\xdb\xb7\x1b\xc8\x12\x20\x8c\x23\xca\x64\x7e\x78\xa3\x62\x5b\x75\x56\xd9\x9e\x2a\x91\x27\xb0\x70\x34\x1f\x90\x89\xb5\x86\x73\x7e\x71\xda\x1e\xfb\x3a\x72\xdc\x5e\x79\x88\xcb\x74\x79\xd9\x64\xe4\xd4\xc2\x9e\xce\xb1\xfe\x85\x5a\xc0\xe9\x0c\x34\x3d\xd0\x43\xce\xa1\x36\x39\xd5\xa1\x4e\xf5\xf8\xb1\xa9\x23\x08\x75\x84\xac\x53\x6c\x3a\xc5\xa6\x53\x6c\x3a\xc5\xa6\x7f\xc5\xd8\xf4\x51\xfd\xff\x25\x4e\xfa\x33\x05\xbe\x9d\x60\xd2\x04\x93\x6a\x5f\x33\x9b\x98\x50\xd2\xe1\x50\x52\xc6\xcc\xdb\x38\x91\xdb\xe6\xaa\xa2\x8f\xa1\x6a\xa6\xd4\xc6\x56\xd6\x8c\x40\x02\x68\x48\xe8\x1a\xe1\x9a\xd9\x2e\xb7\x05\xc3\x34\xda\x2a\xbb\xcd\x12\x36\x98\x22\x50\x4c\xa1\x1b\xc5\xd5\x84\xf0\xbe\x24\x84\xf7\x2f\x22\x37\xef\x94\xd7\x9f\xa0\xde\x04\xf5\x26\xa8\x37\x41\x3d\x64\x40\x3d\xe5\xf2\xde\x60\x89\x27\xb4\x37\xa1\xbd\xda\xd7\xd2\x2c\x26\xc0\x37\x01\x3e\x1b\xef\x5f\x06\xe0\x6b\x7c\x5c\x91\x08\x26\x10\x38\x81\xc0\x09\x04\x76\x4a\x3d\x81\xc0\xbf\x12\x08\x4c\xb0\xdc\x7c\x99\x00\xd0\x75\x70\xb4\xf8\x5a\x7c\xea\xde\x3e\x39\x08\x30\x5a\x27\x35\xed\xb4\x65\xad\x69\x74\x10\x88\x79\xe2\x30\x52\x19\xd6\x04\x21\xa7\x95\xd5\x0e\x03\xf8\xda\x20\xd7\x84\xb4\x26\xa4\x35\x21\xad\x09\x69\x21\x03\x69\x51\x46\xff\xff\x18\x9b\x54\xed\x87\x47\x06\x9d\x4e\x73\x6e\x9a\xb3\xa9\xce\x83\x5e\x4b\xc6\x71\x20\x45\xd7\x72\xf5\x40\x72\x0e\x34\x6c\xf4\x6c\xf3\xba\x5e\x4b\x97\x0e\x52\xb8\xbe\x8b\x79\xa0\x10\x86\xa1\x75\xb0\x6f\xec\xc8\xf4\x3d\x4d\x7b\x86\xc2\x02\x31\x12\x51\xbf\x07\x94\xad\x10\xd6\x2e\x79\xcf\xe9\x1c\xf5\x1e\x31\x23\x5c\x18\xfb\x9c\xfb\x70\xe0\x62\xbd\xf7\xb5\x94\xcf\xf3\xf6\xfa\xc5\x4e\x9c\x85\x76\x1d\xae\x37\xbc\xde\xa3\x41\xcb\x29\xd0\x5e\x70\x67\x50\x93\x6d\x98\xa8\xd3\x67\x0f\x68\xb1\xeb\x38\x47\x07\x10\x1b\xd2\xe2\x18\x68\x6d\x40\xbb\xa3\x40\xba\x21\xf2\x8e\x81\xfb\xf6\x92\x77\x2f\x70\xe8\xdb\xb2\x36\xbf\x30\x91\xc5\x21\xe7\x45\xcc\x34\x0c\x48\x8e\xd0\xf2\x9b\x7c\x3c\xbd\x1c\x04\x3e\x07\xe8\x7c\x2f\x84\x7a\x48\x4d\x1f\xba\xe1\x76\x45\x7b\x60\xe0\x01\xca\xee\x04\xca\x31\xbe\x73\x5f\xa3\x70\x0c\xad\x1f\xa5\xf5\x76\xd5\xbb\xd2\x7e\xfb\x30\x90\xcf\xfa\x67\x7a\xe6\xc3\x37\x42\x19\xe2\xc9\x9c\x61\x4c\xe7\xd1\x77\x55\x86\x6e\x8f\x7b\x85\x42\x33\xa3\xaa\x57\xae\xfd\xd5\xcc\x9c\x56\x68\xe2\xde\x0e\xa8\x2c\xa9\xb0\x7d\xf0\x54\x2d\x80\xf2\x48\x39\x3d\x98\x1a\x6d\x0b\x9d\xba\x53\xfb\xce\xf8\xd1\x7e\xbb\x60\x4f\x06\xf5\xce\xda\xab\xeb\xca\xcb\xd5\xac\x20\xda\x72\x3b\xa2\x4b\x38\xd7\xb5\x89\xbe\x42\xd9\xb9\x73\xc4\x0c\x6d\xb7\xd9\xf8\x8d\xbd\x3e\x9c\xf5\x53\x68\x48\x14\x36\x8f\x09\xc5\x92\xf1\x21\xd1\x09\x07\x1c\xbe\xa7\x91\xf3\x6a\xc8\xc1\x57\xb0\xdd\xc5\xc6\x1d\xad\x76\x1d\xa8\x82\x0e\x4c\x38\xfe\xa5\x8c\xc5\x0a\x40\x5d\xa1\xbb\x98\xd1\xfb\x74\x61\xed\x1a\x98\xaf\x3c\x8c\x1e\xe3\xc2\x92\x29\x74\x3e\x99\xd0\xf9\x41\x50\xd0\x38\x4b\x57\x7e\x5b\x7a\x0e\xe6\xce\x4e\xd7\x19\x35\x57\xbb\x3c\x3c\xd2\x5e\x4f\x4b\x4c\xf7\x0f\x4d\x2b\x91\x5d\x94\xa6\x95\xc8\x69\x25\x72\x5a\x89\x7c\xb8\x95\xc8\x07\x80\x8c\xda\x9c\x64\x7b\xb7\x71\xdf\x57\x12\x4b\x9a\x1f\x72\x0c\x13\x03\xad\x3c\xd5\x4e\xde\x8e\x57\x13\x6d\x34\x86\xcf\x97\xe6\xa4\x68\xc4\xb0\xf6\xc9\xc2\xeb\x8d\x0b\xd7\xcd\xfe\xba\xa6\xf5\x30\xeb\x30\x33\xbe\xc7\x56\x27\xab\x08\xd9\x6d\xbb\x09\xee\x7c\x2d\xcf\xee\x87\x38\xac\xc8\xdd\x90\x9a\x58\x4a\x4e\x96\xa9\x79\x79\xf3\xde\x20\xf0\x96\xe3\x24\x19\xeb\xba\xf2\x53\x19\xab\x12\xaf\x47\xb3\xa0\x3e\xef\x9b\x8d\x6d\x6d\x7b\xde\x3b\x3b\x1a\xc0\x3f\x95\x7e\xed\x78\xfb\x76\xb8\xaf\xb3\xdd\xc5\xeb\x95\xed\x5a\x62\x41\x82\xb3\x54\x6e\x80\x4a\x92\x6f\x36\xbd\x34\xae\xde\x6f\xa4\xc0\xbc\x08\xe3\x84\xfc\x1d\xb6\xe3\xd0\x62\x38\x95\x9b\x57\xe7\x71\x12\x91\x80\xc8\x31\x69\x5e\x60\x21\x6e\x19\x0f\xc7\xa4\x79\x96\x28\x3e\x47\x54\x65\x41\x36\x08\x40\x88\x1f\x58\x08\x56\xaa\xd5\xbf\xaf\xad\x96\xd7\xd6\xcf\x87\xf5\x34\x0f\x71\x93\x6e\x26\xed\x98\x5b\x9f\x4f\xcf\x95\x34\xc6\xd7\x11\xfa\xb0\x81\x22\x1a\xdb\xdf\x8e\xdc\xc3\xb9\xf8\xdd\x5d\x3c\x74\xe6\xea\xb7\x8b\xbf\xf5\x6e\xb3\x46\x2e\x64\xf4\xab\x3c\x4e\xcf\x36\x1d\xfe\xfa\xb8\x36\xba\x8a\xd8\xad\xf6\xc6\x41\x2a\x37\x8c\x17\x0f\xda\xfe\xda\xe7\x65\xbc\x71\x2c\x36\x57\x8a\x47\x12\x4c\xf1\xbd\x77\x6b\xa4\x50\x7e\x77\x7b\x22\x60\x89\xef\xcd\xf5\xb9\x0c\x97\x79\x0d\x2b\x35\x43\xcb\x3d\x24\xf1\x78\xfc\xf8\xcb\x1f\x15\x06\xe2\x78\xd8\x51\x21\xd9\x1f\xf0\xf5\x8f\x86\xa4\x50\xfa\xb1\x47\x43\xa5\xdd\x69\x14\xe8\xa3\xc0\x86\x91\xa7\x81\x50\xb4\x7c\xc0\x81\x80\x77\x7a\x9f\xc6\xc2\xa9\x8c\x05\x33\xb0\x3b\x31\xa4\xf4\xd7\x1b\x26\x55\x97\x7c\x65\xf8\x69\x1a\x84\x8e\x41\x78\xd9\xec\xc5\x11\x16\x1e\x74\x91\xf5\x56\xf5\x57\x49\x47\x5c\x92\xa9\x1e\x99\x36\xf4\xdb\xb1\x0e\xd3\x78\x02\xb0\x9b\x25\xcb\xe9\xe9\x1d\x0d\x44\x01\x42\x08\x91\x64\xd9\xdd\x37\x08\x17\xef\xf9\xe5\x0f\xbd\x46\x91\xf5\xf9\x89\x92\x37\xdd\x89\x59\x44\x1f\x9c\xee\x34\x1e\xbe\x47\x83\x32\x72\x8e\x37\xdf\xac\x69\x38\xef\x75\xb0\xda\xdb\xac\x83\x94\x2f\x39\xa6\x62\x05\x1c\x25\x9c\x49\x16\xb0\xa8\x3c\xc7\x7e\x76\x71\x3e\x6f\xb5\x24\xe7\xe8\xb7\xb9\xc7\x6c\x43\x92\xee\x21\xd4\x17\xa1\x7f\xba\x35\xfe\xae\x39\xbc\xde\xba\x69\xd9\x8e\xe1\x62\xde\x64\x7d\x16\x88\x1b\xed\x29\x11\xfd\x4f\xa9\xff\x99\x90\xc4\xf6\xf4\xf9\x6e\xe9\x28\x23\xd7\xca\xe5\xee\xee\x9f\x63\xb1\x5b\xfb\x10\xd7\x2f\x1d\xf2\xe3\xbf\xb9\xb5\x6f\xa4\x6d\x7d\x25\x79\xfb\x24\x31\xea\x56\xbe\x5d\x53\xcd\x2d\x36\xa3\x6d\xdf\xab\x1c\xb8\x6d\x6f\xc0\x98\xa7\xdd\xaa\x86\x8c\x1d\x39\xa3\x9d\x70\x2b\x9b\x68\xd9\xfd\x33\xfe\xa9\xb6\x4a\x2e\x63\x0f\xcf\x68\x27\xd9\x4c\xb9\x46\x6d\xcb\xbe\xa1\xa8\xd6\x5f\xc6\xd6\x9f\xf1\x4f\xf4\xd4\xb4\x78\xd0\xd6\xf4\x13\x3c\x3b\xac\xd0\xdc\x90\x34\xda\xc9\xb4\x9a\x1a\x8d\xbd\x93\x87\xd4\xe2\x21\x1b\xb3\x2b\xd1\xbe\xe7\x69\xd4\x53\x67\xd5\x40\xa0\xe3\x19\x3f\x6d\x1a\xbc\x0e\x86\x3c\x10\xb4\x3d\x2a\xcd\x78\x32\xe6\xab\xbd\x36\xc9\xf4\x3a\x58\xae\xc3\xf4\x47\xea\xbf\xfb\x47\xff\x0d\x00\x00\xff\xff\xd2\x32\x5a\x28\x38\x9d\x00\x00") - -func v2SchemaJsonBytes() ([]byte, error) { - return bindataRead( - _v2SchemaJson, - "v2/schema.json", - ) -} - -func v2SchemaJson() (*asset, error) { - bytes, err := v2SchemaJsonBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "v2/schema.json", size: 40248, mode: os.FileMode(0640), modTime: time.Unix(1568964748, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x88, 0x5e, 0xf, 0xbf, 0x17, 0x74, 0x0, 0xb2, 0x5a, 0x7f, 0xbc, 0x58, 0xcd, 0xc, 0x25, 0x73, 0xd5, 0x29, 0x1c, 0x7a, 0xd0, 0xce, 0x79, 0xd4, 0x89, 0x31, 0x27, 0x90, 0xf2, 0xff, 0xe6}} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// AssetString returns the asset contents as a string (instead of a []byte). -func AssetString(name string) (string, error) { - data, err := Asset(name) - return string(data), err -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// MustAssetString is like AssetString but panics when Asset would return an -// error. It simplifies safe initialization of global variables. -func MustAssetString(name string) string { - return string(MustAsset(name)) -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetDigest returns the digest of the file with the given name. It returns an -// error if the asset could not be found or the digest could not be loaded. -func AssetDigest(name string) ([sha256.Size]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) - } - return a.digest, nil - } - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) -} - -// Digests returns a map of all known files and their checksums. -func Digests() (map[string][sha256.Size]byte, error) { - mp := make(map[string][sha256.Size]byte, len(_bindata)) - for name := range _bindata { - a, err := _bindata[name]() - if err != nil { - return nil, err - } - mp[name] = a.digest - } - return mp, nil -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "jsonschema-draft-04.json": jsonschemaDraft04Json, - - "v2/schema.json": v2SchemaJson, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"}, -// AssetDir("data/img") would return []string{"a.png", "b.png"}, -// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "jsonschema-draft-04.json": {jsonschemaDraft04Json, map[string]*bintree{}}, - "v2": {nil, map[string]*bintree{ - "schema.json": {v2SchemaJson, map[string]*bintree{}}, - }}, -}} - -// RestoreAsset restores an asset under the given directory. -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) -} - -// RestoreAssets restores an asset under the given directory recursively. -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) -} diff --git a/vendor/github.com/go-openapi/spec/cache.go b/vendor/github.com/go-openapi/spec/cache.go deleted file mode 100644 index 122993b44b..0000000000 --- a/vendor/github.com/go-openapi/spec/cache.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "sync" -) - -// ResolutionCache a cache for resolving urls -type ResolutionCache interface { - Get(string) (interface{}, bool) - Set(string, interface{}) -} - -type simpleCache struct { - lock sync.RWMutex - store map[string]interface{} -} - -func (s *simpleCache) ShallowClone() ResolutionCache { - store := make(map[string]interface{}, len(s.store)) - s.lock.RLock() - for k, v := range s.store { - store[k] = v - } - s.lock.RUnlock() - - return &simpleCache{ - store: store, - } -} - -// Get retrieves a cached URI -func (s *simpleCache) Get(uri string) (interface{}, bool) { - s.lock.RLock() - v, ok := s.store[uri] - - s.lock.RUnlock() - return v, ok -} - -// Set caches a URI -func (s *simpleCache) Set(uri string, data interface{}) { - s.lock.Lock() - s.store[uri] = data - s.lock.Unlock() -} - -var ( - // resCache is a package level cache for $ref resolution and expansion. - // It is initialized lazily by methods that have the need for it: no - // memory is allocated unless some expander methods are called. - // - // It is initialized with JSON schema and swagger schema, - // which do not mutate during normal operations. - // - // All subsequent utilizations of this cache are produced from a shallow - // clone of this initial version. - resCache *simpleCache - onceCache sync.Once - - _ ResolutionCache = &simpleCache{} -) - -// initResolutionCache initializes the URI resolution cache. To be wrapped in a sync.Once.Do call. -func initResolutionCache() { - resCache = defaultResolutionCache() -} - -func defaultResolutionCache() *simpleCache { - return &simpleCache{store: map[string]interface{}{ - "http://swagger.io/v2/schema.json": MustLoadSwagger20Schema(), - "http://json-schema.org/draft-04/schema": MustLoadJSONSchemaDraft04(), - }} -} - -func cacheOrDefault(cache ResolutionCache) ResolutionCache { - onceCache.Do(initResolutionCache) - - if cache != nil { - return cache - } - - // get a shallow clone of the base cache with swagger and json schema - return resCache.ShallowClone() -} diff --git a/vendor/github.com/go-openapi/spec/contact_info.go b/vendor/github.com/go-openapi/spec/contact_info.go deleted file mode 100644 index 2f7bb219b5..0000000000 --- a/vendor/github.com/go-openapi/spec/contact_info.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// ContactInfo contact information for the exposed API. -// -// For more information: http://goo.gl/8us55a#contactObject -type ContactInfo struct { - ContactInfoProps - VendorExtensible -} - -// ContactInfoProps hold the properties of a ContactInfo object -type ContactInfoProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - Email string `json:"email,omitempty"` -} - -// UnmarshalJSON hydrates ContactInfo from json -func (c *ContactInfo) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &c.ContactInfoProps); err != nil { - return err - } - return json.Unmarshal(data, &c.VendorExtensible) -} - -// MarshalJSON produces ContactInfo as json -func (c ContactInfo) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(c.ContactInfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(c.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/debug.go b/vendor/github.com/go-openapi/spec/debug.go deleted file mode 100644 index fc889f6d0b..0000000000 --- a/vendor/github.com/go-openapi/spec/debug.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "fmt" - "log" - "os" - "path" - "runtime" -) - -// Debug is true when the SWAGGER_DEBUG env var is not empty. -// -// It enables a more verbose logging of this package. -var Debug = os.Getenv("SWAGGER_DEBUG") != "" - -var ( - // specLogger is a debug logger for this package - specLogger *log.Logger -) - -func init() { - debugOptions() -} - -func debugOptions() { - specLogger = log.New(os.Stdout, "spec:", log.LstdFlags) -} - -func debugLog(msg string, args ...interface{}) { - // A private, trivial trace logger, based on go-openapi/spec/expander.go:debugLog() - if Debug { - _, file1, pos1, _ := runtime.Caller(1) - specLogger.Printf("%s:%d: %s", path.Base(file1), pos1, fmt.Sprintf(msg, args...)) - } -} diff --git a/vendor/github.com/go-openapi/spec/errors.go b/vendor/github.com/go-openapi/spec/errors.go deleted file mode 100644 index 6992c7ba73..0000000000 --- a/vendor/github.com/go-openapi/spec/errors.go +++ /dev/null @@ -1,19 +0,0 @@ -package spec - -import "errors" - -// Error codes -var ( - // ErrUnknownTypeForReference indicates that a resolved reference was found in an unsupported container type - ErrUnknownTypeForReference = errors.New("unknown type for the resolved reference") - - // ErrResolveRefNeedsAPointer indicates that a $ref target must be a valid JSON pointer - ErrResolveRefNeedsAPointer = errors.New("resolve ref: target needs to be a pointer") - - // ErrDerefUnsupportedType indicates that a resolved reference was found in an unsupported container type. - // At the moment, $ref are supported only inside: schemas, parameters, responses, path items - ErrDerefUnsupportedType = errors.New("deref: unsupported type") - - // ErrExpandUnsupportedType indicates that $ref expansion is attempted on some invalid type - ErrExpandUnsupportedType = errors.New("expand: unsupported type. Input should be of type *Parameter or *Response") -) diff --git a/vendor/github.com/go-openapi/spec/expander.go b/vendor/github.com/go-openapi/spec/expander.go deleted file mode 100644 index d4ea889d44..0000000000 --- a/vendor/github.com/go-openapi/spec/expander.go +++ /dev/null @@ -1,594 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" -) - -// ExpandOptions provides options for the spec expander. -// -// RelativeBase is the path to the root document. This can be a remote URL or a path to a local file. -// -// If left empty, the root document is assumed to be located in the current working directory: -// all relative $ref's will be resolved from there. -// -// PathLoader injects a document loading method. By default, this resolves to the function provided by the SpecLoader package variable. -// -type ExpandOptions struct { - RelativeBase string // the path to the root document to expand. This is a file, not a directory - SkipSchemas bool // do not expand schemas, just paths, parameters and responses - ContinueOnError bool // continue expanding even after and error is found - PathLoader func(string) (json.RawMessage, error) `json:"-"` // the document loading method that takes a path as input and yields a json document - AbsoluteCircularRef bool // circular $ref remaining after expansion remain absolute URLs -} - -func optionsOrDefault(opts *ExpandOptions) *ExpandOptions { - if opts != nil { - clone := *opts // shallow clone to avoid internal changes to be propagated to the caller - if clone.RelativeBase != "" { - clone.RelativeBase = normalizeBase(clone.RelativeBase) - } - // if the relative base is empty, let the schema loader choose a pseudo root document - return &clone - } - return &ExpandOptions{} -} - -// ExpandSpec expands the references in a swagger spec -func ExpandSpec(spec *Swagger, options *ExpandOptions) error { - options = optionsOrDefault(options) - resolver := defaultSchemaLoader(spec, options, nil, nil) - - specBasePath := options.RelativeBase - - if !options.SkipSchemas { - for key, definition := range spec.Definitions { - parentRefs := make([]string, 0, 10) - parentRefs = append(parentRefs, fmt.Sprintf("#/definitions/%s", key)) - - def, err := expandSchema(definition, parentRefs, resolver, specBasePath) - if resolver.shouldStopOnError(err) { - return err - } - if def != nil { - spec.Definitions[key] = *def - } - } - } - - for key := range spec.Parameters { - parameter := spec.Parameters[key] - if err := expandParameterOrResponse(¶meter, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Parameters[key] = parameter - } - - for key := range spec.Responses { - response := spec.Responses[key] - if err := expandParameterOrResponse(&response, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Responses[key] = response - } - - if spec.Paths != nil { - for key := range spec.Paths.Paths { - pth := spec.Paths.Paths[key] - if err := expandPathItem(&pth, resolver, specBasePath); resolver.shouldStopOnError(err) { - return err - } - spec.Paths.Paths[key] = pth - } - } - - return nil -} - -const rootBase = ".root" - -// baseForRoot loads in the cache the root document and produces a fake ".root" base path entry -// for further $ref resolution -// -// Setting the cache is optional and this parameter may safely be left to nil. -func baseForRoot(root interface{}, cache ResolutionCache) string { - if root == nil { - return "" - } - - // cache the root document to resolve $ref's - normalizedBase := normalizeBase(rootBase) - cache.Set(normalizedBase, root) - - return normalizedBase -} - -// ExpandSchema expands the refs in the schema object with reference to the root object. -// -// go-openapi/validate uses this function. -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandSchemaWithBasePath to resolve external references). -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandSchema(schema *Schema, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - if root == nil { - root = schema - } - - opts := &ExpandOptions{ - // when a root is specified, cache the root as an in-memory document for $ref retrieval - RelativeBase: baseForRoot(root, cache), - SkipSchemas: false, - ContinueOnError: false, - } - - return ExpandSchemaWithBasePath(schema, cache, opts) -} - -// ExpandSchemaWithBasePath expands the refs in the schema object, base path configured through expand options. -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandSchemaWithBasePath(schema *Schema, cache ResolutionCache, opts *ExpandOptions) error { - if schema == nil { - return nil - } - - cache = cacheOrDefault(cache) - - opts = optionsOrDefault(opts) - - resolver := defaultSchemaLoader(nil, opts, cache, nil) - - parentRefs := make([]string, 0, 10) - s, err := expandSchema(*schema, parentRefs, resolver, opts.RelativeBase) - if err != nil { - return err - } - if s != nil { - // guard for when continuing on error - *schema = *s - } - - return nil -} - -func expandItems(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Items == nil { - return &target, nil - } - - // array - if target.Items.Schema != nil { - t, err := expandSchema(*target.Items.Schema, parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - *target.Items.Schema = *t - } - - // tuple - for i := range target.Items.Schemas { - t, err := expandSchema(target.Items.Schemas[i], parentRefs, resolver, basePath) - if err != nil { - return nil, err - } - target.Items.Schemas[i] = *t - } - - return &target, nil -} - -func expandSchema(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - if target.Ref.String() == "" && target.Ref.IsRoot() { - newRef := normalizeRef(&target.Ref, basePath) - target.Ref = *newRef - return &target, nil - } - - // change the base path of resolution when an ID is encountered - // otherwise the basePath should inherit the parent's - if target.ID != "" { - basePath, _ = resolver.setSchemaID(target, target.ID, basePath) - } - - if target.Ref.String() != "" { - return expandSchemaRef(target, parentRefs, resolver, basePath) - } - - for k := range target.Definitions { - tt, err := expandSchema(target.Definitions[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if tt != nil { - target.Definitions[k] = *tt - } - } - - t, err := expandItems(target, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target = *t - } - - for i := range target.AllOf { - t, err := expandSchema(target.AllOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.AllOf[i] = *t - } - } - - for i := range target.AnyOf { - t, err := expandSchema(target.AnyOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.AnyOf[i] = *t - } - } - - for i := range target.OneOf { - t, err := expandSchema(target.OneOf[i], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.OneOf[i] = *t - } - } - - if target.Not != nil { - t, err := expandSchema(*target.Not, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Not = *t - } - } - - for k := range target.Properties { - t, err := expandSchema(target.Properties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.Properties[k] = *t - } - } - - if target.AdditionalProperties != nil && target.AdditionalProperties.Schema != nil { - t, err := expandSchema(*target.AdditionalProperties.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalProperties.Schema = *t - } - } - - for k := range target.PatternProperties { - t, err := expandSchema(target.PatternProperties[k], parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - target.PatternProperties[k] = *t - } - } - - for k := range target.Dependencies { - if target.Dependencies[k].Schema != nil { - t, err := expandSchema(*target.Dependencies[k].Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.Dependencies[k].Schema = *t - } - } - } - - if target.AdditionalItems != nil && target.AdditionalItems.Schema != nil { - t, err := expandSchema(*target.AdditionalItems.Schema, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return &target, err - } - if t != nil { - *target.AdditionalItems.Schema = *t - } - } - return &target, nil -} - -func expandSchemaRef(target Schema, parentRefs []string, resolver *schemaLoader, basePath string) (*Schema, error) { - // if a Ref is found, all sibling fields are skipped - // Ref also changes the resolution scope of children expandSchema - - // here the resolution scope is changed because a $ref was encountered - normalizedRef := normalizeRef(&target.Ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if resolver.isCircular(normalizedRef, basePath, parentRefs...) { - // this means there is a cycle in the recursion tree: return the Ref - // - circular refs cannot be expanded. We leave them as ref. - // - denormalization means that a new local file ref is set relative to the original basePath - debugLog("short circuit circular ref: basePath: %s, normalizedPath: %s, normalized ref: %s", - basePath, normalizedBasePath, normalizedRef.String()) - if !resolver.options.AbsoluteCircularRef { - target.Ref = denormalizeRef(normalizedRef, resolver.context.basePath, resolver.context.rootID) - } else { - target.Ref = *normalizedRef - } - return &target, nil - } - - var t *Schema - err := resolver.Resolve(&target.Ref, &t, basePath) - if resolver.shouldStopOnError(err) { - return nil, err - } - - if t == nil { - // guard for when continuing on error - return &target, nil - } - - parentRefs = append(parentRefs, normalizedRef.String()) - transitiveResolver := resolver.transitiveResolver(basePath, target.Ref) - - basePath = resolver.updateBasePath(transitiveResolver, normalizedBasePath) - - return expandSchema(*t, parentRefs, transitiveResolver, basePath) -} - -func expandPathItem(pathItem *PathItem, resolver *schemaLoader, basePath string) error { - if pathItem == nil { - return nil - } - - parentRefs := make([]string, 0, 10) - if err := resolver.deref(pathItem, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - - if pathItem.Ref.String() != "" { - transitiveResolver := resolver.transitiveResolver(basePath, pathItem.Ref) - basePath = transitiveResolver.updateBasePath(resolver, basePath) - resolver = transitiveResolver - } - - pathItem.Ref = Ref{} - for i := range pathItem.Parameters { - if err := expandParameterOrResponse(&(pathItem.Parameters[i]), resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - - ops := []*Operation{ - pathItem.Get, - pathItem.Head, - pathItem.Options, - pathItem.Put, - pathItem.Post, - pathItem.Patch, - pathItem.Delete, - } - for _, op := range ops { - if err := expandOperation(op, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - } - - return nil -} - -func expandOperation(op *Operation, resolver *schemaLoader, basePath string) error { - if op == nil { - return nil - } - - for i := range op.Parameters { - param := op.Parameters[i] - if err := expandParameterOrResponse(¶m, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - op.Parameters[i] = param - } - - if op.Responses == nil { - return nil - } - - responses := op.Responses - if err := expandParameterOrResponse(responses.Default, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - - for code := range responses.StatusCodeResponses { - response := responses.StatusCodeResponses[code] - if err := expandParameterOrResponse(&response, resolver, basePath); resolver.shouldStopOnError(err) { - return err - } - responses.StatusCodeResponses[code] = response - } - - return nil -} - -// ExpandResponseWithRoot expands a response based on a root document, not a fetchable document -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandResponse to resolve external references). -// -// Setting the cache is optional and this parameter may safely be left to nil. -func ExpandResponseWithRoot(response *Response, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - } - resolver := defaultSchemaLoader(root, opts, cache, nil) - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandResponse expands a response based on a basepath -// -// All refs inside response will be resolved relative to basePath -func ExpandResponse(response *Response, basePath string) error { - opts := optionsOrDefault(&ExpandOptions{ - RelativeBase: basePath, - }) - resolver := defaultSchemaLoader(nil, opts, nil, nil) - - return expandParameterOrResponse(response, resolver, opts.RelativeBase) -} - -// ExpandParameterWithRoot expands a parameter based on a root document, not a fetchable document. -// -// Notice that it is impossible to reference a json schema in a different document other than root -// (use ExpandParameter to resolve external references). -func ExpandParameterWithRoot(parameter *Parameter, root interface{}, cache ResolutionCache) error { - cache = cacheOrDefault(cache) - - opts := &ExpandOptions{ - RelativeBase: baseForRoot(root, cache), - } - resolver := defaultSchemaLoader(root, opts, cache, nil) - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -// ExpandParameter expands a parameter based on a basepath. -// This is the exported version of expandParameter -// all refs inside parameter will be resolved relative to basePath -func ExpandParameter(parameter *Parameter, basePath string) error { - opts := optionsOrDefault(&ExpandOptions{ - RelativeBase: basePath, - }) - resolver := defaultSchemaLoader(nil, opts, nil, nil) - - return expandParameterOrResponse(parameter, resolver, opts.RelativeBase) -} - -func getRefAndSchema(input interface{}) (*Ref, *Schema, error) { - var ( - ref *Ref - sch *Schema - ) - - switch refable := input.(type) { - case *Parameter: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - case *Response: - if refable == nil { - return nil, nil, nil - } - ref = &refable.Ref - sch = refable.Schema - default: - return nil, nil, fmt.Errorf("unsupported type: %T: %w", input, ErrExpandUnsupportedType) - } - - return ref, sch, nil -} - -func expandParameterOrResponse(input interface{}, resolver *schemaLoader, basePath string) error { - ref, _, err := getRefAndSchema(input) - if err != nil { - return err - } - - if ref == nil { - return nil - } - - parentRefs := make([]string, 0, 10) - if err = resolver.deref(input, parentRefs, basePath); resolver.shouldStopOnError(err) { - return err - } - - ref, sch, _ := getRefAndSchema(input) - if ref.String() != "" { - transitiveResolver := resolver.transitiveResolver(basePath, *ref) - basePath = resolver.updateBasePath(transitiveResolver, basePath) - resolver = transitiveResolver - } - - if sch == nil { - // nothing to be expanded - if ref != nil { - *ref = Ref{} - } - return nil - } - - if sch.Ref.String() != "" { - rebasedRef, ern := NewRef(normalizeURI(sch.Ref.String(), basePath)) - if ern != nil { - return ern - } - - switch { - case resolver.isCircular(&rebasedRef, basePath, parentRefs...): - // this is a circular $ref: stop expansion - if !resolver.options.AbsoluteCircularRef { - sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) - } else { - sch.Ref = rebasedRef - } - case !resolver.options.SkipSchemas: - // schema expanded to a $ref in another root - sch.Ref = rebasedRef - debugLog("rebased to: %s", sch.Ref.String()) - default: - // skip schema expansion but rebase $ref to schema - sch.Ref = denormalizeRef(&rebasedRef, resolver.context.basePath, resolver.context.rootID) - } - } - - if ref != nil { - *ref = Ref{} - } - - // expand schema - if !resolver.options.SkipSchemas { - s, err := expandSchema(*sch, parentRefs, resolver, basePath) - if resolver.shouldStopOnError(err) { - return err - } - if s == nil { - // guard for when continuing on error - return nil - } - *sch = *s - } - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/external_docs.go b/vendor/github.com/go-openapi/spec/external_docs.go deleted file mode 100644 index 88add91b2b..0000000000 --- a/vendor/github.com/go-openapi/spec/external_docs.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// ExternalDocumentation allows referencing an external resource for -// extended documentation. -// -// For more information: http://goo.gl/8us55a#externalDocumentationObject -type ExternalDocumentation struct { - Description string `json:"description,omitempty"` - URL string `json:"url,omitempty"` -} diff --git a/vendor/github.com/go-openapi/spec/header.go b/vendor/github.com/go-openapi/spec/header.go deleted file mode 100644 index 9dfd17b185..0000000000 --- a/vendor/github.com/go-openapi/spec/header.go +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonArray = "array" -) - -// HeaderProps describes a response header -type HeaderProps struct { - Description string `json:"description,omitempty"` -} - -// Header describes a header for a response of the API -// -// For more information: http://goo.gl/8us55a#headerObject -type Header struct { - CommonValidations - SimpleSchema - VendorExtensible - HeaderProps -} - -// ResponseHeader creates a new header instance for use in a response -func ResponseHeader() *Header { - return new(Header) -} - -// WithDescription sets the description on this response, allows for chaining -func (h *Header) WithDescription(description string) *Header { - h.Description = description - return h -} - -// Typed a fluent builder method for the type of parameter -func (h *Header) Typed(tpe, format string) *Header { - h.Type = tpe - h.Format = format - return h -} - -// CollectionOf a fluent builder method for an array item -func (h *Header) CollectionOf(items *Items, format string) *Header { - h.Type = jsonArray - h.Items = items - h.CollectionFormat = format - return h -} - -// WithDefault sets the default value on this item -func (h *Header) WithDefault(defaultValue interface{}) *Header { - h.Default = defaultValue - return h -} - -// WithMaxLength sets a max length value -func (h *Header) WithMaxLength(max int64) *Header { - h.MaxLength = &max - return h -} - -// WithMinLength sets a min length value -func (h *Header) WithMinLength(min int64) *Header { - h.MinLength = &min - return h -} - -// WithPattern sets a pattern value -func (h *Header) WithPattern(pattern string) *Header { - h.Pattern = pattern - return h -} - -// WithMultipleOf sets a multiple of value -func (h *Header) WithMultipleOf(number float64) *Header { - h.MultipleOf = &number - return h -} - -// WithMaximum sets a maximum number value -func (h *Header) WithMaximum(max float64, exclusive bool) *Header { - h.Maximum = &max - h.ExclusiveMaximum = exclusive - return h -} - -// WithMinimum sets a minimum number value -func (h *Header) WithMinimum(min float64, exclusive bool) *Header { - h.Minimum = &min - h.ExclusiveMinimum = exclusive - return h -} - -// WithEnum sets a the enum values (replace) -func (h *Header) WithEnum(values ...interface{}) *Header { - h.Enum = append([]interface{}{}, values...) - return h -} - -// WithMaxItems sets the max items -func (h *Header) WithMaxItems(size int64) *Header { - h.MaxItems = &size - return h -} - -// WithMinItems sets the min items -func (h *Header) WithMinItems(size int64) *Header { - h.MinItems = &size - return h -} - -// UniqueValues dictates that this array can only have unique items -func (h *Header) UniqueValues() *Header { - h.UniqueItems = true - return h -} - -// AllowDuplicates this array can have duplicates -func (h *Header) AllowDuplicates() *Header { - h.UniqueItems = false - return h -} - -// WithValidations is a fluent method to set header validations -func (h *Header) WithValidations(val CommonValidations) *Header { - h.SetValidations(SchemaValidations{CommonValidations: val}) - return h -} - -// MarshalJSON marshal this to JSON -func (h Header) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(h.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(h.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(h.HeaderProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// UnmarshalJSON unmarshals this header from JSON -func (h *Header) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &h.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &h.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &h.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &h.HeaderProps) -} - -// JSONLookup look up a value by the json property name -func (h Header) JSONLookup(token string) (interface{}, error) { - if ex, ok := h.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(h.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(h.HeaderProps, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/info.go b/vendor/github.com/go-openapi/spec/info.go deleted file mode 100644 index 582f0fd4c4..0000000000 --- a/vendor/github.com/go-openapi/spec/info.go +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strconv" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Extensions vendor specific extensions -type Extensions map[string]interface{} - -// Add adds a value to these extensions -func (e Extensions) Add(key string, value interface{}) { - realKey := strings.ToLower(key) - e[realKey] = value -} - -// GetString gets a string value from the extensions -func (e Extensions) GetString(key string) (string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(string) - return str, ok - } - return "", false -} - -// GetInt gets a int value from the extensions -func (e Extensions) GetInt(key string) (int, bool) { - realKey := strings.ToLower(key) - - if v, ok := e.GetString(realKey); ok { - if r, err := strconv.Atoi(v); err == nil { - return r, true - } - } - - if v, ok := e[realKey]; ok { - if r, rOk := v.(float64); rOk { - return int(r), true - } - } - return -1, false -} - -// GetBool gets a string value from the extensions -func (e Extensions) GetBool(key string) (bool, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - str, ok := v.(bool) - return str, ok - } - return false, false -} - -// GetStringSlice gets a string value from the extensions -func (e Extensions) GetStringSlice(key string) ([]string, bool) { - if v, ok := e[strings.ToLower(key)]; ok { - arr, isSlice := v.([]interface{}) - if !isSlice { - return nil, false - } - var strs []string - for _, iface := range arr { - str, isString := iface.(string) - if !isString { - return nil, false - } - strs = append(strs, str) - } - return strs, ok - } - return nil, false -} - -// VendorExtensible composition block. -type VendorExtensible struct { - Extensions Extensions -} - -// AddExtension adds an extension to this extensible object -func (v *VendorExtensible) AddExtension(key string, value interface{}) { - if value == nil { - return - } - if v.Extensions == nil { - v.Extensions = make(map[string]interface{}) - } - v.Extensions.Add(key, value) -} - -// MarshalJSON marshals the extensions to json -func (v VendorExtensible) MarshalJSON() ([]byte, error) { - toser := make(map[string]interface{}) - for k, v := range v.Extensions { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - toser[k] = v - } - } - return json.Marshal(toser) -} - -// UnmarshalJSON for this extensible object -func (v *VendorExtensible) UnmarshalJSON(data []byte) error { - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if v.Extensions == nil { - v.Extensions = map[string]interface{}{} - } - v.Extensions[k] = vv - } - } - return nil -} - -// InfoProps the properties for an info definition -type InfoProps struct { - Description string `json:"description,omitempty"` - Title string `json:"title,omitempty"` - TermsOfService string `json:"termsOfService,omitempty"` - Contact *ContactInfo `json:"contact,omitempty"` - License *License `json:"license,omitempty"` - Version string `json:"version,omitempty"` -} - -// Info object provides metadata about the API. -// The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience. -// -// For more information: http://goo.gl/8us55a#infoObject -type Info struct { - VendorExtensible - InfoProps -} - -// JSONLookup look up a value by the json property name -func (i Info) JSONLookup(token string) (interface{}, error) { - if ex, ok := i.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(i.InfoProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (i Info) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.InfoProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (i *Info) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &i.InfoProps); err != nil { - return err - } - return json.Unmarshal(data, &i.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/items.go b/vendor/github.com/go-openapi/spec/items.go deleted file mode 100644 index e2afb2133b..0000000000 --- a/vendor/github.com/go-openapi/spec/items.go +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - jsonRef = "$ref" -) - -// SimpleSchema describe swagger simple schemas for parameters and headers -type SimpleSchema struct { - Type string `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Items *Items `json:"items,omitempty"` - CollectionFormat string `json:"collectionFormat,omitempty"` - Default interface{} `json:"default,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// TypeName return the type (or format) of a simple schema -func (s *SimpleSchema) TypeName() string { - if s.Format != "" { - return s.Format - } - return s.Type -} - -// ItemsTypeName yields the type of items in a simple schema array -func (s *SimpleSchema) ItemsTypeName() string { - if s.Items == nil { - return "" - } - return s.Items.TypeName() -} - -// Items a limited subset of JSON-Schema's items object. -// It is used by parameter definitions that are not located in "body". -// -// For more information: http://goo.gl/8us55a#items-object -type Items struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible -} - -// NewItems creates a new instance of items -func NewItems() *Items { - return &Items{} -} - -// Typed a fluent builder method for the type of item -func (i *Items) Typed(tpe, format string) *Items { - i.Type = tpe - i.Format = format - return i -} - -// AsNullable flags this schema as nullable. -func (i *Items) AsNullable() *Items { - i.Nullable = true - return i -} - -// CollectionOf a fluent builder method for an array item -func (i *Items) CollectionOf(items *Items, format string) *Items { - i.Type = jsonArray - i.Items = items - i.CollectionFormat = format - return i -} - -// WithDefault sets the default value on this item -func (i *Items) WithDefault(defaultValue interface{}) *Items { - i.Default = defaultValue - return i -} - -// WithMaxLength sets a max length value -func (i *Items) WithMaxLength(max int64) *Items { - i.MaxLength = &max - return i -} - -// WithMinLength sets a min length value -func (i *Items) WithMinLength(min int64) *Items { - i.MinLength = &min - return i -} - -// WithPattern sets a pattern value -func (i *Items) WithPattern(pattern string) *Items { - i.Pattern = pattern - return i -} - -// WithMultipleOf sets a multiple of value -func (i *Items) WithMultipleOf(number float64) *Items { - i.MultipleOf = &number - return i -} - -// WithMaximum sets a maximum number value -func (i *Items) WithMaximum(max float64, exclusive bool) *Items { - i.Maximum = &max - i.ExclusiveMaximum = exclusive - return i -} - -// WithMinimum sets a minimum number value -func (i *Items) WithMinimum(min float64, exclusive bool) *Items { - i.Minimum = &min - i.ExclusiveMinimum = exclusive - return i -} - -// WithEnum sets a the enum values (replace) -func (i *Items) WithEnum(values ...interface{}) *Items { - i.Enum = append([]interface{}{}, values...) - return i -} - -// WithMaxItems sets the max items -func (i *Items) WithMaxItems(size int64) *Items { - i.MaxItems = &size - return i -} - -// WithMinItems sets the min items -func (i *Items) WithMinItems(size int64) *Items { - i.MinItems = &size - return i -} - -// UniqueValues dictates that this array can only have unique items -func (i *Items) UniqueValues() *Items { - i.UniqueItems = true - return i -} - -// AllowDuplicates this array can have duplicates -func (i *Items) AllowDuplicates() *Items { - i.UniqueItems = false - return i -} - -// WithValidations is a fluent method to set Items validations -func (i *Items) WithValidations(val CommonValidations) *Items { - i.SetValidations(SchemaValidations{CommonValidations: val}) - return i -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (i *Items) UnmarshalJSON(data []byte) error { - var validations CommonValidations - if err := json.Unmarshal(data, &validations); err != nil { - return err - } - var ref Refable - if err := json.Unmarshal(data, &ref); err != nil { - return err - } - var simpleSchema SimpleSchema - if err := json.Unmarshal(data, &simpleSchema); err != nil { - return err - } - var vendorExtensible VendorExtensible - if err := json.Unmarshal(data, &vendorExtensible); err != nil { - return err - } - i.Refable = ref - i.CommonValidations = validations - i.SimpleSchema = simpleSchema - i.VendorExtensible = vendorExtensible - return nil -} - -// MarshalJSON converts this items object to JSON -func (i Items) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(i.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(i.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(i.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(i.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b4, b3, b1, b2), nil -} - -// JSONLookup look up a value by the json property name -func (i Items) JSONLookup(token string) (interface{}, error) { - if token == jsonRef { - return &i.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(i.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(i.SimpleSchema, token) - return r, err -} diff --git a/vendor/github.com/go-openapi/spec/license.go b/vendor/github.com/go-openapi/spec/license.go deleted file mode 100644 index b42f80368e..0000000000 --- a/vendor/github.com/go-openapi/spec/license.go +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/swag" -) - -// License information for the exposed API. -// -// For more information: http://goo.gl/8us55a#licenseObject -type License struct { - LicenseProps - VendorExtensible -} - -// LicenseProps holds the properties of a License object -type LicenseProps struct { - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` -} - -// UnmarshalJSON hydrates License from json -func (l *License) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &l.LicenseProps); err != nil { - return err - } - return json.Unmarshal(data, &l.VendorExtensible) -} - -// MarshalJSON produces License as json -func (l License) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(l.LicenseProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(l.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} diff --git a/vendor/github.com/go-openapi/spec/normalizer.go b/vendor/github.com/go-openapi/spec/normalizer.go deleted file mode 100644 index e8b6009945..0000000000 --- a/vendor/github.com/go-openapi/spec/normalizer.go +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "path" - "strings" -) - -const fileScheme = "file" - -// normalizeURI ensures that all $ref paths used internally by the expander are canonicalized. -// -// NOTE(windows): there is a tolerance over the strict URI format on windows. -// -// The normalizer accepts relative file URLs like 'Path\File.JSON' as well as absolute file URLs like -// 'C:\Path\file.Yaml'. -// -// Both are canonicalized with a "file://" scheme, slashes and a lower-cased path: -// 'file:///c:/path/file.yaml' -// -// URLs can be specified with a file scheme, like in 'file:///folder/file.json' or -// 'file:///c:\folder\File.json'. -// -// URLs like file://C:\folder are considered invalid (i.e. there is no host 'c:\folder') and a "repair" -// is attempted. -// -// The base path argument is assumed to be canonicalized (e.g. using normalizeBase()). -func normalizeURI(refPath, base string) string { - refURL, err := parseURL(refPath) - if err != nil { - specLogger.Printf("warning: invalid URI in $ref %q: %v", refPath, err) - refURL, refPath = repairURI(refPath) - } - - fixWindowsURI(refURL, refPath) // noop on non-windows OS - - refURL.Path = path.Clean(refURL.Path) - if refURL.Path == "." { - refURL.Path = "" - } - - r := MustCreateRef(refURL.String()) - if r.IsCanonical() { - return refURL.String() - } - - baseURL, _ := parseURL(base) - if path.IsAbs(refURL.Path) { - baseURL.Path = refURL.Path - } else if refURL.Path != "" { - baseURL.Path = path.Join(path.Dir(baseURL.Path), refURL.Path) - } - // copying fragment from ref to base - baseURL.Fragment = refURL.Fragment - - return baseURL.String() -} - -// denormalizeRef returns the simplest notation for a normalized $ref, given the path of the original root document. -// -// When calling this, we assume that: -// * $ref is a canonical URI -// * originalRelativeBase is a canonical URI -// -// denormalizeRef is currently used when we rewrite a $ref after a circular $ref has been detected. -// In this case, expansion stops and normally renders the internal canonical $ref. -// -// This internal $ref is eventually rebased to the original RelativeBase used for the expansion. -// -// There is a special case for schemas that are anchored with an "id": -// in that case, the rebasing is performed // against the id only if this is an anchor for the initial root document. -// All other intermediate "id"'s found along the way are ignored for the purpose of rebasing. -func denormalizeRef(ref *Ref, originalRelativeBase, id string) Ref { - debugLog("denormalizeRef called:\n$ref: %q\noriginal: %s\nroot ID:%s", ref.String(), originalRelativeBase, id) - - if ref.String() == "" || ref.IsRoot() || ref.HasFragmentOnly { - // short circuit: $ref to current doc - return *ref - } - - if id != "" { - idBaseURL, err := parseURL(id) - if err == nil { // if the schema id is not usable as a URI, ignore it - if ref, ok := rebase(ref, idBaseURL, true); ok { // rebase, but keep references to root unchaged (do not want $ref: "") - // $ref relative to the ID of the schema in the root document - return ref - } - } - } - - originalRelativeBaseURL, _ := parseURL(originalRelativeBase) - - r, _ := rebase(ref, originalRelativeBaseURL, false) - - return r -} - -func rebase(ref *Ref, v *url.URL, notEqual bool) (Ref, bool) { - var newBase url.URL - - u := ref.GetURL() - - if u.Scheme != v.Scheme || u.Host != v.Host { - return *ref, false - } - - docPath := v.Path - v.Path = path.Dir(v.Path) - - if v.Path == "." { - v.Path = "" - } else if !strings.HasSuffix(v.Path, "/") { - v.Path += "/" - } - - newBase.Fragment = u.Fragment - - if strings.HasPrefix(u.Path, docPath) { - newBase.Path = strings.TrimPrefix(u.Path, docPath) - } else { - newBase.Path = strings.TrimPrefix(u.Path, v.Path) - } - - if notEqual && newBase.Path == "" && newBase.Fragment == "" { - // do not want rebasing to end up in an empty $ref - return *ref, false - } - - if path.IsAbs(newBase.Path) { - // whenever we end up with an absolute path, specify the scheme and host - newBase.Scheme = v.Scheme - newBase.Host = v.Host - } - - return MustCreateRef(newBase.String()), true -} - -// normalizeRef canonicalize a Ref, using a canonical relativeBase as its absolute anchor -func normalizeRef(ref *Ref, relativeBase string) *Ref { - r := MustCreateRef(normalizeURI(ref.String(), relativeBase)) - return &r -} - -// normalizeBase performs a normalization of the input base path. -// -// This always yields a canonical URI (absolute), usable for the document cache. -// -// It ensures that all further internal work on basePath may safely assume -// a non-empty, cross-platform, canonical URI (i.e. absolute). -// -// This normalization tolerates windows paths (e.g. C:\x\y\File.dat) and transform this -// in a file:// URL with lower cased drive letter and path. -// -// See also: https://en.wikipedia.org/wiki/File_URI_scheme -func normalizeBase(in string) string { - u, err := parseURL(in) - if err != nil { - specLogger.Printf("warning: invalid URI in RelativeBase %q: %v", in, err) - u, in = repairURI(in) - } - - u.Fragment = "" // any fragment in the base is irrelevant - - fixWindowsURI(u, in) // noop on non-windows OS - - u.Path = path.Clean(u.Path) - if u.Path == "." { // empty after Clean() - u.Path = "" - } - - if u.Scheme != "" { - if path.IsAbs(u.Path) || u.Scheme != fileScheme { - // this is absolute or explicitly not a local file: we're good - return u.String() - } - } - - // no scheme or file scheme with relative path: assume file and make it absolute - // enforce scheme file://... with absolute path. - // - // If the input path is relative, we anchor the path to the current working directory. - // NOTE: we may end up with a host component. Leave it unchanged: e.g. file://host/folder/file.json - - u.Scheme = fileScheme - u.Path = absPath(u.Path) // platform-dependent - u.RawQuery = "" // any query component is irrelevant for a base - return u.String() -} diff --git a/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go b/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go deleted file mode 100644 index 2df0723154..0000000000 --- a/vendor/github.com/go-openapi/spec/normalizer_nonwindows.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build !windows -// +build !windows - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "path/filepath" -) - -// absPath makes a file path absolute and compatible with a URI path component. -// -// The parameter must be a path, not an URI. -func absPath(in string) string { - anchored, err := filepath.Abs(in) - if err != nil { - specLogger.Printf("warning: could not resolve current working directory: %v", err) - return in - } - return anchored -} - -func repairURI(in string) (*url.URL, string) { - u, _ := parseURL("") - debugLog("repaired URI: original: %q, repaired: %q", in, "") - return u, "" -} - -func fixWindowsURI(u *url.URL, in string) { -} diff --git a/vendor/github.com/go-openapi/spec/normalizer_windows.go b/vendor/github.com/go-openapi/spec/normalizer_windows.go deleted file mode 100644 index a66c532dbc..0000000000 --- a/vendor/github.com/go-openapi/spec/normalizer_windows.go +++ /dev/null @@ -1,154 +0,0 @@ -// -build windows - -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "net/url" - "os" - "path" - "path/filepath" - "strings" -) - -// absPath makes a file path absolute and compatible with a URI path component -// -// The parameter must be a path, not an URI. -func absPath(in string) string { - // NOTE(windows): filepath.Abs exhibits a special behavior on windows for empty paths. - // See https://github.com/golang/go/issues/24441 - if in == "" { - in = "." - } - - anchored, err := filepath.Abs(in) - if err != nil { - specLogger.Printf("warning: could not resolve current working directory: %v", err) - return in - } - - pth := strings.ReplaceAll(strings.ToLower(anchored), `\`, `/`) - if !strings.HasPrefix(pth, "/") { - pth = "/" + pth - } - - return path.Clean(pth) -} - -// repairURI tolerates invalid file URIs with common typos -// such as 'file://E:\folder\file', that break the regular URL parser. -// -// Adopting the same defaults as for unixes (e.g. return an empty path) would -// result into a counter-intuitive result for that case (e.g. E:\folder\file is -// eventually resolved as the current directory). The repair will detect the missing "/". -// -// Note that this only works for the file scheme. -func repairURI(in string) (*url.URL, string) { - const prefix = fileScheme + "://" - if !strings.HasPrefix(in, prefix) { - // giving up: resolve to empty path - u, _ := parseURL("") - - return u, "" - } - - // attempt the repair, stripping the scheme should be sufficient - u, _ := parseURL(strings.TrimPrefix(in, prefix)) - debugLog("repaired URI: original: %q, repaired: %q", in, u.String()) - - return u, u.String() -} - -// fixWindowsURI tolerates an absolute file path on windows such as C:\Base\File.yaml or \\host\share\Base\File.yaml -// and makes it a canonical URI: file:///c:/base/file.yaml -// -// Catch 22 notes for Windows: -// -// * There may be a drive letter on windows (it is lower-cased) -// * There may be a share UNC, e.g. \\server\folder\data.xml -// * Paths are case insensitive -// * Paths may already contain slashes -// * Paths must be slashed -// -// NOTE: there is no escaping. "/" may be valid separators just like "\". -// We don't use ToSlash() (which escapes everything) because windows now also -// tolerates the use of "/". Hence, both C:\File.yaml and C:/File.yaml will work. -func fixWindowsURI(u *url.URL, in string) { - drive := filepath.VolumeName(in) - - if len(drive) > 0 { - if len(u.Scheme) == 1 && strings.EqualFold(u.Scheme, drive[:1]) { // a path with a drive letter - u.Scheme = fileScheme - u.Host = "" - u.Path = strings.Join([]string{drive, u.Opaque, u.Path}, `/`) // reconstruct the full path component (no fragment, no query) - } else if u.Host == "" && strings.HasPrefix(u.Path, drive) { // a path with a \\host volume - // NOTE: the special host@port syntax for UNC is not supported (yet) - u.Scheme = fileScheme - - // this is a modified version of filepath.Dir() to apply on the VolumeName itself - i := len(drive) - 1 - for i >= 0 && !os.IsPathSeparator(drive[i]) { - i-- - } - host := drive[:i] // \\host\share => host - - u.Path = strings.TrimPrefix(u.Path, host) - u.Host = strings.TrimPrefix(host, `\\`) - } - - u.Opaque = "" - u.Path = strings.ReplaceAll(strings.ToLower(u.Path), `\`, `/`) - - // ensure we form an absolute path - if !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - - u.Path = path.Clean(u.Path) - - return - } - - if u.Scheme == fileScheme { - // Handle dodgy cases for file://{...} URIs on windows. - // A canonical URI should always be followed by an absolute path. - // - // Examples: - // * file:///folder/file => valid, unchanged - // * file:///c:\folder\file => slashed - // * file:///./folder/file => valid, cleaned to remove the dot - // * file:///.\folder\file => remapped to cwd - // * file:///. => dodgy, remapped to / (consistent with the behavior on unix) - // * file:///.. => dodgy, remapped to / (consistent with the behavior on unix) - if (!path.IsAbs(u.Path) && !filepath.IsAbs(u.Path)) || (strings.HasPrefix(u.Path, `/.`) && strings.Contains(u.Path, `\`)) { - // ensure we form an absolute path - u.Path, _ = filepath.Abs(strings.TrimLeft(u.Path, `/`)) - if !strings.HasPrefix(u.Path, "/") { - u.Path = "/" + u.Path - } - } - u.Path = strings.ToLower(u.Path) - } - - // NOTE: lower case normalization does not propagate to inner resources, - // generated when rebasing: when joining a relative URI with a file to an absolute base, - // only the base is currently lower-cased. - // - // For now, we assume this is good enough for most use cases - // and try not to generate too many differences - // between the output produced on different platforms. - u.Path = path.Clean(strings.ReplaceAll(u.Path, `\`, `/`)) -} diff --git a/vendor/github.com/go-openapi/spec/operation.go b/vendor/github.com/go-openapi/spec/operation.go deleted file mode 100644 index 995ce6acb1..0000000000 --- a/vendor/github.com/go-openapi/spec/operation.go +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "sort" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -func init() { - gob.Register(map[string]interface{}{}) - gob.Register([]interface{}{}) -} - -// OperationProps describes an operation -// -// NOTES: -// - schemes, when present must be from [http, https, ws, wss]: see validate -// - Security is handled as a special case: see MarshalJSON function -type OperationProps struct { - Description string `json:"description,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Tags []string `json:"tags,omitempty"` - Summary string `json:"summary,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - ID string `json:"operationId,omitempty"` - Deprecated bool `json:"deprecated,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` - Responses *Responses `json:"responses,omitempty"` -} - -// MarshalJSON takes care of serializing operation properties to JSON -// -// We use a custom marhaller here to handle a special cases related to -// the Security field. We need to preserve zero length slice -// while omitting the field when the value is nil/unset. -func (op OperationProps) MarshalJSON() ([]byte, error) { - type Alias OperationProps - if op.Security == nil { - return json.Marshal(&struct { - Security []map[string][]string `json:"security,omitempty"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) - } - return json.Marshal(&struct { - Security []map[string][]string `json:"security"` - *Alias - }{ - Security: op.Security, - Alias: (*Alias)(&op), - }) -} - -// Operation describes a single API operation on a path. -// -// For more information: http://goo.gl/8us55a#operationObject -type Operation struct { - VendorExtensible - OperationProps -} - -// SuccessResponse gets a success response model -func (o *Operation) SuccessResponse() (*Response, int, bool) { - if o.Responses == nil { - return nil, 0, false - } - - responseCodes := make([]int, 0, len(o.Responses.StatusCodeResponses)) - for k := range o.Responses.StatusCodeResponses { - if k >= 200 && k < 300 { - responseCodes = append(responseCodes, k) - } - } - if len(responseCodes) > 0 { - sort.Ints(responseCodes) - v := o.Responses.StatusCodeResponses[responseCodes[0]] - return &v, responseCodes[0], true - } - - return o.Responses.Default, 0, false -} - -// JSONLookup look up a value by the json property name -func (o Operation) JSONLookup(token string) (interface{}, error) { - if ex, ok := o.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(o.OperationProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (o *Operation) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &o.OperationProps); err != nil { - return err - } - return json.Unmarshal(data, &o.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (o Operation) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(o.OperationProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(o.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// NewOperation creates a new operation instance. -// It expects an ID as parameter but not passing an ID is also valid. -func NewOperation(id string) *Operation { - op := new(Operation) - op.ID = id - return op -} - -// WithID sets the ID property on this operation, allows for chaining. -func (o *Operation) WithID(id string) *Operation { - o.ID = id - return o -} - -// WithDescription sets the description on this operation, allows for chaining -func (o *Operation) WithDescription(description string) *Operation { - o.Description = description - return o -} - -// WithSummary sets the summary on this operation, allows for chaining -func (o *Operation) WithSummary(summary string) *Operation { - o.Summary = summary - return o -} - -// WithExternalDocs sets/removes the external docs for/from this operation. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (o *Operation) WithExternalDocs(description, url string) *Operation { - if description == "" && url == "" { - o.ExternalDocs = nil - return o - } - - if o.ExternalDocs == nil { - o.ExternalDocs = &ExternalDocumentation{} - } - o.ExternalDocs.Description = description - o.ExternalDocs.URL = url - return o -} - -// Deprecate marks the operation as deprecated -func (o *Operation) Deprecate() *Operation { - o.Deprecated = true - return o -} - -// Undeprecate marks the operation as not deprected -func (o *Operation) Undeprecate() *Operation { - o.Deprecated = false - return o -} - -// WithConsumes adds media types for incoming body values -func (o *Operation) WithConsumes(mediaTypes ...string) *Operation { - o.Consumes = append(o.Consumes, mediaTypes...) - return o -} - -// WithProduces adds media types for outgoing body values -func (o *Operation) WithProduces(mediaTypes ...string) *Operation { - o.Produces = append(o.Produces, mediaTypes...) - return o -} - -// WithTags adds tags for this operation -func (o *Operation) WithTags(tags ...string) *Operation { - o.Tags = append(o.Tags, tags...) - return o -} - -// AddParam adds a parameter to this operation, when a parameter for that location -// and with that name already exists it will be replaced -func (o *Operation) AddParam(param *Parameter) *Operation { - if param == nil { - return o - } - - for i, p := range o.Parameters { - if p.Name == param.Name && p.In == param.In { - params := append(o.Parameters[:i], *param) - params = append(params, o.Parameters[i+1:]...) - o.Parameters = params - return o - } - } - - o.Parameters = append(o.Parameters, *param) - return o -} - -// RemoveParam removes a parameter from the operation -func (o *Operation) RemoveParam(name, in string) *Operation { - for i, p := range o.Parameters { - if p.Name == name && p.In == in { - o.Parameters = append(o.Parameters[:i], o.Parameters[i+1:]...) - return o - } - } - return o -} - -// SecuredWith adds a security scope to this operation. -func (o *Operation) SecuredWith(name string, scopes ...string) *Operation { - o.Security = append(o.Security, map[string][]string{name: scopes}) - return o -} - -// WithDefaultResponse adds a default response to the operation. -// Passing a nil value will remove the response -func (o *Operation) WithDefaultResponse(response *Response) *Operation { - return o.RespondsWith(0, response) -} - -// RespondsWith adds a status code response to the operation. -// When the code is 0 the value of the response will be used as default response value. -// When the value of the response is nil it will be removed from the operation -func (o *Operation) RespondsWith(code int, response *Response) *Operation { - if o.Responses == nil { - o.Responses = new(Responses) - } - if code == 0 { - o.Responses.Default = response - return o - } - if response == nil { - delete(o.Responses.StatusCodeResponses, code) - return o - } - if o.Responses.StatusCodeResponses == nil { - o.Responses.StatusCodeResponses = make(map[int]Response) - } - o.Responses.StatusCodeResponses[code] = *response - return o -} - -type opsAlias OperationProps - -type gobAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *opsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (o Operation) GobEncode() ([]byte, error) { - raw := struct { - Ext VendorExtensible - Props OperationProps - }{ - Ext: o.VendorExtensible, - Props: o.OperationProps, - } - var b bytes.Buffer - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (o *Operation) GobDecode(b []byte) error { - var raw struct { - Ext VendorExtensible - Props OperationProps - } - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - o.VendorExtensible = raw.Ext - o.OperationProps = raw.Props - return nil -} - -// GobEncode provides a safe gob encoder for Operation, including empty security requirements -func (op OperationProps) GobEncode() ([]byte, error) { - raw := gobAlias{ - Alias: (*opsAlias)(&op), - } - - var b bytes.Buffer - if op.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(op.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(op.Security)) - for _, req := range op.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Operation, including empty security requirements -func (op *OperationProps) GobDecode(b []byte) error { - var raw gobAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *op = *(*OperationProps)(raw.Alias) - return nil -} diff --git a/vendor/github.com/go-openapi/spec/parameter.go b/vendor/github.com/go-openapi/spec/parameter.go deleted file mode 100644 index 2b2b89b67b..0000000000 --- a/vendor/github.com/go-openapi/spec/parameter.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// QueryParam creates a query parameter -func QueryParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "query"}} -} - -// HeaderParam creates a header parameter, this is always required by default -func HeaderParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "header", Required: true}} -} - -// PathParam creates a path parameter, this is always required -func PathParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "path", Required: true}} -} - -// BodyParam creates a body parameter -func BodyParam(name string, schema *Schema) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "body", Schema: schema}} -} - -// FormDataParam creates a body parameter -func FormDataParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}} -} - -// FileParam creates a body parameter -func FileParam(name string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name, In: "formData"}, - SimpleSchema: SimpleSchema{Type: "file"}} -} - -// SimpleArrayParam creates a param for a simple array (string, int, date etc) -func SimpleArrayParam(name, tpe, fmt string) *Parameter { - return &Parameter{ParamProps: ParamProps{Name: name}, - SimpleSchema: SimpleSchema{Type: jsonArray, CollectionFormat: "csv", - Items: &Items{SimpleSchema: SimpleSchema{Type: tpe, Format: fmt}}}} -} - -// ParamRef creates a parameter that's a json reference -func ParamRef(uri string) *Parameter { - p := new(Parameter) - p.Ref = MustCreateRef(uri) - return p -} - -// ParamProps describes the specific attributes of an operation parameter -// -// NOTE: -// - Schema is defined when "in" == "body": see validate -// - AllowEmptyValue is allowed where "in" == "query" || "formData" -type ParamProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - In string `json:"in,omitempty"` - Required bool `json:"required,omitempty"` - Schema *Schema `json:"schema,omitempty"` - AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` -} - -// Parameter a unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). -// -// There are five possible parameter types. -// * Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part -// of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, -// the path parameter is `itemId`. -// * Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`. -// * Header - Custom headers that are expected as part of the request. -// * Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be -// _one_ body parameter. The name of the body parameter has no effect on the parameter itself and is used for -// documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist -// together for the same operation. -// * Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or -// `multipart/form-data` are used as the content type of the request (in Swagger's definition, -// the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used -// to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be -// declared together with a body parameter for the same operation. Form parameters have a different format based on -// the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4). -// * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. -// For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple -// parameters that are being transferred. -// * `multipart/form-data` - each parameter takes a section in the payload with an internal header. -// For example, for the header `Content-Disposition: form-data; name="submit-name"` the name of the parameter is -// `submit-name`. This type of form parameters is more commonly used for file transfers. -// -// For more information: http://goo.gl/8us55a#parameterObject -type Parameter struct { - Refable - CommonValidations - SimpleSchema - VendorExtensible - ParamProps -} - -// JSONLookup look up a value by the json property name -func (p Parameter) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - - r, _, err := jsonpointer.GetForToken(p.CommonValidations, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.SimpleSchema, token) - if err != nil && !strings.HasPrefix(err.Error(), "object has no field") { - return nil, err - } - if r != nil { - return r, nil - } - r, _, err = jsonpointer.GetForToken(p.ParamProps, token) - return r, err -} - -// WithDescription a fluent builder method for the description of the parameter -func (p *Parameter) WithDescription(description string) *Parameter { - p.Description = description - return p -} - -// Named a fluent builder method to override the name of the parameter -func (p *Parameter) Named(name string) *Parameter { - p.Name = name - return p -} - -// WithLocation a fluent builder method to override the location of the parameter -func (p *Parameter) WithLocation(in string) *Parameter { - p.In = in - return p -} - -// Typed a fluent builder method for the type of the parameter value -func (p *Parameter) Typed(tpe, format string) *Parameter { - p.Type = tpe - p.Format = format - return p -} - -// CollectionOf a fluent builder method for an array parameter -func (p *Parameter) CollectionOf(items *Items, format string) *Parameter { - p.Type = jsonArray - p.Items = items - p.CollectionFormat = format - return p -} - -// WithDefault sets the default value on this parameter -func (p *Parameter) WithDefault(defaultValue interface{}) *Parameter { - p.AsOptional() // with default implies optional - p.Default = defaultValue - return p -} - -// AllowsEmptyValues flags this parameter as being ok with empty values -func (p *Parameter) AllowsEmptyValues() *Parameter { - p.AllowEmptyValue = true - return p -} - -// NoEmptyValues flags this parameter as not liking empty values -func (p *Parameter) NoEmptyValues() *Parameter { - p.AllowEmptyValue = false - return p -} - -// AsOptional flags this parameter as optional -func (p *Parameter) AsOptional() *Parameter { - p.Required = false - return p -} - -// AsRequired flags this parameter as required -func (p *Parameter) AsRequired() *Parameter { - if p.Default != nil { // with a default required makes no sense - return p - } - p.Required = true - return p -} - -// WithMaxLength sets a max length value -func (p *Parameter) WithMaxLength(max int64) *Parameter { - p.MaxLength = &max - return p -} - -// WithMinLength sets a min length value -func (p *Parameter) WithMinLength(min int64) *Parameter { - p.MinLength = &min - return p -} - -// WithPattern sets a pattern value -func (p *Parameter) WithPattern(pattern string) *Parameter { - p.Pattern = pattern - return p -} - -// WithMultipleOf sets a multiple of value -func (p *Parameter) WithMultipleOf(number float64) *Parameter { - p.MultipleOf = &number - return p -} - -// WithMaximum sets a maximum number value -func (p *Parameter) WithMaximum(max float64, exclusive bool) *Parameter { - p.Maximum = &max - p.ExclusiveMaximum = exclusive - return p -} - -// WithMinimum sets a minimum number value -func (p *Parameter) WithMinimum(min float64, exclusive bool) *Parameter { - p.Minimum = &min - p.ExclusiveMinimum = exclusive - return p -} - -// WithEnum sets a the enum values (replace) -func (p *Parameter) WithEnum(values ...interface{}) *Parameter { - p.Enum = append([]interface{}{}, values...) - return p -} - -// WithMaxItems sets the max items -func (p *Parameter) WithMaxItems(size int64) *Parameter { - p.MaxItems = &size - return p -} - -// WithMinItems sets the min items -func (p *Parameter) WithMinItems(size int64) *Parameter { - p.MinItems = &size - return p -} - -// UniqueValues dictates that this array can only have unique items -func (p *Parameter) UniqueValues() *Parameter { - p.UniqueItems = true - return p -} - -// AllowDuplicates this array can have duplicates -func (p *Parameter) AllowDuplicates() *Parameter { - p.UniqueItems = false - return p -} - -// WithValidations is a fluent method to set parameter validations -func (p *Parameter) WithValidations(val CommonValidations) *Parameter { - p.SetValidations(SchemaValidations{CommonValidations: val}) - return p -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Parameter) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.CommonValidations); err != nil { - return err - } - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.SimpleSchema); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.ParamProps) -} - -// MarshalJSON converts this items object to JSON -func (p Parameter) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.CommonValidations) - if err != nil { - return nil, err - } - b2, err := json.Marshal(p.SimpleSchema) - if err != nil { - return nil, err - } - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.ParamProps) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b3, b1, b2, b4, b5), nil -} diff --git a/vendor/github.com/go-openapi/spec/path_item.go b/vendor/github.com/go-openapi/spec/path_item.go deleted file mode 100644 index 68fc8e9014..0000000000 --- a/vendor/github.com/go-openapi/spec/path_item.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// PathItemProps the path item specific properties -type PathItemProps struct { - Get *Operation `json:"get,omitempty"` - Put *Operation `json:"put,omitempty"` - Post *Operation `json:"post,omitempty"` - Delete *Operation `json:"delete,omitempty"` - Options *Operation `json:"options,omitempty"` - Head *Operation `json:"head,omitempty"` - Patch *Operation `json:"patch,omitempty"` - Parameters []Parameter `json:"parameters,omitempty"` -} - -// PathItem describes the operations available on a single path. -// A Path Item may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// The path itself is still exposed to the documentation viewer but they will -// not know which operations and parameters are available. -// -// For more information: http://goo.gl/8us55a#pathItemObject -type PathItem struct { - Refable - VendorExtensible - PathItemProps -} - -// JSONLookup look up a value by the json property name -func (p PathItem) JSONLookup(token string) (interface{}, error) { - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - if token == jsonRef { - return &p.Ref, nil - } - r, _, err := jsonpointer.GetForToken(p.PathItemProps, token) - return r, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *PathItem) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &p.Refable); err != nil { - return err - } - if err := json.Unmarshal(data, &p.VendorExtensible); err != nil { - return err - } - return json.Unmarshal(data, &p.PathItemProps) -} - -// MarshalJSON converts this items object to JSON -func (p PathItem) MarshalJSON() ([]byte, error) { - b3, err := json.Marshal(p.Refable) - if err != nil { - return nil, err - } - b4, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - b5, err := json.Marshal(p.PathItemProps) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b3, b4, b5) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/paths.go b/vendor/github.com/go-openapi/spec/paths.go deleted file mode 100644 index 9dc82a2901..0000000000 --- a/vendor/github.com/go-openapi/spec/paths.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-openapi/swag" -) - -// Paths holds the relative paths to the individual endpoints. -// The path is appended to the [`basePath`](http://goo.gl/8us55a#swaggerBasePath) in order -// to construct the full URL. -// The Paths may be empty, due to [ACL constraints](http://goo.gl/8us55a#securityFiltering). -// -// For more information: http://goo.gl/8us55a#pathsObject -type Paths struct { - VendorExtensible - Paths map[string]PathItem `json:"-"` // custom serializer to flatten this, each entry must start with "/" -} - -// JSONLookup look up a value by the json property name -func (p Paths) JSONLookup(token string) (interface{}, error) { - if pi, ok := p.Paths[token]; ok { - return &pi, nil - } - if ex, ok := p.Extensions[token]; ok { - return &ex, nil - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (p *Paths) UnmarshalJSON(data []byte) error { - var res map[string]json.RawMessage - if err := json.Unmarshal(data, &res); err != nil { - return err - } - for k, v := range res { - if strings.HasPrefix(strings.ToLower(k), "x-") { - if p.Extensions == nil { - p.Extensions = make(map[string]interface{}) - } - var d interface{} - if err := json.Unmarshal(v, &d); err != nil { - return err - } - p.Extensions[k] = d - } - if strings.HasPrefix(k, "/") { - if p.Paths == nil { - p.Paths = make(map[string]PathItem) - } - var pi PathItem - if err := json.Unmarshal(v, &pi); err != nil { - return err - } - p.Paths[k] = pi - } - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (p Paths) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(p.VendorExtensible) - if err != nil { - return nil, err - } - - pths := make(map[string]PathItem) - for k, v := range p.Paths { - if strings.HasPrefix(k, "/") { - pths[k] = v - } - } - b2, err := json.Marshal(pths) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} diff --git a/vendor/github.com/go-openapi/spec/properties.go b/vendor/github.com/go-openapi/spec/properties.go deleted file mode 100644 index 91d2435f01..0000000000 --- a/vendor/github.com/go-openapi/spec/properties.go +++ /dev/null @@ -1,91 +0,0 @@ -package spec - -import ( - "bytes" - "encoding/json" - "reflect" - "sort" -) - -// OrderSchemaItem holds a named schema (e.g. from a property of an object) -type OrderSchemaItem struct { - Name string - Schema -} - -// OrderSchemaItems is a sortable slice of named schemas. -// The ordering is defined by the x-order schema extension. -type OrderSchemaItems []OrderSchemaItem - -// MarshalJSON produces a json object with keys defined by the name schemas -// of the OrderSchemaItems slice, keeping the original order of the slice. -func (items OrderSchemaItems) MarshalJSON() ([]byte, error) { - buf := bytes.NewBuffer(nil) - buf.WriteString("{") - for i := range items { - if i > 0 { - buf.WriteString(",") - } - buf.WriteString("\"") - buf.WriteString(items[i].Name) - buf.WriteString("\":") - bs, err := json.Marshal(&items[i].Schema) - if err != nil { - return nil, err - } - buf.Write(bs) - } - buf.WriteString("}") - return buf.Bytes(), nil -} - -func (items OrderSchemaItems) Len() int { return len(items) } -func (items OrderSchemaItems) Swap(i, j int) { items[i], items[j] = items[j], items[i] } -func (items OrderSchemaItems) Less(i, j int) (ret bool) { - ii, oki := items[i].Extensions.GetInt("x-order") - ij, okj := items[j].Extensions.GetInt("x-order") - if oki { - if okj { - defer func() { - if err := recover(); err != nil { - defer func() { - if err = recover(); err != nil { - ret = items[i].Name < items[j].Name - } - }() - ret = reflect.ValueOf(ii).String() < reflect.ValueOf(ij).String() - } - }() - return ii < ij - } - return true - } else if okj { - return false - } - return items[i].Name < items[j].Name -} - -// SchemaProperties is a map representing the properties of a Schema object. -// It knows how to transform its keys into an ordered slice. -type SchemaProperties map[string]Schema - -// ToOrderedSchemaItems transforms the map of properties into a sortable slice -func (properties SchemaProperties) ToOrderedSchemaItems() OrderSchemaItems { - items := make(OrderSchemaItems, 0, len(properties)) - for k, v := range properties { - items = append(items, OrderSchemaItem{ - Name: k, - Schema: v, - }) - } - sort.Sort(items) - return items -} - -// MarshalJSON produces properties as json, keeping their order. -func (properties SchemaProperties) MarshalJSON() ([]byte, error) { - if properties == nil { - return []byte("null"), nil - } - return json.Marshal(properties.ToOrderedSchemaItems()) -} diff --git a/vendor/github.com/go-openapi/spec/ref.go b/vendor/github.com/go-openapi/spec/ref.go deleted file mode 100644 index b0ef9bd9c9..0000000000 --- a/vendor/github.com/go-openapi/spec/ref.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "net/http" - "os" - "path/filepath" - - "github.com/go-openapi/jsonreference" -) - -// Refable is a struct for things that accept a $ref property -type Refable struct { - Ref Ref -} - -// MarshalJSON marshals the ref to json -func (r Refable) MarshalJSON() ([]byte, error) { - return r.Ref.MarshalJSON() -} - -// UnmarshalJSON unmarshalss the ref from json -func (r *Refable) UnmarshalJSON(d []byte) error { - return json.Unmarshal(d, &r.Ref) -} - -// Ref represents a json reference that is potentially resolved -type Ref struct { - jsonreference.Ref -} - -// RemoteURI gets the remote uri part of the ref -func (r *Ref) RemoteURI() string { - if r.String() == "" { - return "" - } - - u := *r.GetURL() - u.Fragment = "" - return u.String() -} - -// IsValidURI returns true when the url the ref points to can be found -func (r *Ref) IsValidURI(basepaths ...string) bool { - if r.String() == "" { - return true - } - - v := r.RemoteURI() - if v == "" { - return true - } - - if r.HasFullURL { - //nolint:noctx,gosec - rr, err := http.Get(v) - if err != nil { - return false - } - defer rr.Body.Close() - - return rr.StatusCode/100 == 2 - } - - if !(r.HasFileScheme || r.HasFullFilePath || r.HasURLPathOnly) { - return false - } - - // check for local file - pth := v - if r.HasURLPathOnly { - base := "." - if len(basepaths) > 0 { - base = filepath.Dir(filepath.Join(basepaths...)) - } - p, e := filepath.Abs(filepath.ToSlash(filepath.Join(base, pth))) - if e != nil { - return false - } - pth = p - } - - fi, err := os.Stat(filepath.ToSlash(pth)) - if err != nil { - return false - } - - return !fi.IsDir() -} - -// Inherits creates a new reference from a parent and a child -// If the child cannot inherit from the parent, an error is returned -func (r *Ref) Inherits(child Ref) (*Ref, error) { - ref, err := r.Ref.Inherits(child.Ref) - if err != nil { - return nil, err - } - return &Ref{Ref: *ref}, nil -} - -// NewRef creates a new instance of a ref object -// returns an error when the reference uri is an invalid uri -func NewRef(refURI string) (Ref, error) { - ref, err := jsonreference.New(refURI) - if err != nil { - return Ref{}, err - } - return Ref{Ref: ref}, nil -} - -// MustCreateRef creates a ref object but panics when refURI is invalid. -// Use the NewRef method for a version that returns an error. -func MustCreateRef(refURI string) Ref { - return Ref{Ref: jsonreference.MustCreateRef(refURI)} -} - -// MarshalJSON marshals this ref into a JSON object -func (r Ref) MarshalJSON() ([]byte, error) { - str := r.String() - if str == "" { - if r.IsRoot() { - return []byte(`{"$ref":""}`), nil - } - return []byte("{}"), nil - } - v := map[string]interface{}{"$ref": str} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshals this ref from a JSON object -func (r *Ref) UnmarshalJSON(d []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(d, &v); err != nil { - return err - } - return r.fromMap(v) -} - -// GobEncode provides a safe gob encoder for Ref -func (r Ref) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw, err := r.MarshalJSON() - if err != nil { - return nil, err - } - err = gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Ref -func (r *Ref) GobDecode(b []byte) error { - var raw []byte - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - return json.Unmarshal(raw, r) -} - -func (r *Ref) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - - if vv, ok := v["$ref"]; ok { - if str, ok := vv.(string); ok { - ref, err := jsonreference.New(str) - if err != nil { - return err - } - *r = Ref{Ref: ref} - } - } - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/resolver.go b/vendor/github.com/go-openapi/spec/resolver.go deleted file mode 100644 index 47d1ee13fc..0000000000 --- a/vendor/github.com/go-openapi/spec/resolver.go +++ /dev/null @@ -1,127 +0,0 @@ -package spec - -import ( - "fmt" - - "github.com/go-openapi/swag" -) - -func resolveAnyWithBase(root interface{}, ref *Ref, result interface{}, options *ExpandOptions) error { - options = optionsOrDefault(options) - resolver := defaultSchemaLoader(root, options, nil, nil) - - if err := resolver.Resolve(ref, result, options.RelativeBase); err != nil { - return err - } - - return nil -} - -// ResolveRefWithBase resolves a reference against a context root with preservation of base path -func ResolveRefWithBase(root interface{}, ref *Ref, options *ExpandOptions) (*Schema, error) { - result := new(Schema) - - if err := resolveAnyWithBase(root, ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveRef resolves a reference for a schema against a context root -// ref is guaranteed to be in root (no need to go to external files) -// -// ResolveRef is ONLY called from the code generation module -func ResolveRef(root interface{}, ref *Ref) (*Schema, error) { - res, _, err := ref.GetPointer().Get(root) - if err != nil { - return nil, err - } - - switch sch := res.(type) { - case Schema: - return &sch, nil - case *Schema: - return sch, nil - case map[string]interface{}: - newSch := new(Schema) - if err = swag.DynamicJSONToStruct(sch, newSch); err != nil { - return nil, err - } - return newSch, nil - default: - return nil, fmt.Errorf("type: %T: %w", sch, ErrUnknownTypeForReference) - } -} - -// ResolveParameterWithBase resolves a parameter reference against a context root and base path -func ResolveParameterWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Parameter, error) { - result := new(Parameter) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveParameter resolves a parameter reference against a context root -func ResolveParameter(root interface{}, ref Ref) (*Parameter, error) { - return ResolveParameterWithBase(root, ref, nil) -} - -// ResolveResponseWithBase resolves response a reference against a context root and base path -func ResolveResponseWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Response, error) { - result := new(Response) - - err := resolveAnyWithBase(root, &ref, result, options) - if err != nil { - return nil, err - } - - return result, nil -} - -// ResolveResponse resolves response a reference against a context root -func ResolveResponse(root interface{}, ref Ref) (*Response, error) { - return ResolveResponseWithBase(root, ref, nil) -} - -// ResolvePathItemWithBase resolves response a path item against a context root and base path -func ResolvePathItemWithBase(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { - result := new(PathItem) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolvePathItem resolves response a path item against a context root and base path -// -// Deprecated: use ResolvePathItemWithBase instead -func ResolvePathItem(root interface{}, ref Ref, options *ExpandOptions) (*PathItem, error) { - return ResolvePathItemWithBase(root, ref, options) -} - -// ResolveItemsWithBase resolves parameter items reference against a context root and base path. -// -// NOTE: stricly speaking, this construct is not supported by Swagger 2.0. -// Similarly, $ref are forbidden in response headers. -func ResolveItemsWithBase(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { - result := new(Items) - - if err := resolveAnyWithBase(root, &ref, result, options); err != nil { - return nil, err - } - - return result, nil -} - -// ResolveItems resolves parameter items reference against a context root and base path. -// -// Deprecated: use ResolveItemsWithBase instead -func ResolveItems(root interface{}, ref Ref, options *ExpandOptions) (*Items, error) { - return ResolveItemsWithBase(root, ref, options) -} diff --git a/vendor/github.com/go-openapi/spec/response.go b/vendor/github.com/go-openapi/spec/response.go deleted file mode 100644 index 0340b60d84..0000000000 --- a/vendor/github.com/go-openapi/spec/response.go +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// ResponseProps properties specific to a response -type ResponseProps struct { - Description string `json:"description"` - Schema *Schema `json:"schema,omitempty"` - Headers map[string]Header `json:"headers,omitempty"` - Examples map[string]interface{} `json:"examples,omitempty"` -} - -// Response describes a single response from an API Operation. -// -// For more information: http://goo.gl/8us55a#responseObject -type Response struct { - Refable - ResponseProps - VendorExtensible -} - -// JSONLookup look up a value by the json property name -func (r Response) JSONLookup(token string) (interface{}, error) { - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if token == "$ref" { - return &r.Ref, nil - } - ptr, _, err := jsonpointer.GetForToken(r.ResponseProps, token) - return ptr, err -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Response) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponseProps); err != nil { - return err - } - if err := json.Unmarshal(data, &r.Refable); err != nil { - return err - } - return json.Unmarshal(data, &r.VendorExtensible) -} - -// MarshalJSON converts this items object to JSON -func (r Response) MarshalJSON() ([]byte, error) { - var ( - b1 []byte - err error - ) - - if r.Ref.String() == "" { - // when there is no $ref, empty description is rendered as an empty string - b1, err = json.Marshal(r.ResponseProps) - } else { - // when there is $ref inside the schema, description should be omitempty-ied - b1, err = json.Marshal(struct { - Description string `json:"description,omitempty"` - Schema *Schema `json:"schema,omitempty"` - Headers map[string]Header `json:"headers,omitempty"` - Examples map[string]interface{} `json:"examples,omitempty"` - }{ - Description: r.ResponseProps.Description, - Schema: r.ResponseProps.Schema, - Examples: r.ResponseProps.Examples, - }) - } - if err != nil { - return nil, err - } - - b2, err := json.Marshal(r.Refable) - if err != nil { - return nil, err - } - b3, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2, b3), nil -} - -// NewResponse creates a new response instance -func NewResponse() *Response { - return new(Response) -} - -// ResponseRef creates a response as a json reference -func ResponseRef(url string) *Response { - resp := NewResponse() - resp.Ref = MustCreateRef(url) - return resp -} - -// WithDescription sets the description on this response, allows for chaining -func (r *Response) WithDescription(description string) *Response { - r.Description = description - return r -} - -// WithSchema sets the schema on this response, allows for chaining. -// Passing a nil argument removes the schema from this response -func (r *Response) WithSchema(schema *Schema) *Response { - r.Schema = schema - return r -} - -// AddHeader adds a header to this response -func (r *Response) AddHeader(name string, header *Header) *Response { - if header == nil { - return r.RemoveHeader(name) - } - if r.Headers == nil { - r.Headers = make(map[string]Header) - } - r.Headers[name] = *header - return r -} - -// RemoveHeader removes a header from this response -func (r *Response) RemoveHeader(name string) *Response { - delete(r.Headers, name) - return r -} - -// AddExample adds an example to this response -func (r *Response) AddExample(mediaType string, example interface{}) *Response { - if r.Examples == nil { - r.Examples = make(map[string]interface{}) - } - r.Examples[mediaType] = example - return r -} diff --git a/vendor/github.com/go-openapi/spec/responses.go b/vendor/github.com/go-openapi/spec/responses.go deleted file mode 100644 index 16c3076fe8..0000000000 --- a/vendor/github.com/go-openapi/spec/responses.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" - "strings" - - "github.com/go-openapi/swag" -) - -// Responses is a container for the expected responses of an operation. -// The container maps a HTTP response code to the expected response. -// It is not expected from the documentation to necessarily cover all possible HTTP response codes, -// since they may not be known in advance. However, it is expected from the documentation to cover -// a successful operation response and any known errors. -// -// The `default` can be used a default response object for all HTTP codes that are not covered -// individually by the specification. -// -// The `Responses Object` MUST contain at least one response code, and it SHOULD be the response -// for a successful operation call. -// -// For more information: http://goo.gl/8us55a#responsesObject -type Responses struct { - VendorExtensible - ResponsesProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (r Responses) JSONLookup(token string) (interface{}, error) { - if token == "default" { - return r.Default, nil - } - if ex, ok := r.Extensions[token]; ok { - return &ex, nil - } - if i, err := strconv.Atoi(token); err == nil { - if scr, ok := r.StatusCodeResponses[i]; ok { - return scr, nil - } - } - return nil, fmt.Errorf("object has no field %q", token) -} - -// UnmarshalJSON hydrates this items instance with the data from JSON -func (r *Responses) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &r.ResponsesProps); err != nil { - return err - } - - if err := json.Unmarshal(data, &r.VendorExtensible); err != nil { - return err - } - if reflect.DeepEqual(ResponsesProps{}, r.ResponsesProps) { - r.ResponsesProps = ResponsesProps{} - } - return nil -} - -// MarshalJSON converts this items object to JSON -func (r Responses) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(r.ResponsesProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(r.VendorExtensible) - if err != nil { - return nil, err - } - concated := swag.ConcatJSON(b1, b2) - return concated, nil -} - -// ResponsesProps describes all responses for an operation. -// It tells what is the default response and maps all responses with a -// HTTP status code. -type ResponsesProps struct { - Default *Response - StatusCodeResponses map[int]Response -} - -// MarshalJSON marshals responses as JSON -func (r ResponsesProps) MarshalJSON() ([]byte, error) { - toser := map[string]Response{} - if r.Default != nil { - toser["default"] = *r.Default - } - for k, v := range r.StatusCodeResponses { - toser[strconv.Itoa(k)] = v - } - return json.Marshal(toser) -} - -// UnmarshalJSON unmarshals responses from JSON -func (r *ResponsesProps) UnmarshalJSON(data []byte) error { - var res map[string]json.RawMessage - if err := json.Unmarshal(data, &res); err != nil { - return err - } - - if v, ok := res["default"]; ok { - var defaultRes Response - if err := json.Unmarshal(v, &defaultRes); err != nil { - return err - } - r.Default = &defaultRes - delete(res, "default") - } - for k, v := range res { - if !strings.HasPrefix(k, "x-") { - var statusCodeResp Response - if err := json.Unmarshal(v, &statusCodeResp); err != nil { - return err - } - if nk, err := strconv.Atoi(k); err == nil { - if r.StatusCodeResponses == nil { - r.StatusCodeResponses = map[int]Response{} - } - r.StatusCodeResponses[nk] = statusCodeResp - } - } - } - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema.go b/vendor/github.com/go-openapi/spec/schema.go deleted file mode 100644 index 4e9be8576b..0000000000 --- a/vendor/github.com/go-openapi/spec/schema.go +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "strings" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// BooleanProperty creates a boolean property -func BooleanProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"boolean"}}} -} - -// BoolProperty creates a boolean property -func BoolProperty() *Schema { return BooleanProperty() } - -// StringProperty creates a string property -func StringProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// CharProperty creates a string property -func CharProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}}} -} - -// Float64Property creates a float64/double property -func Float64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "double"}} -} - -// Float32Property creates a float32/float property -func Float32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"number"}, Format: "float"}} -} - -// Int8Property creates an int8 property -func Int8Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int8"}} -} - -// Int16Property creates an int16 property -func Int16Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int16"}} -} - -// Int32Property creates an int32 property -func Int32Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int32"}} -} - -// Int64Property creates an int64 property -func Int64Property() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"integer"}, Format: "int64"}} -} - -// StrFmtProperty creates a property for the named string format -func StrFmtProperty(format string) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: format}} -} - -// DateProperty creates a date property -func DateProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date"}} -} - -// DateTimeProperty creates a date time property -func DateTimeProperty() *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"string"}, Format: "date-time"}} -} - -// MapProperty creates a map property -func MapProperty(property *Schema) *Schema { - return &Schema{SchemaProps: SchemaProps{Type: []string{"object"}, - AdditionalProperties: &SchemaOrBool{Allows: true, Schema: property}}} -} - -// RefProperty creates a ref property -func RefProperty(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// RefSchema creates a ref property -func RefSchema(name string) *Schema { - return &Schema{SchemaProps: SchemaProps{Ref: MustCreateRef(name)}} -} - -// ArrayProperty creates an array property -func ArrayProperty(items *Schema) *Schema { - if items == nil { - return &Schema{SchemaProps: SchemaProps{Type: []string{"array"}}} - } - return &Schema{SchemaProps: SchemaProps{Items: &SchemaOrArray{Schema: items}, Type: []string{"array"}}} -} - -// ComposedSchema creates a schema with allOf -func ComposedSchema(schemas ...Schema) *Schema { - s := new(Schema) - s.AllOf = schemas - return s -} - -// SchemaURL represents a schema url -type SchemaURL string - -// MarshalJSON marshal this to JSON -func (r SchemaURL) MarshalJSON() ([]byte, error) { - if r == "" { - return []byte("{}"), nil - } - v := map[string]interface{}{"$schema": string(r)} - return json.Marshal(v) -} - -// UnmarshalJSON unmarshal this from JSON -func (r *SchemaURL) UnmarshalJSON(data []byte) error { - var v map[string]interface{} - if err := json.Unmarshal(data, &v); err != nil { - return err - } - return r.fromMap(v) -} - -func (r *SchemaURL) fromMap(v map[string]interface{}) error { - if v == nil { - return nil - } - if vv, ok := v["$schema"]; ok { - if str, ok := vv.(string); ok { - u, err := parseURL(str) - if err != nil { - return err - } - - *r = SchemaURL(u.String()) - } - } - return nil -} - -// SchemaProps describes a JSON schema (draft 4) -type SchemaProps struct { - ID string `json:"id,omitempty"` - Ref Ref `json:"-"` - Schema SchemaURL `json:"-"` - Description string `json:"description,omitempty"` - Type StringOrArray `json:"type,omitempty"` - Nullable bool `json:"nullable,omitempty"` - Format string `json:"format,omitempty"` - Title string `json:"title,omitempty"` - Default interface{} `json:"default,omitempty"` - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` - Required []string `json:"required,omitempty"` - Items *SchemaOrArray `json:"items,omitempty"` - AllOf []Schema `json:"allOf,omitempty"` - OneOf []Schema `json:"oneOf,omitempty"` - AnyOf []Schema `json:"anyOf,omitempty"` - Not *Schema `json:"not,omitempty"` - Properties SchemaProperties `json:"properties,omitempty"` - AdditionalProperties *SchemaOrBool `json:"additionalProperties,omitempty"` - PatternProperties SchemaProperties `json:"patternProperties,omitempty"` - Dependencies Dependencies `json:"dependencies,omitempty"` - AdditionalItems *SchemaOrBool `json:"additionalItems,omitempty"` - Definitions Definitions `json:"definitions,omitempty"` -} - -// SwaggerSchemaProps are additional properties supported by swagger schemas, but not JSON-schema (draft 4) -type SwaggerSchemaProps struct { - Discriminator string `json:"discriminator,omitempty"` - ReadOnly bool `json:"readOnly,omitempty"` - XML *XMLObject `json:"xml,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` - Example interface{} `json:"example,omitempty"` -} - -// Schema the schema object allows the definition of input and output data types. -// These types can be objects, but also primitives and arrays. -// This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) -// and uses a predefined subset of it. -// On top of this subset, there are extensions provided by this specification to allow for more complete documentation. -// -// For more information: http://goo.gl/8us55a#schemaObject -type Schema struct { - VendorExtensible - SchemaProps - SwaggerSchemaProps - ExtraProps map[string]interface{} `json:"-"` -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s Schema) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - if ex, ok := s.ExtraProps[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SchemaProps, token) - if r != nil || (err != nil && !strings.HasPrefix(err.Error(), "object has no field")) { - return r, err - } - r, _, err = jsonpointer.GetForToken(s.SwaggerSchemaProps, token) - return r, err -} - -// WithID sets the id for this schema, allows for chaining -func (s *Schema) WithID(id string) *Schema { - s.ID = id - return s -} - -// WithTitle sets the title for this schema, allows for chaining -func (s *Schema) WithTitle(title string) *Schema { - s.Title = title - return s -} - -// WithDescription sets the description for this schema, allows for chaining -func (s *Schema) WithDescription(description string) *Schema { - s.Description = description - return s -} - -// WithProperties sets the properties for this schema -func (s *Schema) WithProperties(schemas map[string]Schema) *Schema { - s.Properties = schemas - return s -} - -// SetProperty sets a property on this schema -func (s *Schema) SetProperty(name string, schema Schema) *Schema { - if s.Properties == nil { - s.Properties = make(map[string]Schema) - } - s.Properties[name] = schema - return s -} - -// WithAllOf sets the all of property -func (s *Schema) WithAllOf(schemas ...Schema) *Schema { - s.AllOf = schemas - return s -} - -// WithMaxProperties sets the max number of properties an object can have -func (s *Schema) WithMaxProperties(max int64) *Schema { - s.MaxProperties = &max - return s -} - -// WithMinProperties sets the min number of properties an object must have -func (s *Schema) WithMinProperties(min int64) *Schema { - s.MinProperties = &min - return s -} - -// Typed sets the type of this schema for a single value item -func (s *Schema) Typed(tpe, format string) *Schema { - s.Type = []string{tpe} - s.Format = format - return s -} - -// AddType adds a type with potential format to the types for this schema -func (s *Schema) AddType(tpe, format string) *Schema { - s.Type = append(s.Type, tpe) - if format != "" { - s.Format = format - } - return s -} - -// AsNullable flags this schema as nullable. -func (s *Schema) AsNullable() *Schema { - s.Nullable = true - return s -} - -// CollectionOf a fluent builder method for an array parameter -func (s *Schema) CollectionOf(items Schema) *Schema { - s.Type = []string{jsonArray} - s.Items = &SchemaOrArray{Schema: &items} - return s -} - -// WithDefault sets the default value on this parameter -func (s *Schema) WithDefault(defaultValue interface{}) *Schema { - s.Default = defaultValue - return s -} - -// WithRequired flags this parameter as required -func (s *Schema) WithRequired(items ...string) *Schema { - s.Required = items - return s -} - -// AddRequired adds field names to the required properties array -func (s *Schema) AddRequired(items ...string) *Schema { - s.Required = append(s.Required, items...) - return s -} - -// WithMaxLength sets a max length value -func (s *Schema) WithMaxLength(max int64) *Schema { - s.MaxLength = &max - return s -} - -// WithMinLength sets a min length value -func (s *Schema) WithMinLength(min int64) *Schema { - s.MinLength = &min - return s -} - -// WithPattern sets a pattern value -func (s *Schema) WithPattern(pattern string) *Schema { - s.Pattern = pattern - return s -} - -// WithMultipleOf sets a multiple of value -func (s *Schema) WithMultipleOf(number float64) *Schema { - s.MultipleOf = &number - return s -} - -// WithMaximum sets a maximum number value -func (s *Schema) WithMaximum(max float64, exclusive bool) *Schema { - s.Maximum = &max - s.ExclusiveMaximum = exclusive - return s -} - -// WithMinimum sets a minimum number value -func (s *Schema) WithMinimum(min float64, exclusive bool) *Schema { - s.Minimum = &min - s.ExclusiveMinimum = exclusive - return s -} - -// WithEnum sets a the enum values (replace) -func (s *Schema) WithEnum(values ...interface{}) *Schema { - s.Enum = append([]interface{}{}, values...) - return s -} - -// WithMaxItems sets the max items -func (s *Schema) WithMaxItems(size int64) *Schema { - s.MaxItems = &size - return s -} - -// WithMinItems sets the min items -func (s *Schema) WithMinItems(size int64) *Schema { - s.MinItems = &size - return s -} - -// UniqueValues dictates that this array can only have unique items -func (s *Schema) UniqueValues() *Schema { - s.UniqueItems = true - return s -} - -// AllowDuplicates this array can have duplicates -func (s *Schema) AllowDuplicates() *Schema { - s.UniqueItems = false - return s -} - -// AddToAllOf adds a schema to the allOf property -func (s *Schema) AddToAllOf(schemas ...Schema) *Schema { - s.AllOf = append(s.AllOf, schemas...) - return s -} - -// WithDiscriminator sets the name of the discriminator field -func (s *Schema) WithDiscriminator(discriminator string) *Schema { - s.Discriminator = discriminator - return s -} - -// AsReadOnly flags this schema as readonly -func (s *Schema) AsReadOnly() *Schema { - s.ReadOnly = true - return s -} - -// AsWritable flags this schema as writeable (not read-only) -func (s *Schema) AsWritable() *Schema { - s.ReadOnly = false - return s -} - -// WithExample sets the example for this schema -func (s *Schema) WithExample(example interface{}) *Schema { - s.Example = example - return s -} - -// WithExternalDocs sets/removes the external docs for/from this schema. -// When you pass empty strings as params the external documents will be removed. -// When you pass non-empty string as one value then those values will be used on the external docs object. -// So when you pass a non-empty description, you should also pass the url and vice versa. -func (s *Schema) WithExternalDocs(description, url string) *Schema { - if description == "" && url == "" { - s.ExternalDocs = nil - return s - } - - if s.ExternalDocs == nil { - s.ExternalDocs = &ExternalDocumentation{} - } - s.ExternalDocs.Description = description - s.ExternalDocs.URL = url - return s -} - -// WithXMLName sets the xml name for the object -func (s *Schema) WithXMLName(name string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Name = name - return s -} - -// WithXMLNamespace sets the xml namespace for the object -func (s *Schema) WithXMLNamespace(namespace string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Namespace = namespace - return s -} - -// WithXMLPrefix sets the xml prefix for the object -func (s *Schema) WithXMLPrefix(prefix string) *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Prefix = prefix - return s -} - -// AsXMLAttribute flags this object as xml attribute -func (s *Schema) AsXMLAttribute() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = true - return s -} - -// AsXMLElement flags this object as an xml node -func (s *Schema) AsXMLElement() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Attribute = false - return s -} - -// AsWrappedXML flags this object as wrapped, this is mostly useful for array types -func (s *Schema) AsWrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = true - return s -} - -// AsUnwrappedXML flags this object as an xml node -func (s *Schema) AsUnwrappedXML() *Schema { - if s.XML == nil { - s.XML = new(XMLObject) - } - s.XML.Wrapped = false - return s -} - -// SetValidations defines all schema validations. -// -// NOTE: Required, ReadOnly, AllOf, AnyOf, OneOf and Not are not considered. -func (s *Schema) SetValidations(val SchemaValidations) { - s.Maximum = val.Maximum - s.ExclusiveMaximum = val.ExclusiveMaximum - s.Minimum = val.Minimum - s.ExclusiveMinimum = val.ExclusiveMinimum - s.MaxLength = val.MaxLength - s.MinLength = val.MinLength - s.Pattern = val.Pattern - s.MaxItems = val.MaxItems - s.MinItems = val.MinItems - s.UniqueItems = val.UniqueItems - s.MultipleOf = val.MultipleOf - s.Enum = val.Enum - s.MinProperties = val.MinProperties - s.MaxProperties = val.MaxProperties - s.PatternProperties = val.PatternProperties -} - -// WithValidations is a fluent method to set schema validations -func (s *Schema) WithValidations(val SchemaValidations) *Schema { - s.SetValidations(val) - return s -} - -// Validations returns a clone of the validations for this schema -func (s Schema) Validations() SchemaValidations { - return SchemaValidations{ - CommonValidations: CommonValidations{ - Maximum: s.Maximum, - ExclusiveMaximum: s.ExclusiveMaximum, - Minimum: s.Minimum, - ExclusiveMinimum: s.ExclusiveMinimum, - MaxLength: s.MaxLength, - MinLength: s.MinLength, - Pattern: s.Pattern, - MaxItems: s.MaxItems, - MinItems: s.MinItems, - UniqueItems: s.UniqueItems, - MultipleOf: s.MultipleOf, - Enum: s.Enum, - }, - MinProperties: s.MinProperties, - MaxProperties: s.MaxProperties, - PatternProperties: s.PatternProperties, - } -} - -// MarshalJSON marshal this to JSON -func (s Schema) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SchemaProps) - if err != nil { - return nil, fmt.Errorf("schema props %v", err) - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, fmt.Errorf("vendor props %v", err) - } - b3, err := s.Ref.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("ref prop %v", err) - } - b4, err := s.Schema.MarshalJSON() - if err != nil { - return nil, fmt.Errorf("schema prop %v", err) - } - b5, err := json.Marshal(s.SwaggerSchemaProps) - if err != nil { - return nil, fmt.Errorf("common validations %v", err) - } - var b6 []byte - if s.ExtraProps != nil { - jj, err := json.Marshal(s.ExtraProps) - if err != nil { - return nil, fmt.Errorf("extra props %v", err) - } - b6 = jj - } - return swag.ConcatJSON(b1, b2, b3, b4, b5, b6), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *Schema) UnmarshalJSON(data []byte) error { - props := struct { - SchemaProps - SwaggerSchemaProps - }{} - if err := json.Unmarshal(data, &props); err != nil { - return err - } - - sch := Schema{ - SchemaProps: props.SchemaProps, - SwaggerSchemaProps: props.SwaggerSchemaProps, - } - - var d map[string]interface{} - if err := json.Unmarshal(data, &d); err != nil { - return err - } - - _ = sch.Ref.fromMap(d) - _ = sch.Schema.fromMap(d) - - delete(d, "$ref") - delete(d, "$schema") - for _, pn := range swag.DefaultJSONNameProvider.GetJSONNames(s) { - delete(d, pn) - } - - for k, vv := range d { - lk := strings.ToLower(k) - if strings.HasPrefix(lk, "x-") { - if sch.Extensions == nil { - sch.Extensions = map[string]interface{}{} - } - sch.Extensions[k] = vv - continue - } - if sch.ExtraProps == nil { - sch.ExtraProps = map[string]interface{}{} - } - sch.ExtraProps[k] = vv - } - - *s = sch - - return nil -} diff --git a/vendor/github.com/go-openapi/spec/schema_loader.go b/vendor/github.com/go-openapi/spec/schema_loader.go deleted file mode 100644 index b81175afdf..0000000000 --- a/vendor/github.com/go-openapi/spec/schema_loader.go +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - "fmt" - "log" - "net/url" - "reflect" - "strings" - - "github.com/go-openapi/swag" -) - -// PathLoader is a function to use when loading remote refs. -// -// This is a package level default. It may be overridden or bypassed by -// specifying the loader in ExpandOptions. -// -// NOTE: if you are using the go-openapi/loads package, it will override -// this value with its own default (a loader to retrieve YAML documents as -// well as JSON ones). -var PathLoader = func(pth string) (json.RawMessage, error) { - data, err := swag.LoadFromFileOrHTTP(pth) - if err != nil { - return nil, err - } - return json.RawMessage(data), nil -} - -// resolverContext allows to share a context during spec processing. -// At the moment, it just holds the index of circular references found. -type resolverContext struct { - // circulars holds all visited circular references, to shortcircuit $ref resolution. - // - // This structure is privately instantiated and needs not be locked against - // concurrent access, unless we chose to implement a parallel spec walking. - circulars map[string]bool - basePath string - loadDoc func(string) (json.RawMessage, error) - rootID string -} - -func newResolverContext(options *ExpandOptions) *resolverContext { - expandOptions := optionsOrDefault(options) - - // path loader may be overridden by options - var loader func(string) (json.RawMessage, error) - if expandOptions.PathLoader == nil { - loader = PathLoader - } else { - loader = expandOptions.PathLoader - } - - return &resolverContext{ - circulars: make(map[string]bool), - basePath: expandOptions.RelativeBase, // keep the root base path in context - loadDoc: loader, - } -} - -type schemaLoader struct { - root interface{} - options *ExpandOptions - cache ResolutionCache - context *resolverContext -} - -func (r *schemaLoader) transitiveResolver(basePath string, ref Ref) *schemaLoader { - if ref.IsRoot() || ref.HasFragmentOnly { - return r - } - - baseRef := MustCreateRef(basePath) - currentRef := normalizeRef(&ref, basePath) - if strings.HasPrefix(currentRef.String(), baseRef.String()) { - return r - } - - // set a new root against which to resolve - rootURL := currentRef.GetURL() - rootURL.Fragment = "" - root, _ := r.cache.Get(rootURL.String()) - - // shallow copy of resolver options to set a new RelativeBase when - // traversing multiple documents - newOptions := r.options - newOptions.RelativeBase = rootURL.String() - - return defaultSchemaLoader(root, newOptions, r.cache, r.context) -} - -func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) string { - if transitive != r { - if transitive.options != nil && transitive.options.RelativeBase != "" { - return normalizeBase(transitive.options.RelativeBase) - } - } - - return basePath -} - -func (r *schemaLoader) resolveRef(ref *Ref, target interface{}, basePath string) error { - tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { - return ErrResolveRefNeedsAPointer - } - - if ref.GetURL() == nil { - return nil - } - - var ( - res interface{} - data interface{} - err error - ) - - // Resolve against the root if it isn't nil, and if ref is pointing at the root, or has a fragment only which means - // it is pointing somewhere in the root. - root := r.root - if (ref.IsRoot() || ref.HasFragmentOnly) && root == nil && basePath != "" { - if baseRef, erb := NewRef(basePath); erb == nil { - root, _, _, _ = r.load(baseRef.GetURL()) - } - } - - if (ref.IsRoot() || ref.HasFragmentOnly) && root != nil { - data = root - } else { - baseRef := normalizeRef(ref, basePath) - data, _, _, err = r.load(baseRef.GetURL()) - if err != nil { - return err - } - } - - res = data - if ref.String() != "" { - res, _, err = ref.GetPointer().Get(data) - if err != nil { - return err - } - } - return swag.DynamicJSONToStruct(res, target) -} - -func (r *schemaLoader) load(refURL *url.URL) (interface{}, url.URL, bool, error) { - debugLog("loading schema from url: %s", refURL) - toFetch := *refURL - toFetch.Fragment = "" - - var err error - pth := toFetch.String() - normalized := normalizeBase(pth) - debugLog("loading doc from: %s", normalized) - - unescaped, err := url.PathUnescape(normalized) - if err != nil { - return nil, url.URL{}, false, err - } - - u := url.URL{Path: unescaped} - - data, fromCache := r.cache.Get(u.RequestURI()) - if fromCache { - return data, toFetch, fromCache, nil - } - - b, err := r.context.loadDoc(normalized) - if err != nil { - return nil, url.URL{}, false, err - } - - var doc interface{} - if err := json.Unmarshal(b, &doc); err != nil { - return nil, url.URL{}, false, err - } - r.cache.Set(normalized, doc) - - return doc, toFetch, fromCache, nil -} - -// isCircular detects cycles in sequences of $ref. -// -// It relies on a private context (which needs not be locked). -func (r *schemaLoader) isCircular(ref *Ref, basePath string, parentRefs ...string) (foundCycle bool) { - normalizedRef := normalizeURI(ref.String(), basePath) - if _, ok := r.context.circulars[normalizedRef]; ok { - // circular $ref has been already detected in another explored cycle - foundCycle = true - return - } - foundCycle = swag.ContainsStrings(parentRefs, normalizedRef) // normalized windows url's are lower cased - if foundCycle { - r.context.circulars[normalizedRef] = true - } - return -} - -// Resolve resolves a reference against basePath and stores the result in target. -// -// Resolve is not in charge of following references: it only resolves ref by following its URL. -// -// If the schema the ref is referring to holds nested refs, Resolve doesn't resolve them. -// -// If basePath is an empty string, ref is resolved against the root schema stored in the schemaLoader struct -func (r *schemaLoader) Resolve(ref *Ref, target interface{}, basePath string) error { - return r.resolveRef(ref, target, basePath) -} - -func (r *schemaLoader) deref(input interface{}, parentRefs []string, basePath string) error { - var ref *Ref - switch refable := input.(type) { - case *Schema: - ref = &refable.Ref - case *Parameter: - ref = &refable.Ref - case *Response: - ref = &refable.Ref - case *PathItem: - ref = &refable.Ref - default: - return fmt.Errorf("unsupported type: %T: %w", input, ErrDerefUnsupportedType) - } - - curRef := ref.String() - if curRef == "" { - return nil - } - - normalizedRef := normalizeRef(ref, basePath) - normalizedBasePath := normalizedRef.RemoteURI() - - if r.isCircular(normalizedRef, basePath, parentRefs...) { - return nil - } - - if err := r.resolveRef(ref, input, basePath); r.shouldStopOnError(err) { - return err - } - - if ref.String() == "" || ref.String() == curRef { - // done with rereferencing - return nil - } - - parentRefs = append(parentRefs, normalizedRef.String()) - return r.deref(input, parentRefs, normalizedBasePath) -} - -func (r *schemaLoader) shouldStopOnError(err error) bool { - if err != nil && !r.options.ContinueOnError { - return true - } - - if err != nil { - log.Println(err) - } - - return false -} - -func (r *schemaLoader) setSchemaID(target interface{}, id, basePath string) (string, string) { - debugLog("schema has ID: %s", id) - - // handling the case when id is a folder - // remember that basePath has to point to a file - var refPath string - if strings.HasSuffix(id, "/") { - // ensure this is detected as a file, not a folder - refPath = fmt.Sprintf("%s%s", id, "placeholder.json") - } else { - refPath = id - } - - // updates the current base path - // * important: ID can be a relative path - // * registers target to be fetchable from the new base proposed by this id - newBasePath := normalizeURI(refPath, basePath) - - // store found IDs for possible future reuse in $ref - r.cache.Set(newBasePath, target) - - // the root document has an ID: all $ref relative to that ID may - // be rebased relative to the root document - if basePath == r.context.basePath { - debugLog("root document is a schema with ID: %s (normalized as:%s)", id, newBasePath) - r.context.rootID = newBasePath - } - - return newBasePath, refPath -} - -func defaultSchemaLoader( - root interface{}, - expandOptions *ExpandOptions, - cache ResolutionCache, - context *resolverContext) *schemaLoader { - - if expandOptions == nil { - expandOptions = &ExpandOptions{} - } - - cache = cacheOrDefault(cache) - - if expandOptions.RelativeBase == "" { - // if no relative base is provided, assume the root document - // contains all $ref, or at least, that the relative documents - // may be resolved from the current working directory. - expandOptions.RelativeBase = baseForRoot(root, cache) - } - debugLog("effective expander options: %#v", expandOptions) - - if context == nil { - context = newResolverContext(expandOptions) - } - - return &schemaLoader{ - root: root, - options: expandOptions, - cache: cache, - context: context, - } -} diff --git a/vendor/github.com/go-openapi/spec/security_scheme.go b/vendor/github.com/go-openapi/spec/security_scheme.go deleted file mode 100644 index 9d0bdae908..0000000000 --- a/vendor/github.com/go-openapi/spec/security_scheme.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -const ( - basic = "basic" - apiKey = "apiKey" - oauth2 = "oauth2" - implicit = "implicit" - password = "password" - application = "application" - accessCode = "accessCode" -) - -// BasicAuth creates a basic auth security scheme -func BasicAuth() *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: basic}} -} - -// APIKeyAuth creates an api key auth security scheme -func APIKeyAuth(fieldName, valueSource string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{Type: apiKey, Name: fieldName, In: valueSource}} -} - -// OAuth2Implicit creates an implicit flow oauth2 security scheme -func OAuth2Implicit(authorizationURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: implicit, - AuthorizationURL: authorizationURL, - }} -} - -// OAuth2Password creates a password flow oauth2 security scheme -func OAuth2Password(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: password, - TokenURL: tokenURL, - }} -} - -// OAuth2Application creates an application flow oauth2 security scheme -func OAuth2Application(tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: application, - TokenURL: tokenURL, - }} -} - -// OAuth2AccessToken creates an access token flow oauth2 security scheme -func OAuth2AccessToken(authorizationURL, tokenURL string) *SecurityScheme { - return &SecurityScheme{SecuritySchemeProps: SecuritySchemeProps{ - Type: oauth2, - Flow: accessCode, - AuthorizationURL: authorizationURL, - TokenURL: tokenURL, - }} -} - -// SecuritySchemeProps describes a swagger security scheme in the securityDefinitions section -type SecuritySchemeProps struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl"` // oauth2 - TokenURL string `json:"tokenUrl,omitempty"` // oauth2 - Scopes map[string]string `json:"scopes,omitempty"` // oauth2 -} - -// AddScope adds a scope to this security scheme -func (s *SecuritySchemeProps) AddScope(scope, description string) { - if s.Scopes == nil { - s.Scopes = make(map[string]string) - } - s.Scopes[scope] = description -} - -// SecurityScheme allows the definition of a security scheme that can be used by the operations. -// Supported schemes are basic authentication, an API key (either as a header or as a query parameter) -// and OAuth2's common flows (implicit, password, application and access code). -// -// For more information: http://goo.gl/8us55a#securitySchemeObject -type SecurityScheme struct { - VendorExtensible - SecuritySchemeProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SecurityScheme) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(s.SecuritySchemeProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (s SecurityScheme) MarshalJSON() ([]byte, error) { - var ( - b1 []byte - err error - ) - - if s.Type == oauth2 && (s.Flow == "implicit" || s.Flow == "accessCode") { - // when oauth2 for implicit or accessCode flows, empty AuthorizationURL is added as empty string - b1, err = json.Marshal(s.SecuritySchemeProps) - } else { - // when not oauth2, empty AuthorizationURL should be omitted - b1, err = json.Marshal(struct { - Description string `json:"description,omitempty"` - Type string `json:"type"` - Name string `json:"name,omitempty"` // api key - In string `json:"in,omitempty"` // api key - Flow string `json:"flow,omitempty"` // oauth2 - AuthorizationURL string `json:"authorizationUrl,omitempty"` // oauth2 - TokenURL string `json:"tokenUrl,omitempty"` // oauth2 - Scopes map[string]string `json:"scopes,omitempty"` // oauth2 - }{ - Description: s.Description, - Type: s.Type, - Name: s.Name, - In: s.In, - Flow: s.Flow, - AuthorizationURL: s.AuthorizationURL, - TokenURL: s.TokenURL, - Scopes: s.Scopes, - }) - } - if err != nil { - return nil, err - } - - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (s *SecurityScheme) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &s.SecuritySchemeProps); err != nil { - return err - } - return json.Unmarshal(data, &s.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/spec.go b/vendor/github.com/go-openapi/spec/spec.go deleted file mode 100644 index 7d38b6e625..0000000000 --- a/vendor/github.com/go-openapi/spec/spec.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" -) - -//go:generate curl -L --progress -o ./schemas/v2/schema.json http://swagger.io/v2/schema.json -//go:generate curl -L --progress -o ./schemas/jsonschema-draft-04.json http://json-schema.org/draft-04/schema -//go:generate go-bindata -pkg=spec -prefix=./schemas -ignore=.*\.md ./schemas/... -//go:generate perl -pi -e s,Json,JSON,g bindata.go - -const ( - // SwaggerSchemaURL the url for the swagger 2.0 schema to validate specs - SwaggerSchemaURL = "http://swagger.io/v2/schema.json#" - // JSONSchemaURL the url for the json schema schema - JSONSchemaURL = "http://json-schema.org/draft-04/schema#" -) - -// MustLoadJSONSchemaDraft04 panics when Swagger20Schema returns an error -func MustLoadJSONSchemaDraft04() *Schema { - d, e := JSONSchemaDraft04() - if e != nil { - panic(e) - } - return d -} - -// JSONSchemaDraft04 loads the json schema document for json shema draft04 -func JSONSchemaDraft04() (*Schema, error) { - b, err := Asset("jsonschema-draft-04.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} - -// MustLoadSwagger20Schema panics when Swagger20Schema returns an error -func MustLoadSwagger20Schema() *Schema { - d, e := Swagger20Schema() - if e != nil { - panic(e) - } - return d -} - -// Swagger20Schema loads the swagger 2.0 schema from the embedded assets -func Swagger20Schema() (*Schema, error) { - - b, err := Asset("v2/schema.json") - if err != nil { - return nil, err - } - - schema := new(Schema) - if err := json.Unmarshal(b, schema); err != nil { - return nil, err - } - return schema, nil -} diff --git a/vendor/github.com/go-openapi/spec/swagger.go b/vendor/github.com/go-openapi/spec/swagger.go deleted file mode 100644 index 44722ffd5a..0000000000 --- a/vendor/github.com/go-openapi/spec/swagger.go +++ /dev/null @@ -1,448 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "bytes" - "encoding/gob" - "encoding/json" - "fmt" - "strconv" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// Swagger this is the root document object for the API specification. -// It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) -// together into one document. -// -// For more information: http://goo.gl/8us55a#swagger-object- -type Swagger struct { - VendorExtensible - SwaggerProps -} - -// JSONLookup look up a value by the json property name -func (s Swagger) JSONLookup(token string) (interface{}, error) { - if ex, ok := s.Extensions[token]; ok { - return &ex, nil - } - r, _, err := jsonpointer.GetForToken(s.SwaggerProps, token) - return r, err -} - -// MarshalJSON marshals this swagger structure to json -func (s Swagger) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(s.SwaggerProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(s.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON unmarshals a swagger spec from json -func (s *Swagger) UnmarshalJSON(data []byte) error { - var sw Swagger - if err := json.Unmarshal(data, &sw.SwaggerProps); err != nil { - return err - } - if err := json.Unmarshal(data, &sw.VendorExtensible); err != nil { - return err - } - *s = sw - return nil -} - -// GobEncode provides a safe gob encoder for Swagger, including extensions -func (s Swagger) GobEncode() ([]byte, error) { - var b bytes.Buffer - raw := struct { - Props SwaggerProps - Ext VendorExtensible - }{ - Props: s.SwaggerProps, - Ext: s.VendorExtensible, - } - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for Swagger, including extensions -func (s *Swagger) GobDecode(b []byte) error { - var raw struct { - Props SwaggerProps - Ext VendorExtensible - } - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - s.SwaggerProps = raw.Props - s.VendorExtensible = raw.Ext - return nil -} - -// SwaggerProps captures the top-level properties of an Api specification -// -// NOTE: validation rules -// - the scheme, when present must be from [http, https, ws, wss] -// - BasePath must start with a leading "/" -// - Paths is required -type SwaggerProps struct { - ID string `json:"id,omitempty"` - Consumes []string `json:"consumes,omitempty"` - Produces []string `json:"produces,omitempty"` - Schemes []string `json:"schemes,omitempty"` - Swagger string `json:"swagger,omitempty"` - Info *Info `json:"info,omitempty"` - Host string `json:"host,omitempty"` - BasePath string `json:"basePath,omitempty"` - Paths *Paths `json:"paths"` - Definitions Definitions `json:"definitions,omitempty"` - Parameters map[string]Parameter `json:"parameters,omitempty"` - Responses map[string]Response `json:"responses,omitempty"` - SecurityDefinitions SecurityDefinitions `json:"securityDefinitions,omitempty"` - Security []map[string][]string `json:"security,omitempty"` - Tags []Tag `json:"tags,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -type swaggerPropsAlias SwaggerProps - -type gobSwaggerPropsAlias struct { - Security []map[string]struct { - List []string - Pad bool - } - Alias *swaggerPropsAlias - SecurityIsEmpty bool -} - -// GobEncode provides a safe gob encoder for SwaggerProps, including empty security requirements -func (o SwaggerProps) GobEncode() ([]byte, error) { - raw := gobSwaggerPropsAlias{ - Alias: (*swaggerPropsAlias)(&o), - } - - var b bytes.Buffer - if o.Security == nil { - // nil security requirement - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - if len(o.Security) == 0 { - // empty, but non-nil security requirement - raw.SecurityIsEmpty = true - raw.Alias.Security = nil - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err - } - - raw.Security = make([]map[string]struct { - List []string - Pad bool - }, 0, len(o.Security)) - for _, req := range o.Security { - v := make(map[string]struct { - List []string - Pad bool - }, len(req)) - for k, val := range req { - v[k] = struct { - List []string - Pad bool - }{ - List: val, - } - } - raw.Security = append(raw.Security, v) - } - - err := gob.NewEncoder(&b).Encode(raw) - return b.Bytes(), err -} - -// GobDecode provides a safe gob decoder for SwaggerProps, including empty security requirements -func (o *SwaggerProps) GobDecode(b []byte) error { - var raw gobSwaggerPropsAlias - - buf := bytes.NewBuffer(b) - err := gob.NewDecoder(buf).Decode(&raw) - if err != nil { - return err - } - if raw.Alias == nil { - return nil - } - - switch { - case raw.SecurityIsEmpty: - // empty, but non-nil security requirement - raw.Alias.Security = []map[string][]string{} - case len(raw.Alias.Security) == 0: - // nil security requirement - raw.Alias.Security = nil - default: - raw.Alias.Security = make([]map[string][]string, 0, len(raw.Security)) - for _, req := range raw.Security { - v := make(map[string][]string, len(req)) - for k, val := range req { - v[k] = make([]string, 0, len(val.List)) - v[k] = append(v[k], val.List...) - } - raw.Alias.Security = append(raw.Alias.Security, v) - } - } - - *o = *(*SwaggerProps)(raw.Alias) - return nil -} - -// Dependencies represent a dependencies property -type Dependencies map[string]SchemaOrStringArray - -// SchemaOrBool represents a schema or boolean value, is biased towards true for the boolean property -type SchemaOrBool struct { - Allows bool - Schema *Schema -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrBool) JSONLookup(token string) (interface{}, error) { - if token == "allows" { - return s.Allows, nil - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -var jsTrue = []byte("true") -var jsFalse = []byte("false") - -// MarshalJSON convert this object to JSON -func (s SchemaOrBool) MarshalJSON() ([]byte, error) { - if s.Schema != nil { - return json.Marshal(s.Schema) - } - - if s.Schema == nil && !s.Allows { - return jsFalse, nil - } - return jsTrue, nil -} - -// UnmarshalJSON converts this bool or schema object from a JSON structure -func (s *SchemaOrBool) UnmarshalJSON(data []byte) error { - var nw SchemaOrBool - if len(data) >= 4 { - if data[0] == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - nw.Allows = !(data[0] == 'f' && data[1] == 'a' && data[2] == 'l' && data[3] == 's' && data[4] == 'e') - } - *s = nw - return nil -} - -// SchemaOrStringArray represents a schema or a string array -type SchemaOrStringArray struct { - Schema *Schema - Property []string -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrStringArray) JSONLookup(token string) (interface{}, error) { - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrStringArray) MarshalJSON() ([]byte, error) { - if len(s.Property) > 0 { - return json.Marshal(s.Property) - } - if s.Schema != nil { - return json.Marshal(s.Schema) - } - return []byte("null"), nil -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrStringArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - var nw SchemaOrStringArray - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Property); err != nil { - return err - } - } - *s = nw - return nil -} - -// Definitions contains the models explicitly defined in this spec -// An object to hold data types that can be consumed and produced by operations. -// These data types can be primitives, arrays or models. -// -// For more information: http://goo.gl/8us55a#definitionsObject -type Definitions map[string]Schema - -// SecurityDefinitions a declaration of the security schemes available to be used in the specification. -// This does not enforce the security schemes on the operations and only serves to provide -// the relevant details for each scheme. -// -// For more information: http://goo.gl/8us55a#securityDefinitionsObject -type SecurityDefinitions map[string]*SecurityScheme - -// StringOrArray represents a value that can either be a string -// or an array of strings. Mainly here for serialization purposes -type StringOrArray []string - -// Contains returns true when the value is contained in the slice -func (s StringOrArray) Contains(value string) bool { - for _, str := range s { - if str == value { - return true - } - } - return false -} - -// JSONLookup implements an interface to customize json pointer lookup -func (s SchemaOrArray) JSONLookup(token string) (interface{}, error) { - if _, err := strconv.Atoi(token); err == nil { - r, _, err := jsonpointer.GetForToken(s.Schemas, token) - return r, err - } - r, _, err := jsonpointer.GetForToken(s.Schema, token) - return r, err -} - -// UnmarshalJSON unmarshals this string or array object from a JSON array or JSON string -func (s *StringOrArray) UnmarshalJSON(data []byte) error { - var first byte - if len(data) > 1 { - first = data[0] - } - - if first == '[' { - var parsed []string - if err := json.Unmarshal(data, &parsed); err != nil { - return err - } - *s = StringOrArray(parsed) - return nil - } - - var single interface{} - if err := json.Unmarshal(data, &single); err != nil { - return err - } - if single == nil { - return nil - } - switch v := single.(type) { - case string: - *s = StringOrArray([]string{v}) - return nil - default: - return fmt.Errorf("only string or array is allowed, not %T", single) - } -} - -// MarshalJSON converts this string or array to a JSON array or JSON string -func (s StringOrArray) MarshalJSON() ([]byte, error) { - if len(s) == 1 { - return json.Marshal([]string(s)[0]) - } - return json.Marshal([]string(s)) -} - -// SchemaOrArray represents a value that can either be a Schema -// or an array of Schema. Mainly here for serialization purposes -type SchemaOrArray struct { - Schema *Schema - Schemas []Schema -} - -// Len returns the number of schemas in this property -func (s SchemaOrArray) Len() int { - if s.Schema != nil { - return 1 - } - return len(s.Schemas) -} - -// ContainsType returns true when one of the schemas is of the specified type -func (s *SchemaOrArray) ContainsType(name string) bool { - if s.Schema != nil { - return s.Schema.Type != nil && s.Schema.Type.Contains(name) - } - return false -} - -// MarshalJSON converts this schema object or array into JSON structure -func (s SchemaOrArray) MarshalJSON() ([]byte, error) { - if len(s.Schemas) > 0 { - return json.Marshal(s.Schemas) - } - return json.Marshal(s.Schema) -} - -// UnmarshalJSON converts this schema object or array from a JSON structure -func (s *SchemaOrArray) UnmarshalJSON(data []byte) error { - var nw SchemaOrArray - var first byte - if len(data) > 1 { - first = data[0] - } - if first == '{' { - var sch Schema - if err := json.Unmarshal(data, &sch); err != nil { - return err - } - nw.Schema = &sch - } - if first == '[' { - if err := json.Unmarshal(data, &nw.Schemas); err != nil { - return err - } - } - *s = nw - return nil -} - -// vim:set ft=go noet sts=2 sw=2 ts=2: diff --git a/vendor/github.com/go-openapi/spec/tag.go b/vendor/github.com/go-openapi/spec/tag.go deleted file mode 100644 index faa3d3de1e..0000000000 --- a/vendor/github.com/go-openapi/spec/tag.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -import ( - "encoding/json" - - "github.com/go-openapi/jsonpointer" - "github.com/go-openapi/swag" -) - -// TagProps describe a tag entry in the top level tags section of a swagger spec -type TagProps struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"` -} - -// NewTag creates a new tag -func NewTag(name, description string, externalDocs *ExternalDocumentation) Tag { - return Tag{TagProps: TagProps{Description: description, Name: name, ExternalDocs: externalDocs}} -} - -// Tag allows adding meta data to a single tag that is used by the -// [Operation Object](http://goo.gl/8us55a#operationObject). -// It is not mandatory to have a Tag Object per tag used there. -// -// For more information: http://goo.gl/8us55a#tagObject -type Tag struct { - VendorExtensible - TagProps -} - -// JSONLookup implements an interface to customize json pointer lookup -func (t Tag) JSONLookup(token string) (interface{}, error) { - if ex, ok := t.Extensions[token]; ok { - return &ex, nil - } - - r, _, err := jsonpointer.GetForToken(t.TagProps, token) - return r, err -} - -// MarshalJSON marshal this to JSON -func (t Tag) MarshalJSON() ([]byte, error) { - b1, err := json.Marshal(t.TagProps) - if err != nil { - return nil, err - } - b2, err := json.Marshal(t.VendorExtensible) - if err != nil { - return nil, err - } - return swag.ConcatJSON(b1, b2), nil -} - -// UnmarshalJSON marshal this from JSON -func (t *Tag) UnmarshalJSON(data []byte) error { - if err := json.Unmarshal(data, &t.TagProps); err != nil { - return err - } - return json.Unmarshal(data, &t.VendorExtensible) -} diff --git a/vendor/github.com/go-openapi/spec/url_go18.go b/vendor/github.com/go-openapi/spec/url_go18.go deleted file mode 100644 index 60b7851536..0000000000 --- a/vendor/github.com/go-openapi/spec/url_go18.go +++ /dev/null @@ -1,8 +0,0 @@ -//go:build !go1.19 -// +build !go1.19 - -package spec - -import "net/url" - -var parseURL = url.Parse diff --git a/vendor/github.com/go-openapi/spec/url_go19.go b/vendor/github.com/go-openapi/spec/url_go19.go deleted file mode 100644 index 392e3e6395..0000000000 --- a/vendor/github.com/go-openapi/spec/url_go19.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build go1.19 -// +build go1.19 - -package spec - -import "net/url" - -func parseURL(s string) (*url.URL, error) { - u, err := url.Parse(s) - if err == nil { - u.OmitHost = false - } - return u, err -} diff --git a/vendor/github.com/go-openapi/spec/validations.go b/vendor/github.com/go-openapi/spec/validations.go deleted file mode 100644 index 6360a8ea77..0000000000 --- a/vendor/github.com/go-openapi/spec/validations.go +++ /dev/null @@ -1,215 +0,0 @@ -package spec - -// CommonValidations describe common JSON-schema validations -type CommonValidations struct { - Maximum *float64 `json:"maximum,omitempty"` - ExclusiveMaximum bool `json:"exclusiveMaximum,omitempty"` - Minimum *float64 `json:"minimum,omitempty"` - ExclusiveMinimum bool `json:"exclusiveMinimum,omitempty"` - MaxLength *int64 `json:"maxLength,omitempty"` - MinLength *int64 `json:"minLength,omitempty"` - Pattern string `json:"pattern,omitempty"` - MaxItems *int64 `json:"maxItems,omitempty"` - MinItems *int64 `json:"minItems,omitempty"` - UniqueItems bool `json:"uniqueItems,omitempty"` - MultipleOf *float64 `json:"multipleOf,omitempty"` - Enum []interface{} `json:"enum,omitempty"` -} - -// SetValidations defines all validations for a simple schema. -// -// NOTE: the input is the larger set of validations available for schemas. -// For simple schemas, MinProperties and MaxProperties are ignored. -func (v *CommonValidations) SetValidations(val SchemaValidations) { - v.Maximum = val.Maximum - v.ExclusiveMaximum = val.ExclusiveMaximum - v.Minimum = val.Minimum - v.ExclusiveMinimum = val.ExclusiveMinimum - v.MaxLength = val.MaxLength - v.MinLength = val.MinLength - v.Pattern = val.Pattern - v.MaxItems = val.MaxItems - v.MinItems = val.MinItems - v.UniqueItems = val.UniqueItems - v.MultipleOf = val.MultipleOf - v.Enum = val.Enum -} - -type clearedValidation struct { - Validation string - Value interface{} -} - -type clearedValidations []clearedValidation - -func (c clearedValidations) apply(cbs []func(string, interface{})) { - for _, cb := range cbs { - for _, cleared := range c { - cb(cleared.Validation, cleared.Value) - } - } -} - -// ClearNumberValidations clears all number validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearNumberValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 5) - defer func() { - done.apply(cbs) - }() - - if v.Minimum != nil { - done = append(done, clearedValidation{Validation: "minimum", Value: v.Minimum}) - v.Minimum = nil - } - if v.Maximum != nil { - done = append(done, clearedValidation{Validation: "maximum", Value: v.Maximum}) - v.Maximum = nil - } - if v.ExclusiveMaximum { - done = append(done, clearedValidation{Validation: "exclusiveMaximum", Value: v.ExclusiveMaximum}) - v.ExclusiveMaximum = false - } - if v.ExclusiveMinimum { - done = append(done, clearedValidation{Validation: "exclusiveMinimum", Value: v.ExclusiveMinimum}) - v.ExclusiveMinimum = false - } - if v.MultipleOf != nil { - done = append(done, clearedValidation{Validation: "multipleOf", Value: v.MultipleOf}) - v.MultipleOf = nil - } -} - -// ClearStringValidations clears all string validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearStringValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.Pattern != "" { - done = append(done, clearedValidation{Validation: "pattern", Value: v.Pattern}) - v.Pattern = "" - } - if v.MinLength != nil { - done = append(done, clearedValidation{Validation: "minLength", Value: v.MinLength}) - v.MinLength = nil - } - if v.MaxLength != nil { - done = append(done, clearedValidation{Validation: "maxLength", Value: v.MaxLength}) - v.MaxLength = nil - } -} - -// ClearArrayValidations clears all array validations. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *CommonValidations) ClearArrayValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.MaxItems != nil { - done = append(done, clearedValidation{Validation: "maxItems", Value: v.MaxItems}) - v.MaxItems = nil - } - if v.MinItems != nil { - done = append(done, clearedValidation{Validation: "minItems", Value: v.MinItems}) - v.MinItems = nil - } - if v.UniqueItems { - done = append(done, clearedValidation{Validation: "uniqueItems", Value: v.UniqueItems}) - v.UniqueItems = false - } -} - -// Validations returns a clone of the validations for a simple schema. -// -// NOTE: in the context of simple schema objects, MinProperties, MaxProperties -// and PatternProperties remain unset. -func (v CommonValidations) Validations() SchemaValidations { - return SchemaValidations{ - CommonValidations: v, - } -} - -// HasNumberValidations indicates if the validations are for numbers or integers -func (v CommonValidations) HasNumberValidations() bool { - return v.Maximum != nil || v.Minimum != nil || v.MultipleOf != nil -} - -// HasStringValidations indicates if the validations are for strings -func (v CommonValidations) HasStringValidations() bool { - return v.MaxLength != nil || v.MinLength != nil || v.Pattern != "" -} - -// HasArrayValidations indicates if the validations are for arrays -func (v CommonValidations) HasArrayValidations() bool { - return v.MaxItems != nil || v.MinItems != nil || v.UniqueItems -} - -// HasEnum indicates if the validation includes some enum constraint -func (v CommonValidations) HasEnum() bool { - return len(v.Enum) > 0 -} - -// SchemaValidations describes the validation properties of a schema -// -// NOTE: at this moment, this is not embedded in SchemaProps because this would induce a breaking change -// in the exported members: all initializers using litterals would fail. -type SchemaValidations struct { - CommonValidations - - PatternProperties SchemaProperties `json:"patternProperties,omitempty"` - MaxProperties *int64 `json:"maxProperties,omitempty"` - MinProperties *int64 `json:"minProperties,omitempty"` -} - -// HasObjectValidations indicates if the validations are for objects -func (v SchemaValidations) HasObjectValidations() bool { - return v.MaxProperties != nil || v.MinProperties != nil || v.PatternProperties != nil -} - -// SetValidations for schema validations -func (v *SchemaValidations) SetValidations(val SchemaValidations) { - v.CommonValidations.SetValidations(val) - v.PatternProperties = val.PatternProperties - v.MaxProperties = val.MaxProperties - v.MinProperties = val.MinProperties -} - -// Validations for a schema -func (v SchemaValidations) Validations() SchemaValidations { - val := v.CommonValidations.Validations() - val.PatternProperties = v.PatternProperties - val.MinProperties = v.MinProperties - val.MaxProperties = v.MaxProperties - return val -} - -// ClearObjectValidations returns a clone of the validations with all object validations cleared. -// -// Some callbacks may be set by the caller to capture changed values. -func (v *SchemaValidations) ClearObjectValidations(cbs ...func(string, interface{})) { - done := make(clearedValidations, 0, 3) - defer func() { - done.apply(cbs) - }() - - if v.MaxProperties != nil { - done = append(done, clearedValidation{Validation: "maxProperties", Value: v.MaxProperties}) - v.MaxProperties = nil - } - if v.MinProperties != nil { - done = append(done, clearedValidation{Validation: "minProperties", Value: v.MinProperties}) - v.MinProperties = nil - } - if v.PatternProperties != nil { - done = append(done, clearedValidation{Validation: "patternProperties", Value: v.PatternProperties}) - v.PatternProperties = nil - } -} diff --git a/vendor/github.com/go-openapi/spec/xml_object.go b/vendor/github.com/go-openapi/spec/xml_object.go deleted file mode 100644 index 945a46703d..0000000000 --- a/vendor/github.com/go-openapi/spec/xml_object.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package spec - -// XMLObject a metadata object that allows for more fine-tuned XML model definitions. -// -// For more information: http://goo.gl/8us55a#xmlObject -type XMLObject struct { - Name string `json:"name,omitempty"` - Namespace string `json:"namespace,omitempty"` - Prefix string `json:"prefix,omitempty"` - Attribute bool `json:"attribute,omitempty"` - Wrapped bool `json:"wrapped,omitempty"` -} - -// WithName sets the xml name for the object -func (x *XMLObject) WithName(name string) *XMLObject { - x.Name = name - return x -} - -// WithNamespace sets the xml namespace for the object -func (x *XMLObject) WithNamespace(namespace string) *XMLObject { - x.Namespace = namespace - return x -} - -// WithPrefix sets the xml prefix for the object -func (x *XMLObject) WithPrefix(prefix string) *XMLObject { - x.Prefix = prefix - return x -} - -// AsAttribute flags this object as xml attribute -func (x *XMLObject) AsAttribute() *XMLObject { - x.Attribute = true - return x -} - -// AsElement flags this object as an xml node -func (x *XMLObject) AsElement() *XMLObject { - x.Attribute = false - return x -} - -// AsWrapped flags this object as wrapped, this is mostly useful for array types -func (x *XMLObject) AsWrapped() *XMLObject { - x.Wrapped = true - return x -} - -// AsUnwrapped flags this object as an xml node -func (x *XMLObject) AsUnwrapped() *XMLObject { - x.Wrapped = false - return x -} diff --git a/vendor/github.com/go-openapi/strfmt/.editorconfig b/vendor/github.com/go-openapi/strfmt/.editorconfig deleted file mode 100644 index 3152da69a5..0000000000 --- a/vendor/github.com/go-openapi/strfmt/.editorconfig +++ /dev/null @@ -1,26 +0,0 @@ -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -end_of_line = lf -insert_final_newline = true -indent_style = space -indent_size = 2 -trim_trailing_whitespace = true - -# Set default charset -[*.{js,py,go,scala,rb,java,html,css,less,sass,md}] -charset = utf-8 - -# Tab indentation (no size specified) -[*.go] -indent_style = tab - -[*.md] -trim_trailing_whitespace = false - -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] -indent_style = space -indent_size = 2 diff --git a/vendor/github.com/go-openapi/strfmt/.gitattributes b/vendor/github.com/go-openapi/strfmt/.gitattributes deleted file mode 100644 index d020be8ea4..0000000000 --- a/vendor/github.com/go-openapi/strfmt/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.go text eol=lf - diff --git a/vendor/github.com/go-openapi/strfmt/.gitignore b/vendor/github.com/go-openapi/strfmt/.gitignore deleted file mode 100644 index dd91ed6a04..0000000000 --- a/vendor/github.com/go-openapi/strfmt/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -secrets.yml -coverage.out diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml deleted file mode 100644 index be4899cb12..0000000000 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ /dev/null @@ -1,59 +0,0 @@ -linters-settings: - govet: - check-shadowing: true - golint: - min-confidence: 0 - gocyclo: - min-complexity: 31 - maligned: - suggest-new: true - dupl: - threshold: 100 - goconst: - min-len: 2 - min-occurrences: 4 - -linters: - enable: - - revive - - goimports - - gosec - - unparam - - unconvert - - predeclared - - prealloc - - misspell - - # disable: - # - maligned - # - lll - # - gochecknoinits - # - gochecknoglobals - # - godox - # - gocognit - # - whitespace - # - wsl - # - funlen - # - wrapcheck - # - testpackage - # - nlreturn - # - gofumpt - # - goerr113 - # - gci - # - gomnd - # - godot - # - exhaustivestruct - # - paralleltest - # - varnamelen - # - ireturn - # - exhaustruct - # #- thelper - -issues: - exclude-rules: - - path: bson.go - text: "should be .*ObjectID" - linters: - - golint - - stylecheck - diff --git a/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md b/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md deleted file mode 100644 index 9322b065e3..0000000000 --- a/vendor/github.com/go-openapi/strfmt/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,74 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of experience, -nationality, personal appearance, race, religion, or sexual identity and -orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or -advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at ivan+abuse@flanders.co.nz. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at [http://contributor-covenant.org/version/1/4][version] - -[homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/4/ diff --git a/vendor/github.com/go-openapi/strfmt/LICENSE b/vendor/github.com/go-openapi/strfmt/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/go-openapi/strfmt/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md deleted file mode 100644 index 0cf89d7766..0000000000 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Strfmt [![Build Status](https://travis-ci.org/go-openapi/strfmt.svg?branch=master)](https://travis-ci.org/go-openapi/strfmt) [![codecov](https://codecov.io/gh/go-openapi/strfmt/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/strfmt) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io) - -[![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/strfmt/master/LICENSE) -[![GoDoc](https://godoc.org/github.com/go-openapi/strfmt?status.svg)](http://godoc.org/github.com/go-openapi/strfmt) -[![GolangCI](https://golangci.com/badges/github.com/go-openapi/strfmt.svg)](https://golangci.com) -[![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/strfmt)](https://goreportcard.com/report/github.com/go-openapi/strfmt) - -This package exposes a registry of data types to support string formats in the go-openapi toolkit. - -strfmt represents a well known string format such as credit card or email. The go toolkit for OpenAPI specifications knows how to deal with those. - -## Supported data formats -go-openapi/strfmt follows the swagger 2.0 specification with the following formats -defined [here](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types). - -It also provides convenient extensions to go-openapi users. - -- [x] JSON-schema draft 4 formats - - date-time - - email - - hostname - - ipv4 - - ipv6 - - uri -- [x] swagger 2.0 format extensions - - binary - - byte (e.g. base64 encoded string) - - date (e.g. "1970-01-01") - - password -- [x] go-openapi custom format extensions - - bsonobjectid (BSON objectID) - - creditcard - - duration (e.g. "3 weeks", "1ms") - - hexcolor (e.g. "#FFFFFF") - - isbn, isbn10, isbn13 - - mac (e.g "01:02:03:04:05:06") - - rgbcolor (e.g. "rgb(100,100,100)") - - ssn - - uuid, uuid3, uuid4, uuid5 - - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") - - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) - -> NOTE: as the name stands for, this package is intended to support string formatting only. -> It does not provide validation for numerical values with swagger format extension for JSON types "number" or -> "integer" (e.g. float, double, int32...). - -## Type conversion - -All types defined here are stringers and may be converted to strings with `.String()`. -Note that most types defined by this package may be converted directly to string like `string(Email{})`. - -`Date` and `DateTime` may be converted directly to `time.Time` like `time.Time(Time{})`. -Similarly, you can convert `Duration` to `time.Duration` as in `time.Duration(Duration{})` - -## Using pointers - -The `conv` subpackage provides helpers to convert the types to and from pointers, just like `go-openapi/swag` does -with primitive types. - -## Format types -Types defined in strfmt expose marshaling and validation capabilities. - -List of defined types: -- Base64 -- CreditCard -- Date -- DateTime -- Duration -- Email -- HexColor -- Hostname -- IPv4 -- IPv6 -- CIDR -- ISBN -- ISBN10 -- ISBN13 -- MAC -- ObjectId -- Password -- RGBColor -- SSN -- URI -- UUID -- UUID3 -- UUID4 -- UUID5 -- [ULID](https://github.com/ulid/spec) diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go deleted file mode 100644 index a8a3604a2c..0000000000 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "fmt" - - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" - bsonprim "go.mongodb.org/mongo-driver/bson/primitive" -) - -func init() { - var id ObjectId - // register this format in the default registry - Default.Add("bsonobjectid", &id, IsBSONObjectID) -} - -// IsBSONObjectID returns true when the string is a valid BSON.ObjectId -func IsBSONObjectID(str string) bool { - _, err := bsonprim.ObjectIDFromHex(str) - return err == nil -} - -// ObjectId represents a BSON object ID (alias to go.mongodb.org/mongo-driver/bson/primitive.ObjectID) -// -// swagger:strfmt bsonobjectid -type ObjectId bsonprim.ObjectID //nolint:revive - -// NewObjectId creates a ObjectId from a Hex String -func NewObjectId(hex string) ObjectId { //nolint:revive - oid, err := bsonprim.ObjectIDFromHex(hex) - if err != nil { - panic(err) - } - return ObjectId(oid) -} - -// MarshalText turns this instance into text -func (id ObjectId) MarshalText() ([]byte, error) { - oid := bsonprim.ObjectID(id) - if oid == bsonprim.NilObjectID { - return nil, nil - } - return []byte(oid.Hex()), nil -} - -// UnmarshalText hydrates this instance from text -func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performed later on - if len(data) == 0 { - *id = ObjectId(bsonprim.NilObjectID) - return nil - } - oidstr := string(data) - oid, err := bsonprim.ObjectIDFromHex(oidstr) - if err != nil { - return err - } - *id = ObjectId(oid) - return nil -} - -// Scan read a value from a database driver -func (id *ObjectId) Scan(raw interface{}) error { - var data []byte - switch v := raw.(type) { - case []byte: - data = v - case string: - data = []byte(v) - default: - return fmt.Errorf("cannot sql.Scan() strfmt.URI from: %#v", v) - } - - return id.UnmarshalText(data) -} - -// Value converts a value to a database driver value -func (id ObjectId) Value() (driver.Value, error) { - return driver.Value(bsonprim.ObjectID(id).Hex()), nil -} - -func (id ObjectId) String() string { - return bsonprim.ObjectID(id).Hex() -} - -// MarshalJSON returns the ObjectId as JSON -func (id ObjectId) MarshalJSON() ([]byte, error) { - return bsonprim.ObjectID(id).MarshalJSON() -} - -// UnmarshalJSON sets the ObjectId from JSON -func (id *ObjectId) UnmarshalJSON(data []byte) error { - var obj bsonprim.ObjectID - if err := obj.UnmarshalJSON(data); err != nil { - return err - } - *id = ObjectId(obj) - return nil -} - -// MarshalBSON renders the object id as a BSON document -func (id ObjectId) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) -} - -// UnmarshalBSON reads the objectId from a BSON document -func (id *ObjectId) UnmarshalBSON(data []byte) error { - var obj struct { - Data bsonprim.ObjectID - } - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - *id = ObjectId(obj.Data) - return nil -} - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { - oid := bsonprim.ObjectID(id) - return bsontype.ObjectID, oid[:], nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { - var oid bsonprim.ObjectID - copy(oid[:], data) - *id = ObjectId(oid) - return nil -} - -// DeepCopyInto copies the receiver and writes its value into out. -func (id *ObjectId) DeepCopyInto(out *ObjectId) { - *out = *id -} - -// DeepCopy copies the receiver into a new ObjectId. -func (id *ObjectId) DeepCopy() *ObjectId { - if id == nil { - return nil - } - out := new(ObjectId) - id.DeepCopyInto(out) - return out -} diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go deleted file mode 100644 index 3c93381c7c..0000000000 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "encoding/json" - "errors" - "fmt" - "time" - - "go.mongodb.org/mongo-driver/bson" -) - -func init() { - d := Date{} - // register this format in the default registry - Default.Add("date", &d, IsDate) -} - -// IsDate returns true when the string is a valid date -func IsDate(str string) bool { - _, err := time.Parse(RFC3339FullDate, str) - return err == nil -} - -const ( - // RFC3339FullDate represents a full-date as specified by RFC3339 - // See: http://goo.gl/xXOvVd - RFC3339FullDate = "2006-01-02" -) - -// Date represents a date from the API -// -// swagger:strfmt date -type Date time.Time - -// String converts this date into a string -func (d Date) String() string { - return time.Time(d).Format(RFC3339FullDate) -} - -// UnmarshalText parses a text representation into a date type -func (d *Date) UnmarshalText(text []byte) error { - if len(text) == 0 { - return nil - } - dd, err := time.ParseInLocation(RFC3339FullDate, string(text), DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(dd) - return nil -} - -// MarshalText serializes this date type to string -func (d Date) MarshalText() ([]byte, error) { - return []byte(d.String()), nil -} - -// Scan scans a Date value from database driver type. -func (d *Date) Scan(raw interface{}) error { - switch v := raw.(type) { - case []byte: - return d.UnmarshalText(v) - case string: - return d.UnmarshalText([]byte(v)) - case time.Time: - *d = Date(v) - return nil - case nil: - *d = Date{} - return nil - default: - return fmt.Errorf("cannot sql.Scan() strfmt.Date from: %#v", v) - } -} - -// Value converts Date to a primitive value ready to written to a database. -func (d Date) Value() (driver.Value, error) { - return driver.Value(d.String()), nil -} - -// MarshalJSON returns the Date as JSON -func (d Date) MarshalJSON() ([]byte, error) { - return json.Marshal(time.Time(d).Format(RFC3339FullDate)) -} - -// UnmarshalJSON sets the Date from JSON -func (d *Date) UnmarshalJSON(data []byte) error { - if string(data) == jsonNull { - return nil - } - var strdate string - if err := json.Unmarshal(data, &strdate); err != nil { - return err - } - tt, err := time.ParseInLocation(RFC3339FullDate, strdate, DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(tt) - return nil -} - -func (d Date) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Date) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(rd) - return nil - } - - return errors.New("couldn't unmarshal bson bytes value as Date") -} - -// DeepCopyInto copies the receiver and writes its value into out. -func (d *Date) DeepCopyInto(out *Date) { - *out = *d -} - -// DeepCopy copies the receiver into a new Date. -func (d *Date) DeepCopy() *Date { - if d == nil { - return nil - } - out := new(Date) - d.DeepCopyInto(out) - return out -} - -// GobEncode implements the gob.GobEncoder interface. -func (d Date) GobEncode() ([]byte, error) { - return d.MarshalBinary() -} - -// GobDecode implements the gob.GobDecoder interface. -func (d *Date) GobDecode(data []byte) error { - return d.UnmarshalBinary(data) -} - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (d Date) MarshalBinary() ([]byte, error) { - return time.Time(d).MarshalBinary() -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. -func (d *Date) UnmarshalBinary(data []byte) error { - var original time.Time - - err := original.UnmarshalBinary(data) - if err != nil { - return err - } - - *d = Date(original) - - return nil -} - -// Equal checks if two Date instances are equal -func (d Date) Equal(d2 Date) bool { - return time.Time(d).Equal(time.Time(d2)) -} diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go deleted file mode 100644 index a89a4de3f3..0000000000 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ /dev/null @@ -1,2035 +0,0 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package strfmt - -import ( - "database/sql/driver" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "net/mail" - "regexp" - "strings" - - "github.com/asaskevich/govalidator" - "go.mongodb.org/mongo-driver/bson" -) - -const ( - // HostnamePattern http://json-schema.org/latest/json-schema-validation.html#anchor114 - // A string instance is valid against this attribute if it is a valid - // representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - // http://tools.ietf.org/html/rfc1034#section-3.5 - // ::= any one of the ten digits 0 through 9 - // var digit = /[0-9]/; - // ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case - // var letter = /[a-zA-Z]/; - // ::= | - // var letDig = /[0-9a-zA-Z]/; - // ::= | "-" - // var letDigHyp = /[-0-9a-zA-Z]/; - // ::= | - // var ldhStr = /[-0-9a-zA-Z]+/; - //
") - } - buf.WriteString("\n\n
  • ") - } else { - for node.Level > tocLevel { - tocLevel++ - buf.WriteString("\n") - } - - if buf.Len() > 0 { - io.WriteString(w, "\n") - } - r.lastOutputLen = buf.Len() -} diff --git a/vendor/github.com/russross/blackfriday/v2/inline.go b/vendor/github.com/russross/blackfriday/v2/inline.go deleted file mode 100644 index d45bd94172..0000000000 --- a/vendor/github.com/russross/blackfriday/v2/inline.go +++ /dev/null @@ -1,1228 +0,0 @@ -// -// Blackfriday Markdown Processor -// Available at http://github.com/russross/blackfriday -// -// Copyright © 2011 Russ Ross . -// Distributed under the Simplified BSD License. -// See README.md for details. -// - -// -// Functions to parse inline elements. -// - -package blackfriday - -import ( - "bytes" - "regexp" - "strconv" -) - -var ( - urlRe = `((https?|ftp):\/\/|\/)[-A-Za-z0-9+&@#\/%?=~_|!:,.;\(\)]+` - anchorRe = regexp.MustCompile(`^(]+")?\s?>` + urlRe + `<\/a>)`) - - // https://www.w3.org/TR/html5/syntax.html#character-references - // highest unicode code point in 17 planes (2^20): 1,114,112d = - // 7 dec digits or 6 hex digits - // named entity references can be 2-31 characters with stuff like < - // at one end and ∳ at the other. There - // are also sometimes numbers at the end, although this isn't inherent - // in the specification; there are never numbers anywhere else in - // current character references, though; see ¾ and ▒, etc. - // https://www.w3.org/TR/html5/syntax.html#named-character-references - // - // entity := "&" (named group | number ref) ";" - // named group := [a-zA-Z]{2,31}[0-9]{0,2} - // number ref := "#" (dec ref | hex ref) - // dec ref := [0-9]{1,7} - // hex ref := ("x" | "X") [0-9a-fA-F]{1,6} - htmlEntityRe = regexp.MustCompile(`&([a-zA-Z]{2,31}[0-9]{0,2}|#([0-9]{1,7}|[xX][0-9a-fA-F]{1,6}));`) -) - -// Functions to parse text within a block -// Each function returns the number of chars taken care of -// data is the complete block being rendered -// offset is the number of valid chars before the current cursor - -func (p *Markdown) inline(currBlock *Node, data []byte) { - // handlers might call us recursively: enforce a maximum depth - if p.nesting >= p.maxNesting || len(data) == 0 { - return - } - p.nesting++ - beg, end := 0, 0 - for end < len(data) { - handler := p.inlineCallback[data[end]] - if handler != nil { - if consumed, node := handler(p, data, end); consumed == 0 { - // No action from the callback. - end++ - } else { - // Copy inactive chars into the output. - currBlock.AppendChild(text(data[beg:end])) - if node != nil { - currBlock.AppendChild(node) - } - // Skip past whatever the callback used. - beg = end + consumed - end = beg - } - } else { - end++ - } - } - if beg < len(data) { - if data[end-1] == '\n' { - end-- - } - currBlock.AppendChild(text(data[beg:end])) - } - p.nesting-- -} - -// single and double emphasis parsing -func emphasis(p *Markdown, data []byte, offset int) (int, *Node) { - data = data[offset:] - c := data[0] - - if len(data) > 2 && data[1] != c { - // whitespace cannot follow an opening emphasis; - // strikethrough only takes two characters '~~' - if c == '~' || isspace(data[1]) { - return 0, nil - } - ret, node := helperEmphasis(p, data[1:], c) - if ret == 0 { - return 0, nil - } - - return ret + 1, node - } - - if len(data) > 3 && data[1] == c && data[2] != c { - if isspace(data[2]) { - return 0, nil - } - ret, node := helperDoubleEmphasis(p, data[2:], c) - if ret == 0 { - return 0, nil - } - - return ret + 2, node - } - - if len(data) > 4 && data[1] == c && data[2] == c && data[3] != c { - if c == '~' || isspace(data[3]) { - return 0, nil - } - ret, node := helperTripleEmphasis(p, data, 3, c) - if ret == 0 { - return 0, nil - } - - return ret + 3, node - } - - return 0, nil -} - -func codeSpan(p *Markdown, data []byte, offset int) (int, *Node) { - data = data[offset:] - - nb := 0 - - // count the number of backticks in the delimiter - for nb < len(data) && data[nb] == '`' { - nb++ - } - - // find the next delimiter - i, end := 0, 0 - for end = nb; end < len(data) && i < nb; end++ { - if data[end] == '`' { - i++ - } else { - i = 0 - } - } - - // no matching delimiter? - if i < nb && end >= len(data) { - return 0, nil - } - - // trim outside whitespace - fBegin := nb - for fBegin < end && data[fBegin] == ' ' { - fBegin++ - } - - fEnd := end - nb - for fEnd > fBegin && data[fEnd-1] == ' ' { - fEnd-- - } - - // render the code span - if fBegin != fEnd { - code := NewNode(Code) - code.Literal = data[fBegin:fEnd] - return end, code - } - - return end, nil -} - -// newline preceded by two spaces becomes
    -func maybeLineBreak(p *Markdown, data []byte, offset int) (int, *Node) { - origOffset := offset - for offset < len(data) && data[offset] == ' ' { - offset++ - } - - if offset < len(data) && data[offset] == '\n' { - if offset-origOffset >= 2 { - return offset - origOffset + 1, NewNode(Hardbreak) - } - return offset - origOffset, nil - } - return 0, nil -} - -// newline without two spaces works when HardLineBreak is enabled -func lineBreak(p *Markdown, data []byte, offset int) (int, *Node) { - if p.extensions&HardLineBreak != 0 { - return 1, NewNode(Hardbreak) - } - return 0, nil -} - -type linkType int - -const ( - linkNormal linkType = iota - linkImg - linkDeferredFootnote - linkInlineFootnote -) - -func isReferenceStyleLink(data []byte, pos int, t linkType) bool { - if t == linkDeferredFootnote { - return false - } - return pos < len(data)-1 && data[pos] == '[' && data[pos+1] != '^' -} - -func maybeImage(p *Markdown, data []byte, offset int) (int, *Node) { - if offset < len(data)-1 && data[offset+1] == '[' { - return link(p, data, offset) - } - return 0, nil -} - -func maybeInlineFootnote(p *Markdown, data []byte, offset int) (int, *Node) { - if offset < len(data)-1 && data[offset+1] == '[' { - return link(p, data, offset) - } - return 0, nil -} - -// '[': parse a link or an image or a footnote -func link(p *Markdown, data []byte, offset int) (int, *Node) { - // no links allowed inside regular links, footnote, and deferred footnotes - if p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') { - return 0, nil - } - - var t linkType - switch { - // special case: ![^text] == deferred footnote (that follows something with - // an exclamation point) - case p.extensions&Footnotes != 0 && len(data)-1 > offset && data[offset+1] == '^': - t = linkDeferredFootnote - // ![alt] == image - case offset >= 0 && data[offset] == '!': - t = linkImg - offset++ - // ^[text] == inline footnote - // [^refId] == deferred footnote - case p.extensions&Footnotes != 0: - if offset >= 0 && data[offset] == '^' { - t = linkInlineFootnote - offset++ - } else if len(data)-1 > offset && data[offset+1] == '^' { - t = linkDeferredFootnote - } - // [text] == regular link - default: - t = linkNormal - } - - data = data[offset:] - - var ( - i = 1 - noteID int - title, link, altContent []byte - textHasNl = false - ) - - if t == linkDeferredFootnote { - i++ - } - - // look for the matching closing bracket - for level := 1; level > 0 && i < len(data); i++ { - switch { - case data[i] == '\n': - textHasNl = true - - case isBackslashEscaped(data, i): - continue - - case data[i] == '[': - level++ - - case data[i] == ']': - level-- - if level <= 0 { - i-- // compensate for extra i++ in for loop - } - } - } - - if i >= len(data) { - return 0, nil - } - - txtE := i - i++ - var footnoteNode *Node - - // skip any amount of whitespace or newline - // (this is much more lax than original markdown syntax) - for i < len(data) && isspace(data[i]) { - i++ - } - - // inline style link - switch { - case i < len(data) && data[i] == '(': - // skip initial whitespace - i++ - - for i < len(data) && isspace(data[i]) { - i++ - } - - linkB := i - - // look for link end: ' " ) - findlinkend: - for i < len(data) { - switch { - case data[i] == '\\': - i += 2 - - case data[i] == ')' || data[i] == '\'' || data[i] == '"': - break findlinkend - - default: - i++ - } - } - - if i >= len(data) { - return 0, nil - } - linkE := i - - // look for title end if present - titleB, titleE := 0, 0 - if data[i] == '\'' || data[i] == '"' { - i++ - titleB = i - - findtitleend: - for i < len(data) { - switch { - case data[i] == '\\': - i += 2 - - case data[i] == ')': - break findtitleend - - default: - i++ - } - } - - if i >= len(data) { - return 0, nil - } - - // skip whitespace after title - titleE = i - 1 - for titleE > titleB && isspace(data[titleE]) { - titleE-- - } - - // check for closing quote presence - if data[titleE] != '\'' && data[titleE] != '"' { - titleB, titleE = 0, 0 - linkE = i - } - } - - // remove whitespace at the end of the link - for linkE > linkB && isspace(data[linkE-1]) { - linkE-- - } - - // remove optional angle brackets around the link - if data[linkB] == '<' { - linkB++ - } - if data[linkE-1] == '>' { - linkE-- - } - - // build escaped link and title - if linkE > linkB { - link = data[linkB:linkE] - } - - if titleE > titleB { - title = data[titleB:titleE] - } - - i++ - - // reference style link - case isReferenceStyleLink(data, i, t): - var id []byte - altContentConsidered := false - - // look for the id - i++ - linkB := i - for i < len(data) && data[i] != ']' { - i++ - } - if i >= len(data) { - return 0, nil - } - linkE := i - - // find the reference - if linkB == linkE { - if textHasNl { - var b bytes.Buffer - - for j := 1; j < txtE; j++ { - switch { - case data[j] != '\n': - b.WriteByte(data[j]) - case data[j-1] != ' ': - b.WriteByte(' ') - } - } - - id = b.Bytes() - } else { - id = data[1:txtE] - altContentConsidered = true - } - } else { - id = data[linkB:linkE] - } - - // find the reference with matching id - lr, ok := p.getRef(string(id)) - if !ok { - return 0, nil - } - - // keep link and title from reference - link = lr.link - title = lr.title - if altContentConsidered { - altContent = lr.text - } - i++ - - // shortcut reference style link or reference or inline footnote - default: - var id []byte - - // craft the id - if textHasNl { - var b bytes.Buffer - - for j := 1; j < txtE; j++ { - switch { - case data[j] != '\n': - b.WriteByte(data[j]) - case data[j-1] != ' ': - b.WriteByte(' ') - } - } - - id = b.Bytes() - } else { - if t == linkDeferredFootnote { - id = data[2:txtE] // get rid of the ^ - } else { - id = data[1:txtE] - } - } - - footnoteNode = NewNode(Item) - if t == linkInlineFootnote { - // create a new reference - noteID = len(p.notes) + 1 - - var fragment []byte - if len(id) > 0 { - if len(id) < 16 { - fragment = make([]byte, len(id)) - } else { - fragment = make([]byte, 16) - } - copy(fragment, slugify(id)) - } else { - fragment = append([]byte("footnote-"), []byte(strconv.Itoa(noteID))...) - } - - ref := &reference{ - noteID: noteID, - hasBlock: false, - link: fragment, - title: id, - footnote: footnoteNode, - } - - p.notes = append(p.notes, ref) - - link = ref.link - title = ref.title - } else { - // find the reference with matching id - lr, ok := p.getRef(string(id)) - if !ok { - return 0, nil - } - - if t == linkDeferredFootnote { - lr.noteID = len(p.notes) + 1 - lr.footnote = footnoteNode - p.notes = append(p.notes, lr) - } - - // keep link and title from reference - link = lr.link - // if inline footnote, title == footnote contents - title = lr.title - noteID = lr.noteID - } - - // rewind the whitespace - i = txtE + 1 - } - - var uLink []byte - if t == linkNormal || t == linkImg { - if len(link) > 0 { - var uLinkBuf bytes.Buffer - unescapeText(&uLinkBuf, link) - uLink = uLinkBuf.Bytes() - } - - // links need something to click on and somewhere to go - if len(uLink) == 0 || (t == linkNormal && txtE <= 1) { - return 0, nil - } - } - - // call the relevant rendering function - var linkNode *Node - switch t { - case linkNormal: - linkNode = NewNode(Link) - linkNode.Destination = normalizeURI(uLink) - linkNode.Title = title - if len(altContent) > 0 { - linkNode.AppendChild(text(altContent)) - } else { - // links cannot contain other links, so turn off link parsing - // temporarily and recurse - insideLink := p.insideLink - p.insideLink = true - p.inline(linkNode, data[1:txtE]) - p.insideLink = insideLink - } - - case linkImg: - linkNode = NewNode(Image) - linkNode.Destination = uLink - linkNode.Title = title - linkNode.AppendChild(text(data[1:txtE])) - i++ - - case linkInlineFootnote, linkDeferredFootnote: - linkNode = NewNode(Link) - linkNode.Destination = link - linkNode.Title = title - linkNode.NoteID = noteID - linkNode.Footnote = footnoteNode - if t == linkInlineFootnote { - i++ - } - - default: - return 0, nil - } - - return i, linkNode -} - -func (p *Markdown) inlineHTMLComment(data []byte) int { - if len(data) < 5 { - return 0 - } - if data[0] != '<' || data[1] != '!' || data[2] != '-' || data[3] != '-' { - return 0 - } - i := 5 - // scan for an end-of-comment marker, across lines if necessary - for i < len(data) && !(data[i-2] == '-' && data[i-1] == '-' && data[i] == '>') { - i++ - } - // no end-of-comment marker - if i >= len(data) { - return 0 - } - return i + 1 -} - -func stripMailto(link []byte) []byte { - if bytes.HasPrefix(link, []byte("mailto://")) { - return link[9:] - } else if bytes.HasPrefix(link, []byte("mailto:")) { - return link[7:] - } else { - return link - } -} - -// autolinkType specifies a kind of autolink that gets detected. -type autolinkType int - -// These are the possible flag values for the autolink renderer. -const ( - notAutolink autolinkType = iota - normalAutolink - emailAutolink -) - -// '<' when tags or autolinks are allowed -func leftAngle(p *Markdown, data []byte, offset int) (int, *Node) { - data = data[offset:] - altype, end := tagLength(data) - if size := p.inlineHTMLComment(data); size > 0 { - end = size - } - if end > 2 { - if altype != notAutolink { - var uLink bytes.Buffer - unescapeText(&uLink, data[1:end+1-2]) - if uLink.Len() > 0 { - link := uLink.Bytes() - node := NewNode(Link) - node.Destination = link - if altype == emailAutolink { - node.Destination = append([]byte("mailto:"), link...) - } - node.AppendChild(text(stripMailto(link))) - return end, node - } - } else { - htmlTag := NewNode(HTMLSpan) - htmlTag.Literal = data[:end] - return end, htmlTag - } - } - - return end, nil -} - -// '\\' backslash escape -var escapeChars = []byte("\\`*_{}[]()#+-.!:|&<>~") - -func escape(p *Markdown, data []byte, offset int) (int, *Node) { - data = data[offset:] - - if len(data) > 1 { - if p.extensions&BackslashLineBreak != 0 && data[1] == '\n' { - return 2, NewNode(Hardbreak) - } - if bytes.IndexByte(escapeChars, data[1]) < 0 { - return 0, nil - } - - return 2, text(data[1:2]) - } - - return 2, nil -} - -func unescapeText(ob *bytes.Buffer, src []byte) { - i := 0 - for i < len(src) { - org := i - for i < len(src) && src[i] != '\\' { - i++ - } - - if i > org { - ob.Write(src[org:i]) - } - - if i+1 >= len(src) { - break - } - - ob.WriteByte(src[i+1]) - i += 2 - } -} - -// '&' escaped when it doesn't belong to an entity -// valid entities are assumed to be anything matching &#?[A-Za-z0-9]+; -func entity(p *Markdown, data []byte, offset int) (int, *Node) { - data = data[offset:] - - end := 1 - - if end < len(data) && data[end] == '#' { - end++ - } - - for end < len(data) && isalnum(data[end]) { - end++ - } - - if end < len(data) && data[end] == ';' { - end++ // real entity - } else { - return 0, nil // lone '&' - } - - ent := data[:end] - // undo & escaping or it will be converted to &amp; by another - // escaper in the renderer - if bytes.Equal(ent, []byte("&")) { - ent = []byte{'&'} - } - - return end, text(ent) -} - -func linkEndsWithEntity(data []byte, linkEnd int) bool { - entityRanges := htmlEntityRe.FindAllIndex(data[:linkEnd], -1) - return entityRanges != nil && entityRanges[len(entityRanges)-1][1] == linkEnd -} - -// hasPrefixCaseInsensitive is a custom implementation of -// strings.HasPrefix(strings.ToLower(s), prefix) -// we rolled our own because ToLower pulls in a huge machinery of lowercasing -// anything from Unicode and that's very slow. Since this func will only be -// used on ASCII protocol prefixes, we can take shortcuts. -func hasPrefixCaseInsensitive(s, prefix []byte) bool { - if len(s) < len(prefix) { - return false - } - delta := byte('a' - 'A') - for i, b := range prefix { - if b != s[i] && b != s[i]+delta { - return false - } - } - return true -} - -var protocolPrefixes = [][]byte{ - []byte("http://"), - []byte("https://"), - []byte("ftp://"), - []byte("file://"), - []byte("mailto:"), -} - -const shortestPrefix = 6 // len("ftp://"), the shortest of the above - -func maybeAutoLink(p *Markdown, data []byte, offset int) (int, *Node) { - // quick check to rule out most false hits - if p.insideLink || len(data) < offset+shortestPrefix { - return 0, nil - } - for _, prefix := range protocolPrefixes { - endOfHead := offset + 8 // 8 is the len() of the longest prefix - if endOfHead > len(data) { - endOfHead = len(data) - } - if hasPrefixCaseInsensitive(data[offset:endOfHead], prefix) { - return autoLink(p, data, offset) - } - } - return 0, nil -} - -func autoLink(p *Markdown, data []byte, offset int) (int, *Node) { - // Now a more expensive check to see if we're not inside an anchor element - anchorStart := offset - offsetFromAnchor := 0 - for anchorStart > 0 && data[anchorStart] != '<' { - anchorStart-- - offsetFromAnchor++ - } - - anchorStr := anchorRe.Find(data[anchorStart:]) - if anchorStr != nil { - anchorClose := NewNode(HTMLSpan) - anchorClose.Literal = anchorStr[offsetFromAnchor:] - return len(anchorStr) - offsetFromAnchor, anchorClose - } - - // scan backward for a word boundary - rewind := 0 - for offset-rewind > 0 && rewind <= 7 && isletter(data[offset-rewind-1]) { - rewind++ - } - if rewind > 6 { // longest supported protocol is "mailto" which has 6 letters - return 0, nil - } - - origData := data - data = data[offset-rewind:] - - if !isSafeLink(data) { - return 0, nil - } - - linkEnd := 0 - for linkEnd < len(data) && !isEndOfLink(data[linkEnd]) { - linkEnd++ - } - - // Skip punctuation at the end of the link - if (data[linkEnd-1] == '.' || data[linkEnd-1] == ',') && data[linkEnd-2] != '\\' { - linkEnd-- - } - - // But don't skip semicolon if it's a part of escaped entity: - if data[linkEnd-1] == ';' && data[linkEnd-2] != '\\' && !linkEndsWithEntity(data, linkEnd) { - linkEnd-- - } - - // See if the link finishes with a punctuation sign that can be closed. - var copen byte - switch data[linkEnd-1] { - case '"': - copen = '"' - case '\'': - copen = '\'' - case ')': - copen = '(' - case ']': - copen = '[' - case '}': - copen = '{' - default: - copen = 0 - } - - if copen != 0 { - bufEnd := offset - rewind + linkEnd - 2 - - openDelim := 1 - - /* Try to close the final punctuation sign in this same line; - * if we managed to close it outside of the URL, that means that it's - * not part of the URL. If it closes inside the URL, that means it - * is part of the URL. - * - * Examples: - * - * foo http://www.pokemon.com/Pikachu_(Electric) bar - * => http://www.pokemon.com/Pikachu_(Electric) - * - * foo (http://www.pokemon.com/Pikachu_(Electric)) bar - * => http://www.pokemon.com/Pikachu_(Electric) - * - * foo http://www.pokemon.com/Pikachu_(Electric)) bar - * => http://www.pokemon.com/Pikachu_(Electric)) - * - * (foo http://www.pokemon.com/Pikachu_(Electric)) bar - * => foo http://www.pokemon.com/Pikachu_(Electric) - */ - - for bufEnd >= 0 && origData[bufEnd] != '\n' && openDelim != 0 { - if origData[bufEnd] == data[linkEnd-1] { - openDelim++ - } - - if origData[bufEnd] == copen { - openDelim-- - } - - bufEnd-- - } - - if openDelim == 0 { - linkEnd-- - } - } - - var uLink bytes.Buffer - unescapeText(&uLink, data[:linkEnd]) - - if uLink.Len() > 0 { - node := NewNode(Link) - node.Destination = uLink.Bytes() - node.AppendChild(text(uLink.Bytes())) - return linkEnd, node - } - - return linkEnd, nil -} - -func isEndOfLink(char byte) bool { - return isspace(char) || char == '<' -} - -var validUris = [][]byte{[]byte("http://"), []byte("https://"), []byte("ftp://"), []byte("mailto://")} -var validPaths = [][]byte{[]byte("/"), []byte("./"), []byte("../")} - -func isSafeLink(link []byte) bool { - for _, path := range validPaths { - if len(link) >= len(path) && bytes.Equal(link[:len(path)], path) { - if len(link) == len(path) { - return true - } else if isalnum(link[len(path)]) { - return true - } - } - } - - for _, prefix := range validUris { - // TODO: handle unicode here - // case-insensitive prefix test - if len(link) > len(prefix) && bytes.Equal(bytes.ToLower(link[:len(prefix)]), prefix) && isalnum(link[len(prefix)]) { - return true - } - } - - return false -} - -// return the length of the given tag, or 0 is it's not valid -func tagLength(data []byte) (autolink autolinkType, end int) { - var i, j int - - // a valid tag can't be shorter than 3 chars - if len(data) < 3 { - return notAutolink, 0 - } - - // begins with a '<' optionally followed by '/', followed by letter or number - if data[0] != '<' { - return notAutolink, 0 - } - if data[1] == '/' { - i = 2 - } else { - i = 1 - } - - if !isalnum(data[i]) { - return notAutolink, 0 - } - - // scheme test - autolink = notAutolink - - // try to find the beginning of an URI - for i < len(data) && (isalnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-') { - i++ - } - - if i > 1 && i < len(data) && data[i] == '@' { - if j = isMailtoAutoLink(data[i:]); j != 0 { - return emailAutolink, i + j - } - } - - if i > 2 && i < len(data) && data[i] == ':' { - autolink = normalAutolink - i++ - } - - // complete autolink test: no whitespace or ' or " - switch { - case i >= len(data): - autolink = notAutolink - case autolink != notAutolink: - j = i - - for i < len(data) { - if data[i] == '\\' { - i += 2 - } else if data[i] == '>' || data[i] == '\'' || data[i] == '"' || isspace(data[i]) { - break - } else { - i++ - } - - } - - if i >= len(data) { - return autolink, 0 - } - if i > j && data[i] == '>' { - return autolink, i + 1 - } - - // one of the forbidden chars has been found - autolink = notAutolink - } - i += bytes.IndexByte(data[i:], '>') - if i < 0 { - return autolink, 0 - } - return autolink, i + 1 -} - -// look for the address part of a mail autolink and '>' -// this is less strict than the original markdown e-mail address matching -func isMailtoAutoLink(data []byte) int { - nb := 0 - - // address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@' - for i := 0; i < len(data); i++ { - if isalnum(data[i]) { - continue - } - - switch data[i] { - case '@': - nb++ - - case '-', '.', '_': - break - - case '>': - if nb == 1 { - return i + 1 - } - return 0 - default: - return 0 - } - } - - return 0 -} - -// look for the next emph char, skipping other constructs -func helperFindEmphChar(data []byte, c byte) int { - i := 0 - - for i < len(data) { - for i < len(data) && data[i] != c && data[i] != '`' && data[i] != '[' { - i++ - } - if i >= len(data) { - return 0 - } - // do not count escaped chars - if i != 0 && data[i-1] == '\\' { - i++ - continue - } - if data[i] == c { - return i - } - - if data[i] == '`' { - // skip a code span - tmpI := 0 - i++ - for i < len(data) && data[i] != '`' { - if tmpI == 0 && data[i] == c { - tmpI = i - } - i++ - } - if i >= len(data) { - return tmpI - } - i++ - } else if data[i] == '[' { - // skip a link - tmpI := 0 - i++ - for i < len(data) && data[i] != ']' { - if tmpI == 0 && data[i] == c { - tmpI = i - } - i++ - } - i++ - for i < len(data) && (data[i] == ' ' || data[i] == '\n') { - i++ - } - if i >= len(data) { - return tmpI - } - if data[i] != '[' && data[i] != '(' { // not a link - if tmpI > 0 { - return tmpI - } - continue - } - cc := data[i] - i++ - for i < len(data) && data[i] != cc { - if tmpI == 0 && data[i] == c { - return i - } - i++ - } - if i >= len(data) { - return tmpI - } - i++ - } - } - return 0 -} - -func helperEmphasis(p *Markdown, data []byte, c byte) (int, *Node) { - i := 0 - - // skip one symbol if coming from emph3 - if len(data) > 1 && data[0] == c && data[1] == c { - i = 1 - } - - for i < len(data) { - length := helperFindEmphChar(data[i:], c) - if length == 0 { - return 0, nil - } - i += length - if i >= len(data) { - return 0, nil - } - - if i+1 < len(data) && data[i+1] == c { - i++ - continue - } - - if data[i] == c && !isspace(data[i-1]) { - - if p.extensions&NoIntraEmphasis != 0 { - if !(i+1 == len(data) || isspace(data[i+1]) || ispunct(data[i+1])) { - continue - } - } - - emph := NewNode(Emph) - p.inline(emph, data[:i]) - return i + 1, emph - } - } - - return 0, nil -} - -func helperDoubleEmphasis(p *Markdown, data []byte, c byte) (int, *Node) { - i := 0 - - for i < len(data) { - length := helperFindEmphChar(data[i:], c) - if length == 0 { - return 0, nil - } - i += length - - if i+1 < len(data) && data[i] == c && data[i+1] == c && i > 0 && !isspace(data[i-1]) { - nodeType := Strong - if c == '~' { - nodeType = Del - } - node := NewNode(nodeType) - p.inline(node, data[:i]) - return i + 2, node - } - i++ - } - return 0, nil -} - -func helperTripleEmphasis(p *Markdown, data []byte, offset int, c byte) (int, *Node) { - i := 0 - origData := data - data = data[offset:] - - for i < len(data) { - length := helperFindEmphChar(data[i:], c) - if length == 0 { - return 0, nil - } - i += length - - // skip whitespace preceded symbols - if data[i] != c || isspace(data[i-1]) { - continue - } - - switch { - case i+2 < len(data) && data[i+1] == c && data[i+2] == c: - // triple symbol found - strong := NewNode(Strong) - em := NewNode(Emph) - strong.AppendChild(em) - p.inline(em, data[:i]) - return i + 3, strong - case (i+1 < len(data) && data[i+1] == c): - // double symbol found, hand over to emph1 - length, node := helperEmphasis(p, origData[offset-2:], c) - if length == 0 { - return 0, nil - } - return length - 2, node - default: - // single symbol found, hand over to emph2 - length, node := helperDoubleEmphasis(p, origData[offset-1:], c) - if length == 0 { - return 0, nil - } - return length - 1, node - } - } - return 0, nil -} - -func text(s []byte) *Node { - node := NewNode(Text) - node.Literal = s - return node -} - -func normalizeURI(s []byte) []byte { - return s // TODO: implement -} diff --git a/vendor/github.com/russross/blackfriday/v2/markdown.go b/vendor/github.com/russross/blackfriday/v2/markdown.go deleted file mode 100644 index 58d2e4538c..0000000000 --- a/vendor/github.com/russross/blackfriday/v2/markdown.go +++ /dev/null @@ -1,950 +0,0 @@ -// Blackfriday Markdown Processor -// Available at http://github.com/russross/blackfriday -// -// Copyright © 2011 Russ Ross . -// Distributed under the Simplified BSD License. -// See README.md for details. - -package blackfriday - -import ( - "bytes" - "fmt" - "io" - "strings" - "unicode/utf8" -) - -// -// Markdown parsing and processing -// - -// Version string of the package. Appears in the rendered document when -// CompletePage flag is on. -const Version = "2.0" - -// Extensions is a bitwise or'ed collection of enabled Blackfriday's -// extensions. -type Extensions int - -// These are the supported markdown parsing extensions. -// OR these values together to select multiple extensions. -const ( - NoExtensions Extensions = 0 - NoIntraEmphasis Extensions = 1 << iota // Ignore emphasis markers inside words - Tables // Render tables - FencedCode // Render fenced code blocks - Autolink // Detect embedded URLs that are not explicitly marked - Strikethrough // Strikethrough text using ~~test~~ - LaxHTMLBlocks // Loosen up HTML block parsing rules - SpaceHeadings // Be strict about prefix heading rules - HardLineBreak // Translate newlines into line breaks - TabSizeEight // Expand tabs to eight spaces instead of four - Footnotes // Pandoc-style footnotes - NoEmptyLineBeforeBlock // No need to insert an empty line to start a (code, quote, ordered list, unordered list) block - HeadingIDs // specify heading IDs with {#id} - Titleblock // Titleblock ala pandoc - AutoHeadingIDs // Create the heading ID from the text - BackslashLineBreak // Translate trailing backslashes into line breaks - DefinitionLists // Render definition lists - - CommonHTMLFlags HTMLFlags = UseXHTML | Smartypants | - SmartypantsFractions | SmartypantsDashes | SmartypantsLatexDashes - - CommonExtensions Extensions = NoIntraEmphasis | Tables | FencedCode | - Autolink | Strikethrough | SpaceHeadings | HeadingIDs | - BackslashLineBreak | DefinitionLists -) - -// ListType contains bitwise or'ed flags for list and list item objects. -type ListType int - -// These are the possible flag values for the ListItem renderer. -// Multiple flag values may be ORed together. -// These are mostly of interest if you are writing a new output format. -const ( - ListTypeOrdered ListType = 1 << iota - ListTypeDefinition - ListTypeTerm - - ListItemContainsBlock - ListItemBeginningOfList // TODO: figure out if this is of any use now - ListItemEndOfList -) - -// CellAlignFlags holds a type of alignment in a table cell. -type CellAlignFlags int - -// These are the possible flag values for the table cell renderer. -// Only a single one of these values will be used; they are not ORed together. -// These are mostly of interest if you are writing a new output format. -const ( - TableAlignmentLeft CellAlignFlags = 1 << iota - TableAlignmentRight - TableAlignmentCenter = (TableAlignmentLeft | TableAlignmentRight) -) - -// The size of a tab stop. -const ( - TabSizeDefault = 4 - TabSizeDouble = 8 -) - -// blockTags is a set of tags that are recognized as HTML block tags. -// Any of these can be included in markdown text without special escaping. -var blockTags = map[string]struct{}{ - "blockquote": {}, - "del": {}, - "div": {}, - "dl": {}, - "fieldset": {}, - "form": {}, - "h1": {}, - "h2": {}, - "h3": {}, - "h4": {}, - "h5": {}, - "h6": {}, - "iframe": {}, - "ins": {}, - "math": {}, - "noscript": {}, - "ol": {}, - "pre": {}, - "p": {}, - "script": {}, - "style": {}, - "table": {}, - "ul": {}, - - // HTML5 - "address": {}, - "article": {}, - "aside": {}, - "canvas": {}, - "figcaption": {}, - "figure": {}, - "footer": {}, - "header": {}, - "hgroup": {}, - "main": {}, - "nav": {}, - "output": {}, - "progress": {}, - "section": {}, - "video": {}, -} - -// Renderer is the rendering interface. This is mostly of interest if you are -// implementing a new rendering format. -// -// Only an HTML implementation is provided in this repository, see the README -// for external implementations. -type Renderer interface { - // RenderNode is the main rendering method. It will be called once for - // every leaf node and twice for every non-leaf node (first with - // entering=true, then with entering=false). The method should write its - // rendition of the node to the supplied writer w. - RenderNode(w io.Writer, node *Node, entering bool) WalkStatus - - // RenderHeader is a method that allows the renderer to produce some - // content preceding the main body of the output document. The header is - // understood in the broad sense here. For example, the default HTML - // renderer will write not only the HTML document preamble, but also the - // table of contents if it was requested. - // - // The method will be passed an entire document tree, in case a particular - // implementation needs to inspect it to produce output. - // - // The output should be written to the supplied writer w. If your - // implementation has no header to write, supply an empty implementation. - RenderHeader(w io.Writer, ast *Node) - - // RenderFooter is a symmetric counterpart of RenderHeader. - RenderFooter(w io.Writer, ast *Node) -} - -// Callback functions for inline parsing. One such function is defined -// for each character that triggers a response when parsing inline data. -type inlineParser func(p *Markdown, data []byte, offset int) (int, *Node) - -// Markdown is a type that holds extensions and the runtime state used by -// Parse, and the renderer. You can not use it directly, construct it with New. -type Markdown struct { - renderer Renderer - referenceOverride ReferenceOverrideFunc - refs map[string]*reference - inlineCallback [256]inlineParser - extensions Extensions - nesting int - maxNesting int - insideLink bool - - // Footnotes need to be ordered as well as available to quickly check for - // presence. If a ref is also a footnote, it's stored both in refs and here - // in notes. Slice is nil if footnotes not enabled. - notes []*reference - - doc *Node - tip *Node // = doc - oldTip *Node - lastMatchedContainer *Node // = doc - allClosed bool -} - -func (p *Markdown) getRef(refid string) (ref *reference, found bool) { - if p.referenceOverride != nil { - r, overridden := p.referenceOverride(refid) - if overridden { - if r == nil { - return nil, false - } - return &reference{ - link: []byte(r.Link), - title: []byte(r.Title), - noteID: 0, - hasBlock: false, - text: []byte(r.Text)}, true - } - } - // refs are case insensitive - ref, found = p.refs[strings.ToLower(refid)] - return ref, found -} - -func (p *Markdown) finalize(block *Node) { - above := block.Parent - block.open = false - p.tip = above -} - -func (p *Markdown) addChild(node NodeType, offset uint32) *Node { - return p.addExistingChild(NewNode(node), offset) -} - -func (p *Markdown) addExistingChild(node *Node, offset uint32) *Node { - for !p.tip.canContain(node.Type) { - p.finalize(p.tip) - } - p.tip.AppendChild(node) - p.tip = node - return node -} - -func (p *Markdown) closeUnmatchedBlocks() { - if !p.allClosed { - for p.oldTip != p.lastMatchedContainer { - parent := p.oldTip.Parent - p.finalize(p.oldTip) - p.oldTip = parent - } - p.allClosed = true - } -} - -// -// -// Public interface -// -// - -// Reference represents the details of a link. -// See the documentation in Options for more details on use-case. -type Reference struct { - // Link is usually the URL the reference points to. - Link string - // Title is the alternate text describing the link in more detail. - Title string - // Text is the optional text to override the ref with if the syntax used was - // [refid][] - Text string -} - -// ReferenceOverrideFunc is expected to be called with a reference string and -// return either a valid Reference type that the reference string maps to or -// nil. If overridden is false, the default reference logic will be executed. -// See the documentation in Options for more details on use-case. -type ReferenceOverrideFunc func(reference string) (ref *Reference, overridden bool) - -// New constructs a Markdown processor. You can use the same With* functions as -// for Run() to customize parser's behavior and the renderer. -func New(opts ...Option) *Markdown { - var p Markdown - for _, opt := range opts { - opt(&p) - } - p.refs = make(map[string]*reference) - p.maxNesting = 16 - p.insideLink = false - docNode := NewNode(Document) - p.doc = docNode - p.tip = docNode - p.oldTip = docNode - p.lastMatchedContainer = docNode - p.allClosed = true - // register inline parsers - p.inlineCallback[' '] = maybeLineBreak - p.inlineCallback['*'] = emphasis - p.inlineCallback['_'] = emphasis - if p.extensions&Strikethrough != 0 { - p.inlineCallback['~'] = emphasis - } - p.inlineCallback['`'] = codeSpan - p.inlineCallback['\n'] = lineBreak - p.inlineCallback['['] = link - p.inlineCallback['<'] = leftAngle - p.inlineCallback['\\'] = escape - p.inlineCallback['&'] = entity - p.inlineCallback['!'] = maybeImage - p.inlineCallback['^'] = maybeInlineFootnote - if p.extensions&Autolink != 0 { - p.inlineCallback['h'] = maybeAutoLink - p.inlineCallback['m'] = maybeAutoLink - p.inlineCallback['f'] = maybeAutoLink - p.inlineCallback['H'] = maybeAutoLink - p.inlineCallback['M'] = maybeAutoLink - p.inlineCallback['F'] = maybeAutoLink - } - if p.extensions&Footnotes != 0 { - p.notes = make([]*reference, 0) - } - return &p -} - -// Option customizes the Markdown processor's default behavior. -type Option func(*Markdown) - -// WithRenderer allows you to override the default renderer. -func WithRenderer(r Renderer) Option { - return func(p *Markdown) { - p.renderer = r - } -} - -// WithExtensions allows you to pick some of the many extensions provided by -// Blackfriday. You can bitwise OR them. -func WithExtensions(e Extensions) Option { - return func(p *Markdown) { - p.extensions = e - } -} - -// WithNoExtensions turns off all extensions and custom behavior. -func WithNoExtensions() Option { - return func(p *Markdown) { - p.extensions = NoExtensions - p.renderer = NewHTMLRenderer(HTMLRendererParameters{ - Flags: HTMLFlagsNone, - }) - } -} - -// WithRefOverride sets an optional function callback that is called every -// time a reference is resolved. -// -// In Markdown, the link reference syntax can be made to resolve a link to -// a reference instead of an inline URL, in one of the following ways: -// -// * [link text][refid] -// * [refid][] -// -// Usually, the refid is defined at the bottom of the Markdown document. If -// this override function is provided, the refid is passed to the override -// function first, before consulting the defined refids at the bottom. If -// the override function indicates an override did not occur, the refids at -// the bottom will be used to fill in the link details. -func WithRefOverride(o ReferenceOverrideFunc) Option { - return func(p *Markdown) { - p.referenceOverride = o - } -} - -// Run is the main entry point to Blackfriday. It parses and renders a -// block of markdown-encoded text. -// -// The simplest invocation of Run takes one argument, input: -// output := Run(input) -// This will parse the input with CommonExtensions enabled and render it with -// the default HTMLRenderer (with CommonHTMLFlags). -// -// Variadic arguments opts can customize the default behavior. Since Markdown -// type does not contain exported fields, you can not use it directly. Instead, -// use the With* functions. For example, this will call the most basic -// functionality, with no extensions: -// output := Run(input, WithNoExtensions()) -// -// You can use any number of With* arguments, even contradicting ones. They -// will be applied in order of appearance and the latter will override the -// former: -// output := Run(input, WithNoExtensions(), WithExtensions(exts), -// WithRenderer(yourRenderer)) -func Run(input []byte, opts ...Option) []byte { - r := NewHTMLRenderer(HTMLRendererParameters{ - Flags: CommonHTMLFlags, - }) - optList := []Option{WithRenderer(r), WithExtensions(CommonExtensions)} - optList = append(optList, opts...) - parser := New(optList...) - ast := parser.Parse(input) - var buf bytes.Buffer - parser.renderer.RenderHeader(&buf, ast) - ast.Walk(func(node *Node, entering bool) WalkStatus { - return parser.renderer.RenderNode(&buf, node, entering) - }) - parser.renderer.RenderFooter(&buf, ast) - return buf.Bytes() -} - -// Parse is an entry point to the parsing part of Blackfriday. It takes an -// input markdown document and produces a syntax tree for its contents. This -// tree can then be rendered with a default or custom renderer, or -// analyzed/transformed by the caller to whatever non-standard needs they have. -// The return value is the root node of the syntax tree. -func (p *Markdown) Parse(input []byte) *Node { - p.block(input) - // Walk the tree and finish up some of unfinished blocks - for p.tip != nil { - p.finalize(p.tip) - } - // Walk the tree again and process inline markdown in each block - p.doc.Walk(func(node *Node, entering bool) WalkStatus { - if node.Type == Paragraph || node.Type == Heading || node.Type == TableCell { - p.inline(node, node.content) - node.content = nil - } - return GoToNext - }) - p.parseRefsToAST() - return p.doc -} - -func (p *Markdown) parseRefsToAST() { - if p.extensions&Footnotes == 0 || len(p.notes) == 0 { - return - } - p.tip = p.doc - block := p.addBlock(List, nil) - block.IsFootnotesList = true - block.ListFlags = ListTypeOrdered - flags := ListItemBeginningOfList - // Note: this loop is intentionally explicit, not range-form. This is - // because the body of the loop will append nested footnotes to p.notes and - // we need to process those late additions. Range form would only walk over - // the fixed initial set. - for i := 0; i < len(p.notes); i++ { - ref := p.notes[i] - p.addExistingChild(ref.footnote, 0) - block := ref.footnote - block.ListFlags = flags | ListTypeOrdered - block.RefLink = ref.link - if ref.hasBlock { - flags |= ListItemContainsBlock - p.block(ref.title) - } else { - p.inline(block, ref.title) - } - flags &^= ListItemBeginningOfList | ListItemContainsBlock - } - above := block.Parent - finalizeList(block) - p.tip = above - block.Walk(func(node *Node, entering bool) WalkStatus { - if node.Type == Paragraph || node.Type == Heading { - p.inline(node, node.content) - node.content = nil - } - return GoToNext - }) -} - -// -// Link references -// -// This section implements support for references that (usually) appear -// as footnotes in a document, and can be referenced anywhere in the document. -// The basic format is: -// -// [1]: http://www.google.com/ "Google" -// [2]: http://www.github.com/ "Github" -// -// Anywhere in the document, the reference can be linked by referring to its -// label, i.e., 1 and 2 in this example, as in: -// -// This library is hosted on [Github][2], a git hosting site. -// -// Actual footnotes as specified in Pandoc and supported by some other Markdown -// libraries such as php-markdown are also taken care of. They look like this: -// -// This sentence needs a bit of further explanation.[^note] -// -// [^note]: This is the explanation. -// -// Footnotes should be placed at the end of the document in an ordered list. -// Finally, there are inline footnotes such as: -// -// Inline footnotes^[Also supported.] provide a quick inline explanation, -// but are rendered at the bottom of the document. -// - -// reference holds all information necessary for a reference-style links or -// footnotes. -// -// Consider this markdown with reference-style links: -// -// [link][ref] -// -// [ref]: /url/ "tooltip title" -// -// It will be ultimately converted to this HTML: -// -//

    link

    -// -// And a reference structure will be populated as follows: -// -// p.refs["ref"] = &reference{ -// link: "/url/", -// title: "tooltip title", -// } -// -// Alternatively, reference can contain information about a footnote. Consider -// this markdown: -// -// Text needing a footnote.[^a] -// -// [^a]: This is the note -// -// A reference structure will be populated as follows: -// -// p.refs["a"] = &reference{ -// link: "a", -// title: "This is the note", -// noteID: , -// } -// -// TODO: As you can see, it begs for splitting into two dedicated structures -// for refs and for footnotes. -type reference struct { - link []byte - title []byte - noteID int // 0 if not a footnote ref - hasBlock bool - footnote *Node // a link to the Item node within a list of footnotes - - text []byte // only gets populated by refOverride feature with Reference.Text -} - -func (r *reference) String() string { - return fmt.Sprintf("{link: %q, title: %q, text: %q, noteID: %d, hasBlock: %v}", - r.link, r.title, r.text, r.noteID, r.hasBlock) -} - -// Check whether or not data starts with a reference link. -// If so, it is parsed and stored in the list of references -// (in the render struct). -// Returns the number of bytes to skip to move past it, -// or zero if the first line is not a reference. -func isReference(p *Markdown, data []byte, tabSize int) int { - // up to 3 optional leading spaces - if len(data) < 4 { - return 0 - } - i := 0 - for i < 3 && data[i] == ' ' { - i++ - } - - noteID := 0 - - // id part: anything but a newline between brackets - if data[i] != '[' { - return 0 - } - i++ - if p.extensions&Footnotes != 0 { - if i < len(data) && data[i] == '^' { - // we can set it to anything here because the proper noteIds will - // be assigned later during the second pass. It just has to be != 0 - noteID = 1 - i++ - } - } - idOffset := i - for i < len(data) && data[i] != '\n' && data[i] != '\r' && data[i] != ']' { - i++ - } - if i >= len(data) || data[i] != ']' { - return 0 - } - idEnd := i - // footnotes can have empty ID, like this: [^], but a reference can not be - // empty like this: []. Break early if it's not a footnote and there's no ID - if noteID == 0 && idOffset == idEnd { - return 0 - } - // spacer: colon (space | tab)* newline? (space | tab)* - i++ - if i >= len(data) || data[i] != ':' { - return 0 - } - i++ - for i < len(data) && (data[i] == ' ' || data[i] == '\t') { - i++ - } - if i < len(data) && (data[i] == '\n' || data[i] == '\r') { - i++ - if i < len(data) && data[i] == '\n' && data[i-1] == '\r' { - i++ - } - } - for i < len(data) && (data[i] == ' ' || data[i] == '\t') { - i++ - } - if i >= len(data) { - return 0 - } - - var ( - linkOffset, linkEnd int - titleOffset, titleEnd int - lineEnd int - raw []byte - hasBlock bool - ) - - if p.extensions&Footnotes != 0 && noteID != 0 { - linkOffset, linkEnd, raw, hasBlock = scanFootnote(p, data, i, tabSize) - lineEnd = linkEnd - } else { - linkOffset, linkEnd, titleOffset, titleEnd, lineEnd = scanLinkRef(p, data, i) - } - if lineEnd == 0 { - return 0 - } - - // a valid ref has been found - - ref := &reference{ - noteID: noteID, - hasBlock: hasBlock, - } - - if noteID > 0 { - // reusing the link field for the id since footnotes don't have links - ref.link = data[idOffset:idEnd] - // if footnote, it's not really a title, it's the contained text - ref.title = raw - } else { - ref.link = data[linkOffset:linkEnd] - ref.title = data[titleOffset:titleEnd] - } - - // id matches are case-insensitive - id := string(bytes.ToLower(data[idOffset:idEnd])) - - p.refs[id] = ref - - return lineEnd -} - -func scanLinkRef(p *Markdown, data []byte, i int) (linkOffset, linkEnd, titleOffset, titleEnd, lineEnd int) { - // link: whitespace-free sequence, optionally between angle brackets - if data[i] == '<' { - i++ - } - linkOffset = i - for i < len(data) && data[i] != ' ' && data[i] != '\t' && data[i] != '\n' && data[i] != '\r' { - i++ - } - linkEnd = i - if data[linkOffset] == '<' && data[linkEnd-1] == '>' { - linkOffset++ - linkEnd-- - } - - // optional spacer: (space | tab)* (newline | '\'' | '"' | '(' ) - for i < len(data) && (data[i] == ' ' || data[i] == '\t') { - i++ - } - if i < len(data) && data[i] != '\n' && data[i] != '\r' && data[i] != '\'' && data[i] != '"' && data[i] != '(' { - return - } - - // compute end-of-line - if i >= len(data) || data[i] == '\r' || data[i] == '\n' { - lineEnd = i - } - if i+1 < len(data) && data[i] == '\r' && data[i+1] == '\n' { - lineEnd++ - } - - // optional (space|tab)* spacer after a newline - if lineEnd > 0 { - i = lineEnd + 1 - for i < len(data) && (data[i] == ' ' || data[i] == '\t') { - i++ - } - } - - // optional title: any non-newline sequence enclosed in '"() alone on its line - if i+1 < len(data) && (data[i] == '\'' || data[i] == '"' || data[i] == '(') { - i++ - titleOffset = i - - // look for EOL - for i < len(data) && data[i] != '\n' && data[i] != '\r' { - i++ - } - if i+1 < len(data) && data[i] == '\n' && data[i+1] == '\r' { - titleEnd = i + 1 - } else { - titleEnd = i - } - - // step back - i-- - for i > titleOffset && (data[i] == ' ' || data[i] == '\t') { - i-- - } - if i > titleOffset && (data[i] == '\'' || data[i] == '"' || data[i] == ')') { - lineEnd = titleEnd - titleEnd = i - } - } - - return -} - -// The first bit of this logic is the same as Parser.listItem, but the rest -// is much simpler. This function simply finds the entire block and shifts it -// over by one tab if it is indeed a block (just returns the line if it's not). -// blockEnd is the end of the section in the input buffer, and contents is the -// extracted text that was shifted over one tab. It will need to be rendered at -// the end of the document. -func scanFootnote(p *Markdown, data []byte, i, indentSize int) (blockStart, blockEnd int, contents []byte, hasBlock bool) { - if i == 0 || len(data) == 0 { - return - } - - // skip leading whitespace on first line - for i < len(data) && data[i] == ' ' { - i++ - } - - blockStart = i - - // find the end of the line - blockEnd = i - for i < len(data) && data[i-1] != '\n' { - i++ - } - - // get working buffer - var raw bytes.Buffer - - // put the first line into the working buffer - raw.Write(data[blockEnd:i]) - blockEnd = i - - // process the following lines - containsBlankLine := false - -gatherLines: - for blockEnd < len(data) { - i++ - - // find the end of this line - for i < len(data) && data[i-1] != '\n' { - i++ - } - - // if it is an empty line, guess that it is part of this item - // and move on to the next line - if p.isEmpty(data[blockEnd:i]) > 0 { - containsBlankLine = true - blockEnd = i - continue - } - - n := 0 - if n = isIndented(data[blockEnd:i], indentSize); n == 0 { - // this is the end of the block. - // we don't want to include this last line in the index. - break gatherLines - } - - // if there were blank lines before this one, insert a new one now - if containsBlankLine { - raw.WriteByte('\n') - containsBlankLine = false - } - - // get rid of that first tab, write to buffer - raw.Write(data[blockEnd+n : i]) - hasBlock = true - - blockEnd = i - } - - if data[blockEnd-1] != '\n' { - raw.WriteByte('\n') - } - - contents = raw.Bytes() - - return -} - -// -// -// Miscellaneous helper functions -// -// - -// Test if a character is a punctuation symbol. -// Taken from a private function in regexp in the stdlib. -func ispunct(c byte) bool { - for _, r := range []byte("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~") { - if c == r { - return true - } - } - return false -} - -// Test if a character is a whitespace character. -func isspace(c byte) bool { - return ishorizontalspace(c) || isverticalspace(c) -} - -// Test if a character is a horizontal whitespace character. -func ishorizontalspace(c byte) bool { - return c == ' ' || c == '\t' -} - -// Test if a character is a vertical character. -func isverticalspace(c byte) bool { - return c == '\n' || c == '\r' || c == '\f' || c == '\v' -} - -// Test if a character is letter. -func isletter(c byte) bool { - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') -} - -// Test if a character is a letter or a digit. -// TODO: check when this is looking for ASCII alnum and when it should use unicode -func isalnum(c byte) bool { - return (c >= '0' && c <= '9') || isletter(c) -} - -// Replace tab characters with spaces, aligning to the next TAB_SIZE column. -// always ends output with a newline -func expandTabs(out *bytes.Buffer, line []byte, tabSize int) { - // first, check for common cases: no tabs, or only tabs at beginning of line - i, prefix := 0, 0 - slowcase := false - for i = 0; i < len(line); i++ { - if line[i] == '\t' { - if prefix == i { - prefix++ - } else { - slowcase = true - break - } - } - } - - // no need to decode runes if all tabs are at the beginning of the line - if !slowcase { - for i = 0; i < prefix*tabSize; i++ { - out.WriteByte(' ') - } - out.Write(line[prefix:]) - return - } - - // the slow case: we need to count runes to figure out how - // many spaces to insert for each tab - column := 0 - i = 0 - for i < len(line) { - start := i - for i < len(line) && line[i] != '\t' { - _, size := utf8.DecodeRune(line[i:]) - i += size - column++ - } - - if i > start { - out.Write(line[start:i]) - } - - if i >= len(line) { - break - } - - for { - out.WriteByte(' ') - column++ - if column%tabSize == 0 { - break - } - } - - i++ - } -} - -// Find if a line counts as indented or not. -// Returns number of characters the indent is (0 = not indented). -func isIndented(data []byte, indentSize int) int { - if len(data) == 0 { - return 0 - } - if data[0] == '\t' { - return 1 - } - if len(data) < indentSize { - return 0 - } - for i := 0; i < indentSize; i++ { - if data[i] != ' ' { - return 0 - } - } - return indentSize -} - -// Create a url-safe slug for fragments -func slugify(in []byte) []byte { - if len(in) == 0 { - return in - } - out := make([]byte, 0, len(in)) - sym := false - - for _, ch := range in { - if isalnum(ch) { - sym = false - out = append(out, ch) - } else if sym { - continue - } else { - out = append(out, '-') - sym = true - } - } - var a, b int - var ch byte - for a, ch = range out { - if ch != '-' { - break - } - } - for b = len(out) - 1; b > 0; b-- { - if out[b] != '-' { - break - } - } - return out[a : b+1] -} diff --git a/vendor/github.com/russross/blackfriday/v2/node.go b/vendor/github.com/russross/blackfriday/v2/node.go deleted file mode 100644 index 04e6050cee..0000000000 --- a/vendor/github.com/russross/blackfriday/v2/node.go +++ /dev/null @@ -1,360 +0,0 @@ -package blackfriday - -import ( - "bytes" - "fmt" -) - -// NodeType specifies a type of a single node of a syntax tree. Usually one -// node (and its type) corresponds to a single markdown feature, e.g. emphasis -// or code block. -type NodeType int - -// Constants for identifying different types of nodes. See NodeType. -const ( - Document NodeType = iota - BlockQuote - List - Item - Paragraph - Heading - HorizontalRule - Emph - Strong - Del - Link - Image - Text - HTMLBlock - CodeBlock - Softbreak - Hardbreak - Code - HTMLSpan - Table - TableCell - TableHead - TableBody - TableRow -) - -var nodeTypeNames = []string{ - Document: "Document", - BlockQuote: "BlockQuote", - List: "List", - Item: "Item", - Paragraph: "Paragraph", - Heading: "Heading", - HorizontalRule: "HorizontalRule", - Emph: "Emph", - Strong: "Strong", - Del: "Del", - Link: "Link", - Image: "Image", - Text: "Text", - HTMLBlock: "HTMLBlock", - CodeBlock: "CodeBlock", - Softbreak: "Softbreak", - Hardbreak: "Hardbreak", - Code: "Code", - HTMLSpan: "HTMLSpan", - Table: "Table", - TableCell: "TableCell", - TableHead: "TableHead", - TableBody: "TableBody", - TableRow: "TableRow", -} - -func (t NodeType) String() string { - return nodeTypeNames[t] -} - -// ListData contains fields relevant to a List and Item node type. -type ListData struct { - ListFlags ListType - Tight bool // Skip

    s around list item data if true - BulletChar byte // '*', '+' or '-' in bullet lists - Delimiter byte // '.' or ')' after the number in ordered lists - RefLink []byte // If not nil, turns this list item into a footnote item and triggers different rendering - IsFootnotesList bool // This is a list of footnotes -} - -// LinkData contains fields relevant to a Link node type. -type LinkData struct { - Destination []byte // Destination is what goes into a href - Title []byte // Title is the tooltip thing that goes in a title attribute - NoteID int // NoteID contains a serial number of a footnote, zero if it's not a footnote - Footnote *Node // If it's a footnote, this is a direct link to the footnote Node. Otherwise nil. -} - -// CodeBlockData contains fields relevant to a CodeBlock node type. -type CodeBlockData struct { - IsFenced bool // Specifies whether it's a fenced code block or an indented one - Info []byte // This holds the info string - FenceChar byte - FenceLength int - FenceOffset int -} - -// TableCellData contains fields relevant to a TableCell node type. -type TableCellData struct { - IsHeader bool // This tells if it's under the header row - Align CellAlignFlags // This holds the value for align attribute -} - -// HeadingData contains fields relevant to a Heading node type. -type HeadingData struct { - Level int // This holds the heading level number - HeadingID string // This might hold heading ID, if present - IsTitleblock bool // Specifies whether it's a title block -} - -// Node is a single element in the abstract syntax tree of the parsed document. -// It holds connections to the structurally neighboring nodes and, for certain -// types of nodes, additional information that might be needed when rendering. -type Node struct { - Type NodeType // Determines the type of the node - Parent *Node // Points to the parent - FirstChild *Node // Points to the first child, if any - LastChild *Node // Points to the last child, if any - Prev *Node // Previous sibling; nil if it's the first child - Next *Node // Next sibling; nil if it's the last child - - Literal []byte // Text contents of the leaf nodes - - HeadingData // Populated if Type is Heading - ListData // Populated if Type is List - CodeBlockData // Populated if Type is CodeBlock - LinkData // Populated if Type is Link - TableCellData // Populated if Type is TableCell - - content []byte // Markdown content of the block nodes - open bool // Specifies an open block node that has not been finished to process yet -} - -// NewNode allocates a node of a specified type. -func NewNode(typ NodeType) *Node { - return &Node{ - Type: typ, - open: true, - } -} - -func (n *Node) String() string { - ellipsis := "" - snippet := n.Literal - if len(snippet) > 16 { - snippet = snippet[:16] - ellipsis = "..." - } - return fmt.Sprintf("%s: '%s%s'", n.Type, snippet, ellipsis) -} - -// Unlink removes node 'n' from the tree. -// It panics if the node is nil. -func (n *Node) Unlink() { - if n.Prev != nil { - n.Prev.Next = n.Next - } else if n.Parent != nil { - n.Parent.FirstChild = n.Next - } - if n.Next != nil { - n.Next.Prev = n.Prev - } else if n.Parent != nil { - n.Parent.LastChild = n.Prev - } - n.Parent = nil - n.Next = nil - n.Prev = nil -} - -// AppendChild adds a node 'child' as a child of 'n'. -// It panics if either node is nil. -func (n *Node) AppendChild(child *Node) { - child.Unlink() - child.Parent = n - if n.LastChild != nil { - n.LastChild.Next = child - child.Prev = n.LastChild - n.LastChild = child - } else { - n.FirstChild = child - n.LastChild = child - } -} - -// InsertBefore inserts 'sibling' immediately before 'n'. -// It panics if either node is nil. -func (n *Node) InsertBefore(sibling *Node) { - sibling.Unlink() - sibling.Prev = n.Prev - if sibling.Prev != nil { - sibling.Prev.Next = sibling - } - sibling.Next = n - n.Prev = sibling - sibling.Parent = n.Parent - if sibling.Prev == nil { - sibling.Parent.FirstChild = sibling - } -} - -// IsContainer returns true if 'n' can contain children. -func (n *Node) IsContainer() bool { - switch n.Type { - case Document: - fallthrough - case BlockQuote: - fallthrough - case List: - fallthrough - case Item: - fallthrough - case Paragraph: - fallthrough - case Heading: - fallthrough - case Emph: - fallthrough - case Strong: - fallthrough - case Del: - fallthrough - case Link: - fallthrough - case Image: - fallthrough - case Table: - fallthrough - case TableHead: - fallthrough - case TableBody: - fallthrough - case TableRow: - fallthrough - case TableCell: - return true - default: - return false - } -} - -// IsLeaf returns true if 'n' is a leaf node. -func (n *Node) IsLeaf() bool { - return !n.IsContainer() -} - -func (n *Node) canContain(t NodeType) bool { - if n.Type == List { - return t == Item - } - if n.Type == Document || n.Type == BlockQuote || n.Type == Item { - return t != Item - } - if n.Type == Table { - return t == TableHead || t == TableBody - } - if n.Type == TableHead || n.Type == TableBody { - return t == TableRow - } - if n.Type == TableRow { - return t == TableCell - } - return false -} - -// WalkStatus allows NodeVisitor to have some control over the tree traversal. -// It is returned from NodeVisitor and different values allow Node.Walk to -// decide which node to go to next. -type WalkStatus int - -const ( - // GoToNext is the default traversal of every node. - GoToNext WalkStatus = iota - // SkipChildren tells walker to skip all children of current node. - SkipChildren - // Terminate tells walker to terminate the traversal. - Terminate -) - -// NodeVisitor is a callback to be called when traversing the syntax tree. -// Called twice for every node: once with entering=true when the branch is -// first visited, then with entering=false after all the children are done. -type NodeVisitor func(node *Node, entering bool) WalkStatus - -// Walk is a convenience method that instantiates a walker and starts a -// traversal of subtree rooted at n. -func (n *Node) Walk(visitor NodeVisitor) { - w := newNodeWalker(n) - for w.current != nil { - status := visitor(w.current, w.entering) - switch status { - case GoToNext: - w.next() - case SkipChildren: - w.entering = false - w.next() - case Terminate: - return - } - } -} - -type nodeWalker struct { - current *Node - root *Node - entering bool -} - -func newNodeWalker(root *Node) *nodeWalker { - return &nodeWalker{ - current: root, - root: root, - entering: true, - } -} - -func (nw *nodeWalker) next() { - if (!nw.current.IsContainer() || !nw.entering) && nw.current == nw.root { - nw.current = nil - return - } - if nw.entering && nw.current.IsContainer() { - if nw.current.FirstChild != nil { - nw.current = nw.current.FirstChild - nw.entering = true - } else { - nw.entering = false - } - } else if nw.current.Next == nil { - nw.current = nw.current.Parent - nw.entering = false - } else { - nw.current = nw.current.Next - nw.entering = true - } -} - -func dump(ast *Node) { - fmt.Println(dumpString(ast)) -} - -func dumpR(ast *Node, depth int) string { - if ast == nil { - return "" - } - indent := bytes.Repeat([]byte("\t"), depth) - content := ast.Literal - if content == nil { - content = ast.content - } - result := fmt.Sprintf("%s%s(%q)\n", indent, ast.Type, content) - for n := ast.FirstChild; n != nil; n = n.Next { - result += dumpR(n, depth+1) - } - return result -} - -func dumpString(ast *Node) string { - return dumpR(ast, 0) -} diff --git a/vendor/github.com/russross/blackfriday/v2/smartypants.go b/vendor/github.com/russross/blackfriday/v2/smartypants.go deleted file mode 100644 index 3a220e9424..0000000000 --- a/vendor/github.com/russross/blackfriday/v2/smartypants.go +++ /dev/null @@ -1,457 +0,0 @@ -// -// Blackfriday Markdown Processor -// Available at http://github.com/russross/blackfriday -// -// Copyright © 2011 Russ Ross . -// Distributed under the Simplified BSD License. -// See README.md for details. -// - -// -// -// SmartyPants rendering -// -// - -package blackfriday - -import ( - "bytes" - "io" -) - -// SPRenderer is a struct containing state of a Smartypants renderer. -type SPRenderer struct { - inSingleQuote bool - inDoubleQuote bool - callbacks [256]smartCallback -} - -func wordBoundary(c byte) bool { - return c == 0 || isspace(c) || ispunct(c) -} - -func tolower(c byte) byte { - if c >= 'A' && c <= 'Z' { - return c - 'A' + 'a' - } - return c -} - -func isdigit(c byte) bool { - return c >= '0' && c <= '9' -} - -func smartQuoteHelper(out *bytes.Buffer, previousChar byte, nextChar byte, quote byte, isOpen *bool, addNBSP bool) bool { - // edge of the buffer is likely to be a tag that we don't get to see, - // so we treat it like text sometimes - - // enumerate all sixteen possibilities for (previousChar, nextChar) - // each can be one of {0, space, punct, other} - switch { - case previousChar == 0 && nextChar == 0: - // context is not any help here, so toggle - *isOpen = !*isOpen - case isspace(previousChar) && nextChar == 0: - // [ "] might be [ "foo...] - *isOpen = true - case ispunct(previousChar) && nextChar == 0: - // [!"] hmm... could be [Run!"] or [("...] - *isOpen = false - case /* isnormal(previousChar) && */ nextChar == 0: - // [a"] is probably a close - *isOpen = false - case previousChar == 0 && isspace(nextChar): - // [" ] might be [...foo" ] - *isOpen = false - case isspace(previousChar) && isspace(nextChar): - // [ " ] context is not any help here, so toggle - *isOpen = !*isOpen - case ispunct(previousChar) && isspace(nextChar): - // [!" ] is probably a close - *isOpen = false - case /* isnormal(previousChar) && */ isspace(nextChar): - // [a" ] this is one of the easy cases - *isOpen = false - case previousChar == 0 && ispunct(nextChar): - // ["!] hmm... could be ["$1.95] or ["!...] - *isOpen = false - case isspace(previousChar) && ispunct(nextChar): - // [ "!] looks more like [ "$1.95] - *isOpen = true - case ispunct(previousChar) && ispunct(nextChar): - // [!"!] context is not any help here, so toggle - *isOpen = !*isOpen - case /* isnormal(previousChar) && */ ispunct(nextChar): - // [a"!] is probably a close - *isOpen = false - case previousChar == 0 /* && isnormal(nextChar) */ : - // ["a] is probably an open - *isOpen = true - case isspace(previousChar) /* && isnormal(nextChar) */ : - // [ "a] this is one of the easy cases - *isOpen = true - case ispunct(previousChar) /* && isnormal(nextChar) */ : - // [!"a] is probably an open - *isOpen = true - default: - // [a'b] maybe a contraction? - *isOpen = false - } - - // Note that with the limited lookahead, this non-breaking - // space will also be appended to single double quotes. - if addNBSP && !*isOpen { - out.WriteString(" ") - } - - out.WriteByte('&') - if *isOpen { - out.WriteByte('l') - } else { - out.WriteByte('r') - } - out.WriteByte(quote) - out.WriteString("quo;") - - if addNBSP && *isOpen { - out.WriteString(" ") - } - - return true -} - -func (r *SPRenderer) smartSingleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 2 { - t1 := tolower(text[1]) - - if t1 == '\'' { - nextChar := byte(0) - if len(text) >= 3 { - nextChar = text[2] - } - if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { - return 1 - } - } - - if (t1 == 's' || t1 == 't' || t1 == 'm' || t1 == 'd') && (len(text) < 3 || wordBoundary(text[2])) { - out.WriteString("’") - return 0 - } - - if len(text) >= 3 { - t2 := tolower(text[2]) - - if ((t1 == 'r' && t2 == 'e') || (t1 == 'l' && t2 == 'l') || (t1 == 'v' && t2 == 'e')) && - (len(text) < 4 || wordBoundary(text[3])) { - out.WriteString("’") - return 0 - } - } - } - - nextChar := byte(0) - if len(text) > 1 { - nextChar = text[1] - } - if smartQuoteHelper(out, previousChar, nextChar, 's', &r.inSingleQuote, false) { - return 0 - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartParens(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 3 { - t1 := tolower(text[1]) - t2 := tolower(text[2]) - - if t1 == 'c' && t2 == ')' { - out.WriteString("©") - return 2 - } - - if t1 == 'r' && t2 == ')' { - out.WriteString("®") - return 2 - } - - if len(text) >= 4 && t1 == 't' && t2 == 'm' && text[3] == ')' { - out.WriteString("™") - return 3 - } - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartDash(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 2 { - if text[1] == '-' { - out.WriteString("—") - return 1 - } - - if wordBoundary(previousChar) && wordBoundary(text[1]) { - out.WriteString("–") - return 0 - } - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartDashLatex(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 3 && text[1] == '-' && text[2] == '-' { - out.WriteString("—") - return 2 - } - if len(text) >= 2 && text[1] == '-' { - out.WriteString("–") - return 1 - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartAmpVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte, addNBSP bool) int { - if bytes.HasPrefix(text, []byte(""")) { - nextChar := byte(0) - if len(text) >= 7 { - nextChar = text[6] - } - if smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, addNBSP) { - return 5 - } - } - - if bytes.HasPrefix(text, []byte("�")) { - return 3 - } - - out.WriteByte('&') - return 0 -} - -func (r *SPRenderer) smartAmp(angledQuotes, addNBSP bool) func(*bytes.Buffer, byte, []byte) int { - var quote byte = 'd' - if angledQuotes { - quote = 'a' - } - - return func(out *bytes.Buffer, previousChar byte, text []byte) int { - return r.smartAmpVariant(out, previousChar, text, quote, addNBSP) - } -} - -func (r *SPRenderer) smartPeriod(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 3 && text[1] == '.' && text[2] == '.' { - out.WriteString("…") - return 2 - } - - if len(text) >= 5 && text[1] == ' ' && text[2] == '.' && text[3] == ' ' && text[4] == '.' { - out.WriteString("…") - return 4 - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartBacktick(out *bytes.Buffer, previousChar byte, text []byte) int { - if len(text) >= 2 && text[1] == '`' { - nextChar := byte(0) - if len(text) >= 3 { - nextChar = text[2] - } - if smartQuoteHelper(out, previousChar, nextChar, 'd', &r.inDoubleQuote, false) { - return 1 - } - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartNumberGeneric(out *bytes.Buffer, previousChar byte, text []byte) int { - if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { - // is it of the form digits/digits(word boundary)?, i.e., \d+/\d+\b - // note: check for regular slash (/) or fraction slash (⁄, 0x2044, or 0xe2 81 84 in utf-8) - // and avoid changing dates like 1/23/2005 into fractions. - numEnd := 0 - for len(text) > numEnd && isdigit(text[numEnd]) { - numEnd++ - } - if numEnd == 0 { - out.WriteByte(text[0]) - return 0 - } - denStart := numEnd + 1 - if len(text) > numEnd+3 && text[numEnd] == 0xe2 && text[numEnd+1] == 0x81 && text[numEnd+2] == 0x84 { - denStart = numEnd + 3 - } else if len(text) < numEnd+2 || text[numEnd] != '/' { - out.WriteByte(text[0]) - return 0 - } - denEnd := denStart - for len(text) > denEnd && isdigit(text[denEnd]) { - denEnd++ - } - if denEnd == denStart { - out.WriteByte(text[0]) - return 0 - } - if len(text) == denEnd || wordBoundary(text[denEnd]) && text[denEnd] != '/' { - out.WriteString("") - out.Write(text[:numEnd]) - out.WriteString("") - out.Write(text[denStart:denEnd]) - out.WriteString("") - return denEnd - 1 - } - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartNumber(out *bytes.Buffer, previousChar byte, text []byte) int { - if wordBoundary(previousChar) && previousChar != '/' && len(text) >= 3 { - if text[0] == '1' && text[1] == '/' && text[2] == '2' { - if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' { - out.WriteString("½") - return 2 - } - } - - if text[0] == '1' && text[1] == '/' && text[2] == '4' { - if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 5 && tolower(text[3]) == 't' && tolower(text[4]) == 'h') { - out.WriteString("¼") - return 2 - } - } - - if text[0] == '3' && text[1] == '/' && text[2] == '4' { - if len(text) < 4 || wordBoundary(text[3]) && text[3] != '/' || (len(text) >= 6 && tolower(text[3]) == 't' && tolower(text[4]) == 'h' && tolower(text[5]) == 's') { - out.WriteString("¾") - return 2 - } - } - } - - out.WriteByte(text[0]) - return 0 -} - -func (r *SPRenderer) smartDoubleQuoteVariant(out *bytes.Buffer, previousChar byte, text []byte, quote byte) int { - nextChar := byte(0) - if len(text) > 1 { - nextChar = text[1] - } - if !smartQuoteHelper(out, previousChar, nextChar, quote, &r.inDoubleQuote, false) { - out.WriteString(""") - } - - return 0 -} - -func (r *SPRenderer) smartDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { - return r.smartDoubleQuoteVariant(out, previousChar, text, 'd') -} - -func (r *SPRenderer) smartAngledDoubleQuote(out *bytes.Buffer, previousChar byte, text []byte) int { - return r.smartDoubleQuoteVariant(out, previousChar, text, 'a') -} - -func (r *SPRenderer) smartLeftAngle(out *bytes.Buffer, previousChar byte, text []byte) int { - i := 0 - - for i < len(text) && text[i] != '>' { - i++ - } - - out.Write(text[:i+1]) - return i -} - -type smartCallback func(out *bytes.Buffer, previousChar byte, text []byte) int - -// NewSmartypantsRenderer constructs a Smartypants renderer object. -func NewSmartypantsRenderer(flags HTMLFlags) *SPRenderer { - var ( - r SPRenderer - - smartAmpAngled = r.smartAmp(true, false) - smartAmpAngledNBSP = r.smartAmp(true, true) - smartAmpRegular = r.smartAmp(false, false) - smartAmpRegularNBSP = r.smartAmp(false, true) - - addNBSP = flags&SmartypantsQuotesNBSP != 0 - ) - - if flags&SmartypantsAngledQuotes == 0 { - r.callbacks['"'] = r.smartDoubleQuote - if !addNBSP { - r.callbacks['&'] = smartAmpRegular - } else { - r.callbacks['&'] = smartAmpRegularNBSP - } - } else { - r.callbacks['"'] = r.smartAngledDoubleQuote - if !addNBSP { - r.callbacks['&'] = smartAmpAngled - } else { - r.callbacks['&'] = smartAmpAngledNBSP - } - } - r.callbacks['\''] = r.smartSingleQuote - r.callbacks['('] = r.smartParens - if flags&SmartypantsDashes != 0 { - if flags&SmartypantsLatexDashes == 0 { - r.callbacks['-'] = r.smartDash - } else { - r.callbacks['-'] = r.smartDashLatex - } - } - r.callbacks['.'] = r.smartPeriod - if flags&SmartypantsFractions == 0 { - r.callbacks['1'] = r.smartNumber - r.callbacks['3'] = r.smartNumber - } else { - for ch := '1'; ch <= '9'; ch++ { - r.callbacks[ch] = r.smartNumberGeneric - } - } - r.callbacks['<'] = r.smartLeftAngle - r.callbacks['`'] = r.smartBacktick - return &r -} - -// Process is the entry point of the Smartypants renderer. -func (r *SPRenderer) Process(w io.Writer, text []byte) { - mark := 0 - for i := 0; i < len(text); i++ { - if action := r.callbacks[text[i]]; action != nil { - if i > mark { - w.Write(text[mark:i]) - } - previousChar := byte(0) - if i > 0 { - previousChar = text[i-1] - } - var tmp bytes.Buffer - i += action(&tmp, previousChar, text[i:]) - w.Write(tmp.Bytes()) - mark = i + 1 - } - } - if mark < len(text) { - w.Write(text[mark:]) - } -} diff --git a/vendor/github.com/ryancurrah/gomodguard/.dockerignore b/vendor/github.com/ryancurrah/gomodguard/.dockerignore deleted file mode 100644 index 77738287f0..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -dist/ \ No newline at end of file diff --git a/vendor/github.com/ryancurrah/gomodguard/.gitignore b/vendor/github.com/ryancurrah/gomodguard/.gitignore deleted file mode 100644 index 4ebc79c5d9..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -/gomodguard - -*.xml - -dist/ - -coverage.* - -.idea/ diff --git a/vendor/github.com/ryancurrah/gomodguard/.golangci.yml b/vendor/github.com/ryancurrah/gomodguard/.golangci.yml deleted file mode 100644 index a0e6fd55ea..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/.golangci.yml +++ /dev/null @@ -1,111 +0,0 @@ -# See https://golangci-lint.run/usage/configuration/ - -linters-settings: - revive: - # see https://github.com/mgechev/revive#available-rules for details. - ignore-generated-header: true - severity: warning - rules: - - name: atomic - - name: blank-imports - - name: bool-literal-in-expr - - name: call-to-gc - - name: confusing-naming - - name: confusing-results - - name: constant-logical-expr - - name: context-as-argument - - name: context-keys-type - - name: deep-exit - - name: defer - - name: dot-imports - - name: duplicated-imports - - name: early-return - - name: empty-block - - name: empty-lines - - name: error-naming - - name: error-return - - name: error-strings - - name: errorf - - name: exported - - name: get-return - - name: identical-branches - - name: if-return - - name: import-shadowing - - name: increment-decrement - - name: indent-error-flow - - name: modifies-parameter - - name: modifies-value-receiver - - name: package-comments - - name: range - - name: range-val-address - - name: range-val-in-closure - - name: receiver-naming - - name: redefines-builtin-id - - name: string-of-int - - name: struct-tag - - name: superfluous-else - - name: time-naming - - name: unconditional-recursion - - name: unexported-naming - - name: unexported-return - - name: unnecessary-stmt - - name: unreachable-code - - name: unused-parameter - - name: var-declaration - - name: var-naming - - name: waitgroup-by-value - -linters: - disable-all: true - enable: - - asciicheck - - bodyclose - - dogsled - - dupl - - durationcheck - - errcheck - - errorlint - - exhaustive - - exportloopref - - forcetypeassert - - funlen - - gochecknoinits - - gocognit - - goconst - - gocritic - - gocyclo - - godot - - godox - - goimports - - gomoddirectives - - gomodguard - - goprintffuncname - - gosec - - gosimple - - govet - - importas - - ineffassign - - lll - - makezero - - misspell - - nakedret - - nestif - - nilerr - - noctx - - nolintlint - - prealloc - - predeclared - - revive - - rowserrcheck - - sqlclosecheck - - staticcheck - - stylecheck - - testpackage - - thelper - - tparallel - - typecheck - - unconvert - - unparam - - unused - - whitespace - - wsl diff --git a/vendor/github.com/ryancurrah/gomodguard/.goreleaser.yml b/vendor/github.com/ryancurrah/gomodguard/.goreleaser.yml deleted file mode 100644 index f3675a9c27..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/.goreleaser.yml +++ /dev/null @@ -1,28 +0,0 @@ -builds: -- main: ./cmd/gomodguard/main.go - env: - - CGO_ENABLED=0 -archives: -- name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} -checksum: - name_template: 'checksums.txt' -dockers: -- goos: linux - goarch: amd64 - image_templates: - - "ryancurrah/gomodguard:latest" - - "ryancurrah/gomodguard:{{.Tag}}" - skip_push: false - dockerfile: Dockerfile.goreleaser - build_flag_templates: - - "--pull" - - "--label=org.opencontainers.image.created={{.Date}}" - - "--label=org.opencontainers.image.name={{.ProjectName}}" - - "--label=org.opencontainers.image.revision={{.FullCommit}}" - - "--label=org.opencontainers.image.version={{.Version}}" - - "--label=org.opencontainers.image.source={{.GitURL}}" diff --git a/vendor/github.com/ryancurrah/gomodguard/Dockerfile b/vendor/github.com/ryancurrah/gomodguard/Dockerfile deleted file mode 100644 index 2f1d3340c1..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -# ---- Build container -FROM golang:alpine AS builder -WORKDIR /gomodguard -COPY . . -RUN apk add --no-cache git -RUN go build -o gomodguard cmd/gomodguard/main.go - -# ---- App container -FROM golang:alpine -WORKDIR / -RUN apk --no-cache add ca-certificates -COPY --from=builder gomodguard/gomodguard / -ENTRYPOINT ./gomodguard diff --git a/vendor/github.com/ryancurrah/gomodguard/Dockerfile.goreleaser b/vendor/github.com/ryancurrah/gomodguard/Dockerfile.goreleaser deleted file mode 100644 index ccaaa8959f..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/Dockerfile.goreleaser +++ /dev/null @@ -1,6 +0,0 @@ -# ---- App container -FROM golang:alpine -WORKDIR / -RUN apk --no-cache add ca-certificates -COPY gomodguard /gomodguard -ENTRYPOINT ./gomodguard diff --git a/vendor/github.com/ryancurrah/gomodguard/LICENSE b/vendor/github.com/ryancurrah/gomodguard/LICENSE deleted file mode 100644 index acd8a81e16..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Ryan Currah - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/ryancurrah/gomodguard/Makefile b/vendor/github.com/ryancurrah/gomodguard/Makefile deleted file mode 100644 index 5235d5aade..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -current_dir = $(shell pwd) - -.PHONY: lint -lint: - golangci-lint run ./... - -.PHONY: build -build: - go build -o gomodguard cmd/gomodguard/main.go - -.PHONY: run -run: build - ./gomodguard - -.PHONY: test -test: - go test -v -coverprofile coverage.out - -.PHONY: cover -cover: - gocover-cobertura < coverage.out > coverage.xml - -.PHONY: dockerrun -dockerrun: dockerbuild - docker run -v "${current_dir}/.gomodguard.yaml:/.gomodguard.yaml" ryancurrah/gomodguard:latest - -.PHONY: snapshot -snapshot: - goreleaser --rm-dist --snapshot - -.PHONY: release -release: - goreleaser --rm-dist - -.PHONY: clean -clean: - rm -rf dist/ - rm -f gomodguard coverage.xml coverage.out - -.PHONY: install-mac-tools -install-tools-mac: - brew install goreleaser/tap/goreleaser - -.PHONY: install-go-tools -install-go-tools: - go install -v github.com/t-yuki/gocover-cobertura diff --git a/vendor/github.com/ryancurrah/gomodguard/README.md b/vendor/github.com/ryancurrah/gomodguard/README.md deleted file mode 100644 index 4945f01012..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/README.md +++ /dev/null @@ -1,131 +0,0 @@ -# gomodguard -[![License](https://img.shields.io/github/license/ryancurrah/gomodguard?style=flat-square)](/LICENSE) -[![Codecov](https://img.shields.io/codecov/c/gh/ryancurrah/gomodguard?style=flat-square)](https://codecov.io/gh/ryancurrah/gomodguard) -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/ryancurrah/gomodguard/Go?logo=Go&style=flat-square)](https://github.com/ryancurrah/gomodguard/actions?query=workflow%3AGo) -[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/ryancurrah/gomodguard?style=flat-square)](https://github.com/ryancurrah/gomodguard/releases/latest) -[![Docker](https://img.shields.io/docker/pulls/ryancurrah/gomodguard?style=flat-square)](https://hub.docker.com/r/ryancurrah/gomodguard) -[![Github Releases Stats of golangci-lint](https://img.shields.io/github/downloads/ryancurrah/gomodguard/total.svg?logo=github&style=flat-square)](https://somsubhra.com/github-release-stats/?username=ryancurrah&repository=gomodguard) - - - -Allow and block list linter for direct Go module dependencies. This is useful for organizations where they want to standardize on the modules used and be able to recommend alternative modules. - -## Description - -Allowed and blocked modules are defined in a `./.gomodguard.yaml` or `~/.gomodguard.yaml` file. - -Modules can be allowed by module or domain name. When allowed modules are specified any modules not in the allowed configuration are blocked. - -If no allowed modules or domains are specified then all modules are allowed except for blocked ones. - -The linter looks for blocked modules in `go.mod` and searches for imported packages where the imported packages module is blocked. Indirect modules are not considered. - -Alternative modules can be optionally recommended in the blocked modules list. - -If the linted module imports a blocked module but the linted module is in the recommended modules list the blocked module is ignored. Usually, this means the linted module wraps that blocked module for use by other modules, therefore the import of the blocked module should not be blocked. - -Version constraints can be specified for modules as well which lets you block new or old versions of modules or specific versions. - -Results are printed to `stdout`. - -Logging statements are printed to `stderr`. - -Results can be exported to different report formats. Which can be imported into CI tools. See the help section for more information. - -## Configuration - -```yaml -allowed: - modules: # List of allowed modules - - gopkg.in/yaml.v2 - - github.com/go-xmlfmt/xmlfmt - - github.com/phayes/checkstyle - - github.com/mitchellh/go-homedir - domains: # List of allowed module domains - - golang.org - -blocked: - modules: # List of blocked modules - - github.com/uudashr/go-module: # Blocked module - recommendations: # Recommended modules that should be used instead (Optional) - - golang.org/x/mod - reason: "`mod` is the official go.mod parser library." # Reason why the recommended module should be used (Optional) - versions: # List of blocked module version constraints. - - github.com/mitchellh/go-homedir: # Blocked module with version constraint. - version: "<= 1.1.0" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons. - reason: "testing if blocked version constraint works." # Reason why the version constraint exists. -``` - -## Usage - -``` -╰─ ./gomodguard -h -Usage: gomodguard [files...] -Also supports package syntax but will use it in relative path, i.e. ./pkg/... -Flags: - -f string - Report results to the specified file. A report type must also be specified - -file string - - -h Show this help text - -help - - -i int - Exit code when issues were found (default 2) - -issues-exit-code int - (default 2) - - -n Don't lint test files - -no-test - - -r string - Report results to one of the following formats: checkstyle. A report file destination must also be specified - -report string -``` - -## Example - -``` -╰─ ./gomodguard -r checkstyle -f gomodguard-checkstyle.xml ./... - -info: allowed modules, [gopkg.in/yaml.v2 github.com/go-xmlfmt/xmlfmt github.com/phayes/checkstyle github.com/mitchellh/go-homedir] -info: allowed module domains, [golang.org] -info: blocked modules, [github.com/uudashr/go-module] -info: found `2` blocked modules in the go.mod file, [github.com/gofrs/uuid github.com/uudashr/go-module] -blocked_example.go:6: import of package `github.com/gofrs/uuid` is blocked because the module is not in the allowed modules list. -blocked_example.go:7: import of package `github.com/uudashr/go-module` is blocked because the module is in the blocked modules list. `golang.org/x/mod` is a recommended module. `mod` is the official go.mod parser library. -``` - -Resulting checkstyle file - -``` -╰─ cat gomodguard-checkstyle.xml - - - - - - - - - - -``` - -## Install - -``` -go install github.com/ryancurrah/gomodguard/cmd/gomodguard -``` - -## Develop - -``` -git clone https://github.com/ryancurrah/gomodguard.git && cd gomodguard - -go build -o gomodguard cmd/gomodguard/main.go -``` - -## License - -**MIT** diff --git a/vendor/github.com/ryancurrah/gomodguard/allowed.go b/vendor/github.com/ryancurrah/gomodguard/allowed.go deleted file mode 100644 index 5b0d26f835..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/allowed.go +++ /dev/null @@ -1,39 +0,0 @@ -package gomodguard - -import "strings" - -// Allowed is a list of modules and module -// domains that are allowed to be used. -type Allowed struct { - Modules []string `yaml:"modules"` - Domains []string `yaml:"domains"` -} - -// IsAllowedModule returns true if the given module -// name is in the allowed modules list. -func (a *Allowed) IsAllowedModule(moduleName string) bool { - allowedModules := a.Modules - - for i := range allowedModules { - if strings.TrimSpace(moduleName) == strings.TrimSpace(allowedModules[i]) { - return true - } - } - - return false -} - -// IsAllowedModuleDomain returns true if the given modules domain is -// in the allowed module domains list. -func (a *Allowed) IsAllowedModuleDomain(moduleName string) bool { - allowedDomains := a.Domains - - for i := range allowedDomains { - if strings.HasPrefix(strings.TrimSpace(strings.ToLower(moduleName)), - strings.TrimSpace(strings.ToLower(allowedDomains[i]))) { - return true - } - } - - return false -} diff --git a/vendor/github.com/ryancurrah/gomodguard/blocked.go b/vendor/github.com/ryancurrah/gomodguard/blocked.go deleted file mode 100644 index 2a6e5c2159..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/blocked.go +++ /dev/null @@ -1,189 +0,0 @@ -package gomodguard - -import ( - "fmt" - "strings" - - "github.com/Masterminds/semver" -) - -// Blocked is a list of modules that are -// blocked and not to be used. -type Blocked struct { - Modules BlockedModules `yaml:"modules"` - Versions BlockedVersions `yaml:"versions"` - LocalReplaceDirectives bool `yaml:"local_replace_directives"` -} - -// BlockedVersion has a version constraint a reason why the the module version is blocked. -type BlockedVersion struct { - Version string `yaml:"version"` - Reason string `yaml:"reason"` -} - -// IsLintedModuleVersionBlocked returns true if a version constraint is specified and the -// linted module version matches the constraint. -func (r *BlockedVersion) IsLintedModuleVersionBlocked(lintedModuleVersion string) bool { - if r.Version == "" { - return false - } - - constraint, err := semver.NewConstraint(r.Version) - if err != nil { - return false - } - - version, err := semver.NewVersion(lintedModuleVersion) - if err != nil { - return false - } - - meet := constraint.Check(version) - - return meet -} - -// Message returns the reason why the module version is blocked. -func (r *BlockedVersion) Message(lintedModuleVersion string) string { - var sb strings.Builder - - // Add version contraint to message. - _, _ = fmt.Fprintf(&sb, "version `%s` is blocked because it does not meet the version constraint `%s`.", - lintedModuleVersion, r.Version) - - if r.Reason == "" { - return sb.String() - } - - // Add reason to message. - _, _ = fmt.Fprintf(&sb, " %s.", strings.TrimRight(r.Reason, ".")) - - return sb.String() -} - -// BlockedModule has alternative modules to use and a reason why the module is blocked. -type BlockedModule struct { - Recommendations []string `yaml:"recommendations"` - Reason string `yaml:"reason"` -} - -// IsCurrentModuleARecommendation returns true if the current module is in the Recommendations list. -// -// If the current go.mod file being linted is a recommended module of a -// blocked module and it imports that blocked module, do not set as blocked. -// This could mean that the linted module is a wrapper for that blocked module. -func (r *BlockedModule) IsCurrentModuleARecommendation(currentModuleName string) bool { - if r == nil { - return false - } - - for n := range r.Recommendations { - if strings.TrimSpace(currentModuleName) == strings.TrimSpace(r.Recommendations[n]) { - return true - } - } - - return false -} - -// Message returns the reason why the module is blocked and a list of recommended modules if provided. -func (r *BlockedModule) Message() string { - var sb strings.Builder - - // Add recommendations to message - for i := range r.Recommendations { - switch { - case len(r.Recommendations) == 1: - _, _ = fmt.Fprintf(&sb, "`%s` is a recommended module.", r.Recommendations[i]) - case (i+1) != len(r.Recommendations) && (i+1) == (len(r.Recommendations)-1): - _, _ = fmt.Fprintf(&sb, "`%s` ", r.Recommendations[i]) - case (i + 1) != len(r.Recommendations): - _, _ = fmt.Fprintf(&sb, "`%s`, ", r.Recommendations[i]) - default: - _, _ = fmt.Fprintf(&sb, "and `%s` are recommended modules.", r.Recommendations[i]) - } - } - - if r.Reason == "" { - return sb.String() - } - - // Add reason to message - if sb.Len() == 0 { - _, _ = fmt.Fprintf(&sb, "%s.", strings.TrimRight(r.Reason, ".")) - } else { - _, _ = fmt.Fprintf(&sb, " %s.", strings.TrimRight(r.Reason, ".")) - } - - return sb.String() -} - -// HasRecommendations returns true if the blocked package has -// recommended modules. -func (r *BlockedModule) HasRecommendations() bool { - if r == nil { - return false - } - - return len(r.Recommendations) > 0 -} - -// BlockedVersions a list of blocked modules by a version constraint. -type BlockedVersions []map[string]BlockedVersion - -// Get returns the module names that are blocked. -func (b BlockedVersions) Get() []string { - modules := make([]string, len(b)) - - for n := range b { - for module := range b[n] { - modules[n] = module - break - } - } - - return modules -} - -// GetBlockReason returns a block version if one is set for the provided linted module name. -func (b BlockedVersions) GetBlockReason(lintedModuleName string) *BlockedVersion { - for _, blockedModule := range b { - for blockedModuleName, blockedVersion := range blockedModule { - if strings.TrimSpace(lintedModuleName) == strings.TrimSpace(blockedModuleName) { - return &blockedVersion - } - } - } - - return nil -} - -// BlockedModules a list of blocked modules. -type BlockedModules []map[string]BlockedModule - -// Get returns the module names that are blocked. -func (b BlockedModules) Get() []string { - modules := make([]string, len(b)) - - for n := range b { - for module := range b[n] { - modules[n] = module - break - } - } - - return modules -} - -// GetBlockReason returns a block module if one is set for the provided linted module name. -func (b BlockedModules) GetBlockReason(lintedModuleName string) *BlockedModule { - for _, blockedModule := range b { - for blockedModuleName, blockedModule := range blockedModule { - if strings.TrimSpace(lintedModuleName) == strings.TrimSpace(blockedModuleName) { - return &blockedModule - } - } - } - - return nil -} diff --git a/vendor/github.com/ryancurrah/gomodguard/issue.go b/vendor/github.com/ryancurrah/gomodguard/issue.go deleted file mode 100644 index d60fc3a868..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/issue.go +++ /dev/null @@ -1,20 +0,0 @@ -package gomodguard - -import ( - "fmt" - "go/token" -) - -// Issue represents the result of one error. -type Issue struct { - FileName string - LineNumber int - Position token.Position - Reason string -} - -// String returns the filename, line -// number and reason of a Issue. -func (r *Issue) String() string { - return fmt.Sprintf("%s:%d:1 %s", r.FileName, r.LineNumber, r.Reason) -} diff --git a/vendor/github.com/ryancurrah/gomodguard/processor.go b/vendor/github.com/ryancurrah/gomodguard/processor.go deleted file mode 100644 index 8457e3b070..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/processor.go +++ /dev/null @@ -1,291 +0,0 @@ -package gomodguard - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "go/parser" - "go/token" - "os" - "os/exec" - "regexp" - "strings" - - "golang.org/x/mod/modfile" -) - -const ( - goModFilename = "go.mod" - errReadingGoModFile = "unable to read module file %s: %w" - errParsingGoModFile = "unable to parse module file %s: %w" -) - -var ( - blockReasonNotInAllowedList = "import of package `%s` is blocked because the module is not in the " + - "allowed modules list." - blockReasonInBlockedList = "import of package `%s` is blocked because the module is in the " + - "blocked modules list." - blockReasonHasLocalReplaceDirective = "import of package `%s` is blocked because the module has a " + - "local replace directive." - - // startsWithVersion is used to test when a string begins with the version identifier of a module, - // after having stripped the prefix base module name. IE "github.com/foo/bar/v2/baz" => "v2/baz" - // probably indicates that the module is actually github.com/foo/bar/v2, not github.com/foo/bar. - startsWithVersion = regexp.MustCompile(`^v[0-9]+`) -) - -// Configuration of gomodguard allow and block lists. -type Configuration struct { - Allowed Allowed `yaml:"allowed"` - Blocked Blocked `yaml:"blocked"` -} - -// Processor processes Go files. -type Processor struct { - Config *Configuration - Modfile *modfile.File - blockedModulesFromModFile map[string][]string -} - -// NewProcessor will create a Processor to lint blocked packages. -func NewProcessor(config *Configuration) (*Processor, error) { - goModFileBytes, err := loadGoModFile() - if err != nil { - return nil, fmt.Errorf(errReadingGoModFile, goModFilename, err) - } - - modFile, err := modfile.Parse(goModFilename, goModFileBytes, nil) - if err != nil { - return nil, fmt.Errorf(errParsingGoModFile, goModFilename, err) - } - - p := &Processor{ - Config: config, - Modfile: modFile, - } - - p.SetBlockedModules() - - return p, nil -} - -// ProcessFiles takes a string slice with file names (full paths) -// and lints them. -func (p *Processor) ProcessFiles(filenames []string) (issues []Issue) { - for _, filename := range filenames { - data, err := os.ReadFile(filename) - if err != nil { - issues = append(issues, Issue{ - FileName: filename, - LineNumber: 0, - Reason: fmt.Sprintf("unable to read file, file cannot be linted (%s)", err.Error()), - }) - - continue - } - - issues = append(issues, p.process(filename, data)...) - } - - return issues -} - -// process file imports and add lint error if blocked package is imported. -func (p *Processor) process(filename string, data []byte) (issues []Issue) { - fileSet := token.NewFileSet() - - file, err := parser.ParseFile(fileSet, filename, data, parser.ParseComments) - if err != nil { - issues = append(issues, Issue{ - FileName: filename, - LineNumber: 0, - Reason: fmt.Sprintf("invalid syntax, file cannot be linted (%s)", err.Error()), - }) - - return - } - - imports := file.Imports - for n := range imports { - importedPkg := strings.TrimSpace(strings.Trim(imports[n].Path.Value, "\"")) - - blockReasons := p.isBlockedPackageFromModFile(importedPkg) - if blockReasons == nil { - continue - } - - for _, blockReason := range blockReasons { - issues = append(issues, p.addError(fileSet, imports[n].Pos(), blockReason)) - } - } - - return issues -} - -// addError adds an error for the file and line number for the current token.Pos -// with the given reason. -func (p *Processor) addError(fileset *token.FileSet, pos token.Pos, reason string) Issue { - position := fileset.Position(pos) - - return Issue{ - FileName: position.Filename, - LineNumber: position.Line, - Position: position, - Reason: reason, - } -} - -// SetBlockedModules determines and sets which modules are blocked by reading -// the go.mod file of the module that is being linted. -// -// It works by iterating over the dependant modules specified in the require -// directive, checking if the module domain or full name is in the allowed list. -func (p *Processor) SetBlockedModules() { //nolint:gocognit,funlen - blockedModules := make(map[string][]string, len(p.Modfile.Require)) - currentModuleName := p.Modfile.Module.Mod.Path - lintedModules := p.Modfile.Require - replacedModules := p.Modfile.Replace - - for i := range lintedModules { - if lintedModules[i].Indirect { - continue // Do not lint indirect modules. - } - - lintedModuleName := strings.TrimSpace(lintedModules[i].Mod.Path) - lintedModuleVersion := strings.TrimSpace(lintedModules[i].Mod.Version) - - var isAllowed bool - - switch { - case len(p.Config.Allowed.Modules) == 0 && len(p.Config.Allowed.Domains) == 0: - isAllowed = true - case p.Config.Allowed.IsAllowedModuleDomain(lintedModuleName): - isAllowed = true - case p.Config.Allowed.IsAllowedModule(lintedModuleName): - isAllowed = true - default: - isAllowed = false - } - - blockModuleReason := p.Config.Blocked.Modules.GetBlockReason(lintedModuleName) - blockVersionReason := p.Config.Blocked.Versions.GetBlockReason(lintedModuleName) - - if !isAllowed && blockModuleReason == nil && blockVersionReason == nil { - blockedModules[lintedModuleName] = append(blockedModules[lintedModuleName], blockReasonNotInAllowedList) - continue - } - - if blockModuleReason != nil && !blockModuleReason.IsCurrentModuleARecommendation(currentModuleName) { - blockedModules[lintedModuleName] = append(blockedModules[lintedModuleName], - fmt.Sprintf("%s %s", blockReasonInBlockedList, blockModuleReason.Message())) - } - - if blockVersionReason != nil && blockVersionReason.IsLintedModuleVersionBlocked(lintedModuleVersion) { - blockedModules[lintedModuleName] = append(blockedModules[lintedModuleName], - fmt.Sprintf("%s %s", blockReasonInBlockedList, blockVersionReason.Message(lintedModuleVersion))) - } - } - - // Replace directives with local paths are blocked. - // Filesystem paths found in "replace" directives are represented by a path with an empty version. - // https://github.com/golang/mod/blob/bc388b264a244501debfb9caea700c6dcaff10e2/module/module.go#L122-L124 - if p.Config.Blocked.LocalReplaceDirectives { - for i := range replacedModules { - replacedModuleOldName := strings.TrimSpace(replacedModules[i].Old.Path) - replacedModuleNewName := strings.TrimSpace(replacedModules[i].New.Path) - replacedModuleNewVersion := strings.TrimSpace(replacedModules[i].New.Version) - - if replacedModuleNewName != "" && replacedModuleNewVersion == "" { - blockedModules[replacedModuleOldName] = append(blockedModules[replacedModuleOldName], - blockReasonHasLocalReplaceDirective) - } - } - } - - p.blockedModulesFromModFile = blockedModules -} - -// isBlockedPackageFromModFile returns the block reason if the package is blocked. -func (p *Processor) isBlockedPackageFromModFile(packageName string) []string { - for blockedModuleName, blockReasons := range p.blockedModulesFromModFile { - if isPackageInModule(packageName, blockedModuleName) { - formattedReasons := make([]string, 0, len(blockReasons)) - - for _, blockReason := range blockReasons { - formattedReasons = append(formattedReasons, fmt.Sprintf(blockReason, packageName)) - } - - return formattedReasons - } - } - - return nil -} - -func loadGoModFile() ([]byte, error) { - cmd := exec.Command("go", "env", "-json") - stdout, _ := cmd.StdoutPipe() - _ = cmd.Start() - - if stdout == nil { - return os.ReadFile(goModFilename) - } - - buf := new(bytes.Buffer) - _, _ = buf.ReadFrom(stdout) - - goEnv := make(map[string]string) - - err := json.Unmarshal(buf.Bytes(), &goEnv) - if err != nil { - return os.ReadFile(goModFilename) - } - - if _, ok := goEnv["GOMOD"]; !ok { - return os.ReadFile(goModFilename) - } - - if _, err = os.Stat(goEnv["GOMOD"]); os.IsNotExist(err) { - return os.ReadFile(goModFilename) - } - - if goEnv["GOMOD"] == "/dev/null" { - return nil, errors.New("current working directory must have a go.mod file") - } - - return os.ReadFile(goEnv["GOMOD"]) -} - -// isPackageInModule determines if a package is apart of the specified go module. -func isPackageInModule(pkg, mod string) bool { - // Split pkg and mod paths into parts - pkgPart := strings.Split(pkg, "/") - modPart := strings.Split(mod, "/") - - pkgPartMatches := 0 - - // Count number of times pkg path matches the mod path - for i, m := range modPart { - if len(pkgPart) > i && pkgPart[i] == m { - pkgPartMatches++ - } - } - - // If pkgPartMatches are not the same length as modPart - // than the package is not in this module - if pkgPartMatches != len(modPart) { - return false - } - - if len(pkgPart) > len(modPart) { - // If pkgPart path starts with a major version - // than the package is not in this module as - // major versions are completely different modules - if startsWithVersion.MatchString(pkgPart[len(modPart)]) { - return false - } - } - - return true -} diff --git a/vendor/github.com/ryancurrah/gomodguard/tools.go b/vendor/github.com/ryancurrah/gomodguard/tools.go deleted file mode 100644 index d56bcc7470..0000000000 --- a/vendor/github.com/ryancurrah/gomodguard/tools.go +++ /dev/null @@ -1,5 +0,0 @@ -//go:build tools - -package gomodguard - -import _ "github.com/t-yuki/gocover-cobertura" diff --git a/vendor/github.com/ryanrolds/sqlclosecheck/LICENSE b/vendor/github.com/ryanrolds/sqlclosecheck/LICENSE deleted file mode 100644 index 77b261d7a1..0000000000 --- a/vendor/github.com/ryanrolds/sqlclosecheck/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Ryan R. Olds - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/ryanrolds/sqlclosecheck/pkg/analyzer/analyzer.go b/vendor/github.com/ryanrolds/sqlclosecheck/pkg/analyzer/analyzer.go deleted file mode 100644 index 55e931a898..0000000000 --- a/vendor/github.com/ryanrolds/sqlclosecheck/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,405 +0,0 @@ -package analyzer - -import ( - "go/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/ssa" -) - -const ( - rowsName = "Rows" - stmtName = "Stmt" - namedStmtName = "NamedStmt" - closeMethod = "Close" -) - -type action uint8 - -const ( - actionUnhandled action = iota - actionHandled - actionReturned - actionPassed - actionClosed - actionUnvaluedCall - actionUnvaluedDefer - actionNoOp -) - -var ( - sqlPackages = []string{ - "database/sql", - "github.com/jmoiron/sqlx", - "github.com/jackc/pgx/v5", - "github.com/jackc/pgx/v5/pgxpool", - } -) - -func NewAnalyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "sqlclosecheck", - Doc: "Checks that sql.Rows, sql.Stmt, sqlx.NamedStmt, pgx.Query are closed.", - Run: run, - Requires: []*analysis.Analyzer{ - buildssa.Analyzer, - }, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - pssa, ok := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA) - if !ok { - return nil, nil - } - - // Build list of types we are looking for - targetTypes := getTargetTypes(pssa, sqlPackages) - - // If non of the types are found, skip - if len(targetTypes) == 0 { - return nil, nil - } - - funcs := pssa.SrcFuncs - for _, f := range funcs { - for _, b := range f.Blocks { - for i := range b.Instrs { - // Check if instruction is call that returns a target pointer type - targetValues := getTargetTypesValues(b, i, targetTypes) - if len(targetValues) == 0 { - continue - } - - // For each found target check if they are closed and deferred - for _, targetValue := range targetValues { - refs := (*targetValue.value).Referrers() - isClosed := checkClosed(refs, targetTypes) - if !isClosed { - pass.Reportf((targetValue.instr).Pos(), "Rows/Stmt/NamedStmt was not closed") - } - - checkDeferred(pass, refs, targetTypes, false) - } - } - } - } - - return nil, nil -} - -func getTargetTypes(pssa *buildssa.SSA, targetPackages []string) []any { - targets := []any{} - - for _, sqlPkg := range targetPackages { - pkg := pssa.Pkg.Prog.ImportedPackage(sqlPkg) - if pkg == nil { - // the SQL package being checked isn't imported - continue - } - - rowsPtrType := getTypePointerFromName(pkg, rowsName) - if rowsPtrType != nil { - targets = append(targets, rowsPtrType) - } - - rowsType := getTypeFromName(pkg, rowsName) - if rowsType != nil { - targets = append(targets, rowsType) - } - - stmtType := getTypePointerFromName(pkg, stmtName) - if stmtType != nil { - targets = append(targets, stmtType) - } - - namedStmtType := getTypePointerFromName(pkg, namedStmtName) - if namedStmtType != nil { - targets = append(targets, namedStmtType) - } - } - - return targets -} - -func getTypePointerFromName(pkg *ssa.Package, name string) *types.Pointer { - pkgType := pkg.Type(name) - if pkgType == nil { - // this package does not use Rows/Stmt/NamedStmt - return nil - } - - obj := pkgType.Object() - named, ok := obj.Type().(*types.Named) - if !ok { - return nil - } - - return types.NewPointer(named) -} - -func getTypeFromName(pkg *ssa.Package, name string) *types.Named { - pkgType := pkg.Type(name) - if pkgType == nil { - // this package does not use Rows/Stmt - return nil - } - - obj := pkgType.Object() - named, ok := obj.Type().(*types.Named) - if !ok { - return nil - } - - return named -} - -type targetValue struct { - value *ssa.Value - instr ssa.Instruction -} - -func getTargetTypesValues(b *ssa.BasicBlock, i int, targetTypes []any) []targetValue { - targetValues := []targetValue{} - - instr := b.Instrs[i] - call, ok := instr.(*ssa.Call) - if !ok { - return targetValues - } - - signature := call.Call.Signature() - results := signature.Results() - for i := 0; i < results.Len(); i++ { - v := results.At(i) - varType := v.Type() - - for _, targetType := range targetTypes { - var tt types.Type - - switch t := targetType.(type) { - case *types.Pointer: - tt = t - case *types.Named: - tt = t - default: - continue - } - - if !types.Identical(varType, tt) { - continue - } - - for _, cRef := range *call.Referrers() { - switch instr := cRef.(type) { - case *ssa.Call: - if len(instr.Call.Args) >= 1 && types.Identical(instr.Call.Args[0].Type(), tt) { - targetValues = append(targetValues, targetValue{ - value: &instr.Call.Args[0], - instr: call, - }) - } - case ssa.Value: - if types.Identical(instr.Type(), tt) { - targetValues = append(targetValues, targetValue{ - value: &instr, - instr: call, - }) - } - } - } - } - } - - return targetValues -} - -func checkClosed(refs *[]ssa.Instruction, targetTypes []any) bool { - numInstrs := len(*refs) - for idx, ref := range *refs { - action := getAction(ref, targetTypes) - switch action { - case actionClosed, actionReturned, actionHandled: - return true - case actionPassed: - // Passed and not used after - if numInstrs == idx+1 { - return true - } - } - } - - return false -} - -func getAction(instr ssa.Instruction, targetTypes []any) action { - switch instr := instr.(type) { - case *ssa.Defer: - if instr.Call.Value != nil { - name := instr.Call.Value.Name() - if name == closeMethod { - return actionClosed - } - } - - if instr.Call.Method != nil { - name := instr.Call.Method.Name() - if name == closeMethod { - return actionClosed - } - } - - return actionUnvaluedDefer - case *ssa.Call: - if instr.Call.Value == nil { - return actionUnvaluedCall - } - - isTarget := false - staticCallee := instr.Call.StaticCallee() - if staticCallee != nil { - receiver := instr.Call.StaticCallee().Signature.Recv() - if receiver != nil { - isTarget = isTargetType(receiver.Type(), targetTypes) - } - } - - name := instr.Call.Value.Name() - if isTarget && name == closeMethod { - return actionClosed - } - - if !isTarget { - return actionPassed - } - case *ssa.Phi: - return actionPassed - case *ssa.MakeInterface: - return actionPassed - case *ssa.Store: - // A Row/Stmt is stored in a struct, which may be closed later - // by a different flow. - if _, ok := instr.Addr.(*ssa.FieldAddr); ok { - return actionReturned - } - - if len(*instr.Addr.Referrers()) == 0 { - return actionNoOp - } - - for _, aRef := range *instr.Addr.Referrers() { - if c, ok := aRef.(*ssa.MakeClosure); ok { - if f, ok := c.Fn.(*ssa.Function); ok { - for _, b := range f.Blocks { - if checkClosed(&b.Instrs, targetTypes) { - return actionHandled - } - } - } - } - } - case *ssa.UnOp: - instrType := instr.Type() - for _, targetType := range targetTypes { - var tt types.Type - - switch t := targetType.(type) { - case *types.Pointer: - tt = t - case *types.Named: - tt = t - default: - continue - } - - if types.Identical(instrType, tt) { - if checkClosed(instr.Referrers(), targetTypes) { - return actionHandled - } - } - } - case *ssa.FieldAddr: - if checkClosed(instr.Referrers(), targetTypes) { - return actionHandled - } - case *ssa.Return: - return actionReturned - } - - return actionUnhandled -} - -func checkDeferred(pass *analysis.Pass, instrs *[]ssa.Instruction, targetTypes []any, inDefer bool) { - for _, instr := range *instrs { - switch instr := instr.(type) { - case *ssa.Defer: - if instr.Call.Value != nil && instr.Call.Value.Name() == closeMethod { - return - } - - if instr.Call.Method != nil && instr.Call.Method.Name() == closeMethod { - return - } - case *ssa.Call: - if instr.Call.Value != nil && instr.Call.Value.Name() == closeMethod { - if !inDefer { - pass.Reportf(instr.Pos(), "Close should use defer") - } - - return - } - case *ssa.Store: - if len(*instr.Addr.Referrers()) == 0 { - return - } - - for _, aRef := range *instr.Addr.Referrers() { - if c, ok := aRef.(*ssa.MakeClosure); ok { - if f, ok := c.Fn.(*ssa.Function); ok { - for _, b := range f.Blocks { - checkDeferred(pass, &b.Instrs, targetTypes, true) - } - } - } - } - case *ssa.UnOp: - instrType := instr.Type() - for _, targetType := range targetTypes { - var tt types.Type - - switch t := targetType.(type) { - case *types.Pointer: - tt = t - case *types.Named: - tt = t - default: - continue - } - - if types.Identical(instrType, tt) { - checkDeferred(pass, instr.Referrers(), targetTypes, inDefer) - } - } - case *ssa.FieldAddr: - checkDeferred(pass, instr.Referrers(), targetTypes, inDefer) - } - } -} - -func isTargetType(t types.Type, targetTypes []any) bool { - for _, targetType := range targetTypes { - switch tt := targetType.(type) { - case *types.Pointer: - if types.Identical(t, tt) { - return true - } - case *types.Named: - if types.Identical(t, tt) { - return true - } - } - } - - return false -} diff --git a/vendor/github.com/sanposhiho/wastedassign/v2/LICENSE b/vendor/github.com/sanposhiho/wastedassign/v2/LICENSE deleted file mode 100644 index 4ed7724fec..0000000000 --- a/vendor/github.com/sanposhiho/wastedassign/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Kensei Nakada - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sanposhiho/wastedassign/v2/README.md b/vendor/github.com/sanposhiho/wastedassign/v2/README.md deleted file mode 100644 index 6b736f7f1d..0000000000 --- a/vendor/github.com/sanposhiho/wastedassign/v2/README.md +++ /dev/null @@ -1,75 +0,0 @@ -# wastedassign -`wastedassign` finds wasted assignment statements - -found the value ... - -- reassigned, but never used afterward -- reassigned, but reassigned without using the value - -## Example - -```go -package main - -import "fmt" - -func f() int { - a := 0 - b := 0 - fmt.Print(a) - fmt.Print(b) - a = 1 // This reassignment is wasted, because never used afterwards. Wastedassign find this - - b = 1 // This reassignment is wasted, because reassigned without use this value. Wastedassign find this - b = 2 - fmt.Print(b) - - return 1 + 2 -} -``` - - -```bash -$ go vet -vettool=`which wastedassign` sample.go -# command-line-arguments -./sample.go:10:2: assigned to a, but never used afterwards -./sample.go:12:2: assigned to b, but reassigned without using the value -``` - - -## Installation - - -### Go version < 1.16 - -``` -go get -u github.com/sanposhiho/wastedassign/v2/cmd/wastedassign -``` - -### Go version 1.16+ - -``` -go install github.com/sanposhiho/wastedassign/v2/cmd/wastedassign@latest -``` - -## Usage - -``` -# in your project - -go vet -vettool=`which wastedassign` ./... -``` - -And, you can use wastedassign in [golangci-lint](https://github.com/golangci/golangci-lint). - -## Contribution - -I am waiting for your contribution :D - -Feel free to create an issue or a PR! - -### Run test - -``` -go test -``` diff --git a/vendor/github.com/sanposhiho/wastedassign/v2/wastedassign.go b/vendor/github.com/sanposhiho/wastedassign/v2/wastedassign.go deleted file mode 100644 index e0c0da6166..0000000000 --- a/vendor/github.com/sanposhiho/wastedassign/v2/wastedassign.go +++ /dev/null @@ -1,272 +0,0 @@ -package wastedassign - -import ( - "errors" - "fmt" - "go/ast" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - "golang.org/x/tools/go/ssa" -) - -const doc = "wastedassign finds wasted assignment statements." - -// Analyzer is the wastedassign analyzer. -var Analyzer = &analysis.Analyzer{ - Name: "wastedassign", - Doc: doc, - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -type wastedAssignStruct struct { - pos token.Pos - reason string -} - -func run(pass *analysis.Pass) (interface{}, error) { - // Plundered from buildssa.Run. - prog := ssa.NewProgram(pass.Fset, ssa.NaiveForm) - - // Create SSA packages for all imports. - // Order is not significant. - created := make(map[*types.Package]bool) - var createAll func(pkgs []*types.Package) - createAll = func(pkgs []*types.Package) { - for _, p := range pkgs { - if !created[p] { - created[p] = true - prog.CreatePackage(p, nil, nil, true) - createAll(p.Imports()) - } - } - } - createAll(pass.Pkg.Imports()) - - // Create and build the primary package. - ssapkg := prog.CreatePackage(pass.Pkg, pass.Files, pass.TypesInfo, false) - ssapkg.Build() - - var srcFuncs []*ssa.Function - for _, f := range pass.Files { - for _, decl := range f.Decls { - if fdecl, ok := decl.(*ast.FuncDecl); ok { - - // SSA will not build a Function - // for a FuncDecl named blank. - // That's arguably too strict but - // relaxing it would break uniqueness of - // names of package members. - if fdecl.Name.Name == "_" { - continue - } - - // (init functions have distinct Func - // objects named "init" and distinct - // ssa.Functions named "init#1", ...) - - fn := pass.TypesInfo.Defs[fdecl.Name].(*types.Func) - if fn == nil { - return nil, errors.New("failed to get func's typesinfo") - } - - f := ssapkg.Prog.FuncValue(fn) - if f == nil { - return nil, errors.New("failed to get func's SSA-form intermediate representation") - } - - var addAnons func(f *ssa.Function) - addAnons = func(f *ssa.Function) { - srcFuncs = append(srcFuncs, f) - for _, anon := range f.AnonFuncs { - addAnons(anon) - } - } - addAnons(f) - } - } - } - - typeSwitchPos := map[int]bool{} - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - inspect.Preorder([]ast.Node{new(ast.TypeSwitchStmt)}, func(n ast.Node) { - if _, ok := n.(*ast.TypeSwitchStmt); ok { - typeSwitchPos[pass.Fset.Position(n.Pos()).Line] = true - } - }) - - var wastedAssignMap []wastedAssignStruct - - for _, sf := range srcFuncs { - for _, bl := range sf.Blocks { - blCopy := *bl - for _, ist := range bl.Instrs { - blCopy.Instrs = rmInstrFromInstrs(blCopy.Instrs, ist) - if _, ok := ist.(*ssa.Store); !ok { - continue - } - - var buf [10]*ssa.Value - for _, op := range ist.Operands(buf[:0]) { - if (*op) == nil || !opInLocals(sf.Locals, op) { - continue - } - - reason := isNextOperationToOpIsStore([]*ssa.BasicBlock{&blCopy}, op, nil) - if reason == notWasted { - continue - } - - if ist.Pos() == 0 || typeSwitchPos[pass.Fset.Position(ist.Pos()).Line] { - continue - } - - v, ok := (*op).(*ssa.Alloc) - if !ok { - // This block should never have been executed. - continue - } - wastedAssignMap = append(wastedAssignMap, wastedAssignStruct{ - pos: ist.Pos(), - reason: reason.String(v), - }) - } - } - } - } - - for _, was := range wastedAssignMap { - pass.Reportf(was.pos, was.reason) - } - - return nil, nil -} - -type wastedReason string - -const ( - noUseUntilReturn wastedReason = "assigned, but never used afterwards" - reassignedSoon wastedReason = "wasted assignment" - notWasted wastedReason = "" -) - -func (wr wastedReason) String(a *ssa.Alloc) string { - switch wr { - case noUseUntilReturn: - return fmt.Sprintf("assigned to %s, but never used afterwards", a.Comment) - case reassignedSoon: - return fmt.Sprintf("assigned to %s, but reassigned without using the value", a.Comment) - case notWasted: - return "" - default: - return "" - } -} - -func isNextOperationToOpIsStore(bls []*ssa.BasicBlock, currentOp *ssa.Value, haveCheckedMap map[int]int) wastedReason { - var wastedReasons []wastedReason - var wastedReasonsCurrentBls []wastedReason - - if haveCheckedMap == nil { - haveCheckedMap = map[int]int{} - } - - for _, bl := range bls { - if haveCheckedMap[bl.Index] == 2 { - continue - } - - haveCheckedMap[bl.Index]++ - breakFlag := false - for _, ist := range bl.Instrs { - if breakFlag { - break - } - - switch w := ist.(type) { - case *ssa.Store: - var buf [10]*ssa.Value - for _, op := range ist.Operands(buf[:0]) { - if *op == *currentOp { - if w.Addr.Name() == (*currentOp).Name() { - wastedReasonsCurrentBls = append(wastedReasonsCurrentBls, reassignedSoon) - breakFlag = true - break - } else { - return notWasted - } - } - } - default: - var buf [10]*ssa.Value - for _, op := range ist.Operands(buf[:0]) { - if *op == *currentOp { - // It wasn't a continuous store. - return notWasted - } - } - } - } - - if len(bl.Succs) != 0 && !breakFlag { - wastedReason := isNextOperationToOpIsStore(rmSameBlock(bl.Succs, bl), currentOp, haveCheckedMap) - if wastedReason == notWasted { - return notWasted - } - wastedReasons = append(wastedReasons, wastedReason) - } - } - - wastedReasons = append(wastedReasons, wastedReasonsCurrentBls...) - - if len(wastedReasons) != 0 && containReassignedSoon(wastedReasons) { - return reassignedSoon - } - - return noUseUntilReturn -} - -func rmSameBlock(bls []*ssa.BasicBlock, currentBl *ssa.BasicBlock) []*ssa.BasicBlock { - var rto []*ssa.BasicBlock - - for _, bl := range bls { - if bl != currentBl { - rto = append(rto, bl) - } - } - return rto -} - -func containReassignedSoon(ws []wastedReason) bool { - for _, w := range ws { - if w == reassignedSoon { - return true - } - } - return false -} - -func rmInstrFromInstrs(instrs []ssa.Instruction, instrToRm ssa.Instruction) []ssa.Instruction { - var rto []ssa.Instruction - for _, i := range instrs { - if i != instrToRm { - rto = append(rto, i) - } - } - return rto -} - -func opInLocals(locals []*ssa.Alloc, op *ssa.Value) bool { - for _, l := range locals { - if *op == ssa.Value(l) { - return true - } - } - return false -} diff --git a/vendor/github.com/sashamelentyev/interfacebloat/LICENSE b/vendor/github.com/sashamelentyev/interfacebloat/LICENSE deleted file mode 100644 index a52602b3da..0000000000 --- a/vendor/github.com/sashamelentyev/interfacebloat/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Sasha Melentyev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sashamelentyev/interfacebloat/pkg/analyzer/analyzer.go b/vendor/github.com/sashamelentyev/interfacebloat/pkg/analyzer/analyzer.go deleted file mode 100644 index 4a6afdf8cb..0000000000 --- a/vendor/github.com/sashamelentyev/interfacebloat/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,57 +0,0 @@ -package analyzer - -import ( - "flag" - "go/ast" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const InterfaceMaxMethodsFlag = "max" - -const defaultMaxMethods = 10 - -// New returns new interfacebloat analyzer. -func New() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "interfacebloat", - Doc: "A linter that checks the number of methods inside an interface.", - Run: run, - Flags: flags(), - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } -} - -func flags() flag.FlagSet { - flags := flag.NewFlagSet("", flag.ExitOnError) - flags.Int(InterfaceMaxMethodsFlag, 10, "maximum number of methods") - return *flags -} - -func run(pass *analysis.Pass) (interface{}, error) { - maxMethods, ok := pass.Analyzer.Flags.Lookup(InterfaceMaxMethodsFlag).Value.(flag.Getter).Get().(int) - if !ok { - maxMethods = defaultMaxMethods - } - - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - filter := []ast.Node{ - (*ast.InterfaceType)(nil), - } - - insp.Preorder(filter, func(node ast.Node) { - i, ok := node.(*ast.InterfaceType) - if !ok { - return - } - - if len(i.Methods.List) > maxMethods { - pass.Reportf(node.Pos(), `the interface has more than %d methods: %d`, maxMethods, len(i.Methods.List)) - } - }) - - return nil, nil -} diff --git a/vendor/github.com/sashamelentyev/usestdlibvars/LICENSE b/vendor/github.com/sashamelentyev/usestdlibvars/LICENSE deleted file mode 100644 index a52602b3da..0000000000 --- a/vendor/github.com/sashamelentyev/usestdlibvars/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Sasha Melentyev - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/analyzer.go b/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/analyzer.go deleted file mode 100644 index 4d6ab3ccab..0000000000 --- a/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,569 +0,0 @@ -package analyzer - -import ( - "flag" - "go/ast" - "go/token" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping" -) - -const ( - TimeWeekdayFlag = "time-weekday" - TimeMonthFlag = "time-month" - TimeLayoutFlag = "time-layout" - CryptoHashFlag = "crypto-hash" - HTTPMethodFlag = "http-method" - HTTPStatusCodeFlag = "http-status-code" - RPCDefaultPathFlag = "rpc-default-path" - OSDevNullFlag = "os-dev-null" - SQLIsolationLevelFlag = "sql-isolation-level" - TLSSignatureSchemeFlag = "tls-signature-scheme" - ConstantKindFlag = "constant-kind" - SyslogPriorityFlag = "syslog-priority" -) - -// New returns new usestdlibvars analyzer. -func New() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "usestdlibvars", - Doc: "A linter that detect the possibility to use variables/constants from the Go standard library.", - Run: run, - Flags: flags(), - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } -} - -func flags() flag.FlagSet { - flags := flag.NewFlagSet("", flag.ExitOnError) - flags.Bool(HTTPMethodFlag, true, "suggest the use of http.MethodXX") - flags.Bool(HTTPStatusCodeFlag, true, "suggest the use of http.StatusXX") - flags.Bool(TimeWeekdayFlag, false, "suggest the use of time.Weekday.String()") - flags.Bool(TimeMonthFlag, false, "suggest the use of time.Month.String()") - flags.Bool(TimeLayoutFlag, false, "suggest the use of time.Layout") - flags.Bool(CryptoHashFlag, false, "suggest the use of crypto.Hash.String()") - flags.Bool(RPCDefaultPathFlag, false, "suggest the use of rpc.DefaultXXPath") - flags.Bool(OSDevNullFlag, false, "[DEPRECATED] suggest the use of os.DevNull") - flags.Bool(SQLIsolationLevelFlag, false, "suggest the use of sql.LevelXX.String()") - flags.Bool(TLSSignatureSchemeFlag, false, "suggest the use of tls.SignatureScheme.String()") - flags.Bool(ConstantKindFlag, false, "suggest the use of constant.Kind.String()") - flags.Bool(SyslogPriorityFlag, false, "[DEPRECATED] suggest the use of syslog.Priority") - return *flags -} - -func run(pass *analysis.Pass) (interface{}, error) { - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - types := []ast.Node{ - (*ast.CallExpr)(nil), - (*ast.BasicLit)(nil), - (*ast.CompositeLit)(nil), - (*ast.IfStmt)(nil), - (*ast.SwitchStmt)(nil), - (*ast.ForStmt)(nil), - } - - insp.Preorder(types, func(node ast.Node) { - switch n := node.(type) { - case *ast.CallExpr: - fun, ok := n.Fun.(*ast.SelectorExpr) - if !ok { - return - } - - x, ok := fun.X.(*ast.Ident) - if !ok { - return - } - - funArgs(pass, x, fun, n.Args) - - case *ast.BasicLit: - for _, c := range []struct { - flag string - checkFunc func(pass *analysis.Pass, basicLit *ast.BasicLit) - }{ - {flag: TimeWeekdayFlag, checkFunc: checkTimeWeekday}, - {flag: TimeMonthFlag, checkFunc: checkTimeMonth}, - {flag: TimeLayoutFlag, checkFunc: checkTimeLayout}, - {flag: CryptoHashFlag, checkFunc: checkCryptoHash}, - {flag: RPCDefaultPathFlag, checkFunc: checkRPCDefaultPath}, - {flag: OSDevNullFlag, checkFunc: checkOSDevNull}, - {flag: SQLIsolationLevelFlag, checkFunc: checkSQLIsolationLevel}, - {flag: TLSSignatureSchemeFlag, checkFunc: checkTLSSignatureScheme}, - {flag: ConstantKindFlag, checkFunc: checkConstantKind}, - } { - if lookupFlag(pass, c.flag) { - c.checkFunc(pass, n) - } - } - - case *ast.CompositeLit: - typ, ok := n.Type.(*ast.SelectorExpr) - if !ok { - return - } - - x, ok := typ.X.(*ast.Ident) - if !ok { - return - } - - typeElts(pass, x, typ, n.Elts) - - case *ast.IfStmt: - cond, ok := n.Cond.(*ast.BinaryExpr) - if !ok { - return - } - - switch cond.Op { - case token.LSS, token.GTR, token.LEQ, token.GEQ: - return - } - - x, ok := cond.X.(*ast.SelectorExpr) - if !ok { - return - } - - y, ok := cond.Y.(*ast.BasicLit) - if !ok { - return - } - - ifElseStmt(pass, x, y) - - case *ast.SwitchStmt: - x, ok := n.Tag.(*ast.SelectorExpr) - if ok { - switchStmt(pass, x, n.Body.List) - } else { - switchStmtAsIfElseStmt(pass, n.Body.List) - } - - case *ast.ForStmt: - cond, ok := n.Cond.(*ast.BinaryExpr) - if !ok { - return - } - - x, ok := cond.X.(*ast.SelectorExpr) - if !ok { - return - } - - y, ok := cond.Y.(*ast.BasicLit) - if !ok { - return - } - - ifElseStmt(pass, x, y) - } - }) - - return nil, nil -} - -// funArgs checks arguments of function or method. -func funArgs(pass *analysis.Pass, x *ast.Ident, fun *ast.SelectorExpr, args []ast.Expr) { - switch x.Name { - case "http": - switch fun.Sel.Name { - // http.NewRequest(http.MethodGet, "localhost", http.NoBody) - case "NewRequest": - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 3, 0, token.STRING); basicLit != nil { - checkHTTPMethod(pass, basicLit) - } - - // http.NewRequestWithContext(context.Background(), http.MethodGet, "localhost", http.NoBody) - case "NewRequestWithContext": - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 4, 1, token.STRING); basicLit != nil { - checkHTTPMethod(pass, basicLit) - } - - // http.Error(w, err, http.StatusInternalServerError) - case "Error": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 3, 2, token.INT); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - - // http.StatusText(http.StatusOK) - case "StatusText": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 1, 0, token.INT); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - - // http.Redirect(w, r, "localhost", http.StatusMovedPermanently) - case "Redirect": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 4, 3, token.INT); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - - // http.RedirectHandler("localhost", http.StatusMovedPermanently) - case "RedirectHandler": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 2, 1, token.INT); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - } - case "httptest": - if fun.Sel.Name == "NewRequest" { - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 3, 0, token.STRING); basicLit != nil { - checkHTTPMethod(pass, basicLit) - } - } - case "syslog": - if !lookupFlag(pass, SyslogPriorityFlag) { - return - } - - switch fun.Sel.Name { - case "New": - if basicLit := getBasicLitFromArgs(args, 2, 0, token.INT); basicLit != nil { - checkSyslogPriority(pass, basicLit) - } - - case "Dial": - if basicLit := getBasicLitFromArgs(args, 4, 2, token.INT); basicLit != nil { - checkSyslogPriority(pass, basicLit) - } - - case "NewLogger": - if basicLit := getBasicLitFromArgs(args, 2, 0, token.INT); basicLit != nil { - checkSyslogPriority(pass, basicLit) - } - } - default: - // w.WriteHeader(http.StatusOk) - if fun.Sel.Name == "WriteHeader" { - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromArgs(args, 1, 0, token.INT); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - } - } -} - -// typeElts checks elements of type. -func typeElts(pass *analysis.Pass, x *ast.Ident, typ *ast.SelectorExpr, elts []ast.Expr) { - switch x.Name { - case "http": - switch typ.Sel.Name { - // http.Request{Method: http.MethodGet} - case "Request": - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - if basicLit := getBasicLitFromElts(elts, "Method"); basicLit != nil { - checkHTTPMethod(pass, basicLit) - } - - // http.Response{StatusCode: http.StatusOK} - case "Response": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromElts(elts, "StatusCode"); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - } - case "httptest": - if typ.Sel.Name == "ResponseRecorder" { - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - if basicLit := getBasicLitFromElts(elts, "Code"); basicLit != nil { - checkHTTPStatusCode(pass, basicLit) - } - } - } -} - -// ifElseStmt checks X and Y in if-else-statement. -func ifElseStmt(pass *analysis.Pass, x *ast.SelectorExpr, y *ast.BasicLit) { - switch x.Sel.Name { - case "StatusCode": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - checkHTTPStatusCode(pass, y) - - case "Method": - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - checkHTTPMethod(pass, y) - } -} - -func switchStmt(pass *analysis.Pass, x *ast.SelectorExpr, cases []ast.Stmt) { - var checkFunc func(pass *analysis.Pass, basicLit *ast.BasicLit) - - switch x.Sel.Name { - case "StatusCode": - if !lookupFlag(pass, HTTPStatusCodeFlag) { - return - } - - checkFunc = checkHTTPStatusCode - - case "Method": - if !lookupFlag(pass, HTTPMethodFlag) { - return - } - - checkFunc = checkHTTPMethod - - default: - return - } - - for _, c := range cases { - caseClause, ok := c.(*ast.CaseClause) - if !ok { - continue - } - - for _, expr := range caseClause.List { - basicLit, ok := expr.(*ast.BasicLit) - if !ok { - continue - } - - checkFunc(pass, basicLit) - } - } -} - -func switchStmtAsIfElseStmt(pass *analysis.Pass, cases []ast.Stmt) { - for _, c := range cases { - caseClause, ok := c.(*ast.CaseClause) - if !ok { - continue - } - - for _, expr := range caseClause.List { - binaryExpr, ok := expr.(*ast.BinaryExpr) - if !ok { - continue - } - - x, ok := binaryExpr.X.(*ast.SelectorExpr) - if !ok { - continue - } - - y, ok := binaryExpr.Y.(*ast.BasicLit) - if !ok { - continue - } - - ifElseStmt(pass, x, y) - } - } -} - -func lookupFlag(pass *analysis.Pass, name string) bool { - return pass.Analyzer.Flags.Lookup(name).Value.(flag.Getter).Get().(bool) -} - -func checkHTTPMethod(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - key := strings.ToUpper(currentVal) - - if newVal, ok := mapping.HTTPMethod[key]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkHTTPStatusCode(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.HTTPStatusCode[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkTimeWeekday(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.TimeWeekday[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkTimeMonth(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.TimeMonth[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkTimeLayout(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.TimeLayout[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkCryptoHash(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.CryptoHash[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkRPCDefaultPath(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.RPCDefaultPath[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkOSDevNull(pass *analysis.Pass, basicLit *ast.BasicLit) {} - -func checkSQLIsolationLevel(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.SQLIsolationLevel[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkTLSSignatureScheme(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.TLSSignatureScheme[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkConstantKind(pass *analysis.Pass, basicLit *ast.BasicLit) { - currentVal := getBasicLitValue(basicLit) - - if newVal, ok := mapping.ConstantKind[currentVal]; ok { - report(pass, basicLit.Pos(), currentVal, newVal) - } -} - -func checkSyslogPriority(pass *analysis.Pass, basicLit *ast.BasicLit) {} - -// getBasicLitFromArgs gets the *ast.BasicLit of a function argument. -// -// Arguments: -// - args - slice of function arguments -// - count - expected number of argument in function -// - idx - index of the argument to get the *ast.BasicLit -// - typ - argument type -func getBasicLitFromArgs(args []ast.Expr, count, idx int, typ token.Token) *ast.BasicLit { - if len(args) != count { - return nil - } - - if idx > count-1 { - return nil - } - - basicLit, ok := args[idx].(*ast.BasicLit) - if !ok { - return nil - } - - if basicLit.Kind != typ { - return nil - } - - return basicLit -} - -// getBasicLitFromElts gets the *ast.BasicLit of a struct elements. -// -// Arguments: -// - elts - slice of a struct elements -// - key - name of key in struct -func getBasicLitFromElts(elts []ast.Expr, key string) *ast.BasicLit { - for _, e := range elts { - keyValueExpr, ok := e.(*ast.KeyValueExpr) - if !ok { - continue - } - - ident, ok := keyValueExpr.Key.(*ast.Ident) - if !ok { - continue - } - - if ident.Name != key { - continue - } - - if basicLit, ok := keyValueExpr.Value.(*ast.BasicLit); ok { - return basicLit - } - } - - return nil -} - -// getBasicLitValue returns BasicLit value as string without quotes. -func getBasicLitValue(basicLit *ast.BasicLit) string { - var val strings.Builder - for _, r := range basicLit.Value { - if r == '"' { - continue - } else { - val.WriteRune(r) - } - } - return val.String() -} - -func report(pass *analysis.Pass, pos token.Pos, currentVal, newVal string) { - pass.Reportf(pos, "%q can be replaced by %s", currentVal, newVal) -} diff --git a/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping/mapping.go b/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping/mapping.go deleted file mode 100644 index 5bad23d288..0000000000 --- a/vendor/github.com/sashamelentyev/usestdlibvars/pkg/analyzer/internal/mapping/mapping.go +++ /dev/null @@ -1,202 +0,0 @@ -package mapping - -import ( - "crypto" - "crypto/tls" - "database/sql" - "go/constant" - "net/http" - "net/rpc" - "strconv" - "time" -) - -var CryptoHash = map[string]string{ - crypto.MD4.String(): "crypto.MD4.String()", - crypto.MD5.String(): "crypto.MD5.String()", - crypto.SHA1.String(): "crypto.SHA1.String()", - crypto.SHA224.String(): "crypto.SHA224.String()", - crypto.SHA256.String(): "crypto.SHA256.String()", - crypto.SHA384.String(): "crypto.SHA384.String()", - crypto.SHA512.String(): "crypto.SHA512.String()", - crypto.MD5SHA1.String(): "crypto.MD5SHA1.String()", - crypto.RIPEMD160.String(): "crypto.RIPEMD160.String()", - crypto.SHA3_224.String(): "crypto.SHA3_224.String()", - crypto.SHA3_256.String(): "crypto.SHA3_256.String()", - crypto.SHA3_384.String(): "crypto.SHA3_384.String()", - crypto.SHA3_512.String(): "crypto.SHA3_512.String()", - crypto.SHA512_224.String(): "crypto.SHA512_224.String()", - crypto.SHA512_256.String(): "crypto.SHA512_256.String()", - crypto.BLAKE2s_256.String(): "crypto.BLAKE2s_256.String()", - crypto.BLAKE2b_256.String(): "crypto.BLAKE2b_256.String()", - crypto.BLAKE2b_384.String(): "crypto.BLAKE2b_384.String()", - crypto.BLAKE2b_512.String(): "crypto.BLAKE2b_512.String()", -} - -var HTTPMethod = map[string]string{ - http.MethodGet: "http.MethodGet", - http.MethodHead: "http.MethodHead", - http.MethodPost: "http.MethodPost", - http.MethodPut: "http.MethodPut", - http.MethodPatch: "http.MethodPatch", - http.MethodDelete: "http.MethodDelete", - http.MethodConnect: "http.MethodConnect", - http.MethodOptions: "http.MethodOptions", - http.MethodTrace: "http.MethodTrace", -} - -var HTTPStatusCode = map[string]string{ - strconv.Itoa(http.StatusContinue): "http.StatusContinue", - strconv.Itoa(http.StatusSwitchingProtocols): "http.StatusSwitchingProtocols", - strconv.Itoa(http.StatusProcessing): "http.StatusProcessing", - strconv.Itoa(http.StatusEarlyHints): "http.StatusEarlyHints", - - strconv.Itoa(http.StatusOK): "http.StatusOK", - strconv.Itoa(http.StatusCreated): "http.StatusCreated", - strconv.Itoa(http.StatusAccepted): "http.StatusAccepted", - strconv.Itoa(http.StatusNonAuthoritativeInfo): "http.StatusNonAuthoritativeInfo", - strconv.Itoa(http.StatusNoContent): "http.StatusNoContent", - strconv.Itoa(http.StatusResetContent): "http.StatusResetContent", - strconv.Itoa(http.StatusPartialContent): "http.StatusPartialContent", - strconv.Itoa(http.StatusMultiStatus): "http.StatusMultiStatus", - strconv.Itoa(http.StatusAlreadyReported): "http.StatusAlreadyReported", - strconv.Itoa(http.StatusIMUsed): "http.StatusIMUsed", - - strconv.Itoa(http.StatusMultipleChoices): "http.StatusMultipleChoices", - strconv.Itoa(http.StatusMovedPermanently): "http.StatusMovedPermanently", - strconv.Itoa(http.StatusFound): "http.StatusFound", - strconv.Itoa(http.StatusSeeOther): "http.StatusSeeOther", - strconv.Itoa(http.StatusNotModified): "http.StatusNotModified", - strconv.Itoa(http.StatusUseProxy): "http.StatusUseProxy", - strconv.Itoa(http.StatusTemporaryRedirect): "http.StatusTemporaryRedirect", - strconv.Itoa(http.StatusPermanentRedirect): "http.StatusPermanentRedirect", - - strconv.Itoa(http.StatusBadRequest): "http.StatusBadRequest", - strconv.Itoa(http.StatusUnauthorized): "http.StatusUnauthorized", - strconv.Itoa(http.StatusPaymentRequired): "http.StatusPaymentRequired", - strconv.Itoa(http.StatusForbidden): "http.StatusForbidden", - strconv.Itoa(http.StatusNotFound): "http.StatusNotFound", - strconv.Itoa(http.StatusMethodNotAllowed): "http.StatusMethodNotAllowed", - strconv.Itoa(http.StatusNotAcceptable): "http.StatusNotAcceptable", - strconv.Itoa(http.StatusProxyAuthRequired): "http.StatusProxyAuthRequired", - strconv.Itoa(http.StatusRequestTimeout): "http.StatusRequestTimeout", - strconv.Itoa(http.StatusConflict): "http.StatusConflict", - strconv.Itoa(http.StatusGone): "http.StatusGone", - strconv.Itoa(http.StatusLengthRequired): "http.StatusLengthRequired", - strconv.Itoa(http.StatusPreconditionFailed): "http.StatusPreconditionFailed", - strconv.Itoa(http.StatusRequestEntityTooLarge): "http.StatusRequestEntityTooLarge", - strconv.Itoa(http.StatusRequestURITooLong): "http.StatusRequestURITooLong", - strconv.Itoa(http.StatusUnsupportedMediaType): "http.StatusUnsupportedMediaType", - strconv.Itoa(http.StatusRequestedRangeNotSatisfiable): "http.StatusRequestedRangeNotSatisfiable", - strconv.Itoa(http.StatusExpectationFailed): "http.StatusExpectationFailed", - strconv.Itoa(http.StatusTeapot): "http.StatusTeapot", - strconv.Itoa(http.StatusMisdirectedRequest): "http.StatusMisdirectedRequest", - strconv.Itoa(http.StatusUnprocessableEntity): "http.StatusUnprocessableEntity", - strconv.Itoa(http.StatusLocked): "http.StatusLocked", - strconv.Itoa(http.StatusFailedDependency): "http.StatusFailedDependency", - strconv.Itoa(http.StatusTooEarly): "http.StatusTooEarly", - strconv.Itoa(http.StatusUpgradeRequired): "http.StatusUpgradeRequired", - strconv.Itoa(http.StatusPreconditionRequired): "http.StatusPreconditionRequired", - strconv.Itoa(http.StatusTooManyRequests): "http.StatusTooManyRequests", - strconv.Itoa(http.StatusRequestHeaderFieldsTooLarge): "http.StatusRequestHeaderFieldsTooLarge", - strconv.Itoa(http.StatusUnavailableForLegalReasons): "http.StatusUnavailableForLegalReasons", - - strconv.Itoa(http.StatusInternalServerError): "http.StatusInternalServerError", - strconv.Itoa(http.StatusNotImplemented): "http.StatusNotImplemented", - strconv.Itoa(http.StatusBadGateway): "http.StatusBadGateway", - strconv.Itoa(http.StatusServiceUnavailable): "http.StatusServiceUnavailable", - strconv.Itoa(http.StatusGatewayTimeout): "http.StatusGatewayTimeout", - strconv.Itoa(http.StatusHTTPVersionNotSupported): "http.StatusHTTPVersionNotSupported", - strconv.Itoa(http.StatusVariantAlsoNegotiates): "http.StatusVariantAlsoNegotiates", - strconv.Itoa(http.StatusInsufficientStorage): "http.StatusInsufficientStorage", - strconv.Itoa(http.StatusLoopDetected): "http.StatusLoopDetected", - strconv.Itoa(http.StatusNotExtended): "http.StatusNotExtended", - strconv.Itoa(http.StatusNetworkAuthenticationRequired): "http.StatusNetworkAuthenticationRequired", -} - -var RPCDefaultPath = map[string]string{ - rpc.DefaultRPCPath: "rpc.DefaultRPCPath", - rpc.DefaultDebugPath: "rpc.DefaultDebugPath", -} - -var TimeWeekday = map[string]string{ - time.Sunday.String(): "time.Sunday.String()", - time.Monday.String(): "time.Monday.String()", - time.Tuesday.String(): "time.Tuesday.String()", - time.Wednesday.String(): "time.Wednesday.String()", - time.Thursday.String(): "time.Thursday.String()", - time.Friday.String(): "time.Friday.String()", - time.Saturday.String(): "time.Saturday.String()", -} - -var TimeMonth = map[string]string{ - time.January.String(): "time.January.String()", - time.February.String(): "time.February.String()", - time.March.String(): "time.March.String()", - time.April.String(): "time.April.String()", - time.May.String(): "time.May.String()", - time.June.String(): "time.June.String()", - time.July.String(): "time.July.String()", - time.August.String(): "time.August.String()", - time.September.String(): "time.September.String()", - time.October.String(): "time.October.String()", - time.November.String(): "time.November.String()", - time.December.String(): "time.December.String()", -} - -var TimeLayout = map[string]string{ - time.Layout: "time.Layout", - time.ANSIC: "time.ANSIC", - time.UnixDate: "time.UnixDate", - time.RubyDate: "time.RubyDate", - time.RFC822: "time.RFC822", - time.RFC822Z: "time.RFC822Z", - time.RFC850: "time.RFC850", - time.RFC1123: "time.RFC1123", - time.RFC1123Z: "time.RFC1123Z", - time.RFC3339: "time.RFC3339", - time.RFC3339Nano: "time.RFC3339Nano", - time.Kitchen: "time.Kitchen", - time.Stamp: "time.Stamp", - time.StampMilli: "time.StampMilli", - time.StampMicro: "time.StampMicro", - time.StampNano: "time.StampNano", - time.DateTime: "time.DateTime", - time.DateOnly: "time.DateOnly", - time.TimeOnly: "time.TimeOnly", -} - -var SQLIsolationLevel = map[string]string{ - // sql.LevelDefault.String(): "sql.LevelDefault.String()", - sql.LevelReadUncommitted.String(): "sql.LevelReadUncommitted.String()", - sql.LevelReadCommitted.String(): "sql.LevelReadCommitted.String()", - sql.LevelWriteCommitted.String(): "sql.LevelWriteCommitted.String()", - sql.LevelRepeatableRead.String(): "sql.LevelRepeatableRead.String()", - // sql.LevelSnapshot.String(): "sql.LevelSnapshot.String()", - // sql.LevelSerializable.String(): "sql.LevelSerializable.String()", - // sql.LevelLinearizable.String(): "sql.LevelLinearizable.String()", -} - -var TLSSignatureScheme = map[string]string{ - tls.PSSWithSHA256.String(): "tls.PSSWithSHA256.String()", - tls.ECDSAWithP256AndSHA256.String(): "tls.ECDSAWithP256AndSHA256.String()", - tls.Ed25519.String(): "tls.Ed25519.String()", - tls.PSSWithSHA384.String(): "tls.PSSWithSHA384.String()", - tls.PSSWithSHA512.String(): "tls.PSSWithSHA512.String()", - tls.PKCS1WithSHA256.String(): "tls.PKCS1WithSHA256.String()", - tls.PKCS1WithSHA384.String(): "tls.PKCS1WithSHA384.String()", - tls.PKCS1WithSHA512.String(): "tls.PKCS1WithSHA512.String()", - tls.ECDSAWithP384AndSHA384.String(): "tls.ECDSAWithP384AndSHA384.String()", - tls.ECDSAWithP521AndSHA512.String(): "tls.ECDSAWithP521AndSHA512.String()", - tls.PKCS1WithSHA1.String(): "tls.PKCS1WithSHA1.String()", - tls.ECDSAWithSHA1.String(): "tls.ECDSAWithSHA1.String()", -} - -var ConstantKind = map[string]string{ - // constant.Unknown.String(): "constant.Unknown.String()", - constant.Bool.String(): "constant.Bool.String()", - constant.String.String(): "constant.String.String()", - constant.Int.String(): "constant.Int.String()", - constant.Float.String(): "constant.Float.String()", - constant.Complex.String(): "constant.Complex.String()", -} diff --git a/vendor/github.com/securego/gosec/v2/.gitignore b/vendor/github.com/securego/gosec/v2/.gitignore deleted file mode 100644 index f6c8065b44..0000000000 --- a/vendor/github.com/securego/gosec/v2/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# transient files -/image - -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so -*.swp -/gosec - -# Folders -_obj -_test -vendor -dist - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -.DS_Store - -.vscode -.idea - -# SBOMs generated during CI -/bom.json diff --git a/vendor/github.com/securego/gosec/v2/.golangci.yml b/vendor/github.com/securego/gosec/v2/.golangci.yml deleted file mode 100644 index d591dc2493..0000000000 --- a/vendor/github.com/securego/gosec/v2/.golangci.yml +++ /dev/null @@ -1,45 +0,0 @@ -linters: - enable: - - asciicheck - - bodyclose - - dogsled - - durationcheck - - errcheck - - errorlint - - exportloopref - - gci - - ginkgolinter - - gochecknoinits - - gofmt - - gofumpt - - goimports - - gosec - - gosimple - - govet - - importas - - ineffassign - - megacheck - - misspell - - nakedret - - nolintlint - - revive - - staticcheck - - typecheck - - unconvert - - unparam - - unused - - wastedassign - -linters-settings: - gci: - sections: - - standard - - default - - prefix(github.com/securego) - revive: - rules: - - name: dot-imports - disabled: true - -run: - timeout: 5m diff --git a/vendor/github.com/securego/gosec/v2/.goreleaser.yml b/vendor/github.com/securego/gosec/v2/.goreleaser.yml deleted file mode 100644 index e3c903e7a7..0000000000 --- a/vendor/github.com/securego/gosec/v2/.goreleaser.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -project_name: gosec - -release: - extra_files: - - glob: ./bom.json - github: - owner: securego - name: gosec - -builds: - - main: ./cmd/gosec/ - binary: gosec - goos: - - darwin - - linux - - windows - goarch: - - amd64 - - arm64 - - s390x - ldflags: -X main.Version={{.Version}} -X main.GitTag={{.Tag}} -X main.BuildDate={{.Date}} - env: - - CGO_ENABLED=0 - -signs: -- cmd: cosign - stdin: '{{ .Env.COSIGN_PASSWORD}}' - args: - - "sign-blob" - - "--key=/tmp/cosign.key" - - "--output=${signature}" - - "${artifact}" - - "--yes" - artifacts: all - diff --git a/vendor/github.com/securego/gosec/v2/Dockerfile b/vendor/github.com/securego/gosec/v2/Dockerfile deleted file mode 100644 index 1bf94da7d7..0000000000 --- a/vendor/github.com/securego/gosec/v2/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -ARG GO_VERSION -FROM golang:${GO_VERSION}-alpine AS builder -RUN apk add --no-cache ca-certificates make git curl gcc libc-dev \ - && mkdir -p /build -WORKDIR /build -COPY . /build/ -RUN go mod download \ - && make build-linux - -FROM golang:${GO_VERSION}-alpine -RUN apk add --no-cache ca-certificates bash git gcc libc-dev openssh -ENV GO111MODULE on -COPY --from=builder /build/gosec /bin/gosec -COPY entrypoint.sh /bin/entrypoint.sh -ENTRYPOINT ["/bin/entrypoint.sh"] diff --git a/vendor/github.com/securego/gosec/v2/LICENSE.txt b/vendor/github.com/securego/gosec/v2/LICENSE.txt deleted file mode 100644 index 1756c78216..0000000000 --- a/vendor/github.com/securego/gosec/v2/LICENSE.txt +++ /dev/null @@ -1,154 +0,0 @@ -Apache License - -Version 2.0, January 2004 - -http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - -"License" shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, "control" means (i) the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising -permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -"Object" form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -"submitted" means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this -License, each Contributor hereby grants to You a perpetual, worldwide, -non-exclusive, no-charge, royalty-free, irrevocable copyright license to -reproduce, prepare Derivative Works of, publicly display, publicly perform, -sublicense, and distribute the Work and such Derivative Works in Source or -Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, -each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this section) patent -license to make, have made, use, offer to sell, sell, import, and otherwise -transfer the Work, where such license applies only to those patent claims -licensable by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) with the Work -to which such Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim in a lawsuit) -alleging that the Work or a Contribution incorporated within the Work -constitutes direct or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate as of the date -such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or -Derivative Works thereof in any medium, with or without modifications, and in -Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of -this License; and You must cause any modified files to carry prominent notices -stating that You changed the files; and You must retain, in the Source form of -any Derivative Works that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, excluding those notices -that do not pertain to any part of the Derivative Works; and If the Work -includes a "NOTICE" text file as part of its distribution, then any Derivative -Works that You distribute must include a readable copy of the attribution -notices contained within such NOTICE file, excluding those notices that do not -pertain to any part of the Derivative Works, in at least one of the following -places: within a NOTICE text file distributed as part of the Derivative Works; -within the Source form or documentation, if provided along with the Derivative -Works; or, within a display generated by the Derivative Works, if and wherever -such third-party notices normally appear. The contents of the NOTICE file are -for informational purposes only and do not modify the License. You may add Your -own attribution notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided that such -additional attribution notices cannot be construed as modifying the License. - -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. 5. Submission of Contributions. -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, -trademarks, service marks, or product names of the Licensor, except as required -for reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in -writing, Licensor provides the Work (and each Contributor provides its -Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied, including, without limitation, any warranties -or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any risks -associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in -tort (including negligence), contract, or otherwise, unless required by -applicable law (such as deliberate and grossly negligent acts) or agreed to in -writing, shall any Contributor be liable to You for damages, including any -direct, indirect, special, incidental, or consequential damages of any character -arising as a result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, work stoppage, -computer failure or malfunction, or any and all other commercial damages or -losses), even if such Contributor has been advised of the possibility of such -damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or -Derivative Works thereof, You may choose to offer, and charge a fee for, -acceptance of support, warranty, indemnity, or other liability obligations -and/or rights consistent with this License. However, in accepting such -obligations, You may act only on Your own behalf and on Your sole -responsibility, not on behalf of any other Contributor, and only if You agree to -indemnify, defend, and hold each Contributor harmless for any liability incurred -by, or claims asserted against, such Contributor by reason of your accepting any -such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/vendor/github.com/securego/gosec/v2/Makefile b/vendor/github.com/securego/gosec/v2/Makefile deleted file mode 100644 index dcfb4b2ed9..0000000000 --- a/vendor/github.com/securego/gosec/v2/Makefile +++ /dev/null @@ -1,95 +0,0 @@ -GIT_TAG?= $(shell git describe --always --tags) -BIN = gosec -FMT_CMD = $(gofmt -s -l -w $(find . -type f -name '*.go' -not -path './vendor/*') | tee /dev/stderr) -IMAGE_REPO = securego -DATE_FMT=+%Y-%m-%d -ifdef SOURCE_DATE_EPOCH - BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "$(DATE_FMT)" 2>/dev/null || date -u "$(DATE_FMT)") -else - BUILD_DATE ?= $(shell date "$(DATE_FMT)") -endif -BUILDFLAGS := "-w -s -X 'main.Version=$(GIT_TAG)' -X 'main.GitTag=$(GIT_TAG)' -X 'main.BuildDate=$(BUILD_DATE)'" -CGO_ENABLED = 0 -GO := GO111MODULE=on go -GOPATH ?= $(shell $(GO) env GOPATH) -GOBIN ?= $(GOPATH)/bin -GOSEC ?= $(GOBIN)/gosec -GINKGO ?= $(GOBIN)/ginkgo -GO_MINOR_VERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) -GOVULN_MIN_VERSION = 17 -GO_VERSION = 1.20 - -default: - $(MAKE) build - -install-test-deps: - go install github.com/onsi/ginkgo/v2/ginkgo@latest - go install golang.org/x/crypto/...@latest - go install github.com/lib/pq/...@latest - -install-govulncheck: - @if [ $(GO_MINOR_VERSION) -gt $(GOVULN_MIN_VERSION) ]; then \ - go install golang.org/x/vuln/cmd/govulncheck@latest; \ - fi - -test: install-test-deps build-race fmt vet sec govulncheck - $(GINKGO) -v --fail-fast - -fmt: - @echo "FORMATTING" - @FORMATTED=`$(GO) fmt ./...` - @([ ! -z "$(FORMATTED)" ] && printf "Fixed unformatted files:\n$(FORMATTED)") || true - -vet: - @echo "VETTING" - $(GO) vet ./... - -golangci: - @echo "LINTING: golangci-lint" - golangci-lint run - -sec: - @echo "SECURITY SCANNING" - ./$(BIN) ./... - -govulncheck: install-govulncheck - @echo "CHECKING VULNERABILITIES" - @if [ $(GO_MINOR_VERSION) -gt $(GOVULN_MIN_VERSION) ]; then \ - govulncheck ./...; \ - fi - -test-coverage: install-test-deps - go test -race -v -count=1 -coverprofile=coverage.out ./... - -build: - go build -o $(BIN) ./cmd/gosec/ - -build-race: - go build -race -o $(BIN) ./cmd/gosec/ - -clean: - rm -rf build vendor dist coverage.txt - rm -f release image $(BIN) - -release: - @echo "Releasing the gosec binary..." - goreleaser release - -build-linux: - CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=amd64 go build -ldflags=$(BUILDFLAGS) -o $(BIN) ./cmd/gosec/ - -image: - @echo "Building the Docker image..." - docker build -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) --build-arg GO_VERSION=$(GO_VERSION) . - docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest - touch image - -image-push: image - @echo "Pushing the Docker image..." - docker push $(IMAGE_REPO)/$(BIN):$(GIT_TAG) - docker push $(IMAGE_REPO)/$(BIN):latest - -tlsconfig: - go generate ./... - -.PHONY: test build clean release image image-push tlsconfig diff --git a/vendor/github.com/securego/gosec/v2/README.md b/vendor/github.com/securego/gosec/v2/README.md deleted file mode 100644 index d9a33f12a6..0000000000 --- a/vendor/github.com/securego/gosec/v2/README.md +++ /dev/null @@ -1,474 +0,0 @@ - -# gosec - Golang Security Checker - -Inspects source code for security problems by scanning the Go AST and SSA code representation. - - - -## License - -Licensed under the Apache License, Version 2.0 (the "License"). -You may not use this file except in compliance with the License. -You may obtain a copy of the License [here](http://www.apache.org/licenses/LICENSE-2.0). - -## Project status - -[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3218/badge)](https://bestpractices.coreinfrastructure.org/projects/3218) -[![Build Status](https://github.com/securego/gosec/workflows/CI/badge.svg)](https://github.com/securego/gosec/actions?query=workflows%3ACI) -[![Coverage Status](https://codecov.io/gh/securego/gosec/branch/master/graph/badge.svg)](https://codecov.io/gh/securego/gosec) -[![GoReport](https://goreportcard.com/badge/github.com/securego/gosec)](https://goreportcard.com/report/github.com/securego/gosec) -[![GoDoc](https://pkg.go.dev/badge/github.com/securego/gosec/v2)](https://pkg.go.dev/github.com/securego/gosec/v2) -[![Docs](https://readthedocs.org/projects/docs/badge/?version=latest)](https://securego.io/) -[![Downloads](https://img.shields.io/github/downloads/securego/gosec/total.svg)](https://github.com/securego/gosec/releases) -[![Docker Pulls](https://img.shields.io/docker/pulls/securego/gosec.svg)](https://hub.docker.com/r/securego/gosec/tags) -[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](http://securego.slack.com) - -## Install - -### CI Installation - -```bash -# binary will be $(go env GOPATH)/bin/gosec -curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin vX.Y.Z - -# or install it into ./bin/ -curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s vX.Y.Z - -# In alpine linux (as it does not come with curl by default) -wget -O - -q https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s vX.Y.Z - -# If you want to use the checksums provided on the "Releases" page -# then you will have to download a tar.gz file for your operating system instead of a binary file -wget https://github.com/securego/gosec/releases/download/vX.Y.Z/gosec_vX.Y.Z_OS.tar.gz - -# The file will be in the current folder where you run the command -# and you can check the checksum like this -echo " gosec_vX.Y.Z_OS.tar.gz" | sha256sum -c - - -gosec --help -``` - -### GitHub Action - -You can run `gosec` as a GitHub action as follows: - -```yaml -name: Run Gosec -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - tests: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@v3 - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - args: ./... -``` - -### Integrating with code scanning - -You can [integrate third-party code analysis tools](https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/integrating-with-code-scanning) with GitHub code scanning by uploading data as SARIF files. - -The workflow shows an example of running the `gosec` as a step in a GitHub action workflow which outputs the `results.sarif` file. The workflow then uploads the `results.sarif` file to GitHub using the `upload-sarif` action. - -```yaml -name: "Security Scan" - -# Run workflow each time code is pushed to your repository and on a schedule. -# The scheduled workflow runs every at 00:00 on Sunday UTC time. -on: - push: - schedule: - - cron: '0 0 * * 0' - -jobs: - tests: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@v3 - - name: Run Gosec Security Scanner - uses: securego/gosec@master - with: - # we let the report trigger content trigger a failure using the GitHub Security features. - args: '-no-fail -fmt sarif -out results.sarif ./...' - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v1 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: results.sarif -``` - -### Local Installation - -#### Go 1.16+ - -```bash -go install github.com/securego/gosec/v2/cmd/gosec@latest -``` - -#### Go version < 1.16 - -```bash -go get -u github.com/securego/gosec/v2/cmd/gosec -``` - -## Usage - -Gosec can be configured to only run a subset of rules, to exclude certain file -paths, and produce reports in different formats. By default all rules will be -run against the supplied input files. To recursively scan from the current -directory you can supply `./...` as the input argument. - -### Available rules - -- G101: Look for hard coded credentials -- G102: Bind to all interfaces -- G103: Audit the use of unsafe block -- G104: Audit errors not checked -- G106: Audit the use of ssh.InsecureIgnoreHostKey -- G107: Url provided to HTTP request as taint input -- G108: Profiling endpoint automatically exposed on /debug/pprof -- G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32 -- G110: Potential DoS vulnerability via decompression bomb -- G111: Potential directory traversal -- G112: Potential slowloris attack -- G113: Usage of Rat.SetString in math/big with an overflow (CVE-2022-23772) -- G114: Use of net/http serve function that has no support for setting timeouts -- G201: SQL query construction using format string -- G202: SQL query construction using string concatenation -- G203: Use of unescaped data in HTML templates -- G204: Audit use of command execution -- G301: Poor file permissions used when creating a directory -- G302: Poor file permissions used with chmod -- G303: Creating tempfile using a predictable path -- G304: File path provided as taint input -- G305: File traversal when extracting zip/tar archive -- G306: Poor file permissions used when writing to a new file -- G307: Poor file permissions used when creating a file with os.Create -- G401: Detect the usage of DES, RC4, MD5 or SHA1 -- G402: Look for bad TLS connection settings -- G403: Ensure minimum RSA key length of 2048 bits -- G404: Insecure random number source (rand) -- G501: Import blocklist: crypto/md5 -- G502: Import blocklist: crypto/des -- G503: Import blocklist: crypto/rc4 -- G504: Import blocklist: net/http/cgi -- G505: Import blocklist: crypto/sha1 -- G601: Implicit memory aliasing of items from a range statement -- G602: Slice access out of bounds - -### Retired rules - -- G105: Audit the use of math/big.Int.Exp - [CVE is fixed](https://github.com/golang/go/issues/15184) -- G307: Deferring a method which returns an error - causing more inconvenience than fixing a security issue, despite the details from this [blog post](https://www.joeshaw.org/dont-defer-close-on-writable-files/) - -### Selecting rules - -By default, gosec will run all rules against the supplied file paths. It is however possible to select a subset of rules to run via the `-include=` flag, -or to specify a set of rules to explicitly exclude using the `-exclude=` flag. - -```bash -# Run a specific set of rules -$ gosec -include=G101,G203,G401 ./... - -# Run everything except for rule G303 -$ gosec -exclude=G303 ./... -``` - -### CWE Mapping - -Every issue detected by `gosec` is mapped to a [CWE (Common Weakness Enumeration)](http://cwe.mitre.org/data/index.html) which describes in more generic terms the vulnerability. The exact mapping can be found [here](https://github.com/securego/gosec/blob/master/issue/issue.go#L50). - -### Configuration - -A number of global settings can be provided in a configuration file as follows: - -```JSON -{ - "global": { - "nosec": "enabled", - "audit": "enabled" - } -} -``` - -- `nosec`: this setting will overwrite all `#nosec` directives defined throughout the code base -- `audit`: runs in audit mode which enables addition checks that for normal code analysis might be too nosy - -```bash -# Run with a global configuration file -$ gosec -conf config.json . -``` - -Also some rules accept configuration. For instance on rule `G104`, it is possible to define packages along with a list -of functions which will be skipped when auditing the not checked errors: - -```JSON -{ - "G104": { - "ioutil": ["WriteFile"] - } -} -``` - -You can also configure the hard-coded credentials rule `G101` with additional patterns, or adjust the entropy threshold: - -```JSON -{ - "G101": { - "pattern": "(?i)passwd|pass|password|pwd|secret|private_key|token", - "ignore_entropy": false, - "entropy_threshold": "80.0", - "per_char_threshold": "3.0", - "truncate": "32" - } -} -``` - -### Dependencies - -gosec will fetch automatically the dependencies of the code which is being analyzed when go module is turned on (e.g.`GO111MODULE=on`). If this is not the case, -the dependencies need to be explicitly downloaded by running the `go get -d` command before the scan. - -### Excluding test files and folders - -gosec will ignore test files across all packages and any dependencies in your vendor directory. - -The scanning of test files can be enabled with the following flag: - -```bash -gosec -tests ./... -``` - -Also additional folders can be excluded as follows: - -```bash - gosec -exclude-dir=rules -exclude-dir=cmd ./... -``` - -### Excluding generated files - -gosec can ignore generated go files with default generated code comment. - -``` -// Code generated by some generator DO NOT EDIT. -``` - -```bash -gosec -exclude-generated ./... -``` - - -### Annotating code - -As with all automated detection tools, there will be cases of false positives. -In cases where gosec reports a failure that has been manually verified as being safe, -it is possible to annotate the code with a comment that starts with `#nosec`. - -The `#nosec` comment should have the format `#nosec [RuleList] [-- Justification]`. - -The `#nosec` comment needs to be placed on the line where the warning is reported. - -```go -func main() { - tr := &http.Transport{ - TLSClientConfig: &tls.Config{ - InsecureSkipVerify: true, // #nosec G402 - }, - } - - client := &http.Client{Transport: tr} - _, err := client.Get("https://golang.org/") - if err != nil { - fmt.Println(err) - } -} -``` - -When a specific false positive has been identified and verified as safe, you may -wish to suppress only that single rule (or a specific set of rules) within a section of code, -while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within -the `#nosec` annotation, e.g: `/* #nosec G401 */` or `//#nosec G201 G202 G203` - -You could put the description or justification text for the annotation. The -justification should be after the rule(s) to suppress and start with two or -more dashes, e.g: `//#nosec G101 G102 -- This is a false positive` - -In some cases you may also want to revisit places where `#nosec` annotations -have been used. To run the scanner and ignore any `#nosec` annotations you -can do the following: - -```bash -gosec -nosec=true ./... -``` - -### Tracking suppressions - -As described above, we could suppress violations externally (using `-include`/ -`-exclude`) or inline (using `#nosec` annotations) in gosec. This suppression -inflammation can be used to generate corresponding signals for auditing -purposes. - -We could track suppressions by the `-track-suppressions` flag as follows: - -```bash -gosec -track-suppressions -exclude=G101 -fmt=sarif -out=results.sarif ./... -``` - -- For external suppressions, gosec records suppression info where `kind` is -`external` and `justification` is a certain sentence "Globally suppressed". -- For inline suppressions, gosec records suppression info where `kind` is -`inSource` and `justification` is the text after two or more dashes in the -comment. - -**Note:** Only SARIF and JSON formats support tracking suppressions. - -### Build tags - -gosec is able to pass your [Go build tags](https://golang.org/pkg/go/build/) to the analyzer. -They can be provided as a comma separated list as follows: - -```bash -gosec -tags debug,ignore ./... -``` - -### Output formats - -gosec currently supports `text`, `json`, `yaml`, `csv`, `sonarqube`, `JUnit XML`, `html` and `golint` output formats. By default -results will be reported to stdout, but can also be written to an output -file. The output format is controlled by the `-fmt` flag, and the output file is controlled by the `-out` flag as follows: - -```bash -# Write output in json format to results.json -$ gosec -fmt=json -out=results.json *.go -``` - -Results will be reported to stdout as well as to the provided output file by `-stdout` flag. The `-verbose` flag overrides the -output format when stdout the results while saving them in the output file -```bash -# Write output in json format to results.json as well as stdout -$ gosec -fmt=json -out=results.json -stdout *.go - -# Overrides the output format to 'text' when stdout the results, while writing it to results.json -$ gosec -fmt=json -out=results.json -stdout -verbose=text *.go -``` - -**Note:** gosec generates the [generic issue import format](https://docs.sonarqube.org/latest/analysis/generic-issue/) for SonarQube, and a report has to be imported into SonarQube using `sonar.externalIssuesReportPaths=path/to/gosec-report.json`. - -## Development - -### Build - -You can build the binary with: - -```bash -make -``` - -### Note on Sarif Types Generation - -Install the tool with : - -```bash -go get -u github.com/a-h/generate/cmd/schema-generate -``` - -Then generate the types with : - -```bash -schema-generate -i sarif-schema-2.1.0.json -o mypath/types.go -``` - -Most of the MarshallJSON/UnmarshalJSON are removed except the one for PropertyBag which is handy to inline the additional properties. The rest can be removed. -The URI,ID, UUID, GUID were renamed so it fits the Golang convention defined [here](https://github.com/golang/lint/blob/master/lint.go#L700) - -### Tests - -You can run all unit tests using: - -```bash -make test -``` - -### Release - -You can create a release by tagging the version as follows: - -``` bash -git tag v1.0.0 -m "Release version v1.0.0" -git push origin v1.0.0 -``` - -The GitHub [release workflow](.github/workflows/release.yml) triggers immediately after the tag is pushed upstream. This flow will -release the binaries using the [goreleaser](https://goreleaser.com/actions/) action and then it will build and publish the docker image into Docker Hub. - -The released artifacts are signed using [cosign](https://docs.sigstore.dev/). You can use the public key from [cosign.pub](cosign.pub) -file to verify the signature of docker image and binaries files. - -The docker image signature can be verified with the following command: -``` -cosign verify --key cosign.pub securego/gosec: -``` - -The binary files signature can be verified with the following command: -``` -cosign verify-blob --key cosign.pub --signature gosec__darwin_amd64.tar.gz.sig gosec__darwin_amd64.tar.gz -``` - -### Docker image - -You can also build locally the docker image by using the command: - -```bash -make image -``` - -You can run the `gosec` tool in a container against your local Go project. You only have to mount the project -into a volume as follows: - -```bash -docker run --rm -it -w // -v /:/ securego/gosec //... -``` - -**Note:** the current working directory needs to be set with `-w` option in order to get successfully resolved the dependencies from go module file - -### Generate TLS rule - -The configuration of TLS rule can be generated from [Mozilla's TLS ciphers recommendation](https://statics.tls.security.mozilla.org/server-side-tls-conf.json). - -First you need to install the generator tool: - -```bash -go get github.com/securego/gosec/v2/cmd/tlsconfig/... -``` - -You can invoke now the `go generate` in the root of the project: - -```bash -go generate ./... -``` - -This will generate the `rules/tls_config.go` file which will contain the current ciphers recommendation from Mozilla. - -## Who is using gosec? - -This is a [list](USERS.md) with some of the gosec's users. - -## Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website - - diff --git a/vendor/github.com/securego/gosec/v2/USERS.md b/vendor/github.com/securego/gosec/v2/USERS.md deleted file mode 100644 index 9b6e4eeee4..0000000000 --- a/vendor/github.com/securego/gosec/v2/USERS.md +++ /dev/null @@ -1,30 +0,0 @@ -# Users - -This is a list of gosec's users. Please send a pull request with your organisation or project name if you are using gosec. - -## Companies - -1. [Gitlab](https://docs.gitlab.com/ee/user/application_security/sast/) -2. [CloudBees](https://cloudbees.com) -3. [VMware](https://www.vmware.com) -4. [Codacy](https://support.codacy.com/hc/en-us/articles/213632009-Engines) -5. [Coinbase](https://github.com/coinbase/watchdog/blob/master/Makefile#L12) -6. [RedHat/OpenShift](https://github.com/openshift/openshift-azure) -7. [Guardalis](https://www.guardrails.io/) -8. [1Password](https://github.com/1Password/srp) -9. [PingCAP/tidb](https://github.com/pingcap/tidb) -10. [Checkmarx](https://www.checkmarx.com/) -11. [SeatGeek](https://www.seatgeek.com/) -12. [reMarkable](https://remarkable.com) - -## Projects - -1. [golangci-lint](https://github.com/golangci/golangci-lint) -2. [Kubernetes](https://github.com/kubernetes/kubernetes) (via golangci) -3. [caddy](https://github.com/caddyserver/caddy) (via golangci) -4. [Jenkins X](https://github.com/jenkins-x/jx/blob/bdc51840a41b75776159c1c7b7faa1cf477be473/hack/linter.sh#L25) -5. [HuskyCI](https://huskyci.opensource.globo.com/) -6. [GolangCI](https://golangci.com/) -7. [semgrep.live](https://semgrep.live/) -8. [gofiber](https://github.com/gofiber/fiber) -9. [KICS](https://github.com/Checkmarx/kics) diff --git a/vendor/github.com/securego/gosec/v2/action.yml b/vendor/github.com/securego/gosec/v2/action.yml deleted file mode 100644 index aba47b60ce..0000000000 --- a/vendor/github.com/securego/gosec/v2/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'Gosec Security Checker' -description: 'Runs the gosec security checker' -author: '@ccojocar' - -inputs: - args: - description: 'Arguments for gosec' - required: true - default: '-h' - -runs: - using: 'docker' - image: 'docker://securego/gosec:2.18.1' - args: - - ${{ inputs.args }} - -branding: - icon: 'shield' - color: 'blue' diff --git a/vendor/github.com/securego/gosec/v2/analyzer.go b/vendor/github.com/securego/gosec/v2/analyzer.go deleted file mode 100644 index 1fd1f5649a..0000000000 --- a/vendor/github.com/securego/gosec/v2/analyzer.go +++ /dev/null @@ -1,698 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package gosec holds the central scanning logic used by gosec security scanner -package gosec - -import ( - "fmt" - "go/ast" - "go/build" - "go/token" - "go/types" - "log" - "os" - "path" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "sync" - - "github.com/securego/gosec/v2/analyzers" - "github.com/securego/gosec/v2/issue" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/packages" -) - -// LoadMode controls the amount of details to return when loading the packages -const LoadMode = packages.NeedName | - packages.NeedFiles | - packages.NeedCompiledGoFiles | - packages.NeedImports | - packages.NeedTypes | - packages.NeedTypesSizes | - packages.NeedTypesInfo | - packages.NeedSyntax | - packages.NeedModule | - packages.NeedEmbedFiles | - packages.NeedEmbedPatterns - -const externalSuppressionJustification = "Globally suppressed." - -const aliasOfAllRules = "*" - -var generatedCodePattern = regexp.MustCompile(`^// Code generated .* DO NOT EDIT\.$`) - -type ignore struct { - start int - end int - suppressions map[string][]issue.SuppressionInfo -} - -type ignores map[string][]ignore - -func newIgnores() ignores { - return make(map[string][]ignore) -} - -func (i ignores) parseLine(line string) (int, int) { - parts := strings.Split(line, "-") - start, err := strconv.Atoi(parts[0]) - if err != nil { - start = 0 - } - end := start - if len(parts) > 1 { - if e, err := strconv.Atoi(parts[1]); err == nil { - end = e - } - } - return start, end -} - -func (i ignores) add(file string, line string, suppressions map[string]issue.SuppressionInfo) { - is := []ignore{} - if _, ok := i[file]; ok { - is = i[file] - } - found := false - start, end := i.parseLine(line) - for _, ig := range is { - if ig.start <= start && ig.end >= end { - found = true - for r, s := range suppressions { - ss, ok := ig.suppressions[r] - if !ok { - ss = []issue.SuppressionInfo{} - } - ss = append(ss, s) - ig.suppressions[r] = ss - } - break - } - } - if !found { - ig := ignore{ - start: start, - end: end, - suppressions: map[string][]issue.SuppressionInfo{}, - } - for r, s := range suppressions { - ig.suppressions[r] = []issue.SuppressionInfo{s} - } - is = append(is, ig) - } - i[file] = is -} - -func (i ignores) get(file string, line string) map[string][]issue.SuppressionInfo { - start, end := i.parseLine(line) - if is, ok := i[file]; ok { - for _, i := range is { - if i.start <= start && i.end >= end { - return i.suppressions - } - } - } - return map[string][]issue.SuppressionInfo{} -} - -// The Context is populated with data parsed from the source code as it is scanned. -// It is passed through to all rule functions as they are called. Rules may use -// this data in conjunction with the encountered AST node. -type Context struct { - FileSet *token.FileSet - Comments ast.CommentMap - Info *types.Info - Pkg *types.Package - PkgFiles []*ast.File - Root *ast.File - Imports *ImportTracker - Config Config - Ignores ignores - PassedValues map[string]interface{} -} - -// GetFileAtNodePos returns the file at the node position in the file set available in the context. -func (ctx *Context) GetFileAtNodePos(node ast.Node) *token.File { - return ctx.FileSet.File(node.Pos()) -} - -// NewIssue creates a new issue -func (ctx *Context) NewIssue(node ast.Node, ruleID, desc string, - severity, confidence issue.Score, -) *issue.Issue { - return issue.New(ctx.GetFileAtNodePos(node), node, ruleID, desc, severity, confidence) -} - -// Metrics used when reporting information about a scanning run. -type Metrics struct { - NumFiles int `json:"files"` - NumLines int `json:"lines"` - NumNosec int `json:"nosec"` - NumFound int `json:"found"` -} - -// Analyzer object is the main object of gosec. It has methods traverse an AST -// and invoke the correct checking rules as on each node as required. -type Analyzer struct { - ignoreNosec bool - ruleset RuleSet - context *Context - config Config - logger *log.Logger - issues []*issue.Issue - stats *Metrics - errors map[string][]Error // keys are file paths; values are the golang errors in those files - tests bool - excludeGenerated bool - showIgnored bool - trackSuppressions bool - concurrency int - analyzerList []*analysis.Analyzer - mu sync.Mutex -} - -// NewAnalyzer builds a new analyzer. -func NewAnalyzer(conf Config, tests bool, excludeGenerated bool, trackSuppressions bool, concurrency int, logger *log.Logger) *Analyzer { - ignoreNoSec := false - if enabled, err := conf.IsGlobalEnabled(Nosec); err == nil { - ignoreNoSec = enabled - } - showIgnored := false - if enabled, err := conf.IsGlobalEnabled(ShowIgnored); err == nil { - showIgnored = enabled - } - if logger == nil { - logger = log.New(os.Stderr, "[gosec]", log.LstdFlags) - } - return &Analyzer{ - ignoreNosec: ignoreNoSec, - showIgnored: showIgnored, - ruleset: NewRuleSet(), - context: &Context{}, - config: conf, - logger: logger, - issues: make([]*issue.Issue, 0, 16), - stats: &Metrics{}, - errors: make(map[string][]Error), - tests: tests, - concurrency: concurrency, - excludeGenerated: excludeGenerated, - trackSuppressions: trackSuppressions, - analyzerList: analyzers.BuildDefaultAnalyzers(), - } -} - -// SetConfig updates the analyzer configuration -func (gosec *Analyzer) SetConfig(conf Config) { - gosec.config = conf -} - -// Config returns the current configuration -func (gosec *Analyzer) Config() Config { - return gosec.config -} - -// LoadRules instantiates all the rules to be used when analyzing source -// packages -func (gosec *Analyzer) LoadRules(ruleDefinitions map[string]RuleBuilder, ruleSuppressed map[string]bool) { - for id, def := range ruleDefinitions { - r, nodes := def(id, gosec.config) - gosec.ruleset.Register(r, ruleSuppressed[id], nodes...) - } -} - -// Process kicks off the analysis process for a given package -func (gosec *Analyzer) Process(buildTags []string, packagePaths ...string) error { - config := &packages.Config{ - Mode: LoadMode, - BuildFlags: buildTags, - Tests: gosec.tests, - } - - type result struct { - pkgPath string - pkgs []*packages.Package - err error - } - - results := make(chan result) - jobs := make(chan string, len(packagePaths)) - quit := make(chan struct{}) - - var wg sync.WaitGroup - - worker := func(j chan string, r chan result, quit chan struct{}) { - for { - select { - case s := <-j: - pkgs, err := gosec.load(s, config) - select { - case r <- result{pkgPath: s, pkgs: pkgs, err: err}: - case <-quit: - // we've been told to stop, probably an error while - // processing a previous result. - wg.Done() - return - } - default: - // j is empty and there are no jobs left - wg.Done() - return - } - } - } - - // fill the buffer - for _, pkgPath := range packagePaths { - jobs <- pkgPath - } - - for i := 0; i < gosec.concurrency; i++ { - wg.Add(1) - go worker(jobs, results, quit) - } - - go func() { - wg.Wait() - close(results) - }() - - for r := range results { - if r.err != nil { - gosec.AppendError(r.pkgPath, r.err) - } - for _, pkg := range r.pkgs { - if pkg.Name != "" { - err := gosec.ParseErrors(pkg) - if err != nil { - close(quit) - wg.Wait() // wait for the goroutines to stop - return fmt.Errorf("parsing errors in pkg %q: %w", pkg.Name, err) - } - gosec.CheckRules(pkg) - gosec.CheckAnalyzers(pkg) - } - } - } - sortErrors(gosec.errors) - return nil -} - -func (gosec *Analyzer) load(pkgPath string, conf *packages.Config) ([]*packages.Package, error) { - abspath, err := GetPkgAbsPath(pkgPath) - if err != nil { - gosec.logger.Printf("Skipping: %s. Path doesn't exist.", abspath) - return []*packages.Package{}, nil - } - - gosec.logger.Println("Import directory:", abspath) - // step 1/3 create build context. - buildD := build.Default - // step 2/3: add build tags to get env dependent files into basePackage. - gosec.mu.Lock() - buildD.BuildTags = conf.BuildFlags - gosec.mu.Unlock() - basePackage, err := buildD.ImportDir(pkgPath, build.ImportComment) - if err != nil { - return []*packages.Package{}, fmt.Errorf("importing dir %q: %w", pkgPath, err) - } - - var packageFiles []string - for _, filename := range basePackage.GoFiles { - packageFiles = append(packageFiles, path.Join(pkgPath, filename)) - } - for _, filename := range basePackage.CgoFiles { - packageFiles = append(packageFiles, path.Join(pkgPath, filename)) - } - - if gosec.tests { - testsFiles := make([]string, 0) - testsFiles = append(testsFiles, basePackage.TestGoFiles...) - testsFiles = append(testsFiles, basePackage.XTestGoFiles...) - for _, filename := range testsFiles { - packageFiles = append(packageFiles, path.Join(pkgPath, filename)) - } - } - - // step 3/3 remove build tags from conf to proceed build correctly. - gosec.mu.Lock() - conf.BuildFlags = nil - defer gosec.mu.Unlock() - pkgs, err := packages.Load(conf, packageFiles...) - if err != nil { - return []*packages.Package{}, fmt.Errorf("loading files from package %q: %w", pkgPath, err) - } - return pkgs, nil -} - -// CheckRules runs analysis on the given package. -func (gosec *Analyzer) CheckRules(pkg *packages.Package) { - gosec.logger.Println("Checking package:", pkg.Name) - for _, file := range pkg.Syntax { - fp := pkg.Fset.File(file.Pos()) - if fp == nil { - // skip files which cannot be located - continue - } - checkedFile := fp.Name() - // Skip the no-Go file from analysis (e.g. a Cgo files is expanded in 3 different files - // stored in the cache which do not need to by analyzed) - if filepath.Ext(checkedFile) != ".go" { - continue - } - if gosec.excludeGenerated && isGeneratedFile(file) { - gosec.logger.Println("Ignoring generated file:", checkedFile) - continue - } - - gosec.logger.Println("Checking file:", checkedFile) - gosec.context.FileSet = pkg.Fset - gosec.context.Config = gosec.config - gosec.context.Comments = ast.NewCommentMap(gosec.context.FileSet, file, file.Comments) - gosec.context.Root = file - gosec.context.Info = pkg.TypesInfo - gosec.context.Pkg = pkg.Types - gosec.context.PkgFiles = pkg.Syntax - gosec.context.Imports = NewImportTracker() - gosec.context.PassedValues = make(map[string]interface{}) - gosec.context.Ignores = newIgnores() - gosec.updateIgnores() - ast.Walk(gosec, file) - gosec.stats.NumFiles++ - gosec.stats.NumLines += pkg.Fset.File(file.Pos()).LineCount() - } -} - -// CheckAnalyzers runs analyzers on a given package. -func (gosec *Analyzer) CheckAnalyzers(pkg *packages.Package) { - ssaResult, err := gosec.buildSSA(pkg) - if err != nil || ssaResult == nil { - gosec.logger.Printf("Error building the SSA representation of the package %q: %s", pkg.Name, err) - return - } - - resultMap := map[*analysis.Analyzer]interface{}{ - buildssa.Analyzer: &analyzers.SSAAnalyzerResult{ - Config: gosec.Config(), - Logger: gosec.logger, - SSA: ssaResult.(*buildssa.SSA), - }, - } - for _, analyzer := range gosec.analyzerList { - pass := &analysis.Pass{ - Analyzer: analyzer, - Fset: pkg.Fset, - Files: pkg.Syntax, - OtherFiles: pkg.OtherFiles, - IgnoredFiles: pkg.IgnoredFiles, - Pkg: pkg.Types, - TypesInfo: pkg.TypesInfo, - TypesSizes: pkg.TypesSizes, - ResultOf: resultMap, - Report: func(d analysis.Diagnostic) {}, - ImportObjectFact: nil, - ExportObjectFact: nil, - ImportPackageFact: nil, - ExportPackageFact: nil, - AllObjectFacts: nil, - AllPackageFacts: nil, - } - result, err := pass.Analyzer.Run(pass) - if err != nil { - gosec.logger.Printf("Error running analyzer %s: %s\n", analyzer.Name, err) - continue - } - if result != nil { - if passIssues, ok := result.([]*issue.Issue); ok { - for _, iss := range passIssues { - gosec.updateIssues(iss) - } - } - } - } -} - -// buildSSA runs the SSA pass which builds the SSA representation of the package. It handles gracefully any panic. -func (gosec *Analyzer) buildSSA(pkg *packages.Package) (interface{}, error) { - defer func() { - if r := recover(); r != nil { - gosec.logger.Printf("Panic when running SSA analyser on package: %s", pkg.Name) - } - }() - ssaPass := &analysis.Pass{ - Analyzer: buildssa.Analyzer, - Fset: pkg.Fset, - Files: pkg.Syntax, - OtherFiles: pkg.OtherFiles, - IgnoredFiles: pkg.IgnoredFiles, - Pkg: pkg.Types, - TypesInfo: pkg.TypesInfo, - TypesSizes: pkg.TypesSizes, - ResultOf: nil, - Report: nil, - ImportObjectFact: nil, - ExportObjectFact: nil, - ImportPackageFact: nil, - ExportPackageFact: nil, - AllObjectFacts: nil, - AllPackageFacts: nil, - } - - return ssaPass.Analyzer.Run(ssaPass) -} - -func isGeneratedFile(file *ast.File) bool { - for _, comment := range file.Comments { - for _, row := range comment.List { - if generatedCodePattern.MatchString(row.Text) { - return true - } - } - } - return false -} - -// ParseErrors parses the errors from given package -func (gosec *Analyzer) ParseErrors(pkg *packages.Package) error { - if len(pkg.Errors) == 0 { - return nil - } - for _, pkgErr := range pkg.Errors { - parts := strings.Split(pkgErr.Pos, ":") - file := parts[0] - var err error - var line int - if len(parts) > 1 { - if line, err = strconv.Atoi(parts[1]); err != nil { - return fmt.Errorf("parsing line: %w", err) - } - } - var column int - if len(parts) > 2 { - if column, err = strconv.Atoi(parts[2]); err != nil { - return fmt.Errorf("parsing column: %w", err) - } - } - msg := strings.TrimSpace(pkgErr.Msg) - newErr := NewError(line, column, msg) - if errSlice, ok := gosec.errors[file]; ok { - gosec.errors[file] = append(errSlice, *newErr) - } else { - errSlice = []Error{} - gosec.errors[file] = append(errSlice, *newErr) - } - } - return nil -} - -// AppendError appends an error to the file errors -func (gosec *Analyzer) AppendError(file string, err error) { - // Do not report the error for empty packages (e.g. files excluded from build with a tag) - r := regexp.MustCompile(`no buildable Go source files in`) - if r.MatchString(err.Error()) { - return - } - errors := make([]Error, 0) - if ferrs, ok := gosec.errors[file]; ok { - errors = ferrs - } - ferr := NewError(0, 0, err.Error()) - errors = append(errors, *ferr) - gosec.errors[file] = errors -} - -// ignore a node (and sub-tree) if it is tagged with a nosec tag comment -func (gosec *Analyzer) ignore(n ast.Node) map[string]issue.SuppressionInfo { - if groups, ok := gosec.context.Comments[n]; ok && !gosec.ignoreNosec { - - // Checks if an alternative for #nosec is set and, if not, uses the default. - noSecDefaultTag, err := gosec.config.GetGlobal(Nosec) - if err != nil { - noSecDefaultTag = NoSecTag(string(Nosec)) - } else { - noSecDefaultTag = NoSecTag(noSecDefaultTag) - } - noSecAlternativeTag, err := gosec.config.GetGlobal(NoSecAlternative) - if err != nil { - noSecAlternativeTag = noSecDefaultTag - } else { - noSecAlternativeTag = NoSecTag(noSecAlternativeTag) - } - - for _, group := range groups { - comment := strings.TrimSpace(group.Text()) - foundDefaultTag := strings.HasPrefix(comment, noSecDefaultTag) || regexp.MustCompile("\n *"+noSecDefaultTag).Match([]byte(comment)) - foundAlternativeTag := strings.HasPrefix(comment, noSecAlternativeTag) || regexp.MustCompile("\n *"+noSecAlternativeTag).Match([]byte(comment)) - - if foundDefaultTag || foundAlternativeTag { - gosec.stats.NumNosec++ - - // Discard what's in front of the nosec tag. - if foundDefaultTag { - comment = strings.SplitN(comment, noSecDefaultTag, 2)[1] - } else { - comment = strings.SplitN(comment, noSecAlternativeTag, 2)[1] - } - - // Extract the directive and the justification. - justification := "" - commentParts := regexp.MustCompile(`-{2,}`).Split(comment, 2) - directive := commentParts[0] - if len(commentParts) > 1 { - justification = strings.TrimSpace(strings.TrimRight(commentParts[1], "\n")) - } - - // Pull out the specific rules that are listed to be ignored. - re := regexp.MustCompile(`(G\d{3})`) - matches := re.FindAllStringSubmatch(directive, -1) - - suppression := issue.SuppressionInfo{ - Kind: "inSource", - Justification: justification, - } - - // Find the rule IDs to ignore. - ignores := make(map[string]issue.SuppressionInfo) - for _, v := range matches { - ignores[v[1]] = suppression - } - - // If no specific rules were given, ignore everything. - if len(matches) == 0 { - ignores[aliasOfAllRules] = suppression - } - return ignores - } - } - } - return nil -} - -// Visit runs the gosec visitor logic over an AST created by parsing go code. -// Rule methods added with AddRule will be invoked as necessary. -func (gosec *Analyzer) Visit(n ast.Node) ast.Visitor { - // Using ast.File instead of ast.ImportSpec, so that we can track all imports at once. - switch i := n.(type) { - case *ast.File: - gosec.context.Imports.TrackFile(i) - } - - for _, rule := range gosec.ruleset.RegisteredFor(n) { - issue, err := rule.Match(n, gosec.context) - if err != nil { - file, line := GetLocation(n, gosec.context) - file = path.Base(file) - gosec.logger.Printf("Rule error: %v => %s (%s:%d)\n", reflect.TypeOf(rule), err, file, line) - } - gosec.updateIssues(issue) - } - return gosec -} - -func (gosec *Analyzer) updateIgnores() { - for n := range gosec.context.Comments { - gosec.updateIgnoredRulesForNode(n) - } -} - -func (gosec *Analyzer) updateIgnoredRulesForNode(n ast.Node) { - ignoredRules := gosec.ignore(n) - if len(ignoredRules) > 0 { - if gosec.context.Ignores == nil { - gosec.context.Ignores = newIgnores() - } - line := issue.GetLine(gosec.context.FileSet.File(n.Pos()), n) - gosec.context.Ignores.add( - gosec.context.FileSet.File(n.Pos()).Name(), - line, - ignoredRules, - ) - } -} - -func (gosec *Analyzer) getSuppressionsAtLineInFile(file string, line string, id string) ([]issue.SuppressionInfo, bool) { - ignoredRules := gosec.context.Ignores.get(file, line) - - // Check if the rule was specifically suppressed at this location. - generalSuppressions, generalIgnored := ignoredRules[aliasOfAllRules] - ruleSuppressions, ruleIgnored := ignoredRules[id] - ignored := generalIgnored || ruleIgnored - suppressions := append(generalSuppressions, ruleSuppressions...) - - // Track external suppressions of this rule. - if gosec.ruleset.IsRuleSuppressed(id) { - ignored = true - suppressions = append(suppressions, issue.SuppressionInfo{ - Kind: "external", - Justification: externalSuppressionJustification, - }) - } - return suppressions, ignored -} - -func (gosec *Analyzer) updateIssues(issue *issue.Issue) { - if issue != nil { - suppressions, ignored := gosec.getSuppressionsAtLineInFile(issue.File, issue.Line, issue.RuleID) - if gosec.showIgnored { - issue.NoSec = ignored - } - if !ignored || !gosec.showIgnored { - gosec.stats.NumFound++ - } - if ignored && gosec.trackSuppressions { - issue.WithSuppressions(suppressions) - gosec.issues = append(gosec.issues, issue) - } else if !ignored || gosec.showIgnored || gosec.ignoreNosec { - gosec.issues = append(gosec.issues, issue) - } - } -} - -// Report returns the current issues discovered and the metrics about the scan -func (gosec *Analyzer) Report() ([]*issue.Issue, *Metrics, map[string][]Error) { - return gosec.issues, gosec.stats, gosec.errors -} - -// Reset clears state such as context, issues and metrics from the configured analyzer -func (gosec *Analyzer) Reset() { - gosec.context = &Context{} - gosec.issues = make([]*issue.Issue, 0, 16) - gosec.stats = &Metrics{} - gosec.ruleset = NewRuleSet() -} diff --git a/vendor/github.com/securego/gosec/v2/analyzers/slice_bounds.go b/vendor/github.com/securego/gosec/v2/analyzers/slice_bounds.go deleted file mode 100644 index 08a55eb429..0000000000 --- a/vendor/github.com/securego/gosec/v2/analyzers/slice_bounds.go +++ /dev/null @@ -1,386 +0,0 @@ -// (c) Copyright gosec's authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analyzers - -import ( - "errors" - "fmt" - "go/token" - "regexp" - "strconv" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/ssa" - - "github.com/securego/gosec/v2/issue" -) - -type bound int - -const ( - lowerUnbounded bound = iota - upperUnbounded - unbounded - upperBounded -) - -const maxDepth = 20 - -func newSliceBoundsAnalyzer(id string, description string) *analysis.Analyzer { - return &analysis.Analyzer{ - Name: id, - Doc: description, - Run: runSliceBounds, - Requires: []*analysis.Analyzer{buildssa.Analyzer}, - } -} - -func runSliceBounds(pass *analysis.Pass) (interface{}, error) { - ssaResult, err := getSSAResult(pass) - if err != nil { - return nil, err - } - - issues := map[ssa.Instruction]*issue.Issue{} - ifs := map[ssa.If]*ssa.BinOp{} - for _, mcall := range ssaResult.SSA.SrcFuncs { - for _, block := range mcall.DomPreorder() { - for _, instr := range block.Instrs { - switch instr := instr.(type) { - case *ssa.Alloc: - sliceCap, err := extractSliceCapFromAlloc(instr.String()) - if err != nil { - break - } - allocRefs := instr.Referrers() - if allocRefs == nil { - break - } - for _, instr := range *allocRefs { - if slice, ok := instr.(*ssa.Slice); ok { - if _, ok := slice.X.(*ssa.Alloc); ok { - if slice.Parent() != nil { - l, h := extractSliceBounds(slice) - newCap := computeSliceNewCap(l, h, sliceCap) - violations := []ssa.Instruction{} - trackSliceBounds(0, newCap, slice, &violations, ifs) - for _, s := range violations { - switch s := s.(type) { - case *ssa.Slice: - issue := newIssue( - pass.Analyzer.Name, - "slice bounds out of range", - pass.Fset, - s.Pos(), - issue.Low, - issue.High) - issues[s] = issue - case *ssa.IndexAddr: - issue := newIssue( - pass.Analyzer.Name, - "slice index out of range", - pass.Fset, - s.Pos(), - issue.Low, - issue.High) - issues[s] = issue - } - } - } - } - } - } - } - } - } - } - - for ifref, binop := range ifs { - bound, value, err := extractBinOpBound(binop) - if err != nil { - continue - } - for i, block := range ifref.Block().Succs { - if i == 1 { - bound = invBound(bound) - } - for _, instr := range block.Instrs { - if _, ok := issues[instr]; ok { - switch bound { - case lowerUnbounded: - break - case upperUnbounded, unbounded: - delete(issues, instr) - case upperBounded: - switch tinstr := instr.(type) { - case *ssa.Slice: - lower, upper := extractSliceBounds(tinstr) - if isSliceInsideBounds(0, value, lower, upper) { - delete(issues, instr) - } - case *ssa.IndexAddr: - indexValue, err := extractIntValue(tinstr.Index.String()) - if err != nil { - break - } - if isSliceIndexInsideBounds(0, value, indexValue) { - delete(issues, instr) - } - } - } - } - } - } - } - - foundIssues := []*issue.Issue{} - for _, issue := range issues { - foundIssues = append(foundIssues, issue) - } - if len(foundIssues) > 0 { - return foundIssues, nil - } - return nil, nil -} - -func trackSliceBounds(depth int, sliceCap int, slice ssa.Node, violations *[]ssa.Instruction, ifs map[ssa.If]*ssa.BinOp) { - if depth == maxDepth { - return - } - depth++ - if violations == nil { - violations = &[]ssa.Instruction{} - } - referrers := slice.Referrers() - if referrers != nil { - for _, refinstr := range *referrers { - switch refinstr := refinstr.(type) { - case *ssa.Slice: - checkAllSlicesBounds(depth, sliceCap, refinstr, violations, ifs) - switch refinstr.X.(type) { - case *ssa.Alloc, *ssa.Parameter: - l, h := extractSliceBounds(refinstr) - newCap := computeSliceNewCap(l, h, sliceCap) - trackSliceBounds(depth, newCap, refinstr, violations, ifs) - } - case *ssa.IndexAddr: - indexValue, err := extractIntValue(refinstr.Index.String()) - if err == nil && !isSliceIndexInsideBounds(0, sliceCap, indexValue) { - *violations = append(*violations, refinstr) - } - case *ssa.Call: - if ifref, cond := extractSliceIfLenCondition(refinstr); ifref != nil && cond != nil { - ifs[*ifref] = cond - } else { - parPos := -1 - for pos, arg := range refinstr.Call.Args { - if a, ok := arg.(*ssa.Slice); ok && a == slice { - parPos = pos - } - } - if fn, ok := refinstr.Call.Value.(*ssa.Function); ok { - if len(fn.Params) > parPos && parPos > -1 { - param := fn.Params[parPos] - trackSliceBounds(depth, sliceCap, param, violations, ifs) - } - } - } - } - } - } -} - -func checkAllSlicesBounds(depth int, sliceCap int, slice *ssa.Slice, violations *[]ssa.Instruction, ifs map[ssa.If]*ssa.BinOp) { - if depth == maxDepth { - return - } - depth++ - if violations == nil { - violations = &[]ssa.Instruction{} - } - sliceLow, sliceHigh := extractSliceBounds(slice) - if !isSliceInsideBounds(0, sliceCap, sliceLow, sliceHigh) { - *violations = append(*violations, slice) - } - switch slice.X.(type) { - case *ssa.Alloc, *ssa.Parameter, *ssa.Slice: - l, h := extractSliceBounds(slice) - newCap := computeSliceNewCap(l, h, sliceCap) - trackSliceBounds(depth, newCap, slice, violations, ifs) - } - - references := slice.Referrers() - if references == nil { - return - } - for _, ref := range *references { - switch s := ref.(type) { - case *ssa.Slice: - checkAllSlicesBounds(depth, sliceCap, s, violations, ifs) - switch s.X.(type) { - case *ssa.Alloc, *ssa.Parameter: - l, h := extractSliceBounds(s) - newCap := computeSliceNewCap(l, h, sliceCap) - trackSliceBounds(depth, newCap, s, violations, ifs) - } - } - } -} - -func extractSliceIfLenCondition(call *ssa.Call) (*ssa.If, *ssa.BinOp) { - if builtInLen, ok := call.Call.Value.(*ssa.Builtin); ok { - if builtInLen.Name() == "len" { - refs := call.Referrers() - if refs != nil { - for _, ref := range *refs { - if binop, ok := ref.(*ssa.BinOp); ok { - binoprefs := binop.Referrers() - for _, ref := range *binoprefs { - if ifref, ok := ref.(*ssa.If); ok { - return ifref, binop - } - } - } - } - } - } - } - return nil, nil -} - -func computeSliceNewCap(l, h, oldCap int) int { - if l == 0 && h == 0 { - return oldCap - } - if l > 0 && h == 0 { - return oldCap - l - } - if l == 0 && h > 0 { - return h - } - return h - l -} - -func invBound(bound bound) bound { - switch bound { - case lowerUnbounded: - return upperUnbounded - case upperUnbounded: - return lowerUnbounded - case upperBounded: - return unbounded - case unbounded: - return upperBounded - default: - return unbounded - } -} - -func extractBinOpBound(binop *ssa.BinOp) (bound, int, error) { - if binop.X != nil { - if x, ok := binop.X.(*ssa.Const); ok { - value, err := strconv.Atoi(x.Value.String()) - if err != nil { - return lowerUnbounded, value, err - } - switch binop.Op { - case token.LSS, token.LEQ: - return upperUnbounded, value, nil - case token.GTR, token.GEQ: - return lowerUnbounded, value, nil - case token.EQL: - return upperBounded, value, nil - case token.NEQ: - return unbounded, value, nil - } - } - } - if binop.Y != nil { - if y, ok := binop.Y.(*ssa.Const); ok { - value, err := strconv.Atoi(y.Value.String()) - if err != nil { - return lowerUnbounded, value, err - } - switch binop.Op { - case token.LSS, token.LEQ: - return lowerUnbounded, value, nil - case token.GTR, token.GEQ: - return upperUnbounded, value, nil - case token.EQL: - return upperBounded, value, nil - case token.NEQ: - return unbounded, value, nil - } - } - } - return lowerUnbounded, 0, fmt.Errorf("unable to extract constant from binop") -} - -func isSliceIndexInsideBounds(l, h int, index int) bool { - return (l <= index && index < h) -} - -func isSliceInsideBounds(l, h int, cl, ch int) bool { - return (l <= cl && h >= ch) && (l <= ch && h >= cl) -} - -func extractSliceBounds(slice *ssa.Slice) (int, int) { - var low int - if slice.Low != nil { - l, err := extractIntValue(slice.Low.String()) - if err == nil { - low = l - } - } - var high int - if slice.High != nil { - h, err := extractIntValue(slice.High.String()) - if err == nil { - high = h - } - } - return low, high -} - -func extractIntValue(value string) (int, error) { - parts := strings.Split(value, ":") - if len(parts) != 2 { - return 0, fmt.Errorf("invalid value: %s", value) - } - if parts[1] != "int" { - return 0, fmt.Errorf("invalid value: %s", value) - } - return strconv.Atoi(parts[0]) -} - -func extractSliceCapFromAlloc(instr string) (int, error) { - re := regexp.MustCompile(`new \[(\d+)\]*`) - var sliceCap int - matches := re.FindAllStringSubmatch(instr, -1) - if matches == nil { - return sliceCap, errors.New("no slice cap found") - } - - if len(matches) > 0 { - m := matches[0] - if len(m) > 1 { - return strconv.Atoi(m[1]) - } - } - - return 0, errors.New("no slice cap found") -} diff --git a/vendor/github.com/securego/gosec/v2/analyzers/util.go b/vendor/github.com/securego/gosec/v2/analyzers/util.go deleted file mode 100644 index 5941184aa2..0000000000 --- a/vendor/github.com/securego/gosec/v2/analyzers/util.go +++ /dev/null @@ -1,98 +0,0 @@ -// (c) Copyright gosec's authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package analyzers - -import ( - "fmt" - "go/token" - "log" - "os" - "strconv" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - - "github.com/securego/gosec/v2/issue" -) - -// SSAAnalyzerResult contains various information returned by the -// SSA analysis along with some configuration -type SSAAnalyzerResult struct { - Config map[string]interface{} - Logger *log.Logger - SSA *buildssa.SSA -} - -// BuildDefaultAnalyzers returns the default list of analyzers -func BuildDefaultAnalyzers() []*analysis.Analyzer { - return []*analysis.Analyzer{ - newSliceBoundsAnalyzer("G602", "Possible slice bounds out of range"), - } -} - -// getSSAResult retrieves the SSA result from analysis pass -func getSSAResult(pass *analysis.Pass) (*SSAAnalyzerResult, error) { - result, ok := pass.ResultOf[buildssa.Analyzer] - if !ok { - return nil, fmt.Errorf("no SSA result found in the analysis pass") - } - ssaResult, ok := result.(*SSAAnalyzerResult) - if !ok { - return nil, fmt.Errorf("the analysis pass result is not of type SSA") - } - return ssaResult, nil -} - -// newIssue creates a new gosec issue -func newIssue(analyzerID string, desc string, fileSet *token.FileSet, - pos token.Pos, severity, confidence issue.Score, -) *issue.Issue { - file := fileSet.File(pos) - line := file.Line(pos) - col := file.Position(pos).Column - - return &issue.Issue{ - RuleID: analyzerID, - File: file.Name(), - Line: strconv.Itoa(line), - Col: strconv.Itoa(col), - Severity: severity, - Confidence: confidence, - What: desc, - Cwe: issue.GetCweByRule(analyzerID), - Code: issueCodeSnippet(fileSet, pos), - } -} - -func issueCodeSnippet(fileSet *token.FileSet, pos token.Pos) string { - file := fileSet.File(pos) - - start := (int64)(file.Line(pos)) - if start-issue.SnippetOffset > 0 { - start = start - issue.SnippetOffset - } - end := (int64)(file.Line(pos)) - end = end + issue.SnippetOffset - - var code string - if file, err := os.Open(file.Name()); err == nil { - defer file.Close() // #nosec - code, err = issue.CodeSnippet(file, start, end) - if err != nil { - return err.Error() - } - } - return code -} diff --git a/vendor/github.com/securego/gosec/v2/call_list.go b/vendor/github.com/securego/gosec/v2/call_list.go deleted file mode 100644 index 4f2d6c54e4..0000000000 --- a/vendor/github.com/securego/gosec/v2/call_list.go +++ /dev/null @@ -1,118 +0,0 @@ -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gosec - -import ( - "go/ast" - "strings" -) - -const vendorPath = "vendor/" - -type set map[string]bool - -// CallList is used to check for usage of specific packages -// and functions. -type CallList map[string]set - -// NewCallList creates a new empty CallList -func NewCallList() CallList { - return make(CallList) -} - -// AddAll will add several calls to the call list at once -func (c CallList) AddAll(selector string, idents ...string) { - for _, ident := range idents { - c.Add(selector, ident) - } -} - -// Add a selector and call to the call list -func (c CallList) Add(selector, ident string) { - if _, ok := c[selector]; !ok { - c[selector] = make(set) - } - c[selector][ident] = true -} - -// Contains returns true if the package and function are -// members of this call list. -func (c CallList) Contains(selector, ident string) bool { - if idents, ok := c[selector]; ok { - _, found := idents[ident] - return found - } - return false -} - -// ContainsPointer returns true if a pointer to the selector type or the type -// itself is a members of this call list. -func (c CallList) ContainsPointer(selector, indent string) bool { - if strings.HasPrefix(selector, "*") { - if c.Contains(selector, indent) { - return true - } - s := strings.TrimPrefix(selector, "*") - return c.Contains(s, indent) - } - return false -} - -// ContainsPkgCallExpr resolves the call expression name and type, and then further looks -// up the package path for that type. Finally, it determines if the call exists within the call list -func (c CallList) ContainsPkgCallExpr(n ast.Node, ctx *Context, stripVendor bool) *ast.CallExpr { - selector, ident, err := GetCallInfo(n, ctx) - if err != nil { - return nil - } - - // Selector can have two forms: - // 1. A short name if a module function is called (expr.Name). - // E.g., "big" if called function from math/big. - // 2. A full name if a structure function is called (TypeOf(expr)). - // E.g., "math/big.Rat" if called function of Rat structure from math/big. - if !strings.ContainsRune(selector, '.') { - // Use only explicit path (optionally strip vendor path prefix) to reduce conflicts - path, ok := GetImportPath(selector, ctx) - if !ok { - return nil - } - selector = path - } - - if stripVendor { - if vendorIdx := strings.Index(selector, vendorPath); vendorIdx >= 0 { - selector = selector[vendorIdx+len(vendorPath):] - } - } - if !c.Contains(selector, ident) { - return nil - } - - return n.(*ast.CallExpr) -} - -// ContainsCallExpr resolves the call expression name and type, and then determines -// if the call exists with the call list -func (c CallList) ContainsCallExpr(n ast.Node, ctx *Context) *ast.CallExpr { - selector, ident, err := GetCallInfo(n, ctx) - if err != nil { - return nil - } - if !c.Contains(selector, ident) && !c.ContainsPointer(selector, ident) { - return nil - } - - return n.(*ast.CallExpr) -} diff --git a/vendor/github.com/securego/gosec/v2/config.go b/vendor/github.com/securego/gosec/v2/config.go deleted file mode 100644 index 9cbb7a7134..0000000000 --- a/vendor/github.com/securego/gosec/v2/config.go +++ /dev/null @@ -1,137 +0,0 @@ -package gosec - -import ( - "bytes" - "encoding/json" - "fmt" - "io" -) - -const ( - // Globals are applicable to all rules and used for general - // configuration settings for gosec. - Globals = "global" -) - -// GlobalOption defines the name of the global options -type GlobalOption string - -const ( - // Nosec global option for #nosec directive - Nosec GlobalOption = "nosec" - // ShowIgnored defines whether nosec issues are counted as finding or not - ShowIgnored GlobalOption = "show-ignored" - // Audit global option which indicates that gosec runs in audit mode - Audit GlobalOption = "audit" - // NoSecAlternative global option alternative for #nosec directive - NoSecAlternative GlobalOption = "#nosec" - // ExcludeRules global option for some rules should not be load - ExcludeRules GlobalOption = "exclude" - // IncludeRules global option for should be load - IncludeRules GlobalOption = "include" - // SSA global option to enable go analysis framework with SSA support - SSA GlobalOption = "ssa" -) - -// NoSecTag returns the tag used to disable gosec for a line of code. -func NoSecTag(tag string) string { - return fmt.Sprintf("%s%s", "#", tag) -} - -// Config is used to provide configuration and customization to each of the rules. -type Config map[string]interface{} - -// NewConfig initializes a new configuration instance. The configuration data then -// needs to be loaded via c.ReadFrom(strings.NewReader("config data")) -// or from a *os.File. -func NewConfig() Config { - cfg := make(Config) - cfg[Globals] = make(map[GlobalOption]string) - return cfg -} - -func (c Config) keyToGlobalOptions(key string) GlobalOption { - return GlobalOption(key) -} - -func (c Config) convertGlobals() { - if globals, ok := c[Globals]; ok { - if settings, ok := globals.(map[string]interface{}); ok { - validGlobals := map[GlobalOption]string{} - for k, v := range settings { - validGlobals[c.keyToGlobalOptions(k)] = fmt.Sprintf("%v", v) - } - c[Globals] = validGlobals - } - } -} - -// ReadFrom implements the io.ReaderFrom interface. This -// should be used with io.Reader to load configuration from -// file or from string etc. -func (c Config) ReadFrom(r io.Reader) (int64, error) { - data, err := io.ReadAll(r) - if err != nil { - return int64(len(data)), err - } - if err = json.Unmarshal(data, &c); err != nil { - return int64(len(data)), err - } - c.convertGlobals() - return int64(len(data)), nil -} - -// WriteTo implements the io.WriteTo interface. This should -// be used to save or print out the configuration information. -func (c Config) WriteTo(w io.Writer) (int64, error) { - data, err := json.Marshal(c) - if err != nil { - return int64(len(data)), err - } - return io.Copy(w, bytes.NewReader(data)) -} - -// Get returns the configuration section for the supplied key -func (c Config) Get(section string) (interface{}, error) { - settings, found := c[section] - if !found { - return nil, fmt.Errorf("Section %s not in configuration", section) - } - return settings, nil -} - -// Set section in the configuration to specified value -func (c Config) Set(section string, value interface{}) { - c[section] = value -} - -// GetGlobal returns value associated with global configuration option -func (c Config) GetGlobal(option GlobalOption) (string, error) { - if globals, ok := c[Globals]; ok { - if settings, ok := globals.(map[GlobalOption]string); ok { - if value, ok := settings[option]; ok { - return value, nil - } - return "", fmt.Errorf("global setting for %s not found", option) - } - } - return "", fmt.Errorf("no global config options found") -} - -// SetGlobal associates a value with a global configuration option -func (c Config) SetGlobal(option GlobalOption, value string) { - if globals, ok := c[Globals]; ok { - if settings, ok := globals.(map[GlobalOption]string); ok { - settings[option] = value - } - } -} - -// IsGlobalEnabled checks if a global option is enabled -func (c Config) IsGlobalEnabled(option GlobalOption) (bool, error) { - value, err := c.GetGlobal(option) - if err != nil { - return false, err - } - return (value == "true" || value == "enabled"), nil -} diff --git a/vendor/github.com/securego/gosec/v2/cosign.pub b/vendor/github.com/securego/gosec/v2/cosign.pub deleted file mode 100644 index c6fd55988b..0000000000 --- a/vendor/github.com/securego/gosec/v2/cosign.pub +++ /dev/null @@ -1,4 +0,0 @@ ------BEGIN PUBLIC KEY----- -MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEFphl7f2VuFRfsi4wqiLUCQ9xHQgV -O2VMDNcvh+kxiymLXa+GkPzSKExFYIlVwfg13URvCiB+kFvITmLzuLiGQg== ------END PUBLIC KEY----- diff --git a/vendor/github.com/securego/gosec/v2/cwe/data.go b/vendor/github.com/securego/gosec/v2/cwe/data.go deleted file mode 100644 index 79a6b9d231..0000000000 --- a/vendor/github.com/securego/gosec/v2/cwe/data.go +++ /dev/null @@ -1,140 +0,0 @@ -package cwe - -const ( - // Acronym is the acronym of CWE - Acronym = "CWE" - // Version the CWE version - Version = "4.4" - // ReleaseDateUtc the release Date of CWE Version - ReleaseDateUtc = "2021-03-15" - // Organization MITRE - Organization = "MITRE" - // Description the description of CWE - Description = "The MITRE Common Weakness Enumeration" - // InformationURI link to the published CWE PDF - InformationURI = "https://cwe.mitre.org/data/published/cwe_v" + Version + ".pdf/" - // DownloadURI link to the zipped XML of the CWE list - DownloadURI = "https://cwe.mitre.org/data/xml/cwec_v" + Version + ".xml.zip" -) - -var idWeaknesses = map[string]*Weakness{ - "118": { - ID: "118", - Description: "The software does not restrict or incorrectly restricts operations within the boundaries of a resource that is accessed using an index or pointer, such as memory or files.", - Name: "Incorrect Access of Indexable Resource ('Range Error')", - }, - "190": { - ID: "190", - Description: "The software performs a calculation that can produce an integer overflow or wraparound, when the logic assumes that the resulting value will always be larger than the original value. This can introduce other weaknesses when the calculation is used for resource management or execution control.", - Name: "Integer Overflow or Wraparound", - }, - "200": { - ID: "200", - Description: "The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.", - Name: "Exposure of Sensitive Information to an Unauthorized Actor", - }, - "22": { - ID: "22", - Description: "The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.", - Name: "Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')", - }, - "242": { - ID: "242", - Description: "The program calls a function that can never be guaranteed to work safely.", - Name: "Use of Inherently Dangerous Function", - }, - "276": { - ID: "276", - Description: "During installation, installed file permissions are set to allow anyone to modify those files.", - Name: "Incorrect Default Permissions", - }, - "295": { - ID: "295", - Description: "The software does not validate, or incorrectly validates, a certificate.", - Name: "Improper Certificate Validation", - }, - "310": { - ID: "310", - Description: "Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not addressed.", - Name: "Cryptographic Issues", - }, - "322": { - ID: "322", - Description: "The software performs a key exchange with an actor without verifying the identity of that actor.", - Name: "Key Exchange without Entity Authentication", - }, - "326": { - ID: "326", - Description: "The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.", - Name: "Inadequate Encryption Strength", - }, - "327": { - ID: "327", - Description: "The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.", - Name: "Use of a Broken or Risky Cryptographic Algorithm", - }, - "338": { - ID: "338", - Description: "The product uses a Pseudo-Random Number Generator (PRNG) in a security context, but the PRNG's algorithm is not cryptographically strong.", - Name: "Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)", - }, - "377": { - ID: "377", - Description: "Creating and using insecure temporary files can leave application and system data vulnerable to attack.", - Name: "Insecure Temporary File", - }, - "400": { - ID: "400", - Description: "The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.", - Name: "Uncontrolled Resource Consumption", - }, - "409": { - ID: "409", - Description: "The software does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.", - Name: "Improper Handling of Highly Compressed Data (Data Amplification)", - }, - "703": { - ID: "703", - Description: "The software does not properly anticipate or handle exceptional conditions that rarely occur during normal operation of the software.", - Name: "Improper Check or Handling of Exceptional Conditions", - }, - "78": { - ID: "78", - Description: "The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.", - Name: "Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')", - }, - "79": { - ID: "79", - Description: "The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.", - Name: "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')", - }, - "798": { - ID: "798", - Description: "The software contains hard-coded credentials, such as a password or cryptographic key, which it uses for its own inbound authentication, outbound communication to external components, or encryption of internal data.", - Name: "Use of Hard-coded Credentials", - }, - "88": { - ID: "88", - Description: "The software constructs a string for a command to executed by a separate component\nin another control sphere, but it does not properly delimit the\nintended arguments, options, or switches within that command string.", - Name: "Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')", - }, - "89": { - ID: "89", - Description: "The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.", - Name: "Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')", - }, - "676": { - ID: "676", - Description: "The program invokes a potentially dangerous function that could introduce a vulnerability if it is used incorrectly, but the function can also be used safely.", - Name: "Use of Potentially Dangerous Function", - }, -} - -// Get Retrieves a CWE weakness by it's id -func Get(id string) *Weakness { - weakness, ok := idWeaknesses[id] - if ok && weakness != nil { - return weakness - } - return nil -} diff --git a/vendor/github.com/securego/gosec/v2/cwe/types.go b/vendor/github.com/securego/gosec/v2/cwe/types.go deleted file mode 100644 index 562510a8b4..0000000000 --- a/vendor/github.com/securego/gosec/v2/cwe/types.go +++ /dev/null @@ -1,38 +0,0 @@ -package cwe - -import ( - "encoding/json" - "fmt" -) - -// Weakness defines a CWE weakness based on http://cwe.mitre.org/data/xsd/cwe_schema_v6.4.xsd -type Weakness struct { - ID string - Name string - Description string -} - -// SprintURL format the CWE URL -func (w *Weakness) SprintURL() string { - return fmt.Sprintf("https://cwe.mitre.org/data/definitions/%s.html", w.ID) -} - -// SprintID format the CWE ID -func (w *Weakness) SprintID() string { - id := "0000" - if w != nil { - id = w.ID - } - return fmt.Sprintf("%s-%s", Acronym, id) -} - -// MarshalJSON print only id and URL -func (w *Weakness) MarshalJSON() ([]byte, error) { - return json.Marshal(&struct { - ID string `json:"id"` - URL string `json:"url"` - }{ - ID: w.ID, - URL: w.SprintURL(), - }) -} diff --git a/vendor/github.com/securego/gosec/v2/entrypoint.sh b/vendor/github.com/securego/gosec/v2/entrypoint.sh deleted file mode 100644 index bc6ad6a241..0000000000 --- a/vendor/github.com/securego/gosec/v2/entrypoint.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Expand the arguments into an array of strings. This is required because the GitHub action -# provides all arguments concatenated as a single string. -ARGS=("$@") - -if [[ ! -z "${GITHUB_AUTHENTICATION_TOKEN}" ]]; then - git config --global --add url."https://x-access-token:${GITHUB_AUTHENTICATION_TOKEN}@github.com/".insteadOf "https://github.com/" -fi - -/bin/gosec ${ARGS[*]} diff --git a/vendor/github.com/securego/gosec/v2/errors.go b/vendor/github.com/securego/gosec/v2/errors.go deleted file mode 100644 index 2f66727046..0000000000 --- a/vendor/github.com/securego/gosec/v2/errors.go +++ /dev/null @@ -1,33 +0,0 @@ -package gosec - -import ( - "sort" -) - -// Error is used when there are golang errors while parsing the AST -type Error struct { - Line int `json:"line"` - Column int `json:"column"` - Err string `json:"error"` -} - -// NewError creates Error object -func NewError(line, column int, err string) *Error { - return &Error{ - Line: line, - Column: column, - Err: err, - } -} - -// sortErrors sorts the golang errors by line -func sortErrors(allErrors map[string][]Error) { - for _, errors := range allErrors { - sort.Slice(errors, func(i, j int) bool { - if errors[i].Line == errors[j].Line { - return errors[i].Column <= errors[j].Column - } - return errors[i].Line < errors[j].Line - }) - } -} diff --git a/vendor/github.com/securego/gosec/v2/helpers.go b/vendor/github.com/securego/gosec/v2/helpers.go deleted file mode 100644 index 15b2b5f3a3..0000000000 --- a/vendor/github.com/securego/gosec/v2/helpers.go +++ /dev/null @@ -1,519 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gosec - -import ( - "errors" - "fmt" - "go/ast" - "go/token" - "go/types" - "os" - "os/user" - "path/filepath" - "regexp" - "runtime" - "strconv" - "strings" -) - -// MatchCallByPackage ensures that the specified package is imported, -// adjusts the name for any aliases and ignores cases that are -// initialization only imports. -// -// Usage: -// -// node, matched := MatchCallByPackage(n, ctx, "math/rand", "Read") -func MatchCallByPackage(n ast.Node, c *Context, pkg string, names ...string) (*ast.CallExpr, bool) { - importedNames, found := GetImportedNames(pkg, c) - if !found { - return nil, false - } - - if callExpr, ok := n.(*ast.CallExpr); ok { - packageName, callName, err := GetCallInfo(callExpr, c) - if err != nil { - return nil, false - } - for _, in := range importedNames { - if packageName != in { - continue - } - for _, name := range names { - if callName == name { - return callExpr, true - } - } - } - } - return nil, false -} - -// MatchCompLit will match an ast.CompositeLit based on the supplied type -func MatchCompLit(n ast.Node, ctx *Context, required string) *ast.CompositeLit { - if complit, ok := n.(*ast.CompositeLit); ok { - typeOf := ctx.Info.TypeOf(complit) - if typeOf.String() == required { - return complit - } - } - return nil -} - -// GetInt will read and return an integer value from an ast.BasicLit -func GetInt(n ast.Node) (int64, error) { - if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.INT { - return strconv.ParseInt(node.Value, 0, 64) - } - return 0, fmt.Errorf("Unexpected AST node type: %T", n) -} - -// GetFloat will read and return a float value from an ast.BasicLit -func GetFloat(n ast.Node) (float64, error) { - if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.FLOAT { - return strconv.ParseFloat(node.Value, 64) - } - return 0.0, fmt.Errorf("Unexpected AST node type: %T", n) -} - -// GetChar will read and return a char value from an ast.BasicLit -func GetChar(n ast.Node) (byte, error) { - if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.CHAR { - return node.Value[0], nil - } - return 0, fmt.Errorf("Unexpected AST node type: %T", n) -} - -// GetStringRecursive will recursively walk down a tree of *ast.BinaryExpr. It will then concat the results, and return. -// Unlike the other getters, it does _not_ raise an error for unknown ast.Node types. At the base, the recursion will hit a non-BinaryExpr type, -// either BasicLit or other, so it's not an error case. It will only error if `strconv.Unquote` errors. This matters, because there's -// currently functionality that relies on error values being returned by GetString if and when it hits a non-basiclit string node type, -// hence for cases where recursion is needed, we use this separate function, so that we can still be backwards compatible. -// -// This was added to handle a SQL injection concatenation case where the injected value is infixed between two strings, not at the start or end. See example below -// -// Do note that this will omit non-string values. So for example, if you were to use this node: -// ```go -// q := "SELECT * FROM foo WHERE name = '" + os.Args[0] + "' AND 1=1" // will result in "SELECT * FROM foo WHERE ” AND 1=1" - -func GetStringRecursive(n ast.Node) (string, error) { - if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.STRING { - return strconv.Unquote(node.Value) - } - - if expr, ok := n.(*ast.BinaryExpr); ok { - x, err := GetStringRecursive(expr.X) - if err != nil { - return "", err - } - - y, err := GetStringRecursive(expr.Y) - if err != nil { - return "", err - } - - return x + y, nil - } - - return "", nil -} - -// GetString will read and return a string value from an ast.BasicLit -func GetString(n ast.Node) (string, error) { - if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.STRING { - return strconv.Unquote(node.Value) - } - - return "", fmt.Errorf("Unexpected AST node type: %T", n) -} - -// GetCallObject returns the object and call expression and associated -// object for a given AST node. nil, nil will be returned if the -// object cannot be resolved. -func GetCallObject(n ast.Node, ctx *Context) (*ast.CallExpr, types.Object) { - switch node := n.(type) { - case *ast.CallExpr: - switch fn := node.Fun.(type) { - case *ast.Ident: - return node, ctx.Info.Uses[fn] - case *ast.SelectorExpr: - return node, ctx.Info.Uses[fn.Sel] - } - } - return nil, nil -} - -// GetCallInfo returns the package or type and name associated with a -// call expression. -func GetCallInfo(n ast.Node, ctx *Context) (string, string, error) { - switch node := n.(type) { - case *ast.CallExpr: - switch fn := node.Fun.(type) { - case *ast.SelectorExpr: - switch expr := fn.X.(type) { - case *ast.Ident: - if expr.Obj != nil && expr.Obj.Kind == ast.Var { - t := ctx.Info.TypeOf(expr) - if t != nil { - return t.String(), fn.Sel.Name, nil - } - return "undefined", fn.Sel.Name, fmt.Errorf("missing type info") - } - return expr.Name, fn.Sel.Name, nil - case *ast.SelectorExpr: - if expr.Sel != nil { - t := ctx.Info.TypeOf(expr.Sel) - if t != nil { - return t.String(), fn.Sel.Name, nil - } - return "undefined", fn.Sel.Name, fmt.Errorf("missing type info") - } - case *ast.CallExpr: - switch call := expr.Fun.(type) { - case *ast.Ident: - if call.Name == "new" && len(expr.Args) > 0 { - t := ctx.Info.TypeOf(expr.Args[0]) - if t != nil { - return t.String(), fn.Sel.Name, nil - } - return "undefined", fn.Sel.Name, fmt.Errorf("missing type info") - } - if call.Obj != nil { - switch decl := call.Obj.Decl.(type) { - case *ast.FuncDecl: - ret := decl.Type.Results - if ret != nil && len(ret.List) > 0 { - ret1 := ret.List[0] - if ret1 != nil { - t := ctx.Info.TypeOf(ret1.Type) - if t != nil { - return t.String(), fn.Sel.Name, nil - } - return "undefined", fn.Sel.Name, fmt.Errorf("missing type info") - } - } - } - } - } - } - case *ast.Ident: - return ctx.Pkg.Name(), fn.Name, nil - } - } - - return "", "", fmt.Errorf("unable to determine call info") -} - -// GetCallStringArgsValues returns the values of strings arguments if they can be resolved -func GetCallStringArgsValues(n ast.Node, _ *Context) []string { - values := []string{} - switch node := n.(type) { - case *ast.CallExpr: - for _, arg := range node.Args { - switch param := arg.(type) { - case *ast.BasicLit: - value, err := GetString(param) - if err == nil { - values = append(values, value) - } - case *ast.Ident: - values = append(values, GetIdentStringValues(param)...) - } - } - } - return values -} - -func getIdentStringValues(ident *ast.Ident, stringFinder func(ast.Node) (string, error)) []string { - values := []string{} - obj := ident.Obj - if obj != nil { - switch decl := obj.Decl.(type) { - case *ast.ValueSpec: - for _, v := range decl.Values { - value, err := stringFinder(v) - if err == nil { - values = append(values, value) - } - } - case *ast.AssignStmt: - for _, v := range decl.Rhs { - value, err := stringFinder(v) - if err == nil { - values = append(values, value) - } - } - } - } - return values -} - -// getIdentStringRecursive returns the string of values of an Ident if they can be resolved -// The difference between this and GetIdentStringValues is that it will attempt to resolve the strings recursively, -// if it is passed a *ast.BinaryExpr. See GetStringRecursive for details -func GetIdentStringValuesRecursive(ident *ast.Ident) []string { - return getIdentStringValues(ident, GetStringRecursive) -} - -// GetIdentStringValues return the string values of an Ident if they can be resolved -func GetIdentStringValues(ident *ast.Ident) []string { - return getIdentStringValues(ident, GetString) -} - -// GetBinaryExprOperands returns all operands of a binary expression by traversing -// the expression tree -func GetBinaryExprOperands(be *ast.BinaryExpr) []ast.Node { - var traverse func(be *ast.BinaryExpr) - result := []ast.Node{} - traverse = func(be *ast.BinaryExpr) { - if lhs, ok := be.X.(*ast.BinaryExpr); ok { - traverse(lhs) - } else { - result = append(result, be.X) - } - if rhs, ok := be.Y.(*ast.BinaryExpr); ok { - traverse(rhs) - } else { - result = append(result, be.Y) - } - } - traverse(be) - return result -} - -// GetImportedNames returns the name(s)/alias(es) used for the package within -// the code. It ignores initialization-only imports. -func GetImportedNames(path string, ctx *Context) (names []string, found bool) { - importNames, imported := ctx.Imports.Imported[path] - return importNames, imported -} - -// GetImportPath resolves the full import path of an identifier based on -// the imports in the current context(including aliases). -func GetImportPath(name string, ctx *Context) (string, bool) { - for path := range ctx.Imports.Imported { - if imported, ok := GetImportedNames(path, ctx); ok { - for _, n := range imported { - if n == name { - return path, true - } - } - } - } - - return "", false -} - -// GetLocation returns the filename and line number of an ast.Node -func GetLocation(n ast.Node, ctx *Context) (string, int) { - fobj := ctx.FileSet.File(n.Pos()) - return fobj.Name(), fobj.Line(n.Pos()) -} - -// Gopath returns all GOPATHs -func Gopath() []string { - defaultGoPath := runtime.GOROOT() - if u, err := user.Current(); err == nil { - defaultGoPath = filepath.Join(u.HomeDir, "go") - } - path := Getenv("GOPATH", defaultGoPath) - paths := strings.Split(path, string(os.PathListSeparator)) - for idx, path := range paths { - if abs, err := filepath.Abs(path); err == nil { - paths[idx] = abs - } - } - return paths -} - -// Getenv returns the values of the environment variable, otherwise -// returns the default if variable is not set -func Getenv(key, userDefault string) string { - if val := os.Getenv(key); val != "" { - return val - } - return userDefault -} - -// GetPkgRelativePath returns the Go relative path derived -// form the given path -func GetPkgRelativePath(path string) (string, error) { - abspath, err := filepath.Abs(path) - if err != nil { - abspath = path - } - if strings.HasSuffix(abspath, ".go") { - abspath = filepath.Dir(abspath) - } - for _, base := range Gopath() { - projectRoot := filepath.FromSlash(fmt.Sprintf("%s/src/", base)) - if strings.HasPrefix(abspath, projectRoot) { - return strings.TrimPrefix(abspath, projectRoot), nil - } - } - return "", errors.New("no project relative path found") -} - -// GetPkgAbsPath returns the Go package absolute path derived from -// the given path -func GetPkgAbsPath(pkgPath string) (string, error) { - absPath, err := filepath.Abs(pkgPath) - if err != nil { - return "", err - } - if _, err := os.Stat(absPath); os.IsNotExist(err) { - return "", errors.New("no project absolute path found") - } - return absPath, nil -} - -// ConcatString recursively concatenates strings from a binary expression -func ConcatString(n *ast.BinaryExpr) (string, bool) { - var s string - // sub expressions are found in X object, Y object is always last BasicLit - if rightOperand, ok := n.Y.(*ast.BasicLit); ok { - if str, err := GetString(rightOperand); err == nil { - s = str + s - } - } else { - return "", false - } - if leftOperand, ok := n.X.(*ast.BinaryExpr); ok { - if recursion, ok := ConcatString(leftOperand); ok { - s = recursion + s - } - } else if leftOperand, ok := n.X.(*ast.BasicLit); ok { - if str, err := GetString(leftOperand); err == nil { - s = str + s - } - } else { - return "", false - } - return s, true -} - -// FindVarIdentities returns array of all variable identities in a given binary expression -func FindVarIdentities(n *ast.BinaryExpr, c *Context) ([]*ast.Ident, bool) { - identities := []*ast.Ident{} - // sub expressions are found in X object, Y object is always the last term - if rightOperand, ok := n.Y.(*ast.Ident); ok { - obj := c.Info.ObjectOf(rightOperand) - if _, ok := obj.(*types.Var); ok && !TryResolve(rightOperand, c) { - identities = append(identities, rightOperand) - } - } - if leftOperand, ok := n.X.(*ast.BinaryExpr); ok { - if leftIdentities, ok := FindVarIdentities(leftOperand, c); ok { - identities = append(identities, leftIdentities...) - } - } else { - if leftOperand, ok := n.X.(*ast.Ident); ok { - obj := c.Info.ObjectOf(leftOperand) - if _, ok := obj.(*types.Var); ok && !TryResolve(leftOperand, c) { - identities = append(identities, leftOperand) - } - } - } - - if len(identities) > 0 { - return identities, true - } - // if nil or error, return false - return nil, false -} - -// PackagePaths returns a slice with all packages path at given root directory -func PackagePaths(root string, excludes []*regexp.Regexp) ([]string, error) { - if strings.HasSuffix(root, "...") { - root = root[0 : len(root)-3] - } else { - return []string{root}, nil - } - paths := map[string]bool{} - err := filepath.Walk(root, func(path string, f os.FileInfo, err error) error { - if filepath.Ext(path) == ".go" { - path = filepath.Dir(path) - if isExcluded(filepath.ToSlash(path), excludes) { - return nil - } - paths[path] = true - } - return nil - }) - if err != nil { - return []string{}, err - } - - result := []string{} - for path := range paths { - result = append(result, path) - } - return result, nil -} - -// isExcluded checks if a string matches any of the exclusion regexps -func isExcluded(str string, excludes []*regexp.Regexp) bool { - if excludes == nil { - return false - } - for _, exclude := range excludes { - if exclude != nil && exclude.MatchString(str) { - return true - } - } - return false -} - -// ExcludedDirsRegExp builds the regexps for a list of excluded dirs provided as strings -func ExcludedDirsRegExp(excludedDirs []string) []*regexp.Regexp { - var exps []*regexp.Regexp - for _, excludedDir := range excludedDirs { - str := fmt.Sprintf(`([\\/])?%s([\\/])?`, strings.ReplaceAll(filepath.ToSlash(excludedDir), "/", `\/`)) - r := regexp.MustCompile(str) - exps = append(exps, r) - } - return exps -} - -// RootPath returns the absolute root path of a scan -func RootPath(root string) (string, error) { - root = strings.TrimSuffix(root, "...") - return filepath.Abs(root) -} - -// GoVersion returns parsed version of Go from runtime -func GoVersion() (int, int, int) { - return parseGoVersion(runtime.Version()) -} - -// parseGoVersion parses Go version. -// example: -// - go1.19rc2 -// - go1.19beta2 -// - go1.19.4 -// - go1.19 -func parseGoVersion(version string) (int, int, int) { - exp := regexp.MustCompile(`go(\d+).(\d+)(?:.(\d+))?.*`) - parts := exp.FindStringSubmatch(version) - if len(parts) <= 1 { - return 0, 0, 0 - } - - major, _ := strconv.Atoi(parts[1]) - minor, _ := strconv.Atoi(parts[2]) - build, _ := strconv.Atoi(parts[3]) - - return major, minor, build -} diff --git a/vendor/github.com/securego/gosec/v2/import_tracker.go b/vendor/github.com/securego/gosec/v2/import_tracker.go deleted file mode 100644 index 7984e99f42..0000000000 --- a/vendor/github.com/securego/gosec/v2/import_tracker.go +++ /dev/null @@ -1,70 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gosec - -import ( - "go/ast" - "go/types" - "strings" -) - -// ImportTracker is used to normalize the packages that have been imported -// by a source file. It is able to differentiate between plain imports, aliased -// imports and init only imports. -type ImportTracker struct { - // Imported is a map of Imported with their associated names/aliases. - Imported map[string][]string -} - -// NewImportTracker creates an empty Import tracker instance -func NewImportTracker() *ImportTracker { - return &ImportTracker{ - Imported: make(map[string][]string), - } -} - -// TrackFile track all the imports used by the supplied file -func (t *ImportTracker) TrackFile(file *ast.File) { - for _, imp := range file.Imports { - t.TrackImport(imp) - } -} - -// TrackPackages tracks all the imports used by the supplied packages -func (t *ImportTracker) TrackPackages(pkgs ...*types.Package) { - for _, pkg := range pkgs { - t.Imported[pkg.Path()] = []string{pkg.Name()} - } -} - -// TrackImport tracks imports. -func (t *ImportTracker) TrackImport(imported *ast.ImportSpec) { - importPath := strings.Trim(imported.Path.Value, `"`) - if imported.Name != nil { - if imported.Name.Name != "_" { - // Aliased import - t.Imported[importPath] = append(t.Imported[importPath], imported.Name.String()) - } - } else { - t.Imported[importPath] = append(t.Imported[importPath], importName(importPath)) - } -} - -func importName(importPath string) string { - parts := strings.Split(importPath, "/") - name := importPath - if len(parts) > 0 { - name = parts[len(parts)-1] - } - return name -} diff --git a/vendor/github.com/securego/gosec/v2/install.sh b/vendor/github.com/securego/gosec/v2/install.sh deleted file mode 100644 index 2b6403cb25..0000000000 --- a/vendor/github.com/securego/gosec/v2/install.sh +++ /dev/null @@ -1,377 +0,0 @@ -#!/bin/sh -set -e -# Code generated by godownloader. DO NOT EDIT. -# - -usage() { - this=$1 - cat </dev/null -} -echoerr() { - echo "$@" 1>&2 -} -log_prefix() { - echo "$0" -} -_logp=6 -log_set_priority() { - _logp="$1" -} -log_priority() { - if test -z "$1"; then - echo "$_logp" - return - fi - [ "$1" -le "$_logp" ] -} -log_tag() { - case $1 in - 0) echo "emerg" ;; - 1) echo "alert" ;; - 2) echo "crit" ;; - 3) echo "err" ;; - 4) echo "warning" ;; - 5) echo "notice" ;; - 6) echo "info" ;; - 7) echo "debug" ;; - *) echo "$1" ;; - esac -} -log_debug() { - log_priority 7 || return 0 - echoerr "$(log_prefix)" "$(log_tag 7)" "$@" -} -log_info() { - log_priority 6 || return 0 - echoerr "$(log_prefix)" "$(log_tag 6)" "$@" -} -log_err() { - log_priority 3 || return 0 - echoerr "$(log_prefix)" "$(log_tag 3)" "$@" -} -log_crit() { - log_priority 2 || return 0 - echoerr "$(log_prefix)" "$(log_tag 2)" "$@" -} -uname_os() { - os=$(uname -s | tr '[:upper:]' '[:lower:]') - case "$os" in - cygwin_nt*) os="windows" ;; - mingw*) os="windows" ;; - msys_nt*) os="windows" ;; - esac - echo "$os" -} -uname_arch() { - arch=$(uname -m) - case $arch in - x86_64) arch="amd64" ;; - x86) arch="386" ;; - i686) arch="386" ;; - i386) arch="386" ;; - aarch64) arch="arm64" ;; - armv5*) arch="armv5" ;; - armv6*) arch="armv6" ;; - armv7*) arch="armv7" ;; - esac - echo ${arch} -} -uname_os_check() { - os=$(uname_os) - case "$os" in - darwin) return 0 ;; - dragonfly) return 0 ;; - freebsd) return 0 ;; - linux) return 0 ;; - android) return 0 ;; - nacl) return 0 ;; - netbsd) return 0 ;; - openbsd) return 0 ;; - plan9) return 0 ;; - solaris) return 0 ;; - windows) return 0 ;; - esac - log_crit "uname_os_check '$(uname -s)' got converted to '$os' which is not a GOOS value. Please file bug at https://github.com/client9/shlib" - return 1 -} -uname_arch_check() { - arch=$(uname_arch) - case "$arch" in - 386) return 0 ;; - amd64) return 0 ;; - arm64) return 0 ;; - armv5) return 0 ;; - armv6) return 0 ;; - armv7) return 0 ;; - ppc64) return 0 ;; - ppc64le) return 0 ;; - mips) return 0 ;; - mipsle) return 0 ;; - mips64) return 0 ;; - mips64le) return 0 ;; - s390x) return 0 ;; - amd64p32) return 0 ;; - esac - log_crit "uname_arch_check '$(uname -m)' got converted to '$arch' which is not a GOARCH value. Please file bug report at https://github.com/client9/shlib" - return 1 -} -untar() { - tarball=$1 - case "${tarball}" in - *.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" ;; - *.tar) tar --no-same-owner -xf "${tarball}" ;; - *.zip) unzip "${tarball}" ;; - *) - log_err "untar unknown archive format for ${tarball}" - return 1 - ;; - esac -} -http_download_curl() { - local_file=$1 - source_url=$2 - header=$3 - if [ -z "$header" ]; then - code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url") - else - code=$(curl -w '%{http_code}' -sL -H "$header" -o "$local_file" "$source_url") - fi - if [ "$code" != "200" ]; then - log_debug "http_download_curl received HTTP status $code" - return 1 - fi - return 0 -} -http_download_wget() { - local_file=$1 - source_url=$2 - header=$3 - if [ -z "$header" ]; then - wget -q -O "$local_file" "$source_url" - else - wget -q --header "$header" -O "$local_file" "$source_url" - fi -} -http_download() { - log_debug "http_download $2" - if is_command curl; then - http_download_curl "$@" - return - elif is_command wget; then - http_download_wget "$@" - return - fi - log_crit "http_download unable to find wget or curl" - return 1 -} -http_copy() { - tmp=$(mktemp) - http_download "${tmp}" "$1" "$2" || return 1 - body=$(cat "$tmp") - rm -f "${tmp}" - echo "$body" -} -github_release() { - owner_repo=$1 - version=$2 - giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}" - if [ -z "${version}" ]; then - giturl="https://api.github.com/repos/${owner_repo}/releases/latest" - fi - json=$(http_copy "$giturl" "Accept:application/json") - test -z "$json" && return 1 - version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//') - test -z "$version" && return 1 - echo "$version" -} -hash_sha256() { - TARGET=${1:-/dev/stdin} - if is_command gsha256sum; then - hash=$(gsha256sum "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command sha256sum; then - hash=$(sha256sum "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command shasum; then - hash=$(shasum -a 256 "$TARGET" 2>/dev/null) || return 1 - echo "$hash" | cut -d ' ' -f 1 - elif is_command openssl; then - hash=$(openssl -dst openssl dgst -sha256 "$TARGET") || return 1 - echo "$hash" | cut -d ' ' -f a - else - log_crit "hash_sha256 unable to find command to compute sha-256 hash" - return 1 - fi -} -hash_sha256_verify() { - TARGET=$1 - checksums=$2 - if [ -z "$checksums" ]; then - log_err "hash_sha256_verify checksum file not specified in arg2" - return 1 - fi - BASENAME=${TARGET##*/} - want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1) - if [ -z "$want" ]; then - log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'" - return 1 - fi - got=$(hash_sha256 "$TARGET") - if [ "$want" != "$got" ]; then - log_err "hash_sha256_verify checksum for '$TARGET' did not verify ${want} vs $got" - return 1 - fi -} -cat /dev/null < end { - break - } else if pos >= start && pos <= end { - code := fmt.Sprintf("%d: %s\n", pos, scanner.Text()) - buf.WriteString(code) - } - } - return buf.String(), nil -} - -func codeSnippetStartLine(node ast.Node, fobj *token.File) int64 { - s := (int64)(fobj.Line(node.Pos())) - if s-SnippetOffset > 0 { - return s - SnippetOffset - } - return s -} - -func codeSnippetEndLine(node ast.Node, fobj *token.File) int64 { - e := (int64)(fobj.Line(node.End())) - return e + SnippetOffset -} - -// New creates a new Issue -func New(fobj *token.File, node ast.Node, ruleID, desc string, severity, confidence Score) *Issue { - name := fobj.Name() - line := GetLine(fobj, node) - col := strconv.Itoa(fobj.Position(node.Pos()).Column) - - var code string - if node == nil { - code = "invalid AST node provided" - } - if file, err := os.Open(fobj.Name()); err == nil && node != nil { - defer file.Close() // #nosec - s := codeSnippetStartLine(node, fobj) - e := codeSnippetEndLine(node, fobj) - code, err = CodeSnippet(file, s, e) - if err != nil { - code = err.Error() - } - } - - return &Issue{ - File: name, - Line: line, - Col: col, - RuleID: ruleID, - What: desc, - Confidence: confidence, - Severity: severity, - Code: code, - Cwe: GetCweByRule(ruleID), - } -} - -// WithSuppressions set the suppressions of the issue -func (i *Issue) WithSuppressions(suppressions []SuppressionInfo) *Issue { - i.Suppressions = suppressions - return i -} - -// GetLine returns the line number of a given ast.Node -func GetLine(fobj *token.File, node ast.Node) string { - start, end := fobj.Line(node.Pos()), fobj.Line(node.End()) - line := strconv.Itoa(start) - if start != end { - line = fmt.Sprintf("%d-%d", start, end) - } - return line -} diff --git a/vendor/github.com/securego/gosec/v2/renovate.json b/vendor/github.com/securego/gosec/v2/renovate.json deleted file mode 100644 index 58ee1e0ea8..0000000000 --- a/vendor/github.com/securego/gosec/v2/renovate.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "dependencyDashboard": true, - "dependencyDashboardTitle" : "Renovate(bot) : dependency dashboard", - "vulnerabilityAlerts": { - "enabled": true - }, - "extends": [ - ":preserveSemverRanges", - "group:all", - "schedule:weekly" - ], - "lockFileMaintenance": { - "commitMessageAction": "Update", - "enabled": true, - "extends": [ - "group:all", - "schedule:weekly" - ] - }, - "postUpdateOptions": [ - "gomodTidy", - "gomodUpdateImportPaths" - ], - "separateMajorMinor": false -} diff --git a/vendor/github.com/securego/gosec/v2/report.go b/vendor/github.com/securego/gosec/v2/report.go deleted file mode 100644 index 4fdeea5206..0000000000 --- a/vendor/github.com/securego/gosec/v2/report.go +++ /dev/null @@ -1,28 +0,0 @@ -package gosec - -import ( - "github.com/securego/gosec/v2/issue" -) - -// ReportInfo this is report information -type ReportInfo struct { - Errors map[string][]Error `json:"Golang errors"` - Issues []*issue.Issue - Stats *Metrics - GosecVersion string -} - -// NewReportInfo instantiate a ReportInfo -func NewReportInfo(issues []*issue.Issue, metrics *Metrics, errors map[string][]Error) *ReportInfo { - return &ReportInfo{ - Errors: errors, - Issues: issues, - Stats: metrics, - } -} - -// WithVersion defines the version of gosec used to generate the report -func (r *ReportInfo) WithVersion(version string) *ReportInfo { - r.GosecVersion = version - return r -} diff --git a/vendor/github.com/securego/gosec/v2/resolve.go b/vendor/github.com/securego/gosec/v2/resolve.go deleted file mode 100644 index a201b8d32b..0000000000 --- a/vendor/github.com/securego/gosec/v2/resolve.go +++ /dev/null @@ -1,95 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gosec - -import "go/ast" - -func resolveIdent(n *ast.Ident, c *Context) bool { - if n.Obj == nil || n.Obj.Kind != ast.Var { - return true - } - if node, ok := n.Obj.Decl.(ast.Node); ok { - return TryResolve(node, c) - } - return false -} - -func resolveValueSpec(n *ast.ValueSpec, c *Context) bool { - if len(n.Values) == 0 { - return false - } - for _, value := range n.Values { - if !TryResolve(value, c) { - return false - } - } - return true -} - -func resolveAssign(n *ast.AssignStmt, c *Context) bool { - if len(n.Rhs) == 0 { - return false - } - for _, arg := range n.Rhs { - if !TryResolve(arg, c) { - return false - } - } - return true -} - -func resolveCompLit(n *ast.CompositeLit, c *Context) bool { - if len(n.Elts) == 0 { - return false - } - for _, arg := range n.Elts { - if !TryResolve(arg, c) { - return false - } - } - return true -} - -func resolveBinExpr(n *ast.BinaryExpr, c *Context) bool { - return (TryResolve(n.X, c) && TryResolve(n.Y, c)) -} - -func resolveCallExpr(_ *ast.CallExpr, _ *Context) bool { - // TODO(tkelsey): next step, full function resolution - return false -} - -// TryResolve will attempt, given a subtree starting at some AST node, to resolve -// all values contained within to a known constant. It is used to check for any -// unknown values in compound expressions. -func TryResolve(n ast.Node, c *Context) bool { - switch node := n.(type) { - case *ast.BasicLit: - return true - case *ast.CompositeLit: - return resolveCompLit(node, c) - case *ast.Ident: - return resolveIdent(node, c) - case *ast.ValueSpec: - return resolveValueSpec(node, c) - case *ast.AssignStmt: - return resolveAssign(node, c) - case *ast.CallExpr: - return resolveCallExpr(node, c) - case *ast.BinaryExpr: - return resolveBinExpr(node, c) - } - return false -} diff --git a/vendor/github.com/securego/gosec/v2/rule.go b/vendor/github.com/securego/gosec/v2/rule.go deleted file mode 100644 index 490a25da02..0000000000 --- a/vendor/github.com/securego/gosec/v2/rule.go +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package gosec - -import ( - "go/ast" - "reflect" - - "github.com/securego/gosec/v2/issue" -) - -// The Rule interface used by all rules supported by gosec. -type Rule interface { - ID() string - Match(ast.Node, *Context) (*issue.Issue, error) -} - -// RuleBuilder is used to register a rule definition with the analyzer -type RuleBuilder func(id string, c Config) (Rule, []ast.Node) - -// A RuleSet contains a mapping of lists of rules to the type of AST node they -// should be run on and a mapping of rule ID's to whether the rule are -// suppressed. -// The analyzer will only invoke rules contained in the list associated with the -// type of AST node it is currently visiting. -type RuleSet struct { - Rules map[reflect.Type][]Rule - RuleSuppressedMap map[string]bool -} - -// NewRuleSet constructs a new RuleSet -func NewRuleSet() RuleSet { - return RuleSet{make(map[reflect.Type][]Rule), make(map[string]bool)} -} - -// Register adds a trigger for the supplied rule for the -// specified ast nodes. -func (r RuleSet) Register(rule Rule, isSuppressed bool, nodes ...ast.Node) { - for _, n := range nodes { - t := reflect.TypeOf(n) - if rules, ok := r.Rules[t]; ok { - r.Rules[t] = append(rules, rule) - } else { - r.Rules[t] = []Rule{rule} - } - } - r.RuleSuppressedMap[rule.ID()] = isSuppressed -} - -// RegisteredFor will return all rules that are registered for a -// specified ast node. -func (r RuleSet) RegisteredFor(n ast.Node) []Rule { - if rules, found := r.Rules[reflect.TypeOf(n)]; found { - return rules - } - return []Rule{} -} - -// IsRuleSuppressed will return whether the rule is suppressed. -func (r RuleSet) IsRuleSuppressed(ruleID string) bool { - return r.RuleSuppressedMap[ruleID] -} diff --git a/vendor/github.com/securego/gosec/v2/rules/archive.go b/vendor/github.com/securego/gosec/v2/rules/archive.go deleted file mode 100644 index 987047435b..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/archive.go +++ /dev/null @@ -1,66 +0,0 @@ -package rules - -import ( - "go/ast" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type archive struct { - issue.MetaData - calls gosec.CallList - argTypes []string -} - -func (a *archive) ID() string { - return a.MetaData.ID -} - -// Match inspects AST nodes to determine if the filepath.Joins uses any argument derived from type zip.File or tar.Header -func (a *archive) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node := a.calls.ContainsPkgCallExpr(n, c, false); node != nil { - for _, arg := range node.Args { - var argType types.Type - if selector, ok := arg.(*ast.SelectorExpr); ok { - argType = c.Info.TypeOf(selector.X) - } else if ident, ok := arg.(*ast.Ident); ok { - if ident.Obj != nil && ident.Obj.Kind == ast.Var { - decl := ident.Obj.Decl - if assign, ok := decl.(*ast.AssignStmt); ok { - if selector, ok := assign.Rhs[0].(*ast.SelectorExpr); ok { - argType = c.Info.TypeOf(selector.X) - } - } - } - } - - if argType != nil { - for _, t := range a.argTypes { - if argType.String() == t { - return c.NewIssue(n, a.ID(), a.What, a.Severity, a.Confidence), nil - } - } - } - } - } - return nil, nil -} - -// NewArchive creates a new rule which detects the file traversal when extracting zip/tar archives -func NewArchive(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("path/filepath", "Join") - calls.Add("path", "Join") - return &archive{ - calls: calls, - argTypes: []string{"*archive/zip.File", "*archive/tar.Header"}, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "File traversal when extracting zip/tar archive", - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/bind.go b/vendor/github.com/securego/gosec/v2/rules/bind.go deleted file mode 100644 index fef760c808..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/bind.go +++ /dev/null @@ -1,84 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "regexp" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -// Looks for net.Listen("0.0.0.0") or net.Listen(":8080") -type bindsToAllNetworkInterfaces struct { - issue.MetaData - calls gosec.CallList - pattern *regexp.Regexp -} - -func (r *bindsToAllNetworkInterfaces) ID() string { - return r.MetaData.ID -} - -func (r *bindsToAllNetworkInterfaces) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - callExpr := r.calls.ContainsPkgCallExpr(n, c, false) - if callExpr == nil { - return nil, nil - } - if len(callExpr.Args) > 1 { - arg := callExpr.Args[1] - if bl, ok := arg.(*ast.BasicLit); ok { - if arg, err := gosec.GetString(bl); err == nil { - if r.pattern.MatchString(arg) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } else if ident, ok := arg.(*ast.Ident); ok { - values := gosec.GetIdentStringValues(ident) - for _, value := range values { - if r.pattern.MatchString(value) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } else if len(callExpr.Args) > 0 { - values := gosec.GetCallStringArgsValues(callExpr.Args[0], c) - for _, value := range values { - if r.pattern.MatchString(value) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - return nil, nil -} - -// NewBindsToAllNetworkInterfaces detects socket connections that are setup to -// listen on all network interfaces. -func NewBindsToAllNetworkInterfaces(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("net", "Listen") - calls.Add("crypto/tls", "Listen") - return &bindsToAllNetworkInterfaces{ - calls: calls, - pattern: regexp.MustCompile(`^(0.0.0.0|:).*$`), - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "Binds to all network interfaces", - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/blocklist.go b/vendor/github.com/securego/gosec/v2/rules/blocklist.go deleted file mode 100644 index 5e03cf7a0c..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/blocklist.go +++ /dev/null @@ -1,95 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "strings" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type blocklistedImport struct { - issue.MetaData - Blocklisted map[string]string -} - -func unquote(original string) string { - cleaned := strings.TrimSpace(original) - cleaned = strings.TrimLeft(cleaned, `"`) - return strings.TrimRight(cleaned, `"`) -} - -func (r *blocklistedImport) ID() string { - return r.MetaData.ID -} - -func (r *blocklistedImport) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node, ok := n.(*ast.ImportSpec); ok { - if description, ok := r.Blocklisted[unquote(node.Path.Value)]; ok { - return c.NewIssue(node, r.ID(), description, r.Severity, r.Confidence), nil - } - } - return nil, nil -} - -// NewBlocklistedImports reports when a blocklisted import is being used. -// Typically when a deprecated technology is being used. -func NewBlocklistedImports(id string, _ gosec.Config, blocklist map[string]string) (gosec.Rule, []ast.Node) { - return &blocklistedImport{ - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - }, - Blocklisted: blocklist, - }, []ast.Node{(*ast.ImportSpec)(nil)} -} - -// NewBlocklistedImportMD5 fails if MD5 is imported -func NewBlocklistedImportMD5(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - return NewBlocklistedImports(id, conf, map[string]string{ - "crypto/md5": "Blocklisted import crypto/md5: weak cryptographic primitive", - }) -} - -// NewBlocklistedImportDES fails if DES is imported -func NewBlocklistedImportDES(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - return NewBlocklistedImports(id, conf, map[string]string{ - "crypto/des": "Blocklisted import crypto/des: weak cryptographic primitive", - }) -} - -// NewBlocklistedImportRC4 fails if DES is imported -func NewBlocklistedImportRC4(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - return NewBlocklistedImports(id, conf, map[string]string{ - "crypto/rc4": "Blocklisted import crypto/rc4: weak cryptographic primitive", - }) -} - -// NewBlocklistedImportCGI fails if CGI is imported -func NewBlocklistedImportCGI(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - return NewBlocklistedImports(id, conf, map[string]string{ - "net/http/cgi": "Blocklisted import net/http/cgi: Go versions < 1.6.3 are vulnerable to Httpoxy attack: (CVE-2016-5386)", - }) -} - -// NewBlocklistedImportSHA1 fails if SHA1 is imported -func NewBlocklistedImportSHA1(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - return NewBlocklistedImports(id, conf, map[string]string{ - "crypto/sha1": "Blocklisted import crypto/sha1: weak cryptographic primitive", - }) -} diff --git a/vendor/github.com/securego/gosec/v2/rules/decompression-bomb.go b/vendor/github.com/securego/gosec/v2/rules/decompression-bomb.go deleted file mode 100644 index 7e57f1a5b1..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/decompression-bomb.go +++ /dev/null @@ -1,111 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type decompressionBombCheck struct { - issue.MetaData - readerCalls gosec.CallList - copyCalls gosec.CallList -} - -func (d *decompressionBombCheck) ID() string { - return d.MetaData.ID -} - -func containsReaderCall(node ast.Node, ctx *gosec.Context, list gosec.CallList) bool { - if list.ContainsPkgCallExpr(node, ctx, false) != nil { - return true - } - // Resolve type info of ident (for *archive/zip.File.Open) - s, idt, _ := gosec.GetCallInfo(node, ctx) - return list.Contains(s, idt) -} - -func (d *decompressionBombCheck) Match(node ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - var readerVarObj map[*ast.Object]struct{} - - // To check multiple lines, ctx.PassedValues is used to store temporary data. - if _, ok := ctx.PassedValues[d.ID()]; !ok { - readerVarObj = make(map[*ast.Object]struct{}) - ctx.PassedValues[d.ID()] = readerVarObj - } else if pv, ok := ctx.PassedValues[d.ID()].(map[*ast.Object]struct{}); ok { - readerVarObj = pv - } else { - return nil, fmt.Errorf("PassedValues[%s] of Context is not map[*ast.Object]struct{}, but %T", d.ID(), ctx.PassedValues[d.ID()]) - } - - // io.Copy is a common function. - // To reduce false positives, This rule detects code which is used for compressed data only. - switch n := node.(type) { - case *ast.AssignStmt: - for _, expr := range n.Rhs { - if callExpr, ok := expr.(*ast.CallExpr); ok && containsReaderCall(callExpr, ctx, d.readerCalls) { - if idt, ok := n.Lhs[0].(*ast.Ident); ok && idt.Name != "_" { - // Example: - // r, _ := zlib.NewReader(buf) - // Add r's Obj to readerVarObj map - readerVarObj[idt.Obj] = struct{}{} - } - } - } - case *ast.CallExpr: - if d.copyCalls.ContainsPkgCallExpr(n, ctx, false) != nil { - if idt, ok := n.Args[1].(*ast.Ident); ok { - if _, ok := readerVarObj[idt.Obj]; ok { - // Detect io.Copy(x, r) - return ctx.NewIssue(n, d.ID(), d.What, d.Severity, d.Confidence), nil - } - } - } - } - - return nil, nil -} - -// NewDecompressionBombCheck detects if there is potential DoS vulnerability via decompression bomb -func NewDecompressionBombCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - readerCalls := gosec.NewCallList() - readerCalls.Add("compress/gzip", "NewReader") - readerCalls.AddAll("compress/zlib", "NewReader", "NewReaderDict") - readerCalls.Add("compress/bzip2", "NewReader") - readerCalls.AddAll("compress/flate", "NewReader", "NewReaderDict") - readerCalls.Add("compress/lzw", "NewReader") - readerCalls.Add("archive/tar", "NewReader") - readerCalls.Add("archive/zip", "NewReader") - readerCalls.Add("*archive/zip.File", "Open") - - copyCalls := gosec.NewCallList() - copyCalls.Add("io", "Copy") - copyCalls.Add("io", "CopyBuffer") - - return &decompressionBombCheck{ - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.Medium, - What: "Potential DoS vulnerability via decompression bomb", - }, - readerCalls: readerCalls, - copyCalls: copyCalls, - }, []ast.Node{(*ast.FuncDecl)(nil), (*ast.AssignStmt)(nil), (*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/directory-traversal.go b/vendor/github.com/securego/gosec/v2/rules/directory-traversal.go deleted file mode 100644 index 47bcb2dc4a..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/directory-traversal.go +++ /dev/null @@ -1,65 +0,0 @@ -package rules - -import ( - "go/ast" - "regexp" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type traversal struct { - pattern *regexp.Regexp - issue.MetaData -} - -func (r *traversal) ID() string { - return r.MetaData.ID -} - -func (r *traversal) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch node := n.(type) { - case *ast.CallExpr: - return r.matchCallExpr(node, ctx) - } - return nil, nil -} - -func (r *traversal) matchCallExpr(assign *ast.CallExpr, ctx *gosec.Context) (*issue.Issue, error) { - for _, i := range assign.Args { - if basiclit, ok1 := i.(*ast.BasicLit); ok1 { - if fun, ok2 := assign.Fun.(*ast.SelectorExpr); ok2 { - if x, ok3 := fun.X.(*ast.Ident); ok3 { - str := x.Name + "." + fun.Sel.Name + "(" + basiclit.Value + ")" - if r.pattern.MatchString(str) { - return ctx.NewIssue(assign, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } - } - return nil, nil -} - -// NewDirectoryTraversal attempts to find the use of http.Dir("/") -func NewDirectoryTraversal(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - pattern := `http\.Dir\("\/"\)|http\.Dir\('\/'\)` - if val, ok := conf[id]; ok { - conf := val.(map[string]interface{}) - if configPattern, ok := conf["pattern"]; ok { - if cfgPattern, ok := configPattern.(string); ok { - pattern = cfgPattern - } - } - } - - return &traversal{ - pattern: regexp.MustCompile(pattern), - MetaData: issue.MetaData{ - ID: id, - What: "Potential directory traversal", - Confidence: issue.Medium, - Severity: issue.Medium, - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/errors.go b/vendor/github.com/securego/gosec/v2/rules/errors.go deleted file mode 100644 index d31248ccb4..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/errors.go +++ /dev/null @@ -1,122 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type noErrorCheck struct { - issue.MetaData - whitelist gosec.CallList -} - -func (r *noErrorCheck) ID() string { - return r.MetaData.ID -} - -func returnsError(callExpr *ast.CallExpr, ctx *gosec.Context) int { - if tv := ctx.Info.TypeOf(callExpr); tv != nil { - switch t := tv.(type) { - case *types.Tuple: - for pos := 0; pos < t.Len(); pos++ { - variable := t.At(pos) - if variable != nil && variable.Type().String() == "error" { - return pos - } - } - case *types.Named: - if t.String() == "error" { - return 0 - } - } - } - return -1 -} - -func (r *noErrorCheck) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch stmt := n.(type) { - case *ast.AssignStmt: - cfg := ctx.Config - if enabled, err := cfg.IsGlobalEnabled(gosec.Audit); err == nil && enabled { - for _, expr := range stmt.Rhs { - if callExpr, ok := expr.(*ast.CallExpr); ok && r.whitelist.ContainsCallExpr(expr, ctx) == nil { - pos := returnsError(callExpr, ctx) - if pos < 0 || pos >= len(stmt.Lhs) { - return nil, nil - } - if id, ok := stmt.Lhs[pos].(*ast.Ident); ok && id.Name == "_" { - return ctx.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } - case *ast.ExprStmt: - if callExpr, ok := stmt.X.(*ast.CallExpr); ok && r.whitelist.ContainsCallExpr(stmt.X, ctx) == nil { - pos := returnsError(callExpr, ctx) - if pos >= 0 { - return ctx.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - return nil, nil -} - -// NewNoErrorCheck detects if the returned error is unchecked -func NewNoErrorCheck(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - // TODO(gm) Come up with sensible defaults here. Or flip it to use a - // black list instead. - whitelist := gosec.NewCallList() - whitelist.AddAll("bytes.Buffer", "Write", "WriteByte", "WriteRune", "WriteString") - whitelist.AddAll("fmt", "Print", "Printf", "Println", "Fprint", "Fprintf", "Fprintln") - whitelist.AddAll("strings.Builder", "Write", "WriteByte", "WriteRune", "WriteString") - whitelist.Add("io.PipeWriter", "CloseWithError") - whitelist.Add("hash.Hash", "Write") - whitelist.Add("os", "Unsetenv") - - if configured, ok := conf[id]; ok { - if whitelisted, ok := configured.(map[string]interface{}); ok { - for pkg, funcs := range whitelisted { - if funcs, ok := funcs.([]interface{}); ok { - whitelist.AddAll(pkg, toStringSlice(funcs)...) - } - } - } - } - - return &noErrorCheck{ - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Low, - Confidence: issue.High, - What: "Errors unhandled.", - }, - whitelist: whitelist, - }, []ast.Node{(*ast.AssignStmt)(nil), (*ast.ExprStmt)(nil)} -} - -func toStringSlice(values []interface{}) []string { - result := []string{} - for _, value := range values { - if value, ok := value.(string); ok { - result = append(result, value) - } - } - return result -} diff --git a/vendor/github.com/securego/gosec/v2/rules/fileperms.go b/vendor/github.com/securego/gosec/v2/rules/fileperms.go deleted file mode 100644 index 5311f74c6c..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/fileperms.go +++ /dev/null @@ -1,164 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - "strconv" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type filePermissions struct { - issue.MetaData - mode int64 - pkgs []string - calls []string -} - -// ID returns the ID of the rule. -func (r *filePermissions) ID() string { - return r.MetaData.ID -} - -func getConfiguredMode(conf map[string]interface{}, configKey string, defaultMode int64) int64 { - mode := defaultMode - if value, ok := conf[configKey]; ok { - switch value := value.(type) { - case int64: - mode = value - case string: - if m, e := strconv.ParseInt(value, 0, 64); e != nil { - mode = defaultMode - } else { - mode = m - } - } - } - return mode -} - -func modeIsSubset(subset int64, superset int64) bool { - return (subset | superset) == superset -} - -// Match checks if the rule is matched. -func (r *filePermissions) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - for _, pkg := range r.pkgs { - if callexpr, matched := gosec.MatchCallByPackage(n, c, pkg, r.calls...); matched { - modeArg := callexpr.Args[len(callexpr.Args)-1] - if mode, err := gosec.GetInt(modeArg); err == nil && !modeIsSubset(mode, r.mode) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - return nil, nil -} - -// NewWritePerms creates a rule to detect file Writes with bad permissions. -func NewWritePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - mode := getConfiguredMode(conf, id, 0o600) - return &filePermissions{ - mode: mode, - pkgs: []string{"io/ioutil", "os"}, - calls: []string{"WriteFile"}, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: fmt.Sprintf("Expect WriteFile permissions to be %#o or less", mode), - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} - -// NewFilePerms creates a rule to detect file creation with a more permissive than configured -// permission mask. -func NewFilePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - mode := getConfiguredMode(conf, id, 0o600) - return &filePermissions{ - mode: mode, - pkgs: []string{"os"}, - calls: []string{"OpenFile", "Chmod"}, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: fmt.Sprintf("Expect file permissions to be %#o or less", mode), - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} - -// NewMkdirPerms creates a rule to detect directory creation with more permissive than -// configured permission mask. -func NewMkdirPerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - mode := getConfiguredMode(conf, id, 0o750) - return &filePermissions{ - mode: mode, - pkgs: []string{"os"}, - calls: []string{"Mkdir", "MkdirAll"}, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: fmt.Sprintf("Expect directory permissions to be %#o or less", mode), - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} - -type osCreatePermissions struct { - issue.MetaData - mode int64 - pkgs []string - calls []string -} - -const defaultOsCreateMode = 0o666 - -// ID returns the ID of the rule. -func (r *osCreatePermissions) ID() string { - return r.MetaData.ID -} - -// Match checks if the rule is matched. -func (r *osCreatePermissions) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - for _, pkg := range r.pkgs { - if _, matched := gosec.MatchCallByPackage(n, c, pkg, r.calls...); matched { - if !modeIsSubset(defaultOsCreateMode, r.mode) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - return nil, nil -} - -// NewOsCreatePerms reates a rule to detect file creation with a more permissive than configured -// permission mask. -func NewOsCreatePerms(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - mode := getConfiguredMode(conf, id, 0o666) - return &osCreatePermissions{ - mode: mode, - pkgs: []string{"os"}, - calls: []string{"Create"}, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: fmt.Sprintf("Expect file permissions to be %#o or less but os.Create used with default permissions %#o", - mode, defaultOsCreateMode), - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/hardcoded_credentials.go b/vendor/github.com/securego/gosec/v2/rules/hardcoded_credentials.go deleted file mode 100644 index ed1fb947d1..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/hardcoded_credentials.go +++ /dev/null @@ -1,398 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - "go/token" - "regexp" - "strconv" - - zxcvbn "github.com/ccojocar/zxcvbn-go" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type secretPattern struct { - name string - regexp *regexp.Regexp -} - -var secretsPatterns = [...]secretPattern{ - { - name: "RSA private key", - regexp: regexp.MustCompile(`-----BEGIN RSA PRIVATE KEY-----`), - }, - { - name: "SSH (DSA) private key", - regexp: regexp.MustCompile(`-----BEGIN DSA PRIVATE KEY-----`), - }, - { - name: "SSH (EC) private key", - regexp: regexp.MustCompile(`-----BEGIN EC PRIVATE KEY-----`), - }, - { - name: "PGP private key block", - regexp: regexp.MustCompile(`-----BEGIN PGP PRIVATE KEY BLOCK-----`), - }, - { - name: "Slack Token", - regexp: regexp.MustCompile(`xox[pborsa]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32}`), - }, - { - name: "AWS API Key", - regexp: regexp.MustCompile(`AKIA[0-9A-Z]{16}`), - }, - { - name: "Amazon MWS Auth Token", - regexp: regexp.MustCompile(`amzn\.mws\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`), - }, - { - name: "AWS AppSync GraphQL Key", - regexp: regexp.MustCompile(`da2-[a-z0-9]{26}`), - }, - { - name: "GitHub personal access token", - regexp: regexp.MustCompile(`ghp_[a-zA-Z0-9]{36}`), - }, - { - name: "GitHub fine-grained access token", - regexp: regexp.MustCompile(`github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}`), - }, - { - name: "GitHub action temporary token", - regexp: regexp.MustCompile(`ghs_[a-zA-Z0-9]{36}`), - }, - { - name: "Google API Key", - regexp: regexp.MustCompile(`AIza[0-9A-Za-z\-_]{35}`), - }, - { - name: "Google Cloud Platform API Key", - regexp: regexp.MustCompile(`AIza[0-9A-Za-z\-_]{35}`), - }, - { - name: "Google Cloud Platform OAuth", - regexp: regexp.MustCompile(`[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com`), - }, - { - name: "Google Drive API Key", - regexp: regexp.MustCompile(`AIza[0-9A-Za-z\-_]{35}`), - }, - { - name: "Google Drive OAuth", - regexp: regexp.MustCompile(`[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com`), - }, - { - name: "Google (GCP) Service-account", - regexp: regexp.MustCompile(`"type": "service_account"`), - }, - { - name: "Google Gmail API Key", - regexp: regexp.MustCompile(`AIza[0-9A-Za-z\-_]{35}`), - }, - { - name: "Google Gmail OAuth", - regexp: regexp.MustCompile(`[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com`), - }, - { - name: "Google OAuth Access Token", - regexp: regexp.MustCompile(`ya29\.[0-9A-Za-z\-_]+`), - }, - { - name: "Google YouTube API Key", - regexp: regexp.MustCompile(`AIza[0-9A-Za-z\-_]{35}`), - }, - { - name: "Google YouTube OAuth", - regexp: regexp.MustCompile(`[0-9]+-[0-9A-Za-z_]{32}\.apps\.googleusercontent\.com`), - }, - { - name: "Generic API Key", - regexp: regexp.MustCompile(`[aA][pP][iI]_?[kK][eE][yY].*[''|"][0-9a-zA-Z]{32,45}[''|"]`), - }, - { - name: "Generic Secret", - regexp: regexp.MustCompile(`[sS][eE][cC][rR][eE][tT].*[''|"][0-9a-zA-Z]{32,45}[''|"]`), - }, - { - name: "Heroku API Key", - regexp: regexp.MustCompile(`[hH][eE][rR][oO][kK][uU].*[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}`), - }, - { - name: "MailChimp API Key", - regexp: regexp.MustCompile(`[0-9a-f]{32}-us[0-9]{1,2}`), - }, - { - name: "Mailgun API Key", - regexp: regexp.MustCompile(`key-[0-9a-zA-Z]{32}`), - }, - { - name: "Password in URL", - regexp: regexp.MustCompile(`[a-zA-Z]{3,10}://[^/\\s:@]{3,20}:[^/\\s:@]{3,20}@.{1,100}["'\\s]`), - }, - { - name: "Slack Webhook", - regexp: regexp.MustCompile(`https://hooks\.slack\.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}`), - }, - { - name: "Stripe API Key", - regexp: regexp.MustCompile(`sk_live_[0-9a-zA-Z]{24}`), - }, - { - name: "Stripe API Key", - regexp: regexp.MustCompile(`sk_live_[0-9a-zA-Z]{24}`), - }, - { - name: "Stripe Restricted API Key", - regexp: regexp.MustCompile(`rk_live_[0-9a-zA-Z]{24}`), - }, - { - name: "Square Access Token", - regexp: regexp.MustCompile(`sq0atp-[0-9A-Za-z\-_]{22}`), - }, - { - name: "Square OAuth Secret", - regexp: regexp.MustCompile(`sq0csp-[0-9A-Za-z\-_]{43}`), - }, - { - name: "Telegram Bot API Key", - regexp: regexp.MustCompile(`[0-9]+:AA[0-9A-Za-z\-_]{33}`), - }, - { - name: "Twilio API Key", - regexp: regexp.MustCompile(`SK[0-9a-fA-F]{32}`), - }, - { - name: "Twitter Access Token", - regexp: regexp.MustCompile(`[tT][wW][iI][tT][tT][eE][rR].*[1-9][0-9]+-[0-9a-zA-Z]{40}`), - }, - { - name: "Twitter OAuth", - regexp: regexp.MustCompile(`[tT][wW][iI][tT][tT][eE][rR].*[''|"][0-9a-zA-Z]{35,44}[''|"]`), - }, -} - -type credentials struct { - issue.MetaData - pattern *regexp.Regexp - entropyThreshold float64 - perCharThreshold float64 - truncate int - ignoreEntropy bool -} - -func (r *credentials) ID() string { - return r.MetaData.ID -} - -func truncate(s string, n int) string { - if n > len(s) { - return s - } - return s[:n] -} - -func (r *credentials) isHighEntropyString(str string) bool { - s := truncate(str, r.truncate) - info := zxcvbn.PasswordStrength(s, []string{}) - entropyPerChar := info.Entropy / float64(len(s)) - return (info.Entropy >= r.entropyThreshold || - (info.Entropy >= (r.entropyThreshold/2) && - entropyPerChar >= r.perCharThreshold)) -} - -func (r *credentials) isSecretPattern(str string) (bool, string) { - for _, pattern := range secretsPatterns { - if pattern.regexp.MatchString(str) { - return true, pattern.name - } - } - return false, "" -} - -func (r *credentials) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch node := n.(type) { - case *ast.AssignStmt: - return r.matchAssign(node, ctx) - case *ast.ValueSpec: - return r.matchValueSpec(node, ctx) - case *ast.BinaryExpr: - return r.matchEqualityCheck(node, ctx) - } - return nil, nil -} - -func (r *credentials) matchAssign(assign *ast.AssignStmt, ctx *gosec.Context) (*issue.Issue, error) { - for _, i := range assign.Lhs { - if ident, ok := i.(*ast.Ident); ok { - // First check LHS to find anything being assigned to variables whose name appears to be a cred - if r.pattern.MatchString(ident.Name) { - for _, e := range assign.Rhs { - if val, err := gosec.GetString(e); err == nil { - if r.ignoreEntropy || (!r.ignoreEntropy && r.isHighEntropyString(val)) { - return ctx.NewIssue(assign, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } - - // Now that no names were matched, match the RHS to see if the actual values being assigned are creds - for _, e := range assign.Rhs { - val, err := gosec.GetString(e) - if err != nil { - continue - } - - if r.ignoreEntropy || r.isHighEntropyString(val) { - if ok, patternName := r.isSecretPattern(val); ok { - return ctx.NewIssue(assign, r.ID(), fmt.Sprintf("%s: %s", r.What, patternName), r.Severity, r.Confidence), nil - } - } - } - } - } - return nil, nil -} - -func (r *credentials) matchValueSpec(valueSpec *ast.ValueSpec, ctx *gosec.Context) (*issue.Issue, error) { - // Running match against the variable name(s) first. Will catch any creds whose var name matches the pattern, - // then will go back over to check the values themselves. - for index, ident := range valueSpec.Names { - if r.pattern.MatchString(ident.Name) && valueSpec.Values != nil { - // const foo, bar = "same value" - if len(valueSpec.Values) <= index { - index = len(valueSpec.Values) - 1 - } - if val, err := gosec.GetString(valueSpec.Values[index]); err == nil { - if r.ignoreEntropy || (!r.ignoreEntropy && r.isHighEntropyString(val)) { - return ctx.NewIssue(valueSpec, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } - - // Now that no variable names have been matched, match the actual values to find any creds - for _, ident := range valueSpec.Values { - if val, err := gosec.GetString(ident); err == nil { - if r.ignoreEntropy || r.isHighEntropyString(val) { - if ok, patternName := r.isSecretPattern(val); ok { - return ctx.NewIssue(valueSpec, r.ID(), fmt.Sprintf("%s: %s", r.What, patternName), r.Severity, r.Confidence), nil - } - } - } - } - - return nil, nil -} - -func (r *credentials) matchEqualityCheck(binaryExpr *ast.BinaryExpr, ctx *gosec.Context) (*issue.Issue, error) { - if binaryExpr.Op == token.EQL || binaryExpr.Op == token.NEQ { - ident, ok := binaryExpr.X.(*ast.Ident) - if !ok { - ident, _ = binaryExpr.Y.(*ast.Ident) - } - - if ident != nil && r.pattern.MatchString(ident.Name) { - valueNode := binaryExpr.Y - if !ok { - valueNode = binaryExpr.X - } - if val, err := gosec.GetString(valueNode); err == nil { - if r.ignoreEntropy || (!r.ignoreEntropy && r.isHighEntropyString(val)) { - return ctx.NewIssue(binaryExpr, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - - // Now that the variable names have been checked, and no matches were found, make sure that - // either the left or right operands is a string literal so we can match the value. - identStrConst, ok := binaryExpr.X.(*ast.BasicLit) - if !ok { - identStrConst, ok = binaryExpr.Y.(*ast.BasicLit) - } - - if ok && identStrConst.Kind == token.STRING { - s, _ := gosec.GetString(identStrConst) - if r.ignoreEntropy || r.isHighEntropyString(s) { - if ok, patternName := r.isSecretPattern(s); ok { - return ctx.NewIssue(binaryExpr, r.ID(), fmt.Sprintf("%s: %s", r.What, patternName), r.Severity, r.Confidence), nil - } - } - } - } - return nil, nil -} - -// NewHardcodedCredentials attempts to find high entropy string constants being -// assigned to variables that appear to be related to credentials. -func NewHardcodedCredentials(id string, conf gosec.Config) (gosec.Rule, []ast.Node) { - pattern := `(?i)passwd|pass|password|pwd|secret|token|pw|apiKey|bearer|cred` - entropyThreshold := 80.0 - perCharThreshold := 3.0 - ignoreEntropy := false - truncateString := 16 - if val, ok := conf[id]; ok { - conf := val.(map[string]interface{}) - if configPattern, ok := conf["pattern"]; ok { - if cfgPattern, ok := configPattern.(string); ok { - pattern = cfgPattern - } - } - - if configIgnoreEntropy, ok := conf["ignore_entropy"]; ok { - if cfgIgnoreEntropy, ok := configIgnoreEntropy.(bool); ok { - ignoreEntropy = cfgIgnoreEntropy - } - } - if configEntropyThreshold, ok := conf["entropy_threshold"]; ok { - if cfgEntropyThreshold, ok := configEntropyThreshold.(string); ok { - if parsedNum, err := strconv.ParseFloat(cfgEntropyThreshold, 64); err == nil { - entropyThreshold = parsedNum - } - } - } - if configCharThreshold, ok := conf["per_char_threshold"]; ok { - if cfgCharThreshold, ok := configCharThreshold.(string); ok { - if parsedNum, err := strconv.ParseFloat(cfgCharThreshold, 64); err == nil { - perCharThreshold = parsedNum - } - } - } - if configTruncate, ok := conf["truncate"]; ok { - if cfgTruncate, ok := configTruncate.(string); ok { - if parsedInt, err := strconv.Atoi(cfgTruncate); err == nil { - truncateString = parsedInt - } - } - } - } - - return &credentials{ - pattern: regexp.MustCompile(pattern), - entropyThreshold: entropyThreshold, - perCharThreshold: perCharThreshold, - ignoreEntropy: ignoreEntropy, - truncate: truncateString, - MetaData: issue.MetaData{ - ID: id, - What: "Potential hardcoded credentials", - Confidence: issue.Low, - Severity: issue.High, - }, - }, []ast.Node{(*ast.AssignStmt)(nil), (*ast.ValueSpec)(nil), (*ast.BinaryExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/http_serve.go b/vendor/github.com/securego/gosec/v2/rules/http_serve.go deleted file mode 100644 index 525ed4ebc7..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/http_serve.go +++ /dev/null @@ -1,39 +0,0 @@ -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type httpServeWithoutTimeouts struct { - issue.MetaData - pkg string - calls []string -} - -func (r *httpServeWithoutTimeouts) ID() string { - return r.MetaData.ID -} - -func (r *httpServeWithoutTimeouts) Match(n ast.Node, c *gosec.Context) (gi *issue.Issue, err error) { - if _, matches := gosec.MatchCallByPackage(n, c, r.pkg, r.calls...); matches { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - return nil, nil -} - -// NewHTTPServeWithoutTimeouts detects use of net/http serve functions that have no support for setting timeouts. -func NewHTTPServeWithoutTimeouts(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &httpServeWithoutTimeouts{ - pkg: "net/http", - calls: []string{"ListenAndServe", "ListenAndServeTLS", "Serve", "ServeTLS"}, - MetaData: issue.MetaData{ - ID: id, - What: "Use of net/http serve function that has no support for setting timeouts", - Severity: issue.Medium, - Confidence: issue.High, - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/implicit_aliasing.go b/vendor/github.com/securego/gosec/v2/rules/implicit_aliasing.go deleted file mode 100644 index a7eabb20b4..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/implicit_aliasing.go +++ /dev/null @@ -1,142 +0,0 @@ -package rules - -import ( - "go/ast" - "go/token" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type implicitAliasing struct { - issue.MetaData - aliases map[*ast.Object]struct{} - rightBrace token.Pos - acceptableAlias []*ast.UnaryExpr -} - -func (r *implicitAliasing) ID() string { - return r.MetaData.ID -} - -func containsUnary(exprs []*ast.UnaryExpr, expr *ast.UnaryExpr) bool { - for _, e := range exprs { - if e == expr { - return true - } - } - return false -} - -func getIdentExpr(expr ast.Expr) (*ast.Ident, bool) { - return doGetIdentExpr(expr, false) -} - -func doGetIdentExpr(expr ast.Expr, hasSelector bool) (*ast.Ident, bool) { - switch node := expr.(type) { - case *ast.Ident: - return node, hasSelector - case *ast.SelectorExpr: - return doGetIdentExpr(node.X, true) - case *ast.UnaryExpr: - return doGetIdentExpr(node.X, hasSelector) - default: - return nil, false - } -} - -func (r *implicitAliasing) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - switch node := n.(type) { - case *ast.RangeStmt: - // When presented with a range statement, get the underlying Object bound to - // by assignment and add it to our set (r.aliases) of objects to check for. - if key, ok := node.Value.(*ast.Ident); ok { - if key.Obj != nil { - if assignment, ok := key.Obj.Decl.(*ast.AssignStmt); ok { - if len(assignment.Lhs) < 2 { - return nil, nil - } - - if object, ok := assignment.Lhs[1].(*ast.Ident); ok { - r.aliases[object.Obj] = struct{}{} - - if r.rightBrace < node.Body.Rbrace { - r.rightBrace = node.Body.Rbrace - } - } - } - } - } - - case *ast.UnaryExpr: - // If this unary expression is outside of the last range statement we were looking at - // then clear the list of objects we're concerned about because they're no longer in - // scope - if node.Pos() > r.rightBrace { - r.aliases = make(map[*ast.Object]struct{}) - r.acceptableAlias = make([]*ast.UnaryExpr, 0) - } - - // Short circuit logic to skip checking aliases if we have nothing to check against. - if len(r.aliases) == 0 { - return nil, nil - } - - // If this unary is at the top level of a return statement then it is okay-- - // see *ast.ReturnStmt comment below. - if containsUnary(r.acceptableAlias, node) { - return nil, nil - } - - // If we find a unary op of & (reference) of an object within r.aliases, complain. - if identExpr, hasSelector := getIdentExpr(node); identExpr != nil && node.Op.String() == "&" { - if _, contains := r.aliases[identExpr.Obj]; contains { - _, isPointer := c.Info.TypeOf(identExpr).(*types.Pointer) - - if !hasSelector || !isPointer { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - case *ast.ReturnStmt: - // Returning a rangeStmt yielded value is acceptable since only one value will be returned - for _, item := range node.Results { - if unary, ok := item.(*ast.UnaryExpr); ok && unary.Op.String() == "&" { - r.acceptableAlias = append(r.acceptableAlias, unary) - } - } - } - - return nil, nil -} - -// NewImplicitAliasing detects implicit memory aliasing of type: for blah := SomeCall() {... SomeOtherCall(&blah) ...} -func NewImplicitAliasing(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &implicitAliasing{ - aliases: make(map[*ast.Object]struct{}), - rightBrace: token.NoPos, - acceptableAlias: make([]*ast.UnaryExpr, 0), - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.Medium, - What: "Implicit memory aliasing in for loop.", - }, - }, []ast.Node{(*ast.RangeStmt)(nil), (*ast.UnaryExpr)(nil), (*ast.ReturnStmt)(nil)} -} - -/* -This rule is prone to flag false positives. - -Within GoSec, the rule is just an AST match-- there are a handful of other -implementation strategies which might lend more nuance to the rule at the -cost of allowing false negatives. - -From a tooling side, I'd rather have this rule flag false positives than -potentially have some false negatives-- especially if the sentiment of this -rule (as I understand it, and Go) is that referencing a rangeStmt-yielded -value is kinda strange and does not have a strongly justified use case. - -Which is to say-- a false positive _should_ just be changed. -*/ diff --git a/vendor/github.com/securego/gosec/v2/rules/integer_overflow.go b/vendor/github.com/securego/gosec/v2/rules/integer_overflow.go deleted file mode 100644 index 1d57906642..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/integer_overflow.go +++ /dev/null @@ -1,90 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type integerOverflowCheck struct { - issue.MetaData - calls gosec.CallList -} - -func (i *integerOverflowCheck) ID() string { - return i.MetaData.ID -} - -func (i *integerOverflowCheck) Match(node ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - var atoiVarObj map[*ast.Object]ast.Node - - // To check multiple lines, ctx.PassedValues is used to store temporary data. - if _, ok := ctx.PassedValues[i.ID()]; !ok { - atoiVarObj = make(map[*ast.Object]ast.Node) - ctx.PassedValues[i.ID()] = atoiVarObj - } else if pv, ok := ctx.PassedValues[i.ID()].(map[*ast.Object]ast.Node); ok { - atoiVarObj = pv - } else { - return nil, fmt.Errorf("PassedValues[%s] of Context is not map[*ast.Object]ast.Node, but %T", i.ID(), ctx.PassedValues[i.ID()]) - } - - // strconv.Atoi is a common function. - // To reduce false positives, This rule detects code which is converted to int32/int16 only. - switch n := node.(type) { - case *ast.AssignStmt: - for _, expr := range n.Rhs { - if callExpr, ok := expr.(*ast.CallExpr); ok && i.calls.ContainsPkgCallExpr(callExpr, ctx, false) != nil { - if idt, ok := n.Lhs[0].(*ast.Ident); ok && idt.Name != "_" { - // Example: - // v, _ := strconv.Atoi("1111") - // Add v's Obj to atoiVarObj map - atoiVarObj[idt.Obj] = n - } - } - } - case *ast.CallExpr: - if fun, ok := n.Fun.(*ast.Ident); ok { - if fun.Name == "int32" || fun.Name == "int16" { - if idt, ok := n.Args[0].(*ast.Ident); ok { - if _, ok := atoiVarObj[idt.Obj]; ok { - // Detect int32(v) and int16(v) - return ctx.NewIssue(n, i.ID(), i.What, i.Severity, i.Confidence), nil - } - } - } - } - } - - return nil, nil -} - -// NewIntegerOverflowCheck detects if there is potential Integer OverFlow -func NewIntegerOverflowCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("strconv", "Atoi") - return &integerOverflowCheck{ - MetaData: issue.MetaData{ - ID: id, - Severity: issue.High, - Confidence: issue.Medium, - What: "Potential Integer overflow made by strconv.Atoi result conversion to int16/32", - }, - calls: calls, - }, []ast.Node{(*ast.FuncDecl)(nil), (*ast.AssignStmt)(nil), (*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/math_big_rat.go b/vendor/github.com/securego/gosec/v2/rules/math_big_rat.go deleted file mode 100644 index 1aac1fa201..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/math_big_rat.go +++ /dev/null @@ -1,45 +0,0 @@ -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type usingOldMathBig struct { - issue.MetaData - calls gosec.CallList -} - -func (r *usingOldMathBig) ID() string { - return r.MetaData.ID -} - -func (r *usingOldMathBig) Match(node ast.Node, ctx *gosec.Context) (gi *issue.Issue, err error) { - if callExpr := r.calls.ContainsPkgCallExpr(node, ctx, false); callExpr == nil { - return nil, nil - } - - confidence := issue.Low - major, minor, build := gosec.GoVersion() - if major == 1 && (minor == 16 && build < 14 || minor == 17 && build < 7) { - confidence = issue.Medium - } - - return ctx.NewIssue(node, r.ID(), r.What, r.Severity, confidence), nil -} - -// NewUsingOldMathBig rule detects the use of Rat.SetString from math/big. -func NewUsingOldMathBig(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("math/big.Rat", "SetString") - return &usingOldMathBig{ - calls: calls, - MetaData: issue.MetaData{ - ID: id, - What: "Potential uncontrolled memory consumption in Rat.SetString (CVE-2022-23772)", - Severity: issue.High, - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/pprof.go b/vendor/github.com/securego/gosec/v2/rules/pprof.go deleted file mode 100644 index 68498dd5e0..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/pprof.go +++ /dev/null @@ -1,43 +0,0 @@ -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type pprofCheck struct { - issue.MetaData - importPath string - importName string -} - -// ID returns the ID of the check -func (p *pprofCheck) ID() string { - return p.MetaData.ID -} - -// Match checks for pprof imports -func (p *pprofCheck) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node, ok := n.(*ast.ImportSpec); ok { - if p.importPath == unquote(node.Path.Value) && node.Name != nil && p.importName == node.Name.Name { - return c.NewIssue(node, p.ID(), p.What, p.Severity, p.Confidence), nil - } - } - return nil, nil -} - -// NewPprofCheck detects when the profiling endpoint is automatically exposed -func NewPprofCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &pprofCheck{ - MetaData: issue.MetaData{ - ID: id, - Severity: issue.High, - Confidence: issue.High, - What: "Profiling endpoint is automatically exposed on /debug/pprof", - }, - importPath: "net/http/pprof", - importName: "_", - }, []ast.Node{(*ast.ImportSpec)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/rand.go b/vendor/github.com/securego/gosec/v2/rules/rand.go deleted file mode 100644 index 4491fd9284..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/rand.go +++ /dev/null @@ -1,59 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type weakRand struct { - issue.MetaData - funcNames []string - packagePath string -} - -func (w *weakRand) ID() string { - return w.MetaData.ID -} - -func (w *weakRand) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - for _, funcName := range w.funcNames { - if _, matched := gosec.MatchCallByPackage(n, c, w.packagePath, funcName); matched { - return c.NewIssue(n, w.ID(), w.What, w.Severity, w.Confidence), nil - } - } - - return nil, nil -} - -// NewWeakRandCheck detects the use of random number generator that isn't cryptographically secure -func NewWeakRandCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &weakRand{ - funcNames: []string{ - "New", "Read", "Float32", "Float64", "Int", "Int31", - "Int31n", "Int63", "Int63n", "Intn", "NormalFloat64", "Uint32", "Uint64", - }, - packagePath: "math/rand", - MetaData: issue.MetaData{ - ID: id, - Severity: issue.High, - Confidence: issue.Medium, - What: "Use of weak random number generator (math/rand instead of crypto/rand)", - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/readfile.go b/vendor/github.com/securego/gosec/v2/rules/readfile.go deleted file mode 100644 index 7ef4bbad13..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/readfile.go +++ /dev/null @@ -1,152 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type readfile struct { - issue.MetaData - gosec.CallList - pathJoin gosec.CallList - clean gosec.CallList - cleanedVar map[any]ast.Node -} - -// ID returns the identifier for this rule -func (r *readfile) ID() string { - return r.MetaData.ID -} - -// isJoinFunc checks if there is a filepath.Join or other join function -func (r *readfile) isJoinFunc(n ast.Node, c *gosec.Context) bool { - if call := r.pathJoin.ContainsPkgCallExpr(n, c, false); call != nil { - for _, arg := range call.Args { - // edge case: check if one of the args is a BinaryExpr - if binExp, ok := arg.(*ast.BinaryExpr); ok { - // iterate and resolve all found identities from the BinaryExpr - if _, ok := gosec.FindVarIdentities(binExp, c); ok { - return true - } - } - - // try and resolve identity - if ident, ok := arg.(*ast.Ident); ok { - obj := c.Info.ObjectOf(ident) - if _, ok := obj.(*types.Var); ok && !gosec.TryResolve(ident, c) { - return true - } - } - } - } - return false -} - -// isFilepathClean checks if there is a filepath.Clean for given variable -func (r *readfile) isFilepathClean(n *ast.Ident, c *gosec.Context) bool { - if _, ok := r.cleanedVar[n.Obj.Decl]; ok { - return true - } - if n.Obj.Kind != ast.Var { - return false - } - if node, ok := n.Obj.Decl.(*ast.AssignStmt); ok { - if call, ok := node.Rhs[0].(*ast.CallExpr); ok { - if clean := r.clean.ContainsPkgCallExpr(call, c, false); clean != nil { - return true - } - } - } - return false -} - -// trackFilepathClean tracks back the declaration of variable from filepath.Clean argument -func (r *readfile) trackFilepathClean(n ast.Node) { - if clean, ok := n.(*ast.CallExpr); ok && len(clean.Args) > 0 { - if ident, ok := clean.Args[0].(*ast.Ident); ok { - // ident.Obj may be nil if the referenced declaration is in another file. It also may be incorrect. - // if it is nil, do not follow it. - if ident.Obj != nil { - r.cleanedVar[ident.Obj.Decl] = n - } - } - } -} - -// Match inspects AST nodes to determine if the match the methods `os.Open` or `ioutil.ReadFile` -func (r *readfile) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node := r.clean.ContainsPkgCallExpr(n, c, false); node != nil { - r.trackFilepathClean(n) - return nil, nil - } else if node := r.ContainsPkgCallExpr(n, c, false); node != nil { - for _, arg := range node.Args { - // handles path joining functions in Arg - // eg. os.Open(filepath.Join("/tmp/", file)) - if callExpr, ok := arg.(*ast.CallExpr); ok { - if r.isJoinFunc(callExpr, c) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - // handles binary string concatenation eg. ioutil.Readfile("/tmp/" + file + "/blob") - if binExp, ok := arg.(*ast.BinaryExpr); ok { - // resolve all found identities from the BinaryExpr - if _, ok := gosec.FindVarIdentities(binExp, c); ok { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - - if ident, ok := arg.(*ast.Ident); ok { - obj := c.Info.ObjectOf(ident) - if _, ok := obj.(*types.Var); ok && - !gosec.TryResolve(ident, c) && - !r.isFilepathClean(ident, c) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - } - return nil, nil -} - -// NewReadFile detects cases where we read files -func NewReadFile(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - rule := &readfile{ - pathJoin: gosec.NewCallList(), - clean: gosec.NewCallList(), - CallList: gosec.NewCallList(), - MetaData: issue.MetaData{ - ID: id, - What: "Potential file inclusion via variable", - Severity: issue.Medium, - Confidence: issue.High, - }, - cleanedVar: map[any]ast.Node{}, - } - rule.pathJoin.Add("path/filepath", "Join") - rule.pathJoin.Add("path", "Join") - rule.clean.Add("path/filepath", "Clean") - rule.clean.Add("path/filepath", "Rel") - rule.Add("io/ioutil", "ReadFile") - rule.Add("os", "ReadFile") - rule.Add("os", "Open") - rule.Add("os", "OpenFile") - rule.Add("os", "Create") - return rule, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/rsa.go b/vendor/github.com/securego/gosec/v2/rules/rsa.go deleted file mode 100644 index 331e7fc80a..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/rsa.go +++ /dev/null @@ -1,59 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type weakKeyStrength struct { - issue.MetaData - calls gosec.CallList - bits int -} - -func (w *weakKeyStrength) ID() string { - return w.MetaData.ID -} - -func (w *weakKeyStrength) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if callExpr := w.calls.ContainsPkgCallExpr(n, c, false); callExpr != nil { - if bits, err := gosec.GetInt(callExpr.Args[1]); err == nil && bits < (int64)(w.bits) { - return c.NewIssue(n, w.ID(), w.What, w.Severity, w.Confidence), nil - } - } - return nil, nil -} - -// NewWeakKeyStrength builds a rule that detects RSA keys < 2048 bits -func NewWeakKeyStrength(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("crypto/rsa", "GenerateKey") - bits := 2048 - return &weakKeyStrength{ - calls: calls, - bits: bits, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: fmt.Sprintf("RSA keys should be at least %d bits", bits), - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/rulelist.go b/vendor/github.com/securego/gosec/v2/rules/rulelist.go deleted file mode 100644 index f9ca4f52c4..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/rulelist.go +++ /dev/null @@ -1,130 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import "github.com/securego/gosec/v2" - -// RuleDefinition contains the description of a rule and a mechanism to -// create it. -type RuleDefinition struct { - ID string - Description string - Create gosec.RuleBuilder -} - -// RuleList contains a mapping of rule ID's to rule definitions and a mapping -// of rule ID's to whether rules are suppressed. -type RuleList struct { - Rules map[string]RuleDefinition - RuleSuppressed map[string]bool -} - -// RulesInfo returns all the create methods and the rule suppressed map for a -// given list -func (rl RuleList) RulesInfo() (map[string]gosec.RuleBuilder, map[string]bool) { - builders := make(map[string]gosec.RuleBuilder) - for _, def := range rl.Rules { - builders[def.ID] = def.Create - } - return builders, rl.RuleSuppressed -} - -// RuleFilter can be used to include or exclude a rule depending on the return -// value of the function -type RuleFilter func(string) bool - -// NewRuleFilter is a closure that will include/exclude the rule ID's based on -// the supplied boolean value. -func NewRuleFilter(action bool, ruleIDs ...string) RuleFilter { - rulelist := make(map[string]bool) - for _, rule := range ruleIDs { - rulelist[rule] = true - } - return func(rule string) bool { - if _, found := rulelist[rule]; found { - return action - } - return !action - } -} - -// Generate the list of rules to use -func Generate(trackSuppressions bool, filters ...RuleFilter) RuleList { - rules := []RuleDefinition{ - // misc - {"G101", "Look for hardcoded credentials", NewHardcodedCredentials}, - {"G102", "Bind to all interfaces", NewBindsToAllNetworkInterfaces}, - {"G103", "Audit the use of unsafe block", NewUsingUnsafe}, - {"G104", "Audit errors not checked", NewNoErrorCheck}, - {"G106", "Audit the use of ssh.InsecureIgnoreHostKey function", NewSSHHostKey}, - {"G107", "Url provided to HTTP request as taint input", NewSSRFCheck}, - {"G108", "Profiling endpoint is automatically exposed", NewPprofCheck}, - {"G109", "Converting strconv.Atoi result to int32/int16", NewIntegerOverflowCheck}, - {"G110", "Detect io.Copy instead of io.CopyN when decompression", NewDecompressionBombCheck}, - {"G111", "Detect http.Dir('/') as a potential risk", NewDirectoryTraversal}, - {"G112", "Detect ReadHeaderTimeout not configured as a potential risk", NewSlowloris}, - {"G113", "Usage of Rat.SetString in math/big with an overflow", NewUsingOldMathBig}, - {"G114", "Use of net/http serve function that has no support for setting timeouts", NewHTTPServeWithoutTimeouts}, - - // injection - {"G201", "SQL query construction using format string", NewSQLStrFormat}, - {"G202", "SQL query construction using string concatenation", NewSQLStrConcat}, - {"G203", "Use of unescaped data in HTML templates", NewTemplateCheck}, - {"G204", "Audit use of command execution", NewSubproc}, - - // filesystem - {"G301", "Poor file permissions used when creating a directory", NewMkdirPerms}, - {"G302", "Poor file permissions used when creation file or using chmod", NewFilePerms}, - {"G303", "Creating tempfile using a predictable path", NewBadTempFile}, - {"G304", "File path provided as taint input", NewReadFile}, - {"G305", "File path traversal when extracting zip archive", NewArchive}, - {"G306", "Poor file permissions used when writing to a file", NewWritePerms}, - {"G307", "Poor file permissions used when creating a file with os.Create", NewOsCreatePerms}, - - // crypto - {"G401", "Detect the usage of DES, RC4, MD5 or SHA1", NewUsesWeakCryptography}, - {"G402", "Look for bad TLS connection settings", NewIntermediateTLSCheck}, - {"G403", "Ensure minimum RSA key length of 2048 bits", NewWeakKeyStrength}, - {"G404", "Insecure random number source (rand)", NewWeakRandCheck}, - - // blocklist - {"G501", "Import blocklist: crypto/md5", NewBlocklistedImportMD5}, - {"G502", "Import blocklist: crypto/des", NewBlocklistedImportDES}, - {"G503", "Import blocklist: crypto/rc4", NewBlocklistedImportRC4}, - {"G504", "Import blocklist: net/http/cgi", NewBlocklistedImportCGI}, - {"G505", "Import blocklist: crypto/sha1", NewBlocklistedImportSHA1}, - - // memory safety - {"G601", "Implicit memory aliasing in RangeStmt", NewImplicitAliasing}, - } - - ruleMap := make(map[string]RuleDefinition) - ruleSuppressedMap := make(map[string]bool) - -RULES: - for _, rule := range rules { - ruleSuppressedMap[rule.ID] = false - for _, filter := range filters { - if filter(rule.ID) { - ruleSuppressedMap[rule.ID] = true - if !trackSuppressions { - continue RULES - } - } - } - ruleMap[rule.ID] = rule - } - return RuleList{ruleMap, ruleSuppressedMap} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/slowloris.go b/vendor/github.com/securego/gosec/v2/rules/slowloris.go deleted file mode 100644 index 70db73f5f3..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/slowloris.go +++ /dev/null @@ -1,71 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type slowloris struct { - issue.MetaData -} - -func (r *slowloris) ID() string { - return r.MetaData.ID -} - -func containsReadHeaderTimeout(node *ast.CompositeLit) bool { - if node == nil { - return false - } - for _, elt := range node.Elts { - if kv, ok := elt.(*ast.KeyValueExpr); ok { - if ident, ok := kv.Key.(*ast.Ident); ok { - if ident.Name == "ReadHeaderTimeout" || ident.Name == "ReadTimeout" { - return true - } - } - } - } - return false -} - -func (r *slowloris) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch node := n.(type) { - case *ast.CompositeLit: - actualType := ctx.Info.TypeOf(node.Type) - if actualType != nil && actualType.String() == "net/http.Server" { - if !containsReadHeaderTimeout(node) { - return ctx.NewIssue(node, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - } - return nil, nil -} - -// NewSlowloris attempts to find the http.Server struct and check if the ReadHeaderTimeout is configured. -func NewSlowloris(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &slowloris{ - MetaData: issue.MetaData{ - ID: id, - What: "Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server", - Confidence: issue.Low, - Severity: issue.Medium, - }, - }, []ast.Node{(*ast.CompositeLit)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/sql.go b/vendor/github.com/securego/gosec/v2/rules/sql.go deleted file mode 100644 index 61222bfdb3..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/sql.go +++ /dev/null @@ -1,405 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "fmt" - "go/ast" - "regexp" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type sqlStatement struct { - issue.MetaData - gosec.CallList - - // Contains a list of patterns which must all match for the rule to match. - patterns []*regexp.Regexp -} - -var sqlCallIdents = map[string]map[string]int{ - "*database/sql.DB": { - "Exec": 0, - "ExecContext": 1, - "Query": 0, - "QueryContext": 1, - "QueryRow": 0, - "QueryRowContext": 1, - "Prepare": 0, - "PrepareContext": 1, - }, - "*database/sql.Tx": { - "Exec": 0, - "ExecContext": 1, - "Query": 0, - "QueryContext": 1, - "QueryRow": 0, - "QueryRowContext": 1, - "Prepare": 0, - "PrepareContext": 1, - }, -} - -// findQueryArg locates the argument taking raw SQL -func findQueryArg(call *ast.CallExpr, ctx *gosec.Context) (ast.Expr, error) { - typeName, fnName, err := gosec.GetCallInfo(call, ctx) - if err != nil { - return nil, err - } - i := -1 - if ni, ok := sqlCallIdents[typeName]; ok { - if i, ok = ni[fnName]; !ok { - i = -1 - } - } - if i == -1 { - return nil, fmt.Errorf("SQL argument index not found for %s.%s", typeName, fnName) - } - if i >= len(call.Args) { - return nil, nil - } - query := call.Args[i] - return query, nil -} - -func (s *sqlStatement) ID() string { - return s.MetaData.ID -} - -// See if the string matches the patterns for the statement. -func (s *sqlStatement) MatchPatterns(str string) bool { - for _, pattern := range s.patterns { - if !pattern.MatchString(str) { - return false - } - } - return true -} - -type sqlStrConcat struct { - sqlStatement -} - -func (s *sqlStrConcat) ID() string { - return s.MetaData.ID -} - -// findInjectionInBranch walks diwb a set if expressions, and will create new issues if it finds SQL injections -// This method assumes you've already verified that the branch contains SQL syntax -func (s *sqlStrConcat) findInjectionInBranch(ctx *gosec.Context, branch []ast.Expr) *ast.BinaryExpr { - for _, node := range branch { - be, ok := node.(*ast.BinaryExpr) - if !ok { - continue - } - - operands := gosec.GetBinaryExprOperands(be) - - for _, op := range operands { - if _, ok := op.(*ast.BasicLit); ok { - continue - } - - if ident, ok := op.(*ast.Ident); ok && s.checkObject(ident, ctx) { - continue - } - - return be - } - } - return nil -} - -// see if we can figure out what it is -func (s *sqlStrConcat) checkObject(n *ast.Ident, c *gosec.Context) bool { - if n.Obj != nil { - return n.Obj.Kind != ast.Var && n.Obj.Kind != ast.Fun - } - - // Try to resolve unresolved identifiers using other files in same package - for _, file := range c.PkgFiles { - if node, ok := file.Scope.Objects[n.String()]; ok { - return node.Kind != ast.Var && node.Kind != ast.Fun - } - } - return false -} - -// checkQuery verifies if the query parameters is a string concatenation -func (s *sqlStrConcat) checkQuery(call *ast.CallExpr, ctx *gosec.Context) (*issue.Issue, error) { - query, err := findQueryArg(call, ctx) - if err != nil { - return nil, err - } - - if be, ok := query.(*ast.BinaryExpr); ok { - operands := gosec.GetBinaryExprOperands(be) - if start, ok := operands[0].(*ast.BasicLit); ok { - if str, e := gosec.GetString(start); e == nil { - if !s.MatchPatterns(str) { - return nil, nil - } - } - for _, op := range operands[1:] { - if _, ok := op.(*ast.BasicLit); ok { - continue - } - if op, ok := op.(*ast.Ident); ok && s.checkObject(op, ctx) { - continue - } - return ctx.NewIssue(be, s.ID(), s.What, s.Severity, s.Confidence), nil - } - } - } - - // Handle the case where an injection occurs as an infixed string concatenation, ie "SELECT * FROM foo WHERE name = '" + os.Args[0] + "' AND 1=1" - if id, ok := query.(*ast.Ident); ok { - var match bool - for _, str := range gosec.GetIdentStringValuesRecursive(id) { - if s.MatchPatterns(str) { - match = true - break - } - } - - if !match { - return nil, nil - } - - switch decl := id.Obj.Decl.(type) { - case *ast.AssignStmt: - if injection := s.findInjectionInBranch(ctx, decl.Rhs); injection != nil { - return ctx.NewIssue(injection, s.ID(), s.What, s.Severity, s.Confidence), nil - } - } - } - - return nil, nil -} - -// Checks SQL query concatenation issues such as "SELECT * FROM table WHERE " + " ' OR 1=1" -func (s *sqlStrConcat) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch stmt := n.(type) { - case *ast.AssignStmt: - for _, expr := range stmt.Rhs { - if sqlQueryCall, ok := expr.(*ast.CallExpr); ok && s.ContainsCallExpr(expr, ctx) != nil { - return s.checkQuery(sqlQueryCall, ctx) - } - } - case *ast.ExprStmt: - if sqlQueryCall, ok := stmt.X.(*ast.CallExpr); ok && s.ContainsCallExpr(stmt.X, ctx) != nil { - return s.checkQuery(sqlQueryCall, ctx) - } - } - - return nil, nil -} - -// NewSQLStrConcat looks for cases where we are building SQL strings via concatenation -func NewSQLStrConcat(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - rule := &sqlStrConcat{ - sqlStatement: sqlStatement{ - patterns: []*regexp.Regexp{ - regexp.MustCompile("(?i)(SELECT|DELETE|INSERT|UPDATE|INTO|FROM|WHERE)( |\n|\r|\t)"), - }, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "SQL string concatenation", - }, - CallList: gosec.NewCallList(), - }, - } - - for s, si := range sqlCallIdents { - for i := range si { - rule.Add(s, i) - } - } - return rule, []ast.Node{(*ast.AssignStmt)(nil), (*ast.ExprStmt)(nil)} -} - -type sqlStrFormat struct { - gosec.CallList - sqlStatement - fmtCalls gosec.CallList - noIssue gosec.CallList - noIssueQuoted gosec.CallList -} - -// see if we can figure out what it is -func (s *sqlStrFormat) constObject(e ast.Expr, c *gosec.Context) bool { - n, ok := e.(*ast.Ident) - if !ok { - return false - } - - if n.Obj != nil { - return n.Obj.Kind == ast.Con - } - - // Try to resolve unresolved identifiers using other files in same package - for _, file := range c.PkgFiles { - if node, ok := file.Scope.Objects[n.String()]; ok { - return node.Kind == ast.Con - } - } - return false -} - -func (s *sqlStrFormat) checkQuery(call *ast.CallExpr, ctx *gosec.Context) (*issue.Issue, error) { - query, err := findQueryArg(call, ctx) - if err != nil { - return nil, err - } - - if ident, ok := query.(*ast.Ident); ok && ident.Obj != nil { - decl := ident.Obj.Decl - if assign, ok := decl.(*ast.AssignStmt); ok { - for _, expr := range assign.Rhs { - issue := s.checkFormatting(expr, ctx) - if issue != nil { - return issue, err - } - } - } - } - - return nil, nil -} - -func (s *sqlStrFormat) checkFormatting(n ast.Node, ctx *gosec.Context) *issue.Issue { - // argIndex changes the function argument which gets matched to the regex - argIndex := 0 - if node := s.fmtCalls.ContainsPkgCallExpr(n, ctx, false); node != nil { - // if the function is fmt.Fprintf, search for SQL statement in Args[1] instead - if sel, ok := node.Fun.(*ast.SelectorExpr); ok { - if sel.Sel.Name == "Fprintf" { - // if os.Stderr or os.Stdout is in Arg[0], mark as no issue - if arg, ok := node.Args[0].(*ast.SelectorExpr); ok { - if ident, ok := arg.X.(*ast.Ident); ok { - if s.noIssue.Contains(ident.Name, arg.Sel.Name) { - return nil - } - } - } - // the function is Fprintf so set argIndex = 1 - argIndex = 1 - } - } - - // no formatter - if len(node.Args) == 0 { - return nil - } - - var formatter string - - // concats callexpr arg strings together if needed before regex evaluation - if argExpr, ok := node.Args[argIndex].(*ast.BinaryExpr); ok { - if fullStr, ok := gosec.ConcatString(argExpr); ok { - formatter = fullStr - } - } else if arg, e := gosec.GetString(node.Args[argIndex]); e == nil { - formatter = arg - } - if len(formatter) <= 0 { - return nil - } - - // If all formatter args are quoted or constant, then the SQL construction is safe - if argIndex+1 < len(node.Args) { - allSafe := true - for _, arg := range node.Args[argIndex+1:] { - if n := s.noIssueQuoted.ContainsPkgCallExpr(arg, ctx, true); n == nil && !s.constObject(arg, ctx) { - allSafe = false - break - } - } - if allSafe { - return nil - } - } - if s.MatchPatterns(formatter) { - return ctx.NewIssue(n, s.ID(), s.What, s.Severity, s.Confidence) - } - } - return nil -} - -// Check SQL query formatting issues such as "fmt.Sprintf("SELECT * FROM foo where '%s', userInput)" -func (s *sqlStrFormat) Match(n ast.Node, ctx *gosec.Context) (*issue.Issue, error) { - switch stmt := n.(type) { - case *ast.AssignStmt: - for _, expr := range stmt.Rhs { - if call, ok := expr.(*ast.CallExpr); ok { - selector, ok := call.Fun.(*ast.SelectorExpr) - if !ok { - continue - } - sqlQueryCall, ok := selector.X.(*ast.CallExpr) - if ok && s.ContainsCallExpr(sqlQueryCall, ctx) != nil { - issue, err := s.checkQuery(sqlQueryCall, ctx) - if err == nil && issue != nil { - return issue, err - } - } - } - if sqlQueryCall, ok := expr.(*ast.CallExpr); ok && s.ContainsCallExpr(expr, ctx) != nil { - return s.checkQuery(sqlQueryCall, ctx) - } - } - case *ast.ExprStmt: - if sqlQueryCall, ok := stmt.X.(*ast.CallExpr); ok && s.ContainsCallExpr(stmt.X, ctx) != nil { - return s.checkQuery(sqlQueryCall, ctx) - } - } - return nil, nil -} - -// NewSQLStrFormat looks for cases where we're building SQL query strings using format strings -func NewSQLStrFormat(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - rule := &sqlStrFormat{ - CallList: gosec.NewCallList(), - fmtCalls: gosec.NewCallList(), - noIssue: gosec.NewCallList(), - noIssueQuoted: gosec.NewCallList(), - sqlStatement: sqlStatement{ - patterns: []*regexp.Regexp{ - regexp.MustCompile("(?i)(SELECT|DELETE|INSERT|UPDATE|INTO|FROM|WHERE)( |\n|\r|\t)"), - regexp.MustCompile("%[^bdoxXfFp]"), - }, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "SQL string formatting", - }, - }, - } - for s, si := range sqlCallIdents { - for i := range si { - rule.Add(s, i) - } - } - rule.fmtCalls.AddAll("fmt", "Sprint", "Sprintf", "Sprintln", "Fprintf") - rule.noIssue.AddAll("os", "Stdout", "Stderr") - rule.noIssueQuoted.Add("github.com/lib/pq", "QuoteIdentifier") - - return rule, []ast.Node{(*ast.AssignStmt)(nil), (*ast.ExprStmt)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/ssh.go b/vendor/github.com/securego/gosec/v2/rules/ssh.go deleted file mode 100644 index e2ba5a3f4e..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/ssh.go +++ /dev/null @@ -1,39 +0,0 @@ -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type sshHostKey struct { - issue.MetaData - pkg string - calls []string -} - -func (r *sshHostKey) ID() string { - return r.MetaData.ID -} - -func (r *sshHostKey) Match(n ast.Node, c *gosec.Context) (gi *issue.Issue, err error) { - if _, matches := gosec.MatchCallByPackage(n, c, r.pkg, r.calls...); matches { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - return nil, nil -} - -// NewSSHHostKey rule detects the use of insecure ssh HostKeyCallback. -func NewSSHHostKey(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &sshHostKey{ - pkg: "golang.org/x/crypto/ssh", - calls: []string{"InsecureIgnoreHostKey"}, - MetaData: issue.MetaData{ - ID: id, - What: "Use of ssh InsecureIgnoreHostKey should be audited", - Severity: issue.Medium, - Confidence: issue.High, - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/ssrf.go b/vendor/github.com/securego/gosec/v2/rules/ssrf.go deleted file mode 100644 index dbf01081b2..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/ssrf.go +++ /dev/null @@ -1,67 +0,0 @@ -package rules - -import ( - "go/ast" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type ssrf struct { - issue.MetaData - gosec.CallList -} - -// ID returns the identifier for this rule -func (r *ssrf) ID() string { - return r.MetaData.ID -} - -// ResolveVar tries to resolve the first argument of a call expression -// The first argument is the url -func (r *ssrf) ResolveVar(n *ast.CallExpr, c *gosec.Context) bool { - if len(n.Args) > 0 { - arg := n.Args[0] - if ident, ok := arg.(*ast.Ident); ok { - obj := c.Info.ObjectOf(ident) - if _, ok := obj.(*types.Var); ok { - scope := c.Pkg.Scope() - if scope != nil && scope.Lookup(ident.Name) != nil { - // a URL defined in a variable at package scope can be changed at any time - return true - } - if !gosec.TryResolve(ident, c) { - return true - } - } - } - } - return false -} - -// Match inspects AST nodes to determine if certain net/http methods are called with variable input -func (r *ssrf) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - // Call expression is using http package directly - if node := r.ContainsPkgCallExpr(n, c, false); node != nil { - if r.ResolveVar(node, c) { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - return nil, nil -} - -// NewSSRFCheck detects cases where HTTP requests are sent -func NewSSRFCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - rule := &ssrf{ - CallList: gosec.NewCallList(), - MetaData: issue.MetaData{ - ID: id, - What: "Potential HTTP request made with variable url", - Severity: issue.Medium, - Confidence: issue.Medium, - }, - } - rule.AddAll("net/http", "Do", "Get", "Head", "Post", "PostForm", "RoundTrip") - return rule, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/subproc.go b/vendor/github.com/securego/gosec/v2/rules/subproc.go deleted file mode 100644 index 1e2cedaa58..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/subproc.go +++ /dev/null @@ -1,123 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "go/types" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type subprocess struct { - issue.MetaData - gosec.CallList -} - -func (r *subprocess) ID() string { - return r.MetaData.ID -} - -// TODO(gm) The only real potential for command injection with a Go project -// is something like this: -// -// syscall.Exec("/bin/sh", []string{"-c", tainted}) -// -// E.g. Input is correctly escaped but the execution context being used -// is unsafe. For example: -// -// syscall.Exec("echo", "foobar" + tainted) -func (r *subprocess) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node := r.ContainsPkgCallExpr(n, c, false); node != nil { - args := node.Args - if r.isContext(n, c) { - args = args[1:] - } - for _, arg := range args { - if ident, ok := arg.(*ast.Ident); ok { - obj := c.Info.ObjectOf(ident) - - // need to cast and check whether it is for a variable ? - _, variable := obj.(*types.Var) - - // .. indeed it is a variable then processing is different than a normal - // field assignment - if variable { - // skip the check when the declaration is not available - if ident.Obj == nil { - continue - } - switch ident.Obj.Decl.(type) { - case *ast.AssignStmt: - _, assignment := ident.Obj.Decl.(*ast.AssignStmt) - if variable && assignment { - if !gosec.TryResolve(ident, c) { - return c.NewIssue(n, r.ID(), "Subprocess launched with variable", issue.Medium, issue.High), nil - } - } - case *ast.Field: - _, field := ident.Obj.Decl.(*ast.Field) - if variable && field { - // check if the variable exist in the scope - vv, vvok := obj.(*types.Var) - - if vvok && vv.Parent().Lookup(ident.Name) == nil { - return c.NewIssue(n, r.ID(), "Subprocess launched with variable", issue.Medium, issue.High), nil - } - } - case *ast.ValueSpec: - _, valueSpec := ident.Obj.Decl.(*ast.ValueSpec) - if variable && valueSpec { - if !gosec.TryResolve(ident, c) { - return c.NewIssue(n, r.ID(), "Subprocess launched with variable", issue.Medium, issue.High), nil - } - } - } - } - } else if !gosec.TryResolve(arg, c) { - // the arg is not a constant or a variable but instead a function call or os.Args[i] - return c.NewIssue(n, r.ID(), "Subprocess launched with a potential tainted input or cmd arguments", issue.Medium, issue.High), nil - } - } - } - return nil, nil -} - -// isContext checks whether or not the node is a CommandContext call or not -// This is required in order to skip the first argument from the check. -func (r *subprocess) isContext(n ast.Node, ctx *gosec.Context) bool { - selector, indent, err := gosec.GetCallInfo(n, ctx) - if err != nil { - return false - } - if selector == "exec" && indent == "CommandContext" { - return true - } - return false -} - -// NewSubproc detects cases where we are forking out to an external process -func NewSubproc(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - rule := &subprocess{issue.MetaData{ID: id}, gosec.NewCallList()} - rule.Add("os/exec", "Command") - rule.Add("os/exec", "CommandContext") - rule.Add("syscall", "Exec") - rule.Add("syscall", "ForkExec") - rule.Add("syscall", "StartProcess") - rule.Add("golang.org/x/sys/execabs", "Command") - rule.Add("golang.org/x/sys/execabs", "CommandContext") - return rule, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/tempfiles.go b/vendor/github.com/securego/gosec/v2/rules/tempfiles.go deleted file mode 100644 index 6fef52a2cb..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/tempfiles.go +++ /dev/null @@ -1,88 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - "regexp" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type badTempFile struct { - issue.MetaData - calls gosec.CallList - args *regexp.Regexp - argCalls gosec.CallList - nestedCalls gosec.CallList -} - -func (t *badTempFile) ID() string { - return t.MetaData.ID -} - -func (t *badTempFile) findTempDirArgs(n ast.Node, c *gosec.Context, suspect ast.Node) *issue.Issue { - if s, e := gosec.GetString(suspect); e == nil { - if t.args.MatchString(s) { - return c.NewIssue(n, t.ID(), t.What, t.Severity, t.Confidence) - } - return nil - } - if ce := t.argCalls.ContainsPkgCallExpr(suspect, c, false); ce != nil { - return c.NewIssue(n, t.ID(), t.What, t.Severity, t.Confidence) - } - if be, ok := suspect.(*ast.BinaryExpr); ok { - if ops := gosec.GetBinaryExprOperands(be); len(ops) != 0 { - return t.findTempDirArgs(n, c, ops[0]) - } - return nil - } - if ce := t.nestedCalls.ContainsPkgCallExpr(suspect, c, false); ce != nil { - return t.findTempDirArgs(n, c, ce.Args[0]) - } - return nil -} - -func (t *badTempFile) Match(n ast.Node, c *gosec.Context) (gi *issue.Issue, err error) { - if node := t.calls.ContainsPkgCallExpr(n, c, false); node != nil { - return t.findTempDirArgs(n, c, node.Args[0]), nil - } - return nil, nil -} - -// NewBadTempFile detects direct writes to predictable path in temporary directory -func NewBadTempFile(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("io/ioutil", "WriteFile") - calls.AddAll("os", "Create", "WriteFile") - argCalls := gosec.NewCallList() - argCalls.Add("os", "TempDir") - nestedCalls := gosec.NewCallList() - nestedCalls.Add("path", "Join") - nestedCalls.Add("path/filepath", "Join") - return &badTempFile{ - calls: calls, - args: regexp.MustCompile(`^(/(usr|var))?/tmp(/.*)?$`), - argCalls: argCalls, - nestedCalls: nestedCalls, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "File creation in shared tmp directory without using ioutil.Tempfile", - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/templates.go b/vendor/github.com/securego/gosec/v2/rules/templates.go deleted file mode 100644 index 728766f457..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/templates.go +++ /dev/null @@ -1,61 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type templateCheck struct { - issue.MetaData - calls gosec.CallList -} - -func (t *templateCheck) ID() string { - return t.MetaData.ID -} - -func (t *templateCheck) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if node := t.calls.ContainsPkgCallExpr(n, c, false); node != nil { - for _, arg := range node.Args { - if _, ok := arg.(*ast.BasicLit); !ok { // basic lits are safe - return c.NewIssue(n, t.ID(), t.What, t.Severity, t.Confidence), nil - } - } - } - return nil, nil -} - -// NewTemplateCheck constructs the template check rule. This rule is used to -// find use of templates where HTML/JS escaping is not being used -func NewTemplateCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := gosec.NewCallList() - calls.Add("html/template", "HTML") - calls.Add("html/template", "HTMLAttr") - calls.Add("html/template", "JS") - calls.Add("html/template", "URL") - return &templateCheck{ - calls: calls, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.Low, - What: "The used method does not auto-escape HTML. This can potentially lead to 'Cross-site Scripting' vulnerabilities, in case the attacker controls the input.", - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/tls.go b/vendor/github.com/securego/gosec/v2/rules/tls.go deleted file mode 100644 index 65a0b5a33a..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/tls.go +++ /dev/null @@ -1,239 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:generate tlsconfig - -package rules - -import ( - "crypto/tls" - "fmt" - "go/ast" - "go/types" - "strconv" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type insecureConfigTLS struct { - issue.MetaData - MinVersion int64 - MaxVersion int64 - requiredType string - goodCiphers []string - actualMinVersion int64 - actualMaxVersion int64 -} - -func (t *insecureConfigTLS) ID() string { - return t.MetaData.ID -} - -func stringInSlice(a string, list []string) bool { - for _, b := range list { - if b == a { - return true - } - } - return false -} - -func (t *insecureConfigTLS) processTLSCipherSuites(n ast.Node, c *gosec.Context) *issue.Issue { - if ciphers, ok := n.(*ast.CompositeLit); ok { - for _, cipher := range ciphers.Elts { - if ident, ok := cipher.(*ast.SelectorExpr); ok { - if !stringInSlice(ident.Sel.Name, t.goodCiphers) { - err := fmt.Sprintf("TLS Bad Cipher Suite: %s", ident.Sel.Name) - return c.NewIssue(ident, t.ID(), err, issue.High, issue.High) - } - } - } - } - return nil -} - -func (t *insecureConfigTLS) processTLSConf(n ast.Node, c *gosec.Context) *issue.Issue { - if kve, ok := n.(*ast.KeyValueExpr); ok { - issue := t.processTLSConfVal(kve.Key, kve.Value, c) - if issue != nil { - return issue - } - } else if assign, ok := n.(*ast.AssignStmt); ok { - if len(assign.Lhs) < 1 || len(assign.Rhs) < 1 { - return nil - } - if selector, ok := assign.Lhs[0].(*ast.SelectorExpr); ok { - issue := t.processTLSConfVal(selector.Sel, assign.Rhs[0], c) - if issue != nil { - return issue - } - } - } - return nil -} - -func (t *insecureConfigTLS) processTLSConfVal(key ast.Expr, value ast.Expr, c *gosec.Context) *issue.Issue { - if ident, ok := key.(*ast.Ident); ok { - switch ident.Name { - case "InsecureSkipVerify": - if node, ok := value.(*ast.Ident); ok { - if node.Name != "false" { - return c.NewIssue(value, t.ID(), "TLS InsecureSkipVerify set true.", issue.High, issue.High) - } - } else { - // TODO(tk): symbol tab look up to get the actual value - return c.NewIssue(value, t.ID(), "TLS InsecureSkipVerify may be true.", issue.High, issue.Low) - } - - case "PreferServerCipherSuites": - if node, ok := value.(*ast.Ident); ok { - if node.Name == "false" { - return c.NewIssue(value, t.ID(), "TLS PreferServerCipherSuites set false.", issue.Medium, issue.High) - } - } else { - // TODO(tk): symbol tab look up to get the actual value - return c.NewIssue(value, t.ID(), "TLS PreferServerCipherSuites may be false.", issue.Medium, issue.Low) - } - - case "MinVersion": - if d, ok := value.(*ast.Ident); ok { - obj := d.Obj - if obj == nil { - for _, f := range c.PkgFiles { - obj = f.Scope.Lookup(d.Name) - if obj != nil { - break - } - } - } - if vs, ok := obj.Decl.(*ast.ValueSpec); ok && len(vs.Values) > 0 { - if s, ok := vs.Values[0].(*ast.SelectorExpr); ok { - x := s.X.(*ast.Ident).Name - sel := s.Sel.Name - - for _, imp := range c.Pkg.Imports() { - if imp.Name() == x { - tObj := imp.Scope().Lookup(sel) - if cst, ok := tObj.(*types.Const); ok { - // ..got the value check if this can be translated - if minVersion, err := strconv.ParseInt(cst.Val().String(), 0, 64); err == nil { - t.actualMinVersion = minVersion - } - } - } - } - } - if ival, ierr := gosec.GetInt(vs.Values[0]); ierr == nil { - t.actualMinVersion = ival - } - } - } else if ival, ierr := gosec.GetInt(value); ierr == nil { - t.actualMinVersion = ival - } else { - if se, ok := value.(*ast.SelectorExpr); ok { - if pkg, ok := se.X.(*ast.Ident); ok { - if ip, ok := gosec.GetImportPath(pkg.Name, c); ok && ip == "crypto/tls" { - t.actualMinVersion = t.mapVersion(se.Sel.Name) - } - } - } - } - - case "MaxVersion": - if ival, ierr := gosec.GetInt(value); ierr == nil { - t.actualMaxVersion = ival - } else { - if se, ok := value.(*ast.SelectorExpr); ok { - if pkg, ok := se.X.(*ast.Ident); ok { - if ip, ok := gosec.GetImportPath(pkg.Name, c); ok && ip == "crypto/tls" { - t.actualMaxVersion = t.mapVersion(se.Sel.Name) - } - } - } - } - - case "CipherSuites": - if ret := t.processTLSCipherSuites(value, c); ret != nil { - return ret - } - - } - } - return nil -} - -func (t *insecureConfigTLS) mapVersion(version string) int64 { - var v int64 - switch version { - case "VersionTLS13": - v = tls.VersionTLS13 - case "VersionTLS12": - v = tls.VersionTLS12 - case "VersionTLS11": - v = tls.VersionTLS11 - case "VersionTLS10": - v = tls.VersionTLS10 - } - return v -} - -func (t *insecureConfigTLS) checkVersion(n ast.Node, c *gosec.Context) *issue.Issue { - if t.actualMaxVersion == 0 && t.actualMinVersion >= t.MinVersion { - // no warning is generated since the min version is greater than the secure min version - return nil - } - if t.actualMinVersion < t.MinVersion { - return c.NewIssue(n, t.ID(), "TLS MinVersion too low.", issue.High, issue.High) - } - if t.actualMaxVersion < t.MaxVersion { - return c.NewIssue(n, t.ID(), "TLS MaxVersion too low.", issue.High, issue.High) - } - return nil -} - -func (t *insecureConfigTLS) resetVersion() { - t.actualMaxVersion = 0 - t.actualMinVersion = 0 -} - -func (t *insecureConfigTLS) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - if complit, ok := n.(*ast.CompositeLit); ok && complit.Type != nil { - actualType := c.Info.TypeOf(complit.Type) - if actualType != nil && actualType.String() == t.requiredType { - for _, elt := range complit.Elts { - issue := t.processTLSConf(elt, c) - if issue != nil { - return issue, nil - } - } - issue := t.checkVersion(complit, c) - t.resetVersion() - return issue, nil - } - } else { - if assign, ok := n.(*ast.AssignStmt); ok && len(assign.Lhs) > 0 { - if selector, ok := assign.Lhs[0].(*ast.SelectorExpr); ok { - actualType := c.Info.TypeOf(selector.X) - if actualType != nil && actualType.String() == t.requiredType { - issue := t.processTLSConf(assign, c) - if issue != nil { - return issue, nil - } - } - } - } - } - return nil, nil -} diff --git a/vendor/github.com/securego/gosec/v2/rules/tls_config.go b/vendor/github.com/securego/gosec/v2/rules/tls_config.go deleted file mode 100644 index cbbdf7983a..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/tls_config.go +++ /dev/null @@ -1,93 +0,0 @@ -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -// NewModernTLSCheck creates a check for Modern TLS ciphers -// DO NOT EDIT - generated by tlsconfig tool -func NewModernTLSCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &insecureConfigTLS{ - MetaData: issue.MetaData{ID: id}, - requiredType: "crypto/tls.Config", - MinVersion: 0x0304, - MaxVersion: 0x0304, - goodCiphers: []string{ - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - }, - }, []ast.Node{(*ast.CompositeLit)(nil), (*ast.AssignStmt)(nil)} -} - -// NewIntermediateTLSCheck creates a check for Intermediate TLS ciphers -// DO NOT EDIT - generated by tlsconfig tool -func NewIntermediateTLSCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &insecureConfigTLS{ - MetaData: issue.MetaData{ID: id}, - requiredType: "crypto/tls.Config", - MinVersion: 0x0303, - MaxVersion: 0x0304, - goodCiphers: []string{ - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", - }, - }, []ast.Node{(*ast.CompositeLit)(nil), (*ast.AssignStmt)(nil)} -} - -// NewOldTLSCheck creates a check for Old TLS ciphers -// DO NOT EDIT - generated by tlsconfig tool -func NewOldTLSCheck(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &insecureConfigTLS{ - MetaData: issue.MetaData{ID: id}, - requiredType: "crypto/tls.Config", - MinVersion: 0x0301, - MaxVersion: 0x0304, - goodCiphers: []string{ - "TLS_AES_128_GCM_SHA256", - "TLS_AES_256_GCM_SHA384", - "TLS_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256", - "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", - "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", - "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", - "TLS_RSA_WITH_AES_128_GCM_SHA256", - "TLS_RSA_WITH_AES_256_GCM_SHA384", - "TLS_RSA_WITH_AES_128_CBC_SHA256", - "TLS_RSA_WITH_AES_256_CBC_SHA256", - "TLS_RSA_WITH_AES_128_CBC_SHA", - "TLS_RSA_WITH_AES_256_CBC_SHA", - "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - }, - }, []ast.Node{(*ast.CompositeLit)(nil), (*ast.AssignStmt)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/unsafe.go b/vendor/github.com/securego/gosec/v2/rules/unsafe.go deleted file mode 100644 index 2e2adca7c7..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/unsafe.go +++ /dev/null @@ -1,54 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type usingUnsafe struct { - issue.MetaData - pkg string - calls []string -} - -func (r *usingUnsafe) ID() string { - return r.MetaData.ID -} - -func (r *usingUnsafe) Match(n ast.Node, c *gosec.Context) (gi *issue.Issue, err error) { - if _, matches := gosec.MatchCallByPackage(n, c, r.pkg, r.calls...); matches { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - return nil, nil -} - -// NewUsingUnsafe rule detects the use of the unsafe package. This is only -// really useful for auditing purposes. -func NewUsingUnsafe(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - return &usingUnsafe{ - pkg: "unsafe", - calls: []string{"Pointer", "String", "StringData", "Slice", "SliceData"}, - MetaData: issue.MetaData{ - ID: id, - What: "Use of unsafe calls should be audited", - Severity: issue.Low, - Confidence: issue.High, - }, - }, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/securego/gosec/v2/rules/weakcrypto.go b/vendor/github.com/securego/gosec/v2/rules/weakcrypto.go deleted file mode 100644 index 4f2ab11d15..0000000000 --- a/vendor/github.com/securego/gosec/v2/rules/weakcrypto.go +++ /dev/null @@ -1,59 +0,0 @@ -// (c) Copyright 2016 Hewlett Packard Enterprise Development LP -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package rules - -import ( - "go/ast" - - "github.com/securego/gosec/v2" - "github.com/securego/gosec/v2/issue" -) - -type usesWeakCryptography struct { - issue.MetaData - blocklist map[string][]string -} - -func (r *usesWeakCryptography) ID() string { - return r.MetaData.ID -} - -func (r *usesWeakCryptography) Match(n ast.Node, c *gosec.Context) (*issue.Issue, error) { - for pkg, funcs := range r.blocklist { - if _, matched := gosec.MatchCallByPackage(n, c, pkg, funcs...); matched { - return c.NewIssue(n, r.ID(), r.What, r.Severity, r.Confidence), nil - } - } - return nil, nil -} - -// NewUsesWeakCryptography detects uses of des.* md5.* or rc4.* -func NewUsesWeakCryptography(id string, _ gosec.Config) (gosec.Rule, []ast.Node) { - calls := make(map[string][]string) - calls["crypto/des"] = []string{"NewCipher", "NewTripleDESCipher"} - calls["crypto/md5"] = []string{"New", "Sum"} - calls["crypto/sha1"] = []string{"New", "Sum"} - calls["crypto/rc4"] = []string{"NewCipher"} - rule := &usesWeakCryptography{ - blocklist: calls, - MetaData: issue.MetaData{ - ID: id, - Severity: issue.Medium, - Confidence: issue.High, - What: "Use of weak cryptographic primitive", - }, - } - return rule, []ast.Node{(*ast.CallExpr)(nil)} -} diff --git a/vendor/github.com/sergi/go-diff/AUTHORS b/vendor/github.com/sergi/go-diff/AUTHORS deleted file mode 100644 index 2d7bb2bf57..0000000000 --- a/vendor/github.com/sergi/go-diff/AUTHORS +++ /dev/null @@ -1,25 +0,0 @@ -# This is the official list of go-diff authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Danny Yoo -James Kolb -Jonathan Amsterdam -Markus Zimmermann -Matt Kovars -Örjan Persson -Osman Masood -Robert Carlsen -Rory Flynn -Sergi Mansilla -Shatrugna Sadhu -Shawn Smith -Stas Maksimov -Tor Arvid Lund -Zac Bergquist diff --git a/vendor/github.com/sergi/go-diff/CONTRIBUTORS b/vendor/github.com/sergi/go-diff/CONTRIBUTORS deleted file mode 100644 index 369e3d5519..0000000000 --- a/vendor/github.com/sergi/go-diff/CONTRIBUTORS +++ /dev/null @@ -1,32 +0,0 @@ -# This is the official list of people who can contribute -# (and typically have contributed) code to the go-diff -# repository. -# -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, ACME Inc. employees would be listed here -# but not in AUTHORS, because ACME Inc. would hold the copyright. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file. -# -# Names should be added to this file like so: -# Name -# -# Please keep the list sorted. - -Danny Yoo -James Kolb -Jonathan Amsterdam -Markus Zimmermann -Matt Kovars -Örjan Persson -Osman Masood -Robert Carlsen -Rory Flynn -Sergi Mansilla -Shatrugna Sadhu -Shawn Smith -Stas Maksimov -Tor Arvid Lund -Zac Bergquist diff --git a/vendor/github.com/sergi/go-diff/LICENSE b/vendor/github.com/sergi/go-diff/LICENSE deleted file mode 100644 index 937942c2b2..0000000000 --- a/vendor/github.com/sergi/go-diff/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2012-2016 The go-diff Authors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go deleted file mode 100644 index 4f7b42488a..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/diff.go +++ /dev/null @@ -1,1352 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "bytes" - "errors" - "fmt" - "html" - "math" - "net/url" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" -) - -// Operation defines the operation of a diff item. -type Operation int8 - -//go:generate stringer -type=Operation -trimprefix=Diff - -const ( - // DiffDelete item represents a delete diff. - DiffDelete Operation = -1 - // DiffInsert item represents an insert diff. - DiffInsert Operation = 1 - // DiffEqual item represents an equal diff. - DiffEqual Operation = 0 - //IndexSeparator is used to seperate the array indexes in an index string - IndexSeparator = "," -) - -// Diff represents one diff operation -type Diff struct { - Type Operation - Text string -} - -// splice removes amount elements from slice at index index, replacing them with elements. -func splice(slice []Diff, index int, amount int, elements ...Diff) []Diff { - if len(elements) == amount { - // Easy case: overwrite the relevant items. - copy(slice[index:], elements) - return slice - } - if len(elements) < amount { - // Fewer new items than old. - // Copy in the new items. - copy(slice[index:], elements) - // Shift the remaining items left. - copy(slice[index+len(elements):], slice[index+amount:]) - // Calculate the new end of the slice. - end := len(slice) - amount + len(elements) - // Zero stranded elements at end so that they can be garbage collected. - tail := slice[end:] - for i := range tail { - tail[i] = Diff{} - } - return slice[:end] - } - // More new items than old. - // Make room in slice for new elements. - // There's probably an even more efficient way to do this, - // but this is simple and clear. - need := len(slice) - amount + len(elements) - for len(slice) < need { - slice = append(slice, Diff{}) - } - // Shift slice elements right to make room for new elements. - copy(slice[index+len(elements):], slice[index+amount:]) - // Copy in new elements. - copy(slice[index:], elements) - return slice -} - -// DiffMain finds the differences between two texts. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -func (dmp *DiffMatchPatch) DiffMain(text1, text2 string, checklines bool) []Diff { - return dmp.DiffMainRunes([]rune(text1), []rune(text2), checklines) -} - -// DiffMainRunes finds the differences between two rune sequences. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -func (dmp *DiffMatchPatch) DiffMainRunes(text1, text2 []rune, checklines bool) []Diff { - var deadline time.Time - if dmp.DiffTimeout > 0 { - deadline = time.Now().Add(dmp.DiffTimeout) - } - return dmp.diffMainRunes(text1, text2, checklines, deadline) -} - -func (dmp *DiffMatchPatch) diffMainRunes(text1, text2 []rune, checklines bool, deadline time.Time) []Diff { - if runesEqual(text1, text2) { - var diffs []Diff - if len(text1) > 0 { - diffs = append(diffs, Diff{DiffEqual, string(text1)}) - } - return diffs - } - // Trim off common prefix (speedup). - commonlength := commonPrefixLength(text1, text2) - commonprefix := text1[:commonlength] - text1 = text1[commonlength:] - text2 = text2[commonlength:] - - // Trim off common suffix (speedup). - commonlength = commonSuffixLength(text1, text2) - commonsuffix := text1[len(text1)-commonlength:] - text1 = text1[:len(text1)-commonlength] - text2 = text2[:len(text2)-commonlength] - - // Compute the diff on the middle block. - diffs := dmp.diffCompute(text1, text2, checklines, deadline) - - // Restore the prefix and suffix. - if len(commonprefix) != 0 { - diffs = append([]Diff{{DiffEqual, string(commonprefix)}}, diffs...) - } - if len(commonsuffix) != 0 { - diffs = append(diffs, Diff{DiffEqual, string(commonsuffix)}) - } - - return dmp.DiffCleanupMerge(diffs) -} - -// diffCompute finds the differences between two rune slices. Assumes that the texts do not have any common prefix or suffix. -func (dmp *DiffMatchPatch) diffCompute(text1, text2 []rune, checklines bool, deadline time.Time) []Diff { - diffs := []Diff{} - if len(text1) == 0 { - // Just add some text (speedup). - return append(diffs, Diff{DiffInsert, string(text2)}) - } else if len(text2) == 0 { - // Just delete some text (speedup). - return append(diffs, Diff{DiffDelete, string(text1)}) - } - - var longtext, shorttext []rune - if len(text1) > len(text2) { - longtext = text1 - shorttext = text2 - } else { - longtext = text2 - shorttext = text1 - } - - if i := runesIndex(longtext, shorttext); i != -1 { - op := DiffInsert - // Swap insertions for deletions if diff is reversed. - if len(text1) > len(text2) { - op = DiffDelete - } - // Shorter text is inside the longer text (speedup). - return []Diff{ - Diff{op, string(longtext[:i])}, - Diff{DiffEqual, string(shorttext)}, - Diff{op, string(longtext[i+len(shorttext):])}, - } - } else if len(shorttext) == 1 { - // Single character string. - // After the previous speedup, the character can't be an equality. - return []Diff{ - {DiffDelete, string(text1)}, - {DiffInsert, string(text2)}, - } - // Check to see if the problem can be split in two. - } else if hm := dmp.diffHalfMatch(text1, text2); hm != nil { - // A half-match was found, sort out the return data. - text1A := hm[0] - text1B := hm[1] - text2A := hm[2] - text2B := hm[3] - midCommon := hm[4] - // Send both pairs off for separate processing. - diffsA := dmp.diffMainRunes(text1A, text2A, checklines, deadline) - diffsB := dmp.diffMainRunes(text1B, text2B, checklines, deadline) - // Merge the results. - diffs := diffsA - diffs = append(diffs, Diff{DiffEqual, string(midCommon)}) - diffs = append(diffs, diffsB...) - return diffs - } else if checklines && len(text1) > 100 && len(text2) > 100 { - return dmp.diffLineMode(text1, text2, deadline) - } - return dmp.diffBisect(text1, text2, deadline) -} - -// diffLineMode does a quick line-level diff on both []runes, then rediff the parts for greater accuracy. This speedup can produce non-minimal diffs. -func (dmp *DiffMatchPatch) diffLineMode(text1, text2 []rune, deadline time.Time) []Diff { - // Scan the text on a line-by-line basis first. - text1, text2, linearray := dmp.DiffLinesToRunes(string(text1), string(text2)) - - diffs := dmp.diffMainRunes(text1, text2, false, deadline) - - // Convert the diff back to original text. - diffs = dmp.DiffCharsToLines(diffs, linearray) - // Eliminate freak matches (e.g. blank lines) - diffs = dmp.DiffCleanupSemantic(diffs) - - // Rediff any replacement blocks, this time character-by-character. - // Add a dummy entry at the end. - diffs = append(diffs, Diff{DiffEqual, ""}) - - pointer := 0 - countDelete := 0 - countInsert := 0 - - // NOTE: Rune slices are slower than using strings in this case. - textDelete := "" - textInsert := "" - - for pointer < len(diffs) { - switch diffs[pointer].Type { - case DiffInsert: - countInsert++ - textInsert += diffs[pointer].Text - case DiffDelete: - countDelete++ - textDelete += diffs[pointer].Text - case DiffEqual: - // Upon reaching an equality, check for prior redundancies. - if countDelete >= 1 && countInsert >= 1 { - // Delete the offending records and add the merged ones. - diffs = splice(diffs, pointer-countDelete-countInsert, - countDelete+countInsert) - - pointer = pointer - countDelete - countInsert - a := dmp.diffMainRunes([]rune(textDelete), []rune(textInsert), false, deadline) - for j := len(a) - 1; j >= 0; j-- { - diffs = splice(diffs, pointer, 0, a[j]) - } - pointer = pointer + len(a) - } - - countInsert = 0 - countDelete = 0 - textDelete = "" - textInsert = "" - } - pointer++ - } - - return diffs[:len(diffs)-1] // Remove the dummy entry at the end. -} - -// DiffBisect finds the 'middle snake' of a diff, split the problem in two and return the recursively constructed diff. -// If an invalid UTF-8 sequence is encountered, it will be replaced by the Unicode replacement character. -// See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. -func (dmp *DiffMatchPatch) DiffBisect(text1, text2 string, deadline time.Time) []Diff { - // Unused in this code, but retained for interface compatibility. - return dmp.diffBisect([]rune(text1), []rune(text2), deadline) -} - -// diffBisect finds the 'middle snake' of a diff, splits the problem in two and returns the recursively constructed diff. -// See Myers's 1986 paper: An O(ND) Difference Algorithm and Its Variations. -func (dmp *DiffMatchPatch) diffBisect(runes1, runes2 []rune, deadline time.Time) []Diff { - // Cache the text lengths to prevent multiple calls. - runes1Len, runes2Len := len(runes1), len(runes2) - - maxD := (runes1Len + runes2Len + 1) / 2 - vOffset := maxD - vLength := 2 * maxD - - v1 := make([]int, vLength) - v2 := make([]int, vLength) - for i := range v1 { - v1[i] = -1 - v2[i] = -1 - } - v1[vOffset+1] = 0 - v2[vOffset+1] = 0 - - delta := runes1Len - runes2Len - // If the total number of characters is odd, then the front path will collide with the reverse path. - front := (delta%2 != 0) - // Offsets for start and end of k loop. Prevents mapping of space beyond the grid. - k1start := 0 - k1end := 0 - k2start := 0 - k2end := 0 - for d := 0; d < maxD; d++ { - // Bail out if deadline is reached. - if !deadline.IsZero() && d%16 == 0 && time.Now().After(deadline) { - break - } - - // Walk the front path one step. - for k1 := -d + k1start; k1 <= d-k1end; k1 += 2 { - k1Offset := vOffset + k1 - var x1 int - - if k1 == -d || (k1 != d && v1[k1Offset-1] < v1[k1Offset+1]) { - x1 = v1[k1Offset+1] - } else { - x1 = v1[k1Offset-1] + 1 - } - - y1 := x1 - k1 - for x1 < runes1Len && y1 < runes2Len { - if runes1[x1] != runes2[y1] { - break - } - x1++ - y1++ - } - v1[k1Offset] = x1 - if x1 > runes1Len { - // Ran off the right of the graph. - k1end += 2 - } else if y1 > runes2Len { - // Ran off the bottom of the graph. - k1start += 2 - } else if front { - k2Offset := vOffset + delta - k1 - if k2Offset >= 0 && k2Offset < vLength && v2[k2Offset] != -1 { - // Mirror x2 onto top-left coordinate system. - x2 := runes1Len - v2[k2Offset] - if x1 >= x2 { - // Overlap detected. - return dmp.diffBisectSplit(runes1, runes2, x1, y1, deadline) - } - } - } - } - // Walk the reverse path one step. - for k2 := -d + k2start; k2 <= d-k2end; k2 += 2 { - k2Offset := vOffset + k2 - var x2 int - if k2 == -d || (k2 != d && v2[k2Offset-1] < v2[k2Offset+1]) { - x2 = v2[k2Offset+1] - } else { - x2 = v2[k2Offset-1] + 1 - } - var y2 = x2 - k2 - for x2 < runes1Len && y2 < runes2Len { - if runes1[runes1Len-x2-1] != runes2[runes2Len-y2-1] { - break - } - x2++ - y2++ - } - v2[k2Offset] = x2 - if x2 > runes1Len { - // Ran off the left of the graph. - k2end += 2 - } else if y2 > runes2Len { - // Ran off the top of the graph. - k2start += 2 - } else if !front { - k1Offset := vOffset + delta - k2 - if k1Offset >= 0 && k1Offset < vLength && v1[k1Offset] != -1 { - x1 := v1[k1Offset] - y1 := vOffset + x1 - k1Offset - // Mirror x2 onto top-left coordinate system. - x2 = runes1Len - x2 - if x1 >= x2 { - // Overlap detected. - return dmp.diffBisectSplit(runes1, runes2, x1, y1, deadline) - } - } - } - } - } - // Diff took too long and hit the deadline or number of diffs equals number of characters, no commonality at all. - return []Diff{ - {DiffDelete, string(runes1)}, - {DiffInsert, string(runes2)}, - } -} - -func (dmp *DiffMatchPatch) diffBisectSplit(runes1, runes2 []rune, x, y int, - deadline time.Time) []Diff { - runes1a := runes1[:x] - runes2a := runes2[:y] - runes1b := runes1[x:] - runes2b := runes2[y:] - - // Compute both diffs serially. - diffs := dmp.diffMainRunes(runes1a, runes2a, false, deadline) - diffsb := dmp.diffMainRunes(runes1b, runes2b, false, deadline) - - return append(diffs, diffsb...) -} - -// DiffLinesToChars splits two texts into a list of strings, and educes the texts to a string of hashes where each Unicode character represents one line. -// It's slightly faster to call DiffLinesToRunes first, followed by DiffMainRunes. -func (dmp *DiffMatchPatch) DiffLinesToChars(text1, text2 string) (string, string, []string) { - chars1, chars2, lineArray := dmp.diffLinesToStrings(text1, text2) - return chars1, chars2, lineArray -} - -// DiffLinesToRunes splits two texts into a list of runes. -func (dmp *DiffMatchPatch) DiffLinesToRunes(text1, text2 string) ([]rune, []rune, []string) { - chars1, chars2, lineArray := dmp.diffLinesToStrings(text1, text2) - return []rune(chars1), []rune(chars2), lineArray -} - -// DiffCharsToLines rehydrates the text in a diff from a string of line hashes to real lines of text. -func (dmp *DiffMatchPatch) DiffCharsToLines(diffs []Diff, lineArray []string) []Diff { - hydrated := make([]Diff, 0, len(diffs)) - for _, aDiff := range diffs { - chars := strings.Split(aDiff.Text, IndexSeparator) - text := make([]string, len(chars)) - - for i, r := range chars { - i1, err := strconv.Atoi(r) - if err == nil { - text[i] = lineArray[i1] - } - } - - aDiff.Text = strings.Join(text, "") - hydrated = append(hydrated, aDiff) - } - return hydrated -} - -// DiffCommonPrefix determines the common prefix length of two strings. -func (dmp *DiffMatchPatch) DiffCommonPrefix(text1, text2 string) int { - // Unused in this code, but retained for interface compatibility. - return commonPrefixLength([]rune(text1), []rune(text2)) -} - -// DiffCommonSuffix determines the common suffix length of two strings. -func (dmp *DiffMatchPatch) DiffCommonSuffix(text1, text2 string) int { - // Unused in this code, but retained for interface compatibility. - return commonSuffixLength([]rune(text1), []rune(text2)) -} - -// commonPrefixLength returns the length of the common prefix of two rune slices. -func commonPrefixLength(text1, text2 []rune) int { - // Linear search. See comment in commonSuffixLength. - n := 0 - for ; n < len(text1) && n < len(text2); n++ { - if text1[n] != text2[n] { - return n - } - } - return n -} - -// commonSuffixLength returns the length of the common suffix of two rune slices. -func commonSuffixLength(text1, text2 []rune) int { - // Use linear search rather than the binary search discussed at https://neil.fraser.name/news/2007/10/09/. - // See discussion at https://github.com/sergi/go-diff/issues/54. - i1 := len(text1) - i2 := len(text2) - for n := 0; ; n++ { - i1-- - i2-- - if i1 < 0 || i2 < 0 || text1[i1] != text2[i2] { - return n - } - } -} - -// DiffCommonOverlap determines if the suffix of one string is the prefix of another. -func (dmp *DiffMatchPatch) DiffCommonOverlap(text1 string, text2 string) int { - // Cache the text lengths to prevent multiple calls. - text1Length := len(text1) - text2Length := len(text2) - // Eliminate the null case. - if text1Length == 0 || text2Length == 0 { - return 0 - } - // Truncate the longer string. - if text1Length > text2Length { - text1 = text1[text1Length-text2Length:] - } else if text1Length < text2Length { - text2 = text2[0:text1Length] - } - textLength := int(math.Min(float64(text1Length), float64(text2Length))) - // Quick check for the worst case. - if text1 == text2 { - return textLength - } - - // Start by looking for a single character match and increase length until no match is found. Performance analysis: http://neil.fraser.name/news/2010/11/04/ - best := 0 - length := 1 - for { - pattern := text1[textLength-length:] - found := strings.Index(text2, pattern) - if found == -1 { - break - } - length += found - if found == 0 || text1[textLength-length:] == text2[0:length] { - best = length - length++ - } - } - - return best -} - -// DiffHalfMatch checks whether the two texts share a substring which is at least half the length of the longer text. This speedup can produce non-minimal diffs. -func (dmp *DiffMatchPatch) DiffHalfMatch(text1, text2 string) []string { - // Unused in this code, but retained for interface compatibility. - runeSlices := dmp.diffHalfMatch([]rune(text1), []rune(text2)) - if runeSlices == nil { - return nil - } - - result := make([]string, len(runeSlices)) - for i, r := range runeSlices { - result[i] = string(r) - } - return result -} - -func (dmp *DiffMatchPatch) diffHalfMatch(text1, text2 []rune) [][]rune { - if dmp.DiffTimeout <= 0 { - // Don't risk returning a non-optimal diff if we have unlimited time. - return nil - } - - var longtext, shorttext []rune - if len(text1) > len(text2) { - longtext = text1 - shorttext = text2 - } else { - longtext = text2 - shorttext = text1 - } - - if len(longtext) < 4 || len(shorttext)*2 < len(longtext) { - return nil // Pointless. - } - - // First check if the second quarter is the seed for a half-match. - hm1 := dmp.diffHalfMatchI(longtext, shorttext, int(float64(len(longtext)+3)/4)) - - // Check again based on the third quarter. - hm2 := dmp.diffHalfMatchI(longtext, shorttext, int(float64(len(longtext)+1)/2)) - - hm := [][]rune{} - if hm1 == nil && hm2 == nil { - return nil - } else if hm2 == nil { - hm = hm1 - } else if hm1 == nil { - hm = hm2 - } else { - // Both matched. Select the longest. - if len(hm1[4]) > len(hm2[4]) { - hm = hm1 - } else { - hm = hm2 - } - } - - // A half-match was found, sort out the return data. - if len(text1) > len(text2) { - return hm - } - - return [][]rune{hm[2], hm[3], hm[0], hm[1], hm[4]} -} - -// diffHalfMatchI checks if a substring of shorttext exist within longtext such that the substring is at least half the length of longtext? -// Returns a slice containing the prefix of longtext, the suffix of longtext, the prefix of shorttext, the suffix of shorttext and the common middle, or null if there was no match. -func (dmp *DiffMatchPatch) diffHalfMatchI(l, s []rune, i int) [][]rune { - var bestCommonA []rune - var bestCommonB []rune - var bestCommonLen int - var bestLongtextA []rune - var bestLongtextB []rune - var bestShorttextA []rune - var bestShorttextB []rune - - // Start with a 1/4 length substring at position i as a seed. - seed := l[i : i+len(l)/4] - - for j := runesIndexOf(s, seed, 0); j != -1; j = runesIndexOf(s, seed, j+1) { - prefixLength := commonPrefixLength(l[i:], s[j:]) - suffixLength := commonSuffixLength(l[:i], s[:j]) - - if bestCommonLen < suffixLength+prefixLength { - bestCommonA = s[j-suffixLength : j] - bestCommonB = s[j : j+prefixLength] - bestCommonLen = len(bestCommonA) + len(bestCommonB) - bestLongtextA = l[:i-suffixLength] - bestLongtextB = l[i+prefixLength:] - bestShorttextA = s[:j-suffixLength] - bestShorttextB = s[j+prefixLength:] - } - } - - if bestCommonLen*2 < len(l) { - return nil - } - - return [][]rune{ - bestLongtextA, - bestLongtextB, - bestShorttextA, - bestShorttextB, - append(bestCommonA, bestCommonB...), - } -} - -// DiffCleanupSemantic reduces the number of edits by eliminating semantically trivial equalities. -func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff { - changes := false - // Stack of indices where equalities are found. - equalities := make([]int, 0, len(diffs)) - - var lastequality string - // Always equal to diffs[equalities[equalitiesLength - 1]][1] - var pointer int // Index of current position. - // Number of characters that changed prior to the equality. - var lengthInsertions1, lengthDeletions1 int - // Number of characters that changed after the equality. - var lengthInsertions2, lengthDeletions2 int - - for pointer < len(diffs) { - if diffs[pointer].Type == DiffEqual { - // Equality found. - equalities = append(equalities, pointer) - lengthInsertions1 = lengthInsertions2 - lengthDeletions1 = lengthDeletions2 - lengthInsertions2 = 0 - lengthDeletions2 = 0 - lastequality = diffs[pointer].Text - } else { - // An insertion or deletion. - - if diffs[pointer].Type == DiffInsert { - lengthInsertions2 += utf8.RuneCountInString(diffs[pointer].Text) - } else { - lengthDeletions2 += utf8.RuneCountInString(diffs[pointer].Text) - } - // Eliminate an equality that is smaller or equal to the edits on both sides of it. - difference1 := int(math.Max(float64(lengthInsertions1), float64(lengthDeletions1))) - difference2 := int(math.Max(float64(lengthInsertions2), float64(lengthDeletions2))) - if utf8.RuneCountInString(lastequality) > 0 && - (utf8.RuneCountInString(lastequality) <= difference1) && - (utf8.RuneCountInString(lastequality) <= difference2) { - // Duplicate record. - insPoint := equalities[len(equalities)-1] - diffs = splice(diffs, insPoint, 0, Diff{DiffDelete, lastequality}) - - // Change second copy to insert. - diffs[insPoint+1].Type = DiffInsert - // Throw away the equality we just deleted. - equalities = equalities[:len(equalities)-1] - - if len(equalities) > 0 { - equalities = equalities[:len(equalities)-1] - } - pointer = -1 - if len(equalities) > 0 { - pointer = equalities[len(equalities)-1] - } - - lengthInsertions1 = 0 // Reset the counters. - lengthDeletions1 = 0 - lengthInsertions2 = 0 - lengthDeletions2 = 0 - lastequality = "" - changes = true - } - } - pointer++ - } - - // Normalize the diff. - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - diffs = dmp.DiffCleanupSemanticLossless(diffs) - // Find any overlaps between deletions and insertions. - // e.g: abcxxxxxxdef - // -> abcxxxdef - // e.g: xxxabcdefxxx - // -> defxxxabc - // Only extract an overlap if it is as big as the edit ahead or behind it. - pointer = 1 - for pointer < len(diffs) { - if diffs[pointer-1].Type == DiffDelete && - diffs[pointer].Type == DiffInsert { - deletion := diffs[pointer-1].Text - insertion := diffs[pointer].Text - overlapLength1 := dmp.DiffCommonOverlap(deletion, insertion) - overlapLength2 := dmp.DiffCommonOverlap(insertion, deletion) - if overlapLength1 >= overlapLength2 { - if float64(overlapLength1) >= float64(utf8.RuneCountInString(deletion))/2 || - float64(overlapLength1) >= float64(utf8.RuneCountInString(insertion))/2 { - - // Overlap found. Insert an equality and trim the surrounding edits. - diffs = splice(diffs, pointer, 0, Diff{DiffEqual, insertion[:overlapLength1]}) - diffs[pointer-1].Text = - deletion[0 : len(deletion)-overlapLength1] - diffs[pointer+1].Text = insertion[overlapLength1:] - pointer++ - } - } else { - if float64(overlapLength2) >= float64(utf8.RuneCountInString(deletion))/2 || - float64(overlapLength2) >= float64(utf8.RuneCountInString(insertion))/2 { - // Reverse overlap found. Insert an equality and swap and trim the surrounding edits. - overlap := Diff{DiffEqual, deletion[:overlapLength2]} - diffs = splice(diffs, pointer, 0, overlap) - diffs[pointer-1].Type = DiffInsert - diffs[pointer-1].Text = insertion[0 : len(insertion)-overlapLength2] - diffs[pointer+1].Type = DiffDelete - diffs[pointer+1].Text = deletion[overlapLength2:] - pointer++ - } - } - pointer++ - } - pointer++ - } - - return diffs -} - -// Define some regex patterns for matching boundaries. -var ( - nonAlphaNumericRegex = regexp.MustCompile(`[^a-zA-Z0-9]`) - whitespaceRegex = regexp.MustCompile(`\s`) - linebreakRegex = regexp.MustCompile(`[\r\n]`) - blanklineEndRegex = regexp.MustCompile(`\n\r?\n$`) - blanklineStartRegex = regexp.MustCompile(`^\r?\n\r?\n`) -) - -// diffCleanupSemanticScore computes a score representing whether the internal boundary falls on logical boundaries. -// Scores range from 6 (best) to 0 (worst). Closure, but does not reference any external variables. -func diffCleanupSemanticScore(one, two string) int { - if len(one) == 0 || len(two) == 0 { - // Edges are the best. - return 6 - } - - // Each port of this function behaves slightly differently due to subtle differences in each language's definition of things like 'whitespace'. Since this function's purpose is largely cosmetic, the choice has been made to use each language's native features rather than force total conformity. - rune1, _ := utf8.DecodeLastRuneInString(one) - rune2, _ := utf8.DecodeRuneInString(two) - char1 := string(rune1) - char2 := string(rune2) - - nonAlphaNumeric1 := nonAlphaNumericRegex.MatchString(char1) - nonAlphaNumeric2 := nonAlphaNumericRegex.MatchString(char2) - whitespace1 := nonAlphaNumeric1 && whitespaceRegex.MatchString(char1) - whitespace2 := nonAlphaNumeric2 && whitespaceRegex.MatchString(char2) - lineBreak1 := whitespace1 && linebreakRegex.MatchString(char1) - lineBreak2 := whitespace2 && linebreakRegex.MatchString(char2) - blankLine1 := lineBreak1 && blanklineEndRegex.MatchString(one) - blankLine2 := lineBreak2 && blanklineEndRegex.MatchString(two) - - if blankLine1 || blankLine2 { - // Five points for blank lines. - return 5 - } else if lineBreak1 || lineBreak2 { - // Four points for line breaks. - return 4 - } else if nonAlphaNumeric1 && !whitespace1 && whitespace2 { - // Three points for end of sentences. - return 3 - } else if whitespace1 || whitespace2 { - // Two points for whitespace. - return 2 - } else if nonAlphaNumeric1 || nonAlphaNumeric2 { - // One point for non-alphanumeric. - return 1 - } - return 0 -} - -// DiffCleanupSemanticLossless looks for single edits surrounded on both sides by equalities which can be shifted sideways to align the edit to a word boundary. -// E.g: The cat came. -> The cat came. -func (dmp *DiffMatchPatch) DiffCleanupSemanticLossless(diffs []Diff) []Diff { - pointer := 1 - - // Intentionally ignore the first and last element (don't need checking). - for pointer < len(diffs)-1 { - if diffs[pointer-1].Type == DiffEqual && - diffs[pointer+1].Type == DiffEqual { - - // This is a single edit surrounded by equalities. - equality1 := diffs[pointer-1].Text - edit := diffs[pointer].Text - equality2 := diffs[pointer+1].Text - - // First, shift the edit as far left as possible. - commonOffset := dmp.DiffCommonSuffix(equality1, edit) - if commonOffset > 0 { - commonString := edit[len(edit)-commonOffset:] - equality1 = equality1[0 : len(equality1)-commonOffset] - edit = commonString + edit[:len(edit)-commonOffset] - equality2 = commonString + equality2 - } - - // Second, step character by character right, looking for the best fit. - bestEquality1 := equality1 - bestEdit := edit - bestEquality2 := equality2 - bestScore := diffCleanupSemanticScore(equality1, edit) + - diffCleanupSemanticScore(edit, equality2) - - for len(edit) != 0 && len(equality2) != 0 { - _, sz := utf8.DecodeRuneInString(edit) - if len(equality2) < sz || edit[:sz] != equality2[:sz] { - break - } - equality1 += edit[:sz] - edit = edit[sz:] + equality2[:sz] - equality2 = equality2[sz:] - score := diffCleanupSemanticScore(equality1, edit) + - diffCleanupSemanticScore(edit, equality2) - // The >= encourages trailing rather than leading whitespace on edits. - if score >= bestScore { - bestScore = score - bestEquality1 = equality1 - bestEdit = edit - bestEquality2 = equality2 - } - } - - if diffs[pointer-1].Text != bestEquality1 { - // We have an improvement, save it back to the diff. - if len(bestEquality1) != 0 { - diffs[pointer-1].Text = bestEquality1 - } else { - diffs = splice(diffs, pointer-1, 1) - pointer-- - } - - diffs[pointer].Text = bestEdit - if len(bestEquality2) != 0 { - diffs[pointer+1].Text = bestEquality2 - } else { - diffs = append(diffs[:pointer+1], diffs[pointer+2:]...) - pointer-- - } - } - } - pointer++ - } - - return diffs -} - -// DiffCleanupEfficiency reduces the number of edits by eliminating operationally trivial equalities. -func (dmp *DiffMatchPatch) DiffCleanupEfficiency(diffs []Diff) []Diff { - changes := false - // Stack of indices where equalities are found. - type equality struct { - data int - next *equality - } - var equalities *equality - // Always equal to equalities[equalitiesLength-1][1] - lastequality := "" - pointer := 0 // Index of current position. - // Is there an insertion operation before the last equality. - preIns := false - // Is there a deletion operation before the last equality. - preDel := false - // Is there an insertion operation after the last equality. - postIns := false - // Is there a deletion operation after the last equality. - postDel := false - for pointer < len(diffs) { - if diffs[pointer].Type == DiffEqual { // Equality found. - if len(diffs[pointer].Text) < dmp.DiffEditCost && - (postIns || postDel) { - // Candidate found. - equalities = &equality{ - data: pointer, - next: equalities, - } - preIns = postIns - preDel = postDel - lastequality = diffs[pointer].Text - } else { - // Not a candidate, and can never become one. - equalities = nil - lastequality = "" - } - postIns = false - postDel = false - } else { // An insertion or deletion. - if diffs[pointer].Type == DiffDelete { - postDel = true - } else { - postIns = true - } - - // Five types to be split: - // ABXYCD - // AXCD - // ABXC - // AXCD - // ABXC - var sumPres int - if preIns { - sumPres++ - } - if preDel { - sumPres++ - } - if postIns { - sumPres++ - } - if postDel { - sumPres++ - } - if len(lastequality) > 0 && - ((preIns && preDel && postIns && postDel) || - ((len(lastequality) < dmp.DiffEditCost/2) && sumPres == 3)) { - - insPoint := equalities.data - - // Duplicate record. - diffs = splice(diffs, insPoint, 0, Diff{DiffDelete, lastequality}) - - // Change second copy to insert. - diffs[insPoint+1].Type = DiffInsert - // Throw away the equality we just deleted. - equalities = equalities.next - lastequality = "" - - if preIns && preDel { - // No changes made which could affect previous entry, keep going. - postIns = true - postDel = true - equalities = nil - } else { - if equalities != nil { - equalities = equalities.next - } - if equalities != nil { - pointer = equalities.data - } else { - pointer = -1 - } - postIns = false - postDel = false - } - changes = true - } - } - pointer++ - } - - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - - return diffs -} - -// DiffCleanupMerge reorders and merges like edit sections. Merge equalities. -// Any edit section can move as long as it doesn't cross an equality. -func (dmp *DiffMatchPatch) DiffCleanupMerge(diffs []Diff) []Diff { - // Add a dummy entry at the end. - diffs = append(diffs, Diff{DiffEqual, ""}) - pointer := 0 - countDelete := 0 - countInsert := 0 - commonlength := 0 - textDelete := []rune(nil) - textInsert := []rune(nil) - - for pointer < len(diffs) { - switch diffs[pointer].Type { - case DiffInsert: - countInsert++ - textInsert = append(textInsert, []rune(diffs[pointer].Text)...) - pointer++ - break - case DiffDelete: - countDelete++ - textDelete = append(textDelete, []rune(diffs[pointer].Text)...) - pointer++ - break - case DiffEqual: - // Upon reaching an equality, check for prior redundancies. - if countDelete+countInsert > 1 { - if countDelete != 0 && countInsert != 0 { - // Factor out any common prefixies. - commonlength = commonPrefixLength(textInsert, textDelete) - if commonlength != 0 { - x := pointer - countDelete - countInsert - if x > 0 && diffs[x-1].Type == DiffEqual { - diffs[x-1].Text += string(textInsert[:commonlength]) - } else { - diffs = append([]Diff{{DiffEqual, string(textInsert[:commonlength])}}, diffs...) - pointer++ - } - textInsert = textInsert[commonlength:] - textDelete = textDelete[commonlength:] - } - // Factor out any common suffixies. - commonlength = commonSuffixLength(textInsert, textDelete) - if commonlength != 0 { - insertIndex := len(textInsert) - commonlength - deleteIndex := len(textDelete) - commonlength - diffs[pointer].Text = string(textInsert[insertIndex:]) + diffs[pointer].Text - textInsert = textInsert[:insertIndex] - textDelete = textDelete[:deleteIndex] - } - } - // Delete the offending records and add the merged ones. - if countDelete == 0 { - diffs = splice(diffs, pointer-countInsert, - countDelete+countInsert, - Diff{DiffInsert, string(textInsert)}) - } else if countInsert == 0 { - diffs = splice(diffs, pointer-countDelete, - countDelete+countInsert, - Diff{DiffDelete, string(textDelete)}) - } else { - diffs = splice(diffs, pointer-countDelete-countInsert, - countDelete+countInsert, - Diff{DiffDelete, string(textDelete)}, - Diff{DiffInsert, string(textInsert)}) - } - - pointer = pointer - countDelete - countInsert + 1 - if countDelete != 0 { - pointer++ - } - if countInsert != 0 { - pointer++ - } - } else if pointer != 0 && diffs[pointer-1].Type == DiffEqual { - // Merge this equality with the previous one. - diffs[pointer-1].Text += diffs[pointer].Text - diffs = append(diffs[:pointer], diffs[pointer+1:]...) - } else { - pointer++ - } - countInsert = 0 - countDelete = 0 - textDelete = nil - textInsert = nil - break - } - } - - if len(diffs[len(diffs)-1].Text) == 0 { - diffs = diffs[0 : len(diffs)-1] // Remove the dummy entry at the end. - } - - // Second pass: look for single edits surrounded on both sides by equalities which can be shifted sideways to eliminate an equality. E.g: ABAC -> ABAC - changes := false - pointer = 1 - // Intentionally ignore the first and last element (don't need checking). - for pointer < (len(diffs) - 1) { - if diffs[pointer-1].Type == DiffEqual && - diffs[pointer+1].Type == DiffEqual { - // This is a single edit surrounded by equalities. - if strings.HasSuffix(diffs[pointer].Text, diffs[pointer-1].Text) { - // Shift the edit over the previous equality. - diffs[pointer].Text = diffs[pointer-1].Text + - diffs[pointer].Text[:len(diffs[pointer].Text)-len(diffs[pointer-1].Text)] - diffs[pointer+1].Text = diffs[pointer-1].Text + diffs[pointer+1].Text - diffs = splice(diffs, pointer-1, 1) - changes = true - } else if strings.HasPrefix(diffs[pointer].Text, diffs[pointer+1].Text) { - // Shift the edit over the next equality. - diffs[pointer-1].Text += diffs[pointer+1].Text - diffs[pointer].Text = - diffs[pointer].Text[len(diffs[pointer+1].Text):] + diffs[pointer+1].Text - diffs = splice(diffs, pointer+1, 1) - changes = true - } - } - pointer++ - } - - // If shifts were made, the diff needs reordering and another shift sweep. - if changes { - diffs = dmp.DiffCleanupMerge(diffs) - } - - return diffs -} - -// DiffXIndex returns the equivalent location in s2. -func (dmp *DiffMatchPatch) DiffXIndex(diffs []Diff, loc int) int { - chars1 := 0 - chars2 := 0 - lastChars1 := 0 - lastChars2 := 0 - lastDiff := Diff{} - for i := 0; i < len(diffs); i++ { - aDiff := diffs[i] - if aDiff.Type != DiffInsert { - // Equality or deletion. - chars1 += len(aDiff.Text) - } - if aDiff.Type != DiffDelete { - // Equality or insertion. - chars2 += len(aDiff.Text) - } - if chars1 > loc { - // Overshot the location. - lastDiff = aDiff - break - } - lastChars1 = chars1 - lastChars2 = chars2 - } - if lastDiff.Type == DiffDelete { - // The location was deleted. - return lastChars2 - } - // Add the remaining character length. - return lastChars2 + (loc - lastChars1) -} - -// DiffPrettyHtml converts a []Diff into a pretty HTML report. -// It is intended as an example from which to write one's own display functions. -func (dmp *DiffMatchPatch) DiffPrettyHtml(diffs []Diff) string { - var buff bytes.Buffer - for _, diff := range diffs { - text := strings.Replace(html.EscapeString(diff.Text), "\n", "¶
    ", -1) - switch diff.Type { - case DiffInsert: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - case DiffDelete: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - case DiffEqual: - _, _ = buff.WriteString("") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("") - } - } - return buff.String() -} - -// DiffPrettyText converts a []Diff into a colored text report. -func (dmp *DiffMatchPatch) DiffPrettyText(diffs []Diff) string { - var buff bytes.Buffer - for _, diff := range diffs { - text := diff.Text - - switch diff.Type { - case DiffInsert: - _, _ = buff.WriteString("\x1b[32m") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("\x1b[0m") - case DiffDelete: - _, _ = buff.WriteString("\x1b[31m") - _, _ = buff.WriteString(text) - _, _ = buff.WriteString("\x1b[0m") - case DiffEqual: - _, _ = buff.WriteString(text) - } - } - - return buff.String() -} - -// DiffText1 computes and returns the source text (all equalities and deletions). -func (dmp *DiffMatchPatch) DiffText1(diffs []Diff) string { - //StringBuilder text = new StringBuilder() - var text bytes.Buffer - - for _, aDiff := range diffs { - if aDiff.Type != DiffInsert { - _, _ = text.WriteString(aDiff.Text) - } - } - return text.String() -} - -// DiffText2 computes and returns the destination text (all equalities and insertions). -func (dmp *DiffMatchPatch) DiffText2(diffs []Diff) string { - var text bytes.Buffer - - for _, aDiff := range diffs { - if aDiff.Type != DiffDelete { - _, _ = text.WriteString(aDiff.Text) - } - } - return text.String() -} - -// DiffLevenshtein computes the Levenshtein distance that is the number of inserted, deleted or substituted characters. -func (dmp *DiffMatchPatch) DiffLevenshtein(diffs []Diff) int { - levenshtein := 0 - insertions := 0 - deletions := 0 - - for _, aDiff := range diffs { - switch aDiff.Type { - case DiffInsert: - insertions += utf8.RuneCountInString(aDiff.Text) - case DiffDelete: - deletions += utf8.RuneCountInString(aDiff.Text) - case DiffEqual: - // A deletion and an insertion is one substitution. - levenshtein += max(insertions, deletions) - insertions = 0 - deletions = 0 - } - } - - levenshtein += max(insertions, deletions) - return levenshtein -} - -// DiffToDelta crushes the diff into an encoded string which describes the operations required to transform text1 into text2. -// E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'. Operations are tab-separated. Inserted text is escaped using %xx notation. -func (dmp *DiffMatchPatch) DiffToDelta(diffs []Diff) string { - var text bytes.Buffer - for _, aDiff := range diffs { - switch aDiff.Type { - case DiffInsert: - _, _ = text.WriteString("+") - _, _ = text.WriteString(strings.Replace(url.QueryEscape(aDiff.Text), "+", " ", -1)) - _, _ = text.WriteString("\t") - break - case DiffDelete: - _, _ = text.WriteString("-") - _, _ = text.WriteString(strconv.Itoa(utf8.RuneCountInString(aDiff.Text))) - _, _ = text.WriteString("\t") - break - case DiffEqual: - _, _ = text.WriteString("=") - _, _ = text.WriteString(strconv.Itoa(utf8.RuneCountInString(aDiff.Text))) - _, _ = text.WriteString("\t") - break - } - } - delta := text.String() - if len(delta) != 0 { - // Strip off trailing tab character. - delta = delta[0 : utf8.RuneCountInString(delta)-1] - delta = unescaper.Replace(delta) - } - return delta -} - -// DiffFromDelta given the original text1, and an encoded string which describes the operations required to transform text1 into text2, comAdde the full diff. -func (dmp *DiffMatchPatch) DiffFromDelta(text1 string, delta string) (diffs []Diff, err error) { - i := 0 - runes := []rune(text1) - - for _, token := range strings.Split(delta, "\t") { - if len(token) == 0 { - // Blank tokens are ok (from a trailing \t). - continue - } - - // Each token begins with a one character parameter which specifies the operation of this token (delete, insert, equality). - param := token[1:] - - switch op := token[0]; op { - case '+': - // Decode would Diff all "+" to " " - param = strings.Replace(param, "+", "%2b", -1) - param, err = url.QueryUnescape(param) - if err != nil { - return nil, err - } - if !utf8.ValidString(param) { - return nil, fmt.Errorf("invalid UTF-8 token: %q", param) - } - - diffs = append(diffs, Diff{DiffInsert, param}) - case '=', '-': - n, err := strconv.ParseInt(param, 10, 0) - if err != nil { - return nil, err - } else if n < 0 { - return nil, errors.New("Negative number in DiffFromDelta: " + param) - } - - i += int(n) - // Break out if we are out of bounds, go1.6 can't handle this very well - if i > len(runes) { - break - } - // Remember that string slicing is by byte - we want by rune here. - text := string(runes[i-int(n) : i]) - - if op == '=' { - diffs = append(diffs, Diff{DiffEqual, text}) - } else { - diffs = append(diffs, Diff{DiffDelete, text}) - } - default: - // Anything else is an error. - return nil, errors.New("Invalid diff operation in DiffFromDelta: " + string(token[0])) - } - } - - if i != len(runes) { - return nil, fmt.Errorf("Delta length (%v) is different from source text length (%v)", i, len(text1)) - } - - return diffs, nil -} - -// diffLinesToStrings splits two texts into a list of strings. Each string represents one line. -func (dmp *DiffMatchPatch) diffLinesToStrings(text1, text2 string) (string, string, []string) { - // '\x00' is a valid character, but various debuggers don't like it. So we'll insert a junk entry to avoid generating a null character. - lineArray := []string{""} // e.g. lineArray[4] == 'Hello\n' - - lineHash := make(map[string]int) - //Each string has the index of lineArray which it points to - strIndexArray1 := dmp.diffLinesToStringsMunge(text1, &lineArray, lineHash) - strIndexArray2 := dmp.diffLinesToStringsMunge(text2, &lineArray, lineHash) - - return intArrayToString(strIndexArray1), intArrayToString(strIndexArray2), lineArray -} - -// diffLinesToStringsMunge splits a text into an array of strings, and reduces the texts to a []string. -func (dmp *DiffMatchPatch) diffLinesToStringsMunge(text string, lineArray *[]string, lineHash map[string]int) []uint32 { - // Walk the text, pulling out a substring for each line. text.split('\n') would would temporarily double our memory footprint. Modifying text would create many large strings to garbage collect. - lineStart := 0 - lineEnd := -1 - strs := []uint32{} - - for lineEnd < len(text)-1 { - lineEnd = indexOf(text, "\n", lineStart) - - if lineEnd == -1 { - lineEnd = len(text) - 1 - } - - line := text[lineStart : lineEnd+1] - lineStart = lineEnd + 1 - lineValue, ok := lineHash[line] - - if ok { - strs = append(strs, uint32(lineValue)) - } else { - *lineArray = append(*lineArray, line) - lineHash[line] = len(*lineArray) - 1 - strs = append(strs, uint32(len(*lineArray)-1)) - } - } - - return strs -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go deleted file mode 100644 index d3acc32ce1..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/diffmatchpatch.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -// Package diffmatchpatch offers robust algorithms to perform the operations required for synchronizing plain text. -package diffmatchpatch - -import ( - "time" -) - -// DiffMatchPatch holds the configuration for diff-match-patch operations. -type DiffMatchPatch struct { - // Number of seconds to map a diff before giving up (0 for infinity). - DiffTimeout time.Duration - // Cost of an empty edit operation in terms of edit characters. - DiffEditCost int - // How far to search for a match (0 = exact location, 1000+ = broad match). A match this many characters away from the expected location will add 1.0 to the score (0.0 is a perfect match). - MatchDistance int - // When deleting a large block of text (over ~64 characters), how close do the contents have to be to match the expected contents. (0.0 = perfection, 1.0 = very loose). Note that MatchThreshold controls how closely the end points of a delete need to match. - PatchDeleteThreshold float64 - // Chunk size for context length. - PatchMargin int - // The number of bits in an int. - MatchMaxBits int - // At what point is no match declared (0.0 = perfection, 1.0 = very loose). - MatchThreshold float64 -} - -// New creates a new DiffMatchPatch object with default parameters. -func New() *DiffMatchPatch { - // Defaults. - return &DiffMatchPatch{ - DiffTimeout: time.Second, - DiffEditCost: 4, - MatchThreshold: 0.5, - MatchDistance: 1000, - PatchDeleteThreshold: 0.5, - PatchMargin: 4, - MatchMaxBits: 32, - } -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go deleted file mode 100644 index 17374e109f..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/match.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "math" -) - -// MatchMain locates the best instance of 'pattern' in 'text' near 'loc'. -// Returns -1 if no match found. -func (dmp *DiffMatchPatch) MatchMain(text, pattern string, loc int) int { - // Check for null inputs not needed since null can't be passed in C#. - - loc = int(math.Max(0, math.Min(float64(loc), float64(len(text))))) - if text == pattern { - // Shortcut (potentially not guaranteed by the algorithm) - return 0 - } else if len(text) == 0 { - // Nothing to match. - return -1 - } else if loc+len(pattern) <= len(text) && text[loc:loc+len(pattern)] == pattern { - // Perfect match at the perfect spot! (Includes case of null pattern) - return loc - } - // Do a fuzzy compare. - return dmp.MatchBitap(text, pattern, loc) -} - -// MatchBitap locates the best instance of 'pattern' in 'text' near 'loc' using the Bitap algorithm. -// Returns -1 if no match was found. -func (dmp *DiffMatchPatch) MatchBitap(text, pattern string, loc int) int { - // Initialise the alphabet. - s := dmp.MatchAlphabet(pattern) - - // Highest score beyond which we give up. - scoreThreshold := dmp.MatchThreshold - // Is there a nearby exact match? (speedup) - bestLoc := indexOf(text, pattern, loc) - if bestLoc != -1 { - scoreThreshold = math.Min(dmp.matchBitapScore(0, bestLoc, loc, - pattern), scoreThreshold) - // What about in the other direction? (speedup) - bestLoc = lastIndexOf(text, pattern, loc+len(pattern)) - if bestLoc != -1 { - scoreThreshold = math.Min(dmp.matchBitapScore(0, bestLoc, loc, - pattern), scoreThreshold) - } - } - - // Initialise the bit arrays. - matchmask := 1 << uint((len(pattern) - 1)) - bestLoc = -1 - - var binMin, binMid int - binMax := len(pattern) + len(text) - lastRd := []int{} - for d := 0; d < len(pattern); d++ { - // Scan for the best match; each iteration allows for one more error. Run a binary search to determine how far from 'loc' we can stray at this error level. - binMin = 0 - binMid = binMax - for binMin < binMid { - if dmp.matchBitapScore(d, loc+binMid, loc, pattern) <= scoreThreshold { - binMin = binMid - } else { - binMax = binMid - } - binMid = (binMax-binMin)/2 + binMin - } - // Use the result from this iteration as the maximum for the next. - binMax = binMid - start := int(math.Max(1, float64(loc-binMid+1))) - finish := int(math.Min(float64(loc+binMid), float64(len(text))) + float64(len(pattern))) - - rd := make([]int, finish+2) - rd[finish+1] = (1 << uint(d)) - 1 - - for j := finish; j >= start; j-- { - var charMatch int - if len(text) <= j-1 { - // Out of range. - charMatch = 0 - } else if _, ok := s[text[j-1]]; !ok { - charMatch = 0 - } else { - charMatch = s[text[j-1]] - } - - if d == 0 { - // First pass: exact match. - rd[j] = ((rd[j+1] << 1) | 1) & charMatch - } else { - // Subsequent passes: fuzzy match. - rd[j] = ((rd[j+1]<<1)|1)&charMatch | (((lastRd[j+1] | lastRd[j]) << 1) | 1) | lastRd[j+1] - } - if (rd[j] & matchmask) != 0 { - score := dmp.matchBitapScore(d, j-1, loc, pattern) - // This match will almost certainly be better than any existing match. But check anyway. - if score <= scoreThreshold { - // Told you so. - scoreThreshold = score - bestLoc = j - 1 - if bestLoc > loc { - // When passing loc, don't exceed our current distance from loc. - start = int(math.Max(1, float64(2*loc-bestLoc))) - } else { - // Already passed loc, downhill from here on in. - break - } - } - } - } - if dmp.matchBitapScore(d+1, loc, loc, pattern) > scoreThreshold { - // No hope for a (better) match at greater error levels. - break - } - lastRd = rd - } - return bestLoc -} - -// matchBitapScore computes and returns the score for a match with e errors and x location. -func (dmp *DiffMatchPatch) matchBitapScore(e, x, loc int, pattern string) float64 { - accuracy := float64(e) / float64(len(pattern)) - proximity := math.Abs(float64(loc - x)) - if dmp.MatchDistance == 0 { - // Dodge divide by zero error. - if proximity == 0 { - return accuracy - } - - return 1.0 - } - return accuracy + (proximity / float64(dmp.MatchDistance)) -} - -// MatchAlphabet initialises the alphabet for the Bitap algorithm. -func (dmp *DiffMatchPatch) MatchAlphabet(pattern string) map[byte]int { - s := map[byte]int{} - charPattern := []byte(pattern) - for _, c := range charPattern { - _, ok := s[c] - if !ok { - s[c] = 0 - } - } - i := 0 - - for _, c := range charPattern { - value := s[c] | int(uint(1)< y { - return x - } - return y -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/operation_string.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/operation_string.go deleted file mode 100644 index 533ec0da7b..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/operation_string.go +++ /dev/null @@ -1,17 +0,0 @@ -// Code generated by "stringer -type=Operation -trimprefix=Diff"; DO NOT EDIT. - -package diffmatchpatch - -import "fmt" - -const _Operation_name = "DeleteEqualInsert" - -var _Operation_index = [...]uint8{0, 6, 11, 17} - -func (i Operation) String() string { - i -= -1 - if i < 0 || i >= Operation(len(_Operation_index)-1) { - return fmt.Sprintf("Operation(%d)", i+-1) - } - return _Operation_name[_Operation_index[i]:_Operation_index[i+1]] -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go deleted file mode 100644 index 0dbe3bdd7d..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/patch.go +++ /dev/null @@ -1,556 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "bytes" - "errors" - "math" - "net/url" - "regexp" - "strconv" - "strings" -) - -// Patch represents one patch operation. -type Patch struct { - diffs []Diff - Start1 int - Start2 int - Length1 int - Length2 int -} - -// String emulates GNU diff's format. -// Header: @@ -382,8 +481,9 @@ -// Indices are printed as 1-based, not 0-based. -func (p *Patch) String() string { - var coords1, coords2 string - - if p.Length1 == 0 { - coords1 = strconv.Itoa(p.Start1) + ",0" - } else if p.Length1 == 1 { - coords1 = strconv.Itoa(p.Start1 + 1) - } else { - coords1 = strconv.Itoa(p.Start1+1) + "," + strconv.Itoa(p.Length1) - } - - if p.Length2 == 0 { - coords2 = strconv.Itoa(p.Start2) + ",0" - } else if p.Length2 == 1 { - coords2 = strconv.Itoa(p.Start2 + 1) - } else { - coords2 = strconv.Itoa(p.Start2+1) + "," + strconv.Itoa(p.Length2) - } - - var text bytes.Buffer - _, _ = text.WriteString("@@ -" + coords1 + " +" + coords2 + " @@\n") - - // Escape the body of the patch with %xx notation. - for _, aDiff := range p.diffs { - switch aDiff.Type { - case DiffInsert: - _, _ = text.WriteString("+") - case DiffDelete: - _, _ = text.WriteString("-") - case DiffEqual: - _, _ = text.WriteString(" ") - } - - _, _ = text.WriteString(strings.Replace(url.QueryEscape(aDiff.Text), "+", " ", -1)) - _, _ = text.WriteString("\n") - } - - return unescaper.Replace(text.String()) -} - -// PatchAddContext increases the context until it is unique, but doesn't let the pattern expand beyond MatchMaxBits. -func (dmp *DiffMatchPatch) PatchAddContext(patch Patch, text string) Patch { - if len(text) == 0 { - return patch - } - - pattern := text[patch.Start2 : patch.Start2+patch.Length1] - padding := 0 - - // Look for the first and last matches of pattern in text. If two different matches are found, increase the pattern length. - for strings.Index(text, pattern) != strings.LastIndex(text, pattern) && - len(pattern) < dmp.MatchMaxBits-2*dmp.PatchMargin { - padding += dmp.PatchMargin - maxStart := max(0, patch.Start2-padding) - minEnd := min(len(text), patch.Start2+patch.Length1+padding) - pattern = text[maxStart:minEnd] - } - // Add one chunk for good luck. - padding += dmp.PatchMargin - - // Add the prefix. - prefix := text[max(0, patch.Start2-padding):patch.Start2] - if len(prefix) != 0 { - patch.diffs = append([]Diff{Diff{DiffEqual, prefix}}, patch.diffs...) - } - // Add the suffix. - suffix := text[patch.Start2+patch.Length1 : min(len(text), patch.Start2+patch.Length1+padding)] - if len(suffix) != 0 { - patch.diffs = append(patch.diffs, Diff{DiffEqual, suffix}) - } - - // Roll back the start points. - patch.Start1 -= len(prefix) - patch.Start2 -= len(prefix) - // Extend the lengths. - patch.Length1 += len(prefix) + len(suffix) - patch.Length2 += len(prefix) + len(suffix) - - return patch -} - -// PatchMake computes a list of patches. -func (dmp *DiffMatchPatch) PatchMake(opt ...interface{}) []Patch { - if len(opt) == 1 { - diffs, _ := opt[0].([]Diff) - text1 := dmp.DiffText1(diffs) - return dmp.PatchMake(text1, diffs) - } else if len(opt) == 2 { - text1 := opt[0].(string) - switch t := opt[1].(type) { - case string: - diffs := dmp.DiffMain(text1, t, true) - if len(diffs) > 2 { - diffs = dmp.DiffCleanupSemantic(diffs) - diffs = dmp.DiffCleanupEfficiency(diffs) - } - return dmp.PatchMake(text1, diffs) - case []Diff: - return dmp.patchMake2(text1, t) - } - } else if len(opt) == 3 { - return dmp.PatchMake(opt[0], opt[2]) - } - return []Patch{} -} - -// patchMake2 computes a list of patches to turn text1 into text2. -// text2 is not provided, diffs are the delta between text1 and text2. -func (dmp *DiffMatchPatch) patchMake2(text1 string, diffs []Diff) []Patch { - // Check for null inputs not needed since null can't be passed in C#. - patches := []Patch{} - if len(diffs) == 0 { - return patches // Get rid of the null case. - } - - patch := Patch{} - charCount1 := 0 // Number of characters into the text1 string. - charCount2 := 0 // Number of characters into the text2 string. - // Start with text1 (prepatchText) and apply the diffs until we arrive at text2 (postpatchText). We recreate the patches one by one to determine context info. - prepatchText := text1 - postpatchText := text1 - - for i, aDiff := range diffs { - if len(patch.diffs) == 0 && aDiff.Type != DiffEqual { - // A new patch starts here. - patch.Start1 = charCount1 - patch.Start2 = charCount2 - } - - switch aDiff.Type { - case DiffInsert: - patch.diffs = append(patch.diffs, aDiff) - patch.Length2 += len(aDiff.Text) - postpatchText = postpatchText[:charCount2] + - aDiff.Text + postpatchText[charCount2:] - case DiffDelete: - patch.Length1 += len(aDiff.Text) - patch.diffs = append(patch.diffs, aDiff) - postpatchText = postpatchText[:charCount2] + postpatchText[charCount2+len(aDiff.Text):] - case DiffEqual: - if len(aDiff.Text) <= 2*dmp.PatchMargin && - len(patch.diffs) != 0 && i != len(diffs)-1 { - // Small equality inside a patch. - patch.diffs = append(patch.diffs, aDiff) - patch.Length1 += len(aDiff.Text) - patch.Length2 += len(aDiff.Text) - } - if len(aDiff.Text) >= 2*dmp.PatchMargin { - // Time for a new patch. - if len(patch.diffs) != 0 { - patch = dmp.PatchAddContext(patch, prepatchText) - patches = append(patches, patch) - patch = Patch{} - // Unlike Unidiff, our patch lists have a rolling context. http://code.google.com/p/google-diff-match-patch/wiki/Unidiff Update prepatch text & pos to reflect the application of the just completed patch. - prepatchText = postpatchText - charCount1 = charCount2 - } - } - } - - // Update the current character count. - if aDiff.Type != DiffInsert { - charCount1 += len(aDiff.Text) - } - if aDiff.Type != DiffDelete { - charCount2 += len(aDiff.Text) - } - } - - // Pick up the leftover patch if not empty. - if len(patch.diffs) != 0 { - patch = dmp.PatchAddContext(patch, prepatchText) - patches = append(patches, patch) - } - - return patches -} - -// PatchDeepCopy returns an array that is identical to a given an array of patches. -func (dmp *DiffMatchPatch) PatchDeepCopy(patches []Patch) []Patch { - patchesCopy := []Patch{} - for _, aPatch := range patches { - patchCopy := Patch{} - for _, aDiff := range aPatch.diffs { - patchCopy.diffs = append(patchCopy.diffs, Diff{ - aDiff.Type, - aDiff.Text, - }) - } - patchCopy.Start1 = aPatch.Start1 - patchCopy.Start2 = aPatch.Start2 - patchCopy.Length1 = aPatch.Length1 - patchCopy.Length2 = aPatch.Length2 - patchesCopy = append(patchesCopy, patchCopy) - } - return patchesCopy -} - -// PatchApply merges a set of patches onto the text. Returns a patched text, as well as an array of true/false values indicating which patches were applied. -func (dmp *DiffMatchPatch) PatchApply(patches []Patch, text string) (string, []bool) { - if len(patches) == 0 { - return text, []bool{} - } - - // Deep copy the patches so that no changes are made to originals. - patches = dmp.PatchDeepCopy(patches) - - nullPadding := dmp.PatchAddPadding(patches) - text = nullPadding + text + nullPadding - patches = dmp.PatchSplitMax(patches) - - x := 0 - // delta keeps track of the offset between the expected and actual location of the previous patch. If there are patches expected at positions 10 and 20, but the first patch was found at 12, delta is 2 and the second patch has an effective expected position of 22. - delta := 0 - results := make([]bool, len(patches)) - for _, aPatch := range patches { - expectedLoc := aPatch.Start2 + delta - text1 := dmp.DiffText1(aPatch.diffs) - var startLoc int - endLoc := -1 - if len(text1) > dmp.MatchMaxBits { - // PatchSplitMax will only provide an oversized pattern in the case of a monster delete. - startLoc = dmp.MatchMain(text, text1[:dmp.MatchMaxBits], expectedLoc) - if startLoc != -1 { - endLoc = dmp.MatchMain(text, - text1[len(text1)-dmp.MatchMaxBits:], expectedLoc+len(text1)-dmp.MatchMaxBits) - if endLoc == -1 || startLoc >= endLoc { - // Can't find valid trailing context. Drop this patch. - startLoc = -1 - } - } - } else { - startLoc = dmp.MatchMain(text, text1, expectedLoc) - } - if startLoc == -1 { - // No match found. :( - results[x] = false - // Subtract the delta for this failed patch from subsequent patches. - delta -= aPatch.Length2 - aPatch.Length1 - } else { - // Found a match. :) - results[x] = true - delta = startLoc - expectedLoc - var text2 string - if endLoc == -1 { - text2 = text[startLoc:int(math.Min(float64(startLoc+len(text1)), float64(len(text))))] - } else { - text2 = text[startLoc:int(math.Min(float64(endLoc+dmp.MatchMaxBits), float64(len(text))))] - } - if text1 == text2 { - // Perfect match, just shove the Replacement text in. - text = text[:startLoc] + dmp.DiffText2(aPatch.diffs) + text[startLoc+len(text1):] - } else { - // Imperfect match. Run a diff to get a framework of equivalent indices. - diffs := dmp.DiffMain(text1, text2, false) - if len(text1) > dmp.MatchMaxBits && float64(dmp.DiffLevenshtein(diffs))/float64(len(text1)) > dmp.PatchDeleteThreshold { - // The end points match, but the content is unacceptably bad. - results[x] = false - } else { - diffs = dmp.DiffCleanupSemanticLossless(diffs) - index1 := 0 - for _, aDiff := range aPatch.diffs { - if aDiff.Type != DiffEqual { - index2 := dmp.DiffXIndex(diffs, index1) - if aDiff.Type == DiffInsert { - // Insertion - text = text[:startLoc+index2] + aDiff.Text + text[startLoc+index2:] - } else if aDiff.Type == DiffDelete { - // Deletion - startIndex := startLoc + index2 - text = text[:startIndex] + - text[startIndex+dmp.DiffXIndex(diffs, index1+len(aDiff.Text))-index2:] - } - } - if aDiff.Type != DiffDelete { - index1 += len(aDiff.Text) - } - } - } - } - } - x++ - } - // Strip the padding off. - text = text[len(nullPadding) : len(nullPadding)+(len(text)-2*len(nullPadding))] - return text, results -} - -// PatchAddPadding adds some padding on text start and end so that edges can match something. -// Intended to be called only from within patchApply. -func (dmp *DiffMatchPatch) PatchAddPadding(patches []Patch) string { - paddingLength := dmp.PatchMargin - nullPadding := "" - for x := 1; x <= paddingLength; x++ { - nullPadding += string(rune(x)) - } - - // Bump all the patches forward. - for i := range patches { - patches[i].Start1 += paddingLength - patches[i].Start2 += paddingLength - } - - // Add some padding on start of first diff. - if len(patches[0].diffs) == 0 || patches[0].diffs[0].Type != DiffEqual { - // Add nullPadding equality. - patches[0].diffs = append([]Diff{Diff{DiffEqual, nullPadding}}, patches[0].diffs...) - patches[0].Start1 -= paddingLength // Should be 0. - patches[0].Start2 -= paddingLength // Should be 0. - patches[0].Length1 += paddingLength - patches[0].Length2 += paddingLength - } else if paddingLength > len(patches[0].diffs[0].Text) { - // Grow first equality. - extraLength := paddingLength - len(patches[0].diffs[0].Text) - patches[0].diffs[0].Text = nullPadding[len(patches[0].diffs[0].Text):] + patches[0].diffs[0].Text - patches[0].Start1 -= extraLength - patches[0].Start2 -= extraLength - patches[0].Length1 += extraLength - patches[0].Length2 += extraLength - } - - // Add some padding on end of last diff. - last := len(patches) - 1 - if len(patches[last].diffs) == 0 || patches[last].diffs[len(patches[last].diffs)-1].Type != DiffEqual { - // Add nullPadding equality. - patches[last].diffs = append(patches[last].diffs, Diff{DiffEqual, nullPadding}) - patches[last].Length1 += paddingLength - patches[last].Length2 += paddingLength - } else if paddingLength > len(patches[last].diffs[len(patches[last].diffs)-1].Text) { - // Grow last equality. - lastDiff := patches[last].diffs[len(patches[last].diffs)-1] - extraLength := paddingLength - len(lastDiff.Text) - patches[last].diffs[len(patches[last].diffs)-1].Text += nullPadding[:extraLength] - patches[last].Length1 += extraLength - patches[last].Length2 += extraLength - } - - return nullPadding -} - -// PatchSplitMax looks through the patches and breaks up any which are longer than the maximum limit of the match algorithm. -// Intended to be called only from within patchApply. -func (dmp *DiffMatchPatch) PatchSplitMax(patches []Patch) []Patch { - patchSize := dmp.MatchMaxBits - for x := 0; x < len(patches); x++ { - if patches[x].Length1 <= patchSize { - continue - } - bigpatch := patches[x] - // Remove the big old patch. - patches = append(patches[:x], patches[x+1:]...) - x-- - - Start1 := bigpatch.Start1 - Start2 := bigpatch.Start2 - precontext := "" - for len(bigpatch.diffs) != 0 { - // Create one of several smaller patches. - patch := Patch{} - empty := true - patch.Start1 = Start1 - len(precontext) - patch.Start2 = Start2 - len(precontext) - if len(precontext) != 0 { - patch.Length1 = len(precontext) - patch.Length2 = len(precontext) - patch.diffs = append(patch.diffs, Diff{DiffEqual, precontext}) - } - for len(bigpatch.diffs) != 0 && patch.Length1 < patchSize-dmp.PatchMargin { - diffType := bigpatch.diffs[0].Type - diffText := bigpatch.diffs[0].Text - if diffType == DiffInsert { - // Insertions are harmless. - patch.Length2 += len(diffText) - Start2 += len(diffText) - patch.diffs = append(patch.diffs, bigpatch.diffs[0]) - bigpatch.diffs = bigpatch.diffs[1:] - empty = false - } else if diffType == DiffDelete && len(patch.diffs) == 1 && patch.diffs[0].Type == DiffEqual && len(diffText) > 2*patchSize { - // This is a large deletion. Let it pass in one chunk. - patch.Length1 += len(diffText) - Start1 += len(diffText) - empty = false - patch.diffs = append(patch.diffs, Diff{diffType, diffText}) - bigpatch.diffs = bigpatch.diffs[1:] - } else { - // Deletion or equality. Only take as much as we can stomach. - diffText = diffText[:min(len(diffText), patchSize-patch.Length1-dmp.PatchMargin)] - - patch.Length1 += len(diffText) - Start1 += len(diffText) - if diffType == DiffEqual { - patch.Length2 += len(diffText) - Start2 += len(diffText) - } else { - empty = false - } - patch.diffs = append(patch.diffs, Diff{diffType, diffText}) - if diffText == bigpatch.diffs[0].Text { - bigpatch.diffs = bigpatch.diffs[1:] - } else { - bigpatch.diffs[0].Text = - bigpatch.diffs[0].Text[len(diffText):] - } - } - } - // Compute the head context for the next patch. - precontext = dmp.DiffText2(patch.diffs) - precontext = precontext[max(0, len(precontext)-dmp.PatchMargin):] - - postcontext := "" - // Append the end context for this patch. - if len(dmp.DiffText1(bigpatch.diffs)) > dmp.PatchMargin { - postcontext = dmp.DiffText1(bigpatch.diffs)[:dmp.PatchMargin] - } else { - postcontext = dmp.DiffText1(bigpatch.diffs) - } - - if len(postcontext) != 0 { - patch.Length1 += len(postcontext) - patch.Length2 += len(postcontext) - if len(patch.diffs) != 0 && patch.diffs[len(patch.diffs)-1].Type == DiffEqual { - patch.diffs[len(patch.diffs)-1].Text += postcontext - } else { - patch.diffs = append(patch.diffs, Diff{DiffEqual, postcontext}) - } - } - if !empty { - x++ - patches = append(patches[:x], append([]Patch{patch}, patches[x:]...)...) - } - } - } - return patches -} - -// PatchToText takes a list of patches and returns a textual representation. -func (dmp *DiffMatchPatch) PatchToText(patches []Patch) string { - var text bytes.Buffer - for _, aPatch := range patches { - _, _ = text.WriteString(aPatch.String()) - } - return text.String() -} - -// PatchFromText parses a textual representation of patches and returns a List of Patch objects. -func (dmp *DiffMatchPatch) PatchFromText(textline string) ([]Patch, error) { - patches := []Patch{} - if len(textline) == 0 { - return patches, nil - } - text := strings.Split(textline, "\n") - textPointer := 0 - patchHeader := regexp.MustCompile("^@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@$") - - var patch Patch - var sign uint8 - var line string - for textPointer < len(text) { - - if !patchHeader.MatchString(text[textPointer]) { - return patches, errors.New("Invalid patch string: " + text[textPointer]) - } - - patch = Patch{} - m := patchHeader.FindStringSubmatch(text[textPointer]) - - patch.Start1, _ = strconv.Atoi(m[1]) - if len(m[2]) == 0 { - patch.Start1-- - patch.Length1 = 1 - } else if m[2] == "0" { - patch.Length1 = 0 - } else { - patch.Start1-- - patch.Length1, _ = strconv.Atoi(m[2]) - } - - patch.Start2, _ = strconv.Atoi(m[3]) - - if len(m[4]) == 0 { - patch.Start2-- - patch.Length2 = 1 - } else if m[4] == "0" { - patch.Length2 = 0 - } else { - patch.Start2-- - patch.Length2, _ = strconv.Atoi(m[4]) - } - textPointer++ - - for textPointer < len(text) { - if len(text[textPointer]) > 0 { - sign = text[textPointer][0] - } else { - textPointer++ - continue - } - - line = text[textPointer][1:] - line = strings.Replace(line, "+", "%2b", -1) - line, _ = url.QueryUnescape(line) - if sign == '-' { - // Deletion. - patch.diffs = append(patch.diffs, Diff{DiffDelete, line}) - } else if sign == '+' { - // Insertion. - patch.diffs = append(patch.diffs, Diff{DiffInsert, line}) - } else if sign == ' ' { - // Minor equality. - patch.diffs = append(patch.diffs, Diff{DiffEqual, line}) - } else if sign == '@' { - // Start of next patch. - break - } else { - // WTF? - return patches, errors.New("Invalid patch mode '" + string(sign) + "' in: " + string(line)) - } - textPointer++ - } - - patches = append(patches, patch) - } - return patches, nil -} diff --git a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go b/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go deleted file mode 100644 index 44c4359547..0000000000 --- a/vendor/github.com/sergi/go-diff/diffmatchpatch/stringutil.go +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 2012-2016 The go-diff authors. All rights reserved. -// https://github.com/sergi/go-diff -// See the included LICENSE file for license details. -// -// go-diff is a Go implementation of Google's Diff, Match, and Patch library -// Original library is Copyright (c) 2006 Google Inc. -// http://code.google.com/p/google-diff-match-patch/ - -package diffmatchpatch - -import ( - "strconv" - "strings" - "unicode/utf8" -) - -// unescaper unescapes selected chars for compatibility with JavaScript's encodeURI. -// In speed critical applications this could be dropped since the receiving application will certainly decode these fine. Note that this function is case-sensitive. Thus "%3F" would not be unescaped. But this is ok because it is only called with the output of HttpUtility.UrlEncode which returns lowercase hex. Example: "%3f" -> "?", "%24" -> "$", etc. -var unescaper = strings.NewReplacer( - "%21", "!", "%7E", "~", "%27", "'", - "%28", "(", "%29", ")", "%3B", ";", - "%2F", "/", "%3F", "?", "%3A", ":", - "%40", "@", "%26", "&", "%3D", "=", - "%2B", "+", "%24", "$", "%2C", ",", "%23", "#", "%2A", "*") - -// indexOf returns the first index of pattern in str, starting at str[i]. -func indexOf(str string, pattern string, i int) int { - if i > len(str)-1 { - return -1 - } - if i <= 0 { - return strings.Index(str, pattern) - } - ind := strings.Index(str[i:], pattern) - if ind == -1 { - return -1 - } - return ind + i -} - -// lastIndexOf returns the last index of pattern in str, starting at str[i]. -func lastIndexOf(str string, pattern string, i int) int { - if i < 0 { - return -1 - } - if i >= len(str) { - return strings.LastIndex(str, pattern) - } - _, size := utf8.DecodeRuneInString(str[i:]) - return strings.LastIndex(str[:i+size], pattern) -} - -// runesIndexOf returns the index of pattern in target, starting at target[i]. -func runesIndexOf(target, pattern []rune, i int) int { - if i > len(target)-1 { - return -1 - } - if i <= 0 { - return runesIndex(target, pattern) - } - ind := runesIndex(target[i:], pattern) - if ind == -1 { - return -1 - } - return ind + i -} - -func runesEqual(r1, r2 []rune) bool { - if len(r1) != len(r2) { - return false - } - for i, c := range r1 { - if c != r2[i] { - return false - } - } - return true -} - -// runesIndex is the equivalent of strings.Index for rune slices. -func runesIndex(r1, r2 []rune) int { - last := len(r1) - len(r2) - for i := 0; i <= last; i++ { - if runesEqual(r1[i:i+len(r2)], r2) { - return i - } - } - return -1 -} - -func intArrayToString(ns []uint32) string { - if len(ns) == 0 { - return "" - } - - indexSeparator := IndexSeparator[0] - - // Appr. 3 chars per num plus the comma. - b := []byte{} - for _, n := range ns { - b = strconv.AppendInt(b, int64(n), 10) - b = append(b, indexSeparator) - } - b = b[:len(b)-1] - return string(b) -} diff --git a/vendor/github.com/shazow/go-diff/LICENSE b/vendor/github.com/shazow/go-diff/LICENSE deleted file mode 100644 index 85e1e4b33a..0000000000 --- a/vendor/github.com/shazow/go-diff/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Andrey Petrov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/vendor/github.com/shazow/go-diff/difflib/differ.go b/vendor/github.com/shazow/go-diff/difflib/differ.go deleted file mode 100644 index 43dc84d9a7..0000000000 --- a/vendor/github.com/shazow/go-diff/difflib/differ.go +++ /dev/null @@ -1,39 +0,0 @@ -// This package implements the diff.Differ interface using github.com/mb0/diff as a backend. -package difflib - -import ( - "io" - "io/ioutil" - - "github.com/pmezard/go-difflib/difflib" -) - -type differ struct{} - -// New returns an implementation of diff.Differ using mb0diff as the backend. -func New() *differ { - return &differ{} -} - -// Diff consumes the entire reader streams into memory before generating a diff -// which then gets filled into the buffer. This implementation stores and -// manipulates all three values in memory. -func (diff *differ) Diff(out io.Writer, a io.ReadSeeker, b io.ReadSeeker) error { - var src, dst []byte - var err error - - if src, err = ioutil.ReadAll(a); err != nil { - return err - } - if dst, err = ioutil.ReadAll(b); err != nil { - return err - } - - d := difflib.UnifiedDiff{ - A: difflib.SplitLines(string(src)), - B: difflib.SplitLines(string(dst)), - Context: 3, - } - - return difflib.WriteUnifiedDiff(out, d) -} diff --git a/vendor/github.com/shopspring/decimal/.gitignore b/vendor/github.com/shopspring/decimal/.gitignore deleted file mode 100644 index ff36b987f0..0000000000 --- a/vendor/github.com/shopspring/decimal/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -.git -*.swp - -# IntelliJ -.idea/ -*.iml - -# VS code -*.code-workspace diff --git a/vendor/github.com/shopspring/decimal/.travis.yml b/vendor/github.com/shopspring/decimal/.travis.yml deleted file mode 100644 index 6326d40f0e..0000000000 --- a/vendor/github.com/shopspring/decimal/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go - -arch: - - amd64 - - ppc64le - -go: - - 1.7.x - - 1.14.x - - 1.15.x - - 1.16.x - - 1.17.x - - tip - -install: - - go build . - -script: - - go test -v diff --git a/vendor/github.com/shopspring/decimal/CHANGELOG.md b/vendor/github.com/shopspring/decimal/CHANGELOG.md deleted file mode 100644 index aea61154b8..0000000000 --- a/vendor/github.com/shopspring/decimal/CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -## Decimal v1.3.1 - -#### ENHANCEMENTS -- Reduce memory allocation in case of initialization from big.Int [#252](https://github.com/shopspring/decimal/pull/252) - -#### BUGFIXES -- Fix binary marshalling of decimal zero value [#253](https://github.com/shopspring/decimal/pull/253) - -## Decimal v1.3.0 - -#### FEATURES -- Add NewFromFormattedString initializer [#184](https://github.com/shopspring/decimal/pull/184) -- Add NewNullDecimal initializer [#234](https://github.com/shopspring/decimal/pull/234) -- Add implementation of natural exponent function (Taylor, Hull-Abraham) [#229](https://github.com/shopspring/decimal/pull/229) -- Add RoundUp, RoundDown, RoundCeil, RoundFloor methods [#196](https://github.com/shopspring/decimal/pull/196) [#202](https://github.com/shopspring/decimal/pull/202) [#220](https://github.com/shopspring/decimal/pull/220) -- Add XML support for NullDecimal [#192](https://github.com/shopspring/decimal/pull/192) -- Add IsInteger method [#179](https://github.com/shopspring/decimal/pull/179) -- Add Copy helper method [#123](https://github.com/shopspring/decimal/pull/123) -- Add InexactFloat64 helper method [#205](https://github.com/shopspring/decimal/pull/205) -- Add CoefficientInt64 helper method [#244](https://github.com/shopspring/decimal/pull/244) - -#### ENHANCEMENTS -- Performance optimization of NewFromString init method [#198](https://github.com/shopspring/decimal/pull/198) -- Performance optimization of Abs and Round methods [#240](https://github.com/shopspring/decimal/pull/240) -- Additional tests (CI) for ppc64le architecture [#188](https://github.com/shopspring/decimal/pull/188) - -#### BUGFIXES -- Fix rounding in FormatFloat fallback path (roundShortest method, fix taken from Go main repository) [#161](https://github.com/shopspring/decimal/pull/161) -- Add slice range checks to UnmarshalBinary method [#232](https://github.com/shopspring/decimal/pull/232) - -## Decimal v1.2.0 - -#### BREAKING -- Drop support for Go version older than 1.7 [#172](https://github.com/shopspring/decimal/pull/172) - -#### FEATURES -- Add NewFromInt and NewFromInt32 initializers [#72](https://github.com/shopspring/decimal/pull/72) -- Add support for Go modules [#157](https://github.com/shopspring/decimal/pull/157) -- Add BigInt, BigFloat helper methods [#171](https://github.com/shopspring/decimal/pull/171) - -#### ENHANCEMENTS -- Memory usage optimization [#160](https://github.com/shopspring/decimal/pull/160) -- Updated travis CI golang versions [#156](https://github.com/shopspring/decimal/pull/156) -- Update documentation [#173](https://github.com/shopspring/decimal/pull/173) -- Improve code quality [#174](https://github.com/shopspring/decimal/pull/174) - -#### BUGFIXES -- Revert remove insignificant digits [#159](https://github.com/shopspring/decimal/pull/159) -- Remove 15 interval for RoundCash [#166](https://github.com/shopspring/decimal/pull/166) diff --git a/vendor/github.com/shopspring/decimal/LICENSE b/vendor/github.com/shopspring/decimal/LICENSE deleted file mode 100644 index ad2148aaf9..0000000000 --- a/vendor/github.com/shopspring/decimal/LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2015 Spring, Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -- Based on https://github.com/oguzbilgic/fpd, which has the following license: -""" -The MIT License (MIT) - -Copyright (c) 2013 Oguz Bilgic - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -""" diff --git a/vendor/github.com/shopspring/decimal/README.md b/vendor/github.com/shopspring/decimal/README.md deleted file mode 100644 index 2e35df068e..0000000000 --- a/vendor/github.com/shopspring/decimal/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# decimal - -[![Build Status](https://app.travis-ci.com/shopspring/decimal.svg?branch=master)](https://app.travis-ci.com/shopspring/decimal) [![GoDoc](https://godoc.org/github.com/shopspring/decimal?status.svg)](https://godoc.org/github.com/shopspring/decimal) [![Go Report Card](https://goreportcard.com/badge/github.com/shopspring/decimal)](https://goreportcard.com/report/github.com/shopspring/decimal) - -Arbitrary-precision fixed-point decimal numbers in go. - -_Note:_ Decimal library can "only" represent numbers with a maximum of 2^31 digits after the decimal point. - -## Features - - * The zero-value is 0, and is safe to use without initialization - * Addition, subtraction, multiplication with no loss of precision - * Division with specified precision - * Database/sql serialization/deserialization - * JSON and XML serialization/deserialization - -## Install - -Run `go get github.com/shopspring/decimal` - -## Requirements - -Decimal library requires Go version `>=1.7` - -## Usage - -```go -package main - -import ( - "fmt" - "github.com/shopspring/decimal" -) - -func main() { - price, err := decimal.NewFromString("136.02") - if err != nil { - panic(err) - } - - quantity := decimal.NewFromInt(3) - - fee, _ := decimal.NewFromString(".035") - taxRate, _ := decimal.NewFromString(".08875") - - subtotal := price.Mul(quantity) - - preTax := subtotal.Mul(fee.Add(decimal.NewFromFloat(1))) - - total := preTax.Mul(taxRate.Add(decimal.NewFromFloat(1))) - - fmt.Println("Subtotal:", subtotal) // Subtotal: 408.06 - fmt.Println("Pre-tax:", preTax) // Pre-tax: 422.3421 - fmt.Println("Taxes:", total.Sub(preTax)) // Taxes: 37.482861375 - fmt.Println("Total:", total) // Total: 459.824961375 - fmt.Println("Tax rate:", total.Sub(preTax).Div(preTax)) // Tax rate: 0.08875 -} -``` - -## Documentation - -http://godoc.org/github.com/shopspring/decimal - -## Production Usage - -* [Spring](https://shopspring.com/), since August 14, 2014. -* If you are using this in production, please let us know! - -## FAQ - -#### Why don't you just use float64? - -Because float64 (or any binary floating point type, actually) can't represent -numbers such as `0.1` exactly. - -Consider this code: http://play.golang.org/p/TQBd4yJe6B You might expect that -it prints out `10`, but it actually prints `9.999999999999831`. Over time, -these small errors can really add up! - -#### Why don't you just use big.Rat? - -big.Rat is fine for representing rational numbers, but Decimal is better for -representing money. Why? Here's a (contrived) example: - -Let's say you use big.Rat, and you have two numbers, x and y, both -representing 1/3, and you have `z = 1 - x - y = 1/3`. If you print each one -out, the string output has to stop somewhere (let's say it stops at 3 decimal -digits, for simplicity), so you'll get 0.333, 0.333, and 0.333. But where did -the other 0.001 go? - -Here's the above example as code: http://play.golang.org/p/lCZZs0w9KE - -With Decimal, the strings being printed out represent the number exactly. So, -if you have `x = y = 1/3` (with precision 3), they will actually be equal to -0.333, and when you do `z = 1 - x - y`, `z` will be equal to .334. No money is -unaccounted for! - -You still have to be careful. If you want to split a number `N` 3 ways, you -can't just send `N/3` to three different people. You have to pick one to send -`N - (2/3*N)` to. That person will receive the fraction of a penny remainder. - -But, it is much easier to be careful with Decimal than with big.Rat. - -#### Why isn't the API similar to big.Int's? - -big.Int's API is built to reduce the number of memory allocations for maximal -performance. This makes sense for its use-case, but the trade-off is that the -API is awkward and easy to misuse. - -For example, to add two big.Ints, you do: `z := new(big.Int).Add(x, y)`. A -developer unfamiliar with this API might try to do `z := a.Add(a, b)`. This -modifies `a` and sets `z` as an alias for `a`, which they might not expect. It -also modifies any other aliases to `a`. - -Here's an example of the subtle bugs you can introduce with big.Int's API: -https://play.golang.org/p/x2R_78pa8r - -In contrast, it's difficult to make such mistakes with decimal. Decimals -behave like other go numbers types: even though `a = b` will not deep copy -`b` into `a`, it is impossible to modify a Decimal, since all Decimal methods -return new Decimals and do not modify the originals. The downside is that -this causes extra allocations, so Decimal is less performant. My assumption -is that if you're using Decimals, you probably care more about correctness -than performance. - -## License - -The MIT License (MIT) - -This is a heavily modified fork of [fpd.Decimal](https://github.com/oguzbilgic/fpd), which was also released under the MIT License. diff --git a/vendor/github.com/shopspring/decimal/decimal-go.go b/vendor/github.com/shopspring/decimal/decimal-go.go deleted file mode 100644 index 9958d69020..0000000000 --- a/vendor/github.com/shopspring/decimal/decimal-go.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Multiprecision decimal numbers. -// For floating-point formatting only; not general purpose. -// Only operations are assign and (binary) left/right shift. -// Can do binary floating point in multiprecision decimal precisely -// because 2 divides 10; cannot do decimal floating point -// in multiprecision binary precisely. - -package decimal - -type decimal struct { - d [800]byte // digits, big-endian representation - nd int // number of digits used - dp int // decimal point - neg bool // negative flag - trunc bool // discarded nonzero digits beyond d[:nd] -} - -func (a *decimal) String() string { - n := 10 + a.nd - if a.dp > 0 { - n += a.dp - } - if a.dp < 0 { - n += -a.dp - } - - buf := make([]byte, n) - w := 0 - switch { - case a.nd == 0: - return "0" - - case a.dp <= 0: - // zeros fill space between decimal point and digits - buf[w] = '0' - w++ - buf[w] = '.' - w++ - w += digitZero(buf[w : w+-a.dp]) - w += copy(buf[w:], a.d[0:a.nd]) - - case a.dp < a.nd: - // decimal point in middle of digits - w += copy(buf[w:], a.d[0:a.dp]) - buf[w] = '.' - w++ - w += copy(buf[w:], a.d[a.dp:a.nd]) - - default: - // zeros fill space between digits and decimal point - w += copy(buf[w:], a.d[0:a.nd]) - w += digitZero(buf[w : w+a.dp-a.nd]) - } - return string(buf[0:w]) -} - -func digitZero(dst []byte) int { - for i := range dst { - dst[i] = '0' - } - return len(dst) -} - -// trim trailing zeros from number. -// (They are meaningless; the decimal point is tracked -// independent of the number of digits.) -func trim(a *decimal) { - for a.nd > 0 && a.d[a.nd-1] == '0' { - a.nd-- - } - if a.nd == 0 { - a.dp = 0 - } -} - -// Assign v to a. -func (a *decimal) Assign(v uint64) { - var buf [24]byte - - // Write reversed decimal in buf. - n := 0 - for v > 0 { - v1 := v / 10 - v -= 10 * v1 - buf[n] = byte(v + '0') - n++ - v = v1 - } - - // Reverse again to produce forward decimal in a.d. - a.nd = 0 - for n--; n >= 0; n-- { - a.d[a.nd] = buf[n] - a.nd++ - } - a.dp = a.nd - trim(a) -} - -// Maximum shift that we can do in one pass without overflow. -// A uint has 32 or 64 bits, and we have to be able to accommodate 9<> 63) -const maxShift = uintSize - 4 - -// Binary shift right (/ 2) by k bits. k <= maxShift to avoid overflow. -func rightShift(a *decimal, k uint) { - r := 0 // read pointer - w := 0 // write pointer - - // Pick up enough leading digits to cover first shift. - var n uint - for ; n>>k == 0; r++ { - if r >= a.nd { - if n == 0 { - // a == 0; shouldn't get here, but handle anyway. - a.nd = 0 - return - } - for n>>k == 0 { - n = n * 10 - r++ - } - break - } - c := uint(a.d[r]) - n = n*10 + c - '0' - } - a.dp -= r - 1 - - var mask uint = (1 << k) - 1 - - // Pick up a digit, put down a digit. - for ; r < a.nd; r++ { - c := uint(a.d[r]) - dig := n >> k - n &= mask - a.d[w] = byte(dig + '0') - w++ - n = n*10 + c - '0' - } - - // Put down extra digits. - for n > 0 { - dig := n >> k - n &= mask - if w < len(a.d) { - a.d[w] = byte(dig + '0') - w++ - } else if dig > 0 { - a.trunc = true - } - n = n * 10 - } - - a.nd = w - trim(a) -} - -// Cheat sheet for left shift: table indexed by shift count giving -// number of new digits that will be introduced by that shift. -// -// For example, leftcheats[4] = {2, "625"}. That means that -// if we are shifting by 4 (multiplying by 16), it will add 2 digits -// when the string prefix is "625" through "999", and one fewer digit -// if the string prefix is "000" through "624". -// -// Credit for this trick goes to Ken. - -type leftCheat struct { - delta int // number of new digits - cutoff string // minus one digit if original < a. -} - -var leftcheats = []leftCheat{ - // Leading digits of 1/2^i = 5^i. - // 5^23 is not an exact 64-bit floating point number, - // so have to use bc for the math. - // Go up to 60 to be large enough for 32bit and 64bit platforms. - /* - seq 60 | sed 's/^/5^/' | bc | - awk 'BEGIN{ print "\t{ 0, \"\" }," } - { - log2 = log(2)/log(10) - printf("\t{ %d, \"%s\" },\t// * %d\n", - int(log2*NR+1), $0, 2**NR) - }' - */ - {0, ""}, - {1, "5"}, // * 2 - {1, "25"}, // * 4 - {1, "125"}, // * 8 - {2, "625"}, // * 16 - {2, "3125"}, // * 32 - {2, "15625"}, // * 64 - {3, "78125"}, // * 128 - {3, "390625"}, // * 256 - {3, "1953125"}, // * 512 - {4, "9765625"}, // * 1024 - {4, "48828125"}, // * 2048 - {4, "244140625"}, // * 4096 - {4, "1220703125"}, // * 8192 - {5, "6103515625"}, // * 16384 - {5, "30517578125"}, // * 32768 - {5, "152587890625"}, // * 65536 - {6, "762939453125"}, // * 131072 - {6, "3814697265625"}, // * 262144 - {6, "19073486328125"}, // * 524288 - {7, "95367431640625"}, // * 1048576 - {7, "476837158203125"}, // * 2097152 - {7, "2384185791015625"}, // * 4194304 - {7, "11920928955078125"}, // * 8388608 - {8, "59604644775390625"}, // * 16777216 - {8, "298023223876953125"}, // * 33554432 - {8, "1490116119384765625"}, // * 67108864 - {9, "7450580596923828125"}, // * 134217728 - {9, "37252902984619140625"}, // * 268435456 - {9, "186264514923095703125"}, // * 536870912 - {10, "931322574615478515625"}, // * 1073741824 - {10, "4656612873077392578125"}, // * 2147483648 - {10, "23283064365386962890625"}, // * 4294967296 - {10, "116415321826934814453125"}, // * 8589934592 - {11, "582076609134674072265625"}, // * 17179869184 - {11, "2910383045673370361328125"}, // * 34359738368 - {11, "14551915228366851806640625"}, // * 68719476736 - {12, "72759576141834259033203125"}, // * 137438953472 - {12, "363797880709171295166015625"}, // * 274877906944 - {12, "1818989403545856475830078125"}, // * 549755813888 - {13, "9094947017729282379150390625"}, // * 1099511627776 - {13, "45474735088646411895751953125"}, // * 2199023255552 - {13, "227373675443232059478759765625"}, // * 4398046511104 - {13, "1136868377216160297393798828125"}, // * 8796093022208 - {14, "5684341886080801486968994140625"}, // * 17592186044416 - {14, "28421709430404007434844970703125"}, // * 35184372088832 - {14, "142108547152020037174224853515625"}, // * 70368744177664 - {15, "710542735760100185871124267578125"}, // * 140737488355328 - {15, "3552713678800500929355621337890625"}, // * 281474976710656 - {15, "17763568394002504646778106689453125"}, // * 562949953421312 - {16, "88817841970012523233890533447265625"}, // * 1125899906842624 - {16, "444089209850062616169452667236328125"}, // * 2251799813685248 - {16, "2220446049250313080847263336181640625"}, // * 4503599627370496 - {16, "11102230246251565404236316680908203125"}, // * 9007199254740992 - {17, "55511151231257827021181583404541015625"}, // * 18014398509481984 - {17, "277555756156289135105907917022705078125"}, // * 36028797018963968 - {17, "1387778780781445675529539585113525390625"}, // * 72057594037927936 - {18, "6938893903907228377647697925567626953125"}, // * 144115188075855872 - {18, "34694469519536141888238489627838134765625"}, // * 288230376151711744 - {18, "173472347597680709441192448139190673828125"}, // * 576460752303423488 - {19, "867361737988403547205962240695953369140625"}, // * 1152921504606846976 -} - -// Is the leading prefix of b lexicographically less than s? -func prefixIsLessThan(b []byte, s string) bool { - for i := 0; i < len(s); i++ { - if i >= len(b) { - return true - } - if b[i] != s[i] { - return b[i] < s[i] - } - } - return false -} - -// Binary shift left (* 2) by k bits. k <= maxShift to avoid overflow. -func leftShift(a *decimal, k uint) { - delta := leftcheats[k].delta - if prefixIsLessThan(a.d[0:a.nd], leftcheats[k].cutoff) { - delta-- - } - - r := a.nd // read index - w := a.nd + delta // write index - - // Pick up a digit, put down a digit. - var n uint - for r--; r >= 0; r-- { - n += (uint(a.d[r]) - '0') << k - quo := n / 10 - rem := n - 10*quo - w-- - if w < len(a.d) { - a.d[w] = byte(rem + '0') - } else if rem != 0 { - a.trunc = true - } - n = quo - } - - // Put down extra digits. - for n > 0 { - quo := n / 10 - rem := n - 10*quo - w-- - if w < len(a.d) { - a.d[w] = byte(rem + '0') - } else if rem != 0 { - a.trunc = true - } - n = quo - } - - a.nd += delta - if a.nd >= len(a.d) { - a.nd = len(a.d) - } - a.dp += delta - trim(a) -} - -// Binary shift left (k > 0) or right (k < 0). -func (a *decimal) Shift(k int) { - switch { - case a.nd == 0: - // nothing to do: a == 0 - case k > 0: - for k > maxShift { - leftShift(a, maxShift) - k -= maxShift - } - leftShift(a, uint(k)) - case k < 0: - for k < -maxShift { - rightShift(a, maxShift) - k += maxShift - } - rightShift(a, uint(-k)) - } -} - -// If we chop a at nd digits, should we round up? -func shouldRoundUp(a *decimal, nd int) bool { - if nd < 0 || nd >= a.nd { - return false - } - if a.d[nd] == '5' && nd+1 == a.nd { // exactly halfway - round to even - // if we truncated, a little higher than what's recorded - always round up - if a.trunc { - return true - } - return nd > 0 && (a.d[nd-1]-'0')%2 != 0 - } - // not halfway - digit tells all - return a.d[nd] >= '5' -} - -// Round a to nd digits (or fewer). -// If nd is zero, it means we're rounding -// just to the left of the digits, as in -// 0.09 -> 0.1. -func (a *decimal) Round(nd int) { - if nd < 0 || nd >= a.nd { - return - } - if shouldRoundUp(a, nd) { - a.RoundUp(nd) - } else { - a.RoundDown(nd) - } -} - -// Round a down to nd digits (or fewer). -func (a *decimal) RoundDown(nd int) { - if nd < 0 || nd >= a.nd { - return - } - a.nd = nd - trim(a) -} - -// Round a up to nd digits (or fewer). -func (a *decimal) RoundUp(nd int) { - if nd < 0 || nd >= a.nd { - return - } - - // round up - for i := nd - 1; i >= 0; i-- { - c := a.d[i] - if c < '9' { // can stop after this digit - a.d[i]++ - a.nd = i + 1 - return - } - } - - // Number is all 9s. - // Change to single 1 with adjusted decimal point. - a.d[0] = '1' - a.nd = 1 - a.dp++ -} - -// Extract integer part, rounded appropriately. -// No guarantees about overflow. -func (a *decimal) RoundedInteger() uint64 { - if a.dp > 20 { - return 0xFFFFFFFFFFFFFFFF - } - var i int - n := uint64(0) - for i = 0; i < a.dp && i < a.nd; i++ { - n = n*10 + uint64(a.d[i]-'0') - } - for ; i < a.dp; i++ { - n *= 10 - } - if shouldRoundUp(a, a.dp) { - n++ - } - return n -} diff --git a/vendor/github.com/shopspring/decimal/decimal.go b/vendor/github.com/shopspring/decimal/decimal.go deleted file mode 100644 index 84405ec1cf..0000000000 --- a/vendor/github.com/shopspring/decimal/decimal.go +++ /dev/null @@ -1,1904 +0,0 @@ -// Package decimal implements an arbitrary precision fixed-point decimal. -// -// The zero-value of a Decimal is 0, as you would expect. -// -// The best way to create a new Decimal is to use decimal.NewFromString, ex: -// -// n, err := decimal.NewFromString("-123.4567") -// n.String() // output: "-123.4567" -// -// To use Decimal as part of a struct: -// -// type Struct struct { -// Number Decimal -// } -// -// Note: This can "only" represent numbers with a maximum of 2^31 digits after the decimal point. -package decimal - -import ( - "database/sql/driver" - "encoding/binary" - "fmt" - "math" - "math/big" - "regexp" - "strconv" - "strings" -) - -// DivisionPrecision is the number of decimal places in the result when it -// doesn't divide exactly. -// -// Example: -// -// d1 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(3)) -// d1.String() // output: "0.6666666666666667" -// d2 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(30000)) -// d2.String() // output: "0.0000666666666667" -// d3 := decimal.NewFromFloat(20000).Div(decimal.NewFromFloat(3)) -// d3.String() // output: "6666.6666666666666667" -// decimal.DivisionPrecision = 3 -// d4 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(3)) -// d4.String() // output: "0.667" -// -var DivisionPrecision = 16 - -// MarshalJSONWithoutQuotes should be set to true if you want the decimal to -// be JSON marshaled as a number, instead of as a string. -// WARNING: this is dangerous for decimals with many digits, since many JSON -// unmarshallers (ex: Javascript's) will unmarshal JSON numbers to IEEE 754 -// double-precision floating point numbers, which means you can potentially -// silently lose precision. -var MarshalJSONWithoutQuotes = false - -// ExpMaxIterations specifies the maximum number of iterations needed to calculate -// precise natural exponent value using ExpHullAbrham method. -var ExpMaxIterations = 1000 - -// Zero constant, to make computations faster. -// Zero should never be compared with == or != directly, please use decimal.Equal or decimal.Cmp instead. -var Zero = New(0, 1) - -var zeroInt = big.NewInt(0) -var oneInt = big.NewInt(1) -var twoInt = big.NewInt(2) -var fourInt = big.NewInt(4) -var fiveInt = big.NewInt(5) -var tenInt = big.NewInt(10) -var twentyInt = big.NewInt(20) - -var factorials = []Decimal{New(1, 0)} - -// Decimal represents a fixed-point decimal. It is immutable. -// number = value * 10 ^ exp -type Decimal struct { - value *big.Int - - // NOTE(vadim): this must be an int32, because we cast it to float64 during - // calculations. If exp is 64 bit, we might lose precision. - // If we cared about being able to represent every possible decimal, we - // could make exp a *big.Int but it would hurt performance and numbers - // like that are unrealistic. - exp int32 -} - -// New returns a new fixed-point decimal, value * 10 ^ exp. -func New(value int64, exp int32) Decimal { - return Decimal{ - value: big.NewInt(value), - exp: exp, - } -} - -// NewFromInt converts a int64 to Decimal. -// -// Example: -// -// NewFromInt(123).String() // output: "123" -// NewFromInt(-10).String() // output: "-10" -func NewFromInt(value int64) Decimal { - return Decimal{ - value: big.NewInt(value), - exp: 0, - } -} - -// NewFromInt32 converts a int32 to Decimal. -// -// Example: -// -// NewFromInt(123).String() // output: "123" -// NewFromInt(-10).String() // output: "-10" -func NewFromInt32(value int32) Decimal { - return Decimal{ - value: big.NewInt(int64(value)), - exp: 0, - } -} - -// NewFromBigInt returns a new Decimal from a big.Int, value * 10 ^ exp -func NewFromBigInt(value *big.Int, exp int32) Decimal { - return Decimal{ - value: new(big.Int).Set(value), - exp: exp, - } -} - -// NewFromString returns a new Decimal from a string representation. -// Trailing zeroes are not trimmed. -// -// Example: -// -// d, err := NewFromString("-123.45") -// d2, err := NewFromString(".0001") -// d3, err := NewFromString("1.47000") -// -func NewFromString(value string) (Decimal, error) { - originalInput := value - var intString string - var exp int64 - - // Check if number is using scientific notation - eIndex := strings.IndexAny(value, "Ee") - if eIndex != -1 { - expInt, err := strconv.ParseInt(value[eIndex+1:], 10, 32) - if err != nil { - if e, ok := err.(*strconv.NumError); ok && e.Err == strconv.ErrRange { - return Decimal{}, fmt.Errorf("can't convert %s to decimal: fractional part too long", value) - } - return Decimal{}, fmt.Errorf("can't convert %s to decimal: exponent is not numeric", value) - } - value = value[:eIndex] - exp = expInt - } - - pIndex := -1 - vLen := len(value) - for i := 0; i < vLen; i++ { - if value[i] == '.' { - if pIndex > -1 { - return Decimal{}, fmt.Errorf("can't convert %s to decimal: too many .s", value) - } - pIndex = i - } - } - - if pIndex == -1 { - // There is no decimal point, we can just parse the original string as - // an int - intString = value - } else { - if pIndex+1 < vLen { - intString = value[:pIndex] + value[pIndex+1:] - } else { - intString = value[:pIndex] - } - expInt := -len(value[pIndex+1:]) - exp += int64(expInt) - } - - var dValue *big.Int - // strconv.ParseInt is faster than new(big.Int).SetString so this is just a shortcut for strings we know won't overflow - if len(intString) <= 18 { - parsed64, err := strconv.ParseInt(intString, 10, 64) - if err != nil { - return Decimal{}, fmt.Errorf("can't convert %s to decimal", value) - } - dValue = big.NewInt(parsed64) - } else { - dValue = new(big.Int) - _, ok := dValue.SetString(intString, 10) - if !ok { - return Decimal{}, fmt.Errorf("can't convert %s to decimal", value) - } - } - - if exp < math.MinInt32 || exp > math.MaxInt32 { - // NOTE(vadim): I doubt a string could realistically be this long - return Decimal{}, fmt.Errorf("can't convert %s to decimal: fractional part too long", originalInput) - } - - return Decimal{ - value: dValue, - exp: int32(exp), - }, nil -} - -// NewFromFormattedString returns a new Decimal from a formatted string representation. -// The second argument - replRegexp, is a regular expression that is used to find characters that should be -// removed from given decimal string representation. All matched characters will be replaced with an empty string. -// -// Example: -// -// r := regexp.MustCompile("[$,]") -// d1, err := NewFromFormattedString("$5,125.99", r) -// -// r2 := regexp.MustCompile("[_]") -// d2, err := NewFromFormattedString("1_000_000", r2) -// -// r3 := regexp.MustCompile("[USD\\s]") -// d3, err := NewFromFormattedString("5000 USD", r3) -// -func NewFromFormattedString(value string, replRegexp *regexp.Regexp) (Decimal, error) { - parsedValue := replRegexp.ReplaceAllString(value, "") - d, err := NewFromString(parsedValue) - if err != nil { - return Decimal{}, err - } - return d, nil -} - -// RequireFromString returns a new Decimal from a string representation -// or panics if NewFromString would have returned an error. -// -// Example: -// -// d := RequireFromString("-123.45") -// d2 := RequireFromString(".0001") -// -func RequireFromString(value string) Decimal { - dec, err := NewFromString(value) - if err != nil { - panic(err) - } - return dec -} - -// NewFromFloat converts a float64 to Decimal. -// -// The converted number will contain the number of significant digits that can be -// represented in a float with reliable roundtrip. -// This is typically 15 digits, but may be more in some cases. -// See https://www.exploringbinary.com/decimal-precision-of-binary-floating-point-numbers/ for more information. -// -// For slightly faster conversion, use NewFromFloatWithExponent where you can specify the precision in absolute terms. -// -// NOTE: this will panic on NaN, +/-inf -func NewFromFloat(value float64) Decimal { - if value == 0 { - return New(0, 0) - } - return newFromFloat(value, math.Float64bits(value), &float64info) -} - -// NewFromFloat32 converts a float32 to Decimal. -// -// The converted number will contain the number of significant digits that can be -// represented in a float with reliable roundtrip. -// This is typically 6-8 digits depending on the input. -// See https://www.exploringbinary.com/decimal-precision-of-binary-floating-point-numbers/ for more information. -// -// For slightly faster conversion, use NewFromFloatWithExponent where you can specify the precision in absolute terms. -// -// NOTE: this will panic on NaN, +/-inf -func NewFromFloat32(value float32) Decimal { - if value == 0 { - return New(0, 0) - } - // XOR is workaround for https://github.com/golang/go/issues/26285 - a := math.Float32bits(value) ^ 0x80808080 - return newFromFloat(float64(value), uint64(a)^0x80808080, &float32info) -} - -func newFromFloat(val float64, bits uint64, flt *floatInfo) Decimal { - if math.IsNaN(val) || math.IsInf(val, 0) { - panic(fmt.Sprintf("Cannot create a Decimal from %v", val)) - } - exp := int(bits>>flt.mantbits) & (1<>(flt.expbits+flt.mantbits) != 0 - - roundShortest(&d, mant, exp, flt) - // If less than 19 digits, we can do calculation in an int64. - if d.nd < 19 { - tmp := int64(0) - m := int64(1) - for i := d.nd - 1; i >= 0; i-- { - tmp += m * int64(d.d[i]-'0') - m *= 10 - } - if d.neg { - tmp *= -1 - } - return Decimal{value: big.NewInt(tmp), exp: int32(d.dp) - int32(d.nd)} - } - dValue := new(big.Int) - dValue, ok := dValue.SetString(string(d.d[:d.nd]), 10) - if ok { - return Decimal{value: dValue, exp: int32(d.dp) - int32(d.nd)} - } - - return NewFromFloatWithExponent(val, int32(d.dp)-int32(d.nd)) -} - -// NewFromFloatWithExponent converts a float64 to Decimal, with an arbitrary -// number of fractional digits. -// -// Example: -// -// NewFromFloatWithExponent(123.456, -2).String() // output: "123.46" -// -func NewFromFloatWithExponent(value float64, exp int32) Decimal { - if math.IsNaN(value) || math.IsInf(value, 0) { - panic(fmt.Sprintf("Cannot create a Decimal from %v", value)) - } - - bits := math.Float64bits(value) - mant := bits & (1<<52 - 1) - exp2 := int32((bits >> 52) & (1<<11 - 1)) - sign := bits >> 63 - - if exp2 == 0 { - // specials - if mant == 0 { - return Decimal{} - } - // subnormal - exp2++ - } else { - // normal - mant |= 1 << 52 - } - - exp2 -= 1023 + 52 - - // normalizing base-2 values - for mant&1 == 0 { - mant = mant >> 1 - exp2++ - } - - // maximum number of fractional base-10 digits to represent 2^N exactly cannot be more than -N if N<0 - if exp < 0 && exp < exp2 { - if exp2 < 0 { - exp = exp2 - } else { - exp = 0 - } - } - - // representing 10^M * 2^N as 5^M * 2^(M+N) - exp2 -= exp - - temp := big.NewInt(1) - dMant := big.NewInt(int64(mant)) - - // applying 5^M - if exp > 0 { - temp = temp.SetInt64(int64(exp)) - temp = temp.Exp(fiveInt, temp, nil) - } else if exp < 0 { - temp = temp.SetInt64(-int64(exp)) - temp = temp.Exp(fiveInt, temp, nil) - dMant = dMant.Mul(dMant, temp) - temp = temp.SetUint64(1) - } - - // applying 2^(M+N) - if exp2 > 0 { - dMant = dMant.Lsh(dMant, uint(exp2)) - } else if exp2 < 0 { - temp = temp.Lsh(temp, uint(-exp2)) - } - - // rounding and downscaling - if exp > 0 || exp2 < 0 { - halfDown := new(big.Int).Rsh(temp, 1) - dMant = dMant.Add(dMant, halfDown) - dMant = dMant.Quo(dMant, temp) - } - - if sign == 1 { - dMant = dMant.Neg(dMant) - } - - return Decimal{ - value: dMant, - exp: exp, - } -} - -// Copy returns a copy of decimal with the same value and exponent, but a different pointer to value. -func (d Decimal) Copy() Decimal { - d.ensureInitialized() - return Decimal{ - value: &(*d.value), - exp: d.exp, - } -} - -// rescale returns a rescaled version of the decimal. Returned -// decimal may be less precise if the given exponent is bigger -// than the initial exponent of the Decimal. -// NOTE: this will truncate, NOT round -// -// Example: -// -// d := New(12345, -4) -// d2 := d.rescale(-1) -// d3 := d2.rescale(-4) -// println(d1) -// println(d2) -// println(d3) -// -// Output: -// -// 1.2345 -// 1.2 -// 1.2000 -// -func (d Decimal) rescale(exp int32) Decimal { - d.ensureInitialized() - - if d.exp == exp { - return Decimal{ - new(big.Int).Set(d.value), - d.exp, - } - } - - // NOTE(vadim): must convert exps to float64 before - to prevent overflow - diff := math.Abs(float64(exp) - float64(d.exp)) - value := new(big.Int).Set(d.value) - - expScale := new(big.Int).Exp(tenInt, big.NewInt(int64(diff)), nil) - if exp > d.exp { - value = value.Quo(value, expScale) - } else if exp < d.exp { - value = value.Mul(value, expScale) - } - - return Decimal{ - value: value, - exp: exp, - } -} - -// Abs returns the absolute value of the decimal. -func (d Decimal) Abs() Decimal { - if !d.IsNegative() { - return d - } - d.ensureInitialized() - d2Value := new(big.Int).Abs(d.value) - return Decimal{ - value: d2Value, - exp: d.exp, - } -} - -// Add returns d + d2. -func (d Decimal) Add(d2 Decimal) Decimal { - rd, rd2 := RescalePair(d, d2) - - d3Value := new(big.Int).Add(rd.value, rd2.value) - return Decimal{ - value: d3Value, - exp: rd.exp, - } -} - -// Sub returns d - d2. -func (d Decimal) Sub(d2 Decimal) Decimal { - rd, rd2 := RescalePair(d, d2) - - d3Value := new(big.Int).Sub(rd.value, rd2.value) - return Decimal{ - value: d3Value, - exp: rd.exp, - } -} - -// Neg returns -d. -func (d Decimal) Neg() Decimal { - d.ensureInitialized() - val := new(big.Int).Neg(d.value) - return Decimal{ - value: val, - exp: d.exp, - } -} - -// Mul returns d * d2. -func (d Decimal) Mul(d2 Decimal) Decimal { - d.ensureInitialized() - d2.ensureInitialized() - - expInt64 := int64(d.exp) + int64(d2.exp) - if expInt64 > math.MaxInt32 || expInt64 < math.MinInt32 { - // NOTE(vadim): better to panic than give incorrect results, as - // Decimals are usually used for money - panic(fmt.Sprintf("exponent %v overflows an int32!", expInt64)) - } - - d3Value := new(big.Int).Mul(d.value, d2.value) - return Decimal{ - value: d3Value, - exp: int32(expInt64), - } -} - -// Shift shifts the decimal in base 10. -// It shifts left when shift is positive and right if shift is negative. -// In simpler terms, the given value for shift is added to the exponent -// of the decimal. -func (d Decimal) Shift(shift int32) Decimal { - d.ensureInitialized() - return Decimal{ - value: new(big.Int).Set(d.value), - exp: d.exp + shift, - } -} - -// Div returns d / d2. If it doesn't divide exactly, the result will have -// DivisionPrecision digits after the decimal point. -func (d Decimal) Div(d2 Decimal) Decimal { - return d.DivRound(d2, int32(DivisionPrecision)) -} - -// QuoRem does divsion with remainder -// d.QuoRem(d2,precision) returns quotient q and remainder r such that -// d = d2 * q + r, q an integer multiple of 10^(-precision) -// 0 <= r < abs(d2) * 10 ^(-precision) if d>=0 -// 0 >= r > -abs(d2) * 10 ^(-precision) if d<0 -// Note that precision<0 is allowed as input. -func (d Decimal) QuoRem(d2 Decimal, precision int32) (Decimal, Decimal) { - d.ensureInitialized() - d2.ensureInitialized() - if d2.value.Sign() == 0 { - panic("decimal division by 0") - } - scale := -precision - e := int64(d.exp - d2.exp - scale) - if e > math.MaxInt32 || e < math.MinInt32 { - panic("overflow in decimal QuoRem") - } - var aa, bb, expo big.Int - var scalerest int32 - // d = a 10^ea - // d2 = b 10^eb - if e < 0 { - aa = *d.value - expo.SetInt64(-e) - bb.Exp(tenInt, &expo, nil) - bb.Mul(d2.value, &bb) - scalerest = d.exp - // now aa = a - // bb = b 10^(scale + eb - ea) - } else { - expo.SetInt64(e) - aa.Exp(tenInt, &expo, nil) - aa.Mul(d.value, &aa) - bb = *d2.value - scalerest = scale + d2.exp - // now aa = a ^ (ea - eb - scale) - // bb = b - } - var q, r big.Int - q.QuoRem(&aa, &bb, &r) - dq := Decimal{value: &q, exp: scale} - dr := Decimal{value: &r, exp: scalerest} - return dq, dr -} - -// DivRound divides and rounds to a given precision -// i.e. to an integer multiple of 10^(-precision) -// for a positive quotient digit 5 is rounded up, away from 0 -// if the quotient is negative then digit 5 is rounded down, away from 0 -// Note that precision<0 is allowed as input. -func (d Decimal) DivRound(d2 Decimal, precision int32) Decimal { - // QuoRem already checks initialization - q, r := d.QuoRem(d2, precision) - // the actual rounding decision is based on comparing r*10^precision and d2/2 - // instead compare 2 r 10 ^precision and d2 - var rv2 big.Int - rv2.Abs(r.value) - rv2.Lsh(&rv2, 1) - // now rv2 = abs(r.value) * 2 - r2 := Decimal{value: &rv2, exp: r.exp + precision} - // r2 is now 2 * r * 10 ^ precision - var c = r2.Cmp(d2.Abs()) - - if c < 0 { - return q - } - - if d.value.Sign()*d2.value.Sign() < 0 { - return q.Sub(New(1, -precision)) - } - - return q.Add(New(1, -precision)) -} - -// Mod returns d % d2. -func (d Decimal) Mod(d2 Decimal) Decimal { - quo := d.Div(d2).Truncate(0) - return d.Sub(d2.Mul(quo)) -} - -// Pow returns d to the power d2 -func (d Decimal) Pow(d2 Decimal) Decimal { - var temp Decimal - if d2.IntPart() == 0 { - return NewFromFloat(1) - } - temp = d.Pow(d2.Div(NewFromFloat(2))) - if d2.IntPart()%2 == 0 { - return temp.Mul(temp) - } - if d2.IntPart() > 0 { - return temp.Mul(temp).Mul(d) - } - return temp.Mul(temp).Div(d) -} - -// ExpHullAbrham calculates the natural exponent of decimal (e to the power of d) using Hull-Abraham algorithm. -// OverallPrecision argument specifies the overall precision of the result (integer part + decimal part). -// -// ExpHullAbrham is faster than ExpTaylor for small precision values, but it is much slower for large precision values. -// -// Example: -// -// NewFromFloat(26.1).ExpHullAbrham(2).String() // output: "220000000000" -// NewFromFloat(26.1).ExpHullAbrham(20).String() // output: "216314672147.05767284" -// -func (d Decimal) ExpHullAbrham(overallPrecision uint32) (Decimal, error) { - // Algorithm based on Variable precision exponential function. - // ACM Transactions on Mathematical Software by T. E. Hull & A. Abrham. - if d.IsZero() { - return Decimal{oneInt, 0}, nil - } - - currentPrecision := overallPrecision - - // Algorithm does not work if currentPrecision * 23 < |x|. - // Precision is automatically increased in such cases, so the value can be calculated precisely. - // If newly calculated precision is higher than ExpMaxIterations the currentPrecision will not be changed. - f := d.Abs().InexactFloat64() - if ncp := f / 23; ncp > float64(currentPrecision) && ncp < float64(ExpMaxIterations) { - currentPrecision = uint32(math.Ceil(ncp)) - } - - // fail if abs(d) beyond an over/underflow threshold - overflowThreshold := New(23*int64(currentPrecision), 0) - if d.Abs().Cmp(overflowThreshold) > 0 { - return Decimal{}, fmt.Errorf("over/underflow threshold, exp(x) cannot be calculated precisely") - } - - // Return 1 if abs(d) small enough; this also avoids later over/underflow - overflowThreshold2 := New(9, -int32(currentPrecision)-1) - if d.Abs().Cmp(overflowThreshold2) <= 0 { - return Decimal{oneInt, d.exp}, nil - } - - // t is the smallest integer >= 0 such that the corresponding abs(d/k) < 1 - t := d.exp + int32(d.NumDigits()) // Add d.NumDigits because the paper assumes that d.value [0.1, 1) - - if t < 0 { - t = 0 - } - - k := New(1, t) // reduction factor - r := Decimal{new(big.Int).Set(d.value), d.exp - t} // reduced argument - p := int32(currentPrecision) + t + 2 // precision for calculating the sum - - // Determine n, the number of therms for calculating sum - // use first Newton step (1.435p - 1.182) / log10(p/abs(r)) - // for solving appropriate equation, along with directed - // roundings and simple rational bound for log10(p/abs(r)) - rf := r.Abs().InexactFloat64() - pf := float64(p) - nf := math.Ceil((1.453*pf - 1.182) / math.Log10(pf/rf)) - if nf > float64(ExpMaxIterations) || math.IsNaN(nf) { - return Decimal{}, fmt.Errorf("exact value cannot be calculated in <=ExpMaxIterations iterations") - } - n := int64(nf) - - tmp := New(0, 0) - sum := New(1, 0) - one := New(1, 0) - for i := n - 1; i > 0; i-- { - tmp.value.SetInt64(i) - sum = sum.Mul(r.DivRound(tmp, p)) - sum = sum.Add(one) - } - - ki := k.IntPart() - res := New(1, 0) - for i := ki; i > 0; i-- { - res = res.Mul(sum) - } - - resNumDigits := int32(res.NumDigits()) - - var roundDigits int32 - if resNumDigits > abs(res.exp) { - roundDigits = int32(currentPrecision) - resNumDigits - res.exp - } else { - roundDigits = int32(currentPrecision) - } - - res = res.Round(roundDigits) - - return res, nil -} - -// ExpTaylor calculates the natural exponent of decimal (e to the power of d) using Taylor series expansion. -// Precision argument specifies how precise the result must be (number of digits after decimal point). -// Negative precision is allowed. -// -// ExpTaylor is much faster for large precision values than ExpHullAbrham. -// -// Example: -// -// d, err := NewFromFloat(26.1).ExpTaylor(2).String() -// d.String() // output: "216314672147.06" -// -// NewFromFloat(26.1).ExpTaylor(20).String() -// d.String() // output: "216314672147.05767284062928674083" -// -// NewFromFloat(26.1).ExpTaylor(-10).String() -// d.String() // output: "220000000000" -// -func (d Decimal) ExpTaylor(precision int32) (Decimal, error) { - // Note(mwoss): Implementation can be optimized by exclusively using big.Int API only - if d.IsZero() { - return Decimal{oneInt, 0}.Round(precision), nil - } - - var epsilon Decimal - var divPrecision int32 - if precision < 0 { - epsilon = New(1, -1) - divPrecision = 8 - } else { - epsilon = New(1, -precision-1) - divPrecision = precision + 1 - } - - decAbs := d.Abs() - pow := d.Abs() - factorial := New(1, 0) - - result := New(1, 0) - - for i := int64(1); ; { - step := pow.DivRound(factorial, divPrecision) - result = result.Add(step) - - // Stop Taylor series when current step is smaller than epsilon - if step.Cmp(epsilon) < 0 { - break - } - - pow = pow.Mul(decAbs) - - i++ - - // Calculate next factorial number or retrieve cached value - if len(factorials) >= int(i) && !factorials[i-1].IsZero() { - factorial = factorials[i-1] - } else { - // To avoid any race conditions, firstly the zero value is appended to a slice to create - // a spot for newly calculated factorial. After that, the zero value is replaced by calculated - // factorial using the index notation. - factorial = factorials[i-2].Mul(New(i, 0)) - factorials = append(factorials, Zero) - factorials[i-1] = factorial - } - } - - if d.Sign() < 0 { - result = New(1, 0).DivRound(result, precision+1) - } - - result = result.Round(precision) - return result, nil -} - -// NumDigits returns the number of digits of the decimal coefficient (d.Value) -// Note: Current implementation is extremely slow for large decimals and/or decimals with large fractional part -func (d Decimal) NumDigits() int { - // Note(mwoss): It can be optimized, unnecessary cast of big.Int to string - if d.IsNegative() { - return len(d.value.String()) - 1 - } - return len(d.value.String()) -} - -// IsInteger returns true when decimal can be represented as an integer value, otherwise, it returns false. -func (d Decimal) IsInteger() bool { - // The most typical case, all decimal with exponent higher or equal 0 can be represented as integer - if d.exp >= 0 { - return true - } - // When the exponent is negative we have to check every number after the decimal place - // If all of them are zeroes, we are sure that given decimal can be represented as an integer - var r big.Int - q := new(big.Int).Set(d.value) - for z := abs(d.exp); z > 0; z-- { - q.QuoRem(q, tenInt, &r) - if r.Cmp(zeroInt) != 0 { - return false - } - } - return true -} - -// Abs calculates absolute value of any int32. Used for calculating absolute value of decimal's exponent. -func abs(n int32) int32 { - if n < 0 { - return -n - } - return n -} - -// Cmp compares the numbers represented by d and d2 and returns: -// -// -1 if d < d2 -// 0 if d == d2 -// +1 if d > d2 -// -func (d Decimal) Cmp(d2 Decimal) int { - d.ensureInitialized() - d2.ensureInitialized() - - if d.exp == d2.exp { - return d.value.Cmp(d2.value) - } - - rd, rd2 := RescalePair(d, d2) - - return rd.value.Cmp(rd2.value) -} - -// Equal returns whether the numbers represented by d and d2 are equal. -func (d Decimal) Equal(d2 Decimal) bool { - return d.Cmp(d2) == 0 -} - -// Equals is deprecated, please use Equal method instead -func (d Decimal) Equals(d2 Decimal) bool { - return d.Equal(d2) -} - -// GreaterThan (GT) returns true when d is greater than d2. -func (d Decimal) GreaterThan(d2 Decimal) bool { - return d.Cmp(d2) == 1 -} - -// GreaterThanOrEqual (GTE) returns true when d is greater than or equal to d2. -func (d Decimal) GreaterThanOrEqual(d2 Decimal) bool { - cmp := d.Cmp(d2) - return cmp == 1 || cmp == 0 -} - -// LessThan (LT) returns true when d is less than d2. -func (d Decimal) LessThan(d2 Decimal) bool { - return d.Cmp(d2) == -1 -} - -// LessThanOrEqual (LTE) returns true when d is less than or equal to d2. -func (d Decimal) LessThanOrEqual(d2 Decimal) bool { - cmp := d.Cmp(d2) - return cmp == -1 || cmp == 0 -} - -// Sign returns: -// -// -1 if d < 0 -// 0 if d == 0 -// +1 if d > 0 -// -func (d Decimal) Sign() int { - if d.value == nil { - return 0 - } - return d.value.Sign() -} - -// IsPositive return -// -// true if d > 0 -// false if d == 0 -// false if d < 0 -func (d Decimal) IsPositive() bool { - return d.Sign() == 1 -} - -// IsNegative return -// -// true if d < 0 -// false if d == 0 -// false if d > 0 -func (d Decimal) IsNegative() bool { - return d.Sign() == -1 -} - -// IsZero return -// -// true if d == 0 -// false if d > 0 -// false if d < 0 -func (d Decimal) IsZero() bool { - return d.Sign() == 0 -} - -// Exponent returns the exponent, or scale component of the decimal. -func (d Decimal) Exponent() int32 { - return d.exp -} - -// Coefficient returns the coefficient of the decimal. It is scaled by 10^Exponent() -func (d Decimal) Coefficient() *big.Int { - d.ensureInitialized() - // we copy the coefficient so that mutating the result does not mutate the Decimal. - return new(big.Int).Set(d.value) -} - -// CoefficientInt64 returns the coefficient of the decimal as int64. It is scaled by 10^Exponent() -// If coefficient cannot be represented in an int64, the result will be undefined. -func (d Decimal) CoefficientInt64() int64 { - d.ensureInitialized() - return d.value.Int64() -} - -// IntPart returns the integer component of the decimal. -func (d Decimal) IntPart() int64 { - scaledD := d.rescale(0) - return scaledD.value.Int64() -} - -// BigInt returns integer component of the decimal as a BigInt. -func (d Decimal) BigInt() *big.Int { - scaledD := d.rescale(0) - i := &big.Int{} - i.SetString(scaledD.String(), 10) - return i -} - -// BigFloat returns decimal as BigFloat. -// Be aware that casting decimal to BigFloat might cause a loss of precision. -func (d Decimal) BigFloat() *big.Float { - f := &big.Float{} - f.SetString(d.String()) - return f -} - -// Rat returns a rational number representation of the decimal. -func (d Decimal) Rat() *big.Rat { - d.ensureInitialized() - if d.exp <= 0 { - // NOTE(vadim): must negate after casting to prevent int32 overflow - denom := new(big.Int).Exp(tenInt, big.NewInt(-int64(d.exp)), nil) - return new(big.Rat).SetFrac(d.value, denom) - } - - mul := new(big.Int).Exp(tenInt, big.NewInt(int64(d.exp)), nil) - num := new(big.Int).Mul(d.value, mul) - return new(big.Rat).SetFrac(num, oneInt) -} - -// Float64 returns the nearest float64 value for d and a bool indicating -// whether f represents d exactly. -// For more details, see the documentation for big.Rat.Float64 -func (d Decimal) Float64() (f float64, exact bool) { - return d.Rat().Float64() -} - -// InexactFloat64 returns the nearest float64 value for d. -// It doesn't indicate if the returned value represents d exactly. -func (d Decimal) InexactFloat64() float64 { - f, _ := d.Float64() - return f -} - -// String returns the string representation of the decimal -// with the fixed point. -// -// Example: -// -// d := New(-12345, -3) -// println(d.String()) -// -// Output: -// -// -12.345 -// -func (d Decimal) String() string { - return d.string(true) -} - -// StringFixed returns a rounded fixed-point string with places digits after -// the decimal point. -// -// Example: -// -// NewFromFloat(0).StringFixed(2) // output: "0.00" -// NewFromFloat(0).StringFixed(0) // output: "0" -// NewFromFloat(5.45).StringFixed(0) // output: "5" -// NewFromFloat(5.45).StringFixed(1) // output: "5.5" -// NewFromFloat(5.45).StringFixed(2) // output: "5.45" -// NewFromFloat(5.45).StringFixed(3) // output: "5.450" -// NewFromFloat(545).StringFixed(-1) // output: "550" -// -func (d Decimal) StringFixed(places int32) string { - rounded := d.Round(places) - return rounded.string(false) -} - -// StringFixedBank returns a banker rounded fixed-point string with places digits -// after the decimal point. -// -// Example: -// -// NewFromFloat(0).StringFixedBank(2) // output: "0.00" -// NewFromFloat(0).StringFixedBank(0) // output: "0" -// NewFromFloat(5.45).StringFixedBank(0) // output: "5" -// NewFromFloat(5.45).StringFixedBank(1) // output: "5.4" -// NewFromFloat(5.45).StringFixedBank(2) // output: "5.45" -// NewFromFloat(5.45).StringFixedBank(3) // output: "5.450" -// NewFromFloat(545).StringFixedBank(-1) // output: "540" -// -func (d Decimal) StringFixedBank(places int32) string { - rounded := d.RoundBank(places) - return rounded.string(false) -} - -// StringFixedCash returns a Swedish/Cash rounded fixed-point string. For -// more details see the documentation at function RoundCash. -func (d Decimal) StringFixedCash(interval uint8) string { - rounded := d.RoundCash(interval) - return rounded.string(false) -} - -// Round rounds the decimal to places decimal places. -// If places < 0, it will round the integer part to the nearest 10^(-places). -// -// Example: -// -// NewFromFloat(5.45).Round(1).String() // output: "5.5" -// NewFromFloat(545).Round(-1).String() // output: "550" -// -func (d Decimal) Round(places int32) Decimal { - if d.exp == -places { - return d - } - // truncate to places + 1 - ret := d.rescale(-places - 1) - - // add sign(d) * 0.5 - if ret.value.Sign() < 0 { - ret.value.Sub(ret.value, fiveInt) - } else { - ret.value.Add(ret.value, fiveInt) - } - - // floor for positive numbers, ceil for negative numbers - _, m := ret.value.DivMod(ret.value, tenInt, new(big.Int)) - ret.exp++ - if ret.value.Sign() < 0 && m.Cmp(zeroInt) != 0 { - ret.value.Add(ret.value, oneInt) - } - - return ret -} - -// RoundCeil rounds the decimal towards +infinity. -// -// Example: -// -// NewFromFloat(545).RoundCeil(-2).String() // output: "600" -// NewFromFloat(500).RoundCeil(-2).String() // output: "500" -// NewFromFloat(1.1001).RoundCeil(2).String() // output: "1.11" -// NewFromFloat(-1.454).RoundCeil(1).String() // output: "-1.5" -// -func (d Decimal) RoundCeil(places int32) Decimal { - if d.exp >= -places { - return d - } - - rescaled := d.rescale(-places) - if d.Equal(rescaled) { - return d - } - - if d.value.Sign() > 0 { - rescaled.value.Add(rescaled.value, oneInt) - } - - return rescaled -} - -// RoundFloor rounds the decimal towards -infinity. -// -// Example: -// -// NewFromFloat(545).RoundFloor(-2).String() // output: "500" -// NewFromFloat(-500).RoundFloor(-2).String() // output: "-500" -// NewFromFloat(1.1001).RoundFloor(2).String() // output: "1.1" -// NewFromFloat(-1.454).RoundFloor(1).String() // output: "-1.4" -// -func (d Decimal) RoundFloor(places int32) Decimal { - if d.exp >= -places { - return d - } - - rescaled := d.rescale(-places) - if d.Equal(rescaled) { - return d - } - - if d.value.Sign() < 0 { - rescaled.value.Sub(rescaled.value, oneInt) - } - - return rescaled -} - -// RoundUp rounds the decimal away from zero. -// -// Example: -// -// NewFromFloat(545).RoundUp(-2).String() // output: "600" -// NewFromFloat(500).RoundUp(-2).String() // output: "500" -// NewFromFloat(1.1001).RoundUp(2).String() // output: "1.11" -// NewFromFloat(-1.454).RoundUp(1).String() // output: "-1.4" -// -func (d Decimal) RoundUp(places int32) Decimal { - if d.exp >= -places { - return d - } - - rescaled := d.rescale(-places) - if d.Equal(rescaled) { - return d - } - - if d.value.Sign() > 0 { - rescaled.value.Add(rescaled.value, oneInt) - } else if d.value.Sign() < 0 { - rescaled.value.Sub(rescaled.value, oneInt) - } - - return rescaled -} - -// RoundDown rounds the decimal towards zero. -// -// Example: -// -// NewFromFloat(545).RoundDown(-2).String() // output: "500" -// NewFromFloat(-500).RoundDown(-2).String() // output: "-500" -// NewFromFloat(1.1001).RoundDown(2).String() // output: "1.1" -// NewFromFloat(-1.454).RoundDown(1).String() // output: "-1.5" -// -func (d Decimal) RoundDown(places int32) Decimal { - if d.exp >= -places { - return d - } - - rescaled := d.rescale(-places) - if d.Equal(rescaled) { - return d - } - return rescaled -} - -// RoundBank rounds the decimal to places decimal places. -// If the final digit to round is equidistant from the nearest two integers the -// rounded value is taken as the even number -// -// If places < 0, it will round the integer part to the nearest 10^(-places). -// -// Examples: -// -// NewFromFloat(5.45).RoundBank(1).String() // output: "5.4" -// NewFromFloat(545).RoundBank(-1).String() // output: "540" -// NewFromFloat(5.46).RoundBank(1).String() // output: "5.5" -// NewFromFloat(546).RoundBank(-1).String() // output: "550" -// NewFromFloat(5.55).RoundBank(1).String() // output: "5.6" -// NewFromFloat(555).RoundBank(-1).String() // output: "560" -// -func (d Decimal) RoundBank(places int32) Decimal { - - round := d.Round(places) - remainder := d.Sub(round).Abs() - - half := New(5, -places-1) - if remainder.Cmp(half) == 0 && round.value.Bit(0) != 0 { - if round.value.Sign() < 0 { - round.value.Add(round.value, oneInt) - } else { - round.value.Sub(round.value, oneInt) - } - } - - return round -} - -// RoundCash aka Cash/Penny/öre rounding rounds decimal to a specific -// interval. The amount payable for a cash transaction is rounded to the nearest -// multiple of the minimum currency unit available. The following intervals are -// available: 5, 10, 25, 50 and 100; any other number throws a panic. -// 5: 5 cent rounding 3.43 => 3.45 -// 10: 10 cent rounding 3.45 => 3.50 (5 gets rounded up) -// 25: 25 cent rounding 3.41 => 3.50 -// 50: 50 cent rounding 3.75 => 4.00 -// 100: 100 cent rounding 3.50 => 4.00 -// For more details: https://en.wikipedia.org/wiki/Cash_rounding -func (d Decimal) RoundCash(interval uint8) Decimal { - var iVal *big.Int - switch interval { - case 5: - iVal = twentyInt - case 10: - iVal = tenInt - case 25: - iVal = fourInt - case 50: - iVal = twoInt - case 100: - iVal = oneInt - default: - panic(fmt.Sprintf("Decimal does not support this Cash rounding interval `%d`. Supported: 5, 10, 25, 50, 100", interval)) - } - dVal := Decimal{ - value: iVal, - } - - // TODO: optimize those calculations to reduce the high allocations (~29 allocs). - return d.Mul(dVal).Round(0).Div(dVal).Truncate(2) -} - -// Floor returns the nearest integer value less than or equal to d. -func (d Decimal) Floor() Decimal { - d.ensureInitialized() - - if d.exp >= 0 { - return d - } - - exp := big.NewInt(10) - - // NOTE(vadim): must negate after casting to prevent int32 overflow - exp.Exp(exp, big.NewInt(-int64(d.exp)), nil) - - z := new(big.Int).Div(d.value, exp) - return Decimal{value: z, exp: 0} -} - -// Ceil returns the nearest integer value greater than or equal to d. -func (d Decimal) Ceil() Decimal { - d.ensureInitialized() - - if d.exp >= 0 { - return d - } - - exp := big.NewInt(10) - - // NOTE(vadim): must negate after casting to prevent int32 overflow - exp.Exp(exp, big.NewInt(-int64(d.exp)), nil) - - z, m := new(big.Int).DivMod(d.value, exp, new(big.Int)) - if m.Cmp(zeroInt) != 0 { - z.Add(z, oneInt) - } - return Decimal{value: z, exp: 0} -} - -// Truncate truncates off digits from the number, without rounding. -// -// NOTE: precision is the last digit that will not be truncated (must be >= 0). -// -// Example: -// -// decimal.NewFromString("123.456").Truncate(2).String() // "123.45" -// -func (d Decimal) Truncate(precision int32) Decimal { - d.ensureInitialized() - if precision >= 0 && -precision > d.exp { - return d.rescale(-precision) - } - return d -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (d *Decimal) UnmarshalJSON(decimalBytes []byte) error { - if string(decimalBytes) == "null" { - return nil - } - - str, err := unquoteIfQuoted(decimalBytes) - if err != nil { - return fmt.Errorf("error decoding string '%s': %s", decimalBytes, err) - } - - decimal, err := NewFromString(str) - *d = decimal - if err != nil { - return fmt.Errorf("error decoding string '%s': %s", str, err) - } - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (d Decimal) MarshalJSON() ([]byte, error) { - var str string - if MarshalJSONWithoutQuotes { - str = d.String() - } else { - str = "\"" + d.String() + "\"" - } - return []byte(str), nil -} - -// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. As a string representation -// is already used when encoding to text, this method stores that string as []byte -func (d *Decimal) UnmarshalBinary(data []byte) error { - // Verify we have at least 4 bytes for the exponent. The GOB encoded value - // may be empty. - if len(data) < 4 { - return fmt.Errorf("error decoding binary %v: expected at least 4 bytes, got %d", data, len(data)) - } - - // Extract the exponent - d.exp = int32(binary.BigEndian.Uint32(data[:4])) - - // Extract the value - d.value = new(big.Int) - if err := d.value.GobDecode(data[4:]); err != nil { - return fmt.Errorf("error decoding binary %v: %s", data, err) - } - - return nil -} - -// MarshalBinary implements the encoding.BinaryMarshaler interface. -func (d Decimal) MarshalBinary() (data []byte, err error) { - // Write the exponent first since it's a fixed size - v1 := make([]byte, 4) - binary.BigEndian.PutUint32(v1, uint32(d.exp)) - - // Add the value - var v2 []byte - if v2, err = d.value.GobEncode(); err != nil { - return - } - - // Return the byte array - data = append(v1, v2...) - return -} - -// Scan implements the sql.Scanner interface for database deserialization. -func (d *Decimal) Scan(value interface{}) error { - // first try to see if the data is stored in database as a Numeric datatype - switch v := value.(type) { - - case float32: - *d = NewFromFloat(float64(v)) - return nil - - case float64: - // numeric in sqlite3 sends us float64 - *d = NewFromFloat(v) - return nil - - case int64: - // at least in sqlite3 when the value is 0 in db, the data is sent - // to us as an int64 instead of a float64 ... - *d = New(v, 0) - return nil - - default: - // default is trying to interpret value stored as string - str, err := unquoteIfQuoted(v) - if err != nil { - return err - } - *d, err = NewFromString(str) - return err - } -} - -// Value implements the driver.Valuer interface for database serialization. -func (d Decimal) Value() (driver.Value, error) { - return d.String(), nil -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface for XML -// deserialization. -func (d *Decimal) UnmarshalText(text []byte) error { - str := string(text) - - dec, err := NewFromString(str) - *d = dec - if err != nil { - return fmt.Errorf("error decoding string '%s': %s", str, err) - } - - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface for XML -// serialization. -func (d Decimal) MarshalText() (text []byte, err error) { - return []byte(d.String()), nil -} - -// GobEncode implements the gob.GobEncoder interface for gob serialization. -func (d Decimal) GobEncode() ([]byte, error) { - return d.MarshalBinary() -} - -// GobDecode implements the gob.GobDecoder interface for gob serialization. -func (d *Decimal) GobDecode(data []byte) error { - return d.UnmarshalBinary(data) -} - -// StringScaled first scales the decimal then calls .String() on it. -// NOTE: buggy, unintuitive, and DEPRECATED! Use StringFixed instead. -func (d Decimal) StringScaled(exp int32) string { - return d.rescale(exp).String() -} - -func (d Decimal) string(trimTrailingZeros bool) string { - if d.exp >= 0 { - return d.rescale(0).value.String() - } - - abs := new(big.Int).Abs(d.value) - str := abs.String() - - var intPart, fractionalPart string - - // NOTE(vadim): this cast to int will cause bugs if d.exp == INT_MIN - // and you are on a 32-bit machine. Won't fix this super-edge case. - dExpInt := int(d.exp) - if len(str) > -dExpInt { - intPart = str[:len(str)+dExpInt] - fractionalPart = str[len(str)+dExpInt:] - } else { - intPart = "0" - - num0s := -dExpInt - len(str) - fractionalPart = strings.Repeat("0", num0s) + str - } - - if trimTrailingZeros { - i := len(fractionalPart) - 1 - for ; i >= 0; i-- { - if fractionalPart[i] != '0' { - break - } - } - fractionalPart = fractionalPart[:i+1] - } - - number := intPart - if len(fractionalPart) > 0 { - number += "." + fractionalPart - } - - if d.value.Sign() < 0 { - return "-" + number - } - - return number -} - -func (d *Decimal) ensureInitialized() { - if d.value == nil { - d.value = new(big.Int) - } -} - -// Min returns the smallest Decimal that was passed in the arguments. -// -// To call this function with an array, you must do: -// -// Min(arr[0], arr[1:]...) -// -// This makes it harder to accidentally call Min with 0 arguments. -func Min(first Decimal, rest ...Decimal) Decimal { - ans := first - for _, item := range rest { - if item.Cmp(ans) < 0 { - ans = item - } - } - return ans -} - -// Max returns the largest Decimal that was passed in the arguments. -// -// To call this function with an array, you must do: -// -// Max(arr[0], arr[1:]...) -// -// This makes it harder to accidentally call Max with 0 arguments. -func Max(first Decimal, rest ...Decimal) Decimal { - ans := first - for _, item := range rest { - if item.Cmp(ans) > 0 { - ans = item - } - } - return ans -} - -// Sum returns the combined total of the provided first and rest Decimals -func Sum(first Decimal, rest ...Decimal) Decimal { - total := first - for _, item := range rest { - total = total.Add(item) - } - - return total -} - -// Avg returns the average value of the provided first and rest Decimals -func Avg(first Decimal, rest ...Decimal) Decimal { - count := New(int64(len(rest)+1), 0) - sum := Sum(first, rest...) - return sum.Div(count) -} - -// RescalePair rescales two decimals to common exponential value (minimal exp of both decimals) -func RescalePair(d1 Decimal, d2 Decimal) (Decimal, Decimal) { - d1.ensureInitialized() - d2.ensureInitialized() - - if d1.exp == d2.exp { - return d1, d2 - } - - baseScale := min(d1.exp, d2.exp) - if baseScale != d1.exp { - return d1.rescale(baseScale), d2 - } - return d1, d2.rescale(baseScale) -} - -func min(x, y int32) int32 { - if x >= y { - return y - } - return x -} - -func unquoteIfQuoted(value interface{}) (string, error) { - var bytes []byte - - switch v := value.(type) { - case string: - bytes = []byte(v) - case []byte: - bytes = v - default: - return "", fmt.Errorf("could not convert value '%+v' to byte array of type '%T'", - value, value) - } - - // If the amount is quoted, strip the quotes - if len(bytes) > 2 && bytes[0] == '"' && bytes[len(bytes)-1] == '"' { - bytes = bytes[1 : len(bytes)-1] - } - return string(bytes), nil -} - -// NullDecimal represents a nullable decimal with compatibility for -// scanning null values from the database. -type NullDecimal struct { - Decimal Decimal - Valid bool -} - -func NewNullDecimal(d Decimal) NullDecimal { - return NullDecimal{ - Decimal: d, - Valid: true, - } -} - -// Scan implements the sql.Scanner interface for database deserialization. -func (d *NullDecimal) Scan(value interface{}) error { - if value == nil { - d.Valid = false - return nil - } - d.Valid = true - return d.Decimal.Scan(value) -} - -// Value implements the driver.Valuer interface for database serialization. -func (d NullDecimal) Value() (driver.Value, error) { - if !d.Valid { - return nil, nil - } - return d.Decimal.Value() -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (d *NullDecimal) UnmarshalJSON(decimalBytes []byte) error { - if string(decimalBytes) == "null" { - d.Valid = false - return nil - } - d.Valid = true - return d.Decimal.UnmarshalJSON(decimalBytes) -} - -// MarshalJSON implements the json.Marshaler interface. -func (d NullDecimal) MarshalJSON() ([]byte, error) { - if !d.Valid { - return []byte("null"), nil - } - return d.Decimal.MarshalJSON() -} - -// UnmarshalText implements the encoding.TextUnmarshaler interface for XML -// deserialization -func (d *NullDecimal) UnmarshalText(text []byte) error { - str := string(text) - - // check for empty XML or XML without body e.g., - if str == "" { - d.Valid = false - return nil - } - if err := d.Decimal.UnmarshalText(text); err != nil { - d.Valid = false - return err - } - d.Valid = true - return nil -} - -// MarshalText implements the encoding.TextMarshaler interface for XML -// serialization. -func (d NullDecimal) MarshalText() (text []byte, err error) { - if !d.Valid { - return []byte{}, nil - } - return d.Decimal.MarshalText() -} - -// Trig functions - -// Atan returns the arctangent, in radians, of x. -func (d Decimal) Atan() Decimal { - if d.Equal(NewFromFloat(0.0)) { - return d - } - if d.GreaterThan(NewFromFloat(0.0)) { - return d.satan() - } - return d.Neg().satan().Neg() -} - -func (d Decimal) xatan() Decimal { - P0 := NewFromFloat(-8.750608600031904122785e-01) - P1 := NewFromFloat(-1.615753718733365076637e+01) - P2 := NewFromFloat(-7.500855792314704667340e+01) - P3 := NewFromFloat(-1.228866684490136173410e+02) - P4 := NewFromFloat(-6.485021904942025371773e+01) - Q0 := NewFromFloat(2.485846490142306297962e+01) - Q1 := NewFromFloat(1.650270098316988542046e+02) - Q2 := NewFromFloat(4.328810604912902668951e+02) - Q3 := NewFromFloat(4.853903996359136964868e+02) - Q4 := NewFromFloat(1.945506571482613964425e+02) - z := d.Mul(d) - b1 := P0.Mul(z).Add(P1).Mul(z).Add(P2).Mul(z).Add(P3).Mul(z).Add(P4).Mul(z) - b2 := z.Add(Q0).Mul(z).Add(Q1).Mul(z).Add(Q2).Mul(z).Add(Q3).Mul(z).Add(Q4) - z = b1.Div(b2) - z = d.Mul(z).Add(d) - return z -} - -// satan reduces its argument (known to be positive) -// to the range [0, 0.66] and calls xatan. -func (d Decimal) satan() Decimal { - Morebits := NewFromFloat(6.123233995736765886130e-17) // pi/2 = PIO2 + Morebits - Tan3pio8 := NewFromFloat(2.41421356237309504880) // tan(3*pi/8) - pi := NewFromFloat(3.14159265358979323846264338327950288419716939937510582097494459) - - if d.LessThanOrEqual(NewFromFloat(0.66)) { - return d.xatan() - } - if d.GreaterThan(Tan3pio8) { - return pi.Div(NewFromFloat(2.0)).Sub(NewFromFloat(1.0).Div(d).xatan()).Add(Morebits) - } - return pi.Div(NewFromFloat(4.0)).Add((d.Sub(NewFromFloat(1.0)).Div(d.Add(NewFromFloat(1.0)))).xatan()).Add(NewFromFloat(0.5).Mul(Morebits)) -} - -// sin coefficients -var _sin = [...]Decimal{ - NewFromFloat(1.58962301576546568060e-10), // 0x3de5d8fd1fd19ccd - NewFromFloat(-2.50507477628578072866e-8), // 0xbe5ae5e5a9291f5d - NewFromFloat(2.75573136213857245213e-6), // 0x3ec71de3567d48a1 - NewFromFloat(-1.98412698295895385996e-4), // 0xbf2a01a019bfdf03 - NewFromFloat(8.33333333332211858878e-3), // 0x3f8111111110f7d0 - NewFromFloat(-1.66666666666666307295e-1), // 0xbfc5555555555548 -} - -// Sin returns the sine of the radian argument x. -func (d Decimal) Sin() Decimal { - PI4A := NewFromFloat(7.85398125648498535156e-1) // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B := NewFromFloat(3.77489470793079817668e-8) // 0x3e64442d00000000, - PI4C := NewFromFloat(2.69515142907905952645e-15) // 0x3ce8469898cc5170, - M4PI := NewFromFloat(1.273239544735162542821171882678754627704620361328125) // 4/pi - - if d.Equal(NewFromFloat(0.0)) { - return d - } - // make argument positive but save the sign - sign := false - if d.LessThan(NewFromFloat(0.0)) { - d = d.Neg() - sign = true - } - - j := d.Mul(M4PI).IntPart() // integer part of x/(Pi/4), as integer for tests on the phase angle - y := NewFromFloat(float64(j)) // integer part of x/(Pi/4), as float - - // map zeros to origin - if j&1 == 1 { - j++ - y = y.Add(NewFromFloat(1.0)) - } - j &= 7 // octant modulo 2Pi radians (360 degrees) - // reflect in x axis - if j > 3 { - sign = !sign - j -= 4 - } - z := d.Sub(y.Mul(PI4A)).Sub(y.Mul(PI4B)).Sub(y.Mul(PI4C)) // Extended precision modular arithmetic - zz := z.Mul(z) - - if j == 1 || j == 2 { - w := zz.Mul(zz).Mul(_cos[0].Mul(zz).Add(_cos[1]).Mul(zz).Add(_cos[2]).Mul(zz).Add(_cos[3]).Mul(zz).Add(_cos[4]).Mul(zz).Add(_cos[5])) - y = NewFromFloat(1.0).Sub(NewFromFloat(0.5).Mul(zz)).Add(w) - } else { - y = z.Add(z.Mul(zz).Mul(_sin[0].Mul(zz).Add(_sin[1]).Mul(zz).Add(_sin[2]).Mul(zz).Add(_sin[3]).Mul(zz).Add(_sin[4]).Mul(zz).Add(_sin[5]))) - } - if sign { - y = y.Neg() - } - return y -} - -// cos coefficients -var _cos = [...]Decimal{ - NewFromFloat(-1.13585365213876817300e-11), // 0xbda8fa49a0861a9b - NewFromFloat(2.08757008419747316778e-9), // 0x3e21ee9d7b4e3f05 - NewFromFloat(-2.75573141792967388112e-7), // 0xbe927e4f7eac4bc6 - NewFromFloat(2.48015872888517045348e-5), // 0x3efa01a019c844f5 - NewFromFloat(-1.38888888888730564116e-3), // 0xbf56c16c16c14f91 - NewFromFloat(4.16666666666665929218e-2), // 0x3fa555555555554b -} - -// Cos returns the cosine of the radian argument x. -func (d Decimal) Cos() Decimal { - - PI4A := NewFromFloat(7.85398125648498535156e-1) // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B := NewFromFloat(3.77489470793079817668e-8) // 0x3e64442d00000000, - PI4C := NewFromFloat(2.69515142907905952645e-15) // 0x3ce8469898cc5170, - M4PI := NewFromFloat(1.273239544735162542821171882678754627704620361328125) // 4/pi - - // make argument positive - sign := false - if d.LessThan(NewFromFloat(0.0)) { - d = d.Neg() - } - - j := d.Mul(M4PI).IntPart() // integer part of x/(Pi/4), as integer for tests on the phase angle - y := NewFromFloat(float64(j)) // integer part of x/(Pi/4), as float - - // map zeros to origin - if j&1 == 1 { - j++ - y = y.Add(NewFromFloat(1.0)) - } - j &= 7 // octant modulo 2Pi radians (360 degrees) - // reflect in x axis - if j > 3 { - sign = !sign - j -= 4 - } - if j > 1 { - sign = !sign - } - - z := d.Sub(y.Mul(PI4A)).Sub(y.Mul(PI4B)).Sub(y.Mul(PI4C)) // Extended precision modular arithmetic - zz := z.Mul(z) - - if j == 1 || j == 2 { - y = z.Add(z.Mul(zz).Mul(_sin[0].Mul(zz).Add(_sin[1]).Mul(zz).Add(_sin[2]).Mul(zz).Add(_sin[3]).Mul(zz).Add(_sin[4]).Mul(zz).Add(_sin[5]))) - } else { - w := zz.Mul(zz).Mul(_cos[0].Mul(zz).Add(_cos[1]).Mul(zz).Add(_cos[2]).Mul(zz).Add(_cos[3]).Mul(zz).Add(_cos[4]).Mul(zz).Add(_cos[5])) - y = NewFromFloat(1.0).Sub(NewFromFloat(0.5).Mul(zz)).Add(w) - } - if sign { - y = y.Neg() - } - return y -} - -var _tanP = [...]Decimal{ - NewFromFloat(-1.30936939181383777646e+4), // 0xc0c992d8d24f3f38 - NewFromFloat(1.15351664838587416140e+6), // 0x413199eca5fc9ddd - NewFromFloat(-1.79565251976484877988e+7), // 0xc1711fead3299176 -} -var _tanQ = [...]Decimal{ - NewFromFloat(1.00000000000000000000e+0), - NewFromFloat(1.36812963470692954678e+4), //0x40cab8a5eeb36572 - NewFromFloat(-1.32089234440210967447e+6), //0xc13427bc582abc96 - NewFromFloat(2.50083801823357915839e+7), //0x4177d98fc2ead8ef - NewFromFloat(-5.38695755929454629881e+7), //0xc189afe03cbe5a31 -} - -// Tan returns the tangent of the radian argument x. -func (d Decimal) Tan() Decimal { - - PI4A := NewFromFloat(7.85398125648498535156e-1) // 0x3fe921fb40000000, Pi/4 split into three parts - PI4B := NewFromFloat(3.77489470793079817668e-8) // 0x3e64442d00000000, - PI4C := NewFromFloat(2.69515142907905952645e-15) // 0x3ce8469898cc5170, - M4PI := NewFromFloat(1.273239544735162542821171882678754627704620361328125) // 4/pi - - if d.Equal(NewFromFloat(0.0)) { - return d - } - - // make argument positive but save the sign - sign := false - if d.LessThan(NewFromFloat(0.0)) { - d = d.Neg() - sign = true - } - - j := d.Mul(M4PI).IntPart() // integer part of x/(Pi/4), as integer for tests on the phase angle - y := NewFromFloat(float64(j)) // integer part of x/(Pi/4), as float - - // map zeros to origin - if j&1 == 1 { - j++ - y = y.Add(NewFromFloat(1.0)) - } - - z := d.Sub(y.Mul(PI4A)).Sub(y.Mul(PI4B)).Sub(y.Mul(PI4C)) // Extended precision modular arithmetic - zz := z.Mul(z) - - if zz.GreaterThan(NewFromFloat(1e-14)) { - w := zz.Mul(_tanP[0].Mul(zz).Add(_tanP[1]).Mul(zz).Add(_tanP[2])) - x := zz.Add(_tanQ[1]).Mul(zz).Add(_tanQ[2]).Mul(zz).Add(_tanQ[3]).Mul(zz).Add(_tanQ[4]) - y = z.Add(z.Mul(w.Div(x))) - } else { - y = z - } - if j&2 == 2 { - y = NewFromFloat(-1.0).Div(y) - } - if sign { - y = y.Neg() - } - return y -} diff --git a/vendor/github.com/shopspring/decimal/rounding.go b/vendor/github.com/shopspring/decimal/rounding.go deleted file mode 100644 index d4b0cd0079..0000000000 --- a/vendor/github.com/shopspring/decimal/rounding.go +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Multiprecision decimal numbers. -// For floating-point formatting only; not general purpose. -// Only operations are assign and (binary) left/right shift. -// Can do binary floating point in multiprecision decimal precisely -// because 2 divides 10; cannot do decimal floating point -// in multiprecision binary precisely. - -package decimal - -type floatInfo struct { - mantbits uint - expbits uint - bias int -} - -var float32info = floatInfo{23, 8, -127} -var float64info = floatInfo{52, 11, -1023} - -// roundShortest rounds d (= mant * 2^exp) to the shortest number of digits -// that will let the original floating point value be precisely reconstructed. -func roundShortest(d *decimal, mant uint64, exp int, flt *floatInfo) { - // If mantissa is zero, the number is zero; stop now. - if mant == 0 { - d.nd = 0 - return - } - - // Compute upper and lower such that any decimal number - // between upper and lower (possibly inclusive) - // will round to the original floating point number. - - // We may see at once that the number is already shortest. - // - // Suppose d is not denormal, so that 2^exp <= d < 10^dp. - // The closest shorter number is at least 10^(dp-nd) away. - // The lower/upper bounds computed below are at distance - // at most 2^(exp-mantbits). - // - // So the number is already shortest if 10^(dp-nd) > 2^(exp-mantbits), - // or equivalently log2(10)*(dp-nd) > exp-mantbits. - // It is true if 332/100*(dp-nd) >= exp-mantbits (log2(10) > 3.32). - minexp := flt.bias + 1 // minimum possible exponent - if exp > minexp && 332*(d.dp-d.nd) >= 100*(exp-int(flt.mantbits)) { - // The number is already shortest. - return - } - - // d = mant << (exp - mantbits) - // Next highest floating point number is mant+1 << exp-mantbits. - // Our upper bound is halfway between, mant*2+1 << exp-mantbits-1. - upper := new(decimal) - upper.Assign(mant*2 + 1) - upper.Shift(exp - int(flt.mantbits) - 1) - - // d = mant << (exp - mantbits) - // Next lowest floating point number is mant-1 << exp-mantbits, - // unless mant-1 drops the significant bit and exp is not the minimum exp, - // in which case the next lowest is mant*2-1 << exp-mantbits-1. - // Either way, call it mantlo << explo-mantbits. - // Our lower bound is halfway between, mantlo*2+1 << explo-mantbits-1. - var mantlo uint64 - var explo int - if mant > 1<= d.nd { - break - } - li := ui - upper.dp + lower.dp - l := byte('0') // lower digit - if li >= 0 && li < lower.nd { - l = lower.d[li] - } - m := byte('0') // middle digit - if mi >= 0 { - m = d.d[mi] - } - u := byte('0') // upper digit - if ui < upper.nd { - u = upper.d[ui] - } - - // Okay to round down (truncate) if lower has a different digit - // or if lower is inclusive and is exactly the result of rounding - // down (i.e., and we have reached the final digit of lower). - okdown := l != m || inclusive && li+1 == lower.nd - - switch { - case upperdelta == 0 && m+1 < u: - // Example: - // m = 12345xxx - // u = 12347xxx - upperdelta = 2 - case upperdelta == 0 && m != u: - // Example: - // m = 12345xxx - // u = 12346xxx - upperdelta = 1 - case upperdelta == 1 && (m != '9' || u != '0'): - // Example: - // m = 1234598x - // u = 1234600x - upperdelta = 2 - } - // Okay to round up if upper has a different digit and either upper - // is inclusive or upper is bigger than the result of rounding up. - okup := upperdelta > 0 && (inclusive || upperdelta > 1 || ui+1 < upper.nd) - - // If it's okay to do either, then round to the nearest one. - // If it's okay to do only one, do it. - switch { - case okdown && okup: - d.Round(mi + 1) - return - case okdown: - d.RoundDown(mi + 1) - return - case okup: - d.RoundUp(mi + 1) - return - } - } -} diff --git a/vendor/github.com/sivchari/containedctx/.golangci.yml b/vendor/github.com/sivchari/containedctx/.golangci.yml deleted file mode 100644 index f687df8362..0000000000 --- a/vendor/github.com/sivchari/containedctx/.golangci.yml +++ /dev/null @@ -1,38 +0,0 @@ -run: - timeout: 5m - skip-files: [] - -linters-settings: - govet: - enable-all: true - disable: - - fieldalignment - gocyclo: - min-complexity: 12 - misspell: - locale: US - godox: - keywords: - - FIXME - gofumpt: - extra-rules: true - -linters: - disable-all: true - enable: - - govet - - revive - - goimports - - staticcheck - - gosimple - - unused - - godox - - gofumpt - - misspell - - gocyclo - -issues: - exclude-use-default: true - max-per-linter: 0 - max-same-issues: 0 - exclude: [] diff --git a/vendor/github.com/sivchari/containedctx/LICENCE b/vendor/github.com/sivchari/containedctx/LICENCE deleted file mode 100644 index 5185ec09a5..0000000000 --- a/vendor/github.com/sivchari/containedctx/LICENCE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 sivchari - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sivchari/containedctx/README.md b/vendor/github.com/sivchari/containedctx/README.md deleted file mode 100644 index 0c2dd208d4..0000000000 --- a/vendor/github.com/sivchari/containedctx/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# containedctx - -[![test_and_lint](https://github.com/sivchari/containedctx/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/sivchari/containedctx/actions/workflows/ci.yml) - -containedctx is a linter that detects struct contained context.Context field. -This is discouraged technique in favour of passing context as first argument of method or function. -For rationale please read [Contexts and structs](https://go.dev/blog/context-and-structs) the Go blog post. - -## Instruction - -```sh -go install github.com/sivchari/containedctx/cmd/containedctx -``` - -## Usage - -```go -package main - -import "context" - -type ok struct { - i int - s string -} - -type ng struct { - ctx context.Context -} - -type empty struct{} -``` - -```console -go vet -vettool=(which containedctx) ./... - -# a -./main.go:11:2: found a struct that contains a context.Context field -``` - - -## CI - -### CircleCI - -```yaml -- run: - name: install containedctx - command: go install github.com/sivchari/containedctx/cmd/containedctx - -- run: - name: run containedctx - command: go vet -vettool=`which containedctx` ./... -``` - -### GitHub Actions - -```yaml -- name: install containedctx - run: go install github.com/sivchari/containedctx/cmd/containedctx - -- name: run containedctx - run: go vet -vettool=`which containedctx` ./... -``` diff --git a/vendor/github.com/sivchari/containedctx/containedctx.go b/vendor/github.com/sivchari/containedctx/containedctx.go deleted file mode 100644 index 0260d6a6eb..0000000000 --- a/vendor/github.com/sivchari/containedctx/containedctx.go +++ /dev/null @@ -1,45 +0,0 @@ -package containedctx - -import ( - "go/ast" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const doc = "containedctx is a linter that detects struct contained context.Context field" - -// Analyzer is the contanedctx analyzer -var Analyzer = &analysis.Analyzer{ - Name: "containedctx", - Doc: doc, - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ - (*ast.StructType)(nil), - } - - inspect.Preorder(nodeFilter, func(n ast.Node) { - switch structTyp := n.(type) { - case *ast.StructType: - if structTyp.Fields.List == nil { - return - } - for _, field := range structTyp.Fields.List { - if pass.TypesInfo.TypeOf(field.Type).String() == "context.Context" { - pass.Reportf(field.Pos(), "found a struct that contains a context.Context field") - } - } - } - }) - - return nil, nil -} diff --git a/vendor/github.com/sivchari/nosnakecase/.gitignore b/vendor/github.com/sivchari/nosnakecase/.gitignore deleted file mode 100644 index 66fd13c903..0000000000 --- a/vendor/github.com/sivchari/nosnakecase/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ diff --git a/vendor/github.com/sivchari/nosnakecase/.golangci.yml b/vendor/github.com/sivchari/nosnakecase/.golangci.yml deleted file mode 100644 index 31e05c4ee1..0000000000 --- a/vendor/github.com/sivchari/nosnakecase/.golangci.yml +++ /dev/null @@ -1,40 +0,0 @@ -run: - timeout: 5m - skip-files: [] - go: '1.17' - -linters-settings: - govet: - enable-all: true - disable: - - fieldalignment - gocyclo: - min-complexity: 18 - misspell: - locale: US - godox: - keywords: - - FIXME - gofumpt: - extra-rules: true - -linters: - disable-all: true - enable: - - govet - - revive - - goimports - - staticcheck - - gosimple - - unused - - godox - - gofumpt - - misspell - - gocyclo - -issues: - exclude-use-default: true - max-per-linter: 0 - max-same-issues: 0 - exclude: [] - diff --git a/vendor/github.com/sivchari/nosnakecase/LICENSE b/vendor/github.com/sivchari/nosnakecase/LICENSE deleted file mode 100644 index fb41276774..0000000000 --- a/vendor/github.com/sivchari/nosnakecase/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 sivchari - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sivchari/nosnakecase/README.md b/vendor/github.com/sivchari/nosnakecase/README.md deleted file mode 100644 index 69bb660462..0000000000 --- a/vendor/github.com/sivchari/nosnakecase/README.md +++ /dev/null @@ -1,224 +0,0 @@ -# nosnakecase -nosnakecase is a linter that detects snake case of variable naming and function name. - -## Instruction - -```sh -go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest -``` - -## Usage - -```go -package sandbox - -// global variable name with underscore. -var v_v = 0 // want "v_v is used under score. You should use mixedCap or MixedCap." - -// global constant name with underscore. -const c_c = 0 // want "c_c is used under score. You should use mixedCap or MixedCap." - -// struct name with underscore. -type S_a struct { // want "S_a is used under score. You should use mixedCap or MixedCap." - fi int -} - -// non-exported struct field name with underscore. -type Sa struct { - fi_a int // // want "fi_a is used under score. You should use mixedCap or MixedCap." -} - -// function as struct field, with parameter name with underscore. -type Sb struct { - fib func(p_a int) // want "p_a is used under score. You should use mixedCap or MixedCap." -} - -// exported struct field with underscore. -type Sc struct { - Fi_A int // want "Fi_A is used under score. You should use mixedCap or MixedCap." -} - -// function as struct field, with return name with underscore. -type Sd struct { - fib func(p int) (r_a int) // want "r_a is used under score. You should use mixedCap or MixedCap." -} - -// interface name with underscore. -type I_a interface { // want "I_a is used under score. You should use mixedCap or MixedCap." - fn(p int) -} - -// interface with parameter name with underscore. -type Ia interface { - fn(p_a int) // want "p_a is used under score. You should use mixedCap or MixedCap." -} - -// interface with parameter name with underscore. -type Ib interface { - Fn(p_a int) // want "p_a is used under score. You should use mixedCap or MixedCap." -} - -// function as struct field, with return name with underscore. -type Ic interface { - Fn_a() // want "Fn_a is used under score. You should use mixedCap or MixedCap." -} - -// interface with return name with underscore. -type Id interface { - Fn() (r_a int) // want "r_a is used under score. You should use mixedCap or MixedCap." -} - -// function name with underscore. -func f_a() {} // want "f_a is used under score. You should use mixedCap or MixedCap." - -// function's parameter name with underscore. -func fb(p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -// named return with underscore. -func fc() (r_b int) { // want "r_b is used under score. You should use mixedCap or MixedCap." - return 0 -} - -// local variable (short declaration) with underscore. -func fd(p int) int { - v_b := p * 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -// local constant with underscore. -func fe(p int) int { - const v_b = 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b * p // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -// local variable with underscore. -func ff(p int) int { - var v_b = 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b * p // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -// inner function, parameter name with underscore. -func fg() { - fgl := func(p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - fgl(1) -} - -type Foo struct{} - -// method name with underscore. -func (f Foo) f_a() {} // want "f_a is used under score. You should use mixedCap or MixedCap." - -// method's parameter name with underscore. -func (f Foo) fb(p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -// named return with underscore. -func (f Foo) fc() (r_b int) { return 0 } // want "r_b is used under score. You should use mixedCap or MixedCap." - -// local variable (short declaration) with underscore. -func (f Foo) fd(p int) int { - v_b := p * 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -// local constant with underscore. -func (f Foo) fe(p int) int { - const v_b = 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b * p // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -// local variable with underscore. -func (f Foo) ff(p int) int { - var v_b = 2 // want "v_b is used under score. You should use mixedCap or MixedCap." - - return v_b * p // want "v_b is used under score. You should use mixedCap or MixedCap." -} - -func fna(a, p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -func fna1(a string, p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -func fnb(a, b, p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -func fnb1(a, b string, p_a int) {} // want "p_a is used under score. You should use mixedCap or MixedCap." - -func fnd( - p_a int, // want "p_a is used under score. You should use mixedCap or MixedCap." - p_b int, // want "p_b is used under score. You should use mixedCap or MixedCap." - p_c int, // want "p_c is used under score. You should use mixedCap or MixedCap." -) { -} -``` - -```console -go vet -vettool=(which nosnakecase) ./... - -# command-line-arguments -# a -./a.go:4:5: v_v is used under score. You should use mixedCap or MixedCap. -./a.go:7:7: c_c is used under score. You should use mixedCap or MixedCap. -./a.go:10:6: S_a is used under score. You should use mixedCap or MixedCap. -./a.go:16:2: fi_a is used under score. You should use mixedCap or MixedCap. -./a.go:21:11: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:26:2: Fi_A is used under score. You should use mixedCap or MixedCap. -./a.go:31:19: r_a is used under score. You should use mixedCap or MixedCap. -./a.go:35:6: I_a is used under score. You should use mixedCap or MixedCap. -./a.go:41:5: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:46:5: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:51:2: Fn_a is used under score. You should use mixedCap or MixedCap. -./a.go:56:8: r_a is used under score. You should use mixedCap or MixedCap. -./a.go:60:6: f_a is used under score. You should use mixedCap or MixedCap. -./a.go:63:9: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:66:12: r_b is used under score. You should use mixedCap or MixedCap. -./a.go:72:2: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:74:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:79:8: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:81:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:86:6: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:88:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:93:14: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:100:14: f_a is used under score. You should use mixedCap or MixedCap. -./a.go:103:17: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:106:20: r_b is used under score. You should use mixedCap or MixedCap. -./a.go:110:2: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:112:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:117:8: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:119:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:124:6: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:126:9: v_b is used under score. You should use mixedCap or MixedCap. -./a.go:129:13: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:131:21: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:133:16: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:135:24: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:138:2: p_a is used under score. You should use mixedCap or MixedCap. -./a.go:139:2: p_b is used under score. You should use mixedCap or MixedCap. -./a.go:140:2: p_c is used under score. You should use mixedCap or MixedCap. -``` - -## CI - -### CircleCI - -```yaml -- run: - name: install nosnakecase - command: go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest - -- run: - name: run nosnakecase - command: go vet -vettool=`which nosnakecase` ./... -``` - -### GitHub Actions - -```yaml -- name: install nosnakecase - run: go install github.com/sivchari/nosnakecase/cmd/nosnakecase@latest - -- name: run nosnakecase - run: go vet -vettool=`which nosnakecase` ./... -``` diff --git a/vendor/github.com/sivchari/nosnakecase/nosnakecase.go b/vendor/github.com/sivchari/nosnakecase/nosnakecase.go deleted file mode 100644 index 88cf70e3f0..0000000000 --- a/vendor/github.com/sivchari/nosnakecase/nosnakecase.go +++ /dev/null @@ -1,63 +0,0 @@ -package nosnakecase - -import ( - "go/ast" - "go/token" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const doc = "nosnakecase is a linter that detects snake case of variable naming and function name." - -// Analyzer is a nosnakecase linter. -var Analyzer = &analysis.Analyzer{ - Name: "nosnakecase", - Doc: doc, - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -func run(pass *analysis.Pass) (interface{}, error) { - result := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ - (*ast.Ident)(nil), - } - - result.Preorder(nodeFilter, func(n ast.Node) { - switch n := n.(type) { - case *ast.Ident: - report(pass, n.Pos(), n.Name) - } - }) - - return nil, nil -} - -func report(pass *analysis.Pass, pos token.Pos, name string) { - // skip import _ "xxx" - if name == "_" { - return - } - - // skip package xxx_test - if strings.Contains(name, "_test") { - return - } - - // If prefix is Test or Benchmark, Fuzz, skip - // FYI https://go.dev/blog/examples - if strings.HasPrefix(name, "Test") || strings.HasPrefix(name, "Benchmark") || strings.HasPrefix(name, "Fuzz") { - return - } - - if strings.Contains(name, "_") { - pass.Reportf(pos, "%s contains underscore. You should use mixedCap or MixedCap.", name) - return - } -} diff --git a/vendor/github.com/sivchari/tenv/.gitignore b/vendor/github.com/sivchari/tenv/.gitignore deleted file mode 100644 index 83470100fc..0000000000 --- a/vendor/github.com/sivchari/tenv/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -.idea - -# Dependency directories (remove the comment below to include it) -# vendor/ diff --git a/vendor/github.com/sivchari/tenv/.golangci.yml b/vendor/github.com/sivchari/tenv/.golangci.yml deleted file mode 100644 index f687df8362..0000000000 --- a/vendor/github.com/sivchari/tenv/.golangci.yml +++ /dev/null @@ -1,38 +0,0 @@ -run: - timeout: 5m - skip-files: [] - -linters-settings: - govet: - enable-all: true - disable: - - fieldalignment - gocyclo: - min-complexity: 12 - misspell: - locale: US - godox: - keywords: - - FIXME - gofumpt: - extra-rules: true - -linters: - disable-all: true - enable: - - govet - - revive - - goimports - - staticcheck - - gosimple - - unused - - godox - - gofumpt - - misspell - - gocyclo - -issues: - exclude-use-default: true - max-per-linter: 0 - max-same-issues: 0 - exclude: [] diff --git a/vendor/github.com/sivchari/tenv/LICENSE b/vendor/github.com/sivchari/tenv/LICENSE deleted file mode 100644 index 5185ec09a5..0000000000 --- a/vendor/github.com/sivchari/tenv/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 sivchari - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sivchari/tenv/README.md b/vendor/github.com/sivchari/tenv/README.md deleted file mode 100644 index c5d0047734..0000000000 --- a/vendor/github.com/sivchari/tenv/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# tenv - -![tenv Gopher](./tenv.png "Gopher") - - -[![test_and_lint](https://github.com/sivchari/tenv/actions/workflows/workflows.yml/badge.svg?branch=main)](https://github.com/sivchari/tenv/actions/workflows/workflows.yml) - -tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 - -## Instruction - -```sh -go install github.com/sivchari/tenv/cmd/tenv -``` - -## Usage - -```go -package main - -import ( - "fmt" - "os" - "testing" -) - -func TestMain(t *testing.T) { - fmt.Println(os.Getenv("GO")) - os.Setenv("GO", "HACKING GOPHER") -} - -func TestMain2(t *testing.T) { - fmt.Println(os.Getenv("GO")) -} - -func helper() { - os.Setenv("GO", "HACKING GOPHER") -} -``` - -```console -go vet -vettool=(which tenv) ./... - -# a -./main_test.go:11:2: os.Setenv() can be replaced by `t.Setenv()` in TestMain -``` - -### option - -The option `all` will run against whole test files (`_test.go`) regardless of method/function signatures. - -By default, only methods that take `*testing.T`, `*testing.B`, and `testing.TB` as arguments are checked. - -```go -package main - -import ( - "fmt" - "os" - "testing" -) - -func TestMain(t *testing.T) { - fmt.Println(os.Getenv("GO")) - os.Setenv("GO", "HACKING GOPHER") -} - -func TestMain2(t *testing.T) { - fmt.Println(os.Getenv("GO")) -} - -func helper() { - os.Setenv("GO", "HACKING GOPHER") -} -``` - -```console -go vet -vettool=(which tenv) -tenv.all ./... - -# a -./main_test.go:11:2: os.Setenv() can be replaced by `t.Setenv()` in TestMain -./main_test.go:19:2: os.Setenv() can be replaced by `testing.Setenv()` in helper -``` - -## CI - -### CircleCI - -```yaml -- run: - name: install tenv - command: go install github.com/sivchari/tenv - -- run: - name: run tenv - command: go vet -vettool=`which tenv` ./... -``` - -### GitHub Actions - -```yaml -- name: install tenv - run: go install github.com/sivchari/tenv - -- name: run tenv - run: go vet -vettool=`which tenv` ./... -``` diff --git a/vendor/github.com/sivchari/tenv/tenv.go b/vendor/github.com/sivchari/tenv/tenv.go deleted file mode 100644 index fcff98d058..0000000000 --- a/vendor/github.com/sivchari/tenv/tenv.go +++ /dev/null @@ -1,213 +0,0 @@ -package tenv - -import ( - "go/ast" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const doc = "tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17" - -// Analyzer is tenv analyzer -var Analyzer = &analysis.Analyzer{ - Name: "tenv", - Doc: doc, - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -var ( - A = "all" - aflag bool -) - -func init() { - Analyzer.Flags.BoolVar(&aflag, A, false, "the all option will run against all method in test file") -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - (*ast.FuncLit)(nil), - } - - inspect.Preorder(nodeFilter, func(n ast.Node) { - switch n := n.(type) { - case *ast.FuncDecl: - checkFuncDecl(pass, n, pass.Fset.File(n.Pos()).Name()) - case *ast.FuncLit: - checkFuncLit(pass, n, pass.Fset.File(n.Pos()).Name()) - } - }) - - return nil, nil -} - -func checkFuncDecl(pass *analysis.Pass, f *ast.FuncDecl, fileName string) { - argName, ok := targetRunner(f.Type.Params.List, fileName) - if !ok { - return - } - checkStmts(pass, f.Body.List, f.Name.Name, argName) -} - -func checkFuncLit(pass *analysis.Pass, f *ast.FuncLit, fileName string) { - argName, ok := targetRunner(f.Type.Params.List, fileName) - if !ok { - return - } - checkStmts(pass, f.Body.List, "anonymous function", argName) -} - -func checkStmts(pass *analysis.Pass, stmts []ast.Stmt, funcName, argName string) { - for _, stmt := range stmts { - switch stmt := stmt.(type) { - case *ast.ExprStmt: - if !checkExprStmt(pass, stmt, funcName, argName) { - continue - } - case *ast.IfStmt: - if !checkIfStmt(pass, stmt, funcName, argName) { - continue - } - case *ast.AssignStmt: - if !checkAssignStmt(pass, stmt, funcName, argName) { - continue - } - } - } -} - -func checkExprStmt(pass *analysis.Pass, stmt *ast.ExprStmt, funcName, argName string) bool { - callExpr, ok := stmt.X.(*ast.CallExpr) - if !ok { - return false - } - fun, ok := callExpr.Fun.(*ast.SelectorExpr) - if !ok { - return false - } - x, ok := fun.X.(*ast.Ident) - if !ok { - return false - } - targetName := x.Name + "." + fun.Sel.Name - if targetName == "os.Setenv" { - if argName == "" { - argName = "testing" - } - pass.Reportf(stmt.Pos(), "os.Setenv() can be replaced by `%s.Setenv()` in %s", argName, funcName) - } - return true -} - -func checkIfStmt(pass *analysis.Pass, stmt *ast.IfStmt, funcName, argName string) bool { - assignStmt, ok := stmt.Init.(*ast.AssignStmt) - if !ok { - return false - } - rhs, ok := assignStmt.Rhs[0].(*ast.CallExpr) - if !ok { - return false - } - fun, ok := rhs.Fun.(*ast.SelectorExpr) - if !ok { - return false - } - x, ok := fun.X.(*ast.Ident) - if !ok { - return false - } - targetName := x.Name + "." + fun.Sel.Name - if targetName == "os.Setenv" { - if argName == "" { - argName = "testing" - } - pass.Reportf(stmt.Pos(), "os.Setenv() can be replaced by `%s.Setenv()` in %s", argName, funcName) - } - return true -} - -func checkAssignStmt(pass *analysis.Pass, stmt *ast.AssignStmt, funcName, argName string) bool { - rhs, ok := stmt.Rhs[0].(*ast.CallExpr) - if !ok { - return false - } - fun, ok := rhs.Fun.(*ast.SelectorExpr) - if !ok { - return false - } - x, ok := fun.X.(*ast.Ident) - if !ok { - return false - } - targetName := x.Name + "." + fun.Sel.Name - if targetName == "os.Setenv" { - if argName == "" { - argName = "testing" - } - pass.Reportf(stmt.Pos(), "os.Setenv() can be replaced by `%s.Setenv()` in %s", argName, funcName) - } - return true -} - -func targetRunner(params []*ast.Field, fileName string) (string, bool) { - for _, p := range params { - switch typ := p.Type.(type) { - case *ast.StarExpr: - if checkStarExprTarget(typ) { - if len(p.Names) == 0 { - return "", false - } - argName := p.Names[0].Name - return argName, true - } - case *ast.SelectorExpr: - if checkSelectorExprTarget(typ) { - if len(p.Names) == 0 { - return "", false - } - argName := p.Names[0].Name - return argName, true - } - } - } - if aflag && strings.HasSuffix(fileName, "_test.go") { - return "", true - } - return "", false -} - -func checkStarExprTarget(typ *ast.StarExpr) bool { - selector, ok := typ.X.(*ast.SelectorExpr) - if !ok { - return false - } - x, ok := selector.X.(*ast.Ident) - if !ok { - return false - } - targetName := x.Name + "." + selector.Sel.Name - switch targetName { - case "testing.T", "testing.B", "testing.F": - return true - default: - return false - } -} - -func checkSelectorExprTarget(typ *ast.SelectorExpr) bool { - x, ok := typ.X.(*ast.Ident) - if !ok { - return false - } - targetName := x.Name + "." + typ.Sel.Name - return targetName == "testing.TB" -} diff --git a/vendor/github.com/sivchari/tenv/tenv.png b/vendor/github.com/sivchari/tenv/tenv.png deleted file mode 100644 index 96dc967e388ae4143df6222c7ad7da8522a0e5e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 247119 zcmeGC_dA>a{|1bwrD#h@t*X_cs7=%!rAAx3)Sk6>jaac-TAQjFvuJ6}qPCzdVuV!H z7O~X`HG`1cm)Ga`9>@3o<^BuaKeRdIN}ktao{#f!UWwD!)ug$0`x*!YqIvRI?HLGk zg#q~Yl8OR&M=@&jBM1};dZMOc6qL7xxti?+4Vx!mciJ2L13mpme_1{Et{0>dc>P## zh$)bz$)#^mB1h)-13Nad162v>Ifu78h&cl!N~{H9z~}aQgvZ35&AHgRDen5~JD2OI z4lYY!bWEPtj2#vbjG!eSgkrYKgqR~`%Vg=uJEK*O2FcEF_}ry zcrkyqLUv~^obTwsAFHIGuou-|NDZBgsmz>vz@=WkMAFD9z3lwrfi z_N4H=d3PRA7u$k9D=5fvCv;7|4F-c{HJMj^O46`*b!urB@;h7lU5Dc4UW`SVp8nJS zD>sCC;AqxcpxB0_EtD2E{W`x|mq^L=!cWa3K9&HnV6~`f_xAAc7}X2kOBNE7jqqb6FiDa){20IA}51Qt%407|T+BswPe+Z3+@JnSn z&N74XnT{=YArsEYRicBvh$>_EpU+LK8W7tmmq0h(exL&R^{F#k{h6AYlKtf(c?$94 zVsgqPbA%6}ZpFqDV@<)}>zf6P+0EiZr*(-iuEp)x<0no)1=#PV)d}sioNiP|bHt{B zK#+Lgtor{u3xf&sH_Jq-cZ;iok!s7eU>^^&OigFqyw}tyni4R5?Jgg9g&phzt6*%( zatvOZoSek%z_5gXKZu%MlVQxsaR;K1GRS) zdn;mg+^t6#9=w?;Y!Mzh^k5=!T#*wb76^P-KdK3V^GwJT!NJ@r#$?2~bO%uM5c{+J zG7Ysr%>JeNX;ZaeXSLaz;3oC%A;M9E*KHP-mJ@EylfK88pO--Og@7l9E{7Xqitu1J zCnX4^Fq1_uA+}7d+W?BDKxqZ4r%S7M>r@$^eH9waZSVm3LbLD_I%=M375 zAFD7aoOF>a$Ynvx(%nFEDne-~#Nxa}2am1QLfgjN!eAaATLdq1GEg*Nq2AVFf~fWM z$cT@Vnt~|ASfl%REewjjA~s|W_VH6Y!PTL>fg1F-hK@Z~R`>@6*>ZpxF3mGnS~P8c zj6Kdk$q*hYC=_kOK~A5G>JmxpU~C^7VZ0-3w=-XW2IL1sp{u>gX(-43c2cOF+3E>+ z_chAY8m|qiH>wa?BEVNn1|&LvyESwKj6FB;tby@^Y<+?7qvV-wLU(^39UWycs4FOQ z+0cPCClu+s*be`79qU;%dYlYAn6Rv`-!1}0KH}!TEGAlM)pqo)I5tbO`-&rrAY^ps zVdT2BdFG0=#8O0~`L1$x``*A#3k5d_rDUyrNz8;1z$Xhva7}-rO~W;?Ew4aRrek=K z&>(tes(vkj^SFz$aa<7$`qvGFb@ja^BIIyDqh!|t?qjERFri2X%4pyk@CLpT4uo^3 zy5n?%a}0R*-(TS4P6(j6*bEtZI#G#0j(wnLvMvXHZ{fi+pn?lq_67ty<%w@v`7VQw z06`!-V_1Hty|I2+ZZiYCn;g4$r8N;5&gFig zg4qY@ch)7cLIzWklatR^fKHhsY!py}RrB9pP|Nz0lH66HA|-HLl|4 zKvjsDPywI6Rbf)2R5Idn7VMN~ju!%kI+wv?~Th+78UXo;C@w+pW%*B9UK9gqAjhEgIW* za@?z@{)^=(a98bI02)L@;@d^IlD`0V{XAb#mzYq~ycn-Hp-2Tn@u*|SKw=RL>fxr^ zM3=n&Ymq z$w2|yaCpN78s&lzziqRC=IQ)3mJ8X!kKgaqSR+moTVpOo%01ZN07bTV59K^S^T)T> zZOek@^&MAJ)eX*u%bzPi=kUwjTlgFtDYtN8a6D~$6G zhqOcy2geu3t@8ps%s%`DpnBPt(XQU!ZC;pGXs0nAfb#sjJ?gG>dHk$jb!_Zh>l!HX z{x3L7XZWzJv#3aXFUkL!BxwKDg;z26F36vuAhyA6%#36YoDegicon4m0I2ZwuT9&R zK(@Efo;rm(1F+0D4unhl9&p7~f6fLE@G_lbPj|tN767d3H#x{brNAr#j2>+70777U zy8K?FwCmr%cbnYDD}$e7qCi~^7d`FkXco@P6)>(y z30ywXC}|D=jH#)F(SfqH&F}#Ivt+jNH}DP&#D4+%sH#==31y`_9yw(qz$3<)C$?(e zBnE*=Zm8CBw-`zwqxI-q0jeNa?P2>?T>~jlt)rr&kOJfexh;MaKPcLHngFG}3`$ec zC!co~Y5iL~TwPslb3Z;b*er9+dG$VJeSV$LAgZ04s{`YffpuvxxABs^tvn>;9oP3M zO<5L%3Xk->>#SQRe(eS71<3ipu%w%$vHTScVcYE{ple^N0u3hr9bzll|U$e zJOGn{D+DZw*me=D8*e^PiKSElQ(+mkr#B#BodypF*!Z6|uZe1mbHqg_J_mC7^6T_P z*{tImn-HEOzdvaat<)?TQazt>0fjxvEM)r68N9pNN_iQZK9KS$oWU{I*5(h{TXOA73d41vB7dgQtTC=Z9)69|0Yd0 z*G;UTW55W!4ARTYxDVRzcFd}>GGsWpDh>uYMHc`m^-E9yWhVh8CPr%+Fg2~ky;lyD z7>Hxx_<6-JarfdbtQQ^@Q186Gg!0L&#sYl9wuBzHqx$rTAJ0yh3%Jkyf7b!wsjLA>n-S!L13Mv&aP1R??$}oHy2wOuI+)uwgKO>k=9Q_37o(lG1nZtznXfVboI+e{&<^RtUoB5 zb)ZhB`akP~cCXeyu4lQ9>^()_kC)+t6fma>Lh4}xcsN`Uyo=h^TsdsEm=f=jfhPuQo z^=?^DPhdJ|*D6aosj(Hpk(%A!4gqTQvR@UsIsp2!2Em7hpPyE-ZWQ=+^d{q7*LKc(yZZB$2TEfp!VPL%vV&HV7-Yp2(&j4R9nPO`e;Zl;9lRL`7 zVt|V#vya>^w0g1rz zi$dejS}#(X@(_v80XBDgwQye%WOvLUs=Amzyk?}&B4_9on)Zf>eCIZNH4^AP5J>Ec z)CG(ya0oIKQ4Fo_t*J3^4x=EO1)p@`!75HOSE8cGY?5xl&~It*5udiDx)kv8D{*w%*>}BL?-6X#@-(kR^PXLsviA_0Pma zpsDvx@!+5YHhf;BUro(mIT)DvUQ(1Dl2XRim~XD5P$*imEuF0XJR}#?g?3EFnBu8X zEcsDUng!WYGSxx}_K-n)?!C#_y*`voyUc;j(Cuxe^8T zi7@L81J{Zdx0mqm4cFE-djiX*bX>An1XaA44h02;^)HuhO>STPr=kAvlj6q4(2;mX zvcl=68q0du(NX{mTm$+(UEqUuPHh-ru?4}}QF+b5 zSmMMTS_It`X}7;aq#yN@Yw;^eW_Mx6Rq{v^3CJdRhhDrz)t&`>rHN~sFnoGg>wYsr z+xG3d2eunf>KjKk)(ky8P+Ez$^fusQ2zYMwOS-*dkv0!Z6nMl0&jw6Y{w9rXB<-np zR?B9*V6~}q3q+hAphuMzBQEV9M)=W!g9`Fo1?Tz-dG`nEX6aM0vHYFcvPZP|IT%R? ziYC{-p#m=bm8!|nQdwV*tKr_8ZFPoM4b+`IsbFOGoNeCqgQ6u2tpcW6!@%MtH#jau zo?3>VFj}t-8EA3@FZH*7}(~)=t1&A58;-Tm{~pLe+LMFxv(A4M4P00SRX` zo{K2Ol~NANoDzbhxJoXPJf$d!PUwOWEVey(AK0xV$>QQbAiqBgF`P;O9KOc(2}SHL zNJI0IvJ8M7llz6I+RQXi{v8l0CX%PW|G`qOv^U2WnACj#ePDR5788j?zj&^W_xE{q zGf|2qmGQ`w_KwS*(oNSgv_o3CUEGCgHOB;sW2t@_nVVaXX4Q}P%Q&Syw zFTaw)1~Y}_OSj`9H-N5nh>98%bpe=9HXI=45|qNOl6#^+mvpZ0>;!V(1c6r5zkk0s z^!+*d zrjfpx+@V*rQn?7Nje@H|9IHAP(iMK!gu)BC$ePpV^c9D>z!97ryXk5Wq6=q)>h@YDj zSGXzvHlRBh$6b5=iqd|tbf|WvLs-1g+XkcjyF~8gDYDhcZ$21?-zE$d5)aDo6N-j9 zjq2TYP+CCMqng>|h~#VZn5wg%o?#`4a9K-F=(#Edwa7q}W<74S`*>7_?w9K1dVPU$ z&99NG%cz~7pC{Z-TJ(l2#mXHiho9A+{Uyq*rY|l1O-oMtzGU28S3)SM3iBl%iVR9{ z%(e?l&9x{=&H8wIwA+WxLigFl+dWs?Px9ewfdP$H(lX6k4_KvUNoXkAFp83Eak4cA zh#t9$4~0d0kPo(4{W_5!LV`L0Ittq39bAw#sW}{|nG|V{N&mxRt@Kvs%Yao5>ZzoA zkb(#Kge}uwEPOSg8hLelEIy0%ddb^ALrOhtXsZI)BJ%cTorznUxzcBn+wHqZpTWS0 zTTP+()yaByeEN{S&J72tj%kmhPC&oai7?w28})porceejk4P33{XDpDPy8$CEJsT? zTytCz<&g%@hX=3B&v%_v8K3m((ysuaMp^SqPy z&wU04oHbz1h%6J?7ytU=kONuO@wH+0KFFk|9(?B>rg?!xu-=+8)3cn7I3GCM5j3V& z!p*^?&t^{cwgF`=gl_-@swFi))X%fa6txNWwXpEfQLFYv1-Qg>*_bod&wTN0Vt|3;h_yk1=J3m)0(y-tz2$>$`<)}GF zU=vw8gCB+Bb~@OUTTYT&HBNs5Rg-+p2PpU4K8-icxF?MP|#0@K?>|$WBvI z5=deYQNQ|({`4qM&yz!-e+~gv`_uz7+7)__|HpS%Z+G`lE-ohBu^aKlvGvyBUhV&y zteFs6r=@PvY1LIFin{Wo#5g3P3Byi0n6OD??T|Y6=5Siw1p18|**jq3J^jsf?HjFF zl6lpcK@lKP&?BY;LN~Gd>bP!IxCV^;AQR>D#`l81$C0Y7>Wah|Dm;z2qh|rLXkV|VKx3jXA&|0a|lmOO_gnVwrhbs9seb}mUm77w_E^L zWC-TvPnxFlW27>%EY@XAaWHh$<49zEQ~oRsenJU%-5r+fM=>8A9&WSVzD+d8)OUq0 zzW@4<=Rq!+%`j@857rhVY{lkHT*4-m6ojB0yhD0h)-9yFvBWZW`%THWJ#|8WK7K8D@yt4EJtr@)b0f!lWt|M9O+(Tx z7+!lK%y1xAL(>A?xzjpj;V{Be6~wHz3dfeh-QFH5VRT81vaza`VbLWY#GpE4M<@8A1W`;8PE_bx~*U}u({ z)@$yz#m>x4JO&|tfoazbV;$^@@K7Q3Ab&$P;fC+yCSiPfBQ;EAvk`Q7uHP`&`2rBA5Ay3ns< z@oQcH9~yU^xsQ4TSo+nW|NR_5y8$I2MsHk-)ide%9B*?|v(SIb!P9qqCIm~i8;2*V z&jyd;3_EJ-ggR@(&wH6Qx>4;^C>2vccw&}V`gE~9{#i48tkfj|FXvnMh+-+B1c6>_oB=0V7X!FCb)3@7pZv#W!12Lm$aXKUK4yv~R> zn1sbdW<_c9s_}059K-vNlnop%c>33`f7nD$KkfD5(te=n{Vs&@{Ryi;3}dde@-B2s zqFx>%`WJ@_^V8GYsa{xE;8g3L{6;N1ctK(ki(Lr5PB+GDN!&Sui#;`McdR>4o0g_T zO<6RhveXS2po!1SMqIk*cLf(KvkF-?m2s1k?F(hKVS`bIt!RM5BM`Xzj~@MuQ2ZqS zI#^pjn(voK?+?_RUNUEp&bU-zz$#?1-6kyD|4?U|cP$Z>Sf;S~F)kw)n4>Y`tqo?y#BwgSC0zx_!IF5qO5HGc1E+(ZX*7PtJ~#ue^8wLUG#zkGK#!VLR^{Q{kFS z>O^B8QwgnYFfVovj*h_J6nQ;4L&OQqWhBIJTEs{u=qx_yXHHYMpG`o3ztG>rj-Rx- zrtieE5=jbtg+K$Jx*~h3ux+wO+wil&U?-;%p@iobdDm0>#v4W{mU1=zpA4{s=i4wO zY4N(lmO90dwAVQ5KDet$-X=Z>RY+=V3>pu1?*6-t*iFmb$s4dj6qh+Kti6p1)V6BL zqY%`C9Vx;z@MpPUC9wJuLnHFYlg00poQa&IAYUdXr&R;>)XveF8NbsXZxXy_YweNr zHrYPOa)7{{2_LPy_95_zP5UW(C%7hr@P=O6hYh1BS4(AQpm!eVRUn{6nVj9+g2E{` zL!S<742}n%I zh*VSZcds@avKG3z-1I(=-z?bNpj$o!1`C;)p6*1rPgE%_n58lA~8c~*j1bUQNP;ddcshevX>_wD-Y5|8AW+%Jz77!}XDbm$p zTHgW#0A9nMBGZ90odjDUFoudh5}z@s=Y$}J#XbMizjXNks!4aT*e5x(=i(%ZNs&AiJx4+fLXIiiqNv7Djjt@q>N0idd> zSsO1ZTKFQ{84`~P-5;_?TLf!FR6JM07u6(nzKoBH6}BZ4Q^rjp1OuoQkLxdwyCtb> zuD#AF%VE2Kf&86NXY->BxD~u-@B+meDk=y^K-u0$^d0)MvayARm!uZ z1++5Ji^)1#;Uc;%>m7u-(1UoV2nCOoo{kZKc{Peo%ge3(iBIG!8FL$&DP*@*nrZOk z2}q_^UUa8D*A-gra#R5p+M7*S;*u-I*-1n&KGYr6G!_t8T$M|c(5z?qQmW5L(gbopqnLWY^QfSzm3nc4ek>J z4Bb+o0(Nw#HS7vMZi~msddN5SftMP2<-Wxr~D!rS=q@#55;$5=- zqodw3TII8U1y8WYfBxRO5J&(4;HL&R$t%cV`P&ff*`6yG48N7UK-r|>?lEr7wf8QO z+B1RuXWF^0Gzc1%z3!ewj3z4&l8rW>TM!bf&Pyff0YG)ts_7%mQ#KtEbtD#P33&*wlAH5h> zi>62cY}&7YN0NY`lGr~vE;zTBV>*fWYtT92*073!8t~3^)kcj39^38yB%Mb+!3H>q zcuL;Zq@|^eaQZE+6f8$UNr|1Fn1Fd2Eayt>$HsKj+OG}ExT)`F5q}&j2LkRDG@A`t znr0Y`0i9M0TT8w*)8zf4!AW!Nas}h1)vt9z_6~o)$6r;g48L2pX?=0B#p+?I*D6cbj*K}^u`21!mQ&{k0#U;hX_M&MxI=MI|zsX8r z8ti^I!dc3w0b7Hr=S-C3B|ZYAlGK1%F>yfivOC?>z0!zT7eNn(o`Gm zKbZlT%^5b(sZkp0+EC#&mFd`zFzGt5jlX-4L;qO*$zwg@+T3j3Y;Il}%urYNz2CE| z??A5}Qjt>?Mc?SXwe*^GyHQBXcxKL-h;FZAn=$=eeUv{{jNexX2i1o-2i(JT?C09t zH;yyC9D&$*GKl4;P0xGdr^+mXi!;@bY-;!CH%^Lcuib$}7wAu}f^9bS+6e7Op!x{+tnwbDL>ao0YCX_#JP^ zR@vi$tpKF_tB1DIC0AsPtyBH3|6f zFRWhg|M{O8i=_KU^E+1quCGjc4Z2wWrJD+$7^1zN7yl`%`Xdaja7}3VJH8tvW?ZU&Y0I^M(aSA2QAxhpAO`{&EpI)milT5D?u6RV9S+IOn% z;hlf5%4JGYph1~;k53+!6|9qV4_xy-ZVv=$x# zqJdi5CfeEwWE3;oX_Q?3NTu~Jidai{I-;#}`4)8#=j@tHvY_$Ei1}i++v=mt@dHql+ za|rDq#1S*N9*I#p0^L#1Tz?bC!*VCS$Iy*FMIGtUr_2S99o>_O8ZmmwoX&>yNwbpq ztI0E1Zmz;`m*pB?Hbla|)NzXXmS-6@PbxbxTdpaIf@uu>P2sALF_>$1)qi@1nqrhS z^)Zh#ccWrKx$eWz9J=EEe6_$d%87{eqr{`**Zf@utIM!=K9a*Oy_*riS9}Es4koHp zU~-9hJf*dhuP>W)KZDKfYe>hU_V(FJ@0gg}AC$5%X!WKoQA}UM?9(cy9r0%N*k(M{ zWAr-DN^zIm(r7L#Ep>VUopRj^Qdk=w8>?m}-%W{r=PEQl+u$^cic{&-N~mDZ`#-1Dwrm~u zA*;Kkw@*xj+B_I(%vWyT{n5ab;953eL4aFYrnFjCKU4jPG^4gvV7>4%Y=J4e3jX|# z8T*^8ySdlzF@7?It^`w?@JLHoCNA-2%tjQywB!(nYeUQ`?Il?ZtZdSbmgskP`RJI+ z--*UH6^21@$odUD1ggs_az2@%Jub(1_oMmyZmgKiareVJHBCp}uOpd3b&)I63y;YO zw57@};%wJ`RZI?dmZl;hmfoT0MD5MkJ!|3&UB|IqJyZi_!ZdMiKHl zq0!t3$AZ0Y96LgOb{OYsaLEt zkhRrL>Gy8!85Z!Xt`~ya@%J)^&;MRQnQMSwfAMOvsK1J3GeHGCOkL8wOZ8Mf0qT~E zU^y&GKwh)omjeTBu2&{pT2U#7Nb-?0uCa(3cJ#}xl73AW+6@3j-dKpWHypVM#XgF) zqrbZxYP?zCil>CpC6y|(h;k(SzTV(p=CI0r=$<8IEI2QMO{)>^uj;+I5oD8 z?@FtM2J7GY`Y2QNBj*kTt7-=RZVI>w`V5lrKA{VI*oT{W>pA&0r+t@IKL#pt;PJCw zO{?GsDadnSl{?I?wE<>2SE><&)vH%pwT&S(0>10DlU0&SnT#r3D=4O=<|omV46@q{ z@t1j5K0TmmU{O@!7!ryqf7gC;;Lf5LepG&fO4gzJ4z+2`$b49@L3N@6g+h%3n*;>~ zaU3axnP^j`J8I236{Yjs4(i{J*ySOow+~f^lqYS(m`$CZ^70lmNX+IA#60G2E3gDQ zkIiD_@vZMgmvrj>USHT3fj|CLfGpoDJrI1MyW&}eIP7TrLofDg zX1^-XZT}*bTJX?Eziq$;nrzU>0*gQFv-g9qF?*qu|#VSe#85SrFcelzYCHHD$Zz4I0ZnwV_zO~Wq?xE>ctreVK}k;1zH3+|GB z=VLP)cSr35J!#)S@}?3z|8Ie@^a6E{Az1bAom59ovnSr&9MjN9Gri5L1!!#p2Bqzn zlLWF?^Sl&VIZw5$&~78r1`@YlVlYh~1b#ZaHZ)_GnvSsYZo^_;Id6x(CI;_+F?nfA zur|$?D#gWoDx3~A^H2tB9Mw^fgOv|3rYlMQ7m1c;p{_DfdPnN~(zd!vd(hUj~GdRje+ zTUvYlF#Iu9ete8ewq1tRO0liB7So0TAosb!SA-eq(>Ustv^WO3bVr z_sNu9cdyAZl8B4xh~O+ZUMcyj^fLX1KJ|?&zYv|*SqotFcO&RVnZGf2cdyswTx;L` zBN(e$&x!iTf9oHCEW*zB1)KDff0Eae36$W6j*SVADdIAf90WMxRCF2jru+opKfYU0 z{tgda+iS`3wp2Pj$^F|Kbx$?6-hErICoh!)-@|JAkbgpK+Z!4@;wq?VG*XJUw6&w@_ys8zZgB6So$Q$c94H& znZ^UY$8y8rNfu_MYpf7)$>yvk;`_H?h@`AWE7jdKTD)=P`M1+Tcz77ljL_(Ldh@)Q zoK4ZvdrMPvG+b&=I&;%E(CA0X&73<5r18%w!MM1rf3swIn*q90bmW)V2Pe}N$xMgc z?k497{fFS6%gf8}L_3_zF9`YR{1d#&RkR4_hdH3{@+__6@3?t*kDrM&PdODSzBbLO zys5exq_9o$S;e+tw)YWp)55Rsgl5q#tCvT$y5=K%Ikr!+q{Nen%C{pDyYH(X%aD`w zBj%1sfA-pcdgT;(vSZ?__G!3qu=}(O5uE>Mi&3@ zTkPfdm_SZ#LakI5dq%@pEcwrz0{XwJlTj<~CJ>t}x;>hjrjVl3ot2f925WB|_j{hR zB)T6CzCn$NPV`JR-`EPz@NGUL!tMsqN5JK8ZJN!A_Mb?fm@9?NaH5GgcA1x=aIPW!yFT4C!yB8cP+64^}8>6J{FKRqY$orWI4+O@LGA zD<2|6Z4bxRMkPuO%?9#cHcdD~6H{;gZO^@2^+-cY0v;Lhl`~H52mu3}Zl;$mry%$$ zxypjkg?Q-U{^6fWm@3sk+25IDGrB9Sg~z>$*xvVACd+l51?qIsoFRyUiCHiF!3f9l z;dpoookZ5*cdd$nmn(cVj(_&`M?CM?1LJ%sl8wVC{kZ8-NR&GIyc9VO1XG0R0Hqi5HCsNh0I`@b+OrpgEhcWf~Fz!Ew$A4wcVg?rTv`7#>OKF)xI@T&QTYM7Z_)+55oSYbTl_(KZMyz zaU?Bt?3@Xd7^?|X)W0l`V0D&+m}%0zW6n@#GvU8z=v(xkws^6nH+xb)O-A^mijZYr zD$g|yci$;T8>!~fgz_AuOf-BfW>~X{sO3fW-;3&xy_Z$3E%+`-VCRRcn0(#!w@c}X z2#9F7uL`=rVjzzC=A20?z`gu72u}R-kNE#;Dj}kH{qn-9`y|4whK;5chx}_v!V@31f8n(>qyQZM1yEE#>?Exz{0|UFTU9%VaX~4neqAaP)PXFlMqKf z;<|H0-)CQ!?sT&^^cMS#5`+4A0~hE-{U18%GmH$sVDHbidT7ANc8$SbUsW-XG#?|~ zRdPSDuuj$xM7l%xZFZP9yfrde>v6-}ImKMqP@kHYo5`k~t?(4zR=Y8<|N90{G95Kn zd1?K9GR_t;>Ql<~9{uX&Vm3jJgd4QwPj)-v0T#Bdj};xm4}~^^p{15h^;B2FIETl1 z$e)iQTI4>BelD!P7*92%RSVOAsq(xG6?#?U1g@!#!|}PhR6%rirn0Q^?E3EsX6v;N zOI^LoZh;M=-7E~_UaHA$@Z~6PAIr&0W13AunS&&2&0~RH#9@16svlCl=DIZH9j*2R z6+$C>Z&X{cE#XO`Vc;tj<**y;zUc*X9TH%zUu)j>rfy&wO>~GZGqyET_v5(zokS*{ zsOS@SCi{^$gLPi%9EY{SO)1D1k9kjR{hDpXHspKgWUukRK2p{BAuV&(o>aP3uLMxC z_~!~tLsJZE{>ybK_CmL1JVu`T&)N~uDW(u9*CxVOx0>)bFGkNJt*Vxb( zK*OM}tNh7}`U_7k>f_5h(H}KFb(&vyqRXz6#W~abcpG}DyJSm(?9ar$N97Gxk&Z)O zC*;U=FgeOxoH;OT&Ce9E9m;FSTp^!p0ExnVy=_KBb}=DDZ(Z%jXy%<-MiK9-srHP} zXDrDiH>kSM-yQst=P*6^<rFzm_GdF zc#?F=Lla#$sgPgptD(66flK#>$NFdkX9h>oFp~Z%CHNoB^0$Lrpt%bB_Fl&M6;anc zJ|dV`3ZQ zdMx{bM1bv%Luvple6R8Y*>QMZuD_Ko!>I0yKVP(wm>E!Tm;M8P26cy<>yNu9Jr&Y+ zd4xHKDdQ`DyO7tD~U1QA*lRrBV5HG#t@- zb5|xb>iqF~sKI~_TbB3D-CJj5=d!~0hSTTL3b>29J|l(pjk{a~6OC^l-K6w7on~*| zlrL0oX%kz5tXYOBDF|*e_@#gqkFjSW>&{^voZm+_ya@KKYzFFZ1jNf>fXP# z#U5GFPOeceUa}7o&c9JQh8}ScA6*ZlC3a$+LaD1Vj5F-UTKC1nyjVSZt7G=ot?3LN zPOP4zCXzK&AM?EUDsM@5568=PQ}qtjj~LeJHPBEW%T~+qsmDeAqb*-F=n37n-VT*{jQnD*X_-n0sDI+gdD5<@)Je*cjjt+gF`;YnLO zlDUoRL_8rxITzcndkERIndj2~jvGlof&Q4H<4XU3<@L5htuF6M$NIG!S6pnnJw~gq z21>HAZ_nI96LmusP8WC=OP-X?MmY%_(fqzEY#bwuvt!)|rpD`P@9ffy=8EmKt4|*P zIQ_;^^Wczx*o*fQhpi}>2b46`jhmnT9{IqvG(a$tctYmkR6*lZVO4)gU}H0r_L6$u z-!F96PS^kF=l;y7FA@hF4tc-A@VetJMk~f_MDUS;qAtH!$n$syI)ewoorC$B_F^nA z*KsDlZvNE_KagjetQDOoljJo~zbevler?Emao`F3WGqPN=EagyFft+YG{1Q}q3Nq) zDw|l&6g9|*;f;xpuVv1$=yhcNyQiNhOe^X4+=WBUik2SR~zDg*vI_i zp&qHZCW=e&fFSlqI(-+19W$xw59W5`qVo6M=j$NIww?^Di}|QcrJMg5$}R4<@_%!5 zi+ZH1*cichj|OswPXG`k)+z&8*pWVYbARyi*oQXXDd<%M?|qA?;ow+?9(BZV3*=(x zBsms~9t7G86Hj7ndY>0|Bpbh7=2oG5d6GZTpeE1Fy4x-!VrpfQ}RM4i*ztd2pW$c=eeoQ!XP5t8HHw8{m zbB*&+(z^HT-yw|(-IZ)1-p3kbn6riMXq=i*a*$Ag4_rz&T~qmFQ&Tgasw$@R=)S2R zMx8&gA10|nnVV`54M*6K#WO`d*3?QW{m%+INrUNW z#lYXL%!`K&ND=|8V@}~%{>e{($?B_7)6%^q4@jU*=GGKuYj30s#Az<(G!-hOI8^lAi&=Cot7KbaC$rXsEr|j*lhJ|@n`FBs<=#4%i8qXey zzl=aVkCn<`)Z$McxoMJrO~+{(`9 z(TMW=&kDWv^pS~5>!!C90WGxmtEI(~N9lHef-Oshu*ONnzp_6U%49KAxLJmb)0{dg z@XM6Dd%Nzs8`X_bXVmwC`G#+lz&sn8G3cr4j4JuJVd; zG1-8QKB>EloD3Z-OU;tI|0jp#6lFIMx0e7nvhv=G`-i@x=rw&1zFdEeIjxo>d zDOTouG+4iA<7Q4Th3{99evE`^cdW3~wy`xY(sTA`DhJX(6}Y}L{Ph#+)vBMIt)x5a zXG77aKfi-$zBxj^_1HQ<4)xr*nU{OAF+Y7Qcc1bs9#H6uW9goVbD-Wo3y4P395O$eYH~(FW8%x~V;#)G~F^|PiJal(i zc+%6ew1etuzNZt}=cuBRjCdK$djB7yzA`MT?t5FMLAtxUySuxQ?rtOn0qF+m?v`$( zdqfzzyQD)}V&H#xe(!a?-{-@ebM{{QUU#g`n9v&;5%}x}dAdcDDCY@$4t(V-n{-*c zUy9Al(c#KpMQAd5iXplk7!&0Z3vt3k$RR|cD&V6aK$s0;u4Xj_(4}rn=m+?Z$Wva} z!?9N3MUVP0U!m+S7KNJhGl)CU-b(qc$@!47NvC8od8h^d#(a!lFU0-S$DnuS#D^+g zDy5KR8Aa)P!_|o}2QMK)Sbr|4SgI7(Xq{oQ_XS^O{+AA{)Rz**c zw%hfMnMY~jh9uEZz_a1Sa>bOXO_3dw<$nOX83rV2(nCW@Hs@bkl8tdB8+%7HQL=Gm z+=1B*qKK{H=Jkl1)WE_vH70Z5-K`Cd z)_BRQGDTj2w_MBlXnBuF0_29g<8sCTfc9;WF(a-i1Fm0x@0a)M3kM8BY61hGAQ3IB zx8+t-h40L#*_c{y%EhY^7)!oUsAPV~jRXPR$3HBf#$HJ@pcvyPP>hl3eVouRsr%-_ zR($GyQN52qT8G!ppm0caxS0PHU-ji!oyzb4 zJ*Ys8D<{Vsxo64J$q*~@bRrJb)Y6rtbN=y{;m1VbNlmkzdswO`p~V~;7*9s~US>v0 zlgrD9z+~;V=ctR$0zC}PU?XB;zhyXI|NYjs>CU^{!+e%evLeV%7(Q|bqs*~LaezLh zbzMe;WGBkU&AkQrDcqq2UY_EjR>VKt*jXfuKzn%MNz*U<`VF=Bb;HF@_1444XSdYj z9T;9urQebHSpoi5U>_)gR`p4ZlNYGZq5XgmK>wE!GhQ%c_Ne_E+DyusfYtn;zpXs= z{FUkeAWPV20jG74FE@SR1*#0T<5xG~qHQ|iz_F+e?j)+|Z@NMRk{t*LfGGX_4*Iwi zhEo=tG#<`0=Ch3&IINf;0&=ufrdf+?X@5~{>$jf-4@oRg6-$Ne@s!6|cjQIGL#Nh| z&|N}@cicJ%7YCSFOv590$R`D*@#e?*ic^$pG^ezqO~13}lE{y+q|4jl0=b2e13-+N zBKc=qRljLTK4)eTRNL1O{PYMv!7MfQQl8yiY{u-__%K|iQt>wb)w{zq@~U$}udeRY z^T3mGZhL)Zv3oETWIKFv?Fss>x0m?@c;>W(qkF|R0UL^v%t?$Ibf2gr&{%#Lp`{Y&UI9=$GYgM&wEJOaV3it&i3A( z2bq)*@>GGN6t+0J(`Mt?Yis$e*(F`@Fu*3yOlfNt1TtWmQJFHcm8@Rd)c}_ zdTerdxUDv9RO4SVK1^bt@lJvG<|R)KP%PN8kPk(ds#YJirEpA`Fv5#|p-~U&@je&P z&1_kaD^l&q(d>FmePj*V=TmVQoV|lYh6bx~I8_*0+KRCc5(-cP3Z8*;#l;0Ds~-I5 zxC>csG<>MeJFxCt5HaC~ELZiW&Exhuob6LiT6|>|>?TG7^qCVKKC*@NQ21AIp}&EF zicrBv9e?-7Y)7v%cN+L=MCkV%my8J8W{t0wHL$v{0MXs_vj!0_!hfPt|55WNG>O{Z zUb%8)vC_CK^EX9-CxqG4i={?e)?2!yV6L^Bd*quhKKjR|o-4M!sh7VQQM!8J{MV0e z=iGT0IKca-q6-mlubVDzr>4A3+@RtfkvJ!C`{6=MbB>h1NU_xzHbxUzDdGuFd89co zE%%&*?>Eum>SnIa-^@}=4)G_(AA%CM0~d4dIMC>$Qe9i+iN67AuK^zUD#qN*2FsNw zy?5?@EDCxsI+YIJl&x$tFD#88)ksSA&_eW%Z zUcl*B8$p7VEW4I)ojGAIF08^Jk(|T80BfsXCKrAfer@L}e&FK{g6f}lMYD~Vsv2Sj zg!tevLana{Kih2Og`g6ErSwVn|1YIeFB?O&Up9?Kw3%`ka;KD{ zGOCLum6(Qt+mT3;bgV5#gWC?YZoBH6CKQEa63MQAf9u+o%4CJ~9dg-hZiNO%{kTIq z7_?-4?(x#s=p{vBHB<1c-|s-~8KH11U|X-|qooJ2< z29pg~l8FAI9iz|6=a=j`%T#g)^$(=Kam#ouUWy)^qF%h1un$WTt}Vu>;R|++@ZzlMa#kV z4N&&55n#|z{*f_0+N3s_vJsNewg`F$!LtEo2N9Z7r72T$o{+5-mJFnrD!%ZaN5jX> zX3JJp;c%^v^Dd@}i+O`Ls(^WGz47re;dVRoDR11iSJ2pNCo^2JwzxT+629G#-DRQH2)4h63Z`ZsO}d;=ArT)e9oe>*lK~cehLCVfJo(;O!LY zMd^!@-nLXZ-hTVV0oysV3GbdMe;LF~1hV>er||J#fsZ8(DT@dC`ms3Oz9 za{1N~O}b|`kSALzB@>WiOD-?mLgV6c+ag+J0r0J-A*p)Rj)jPvFO7;9h>BS}3ghU=W(W(iE-~ zA6nV#q$yXQdE1OIxgx9R-3PG7I1c$0XF%ZJNhOu&T^fXdmVP&z>3PquF^dMPlJJ!i zUNuI9-lliI9~@O2v1F3b8CgUlUgSqGJ;>yLkrv@6L4h8pyl?m(JA7TA58YPi43Uoa zw;S>y@8dXmwxU(PVp&&(IUheJl(scoT%1cQhX|hSKEQqTIfT2PJ}8Hit;9^<{DRz7 zbK60r>W5gZBABaDVZ&oE+vugMaJqE4L!+!Xd-Wb2hK?Ukjxrw)*0fdEtbyOBl>+2O z3iOL;AOC$jO0}iTPp`x$P=rrB8BbYHme?g?LBnO7>@0}tB^*IuU-h5Zni|vHM z83KO#BS1w*-xh->H~DU?8u~2$cyYWb9c-3mmk~L9B)U8OZ?q?-yl3Ll_Oy8u-!BSk z_5j@XWzi`1_%SPX(vItx-OFWV)Rwt1@y&k{^&eEoeMI=j`;OP9bE=>C=@71-#0rgX z8Llq&g+KYxY_sKn4dp`QTepE|L1tJr@lp?}=+kdhw{7M0q5;iJFR_MuSJV~Ua_`t( zqi&ynviGyGO2S+%ZKh|Sx-!B!bF#<}hJRS_xEO{>Rh9jqm`c4Izg#H~4PNHtgplk9 zdQhX(ZbohRKU&J=&=Vj~q9+XQyNYxC-2gNoWRtJ5gW^(yg-u{hMm*T$_e~2dL1PAP zE1OmME^$cZ79gZ-F8gJ2gnrtHtRVJ8~)Uyx>3^$vhaA+sTMfj$3syF zL}b4PDp>M;*Y$vJ*Zpy4`%#s5f%^jy&50K&-|y=5uMDMK!*3nFl+P$9C~n}W*#Lq3 zlT~N@W6i2;+;lFk>jnZ!DCN_B%< ziMx>zh;1&5wm%HkDzbU8=VwpIKs$el3CBmj(Ea|~hlAE3(4d5yg8O61k8Fmt=nmz`l+wC z;D)~)6tarQ>lSCT(R6%U+nXvf;G*PnO^XQ^DNSeCi=UnavXV9BBkJA$>DQzvzV3Hvu`=)DLEHWLnKE-K6V<4$@#vdacNZlt7wlcF^;oE~`P!r?#sDElH_;6&*! zoI00M=qA5v7kJ>2K8>{9t@sAH68-n82g+kxRp=r z(f6BcvB$o=3bcIHf9mc{pYP20X$_nq2CpCtEm+zvTRh$8dA#Uu5X&>%+C3dw&~oa z1T!xyM1rJU9H1ENMTMfAR|zk+M@@vwmc=qPTUhhLJo9^4>Oy)mzsF)IFpeFrKYZ2E z|AZj>6AJQ_AU-h|=R%W(t19Y1pI15;|9hX{ktq3c4Ov2sH9R?rk2#1&$RKeyI_dEX zKFT9H3e4xMs3C>fXB{QMK;xAQJt;D|@LfEC->oirICWMBRxxJdgMZlX-#HM*FMvut8P6LvX1_+x4s@DY`BfP z&&WwAqUuG54~=Kj1MIKpZ-OH`-p3IZd5m5$ytzn}I~3FYtYH{U=Zd`Y&gqb!Rk(e& zJTr0W9rQCv#d8mZ1t(?cJX@K5`BOLTd~Uq=T@I{8vk%Y>d>aJHIGF2vNakkGv*ABY|I z`B*qFbwiKpzZ+6~=#S-gKf2jh(o;C&yE3-UH1c&I zwBdlOIX!5n-F}}hPKqM&+pL{Qf6*yFzUq`x1F)>JlV_vIqPg7b-5(5BE~HMv7XU0T z_;BGOd`)2dZ_tEWm_+3!$?!gtaH^+W^V;HQ*u1Sz@BDXmK-3Y3KDfEg{IDH$oBRy! zqF!fO7unlyFe3pS8N)yRKUn&x#6XG+)=?TUW6MH3w+Y*ApPjB84A_i9mo#s@p5FP`-+-qO_YlMgyoh($3PGoV4;e2Zrt$Q*Y3JG zydF<*E1UVjVfgxI^)S3qcgfI8;9IF0LQ-T_t1p_~$d)=yT&w3STb<|JXmL5kheF)Z zA~Ck_yBmq08NzhA#+$JDYrjcTnn6P(9Uf%i33! z9!}XgoHzXScW_8O%{pi>fZ<<8(+}wl$I%Ts4)=X0 zz3A>rT=p$K(&d3m-}FQVcQK(1_77?DmJRpm?~7?y!G%Qlq9yFzr)V^-$L^PMa=ZxK z^6T()vbz@09&}SiG+}>nk&YkpjxHj@KqSMunMF7sE^<4^YBuWnX8of{3_92~U-aON zdSb5C8s$_w%+LKNo;)l<(ACo)K=aMeWXPU24_gKp$OH zFLdr^=SyiDAy@tR%zz%V`x7p2ByExR&!g5%>&}&X{V8SDjD55bUNmQh4+DSZz{J6( z^gT+eUIUXh_hP~BRVn7nqZCzmjcQkz_=u)F?Qc`IfqhqO@OO%MMjRlrpyJ9>CRRj; zkP&cBG#5J?;zjXz@3q@ayJ6XLE|og3Z8|Z}=M!j}?jc>+9 zcqC9Qe47o*ywy#&dN{AGJtt*p3ZU`F|RqVK_!n|q>Zrm+53?{rvwUnsBG;Lc)EG5fj^y2CAiQD4V0{a5ub zM6cd|B=L^xlc!yc;_yMk``?y1_yc+X6AWO)1IsB5S^N~iE*t0J6j)#hZz@wtzQqQ# zDN#R+(a<|d-Vw^k4>;>zNvcc3Ru6m{4~1t!OaiZMxCm=)(Sw2BR%=10sQCvGwYF7r zTl*tO@0jR%q_b%}GnsICR0`wOcXtu}2By(iQ5}mKBkIf3(^CQmKYx67sL#rKQ0eHA zM+V@sZPKl(d*TD6uX1llv~+44!R&t9?$!jvqg|ngJxjU$G2f-H`KQy{->jb476c`S z6?b5zg1PYo=3=C{ddo;V$`=RKlh@z9mw;!;TCZOM9||rh%A)S;Q;-w~QiZsUR|1I} zJ6a4B3ar1_;Hgyf+GCCJpT01TRx055!k)Uv&c|!>75CZa%8D! zbR4q&lQ?fg0pJ0%Y+8#fmK~Y8J+LQwU(A`hOzD+9Y;&fAv%>XLv{D8v*%R=UQeuHM zumYKgx0+QXtiK$-txognE-$|aRRckX(YGDUqO3x@EFXE)^e%%72kGI%4OCZ#?x{`| zb+_=^z`XxnzGnFNAmR*e~l#51JDUah&~&deMDqQ~B&2ZxS^dUR_TvF_JPL_^ozQr*v& zh)UVKPY>OBW+Fx31U$O&Y#4b~5HvSmQDGylK$#Vyi!!rrRyUo%79Pst_W0&*uN=+DOA&8@1x$Ebdj((cv6V z+5&saHLbJWVb^OVi^`<(K!0)N8_WS~;c^6HEg!C?K=}+w9IQ-`pXY04)#*^JaKzSqI!xC8(s%9PRt(=Y|JhqRxiO;`$t`-1xOLy*XViQkZy?d;-pJxc_~VZGRf(3 zBT}WM^CONn5LO#ZcPSSiE|L%niJ~Z`&j>rUM7Y@&$qGtRj6*6D=V;80Wg|LN?^>4 zJ6v|7vq`==5y;-k94pHG;sjzEw9M~#kS-%T2m(!{_Q(dqLy;APu zi!qNC8|HMgtpGG~aF-NWg>7Znvc1%6;qI5|PwJ^kG-wGjwyhO(4ag;*mlLhBgJ^}}iEsRJhW;Jt$U#=yP^AOIc^4veKSxqAxn!($$C zOU40YC&O?@o+oi}GVgl*x&u?*{pzgzWK{IHUcclJw(td0xH9AL*$f{cq(;%Eo)VHa*rU;q0}`$G#OL$$rzn-)E0>CE?9Dwka__ z4q9^0UWJ-dimCgCu!2&yve@;`pI? zCejGu{4kR2t+i>tN+y*)Xyo@;`mL*((PG|UU^*`Tv&px{*uA zJ*o4D92Emz@&V=Q1%QNsCLXiKbwc~dwMAwDT3xjr4c2*6697YQp)Hhil6r9Quke4i z;#_hSnd+#;%ijtqL7ol;=Vy-LmNPv=9{(P=#o}qVPe`VoeKO^8@Kz`kFr-A9smrBC z#X_`!G(x4;2iRi%gZISeq;s3e1ul_k{J4w&H|Snxj9}vw(Co>st90n=Qs)fJ1JS0o z?X^UI?Pk;nCNtfi(Q8iepWHWEAyHCCLkVTKFq2iOa&c5y4W*T|*#)HK;d5{A|30P` z6-Fm;u0m%p{c=kt+B|b#gZ>BU7gj0XHJ6A?AND=o=V3bp-8`HzrHzS32iu(cNz5WI zrs&PS`TCiU#i@Y|2JDEWXmsYRQTT5h-tdk`^aR_$>GRCxcg5QIGnBUVyA!aDAZHyLRmPLEloJa=1!6rn4=jt;h_E zdb|Ji_id&|B^6+;U=5id7e}+D7f?a5kLtJO2twO9(Qr9FAw_w#!x!i*{O}+PA>8*AaX~Y;RQ16>PREAr5c_{H0oj-U85e(k7wG~-e zSG`EWjk=1dyVMC^dOvnFQjE28qQTpmlux)NOQDG#aSeSoJ~QnT0ciit2>B@ z6>ZF(fK4+gS_5byZ#)+O^Fxd0Dwo|RO3s^VQ2aS5EfVR@A$P30*0j!t#{!R{_&}K@ zdaJTthAgX3q41*Cl32BgZ;XZso1Pq6!`t6X=#4KRt)IB51$-GFp)7(Tvn=^*ulYbKnirQL8YOgTB@$L+s`DXJ!=N=#6@(U-E3t0h~*@+2vuYENB zt%@Q6;zq^bc7_c6k!g$dWT7*_=ijK zTr-ACrlfR7pprtMug=pLLD)QR3=@-H%|aXyc$bGa!#U$`cNY~%2h%UTCjul3)R)ao zioMsr(o9J6p4|VrQM86M8zwCq3}Sk!4OD?om={ljCfz^PATGd1XE5r6aeJ+wnPbAE zgo3ojd5nI1O)gXdzA$YCIN6=)?Qc3PG%_kQp=boZv|n?gtXVMn`uq$z3Ud}{)$`>C zeoB?|)fogOb^JEWSCH}bCKVSN_fo?}hqtaV%1Lg;HGE0@h_PRtm#{1A>w0S1W(`Wz zNtivoelmZP}qdv3hAsU4{a~Zw~{1E`@zM#M&Lv8AM?e>g3 z6CT4n#FQ_L(}92SG@_o@WXC=uUfO2BwhU3whs1}6c%Uitq+rGrN%`r<>jY#g(HxQ% zj~Zgt_2$hjavzck)u>vrb7sXIwp#*PjXu&H>?ff5h8RJ{7p})0#jdY1#}{^^BOU`* zT1{ynMu3$H_}tTs6}F9do|S1|ZbV6kru}6zYRc)Zc!AjO$vDm)-#Hbqp7{W9t2W^5 zO@s~onS0C=^?WU1KT{Kt=G)zfX5CgU?#7IzQ}S@^Nv{v%Z+iwVy$+S%X!nF;Q z{-E(UXjqFuTG7OcUpmC&K};PhD~^wVKUIQ*O&HhTIM3vh6+mP0S^1-Co`l zEgfA+n*Qb>8pugJG=O|R9t9o2YCfNj6hJ;0Z~I-1zckI556(A&EJe5pz^z|}>l!5&3)6a@H!1x#Zc7?*Uh zGVbCZmwts=as++fjF97#@}p6KmBM24{32LZlZiB)@sx(LtT2LcxDh~i;+d1m@`fAk zg8#H%`WT$3ukH;mEN;%8c1xZV6m?uQ+wvXh8NC8Srud&Br!ZL}<%lJKOz}MmzhotTK{ZVOw1mqJE`rXGF~$L?SdN zImvBOiHjZO6Z?Wr6$LwpsC+8*S0&AA$l~~-lDs?!jsl)b(yhykoU)r4S%wn2@UO9V zO+}pn-IgpLUIrG_Cz&OMvkdn?99pe7)5yXSu0EPxgCx}~jDY%t2F1u5UUl?Q(hzLOKj_%nY4O}3z6W$HA52&fBe(; zfu&4$!}kc#!6&&Y2l^6yTt#nrb)ItK^O5IK47|)kAy=hr`o`-;rV+p4VG-YOt-B>UTU;rH3Z=Lt! zh@ae0^Or#N`>;+PXHd$7oreJDnCJW^)IuuzvN6Zu2k@ zuLI?sy6SE~hbEv)WW2Ysvy@j!B0lMUbIiwO@ zJ_SM>#qiNwy`ijW`!aucMSF##lqsLR(@f(^DMSE6IsSPF>_75IFKqk?D;be6`;zd$ zlBzI6rb@098V@Sw8oW|Ec9$F3Wy??^liD@&>}D$Sji%dn;z zp&i}Z*VJxnXMg%(RsShtRC=TLTLgIoN~7N1>%xCzjQ0X8IE$Cqd77@#8zx`)Xjlh(0SV^5UJ zISkRs!Ke9YPTw-fS%t4t9;TuqV!%2e#fRwaXQ48|swtC=-@-|Vjw&<5ax&497&Ue5 zS7iBXvR`UcD%jdBAM8r+ozeq3GSaB-Ass481X2Yh_vSrH)eF&&9nk)g&1-&*O3ozY z_|!_GEGwgU{>bQVWPMe?|BwK({#E31RIMZ%8x6$Pwc5rXBKXgPB^6!KL$#6zMVZUmYN0!V=% z6oFcfV~~`#ofH0kwSjm9k1~#=?BkXoPsV~poHZpX&F8EJ0mqDPdy>}fpD>B0)_P4x z(c#5QZMRU(%ozwFQQ(8P4pq6KT`svyu+2cWYHu`eo;h!%RmSJ?O;XEGqF}eRif9Mf zUv6K@IyyRlF%z5Ap=_IB0zi7=;p7$CCNt)C#)9COaL5J7P6!xfa5v4z8uVPcrOa!^ zJ}m)>f_hOYUK6uhRnvc)7Ta_bh4AKybWW#AA@==j>!*BUMt=bbdSn0v(AM@3@+YCy z3-oG))T)pHks?vq&+YH}dSpHxjqb8;+yrC#pT{{4oZGPav&y#Z6Zs2sL6eH!UF#Si z0?5qz!MMQ|x=_p)KVK#ppCwu`IV|;!r(2=zqOazLfzZZ0lXZ%c} z3Z4%p6Db;Ap-#1GzhrEi-6|r%Xy7}4IYZy1K)_G5SoE?1!^`=%TGY!qtYr!Smp;C5q5K^Oix&hJCL345guMQia}7#S|*O zoKla2GcXfyE$cgZDRC|M=mj8pqZW7(>d-Hx9y+L9Hulq=JW~!(xu(ADSpNAzKOBp6 zpt>TqJk9)6zZ-Tx@-?=5JZSk7bHr$3wmq8jmHK`6>uoBjJ%N@7z;^n#WbAJ6MGpGoSRmWapQB@ns)xdepU@!ttupo|0RCKxWOn?1o_E zCS-OtE6-T{Z+2GJN}Zjr8bt>c4OSG!pq`diy<}2JrZ15YvmjK$b3W@)2jt7e2x@)6 zgZ_HF3+%47N?)}>t?VfGD7%uy6jkJKO-DWVAkK85oO(*h>&6HLd(K)jX^SjF9Ez3L z+(qx;5spD2rf@+;_fIo1?QgYM2^EcVnp8v*-UnN)Ewmi(1@M%p?k@LB%x89%<=KOb zU2yiuwT{|joc^OlBp7m5#bfcBCJc2h%4A@f7^w(WlGRt~(9I^^ z^w*-oz2!K1v}-?MJ=e_t<;mY;nJ9%_0(QoYQoNl8d^3laz^zr!@ax1YkS8qZqsZZu zhFjoXqAcQ+NEXJQb)O@X8zk zG%SVD3Y)}(&(TH&gfVA`Ym}j!2`}B~H?;V2_WfQWr77Y6`JthN#i9(WLA0Z&-D~9^ z35oQNoQ{T`CS9KQ;HVKSobeK7PH6D3fth?_F7NyndLwcjT8kPw`VU=U9VeXJ-L56u zXrH^PUJfSt9)ns1^L8%(wb?tIylT#dU`$(4+guYCQO&Kct|lh!EVIh%(j3(np~6Y> zwLY;$gVOBvE0L9#pkz&C8FB~#q6nUE~roxu}PKmmSvTIhmkBw z$lfq5}~#lLDjnqJYm*z}lAa+kurN+h*w|>9x(q&2iD}#_JZ3c&1=3uNDVNA5j*U z_B4m~ju^DC$ZPMbB&{C5u(0qN_E=SO6clyX=rb>uA|@;>T<$O8qLx%*aLX6KMbtlS z6!ASZzec{)T!;jepYJPw!%bAHf1Ks!`XoXG+4}x3z;e$DWjToEQkO_P5G_$o>PFfk zQ2LQ81{~dmKwU5BbXZ{*grQm+#0)WSsK^)~iVKxa8a8h^cF(i5RKpC#mKNv3`!;Mo zPc0KOOhF^!APzAe*=1*MSfNv*3MdH-z78F3GWE{(Q|wS@xX(dz>DCh&|7t3tfz%j_ z5~V~pwF`Q3XxlE$7me{Y(TfO=?kFMD@uIg$$dT|>Da&|Q!+Y!Za9n4MCP~tQ9S8v2 zgX$4D>LSKIgH$P4I+lr7VX{EIHcUAToUhL4wY|lTY7y$VDxDk4m3q38L5_*+&LhC^ z3lHJwkrczn{z*cxecR=XessA7)Eme2O%6;B_Z>o zXnB88f++JoN(0v55Q9UFXQy?(E-&1UY(Ze_Pch+C;cb|EcW~A0AU^tSU(A=uri|r& z_!NDI`K42Eg)7&~v1xUU8$AZ)j1cR1@--x|Tj`_2^eo|Ib>C&TEVqdLGwS^Ot;zJi0x6HM z3^gi_@b30@Qz$a<;x$!rZGQN$Ntc5dwkPfHgzc7clLhM9LJDRt0ITUJqbf;#iv1KJ1xrsy_bbK9F`de;EAL>G z<@YeeAcjk|LW2oJA-LP_gCrs(CECKO^4PEqSk)L!)@eO$9 z2N-eY23y#BL6$MlZHrLpva5(J1Oy#~t8O=E>xXuV=K&g|Hcf(3^E;+Ac%UM5k5&i2 zT*@&VAI(|Q2K!lGasPlrTc???NcoYR%tl&)_RJV4QOBw@7@|qS9H@&-S??o2UkBYH z$7_!V5l?ly@t=4AiR+SG>1Q{+&ogOn^jtNUa>DBLTKMMcEGN7}*E~N-g0Qi{>ff9) zU|ClUR7p@k0YkA;R~)ZY#AXh>w)j!fp<+lokudj_ex4qT6tQ>xt?QNcx5~{UN7myX z{*vLnsGQ+{g6!H6cS7yOy>rm2Ugh%CrkzhKZywW1H5RUAq;aJd=se*l82j75JVGmw z9@wZ1IK(Q8+Mi&5Y)0Ir$$%}As1WFlNl#Inl4M`u^$nssa!tEsftQoqfD3L*C$Gj z%~;OHA!2ENO;@kZn@%zh*uju8J-SZ6_cBUbb8-YC9mo1^duPJ(f(Vc1b1=!^ZLFx_ zs!DxF7rQy;{$r1y+jk#dN+}7V3aTXYi7os`C+EbG9S~rk;2-_MAqA8DzGoyDM7ur`=B|Gt;iwCLQKTWbKyCI%}YHl~p z8|9>FpJT4s?k5PJe&A@f6UT-30R2SMYJ_o%xu{-iv%Y)_tSV)~wD z@q5NoM;G+&Pq#@sm;KuvSJAk)2Q*kWG0{UlU(x(cBMMSHP)9a7pzMa1Wg;X}u!3L6 z?wp_B2`)NH`%BkMZ&RfVsiehRWfWOh69m9sq=Tr~Gh(2}ipS%M|a7|6kdv|42 z1u3Wj;9JOJ;oxjAjp-&wmK51vtsVWM|1JH{*(o(CHIrYV-*u@!-g|GYd8bb`qyNdD zFury*WaF-I*5GosnkRb+!^xYEb;+c;yh_q>em6{q&B#c!O`D|^3G{_&|V5THje|R31{6^dbR*c zIN8fC;H!$UWfq(@~x)y{GJ%y zrO&1-4w&+Z>h@{((!X^(5GajoQ!%b=ec`&e-_>)%F5AXK8P_d5=%mVU5X0+TW}O{P zTJ)}a{O3UFi40!rO3c~sBThaz=t}o9_WHiJL2>A$)KgDUV=7astE&^O1s02K-&@Jf z3=R&K#))ZWP*07vWCBvH_(;};r{`fI=bDn1*6VR+e67x`9R@8mI&75kNmBXJorClY z=g-1XPrQOTEYnS{WWF6M=qO=a2}iSzUV=hB9+&k)iwz4-&xM99ids`H86z zixT#0&R+FX43+sq*?Od{ka7l#QmZaojU#NW2?uFqCh0nz?`w_I((?gwRz539!mF~A z6C}_!z?6c34M56DbknQ(5g5|yBA05cy3Fz%nS6Czq}S)h-}GW?BL=_xktB^w3d8uM z_Va{~!7DIQH^u+*#=K=^OJ2G6xFYI;I;kl<P4Vx?4RTtupH|;)(Ag{q%W~Ixdv*f5FRm=_@LT+hY zMoB%Kj0J|&@Kj}>3BTsS(2?*C9J)qw9k^VKTzcOXb=QIq)xw$d(k5@Un@#2yJ)3!` zhp+e4($dm{9B`B)XrG!42BRummOyv&*~1I_a=N{RpFD1vbYk`)4A?LM(g@0RHBS7M zZy$K-?LRiGt*yy>by^XVVG|H57D*SYU&6ye0Ru53haWramA2I+6rYV3^$NrVL12Dt{QL2&33o zSXg5m3-U=^{fD|Y7zrSBc<8PBdkVbM&e>CsmBg&9@aJbC;71gqqNLK&(mPIGUMP)C zP15F5yO(``J`e872dz8ff}%lBZ9*Wkre$gK&#y23J|{ITx}A5*Dd`uO`Lmx|GLirU z9Wx)CiDc8XNP)~>nDW4Y9)ABX zFJHO2Irp47XJ)RsW`>c^jlNEV#NTLk%IMC@`iTTQsU1m8zql+ewKX>Sv+#DZ>q3wi z@q`o`LK}q&>}BsG6sarGD>7&+BuE?ZdcNSpJT%eqQnIuee7AQd+LaI;vY&!v!^+9a z%kz~iCHvsfgs!lAX=-qO9pK@43_nd*lQ=jy(9qKQM8qg(d9=nyDdzSN8Ls>}E{>6& zJIR={akNXHiCB&|pS!;uVn`X@)wv`yeMAZ)3a{$#=hUn*Fg1+?<0AeJi0E4#t_;}O z*(o&^c6~y_?u?rack+X#!;M-2;uPJ@6yNt}JNF(oUIQ60AzG2Gf@r9Df>~-v)P^2< z;$Wmv+=wXhEsX`_t)Bqe7S>L*HQh`jq387SxK}B=qk&T~wv)QLriSd}i^pPOhV|zw z#&1{Cy^%D3x3}rmwzgh)dlNJ^HT_1TKc1WjSJ&2Nm6VW~nx?Nl&m+mwSbI;y;OW2N z*6=*WQ6V8KxTEZ8~wZxcBC%tgdM7maza{U9af4QgWX)lkA?;U>I^IZ4ddr<~9q`H<|6r_|Lxf}sKu zQD5!n-;CVeFf$s)#>A$waMbxfdh;{gBv>FV>M8lTbz9M$W4fc(u}F(w-;%OcMa{8U z?!RoaHFegyUPN^H?D2Jgw2{#tsB#9CK<+}6M51MH?6+h-t5Ajeg@N;dvdy{wyvo4&J@sCdTXbPeCPx|ItX^5UGoN zG<{@yJEVS=n@_ZBcNYfcr<@~YrPz@Wa*vdhl)dx!mKC+{4sFm5t|PhLL&ruQPXq)Q z-xZR}lcn$0*twV6$HW?|yJJSVOok1HcB;_QJI}D2iE3-{p0^spVJOj>eKyEVH22)t zYID?hZjR56vT!VCmJc>KM91O5jBNAOcM2p2tT9la;^;!6X;3f@yZrJ9hkP-^Z>Ot0 z1PA7qv9rTnU0sbl-U_MZE@IH0Nb;8=A4eu8lE;`77Z!G| zkL0;-jI!(Kd?D-YuC2vKxA!cRr#syHN6oJrvF~$5QB!jqXzM`>^>_nJI&(^U`^=*c z%P_-4?1-punT=1hD0l+e%x7NeQiuROhPaA4j63#!dB??~o)NLQXjwnYzF1n^IEnr6 zK82|xGqRCQMNyGxx^S#(dalKf1$n6zE3t?f`CS_fZ*l0~1 zJw%~FT7hevYEIIY7fK1%*50CgwT{>ax#Z#2i|eZLM0U4!P48U1^YV3=wyhIZUTvvr zFAN@0(P76dJl}|{$60vwbL}nn`p6i(5?3W%oGhGT{-eZ>!6(Bin;#2rQ56+0-{WIU zJ*a3iRX2BmVa_qEiGvAbgfet zlI&Tz{g{#~#iUIY5?at@sfz3}y!k29-{$?a)KoM~H$1)?mGxN7MJhOzG2sRA)f_X4 zw>`G=nUcA~9LTa(8AoL|Ww{i&3lbBxkiOZ|8rFhB_}q0`(OHC4N~Z4H^OY3F=F`c7 zEkt9px&I4y3ze@@VB=Az{otw;Kekrdf)@9g~C$%7N> z@$OEOJ_28%$(m|NIX2$jgLA`@i55S+OPPt7M6pxMedX276%C*Fj-*PeAl36s3V@lQ z)~hcXkf>xEBh%aeD1_*X#yDc(YI%oO#!c5%h&s^enA5zK_L&}M&(5r0SI;QyTcfCe z_NOCDXjzwWDM@eF6;X&>n5^KFSv)7vR#)l9RPhM>*9s};4eu0q2FL>S7O^?JGoXI3 zaG$oSl3hp&2B>qg82z%(_JvQ*(UXO`l)7l6!s?hDL{raYZoZ-yOcEQ%x7XL@93191 z2Rac;6+ZjKoTiPWU@#%w7d491w6w0(@81#q*9j3IVlXR{pCQyIg_jKXL^JfX`d^m& zopJ*c+m#|<+u10^+!Zo9s#Ad>yfoknLj;!Q=H7T_FFip$>lnj}K`gJXf;PlgFJu3O zMMPu=W{slJPgw+-X4PV#Ce>?tGae)NE4Di}kC7bEV|SG1_3p4))8`_mvJUY>a>itG3=ECpDtrs@3M;Zxr zeYI)kXk0_3+cN}$`q#($jJ4n{`tf0Xy#PhL4+d(JJD7TIgEsQ$-@l*Coy>FY?uOVU zdX_bkdWvrCoom5j`3N5)Gr~c1J=yBtq`*rLl-DcLd?#y@=~#RFzTD z3jrfIfFet0rjqRZA?K*4I*Ppm8L2DACzoo2BMZpK30s9uoq^M5md2=ICqN+OZ z7(+H$*a@5d{od0Vzg>Sy>40VfQ6UkL@UHk2a@9gRK@M^d;;J$cjdjIb=naXAIM4W$ z+Pfwgd=^jlLQ80w>acVquC*3+JxZ>4C0s<#UT`+u=xR9#zdf9$F0*p$|LCx<{5F8I}7>zpicHJPA>Lebeq)aso(qG2gZR8jEY=H_OE zUQx4LY)*_^*H`XLASW?;MkV zLMYnyyvC>`mDU{Rx)&DR!x$T8-yeog*B*+uS>ZfuJlSw472KgYQf#rbe|B3`QgZvz z;vSHR>$0phF%0&|Jc((YJ$ull!l2W1Y-L5y+SWF!*pa^VxTNi+p<&A8-1O|MQ{npC zjrQC&YV^7X5*9PGN)jj>bi6tL!+q$Q$YG)tQCq7fN-MnYpYZzdsGuRf9o^+mf^uoa zCwH(Use(Sp>LeSD&+MEsWq=SPDd`4vQx5m;)0);%NI7*MKWpAWr!DlVHT|7GuJy3I z-IO5Q;=APyfof(_DBDEHt$Qw6RHU$KzR0Nq;LP>(iRJX>E{b2#ml2@Z6|Hz7?Fy>L zcW$E3Rz(jKhe68ab6AH3nmRu(PrkUq)w#u~_PDwW!pOz-V150K9hgF2>twutv01j1 z?hPgfW+~#j_5S=RI*;A^Rg^$3d%p>citd-D|6)gJArte{C$YW#lm2VN#vypzsf$Z# zQ4xi45U_g))(oHf>XQ38$^T}?#}oII+LYJJv=a5H+gqU(>@!=x&V(Si3|^>u|KD&Lnn#DY;%+N zpinHDGgzV{%*tg~ZmB?A){-qn7~9GvBLLk-aQv|RwuWx)&9;)AiA{E^*@`+_cmBJ$ zzkBr&_+e}osf9G)uQQ4H@|Cs2-jw)d0r&C9DO z@@nb%IbV7U<#MJ(esQ=k!{G4tXUjEUy%77cQf_e*r~K4(aYaRt^hcKNZdOSyb5=zP zOz#bT_lzJJd&=`{*{4cypfdozuW(v!$`|$R25w@w7n$o@-18ZPqwIvO&W;%lG=hzn@(Qf2}w&6 z=oRt#lan#uD5PU(h3uPc3<&Y%oSg8?eAk(quMXURk3hlD_v;totz0(E zD|4){zK@1=a~~?3$e+|P4FRl#y8wWad9`#hex_;YER)gX29mDvsQ@RkNRSNCZ?AI> zl&pBir^FeR4fLl2@h7E+S62jj!BmHr5^8J93P$e@5r|h$^$XCJ?RF>L&*Z@q6PvQL zwRMzQI}k{TPC&iaUEv9h4l6?Tf;P)xcyI%m7F z!EK61@5VxqU6AamDjMfHWzPR@c6M8XT;4CySlYXT3BK&LB0Wp4nlW}YMlkbE;3$n8 z$&JP~o*A_TNZss(&0B2$se$~M7I`Wz@Wz+xM4wBoY2V0TNNX7feL?a!U!1ZufEI6S-mk+9i}fSkvS6Qh{ZuyRyKR)bsq+S|k1 zJNy@{ZQkWqAxwy+ZW=_5GOjImF1+OBR@Ev=_@hVXmTuMe5HRPDEc}EdNGRep2twb> z$G%-~O%>OqFx^1idBYUGo-zDRe>|EmHZr02D=I4wu2!kosUwk(N=DX66`{v5Dmd*w zG;SH1&lYhEDlEnD=_Mi06H`*S3(4c2R;;}hY}w|0x{DST_Qs(IGbuk9IU z_$6|k;Jt7RMRfPu_x@rV(fX_`go-j#w?^-~TJAagQeW&S3H!+86V*r^Man8?Dnfs* zE$8MYfcMS`k885kUSKZJPkva%{^Zhc=v3~D`jv~%R~iiR#~?Sk9M{hkNJUQE#Z#6OfD3T z<|4K|!56u%9g@e#)Y1);>8YP+THP*Tx2?HXOlpo2oQvbrYnwe*op>Z=XNPIh#Xn-a zPo9tq1vZ8DRfsuK@?BB`KL;;mWc$ry?Fs5IP&QGko94RmTk$SHSJ!9E&GmJ?+^$;Z|a!{Q&c4@ zweC)SSs6oyY5)S4U$SfxL0nwU>-~|*5CDGh5r#H!U!`*kAiKapt zKv;A{rNqfi9B%6!2rrj*G@y;;Tv%~2_5B@atBQl)dfvL@+NeESzwj))Y{Nm^9;Bwn zF0ppc^T~<^J}s_i!x)rtj75GEjvLK$vIqt4ot)$(kIs0@&IGoKEXK3Pb>^(R?xXL@ z*UXN<=dtkh_3ad1nwvA*ZymE28i+jgk>no#_UO?g%en!Vz{~lw%-eGY0If2zvMTEc zu#`&IgX&L?y77sLUDe-Mh)^kaNfIJF3-AZg#+<`d2ua&p2qQQa*nG$PBbhh21X4%u z0REHFHu5IkfRlxO0}_Pj?9(QFa^q)r;612Ih_T{^8h<_Ur9Jm`&UVe9+I(+g{-kVRE|6g{u*A z*^3Kq4WCm|dZCN|>FDY%c2SsjBFT7`zJHWmw3?ctdfOCdB~#sZs5xe-MpQ)JYZ9Tt zY4(O#9nrPF&~&NcSFcrPa8SnH-U%on7n|);_qGC^!q_qA-+y6JW=l5s6eFV2yciGz z?alpGN(J&-KT5s5SYSey^Eo!sscFVtmvJnr->*-lKgcuq<68AZ35iQ;V}-~-DkjIq zn8yQb6gf{=aSsm;Iz4+f#)|f;GOuwZyjw9dhZvEMiEHqTG~*e@M@O$k@4mb{B5>s? zH3}Q&Ff;b``6fc#{5DlML1ThK^@xx>}S%ybO zNa%YsvIEp7iVcG(%zWqpdyw4M_X^AhTV;W=%8%W#lr+6gWmM9J3Ss<70KROLwbiUy zeRy9Av0fqSipJ%8_)lq!PBMHcjR5{Idwg`h=UkmLWXz&zqbw4JvK03;t~vi>0Fv5Q z`^=Q@u6;zcwSo7gKoRD((~~Ie@;#+vCA0lzeGcwicQ})?(o^oSo?bppGS1G%?k`?p zm$<8c8@~}7tEH)Wel()KFn@bZ0lZWBmoGCEKCmpZ)T91J3klVj4_`x}9hAUch_i8U z_~^#wU=q8Qx+6NjqP|ZBx({z2FHYHJc5F>mxvun6#k}XY46g!g{}{Up11JorSYwuP zNmwBgS>?0Su)4QVR0bTn>_sa>Ln>6Bs+JB{Zaqk;U-?l$1f-{dTQR7;h)o@(^VMw# z>&WY9!?!f1s@r1ps#pJ5$n@Arw0^}u*h9fL%3KsLWJI1|%^|^uwr70%<@G-Gz!LRi z7UDPg4led2WANR!mIp2AQg^;*W~tm4(S2$(%|2Sb4bErPO-W}qjD-;dVF#fF*IeCH z>5a{2`ca{LU)9*8q%eS&U5!Xz6Bg;Wu@m=*iHTtq=;@HY_6K;|wj~Y)(VHkN7$g#$ zg<`-qh?!emSEg5jcP-NVXTsVStAG7-v|yy%ZJ7gY`>nQiyd3d1M#0?urn*`%Mn$l1 z(S|KtF5BmDKxBVdnFn6jRa$CRZ=z;xW5c96wzyWXqyeIRl@yWmUR(ZzTmlD;hRcVI zsS+My0dw^b6(jKvPTinjxGaER+tVqvd#O*gV@uwdev}WS@Pn)TA~vU36p0VI$t?fj zk^EIUr6$LWp4U*NFTPJz+3vUF+=aJfqHh0^&kXeR#I>{};XPy{^ZA~B+PteL z4Qx%DEP$3oMTd`mM>jTL`OL!|mYv(9I-uNB97ch^<}kK;tDT1bb>lmgs#W7nc=+d7 zv3j$*noISivy~vrT|<oa_^O)qX4J0Ns`NqDJV0;^@E?)+PeD{`{$NL1Ljd$4f{^P}*7- zxelyui*v6cQu)abcMaiyl%Rt4_@Y2&w@ZZRx>y>6!!QG%{!?)Mx>cl%=^4>&r7POl zO6wYV!I7xK5K@7YM{ps^#p>XCwml1n9hb-~jN4HE!rz|cVG+s{-^&6Hz25Bw$YtQQ zwA`!c@2b2L5l-N=-5hJ5tp?t(dU$wb z)f?O@{zjra6tx`9JVE?Ct0p7ZzxOL5^jXi(#l>mspLHCuf;1Z4z^AbA(11dX-0Epj z?NxRrSaPZ~VOSHYp(6u@7F@6(i&1*fpg*#ELl4YvY~ky3(K zHQiCzCC6NkF=ge#V9*?Pn5NOa^_=^!lO8Uo3+U?7{I}N|6)MR>`o@4NA=4Z+xpiwC zo72PmWMIt)4kzxltg_s=qDsDPNYmtP1TcT-mqcyPe6hFGCAtF-E_}IaDVI!Q5BE|D zej7=Zi#~VW7#90UpEodsY-^#pG@mY2tkiy8W2nLV?xB)Rq!k2hy`eVoY8o{9`aABX z%He~6$0F{3qeC8qvF*9&>gs}&k!%jd-D-aJ_aEgpN=XL?yMQ!a=@3+KOSQ$7W#?*R z^>3fG-~EzD5`LOhyMh~0dS<$?x$34;`SIlY1B;?9+k_k#Vx-JPf|w)E^GqH7g4Uf6 z%ADl&55M~@P0xCfs?volQdxmE(L&*o7-dB@Bn~&1LSWJ`1oChRdGIWd?QE&LyW1=~ z=;?6kKAjQ5L%6cur*&kSkjVlc$lr zBT+)n{tkVScU#yxzU^)WLL%Nb`;PlAaV75+MdA)3oA$yOBpC}y5O9TZrC1%Cs!4jq z(|4z}-k!Qtbc8X9^~Bjvovh!i&nta4i)Uh=T{D2g`$0kZ;?Kbcs6xA$V#H^mwFG&F z7;7wc!-Ah_1{|?&071)gmWKSm(dWv|dG}e2Uwwp9tMdI%deaZJ$nJZmJUUBi&xW1< zG&;t_NMt?CQj=~p<~A=_8&K=2r^$PDcv5ERa5 zrks1jNyGkcOt($bcWLMdV)T+VaJ>fuxMK#2f0pYr~iYy zZPKim`S_cdpUOSL@T~08<4>7!n(-m~BI-TKX}Rrj110A+q(_+hTLghYj1mOYbl5~O z1&aRUd3hIZewR*VGSGO=Kh#F97vHha#xaU8f3X&4 zO@x8C11&$2-y-JqL%%BxOIK1=hLS$9*F}%O-aYABvMY0FDlCf(hCmutRaDWErAM)} zqS~}}C3d8{%9X**6|iKV%Nn+H0s2yp=#^C_r-#=suXY$RWR}qafV2dS7i3aQO$YsE za$BkZQ3x5o1qAlgR>yTcP%-w18DuCRO2Vck>G`5=)FTvwQ@_Y=@Y-==Pkl54eNUaw_as9+KK%yZ~hT|`Qzw@ zRv>M=>@m;Y@CgC=DI#V%tl{`09dj=~+toC=9vMMO6}I8e{FU`byRQu|q5vs?h`A_g z#jAQ$*y7g}70AXHE5zpb@mFL@bcD}TgxHnY%ZL)TqROzmj!-@;l(WPG_9{T-%k2cO zLXK*#@`e^W=d9$yUP9xmq2DYEc_!zk8ajZUVjzM1`Q<1Q=I&9oy&i%>P(R)jI|7c1 zoXW86B^TAuN+n~U7W;jt*)^xl)~(f^C2SM3q+Yq3q%&KGx!W6C z8}vY(e=lY_8hG=Ajy`iYq_niOZ+@1MpGsH(mGz=h zIZ;~a?lOM@h02DY*bHvsY>5sqBk@B#^n7Q1RNB0`9ix<8M0OnQ!rE${S-8eD3A&Q|ln9k~6SxO%$v(6e{HRS^~^ z9Zq>R5H#ZoTg!Krn`CHQTQ#)CqGCKCrlv{hD73v{;z$A)gK;cVq?+>an1_c~A`Kl5 zdhC@w9D$;$vNFs3Dherz0w}J> zF%mKAs4v;9Lnjd~5^#+~TM!cAnZ|l#cPwA|0~}y}O#@y^S|_RPRwZ!@yYG{r49&>~ z4;G@IYJB>shr`0166D~VdSCIzahP|DAp2M+{b@xEA1UkyjryV32e^XzhEU1$${7XF zXVA}HBPU0w^6RTF))iNJu}m!82)M`S>^R~}tmMDM6&gBhW;l;D$$E$(I7Kfwi7z|n zyE-)gsj=~K3M&-{8Taka6_)&Oi)dBU_kGPlvcO(IoDlWw2Nai?Ys&sIhDlKcNkYW@ zJ(ObHjk1F`PVY;kSfBGpp3^v*dqx~-ggeXS84EA2)923?jsN!|&isj5{HcT6h^U}7 zB|a)y#e$q1YZUJK1aX=u5fL-gMW3eo4+%uX}@Cq5c%-rls-3wv8z+bVPgp(*||Qg-&KC)b~QfvR`@IUAmq z3wwd_nUlYJ-iwQ6hTrtcP&cr8c&(i6o^Xjz&l(|62C`%735;`0z@_kD2KPb^NLk00 z{g){qjt@aCz8(q#t;Ofn-sbN42{UW(6S; z)ytM~-LiL)Krn7#1=dz^*3TP=iKvz*F~iW~llC5z)=!$IKT;9QGI5YeOWjKi4Xq8; zqn-DhT;l~FP~tw(>~;5lNx}auh~VI8(Y}8GqztzcoxU8rypuqjHCFa7mJZ9M_ib75 zAYi{DzL_0Had4R015!j1U}iFtDR!?$Mty|a)lav*i$*^sjETbE^Zo+=`L_9lxylM? zyPTI-t^By2}rPpaTE~8 zg+Mk~mBTx0cw?{taaPg7S`%GEoa1qK%cG*dO#1b&5whL04(Fs7JWBt!D+r91!V9A} z7VD08A|x!uXJ=QaeBXrTBP2qzrgKU=gGJ?JkzA#-K=|pxVGRRolyL4~@O8w*brK{* zDgEmYSig2QkR{r&X#^$>(TZAlP(ndIp_!b;-4clHBN?&5iYnBaAIz~<9gDm>3er>g z@_032@y952up=t!6$YgO;usJ}WBCS&?w!o2^TAu-KdYIF+UfkP#Z}m1*A+jP3jN|t<#>^}UVHjV@{>Z|jTn-}d*b{jWc!&&_POH& zCPjX6;N&(knbE{Gyj^~gD_of4QN^SvvhGh0(BQ~Kg{ia_2{>(Fc%Cc~BF zft$N$L?S$bJiJHKR5wIH5W9%kwMJvZJ-%=G(@+vpK1nJ800@>H$EuDDDKT5zulI>hOho2Dh|syJX&_r2*qJKi@Ox$kJ8b~D zwZ%E=^vpyK4A_=cIO06OFj zUDE6vnq}8Fe~3a)1_H8&G|0S(wbsnUjcx_&N0gdOrZEiJsi zUuAaiCA7Dop#h7h^$e286NuI1wN1pJtgapc($wM8;aqQ-6;KxnE)>daCskrw27BKj zoEKM?`?io_bJ^GF3Xq+tvwQ77e#4}Bh_Jd8B;BSOp@xa**;&t4YS;1Nl(Tk<)+eBM z<~v6^IYAR4A)%~q-yY$IF=nmmPUu;6NBjV|-RWLj<`pS3GmOI2rT6ozv3D(?&-!di z;V&6ebr}ybaMrYGOtt>pQ&bw;JYy(Ri)VU5ub&$9W3TxY?<73}It-ei9H+UoHY}b@ zyR@wyt&fx&9R1ngd`gSovF(+e1D&{HC&If2vTNOkL(*YF4tm)I1&_S^%*Rk;z6*t2 zP#tzN?ySinn>vdhL3NgBiXFm07Kl@qm214qTx3a^6Lg@U@Yw}*3kfo*P%Zwoq0Svc z2SSO<`0UvO<)k@854|65-AtvzL_M7CosN#q6H456=Q?x2f;^#P$v1D_z~!LrKvUg-rY@8P z92Z63P6S?0RM`%GK_7=G`)g`Nn`>#cmkdHZx~QqC%PqV53|g;XAUQ3s8*Wynf7NjN zPC3y!MrU*+L5IQri$GThX6rex4fmI9D;;QuJSTYvz*sxGljdcFIY&& zY7!e)!~@k_e{f~x<3Z{$Y*d|ITHOAosdYT3+DCq6`Rq z^fq<~styW?>5qzv($LdOJi58ubs7Bii+W;oG-ne>pN&*TO%1=YQnWrCj$yMo&gFA5 zWm^Gqf`HrG;avArLV|=moJ`~EW$mhhq_1ue`9);1D7N{<4awf?4X<6e-OuTxykmpY zt5juYht_0hH4IE*THB1I1PE)EhQZ8#hLzS>t!G_5uA3!wuET;vrdsaqRX$9 zFbfMJ`gi~C2nf;^o$y#3d^^QXyqS>%viB&ak-r3tDSy_6i5kbNPEXZ!D9V4lI&%kj zSCIfee>XUEbk{?-S3{Za57XwaO6P(MATjV{h@R0e#eArs4>$&k+!uX3Z4pv_zq)!V ztN0g`_cwg!KC+NrN*#$rFJ5%LPVI&Yj?&G$KYVs`{m!G-3-^o?p};0bL=r@1WIWw< zIbkMYs`4h_Y(aivPRnoVp+}n5GBN$Z z(h=77;3XWygpu7hCi?of=f%avXf7_U;|cS?>tNM1;cZ7Jry8)kvpdN}JTesqxLsXc zs6Yr&Oro&!%!k#COU5~)Ch}HNfA62T!ddyL!htOGw>SDi;Rw5YY|IXyg}k*~| z|6(W;=`#oWzx$099_v~l5p0Kc`uy4~ln_03czK;)Sg3S1x_WbuYyNW1`z`^s_342T z@I@Cw@7CzcN;-z~>bMTv*$F}-OCKg^IM;T-xchDzmu3&Z6qNG0IC^7RMAETPp1k%Y zE-rgo3=aQwnz)p8xjS)8Ys5sVI~5{!b}@9DX#5qyy|{)Mw%2oeIu8#nb0i#IW`bm$ z?OFBh{fkpaas@%5L9aVUZDE?9GcvdfODK3+@yN(*W75)25%;(dKF?nR$uYUksvuPI zT?m!`rL3&1&{0uU#P00u2t-RB{G9ck^_&O-SXUzpNj5s)hsb&!3K=$bc0QP?wkvgN zSHC&P)Nnuel{-R=$NKE{QvGb3Ah5)cpHDO6{U;DN3`hB1|ML*u(G%* zQ4wkKKR&_O+nqnVT^RjH0HW8Qq>zQj85h%mcc-0KoD>4-D40+O(Cnh`#>jNkF_R*( zy@SL4q*b)VTysNyNy$GdY%Ord1Twv++4uqvfDCd(2rkjH=Au{!hR=P4WRzI zk-&1_w?#p9Iq^9J75?r*qOG&{T7_eHZ+vPvD)V|-dZ~Xw`wj`QroNug@}>9)a$kyj zmwpR}-xg`+&vMTUAVccb!T^*gxB0j{8y_G41t4@$5fKsXWr5e5ffH!HJw=2*xFIsz zisYcsq?3N{K!i4?Iwc)O%+pi{nthkRV;(yvJHES58tMJ@3zWbUHyj%za^)8kbhn(& zg-h(3AR8Mo^w@{XyE5NXj~7>(xYSKo-5U+KoSqMGoT+!s21WE9>6GM=axsaCiN9Ie zq0ru~I%yvzCOvp)Tqsif>I%V-U02lu;$*l=uX9~ExfWvQH6?Zk6mp1QZN*3%`1Fc5 z`S&47$|Dk_U@`2Q58!wB9fE{ycffg{`Ar&NRN`Ach481m<&C(#>B%Ep!=t3b)|9Ch zs$B%dpwFO;2pZ8B(D(>`e*V914aDMKVJ&80kbF1b{va{weg2D#94OYxu|P;43l_6$ zc0KsI?qGiT#|l6pV(IDWje4xzORoE<9tv6rs%XS$K7u0fKq9;2$*`#?Ww*fmHGxNs z=N(L@srB>!Bqa8gnK}|eufLa2cEwX~0y@exuPb&CR8b2yvn%xkW09~(-JC7W7nhYy z2&GUWpq~M|rWOPpctTkk8mDQ@^4@ga5Ylcw9tYK5ZJZN45Uj8+1a z0wpbx5K)1a#95V<)amJ_mM=>t4%erLN>-|ksVnEs28u)*ZtHheH3Ox`Y7~`~!zT;n zq48Uzo1CEJ(<>NI;34S$hU0qB*+aBLU^m9=)-cKIM+FKD-8*$vrwM~!eEDhj+9q9F18@gn~5W!=^fP?5gji*K0N zRoh%xNDVwRi_!d;vxB6zoJ}zVoEWg-;pwjsJKyrnx>Shr@NHs1kg z<#71x7x`-&o7_T*R$omX-?4Ce5Q?HT664as8LroQ&h|Ru&gM>A!!t6>fZKp*8)-DE z$f~5@G&d<)=R-t{g5#tgaEx;9(Vuv_VU!1i^W)WHg6C)d&G{_hZOsQhj+VZucV15b_@ z@SmKct4+YI$o%^|OEy`$4R>s;X7BPkRsUJ3p9Nm3J++V&ON^$O-v!x2&t%Keo4F8~ zr!h176XLh4w^v*z+tbm2BSCgL<4#blR|J4i2tV@TOHxcs%F)Z3jUy4Lf3CNAO z6A`5-8W~ZWaO=y|JwIjTrQkG3E_Wxs(*H=j`S9O&R56xq^ z`Wt4@aDWFm&VT`7pQRdB@b${G_aA%0v%tB!X0Js^on?4uGi1z*}g z_XZR~eR8KO;2Kh75-%(&5>n-GHm*^uvLa&s(^OV0tDNqooybLw11fVg%;({(neXo} zFJJP4GLeBOb!a^9`{$XIp;QPcvDe^RQQW54#PUO;|9ztpAb5lW^ts>?QJqe*hjl%M z*iwf=AI2vnSX^J=l^Yc2m%02d&RhIgvYaoWo!wgjazgWC;ap`-zqfogc6F4MasEt8 z?2l@zFQnK8bO=2r!ZSv2Z+w1Dwe7TxCB+(pzH`T8Uo%<%`#K&cf7xZpS1};Q#ie?8 zf|;``E6)uY+`c9A7rpL7fMyr=ZnP-qpQ}F@XH7Lz?C4AtFc0EvB-5;GqV2|0HA)#8 zU)*fQBT26=Q$#8YS{V+)tTFD8f`7ou{#QS-CW^rbq9Mh+V%#T?i=1f}^N7rwBUThr zsVH=PInBFcezxfD6P~US+zm8za04}ufI|5(gI*fMGE}GYw;xz~!0GTpaPNG!rmJfs zN&(a{YY<^A2Pno$%JuMRT(^)IrYk@_EauM#yB z#sq1MFuys_2mDW%yL%kVHY@(lWS*i46jAQIgqcb!e?7a-@cp2~#osv2ikJwG`MQOa z3giojkO1mEs6KdPqg`=Hi$KDtRK?Ymul2O0P2R=jMch(4n{?>lIKFBWEGKV+ zgbcL*IQklGRbilEXc!49B>ooU1(YZ{0!Uj`NeP*+HCi};P2_*KMzU~NK;h2D4!8u6xUclfn3`^XEh4o-Co6Cer_8>LtX;jl4*1Ex7jAwfQ&q4IUZ-hq z4^U!4JVmfo1)vE*CYld79>r$)a)^Qxf_lc-$Di^3zyU5trdkVmqj?O=sk3UrC%B;8 z*j3Zk#<^MKxuGEEG{^^HfXXIJY?37)x4tRlZ~n zFQ-E9yLOl?>MChuWCYyHkuWuTVv-oMjloecMcUKL3&P5ZbGt`y`+sjWwYTTEWFvk9 zs`~ix6f2oLJyD!}TX*}MprxhtcDLp9DdA&0-)VPuRYvL}YQgYG1&2I>49X+E(PKHV zzw`lTL=lvHGI8}_d&M({Fzcq%k6K8>!`)eF=pJZFgQb!pk$>;!+8pak_wd*_mO#sj6O0yrsm0k*7QTnfq{ z)_3JUJT4$h_Rgh8bqd7Dh$ySCpuUm^q?SF7o$D7cKou4q9bHi7u!*PT9u^IxMF)>R zi%pRj)cU;zp^N38>NlxfFsLAHPHt}d!rLe0;Z$_LUd=cGVCnkqynbH(=WnTF{@H{( z$?ilM3Vq<-fhY2WlJAkak;?TGG^tSQ8o^6ncwmgBj7ab zk&%&iB-Iw{2OnPyyYw>gKQl~(5h?Jqk}@l%8fs{~4FV~pf?_$$7Z1N20aRa{HhQntcbb|*vYF5_06GidrGnxFCZICDMH}j!!0-uSBEAzxrdV))c`8> zFp6G^Wlm3DKRYXn9(coxx3=o)JTh7TF)5PwM%~;Ce4a@_MU}$F$q7|d#F7K`g|17b zME(K|D@@d)$KFNR*|LuQdV#C4F`P?g|Ls!IVG@B8UynjHKk99qHS~X4IpsLBqXHFF z7|B(YRYEH3tmF?BJsA7*`%}gsy^oeuYPYG+MK%BUu=xnK%I`h?65DRlPd~c3uE;KKS6) zI!mOI^!$g_HWUI`vbVQ~YPs&twS*EQ8(RnI`;9?za5<^f%L=Q@1Y!?}9YCQJ8&D8wt1d_L`aOn4`*Cg(fIItz?rJ$=ttcXv>Kh5Xp`5} z_$;ub!@=wf1x~pah&>yt*QzR<$jD>B(~%Sv5i}AwG%(?&08T-dpRnL4C}E}pbv>+V&(E#D z_@DUB1m0dl)F9%3Q7(9GJE~GxXkzV+3!MSW(jwh9`O1rSP&o15s#$>0X})mNYrWCl-J zU~c%E^0$bNZq9fY4E!TTB7ww7gj}{Is|&DV)%AA10k@a(u1k^Tof%S>8YU*eiHR&R z$v;7><>?;=nwlRAImi%DS{mUiGIgnAiW#rzlKPWBn{Q`51Bc!{L{G0t6UfTSTHcr@ z4;aRiq@~*Hd3YQ-*GLejwt(x(m>ubxG0UeSUrL3;YIEcaSczq=7uW!Sfa{z4lYzn| zLOQx*EM@+bjPYa`%uG;F5Sg?1r^W&1J*2HBrpv^DV3EyaQ$O()dj9+-Y990cM@3Ik zPw_}~_Laf(XVe5aTI{k*k$7azrc9|RzJKs3=^06}Esi&Yz%7?ZOrn~8fm`N;>XFwIJwAZz}Rj11?k zxfV=N)8r>gi=6EB95=LGl4WS51vD#xb&2d0RB0=HnbSKft=sKSV(#<%m$sRK_+8|l zmFCrUe7}DE!eu4B6!+zu5eWvPkP7yRR3|iczb^1;72pCJo6{+)efsNJ*Vz@Yb~8t{v;(AJXzqt^SF0be@aGer zo($uHBJ#mXiO_XR0dnlHjx*qwL=ps^xfL5$VP~FovUWy=L`A9b8G-{t`e^DH(LBGK zsdr##j>CrJAm?Ic{$^SC@wu~;(_MhVid~-R+U@6hvAzjS&#~rz^XpW}n(VsD6cj3F z%+SOr<~1nC94Jl9;mZa-ulsFUX^qH%+i~1nw%yV=Ok}{v$FGwG@(gE24#iT=yr$^l zQ`z!{hlhg)2h~jckH+9)|)WVn;B6N!XdF5-ZZf(+H z2S-kq&-|2VL2!ErYmHCS{qR^5p}p?zu;Hv4iK3g{|Hd=RhAa=@i;BD zvbVLelHWDBy_j0br7SL|&0JL#4^*tb1C(VU(VhAPR3DRO76%tsSM$3=zUTD9l6o$F zb@9n?Yf3swzN1z5@L6!26_Ie3%?!T)cyz!~HXFx5c0+^Vl_{wuW7rJZ(SPpuq(L-b zz8Qjga_afB?g=jCT*BpSP=ek^PskLfSn$;U9voe zO=%?u`L_CJQ&__v3iF@CH1TcD27x#f$J+BtOEWyaV_GTY!T2@1YkfFq0|Dmpc1X$_ zaQYcwoQZ_6$+T4J&ebP%<>kH~v)VF8*1zP(J#-ztxXT0VH0_$9m-pkf)oKLkAyh|? zns6VOUTbwf<>%lh@BaSrxvbS%`0v%Yv_h+!ts_U?=3}y1X{(}Bt z!M;RDCB!fK>8DTUZvf87&>EH$6(y1D4>q44x?U2r2KL{U7F8X74qmjrG06hp=M_PW z3MUT_nFP{ChJSziXt!sVM@Cuszp}O)3^maOXa&vT#iq2aw;eRmt-%B(2~0pT^K3>~ zSlG7#&(BgPCgra?^Y`|D3QSopDk39dKC7@~j#Q?R5g=KK-9iH?{12A*eL7XcY-&NW zYKf7dL567s6c+Vp7#nlh6RZc`o*RjF$`h*C5z zfA#UqUeIuUdXAAD0V!x=R|~;s1W;;qIL~ zbLO1$i{t9j{pG}4#>NIe>v9&ybl0pphEpRO^8tEtlO81QxlL+gzB2+jP*h&NR>4>a zdUEDiIy%@U$CWfrH4+i>NLnHg$~#x1tP|)3EwcUS8R|2YEr)+I7Eq(n%>Bv~ zb2=HL3+rAcZIHHl``PXp)m#O_S1W~tkAXYezqYybFAp$9__I{s{M zWWbhYn*1k%^DUf!TxXF*s(xtqTX>AkuZ()oR2OWNv9z1CW^9*1{J zMTK+GG8^L1xadBi3L#j`dS&Kssv1vM2Ar4^&bK<&CXb`kcI&E!*7z^K_Lz=XV}t4| ztIc~YGj@Djx1tIRyc`Js@cu>u^i&Wz$`eMXr*%ia#I|uG*1-=gR@c#qc;8lVn(9Uw zBGDC_Mo1wrJod~Y;{z6%B1Krt_Lj-5C^#}qP$8jT;UcZtHff=5q9OIJ=>WRi|9qO! zM}!NtU3U#ENpt90cJX9I_i|KFP$=4d5fSqt>7v&Kfy_KBiw{G^_gcrnASXUg@mV#{ zP(o~$d=%rV8Nq^%0W^As&JR6yra3nmS6!n!Hu`8RG<8UX{+uxplRY}vPz#*CTUgLf zR^Zr-eiGd?ckelr=K4{TJM~2QB3H`&lauak3ptF&{hvp5*Z=k+m^pyvmbjwit(*CS z#hyh^k4KS__!*xbDd$VtvnR>Ax)K3znoi8H`P&-}L%)MdmGIB3f$Ll1{xslRb;iK? zZPI3ILXoVU!9l0hpot+RPxEP=90ZzvHpD?F$HiX-)aWash>kyQqB~<~V*_gn^~=9> zNw=AfuK%)}F8$b&WC)lW9d+CPw6B~SXwvq&LZ8vlcc*5FbpimZcAomMu(992u_bTgf=p}pq8$<`1Ltr zMcCow;8X2u`bOh&uTe=!!O$jO53{3^^l!Ekw1w;)*MWR1hMGl*!i&Q*Gm!vPCmbo1 zy;X#2ZAfVaw9tWUFQ0|@pe*yFEY*lbk?ma`oebzI93Xn@U@Zt!nB{3sM`o*AKYm_R zT*$>Q#I~8hMeF(5K=LTHr5iN#S<<9H3@7PWYAXc$;P8;I!&Jj>+l;O~U!|OSyHF`n z?HJC%%seR@LkCJ@c|odO8fh;MbL%KC@tDw13_%Ot5dbaNir<_OA=wm~haMfM3j9f9gD;Gtvd z8J+Mpw9|{0uC7{EBy_FEyt%u7aZd55XhEf!^W(?MZBYi-S?@I()Ao<3)Olad4$Mqt zjIUpJ^uKvwemT7dpE7`Brf+n9AAliUx+TL9=_)%GP*W!n5+ZRyO>j17_0JVvIv zk&zJt3k2B<@F|Ww*0e-i?Nnt;ZB#WUD1|yNzR_OyIYM-FQq?o=f!@3Gv`xVx5FJTt zY27z0`?_rHl-#XHB@iv#Y1Wp~-yYw8%u)+NCGB?7t^M!HYw#g1)Tq^wduqRmp9A zAt9A+{`)rlK~SvmzZZ=^>{)b6UosIU;GRtOw{5rg_>6Sy#w-2dj(I^e2&)&!8cW9^ zei$mI{0yPF?NXntgoUss1m{o5hEkV`#>`Z@MkG$YI<)6 z7In)pd&{X-pDV1{$HQmz{eE~P`0O)Kfknva)8yQ^_C;KGL>%Ksd6lxU?3;O5!jw^@ihz!nPrFHl-%6jIrZb@! z|H)Q`WZ{Q2kb!#Elh;Y?f>2!Yv&M-`v=Kjq}UJ^yPciWPy(U^V;V_R`ni z%}u*y^DS`KctwRLr+mp#fU?n0W0;R^8;+}~t$j21!+m{yoj75!SKM8j7~U8f7RDn; zN_rAX%4r?4K{ne}b!b}*u0cxvQffec*5{v;QXIirGtg1&^AlM}hn z{FRE`#U4n|LYTjU0KkwXVwfK&Hz3mZ~AZ%E9g;8Us3@PbPNkEm$O($be~ zXJWX-iKNN8xN z(=QP#HMZ1sCt>_ZS@>EPQlguEZ1ix52<>03`*LcFc<}ty;o4b$ zXiMu_KdIQz>2#EjpNh)KS-;8WHnqSDEx!v?)^{-gSXWmQgYXCZT}l=!LNCKKG!2-U zxR6DBFT1r`R2vL&tE<1!M^XTLl0f`e7Wi_LUjY6mdB%^5wr907j&e56Bh~Q{js9oV5#)LbFc^5eXmw19zu7qJpe|(83aVXhNMKmxhOhpWp0{_sD+EK4R8B zSp7R2O=9~&SWNdM0UlDJZ?EYZnp0T(UAapboO$s~RY#D9F8+!aCoG*fv+`+3d+c7AOj~S#TkPU;9*i$3C50i0 zFTgoP0}S~2A^RxW9cye2P#{1;Cw|EBiZ8VzK~3^r7I#ZR#DzGrp@EF<3d~Zv-_(?lR<)khyWLB3mjuA0Vh$;l_+y9Gs@x_jUorB|Azd4I z75!yoY7&WpVF{q^WFV{Y8x<9st!B>GkTYT}$4U%r2U7I70I9@4mfs3esKztrQ2S{> zYq1`jyoHq%lNU-#45J%nEd3d(EI;tv7?PA1Yw@merG8v;{Z7WfS8UPQ7mw>`V+p_b z821-eaYXzvgVm$iraxWS|JtXz))T?zE6GA~GUVm&-&DwXUScxm=qU_))T{U<3df~F z>0kJV9CCq4a@JI3B*;KlR%R`p&1k7fd;soz5n*KK$}MVJsPK}qoA+n_;%rui{+7rg zdxW@y-?15;9LMJjH*}^<)trh7g3Et9-Jq~nP<;;b?pQmDP+`(#A~E73qohjD{jH%* z{D`XRqXmeJSZr8KQTLwDP~wI?y2q$nW>^m(#(>mh-Zj&5wWX_oKx3Bo>-(U`Rlb-V zMk^~LGnX5KTUd+;z6oG0M%?-@*%%%Ka=n1wk77I?YOBEd{A?QL!uwGB;Wd&OWw7=+ z?BBn#M(*R!mwvZbYqu7jtguIb*rq_iLWz*42(vCWjUz`c7H0DzM+ytsUh3#@a&qH!NAPgXerK~aQ7fAUh3RT)`}keRH{xX2o^v61-T>~FgMhU?$r;wM*sS)|(e zhrZ$R4{`wBlpTA;+tbSSjgEH@vGAXKV2sLd*8BMsmJmN*VwlDY+GNkrcFaMtf|{nP zKjeOPWP~$V%0EOTM9j|7ayiFPxAT1uSy|~fszyc>@t{kFVD>2R_P$kCGw!0> zcUPq7hg9FP$#Z$a;S`qJ`P)n)U56Hj0&lA37V$BG zhE=nRg11g4%KC>nb!}|-GLg|xWL^i%ajNdXLgSDjE4^Y}I-4h%`&G>5=+mgY0=> zSEFd89516fBgxF{?CeGZ1$~c2UYT9Jn!ot|w0RN z3?JFsGf%=b2pvQqi7Du0WtcAml0)V7ZDZV$CZOHZ{A|AEz*Le*c1wgi~vIbnP z6r$kguQjnA>gd4zk+J?)%V!O00qD+XMQ;D}kK780=E#)L1FjZg#6FG$dD$JRUGIDe z96u33-N(Bc-&GHPUm1aMPnP9qxjn(;DN!%ua#f0|Eh`&a5+Pob#n5L75b!SBwv;7N zYxu6DmPhw36GdYzg1$_AxCoW)Fx3)M%T%?xYhvI~2`&IgvF2(a+|GO>pAZMA#)}G7 z-ik*QWr9+JX|0H3g!eAzR8JgG;Opu&AC6NknCIw|B*giZF0^+BgV39;%jBYL#??5U zXWd@mtZ!|}$;e#iHgJTs(`#gH0^&v5nLm{G+T1iIz&RRCcyGIEzoMi}T1_p`m@aby ziqrP`IrTj%a`JCt)DUgZEW_WYav<$^51E4NUaMXQ$hrV0F@o#skca%;&kik?p*cU* zcI$277Aw^^er2WoO{X_u1K+~!)=qplOL7WZx`8vHhJgWQj_oVBh9PZiNCR;%A*dJO zi4Q~N)QPQMS_ZNwZQ_Krr-B_Wz-ip*6>KoK!k4PtrVM47ksRv$I4Hc(Vn7RQI%WU=;(X34gBLiks29>20ThX}8=Pa2*hRE4O4ILrT^ zi1^t;h>ICRWn44vZxdZ=-(S{1f1erxlDNkox^Q9(Z2I1^1ryN7yqSgDV5pDxk;75d zLI84WM}sIOa~J>`pzfP-T)6VAd?61u4$k6g`YoJsH$!zT_tvn?cj+Nni^-MosxxE+ zld{!!NI!NtR_Y!@yUZbm&Wwc z3J}lwgpZSH#5^WxekMjmnbUnvkGma+o|>4D+TnGHwg-*fto|pFtlaCiZAEsPpSV;| z>KYmm-bbtSr2Ng_b%-rKB({df1cMgtyW(Q&MBb127XQ$D(89Tmez+NcuKWrlt0Zgv z=sY)8W%X>=(^1CPw_qJxEQuvz#F}_e1?R4iS~{)Fx{>1#nz&aga^nRn&`=60*Y7-^HlYR*tvI1EPg|{)&*sAjsmze&%%ja9@p?N=i(WM})hGiis_p{Mg1d z)67tP==*1Y`FSQYH22^AbqeYiGdE4hfeyF7qLPl2-|m$+9wLs(Bes{o&U$9>_w=%( z!s>dIdr?BKHv+M~4&pdUKwymHe&TtT+~`L|8!_OUgN~L6f(Lg@_cEWf_vcY zpF4ttu!;#Bg}?mJ+lkq*pBR@@>FA7&nnJ#mlwdVA`S1H+EoVD_ z6Ar%vW_)MFo;JW?yR0YUoaq&|rw+uA&{4Ggd#4Q4F-yP}FP@YxZmzT}M>z1t50IJK zSB%jHIN!)|SE7M#g{X=am3dS`ul4;R?P4=8uSqZ>MVr_0Ph(zOxJYD&GBX2ZC9$G? z=F~1|;b=8W0o5OO)T#w-p4ucqd_I4>rQ7uhrGqy}1XX z44c-IaRGa8o z=;?vfO}Vh;hFe2{gzmpLjrXYp#W}g3L((_4UZnI}^j;a6^bcgUJcs5*cH;X;pVuU!3oyv^3JSx92=oKKc|hv(wSD|F|nYDD}~-Tv%1-ITn3I z;jI)~^}7=&KM5I`5(P^i1DML{#Tfdj4R^Vo22mM+%UaUXVv?mbP1BVNIz>M&FvM?X zkIok7q~6P9DUp}v71{*Zn({B%*Up8Gk9#DlX5{kxTyX*W5>yh2ixuIAA11bH{`Rc9fq2Cb5EIpBUcH?6K-P^IL|qa_l30|7^6`NDKql}-G&tdK!7-S{i1Gg@fE-~3 z)PxsjeyBi~b#8WPJvk~Lv6W}Ur!j0yK&asy5!*m(UL>WWaKyu2w( zV%hSOMP9Q(-tc^O(ujy$B(Tqw-d4@nz0WV&=p@WovJq@StONg6_ZSpOIE~-WaURg1 zq%KNtMZ(hTyABs*Vi)92ukgpll6vGbv>a#aG^X`o9#zHI$<4_JJ`&b8;3XX0c5{jq z6LN>cW9|UvbQz7mjKo?+12+*S?03=DPPd)-+H}`Vbn0Us+SNg9VC%2Uh7N-Cjl)Yn z>%DdShrRUmf^olc&=t_i9RqM^J>O8515O4xIr(#6-}JfcVGc6vz6}Q|ixjKMPdBMb z6s5PRiXbnKJ0hs>>WUKRuLw!*{nCg;&#rJb3^)%P9+?Xx)Dz?tPRfvxy?y) zlcxf52BZ5eLku226-DGYJ(4dER@22g4^)t;t-zV3CYz-D^9fx$a5!z?&Nt+RR{}7#cjWScn8YcRfJ|m_hLGw!1f@q?83FW_NF<$GrHMwj<7p%dYpO zLde4tdP0QFh+Wj*Ct+Bw-7bKY(w{-PJ=a84@YxOB*vFn9LH&Ffhjnv=F8nRgQM#tk zf>u!2?HNl(;P^&3{AXd&*GyfUO@;#>e`LZxKp)GCRxoEt>1QHDfJ;&}FCO?-yx`I2 zpk=4XW-Tl!E?y$_igoRPSJKUMh=nw650(%9ije>%7~R~}vn zUJSnL&O9=4bmaaVc;o#b;)V%fD;tR(x+m)x|l}N)qdWOvx79@9jpU3_W~cG!>|qi*DZ(a<;wZ(3(eP^t3YS z1P3QHfpjm~pH<|Y|K&dgnv@<@T>(qXuy$Y*4s&;pe&5BRn2Op+)b@#5-v?Kb78~Lv z%Nt^U-YKHU&d__gk&%(M{*v>CRa~3J#iYthR)W48d1NEg)69AL{?5*rKE4-Dz%43r zek<@=))hg)Ddruxo0sBz%N-a4(tD-Pc6}csU0=U$-Bq_v1~=2k3IlP=Z^<+x+Hghz z^ux=@+$b4-InbXq)8a=U5Kc!@fh4xEuR_xu>q&+hkDp*LC}`kKiye%T`7|wSh@TI* zo-L&~{!}PQUXTiO!vjPpbsZxncPmrX-QV(hdMU>h5!%1XfD1qIPy};7u(q9p$tD~eJdPDlsEHCZ?_G?uI)Aca><8U&``(;?v$?(9$|)2` zG=E$BiZ}2E9SRl5DXi1CbEcuAlJR}@?BCv8q!;AF=;%}671kjzR(gw9zvb?EdQYp1 zr81;@xgwW3`Nq{iS2r|2-%=d#K=0l(I@+K|8-&avC{Cn>p)bnjD^*Z4#O(okFlpA1 zRUeFXVlfr7^QzVc#oS|8w|aEBc=W@0u0ZNTviH%qe|0*K@5|@kbAOWc#-Gwi^Z@^; zovs-@-PlJ%`45)!J$^|^2hYcekGNX4`CxX6Jxqj{zbAf2C^YhYJq{SZ8T379vUNzN zq#7CNfN0bao1wN>LuIcHMs7RjZ!Su!>!OCqe)9)QhGk&7L^J@UinccElF!tSKq-&i z$+DsJ&K6fu9WQ^$kzsh&%w}L0!Yp01N|A_Q>V*lND0NIoy4pazZI_OT2_A)1aVmCl zZ+PUo{C~UlNih@7n8<GtEp_nt({{3v0{HRMjJYe-OvMD1#hMWl$wt zmO*%}X|GKP9GXRQj2A5GOBh#Wb}VpZDAqe9_t_tIuU(xWmfL?2RdI*THglvTChPC_ z$f)JNFc|E-WA8Mw{DY4p7x6*e!G$C2Tsn*B)!2pzX(W(oVRm+Q^)nR}N7V?A#5vc< z=Yuk&>|UZ}&hq-ijxsYpT7@3AWC3c*ZoE@Gq4yiT(mjxbJr#YNcHo($n5V9%7l!C_ zne{mmavt3zIlD3PH0$5ht-z|7j8l0^Dn?HjEy?t1|7ua{3Nt0}tX=pvO6y?t*Ur)> zS9%tr;GDf4Ah2YIfu@5dK*mS5KR%;+{au@#Ev@qGx{C;r7MeUgJ@M$m*+YZ_;h zp=uR@Y;|;_Rzdmb=+Iz%0S1S;Zo9MfB$l+dyuMUo6rKyuYtP>5;t*Z0?wnqZ%x-tz zTwgk)$XbH-{MTOT*ZAP9avQ!!^syf#y7>8F)7aZjeqV9l{!^pJNNsCdyl`*<%Sn+= zQGKOl6%iiZ!=9Iyhg?i}pYz_0n13Z)Tq8yYvl9jhuB>z!*{KIUH-_c;N*al#Iy(Jm z$4WTy*683yVQx3dBZiN#_(=dPyyfv*5Tt5=r)JGa;T6Wc3moYz{YrYJn|^mX!73gX zho7K)W(xpH(_^NiD2C-XDAu{v-*tA+G8k(5RthU5wlt}e}m~yBZ0a(>eYVok~t*3`B2T; zLC`SfCF0<~dG=!G)i!QBPu38(2b;sp_rYCt%UnZbUUu-Hg^gtedv>AC6d@2tj>UJO z-sWM$+<;$4d@B22?3`nC`HhKou*ooLXYBh_dHj{HWkKt4(4#)99Dz^-*SEM++Xu2Q z!sOLE*Ly!MRbfbi2Z;M9+V(~DZx;hZ8itnhr!T7d^KrP51v$Rcfs#q85kIf2%1mMf zY{%uJ?E$haW(AYhsD0gresw;i1~TZVM3BOv(gA1#ngQ{OCJdXlU{Ad{6th|CFto5B zG3W3mfyX7JGKymBLYM(+pvhvE;U=1(#F~%VaLY7!SS_GJB=qE2%t$=1F}LThRJK!o zb)C+9Cvz!^!C+#Y;Ge5l=Gk6QhxH*VH5K8rk0?egQjTh|_Y}{7cyO>s8kL9BQ2=2t6=x2l#Nx1`!GWUqVFUEwFa( zoJiHJ;xPf8oVqzx;7`DP<|jE4Jr-^*9^v&qkFZB{Jh{=)EN4-uic zR89kttM;P;acyBhCO#GZvo-*zo`xVMJz!v9@Cf5$`1-P@Zx=sY85kaNcxQom_J@a0 z&aML}#EQV&l70hNnsVEeKq|6=S09(vLbiJZ%9+t?9$JZasgsp&lP~#ZF>dYWU5FhW z{qhhVXI0=O&U`}$igd?!FBq|o*kIBsNwZv62$yU@LEl4FBG+yEfIjOv&{oD7bZZ@B zGJ*Gf)AsHmK<42bT?|o{@{FVUjb0IRz~6*~qw|fpLQ=1JE|dw`-p|xjho$`)aIrXE zRzEJ$Ta&YLflRsJhz~Y9fDJP8zA`tLxYvAiSRaA(($)b&KV@*XQh)BqKGz_|TnnpN zRAwd`D=z^hxaK?eZT{ynX1l#&&0$8xPmY!WrbKG1&h!NQ%_k4awGCXw1CA3 zSpuLa!{MPN-NOVKeuur*)`cOdHT70RK$IWd<=n?s@N?^Ang%zH?YIU>veh{&@!aG{ zelq(pT!9}HHFuhkY*t(YdrY~6-dxFNLxsgJ-;O`b0I{&j=Y*0mVYZ$=T{0MiRQ;+| zFK|R5?DDB@vTme8?=ay<0)m2z09b4v#@}M?`&e@1@yB~@2JC1X@T_J_sBf4la{|F> z5Fp)}k9rA#TgpJ@|8FggdYXNfhHQ~`s1++S(IbJg2_B(;-pTKwi;%AHJLfw{l1uuF zkYzvyKs;Fq38v(-64tR44OAl5_kW3Q*&QUg6Gv0g(%#8V0Rpx*dH2jxMOMpLabI|f z6$KxKwh~47y3r>IdM(yFK0^<4WEVioOfTH=@w*Exuzl-J34|Uo6JvGvvShtGJk!I^X9r*yyCr1Ato(eC=HA(o_VV~)6f(ni97^(*MC zZPNoHa@6cv;Ldac*q-Z8!(@JG!~30t_zhsZ&C4n}BpO2f*1Q3tqW)Y5pHE9=0&kzL z1z~h7^LjNo`2A(jy9*i{)VN_xEV)q5kk{XcaWPezp(+VgV{zb}L0MDCeia}3L@mQ# z7x<%_k6DPr99Ymuk^wyRaHF~l9>jRDq;tzFyppJO_xvv)Gh4ATOiKL3C`#%txrj$O zlegmb10WIrnPlhW5^YrCs_)pvf0B0Ny|=MJ*4;f(W@HPnp!_PX>_U2cRzf`8=$0%^ zb~X;A=fZZ{fF_p}xrO*C7HDQ?b1laKz}gFZB{DO{a41z)QG6de*8 zCb!@wiW9x)(y+k2$}3)pOXo%sqr`QN1`H#3_$QNKXEaoYk!P|g6S3FbIa{r1yy@5i#xc-u6=Dd@Kwy2oHKu zuZrCBou2|E?PFX%uECeg_c;eC5!(8dM})srN&$y!0yG;cM`nmYf_`vvvE}$pj2P0d zU%$G48OiungCzF-i*VdF65&*74QNVkwlt9mNSyrRyTsq;SKyjt|F}AQrv8!=cGtX3 zd?(1q_YO2rmjIGebGN3)wyx|+e187A+9Zhg$W>TElCM0!QN4FWUuI3R@J4Qe^UXQg zmx6*=JXRKk+uPq$-e^{!I*_~=iM@*y7Nu|h7R}3v)7E-XG!?KSnDgGSk2D;_DC7@A zZK^6}g)ej(dIlneSU!HRnX0r9-fKMK;o<3MX}1{-ER)WD{7dqZIx)G@l7A%@q$3C4 zTCH*5u|w^Y2y?dDZu|A2t*mo-#&-t?AFBcF4m3nX50Wx#SXgL>beS$T^=_vCQo~^} z#+<0l{;+(4#khX16_sbh3zZFhKZX%S znXh(m!+KnFq2_HJxSb$zL?V$PbH8yuj?D+H(+D>(SIO6pzD-+2`{-P6`0M%8g?J}k ziBh{v$c->@C6&Wj<5^#hBFYtTS*B^wN9YM7>hve6nj|j~ll2*;D~IIIn0A03+&Pe+ zE_XB=98*KTh5IRA8XEMrrI9ilt_S)Y!H)i0q#)m(0()ZxWUPa#9GlA}#gLMc>WTtG zm|QFNlT;YLuE@X4L@)8r3d{)<{0RZN67~?+yFhujB%K;eTT>@bTO{dgM#5Fd zYr^AOxe9%BuvNzPFY7}h57nTQBp+_0B^eiR;q1y!V*gCPKG_`mkNz1F!jPfV7#%?4 z;ON*rThCdy*L=ARzJQ>vy|h9B3Y^b{BL$njpJkEePk=Cs5s@g0gNUb{Xdxycc?hN{ z4X<}5T7E~VN!`!7`dctOA=JaL-Tj3-9s>hocy!e3TNRT=Ga#Nqimaj8>n>Dc0g6za zn=c1tOBYB1V$&2WF~HkxG2IwtvUc2CC<=?9scLU;?=cU`y54S4H~!^f2eU*?Gy(Lu zk+C#b!UYNOVJWNYWlYN*N{%N8DJlk8@egl~)R>i-`R0c;H3I7!8c&Sw%ks4vkwa)HD3M0nW@TvK`^-8u##DGgS)zew1Wa9ieeGY-?Wa zhn-H+5E2lqP?S~o5~qa{D9Ai4eLL`T`8R+6?RAUPPe43bUw?g_Q;WJaS&s~<`sG7c z*7Wb?9pS7vJDZ+uxo4VF7HVMJQejk4&nW82I<2IkeFefENa7^jJWmJG&fnjhqfB;o z?iN;Ae82Vf{|^Ml!9WH0?pu^IRK>kXAm97dV*!-}jqT(^c{rR2aLTjjGsi*w`qKwN zg!LYXoB&GYwfs`o)YHBkdrMK=$0k8QK=Wsyk!n;K5+f!DiF4v0rQ$y-#Ecam zQU(U?(cp|qh3xJcA9#wtNE{GN7Rpvhh`0$d=@W(}Fq!F<1~e?; zc3wGy(7Fh|JfV;8rPW^WgelLyW3wfmpW zS%Iu5K~Pi_oq{UZuM-qfHM6wK5#%ZT5pi*E*bY8Y-`?!aOPzh>i<2Mtl!?F%yMKLs zf9V8>PH0-d8t&jmusUwo%03fhTc1eL=Lq!@=gR42wDpZ+v+OeZc=(Yy8&Svl*r*t9 z^}tJe>@Po=-ywgM#9_~#Qx`=+q>)c?@jzNG^2Wc*R0E9H0{MUhQ0gVk(G#dl_w+nA z;A;B;N#pc|T4+Fx-s?eX14XdHg1ow^XDzPrRK^06c}*U?z^A4H~TI)m>wG! zw{3%?G1qh#jBk1M2zXCL19O@CDJB6Q=H3vjG|l3|t2Xwsi*YMLc`pJk;-9~K4RZvQ z-->_=YW5<-YQEWj5$F?R9-+G+GUyhYl&R7WLx$G6tA->aPqv1hzj{^h34h@C-I8vU z$Hd&PJ6nppn*w_GV-usIqa#vKHrqvwEtA~FFx|tm#!y?&RYJ+iw-ND%K;a^EP-1dT zxV%iiJwMMC!$|rw143qIYb$nf`RE|2eD-}bl@PcMnLNT|wed@5-b40$kTyI4vmxs| zAc?P%XS>K@RdiZLWcK&vansF7@2dwW^Jt7djLKx?S0$iG2dv1eglT>m|>x5np}8KUb$JNR>F?noIdFT{X;0AV3n5Q5Xyr z7w5}iMqQZZg9vjskcl?%%DFuOA0h^{f)NqbBSYm;4h=ArhT%)QyBzUaoi!@>9y9UL zR0K;|C*X$e7peJ653qp*9rrU~57|ZIYd=53ZAI({2%z?n0{XS`1t8+X>Q9}8MCzQaylo~0S<2@P$7VU zuaUW?lALJy?6pC?Ohj4Us|J9fzk?fT{Sx%3KxYq!g;=Si4{L)z^L;=*<*+G4MqqtORxMZtNk4}Q%4^%3^aoHi?t{YQ z4QTQ%_4)&j_tvta9I`t@F|Pw+d40kE?M=H$$AJS5h-9+BuAo?om#YE@oa ztJWuM-V8($bg#bKb%OY{2bfO;5sf!D_YU?-6*)GKf?*I~jiu^bUH|<%#(!Md`R4ne z32Bs=bU=?4N1$u}yqB5SEWFc{P*u~0qf05DwNZzk*D(!3ne~?{ z5VO7i`l@!3D65WgZmtQ~DOI@ZwP|l8L{(JqQVS1<*p}5(s!7z`vlQfkR7!h#rX)JQ zTgd~mtF&UIsmR3QpFgy0%O3>*bFuk2kK3$2+5SK05)s#zFw^p;Cau{L3u+TTF@FyK z0Z>YmmEDI#h)B}@JYUNS1DC|wWTW>pFcj?-&;~u*k%+M5_iwTuqXcQc;*?<_>qpI) zsP#F0{Yd5P;_2|HU)l)ddX+PGkU1poW6joq(;kC|CvUc}@427k)zw-{N0_9WNLkB` z&)tk)z~^gw&EqIVR?qMYFyEI>f$aw^&voMsZ8(Ji`SG6_}mz8R|aMwD@h z^txB-f(Z^c8(GZ=D#t6rJ2C6QLI~bcs?`lU<?E|VA~YPN=*4UtUceepl_msz+mmJ?72AEYX|%UM8ob6CB`iv zuv|F3JSy(W2Xjqvo?&2wg83JOSBEL5W?*d7-K!0@wmzlCT_*ZBsz|%X;M-F;UsT*W zJp3ims|Sp2#sc%CQoV4nvBPthBDtIYBh=X2e+A#26i16$taDh32v~br+u2FGx?%z5 zW(1L{FhRj*A9f)99Juiax2!Q7^xyJemCY@cf~pAAxRDPUgUeGv^Nk1{cU}kJPDnce zAud!R`;%hcKmZmy8c=!M36&&Iidxz|n_aO2fc4pzmO%Aw{ogDH^+xC(07xLV+Ff5K zY@hKbt|F(ZrE0sDVE5aZ(VvQuN~^+%QOPmC-q zR@(j|9n8%ieEs@$eRGpo052>Qqw_>9D|U5L1Sp;l@GDA7u|Y)+aOLMRGC76UhMGSq zD`2{c1*l|u9(7`PBKOBChIj$uUTVYOcsA%DZ>ddMK6%}R&CBooRj7^Q^%goB8l08S zk5iKdK*f|FrS!q(PviL#`LP~o=AX6U1q3~!yQ0%b@7Z$CK_X3&_X`9f;Qnt2BH<%5 z>72VaZFt7-W*jbQK}+dv?8zC?_b=tYtdth5+Pj}$WunVIFt7eto}Kvnp^lHD70uj7l(=BKG%Dq8RSc7q>o6aj!G9`P$0c!Je_Gw&sIb9awK-wFu{F=Yv+Ai@He z0e?}89Jq`@hUm1BN7n)F(vUE^8=8a&s2QmL5DeF{o_}$LR)x?%^}e$K!`g;fEH z$%6$K8(TgyGCVw=MbCBq2PI-Lq(xBH0te3b&=c5IfSJ&tR8&;5_sIP-jPE?mykp!% zCDIy#(&O~O=$u(bbI=FdKx3cxgt;S318-U-e75fy3wI}4fL zBk4xc;C3g9!Pi8iV?AsoyQGp*=oV+ces z<%H725m*S2tlMmT{+Bhhs~VdPFt6V|3=qhrz7Fj(y(McuL*34DXqI9e+ua4uh-N=v zU0|i7lUZDhK-UL)BSzX-7SOkwiJB&H+&dodadU%SsN7_@{vs&{I2y=WDDH;8-bv2^ z?*~kdQ28zHecJtdLmNKVZYU|9q_{j+@7yx~>@7pnX;Y-rQUuFu&|B~t@>K=G@$b7- zjFkqyzTaKzN8X!O!*dHtM2>8o1RMz=V5 za$wQc2{6Tx=^u0w5_5pYN+w6z)g{aFih@{;5F6I zi?IIw*3mJ6Pu1P*>)i!aQrtW}oHexLvbVVzPfS2Sppv3<@{a~LtT0m&bRZQ?$n#ij z#=#}dV=D~^Imdm%BBiWp@~psIOCCx|qoFgFsI24=h78Er_i3_hd^m_65J;f=^(B)r z3@QQW|vAk3c#TF|4c)5f1!G1j;&k-b679}gUcMrVGG2)BcZiX!em!j<>_rlr}I z*=)|8Blp>zHkJ&?b$D`SvA|oXie`QmwlNQQ0;K%mhYH!lpdpomr=J8gf_JU|yQ@AL z$tvN}_2R2!*6!XO9UUz#ty6uJomCYZ7Y87f#-{tR^vcFZruMY1mqL5gIc z_pqRCj)^u_?n)WdPyatO%$cgM#uuknTtGtqc*I(pkt})y18{c2m_EoJ=_@Sc7x5ggfr*w&2aNwU z{8{7V!$*n6chso~RA^3og9y?>?~kH0_<-piy--B_TOrZVd>eJ*n(^fWZPlyh?g2{a zdWIpOE`piI0)4O&MFBDy$ADGp_pi8w**_I#4Pc*zTW=npWRvv5t|dU*JUBRDz2A6w zujsC~cV|zX&?_tpy?$%`Nq5;v7*?AO=b4ZT%hp2HJ4f_8PTn3XPSx|0F{-PvJIcW@nr` zyxr1x07#+VXNLD+G+_SObVtATj;O8+k18zu3Kb6p++{tz0{I_A1aUPW z-WOImuI49G10t$AE90sRSIU8wcX66c5+V7>o4chNg&y~lvm|JAEMFTnc%1Ca)Rs%( zKkgy__wAVKLja1WN|ynY@NWTeJ6v`dY-V?8seO^mH?Z0J@JQT~Sc{+@+f%?O7nFH3 zwN){|?Q@JU;yq9ZbmD@ExFKzAFEnIEwoWK%xs&er1Hjk2*L<3m0tkSBmnfJro&&6n zn)tZNR0}|~$M8K>Ow|Q@m3Vzi zTBYlJSpih~}^3ZSMf2y_iAj>=uo_$0PGf z1ZrQv2ZU6Pml-)q>%8$A{Zs7~Qw^LC3T?`g_Zp5_`=7QLuy%aUoh;RYkPu zM2;J_NQs~Utw2#Qil^5u)T%j+IYwNsVQ$yw`V@#^Gc8SqN#Jh^tRN7qow)|QN4V7Z zgDg?%+7AaKU*&ef8D(^2q8E9AeNboI+V}5*Y`kE_Dms^)M?Q8UE+X*rnyEn+BrWkASH{#jy_6XaHB}C1%Np?8fK>syP9B)6#?c@N*^it=t-Ci=ni7> z{ZU2nZU2SmgU>UNjP^8dH51D5WNQxyzi zYXYKg9A8dy0GYq{RU1TmoJtH)Ud$ff3pMuL5%@23jQ}UPeh(H=YTWnI^v-{$mYpeR z)pST4Y*@6wVIoz})dqv$IpE*x>;gGRZIjfsmI|RNW;DQ(9Sd|h?fx`UNM;>8g4eii z0&NWAt7|_qcVbtp>7AMS#rNSoPcD3h`$B=jhYS#xK>szkds#r-m^tC?-60~lJ4Ap$ znn;5vF0KX|u1BXkGZVEyS5fwwht+J7!9|#Q`xwNrU?3X^59J7c-ny?psI;mG%)P#2 zgkZvrG~&n{8!HSlkWV2H*A>Or21(#@090Ubh}nIbx(E?z`OzPw4>CvJF^FP=59NkH zZ?|%Vs)Qg5BeiwD-oppT=^qPA9Jn$yC!%{a~_UChH8p+51*hQMoRx=oE7}VJdkIGS1*L)w$Dak z69j21Zt-|YWPA~@PRlPR_H6k#ZQB6A<)|02>pSkmgQXMlFz8GZ=%i?N6}>H#{niNU z)8|(ZP5OD(Bm6Um9@ehWajeIP!I>Exz^%emd8$>=kC`%q6V`vvB#y4xRO+e|&ia)- zWM=vMi6yar^sGQFf z6*j1e&LDc%xOW3bzW`O_0ra<4=F~bMF85bFXf**B-09j6`wcP^{))TcRBs%3?Jk_z z#j@?1GL%B7mff4nPrgm@Ty5qawmV+9$yRyx=NIo~yYOkTr~>d}ha%$m3 zD*_~ig(Wa=d!}M4Ti8-u%r80)!rLKHPpa|;xk6EGAc5SV@IuoA};t`YoE z+g2Yi=S!Yb4iC3X03EHRK_O3Mb@jl${>c$#UPt24(g?ZesoNJXO({jP{`n9>-2}Hr|zlxZpS2GnJ1nzwfr) zd~Fy(joV-Ry4rXg8~V)=N@W#;WGyT$mqsB;2aKAZZ$JH-sU=lHH$0|Lcwq4ICG%U> zU2uiEu2o_Z5X4acvi#^q^`waPLvXRg#NdL?!$ZId^%93GRM2Ckg7Hn2AVkkZJI;(B z!+YL=@yU$HJILr@ z%Mv1xO%86@{+UI^`e5-%(X8zq9RpF;rzO2TG`=9OI=}N|^AcBWZ`d_=8?I3@7mwl` za_mZ8GX_=;+I$wC^7&wf>SVo5y4RxQm+DGvrE#wAVt3nbPA7!I8ROdzDwI@QGv)nG z-H(-hqh=jafl2pL-!mz8UQq}{`un3G;cUyXU068okm~kK?V}2P>8t65Mr%hkHMN$; z^>Ex+u%a;W&jF}q4I%`R+>WT|xlRRIYr;&eW1y?KdB-u9|M%w(hSdHZ4O1)e;qu87 z#=a`Q-z8{BIWMMlYMO!zfUOwbIKz>Q!um83QM{3S~U^WQmc1laqje)%@c zWdKr;N?2fEpqiOkQ=%vWv8109I9Ka9zgtmJ0c0^c^h`Yr%~_E6h>Pg|rf+zI3fBr0 zNinZ^ti4K;nLaolyWW0p@>;|jT8LgVChJb$;2cqZz%6mp==HE)$?5RCU@;MEJiByy za-`g^%6d@KE?`wh#tck(FrE2s5ByK=B%Jh|f)Gd_Gx1ly;ev9ZM;I8u-jCL+scRw~ z@e`n+IN&?;rG-i$OvSSci}jy89R_^7AGQ-^*993ah$2k5vfG zpY1bsp>D4#tg4P2=f;cU{#z;EwRX~$q z5#XC}dZuI7}%=o6JW(KU?NUd!v&)RwXkEE*%tE%g^ z@)FYBT~gBBNQb0!ceiv)H%Lf_G}0YX(jZ*|(jeX4aM$_nZ+z1NyC<{V>`9A#N& z?mphj(+F(0TK?s`z0WQ&T3q@#)zHQ^(>shntlx2W*6MLSb$M$1_lbaa|Ls~|;i4+L z5FS30JU%{N1W}DJxSQOTpPqF4X|Bx~`mhcD z$l!&$e`k`BJBvd#;h!N*^Jn%%sq7s3Wz_*h^ z_BSs1eKx6fO4OD27~`8vZpT%fEXl>j`|=_Zx1GdicQc>_}@R7}34rTo3m7aVS7vGFHAsd#Z(!fE#A&q&j z4VUTmZ?C%h40W~iZ@;CB7U_?p$ zRmR?budW{Inwe-mhV0&9+#7Zc^dr80%}IHgJx(Ww7efX_yN!8D#f3qITyi6c;R2Z8 zyMJ@>PM1nmgNdoaVa4-?no*N7CR02 zj{gaMpd}Pnu`Nx|hi8E$sf+Gg<8$BGHn}5B)}jX8jAx_WQH< zf?^3WLWjbSgw6V&sWjR%T_wLYa5#8hD1kGy)~#xI|} zd1d?@dg1)76hBvwio#vEa7sq2GwXm36Gk-R%e@z<>`A&Apb=n#fjo8iqMhtt4La&= z|5{^8OLEZ!nfH01GiUFQS1MsGho0pIW><}p%KKihon9izzMgYfy%6eQpD>-Z7)AvKk4Vmk2J-ko$d{Bj4zQKN3hfm#MZ|~FHj66ra00pxP>)s{I4TFWVj|n=pI;XC zx%wkP!VGn4p%OaP2bDq=Nr}XfI<><2L$tRwz@PjMDorAW1y`psr9|k_SC|5o4e~?! z!pWF7_s55eulKI_DY*7Fi<~WmUY^4P{^>;lXQpfd=ZyV#o-)`GpMeSy5lJKxR;1sZYX z#KOX^0K!;b>Mw)Afgg0Ju%QFr#DAg|O(2J-^oM**jjEVJ0ouXBR#oHo4M+rR%4eMORLZCNvR8}f5Zi^xJlgO2 z4_9tqfjL6HCimxLBlP%{E61muKoQC=>if9OA4b31|4E)lK>xIwq6FUUsYv+$I|Z

    ;?74mJa)(q<%G& zam06n9!z7F*bsuqKLaahuW%0!W@ctZela%v{qgKE63@M#k9BhLX0~6atU`vZf`+X^ zrp!V#u(p#G|HC7^hJ(K1Ux_#rXOkW=;l3O(0+^a1p1z;oV^w`#ptfN((!}aHK6BUM zJi(7>oan@|PqW1AP(IwJa=#UgjfFw|5C>2fXCIqv z$|J0F0mZgko~LVJcg>m#Q?aHtJfXcro7*V}HoJ}aI{sT-K{Y&Y=$WcxG zStjP40nvdLTN5U488rnqV)wpl@#7>ohkV0e#WM!P>+`)nvvhVx!l>U#%~;WRCtie1 zJ{(CxeSZkb`=g>RKFjCuB5V!BNjj^rjnb&fvn8xJ0@ZRYuV})ev-L~@7dLo)3w=d29p?Zye}E;)4P4?&a(7|RZ??CR=Ek_*#Tg;){`vQI69odw@MN*;hi!`=_f zqd=LDfeFRBHN+=2fE_#cQN!ezc7N@NCsV$Zu6mu)#7!ONh}&n`T5FVqJtGFlPk$LU zlV~!(%NVnG$=Dgq2!*}eH3ix|fAgO@99V=sEsS;IzR}Gk4dj0obNj@d#-XRD7Xcsz zkg+uu7Qk1Q;uwv0X@}B-?WVEXhgpq!1`kWt6Ge0ep}O{VU4sxCYBg zHWBv?y1@HED3`M*f01e&NM=Ni@7-8Op{mfR|4R2oZC=Usn*V&D%Rqjg4X)=;Qhtw^ zd?`VEt?59IL;X8q^&!$+$L3y}S~K&?U)_7x-fHR^7p47t^%mztb87LABWNj?6Wm1U z{+<_W*7b`q7{S5e&A{6as!pms0aV{%u<4+}S2V?;HGHZJ!| z;wC0@UF=YtVt7!H?`j7h-tfpsZv(w5>+7Vrih)K7yD{4y8YpXX3;W#bMtSArXDg+s zHh?t>rb#rYQyO}oT3j7_ev~1uz|TK!z{80zwzgmtkV38*#Yi_AYz7DFlem~SE?lJs zQv6`AM-${`<#~av%e%&iq?^UTF)Y^njeRSd!6*-rkNa#3e^pcr;t;lIzms>7{}_Vr z5S^eRspDdpI=zKp@W&)1%g)h%?iY<%ji&n|1#MJ9?gX*R@dDB@+lD`J_yv7!*ad>E zzUTdjzBk%7UA^GVwW40GrIDqcxLS4?#OIti7~g=JdI?lrdTF9TGGCULf73|8USC%d zm6we`Q_)s1GKP5w&L5i zm2uUE#YeW5s^Vd@o|yfasnylE>^2XO_7I6wrBww8o96SpFSLxgCD{)5TCM)heN9HW zF@XCI5x{gf#6X9-XFv)ahV8G>3z4p&R0av_r;AIZvwd1hXvDdAs1O)J>WCJ=W1uW3 zwUJS7-hJ*G8C8+hY-R>E3tpje#Evug1l{cyzdt(h>WO7I${Vs`-E7WER8cIqY#qLP zuWGVn(sV``*)Q2I)+Z6G5!^0V{QDikiB&2#&kCc2d(7OB1?Rhk?zw82Ggjot?t%=L1Bn z>3tGlujPf6!adA%Y`S{=GJ?st`%nHfa2)+ng*(0RbB)f^%%rK9k0T=^bIae(QWNiw z{lb^O_DiTTk=%r_XJWuvzi0Hz%atu8#P-iHblTOgL< z+e>8B7V0X`+B7=xW@&XfWTX3(l|4Y^e(i*TVZ($32RT*MnNRAHpYMgl!4B&YYx;E3 zO-xO%%$PPf<~O^sJO+aUv6(7rYRRs%Egf`Z9G|jI+O7M&^KQ}#*o%J>h6Wu%WsL2_ zNT^eTX_4$59|;MGR=qnDaqu72N~z#|)e^*Vm$`;=m56LL*4sPrq$UiE3`3w{`@dj| z@5f6V7ehSn&|J{ujsz^EV71jmZ0(LPPd;Kvw1e{1j1U%`thfV|&u*aZ%^yQWa{0XM zz{6!p0e;;tFn{i?mMpv*7j__Z4V#_gL%jQMp-E#F!M`hwx5*oMl%{t7XCh;-87E?6 zI--=0<^mbK(N?j-TV9{h)w>Kr3R4%?>z>_n#M*Zm+JmE8`$xl*Ygt7w5EjGlZ$D%= zXh9xUPwN_ZYI5ZWuD7oXv|4C zqam%5NNq67quQnq?%U!3nEnR7`?gj|fs3ZR;PbZ)-|~1P+mQQnBG9`^q)Ui7`G#|Ic+o|_c5XDnihxB zoB<*(XfD|wkxK>-Q)7F30`1VeWG5TPXt%bDXF`iZ?0$hEy9D;gY8ERzpReZuzQJIo z_rLg+Nui));q6x0|Pr6-oHt$!2twGb(EIvW?*7k~+`8YYVCz9;!J(srIHU%|PBFB_sK@JO2 zp|`L_!>RVe6BE+<`p}Z};C~2l<|QVu9>_0axVX4D0~QD03kr~=OfNEn^S)*z?i9l$ zz=K*+Ta+%OSz^g|H@i8th(ioxBSYIR4|C%K2oe7nfL=We*nw&NlFUdGjo_jrWA9-Z zwloD)$Au(KD5)0zdZ+&~sr_D7hnYm9*jGWo;q)&EHjU2|PHuDg%+_{EB#@$%PHdov zr?`sLvQ8#3L|h3sX|sAx&T}JlcShsCFi>h|8vEO#?Yt1+3pwV@s1QRX_&fiTsgwZA;~(8D%G*s^dOl&jl+lAqb`4Hraqvu zH^DWY6j3E1?#Cu8RFFx4OUh@UH5?_44Bi6qXp3G|43{ZAGxNZ_Vf8?ny5adNZQEc$ znbthWUOKb*2quO9Uef8=81{~iT+0}6qv}d{_LR_I+Pxs_5}+lV{>d>x+zD(4qTnFC z?mwV&Iq;`)Nkxy*;zU6jbXtW`k&N?&%2!EWpU1Q?DJE?CDP~Hf{bGE+e8ESCo0_Mk zOKjkEODLqIBh!qu4xf$Z4H66M9FJ2FEftuel#N=lI76$XPilN~ktYp$Kxmmrs`Zu0Xl-33sLJihj`tH>^$Y z6@!yOmxZK51=e^mc^BMoxgRE=J)CmIRa8`T`a5KjO*}k2{>I6o!z5Ufdagr}rqhiK z^PtgJF?Q$CMq0~bpoRVyLL{Yxs9F{z=cMMKCRvU`5J?Q+LZRwZdZ0Ol(f3~!s19fsjFv6uZvx7vSprzxTsmS!w?2$h_k}7Aw zAd~_h8DXE9N!C+)XdPbc4dgzD=9h}m$m}>;H-4ti{FTb6JxY7widS!m1hiaus_!Kr zC5zX7QECm?uLr)R@cXU-|MmwF2{hZ2W9jis!pH7A;;5E1XL zn@9vg$mS1kHZPk~Hmh>iLc(7?McgaaXrAzg>((=+k!npFbpUtv{Hzy(GWK;#YHH%G z#f(UJST=Xx2N>7GQ;Rv8rjkF&-^4>ElwN4 zCDi&>oP-e2D*}=j+=2AD$dgXrNn5wsuZB6bE#K$Z#=49AWc{^4Et|0H{NIIU!y4xYpNx$B3($VsvsI{?1-n1;Dlo|Jzj^ zj5`*C)Nu*NKdpt&hw(j!HP5?7t$tox?)#xO#bQggYRe*BK4!uG6|91>@R#_10 zU<#&&UT=YM<{5&}$`2E}b3lqB_=ZXj0HF}z1xFB#>lXs7AsVrE1GZ%T;Vgv2Fc}>6 z-_y}4bT(o1Y$}MG7NF|}pWi==QGTdL09A3T%g*<@{2-4WGrXJE)_TiJH`n=-6>FlA zoH2pcn!7Wy(~%4{E0snGdu{*$3qTCIkZPqN&knZS%&FNEjM>w{H3|wvS_?B^DJGDo zE9|7~Ll=b)0ypjubOkIw{?pNB&(%mV_Y@=rTT-~dQz+=~)gYSguQXHOaGCRG3nY%h zBwztU)P*}IbYAL6M%$;DFAvb9v`S$QLmSFj^s@Ls1gRVIYyr4J@~wXsE+mhfdHqG(~`^ zIFQzZ_BB!RNX|E?-p#uKF3JGkf)A2;3n~i6&O4KLW##WfCB{j-r#DKol$p%zBH0i3 zyu^+h-5M^Z@$!LXCp<%xQ`;h(PqxqD0lT~Jjo-^tWl_s<2@hy?%h|b62iVs5*sO_; zo(2K5TweYbP4GR* zN*E@zDt`%eYVV3}LzgOTOT#I>Pc)&x0^%Qwlto7T9`w-J97cP!*xeLhj+@NXYl0Kh=qem=!vWh~QxUYCDRC zw^C8xmZX5Dh7W|K*>@-?V~&7d{eB?hcbmh_mFuOf(8`!Lx+3(|y|3VL2BgnCn-qT? zIG8hp$ZbcQxeQ^{v%1^Fey#0CBD$5H=n8N1f6+XW7v(^0dg0{ercCyI7yqmrB%1S^ zOJ}j(gC+iCf`+?NYeGQGQLmPnY7kHT;}j^HffnuU%B=^*4Jg;^5US@#U?o+|wWP!h z3`oIvo6Dg2k4Y`Hy^{J|Wo&HaDLfGMgNNjhOfSWd1ZA0R*wyrzyI;^~-)oddnN{*7 z2peK7-hL&I2!0#h8|ZV|fhV;UxZ)-KyVf$7dQ?NOfu~{frTny~O{skt_NUs$P0Q5m zETix7xo3Mp-M%JhR0uQc3MhUXJrMhO9!i|4p)!v>RZuVj_PRK-zPshaLLQ774-lLW7KST-Io=p_+50)f>GdSzwBmt@)1-5~1S{^nWS5NBx`Bd};Oo=n-PMdz zXbhM*Q6|;6)c^x0(^xHhi~4kFna-z+kx3hKipEEE97is0cRM`x4?*b2kUUdR<|&`d z6fBC?yc7(66qbd;K(g0N zViQ*MNfYz(>tWm3T=@G>{uLW%olK>@m1R8kT?@BZhof6h%2+uaWAGT<3_lG@RuQ`iA#(xu7C zr=MS;FeMNnFqt>Dq84z>tOa!z#`cKB(AXqd=LQOW_TnT65J;B zz#p%|NFtm!kYbDq+MpH}x43WqRMOlsoL@!KRJw6R(ZGgvyT0B#IKj14gRPFxVpcL)vW4<}< z*`AxNYv?AHyux1gY&q@QBG#uvL@f5l_U#3=LlJJ(gCp~)cJVcYZI)q`P|@N?-aN6#k;R1OcS1)?vjPuw2*jg*B?@$tL%{@STIBkREdHHrh3V ziXoZJ+@M1eBnmqr{K)w9Vl*l<+}&B`{e@@bSyGey`~Qv?q-azE@Tz!Xp>)28%_Oy; z{IjmQx^eT87j+*PAwW`c3~qoWlA*5dQfb5}xO%ty2M2#oPxCi7{a#OjZW;h0k%L9w zYU5(TI_(W3c|P~4op;Y5o$mn5(WeNzWF&IM=l1)=3hgM3i``Ej?>g?FiXW}%^YX~W zbQ#sGYdN*dxl5g^LDHWX88R4Y@=SaUa$td#IG+1y-0F4v_Zp+Ft~UOe`E5uNVg=|7 zFv8UPHKJxFEZ_kAp8=eKjD*+O|FNg3nt;3AAgHTDi;iPqAb4C}adC0hzKtw;-(FE?6|fbLehVMPv+P85a6ky; zHJI%>`M1M=93HiwP0gQob0Dc&7;<(Sp#w!fD{K2eN*f_%D39Dsr0B(I*o=;G0CGW) zg=9WZ7LlH`?t6G1yy!a3O)&S&%5u^3DRR13Ed8E2^2?c(G|cfl`9VkbUhXgIBQXd& zlXG*iL=G*&2c|&Q@b-izrvmopj4}_eUf4bQ9s- zU-11Dq*U~12*fm^g(0Ijgya!0K5V(diBoykQwD=OaYiQvU;SSA2E2L;$CuXUg z!mh0=V7ce6fB&+Z1pXHuG9@~03TGYhgoXQb`}IzyR-46fXP4zzPAo^43oaNB#{d%R zyEQkwZ=YP37il-nRO2yCY*~@W{760;JdnR@QjMM8-P-@H6C38SffGph$xFvM;PxYv z86U^vu>Q)*LW4O{JdNzTd4qe^*_g`BwYhWC^0U~j_?`_H%bvMiDRGyFAR%u7?;4L0 zhf%&4R;z|hrPjsWp>c{P-$piTptRLv$8BG>M|q$hW2jQI%5eSboz8rLBKUd*u%Weol?Lbh(4vT z7={r!wnK628t83J$z1q%T6XO|7_M<)e_8{5Z7Yj8G%dWSS=HnlQEC}FY+tRE>r^y1 zviQ&VPEv$IVzsX@P0jO>fal`OHf6+W#_26yJ@4{1kuP3Sa#)%OxX@Q!Kcx z$Uel{!O{caa9{E|>h98+?)>>)8`ck*l%iITP4 zeD5fr+8*S;9aUv>{Bs5EkgLT3*VVRZGRxDr-m1CQk5@ilc~3#9RKcbbXrnW6OpT@AK76__9?cupG8hik?GUw36^KB=g;9W#$Yj zRn3-y?$AJ@YTI*t(ixwmVF7)usEZ4Sp>7&l>M)JjXvyrMn-t~<4`I_Qb&X%oMd zpd&paOvc~tgr^kv4iI%qC;pX6FE1|_;JE6(-hsKczj&KUEvgcpJNoFcsQ`{XSW-q~ z{<%lFO8ib$B?_KJMzJI*Ix3im0=(R3R?DA*TcYJ7{nbK&Z-Rn8X)an@d{9}xd2F@! zApfN#nU2N$`Om|lp~K&5(Sg=A5wz;g8wQBmTnvdW6XV={16gk9e)t5oi7oj@!)NqU zk^3g6wscB-h@D{`0<6Lr1l3wqi*xXY=aty<$#)= z*D$Qg{AZsWoIz4HG#5+7-jfcLy%V=WUp*3q<2^fv!3xuzqJM(DR$Ru?U0Zyvk^~a|Rw5~zmHF5`sn0Y95FdeS;ZNkxR+||3| z*(Gaj!ro@#mO~t)5!8INAb7U#xD-DZ$*7j&yw^DUjN#tKbaJgGP>Or~;$QxtE-pU8 z6%_svojwqh*d@TuRiTbiUvSos(E7Eyz6^Da#rD@07a_pv3aTeUqgh_)J@PqPdvToE zfl;SVHo>u)6uQJy%aeZtU$&rII^Q3v$Vpl39jn{>X8`ee9efx4ATe>G-*z_Ci+1X< zbWWS|s{pG~;J^E#IWzLAfZzmmJs%@GXey-857T37V+ z!1}$|YS&lHO0=4Fye`W{2%ew|y<$_rK+wwj2YXf+;$6boxVK?{*@k zds8g?ckBhcurk%A+e;$nRkPd|D0=KQXVr{vce3~FaIv6%cm9{_|9}7loCN6Jzu#)U z#|cffqN}JH2-=Dh_cAw^<1t<&-ZftHi4UKswKJHr=EQE5L4V5!kVhsark+3DW=6Ia z09=nhFz9%&O-{xhY+N12*DFI(o_(znEh{tFa%$l&G@FE>fS|-#KyrC*(XQz}F@!$& zG>NSRw||o9?sjD&%PBaAMZU7q9wJ=BPFggCTWrJ%-@G(-NN-U#4weIIogaLy+<9Ai z-!ovcsVoTYm@78VkB~S7EAp6xKV~=Mnd}deojzucg)TKY_5zW?P!RrJ)baB3i$6tF z!Y|FwZtgFUZZ!UQY-a+4i9Vn22ne6ia)wGZfiTuaA|%oWfjTWt)1ud>fz0Dn)Q9r zZgMMZGCf~qYWu4BHJnYgk0+9z@qN#4$@d`(?3rUgJLKQk;ds{>WzO{Sj_XaT$~dC9@4PC(#;5C>aGpMkwk;aEJB(V7YApc!{PVzOD2^a z3MvKm{p&+m*v|V;+)kj}uN;sV2mZqXX4(%^>r0D$g38EduhH`3y?HbHlT%X&K)PmJumaD7ilRlQu$ zvNfU)et*^)r8!zw&7Iytg>^9#Bt`q_^V5rg?NPUU4iN(nM-s5*cj>2&9xEd^T5221 z8Y^Qx>{oR)2Mdm7TH_9``IpZ!4bOJoQ-%7)(UQ9G#z;YP|2dJ_zq8eJ90*BIQr0qH zoOKY@#`yV{f2x7wUMK44IyE_Ez0ff?5P`$;Vz1AR;yax$$Kdwuv! zrlYT^g2a8i+0_2kC~d#n{4-Q0x4o3Jv&ynDV_j3tV(Y27lIfo zq?QUF+5T(Zyi0;2gLT_w`FiHetupxehDs$$NT|b!*ZchWG(cnvgxu&ThvrO{3=pLW zNRUL)pJBu(8u*FZsp=E+BKovy_$nt(ckz-8$UKhOQfDHGs=EBU!rqhUXHOpVxe;3E z`SwmEXp&cDb_{M0bX9fW#f=*nbBCKeBu5G|)Rr2(!nZ`#VPgMVsxkG@AK)%n;Gf!c zcX6KDaJ@jG=bBx+W>1Glz3~nTBnOf=U1LtP3O6gKZoHnq7juMsYD%h50aNFRZ9gn_ zSE=iT&q6*st%0fOL@85{^wL71Hv>g?{l+si#+miVZ~3YpZWPQp(<)3djwMQSIB`et z{1aWx_O7(+o#umI2O>*yGR`maHjLK9Qzr&lbYkJWqqL|aR1{22sn%phT(LlReGROd z&;IB-t^)&ysEdobmR&gnOwQl~+OXN0!qPIg#Mvv3aOiGqlx*@4@p6`gq<`D#MAWh` zxzCR3Xr%=aPy)h`^Xq8?EO`2X{j2y%mbrJHiB+Qx={^+cH|yamC-7N|myV^Pdnq_S zNvBX-QAb7#>$sD2k`p_pA&)NZOhs*+OxAh=afq|kw$l?2T}>slsE<*hMU^?Ot2}J4 z$y6Z=Vs{}gk(s1oD}RJ~>`=mG#q zMnZx5aYJWkV9mr%#`}OMaZ9p=DL#TI#0%$XHl!N+d4mQISA<5Az>exR?qdkx3#(1V zY(HVf=IjGvSKPutE1p4!$cq2lqx;CBc(f3|=7tTgSi^9l@-ul%sLQ1f*y`K)`LyWk zQ&B$-z9^wf>_Fti9UUD9GHWD2FYcT3cm%XLF>GW5oI^y9($h1)Mc^t&9~g zv+HL2d0AW-^pisDI$X7WYqF$5jH}`WPUo0vFI-hTa3F^!1CfFQVi{UQI0@L z55z$9(Flgx=GL9vdR|{X-8!5rzkMFtA(cc#z`{b3Lpl#1eEF~P7iSS#jzI)kjyB!s zs!;_l$GFg?8fhp#+HtnN=Y6H56R$o!QIbqyO`4EXB@#U%p3n56lLhtOHUHDeMKoK$ z31IS2;j5jU&9H3sD)r62BaSMV;LVxG#zA;IdU0PgoT_W)%iFbX(0ST<5ZTbR^rOw& zJ$JYyM7i4FQxq^Vr6xqoG!>%|u9jqu`ZBicn}pD>@t%(thD{EPyCiIFZU00>+QnrH zda=J;=Dx0jnP;dFeNvgc<;nAn4;;yl#16+nDhGPB11p2hYGq; zN6U?W0R=9tQ3pS*UWiSVlTvYaq7e_5{pI zWBDG+s2xzBx~rMRwnNx@j_eIpqw!AtbkaJylfPkarLPe=OVH31;1F z_2uW}Zvc>bt?TtI5YS=GgidFz`q>qI32!5P;Ko0i#U07RWo=`xG<=6@As2-RsUl3K z?`o|DXdVSG?Y*=*99-m%93Q=rPzB7PVl0waGmGZTt!%9%M{*YQhZ=R596EPTwVXz4 zofo;SIEQ%f?<^vR?oo^r*w_cPdx+>L)D>FpaeUf)mkgn2&cOr-WAK`XqK?Tb5}LQWcIrKrD@6e z3W2t-p(KGCJ0!HPI}`HdUwW}UP{&4t?`{s%| zdD9NDgsY^tJ1$H~W&P}NOAc$+niF4D`PX=y^G&*Cp8H73^9kCIJSfKv*^5trpg1(mmn0LijcfU*3ivg>qm|R?@SUUA@=M`br z`ZUmy>3txfw>C8=$QVoF_b}>kE_vby^>e&8k1&#wC?w=`7jeOpeXfa%Jvhj4HD|}6 zyc-c)#*I4n%-Y=O+FGFBT5BW{aA%xTqlOo~3linLxw)8K_naJI_o%5aDkv2#5KWjG zl9Y6e!CL;3fA;rlwb1!LC=<#amr{6|iEIWn`6GwJo=mh3%F)#i`H_)zQqa08^cN!x zUkyJ6w&$BLlgGhC&;4e>QCH`MslRPw!AH(_pOLE2ZA2{Zy!(%6zG^sw?moeYm5|N! zhFCt64{OG9yf0)}RoOtBezcSDO8oqW;-B-ip^v_@FRA~huMCR(?ojQ*B94D3GeYA# z;|Qe3cTi#^y8QzVMP3QpxJk93FZQq$V?N58U1srpqzo~W-Q21@aCHg`?e{ctG4NAD zW3cB=qw5VOufyHh;^gE!YgDS9w~S50N2E_<&4WY2WA5Xa5R9Fk-VEvM%lnjlzIIvJ zm6#^;k3D_WjvAf;)XhD`#H&s#N z!)@BcBu)S7kcIj-h3Ogp<7xm{XMSS0B`&wZ{+7J{&oMiUDqaAUV|V;xK$(t==;ZO2 z%>&WNmFTZa-x6g8b`5>-SURo)o!Vy5awA_m?&b2hi9G&nos2jxo;C&LQwrW(lne56 z61sQfNYh%p4^)nD%y`(>?uB;!POY;RBd!*sMV8kN z!QD~4IX;hr{4$Y$9kq+7Giwx~7;9mLt(8?)CgjNe9U}b}LY@friz*V$_wf>`&kvRu zW})-3F>+>2=Tyzc3+tQlnCzK&9~MlNHS~Zcd^Qe>4kars6W}duf2LqzVJU}E3IeVe z7+BYJF=7P?($E$h4^A9uS_x5DC5n=!D+Wi4tuAZ!`Jb{UIws6sDY|>{=!6X(j;M3SV)MW8l^1!Sj!EZ6g56eU)u|xJd`uVTvOeI<@*YUPyWv|4 zoiY=9&JjAZke&5~iPeb4QoM(&YTwb(b2~m|do3;Slyi}a+WW|E)`6g73v~s%&6=zx zZrUU|ZRI6VK!|zyoWp02`In!+wnW%{CP`w?%0|3DgdsT=Xa0H-#KpMNDwL($75Cm_ z52MXw`l;Mh$%M$>yaZ}tDFaNJI4cV7kv3mptvb4&S>zG^Y_(NY%!hpvA+Y^mtg``D zMFy$j1;f}(Hy!&Z#ltj6AF|j=;lKprb=Q@j2Z5AbwD8-}O%yz(q8@YVlEsLCd}5*a zi%&VH8HNKNu{EZGT7yny=}H3*O*w*Pwll7`kGCqv8TF)1qafE83CSRQf>k3{2ezsF zne*}D)=vw$d?P=3CHlRPaMz!C)ibdp6PsTN0qojYru}#iObGP~Bk^#&ZXhv7FdUv)G-&g;d3uuR$ODaC!Vfd6X zcH9eA=UBJDiaU*?`47!#G&`&!SMzjWMB6C{Js;IO&#c_8_o;Rb+luWVCTgHn_M`f# zn0K|{N9w6zDqULcLWfUe2b#YJ8qw#7LE@K{Bk#kl_Xwj(ybY`v7` zrYol0XQkSH%4C#%J@zJ}!ckFIZ-Itdh#9E(Eev`j6iF3NXkdhs>ITwA<29gwoF5t* z#^Sv1{9tY_IjUy4V`$^GUzul)`zZl$7jRY=YgofY;l-Yx8=X?HzMiG)umrV zt0%6$!c&$fa1vTwTrS279&9Z*mi;nXM|Ee$Qc~#8&3zR=TF7a)x($AP4B)-EGEHj2 z$}@Mw0zK21EDtR`GgJTm8XwWx!}#JNfh><0C;>c=y5FAdd}Jvu3LHt^pK-o+n|D!h z;mo_b?pd3Q`Cb5R6Lh+DqwnLqQu+FUm99#>dDZHdTl`wz%s0vD`bIoj;>)qpczSL^ z7hw|KRsK2~@;61zJVmj-U1se4+Z!dT77>| zm&iHq!0fDqUlyY*9Vh zikOM(Myq~FVD%Xt7AkZi1s5x`0yjI3Cz}w(Gf4F6!8BFY^ZrN4`NH#UiMc#jXI#GG zF+pG`JIGyKSf~}6*`k2Q03*&ALLkkY@)0wR@IW}bu&4nyhszEaA)14& zmNY9)F@dNZkTs_^&XM1n(RY(GgJn|JhUVCz&dSL++gBGV`Ttb2Ju241-UfIm^-RnV zA>Tn1@7i_^zc_Ev!V^t=Sn!a*Q>3?C!$N5rV(*H3%SD`xfm~u)_fhbAEgu6J?tD+= zbnv5+2$u^dnRZ$?EKMbc!}sDArdC9yCl?*xg0 z(@qF5pixo%FQN_Cbu9yE4@?(`RXC$4v8W^@{(EKJ&#GfAC}|@Cr5Q=WbF^a%^7a-( z65*CnPU|zu}!qboHR{j&9t>JR1_leOBw;EPyxbz~J{m zIK^d>Wfv3X`HuShXgruBV9Jo<+lkr93sd1~G!AIK{S^hfh_#yLm4OD_$UXu8I*1i& zP7xo4VN42ZCqxcp7`;yYJeN-z0DUZCn&wb8=8^6~Ki7uT(;h5 zh*X(5R0`G;qYZsUss=UU2!eC_>IFhl3PAXrxXSXnYdEQd364D`iD3S#}#-(1v~ z_e1fOa~E4bHsEJGe-LuO(dN4IYXscG;zdgTR$}S;udDs$R&a&SVBv1j#~gITjl!aN zTq=cUmPPYcH+}|3F4H0Xk{Cax6Qz(U8{dTG%gN}F;Ni|q25v(m!wLPCi>i4lPl&t_ zpQ>8*N$fxX#qir6+a}Pd5%#g)MPE(h?mfFVGutSU&NXnx9ibCXHW_Z z&S@!Wf*gf6F2dkSTEID~`!co9h4Gfey-jG%h*gj5(3v8{6AKFy2VrwPucigRc{w0J zK5w{q{*tcDwMUWDFAp8>fif0GubW&i@Qu>^B~0+si;PW)REqS`_j)g-$Z4p?!Uk+4 zLm#d@y6hj}Bte$}ms=QdR#po>7gv?>Ab%5GJ8#j*|HA2dCUL}McN;)nh2kSEH`U)2jEfs5F_}5WTt3t!~GKQnpbV-Br&pfTGUbbSm2+(ZoynKe1!$gag zO1yit059<|Ww>E6;+NGQn|n#DxI1}?WD-o-umQW^&Xy=?me0n{${u@c>e~ytYawAf zfBwbcgv~D_hqC&0j}{*NBSJKuMO zLFa^HFC;nPRMS)GA(BD7ye%(r0?HiLCbNTS4SyTBso+Dz+M7~)Pj}Ng0FYvYTRvco=Ubn$3yqvJyDg&`&W5bhT#pU3s?~W;XVY zC69|^ok<2w8aGn{mcv1VA$;Pj-7A*Qj8H3}j*M+SmJp$&uJB1O`8%6-9!pt}9joYd zTOQo&l8Wcwe+XJv=b!0R{4FCV>zWB53t+Br&k^?6nZJ#vb;3H<@@Ha8GoO_&7nBvk zDW~#}{K+y0gG65ltfarb2xAsH6;cwJHYoYu7>8fbNqQJQp?E=diV7~gyAaXL?peA| z`HB6g-m58~YlF?OzS3V7^AMBz{9`>(SUQ|Qm~ucW84j)IJs`{MpD+NYOVh5p+C$K0oi+iw#u5;G|tv;EPZ_ z6w7e_9-EsS?sZJla{C$L4}Ii!sNhbDB+XfO$*NCC8A!#&TVP+h=gOa~p1d^^FD$pO z1zCkS`zCRWrlX<;i+HnkrK*126c(1U%fbC2NQPp6?3gkFn_|RfQHJ5V^pWP}j-j<4 z%K)r{-P|a)Urk4Yc_x|BQj@)G$=@PEb@h$g$AsM6_}_B1u~_hwy2gs9t5sE{*7Pgw-Cr4o_?HVu9ntW$t%#4z09^Jr?xKj#|3!oxch~%*G4<@@_Y$1WCjPAJO04sj zM02atBTV*HoKyd>q;UbazWhv44qpyj`ej!-1BnUKQPRwji(ZwgAARU?7qJ>2Z_<*K z1|E)=JjE%%l~x44qyT$ui7%Y9X=O=_t#KwmhC6{s`oE$9S&sh(Vu^Z36e4Ql?NLw^ z0x(Qs$m_mN%?%{-MkMrw4=(gbiH@==vnV(=?#1>2zXJ&$d zg_&_QwWt{f3A5&ChKoiv^EOHLBE4(;#2^)xWUk`>(R9vneZK$OAF^#*pKLC3dDU9B zZ7$nfHkR#LwrhFqom(xN_qp%yasSodUGM8U&lis4d2o2gI*b{1N?^`M%F7uG`vW;V zB>7S)>d_H5DUBQ6KR(Wt^X7*_t4ay+p$)MtHg8)HGVzk(|*dxX+DqOQh3fV$oMT?8mFvL`Y~ zp0})St!ndqQQ@2;Q}f93U$=!tE`#CNDiD?wb@x{|m*>cuy*^~)=o-ukdaatwd`+lD zqp|c^!<+FG^A%G)|F)=OsD5&J^f@cl8i-q9j*>n&ryr|DkBt4L*ZKU1v0u2Qpadap z)y0~@4%>CWo)Lu2^RH>$Y=el%%>#;P)` zUF=;tb{RZ1-GD!T7#5g#;l1SbCbsdo2(a*C3gzO7!?Eo4Fv@B12plN^5JHWFW+E#r zam&a?t0UDMj!Iqz-teaG62mV?<7dHuI{L03Up3r5Nl&h{V+jT~&-pZYNDsi5mC%k! z)nXu=+r5Tz@*Glx&jL_9VGodB=)I6fWh4y!1jl$H__ zX4>KYd*!fHF~d~?Htag^;uEcd(%;zR*R5RCnoaW4$-Obp^+oaWCKkM4!IhBQTL;Wg z65H}(Ofw^_xj!xxXp~N^GX^r{y#F4cXBTBPTPhtG3-#n^Sq9}ehzI9`3yw%bnNwS# zb*s9&J{G^NfBX0A$!d55{M1_+3>s4Q_vU`5I#AfqYuxsV z3<7x##qWpxZ%r&PbQ-8-rOGYuRB2ah$%v87$>LKFL__se?oPQ=4yOq|$F81}7&>xn zn($k6UqX=wmXy$d<%{`|WNJ;1jW9D4lLRZ?K%Acoy4%Tm%-9%0K>3uFG%Fte+OAVu z2p&~9QwWr#kvgcUb?IeQKk~=XkF#%%YBwHGPNX}+#q#ZG0ojb%^Sj8}GB5~N3IH}( z9|&#uY#=S#2lHs=>;!GEaxrLNn*~5+#lirUQV>q%Rh25x4HuPk{v+#Li|gHEUkqAk zK|>cYsDoTb9{nED#@XB=?<_S^Id#r>Z)(+8_iOJdBePQbxy~;rKZ-dSkl-MD4@z;j z45P{65kwI`1UmgH=Ed=ZXa~Vk9(!Y#cMNx{^`dh+f(ae(Q(58JB*(Obk~^x~>9TM^ z9i1rjF4w0rJpGiJOA{G7E>speIml{3KSV9LRh|L#N04nvQiIvPmfEX+)H%4(JaAwE`wRSGr*;zK{9l z0`aqs^Q8UxsPsq;&ZEdC@tU*u-#mW{KY}#~6w{KUBOn}kIh2IgF z*9}%1Ez{Xe89;_~=5_gi%`ty=?CDq?=2u`o@0OQFD-2+Eznc6VewQql{+=YbJY|G!+r^kyZFtiXT?i0qIOihv7i`=H+8mt=+_XG%L$M*EV3MB9ab>W_TAp1@y zLS%}a(t5J@DSxWAr@_o}EL(<`=sq4RAv=L8GY>QVTDMU14h zHz7&;tsXdM(-^db+?Zm8?y+?4=5zauB8aiqwlDK}L+EdwI2NruuXY_=yafg2fJz1e zuukh~XZJoj3KP)Ff?Rg%y#G9Xcl#ow5|);1%j%R2`4XSbos5mg)r>09CESuWzQc+R zL`<52B(L7AlkJ;Q;kB9N<>)5srQcy9f}|iy1f<>_x$mRJ)|+g*@IK5pRsCEjV#knZ zKZ6cB2uIJhSUgl+Rqv~y>%6pMismO~ICjIzm=vU7Tg}Q(FlFYo;v!(Skf1F4-Y-QD zBc5MItf*P@grV>Evf|f5?0zGAwn;3E_fZ%^0fv4(|(7wIt{E-@>EVdEuK6Hsn^ znLabSD;&x@pIazuv=tx&ptJUp4KiAR0<#tc!g<(D~Z(P>3r^X3&RbLA$?5(Y9We+5vv;lMc)Ngv#jVb24()Fl__ zlGG?T7!mmqMIx{ToWCPNcgYl;W5Z;O<7Af365yg1jfb}?oqJF-H)8)I1s4ba6QBO^b~g*9{~ar7A(fsg^z zCxDKh>i^Z{TK4@rmIe>HPmY@3uerJAe+-Bbrvsa;5l*wM90Q9{pYZ8ShH;b z2GqzXm$uqg3Li0BR=m5>UZCO$b}6C?cfnNs#OvE#7FSoq%k`7E7$O@i)__kfEAf6U zM#@5LwlFl*Io_B{W4Y6>zxy@r8#@Z_rpF4Lbejl&49WHdjbWlM%!Ial-}I6UhCPC+ z5qojt&8~&mR)S?{u%z|P%U(h{9*ihv>NPpkT!0VHc`>R!tOZypJdE>BPvd?}vs`OGEIf z!ioL?jP}9%X!?yr+{B$(WHVIc`OphMBpC5T{CpIdYTp~y^q$^2tJJYbtzX2GR-!ZWTq4bLg5V-sjJ}Jq@9i+Gr6@LlkKKdGU&y zjI*`hqL<>*SkE*{$D?WN)vJ@UmvwjfNQn_8D?@~Se96d)w}sP=M1YKI7cmeI0~h7# z<=f}_dVGK1`p_=2wK**uw-QEzb6qF!)BdA}&(sI|g~u*&iTVd4iQ`J`x_8!^)OxTO zI_m0oL)Oo~gzkQ_NsC8NEZ&$Wq*TAaRCiz=Ms4W~D zk!tHt(}>Xp{muW%6NuI=`U;FHPrDUU!)*7&2c#vkj5fdAJb%3M7H}NHT7S%ycIYQ| zFQ_aq8X4w1DGOU7?&6y_=oCfmlygzBaiB7&EKvoB4J|QaJOwJ%x~gLQ{ajD8R)c{V ziHb*tK&_A2I*!S808@k_AQFBD1Jhixqr8IdhQjIhbaERnybl+*}}_ zEMzVFQlZ$TUmnGfr+-r;g5Xr4;P$yl`ryN+V$ifQ<>!ueJv4-8$;f`9V3DFrZzbh zB0l9MS^e_hKV_`DP1PLgYI-=fe>D9plUh9`L~y&l|1`y+(fuH|@cigasqNdH4v9Lg z(Uxr4Y<)#ZR!8k}=+-C~*PZehODR*KVphgaL^I)iUl$%m z8RqFe=Q?n)V(6nV{Wajg`&62mnz}?~9p9gTuA{s&LL#b+G;cjj+;lL~ zoX!8mC%B(nUGsMDX{E1BT8{yekL- zEFj!<U0ordtxob##Q8O|u;A1YjO@f)ABY%9w1SBe#!)~g z@1LHp`{`4_?dB_*{_BILCAGqz#ac)pJ}SV`hM|&{$juNb(qN2xQ_YS(DZ@$d^&neu zg$SaCfMYODtNluzl>iw4J}7HQ&^so%500Qj0WmVC0A^b79M$I@mdCg+OIG}kadq>X z?aPt^E&Ut^j|T1h58aB=Mw;Khw>f#uGNe%1eOs`?P?o5R@;@n;#4cyn&zq;#$?p7K z0@LHYQ*$?3;};WHpyynA_+vKs5e*4?7Gf9Gu0%&9l{PG1V8j`)vP~lBf23@X zKam>baERsqm`vmvfsCLr(>a;Mk-;T;(4j0cnv*R?sR~jp`4Y-?I}o&uA5UejxF6@Ndhe=)GUM;rb>T_ZOy- z@oCblCbwMByw}y`zb(&zuUG!|Ao|>p8rAx!+84SWL73alW@L&i}&Zj`&2bzu>#9_4Dvt;u@|J zU&u>lIL>R`04?)pb@&Be?et(ZCmP!4UKv1 z7yD;!U`h2=*GMfT(`I_Q-rF-?qq0lxPr$w)Am+__J2J}VPmBh(jS zkJ8OkzY7AIT!H^iy7PG!q2!RU%jy=A%F<`7DerfknpT6mns~EpzCNEIC$Q0Hm|xP@ zs8z5%PH?c<4%w6`jHPe=9t}n>*<$is?ZbPNBo$#wC2DNq-u~U~3r{S9gVKSlukE+} zb-K<`C(}qp94u^x9nCKBJh5FAQ@7nZ%I^>wuA8*0j`tWL4(SiNpFc+cLF({7x`m2{ zhLfD|>P{S{S3!CCwRs}<*#Ccr293Ja(1HWT$!UHJ^615$Hz@Y6wg{(`7^8C%AY&oC zt?9af@nmAwav-VHV2pV0)FIRGQjf^a!MzL~ri<^dC?du7T2Db0#QK9z-;-8L}VP&Uk{e)|vfpz8E zjxQWl;_dugs!pL)TKL5?#*Zkr5iSAEgHZHZV zD9f$@*Y~6fUXk1Nd)Chr2Zw(Gg^cE@qLz*ZFKYaaf9x;xlhH9i2QbK?-hf38y=IM) zB`I%~%iPAsKj3RU-;Tv*gCApx+``YFTOft5Pw4guE+piB=IA;x)HL_034>5x z0wO_=S{6=iJ0QyT5|NH0DQ2B0D2SFf9>o_O_a)USZsx`h8+A9s@nr}$@)FMO^5NVbt?GQ7p}(%RxCmXgo-yi6S<+J?Y;bP2{}tRL zd`EV3vdXu^oiZyH8@6s`WRWr^iW~OSOBR?v6MqSD;{Apo5Vp3uIx{~n9tAS2R5k7~ zW?42C%2W!^CODL~V+HKQ6=N-bz{Q!s!@L(UBF!v{apGkU(MRW7`Ea$I%{zmCtz7Pn zyuyK-9n;Xms~_oi4K|)C%E}+a*6U66hyF1IXA_7doH`5&HxbA6Dv`Or|KShliu)1o+{&l78X0TYlZ{yXurpU<1_!50NM%OV$ zWa0zMLYneyip1bRH$w|QF)k)w7G3RSP&Tbu3{8HBRB@hIiY3+`XQd!T)9@p%<4*fp z(ytr#9}9+a3zg|uUH6y-@0K@J)HHc^+?+09aCyV554kjiHF;WGc|V5^Z|C<#0gC{q zlHq;>(LN0lcZ)VCA?>>F8L#vJO-U`eLyz9plmSJ0$U!uL(t2!s91%)XhMzBkZ`!Hv zRld6o%eW*)sd)tx4kn0>nYqOE=BT;@=O3UIFr`hsXQd=83~+5))?&oNP*m_Z!#J|; zf_lpa->V}G)+$ICe;U0WmVxqHv)$~SHGOn7k znpHMvES!z6G`~*^F(f{ntW2|9hK#MKl?){;=_B4J2CPFDmlvuVe$1g=MX9zr{%Yrx z?AI_`@7e9Y3I#2+1+!M?#f0_*7e~V%1#M^cG5#~+P&e9jjrsH@x<3IE@Bw(8cHkt5 z4_zX5#iyv!C)G812mtJRFs<7Kxhr>TD-jFJ@KCZ`;n%m2{!yIPypaShh=W$5))%$d z!{lMRr_rT&O+gRn#rz-4HXyc4J>3+%{Qn@Ez(m7VU-`67`f;ET40-TDl3BgK2+{rT zC_^R`^XuOhd>F8q!OcxgTOfX_qzF=6JUB8wF3|gi``ctP%SVJ|&-<03xZjOh#*qxgP+eo`GmeSnCgTtXuR#vCmz^UQ$9+9)`nfbipI^zXoe`2sgE;2z3zo{` za#vNvZ9qna!zu^ZvAceUySxA=(oejFpsn&DE$?)>@v;}>G4yzNFiw5CoS z6n7@_?rwS6!4n^ZRZjIMZx|)V|Ndn;(^joWH>P{OQo#})e22@f&A`0)pW&vstsu#0 z`7a8St``?b&7$*GQ9%m$Y1P!Y>Ul6jj`5K%OC59k(w^5@R}zy&w_B~EuKV#sAf5A& z)92}&wye6E%gfWp4qQ6D zoME;Rpk{W@^ZNfvwJag#M%M_fpb)CjA!%1Bj?8OU&EyT~#Le}8vq{2Sw!8~nYyiqw3u&5*hi<=_=n`V$)@vH8EmDTru z29R;)4k!THKETA@^-{qF+NP_QSQ4Sgn;W;49#Ta!%yA%!h$eBGb%J^b>cw=jf4)fT z`Oyb3VSQq@wp`1W>@#f`NKj`FQ7kBJN{?=T`=)#Rd43*0yeZsYklxU&SV(xIVp|=? z(5rwEN*-$I6pEWUEuG1NCB{k=%7aJcIGedOic8BEZN-If?e#r22acu*+W3;DkSUhc zLg`1yd!Y`8MXp{Kd zj`3FZClu3+vG-qUZ&|I>i6bJSaCC!%U{Moi|TFTjCU0TT1^2OZ#>_wLL{r7yppF4-s{N zf*Flt15R{xvVPqf@?r&9!<7ji$cRE+-za@P=gT=_Z!p|WS1c}Yo+3pUB+g^{@KwcD zs=FHPC7v`VPvFnXuRK`Y9F%3B4Y*KoWd?O+dL#Xwez?L#Pb|F{!lbFJNaWLM$r;jI zp4?vsKc@X(VcUt}s#N(Zqp$;%>Avq*f36_bh?7O3{R|9p1cZd6j4Fk*%IXPOhHmo* zvxSZaGom_fE5*w_uRk0jBWz4;n^ulr@k@dndGV23Uij)u>g%5XfaFQ3{;!Vfnk%pM zIiJd{=lN^S;4n*1?s2|ifbK#Zi4a26VBmi4E6bF?si3wkVpxBDZeGL7|h(cIf4(X&YCpBbF1l#rJ z4-)IF6^rYXDpI^peycD+Vc*BY9CjXEQ1Z8G`|ZUWF5v_N4*HDz)e+pP2`zd>t7c{> zf|uhAMo{%fU^}KGKO9`XxHP$MDY?JEG*2xLuG&4mpgP=h$;0~oDwsv8`280iW)_or zQNmLZC7S*AWGk8oQ20S~i0EyDp<@rvL|bfMGwy%wc(5o$L}qLWSz4e)Q&ufWj@yG;yT>E4%2-Ds1pE~BQYAR?*V~E2oZES zK!bO5!uj0?VO3|q-XIb2%j(3ImyP@yDawoa-r~8h_I~fNW`H*rLv+Ez^p|b{<-bvb%h}9!VO3|Y@ zj~n0HWGE1qzexvntHNh)l5$*&`zu%>g3C=btQ7fgH4T(_ojxJly)0`ZWiu~bqQ2_a z)0fS-voqZuap}uC(c8?Hv!^m63h$bTP%m2f%6F`9bKH|D-*@V<0Qio@tV)$e()*zG zd9(;HcYY5`XR6LWFaReQMiGW7`s-yX3th>sdKczHda{jxGmAi4^rn`AhN{WAQ~ zd5#IH=ey%~xtW>r&>sN^I{+S&=67YoRKW~XTU2DY2LrqD5TNG*SPJu#S65D70biEM zfm0g{SNuxR4DUq6`Ek0DUwgpF=%l2mA-VAL@1W%C{KgU_ci|`T9h_`!Vr_D|#}FRc z)P032Wiq7-YEhLF<2e~hGz7_OMU&t@h@pr+?`S?6)CGpwwjzb$Ox_?W=7sAZTpmCkdjqy72n@wuJ{ z#zECi60~K%qO@&|@>7Wv{rPo+l!8+bB(*R4%CQhy3l*e}hGPmZeb-825=p%$8Xa5z z_I6lOY?8ix7Xe$yWNfJMt()S_o3C$VB}CO{cjjKt#UPUe$e$cyciZ|$6|w@}z$?ze zNh2VhpKAG)Q5q9Jq8R&5KdZnY$ax#g?(`D6^pg_s4x6#p9zEgX`oH}M8(UC#c!@BB zNuxAm|MCRq@^FAi*w&v8+afYWXWXh$yhT2p6+LittvaBlq=cI7{hdiho+2^=Fg*dh zmUdS`q0rn2O0;;1&=2UVF{cH3Atw0$<~{^bgHCB=WQTHq`PYM|?d#K*s$Dp=(@Ho+POx2xN7gaiHBF0P92V~ZPAAZDvKSVZmzn%CRz*M&jHAN1( zWevGvQSNjN;50(s4&V#77kJQ>$Sa#zU?Gfs#%^|(bcx-% zlgjw;V!p3Z%}u(P>VBdw)) zVt9>;<naZV-3Rj?#nAXwjgsv*yB46pJ_8~?X{)Ns1$a&?4CoqKMOUgfxAnx@8v zS+SVGRX{=UsT$v{Bb(a{>73OA|m1VG^glZ!MQGF*-j{RQq_=I4^%9YQora!-VM7d_b z789qVDA2^WAet>lQjeF6RJMqsL2XK{D`TjLarXbH-DO&c5GhAJv91Uy!Uu>EQ05T{ zxJBZZ_euEc!mUrgJ6##>kYF&@an6w-5K&Js> z?fy(grcz_Ryco`CRHXFft$0tTe$r6<6HY@{-$0oyNs}D-p`e5(^xT>~)A1LeTK$>$ zR(o@mS6s(dedCPa?D$CP|Mg*XdxWrVT`NRRjdRgU7YxL!lJ0Vvz1 zBD!gG#RR3bmzz?umk5dzJFzk0gQNzG+4MDob!^|pm)Z?tU9Dh4Wj@x^kGp&MO0trh8+*Q{mPETkG*$h4frW3DIPlsul-=%p)dt& z^O8hwL?Ls9)MMWwP^1((2^on#R;J{oOaxyWL6f#8)ry-HO?2O1R6mh&?&g|bf&S}{ zX(k=)WD{hlAz~I*R=tguYUfw;(*{p>=inqa(6>vl>EFMceFW{RxS=8Wbj=8Ua?o%b zD!;55=I<>$zV^`f+-xy`1SLZJ_wOC(%tLNyZSYS(c=w3PElafJ zcvA6aD`H@L^CeQ;@|ofc>?K1$K#0%P|LT4EjDON~yI-pnedSLR5rOWvzPvoaDC8_9 zxKb+NAca(1T->l=WjcqAOf&T@`pe0q+uXBkQ`ra*u}OiT!++4UA0fDU;f2z1i9Gt; zRSJ=;??+E>llF}O)gvNmg)YY_aofS%e8HhxRouxaQ=N)|0R=PHnUI#p4a3z?a zO^|>f@B?}8$FFPuHrB;GGzmi| z;77cWW@oR#0>duReP4BzSrb8sSC>itU$Gq)e0E6%38JMKttDaN_o1n_%u3faE z?%-V;kZ_FUuv(x45+NPWT?`CNdHJYv8Pk#}M=S)(y?mnBb%>@!Y&1GTk;R|^o9rwS z+hyl`-PIH!mG!B~vSd?10ft;L!RFImi^JpJmR_6Yyn+G>W0uxY&=Jw)8j+#pF}O*` z5|IZ5^#?>lNlHj`268H;gTpEE$_s;MUPUN{L$FrAi$hA3ESK?tmp@tAGS&x8jkxyw zL#|nXSfO%}ug$TNf+(B#!|14;mzS4}%rW>OzL-pN56DgZ)0o}-U8{3|hyfNf0@yWP z`HACq)?%XoHgW%3@XHtjn95lnXN})Z}4|<=N))L)a6#?$|W^~V2GXtYx&~Nw{%%V zqB_6Zb@7BGIU*F;|8iQIn-eFeZ8mKbY_SkR@|KQNG&RF;^`BUnyYIw~SDO&IxISI^ zsd44D{eBo!<@!YNNt`G)YqWbdg2M<6Dj&=0gP7fl-xhM`PZ2g|4pdnv@gBQr(%!1}!NE?wbq=-4=gB=uG8E18Re?_hbTTLcEkbu1g(0QUQ;@`~=UC&) zXvajvX4U-Cqu_+{6C^-A9}DV0o#78{W@|$O7nY~}`47E9H3oVeHtE9rGqXD4sSyf1 zl>R^0QXA%{L({e3YB&~I_}X;Dli&FrrWhML=!6t5g#CqRs|Y59>_egY-0h~n4m>TZ zFgeAKI&LNc> z$|$ts5F85W=HPz1L@`>9jN-|B5B5UEis5Y3SF~66ThiZ-?P^ZZ2CU)h>pFn6E_l5# zzg%z12yl&t6CiB|aGjFls54`*Bm{Br0YdB-3y0#exlx_g+y<8-!t4P01rb7+DWrJ# zp)5{e9i1Kt4K9rSiJ8iaTAHTOM!%TM0TS>0ZZ;S#bo_7twZ|Wo$jy7x*x&nr{OMl* zmE?-+MLAp$+Z9}%5Q(rDp3sp#SVfZDK1eqkLPA~i-x_tgJRGRc|5?@FVsM2S(RCDx z@RkpQaO#c@LQvjK;k&|wKFcF#mhSBCsz5D*Rh9j^=RPsua)`OQQVZqEv7L{7sTo|C z-_Jfv=bH|^DXfxhv1Kohs?@lm+CU4VG-mgXi0_XGB+HYDbfa?ej*~O>Zgd8yI?ieV=-%CVQh@;oh8IV%ZBc#!=ll3PV=()`pAskzwLk_ z+9(fp%LYx_miZ!UgA!~5Z6zh4HkTbI?U>`K{{@Zj7A1c?zE{Ud>O284ffO|C3K)~m zeTK-W-h0s={~A?}`%&&ZWjX_yy08KnQA_fZmo+67ZMD>TV;?_Ab*N%#KR_}ERaCbJ zUerh9bHFg9cn!cs87((V?-$B>f;%T4{;P;o-MiSQnIX90tC;vrLGvB4{8u)FG8b33 zt@~F&uHVja!dKFAnQVCAo=4Hk3*mSd?%K87;f?F}`UuPFxCOQDeL6id9^D@S*c*9* zn?Ngd<&FMVtu5kjMBg6av2Xo7$aWEMJS>hn2fDoQtt~Mu+_WN}{8z@;%a0S<9z$QJ z@rxKo=p&pF!zj%?o)Dy)wV3ww5d!1Ym%C?;`kpFS;;Yrzl&u$djb~SQ>o3vTS7S?$ zdBM8yyHKWrl+Ai8{=a|%Fr#L(|0Rfl{Y{ioC8QxbtV_wPldV4#-xbu&-}hsJQy>Xq ztXP4Jk;~|*q9l?iwD?(mA|ce$+X=9KaY6!aNOxKNc44D7LzZeKC=Xu#bP~}1$)APc z_o8ix*dhspE(b8r+I1ZO-M#I?_USTL>Bs4<;hzOdb%mgQQ3-{H6&nj{YjJaP+W*X= z_%IrDWhAHu+FDzKo52gMvhL8IR_A`|2S&~_`)DYocKMphaIM!Zn}e<2f=XBH*O$Hq zt=-5vG@d=Wbx?Y_a)56hA3yRP?GX?faKM2iqFpmq!lFavcdW)+nLXX_8>R$=iiZt{ zqQ&y_;@?#?!Sej_z_jah#BXnJX9c?SKf^NT8WIv(3l^L%)=k=@)(!dj0e$&}V4TZN zs*7Z(HBmSMF`+!Z{TmJO^mW)2?!3Q{2gAmTI%&g}m4Xw@am2*_1dd~V^#68NPH&BG zZ){BjcK7yFBk?mQBS~M*NEEVoNq~C2W~BRfw9c~q4!}@iVb9Oai6Jge+z`XeB=NEjs6vJ{dmgwVaf~j}ug04)5SBYnPI_LjT$6?+Hl~xUQ~$(6t8xuMMzFy> zmq6XtmSH5SyqRJnAc;-Q3-q&dE)1do$DoM27_@dMy3{Kzn5*e*}ay1L&VsOqPuOxik0(*|Hfu)$3(u5 zMyt`88Yvh*ilI;6ybU@ntSYAdBW#1zc;m8N>A8>69_NvzH5kuJ#J7b41Bux>>~P(d z>bxEs_kHDf95Y}got$02TcO9@qeMN%-NL?Zcd(;u9ioLp)jA0HQua!Cv0ab}cFd$-~;&?447 zKJVn?#oTIE4*;>yw$q!bBEOnkzhmBPDhZ0@drWo~7~AglG% zi|Q8+Ecw5OMY_X|nH1eHkYElU&D<#0mVIFw7*i-MW<#>ygA=*CJLjbb3<+vYMt7Hc z{6!`OmY*mWouk`juUjAOMS}R2FqU41h%5!Mphf9Yipaq(GCFHEHt7>M1mFYnTG>E5 zI26~H+%{i)xPV4qQ!#M2Qfhb!ONfS4#4XC!aqxu+=R!lL%L`f0?_QGKXNupNIplQN zrdhb(fNFNr8bp1mRZHG{22p(Mf$9v4;o7FDl+tnBAIj%ZAADGeO1>9HqTj6TnXq&l zu$sZu_uCD}owOp8vTK$Ux<{%v&Pv_F*_4c|O7FakJfwe1d8jw5M+eZjzt(p>Rc@r-vZ%UUK*>XEE zHa)go*FCnKfSrhuj&4L+MP;^@ml2$WF#l>)_?1Jy8r0nG2gA8xl(1Q&mNnRFw;@P0 z+8xq2N=>TK&xVaiN+J7NKoAu|D&$Bi_gzi%t#+{P`ZtK$moJhK{LPn}Dy{mRD6I~+ z|D@tbK8C(sqfOycWXCr{i)_OI4UT@u0g!PC_a`Lb*KQujvvh?IM&UvNp%INvPWSX8 zvzW-SPzq^LSpM`ppNqPZqR~aX{@W2?{l!gP*Yc3en7KUI7t*A zAI`-T2GmKaS2z%f`p$}cN7uUgm?a-gERcF3 z@yqSYsm{OD=Bo}KJfwaj7JX3b>fCk>Jj+L8eDc(w`=JTXOG)xiHxwC9E6E7sYz7yJ z3?OO?lv`H$fw7OSFqS08Oi>yyZN`e0@r7f;N?&>zWApCX(PNwxJ)Qk;|TmH zo4_B!X{o6=|GLFaWY8v!{MbPfIreUSeR&;RC{F?}C^q<#dC;#OYmLWK%WAd*DQF4d z-XFwL+HdV$ADur$y%Nu{<=pRMF1L8QFZhBccfyF3C{`!j)z{-TW(m_SX+>G8FaZiD zX*9ev*AE7){|Ea*5YLVqrq31_@MH1j*1^J|dGlXYc<%9F)1QFX)^}{!{7GGX=4L@n zY3}qsKkOwMXfo6_HBmFw`szu2vB7-RL#8H0P8lgI1Vff!%fSQ*tmH;8q6X`g(Sk3N zY|Y1T&GNi-syMR~!^`(4g0(A#x+lF={g~J~`9wtGpoV}5?Tvl+J--mQ^-recl$3-t zJu);rM?<3LLsE=MVGc9p)xS60wHD`>_z@Kg{iEPyih4YGpizNhufAO_|ks1BI96ja+{6Xx48c2 zPG#yrxZf{A#AfKQ)UU$(6BxUB8H!(Da7E%iL;JF(Z~T}l?CbEm)XG0hwD9Rd!`(@M0us4Zr(Mfc1tOTMzO-z0Y<6LS z;01ZDDj}f9rpkBaB|@L@#96-yJ2jkWJQueUSBAUWNx6mG(zMXgz|Ab%-00IR!i7;f z|0|-X!L(mh6s8V`JlQ zaDw;$SJtYz^>cHYjD@phL^RiF5_`j6l_;YfTDUEG}Nkh(2hyJ~leg26`NkcYtZoWp`DT78* z&d!LxysW8nJhmJ`cs%Ohpd{5#hfrKLcQ+8A0puz&5+DZSO1E77JNh@mI+2MIppm8W z5g<~0x@qYdvTgB&CFHg#K={{f_2bN{3)G>w3;CcrMJ1xDe`#^z%HlS!pDc@!nztuL zfpuTnkJh@gNu!i!!ns@wB%6?H&Yowaz#C@BPX!$-hv<-c7?xg0$}ot zUtEAT4n1^t=Ftgu%S$7K=l_25n$8ObPXs`yO$rOsuEJ-{8ag^RxJs`pE3Y7IwB@#3 zs6CB-_2XmjCqx=bX*mNW`dOUx3)3hY>hVU@>TIFP7ap$}-#&CymJPUE7v~*WGOPlt z!xd=bbaST)dPWpL#}&WA~d!Kd-QWlel5rq>|;DV^v_G6NJBV^MTo z6ztv~qq*@9DJUq!C?1Ibs6kfQ=TAAU<5AUSUnKUlXrW4BWo5E(A!Mvg__p5JabBq# zrC5&Oi`P6X;mrJOwu?Zo!GTIxKbsFG7Yc1Z-U=nPbTh~`szig*$+i(_c|CtrN28wi zJWRm8J1D*ly-o)r!03vfKi%+RymVX_7qz;dq$VE>;>os6a2q#9JH=7(feI@A13)U!?$kAYw z&E?C2{2)ch2jvl;qqU_~-%_=%9Qm}WA$#WeNYbk)U&x6=qd~e{`sD8IqXUqLLA?`|+dm&V6)9J(t(y*x&$m5+-w^j?R`*2wUT|$* zIlWH)dVnCT1|az2mYJhRkq$kZO`?=%U>x7Xfig6#|NC@yo@-tiwl#XJ)qwr_G`NX| zgk+y$XtvX?!|dYX(r3c{8xY6)FLuWr9}dmq12$GyAmv=$m5OzpG7fP{0)7qHdeziz3dZ^?Lr~uOh_oASMa~xbNV?k`AHz z4PCqh*`jJ|;V*1K>H8uyx4&6MEJT3%dbydv`926tAQHw0ymvBMiCQifmH{mPf{g)MSr6E zH^o*&_>G3FEW9LRmEJQwiRTWw;O#nsN0%R%2BUn*kw{oC@bS4^YAGxedswAqB=Nz> z?Yftp`y1S!AC-}zttt0^4=*A4e-DobA&`}F#qH$Fxd5JXQTY`Y5pN~R({ri6RDVu? zzn_hn4_~$-k;t!*EFuo(o~I}f^nqWM)vyl&_8^y@(#d$KND~f6EUXkpJCS0Ablmk{ zQsg9CoZx%WyEs;UGIBHKFC8850e*1|A3f~-W9&+m!Xr~3^y*_T!a^6J(tIUT1_ z>dtt1C^Kmg463bu?jh)VyJAkeSCt&~oQxt7H&9SuH1@a6@0lNX(Tu66+}yu_gIgv_ zwx6Dgy(CBIJ>Vr9tJ>t+m$uj z-W$!YVu5wqFs;lPI@l?Etg$YEuDU+($(>%rTjlo=3s${wm_y6(?RIP78q z0s?@pj^lGNI{YtUrq=V4=IUxWUzJ`Nh!{ySR70m~jYaOqtmzmcx(l)^789kh!;&JX zC}_IxCOACqT6z>M{rx;&Ygp~()ORHNHVS$rB^67y5n?o}O6V^S^CDQAL&WeYh1p4FROv>ha36&p_e$ytrfb+@MG^odxfZXg?AqQ5Je^o zOuhpk#l{UVRC&g;JIyA!>g-F=u!~a zRab<|752Jz{-9c<1s=i=Rh5Wb|QM4mJu1Q148P z@19?TdzIG*pcQ6s(EbwISr5TJ`Yc*;jg5^R-qyPPHNRWx$@$^``luf%Ha6L$Onu=3 z7Xe)y(z@IIMMYINK> z#(}t;yAVzxIm~0Do~>TmI=kIJjn|?~zvh1ZLNW6OGD+k#JuiHm|Fokm=Sva-+>e** zgbT9>edgvjgU)u=l1Pu@?sT)BvhF+@zuXX*#e*PQ;r@oYx&(;Ktpg5XU|5Ok*@+c@@>wU4Oyg1alG$ zVFG6pX-iAX1nnxpR2zX$#?}t|;v&fwDvzn#-NRp51N{^_|fZl$%KX($$*l9f%Z-1j{~p6*>BMcVV#Z}j(-Ne z$J^7O`NL4DLJ(w@vjdrksCAe%dOGV~j)H;aC*D=xahUr^hD9+AGV2GnhhrgYo!Hsibqm7cSo=&gyI$hb&JHU`QH)tI!&cNm@iicMP9SL52ZezR z5`l;&viLBYnhNO(iaI*Nprp*AB8)ah19kmtL}n}M{Fwz(?YNQA}^6P5RbL1|KBk`eZW@_+8CcoRr=$P&DnJvG`|UZ+I2G&P2arr ze={w3#$w}TudDq?jt~Oo-HCia;sHJgVo->YPYKwQgN9i#P~F{~CqxpIz0AyJtj}F& z?*quRwKM9>r|oQ(YXdOc?KiuLfgE3w6)&_mPg*fHL@$XM{oLf`VqqSS!_Q~IS3Tj~ ze@~htva~PZ>39_x9Q~{FL8t4jM3XVnhyL85KbPWq7s}^ZeIGcJlLv5_Z^jr|=5bKX zvm9aU+IFpdUl|vzlH-UGKM@(_E0#;dYK%{_DXtz~c^v3O4ZS^L=6$}wByrXv_PESt zF`hgkEo}`OrNnWr)As)D;zcKCaCN{xk-?SO8ErnD69a~RsyW7KcX6oJ~@* zW$;E*gSrn>c5k00V+GcANytKQ8nUvoF5J96Dw>%*PRzb zrCIz7oIU7Q`1NM{;eWSn00u%8ievOpGSP?R05U$naZGBIp;si>m^C{&!&BuMKr_94 zhY0)e9N1YC9b{S9cDM}p zEH8#67T6;NX$th7;o`=`9c~{?0HwsWIx{RStrc@|?drt@jX((rlBg!{cc|u<^rabU zcP)l`R;h1OBaAyEhm<>xyqCl0K7sk|V1P!E9gqHczB}!+^KtUkc|O?R-)`!9eWi(| zBBcf9X(rh)kiPH1vvn$lIVMW<5nUPD-E)HX)i_bMX4$sipJ+ck?B8!+KaihT{6)Sd z;>(h6U0~Cury7!lL$l^j6YxZ2ke{26rflmzb?Gs!Q#u>?5uuRTgCZ_wDpbdkzC5kn zXx+tF>Gm*UK2k7weWNn6*@TwI)u zsxosFh>|WBWxSFus;a6wRf-1UwWsvW2Oyxk3)O-*Ij-2xCU~( z0v>zAC@1S}p(Ew<=Ll#vW)jB1pu~yi2m_ z13E{4Q;b7Ore*sx4J4;@oDLCETMXn|+x`qGR6i2pFPKcN{w}Ghp>P2iB2s2;h>pG7c^AlV*yhP^K5}W3(t!^K0j-NY50_}v zi#tF8jrsei>PKeEXe5uOxzDf!<68|XG13SQwyCuxJ1%VC+_8t#Y_pCnu;q2@V!IE$ zvEB3Db_J1uHw>5?eee=NC1Air!_ZZtPQoz^q7N zxP_m_M^ZU(v7wNuc<^ZqHGbR1hVr8q027_!k=N$RLt5{5z$D>K#*w*vtL@frGE7wm z0MTgKkYj7nOI)dEG8>XE8z)lA4KCFfTl8oY%=Dh$-@-)sb7M(xhxeT@2ZKZ&5uKcz z@)q%qoHpysxWYq;yl+rAt-pm97pucsFwxWd$(sptXY%M3%}%CC8|6c8Y& zU7wH#Xif3eRIx{H?jOCD+TF<(Dj(rtgZ%)$8ZD9>es@@TJ{#0viN%G51d$3=T8n|T zQNIS8eCEdrd(@r(LZn?3Jl;4*;ZZx{#<37=aSWTc`(*4pOT z!OV_}5zL8!fsv!Er1UGN2vpV`_2^`Orgm81r3xWndavoQHX8!cy)nW7%G{32`-3zQ z_T1q+2#|)ik2|!Tz0eO{*L*_WAXrbkbvzQb$iuJRsOYtJH17v|98DVbJC*Xlc=ar=uSJSa7jv#U?I0&M-RU z?7A8DL}NU=p8T0bE8#01DJeAQGoB2&1u#MNU&}9|2(n|5xuhAk=EkvBM+_?QRM%gy zO1BGX{0(>FbzR=@jgbb40uqO>It*qZ$E$W-flV7);@jN&`}^1e9_(t=_*}O5054c9 zz>$NBorY35Z%MH`#q{M;S;mIu3L}Y?)}VZ4aCc|9Dv=UQ$|-1 z*3+vFqn3C!!379FcqY5SDbp1vY%cx z+4d zAl}Zn{oT!$o2ck$hnL5!bibs6g2K4>4KKmq&lHu<@Y+$N*kM7wb>4E89BSH!_J!RT z(EXK1M?wJaj%hC0p&RBKcqAO|+ZeuS;=*|mD3iv37WGM2hx~-D{Ro*+i zmymk!62#|m#0I!V#Hepb_fO~;81kqST3bD2Qp;^Bn-8dnluVQ@U*~Mu(FGKe~#FlCu|&*^}7f zm)l-Xn`G5tE3WTSWzFhat!3p4sgj2>je$@tuc>)4}mcu<5M@86Xt zb2Q%Wz%n@{TiehR{lO)G2IYeT2_Wqc%x{w5q$=ibg5jXRL|E;Y#q{6{-n^8jVt9U+_)~u>R~_wqi`d~}%U=fS=F%bL zR-1s9vP^ISG>8D}+DuTE4N%SFcB#w~>s?q-_lS9&f|tK*XSni)0n1gdIATMA`z1xv zY{n~&F#v?IJgH7^Y0TuvwY`)v2zOsf>!KoCs@D&{Jd@w*sP2*b(;??>DwC>oW;b&F zXlg9}t&x+Mf%i@^Z(1keogFPwXF8D&;~1`m5G@1j*kwBi;=;e&xPc5Dp0RW{B$rnP zxVT}RV*pP_UDPMV;ZZ;cG@1D|cHp^g_hD@gWZ&|s_^he+PFlERv++gPgzcF)b7v;i z9`qpz)Lr~9U3k#nfMDt;`*fzQo;qZMo%qu)P*gkFQp_+ z#`m|m%gcVS#?}RkxM@j_O7V%*J@%wnV#Z62Sl4X?>wWK!WRfB+NF9|JpIx$|L$H(L@vI)7MB`czGR+Bpy?yqc zqcWXsXu4-aj07WHMI;hL4`;NXMEQvj%bOK)GFe-ztXWjZa;W)xPy1`xMZ{VhZ73-* z(22=rw7q~U=>iSnmW%+~|FZuLZzR)m|B?Io3gY3S>wN3M>y5F9qaG?Epd4&2mZ;1~7ht+5p3FEt6mSZD2v!HK9uFy&5{EiMfJxao4AI|l8} z`->MJZu<`5a^J_2WW?Z=)iy7eYQAj_V4U?_BaHMd$^QIEH{8G-Dx25IFid>^*W8AH z8;mLbbR@2YjDoRDWwQkaMJ1nUjeqfs#w&_+wi@cH=L3U9&o2}#z?YnvDaMZuHJLX& zSPJCjZed_vSuEL0Cnv;#g{S)Xi9VdaYMmwt;Cu6DgacpP>jX4z)W&PD33hkxH# zFkeMnJ6zU|nXh)(LJ4}Gik@h-2~>F};JPqI-hF!?Mr9$|%@c*9uGffqnl@K8(GN$V zw59_F$?F*?C@8$+DRxMi@$7!^61a2W!h6)Vd8jOf9b3uE8uwXuq;C8{;Zu<1yKW&U zCT3B+K{t7IZCSH#(~TcpQXdsxU0#;nG1S(k16I0I_ZD_^WHoL?EOmC?kDl-s)VLaY z=K7fMYIR^@F|@&7|Kes^*TrE~4(12w5lH{5qC@8pIG9LsN9oWUV6~#8i?ZO#B%=a` z1No4iC)V+`{rNwJ)RwIu}e%x@fdMsxY&_{IZeQ=Wh;m z3+qp{VwhiI2=t}7p95u%t2N^TyysScdv)9t4IYvV#sR4G0yhEdp0|~wymTiEj~c&Y z1uRKon(RSpw(p6%i%!$3IBEX6ZRpgYKadFQGo(^djG{EW2Ow^l8|-tJ#)EG&{8#jJ-({RK2oKSV&H?3qD5hV&EF}PL0`;Z2k zu}c2_2@50}ovL|>;C|{sSIK9bok<1s(5pSsku;)=Y@5)0jNQfUiDoipoe zXKW`<+P(Lp2`URlYV6=B*^v@yL4Z$z>kS3XKgru0UhU- z1dJnNm`@H<;=|avP-1V41B`M4XYV7i4(+>6v4`f_v&ub`e*soYRce2^Y%9z1%etIb z_Fs#wI=|4~7XRI*ayuA-hMJCkOqb1@H!N>Oih_g0exKfXNGr0}jqu%H9VqUY2VcSiz%BzMZdUcsx)(S#E~I+jxZMQ@8Vj=3!MwZyxLv_%o1L*YP}2p<~5toLBx!5;5=0yF=y+>lGFriA$^uHbeT<2C(T2l z|JzMO#IvFeE`i2F9T&D($xtAF)lWD)vLt&k9haw92ltiRp~Ksq8h~2`?%n-w(&0|p z1!W(=A|fSwB1AGd7P(pT5w)ZsX4uzp7RzVJZ19BVhX)C}@@5@5wC!g5)j7r5KqkXd zHl#;BkzoU!q@+&#hdF#({Uob;;Gi1Oe75*YHmW}d_fNl#CpfJi&4EPD=I1Vj>~pH* z8>}~ZO1$3a(8SCDopM>91&V7Eq7{B@k3@FDh=5N(dn8WHMSL|QGj7N&J6iZ6{GX!76 zkU;8bjG;9lY{bM;pi$Y4V+ADyAP!?*+d^(vY_whT+g!hQs%Pg!d}wEi2|yM7-Wvo1 zwAb+NJFrxL<5x@lXe4(`1~NA@r;3IuZ=eDc$|}rL7tghgh_JAh6Hn&SdFFCeop1Pt z+^;?|A}EWUpP>*}_jc2;5gOD3j}IsFC;nX;Et;(YJvIPiln)ga7Egkbo_S9`4 z0dCPgU#PIySmw z=kN0sH0W*|XmTBUh}B!b0Dg(&}m=MOpNbk&(PilS^PuQ%OllBp@IC zNVS~Aoi1Yg;FmD4H0TQ!W?i;0H@tQx$z<+j3!daD6f38h5v#fLilBqijn3NJvFXXi zZ!|p(ui#kj%r{_l5Wyis2lD)`B@k^J20H%zSAXH&KEgQwV8gIrAa>KtQ>CRqL3ftW zQxlc>TM|<+Vd10*cIjN9USRP)1B~0SML`D$C#MZfruxCuQ5nuz6wIy{k<6Z1`g0wL zH@LG0abGof1c*Ec5Tasmw3~~mlZ0@#g&f5XyZP?Ryga&giMVQ{?7c>Y0-VB0ZgoGOiOQsVTm~n+Adh z7^Q~tJ4w)g7&BNA=mVL{x_y$VvL17mZMc-Iud6kKoWM9F0jF>C=b?<)qBg5c^f>J# zNwA$%i(MAe74C0W6eCh`C^v3=+XxetV`F=g}=yrIk%*r#bME*e%0QgDNO3O)W1f28&h>A6?T~;wQv+`*eakB&18*kDjP zegyv>&px_F^3KkF%FKdCVH!VHlTSMgfgIWF@Dya~42R_(bAV(+a(ld}p-(^Ao!bE_ z^MmXJU^GjezeEr?6ZQk;0>Q2OSBJe|CUjDi89YFS8#McE>$Y=zy}_&b@9{C1rNOJY zj(=C60iqnMg`(DP5}{8lo1D5t6e%y+f-%5+B<3LLNN<@WgNoU(=Jd@4oGiQK4BXKQ zve$=w39);-si@x0G2hY}!3F?Q=#7kYch*bcKxk#SSuB9A){DcF1dyamLYNs12Fx0c zhWnz>tg@sQrJy zX7@RuP3}s4&q%_wZ;;rPS!#1p@ro=0;Ie9e7@u_mn%HT~b`;}ksev&yphEOr=b3UR z@5qrS@ks538vL_3B^qbt8@i2vz(el~1WeO59HfN`FnG>TD>u>+%7)9rRm|ppVH)RJ zp4BhrOYIySy%$3v1m(oY9oYy>*%Wvp8gCv5EOmWnT1R?N(f*#z_Oh3PX)xI0#BBU_ zQmGG4NUJPfMS~vU^(pkf4BCHWiLfGysUI1%tpKA|>MEL&(-$kIkiNgU^Nx+Do9$3{ zwr6T_@~PXJY@IPzL<{nzqT=2dOzfz6ed{uMO!Egb056t92PHCW-s-<#tvupbaX=w4 zI}PH3#1xoQ_j)C;CDW01va2^k?iLmbpU8_scL0}F>fywHbbI+)jB`ff22Uw^JyY=T zICVZyXfb;k&36WDB1}ZH6}@pW#^XZ*W)6S6c#TshNV83!SxU6Er7I?ARxZyeXN062<5)aCtWhxw8>HskY!TW^$D>Sr}| z?U-_h2GyBrK;~d&;AYpWq9ow`897vQzY)F5bamzYHdn1^iHny2%Tufl!-j@$8J6)~ z@zk;hx(v0n(-Sb!M2xcNjyaJ>vc9RSW8S}|(Nnwp_%VGN!;siQjNFLYPDUr9ZkO$ zH_F@osZw}aRX3geTx|G9Y-KaWYkj0SMCqI)8r>K)Oe>uugMnY4GE`i9K>)) z#HSx$rlxLNMdH?9!P3uW4|xCkjrBUhUtY+BDi!VD59zj{49&0Agso@QGXKc2LsQb zYqR9;#^pk^-p90(n9RnUE0vf%QY`jaTv-X*I3$X=PC3L#)AFzN_P@s*4;UHwp8hTB z5L-lpy#?g6O~Rg+y~<_nN~x#NqNfE&@KxNIxtXYtJBhg_PEg~psa@5Md3wai12yOv zg1u#BD^C4QguS91x@fk2?+?k???_SvJDSh0_t|=*Vme=?o&1X}Qg!hArf+n~l^+RB z)SnZd(SM2Y+5iw57^|ET1`4j8`y=l&YCoN-7ski?L^~#Pcn21>zC@0(?erIIAT>)w>=D0zx2;7JJ<`ylhcB1KEU*&S!2~H8@11>!Arve1@%=PBl;Cr zOzT`VdrOEe_D|HQSBZ zRwo54-g|3NW68Q@?G@&zQAKdoQAP3$R0wqGU>0i8ncPGnWvzKG!g_k8IR{3?B}lv^O=r zzWcrIomwj^7X$h)tb%WUONhrRraJYqTS~jq8NT|9R}fEI0i5=7yZ*0xfBZ7%mDwRw z!j;CU%pN?MSW>JTa-Gef^dV*jpa-Fbm|2)dzeFYWp{3&G!8> z^5D)5|3S&Yqm8)>%Jw7jIUKqkGzpFzamGk`>pfC}2@GdRR?4rVv4Uz`ruK&U3kXX$ zY5`xL!G0 z8{;K$50qz9rDcgrelD_P@XNk?)pod2=|j}mN0~9oN6TIaM%C@k0`d}lu||q8^V#iI zN^W|}Q;Vyf>ym`FXF=kv{`C*bfUJqaC@x@6|C28Y#W)WwfZ1_jUo^Pt1((u8h#b|#DQ)apEB^$l= zhx+%Nxm=+AP*XB=U4DG6bfK%{#6vP&%|i4MSAFMuUD$WN)Gir= zvoPVan)5vLRIr==;?RtOOz(9b$2kdVcy4j=L+%d|XXnd9cKO3mg;JSiQ3q>lYw@17 zeNZIaLz~?@#oJq#H(qFrV06wyufpyy+Y~lyjo$ltoEZkwtER8O-|DX|zd0?!Z#*C# zux6c7Wuh+c)s@q3rnngGs8(E^1#e!5L8)d;lX8HciwPY)s|4b}wBeBF3q)9Ox&vpH7U|Gew>f94<(qeO9p49{dBYkTjG)I<7K* zX6Ct~v$}Jtj!NO8;eEO9;i>D*nf*a)s~*So>K9}3H6sx{DGV6-;KM%^EsqY{dbrQQ zxt%_3ggCublQ)N$q#nUI_;>9&a(G6b*l0zSkbggY z;Ud9^0*fg8gN>@l{#ze%+2jW8+>rr^e4nC-oCTL)FHy?s*Idim3EKBg+^wk)q_G6k51|ZUtnl5-dShl^M0~ z<4F_2!S3}4fBdwg?AKd5GBz+;Y7xX130;DPJcX&z`b=EP&4#4*c<~lZn~|QKt#|89 zfH>6pexBh8I&O*wdNPfNcaPrNFvQRd;rDi+Yk0U#uzck_80P<>>d;fSW7ftF?-`Hj zW%Sl+cm52Bw?3Ydcx7sPY0!Mo(sa=tT{KspxY$;I$|nprp)iSj$*n>lu`0^Jib#0q zZ=_V{#V!pcT~4CTm7b`YA?I zP=O>->AjDvxV*NAco6CfW^mI2Xb}DVJ(x@9bi1WoEAPekSY7++8DyWIsdZYCMBbYQ z5i}e5*coP(oAblXvK%>Gvm5I9(F2~hB`ZzSTX@EH^V_Tc^Yb&jdnWCBUpSe3Y@}KL zK%G+OAPaoSNx+aYLTnK%XUz{a_!Z?`?;TJzUhlqmBcuYg$|Tv*mqlHS-)F#Lbp`?>8JEBKCo5#Y*|>Li_UiS8 z>txC@G9^!$r6_sB7M^G2y)G|TF*m0KC_Pmk}Kl>@IaH;YAYo2i|q%$LO7M@c&N zM_*l(E_`ub8?YyWeuBM_Y>56u292im<@V4gkgI*k^&?#dNEM`LL-N0^CwzV%_=C;~ zlA@5JqbW>ON&PCnABdeFXePyD!i8jtz3y3qUzQ$Fm>^7>G7g30#Pa6M6K4{BzeATK z2p8b@R~X@d%53pvsjsiE0+w1v0-rpGIEzv4=ki1b7lM0c>j81scd%WNtp+VZ1Nv$G zNW_tmFVQX|J$77Q<5)_*r_@#&hnbPR+-k{p;KGpXN#olZgGB@oD-wy<9xDP63SLQ7 zfH`-3*mhct8U#&)LD)Y$@Cb5D@KwNM;1?aGTyaP4qvUl{H>ObLfUw|*j!FQrrU=VO zU#vzYaC%zB7UcvL?u!7i4t;B?OYru-06v)o4MdyS zXDmBXM?PbKS^N0k)2d;tOJve1jj)lJkPXw~1SLZRrFh4(_(L&SCuEsPX^PQx0p*SN zbi-)lD-D{GeYa_f3e&5vBg9q3Zr#jPg%6u*q=VRN^R_{z*ZzgA#h;$0boH-yH#$6B z)$Zwr^uj9g%4r#OTTOTW)yeXr!tC%9tskfu#1C%R}>vYj8yg!{T5;9}){L;?(DtXox!s zf?h6Vm)jRbzPY7-^b3Z_C%y{*livv*Zl-dq4@XZFXJl~hI|2S?=B$|m+Rv+YQdAB0 zRe0xu)#vfaP-El&)*Szpn1Pdyo)eC>41P*choMPLxPk1QPXqJZcxS9#tJpHE$gil~O<+6|9%ne;YJIsgUxdCWzY7z# zhu2FCU)Q%o8noTea`U9)kp=to=Uu^9mv!*{r5O&Qyci_fS#9>lQ7-6KRbF08zm(&B z#32t&k`WA`olk?ZW@Lo{|J{__?Ao~B9&Uw=(+vk{P#n@|*>c1LB)yq@HC);p814$L z#w#|18Y-e)jnKpOg{QB^jq%z;cTSE#Gg>xM{Ub7iOIR&Jz`&s0tx%h&lGkqHD#}+= z6gg9r84c2R4*jwhn=*W%w``JFmHleYLOY|feKv?X_URyGkW6+|xEP9(axux>cKiws<3bJV};DL~gb2|fTd z33Pg2Sb|yGtnIK5@N02kC5yp7SfdZBv`2Y!o3#SE75|N-$TA^%-E^am90bho9*))i zu)1F8`CE0^Geku&R4_vgG+BNh&R%WhLvY6jL6hL6I8aQ{0xu)?@iIoG1had}ES)=SqC`)8B1r~S<)IUJepS5C+Rk52Iw{{8 zi1#a?Hr#e4hfSktZj0c>fp1VS(h>fM!Vg3N8I{(N;13Iy$%Y{bs{9fo09( zQ33JG*pMX!&1@)x9V5_#Sg3R!{gWN5kLV`A!|plY6B@Ikb3}*K#{GA>M&{{T%sXp- z9v|PW$%NSSMf=`GNqFWHXJptf2`2sOlPNPiN;aOgtgx*!6Y!=%(Pj=p3I62gY45hX zb7sRKKwM}MjNv&;2+G_XtB`aWN!VFY0CU3tFLVGKRc&>hLr5R%kL+qq~!{$By+sV?)TfqPtX3{ zt=M|AhJQ6CxjD9C4+{PU$%k~x>74WN^P#i5I!?mzEb409w0Mmypiz7vUKp5W$4L87CwKTh_pZJ~0LiI>SLWH7EjuTt;7x}PY19vE z!ZdTAB2c1KaB&=>92uIv&L!cPTIA-y;@I<*W>j4bz4i4Msq)W-<*$kqynu&=el&Lp ze4_T~*eJK>)_H_d2dRgBD2};2aMs8D0Uz&Q!(+YlY;C9Xd0b+{owFW2wgD=U#~OM`IPACUWU@&)%POy;koMttsY|SsMNKfVG=>9bnPwBCj~wV zp<95nyKT=*M@?#Bj!X$pY~^|{mmW};iGfnT{0Y-*W#M>h$`6zz#$0IpEBgN~*9=O? z2VCfB^;~qsySZ!A5*`t8tNQKl>cd}+uDc~evg_+>MKz27;>sfj@yIWl8AR3k?m`bV z;qW%jw$^r6MxMqPE}UvT|0<^=9nvAc{)lHfw--`fju4X*NN5lt_r6u6SUw^65YaRx zfje=fO4dDp=rZL09^?8Khp1BHDEsY)EVN!fRn+_|Bh(S_8TmcL?{pC5QyWn2wVxuy zYLGf%TJ!t2AHeXTCZr%g^DvF(?S1d%(=6*$h1S-jy8Gx&a8&LJ8Y$LzeK19>wP-Gu zcnBaS*3=CZ(?#2Plc0^J42qK*E%hTchJ`>MDgJOA(hHf9@~>!sAS8hq!%z8cQ;2?v zXicP2AVr7WwbFm)C0e+mPE1S$LO#LKBc04@h!&Xl-OV=yBeW)D+|G#UX^KL!x)4E) zky6@|YZb5gwbrmgCcmIAl*?91SVmOPFr^V&>7FJscr^)}J>X+}l);le?51xa|c;IV-khCwk^Nc^eSwon(3w z#6|Ri( zY;oql1|lC;8paqt2iR%0HCg0i4hdBZ%0qs8hVUUf&aE68O8eRWV|g9XeH)1Ke^UY7FT9oLSbnN`@GZR;`XZJxia78wa;y$;gM7EXEKjB2PQB!`%JJ#x$>{{91|^qZY4aul+DU9VhR zZAf@|DUhw*jb@cwhtubCIudraX}Ap<)z^H{3?*6Q17s+5*j5oq+)pNZ0g+XK$*-PT^aN7)Q_g zI3l0KZjuuU;=>#!ZOkYLg}ym)*`KduB?zAP_JYZ0@eZV*0E2@U9p~Nvkei^T-Du|R z(Xf+5=ya<`(8i;EUKcSL?p*L_%~HkD)osci25WF;_9Q75P3k)rVCIp<^q1>Wz85>X{dgx0U*kKuPf+K@ZDi)9g$mL63Q3L#(bzhFD347A+=Sq;2Rm7IrlxJjtZHn9U$PG z6d9id(0i%_VLtQ;;i+DRHlVo2M$D5YBdeGnKo~SaggID%qeGF~8m1fi{VL1_Fx~%a zb}HLEsY=cqFdf)d5RC3)5}NQN(k9@1dw$HVTn{eWi0$E<3oYOFc{9vQV4(2&(d zBx~GRfmKeO-a!FCP4*Mu?NrtL0RUSp0+=(~N}xN6AfI}{DxH#fa88Gj%LK3_)H9(@ zfC}u7sO=wot{*lEGCTBs)9}Sa3pD0_n>sf*IuNL9YC6l*!@3i2Mebn2_pmoQwC8&` z-!CvXfNpRmQ`3cdpI}3tEkiwX^X4v*FbEH3u6w3NO8-EezMO#`)U3rH0{n4=*rcN7Ba8n8{=zlc z-N;=x*{0{~NFTNJ$i>q3kA|FU7#SBhaWjcqMU$uxWDgvSQL6#-5i$N;DZ^xTp#TxK_Z!9Fs31)5{IjwCfo!5`D}ESf5v` zS*bE#X@$rVSe>44Lqlx3&g*JgVz^NCBnca6cv3f^E4~+qEbqa)K-^??TP&j5tA*AP zhzYLpM6vkG?#UN~T${Iy@HY?I?|=7Y#HoqCT+K50=1r3w^}kFNLHC_1n=2izgTGD2B_KgExvMvIX$s zwH83gno5fePY8L@mGbv7%Chk*V9%2Rh+%=3+xo%hK4|1f^E<3agz-6BXgH;~JQXLW zr@xz;GIWrIizl)rT+>AP*m)JtIEqLki;(Kv>FC#0x7z9UbJf+eqM8Om_0;q5*0y6l z`PI;GUh5Z@=(r0mqpNPX(l!rNWm?-|_ z8{u|so+prd!5C0jAd<`6Pr+v zjbf4+>tDK7Y!T9*!o2Yy+ISFW*0%rfep+oY*_wMzD2K6U;;|ERO4uoJ1L-pCRxw{-Bd*X z=z!F?@{uYlgxn0_(5PStWIWNyYC+Q2Jg5UvIV}z?TxAw{M>#Y|j zpPU;daM=#Sm}yL|4WUq2Y-Q|!M%Z%@b>+z;!6PR|*-&m@f2LDHr=ALe4gB3I>PtR* z&D~KlFKVR)WB@O7!f;6u^HU|tv`<@EnFz4G{sHOJLiIZ|31vPEMn5~D!n^`=v3GpU zA04A9Qzx&{y46GfKo1(gGAs*=DeVmbiPfI5_}gl6%{`oGUODd{kh`rX;;8Q7^*)u( zYAx=*Vv!TQ_vXcgOrO+hyE~b`{}qfPrpk{~VIhCnk9P-rPqMs_OULECkY6#5Q~TVM z1CFuen(bk*IlIeZ927<2_=oHQBY|yVN)H$!22e7$nd#+M7O5$|UW9>*=a<=colja) zbJ`!V3uG_$E|mmk1qIQP(_vtgdIpeKs+D>jJ(Ku z3*N(w?>ixpr71Ixf$d-rQSt0?(hQP(*m9|SKx%&3$mU4u%f0Y1SOigFj%-W$+S2pd z=Nq3BWH9Z3IFpgzFo}RrNfo&(n+{6wNbnv|Zgn|8%BqcTjHU;#xRT7Z_MO-Oe=wlv z2n!^09j?bYGGBXO#uX+=Qgm}%NYXxq;fMo@mDOAM$VtBhMBxT%kay>aFvJX^s z_cc1&u2gsYbx7-y9&WiaG6Glt0*XTzYvc~>o=3wYE#>a&z?unhscQlvk?(XV6PF^U z_rEp<8_-hRnOQPMe(tqkh(GU#hlelTFnzrW3QB@b=0{`uCO|mF#5@?2))BuCs)K8G z&O^f5;Ex>Hb|AEATB`I))*itGv>LQPY36!`YJND5ohl+wH@=ga0~$OPU)W~xqyvzZ z`c6DHCFGF(U(fR${mxqj?$_7dRNS7lB1tV=&D6PgO z5%e<8Pr!jGkKj9@mA3idPRnRPnl)!m_>X*H0@WxonS+K0Q=%xC*SNy?fFGMIdb>@X zvxb)I+l-2ieuqsKNQ@2wk{E^Q>HLD-x46b9^G0Vw*rJq)Jv%#K)|_|%Z<)z*Z(xKe z1g7)6KQ6lqdtO}$oXz^F`No3f3eYM57!A(JWfs9#9E=SWmfc^yb8lF=e;^b9B`Tz) z4S9xSw%;X${I%W#^tVWf?V8&Clg6yo{Qf*QH&?lgN77FX;7*G9>FM7Z$QO{tl`cj1 zfD3BL1ncU;6cBi}e|^GOYn_Kun+M1Sw_Og$JXGh~qrfPcAHW*SH&y~-1Xe##lI35G z7c#(K#7kp}zvy*&xc9(K9zk zUR+}4Hc~TSw4D|;HkSWYVyt9UAzF54W1g?s{fQQ6L<&h)*}7>pXwXn?llrjbv!l)J ziWE3^!4`E*wUmyeup}wswZ$7JRe+@_9{?$>aXTT{y{sc$OuBA#-zKK8@Nq_~l3I-V zEI9reNu`t|oq4xC3V~)p(XAz?0LC2%@`vA;2A38iTXM>2rHcMMtSol=3%&H&k*0yO zGlYJlk8(O>+zu6bVchU}mc%CLnA+R|DCjB|u8#0boR_w)T4!eJF!&J9dK~0{|;4g5U*ceP__;D&)STp-!LWU#0vuUn%E`|Op`DJkNB+%chRES2Sa$jhH zTf0opn#OL;$!DU;*n0c3*g{EdfQpKeQod?c0)~bJkl_Rv$Uuht;SJ*`8=z~oMJL9L z_-*n1Y4c)~E~k4<2R)zqg3F;~wwDbfG<3-RYR}B#^Kawp#z z#Y{7!vt8}_0$@&wuZx(&>cECaW=|`?P(Zr}wc?d*r{b`A;#u`!7kg$))KZ$?0h#u_ zc(=$3>zI2``^)b25uYo;OfWPOeY)JHHfx$NZ+(<1F6BvR1s5{^!t%~E~Y*R`DZqL6T3#VtJDdFfNe1O*W%M~;8jSFjLRdQ=+1j_)7d=ftn$NADLsWkqAGyc75KD-mX`Gx z9xxpC_y3QitBlIBYq|(LbV+whw{%K(cL>rc-Q7qd-6${- zzRo!_v-j+oeZjcG?UMwHIVvcrs-DCwuj(O@pT9jZH5IeACJJ04ac@pmV}%|H?EXHk zznZIQK5CpZEVao=cmQU|(~QU$T0|xSJbE>T=;$sxgupX`z7=VqTwq=8eOx>@-7!=3gNw!j}G9?KR8IXI9Oq+PPA?>4Hw$c_xzW6^z1 zCT;k)9B@*6lUu>lIs8NXCqEngThbVn8#G00J>xu;)*8YrBf@|+2sWyI%Y=he*s;A; z+-;q*>2{x+!n+7=<%CG4$H}n7H}@hIZ9=Il)zt5+oc3(ND)^5J_13_QF5|mGu?Js; zYVlf+-&3q#Cx$wuG}B=-J2Jd{4|8;Ete^R+FR6&kTS%jX4Dg>edhdr+1=Y8r=w}=& zQEAOdw^87TxbHggS@k1(= z%Ap733~EQN3U~cwOzI;9`+8lOrf$VV;ie( z>pi-5Z2^zBupXT%LPh(quq~_aq~nvPR!05&?3R`SZ%!2I{vC?tHWRxrUe7pzatMw! zz{d~)a2xKP(jR2!U|6Rw+1YuKNrQhCh*8F*RnsC}BO9GPd|qjB9k}YEi-PA5)f^NX z*}?QZ(bPSXbORd;1Re-Gt{MjMqhHOFhQ zBl9em7;?QmZEPM^c%Msx6QO{1`Qo-F%C8OH)X z-$#?W;n-pi>hobEd+HlTCNohzk69DGUM(}TGae;p{QN%vL|`J#i7v6d>jLVWKX4cy z?ofzWy$Hl*`x8=ead*MT}9 zN?N%MiuS)~);ZndEH(9zS*xCGfk(qeS-3Fcvh;;aA++s|7>R2r=%5}$aUUN6--lv9 zbg)WP8wq8tHv|#qT9t=tg6%7XU6cCT62+-H|nfcX4Ss1KYP9 z);F9|c<;Y9M8MNf8N)}d67)@sdf_&61cwK(2JeZQ*+rV8UmQ#}6UGlws{Eux#RVIZ zf>5;rf=cQq$ZzJ3D!<`HcMoEahGnmq)YR0&He5f4k4e?k(5*wMq;g|xKF zvDfSyTfDdgFVn`2zI=hR>v-l=$h>1cZRF&b zvQbvK^RBOG47={cW=}inEwN~mT=JouWk<{n1}^GqCoJjW#MQUF@j4)KNrfn5{^!QD z+HL;|5o(L{#nl^sljkz%n-&7h;bWv&ck6B5%ihBS4A=*pa4WIW(uf009b54kvlPfM zb+-3hOVh`tX4s>t8>FTr!(<$r88Q`cVhBC3ixqSJ7EW?zw3Ynf?5`TNN)kfeU`BeF zgs0`9^PoDa$jjR-A>H7nrz0N(S9)T$9%KD}?Dk9JvWLHe0H#d-2kGEd+mJqTVKo1r zKeex}SNp>;>^3EZ9>`8s4kT$XL#HkGR67tf+x`?%ro$rvvZ)@~W#M-tA|Hw?#loBz z)aSQ?E=c+S8h@<4i~5r$+pJMvZ$K=Cxl?Lel02gz`?oy1*R;iDQd6JHQB? z$Jy`(ZN89QWwngSrr{Lrq9G;?Ts?|d*7&wJH8uI0ut9Znz_hrXc5U`37PNSwf^&7h zP9y!sPYRc9)9wC6SxA2LR(*s#Es6p?oHRq7ba;wFHXAq|AR{7P-u+vDna3q2-cF0@ z%f_)vzv%~Wr1;99lB@$xL?((H*<=+SG6svFb#A?}c9HPrco8;bxNm)9UN(lFPTm6IBAlZJtXT^xh5dCCxEvT{2@@UzS)kI>vNb4Jzf%ls*h}$$ zZUa6~CkM{hX>!T0+Gt`;dcLg}f6DH*sSSD;76_RP+P`tF-3fxOdO&rx@>=Wsj$_Y( zbFxW}Vm=*$(8iIqqXnV4pF5;&4i4jT!k1sN9RdRF9x?K?Yb6A4*YSl~~14$6(f=BMSG56l!no(RmwmfEA}z%Z=b| z`EpE}2Je}m9L zmn3FvjPd)oD+97YAn7!!-JjSWw-UkzkaHAnC z_RlD`2FE>}^(_D|DPdiPDq~}gpfJ)gt#-BVfBu$)MqJKu+k+25V90_P)&w2>tC)I08o z{4?oEE&MZdxS31G{YsyI*0Rso>wR9QZ9QSl3=AWT9FWN#b|^krQ#+%r-Nk;~Qhf7~{O zF-CH7wJnP}TdV+&5}meps~=hzv2X?@EC?39XY-8WC8=N6xp@^VQF_8u$ns3lEMNQ= zlOI<5job_V?Y8vgz1@~5%W+Hmgh*t#qG|2pmBr}ayr{c-2}kv9976_VvPQ0)T|uFI zZnmO|ia6~TNv|X%8yCA7Lfy?y#r9kM$Wc*9N4Ng7Ry!D-CfdFRd3%kH;MFpMm@(dqFC#S%9_i5?|8xpEZyoCb;*Kp zrCwV}5XIkMA*hij{9a)CPu94e`G0)5_fTd^+1k@Oa1MnPdVYcM^o%)g|Hj;Q#nxcE z`mRw|gb9{`so&$nVu2@Ng}U#QQ~L$Ox`FcJr^Sz3rZW%3x5o$Ky1LX44;7dGMh>ab ztgXklj~xPhe7b_jbnx2m0D`-wg!q-gsv(wQ*I)YpR)SY~-RhT=cCL30yODad=T#Qb zre;K*`9`9IA-A}?fQ4+f!95+JFE3@Sln)Ty@7S8X_-4kDRwUZ6&m+sMUpL5kw zV6TVr9NO2OiyM_x4I%+)!fv-5SX9nf0(juhdmp_bK}?a-mIk_qsa7n|xiYgel}|0r zJz0{LBYfgUO+*)=(`3LDx3GObeOt^jB{Ueu`9JQxJPh!r;{j6#?98TPJ2kC!3tQ*; zjczz^?v{kS&bW`aB!T05!TAtB69d!IXgbyyysAD^)hdvu89h1{<1t48{dGrJ8=gaN$L@1K>Gc4kO?k|BjTr)&C@=vH{J z7$nI;sg~acFuwI&_~4dn5X2Dj49=%?JkdA#JYp+ka{muQ?T%XG5)cTpa|GpUF1)L(X0nke_mG5;% z2OO`V)$8R1F3}eJPf9QyLKQ~M;(ICxQ?cIHyMZfG3)-(oWFf?t0Cp=XD-^~*jRP6X z{sB+K8%lIN*1o#A$#0k&KE;SOV-+C!{0H6pm31!ig};V@`P%wvUq9-8Y9Hye(fw@W zee27^EejuCZQ`sJ(i{!kQY2t)l0reWSp7!+``rvC2o|G!8KZgi^+cni!oDHJQ`^P< zI~{YVpAr(JeLr2e69QNY0oIcE_w`k7jb&vtIquK_iB(vW_dR4$F*Pe6A8g}tpO?$G zd@WAX$=_=HL$Z`th1SOw5Y_r(~Tj^!!KaDmz+Z7mzQ82tZd1gBdO9j5~L0xpfrgig-Tupr| z%_junZ=PtFhlsRlLe4sM#%xtp+(voT#k*cqMIC*`cuF!%1Tx}SA;&+Lj*B+fjEuSy zt8K6#$@I)-x3rC8VwB}$W=wb(y zZs6{{jccT-d3-Qp7#9O81NoK3)Unhw=Qs8z_a>%mNtoO3AVF<~+|hx@Nf0Mv2^TWO z|EW0Vc6+=~CWE%z5}%~#=c%EYStxbOTTLr}C1A#e*R)FPi{iCAat^DSABn_pl0bPt z3h~wne=Fu=v|@`a=aTfLrq-hX4u98}o!th}8&6a>Z}3uze~0x8$zYO(RGM6`f{u`T zVpx+BUBY1fGw{g4J8ggDWcth-J2d1lGBVO-+jyY@Asv6;g=-q$T%wzrzIQaXqg%C9 zUQ${v@mUs4x1lkwz?_~rDY+cGwh^dmf`7G0U2<~oQhm|QTCL z`l#U`D`(PkawIv+a*O)Iva@}_D&*MB&VZhU7B{ZIu1*#0>IgNuXbbk|iLGDe(wCBx zemVDatnYwc8!iN!q!j;=rdcm}{bboKuJPpXv||V=qVG$THpD;ij`de4{4o)_|A^`b zf5SmTDrjQ^0==Q~O7MZeh5WswdJ?MNW8>>L;7396U5WwObg>BmqlW=I&ER<|hHWJ^NvM`XixF9RG8)|TF@O#l^Wbelv8| z+4LNR(-BK$65>npLCjc*}z~#?9 zLElPC&!HpbsBUv1%My1+NW?M4^*?a2vW8YySHr&Rr=ENT*5+I4rheC&egX6PkDSM@ z1gFIYBOd8RmRxwMzF@}gp&#E5Q$(iwNt1Cg?(pcyO)CBj+nAwg>Jcu`zqwf(SP3BB zZ3(>~&dfcKEJM2$&=Oihllh4&VE&gKO*8z7DW(7JjsfVIgKNzd|MrFhmy;KtUL$4S zGZ)@0?_Akt7;HoaPWsbY+y(UQ!b#oRuaaJF)C`<|^uZgfsdn!_?Q(mpSzKlj>sJo} z%=;&dh(i<6>`w~)6ZSXP5vR?~X(N*HAIftdMmySqmFo1y!*CU!q^K~wX$pN${+_!} zE;hd{fhI>G@x>PqSS=~L6rN@nG^qhJ(m#H&rf8zxpOQ^|nK%RmL(k70UfPnN zF%a41#lL=q(5%qwgIS;SwaPxN%- z8LXl1{BMpk1r-(Pw`ePJ2(W6;pNeP@3?2fw*7?N5R8D>5!Y%EQlolekmc+obl^R&_d%WgueH=sk7Uuh)X@JMp>|!h%iHPV5ynlmDY}9 zdc5K`+I`&t(76%AnaI)5rKS!5cwA*FOYeHJ5^}rd6_zuOb;%vYs*F}=407NrJ6LhZ z_z*_+qZcR<=E9ets`9Oj0h=v!1`s<2N*LCr{XHT7=ns-6r)ENp7Tjv{odTMcseB3=lBEv<8f`P z-514iefKt3LA4JFL*&GY6!?q-7ssvMQ{uiGkuSBQBO_;Qdt&5$;~5&$9m;+qCT!tg zk>l~I7X%nU&;^qd;`L`nNM1Ia8mRt&L_G#Au3w14Us~QZ{N>enM&`zj%+Je%|N50^ za0faYMNv>rS&c>}T@iJ95!i>_{k`-a9ed%0fj!;0JHNHx9pU+CwhaN{4ra}D*ILHDjkryNzDjy?sVKw*fs$3q5wQ?2=|%DgGBh#LQeI*lR(9Tvbruui0???gIC2) zPPtR_ib`w`Qq3Z}$>N`~!r#9ewic@QfP3l3h2Qmvf;mJHkYePPBV!UCbA~*A63j?m zlPUQ$-Vaw-SL`J1klV$4m4$vCzWRlwbiigN@>4GH*4AxTYJCZthrB4Wu_Kp%OW7J6 z*@w4IdJ_}utA{G>*gwprGQOinhViO|ppsBlzE#m@rHo2TeNKyuz>e`n8( zLUbt3|MEIeuFLh-;{rTosKJMf%*>4-yDO-yms3;iUA(9edh?wdKE-}?+$PsB=B&zg zn13w|^m?ZMnFDvU%!UES9HWbx#3 z3yIe)v6!YNmtKW899fzg%SVi$QaV|IjbWZRnzQEvp_KOZkPtNHuPC5axKt6s`D6Z} z;`#R1D=}#OPb@YgZ*3Jkx#`OFQy9xBsh8t)-a@GPdh#t!ygj%cluy<)X1gH&51L`k z%yZ?nx8pbKg__eOpZ`};qkKo2TS`a%ou&h_h=j#-F>r0ohuhhL#245e;1v{z?w_6x z0K6Girpat%VF6KF`*F~W;>iIp^&}_c(o-r0+ZPB-huB5C_fzos{-0#gy5?Z?i9gR{ zZam{y2m1bh3BaElU|3OxgN(B#B3;b$3j?&|R696Y=>A7!AlJx14lA-V z&B|({L)Xplva(}*JZ8PzL%H7oJ|$bGztfA(D1#0U@%0%S{9fO^LCTxs17R;OY6fi5 z6sY`3_TAlh)Ujy`Rz+{ZnYRRM8~}V+^|!0 zIonWeB~s_i*ult+^g!tkE|8aR?_5~uZZagGFd>>KhA`sp*P`ys>|2ra6HPIFS6==V zO`LvQiL%dFmc+5jnI$7j{``ehp_qt>=qtG8$T<%)WvQ8&eP9dfRLpF|Ey=g#r?Bwe`F$|K-TQ-KV6JlU1JU2CT9K zl8(Xwx;+~)=|AQKyBHd5{1*5qVIF9#pd25>9ZBH|qE^9GFDe&`@ztk?Bj@F9=-zTL zc5rClzohA};>xIZhj{DVae!fpo^Wz}4rKZY;n{Wfk7?{+btEqz9~qoRwx_~kxOMGQ zk0|+fG5+jr&BI?BX@2(Z2ZgblAvl7eIgiab16Nnv75Z)ATLbHT<+?tAh6LY@Qi$|u z*sQk4w(&g3xY>-^Oa%|ftu6{LXWW$ut_m9RVqkHeqg}uxLjE5E(C-J_kBvy)jV-tN z0I6-9isryEcWJ0C`OF;nH#(SUHFt@hj5>uF;-Pv6yEVDZ4JG{1un6Jr(&S*m#R78- zOl$E3l}ra>R$F2JRvV9Rbp{An*w_ev{)|?GWK#QyElr#^OPHzn%&Ep3qPkUa3;|2G zS}O{*Bub*7^#@Oq%sFX}Lb7Q#Bivew;H}d5OE((+Gp7M$+md1O{UU^m%k@IL56+s` z=~pd=K6x*g4Gi&eB8b9|2{jTRtZ~Z+kxbao3+(UPEgd+g7iZY5{w4|}6;|H=Q~rG+ z=mH6A$RvXK3{?!hb4a8~IFZB)isU{Q@ijT?Y<%OQ&1H;y(4xUxh^_KmOt@Th#pk3M}}N z{NVeqk4kR;ek|&;%FQZ~jJM0pZ~{s?Vk46{B$a7>sL{l<7u|f1W0qUv$qwNchwF87EG#RF#*{)32=POO&ZxRKsB`%-R((yl7j^2E zBzC~#OfA_I$P>=iCCO5Y{g_F(y@hhMQcbdket6h_bT`l#5u#?Ql=ziXpQdPwgnU;p9*JK|+f@HUP*fTL9FfzKjhgYajd?}2v)vey< z_~R$OQ67y!ftw`h5IWFd8eB69uLV^b(oR^ol|P9RyeUDV#J)lSo%q5Y)#zG;;S<-m z(cg{8L0%cI=mwRqiSf6i3Jeb8onMl+C>}Yn1?S63|7h}N{nhq}r##nC(QR}EsD;9P zH*IfnZVoc15=EgHs}zCQIZ8|gl%r1{y$vm-3#a^Gp7$y$DtuXn?t`9*QgX@|n4y^E z%;z*YGd4d=0euWVOA|k-_K5z~x}DP{HlVDtIez9?V~L_IG=R<5d%eBTfNEO=#4M{C zDVjYb%^{o1OZ4Zh=_*1L96t)`LRIcmKy~|W7&BaNKpeYzDXXgo0q?TEvIY;3MMb;r zH-C4AaqM57XhDx-V+Z=DT7*!{^ub@vi$6R~CBvp*{YS`MIxcR{b%N%XYVG^peXtM( zm7(FpLK4WDPDkJPHe6G~BYk!zIVghdOB7W{I6c1ba43>6IxM&D)-FZr6+wP31}UzL zhC+S!b+h*2f>S!l_C5~xd2iZp%;-ed;&$7ySy>Zj1B!u~n);q6{^i+-n4UN`53Ep5 ziI*gABuP}QOf1Ty%~DXM#iF$aG)pMD_#`Zg0qgCM0T$%pQII#9R6Fa*!@uv|b*TC~ zBbovx$rU5ga4@?>rWRWN3yQ*jHv_6arbGV94;U> z{0U}tiMys1g@$1R-b@F!s!6l3-S2J5zk|lDpxQf)lbmr)Yes40kVotyu{{iZLJ(tj zJBE|Y=ngxU)#&55)C?SxA~vv%0uET%=v7h@H&E z2JJQj$T)GfpCpu*3AtruKHhXI%+FJrcia1sILx5sS_Viba?t4*q#lG1929EZhushf z+IqVE!xgElu4a;mL~@0mjhc75g1i==rkCf%Zf+HQd2()NAUY}hcSi1RT>IYs_M5hwtvv_cu&pb-GXdB~BV$lf ziugypGuB4WjjC}ijIOQat4(O};+5MYEIkyw)|fv&w)!wSqM#^$=Nl`tIz9dQTHfyV zwhiop3Q`CQ2w()}FQhl89oUaIpTpX`Zab|wMA5k60*xw*r<3Lv775gZj^V7F3%uRi z1Rp$XY@(j>BBx8%;qIH;+MXwlkY!_(pwZZHo!cNnlP|egaLe9dVB*mu48Ys^b1@bo zrmED6h`6~i&u*8^YNdUvkFv>-ig)koNO(#e-syuCa>pTR*29{fenUvO`tF+^nSwr$ zpz;atWnk1(Q+-P>9y4ztky}MVOKbw|Z+O4_H&ik^S5teE49iu1ksFuET!9 z6bu;!b`4Io<08QXIarEiOPW0jLWk2V;WhJ%BOV{T%#GGXB)lv6VKMMGHZ1jWL$lYpLrHn z0wEG*IJPgZ?;pbCWoOya>o{zq;wtOZxD_1PguhoO8wQda z1G9rMMrkeQb1jc^&_A>XTgFAo#5&5qz7Ictpy`hac5Dt*Iq-HczF)s>SYDG3vw0FL zNB}abu1Mx~v7eLG3rH$Ip)c+;y|F#BCM|wox&!aI{7cU}y_rAiQCYZoqWw0tO3=nt zm59%Lu#+4M^3ewT!puihqu^H}nYbN`-kllipo0HLFm@nyj_C15IokEFYCP)jsv<50 zO}kLY;w=b=Yny2urWl(W?~hoE+xjwxj9V8L^*StR4BM4ODv`_3@sx$k{sUXOuD^K( z97=Nszx*{980GE1XJ@pBgaZ8h!Fo(VCTzmwwWDT*w$?HUDVP1rIyiXNJ9Oj) z)6T6Ay~8Hn55J%G*Onqb*};8&HoWr+JcDkvf6$_Y1;=Q^d5D7g=QC7QUvVArpNRa* zGq+UNfN3p#*D8D0Z{{fMx1Uaj?ul12tSJU)wv(pX(N znmAk2mOhE?kExOqcI_f`WM8Ot#bOu~?2WL#dBPAJ`FC0*)Y!j$I5`80wLO?!xUmD$ z-kfQ2iJYYC_|XzeS)ZBTN5#_^G9~AW_AT!OacvhbpM62~HoR{q$$O~~cZ)X$=hy%6 zq2-^9R>FJx{M>6L4NNDhcjL_%YV?jDjfZ;ci6IN1EXWQy5NOdc@sJ^%gYX!>~U1mOqGT(w`mz9}$&QMADhxqC99_O%sub4Tkq3wI93DjPDtu^nYns zm#A6&W18UAv2Xe9$-*)b2~3h;yq~siNi(uQmw1-L#q^A>K^ zt)8U5@|VLpD1X3EoDSIfGp-R9eaQ6S6_`jzv=6Vs*nh$(z>=zUi2HU}>^fBR2+w>a zc|#ICJOU!}Ix=~_7L`_5(#Fj<_RMPLp)2N(U*{*zbNSKNA>qIIt*7V+Nj($jqerZ%qQUXHt}OeMCQ}v z=~otLs3Kq!Ai<={@dtM42lx0i{cFhhK7{#Qj_Q5%7_j3>vA^1X9~GTdkW*Y#WXNJ~ z-@H<##c)}Vt3EfpSE|A={XI3@c)t&WB|W-|=U-I|Q6kf7qcxgYN*2!kNv_^O2Ja@jnS+i+nv>$P(47eD72_GbAJ= zBYS)LwU?WtNh|fZp>3dcfCu;!X>TlgV|xfAH66cLWH6sbc^;Uf$k9#_78eZ6V?^sf zMeBg&Mlc^KRJpIa9a4Xpr7}>-B%xfpDN`D|%c8=#+68nCwo8IsP`!rcA>gQc)9rNw z0-&}7xALd`?aP@T;w%h5M{a%(Bq~}9KuZj0J;U|!VqkJe-l#kCuIB$Ia^E~^mN1o- zGA$+vv`5M|)rsc+f8#jbEjJssCWlN$k`s-Z$=)LmeD54|pb8f8X?i?)x8if_^?h9P zeJnLArz`eAOk1F)K2PA!pYT6aq$$zi_pkW@F&!mw`QM&_VqH38-NlE*%MUV1#C)uf z`r|=d`?Tu33j`wTW5QNXQyjRV!+Uu&k}%++{rVcQy8MP?+I6NtN<%RyBXz&<=&j^| z4qxU+mX!~Q0@2+Wj?rdNA`N~<`ei}*%|E=#YW}ExfKK+cir~4gy zp_Egm4ch*J%VD0Fl;csU7jYZTC^pfxOf-Hw5(zP+q#s6DMS$(qDY00IVz>zsNXiNn zm3w(xE=PxUrYyKo(NVn)gJ0VqU-DAwh-D;Mc6K+2cp|PUpmb18XTJpg?H5Np`l&o* zZLi*Mt$p0l9)IH9jyGH*$ng;buwU~0#-rWP;{6B|2g$tJGUzl|E*>qMNTKAV@PVHs z+k6e5e}1V#JoS5By*mp#?O)Nuo7`uoqUyK*+v`x;#m&kZW5XG#$0SO^ZuT3Z=Rxn%yXNpe|557KqC>fDD^$+S1mg@0}Dyo z8Pxe1JX{$9Rc?E+fyt^C<>SR75W@a5W-Yr$!zB`lL|(*xyG28#x_bAN*B|5M`X{Y8 zQt)Q!hGIq^O6PkQ)WFBjWB*Fkc0S6 znh=v@h|b+xR|Os@B_t%kkTMJgMnZ{3Sz>AK56vUmHsQ+o@p%PhZAFm+Iab|VVDLO65;w8o_JF6B~y}i?C?W0aoNpMa21kKiVhafhF+Cv&^3` zo1q~L(?rc!cv0R8zR@U3X~+SGNEK2_Y4W@xEd~{C?g7KkoMYhPHo3MHS=9&1h-+_L zdltg{>Fk7X{fFNvDR|+VIE-FYG-l}Nhy+A!U1gQTU4w%x2qAko z<(*No_kQ+od1BzGBOLG(^)Tn;=eY1Ij_Uu0>850YdHjvG58u7(*m+XZW7KFRU;^ID zLY3OnYDtSXL1SJRrLsWZLYM9&+j1ST`~XWLq7G_6^*hVtS~;be)V`(1nvMx8_!)+p zMVt8Xs$Tk82(e@iDH!9VFQCvV9D1im)R~V3Td!4~Ui!yD2A@5sdWzwgeATLcADqSD z-Ulgk*vP&pU~}{3bd9KKE9N#=&5ArJVr!+@p|s6?cLc4!UxGFsNNWRh$|YbR$Bzta z7r)f&7);-P6^Mw+C;j3|E)y0pWF(SHEp{-~UPY1@VCx>F&)v!-Q^2V^njVt|PL30O z@vCOu(JUwlBnBop2;j2ZQEFjri%{kX-cw*;aHiKBm0=YIFKY0O(mgRSfors#9 z$Ohb>ET@@r2ox$YvU6iyQp`Y*FjaAa-DlZT0hiJkSH|N`u_J0*ecoCiF($V%8Po>G zP*bIBc{=oJ!XT=(TK=iEIbHsT0>)HG@uOAFx>Uq1ViKshV~jE2jpchlxQNJ~4tI!| z9>U16cBoWR$(}yI{ClpYD>YNC@*YWEYhkl_(I&3T-xZT_{Adt&|KGo!n}0q{=lvN< zOkB!L=B#`fokIydAOc!h1?J;YQx5g<@2FJ2cJD zE?ATYDRIMCXwm)Bq$C6cg}hNcJ;iZSBcNRsV&aJ6DF7SR^R8_6COwq;NZZ7QLwB&) z$+@?m0@w2#nwv{O zpo0d~o6dn6S@01$WXt>YI?wW7UG8teHvK?g8p?W{ zP$-s_LjNNRf1uH_ODyn!fDpn19n@AbUx=szIMjOohcvZA?}!q$(!_?!X4>R-Pw9{SfOwP!3(O=}SH4@%_BBy9# zew5$7X&uUflAHTmb>1~^{r}NqHchGgL%q&5vX5HfX32M}+K#)w9|uiTOqQ9kq~mwF z6$tZ6U|@`q|92hxcI@KSZ6+tvb8-l4Jx^J`_BAFS0h@NdJEg) zpK57GUVkC%@Y@BC?)D{VhC2MKeYM zuAJ{Ns#b|$A3vIJt7?ifYZI2_F%aSW-aj&k>5|Ned(Dy>g*m#9>b(T=Nxoxvx!U@-r=er z0^4lO%qf5-)0{K{ePnmXWZgj#0aB>t_#HS;=(qEfPuOZIh^Jf~b6Ck2G_b3jVz3|ujD%~R+v9yQKv%>|;Cr6`=(j!0~st2TZ zBsz-sQXAt6vWfW>#O(cybS@E!YR`g#yMq47X>36%M^tnmFzH~YLz?mSGAS}X$b7Gy z$5cM=9F21xmPXb4yzQdjVE92K` zOJp6Eb$nlCT+a6th~3NfiU@?+ek{dpX8%!aZf-uEB47_w&;t^G^{MF?A4v+Aco_9x^cN%;fr@rdlC_69>%3_| z_a~9#nwwG43Ow|NZ(;VO%6w2RPqqxJo3&C-uZy=Wx04jRxa?l?e0>>INGC-=(}5Ic z$FBV^lh4=n^Phgf1FiaPqgFH{42|rWnpBaD;OyE=Os58Jb*=_7Z{Wy*!qo7 z0`gMk^!Ch^(I#y;$=G#D)Jvr#(51#G(Q+cl5~L_{{*YtIPF9 zU6)@SkL-hyDMa^?3=In_5$oLE=AJdo1RhV-TBKz0TVrlNlA}qo_x8kPXCZV>MG7L8 zAYgC@s*7VMj6H*h*O-I?eaM`z-Bjfz!Uq1c8$?W)g$x>k2%7B7$HPPF|4lB`M6hd2 zV4x({a#?HsL|LO-sdH_eV839It8AC6Y#pbRDsL7iZH7jWL-w8(Bd5UPfvel(ONMsT z7%9Abd05qf(mykokA8;bmm%Y<8H^@=LN9mY4mZb^584e}DYkA-LSH!v_B1T+kR&AE z7?r+ov3P1PuainE`u$6ciMUyuArUMT=QL)hkmN{8oGwt_Z>kk#x}z zhYBH*so{03>pzS zdI<5991sV4fT^#)H2a0PU^TE0M;JB$aqt3!tr2BN_oy`JB*?uP4Q zNx*;O_^d3PcsQsjbXY#th6cqH}k_d%??n&-jxiZ_3l`X}mz|4~_rerma}@@q zmNL0pqk34^)s!i+^!80Iwqb8c?Jxc-539Di8z&SVHWD4(>G*Z|E%2L6b(Bi`H<`RB zJ>IZpi}<-+b@7zP~s zXfQ7@aTBCQy8qoMi6)z#IoB__TYl&VwKU9ILWLIYM0MtUA{!uUO`MmG|MrPAm_ky& zAE)Ea?d~s52VB`~u+G0|#0@rFf-G5|m;ds@opr+h?syQJ)xtBSK>2oH0E0(=ns(Ia z&|pyNi9BCjK~qr`0U?GZAhJloNUPQeMS`>{d)1_c|DsKyg%n4+a`ciaIbL<%pJp{# zEMD~KT5czkZ^T>9gss9PdhbwO(i>Wc-jd4we!KTVrmIZ(TPB(PLAW2Xyc?XS2TGi> zAR6*F#9GnvALC^P7x(w92gf|I$LuP zqAHQIN_z4pURszRwjFuk0jg%{@X8!izUcI4>QjjIrq^i&(+0OL|=Jhf?1m;WbHe=y@g;&46tc>Ysy zHPTF#{5&{30;ykwn z{>9n?Tw+1_dOUM;3eZ0Xv#JPz6X~aF2D1O31^}r_KR?i^Fg0 zv;_8g(>hLWy5xJwGK+HqCU6F~f9F=|@C{-*$9umr-G!lA3q+}l&X-U)>m58X9F9vy z&Hqt1QN{aVzNa*TDMgcMElH>mVHzREuoF2m6WO&7hoAN-eqw63I|DO&k5-l@XS}T+ zRh{eVGZQLMi@~oypET|V0pO96d5H9Z{y<$hkyxi|^CK=%7^o&u$i36HuG}Ecn0C}J zplzzPl*-iKX2Ws}hm*^>o%jEJ8^~an{;2%DtBGA^3u~wSNdO)C-DuI&v3TDX7A1Kc z@RHlxg$cRs{fR5*>Ay+rNhxJ!MXS`NfDvMDj|*J*s0*II=g>Ng@6Br8ab_TEl>Lk6 zt0GXg_)(G~0-vhvEBF$rNt-^oTQ_Y8Mvvh=OEipgxuE?P6lrHJPPK|H!D~}VY=POp z6Z)@Re->P(&^$f=t$WFHt=SMU%5WRDXg#_x8R2lTU&&=?|4|XLY2Zjxh%1`}{w*b6 zZoc=<7VDF}&vk8qnzVpkzv~xLl~7{A)k!8|kS>9^Gh@Kc(9X*P1q&o7ScoXlr3nv? zj$WE6H;HY->43Wj;Lp^8{(@=CMu*pD)GxOuSyF`&|NlYUotUl#EbG&0urn}COQs#v za3m_{1NNfdfJEmfA%RK_>wFFRJe46bbZH}J=ftTW<5>j4@C^SmPYlj zHatXIdf0{Rl)j1uy#Hs>uTmiuHWD1qfm}NZSv!lA&?nc})s6-q4Wdy%HtFowE7#BZ z@+{z^@OewOm{579KRR0;SJE*cxp=`5D2Q~1$D}#bgzc&1OK>FBcxW% zErVjeekCdeMbF*Jo-d-o{h!ycEWSq8xBI}5NF#B5G;PH}8*%=$MM%U;gj%}@Q#Ko* zWP!MLk=zJrk*iZqmPAKNoYM!yB(uhZAOxSED|`M@`I)Q7G<7LQg&{7QE@x)-t4=wj zFY;$nnRAI;R+>L3*G}@gO#By(LK}xAm7@dJ&;orv!=bt+>{~Q2{f@-~82<;RS3@_4 z2mbH5KOFD1QS~}L`Wpz=A>RrJ08R!MX_OojuPkUPs?T4}38k72CJ0QgSoZ+ZsLU&?@)NU)+1U{`U$EW32uq0;ymN#Ee%S|8Zsx8D$_gwZg9k z;vMe;+1GDDu$5gadf~+8`Q$;9+A~rT_e#MML@vRcxXu$t0WyUFB6$&JwJ{dXMT{&l zMm9E>-=%`{qqfeut?GFhuqmP>K4Mj9gvch1K75`#m$@X!$}WzX0_Q5?^Z5*n4_HX# zAlh~ixHcxJ0E$y0u&)L>>#4rUx znDodq8B0Hw3?8l5C$@iQz_;nYhaKqek5d@`u2r&B>e=>Aq5yvVVNUb>`E(u3^C~p_ zbL1NPApKhiJ=_NYV%XgL7awOa?0}Yft9~UoQK4RkmFQuCF#f#p(L!MAtN`Y|UjqSy zPRf>spDsW5oYpk~xnu37Z<1)|ksUT!5~k1meS;)&6iA8FdF6&1F)+43p)UJAx?U$l zhG6E%WodKv$b)Te+o@zvZ9Eb=lk-_3ZohQ8Ytx~V;G&1aj=@ zdMJ_)l@0KQk?s28r)}PL}_3>l@DKKwpmqXxpy^dlbfFuDslyYRz zP#?P-Jg~Z5g|&F@ex!{ z0DNGqjq1?4LC4ED!#=$Y1F3gdR5%2edLj%on`)BO5%7EY}fX7ZjMta=-<0-oRpD@vBL(7-t8hkCowQ6fc&@j$~iH;BPuqhV0F{84MErlQ<|!Y6a9A>b61p=y>uPh*4A&QDy~mqJT3_38>DLyps?zJCsY4n0__}4j|gIF z?gG#DX@iaG*yyOTS@aVTSDIXv&OaJVw!4SWTgs$#zxEs1}jBGjf+B1l=;bR&DKQStpEFR0m>lS*wT;BrCy#m`Y zD}*b@@05g<^8_Rcg(|;>F^xa>B;xd!q9cSf;37SV5)S;+KH-@e{9(fxq*w9nwslY8 z2^iP7m6mB$$`0v;mw4M@IZQ$qD7*f}d{;B8Vv7;ZBUbSKhl+!o zoZJ^r&p@$$@Ri~=HOrHg%aVS=N455*jmq#wc$Y+*a-Xz9(d0PQMn+RbhUep~3Nwp; zTw0B}&mppfg^xDN2yw|ZW0@nJyJ83&$e9J##L>3FzvFJLtc0;ZxWD_GXx%)8G`eN2 z4Ca66Xh$wPaU?18n6-09ahl> z<}V9#;I)yFa0FL3A73>M?-fZ&){f?1E8#`SO9Fa>R#S{MVE{Sg{Q{SV)5KN+-qST| zOx`sWZHZM;BpvD8kqdiHj#o>To*WK0ae|+H~iU z)7{;1ba%{jw_%uWraL!1J#5%?Gme~Qx|{d@z5kv+9M^T8=f1z+PrmIl^IWTXzUt;~ zyONb_=0FR72}__)$vhaMcslXFnM@!TFNH=d9#T!7x*dX8$0rC*)Z=nAdd|-YEP4nh zcVRih14^#yHP4HTt*ELLKc+NVsgvd7F0}mnrQ@}$MQ17r>NF;eFr-`G*NB##ZiPQ8 zsD(a)OOQT=T(;OrG^-w#N{Q@g#VIf{R>m$w0%CjcWO!B8)Xc#4eCqSM6q;0|#+1hN zMyEyZb)A7DUZ4d#p$QEeXQ9SVJKi1(&8d<@Hl$exkNf2luUiGHi;v%3kiO$h4p9Fh ziru0?r5*~$X&8Kcwnw^Mq_DZ;HZW?Pq_(5MtgX(LemX`*9do+p&@?LE7DdoqyC zu*Jio0qHy>vZ9Kwe3$Lwam0NwMc5l+_e$I`*?eSyG}Cy}n@XN4HI5!PE?Xj|6PpVp zM8C@MD!nWU)qA3FYuBIdyTf}UO+UgMLYI#Uc8qPTER2&&-bxoY<|EZzB-#VavWF!w zLgz$8WNqA)^xB)WfA8&%^gmViQm8D@W6$mPi(D_oj0bGb)p;LdXfaVMmZGxajI>#^ z^WqcyvDUI*1u&mLg0QpQ+&is!`=)RxV}e1o{O|QlE}B#}5l*-Cte;k#jI=neR-EoL zA|{pnc16SqitvPF%T+vx`tYC8I6lXwidL7&86N6H+g*giyZGgtd<@X)pCmi^Va9DI zVuWZps?M02q++c;fTu3MBQKtltwNPCQeaS1WKvydQdtaTl4_Sm$bbTSs`y|Z(3jA)v~5~YXUjO5QhNKhU+l?S`01us%VgNT$yA472dy^TGL&+KS4c>x zg*wcZ{m%g)}~#aQY3wE$4+q1)y)J$j8lq`A+)R-d@xdN8I2b z3SP`BH)WDI`Zt>yP0(W*wM`R%?)N22qq z_4Tz3K_>?S0sB$d(GcLhl5%#Y@bkNyoa6hnvSRX4(){8oV$J0jz(an%In5fs! zI$rqd;gnui2j6dTFffvIT*Q4E5czBnfv-ivnkqDbY{xMlYFM{_BsL8mYIHiGU$0vh zKV@d(bzN51ZbXU&yhuseS>Vm{m4W7f03aqfel#<^u(C zxPJcT*dI^g{6wz#UU)An<{9#y8GwRc&ZweKf%i2(JFkOKkNsDXurd5KSa>T)xTo=m zVn?IeD+`cgjXIRdZr{h~T<1>B ztD{K&V}G#h@42*nOr50A77ix1C8CB(bIXM%by4~OBE`l|W zdG4u_D(|LE2msF8`bgfMM$stXI8phm`aM3XB{rTKx|t=P>mQ!}!6N{}y&i9>kr4-j zYmmE?(NO;C^o%zW%zloK#>`?V0d)xiM)O8wH`}ZeOu;h8z@{!$Q zz!xDlh2*Rkx-Uu?;PyJiZ};R&)Da3)2wB4F5k7B??n0KAmqlN6cnAjI{a7aLcQk&~ z7@%;+ZZpdJw|lVEhUUF|2^a7ep5oU^=b{;}p~jaeE%lCBoP|jxGgC~&uv0<#R8&iD zVzYWkgl#cg>M#$OMy)vC^;t9$Qcx6s+lz|guqRC$wuX2LrVN5$TZaiI9-=giKcwZ^ z1RQV7V>^CSSch)-dVG&3?wvRGYJG45m@x9iN34IxMZei~%Hybs(Pc$^I`dHCV(F+* zsb#R6iB+N@EH>u@^o^f$KT)TAmI|=P|K$);guSorNX%sv{l59;WT*R^>Av|_#_w}0 z@b}Hx+-+VW0-=4=&jo``M7eajRmDwx4G7HP!Pi0)!5g)9Zikl<7JRN+hKqLGKP}dh zhTi~Plk1ZAD&OgDF(yr}Dh(ELBI}>EPkk~p3R9`H3eSkhtCc#2DVfS;1(%-*W9P#3 z=VMjPFd}=y1j$wkr(N@3@H?`!#Z2t^;NYF#lFmw^Mf$s(kG5zsUHl9K!*V30g0Kt= zZ}yI+`DdCTprHHJBTrCD6bmOyqefOPgN=pIwEs<=g{ zI!%;KWWS*CzJQA25|KwbGds69eh4N_JShJ%^M=%|^6MWdW4wm8GmvBD<>C7k=wwt1 z(<&fZoS#H52)+av%kC%;R883L9ky??c~IOG@Di9JRZth1j8B8Z{Kq+U1B^B=;7kC- z<*oiwdMhHgW&c$NO@^*UTSyU#cm?L-ZieWkH5d%`uDZX^%;>eIA|W%l&^@!1%L0YR z0||eKkoJ4N6DdUhXC}e7M6n3k8UCLQ&yW(AkncwAG{-;;Z z-Hwh)Hs~Q((&61S`sYca%`G0|3VW}|m6l-ApUh6P2Y2t^Xr!icGTMMO4tKVXEzKU# ztC0+OKBSnUHfj}jhZzt9h>f|%g0cg zP@0Sb#0Ew}N|1BI=O%J`%cM_5fUuC<8wmG^7i8Rl>PK^r&`!y>&|n#=I1)2?5NGQr z)IMLuu@m_KS#eq7j`%oF_qTsV77z7r3zDoQWJsdYDWOA+Iu4y%Eq_Y{7o8I2kiS-m65q`0`nAaYEW1?;qJN+h&rj+I&^?)#Sy0dnv2b{2EL zUV2naE+|_Cup$b-K=U+3*O2C-^l?r`Y-JW3xe%T0)f?druF&1D;LGNU>Em!R9{WpS}>(zxxr;#vD9 zO~1yoyCw~WQ?R$cBmSXAt8k;io#msrf6C7LRvFHmC3D3@@59l!3+a(Q^Ch-!Xn3y9 z{-q#lxbUpzHy9})=~Be|+D;5z)6RTq0`KFlm#XDaq(Q#e%=qssX8+NmR_uWFC$_YX z-I|y{M&evpEf+_1fDw)sJ>y$xzZF z0S{%tq&hK@0ZW5~Q^celeX(H|DK3#I01RJdFTw$!V={InF(IqxBT~D9N9ytZOrqxR z=&1^x#Mr*1{9z5pULz){+%)$}7O++gg>zrfNn7pbNd$+j}%^JQkyJJ9Fw$4a{rqwv$GBFG|(4L_-(pnD@qRhZA& zrULL7PJ=iGQ!~3=e#fez=9uZd&{_N3>qFiu5gLWhNwj+!A3DT{<3tNDeF(EL%lz2W zrPb8t-tK#}n`Y2{Put)xZZ2Ni&Ru;Y=5A<&_Yr?+i&Nn5nFYPj%9;xyJiOs)bBl2T ziBl`wV)LP-si}`>bOrQXA{HYub&QD>P}}|v=OGrT8m_=2ozs}EJSQO@a<7_21S&W{ zavx4Hq$mJxPF?e}JZ-3taD)SIoFtW;tZ((70$*ipLKRxGD(ra0RGKf-K8!vhYDqEp z9cdqbi~k=?m4r9HX@BX`N;cz}Rqq4NN0i96)G2*|H!A8g=3wD(GAiAbLS)-TsO2C1 z070Fpyin@C^8x{~2AD3R>s{-r{MTJA8*`Ood6NHN!ACcqgkR+97sNXYjjLxL^Y2hS z{Njx3Fx*y}|Jt2vm2>@Y;u|mLQd1c<^YK9*7d~eJ{1f@)?rX;!-fWejvpT)6R{b7| z(nj-m&W=77b0jtIkecpx4Y6l?tp6Nj^yY=#y_qrhkcnj zGt3bkoeT|nk!(pf`ViP4Aty>{u^Uj06dRO}4L7-^1vW3RIE>IL40%JJ*!YN576wu& zbQS4OTJNhDPdbh}3^uT99Z7{Sel|WAlXXU@GgIFE&G)zO*aW1LR4^-cb2e zM+gjwCsUa@=qXJyx#XQfGC5GLKMSQP#=R3E|NT3XktCL{q=nDt&5vise%BWGob6Y| zTK&x(9Z0;{Z~7A`O8b|b#vhJ_277)ZHc-7KIXUZrewj6^pP!hX4s&TmnlthLKuzd< zv=k;ziI6|8TKh!{L5oS-4dHX$03c$+1qqm@M{c378|qm}_J)48pu2q7*%D9@uhfzg zHI)?2m#Y6rxcHZbAK^lThB#Qx*LM}5VFrcpTqk(>g42CIg|q|xnWrQSXMU35f3 z6MKFB@qt5Ip4lL?7gdS)_f!Npzie+_{<2zoZPb3etPT4a_j#^%k= z{6{s^1!ci6CH_?V-3=37!@ zI$t}jwF^r8MwbSYb{FWrf+6(n5{~?{HNq)%=Xwr)vE=MV8eothCu70|Y~UcXBIa%I z?f&N+(%v0VevPMX*<>)7X{=(aY|`zS4Dy6Nb~^a z{ss}ToiVfkHj`8bL4HYgwx8DY?vPC#U}TnsvMOIni2wx^B-*Y4+tY2zMUwRh4ugfO>Id6o4Lo+)t%_qVzCf753o%Y;%>wVkf?oxYyq=fdA5MFuYA^$II zXx!rqUPp#BO0`W2aY;#$LX|gRek`@9K#T)Zm`-u!*UX;Zkl1b`eAz3exR(f3*!013 zsr`MohzMuiLx*0)EiIUZ>V$>r1c-=;cD)Vd<(QqF@W_!;GX*aa#TbUJ`LCAv5=m~u z{{;Wb>c?4tf4=NSRb9=jSZmwqj!?XimKz(@Gu}M5EYq7lxI1D6{<8GdKL>XiVeQ-d z9(T6~D0w?(?8pG%28J~}kkthoTev=#v%TMT5M&fh!h&BF82h{Zj<7yAIE_^T=(>aO_-g62 zYw)1!Jh*DuWb?iQNBmbEq^`$9=M4aA_Rj0!VG5s+1w7wh1C23ubSm)hoOkFL98fYg z;ii2Gb!(GGH`KB%=nj6NYvRjO)3!}ns&pR!2l75p=bX94J4`^8ga>K}DO;4x190Pv z>b2gFpWk_L7sXSPq#4A4twDHd4`J3`nRXqB8hQ>KK29aCpAyQvNmZ2L90Km3C_2B+ zBxzY#8$X4Buc)>E;U7i=GLP>V7%eI73fHf%ih}Pc{aUVy%ex79JKo5KMHP`b9i89dvTZw%8{qP5d{{5=+tJBV({bmn z=neL0O}Czwn7qmOmgkBYd($Bz$}bDDOl9&xtJe&wr2S}bg~Qx;WEuHs@ne!i{(1=7 znasT8(JRsUl5}X%2s{1LVv-^1v}rCe%O;j-p(L)@8nPxIkkPwwqZp4KZ+#a_UM?`y7DKJ6kX z(t6zGys@3_EL;626!x`03fJ~Dj3R(Q?CG@I($DXuUuOtDP1sNN?wFEr_o{;;xH#E3 z;_uwq=v5;0LR&!e3yf+&J9<=Xd3_|ZdyJ`Z_l=h5-J}LJ;V-X?&<4$ZX<5XuLOL{W z*p`4!=Cp^Fkj@){ES01oNk|j1Eo1>Gt0^;cWVnfCn9_>;;=pKk8xTTGnf6Xagm2YL z_U4r*Rom^Sex*2DF0eJ0H{-qc* z_75(tBqAd4$cR$^ku|!yJ}WR_oJd84L^qI8OwxQ*B_yUug(Pink7(dzZ$>8%p_fn&CJFva$S;`x;3;i4RKZ6wotW?vgMC4=Cl zZ_kld{R-bsfI;EHUm4?XGswT6p5QL7oquWT8ppvSVE_%aBVN*9w_7vL({q(K2CQ&# z5je09+OKnM|J&$YU6JhR&Q1a}3Bx2Xi?Q)$A)2-Ddmb3THZi1E0!2|)8&^lY+}xz4 zP9jPjmH~W!^ch>mFzp1ShkD_>GJZR#bg}6vlx-$kVJX?we;N7GqtLd10NxOZqs|h| z$cccIjlqbV;I(XT@|Z3Yp2ol%brw9v1s4xXotl_;FQAH_ z@!NDS0S%>z^1A~fE0aL8t<}%ysQn~s{=;v37yL(~b2aT}v2PQ^>@(uczS^Ru2@;|Fg8XxnSDk>+JzI1yr!>|+s`%p(aF(ToeeTOe^(oAphFv!~9OzyIP@axfD)pA@l zu}4VPMd>fJ=(AhvRo$Q`c+3ZeTdxGsJ5AxU0U8jAW(^ROimt8)lOfU5e>YW7t>hCv z@k53r`G`Y)4mPwhNe8!{wG&6-@kh9R*W<&HH)C@HRa!$3e6&r32ub7Ct#t3{V{+e3 z37kPInupQW)B?f;0*JkgXk^2=bMd*V>hF^YDa`e9u|UFcv1jh^%xq<_Cb4}UEkmP5 z{r1;_LB_-ZcyqvFB4f1RfPwH5?qDU5uBLTe@nEGh!wCt|kC9BVR@Y?CL9t>0QFWt< zkx(6knw9pUsN*ubgHV^8M`AKi+TW~ZGOkaiIauo3X?6#BXRNif^wcrvW^+S`G=BZ@!bmdKXe?-=|MaT zE)H4?*AZo9OTPfr(*c%JZf6gZV|VIk>gwt3NVs(V!} z4t95s1i7p05Q;UMQ0pmzITRq9q=7p`C);C1M@dgz^J28W39m#4J?Z%YS3cD1UDiJK z&e7uEt~00a+Z5KBwB*l1Gh8XmZfp@=R?$sY^r5^5&uPJ-V|9L&KL~2m8Zd3^KLZ%{ zJd^UnHt=AExbOUSJz65l5f%BUS*~hku}*qxQVPxNk_D!SKEe2nonM};f7ZjFbOD{u zmQng5?&t^vIeTy&b=^OS(J#-Hj7 z&Fy>XOUcr1NM1aB*l10AODMHYp~m{ioQ5isF@NZFu+T(s9CV%Qvm@l(W4P)E4{kTt zfOTAovcW%VE?s*ijB39twX%w?j=GSOvFeV%R^PEUHp zdfmq#UnULU3FPC)pyS76LN6!0NWX0cxFf{l?-*1o?oEak;JwcvSX)^MQjA$>+(9++ zKWv(>w?vaHbh>#o*JH8ID&(ekoG*#boOTap(Ap#N*-p+JhUxT#N=& z2VMdrHiBkA;pgQ!fmArO!o&pP;@0J$s>lP6g`MdX?bI?RoPU?}F!G*I8*ckQlI4S> zPZ)|RZ@nG_NzmQx_#T|^Uwg>zTjw)-pD{pkd_81-|C&J5NKRz5)Abv(yIvbg2rS%~ z(|Dx`+kq-(4ZP>V2CZ_o)tl%W8Zs@)cyz0& zzPuUAsV(-^yQ;T()*_!vXI*sNo#;4O!we=w!Z5<@$d&74D}ug*HuoJkI6Pfu&_MoO z3U@tS9;v`J9tLy5jxt)1eN+ko|WDxZyMVeY_xy;t442aQzw=R(jD^50X zbX&bPW2bnGHmZ1(0S43H%iwMQL6{vsRiCK`p@bGE%clI1x=qX#zU88SUOX3;BZ&(P zTn0S81p9n=O^s94yZPzqNLIr;kp4DM#!l#fXZ&SG7J*0WJvTz?a1+{8fp&j@dDYo3 z-eG$)@EYRcWk|5PBA(_yqX#(O<0(HKW_Yr>n+f6K%?YqdEb{zZKir#dn~gtHl)_`? z2~6H$)zIQZ0>wnYN*a+>4g_ky2UGehg%wJnKxk3)8V>fheleF|Mnq>$O9D%f_li#{ zZ^Jsc&Y&6)n2EV-Zf&l;=*K^*TUJ7Zj(jk^4j0gilcehBrKvRvyN&-dquzHLbt_cT zRiZWx-5WzvH6R6#c|xaM*URBRAH)XwJ(!-(#VGoU6GWAp=)qbOAWDG}lj}<%!1W_A zeWNwo&%dJ^2WZkN;R(zg%sv;iwy|Gce0+ZU;hwbLbuCS_%^f*|Ue>zEtJ5y)km=IqgD;>UU&RF zr{{dV`K!UCwtL&zk{XQY6Uj z{Dqb zv+o?W#@(sovDD(0dufe=aYaGn_j4TSCYHe!c2wjhsKw4`uWOvR&p80ze`KfaE-!j{?Q-PHXXJnU zf`7ST%o6qBMfnC*)B*}~>~L{uAp{WzPq$2eqKEjCVljjqKt?u=XZHbJs&O;)4E?A7 zzWmqPq_I$uGB;wyIeE35I+v*|i}2Ezz=QcudkG%?*TpkJ`zBQDmc2{iX6M!T{n}t8 zr|w5pBkyHTLc-m`>jLOI%4`t|pF-}L)P*KD861MQn9BhO4-YhlmlDa+o98lksL{24 zCx4qjoQ*-iSxWwo;Kwju@%s(eWc@4!iX@^*F}7ow}Y)t$6E z>q9mDP%mK~x=s(0oQ=)dcb~}rVz`pF6g?kRofJ;t59&)*RWB>EsJf^h*CaJuy5Jv;n0Ddsr#$~$X}(+;OmFI z{33iY_~V~yKmHyVoC)x+Ag2VA*bgSf$0kksX0bXxzW5UC0;|;yMD`_X)Em+IV*Cbg z-!qCDQ%*Lb0_}Vv5emUhwn_ex?&@X_dv7ifnink*=f9Q|_q4#X zmG!X|sKvn#BDR*BaHbyXRj%oEB`jaQlOEvc6xGpJRi{_Wx2ryt;{yz^;QzRD*~x9O zbZ|gqP|N$lH7*>rlOG&mAJVtcc*r*8#Pp*Jzx{$0k06bhuI#pdQZ*%=?5kUw{Q7$1 zxTp-8nzuLR-Tgffk*OXmdb3^~c0}YbgU0a$xhON1G=mFgKi8R8z=86WhYd87&Q#$$ zrW!r?m)?I%j<&9EHE;39Mt-d>VvwtfU3zxQw0=r^cFR(#JgoZX;(|6UTb@2;hJ`+V zyiluZBFlm|dto_X^nA|N14A3~b?*IPv8w0S&0zSBWt5I(S!_}uW~*R~K9FaMdyz9^ zt}hA_$7Bk#l>MUhv_#)h6UUvs8iSQm-^`t7*^&4#yD;(E;uVD?C(YR_WOx2m>Qsg zw|jfJ@1J!PvwfK;*noz5lhBPp1<% zv7$&Xv~q^cozA!c@0X;6Yw332ZQ$ru10?OARg4jf4%N@UI=-nHJ$|CEn~D=Ur4#yFO)up z0Zj=BaTlMP3xUEA_wSh8W@hDxi z(V!mGK4R^ZPaN~fjyqm&B*9F*V85cOO2W~RmF@cpHL%}LVl2nJeL`Do>6VD__VHn# zoidd&hz51d| zPQv|v|I8cpgRm&PEQUo-5eyq9hbFCe2Tk(1iqWK6&8G6xf2BRZ#*}rFUpbn^~{-k@%}#bvXa?!}WTqCU2tG^VyaPJK+Tu!W)=d0)u?E z-1N=^?&$e+;|f>EjJBX+cFM0`GRJpDiPefA+FhM}%7*!ut>`(Uk>4KD>EE#HjjsEk z@GztfGj2sr@=RX+P)a+v@1})VE&REqd{>v~PjAO{Houbz7qoI?=cq3FNvJ;{t2>Nc zAoSAfg0=bgb}ZLQ*!!AW%pC6(0W6tUX>VeRob4%(-Hu?06`a=7o2MMbv?xve^yqF9 z5>#U%*Dr^RNQq7hii>eU^IY$j+OF8g`^5n)|4x%3JuBR{O=(3Uc7VY+Q0C{y$^3aT zv&^Y+?GaV-Vg>anTbfj;O9$+K8%%uG=?|_M6Vi+<&{%9hsA9#vY%PytY zf!Ct>-VF!QxnZN-_D!j`9B=vpzD#>@f+!^hzON<95|z^+gSw1G^2*u7gxnMA)s|lP z{X1%SxDJyk8xs@NP6mu`yQE%@mKsK13YDp4hSc>q@J{XY2T|mjP~@*$H5iv=aruaI zNcDXWBMdsVomk8^)4%;mlqT`z{6L*31`D&qG_7}#ZIUHJh$NPlzmo0!`sJI_lF;>!};k%u=|Z~ebd(;GD>9TqzO4}bM;86eh!kykbv1~sCeEEk-hp~PlTZf)^<&Hf7 znv~KH0uN1pv!ioCvD6eP5g{S%Bi;4@dl*&PYlvnhlV<4(jCZ0x!-+A?k5e*M9rBTH zbtxL0%sZOXspXZoEcYNf;Unk!ZjrZpVPP6N4x)^R?J zhU^OZpT6i+|32GduJgO}`)b-9bs!zoMfKi?l7}8p=$y z;lj^AaVGqmlq_EjRckO4$-XIiDB*K4sCkSBX`2CA_YY49?HvhbKCKBaW8~sJKtwaV zo%3qsV^wa=n+7ZB>5&{#oU!9h*|DwNB8_R= z_8?auVK4eDU0^FD;?ay~|Dm|0_644^XXERdS#ZiDNBwGCT!Wdk;3F2p0lQ&PHxfKN z&3}6b9UrNH+b7N$P|72JUS?9OWX)QYm~Z;xi?)D@B6SOsjN%A({PMsBeJZrAmzowQCbg*{fbFQW9!B&ta{Z+Z^s>L# zdLuy!IU8!9r-#SizdzwYEmPqS7A_xXW=P0I4uXV0o95?3r^0D(R&Azj(nb!|PNWf- zqvLWo=+BTW*VMe$+Q#GMsV*SvjfmKCX)}T_yBAedypS!9s9_{0z>ey}LY0Yc>)Km3 z00o1#^&Fk&+}VpTQeWZ05_ux8rlwiFuJ3}ELX~jotH)(ue@R7Rr0~-CzeY#b;Hq0$ zAx8*%8bpPYP@gDEO|333eqqdeQ62AHQ$o*({jZf(Ko-i_0=%~36pcWc5XY(Hz>BnZ zm7Xq`l%EgMCZ&0`Dzzr}!3&WV&5#ncF~&uw^VZW)HM!WTUT^ni#1#rDu@86QAK|N2 z{qPg^GOh5%X@St9lz#HZ$g63o!au$0%@H2BO)@;{cCRnIRm|yvp9zTSr8zC3N{teg zla_M+d>G^b>ED*G4`7*0re2m7l0(0Thq;pa!W2vWl-w(g-sQOkq+L1C$MW9JEVtPBJ?gWW6nQ#qx}p?k_!3SGX0k_`c}tEw zMe?X3-U4JF54OR<&&)&u?6#BtJxVVkdtIX_|K5jEvW)kgS{XC&qWB6s4as(FXN_;* z=C=}uhubJJU?TMNf1Arkhl)=s-vuN`K<_rB5ijwkMUF2HM#aTTu1Cx!3cr0rz>q`X zbzJ!1LkeKNUxiZlj03H=?{p8^5xIL9u@jwD^P@NvHucwCqjEPrJ z`+1y=QD>V_Nfh^Gn9H#r?IMl-6s;xI4Q8h#W(55zoOT{MlN42IdjOasq^*R6>KlV! zdOweAYtavH8?~K9jaFJ)k7?D(4~ga&H!nW08+S=H6FKC?%a)=;nhelW81vf+YxU}1 zzW?)8Dlm|2X!r{V1WyQkiM~mwN1NPt;_@NB*I~eeu~NA=espErM_BgQb9?K1iRXva z<6`BWWE>%$vCPBE3N1xHQzWE~I=$GN`F_z@kV}o;eLGs~x*FIm6a1{f2tcn1s;m87HsuL0$OPqK5VtHbA^Pl_I9VD2r3Sme=FBJGN-cXg$|NS&l%XYy z-GBc|Fx)~L0nad8A(82Ue2XB(p?N&;FcOZI4ylTF|1W@jv1RNrV&2%W}qKLPFP?dl&!N z4>Pa)80d$?KsZmDv2Blyyq}sYFi{zh$Y(|}=~e5X;xq&+DJs@G=+mXM8p`HoT>8=E znwC#bzb|1c(nwZGa>)GJ;=lf)=)v1YcmCW{kn9ysOmwtnv&N7M_OBZ&2FI}xc5TOy zmcw_nMIjEDTP0M2lWLe_>okk#`gwtkaf(*3rJ#r3NjXiq%*vS5icv^GL&CQEel|k$ zJX+e?DIQwJ#+Fs>m53OTF%6fgit3!Q?1cUEdM*ucw3N4KnP*~Zv7rwfHva5tWY5-% zg2KX*ZqSkPWWHZEVc&nB_&i)ZLRdZj0s%&k?@n%l|4|#s^G&~|)~&jhmSpKk=G_=_ zs5(>h`nVCBoDwzF3MV_e3pWkYHVYG&Ym%UPdUk*IxL5HJPL;r(#p$ZNJy7@Rd13emUs|WIyF>qz95m=wy7fnWb|Wqy`Z3?T zfz7DLY|Y*d8EAFg@WZ($BPIQvL?br|gT?>(vkb0mhP^_7TX=Y1Po1Koo>g+kc0R)( zuKq%0NCc&^B$rmUs@oSFQh+=AFAuk?%L#OtqN!JM)7F`4Xe9lkU6yQzq@|_R=|yWm zEs8e6C8-~tC#~KdUnO_h9?u|MhrDA>eR#Ld7YPjw#)B&;Hy@uA-rItM zqk0ZLM8pX2$JG|}b93)qZ%(L41!rW4P8zn?jm$R8d0VQg5LL@#azrz}#0r`a5M-!} z|2OT1h9)1;xJUPxS9;v~JTl%sb1h?~&XLj4{laS<86H-8MO5lEF?HH%EKeX&8Payd z;&UaMbXe%ZFQAgVy?ua)m*6Lj+GoD7AViS-`h<7?OpgUP6O>S1+Bb>+FvWP_wmpEy{F*$j)(K`WHCZy|$KCYSOlO zGM*w(S>v)3a?gKzC-QIq840Wv{6S|a9d)3Z1dqUQ?>@CMqO1~UcN~%idZyA$<`#u+ zEMzf8^tn$ytW)=`x!^IS`Mkgy8wS^jB|9glWC|=&>_KD6rPouhsVckyM^5$uk2E{M zxX_9-DZLDyt6)UIBIWPR4ZpRoUDI7^jm7UsKHGTKguIm{8HxBJ5FE;anO%*yKUZ7+ z!HJSR{^w8ZtPAhsmAEh@ApkbRk%}y+zzT`u(pTWyX5z@03GfM~$KMM1O)D*w;_T>E zrPgK$Du~_f_HM=k6921yBjV^NvxcT7D5*hA%@6`(a9qQNf{MkwWLV(Ucj2twH5Q)u z{OS3GC~49V@tlK*RPkjbJ={hmQFPCdDQz7sY!eZcP^0^q_m55Yb#rVc1Po+ zuAu?(@=`^w(T0_n>W7fm38XHHwgmEHih2$hzqAmG<>U3ahk_WQZj>Zsc~DUmHH;1MM(vwj5+QeiAoC@NJ(v67}&5_nco{>oBnpyj|Dd@`I+t8Xaxgl zpHAGFoAPQ$zBB&n*+CkU$~%;@P?L6AgG@%f0^?%xS=`@ zl_SoKWDqQ;^)LJ|yj9Y`YQtxxkFL6nHRJagQgM^ufEnI9sBfV^rnL&o}q^7|tEKt;wJmiGQOC!>MnpsR?CLU-x zRj+M*^<%`gs2V;GpmT)ay?h7~qf2EMV@nauS!x~KN1vj%Qc)obx+oTM9TV7D2inMA zW4ViriSKx`H92YByJaQBi3)B)hPNC5t-A^)`D>d^3w{A~Ob8qGf!BRoXu(aBN8=b7 zuLS1~Sf4gVxW<2acl(q4sWy~}ADaK{Y+|sb#*m4pfHY{wJ#Jq#MhDMLvQnv8cG1Ob zcV?@`k@;1xqnWTgXDSq=+NU;eFPt*PqP)SEYNAZ)yv z>b!W-R7syo@gcCo-~9j#Js&)EZ%k7f+U)l8AyNUz+?a-NgS;CdX?b z6T-|Ktb}h-mdGXPAxJhfl%C{)*n!YSgvM~bIhzmv972#3+ubB25b55~Tb3)IPSS9| z&!67pt~5$js@!MBE-%sdU6_lQI18Hnq%z-ns>RLC!mw=A2opz_Tz6&sK=`_$$=8Zg z&-3fUD>rD3BnElIdmGF2FF&@=13;}1@i+Eo$DlDdrp5fvCm^L5I2CVR7#RFn>wdl` ze^|rp20e<9v-4^qv>eozuZti-I<<2=3x`+18|~3b6kz%z1rc8NZ$c@TSdj-Lfa+i_$^u6glu>hr$_lKzof*Q>t{{8d^%>@Oe;mO3|;*ClfWfpvCT54s)H4vNV zsqSQNU!rOvY6{d2q@bk?X<_kNgT1D)F<1J+vK}jqxdmfzK1{vg(|3J7ik&p$J9S93JS`%K>;e(fWVSi3yiRRf^asm}im)=jPBy6>T)fZ^ zTnG|3U>v*&0IN|qWFxGRb`1`+iS4@y)Vw-zl)&2l?n!m{QM%GlPenxp&};s!4`-N^ zI8l~XeM)5C@HvYec^86#_AupmcNbDL$^I%oT~Koi&JCu^qJ2g$5dTHDw&(7W^+G72 zKPD+j;$X3b;6Gsa>Cq814=Z9O^ux!=+UFH%RmJb&N4`UgIWT6R?{|H;P84X8Esm<` zE-wdF@cxYK_Vs#(tj$sQ zsE(wY)Yev-9e^DHqw&u`kL4A6c2kKXIVv5*kONE4@BAB!N}7D%PA3#|S~LT^aN70; z)of{G0>QK?)B&Pmx7ryde%SBkSABO5Tc4j+dp1z0-;PUmnMX9d*~dc_-tt(e-QOp< zq5I$>%NClVdGf&mIIj&ro4_*qiyB-6^Z5LB&y?(Rm|lr+-yNlG`;UDDDeBHi8H z-Cfdxq`;Z}=gJ2!*IIkdG2XO9WfEtRA)L46DH_vf`8-$l^m|lH-ir{dq z2d9qw5&v>|M#kW}gM|6F*+yNg=V#otdf0P)q|4 zPhDqGItH6=7+Luja%|j_jTwcKPd3Z2LmvTcZul^QwZu%CxhRUzolj2c17vI=Hkx+J z_3IAk2+upnZCrOl{kMe`oe5@(N=e8_&>;218NLhSO7Fu2L|d)S;AA=>fc@o$CnwoJ zKvE-e(B*P7h0?n`a#GR|y^8)rQFm4#6whR2WH)o1LX^O&ozaRSE;=?0m<=>cgro~S z1}w|^QSQC7n^iB<1W1Uak`nIosaqI_@LJf#&kb2oz}o%2{7AQkc%GVi zbFgZOkgOCfAxyMJ43v1Q=PAdtgPEBbzsDuA@KqmJX@AQHSGTnVDe{8jc(X7*L%6?nVF!~Pfwyi zk;A4L`d_^zL|?thC=aXrKi<{Fu+Y$0^F3;Q0ccD{;D;zG>Ss>bkqe?S5Lh%*U_IU? zA}0^*RS(Vl)B+F2HuXMJ1vGTe+7-hn6;=AAZ-RIwLh98eN)naLpOXzD$zDC_agd|q zypKgR$~4*2>q^VZWqo~l02S&pVj>I#c^DLHaX?Y6h5-6-D?k>Y6#EfPg~~1O$sYt~ z>XMN{7n*yBVI2+m*K3h z+#Eg`@z|BfB^pJ{o{WyZHK|QWyw0>SlvO2ROs?YYq%5d>7F?y-c61JMboCom-HiDU zQI%{hhhi;>3)8Hc$f7w!GH*DtC^3;5G~Jobe@_9Og1Pp6D=V^(?TYYvo3&+pSm9>Y zjM9S%bqidZ9(Ej5h?C}-eSeD|LYF1o-gSzJ=g?hOr(JZYm1?4Zln)eJUOv8UP<78^ z@ngef(vXORgq9fp)_3Gf3<2CWXT9Ej)#{ls5fRZ+LIUcRIXQr>IU=K?$~C(Cln%UD zc##ocpl3+d+8)q+4uv-Rm#uOza@bHh#ayGihX{rX`OA?bV+?UHVx6B`iK(n|BTa#$ z_w)@h`z`rL+5F;SlF?M1S(mkQELmAEryFZFw~J5x=j%e#>%PFD*>3(}DM&`}oA`1R za8$(702v^R^P+X=8WTwwMDVtq7-XeKE8o@{RR+)Nec3S;A|WA>XDhC*#(1Yge0r<+ zf#q@d;sbR;;m^<8RfU6TsCQUly#fLsuPf$ld$xOnlVezww8j>j0V8F>)NwQ8Vr{FZ zs*0H@HJc7=L2d=$>X8w}UyXFI1dg$2|6x(^R|C^|pX-jY?&$DiRzic=D zjUCVVO-30ZjfI9VglTH0-XLn>;;N;EuBb$=+0tf-u0OeuUpJ>f9PZVg9FL7sEf*bR z3ArvW8+R^BWUw`Xth#TT_$e_0%7K}$*g*bO^87tJ|4~T4Y2W8X-x%hWj=T0(5PDas zRui(E#doYf4lmIK_|2=58qTLbz=9EHu?NGi8-j@Ef>csls*T0nNeE}3by7WN%fqup zM0vOMd$h8Pwb3W8W=2*HHpxPESvG^AKl$=MFWg2vmOmfu$D~3vIIEV~`p13Ylpivw z1>8=t(MBG>C=$hZF(dyhFYnj2%9e>r$;-ob{Y(yKHwGTh46>u3Nxs1DZa*C7 ziBYa;(}R1%9|l7v$%9=Te5c*fp8@^(9BY`fdNu&kH}&-0w<`U8kz@6PN2`N%Ld=G7SSLbS_6hs~uGBFINmE5%)|6=y_$l$FV-s0e^zcuqW| z;-NqtyW0c~7ZJ0LPXawW;~ zKG!WRE9*IHe8uW~T4x(FW@cv26TexT3=vev^E-B3`LE29HA@B!9D7Lbbezz0Uy`Uy z&J1E{E{tNL(P+qGw^~j*B7k!RL)#7-9v3%4dLkKlw3SUT`%_KkoH8uOsb@`96~{4Ve^iwpwj?xN$&+_?+N+9)D)4PzCIvJ-0B(|3rY^z zA0K0>aUvkHAOw{DP~#V4#TYXB!13WX06&%~ajS_>e4@oEKHok&d#Z9Ue*3&`IvfU4 zbh0<+%NKJ&9r}&c$f%u~UWVLYgml0MW#)v~{=IWY;ijQ&N6z=0$TR+DC#2nGaUzl~ zXFjWL3dOX*>?e0Q=`R{%_p_ORS<8MvqFJJho{Q&`UE&4%A?e_ZX z|F5bf+tzNdzu4;0)u&{Cb&yH%lSy)uNJ&VDT7;#hXnlP6ZTUmLk)Xc*A0!5tFSrVA zh0Jxp%&bIATMOe8B_;Cj{i2?TNY`s*%koVe{noop^+1z8!9 z?5ehQcGF8uFmJW%OqOdOxIhUc5pxE#L#Ry2x`H>GsGE9dnumLPzP zWqT#N4*c6U0)RIWn$W-z*@g-M<^_OpV-gL^ilxv|wC+8=VFt9F$C7ZZo6^F2!?$Yu zS?~-bO3FWxYXkX+`f)2yL+Ixn)odA?P-0@n>kfXDmj{n(!L)C{NvI`ZCd>CRZ4qIF zY1rvFaS{!1Va>|vJw=smo%Hw+E*&Pz)5^a>Y-7{cF;y@eV`CmbBlqRQq;W8yoP3^E z`F6(njKjt)3qB7TDCNRSutV>}SXj8(3CCuFu{Maf6=@=<8#Yq6xUQ~F9S`5104~q( z-CzReEe`0m%Ul1V@9>N*dfy#YTJ~l0V)A&x042m$JE`HcbMMH46}i~o%G^-0!4Wyk zq5_{TSrOXOeui8Vr6OuBK6w!a{zZ;wy?F?W>+yg3x5ZcxKiPk5{ru)Rv zshOIu+*og!0YjXFSw4@JqL}_YG=dt>)NcA{Z_V4jAKQa|hb191l*8C6@7dC=L!MUg z);W(C*-DZME8l+cdcqr%nc3Fqq=IiZ5YbPLybP2OBJd)@XEW|7p@fvy>s7o8h>CtQ z@^(>O7#4AOq0Rp>)*y+8|C$7toLJ~@UwGrW*$ zVr*deTe)^QHi`ne)soVFHr|9Jm9iZqQCt`ULlUDdB*NGeM1{C%u(h7za83Z! zp#SCByV~Dh=yT#HJG=g+CHe1}8HMFV)ADpPi3?`uJ`Vd-G_9#i_k}Do!RJDE#!mfWlbwkR3Dm zsWB<3E`I&3KyB}l9(-OQabSlbyY;-!?pGH`ynJN%K+U02co2?`|87YY+uMR)HRcf8 zhMohvPBBSc7w3@48(HS8vBdF4&~~j}T&7wwxLiU3OjXo!9>2W2RFh>3;;IDu=T}ETCGE)k->+~I)@h?o zh3nDm0|Nt&-S8K^hVJVzD|%%Qik#^m@IqzFG>g|YLqtHBM$g3^(CuyurZWH5XR~0B zth-NdG=blRf(n3Ake1MV%w%6aEy~NoDA%4(x?Maf#oXPc;rFT|U2Sye1#{cfx-V96 zuoNhR4W$a7%hp|h*I>qH`e<&hr6VmX`kHK+{+o3YY$zW4DTi0!R)DQt4o}1(J#}N? z@vyNG2!V+K>nX23w5uSlDMuhL6i&o_;Q|rBJ(R-)lC{gB!!YkaYS#rr3FI6}Kw}SG zIB7Wf7aqy`(ZIx@48fbbyM(VhR$@;wdSPwXX-S0|nK=%_9L=Z`5sa%obSp1w&~clX z1xDyGzbf2fdvz7RP%p2aI@ zAWe$+rt56u)YMc!=BG#cmR8JyrlxyV6@gi?u&(H_CmxcNJn$czfQ&=n^1{yY1gvAN zxQ&fXGZmx%8>BQdc6ABX17A@}(VM)utqCE2xYqRs>!64kqIo>)j}r>~WQ9LdxFk>@ z3SNF=8_ut^dk4XXgGoAo zAcSbzn)Wk`G6Eq!%6^@=>#dMNCpk$Bg5G~`P*4itdq9Vmz!p$~Mr^*mxDSnT6?Ak2 zDi&sDWRxixYiSX;^O3~7DJn^%eU>Sk6BbCvMy8NHbW{~wYG*^leEoYU=Xhy?`1wKE zJxK;HY08?`_njws!aK<9JM9iFe~BIb1F#Qg0saX71{nmO}43U#X!8-w?qeAb6E!9&NNgfrKbh zevhiCkw`>DMC&`%JhkGW5nE0ZNEx>?GpyzJq&gJade4;$X=X|w{rxQbbn3!RRF~X- zuf4oGVL3t))6%h)&wW`V?KL}+trvUz#%KH(W4q%u1L%>?(A*{-~Vb6Og z?Iyq=!jf{LrdE$}F13mkL5CH?U@}#fx9E5mSX+lAx2yY^jwQt|m(9`A0V?YU&GHa! zki@Hb0fed%CQ|-^e4G7RDv|%J4&7rbFwAi`hHq;-jIyv^28{9#0xn#4J)S5b_u%6` zP6-YUUQZ_#u@c>S8w6hnu3&>A$cxiYAY$3}5dJjt;eIByBUay`J%sE_0`^5dGQBDT zMO;x)UbtquDREA)ixXkk^+cN?ff75>mrXVvKrJWKfIvfg)CYyi& zbzU8Ay318+r|_5CTi@jDw0Dr^8n+su0wC8B;KD&3|E_?VS@KT-mF0QR{Gr*Ir$S}# z2Zral#qI=Mpr@)=@_!HfKEa4sm|jC2aFQG-9cectrJl0{6F33Bm9<9aZ3ie6$=ch61CFpco1Ol?ekRdXOURw|*EVv!`*?Jl{=F-RkvX{)I*XIX6v_jJL4p z$gRG;1f0#cghAnJ1v!wQ>sYZW@)ac)sn$7^zd3l0NAK}(&o+Bd_f#D{qwR+Z8UB+W zvrgyDB^n63TPDDu5SL$jO?AxP(AcP+l$wz6hSO3W{#%M7z6JZpzHffon3tovEJl!0 zcRw{AJ~Ez3oOJ$N_A?mTdPmvB-cNWaC@@7voq@BfcOWLS%GrVj$ervPIPnNbG?t?v z1z7<62K|L2Fh)L^XaM7?z{4W~n+M`&H&xml&6IdQw|wzR4aQ{d*Q!6kvITiKM{11n zE|!9Wv(|NW^qzmOl1L zrahE_+67ypq7@INA&B&v~<}h z+)RubB2MY;75z{_zvlP!UukJ+-+zt1gy6F;Ea%sGmBRYMnqT^oJ*xG)d1GUHAsYQ# zk~)wWKo3n$HiE?9R;cZ^W-_@lO%qqwFEBI!qvR9)Q}&(;FS7RxLv8rd)U>5mT~kwe zk(+~qV|Q`XLf?L8pG5=+1JYeaC}uxm*y`#M+hBb2`b7YwZ-ZOc&C|29aksZ_Gat>t zKfZMv+bA2eB^2$l8c{ z+;4|XEi|N_9@xi%80$^#@+A}YF-4?r<9Vm`;O75F@>Sc+9@mv|;iqW=*s}<3-DQ?( zr%j078}_t(Gc1rij`I3Ro?D`5O16STFeZ{Oa*IVUF+XkoR9YhMi_5x&u8^1&N?8k{ zZpF>V4nG!xkWEVYhhdl+tko=zM0w z(owa#vU+-yb+ZE3Ky-Hj$9425d^;n_1s+_R|GUADQP>59_8=L zWj-qXh`fXZ6&qU|Cq~ga)koPta$dgbyD#k+25lY+*KPDC z(h?Hb05gX$T`nyV4GbcJX7Z?PA$MTqBj@+Ihk_@1dVFLwv0+bRe0pD@t?nqu2fTO} zUVeU}pA};UcQq+QIXD8rE!NlYpFUHU-iHs-K`?K>f42n>uMC_f0zd~5&|8i6@Bmr< zvYAuJ841dOi0OZe48cZ|sh(3K0WgN-bZI*Be{g*6jhC+;G2ZX?pR>fV%gPeWjHT1o zHogfzzfxQKLAnn!bE|pyDvLukK%a=SQG(Eo3jyCPPimLg611`ZV6{J1p!f&oVBTMI zQ>C7K))PB#@FJ|{!x(>v;jjFiIYke+CfGA#S-yndD=tWoN1C=yV@4r>RV;!5@g-MH z1gVB@$iUACdco|ftR~;hgbk8yzL&sSfc@@GjxoppAa@}yepgilz{o$yutwfqAj60< zjm?;)l4=8QN{{&nNC@1FiSs?B0d#!0^iC47TvWP;uxN#WCw;ec0!&1nTD+qEexlXH zaBv$q!=Gake6RyRiU3XCp-er6;N6#=@N#9Pygmn_=<%9Kzwua zREPtenhiUrRVR=ND$?ab0%0mejniQ2f~cGab9#q4mV6!9t+A2d9D(*M@2RzE>1%@} zyLZQr?0Z$075jR;WtZi)X74+Uwwsww$6>nE1oIHGOT7NRy=(p`V(1hr!{CO_wP=r_ zyRV(}iPUY~jC0KJ@B~^0#tBKgfN7GPKDA(Ao)hF>@T0OjJZuvgqck}=v0r8ZUWODI zKmP!j$f%;cbjdt%b|M+!Z(RrDC0l?Y$1;BYMR>UrH96A~@?hnH%FN9B7H`-ah`dCF zgoS+=3xW^FkSWx%#uD}h@Q zugF1Ym6bO{Pp2TI{%NF!djnPVk<8&T9hWq2kO>!)3ARMLJQqT&uC5-ivSJHGXyPLr zkdUCRIJ{YFMd)_!gNumas!n*EmnY%eHExLuPY5rOu94lh&!Xsd>|Fd)bHKXLNv=R$ zn))BpND7$7l0!WFl&)jf+=d2>a-EzY{I}ZqZEZLhVdUE7u|ZLOon!`kcer6msPY+M zB=+kqQLZRj%se8o7sWo*d(nvP8~0yNrHPr8)TJiCAffDy5kG)G2!N;{09*2^^%snwGk^hM(VP3cB1P zba|qV;al)VEibu$ozK`5h#3dgpRBzM6cm($KL+WtB;GJIG=40`Mq%LjyWjT^zL0~& z5WX4T)S$@PR5756@vhU`KIF|j+XQq6hL!7OmToU>kY;UWA6@DW5^9JRfowI$as1R0H6`bq|30rFs^+P18{`~)z9{J@~7MS{8|^We02v!MCFkH z&GPv{SI%+XS@*w%P+u?tV$V6so?LLca|xgBTBjEp;u8!{1xlVFEqqr{sB`uD#*2oh zKd~-zW))SdydL;#sVwCE!SWgkAr@yLC=igwuyrO7qxTjuAQcPxrt|92b2$7MiBN&! z6_Zgp&o3aul2CYI)i8CCn(sRAUF+sIA@rvB;JbT9RUf>~QqRI~TwJ3i`)OQlf<0JMe)5T5^{WT8HAAj_Krnwoy0rJtKK zrL;REhH!BeKFQM3Ff3R1aV&d)1BP4A@$tB17nGjK&?a_ubs<@>H`Lev3+|cQvoJRg z&!7Po&g7T;!tSB0eFLYo5|TEgvIC^kJkbM({Io*ni*|4QYl56j}0qc_(Yf9wT z`D(}q>w@k1?aspojHg}i{U6O{JUj0;C}+Kg{zf+6V*?H^f8JI$Dk`cHSPK>WyL*Ni zg>%zBW=$l<1O*7eLxS45wBDhux-n_!rRhswr zpBhO6#cBV;_Qa60e9Q--4ko75iOxUft5%iN)wjC_Vo06#Q*?SSa^x-8&!y!C{ajsL z0l(Mxg+Z&OQXZZlB?(&gHjScgj8`KDC%G(J(u_HHI!?sft)TuhAxL577;*mb<3}Fa zz`+67t!>2r`wyRmK!f=STb_0&NjH8*O8M;kU3Elc?=Z|M1sNGxkApwRNPm_{PHCQL zNU@)oJ}wM>%a!eqhCrhrJCsqu6(W)H~ z$i-{(UGtZXU?i7RMj?HvKop>vD$Vw?4CK+@?_55ZUOuoBceRaP&ni4CfN1u(l8kA)_Aeg8y{^tKeY`@_{ zvQW7xol%z{Z~nW*+3I|E3|=BndS1X-d~mmsdWSrH+AdK6+fSgXR6}Z1NYaHMO&TIi zg)_SHFdyoZ{NLk;g^5W|t3t>+EswX45bZ1-i#$&v87>kWOmZ1W-z6xV^Aa^#+`fBK zNPSt*??erj2m@R<^nV5fcpo$_PEHr#!SCS0b!G7B5#ii~o_^Nsa10Hwr&uAtu8^(j zi%OLxxN0Vk{$ULY@BVzVv4PfVVIQCc6M*Uxxcg3tvX_QdT}8|g(WR~ zUgWI{)NH)p6+i#rN>P#Xer(+z;Yq6+(n%N~T87t5+_6>ByU%ntE(atTh;IXwM zonBh{($eC*x36o$PISbdARlzV)|}LehRNy7&mj5hbZv7p7)VP~xi?GaSL#B>_D`iN zv@_ky0H z0=-RB>nq~20X!bGp?=rnoBfL&xAE(F5CD0nlG>Vw9d@=H8}Xw%`HVAP=?|FVtjItl32?#ph*_^$SnSX3 z6_we*^L|>3&d9K+TF$D{i^`i0XpvXavqc_h`pSz5M`5t%7z=Euz1DME-@GZhfFN?) zF}e6Z(j)~YA$4XZoEa3^n&vP8&eQtpG=>TU)*9TtgW3vx<8I*W4F_ohah%voYuzsm z9^}*$t9cx$xd(sQ@=nTx5|nH4*b}e-Kv&xRO}#uwub+!R;98CmM@~4Qy*{Ph5|(A( zt_Iw|%2)^OQP;}YaAo;xf+gRq9XqFB+}>hzu(J_%3A|Zzwt`9>1$}T>=U8wbwJ%B_WmM3vonisN+bZaD zqR&S~L0Gzb3UO;%&H}+7SSSymS->CobP%l(E$J6Wzu{tpsTGGvz2-jN?Q z&>)e@=KDX-7B-5E{2~{LN|!ljL4HpJ{@V=4Uu9N1?HBD>K>YMZyK*Do*Dpal!qlk~ z0L6|&+fRc=uF@z#LS&Djjl^8k^Di437ECL<*>aJLC))@B@~5GJ*M9Q_;pJhnbJxM& z8)voQzk=xT?(UBxZSNSX)N=dm7u4?bfK=cEi)x^jTST){Hkqp1@Fbtf#l~~fb|{<1 z*19$KIJ1y?i&%_Jr*`PL*p-Lyf2=YBrTiS*#W6GWc6`)qY?NN@UwJ8=Kh}Op(&Zk2 zAwn755^YoYiK-lB4k?Uno%X;{41uzU<>udIA>WCh_0hHO%O8I$Iqqp3n!DF5+#G3t z*k;6*a-_N_{$3=QcNCnnDv9D;74b>t$+SXVD>hc$+m0$D0b_ghW1aOMSjrSZ0Mnbn zpCKw|V>+gOed$);5bE{92#q{qNko6SJ_?YLdImT~4x9Te9A3v*xNc>+hfLbK^nGfq zgl0@D{dUGdoxsl8R@t<}yasUbT*xuIu<+Ga=b<7beQD+t5|lQ1T|84gAv}8+Qw&T@ zX~&uvJcF#qbXJPLew03<9P>~zs7XweDk=m(3B6M@DjIO*1R_MerxzE)78XQ2p8x28 znQJYQyXpgq4Ppwb5ActD9y~ug8vyAW3PrOJ z1Tz7k*8S&p%q=cPaPt;WR8)4278jT1C(FN6u|0>OFyG5^MG6Y4$@G6(HU4L^valGn zoDQc`I6-7e<8N&aYL_ibCgH30)@vB&3Ta<3Vb81o%=eFG1;&t9*=6ft^TZRzcj~`K zwDbSgz0ZB>-<){7j$uelLz2#eFaw}9R{(jTJL@6Lm%LW@7Yk!@sqmAFTB)bmcZ0Cy zNpna|b92>;xgE^GA-J|Q`@2oU9u%q9&Y@6HlmVLiQ-+_c8{p2yYK(1l5B#emQW98S z-{S4W8NBl;Z6wT##>~EsbyN~TwCB~2P^4R9K#DA0CYM;L27;+x?@ezezsK2}#FwR` zQg^+B*%?{pKXW@Vd<_7jIK$&kKaK?+07(lA{EerLsAJzKSsI3Z?*U!mp*xNzJyi>K zStf6e1bGO7sX_!g56}FE#!oarLq%rbI$g9>wav}V`woyXxi$R>2_I2Z5rQS)f}sW7 z1n)+As8mrUkC@W(=6{v?B#pbAk^o^y-|d`CQ?zxvl!E)A!k*JGpfd#T-PN!*Y^l%lBc& z$!WxPjh##JBJg&CS_fP1#i=Tgik~DXaviWUBV*izMv{cTQP6tmnpMbX!6LhZ%m^RI z?8%?Cyn`u&J!)E3YuCG9rTGKg@&a5^6SV*4{?$L)&s+B9jEcx8W99?|1QYbo!iVvk z`0&5O=4@Gc9gO0vHT&LHw#nPUHoWBYR@=e9!8EG8XpY9naFKK#CN*>|ogcYC4yy8O zsI*G@0+0tUGqK0%_hnJLTe)|IBO?jHtcj}Tg5=*qh9T2xjBrNey~Cf2t=Mb&C4?!& z4jk+g@)r*azJEumudi>~OGIVoz!o>&q_TJde?u6KeV_C=goOiuow9FNVQ-(9sW(;N zWqHD&&uKXdB_t>aW%iXIZjkZq)6ujPzpJ$vg%=VdYkluNGqBvz08t@OiOrY(_#vyF zfDcw_0um#Kv>+0OQA^arJxLI*7cb9vRc^ell$~(qCbx1|yJn+XGCS${F1|(jt+fl7 zx(f@DXWsfwOg4fwuh--8c#w&!wW{hUtvRmthVh3G{_qDPk;-SAi9za^ev{;p+&_Bw zt|aFTjx#iP5gLwy`goc@WricK|E+QMLlvduwXI`|=m=8gajA+IPz_nY%>{gYO;-aB z)MOYtK#x9%S2}Oa?ed{F+}K4hyA?oc6cd;60vAw?W3_$zHU4^7mkurhp{pXXzkj2E zD)vb=t^K~C@QXqe`jM&#b>=d~*LsS$%$f$(n#Sl_IQ|#WxPDV6@+o!;Gj=(niiLuf z7J|>8KLdV)3)uWQIJWy^$^V7RsJgl}jz9(=7^ckjXB?sU4|O8V~zITGOE`TU{N5BHzTdSJkEZhl_Fk%Nq&tXc_}G|yHJ z7JA}()6q|j>Oa(Z9OZRx9hc;Q`;&hZVxd;Xp&xJ6a~ywz#WQ7#j)d@RV}UwKJbHRH zqx9MX1XoIS6uga2)3jG58BX$bNNvfm6R5tBUhou6w#zceq870c12SD-FgSSNjL!W zaE5b!1638@XX?c4;L4v>_>g=~+gvAP;-bpC_av4eKNGx8$zSZM7uY8J791dw20mBt zn(wA&xx&xSgMk?%?qA#t5a7R2(XMn4BB0W%h#f)OhcbIN#^IbRjlm10A(SxFNo`@? zaW$aba`5}NMd{C<5>isQy#EQJ19eLmfOJf!H55G9)5N(+iUpDpnfas8Z?pL_$B9Us zclkOW;FozSczv%v->zHT33>lld=3l1A$c1nS;k)ebrzYV;ppyeXpqnY%l~}C#YDP% zad$l)Ko?7EAGW+RSn6r`R4}Gyw=1)iY z1eV_rE({MAs4+eqfZhBX* z=ZP4gwB#Cp73dNhh=?}}u2j-w#qFn{fS%zthE;3$(jUrg{&fCcjHW^_zABIw%fk-w||-pP5#~llheS zl~Q;157lTQ3)r6D72Jl9Gvh_j;KfLlYeP)b`#%#1FySa*;|9tvFzete@_e6oz_eDD zStf?EQr$DH0u`v!vIgu#0sWBpB(p5kF-&6eKi#%Gpk}TOad-Dq+tq+wvM@X1hKBaR zU)lHXH}712#`;D8snBtrTG^$DdS802Cx<>*SUH$Kzx>ka32 zX?55Y$g=y!z5MG0>|ISkb%cBl8%V9|2-y>o&{%H75Kq^vjO{(hohSzIjpXN2QD$e$ zT>(#@-@@R>yKk7u)h;x~24{+7+ z6u;Wbtvc6a}7 z(3kIxpM25(6?2SP!bV0Zsp;#-@z|+$kEGbC85@ULjAqS|_1Ghra)6xmgoC{sa--w_ z_HdD{woNwevQ=TTG3LTU*5lyeLu`aNov-nNySXdPw3xN4E2zJ)GH;tNRh=6`6DDeAX*cwT)VDx!jZriPuNyCX( zH$8|dO^bQWwsF-R4Gk@N0&tw*4A%fcZ6zQG84ob|Hhz+#NN0mop*J4{j&Zk@Jo0jmmSdSWc3n1DdJUnouEf!RGn*w989|MH-R>067ETKd< zqouXqbiZ>ArW7gnJ80k}j_`e2DUEWKlVbp(zT4NHjF-jJ){q#@!Z2Ygi}E#7FDU8+ z`FNu&pu>~{cf9)DNnoHKSbkmV)YXlQ{(0Xsy!rlHi5?l@1SikO`V8xBqL|3!H{%D? z%}*?gdpj&}r%yU+xr68H|9RX@i)kQGwGLWpoZACtM>M+8(9N

    zD(t#?2QI$KCF0(yB_Q{XQ;bR|KYzMdyj>xI=1SW#)?$zN>I;C z=cVX0OoD)Qy2G7U-f9I&xY3>*lcfX=UYt`46+W zoOWXxw;oSA1H`*93#Pf>Zc5=*>y_bkpl_{YMdPtS10vY6^t0f+N`82KEwTYqiXsSC z=>}0scb)zWB&2p6+728VVbTsECM4A2s);@NlUvdRAho5fpDf53l3XecOeMA0a@1c#bg!4^|=Iz)) zuq&_3@(C(x)YQsK(8ex?0qmwUB~_*jl58FjZXnVN%45YpTg=Xi7!7@$01T)5C?CPkk;ux- z!ZLB|c!2Jf4Uv>40-zN>aQp+hEplx3vtxxiFKU@7|KIy9VZH?bp$!ub8_ z?{($BITDn7W%n1SX@0d}2PfwVP3BwRE)A0K*Q+#JEQXYQtlrxO!EzBwY|l^`nVH*H zh3;7o;uu)J{yb_D$fuoqKX84t!>iX*NyHJ&i4**9q+1K%f?1ReFI%Ko7qJ7H;h{<| zxQMS;8uy5TgnL;LU&6&1Wy$mFZRy|%Jr{OnsJ_ZuYH?u;rw!?fr^Q@(`PTVa*{yv5 zW%U$?k$A!}HTZ}iy}B|1^LL#8UvdkJpSr_ENI@o=jF&mU@#Bqvh}e4g-xdRtaPIxP z&Qxv!Qfk*dd>k%!%8kmkg_09ezt5sFp@G3{QSg(2A866FlJyu9{eWqROS1W zd30*u8wi^XS}RlpHWd@!#0zqt95pSYyrb~{RIewstbS@$)+Z3Tz5Nkr3U^a{#00q2 zE@uEX0Z4-(kXgS<4q8FB2PYz8ba*qdRZCI_!h(WW?w_%Nr|QTDB!K*9bo@MV-u0_)A0{ZGC&6~!ws~(0<{>&fSGGURHpFg4h{6Pm`iO8pB3s@i|NJzEHI|1=*+gBdDUm|G<>F5!E&di$B z+ur}FH0~N@d)4VF;l_us3p{@)$!u%!=e+PP2zoo*M}2brqusI=yhg75w9pt>0Rc}C z)o%qz9!gN~dD=A;E@bv?h5*&O*z6vJ#s^sCJflC9ZFrqj0K*xBO#v4c5>CPp0VgPK zHWhO61wkP#ErK@cjn?XP*}e8g(G$#!f-EaHjANeoM;lK{efh_Rn=<(v5SE%$qgm`` z>nTm*f=TGA?eKLze|DEFC{kF0|GcEV=qG3#->4-Y1T3RqI|yd0uF$@>a+Ca5|7%m= z@aNb3{YmG`1!$3ED4pS%M3axv)Wnk^jOwRgVq^0xDk-^e=UO;|M^a$y0M91!BBtLp zC+oYz&e0K45f-?uHzmz>Ingk^HGW1nsbOJ+L0E=heyd+Twc{OyNlNGyj_VvZevxiT z_)Avp1OkMqvBLYcx|wzH_{o|-H2%aoS*Yk0x$}uvP6DD6a0E+yr}q6<=peMHit5y0 z4K~7?tQr}2`kdL52vS}n{faipe;yZ;nZxV&I9hK|mF{3tyBs0EUT5i5IH49 zrtY4MGL8xl#XO5UCGFY7kWFYcC@)X_@2Qp88+Zc=35gLDsfEdAZNUabmjn(bY)2i*t{-H68rPmgi46 z7Z4)S`%Wi3%&ucWKm9}Mc<;5qx%ssdKUv@+X-_Yv*q4Te-TQO*S7Sj3UjO%R{wxzj z^>+Zrwb!qal()xMYagJ%?`}1>uFf?gpV6NuMbm0KlV4Ocw$kqpDM;bI1A;b1|LjHy zS{Oy1vGMWVl(!;D^oBAcwO_tSdr^HG1ucn=L`Vp|$TNZMKeS1Iour!fM_Sy^l~D9| z1>jmuej8Y>wF)<}w-XBN=nw_W5%m_ReAkMZ=RV80n}m~A%bzU+zE1vQ?5MX5`FoiS z{;w3LYY!;+g*Mh7B0-GXKQ$%@_6h>y2~rE036`Qc%dV-$0kSNq=&H)(Oa0( zKTwRDOO2o9gjE#2afyllaETN~Q#i+!sZq>yK<1&X2Ic9=>+>+`AGZp1=@@A3CR+_URDGt@Oz$3YBR%mm1 zc_Ut)7{4;GA^-~wQ9d>`zlG0e~;@kg{6y((FXu*DcfsQ~^hWhO1 zKf*M6%H=D{2FA~etp)wY-cOC#OsNweBC<*J)2geZvQc*?+d=2)Qhw(vv!de2(b^`4 zu*y5xbe!S&9B@K&P}o``eqFofxgqzZ(20H48F*_|>-G@*@jf_y&omS}Vu1Y|H8GJp ziG4pg|Mn+augT=3wGb`s64{w+3oxQJQ5}%+QbxymRe3m}zpVN{QG!ERjxmZ#tkZ;9 zD<|ax%WYXr&5qbD2q*hEK++ySh1^e?`{RdoR6b))+DP?UlQ$AR{`~#QVn<+Pq%#_Z zWk=AqJ%WC)H1&29Vb5OsP!qIQnh$fZ1f@N1Z*-%Uq~y-}8yM2gP0XCh_fZ^1PR&sL z{ryeX6K6N4+a3sKte^ZI-j})hh zcQ&^4cWAWQ?h1UqA9wHzVe{GMa%`P_WjS(H6#o2cWfNJf!d-~rkiV!L~oKw7*?DIj*s%RlNUV^mcCK3Fp`q46LIUhw4h z?P{aipp``N530Lcq%bq~%>SG)YloTelC+?Fuu`I&kt3Fou08;t^sWEnw-P1We?E>H z3mzb@e*!BYXr9Fc0CXt$Mep1kCmkI(E0=|BJBIsAxC*l7nJd$qa!Rn%mp8BwDE&34 zwGkF{+93k$UKp@63~D}qe)vsqzt)s4Kai23$D*eRmpQKNhS_aG6exa_VWJjm!G)Oc zJ*p|6*Kjez_mf)#y3Ws=UEq+xCjOq9T=?y0@5Z1tcYB8g`1#ZlgAbHf6Qm=tx=k%W>UWQmjllB_Gz|yt7BAOlL^q_r^*GX z31c#T5Qt=7!uMW2N~JfVPamtbJc{ZLdqM|TwTB#hVR%C-2MaCsUyl%3EPS=V_{8KP zYL_j~7FUjEG%t;@--FBuwTamU-e0^6?#viW*!w|`?*)B$Z;<=#@=Cuy2IMm~miSPm zhlX<6j-8!78kKNjYb;%Z-|sJ6ETvfJ`8h>&oY1ywEY2Gn z&h*liAB@xqOn*!{tA|$-a*V_O`lwBpZft<~H}~y0f1dk0=xV%D7*{u=y8N!d_5a z$>MhLg6r(;tnqV#C_-AE+>ST1MA@KvQi&e7JzI!^#X$ll5!__IKsibPN|t%t8S*==Qd# zLCahWfEx0P_Ssif-|x&6DP2DKM&yf$`OtiE(eb?>DrQc*sb!z%r$=d#-j+aO7Sd5E z3VP>NW~5A<^#i?^5J@A$r8rNwM!j|yc`5RQYaK6wI5f=x*bTC%4x3El`q@?gkE63- zh-z!2Fi3}Vcb9ZYcXx-RbT>#!Bf}6&LiX6#nYvXqPX>#A1tq?Tr{H3{I8FzjMmRA5~HP`ZZ0hRz4d0E0|a()=*fTY{>KX#E1(ac zZEU1~?T+PMdx z<#&y`f{~itR^tFJkloxgDJ8|~;6?$R03jSzEDsJho(@UZ$_Ynhy1Cf^u<@hbgWm7e z|J|Vhc6#5+SwxJ!DddREC4xy^JOBRD=^ui9vHvm#R1N!zOmt z{tp$MYksP{osMd8AmvMBamuSPi~lI7|GOB{()yTGK+Bx)(i?sY)I-P*qo*cBoc`Tb zA#>ebK#h_DhZ$kSv z#mhrVUn8BY^uw7TMY%;IYRv?qBl(aV(^(%8W$vz*g>@t)X^$^9jb(@J_4x~aHxGRw zbM=b_H`m;+40nJ?aj z-g5lvvA@(ls+cq?t{k<1^Jh<1U`*y^C=i0zpYh2zBq(8UNfUo)WA6wu{>nP4-bD;{A>XnF8X6=sB4sfcjFeHM>G(_AOnKO1 zt(vj`lPv-0mw~rK5GDF~jxuC^>y7MLP!H58G@Atm1WE}$$hNq`xz;i4) zWbxmwZkhrm1aUt~#IW2rUcs6!I+#{Gd*tv(Wu>f}8xbb5RA5_idL1|0w6WqfU3gqbp3V_p704I@qKj)&TPYRJ5;A>PYgr^ZxX0Lz1V*Y_A+nRr=}p^3&h*40gM>5>cW`l5%Bnz;|)_b)ab3!JR|WvW;J z-0xbaxj>h-4tUiJPQ{SF=wODuJqjZU(DCABW|}EnM*{2;UQ`ek{7;?r`u<+H5xzC( zmh%Zj4`BcdRA>y$itfBC6YlsOh#tFJJ%6t*=^eef^SCYtPk5Y`7Ck~0irjxq$c4`) zUw}-+rq!~X>BZ=6?yn33trvd)tARd8-%l-%dHaA^XRsTo$S;}6;7i3h{J}mUka>6K z#OsN7IbGsL7K%+F6b1MKMZlXMM_BKf6U6kp&|n1d#0Kq;_$h+JDH*Ka#JRT3F44AR zAk2e7g$rI^Kh|^yk^Y}ZKCRM#lu(2v3-6|W)?o~6lf@#Ya+&IbUEZpS5hSxu)IP!k z1I4VP-s=sypDe0;$IKzH%1lM*3^#nY_nC$E^_f1wEP@F^O3s%Aw)WNJ-$AT#g-I}< z^&g|7A|SYT$ga5eiXug8=O@4VJ=2%sug><;geK)XJ3E`NEbg6mc5I5e*EvG)brEZ> zDIh5OsqKDZ<0_Fu+l4y6ZEYjMKL2ay!^6Ws8_~ag`VX#i;9M`ALjwbRKJm6=S(kN5 z;$gkL+Bp)di8Ey;o?8Q+jm^y;GiXg_kt1mrPX%@44t+9j%m{W64DC(ux-k%+K`!c?LYEm=&*MG3AJucYd6%t-( z_|-88`d)i)2c7L6d_w zKW@cnhF6sLj03JCtF-qrSrJ#_}XADm@ZfD&JnqX%iNy9*UJqpdr{) zQUBvB7;_M)N;Enz8N2dJ{rN;!;3-Ia|M=aYfXB5ttSJ@7+wrR*H-RnFP3KJylG)q( zX^;^43It0iUTFTiPD0!4Ay{*7Sati`I&=7R7V$lH2F!w9s00Lze6Z$O5l#n=*RK-4 zhnYQxC`Gw>x55kMl$Ggugky8vn#=7XrP!bxL=H%i(mGLeXYO@yvuof<6OBmcl@Al6 zU(PCZnit6%y?u)Y1PgW6LxOB=fY}h!V80B)6|x&QI(-gb+;i1$H`M#L<FK*a`2nMiJ6OU( zC;C@o{^(c4>@rF$loEsb`!_6l4fPbQ9-GfejJCi7qGEjXoD{#I076kM2Hw7)2u@|9EGp!C6X%04Wp(&`GYYJ29%@3;4A3^tT>A z#kZHJf+-*a$}qHgsCdx1-2~TvxiGG;f7z)r-Eo|Bb2Xy--$suVgWPd&XH$XnX%286 zz0~;tAmUo#aDSd0vhu`mUm{y~bkpTc#5*ouyS9tP@rhgePag4hw0zI$K;IX0`(h;* z%ubt<37=>j$Cz02DScOB zeOYvx@9($Vb)$GWi*;APqG`Zu{*|GWstN$5Yh&9aly)&>uJ%yU0?d3gKuWC`j321j6o zCFJh`=y;-#&zK(~8*%KmKMG0U<5(9~9>uc6!_)|R>WQkvpIn}(2D0haJ#k|6#lJJhH;pW@3jM?5P1fUCFZBpM5P#Q(DB1np zTwee0pY>Fsm)J$mUpc`TnN7#p=y3vqftRuE?Vtla%yTca0dE! zN(Y)7El2jk0p0^kZbsFCm1hwAs_)Q{CI53U)BYUa;3K9X%qc6vLrCG)|9q`;vGegI zh2)xy_0Nk78di&?){*M${^a!9f?i*VdcJTE{utt2#{_tF89S#UVUP_xv|5#I*XqM~;rT)>^f5e0o@;u~qDOk&q;3bnJ zjAu3Oj`W$gAwmVkFm>GmO0(&Bpxg_Cp6102DsdMb09CBG->xG;>QYTg>RC`_#-lH-S7tLUNK^4F6C;an~Zl{%HVsxnujh z0J7a(LI($<7!DJ+{x)9#C2aZp+FQo`b6EPwSxwh6p98;;8B_Ep5P8Tq*W!a@p` zxESomZ z+1kVBt>G6nU&+YND<{XvNHbUNY3z3rhwzeMe&ikBCe{3yp$qSv4YLZL-0#KUdLqIW zzXmE%^bu9hQYvvl36caRpnrR0)dxuqy4R0j2nyEYL&M9Nxy0=*OsT9?w`M^v$L%nh zf~tq8B7E%r&e}{*eFu9SSSBCy<->8!7LW`c9JNIO9R7o7`>Mty_Hoj}dcIE*PyZQQ z*X@z;iA!e$wtJ<5`c$9x(Z!wc?r7=xQ=XE#l1PSu#NLXRio0LhYdcWo;k|x|n~|8* z?kM}iu0c1a?&FF3VueU9?MmoB1pn=Xg$vM?q_GQ@@?x{1OMrl}yP~|j@McoS6ERo> z69KRay&^=i$UC~Er>6&V5$x?=6v-DEuhNw6la*f53e$nE=_Rf9Lk) zt+5b7c~sQE4($sJ!LHgK1kb**@^TVe+mgj*SMmxEPE#Rh|A*V{*@{#lzY~^;Tv6F< zBCEP@GnWLK>bi$PHV%r}kBXH9V!uwY&}o8#+NYKR&_eI}Lur|rQJfd5hbr}tYyD0+ zj2cRL&L|z?t0?>V?W6mX->DzxyxQn$V`CkB|KF9x7SK%5%J0vA6TMip*0j9ZYXWdk z?CtgcPV+|;b^RTHo)j=TFhJX#zoS{<7?Z7GX1kzUvj9A^Z&jKmM@Bjw`;_%OD5&4j z5U!ltkVBTGEnjuHqp6-1= z<9`yJ1Y%)f^=%IKzV5nwef?b`pL*<*Kw(EPt{4?|0_ohGfY193fG-x~+N$b*%N)I? zH?rj;>#u(`Ya@`?Tn(EXiF{?q3D|0p;OLZmW0HhhK!P6apbHY5Q@y+eiZ6h03HskmbliBmIHoy)rAUMr`4wy?B*%S{roEUwYa zhEejX0ZueDe^N2q6ilm98{q}T#N^TeBHdK#(HSm3jSV(pEsY>&uKh9)<>FmR5`a0|Nu1=OYq%8QtIhGN$j?;Y@j!k%56X3254q?5z+Y z6E=N)RRLN6A>oy{cqDkCV?jRw{+Bw7Ck{_f)$gJzDv4^`oJRe_iKRKcSQ@8(Ppfim zec#WM_4K3#_PAQlZ9A7`KNKhDV{N0)nny4#RJlB)7qoQ5NXGoc1uP;vdvAcJYjSIZ z`Ct4jgejE@%t_g*O%DfKy8ng(d0%L>^$-^BTL5EFyG>fQyHJ+_oW-NTY@{TVh&!<9 ziK?s92J3Bg)paEU`r1d^7EuTKv)qR~8Z);+S?!N0Vx4Ry083CPPk3TQd=84*aAvuOCwVZ4#6m+e{bbF>OJ;l zqIs%F7^~KjR$%1AeA+TrUE$;1?0eoKLoCfEu}gvMiR2X5U%m$*0rIE!9reHM<1}$@ zdF;KUPw9kzzqH&QWzVcn-$Rg8S-|%(4>uaAd#PcAT{*N3(9Tc7fEA@$x(T+p0RvVl zaqXo%2RCB70hX3w?}1uNOAJhJlsd?(xqff?wQu?iI!u}A>4nKd(Q6%Nkp0ChWbF6l zbHoBLIXH$qPZn_-Tk@la`gO&PrI^_|<75aAnMjx=pk;qQrKL@ugQW03=j-aDWBE@z zlC?G?I>3xzy*>C1z`6)W$5bJ))|X}Llf*}b{v)QeBmv=+EM<=% z2qX>|ONc;-NJhoo==#6E|9Vq3B@+4Ue?7~XCVn3B10_4w&fZ?ndAG1HoilXYuJ3Z& z75LPNOZqkJd#R;2?t{&Bvfg|XtSk&FlE^sW8Wm^Mb^cIzL5FkF>LDcaH}{75&(c$y zdN*Mh%MnONcB`lJ|M$3#(qi)36()vwCoHc#7w-RX_4B7xUn(0}0&q>|n4heGrHGkq z_53#L0hXem8k6eQy9P9?hEEonFYOv|6^gJnxi@^UHU}UYK(K-`ltj%axl~=P>SJLH zu&<+_X`nKTRC7(EsrVQ7BKAb2;S%EhqI`I4Y$%0sOxwid!_g6}yvjsnlKWWFw5cAo zYb9{Q=~Y@Ue(b#&sW3L=x?e{NvQ>IZ+aBl&Y64oGA{@`G$^FPlVj9)7Xa$yty$P)ZExvr`;No&;BLY9d!GCx?ZpN1ZUPiT1g}q2PBqv0l;3DnltDJ~nY_cxc3u}Tat!+VvsC&b$~2dJS6HZmb0 z;$-BLw@-RWRqIoh{&-Tq|{=)>znKZo4kVnCg57U0^Hdg{E9w)=5#Wb^Cqviha}&Vtv{}HgJCL3vivg@P2#^xO+00v zhKj1J(&Vf&U}_pne`Uzx>(^E#gKjaP#S&jv$Mbm{UWL%ETbF<^4o?+Fny0dhtYD$N zf`ECt=zCz28TPz=umo4dAH?Kg<*UqNY$7P3Va*@VHd@dWE;tGFf&%?`kHe5IF_lf9 zg>llpzw5opi~bPLk)7BIU4gsY{gsWKH_{P)wd~J@yGj77@aw^l=uW z_b4u~n@qRFD7jxfgQrq7z$hl}n6!J3ESQv(6r^pMlf?D@lIwY1q;eGtRIjYax&-nN zSZ!x<@y?&Ft}a8n#;Gerj1(<)R#r!?w8hSfY0VBNyD$Pzz-de^uP~O2HnLO36t<^D z?&#|aR`JC{?|(;*0`p{#-AOO7F7`_M`0-<_ajcKhz?|91?u}Oj*ad%lsHv|fFlkwf z8=?-yG&5TT)r3*Ui>v2pg2I{?s8`YqvU79Q*?1*1Aa$?Ad-G`0_4G@mQXfZI^q#hM zM(`b6U3+sktDQN~ z&H`{mTe~dQM#rY=R~c-HuHREt)YB!SR#pNCtP;Y?>moCRn5SB`1b1?%UkA0dS# zXk1$S4Y#?58iIJq|3E>Ql7IMc|02pc(+(w7Pps$OozL4=e;$cT<`MCr(~@Hpsa%& z zK>eY8vxDIxsarDkzyIFzx@KhVgTdlV z!VZtQJ|UTNRA4fPKY(12k$ti}oMuEtl!&V`Y_HJqQB{5Q>~{t;CxGpV4iA@pGtiJ> zUc-!spiEd{Pqu)c3F7N*Z4Kz4i-k{p(SA9i@5m-4-3#T#Oj_NS{X~<6U%pglVQ-8S zm^dY4iC8VvLIv8TFB_M4m-IgGl|CwpfFW)l3`+cSr308V+&~B!kVwze znY({v3$i9l0}J1N=bFFC1j)j}!mJf%WiNCrD>|s}|E}E)mZ^NA`I-+wpNvhd%8|l@ zv0J4v5hTQH9~Q&w_(%8m<#T4y*iVxl*Ea8hVchRs4FEP#HEQ=0xPSW)9Papt*}S+F zH)bSb3pNapr<%%26#@u;+4x^dj_Y^qe=H}Jm_l^rM}^51frn3xNyFitk5578Uw-hr zB!SpG1~xuLu-sm#H)iwe-!(E{td}0oGMI2*N7CW9D_dxF#*hyNTg=uXqL1(U~pP8)EkqY1bpGFxm3?_Vcph!LV-`~eCm7H0II5lVE zzXo-~4^CJG>~c=7?pAmxuY}t_orGBUZ)P?Qp~xf?LV+zjs5_^1!>?h#ObPX2*S?SseaBhL&y_Y_XIM zNzsw24<}DZz;|phHahyY!IM`acVoZ^lPMK`Y02(rEFA9Vj5pE;?DOZOEN~Z_`}mmB zcxA4d%-hYM2e5TNKJB8!vN`lhG0qsR1VcieXXg%roQV5S!_OS&K7jd04eF- z-Yl`2wio#DJQ!rg8)9bZOrULHV2a$Cb!h(i67j|L3xb0iw(CF)kir%YF8-e5PHK>b zb#Txc`{@(C|JC?{$K{sr^|cQ@2_`)k7m8hj0PaPxC?nY=QumaDT0HE;bj6Js&~_lP zxzp3Uzd1~roL)A&E+^WKk!c$kkkou4XGq7bzT8r!?%Tu}9EyB~$cA6-Pi})sH6Jv* znZE`B$28kKmNhy2BdGhs%71|awF|AB7uX;|dfK`) zYn=g!2?Vb~A|m=4Sszm#KZ2pgYIQQ%?bAJHj*uroO=mMcvqs~*LZr`3lr>T!7AE}0H?lt-*IZN5#Kw<2gh-WDG*XfRa8U|psU4#|As=J$e)7> ze2)bIB^$nFr9SgV?b1Vj!oDdyk(vn;S-YKiO@73Id&u#>4<>F)v9H&I5vY#xK{;TG#W@UdI5;H_2?`Q72)p+wfTrlP>*Vphr`Fcx+9k0X~%9<&3c+DRqDc zXbP0m`?0AdqQJhqplshuhI0HNzdt!w&sKsDu@H{=L=JYxVvGZtv7+kg@U&PUx-S0A zK?G$;%b+_oHeDZaQ)4hJn&(ev(-Wn@vauC*@Q%6>y(FD-xI3+ZYRF?%tP9c|ko9Oi z=5tSbqV`@UA9hROxns;ZL>D!}8$-!9%T1BS9maf8f!ITQu@zwd1QY9x5@0fgKNtHV zBcy2LvhM+Rbm;Qb{olD#Hfr!BO=NjSH>+SCty5RG-brp(js40~;2U!GII4caTmQw#i3zM{p~OUP=s<<8 z>%mEfQgJKz@9AB2{Fi4Jp|n#>#iF0X;Q;g!0n`Qt2KWJsKWig&U?AUmN?K}974nDc6{IS}~}Su>FGm#J3oNN4#ant?m07{M6hlZe0cS zKnD1U-8jDe{JrEoG*`$I@$vRtT2&RJL@6mD;b)(5nJzvX!=((FaunJNS(K_djT%et zC_a0Qtsj|!PY(-{ik_aVKv0fxuT%~EI#A*a*_j_{l_P{o$t^6&r41pQ9whz!1ySxR zi$>g=C4%^tw{kUxkoN zYm1Q5(h|MD!UQVf*_#iyH;;eQ0(4B;5s9F}-`>ZbXcMZ~RGS+>lx7=Ql06lZ@|Xy> zxOUv11*?k-*}#5%s8C)X;*I%1 z7Nj%hP8$h$Vj7aw9|Id1ONfYQb{T)e{>QR*d1iSmO`_(lz(9^)Pb{XZt|X^IaQ5%W z>7@TPh78I?Ojw40D@ShbdjqsXmK>&-^6HKOOtj#rw)9L|IPUN1fdgL}zV#m&gckqH zqSDeA=OO2vci<2Vbuh>28e#pSqi;?9qE?g0xs`_qv%rDh2@IeON&_isvJQqqZpEW~ zj}4OJ81NuJ-t6|8B2sVP-RwX+MM7wfs2^TyAC!|2_`!?27V zY&u#q>S3&>a zI`ET#xLL^o06Vdsou9W_s<#7a?%}9|M@K4PNR;xMmn5E+0*i(uz618^)UFp2Jscmj zT6fiC^y9+c%KxxL^5=OePVI!K2k%tE))p^Nav9e7ogzPtgG0Qg^ACs%^wn92H8ZK2 zivfs|lV3N;fH$i6R?vQxzhL-5&dm)AY)KElXKMUDJf+#fQ{RsEd{$ZSV?1BlhE;QyFJx4A!&+1#1~k=9NHR{B@Sg@pXrl1@3qcp%?1gw*n0AUhqm@50h`2jCukHTI|6TxDnP+b0gIp^@b>nm3_Ih5E7eQ1 z#@+_3&bT<0i;MoGl!x)%-%7lmS-qUh7;460W;!|w3mJy4@82;(v|ghV#_iyO3T=-q zWuK_J)|-w<*RsL5*3FEsQ{qpZCP0PY1IE%9z3n1J?9CsUGbCkRFgH3@b|Q?5+!WpF zned&-x6mhWQ`5Z%D@e~hHBs}xLt*e-!Rqj4=lkMpBRUwhD*_tmS8xJyJ^WpH$Fo%A z#`)tra%9X{23KmztR=Tyn{dO6uh=Lrq}$d(Iw}+6QXJuUS{HjIR1>*F2ukVd${`f+ z`voWtq!>WB`O!k;4Qnze)q5XK6B^YOLZ-7C8oV7&HluS) z!N9q?&OvEcmVri z#SBGppqyWkI-I!s)66i7if~H5T79lpwH&F5=r#X%SgNeVE_7jK4S)T|uc+D$4HlI= z+((xBF)cyMqMHO;>_Qu8qMiWupfby=StYmh@C@NuD{U!_6GsH~M8RqIWqVHnio)}N zNtD`vE99tt?Fx+?o&lEO`Qw0$9G4CD4sYOFhdia{|*BFW%1>l;ZO0zp+O@?;_+6WX{KMBI*93W!BZE~V%8Z6612Hqvhie`{M) zk42bdj6o#-yOi&^+w#_Hv>8d+bpXN;5GfCw42&!+EQ)^3>Hp=80~u2+Dv>n%k3pV1 zVr=;53BcxNIH_t?9(04yx5z^zx6!lJZah#W{PgJP^L3Di49^GDu+#S>GHrHA->3GKtE`5o_x%z^VCs>er4p|KfzK_+kVy z>sW0gXLW+t6?+oYtVATY?V`K#+56Rj{>l^l03B`X<3!(T5c;+uR}Y^L>E~_4A}4NX z_wn#>^Y7e?zb$L)YVM1LX4Q1r{ApTittg(ybE>epl@tr zn^X$d2q2<@&QUJG-W+{(HA5Sy6Du^&fMlNnSwtIHGD; z!ZY++ZN&jvp5jj=m@y1D=9qvn9{Moj40IK~PuFGZioU)tv$7YoeD|KYq+MM^OH0PX zqr54BQ>R#c`&YV6%N6B$cIcIr;kjFDo$bo3S<0d9OCLz?mw4{}N`MHd!iow=Y~!qs zr8PI%jo#*6YW@?S5xXE9U-p_vg#j#|R)c{}u4Cy`0rhhCqL$p%)z!gWQWh2n6vi^? znP!~Ce}lk?0oQxvJl$<9!lrNyaNBrd{sIP&wz07?>=URn;&#Wfwam?xyQ0|@{MyZc z+p*2gGl%Vv%LPrQz#~U)HWeZfBuueFoLu!SdP{)&Ro?x($igF_<&x%#G2+Kuw`3kf z;p`KgMSJ%zAWE#r(GjXKlbXeQ*|3J0YZv9jEmL+>Fc@08p854>ya5UOk{nK@!mDc{ z6n<}_zwKZZJKJO3iaP$`kgR`kzq}GFBqW5twEjNkTgHALiAb)cw-Yysg6<6OO2Gc( zMa{p5P)CW)%!JgWNJ1p%c!g6eILYiOGsP#`C2;tBi5mw7cfUOO zaHtyMh)eb82v1SfF}i+-xkLDaO)n?Lag9O|E;!Bm#<;qbr2n&-$unMmi%|&52JN|R zKq=$f%lMH`{9XfW0g}Fqmonoe-;AG~tqFy<=2!CNORj6M$!#(Y=e2Kbr9?Ri;pde_ z+*wZokQ0NKBmp`O#L#dd%y!J+V^$*w60EfHdXX{Y1P0SP_oIVY|4CGYHfu@5Nmw?$ zQOX^8E&eran%$~Li{&#-{{GQb$pODnoYNsAEiI2|?+0R@GPQLh`ual!g&0SArd+DA zlLn)B;4!eRFaCM_^7_h@Qnd^{pDPStt3jyF<3;=WUv$uVg2PX3>YX7EeB1Kq*rl2# zb}--KitvX3O%|stKVlq{oFh-rkVGt?PzS@^-+w2e`m_c)ls;Pc{4y~z5`kbxCAtti zHJJ#dnw$G4y>ShFU(fU;1TgB7^}Z4bzU#-{oG#%6sR(d@kUBN(MMBJ#SH!P}EVuxv z95`fnJz!twJv=f332KUFT|7NJQ~)c$XRPr0zpex}Lbt_QQs;So>%-~v@^5BwU)k5} zh_D02Ogo29`KB|xe*ALbKPsoY1>G8i-3mT95bf7@>BibW$dT}s|CyMXLB01Uw6e}^ zesRXOf;BFfcHq1+EH$-0FQpYDS7*X^5k%mBS*%7$ja^i-i>Q(7#29@Mj_~+%$}>-} zggzMu#)2G~tQ0)|It8uCCsLgJ#M^lJt`HCO6g$yIh6_@2nHe0;42&4Q?5=ptN-ing9N?`?*9BTuiH+LHl>O*q9P0^OXRr zEdR$0zc^U=x3#qa`w<5$wqcytiitMu!rUDZ{E$O`PTy^Tls~iz0ReSYR`Z#|S`G?M zWAtmv=X00mhqFvwYip~NcHuIie3|CWqEwG&`vKt9i^|Zd&GqP7;cZ}xU{hTE_S%Ze zWI<|64H>-WZ29zC<9if%aKT|(=yg3TIH&^{^d1&(il$Up2dWIdMJ*i5Dk@@6cf?Mom_IP|w&I-dE-E^}s{V;;QK5GvjFlq8(+yQ^iuU{G)0}$(C^UCsa zDO=l@Ak#9E!=xDxHznU9>??b^xWAe*3nv@pML>Z4TpjaSGILa1+tHTPnJ|d zK(B^`f6IfcFYpmhzXl~(;tR0uE8Rz;U_ZAzK;tJ?!rRa_`fDUl6bh3mHvRorqWUri zv*5&f67RU^WE*(=!7(g<`*tM7wiuO@jjhx^>4ur;s?Btwg+Ku>y;K+eR`%tTugwC} zt1;=QlGQUBO{36qVkLZON;Nraei2W&FoM~<8)m@z5s4_Xy@ z2#JmS83g*zmSy?VEgSu)|6G^qcZVk?iUgTc-OdruP)c;1?svxwwcor!&Ub%kNW9y3 z@U+s3oo&GrcF*9Y;2Vf9Q&5kAT^}neH|7{bJ)s z0PBVWYP6-;#g1_gYuRdzGAkfk*xQPWi@T#pe?OL>7H+RR0QjNEqZS%_xFFz{(30k|NI=DecGEOO0!Ip!|uH0wL zhO0KGlwxW0@G}7;Wd5Uv6-|qDV@g?zIji9 zoH&`3Q2Fv!+;+j057*z=#?)|aObaNYCie@PZSD8L--BFbxE}HFzzB?Yj5=I67x*Iw zw~y;OUk>f^Jf*Gbok3Rvk^3<*!PKqS#lx*VVw@5S+I_r31nA@9UC{0*A=$qC?*527 z!9<9ECw$r`BJE#S;Rr#FRQ#E06@!)_Q{WqE7z4rf=awj|fBw^051 zIW{Ir&-fLXX?tHefh|ct;2VHV09@x&#@pQSL4A`q9cu*^SpZHJWqg<**dA+_PRhT_Ls4iR+NDAyw2P7 zy}c$td}jWqFuy0&lT=r?>8Sc$wOVc5JYvA64j_e;2;Og{=g7`n6+AyO(gD*oOx$8C zcXzIYvEAKWg4Z5NE8m06Q{g9NUP|k$w?3Y=Uw|KpWPdWBQHBS0%QI-zwhVWINWO zymoJIdOk$s0Vpx0JAOFTS@H1BsxN z3PlP?=5)y(PcZ0!={fxexnvyrkkH>dXmp78D+1rW_q{VzT;pJ-fFj6B+H>rq(!m{* zQp^oClO^!1*DC+FW_};qX}EV|9*VzH$6G>hdQAJ(7VNAy=L|VmyURvwdNTRGkx<^G zpmXA&n!c03zl8>Q9UZ*6(zD4!1_52=^><*!TyBvsGN&RD3ra9%{pvZVg06vwrq#1y zBl$y{SV0f#&^1NUcm;flM2gvk1^j?6AgTf}d&yhV$Gh(f&1-_*fEYO)`m>t@ z3Ly$($P3LrJE;dcAnW=;Jutjw#Yvy3hl%*KQ!%`koLL)_>1tV5FiBi`@6{i}@!S-7 z+fQ$s)0R& z+^HjK;lXTqSTZGm*}d&FP3l_u{NOr}_I+FH#}6_44)v7MTSFd+0z-bMYHmE;^MQV%6v_&iTnY5u>eRR&c2{5X@}1EY1%X8#9ELGsuq zppq(UJOIl|xd9;g0LKreU^Zb~-%OP;I}VnjgMD`P=i@Jx=(rUK2%IV{cK-(VYDU7` z%>zf?loS@G1iuRSnmkIkyQ-^D^Y?Z!4UJLbJ)17u@TDK>2ifu(3l;R~sj1C0LAP%P zuaZMS_3YEVxWW}ozw~%;16+PjYYi>7mjFVV2oA=Aq9TO-$(HQ_2$70)SKtl0Dd%f3 zDrz+*an|G37QK_KXnm&P0h?W}TOrKp(h98?1_tvWe}hV0y{a4=pxp54h!YexyuQa? zLzZ+2>It|U{R7nU=D;^^o4Hz{xsT@1}wxt5{I-|5s0Kgd>4#YKzRUm zkx?>v~lR504n}hOj z|I|F{9qF{dR45`fGs~5e<1}d|2@|N6+96K``?x3U4>1a!XDjk_E|YoUveCf++fp7H z$L~Hb3G5~uI7rIb%JR81aPr9n1qylul==yruU-}P$$}k{?kI@Z0-qcLZsS)??3XXK zE$}L*vtd!UcJaS@@*LY&shDw3FWFX=aPm&vZ85>{oM)j&HWdw;*aFpG>?TbZOyfnj zdnG3r2Z*Ym*D3h=l^{A=9zt+%{{|_G*dFq+Fn_!ZY%WT@)omyA2w-H;!!zUy@0frS*5rq;c~=;PR(+CTxuOKQOeoe;M|N{t3bsW`SlSc2?j zze_V7Yje=;@g@JwNM{RhkL=j}bsqb4BZqnW=TBiv3yPVU890lgfqxemyRBSY2sHLd zIH=f(=#wqMWLz#0qVhv3Ua3`01}Eozcm8Y|I~526|Ni|u0P!+00vq)!7IiVMny_Jc zzn6nULp%~^Dji7|A3BUboDa)9&~^x8*JV57FRMS~0{Qi;oXFUiI8 zI(~h{!NJktwX1Rqj?6Pl3B0%%BekXSnG!n>n)q+V9?P?h$nU!`8Qp+;?ZEXFP>8@#Y#;&^xy5sx&7EK7x}k*xGNw(FH);M9yaDNw&K;Emcf zOk=$_H>Uzv7!Vdp0&j}lAu5*Q8YDsmaLR; zbKe2RsXmkP+4RXQ6=3#2T#^$vzP8}hw1pk&AI`?r(vnY?PT#KC-{0?Zeixw$2>x_8 z1?KKbEI85YHkJE)xk?6fU^b)kHBgM|%}+3^FX-ra0qQ5%@7*zFj_iC3rAbofw#j|z z(C*YV=I<=iK4C$83R`Q*f|aP_UG>M~H3c%KFOef>{$xJa9~ejtb67Gn{A7=c3JMOK zRy-Qo+B^Yh2uA|%r?231?BN96*W&X3yZ(@N$&K_?H%*BH9D#Oi@G}Wu`)CTbj~crq zMDcYf(Z1EE%kGLAiMW8ZtISeLT1Rq=WCe}a>w(tGRghV;5GX0L($RuHJOUSm#57)m zr+Y|ddis&QUziy!K#&PgvEk?6|Ih~%r0~w5+rn?BLI7;_bIzAlS}0SE$>>{i)Df$$ zbQMijE4MVQ{-;&9B;rq>S)#ydP&U07@Gyr)1pgMl>|7EC+zOTDZ{W3!CT%gv6f0nf zmB@A51NLBX9LM9FVAT+}-6+qr=<@}F=(p=Y0;D26ImrcD{{m;>r66~1l4r>>@I(P= z@twF9M9Stig4lA3ae{FMT@EW+NqXKqf0A4iH&HtX8mFSA-$Vl33n@wOJUx{QS>o@4 z)==nuPD^E@Kb!7E-?IL+ueax6X3l=-syt#XwYm-M;$V4})Km|txp~A{xmlg$x{5_! z!+{JF5PwSC^PPn}2fhN->Npckqj4<8>y_%(~{(`AW< z`1JEI>IJ;J$&?Pb2W6}RX(MVK_|*ungC(f{0zBo%Y?G*OCaNGlIa|5HZx8dfNz~^6 zE?~j*`*dVp9#xk2)zwvbD`Zhzqgo=zjbTzYr*@k8FZmXO{t+}ni2*TnMA}gv7`s`e z^3m-?zU=>(5mW5^Mct9sXSyZDB5)VAZTWx$C!%q z3BK17r@vpLZGCBJ34nqWtgZP1d=2#UQdzs^oYZj^!==Jv=XY*1t6%D#(Zcj&R*0t* z(hDiEL}8YNg|E2`Sd`_^KsTF>vfkMEhJz$8g@#ic$GdX+ z`QObuqG1&Q0d~MhZzcz_kQ0XjSjPk25fT#q-2sUi2z(3EOG)<%EJyIZwJ$xJ&BGaSP(3cs{e3TZ^upEk92K?v8%ll$C>k^0%XaU{K z*n!)Do8;?roc4URStOV!;>gPOgLXm)DEU*hxc*%G=>Bx#&2(%rE&s<`k=Qn6uW37z zJn1R|^2K^>>a|XK_uH2E9MR@-Mr>5*aPB*@j#flGzdn4L-2)jT@5Aozk>v6&ow@IW z*y9FPSVF{8KhrD}`6Qm~-aZ0YP9)%V6oQpi1&*`R5d=qo1k-cfE$`vSe|eOmtA{@# zXo&Z&{DO#JCg4ZE{)(2)eygC?{WARd)(b`=*IfGi2n4Ag=|Yz36?EVx=D&)V*UHoT ziahpU_7lN~0w@w{VSZhdQ9&I51_ATq#cY9oki||`Z|HWv~z-{l080c^|H#b|l{7{w` zSPU}yCP-(o$17I=1wu2Of`oX??t};~KFeDO@!QP2Ms}hclo#NlJ&QUo`kWomOPnBv z5YYCxqEWPELut5QFHdCR0>pxrms@YX8cnGYek10pmetUps^F7HuUkKFA6!ljO4qQ6 z!88<8U}@fR9W9Kf$WD;dTp8jayDj+SnF@Zsz9_A($yu^#fSby{22-Y%i*fh=I6woF zlJwhUB6cULENd|yY?A0;g)l2xovBR^Etk?tGFKHe_lv*mVhiL(t%sNwX9lgO#5j5uu^BzChjtd&u*an*q^BBz;g#@U{Bu zR+Xu6&@F8!N^o&?19spTgi_cbXKulanNJv6fJ@@7_dGa#D zTVBU10wmuGO2Q(YO?`cRus%ilA4yjgR#nr5MHG;3kOq?79 zl`)3IbV@CpN1^D5aC)VINDlR=BaL@^3obIHV!;+cqk>$f>jq3G-?P-y4{Y9*$0${* zwzfv#1>gy8MhyDjCR;0`SU5}HfWAY-r5j=Yod*QG$y$QEkXj(C1o?00b7j26P{F(Io+3-|4i@b5jW88%6#K=nu{d>#|rt@j=oRin@jBOW&Z48CjkJAzox(7&S#m)~~+ zLOKz4qjGxKTHJIqG~^W(!gCU<2Qg>Z@aBM%O!54n@FhiIP;XV@$G+U%A~JS-_feSJTJ zwoqAuY85?CTJrn92p%8DjLSnB8~ExngyhRU{#-|8&_qEHoTP} zpOQx~44;Qh~*7 zRA8)*4<%K<674kh_5;<;ZMV7l(2=HkqITuHwhQl^ExdpDYw78OY$j%AsSFyv^-cS< zYNrMNP*u6K;+?|SFW}Wah~O3-=gCo#CDH=(O#SJ6=@3zF0EtimeoUHX&OWYpm_Ur; zMO-ZQcJuCz>RoKI)ZC40DSmAvQA7zTBm8)sC7Y0PMb&Gp)V&Yz6^z~Lu1Iu$v{>h5 zoXaKi$S&?j{7A=x^rP!xEMO~Agy0c2U%mSF3N&$)TC2}4%V*GsYuGC1CGsRT3x<1J zX&)Y7Dh>N(hWs1swy=SCsse5eDq?sqnVYFvg23j1J$z`6UoA%za`5-hBvK-}uYG@~ z8E{Qu$ODD&IqV#RXD~Ul+n?~(a+a^Qg>m<=(-(PFw3ioVka6cv@(*>P9(V8V;n z?4k?YdZdXAK70@Y?w6=L+B{zF0TijRg8^2yeiW$M5O(_F;>C>|+7FPhp3@-tk00>O zAjfV+&S7wNH?BP4$V|H%L!$_lP34ns^l9RACf4u0YEUshN!!raTqvLtVOjc=TIDGW zW`u0(s{wm^Ufxz9WejF~%~U7`JZmCvRbKm&AcbAr^W>>BjncR=gjvxH8Jr~SZun91 z2O|fIa+WMKA_RAzx%0A4Y&MD;+hK(YlbNUQjQ5W}v>Y6W1KYN(hMT3M6D8fFW=8c7 zIVk8l!I5>MhR@{oUsX#$dWwI7I0vZq%>5o{az)Qu*|XNb@cm-Mg-d(;Y2SALhCF*# zNq0bo`;m~y`>rkF`#fuzq?NYSb(f4v41%cK3~L#RoO`Nvg%)Jvu*Bs9_K{$tr+nCu z#j9{c{a|RmKcV>E*X*D8 zy&nLL7r_iSW#O0_Te}>C+?X}bP1`mf>FEJfoOjbWHGn5>Spg+?UbFk4K0CH4Y7P938-6|kn-6kHL(WHX-?IUa zjX+boi*2AkY)P(Zd_Kl{6fVkLT$QO&IG$qTGmB7x$2ba46aUatoCLSciNAVw-@-b% zd;Rc5%cz-G_nb)|_GHbgEM3g~+*}(^!%JFBEErhreG#xD%q^sGW^awnAxRyTFFO0u z6E2lc9$BUQZM8o;8n#FYoBw{WebQ8>prmM#H0Dg3{6JTR0SdhLm{JJYc+U7hDAMz=J16_l+Um7`dKzrJ`Z-4ql9+uq0}yg?I9njzxG^#twkgrXOi*@N z-ffymhOnZPQ3IO16}UWxi_%M5M^%cfXJyb}fHaKOucU>6zvPGEzBmk3sNv_R*Hu;1 zm`j0f${*^jmVH4Co8Uvty`I<;t%^k=8`@zGP0DeND(9Y@ob>(vy=?z9!`15Y`%HN9qI&KMp5+>7kxBB~pm@Al(8QD+&66JUG z$92%YdX%@d5gsTA|Jwwk{=bK+QCo(@kC?p6sb!?Lq}6ir4Wb@U2-|XW*x{I*j6mrv z*f4g?ii05EvkTxG+7!$1Olx(EmF2$1`T9n3*liY;3DFUWbXq44W5GmQ-*?P2;e=%s z(u7U@%A&GAIaz5$kSP$&R*D>4{zwb`h@=I1i^BgGQ^#%RDZ@%S|9M?Bu>c?)i@+*T7|Ib2Cn&j{EyXsAQ>>t{gE@ z8F}Btjg2_)ARK`Q*x?^B;omJ~&L2^JnBB0Y!)N3#P#r5W|*c}-wD~6AfCbn)qIRWfl*n@iDCKQg1 z)$3-smuOY5MmOPR;?G>aETl~FAqIDchk#(^TO>YvE|{k$xbn!HV64UEDZD#ye2D1W zln8Mmd!rf9QL|2k2|xV};0Go+H~p-6DQEvWki4u(o_AWqwaHhZ8D1xwt6479KA#n-P%Oyb6TizkkPt zwEvYL;Ha#BDORjg=*?LYW2_Cpljm z=CP4-wm%#AW7Mq*8{h$L$7P^{behffLt-Z(uJSTXIQ+TIEbfc*8oX1tSJhLEF|kK- zjzCg+Z^V@=&vz*b<~5W%8D&ujdt)d6Zo$Y2yV2%l-yZ3Y~zXYRxI|OIVm3 zN>ey2ZgO%uDLq}l#RX;a+`4*J_yMa5`H|j`iGR_r*8p(VXdhK7pw6~?)slAnP%%Hm zgy_moOpkCK;|=Xyz9g0)Nu$`lR91iQilsMxtT*8cs4(#DcfGkcB;%6`%v#clg(*gj zmK{g&8TsJZ?5p%}d8DX_qT(tYFSe<-?bXqd#uF+EG|HBUB8Jj>x6Y^ZvP()3fN2EM zwfLfCP**V}MIROG!_@)Wg%JTUaW4Ff<@4;<cMgrrg0>4&GckCZtv-YC%#H7JT-S^?#6@}m%U~&(|F0dM*3)pi zC%&R$oDyr_hV2qj0L=TpLHY~vL{4}!*H>4u_4>N&uh=XXLdwg5H0Z6o8q2aOFEuv~ z$>qIP*(+H?yVQ81o~o@4d1e|yG0;{fojgUE@%}LVYYbKS%l2ZM7Y?NPSmHsHEtRyJHFG>}z!j)8q;WZ+$Hi^24uD8NZgB6(cf8_8 z?M4BF?KRE0i)QFTbsDu21brr>xotR$RK>M8T{+nKb$6;~<+OTCGe016_a74goEY(o zf41H86Mx=ivJ9m@uJHxTYJ(ky8woP9b;s}D6zHhXzKn}#pp+Q1YSbc+;mBkdK|{u| zULIQV>?%=ES_C$=O7bb%!0hk43I<+Y2o(rJ7ATWeXQo$EkEm#$09BEe!}hl_$gZun zCmGC%JrxuS+MK{;sIX|c^ec2~L8;{WinN!EYM!Nr{w4p2K^o1|jq}@V5>>vAOn7U< za&&g+&1bn-ZFP@F!AW@xg$Kt0#9;VVT-L|;gIpR{=-*FS5^B3d-$H3(ifG3`rGPj4 zWe&MTO)~IJ;baH{L7+$l#T*ysiW0|UJ5j>O4_ zjHWnj_4wcEhZ&GzA9a>%Co25u1AChDpW1WJk^!zVdPj<}^;*_$SYj>mt(0Y($hmU5*z-W}6%LRc>kY zp2v2WEvnmb-0FmvJ^3;Tr$$=Q0@J$?N`L7@h=OM)KfV$%1TQcCmx{A(cuJS znW-8_sN}|&#iT1%sgsSQ^B;hHqrt)estPE9-vb3VK3XY~8#5%* zGJ9&jglhv=ZvrGQucvJ&HZCp+PIou8a0QIFngU82>9nuZ2X^Stu_~JXxN}>^@9hkl zuux%MIIjuiVf!sxI_-%rRDGJ(S;#;wllgVd(+j_IWsx?iOUHBHVxsD`+iSPLX@y>u(@gJJHvt8-+)KwY?gv>Jx{<9Q|C^B6GY@`%+#lJ&U$(jeG0m94+Cla&v4p z4ugKWfH{X91I%`j>}a9v=vu4HywDC>fmN8AW4MS{dAjd{Kd}005dZoCX!S4Y5GO(j zX_#B94$Z?&i7s!DBtt7;1Hkqgc*pncU&?+{rsbMXa!G1e{j&bs2WKf*L$jdjNwT&U zZ`#*ZyZfgXo40j}X!m*<=P6RI#9PgD8Gu%YMGbdi+g8VZtfX=WY9wY%>Nf>z8NkpWl z+g+d!?>S&zbR~eJ{p4sEzixs!5LkGdj&Pl=_1VbFIy;)XTgb+4*{03MItte`25C}C zmHuWBMq&iUz>9ae@2_v);?hWO|3@~DWHdK4eVp?1$0t^~cY%INS;67+%4!L}q{06) zqOZZjQ05Bma4=zlso+El2f} z3fIh;x0{iXqaj8x`>!_&0kW+Bejf}830kGn&@@uCgmH{iezX(?6AO#n1^q0SoQ&_N^ga=y1t@5O&uNoDG6@LTsdgp}*ksPYW z)a4TaM%=7aYJxvm^Jc6PjlpCws9hT*z=U`QWx@$(#Ts_?TjXu6{x`u6$vk*o)UiFL zh2ni&M0Z9WPdxs+&UTW-;c2>m3Rl9;L<`Wyj*bz6IgVc1_n|LqYP9&9Wg$-?G(u?Z z6!3o>UGQhv!Tp+oXjDO_N|yOk6B$FiD$3&Nq zk($m@1*L(P9mk5mBXY11IahT%xa)g>iRkg%?Cjg9esd3+LvqHjY0V;ADElK7?>~#@ z)L}K^+#&}Shrc1HbFEqXx7-G=9#XZVv?CI=o!<(Q5}TODC8cc(&fML-5f$raVq%gw zmCYo|#s^U;TZtwbl;|Y0U*oN**v@_jFAyD5WY$ule|P1$TiPeCV=`4?9?I39mteIV;bdwZN`rIh#9|)uZTT z?)N{ZYm_2>D$&Tzh>|h+8!-!{z-fYrBMqznlySyYsw7djrR*j{E@0?wm~kO(MtU9k z$>jN0*Z%$&|JAG!?te|#UH=a38;hcV2f$Bm*H&-)V*5rO*7Nz7nc{GZ`8;> z@Fh;XSbL<9;%d@=>desQ6_!JlZ|+p@XnU0A#6X1?L}br_Y07d`i7#hsu zA4X7+%x@qso0O438c4|aCCNZE8!mI!38}bvT6$m&VO}$HoWK8bx$f_ zea1(x%@*0w#_@Zt-JNSF(cKhIMcSz9;BJloWyw>^H z>_&Ujn&;hx`@wq8XA@7)w6L-nq4ZLx$$z2?uOiZ2oark&#ejMF$~bax+;Mr|glVb& zrt8Zsm^`dy_jTu%5HV;_^8CD?IESVOk{E6o-S{MKsQo7J4GScVbFe7H;+3*QXWs)@ z&_GaMval$!>ZeGJDf}{KP9}*Gx_N&~L^o#-b=g~ZZJtwz@1uM|g-n?yQ{FHtojA8J zCyMk+T0|x7gkUr?!t(EE4@k6axoLwf=X$oc$rn9mX;3=nSX%{bow9O2NMU7oxIX|0 zfn@*Km}yO1MwmgbmDfqmkX`kkw<6lAIc24L=dR}?EV7$1Vnmj3y&E{VF3(PjZkX3K zV>#p3$Y3TX+~GWRXPf+(C2vtad^wkun!Ii#Dy_$gh|z0+eD4YKBEH?6NR0myi^<|M zkg69puie4F6q~Jrg=Lq^@Esd#NOx_)s7k7+s~3d&q3FBXl0$`vV)yz_^C=(C?aH*# z4~9I{VZptClc+tn*uIvR{CX^kF-zp%&(9=ZGQwlNyy@=#VD#mS?-M@g$T- ztV_|h>Q}c=3<^ogI0N+@mRr&s{z?$kyD>n*CM1*(yVJWN~L?qz{<9pamR>4S&KJ5;e2-3AZgI}Ny1Iq+|M20UN8!6&YZZ9=(@IUsvr{Rbel)VDLU)od;6Q%d z-mfR0zH87?YZz6b5B`87LugvcQm?`4Lyrl+T?Q2~Z3>9M$qtu5oEo6L0C}}Ik?yvr54CKg=G?JPzlE6NfUF(OiD`jmiF|`U$os;T~FSPBRaQ? z1Z~`-~gm{#&yG57aCfMsUdJmJS?&<_APIEBQ&KOAoK^YcLN!tNgr1{ND8kolq!528Bc$s@L;c^2za^ zLk3$0QsXGnawl;=I?X$YjfP(v)L{MB2(Y(h5P*FdPaUs$5xNZlsas+UjIC`a4sLEC zYDHJO1)l2~FE`+*6sZgZNIzGb_wj0N%vG{}aF zHsbTVyJyj?JF}w&NoV3E0!^eq%$>X?_PQcTY7qBh_V5UANu!lH#=dHW~-dis}$7&3e4 z7*7jPYmvnuOGI`nt|ej4(fwCY5a#Ww)o492F1M`{|3uwse_CdkPD+U^3*6(W@bBO~ z)+&dyndM3`Yk@l}cZOC;xu&C{@$xz!#(Hb>_Q$m+0S@A(e!e-)=yxE(fYQo_cajoR zvumhEQ(PQFDGag|5)$I_m++~Mms0^BER>XS6Jz?hBtCPo&QUuTs%vC~HB@<+sgW%+ z4~30Ra{zN=F?^kfTlLtLlETDXaPnYAJgY>d#HuW76;W&ASK-Caa_#{HCcH?6KT`F} zp9-il|9c&kirRp3ES#IJ)-57g<>V3}i!ah3lUSP0LI4y^BVA-)6Wediw>bPh8zLG_ha^HuSwGI5 z{(%4R*!+AN6LYRx=A5eH=R^snl`htA({zeMhK8Eq8kPQ{>hBd8g}Bx=c(G^XH2PQUoM!g^mL*p= zeRSkXuX7Pc^!?V3EuxPLBas*T3;*TJ+he<~_da0GnTGt+B1?|Sp{l5-yEX;Nj=IGv zqc+k~Qrjxc(!+yI=$MZWo2suK>M`HWmjP;w1y-I)vc`9Wm%lNEEc_jmWzzahmW)jN ziDw4C$#6hXFo;oJ#kgXy45hiE=~l`ax`tB=6X<$Gg&hv!y05;{F>2Kg@2g?vqFA0CHFP zto8SoZ3KBGObjGmzho6F(a^sOBf;+g`r00&pXOoa`l|wy(P&psE(r!`LbHPO**=-~ zf1hPU#QS-EVk_J4Oxl9B$R|AI9@Q_ziPjjhU(m(X)m*IwskK^v+5L@-s6|Y7Njfsj zpTJ#cxpCQ0X~Ilwy{C4`r`f_+jV*_{9DTO_lc8H7bCP&u%5F95vPPNhu2^oQ0Jo>}I+;7@9nm^~8 z%M*!pH*i>zzNBER;euY6N2&AGpKDWQK7}{>k(@@k8NK3m36dA79r}be$FEAW6LhNX ztY3F2D^=~?T5hLS>r?Y|dCS#mn)%M7xC)hSE(F;?edyGUr=0YaPxE1=m$=))*1(=4 zQ#W*VMUI$@sC>Otht2X&QxOxtgpoTPa_6Z-Q;81uhFUDAFl{t^T}fjp_`l6YLD!tw z&e0#WcevckNgW?Xj;unXtkGa=HfQ-ED)kHr*OD|Jl57)kv2p0NyA~a7(&QbluO)%y_v}OOi8aU%y z?%(t20?JJ7x%9Hv7CLgrN8!5J#Y2=(c}|Jn97rH^I*Sz&IOY1dNRaWY@CL1NIgt)C z)}Zg-k(=ZfJe-9Bx(UfqMac+_Mwqwi+S}Vz-WJ!_M9HMO{gbduoQ(*JXPGF zx)HNEIr=;Fg}b`=r4hd~HoZP}2FZ$9!QwYZ2c1K$oYLHl4`1v5>u%zpOP(MHy69G^ z<%ACI@?g3VuUW43I+F^^Fa7Ru<-m~)J#=cD@W@4-`1ls~ zn4p*R!Gm=uy|8NoS(pq>^AT=h&mcDHgdZ=m<7n1`?9bwoIs`u{O-fFaRaz`NI&ZTi z0(`ilBJ-~<%$)w7Z6TIy(o13h^um@Z0+?uIOwyU>EAtNoNC6f^cy1hrO*-7{!}|PG zVd$^~&ze-2Txk+{Cd+O9%0{CIVc%{bpBI|Ue?c1fW~0FeZa8!QcD~g59HxM?S*(n8;P~DCzV&8F0H`&; zE|87VbG%|TG0FdOH@suNzaO$$lljE6_WW=CGlgPpD~cQb(?8sYM|@ahcsG)Z)K_xK z=h`JVuk_e;s>~*&6NYyVf(%Xs+MUNpiNj8PTsd4dXPZWKa5drp?+dIcq<5QEt*d*JR(ql* zzj86;{dZ1rn7jHI5&c`>-5TtYA5=HQ2Ojk2GON8gaS;JI6x!Y0ebBAArY1ax{>5_- z^ZdT$D&xAFC@PWXwKk*{J7`2+Kjkkk3;(W|(itZC>}6OzUuKxuulgGs$ZL4|9>3z0 zn;R+aA4{LJ<>pzd7o|oAzdEylX0QB|U|+u&fDQ@9U<3-rq*W}eFLGW0e`!0;uaA}= zT<)I!oC1q*-Cqv5C8H_Wn4rJG{%UABp@~pm%At0ZNf7H*4&SEwTDlW04RvoJUuPbH)dfWV)AQs@bA1whzxIpR8`p*MS2a;5|rz07H-qW9*ijPkMBIa(J=x~I>+7~9W8cz`G1MG zZLmG!>FeY>$|xl<+NZO)uzrd{LUc-In*aSfT&VxC7u{Sa;QyR9*8ITd<>d|O_xOF; zC{DL6nEkr@6}=_6fXYrNQ_Gef`D?5$*BJsYv6^<=u+rgzwZZO>8OS~0lWqgNZnU^K@s(zoryQWu_P0$SmOk4HE2Q5KQ2BT?}8Du z>908LE6~#b@>F|v-AMBj-ecvx>X+6^X?FB%K{5=EGI;AX0#M67baR0j8Q%L%@Y=y% z(@+PFp)(JIgYxd_DJeZ?XQ-gY0506P05bLSU!sHvCOpr2E?obVQ~Gz8yg(7>xI_u# z6t8Hau$Sb;oHAa*O}^$3q4TYP&X2(BBG5IZcuo$IfIc>Ge~CK)oZ-vle@lpOV6ks4d0UrR@|c%(jr4m(gP zyIo5_$K51Py6PL*`bnDdyt1GG7BqzSk0avhv)9MFe{ge=DUE}0pn!(g{rjzg+B(g{ z5>OeCk{yqR{SXCbJ4v3od{X|-LQo4M#V^Sbb5B&*C`-U!?Q8ar`#rCJ?f93p48p7a zv9bm?S64Aaj?>aMQO&anQ#GA6M0jOieae5Ru8oB^ZUHaMM zsx4PzSH`e1BX4@qXcBiiSBnlTmK2oK_T_tUT3>VpyMa~g*$^$mCh%qj(|gj}1ucjy zjw#9S0ztYB+kmCXB+4u_JLuWC)P#dwfM6Zw`^>Q{1?7PnKb*(8js@=npf_yR$G#2E zL&j`Wh0!5Nqxpbx?iUlI2t=zm0-eT3r1Tvfe_;AR7$JGBNl@7%I$*Ic^CmJ8$I*yLEAo~V zkZrt`$eEP6=n5C^3h6c2KRg6b1!5qcvF}j7{8qbyn=|z5aGpXk#YOev$ou|v*HW;> zrfNRM)i@jF2|k2;3C=%~844~vY9T2rKf0o68z!t_)euW#kRQ(WhLok4RBLTr_nnNn zv}|@+qAk)L8#Ezv`J}R4zjB2JIQu9)cP?L59XDj)=t7d={qPO|U^B-gf#8gxb=&HY zN|admYtV*(&w?IGFi}O%8(6hQS-Z+#K1*%CPjwyETnjaukt}uqSKo*$S*K*zWg3rl zGdZUm)epu`pMbc5%x1D_M(9qS{IUCxi?hI=;b;~is%Bp421Ib;K<4l7vyo2P=5lF8VghGRfIlt^~ag$=C0y95(LEF{09NCi&)zZ!M92NR(!djSeD=V&7fp7ydmLoI0y z>XE+VP>}NYtpL@QdFSXxz}7w5;*)Q}g9Z_DC+^419l>T}I)c-sj@n z3>oeD)^?uW&I@za5$hmyRa?lZ)o#`{jlC5`dw+O-cS2_2Uba+?irM&^{g!}!PDbwt z_O<0QO`W=HtrqcbE3Z zr@N~HeqYl}udp$Y*kP!|pj!av!(s8^4sd4H|t%x33PL zKe-{nw4ZR1NyqC$U}%X5CiX`4xNY+@?AP%x+#H2Lm^6zZ!i~g27x56j7I2~qoLd2X8-g>wn)Kyo;sNX2273XAY7z^6 z$7B>b|1KjRayc_Yj%A&kvWZpF%goCwvgc>Tg8pvWSyNW4 z*s;Ev$b)3(QvIg_HBG|{(iDAA0Tm;(rE);QWE4w6Zw%3c32jjdUuBs)rdD@5$aNbbeZY%cdSsF>yBL@NozfGNqc^XifL!iZ_Q#Czy$`VE zpw-_BaWN=Xq6<5&q|4n^UMMuDBM+#)j2$&OYdw9!1*~NN(9gMEa1qKzHD@~h3!ql| z-9b7-obTa#QN!KL@$=B5#}kh)4W=x}V!#dXDo`+i^#f@vTX5_gYt78IghdKS3h;`< zghop{RyESk?&Xw*sv`2~zJlO1 zt2?3}7Av<^rh>^u3mhVQ{ko_seeG9aHFT_DgW*w_BwFO-P$ zk~dbDPC_Rb7w0LM7b+ARXsPC&BXXBs_U3dqYZs_im4j*pz? z=Hi-ITogf8wA4TC-hc~rkNE;ipCgx+bhhn;J%ov_RrJH$Co+5R*oz9Y>)(^d`K`~h zuI=ADvOtQ&0g%~6v~O33(L?$e_uRF8pt&sJ+lKQ|ZwMFAX0 z1Z(=(7!@bq`D+)l@!U|sY$+>@Ew4XRJ3pO$4kUd-eg5s)C~6}*(~+Uaoumc}UjB`R zB*FsxGEn+MKVGOpXm&p7sIy8m=njIqxL}ng$*hP@aNO*H<9ogzH(YOPb(Bf1nAeNM z3yL*A6w}=*H5Q1`4%rIJF~Sm2cid-bAJihJ@;b5b2?k(0&x<%>u`08T0{$mXZ}9zA zQGs{hbb)M~#-DRnsu=3#$=zV48vJjos5Le3eok{XtRgp=yL-UeE*h);9-^)20)YPg z*T*L(B6Qf+4QK)qJk3?KSkNpioSIntHKQktrQ?X5yK70_?f$}_M62M8nBObR%BFJ# z#>7lxKJ)YN1cZh%x#NzGjOe+$r}S`$Y;0_h>C?ERJ5NXtmqei2Lu>yN>{VvAAU zdc$?RR2vUJ?R`J2+trP-9yK;Lrr~r%!D*mACsjjRW<1xBRruW;Pv;dNkIWhJ(=}7) z7f_y$+IXk8K!JRY8rT#GVP?=3GdF9sTs7Jr?MSp3_dg|?fd+Koi~obuKB&Rqn_X%U zzOwxN$H9P&$VytS@x7NGroPqA08 zE>B?kOF6{z+SY<-X{7H0>;gY?qOA7w2W0CDykk%k@7Fu*K>)iF2^t!Ia=jf5pUp82 z*04&g@>BM=lUK%U+X36zLxMlbJPIzpV4CE%0$&{0`yCwHao%Sc(rxxNR|Fm+1|aCI zvy>0_-o{t8zrQ~(t3e?mGBOf0u6PQmBozH}fRK-3TRVf-0m7Ay^Lc1bawHCe2iTc~ zA+R4X;kRNX%R3_3*8)l^+OWA@biz72t?xXEaD%#?w?0vcz0$1Ei3~Ya#T^=E8YbnT zJWPvR$9=Yqesv`kt|4h&a@9Hk-8G#;v-IemZW&+HIsfYzND6Hu z>1ZH}K&aql`%PfborF@w6icyJ7F4Kd49{n=8&5{Qd(n%s{Xd0bmV35JqEIQ5SoCZ* zwBEp~O@JUd^zabn|2Hw^I=OzJqFdbB(4P!^{mkbv&NuCp&id|8Lwqirct!?d9i%gt z&h1y8Ov-5TNl|#@-$#dK;7~Qm5R=rmy^V_%bbmj7nr*-uB%c>;^(Q)y1QkxP`Qo0g zua9B?+kxv72LWU%f>pX|dU&Q+dXB9;?+jHAZFOnW&Bx5q@v1jLMW?&eNg(EZwup$p z@W<%JVVfsL5qo)OeeQIbt7{}6mi+i;?INK*E(tgCfqI=xb$57RFZGtp>}?FO`1DMQ z->Ku_kM2q>h+ORsuZK=2I3B|B=|FqrMQKmIO=#oau=SU^a*(!N|K;(}irLbjU+@o0 z$DdZ(ZyA7!c-h_>0wLZbue1-}V6h}5L!}NIFE91Q=f^8{NL3{#QyVdhG-&C(ir+E& z4-idGueaFCn=p>ny9Rm8WWj{@lnPiXH^$2)VAV9gI*Ub{xd8=9xb52J`d*GEBW}-5 z;(A0$`I2;eYIrYCpt7v2tinmq;^G@D@ARakpI4RuzCETo>Y#E-5D}(*tSqcSLytC|N|%yirSlYP)B7?FI@k6lVwaE`hoi6+n1}68vILMhuhyB?~QH z_cc}qj{Sj*stVd?r%-%#hf;Has+yYVisA>HS38lCi^#G`<_bJK&45IR3|chwcaiI^ z{9xlQ10zb3cXG*6@8jZ3@&n`lX}yw#|T3!f3ztnW3ix~t!>+L zR%o6+Wy57#2gr8pg2AbHeG=&0Niy(85pqL1rP*6U1%KK!9k>@Wo;Y&JmA$U1d7oki z@>AfE0SAtKACRpc+_D8tek)T;OT?O*8ad1wftGDfVxVyJE}~_s29>0ib7Mx!Na{m; ziU>1j_;f+A?NOOczZl=eyTA9DKFK@;K2JvlMXsl9UXQjw_^eqjLd0BC3-YI<7E@C~ z{>M5Y?!K43tLv5S@&$A$+FW&3VT0E9@mE8X8f)Lm3UT1wXeu{vVb984T2YAq{)V+% zwmSV;{CR|E%n06Sn|ay0v4lHRE1btAyBm3MSO0Tp5AMw$-VosMhzu$@!A8{nKG73j zf5D6p-_NfI2`4qEDlmtzMU|c08LNDk|H7vK7p21k7twkRVoZh-57X7k5(dqTy>9;+ z?d;`PH`CC&!NNnk7Wt9sYMWCZrxMzLv`bvRg1zCV^M4CA1rc7?DLOMC**nZQ`h<~k z8sP>J1gw@lb_Szh5}ngd>3(ibPT%ZoMWx@{u>5xrEeN0;E(Fq+H{b!zFm!qIA1A;B z?d*&6Y1#n4DWOK<-kc z!j0-82htKf)YJ0@h=0P~&HFs@IiEB|TxD~gdh)Mbm%D5}o%*oH4!*9v%}dPacNlN| z*6N{~4k^-GlUq- z5~inH&Vb^vC^cmdmTb6%~!kFZRE@*;Qu*uoZ*t{KbVC1Ax0eM z#ek;70K$>qVLalbl0G`$R{2cbA6Yd#9Ik?a2y9c6fi1`9O>2%7Up2Zgi}H;fRz&D8Qh-5-*Wq-C@Lwv-VqD_!$#qo; zVWY=$R~|SR!mHECNhV+hR03GJVrQG-;~Nv%(A(a_5YMRo;I%cKrn@7ekhx+CJze-s zx0Rv0@bHj1+Jr!MDBDl<?X#ctjum&J|mE#djSurtvIr+z=l=P6WNw8%a8^zFzL#Jwpp zA@mgHFD#bmsHQ8cRVi<$fxF~oTI387H4N#+OfgDJ!p%k96C?IQ1;dwyi=p|Ly-oW1 zl?X{luz)?o*=+NawEKNYJ#-Nx=X;F)(C_<#``Pv?F4HLdf-b zOcTHkE`Z6qe(|SC+*-6yVKjJ=fp;fB{Ti0%YNAys>voKrU)Tx`CcWWmD*abw_ua86 zzmQH`m0GDWC4-3k+Ws}yvw;arrqx!F&ZoJwEFfa#L5O_)4E;kgp_RB3RcB};|$i~)^!^BJOwc=L_`x%Q*{WVP+v$ea|7{v1zuz(^a|vA>#l z5f2FciM8-bNXb|SJ}gHe$8L@RDxZFc-rZ{GU`C?Q&JZ~}FPKNuc_u)j8!x89jH%LT z!Hq6awXE|0b4}BZCZ=gtY~Fv?vy;JMB40HuFycPXvSu&Exff57Ks4r>(D4FM_v{;i zCaCmYs}ha8;|4U!N;t65eDi!4W!Lh@X?~ONw1IG5`xXWy_330hm-jR#rj7Yqwr7VE zmMfrcIBS~M4xDfQN5jbSA$?5G+4*&URAv`Y5ezTLc=(7+;2Iy+QF;3KBml2lN4J(> z_ABnV)sagidjiO>kXSeFuzCK5ZjZ#bX~BvK!6$y&hdm#n^*B4R@ri>UY0xT@X7=}H z-eGxqYV8MdUC(W0lrC6m7JfOKV72h%tgW4(dC<&=z@Y3rzQPj=Xn{7z$RtJ&V_9JR zNW|!7q-HYX`I8siH!#5ZE(A~$Ke*m3765^HVd!^J{o!V;Tm`&GAAh)gcQwnr3^UKs zV3IFNAtzH=aGOx(_#aDG!4}o`by2#zdq6}Qq*Gv!kPZRqlzFTel$0q#6=?zv~5z1LoQEmy*{N{JZ)3xdYwt)B!1MFqS}Xd(pjy&nbt7rqF! zsPz~LtP)X^K|_w%{YI-aoJ2>!gUxun315#|smfZGC&W zeP+?3HU};&5kHOj&VTuXSIJrJ$SZI}g2eLUs*EYaCbFVra(9m+>DFF>P9lfYt|>hU zz?3`tf#&K-%kCgxy`HTio~&c%`5qYXwewe`%|Doym+I??7e3N|jRxmurX8E%+fm9ufPeEtrec#Z~tfLx=QgK+;s%4Id|{6 z(X6@l>^jm=I2bwGBfy4*PkawZmd2CX+jJ!6G81&ZXS&;NyD|X}KebsN$@;yN z`gkMj3)v?@r&d~BqeiNK=LiW`e+jF3Z2AjIL#b5)e~j)+)F4V_M46b?|PC`*~p z6_OUvv@pB=%uQAxJ1>#@O)~Tv<^*U3ua}m&{b+W-KX%V)6AJQK`M|3~a}SYr`sO#N z%NA;rq_oqjD+r3?2S%rxHfD9~2i}U^y#wU>;BTj5PF@(Qv359Ep_ZLKJ;ZJv_1X17 zK=Fp^cODUXe){}G=X04yod<0Nz7(`)HbklKbG5(O-QC+5F)S1A}zlhb-JsU}duLpY+eBIgSQ{-Qv84 zJFfSO{G$MSy-<(a^-vCOmw$4i7{2S;zMI#Xl8gn3|sTmeL#Nqo`PZL+5~Q&TexpLQZ`w!MS_GOD1c z_*j zU-(<9UbAGq;G3T}j~+K|r+qtPzQvze^Hp2^APZ0X=tL;+s`}c7U(QSSU&nJ&72ec3{_#AYGlQ zh52m4t`X=>p0pr2z%ks*LE+GC?M*h&quJrki7ww6Q>ACJ?;h!rmkiB(a_1uW4K|0z z5LeSYdhqLQD=R5w>jKhaY6|U!gE@u9py*^x18z+{io};|4#92pONA4*lr3g(V~yK3 zx<+3Bn{ErMVvlhP)3oQiGfzsCf0W9(A8MS*>o`41ehpk9MYW-CqnWEA($^8v*Bvzk zxikhCw*=_s21t}h2!68@!m%v1653?k=+uy!mlf881`5M7C!*>5-FX6L%;>k>*iWSH zD|fi<&yUnyNvw}UrcCr0ynh%sM6&65hshhX)Td^6zQy<+1vWokyKmGCQVjrmPx#Hcbj!)=6ycDx!g#~tL!|3dvB*=O-SjO~0O|o+ zZDhwb-s8}I(0G>ROqslz-)l6@#@kg5#3O-jDw0ei>{h{tFlpbt2*gQThdjD1asIuJ z!bicd+^N>2%%d4Da)}()Nfy~$(~S3;k_-j|tZm3=w-H4Sx4$uL{ojm7n56>rS=w%o ziZR~*_{9}@v1gi$TggkIVXs;CUE&#pT$iUVc~icZF&>oe=n#Pz-&Zbh@@$UL&W@SZ zHZryxjs3TIrnroap~i{evW5+jiPrm4qjgAyx~Pj>wopWbz|YWQpTO2xKkjmp`lrn=dq$kVFRj z3EHr_T;Fgv>Qteh7U%slIr;8k#sGlp&jL?3HmRSv0k;KU%IkfIL@q?GKxVhNredSR zC}qf$Yshr|TDSRP{ARPlz9TAQ3aFXb@R&WpWw2|oy4ADYv!jvZB429&5Fe*%m2GzW zhuH*yIp~k4?msUS9`>YH-BZj5oTG{iE&u@7b1|Mp!M1Xf<>6RV}<8C7yrQ+qzmafS>8yO!{_>GFKFv|6= zv&QoC|96IY0H*Xi&01)A=0kXCDNW+L+$LD)Vbxw<>~uzfG) z-ZPE|eJGh}C>cYY2`N}kX^cq5Fhj=lT~MoXIp_y_u5L*@U!H@q)vuZ6c*cYzh0wt~ zwaQ+g>b;HVyv2X0dcLy1{ay3~2l#*419L}V>ZKOXjbEE|m=d`P3nA+6o3QLB0>HC( zwa@qFF{7Q@z~>xMz04Eg_4l;AS*}>E=%`8pYXxPW&njm>ukBz^ijWd@G!qjOf>SD# zTR>^QLJtQRAi2G6>J$&yc*yv;(E%#~n$EQ83L7VF{&L$r244Gb{^$dvY`$OL^nq0f zr@2{4l2|Fy7(D4q(F#Dpqq(_NeBUrd#4iV4??rk{5nko7@4TIg6#;w1yPc&14T${8 zREgA6_~R^BWs7@0J%Mk&(r?dTZ=-2SJ@;QVW?sY7mZhGjd+Y;Q(L=}d$@@=!X>kKy@Um*b$smxH&p0ao{@ zR3C{rVNPzNdX4Q`sZ6-5<8Gf5)+6C~{&;+6XtEh^sf^MvpIupU)my(F=+Mh)G9+HszU3qGtbF^nj^N~>t@9qY{UYd8|1dH3{2T)2`h!12q#Fcb)K~|Q_LrznXSr7G za^oTD28dG&QxQ&x+@K|*b?#>Q=S2W0+mBhjlQTNi-?_0jMkVS687MvC-G^>8WPfS# zTujuINEZ3PoRfq({-N-82*PYm+H4x7jET*Iv_fpo2`f=;~+W47IB2&6Q9aMAy8rmH@K87SlC7 zKD&V#p$*2QQf@bcXkXM)B=#Yuzx42KVRfZ6NAA$~TOn$5GKTVM#V(2Z(nVY(S-%Vg zwR4pBZGJ|o&cG2+jelq%bxm{$+2%+3Zkc9U=IZJSv%dp~AaI=z+j+NvVz**v-kmq7 zm)F-cnQTBQo~fa}wc95lm?lF_HB@*OnNPN`wJT4=O& zAOtqWI9J(kXwy+Fr*!1_c;(uss#moHoJj86BJ4TRaq8QN$*YgELDR|T>f-hm;rPV)*On}8O=T!AUvMKA+<@8 z9HHg%odnJu=acKf2=K7b`_TsQwR4hm#8ZFdIu+>ss0-!_7WKb|pUY7$*_fgGv4`SS zTpdw^0fpj3yby*!mPF>*rv7t2 zKV*_72-#eNz^UQj3g1N`x2Jq6HeL8Fp9``>g;9J8f9fw2uDG|@12w5E9qgYmbOzys z*)m;-5w9NW$zj~@1~&l9Qh>~PmRR+GnC0^~`4%SjsN`{|vx<>C`h8*HNI){DrQ}APaJLcYii0EggW{PII%>)MZ()Ap(dX zY%73-ZSIJlKgy}cVB6VuY#)+4pBA@Xj}AM8z!w886#ompXGB2aD+Vxt_7$P$u0>XA z!#!rv^gt|<>!)`WBXclOvnL_vXBD%k@DHM<{D^0low-%|@l11u zerQGPcp}F5F%UoC@fGmz2Y&b%}BApde~RFoMt8lvACmcXqI0EoVk2zbI@Way66aV$gRQA2VjlJEc z?9oejt)we#2-kIm*}^SaZ6Sh`vS{x)Jb*e;!?+)^;Y4#8N8cm?y|H1nXV|?MM1_O&%qF^zcLtiEy$p@(NEhy8_hIUf9xWS2ub$PRAFTr=>2ku6403Jto}1FQmEqC z+NC;DT`I_S^wc#zP^B$c3dX(e<~<36g#uy@K7a)dAS#M{w$1)b*l4#LmYV7#sehQ* zTU)M{WaeA(g{M=5^Lr2E#D`SNIRIp0V{@de1jGoQv420!O6Hg#t|ewAn#^dGR&F{V zWV|+VvB&+1bxG=ftO$W|U&Qe~)@XgqRnEVmqmCfA~C z$@I*{SE<2dJpC&_9S0}5S5%o`s*|_L)@=#+Xv4v1Qx?gQRR8hcOM6;}Bxvo?gP6s# zcrmlyJ1!a```xn&;hdhSIbnRGS1iwgP|EJKwC;#gec*WY% z@%yJ`EdkdQ;a&_&xM8CYrl>u}Yo5BZdU~+7HqnW?*85s(4_!@zi?sf45hR+p;_5iK zQXJp#kW)US7=@t98yB{gnz(K|z&yovmr7G#eJ}C8cT>`wcs?vLYi&CzQEO@)e}3@a zr9Qi?Gns#{D^c(T|IY{h{N_`5^nt)ra26H@2J}nC+E=kQTtJViKl$e+p{~=gL5{jr z&J;%x4^0H8xeVUPR}7t3jVkdOJPSudg_hnuq~@Q|AP!Rfg5QwuH2wYkK@{fiK8U4q z-u2e9=>0zCm*BJ~-lw3TAfWta#Uq)Ie35-o6-}0<_*S{(_e*Se4QM5a;P$i`c0(Uk zqQxg2k*qNBlg4taxfBJ>;fko6;EJgDum@RW>B`GMQKnVCE}Wey&(R(sh~pr9542)kY}_pSKGN-S zq*U=4UooQ8tI5#^Ln>9l?bq?;(M)4$DHHgQTmk;3(w$cug76kBb#r z*^e6!|t=+7XcJ6vP9c`Snpo?44z9^4NRd1Z* zjqU03k~|b#TSm{?iY215Ql^t$KnX!c>E$7;w@V?8I`$+xPk5&9ua~}&f9U)6KHA{h zX0n-bX=6|dNqq@%$)JReVVIQUo)Q=*CWxlY&ekMU0Hz8$TI0N<>S}yNj=_-OmdZ;y z+{_jbF)n1r`FE2?xW$&FjL%fc>k?c-i=d>3si>t+KzOmsP9!d^sduFWBK)U!`cDk5 z2S&?u@`L`qb$z`BKkC-_GAQTP$CR(!7LB@r_$d<@X#*H667moI>~`INb&}z`aZtXN z&$lH8=1;`*4kxk^{m5U39}-d`%!G<(SUKb;LOpruM)4pGg~fFa+x^Vv$BR^Ay-R1fNHGl>M>fL-?I%9P#=(U{4x9+B-G4pPb%}?OQllXej;mI;0X9(}$ z^BLwSg|rJE5w1V{KFP)u2SNX1i`l|=(PUyl%eh9(dJO6IC&WiiUB~VkX!O=jrb+Yj z@b1}GBW{8fYY>ly3j_+&5=%%rO8mxgL15JJsbsX; zfrbrIKAR3(Y$(w*#KOPXsI5yjSp*KP`4v_%gpDYvB!>}FoEST?TkWtefmuG|Ac^0$u+>*ofaqT)$YT9DyGcF)f{P%sq^Nm&C?q`n&@|3WR%75eBuux0~ zHS-gyB#V7DSp8;^bW;=Kt9*1{*?M3QG-OHgS@|@$yi{>w-&TLWg?Nahj$ZaJg`h{y zx8{gV4thLJ?sOiX4SeeEO!p_%-&#i*jrYM~N=3~0&vXVYK5$i{ieyWO9Y75_8`2VJD?SUd^R-`J3tbb&LPCoKYs0u4DL!QgsvNur7Vl_5ANOR6Nb;^L z)Ux3VNKh%h9o5n95iE5?ZXR(va9mP2oOO!5YLZ&`4(q;{6#eCqW*pHrv+&lR7JNd! z@9KV^)4op?E!VCi1Ii#N1CG+qaTqORz-#L<5a3oX){PlGqcS0TP6S;e&Z%+T)<#m{@rLPm>3 z8|U;GCc2lCL#9Y)jZGauva4{pxc4jURPW*E3_&hGdYoA#M+n(BFkg(AvUgaxl%xx( z8wEH|P=XfK;9*14p%-%%PzHZ(k#?XX?=pyJg(+EYU?3B|LYQn?u_c zVj+yz@I>LK#2}}@LMFdPStUkl&|%4%rhpz7_8jXZT9|G;`+=J&S2g!u5eGq>0*%2& zx;j)D@8GKRR(0ltjzCBc?-2~I$Y(caY0pF8sz;c986F-W(+vXRS6J_NmeC&R^0~uf zf*oRa{=11g6X4|uKVBjM1A8+hq{Fm{Be#tvti3%Dsdu_g<4*HQbWp;;Jua5%FiPZ7 zP_7u^;0GqAR^CO$(?pFQW=$-*HPbj%>$e5I{FeQ2YIiy_eiG@R$#vGk7E?EJRxD%)>8>RHf}wpVijY3w2MoApD3 zXRgv2rhoT8>e%|yX;1=E^qQsqq<@dGP7B$i-vble{{f;bHbbqqJbB%+oKrYef7Vo`AFi4CQ+-Kn zuxXN+j$j(#*fgyHa2yLuS@_daGY;Xq83^zuJ>I2_nbSlqIK&nMa^n5wGt04FZ7T{* zsUr6%O-Tti0!cyxs~fzbsn7x1O{GIJMY#t@1(IC-kj(G zgqIsu-3EE`M)>yY#KE=sH>B!TNcnJHf{V~=8c72th#5LeX24}#?IL>uk-izZY$=pF zy&O1Dj^oTk8@>*PrmwV_rh6pyJZ(aO2gGDGI#oTb6HR;&Ers$04FKKqU_B;-0=jKaVe zx>cIiF9&a=M>rKmeK)9SG{Z~;@%o0}@6|@sbL0r;^~$fa6cawJbZyz+mqGE%RLrnb zuciX((@LlWEjW+U=TOIB5OC&D(fW-3_*mmM$c#q_T%TdPCX0>5B?Jjk4s9QGiq)Bp z1r_u`NZLXY5(@@D&3Mn9ERETb{4E&sBgP?#a@t|>FP|ePj2}y~K-E_zZpe|sF_zE& zNrINa@984DXCO)mlzDPNcy&7a)zqTVM%UvXUi;rIsh-sa3f}E3v_i88q-u2Jcr7k= zR6RBD&X&z0JHq$hSkqSZHj#wn(BWU{Pk+Ha8~z60&?mH*ffIH`7t}KwlZ$R+eKX09~{frWzdMTLq@6 zI+Zdwx^_$8p7WR!()g{6(5O8YnI3uxi)cu(joRlwz^ePGg=E8@V&9-{fBD2+bGO?m zfR6relW`8ik!zjsXUazqE-j1SMf%(emd{U8cN6h)2O~^<7s3fK3M&tx5fnD*%&};q zqiwf4d*d!fJC+r~g1q@i#Yrpixr}g1TP9&68T+keR<_|GU{25Vob(%C=OWB zX~&ej659A303SsfpWVPn?tz6b zO#BxH1d0-8;Z$3_nzf$8y$kS!P3yeRx7q#4(s^xh6ohV{y0B~MjcTWRrV$<6w`=in zVk|7kt`n|_p%HbPG=%6z!w=k0T0PT`kKwJ<2@B zxinD3?+M$_8VVFXvxlzSWS9?6H}2uS5y>41^tp&@nt)UZ?&284bd?FLmZ)Ci6|F0=Zn?k2Dvd>5YM^1>vI;LP*coJ9RYfrZ8cHVBMEAO!0cc4KsqmFC{2-3&IV$M8T4sUl>8*Kr;jD44i zG^DZC_4|;1_0E56-YiEL2GDO?U3QG-O#g!Dqkuk(H4Cd=j$&kn_U;p+V1cr z94lUT;h@9H6>i_JGEi0qC!}c=77BTYNC=%3BUP$PBX!|6ipo_`-am(<4UERq%sz)) z2C&qrNvn4e;2yWOUzCjpg;s_NM|G1xB4zmi&4;hTN;!jjEeT(n?I+y^w94)W--AIa z>omYF_CvdfF{-q9B^%7wTz9FNRUOsNaYn9Y6I#)5*<)g0ERMm%~`MC-w5MGnJIeqz!Knrr>RL)Zzjl zfv0Pije|c|;cX*l45j~6{QHZ{TS*U?*;~W?2Xz`_CeeH__k|tqW^F3yM$6!1Bs|b`Kk~fQT9GCwLd(eELW44-v(9wTSTeBZZ9}Q z_Bj{TWEZ^~A653Is_b%Zhkb$3^OH_d%CwE0UD#WXf1Hcx+p7kSO!~g#PLYHMQ0GKy z++_B?eV32SGFynM{kDV+j*Se zF`|l3cbHx;F#4B(OBsdKsx)yO*63f3SUU>@TCb*^zOhQ#?4L4r(!VSAEL*O3pCaRZ z&CKAmsa4T{gI3b~7rI&Pq)na13cKm1=^S^Xut!st_}bTLTVHoU#3M!UnqzoQl(<}T0^Wjhk^a%H}u|2CZJ#f97jF8N-kq#O3^ zyiJM{%3aTr4#oS5^AqJTEwXIIg@{ee9ucho=}Y0JwPUp{`MHNg2CuI3Sn>-o3%hg# zCqha_{bkJ(``k*Lk+TUP6s$u0IE%$3nF8})IyEkQR$M8+4|CQpR5ivfTpxH!N~4`x z=&i_*U8`Q|%8hM@Q9FK+NtdIbE5;k#aDGnCm(FS@IL%ow^IF3k;W)6-tM`M9+Sx!v z^x!Zvl9Va*8AFHxbPA%S{IpvT7Zze9l%k=HUWfTq`S}1zQFkS#?CF}N&!kmGB)jA% z>aXP^5ne7X)%3Wx!oM!_b5bUD2VV*Iwx9g+?IKPC!aDFHXO*3z_>aS378j!E@Q6FY zGp*rZ^+E5|Ry2Rl6Exh9Y=WkDS`^K&`MJ4JK-EUcXG0S3Td^01eFOXhp}_g>!$onY zvRTAakO&|=qsP6{s?uCO75=RR7BchVMT6ittNDyYEgl0>;3FfL* z7tv4_S*Txj7u=%$UkM0%R($-o}Zd3dbW2dqlQ)SE0VU$j(^%N z0!AUk>%XX<&hF1E?0u2LgI4U&mF&5I6~{>wk+j(gNj#v-bsa_m)R^Eg6#}vT?nF0C zDX};_81eG_yEna=Tw-I!as{#~Z#^3!1;82aTarjJQ*p{$aM9rel*d$*&Vjrg@9DB= zHLt4b$Ig+YJc6=yiiBA6hQ{Dp04zDoZaie0{Ym!sM;DTRswzMpiz?E?T_loZrD!yd zMHUh~m*tNEoJ%xyvch?HdA|4{qs4(h*b}%eD2tHb)dTJaw^k(LU=dRMU=emfXHqtS zdq(arN&H4R9jEIB>O8SwA!n7$6J2*jtRHia3dKf6S4d9y&AEJ`qCH>5?j4sLddFl6 zBqY@HVbnk#M~5sMZn&~jIf*}O0_rk&t zOZ6hdEO}oM`*qoxunjv+A`#~x=ZFbqtSqGRYna4Tp~aO@TEX|Yp+6Lj{+%1cr-D&V zy$_jaZ;6-{Y8>vhEo>JD*4Ag5ecU6O1i6W`z_@>j95 zLEiik-H~cO#awmdNn?oCiSH(?68!A5YNHMFm(wF%a0w?6WyvTR?Z+Bd{zpncm z6z+G`kg|zdr|#jYSCT`cUu9xY_z6OdOaAoqd`DQhX>@k%CjF#b*|Y>Br#5k$&OW>% z1Ed|wfN`@MBL@zKB+!3}`VMcV#Bs&vYBL4hT)blS(tA3MO8j7KZ#qn8Z8RG;&M_E3i{`PBu6UJU%#6YxY{1kt=oHMwcy_jSPBvl9i=7>rlB{5pO0C*F6bF2qjIBjJ4;B2%)!MKiS4tt`r_5`D?K^Kg$4MY1r)z-+NX7! zg8!DSCLYUqsO^^?i7B>s*Co)Z+X)()ysIMrtYGJ z?7G?g&hddn;yErH&+tn$&MO1w6SRlz(rutDJ5Zo@i{j)|6vhK`LQ8sMBdtbBo=12| zi2@@-4$A(r2?4p^c{Ys?X1r7Zf+pj;a1<)E1tP4BP8hxaUYjVc>ABnvYR(aYdrRjZ zV1u65Q{fMc>SQFpz~@!=g2+WwLQ34@=iX_(QR8cC!beLj@BqC;W4^%}8wqIx^f&IM z{%bc!O?rOw%>7j19&SiclN*-ItB#xs(7Ml*8_8Im5{1 zWBz8r>Q~-jS;PeEg`#2y{NrsTCfhUvoBldRQ$hVb9oB9p{P@h(W+yT055r>s+NE4!M8VHdNg8zd4Dl8#6xw+ul2#p^-fp0~=Ls;Hd-o0_ATgNXFEze1GN18yz~=4Y zuUl1Br||8iI;FL53Cg-YLlbSn3m)t`s(8e z-}$8E4INd?ed#9_o226$qj`_*cc0GwUBrag!Yjb885y|dqXV_H@UQUH&chfhKKgB6 z<}%_D$o8mBL>u?k(S=E0ei$%|OeA%-<4`y}1+1t;;7RMHQvqtzR||_R(LtkRu7RI@ zB#laDz=G*FX>FF@f0yRN5>J8)hJ;RdHM47#^Ey7LJl=K*jrVSNIueYGJ$7Em31@xa zZ6gL4)6#$yO|iwa#G&X*2Gmm<5TlHsD_%2Ij4D3WhEF$fz&7NkmUXv@+4~`vgBC%m zw&W!gDLZ)QACeh!V!AJ#I|HMK*g+N3SFzYa7&UwVW|HB&@mkk&ss`lSxcy1qRA#VO ztCc2LMvFKzQ&v7h^tNJ#0P!j*T&!{-YS;-qE_SEQvrLHLJ!x-Vq`-61*v_hepr9b$ zUcPs%KuPqrQ%krF?~T!*k^e6L_*b}Vm5&9mr2-Xau4f7zI@fE>Tuj(fMiG)cV;k@{1S)thH96H z2#!Atx~gT7136HZT2>1_%+iA^of1n_x=JPU!LR8{h>T~}SirlNlq3D}N(z7s^?f$U zpM$?t0Hp72PYhZHLHYdAEWah;hZs#tIxggPH)l5r2JrAtQ*ge3btx#V3I`U!BFSyA zP;EkR*tms@$^7$%BGO36WV`}c@#hkC12JxHACt+8V~w5soO#;hQ4t>Qgl7bknI=K3 zC+csWcAH~OXT#0WtZi@423@^_x{6Dj|22-0HpBC3TW(x#?rxUyWe3Z1fqrV54#SLl z27z9`OaWf=-46NrsKLrR#dhwfgLl9!@(Yn-5cgd(43<#9lvZ0@+EmD5=PO}GhK*9Z2fJO!jeHE$%i3fhL_yYwh^G8o12@rBbqEdW_cgbp{3q(LtbLDE(d?NE%nFO+_$evxAG&6Sfgbaa^j!S<5tr zpjoSi?K&gOm(rKw+x_uUW1lgZ-&NV_8c<5p_N>S5{XLSE53-(SC{tib&+a2<7tu#3 z{GDESGXx$K_ZMX71J}cf!uO?<;55|E&O*xfj+ThA-B+}$jv8%!fT>as5&utt*_Nly zU=#=?S=8(Vobb+-;7^i#eB7-8=H`p_ul*&jUEdsGg1!9*#Vaf~*e68D{QdjiamXVl zhU{yrZz*a6niT-J76^2$bwI5kBJ|2n1i=60yf|y=3T?d4K&qsM8AjCSv%}CVLd%1+9oA0>$9rJ7 zPQZ1|yT}&m{Ebcy;02+X4P@w$m=Lnhh1b)ehDmb^-)`yKtnh@yir(|x1);k;lCi4& z?rHzqlX!a=p$VPhp5$Uxf`a%y#>s#)TpqXHiuD}K#L&i}+%eTF0UPoQOE3UxtCN*? zgvH7ArGkMeao7zZ>!wBzpXVN%gRtM5Qp!$!5?Ki{L#g|aiiNWjk-aA@{1DLv3B+XF-?Tp z|7-DeplH*h5ovD7xaSBl$^kA+m}6D*m|}Yoo|u2+{_4*8+`a~mOPgdF^xn1Nb8w-; z;^j-fjSkN4R3aBA%f|`d?;ng@D$SXZ;983h7qk|XzC1cEidIyW5gKCI`+X+&zrs zoapDK9Eg<*s&RAH=eAf!N1PIJD5_EAiwzGwi+SGUrf8!NG;Y{#A$e_3JiX8TbQaon zz6NNt=lY6`zd((Sw~p3~g7<1!fqmS1K(oC4)ZDv71+_EO4@B_x?OVXNK=D6Fa-F=% z4T=V{S)0}I4*<|{+RSkeIoBPcU-cB+Ux>y9EMKwl`_|m9aN8EWh^H$7USGcdE#LtCq|kRxeVZOFt@q6NlzqGbq8Ei7*NB8>vGt?yprPMa?I zJ@X!oCxZF8S@ApI@e$p0fEowM|G8BSCniMMnuN+)hqKR^b1G*WIQ+P!GpKul1tI`Z z;S!V?-7Ag`IcZKR&fP0IsU^>4yb7{aA!y=_OKusdWl`-Rj~b{Sk9xUe79Dg*!-Hzf zM%|VGwiEz}S#Pz&=UC43`)O0N3Aqcdb8J3l{vRxj@o?FdGL_;eUz7y!vZhyGr@WQsHz&yv^a`wapK z4by|`MLLH(Lm@1=86thp5##pr_)S{L03#1)`WCtbnLfwUj?P}d6N+Iv%RAQtxcU(s z;rNypq7=8TY4@UsfKTrW>%EM~iHqm87`5NAe7>*=8V|vz0wzd*PyJZL%c}018}QSc z_Y0|wC$e5#gKshpmbh8+@oC$4+6hTyq?D_?%Ni!KqXaM>hl?$C4mgV5Vj=9JJ$xRd z6LiB$JS#(P3O^DbcE{JVjIgaEf1S0Fu`NSL033}Ig#6X}mf3axY9q{>iq$}|@`b3M zU>O#0z4;~55&S4f1i*E626Hl#}v>*!{+cP0QD6zpc#n1h;K~ zQ+0`Fhmb=DX-3vVZ^F+7oCAf?y?w-{K83269!xyFg9JIXZ18rb)1Lo$S&~rmR5&eQ zsfXYBc$^tFNS8%!PL@O`L15r|0HWw*p{t#1Z@p?f4*S*LEnn`dCEL>_-@SS$qlLKo zamiy21{6ymvT2_}!T012KQjO@ugIj*IgZZj#(Z&{n6x)2+gd{^1oY{4L1e=4Yh&0? z^&o_PDv2a|+=BUR$l6$PW{^CHMbOLB6a8)@aX9~MEzrLw1apFhVirEe?xoNuj8T-U zF(SDquSeh)OdAWa5Z>U`Jm;-a)a%io*E#e2hx1_m!Ea#Df3AN3ojiP>2Ar0ITxC z7+4#=+Y3=_{kvrbQ0=ib^O6yG=egp1%G7|=Pu9v!_hG_Ykx||Rf2*yg~PJ`DV`Ou*@`o#>MjIG zJ=@q5A7G|?X&ZckH6tk(DsbKI`{}(D=Lg6p)BcLKMk<>! zCV$$<8HuoUpnGGsPI7)o@%4JnDBeu=*TSK23mxzsPFgj9JLrHd3fLp!6V&gYtw=xn z^*$XZ>Z8aa?P#sz->FA_BW-G+p&K7M$@`?f^l=a>_)ksc=3d*bY8S7PghHaiXk(y_ z&)5{oAZUHR{9YEX&C*4$P#$!^W-;Bqp0ItHfHtJdgR4llN zc%?IF6oc1G6{%wSbFP3~_-aYld&>w@ZKC~A{Zm?h+x`teBp&eb0D{RnE|Q+R!)eD2 zVEBXK}54>bz(LH zf5rr8kNyR7HjZ*+l)-0i;l4gz0WZTZt@9rh`BlY)@FXy?>iX{@9g)9_X!UX7pAwp1 zO0B2V^%&q{Aq&ehbIblWi%Y?l>H4vmP-mDRT{ww*82a=WWY$;qWU^ofyu{!1ZPAyDWP$9W&VwN!p? zq3bG5Wcu*O(ShMX4C8(%x0M3yN6Jt|=GZq=ZWh(d7BSgh7*NMd7P?H7%`Dfpb09^M zlF`hyR*P$#fBW&{$7=-sF*+nXg5@s|*F`r`_-b0Qxr_d{R5LZlEwAmGt>M#H@x#Ly zpvz$k*zV0EJn+)2GV4p4EaG`)o=!{Z8d7zZYr}7|;Y`$}0W1khya&c~gW?DNURkQ4 zr)B(m-ob6=C?q_(LAKZ!yjOVGy30723Z?rsQkz}K!h{wKs8|M+24I=I01=hpA0_8o zU72eaIsk=p&}NQ~%_45WsG@-RhlFmt%q)>E3M9S6spRPTI?ADMV+0r&`(TuG_vrP) zwyckNmf$8}Rv3U&za^dk>B>t`m2jP{eI=Bq!`M3lQ4%{OP7FYi#gD@e|L@wlhBFRsYI@|Js zdx_Jc7WFjDbblO@jsHzFYNJBck6v4T6eG7~kXCq1OxWgo04iJ7fZuy26dY52)_IJoBrCYP;FLi?AW98my077Eqm8fF9;>D|Wm{pwoX z1fnn5=F{37d9{!Mn5Fb?9NQG*o&uSgnE-A3Taj1ahk%V&Bqr0x-(1o=BfdMxd}o30 zY_?~9sx~K9J&!$QlkEG|6D3nH+k+~7wOK6nE`@43i&k+6NNE_*gjx#d7IVl96CM=jd8U#6O;zDENDKa|xh&m7m5Hwg)gH$Ig z9cl@zDg+IO)M^4dg6jqX@!sQ=f-FESz*D3DZF;g&hWEhKO~um z@JAYMT%TnSRbsT%e8m#U^=@L}e6we8jDbUS$HWx|d)F&v3v-SzJVd0oib4=Z#DX zTe=W@D;1Ybd_MR*nptG0mMv8El|e1P<^9{y6)Tay0#0Acl~Zzj@m?}=p0q+Er`m8E zH)>E^wX{)8cuqFZH~>X-SqB94l1zs)x{Uct8}*Pw?ZssXk&}UUO#amTBrp{urP*;T zlqJSs=SuOA&{^HNI{`kl|`-;+6lFBnh9H-y3S&wNef1XAK1`ch>xf0vYl zC-(aVg)TUoEA~I<2n*vvREZG{-|H7; zW+JvXc$v$sW#050*V1PdDS8C0ZpKyuX@TQhuh7}%svTaBv6g0V^P#gYDZ z>+CaJq!KFj0NX{euaV1pyI*E2dlF=WYD`w?EAQ_%Nyw_8?6|mMMN(hgdRMdGTx>wE zI*AeI9Vu|R06n=$tM3RvogSvGSkzkwP+E&v9HqYkXjH?OG3OxTqV8ez8}!WLUPaHLCxaPsZ#*1+6$A{{f2_-`+$fU&WOC^f8L z7G@yb=V&h!Zi`VPxRSa-%Phvw&@lMi?p-p#1`7tN2Je&q>**?^qH5bU2vXAB-Qm#P z4Bg$`4HD8V3`2LPfPl1gN=u7~fHX*VH=ND;t##%HKbW;=KXJ!(w@sY){rtedeB=0k zxH`v8H|D`;>E_(eZBD*Od+XS7`y)V3YFfy+x%^LnhwE7j-tZ=NlSRxV{80}NZm%3O z^l6_dw!XtTC-9T&OIZF%5(+?0QoKTs{xGKIv3K|3o56?e%rt38>#7GgYxkyNbV2wD zJ_KJOS%az~kt(AZ6j86abo|1tJc(gfs9M?*r5Z9_CO1pI8p*WNgoj(h!FL=_GVfI0 zJ`2*xpXG{9nu2zX!gro%k-u9_5RT(}qFuOPjXXT+MCcvVS$N z+X_jjA*J;={pv@8?sNu9Oknb=@f%Ag49jiV^E=^EX?P@LC@8^l@h~UEv+D$wG}2B^ ziXN-CmfQz_wbNO|pe)V~T$&OmfP}Y02jC?%T6yecGUr9?4MVl*fIN4HCKT4OOT7B` zV<0v{Z}eKhCS23Qn<$zsqD0{yofeZ4)ERE|ui7HASpbn^4tOpK{ZUC#8Ib(F;G4a- z^jC>GcA{hWtdv3odh|dq{pSm-qUPSNFo2!V(c+wuyocbCp;43tQ*+LXcl?%zp9$*lXFK>AY>bPG>fy&c-T z3yB1YMrFmR9fEf{B+FZN(yZli|A5k5Be$01KnA6(9Z|JA#T(U2=^Kfqes{WxCGQgkkSn8i)iXC-3_^I~H0#ik4tJs=Y zI8W!|Q}tvrlz0W?O_7#EW3^Z##Htp#X#{!4*o1$_wsU+7z77H*rAc%1fqe z=U{f|h_7pTbrD8d)WhuC$^c~J3HPz7Z=IbpOH?oYXb&@Pu|l%+?dO;S(kKZXE7}dJ zmLLi;zqj!n!HLra@f$$I?Djl?qPKfJS&k#)ix2-k{~>JQd2j{t*rkLaABNSp{vONm z=klCzF+5sYYGQI93yf~>3*uN@hhmkGN9+p4f$`pqswJO6k9y-4gw!}K=5RG6T1Eg3 zkrui6|8(F1f5zh5S~$2`mS!x@BYx@|CeOc*c3DVJ!41u*j^+RHwe3F~4y0|nIJVZ} zq01&Jln$&H65#3&fh%BVJkb}FQgXhPmr)bzFfI5JuibE$u*eN~3ZD*`1U%U~Cgqe< z;ZJ`tl8)tQo^8$x9cCf%?6<@eJon$=&Rh9HBh=}c*v>OYt~uO=2!F^SV6P-fist5mjV z*1?y#1qhWu)94kN%H({51Xw1V4OxjDGWw_~L>L8^vn{cdOOjWgexe&)Y!0(?s!K7K zskY&wSvrB%I{g7RtfHC+y$LBcZXi40Y8MP~RrVr%me^C2sk7hV7rlCls`Kj?wMsT0 zkRE0AdY5mHi)=@P@4W@BJ3MxDaNnt3a56J9!+eL&3U7H?59puFBT~RK%%;7s_M?IN zS8e5NrLB4GOz*;2fC;04H#M%U;ARnx)xEDvP!4h2_H!e{tMTU}z&a*Ljn$V-r>I`r zf=*=b!=8*uOXR&X26FV!>(IAlENQK1`ImzjMl;$B6Bx}-i}1Kx6W4m3-ei}}i#`1_ zl?QWZp3!o$2cRho1RmRs(jwy=)rN(o949^k z?v^YX$`uZjTWnGR-mgT8uj0BLFLrJ_6*^xndc)rGU(at&+s)4i>H=$|CJa+SJ4OPk zCeS8qmUT!U zO!TaxN^4^#>}wtuPY|+j(LcRL36?{Zvwidd5=_vp_`T9k=#o21`A9>fm<-XX`i&NF z&^$b-+h$`{2cpkzRYSSFq#0X^RzDp-c8|s1wz?IEwc(M z(hQFlLX}9+XN-NoW)Z@Inl#&js?vgOn;}6dADjGq?2y9zOb@wbet*=WhDKS+NFp`G4ZRrE-}=PtecPJblvPuKFy7 zhc%%q`qDq!>InE)3plZ6!y!se0_ZDT+}xKJh1*J`#MroBfDz@)Z_;kKB0I`BRd)JQ z;yZY7gMC+d1I{94>+N?4?|)%Mc=4!3Mfr#p^U8n;nz+dqb8*nsTg)$(?75URao>t= zrD|d*W)r=d;24X|=K7k<(T~D{yoDMSKHbeY?z`T0$IryixsSwr2Aflk%#*Ci5RFR< z1iFztk0LekYMszB`P4k%X$jI~na`inSai)68m!A__w#FJwcg@vAv7PcwPx9a_#rsF z`fogyy&d1D7@wm#u1?8zVH54bpN{8X()9qVQ2al3Sdu^Io+EHPtMlCr)=uPjV~jC4SpzrYh| zd!s^$eU5Kzo=s1kgfuCzBdmvy{2ywMIFN#Gaq%Egd!G>yZGi~idrUkiY#L$J?MR3q zExUB-VO-D8l)a!9^6HY9MoYJ*B2QS0z)@KVuKUBbbnRFfJ0Ucz&d7s_<~a2&58cDL zp^_<|xEph7*c>(cwFG6*sx;d5IY6Y_eavs#x!erf8wZi)xO*<(3u|+HlfysF zL(7ODE?TfUrgycl@PPTawaWB?-RljL^UFrx!N6 zLiSUYmE_HyJCnj%33O6|6Grs(L(*0|=DDx_+i58`!vzQV*4vG-M5QwD0uzXry@Uzi zd<#b*g|n%et?THA6_;4!Q;=EwCOakmAFPDPI-3hj(Wh`k_u;2SaK;gEhojwZ)&ItE zTz3~0J@Uc8XMB+KL_>zca&T+?;LWMN;oM&0oUIq6`ZHoD_xt1RGL6t##Y+$-hDZ}Z zQr*5lSiFxt={6`KkC+pg>M(r(Y%*4Tdg$o4%y!Gpa0+61U-aetN?*hk{D?-)^|d_OxL%JhcO+!gzUh*4+PKnUmo89 z)v6VL=m6Y=!6DLz2N*T$2MW4Mm-!8>W1OB(r{1#1zdby2Mm@zaZUiB4ZT0o;XW#k_ z5t9LRu!~3N!Os3O0q8A>dgZsA@{|~{oOWu|4M7tc0>F|>=*uAo_~u74?XO`PDm+z} zvCSEv7lYW{lZ_rP&YRDb@HCU0LzOTc%sF%%XKp}Gt`H(%@aBk(#|z^33?j>F%AtP+ zZF*oF#lHY{eeb~XY(C+_KKx|He1t$vYwa5j@~N8$7N7ys zu)b||U!}HfKf9A^lMo;}A^mZ<WvjFBAs5u3K}sVBh_COG{3z2?FQm=0^5zN_6!z?^zPWhD|? zMimSh-kb+Q%R^0o>wsLBIA6JxBzYOI|HI4uo`F%|jOBc*hn8n(yeu~rWWBIvdO&g0 zI~#>cOsAI&!%1qaaUk#z|M>Cu0gqjF*j)ED3M#4680~aqP<*i;i z>_R^*9(rX_Ipebf<0Sr4qw|Ru?w#U$TzWJ8(HbIGc0KIf`@UPB zUd=n^=lQxai&Z_m1mQdaSO#-tgh2=?vCEgXr}$lFY;|Ku$49Y7oPzt4D7VEfL$gfu zUuTJ}UtpWN7Y8z*CY`)*TSC#~m5>1~f#Gk*_#z$h#A3-xF%Xi6VZmBVMLd1>Q}f}p z;zR^;@_3GXIGTZp&Q$!pq6YZGO$E^)e`sb=*GE!Mrdf@CK+)j0hGUFFT5U+ z0yM|$B2O=cM81E$q(j-{e@{FBFb>rmt`41d;sx)>gRrnMC39)1feGG0ls$;a|CDjJ zYV*Xp)iOhz`*q3WUse5&0d`a?PWjIJ*;*_w%!8}!FLuGoX@#TM)SGahV#fPWb8a|K zg;$5@o|Ry_gNr1PB^sp+I37|&e1e{OO@{Eajb$etN4fe>PuZ1bu&`d$51>(i>bh)f z6|pBJ(vM5g^KBkN#nXCoa~_U^PyG(dxL#L?Tv(`OpBc3c>zoi11)GAtTv?Ah3@Ezt zCA>ReE;h$w>mS-Qym-X~RsQq|3e|Mkd6824+?RM}VqB;XfDeVH1CBg1lbV)s5@zA> z^kjRgphtD)A4o3wQ4EeGvu!!$5JK;O_jvm;$NdFoYCV}Np-t*_dIk$Y|U#k3=dTPv&SXa3(!J6edLE(7I@p#d>Q8!l!)EmKPCkhi)RyBgrvfvLJ%T`n{5vNzYW7_upUCoA z2g@S0f1>*7)XB8fC=Nz{ydk%5%D-|B#h^L)c;l)%Q(!F@(zHWEJ>mDP^o0M$=|z-t z`_t~3qFWa49-9e9PIL^N&gRTntjZAqu9G^-<@f%NCWh(JBO}x+catC2f!cu>NZHyX z&Hpe)C~aGqZUuK+4~rG1qYpQ6KaOhE;ATQC-ZXSMe!;#f8K^h$>dLX$;%%##bF^!U ztVv)cm97)sY=l;sMdF)&bi7);TY70fnK|7fJuO*Qg!Pd4kq>Z=d^>JqB8F}UT~lT=lN{#P zcPCPnH}_M<z_j|o#m6UCE||w zm2wGBrE9GXeh@gcUi8|YeaG=XgMLPITPIR<{{@v8KZ)tBBW*<0#8vRRmE;)aI~+GJ z4h*EOw7eP$yuEf#*lbJUyq{6Oxgi%)kB^Hp-x|d^O>gOx<_{{xmSzApd5PV?+S{-|+`75djXtaiUryV0#ULvy>o(585??N*3XqY- zer8$dr*|1^z>tUUf2yY-{cJ8V9nRmk*;|u*%+U^-;~`4T!M6opHX1ka3-#>#8s~GH zl_kOO;ml({J>MoJqAZ&GxU@!GpSjOaIQnx003&W`3jXb;G9e-Jf9C978Vo zqPM7M-76Gb2_798%B92`gOJ$cJ6$Z@f%hp8Ht{{G!{H=#p(FIR!8y{Q>r+(0QjAxQ z2N0_lQxOXiofLK#O$RA`1`%ONT9vMZ*$dzS24)+A~R&gs1Goj96w)0el> zeA&HtcwJ>F7mL<}^p&%tx!&`y`qoUKHD2Uq3@HE7s4{t?BoDl#O1eJWs*4w6Eg9)U z7pZrKN86M)x+?qTwqJjtR@MBI+i9F9V_`zg2C`3Vp^lb50eZ5rcBxMRrnT*HDS?`d!JcPfc9b|4f_PDDuPqsU+N5=AS2^6tao zq#x5*GQYXIr#6_zWkmp5J*B+%G2y7MUXhc3XW)}wTPMXBK7G+Z@XQP%$(w|Ong54r_0#LuJWPiaGugKf>=Y>U2g-9?`2OvW)whPYwnPxfs`tx#jlz6tD@TrP#cQ zY-A7Zm=G@}W%q>QyV%P`kNMs&X+nzHq)fo4CDE$f!>tTv00I$HeT6y9!hFqEd2(Ya z5ycsD6E@%CM@EpL|1}{I?gKjWetIgOt<-DUPiuWVpIg6Pbj3q6?EJ&v{kK=3qSa97 zw4+5VI&La{!}YxYtSo2*QjgjnIY@dEzhxe>N`Rb<)T%yMR6tw&jwCXgp(SoDYuVDr z=7v9i*${I%hetV*ngt@=xMR(sB8&ajavWiPIek!+8;H!%-P%%?rL@)iA2}OHN%i*- zl9C#cq1fxf`Fy68U%qL(fm!{1F$hL5l?!o`lPNXd==PdgUuXEXI|Z%_kU(Le5W*N{ zQ??AEkN3^W)KgO$TL8Upcru;gP&`4}DK!T3Ve6<>XX$m=Bi&Rjvq?57&&W{YN5Tht zY;W=rD`N?q^}O8ltf9HKzG=!v9&6aK%H{`PPLh;cq>{Q877>sS7f8nIPC_r=wW^#v z)id*N2vGDbO#s@%Dv~SypXo?uh=cM8e3#_c^}ZOpw)0$hzR{kh*=d2c82^ciihTAH zC}4GS%KW0n{c+G<(fw>ecDBYP;@*w1BMM^^$L|gxvbf_~7{o*KNS22eQc`y(>RJ}Al3^RH=1xvdgx^;| z293LX4dbHB^1mu(UaGJqv%}m3sZnauS=fa2iF-E<&yn_+)5ldU2E%aUO_GP8gG8*R znb=K4baD@$xD9`|dJ(8?w}$0iNY<-o|IHq7`@XaJ?lUcg9_3x%Ty!6+PPWhK2$pbz zI|Z*3iS$^bG{=IQ5?&MT6YH7Fjy%rb2E55dHp^)*Mvz*Gs4g=aHqL7>5WCs*kQ0@L z9kw>*+^BX=SeB&SzR#gU@%+$Tu5&|%mNN-|@Wj34)2Z}Qgq&|pj1vqX?ZZx?H3vVr z@v759E$Sma#~XycT=lHPeXV^)rDtGBQYZ~5-T$zf{*apmmb+xQ-GW;@I~@w-zxg-F z|MGiKudPb;c5*3G=!jDv-Gd}tbPALoraGQ~gYl7~e>mA{xz_4uD*o zKsI@`Vmj@KHS05zeBUa}uj0KR6)a^+c}N7tqrg0G|8Ws@J|G0^%8JE^WK5aE=-z4Y z`IK;uqakT|hOUuEKV#s7Kfj{z+PR zd}t&`(#bC!MvhcM1~|)Q5AZPE0#W9fU1qRq32sQwxP z>S%0(b<79~zlVb6=<>nM^y}!MFJGz%znhuj?)m6>%G(@$ClTd4enFv_7g!_c$&It* z#}ubo4^cgoAsu~iBsw?!(3ADB6ri%z9_lv(4(f!8v{C1eWv~mY_k-Kshq>O`)t5*5 zC<(1KwLEQQ;ozL%e(x3l%=2ed5ju{z#6tdefCu_*;bXpZ4E~cs`hq_#at54+PkX`5 z8c!TZ=d3&utVB>TIhY-~E{V2yjenY04AIQi5~eLCM4VBd<_%)+e<2w(qmNahZV<~> zSEnmaMwLza|lBvTd$A^U&}CZq}Otf;ObV=HAZn_2cZ2lt;zZz#0T(6^;d3=IyCtKh zfY`k%MYv5rV$rOw4UQ}cOdFZ0QObhxbL4Ct>9dw8_mi=+DJ|E-3V zjZHbQzf#!AdV~j=XPvS4<@Un(vGz*=pa13@(4&-QuG#JBJTlP8p#RT(gK~TlHXDH~ ztVCcu$cxyfpz3Bo`l?_7$Cei-&0;E#%1sB0-pA znas*H8#u;>A(Zpgh9aobYr%J=SrerNRv0!m=-~QjGSA}?h&}FK>@`IKlSp3Pg}nGZ z-CtqISBTO^_}utDKYj>HdA4q;|J%21F!o5T_-*MiY#+gr^fFTJ*Lc91sj*8|_d7?H zc=?AvJz6ci>2B^Gc#bS=7fmY!MoR`9JrP%qor%w%zL@rC!XrOPM3`W%yYO-MFov^B zvd2zSfVYj(GmJEwf$1&GK}-cIFDOqzf_YL^RaNU}!(wqji;CLMb0jp%nh3bjkX=!0 zUsuA&?Wsx$_KrU~Cqn!M5!Kv`oOcYtLf6@MK^Xn(Fb4+*wjZHju$GV?nz6ni9pr){*H|H9lo6&x{HaYw4~cPn{K~i%WWa z+fe17Z4F)VM-$pc^LFMQP1e^n-mXu-YC&Y?VPQ|^R@<G0T@q{w|h{+VSV?*2^I z(b4g;J(|X1dLz6;5Rn)xi`2Q-sk(8Shx!yV%Js4}e_r+3L`yzCh+k%L3d=UD?P3GT z{`f~`ca$`x%FBlg$xbWXe$I~^6CV~6ICOtBklIhjNWL7Frdx)k#HRvf7os=ZyBCfv z7!wcoKnnOLpaIQ}GP^rBRBvAi39b)Nv#@FL>_SreGj8S<%wU*i@Llc-qp+3o`sU{3 z&Fy%TbY&H76t6U3tx~uqv&*onC*Su@3s`Ygqe7-J^Ukw2>V+> z;v7x-FCEWxZNERn`!V9L_kUgoeW@5{oX+rbJa{8|RS_I(`Z(AVM+xB|9z>3IxnuqUiSthDT!srxy%>mi6TkgN?`5h!rL1R<|kwyc)$#th_NcsCq zzi*wLR&PFq_kItULT7eYBKi7`p!qCX^--#-rslPQQJ|H+!?S3h>Y%0A!}E*f-|*@- zwyN63@sFHc6qC3O#laRfe|@_igKoRYq1bvKtfz@fmKauhKsunM!l_J+JKfaef+>%y ze=931>s3=xljv~JcQ&rBCrmJ^%dPHvUlp2G*h+89F?}|xrrv>Wr45GekFA+V`9^FM zmv3}G&0tWH+iGrd1qQkw{Bb+I-R$OcYSxajms%nPf_U{?dplS zr6mqf5GD5g`uc6a`nw*>?v^I6bvwDmz5J=JC2^)hBiIu==N!)@|Fe9bYyBvYD$|uT z<%?1FhAJ?+X|nfqSLDF1DhX?!gI$*9@1PorVk{BBo;D`FiPmPEZ>&yST)k5Rv8&@| zaqhJAJdxc_tUfaMJS?t4T|PqiRTePwA>}rg?YP6yBY?*(-^ch@Z4xch{nI`Xv^ls~ z^V@SLZy~?EH+6i29Q@y-__lcdQSYi5FDmNdZ^h$!*7o!Q{`ro{k_Od()C<*WIV67a z=|=+<@}SMpG{@Ve9Z`So2+dkPTVKnQXWG8IzZeA(8q9A7PIlVv3CszD#%`XDtEQqS zF@Q}RPv%WJ!@M{+IvzyF#ig~tp6f6k!y~}{n}?iU}9>d zx4&8B5PPN^SWERwo4p%p^cg=#7P>aq#pp;XZ(ZB%;RBWpm#!Du>{LSWZn;+Vd+RkY z*fU5+S9e0HmH}jRa3#n^jJEE}*102c(hrPE?Q?y(wmn@w2^zKny=P;~+LI9&6LLdE^=}pX4F+ec zPfx>_88ghnRgAMCK2fOYLsM`>!9!b5D7V+oBZM#WhA|MxzKTLLcOEb!AghRx1&t%i z){mlWRWpqo%J{d0F|Bw8d3>(sfKpkXNgNDL8EF_#6>)Vo7Ow>cAtYtA3#8H3`*yCQ zC2a5oZMp~SDXOjkGfR>y^cLsmBX)e7^ix!0G??Kq-`t)kY!#?#20Y#E6u83i`{F1V z=%F(HQ8h@F3O@ha#^DeXizK$kBuiy%KGTFrHa+?-a3NQiIf$l@r0f&~s z6fG{x;yo1R!su=8!0kif@1I1^g{uQf(7H#8Gh72jQ!-8}M&Xs2$Yx^BPfua&QCe#p z|2R=o7t5#e)${W5PPnC?`8+}wj-R@ZzTPG!JfZ|W4zGr-J}n2w0G)ppA)ADXiflN! ztcE_^>PgY_nkZ9DrQNVrFK3f^Ph$C3zSECp;`Kw<*VmCS`9BkK_&&NY&iWBhu7coK z%2QkE;dN{S<98%L%zjch@UY3Web?90uS1kVhRGi~Zleo)SY$qvK0NeJdqhJZl|LP$ zPHv!UbDo;{2QAN#(UTD`vH|yqj*mB(!=nMpfL{Exaswa}GY^j$cwAFuLiBOJt8Km> zJYYT(Juusi4`|aHjJ5jmJR>*r(~9Li2-NS@Ww3nfk4Gkc^u|Yn>8fd(@%giN2if?2 ziQO}M;XG!G>&Ii5+s+`Po}edL*sHk`+~BurFJhE6??Pj~i4K1&PUXz$j3EH6=bbzf z1)PRc40Nnqx%iO(Jc?&0A1-^r!@`>8j;JF^=AK|~8e>FkXsyxgI7A$FAE!}HiO#QG z4brDxK0*A^Fz>W+cr*3r35Z#GCy=S(^^(g+DCcfQkA!xO$dNY*z+pa9{?GJ)3#13? z8gzkiI^ilB4a}v=AF=Wz#b9CiO7GvDuLN`Upb-61p>-`A-n%RI(7l>-r9U0;_27l? zC(Hcuav(xT(Bnl8AE*c4ja*xyTbrp<9!Z!M-UZge_s@>6K`~?B>{s2hJ=GVk$KR@5 zIDTk^sMw8*G~eXS*^?j;6&XsT0L>ah9w~K&uB>{JJi)hkW63)stI23J+ijd8RU1A5 zzex)q5IYS&wpquK?QQx$b8|lry6(SoKe^sxMZ$44T3cGaI|+W7+9W&iVR$~AdgcQL z_!MvldkZ>q@sD2^;TU=54t7zMrwZb}nPM(|22pmWS?@2plfH0pVO5|Y;F26)ABCU5 z{Y+Tx@HyKUI&bJq+gVAFuUIL^4N^inLl76CjySamteF{YKwVrE@|o*ci55om{usy= zs-aLOjEOZpGOr8)w=D9at&rKCC+H|_*>GvJJS#PWO3DNJRZL@8$Lf1}T;D+Bzj@j0 z$brFEX**eap}@zYAp4pU0n{pTFgbO3he^C&lA_q=;JMy+Gd7I6$vKht`4-N!QgMj zb9k#KH1fZou+o`kR?B{G|I+DXkB>2jYIN})bS?M@54iDj*Y;m!1Kgv*%*R*$-e{gz zqPLflpLm`#`a=#0d??X&TYEcnuIu>9=g862wSlm}Z-44+Vd@$G`sT#K*Vp>k1%l0On_>@^!Rwi7yrA}lN`k4EgbZ+;eSH4dSk5i=zE)S zBBC+O^xjc+GQyV>F6_Zr zYd;z*Pls8;e3P&7oJNt?e+X(e%M(<0ucSGES_Fcrxw$%1XXN;4gneaUl9m0PA%{*YNfVF^o?9 zGW0P@0a+D^6s73;f)tMGlr+RUKc+)J{VsmW!inFs+C1Z*e%R6Z zng&!6mq^#Ki}sRG3TmS={?h-|b6ULEa%C#?`8=olMD@XMNgLp3BX{GuR3QumI4yfN zrw0ZUkAUUWUX7=f63=nBMtQjK`@79E!l)=jdZ~JcNE$#UyZfQFd)gx|A5*n2yOcVF z=_c>Yvb<9g$=4`eJi1?gZ$i%yW#`U1poUi5XZMEzQ06fcF4VZmw47Ne49i;c*vm;- z3PwjwS{xB2-3u4I@4!k%lhp;={MhcKMT`0LAAt?1zm;erhn6yH77@gejcaTnS=S8P;TFvZ z2>YP{I@x~DOF$mm$;D-TfA;GIrW$P}T95(_@P&-JLaxDf&VgSUFzu4RYDr36Z26j~ z%2uHE$e5MoCNmkEUR;Q@%q`c?gao({F~5n~1Vr-I$g3-!lqNYa!*B>S8@5Un@JnqQ z{P81dqzO@)sJivxilcEVdGk)nh#DwbzK+-YnMJJO604mE!1>9S+M`T4uJC)K69!52ZK5rz{HL05#N7r76GbWMRP%nBcA5A+f`IU`{-teKVG2BWg(hw zQEFNw`?qj3XLDuko*8@jd^n($cDMGL7?m}R+CIF+5IzmLdqDlO7LoQ*i{LR+23QdH z+hKR*W+}`|C~H6Sf@dH6(tc(h(l`5W{&Y-v3Z-k3^WU9X7CEe^&{^_dd2XQ!9Gb&t z8vaVMUXQuq&>Wcb$qPj6JiJ#k9RfuC_|Z4`-_r~0<`7o%f#PXYo%zRwf6euK8Gm#C z+OB_a6Bt3o^=i>yTI(asdA&~0eC6V*tsO$GPWP?Rw0ApK{g6p)u`(>+qiqEj7SEJH zjEXS$Z`WZVQlq`;2usgp+zEgC-*8%1{(ZL0^iOzPM*}PsFqo@k&UMZUux%37&aHDQ zGIw?w*5pdXxG`s8UXL%e&+X3+K&x8k!WilR;n?RCE_f0_ua-6Ei@03WQA8K$t5JX3 z=tDa`Vqgxl&+xww<1E)P)Hg4dEhlMH*+ZoMBttTnJ)m&`7Yblxvm<=S}2&lO*_NS+XX;gy@Mo6$@rsV|^)cg#6SI+{Zp5h~fP6jh&c4tE%l;S^DkJvWOH0`-|ImTCk_Fahz4gK^Oto zKJ?#RqxL-@Q2-5+2E=-?)I}E1#G5#m2pX*0My(ia^mVKlRaO{&UK4mabP+MF+NKp& zcat^`2uQUoN@vGYZQW<(GhkthZa5_)C)rnYD|aRP zTG0$aL_BBuGFF6dN|Jb6{{U+xd4S;uH61l|r2^#?mu6t$++KCH^MzdUK&s5amB0N+ z|Ms>G$9L=VUQ4i7e+V^C*h*d7dw+H;EFNQ`?=hS6PJ~7+_p($uz6>$FRJ>C4qr{pv z>uE$#FEmE-sewkmi{Ic->8D3wU4DLk0CPBj?fJ2=CP;)Rfv$iSpuOxXc`@M=lQgN> zbOx|jUkGraSnATeH0rOi5;-Y@n({o+< z`^?UgT!7OXQx6(V4%DmE0WRqxlGA#7a`%gR-PIY8YFJNqrmiT5lxcfn2=YuyHXA;| zqWdFyTcl1*Ze9M21{>v#9Vmf;zqn;EBL?TL&^xh#HLwAx?Dk2hwt;T|2hhBeeKIFq z69ZLgIOQn^X=GZswe?8jCil8!Cg;gFhXnbl3#Gd2Q@7Q4E3R;ZeewX{JgE&xm2YVk zd5Th@wt?utkKCRM^ChIDk|;7M2lt%$7^Q+#pAD=*W$hV48L;9xMS4dxU%ExzNqcYn zw-4G)S%9A?mIh87SPV~O-f1pg3X$rypgI3{AK^;RTn%2uhH(`q$zR3-TWt!F=2=Cp zJ;7!T@?=r4(yveY{_iMxM(ve!(lso&iK(DNIB3KI*E0$CC@T-`E0yWOimfw!40}=HW85Wy+iTz#{nWBQj;CZdgI5a@_cdf z7FYU6G5^Y|jc?2MoX;@<=QNPQoS)T?{R0^Tu<~pIR7MTB`SS)Fr5Rf4V%?Oo3SXt1 ztFi=5g{;E?{`k=o9sX|Ah6W?G?&nnsyt#v_$wYt_maH@sbXL^a z*!v{WC=+Rs{X|}N9jU1u$~Yl|U_k%0u3p%={Vm`bB1fR|5cwdT=kIrbi z5QDshALHNeR!xUO!|qCdOqR#;+;LmeWJPEgKs>tJne3#LNC@L9z#yyL&?IyqI1Ly9*ZFruW6UsVsJ)^CFM>ln* zUij5Pyk22yP+B*gUvV#WHS1Py>H-kV>kolA@HUaJggO0aH_2cCJWX9rUC198GU`sd z!OyFipO*dT6_3GKubGgOROluQNCm_9wT^`7W{W1Ag@7;xbAt%gXaO=EQd7v~pP6ts zDzOh^M^&O2sN5RU;ALR<20@rvGO{wHJkc?3lvl^-jRDLAP&EKZ{^JMCQB<3(=BVP- zUrN!(R{>V~CaLE-{%phUB%0lZ2yc%{Y(H*Pjc;}_g%>8UDiV840O}cn4+{tVjdU|w z4P0Kur9tA(s8xrup)+d)cjy57At6m9wmceU)f);fH2uklgBXhH{hf+Xn#CeQu;m#^1)tflYf7J0-I4!Ad{b&L-P-k@K)gsh_ks zMHa`{C!C>^+LLBfI*pv4^BBIU~7r?b*N5UMQ)~e>dbex~FH}F)- zI?%SRgKD7E98kv(1G+p!V^(4O6{YPSo@x^D$h1Y9`w0SXQw0R0Tr#et))S#uXMyX* zA8ID+dVJOAl`9^V8PxDz7)kDv?ALWoumJadJ?fMg)DyMN9<|d%s0Hxz=qNyOtHVCR zHNU4$R>bj#;qh~tQ5SAp74yG#egyOa?{04|Y)DDy6T|Dvw{ZXx#C#)xX~vGEe1{8& z_AEh(k^1jGq}i0Zv*(6X5qkx8o5^S~jM+hu28|IeC^^(VyLj$^YK-$*9pD)1Y#cy7 zTFz^*Ec{R=#lq5;G}|Xp1Vk%3ru1i~`@86&YnVnU{agj>4Qq@+?ze(@ybY|*W+(Em z>~r^fT(#-9I4`99CQO-y3$PFld=}himD)Co87r5hrqOXFI5JDJo&vsf9p5JcR7pER zOp^Gj%(D3&wO%1}oCZQ^CBl`HstG01Jz+u=JwN}RW2&kLDROCchP5phuCzLv+7-VU z`>rLo0+c-U^_sXHUst@V9J>tW1+hdxAfqtF+~J~S{C}&c)NyH05jCFzsQ#%(THqj4 zt+lIcDZtKoDMwmhM#zT$d1YI>W`IqkIkUG5KU`o*C;9TDM>Sw#@ua0%RFXp#7DCLD zX_5Mi?vS*3>Z}V^4$U$r)T+GEgr}qkBa!+;dI84(b+JG%V9B7Cp4(+_9&SrzMjm&W zAm%g7%O*j}L!IubB6iwroXZW)s}kZi%YUe8rE#H^dQLcwYrcSmeE)Jt=sac8ujvkU z<@lwfLs@XtNKxMa7RYD;5kLaK;fRzur~?~}cK#uDzy$zZ{po{{O`pNbwZ>odl1M2< z{KTK6%gkp{2k#6*A`-U|a!zj8N&kM>XlnARs&&l_7K{1*h0KbExq7%7=&cWUK}<3n z0hEL_oeRiz;_$!>2t*D9m%o!On@o$BfG0Nt-@kskdmx`0Dlq4zG;$?u#rW5L?#rM7DH6Udb%n7^y1Zj&6k#`Y7D zR9KxrXQR1lPiOjvHjDjhnt02xZ?d0DcKcsd5cu1Gs+E@i){r$Yyff|+aIaR3QZD@c zd#^6;o_w30hmvP0OirL5I4df-S5TCYDFZ#tJ~Y@cY;%2(f%9#+#lYAd=H&VuT1)WHPaLChwr%$tYP)9FYpw5Mca(x zf%W?m*7n*R%f0LCy$iWS01i*(q;Yk2cJ6Z$2o*-$;FnBah;3sYJ-2xBu+=?xTD^HU zmUVRp1ScAJr_Pr~$)PiEajo5td@TVW2(cq)FO+*nC*Lr|SX%a1xx{`b4haj3$UfV` z-k!+Nkbr)4)PppqXnwCT$$CU9T-psGT%|HuBXjud;zz?cs-t~VCl|}d_sT-4(i9#( zJ|WYPSL6i-UxWZKnepSvN}vwY73hnAcQ*Yga7wNOpySMS)|B)+6-{)bYxG7U=r@v4 z3&kd5qt-ghH=gpzl*%|bN=qv%yhKpI%B?P^u;qHRYH!k`z=@PHtOD$Fz>wdWyoZNW zrkKK?-c(Y2iNBX#m>><0dBuliOgcI`?pOP8x9b=$eemy0-$Uq2!-W&3kGz$d{byN) zsMM?wwrg)aCX+>%g{SJeyV03ysZgaZ$p6go)z#OBG7^7YJ;^!PXpi5kunVvLlG3Di zUF^Axe^{Cmz}74wXYHq#&WB{1cLV?t@NX-C_h@#Nb5|(I$h{}#@^|v>XM6$D4sI?m ziyzAX_1_5XdbVR0f67oO{3gMgDc`T3j)#-NfYG>sDoqlRYfV}8cn8pxo}nS%ss||| z5LJH-$VexR6#q`ofHUgyL;L!b1+?G6U+q8F{5MX7iHuer`t%gIg883Rg=6(Cdz-qg z{lNG)jsh4pccBv|U{bc0=X43Ox%VV#%?L1>k zx;@dqvMvumi|bZdgh-(svk6)@;UzchuW@lKsF`{4!2D8YNDdzbYngy8$S)p05)MbL zir8poc-Y-Z0h*xdm+xh|+VB)5%J<|(deiNJFPZ&)(>~8}p~amY2|AZ^$a942fU$Xo sq$+Y{jFdF~`1ciB@GQT)gMoQ@F=f*TvGwG`h5 This repo is brought to you by [Skeema](https://github.com/skeema/skeema), a -> declarative pure-SQL schema management system for MySQL and MariaDB. Our -> premium products include extensive [SSH tunnel](https://www.skeema.io/docs/options/#ssh) -> functionality, which internally makes use of this package. - -Go provides excellent functionality for OpenSSH known_hosts files in its -external package [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts). -However, that package is somewhat low-level, making it difficult to implement full known_hosts management similar to command-line `ssh`'s behavior for `StrictHostKeyChecking=no` configuration. - -This repo ([github.com/skeema/knownhosts](https://github.com/skeema/knownhosts)) is a thin wrapper package around [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts), adding the following functionality: - -* Look up known_hosts public keys for any given host -* Auto-populate ssh.ClientConfig.HostKeyAlgorithms easily based on known_hosts, providing a solution for [golang/go#29286](https://github.com/golang/go/issues/29286) -* Write new known_hosts entries to an io.Writer -* Properly format/normalize new known_hosts entries containing ipv6 addresses, providing a solution for [golang/go#53463](https://github.com/golang/go/issues/53463) -* Determine if an ssh.HostKeyCallback's error corresponds to a host whose key has changed (indicating potential MitM attack) vs a host that just isn't known yet - -## How host key lookup works - -Although [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts) doesn't directly expose a way to query its known_host map, we use a subtle trick to do so: invoke the HostKeyCallback with a valid host but a bogus key. The resulting KeyError allows us to determine which public keys are actually present for that host. - -By using this technique, [github.com/skeema/knownhosts](https://github.com/skeema/knownhosts) doesn't need to duplicate or re-implement any of the actual known_hosts management from [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts). - -## Populating ssh.ClientConfig.HostKeyAlgorithms based on known_hosts - -Hosts often have multiple public keys, each of a different type (algorithm). This can be [problematic](https://github.com/golang/go/issues/29286) in [golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts): if a host's first public key is *not* in known_hosts, but a key of a different type *is*, the HostKeyCallback returns an error. The solution is to populate `ssh.ClientConfig.HostKeyAlgorithms` based on the algorithms of the known_hosts entries for that host, but -[golang.org/x/crypto/ssh/knownhosts](https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts) -does not provide an obvious way to do so. - -This package uses its host key lookup trick in order to make ssh.ClientConfig.HostKeyAlgorithms easy to populate: - -```golang -import ( - "golang.org/x/crypto/ssh" - "github.com/skeema/knownhosts" -) - -func sshConfigForHost(hostWithPort string) (*ssh.ClientConfig, error) { - kh, err := knownhosts.New("/home/myuser/.ssh/known_hosts") - if err != nil { - return nil, err - } - config := &ssh.ClientConfig{ - User: "myuser", - Auth: []ssh.AuthMethod{ /* ... */ }, - HostKeyCallback: kh.HostKeyCallback(), // or, equivalently, use ssh.HostKeyCallback(kh) - HostKeyAlgorithms: kh.HostKeyAlgorithms(hostWithPort), - } - return config, nil -} -``` - -## Writing new known_hosts entries - -If you wish to mimic the behavior of OpenSSH's `StrictHostKeyChecking=no` or `StrictHostKeyChecking=ask`, this package provides a few functions to simplify this task. For example: - -```golang -sshHost := "yourserver.com:22" -khPath := "/home/myuser/.ssh/known_hosts" -kh, err := knownhosts.New(khPath) -if err != nil { - log.Fatal("Failed to read known_hosts: ", err) -} - -// Create a custom permissive hostkey callback which still errors on hosts -// with changed keys, but allows unknown hosts and adds them to known_hosts -cb := ssh.HostKeyCallback(func(hostname string, remote net.Addr, key ssh.PublicKey) error { - err := kh(hostname, remote, key) - if knownhosts.IsHostKeyChanged(err) { - return fmt.Errorf("REMOTE HOST IDENTIFICATION HAS CHANGED for host %s! This may indicate a MitM attack.", hostname) - } else if knownhosts.IsHostUnknown(err) { - f, ferr := os.OpenFile(khPath, os.O_APPEND|os.O_WRONLY, 0600) - if ferr == nil { - defer f.Close() - ferr = knownhosts.WriteKnownHost(f, hostname, remote, key) - } - if ferr == nil { - log.Printf("Added host %s to known_hosts\n", hostname) - } else { - log.Printf("Failed to add host %s to known_hosts: %v\n", hostname, ferr) - } - return nil // permit previously-unknown hosts (warning: may be insecure) - } - return err -}) - -config := &ssh.ClientConfig{ - User: "myuser", - Auth: []ssh.AuthMethod{ /* ... */ }, - HostKeyCallback: cb, - HostKeyAlgorithms: kh.HostKeyAlgorithms(sshHost), -} -``` - -## License - -**Source code copyright 2023 Skeema LLC and the Skeema Knownhosts authors** - -```text -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -``` diff --git a/vendor/github.com/skeema/knownhosts/knownhosts.go b/vendor/github.com/skeema/knownhosts/knownhosts.go deleted file mode 100644 index c2fb516057..0000000000 --- a/vendor/github.com/skeema/knownhosts/knownhosts.go +++ /dev/null @@ -1,182 +0,0 @@ -// Package knownhosts is a thin wrapper around golang.org/x/crypto/ssh/knownhosts, -// adding the ability to obtain the list of host key algorithms for a known host. -package knownhosts - -import ( - "encoding/base64" - "errors" - "fmt" - "io" - "net" - "sort" - "strings" - - "golang.org/x/crypto/ssh" - xknownhosts "golang.org/x/crypto/ssh/knownhosts" -) - -// HostKeyCallback wraps ssh.HostKeyCallback with an additional method to -// perform host key algorithm lookups from the known_hosts entries. -type HostKeyCallback ssh.HostKeyCallback - -// New creates a host key callback from the given OpenSSH host key files. The -// returned value may be used in ssh.ClientConfig.HostKeyCallback by casting it -// to ssh.HostKeyCallback, or using its HostKeyCallback method. Otherwise, it -// operates the same as the New function in golang.org/x/crypto/ssh/knownhosts. -func New(files ...string) (HostKeyCallback, error) { - cb, err := xknownhosts.New(files...) - return HostKeyCallback(cb), err -} - -// HostKeyCallback simply casts the receiver back to ssh.HostKeyCallback, for -// use in ssh.ClientConfig.HostKeyCallback. -func (hkcb HostKeyCallback) HostKeyCallback() ssh.HostKeyCallback { - return ssh.HostKeyCallback(hkcb) -} - -// HostKeys returns a slice of known host public keys for the supplied host:port -// found in the known_hosts file(s), or an empty slice if the host is not -// already known. For hosts that have multiple known_hosts entries (for -// different key types), the result will be sorted by known_hosts filename and -// line number. -func (hkcb HostKeyCallback) HostKeys(hostWithPort string) (keys []ssh.PublicKey) { - var keyErr *xknownhosts.KeyError - placeholderAddr := &net.TCPAddr{IP: []byte{0, 0, 0, 0}} - placeholderPubKey := &fakePublicKey{} - var kkeys []xknownhosts.KnownKey - if hkcbErr := hkcb(hostWithPort, placeholderAddr, placeholderPubKey); errors.As(hkcbErr, &keyErr) { - kkeys = append(kkeys, keyErr.Want...) - knownKeyLess := func(i, j int) bool { - if kkeys[i].Filename < kkeys[j].Filename { - return true - } - return (kkeys[i].Filename == kkeys[j].Filename && kkeys[i].Line < kkeys[j].Line) - } - sort.Slice(kkeys, knownKeyLess) - keys = make([]ssh.PublicKey, len(kkeys)) - for n := range kkeys { - keys[n] = kkeys[n].Key - } - } - return keys -} - -// HostKeyAlgorithms returns a slice of host key algorithms for the supplied -// host:port found in the known_hosts file(s), or an empty slice if the host -// is not already known. The result may be used in ssh.ClientConfig's -// HostKeyAlgorithms field, either as-is or after filtering (if you wish to -// ignore or prefer particular algorithms). For hosts that have multiple -// known_hosts entries (for different key types), the result will be sorted by -// known_hosts filename and line number. -func (hkcb HostKeyCallback) HostKeyAlgorithms(hostWithPort string) (algos []string) { - // We ensure that algos never contains duplicates. This is done for robustness - // even though currently golang.org/x/crypto/ssh/knownhosts never exposes - // multiple keys of the same type. This way our behavior here is unaffected - // even if https://github.com/golang/go/issues/28870 is implemented, for - // example by https://github.com/golang/crypto/pull/254. - hostKeys := hkcb.HostKeys(hostWithPort) - seen := make(map[string]struct{}, len(hostKeys)) - for _, key := range hostKeys { - typ := key.Type() - if _, already := seen[typ]; !already { - algos = append(algos, typ) - seen[typ] = struct{}{} - } - } - return algos -} - -// HostKeyAlgorithms is a convenience function for performing host key algorithm -// lookups on an ssh.HostKeyCallback directly. It is intended for use in code -// paths that stay with the New method of golang.org/x/crypto/ssh/knownhosts -// rather than this package's New method. -func HostKeyAlgorithms(cb ssh.HostKeyCallback, hostWithPort string) []string { - return HostKeyCallback(cb).HostKeyAlgorithms(hostWithPort) -} - -// IsHostKeyChanged returns a boolean indicating whether the error indicates -// the host key has changed. It is intended to be called on the error returned -// from invoking a HostKeyCallback to check whether an SSH host is known. -func IsHostKeyChanged(err error) bool { - var keyErr *xknownhosts.KeyError - return errors.As(err, &keyErr) && len(keyErr.Want) > 0 -} - -// IsHostUnknown returns a boolean indicating whether the error represents an -// unknown host. It is intended to be called on the error returned from invoking -// a HostKeyCallback to check whether an SSH host is known. -func IsHostUnknown(err error) bool { - var keyErr *xknownhosts.KeyError - return errors.As(err, &keyErr) && len(keyErr.Want) == 0 -} - -// Normalize normalizes an address into the form used in known_hosts. This -// implementation includes a fix for https://github.com/golang/go/issues/53463 -// and will omit brackets around ipv6 addresses on standard port 22. -func Normalize(address string) string { - host, port, err := net.SplitHostPort(address) - if err != nil { - host = address - port = "22" - } - entry := host - if port != "22" { - entry = "[" + entry + "]:" + port - } else if strings.HasPrefix(host, "[") && strings.HasSuffix(host, "]") { - entry = entry[1 : len(entry)-1] - } - return entry -} - -// Line returns a line to append to the known_hosts files. This implementation -// uses the local patched implementation of Normalize in order to solve -// https://github.com/golang/go/issues/53463. -func Line(addresses []string, key ssh.PublicKey) string { - var trimmed []string - for _, a := range addresses { - trimmed = append(trimmed, Normalize(a)) - } - - return strings.Join([]string{ - strings.Join(trimmed, ","), - key.Type(), - base64.StdEncoding.EncodeToString(key.Marshal()), - }, " ") -} - -// WriteKnownHost writes a known_hosts line to writer for the supplied hostname, -// remote, and key. This is useful when writing a custom hostkey callback which -// wraps a callback obtained from knownhosts.New to provide additional -// known_hosts management functionality. The hostname, remote, and key typically -// correspond to the callback's args. -func WriteKnownHost(w io.Writer, hostname string, remote net.Addr, key ssh.PublicKey) error { - // Always include hostname; only also include remote if it isn't a zero value - // and doesn't normalize to the same string as hostname. - hostnameNormalized := Normalize(hostname) - if strings.ContainsAny(hostnameNormalized, "\t ") { - return fmt.Errorf("knownhosts: hostname '%s' contains spaces", hostnameNormalized) - } - addresses := []string{hostnameNormalized} - remoteStrNormalized := Normalize(remote.String()) - if remoteStrNormalized != "[0.0.0.0]:0" && remoteStrNormalized != hostnameNormalized && - !strings.ContainsAny(remoteStrNormalized, "\t ") { - addresses = append(addresses, remoteStrNormalized) - } - line := Line(addresses, key) + "\n" - _, err := w.Write([]byte(line)) - return err -} - -// fakePublicKey is used as part of the work-around for -// https://github.com/golang/go/issues/29286 -type fakePublicKey struct{} - -func (fakePublicKey) Type() string { - return "fake-public-key" -} -func (fakePublicKey) Marshal() []byte { - return []byte("fake public key") -} -func (fakePublicKey) Verify(_ []byte, _ *ssh.Signature) error { - return errors.New("Verify called on placeholder key") -} diff --git a/vendor/github.com/sonatard/noctx/.gitignore b/vendor/github.com/sonatard/noctx/.gitignore deleted file mode 100644 index 2d830686d4..0000000000 --- a/vendor/github.com/sonatard/noctx/.gitignore +++ /dev/null @@ -1 +0,0 @@ -coverage.out diff --git a/vendor/github.com/sonatard/noctx/.golangci.yml b/vendor/github.com/sonatard/noctx/.golangci.yml deleted file mode 100644 index 55ebeebdb0..0000000000 --- a/vendor/github.com/sonatard/noctx/.golangci.yml +++ /dev/null @@ -1,14 +0,0 @@ -run: - linters-settings: - govet: - enable-all: true - linters: - enable-all: true - disable: - - gochecknoglobals - - gomnd - - gocognit - - nestif - - nilnil - - paralleltest - - varnamelen \ No newline at end of file diff --git a/vendor/github.com/sonatard/noctx/LICENSE b/vendor/github.com/sonatard/noctx/LICENSE deleted file mode 100644 index a00d5727f6..0000000000 --- a/vendor/github.com/sonatard/noctx/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 sonatard - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/sonatard/noctx/Makefile b/vendor/github.com/sonatard/noctx/Makefile deleted file mode 100644 index 1a27f6b595..0000000000 --- a/vendor/github.com/sonatard/noctx/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: all imports test lint - -all: imports test lint - -imports: - goimports -w ./ - -test: - go test -race ./... - -test_coverage: - go test -race -coverprofile=coverage.out -covermode=atomic ./... - -lint: - golangci-lint run ./... - diff --git a/vendor/github.com/sonatard/noctx/README.md b/vendor/github.com/sonatard/noctx/README.md deleted file mode 100644 index b3793fc968..0000000000 --- a/vendor/github.com/sonatard/noctx/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# noctx - -![](https://github.com/sonatard/noctx/workflows/CI/badge.svg) - -`noctx` finds sending http request without context.Context. - -You should use `noctx` if sending http request in your library. -Passing `context.Context` enables library user to cancel http request, getting trace information and so on. - -## Usage - - -### noctx with go vet - -go vet is a Go standard tool for analyzing source code. - -1. Install noctx. -```sh -$ go install github.com/sonatard/noctx/cmd/noctx@latest -``` - -2. noctx execute -```sh -$ go vet -vettool=`which noctx` main.go -./main.go:6:11: net/http.Get must not be called -``` - -### noctx with golangci-lint - -golangci-lint is a fast Go linters runner. - -1. Install golangci-lint. -[golangci-lint - Install](https://golangci-lint.run/usage/install/) - -2. Setup .golangci.yml -```yaml: -# Add noctx to enable linters. -linters: - enable: - - noctx - -# Or enable-all is true. -linters: - enable-all: true - disable: - - xxx # Add unused linter to disable linters. -``` - -3. noctx execute -```sh -# Use .golangci.yml -$ golangci-lint run - -# Only noctx execute -golangci-lint run --disable-all -E noctx -``` - -## Detection rules -- Executing following functions - - `net/http.Get` - - `net/http.Head` - - `net/http.Post` - - `net/http.PostForm` - - `(*net/http.Client).Get` - - `(*net/http.Client).Head` - - `(*net/http.Client).Post` - - `(*net/http.Client).PostForm` -- `http.Request` returned by `http.NewRequest` function and passes it to other function. - -## How to fix -- Send http request using `(*http.Client).Do(*http.Request)` method. -- In Go 1.13 and later, use `http.NewRequestWithContext` function instead of using `http.NewRequest` function. -- In Go 1.12 and earlier, call `(http.Request).WithContext(ctx)` after `http.NewRequest`. - -`(http.Request).WithContext(ctx)` has a disadvantage of performance because it returns a copy of `http.Request`. Use `http.NewRequestWithContext` function if you only support Go1.13 or later. - - -If your library already provides functions that don't accept context, you define a new function that accepts context and make the existing function a wrapper for a new function. - - -```go -// Before fix code -// Sending an HTTP request but not accepting context -func Send(body io.Reader) error { - req,err := http.NewRequest(http.MethodPost, "http://example.com", body) - if err != nil { - return err - } - _, err = http.DefaultClient.Do(req) - if err != nil{ - return err - } - - return nil -} -``` - -```go -// After fix code -func Send(body io.Reader) error { - // Pass context.Background() to SendWithContext - return SendWithContext(context.Background(), body) -} - -// Sending an HTTP request and accepting context -func SendWithContext(ctx context.Context, body io.Reader) error { - // Change NewRequest to NewRequestWithContext and pass context it - req, err := http.NewRequestWithContext(ctx, http.MethodPost, "http://example.com", body) - if err != nil { - return nil - } - _, err = http.DefaultClient.Do(req) - if err != nil { - return err - } - - return nil -} -``` - -## Detection sample - -```go -package main - -import ( - "context" - "net/http" -) - -func main() { - const url = "http://example.com" - http.Get(url) // want `net/http\.Get must not be called` - http.Head(url) // want `net/http\.Head must not be called` - http.Post(url, "", nil) // want `net/http\.Post must not be called` - http.PostForm(url, nil) // want `net/http\.PostForm must not be called` - - cli := &http.Client{} - cli.Get(url) // want `\(\*net/http\.Client\)\.Get must not be called` - cli.Head(url) // want `\(\*net/http\.Client\)\.Head must not be called` - cli.Post(url, "", nil) // want `\(\*net/http\.Client\)\.Post must not be called` - cli.PostForm(url, nil) // want `\(\*net/http\.Client\)\.PostForm must not be called` - - req, _ := http.NewRequest(http.MethodPost, url, nil) // want `should rewrite http.NewRequestWithContext or add \(\*Request\).WithContext` - cli.Do(req) - - ctx := context.Background() - req2, _ := http.NewRequestWithContext(ctx, http.MethodPost, url, nil) // OK - cli.Do(req2) - - req3, _ := http.NewRequest(http.MethodPost, url, nil) // OK - req3 = req3.WithContext(ctx) - cli.Do(req3) - - f2 := func(req *http.Request, ctx context.Context) *http.Request { - return req - } - req4, _ := http.NewRequest(http.MethodPost, url, nil) // want `should rewrite http.NewRequestWithContext or add \(\*Request\).WithContext` - req4 = f2(req4, ctx) - cli.Do(req4) - - req5, _ := func() (*http.Request, error) { - return http.NewRequest(http.MethodPost, url, nil) // want `should rewrite http.NewRequestWithContext or add \(\*Request\).WithContext` - }() - cli.Do(req5) - -} -``` - -## Reference -- [net/http - NewRequest](https://golang.org/pkg/net/http/#NewRequest) -- [net/http - NewRequestWithContext](https://golang.org/pkg/net/http/#NewRequestWithContext) -- [net/http - Request.WithContext](https://golang.org/pkg/net/http/#Request.WithContext) - diff --git a/vendor/github.com/sonatard/noctx/ngfunc/main.go b/vendor/github.com/sonatard/noctx/ngfunc/main.go deleted file mode 100644 index 46306218d2..0000000000 --- a/vendor/github.com/sonatard/noctx/ngfunc/main.go +++ /dev/null @@ -1,61 +0,0 @@ -package ngfunc - -import ( - "fmt" - "go/types" - - "github.com/gostaticanalysis/analysisutil" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" -) - -func Run(pass *analysis.Pass) (interface{}, error) { - ngFuncNames := []string{ - "net/http.Get", - "net/http.Head", - "net/http.Post", - "net/http.PostForm", - "(*net/http.Client).Get", - "(*net/http.Client).Head", - "(*net/http.Client).Post", - "(*net/http.Client).PostForm", - } - - ngFuncs := typeFuncs(pass, ngFuncNames) - if len(ngFuncs) == 0 { - return nil, nil - } - - reportFuncs := ngCalledFuncs(pass, ngFuncs) - report(pass, reportFuncs) - - return nil, nil -} - -func ngCalledFuncs(pass *analysis.Pass, ngFuncs []*types.Func) []*Report { - var reports []*Report - - ssa, ok := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA) - if !ok { - panic(fmt.Sprintf("%T is not *buildssa.SSA", pass.ResultOf[buildssa.Analyzer])) - } - for _, sf := range ssa.SrcFuncs { - for _, b := range sf.Blocks { - for _, instr := range b.Instrs { - for _, ngFunc := range ngFuncs { - if analysisutil.Called(instr, nil, ngFunc) { - ngCalledFunc := &Report{ - Instruction: instr, - function: ngFunc, - } - reports = append(reports, ngCalledFunc) - - break - } - } - } - } - } - - return reports -} diff --git a/vendor/github.com/sonatard/noctx/ngfunc/report.go b/vendor/github.com/sonatard/noctx/ngfunc/report.go deleted file mode 100644 index e500517986..0000000000 --- a/vendor/github.com/sonatard/noctx/ngfunc/report.go +++ /dev/null @@ -1,29 +0,0 @@ -package ngfunc - -import ( - "fmt" - "go/token" - "go/types" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ssa" -) - -type Report struct { - Instruction ssa.Instruction - function *types.Func -} - -func (n *Report) Pos() token.Pos { - return n.Instruction.Pos() -} - -func (n *Report) Message() string { - return fmt.Sprintf("%s must not be called", n.function.FullName()) -} - -func report(pass *analysis.Pass, reports []*Report) { - for _, report := range reports { - pass.Reportf(report.Pos(), report.Message()) - } -} diff --git a/vendor/github.com/sonatard/noctx/ngfunc/types.go b/vendor/github.com/sonatard/noctx/ngfunc/types.go deleted file mode 100644 index f1877386ce..0000000000 --- a/vendor/github.com/sonatard/noctx/ngfunc/types.go +++ /dev/null @@ -1,65 +0,0 @@ -package ngfunc - -import ( - "fmt" - "go/types" - "strings" - - "github.com/gostaticanalysis/analysisutil" - "golang.org/x/tools/go/analysis" -) - -var errNotFound = fmt.Errorf("function not found") - -func typeFuncs(pass *analysis.Pass, funcs []string) []*types.Func { - fs := make([]*types.Func, 0, len(funcs)) - - for _, fn := range funcs { - f, err := typeFunc(pass, fn) - if err != nil { - continue - } - - fs = append(fs, f) - } - - return fs -} - -func typeFunc(pass *analysis.Pass, funcName string) (*types.Func, error) { - ss := strings.Split(strings.TrimSpace(funcName), ".") - - switch len(ss) { - case 2: - // package function: pkgname.Func - f, ok := analysisutil.ObjectOf(pass, ss[0], ss[1]).(*types.Func) - if !ok || f == nil { - return nil, errNotFound - } - - return f, nil - case 3: - // method: (*pkgname.Type).Method - pkgname := strings.TrimLeft(ss[0], "(") - typename := strings.TrimRight(ss[1], ")") - - if pkgname != "" && pkgname[0] == '*' { - pkgname = pkgname[1:] - typename = "*" + typename - } - - typ := analysisutil.TypeOf(pass, pkgname, typename) - if typ == nil { - return nil, errNotFound - } - - m := analysisutil.MethodOf(typ, ss[2]) - if m == nil { - return nil, errNotFound - } - - return m, nil - } - - return nil, errNotFound -} diff --git a/vendor/github.com/sonatard/noctx/noctx.go b/vendor/github.com/sonatard/noctx/noctx.go deleted file mode 100644 index 89e0446ecd..0000000000 --- a/vendor/github.com/sonatard/noctx/noctx.go +++ /dev/null @@ -1,35 +0,0 @@ -package noctx - -import ( - "fmt" - "github.com/sonatard/noctx/ngfunc" - "github.com/sonatard/noctx/reqwithoutctx" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" -) - -var Analyzer = &analysis.Analyzer{ - Name: "noctx", - Doc: Doc, - Run: run, - RunDespiteErrors: false, - Requires: []*analysis.Analyzer{ - buildssa.Analyzer, - }, - ResultType: nil, - FactTypes: nil, -} - -const Doc = "noctx finds sending http request without context.Context" - -func run(pass *analysis.Pass) (interface{}, error) { - if _, err := ngfunc.Run(pass); err != nil { - return nil, fmt.Errorf("run: %w", err) - } - - if _, err := reqwithoutctx.Run(pass); err != nil { - return nil, fmt.Errorf("run: %w", err) - } - - return nil, nil -} diff --git a/vendor/github.com/sonatard/noctx/reqwithoutctx/main.go b/vendor/github.com/sonatard/noctx/reqwithoutctx/main.go deleted file mode 100644 index b09e1de1b0..0000000000 --- a/vendor/github.com/sonatard/noctx/reqwithoutctx/main.go +++ /dev/null @@ -1,14 +0,0 @@ -package reqwithoutctx - -import ( - "golang.org/x/tools/go/analysis" -) - -func Run(pass *analysis.Pass) (interface{}, error) { - analyzer := NewAnalyzer(pass) - reports := analyzer.Exec() - - report(pass, reports) - - return nil, nil -} diff --git a/vendor/github.com/sonatard/noctx/reqwithoutctx/report.go b/vendor/github.com/sonatard/noctx/reqwithoutctx/report.go deleted file mode 100644 index 1c94e3148c..0000000000 --- a/vendor/github.com/sonatard/noctx/reqwithoutctx/report.go +++ /dev/null @@ -1,26 +0,0 @@ -package reqwithoutctx - -import ( - "go/token" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/ssa" -) - -type Report struct { - Instruction ssa.Instruction -} - -func (n *Report) Pos() token.Pos { - return n.Instruction.Pos() -} - -func (n *Report) Message() string { - return "should rewrite http.NewRequestWithContext or add (*Request).WithContext" -} - -func report(pass *analysis.Pass, reports []*Report) { - for _, report := range reports { - pass.Reportf(report.Pos(), report.Message()) - } -} diff --git a/vendor/github.com/sonatard/noctx/reqwithoutctx/ssa.go b/vendor/github.com/sonatard/noctx/reqwithoutctx/ssa.go deleted file mode 100644 index d7e0f5084d..0000000000 --- a/vendor/github.com/sonatard/noctx/reqwithoutctx/ssa.go +++ /dev/null @@ -1,185 +0,0 @@ -package reqwithoutctx - -import ( - "fmt" - "go/types" - - "github.com/gostaticanalysis/analysisutil" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/ssa" -) - -//nolint:govet -type Analyzer struct { - Funcs []*ssa.Function - newRequestType types.Type - requestType types.Type -} - -func NewAnalyzer(pass *analysis.Pass) *Analyzer { - newRequestType := analysisutil.TypeOf(pass, "net/http", "NewRequest") - requestType := analysisutil.TypeOf(pass, "net/http", "*Request") - - ssa, ok := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA) - if !ok { - panic(fmt.Sprintf("%T is not *buildssa.SSA", pass.ResultOf[buildssa.Analyzer])) - } - - return &Analyzer{ - Funcs: ssa.SrcFuncs, - newRequestType: newRequestType, - requestType: requestType, - } -} - -func (a *Analyzer) Exec() []*Report { - if a.newRequestType == nil || a.requestType == nil { - return []*Report{} - } - - usedReqs := a.usedReqs() - newReqs := a.requestsByNewRequest() - - return a.report(usedReqs, newReqs) -} - -func (a *Analyzer) report(usedReqs map[string]*ssa.Extract, newReqs map[*ssa.Call]*ssa.Extract) []*Report { - var reports []*Report - - for _, fReq := range usedReqs { - for newRequest, req := range newReqs { - if fReq == req { - reports = append(reports, &Report{Instruction: newRequest}) - } - } - } - - return reports -} - -func (a *Analyzer) usedReqs() map[string]*ssa.Extract { - reqExts := make(map[string]*ssa.Extract) - - for _, f := range a.Funcs { - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - switch i := instr.(type) { - case *ssa.Call: - exts := a.usedReqByCall(i) - for _, ext := range exts { - key := i.String() + ext.String() - reqExts[key] = ext - } - case *ssa.UnOp: - ext := a.usedReqByUnOp(i) - if ext != nil { - key := i.String() + ext.String() - reqExts[key] = ext - } - case *ssa.Return: - exts := a.usedReqByReturn(i) - for _, ext := range exts { - key := i.String() + ext.String() - reqExts[key] = ext - } - } - } - } - } - - return reqExts -} - -func (a *Analyzer) usedReqByCall(call *ssa.Call) []*ssa.Extract { - args := call.Common().Args - exts := make([]*ssa.Extract, 0, len(args)) - - // skip net/http.Request method call - if call.Common().Signature().Recv() != nil && types.Identical(call.Value().Type(), a.requestType) { - return exts - } - - if len(args) == 0 { - return exts - } - - for _, arg := range args { - ext, ok := arg.(*ssa.Extract) - if !ok { - continue - } - - if !types.Identical(ext.Type(), a.requestType) { - continue - } - - exts = append(exts, ext) - } - - return exts -} - -func (a *Analyzer) usedReqByUnOp(op *ssa.UnOp) *ssa.Extract { - if ext, ok := op.X.(*ssa.Extract); ok && types.Identical(ext.Type(), a.requestType) { - return ext - } - - return nil -} - -func (a *Analyzer) usedReqByReturn(ret *ssa.Return) []*ssa.Extract { - rets := ret.Results - exts := make([]*ssa.Extract, 0, len(rets)) - - for _, ret := range rets { - ext, ok := ret.(*ssa.Extract) - if !ok { - continue - } - - if types.Identical(ext.Type(), a.requestType) { - exts = append(exts, ext) - } - } - - return exts -} - -func (a *Analyzer) requestsByNewRequest() map[*ssa.Call]*ssa.Extract { - reqs := make(map[*ssa.Call]*ssa.Extract) - - for _, f := range a.Funcs { - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - ext, ok := instr.(*ssa.Extract) - if !ok { - continue - } - - if !types.Identical(ext.Type(), a.requestType) { - continue - } - - operands := ext.Operands([]*ssa.Value{}) - if len(operands) != 1 { - continue - } - - operand := *operands[0] - - f, ok := operand.(*ssa.Call) - if !ok { - continue - } - - if types.Identical(f.Call.Value.Type(), a.newRequestType) { - reqs[f] = ext - } - } - } - } - - return reqs -} diff --git a/vendor/github.com/sourcegraph/go-diff/LICENSE b/vendor/github.com/sourcegraph/go-diff/LICENSE deleted file mode 100644 index 5ba1c44360..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/LICENSE +++ /dev/null @@ -1,46 +0,0 @@ -Copyright (c) 2014 Sourcegraph, Inc. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------------------------------------ - -Portions adapted from python-unidiff: - -Copyright (c) 2012 Matias Bordese - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE -OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/sourcegraph/go-diff/diff/diff.go b/vendor/github.com/sourcegraph/go-diff/diff/diff.go deleted file mode 100644 index 81aa655707..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/diff/diff.go +++ /dev/null @@ -1,136 +0,0 @@ -package diff - -import ( - "bytes" - "time" -) - -// A FileDiff represents a unified diff for a single file. -// -// A file unified diff has a header that resembles the following: -// -// --- oldname 2009-10-11 15:12:20.000000000 -0700 -// +++ newname 2009-10-11 15:12:30.000000000 -0700 -type FileDiff struct { - // the original name of the file - OrigName string - // the original timestamp (nil if not present) - OrigTime *time.Time - // the new name of the file (often same as OrigName) - NewName string - // the new timestamp (nil if not present) - NewTime *time.Time - // extended header lines (e.g., git's "new mode ", "rename from ", etc.) - Extended []string - // hunks that were changed from orig to new - Hunks []*Hunk -} - -// A Hunk represents a series of changes (additions or deletions) in a file's -// unified diff. -type Hunk struct { - // starting line number in original file - OrigStartLine int32 - // number of lines the hunk applies to in the original file - OrigLines int32 - // if > 0, then the original file had a 'No newline at end of file' mark at this offset - OrigNoNewlineAt int32 - // starting line number in new file - NewStartLine int32 - // number of lines the hunk applies to in the new file - NewLines int32 - // optional section heading - Section string - // 0-indexed line offset in unified file diff (including section headers); this is - // only set when Hunks are read from entire file diff (i.e., when ReadAllHunks is - // called) This accounts for hunk headers, too, so the StartPosition of the first - // hunk will be 1. - StartPosition int32 - // hunk body (lines prefixed with '-', '+', or ' ') - Body []byte -} - -// A Stat is a diff stat that represents the number of lines added/changed/deleted. -type Stat struct { - // number of lines added - Added int32 - // number of lines changed - Changed int32 - // number of lines deleted - Deleted int32 -} - -// Stat computes the number of lines added/changed/deleted in all -// hunks in this file's diff. -func (d *FileDiff) Stat() Stat { - total := Stat{} - for _, h := range d.Hunks { - total.add(h.Stat()) - } - return total -} - -// Stat computes the number of lines added/changed/deleted in this -// hunk. -func (h *Hunk) Stat() Stat { - lines := bytes.Split(h.Body, []byte{'\n'}) - var last byte - st := Stat{} - for _, line := range lines { - if len(line) == 0 { - last = 0 - continue - } - switch line[0] { - case '-': - if last == '+' { - st.Added-- - st.Changed++ - last = 0 // next line can't change this one since this is already a change - } else { - st.Deleted++ - last = line[0] - } - case '+': - if last == '-' { - st.Deleted-- - st.Changed++ - last = 0 // next line can't change this one since this is already a change - } else { - st.Added++ - last = line[0] - } - default: - last = 0 - } - } - return st -} - -var ( - hunkPrefix = []byte("@@ ") - onlyInMessagePrefix = []byte("Only in ") -) - -const hunkHeader = "@@ -%d,%d +%d,%d @@" -const onlyInMessage = "Only in %s: %s\n" - -// diffTimeParseLayout is the layout used to parse the time in unified diff file -// header timestamps. -// See https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html. -const diffTimeParseLayout = "2006-01-02 15:04:05 -0700" - -// Apple's diff is based on freebsd diff, which uses a timestamp format that does -// not include the timezone offset. -const diffTimeParseWithoutTZLayout = "2006-01-02 15:04:05" - -// diffTimeFormatLayout is the layout used to format (i.e., print) the time in unified diff file -// header timestamps. -// See https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html. -const diffTimeFormatLayout = "2006-01-02 15:04:05.000000000 -0700" - -func (s *Stat) add(o Stat) { - s.Added += o.Added - s.Changed += o.Changed - s.Deleted += o.Deleted -} diff --git a/vendor/github.com/sourcegraph/go-diff/diff/doc.go b/vendor/github.com/sourcegraph/go-diff/diff/doc.go deleted file mode 100644 index 12fe96a070..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/diff/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package diff provides a parser for unified diffs. -package diff diff --git a/vendor/github.com/sourcegraph/go-diff/diff/parse.go b/vendor/github.com/sourcegraph/go-diff/diff/parse.go deleted file mode 100644 index 48eeb96702..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/diff/parse.go +++ /dev/null @@ -1,865 +0,0 @@ -package diff - -import ( - "bufio" - "bytes" - "errors" - "fmt" - "io" - "path/filepath" - "strconv" - "strings" - "time" -) - -// ParseMultiFileDiff parses a multi-file unified diff. It returns an error if -// parsing failed as a whole, but does its best to parse as many files in the -// case of per-file errors. If it cannot detect when the diff of the next file -// begins, the hunks are added to the FileDiff of the previous file. -func ParseMultiFileDiff(diff []byte) ([]*FileDiff, error) { - return NewMultiFileDiffReader(bytes.NewReader(diff)).ReadAllFiles() -} - -// NewMultiFileDiffReader returns a new MultiFileDiffReader that reads -// a multi-file unified diff from r. -func NewMultiFileDiffReader(r io.Reader) *MultiFileDiffReader { - return &MultiFileDiffReader{reader: newLineReader(r)} -} - -// MultiFileDiffReader reads a multi-file unified diff. -type MultiFileDiffReader struct { - line int - offset int64 - reader *lineReader - - // TODO(sqs): line and offset tracking in multi-file diffs is broken; add tests and fix - - // nextFileFirstLine is a line that was read by a HunksReader that - // was how it determined the hunk was complete. But to determine - // that, it needed to read the first line of the next file. We - // store nextFileFirstLine so we can "give the first line back" to - // the next file. - nextFileFirstLine []byte -} - -// ReadFile reads the next file unified diff (including headers and -// all hunks) from r. If there are no more files in the diff, it -// returns error io.EOF. -func (r *MultiFileDiffReader) ReadFile() (*FileDiff, error) { - fd, _, err := r.ReadFileWithTrailingContent() - return fd, err -} - -// ReadFileWithTrailingContent reads the next file unified diff (including -// headers and all hunks) from r, also returning any trailing content. If there -// are no more files in the diff, it returns error io.EOF. -func (r *MultiFileDiffReader) ReadFileWithTrailingContent() (*FileDiff, string, error) { - fr := &FileDiffReader{ - line: r.line, - offset: r.offset, - reader: r.reader, - fileHeaderLine: r.nextFileFirstLine, - } - r.nextFileFirstLine = nil - - fd, err := fr.ReadAllHeaders() - if err != nil { - switch e := err.(type) { - case *ParseError: - if e.Err == ErrNoFileHeader || e.Err == ErrExtendedHeadersEOF { - // Any non-diff content preceding a valid diff is included in the - // extended headers of the following diff. In this way, mixed diff / - // non-diff content can be parsed. Trailing non-diff content is - // different: it doesn't make sense to return a FileDiff with only - // extended headers populated. Instead, we return any trailing content - // in case the caller needs it. - trailing := "" - if fd != nil { - trailing = strings.Join(fd.Extended, "\n") - } - return nil, trailing, io.EOF - } - return nil, "", err - - case OverflowError: - r.nextFileFirstLine = []byte(e) - return fd, "", nil - - default: - return nil, "", err - } - } - - // FileDiff is added/deleted file - // No further collection of hunks needed - if fd.NewName == "" { - return fd, "", nil - } - - // Before reading hunks, check to see if there are any. If there - // aren't any, and there's another file after this file in the - // diff, then the hunks reader will complain ErrNoHunkHeader. It's - // not easy for us to tell from that error alone if that was - // caused by the lack of any hunks, or a malformatted hunk, so we - // need to perform the check here. - hr := fr.HunksReader() - line, err := r.reader.readLine() - if err != nil && err != io.EOF { - return fd, "", err - } - line = bytes.TrimSuffix(line, []byte{'\n'}) - if bytes.HasPrefix(line, hunkPrefix) { - hr.nextHunkHeaderLine = line - fd.Hunks, err = hr.ReadAllHunks() - r.line = fr.line - r.offset = fr.offset - if err != nil { - if e0, ok := err.(*ParseError); ok { - if e, ok := e0.Err.(*ErrBadHunkLine); ok { - // This just means we finished reading the hunks for the - // current file. See the ErrBadHunkLine doc for more info. - r.nextFileFirstLine = e.Line - return fd, "", nil - } - } - return nil, "", err - } - } else { - // There weren't any hunks, so that line we peeked ahead at - // actually belongs to the next file. Put it back. - r.nextFileFirstLine = line - } - - return fd, "", nil -} - -// ReadAllFiles reads all file unified diffs (including headers and all -// hunks) remaining in r. -func (r *MultiFileDiffReader) ReadAllFiles() ([]*FileDiff, error) { - var ds []*FileDiff - for { - d, err := r.ReadFile() - if d != nil { - ds = append(ds, d) - } - if err == io.EOF { - return ds, nil - } - if err != nil { - return nil, err - } - } -} - -// ParseFileDiff parses a file unified diff. -func ParseFileDiff(diff []byte) (*FileDiff, error) { - return NewFileDiffReader(bytes.NewReader(diff)).Read() -} - -// NewFileDiffReader returns a new FileDiffReader that reads a file -// unified diff. -func NewFileDiffReader(r io.Reader) *FileDiffReader { - return &FileDiffReader{reader: &lineReader{reader: bufio.NewReader(r)}} -} - -// FileDiffReader reads a unified file diff. -type FileDiffReader struct { - line int - offset int64 - reader *lineReader - - // fileHeaderLine is the first file header line, set by: - // - // (1) ReadExtendedHeaders if it encroaches on a file header line - // (which it must to detect when extended headers are done); or - // (2) (*MultiFileDiffReader).ReadFile() if it encroaches on a - // file header line while reading the previous file's hunks (in a - // multi-file diff). - fileHeaderLine []byte -} - -// Read reads a file unified diff, including headers and hunks, from r. -func (r *FileDiffReader) Read() (*FileDiff, error) { - fd, err := r.ReadAllHeaders() - if err != nil { - return nil, err - } - - fd.Hunks, err = r.HunksReader().ReadAllHunks() - if err != nil { - return nil, err - } - - return fd, nil -} - -// ReadAllHeaders reads the file headers and extended headers (if any) -// from a file unified diff. It does not read hunks, and the returned -// FileDiff's Hunks field is nil. To read the hunks, call the -// (*FileDiffReader).HunksReader() method to get a HunksReader and -// read hunks from that. -func (r *FileDiffReader) ReadAllHeaders() (*FileDiff, error) { - var err error - fd := &FileDiff{} - - fd.Extended, err = r.ReadExtendedHeaders() - if pe, ok := err.(*ParseError); ok && pe.Err == ErrExtendedHeadersEOF { - wasEmpty := handleEmpty(fd) - if wasEmpty { - return fd, nil - } - return fd, err - } else if _, ok := err.(OverflowError); ok { - handleEmpty(fd) - return fd, err - } else if err != nil { - return fd, err - } - - var origTime, newTime *time.Time - fd.OrigName, fd.NewName, origTime, newTime, err = r.ReadFileHeaders() - if err != nil { - return nil, err - } - if origTime != nil { - fd.OrigTime = origTime - } - if newTime != nil { - fd.NewTime = newTime - } - - return fd, nil -} - -// HunksReader returns a new HunksReader that reads hunks from r. The -// HunksReader's line and offset (used in error messages) is set to -// start where the file diff header ended (which means errors have the -// correct position information). -func (r *FileDiffReader) HunksReader() *HunksReader { - return &HunksReader{ - line: r.line, - offset: r.offset, - reader: r.reader, - } -} - -// ReadFileHeaders reads the unified file diff header (the lines that -// start with "---" and "+++" with the orig/new file names and -// timestamps). Or which starts with "Only in " with dir path and filename. -// "Only in" message is supported in POSIX locale: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/diff.html#tag_20_34_10 -func (r *FileDiffReader) ReadFileHeaders() (origName, newName string, origTimestamp, newTimestamp *time.Time, err error) { - if r.fileHeaderLine != nil { - if isOnlyMessage, source, filename := parseOnlyInMessage(r.fileHeaderLine); isOnlyMessage { - return filepath.Join(string(source), string(filename)), - "", nil, nil, nil - } - } - origName, origTimestamp, err = r.readOneFileHeader([]byte("--- ")) - if err != nil { - return "", "", nil, nil, err - } - - newName, newTimestamp, err = r.readOneFileHeader([]byte("+++ ")) - if err != nil { - return "", "", nil, nil, err - } - - unquotedOrigName, err := strconv.Unquote(origName) - if err == nil { - origName = unquotedOrigName - } - unquotedNewName, err := strconv.Unquote(newName) - if err == nil { - newName = unquotedNewName - } - - return origName, newName, origTimestamp, newTimestamp, nil -} - -// readOneFileHeader reads one of the file headers (prefix should be -// either "+++ " or "--- "). -func (r *FileDiffReader) readOneFileHeader(prefix []byte) (filename string, timestamp *time.Time, err error) { - var line []byte - - if r.fileHeaderLine == nil { - var err error - line, err = r.reader.readLine() - if err == io.EOF { - return "", nil, &ParseError{r.line, r.offset, ErrNoFileHeader} - } else if err != nil { - return "", nil, err - } - } else { - line = r.fileHeaderLine - r.fileHeaderLine = nil - } - - if !bytes.HasPrefix(line, prefix) { - return "", nil, &ParseError{r.line, r.offset, ErrBadFileHeader} - } - - r.offset += int64(len(line)) - r.line++ - line = line[len(prefix):] - - trimmedLine := strings.TrimSpace(string(line)) // filenames that contain spaces may be terminated by a tab - parts := strings.SplitN(trimmedLine, "\t", 2) - filename = parts[0] - if len(parts) == 2 { - var ts time.Time - // Timestamp is optional, but this header has it. - ts, err = time.Parse(diffTimeParseLayout, parts[1]) - if err != nil { - var err1 error - ts, err1 = time.Parse(diffTimeParseWithoutTZLayout, parts[1]) - if err1 != nil { - return "", nil, err - } - err = nil - } - timestamp = &ts - } - - return filename, timestamp, err -} - -// OverflowError is returned when we have overflowed into the start -// of the next file while reading extended headers. -type OverflowError string - -func (e OverflowError) Error() string { - return fmt.Sprintf("overflowed into next file: %s", string(e)) -} - -// ReadExtendedHeaders reads the extended header lines, if any, from a -// unified diff file (e.g., git's "diff --git a/foo.go b/foo.go", "new -// mode ", "rename from ", etc.). -func (r *FileDiffReader) ReadExtendedHeaders() ([]string, error) { - var xheaders []string - firstLine := true - for { - var line []byte - if r.fileHeaderLine == nil { - var err error - line, err = r.reader.readLine() - if err == io.EOF { - return xheaders, &ParseError{r.line, r.offset, ErrExtendedHeadersEOF} - } else if err != nil { - return xheaders, err - } - } else { - line = r.fileHeaderLine - r.fileHeaderLine = nil - } - - if bytes.HasPrefix(line, []byte("diff --git ")) { - if firstLine { - firstLine = false - } else { - return xheaders, OverflowError(line) - } - } - if bytes.HasPrefix(line, []byte("--- ")) { - // We've reached the file header. - r.fileHeaderLine = line // pass to readOneFileHeader (see fileHeaderLine field doc) - return xheaders, nil - } - - // Reached message that file is added/deleted - if isOnlyInMessage, _, _ := parseOnlyInMessage(line); isOnlyInMessage { - r.fileHeaderLine = line // pass to readOneFileHeader (see fileHeaderLine field doc) - return xheaders, nil - } - - r.line++ - r.offset += int64(len(line)) - xheaders = append(xheaders, string(line)) - } -} - -// readQuotedFilename extracts a quoted filename from the beginning of a string, -// returning the unquoted filename and any remaining text after the filename. -func readQuotedFilename(text string) (value string, remainder string, err error) { - if text == "" || text[0] != '"' { - return "", "", fmt.Errorf(`string must start with a '"': %s`, text) - } - - // The end quote is the first quote NOT preceeded by an uneven number of backslashes. - numberOfBackslashes := 0 - for i, c := range text { - if c == '"' && i > 0 && numberOfBackslashes%2 == 0 { - value, err = strconv.Unquote(text[:i+1]) - remainder = text[i+1:] - return - } else if c == '\\' { - numberOfBackslashes++ - } else { - numberOfBackslashes = 0 - } - } - return "", "", fmt.Errorf(`end of string found while searching for '"': %s`, text) -} - -// parseDiffGitArgs extracts the two filenames from a 'diff --git' line. -// Returns false on syntax error, true if syntax is valid. Even with a -// valid syntax, it may be impossible to extract filenames; if so, the -// function returns ("", "", true). -func parseDiffGitArgs(diffArgs string) (string, string, bool) { - length := len(diffArgs) - if length < 3 { - return "", "", false - } - - if diffArgs[0] != '"' && diffArgs[length-1] != '"' { - // Both filenames are unquoted. - firstSpace := strings.IndexByte(diffArgs, ' ') - if firstSpace <= 0 || firstSpace == length-1 { - return "", "", false - } - - secondSpace := strings.IndexByte(diffArgs[firstSpace+1:], ' ') - if secondSpace == -1 { - if diffArgs[firstSpace+1] == '"' { - // The second filename begins with '"', but doesn't end with one. - return "", "", false - } - return diffArgs[:firstSpace], diffArgs[firstSpace+1:], true - } - - // One or both filenames contain a space, but the names are - // unquoted. Here, the 'diff --git' syntax is ambiguous, and - // we have to obtain the filenames elsewhere (e.g. from the - // hunk headers or extended headers). HOWEVER, if the file - // is newly created and empty, there IS no other place to - // find the filename. In this case, the two filenames are - // identical (except for the leading 'a/' prefix), and we have - // to handle that case here. - first := diffArgs[:length/2] - second := diffArgs[length/2+1:] - - // If the two strings could be equal, based on length, proceed. - if length%2 == 1 { - // If the name minus the a/ b/ prefixes is equal, proceed. - if len(first) >= 3 && first[1] == '/' && first[1:] == second[1:] { - return first, second, true - } - // If the names don't have the a/ and b/ prefixes and they're equal, proceed. - if !(first[:2] == "a/" && second[:2] == "b/") && first == second { - return first, second, true - } - } - - // The syntax is (unfortunately) valid, but we could not extract - // the filenames. - return "", "", true - } - - if diffArgs[0] == '"' { - first, remainder, err := readQuotedFilename(diffArgs) - if err != nil || len(remainder) < 2 || remainder[0] != ' ' { - return "", "", false - } - if remainder[1] == '"' { - second, remainder, err := readQuotedFilename(remainder[1:]) - if remainder != "" || err != nil { - return "", "", false - } - return first, second, true - } - return first, remainder[1:], true - } - - // In this case, second argument MUST be quoted (or it's a syntax error) - i := strings.IndexByte(diffArgs, '"') - if i == -1 || i+2 >= length || diffArgs[i-1] != ' ' { - return "", "", false - } - - second, remainder, err := readQuotedFilename(diffArgs[i:]) - if remainder != "" || err != nil { - return "", "", false - } - return diffArgs[:i-1], second, true -} - -// handleEmpty detects when FileDiff was an empty diff and will not have any hunks -// that follow. It updates fd fields from the parsed extended headers. -func handleEmpty(fd *FileDiff) (wasEmpty bool) { - lineCount := len(fd.Extended) - if lineCount > 0 && !strings.HasPrefix(fd.Extended[0], "diff --git ") { - return false - } - - lineHasPrefix := func(idx int, prefix string) bool { - return strings.HasPrefix(fd.Extended[idx], prefix) - } - - linesHavePrefixes := func(idx1 int, prefix1 string, idx2 int, prefix2 string) bool { - return lineHasPrefix(idx1, prefix1) && lineHasPrefix(idx2, prefix2) - } - - isCopy := (lineCount == 4 && linesHavePrefixes(2, "copy from ", 3, "copy to ")) || - (lineCount == 6 && linesHavePrefixes(2, "copy from ", 3, "copy to ") && lineHasPrefix(5, "Binary files ")) || - (lineCount == 6 && linesHavePrefixes(1, "old mode ", 2, "new mode ") && linesHavePrefixes(4, "copy from ", 5, "copy to ")) - - isRename := (lineCount == 4 && linesHavePrefixes(2, "rename from ", 3, "rename to ")) || - (lineCount == 5 && linesHavePrefixes(2, "rename from ", 3, "rename to ") && lineHasPrefix(4, "Binary files ")) || - (lineCount == 6 && linesHavePrefixes(2, "rename from ", 3, "rename to ") && lineHasPrefix(5, "Binary files ")) || - (lineCount == 6 && linesHavePrefixes(1, "old mode ", 2, "new mode ") && linesHavePrefixes(4, "rename from ", 5, "rename to ")) - - isDeletedFile := (lineCount == 3 || lineCount == 4 && lineHasPrefix(3, "Binary files ") || lineCount > 4 && lineHasPrefix(3, "GIT binary patch")) && - lineHasPrefix(1, "deleted file mode ") - - isNewFile := (lineCount == 3 || lineCount == 4 && lineHasPrefix(3, "Binary files ") || lineCount > 4 && lineHasPrefix(3, "GIT binary patch")) && - lineHasPrefix(1, "new file mode ") - - isModeChange := lineCount == 3 && linesHavePrefixes(1, "old mode ", 2, "new mode ") - - isBinaryPatch := lineCount == 3 && lineHasPrefix(2, "Binary files ") || lineCount > 3 && lineHasPrefix(2, "GIT binary patch") - - if !isModeChange && !isCopy && !isRename && !isBinaryPatch && !isNewFile && !isDeletedFile { - return false - } - - var success bool - fd.OrigName, fd.NewName, success = parseDiffGitArgs(fd.Extended[0][len("diff --git "):]) - if isNewFile { - fd.OrigName = "/dev/null" - } - - if isDeletedFile { - fd.NewName = "/dev/null" - } - - // For ambiguous 'diff --git' lines, try to reconstruct filenames using extended headers. - if success && (isCopy || isRename) && fd.OrigName == "" && fd.NewName == "" { - diffArgs := fd.Extended[0][len("diff --git "):] - - tryReconstruct := func(header string, prefix string, whichFile int, result *string) { - if !strings.HasPrefix(header, prefix) { - return - } - rawFilename := header[len(prefix):] - - // extract the filename prefix (e.g. "a/") from the 'diff --git' line. - var prefixLetterIndex int - if whichFile == 1 { - prefixLetterIndex = 0 - } else if whichFile == 2 { - prefixLetterIndex = len(diffArgs) - len(rawFilename) - 2 - } - if prefixLetterIndex < 0 || diffArgs[prefixLetterIndex+1] != '/' { - return - } - - *result = diffArgs[prefixLetterIndex:prefixLetterIndex+2] + rawFilename - } - - for _, header := range fd.Extended { - tryReconstruct(header, "copy from ", 1, &fd.OrigName) - tryReconstruct(header, "copy to ", 2, &fd.NewName) - tryReconstruct(header, "rename from ", 1, &fd.OrigName) - tryReconstruct(header, "rename to ", 2, &fd.NewName) - } - } - return success -} - -var ( - // ErrNoFileHeader is when a file unified diff has no file header - // (i.e., the lines that begin with "---" and "+++"). - ErrNoFileHeader = errors.New("expected file header, got EOF") - - // ErrBadFileHeader is when a file unified diff has a malformed - // file header (i.e., the lines that begin with "---" and "+++"). - ErrBadFileHeader = errors.New("bad file header") - - // ErrExtendedHeadersEOF is when an EOF was encountered while reading extended file headers, which means that there were no ---/+++ headers encountered before hunks (if any) began. - ErrExtendedHeadersEOF = errors.New("expected file header while reading extended headers, got EOF") - - // ErrBadOnlyInMessage is when a file have a malformed `only in` message - // Should be in format `Only in {source}: {filename}` - ErrBadOnlyInMessage = errors.New("bad 'only in' message") -) - -// ParseHunks parses hunks from a unified diff. The diff must consist -// only of hunks and not include a file header; if it has a file -// header, use ParseFileDiff. -func ParseHunks(diff []byte) ([]*Hunk, error) { - r := NewHunksReader(bytes.NewReader(diff)) - hunks, err := r.ReadAllHunks() - if err != nil { - return nil, err - } - return hunks, nil -} - -// NewHunksReader returns a new HunksReader that reads unified diff hunks -// from r. -func NewHunksReader(r io.Reader) *HunksReader { - return &HunksReader{reader: &lineReader{reader: bufio.NewReader(r)}} -} - -// A HunksReader reads hunks from a unified diff. -type HunksReader struct { - line int - offset int64 - hunk *Hunk - reader *lineReader - - nextHunkHeaderLine []byte -} - -// ReadHunk reads one hunk from r. If there are no more hunks, it -// returns error io.EOF. -func (r *HunksReader) ReadHunk() (*Hunk, error) { - r.hunk = nil - lastLineFromOrig := true - var line []byte - var err error - for { - if r.nextHunkHeaderLine != nil { - // Use stored hunk header line that was scanned in at the - // completion of the previous hunk's ReadHunk. - line = r.nextHunkHeaderLine - r.nextHunkHeaderLine = nil - } else { - line, err = r.reader.readLine() - if err != nil { - if err == io.EOF && r.hunk != nil { - return r.hunk, nil - } - return nil, err - } - } - - // Record position. - r.line++ - r.offset += int64(len(line)) - - if r.hunk == nil { - // Check for presence of hunk header. - if !bytes.HasPrefix(line, hunkPrefix) { - return nil, &ParseError{r.line, r.offset, ErrNoHunkHeader} - } - - // Parse hunk header. - r.hunk = &Hunk{} - items := []interface{}{ - &r.hunk.OrigStartLine, &r.hunk.OrigLines, - &r.hunk.NewStartLine, &r.hunk.NewLines, - } - header, section, err := normalizeHeader(string(line)) - if err != nil { - return nil, &ParseError{r.line, r.offset, err} - } - n, err := fmt.Sscanf(header, hunkHeader, items...) - if err != nil { - return nil, err - } - if n < len(items) { - return nil, &ParseError{r.line, r.offset, &ErrBadHunkHeader{header: string(line)}} - } - - r.hunk.Section = section - } else { - // Read hunk body line. - - // If the line starts with `---` and the next one with `+++` we're - // looking at a non-extended file header and need to abort. - if bytes.HasPrefix(line, []byte("---")) { - ok, err := r.reader.nextLineStartsWith("+++") - if err != nil { - return r.hunk, err - } - if ok { - ok2, _ := r.reader.nextNextLineStartsWith(string(hunkPrefix)) - if ok2 { - return r.hunk, &ParseError{r.line, r.offset, &ErrBadHunkLine{Line: line}} - } - } - } - - // If the line starts with the hunk prefix, this hunk is complete. - if bytes.HasPrefix(line, hunkPrefix) { - // But we've already read in the next hunk's - // header, so we need to be sure that the next call to - // ReadHunk starts with that header. - r.nextHunkHeaderLine = line - - // Rewind position. - r.line-- - r.offset -= int64(len(line)) - - return r.hunk, nil - } - - if len(line) >= 1 && !linePrefix(line[0]) { - // Bad hunk header line. If we're reading a multi-file - // diff, this may be the end of the current - // file. Return a "rich" error that lets our caller - // handle that case. - return r.hunk, &ParseError{r.line, r.offset, &ErrBadHunkLine{Line: line}} - } - if bytes.Equal(line, []byte(noNewlineMessage)) { - if lastLineFromOrig { - // Retain the newline in the body (otherwise the - // diff line would be like "-a+b", where "+b" is - // the the next line of the new file, which is not - // validly formatted) but record that the orig had - // no newline. - r.hunk.OrigNoNewlineAt = int32(len(r.hunk.Body)) - } else { - // Remove previous line's newline. - if len(r.hunk.Body) != 0 { - r.hunk.Body = r.hunk.Body[:len(r.hunk.Body)-1] - } - } - continue - } - - if len(line) > 0 { - lastLineFromOrig = line[0] == '-' - } - - r.hunk.Body = append(r.hunk.Body, line...) - r.hunk.Body = append(r.hunk.Body, '\n') - } - } -} - -const noNewlineMessage = `\ No newline at end of file` - -// linePrefixes is the set of all characters a valid line in a diff -// hunk can start with. '\' can appear in diffs when no newline is -// present at the end of a file. -// See: 'http://www.gnu.org/software/diffutils/manual/diffutils.html#Incomplete-Lines' -var linePrefixes = []byte{' ', '-', '+', '\\'} - -// linePrefix returns true if 'c' is in 'linePrefixes'. -func linePrefix(c byte) bool { - for _, p := range linePrefixes { - if p == c { - return true - } - } - return false -} - -// normalizeHeader takes a header of the form: -// "@@ -linestart[,chunksize] +linestart[,chunksize] @@ section" -// and returns two strings, with the first in the form: -// "@@ -linestart,chunksize +linestart,chunksize @@". -// where linestart and chunksize are both integers. The second is the -// optional section header. chunksize may be omitted from the header -// if its value is 1. normalizeHeader returns an error if the header -// is not in the correct format. -func normalizeHeader(header string) (string, string, error) { - // Split the header into five parts: the first '@@', the two - // ranges, the last '@@', and the optional section. - pieces := strings.SplitN(header, " ", 5) - if len(pieces) < 4 { - return "", "", &ErrBadHunkHeader{header: header} - } - - if pieces[0] != "@@" { - return "", "", &ErrBadHunkHeader{header: header} - } - for i := 1; i < 3; i++ { - if !strings.ContainsRune(pieces[i], ',') { - pieces[i] = pieces[i] + ",1" - } - } - if pieces[3] != "@@" { - return "", "", &ErrBadHunkHeader{header: header} - } - - var section string - if len(pieces) == 5 { - section = pieces[4] - } - return strings.Join(pieces, " "), strings.TrimSpace(section), nil -} - -// ReadAllHunks reads all remaining hunks from r. A successful call -// returns err == nil, not err == EOF. Because ReadAllHunks is defined -// to read until EOF, it does not treat end of file as an error to be -// reported. -func (r *HunksReader) ReadAllHunks() ([]*Hunk, error) { - var hunks []*Hunk - linesRead := int32(0) - for { - hunk, err := r.ReadHunk() - if err == io.EOF { - return hunks, nil - } - if hunk != nil { - linesRead++ // account for the hunk header line - hunk.StartPosition = linesRead - hunks = append(hunks, hunk) - linesRead += int32(bytes.Count(hunk.Body, []byte{'\n'})) - } - if err != nil { - return hunks, err - } - } -} - -// parseOnlyInMessage checks if line is a "Only in {source}: {filename}" and returns source and filename -func parseOnlyInMessage(line []byte) (bool, []byte, []byte) { - if !bytes.HasPrefix(line, onlyInMessagePrefix) { - return false, nil, nil - } - line = line[len(onlyInMessagePrefix):] - idx := bytes.Index(line, []byte(": ")) - if idx < 0 { - return false, nil, nil - } - return true, line[:idx], line[idx+2:] -} - -// A ParseError is a description of a unified diff syntax error. -type ParseError struct { - Line int // Line where the error occurred - Offset int64 // Offset where the error occurred - Err error // The actual error -} - -func (e *ParseError) Error() string { - return fmt.Sprintf("line %d, char %d: %s", e.Line, e.Offset, e.Err) -} - -// ErrNoHunkHeader indicates that a unified diff hunk header was -// expected but not found during parsing. -var ErrNoHunkHeader = errors.New("no hunk header") - -// ErrBadHunkHeader indicates that a malformed unified diff hunk -// header was encountered during parsing. -type ErrBadHunkHeader struct { - header string -} - -func (e *ErrBadHunkHeader) Error() string { - if e.header == "" { - return "bad hunk header" - } - return "bad hunk header: " + e.header -} - -// ErrBadHunkLine is when a line not beginning with ' ', '-', '+', or -// '\' is encountered while reading a hunk. In the context of reading -// a single hunk or file, it is an unexpected error. In a multi-file -// diff, however, it indicates that the current file's diff is -// complete (and remaining diff data will describe another file -// unified diff). -type ErrBadHunkLine struct { - Line []byte -} - -func (e *ErrBadHunkLine) Error() string { - m := "bad hunk line (does not start with ' ', '-', '+', or '\\')" - if len(e.Line) == 0 { - return m - } - return m + ": " + string(e.Line) -} diff --git a/vendor/github.com/sourcegraph/go-diff/diff/print.go b/vendor/github.com/sourcegraph/go-diff/diff/print.go deleted file mode 100644 index 012651a33b..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/diff/print.go +++ /dev/null @@ -1,141 +0,0 @@ -package diff - -import ( - "bytes" - "fmt" - "io" - "path/filepath" - "time" -) - -// PrintMultiFileDiff prints a multi-file diff in unified diff format. -func PrintMultiFileDiff(ds []*FileDiff) ([]byte, error) { - var buf bytes.Buffer - for _, d := range ds { - diff, err := PrintFileDiff(d) - if err != nil { - return nil, err - } - if _, err := buf.Write(diff); err != nil { - return nil, err - } - } - return buf.Bytes(), nil -} - -// PrintFileDiff prints a FileDiff in unified diff format. -// -// TODO(sqs): handle escaping whitespace/etc. chars in filenames -func PrintFileDiff(d *FileDiff) ([]byte, error) { - var buf bytes.Buffer - - for _, xheader := range d.Extended { - if _, err := fmt.Fprintln(&buf, xheader); err != nil { - return nil, err - } - } - - // FileDiff is added/deleted file - // No further hunks printing needed - if d.NewName == "" { - _, err := fmt.Fprintf(&buf, onlyInMessage, filepath.Dir(d.OrigName), filepath.Base(d.OrigName)) - if err != nil { - return nil, err - } - return buf.Bytes(), nil - } - - if d.Hunks == nil { - return buf.Bytes(), nil - } - - if err := printFileHeader(&buf, "--- ", d.OrigName, d.OrigTime); err != nil { - return nil, err - } - if err := printFileHeader(&buf, "+++ ", d.NewName, d.NewTime); err != nil { - return nil, err - } - - ph, err := PrintHunks(d.Hunks) - if err != nil { - return nil, err - } - - if _, err := buf.Write(ph); err != nil { - return nil, err - } - return buf.Bytes(), nil -} - -func printFileHeader(w io.Writer, prefix string, filename string, timestamp *time.Time) error { - if _, err := fmt.Fprint(w, prefix, filename); err != nil { - return err - } - if timestamp != nil { - if _, err := fmt.Fprint(w, "\t", timestamp.Format(diffTimeFormatLayout)); err != nil { - return err - } - } - if _, err := fmt.Fprintln(w); err != nil { - return err - } - return nil -} - -// PrintHunks prints diff hunks in unified diff format. -func PrintHunks(hunks []*Hunk) ([]byte, error) { - var buf bytes.Buffer - for _, hunk := range hunks { - _, err := fmt.Fprintf(&buf, - "@@ -%d,%d +%d,%d @@", hunk.OrigStartLine, hunk.OrigLines, hunk.NewStartLine, hunk.NewLines, - ) - if err != nil { - return nil, err - } - if hunk.Section != "" { - _, err := fmt.Fprint(&buf, " ", hunk.Section) - if err != nil { - return nil, err - } - } - if _, err := fmt.Fprintln(&buf); err != nil { - return nil, err - } - - if hunk.OrigNoNewlineAt == 0 { - if _, err := buf.Write(hunk.Body); err != nil { - return nil, err - } - } else { - if _, err := buf.Write(hunk.Body[:hunk.OrigNoNewlineAt]); err != nil { - return nil, err - } - if err := printNoNewlineMessage(&buf); err != nil { - return nil, err - } - if _, err := buf.Write(hunk.Body[hunk.OrigNoNewlineAt:]); err != nil { - return nil, err - } - } - - if !bytes.HasSuffix(hunk.Body, []byte{'\n'}) { - if _, err := fmt.Fprintln(&buf); err != nil { - return nil, err - } - if err := printNoNewlineMessage(&buf); err != nil { - return nil, err - } - } - } - return buf.Bytes(), nil -} - -func printNoNewlineMessage(w io.Writer) error { - if _, err := w.Write([]byte(noNewlineMessage)); err != nil { - return err - } - if _, err := fmt.Fprintln(w); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/sourcegraph/go-diff/diff/reader_util.go b/vendor/github.com/sourcegraph/go-diff/diff/reader_util.go deleted file mode 100644 index 45300252b7..0000000000 --- a/vendor/github.com/sourcegraph/go-diff/diff/reader_util.go +++ /dev/null @@ -1,120 +0,0 @@ -package diff - -import ( - "bufio" - "bytes" - "errors" - "io" -) - -var ErrLineReaderUninitialized = errors.New("line reader not initialized") - -func newLineReader(r io.Reader) *lineReader { - return &lineReader{reader: bufio.NewReader(r)} -} - -// lineReader is a wrapper around a bufio.Reader that caches the next line to -// provide lookahead functionality for the next two lines. -type lineReader struct { - reader *bufio.Reader - - cachedNextLine []byte - cachedNextLineErr error -} - -// readLine returns the next unconsumed line and advances the internal cache of -// the lineReader. -func (l *lineReader) readLine() ([]byte, error) { - if l.cachedNextLine == nil && l.cachedNextLineErr == nil { - l.cachedNextLine, l.cachedNextLineErr = readLine(l.reader) - } - - if l.cachedNextLineErr != nil { - return nil, l.cachedNextLineErr - } - - next := l.cachedNextLine - - l.cachedNextLine, l.cachedNextLineErr = readLine(l.reader) - - return next, nil -} - -// nextLineStartsWith looks at the line that would be returned by the next call -// to readLine to check whether it has the given prefix. -// -// io.EOF and bufio.ErrBufferFull errors are ignored so that the function can -// be used when at the end of the file. -func (l *lineReader) nextLineStartsWith(prefix string) (bool, error) { - if l.cachedNextLine == nil && l.cachedNextLineErr == nil { - l.cachedNextLine, l.cachedNextLineErr = readLine(l.reader) - } - - return l.lineHasPrefix(l.cachedNextLine, prefix, l.cachedNextLineErr) -} - -// nextNextLineStartsWith checks the prefix of the line *after* the line that -// would be returned by the next readLine. -// -// io.EOF and bufio.ErrBufferFull errors are ignored so that the function can -// be used when at the end of the file. -// -// The lineReader MUST be initialized by calling readLine at least once before -// calling nextLineStartsWith. Otherwise ErrLineReaderUninitialized will be -// returned. -func (l *lineReader) nextNextLineStartsWith(prefix string) (bool, error) { - if l.cachedNextLine == nil && l.cachedNextLineErr == nil { - l.cachedNextLine, l.cachedNextLineErr = readLine(l.reader) - } - - next, err := l.reader.Peek(len(prefix)) - return l.lineHasPrefix(next, prefix, err) -} - -// lineHasPrefix checks whether the given line has the given prefix with -// bytes.HasPrefix. -// -// The readErr should be the error that was returned when the line was read. -// lineHasPrefix checks the error to adjust its return value to, e.g., return -// false and ignore the error when readErr is io.EOF. -func (l *lineReader) lineHasPrefix(line []byte, prefix string, readErr error) (bool, error) { - if readErr != nil { - if readErr == io.EOF || readErr == bufio.ErrBufferFull { - return false, nil - } - return false, readErr - } - - return bytes.HasPrefix(line, []byte(prefix)), nil -} - -// readLine is a helper that mimics the functionality of calling bufio.Scanner.Scan() and -// bufio.Scanner.Bytes(), but without the token size limitation. It will read and return -// the next line in the Reader with the trailing newline stripped. It will return an -// io.EOF error when there is nothing left to read (at the start of the function call). It -// will return any other errors it receives from the underlying call to ReadBytes. -func readLine(r *bufio.Reader) ([]byte, error) { - line_, err := r.ReadBytes('\n') - if err == io.EOF { - if len(line_) == 0 { - return nil, io.EOF - } - - // ReadBytes returned io.EOF, because it didn't find another newline, but there is - // still the remainder of the file to return as a line. - line := line_ - return line, nil - } else if err != nil { - return nil, err - } - line := line_[0 : len(line_)-1] - return dropCR(line), nil -} - -// dropCR drops a terminal \r from the data. -func dropCR(data []byte) []byte { - if len(data) > 0 && data[len(data)-1] == '\r' { - return data[0 : len(data)-1] - } - return data -} diff --git a/vendor/github.com/spf13/cobra/doc/man_docs.go b/vendor/github.com/spf13/cobra/doc/man_docs.go deleted file mode 100644 index b8c15ce885..0000000000 --- a/vendor/github.com/spf13/cobra/doc/man_docs.go +++ /dev/null @@ -1,246 +0,0 @@ -// Copyright 2013-2023 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strconv" - "strings" - "time" - - "github.com/cpuguy83/go-md2man/v2/md2man" - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -// GenManTree will generate a man page for this command and all descendants -// in the directory given. The header may be nil. This function may not work -// correctly if your command names have `-` in them. If you have `cmd` with two -// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` -// it is undefined which help output will be in the file `cmd-sub-third.1`. -func GenManTree(cmd *cobra.Command, header *GenManHeader, dir string) error { - return GenManTreeFromOpts(cmd, GenManTreeOptions{ - Header: header, - Path: dir, - CommandSeparator: "-", - }) -} - -// GenManTreeFromOpts generates a man page for the command and all descendants. -// The pages are written to the opts.Path directory. -func GenManTreeFromOpts(cmd *cobra.Command, opts GenManTreeOptions) error { - header := opts.Header - if header == nil { - header = &GenManHeader{} - } - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenManTreeFromOpts(c, opts); err != nil { - return err - } - } - section := "1" - if header.Section != "" { - section = header.Section - } - - separator := "_" - if opts.CommandSeparator != "" { - separator = opts.CommandSeparator - } - basename := strings.ReplaceAll(cmd.CommandPath(), " ", separator) - filename := filepath.Join(opts.Path, basename+"."+section) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - headerCopy := *header - return GenMan(cmd, &headerCopy, f) -} - -// GenManTreeOptions is the options for generating the man pages. -// Used only in GenManTreeFromOpts. -type GenManTreeOptions struct { - Header *GenManHeader - Path string - CommandSeparator string -} - -// GenManHeader is a lot like the .TH header at the start of man pages. These -// include the title, section, date, source, and manual. We will use the -// current time if Date is unset and will use "Auto generated by spf13/cobra" -// if the Source is unset. -type GenManHeader struct { - Title string - Section string - Date *time.Time - date string - Source string - Manual string -} - -// GenMan will generate a man page for the given command and write it to -// w. The header argument may be nil, however obviously w may not. -func GenMan(cmd *cobra.Command, header *GenManHeader, w io.Writer) error { - if header == nil { - header = &GenManHeader{} - } - if err := fillHeader(header, cmd.CommandPath(), cmd.DisableAutoGenTag); err != nil { - return err - } - - b := genMan(cmd, header) - _, err := w.Write(md2man.Render(b)) - return err -} - -func fillHeader(header *GenManHeader, name string, disableAutoGen bool) error { - if header.Title == "" { - header.Title = strings.ToUpper(strings.ReplaceAll(name, " ", "\\-")) - } - if header.Section == "" { - header.Section = "1" - } - if header.Date == nil { - now := time.Now() - if epoch := os.Getenv("SOURCE_DATE_EPOCH"); epoch != "" { - unixEpoch, err := strconv.ParseInt(epoch, 10, 64) - if err != nil { - return fmt.Errorf("invalid SOURCE_DATE_EPOCH: %v", err) - } - now = time.Unix(unixEpoch, 0) - } - header.Date = &now - } - header.date = (*header.Date).Format("Jan 2006") - if header.Source == "" && !disableAutoGen { - header.Source = "Auto generated by spf13/cobra" - } - return nil -} - -func manPreamble(buf io.StringWriter, header *GenManHeader, cmd *cobra.Command, dashedName string) { - description := cmd.Long - if len(description) == 0 { - description = cmd.Short - } - - cobra.WriteStringAndCheck(buf, fmt.Sprintf(`%% "%s" "%s" "%s" "%s" "%s" -# NAME -`, header.Title, header.Section, header.date, header.Source, header.Manual)) - cobra.WriteStringAndCheck(buf, fmt.Sprintf("%s \\- %s\n\n", dashedName, cmd.Short)) - cobra.WriteStringAndCheck(buf, "# SYNOPSIS\n") - cobra.WriteStringAndCheck(buf, fmt.Sprintf("**%s**\n\n", cmd.UseLine())) - cobra.WriteStringAndCheck(buf, "# DESCRIPTION\n") - cobra.WriteStringAndCheck(buf, description+"\n\n") -} - -func manPrintFlags(buf io.StringWriter, flags *pflag.FlagSet) { - flags.VisitAll(func(flag *pflag.Flag) { - if len(flag.Deprecated) > 0 || flag.Hidden { - return - } - format := "" - if len(flag.Shorthand) > 0 && len(flag.ShorthandDeprecated) == 0 { - format = fmt.Sprintf("**-%s**, **--%s**", flag.Shorthand, flag.Name) - } else { - format = fmt.Sprintf("**--%s**", flag.Name) - } - if len(flag.NoOptDefVal) > 0 { - format += "[" - } - if flag.Value.Type() == "string" { - // put quotes on the value - format += "=%q" - } else { - format += "=%s" - } - if len(flag.NoOptDefVal) > 0 { - format += "]" - } - format += "\n\t%s\n\n" - cobra.WriteStringAndCheck(buf, fmt.Sprintf(format, flag.DefValue, flag.Usage)) - }) -} - -func manPrintOptions(buf io.StringWriter, command *cobra.Command) { - flags := command.NonInheritedFlags() - if flags.HasAvailableFlags() { - cobra.WriteStringAndCheck(buf, "# OPTIONS\n") - manPrintFlags(buf, flags) - cobra.WriteStringAndCheck(buf, "\n") - } - flags = command.InheritedFlags() - if flags.HasAvailableFlags() { - cobra.WriteStringAndCheck(buf, "# OPTIONS INHERITED FROM PARENT COMMANDS\n") - manPrintFlags(buf, flags) - cobra.WriteStringAndCheck(buf, "\n") - } -} - -func genMan(cmd *cobra.Command, header *GenManHeader) []byte { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - // something like `rootcmd-subcmd1-subcmd2` - dashCommandName := strings.ReplaceAll(cmd.CommandPath(), " ", "-") - - buf := new(bytes.Buffer) - - manPreamble(buf, header, cmd, dashCommandName) - manPrintOptions(buf, cmd) - if len(cmd.Example) > 0 { - buf.WriteString("# EXAMPLE\n") - buf.WriteString(fmt.Sprintf("```\n%s\n```\n", cmd.Example)) - } - if hasSeeAlso(cmd) { - buf.WriteString("# SEE ALSO\n") - seealsos := make([]string, 0) - if cmd.HasParent() { - parentPath := cmd.Parent().CommandPath() - dashParentPath := strings.ReplaceAll(parentPath, " ", "-") - seealso := fmt.Sprintf("**%s(%s)**", dashParentPath, header.Section) - seealsos = append(seealsos, seealso) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - children := cmd.Commands() - sort.Sort(byName(children)) - for _, c := range children { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - seealso := fmt.Sprintf("**%s-%s(%s)**", dashCommandName, c.Name(), header.Section) - seealsos = append(seealsos, seealso) - } - buf.WriteString(strings.Join(seealsos, ", ") + "\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString(fmt.Sprintf("# HISTORY\n%s Auto generated by spf13/cobra\n", header.Date.Format("2-Jan-2006"))) - } - return buf.Bytes() -} diff --git a/vendor/github.com/spf13/cobra/doc/md_docs.go b/vendor/github.com/spf13/cobra/doc/md_docs.go deleted file mode 100644 index f98fe2a3b8..0000000000 --- a/vendor/github.com/spf13/cobra/doc/md_docs.go +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2013-2023 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/spf13/cobra" -) - -const markdownExtension = ".md" - -func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error { - flags := cmd.NonInheritedFlags() - flags.SetOutput(buf) - if flags.HasAvailableFlags() { - buf.WriteString("### Options\n\n```\n") - flags.PrintDefaults() - buf.WriteString("```\n\n") - } - - parentFlags := cmd.InheritedFlags() - parentFlags.SetOutput(buf) - if parentFlags.HasAvailableFlags() { - buf.WriteString("### Options inherited from parent commands\n\n```\n") - parentFlags.PrintDefaults() - buf.WriteString("```\n\n") - } - return nil -} - -// GenMarkdown creates markdown output. -func GenMarkdown(cmd *cobra.Command, w io.Writer) error { - return GenMarkdownCustom(cmd, w, func(s string) string { return s }) -} - -// GenMarkdownCustom creates custom markdown output. -func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - buf := new(bytes.Buffer) - name := cmd.CommandPath() - - buf.WriteString("## " + name + "\n\n") - buf.WriteString(cmd.Short + "\n\n") - if len(cmd.Long) > 0 { - buf.WriteString("### Synopsis\n\n") - buf.WriteString(cmd.Long + "\n\n") - } - - if cmd.Runnable() { - buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.UseLine())) - } - - if len(cmd.Example) > 0 { - buf.WriteString("### Examples\n\n") - buf.WriteString(fmt.Sprintf("```\n%s\n```\n\n", cmd.Example)) - } - - if err := printOptions(buf, cmd, name); err != nil { - return err - } - if hasSeeAlso(cmd) { - buf.WriteString("### SEE ALSO\n\n") - if cmd.HasParent() { - parent := cmd.Parent() - pname := parent.CommandPath() - link := pname + markdownExtension - link = strings.ReplaceAll(link, " ", "_") - buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", pname, linkHandler(link), parent.Short)) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - - children := cmd.Commands() - sort.Sort(byName(children)) - - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - cname := name + " " + child.Name() - link := cname + markdownExtension - link = strings.ReplaceAll(link, " ", "_") - buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", cname, linkHandler(link), child.Short)) - } - buf.WriteString("\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString("###### Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "\n") - } - _, err := buf.WriteTo(w) - return err -} - -// GenMarkdownTree will generate a markdown page for this command and all -// descendants in the directory given. The header may be nil. -// This function may not work correctly if your command names have `-` in them. -// If you have `cmd` with two subcmds, `sub` and `sub-third`, -// and `sub` has a subcommand called `third`, it is undefined which -// help output will be in the file `cmd-sub-third.1`. -func GenMarkdownTree(cmd *cobra.Command, dir string) error { - identity := func(s string) string { return s } - emptyStr := func(s string) string { return "" } - return GenMarkdownTreeCustom(cmd, dir, emptyStr, identity) -} - -// GenMarkdownTreeCustom is the the same as GenMarkdownTree, but -// with custom filePrepender and linkHandler. -func GenMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenMarkdownTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + markdownExtension - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenMarkdownCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/spf13/cobra/doc/rest_docs.go b/vendor/github.com/spf13/cobra/doc/rest_docs.go deleted file mode 100644 index 2cca6fd778..0000000000 --- a/vendor/github.com/spf13/cobra/doc/rest_docs.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2013-2023 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - "time" - - "github.com/spf13/cobra" -) - -func printOptionsReST(buf *bytes.Buffer, cmd *cobra.Command, name string) error { - flags := cmd.NonInheritedFlags() - flags.SetOutput(buf) - if flags.HasAvailableFlags() { - buf.WriteString("Options\n") - buf.WriteString("~~~~~~~\n\n::\n\n") - flags.PrintDefaults() - buf.WriteString("\n") - } - - parentFlags := cmd.InheritedFlags() - parentFlags.SetOutput(buf) - if parentFlags.HasAvailableFlags() { - buf.WriteString("Options inherited from parent commands\n") - buf.WriteString("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n::\n\n") - parentFlags.PrintDefaults() - buf.WriteString("\n") - } - return nil -} - -// defaultLinkHandler for default ReST hyperlink markup -func defaultLinkHandler(name, ref string) string { - return fmt.Sprintf("`%s <%s.rst>`_", name, ref) -} - -// GenReST creates reStructured Text output. -func GenReST(cmd *cobra.Command, w io.Writer) error { - return GenReSTCustom(cmd, w, defaultLinkHandler) -} - -// GenReSTCustom creates custom reStructured Text output. -func GenReSTCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string, string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - buf := new(bytes.Buffer) - name := cmd.CommandPath() - - short := cmd.Short - long := cmd.Long - if len(long) == 0 { - long = short - } - ref := strings.ReplaceAll(name, " ", "_") - - buf.WriteString(".. _" + ref + ":\n\n") - buf.WriteString(name + "\n") - buf.WriteString(strings.Repeat("-", len(name)) + "\n\n") - buf.WriteString(short + "\n\n") - buf.WriteString("Synopsis\n") - buf.WriteString("~~~~~~~~\n\n") - buf.WriteString("\n" + long + "\n\n") - - if cmd.Runnable() { - buf.WriteString(fmt.Sprintf("::\n\n %s\n\n", cmd.UseLine())) - } - - if len(cmd.Example) > 0 { - buf.WriteString("Examples\n") - buf.WriteString("~~~~~~~~\n\n") - buf.WriteString(fmt.Sprintf("::\n\n%s\n\n", indentString(cmd.Example, " "))) - } - - if err := printOptionsReST(buf, cmd, name); err != nil { - return err - } - if hasSeeAlso(cmd) { - buf.WriteString("SEE ALSO\n") - buf.WriteString("~~~~~~~~\n\n") - if cmd.HasParent() { - parent := cmd.Parent() - pname := parent.CommandPath() - ref = strings.ReplaceAll(pname, " ", "_") - buf.WriteString(fmt.Sprintf("* %s \t - %s\n", linkHandler(pname, ref), parent.Short)) - cmd.VisitParents(func(c *cobra.Command) { - if c.DisableAutoGenTag { - cmd.DisableAutoGenTag = c.DisableAutoGenTag - } - }) - } - - children := cmd.Commands() - sort.Sort(byName(children)) - - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - cname := name + " " + child.Name() - ref = strings.ReplaceAll(cname, " ", "_") - buf.WriteString(fmt.Sprintf("* %s \t - %s\n", linkHandler(cname, ref), child.Short)) - } - buf.WriteString("\n") - } - if !cmd.DisableAutoGenTag { - buf.WriteString("*Auto generated by spf13/cobra on " + time.Now().Format("2-Jan-2006") + "*\n") - } - _, err := buf.WriteTo(w) - return err -} - -// GenReSTTree will generate a ReST page for this command and all -// descendants in the directory given. -// This function may not work correctly if your command names have `-` in them. -// If you have `cmd` with two subcmds, `sub` and `sub-third`, -// and `sub` has a subcommand called `third`, it is undefined which -// help output will be in the file `cmd-sub-third.1`. -func GenReSTTree(cmd *cobra.Command, dir string) error { - emptyStr := func(s string) string { return "" } - return GenReSTTreeCustom(cmd, dir, emptyStr, defaultLinkHandler) -} - -// GenReSTTreeCustom is the the same as GenReSTTree, but -// with custom filePrepender and linkHandler. -func GenReSTTreeCustom(cmd *cobra.Command, dir string, filePrepender func(string) string, linkHandler func(string, string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenReSTTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".rst" - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenReSTCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} - -// indentString adapted from: https://github.com/kr/text/blob/main/indent.go -func indentString(s, p string) string { - var res []byte - b := []byte(s) - prefix := []byte(p) - bol := true - for _, c := range b { - if bol && c != '\n' { - res = append(res, prefix...) - } - res = append(res, c) - bol = c == '\n' - } - return string(res) -} diff --git a/vendor/github.com/spf13/cobra/doc/util.go b/vendor/github.com/spf13/cobra/doc/util.go deleted file mode 100644 index 0aaa07a166..0000000000 --- a/vendor/github.com/spf13/cobra/doc/util.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2013-2023 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "strings" - - "github.com/spf13/cobra" -) - -// Test to see if we have a reason to print See Also information in docs -// Basically this is a test for a parent command or a subcommand which is -// both not deprecated and not the autogenerated help command. -func hasSeeAlso(cmd *cobra.Command) bool { - if cmd.HasParent() { - return true - } - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - return true - } - return false -} - -// Temporary workaround for yaml lib generating incorrect yaml with long strings -// that do not contain \n. -func forceMultiLine(s string) string { - if len(s) > 60 && !strings.Contains(s, "\n") { - s = s + "\n" - } - return s -} - -type byName []*cobra.Command - -func (s byName) Len() int { return len(s) } -func (s byName) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byName) Less(i, j int) bool { return s[i].Name() < s[j].Name() } diff --git a/vendor/github.com/spf13/cobra/doc/yaml_docs.go b/vendor/github.com/spf13/cobra/doc/yaml_docs.go deleted file mode 100644 index 2b26d6ec0f..0000000000 --- a/vendor/github.com/spf13/cobra/doc/yaml_docs.go +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright 2013-2023 The Cobra Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package doc - -import ( - "fmt" - "io" - "os" - "path/filepath" - "sort" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "gopkg.in/yaml.v3" -) - -type cmdOption struct { - Name string - Shorthand string `yaml:",omitempty"` - DefaultValue string `yaml:"default_value,omitempty"` - Usage string `yaml:",omitempty"` -} - -type cmdDoc struct { - Name string - Synopsis string `yaml:",omitempty"` - Description string `yaml:",omitempty"` - Usage string `yaml:",omitempty"` - Options []cmdOption `yaml:",omitempty"` - InheritedOptions []cmdOption `yaml:"inherited_options,omitempty"` - Example string `yaml:",omitempty"` - SeeAlso []string `yaml:"see_also,omitempty"` -} - -// GenYamlTree creates yaml structured ref files for this command and all descendants -// in the directory given. This function may not work -// correctly if your command names have `-` in them. If you have `cmd` with two -// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third` -// it is undefined which help output will be in the file `cmd-sub-third.1`. -func GenYamlTree(cmd *cobra.Command, dir string) error { - identity := func(s string) string { return s } - emptyStr := func(s string) string { return "" } - return GenYamlTreeCustom(cmd, dir, emptyStr, identity) -} - -// GenYamlTreeCustom creates yaml structured ref files. -func GenYamlTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHandler func(string) string) error { - for _, c := range cmd.Commands() { - if !c.IsAvailableCommand() || c.IsAdditionalHelpTopicCommand() { - continue - } - if err := GenYamlTreeCustom(c, dir, filePrepender, linkHandler); err != nil { - return err - } - } - - basename := strings.ReplaceAll(cmd.CommandPath(), " ", "_") + ".yaml" - filename := filepath.Join(dir, basename) - f, err := os.Create(filename) - if err != nil { - return err - } - defer f.Close() - - if _, err := io.WriteString(f, filePrepender(filename)); err != nil { - return err - } - if err := GenYamlCustom(cmd, f, linkHandler); err != nil { - return err - } - return nil -} - -// GenYaml creates yaml output. -func GenYaml(cmd *cobra.Command, w io.Writer) error { - return GenYamlCustom(cmd, w, func(s string) string { return s }) -} - -// GenYamlCustom creates custom yaml output. -func GenYamlCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string) string) error { - cmd.InitDefaultHelpCmd() - cmd.InitDefaultHelpFlag() - - yamlDoc := cmdDoc{} - yamlDoc.Name = cmd.CommandPath() - - yamlDoc.Synopsis = forceMultiLine(cmd.Short) - yamlDoc.Description = forceMultiLine(cmd.Long) - - if cmd.Runnable() { - yamlDoc.Usage = cmd.UseLine() - } - - if len(cmd.Example) > 0 { - yamlDoc.Example = cmd.Example - } - - flags := cmd.NonInheritedFlags() - if flags.HasFlags() { - yamlDoc.Options = genFlagResult(flags) - } - flags = cmd.InheritedFlags() - if flags.HasFlags() { - yamlDoc.InheritedOptions = genFlagResult(flags) - } - - if hasSeeAlso(cmd) { - result := []string{} - if cmd.HasParent() { - parent := cmd.Parent() - result = append(result, parent.CommandPath()+" - "+parent.Short) - } - children := cmd.Commands() - sort.Sort(byName(children)) - for _, child := range children { - if !child.IsAvailableCommand() || child.IsAdditionalHelpTopicCommand() { - continue - } - result = append(result, child.CommandPath()+" - "+child.Short) - } - yamlDoc.SeeAlso = result - } - - final, err := yaml.Marshal(&yamlDoc) - if err != nil { - fmt.Println(err) - os.Exit(1) - } - - if _, err := w.Write(final); err != nil { - return err - } - return nil -} - -func genFlagResult(flags *pflag.FlagSet) []cmdOption { - var result []cmdOption - - flags.VisitAll(func(flag *pflag.Flag) { - // Todo, when we mark a shorthand is deprecated, but specify an empty message. - // The flag.ShorthandDeprecated is empty as the shorthand is deprecated. - // Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok. - if !(len(flag.ShorthandDeprecated) > 0) && len(flag.Shorthand) > 0 { - opt := cmdOption{ - flag.Name, - flag.Shorthand, - flag.DefValue, - forceMultiLine(flag.Usage), - } - result = append(result, opt) - } else { - opt := cmdOption{ - Name: flag.Name, - DefaultValue: forceMultiLine(flag.DefValue), - Usage: forceMultiLine(flag.Usage), - } - result = append(result, opt) - } - }) - - return result -} diff --git a/vendor/github.com/ssgreg/nlreturn/v2/LICENSE b/vendor/github.com/ssgreg/nlreturn/v2/LICENSE deleted file mode 100644 index 0a5b4d106a..0000000000 --- a/vendor/github.com/ssgreg/nlreturn/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Grigory Zubankov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/ssgreg/nlreturn/v2/pkg/nlreturn/nlreturn.go b/vendor/github.com/ssgreg/nlreturn/v2/pkg/nlreturn/nlreturn.go deleted file mode 100644 index 42b15e9b37..0000000000 --- a/vendor/github.com/ssgreg/nlreturn/v2/pkg/nlreturn/nlreturn.go +++ /dev/null @@ -1,95 +0,0 @@ -package nlreturn - -import ( - "flag" - "fmt" - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" -) - -const ( - linterName = "nlreturn" - linterDoc = `Linter requires a new line before return and branch statements except when the return is alone inside a statement group (such as an if statement) to increase code clarity.` -) - -var blockSize int - -// NewAnalyzer returns a new nlreturn analyzer. -func NewAnalyzer() *analysis.Analyzer { - a := &analysis.Analyzer{ - Name: linterName, - Doc: linterDoc, - Run: run, - } - - a.Flags.Init("nlreturn", flag.ExitOnError) - a.Flags.IntVar(&blockSize, "block-size", 1, "set block size that is still ok") - - return a -} - -func run(pass *analysis.Pass) (interface{}, error) { - for _, f := range pass.Files { - ast.Inspect(f, func(node ast.Node) bool { - switch c := node.(type) { - case *ast.CaseClause: - inspectBlock(pass, c.Body) - case *ast.CommClause: - inspectBlock(pass, c.Body) - case *ast.BlockStmt: - inspectBlock(pass, c.List) - } - - return true - }) - } - - return nil, nil -} - -func inspectBlock(pass *analysis.Pass, block []ast.Stmt) { - for i, stmt := range block { - switch stmt.(type) { - case *ast.BranchStmt, *ast.ReturnStmt: - - if i == 0 || line(pass, stmt.Pos())-line(pass, block[0].Pos()) < blockSize { - return - } - - if line(pass, stmt.Pos())-line(pass, block[i-1].End()) <= 1 { - pass.Report(analysis.Diagnostic{ - Pos: stmt.Pos(), - Message: fmt.Sprintf("%s with no blank line before", name(stmt)), - SuggestedFixes: []analysis.SuggestedFix{ - { - TextEdits: []analysis.TextEdit{ - { - Pos: stmt.Pos(), - NewText: []byte("\n"), - End: stmt.Pos(), - }, - }, - }, - }, - }) - } - } - } -} - -func name(stmt ast.Stmt) string { - switch c := stmt.(type) { - case *ast.BranchStmt: - return c.Tok.String() - case *ast.ReturnStmt: - return "return" - default: - return "unknown" - } -} - -func line(pass *analysis.Pass, pos token.Pos) int { - return pass.Fset.Position(pos).Line -} diff --git a/vendor/github.com/stbenjam/no-sprintf-host-port/LICENSE b/vendor/github.com/stbenjam/no-sprintf-host-port/LICENSE deleted file mode 100644 index 586dfd8cce..0000000000 --- a/vendor/github.com/stbenjam/no-sprintf-host-port/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Stephen Benjamin - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/stbenjam/no-sprintf-host-port/pkg/analyzer/analyzer.go b/vendor/github.com/stbenjam/no-sprintf-host-port/pkg/analyzer/analyzer.go deleted file mode 100644 index 374bb0d242..0000000000 --- a/vendor/github.com/stbenjam/no-sprintf-host-port/pkg/analyzer/analyzer.go +++ /dev/null @@ -1,96 +0,0 @@ -package analyzer - -import ( - "fmt" - "go/ast" - "go/token" - "regexp" - - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "golang.org/x/tools/go/analysis" -) - -var Analyzer = &analysis.Analyzer{ - Name: "nosprintfhostport", - Doc: "Checks for misuse of Sprintf to construct a host with port in a URL.", - Run: run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspector := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CallExpr)(nil), - } - - inspector.Preorder(nodeFilter, func(node ast.Node) { - callExpr := node.(*ast.CallExpr) - if p, f, ok := getCallExprFunction(callExpr); ok && p == "fmt" && f == "Sprintf" { - if err := checkForHostPortConstruction(callExpr); err != nil { - pass.Reportf(node.Pos(), err.Error()) - } - } - }) - - return nil, nil -} - -// getCallExprFunction returns the package and function name from a callExpr, if any. -func getCallExprFunction(callExpr *ast.CallExpr) (pkg string, fn string, result bool) { - selector, ok := callExpr.Fun.(*ast.SelectorExpr) - if !ok { - return "", "", false - } - gopkg, ok := selector.X.(*ast.Ident) - if !ok { - return "", "", false - } - return gopkg.Name, selector.Sel.Name, true -} - -// getStringLiteral returns the value at a position if it's a string literal. -func getStringLiteral(args []ast.Expr, pos int) (string, bool) { - if len(args) < pos + 1 { - return "", false - } - - // Let's see if our format string is a string literal. - fsRaw, ok := args[pos].(*ast.BasicLit) - if !ok { - return "", false - } - if fsRaw.Kind == token.STRING && len(fsRaw.Value) >= 2 { - return fsRaw.Value[1 : len(fsRaw.Value)-1], true - } else { - return "", false - } -} - -// checkForHostPortConstruction checks to see if a sprintf call looks like a URI with a port, -// essentially scheme://%s:, or scheme://user:pass@%s:. -// -// Matching requirements: -// - Scheme as per RFC3986 is ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) -// - A format string substitution in the host portion, preceded by an optional username/password@ -// - A colon indicating a port will be specified -func checkForHostPortConstruction(sprintf *ast.CallExpr) error { - fs, ok := getStringLiteral(sprintf.Args, 0) - if !ok { - return nil - } - - regexes := []*regexp.Regexp{ - regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9+-.]*://%s:[^@]*$`), // URL without basic auth user - regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9+-.]*://[^/]*@%s:.*$`), // URL with basic auth - } - - for _, re := range regexes { - if re.MatchString(fs) { - return fmt.Errorf("host:port in url should be constructed with net.JoinHostPort and not directly with fmt.Sprintf") - } - } - - return nil -} \ No newline at end of file diff --git a/vendor/github.com/t-yuki/gocover-cobertura/.travis.yml b/vendor/github.com/t-yuki/gocover-cobertura/.travis.yml deleted file mode 100644 index f17bb61693..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -go: - - 1.6 - - 1.7 - - 1.8 - - tip - -sudo: false -before_install: - - go get github.com/mattn/goveralls -script: - - $GOPATH/bin/goveralls -service=travis-ci diff --git a/vendor/github.com/t-yuki/gocover-cobertura/LICENSE b/vendor/github.com/t-yuki/gocover-cobertura/LICENSE deleted file mode 100644 index 7ec1b3d853..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Yukinari Toyota - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/t-yuki/gocover-cobertura/README.md b/vendor/github.com/t-yuki/gocover-cobertura/README.md deleted file mode 100644 index 60ab1dbe72..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/README.md +++ /dev/null @@ -1,35 +0,0 @@ -[![Build Status](https://travis-ci.org/t-yuki/gocover-cobertura.svg?branch=master)](https://travis-ci.org/t-yuki/gocover-cobertura) -[![Coverage Status](https://coveralls.io/repos/github/t-yuki/gocover-cobertura/badge.svg?branch=master)](https://coveralls.io/github/t-yuki/gocover-cobertura?branch=master) - -go tool cover XML (Cobertura) export -==================================== - -This is a simple helper tool for generating XML output in [Cobertura](http://cobertura.sourceforge.net/) format -for CIs like [Jenkins](https://wiki.jenkins-ci.org/display/JENKINS/Cobertura+Plugin) and others -from [go tool cover](https://code.google.com/p/go.tools/) output. - -Installation ------------- - -Just type the following to install the program and its dependencies: - - $ go get code.google.com/p/go.tools/cmd/cover - $ go get github.com/t-yuki/gocover-cobertura - -Usage ------ - -`gocover-cobertura` reads from the standard input: - - $ go test -coverprofile=coverage.txt -covermode count github.com/gorilla/mux - $ gocover-cobertura < coverage.txt > coverage.xml - -Authors -------- - -* [Yukinari Toyota (t-yuki)](https://github.com/t-yuki) - -Thanks ------- - -This tool is originated from [gocov-xml](https://github.com/AlekSi/gocov-xml) by [Alexey Palazhchenko (AlekSi)](https://github.com/AlekSi) diff --git a/vendor/github.com/t-yuki/gocover-cobertura/cobertura.go b/vendor/github.com/t-yuki/gocover-cobertura/cobertura.go deleted file mode 100644 index 8556dc5636..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/cobertura.go +++ /dev/null @@ -1,178 +0,0 @@ -package main - -import ( - "encoding/xml" -) - -type Coverage struct { - XMLName xml.Name `xml:"coverage"` - LineRate float32 `xml:"line-rate,attr"` - BranchRate float32 `xml:"branch-rate,attr"` - Version string `xml:"version,attr"` - Timestamp int64 `xml:"timestamp,attr"` - LinesCovered int64 `xml:"lines-covered,attr"` - LinesValid int64 `xml:"lines-valid,attr"` - BranchesCovered int64 `xml:"branches-covered,attr"` - BranchesValid int64 `xml:"branches-valid,attr"` - Complexity float32 `xml:"complexity,attr"` - Sources []*Source `xml:"sources>source"` - Packages []*Package `xml:"packages>package"` -} - -type Source struct { - Path string `xml:",chardata"` -} - -type Package struct { - Name string `xml:"name,attr"` - LineRate float32 `xml:"line-rate,attr"` - BranchRate float32 `xml:"branch-rate,attr"` - Complexity float32 `xml:"complexity,attr"` - Classes []*Class `xml:"classes>class"` -} - -type Class struct { - Name string `xml:"name,attr"` - Filename string `xml:"filename,attr"` - LineRate float32 `xml:"line-rate,attr"` - BranchRate float32 `xml:"branch-rate,attr"` - Complexity float32 `xml:"complexity,attr"` - Methods []*Method `xml:"methods>method"` - Lines Lines `xml:"lines>line"` -} - -type Method struct { - Name string `xml:"name,attr"` - Signature string `xml:"signature,attr"` - LineRate float32 `xml:"line-rate,attr"` - BranchRate float32 `xml:"branch-rate,attr"` - Complexity float32 `xml:"complexity,attr"` - Lines Lines `xml:"lines>line"` -} - -type Line struct { - Number int `xml:"number,attr"` - Hits int64 `xml:"hits,attr"` -} - -// Lines is a slice of Line pointers, with some convenience methods -type Lines []*Line - -// HitRate returns a float32 from 0.0 to 1.0 representing what fraction of lines -// have hits -func (lines Lines) HitRate() (hitRate float32) { - return float32(lines.NumLinesWithHits()) / float32(len(lines)) -} - -// NumLines returns the number of lines -func (lines Lines) NumLines() int64 { - return int64(len(lines)) -} - -// NumLinesWithHits returns the number of lines with a hit count > 0 -func (lines Lines) NumLinesWithHits() (numLinesWithHits int64) { - for _, line := range lines { - if line.Hits > 0 { - numLinesWithHits++ - } - } - return numLinesWithHits -} - -// AddOrUpdateLine adds a line if it is a different line than the last line recorded. -// If it's the same line as the last line recorded then we update the hits down -// if the new hits is less; otherwise just leave it as-is -func (lines *Lines) AddOrUpdateLine(lineNumber int, hits int64) { - if len(*lines) > 0 { - lastLine := (*lines)[len(*lines)-1] - if lineNumber == lastLine.Number { - if hits < lastLine.Hits { - lastLine.Hits = hits - } - return - } - } - *lines = append(*lines, &Line{Number: lineNumber, Hits: hits}) -} - -// HitRate returns a float32 from 0.0 to 1.0 representing what fraction of lines -// have hits -func (method Method) HitRate() float32 { - return method.Lines.HitRate() -} - -// NumLines returns the number of lines -func (method Method) NumLines() int64 { - return method.Lines.NumLines() -} - -// NumLinesWithHits returns the number of lines with a hit count > 0 -func (method Method) NumLinesWithHits() int64 { - return method.Lines.NumLinesWithHits() -} - -// HitRate returns a float32 from 0.0 to 1.0 representing what fraction of lines -// have hits -func (class Class) HitRate() float32 { - return float32(class.NumLinesWithHits()) / float32(class.NumLines()) -} - -// NumLines returns the number of lines -func (class Class) NumLines() (numLines int64) { - for _, method := range class.Methods { - numLines += method.NumLines() - } - return numLines -} - -// NumLinesWithHits returns the number of lines with a hit count > 0 -func (class Class) NumLinesWithHits() (numLinesWithHits int64) { - for _, method := range class.Methods { - numLinesWithHits += method.NumLinesWithHits() - } - return numLinesWithHits -} - -// HitRate returns a float32 from 0.0 to 1.0 representing what fraction of lines -// have hits -func (pkg Package) HitRate() float32 { - return float32(pkg.NumLinesWithHits()) / float32(pkg.NumLines()) -} - -// NumLines returns the number of lines -func (pkg Package) NumLines() (numLines int64) { - for _, class := range pkg.Classes { - numLines += class.NumLines() - } - return numLines -} - -// NumLinesWithHits returns the number of lines with a hit count > 0 -func (pkg Package) NumLinesWithHits() (numLinesWithHits int64) { - for _, class := range pkg.Classes { - numLinesWithHits += class.NumLinesWithHits() - } - return numLinesWithHits -} - -// HitRate returns a float32 from 0.0 to 1.0 representing what fraction of lines -// have hits -func (cov Coverage) HitRate() float32 { - return float32(cov.NumLinesWithHits()) / float32(cov.NumLines()) -} - -// NumLines returns the number of lines -func (cov Coverage) NumLines() (numLines int64) { - for _, pkg := range cov.Packages { - numLines += pkg.NumLines() - } - return numLines -} - -// NumLinesWithHits returns the number of lines with a hit count > 0 -func (cov Coverage) NumLinesWithHits() (numLinesWithHits int64) { - for _, pkg := range cov.Packages { - numLinesWithHits += pkg.NumLinesWithHits() - } - return numLinesWithHits -} diff --git a/vendor/github.com/t-yuki/gocover-cobertura/gocover-cobertura.go b/vendor/github.com/t-yuki/gocover-cobertura/gocover-cobertura.go deleted file mode 100644 index e64b5de029..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/gocover-cobertura.go +++ /dev/null @@ -1,176 +0,0 @@ -package main - -import ( - "encoding/xml" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/token" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -const coberturaDTDDecl = "\n" - -func main() { - convert(os.Stdin, os.Stdout) -} - -func convert(in io.Reader, out io.Writer) { - profiles, err := ParseProfiles(in) - if err != nil { - panic("Can't parse profiles") - } - - srcDirs := build.Default.SrcDirs() - sources := make([]*Source, len(srcDirs)) - for i, dir := range srcDirs { - sources[i] = &Source{dir} - } - - coverage := Coverage{Sources: sources, Packages: nil, Timestamp: time.Now().UnixNano() / int64(time.Millisecond)} - coverage.parseProfiles(profiles) - - fmt.Fprintf(out, xml.Header) - fmt.Fprintf(out, coberturaDTDDecl) - - encoder := xml.NewEncoder(out) - encoder.Indent("", "\t") - err = encoder.Encode(coverage) - if err != nil { - panic(err) - } - - fmt.Fprintln(out) -} - -func (cov *Coverage) parseProfiles(profiles []*Profile) error { - cov.Packages = []*Package{} - for _, profile := range profiles { - cov.parseProfile(profile) - } - cov.LinesValid = cov.NumLines() - cov.LinesCovered = cov.NumLinesWithHits() - cov.LineRate = cov.HitRate() - return nil -} - -func (cov *Coverage) parseProfile(profile *Profile) error { - fileName := profile.FileName - absFilePath, err := findFile(fileName) - if err != nil { - return err - } - fset := token.NewFileSet() - parsed, err := parser.ParseFile(fset, absFilePath, nil, 0) - if err != nil { - return err - } - data, err := ioutil.ReadFile(absFilePath) - if err != nil { - return err - } - - pkgPath, _ := filepath.Split(fileName) - pkgPath = strings.TrimRight(pkgPath, string(os.PathSeparator)) - - var pkg *Package - for _, p := range cov.Packages { - if p.Name == pkgPath { - pkg = p - } - } - if pkg == nil { - pkg = &Package{Name: pkgPath, Classes: []*Class{}} - cov.Packages = append(cov.Packages, pkg) - } - visitor := &fileVisitor{ - fset: fset, - fileName: fileName, - fileData: data, - classes: make(map[string]*Class), - pkg: pkg, - profile: profile, - } - ast.Walk(visitor, parsed) - pkg.LineRate = pkg.HitRate() - return nil -} - -type fileVisitor struct { - fset *token.FileSet - fileName string - fileData []byte - pkg *Package - classes map[string]*Class - profile *Profile -} - -func (v *fileVisitor) Visit(node ast.Node) ast.Visitor { - switch n := node.(type) { - case *ast.FuncDecl: - class := v.class(n) - method := v.method(n) - method.LineRate = method.Lines.HitRate() - class.Methods = append(class.Methods, method) - for _, line := range method.Lines { - class.Lines = append(class.Lines, line) - } - class.LineRate = class.Lines.HitRate() - } - return v -} - -func (v *fileVisitor) method(n *ast.FuncDecl) *Method { - method := &Method{Name: n.Name.Name} - method.Lines = []*Line{} - - start := v.fset.Position(n.Pos()) - end := v.fset.Position(n.End()) - startLine := start.Line - startCol := start.Column - endLine := end.Line - endCol := end.Column - // The blocks are sorted, so we can stop counting as soon as we reach the end of the relevant block. - for _, b := range v.profile.Blocks { - if b.StartLine > endLine || (b.StartLine == endLine && b.StartCol >= endCol) { - // Past the end of the function. - break - } - if b.EndLine < startLine || (b.EndLine == startLine && b.EndCol <= startCol) { - // Before the beginning of the function - continue - } - for i := b.StartLine; i <= b.EndLine; i++ { - method.Lines.AddOrUpdateLine(i, int64(b.Count)) - } - } - return method -} - -func (v *fileVisitor) class(n *ast.FuncDecl) *Class { - className := v.recvName(n) - var class *Class = v.classes[className] - if class == nil { - class = &Class{Name: className, Filename: v.fileName, Methods: []*Method{}, Lines: []*Line{}} - v.classes[className] = class - v.pkg.Classes = append(v.pkg.Classes, class) - } - return class -} - -func (v *fileVisitor) recvName(n *ast.FuncDecl) string { - if n.Recv == nil { - return "-" - } - recv := n.Recv.List[0].Type - start := v.fset.Position(recv.Pos()) - end := v.fset.Position(recv.End()) - name := string(v.fileData[start.Offset:end.Offset]) - return strings.TrimSpace(strings.TrimLeft(name, "*")) -} diff --git a/vendor/github.com/t-yuki/gocover-cobertura/profile.go b/vendor/github.com/t-yuki/gocover-cobertura/profile.go deleted file mode 100644 index 99cbac234c..0000000000 --- a/vendor/github.com/t-yuki/gocover-cobertura/profile.go +++ /dev/null @@ -1,202 +0,0 @@ -// Imported from https://code.google.com/p/go/source/browse/cmd/cover/profile.go?repo=tools&r=c10a9dd5e0b0a859a8385b6f004584cb083a3934 - -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package main - -import ( - "bufio" - "fmt" - "go/build" - "io" - "math" - "os" - "path/filepath" - "regexp" - "sort" - "strconv" - "strings" -) - -// Profile represents the profiling data for a specific file. -type Profile struct { - FileName string - Mode string - Blocks []ProfileBlock -} - -// ProfileBlock represents a single block of profiling data. -type ProfileBlock struct { - StartLine, StartCol int - EndLine, EndCol int - NumStmt, Count int -} - -type byFileName []*Profile - -func (p byFileName) Len() int { return len(p) } -func (p byFileName) Less(i, j int) bool { return p[i].FileName < p[j].FileName } -func (p byFileName) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// ParseProfiles parses profile data from the given Reader and returns a -// Profile for each file. -func ParseProfiles(in io.Reader) ([]*Profile, error) { - files := make(map[string]*Profile) - // First line is "mode: foo", where foo is "set", "count", or "atomic". - // Rest of file is in the format - // encoding/base64/base64.go:34.44,37.40 3 1 - // where the fields are: name.go:line.column,line.column numberOfStatements count - s := bufio.NewScanner(in) - mode := "" - for s.Scan() { - line := s.Text() - if mode == "" { - const p = "mode: " - if !strings.HasPrefix(line, p) || line == p { - return nil, fmt.Errorf("bad mode line: %v", line) - } - mode = line[len(p):] - continue - } - m := lineRe.FindStringSubmatch(line) - if m == nil { - return nil, fmt.Errorf("line %q doesn't match expected format: %v", m, lineRe) - } - fn := m[1] - p := files[fn] - if p == nil { - p = &Profile{ - FileName: fn, - Mode: mode, - } - files[fn] = p - } - p.Blocks = append(p.Blocks, ProfileBlock{ - StartLine: toInt(m[2]), - StartCol: toInt(m[3]), - EndLine: toInt(m[4]), - EndCol: toInt(m[5]), - NumStmt: toInt(m[6]), - Count: toInt(m[7]), - }) - } - if err := s.Err(); err != nil { - return nil, err - } - for _, p := range files { - sort.Sort(blocksByStart(p.Blocks)) - } - // Generate a sorted slice. - profiles := make([]*Profile, 0, len(files)) - for _, profile := range files { - profiles = append(profiles, profile) - } - sort.Sort(byFileName(profiles)) - return profiles, nil -} - -type blocksByStart []ProfileBlock - -func (b blocksByStart) Len() int { return len(b) } -func (b blocksByStart) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b blocksByStart) Less(i, j int) bool { - bi, bj := b[i], b[j] - return bi.StartLine < bj.StartLine || bi.StartLine == bj.StartLine && bi.StartCol < bj.StartCol -} - -var lineRe = regexp.MustCompile(`^(.+):([0-9]+).([0-9]+),([0-9]+).([0-9]+) ([0-9]+) ([0-9]+)$`) - -func toInt(s string) int { - i, err := strconv.Atoi(s) - if err != nil { - panic(err) - } - return i -} - -// Boundary represents the position in a source file of the beginning or end of a -// block as reported by the coverage profile. In HTML mode, it will correspond to -// the opening or closing of a tag and will be used to colorize the source -type Boundary struct { - Offset int // Location as a byte offset in the source file. - Start bool // Is this the start of a block? - Count int // Event count from the cover profile. - Norm float64 // Count normalized to [0..1]. -} - -// Boundaries returns a Profile as a set of Boundary objects within the provided src. -func (p *Profile) Boundaries(src []byte) (boundaries []Boundary) { - // Find maximum count. - max := 0 - for _, b := range p.Blocks { - if b.Count > max { - max = b.Count - } - } - // Divisor for normalization. - divisor := math.Log(float64(max)) - - // boundary returns a Boundary, populating the Norm field with a normalized Count. - boundary := func(offset int, start bool, count int) Boundary { - b := Boundary{Offset: offset, Start: start, Count: count} - if !start || count == 0 { - return b - } - if max <= 1 { - b.Norm = 0.8 // Profile is in"set" mode; we want a heat map. Use cov8 in the CSS. - } else if count > 0 { - b.Norm = math.Log(float64(count)) / divisor - } - return b - } - - line, col := 1, 2 // TODO: Why is this 2? - for si, bi := 0, 0; si < len(src) && bi < len(p.Blocks); { - b := p.Blocks[bi] - if b.StartLine == line && b.StartCol == col { - boundaries = append(boundaries, boundary(si, true, b.Count)) - } - if b.EndLine == line && b.EndCol == col { - boundaries = append(boundaries, boundary(si, false, 0)) - bi++ - continue // Don't advance through src; maybe the next block starts here. - } - if src[si] == '\n' { - line++ - col = 0 - } - col++ - si++ - } - sort.Sort(boundariesByPos(boundaries)) - return -} - -type boundariesByPos []Boundary - -func (b boundariesByPos) Len() int { return len(b) } -func (b boundariesByPos) Swap(i, j int) { b[i], b[j] = b[j], b[i] } -func (b boundariesByPos) Less(i, j int) bool { - if b[i].Offset == b[j].Offset { - return !b[i].Start && b[j].Start - } - return b[i].Offset < b[j].Offset -} - -// findFile finds the location of the named file in GOROOT, GOPATH etc. -func findFile(file string) (string, error) { - if strings.HasPrefix(file, "_") { - file = file[1:] - } - if _, err := os.Stat(file); err == nil { - return file, nil - } - dir, file := filepath.Split(file) - pkg, err := build.Import(dir, ".", build.FindOnly) - if err != nil { - return "", fmt.Errorf("can't find %q: %v", file, err) - } - return filepath.Join(pkg.Dir, file), nil -} diff --git a/vendor/github.com/tdakkota/asciicheck/.gitignore b/vendor/github.com/tdakkota/asciicheck/.gitignore deleted file mode 100644 index dfa562d3ec..0000000000 --- a/vendor/github.com/tdakkota/asciicheck/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# IntelliJ project files -.idea -*.iml -out -gen - -# Go template -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ -.idea/$CACHE_FILE$ -.idea/$PRODUCT_WORKSPACE_FILE$ -.idea/.gitignore -.idea/codeStyles -.idea/deployment.xml -.idea/inspectionProfiles/ -.idea/kotlinc.xml -.idea/misc.xml -.idea/modules.xml -asciicheck.iml diff --git a/vendor/github.com/tdakkota/asciicheck/LICENSE b/vendor/github.com/tdakkota/asciicheck/LICENSE deleted file mode 100644 index 48a60cf1c4..0000000000 --- a/vendor/github.com/tdakkota/asciicheck/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 tdakkota - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/tdakkota/asciicheck/README.md b/vendor/github.com/tdakkota/asciicheck/README.md deleted file mode 100644 index a7ff5884f3..0000000000 --- a/vendor/github.com/tdakkota/asciicheck/README.md +++ /dev/null @@ -1,72 +0,0 @@ -# asciicheck [![Go Report Card](https://goreportcard.com/badge/github.com/tdakkota/asciicheck)](https://goreportcard.com/report/github.com/tdakkota/asciicheck) [![codecov](https://codecov.io/gh/tdakkota/asciicheck/branch/master/graph/badge.svg)](https://codecov.io/gh/tdakkota/asciicheck) ![Go](https://github.com/tdakkota/asciicheck/workflows/Go/badge.svg) -Simple linter to check that your code does not contain non-ASCII identifiers - -# Install - -``` -go get -u github.com/tdakkota/asciicheck/cmd/asciicheck -``` - -# Reason to use -So, do you see this code? Looks correct, isn't it? - -```go -package main - -import "fmt" - -type TеstStruct struct{} - -func main() { - s := TestStruct{} - fmt.Println(s) -} -``` -But if you try to run it, you will get an error: -``` -./prog.go:8:7: undefined: TestStruct -``` -What? `TestStruct` is defined above, but compiler thinks diffrent. Why? - -**Answer**: -Because `TestStruct` is not `TеstStruct`. -``` -type TеstStruct struct{} - ^ this 'e' (U+0435) is not 'e' (U+0065) -``` - -# Usage -asciicheck uses [`singlechecker`](https://pkg.go.dev/golang.org/x/tools/go/analysis/singlechecker) package to run: - -``` -asciicheck: checks that all code identifiers does not have non-ASCII symbols in the name - -Usage: asciicheck [-flag] [package] - - -Flags: - -V print version and exit - -all - no effect (deprecated) - -c int - display offending line with this many lines of context (default -1) - -cpuprofile string - write CPU profile to this file - -debug string - debug flags, any subset of "fpstv" - -fix - apply all suggested fixes - -flags - print analyzer flags in JSON - -json - emit JSON output - -memprofile string - write memory profile to this file - -source - no effect (deprecated) - -tags string - no effect (deprecated) - -trace string - write trace log to this file - -v no effect (deprecated) -``` diff --git a/vendor/github.com/tdakkota/asciicheck/ascii.go b/vendor/github.com/tdakkota/asciicheck/ascii.go deleted file mode 100644 index 43fe25b59e..0000000000 --- a/vendor/github.com/tdakkota/asciicheck/ascii.go +++ /dev/null @@ -1,21 +0,0 @@ -package asciicheck - -import ( - "unicode" - "unicode/utf8" -) - -func isASCII(s string) (rune, bool) { - if len(s) == 1 { - r, size := utf8.DecodeRuneInString(s) - return r, size < 2 - } - - for _, r := range s { - if r > unicode.MaxASCII { - return r, false - } - } - - return 0, true -} diff --git a/vendor/github.com/tdakkota/asciicheck/asciicheck.go b/vendor/github.com/tdakkota/asciicheck/asciicheck.go deleted file mode 100644 index 6907280222..0000000000 --- a/vendor/github.com/tdakkota/asciicheck/asciicheck.go +++ /dev/null @@ -1,49 +0,0 @@ -package asciicheck - -import ( - "fmt" - "go/ast" - "golang.org/x/tools/go/analysis" -) - -func NewAnalyzer() *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "asciicheck", - Doc: "checks that all code identifiers does not have non-ASCII symbols in the name", - Run: run, - } -} - -func run(pass *analysis.Pass) (interface{}, error) { - for _, file := range pass.Files { - alreadyViewed := map[*ast.Object]struct{}{} - ast.Inspect( - file, func(node ast.Node) bool { - cb(pass, node, alreadyViewed) - return true - }, - ) - } - - return nil, nil -} - -func cb(pass *analysis.Pass, n ast.Node, m map[*ast.Object]struct{}) { - if v, ok := n.(*ast.Ident); ok { - if _, ok := m[v.Obj]; ok { - return - } else { - m[v.Obj] = struct{}{} - } - - ch, ascii := isASCII(v.Name) - if !ascii { - pass.Report( - analysis.Diagnostic{ - Pos: v.Pos(), - Message: fmt.Sprintf("identifier \"%s\" contain non-ASCII character: %#U", v.Name, ch), - }, - ) - } - } -} diff --git a/vendor/github.com/tetafro/godot/.gitignore b/vendor/github.com/tetafro/godot/.gitignore deleted file mode 100644 index 0b17eac4c3..0000000000 --- a/vendor/github.com/tetafro/godot/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/dist/ -/tmp/ -/vendor/ -/godot -/profile.out diff --git a/vendor/github.com/tetafro/godot/.godot.yaml b/vendor/github.com/tetafro/godot/.godot.yaml deleted file mode 100644 index af36858f90..0000000000 --- a/vendor/github.com/tetafro/godot/.godot.yaml +++ /dev/null @@ -1,16 +0,0 @@ -# Which comments to check: -# declarations - for top level declaration comments (default); -# toplevel - for top level comments; -# all - for all comments. -scope: declarations - -# List of regexps for excluding particular comment lines from check. -# Example: exclude comments which contain numbers. -exclude: - # - '[0-9]+' - -# Check periods at the end of sentences. -period: true - -# Check that first letter of each sentence is capital. -capital: false diff --git a/vendor/github.com/tetafro/godot/.golangci.yml b/vendor/github.com/tetafro/godot/.golangci.yml deleted file mode 100644 index ea380eb83d..0000000000 --- a/vendor/github.com/tetafro/godot/.golangci.yml +++ /dev/null @@ -1,80 +0,0 @@ -run: - concurrency: 2 - deadline: 5m - -skip-dirs: - - path: ./testdata/ - -linters: - disable-all: true - enable: - - asciicheck - - bodyclose - - cyclop - - dogsled - - durationcheck - - errcheck - - errname - - errorlint - - exhaustive - - exportloopref - - exportloopref - - gochecknoinits - - gocognit - - goconst - - gocritic - - gocyclo - - godot - - goerr113 - - gofmt - - gofumpt - - goimports - - goprintffuncname - - gosec - - gosimple - - govet - - importas - - ineffassign - - lll - - misspell - - nakedret - - nestif - - noctx - - nolintlint - - prealloc - - revive - - rowserrcheck - - sqlclosecheck - - sqlclosecheck - - staticcheck - - stylecheck - - typecheck - - unconvert - - unparam - - unused - - wastedassign - - whitespace - - wrapcheck - -linters-settings: - godot: - scope: toplevel - -issues: - exclude-use-default: false - exclude: - - "do not define dynamic errors, use wrapped static errors instead" - exclude-rules: - - path: _test\.go - linters: - - dupl - - errcheck - - funlen - - gocognit - - cyclop - - gosec - - noctx - - path: main\.go - linters: - - cyclop - - gomnd diff --git a/vendor/github.com/tetafro/godot/.goreleaser.yml b/vendor/github.com/tetafro/godot/.goreleaser.yml deleted file mode 100644 index c0fc2b6b1f..0000000000 --- a/vendor/github.com/tetafro/godot/.goreleaser.yml +++ /dev/null @@ -1,11 +0,0 @@ -builds: - - dir: ./cmd/godot -checksum: - name_template: checksums.txt -snapshot: - name_template: "{{ .Tag }}" -changelog: - sort: asc - filters: - exclude: - - '^Merge pull request' diff --git a/vendor/github.com/tetafro/godot/LICENSE b/vendor/github.com/tetafro/godot/LICENSE deleted file mode 100644 index 120c6d5023..0000000000 --- a/vendor/github.com/tetafro/godot/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Denis Krivak - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/tetafro/godot/Makefile b/vendor/github.com/tetafro/godot/Makefile deleted file mode 100644 index f167051e87..0000000000 --- a/vendor/github.com/tetafro/godot/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -.PHONY: dep -dep: - go mod tidy && go mod verify - -.PHONY: test -test: - go test ./... - -.PHONY: cover -cover: - go test -coverprofile cover.out ./... - go tool cover -html=cover.out - rm -f cover.out - -.PHONY: lint -lint: - golangci-lint run - -.PHONY: build -build: - go build -o godot ./cmd/godot - -.PHONY: release -release: - goreleaser release --rm-dist diff --git a/vendor/github.com/tetafro/godot/README.md b/vendor/github.com/tetafro/godot/README.md deleted file mode 100644 index 6b2e530b93..0000000000 --- a/vendor/github.com/tetafro/godot/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# godot - -[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/tetafro/godot/master/LICENSE) -[![Github CI](https://img.shields.io/github/actions/workflow/status/tetafro/godot/push.yml)](https://github.com/tetafro/godot/actions) -[![Go Report](https://goreportcard.com/badge/github.com/tetafro/godot)](https://goreportcard.com/report/github.com/tetafro/godot) -[![Codecov](https://codecov.io/gh/tetafro/godot/branch/master/graph/badge.svg)](https://codecov.io/gh/tetafro/godot) - -Linter that checks if all top-level comments contain a period at the -end of the last sentence if needed. - -[CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences) quote: - -> Comments should begin with the name of the thing being described -> and end in a period - -## Install - -*NOTE: Godot is available as a part of [GolangCI Lint](https://github.com/golangci/golangci-lint) -(disabled by default).* - -Build from source - -```sh -go install github.com/tetafro/godot/cmd/godot@latest -``` - -or download binary from [releases page](https://github.com/tetafro/godot/releases). - -## Config - -You can specify options using config file. Use default name `.godot.yaml`, or -set it using `-c filename.yaml` argument. If no config provided the following -defaults are used: - -```yaml -# Which comments to check: -# declarations - for top level declaration comments (default); -# toplevel - for top level comments; -# all - for all comments. -scope: declarations - -# List of regexps for excluding particular comment lines from check. -exclude: - -# Check periods at the end of sentences. -period: true - -# Check that first letter of each sentence is capital. -capital: false -``` - -## Run - -```sh -godot ./myproject -``` - -Autofix flags are also available - -```sh -godot -f ./myproject # fix issues and print the result -godot -w ./myproject # fix issues and replace the original file -``` - -See all flags with `godot -h`. - -## Example - -Code - -```go -package math - -// Sum sums two integers -func Sum(a, b int) int { - return a + b // result -} -``` - -Output - -```sh -Comment should end in a period: math/math.go:3:1 -``` diff --git a/vendor/github.com/tetafro/godot/checks.go b/vendor/github.com/tetafro/godot/checks.go deleted file mode 100644 index 0e53c220a2..0000000000 --- a/vendor/github.com/tetafro/godot/checks.go +++ /dev/null @@ -1,296 +0,0 @@ -package godot - -import ( - "go/token" - "regexp" - "strings" - "unicode" -) - -// Error messages. -const ( - noPeriodMessage = "Comment should end in a period" - noCapitalMessage = "Sentence should start with a capital letter" -) - -var ( - // List of valid sentence ending. - // A sentence can be inside parenthesis, and therefore ends with parenthesis. - lastChars = []string{".", "?", "!", ".)", "?)", "!)", "。", "?", "!", "。)", "?)", "!)", specialReplacer} - - // Abbreviations to exclude from capital letters check. - abbreviations = []string{"i.e.", "i. e.", "e.g.", "e. g.", "etc."} - - // Special tags in comments like "//nolint:", or "//+k8s:". - tags = regexp.MustCompile(`^\+?[a-z0-9]+:`) - - // Special hashtags in comments like "// #nosec". - hashtags = regexp.MustCompile(`^#[a-z]+($|\s)`) - - // URL at the end of the line. - endURL = regexp.MustCompile(`[a-z]+://[^\s]+$`) -) - -// position is a position inside a comment (might be multiline comment). -type position struct { - line int // starts at 1 - column int // starts at 1, byte count -} - -// checkComments checks every comment accordings to the rules from -// `settings` argument. -func checkComments(comments []comment, settings Settings) []Issue { - var issues []Issue - for _, c := range comments { - if settings.Period { - if iss := checkPeriod(c); iss != nil { - issues = append(issues, *iss) - } - } - if settings.Capital { - if iss := checkCapital(c); len(iss) > 0 { - issues = append(issues, iss...) - } - } - } - return issues -} - -// checkPeriod checks that the last sentense of the comment ends -// in a period. -func checkPeriod(c comment) *Issue { - // Check last non-empty line - var found bool - var line string - var pos position - lines := strings.Split(c.text, "\n") - for i := len(lines) - 1; i >= 0; i-- { - line = strings.TrimRightFunc(lines[i], unicode.IsSpace) - if line == "" { - continue - } - found = true - pos.line = i + 1 - break - } - // All lines are empty - if !found { - return nil - } - // Correct line - if hasSuffix(line, lastChars) { - return nil - } - - pos.column = len(line) + 1 - - // Shift position to its real value. `c.text` doesn't contain comment's - // special symbols: /* or //, and line indentations inside. It also - // contains */ in the end in case of block comment. - pos.column += strings.Index( - c.lines[pos.line-1], - strings.Split(c.text, "\n")[pos.line-1], - ) - - iss := Issue{ - Pos: token.Position{ - Filename: c.start.Filename, - Offset: c.start.Offset, - Line: pos.line + c.start.Line - 1, - Column: pos.column, - }, - Message: noPeriodMessage, - } - - // Make a replacement. Use `pos.line` to get an original line from - // attached lines. Use `iss.Pos.Column` because it's a position in - // the original line. - original := c.lines[pos.line-1] - if len(original) < iss.Pos.Column-1 { - // This should never happen. Avoid panics, skip this check. - return nil - } - iss.Replacement = original[:iss.Pos.Column-1] + "." + - original[iss.Pos.Column-1:] - - // Save replacement to raw lines to be able to combine it with - // further replacements - c.lines[pos.line-1] = iss.Replacement - - return &iss -} - -// checkCapital checks that each sentense of the comment starts with -// a capital letter. -// -//nolint:cyclop,funlen -func checkCapital(c comment) []Issue { - // Remove common abbreviations from the comment - for _, abbr := range abbreviations { - repl := strings.ReplaceAll(abbr, ".", "_") - c.text = strings.ReplaceAll(c.text, abbr, repl) - } - - // List of states during the scan: `empty` - nothing special, - // `endChar` - found one of sentence ending chars (.!?), - // `endOfSentence` - found `endChar`, and then space or newline. - const empty, endChar, endOfSentence = 1, 2, 3 - - var pp []position - pos := position{line: 1} - state := endOfSentence - if c.decl { - // Skip first - state = empty - } - for _, r := range c.text { - s := string(r) - - pos.column++ - if s == "\n" { - pos.line++ - pos.column = 0 - if state == endChar { - state = endOfSentence - } - continue - } - if s == "." || s == "!" || s == "?" { - state = endChar - continue - } - if s == ")" && state == endChar { - continue - } - if s == " " { - if state == endChar { - state = endOfSentence - } - continue - } - if state == endOfSentence && unicode.IsLower(r) { - pp = append(pp, position{ - line: pos.line, - column: runeToByteColumn(c.text, pos.column), - }) - } - state = empty - } - if len(pp) == 0 { - return nil - } - - issues := make([]Issue, len(pp)) - for i, pos := range pp { - // Shift position by the length of comment's special symbols: /* or // - isBlock := strings.HasPrefix(c.lines[0], "/*") - if (isBlock && pos.line == 1) || !isBlock { - pos.column += 2 - } - - iss := Issue{ - Pos: token.Position{ - Filename: c.start.Filename, - Offset: c.start.Offset, - Line: pos.line + c.start.Line - 1, - Column: pos.column + c.start.Column - 1, - }, - Message: noCapitalMessage, - } - - // Make a replacement. Use `pos.original` to get an original original from - // attached lines. Use `iss.Pos.Column` because it's a position in - // the original original. - original := c.lines[pos.line-1] - col := byteToRuneColumn(original, iss.Pos.Column) - 1 - rep := string(unicode.ToTitle([]rune(original)[col])) // capital letter - if len(original) < iss.Pos.Column-1+len(rep) { - // This should never happen. Avoid panics, skip this check. - continue - } - iss.Replacement = original[:iss.Pos.Column-1] + rep + - original[iss.Pos.Column-1+len(rep):] - - // Save replacement to raw lines to be able to combine it with - // further replacements - c.lines[pos.line-1] = iss.Replacement - - issues[i] = iss - } - - return issues -} - -// isSpecialBlock checks that given block of comment lines is special and -// shouldn't be checked as a regular sentence. -func isSpecialBlock(comment string) bool { - // Skip cgo code blocks - // TODO: Find a better way to detect cgo code - if strings.HasPrefix(comment, "/*") && (strings.Contains(comment, "#include") || - strings.Contains(comment, "#define")) { - return true - } - if strings.HasPrefix(comment, "// Output: ") { - return true - } - return false -} - -// isSpecialLine checks that given comment line is special and -// shouldn't be checked as a regular sentence. -func isSpecialLine(comment string) bool { - // Skip cgo export tags: https://golang.org/cmd/cgo/#hdr-C_references_to_Go - if strings.HasPrefix(comment, "//export ") { - return true - } - - comment = strings.TrimPrefix(comment, "//") - comment = strings.TrimPrefix(comment, "/*") - - // Don't check comments starting with space indentation - they may - // contain code examples, which shouldn't end with period - if strings.HasPrefix(comment, " ") || - strings.HasPrefix(comment, " \t") || - strings.HasPrefix(comment, "\t") { - return true - } - - // Skip tags and URLs - comment = strings.TrimSpace(comment) - if tags.MatchString(comment) || - hashtags.MatchString(comment) || - endURL.MatchString(comment) || - strings.HasPrefix(comment, "+build") { - return true - } - - return false -} - -func hasSuffix(s string, suffixes []string) bool { - for _, suffix := range suffixes { - if strings.HasSuffix(s, suffix) { - return true - } - } - return false -} - -// The following two functions convert byte and rune indexes. -// -// Example: -// text: a b c Ш e f -// runes: 1 2 3 4 5 6 -// bytes: 0 1 2 3 5 6 -// The reason of the difference is that the size of "Ш" is 2 bytes. -// NOTE: Works only for 1-based indexes (line columns). - -// byteToRuneColumn converts byte index inside the string to rune index. -func byteToRuneColumn(s string, i int) int { - return len([]rune(s[:i-1])) + 1 -} - -// runeToByteColumn converts rune index inside the string to byte index. -func runeToByteColumn(s string, i int) int { - return len(string([]rune(s)[:i-1])) + 1 -} diff --git a/vendor/github.com/tetafro/godot/getters.go b/vendor/github.com/tetafro/godot/getters.go deleted file mode 100644 index 7d3d22fb13..0000000000 --- a/vendor/github.com/tetafro/godot/getters.go +++ /dev/null @@ -1,289 +0,0 @@ -package godot - -import ( - "errors" - "fmt" - "go/ast" - "go/token" - "os" - "regexp" - "strings" -) - -var ( - errEmptyInput = errors.New("empty input") - errUnsuitableInput = errors.New("unsuitable input") -) - -// specialReplacer is a replacer for some types of special lines in comments, -// which shouldn't be checked. For example, if comment ends with a block of -// code it should not necessarily have a period at the end. -const specialReplacer = "" - -type parsedFile struct { - fset *token.FileSet - file *ast.File - lines []string -} - -func newParsedFile(file *ast.File, fset *token.FileSet) (*parsedFile, error) { - if file == nil || fset == nil || len(file.Comments) == 0 { - return nil, errEmptyInput - } - - pf := parsedFile{ - fset: fset, - file: file, - } - - var err error - - // Read original file. This is necessary for making a replacements for - // inline comments. I couldn't find a better way to get original line - // with code and comment without reading the file. Function `Format` - // from "go/format" won't help here if the original file is not gofmt-ed. - pf.lines, err = readFile(file, fset) - if err != nil { - return nil, fmt.Errorf("read file: %w", err) - } - - // Dirty hack. For some cases Go generates temporary files during - // compilation process if there is a cgo block in the source file. Some of - // these temporary files are just copies of original source files but with - // new generated comments at the top. Because of them the content differs - // from AST. For some reason it differs only in golangci-lint. I failed to - // find out the exact description of the process, so let's just skip files - // generated by cgo. - if isCgoGenerated(pf.lines) { - return nil, errUnsuitableInput - } - - // Check consistency to avoid checking slice indexes in each function. - // Note that `PositionFor` is used with `adjusted=false` to skip `//line` - // directives that can set references to other files (e.g. templates) - // instead of the real ones, and break consistency here. - // Issue: https://github.com/tetafro/godot/issues/32 - lastComment := pf.file.Comments[len(pf.file.Comments)-1] - if p := pf.fset.PositionFor(lastComment.End(), false); len(pf.lines) < p.Line { - return nil, fmt.Errorf("inconsistency between file and AST: %s", p.Filename) - } - - return &pf, nil -} - -// getComments extracts comments from a file. -func (pf *parsedFile) getComments(scope Scope, exclude []*regexp.Regexp) []comment { - var comments []comment - decl := pf.getDeclarationComments(exclude) - switch scope { - case AllScope: - // All comments - comments = pf.getAllComments(exclude) - case TopLevelScope: - // All top level comments and comments from the inside - // of top level blocks - comments = append( - pf.getBlockComments(exclude), - pf.getTopLevelComments(exclude)..., - ) - case DeclScope: - // Top level declaration comments and comments from the inside - // of top level blocks - comments = append(pf.getBlockComments(exclude), decl...) - } - - // Set `decl` flag - setDecl(comments, decl) - - return comments -} - -// getBlockComments gets comments from the inside of top level blocks: -// var (...), const (...). -func (pf *parsedFile) getBlockComments(exclude []*regexp.Regexp) []comment { - var comments []comment - for _, decl := range pf.file.Decls { - d, ok := decl.(*ast.GenDecl) - if !ok { - continue - } - // No parenthesis == no block - if d.Lparen == 0 { - continue - } - for _, c := range pf.file.Comments { - if c == nil || len(c.List) == 0 { - continue - } - // Skip comments outside this block - if d.Lparen > c.Pos() || c.Pos() > d.Rparen { - continue - } - // Skip comments that are not top-level for this block - // (the block itself is top level, so comments inside this block - // would be on column 2) - //nolint:gomnd - if pf.fset.Position(c.Pos()).Column != 2 { - continue - } - firstLine := pf.fset.Position(c.Pos()).Line - lastLine := pf.fset.Position(c.End()).Line - comments = append(comments, comment{ - lines: pf.lines[firstLine-1 : lastLine], - text: getText(c, exclude), - start: pf.fset.Position(c.List[0].Slash), - }) - } - } - return comments -} - -// getTopLevelComments gets all top level comments. -func (pf *parsedFile) getTopLevelComments(exclude []*regexp.Regexp) []comment { - var comments []comment //nolint:prealloc - for _, c := range pf.file.Comments { - if c == nil || len(c.List) == 0 { - continue - } - if pf.fset.Position(c.Pos()).Column != 1 { - continue - } - firstLine := pf.fset.Position(c.Pos()).Line - lastLine := pf.fset.Position(c.End()).Line - comments = append(comments, comment{ - lines: pf.lines[firstLine-1 : lastLine], - text: getText(c, exclude), - start: pf.fset.Position(c.List[0].Slash), - }) - } - return comments -} - -// getDeclarationComments gets top level declaration comments. -func (pf *parsedFile) getDeclarationComments(exclude []*regexp.Regexp) []comment { - var comments []comment //nolint:prealloc - for _, decl := range pf.file.Decls { - var cg *ast.CommentGroup - switch d := decl.(type) { - case *ast.GenDecl: - cg = d.Doc - case *ast.FuncDecl: - cg = d.Doc - } - - if cg == nil || len(cg.List) == 0 { - continue - } - - firstLine := pf.fset.Position(cg.Pos()).Line - lastLine := pf.fset.Position(cg.End()).Line - comments = append(comments, comment{ - lines: pf.lines[firstLine-1 : lastLine], - text: getText(cg, exclude), - start: pf.fset.Position(cg.List[0].Slash), - }) - } - return comments -} - -// getAllComments gets every single comment from the file. -func (pf *parsedFile) getAllComments(exclude []*regexp.Regexp) []comment { - var comments []comment //nolint:prealloc - for _, c := range pf.file.Comments { - if c == nil || len(c.List) == 0 { - continue - } - firstLine := pf.fset.Position(c.Pos()).Line - lastLine := pf.fset.Position(c.End()).Line - comments = append(comments, comment{ - lines: pf.lines[firstLine-1 : lastLine], - start: pf.fset.Position(c.List[0].Slash), - text: getText(c, exclude), - }) - } - return comments -} - -// getText extracts text from comment. If the comment is a special block -// (e.g., CGO code), a block of empty lines is returned. If comment contains -// special lines (e.g., tags or indented code examples), they are replaced -// with `specialReplacer` to skip checks for them. -// The result can be multiline. -// -//nolint:cyclop -func getText(comment *ast.CommentGroup, exclude []*regexp.Regexp) (s string) { - if len(comment.List) == 1 && - strings.HasPrefix(comment.List[0].Text, "/*") && - isSpecialBlock(comment.List[0].Text) { - return "" - } - - for _, c := range comment.List { - text := c.Text - isBlock := false - if strings.HasPrefix(c.Text, "/*") { - isBlock = true - text = strings.TrimPrefix(text, "/*") - text = strings.TrimSuffix(text, "*/") - } - for _, line := range strings.Split(text, "\n") { - if isSpecialLine(line) { - s += specialReplacer + "\n" - continue - } - if !isBlock { - line = strings.TrimPrefix(line, "//") - } - if matchAny(line, exclude) { - s += specialReplacer + "\n" - continue - } - s += line + "\n" - } - } - if len(s) == 0 { - return "" - } - return s[:len(s)-1] // trim last "\n" -} - -// readFile reads file and returns its lines as strings. -func readFile(file *ast.File, fset *token.FileSet) ([]string, error) { - fname := fset.File(file.Package) - f, err := os.ReadFile(fname.Name()) - if err != nil { - return nil, err //nolint:wrapcheck - } - return strings.Split(string(f), "\n"), nil -} - -// setDecl sets `decl` flag to comments which are declaration comments. -func setDecl(comments, decl []comment) { - for _, d := range decl { - for i, c := range comments { - if d.start == c.start { - comments[i].decl = true - break - } - } - } -} - -// matchAny checks if string matches any of given regexps. -func matchAny(s string, rr []*regexp.Regexp) bool { - for _, re := range rr { - if re.MatchString(s) { - return true - } - } - return false -} - -func isCgoGenerated(lines []string) bool { - for i := range lines { - if strings.Contains(lines[i], "Code generated by cmd/cgo") { - return true - } - } - return false -} diff --git a/vendor/github.com/tetafro/godot/godot.go b/vendor/github.com/tetafro/godot/godot.go deleted file mode 100644 index e825e9a6de..0000000000 --- a/vendor/github.com/tetafro/godot/godot.go +++ /dev/null @@ -1,129 +0,0 @@ -// Package godot checks if comments contain a period at the end of the last -// sentence if needed. -package godot - -import ( - "errors" - "fmt" - "go/ast" - "go/token" - "os" - "regexp" - "sort" - "strings" -) - -// NOTE: Line and column indexes are 1-based. - -// NOTE: Errors `invalid line number inside comment...` should never happen. -// Their goal is to prevent panic, if there's a bug with array indexes. - -// Issue contains a description of linting error and a recommended replacement. -type Issue struct { - Pos token.Position - Message string - Replacement string -} - -// comment is an internal representation of AST comment entity with additional -// data attached. The latter is used for creating a full replacement for -// the line with issues. -type comment struct { - lines []string // unmodified lines from file - text string // concatenated `lines` with special parts excluded - start token.Position // position of the first symbol in comment - decl bool // whether comment is a declaration comment -} - -// Run runs this linter on the provided code. -func Run(file *ast.File, fset *token.FileSet, settings Settings) ([]Issue, error) { - pf, err := newParsedFile(file, fset) - if errors.Is(err, errEmptyInput) || errors.Is(err, errUnsuitableInput) { - return nil, nil - } - if err != nil { - return nil, fmt.Errorf("parse input file: %w", err) - } - - exclude := make([]*regexp.Regexp, len(settings.Exclude)) - for i := 0; i < len(settings.Exclude); i++ { - exclude[i], err = regexp.Compile(settings.Exclude[i]) - if err != nil { - return nil, fmt.Errorf("invalid regexp: %w", err) - } - } - - comments := pf.getComments(settings.Scope, exclude) - issues := checkComments(comments, settings) - sortIssues(issues) - - return issues, nil -} - -// Fix fixes all issues and returns new version of file content. -func Fix(path string, file *ast.File, fset *token.FileSet, settings Settings) ([]byte, error) { - // Read file - content, err := os.ReadFile(path) //nolint:gosec - if err != nil { - return nil, fmt.Errorf("read file: %w", err) - } - if len(content) == 0 { - return nil, nil - } - - issues, err := Run(file, fset, settings) - if err != nil { - return nil, fmt.Errorf("run linter: %w", err) - } - - // slice -> map - m := map[int]Issue{} - for _, iss := range issues { - m[iss.Pos.Line] = iss - } - - // Replace lines from issues - fixed := make([]byte, 0, len(content)) - for i, line := range strings.Split(string(content), "\n") { - newline := line - if iss, ok := m[i+1]; ok { - newline = iss.Replacement - } - fixed = append(fixed, []byte(newline+"\n")...) - } - fixed = fixed[:len(fixed)-1] // trim last "\n" - - return fixed, nil -} - -// Replace rewrites original file with its fixed version. -func Replace(path string, file *ast.File, fset *token.FileSet, settings Settings) error { - info, err := os.Stat(path) - if err != nil { - return fmt.Errorf("check file: %w", err) - } - mode := info.Mode() - - fixed, err := Fix(path, file, fset, settings) - if err != nil { - return fmt.Errorf("fix issues: %w", err) - } - - if err := os.WriteFile(path, fixed, mode); err != nil { - return fmt.Errorf("write file: %w", err) - } - return nil -} - -// sortIssues sorts by filename, line and column. -func sortIssues(iss []Issue) { - sort.Slice(iss, func(i, j int) bool { - if iss[i].Pos.Filename != iss[j].Pos.Filename { - return iss[i].Pos.Filename < iss[j].Pos.Filename - } - if iss[i].Pos.Line != iss[j].Pos.Line { - return iss[i].Pos.Line < iss[j].Pos.Line - } - return iss[i].Pos.Column < iss[j].Pos.Column - }) -} diff --git a/vendor/github.com/tetafro/godot/settings.go b/vendor/github.com/tetafro/godot/settings.go deleted file mode 100644 index b71bf5d584..0000000000 --- a/vendor/github.com/tetafro/godot/settings.go +++ /dev/null @@ -1,29 +0,0 @@ -package godot - -// Settings contains linter settings. -type Settings struct { - // Which comments to check (top level declarations, top level, all). - Scope Scope - - // Regexp for excluding particular comment lines from check. - Exclude []string - - // Check periods at the end of sentences. - Period bool - - // Check that first letter of each sentence is capital. - Capital bool -} - -// Scope sets which comments should be checked. -type Scope string - -// List of available check scopes. -const ( - // DeclScope is for top level declaration comments. - DeclScope Scope = "declarations" - // TopLevelScope is for all top level comments. - TopLevelScope Scope = "toplevel" - // AllScope is for all comments. - AllScope Scope = "all" -) diff --git a/vendor/github.com/tetratelabs/wazero/.editorconfig b/vendor/github.com/tetratelabs/wazero/.editorconfig deleted file mode 100644 index f999431de5..0000000000 --- a/vendor/github.com/tetratelabs/wazero/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/vendor/github.com/tetratelabs/wazero/.gitattributes b/vendor/github.com/tetratelabs/wazero/.gitattributes deleted file mode 100644 index 3a08bc389b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Improves experience of commands like `make format` on Windows -* text=auto eol=lf diff --git a/vendor/github.com/tetratelabs/wazero/.gitignore b/vendor/github.com/tetratelabs/wazero/.gitignore deleted file mode 100644 index f824fdde0b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib -/wazero -build -dist - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work - -# Goland -.idea - -# AssemblyScript -node_modules -package-lock.json - -# codecov.io -/coverage.txt - -.vagrant - -zig-cache/ -zig-out/ - -.DS_Store diff --git a/vendor/github.com/tetratelabs/wazero/.gitmodules b/vendor/github.com/tetratelabs/wazero/.gitmodules deleted file mode 100644 index 410c91f44f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "site/themes/hello-friend"] - path = site/themes/hello-friend - url = https://github.com/panr/hugo-theme-hello-friend.git diff --git a/vendor/github.com/tetratelabs/wazero/CONTRIBUTING.md b/vendor/github.com/tetratelabs/wazero/CONTRIBUTING.md deleted file mode 100644 index 8ab866f0e0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/CONTRIBUTING.md +++ /dev/null @@ -1,75 +0,0 @@ -# Contributing - -We welcome contributions from the community. Please read the following guidelines carefully to maximize the chances of your PR being merged. - -## Coding Style - -- To ensure your change passes format checks, run `make check`. To format your files, you can run `make format`. -- We follow standard Go table-driven tests and use an internal [testing library](./internal/testing/require) to assert correctness. To verify all tests pass, you can run `make test`. - -## DCO - -We require DCO signoff line in every commit to this repo. - -The sign-off is a simple line at the end of the explanation for the -patch, which certifies that you wrote it or otherwise have the right to -pass it on as an open-source patch. The rules are pretty simple: if you -can certify the below (from -[developercertificate.org](https://developercertificate.org/)): - -``` -Developer Certificate of Origin -Version 1.1 -Copyright (C) 2004, 2006 The Linux Foundation and its contributors. -660 York Street, Suite 102, -San Francisco, CA 94110 USA -Everyone is permitted to copy and distribute verbatim copies of this -license document, but changing it is not allowed. -Developer's Certificate of Origin 1.1 -By making a contribution to this project, I certify that: -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. -``` - -then you just add a line to every git commit message: - - Signed-off-by: Joe Smith - -using your real name (sorry, no pseudonyms or anonymous contributions.) - -You can add the sign off when creating the git commit via `git commit -s`. - -## Code Reviews - -* The pull request title should describe what the change does and not embed issue numbers. -The pull request should only be blank when the change is minor. Any feature should include -a description of the change and what motivated it. If the change or design changes through -review, please keep the title and description updated accordingly. -* A single approval is sufficient to merge. If a reviewer asks for -changes in a PR they should be addressed before the PR is merged, -even if another reviewer has already approved the PR. -* During the review, address the comments and commit the changes -_without_ squashing the commits. This facilitates incremental reviews -since the reviewer does not go through all the code again to find out -what has changed since the last review. When a change goes out of sync with main, -please rebase and force push, keeping the original commits where practical. -* Commits are squashed prior to merging a pull request, using the title -as commit message by default. Maintainers may request contributors to -edit the pull request tite to ensure that it remains descriptive as a -commit message. Alternatively, maintainers may change the commit message directly. diff --git a/vendor/github.com/tetratelabs/wazero/LICENSE b/vendor/github.com/tetratelabs/wazero/LICENSE deleted file mode 100644 index e21d699582..0000000000 --- a/vendor/github.com/tetratelabs/wazero/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2020-2023 wazero authors - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/tetratelabs/wazero/Makefile b/vendor/github.com/tetratelabs/wazero/Makefile deleted file mode 100644 index 0567942880..0000000000 --- a/vendor/github.com/tetratelabs/wazero/Makefile +++ /dev/null @@ -1,347 +0,0 @@ - -gofumpt := mvdan.cc/gofumpt@v0.5.0 -gosimports := github.com/rinchsan/gosimports/cmd/gosimports@v0.3.8 -golangci_lint := github.com/golangci/golangci-lint/cmd/golangci-lint@v1.52.2 -asmfmt := github.com/klauspost/asmfmt/cmd/asmfmt@v1.3.2 -# sync this with netlify.toml! -hugo := github.com/gohugoio/hugo@v0.112.5 - -# Make 3.81 doesn't support '**' globbing: Set explicitly instead of recursion. -all_sources := $(wildcard *.go */*.go */*/*.go */*/*/*.go */*/*/*.go */*/*/*/*.go) -all_testdata := $(wildcard testdata/* */testdata/* */*/testdata/* */*/testdata/*/* */*/*/testdata/*) -all_testing := $(wildcard internal/testing/* internal/testing/*/* internal/testing/*/*/*) -all_examples := $(wildcard examples/* examples/*/* examples/*/*/* */*/example/* */*/example/*/* */*/example/*/*/*) -all_it := $(wildcard internal/integration_test/* internal/integration_test/*/* internal/integration_test/*/*/*) -# main_sources exclude any test or example related code -main_sources := $(wildcard $(filter-out %_test.go $(all_testdata) $(all_testing) $(all_examples) $(all_it), $(all_sources))) -# main_packages collect the unique main source directories (sort will dedupe). -# Paths need to all start with ./, so we do that manually vs foreach which strips it. -main_packages := $(sort $(foreach f,$(dir $(main_sources)),$(if $(findstring ./,$(f)),./,./$(f)))) - -go_test_options ?= -timeout 300s - -ensureCompilerFastest := -ldflags '-X github.com/tetratelabs/wazero/internal/integration_test/vs.ensureCompilerFastest=true' -.PHONY: bench -bench: - @go test -run=NONE -benchmem -bench=. ./internal/engine/compiler/... - @go build ./internal/integration_test/bench/... - @# Don't use -test.benchmem as it isn't accurate when comparing against CGO libs - @for d in vs/time vs/wasmedge vs/wasmtime ; do \ - cd ./internal/integration_test/$$d ; \ - go test -bench=. . -tags='wasmedge' $(ensureCompilerFastest) ; \ - cd - ;\ - done - -bench_testdata_dir := internal/integration_test/bench/testdata -.PHONY: build.bench -build.bench: - @tinygo build -o $(bench_testdata_dir)/case.wasm -scheduler=none --no-debug -target=wasi $(bench_testdata_dir)/case.go - -.PHONY: test.examples -test.examples: - @go test $(go_test_options) ./examples/... ./imports/assemblyscript/example/... ./imports/emscripten/... ./experimental/gojs/example/... ./imports/wasi_snapshot_preview1/example/... - -.PHONY: build.examples.as -build.examples.as: - @cd ./imports/assemblyscript/example/testdata && npm install && npm run build - -%.wasm: %.zig - @(cd $(@D); zig build -Doptimize=ReleaseSmall) - @mv $(@D)/zig-out/*/$(@F) $(@D) - -.PHONY: build.examples.zig -build.examples.zig: examples/allocation/zig/testdata/greet.wasm imports/wasi_snapshot_preview1/example/testdata/zig/cat.wasm imports/wasi_snapshot_preview1/testdata/zig/wasi.wasm - @cd internal/testing/dwarftestdata/testdata/zig; zig build; mv zig-out/*/main.wasm ./ # Need DWARF custom sections. - -tinygo_sources := examples/basic/testdata/add.go examples/allocation/tinygo/testdata/greet.go examples/cli/testdata/cli.go imports/wasi_snapshot_preview1/example/testdata/tinygo/cat.go -.PHONY: build.examples.tinygo -build.examples.tinygo: $(tinygo_sources) - @for f in $^; do \ - tinygo build -o $$(echo $$f | sed -e 's/\.go/\.wasm/') -scheduler=none --no-debug --target=wasi $$f; \ - done - -# We use zig to build C as it is easy to install and embeds a copy of zig-cc. -# Note: Don't use "-Oz" as that breaks our wasi sock example. -c_sources := imports/wasi_snapshot_preview1/example/testdata/zig-cc/cat.c imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.c -.PHONY: build.examples.zig-cc -build.examples.zig-cc: $(c_sources) - @for f in $^; do \ - zig cc --target=wasm32-wasi -o $$(echo $$f | sed -e 's/\.c/\.wasm/') $$f; \ - done - -# Here are the emcc args we use: -# -# * `-Oz` - most optimization for code size. -# * `--profiling` - adds the name section. -# * `-s STANDALONE_WASM` - ensures wasm is built for a non-js runtime. -# * `-s EXPORTED_FUNCTIONS=_malloc,_free` - export allocation functions so that -# they can be used externally as "malloc" and "free". -# * `-s WARN_ON_UNDEFINED_SYMBOLS=0` - imports not defined in JavaScript error -# otherwise. See https://github.com/emscripten-core/emscripten/issues/13641 -# * `-s TOTAL_STACK=8KB -s TOTAL_MEMORY=64KB` - reduce memory default from 16MB -# to one page (64KB). To do this, we have to reduce the stack size. -# * `-s ALLOW_MEMORY_GROWTH` - allows "memory.grow" instructions to succeed, but -# requires a function import "emscripten_notify_memory_growth". -emscripten_sources := $(wildcard imports/emscripten/testdata/*.cc) -.PHONY: build.examples.emscripten -build.examples.emscripten: $(emscripten_sources) - @for f in $^; do \ - em++ -Oz --profiling \ - -s STANDALONE_WASM \ - -s EXPORTED_FUNCTIONS=_malloc,_free \ - -s WARN_ON_UNDEFINED_SYMBOLS=0 \ - -s TOTAL_STACK=8KB -s TOTAL_MEMORY=64KB \ - -s ALLOW_MEMORY_GROWTH \ - --std=c++17 -o $$(echo $$f | sed -e 's/\.cc/\.wasm/') $$f; \ - done - -%/greet.wasm : cargo_target := wasm32-unknown-unknown -%/cat.wasm : cargo_target := wasm32-wasi -%/wasi.wasm : cargo_target := wasm32-wasi - -.PHONY: build.examples.rust -build.examples.rust: examples/allocation/rust/testdata/greet.wasm imports/wasi_snapshot_preview1/example/testdata/cargo-wasi/cat.wasm imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.wasm internal/testing/dwarftestdata/testdata/rust/main.wasm.xz - -# Normally, we build release because it is smaller. Testing dwarf requires the debug build. -internal/testing/dwarftestdata/testdata/rust/main.wasm.xz: - cd $(@D) && cargo wasi build - mv $(@D)/target/wasm32-wasi/debug/main.wasm $(@D) - cd $(@D) && xz -k -f ./main.wasm # Rust's DWARF section is huge, so compress it. - -# Builds rust using cargo normally, or cargo-wasi. -%.wasm: %.rs - @(cd $(@D); cargo $(if $(findstring wasi,$(cargo_target)),wasi build,build --target $(cargo_target)) --release) - @mv $(@D)/target/$(cargo_target)/release/$(@F) $(@D) - -spectest_base_dir := internal/integration_test/spectest -spectest_v1_dir := $(spectest_base_dir)/v1 -spectest_v1_testdata_dir := $(spectest_v1_dir)/testdata -spec_version_v1 := wg-1.0 -spectest_v2_dir := $(spectest_base_dir)/v2 -spectest_v2_testdata_dir := $(spectest_v2_dir)/testdata -# Latest draft state as of May 23, 2023. -spec_version_v2 := 2e8912e88a3118a46b90e8ccb659e24b4e8f3c23 - -.PHONY: build.spectest -build.spectest: - @$(MAKE) build.spectest.v1 - @$(MAKE) build.spectest.v2 - -.PHONY: build.spectest.v1 -build.spectest.v1: # Note: wabt by default uses >1.0 features, so wast2json flags might drift as they include more. See WebAssembly/wabt#1878 - @rm -rf $(spectest_v1_testdata_dir) - @mkdir -p $(spectest_v1_testdata_dir) - @cd $(spectest_v1_testdata_dir) \ - && curl -sSL 'https://api.github.com/repos/WebAssembly/spec/contents/test/core?ref=$(spec_version_v1)' | jq -r '.[]| .download_url' | grep -E ".wast" | xargs -Iurl curl -sJL url -O - @cd $(spectest_v1_testdata_dir) && for f in `find . -name '*.wast'`; do \ - perl -pi -e 's/\(assert_return_canonical_nan\s(\(invoke\s"f32.demote_f64"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \(f32.const nan:canonical\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_arithmetic_nan\s(\(invoke\s"f32.demote_f64"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \(f32.const nan:arithmetic\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_canonical_nan\s(\(invoke\s"f64\.promote_f32"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \(f64.const nan:canonical\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_arithmetic_nan\s(\(invoke\s"f64\.promote_f32"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \(f64.const nan:arithmetic\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_canonical_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \($$2.const nan:canonical\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_arithmetic_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \($$2.const nan:arithmetic\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_canonical_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\s\([a-z0-9.\s+-:]+\)\))\)/\(assert_return $$1 \($$2.const nan:canonical\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_arithmetic_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\s\([a-z0-9.\s+-:]+\)\))\)/\(assert_return $$1 \($$2.const nan:arithmetic\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_canonical_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \($$2.const nan:canonical\)\)/g' $$f; \ - perl -pi -e 's/\(assert_return_arithmetic_nan\s(\(invoke\s"[a-z._0-9]+"\s\((f[0-9]{2})\.const\s[a-z0-9.+:-]+\)\))\)/\(assert_return $$1 \($$2.const nan:arithmetic\)\)/g' $$f; \ - wast2json \ - --disable-saturating-float-to-int \ - --disable-sign-extension \ - --disable-simd \ - --disable-multi-value \ - --disable-bulk-memory \ - --disable-reference-types \ - --debug-names $$f; \ - done - -.PHONY: build.spectest.v2 -build.spectest.v2: # Note: SIMD cases are placed in the "simd" subdirectory. - @mkdir -p $(spectest_v2_testdata_dir) - @cd $(spectest_v2_testdata_dir) \ - && curl -sSL 'https://api.github.com/repos/WebAssembly/spec/contents/test/core?ref=$(spec_version_v2)' | jq -r '.[]| .download_url' | grep -E ".wast" | xargs -Iurl curl -sJL url -O - @cd $(spectest_v2_testdata_dir) \ - && curl -sSL 'https://api.github.com/repos/WebAssembly/spec/contents/test/core/simd?ref=$(spec_version_v2)' | jq -r '.[]| .download_url' | grep -E ".wast" | xargs -Iurl curl -sJL url -O - @cd $(spectest_v2_testdata_dir) && for f in `find . -name '*.wast'`; do \ - wast2json --debug-names --no-check $$f; \ - done - -.PHONY: test -test: - @go test $(go_test_options) $$(go list ./... | grep -vE '$(spectest_v1_dir)|$(spectest_v2_dir)') - @cd internal/version/testdata && go test $(go_test_options) ./... - -.PHONY: coverage -# replace spaces with commas -coverpkg = $(shell echo $(main_packages) | tr ' ' ',') -coverage: ## Generate test coverage - @go test -coverprofile=coverage.txt -covermode=atomic --coverpkg=$(coverpkg) $(main_packages) - @go tool cover -func coverage.txt - -.PHONY: spectest -spectest: - @$(MAKE) spectest.v1 - @$(MAKE) spectest.v2 - -spectest.v1: - @go test $(go_test_options) $$(go list ./... | grep $(spectest_v1_dir)) - -spectest.v2: - @go test $(go_test_options) $$(go list ./... | grep $(spectest_v2_dir)) - -golangci_lint_path := $(shell go env GOPATH)/bin/golangci-lint - -$(golangci_lint_path): - @go install $(golangci_lint) - -golangci_lint_goarch ?= $(shell go env GOARCH) - -.PHONY: lint -lint: $(golangci_lint_path) - @GOARCH=$(golangci_lint_goarch) CGO_ENABLED=0 $(golangci_lint_path) run --timeout 5m - -.PHONY: format -format: - @go run $(gofumpt) -l -w . - @go run $(gosimports) -local github.com/tetratelabs/ -w $(shell find . -name '*.go' -type f) - @go run $(asmfmt) -w $(shell find . -name '*.s' -type f) - -.PHONY: check # Pre-flight check for pull requests -check: -# The following checks help ensure our platform-specific code used for system -# calls safely falls back on a platform unsupported by the compiler engine. -# This makes sure the intepreter can be used. Most often the package that can -# drift here is "platform" or "sysfs": -# -# Ensure we build on windows: - @GOARCH=amd64 GOOS=windows go build ./... -# Ensure we build on an arbitrary operating system: - @GOARCH=amd64 GOOS=dragonfly go build ./... -# Ensure we build on solaris/illumos: - @GOARCH=amd64 GOOS=illumos go build ./... - @GOARCH=amd64 GOOS=solaris go build ./... -# Ensure we build on linux arm for Dapr: -# gh release view -R dapr/dapr --json assets --jq 'first(.assets[] | select(.name = "daprd_linux_arm.tar.gz") | {url, downloadCount})' - @GOARCH=arm GOOS=linux go build ./... -# Ensure we build on linux 386 for Trivy: -# gh release view -R aquasecurity/trivy --json assets --jq 'first(.assets[] | select(.name| test("Linux-32bit.*tar.gz")) | {url, downloadCount})' - @GOARCH=386 GOOS=linux go build ./... -# Ensure we build on FreeBSD amd64 for Trivy: -# gh release view -R aquasecurity/trivy --json assets --jq 'first(.assets[] | select(.name| test("FreeBSD-64bit.*tar.gz")) | {url, downloadCount})' - @GOARCH=amd64 GOOS=freebsd go build ./... - @$(MAKE) lint golangci_lint_goarch=arm64 - @$(MAKE) lint golangci_lint_goarch=amd64 - @$(MAKE) format - @go mod tidy - @if [ ! -z "`git status -s`" ]; then \ - echo "The following differences will fail CI until committed:"; \ - git diff --exit-code; \ - fi - -.PHONY: site -site: ## Serve website content - @git submodule update --init - @cd site && go run $(hugo) server --minify --disableFastRender --baseURL localhost:1313 --cleanDestinationDir -D - -.PHONY: clean -clean: ## Ensure a clean build - @rm -rf dist build coverage.txt - @go clean -testcache - -fuzz_timeout_seconds ?= 10 -.PHONY: fuzz -fuzz: - @cd internal/integration_test/fuzz && cargo fuzz run basic -- -max_total_time=$(fuzz_timeout_seconds) - @cd internal/integration_test/fuzz && cargo fuzz run memory_no_diff -- -max_total_time=$(fuzz_timeout_seconds) - @cd internal/integration_test/fuzz && cargo fuzz run validation -- -max_total_time=$(fuzz_timeout_seconds) - -#### CLI release related #### - -VERSION ?= dev -# Default to a dummy version 0.0.1.1, which is always lower than a real release. -# Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534. -# https://learn.microsoft.com/en-us/windows/win32/msi/productversion?redirectedfrom=MSDN -# https://stackoverflow.com/questions/9312221/msi-version-numbers -MSI_VERSION ?= 0.0.1.1 -non_windows_platforms := darwin_amd64 darwin_arm64 linux_amd64 linux_arm64 -non_windows_archives := $(non_windows_platforms:%=dist/wazero_$(VERSION)_%.tar.gz) -windows_platforms := windows_amd64 # TODO: add arm64 windows once we start testing on it. -windows_archives := $(windows_platforms:%=dist/wazero_$(VERSION)_%.zip) $(windows_platforms:%=dist/wazero_$(VERSION)_%.msi) -checksum_txt := dist/wazero_$(VERSION)_checksums.txt - -# define macros for multi-platform builds. these parse the filename being built -go-arch = $(if $(findstring amd64,$1),amd64,arm64) -go-os = $(if $(findstring .exe,$1),windows,$(if $(findstring linux,$1),linux,darwin)) -# msi-arch is a macro so we can detect it based on the file naming convention -msi-arch = $(if $(findstring amd64,$1),x64,arm64) - -build/wazero_%/wazero: - $(call go-build,$@,$<) - -build/wazero_%/wazero.exe: - $(call go-build,$@,$<) - -dist/wazero_$(VERSION)_%.tar.gz: build/wazero_%/wazero - @echo tar.gz "tarring $@" - @mkdir -p $(@D) -# On Windows, we pass the special flag `--mode='+rx' to ensure that we set the executable flag. -# This is only supported by GNU Tar, so we set it conditionally. - @tar -C $(> $(@F) - -dist: $(non_windows_archives) $(if $(findstring Windows_NT,$(OS)),$(windows_archives),) $(checksum_txt) diff --git a/vendor/github.com/tetratelabs/wazero/NOTICE b/vendor/github.com/tetratelabs/wazero/NOTICE deleted file mode 100644 index 2f5ea8ebf4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/NOTICE +++ /dev/null @@ -1,2 +0,0 @@ -wazero -Copyright 2020-2023 wazero authors diff --git a/vendor/github.com/tetratelabs/wazero/RATIONALE.md b/vendor/github.com/tetratelabs/wazero/RATIONALE.md deleted file mode 100644 index e5dff05db1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/RATIONALE.md +++ /dev/null @@ -1,1107 +0,0 @@ -# Notable rationale of wazero - -## Zero dependencies - -Wazero has zero dependencies to differentiate itself from other runtimes which -have heavy impact usually due to CGO. By avoiding CGO, wazero avoids -prerequisites such as shared libraries or libc, and lets users keep features -like cross compilation. - -Avoiding go.mod dependencies reduces interference on Go version support, and -size of a statically compiled binary. However, doing so brings some -responsibility into the project. - -Go's native platform support is good: We don't need platform-specific code to -get monotonic time, nor do we need much work to implement certain features -needed by our compiler such as `mmap`. That said, Go does not support all -common operating systems to the same degree. For example, Go 1.18 includes -`Mprotect` on Linux and Darwin, but not FreeBSD. - -The general tradeoff the project takes from a zero dependency policy is more -explicit support of platforms (in the compiler runtime), as well a larger and -more technically difficult codebase. - -At some point, we may allow extensions to supply their own platform-specific -hooks. Until then, one end user impact/tradeoff is some glitches trying -untested platforms (with the Compiler runtime). - -### Why do we use CGO to implement system calls on darwin? - -wazero is dependency and CGO free by design. In some cases, we have code that -can optionally use CGO, but retain a fallback for when that's disabled. The only -operating system (`GOOS`) we use CGO by default in is `darwin`. - -Unlike other operating systems, regardless of `CGO_ENABLED`, Go always uses -"CGO" mechanisms in the runtime layer of `darwin`. This is explained in -[Statically linked binaries on Mac OS X](https://developer.apple.com/library/archive/qa/qa1118/_index.html#//apple_ref/doc/uid/DTS10001666): - -> Apple does not support statically linked binaries on Mac OS X. A statically -> linked binary assumes binary compatibility at the kernel system call -> interface, and we do not make any guarantees on that front. Rather, we strive -> to ensure binary compatibility in each dynamically linked system library and -> framework. - -This plays to our advantage for system calls that aren't yet exposed in the Go -standard library, notably `futimens` for nanosecond-precision timestamp -manipulation. - -### Why not x/sys - -Going beyond Go's SDK limitations can be accomplished with their [x/sys library](https://pkg.go.dev/golang.org/x/sys/unix). -For example, this includes `zsyscall_freebsd_amd64.go` missing from the Go SDK. - -However, like all dependencies, x/sys is a source of conflict. For example, -x/sys had to be in order to upgrade to Go 1.18. - -If we depended on x/sys, we could get more precise functionality needed for -features such as clocks or more platform support for the compiler runtime. - -That said, formally supporting an operating system may still require testing as -even use of x/sys can require platform-specifics. For example, [mmap-go](https://github.com/edsrzf/mmap-go) -uses x/sys, but also mentions limitations, some not surmountable with x/sys -alone. - -Regardless, we may at some point introduce a separate go.mod for users to use -x/sys as a platform plugin without forcing all users to maintain that -dependency. - -## Project structure - -wazero uses internal packages extensively to balance API compatability desires for end users with the need to safely -share internals between compilers. - -End-user packages include `wazero`, with `Config` structs, `api`, with shared types, and the built-in `wasi` library. -Everything else is internal. - -We put the main program for wazero into a directory of the same name to match conventions used in `go install`, -notably the name of the folder becomes the binary name. We chose to use `cmd/wazero` as it is common practice -and less surprising than `wazero/wazero`. - -### Internal packages - -Most code in wazero is internal, and it is acknowledged that this prevents external implementation of facets such as -compilers or decoding. It also prevents splitting this code into separate repositories, resulting in a larger monorepo. -This also adds work as more code needs to be centrally reviewed. - -However, the alternative is neither secure nor viable. To allow external implementation would require exporting symbols -public, such as the `CodeSection`, which can easily create bugs. Moreover, there's a high drift risk for any attempt at -external implementations, compounded not just by wazero's code organization, but also the fast moving Wasm and WASI -specifications. - -For example, implementing a compiler correctly requires expertise in Wasm, Golang and assembly. This requires deep -insight into how internals are meant to be structured and the various tiers of testing required for `wazero` to result -in a high quality experience. Even if someone had these skills, supporting external code would introduce variables which -are constants in the central one. Supporting an external codebase is harder on the project team, and could starve time -from the already large burden on the central codebase. - -The tradeoffs of internal packages are a larger codebase and responsibility to implement all standard features. It also -implies thinking about extension more as forking is not viable for reasons above also. The primary mitigation of these -realities are friendly OSS licensing, high rigor and a collaborative spirit which aim to make contribution in the shared -codebase productive. - -### Avoiding cyclic dependencies - -wazero shares constants and interfaces with internal code by a sharing pattern described below: -* shared interfaces and constants go in one package under root: `api`. -* user APIs and structs depend on `api` and go into the root package `wazero`. - * e.g. `InstantiateModule` -> `/wasm.go` depends on the type `api.Module`. -* implementation code can also depend on `api` in a corresponding package under `/internal`. - * Ex package `wasm` -> `/internal/wasm/*.go` and can depend on the type `api.Module`. - -The above guarantees no cyclic dependencies at the cost of having to re-define symbols that exist in both packages. -For example, if `wasm.Store` is a type the user needs access to, it is narrowed by a cover type in the `wazero`: - -```go -type runtime struct { - s *wasm.Store -} -``` - -This is not as bad as it sounds as mutations are only available via configuration. This means exported functions are -limited to only a few functions. - -### Avoiding security bugs - -In order to avoid security flaws such as code insertion, nothing in the public API is permitted to write directly to any -mutable symbol in the internal package. For example, the package `api` is shared with internal code. To ensure -immutability, the `api` package cannot contain any mutable public symbol, such as a slice or a struct with an exported -field. - -In practice, this means shared functionality like memory mutation need to be implemented by interfaces. - -Here are some examples: -* `api.Memory` protects access by exposing functions like `WriteFloat64Le` instead of exporting a buffer (`[]byte`). -* There is no exported symbol for the `[]byte` representing the `CodeSection` - -Besides security, this practice prevents other bugs and allows centralization of validation logic such as decoding Wasm. - -## API Design - -### Why is `context.Context` inconsistent? - -It may seem strange that only certain API have an initial `context.Context` -parameter. We originally had a `context.Context` for anything that might be -traced, but it turned out to be only useful for lifecycle and host functions. - -For instruction-scoped aspects like memory updates, a context parameter is too -fine-grained and also invisible in practice. For example, most users will use -the compiler engine, and its memory, global or table access will never use go's -context. - -### Why does `api.ValueType` map to uint64? - -WebAssembly allows functions to be defined either by the guest or the host, -with signatures expressed as WebAssembly types. For example, `i32` is a 32-bit -type which might be interpreted as signed. Function signatures can have zero or -more parameters or results even if WebAssembly 1.0 allows up to one result. - -The guest can export functions, so that the host can call it. In the case of -wazero, the host is Go and an exported function can be called via -`api.Function`. `api.Function` allows users to supply parameters and read -results as a slice of uint64. For example, if there are no results, an empty -slice is returned. The user can learn the signature via `FunctionDescription`, -which returns the `api.ValueType` corresponding to each parameter or result. -`api.ValueType` defines the mapping of WebAssembly types to `uint64` values for -reason described in this section. The special case of `v128` is also mentioned -below. - -wazero maps each value type to a uint64 values because it holds the largest -type in WebAssembly 1.0 (i64). A slice allows you to express empty (e.g. a -nullary signature), for example a start function. - -Here's an example of calling a function, noting this syntax works for both a -signature `(param i32 i32) (result i32)` and `(param i64 i64) (result i64)` -```go -x, y := uint64(1), uint64(2) -results, err := mod.ExportedFunction("add").Call(ctx, x, y) -if err != nil { - log.Panicln(err) -} -fmt.Printf("%d + %d = %d\n", x, y, results[0]) -``` - -WebAssembly does not define an encoding strategy for host defined parameters or -results. This means the encoding rules above are defined by wazero instead. To -address this, we clarified mapping both in `api.ValueType` and added helper -functions like `api.EncodeF64`. This allows users conversions typical in Go -programming, and utilities to avoid ambiguity and edge cases around casting. - -Alternatively, we could have defined a byte buffer based approach and a binary -encoding of value types in and out. For example, an empty byte slice would mean -no values, while a non-empty could use a binary encoding for supported values. -This could work, but it is more difficult for the normal case of i32 and i64. -It also shares a struggle with the current approach, which is that value types -were added after WebAssembly 1.0 and not all of them have an encoding. More on -this below. - -In summary, wazero chose an approach for signature mapping because there was -none, and the one we chose biases towards simplicity with integers and handles -the rest with documentation and utilities. - -#### Post 1.0 value types - -Value types added after WebAssembly 1.0 stressed the current model, as some -have no encoding or are larger than 64 bits. While problematic, these value -types are not commonly used in exported (extern) functions. However, some -decisions were made and detailed below. - -For example `externref` has no guest representation. wazero chose to map -references to uint64 as that's the largest value needed to encode a pointer on -supported platforms. While there are two reference types, `externref` and -`functype`, the latter is an internal detail of function tables, and the former -is rarely if ever used in function signatures as of the end of 2022. - -The only value larger than 64 bits is used for SIMD (`v128`). Vectorizing via -host functions is not used as of the end of 2022. Even if it were, it would be -inefficient vs guest vectorization due to host function overhead. In other -words, the `v128` value type is unlikely to be in an exported function -signature. That it requires two uint64 values to encode is an internal detail -and not worth changing the exported function interface `api.Function`, as doing -so would break all users. - -### Interfaces, not structs - -All exported types in public packages, regardless of configuration vs runtime, are interfaces. The primary benefits are -internal flexibility and avoiding people accidentally mis-initializing by instantiating the types on their own vs using -the `NewXxx` constructor functions. In other words, there's less support load when things can't be done incorrectly. - -Here's an example: -```go -rt := &RuntimeConfig{} // not initialized properly (fields are nil which shouldn't be) -rt := RuntimeConfig{} // not initialized properly (should be a pointer) -rt := wazero.NewRuntimeConfig() // initialized properly -``` - -There are a few drawbacks to this, notably some work for maintainers. -* Interfaces are decoupled from the structs implementing them, which means the signature has to be repeated twice. -* Interfaces have to be documented and guarded at time of use, that 3rd party implementations aren't supported. -* As of Golang 1.18, interfaces are still [not well supported](https://github.com/golang/go/issues/5860) in godoc. - -## Config - -wazero configures scopes such as Runtime and Module using `XxxConfig` types. For example, `RuntimeConfig` configures -`Runtime` and `ModuleConfig` configure `Module` (instantiation). In all cases, config types begin defaults and can be -customized by a user, e.g., selecting features or a module name override. - -### Why don't we make each configuration setting return an error? -No config types create resources that would need to be closed, nor do they return errors on use. This helps reduce -resource leaks, and makes chaining easier. It makes it possible to parse configuration (ex by parsing yaml) independent -of validating it. - -Instead of: -``` -cfg, err = cfg.WithFS(fs) -if err != nil { - return err -} -cfg, err = cfg.WithName(name) -if err != nil { - return err -} -mod, err = rt.InstantiateModuleWithConfig(ctx, code, cfg) -if err != nil { - return err -} -``` - -There's only one call site to handle errors: -``` -cfg = cfg.WithFS(fs).WithName(name) -mod, err = rt.InstantiateModuleWithConfig(ctx, code, cfg) -if err != nil { - return err -} -``` - -This allows users one place to look for errors, and also the benefit that if anything internally opens a resource, but -errs, there's nothing they need to close. In other words, users don't need to track which resources need closing on -partial error, as that is handled internally by the only code that can read configuration fields. - -### Why are configuration immutable? -While it seems certain scopes like `Runtime` won't repeat within a process, they do, possibly in different goroutines. -For example, some users create a new runtime for each module, and some re-use the same base module configuration with -only small updates (ex the name) for each instantiation. Making configuration immutable allows them to be safely used in -any goroutine. - -Since config are immutable, changes apply via return val, similar to `append` in a slice. - -For example, both of these are the same sort of error: -```go -append(slice, element) // bug as only the return value has the updated slice. -cfg.WithName(next) // bug as only the return value has the updated name. -``` - -Here's an example of correct use: re-assigning explicitly or via chaining. -```go -cfg = cfg.WithName(name) // explicit - -mod, err = rt.InstantiateModuleWithConfig(ctx, code, cfg.WithName(name)) // implicit -if err != nil { - return err -} -``` - -### Why aren't configuration assigned with option types? -The option pattern is a familiar one in Go. For example, someone defines a type `func (x X) err` and uses it to update -the target. For example, you could imagine wazero could choose to make `ModuleConfig` from options vs chaining fields. - -Ex instead of: -```go -type ModuleConfig interface { - WithName(string) ModuleConfig - WithFS(fs.FS) ModuleConfig -} - -struct moduleConfig { - name string - fs fs.FS -} - -func (c *moduleConfig) WithName(name string) ModuleConfig { - ret := *c // copy - ret.name = name - return &ret -} - -func (c *moduleConfig) WithFS(fs fs.FS) ModuleConfig { - ret := *c // copy - ret.setFS("/", fs) - return &ret -} - -config := r.NewModuleConfig().WithFS(fs) -configDerived := config.WithName("name") -``` - -An option function could be defined, then refactor each config method into an name prefixed option function: -```go -type ModuleConfig interface { -} -struct moduleConfig { - name string - fs fs.FS -} - -type ModuleConfigOption func(c *moduleConfig) - -func ModuleConfigName(name string) ModuleConfigOption { - return func(c *moduleConfig) { - c.name = name - } -} - -func ModuleConfigFS(fs fs.FS) ModuleConfigOption { - return func(c *moduleConfig) { - c.fs = fs - } -} - -func (r *runtime) NewModuleConfig(opts ...ModuleConfigOption) ModuleConfig { - ret := newModuleConfig() // defaults - for _, opt := range opts { - opt(&ret.config) - } - return ret -} - -func (c *moduleConfig) WithOptions(opts ...ModuleConfigOption) ModuleConfig { - ret := *c // copy base config - for _, opt := range opts { - opt(&ret.config) - } - return ret -} - -config := r.NewModuleConfig(ModuleConfigFS(fs)) -configDerived := config.WithOptions(ModuleConfigName("name")) -``` - -wazero took the path of the former design primarily due to: -* interfaces provide natural namespaces for their methods, which is more direct than functions with name prefixes. -* parsing config into function callbacks is more direct vs parsing config into a slice of functions to do the same. -* in either case derived config is needed and the options pattern is more awkward to achieve that. - -There are other reasons such as test and debug being simpler without options: the above list is constrained to conserve -space. It is accepted that the options pattern is common in Go, which is the main reason for documenting this decision. - -### Why aren't config types deeply structured? -wazero's configuration types cover the two main scopes of WebAssembly use: -* `RuntimeConfig`: This is the broadest scope, so applies also to compilation - and instantiation. e.g. This controls the WebAssembly Specification Version. -* `ModuleConfig`: This affects modules instantiated after compilation and what - resources are allowed. e.g. This defines how or if STDOUT is captured. This - also allows sub-configuration of `FSConfig`. - -These default to a flat definition each, with lazy sub-configuration only after -proven to be necessary. A flat structure is easier to work with and is also -easy to discover. Unlike the option pattern described earlier, more -configuration in the interface doesn't taint the package namespace, only -`ModuleConfig`. - -We default to a flat structure to encourage simplicity. If we eagerly broke out -all possible configurations into sub-types (e.g. ClockConfig), it would be hard -to notice configuration sprawl. By keeping the config flat, it is easy to see -the cognitive load we may be adding to our users. - -In other words, discomfort adding more configuration is a feature, not a bug. -We should only add new configuration rarely, and before doing so, ensure it -will be used. In fact, this is why we support using context fields for -experimental configuration. By letting users practice, we can find out if a -configuration was a good idea or not before committing to it, and potentially -sprawling our types. - -In reflection, this approach worked well for the nearly 1.5 year period leading -to version 1.0. We've only had to create a single sub-configuration, `FSConfig`, -and it was well understood why when it occurred. - -## Why does InstantiateModule call "_start" by default? -We formerly had functions like `StartWASICommand` that would verify preconditions and start WASI's "_start" command. -However, this caused confusion because both many languages compiled a WASI dependency, and many did so inconsistently. - -That said, if "_start" isn't called, it causes issues in TinyGo, as it needs this in order to implement panic. To deal -with this a different way, we have a configuration to call any start functions that exist, which defaults to "_start". - -## Runtime == Engine+Store -wazero defines a single user-type which combines the specification concept of `Store` with the unspecified `Engine` -which manages them. - -### Why not multi-store? -Multi-store isn't supported as the extra tier complicates lifecycle and locking. Moreover, in practice it is unusual for -there to be an engine that has multiple stores which have multiple modules. More often, it is the case that there is -either 1 engine with 1 store and multiple modules, or 1 engine with many stores, each having 1 non-host module. In worst -case, a user can use multiple runtimes until "multi-store" is better understood. - -If later, we have demand for multiple stores, that can be accomplished by overload. e.g. `Runtime.InstantiateInStore` or -`Runtime.Store(name) Store`. - -## wazeroir -wazero's intermediate representation (IR) is called `wazeroir`. Lowering into an IR provides us a faster interpreter -and a closer to assembly representation for used by our compiler. - -### Intermediate Representation (IR) design -`wazeroir`'s initial design borrowed heavily from the defunct `microwasm` format (a.k.a. LightbeamIR). Notably, -`wazeroir` doesn't have block operations: this simplifies the implementation. - -Note: `microwasm` was never specified formally, and only exists in a historical codebase of wasmtime: -https://github.com/bytecodealliance/wasmtime/blob/v0.29.0/crates/lightbeam/src/microwasm.rs - -## Exit - -### Why do we return a `sys.ExitError` on exit code zero? - -It may be surprising to find an error returned on success (exit code zero). -This can be explained easier when you think of function returns: When results -aren't empty, then you must return an error. This is trickier to explain when -results are empty, such as the case in the "_start" function in WASI. - -The main rationale for returning an exit error even if the code is success is -that the module is no longer functional. For example, function exports would -error later. In cases like these, it is better to handle errors where they -occur. - -Luckily, it is not common to exit a module during the "_start" function. For -example, the only known compilation target that does this is Emscripten. Most, -such as Rust, TinyGo, or normal wasi-libc, don't. If they did, it would -invalidate their function exports. This means it is unlikely most compilers -will change this behavior. - -In summary, we return a `sys.ExitError` to the caller whenever we get it, as it -properly reflects the state of the module, which would be closed on this error. - -### Why panic with `sys.ExitError` after a host function exits? - -Currently, the only portable way to stop processing code is via panic. For -example, WebAssembly "trap" instructions, such as divide by zero, are -implemented via panic. This ensures code isn't executed after it. - -When code reaches the WASI `proc_exit` instruction, we need to stop processing. -Regardless of the exit code, any code invoked after exit would be in an -inconsistent state. This is likely why unreachable instructions are sometimes -inserted after exit: https://github.com/emscripten-core/emscripten/issues/12322 - -## WASI - -Unfortunately, (WASI Snapshot Preview 1)[https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md] is not formally defined enough, and has APIs with ambiguous semantics. -This section describes how Wazero interprets and implements the semantics of several WASI APIs that may be interpreted differently by different wasm runtimes. -Those APIs may affect the portability of a WASI application. - -### Why don't we attempt to pass wasi-testsuite on user-defined `fs.FS`? - -While most cases work fine on an `os.File` based implementation, we won't -promise wasi-testsuite compatibility on user defined wrappers of `os.DirFS`. -The only option for real systems is to use our `sysfs.FS`. - -There are a lot of areas where windows behaves differently, despite the -`os.File` abstraction. This goes well beyond file locking concerns (e.g. -`EBUSY` errors on open files). For example, errors like `ACCESS_DENIED` aren't -properly mapped to `EPERM`. There are trickier parts too. `FileInfo.Sys()` -doesn't return enough information to build inodes needed for WASI. To rebuild -them requires the full path to the underlying file, not just its directory -name, and there's no way for us to get that information. At one point we tried, -but in practice things became tangled and functionality such as read-only -wrappers became untenable. Finally, there are version-specific behaviors which -are difficult to maintain even in our own code. For example, go 1.20 opens -files in a different way than versions before it. - -### Why aren't WASI rules enforced? - -The [snapshot-01](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md) version of WASI has a -number of rules for a "command module", but only the memory export rule is enforced. If a "_start" function exists, it -is enforced to be the correct signature and succeed, but the export itself isn't enforced. It follows that this means -exports are not required to be contained to a "_start" function invocation. Finally, the "__indirect_function_table" -export is also not enforced. - -The reason for the exceptions are that implementations aren't following the rules. For example, TinyGo doesn't export -"__indirect_function_table", so crashing on this would make wazero unable to run TinyGo modules. Similarly, modules -loaded by wapc-go don't always define a "_start" function. Since "snapshot-01" is not a proper version, and certainly -not a W3C recommendation, there's no sense in breaking users over matters like this. - -### Why is I/O configuration not coupled to WASI? - -WebAssembly System Interfaces (WASI) is a formalization of a practice that can be done anyway: Define a host function to -access a system interface, such as writing to STDOUT. WASI stalled at snapshot-01 and as of early 2023, is being -rewritten entirely. - -This instability implies a need to transition between WASI specs, which places wazero in a position that requires -decoupling. For example, if code uses two different functions to call `fd_write`, the underlying configuration must be -centralized and decoupled. Otherwise, calls using the same file descriptor number will end up writing to different -places. - -In short, wazero defined system configuration in `ModuleConfig`, not a WASI type. This allows end-users to switch from -one spec to another with minimal impact. This has other helpful benefits, as centralized resources are simpler to close -coherently (ex via `Module.Close`). - -In reflection, this worked well as more ABI became usable in wazero. For example, `GOARCH=wasm GOOS=js` code uses the -same `ModuleConfig` (and `FSConfig`) WASI uses, and in compatible ways. - -### Background on `ModuleConfig` design - -WebAssembly 1.0 (20191205) specifies some aspects to control isolation between modules ([sandboxing](https://en.wikipedia.org/wiki/Sandbox_(computer_security))). -For example, `wasm.Memory` has size constraints and each instance of it is isolated from each other. While `wasm.Memory` -can be shared, by exporting it, it is not exported by default. In fact a WebAssembly Module (Wasm) has no memory by -default. - -While memory is defined in WebAssembly 1.0 (20191205), many aspects are not. Let's use an example of `exec.Cmd` as for -example, a WebAssembly System Interfaces (WASI) command is implemented as a module with a `_start` function, and in many -ways acts similar to a process with a `main` function. - -To capture "hello world" written to the console (stdout a.k.a. file descriptor 1) in `exec.Cmd`, you would set the -`Stdout` field accordingly, perhaps to a buffer. In WebAssembly 1.0 (20191205), the only way to perform something like -this is via a host function (ex `HostModuleFunctionBuilder`) and internally copy memory corresponding to that string -to a buffer. - -WASI implements system interfaces with host functions. Concretely, to write to console, a WASI command `Module` imports -"fd_write" from "wasi_snapshot_preview1" and calls it with the `fd` parameter set to 1 (STDOUT). - -The [snapshot-01](https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md) version of WASI has no -means to declare configuration, although its function definitions imply configuration for example if fd 1 should exist, -and if so where should it write. Moreover, snapshot-01 was last updated in late 2020 and the specification is being -completely rewritten as of early 2022. This means WASI as defined by "snapshot-01" will not clarify aspects like which -file descriptors are required. While it is possible a subsequent version may, it is too early to tell as no version of -WASI has reached a stage near W3C recommendation. Even if it did, module authors are not required to only use WASI to -write to console, as they can define their own host functions, such as they did before WASI existed. - -wazero aims to serve Go developers as a primary function, and help them transition between WASI specifications. In -order to do this, we have to allow top-level configuration. To ensure isolation by default, `ModuleConfig` has WithXXX -that override defaults to no-op or empty. One `ModuleConfig` instance is used regardless of how many times the same WASI -functions are imported. The nil defaults allow safe concurrency in these situations, as well lower the cost when they -are never used. Finally, a one-to-one mapping with `Module` allows the module to close the `ModuleConfig` instead of -confusing users with another API to close. - -Naming, defaults and validation rules of aspects like `STDIN` and `Environ` are intentionally similar to other Go -libraries such as `exec.Cmd` or `syscall.SetEnv`, and differences called out where helpful. For example, there's no goal -to emulate any operating system primitive specific to Windows (such as a 'c:\' drive). Moreover, certain defaults -working with real system calls are neither relevant nor safe to inherit: For example, `exec.Cmd` defaults to read STDIN -from a real file descriptor ("/dev/null"). Defaulting to this, vs reading `io.EOF`, would be unsafe as it can exhaust -file descriptors if resources aren't managed properly. In other words, blind copying of defaults isn't wise as it can -violate isolation or endanger the embedding process. In summary, we try to be similar to normal Go code, but often need -act differently and document `ModuleConfig` is more about emulating, not necessarily performing real system calls. - -## File systems - -### Why doesn't wazero implement the working directory? - -An early design of wazero's API included a `WithWorkDirFS` which allowed -control over which file a relative path such as "./config.yml" resolved to, -independent of the root file system. This intended to help separate concerns -like mutability of files, but it didn't work and was removed. - -Compilers that target wasm act differently with regard to the working -directory. For example, while `GOOS=js` uses host functions to track the -working directory, WASI host functions do not. wasi-libc, used by TinyGo, -tracks working directory changes in compiled wasm instead: initially "/" until -code calls `chdir`. Zig assumes the first pre-opened file descriptor is the -working directory. - -The only place wazero can standardize a layered concern is via a host function. -Since WASI doesn't use host functions to track the working directory, we can't -standardize the storage and initial value of it. - -Meanwhile, code may be able to affect the working directory by compiling -`chdir` into their main function, using an argument or ENV for the initial -value (possibly `PWD`). Those unable to control the compiled code should only -use absolute paths in configuration. - -See -* https://github.com/golang/go/blob/go1.20/src/syscall/fs_js.go#L324 -* https://github.com/WebAssembly/wasi-libc/pull/214#issue-673090117 -* https://github.com/ziglang/zig/blob/53a9ee699a35a3d245ab6d1dac1f0687a4dcb42c/src/main.zig#L32 - -### Why ignore the error returned by io.Reader when n > 1? - -Per https://pkg.go.dev/io#Reader, if we receive an error, any bytes read should -be processed first. At the syscall abstraction (`fd_read`), the caller is the -processor, so we can't process the bytes inline and also return the error (as -`EIO`). - -Let's assume we want to return the bytes read on error to the caller. This -implies we at least temporarily ignore the error alongside them. The choice -remaining is whether to persist the error returned with the read until a -possible next call, or ignore the error. - -If we persist an error returned, it would be coupled to a file descriptor, but -effectively it is boolean as this case coerces to `EIO`. If we track a "last -error" on a file descriptor, it could be complicated for a couple reasons -including whether the error is transient or permanent, or if the error would -apply to any FD operation, or just read. Finally, there may never be a -subsequent read as perhaps the bytes leading up to the error are enough to -satisfy the processor. - -This decision boils down to whether or not to track an error bit per file -descriptor or not. If not, the assumption is that a subsequent operation would -also error, this time without reading any bytes. - -The current opinion is to go with the simplest path, which is to return the -bytes read and ignore the error the there were any. Assume a subsequent -operation will err if it needs to. This helps reduce the complexity of the code -in wazero and also accommodates the scenario where the bytes read are enough to -satisfy its processor. - -### File descriptor allocation strategy - -File descriptor allocation currently uses a strategy similar the one implemented -by unix systems: when opening a file, the lowest unused number is picked. - -The WASI standard documents that programs cannot expect that file descriptor -numbers will be allocated with a lowest-first strategy, and they should instead -assume the values will be random. Since _random_ is a very imprecise concept in -computers, we technically satisfying the implementation with the descriptor -allocation strategy we use in Wazero. We could imagine adding more _randomness_ -to the descriptor selection process, however this should never be used as a -security measure to prevent applications from guessing the next file number so -there are no strong incentives to complicate the logic. - -### Why does `FSConfig.WithDirMount` not match behaviour with `os.DirFS`? - -It may seem that we should require any feature that seems like a standard -library in Go, to behave the same way as the standard library. Doing so would -present least surprise to Go developers. In the case of how we handle -filesystems, we break from that as it is incompatible with the expectations of -WASI, the most commonly implemented filesystem ABI. - -The main reason is that `os.DirFS` is a virtual filesystem abstraction while -WASI is an abstraction over syscalls. For example, the signature of `fs.Open` -does not permit use of flags. This creates conflict on what default behaviors -to take when Go implemented `os.DirFS`. On the other hand, `path_open` can pass -flags, and in fact tests require them to be honored in specific ways. This -extends beyond WASI as even `GOARCH=wasm GOOS=js` compiled code requires -certain flags passed to `os.OpenFile` which are impossible to pass due to the -signature of `fs.FS`. - -This conflict requires us to choose what to be more compatible with, and which -type of user to surprise the least. We assume there will be more developers -compiling code to wasm than developers of custom filesystem plugins, and those -compiling code to wasm will be better served if we are compatible with WASI. -Hence on conflict, we prefer WASI behavior vs the behavior of `os.DirFS`. - -Meanwhile, it is possible that Go will one day compile to `GOOS=wasi` in -addition to `GOOS=js`. When there is shared stake in WASI, we expect gaps like -these to be easier to close. - -See https://github.com/WebAssembly/wasi-testsuite -See https://github.com/golang/go/issues/58141 - -### fd_pread: io.Seeker fallback when io.ReaderAt is not supported - -`ReadAt` is the Go equivalent to `pread`: it does not affect, and is not -affected by, the underlying file offset. Unfortunately, `io.ReaderAt` is not -implemented by all `fs.File`. For example, as of Go 1.19, `embed.openFile` does -not. - -The initial implementation of `fd_pread` instead used `Seek`. To avoid a -regression, we fall back to `io.Seeker` when `io.ReaderAt` is not supported. - -This requires obtaining the initial file offset, seeking to the intended read -offset, and resetting the file offset the initial state. If this final seek -fails, the file offset is left in an undefined state. This is not thread-safe. - -While seeking per read seems expensive, the common case of `embed.openFile` is -only accessing a single int64 field, which is cheap. - -### Pre-opened files - -WASI includes `fd_prestat_get` and `fd_prestat_dir_name` functions used to -learn any directory paths for file descriptors open at initialization time. - -For example, `__wasilibc_register_preopened_fd` scans any file descriptors past -STDERR (1) and invokes `fd_prestat_dir_name` to learn any path prefixes they -correspond to. Zig's `preopensAlloc` does similar. These pre-open functions are -not used again after initialization. - -wazero supports stdio pre-opens followed by any mounts e.g `.:/`. The guest -path is a directory and its name, e.g. "/" is returned by `fd_prestat_dir_name` -for file descriptor 3 (STDERR+1). The first longest match wins on multiple -pre-opens, which allows a path like "/tmp" to match regardless of order vs "/". - -See - * https://github.com/WebAssembly/wasi-libc/blob/a02298043ff551ce1157bc2ee7ab74c3bffe7144/libc-bottom-half/sources/preopens.c - * https://github.com/ziglang/zig/blob/9cb06f3b8bf9ea6b5e5307711bc97328762d6a1d/lib/std/fs/wasi.zig#L50-L53 - -### fd_prestat_dir_name - -`fd_prestat_dir_name` is a WASI function to return the path of the pre-opened -directory of a file descriptor. It has the following three parameters, and the -third `path_len` has ambiguous semantics. - -* `fd`: a file descriptor -* `path`: the offset for the result path -* `path_len`: In wazero, `FdPrestatDirName` writes the result path string to - `path` offset for the exact length of `path_len`. - -Wasmer considers `path_len` to be the maximum length instead of the exact -length that should be written. -See https://github.com/wasmerio/wasmer/blob/3463c51268ed551933392a4063bd4f8e7498b0f6/lib/wasi/src/syscalls/mod.rs#L764 - -The semantics in wazero follows that of wasmtime. -See https://github.com/bytecodealliance/wasmtime/blob/2ca01ae9478f199337cf743a6ab543e8c3f3b238/crates/wasi-common/src/snapshots/preview_1.rs#L578-L582 - -Their semantics match when `path_len` == the length of `path`, so in practice -this difference won't matter match. - -## Why does fd_readdir not include dot (".") and dot-dot ("..") entries? - -When reading a directory, wazero code does not return dot (".") and dot-dot -("..") entries. The main reason is that Go does not return them from -`os.ReadDir`, and materializing them is complicated (at least dot-dot is). - -A directory entry has stat information in it. The stat information includes -inode which is used for comparing file equivalence. In the simple case of dot, -we could materialize a special entry to expose the same info as stat on the fd -would return. However, doing this and not doing dot-dot would cause confusion, -and dot-dot is far more tricky. To back-fill inode information about a parent -directory would be costly and subtle. For example, the pre-open (mount) of the -directory may be different than its logical parent. This is easy to understand -when considering the common case of mounting "/" and "/tmp" as pre-opens. To -implement ".." from "/tmp" requires information from a separate pre-open, this -includes state to even know the difference. There are easier edge cases as -well, such as the decision to not return ".." from a root path. In any case, -this should start to explain that faking entries when underlying stdlib doesn't -return them is tricky and requires quite a lot of state. - -Even if we did that, it would cause expense to all users of wazero, so we'd -then look to see if that would be justified or not. However, the most common -compilers involved in end user questions, as of early 2023 are TinyGo, Rust and -Zig. All of these compile code which ignores dot and dot-dot entries. In other -words, faking these entries would not only cost our codebase with complexity, -but it would also add unnecessary overhead as the values aren't commonly used. - -The final reason why we might do this, is an end users or a specification -requiring us to. As of early 2023, no end user has raised concern over Go and -by extension wazero not returning dot and dot-dot. The snapshot-01 spec of WASI -does not mention anything on this point. Also, POSIX has the following to say, -which summarizes to "these are optional" - -> The readdir() function shall not return directory entries containing empty names. If entries for dot or dot-dot exist, one entry shall be returned for dot and one entry shall be returned for dot-dot; otherwise, they shall not be returned. - -In summary, wazero not only doesn't return dot and dot-dot entries because Go -doesn't and emulating them in spite of that would result in no difference -except hire overhead to the majority of our users. - -See https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html -See https://github.com/golang/go/blob/go1.20/src/os/dir_unix.go#L108-L110 - -## sys.Walltime and Nanotime - -The `sys` package has two function types, `Walltime` and `Nanotime` for real -and monotonic clock exports. The naming matches conventions used in Go. - -```go -func time_now() (sec int64, nsec int32, mono int64) { - sec, nsec = walltime() - return sec, nsec, nanotime() -} -``` - -Splitting functions for wall and clock time allow implementations to choose -whether to implement the clock once (as in Go), or split them out. - -Each can be configured with a `ClockResolution`, although is it usually -incorrect as detailed in a sub-heading below. The only reason for exposing this -is to satisfy WASI: - -See https://github.com/WebAssembly/wasi-clocks - -### Why default to fake time? - -WebAssembly has an implicit design pattern of capabilities based security. By -defaulting to a fake time, we reduce the chance of timing attacks, at the cost -of requiring configuration to opt-into real clocks. - -See https://gruss.cc/files/fantastictimers.pdf for an example attacks. - -### Why does fake time increase on reading? - -Both the fake nanotime and walltime increase by 1ms on reading. Particularly in -the case of nanotime, this prevents spinning. For example, when Go compiles -`time.Sleep` using `GOOS=js GOARCH=wasm`, nanotime is used in a loop. If that -never increases, the gouroutine is mistaken for being busy. This would be worse -if a compiler implement sleep using nanotime, yet doesn't check for spinning! - -### Why not `time.Clock`? - -wazero can't use `time.Clock` as a plugin for clock implementation as it is -only substitutable with build flags (`faketime`) and conflates wall and -monotonic time in the same call. - -Go's `time.Clock` was added monotonic time after the fact. For portability with -prior APIs, a decision was made to combine readings into the same API call. - -See https://go.googlesource.com/proposal/+/master/design/12914-monotonic.md - -WebAssembly time imports do not have the same concern. In fact even Go's -imports for clocks split walltime from nanotime readings. - -See https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L243-L255 - -Finally, Go's clock is not an interface. WebAssembly users who want determinism -or security need to be able to substitute an alternative clock implementation -from the host process one. - -### `ClockResolution` - -A clock's resolution is hardware and OS dependent so requires a system call to retrieve an accurate value. -Go does not provide a function for getting resolution, so without CGO we don't have an easy way to get an actual -value. For now, we return fixed values of 1us for realtime and 1ns for monotonic, assuming that realtime clocks are -often lower precision than monotonic clocks. In the future, this could be improved by having OS+arch specific assembly -to make syscalls. - -For example, Go implements time.Now for linux-amd64 with this [assembly](https://github.com/golang/go/blob/go1.20/src/runtime/time_linux_amd64.s). -Because retrieving resolution is not generally called often, unlike getting time, it could be appropriate to only -implement the fallback logic that does not use VDSO (executing syscalls in user mode). The syscall for clock_getres -is 229 and should be usable. https://pkg.go.dev/syscall#pkg-constants. - -If implementing similar for Windows, [mingw](https://github.com/mirror/mingw-w64/blob/6a0e9165008f731bccadfc41a59719cf7c8efc02/mingw-w64-libraries/winpthreads/src/clock.c#L77 -) is often a good source to find the Windows API calls that correspond -to a POSIX method. - -Writing assembly would allow making syscalls without CGO, but comes with the cost that it will require implementations -across many combinations of OS and architecture. - -## sys.Nanosleep - -All major programming languages have a `sleep` mechanism to block for a -duration. Sleep is typically implemented by a WASI `poll_oneoff` relative clock -subscription. - -For example, the below ends up calling `wasi_snapshot_preview1.poll_oneoff`: - -```zig -const std = @import("std"); -pub fn main() !void { - std.time.sleep(std.time.ns_per_s * 5); -} -``` - -Besides Zig, this is also the case with TinyGo (`-target=wasi`) and Rust -(`--target wasm32-wasi`). This isn't the case with Go (`GOOS=js GOARCH=wasm`), -though. In the latter case, wasm loops on `sys.Nanotime`. - -We decided to expose `sys.Nanosleep` to allow overriding the implementation -used in the common case, even if it isn't used by Go, because this gives an -easy and efficient closure over a common program function. We also documented -`sys.Nanotime` to warn users that some compilers don't optimize sleep. - -## sys.Osyield - -We expose `sys.Osyield`, to allow users to control the behavior of WASI's -`sched_yield` without a new build of wazero. This is mainly for parity with -all other related features which we allow users to implement, including -`sys.Nanosleep`. Unlike others, we don't provide an out-of-box implementation -primarily because it will cause performance problems when accessed. - -For example, the below implementation uses CGO, which might result in a 1us -delay per invocation depending on the platform. - -See https://github.com/golang/go/issues/19409#issuecomment-284788196 -```go -//go:noescape -//go:linkname osyield runtime.osyield -func osyield() -``` - -In practice, a request to customize this is unlikely to happen until other -thread based functions are implemented. That said, as of early 2023, there are -a few signs of implementation interest and cross-referencing: - -See https://github.com/WebAssembly/stack-switching/discussions/38 -See https://github.com/WebAssembly/wasi-threads#what-can-be-skipped -See https://slinkydeveloper.com/Kubernetes-controllers-A-New-Hope/ - -## poll_oneoff - -`poll_oneoff` is a WASI API for waiting for I/O events on multiple handles. -It is conceptually similar to the POSIX `poll(2)` syscall. -The name is not `poll`, because it references [“the fact that this function is not efficient -when used repeatedly with the same large set of handles”][poll_oneoff]. - -We chose to support this API in a handful of cases that work for regular files -and standard input. We currently do not support other types of file descriptors such -as socket handles. - -### Clock Subscriptions - -As detailed above in [sys.Nanosleep](#sysnanosleep), `poll_oneoff` handles -relative clock subscriptions. In our implementation we use `sys.Nanosleep()` -for this purpose in most cases, except when polling for interactive input -from `os.Stdin` (see more details below). - -### FdRead and FdWrite Subscriptions - -When subscribing a file descriptor (except `Stdin`) for reads or writes, -the implementation will generally return immediately with success, unless -the file descriptor is unknown. The file descriptor is not checked further -for new incoming data. Any timeout is cancelled, and the API call is able -to return, unless there are subscriptions to `Stdin`: these are handled -separately. - -### FdRead and FdWrite Subscription to Stdin - -Subscribing `Stdin` for reads (writes make no sense and cause an error), -requires extra care: wazero allows to configure a custom reader for `Stdin`. - -In general, if a custom reader is found, the behavior will be the same -as for regular file descriptors: data is assumed to be present and -a success is written back to the result buffer. - -However, if the reader is detected to read from `os.Stdin`, -a special code path is followed, invoking `platform.Select()`. - -`platform.Select()` is a wrapper for `select(2)` on POSIX systems, -and it is mocked for a handful of cases also on Windows. - -### Select on POSIX - -On POSIX systems,`select(2)` allows to wait for incoming data on a file -descriptor, and block until either data becomes available or the timeout -expires. It is not surprising that `select(2)` and `poll(2)` have lot in common: -the main difference is how the file descriptor parameters are passed. - -Usage of `platform.Select()` is only reserved for the standard input case, because - -1. it is really only necessary to handle interactive input: otherwise, - there is no way in Go to peek from Standard Input without actually - reading (and thus consuming) from it; - -2. if `Stdin` is connected to a pipe, it is ok in most cases to return - with success immediately; - -3. `platform.Select()` is currently a blocking call, irrespective of goroutines, - because the underlying syscall is; thus, it is better to limit its usage. - -So, if the subscription is for `os.Stdin` and the handle is detected -to correspond to an interactive session, then `platform.Select()` will be -invoked with a the `Stdin` handle *and* the timeout. - -This also means that in this specific case, the timeout is uninterruptible, -unless data becomes available on `Stdin` itself. - -### Select on Windows - -On Windows the `platform.Select()` is much more straightforward, -and it really just replicates the behavior found in the general cases -for `FdRead` subscriptions: in other words, the subscription to `Stdin` -is immediately acknowledged. - -The implementation also support a timeout, but in this case -it relies on `time.Sleep()`, which notably, as compared to the POSIX -case, interruptible and compatible with goroutines. - -However, because `Stdin` subscriptions are always acknowledged -without wait and because this code path is always followed only -when at least one `Stdin` subscription is present, then the -timeout is effectively always handled externally. - -In any case, the behavior of `platform.Select` on Windows -is sensibly different from the behavior on POSIX platforms; -we plan to refine and further align it in semantics in the future. - -[poll_oneoff]: https://github.com/WebAssembly/wasi-poll#why-is-the-function-called-poll_oneoff - -## Signed encoding of integer global constant initializers - -wazero treats integer global constant initializers signed as their interpretation is not known at declaration time. For -example, there is no signed integer [value type](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#value-types%E2%91%A0). - -To get at the problem, let's use an example. -``` -(global (export "start_epoch") i64 (i64.const 1620216263544)) -``` - -In both signed and unsigned LEB128 encoding, this value is the same bit pattern. The problem is that some numbers are -not. For example, 16256 is `807f` encoded as unsigned, but `80ff00` encoded as signed. - -While the specification mentions uninterpreted integers are in abstract [unsigned values](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#integers%E2%91%A0), -the binary encoding is clear that they are encoded [signed](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#integers%E2%91%A4). - -For consistency, we go with signed encoding in the special case of global constant initializers. - -## Implementation limitations - -WebAssembly 1.0 (20191205) specification allows runtimes to [limit certain aspects of Wasm module or execution](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#a2-implementation-limitations). - -wazero limitations are imposed pragmatically and described below. - -### Number of functions in a module - -The possible number of function instances in [a module](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#module-instances%E2%91%A0) is not specified in the WebAssembly specifications since [`funcaddr`](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#syntax-funcaddr) corresponding to a function instance in a store can be arbitrary number. -wazero limits the maximum function instances to 2^27 as even that number would occupy 1GB in function pointers. - -That is because not only we _believe_ that all use cases are fine with the limitation, but also we have no way to test wazero runtimes under these unusual circumstances. - -### Number of function types in a store - -There's no limitation on the number of function types in [a store](https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#store%E2%91%A0) according to the spec. In wazero implementation, we assign each function type to a unique ID, and choose to use `uint32` to represent the IDs. -Therefore the maximum number of function types a store can have is limited to 2^27 as even that number would occupy 512MB just to reference the function types. - -This is due to the same reason for the limitation on the number of functions above. - -### Number of values on the stack in a function - -While the the spec does not clarify a limitation of function stack values, wazero limits this to 2^27 = 134,217,728. -The reason is that we internally represent all the values as 64-bit integers regardless of its types (including f32, f64), and 2^27 values means -1 GiB = (2^30). 1 GiB is the reasonable for most applications [as we see a Goroutine has 250 MB as a limit on the stack for 32-bit arch](https://github.com/golang/go/blob/go1.20/src/runtime/proc.go#L152-L159), considering that WebAssembly is (currently) 32-bit environment. - -All the functions are statically analyzed at module instantiation phase, and if a function can potentially reach this limit, an error is returned. - -### Number of globals in a module - -Theoretically, a module can declare globals (including imports) up to 2^32 times. However, wazero limits this to 2^27(134,217,728) per module. -That is because internally we store globals in a slice with pointer types (meaning 8 bytes on 64-bit platforms), and therefore 2^27 globals -means that we have 1 GiB size of slice which seems large enough for most applications. - -### Number of tables in a module - -While the the spec says that a module can have up to 2^32 tables, wazero limits this to 2^27 = 134,217,728. -One of the reasons is even that number would occupy 1GB in the pointers tables alone. Not only that, we access tables slice by -table index by using 32-bit signed offset in the compiler implementation, which means that the table index of 2^27 can reach 2^27 * 8 (pointer size on 64-bit machines) = 2^30 offsets in bytes. - -We _believe_ that all use cases are fine with the limitation, but also note that we have no way to test wazero runtimes under these unusual circumstances. - -If a module reaches this limit, an error is returned at the compilation phase. - -## Compiler engine implementation - -See [compiler/RATIONALE.md](internal/engine/compiler/RATIONALE.md). - -## Golang patterns - -### Hammer tests -Code that uses concurrency primitives, such as locks or atomics, should include "hammer tests", which run large loops -inside a bounded amount of goroutines, run by half that many `GOMAXPROCS`. These are named consistently "hammer", so -they are easy to find. The name inherits from some existing tests in [golang/go](https://github.com/golang/go/search?q=hammer&type=code). - -Here is an annotated description of the key pieces of a hammer test: -1. `P` declares the count of goroutines to use, defaulting to 8 or 4 if `testing.Short`. - * Half this amount are the cores used, and 4 is less than a modern laptop's CPU. This allows multiple "hammer" tests to run in parallel. -2. `N` declares the scale of work (loop) per goroutine, defaulting to value that finishes in ~0.1s on a modern laptop. - * When in doubt, try 1000 or 100 if `testing.Short` - * Remember, there are multiple hammer tests and CI nodes are slow. Slower tests hurt feedback loops. -3. `defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(P/2))` makes goroutines switch cores, testing visibility of shared data. -4. To ensure goroutines execute at the same time, block them with `sync.WaitGroup`, initialized to `Add(P)`. - * `sync.WaitGroup` internally uses `runtime_Semacquire` not available in any other library. - * `sync.WaitGroup.Add` with a negative value can unblock many goroutines at the same time, e.g. without a for loop. -5. Track goroutines progress via `finished := make(chan int)` where each goroutine in `P` defers `finished <- 1`. - 1. Tests use `require.XXX`, so `recover()` into `t.Fail` in a `defer` function before `finished <- 1`. - * This makes it easier to spot larger concurrency problems as you see each failure, not just the first. - 2. After the `defer` function, await unblocked, then run the stateful function `N` times in a normal loop. - * This loop should trigger shared state problems as locks or atomics are contended by `P` goroutines. -6. After all `P` goroutines launch, atomically release all of them with `WaitGroup.Add(-P)`. -7. Block the runner on goroutine completion, by (`<-finished`) for each `P`. -8. When all goroutines complete, `return` if `t.Failed()`, otherwise perform follow-up state checks. - -This is implemented in wazero in [hammer.go](internal/testing/hammer/hammer.go) - -### Lock-free, cross-goroutine observations of updates - -How to achieve cross-goroutine reads of a variable are not explicitly defined in https://go.dev/ref/mem. wazero uses -atomics to implement this following unofficial practice. For example, a `Close` operation can be guarded to happen only -once via compare-and-swap (CAS) against a zero value. When we use this pattern, we consistently use atomics to both -read and update the same numeric field. - -In lieu of formal documentation, we infer this pattern works from other sources (besides tests): - * `sync.WaitGroup` by definition must support calling `Add` from other goroutines. Internally, it uses atomics. - * rsc in golang/go#5045 writes "atomics guarantee sequential consistency among the atomic variables". - -See https://github.com/golang/go/blob/go1.20/src/sync/waitgroup.go#L64 -See https://github.com/golang/go/issues/5045#issuecomment-252730563 -See https://www.youtube.com/watch?v=VmrEG-3bWyM diff --git a/vendor/github.com/tetratelabs/wazero/README.md b/vendor/github.com/tetratelabs/wazero/README.md deleted file mode 100644 index f547d22577..0000000000 --- a/vendor/github.com/tetratelabs/wazero/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# wazero: the zero dependency WebAssembly runtime for Go developers - -[![WebAssembly Core Specification Test](https://github.com/tetratelabs/wazero/actions/workflows/spectest.yaml/badge.svg)](https://github.com/tetratelabs/wazero/actions/workflows/spectest.yaml) [![Go Reference](https://pkg.go.dev/badge/github.com/tetratelabs/wazero.svg)](https://pkg.go.dev/github.com/tetratelabs/wazero) [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - -WebAssembly is a way to safely run code compiled in other languages. Runtimes -execute WebAssembly Modules (Wasm), which are most often binaries with a `.wasm` -extension. - -wazero is a WebAssembly Core Specification [1.0][1] and [2.0][2] compliant -runtime written in Go. It has *zero dependencies*, and doesn't rely on CGO. -This means you can run applications in other languages and still keep cross -compilation. - -Import wazero and extend your Go application with code written in any language! - -## Example - -The best way to learn wazero is by trying one of our [examples](examples/README.md). The -most [basic example](examples/basic) extends a Go application with an addition -function defined in WebAssembly. - -## Runtime - -There are two runtime configurations supported in wazero: _Compiler_ is default: - -By default, ex `wazero.NewRuntime(ctx)`, the Compiler is used if supported. You -can also force the interpreter like so: -```go -r := wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfigInterpreter()) -``` - -### Interpreter -Interpreter is a naive interpreter-based implementation of Wasm virtual -machine. Its implementation doesn't have any platform (GOARCH, GOOS) specific -code, therefore _interpreter_ can be used for any compilation target available -for Go (such as `riscv64`). - -### Compiler -Compiler compiles WebAssembly modules into machine code ahead of time (AOT), -during `Runtime.CompileModule`. This means your WebAssembly functions execute -natively at runtime. Compiler is faster than Interpreter, often by order of -magnitude (10x) or more. This is done without host-specific dependencies. - -If interested, check out the [RATIONALE.md][8] and help us optimize further! - -### Conformance - -Both runtimes pass WebAssembly Core [1.0][7] and [2.0][14] specification tests -on supported platforms: - -| Runtime | Usage | amd64 | arm64 | others | -|:-----------:|:--------------------------------------:|:-----:|:-----:|:------:| -| Interpreter | `wazero.NewRuntimeConfigInterpreter()` | ✅ | ✅ | ✅ | -| Compiler | `wazero.NewRuntimeConfigCompiler()` | ✅ | ✅ | ❌ | - -## Support Policy - -The below support policy focuses on compatability concerns of those embedding -wazero into their Go applications. - -### wazero - -wazero's [1.0 release][15] happened in March 2023, and is [in use][16] by many -projects and production sites. - -We offer an API stability promise with semantic versioning. In other words, we -promise to not break any exported function signature without incrementing the -major version. This does not mean no innovation: New features and behaviors -happen with a minor version increment, e.g. 1.0.11 to 1.2.0. We also fix bugs -or change internal details with a patch version, e.g. 1.0.0 to 1.0.1. - -You can get the latest version of wazero like this. -```bash -go get github.com/tetratelabs/wazero@latest -``` - -Please give us a [star][17] if you end up using wazero! - -### Go - -wazero has no dependencies except Go, so the only source of conflict in your -project's use of wazero is the Go version. - -wazero follows the same version policy as Go's [Release Policy][10]: two -versions. wazero will ensure these versions work and bugs are valid if there's -an issue with a current Go version. - -Additionally, wazero intentionally delays usage of language or standard library -features one additional version. For example, when Go 1.29 is released, wazero -can use language features or standard libraries added in 1.27. This is a -convenience for embedders who have a slower version policy than Go. However, -only supported Go versions may be used to raise support issues. - -### Platform - -wazero has two runtime modes: Interpreter and Compiler. The only supported operating -systems are ones we test, but that doesn't necessarily mean other operating -system versions won't work. - -We currently test Linux (Ubuntu and scratch), MacOS and Windows as packaged by -[GitHub Actions][11], as well compilation of 32-bit Linux and 64-bit FreeBSD. - -* Interpreter - * Linux is tested on amd64 (native) as well arm64 and riscv64 via emulation. - * MacOS and Windows are only tested on amd64. -* Compiler - * Linux is tested on amd64 (native) as well arm64 via emulation. - * MacOS and Windows are only tested on amd64. - -wazero has no dependencies and doesn't require CGO. This means it can also be -embedded in an application that doesn't use an operating system. This is a main -differentiator between wazero and alternatives. - -We verify zero dependencies by running tests in Docker's [scratch image][12]. -This approach ensures compatibility with any parent image. - ------ -wazero is a registered trademark of Tetrate.io, Inc. in the United States and/or other countries - -[1]: https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/ -[2]: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/ -[4]: https://github.com/WebAssembly/meetings/blob/main/process/subgroups.md -[5]: https://github.com/WebAssembly/WASI -[6]: https://pkg.go.dev/golang.org/x/sys/unix -[7]: https://github.com/WebAssembly/spec/tree/wg-1.0/test/core -[8]: internal/engine/compiler/RATIONALE.md -[9]: https://github.com/tetratelabs/wazero/issues/506 -[10]: https://go.dev/doc/devel/release -[11]: https://github.com/actions/virtual-environments -[12]: https://docs.docker.com/develop/develop-images/baseimages/#create-a-simple-parent-image-using-scratch -[13]: https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md -[14]: https://github.com/WebAssembly/spec/tree/d39195773112a22b245ffbe864bab6d1182ccb06/test/core -[15]: https://tetrate.io/blog/introducing-wazero-from-tetrate/ -[16]: https://wazero.io/community/users/ -[17]: https://github.com/tetratelabs/wazero/stargazers diff --git a/vendor/github.com/tetratelabs/wazero/api/features.go b/vendor/github.com/tetratelabs/wazero/api/features.go deleted file mode 100644 index 04d35e18fc..0000000000 --- a/vendor/github.com/tetratelabs/wazero/api/features.go +++ /dev/null @@ -1,212 +0,0 @@ -package api - -import ( - "fmt" - "strings" -) - -// CoreFeatures is a bit flag of WebAssembly Core specification features. See -// https://github.com/WebAssembly/proposals for proposals and their status. -// -// Constants define individual features, such as CoreFeatureMultiValue, or -// groups of "finished" features, assigned to a WebAssembly Core Specification -// version, e.g. CoreFeaturesV1 or CoreFeaturesV2. -// -// Note: Numeric values are not intended to be interpreted except as bit flags. -type CoreFeatures uint64 - -// CoreFeaturesV1 are features included in the WebAssembly Core Specification -// 1.0. As of late 2022, this is the only version that is a Web Standard (W3C -// Recommendation). -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/ -const CoreFeaturesV1 = CoreFeatureMutableGlobal - -// CoreFeaturesV2 are features included in the WebAssembly Core Specification -// 2.0 (20220419). As of late 2022, version 2.0 is a W3C working draft, not yet -// a Web Standard (W3C Recommendation). -// -// See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#release-1-1 -const CoreFeaturesV2 = CoreFeaturesV1 | - CoreFeatureBulkMemoryOperations | - CoreFeatureMultiValue | - CoreFeatureNonTrappingFloatToIntConversion | - CoreFeatureReferenceTypes | - CoreFeatureSignExtensionOps | - CoreFeatureSIMD - -const ( - // CoreFeatureBulkMemoryOperations adds instructions modify ranges of - // memory or table entries ("bulk-memory-operations"). This is included in - // CoreFeaturesV2, but not CoreFeaturesV1. - // - // Here are the notable effects: - // - Adds `memory.fill`, `memory.init`, `memory.copy` and `data.drop` - // instructions. - // - Adds `table.init`, `table.copy` and `elem.drop` instructions. - // - Introduces a "passive" form of element and data segments. - // - Stops checking "active" element and data segment boundaries at - // compile-time, meaning they can error at runtime. - // - // Note: "bulk-memory-operations" is mixed with the "reference-types" - // proposal due to the WebAssembly Working Group merging them - // "mutually dependent". Therefore, enabling this feature requires enabling - // CoreFeatureReferenceTypes, and vice-versa. - // - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/bulk-memory-operations/Overview.md - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/reference-types/Overview.md and - // https://github.com/WebAssembly/spec/pull/1287 - CoreFeatureBulkMemoryOperations CoreFeatures = 1 << iota - - // CoreFeatureMultiValue enables multiple values ("multi-value"). This is - // included in CoreFeaturesV2, but not CoreFeaturesV1. - // - // Here are the notable effects: - // - Function (`func`) types allow more than one result. - // - Block types (`block`, `loop` and `if`) can be arbitrary function - // types. - // - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/multi-value/Overview.md - CoreFeatureMultiValue - - // CoreFeatureMutableGlobal allows globals to be mutable. This is included - // in both CoreFeaturesV1 and CoreFeaturesV2. - // - // When false, an api.Global can never be cast to an api.MutableGlobal, and - // any wasm that includes global vars will fail to parse. - CoreFeatureMutableGlobal - - // CoreFeatureNonTrappingFloatToIntConversion enables non-trapping - // float-to-int conversions ("nontrapping-float-to-int-conversion"). This - // is included in CoreFeaturesV2, but not CoreFeaturesV1. - // - // The only effect of enabling is allowing the following instructions, - // which return 0 on NaN instead of panicking. - // - `i32.trunc_sat_f32_s` - // - `i32.trunc_sat_f32_u` - // - `i32.trunc_sat_f64_s` - // - `i32.trunc_sat_f64_u` - // - `i64.trunc_sat_f32_s` - // - `i64.trunc_sat_f32_u` - // - `i64.trunc_sat_f64_s` - // - `i64.trunc_sat_f64_u` - // - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/nontrapping-float-to-int-conversion/Overview.md - CoreFeatureNonTrappingFloatToIntConversion - - // CoreFeatureReferenceTypes enables various instructions and features - // related to table and new reference types. This is included in - // CoreFeaturesV2, but not CoreFeaturesV1. - // - // - Introduction of new value types: `funcref` and `externref`. - // - Support for the following new instructions: - // - `ref.null` - // - `ref.func` - // - `ref.is_null` - // - `table.fill` - // - `table.get` - // - `table.grow` - // - `table.set` - // - `table.size` - // - Support for multiple tables per module: - // - `call_indirect`, `table.init`, `table.copy` and `elem.drop` - // - Support for instructions can take non-zero table index. - // - Element segments can take non-zero table index. - // - // Note: "reference-types" is mixed with the "bulk-memory-operations" - // proposal due to the WebAssembly Working Group merging them - // "mutually dependent". Therefore, enabling this feature requires enabling - // CoreFeatureBulkMemoryOperations, and vice-versa. - // - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/bulk-memory-operations/Overview.md - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/reference-types/Overview.md and - // https://github.com/WebAssembly/spec/pull/1287 - CoreFeatureReferenceTypes - - // CoreFeatureSignExtensionOps enables sign extension instructions - // ("sign-extension-ops"). This is included in CoreFeaturesV2, but not - // CoreFeaturesV1. - // - // Adds instructions: - // - `i32.extend8_s` - // - `i32.extend16_s` - // - `i64.extend8_s` - // - `i64.extend16_s` - // - `i64.extend32_s` - // - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/sign-extension-ops/Overview.md - CoreFeatureSignExtensionOps - - // CoreFeatureSIMD enables the vector value type and vector instructions - // (aka SIMD). This is included in CoreFeaturesV2, but not CoreFeaturesV1. - // - // Note: The instruction list is too long to enumerate in godoc. - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md - CoreFeatureSIMD -) - -// SetEnabled enables or disables the feature or group of features. -func (f CoreFeatures) SetEnabled(feature CoreFeatures, val bool) CoreFeatures { - if val { - return f | feature - } - return f &^ feature -} - -// IsEnabled returns true if the feature (or group of features) is enabled. -func (f CoreFeatures) IsEnabled(feature CoreFeatures) bool { - return f&feature != 0 -} - -// RequireEnabled returns an error if the feature (or group of features) is not -// enabled. -func (f CoreFeatures) RequireEnabled(feature CoreFeatures) error { - if f&feature == 0 { - return fmt.Errorf("feature %q is disabled", feature) - } - return nil -} - -// String implements fmt.Stringer by returning each enabled feature. -func (f CoreFeatures) String() string { - var builder strings.Builder - for i := 0; i <= 63; i++ { // cycle through all bits to reduce code and maintenance - target := CoreFeatures(1 << i) - if f.IsEnabled(target) { - if name := featureName(target); name != "" { - if builder.Len() > 0 { - builder.WriteByte('|') - } - builder.WriteString(name) - } - } - } - return builder.String() -} - -func featureName(f CoreFeatures) string { - switch f { - case CoreFeatureMutableGlobal: - // match https://github.com/WebAssembly/mutable-global - return "mutable-global" - case CoreFeatureSignExtensionOps: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/sign-extension-ops/Overview.md - return "sign-extension-ops" - case CoreFeatureMultiValue: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/multi-value/Overview.md - return "multi-value" - case CoreFeatureNonTrappingFloatToIntConversion: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/nontrapping-float-to-int-conversion/Overview.md - return "nontrapping-float-to-int-conversion" - case CoreFeatureBulkMemoryOperations: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/bulk-memory-operations/Overview.md - return "bulk-memory-operations" - case CoreFeatureReferenceTypes: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/reference-types/Overview.md - return "reference-types" - case CoreFeatureSIMD: - // match https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md - return "simd" - } - return "" -} diff --git a/vendor/github.com/tetratelabs/wazero/api/wasm.go b/vendor/github.com/tetratelabs/wazero/api/wasm.go deleted file mode 100644 index 38728b4273..0000000000 --- a/vendor/github.com/tetratelabs/wazero/api/wasm.go +++ /dev/null @@ -1,736 +0,0 @@ -// Package api includes constants and interfaces used by both end-users and internal implementations. -package api - -import ( - "context" - "fmt" - "math" - - "github.com/tetratelabs/wazero/internal/internalapi" -) - -// ExternType classifies imports and exports with their respective types. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#external-types%E2%91%A0 -type ExternType = byte - -const ( - ExternTypeFunc ExternType = 0x00 - ExternTypeTable ExternType = 0x01 - ExternTypeMemory ExternType = 0x02 - ExternTypeGlobal ExternType = 0x03 -) - -// The below are exported to consolidate parsing behavior for external types. -const ( - // ExternTypeFuncName is the name of the WebAssembly 1.0 (20191205) Text Format field for ExternTypeFunc. - ExternTypeFuncName = "func" - // ExternTypeTableName is the name of the WebAssembly 1.0 (20191205) Text Format field for ExternTypeTable. - ExternTypeTableName = "table" - // ExternTypeMemoryName is the name of the WebAssembly 1.0 (20191205) Text Format field for ExternTypeMemory. - ExternTypeMemoryName = "memory" - // ExternTypeGlobalName is the name of the WebAssembly 1.0 (20191205) Text Format field for ExternTypeGlobal. - ExternTypeGlobalName = "global" -) - -// ExternTypeName returns the name of the WebAssembly 1.0 (20191205) Text Format field of the given type. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exports%E2%91%A4 -func ExternTypeName(et ExternType) string { - switch et { - case ExternTypeFunc: - return ExternTypeFuncName - case ExternTypeTable: - return ExternTypeTableName - case ExternTypeMemory: - return ExternTypeMemoryName - case ExternTypeGlobal: - return ExternTypeGlobalName - } - return fmt.Sprintf("%#x", et) -} - -// ValueType describes a parameter or result type mapped to a WebAssembly -// function signature. -// -// The following describes how to convert between Wasm and Golang types: -// -// - ValueTypeI32 - EncodeU32 DecodeU32 for uint32 / EncodeI32 DecodeI32 for int32 -// - ValueTypeI64 - uint64(int64) -// - ValueTypeF32 - EncodeF32 DecodeF32 from float32 -// - ValueTypeF64 - EncodeF64 DecodeF64 from float64 -// - ValueTypeExternref - unintptr(unsafe.Pointer(p)) where p is any pointer -// type in Go (e.g. *string) -// -// e.g. Given a Text Format type use (param i64) (result i64), no conversion is -// necessary. -// -// results, _ := fn(ctx, input) -// result := result[0] -// -// e.g. Given a Text Format type use (param f64) (result f64), conversion is -// necessary. -// -// results, _ := fn(ctx, api.EncodeF64(input)) -// result := api.DecodeF64(result[0]) -// -// Note: This is a type alias as it is easier to encode and decode in the -// binary format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-valtype -type ValueType = byte - -const ( - // ValueTypeI32 is a 32-bit integer. - ValueTypeI32 ValueType = 0x7f - // ValueTypeI64 is a 64-bit integer. - ValueTypeI64 ValueType = 0x7e - // ValueTypeF32 is a 32-bit floating point number. - ValueTypeF32 ValueType = 0x7d - // ValueTypeF64 is a 64-bit floating point number. - ValueTypeF64 ValueType = 0x7c - - // ValueTypeExternref is a externref type. - // - // Note: in wazero, externref type value are opaque raw 64-bit pointers, - // and the ValueTypeExternref type in the signature will be translated as - // uintptr in wazero's API level. - // - // For example, given the import function: - // (func (import "env" "f") (param externref) (result externref)) - // - // This can be defined in Go as: - // r.NewHostModuleBuilder("env"). - // NewFunctionBuilder(). - // WithFunc(func(context.Context, _ uintptr) (_ uintptr) { return }). - // Export("f") - // - // Note: The usage of this type is toggled with api.CoreFeatureBulkMemoryOperations. - ValueTypeExternref ValueType = 0x6f -) - -// ValueTypeName returns the type name of the given ValueType as a string. -// These type names match the names used in the WebAssembly text format. -// -// Note: This returns "unknown", if an undefined ValueType value is passed. -func ValueTypeName(t ValueType) string { - switch t { - case ValueTypeI32: - return "i32" - case ValueTypeI64: - return "i64" - case ValueTypeF32: - return "f32" - case ValueTypeF64: - return "f64" - case ValueTypeExternref: - return "externref" - } - return "unknown" -} - -// Module is a sandboxed, ready to execute Wasm module. This can be used to get exported functions, etc. -// -// In WebAssembly terminology, this corresponds to a "Module Instance", but wazero calls pre-instantiation module as -// "Compiled Module" as in wazero.CompiledModule, therefore we call this post-instantiation module simply "Module". -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#module-instances%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - Closing the wazero.Runtime closes any Module it instantiated. -type Module interface { - fmt.Stringer - - // Name is the name this module was instantiated with. Exported functions can be imported with this name. - Name() string - - // Memory returns a memory defined in this module or nil if there are none wasn't. - Memory() Memory - - // ExportedFunction returns a function exported from this module or nil if it wasn't. - ExportedFunction(name string) Function - - // ExportedFunctionDefinitions returns all the exported function - // definitions in this module, keyed on export name. - ExportedFunctionDefinitions() map[string]FunctionDefinition - - // TODO: Table - - // ExportedMemory returns a memory exported from this module or nil if it wasn't. - // - // WASI modules require exporting a Memory named "memory". This means that a module successfully initialized - // as a WASI Command or Reactor will never return nil for this name. - // - // See https://github.com/WebAssembly/WASI/blob/snapshot-01/design/application-abi.md#current-unstable-abi - ExportedMemory(name string) Memory - - // ExportedMemoryDefinitions returns all the exported memory definitions - // in this module, keyed on export name. - // - // Note: As of WebAssembly Core Specification 2.0, there can be at most one - // memory. - ExportedMemoryDefinitions() map[string]MemoryDefinition - - // ExportedGlobal a global exported from this module or nil if it wasn't. - ExportedGlobal(name string) Global - - // CloseWithExitCode releases resources allocated for this Module. Use a non-zero exitCode parameter to indicate a - // failure to ExportedFunction callers. - // - // The error returned here, if present, is about resource de-allocation (such as I/O errors). Only the last error is - // returned, so a non-nil return means at least one error happened. Regardless of error, this Module will - // be removed, making its name available again. - // - // Calling this inside a host function is safe, and may cause ExportedFunction callers to receive a sys.ExitError - // with the exitCode. - CloseWithExitCode(ctx context.Context, exitCode uint32) error - - // Closer closes this module by delegating to CloseWithExitCode with an exit code of zero. - Closer - - internalapi.WazeroOnly -} - -// Closer closes a resource. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type Closer interface { - // Close closes the resource. - // - // Note: The context parameter is used for value lookup, such as for - // logging. A canceled or otherwise done context will not prevent Close - // from succeeding. - Close(context.Context) error -} - -// ExportDefinition is a WebAssembly type exported in a module -// (wazero.CompiledModule). -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exports%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type ExportDefinition interface { - // ModuleName is the possibly empty name of the module defining this - // export. - // - // Note: This may be different from Module.Name, because a compiled module - // can be instantiated multiple times as different names. - ModuleName() string - - // Index is the position in the module's index, imports first. - Index() uint32 - - // Import returns true with the module and name when this was imported. - // Otherwise, it returns false. - // - // Note: Empty string is valid for both names in the WebAssembly Core - // Specification, so "" "" is possible. - Import() (moduleName, name string, isImport bool) - - // ExportNames include all exported names. - // - // Note: The empty name is allowed in the WebAssembly Core Specification, - // so "" is possible. - ExportNames() []string - - internalapi.WazeroOnly -} - -// MemoryDefinition is a WebAssembly memory exported in a module -// (wazero.CompiledModule). Units are in pages (64KB). -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exports%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type MemoryDefinition interface { - ExportDefinition - - // Min returns the possibly zero initial count of 64KB pages. - Min() uint32 - - // Max returns the possibly zero max count of 64KB pages, or false if - // unbounded. - Max() (uint32, bool) - - internalapi.WazeroOnly -} - -// FunctionDefinition is a WebAssembly function exported in a module -// (wazero.CompiledModule). -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exports%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type FunctionDefinition interface { - ExportDefinition - - // Name is the module-defined name of the function, which is not necessarily - // the same as its export name. - Name() string - - // DebugName identifies this function based on its Index or Name in the - // module. This is used for errors and stack traces. e.g. "env.abort". - // - // When the function name is empty, a substitute name is generated by - // prefixing '$' to its position in the index. Ex ".$0" is the - // first function (possibly imported) in an unnamed module. - // - // The format is dot-delimited module and function name, but there are no - // restrictions on the module and function name. This means either can be - // empty or include dots. e.g. "x.x.x" could mean module "x" and name "x.x", - // or it could mean module "x.x" and name "x". - // - // Note: This name is stable regardless of import or export. For example, - // if Import returns true, the value is still based on the Name or Index - // and not the imported function name. - DebugName() string - - // GoFunction is non-nil when implemented by the embedder instead of a wasm - // binary, e.g. via wazero.HostModuleBuilder - // - // The expected results are nil, GoFunction or GoModuleFunction. - GoFunction() interface{} - - // ParamTypes are the possibly empty sequence of value types accepted by a - // function with this signature. - // - // See ValueType documentation for encoding rules. - ParamTypes() []ValueType - - // ParamNames are index-correlated with ParamTypes or nil if not available - // for one or more parameters. - ParamNames() []string - - // ResultTypes are the results of the function. - // - // When WebAssembly 1.0 (20191205), there can be at most one result. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#result-types%E2%91%A0 - // - // See ValueType documentation for encoding rules. - ResultTypes() []ValueType - - // ResultNames are index-correlated with ResultTypes or nil if not - // available for one or more results. - ResultNames() []string - - internalapi.WazeroOnly -} - -// Function is a WebAssembly function exported from an instantiated module -// (wazero.Runtime InstantiateModule). -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#syntax-func -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type Function interface { - // Definition is metadata about this function from its defining module. - Definition() FunctionDefinition - - // Call invokes the function with the given parameters and returns any - // results or an error for any failure looking up or invoking the function. - // - // Encoding is described in Definition, and supplying an incorrect count of - // parameters vs FunctionDefinition.ParamTypes is an error. - // - // If the exporting Module was closed during this call, the error returned - // may be a sys.ExitError. See Module.CloseWithExitCode for details. - // - // Call is not goroutine-safe, therefore it is recommended to create - // another Function if you want to invoke the same function concurrently. - // On the other hand, sequential invocations of Call is allowed. - // - // To safely encode/decode params/results expressed as uint64, users are encouraged to - // use api.EncodeXXX or DecodeXXX functions. See the docs on api.ValueType. - // - // When RuntimeConfig.WithCloseOnContextDone is toggled, the invocation of this Call method is ensured to be closed - // whenever one of the three conditions is met. In the event of close, sys.ExitError will be returned and - // the api.Module from which this api.Function is derived will be made closed. See the documentation of - // WithCloseOnContextDone on wazero.RuntimeConfig for detail. See examples in context_done_example_test.go for - // the end-to-end demonstrations of how these terminations can be performed. - Call(ctx context.Context, params ...uint64) ([]uint64, error) - - // CallWithStack is an optimized variation of Call that saves memory - // allocations when the stack slice is reused across calls. - // - // Stack length must be at least the max of parameter or result length. - // The caller adds parameters in order to the stack, and reads any results - // in order from the stack, except in the error case. - // - // For example, the following reuses the same stack slice to call searchFn - // repeatedly saving one allocation per iteration: - // - // stack := make([]uint64, 4) - // for i, search := range searchParams { - // // copy the next params to the stack - // copy(stack, search) - // if err := searchFn.CallWithStack(ctx, stack); err != nil { - // return err - // } else if stack[0] == 1 { // found - // return i // searchParams[i] matched! - // } - // } - // - // # Notes - // - // - This is similar to GoModuleFunction, except for using calling functions - // instead of implementing them. Moreover, this is used regardless of - // whether the callee is a host or wasm defined function. - CallWithStack(ctx context.Context, stack []uint64) error - - internalapi.WazeroOnly -} - -// GoModuleFunction is a Function implemented in Go instead of a wasm binary. -// The Module parameter is the calling module, used to access memory or -// exported functions. See GoModuleFunc for an example. -// -// The stack is includes any parameters encoded according to their ValueType. -// Its length is the max of parameter or result length. When there are results, -// write them in order beginning at index zero. Do not use the stack after the -// function returns. -// -// Here's a typical way to read three parameters and write back one. -// -// // read parameters off the stack in index order -// argv, argvBuf := api.DecodeU32(stack[0]), api.DecodeU32(stack[1]) -// -// // write results back to the stack in index order -// stack[0] = api.EncodeU32(ErrnoSuccess) -// -// This function can be non-deterministic or cause side effects. It also -// has special properties not defined in the WebAssembly Core specification. -// Notably, this uses the caller's memory (via Module.Memory). See -// https://www.w3.org/TR/wasm-core-1/#host-functions%E2%91%A0 -// -// Most end users will not define functions directly with this, as they will -// use reflection or code generators instead. These approaches are more -// idiomatic as they can map go types to ValueType. This type is exposed for -// those willing to trade usability and safety for performance. -// -// To safely decode/encode values from/to the uint64 stack, users are encouraged to use -// api.EncodeXXX or api.DecodeXXX functions. See the docs on api.ValueType. -type GoModuleFunction interface { - Call(ctx context.Context, mod Module, stack []uint64) -} - -// GoModuleFunc is a convenience for defining an inlined function. -// -// For example, the following returns an uint32 value read from parameter zero: -// -// api.GoModuleFunc(func(ctx context.Context, mod api.Module, stack []uint64) { -// offset := api.DecodeU32(stack[0]) // read the parameter from the stack -// -// ret, ok := mod.Memory().ReadUint32Le(offset) -// if !ok { -// panic("out of memory") -// } -// -// stack[0] = api.EncodeU32(ret) // add the result back to the stack. -// }) -type GoModuleFunc func(ctx context.Context, mod Module, stack []uint64) - -// Call implements GoModuleFunction.Call. -func (f GoModuleFunc) Call(ctx context.Context, mod Module, stack []uint64) { - f(ctx, mod, stack) -} - -// GoFunction is an optimized form of GoModuleFunction which doesn't require -// the Module parameter. See GoFunc for an example. -// -// For example, this function does not need to use the importing module's -// memory or exported functions. -type GoFunction interface { - Call(ctx context.Context, stack []uint64) -} - -// GoFunc is a convenience for defining an inlined function. -// -// For example, the following returns the sum of two uint32 parameters: -// -// api.GoFunc(func(ctx context.Context, stack []uint64) { -// x, y := api.DecodeU32(stack[0]), api.DecodeU32(stack[1]) -// stack[0] = api.EncodeU32(x + y) -// }) -type GoFunc func(ctx context.Context, stack []uint64) - -// Call implements GoFunction.Call. -func (f GoFunc) Call(ctx context.Context, stack []uint64) { - f(ctx, stack) -} - -// Global is a WebAssembly 1.0 (20191205) global exported from an instantiated module (wazero.Runtime InstantiateModule). -// -// For example, if the value is not mutable, you can read it once: -// -// offset := module.ExportedGlobal("memory.offset").Get() -// -// Globals are allowed by specification to be mutable. However, this can be disabled by configuration. When in doubt, -// safe cast to find out if the value can change. Here's an example: -// -// offset := module.ExportedGlobal("memory.offset") -// if _, ok := offset.(api.MutableGlobal); ok { -// // value can change -// } else { -// // value is constant -// } -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#globals%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type Global interface { - fmt.Stringer - - // Type describes the numeric type of the global. - Type() ValueType - - // Get returns the last known value of this global. - // - // See Type for how to decode this value to a Go type. - Get() uint64 -} - -// MutableGlobal is a Global whose value can be updated at runtime (variable). -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type MutableGlobal interface { - Global - - // Set updates the value of this global. - // - // See Global.Type for how to encode this value from a Go type. - Set(v uint64) - - internalapi.WazeroOnly -} - -// Memory allows restricted access to a module's memory. Notably, this does not allow growing. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#storage%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - This includes all value types available in WebAssembly 1.0 (20191205) and all are encoded little-endian. -type Memory interface { - // Definition is metadata about this memory from its defining module. - Definition() MemoryDefinition - - // Size returns the size in bytes available. e.g. If the underlying memory - // has 1 page: 65536 - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefsyntax-instr-memorymathsfmemorysize%E2%91%A0 - Size() uint32 - - // Grow increases memory by the delta in pages (65536 bytes per page). - // The return val is the previous memory size in pages, or false if the - // delta was ignored as it exceeds MemoryDefinition.Max. - // - // # Notes - // - // - This is the same as the "memory.grow" instruction defined in the - // WebAssembly Core Specification, except returns false instead of -1. - // - When this returns true, any shared views via Read must be refreshed. - // - // See MemorySizer Read and https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#grow-mem - Grow(deltaPages uint32) (previousPages uint32, ok bool) - - // ReadByte reads a single byte from the underlying buffer at the offset or returns false if out of range. - ReadByte(offset uint32) (byte, bool) - - // ReadUint16Le reads a uint16 in little-endian encoding from the underlying buffer at the offset in or returns - // false if out of range. - ReadUint16Le(offset uint32) (uint16, bool) - - // ReadUint32Le reads a uint32 in little-endian encoding from the underlying buffer at the offset in or returns - // false if out of range. - ReadUint32Le(offset uint32) (uint32, bool) - - // ReadFloat32Le reads a float32 from 32 IEEE 754 little-endian encoded bits in the underlying buffer at the offset - // or returns false if out of range. - // See math.Float32bits - ReadFloat32Le(offset uint32) (float32, bool) - - // ReadUint64Le reads a uint64 in little-endian encoding from the underlying buffer at the offset or returns false - // if out of range. - ReadUint64Le(offset uint32) (uint64, bool) - - // ReadFloat64Le reads a float64 from 64 IEEE 754 little-endian encoded bits in the underlying buffer at the offset - // or returns false if out of range. - // - // See math.Float64bits - ReadFloat64Le(offset uint32) (float64, bool) - - // Read reads byteCount bytes from the underlying buffer at the offset or - // returns false if out of range. - // - // For example, to search for a NUL-terminated string: - // buf, _ = memory.Read(offset, byteCount) - // n := bytes.IndexByte(buf, 0) - // if n < 0 { - // // Not found! - // } - // - // Write-through - // - // This returns a view of the underlying memory, not a copy. This means any - // writes to the slice returned are visible to Wasm, and any updates from - // Wasm are visible reading the returned slice. - // - // For example: - // buf, _ = memory.Read(offset, byteCount) - // buf[1] = 'a' // writes through to memory, meaning Wasm code see 'a'. - // - // If you don't intend-write through, make a copy of the returned slice. - // - // When to refresh Read - // - // The returned slice disconnects on any capacity change. For example, - // `buf = append(buf, 'a')` might result in a slice that is no longer - // shared. The same exists Wasm side. For example, if Wasm changes its - // memory capacity, ex via "memory.grow"), the host slice is no longer - // shared. Those who need a stable view must set Wasm memory min=max, or - // use wazero.RuntimeConfig WithMemoryCapacityPages to ensure max is always - // allocated. - Read(offset, byteCount uint32) ([]byte, bool) - - // WriteByte writes a single byte to the underlying buffer at the offset in or returns false if out of range. - WriteByte(offset uint32, v byte) bool - - // WriteUint16Le writes the value in little-endian encoding to the underlying buffer at the offset in or returns - // false if out of range. - WriteUint16Le(offset uint32, v uint16) bool - - // WriteUint32Le writes the value in little-endian encoding to the underlying buffer at the offset in or returns - // false if out of range. - WriteUint32Le(offset, v uint32) bool - - // WriteFloat32Le writes the value in 32 IEEE 754 little-endian encoded bits to the underlying buffer at the offset - // or returns false if out of range. - // - // See math.Float32bits - WriteFloat32Le(offset uint32, v float32) bool - - // WriteUint64Le writes the value in little-endian encoding to the underlying buffer at the offset in or returns - // false if out of range. - WriteUint64Le(offset uint32, v uint64) bool - - // WriteFloat64Le writes the value in 64 IEEE 754 little-endian encoded bits to the underlying buffer at the offset - // or returns false if out of range. - // - // See math.Float64bits - WriteFloat64Le(offset uint32, v float64) bool - - // Write writes the slice to the underlying buffer at the offset or returns false if out of range. - Write(offset uint32, v []byte) bool - - // WriteString writes the string to the underlying buffer at the offset or returns false if out of range. - WriteString(offset uint32, v string) bool - - internalapi.WazeroOnly -} - -// CustomSection contains the name and raw data of a custom section. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type CustomSection interface { - // Name is the name of the custom section - Name() string - // Data is the raw data of the custom section - Data() []byte - - internalapi.WazeroOnly -} - -// EncodeExternref encodes the input as a ValueTypeExternref. -// -// See DecodeExternref -func EncodeExternref(input uintptr) uint64 { - return uint64(input) -} - -// DecodeExternref decodes the input as a ValueTypeExternref. -// -// See EncodeExternref -func DecodeExternref(input uint64) uintptr { - return uintptr(input) -} - -// EncodeI32 encodes the input as a ValueTypeI32. -func EncodeI32(input int32) uint64 { - return uint64(uint32(input)) -} - -// DecodeI32 decodes the input as a ValueTypeI32. -func DecodeI32(input uint64) int32 { - return int32(input) -} - -// EncodeU32 encodes the input as a ValueTypeI32. -func EncodeU32(input uint32) uint64 { - return uint64(input) -} - -// DecodeU32 decodes the input as a ValueTypeI32. -func DecodeU32(input uint64) uint32 { - return uint32(input) -} - -// EncodeI64 encodes the input as a ValueTypeI64. -func EncodeI64(input int64) uint64 { - return uint64(input) -} - -// EncodeF32 encodes the input as a ValueTypeF32. -// -// See DecodeF32 -func EncodeF32(input float32) uint64 { - return uint64(math.Float32bits(input)) -} - -// DecodeF32 decodes the input as a ValueTypeF32. -// -// See EncodeF32 -func DecodeF32(input uint64) float32 { - return math.Float32frombits(uint32(input)) -} - -// EncodeF64 encodes the input as a ValueTypeF64. -// -// See EncodeF32 -func EncodeF64(input float64) uint64 { - return math.Float64bits(input) -} - -// DecodeF64 decodes the input as a ValueTypeF64. -// -// See EncodeF64 -func DecodeF64(input uint64) float64 { - return math.Float64frombits(input) -} diff --git a/vendor/github.com/tetratelabs/wazero/builder.go b/vendor/github.com/tetratelabs/wazero/builder.go deleted file mode 100644 index f64afabdf0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/builder.go +++ /dev/null @@ -1,352 +0,0 @@ -package wazero - -import ( - "context" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// HostFunctionBuilder defines a host function (in Go), so that a -// WebAssembly binary (e.g. %.wasm file) can import and use it. -// -// Here's an example of an addition function: -// -// hostModuleBuilder.NewFunctionBuilder(). -// WithFunc(func(cxt context.Context, x, y uint32) uint32 { -// return x + y -// }). -// Export("add") -// -// # Memory -// -// All host functions act on the importing api.Module, including any memory -// exported in its binary (%.wasm file). If you are reading or writing memory, -// it is sand-boxed Wasm memory defined by the guest. -// -// Below, `m` is the importing module, defined in Wasm. `fn` is a host function -// added via Export. This means that `x` was read from memory defined in Wasm, -// not arbitrary memory in the process. -// -// fn := func(ctx context.Context, m api.Module, offset uint32) uint32 { -// x, _ := m.Memory().ReadUint32Le(ctx, offset) -// return x -// } -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type HostFunctionBuilder interface { - // WithGoFunction is an advanced feature for those who need higher - // performance than WithFunc at the cost of more complexity. - // - // Here's an example addition function: - // - // builder.WithGoFunction(api.GoFunc(func(ctx context.Context, stack []uint64) { - // x, y := api.DecodeI32(stack[0]), api.DecodeI32(stack[1]) - // sum := x + y - // stack[0] = api.EncodeI32(sum) - // }), []api.ValueType{api.ValueTypeI32, api.ValueTypeI32}, []api.ValueType{api.ValueTypeI32}) - // - // As you can see above, defining in this way implies knowledge of which - // WebAssembly api.ValueType is appropriate for each parameter and result. - // - // See WithGoModuleFunction if you also need to access the calling module. - WithGoFunction(fn api.GoFunction, params, results []api.ValueType) HostFunctionBuilder - - // WithGoModuleFunction is an advanced feature for those who need higher - // performance than WithFunc at the cost of more complexity. - // - // Here's an example addition function that loads operands from memory: - // - // builder.WithGoModuleFunction(api.GoModuleFunc(func(ctx context.Context, m api.Module, stack []uint64) { - // mem := m.Memory() - // offset := api.DecodeU32(stack[0]) - // - // x, _ := mem.ReadUint32Le(ctx, offset) - // y, _ := mem.ReadUint32Le(ctx, offset + 4) // 32 bits == 4 bytes! - // sum := x + y - // - // stack[0] = api.EncodeU32(sum) - // }), []api.ValueType{api.ValueTypeI32}, []api.ValueType{api.ValueTypeI32}) - // - // As you can see above, defining in this way implies knowledge of which - // WebAssembly api.ValueType is appropriate for each parameter and result. - // - // See WithGoFunction if you don't need access to the calling module. - WithGoModuleFunction(fn api.GoModuleFunction, params, results []api.ValueType) HostFunctionBuilder - - // WithFunc uses reflect.Value to map a go `func` to a WebAssembly - // compatible Signature. An input that isn't a `func` will fail to - // instantiate. - // - // Here's an example of an addition function: - // - // builder.WithFunc(func(cxt context.Context, x, y uint32) uint32 { - // return x + y - // }) - // - // # Defining a function - // - // Except for the context.Context and optional api.Module, all parameters - // or result types must map to WebAssembly numeric value types. This means - // uint32, int32, uint64, int64, float32 or float64. - // - // api.Module may be specified as the second parameter, usually to access - // memory. This is important because there are only numeric types in Wasm. - // The only way to share other data is via writing memory and sharing - // offsets. - // - // builder.WithFunc(func(ctx context.Context, m api.Module, offset uint32) uint32 { - // mem := m.Memory() - // x, _ := mem.ReadUint32Le(ctx, offset) - // y, _ := mem.ReadUint32Le(ctx, offset + 4) // 32 bits == 4 bytes! - // return x + y - // }) - // - // This example propagates context properly when calling other functions - // exported in the api.Module: - // - // builder.WithFunc(func(ctx context.Context, m api.Module, offset, byteCount uint32) uint32 { - // fn = m.ExportedFunction("__read") - // results, err := fn(ctx, offset, byteCount) - // --snip-- - WithFunc(interface{}) HostFunctionBuilder - - // WithName defines the optional module-local name of this function, e.g. - // "random_get" - // - // Note: This is not required to match the Export name. - WithName(name string) HostFunctionBuilder - - // WithParameterNames defines optional parameter names of the function - // signature, e.x. "buf", "buf_len" - // - // Note: When defined, names must be provided for all parameters. - WithParameterNames(names ...string) HostFunctionBuilder - - // WithResultNames defines optional result names of the function - // signature, e.x. "errno" - // - // Note: When defined, names must be provided for all results. - WithResultNames(names ...string) HostFunctionBuilder - - // Export exports this to the HostModuleBuilder as the given name, e.g. - // "random_get" - Export(name string) HostModuleBuilder -} - -// HostModuleBuilder is a way to define host functions (in Go), so that a -// WebAssembly binary (e.g. %.wasm file) can import and use them. -// -// Specifically, this implements the host side of an Application Binary -// Interface (ABI) like WASI or AssemblyScript. -// -// For example, this defines and instantiates a module named "env" with one -// function: -// -// ctx := context.Background() -// r := wazero.NewRuntime(ctx) -// defer r.Close(ctx) // This closes everything this Runtime created. -// -// hello := func() { -// println("hello!") -// } -// env, _ := r.NewHostModuleBuilder("env"). -// NewFunctionBuilder().WithFunc(hello).Export("hello"). -// Instantiate(ctx) -// -// If the same module may be instantiated multiple times, it is more efficient -// to separate steps. Here's an example: -// -// compiled, _ := r.NewHostModuleBuilder("env"). -// NewFunctionBuilder().WithFunc(getRandomString).Export("get_random_string"). -// Compile(ctx) -// -// env1, _ := r.InstantiateModule(ctx, compiled, wazero.NewModuleConfig().WithName("env.1")) -// env2, _ := r.InstantiateModule(ctx, compiled, wazero.NewModuleConfig().WithName("env.2")) -// -// See HostFunctionBuilder for valid host function signatures and other details. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - HostModuleBuilder is mutable: each method returns the same instance for -// chaining. -// - methods do not return errors, to allow chaining. Any validation errors -// are deferred until Compile. -// - Functions are indexed in order of calls to NewFunctionBuilder as -// insertion ordering is needed by ABI such as Emscripten (invoke_*). -type HostModuleBuilder interface { - // Note: until golang/go#5860, we can't use example tests to embed code in interface godocs. - - // NewFunctionBuilder begins the definition of a host function. - NewFunctionBuilder() HostFunctionBuilder - - // Compile returns a CompiledModule that can be instantiated by Runtime. - Compile(context.Context) (CompiledModule, error) - - // Instantiate is a convenience that calls Compile, then Runtime.InstantiateModule. - // This can fail for reasons documented on Runtime.InstantiateModule. - // - // Here's an example: - // - // ctx := context.Background() - // r := wazero.NewRuntime(ctx) - // defer r.Close(ctx) // This closes everything this Runtime created. - // - // hello := func() { - // println("hello!") - // } - // env, _ := r.NewHostModuleBuilder("env"). - // NewFunctionBuilder().WithFunc(hello).Export("hello"). - // Instantiate(ctx) - // - // # Notes - // - // - Closing the Runtime has the same effect as closing the result. - // - Fields in the builder are copied during instantiation: Later changes do not affect the instantiated result. - // - To avoid using configuration defaults, use Compile instead. - Instantiate(context.Context) (api.Module, error) -} - -// hostModuleBuilder implements HostModuleBuilder -type hostModuleBuilder struct { - r *runtime - moduleName string - exportNames []string - nameToHostFunc map[string]*wasm.HostFunc -} - -// NewHostModuleBuilder implements Runtime.NewHostModuleBuilder -func (r *runtime) NewHostModuleBuilder(moduleName string) HostModuleBuilder { - return &hostModuleBuilder{ - r: r, - moduleName: moduleName, - nameToHostFunc: map[string]*wasm.HostFunc{}, - } -} - -// hostFunctionBuilder implements HostFunctionBuilder -type hostFunctionBuilder struct { - b *hostModuleBuilder - fn interface{} - name string - paramNames []string - resultNames []string -} - -// WithGoFunction implements HostFunctionBuilder.WithGoFunction -func (h *hostFunctionBuilder) WithGoFunction(fn api.GoFunction, params, results []api.ValueType) HostFunctionBuilder { - h.fn = &wasm.HostFunc{ParamTypes: params, ResultTypes: results, Code: wasm.Code{GoFunc: fn}} - return h -} - -// WithGoModuleFunction implements HostFunctionBuilder.WithGoModuleFunction -func (h *hostFunctionBuilder) WithGoModuleFunction(fn api.GoModuleFunction, params, results []api.ValueType) HostFunctionBuilder { - h.fn = &wasm.HostFunc{ParamTypes: params, ResultTypes: results, Code: wasm.Code{GoFunc: fn}} - return h -} - -// WithFunc implements HostFunctionBuilder.WithFunc -func (h *hostFunctionBuilder) WithFunc(fn interface{}) HostFunctionBuilder { - h.fn = fn - return h -} - -// WithName implements HostFunctionBuilder.WithName -func (h *hostFunctionBuilder) WithName(name string) HostFunctionBuilder { - h.name = name - return h -} - -// WithParameterNames implements HostFunctionBuilder.WithParameterNames -func (h *hostFunctionBuilder) WithParameterNames(names ...string) HostFunctionBuilder { - h.paramNames = names - return h -} - -// WithResultNames implements HostFunctionBuilder.WithResultNames -func (h *hostFunctionBuilder) WithResultNames(names ...string) HostFunctionBuilder { - h.resultNames = names - return h -} - -// Export implements HostFunctionBuilder.Export -func (h *hostFunctionBuilder) Export(exportName string) HostModuleBuilder { - var hostFn *wasm.HostFunc - if fn, ok := h.fn.(*wasm.HostFunc); ok { - hostFn = fn - } else { - hostFn = &wasm.HostFunc{Code: wasm.Code{GoFunc: h.fn}} - } - - // Assign any names from the builder - hostFn.ExportName = exportName - if h.name != "" { - hostFn.Name = h.name - } - if len(h.paramNames) != 0 { - hostFn.ParamNames = h.paramNames - } - if len(h.resultNames) != 0 { - hostFn.ResultNames = h.resultNames - } - - h.b.ExportHostFunc(hostFn) - return h.b -} - -// ExportHostFunc implements wasm.HostFuncExporter -func (b *hostModuleBuilder) ExportHostFunc(fn *wasm.HostFunc) { - if _, ok := b.nameToHostFunc[fn.ExportName]; !ok { // add a new name - b.exportNames = append(b.exportNames, fn.ExportName) - } - b.nameToHostFunc[fn.ExportName] = fn -} - -// NewFunctionBuilder implements HostModuleBuilder.NewFunctionBuilder -func (b *hostModuleBuilder) NewFunctionBuilder() HostFunctionBuilder { - return &hostFunctionBuilder{b: b} -} - -// Compile implements HostModuleBuilder.Compile -func (b *hostModuleBuilder) Compile(ctx context.Context) (CompiledModule, error) { - module, err := wasm.NewHostModule(b.moduleName, b.exportNames, b.nameToHostFunc, b.r.enabledFeatures) - if err != nil { - return nil, err - } else if err = module.Validate(b.r.enabledFeatures); err != nil { - return nil, err - } - - c := &compiledModule{module: module, compiledEngine: b.r.store.Engine} - listeners, err := buildFunctionListeners(ctx, module) - if err != nil { - return nil, err - } - - if err = b.r.store.Engine.CompileModule(ctx, module, listeners, false); err != nil { - return nil, err - } - - // typeIDs are static and compile-time known. - typeIDs, err := b.r.store.GetFunctionTypeIDs(module.TypeSection) - if err != nil { - return nil, err - } - c.typeIDs = typeIDs - - return c, nil -} - -// Instantiate implements HostModuleBuilder.Instantiate -func (b *hostModuleBuilder) Instantiate(ctx context.Context) (api.Module, error) { - if compiled, err := b.Compile(ctx); err != nil { - return nil, err - } else { - compiled.(*compiledModule).closeWithModule = true - return b.r.InstantiateModule(ctx, compiled, NewModuleConfig()) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/cache.go b/vendor/github.com/tetratelabs/wazero/cache.go deleted file mode 100644 index 2d1b4e3b9c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/cache.go +++ /dev/null @@ -1,116 +0,0 @@ -package wazero - -import ( - "context" - "errors" - "fmt" - "os" - "path" - "path/filepath" - goruntime "runtime" - "sync" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/filecache" - "github.com/tetratelabs/wazero/internal/version" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// CompilationCache reduces time spent compiling (Runtime.CompileModule) the same wasm module. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - Instances of this can be reused across multiple runtimes, if configured -// via RuntimeConfig. -type CompilationCache interface{ api.Closer } - -// NewCompilationCache returns a new CompilationCache to be passed to RuntimeConfig. -// This configures only in-memory cache, and doesn't persist to the file system. See wazero.NewCompilationCacheWithDir for detail. -// -// The returned CompilationCache can be used to share the in-memory compilation results across multiple instances of wazero.Runtime. -func NewCompilationCache() CompilationCache { - return &cache{} -} - -// NewCompilationCacheWithDir is like wazero.NewCompilationCache except the result also writes -// state into the directory specified by `dirname` parameter. -// -// If the dirname doesn't exist, this creates it or returns an error. -// -// Those running wazero as a CLI or frequently restarting a process using the same wasm should -// use this feature to reduce time waiting to compile the same module a second time. -// -// The contents written into dirname are wazero-version specific, meaning different versions of -// wazero will duplicate entries for the same input wasm. -// -// Note: The embedder must safeguard this directory from external changes. -func NewCompilationCacheWithDir(dirname string) (CompilationCache, error) { - c := &cache{} - err := c.ensuresFileCache(dirname, version.GetWazeroVersion()) - return c, err -} - -// cache implements Cache interface. -type cache struct { - // eng is the engine for this cache. If the cache is configured, the engine is shared across multiple instances of - // Runtime, and its lifetime is not bound to them. Instead, the engine is alive until Cache.Close is called. - engs [engineKindCount]wasm.Engine - fileCache filecache.Cache - initOnces [engineKindCount]sync.Once -} - -func (c *cache) initEngine(ek engineKind, ne newEngine, ctx context.Context, features api.CoreFeatures) wasm.Engine { - c.initOnces[ek].Do(func() { c.engs[ek] = ne(ctx, features, c.fileCache) }) - return c.engs[ek] -} - -// Close implements the same method on the Cache interface. -func (c *cache) Close(_ context.Context) (err error) { - for _, eng := range c.engs { - if eng != nil { - if err = eng.Close(); err != nil { - return - } - } - } - return -} - -func (c *cache) ensuresFileCache(dir string, wazeroVersion string) error { - // Resolve a potentially relative directory into an absolute one. - var err error - dir, err = filepath.Abs(dir) - if err != nil { - return err - } - - // Ensure the user-supplied directory. - if err = mkdir(dir); err != nil { - return err - } - - // Create a version-specific directory to avoid conflicts. - dirname := path.Join(dir, "wazero-"+wazeroVersion+"-"+goruntime.GOARCH+"-"+goruntime.GOOS) - if err = mkdir(dirname); err != nil { - return err - } - - c.fileCache = filecache.New(dirname) - return nil -} - -func mkdir(dirname string) error { - if st, err := os.Stat(dirname); errors.Is(err, os.ErrNotExist) { - // If the directory not found, create the cache dir. - if err = os.MkdirAll(dirname, 0o700); err != nil { - return fmt.Errorf("create directory %s: %v", dirname, err) - } - } else if err != nil { - return err - } else if !st.IsDir() { - return fmt.Errorf("%s is not dir", dirname) - } - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/codecov.yml b/vendor/github.com/tetratelabs/wazero/codecov.yml deleted file mode 100644 index cf9d94df44..0000000000 --- a/vendor/github.com/tetratelabs/wazero/codecov.yml +++ /dev/null @@ -1,9 +0,0 @@ -# Codecov for main is visible here https://app.codecov.io/gh/tetratelabs/wazero - -# We use codecov only as a UI, so we disable PR comments and commit status. -# See https://docs.codecov.com/docs/pull-request-comments -comment: false -coverage: - status: - project: off - patch: off diff --git a/vendor/github.com/tetratelabs/wazero/config.go b/vendor/github.com/tetratelabs/wazero/config.go deleted file mode 100644 index 56a32fcf5b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/config.go +++ /dev/null @@ -1,870 +0,0 @@ -package wazero - -import ( - "context" - "errors" - "fmt" - "io" - "io/fs" - "math" - "net" - "time" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/engine/compiler" - "github.com/tetratelabs/wazero/internal/engine/interpreter" - "github.com/tetratelabs/wazero/internal/filecache" - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/internalapi" - "github.com/tetratelabs/wazero/internal/platform" - internalsock "github.com/tetratelabs/wazero/internal/sock" - internalsys "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/sys" -) - -// RuntimeConfig controls runtime behavior, with the default implementation as -// NewRuntimeConfig -// -// The example below explicitly limits to Wasm Core 1.0 features as opposed to -// relying on defaults: -// -// rConfig = wazero.NewRuntimeConfig().WithCoreFeatures(api.CoreFeaturesV1) -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - RuntimeConfig is immutable. Each WithXXX function returns a new instance -// including the corresponding change. -type RuntimeConfig interface { - // WithCoreFeatures sets the WebAssembly Core specification features this - // runtime supports. Defaults to api.CoreFeaturesV2. - // - // Example of disabling a specific feature: - // features := api.CoreFeaturesV2.SetEnabled(api.CoreFeatureMutableGlobal, false) - // rConfig = wazero.NewRuntimeConfig().WithCoreFeatures(features) - // - // # Why default to version 2.0? - // - // Many compilers that target WebAssembly require features after - // api.CoreFeaturesV1 by default. For example, TinyGo v0.24+ requires - // api.CoreFeatureBulkMemoryOperations. To avoid runtime errors, wazero - // defaults to api.CoreFeaturesV2, even though it is not yet a Web - // Standard (REC). - WithCoreFeatures(api.CoreFeatures) RuntimeConfig - - // WithMemoryLimitPages overrides the maximum pages allowed per memory. The - // default is 65536, allowing 4GB total memory per instance if the maximum is - // not encoded in a Wasm binary. Setting a value larger than default will panic. - // - // This example reduces the largest possible memory size from 4GB to 128KB: - // rConfig = wazero.NewRuntimeConfig().WithMemoryLimitPages(2) - // - // Note: Wasm has 32-bit memory and each page is 65536 (2^16) bytes. This - // implies a max of 65536 (2^16) addressable pages. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#grow-mem - WithMemoryLimitPages(memoryLimitPages uint32) RuntimeConfig - - // WithMemoryCapacityFromMax eagerly allocates max memory, unless max is - // not defined. The default is false, which means minimum memory is - // allocated and any call to grow memory results in re-allocations. - // - // This example ensures any memory.grow instruction will never re-allocate: - // rConfig = wazero.NewRuntimeConfig().WithMemoryCapacityFromMax(true) - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#grow-mem - // - // Note: if the memory maximum is not encoded in a Wasm binary, this - // results in allocating 4GB. See the doc on WithMemoryLimitPages for detail. - WithMemoryCapacityFromMax(memoryCapacityFromMax bool) RuntimeConfig - - // WithDebugInfoEnabled toggles DWARF based stack traces in the face of - // runtime errors. Defaults to true. - // - // Those who wish to disable this, can like so: - // - // r := wazero.NewRuntimeWithConfig(wazero.NewRuntimeConfig().WithDebugInfoEnabled(false) - // - // When disabled, a stack trace message looks like: - // - // wasm stack trace: - // .runtime._panic(i32) - // .myFunc() - // .main.main() - // .runtime.run() - // ._start() - // - // When enabled, the stack trace includes source code information: - // - // wasm stack trace: - // .runtime._panic(i32) - // 0x16e2: /opt/homebrew/Cellar/tinygo/0.26.0/src/runtime/runtime_tinygowasm.go:73:6 - // .myFunc() - // 0x190b: /Users/XXXXX/wazero/internal/testing/dwarftestdata/testdata/main.go:19:7 - // .main.main() - // 0x18ed: /Users/XXXXX/wazero/internal/testing/dwarftestdata/testdata/main.go:4:3 - // .runtime.run() - // 0x18cc: /opt/homebrew/Cellar/tinygo/0.26.0/src/runtime/scheduler_none.go:26:10 - // ._start() - // 0x18b6: /opt/homebrew/Cellar/tinygo/0.26.0/src/runtime/runtime_wasm_wasi.go:22:5 - // - // Note: This only takes into effect when the original Wasm binary has the - // DWARF "custom sections" that are often stripped, depending on - // optimization flags passed to the compiler. - WithDebugInfoEnabled(bool) RuntimeConfig - - // WithCompilationCache configures how runtime caches the compiled modules. In the default configuration, compilation results are - // only in-memory until Runtime.Close is closed, and not shareable by multiple Runtime. - // - // Below defines the shared cache across multiple instances of Runtime: - // - // // Creates the new Cache and the runtime configuration with it. - // cache := wazero.NewCompilationCache() - // defer cache.Close() - // config := wazero.NewRuntimeConfig().WithCompilationCache(c) - // - // // Creates two runtimes while sharing compilation caches. - // foo := wazero.NewRuntimeWithConfig(context.Background(), config) - // bar := wazero.NewRuntimeWithConfig(context.Background(), config) - // - // # Cache Key - // - // Cached files are keyed on the version of wazero. This is obtained from go.mod of your application, - // and we use it to verify the compatibility of caches against the currently-running wazero. - // However, if you use this in tests of a package not named as `main`, then wazero cannot obtain the correct - // version of wazero due to the known issue of debug.BuildInfo function: https://github.com/golang/go/issues/33976. - // As a consequence, your cache won't contain the correct version information and always be treated as `dev` version. - // To avoid this issue, you can pass -ldflags "-X github.com/tetratelabs/wazero/internal/version.version=foo" when running tests. - WithCompilationCache(CompilationCache) RuntimeConfig - - // WithCustomSections toggles parsing of "custom sections". Defaults to false. - // - // When enabled, it is possible to retrieve custom sections from a CompiledModule: - // - // config := wazero.NewRuntimeConfig().WithCustomSections(true) - // r := wazero.NewRuntimeWithConfig(ctx, config) - // c, err := r.CompileModule(ctx, wasm) - // customSections := c.CustomSections() - WithCustomSections(bool) RuntimeConfig - - // WithCloseOnContextDone ensures the executions of functions to be closed under one of the following circumstances: - // - // - context.Context passed to the Call method of api.Function is canceled during execution. (i.e. ctx by context.WithCancel) - // - context.Context passed to the Call method of api.Function reaches timeout during execution. (i.e. ctx by context.WithTimeout or context.WithDeadline) - // - Close or CloseWithExitCode of api.Module is explicitly called during execution. - // - // This is especially useful when one wants to run untrusted Wasm binaries since otherwise, any invocation of - // api.Function can potentially block the corresponding Goroutine forever. Moreover, it might block the - // entire underlying OS thread which runs the api.Function call. See "Why it's safe to execute runtime-generated - // machine codes against async Goroutine preemption" section in internal/engine/compiler/RATIONALE.md for detail. - // - // Note that this comes with a bit of extra cost when enabled. The reason is that internally this forces - // interpreter and compiler runtimes to insert the periodical checks on the conditions above. For that reason, - // this is disabled by default. - // - // See examples in context_done_example_test.go for the end-to-end demonstrations. - // - // When the invocations of api.Function are closed due to this, sys.ExitError is raised to the callers and - // the api.Module from which the functions are derived is made closed. - WithCloseOnContextDone(bool) RuntimeConfig -} - -// NewRuntimeConfig returns a RuntimeConfig using the compiler if it is supported in this environment, -// or the interpreter otherwise. -func NewRuntimeConfig() RuntimeConfig { - return newRuntimeConfig() -} - -type newEngine func(context.Context, api.CoreFeatures, filecache.Cache) wasm.Engine - -type runtimeConfig struct { - enabledFeatures api.CoreFeatures - memoryLimitPages uint32 - memoryCapacityFromMax bool - engineKind engineKind - dwarfDisabled bool // negative as defaults to enabled - newEngine newEngine - cache CompilationCache - storeCustomSections bool - ensureTermination bool -} - -// engineLessConfig helps avoid copy/pasting the wrong defaults. -var engineLessConfig = &runtimeConfig{ - enabledFeatures: api.CoreFeaturesV2, - memoryLimitPages: wasm.MemoryLimitPages, - memoryCapacityFromMax: false, - dwarfDisabled: false, -} - -type engineKind int - -const ( - engineKindCompiler engineKind = iota - engineKindInterpreter - engineKindCount -) - -// NewRuntimeConfigCompiler compiles WebAssembly modules into -// runtime.GOARCH-specific assembly for optimal performance. -// -// The default implementation is AOT (Ahead of Time) compilation, applied at -// Runtime.CompileModule. This allows consistent runtime performance, as well -// the ability to reduce any first request penalty. -// -// Note: While this is technically AOT, this does not imply any action on your -// part. wazero automatically performs ahead-of-time compilation as needed when -// Runtime.CompileModule is invoked. -// -// Warning: This panics at runtime if the runtime.GOOS or runtime.GOARCH does not -// support Compiler. Use NewRuntimeConfig to safely detect and fallback to -// NewRuntimeConfigInterpreter if needed. -func NewRuntimeConfigCompiler() RuntimeConfig { - ret := engineLessConfig.clone() - ret.engineKind = engineKindCompiler - ret.newEngine = compiler.NewEngine - return ret -} - -// NewRuntimeConfigInterpreter interprets WebAssembly modules instead of compiling them into assembly. -func NewRuntimeConfigInterpreter() RuntimeConfig { - ret := engineLessConfig.clone() - ret.engineKind = engineKindInterpreter - ret.newEngine = interpreter.NewEngine - return ret -} - -// clone makes a deep copy of this runtime config. -func (c *runtimeConfig) clone() *runtimeConfig { - ret := *c // copy except maps which share a ref - return &ret -} - -// WithCoreFeatures implements RuntimeConfig.WithCoreFeatures -func (c *runtimeConfig) WithCoreFeatures(features api.CoreFeatures) RuntimeConfig { - ret := c.clone() - ret.enabledFeatures = features - return ret -} - -// WithCloseOnContextDone implements RuntimeConfig.WithCloseOnContextDone -func (c *runtimeConfig) WithCloseOnContextDone(ensure bool) RuntimeConfig { - ret := c.clone() - ret.ensureTermination = ensure - return ret -} - -// WithMemoryLimitPages implements RuntimeConfig.WithMemoryLimitPages -func (c *runtimeConfig) WithMemoryLimitPages(memoryLimitPages uint32) RuntimeConfig { - ret := c.clone() - // This panics instead of returning an error as it is unlikely. - if memoryLimitPages > wasm.MemoryLimitPages { - panic(fmt.Errorf("memoryLimitPages invalid: %d > %d", memoryLimitPages, wasm.MemoryLimitPages)) - } - ret.memoryLimitPages = memoryLimitPages - return ret -} - -// WithCompilationCache implements RuntimeConfig.WithCompilationCache -func (c *runtimeConfig) WithCompilationCache(ca CompilationCache) RuntimeConfig { - ret := c.clone() - ret.cache = ca - return ret -} - -// WithMemoryCapacityFromMax implements RuntimeConfig.WithMemoryCapacityFromMax -func (c *runtimeConfig) WithMemoryCapacityFromMax(memoryCapacityFromMax bool) RuntimeConfig { - ret := c.clone() - ret.memoryCapacityFromMax = memoryCapacityFromMax - return ret -} - -// WithDebugInfoEnabled implements RuntimeConfig.WithDebugInfoEnabled -func (c *runtimeConfig) WithDebugInfoEnabled(dwarfEnabled bool) RuntimeConfig { - ret := c.clone() - ret.dwarfDisabled = !dwarfEnabled - return ret -} - -// WithCustomSections implements RuntimeConfig.WithCustomSections -func (c *runtimeConfig) WithCustomSections(storeCustomSections bool) RuntimeConfig { - ret := c.clone() - ret.storeCustomSections = storeCustomSections - return ret -} - -// CompiledModule is a WebAssembly module ready to be instantiated (Runtime.InstantiateModule) as an api.Module. -// -// In WebAssembly terminology, this is a decoded, validated, and possibly also compiled module. wazero avoids using -// the name "Module" for both before and after instantiation as the name conflation has caused confusion. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#semantic-phases%E2%91%A0 -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - Closing the wazero.Runtime closes any CompiledModule it compiled. -type CompiledModule interface { - // Name returns the module name encoded into the binary or empty if not. - Name() string - - // ImportedFunctions returns all the imported functions - // (api.FunctionDefinition) in this module or nil if there are none. - // - // Note: Unlike ExportedFunctions, there is no unique constraint on - // imports. - ImportedFunctions() []api.FunctionDefinition - - // ExportedFunctions returns all the exported functions - // (api.FunctionDefinition) in this module keyed on export name. - ExportedFunctions() map[string]api.FunctionDefinition - - // ImportedMemories returns all the imported memories - // (api.MemoryDefinition) in this module or nil if there are none. - // - // ## Notes - // - As of WebAssembly Core Specification 2.0, there can be at most one - // memory. - // - Unlike ExportedMemories, there is no unique constraint on imports. - ImportedMemories() []api.MemoryDefinition - - // ExportedMemories returns all the exported memories - // (api.MemoryDefinition) in this module keyed on export name. - // - // Note: As of WebAssembly Core Specification 2.0, there can be at most one - // memory. - ExportedMemories() map[string]api.MemoryDefinition - - // CustomSections returns all the custom sections - // (api.CustomSection) in this module keyed on the section name. - CustomSections() []api.CustomSection - - // Close releases all the allocated resources for this CompiledModule. - // - // Note: It is safe to call Close while having outstanding calls from an - // api.Module instantiated from this. - Close(context.Context) error -} - -// compile-time check to ensure compiledModule implements CompiledModule -var _ CompiledModule = &compiledModule{} - -type compiledModule struct { - module *wasm.Module - // compiledEngine holds an engine on which `module` is compiled. - compiledEngine wasm.Engine - // closeWithModule prevents leaking compiled code when a module is compiled implicitly. - closeWithModule bool - typeIDs []wasm.FunctionTypeID -} - -// Name implements CompiledModule.Name -func (c *compiledModule) Name() (moduleName string) { - if ns := c.module.NameSection; ns != nil { - moduleName = ns.ModuleName - } - return -} - -// Close implements CompiledModule.Close -func (c *compiledModule) Close(context.Context) error { - c.compiledEngine.DeleteCompiledModule(c.module) - // It is possible the underlying may need to return an error later, but in any case this matches api.Module.Close. - return nil -} - -// ImportedFunctions implements CompiledModule.ImportedFunctions -func (c *compiledModule) ImportedFunctions() []api.FunctionDefinition { - return c.module.ImportedFunctions() -} - -// ExportedFunctions implements CompiledModule.ExportedFunctions -func (c *compiledModule) ExportedFunctions() map[string]api.FunctionDefinition { - return c.module.ExportedFunctions() -} - -// ImportedMemories implements CompiledModule.ImportedMemories -func (c *compiledModule) ImportedMemories() []api.MemoryDefinition { - return c.module.ImportedMemories() -} - -// ExportedMemories implements CompiledModule.ExportedMemories -func (c *compiledModule) ExportedMemories() map[string]api.MemoryDefinition { - return c.module.ExportedMemories() -} - -// CustomSections implements CompiledModule.CustomSections -func (c *compiledModule) CustomSections() []api.CustomSection { - ret := make([]api.CustomSection, len(c.module.CustomSections)) - for i, d := range c.module.CustomSections { - ret[i] = &customSection{data: d.Data, name: d.Name} - } - return ret -} - -// customSection implements wasm.CustomSection -type customSection struct { - internalapi.WazeroOnlyType - name string - data []byte -} - -// Name implements wasm.CustomSection.Name -func (c *customSection) Name() string { - return c.name -} - -// Data implements wasm.CustomSection.Data -func (c *customSection) Data() []byte { - return c.data -} - -// ModuleConfig configures resources needed by functions that have low-level interactions with the host operating -// system. Using this, resources such as STDIN can be isolated, so that the same module can be safely instantiated -// multiple times. -// -// Here's an example: -// -// // Initialize base configuration: -// config := wazero.NewModuleConfig().WithStdout(buf).WithSysNanotime() -// -// // Assign different configuration on each instantiation -// mod, _ := r.InstantiateModule(ctx, compiled, config.WithName("rotate").WithArgs("rotate", "angle=90", "dir=cw")) -// -// While wazero supports Windows as a platform, host functions using ModuleConfig follow a UNIX dialect. -// See RATIONALE.md for design background and relationship to WebAssembly System Interfaces (WASI). -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - ModuleConfig is immutable. Each WithXXX function returns a new instance -// including the corresponding change. -type ModuleConfig interface { - // WithArgs assigns command-line arguments visible to an imported function that reads an arg vector (argv). Defaults to - // none. Runtime.InstantiateModule errs if any arg is empty. - // - // These values are commonly read by the functions like "args_get" in "wasi_snapshot_preview1" although they could be - // read by functions imported from other modules. - // - // Similar to os.Args and exec.Cmd Env, many implementations would expect a program name to be argv[0]. However, neither - // WebAssembly nor WebAssembly System Interfaces (WASI) define this. Regardless, you may choose to set the first - // argument to the same value set via WithName. - // - // Note: This does not default to os.Args as that violates sandboxing. - // - // See https://linux.die.net/man/3/argv and https://en.wikipedia.org/wiki/Null-terminated_string - WithArgs(...string) ModuleConfig - - // WithEnv sets an environment variable visible to a Module that imports functions. Defaults to none. - // Runtime.InstantiateModule errs if the key is empty or contains a NULL(0) or equals("") character. - // - // Validation is the same as os.Setenv on Linux and replaces any existing value. Unlike exec.Cmd Env, this does not - // default to the current process environment as that would violate sandboxing. This also does not preserve order. - // - // Environment variables are commonly read by the functions like "environ_get" in "wasi_snapshot_preview1" although - // they could be read by functions imported from other modules. - // - // While similar to process configuration, there are no assumptions that can be made about anything OS-specific. For - // example, neither WebAssembly nor WebAssembly System Interfaces (WASI) define concerns processes have, such as - // case-sensitivity on environment keys. For portability, define entries with case-insensitively unique keys. - // - // See https://linux.die.net/man/3/environ and https://en.wikipedia.org/wiki/Null-terminated_string - WithEnv(key, value string) ModuleConfig - - // WithFS is a convenience that calls WithFSConfig with an FSConfig of the - // input for the root ("/") guest path. - WithFS(fs.FS) ModuleConfig - - // WithFSConfig configures the filesystem available to each guest - // instantiated with this configuration. By default, no file access is - // allowed, so functions like `path_open` result in unsupported errors - // (e.g. syscall.ENOSYS). - WithFSConfig(FSConfig) ModuleConfig - - // WithName configures the module name. Defaults to what was decoded from - // the name section. Empty string ("") clears any name. - WithName(string) ModuleConfig - - // WithStartFunctions configures the functions to call after the module is - // instantiated. Defaults to "_start". - // - // # Notes - // - // - If any function doesn't exist, it is skipped. However, all functions - // that do exist are called in order. - // - Some start functions may exit the module during instantiate with a - // sys.ExitError (e.g. emscripten), preventing use of exported functions. - WithStartFunctions(...string) ModuleConfig - - // WithStderr configures where standard error (file descriptor 2) is written. Defaults to io.Discard. - // - // This writer is most commonly used by the functions like "fd_write" in "wasi_snapshot_preview1" although it could - // be used by functions imported from other modules. - // - // # Notes - // - // - The caller is responsible to close any io.Writer they supply: It is not closed on api.Module Close. - // - This does not default to os.Stderr as that both violates sandboxing and prevents concurrent modules. - // - // See https://linux.die.net/man/3/stderr - WithStderr(io.Writer) ModuleConfig - - // WithStdin configures where standard input (file descriptor 0) is read. Defaults to return io.EOF. - // - // This reader is most commonly used by the functions like "fd_read" in "wasi_snapshot_preview1" although it could - // be used by functions imported from other modules. - // - // # Notes - // - // - The caller is responsible to close any io.Reader they supply: It is not closed on api.Module Close. - // - This does not default to os.Stdin as that both violates sandboxing and prevents concurrent modules. - // - // See https://linux.die.net/man/3/stdin - WithStdin(io.Reader) ModuleConfig - - // WithStdout configures where standard output (file descriptor 1) is written. Defaults to io.Discard. - // - // This writer is most commonly used by the functions like "fd_write" in "wasi_snapshot_preview1" although it could - // be used by functions imported from other modules. - // - // # Notes - // - // - The caller is responsible to close any io.Writer they supply: It is not closed on api.Module Close. - // - This does not default to os.Stdout as that both violates sandboxing and prevents concurrent modules. - // - // See https://linux.die.net/man/3/stdout - WithStdout(io.Writer) ModuleConfig - - // WithWalltime configures the wall clock, sometimes referred to as the - // real time clock. sys.Walltime returns the current unix/epoch time, - // seconds since midnight UTC 1 January 1970, with a nanosecond fraction. - // This defaults to a fake result that increases by 1ms on each reading. - // - // Here's an example that uses a custom clock: - // moduleConfig = moduleConfig. - // WithWalltime(func(context.Context) (sec int64, nsec int32) { - // return clock.walltime() - // }, sys.ClockResolution(time.Microsecond.Nanoseconds())) - // - // # Notes: - // - This does not default to time.Now as that violates sandboxing. - // - This is used to implement host functions such as WASI - // `clock_time_get` with the `realtime` clock ID. - // - Use WithSysWalltime for a usable implementation. - WithWalltime(sys.Walltime, sys.ClockResolution) ModuleConfig - - // WithSysWalltime uses time.Now for sys.Walltime with a resolution of 1us - // (1000ns). - // - // See WithWalltime - WithSysWalltime() ModuleConfig - - // WithNanotime configures the monotonic clock, used to measure elapsed - // time in nanoseconds. Defaults to a fake result that increases by 1ms - // on each reading. - // - // Here's an example that uses a custom clock: - // moduleConfig = moduleConfig. - // WithNanotime(func(context.Context) int64 { - // return clock.nanotime() - // }, sys.ClockResolution(time.Microsecond.Nanoseconds())) - // - // # Notes: - // - This does not default to time.Since as that violates sandboxing. - // - This is used to implement host functions such as WASI - // `clock_time_get` with the `monotonic` clock ID. - // - Some compilers implement sleep by looping on sys.Nanotime (e.g. Go). - // - If you set this, you should probably set WithNanosleep also. - // - Use WithSysNanotime for a usable implementation. - WithNanotime(sys.Nanotime, sys.ClockResolution) ModuleConfig - - // WithSysNanotime uses time.Now for sys.Nanotime with a resolution of 1us. - // - // See WithNanotime - WithSysNanotime() ModuleConfig - - // WithNanosleep configures the how to pause the current goroutine for at - // least the configured nanoseconds. Defaults to return immediately. - // - // This example uses a custom sleep function: - // moduleConfig = moduleConfig. - // WithNanosleep(func(ns int64) { - // rel := unix.NsecToTimespec(ns) - // remain := unix.Timespec{} - // for { // loop until no more time remaining - // err := unix.ClockNanosleep(unix.CLOCK_MONOTONIC, 0, &rel, &remain) - // --snip-- - // - // # Notes: - // - This does not default to time.Sleep as that violates sandboxing. - // - This is used to implement host functions such as WASI `poll_oneoff`. - // - Some compilers implement sleep by looping on sys.Nanotime (e.g. Go). - // - If you set this, you should probably set WithNanotime also. - // - Use WithSysNanosleep for a usable implementation. - WithNanosleep(sys.Nanosleep) ModuleConfig - - // WithOsyield yields the processor, typically to implement spin-wait - // loops. Defaults to return immediately. - // - // # Notes: - // - This primarily supports `sched_yield` in WASI - // - This does not default to runtime.osyield as that violates sandboxing. - WithOsyield(sys.Osyield) ModuleConfig - - // WithSysNanosleep uses time.Sleep for sys.Nanosleep. - // - // See WithNanosleep - WithSysNanosleep() ModuleConfig - - // WithRandSource configures a source of random bytes. Defaults to return a - // deterministic source. You might override this with crypto/rand.Reader - // - // This reader is most commonly used by the functions like "random_get" in - // "wasi_snapshot_preview1", "seed" in AssemblyScript standard "env", and - // "getRandomData" when runtime.GOOS is "js". - // - // Note: The caller is responsible to close any io.Reader they supply: It - // is not closed on api.Module Close. - WithRandSource(io.Reader) ModuleConfig -} - -type moduleConfig struct { - name string - nameSet bool - startFunctions []string - stdin io.Reader - stdout io.Writer - stderr io.Writer - randSource io.Reader - walltime sys.Walltime - walltimeResolution sys.ClockResolution - nanotime sys.Nanotime - nanotimeResolution sys.ClockResolution - nanosleep sys.Nanosleep - osyield sys.Osyield - args [][]byte - // environ is pair-indexed to retain order similar to os.Environ. - environ [][]byte - // environKeys allow overwriting of existing values. - environKeys map[string]int - // fsConfig is the file system configuration for ABI like WASI. - fsConfig FSConfig - // sockConfig is the network listener configuration for ABI like WASI. - sockConfig *internalsock.Config -} - -// NewModuleConfig returns a ModuleConfig that can be used for configuring module instantiation. -func NewModuleConfig() ModuleConfig { - return &moduleConfig{ - startFunctions: []string{"_start"}, - environKeys: map[string]int{}, - } -} - -// clone makes a deep copy of this module config. -func (c *moduleConfig) clone() *moduleConfig { - ret := *c // copy except maps which share a ref - ret.environKeys = make(map[string]int, len(c.environKeys)) - for key, value := range c.environKeys { - ret.environKeys[key] = value - } - return &ret -} - -// WithArgs implements ModuleConfig.WithArgs -func (c *moduleConfig) WithArgs(args ...string) ModuleConfig { - ret := c.clone() - ret.args = toByteSlices(args) - return ret -} - -func toByteSlices(strings []string) (result [][]byte) { - if len(strings) == 0 { - return - } - result = make([][]byte, len(strings)) - for i, a := range strings { - result[i] = []byte(a) - } - return -} - -// WithEnv implements ModuleConfig.WithEnv -func (c *moduleConfig) WithEnv(key, value string) ModuleConfig { - ret := c.clone() - // Check to see if this key already exists and update it. - if i, ok := ret.environKeys[key]; ok { - ret.environ[i+1] = []byte(value) // environ is pair-indexed, so the value is 1 after the key. - } else { - ret.environKeys[key] = len(ret.environ) - ret.environ = append(ret.environ, []byte(key), []byte(value)) - } - return ret -} - -// WithFS implements ModuleConfig.WithFS -func (c *moduleConfig) WithFS(fs fs.FS) ModuleConfig { - var config FSConfig - if fs != nil { - config = NewFSConfig().WithFSMount(fs, "") - } - return c.WithFSConfig(config) -} - -// WithFSConfig implements ModuleConfig.WithFSConfig -func (c *moduleConfig) WithFSConfig(config FSConfig) ModuleConfig { - ret := c.clone() - ret.fsConfig = config - return ret -} - -// WithName implements ModuleConfig.WithName -func (c *moduleConfig) WithName(name string) ModuleConfig { - ret := c.clone() - ret.nameSet = true - ret.name = name - return ret -} - -// WithStartFunctions implements ModuleConfig.WithStartFunctions -func (c *moduleConfig) WithStartFunctions(startFunctions ...string) ModuleConfig { - ret := c.clone() - ret.startFunctions = startFunctions - return ret -} - -// WithStderr implements ModuleConfig.WithStderr -func (c *moduleConfig) WithStderr(stderr io.Writer) ModuleConfig { - ret := c.clone() - ret.stderr = stderr - return ret -} - -// WithStdin implements ModuleConfig.WithStdin -func (c *moduleConfig) WithStdin(stdin io.Reader) ModuleConfig { - ret := c.clone() - ret.stdin = stdin - return ret -} - -// WithStdout implements ModuleConfig.WithStdout -func (c *moduleConfig) WithStdout(stdout io.Writer) ModuleConfig { - ret := c.clone() - ret.stdout = stdout - return ret -} - -// WithWalltime implements ModuleConfig.WithWalltime -func (c *moduleConfig) WithWalltime(walltime sys.Walltime, resolution sys.ClockResolution) ModuleConfig { - ret := c.clone() - ret.walltime = walltime - ret.walltimeResolution = resolution - return ret -} - -// We choose arbitrary resolutions here because there's no perfect alternative. For example, according to the -// source in time.go, windows monotonic resolution can be 15ms. This chooses arbitrarily 1us for wall time and -// 1ns for monotonic. See RATIONALE.md for more context. - -// WithSysWalltime implements ModuleConfig.WithSysWalltime -func (c *moduleConfig) WithSysWalltime() ModuleConfig { - return c.WithWalltime(platform.Walltime, sys.ClockResolution(time.Microsecond.Nanoseconds())) -} - -// WithNanotime implements ModuleConfig.WithNanotime -func (c *moduleConfig) WithNanotime(nanotime sys.Nanotime, resolution sys.ClockResolution) ModuleConfig { - ret := c.clone() - ret.nanotime = nanotime - ret.nanotimeResolution = resolution - return ret -} - -// WithSysNanotime implements ModuleConfig.WithSysNanotime -func (c *moduleConfig) WithSysNanotime() ModuleConfig { - return c.WithNanotime(platform.Nanotime, sys.ClockResolution(1)) -} - -// WithNanosleep implements ModuleConfig.WithNanosleep -func (c *moduleConfig) WithNanosleep(nanosleep sys.Nanosleep) ModuleConfig { - ret := *c // copy - ret.nanosleep = nanosleep - return &ret -} - -// WithOsyield implements ModuleConfig.WithOsyield -func (c *moduleConfig) WithOsyield(osyield sys.Osyield) ModuleConfig { - ret := *c // copy - ret.osyield = osyield - return &ret -} - -// WithSysNanosleep implements ModuleConfig.WithSysNanosleep -func (c *moduleConfig) WithSysNanosleep() ModuleConfig { - return c.WithNanosleep(platform.Nanosleep) -} - -// WithRandSource implements ModuleConfig.WithRandSource -func (c *moduleConfig) WithRandSource(source io.Reader) ModuleConfig { - ret := c.clone() - ret.randSource = source - return ret -} - -// toSysContext creates a baseline wasm.Context configured by ModuleConfig. -func (c *moduleConfig) toSysContext() (sysCtx *internalsys.Context, err error) { - var environ [][]byte // Intentionally doesn't pre-allocate to reduce logic to default to nil. - // Same validation as syscall.Setenv for Linux - for i := 0; i < len(c.environ); i += 2 { - key, value := c.environ[i], c.environ[i+1] - keyLen := len(key) - if keyLen == 0 { - err = errors.New("environ invalid: empty key") - return - } - valueLen := len(value) - result := make([]byte, keyLen+valueLen+1) - j := 0 - for ; j < keyLen; j++ { - if k := key[j]; k == '=' { // NUL enforced in NewContext - err = errors.New("environ invalid: key contains '=' character") - return - } else { - result[j] = k - } - } - result[j] = '=' - copy(result[j+1:], value) - environ = append(environ, result) - } - - var fs fsapi.FS - if f, ok := c.fsConfig.(*fsConfig); ok { - if fs, err = f.toFS(); err != nil { - return - } - } - - var listeners []*net.TCPListener - if n := c.sockConfig; n != nil { - if listeners, err = n.BuildTCPListeners(); err != nil { - return - } - } - - return internalsys.NewContext( - math.MaxUint32, - c.args, - environ, - c.stdin, - c.stdout, - c.stderr, - c.randSource, - c.walltime, c.walltimeResolution, - c.nanotime, c.nanotimeResolution, - c.nanosleep, c.osyield, - fs, - listeners, - ) -} diff --git a/vendor/github.com/tetratelabs/wazero/config_supported.go b/vendor/github.com/tetratelabs/wazero/config_supported.go deleted file mode 100644 index eb31ab9356..0000000000 --- a/vendor/github.com/tetratelabs/wazero/config_supported.go +++ /dev/null @@ -1,14 +0,0 @@ -// Note: The build constraints here are about the compiler, which is more -// narrow than the architectures supported by the assembler. -// -// Constraints here must match platform.CompilerSupported. -// -// Meanwhile, users who know their runtime.GOOS can operate with the compiler -// may choose to use NewRuntimeConfigCompiler explicitly. -//go:build (amd64 || arm64) && (darwin || linux || freebsd || windows) - -package wazero - -func newRuntimeConfig() RuntimeConfig { - return NewRuntimeConfigCompiler() -} diff --git a/vendor/github.com/tetratelabs/wazero/config_unsupported.go b/vendor/github.com/tetratelabs/wazero/config_unsupported.go deleted file mode 100644 index 3e5a53cda5..0000000000 --- a/vendor/github.com/tetratelabs/wazero/config_unsupported.go +++ /dev/null @@ -1,8 +0,0 @@ -// This is the opposite constraint of config_supported.go -//go:build !(amd64 || arm64) || !(darwin || linux || freebsd || windows) - -package wazero - -func newRuntimeConfig() RuntimeConfig { - return NewRuntimeConfigInterpreter() -} diff --git a/vendor/github.com/tetratelabs/wazero/examples/basic/testdata/add.wasm b/vendor/github.com/tetratelabs/wazero/examples/basic/testdata/add.wasm deleted file mode 100644 index 259ca4f00afac1d80527d7efd4694337a266b4fe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6093 zcmbtYU1%KF6~6b*?9A@Yt~9n~dn3vA-HA%&x{@W?S;Zzax^85-ab1Td4}})w(e6mv zAMLJoM{-O9YsV?L5NK%f;6fkz&_W(k$U_RDc6-roJ-R%fU9YWP?$zUnG3&@-#)Ks-p0P6A;g%4YjKyuv zZCfzgwe1Y=a?8RT6Hb;7xVn1P_S~mjXDiz3^sWfzY=x~>r^@!)>%AyqV@}nKOKvYR zy~mu@ejN5n{xjs(4B zL)A=`b|r&qnC5v*UAtzhy}r%7{Y-sw)m8_52Oe?XQF-5GB=LGGF+*_ zDED1$jkXgoXgj?P0`1l{ds?u7t1s9Edx?f5*$6~MkfPhy?1p5g;X70R=G!X2g2^w~ z$~G`jZ$p^m6jyJ-1g>7YZu@MUlqiOIZ`AWG=Ka&=?m#kHapSr@>Z#9Pw&^))LF=zy zTC|w@5;J%(bB5Cdb{lOdd$*iXw_er;+GWd1fE7#9lJ*K*6J-v>6)$swTnaLAL}gqT7(TOSSKx`2wE(iRC~T$WEP?<5)GR?( zW|~MG?vEgTnWjQ60QDrmlG75d1l}e-A(!B)9TNZ`qyj7McuWc~=zT=9NI3zMT)hQ? zjZEi&kD$23IaLBC`9*{o)L=w%L7Ki*go*^(i@LAzwRZzy+*+nde@{9DTzaC2v>oQS zcbFwAFp01tr0D2??ka2B`x^GYPapvN6n85XOXKdHbz?Uk>DCUkP6(#smbBdX&_SJ_%jB|&0z~P`t?H;zG`utb0^&qkJM6xCc za6njm{tB}D1J-T^6eCJEOeU118Y&Yi119K&NhwTtg^7muDhGoQcZo0}?ucMTj3xE2 zY*B~YZx8`+9#(`8R2c%#6gx*%K{7u}<-UY2nn{|eh^%R_Hi3nj0yGsGs2%%sfhBFU zp=@AZq@|zHHoZfnrRC~<&13bhZm^H=4|&V*2iE%9+Qbyd-lKfKDLte?>-P^(f%35l zGXEy3`N99W&4l+4!SnZ_Qfi!Gbh2=2d?<7(!cJk*9mx$wHZ>0zuV6gtM`;&{0Td_7 zt|B*uKUoG#DVqo%0!_mtP&!eXEd9z-SyS5#96?rExMeheWRNl8zCOX|}q?i_2R9AHUQPf?cl?KX$-Svq=g3}AnBOQfMmpIP(9%@)=rB;;1ZiNn$4gqcBN^bCS65TGp{^g4rMs^^;wxC znrq2YP^buL`jbJnBBo?^xk$L@r7H_Edza!uqT)d}#e%Lu$VA-eH927<=t*u&8?q93 zBVwHBh**&akn7(Ls%BaOC`i*YUy@|}n z1J^6y1ZTCvGE_(Sr~7?}blVaK^- z1xB#o+aQ)pWo*Id2l z_i%dCA1&F7P+}3QFikvxJwKp*XeIiW@DdWPEMC-?AY5dK!URvk2kExpX+>=6>n*OF zW?|PfSGj3hv`MrHMtXEt zw~-5EQGiuBom6IRt|DIH$PuX1iyzoW22gW@Y{TNI0NME}vWj3Zf|6llWEj>%z=jQZ zB%42x-2BN}a6;0;*GLNnQvvpTgUcM9LSU3$j`;$;Br|iQ;gHTj1YR?Wn1lXNVJ|{N z_X>+xfgTc!*rO#&6yK8RPZHBnqs{)HuQdHBQy_HEZjwn@@^fk-{tId$`b%m-u{WuO zUy}5`l?-$`z0E03`sPEHYu|AXh2>@Z5k@9bNrcLGAb4+01Z9Y#4xR#@Y*HV=iw{Y^ zOFR9JdNAXCYQgRIsD(N2;usm0P_blQew+w@k_df78)oV64Q={;#kE)we0@!j}t4Dk>gejlVuz+A;2n%mJtQLWzJ&Lkomh6(rTJFY4cqnVX_+*=opxN`ie%L5b$X{| zyWUFm%UaZn*73BfQN3M@UX+QNUfAA<`mK63x^IS2`S<2Oc$u@?*q8pj!8xNb{j>2D z@R-rvRdrXL6Sa0b>#+dE-PjHEJ~VSn?)g0(Llw>q8XPWL(T z&pwb&Cas=Tab|BiuN}~{&QL+O2W0y(emC6FRIs}fS2x36wwO-n&xyG`>2NFTHNV^G z#Qpri>2z+RdIldOn@4By#W9Y&@rPf~sd{^{e# zH|p``&f09XvvoY`<4bqHUtd4oYVB^#V09y^#xk5+tcL5g@YMXtx$0W&RCHo-;lvZw z`6m_@)=n-|7EdlL%-0selSiEw>g_8l9cONK;mO%~_MK6Dyxxf7)%7Thcc9rmHoCPF yhik29W~0?v3tRnT``Vp$+zY#15O`+28&jb;=B@3tnlmQ%k7fJyjrL6RV*DQ!u2SIu diff --git a/vendor/github.com/tetratelabs/wazero/experimental/experimental.go b/vendor/github.com/tetratelabs/wazero/experimental/experimental.go deleted file mode 100644 index 63fd564da3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/experimental/experimental.go +++ /dev/null @@ -1,41 +0,0 @@ -// Package experimental includes features we aren't yet sure about. These are enabled with context.Context keys. -// -// Note: All features here may be changed or deleted at any time, so use with caution! -package experimental - -import ( - "github.com/tetratelabs/wazero/api" -) - -// InternalModule is an api.Module that exposes additional -// information. -type InternalModule interface { - api.Module - - // NumGlobal returns the count of all globals in the module. - NumGlobal() int - - // Global provides a read-only view for a given global index. - // - // The methods panics if i is out of bounds. - Global(i int) api.Global -} - -// ProgramCounter is an opaque value representing a specific execution point in -// a module. It is meant to be used with Function.SourceOffsetForPC and -// StackIterator. -type ProgramCounter uint64 - -// InternalFunction exposes some information about a function instance. -type InternalFunction interface { - // Definition provides introspection into the function's names and - // signature. - Definition() api.FunctionDefinition - - // SourceOffsetForPC resolves a program counter into its corresponding - // offset in the Code section of the module this function belongs to. - // The source offset is meant to help map the function calls to their - // location in the original source files. Returns 0 if the offset cannot - // be calculated. - SourceOffsetForPC(pc ProgramCounter) uint64 -} diff --git a/vendor/github.com/tetratelabs/wazero/experimental/gojs/README.md b/vendor/github.com/tetratelabs/wazero/experimental/gojs/README.md deleted file mode 100644 index b608b576f2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/experimental/gojs/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Overview - -When `GOOS=js` and `GOARCH=wasm`, Go's compiler targets WebAssembly Binary -format (%.wasm). - -Wazero's "github.com/tetratelabs/wazero/experimental/gojs" package allows you to run -a `%.wasm` file compiled by Go. This is similar to what is implemented in -[wasm_exec.js][1]. See https://wazero.io/languages/go/ for more. - -## Example - -wazero includes an [example](example) that makes HTTP client requests. - -## Experimental - -Go defines js "EXPERIMENTAL... exempt from the Go compatibility promise." -Accordingly, wazero cannot guarantee this will work from release to release, -or that usage will be relatively free of bugs. Moreover, [`GOOS=wasip1`][2] will be shipped -in Go 1.21, and once that's available in two releases wazero will remove this -package. - -Due to these concerns and the relatively high implementation overhead, most -will choose TinyGo instead of gojs. - -[1]: https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js -[2]: https://github.com/golang/go/issues/58141 diff --git a/vendor/github.com/tetratelabs/wazero/experimental/gojs/gojs.go b/vendor/github.com/tetratelabs/wazero/experimental/gojs/gojs.go deleted file mode 100644 index 67f855668d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/experimental/gojs/gojs.go +++ /dev/null @@ -1,211 +0,0 @@ -// Package gojs allows you to run wasm binaries compiled by Go when -// `GOARCH=wasm GOOS=js`. See https://wazero.io/languages/go/ for more. -// -// # Experimental -// -// Go defines js "EXPERIMENTAL... exempt from the Go compatibility promise." -// Accordingly, wazero cannot guarantee this will work from release to release, -// or that usage will be relatively free of bugs. Moreover, `GOOS=wasi` will -// happen, and once that's available in two releases wazero will remove this -// package. -// -// Due to these concerns and the relatively high implementation overhead, most -// will choose TinyGo instead of gojs. -package gojs - -import ( - "context" - "net/http" - - "github.com/tetratelabs/wazero" - "github.com/tetratelabs/wazero/api" - . "github.com/tetratelabs/wazero/internal/gojs" - internalconfig "github.com/tetratelabs/wazero/internal/gojs/config" - . "github.com/tetratelabs/wazero/internal/gojs/run" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// MustInstantiate calls Instantiate or panics on error. -// -// This is a simpler function for those who know the module "go" is not -// already instantiated, and don't need to unload it. -func MustInstantiate(ctx context.Context, r wazero.Runtime) { - if _, err := Instantiate(ctx, r); err != nil { - panic(err) - } -} - -// Instantiate instantiates the "go" module, used by `GOARCH=wasm GOOS=js`, -// into the runtime. -// -// # Notes -// -// - Failure cases are documented on wazero.Runtime InstantiateModule. -// - Closing the wazero.Runtime has the same effect as closing the result. -// - To add more functions to the "env" module, use FunctionExporter. -func Instantiate(ctx context.Context, r wazero.Runtime) (api.Closer, error) { - builder := r.NewHostModuleBuilder("go") - NewFunctionExporter().ExportFunctions(builder) - return builder.Instantiate(ctx) -} - -// FunctionExporter configures the functions in the "go" module used by -// `GOARCH=wasm GOOS=js`. -type FunctionExporter interface { - // ExportFunctions builds functions to export with a - // wazero.HostModuleBuilder named "go". - ExportFunctions(wazero.HostModuleBuilder) -} - -// NewFunctionExporter returns a FunctionExporter object. -func NewFunctionExporter() FunctionExporter { - return &functionExporter{} -} - -type functionExporter struct{} - -// ExportFunctions implements FunctionExporter.ExportFunctions -func (e *functionExporter) ExportFunctions(builder wazero.HostModuleBuilder) { - hfExporter := builder.(wasm.HostFuncExporter) - - hfExporter.ExportHostFunc(GetRandomData) - hfExporter.ExportHostFunc(Nanotime1) - hfExporter.ExportHostFunc(WasmExit) - hfExporter.ExportHostFunc(CopyBytesToJS) - hfExporter.ExportHostFunc(ValueCall) - hfExporter.ExportHostFunc(ValueGet) - hfExporter.ExportHostFunc(ValueIndex) - hfExporter.ExportHostFunc(ValueLength) - hfExporter.ExportHostFunc(ValueNew) - hfExporter.ExportHostFunc(ValueSet) - hfExporter.ExportHostFunc(WasmWrite) - hfExporter.ExportHostFunc(ResetMemoryDataView) - hfExporter.ExportHostFunc(Walltime) - hfExporter.ExportHostFunc(ScheduleTimeoutEvent) - hfExporter.ExportHostFunc(ClearTimeoutEvent) - hfExporter.ExportHostFunc(FinalizeRef) - hfExporter.ExportHostFunc(StringVal) - hfExporter.ExportHostFunc(ValueDelete) - hfExporter.ExportHostFunc(ValueSetIndex) - hfExporter.ExportHostFunc(ValueInvoke) - hfExporter.ExportHostFunc(ValuePrepareString) - hfExporter.ExportHostFunc(ValueInstanceOf) - hfExporter.ExportHostFunc(ValueLoadString) - hfExporter.ExportHostFunc(CopyBytesToGo) - hfExporter.ExportHostFunc(Debug) -} - -// Config extends wazero.ModuleConfig with GOOS=js specific extensions. -// Use NewConfig to create an instance. -type Config interface { - // WithOSWorkdir sets the initial working directory used to Run Wasm to - // the value of os.Getwd instead of the default of root "/". - // - // Here's an example that overrides this to the current directory: - // - // err = gojs.Run(ctx, r, compiled, gojs.NewConfig(moduleConfig). - // WithOSWorkdir()) - // - // Note: To use this feature requires mounting the real root directory via - // wazero.FSConfig `WithDirMount`. On windows, this root must be the same drive - // as the value of os.Getwd. For example, it would be an error to mount `C:\` - // as the guest path "", while the current directory is inside `D:\`. - WithOSWorkdir() Config - - // WithOSUser allows the guest to see the current user's uid, gid, euid and - // groups, instead of zero for each value. - // - // Here's an example that uses the real user's IDs: - // - // err = gojs.Run(ctx, r, compiled, gojs.NewConfig(moduleConfig). - // WithOSUser()) - // - // Note: This has no effect on windows. - WithOSUser() Config - - // WithRoundTripper sets the http.RoundTripper used to Run Wasm. - // - // For example, if the code compiled via `GOARCH=wasm GOOS=js` uses - // http.RoundTripper, you can avoid failures by assigning an implementation - // like so: - // - // err = gojs.Run(ctx, r, compiled, gojs.NewConfig(moduleConfig). - // WithRoundTripper(ctx, http.DefaultTransport)) - WithRoundTripper(http.RoundTripper) Config -} - -// NewConfig returns a Config that can be used for configuring module instantiation. -func NewConfig(moduleConfig wazero.ModuleConfig) Config { - return &cfg{moduleConfig: moduleConfig, internal: internalconfig.NewConfig()} -} - -type cfg struct { - moduleConfig wazero.ModuleConfig - internal *internalconfig.Config -} - -func (c *cfg) clone() *cfg { - return &cfg{moduleConfig: c.moduleConfig, internal: c.internal.Clone()} -} - -// WithOSWorkdir implements Config.WithOSWorkdir -func (c *cfg) WithOSWorkdir() Config { - ret := c.clone() - ret.internal.OsWorkdir = true - return ret -} - -// WithOSUser implements Config.WithOSUser -func (c *cfg) WithOSUser() Config { - ret := c.clone() - ret.internal.OsUser = true - return ret -} - -// WithRoundTripper implements Config.WithRoundTripper -func (c *cfg) WithRoundTripper(rt http.RoundTripper) Config { - ret := c.clone() - ret.internal.Rt = rt - return ret -} - -// Run instantiates a new module and calls "run" with the given config. -// -// # Parameters -// -// - ctx: context to use when instantiating the module and calling "run". -// - r: runtime to instantiate both the host and guest (compiled) module in. -// - compiled: guest binary compiled with `GOARCH=wasm GOOS=js` -// - config: the Config to use including wazero.ModuleConfig or extensions of -// it. -// -// # Example -// -// After compiling your Wasm binary with wazero.Runtime's `CompileModule`, run -// it like below: -// -// // Instantiate host functions needed by gojs -// gojs.MustInstantiate(ctx, r) -// -// // Assign any configuration relevant for your compiled wasm. -// config := gojs.NewConfig(wazero.NewConfig()) -// -// // Run your wasm, notably handing any ExitError -// err = gojs.Run(ctx, r, compiled, config) -// if exitErr, ok := err.(*sys.ExitError); ok && exitErr.ExitCode() != 0 { -// log.Panicln(err) -// } else if !ok { -// log.Panicln(err) -// } -// -// # Notes -// -// - Wasm generated by `GOARCH=wasm GOOS=js` is very slow to compile: Use -// wazero.RuntimeConfig with wazero.CompilationCache when re-running the -// same binary. -// - The guest module is closed after being run. -func Run(ctx context.Context, r wazero.Runtime, compiled wazero.CompiledModule, moduleConfig Config) error { - c := moduleConfig.(*cfg) - _, err := RunAndReturnState(ctx, r, compiled, c.moduleConfig, c.internal) - return err -} diff --git a/vendor/github.com/tetratelabs/wazero/experimental/listener.go b/vendor/github.com/tetratelabs/wazero/experimental/listener.go deleted file mode 100644 index 7c1ce6fb20..0000000000 --- a/vendor/github.com/tetratelabs/wazero/experimental/listener.go +++ /dev/null @@ -1,361 +0,0 @@ -package experimental - -import ( - "context" - - "github.com/tetratelabs/wazero/api" -) - -// StackIterator allows iterating on each function of the call stack, starting -// from the top. At least one call to Next() is required to start the iteration. -// -// Note: The iterator provides a view of the call stack at the time of -// iteration. As a result, parameter values may be different than the ones their -// function was called with. -type StackIterator interface { - // Next moves the iterator to the next function in the stack. Returns - // false if it reached the bottom of the stack. - Next() bool - // Function describes the function called by the current frame. - Function() InternalFunction - // ProgramCounter returns the program counter associated with the - // function call. - ProgramCounter() ProgramCounter - // Parameters returns api.ValueType-encoded parameters of the current - // function. Do not modify the content of the slice, and copy out any - // value you need. - Parameters() []uint64 -} - -// FunctionListenerFactoryKey is a context.Context Value key. Its associated value should be a FunctionListenerFactory. -// -// See https://github.com/tetratelabs/wazero/issues/451 -type FunctionListenerFactoryKey struct{} - -// FunctionListenerFactory returns FunctionListeners to be notified when a -// function is called. -type FunctionListenerFactory interface { - // NewFunctionListener returns a FunctionListener for a defined function. - // If nil is returned, no listener will be notified. - NewFunctionListener(api.FunctionDefinition) FunctionListener - // ^^ A single instance can be returned to avoid instantiating a listener - // per function, especially as they may be thousands of functions. Shared - // listeners use their FunctionDefinition parameter to clarify. -} - -// FunctionListener can be registered for any function via -// FunctionListenerFactory to be notified when the function is called. -type FunctionListener interface { - // Before is invoked before a function is called. - // - // There is always one corresponding call to After or Abort for each call to - // Before. This guarantee allows the listener to maintain an internal stack - // to perform correlations between the entry and exit of functions. - // - // # Params - // - // - ctx: the context of the caller function which must be the same - // instance or parent of the result. - // - mod: the calling module. - // - def: the function definition. - // - params: api.ValueType encoded parameters. - // - stackIterator: iterator on the call stack. At least one entry is - // guaranteed (the called function), whose Args() will be equal to - // params. The iterator will be reused between calls to Before. - // - // Note: api.Memory is meant for inspection, not modification. - // mod can be cast to InternalModule to read non-exported globals. - Before(ctx context.Context, mod api.Module, def api.FunctionDefinition, params []uint64, stackIterator StackIterator) - - // After is invoked after a function is called. - // - // # Params - // - // - ctx: the context of the caller function. - // - mod: the calling module. - // - def: the function definition. - // - results: api.ValueType encoded results. - // - // # Notes - // - // - api.Memory is meant for inspection, not modification. - // - This is not called when a host function panics, or a guest function traps. - // See Abort for more details. - After(ctx context.Context, mod api.Module, def api.FunctionDefinition, results []uint64) - - // Abort is invoked when a function does not return due to a trap or panic. - // - // # Params - // - // - ctx: the context of the caller function. - // - mod: the calling module. - // - def: the function definition. - // - err: the error value representing the reason why the function aborted. - // - // # Notes - // - // - api.Memory is meant for inspection, not modification. - Abort(ctx context.Context, mod api.Module, def api.FunctionDefinition, err error) -} - -// FunctionListenerFunc is a function type implementing the FunctionListener -// interface, making it possible to use regular functions and methods as -// listeners of function invocation. -// -// The FunctionListener interface declares two methods (Before and After), -// but this type invokes its value only when Before is called. It is best -// suites for cases where the host does not need to perform correlation -// between the start and end of the function call. -type FunctionListenerFunc func(context.Context, api.Module, api.FunctionDefinition, []uint64, StackIterator) - -// Before satisfies the FunctionListener interface, calls f. -func (f FunctionListenerFunc) Before(ctx context.Context, mod api.Module, def api.FunctionDefinition, params []uint64, stackIterator StackIterator) { - f(ctx, mod, def, params, stackIterator) -} - -// After is declared to satisfy the FunctionListener interface, but it does -// nothing. -func (f FunctionListenerFunc) After(context.Context, api.Module, api.FunctionDefinition, []uint64) { -} - -// Abort is declared to satisfy the FunctionListener interface, but it does -// nothing. -func (f FunctionListenerFunc) Abort(context.Context, api.Module, api.FunctionDefinition, error) { -} - -// FunctionListenerFactoryFunc is a function type implementing the -// FunctionListenerFactory interface, making it possible to use regular -// functions and methods as factory of function listeners. -type FunctionListenerFactoryFunc func(api.FunctionDefinition) FunctionListener - -// NewFunctionListener satisfies the FunctionListenerFactory interface, calls f. -func (f FunctionListenerFactoryFunc) NewFunctionListener(def api.FunctionDefinition) FunctionListener { - return f(def) -} - -// MultiFunctionListenerFactory constructs a FunctionListenerFactory which -// combines the listeners created by each of the factories passed as arguments. -// -// This function is useful when multiple listeners need to be hooked to a module -// because the propagation mechanism based on installing a listener factory in -// the context.Context used when instantiating modules allows for a single -// listener to be installed. -// -// The stack iterator passed to the Before method is reset so that each listener -// can iterate the call stack independently without impacting the ability of -// other listeners to do so. -func MultiFunctionListenerFactory(factories ...FunctionListenerFactory) FunctionListenerFactory { - multi := make(multiFunctionListenerFactory, len(factories)) - copy(multi, factories) - return multi -} - -type multiFunctionListenerFactory []FunctionListenerFactory - -func (multi multiFunctionListenerFactory) NewFunctionListener(def api.FunctionDefinition) FunctionListener { - var lstns []FunctionListener - for _, factory := range multi { - if lstn := factory.NewFunctionListener(def); lstn != nil { - lstns = append(lstns, lstn) - } - } - switch len(lstns) { - case 0: - return nil - case 1: - return lstns[0] - default: - return &multiFunctionListener{lstns: lstns} - } -} - -type multiFunctionListener struct { - lstns []FunctionListener - stack stackIterator -} - -func (multi *multiFunctionListener) Before(ctx context.Context, mod api.Module, def api.FunctionDefinition, params []uint64, si StackIterator) { - multi.stack.base = si - for _, lstn := range multi.lstns { - multi.stack.index = -1 - lstn.Before(ctx, mod, def, params, &multi.stack) - } -} - -func (multi *multiFunctionListener) After(ctx context.Context, mod api.Module, def api.FunctionDefinition, results []uint64) { - for _, lstn := range multi.lstns { - lstn.After(ctx, mod, def, results) - } -} - -func (multi *multiFunctionListener) Abort(ctx context.Context, mod api.Module, def api.FunctionDefinition, err error) { - for _, lstn := range multi.lstns { - lstn.Abort(ctx, mod, def, err) - } -} - -type parameters struct { - values []uint64 - limits []uint8 -} - -func (ps *parameters) append(values []uint64) { - ps.values = append(ps.values, values...) - ps.limits = append(ps.limits, uint8(len(ps.values))) -} - -func (ps *parameters) clear() { - ps.values = ps.values[:0] - ps.limits = ps.limits[:0] -} - -func (ps *parameters) index(i int) []uint64 { - j := uint8(0) - k := ps.limits[i] - if i > 0 { - j = ps.limits[i-1] - } - return ps.values[j:k:k] -} - -type stackIterator struct { - base StackIterator - index int - pcs []uint64 - fns []InternalFunction - params parameters -} - -func (si *stackIterator) Next() bool { - if si.base != nil { - si.pcs = si.pcs[:0] - si.fns = si.fns[:0] - si.params.clear() - - for si.base.Next() { - si.pcs = append(si.pcs, uint64(si.base.ProgramCounter())) - si.fns = append(si.fns, si.base.Function()) - si.params.append(si.base.Parameters()) - } - - si.base = nil - } - si.index++ - return si.index < len(si.pcs) -} - -func (si *stackIterator) ProgramCounter() ProgramCounter { - return ProgramCounter(si.pcs[si.index]) -} - -func (si *stackIterator) Function() InternalFunction { - return si.fns[si.index] -} - -func (si *stackIterator) Parameters() []uint64 { - return si.params.index(si.index) -} - -// StackFrame represents a frame on the call stack. -type StackFrame struct { - Function api.Function - Params []uint64 - Results []uint64 - PC uint64 - SourceOffset uint64 -} - -type internalFunction struct { - definition api.FunctionDefinition - sourceOffset uint64 -} - -func (f internalFunction) Definition() api.FunctionDefinition { - return f.definition -} - -func (f internalFunction) SourceOffsetForPC(pc ProgramCounter) uint64 { - return f.sourceOffset -} - -// stackFrameIterator is an implementation of the experimental.stackFrameIterator -// interface. -type stackFrameIterator struct { - index int - stack []StackFrame - fndef []api.FunctionDefinition -} - -func (si *stackFrameIterator) Next() bool { - si.index++ - return si.index < len(si.stack) -} - -func (si *stackFrameIterator) Function() InternalFunction { - return internalFunction{ - definition: si.fndef[si.index], - sourceOffset: si.stack[si.index].SourceOffset, - } -} - -func (si *stackFrameIterator) ProgramCounter() ProgramCounter { - return ProgramCounter(si.stack[si.index].PC) -} - -func (si *stackFrameIterator) Parameters() []uint64 { - return si.stack[si.index].Params -} - -// NewStackIterator constructs a stack iterator from a list of stack frames. -// The top most frame is the last one. -func NewStackIterator(stack ...StackFrame) StackIterator { - si := &stackFrameIterator{ - index: -1, - stack: make([]StackFrame, len(stack)), - fndef: make([]api.FunctionDefinition, len(stack)), - } - for i := range stack { - si.stack[i] = stack[len(stack)-(i+1)] - } - // The size of function definition is only one pointer which should allow - // the compiler to optimize the conversion to api.FunctionDefinition; but - // the presence of internal.WazeroOnlyType, despite being defined as an - // empty struct, forces a heap allocation that we amortize by caching the - // result. - for i, frame := range stack { - si.fndef[i] = frame.Function.Definition() - } - return si -} - -// BenchmarkFunctionListener implements a benchmark for function listeners. -// -// The benchmark calls Before and After methods repeatedly using the provided -// module an stack frames to invoke the methods. -// -// The stack frame is a representation of the call stack that the Before method -// will be invoked with. The top of the stack is stored at index zero. The stack -// must contain at least one frame or the benchmark will fail. -func BenchmarkFunctionListener(n int, module api.Module, stack []StackFrame, listener FunctionListener) { - if len(stack) == 0 { - panic("cannot benchmark function listener with an empty stack") - } - - ctx := context.Background() - def := stack[0].Function.Definition() - params := stack[0].Params - results := stack[0].Results - stackIterator := &stackIterator{base: NewStackIterator(stack...)} - - for i := 0; i < n; i++ { - stackIterator.index = -1 - listener.Before(ctx, module, def, params, stackIterator) - listener.After(ctx, module, def, results) - } -} - -// TODO: the calls to Abort are not yet tested in internal/testing/enginetest, -// but they are validated indirectly in tests which exercise host logging, -// like Test_procExit in imports/wasi_snapshot_preview1. Eventually we should -// add dedicated tests to validate the behavior of the interpreter and compiler -// engines independently. diff --git a/vendor/github.com/tetratelabs/wazero/experimental/logging/testdata/listener.wasm b/vendor/github.com/tetratelabs/wazero/experimental/logging/testdata/listener.wasm deleted file mode 100644 index c514d5f5b2bc0a5aff988253531ca005ebd1a854..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 318 zcmZ{f&uYUk48}jn-r_WjbqspQq4c&}VS5Abvd2hM;%tWe!%iF6#n(Od?2NI~B+v&x z3F#AR-xC0O6ekXW!byf0Q7M4mc(>HvR(_}_|1r+h z#o5__gkWYVX@a_u6eCk4(+Y?@BWO_&Hcz~VCXJL^Dz!Xdi&CpY>^}fyaf?W}z!%A( z?hSI)SwEY>IC_z|Pfm}2zUXcRza}_eKS_PDp5|8xhB#kZ%3`THGf*ULL(+~{&nneK TMd6IUbo0^MPs0R}*pGYzZRk%u diff --git a/vendor/github.com/tetratelabs/wazero/fsconfig.go b/vendor/github.com/tetratelabs/wazero/fsconfig.go deleted file mode 100644 index 099a79173d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/fsconfig.go +++ /dev/null @@ -1,185 +0,0 @@ -package wazero - -import ( - "io/fs" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/sysfs" -) - -// FSConfig configures filesystem paths the embedding host allows the wasm -// guest to access. Unconfigured paths are not allowed, so functions like -// `path_open` result in unsupported errors (e.g. syscall.ENOSYS). -// -// # Guest Path -// -// `guestPath` is the name of the path the guest should use a filesystem for, or -// empty for any files. -// -// All `guestPath` paths are normalized, specifically removing any leading or -// trailing slashes. This means "/", "./" or "." all coerce to empty "". -// -// Multiple `guestPath` values can be configured, but the last longest match -// wins. For example, if "tmp", then "" were added, a request to open -// "tmp/foo.txt" use the filesystem associated with "tmp" even though a wider -// path, "" (all files), was added later. -// -// A `guestPath` of "." coerces to the empty string "" because the current -// directory is handled by the guest. In other words, the guest resolves ites -// current directory prior to requesting files. -// -// More notes on `guestPath` -// - Go compiled with runtime.GOOS=js do not pay attention to this value. -// Hence, you need to normalize the filesystem with NewRootFS to ensure -// paths requested resolve as expected. -// - Working directories are typically tracked in wasm, though possible some -// relative paths are requested. For example, TinyGo may attempt to resolve -// a path "../.." in unit tests. -// - Zig uses the first path name it sees as the initial working directory of -// the process. -// -// # Scope -// -// Configuration here is module instance scoped. This means you can use the -// same configuration for multiple calls to Runtime.InstantiateModule. Each -// module will have a different file descriptor table. Any errors accessing -// resources allowed here are deferred to instantiation time of each module. -// -// Any host resources present at the time of configuration, but deleted before -// Runtime.InstantiateModule will trap/panic when the guest wasm initializes or -// calls functions like `fd_read`. -// -// # Windows -// -// While wazero supports Windows as a platform, all known compilers use POSIX -// conventions at runtime. For example, even when running on Windows, paths -// used by wasm are separated by forward slash (/), not backslash (\). -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - FSConfig is immutable. Each WithXXX function returns a new instance -// including the corresponding change. -// - RATIONALE.md includes design background and relationship to WebAssembly -// System Interfaces (WASI). -type FSConfig interface { - // WithDirMount assigns a directory at `dir` to any paths beginning at - // `guestPath`. - // - // For example, `dirPath` as / (or c:\ in Windows), makes the entire host - // volume writeable to the path on the guest. The `guestPath` is always a - // POSIX style path, slash (/) delimited, even if run on Windows. - // - // If the same `guestPath` was assigned before, this overrides its value, - // retaining the original precedence. See the documentation of FSConfig for - // more details on `guestPath`. - // - // # Isolation - // - // The guest will have full access to this directory including escaping it - // via relative path lookups like "../../". Full access includes operations - // such as creating or deleting files, limited to any host level access - // controls. - // - // # os.DirFS - // - // This configuration optimizes for WASI compatability which is sometimes - // at odds with the behavior of os.DirFS. Hence, this will not behave - // exactly the same as os.DirFS. See /RATIONALE.md for more. - WithDirMount(dir, guestPath string) FSConfig - - // WithReadOnlyDirMount assigns a directory at `dir` to any paths - // beginning at `guestPath`. - // - // This is the same as WithDirMount except only read operations are - // permitted. However, escaping the directory via relative path lookups - // like "../../" is still allowed. - WithReadOnlyDirMount(dir, guestPath string) FSConfig - - // WithFSMount assigns a fs.FS file system for any paths beginning at - // `guestPath`. - // - // If the same `guestPath` was assigned before, this overrides its value, - // retaining the original precedence. See the documentation of FSConfig for - // more details on `guestPath`. - // - // # Isolation - // - // fs.FS does not restrict the ability to overwrite returned files via - // io.Writer. Moreover, os.DirFS documentation includes important notes - // about isolation, which also applies to fs.Sub. As of Go 1.19, the - // built-in file-systems are not jailed (chroot). See - // https://github.com/golang/go/issues/42322 - // - // # os.DirFS - // - // Due to limited control and functionality available in os.DirFS, we - // advise using WithDirMount instead. There will be behavior differences - // between os.DirFS and WithDirMount, as the latter biases towards what's - // expected from WASI implementations. - WithFSMount(fs fs.FS, guestPath string) FSConfig -} - -type fsConfig struct { - // fs are the currently configured filesystems. - fs []fsapi.FS - // guestPaths are the user-supplied names of the filesystems, retained for - // error messages and fmt.Stringer. - guestPaths []string - // guestPathToFS are the normalized paths to the currently configured - // filesystems, used for de-duplicating. - guestPathToFS map[string]int -} - -// NewFSConfig returns a FSConfig that can be used for configuring module instantiation. -func NewFSConfig() FSConfig { - return &fsConfig{guestPathToFS: map[string]int{}} -} - -// clone makes a deep copy of this module config. -func (c *fsConfig) clone() *fsConfig { - ret := *c // copy except slice and maps which share a ref - ret.fs = make([]fsapi.FS, 0, len(c.fs)) - ret.fs = append(ret.fs, c.fs...) - ret.guestPaths = make([]string, 0, len(c.guestPaths)) - ret.guestPaths = append(ret.guestPaths, c.guestPaths...) - ret.guestPathToFS = make(map[string]int, len(c.guestPathToFS)) - for key, value := range c.guestPathToFS { - ret.guestPathToFS[key] = value - } - return &ret -} - -// WithDirMount implements FSConfig.WithDirMount -func (c *fsConfig) WithDirMount(dir, guestPath string) FSConfig { - return c.withMount(sysfs.NewDirFS(dir), guestPath) -} - -// WithReadOnlyDirMount implements FSConfig.WithReadOnlyDirMount -func (c *fsConfig) WithReadOnlyDirMount(dir, guestPath string) FSConfig { - return c.withMount(sysfs.NewReadFS(sysfs.NewDirFS(dir)), guestPath) -} - -// WithFSMount implements FSConfig.WithFSMount -func (c *fsConfig) WithFSMount(fs fs.FS, guestPath string) FSConfig { - return c.withMount(sysfs.Adapt(fs), guestPath) -} - -func (c *fsConfig) withMount(fs fsapi.FS, guestPath string) FSConfig { - cleaned := sysfs.StripPrefixesAndTrailingSlash(guestPath) - ret := c.clone() - if i, ok := ret.guestPathToFS[cleaned]; ok { - ret.fs[i] = fs - ret.guestPaths[i] = guestPath - } else { - ret.guestPathToFS[cleaned] = len(ret.fs) - ret.fs = append(ret.fs, fs) - ret.guestPaths = append(ret.guestPaths, guestPath) - } - return ret -} - -func (c *fsConfig) toFS() (fsapi.FS, error) { - return sysfs.NewRootFS(c.fs, c.guestPaths) -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go deleted file mode 100644 index 71b2c41181..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/args.go +++ /dev/null @@ -1,97 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// argsGet is the WASI function named ArgsGetName that reads command-line -// argument data. -// -// # Parameters -// -// - argv: offset to begin writing argument offsets in uint32 little-endian -// encoding to api.Memory -// - argsSizesGet result argc * 4 bytes are written to this offset -// - argvBuf: offset to write the null terminated arguments to api.Memory -// - argsSizesGet result argv_len bytes are written to this offset -// -// Result (Errno) -// -// The return value is ErrnoSuccess except the following error conditions: -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if argsSizesGet wrote argc=2 and argvLen=5 for arguments: -// "a" and "bc" parameters argv=7 and argvBuf=1, this function writes the below -// to api.Memory: -// -// argvLen uint32le uint32le -// +----------------+ +--------+ +--------+ -// | | | | | | -// []byte{?, 'a', 0, 'b', 'c', 0, ?, 1, 0, 0, 0, 3, 0, 0, 0, ?} -// argvBuf --^ ^ ^ -// argv --| | -// offset that begins "a" --+ | -// offset that begins "bc" --+ -// -// See argsSizesGet -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#args_get -// See https://en.wikipedia.org/wiki/Null-terminated_string -var argsGet = newHostFunc(wasip1.ArgsGetName, argsGetFn, []api.ValueType{i32, i32}, "argv", "argv_buf") - -func argsGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - argv, argvBuf := uint32(params[0]), uint32(params[1]) - return writeOffsetsAndNullTerminatedValues(mod.Memory(), sysCtx.Args(), argv, argvBuf, sysCtx.ArgsSize()) -} - -// argsSizesGet is the WASI function named ArgsSizesGetName that reads -// command-line argument sizes. -// -// # Parameters -// -// - resultArgc: offset to write the argument count to api.Memory -// - resultArgvLen: offset to write the null-terminated argument length to -// api.Memory -// -// Result (Errno) -// -// The return value is ErrnoSuccess except the following error conditions: -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if args are "a", "bc" and parameters resultArgc=1 and -// resultArgvLen=6, this function writes the below to api.Memory: -// -// uint32le uint32le -// +--------+ +--------+ -// | | | | -// []byte{?, 2, 0, 0, 0, ?, 5, 0, 0, 0, ?} -// resultArgc --^ ^ -// 2 args --+ | -// resultArgvLen --| -// len([]byte{'a',0,'b',c',0}) --+ -// -// See argsGet -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#args_sizes_get -// See https://en.wikipedia.org/wiki/Null-terminated_string -var argsSizesGet = newHostFunc(wasip1.ArgsSizesGetName, argsSizesGetFn, []api.ValueType{i32, i32}, "result.argc", "result.argv_len") - -func argsSizesGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - mem := mod.Memory() - resultArgc, resultArgvLen := uint32(params[0]), uint32(params[1]) - - // argc and argv_len offsets are not necessarily sequential, so we have to - // write them independently. - if !mem.WriteUint32Le(resultArgc, uint32(len(sysCtx.Args()))) { - return syscall.EFAULT - } - if !mem.WriteUint32Le(resultArgvLen, sysCtx.ArgsSize()) { - return syscall.EFAULT - } - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go deleted file mode 100644 index 6e732a06c7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/clock.go +++ /dev/null @@ -1,116 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// clockResGet is the WASI function named ClockResGetName that returns the -// resolution of time values returned by clockTimeGet. -// -// # Parameters -// -// - id: clock ID to use -// - resultResolution: offset to write the resolution to api.Memory -// - the resolution is an uint64 little-endian encoding -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.ENOTSUP: the clock ID is not supported. -// - syscall.EINVAL: the clock ID is invalid. -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if the resolution is 100ns, this function writes the below to -// api.Memory: -// -// uint64le -// +-------------------------------------+ -// | | -// []byte{?, 0x64, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ?} -// resultResolution --^ -// -// Note: This is similar to `clock_getres` in POSIX. -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-clock_res_getid-clockid---errno-timestamp -// See https://linux.die.net/man/3/clock_getres -var clockResGet = newHostFunc(wasip1.ClockResGetName, clockResGetFn, []api.ValueType{i32, i32}, "id", "result.resolution") - -func clockResGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - id, resultResolution := uint32(params[0]), uint32(params[1]) - - var resolution uint64 // ns - switch id { - case wasip1.ClockIDRealtime: - resolution = uint64(sysCtx.WalltimeResolution()) - case wasip1.ClockIDMonotonic: - resolution = uint64(sysCtx.NanotimeResolution()) - default: - return syscall.EINVAL - } - - if !mod.Memory().WriteUint64Le(resultResolution, resolution) { - return syscall.EFAULT - } - return 0 -} - -// clockTimeGet is the WASI function named ClockTimeGetName that returns -// the time value of a name (time.Now). -// -// # Parameters -// -// - id: clock ID to use -// - precision: maximum lag (exclusive) that the returned time value may have, -// compared to its actual value -// - resultTimestamp: offset to write the timestamp to api.Memory -// - the timestamp is epoch nanos encoded as a little-endian uint64 -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.ENOTSUP: the clock ID is not supported. -// - syscall.EINVAL: the clock ID is invalid. -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if time.Now returned exactly midnight UTC 2022-01-01 -// (1640995200000000000), and parameters resultTimestamp=1, this function -// writes the below to api.Memory: -// -// uint64le -// +------------------------------------------+ -// | | -// []byte{?, 0x0, 0x0, 0x1f, 0xa6, 0x70, 0xfc, 0xc5, 0x16, ?} -// resultTimestamp --^ -// -// Note: This is similar to `clock_gettime` in POSIX. -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-clock_time_getid-clockid-precision-timestamp---errno-timestamp -// See https://linux.die.net/man/3/clock_gettime -var clockTimeGet = newHostFunc(wasip1.ClockTimeGetName, clockTimeGetFn, []api.ValueType{i32, i64, i32}, "id", "precision", "result.timestamp") - -func clockTimeGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - id := uint32(params[0]) - // TODO: precision is currently ignored. - // precision = params[1] - resultTimestamp := uint32(params[2]) - - var val int64 - switch id { - case wasip1.ClockIDRealtime: - val = sysCtx.WalltimeNanos() - case wasip1.ClockIDMonotonic: - val = sysCtx.Nanotime() - default: - return syscall.EINVAL - } - - if !mod.Memory().WriteUint64Le(resultTimestamp, uint64(val)) { - return syscall.EFAULT - } - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go deleted file mode 100644 index 995f82f2a8..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/environ.go +++ /dev/null @@ -1,100 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// environGet is the WASI function named EnvironGetName that reads -// environment variables. -// -// # Parameters -// -// - environ: offset to begin writing environment offsets in uint32 -// little-endian encoding to api.Memory -// - environSizesGet result environc * 4 bytes are written to this offset -// - environBuf: offset to write the null-terminated variables to api.Memory -// - the format is like os.Environ: null-terminated "key=val" entries -// - environSizesGet result environLen bytes are written to this offset -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if environSizesGet wrote environc=2 and environLen=9 for -// environment variables: "a=b", "b=cd" and parameters environ=11 and -// environBuf=1, this function writes the below to api.Memory: -// -// environLen uint32le uint32le -// +------------------------------------+ +--------+ +--------+ -// | | | | | | -// []byte{?, 'a', '=', 'b', 0, 'b', '=', 'c', 'd', 0, ?, 1, 0, 0, 0, 5, 0, 0, 0, ?} -// environBuf --^ ^ ^ -// environ offset for "a=b" --+ | -// environ offset for "b=cd" --+ -// -// See environSizesGet -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#environ_get -// See https://en.wikipedia.org/wiki/Null-terminated_string -var environGet = newHostFunc(wasip1.EnvironGetName, environGetFn, []api.ValueType{i32, i32}, "environ", "environ_buf") - -func environGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - environ, environBuf := uint32(params[0]), uint32(params[1]) - - return writeOffsetsAndNullTerminatedValues(mod.Memory(), sysCtx.Environ(), environ, environBuf, sysCtx.EnvironSize()) -} - -// environSizesGet is the WASI function named EnvironSizesGetName that -// reads environment variable sizes. -// -// # Parameters -// -// - resultEnvironc: offset to write the count of environment variables to -// api.Memory -// - resultEnvironvLen: offset to write the null-terminated environment -// variable length to api.Memory -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EFAULT: there is not enough memory to write results -// -// For example, if environ are "a=b","b=cd" and parameters resultEnvironc=1 and -// resultEnvironvLen=6, this function writes the below to api.Memory: -// -// uint32le uint32le -// +--------+ +--------+ -// | | | | -// []byte{?, 2, 0, 0, 0, ?, 9, 0, 0, 0, ?} -// resultEnvironc --^ ^ -// 2 variables --+ | -// resultEnvironvLen --| -// len([]byte{'a','=','b',0, | -// 'b','=','c','d',0}) --+ -// -// See environGet -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#environ_sizes_get -// and https://en.wikipedia.org/wiki/Null-terminated_string -var environSizesGet = newHostFunc(wasip1.EnvironSizesGetName, environSizesGetFn, []api.ValueType{i32, i32}, "result.environc", "result.environv_len") - -func environSizesGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - mem := mod.Memory() - resultEnvironc, resultEnvironvLen := uint32(params[0]), uint32(params[1]) - - // environc and environv_len offsets are not necessarily sequential, so we - // have to write them independently. - if !mem.WriteUint32Le(resultEnvironc, uint32(len(sysCtx.Environ()))) { - return syscall.EFAULT - } - if !mem.WriteUint32Le(resultEnvironvLen, sysCtx.EnvironSize()) { - return syscall.EFAULT - } - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go deleted file mode 100644 index c87d7699f3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/fs.go +++ /dev/null @@ -1,1969 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "io" - "io/fs" - "math" - "path" - "strings" - "syscall" - "unsafe" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/fsapi" - socketapi "github.com/tetratelabs/wazero/internal/sock" - "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/internal/sysfs" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// fdAdvise is the WASI function named FdAdviseName which provides file -// advisory information on a file descriptor. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_advisefd-fd-offset-filesize-len-filesize-advice-advice---errno -var fdAdvise = newHostFunc( - wasip1.FdAdviseName, fdAdviseFn, - []wasm.ValueType{i32, i64, i64, i32}, - "fd", "offset", "len", "advice", -) - -func fdAdviseFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := int32(params[0]) - _ = params[1] - _ = params[2] - advice := byte(params[3]) - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - _, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF - } - - switch advice { - case wasip1.FdAdviceNormal, - wasip1.FdAdviceSequential, - wasip1.FdAdviceRandom, - wasip1.FdAdviceWillNeed, - wasip1.FdAdviceDontNeed, - wasip1.FdAdviceNoReuse: - default: - return syscall.EINVAL - } - - // FdAdvice corresponds to posix_fadvise, but it can only be supported on linux. - // However, the purpose of the call is just to do best-effort optimization on OS kernels, - // so just making this noop rather than returning NoSup error makes sense and doesn't affect - // the semantics of Wasm applications. - // TODO: invoke posix_fadvise on linux, and partially on darwin. - // - https://gitlab.com/cznic/fileutil/-/blob/v1.1.2/fileutil_linux.go#L87-95 - // - https://github.com/bytecodealliance/system-interface/blob/62b97f9776b86235f318c3a6e308395a1187439b/src/fs/file_io_ext.rs#L430-L442 - return 0 -} - -// fdAllocate is the WASI function named FdAllocateName which forces the -// allocation of space in a file. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_allocatefd-fd-offset-filesize-len-filesize---errno -var fdAllocate = newHostFunc( - wasip1.FdAllocateName, fdAllocateFn, - []wasm.ValueType{i32, i64, i64}, - "fd", "offset", "len", -) - -func fdAllocateFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := int32(params[0]) - offset := params[1] - length := params[2] - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - f, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF - } - - tail := int64(offset + length) - if tail < 0 { - return syscall.EINVAL - } - - st, errno := f.File.Stat() - if errno != 0 { - return errno - } - - if st.Size >= tail { - return 0 // We already have enough space. - } - - return f.File.Truncate(tail) -} - -// fdClose is the WASI function named FdCloseName which closes a file -// descriptor. -// -// # Parameters -// -// - fd: file descriptor to close -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: the fd was not open. -// - syscall.ENOTSUP: the fs was a pre-open -// -// Note: This is similar to `close` in POSIX. -// See https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#fd_close -// and https://linux.die.net/man/3/close -var fdClose = newHostFunc(wasip1.FdCloseName, fdCloseFn, []api.ValueType{i32}, "fd") - -func fdCloseFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd := int32(params[0]) - - return fsc.CloseFile(fd) -} - -// fdDatasync is the WASI function named FdDatasyncName which synchronizes -// the data of a file to disk. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_datasyncfd-fd---errno -var fdDatasync = newHostFunc(wasip1.FdDatasyncName, fdDatasyncFn, []api.ValueType{i32}, "fd") - -func fdDatasyncFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd := int32(params[0]) - - // Check to see if the file descriptor is available - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else { - return f.File.Datasync() - } -} - -// fdFdstatGet is the WASI function named FdFdstatGetName which returns the -// attributes of a file descriptor. -// -// # Parameters -// -// - fd: file descriptor to get the fdstat attributes data -// - resultFdstat: offset to write the result fdstat data -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `resultFdstat` points to an offset out of memory -// -// fdstat byte layout is 24-byte size, with the following fields: -// - fs_filetype 1 byte: the file type -// - fs_flags 2 bytes: the file descriptor flag -// - 5 pad bytes -// - fs_right_base 8 bytes: ignored as rights were removed from WASI. -// - fs_right_inheriting 8 bytes: ignored as rights were removed from WASI. -// -// For example, with a file corresponding with `fd` was a directory (=3) opened -// with `fd_read` right (=1) and no fs_flags (=0), parameter resultFdstat=1, -// this function writes the below to api.Memory: -// -// uint16le padding uint64le uint64le -// uint8 --+ +--+ +-----------+ +--------------------+ +--------------------+ -// | | | | | | | | | -// []byte{?, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0} -// resultFdstat --^ ^-- fs_flags ^-- fs_right_base ^-- fs_right_inheriting -// | -// +-- fs_filetype -// -// Note: fdFdstatGet returns similar flags to `fsync(fd, F_GETFL)` in POSIX, as -// well as additional fields. -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fdstat -// and https://linux.die.net/man/3/fsync -var fdFdstatGet = newHostFunc(wasip1.FdFdstatGetName, fdFdstatGetFn, []api.ValueType{i32, i32}, "fd", "result.stat") - -// fdFdstatGetFn cannot currently use proxyResultParams because fdstat is larger -// than api.ValueTypeI64 (i64 == 8 bytes, but fdstat is 24). -func fdFdstatGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd, resultFdstat := int32(params[0]), uint32(params[1]) - - // Ensure we can write the fdstat - buf, ok := mod.Memory().Read(resultFdstat, 24) - if !ok { - return syscall.EFAULT - } - - var fdflags uint16 - var st fsapi.Stat_t - var errno syscall.Errno - f, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF - } else if st, errno = f.File.Stat(); errno != 0 { - return errno - } else if f.File.IsAppend() { - fdflags |= wasip1.FD_APPEND - } - - if f.File.IsNonblock() { - fdflags |= wasip1.FD_NONBLOCK - } - - var fsRightsBase uint32 - var fsRightsInheriting uint32 - fileType := getExtendedWasiFiletype(f.File, st.Mode) - - switch fileType { - case wasip1.FILETYPE_DIRECTORY: - // To satisfy wasi-testsuite, we must advertise that directories cannot - // be given seek permission (RIGHT_FD_SEEK). - fsRightsBase = dirRightsBase - fsRightsInheriting = fileRightsBase | dirRightsBase - case wasip1.FILETYPE_CHARACTER_DEVICE: - // According to wasi-libc, - // > A tty is a character device that we can't seek or tell on. - // See https://github.com/WebAssembly/wasi-libc/blob/a6f871343313220b76009827ed0153586361c0d5/libc-bottom-half/sources/isatty.c#L13-L18 - fsRightsBase = fileRightsBase &^ wasip1.RIGHT_FD_SEEK &^ wasip1.RIGHT_FD_TELL - default: - fsRightsBase = fileRightsBase - } - - writeFdstat(buf, fileType, fdflags, fsRightsBase, fsRightsInheriting) - return 0 -} - -// isPreopenedStdio returns true if the FD is sys.FdStdin, sys.FdStdout or -// sys.FdStderr and pre-opened. This double check is needed in case the guest -// closes stdin and re-opens it with a random alternative file. -// -// Currently, we only support non-blocking mode for standard I/O streams. -// Non-blocking mode is rarely supported for regular files, and we don't -// yet have support for sockets, so we make a special case. -// -// Note: this to get or set FD_NONBLOCK, but skip FD_APPEND. Our current -// implementation can't set FD_APPEND, without re-opening files. As stdio are -// pre-opened, we don't know how to re-open them, neither should we close the -// underlying file. Later, we could add support for setting FD_APPEND, similar -// to SetNonblock. -func isPreopenedStdio(fd int32, f *sys.FileEntry) bool { - return fd <= sys.FdStderr && f.IsPreopen -} - -const fileRightsBase = wasip1.RIGHT_FD_DATASYNC | - wasip1.RIGHT_FD_READ | - wasip1.RIGHT_FD_SEEK | - wasip1.RIGHT_FDSTAT_SET_FLAGS | - wasip1.RIGHT_FD_SYNC | - wasip1.RIGHT_FD_TELL | - wasip1.RIGHT_FD_WRITE | - wasip1.RIGHT_FD_ADVISE | - wasip1.RIGHT_FD_ALLOCATE | - wasip1.RIGHT_FD_FILESTAT_GET | - wasip1.RIGHT_FD_FILESTAT_SET_SIZE | - wasip1.RIGHT_FD_FILESTAT_SET_TIMES | - wasip1.RIGHT_POLL_FD_READWRITE - -const dirRightsBase = wasip1.RIGHT_FD_DATASYNC | - wasip1.RIGHT_FDSTAT_SET_FLAGS | - wasip1.RIGHT_FD_SYNC | - wasip1.RIGHT_PATH_CREATE_DIRECTORY | - wasip1.RIGHT_PATH_CREATE_FILE | - wasip1.RIGHT_PATH_LINK_SOURCE | - wasip1.RIGHT_PATH_LINK_TARGET | - wasip1.RIGHT_PATH_OPEN | - wasip1.RIGHT_FD_READDIR | - wasip1.RIGHT_PATH_READLINK | - wasip1.RIGHT_PATH_RENAME_SOURCE | - wasip1.RIGHT_PATH_RENAME_TARGET | - wasip1.RIGHT_PATH_FILESTAT_GET | - wasip1.RIGHT_PATH_FILESTAT_SET_SIZE | - wasip1.RIGHT_PATH_FILESTAT_SET_TIMES | - wasip1.RIGHT_FD_FILESTAT_GET | - wasip1.RIGHT_FD_FILESTAT_SET_TIMES | - wasip1.RIGHT_PATH_SYMLINK | - wasip1.RIGHT_PATH_REMOVE_DIRECTORY | - wasip1.RIGHT_PATH_UNLINK_FILE - -func writeFdstat(buf []byte, fileType uint8, fdflags uint16, fsRightsBase, fsRightsInheriting uint32) { - b := (*[24]byte)(buf) - le.PutUint16(b[0:], uint16(fileType)) - le.PutUint16(b[2:], fdflags) - le.PutUint32(b[4:], 0) - le.PutUint64(b[8:], uint64(fsRightsBase)) - le.PutUint64(b[16:], uint64(fsRightsInheriting)) -} - -// fdFdstatSetFlags is the WASI function named FdFdstatSetFlagsName which -// adjusts the flags associated with a file descriptor. -var fdFdstatSetFlags = newHostFunc(wasip1.FdFdstatSetFlagsName, fdFdstatSetFlagsFn, []wasm.ValueType{i32, i32}, "fd", "flags") - -func fdFdstatSetFlagsFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd, wasiFlag := int32(params[0]), uint16(params[1]) - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - // Currently we only support APPEND and NONBLOCK. - if wasip1.FD_DSYNC&wasiFlag != 0 || wasip1.FD_RSYNC&wasiFlag != 0 || wasip1.FD_SYNC&wasiFlag != 0 { - return syscall.EINVAL - } - - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else { - nonblock := wasip1.FD_NONBLOCK&wasiFlag != 0 - errno := f.File.SetNonblock(nonblock) - if errno != 0 { - return errno - } - if stat, err := f.File.Stat(); err == 0 && stat.Mode.IsRegular() { - // For normal files, proceed to apply an append flag. - append := wasip1.FD_APPEND&wasiFlag != 0 - return f.File.SetAppend(append) - } - } - - return 0 -} - -// fdFdstatSetRights will not be implemented as rights were removed from WASI. -// -// See https://github.com/bytecodealliance/wasmtime/pull/4666 -var fdFdstatSetRights = stubFunction( - wasip1.FdFdstatSetRightsName, - []wasm.ValueType{i32, i64, i64}, - "fd", "fs_rights_base", "fs_rights_inheriting", -) - -// fdFilestatGet is the WASI function named FdFilestatGetName which returns -// the stat attributes of an open file. -// -// # Parameters -// -// - fd: file descriptor to get the filestat attributes data for -// - resultFilestat: offset to write the result filestat data -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EIO: could not stat `fd` on filesystem -// - syscall.EFAULT: `resultFilestat` points to an offset out of memory -// -// filestat byte layout is 64-byte size, with the following fields: -// - dev 8 bytes: the device ID of device containing the file -// - ino 8 bytes: the file serial number -// - filetype 1 byte: the type of the file -// - 7 pad bytes -// - nlink 8 bytes: number of hard links to the file -// - size 8 bytes: for regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link -// - atim 8 bytes: ast data access timestamp -// - mtim 8 bytes: last data modification timestamp -// - ctim 8 bytes: ast file status change timestamp -// -// For example, with a regular file this function writes the below to api.Memory: -// -// uint8 --+ -// uint64le uint64le | padding uint64le uint64le uint64le uint64le uint64le -// +--------------------+ +--------------------+ | +-----------------+ +--------------------+ +-----------------------+ +----------------------------------+ +----------------------------------+ +----------------------------------+ -// | | | | | | | | | | | | | | | | | -// []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 117, 80, 0, 0, 0, 0, 0, 0, 160, 153, 212, 128, 110, 221, 35, 23, 160, 153, 212, 128, 110, 221, 35, 23, 160, 153, 212, 128, 110, 221, 35, 23} -// resultFilestat ^-- dev ^-- ino ^ ^-- nlink ^-- size ^-- atim ^-- mtim ^-- ctim -// | -// +-- filetype -// -// The following properties of filestat are not implemented: -// - dev: not supported by Golang FS -// - ino: not supported by Golang FS -// - nlink: not supported by Golang FS, we use 1 -// - atime: not supported by Golang FS, we use mtim for this -// - ctim: not supported by Golang FS, we use mtim for this -// -// Note: This is similar to `fstat` in POSIX. -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_filestat_getfd-fd---errno-filestat -// and https://linux.die.net/man/3/fstat -var fdFilestatGet = newHostFunc(wasip1.FdFilestatGetName, fdFilestatGetFn, []api.ValueType{i32, i32}, "fd", "result.filestat") - -// fdFilestatGetFn cannot currently use proxyResultParams because filestat is -// larger than api.ValueTypeI64 (i64 == 8 bytes, but filestat is 64). -func fdFilestatGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - return fdFilestatGetFunc(mod, int32(params[0]), uint32(params[1])) -} - -func fdFilestatGetFunc(mod api.Module, fd int32, resultBuf uint32) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - // Ensure we can write the filestat - buf, ok := mod.Memory().Read(resultBuf, 64) - if !ok { - return syscall.EFAULT - } - - f, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF - } - - st, errno := f.File.Stat() - if errno != 0 { - return errno - } - - filetype := getExtendedWasiFiletype(f.File, st.Mode) - return writeFilestat(buf, &st, filetype) -} - -func getExtendedWasiFiletype(file fsapi.File, fm fs.FileMode) (ftype uint8) { - ftype = getWasiFiletype(fm) - if ftype == wasip1.FILETYPE_UNKNOWN { - if _, ok := file.(socketapi.TCPSock); ok { - ftype = wasip1.FILETYPE_SOCKET_STREAM - } else if _, ok = file.(socketapi.TCPConn); ok { - ftype = wasip1.FILETYPE_SOCKET_STREAM - } - } - return -} - -func getWasiFiletype(fm fs.FileMode) uint8 { - switch { - case fm.IsRegular(): - return wasip1.FILETYPE_REGULAR_FILE - case fm.IsDir(): - return wasip1.FILETYPE_DIRECTORY - case fm&fs.ModeSymlink != 0: - return wasip1.FILETYPE_SYMBOLIC_LINK - case fm&fs.ModeDevice != 0: - // Unlike ModeDevice and ModeCharDevice, FILETYPE_CHARACTER_DEVICE and - // FILETYPE_BLOCK_DEVICE are set mutually exclusively. - if fm&fs.ModeCharDevice != 0 { - return wasip1.FILETYPE_CHARACTER_DEVICE - } - return wasip1.FILETYPE_BLOCK_DEVICE - default: // unknown - return wasip1.FILETYPE_UNKNOWN - } -} - -func writeFilestat(buf []byte, st *fsapi.Stat_t, ftype uint8) (errno syscall.Errno) { - le.PutUint64(buf, st.Dev) - le.PutUint64(buf[8:], st.Ino) - le.PutUint64(buf[16:], uint64(ftype)) - le.PutUint64(buf[24:], st.Nlink) - le.PutUint64(buf[32:], uint64(st.Size)) - le.PutUint64(buf[40:], uint64(st.Atim)) - le.PutUint64(buf[48:], uint64(st.Mtim)) - le.PutUint64(buf[56:], uint64(st.Ctim)) - return -} - -// fdFilestatSetSize is the WASI function named FdFilestatSetSizeName which -// adjusts the size of an open file. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_filestat_set_sizefd-fd-size-filesize---errno -var fdFilestatSetSize = newHostFunc(wasip1.FdFilestatSetSizeName, fdFilestatSetSizeFn, []wasm.ValueType{i32, i64}, "fd", "size") - -func fdFilestatSetSizeFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := int32(params[0]) - size := uint32(params[1]) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - // Check to see if the file descriptor is available - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else { - return f.File.Truncate(int64(size)) - } -} - -// fdFilestatSetTimes is the WASI function named functionFdFilestatSetTimes -// which adjusts the times of an open file. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_filestat_set_timesfd-fd-atim-timestamp-mtim-timestamp-fst_flags-fstflags---errno -var fdFilestatSetTimes = newHostFunc( - wasip1.FdFilestatSetTimesName, fdFilestatSetTimesFn, - []wasm.ValueType{i32, i64, i64, i32}, - "fd", "atim", "mtim", "fst_flags", -) - -func fdFilestatSetTimesFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := int32(params[0]) - atim := int64(params[1]) - mtim := int64(params[2]) - fstFlags := uint16(params[3]) - - sys := mod.(*wasm.ModuleInstance).Sys - fsc := sys.FS() - - f, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF - } - - times, errno := toTimes(atim, mtim, fstFlags) - if errno != 0 { - return errno - } - - // Try to update the file timestamps by file-descriptor. - errno = f.File.Utimens(×) - - // Fall back to path based, despite it being less precise. - switch errno { - case syscall.EPERM, syscall.ENOSYS: - errno = f.FS.Utimens(f.Name, ×, true) - } - - return errno -} - -func toTimes(atim, mtime int64, fstFlags uint16) (times [2]syscall.Timespec, errno syscall.Errno) { - // times[0] == atim, times[1] == mtim - - // coerce atim into a timespec - if set, now := fstFlags&wasip1.FstflagsAtim != 0, fstFlags&wasip1.FstflagsAtimNow != 0; set && now { - errno = syscall.EINVAL - return - } else if set { - times[0] = syscall.NsecToTimespec(atim) - } else if now { - times[0].Nsec = sysfs.UTIME_NOW - } else { - times[0].Nsec = sysfs.UTIME_OMIT - } - - // coerce mtim into a timespec - if set, now := fstFlags&wasip1.FstflagsMtim != 0, fstFlags&wasip1.FstflagsMtimNow != 0; set && now { - errno = syscall.EINVAL - return - } else if set { - times[1] = syscall.NsecToTimespec(mtime) - } else if now { - times[1].Nsec = sysfs.UTIME_NOW - } else { - times[1].Nsec = sysfs.UTIME_OMIT - } - return -} - -// fdPread is the WASI function named FdPreadName which reads from a file -// descriptor, without using and updating the file descriptor's offset. -// -// Except for handling offset, this implementation is identical to fdRead. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_preadfd-fd-iovs-iovec_array-offset-filesize---errno-size -var fdPread = newHostFunc( - wasip1.FdPreadName, fdPreadFn, - []api.ValueType{i32, i32, i32, i64, i32}, - "fd", "iovs", "iovs_len", "offset", "result.nread", -) - -func fdPreadFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - return fdReadOrPread(mod, params, true) -} - -// fdPrestatGet is the WASI function named FdPrestatGetName which returns -// the prestat data of a file descriptor. -// -// # Parameters -// -// - fd: file descriptor to get the prestat -// - resultPrestat: offset to write the result prestat data -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid or the `fd` is not a pre-opened directory -// - syscall.EFAULT: `resultPrestat` points to an offset out of memory -// -// prestat byte layout is 8 bytes, beginning with an 8-bit tag and 3 pad bytes. -// The only valid tag is `prestat_dir`, which is tag zero. This simplifies the -// byte layout to 4 empty bytes followed by the uint32le encoded path length. -// -// For example, the directory name corresponding with `fd` was "/tmp" and -// parameter resultPrestat=1, this function writes the below to api.Memory: -// -// padding uint32le -// uint8 --+ +-----+ +--------+ -// | | | | | -// []byte{?, 0, 0, 0, 0, 4, 0, 0, 0, ?} -// resultPrestat --^ ^ -// tag --+ | -// +-- size in bytes of the string "/tmp" -// -// See fdPrestatDirName and -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#prestat -var fdPrestatGet = newHostFunc(wasip1.FdPrestatGetName, fdPrestatGetFn, []api.ValueType{i32, i32}, "fd", "result.prestat") - -func fdPrestatGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd, resultPrestat := int32(params[0]), uint32(params[1]) - - name, errno := preopenPath(fsc, fd) - if errno != 0 { - return errno - } - - // Upper 32-bits are zero because... - // * Zero-value 8-bit tag, and 3-byte zero-value padding - prestat := uint64(len(name) << 32) - if !mod.Memory().WriteUint64Le(resultPrestat, prestat) { - return syscall.EFAULT - } - return 0 -} - -// fdPrestatDirName is the WASI function named FdPrestatDirNameName which -// returns the path of the pre-opened directory of a file descriptor. -// -// # Parameters -// -// - fd: file descriptor to get the path of the pre-opened directory -// - path: offset in api.Memory to write the result path -// - pathLen: count of bytes to write to `path` -// - This should match the uint32le fdPrestatGet writes to offset -// `resultPrestat`+4 -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `path` points to an offset out of memory -// - syscall.ENAMETOOLONG: `pathLen` is longer than the actual length of the result -// -// For example, the directory name corresponding with `fd` was "/tmp" and -// # Parameters path=1 pathLen=4 (correct), this function will write the below to -// api.Memory: -// -// pathLen -// +--------------+ -// | | -// []byte{?, '/', 't', 'm', 'p', ?} -// path --^ -// -// See fdPrestatGet -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_prestat_dir_name -var fdPrestatDirName = newHostFunc( - wasip1.FdPrestatDirNameName, fdPrestatDirNameFn, - []api.ValueType{i32, i32, i32}, - "fd", "result.path", "result.path_len", -) - -func fdPrestatDirNameFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd, path, pathLen := int32(params[0]), uint32(params[1]), uint32(params[2]) - - name, errno := preopenPath(fsc, fd) - if errno != 0 { - return errno - } - - // Some runtimes may have another semantics. See /RATIONALE.md - if uint32(len(name)) < pathLen { - return syscall.ENAMETOOLONG - } - - if !mod.Memory().Write(path, []byte(name)[:pathLen]) { - return syscall.EFAULT - } - return 0 -} - -// fdPwrite is the WASI function named FdPwriteName which writes to a file -// descriptor, without using and updating the file descriptor's offset. -// -// Except for handling offset, this implementation is identical to fdWrite. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_pwritefd-fd-iovs-ciovec_array-offset-filesize---errno-size -var fdPwrite = newHostFunc( - wasip1.FdPwriteName, fdPwriteFn, - []api.ValueType{i32, i32, i32, i64, i32}, - "fd", "iovs", "iovs_len", "offset", "result.nwritten", -) - -func fdPwriteFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - return fdWriteOrPwrite(mod, params, true) -} - -// fdRead is the WASI function named FdReadName which reads from a file -// descriptor. -// -// # Parameters -// -// - fd: an opened file descriptor to read data from -// - iovs: offset in api.Memory to read offset, size pairs representing where -// to write file data -// - Both offset and length are encoded as uint32le -// - iovsCount: count of memory offset, size pairs to read sequentially -// starting at iovs -// - resultNread: offset in api.Memory to write the number of bytes read -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `iovs` or `resultNread` point to an offset out of memory -// - syscall.EIO: a file system error -// -// For example, this function needs to first read `iovs` to determine where -// to write contents. If parameters iovs=1 iovsCount=2, this function reads two -// offset/length pairs from api.Memory: -// -// iovs[0] iovs[1] -// +---------------------+ +--------------------+ -// | uint32le uint32le| |uint32le uint32le| -// +---------+ +--------+ +--------+ +--------+ -// | | | | | | | | -// []byte{?, 18, 0, 0, 0, 4, 0, 0, 0, 23, 0, 0, 0, 2, 0, 0, 0, ?... } -// iovs --^ ^ ^ ^ -// | | | | -// offset --+ length --+ offset --+ length --+ -// -// If the contents of the `fd` parameter was "wazero" (6 bytes) and parameter -// resultNread=26, this function writes the below to api.Memory: -// -// iovs[0].length iovs[1].length -// +--------------+ +----+ uint32le -// | | | | +--------+ -// []byte{ 0..16, ?, 'w', 'a', 'z', 'e', ?, 'r', 'o', ?, 6, 0, 0, 0 } -// iovs[0].offset --^ ^ ^ -// iovs[1].offset --+ | -// resultNread --+ -// -// Note: This is similar to `readv` in POSIX. https://linux.die.net/man/3/readv -// -// See fdWrite -// and https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_read -var fdRead = newHostFunc( - wasip1.FdReadName, fdReadFn, - []api.ValueType{i32, i32, i32, i32}, - "fd", "iovs", "iovs_len", "result.nread", -) - -// preader tracks an offset across multiple reads. -type preader struct { - f fsapi.File - offset int64 -} - -// Read implements the same function as documented on internalapi.File. -func (w *preader) Read(buf []byte) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length reads. - } - - n, err := w.f.Pread(buf, w.offset) - w.offset += int64(n) - return n, err -} - -func fdReadFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - return fdReadOrPread(mod, params, false) -} - -func fdReadOrPread(mod api.Module, params []uint64, isPread bool) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - iovs := uint32(params[1]) - iovsCount := uint32(params[2]) - - var resultNread uint32 - var reader func(buf []byte) (n int, errno syscall.Errno) - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else if isPread { - offset := int64(params[3]) - reader = (&preader{f: f.File, offset: offset}).Read - resultNread = uint32(params[4]) - } else { - reader = f.File.Read - resultNread = uint32(params[3]) - } - - nread, errno := readv(mem, iovs, iovsCount, reader) - if errno != 0 { - return errno - } - if !mem.WriteUint32Le(resultNread, nread) { - return syscall.EFAULT - } else { - return 0 - } -} - -func readv(mem api.Memory, iovs uint32, iovsCount uint32, reader func(buf []byte) (nread int, errno syscall.Errno)) (uint32, syscall.Errno) { - var nread uint32 - iovsStop := iovsCount << 3 // iovsCount * 8 - iovsBuf, ok := mem.Read(iovs, iovsStop) - if !ok { - return 0, syscall.EFAULT - } - - for iovsPos := uint32(0); iovsPos < iovsStop; iovsPos += 8 { - offset := le.Uint32(iovsBuf[iovsPos:]) - l := le.Uint32(iovsBuf[iovsPos+4:]) - - if l == 0 { // A zero length iovec could be ahead of another. - continue - } - - b, ok := mem.Read(offset, l) - if !ok { - return 0, syscall.EFAULT - } - - n, errno := reader(b) - nread += uint32(n) - - if errno == syscall.ENOSYS { - return 0, syscall.EBADF // e.g. unimplemented for read - } else if errno != 0 { - return 0, errno - } else if n < int(l) { - break // stop when we read less than capacity. - } - } - return nread, 0 -} - -// fdReaddir is the WASI function named FdReaddirName which reads directory -// entries from a directory. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_readdirfd-fd-buf-pointeru8-buf_len-size-cookie-dircookie---errno-size -var fdReaddir = newHostFunc( - wasip1.FdReaddirName, fdReaddirFn, - []wasm.ValueType{i32, i32, i32, i64, i32}, - "fd", "buf", "buf_len", "cookie", "result.bufused", -) - -func fdReaddirFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - buf := uint32(params[1]) - bufLen := uint32(params[2]) - // We control the value of the cookie, and it should never be negative. - // However, we coerce it to signed to ensure the caller doesn't manipulate - // it in such a way that becomes negative. - cookie := int64(params[3]) - resultBufused := uint32(params[4]) - - // The bufLen must be enough to write a dirent. Otherwise, the caller can't - // read what the next cookie is. - if bufLen < wasip1.DirentSize { - return syscall.EINVAL - } - - // Validate the FD is a directory - f, errno := openedDir(fsc, fd) - if errno != 0 { - return errno - } - // Discard the bool value because we validated the fd already. - dir, errno := fsc.LookupReaddir(fd, f) - if errno != 0 { - return errno - } - // Validate the cookie and possibly sync the internal state to the one the cookie represents. - if errno = dir.Rewind(cookie); errno != 0 { - return errno - } - - // Determine how many dirents we can write, excluding a potentially - // truncated entry. - dirents, bufused, direntCount, writeTruncatedEntry := maxDirents(dir, bufLen) - - // Now, write entries to the underlying buffer. - if bufused > 0 { - buf, ok := mem.Read(buf, bufused) - if !ok { - return syscall.EFAULT - } - - // Iterate again on dir, this time writing the entries. - writeDirents(dirents, direntCount, writeTruncatedEntry, buf, uint64(cookie+1)) - } - - if !mem.WriteUint32Le(resultBufused, bufused) { - return syscall.EFAULT - } - return 0 -} - -const largestDirent = int64(math.MaxUint32 - wasip1.DirentSize) - -// maxDirents returns the maximum count and total entries that can fit in -// maxLen bytes. -// -// truncatedEntryLen is the amount of bytes past bufLen needed to write the -// next entry. We have to return bufused == bufLen unless the directory is -// exhausted. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_readdir -// See https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/cloudlibc/src/libc/dirent/readdir.c#L44 -func maxDirents(dir *sys.Readdir, bufLen uint32) (dirents []fsapi.Dirent, bufused, direntCount uint32, writeTruncatedEntry bool) { - lenRemaining := bufLen - for { - d, errno := dir.Peek() - if errno != 0 { - return - } - dirents = append(dirents, *d) - - if lenRemaining < wasip1.DirentSize { - // We don't have enough space in bufLen for another struct, - // entry. A caller who wants more will retry. - - // bufused == bufLen means more dirents exist, which is the case - // when the dirent is larger than bytes remaining. - bufused = bufLen - break - } - - // use int64 to guard against huge filenames - nameLen := int64(len(d.Name)) - var entryLen uint32 - - // Check to see if DirentSize + nameLen overflows, or if it would be - // larger than possible to encode. - if el := int64(wasip1.DirentSize) + nameLen; el < 0 || el > largestDirent { - // panic, as testing is difficult. ex we would have to extract a - // function to get size of a string or allocate a 2^32 size one! - panic("invalid filename: too large") - } else { // we know this can fit into a uint32 - entryLen = uint32(el) - } - - if entryLen > lenRemaining { - // We haven't room to write the entry, and docs say to write the - // header. This helps especially when there is an entry with a very - // long filename. Ex if bufLen is 4096 and the filename is 4096, - // we need to write DirentSize(24) + 4096 bytes to write the entry. - // In this case, we only write up to DirentSize(24) to allow the - // caller to resize. - - // bufused == bufLen means more dirents exist, which is the case - // when the next entry is larger than bytes remaining. - bufused = bufLen - - // We do have enough space to write the header, this value will be - // passed on to writeDirents to only write the header for this entry. - writeTruncatedEntry = true - break - } - - // This won't go negative because we checked entryLen <= lenRemaining. - lenRemaining -= entryLen - bufused += entryLen - direntCount++ - _ = dir.Advance() - } - return -} - -// writeDirents writes the directory entries to the buffer, which is pre-sized -// based on maxDirents. truncatedEntryLen means write one past entryCount, -// without its name. See maxDirents for why -func writeDirents( - dirents []fsapi.Dirent, - direntCount uint32, - writeTruncatedEntry bool, - buf []byte, - d_next uint64, -) { - pos, i := uint32(0), uint32(0) - for ; i < direntCount; i++ { - e := dirents[i] - nameLen := uint32(len(e.Name)) - - writeDirent(buf[pos:], d_next, e.Ino, nameLen, e.Type) - pos += wasip1.DirentSize - - copy(buf[pos:], e.Name) - pos += nameLen - d_next++ - } - - if !writeTruncatedEntry { - return - } - - // Write a dirent without its name - dirent := make([]byte, wasip1.DirentSize) - e := dirents[i] - writeDirent(dirent, d_next, e.Ino, uint32(len(e.Name)), e.Type) - - // Potentially truncate it - copy(buf[pos:], dirent) -} - -// writeDirent writes DirentSize bytes -func writeDirent(buf []byte, dNext uint64, ino uint64, dNamlen uint32, dType fs.FileMode) { - le.PutUint64(buf, dNext) // d_next - le.PutUint64(buf[8:], ino) // d_ino - le.PutUint32(buf[16:], dNamlen) // d_namlen - filetype := getWasiFiletype(dType) - le.PutUint32(buf[20:], uint32(filetype)) // d_type -} - -// openedDir returns the sys.FileEntry for the directory and 0 if the fd points to a readable directory. -func openedDir(fsc *sys.FSContext, fd int32) (*sys.FileEntry, syscall.Errno) { - if f, ok := fsc.LookupFile(fd); !ok { - return nil, syscall.EBADF - } else if isDir, errno := f.File.IsDir(); errno != 0 { - return nil, errno - } else if !isDir { - // fd_readdir docs don't indicate whether to return syscall.ENOTDIR or - // syscall.EBADF. It has been noticed that rust will crash on syscall.ENOTDIR, - // and POSIX C ref seems to not return this, so we don't either. - // - // See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_readdir - // and https://en.wikibooks.org/wiki/C_Programming/POSIX_Reference/dirent.h - return nil, syscall.EBADF - } else { - return f, 0 - } -} - -// fdRenumber is the WASI function named FdRenumberName which atomically -// replaces a file descriptor by renumbering another file descriptor. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_renumberfd-fd-to-fd---errno -var fdRenumber = newHostFunc(wasip1.FdRenumberName, fdRenumberFn, []wasm.ValueType{i32, i32}, "fd", "to") - -func fdRenumberFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - from := int32(params[0]) - to := int32(params[1]) - - if errno := fsc.Renumber(from, to); errno != 0 { - return errno - } - return 0 -} - -// fdSeek is the WASI function named FdSeekName which moves the offset of a -// file descriptor. -// -// # Parameters -// -// - fd: file descriptor to move the offset of -// - offset: signed int64, which is encoded as uint64, input argument to -// `whence`, which results in a new offset -// - whence: operator that creates the new offset, given `offset` bytes -// - If io.SeekStart, new offset == `offset`. -// - If io.SeekCurrent, new offset == existing offset + `offset`. -// - If io.SeekEnd, new offset == file size of `fd` + `offset`. -// - resultNewoffset: offset in api.Memory to write the new offset to, -// relative to start of the file -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `resultNewoffset` points to an offset out of memory -// - syscall.EINVAL: `whence` is an invalid value -// - syscall.EIO: a file system error -// - syscall.EISDIR: the file was a directory. -// -// For example, if fd 3 is a file with offset 0, and parameters fd=3, offset=4, -// whence=0 (=io.SeekStart), resultNewOffset=1, this function writes the below -// to api.Memory: -// -// uint64le -// +--------------------+ -// | | -// []byte{?, 4, 0, 0, 0, 0, 0, 0, 0, ? } -// resultNewoffset --^ -// -// Note: This is similar to `lseek` in POSIX. https://linux.die.net/man/3/lseek -// -// See io.Seeker -// and https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_seek -var fdSeek = newHostFunc( - wasip1.FdSeekName, fdSeekFn, - []api.ValueType{i32, i64, i32, i32}, - "fd", "offset", "whence", "result.newoffset", -) - -func fdSeekFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd := int32(params[0]) - offset := params[1] - whence := uint32(params[2]) - resultNewoffset := uint32(params[3]) - - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else if isDir, _ := f.File.IsDir(); isDir { - return syscall.EISDIR // POSIX doesn't forbid seeking a directory, but wasi-testsuite does. - } else if newOffset, errno := f.File.Seek(int64(offset), int(whence)); errno != 0 { - return errno - } else if !mod.Memory().WriteUint64Le(resultNewoffset, uint64(newOffset)) { - return syscall.EFAULT - } - return 0 -} - -// fdSync is the WASI function named FdSyncName which synchronizes the data -// and metadata of a file to disk. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_syncfd-fd---errno -var fdSync = newHostFunc(wasip1.FdSyncName, fdSyncFn, []api.ValueType{i32}, "fd") - -func fdSyncFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - fd := int32(params[0]) - - // Check to see if the file descriptor is available - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else { - return f.File.Sync() - } -} - -// fdTell is the WASI function named FdTellName which returns the current -// offset of a file descriptor. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_tellfd-fd---errno-filesize -var fdTell = newHostFunc(wasip1.FdTellName, fdTellFn, []api.ValueType{i32, i32}, "fd", "result.offset") - -func fdTellFn(ctx context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := params[0] - offset := uint64(0) - whence := uint64(io.SeekCurrent) - resultNewoffset := params[1] - - fdSeekParams := []uint64{fd, offset, whence, resultNewoffset} - return fdSeekFn(ctx, mod, fdSeekParams) -} - -// fdWrite is the WASI function named FdWriteName which writes to a file -// descriptor. -// -// # Parameters -// -// - fd: an opened file descriptor to write data to -// - iovs: offset in api.Memory to read offset, size pairs representing the -// data to write to `fd` -// - Both offset and length are encoded as uint32le. -// - iovsCount: count of memory offset, size pairs to read sequentially -// starting at iovs -// - resultNwritten: offset in api.Memory to write the number of bytes -// written -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `iovs` or `resultNwritten` point to an offset out of memory -// - syscall.EIO: a file system error -// -// For example, this function needs to first read `iovs` to determine what to -// write to `fd`. If parameters iovs=1 iovsCount=2, this function reads two -// offset/length pairs from api.Memory: -// -// iovs[0] iovs[1] -// +---------------------+ +--------------------+ -// | uint32le uint32le| |uint32le uint32le| -// +---------+ +--------+ +--------+ +--------+ -// | | | | | | | | -// []byte{?, 18, 0, 0, 0, 4, 0, 0, 0, 23, 0, 0, 0, 2, 0, 0, 0, ?... } -// iovs --^ ^ ^ ^ -// | | | | -// offset --+ length --+ offset --+ length --+ -// -// This function reads those chunks api.Memory into the `fd` sequentially. -// -// iovs[0].length iovs[1].length -// +--------------+ +----+ -// | | | | -// []byte{ 0..16, ?, 'w', 'a', 'z', 'e', ?, 'r', 'o', ? } -// iovs[0].offset --^ ^ -// iovs[1].offset --+ -// -// Since "wazero" was written, if parameter resultNwritten=26, this function -// writes the below to api.Memory: -// -// uint32le -// +--------+ -// | | -// []byte{ 0..24, ?, 6, 0, 0, 0', ? } -// resultNwritten --^ -// -// Note: This is similar to `writev` in POSIX. https://linux.die.net/man/3/writev -// -// See fdRead -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#ciovec -// and https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_write -var fdWrite = newHostFunc( - wasip1.FdWriteName, fdWriteFn, - []api.ValueType{i32, i32, i32, i32}, - "fd", "iovs", "iovs_len", "result.nwritten", -) - -func fdWriteFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - return fdWriteOrPwrite(mod, params, false) -} - -// pwriter tracks an offset across multiple writes. -type pwriter struct { - f fsapi.File - offset int64 -} - -// Write implements the same function as documented on internalapi.File. -func (w *pwriter) Write(buf []byte) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length writes. - } - - n, err := w.f.Pwrite(buf, w.offset) - w.offset += int64(n) - return n, err -} - -func fdWriteOrPwrite(mod api.Module, params []uint64, isPwrite bool) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - iovs := uint32(params[1]) - iovsCount := uint32(params[2]) - - var resultNwritten uint32 - var writer func(buf []byte) (n int, errno syscall.Errno) - if f, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF - } else if isPwrite { - offset := int64(params[3]) - writer = (&pwriter{f: f.File, offset: offset}).Write - resultNwritten = uint32(params[4]) - } else { - writer = f.File.Write - resultNwritten = uint32(params[3]) - } - - nwritten, errno := writev(mem, iovs, iovsCount, writer) - if errno != 0 { - return errno - } - - if !mod.Memory().WriteUint32Le(resultNwritten, nwritten) { - return syscall.EFAULT - } - return 0 -} - -func writev(mem api.Memory, iovs uint32, iovsCount uint32, writer func(buf []byte) (n int, errno syscall.Errno)) (uint32, syscall.Errno) { - var nwritten uint32 - iovsStop := iovsCount << 3 // iovsCount * 8 - iovsBuf, ok := mem.Read(iovs, iovsStop) - if !ok { - return 0, syscall.EFAULT - } - - for iovsPos := uint32(0); iovsPos < iovsStop; iovsPos += 8 { - offset := le.Uint32(iovsBuf[iovsPos:]) - l := le.Uint32(iovsBuf[iovsPos+4:]) - - b, ok := mem.Read(offset, l) - if !ok { - return 0, syscall.EFAULT - } - n, errno := writer(b) - nwritten += uint32(n) - if errno == syscall.ENOSYS { - return 0, syscall.EBADF // e.g. unimplemented for write - } else if errno != 0 { - return 0, errno - } - } - return nwritten, 0 -} - -// pathCreateDirectory is the WASI function named PathCreateDirectoryName which -// creates a directory. -// -// # Parameters -// -// - fd: file descriptor of a directory that `path` is relative to -// - path: offset in api.Memory to read the path string from -// - pathLen: length of `path` -// -// # Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.ENOENT: `path` does not exist. -// - syscall.ENOTDIR: `path` is a file -// -// # Notes -// - This is similar to mkdirat in POSIX. -// See https://linux.die.net/man/2/mkdirat -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_create_directoryfd-fd-path-string---errno -var pathCreateDirectory = newHostFunc( - wasip1.PathCreateDirectoryName, pathCreateDirectoryFn, - []wasm.ValueType{i32, i32, i32}, - "fd", "path", "path_len", -) - -func pathCreateDirectoryFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - path := uint32(params[1]) - pathLen := uint32(params[2]) - - preopen, pathName, errno := atPath(fsc, mod.Memory(), fd, path, pathLen) - if errno != 0 { - return errno - } - - if errno = preopen.Mkdir(pathName, 0o700); errno != 0 { - return errno - } - - return 0 -} - -// pathFilestatGet is the WASI function named PathFilestatGetName which -// returns the stat attributes of a file or directory. -// -// # Parameters -// -// - fd: file descriptor of the folder to look in for the path -// - flags: flags determining the method of how paths are resolved -// - path: path under fd to get the filestat attributes data for -// - path_len: length of the path that was given -// - resultFilestat: offset to write the result filestat data -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.ENOTDIR: `fd` points to a file not a directory -// - syscall.EIO: could not stat `fd` on filesystem -// - syscall.EINVAL: the path contained "../" -// - syscall.ENAMETOOLONG: `path` + `path_len` is out of memory -// - syscall.EFAULT: `resultFilestat` points to an offset out of memory -// - syscall.ENOENT: could not find the path -// -// The rest of this implementation matches that of fdFilestatGet, so is not -// repeated here. -// -// Note: This is similar to `fstatat` in POSIX. -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_filestat_getfd-fd-flags-lookupflags-path-string---errno-filestat -// and https://linux.die.net/man/2/fstatat -var pathFilestatGet = newHostFunc( - wasip1.PathFilestatGetName, pathFilestatGetFn, - []api.ValueType{i32, i32, i32, i32, i32}, - "fd", "flags", "path", "path_len", "result.filestat", -) - -func pathFilestatGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - flags := uint16(params[1]) - path := uint32(params[2]) - pathLen := uint32(params[3]) - - preopen, pathName, errno := atPath(fsc, mod.Memory(), fd, path, pathLen) - if errno != 0 { - return errno - } - - // Stat the file without allocating a file descriptor. - var st fsapi.Stat_t - - if (flags & wasip1.LOOKUP_SYMLINK_FOLLOW) == 0 { - st, errno = preopen.Lstat(pathName) - } else { - st, errno = preopen.Stat(pathName) - } - if errno != 0 { - return errno - } - - // Write the stat result to memory - resultBuf := uint32(params[4]) - buf, ok := mod.Memory().Read(resultBuf, 64) - if !ok { - return syscall.EFAULT - } - - filetype := getWasiFiletype(st.Mode) - return writeFilestat(buf, &st, filetype) -} - -// pathFilestatSetTimes is the WASI function named PathFilestatSetTimesName -// which adjusts the timestamps of a file or directory. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_filestat_set_timesfd-fd-flags-lookupflags-path-string-atim-timestamp-mtim-timestamp-fst_flags-fstflags---errno -var pathFilestatSetTimes = newHostFunc( - wasip1.PathFilestatSetTimesName, pathFilestatSetTimesFn, - []wasm.ValueType{i32, i32, i32, i32, i64, i64, i32}, - "fd", "flags", "path", "path_len", "atim", "mtim", "fst_flags", -) - -func pathFilestatSetTimesFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fd := int32(params[0]) - flags := uint16(params[1]) - path := uint32(params[2]) - pathLen := uint32(params[3]) - atim := int64(params[4]) - mtim := int64(params[5]) - fstFlags := uint16(params[6]) - - sys := mod.(*wasm.ModuleInstance).Sys - fsc := sys.FS() - - times, errno := toTimes(atim, mtim, fstFlags) - if errno != 0 { - return errno - } - - preopen, pathName, errno := atPath(fsc, mod.Memory(), fd, path, pathLen) - if errno != 0 { - return errno - } - - symlinkFollow := flags&wasip1.LOOKUP_SYMLINK_FOLLOW != 0 - return preopen.Utimens(pathName, ×, symlinkFollow) -} - -// pathLink is the WASI function named PathLinkName which adjusts the -// timestamps of a file or directory. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#path_link -var pathLink = newHostFunc( - wasip1.PathLinkName, pathLinkFn, - []wasm.ValueType{i32, i32, i32, i32, i32, i32, i32}, - "old_fd", "old_flags", "old_path", "old_path_len", "new_fd", "new_path", "new_path_len", -) - -func pathLinkFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - oldFD := int32(params[0]) - // TODO: use old_flags? - _ = uint32(params[1]) - oldPath := uint32(params[2]) - oldPathLen := uint32(params[3]) - - oldFS, oldName, errno := atPath(fsc, mem, oldFD, oldPath, oldPathLen) - if errno != 0 { - return errno - } - - newFD := int32(params[4]) - newPath := uint32(params[5]) - newPathLen := uint32(params[6]) - - newFS, newName, errno := atPath(fsc, mem, newFD, newPath, newPathLen) - if errno != 0 { - return errno - } - - if oldFS != newFS { // TODO: handle link across filesystems - return syscall.ENOSYS - } - - return oldFS.Link(oldName, newName) -} - -// pathOpen is the WASI function named PathOpenName which opens a file or -// directory. This returns syscall.EBADF if the fd is invalid. -// -// # Parameters -// -// - fd: file descriptor of a directory that `path` is relative to -// - dirflags: flags to indicate how to resolve `path` -// - path: offset in api.Memory to read the path string from -// - pathLen: length of `path` -// - oFlags: open flags to indicate the method by which to open the file -// - fsRightsBase: interpret RIGHT_FD_WRITE to set O_RDWR -// - fsRightsInheriting: ignored as rights were removed from WASI. -// created file descriptor for `path` -// - fdFlags: file descriptor flags -// - resultOpenedFD: offset in api.Memory to write the newly created file -// descriptor to. -// - The result FD value is guaranteed to be less than 2**31 -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.EFAULT: `resultOpenedFD` points to an offset out of memory -// - syscall.ENOENT: `path` does not exist. -// - syscall.EEXIST: `path` exists, while `oFlags` requires that it must not. -// - syscall.ENOTDIR: `path` is not a directory, while `oFlags` requires it. -// - syscall.EIO: a file system error -// -// For example, this function needs to first read `path` to determine the file -// to open. If parameters `path` = 1, `pathLen` = 6, and the path is "wazero", -// pathOpen reads the path from api.Memory: -// -// pathLen -// +------------------------+ -// | | -// []byte{ ?, 'w', 'a', 'z', 'e', 'r', 'o', ?... } -// path --^ -// -// Then, if parameters resultOpenedFD = 8, and this function opened a new file -// descriptor 5 with the given flags, this function writes the below to -// api.Memory: -// -// uint32le -// +--------+ -// | | -// []byte{ 0..6, ?, 5, 0, 0, 0, ?} -// resultOpenedFD --^ -// -// # Notes -// - This is similar to `openat` in POSIX. https://linux.die.net/man/3/openat -// - The returned file descriptor is not guaranteed to be the lowest-number -// -// See https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#path_open -var pathOpen = newHostFunc( - wasip1.PathOpenName, pathOpenFn, - []api.ValueType{i32, i32, i32, i32, i32, i64, i64, i32, i32}, - "fd", "dirflags", "path", "path_len", "oflags", "fs_rights_base", "fs_rights_inheriting", "fdflags", "result.opened_fd", -) - -func pathOpenFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - preopenFD := int32(params[0]) - - // TODO: dirflags is a lookupflags, and it only has one bit: symlink_follow - // https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#lookupflags - dirflags := uint16(params[1]) - - path := uint32(params[2]) - pathLen := uint32(params[3]) - - oflags := uint16(params[4]) - - rights := uint32(params[5]) - // inherited rights aren't used - _ = params[6] - - fdflags := uint16(params[7]) - resultOpenedFD := uint32(params[8]) - - preopen, pathName, errno := atPath(fsc, mod.Memory(), preopenFD, path, pathLen) - if errno != 0 { - return errno - } - - fileOpenFlags := openFlags(dirflags, oflags, fdflags, rights) - isDir := fileOpenFlags&fsapi.O_DIRECTORY != 0 - - if isDir && oflags&wasip1.O_CREAT != 0 { - return syscall.EINVAL // use pathCreateDirectory! - } - - newFD, errno := fsc.OpenFile(preopen, pathName, fileOpenFlags, 0o600) - if errno != 0 { - return errno - } - - // Check any flags that require the file to evaluate. - if isDir { - if f, ok := fsc.LookupFile(newFD); !ok { - return syscall.EBADF // unexpected - } else if isDir, errno := f.File.IsDir(); errno != 0 { - _ = fsc.CloseFile(newFD) - return errno - } else if !isDir { - _ = fsc.CloseFile(newFD) - return syscall.ENOTDIR - } - } - - if !mod.Memory().WriteUint32Le(resultOpenedFD, uint32(newFD)) { - _ = fsc.CloseFile(newFD) - return syscall.EFAULT - } - return 0 -} - -// atPath returns the pre-open specific path after verifying it is a directory. -// -// # Notes -// -// Languages including Zig and Rust use only pre-opens for the FD because -// wasi-libc `__wasilibc_find_relpath` will only return a preopen. That said, -// our wasi.c example shows other languages act differently and can use a non -// pre-opened file descriptor. -// -// We don't handle `AT_FDCWD`, as that's resolved in the compiler. There's no -// working directory function in WASI, so most assume CWD is "/". Notably, Zig -// has different behavior which assumes it is whatever the first pre-open name -// is. -// -// See https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/sources/at_fdcwd.c -// See https://linux.die.net/man/2/openat -func atPath(fsc *sys.FSContext, mem api.Memory, fd int32, p, pathLen uint32) (fsapi.FS, string, syscall.Errno) { - b, ok := mem.Read(p, pathLen) - if !ok { - return nil, "", syscall.EFAULT - } - pathName := string(b) - - // interesting_paths wants us to break on trailing slash if the input ends - // up a file, not a directory! - hasTrailingSlash := strings.HasSuffix(pathName, "/") - - // interesting_paths includes paths that include relative links but end up - // not escaping - pathName = path.Clean(pathName) - - // interesting_paths wants to break on root paths or anything that escapes. - // This part is the same as fs.FS.Open() - if !fs.ValidPath(pathName) { - return nil, "", syscall.EPERM - } - - // add the trailing slash back - if hasTrailingSlash { - pathName = pathName + "/" - } - - if f, ok := fsc.LookupFile(fd); !ok { - return nil, "", syscall.EBADF // closed or invalid - } else if isDir, errno := f.File.IsDir(); errno != 0 { - return nil, "", errno - } else if !isDir { - return nil, "", syscall.ENOTDIR - } else if f.IsPreopen { // don't append the pre-open name - return f.FS, pathName, 0 - } else { - // Join via concat to avoid name conflict on path.Join - return f.FS, f.Name + "/" + pathName, 0 - } -} - -func preopenPath(fsc *sys.FSContext, fd int32) (string, syscall.Errno) { - if f, ok := fsc.LookupFile(fd); !ok { - return "", syscall.EBADF // closed - } else if !f.IsPreopen { - return "", syscall.EBADF - } else if isDir, errno := f.File.IsDir(); errno != 0 || !isDir { - // In wasip1, only directories can be returned by fd_prestat_get as - // there are no prestat types defined for files or sockets. - return "", errno - } else { - return f.Name, 0 - } -} - -func openFlags(dirflags, oflags, fdflags uint16, rights uint32) (openFlags int) { - if dirflags&wasip1.LOOKUP_SYMLINK_FOLLOW == 0 { - openFlags |= fsapi.O_NOFOLLOW - } - if oflags&wasip1.O_DIRECTORY != 0 { - openFlags |= fsapi.O_DIRECTORY - return // Early return for directories as the rest of flags doesn't make sense for it. - } else if oflags&wasip1.O_EXCL != 0 { - openFlags |= syscall.O_EXCL - } - // Because we don't implement rights, we paritally rely on the open flags - // to determine the mode in which the file will be opened. This will create - // divergent behavior compared to WASI runtimes which have a more strict - // interpretation of the WASI capabilities model; for example, a program - // which sets O_CREAT but does not give read or write permissions will - // successfully create a file when running with wazero, but might get a - // permission denied error on other runtimes. - defaultMode := syscall.O_RDONLY - if oflags&wasip1.O_TRUNC != 0 { - openFlags |= syscall.O_TRUNC - defaultMode = syscall.O_RDWR - } - if oflags&wasip1.O_CREAT != 0 { - openFlags |= syscall.O_CREAT - defaultMode = syscall.O_RDWR - } - if fdflags&wasip1.FD_NONBLOCK != 0 { - openFlags |= syscall.O_NONBLOCK - } - if fdflags&wasip1.FD_APPEND != 0 { - openFlags |= syscall.O_APPEND - defaultMode = syscall.O_RDWR - } - // Since rights were discontinued in wasi, we only interpret RIGHT_FD_WRITE - // because it is the only way to know that we need to set write permissions - // on a file if the application did not pass any of O_CREATE, O_APPEND, nor - // O_TRUNC. - const r = wasip1.RIGHT_FD_READ - const w = wasip1.RIGHT_FD_WRITE - const rw = r | w - switch { - case (rights & rw) == rw: - openFlags |= syscall.O_RDWR - case (rights & w) == w: - openFlags |= syscall.O_WRONLY - case (rights & r) == r: - openFlags |= syscall.O_RDONLY - default: - openFlags |= defaultMode - } - return -} - -// pathReadlink is the WASI function named PathReadlinkName that reads the -// contents of a symbolic link. -// -// See: https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_readlinkfd-fd-path-string-buf-pointeru8-buf_len-size---errno-size -var pathReadlink = newHostFunc( - wasip1.PathReadlinkName, pathReadlinkFn, - []wasm.ValueType{i32, i32, i32, i32, i32, i32}, - "fd", "path", "path_len", "buf", "buf_len", "result.bufused", -) - -func pathReadlinkFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - path := uint32(params[1]) - pathLen := uint32(params[2]) - buf := uint32(params[3]) - bufLen := uint32(params[4]) - resultBufused := uint32(params[5]) - - if pathLen == 0 || bufLen == 0 { - return syscall.EINVAL - } - - mem := mod.Memory() - preopen, p, errno := atPath(fsc, mem, fd, path, pathLen) - if errno != 0 { - return errno - } - - dst, errno := preopen.Readlink(p) - if errno != 0 { - return errno - } - - if ok := mem.WriteString(buf, dst); !ok { - return syscall.EFAULT - } - - if !mem.WriteUint32Le(resultBufused, uint32(len(dst))) { - return syscall.EFAULT - } - return 0 -} - -// pathRemoveDirectory is the WASI function named PathRemoveDirectoryName which -// removes a directory. -// -// # Parameters -// -// - fd: file descriptor of a directory that `path` is relative to -// - path: offset in api.Memory to read the path string from -// - pathLen: length of `path` -// -// # Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.ENOENT: `path` does not exist. -// - syscall.ENOTEMPTY: `path` is not empty -// - syscall.ENOTDIR: `path` is a file -// -// # Notes -// - This is similar to unlinkat with AT_REMOVEDIR in POSIX. -// See https://linux.die.net/man/2/unlinkat -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_remove_directoryfd-fd-path-string---errno -var pathRemoveDirectory = newHostFunc( - wasip1.PathRemoveDirectoryName, pathRemoveDirectoryFn, - []wasm.ValueType{i32, i32, i32}, - "fd", "path", "path_len", -) - -func pathRemoveDirectoryFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - path := uint32(params[1]) - pathLen := uint32(params[2]) - - preopen, pathName, errno := atPath(fsc, mod.Memory(), fd, path, pathLen) - if errno != 0 { - return errno - } - - return preopen.Rmdir(pathName) -} - -// pathRename is the WASI function named PathRenameName which renames a file or -// directory. -// -// # Parameters -// -// - fd: file descriptor of a directory that `old_path` is relative to -// - old_path: offset in api.Memory to read the old path string from -// - old_path_len: length of `old_path` -// - new_fd: file descriptor of a directory that `new_path` is relative to -// - new_path: offset in api.Memory to read the new path string from -// - new_path_len: length of `new_path` -// -// # Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` or `new_fd` are invalid -// - syscall.ENOENT: `old_path` does not exist. -// - syscall.ENOTDIR: `old` is a directory and `new` exists, but is a file. -// - syscall.EISDIR: `old` is a file and `new` exists, but is a directory. -// -// # Notes -// - This is similar to unlinkat in POSIX. -// See https://linux.die.net/man/2/renameat -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_renamefd-fd-old_path-string-new_fd-fd-new_path-string---errno -var pathRename = newHostFunc( - wasip1.PathRenameName, pathRenameFn, - []wasm.ValueType{i32, i32, i32, i32, i32, i32}, - "fd", "old_path", "old_path_len", "new_fd", "new_path", "new_path_len", -) - -func pathRenameFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - oldPath := uint32(params[1]) - oldPathLen := uint32(params[2]) - - newFD := int32(params[3]) - newPath := uint32(params[4]) - newPathLen := uint32(params[5]) - - oldFS, oldPathName, errno := atPath(fsc, mod.Memory(), fd, oldPath, oldPathLen) - if errno != 0 { - return errno - } - - newFS, newPathName, errno := atPath(fsc, mod.Memory(), newFD, newPath, newPathLen) - if errno != 0 { - return errno - } - - if oldFS != newFS { // TODO: handle renames across filesystems - return syscall.ENOSYS - } - - return oldFS.Rename(oldPathName, newPathName) -} - -// pathSymlink is the WASI function named PathSymlinkName which creates a -// symbolic link. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#path_symlink -var pathSymlink = newHostFunc( - wasip1.PathSymlinkName, pathSymlinkFn, - []wasm.ValueType{i32, i32, i32, i32, i32}, - "old_path", "old_path_len", "fd", "new_path", "new_path_len", -) - -func pathSymlinkFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - oldPath := uint32(params[0]) - oldPathLen := uint32(params[1]) - fd := int32(params[2]) - newPath := uint32(params[3]) - newPathLen := uint32(params[4]) - - mem := mod.Memory() - - dir, ok := fsc.LookupFile(fd) - if !ok { - return syscall.EBADF // closed - } else if isDir, errno := dir.File.IsDir(); errno != 0 { - return errno - } else if !isDir { - return syscall.ENOTDIR - } - - if oldPathLen == 0 || newPathLen == 0 { - return syscall.EINVAL - } - - oldPathBuf, ok := mem.Read(oldPath, oldPathLen) - if !ok { - return syscall.EFAULT - } - - newPathBuf, ok := mem.Read(newPath, newPathLen) - if !ok { - return syscall.EFAULT - } - - return dir.FS.Symlink( - // Do not join old path since it's only resolved when dereference the link created here. - // And the dereference result depends on the opening directory's file descriptor at that point. - bufToStr(oldPathBuf), - path.Join(dir.Name, bufToStr(newPathBuf)), - ) -} - -// bufToStr converts the given byte slice as string unsafely. -func bufToStr(buf []byte) string { - // TODO: use unsafe.String after flooring Go 1.20. - return *(*string)(unsafe.Pointer(&buf)) -} - -// pathUnlinkFile is the WASI function named PathUnlinkFileName which unlinks a -// file. -// -// # Parameters -// -// - fd: file descriptor of a directory that `path` is relative to -// - path: offset in api.Memory to read the path string from -// - pathLen: length of `path` -// -// # Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EBADF: `fd` is invalid -// - syscall.ENOENT: `path` does not exist. -// - syscall.EISDIR: `path` is a directory -// -// # Notes -// - This is similar to unlinkat without AT_REMOVEDIR in POSIX. -// See https://linux.die.net/man/2/unlinkat -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-path_unlink_filefd-fd-path-string---errno -var pathUnlinkFile = newHostFunc( - wasip1.PathUnlinkFileName, pathUnlinkFileFn, - []wasm.ValueType{i32, i32, i32}, - "fd", "path", "path_len", -) - -func pathUnlinkFileFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - path := uint32(params[1]) - pathLen := uint32(params[2]) - - preopen, pathName, errno := atPath(fsc, mod.Memory(), fd, path, pathLen) - if errno != 0 { - return errno - } - - return preopen.Unlink(pathName) -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go deleted file mode 100644 index 1d8ec7f94c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/poll.go +++ /dev/null @@ -1,251 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - "time" - - "github.com/tetratelabs/wazero/api" - internalsys "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// pollOneoff is the WASI function named PollOneoffName that concurrently -// polls for the occurrence of a set of events. -// -// # Parameters -// -// - in: pointer to the subscriptions (48 bytes each) -// - out: pointer to the resulting events (32 bytes each) -// - nsubscriptions: count of subscriptions, zero returns syscall.EINVAL. -// - resultNevents: count of events. -// -// Result (Errno) -// -// The return value is 0 except the following error conditions: -// - syscall.EINVAL: the parameters are invalid -// - syscall.ENOTSUP: a parameters is valid, but not yet supported. -// - syscall.EFAULT: there is not enough memory to read the subscriptions or -// write results. -// -// # Notes -// -// - Since the `out` pointer nests Errno, the result is always 0. -// - This is similar to `poll` in POSIX. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#poll_oneoff -// See https://linux.die.net/man/3/poll -var pollOneoff = newHostFunc( - wasip1.PollOneoffName, pollOneoffFn, - []api.ValueType{i32, i32, i32, i32}, - "in", "out", "nsubscriptions", "result.nevents", -) - -type event struct { - eventType byte - userData []byte - errno wasip1.Errno - outOffset uint32 -} - -func pollOneoffFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - in := uint32(params[0]) - out := uint32(params[1]) - nsubscriptions := uint32(params[2]) - resultNevents := uint32(params[3]) - - if nsubscriptions == 0 { - return syscall.EINVAL - } - - mem := mod.Memory() - - // Ensure capacity prior to the read loop to reduce error handling. - inBuf, ok := mem.Read(in, nsubscriptions*48) - if !ok { - return syscall.EFAULT - } - outBuf, ok := mem.Read(out, nsubscriptions*32) - // zero-out all buffer before writing - for i := range outBuf { - outBuf[i] = 0 - } - - if !ok { - return syscall.EFAULT - } - - // Eagerly write the number of events which will equal subscriptions unless - // there's a fault in parsing (not processing). - if !mod.Memory().WriteUint32Le(resultNevents, nsubscriptions) { - return syscall.EFAULT - } - - // Loop through all subscriptions and write their output. - - // Extract FS context, used in the body of the for loop for FS access. - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - // Slice of events that are processed out of the loop (stdin subscribers). - var stdinSubs []*event - // The timeout is initialized at max Duration, the loop will find the minimum. - var timeout time.Duration = 1<<63 - 1 - // Count of all the clock subscribers that have been already written back to outBuf. - clockEvents := uint32(0) - // Count of all the non-clock subscribers that have been already written back to outBuf. - readySubs := uint32(0) - - // Layout is subscription_u: Union - // https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#subscription_u - for i := uint32(0); i < nsubscriptions; i++ { - inOffset := i * 48 - outOffset := i * 32 - - eventType := inBuf[inOffset+8] // +8 past userdata - // +8 past userdata +8 contents_offset - argBuf := inBuf[inOffset+8+8:] - userData := inBuf[inOffset : inOffset+8] - - evt := &event{ - eventType: eventType, - userData: userData, - errno: wasip1.ErrnoSuccess, - outOffset: outOffset, - } - - switch eventType { - case wasip1.EventTypeClock: // handle later - clockEvents++ - newTimeout, err := processClockEvent(argBuf) - if err != 0 { - return err - } - // Min timeout. - if newTimeout < timeout { - timeout = newTimeout - } - // Ack the clock event to the outBuf. - writeEvent(outBuf, evt) - case wasip1.EventTypeFdRead: - fd := int32(le.Uint32(argBuf)) - if fd < 0 { - return syscall.EBADF - } - if fd == internalsys.FdStdin { - // if the fd is Stdin, do not ack yet, - // append to a slice for delayed evaluation. - stdinSubs = append(stdinSubs, evt) - } else { - evt.errno = processFDEventRead(fsc, fd) - writeEvent(outBuf, evt) - readySubs++ - } - case wasip1.EventTypeFdWrite: - fd := int32(le.Uint32(argBuf)) - if fd < 0 { - return syscall.EBADF - } - evt.errno = processFDEventWrite(fsc, fd) - readySubs++ - writeEvent(outBuf, evt) - default: - return syscall.EINVAL - } - } - - // If there are subscribers with data ready, we have already written them to outBuf, - // and we don't need to wait for the timeout: clear it. - if readySubs != 0 { - timeout = 0 - } - - // If there are stdin subscribers, check for data with given timeout. - if len(stdinSubs) > 0 { - stdin, ok := fsc.LookupFile(internalsys.FdStdin) - if !ok { - return syscall.EBADF - } - // Wait for the timeout to expire, or for some data to become available on Stdin. - stdinReady, errno := stdin.File.PollRead(&timeout) - if errno != 0 { - return errno - } - if stdinReady { - // stdin has data ready to for reading, write back all the events - for i := range stdinSubs { - readySubs++ - evt := stdinSubs[i] - evt.errno = 0 - writeEvent(outBuf, evt) - } - } - } else { - // No subscribers, just wait for the given timeout. - sysCtx := mod.(*wasm.ModuleInstance).Sys - sysCtx.Nanosleep(int64(timeout)) - } - - if readySubs != nsubscriptions { - if !mod.Memory().WriteUint32Le(resultNevents, readySubs+clockEvents) { - return syscall.EFAULT - } - } - - return 0 -} - -// processClockEvent supports only relative name events, as that's what's used -// to implement sleep in various compilers including Rust, Zig and TinyGo. -func processClockEvent(inBuf []byte) (time.Duration, syscall.Errno) { - _ /* ID */ = le.Uint32(inBuf[0:8]) // See below - timeout := le.Uint64(inBuf[8:16]) // nanos if relative - _ /* precision */ = le.Uint64(inBuf[16:24]) // Unused - flags := le.Uint16(inBuf[24:32]) - - var err syscall.Errno - // subclockflags has only one flag defined: subscription_clock_abstime - switch flags { - case 0: // relative time - case 1: // subscription_clock_abstime - err = syscall.ENOTSUP - default: // subclockflags has only one flag defined. - err = syscall.EINVAL - } - - if err != 0 { - return 0, err - } else { - // https://linux.die.net/man/3/clock_settime says relative timers are - // unaffected. Since this function only supports relative timeout, we can - // skip name ID validation and use a single sleep function. - - return time.Duration(timeout), 0 - } -} - -// processFDEventRead returns ErrnoSuccess if the file exists and ErrnoBadf otherwise. -func processFDEventRead(fsc *internalsys.FSContext, fd int32) wasip1.Errno { - if _, ok := fsc.LookupFile(fd); ok { - return wasip1.ErrnoSuccess - } else { - return wasip1.ErrnoBadf - } -} - -// processFDEventWrite returns ErrnoNotsup if the file exists and ErrnoBadf otherwise. -func processFDEventWrite(fsc *internalsys.FSContext, fd int32) wasip1.Errno { - if _, ok := fsc.LookupFile(fd); ok { - return wasip1.ErrnoNotsup - } - return wasip1.ErrnoBadf -} - -// writeEvent writes the event corresponding to the processed subscription. -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-event-struct -func writeEvent(outBuf []byte, evt *event) { - copy(outBuf[evt.outOffset:], evt.userData) // userdata - outBuf[evt.outOffset+8] = byte(evt.errno) // uint16, but safe as < 255 - outBuf[evt.outOffset+9] = 0 - le.PutUint32(outBuf[evt.outOffset+10:], uint32(evt.eventType)) - // TODO: When FD events are supported, write outOffset+16 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go deleted file mode 100644 index cb0ab487c3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/proc.go +++ /dev/null @@ -1,44 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/sys" -) - -// procExit is the WASI function named ProcExitName that terminates the -// execution of the module with an exit code. The only successful exit code is -// zero. -// -// # Parameters -// -// - exitCode: exit code. -// -// See https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#proc_exit -var procExit = &wasm.HostFunc{ - ExportName: wasip1.ProcExitName, - Name: wasip1.ProcExitName, - ParamTypes: []api.ValueType{i32}, - ParamNames: []string{"rval"}, - Code: wasm.Code{GoFunc: api.GoModuleFunc(procExitFn)}, -} - -func procExitFn(ctx context.Context, mod api.Module, params []uint64) { - exitCode := uint32(params[0]) - - // Ensure other callers see the exit code. - _ = mod.CloseWithExitCode(ctx, exitCode) - - // Prevent any code from executing after this function. For example, LLVM - // inserts unreachable instructions after calls to exit. - // See: https://github.com/emscripten-core/emscripten/issues/12322 - panic(sys.NewExitError(exitCode)) -} - -// procRaise is stubbed and will never be supported, as it was removed. -// -// See https://github.com/WebAssembly/WASI/pull/136 -var procRaise = stubFunction(wasip1.ProcRaiseName, []api.ValueType{i32}, "sig") diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go deleted file mode 100644 index dc94bf7da1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/random.go +++ /dev/null @@ -1,55 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "io" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// randomGet is the WASI function named RandomGetName which writes random -// data to a buffer. -// -// # Parameters -// -// - buf: api.Memory offset to write random values -// - bufLen: size of random data in bytes -// -// Result (Errno) -// -// The return value is ErrnoSuccess except the following error conditions: -// - syscall.EFAULT: `buf` or `bufLen` point to an offset out of memory -// - syscall.EIO: a file system error -// -// For example, if underlying random source was seeded like -// `rand.NewSource(42)`, we expect api.Memory to contain: -// -// bufLen (5) -// +--------------------------+ -// | | -// []byte{?, 0x53, 0x8c, 0x7f, 0x96, 0xb1, ?} -// buf --^ -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-random_getbuf-pointeru8-bufLen-size---errno -var randomGet = newHostFunc(wasip1.RandomGetName, randomGetFn, []api.ValueType{i32, i32}, "buf", "buf_len") - -func randomGetFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - randSource := sysCtx.RandSource() - buf, bufLen := uint32(params[0]), uint32(params[1]) - - randomBytes, ok := mod.Memory().Read(buf, bufLen) - if !ok { // out-of-range - return syscall.EFAULT - } - - // We can ignore the returned n as it only != byteCount on error - if _, err := io.ReadAtLeast(randSource, randomBytes, int(bufLen)); err != nil { - return syscall.EIO - } - - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go deleted file mode 100644 index b6dbf190d5..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sched.go +++ /dev/null @@ -1,22 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// schedYield is the WASI function named SchedYieldName which temporarily -// yields execution of the calling thread. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-sched_yield---errno -var schedYield = newHostFunc(wasip1.SchedYieldName, schedYieldFn, nil) - -func schedYieldFn(_ context.Context, mod api.Module, _ []uint64) syscall.Errno { - sysCtx := mod.(*wasm.ModuleInstance).Sys - sysCtx.Osyield() - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go deleted file mode 100644 index 3dacf3df15..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/sock.go +++ /dev/null @@ -1,187 +0,0 @@ -package wasi_snapshot_preview1 - -import ( - "context" - "syscall" - - "github.com/tetratelabs/wazero/api" - socketapi "github.com/tetratelabs/wazero/internal/sock" - "github.com/tetratelabs/wazero/internal/sysfs" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// sockAccept is the WASI function named SockAcceptName which accepts a new -// incoming connection. -// -// See: https://github.com/WebAssembly/WASI/blob/0ba0c5e2e37625ca5a6d3e4255a998dfaa3efc52/phases/snapshot/docs.md#sock_accept -// and https://github.com/WebAssembly/WASI/pull/458 -var sockAccept = newHostFunc( - wasip1.SockAcceptName, - sockAcceptFn, - []wasm.ValueType{i32, i32, i32}, - "fd", "flags", "result.fd", -) - -func sockAcceptFn(_ context.Context, mod api.Module, params []uint64) (errno syscall.Errno) { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - flags := uint32(params[1]) - resultFd := uint32(params[2]) - nonblock := flags&uint32(wasip1.FD_NONBLOCK) != 0 - - var connFD int32 - if connFD, errno = fsc.SockAccept(fd, nonblock); errno == 0 { - mem.WriteUint32Le(resultFd, uint32(connFD)) - } - return -} - -// sockRecv is the WASI function named SockRecvName which receives a -// message from a socket. -// -// See: https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-sock_recvfd-fd-ri_data-iovec_array-ri_flags-riflags---errno-size-roflags -var sockRecv = newHostFunc( - wasip1.SockRecvName, - sockRecvFn, - []wasm.ValueType{i32, i32, i32, i32, i32, i32}, - "fd", "ri_data", "ri_data_len", "ri_flags", "result.ro_datalen", "result.ro_flags", -) - -func sockRecvFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - riData := uint32(params[1]) - riDataCount := uint32(params[2]) - riFlags := uint8(params[3]) - resultRoDatalen := uint32(params[4]) - resultRoFlags := uint32(params[5]) - - var conn socketapi.TCPConn - if e, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF // Not open - } else if conn, ok = e.File.(socketapi.TCPConn); !ok { - return syscall.EBADF // Not a conn - } - - if riFlags & ^(wasip1.RI_RECV_PEEK|wasip1.RI_RECV_WAITALL) != 0 { - return syscall.ENOTSUP - } - - if riFlags&wasip1.RI_RECV_PEEK != 0 { - // Each record in riData is of the form: - // type iovec struct { buf *uint8; bufLen uint32 } - // This means that the first `uint32` is a `buf *uint8`. - firstIovecBufAddr, ok := mem.ReadUint32Le(riData) - if !ok { - return syscall.EINVAL - } - // Read bufLen - firstIovecBufLen, ok := mem.ReadUint32Le(riData + 4) - if !ok { - return syscall.EINVAL - } - firstIovecBuf, ok := mem.Read(firstIovecBufAddr, firstIovecBufLen) - if !ok { - return syscall.EINVAL - } - n, err := conn.Recvfrom(firstIovecBuf, sysfs.MSG_PEEK) - if err != 0 { - return err - } - mem.WriteUint32Le(resultRoDatalen, uint32(n)) - mem.WriteUint16Le(resultRoFlags, 0) - return 0 - } - - // If riFlags&wasip1.RECV_WAITALL != 0 then we should - // do a blocking operation until all data has been retrieved; - // otherwise we are able to return earlier. - // For simplicity, we currently wait all regardless the flag. - bufSize, errno := readv(mem, riData, riDataCount, conn.Read) - if errno != 0 { - return errno - } - mem.WriteUint32Le(resultRoDatalen, bufSize) - mem.WriteUint16Le(resultRoFlags, 0) - return 0 -} - -// sockSend is the WASI function named SockSendName which sends a message -// on a socket. -// -// See: https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-sock_sendfd-fd-si_data-ciovec_array-si_flags-siflags---errno-size -var sockSend = newHostFunc( - wasip1.SockSendName, - sockSendFn, - []wasm.ValueType{i32, i32, i32, i32, i32}, - "fd", "si_data", "si_data_len", "si_flags", "result.so_datalen", -) - -func sockSendFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - mem := mod.Memory() - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - siData := uint32(params[1]) - siDataCount := uint32(params[2]) - siFlags := uint32(params[3]) - resultSoDatalen := uint32(params[4]) - - if siFlags != 0 { - return syscall.ENOTSUP - } - - var conn socketapi.TCPConn - if e, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF // Not open - } else if conn, ok = e.File.(socketapi.TCPConn); !ok { - return syscall.EBADF // Not a conn - } - - bufSize, errno := writev(mem, siData, siDataCount, conn.Write) - if errno != 0 { - return errno - } - mem.WriteUint32Le(resultSoDatalen, bufSize) - return 0 -} - -// sockShutdown is the WASI function named SockShutdownName which shuts -// down socket send and receive channels. -// -// See: https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-sock_shutdownfd-fd-how-sdflags---errno -var sockShutdown = newHostFunc(wasip1.SockShutdownName, sockShutdownFn, []wasm.ValueType{i32, i32}, "fd", "how") - -func sockShutdownFn(_ context.Context, mod api.Module, params []uint64) syscall.Errno { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := int32(params[0]) - how := uint8(params[1]) - - var conn socketapi.TCPConn - if e, ok := fsc.LookupFile(fd); !ok { - return syscall.EBADF // Not open - } else if conn, ok = e.File.(socketapi.TCPConn); !ok { - return syscall.EBADF // Not a conn - } - - sysHow := 0 - - switch how { - case wasip1.SD_RD | wasip1.SD_WR: - sysHow = syscall.SHUT_RD | syscall.SHUT_WR - case wasip1.SD_RD: - sysHow = syscall.SHUT_RD - case wasip1.SD_WR: - sysHow = syscall.SHUT_WR - default: - return syscall.EINVAL - } - - return conn.Shutdown(sysHow) -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/Cargo.toml b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/Cargo.toml deleted file mode 100644 index f1e93d7b4e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "wasi" -version = "0.1.0" -edition = "2021" - -[[bin]] -name = "wasi" -path = "wasi.rs" - -[dependencies] -libc = "0.2" diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.rs b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.rs deleted file mode 100644 index 3641e53949..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::env; -use std::fs; -use std::io; -use std::io::{Read,Write}; -use std::net::{TcpListener}; -use std::os::wasi::io::FromRawFd; -use std::process::exit; -use std::str::from_utf8; - -// Until NotADirectory is implemented, read the underlying error raised by -// wasi-libc. See https://github.com/rust-lang/rust/issues/86442 -use libc::ENOTDIR; - -fn main() { - let args: Vec = env::args().collect(); - - match args[1].as_str() { - "ls" => { - main_ls(&args[2]); - if args.len() == 4 && args[3].as_str() == "repeat" { - main_ls(&args[2]); - } - } - "stat" => main_stat(), - "sock" => main_sock(), - _ => { - writeln!(io::stderr(), "unknown command: {}", args[1]).unwrap(); - exit(1); - } - } -} - -fn main_ls(dir_name: &String) { - match fs::read_dir(dir_name) { - Ok(paths) => { - for ent in paths.into_iter() { - println!("{}", ent.unwrap().path().display()); - } - } - Err(e) => { - if let Some(error_code) = e.raw_os_error() { - if error_code == ENOTDIR { - println!("ENOTDIR"); - } else { - println!("errno=={}", error_code); - } - } else { - writeln!(io::stderr(), "failed to read directory: {}", e).unwrap(); - } - } - } -} - -extern crate libc; - -fn main_stat() { - unsafe { - println!("stdin isatty: {}", libc::isatty(0) != 0); - println!("stdout isatty: {}", libc::isatty(1) != 0); - println!("stderr isatty: {}", libc::isatty(2) != 0); - println!("/ isatty: {}", libc::isatty(3) != 0); - } -} - -fn main_sock() { - // Get a listener from the pre-opened file descriptor. - // The listener is the first pre-open, with a file-descriptor of 3. - let listener = unsafe { TcpListener::from_raw_fd(3) }; - for conn in listener.incoming() { - match conn { - Ok(mut conn) => { - // Do a blocking read of up to 32 bytes. - // Note: the test should write: "wazero", so that's all we should read. - let mut data = [0 as u8; 32]; - match conn.read(&mut data) { - Ok(size) => { - let text = from_utf8(&data[0..size]).unwrap(); - println!("{}", text); - - // Exit instead of accepting another connection. - exit(0); - }, - Err(e) => writeln!(io::stderr(), "failed to read data: {}", e).unwrap(), - } {} - } - Err(e) => writeln!(io::stderr(), "failed to read connection: {}", e).unwrap(), - } - } -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/cargo-wasi/wasi.wasm deleted file mode 100644 index 2ddde1064d285a9000aa3393cd087ad96e738ed6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 94484 zcmd?S4Y*y`S(v$h&fmS~Ug^kIQemlhpA!wpjfGX9wkwB;mP+gx$4Q|4%|ORa6PM)P z{8+L^q#bH0iIbWnErz(kFaZo?h=BwGV_FXrnhTgt7tb;^ep7am%;dcB&{Y zP-9orxZ^c{>$Z#68~%+~-E#7_SG=lNxj;j!ZG~68=47#UfjT4VeCx^AoVx9Tt*qSs zic_z?DQcm!|N|P_B~ytXCA(g zzw)(jxZ}2BaDg7zsqr^nb;qe!oVsYAyQs$OJY&5}m+FDiTVDT)*WGr((XQNn@(r)N z<+eAz=2TJFkCwk$4(e*ugG`HYS@p|ZyaC7O z)g?t$4EiHF8Q4+L^G{K%`06-brybx705TMHNl8`LL;f28@36eRd^7+0JlHc>ftk|T zvs=Y@_`G`Xy4zm&hLeAjE^YyzCr=gcDaW_m^14^N=JmIne#2{CRlK`g`E8m`<@inI zZ!VE6CoTs>6&1Fn9w z{F^WPE8qIx9RBbBZh775ulUM0-c|mE-ztBjd}n#tjep~Bd-b)m7ypy;H_LmUhi1CJ6~V6R*us>TpvGkO;tqc@v~>|IxAK!@ReqqMjPq&6Y1kW_FF&Jzhl-9<}%k73yP6l|ISc z2EUK_8$C5WZa)^cCAGMDJnFPJPqi;R5jE_!siR>ke!6}3WIT%($|kB*=~MBnZKTeWFJrO_|CQO?5Jrcg*TkpPCgN zDtIAqWIMe>)o4~+-?rQg(w$BHttSA4$!*F8s7FoFFxItk(_=2D6-aHHt505C^?2Ib zm=z6B^-^ic8dZns!4}Zfo7c;x6rfZ!l~7Q3^CWFor%tqYCsMg-6KU;qnw-dk=$}p_ zo-+W!a9Gvp)T3m6U!G3YIrruK-dVZOm{-mpbM>t!W`mtay~1GfNLQc>+uUHx!_8Tr z`pvLef!3OS9(uFdJJzhGH=f9-o)&2Qs8{ z_h2(gC}#eRCqT&*YM7Swu?pflR83|Tql66iMzso%#!V%eMCDltCGr1_vvNN#GR%ex z20bl7Mc`uJRN|xkwOM@wO^F@|L1{q8H(mz2LYX640XGbvm*{Lp-$m}5YC^GI^I)Y%cq}yddTaS@&4#EBweJlfAYeOGzkiqB`kUT@+g7A%eLg~?kJJQ zPo>?b86~_>oP<+Sc?!ZS(sMRW!{aB@fsHW&VR=qU>8qGl{9h}kxdf0ReSt)HdXvAG zU%&qp^vUyXzPfqoH@%lJ*m7Do{aJ6_I!x5GTC179`E>T1J`fe@&&!nn8gpD;zn?1o z{q!b~%w`ETeXTy3A*zuAgM}1WVQ_hRK*HypRHqf7NQRKX5+NeNZiFcK5p+qBk?&{t z)S1l6-kGL^WHK3#XH|@-ei10@byAM$7iG}TzUhFsxmcSOk}Ox-Nfwl3l9j91R>siY zoDyZ1OoQSi6Xk+rmuNd^QG%8wpztM7rUL{MEZY6VxBCNHz6W~kssO(?Zv zD8iOymO=+!Z0e0DvvQV#iYYMDibN~W22ixZKYGi`UBMJrj#144JJE_dPzD{`2n@q! z1iv-|!GdA}5EWwv#HtyPQP+Jl>YB`Uoivm7c4;j*oX!}XtpH>hm8X%;sQ${;rdZQWLv@SDBTS1Pgn7p+FfoHB?hbyOp z&O}4Zp;=)@ECRW8(-t-uM7?=pV>%d%_?vlUkp3hKss4Nr8hYIr>SlmG1^o2^B+NmH z$ODFy0R#MMTG){zO=m(I02SPp%c(!u&cs->(<7bTiE^O>COm)C!A?$?)r7irf#Cw0KL_IaB;zGmM`0{V6`wfB}9D~(v9{^ zkWoBHk5VO!<)i`Kaf@|64Pe2jwG;E7+>8d_Zv?q%_X$S`yK}XF1{Xnw=~~Gdn(n05 zP8N0+9wA1;Vh5!g8rMD0*Hnj#H7rYruWb6E)SEu^hsJ+n({DTNcby_x>P}$Aq&n%X zoRSkLQ*`bKgaS0CIJ*t>)&c>sv~$=LH*K3c<`a@GTi$QYiDUjUGeHrdQ(AH;8P0q> zYPE&TKwT*_6jJ#;WEaY9E;W$FxXrxWiFt`F4`xT~BVgwOxCBvUi>R_i)P|g(B|O?h z^&<;(C}ILeVjG3{4gJgw*C^ARM}(@iR{v?%RRS~|uYXKeOo`FwttNUW~duOFKknje>&7U#-&;zp(rc@urPkr!yCvK(26?2AT z!`vZkLgVwBr>I);oKWcRhYrLUN{lM!`As@y^zUR)4Zn$|^^}5kMl=rs*6fAZP!n7( zJYkGW4%H5}xXv8|dRDf0y=05SMoYH%6b&@eH#^XbjuQ!)F!pYOrgb+FO0cF!hq{8$ zRnWWco2ZVFL2XU}BaxiqXDw{-q#cjFg&p6^c04XQh?*9N2}lgo>ta=^jvfa3R7(|W zTz5+=Lu-BJ3$r3fD*C1aX1MK6wArfyb4O_m6SvZssX-*S6A9>9$RPuI=^AXMEXBF@ zYX3%hA)*^F`hY;pqD;@bp!}3ZmgOgJq)+|+R&hmTbO~*&g%mfVD5qqEG%j{jesdK^ zt%Fb`h^i74j%pxW1LgGa*5vZOMhXy$!%VONE;gT)9aSdTPO6CM&e>lgSr9_i^GLQj zmt^TMlPo_Ynh%o2gcJ8YN!A(EG?QeBzaY9K&_BKVh)h`~S>_p?A<6bL$yOI4S^d?P zWDPn5InPP9pGg+qFb~JUX^{1TWI+lfTV;~PoRnm1W}=>l5PD+2l4Rw0NEXgw##)jM zzrJqgDNhIZ+6UzJlYiuNXOEzk6uib_$+2~S-jV( zH@dR9PP`NAxwA2dwL+;}i;h9GE54ihJkgG2xGy`JJBaogf$oTQmhP2gxLayOm4*Y^ zdV6ceH9Fo7{O!r{R<2AjyB>>a4LyI3m4;A>-=qdzpzRQlLuXPGG;u^%*^ z`Li&dF{vUvyMysuX5$%o9IGmrL=J8(oUjO#0eOIe?Hzq(KUW0shH@HYS%>+|#xt^? zyUuv#4&zyj!T>$Ov^AhDS0&E1q0uAJgxVki8i+)?mNqP%E^M=DG)fm$iwJ0nO0dx7~vVuq>jFRjEgv_W>E8-#4%XNe&^1lCQ04E4sG*1j_pu2~pZ+gvl;-DrQ_ zD%fs4vm4gy03a~92=eV-xNgyKxNgz#HrMU^hMCAb1OUgQWDyJ6V@^7PV-y!6I3BSc zaAAUD0=5%eMk{Kec?D^C3Q)>r``DmjcIm3~Tsk!H+^KU|b{Q7(F#OzX zAwycB0I>fwzL0x)JdRGTN0goK)Zv*U;HqQDw^Hd8Ze3w4GTb_U!mUGibT+cD7-Yb? zkKXACnr=H3bM|Y8G^dSh|4>|pCM)=OqeJpI#|;f0(z4NHf{0DAUpYGd*|l=Oje3Jf zOLa{B+?!#zt8MVuL)-YCF*^cV*3ey?D;c@4bN;C($Lr|R#FC2P0sP+d2;80+oOIOS`J~}Dv19qR7*6xO||UMFtirhSe>Y9 zX-TgmG+^JE&@k{Wq*_`+dp4>iC@=bW2FeT7q7&>QYeYnHP$nF9!#w}WcwC=Z#@QXcK^NO_dEs^whDgDSg8*_i@b z)gp<6YH6u*r`NO>vTD(8Xk#y=S8NLxYN)niIIEVq{8jeBvxEy#KnrC;PYiU;4i~D0 zj#|}1Yze6ZIc--hQL;_7M9D(6;JLGMAF8E7wHVVtL09Lf7Tgj;FU9$)48CwTFCGGS2Q%so>ABl*)P@1r5=*gGJ6oD|ygU zDECRAF~Y~6wT%f&kA_VVRZOK}WtVKcSp&8dF=0g8btMQNUso!0beYsq?Y}b+Ot0x( zRZdLI=%szeJR+V?m|iNzO72bjp(&+;r^}mICpFT}Bo;4@Yck!)@}OwSl=jY~4}4;) zI9$*i+HUeQc6TqQm^haFAG$xw8bOh_aMt5G(AabZ|dc7kc0PI#ZBugjAQM! zB&snEuYcU)7zYvb<#Awe#W*UMo!c8YnXY3D6UqZbqZVrsKpIcJ zVO9Y{;A?556$4cDU+mEffywVFj`L%0EYo`@h;RC%fe zy_-fQnaS5lQ?W2ZH4z#?c|wZ-(X2vi>eM>D2}*dQ{1XuR?noGSn#IYzB-2u%(S>Ks z`v8@n3CT%x?8LB&mhG|l>Cxpb8P4H}1HoQz)(l&(nRVFoC%dDCF=W`gqS`y%6EwCm zk^S*Un?3KFPMST(o4emG6h@OJ9)YAVL$zzjnC@iURB;*Rwy0P72w0`H zBjQ>9hZFfR3?iM?spTg`FxVjh6Mph~!B2f=Vo5FxnJeW&Kln*Tudb+%=%&1pkAH6^2hH#>&#jM{t~yZq9K- z>ST@sp7S|wB$X|39CuW6!o%puKs1Z!_MGFidE(t?$8mO^S*`D)HTZ8b9R>am&GFAP zW@ba4NiJxUb8sAlLvsfpK7RInc9h4PdmSW1CTTL)SJbh-6+*qrL=8n~${yQ181e?H zx*&sf{E~ll1~Ao970E-|z1V1L$O&yvFp;XwU3FELEJ7%I?mxR#O#Zs!=}=LmKl-~HVIE*NUMQ~Z!)m@OivAPI5u-!Eu zRu|@k8cM~~lo$}1NFmp~!KT5yX^ksqNPnu_}6f7rSD0*HUd6ErFp0B;8zPn5xW3tlosd6`1e&j9O ze4Ia%TWOg_uc%*sP5q5L{TPPC)zz!G0*SBX=j>e;yc%n>yrv@1p-Oxw*x`znuC8v6 z%a0da-YwFYME*Vz&;Zlqe-Prc@b&fUz1-8;@|yb93wWrM&c102!;YQ;9+E?@DvIk0 zO}+pfK$uNPLV6|y zJ~xQw^g&)tgUQ`xE?|kWdj|t_S|Y(=G8;j1s=0$uRh;S-?5tRSftc2Kj>#!*?kN#} z<9Dx+V6D`LWTvJB7Y)cmVsb&22^l03Q+aBWLGTvk)n`_-faT^6B3aWqUgyr&U2mzT zNG9?=jSCuuTq?p`H;QIMhqDNx@z}T!`o67A2X zPMSs?aX?-H$if-PRSCI1+p6`muSy~`!W>xJ?lnolNUrkQ1EQ+=Z}>*!)CnYpbVmC1P|FTl^va6JV)9Rk)Ds8dubWw7NtG`O3m(I0~v4$<}{o`+`d4shl^m!xC)Mot6-kbfwd=Z8`smNF|%_ z%61c8=_Wi{lEP;ZEgKP@%qA@kaTXPIa$6ANqTk-h_G+`seMidOydInzYx#I5E?-ku z>zyB$rY6!EVAG^Ke{w=uxN4H0p+KTq5<2*d8;U2BMp(NQU~TFyjY$zp%kI%Tr_na` zPAAZ)Y))nhAke*#m~#^y*mN7oZ=z|#^H5dWG=oHjbO54BJhOdEiQsSt%j5!%fAMz(%Y>FR~}1DdWnbg*_aV%Twfg(~ybHu&$d9 zkkv}tej8k-E*p2aWjTsJi;M@T1T{7@PvG3;sQx@%IN*0<8pw+EJ>J)tB z4TtMW^fK?{(=()f{VjamK>qow1Z_$OdT}*!byjJdcgTLoZxBO4o*Ee2XZtxoE{j!yn4Ip}IH#7i)4bA6Gogj;(=0vjOh<4EdgapD$s9&4Xs45>90g8^jSrDAYIYpFF3*pqXmBkN?rIoVZUK(bhj$;2ljTAhS4J zjJTF2C>cnr@W6-|$>?-=yX#8!5D#l{%kt z@65ueV`Ty1o_eR#r~lbj;q<1-DTt#oTY6r!?-Zjd8O^6{hQ$dRc&r#phbv%o74$)G zAkQRHej@pd?fRF&8m<&rf&J3fNf7ydsFGhJ{*%-3(5kyB*p>F>0&1u7hV?9ze#ma-!OAq~S_He}R{D#ZL&94j>{zhXSD_S#W z#TfuDmh7(11dJRqQ4lsf_+U*3bk5C>N}oWQ4|T0kw?oZ^LtssO0Pw-j4mHDk3H#rg zu#Gh}3HTypy0V})p`P4Ngg|p`L?sBD%C2wD1o>AfaGq}n)C(lr5eZU!4yl%NShLfA%G-8jw zS8g0CXe0nh{f#RM8gc1xkBzKHBkNY7k=@bAo(-m!FeI~-CkTde*S4*}18uv9it_3r z8oi?EUsKR~Q(slAUstT>db^JntOGfLyv+}5I<&}6x7fH%WyU#!*#r_h5{=<7UD(#K z74SL(j^WPDFaxfIe5ru%4#0P}fUgJOm(q!i;K~sbR$w-z!=(=Wb z`BfcPU>qVA?vY*qq8PGwNe~WNY9y-R-#AZmcNc(i2BbT?fN=l>m>_M(pc^d{dU*jt z6rx^XQVTOQvMy0pjR@u+#!%qWBkmVdmA1Iz56d?gwI`TU%;8hh5oqbB&v1Ok5b*(? z!V7U7x;nKnU9rGsYcn7CXrZ>I$uF(mM83uomhvAuD=*_&2w^Os= zDblhq9YO;^aD83HlAUDJptRHJ={J35h&i8sH&~DDy;dcMoW;A)#y~eh5?q<(8Nc3^D5!ji{?eG(T=s$izC51K!)p1(8=ccum&`kst7d> zu|T%HWARKvEI~e|*PIBsYKf4mmI%3OiIAESA+Sq?WtP2}2$vcGF@?Ui2%HB7>hU}G zR)aIOX&E1dmBPY(Vhb~uKh7+OAw*eJ$F~0i6~#*-oO`JTf8scJm6SH=9_o@=x^sc`H_=nPy-;H7M zofcs8X^55llw(@BAHSRxYY=h<*l^DV>E5^V&aTOGE(0&S*vhWZt1u=zFcO8986F?fhmt;bg7fa;PFXdV_vPBAj^m-jx?5P&L)CY(4hte_*u(w z$34ShD&H1N&(Ht+|M1C2-}TeKnZ9~IaS5zYhrm{gorP;u|IvmnMy z+=Gs|(|u0_FDc)>%trydCl`j*IOhhai1?rKjqn~*neiosA&O0vm|Y}GhyfgTaUR1E zIC(W@INeQ0kaDc`j*pk$Hd}i+ew3xS7wyB@dNXd;zj{{fcY${u#1fi?;{-CtgUV(N zRsi8Gg|zadf=Jip&8NPLfw7qx6sEK9;`;9Y5$xT{lNfS~g7z)9VM7NI=3mZPS)$L$ zyJ(e20V-D3mdDf~+~nnRTm;swAh$dP2lIq9{Ae|~e(BX-u8zc&3+7kGRm0UGDLefn z0tZs2*|^L?^Sun&LMF@0T=;-jEz2fvoRK1~qF4nDT@#9!mQB198)=RfFANnEy|sco zQrd=?)16Fw5pW(-gL53p2PL^Fxn*$KxuxSy6|^k~b}QVYb0J+BFGfO(h`&*cq8*Ts zOSi>hXgaXnfXcXv3bF?lU!H6Rv?*2cYZ^j1d0PhXIOg?BfHP~57js2O=_~oU=SR2b z1!hh!#6Bh8U~-2OUa|P5*FlXsVdQPH?G>$lsL+H;aid_il!5>l^eN zkTCH~YN~IrItSRa)4>e1x<)co*RM5W(eSH+T=Y)$e9%8XxRCaYCIZ?ig20 zobccEgDw0F`CPy!3&1gN4Lk+lL>d=>yIP%}Z38@uO+(Ai9&irHSQr`sPBstd7<&VO z!)<4!WctjOPj=eCRX;skY&cS}-;VD?^YJZ)4pBx5YfRCLbt-py^PV5;X4cBizG#zg z`C)Ef49gPMxS(bu}w$;@1pLS>8{#>&X$j zOlwiV>Pu7{rb|wxvuB?wPS`qPp?xPehH|ABSFP|KCVyTq!~IS<9*QRp2Oln0a~v>y zF|;8^s!%WFN7;DXR>Kd`t=LmeG)tTP*o)VDiik*6!!XLV43*|ugQ)f4GcSp1R9tNk z85oP~m1#ij+MW``B0lzQpdvL&m^4Kp%0=^V4+bwuo?TQ9p?UC=SN(>Z-snUo!&QZd>j{B>Y*c3&X+L(J zqU9=4oK}eu=RRi0H~#gB0It`dr&(9d7~mv~##)>y(ksS=qhDNn1Ot7nHWMJ2H$O%I zMNG5DC~)I1OM0+p4NF~?j8JlOws)gpN}Or_Hls~8?_!G%o85#H0nhUiSLcC1(8}y! z9z6008t$jj?aUnL%7X@7izzfahr7+31>kfzlg?4JVL5}(?Um`Fd3){Dl}qy`qlmF- zsDKDpvUTc`YLfk|Exj-7kcxDe=`gr=hSdg?S7|$ej{)+%KEw|*z>zHez$H`te6;Nm ze#mtH5`M^~BaagLnD%K$#{`~rSn25?O|eaQ1gP~*hy=903Az&Bq({AS1NQ_IHM=L! zmktWEbRV%Hk~$7%lfWZaDQw-7YdBabJfSwNE_Z-&WAGNI1Pseo+Koh|Gxg3^CkL6D z5R-ZrdL=p*RYR@MCYb_kFW<=?{jPt}*^2Im-_v z(U@Ki_u#FpO}?-?mjBuCKHBByz${iAj9${}ba&Igs{A4scIZcs^5wl_$KQOmJdT(} zJno-ea{TAte73r)xy1V`{PP!1?mzyaKmPtdF7BFLI;HrEdh&9{CBC>GEec&BGw()Y z_!2I!Di2Qg04>PF+YbE9a!%r|W{v3lq`8!CT-6~pvEQX8GAI`2dnvrPZK;Xc3AS@p zITG>hawChOdfAvL_$85{NLo3CaU>RXt}4lHG<>^ngM9@szcMpV4=Wwl6=hqUa_7vc z8l?yDiFFW08XoXc4+_S-;TeFb;$6FpHYX=}ycY-dPUb<@7o zvo6vLTgvLKYt!s6j=3`BByFDRmD`zB@R?U z#h=l}!NI}VXorTfq;*f$4f*gPX7qX9!XnaOqGeFbD@)^>{ltQK-n z)L@5%m&FQRDy1G`89MKDp!38JN-CVs%xi`8hg-4~4^f;#Q)qWo%SD@z$VfBZJd7&2 z>W1;OtPo>B;8}~vwAc>#-SPH3vCC?eOq-K_!yJJ2F{CrMo|r>$^)$*0XU38Pn+-eZT@Im#^jm|7dd5n(vg? zBZ-ik2fg9_bfbtjN|anCYBC1;y&*PAZ&BpUUAH8}nCYRp-$oZa(gpBvpxbLiuF;GWzRCO0P94#eT z`zYi2{U9oGQW@mF3rwLdMV`fASOo^P55&x~aG~;d(l!y#BFyD_}UbMs(Y z53gNPf%W=P%>_1kf!O1ObY5hkZP1lC{1|Xv;brLUf*V)uf*V)uf}7$7sl(K};FgE# z$hJ2^SGBUnl_@aN?=a$F!tC*fUmdh)aaIl&4YhVvMTtmd1FC>!%ep)r9IPS1A}8 z4(WbaC|$4TG-mN8@ZRWL)w?4=01)oDWsWk0xlt7P&JV_)?0cvcYe3A;^8+Gl9+=_s zlHIZ&BU8E%7Z#Iu~C8DFI10Eg3Q4{p|R&_Rm#I1zfdMz*S2H)RYP^BBcU_4#9^^1xt-!8*8jlO~ug) z00I`C#+_%LNfiE)D&4VWU^(M%Rz&=zo_trCeao2R-b@wqEZ@N5Gm8e?O&BCzayUPb z+mtk~=#!X2Gw)hMBFFgfGG)H#8ng^HV;DhPjEH4aiEEUOG<;s;9O9xJc0$m$1jWdj zwdkc`Np8Yi1>$Wq68DZtjDSQ?*G!$FER61ugo5CA;t(mG5Xnz40ny$TryUavJNR)9 zVx+~nZ~_5qr02o8U;%{eV!+zQ4uDtY93gc81G*!!NLvW#Z@FOs+iV6my138(9D_?M zKx8Z9pBb0^_LDmce}u6w{x#*UL;X?vUs>}Zr0!<yy48pORcP4@zcJFjTxp$;f&W6GGAgFJQn1FO_aFk>ecC&qqN zM6E{#%7)4kE5|j*iuU6VAy*ABa~0tZ)Hc;|LpA+LPfZW~b1-nYaLZl8d8Kh&#DI6x zd*=XA3+FjLU?fVM4$f}^0Bi!}#_4j{jyqW&@alZLizr)QB?8`Sl^nKjy%GY$%?m4A|-58HnfqA&9kPg*r!qU9RI3`f0eot ze@x^n9}KaSrF*p4rPXXM@3vCn^pukNv#oS3O8Lsswo-bdE}w(hR=OIcd(SB~l2M-g zmc-s4c6Gr9nh)kG5?Pp4=|S>emon(mKj5C}XHbl>zM>qMn@38LOQ5?9^%<2a(&|x2 z6C@lhR^{6Nat9Cjmn;~(7qo@Xx9uiJMaJ(70|hpNAECY~apW()USnE3$?yhFzl}qu zHY0DYmLn?|3EQ8EnDw_1Ke6CNqbKNr1ErVuvnL(;ryD9Sy`UH z_!71aqzduv%*b1WmGx!`2J7r)9%TE4SI8dsp@fQwAp#3$OSkl(`B}UeIE0WH^Hk6f zY~0@zR%X#jFXKxF@_0c%^R4}IRr`X45bO)yCctZ7j>sGW3XIYt;I6I?LWKN~OXMB< z{QMbZaxwrj$tw?4>n#$<1)vBh(i^b@-Hv%6M9M@*>5e#xE{sK((;(yl4IuQM*G+3s zK?4yWh>WXtftn>VF^;gBmb4Mco`edr>!jvxb1`yMxk!B@7#$QZjDXJ$K;Tv^0m1Ap zfKc+GYjNhyTLQ+w4iFrWbpvDEgf%R}Jc!C6vP>%?+!4Zx)|?62#dWZP7gvSVTAyl& zbgbd4rYHSyPQ#_RfI?(qyEpxhpNNaJcv!SZ)kSlVUo>YzR@)qx(HvTl^gWx46%JN= zol<2}PFo^&WwcyEF#Jmc;#w;)kSr-Ski3KjmU)cX)S=B;g~@Cprjb9}W>TH1Vr9TJ zfj@!~kBxBXAVX3JSmElVQp~p-C1aUt=(=By1mVp=e866{k`z5R+9aq((TKcd>>myi zwHe2Uyx_vUrMQf6MBWh%Bd?hJU2Y-)@J)KmU&6G&KIpmdtnW}=tE#A z;3Ch47kM_?gg3BC6`AM&vEVv8d{tu9t*~R1G4kCN_)){x7=(24_In@rXmJN#v$@%u zIA&+=IKikR*tp}vPSt?Q@Y@x9pLSh4$3De0Q-WF>)yJ40P+p5o2uKu9Gm1ktG4;ke z?*0{CepMkU0NkpyNK`CKAW}0T`WDkjoIxUB9u0W`e5517O5qjaJW|vxn_v?XzJNWO z(c~%@UL*6zz!PMZo<}_cL^S&U99KHP4kwo z=aW~)ONu>izEF~Rv)5&L+SgblNlLenIf_15RLSwYXt`1EBXZ41x_C2vV-@%(bI^@Q zEE*mdG!<4_^rJ(u(3tT+w}Z*o&mjgEGVnPV%DbyBHV%YFn?C7^TTY++5IK~STbaV2 zf7@1(o|m3_2lwA;%=6-dVGaPwfOn3E&WGg)LiEh4O$jPH*3OL6CK@Z~iK$wkQMzv9 zrbDX`2V(rniU@T+!Y7H9F2~S}q2vy19Ix{l)(bY$bF#Yo@{P17U%lu14d$xfD7X^v zkY6lfU7N2UQ4=*4Y@}y$RkKQ(b!3*LAulNfy9mOAv%#Joq6)ZCfHkW*8gDnl5aiEk z*g(e8Cb1_M+GDC6f(6gaCk5VR6zH!O%cV4$dW}YgvoYQr6!I*HK2tP zSzco2S5AT9+~mC&1Oe$z`6}<9A^R&^m2KPQh1)Jao3>F2@A*VHBk>!)6{3d0eECKW zxYrs&Oi6lY>0G?04 z>=H!$iqk-^aaK;Q4qN(p>QV$@Hg1`#SgLXL42kT586J`G2@c(6xdo8o{P~9cxy^_$ zHc?O;Fi#}Y0IEa-2!p0wbYZhn(10IN+P3I2&`yK++0f5git$I~NgV>3Te+Q;9%hAs z#!c>0IkQ7|-NMQ_-7OYY>ac~fWVa32eX&wQ$VWrxUA;Im0+_I2B*ZCl67e!!3lixY zFoBa%(?lwm20fX)8j-iE8Aq`Ob-H&w|)UP zu?pyk4zja1)0(%6F|W}K+p=3>w9;Aut%0x-27+Wvjch!$Pq5AI;HZh#5iOA@rk;k2 zf_X@X2Gc4GlwQ|I28~jn)oek93Lz#htYA&bz(V&Pp3-^4Ldz`=%a<4q1|QAPR)ocv zVLy1_3`dVNPebe=n$^=BeT*;JjGT9;1JI2&Ux0#8w;#imk2557J^4qB~A96~?yuo^@!C(cJnAAx^i+S_TFU zt+=|bhcLV`f0ws(VcmSzc41w^7_lHzbd11ZA5y{Wtjm%0*taIbED10TBrV$Poa_7YM@C&m&a6xT=e4gwqC@|TeT=Sa3%} z^M^49RN(^7$C23D){X<@a$0TOWK)f|dUTrKI|BDhl(ZDouJ`lg0-E>|E|VJ5X-Dji&}4O zbYC_=R)n{UI7AlBhFkb~u`b^UknO(^z`5~1j$YPXOrLplOGQbhHVu(q3YgNxLV zhPISjHAxUPmME4G+8~pMRDvLca9q;CMv;icuw_nz$s!V#dJfuxiVDSiG5*+q zQ!8=|CGRyowmie>CtAxI7on~O_-9cPsWXl7f15#7nJH0ub$N9xeYAbYW0EPooG4rF zpkSZJwugM9jJn%M-i21(sE8QV`Mt6;niq}Z4#m;4I7FKfy^V%5Tng#Pi3maADwuNH zv$oNFp;t8t@zjp9o6zlq1V1`Q0c96!8pz9|#ev)?Ax+q?3{y=0f9$TUB0WDnbYJJP z8vV)*u!Q1h*roh_$E8r|tW2YJ=>gv{wMYDG+L@nsIrGTKLwq0mYQ3n$^g%P}!S+4vAjDZNXdHWbC_iF9q*svvPe+e%&D5a_Nv`FZaEGC|X#j%- zuA`YZYB9Y)^dFZm$RSy|SB7BgG=R{G!oX1!Mr1kz)xwDE5n>0k7!jtag#w(X1)wu7 zoTQ8iYqV6EC#nj>Lg9v#^R!g<=c?t$e%xt^b935Rysw+Z$r+ky;}lg6QoO$nQtZ@H zo?yjtJHwGI{O#@Z{%GBv1=BGT)!N0(Y<|O^;h*SVNTD^7m|z6cqDE3+Fr5*Q=Z1HQ zaIzstNyOq1FI$mZlZeL}(4@5}MWG>$AoVK6@kmtU1%yTvVWUPZv^^3hib%SNBBO4p zA4NC@QKWWCgD4_{Es97*t`(C)l-Gr|%yl;m52|G`rgB^mYtgvic|}Y1zK++7yakpd zUPi~G)(q~`Kk#=jVH z)<>2zOO~T3B~Xn3yRgB;EHQMyG2q=!N#!=g4JH7%9!+|OMNruY*ep(5e3{dO5ffQ}}t5}eatd_ls*K^k%1d2c7vupKqV=wFT2s3zi^PapxM!4s-A0mK9$ zOG-iP&=FI8w;w_mg57uO%PGLMUptoD`73 zo8g?M2lDlF7tOF>Q{j{l7if01zNwMM*>1^WjbSsJZ0v?W8r4;k8zqQ9NWNJEI!=9N zt>Ohp28!)RO%}=AB)+B_^-^C~GnP!zzplBF9~pX*u5@5c;ui z2xGv!at>}zLdF?z)b7=QllxsL!{AdN47hAS2@nq8h+5I_J^^wR zJpYAj!Wq4;y9j5f`F(0QV?cf9*7${gmNy9WCtr=|lMf9#M-V%zM0285wbdCOxrN0h zf#ux=y18gI$SziZu(ed1xJ;qCk=JCl1spjL+aMCqY~v>@R)mpz(^yhUkj7`m$b?u- zL5^|R+NB1)D@K!V(fI^o^FtR(5Ryp3RJV_@&E^$7eK^-pH+d+z9!i;3+VX~sGY;R= zeGGXhnc&SC!levboi`+#I=>N>9214w9;|Q2V^Rv{6~DlyqXrxBe7raR__Y`AbYCX( z*Y?h@_RX&jbWQO>??l>na>g{)k;N<-Sgr z-;^;w{=cfSR8&7jM01F5#M}xF(Gll~RQ9|#61mUb$SxrX2!XE+dtE+FOjk|uy9=?&Q zf6MO+0By(?>8q<-Wws%aDOioYhE)u9=-QGyQM!9}Df*OKJR0GO96U|sPwIO>&quaLi7>0V#UuV1nlgfIH9E50!nA523><_+V((Q8v7 zh<3#S2*2!)FPS@1G)+l@5IN|8rzbu5+B?z@ANLNMfxE%!`C}FxvIU9zjikyZ{o-w; zRIa}jZ!>Yqtfl6)O}8~T@2>+OH*v{nBw%_fx8k>_AW+PGl(sAZ``#0RW+({+xX{5ENI0V<|Tx=yo+!KCO@a8?! z?8O`Zvx>l5LgiM+myraRJ0L7a1F15H5)M(&2!MP))*mu=ZqYN%#@na_UVcEw!^51`IXJO!VjgeqWR+? z$q)Zy44~W8qloXgA>U%rQ;zFVBhvuw?lU<*)+h^EOGv9NVl|PM*cwitF02)X zMBAhyrxAx~m?OaeHLcQvzp$k>{-7{KP5^i^B{jm_E2+E#vjuxN1Ht`?@qei1PF!n> zx0*!G&LUl!aw^@-Q#%7_0Gmb5uW`-U=d1xJX9(+KmBp+Q8_%nxfz!JEBo9`=-n?Ca zmB{u(Jbh@V=2JW_VUE&WKTfi285>@J`e?C6;C8;O39j@UmJQst(txSL-h79`#m8~Ok_Kf%VZV`=&Vj9KLR8<8K z*n3$j`m+5d)1iOqOuVbv~`90D#Hm&^;tn5$VhaZfvNIb;s zjAhEG2uVRoEM{ygO^^8cIS+97V@YpM0c(l4IF=)N`(vx~{QM5sU4_YKMAMVT*~R-9 zRizE22_G8NRPa2fKL>euvJ++O`)&L!5SDm6t_xC5`lxu~>TuB%=-M)8T@Iu;_wv=D|S;VIwSp7oEh) zoVt^rpMw{@5K%G4sbh^1DKZ5|q2>aBZ7<_8V+ve`{jruREr-%qVi;g6b}aKg+Wo5+ zjkitK$Tc3ASjJlwG#j!~&7X?#R@Jd9Ytypp7w0XJ$M5-#;%gy;V(M4ZLv7--W7Fd< zZPHRYY;qYsK|u zz7zNJzjM{sqsWV}xkvA#yH6C6gG(Do$v%nXq(D;6M9q8bU9e@$4JxkY6q%(Kpo48N zDj8}Fk9ij^%QF`$D8A9G#+N|@1?h|Na3%-1jWpkfs8Uv}-7eD|Te;@hHbUEH4K$=Tg&plU(nCyMyA7mFk8p!j4G5_T9x6sJ!aln<^}cC` zydm7zSlmNVVArE4`pg!H<1@tR(O;xjeZ9O1lhV8aks2UwZDvkAAgQ`5JhJc-xl)DW zD5|kNuK|sHB|neRn1a|D|i(I6UdT<$~u?@V(0gSW@Xd%LUJ+;QN;g)+o4txnP}wA6hOr zNWpuT3%)2FNA3K-+o(W!)-4R&dUIxG3?RsB2rAV#XSgf zvjtzGHCxQ=&1OrKh1tS0Y$I3#4e7zHv=n9wSFPECgQnTy%hKePz^(^^angbs=N~Lt zC-@+(bwZ{X+6`Hmvk~jgH2L*vZkKOc*cZ12(r#B>R-O(8)x(l5w4$Er9RXcTuIG~M z*~%Q6U?abe%T>z~ALlgOVE4p04$y>WtHjAKT$x}Xdr{ZVV22PmAv=Qfa6jQr76la0 zxPZZ@bk!bwgYh8GJ@k&Q1Cpr`KukLuVvF>i_oMV6irgz{B_HVSVPoDCc^sF+mGFe+ zrwpR|*79MXydFbFP5dg|x3twhDC1GyzdaQ@9XkJ^-aASthe!~m*xXesOnWG-R*t%# zsSjy|IJ2wtrphB9jXEg#vA6+v( zigk24b%i>lxM7Ey4hSaD{i1ES$C2BYCbE*>pk25+i=z?0eJvx-G{qcTigdCn-P+H7=9rBaCVMRib3!ue!?MCX!at8KBh5Y;*k~6#WLj6 zjK>+k;1D##nt*^*v!^Y!1;RJL{x(6+Mte?{gNpGVmh)yJe1OvXQDp*?!WTpW!JfKo zFUu)KnM1J>x0TXePBa2^u9XrV*JkuNQ;<{y9kneHYKr6{eE&^0i9$0z$jL>>?m}M3 ztj8L_;=HzWc9fGTSyGgfz>Oa+_eYLm)j)KACN6%Gj?q@oZO1XA6R1qNU)^@Cn+0pA=VLS%?mTU z6BP@C>qhKCLKKJ%vQ!;wchBB*gY5*FGLKqC4aE_hT!E8E3+0!4k~pY8X%GOG4yo5q1hA zr#CCx5##Md_gW|mYJ!8P7oJh*G)d?n1zT?u+J-9-15R6hao~o)9U%N-mXjJ`5~sr{ zwA)-#=ai#Guc;f#JXyNc{cLawehyRr1w8u{Nm2P+w%F&St~~@knQN|Gd&v4%9+Nz- z-AH$J=UKhC$|gzHp**Cawa%SG3F<^b4^H5!bYL?DoExZV!6r++YsB(q7SmNluns2@L z-zTdcst)mfbwzb0kIaC4>hib5Z}Tiuy{0K8 zLL7aIDgbLs1t$H_+qYOSpn;Ei@oE0JxA6O_d1`Bj`Nkkpb*w&C8GMVSMerFYq&qzD zkda-;-_ZU<)&swL`E)BfVOquMaik34_AO%nUEII7i1EX&oB?B^Tm<5o3YNf2?}#!` zic9RdkqXYckunhqP%bfCs%gM1nFPWAB7$U@R+v1KP0%hvF-CFQ<^?4bZ>M3J{`mjw z@j;$g_RD%Oy46i#8m9fMNFl#@(mGl1Q_z?Hag%jjgbBD)QpHqj9k5^I?NFpuyWJf# z&Q~e0exnshG*0Q)s!=)tCuJC-*m}VXKrQ1ytOgCVa9N3<&G~K-e7`tRYzu#QI2rnZfq(YVwLV-OnmHn&v|w6lF=548AKPL z4F;oN^geCGSp29FCdS3b_f%Q*Luw(?RGVnWY^f{M_NGUEcZ-2S;!6&DxMwjCxl=(I zLf`6-?oeGzD+EnsG#o9yfN5aV#H+GAA=BxdAA#MjQ3dXsW)0n{*Bi1cSPDArM-+!H zwNk141rAB8g@}V!LU1=tF}vFUcKq@1UmDRo=V5jzTa5ghGABE<%20e{Xc-}r{r~@J zaq=<-qD~wC*&pgx{FgJ-=XFEQG%s24i|^e>*~J9hlZ$>qyX}Sf*ebUdM)v#sLwcB-?Pf?!P}cMsw-<)1k|l<)W4;PN1c6zhmPw=P(n!5mRWpK0r-23!)@j+XVT*hwWX{7dEV9O;_-PwuyIN`C`1qmQOAljS@5Xq3jtsg($N>)&TwE+%725o?&mty8Dy0@*O#SD^GhVoCS$&*=yw(E6X*2p<|%D~r#aGL6}x z8cNzTIQn3A#Tzr`G{hJGn!36(-$6I|CzHH1Crzk$&Pa7GiY{T|nXUj#)67teC#!`t|kk+~ehWY>wCY zzknB)N>5i~ICzQA$+N(@F=CU<$8cEW>X7br6VTS_Nj@;@g#EQjyat*jfJ8hGN6YJva{2nnLfMghi zFha58-!GTLR&3Km^E*iqyfS=+Mn5ljmECyAwLR6x;8i|(e;&T_!v}C~mG?M3WB95+ z4`0bx=Y+5FIgtpRdHAZ!dClLVbEhWAP=7cF$b+oq%F$Y&P?yN-M&&M~kcY zF=5OIfmc^?)c~vn2!U4|!Bw%^2I4Qe9G3nKkO!>e3^pr1fE}6+v#O`9L`GZ}c;Tvr zsaw$!hUn4={jZmFO1Bbf6)Ddl$}mQeyg|GR6A+?^fR%?CFQir#QcL;9D~u+USd<@# zB#L=`0ycANG1nivF)!u{=&(ov12RVu;)H=PMxNMi6vZhB`6@rshFpG)+Qs-^mfK_g z)NuJFEW5qwUmL{nV)_rc0kaO$U5{C$ zm3X+oVlj;*6*qXd&Jw?L7YH|4$fg#7&@m8T%4hIibl_(z4IA5&aik!h8}*F z49#aSpk^7Gb>xFQ!dYa&k37KlI7lYPjfwMp7e zL#Rx{e-Q=OL<(!tndOoS+PGYCH007YiQcr#nRvQNNk;ez#?<#WFTyVKgNBk$Ki39h;pD zUPLwj_@pIR*E8d!Pp)zXZ?Ba$7!0QD)Uvs|kR27GF_fs|k6p+%q%tIfSAjG|@lY-J zC|fnob>#9YD9S|!Z)}&#YKj+j@&U6QR%hk#pLTHV7VFQ~;QqHVXS8ina0P>2Wnb<6if~a;gPT6k6nJ>uQ;EwY;GM>S%G7Q?p1ejYd4H7PEJ^5U^ z4GZNb987f#JTGbEP7_nAe+^Os)?gEEXqOSHZ{2;vWr&4^vc+!xnQ}Y>C3Ffxc2>3W z($W**ovT_+6X!`~?ff#fP|d~o=UR!tnnIV+4=z2(ke|_JQ+uji*fu4HzV!6yk?H27 zSuH2)P~lLqGCz}+o3(rbvG_sdK0_ghS%640bj0`$oHWQ8M!;Jq85<$>#VyWw%HVu5*xvX$d{RAE+A= zXmZSi)w=CEFgy~{`Dl<{&(ndX#XO@9Jb$a9LK&rIZ{zR25On{k0efdF_)O&&Ya(n~ zfMO`)-1K~Q6_B3ayGVLI(?y>9tVqw8Sx@8COhshY!?xVufZTH~G|b4fN*N-UvxA7` zLiY}d7J~)_XH)4Dv)oFd+W<@|BlA9DvSp6R z!X++a8>6AR@d6TNv(L?=C`EXLRks`-%^}<@l|S4fse_89O zKuw%$z*#$pxt_o;;#{bJ^Wt2E(YK~*zj6$Oydbo^8b?adI78Kj($1ly_yjTa;!DT6 z#66b+rfhXb{2fO)$MJz29w=O)R({FPC#3s7u_fGb#KatQx)xsk(C{cW;Iydb%uKG* z{VYY0T2c}05KLvF8YTq%WLG}o5)k-4G3)Y(TkPSF6qA2U{5^y;-y~vpkm8g_$S5BF za(*1}gkqs{MG3^*EM5p8#jhDC~0-Nqfoy8@?40{q*QBxeCIr&DeCs zN$Jk87ufi!@MGg^P!y?kR;5|C21AXBiCt@8o2(4DjT zeQx}1O3vUr>rvsC@m)JCFLTZIk2#ZhmuYUi!)8&%KsKNY=i=kwb7BcE5y#DUVE zH@x5b$a#4GdZ<0i3G)%!;4h2{ZJJ*AY$>y2)s9$Ry^YY>bnzpywegG)=+C-gwI@=nt18;DIYuE@&cYMQj!F zygK)%kYIqlU7?B}^e%>i(SGp|PC!3GMuC)^5IG$(8JHRf?Nr7o{aBcuc)?FU-`g$G z$oaldw{;zLd1fw3>Fo?{UZVAwu-D*+I0ItErpz$KuheD`6f_Q zNxKQuG3HI6Q5Ks(c~)SLv5xE}P|Dj)pj;g;8qcmM8!EbGQVC~53x*o7rh7iTB^KRP z$g`zQpj>xHRK#M8x!a4%@wrjK6t!q99T+q8A>|Om>=?yR&6XgT?4g&a*-qWw^q!9d z5_Vqn`12>_(Rmn75;?jsouG*C_kJnZ#utUOE88I1j zfs1f=+F)zMXY}5V;MyzlJcx02iR>KtFwXm61X4m@E(c1 z{b>pFn>5DTxD6o!)j%XMXj*scN{q?@(ODaVW-{8$7pGv?4u*F`Fup1P6`h{?kdX(9 z;wuX6C(tJkluW2m7%?9RB--IdRcR#F?nLnTm099JrbUR*FVd4EEAl?6jV&a^xpKw< z(pAT|NDqX)KHg%djkuFdj)|vKq0aSwY<6x|Xn$Uw@XwC+Q&jCfJk5h8Pb(733l%tSFcIui=nmMURAPB12rnIIXA z0J6fmQUb0lB*lChUYzpBkdRQ$;()^t*ola-Ql!gIU?~*o7LV{7 zrNODDcan0xEZNnpsEM>1aB!aWZ#QkLN7c0`81Rh$k_cN6&K#m`z0NixVdmFmYUR67=EXYdBQMGd3+Fh(uN%^|}S!*tMxISGp|@ zk?cowa zPgEE+lQxX)r|(b{CXpS=;7KM7W$cF@Y4S@E5{Nkaw!L%#&BZ05}mIhPq)^#q@A&|O+^M=ZWNI?)?E_x10y!?(x~`_G z9@=?yhMd4Cho*9S$!mI`dRkNG1@lg=w@Q;|kgU%n{12NP@jQ42q zmHfch)I8o?Q(w!E`%$?(!UJ^JA%2ji-<*HGHvhbYpC{Hposjld_?h1 zrwpsZ;yAEa-xaM|4zjcgZ2Xl4VVT~s7b5*nEz|k2; zMPX!dLqMMkqmH73Pv1NjbjIaVB=7e>=iaL7PKQpE?|ZNFozz{<`al2u{Li@}gcAR7 z89xA>xp+~Y&hRGe7jXTU2(PiQ1ZT`ZJYkat*bN#>5uk$J{WV=<)to*8F?_*L0|aX6 z&0htm6=P-}<}p)d7zz*q;Pao$feB1;n0)-Z*lf{UzQ)vC4Wp(RaY%Hu1gsHLxdavf z|8!TdgJR+{E->3nBcrYYU;Cc?ATa-{`aiLMC+!BZ5T&vY?^yB|N}@waix=FmS-E zskYO+cahe~=92)3gvv0>_(HizR6a!lZSlQ9q?rJQ^qRSA2ooUAh13#E&X{Qy`@V^3 zCbR-aLSGo7F>SJQHVHBk)|db)13c*a*=uADk5jo5c~}&B_~72~!H=U-l5g06{>`zd z9Z&-@L@+Y8A)byf;*$%l{Si{Oqn*%0=pS{BofZ)K37O71gE_4NVUe-&gu#d z>H@0LGTc)9(%B#^v>KKOoqdku+5rh#qQjwz!NWvD(CfpMS#~JplOqU=gJKqVa=(`Ie0Cs?rvrG07tG@T~hfMBKhZwOl zN}~?F@ZO+9xNh`>0M*()s0V|j_E~L=kMI^S7_7zi-8sq{o*u`Jk^gv{+fF=?2gF08 z#YoNp7vN$0q*nxir_?A9Jbe)zVSDCya89Zh@W5D>VESl5vh!L5kC2FBck;D;F?NTy zo%cW*0eWKRzTo$YR5t+=PzBQ?1BJo_P#1ogGvGj9M~Mej;1LFpdP;-*!$q0@Om+(y!%x{2WbV*PS z*c%|w7op`YX?+BVss_9}Q-P_=5HQI!XVwJ@v5vr@Lz4=g)`4+ji|17Kp+}U3JG`@l z>w3_ySq=zWsD$7$u_XdyBv5>>!RNSv`fTm4@$Hpp--A$0&`Sz72tUGtkd!{Q#$O}b zV18E|aUZa_5Rw5~3R4iNVOLUum1O&iSV8`^CORU7hQu0WE9BVzL>~edNc(3R8?ytr z?gk7M>7z8X4XTIP^yuai^0KA+pgS@Z3vcJK?xJD-HMgLftRvtEA#*1J>!Y$l3cQAe zvOyvtnv+!*#-jvbE1mBWNqZxe7tnhiaLHntPoI2Fq0|>nBsv-BhiM1gNhxNkIU_f^ zBnYM!GjA>b8VoI3LjPDN8R-uz80Y$vnK7$SwyROl`i6vj#{2b{Ps60}c2R7|xB z+J|v~ssWbdH7Pd5ooxYg0xrO$X?WY{CE;4%%}+co^i4%mEgZ7(^2P7rC550)^zt@h zj)YUKFK6*;!>0r>p>uKSJYs5?HTbpV$VD_?mnM$ErRx$JYu`6O5shL!Un&_hc*z^Fk&tw@$9b!F0Rf`#!P!^V*ELlSHx3vM8 zA>HT`GkgySvwbj$&~K&n(t1>Jln(!cxiX3lt`bHic&RQR|I2aIv`RQGhWD?s`&S$H ze@0k0)V_veiU(!lnyZh)^VCi?#T%;VVMMvRq(OHqIndq}qMGJV2g84|h))R8$ChxxzBUBd;u8_{nrU_Po>8n!A4;Sa39|#&9I4<-SSK)U z88d+|K=ZAikk$A)6ef<4j^>Lfv7hS2Ou>Cevx4&%F-h=h;d^1M)~+`0%)0;_0wHDx z_()Kg^0(nZm(-d8v==A(!lz4^m+^!Qk;yV3=D)Ru1jTgI(Y)+iB>2TA=FnjPhC=`! z(qzs_>UGc&ayv56Ay)&`=&_u@$G`AJ0s06z&VeRH@cTG5oLu;HO<(B=uYoy;RqOlG zv!rcOTpFT-wqd65NB|4rF>7RAUdA4h0=<)6k;iH)QxyQMS5TbobdB}lYe0?4$2ZCX z$XKt~_ks|%&s)EJ($)tWt@D1+sd2m?v<9)2JNp1}ObCP*X(EABpSTa81uiaZCDtD} zsDa|-payaD6)uEAfG;Z64%cgu|a zHn_&(0?p`?Uz==32OBWu(B(czntHN!ICRMyxs`+)(RSZTVA&m{)KO?7uF2w`&iEJm z56)wpM%?-YhAll=LTnT|{zZhXJGj^bd%KTq=M*}prc#~FTByvN)H_6`lYsZpBthUT ziGbrFbb{NizrbKS7-;jtqTqK9Y6mBPL?@Cb@yU%##!Z<7=LR6U$+Q)+0AcBo1-J@7 zcR`{M)u1O3L;Tb~GWZZ8g@zGx(Ar5F>YUX3B!j4^q_iF!4D#afH$M*C zV{l-)Au7YCHDMH!BxYVKG$_OB#j%wb0bI5C56hKjQ-v~6mTWZkp*x@lx)W}_rXtMA z%nT`JBl7iVR0cW0JA`kT5;WMCN7!=~^G>06?A&OH&S(_@8U_&dxK%3BQKlqo|9qTe zdLS;D3yJ7vY)45oBJT(ZaTcH<+oDXk{C(37`^LB5m|Ttd6<~PvD&>gX7Z31=4pfyI#WNIxSk0g2+0= zq6QmVAIa?#YHDODV727++xjRmGYkD;1|LZyF5;!mwW-#-9jTv6%r`BqC#ZErs?fPO z69c3{mGnGN!!Se8oV)0dSCX6{0A`HfJ%k}_C`NP=umZ#4Vk8IX3gU-+0bb*joCFce8^6& z#B<HBSPSK?jE_ici2;Ly{s#9ww^D^rEo`T`>)wj2(Xb2r`L{BKeV2mzSClaPzn8UP=Bt-!k@keIBL_lft-t>MJn-k)sGF-t{10{9|K-HZb;M5k$&_s$GP7zqsRZ zLcR9__4|HB*Ca_GE&dzVohrZzdC<|RV->jXrgsFd7hltNGp^}1WMLOr3gy|-cNb-# zsK>k6+fHiPiPj$eE#(ebM zi)$Ri!E_Tu>jB+KO=up%0l9&F4+En8bB|$yE+DQtTD~|0#<}4KKYHxfAA0A1{rm5U#cufC{cn2sEwA4H z`yaBqhko?Om;TT1ZvWVuZ%9QkZ>fmDQ|dQ%3~UCA1F6T?ih>|SgCyZM5~M>`wb)&$ z3Uh=`A%SObJ%Eo3LcMgLR6bOao$~OoRdVxkyC5jYL+`QbDo}lnH8kY8^1v>yS|6(A z^Yzl9iZ!xq`G8z5$yP}o*j%X$$Oo;VI?hKz{v;Chp#v#wZ$7R!wcMYH>sd$@Z^W}| zJRfcwZHDE}#%_H63k)&4S`Q@g%Zq`ub5a>cV;*)3K) zr&g{U$;)^tb_(OOU#dTA!bVd%_LEk=Ezu;Qm~sW#gWsT44p! z%5l$E;eItzH8_$_pX(z-jLrt-GjT(756uhyI%H=9fAY0Fh?J)Ki+!*{Z_Z7Z6Sa~waH zRus?k(?&MkGgP!IR^>h;=f4b~YF;m1z#)P^F0e*9JY=uKPYi1Q!5Do|{pI@On1V zddwgFjjz90?g@)w{sDZdtx_E<4s*CZjyec;MF5}h8@N`i9g$1rn(UYBC3nQD3>T|a z!e`ej6+O2}@!*hty*lnm)vFDbtF=~KEqS#=<;sE9M=h0DcDVxBQ-i@%&$V2);#I3M zxG5S4?I4G(`9)vg@@`@$MMKF+J zX#}EU#Hv`s9wsn+Oqf7a=gN>Q98=!lRm!DuqhAcitDbj&gl)Y{SC4pyJ*Qr4RKcFPfDOUasg$eL)vkB2h|Fwo z7=OhpQJ+y66oez}aW(8dwL@>wN_`k}hqu5T)^NGBzd3J=BUb7oKokt2J~F~^re5+6 zk3jlh^j--N@Y&Rmh{ffwHw>{|2HjLRORAR~FoON%O7RU;fLQB}DzVWqJS__vIDjeB zi6(+XJYg94h-nr~T!-|W!}W#83r<-Md1WYbVP6aKvT~I-Brgx?b6Z;{({V1vFV!Dn zDyX1RKIFN?3+a#E^&(9`&!lFQiF$8G9VGLvhoW{Se#86!#Qltx`=`KD=sw^nBfy>- zcrhtCc^S{Yk9w&5ukcGcUs%tdP_7O4TyL46CtP$0^V&O^Jl+`NI+^7jv`P-OPy`+h z0U4^Y?Hws&jxZg?ii}C$UmFxQp&ZHCu>59}Cw|*3-(TKM#lzCz*kRe5Q1&e39p5Vu zW)JDAJsd>BBgjWO0r5zxdput~G*||$aTfU^@{%q=dBZ-figVpzEuMw*PWsb%Nb8aO za%C9$UWjCZ0>?1vbfi19mg&R&2BeMSo^QhaW~43So}Z8Vtw{Yyoc4zyqW}oGUh`L* z!kuV`=8W1I4})^G$9H?c7(J5g0rJ}=_|2I$v=~cf)I%9%*sz*vrPr2lH$o&fP z5^VksiR6BG|2(bPat*xh7O%TE+6zN{!sZ4vGWRX=!%7>!}XeXczoYjixrQ( zV_g(V9i5Cm??9cT$1=`DEQ6#)4Qd2v874#vE7-nwn`|Gcd4g~^%96fD{Uf}72KQjJ z=$MWF&<)4SlMekNo|C--k>KU!-DOnndZ>E{GNIzhW$nTH&Se$_yCYZqQdS<<~? zQ@K4e<~5#&@0a2|(b)KLvdS@?oA93SZ7-M`@s;uU7-oX`?nmAsUX*<#mq@75ueDz}7??T#*v+*bI#`5sW}@z( zRVgwt3O4K(t0P0!5ui^4Z7^xQsGr6V!eR%Im~4gcekbmUx3$V7!ZXSf%Aw20-Cu$G zE0Ojgk;VuWSGWr4YNS>e6>#6)1c6T+j@{<-*3cpANVUKew`I#$$?Sq=jqog#a~++X z0`Y+Wo{gFg4U%p%QYk|yKn>W>EA1Xr$xf6d9ut&xpq*nHfXl04RFFC~aWUZ*lv|B* z6WSw9#$PNIYeljNSf^G65*p>6MENX!LtA8TQ`OiA<_o^S1wFx+;6`ZxX?wZ0g>>be z4PAK?QXa=8CNUbmJRKBZcr3T3!a{+XbBSl?HJ`zGo5pgu6Ek&3q($~nniAAp0jtU8tA z2<8w9UZq^$KPZFFok5v205Z5BL|Jyo;u)Rr!h&Y-OZ>;NN+nog@Uqn_)#5=9_Lb#a zTL(&V4PgZNWaJw!D;lut?(S(Z33>>rt36Ex;x3dYU7mCRnu7^>L*)=tSLi<)5{5yh z6xd9=@FL2GKAMoHk{)u>{*?J#E}O~cawGCm`_)>7agRcUiPd@q`pIR;LwZ-3mvlsu zpGjys)1YBW!g}zdDc~~^glWx(JnY9f;zCAHgdI@Jpin`bp^HJQN|SQ1SguzAK^t0@ zJW?)JA^u(XGtkZo)Qh{-%tgaF;85`mT;dNy^3Wt;nqVoDMhhsk%*gjqo@5No7vUH6 znXW034odgbZ-NWy2_%nG!8P5JtfY68mwanf7vVSQ*_4;&g=7cSN6+XT<)=Dn-U#mV zk?0xaA)Scor8elA^3gTbFT{aYNK25?NE?xMBl$>&k=}&#PNe&hK8f@g(l?R*H_{)F z;tAL?NarCPLb@I4KBP||J&N=+(zlU*ffP@63Nw(FAZ3x(B3*{$BOOG#1?e872a&#j z^c>Q6k!U1CwjNN0dAcA(CM_+5dN zMam;}_rT@4yY7%GA@pO7VL#lEr250x3TGb(L)cU%S0fkk0{7T4RL8Obyc)1YNCP7Q z4z32Tz0eflfxAoC(QqCSiQtA?11KX`>tJz=0fJ*RTtoG!5thV zy%?_{AC6o*GD7{3xl0nR8Q4waawAuY08!I)Y0xm5?iis(Ji(>Jyi(+$Z03TW3hojp zn_vv}Qp16Ug50x29wC7V$X3q{%D4Kvf~tjvTEL*l9AiRLO99h>T7xM7oV-d4=o&7n zv6-3sP#`r3D;ur;L4kCdrUy{qdJOaM3H?1gg82-mAaFR5`NfMhrXYYHpWo&T^^bA( z346T5@OIKHk%LPhHG(Dvc74!L2&&LcC4_2%JjP!o>^?GVm*KF$$q@u5(W+!aGlGM1@RKkH$?S@J<%M=2F;T~(6(5=}vb+AfB znY?Uip@CeXPfzAP)3O5rEkMZwbrB&zJdj<_$Y*CDd1P`q5G6q9G|2`M-tn-eCTxKR zj(K6Jd~tYW$Rj%lFVKy^y+&9LWdhP4t|Fp{emI?LMZbt@;TAxPu0U!V6L?I@RXy|q zPj^%iEzjVE`;|j zi$r6IEuhR2w=!DaF$0dz19yZ4T&Ovq-3)ltmcwltgY=0GBGEreqpb}$wkjNhS!n$Wq1{EsZ=Zmc`; zORkd+xCcm_hYMDxuR3Qu^P0;8tt@^zYZOy@Z8{?4i8;%1kYSJ)*);5Y0wn45&KBgDZ z4yl}1qC*;fx7UX@lcC=_PuJji>-_=Thy6JPxGoRJ=#(oSTi5i5Yr$e=cQ@*~ZV7k2 zZ(z#+7u9R52VKIu@SNZj{$_Abe|h+D!s|zZJmGJ{*Ah6cUI^a*8-61wdyv(@;eQC% zu<5+Rw0=a~*Ct0sH4i%uD>#r(AbChdtjXY>XT%e@dr=pDgauvPgju_G$y&%uXV9yj zXnhVWWBQC-DefPvEgxu?QL|sm%L42x}i&SFX5NSoYAR`GkR9nbwfAxoS_)1p&4l-V`L58FbvbknTn~Jnwd5;X4ceA z!!*rY4qeQl`5dawp;!)&#=_xxjO}lbZb0&_A;^*nf^{$_z=Qetoe#T%Op)+@2JXrA zaRTVra!?Pv&dwmQl*^WKJh}sU=OKmnAHy~AE-V#5ONNzO0b^l!8X_uxL$*4rl5m$V zE6I1EPBM2Mz;9Qh4q74PHGCh>iHgGaygYx$T7t$^<5-VE>_&J6WoUe7oXuU_h(rB< z`X}`L=Bp5MY3VipBIEv|^e6N^@(hap=d2UwrdEOfq*^_~`J!?T4}&1SM{~IkgfxI> zL{s6rD{)OGy>MlBclTAy_6nv6Y=S8)P)@B1XDf(3StFB#U?RKdda}HXid5z0G<^f8 z<{0WHlk`^nQoWzRFPW{M#c!P62fV=c_Ctk0R1Hn*GP+m}mlOCEO(yw=2L$2gC`0D% zAMs1{{3?EF-orYmA7i*)(21}Q%DH^b!~7G%D_8;@KwhGQ1Q^vq{GN~(@h2=~hb_L6 z*34mi3(B31{Dk{DQg~11KFM$)j!o}kREi}MQZm^lwZ~G@)M%$TT{ zcglj;!sKFcsd!EFfb?+WG=pR4x=8wk{ZTi}Em;BfBUysh1qZ^l8dcy+`J^Z=s zi)Z}pTi*VG=#;6`&seTz@|(BxU$A|L>+SpJPt9MDNVcbD%+_=H`#m@>f^b|NYAG-Fx2i-tL}rm+gK3-S_iAPnN9D85K4)3l%x}G5+s@s4FS+cBeOC`So`0Zv z`1%{(dhY`dKl1qV4?SEefBv0UcU>2YL{~@rh}hFTdTe1towgvlv~5vrWo%P)>Wa|^ z;!C4Tqsx++)b@=>jka0s$vJB_=ORwBO_>#25}6+p*PGD`V?ELKL|bCLd~UR(O^@Vb z^AgdH#Lj*rJtdv!PPQLCXV--*lPhM;J7>X+*=^g=z@{m46YcS>$#dK4sSWE^#Mi{y z;}^%pSZ5?Q`Zjyf)@1wWhp+D1oNA9xIWr$`*H=YnkAAw>-QBUZt$oYp`CF5_r}QV< zM}N1aePQJMej_q9*&fd&+K=jU6Kf(1E)l0`Q*L~(Ur&ub`POaDl$(^!S+_lK?EHH^ zeJqz)5#1L*r+rKNve=o&9=X!HFq%tDUr#9U?mr}N`u2*p5B>CLdYZT}J~f&=ddpj) z2VzqqZHdlz44mIq>mB`Fdo?*SbITiMbj;|uv~BL_-yS_b@}>>bX5O@OaXdcyt(CEL zOT>}Yk$F++==#Oe^D*)0^DB=1uhHKx-xh6;N;gj5v~BI^7kcAjbZ=~aMmjomRn+ac zqD8()Y{k4%XiiWcG>QE^&F)WqPHCA+pC-P5rUebJLsk+m%` z`qi`BZ;In2l~^numlE-0qHTKng4EoOc~d&4c1(+QM$S0n%(hwLY-sOuBl8mT#Rbyh zS#o4$WOb@rR3fURiT6n#ksgSCH2FvAPq9BsuSSlyeeCd&x83?7<8h{CyF`71wo=_kj9C_`u?zh-U!1y|klcD(%L zXFmJ%SDtX#5WZjSdN>pL(1`o=fC?cNW6{;{XN_}q8DxAm^ieeLOIpX=Yg zBoF1+RKw|)GdKlRwZKK;e-OrJIT%6-54{j0}Ehp+v?52r3Jl@}~5T>m!@J$%Dw zADuOO(c&%VZ{I=q|2H@M(^KF4*7slj^=~WH+iLZ9ozvZO-@~7J?2FHR=ZEiE|L(h# z+ZKQ0o6jEKzT=836Ih!(x969?DwU13=WW=0`yIRY*T3}T=fD2Kzy0*pG~m#l@*JW7`w+6PG5W`0S3I(T$PSU{BNI(>n6eg=ZJ!;pjDIkA5k3?2*X4__04n zE>FyAo6|-JcTK!KJ}-WGVr6Vg`>H5#Bci5OMd!s+kaH!>~Kn=q3r zW5PR@=7d=v(6-y|-g_ zRJ|v9^t-x!sJJ7NRERcGEUoH1Ko z+#wGv{?)3xSFTXxRpk%AxJtTzVD+Lu4Ri~y%K8V659oguf251;ON^yceq?-fs+H@R zb5BlLU~T=cMfYr5pRsnne9b)VHhAV^-M3k?FIwj$sxHYBB>=ZrVmxK+KXNimEUzy6cwTW}0 zVjDzZY-OZ3xnhne8z>M>0*?~y(n2v$#iL1NX_w}Sl9YqYj7q>;agh|k-ZJvp{s)!b2DRF6==tspkIwj4OqLEH~ds&j=;xrMkk1UiH z;oo{mOe94q)h2?P#Jbca9>nLJ+r)U}djJA@o1hw{WV~GxmBngQ!F^0z*4BY7KFAO; z@e&0i`J^P>6%nVv`G5u^($nh&@d@k&x>X#Ig?LdCqGG!&A#8wj3URI!6W=Y(J7bD? zPI7LlJECB0l60=P5s;U#qcDjRY161xl42P53Mnc6lE5ay80*AJIcoW__;)cOf>B17 zMWW(ApngHx8QGFjqt}W0wB;CQdqhQ@32|*?X-rJ6!}gC%8-$5ih!7|N6!HCHBsr5o zRupH6QxlQc6Grl|3Tm4_?<89P12KV2p)LrMKGx`p-q&2i9Euro@0x|Kpq4kp(Ewl$Y@?<`0kfNl#pp_mPZPjm1o6D+#dt1s zOS2Ih8;Qn}Nhz@?dMCb^9MzKIRB={JoQ7Jbvl?TrcsI(djRFFR;e;?S`m(UiIs)yI z(JGGM`wytxDY9Z|VfbTnI)%48QSu9mZ+2b~g{>5_md}H86vBvQH=n16g=)zfsScKF z1-8ED9a0g1QQ2QbKJ26zRC1QC`$}53?40T5GUE2ruZh-x!}?U)H$2T#vsOmY4cn8> zKdt(Fw?J{S=$H+A(pPQQhS>_sQjJ{jmsA9oJ?gSxtvYEY_{#&P2po>o=lKrUEVx*DNr zH2sW`_K+M;RdcGFSY0T2d(SE5 z^^%jencprbpsp{Z5|E}mFTNgsiJ=wO|f!mOZEJmr)RS1*#<&&^Lg$7gcY36(+-gW zyDw1WVqp-mBPa;Zl9pC-if^kq#mf3~)LyuF$9L7U>-!rWP3u`RXBxHzZzVH*=QZ~5&B^##uqSyN<^#he*x`bHcC*c6 z+rTzxni_8zWYO6MXwjr*`EU{XrUgEpbu@PgudD?vpru;yp$F)2-E~Cd2uZpAdIFUN z;M%(7!N&*>Wv1)YrjalSu13?=;jVNY?X2AaWiULq>sX=0zLR`@r{(s!78Y^Fqubb# z03Fd6-%vC=t7ia0CzDRAOV48i$66_ujsP{Th$92ZvC#l?Gytp!VfV)$QoKPjc6GzgDm_~pV-9y*<@2~=l!;z#sQawxO7Eo@v_Dj@4i@m5x|_ou zJuoKA*DPJh<`mAx19*kB%5DqX)(hCUhDCaK@iVq-WL!OMs*n^UjK-1NCgNZ~rn&=s z#aj9hF;dO6K^uma$>t2h&ZM<9z2_ioPQJ8B1FRa>=f*4r@JeggPv~WGn&IVa-SyM0 z0LID)C}wzs^`lVNGic4X9IP$qX3o&lnq#Y(^ILk#3IwdT*?-n+hB)=KMi3+MIq0dG zjH;N1qT~QDtYPd52$~^9Ap2MxJ+T@%UHcJIKW<3lWw4vgTG^~>L+ABuJ7egX@f7SL z+QIb#;M4XXnl)ebfh@k`Ww6T)@%K(zGkSvL*}W6_vP7f4#@DbS#F2rtvL*SWlEh?ihr1_(IZ z#*xp5fC2S za~i6kb-`Xf3R0LTwhxhf%}$=Wwqt0v4b2;?+A8!*Eq&pIO>#u%o0{q_>k!pHc0dg| z0%3;nqj!q#Z)-5#iRdrnONx_owVbCZ4$4B7T+|&%${;+3_-v^N>AD{~ zD$$AxRm;n%S=~xIep=VJ_qXbR0l#hdRhvLz427}phV-#L*RY`LWmL&vX(!AuN2Kt_YN_VJX-69T=Gz7~uRU_xx&{tgBQ*)Qb!DHa2zbt<$suq_~ z4x&C_&S^kk%T|os<*y&cWgQ1GDv0^eY}W@NUU5MS#!ak~ZNnDj%2q@RQQSqbMJ@B) zjO)N8_IyyLW2Ud{pR}&MBM7E$)MYkk45gKvDJr2M6;7SuT9&Uv zfv{Bvwm6LPLL99^qZ;Vu5C-A4M8gG^5RlLJU0p?7Pe%8$CfrxnnwA+Er=IR^*aiV3 zQ8h1}gBGIsIS27dhOP6$Eh3OzLXJ_m7#vc8O=Kfd38;jqBxo?IzL*F@MpG#JAHbI<9f>#L^W2Li6e=g^dM5FRHNau|$aDTwBRG6ikLb2FL!7X+fG zJOVMyLYN?pDaNU{-#t8DXB{hhpsA)|p`?As&Z?H<55~!tPdIE&U4KJr%^WTDn5LMx?{SSDjV*#Q{iU3-L$7-K|oaycLx83VGN%}SqP6T z1c#Gx(_YT?)Y55`^&IF-8VL`_&6=Lq3DhSPHrpk%{ki0X_Pg=5L}><1%iSM zu&xdK3Je-8LY<2a4x=1kg!6iQC@pCp{)f}YR zI0G^@9N?6tx?Zj}sa2w69NX6*7JW-sUDK`y42bo50(CX5Y6fg#IPaiF!$LhcNqz?b zktW8F)jfDLO#RR#`QiJ3GLg}9Ab2h7=MGPj-!svFtdr@aCE1>G1V`DBvt)$4Y;L7I z0#;JME^NnZYP2T~D>N_z#ihlWwT^sQgN~QAR0k6Q>FTPg^@d4$1!f6bNjEjD0@$9f zT(`B^`YH060>>L0XsW|RfWH)eeMfual_wn^e-TQKT}*=XVk>t;+XyA4g2xSi&#KL@&3`lC zy&kOV93iRdWsi!1hW=UzGzO5=eFN)zFm-aO10~1SkBLdFU$GP8ZWPyZn38jqtjXFS zT!u}Rfz9$*kzj+0b<$QdIXKpI^(OK1#uWZl-dOb1f-f{}IhyaNX$n|=lNhbql>=`U zC!Zrl^=P$LN9?kLfM)$~MPtPQ!Pc_WZYsq%1jy+_#-hEx;?yFyWT-pwK~3-6CG~`aqRdz5rRQhhsq;){Bqz zJNTz>6<mxa4woyYD7ReTubKd;(-uX>5vTO zH<{2U0?l$Kd0|h>Eu!YKst3okjmQR2ihhTw6Y@iIPzf0=id z!Uzh3+)=Dy_0q633u_TsECK8PWAffW!G^;RI}%hAT8ol-kH|f96_`vz(1*EoaKdU{ zMzei2?K(O%F}MNVE1qQampe(o6xfo-U{-Yv*xy(=wje&Tx%Y{2-oX3C(^-dTHFyoz zf%y!Ff#I4NtbBh!oZRAN%$u)h5cnDvuV-Q*PsL6VXeC&r%zRM1I>3dKs3t9{;Dl7y zN^+!>koUvDq@XgxEp%K_(w1zTLeG0GSVV`KEDNP_+c{u7GpZ#X80wAh*tP%O`h(#mIN@nhKh9< zELhr>kEQ(Fy<(=!|dlWd|U_!d`?hjRLxZ22ljH=f0&$n(z@bd1ul!Y0l3@K z#)nTLVOt`_ED&baaj~%o>JXN!?h~irV8Q*^nMY!&?A$NLSg6lO#I1pXgk8H3S7Udi zjUURGb&G7yb{t#7DmWH_z}OxT*9BFvaWgo*W(7LV9`xbY_hIL1j+*(XxIL&Km~Whs zgqXT~z9qKqH7hiLQW~~Q0ZwW*?HCV=+60R)Pao0*my$+j){qexv9XzjHp4~{)D(WoU5^P+=SPJeFb!|M2=c8a4g_?pF9;fxmg^+ z3lF!CXcZd_?VrSs0CyM$|MTSI)!}%eN=UK*)Y_*eFM{ByoDUxbOnS?5E$3gvji)x^ zG1Ti}mB@7z1k1q0!&2p^#SNj3NA^gttT_qLushLmv3n6592*XO`!k{+R`Pl&ihzOk+~-fHuxG+;ZJF@vWU!EzHXdU_8=--Zi>I?H>-(ygaeM_{0mm_N>3vw@Pu3tD<~$M6?(>XVRdATuTBm@$3)zq zk99Y!8fF0dXT%_)vsElnBpiMLANFsucRFtoQdrhc9j%Ph%xEC0Kp?Pr8 z80m~-Wb|iW2UiG-(LxV1SjPir^gIK;1xS_W#8?3b>D8VWJGpU<$dDky`0JwD+Y;P? zQ|92t!jY9&2*S}Jg(58rYOaE5QcNhh7W}BjH%_4pT;3WC4&Ad5=C67F|2%~<23&!b z2cfCK?X4KvH$%xeb{?7?!z?41Np-;-Jyo~OZ;6P`MvrMx|1WhX;gmXVYq!MrAs)lZ zsPJ%mp6z5k_uJydC)M;>2gX{3@KgexEpeW>8_bb^9ec3Sh*(lI-~7(RgT+K0#KvP3 zuzkeNS+Lr%LIj_$D~z<^rCWCpr79)K2Cd_~XEC}95!6CQKun&y+CCD2qKwyZHQTLp z>oL*{owL<$L+e&nm*|KCoaVBuaVWoxjsEG?ioRM=m&Xs`RFrx(u5_!pZbisV!x9+8 wSpi+aAsJpZvT_i1_5PtUmR71OQ+9pmz-q)l;xOx#$to1~)d)NNzepA`qW}N^ diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wasm deleted file mode 100644 index 6bbf007f975d3619e3796e9fb3ad04dc078c5367..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmX}kOA5j;6a~rw>ghXc(s0kD;cA54Ip zd0I6)lfB0L48_D`7iZUN7gKl``*sDWgxvLPOfH%V*tcwOmjedeYOk}!xZk7+{zrHu Q#_hfQ7a0UZofdr&Ujw%x>;M1& diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wat b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wat deleted file mode 100644 index 16ca926513..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start.wat +++ /dev/null @@ -1,9 +0,0 @@ -(module $exit_on_start - (import "wasi_snapshot_preview1" "proc_exit" - (func $wasi.proc_exit (param $rval i32))) - - (func (export "_start") - i32.const 2 ;; push $rval onto the stack - call $wasi.proc_exit ;; return a sys.ExitError to the caller - ) -) diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wasm deleted file mode 100644 index 3602aaf0ffdfb7e14ed4f9835265b766d333d7cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmX}kK@Ng26h+bZz61~gfiZh<<^o(v`I-($ppdqLGq(=J#PL13&@d4IbLsg-4@k#q z(=eE~3sIk=y)J%!8T%O`a1k;qn3^N`2o^b0JfuO1d*XDmsH;<&+5HGxqCR)G|3yjx Jk@!_dVh2n;9yR~~ diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wat b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wat deleted file mode 100644 index 9bdd76f24a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/exit_on_start_unstable.wat +++ /dev/null @@ -1,10 +0,0 @@ -(module $exit_on_start - ;; Old TinyGo (e.g. 0.19) uses wasi_unstable not wasi_snapshot_preview1 - (import "wasi_unstable" "proc_exit" - (func $wasi.proc_exit (param $rval i32))) - - (func (export "_start") - i32.const 2 ;; push $rval onto the stack - call $wasi.proc_exit ;; return a sys.ExitError to the caller - ) -) diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/gotip/wasi.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/gotip/wasi.go deleted file mode 100644 index 50612cb871..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/gotip/wasi.go +++ /dev/null @@ -1,162 +0,0 @@ -package main - -import ( - "fmt" - "io" - "net" - "net/http" - "os" - "sync" - "syscall" -) - -func main() { - switch os.Args[1] { - case "sock": - if err := mainSock(); err != nil { - panic(err) - } - case "http": - if err := mainHTTP(); err != nil { - panic(err) - } - case "nonblock": - if err := mainNonblock(os.Args[2], os.Args[3:]); err != nil { - panic(err) - } - } -} - -// mainSock is an explicit test of a blocking socket. -func mainSock() error { - // Get a listener from the pre-opened file descriptor. - // The listener is the first pre-open, with a file-descriptor of 3. - f := os.NewFile(3, "") - l, err := net.FileListener(f) - defer f.Close() - if err != nil { - return err - } - defer l.Close() - - // Accept a connection - conn, err := l.Accept() - if err != nil { - return err - } - defer conn.Close() - - // Do a blocking read of up to 32 bytes. - // Note: the test should write: "wazero", so that's all we should read. - var buf [32]byte - n, err := conn.Read(buf[:]) - if err != nil { - return err - } - fmt.Println(string(buf[:n])) - return nil -} - -// mainHTTP implicitly tests non-blocking sockets, as they are needed for -// middleware. -func mainHTTP() error { - // Get the file representing a pre-opened TCP socket. - // The socket (listener) is the first pre-open, with a file-descriptor of - // 3 because the host didn't add any pre-opened files. - listenerFD := 3 - f := os.NewFile(uintptr(listenerFD), "") - - // Wasm runs similarly to GOMAXPROCS=1, so multiple goroutines cannot work - // in parallel. non-blocking allows the poller to park the go-routine - // accepting connections while work is done on one. - if err := syscall.SetNonblock(listenerFD, true); err != nil { - return err - } - - // Convert the file representing the pre-opened socket to a listener, so - // that we can integrate it with HTTP middleware. - ln, err := net.FileListener(f) - defer f.Close() - if err != nil { - return err - } - defer ln.Close() - - // Serve middleware that echos the request body to the response once, then quits. - h := &echoOnce{ch: make(chan struct{}, 1)} - go http.Serve(ln, h) - <-h.ch - return nil -} - -type echoOnce struct { - ch chan struct{} -} - -func (e echoOnce) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // Copy up to 32 bytes from the request to the response, appending a newline. - // Note: the test should write: "wazero", so that's all we should read. - var buf [32]byte - if n, err := r.Body.Read(buf[:]); err != nil && err != io.EOF { - panic(err) - } else if n, err = w.Write(append(buf[:n], '\n')); err != nil { - panic(err) - } - // Once one request was served, close the channel. - close(e.ch) -} - -// Adapted from nonblock.go -// https://github.com/golang/go/blob/0fcc70ecd56e3b5c214ddaee4065ea1139ae16b5/src/runtime/internal/wasitest/testdata/nonblock.go -func mainNonblock(mode string, files []string) error { - ready := make(chan struct{}) - - var wg sync.WaitGroup - for _, path := range files { - f, err := os.Open(path) - if err != nil { - return err - } - switch mode { - case "open": - case "create": - fd := f.Fd() - if err = syscall.SetNonblock(int(fd), true); err != nil { - return err - } - f = os.NewFile(fd, path) - default: - return fmt.Errorf("invalid test mode") - } - - spawnWait := make(chan struct{}) - - wg.Add(1) - go func(f *os.File) { - defer f.Close() - defer wg.Done() - - // Signal the routine has been spawned. - close(spawnWait) - - // Wait until ready. - <-ready - - var buf [256]byte - - if n, err := f.Read(buf[:]); err != nil { - panic(err) - } else { - os.Stderr.Write(buf[:n]) - } - }(f) - - // Spawn one goroutine at a time. - <-spawnWait - } - - println("waiting") - close(ready) - wg.Wait() - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wasm deleted file mode 100644 index a3d5c31788bf04b38c55fb3e031a289ef432e853..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmaLNK?=e!6a>)uKeZMMr6{=QLWG>aBjhA$z^D~sOA;))Nsn&pUS}~giw6@N0idmD zIVDPMmgdY0uoL^ygieQt8N#iPdhqty+3{2ue+~L-Bk)61UlF>u{qKs)S&zPp79^N> yB?y#PoS>$nTzcYiz2n?j*ZUVE*C84oAvQ-kK$1d@Mv{ce?lm=Pc_gXkru+b(N;;YV diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wat b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wat deleted file mode 100644 index e119704119..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_args.wat +++ /dev/null @@ -1,61 +0,0 @@ -;; $print_args is a WASI command which copies null-terminated args to stdout. -(module $print_args - ;; args_get reads command-line argument data. - ;; - ;; See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-args_getargv-pointerpointeru8-argv_buf-pointeru8---errno - (import "wasi_snapshot_preview1" "args_get" - (func $wasi.args_get (param $argv i32) (param $argv_buf i32) (result (;errno;) i32))) - - ;; args_sizes_get returns command-line argument data sizes. - ;; - ;; See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-args_sizes_get---errno-size-size - (import "wasi_snapshot_preview1" "args_sizes_get" - (func $wasi.args_sizes_get (param $result.argc i32) (param $result.argv_len i32) (result (;errno;) i32))) - - ;; fd_write write bytes to a file descriptor. - ;; - ;; See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fd_write - (import "wasi_snapshot_preview1" "fd_write" - (func $wasi.fd_write (param $fd i32) (param $iovs i32) (param $iovs_len i32) (param $result.size i32) (result (;errno;) i32))) - - ;; WASI commands are required to export "memory". Particularly, imported functions mutate this. - ;; - ;; Note: 1 is the size in pages (64KB), not bytes! - ;; See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memories%E2%91%A7 - (memory (export "memory") 1) - - ;; $iovs are offset/length pairs in memory fd_write copies to the file - ;; descriptor. $main will only write one offset/length pair. - (global $iovs i32 i32.const 1024) ;; 1024 is an arbitrary offset - - ;; WASI parameters are usually memory offsets, you can ignore values by writing them to an unread offset. - (global $ignored i32 i32.const 32768) - - ;; _start is a special function defined by a WASI Command that runs like a main function would. - ;; - ;; See https://github.com/WebAssembly/WASI/blob/snapshot-01/design/application-abi.md#current-unstable-abi - (func $main (export "_start") - ;; To copy an argument to a file, we first need to load it into memory. - (call $wasi.args_get - (global.get $ignored) ;; ignore $argv as we only read the argv_buf - (i32.const 0) ;; Write $argv_buf (null-terminated args) to memory offset zero. - ) - drop ;; ignore the errno returned - - ;; Next, we need to know how many bytes were loaded, as that's how much we'll copy to the file. - (call $wasi.args_sizes_get - (global.get $ignored) ;; ignore $result.argc as we only read the argv_buf. - (i32.add (global.get $iovs) (i32.const 4)) ;; store $result.argv_len as the length to copy - ) - drop ;; ignore the errno returned - - ;; Finally, write the memory region to the file. - (call $wasi.fd_write - (i32.const 1) ;; $fd is a file descriptor and 1 is stdout (console). - (global.get $iovs) ;; $iovs is the start offset of the IO vectors to copy. - (i32.const 1) ;; $iovs_len is the count of offset/length pairs to copy to memory. - (global.get $ignored) ;; ignore $result.size as we aren't verifying it. - ) - drop ;; ignore the errno returned - ) -) diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wasm deleted file mode 100644 index f10887985594a01bdd558c96c33096f850450578..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 231 zcmZ{d!3x4K5JYD;QHz2U3WEIs_2|WWz9bDaY7S{j60Dy3>!zN(bYXZi@L*x0CjfMm z4NntIjhKFr8S@1AEe@lJPRGs+@!2Om1p9J!yzcMq++#9HKWqXPyz0+uUC^EJ7PKH2 zSssH+7A%;=N>aW}#cOYUA3lt=&JRO^*k0%aB@{~38HJK(MoG1TDsBu#x#W~w@4ml? BKaBtY diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wat b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wat deleted file mode 100644 index 81f952d529..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/print_prestat_dirname.wat +++ /dev/null @@ -1,42 +0,0 @@ -;; $$print_prestat_dirname is a WASI command which copies the first preopen dirname to stdout. -(module $print_prestat_dirname - (import "wasi_snapshot_preview1" "fd_prestat_get" - (func $wasi.fd_prestat_get (param $fd i32) (param $result.prestat i32) (result (;errno;) i32))) - - (import "wasi_snapshot_preview1" "fd_prestat_dir_name" - (func $wasi.fd_prestat_dir_name (param $fd i32) (param $result.path i32) (param $result.path_len i32) (result (;errno;) i32))) - - (import "wasi_snapshot_preview1" "fd_write" - (func $wasi.fd_write (param $fd i32) (param $iovs i32) (param $iovs_len i32) (param $result.size i32) (result (;errno;) i32))) - - (memory (export "memory") 1 1) - - (func $main (export "_start") - ;; First, we need to know the size of the prestat dir name. - (call $wasi.fd_prestat_get - (i32.const 3) ;; preopen FD - (i32.const 0) ;; where to write prestat - ) - drop ;; ignore the errno returned - - ;; Next, write the dir name to offset 8 (past the prestat). - (call $wasi.fd_prestat_dir_name - (i32.const 3) ;; preopen FD - (i32.const 8) ;; where to write dir_name - (i32.load (i32.const 4)) ;; length is the last part of the prestat - ) - drop ;; ignore the errno returned - - ;; Now, convert the prestat to an iovec [offset, len] writing offset=8. - (i32.store (i32.const 0) (i32.const 8)) - - ;; Finally, write the dirname to stdout via its iovec [offset, len]. - (call $wasi.fd_write - (i32.const 1) ;; stdout - (i32.const 0) ;; where's the iovec - (i32.const 1) ;; only one iovec - (i32.const 0) ;; overwrite the iovec with the ignored result. - ) - drop ;; ignore the errno returned - ) -) diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.c b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.c deleted file mode 100644 index 818b8c330a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.c +++ /dev/null @@ -1,222 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define formatBool(b) ((b) ? "true" : "false") - -void main_ls(char *dir_name, bool repeat) { - DIR *d; - struct dirent *dir; - d = opendir(dir_name); - if (d) { - while ((dir = readdir(d)) != NULL) { - printf("./%s\n", dir->d_name); - } - if (repeat) { - rewinddir(d); - while ((dir = readdir(d)) != NULL) { - printf("./%s\n", dir->d_name); - } - } - closedir(d); - } else if (errno == ENOTDIR) { - printf("ENOTDIR\n"); - } else { - printf("%s\n", strerror(errno)); - } -} - -void main_stat() { - printf("stdin isatty: %s\n", formatBool(isatty(0))); - printf("stdout isatty: %s\n", formatBool(isatty(1))); - printf("stderr isatty: %s\n", formatBool(isatty(2))); - printf("/ isatty: %s\n", formatBool(isatty(3))); -} - -void main_poll(int timeout, int millis) { - int ret = 0; - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(0, &rfds); - - tv.tv_sec = timeout; - tv.tv_usec = millis*1000; - ret = select(1, &rfds, NULL, NULL, &tv); - if ((ret > 0) && FD_ISSET(0, &rfds)) { - printf("STDIN\n"); - } else { - printf("NOINPUT\n"); - } -} - -void main_sleepmillis(int millis) { - struct timespec tim, tim2; - tim.tv_sec = 0; - tim.tv_nsec = millis * 1000000; - - if(nanosleep(&tim , &tim2) < 0 ) { - printf("ERR\n"); - return; - } - - printf("OK\n"); -} - -void main_open_rdonly() { - const char *path = "zig-cc.rdonly.test"; - int fd; - char buf[32]; - - fd = open(path, O_CREAT|O_TRUNC|O_RDONLY, 0644); - if (fd < 0) { - perror("ERR: open"); - goto cleanup; - } - if (write(fd, "hello world\n", 12) >= 0) { - perror("ERR: write"); - goto cleanup; - } - if (read(fd, buf, sizeof(buf)) != 0) { - perror("ERR: read"); - goto cleanup; - } - puts("OK"); - cleanup: - close(fd); - unlink(path); -} - -void main_open_wronly() { - const char *path = "zig-cc.wronly.test"; - int fd; - char buf[32]; - - fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, 0644); - if (fd < 0) { - perror("ERR: open"); - goto cleanup; - } - if (write(fd, "hello world\n", 12) != 12) { - perror("ERR: write"); - goto cleanup; - } - if (read(fd, buf, sizeof(buf)) >= 0) { - perror("ERR: read"); - goto cleanup; - } - puts("OK"); - cleanup: - close(fd); - unlink(path); -} - -void main_sock() { - // Get a listener from the pre-opened file descriptor. - // The listener is the first pre-open, with a file-descriptor of 3. - int listener_fd = 3; - - int nfd = -1; - // Some runtimes set the fd to NONBLOCK - // so we loop until we no longer get EAGAIN. - while (true) { - nfd = accept(listener_fd, NULL, NULL); - if (nfd >= 0) { - break; - } - if (errno == EAGAIN) { - sleep(1); - continue; - } else { - perror("ERR: accept"); - return; - } - } - - // Wait data to be available on nfd for 1 sec. - char buf[32]; - struct timeval tv = {1, 0}; - fd_set set; - FD_ZERO(&set); - FD_SET(nfd, &set); - int ret = select(nfd+1, &set, NULL, NULL, &tv); - - // If some data is available, read it. - if (ret) { - // Assume no error: we are about to quit - // and we will check `buf` anyway. - recv(nfd, buf, sizeof(buf), 0); - printf("%s\n", buf); - } else { - puts("ERR: failed to read data"); - } -} - -void main_nonblock(char* fpath) { - struct timespec tim, tim2; - tim.tv_sec = 0; - tim.tv_nsec = 100 * 1000000; // 100 msec - int fd = open(fpath, O_RDONLY | O_NONBLOCK); - char buf[32]; - ssize_t newLen = 0; - while (newLen == 0) { - newLen = read(fd, buf, sizeof(buf)); - if (errno == EAGAIN || newLen == 0) { - printf("."); - nanosleep(&tim , &tim2) ; - continue; - } - } - printf("\n%s\n", buf); - close(fd); -} - -int main(int argc, char** argv) { - if (strcmp(argv[1],"ls")==0) { - bool repeat = false; - if (argc > 3) { - repeat = strcmp(argv[3],"repeat")==0; - } - main_ls(argv[2], repeat); - } else if (strcmp(argv[1],"stat")==0) { - main_stat(); - } else if (strcmp(argv[1],"poll")==0) { - int timeout = 0; - int usec = 0; - if (argc > 2) { - timeout = atoi(argv[2]); - } - if (argc > 3) { - usec = atoi(argv[3]); - } - main_poll(timeout, usec); - } else if (strcmp(argv[1],"sleepmillis")==0) { - int timeout = 0; - if (argc > 2) { - timeout = atoi(argv[2]); - } - main_sleepmillis(timeout); - } else if (strcmp(argv[1],"open-rdonly")==0) { - main_open_rdonly(); - } else if (strcmp(argv[1],"open-wronly")==0) { - main_open_wronly(); - } else if (strcmp(argv[1],"sock")==0) { - main_sock(); - } else if (strcmp(argv[1],"nonblock")==0) { - main_nonblock(argv[2]); - } else { - fprintf(stderr, "unknown command: %s\n", argv[1]); - return 1; - } - return 0; -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig-cc/wasi.wasm deleted file mode 100644 index 255a198f097f84776b119254c961b1b5fe43aadf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62102 zcmeFa2b^71x%a>8nQ~^5lRn7=c-Em96eK7HFGaGWOei9th+eN=;1w()Yopp=jw+4XUhoS#oJUaq4l0 zEPD4ri;g_x=tb{3YVkowFFfqncOQ1#_T7gpeCMKr-g(&KD0!Y5<9v-p?|$!LFI=zt z9fuzD_QQ`_bXb%=Pfz{Sc*miO79X;QhmTlSb7$^xX>&I`WVs4vV7a8M}+h z3lBTw&?tMJ3cY0odW!PrsiRI79d_7)sP;S+goEQ2zI*Xu&pXV7qYqj9u7lq3?!!ms z*Y!M|_4uks9evo5QTOvyY4|F~9C`S=k6hq8ect)kk3Q<~!w)*@$it3$$2*=ExSpdI z9`*Kv4m|1P zx-woK*SqRTl=dV^PhXOxNfKpwEzA0otS5uJ3nMQIu(SyYd*Buyz#eFm9P8pUy6 zJ*9w_Q8F&-8sA8IQX2Jkk(cyDQ9^B6OsG%jnUM6<>-C;w+_;I8CQq3%VZzj@6DLlb zIyKAVqvJf!(>R(?>p_f*;o-GWy=ziZJL0e-j#~JhB&r<*TP|E2P44N9qavo14rnqFKqh%hnD@{ZT>fIpLvk&hYSX)VM^SE^2&K z-xl@9J-ab?f%H(V*cL!QA$?P*xRKViM+H` zENK_rq`LPWY{tdf zB%@+i@rTf`i;k4lW$BzmT~t-6rAD=RF;Hk8VRBHSf_UCiAUvCybBMQs2lBWVILDShSm%yC&!a!Y=`II1P+$z+$u6ps% z8gT5uN=PlRWZ!;qKyk}()}q0ZcC#zg2KHq`07BgsEorf&RWyXkuHxucGx2Fnb`%iJ zZV+JIkfj44?Nea3ZtDW;#nG;ZoQ%F8PqDPUfH|dOpD2K3TiZs6MmwMaQZHy`o{XYA zBrPdVM{N^_w}iTdWeq=8=1D@us5o9M7Wh6J&G*?mg(g}CzR!wHtSj(+*I2&K;Cq$8 z_g&A;_bI)MV&Wz^fcs!g8U#)jFY*kCeM!A&2oFMGU-*iIXEmS_H4C2S1j5$I>S=+d z5hQFp>;JKHtq0*`+RO>&gc(bD+u>5oAYEN-b73fTp@mAqug z3!*YsCj?~xmNE$lGU}4LCH2pxu~(EZsl^r*8Jy5U?}6WVK^x7Kw2YAW9VCCgP)*8E_EbW$1pJM4J`+cwwk$^FdyMd{|q@>O~zCm^nK)|*OFqOWw9R< zK#FcrIkseh7*@4FMTfoPz}{mBy`eIX|D(!0RD3RF9;4CtLz$x$fM&E3Yvv_WM?em+ zXk1NOEKSu)pLt4;rgA)r%84fA#asHCW)*S;IrH_B>=ERNg%+{2-Y26HHO`j~tN$vA zGmNN3VhoX?8H;)e>NWOOOyaH_l`d^JBM}VJLz_TXzC2y^?di(6Nz3aiAs;fSH7x=( zJb01^i!+8Pyv0FNt1+w*@Sq98Vko3^6vY_KtD&@1LusjoyroFrDSJu%poUV^P!!Zq z)KNpBA{0{zY6#s}n%@+P@dw2M6rxyEnjMcDX%!ex=+0=@(MDrsFj~W_e_4)<1 zxZ9%}Gt$5Ydm@aNWX8gO<3bUoh{k(~Q?B?Wi_l! zvpYx?_*PF6nVzE2vTjL856ZJ=LEt&sWXLXGo|2xadOXgP(g>)?ki0NtPl^4c#C}p@ zKM~g@@02eBM+fXDV80fyU+Z8$R0R7f0sFNM_7kwrAJ|9V^pFJmwF>){yp-6_tw%)Y zp?QZ0)+1ICamJD(8AT4jXYNeKz_SpsH)h%6AnV{D#?JwpUa0)!MLxiR8-q~!652D> zRB9&|Qafyc*AWK|=Ifz%zLl>mxLvJgpwoy?Mtt{g#h9bbDMDr%3!2duJ}H!j ze+Wl62C3+4H7-*n!3pqk3S)UfJoGg#P)Re{yYh3IfDF$3i8khQZu!^5_W5tP7 zcC+ku>g5 zE+f2uq;$)TO63hmZ#7OGsWm;+ibD^L(?&{0L2~*?u4j%j^c+<Lha0+ll(y;M6nF@ z652Ix2{7TQjEfo{(L>`K`mC?$jcY!Lm5#?f$9Q^6Y%vb|P7#j^D{-HETty{#H}^FW zD9^*H8SfOqti{q$6Z4x<6WhCS&19!2q2>vpCbm{J)90$0?iAr9qq+R(S*XcZ?zOx! z)s~>Glr=(ub`vY6M|5IiU*?iJxkmn(7$+_oimSo%)=9J@s@tc!cSN1wyK8`4Upc*E zd#NqOLKk?a&)G)(G$x!WPpAw^urhZ6bEb6@#tpn{SvdQ%aP7<*-ZLV z4d97D6|WoRdTP#85e7n)q^h!A6zvR&i0Z?jeB}Z>ZhME@&)XQW#83<=$FYWzc+Wxu zG;1O;W(O7$VU+471#JU~Kq}E9?zfQ8h3#nqnZ8iu-Yx4cx);-E;8-852})?z?ThGY zF`j;>2vwM%3N`G8t@>2dc#c*Oq2&Y(h$6FJinf=mP@1`#C|U2>ez> zV?ZCMp6arw$_91kBuu`-Y?z(-TL^j~m}vck8fL0E_I4p4&E7K)Q%ai`*R4dW{g zgs;ir3;#%!`;fJxJIxO7q~6s@9a?n-g|l`su&|lqsuxlv7T+{aZa`xxi)}1{A)ROj z{MQ}Rf$$|KiYEmre9=HEQPu%nm=s!(tPAHKiQ{CMp;)}Wj!NUhvqccbTNdvpl?5_K zArrGwnW~XYEXc;0Fb9;5i}#g47C`HrEDw+L1;%X=kgb2_Z^yOT#V}MjUR+q$l>F$7 z>fr^d1@)H#F+36lZ@`z2cyCxrF-7n%@f4H#o+E1&Vyk2>y=rc#Pyyb|=l92c7|og9 zTrjq*h-yj6D~1I!L}~qk5F~4CRQ9eSY@+1w@DNGx8%KvDl0Stx$#MYcJ7tJILE65Z)!Tw#A$K0Q~tVOiJbH$D+Ez&U!U z>?N&#EQxzzQLmFzX*=wmpY(Qww2F{3KSqZFIRkY-ceP@f>!Mi=6}HSfILt)rh|QkB zK(1HKSx{tMHnLvJSSAC%Wc5mZgBVKj$#Lg)%Knd_n(R{G%wEehj9#!Ri)X0#KDZ>m)`7crJNwdvV7 z4I_x}i(j6&b{LokrNFxCcf>5}jL;|!7wP;At=QWH|}Bl>sGCk7gcY=XPH zZPYEOiIkcmz=*)1%NROse8}Sjr_xt~yi(Q_HSY2SaCgbNrL2hopF3c>h%F?xVoJb` zwd?@6Xrh0BNS9AR6TXga71NJp9l8gFR$%V5Ij}s(@tXIkXP!O5du%=JewK!#VrB=I z?9U|id7pV^{RzHS=+N4O&3xWH%ZHPd#tNqA*|N0Y%y#Yo1%Wb|5n zBx66z1Q#uf(_(F4+{?=7fSg)MMN+Kvncs|BW%Q90e~(n{fsq^_PF}NPve>e1qlUBw zi-@pW4IZNdmU+^(EMgU>tw7q!j-|8KMHQv;`sR`6g}8COCjkLbSk9B>FS(|Em25BQ zjgz^>tPzRQ7{gXRQ@ue?w66q6{e-@$HBXgiwi;K5QM>@pN*Y1bMp}%Fs#v)F@g55@^c{eQyaqJH}2yF~P0c z(ne8{Z^)XP^f1ILn+>7R6c&%v#d~?dx+jdPi&OIgb+!8;h_tpBKna0yE*O z_RM> zU-iT%T3lRLi9}$YE5+d>7HE_r_v*ED2~xQOE9Ej3tNmwOx(0q5T^em{IcREpTtIJ8xr81d5s0-Z+uW{f>hj}GlssuHvUp^MZIOtO$Xf%lN1|Sp_hVFr&NO*W503)=CCu#uBA>kdj!?zs)@Sf)c z(5tckAw)*yd3N21%yl!`FlPAflZzCGM82eTa|}VWRZnd9`he6s zD@-p%tHq1aoa~KLz(EWac`p)$o3-6J4TAod!%|vgHB69Lh{u`XYqENzfTrv_V=+qm zqazlDHw%7~Lonb!PsV>pw~o5mo98Q%zl{hEw3_H5)_FgxAyM>nJsSR`WXoB}7DQ@Y zMK7CLf}fGCngScjngW4_sSF?~M1zG{01fcT?b#xLZ9bUWDbhM)Pm8Cn5N&~)uHdi& zS&u)CLLx1GaUz1*_@dzJkLE?L2MSQ&=Z@Qp4)|ONd%-4Ym^gSTwwceafroUmb$1AY zy^28=SYR(?pcr18wj1}Vy%q~ulJRgEj*u|XD^F~67vK_;$$aF9P4;>nUE;Uo!E#)j z6;~=Ps|PH-GFaMr`?*wba8{WNI%zK%^^SL3&e3Ao0<>D=TEXaJ1ISf*sA?~M#7pf9 zUTR0BX7x`daaYCv?8lT^UoxUq4=@*&PQc?pwbnve!Hnu&P3M{)?d#f`bx?)3 zJ*JH?vRU%8?!g7kE@%gr7kvdHG6?^v0W7;f**z@0u=a_(1^{&cryGB~g3?nbfH6zc zk|gnk=r96P+J???yZwQH5p^He-!VciLZ3LO4(SRt9Em~T$YN(l7J*setv#tmu>~vZ zMeJmin5E zuAqX3Sa4(E^R}4aapLzFXC*r{L4mdmw488>#`Z&nUS4pZ|L`!O?{$~{*Y*8~UzU=F z{b#~me=AG??m)~gtodnm7E#+J3=xqN){#MOkioDEroc=(nO4s)6nLml#&I6D!x9-h ztxie#C5>;2ko^!$7E!15q*Wj~E29=`tBK%6^u!L7ME7SX{85Bi!u1}$D@-a1o3*EO zF11q~$V+A1F@_2$SQ%_JyCf04663PdbOBXR0;4*oCWc3iS(cIF@E(K!l2XqFOSuv$ z-uF6A_CU%<+entx&rjI+qcA?aRC;LCMl&y=Ogj@+c36t==QJlbyB1jH_tqE$12{5a z?3TKkUdj1VSw{JBcp*2 zyaysKRvobOJplt$nCwqC(k!nq;7?mlrW0X+b0mNv0^&u0WHbZF8YJuhH%Hbpc!U#5 zG>;n(i{|w=!f!!X?(%}Di24epT#TIi)SSc@$*tfYnr81ot+zgOCbe4I#pt&cO3D6C zZam_9o#DAyLkB;EMs-%V3by={xdA3WzLzkLF)w3f z>TZ|{rY)vdi!NYxbTi~)y*4D3S?orGc%e2j^i(^xSgR)jsxSa~!?*ff4-#{!yOy(` zrB`1y^?a|jrggq))lpTi2ciUoY4Rb4WTE$a9@me@BgZr_ZCPd7ESWcZ^&0%%^*G`j^Wh8J(Mc^JlyZ!E z<6JbeEK({DNK5lDB!r@j-uZ9sC)Y-evsDQp=6n;YPD*vR^qn@oPZge7?qc(SuZBZx z#mNMn%Vg-iCBoV-ANG%M^zd-fE}mT{X1k-v77Tij`Wr09(OTOXR9)!#T{S zewwUP>HS}kY~cP}BB$ypc1*1m*2&Uhb<#-=cakc68UXeElmNwbx-d!RirbiVT3pBx z%T#M{p})otH9arr3O6+ubSz2^G?Lh*i16}&IV%ooGgr^I>P>~)sD!TOB-`-K*N78^ znntKW-<)Jta4C2~6KQdJ8F-8;{S+L8=K)LT0zqvTGoV)IHH?IGM2*Y{BLjf;I%aj? z@S3#p>F`x8_ea8fTOEP-ho{I+AQua`A?&*%DQSTY`SU)tL4U44UYfJFSkh(PZuo71 zUNrnBr|SB=Qsm*RthIo}_`Eo6C1)N`Q^lQW3#UCV)=_QgBG*e&E$UkO54qh7U0<2( zS?KzUV?&h%Zd_Tnx8=r@{1`noP`eZOo5K*AG<01P4XIk5}QE9mPnON3f}J&>FFs( ze&VLm7)P7BHq}@1+g>!U+Z3C;pg96pbIM-*Y;|~b7(7Ok!zj?B#<#?Q?6^(pm#azl zlVFi))Q-1_;^siHU#mIQFVkDhsKpji`lu!9sYdDsir7uCscxD)*Xgty2*)d%vTMjx*@c-tQ_ zgu-)X9U4-hZZj0X;ELFc1#X5-N4G~zCPaHPJQ4zI`*_+-EekwRXA}=yblVep?*svu zQS=_(oQhikI;NIvwD%xg3S<{h(VQw=hspNJXtN5tNB_7!T$NA@g3-X!ZdARfub&kT zh$as4l=ZuZOcFK1yfxK{eSKc1XblthS`;gNd#U0W&uyL9gZerJ>njlYc$JGP+^|BQ zuaH(1W^YuX;VWcSg|#y3W5<~6Yvff8Das9M5PJe8ieU1aDXG>4V)&6{fd+PPIyDY3#-5{v*dpIYCh7JL=7Z!!Qxbu zK=D!u^i=sjZV&*J9Yn3e+&m|vn44DVb1?T*En&kpsyv3d2LfZKaFq6p86YsW&o7x; zjm6Yc#nc0JM2qdG&5rdD(GCGrJ1_n-iyqjR=?ns~`rvC5i`~?8ZkU*DGMc3~5lhE5 zvt={EN6?J0^negD=%?yt+5kOh6x7#Lo2j|ZEZ}XTHZ;Q|^3W})%i<*7P8br;2L?uC zO)Yjhyj9$C*4p8)F$;2eSwKyNVPKwA40?^p8Bm_4`Pc!UW16&rP12mTX+I5=wVIP~ zGImVYauS1P-sRXay+1{fc5pVaZ=B4<+LX2xtICO)CIz7VNrVeGv%8KGSik;#?dB#n zJ?I0>+NJ@d7y4vk%UWTs2elbuQZc?=q(g(6>0ooS;%*L|y|OW}e`2H2;QhPmzdj|> z>ZviYJ6Cy5Mo*k26DRggj8rc8W)>F?gDf|VBSlQr8Hz(-kA(`nVu{9eN1SiVHpy$7 zFzZs$yxMyt&Oz_t3(A(0Fvc?JG@LG3291Lv*?@#_qR=i8u}y7o&}}k;W509@OHQ|e zfNfx$Bn=zzW`=s0R3dJ=FT=3qfhl&0?o4UgK^EwlZauhV>Y}&aS>0`XM}`d60Rx^R zQ7*sMLa|L6bS%tH=HEcjR@FDh-M_0w&FONAMvXxQguhE}7^2^WoefHsV0$d)t& zyNVqD!NU!JzAAazr;Dc(6t7f{QV!0QYLpt8?5239atbQBIW=rR=EWa~7^XHJ^?=|y z?a>6YHdWYIpjdEq{rg#b*d}ee!=E97} z1e7`Q zU?w|7Y*bAXSjJ4!rqG{hDjSULYmIb=)HC{UPO(`nt!; zKo4x;m9W$I{V3zWCZ}bkz0LWM*1L>UehTpuJbzK zDt!i>&>VDISaWx`IdY7|OTPVo(Te7lBa!&}^<}s&<3Pm?iq24wzPq?;zQPAO(qF@8 zqlugHwc%jTY<@+0hD`~qwrAGR3cmn+Ow1i_@eBigjKa$gDIc4Hj4Vyq}gD0$W_9ogPLcN`8M} zw-=o0KN70{lbOQ);Mr!B>;^xrLt}_I#KN3Z3JWNC@esN2+`6Pm32&VyP1SLYGeuQ# zANU~uAz!ZA!5_jjbXIYs%F$-ClG8E}tL2u{GTGsU&8>>Zz(WkXk30|ccNH}hla&7; zo}X`5D&S%*&@lQ4@14H3S_P6T_I9kfdLP??S_P<_m!GwXV>dA9BvuLgQ3&YA7Y*X+ zHD|S&)4ZCQ;%E7O&9WK1zv5N~pVT-_S+r)^K~*&QTeTiRX&9t&R$1e$fVwMGO6^cu zg8ul$A3LK1dZ~=*>8yZ8T8=^EIqI==Re?6v0`C-5|1>vMhKa9K&detI18MR@rs&)V z&LAqzCg0>hnKLS3eP4kq>sFQGJbuLz2#e+jr?tw2j$UEm$}U)UuHz$x<%X%s#Ax8& z!O!$KMWb+tGE|olg5JTwFw+XTEz+x>%&n&RgHnpUkw}tox$J%5cu1vR?ZQJB< zX?>Kx%!E{b*`rMshhj+O5`Hn4ZHI(4Y&V$hlt7+`8y$<7b2lxGt^2pRnJ$IKIv5O@J9I{@I7O zJ6xWGUS-4&gYrVB7=vkelFP^T1)B)BTYHtUiJ!hEdt`Gfo1&q?(AGAI%^7A5NL%5Q zvJdag+3@gPYvEsb*wL-0K5D~=1;u!qz>;z`!b=8YTg1+BSTOvzez!8Uwv$@7em6hp zU|FK)0fvZ=ZEj64HDFuwQtFmKvpLXhp+UBl-rln65=*<%Z7KPw{*&dc0~r|gj4xF& zj3RJUqG8aRQW}^jUlIgelqDn!dJwVwCm0i?2RRbw6NVu%IJPaDwLttN>LY8D zh-#38DwVtpHHji=k(Ja&VBI|v7wVP82ZCflQ zEGw28>CIYhGvBPaHT-&<_dLWw8bGWy02OZ=yB~yG1cHf+xL9Cw41n1ysgVloKtH6m@FTwKO(` zWx*oZqd(JX#}vIdpbHg>9-Me;_&v(Jn7vc?5~?kP_J zz8?MUF*q_0p3zFuWPbXaXsd%Ndx>=T$MC*Qi><22M%5>vhAV^=5#vzvsqfla^~ zWkPDTHh@1kW^G{8QPPTV|FhQyIxK)t%p5^m05M4G7yv=k1^~_+1t8k*pA8^*9YN1* zR6d>oHoaOpnLcWC*yo=;`UrY(Nk-7)>4$;K0`)lUQLgN4h@5{Eglau#Ot{U|o^xfV z90G}`L=+Z5fcFTXdTC zAW$-xqx4nqI$03&y8xl8yi4Ck(iKvb;D)Et5|5}M;2EWY^b}MmUJ4V9_wWZfD)X|j z&hjeHdmtlZldpkduqk7e0s#loKUOIyqAHcaU@@^(u1TbT9u^I7En^kofW1yIUn<}rU@G>)rfTW4KtGxIV zi3wP1axW1j2a3bM^hQOf?_4J^>?Na@rD$269VxdzeVyQm<9 z7pi(isCuia((Hw*o)xNIp{g`{p{m27>RGBvvlptWJyeA{s!FqeP&E_>{2vYaCn==V zzKifaO+w>?FQ!em#wt)1bFthh`gRsx*g@t|Ba8af4n0?~7dQNskc{fUIn|%dHW$o< z%!eU-w|=RMJnbq|=ipErx)?Jq70NmI&h{e`^gex9`kF2cq)omN4;_;%2g9E*!Aawg zNu|+7Z;y=DXrukKpwT#-qNbc^8PRAzOs%evtXU)rQ4(65^ll1zc@v(-x8$Dt9ndij zyAQ)SvM0|kcs_V*Ai8nNi8vJ4tPQuw^1>LrajJ@G#@;`*g(Kt1DzumDVajj#S|#>J z3vwxrx_5xR)j*8M8HAUF61sSxh(`#&$;44b68$MBF~X>&MyNNbc&QH8>6nX7wNw?V zMYIr#p#?Wt(3~#U1}Af14|d^MEnzn0NH{#b@|y?Hy7;$)Y!ecHjtW!I3qfOQ=G98| zSdBR_%CZxjZe-d2Pu6ci!ib5OhIy!Tse}a+{2vNa{@Vcb)B}&BfrOP6Ghq`e49bPY zl?coH|H$w7ry)-}?;W^=x@v9y|5^x&8!NAywRtT$;5)LC7+m>XapiRuk4;ffx?5`t zX|Tv9)-TUFzPh=8Dn?$ykoNh<|2RuuGi_Y9L&C9$sE_xDHZEh?S!J9O-MFl5$B~JR%gT0amWHx|mv@fm&LK2~mbHM$ zAI6BZ@w;*Bm&JZmoT81(ULMMNpQ~&(*P#F{D;68K+dh=BY4Hyr;=6#aY=~2aalPwyUfqoGwu zt2kP8XpE&pporcrAN`6){jzw3L5Ddfn+MiS=F(lNwVuq!lhOqiE03eJQU?0ivze8e z)Fm{?Hd3X@*a(C+SUSDMz2Sx*{f&}!zy2EFsP8-i9`civg2mA+UScYqx@7IJXSK!; zBySD?nRZzxu5U`)aB5YUVxQ2z=tL~)UjeGW#22$LLputq*R@Gn`Q~bskasZq}fX&2#tC-DN3db~(W?vYd5mZm_B(i|WlD_Nr z(2&IPt9$f*S-FhF3WNE7HA@vEIF_*?1i$ z(tXr=8J#tKn)e_*;t&&o}9G?4&vA{hyh%X!rai^5m&+K%V$NL>ext`)?x6KX0TL zAWb;zS&^nTmNam)_%SLxDDasl4X&*Ckw=lni@4`Uy-ghWG3xMRRBXhL5|)vFrYkv# zkagil5CU}%*GHZEI#}pdzdnz>PKkq0H#)i9Wy&Ar<#wE~eH526fWYe2i{^xR(Hr19 zFZ&Jlf_M&_%JY=jXf;ljRhhTUHGGD*EHsK&G$)>56HekRmvPxV$K~fQR5$99#hrP> zOIDm@6Ic49UI-~m1~)BfP6R}HnP`&^xQT({6({(fPN0SFi4G>|Y#g?#W?X#1l58K~ z=8HSGg@O-lrgar;W_(!svsohm0D#GQPn>twcmWwrR=s!Ht>BaG4URe%vMF@7)W2fH z8aQMuxIx$ZXF6Nm4MJ(kMMPlJuO0BzE0q`-`cYpDkxLx(&kq&4AD7^QalcT|fKoB4 z+)Ix^y!G~V#KycLRQ}CE2CGUMc5Edr2?L0%IDjx>;;-NtrOp{jeW17fn|0mHBsiHn zF|2gCe-a;hm$RD#Vp6kX=fc1qTxmn=;Yep!aYglRjCI$~juU?Bp)xhtuDnw7;v1MV zuunI9w|3>O2Y6&w_6AF&i+e2h3?{DRrqDITlU;}Fg<@NO*QG+y1gpmG4g%aIpN7%Iq7caS3*Vl$8+H`fB(`1TYN709tn8EkChtu2U_g(6^0aBJjH~@c za*2`;`DDs0Net=M3l+9)A@cZOo%aFR#|!uwCz%iVz0( zz>iImH_|*r^`jx^Mu8@RIO=WxKq7A!!DfnQ(zw>syL>lXmky12H5^g*H>==GWnzI* zuZAc8$pNqW&kwkT_t(qo;&=;9vqzgkG!W-eJb$o$cqDR!$e{6C4OYI6rx!0pv|B}y zq8A>}(@H&YcMi#6C4DyS#TvehbT91T?_2WWM$sEsgyq8ed&l_yX%H^yM=-?;`@E#( zfswN33WuBg)PsZGxe!1`1HO{tiNba(t%+h}Vo)|xRA7JO+a2~AGjv?aH9biQ$CzUj zb4Rkt4wCI}eC#M)W~Enb&xpscP8Ry|u)`xPsiU>AJ(Vi(xAg;~ZjnGx8Bdc0*lx)v z(H(bW^TeK!E}d=M>}Rd;gwbH!vE7KV5a2O44I+ElvXnmc9z|R%)IF7=NHcYaabXf) zC6nU4iX+itnSk{G$Hg1D)fa<}ZvhR6L{uyj$=x7i(Is~rke2}T=r_(%25^9=>znAg z_i!$i(73*VAKnj6Oca-IwonTg7Fae|-*F5AOFpP%513IaAwX5!+(Ca*Kf4wmTnepA zP~a##YAk>QN+N(@2)c{Km?rk=c8Ye^n_IhJ|7wjd2(bi+{Aif;HSko4_6&zTA8co9Qh^ zjy`F%S|`~x*lgag;Qb++rgQ#!Y0hTM=NwQMr&ZYRZF7Vza+}&FIu7K_HZvP?j^$9- zc1^n5oD;m8x7`*{VT=BVP@3ZkThee#&f5UTRjTpMb; z`E<93&9^<;Zco5N^a5t~qTyaGw>NO?P54n_=C%CL&OT)A({it~*V^kwAqgyr9rm?- z8;=LfReqz}&-RmdxqmUoz25eBZ?M<91MCfUz>s?*qaSE*v;*7jO`cQUB%%G&a#7*U z!2GZFX8YG_kWPPZvA3wdf3trpt>jw)>8)I6QatQizO69#?_~XZ%N=BIvxCYGSUO!B zxq~Sg#xn^o_4;pJ27_-n zh*%Idh>5QBKy>2{C*{b@k~?O~4tmQD>SYIgc<_DJJBY|6)-PQD&38NwT#qMfJg*KD z>^G{u5@cmU+1JFfuSsQJdLehRO&mmaI8z{uoZ*3)3Pz@pHLZpCu!m9gl_E*g%f4om zeGQgzjpuH~B6tZ@5q-ZQ>*vGpr! zO7BqNIw@|ojnogg_UCQ=Qk9%;MIAR9-=!Cf_9rx~lu%zWi#P{9T3O)XCs>Jcw=F2s$&Hpi42ymJ*tHBfG~>cIhabOx{5O|j{#Q9(1-u&KtD^n4D~ECW+BZIea3ffh>#*=B7JG8d^b zSt79GW`!j|e^!wzC(@jH6>fAFAJWZn<61E4$L=s{n!DrnB8zZm!Kmx9nuQ zqH11cMdN3}tD8sRJa44sKfIbIrNTkm>~2GQZJ=!ccFzFpUJT|{P0PL3UWd71}7~W zZ8rfV@uszuGA~=x7X~tL=6uevrdUUg?X)*Gj6?7xM@8E3WgPgjt(QrSQ&*v{&1kq8 z>S}!b!oK*C%8_?TF}?}+Q8gXr(r@F2 z5VIZ|-{$rMz2x7p32ohNU=u4aI7_4H1YRD-!o| zdzrm_vD?A6w;fvU739nzXU<~mHx~RDr0tdVGMVrwnDB*2*!H#~5=PFhw*6S^9m#ql zQ-w^oy?Q>vG}m6!cDti#hHPgWTIA+aVGr8vX?xh7`?|f5oB3@dX?NSZ?Ow|)_Q6W; z({`_87OVwJop`^(hY9K2FoAvb)rWNL>-M+(f>7=0-au1Qc0+X3e70hj|tvqLrhOm~fT|8xp&$-?43jIT{L*Nz02O+b}bsTkVqXi^(bFZWbSZVV28Kd5hRZ!d1T8S#o$NV z0@t>q-9l^I!uf6yS&Qu`cZ@A|$J#M=?0k2eEwba?ZnuYgKw>`so2#L4k|x0=f@+$k!uQ`psbziOTu+xug8T5PAr?)2D5oE{IkGh$mE z+Zj|kQ=@Rs=FHg6;*rI)xpsDdh}P%$an6nHoYulx5oC7c(MCvY?OSI3b(1? zc3*Hi1$V^8|F_4-xI1Ix|676YV*==|*gh89UGYNqao_e1+I~U>pVXuKRBWG&-KS$C z@oCz8Mn!kW_KDc7jqUE(-4h#$dno#BY@dnkvq1ehUdea&#zv3##*5tNef9f%e_x1= z#24ay-Tkrg|L3Xx#n?U<+ZRcFNwfcQY+s7)%RD}y*+0-B^MkS77Q3&+_F(M38XJkP zGVDXb^4C;kU!%>}1>iSg`+DrY8QV8v_pR7SdM8%uytttf>mv!n3}!@i4bLmX@ahM_I{kYO7D81uGmv>B#? z^3^gHsQz*FVqj=X!12YK2W}6gOG_eC|2o{E4=jmvMla*YOOM=^wq-TOR$&ZcsLHdmt%nGmVm!MSd(Y0c31hGrR9CP*fTNe% zwk?9Gml8>JF;{v8O z)WQXvA85|6vXrsOXS?F}RNV0b3mVmsEUfC*=3R>WhXo)zQsS0Atq=FP8Y6e{=Y9P) z{L$sFaqbZeG2u(yacGJdhKFj&kK}k3Eadciv@|@GShT1HoT#pMsUn%+`VZmy$05YV z^*3JHixsDE7YBcSsjp2GFx?-!)QuqI!Y__%WoC|vx5@X+!kQmU*z`khZkty_ZxMzj z-X;pzG6dU0VQJ51+170Wffsj%ehHmz!^&P*;PautwqfY)Y&-YTIvg{bD%;y^zq&`# z2LNri14HlNhkk{0S?)m#cXM2?y94_rMCoiVy5fZTDtR z{WlBj<$gu$Us=ohwYt#`gzw-j#rM3p{9DmS)J^bhZ*Ba>5A-&=E~5xSh=c6l*KHI+ zsN)-b$A{XX8+3daA^AIi^&KtZiFXoA7{SD03MU#*`TnbzqWHA$VSz2^^icf7XB}>b zH-4wO`Y|cZ_6R#7oWz=;XRL}H*|^VF0M?`Is0!QsQi<5R3_~z63vJPmTMS~nm1z@+ z94pw@%GM;t8(qiS@f*tUV_osG|BMXZ@&9D_|H<%J86J-R?+J0=SRtPOPZnYXZvjVJ zSPMWp54R&;hpQI{SFi1kMiuIv?o!0t*4|LW7uv$HBEHBLjS=z1ws=IukFjGa5kEGF z_;GgZh^si{-pknUv-jHj+PI2KN)bN+5$D%dm)g<|Mf~wRpNT`KBPg#J5%qQEVvC+* z|DhVYG}n(BVP9#hbp=$7adc2jO4obvC?T$521DL-TX*C4Uh(n!)B5o-&Vgz1YNIvC z*KvY!wEeaQ^U!9d-$Z2z4=c_>WKnw|^9|ztTlcz2YkK1kUPq$y>&5rHc4FClgc4j~ zXoI{Or4u16RvKoV?S>W};HEZHM|~)K#25Na2b@;cij6wZ-I;T2HiRYrFrm#U#mL(h zE%}8Q`OR&sa@F5Y_(jZ)ML(Ox^%Jc5y=V`-!)3ucT=X34exMIqU!i`s#(30Z@o^5f z59WTz?LeQbtJ^EutoO~~e3d+xSuFY`TH9mMFRb|CYwk=|wV=-E?Beln*K+mzRTRFe z<9O``5@qtkwB~9xx}ZYQ!Y7=ELugq22&+F=ZlUeo_+zj{R2!mNa12=+Ol%LC@~|3T^*3YlW{Do3At6 zfW+R=V#V-)4cYuNd8)YObrp-p#X7dUEiRYKLv;q;IAD1z9X@(&#M0|H8&^$dyj<(IYGGX~(IIdd8WXs1t4nY@b(IOR z3!5(>PtE#RVUJmo7Dw|EZyT3%zzss885%|*%uL6nhHRGcP_0dq^xM#F=cwsCJg{p8 z&*lN1a{ovEsBJaGs&vVqT!Ud-m+(Yz>B`|@gHfm9kiNL|#uU-i=gH;@bEnN*N0g%;7T7Pj}C9( z;xusax0g#vh>O#*<1jyQ@Y=xt8!#}Sy;Y0g|A2qx#-`81zZdTi-%zWVH(@3lo|s^+ z{-{LQDuH3gu8Y-Jaqycz@GME4gy)^(pm=NI*$_C*_ea;q6HAp0Y7^$eqvLF18&%uO zCJ8rt=tRW6FlH~2Qca<>4eS{rB)G>B}*LJ=y)9-5%6h&iI zYU$ldjRmBaAGGonon>P!8d!1 z@XdUjsMp$lZB*YL=)Kn{@Ub`Si^ki7*ylCj7{i|KO^p0z{`|>>wtEXv(VOfogYMrT z##`C|4uExN78l&1LMIJF%IF_3Ogn4?e@Ry?epEC%axFX5T5UIa@r%BW2*el?F^;4WYhUb)9Ho%N+VffXibGV=c8jUKxFW_e zhU|i9?`>e@rY>n9c`Jo@5bzx zxbMYA;(O5WQSGbPqg497#`!^P-;eDFJpNFq{$WYOyF3loshh`QTNk?@#r9b2ejFQ# zAHy_1QRByB`$=q%)A$KBexgICpQ`l9*nS$@la&5Ur9Uf6f9j?5=jzpd9+!gp3u;j3 z7u0F|Wei1sDH8rFwqM5fD@gcjJ^sc&{)We=1mSP>=zbU5Z)5lS*hu^y2>+m>KgPzb z2!D$0kFoo6Y$X0n(bKX0A-1Q1>@U9jufBu7#YW<9Q1tIU_Zgr2Y-}W+g`(>TH99%5Rf(O<4wlT*U+Dp=1`XPS^mwCb6p%cWq+VByLS&B-SK*x$89S^@&}V*!2wiVGaA?q+=v+ zNYK$YCU!$&H}c~AO?tf9KiK+H z+?|P$xRaufC3ah4A7iw;eEG+H2cJlc#3zz{-6wtSr+n_G6C?5IWKZ`Q0eZJS)+Tm$ zVryxCPhwR5Ok(%I9G?|)d@ixiCiXeX?oEvD?tk6+LfzffW}a`z{8 zQ{uju*!_w7Qeq^&1dLx6b3C9Tdw@0%YBpaHS2(TSVKON*u#nYPGXNF z?z@SR_%1~Ho_c;XvF|1JC_R5)J%4|MNI&2Qrri${`$1wqgevRw_?UlujK?1d_8;rf z{Uos;C+_jYNIcFgpHR_H6Z=u(o=ohgiThb%Bz{KG&l7thv7a;AFMRngeFwivjKr@X z(yx8)Z+z}kiII2;BK=l?{!SmiPwaPz{hs!JK*SRJZDN0bNPiTO{*>4s6Z;coe@=|< z|4iy>HTp|pPb1Sj{#8@_YlldGOKe@@{+`(1688)mA+cwG@mXPPy^3r-ZH7~3b7E@4 zsau}fiK$zW8i^I@kXxDBv*?Tzoslxms?<(OZ559vr;KxQ>NN%Zh)AnbTb-6fIz_*X zc?##o^}35fzxR`&FzVFQNS>ND{yIjNo|d9KPfzW%)J{)Z?hHMi=^xMJ@hky&wjSL% zshyp=b5kR6ZaUwcr=s&yJBwo)shyv?3sNI-0Yw+4c3x^10_;V;{9@n12U8>Q!E|4D ziO;>%=U$c?iObSG-Q}9+75ca`wJTD)lJ*};jmnp&_MvppUBv-)cXeu4rFJ!C*Q7@G z*O0najn<@gZE9DC8&V^212Ep0LW!GHWH-^~X3gf7 z)NW4Qt*PCTx{str;v-Pvqp97P+DEB$o5s04wcAp=oyR*g&K)Hs&LCKe+@0#?W2xPl zy1P>QSn58W8i|iH;3w4hlc{|owNKLcQ)>LF5=hQysPr?beLA(zP5F>ZAb3k(O3{~JPVGyneHjLLK#vdl#|L@*istuKJ-UZd`zl8_QX}y- z=J$0KeIvE6r0$!keIs?>N{z&~DEfA4Ur+7ZjP|fEf5dn2ozzHt2Y&dj&;6dyeKa)^ zkHQb%7ob1T2iL&-AhjRTeqCx*{(frf;D^V=4?jxnvDAJ<*^g7B`yZ3~i5fkg+D}q@ zoX00L#V1N+qCHZ3Aazfs_S4k;EHx581IC|=AAX@C`vq-&soDH0wO^+0*Qxy~b-ziC z#Bbn-r&9ZQYEMz=w;Jbnsr@#!-|_f+jr0334*iH9{*c-qD#`q#X!J+X$V+DC{*>CE z(#Er6#PQFPzo%3Cb81h6@4x8rum16`JpN5k{auglnbiKCx@S`(@htGKSJ7~0e@oqo znGI)dd1fS*XY<{P%+{k+vbJ04%TLPG!K%zitjhLvC;QyhKKGQ&NSu=G>E53)xl{GQ z<;SOHb{g$Z&y33N&+PPU(4E1L4!SclJ0r6*DLX4Ox<8B5*=lr7W@l%14v*(%pygaH zI|$+Wd71qsb?0YxUgkcK8Ho=7;|2Uyxw}wBb|Gyp;#D4Zab_1~?t__KoViOfBXLPK z~bEj&^T9wap*_rzf#?ND6=awcNM-y=B~!c$n0tcyhe?$ z&Fq@YuBGuBHC|H!Nf@Kj>odD9v+F7Suu4B%mY(Lt@dov3H)N$a-bfAV+(@0q`Y{x} ziC25v&6(Yl+09&2dy5`#^^dpm_z^+)Q9ZibGW%%eZqJOw?Lc^kitfzpBSbHm-I=+& zG9z&pMIX=Xj?6v|WS{WmpY$DkDl-zFf})@Hxu5a5cV|Z8ZYa7|le$MApUvzZ^abrd zml>7UX7)KKdao$@`ONOk?DLe}ml@sPN9qe|bbn@F$n1U|zbJHku|!AYzLeQ5nfr2P zU&`DAnUQz^7#|cxzoH`h3T?is**uilS2Opu%pS_z*E1vWbtw9c%pT0_8&vwH#`#ue z-^}b=Jbqi_d^?OoKceWv>gJKm9?sl%GJ7O*-_4A~cNy?|YW!$s-^=V#8h>Anzh450 zB2noNGy6eiKcsY>O4pU8{0iT2o6R|D;L%Ssza$y_r2t`@dvHFVZ;+)mHknYo>jyR&j5aTWuft;Xl%c6M&((D+<6J~uR`;5?O{pWAu4olofp zRQiFk^n4$FT%caY&8s7c+VkDGJ5DYu(xe@kvuzA?93@+L#C_EXB9%#H4!B=s{j`gv|Y%kAep z{z6#zMTrH}M{Zxs-LG={W$u2R8;M^7<8MUBr&MH5(dM_B&F^yiZSH=b+wXGshulc~ z0Yd&Ux8LOUM=JeES+uw701|&bL$MybkJ&(g&SL05sQR$E^7s1=POTYW@pp>oSISj%$l838+7M#n}s{CX6M%IJj%|m8Qq^x>H}(YLCro;vkQ2< zum&zJtW_?{MKyaicNf>}qMG|)%}9I@7%!=T^Gj7^m(u1k&F1o&T~>2f)a>$_yRv2^ zuB;8Y57q3Fntg~$S81H9Yj#!5uIBL?jdM*Hhkk_fYxUOHwd{pQ#XZY~<~20~(|l%) zKMzBR8T4?SDqTmVncRn5{>SLoEBkt7dk=G_`*5u=cY|_osI}aUHM_C41$_)h_Tk$2 z`kP|*?U+~Fm&}XGpZ?n&$WH+-_#`>A13-q*lrAv(U+*SGs z^l0?2%5L0m*}-ZT({G}MSs!mCozCdE8iRggM$A_0{rR!|9s|5&WyTj>E?r{jJX_ra z41Hz(S@%7UU(rm-E0gh3ZoRP8hWEX6NmDJ#DOs3i|(eL3h-aK2yFOh}fmF(cx ziSpuQebpTs>$qd1!XZKinG77aXa{2Wx!+Y17P7cP5+shv((gf%#R=9i#@DA&05v&jY>w^KHIJyhXVjU~y4 zcwp#I%myA!=4zL(%os;%%U6$~YyuU}R)9&f@5%<18abG(fslArp zm0H=Uu9pCjf}B6~AXXOxyk||bR&3vDtQ7wgCq6A6`XeM-AGH^R-*FDaDIr)JokW-Z zrWIXP!j&=s4P2zqfpK`*3K*Efj-5B?>zBmb6tKCd#5HOigrGSTxyJtYtTXN-;2seD ztaZfu)a2*IkJc}36$k6SAW>^gd8xYd7aJrD9%PMQ=U&kPZ)NctX0<@@H%{_0p_Qs8 zK`Q!#2Fu@dQNJD+0!- zMef4Q7g^55KsU|fHVp{!&SJAg&3r+isFAH7nODcq|-)#xKh%(2wZ$bxksGEwq zX-VA;$oc*l)s$4KX@sDG!#4u6ge>-u#T8`nKZdO0v=@S9U4W(F+6Z_C7Jq$*Ef6sT zEbmMeu|maat^{6`?LR1zsl`~4tc|L3ppAY~3r2y=D~-2yR<87~*77zenW+916<1{7 zE;#_zlfFS8G>esUk{+Z>UO!%!kosB&D({VDEoqcdwR96kR)0IW8&4}51LWwZ{Rf|G zQpuS5qo4L4Tv&gmr>1+RL{*)vD@9dCCoc_mR%s_8)!{z`V(*8!sDA1_;JdpTh~M_< zuo>wCtb0Ep90q><2vSvvyOTs8ENIXqA zhdrw10b`zgyGo6!U1$@J>D*Hbjt;%AV{oVssZWx%JgLm4P{ya(HR!T=NTrbw1XLV7 zythwGh7rUA!iCj*%6GW}WkRPbJRrVE+@;A_5=5SHH8wnH-Tq^LZiO6l^0N}|LI97! ztn9V|v#d=M@)BuRuUnlk($jftcF}pbl$-9X`#n~B&%Ct}#t+yA*A(qmv&*Z|mEJVy z9!eB+__6m#B7e&?Kld)%%vG#{3rK);1O&-r-H#!6LvzdCV`&%z+f$CwJ7x@?G=>Z< z*MQ0XbDN611XMsaFI@%q?7Dhoh4xH7Teq@n%BF7019Qi2pX6;zm(@Af?-{7RpsBI= z@e?#?Jdc+%WCr;GgBG)wf7u(XhMz9^I9Ix$r?)gCKw$!9wr>*jsc3i8O2$*|(utwZ zil>Hw50^(Eu}1?CsrOnK9vJ{w?i4&p4vP4K3!SX{1TuNn;n(g1ZaQJaQ%Da)f%yBu znIbp@lb%%cBQ)}pYNODIu=EBp4R{PJMgwifuxWn;5N<@W9I>qy_nNTb4(k0ZRg_4$_AP#&qrXc@Q!VUY%rV( z}?pv5rd3 zmZn~<_P&rxMO?iIk5(ruK>3I)ajTuJ<`7)gkzTz|6#h}IlJI7|IFXxsi{-;h@kVg3 zxFIFvkj?M9N&&>YmNHtEH~UKtkVQPeMn7$+Si8bShv|O65fn|(_@j-<0rVa?s$*d* z6ry5bBjP)M!CX9Ms8Y>>@Wcy4*Qict1}l}#q+v$-ubR=>3pY~*WF^RcISqyyoh5XE zpZ<#LnqZj5kz|ePdJ?Pf}fdGz#jmA{xB0pMup2?Yo7ZgHq&zsE$&s1!+d{ zjvMJ2g}@U%OAOU{sTXlSO1+rQ8^6j^@mWQnov5@qp1Ba8_Lu$;Wr{f)IC;$pXc#^4 z8X^}McKaz)j$&Ba)XzpKVx532ZND1zMembWR#h-RlyNI4UGqBQ_yfGtxP-x^7_ya3 zj>s=6)a$Xy)bj-EUMbMXn=Gl~dn$k|X--p!NVL}C#u-?Zi@-c%17EhZso$Yi zH<=9prc_@yPk^VOjLV;iy!#31bc<;%L~K;;S7Ayal8+vx0oK)n2?cER$|ZC}g0UGR zbOb1?u^Ch7XR?nLISe|PBKgA_-3Nggp<#_0(==(~$!H z-piL+M`w-XgM2Us!RihxYMSHniQ61KhW9DKNX4;YU-%*n+wC;*=#0Y%lMY(N2Gu|AZ^&b{X*T$X04LXJm2(L*(zB$ z*&g$3%PJKMwq5X;Y(`x($8=c9wQc6P*}cqhogte*!O1hfT(N?dW95QxvAk(}A)#!U zxu7a<7Hli0`>swjJ!kqR+p=~G+jTee-ZGew%> zux0Dc^@9LAaN3fBhAD=$2U$m6gM1MA$uQr;mw1L=y|wYcguRNP`0wZTOP00l*+EuY$LU> z_7yzeW7nE?#lir&x^0$+Ej>@17$)5xFOeR)S2DAfZd-Z$*%s1av;Zr%VwBvxUbKoN zA7;3fGFlB)ym2<@_^_^0f=;?O?)g?x&zcCKYAaAmZrLms>~X!~n4^dhY4o5oYT5-b zS=L^*uIzeVchH?~7o5G|H*?)I69NkZ(QJKWrSt|Q!)NPU$ARhOBJ!z^A%LH(a*gZ! zLJ{gA*y*DWy`e8((?V@{2BV(>9h#&w$VvRi3p=wR3+BPwTk*>a(T zfP${oF}obI`iyF_H9JzUb9xkS)F^U=7$1Ftt5Y!zPFEr%KG<3WU4a zY^BV0U=_2%36yn5F*9iTY%3#7-HNAU8L((3)J>bLiHV41iEXSnL6p!$Dilk$MZOHC zQW1k~Vm=_sVL5^fs~F9QLCiwGkS{=N8PPwA)|;TZK4Nzpl5;kcR;?zJCWonx z>{Uvbe}SF&QybM%6ykXk*MV{A)M}-iLZL-0YFOXL7R$%Vx|b$S4t{4*xpo$vZDu+F zU+qLRha&y3q~!DPb+8Ie8ni%|H48#5 z6+wjsQik;iE+7b~t1B*+L~CExvT`&mShWiyZb`>=ik2LZ)|n-9s9+cTf{W3@{omMZkr4l?UL~ff``C8%V*V$7nthMo68j1J3Lh5> zR7WZD`LTy$>)G4NSJ{X89`>3NkKGx&F}9TLRxVIJ%}$ChDC^XX%3lOjLz=--Y{rZk z1Vc)aa04AE&0wu5)bmuFDYKFdU5q6)R5mb;ctTFuGCVX#1xRk9di>_7vLum{499AH z)UJANtRlwR3Clw=AmdnDU(*yYT~llUj?sZ712T@a^)*ca+iHrfgykU_ka5JnnV`;` zNyoFNx_arnv$v~KJF1AW>4fDW8IWbc*jZDYMpzz_0U1a9>+M_KzhdRUs?`^) zy?ovJ4I8P|>&s;?j#4i$ z3tfLP5aZox1 z|1+*5{4x|`w5n=M{EbeEwiZl@xOzP`(*++@YMUjQ>QTjf!FSbF#F%;qRh%#I=CYQf zjj8vC6<@CFQG}|1hcW2 zpjvod@WyK41%U|_3HZ6-pQVBfotFgvJQeOG)qW}X+B%O-WAVgesJR)#$$!t2KLmap zSiMJFic?&bwI8S2{XDgO1eQkeDQb49qChePl3`!ax~MAq131z zUU8c0TAvL{y>Adt+p8$CrfY4+u176|sYf7~Dd(jgE;9BKRFEB*#M%v!9RpO`eKP1E z{Zh4r4jL^gWvC9NMK4pS=K{PoL8)s#m3nWbmnhA*ml!(*0MY!&2dR%$5Z!1HY1I?5 z$+b5z)&)Vb_iL!h5;U3pYf^Ga*n5{`SV9cwp<@TtEgeFsWl@>29GE~()1bzdeLrZ_ z_|s|$V^kVr?Doiq@25`Ykgw2Dm+WXx*inb0w6+ z*^w+^0sR}s6kACGgMUh%xD1`dr1vfh{naHW*qUDiog~U=uE-K=J^vQQP6m3aN9gud z*#yfP?|?1JW`-pWrNpaL+7b#&KTM^qDb%&81dY*y;A{OIj=zp1fqpnt~p2hLCz$EpEM_qgfk~-wvI1uqZPxM=5i61_JFQHNV42eS1AR_Lhh(KwP zNy>aSjFuph?jlB(dgNn_eK&I6EhOT8ik90YqDTk3E}i$K(0OU;yr>j-=D|>>Ua7=a zLM39GNXkQ

    HoyFt_L_K*rocP~JzC-y%i|iQm+gI{HZ8Z_NW^3&$#N!>Q1tUCy{i zDT=VO<1>sM3h0e;+MEn^NXSL&d(ym?U3W3|1BeE9Ot$)oq%&~?h^itsLzIYh&{e79 z1;|alj6)v&5V2_%P93kK+<7&s)A0oUW(pn|;L>=KP5%b)`Gix6=|2R{5N=2^{7FH^ zz6=IUh{K@A6XJhRN+|Nu*R>ItCD)_PZlX5Mh@}(B>8}D)$R|>4`hNragd1WkSp@hh z2%G?|{Ef7^9Fp2Ji^@lR|tRbdivhFM!gZ zbx=HXoWfxi3GH}+5YakSSe|Z-SH(6a*z~u+{#R5sCKF5?BU!NyfdQIDzMH(P>nusF zj*-s0Iw*h`8*K`28p@_KY*5KlgR~ajhDD1OuANw!XmxV1c+dj!Hs&_X z?}eD8G*N$hkTIHOKfwf{N%FOi!9HXU(M1vVsr#tIFukcp9h*Z#c&VkdDhr$2aa~VO zpVi!|Tr(Xyu3&@h7dBkfpyJ7#E6QLyB6J>TtMHI67BJp?DR$FhFbOs^TnZSchvP&i z+VEy@3OKh~Ky@mEZrZdpU9z^}{27Z?G+}W;>rNoCP>n2bG2dzf2 zi#&t37VS!d2pY_kzJd>CohPdpdvI=ai-?z!)<45pG4{t8rn92F-P}YcXhVvw zMU~exW_ks~bIg)A;`#<&fO=Xa+g>axcy72eH03?rX2@G}41?SovE zv+@Rh3VLrkDmbq3F5Becr@E|f(9a9byWCaezV~vd=%<|b$c5AuexrJCBE!S)On8r- z^WH<_ypoj-ti!cKrOO;|QAA5h?VBdznlHrNI90U7gqWozE)nh8QPFz0n2U-;Ms#U! zi8-3jKd4@%@J?OCj|!nBJ|&WyH9n$VqTsJvi&iZ$PfD7jeOOEbdpo{8^FL= z>=v=l(nazp8mbFhHJ-mxG;91E9pZe!wZj@WGoqQ#)kVi?(F|5}bBW-IVT~IZsKDo= zMmr5{`HkvAMJO6ykWo9aa>FRPW^)krR07XintFbln5QKUSE0HP*H=lNjou@y5ROF9 z<(@B7L_DSLM1vEFVbPL!Tr_EKinLY{oiO4`^^=Ms(tJP{+5~i*0Od-Bib=G9U8~zf z0;mxdwZejq#KmyJi?HOaz>tk(6~9Q=_=ZHDEVu-49bBU(VMi*NT{rs+~kyri*Du zMXxUge6fOP_rs_qL{6buT6ErXDc)qRkggr!m+X-M$wauSJFpjA*$SjO1?rDZKuU_D*Xm>@F(&@ zGT$^o9$KkS+Ddm`d`_*cCh0a;=i#~5);(0E*W0=$v=!vD+xh`wI`<4)-=FZw*m*G4 zP_g$PC@@xAsqyO)M@h{^x;i@uMY=8Im&*C|z7ElLOpeKS56I9-@RQghmPX)!FsR5< zTpPs}*d^DT`Zg_=zoe-Sp( zI&vOX5SsI-orl^7P}`{SUy{YdcN!aLgjPY#eW>9Yf0-=0_ducz(}%x;W*p5@hz~j| zv?APn0P`y{m+r6mt7n?~Ice^1VJ;BN4G|0rku>)#)Tq9$Wdc+(_tCSNduL$oAJ1;? zL}2clRddCB7+m9zI|8f!LRNn~v>Kn!ywmEB)>=(Z6L=LU*QHCReO0ub5Di!bllX|J zLemo{17&GW{&jzbJb9aPWt@c_FoB)@Z*Y}7*-dzYy4->67hBv zJ#}mcg8PDtLl|a1-d_`D^ti^q87R9N%s<*siw6HTlmdjpKqBr_;k<~P$P*Q-eM&nb zlE-ji3&v%-9GCA05*~*HKu7=*X`c#^5Rf5(sEZ&2*FIFiG)%4Uk}ps0S5HF&V1igP zfkfv76}I9+A&VG}BN~4ShEC&8py5*iPYA&SB$_9P-Y*M4iARZw#ZAzh!?N>)WPb|m zPXz2C1UnG1gAVq940ZspC$+<;PQm6wh{d~c!$2$8V}XDlKo%eb0EzYq(fTOLXb8WO z#E@s2^E7w>!2=}HxX?a|@*#{e|1k(%ba6R^QG86}k4S}|0mCB!ZwSE)L<)lr zg#$7a1_%|d_8sW^aKQg8L;->yDAf01^xdiP=Rlwfm%LRuE<1i6t&azcAp|23bqqQ> z4#?;jpvKY1B>M|sKNhfu5bQw24m#KaGS~rX*dLPYKL`6m0ec9+4n*vrgFPUF9iWE& zLCO9S*dGkoLkM;tVh0`U0U7K7U~i`t`GJ7r7hnbi2apgGfmgl^!3f%4f`luX&c75i zMwuWQQ;nF=60d3e{{5%H#DAq6!iur~X<9g5R&;d%T||E;QsJ8!Jmt{NI)gSb8R7QH zNkX`X(jR4pA*t9ol{Ih}WpqaoYsXTc*A3!Y}ciN{Y?MwSw4 zH&7Y|JpvnU-ZqDEzmBG|oXoYp1zy$+#M-6&BqO%j8gs!&tk0``YV_9fQ|zFm_(IZG&O3jq8ma8+OuZa0dZ;H9)27H*DWZ zu2~MJx$Q~8c($aQ^$tXa}m_4Q^~=K7Wo z4D>GVUpbUrfjx(Pz5V9u?7+aPRoQ{Qe6M){b{#Fo?=2lM@{RI9$DImWVi) zGy_9Y_NTR4*mq781N)<~qj}irOotl<4N1qUJ6#K!bj9*z%bF2K2olFkje2*pvxKn$ z-kIGHUadymLT*k=cvXpJ^*PgO3Dv1PH)ZT`&3#%E5abDJmY zXwEDMTvnhrvsA{!SXk49qW`=aWn_q--xbPuM;tFo*Va(5E}mXXsfoxXZBfN!*e$KH zN3pdmQg1SVx+BJ#D9J>O)lldWasz5_%o{52?Gw35u{gfGETZIaIGf4 zT{JteUviY(QpH9{MKZmM ?(-0WCR-V|Z&b=;zxvn~mTKynB5d0I?N|I!8T;H)78 z17P}>CG$B_9>cvx$Sc6wFlcHdh7C;ra_NPU^167~$@*|uWaC2KcXR%R7&YIh1wFhk z9x`7M29In>8V-_Yv&GVtG+!v(u4=+fnV&1T!Ifx}CSz=LbCoR1TM}5n zqai$J-LkbOjuECyxyegrZb%ENvdOYFhBXLI$ffc*ISjy7B0_nDHGGD}Fgt>E93NQ> zx7Q42!72EL=aoj{B@dh7u@7Dg&L3=n1aRTgA6I@9v^QCWHu(iNI(ge2D~f!n;%6NV zU!dSy7FS4Dlwve8H_1A$977Aw(}LC57gAgWEwZDdG1GSoWAV`7eev+NcRX3Wx4t=m zbi4Tv@$iQ0Lt1bJA$c)lqM-7x_SMu z5~K1*6bz&3jbN*H|34D8y^%8TM-_xqk#>Ohe~ie0u3uR3PYQw#-)&%C8A8@gK=C$(VHO2}P;%u$lx$U5JX3b*r%6R* z=)|BcHpS;ES=_~{3A#(I;Ohs4uj}h$ji{mThOAuo(71vbkJ{_s#oOFvEx3&0YH#H6 gZCV94f$GwhVnu!!)je#xL-^2aX@Z{By5a8s17yBa+W-In diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/build.zig b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/build.zig deleted file mode 100644 index 6bfd17bdac..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/build.zig +++ /dev/null @@ -1,16 +0,0 @@ -const std = @import("std"); -const CrossTarget = std.zig.CrossTarget; - -pub fn build(b: *std.build.Builder) void { - const target = .{.cpu_arch = .wasm32, .os_tag = .wasi}; - const optimize = b.standardOptimizeOption(.{}); - - const exe = b.addExecutable(.{ - .name = "wasi", - .root_source_file = .{ .path = "wasi.zig" }, - .target = target, - .optimize = optimize, - }); - - exe.install(); -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.wasm b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.wasm deleted file mode 100644 index d6a3e0faf1052f2136cac44d662605b58809b217..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10787 zcmbtaYm8gRb)K1fNnY}jyLTnURxGz2(n=!(esEtT*LGpeTD!6;*-|2>$&VD$c9)Wu zyISs&TsL5-q7^wS9PBWW8TK-0n~jG{kUBtHt& zKvTHickU%c$}0!tvB4e$;WFjlOg|%~qcH<|2oT zbh9#k@uGCR7(`ZnCx9=7TU|l+G`8z?Pr^vW9zN@>E-&F@!W}} zW3Bqa($aEEdAETn0OrI}yR*>Ao&L%0(+By;~lww(5S9uX=&iE@)V_ z$0&XU(QgqFgHa=f4CgW5?6t<3j#Jj`DtU7S0{D1#*R=JbzvPsniIEuVIRii-^MP+n zmQ!K)bCU7fx012HN5&ux*M4~Iho8GW9cl|YUeemTWQD$bNrUYY2nV+%56{l)Slw`E z8}i2DwcoI2#py;Q1VIi2D`@}%x87AU6b5+BLmpb>VG?;j!W62eESA&vQ(4kWpNnyl#6|<8)P@*bkM~D@a+u0~VOk!}2Qp)XaP?+gPDPz5- zXjB%UJFNoGnm96;h$aO_?)QYjj39);`V9;MS=xQ$0WaOR~KphR@fL8M+ z3>_%plGlU8o2&{yqs=7<#;3@wx1aL2&^R8P9t}N=&J`gf+J&b6wN)^Vq9-;|O!aId zv6Phc<_jxb`Z?e|Osp6VUZD_oZK9>i5#T3jUbUTVZhWY^toPRT; zM|zxpU#*nrT`{yN z;!!qTq<0X$6g{9+X~bRnRk7mGj=19+ZZ9-!1Hg~C^$mBNy{s#ucXq?A&+jS%Vc4_W z0v@B&F0)Y@YY06g20;MB-R`{``0_D7QP>#l3p!NVK*$kd4n*W`Xh7-xg%lR}#f`Z_ z3WnT!St|5j`xrAr6MS26k8iki2NOp(T)xu+csDvw;EV20J)pe~WA*9V$zlWeydJ(% z*k6NV-q0G}z#3QpTs^+ga$_Cv)xD8vxNwuQ12>c~gJ>x7hK0lAE9Ob-ySG#Wn(Mji zs0ePZU}$H$n5QOkHh&N@?oA3Xi7B!-2RbwebOc)|joMM0JGhJfB|d;a9*t0$ogY%2N-i8ehTioXYE0cU$~PM;nIW!#GS+yl5hTda5! zq6~=gO-zv0t;ndR9=;l&Ydz@UMRgx&FMw`rA>24Ei~^hczG}p-X-C5oh=W$qCk$Lj zveHo0Lv(`98ZL_zh@ck$j=F??JP6<0RYHh_PKW|MRw6piya=1X82vt_7=}f_P{$3p zMF}uKmGm0X*97DfAS5Y}Y(KGrBzg@eBMm-Bz}Uqw@}LTwnP(fh-5YZoMQBJvF9~ZV zyzxt(cS&E2dT8I!D(u?;Yh6UAl6Qq^f@JJ5wNeV~ zdb9TO6+|s5e2N+9$mt?8pAqZj%-QAq-L zoU8-*?F1OChVDWUVV9C7Vlo*kRoKxR7Ga3&u-rn;Wx&oLBN;N18PNPagggy(fR#}2 zF-&I>B}|8m3mMqWKo*|sMkUDXY&Y+%#4r}(jtcYu|$}8 zR>ZE{zmpjT@~q9pr8C`CK-R(QPvH*zHyk%o-^7ItQV}aP0S=@w4`2=k_gFPc4d<$! zjbFS-$>B{GZSU1t4802n$v27xJX(1gNlYUPPE*PAD4rwyu{tC7rZ|Qt%3_<@3l32e zpk@*&H%b9&-r_ck1|V2mWHbgs;d#UVEDT8jL1ed4ju111$$S=Z6?chKPqUm3kQN~# zeE>dd^9Lws6sUj{wMVoNA7K*N`;o_i=xi|?OVe&AhoKamS-YLPEL3G%h(V)f z0-QwU*tG|JA@Q4QH=Q~cyDcP&^-(=YjS|vj@P-Vg=n}DUqs)X6GZv>LUl#Csd$JWo zqN|v*Ec3mkR-pV`taW+_wCA0s zRqiTo=Oo!}V$%l$kIQKy!%i5|geXg}9>5~<1T3Y&Kg5d2K(S^4h75*PZC>hYu7<2e*bUKR0f%i|uNsLhZ0m1$sOMlUw9whhKYQ<2 zW~nWTD<~id^Bx5gO9?WUqG2}M)8+1K^8SR$PC<(#z-cM{eadxxFxW` zh!^2RBYycrW5hG;0WddTfP2Z-AjiT#l`n+uig0yz^cAkFe*S(4G}uk#(O@^>qrq;X zfCjq>2!y+d3>q(V0U8u=Su{wWImT~TE{j7+f9|hej^!Kg=cIVpfF}!#MT0ed zkVfF}51?d+_IJVJ}g2hjKlrw^F)#956_{P z7b-z0eDp0cB=n$YF*n%5F@$)aKzY$04U!4EY0Oe1f=wduL)qS5m>)VUOrkH40uhrG7eXAIkugcTM^Iou z{j7eTO~^({XK=Ln=yjPHryw2?-Jav2?1Y?*rJ4Hk(H|29OQxXN z{fR(i8Ikf3NK%o3c+!-ZBzQ?he;T9Wc~2hk96_sygg`MzUll@=9jeXG7ji(IR5DEG zIg1k-WP4|eDH|riOS^Z}0mLtHcO(NuE2x~KYo!3+t2p-RxWE4bq}+H|sYewf+C@gR z0I^moakCfjS?-m3NYF1gaF9iTF#aJ2%PXM16&q=%sIYPo#}MuvTF=mVOJdvvgnK6L z@sfahz#{qW;#2uh%x&yQun|2^2>P^#5(ne3| z403M^wI3Ux7Gk|)nhp~Ae-L1t^g&6l)clIbEQp0)M6yAZ@TJ7~m`TXiTmdK6C^e%$ z;0u_`VBq}cm#O5DVeK){3~K)kPV9v?8t4E8|0xJ=(Hd-P%hmoyfJZ<4YHw}5n%Q!- z@BV*R`=_l}^R`^=Cjy-N@Vx!cmaDNeAJ8e&Lw|rrBnX<^h2VjajAD1&4FYH(!PRc?jq9BXNgji1!w;MBMUKF|ka{SDf7#sH2XHHa{Sv z#s&lw@C-Sv?M)TzJ^TIgpwHg}BXu}+7n+=weO&Z1ZBKHJaat@7W ztYl5H{kVA=8GcbKuwo=8#!2!Yxu^(;N%DK_RgD^DUBs|#4awjm?o0Z0svbb__7H*} z^$|cU*EDE|?_cOB>QRj_$z3K=jf9YJdWaK~aANo}kMmy;7Jvds?Fw0puEzYofFchk z821U^uDnu8CZa0#K)1v#$!6FgBgk{t=f8hX>q~Lh$I0By6BcxgPRh zi?R{oX}_>&0SsftPS0Z#6AOBiZ7)rcM}`R{sqjTo!iD*d#s%aWn;pY-w49G6OW+TWt$Oaedg1pX`CK8qQ6GW?sEeCSGhxFcX>*EJ}s9Tv?HMF<&0diRTsR z7X2%${>7ni_@OTjpBOS=oyY{++QfdgxWkM~rGY!lkK@AX1^Au&H-3Xwjr*)!&UY!R zc3B7`jv3((jF*Pl_ix&6UZaRP;a-LY$_oTspWq--Zxl1!37WmQH1TR;v*#~dfp4(-OuI}66;~IfNzUWhRPHeJ13!jkid=#b3t^x zl}+<8E#=A0XlR4*8K@6)At_(>%wl|$BFLwULi{8E&g+2)cM)BX=$+Yse|eo2FGZ2w zxpg))Eja@Y|7G~9D+x}}0t)?6)T8bygQVruF7HBd3$Y8=ozd4xxCCDJ94;o5*~^;# zTdx3El2X@J;vSubEVgkGtcUGv5K`ty* z=J7p^0MvmRenE}Evd)6r?@`53DF8v@7D;JMA+C#+on&^O%>hL1Z4-bP`&>El118cW?0m?rd zU#5 zf{^OD%cc?gouAZsA`YI3!oWQDn(3toAJ;2l6uf<;&p=O!A%@UIudI0>5jBsDkndp3 zNYDg_gT~h^uzAqO3=oFj4dJEoJCp07R!SNCdHB2eiPZe^YJGOIeNOGeFM$^0$HSYQ z!zZ4SpQWh7r|Yc~tIad&z}h;7H#_)N&$Kqz78g48B^gxh&QcSjPdAUQFD%v%)lYOV zw9rwl`g$GB5&VqDt@7tZ=jP5Xw>xdM+Ez!;wLA4wpRBi=o2|uqn>gyNmRjgwbiHFc zO}n{vrnRtcG1_dYf#2`oCqs|mW&P}WeGw$QAE5UGpDm!CZg%$JCr$_2{C=Xjwgwc- z%{7ow@64V%Qm?l_*r`LyYb%GE&2{yu&WYMwvJRj-%WInpgja`}iz~mj++2-&pnZ8w z;de;#TcuAoH&>TtR{^1(#?OqNX*Lfv*G@t@ox}Jk(|oh_Y5Z_#86(6_@vh?a+}dIj zNKT4AFlBZ*elO$o_R&p9;UpyfxcwAVb_(=#fD9}$XtSzm^^Pgxg)z_QLYaJ4a-(%H5Wo!ou0s_VJ&CRtX zp=qc?_S+aay1BmIY(WVMthGcK?l*&7a_KLu%o)+xlYO@VF*ov2OBOqM6dCnqK+C#NQ-Co7ZH$=c-1 zRC#KAYGP_~YHDhFsxnobs!h#Im#4?4C#EN-r>3W;E7R5K+Vo7NTp6!SR3l_#mq! z&vQ>7erDf+Pv#I57$e?HMJkd2F&Hs?bq$|h++eBNd+xP_zV(Bmvj2GiSVQ#IO{BP1 z4gCP^W9aA6rgfy!Xg%}`XwN6(_hX#%E~9@J+Rdc@RrEiC{>RZ0&uhRpiuQFchX3yb zu8482_ieys(O$(k`>28h?_$#aM>2j4aOD3v^vBRXjh6H@lK0!ua@{iENLK;<6x#Ec yMfd|4=lh-LldkWezYXmV0Jj6}Qy3pXJB|KMv|mcbznS#MlKG0+T!leT?*9i0bM6xW diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.zig b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.zig deleted file mode 100644 index 227526bc11..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/testdata/zig/wasi.zig +++ /dev/null @@ -1,50 +0,0 @@ -const std = @import("std"); -const os = std.os; -const fs = std.fs; -const allocator = std.heap.page_allocator; -const preopensAlloc = std.fs.wasi.preopensAlloc; -const stdout = std.io.getStdOut().writer(); - -pub fn main() !void { - // Allocate arguments from the the operating system. - const args = try std.process.argsAlloc(allocator); - defer std.process.argsFree(allocator, args); - - if (std.mem.eql(u8, args[1], "ls")) { - // TODO: This only looks at fd 3. See #14678 - var dir = std.fs.cwd().openIterableDir(args[2], .{}) catch |err| switch (err) { - error.NotDir => { - try stdout.print("ENOTDIR\n", .{}); - return; - }, - else => { - try stdout.print("./{}\n", .{err}); - return; - }, - }; - - try ls(dir); - if (args.len > 3 and std.mem.eql(u8, args[3], "repeat")) { - try ls(dir); - } - } else if (std.mem.eql(u8, args[1], "stat")) { - try stdout.print("stdin isatty: {}\n", .{os.isatty(0)}); - try stdout.print("stdout isatty: {}\n", .{os.isatty(1)}); - try stdout.print("stderr isatty: {}\n", .{os.isatty(2)}); - try stdout.print("/ isatty: {}\n", .{os.isatty(3)}); - } else if (std.mem.eql(u8, args[1], "preopen")) { - var wasi_preopens = try preopensAlloc(allocator); - // fs.wasi.Preopens does not have a free function - - for (wasi_preopens.names, 0..) |preopen, i| { - try stdout.print("{}: {s}\n", .{ i, preopen }); - } - } -} - -fn ls(dir: std.fs.IterableDir) !void { - var iter = dir.iterate(); - while (try iter.next()) |entry| { - try stdout.print("./{s}\n", .{entry.name}); - } -} diff --git a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go b/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go deleted file mode 100644 index c6190316df..0000000000 --- a/vendor/github.com/tetratelabs/wazero/imports/wasi_snapshot_preview1/wasi.go +++ /dev/null @@ -1,314 +0,0 @@ -// Package wasi_snapshot_preview1 contains Go-defined functions to access -// system calls, such as opening a file, similar to Go's x/sys package. These -// are accessible from WebAssembly-defined functions via importing ModuleName. -// All WASI functions return a single Errno result: ErrnoSuccess on success. -// -// e.g. Call Instantiate before instantiating any wasm binary that imports -// "wasi_snapshot_preview1", Otherwise, it will error due to missing imports. -// -// ctx := context.Background() -// r := wazero.NewRuntime(ctx) -// defer r.Close(ctx) // This closes everything this Runtime created. -// -// wasi_snapshot_preview1.MustInstantiate(ctx, r) -// mod, _ := r.Instantiate(ctx, wasm) -// -// See https://github.com/WebAssembly/WASI -package wasi_snapshot_preview1 - -import ( - "context" - "encoding/binary" - "syscall" - - "github.com/tetratelabs/wazero" - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasip1" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// ModuleName is the module name WASI functions are exported into. -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md -const ModuleName = wasip1.InternalModuleName - -const i32, i64 = wasm.ValueTypeI32, wasm.ValueTypeI64 - -var le = binary.LittleEndian - -// MustInstantiate calls Instantiate or panics on error. -// -// This is a simpler function for those who know the module ModuleName is not -// already instantiated, and don't need to unload it. -func MustInstantiate(ctx context.Context, r wazero.Runtime) { - if _, err := Instantiate(ctx, r); err != nil { - panic(err) - } -} - -// Instantiate instantiates the ModuleName module into the runtime. -// -// # Notes -// -// - Failure cases are documented on wazero.Runtime InstantiateModule. -// - Closing the wazero.Runtime has the same effect as closing the result. -func Instantiate(ctx context.Context, r wazero.Runtime) (api.Closer, error) { - return NewBuilder(r).Instantiate(ctx) -} - -// Builder configures the ModuleName module for later use via Compile or Instantiate. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type Builder interface { - // Compile compiles the ModuleName module. Call this before Instantiate. - // - // Note: This has the same effect as the same function on wazero.HostModuleBuilder. - Compile(context.Context) (wazero.CompiledModule, error) - - // Instantiate instantiates the ModuleName module and returns a function to close it. - // - // Note: This has the same effect as the same function on wazero.HostModuleBuilder. - Instantiate(context.Context) (api.Closer, error) -} - -// NewBuilder returns a new Builder. -func NewBuilder(r wazero.Runtime) Builder { - return &builder{r} -} - -type builder struct{ r wazero.Runtime } - -// hostModuleBuilder returns a new wazero.HostModuleBuilder for ModuleName -func (b *builder) hostModuleBuilder() wazero.HostModuleBuilder { - ret := b.r.NewHostModuleBuilder(ModuleName) - exportFunctions(ret) - return ret -} - -// Compile implements Builder.Compile -func (b *builder) Compile(ctx context.Context) (wazero.CompiledModule, error) { - return b.hostModuleBuilder().Compile(ctx) -} - -// Instantiate implements Builder.Instantiate -func (b *builder) Instantiate(ctx context.Context) (api.Closer, error) { - return b.hostModuleBuilder().Instantiate(ctx) -} - -// FunctionExporter exports functions into a wazero.HostModuleBuilder. -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -type FunctionExporter interface { - ExportFunctions(wazero.HostModuleBuilder) -} - -// NewFunctionExporter returns a new FunctionExporter. This is used for the -// following two use cases: -// - Overriding a builtin function with an alternate implementation. -// - Exporting functions to the module "wasi_unstable" for legacy code. -// -// # Example of overriding default behavior -// -// // Export the default WASI functions. -// wasiBuilder := r.NewHostModuleBuilder(ModuleName) -// wasi_snapshot_preview1.NewFunctionExporter().ExportFunctions(wasiBuilder) -// -// // Subsequent calls to NewFunctionBuilder override built-in exports. -// wasiBuilder.NewFunctionBuilder(). -// WithFunc(func(ctx context.Context, mod api.Module, exitCode uint32) { -// // your custom logic -// }).Export("proc_exit") -// -// # Example of using the old module name for WASI -// -// // Instantiate the current WASI functions under the wasi_unstable -// // instead of wasi_snapshot_preview1. -// wasiBuilder := r.NewHostModuleBuilder("wasi_unstable") -// wasi_snapshot_preview1.NewFunctionExporter().ExportFunctions(wasiBuilder) -// _, err := wasiBuilder.Instantiate(testCtx, r) -func NewFunctionExporter() FunctionExporter { - return &functionExporter{} -} - -type functionExporter struct{} - -// ExportFunctions implements FunctionExporter.ExportFunctions -func (functionExporter) ExportFunctions(builder wazero.HostModuleBuilder) { - exportFunctions(builder) -} - -// ## Translation notes -// ### String -// WebAssembly 1.0 has no string type, so any string input parameter expands to two uint32 parameters: offset -// and length. -// -// ### iovec_array -// `iovec_array` is encoded as two uin32le values (i32): offset and count. -// -// ### Result -// Each result besides Errno is always an uint32 parameter. WebAssembly 1.0 can have up to one result, -// which is already used by Errno. This forces other results to be parameters. A result parameter is a memory -// offset to write the result to. As memory offsets are uint32, each parameter representing a result is uint32. -// -// ### Errno -// The WASI specification is sometimes ambiguous resulting in some runtimes interpreting the same function ways. -// Errno mappings are not defined in WASI, yet, so these mappings are best efforts by maintainers. When in doubt -// about portability, first look at /RATIONALE.md and if needed an issue on -// https://github.com/WebAssembly/WASI/issues -// -// ## Memory -// In WebAssembly 1.0 (20191205), there may be up to one Memory per store, which means api.Memory is always the -// wasm.Store Memories index zero: `store.Memories[0].Buffer` -// -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md -// See https://github.com/WebAssembly/WASI/issues/215 -// See https://wwa.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instances%E2%91%A0. - -// exportFunctions adds all go functions that implement wasi. -// These should be exported in the module named ModuleName. -func exportFunctions(builder wazero.HostModuleBuilder) { - exporter := builder.(wasm.HostFuncExporter) - - // Note: these are ordered per spec for consistency even if the resulting - // map can't guarantee that. - // See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#functions - exporter.ExportHostFunc(argsGet) - exporter.ExportHostFunc(argsSizesGet) - exporter.ExportHostFunc(environGet) - exporter.ExportHostFunc(environSizesGet) - exporter.ExportHostFunc(clockResGet) - exporter.ExportHostFunc(clockTimeGet) - exporter.ExportHostFunc(fdAdvise) - exporter.ExportHostFunc(fdAllocate) - exporter.ExportHostFunc(fdClose) - exporter.ExportHostFunc(fdDatasync) - exporter.ExportHostFunc(fdFdstatGet) - exporter.ExportHostFunc(fdFdstatSetFlags) - exporter.ExportHostFunc(fdFdstatSetRights) - exporter.ExportHostFunc(fdFilestatGet) - exporter.ExportHostFunc(fdFilestatSetSize) - exporter.ExportHostFunc(fdFilestatSetTimes) - exporter.ExportHostFunc(fdPread) - exporter.ExportHostFunc(fdPrestatGet) - exporter.ExportHostFunc(fdPrestatDirName) - exporter.ExportHostFunc(fdPwrite) - exporter.ExportHostFunc(fdRead) - exporter.ExportHostFunc(fdReaddir) - exporter.ExportHostFunc(fdRenumber) - exporter.ExportHostFunc(fdSeek) - exporter.ExportHostFunc(fdSync) - exporter.ExportHostFunc(fdTell) - exporter.ExportHostFunc(fdWrite) - exporter.ExportHostFunc(pathCreateDirectory) - exporter.ExportHostFunc(pathFilestatGet) - exporter.ExportHostFunc(pathFilestatSetTimes) - exporter.ExportHostFunc(pathLink) - exporter.ExportHostFunc(pathOpen) - exporter.ExportHostFunc(pathReadlink) - exporter.ExportHostFunc(pathRemoveDirectory) - exporter.ExportHostFunc(pathRename) - exporter.ExportHostFunc(pathSymlink) - exporter.ExportHostFunc(pathUnlinkFile) - exporter.ExportHostFunc(pollOneoff) - exporter.ExportHostFunc(procExit) - exporter.ExportHostFunc(procRaise) - exporter.ExportHostFunc(schedYield) - exporter.ExportHostFunc(randomGet) - exporter.ExportHostFunc(sockAccept) - exporter.ExportHostFunc(sockRecv) - exporter.ExportHostFunc(sockSend) - exporter.ExportHostFunc(sockShutdown) -} - -// writeOffsetsAndNullTerminatedValues is used to write NUL-terminated values -// for args or environ, given a pre-defined bytesLen (which includes NUL -// terminators). -func writeOffsetsAndNullTerminatedValues(mem api.Memory, values [][]byte, offsets, bytes, bytesLen uint32) syscall.Errno { - // The caller may not place bytes directly after offsets, so we have to - // read them independently. - valuesLen := len(values) - offsetsLen := uint32(valuesLen * 4) // uint32Le - offsetsBuf, ok := mem.Read(offsets, offsetsLen) - if !ok { - return syscall.EFAULT - } - bytesBuf, ok := mem.Read(bytes, bytesLen) - if !ok { - return syscall.EFAULT - } - - // Loop through the values, first writing the location of its data to - // offsetsBuf[oI], then its NUL-terminated data at bytesBuf[bI] - var oI, bI uint32 - for _, value := range values { - // Go can't guarantee inlining as there's not //go:inline directive. - // This inlines uint32 little-endian encoding instead. - bytesOffset := bytes + bI - offsetsBuf[oI] = byte(bytesOffset) - offsetsBuf[oI+1] = byte(bytesOffset >> 8) - offsetsBuf[oI+2] = byte(bytesOffset >> 16) - offsetsBuf[oI+3] = byte(bytesOffset >> 24) - oI += 4 // size of uint32 we just wrote - - // Write the next value to memory with a NUL terminator - copy(bytesBuf[bI:], value) - bI += uint32(len(value)) - bytesBuf[bI] = 0 // NUL terminator - bI++ - } - - return 0 -} - -func newHostFunc( - name string, - goFunc wasiFunc, - paramTypes []api.ValueType, - paramNames ...string, -) *wasm.HostFunc { - return &wasm.HostFunc{ - ExportName: name, - Name: name, - ParamTypes: paramTypes, - ParamNames: paramNames, - ResultTypes: []api.ValueType{i32}, - ResultNames: []string{"errno"}, - Code: wasm.Code{GoFunc: goFunc}, - } -} - -// wasiFunc special cases that all WASI functions return a single Errno -// result. The returned value will be written back to the stack at index zero. -type wasiFunc func(ctx context.Context, mod api.Module, params []uint64) syscall.Errno - -// Call implements the same method as documented on api.GoModuleFunction. -func (f wasiFunc) Call(ctx context.Context, mod api.Module, stack []uint64) { - // Write the result back onto the stack - errno := f(ctx, mod, stack) - if errno != 0 { - stack[0] = uint64(wasip1.ToErrno(errno)) - } else { // special case ass ErrnoSuccess is zero - stack[0] = 0 - } -} - -// stubFunction stubs for GrainLang per #271. -func stubFunction(name string, paramTypes []wasm.ValueType, paramNames ...string) *wasm.HostFunc { - return &wasm.HostFunc{ - ExportName: name, - Name: name, - ParamTypes: paramTypes, - ParamNames: paramNames, - ResultTypes: []api.ValueType{i32}, - ResultNames: []string{"errno"}, - Code: wasm.Code{ - GoFunc: api.GoModuleFunc(func(_ context.Context, _ api.Module, stack []uint64) { stack[0] = uint64(wasip1.ErrnoNosys) }), - }, - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/assembler.go b/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/assembler.go deleted file mode 100644 index d247f55648..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/assembler.go +++ /dev/null @@ -1,98 +0,0 @@ -package amd64 - -import ( - "github.com/tetratelabs/wazero/internal/asm" -) - -// Assembler is the interface used by amd64 compiler. -type Assembler interface { - asm.AssemblerBase - - // CompileJumpToMemory adds jump-type instruction whose destination is stored in the memory address specified by `baseReg+offset`, - // and returns the corresponding Node in the assembled linked list. - CompileJumpToMemory(jmpInstruction asm.Instruction, baseReg asm.Register, offset asm.ConstantValue) - - // CompileRegisterToRegisterWithArg adds an instruction where source and destination - // are `from` and `to` registers. - CompileRegisterToRegisterWithArg(instruction asm.Instruction, from, to asm.Register, arg byte) - - // CompileMemoryWithIndexToRegister adds an instruction where source operand is the memory address - // specified as `srcBaseReg + srcOffsetConst + srcIndex*srcScale` and destination is the register `dstReg`. - // Note: sourceScale must be one of 1, 2, 4, 8. - CompileMemoryWithIndexToRegister( - instruction asm.Instruction, - srcBaseReg asm.Register, - srcOffsetConst int64, - srcIndex asm.Register, - srcScale int16, - dstReg asm.Register, - ) - - // CompileMemoryWithIndexAndArgToRegister is the same as CompileMemoryWithIndexToRegister except that this - // also accepts one argument. - CompileMemoryWithIndexAndArgToRegister( - instruction asm.Instruction, - srcBaseReg asm.Register, - srcOffsetConst int64, - srcIndex asm.Register, - srcScale int16, - dstReg asm.Register, - arg byte, - ) - - // CompileRegisterToMemoryWithIndex adds an instruction where source operand is the register `srcReg`, - // and the destination is the memory address specified as `dstBaseReg + dstOffsetConst + dstIndex*dstScale` - // Note: dstScale must be one of 1, 2, 4, 8. - CompileRegisterToMemoryWithIndex( - instruction asm.Instruction, - srcReg asm.Register, - dstBaseReg asm.Register, - dstOffsetConst int64, - dstIndex asm.Register, - dstScale int16, - ) - - // CompileRegisterToMemoryWithIndexAndArg is the same as CompileRegisterToMemoryWithIndex except that this - // also accepts one argument. - CompileRegisterToMemoryWithIndexAndArg( - instruction asm.Instruction, - srcReg asm.Register, - dstBaseReg asm.Register, - dstOffsetConst int64, - dstIndex asm.Register, - dstScale int16, - arg byte, - ) - - // CompileRegisterToConst adds an instruction where source operand is the register `srcRegister`, - // and the destination is the const `value`. - CompileRegisterToConst(instruction asm.Instruction, srcRegister asm.Register, value int64) asm.Node - - // CompileRegisterToNone adds an instruction where source operand is the register `register`, - // and there's no destination operand. - CompileRegisterToNone(instruction asm.Instruction, register asm.Register) - - // CompileNoneToRegister adds an instruction where destination operand is the register `register`, - // and there's no source operand. - CompileNoneToRegister(instruction asm.Instruction, register asm.Register) - - // CompileNoneToMemory adds an instruction where destination operand is the memory address specified - // as `baseReg+offset`. and there's no source operand. - CompileNoneToMemory(instruction asm.Instruction, baseReg asm.Register, offset int64) - - // CompileConstToMemory adds an instruction where source operand is the constant `value` and - // the destination is the memory address specified as `dstBaseReg+dstOffset`. - CompileConstToMemory(instruction asm.Instruction, value int64, dstBaseReg asm.Register, dstOffset int64) asm.Node - - // CompileMemoryToConst adds an instruction where source operand is the memory address, and - // the destination is the constant `value`. - CompileMemoryToConst(instruction asm.Instruction, srcBaseReg asm.Register, srcOffset int64, value int64) asm.Node - - // CompileStaticConstToRegister adds an instruction where the source operand is asm.StaticConst located in the - // memory and the destination is the dstReg. - CompileStaticConstToRegister(instruction asm.Instruction, c *asm.StaticConst, dstReg asm.Register) error - - // CompileRegisterToStaticConst adds an instruction where the destination operand is asm.StaticConst located in the - // memory and the source is the srcReg. - CompileRegisterToStaticConst(instruction asm.Instruction, srcReg asm.Register, c *asm.StaticConst) error -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/consts.go b/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/consts.go deleted file mode 100644 index add64257be..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/consts.go +++ /dev/null @@ -1,1248 +0,0 @@ -package amd64 - -import ( - "fmt" - - "github.com/tetratelabs/wazero/internal/asm" -) - -// AMD64-specific conditional register states. -// -// See https://www.lri.fr/~filliatr/ens/compil/x86-64.pdf -// See https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf -const ( - // ConditionalRegisterStateE is the e (equal to zero) condition code - ConditionalRegisterStateE = asm.ConditionalRegisterStateUnset + 1 + iota // ZF equal to zero - // ConditionalRegisterStateNE is the ne (not equal to zero) condition code - ConditionalRegisterStateNE // ˜ZF not equal to zero - // ConditionalRegisterStateS is the s (negative) condition code - ConditionalRegisterStateS // SF negative - // ConditionalRegisterStateNS is the ns (non-negative) condition code - ConditionalRegisterStateNS // ˜SF non-negative - // ConditionalRegisterStateG is the g (greater) condition code - ConditionalRegisterStateG // ˜(SF xor OF) & ˜ ZF greater (signed >) - // ConditionalRegisterStateGE is the ge (greater or equal) condition code - ConditionalRegisterStateGE // ˜(SF xor OF) greater or equal (signed >=) - // ConditionalRegisterStateL is the l (less) condition code - ConditionalRegisterStateL // SF xor OF less (signed <) - // ConditionalRegisterStateLE is the le (less or equal) condition code - ConditionalRegisterStateLE // (SF xor OF) | ZF less or equal (signed <=) - // ConditionalRegisterStateA is the a (above) condition code - ConditionalRegisterStateA // ˜CF & ˜ZF above (unsigned >) - // ConditionalRegisterStateAE is the ae (above or equal) condition code - ConditionalRegisterStateAE // ˜CF above or equal (unsigned >=) - // ConditionalRegisterStateB is the b (below) condition code - ConditionalRegisterStateB // CF below (unsigned <) - // ConditionalRegisterStateBE is the be (below or equal) condition code - ConditionalRegisterStateBE // CF | ZF below or equal (unsigned <=) -) - -// AMD64-specific instructions. -// -// Note: This only defines amd64 instructions used by wazero's compiler. -// Note: Naming conventions intentionally match the Go assembler: https://go.dev/doc/asm -// See https://www.felixcloutier.com/x86/index.html -const ( - // NONE is not a real instruction but represents the lack of an instruction - NONE asm.Instruction = iota - // ADDL is the ADD instruction in 32-bit mode. https://www.felixcloutier.com/x86/add - ADDL - // ADDQ is the ADD instruction in 64-bit mode. https://www.felixcloutier.com/x86/add - ADDQ - // ADDSD is the ADDSD instruction. https://www.felixcloutier.com/x86/addsd - ADDSD - // ADDSS is the ADDSS instruction. https://www.felixcloutier.com/x86/addss - ADDSS - // ANDL is the AND instruction in 32-bit mode. https://www.felixcloutier.com/x86/and - ANDL - // ANDPD is the ANDPD instruction. https://www.felixcloutier.com/x86/andpd - ANDPD - // ANDPS is the ANDPS instruction. https://www.felixcloutier.com/x86/andps - ANDPS - // ANDQ is the AND instruction in 64-bit mode. https://www.felixcloutier.com/x86/and - ANDQ - // BSRL is the BSR instruction in 32-bit mode. https://www.felixcloutier.com/x86/bsr - BSRL - // BSRQ is the BSR instruction in 64-bit mode. https://www.felixcloutier.com/x86/bsr - BSRQ - // CDQ is the CDQ instruction. https://www.felixcloutier.com/x86/cwd:cdq:cqo - CDQ - // CLD is the CLD instruction. https://www.felixcloutier.com/x86/cld - CLD - // CMOVQCS is the CMOVC (move if carry) instruction in 64-bit mode. https://www.felixcloutier.com/x86/cmovcc - CMOVQCS - // CMPL is the CMP instruction in 32-bit mode. https://www.felixcloutier.com/x86/cmp - CMPL - // CMPQ is the CMP instruction in 64-bit mode. https://www.felixcloutier.com/x86/cmp - CMPQ - // COMISD is the COMISD instruction. https://www.felixcloutier.com/x86/comisd - COMISD - // COMISS is the COMISS instruction. https://www.felixcloutier.com/x86/comiss - COMISS - // CQO is the CQO instruction. https://www.felixcloutier.com/x86/cwd:cdq:cqo - CQO - // CVTSD2SS is the CVTSD2SS instruction. https://www.felixcloutier.com/x86/cvtsd2ss - CVTSD2SS - // CVTSL2SD is the CVTSI2SD instruction in 32-bit mode. https://www.felixcloutier.com/x86/cvtsi2sd - CVTSL2SD - // CVTSL2SS is the CVTSI2SS instruction in 32-bit mode. https://www.felixcloutier.com/x86/cvtsi2ss - CVTSL2SS - // CVTSQ2SD is the CVTSI2SD instruction in 64-bit mode. https://www.felixcloutier.com/x86/cvtsi2sd - CVTSQ2SD - // CVTSQ2SS is the CVTSI2SS instruction in 64-bit mode. https://www.felixcloutier.com/x86/cvtsi2ss - CVTSQ2SS - // CVTSS2SD is the CVTSS2SD instruction. https://www.felixcloutier.com/x86/cvtss2sd - CVTSS2SD - // CVTTSD2SL is the CVTTSD2SI instruction in 32-bit mode. https://www.felixcloutier.com/x86/cvttsd2si - CVTTSD2SL - // CVTTSD2SQ is the CVTTSD2SI instruction in 64-bit mode. https://www.felixcloutier.com/x86/cvttsd2si - CVTTSD2SQ - // CVTTSS2SL is the CVTTSS2SI instruction in 32-bit mode. https://www.felixcloutier.com/x86/cvttss2si - CVTTSS2SL - // CVTTSS2SQ is the CVTTSS2SI instruction in 64-bit mode. https://www.felixcloutier.com/x86/cvttss2si - CVTTSS2SQ - // DECQ is the DEC instruction in 64-bit mode. https://www.felixcloutier.com/x86/dec - DECQ - // DIVL is the DIV instruction in 32-bit mode. https://www.felixcloutier.com/x86/div - DIVL - // DIVQ is the DIV instruction in 64-bit mode. https://www.felixcloutier.com/x86/div - DIVQ - // DIVSD is the DIVSD instruction. https://www.felixcloutier.com/x86/divsd - DIVSD - // DIVSS is the DIVSS instruction. https://www.felixcloutier.com/x86/divss - DIVSS - // IDIVL is the IDIV instruction in 32-bit mode. https://www.felixcloutier.com/x86/idiv - IDIVL - // IDIVQ is the IDIV instruction in 64-bit mode. https://www.felixcloutier.com/x86/idiv - IDIVQ - // INCQ is the INC instruction in 64-bit mode. https://www.felixcloutier.com/x86/inc - INCQ - // JCC is the JAE (jump if above or equal) instruction. https://www.felixcloutier.com/x86/jcc - JCC - // JCS is the JB (jump if below) instruction. https://www.felixcloutier.com/x86/jcc - JCS - // JEQ is the JE (jump if equal) instruction. https://www.felixcloutier.com/x86/jcc - JEQ - // JGE is the JGE (jump if greater or equal) instruction. https://www.felixcloutier.com/x86/jcc - JGE - // JGT is the JG (jump if greater) instruction. https://www.felixcloutier.com/x86/jcc - JGT - // JHI is the JNBE (jump if not below or equal) instruction. https://www.felixcloutier.com/x86/jcc - JHI - // JLE is the JLE (jump if less or equal) instruction. https://www.felixcloutier.com/x86/jcc - JLE - // JLS is the JNA (jump if not above) instruction. https://www.felixcloutier.com/x86/jcc - JLS - // JLT is the JL (jump if less) instruction. https://www.felixcloutier.com/x86/jcc - JLT - // JMI is the JS (jump if sign) instruction. https://www.felixcloutier.com/x86/jcc - JMI - // JNE is the JNE (jump if not equal) instruction. https://www.felixcloutier.com/x86/jcc - JNE - // JPC is the JPO (jump if parity odd) instruction. https://www.felixcloutier.com/x86/jcc - JPC - // JPL is the JNS (jump if not sign) instruction. https://www.felixcloutier.com/x86/jcc - JPL - // JPS is the JPE (jump if parity even) instruction. https://www.felixcloutier.com/x86/jcc - JPS - // LEAQ is the LEA instruction in 64-bit mode. https://www.felixcloutier.com/x86/lea - LEAQ - // LZCNTL is the LZCNT instruction in 32-bit mode. https://www.felixcloutier.com/x86/lzcnt - LZCNTL - // LZCNTQ is the LZCNT instruction in 64-bit mode. https://www.felixcloutier.com/x86/lzcnt - LZCNTQ - // MAXSD is the MAXSD instruction. https://www.felixcloutier.com/x86/maxsd - MAXSD - // MAXSS is the MAXSS instruction. https://www.felixcloutier.com/x86/maxss - MAXSS - // MINSD is the MINSD instruction. https://www.felixcloutier.com/x86/minsd - MINSD - // MINSS is the MINSS instruction. https://www.felixcloutier.com/x86/minss - MINSS - // MOVB is the MOV instruction for a single byte. https://www.felixcloutier.com/x86/mov - MOVB - // MOVBLSX is the MOVSX instruction for single byte in 32-bit mode. https://www.felixcloutier.com/x86/movsx:movsxd - MOVBLSX - // MOVBLZX is the MOVZX instruction for single-byte in 32-bit mode. https://www.felixcloutier.com/x86/movzx - MOVBLZX - // MOVBQSX is the MOVSX instruction for single byte in 64-bit mode. https://www.felixcloutier.com/x86/movsx:movsxd - MOVBQSX - // MOVBQZX is the MOVZX instruction for single-byte in 64-bit mode. https://www.felixcloutier.com/x86/movzx - MOVBQZX - // MOVL is the MOV instruction for a double word. - MOVL - // MOVLQSX is the MOVSXD instruction. https://www.felixcloutier.com/x86/movsx:movsxd - MOVLQSX - // MOVLQZX is the MOVZX instruction for a word to a doubleword. https://www.felixcloutier.com/x86/movzx - MOVLQZX - // MOVQ is the MOV instruction for a doubleword. https://www.felixcloutier.com/x86/mov - MOVQ - // MOVW is the MOV instruction for a word. https://www.felixcloutier.com/x86/mov - MOVW - // MOVWLSX is the MOVSX instruction for a word in 32-bit mode. https://www.felixcloutier.com/x86/movsx:movsxd - MOVWLSX - // MOVWLZX is the MOVZX instruction for a word in 32-bit mode. https://www.felixcloutier.com/x86/movzx - MOVWLZX - // MOVWQSX is the MOVSX instruction for a word in 64-bit mode. https://www.felixcloutier.com/x86/movsx:movsxd - MOVWQSX - // MOVWQZX is the MOVZX instruction for a word in 64-bit mode. https://www.felixcloutier.com/x86/movzx - MOVWQZX - // MULL is the MUL instruction in 32-bit mode. https://www.felixcloutier.com/x86/mul - MULL - // MULQ is the MUL instruction in 64-bit mode. https://www.felixcloutier.com/x86/mul - MULQ - // IMULQ is the IMUL instruction in 64-bit mode. https://www.felixcloutier.com/x86/imul - IMULQ - // MULSD is the MULSD instruction. https://www.felixcloutier.com/x86/mulsd - MULSD - // MULSS is the MULSS instruction. https://www.felixcloutier.com/x86/mulss - MULSS - // NEGQ is the NEG instruction in 64-bit mode. https://www.felixcloutier.com/x86/neg - NEGQ - // ORL is the OR instruction in 32-bit mode. https://www.felixcloutier.com/x86/or - ORL - // ORPD is the ORPD instruction. https://www.felixcloutier.com/x86/orpd - ORPD - // ORPS is the ORPS instruction. https://www.felixcloutier.com/x86/orps - ORPS - // ORQ is the OR instruction in 64-bit mode. https://www.felixcloutier.com/x86/or - ORQ - // POPCNTL is the POPCNT instruction in 32-bit mode. https://www.felixcloutier.com/x86/popcnt - POPCNTL - // POPCNTQ is the POPCNT instruction in 64-bit mode. https://www.felixcloutier.com/x86/popcnt - POPCNTQ - // PSLLD is the PSLLD instruction. https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLD - // PSLLQ is the PSLLQ instruction. https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLQ - // PSRLD is the PSRLD instruction. https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLD - // PSRLQ is the PSRLQ instruction. https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLQ - // REPMOVSQ is the REP MOVSQ instruction in 64-bit mode. https://www.felixcloutier.com/x86/movs:movsb:movsw:movsd:movsq https://www.felixcloutier.com/x86/rep:repe:repz:repne:repnz - REPMOVSQ - // REPSTOSQ is the REP STOSQ instruction in 64-bit mode. https://www.felixcloutier.com/x86/stos:stosb:stosw:stosd:stosq https://www.felixcloutier.com/x86/rep:repe:repz:repne:repnz - REPSTOSQ - // ROLL is the ROL instruction in 32-bit mode. https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - ROLL - // ROLQ is the ROL instruction in 64-bit mode. https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - ROLQ - // RORL is the ROR instruction in 32-bit mode. https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - RORL - // RORQ is the ROR instruction in 64-bit mode. https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - RORQ - // ROUNDSD is the ROUNDSD instruction. https://www.felixcloutier.com/x86/roundsd - ROUNDSD - // ROUNDSS is the ROUNDSS instruction. https://www.felixcloutier.com/x86/roundss - ROUNDSS - // SARL is the SAR instruction in 32-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SARL - // SARQ is the SAR instruction in 64-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SARQ - // SETCC is the SETAE (set if above or equal) instruction. https://www.felixcloutier.com/x86/setcc - SETCC - // SETCS is the SETB (set if below) instruction. https://www.felixcloutier.com/x86/setcc - SETCS - // SETEQ is the SETE (set if equal) instruction. https://www.felixcloutier.com/x86/setcc - SETEQ - // SETGE is the SETGE (set if greater or equal) instruction. https://www.felixcloutier.com/x86/setcc - SETGE - // SETGT is the SETG (set if greater) instruction. https://www.felixcloutier.com/x86/setcc - SETGT - // SETHI is the SETNBE (set if not below or equal) instruction. https://www.felixcloutier.com/x86/setcc - SETHI - // SETLE is the SETLE (set if less or equal) instruction. https://www.felixcloutier.com/x86/setcc - SETLE - // SETLS is the SETNA (set if not above) instruction. https://www.felixcloutier.com/x86/setcc - SETLS - // SETLT is the SETL (set if less) instruction. https://www.felixcloutier.com/x86/setcc - SETLT - // SETMI is the SETS (set if sign) instruction. https://www.felixcloutier.com/x86/setcc - SETMI - // SETNE is the SETNE (set if not equal) instruction. https://www.felixcloutier.com/x86/setcc - SETNE - // SETPC is the SETNP (set if not parity) instruction. https://www.felixcloutier.com/x86/setcc - SETPC - // SETPL is the SETNS (set if not sign) instruction. https://www.felixcloutier.com/x86/setcc - SETPL - // SETPS is the SETP (set if parity) instruction. https://www.felixcloutier.com/x86/setcc - SETPS - // SHLL is the SHL instruction in 32-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SHLL - // SHLQ is the SHL instruction in 64-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SHLQ - // SHRL is the SHR instruction in 32-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SHRL - // SHRQ is the SHR instruction in 64-bit mode. https://www.felixcloutier.com/x86/sal:sar:shl:shr - SHRQ - // SQRTSD is the SQRTSD instruction. https://www.felixcloutier.com/x86/sqrtsd - SQRTSD - // SQRTSS is the SQRTSS instruction. https://www.felixcloutier.com/x86/sqrtss - SQRTSS - // STD is the STD instruction. https://www.felixcloutier.com/x86/std - STD - // SUBL is the SUB instruction in 32-bit mode. https://www.felixcloutier.com/x86/sub - SUBL - // SUBQ is the SUB instruction in 64-bit mode. https://www.felixcloutier.com/x86/sub - SUBQ - // SUBSD is the SUBSD instruction. https://www.felixcloutier.com/x86/subsd - SUBSD - // SUBSS is the SUBSS instruction. https://www.felixcloutier.com/x86/subss - SUBSS - // TESTL is the TEST instruction in 32-bit mode. https://www.felixcloutier.com/x86/test - TESTL - // TESTQ is the TEST instruction in 64-bit mode. https://www.felixcloutier.com/x86/test - TESTQ - // TZCNTL is the TZCNT instruction in 32-bit mode. https://www.felixcloutier.com/x86/tzcnt - TZCNTL - // TZCNTQ is the TZCNT instruction in 64-bit mode. https://www.felixcloutier.com/x86/tzcnt - TZCNTQ - // UCOMISD is the UCOMISD instruction. https://www.felixcloutier.com/x86/ucomisd - UCOMISD - // UCOMISS is the UCOMISS instruction. https://www.felixcloutier.com/x86/ucomisd - UCOMISS - // XORL is the XOR instruction in 32-bit mode. https://www.felixcloutier.com/x86/xor - XORL - // XORPD is the XORPD instruction. https://www.felixcloutier.com/x86/xorpd - XORPD - // XORPS is the XORPS instruction. https://www.felixcloutier.com/x86/xorps - XORPS - // XORQ is the XOR instruction in 64-bit mode. https://www.felixcloutier.com/x86/xor - XORQ - // XCHGQ is the XCHG instruction in 64-bit mode. https://www.felixcloutier.com/x86/xchg - XCHGQ - // RET is the RET instruction. https://www.felixcloutier.com/x86/ret - RET - // JMP is the JMP instruction. https://www.felixcloutier.com/x86/jmp - JMP - // NOP is the NOP instruction. https://www.felixcloutier.com/x86/nop - NOP - // UD2 is the UD2 instruction. https://www.felixcloutier.com/x86/ud - UD2 - // MOVDQU is the MOVDQU instruction in 64-bit mode. https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 - MOVDQU - // MOVDQA is the MOVDQA instruction in 64-bit mode. https://www.felixcloutier.com/x86/movdqa:vmovdqa32:vmovdqa64 - MOVDQA - // PINSRB is the PINSRB instruction. https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRB - // PINSRW is the PINSRW instruction. https://www.felixcloutier.com/x86/pinsrw - PINSRW - // PINSRD is the PINSRD instruction. https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRD - // PINSRQ is the PINSRQ instruction. https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRQ - // PADDB is the PADDB instruction. https://www.felixcloutier.com/x86/paddb:paddw:paddd:paddq - PADDB - // PADDW is the PADDW instruction. https://www.felixcloutier.com/x86/paddb:paddw:paddd:paddq - PADDW - // PADDD is the PADDD instruction. https://www.felixcloutier.com/x86/paddb:paddw:paddd:paddq - PADDD - // PADDQ is the PADDQ instruction. https://www.felixcloutier.com/x86/paddb:paddw:paddd:paddq - PADDQ - // PSUBB is the PSUBB instruction. https://www.felixcloutier.com/x86/psubb:psubw:psubd - PSUBB - // PSUBW is the PSUBW instruction. https://www.felixcloutier.com/x86/psubb:psubw:psubd - PSUBW - // PSUBD is the PSUBD instruction. https://www.felixcloutier.com/x86/psubb:psubw:psubd - PSUBD - // PSUBQ is the PSUBQ instruction. https://www.felixcloutier.com/x86/psubq - PSUBQ - // ADDPS is the ADDPS instruction. https://www.felixcloutier.com/x86/addps - ADDPS - // ADDPD is the ADDPD instruction. https://www.felixcloutier.com/x86/addpd - ADDPD - // SUBPS is the SUBPS instruction. https://www.felixcloutier.com/x86/subps - SUBPS - // SUBPD is the SUBPD instruction. https://www.felixcloutier.com/x86/subpd - SUBPD - // PMOVSXBW is the PMOVSXBW instruction https://www.felixcloutier.com/x86/pmovsx - PMOVSXBW - // PMOVSXWD is the PMOVSXWD instruction https://www.felixcloutier.com/x86/pmovsx - PMOVSXWD - // PMOVSXDQ is the PMOVSXDQ instruction https://www.felixcloutier.com/x86/pmovsx - PMOVSXDQ - // PMOVZXBW is the PMOVZXBW instruction https://www.felixcloutier.com/x86/pmovzx - PMOVZXBW - // PMOVZXWD is the PMOVZXWD instruction https://www.felixcloutier.com/x86/pmovzx - PMOVZXWD - // PMOVZXDQ is the PMOVZXDQ instruction https://www.felixcloutier.com/x86/pmovzx - PMOVZXDQ - // PSHUFB is the PSHUFB instruction https://www.felixcloutier.com/x86/pshufb - PSHUFB - // PSHUFD is the PSHUFD instruction https://www.felixcloutier.com/x86/pshufd - PSHUFD - // PXOR is the PXOR instruction https://www.felixcloutier.com/x86/pxor - PXOR - // PEXTRB is the PEXTRB instruction https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRB - // PEXTRW is the PEXTRW instruction https://www.felixcloutier.com/x86/pextrw - PEXTRW - // PEXTRD is the PEXTRD instruction https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRD - // PEXTRQ is the PEXTRQ instruction https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRQ - // MOVLHPS is the MOVLHPS instruction https://www.felixcloutier.com/x86/movlhps - MOVLHPS - // INSERTPS is the INSERTPS instruction https://www.felixcloutier.com/x86/insertps - INSERTPS - // PTEST is the PTEST instruction https://www.felixcloutier.com/x86/ptest - PTEST - // PCMPEQB is the PCMPEQB instruction https://www.felixcloutier.com/x86/pcmpeqb:pcmpeqw:pcmpeqd - PCMPEQB - // PCMPEQW is the PCMPEQW instruction https://www.felixcloutier.com/x86/pcmpeqb:pcmpeqw:pcmpeqd - PCMPEQW - // PCMPEQD is the PCMPEQD instruction https://www.felixcloutier.com/x86/pcmpeqb:pcmpeqw:pcmpeqd - PCMPEQD - // PCMPEQQ is the PCMPEQQ instruction https://www.felixcloutier.com/x86/pcmpeqq - PCMPEQQ - // PADDUSB is the PADDUSB instruction https://www.felixcloutier.com/x86/paddusb:paddusw - PADDUSB - // MOVSD is the MOVSD instruction https://www.felixcloutier.com/x86/movsd - MOVSD - // PACKSSWB is the PACKSSWB instruction https://www.felixcloutier.com/x86/packsswb:packssdw - PACKSSWB - // PMOVMSKB is the PMOVMSKB instruction https://www.felixcloutier.com/x86/pmovmskb - PMOVMSKB - // MOVMSKPS is the MOVMSKPS instruction https://www.felixcloutier.com/x86/movmskps - MOVMSKPS - // MOVMSKPD is the MOVMSKPD instruction https://www.felixcloutier.com/x86/movmskpd - MOVMSKPD - // PAND is the PAND instruction https://www.felixcloutier.com/x86/pand - PAND - // POR is the POR instruction https://www.felixcloutier.com/x86/por - POR - // PANDN is the PANDN instruction https://www.felixcloutier.com/x86/pandn - PANDN - // PSRAD is the PSRAD instruction https://www.felixcloutier.com/x86/psraw:psrad:psraq - PSRAD - // PSRAW is the PSRAW instruction https://www.felixcloutier.com/x86/psraw:psrad:psraq - PSRAW - // PSRLW is the PSRLW instruction https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLW - // PSLLW is the PSLLW instruction https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLW - // PUNPCKLBW is the PUNPCKLBW instruction https://www.felixcloutier.com/x86/punpcklbw:punpcklwd:punpckldq:punpcklqdq - PUNPCKLBW - // PUNPCKHBW is the PUNPCKHBW instruction https://www.felixcloutier.com/x86/punpckhbw:punpckhwd:punpckhdq:punpckhqdq - PUNPCKHBW - // CMPPS is the CMPPS instruction https://www.felixcloutier.com/x86/cmpps - CMPPS - // CMPPD is the https://www.felixcloutier.com/x86/cmppd - CMPPD - // PCMPGTQ is the PCMPGTQ instruction https://www.felixcloutier.com/x86/pcmpgtq - PCMPGTQ - // PCMPGTD is the PCMPGTD instruction https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTD - // PCMPGTW is the PCMPGTW instruction https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTW - // PCMPGTB is the PCMPGTB instruction https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTB - // PMINSD is the PMINSD instruction https://www.felixcloutier.com/x86/pminsd:pminsq - PMINSD - // PMINSW is the PMINSW instruction https://www.felixcloutier.com/x86/pminsb:pminsw - PMINSW - // PMINSB is the PMINSB instruction https://www.felixcloutier.com/x86/pminsb:pminsw - PMINSB - // PMAXSD is the PMAXSD instruction https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSD - // PMAXSW is the PMAXSW instruction https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSW - // PMAXSB is the PMAXSB instruction https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSB - // PMINUD is the PMINUD instruction https://www.felixcloutier.com/x86/pminud:pminuq - PMINUD - // PMINUW is the PMINUW instruction https://www.felixcloutier.com/x86/pminub:pminuw - PMINUW - // PMINUB is the PMINUB instruction https://www.felixcloutier.com/x86/pminub:pminuw - PMINUB - // PMAXUD is the PMAXUD instruction https://www.felixcloutier.com/x86/pmaxud:pmaxuq - PMAXUD - // PMAXUW is the PMAXUW instruction https://www.felixcloutier.com/x86/pmaxub:pmaxuw - PMAXUW - // PMAXUB is the PMAXUB instruction https://www.felixcloutier.com/x86/pmaxub:pmaxuw - PMAXUB - // PMULLW is the PMULLW instruction https://www.felixcloutier.com/x86/pmullw - PMULLW - // PMULLD is the PMULLD instruction https://www.felixcloutier.com/x86/pmulld:pmullq - PMULLD - // PMULUDQ is the PMULUDQ instruction https://www.felixcloutier.com/x86/pmuludq - PMULUDQ - // PSUBSB is the PSUBSB instruction https://www.felixcloutier.com/x86/psubsb:psubsw - PSUBSB - // PSUBSW is the PSUBSW instruction https://www.felixcloutier.com/x86/psubsb:psubsw - PSUBSW - // PSUBUSB is the PSUBUSB instruction https://www.felixcloutier.com/x86/psubusb:psubusw - PSUBUSB - // PSUBUSW is the PSUBUSW instruction https://www.felixcloutier.com/x86/psubusb:psubusw - PSUBUSW - // PADDSW is the PADDSW instruction https://www.felixcloutier.com/x86/paddsb:paddsw - PADDSW - // PADDSB is the PADDSB instruction https://www.felixcloutier.com/x86/paddsb:paddsw - PADDSB - // PADDUSW is the PADDUSW instruction https://www.felixcloutier.com/x86/paddusb:paddusw - PADDUSW - // PAVGB is the PAVGB instruction https://www.felixcloutier.com/x86/pavgb:pavgw - PAVGB - // PAVGW is the PAVGW instruction https://www.felixcloutier.com/x86/pavgb:pavgw - PAVGW - // PABSB is the PABSB instruction https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSB - // PABSW is the PABSW instruction https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSW - // PABSD is the PABSD instruction https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSD - // BLENDVPD is the BLENDVPD instruction https://www.felixcloutier.com/x86/blendvpd - BLENDVPD - // MAXPD is the MAXPD instruction https://www.felixcloutier.com/x86/maxpd - MAXPD - // MAXPS is the MAXPS instruction https://www.felixcloutier.com/x86/maxps - MAXPS - // MINPD is the MINPD instruction https://www.felixcloutier.com/x86/minpd - MINPD - // MINPS is the MINPS instruction https://www.felixcloutier.com/x86/minps - MINPS - // ANDNPD is the ANDNPD instruction https://www.felixcloutier.com/x86/andnpd - ANDNPD - // ANDNPS is the ANDNPS instruction https://www.felixcloutier.com/x86/andnps - ANDNPS - // MULPS is the MULPS instruction https://www.felixcloutier.com/x86/mulps - MULPS - // MULPD is the MULPD instruction https://www.felixcloutier.com/x86/mulpd - MULPD - // DIVPS is the DIVPS instruction https://www.felixcloutier.com/x86/divps - DIVPS - // DIVPD is the DIVPD instruction https://www.felixcloutier.com/x86/divpd - DIVPD - // SQRTPS is the SQRTPS instruction https://www.felixcloutier.com/x86/sqrtps - SQRTPS - // SQRTPD is the SQRTPD instruction https://www.felixcloutier.com/x86/sqrtpd - SQRTPD - // ROUNDPS is the ROUNDPS instruction https://www.felixcloutier.com/x86/roundps - ROUNDPS - // ROUNDPD is the ROUNDPD instruction https://www.felixcloutier.com/x86/roundpd - ROUNDPD - // PALIGNR is the PALIGNR instruction https://www.felixcloutier.com/x86/palignr - PALIGNR - // PUNPCKLWD is the PUNPCKLWD instruction https://www.felixcloutier.com/x86/punpcklbw:punpcklwd:punpckldq:punpcklqdq - PUNPCKLWD - // PUNPCKHWD is the PUNPCKHWD instruction https://www.felixcloutier.com/x86/punpckhbw:punpckhwd:punpckhdq:punpckhqdq - PUNPCKHWD - // PMULHUW is the PMULHUW instruction https://www.felixcloutier.com/x86/pmulhuw - PMULHUW - // PMULDQ is the PMULDQ instruction https://www.felixcloutier.com/x86/pmuldq - PMULDQ - // PMULHRSW is the PMULHRSW instruction https://www.felixcloutier.com/x86/pmulhrsw - PMULHRSW - // PMULHW is the PMULHW instruction https://www.felixcloutier.com/x86/pmulhw - PMULHW - // CMPEQPS is the CMPEQPS instruction https://www.felixcloutier.com/x86/cmpps - CMPEQPS - // CMPEQPD is the CMPEQPD instruction https://www.felixcloutier.com/x86/cmppd - CMPEQPD - // CVTTPS2DQ is the CVTTPS2DQ instruction https://www.felixcloutier.com/x86/cvttps2dq - CVTTPS2DQ - // CVTDQ2PS is the CVTDQ2PS instruction https://www.felixcloutier.com/x86/cvtdq2ps - CVTDQ2PS - // MOVUPD is the MOVUPD instruction https://www.felixcloutier.com/x86/movupd - MOVUPD - // SHUFPS is the SHUFPS instruction https://www.felixcloutier.com/x86/shufps - SHUFPS - // PMADDWD is the PMADDWD instruction https://www.felixcloutier.com/x86/pmaddwd - PMADDWD - // CVTDQ2PD is the CVTDQ2PD instruction https://www.felixcloutier.com/x86/cvtdq2pd - CVTDQ2PD - // UNPCKLPS is the UNPCKLPS instruction https://www.felixcloutier.com/x86/unpcklps - UNPCKLPS - // PACKUSWB is the PACKUSWB instruction https://www.felixcloutier.com/x86/packuswb - PACKUSWB - // PACKSSDW is the PACKSSDW instruction https://www.felixcloutier.com/x86/packsswb:packssdw - PACKSSDW - // PACKUSDW is the PACKUSDW instruction https://www.felixcloutier.com/x86/packusdw - PACKUSDW - // CVTPS2PD is the CVTPS2PD instruction https://www.felixcloutier.com/x86/cvtps2pd - CVTPS2PD - // CVTPD2PS is the CVTPD2PS instruction https://www.felixcloutier.com/x86/cvtpd2ps - CVTPD2PS - // PMADDUBSW is the PMADDUBSW instruction https://www.felixcloutier.com/x86/pmaddubsw - PMADDUBSW - // CVTTPD2DQ is the CVTTPD2DQ instruction https://www.felixcloutier.com/x86/cvttpd2dq - CVTTPD2DQ - - // instructionEnd is always placed at the bottom of this iota definition to be used in the test. - instructionEnd -) - -// InstructionName returns the name for an instruction -func InstructionName(instruction asm.Instruction) string { - switch instruction { - case ADDL: - return "ADDL" - case ADDQ: - return "ADDQ" - case ADDSD: - return "ADDSD" - case ADDSS: - return "ADDSS" - case ANDL: - return "ANDL" - case ANDPD: - return "ANDPD" - case ANDPS: - return "ANDPS" - case ANDQ: - return "ANDQ" - case BSRL: - return "BSRL" - case BSRQ: - return "BSRQ" - case CDQ: - return "CDQ" - case CLD: - return "CLD" - case CMOVQCS: - return "CMOVQCS" - case CMPL: - return "CMPL" - case CMPQ: - return "CMPQ" - case COMISD: - return "COMISD" - case COMISS: - return "COMISS" - case CQO: - return "CQO" - case CVTSD2SS: - return "CVTSD2SS" - case CVTSL2SD: - return "CVTSL2SD" - case CVTSL2SS: - return "CVTSL2SS" - case CVTSQ2SD: - return "CVTSQ2SD" - case CVTSQ2SS: - return "CVTSQ2SS" - case CVTSS2SD: - return "CVTSS2SD" - case CVTTSD2SL: - return "CVTTSD2SL" - case CVTTSD2SQ: - return "CVTTSD2SQ" - case CVTTSS2SL: - return "CVTTSS2SL" - case CVTTSS2SQ: - return "CVTTSS2SQ" - case DECQ: - return "DECQ" - case DIVL: - return "DIVL" - case DIVQ: - return "DIVQ" - case DIVSD: - return "DIVSD" - case DIVSS: - return "DIVSS" - case IDIVL: - return "IDIVL" - case IDIVQ: - return "IDIVQ" - case INCQ: - return "INCQ" - case JCC: - return "JCC" - case JCS: - return "JCS" - case JEQ: - return "JEQ" - case JGE: - return "JGE" - case JGT: - return "JGT" - case JHI: - return "JHI" - case JLE: - return "JLE" - case JLS: - return "JLS" - case JLT: - return "JLT" - case JMI: - return "JMI" - case JNE: - return "JNE" - case JPC: - return "JPC" - case JPL: - return "JPL" - case JPS: - return "JPS" - case LEAQ: - return "LEAQ" - case LZCNTL: - return "LZCNTL" - case LZCNTQ: - return "LZCNTQ" - case MAXSD: - return "MAXSD" - case MAXSS: - return "MAXSS" - case MINSD: - return "MINSD" - case MINSS: - return "MINSS" - case MOVB: - return "MOVB" - case MOVBLSX: - return "MOVBLSX" - case MOVBLZX: - return "MOVBLZX" - case MOVBQSX: - return "MOVBQSX" - case MOVBQZX: - return "MOVBQZX" - case MOVL: - return "MOVL" - case MOVLQSX: - return "MOVLQSX" - case MOVLQZX: - return "MOVLQZX" - case MOVQ: - return "MOVQ" - case MOVW: - return "MOVW" - case MOVWLSX: - return "MOVWLSX" - case MOVWLZX: - return "MOVWLZX" - case MOVWQSX: - return "MOVWQSX" - case MOVWQZX: - return "MOVWQZX" - case MULL: - return "MULL" - case MULQ: - return "MULQ" - case IMULQ: - return "IMULQ" - case MULSD: - return "MULSD" - case MULSS: - return "MULSS" - case ORL: - return "ORL" - case ORPD: - return "ORPD" - case ORPS: - return "ORPS" - case ORQ: - return "ORQ" - case POPCNTL: - return "POPCNTL" - case POPCNTQ: - return "POPCNTQ" - case PSLLD: - return "PSLLD" - case PSLLQ: - return "PSLLQ" - case PSRLD: - return "PSRLD" - case PSRLQ: - return "PSRLQ" - case REPMOVSQ: - return "REP MOVSQ" - case REPSTOSQ: - return "REP STOSQ" - case ROLL: - return "ROLL" - case ROLQ: - return "ROLQ" - case RORL: - return "RORL" - case RORQ: - return "RORQ" - case ROUNDSD: - return "ROUNDSD" - case ROUNDSS: - return "ROUNDSS" - case SARL: - return "SARL" - case SARQ: - return "SARQ" - case SETCC: - return "SETCC" - case SETCS: - return "SETCS" - case SETEQ: - return "SETEQ" - case SETGE: - return "SETGE" - case SETGT: - return "SETGT" - case SETHI: - return "SETHI" - case SETLE: - return "SETLE" - case SETLS: - return "SETLS" - case SETLT: - return "SETLT" - case SETMI: - return "SETMI" - case SETNE: - return "SETNE" - case SETPC: - return "SETPC" - case SETPL: - return "SETPL" - case SETPS: - return "SETPS" - case SHLL: - return "SHLL" - case SHLQ: - return "SHLQ" - case SHRL: - return "SHRL" - case SHRQ: - return "SHRQ" - case SQRTSD: - return "SQRTSD" - case SQRTSS: - return "SQRTSS" - case STD: - return "STD" - case SUBL: - return "SUBL" - case SUBQ: - return "SUBQ" - case SUBSD: - return "SUBSD" - case SUBSS: - return "SUBSS" - case TESTL: - return "TESTL" - case TESTQ: - return "TESTQ" - case TZCNTL: - return "TZCNTL" - case TZCNTQ: - return "TZCNTQ" - case UCOMISD: - return "UCOMISD" - case UCOMISS: - return "UCOMISS" - case XORL: - return "XORL" - case XORPD: - return "XORPD" - case XORPS: - return "XORPS" - case XORQ: - return "XORQ" - case XCHGQ: - return "XCHGQ" - case RET: - return "RET" - case JMP: - return "JMP" - case NOP: - return "NOP" - case UD2: - return "UD2" - case MOVDQU: - return "MOVDQU" - case PINSRB: - return "PINSRB" - case PINSRW: - return "PINSRW" - case PINSRD: - return "PINSRD" - case PINSRQ: - return "PINSRQ" - case PADDB: - return "PADDB" - case PADDW: - return "PADDW" - case PADDD: - return "PADDD" - case PADDQ: - return "PADDQ" - case ADDPS: - return "ADDPS" - case ADDPD: - return "ADDPD" - case PSUBB: - return "PSUBB" - case PSUBW: - return "PSUBW" - case PSUBD: - return "PSUBD" - case PSUBQ: - return "PSUBQ" - case SUBPS: - return "SUBPS" - case SUBPD: - return "SUBPD" - case PMOVSXBW: - return "PMOVSXBW" - case PMOVSXWD: - return "PMOVSXWD" - case PMOVSXDQ: - return "PMOVSXDQ" - case PMOVZXBW: - return "PMOVZXBW" - case PMOVZXWD: - return "PMOVZXWD" - case PMOVZXDQ: - return "PMOVZXDQ" - case PSHUFB: - return "PSHUFB" - case PSHUFD: - return "PSHUFD" - case PXOR: - return "PXOR" - case PEXTRB: - return "PEXTRB" - case PEXTRW: - return "PEXTRW" - case PEXTRD: - return "PEXTRD" - case PEXTRQ: - return "PEXTRQ" - case INSERTPS: - return "INSERTPS" - case MOVLHPS: - return "MOVLHPS" - case PTEST: - return "PTEST" - case PCMPEQB: - return "PCMPEQB" - case PCMPEQW: - return "PCMPEQW" - case PCMPEQD: - return "PCMPEQD" - case PCMPEQQ: - return "PCMPEQQ" - case PADDUSB: - return "PADDUSB" - case MOVDQA: - return "MOVDQA" - case MOVSD: - return "MOVSD" - case PACKSSWB: - return "PACKSSWB" - case PMOVMSKB: - return "PMOVMSKB" - case MOVMSKPS: - return "MOVMSKPS" - case MOVMSKPD: - return "MOVMSKPD" - case PAND: - return "PAND" - case POR: - return "POR" - case PANDN: - return "PANDN" - case PSRAD: - return "PSRAD" - case PSRAW: - return "PSRAW" - case PSRLW: - return "PSRLW" - case PSLLW: - return "PSLLW" - case PUNPCKLBW: - return "PUNPCKLBW" - case PUNPCKHBW: - return "PUNPCKHBW" - case NEGQ: - return "NEGQ" - case NONE: - return "NONE" - case CMPPS: - return "CMPPS" - case CMPPD: - return "CMPPD" - case PCMPGTQ: - return "PCMPGTQ" - case PCMPGTD: - return "PCMPGTD" - case PMINSD: - return "PMINSD" - case PMAXSD: - return "PMAXSD" - case PMINSW: - return "PMINSW" - case PCMPGTB: - return "PCMPGTB" - case PMINSB: - return "PMINSB" - case PMINUD: - return "PMINUD" - case PMINUW: - return "PMINUW" - case PMINUB: - return "PMINUB" - case PMAXUD: - return "PMAXUD" - case PMAXUW: - return "PMAXUW" - case PMAXUB: - return "PMAXUB" - case PCMPGTW: - return "PCMPGTW" - case PMAXSW: - return "PMAXSW" - case PMAXSB: - return "PMAXSB" - case PMULLW: - return "PMULLW" - case PMULLD: - return "PMULLD" - case PMULUDQ: - return "PMULUDQ" - case PSUBSB: - return "PSUBSB" - case PSUBUSB: - return "PSUBUSB" - case PADDSW: - return "PADDSW" - case PADDSB: - return "PADDSB" - case PADDUSW: - return "PADDUSW" - case PSUBSW: - return "PSUBSW" - case PSUBUSW: - return "PSUBUSW" - case PAVGB: - return "PAVGB" - case PAVGW: - return "PAVGW" - case PABSB: - return "PABSB" - case PABSW: - return "PABSW" - case PABSD: - return "PABSD" - case BLENDVPD: - return "BLENDVPD" - case MAXPD: - return "MAXPD" - case MAXPS: - return "MAXPS" - case MINPD: - return "MINPD" - case MINPS: - return "MINPS" - case ANDNPD: - return "ANDNPD" - case ANDNPS: - return "ANDNPS" - case MULPS: - return "MULPS" - case MULPD: - return "MULPD" - case DIVPS: - return "DIVPS" - case DIVPD: - return "DIVPD" - case SQRTPS: - return "SQRTPS" - case SQRTPD: - return "SQRTPD" - case ROUNDPS: - return "ROUNDPS" - case ROUNDPD: - return "ROUNDPD" - case PALIGNR: - return "PALIGNR" - case PUNPCKLWD: - return "PUNPCKLWD" - case PUNPCKHWD: - return "PUNPCKHWD" - case PMULHUW: - return "PMULHUW" - case PMULDQ: - return "PMULDQ" - case PMULHRSW: - return "PMULHRSW" - case PMULHW: - return "PMULHW" - case CMPEQPS: - return "CMPEQPS" - case CMPEQPD: - return "CMPEQPD" - case CVTTPS2DQ: - return "CVTTPS2DQ" - case CVTDQ2PS: - return "CVTDQ2PS" - case MOVUPD: - return "MOVUPD" - case SHUFPS: - return "SHUFPS" - case PMADDWD: - return "PMADDWD" - case CVTDQ2PD: - return "CVTDQ2PD" - case UNPCKLPS: - return "UNPCKLPS" - case PACKUSWB: - return "PACKUSWB" - case PACKSSDW: - return "PACKSSDW" - case PACKUSDW: - return "PACKUSDW" - case CVTPS2PD: - return "CVTPS2PD" - case CVTPD2PS: - return "CVTPD2PS" - case PMADDUBSW: - return "PMADDUBSW" - case CVTTPD2DQ: - return "CVTTPD2DQ" - } - panic(fmt.Errorf("unknown instruction %d", instruction)) -} - -// Amd64-specific registers. -// -// Note: naming convention intentionally matches the Go assembler: https://go.dev/doc/asm -// See https://www.lri.fr/~filliatr/ens/compil/x86-64.pdf -// See https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf -const ( - // RegAX is the ax register - RegAX = asm.NilRegister + 1 + iota - // RegCX is the cx register - RegCX - // RegDX is the dx register - RegDX - // RegBX is the bx register - RegBX - // RegSP is the sp register - RegSP - // RegBP is the bp register - RegBP - // RegSI is the si register - RegSI - // RegDI is the di register - RegDI - // RegR8 is the r8 register - RegR8 - // RegR9 is the r9 register - RegR9 - // RegR10 is the r10 register - RegR10 - // RegR11 is the r11 register - RegR11 - // RegR12 is the r12 register - RegR12 - // RegR13 is the r13 register - RegR13 - // RegR14 is the r14 register - RegR14 - // RegR15 is the r15 register - RegR15 - // RegX0 is the x0 register - RegX0 - // RegX1 is the x1 register - RegX1 - // RegX2 is the x2 register - RegX2 - // RegX3 is the x3 register - RegX3 - // RegX4 is the x4 register - RegX4 - // RegX5 is the x5 register - RegX5 - // RegX6 is the x6 register - RegX6 - // RegX7 is the x7 register - RegX7 - // RegX8 is the x8 register - RegX8 - // RegX9 is the x9 register - RegX9 - // RegX10 is the x10 register - RegX10 - // RegX11 is the x11 register - RegX11 - // RegX12 is the x12 register - RegX12 - // RegX13 is the x13 register - RegX13 - // RegX14 is the x14 register - RegX14 - // RegX15 is the x15 register - RegX15 -) - -// RegisterName returns the name for a register -func RegisterName(reg asm.Register) string { - switch reg { - case RegAX: - return "AX" - case RegCX: - return "CX" - case RegDX: - return "DX" - case RegBX: - return "BX" - case RegSP: - return "SP" - case RegBP: - return "BP" - case RegSI: - return "SI" - case RegDI: - return "DI" - case RegR8: - return "R8" - case RegR9: - return "R9" - case RegR10: - return "R10" - case RegR11: - return "R11" - case RegR12: - return "R12" - case RegR13: - return "R13" - case RegR14: - return "R14" - case RegR15: - return "R15" - case RegX0: - return "X0" - case RegX1: - return "X1" - case RegX2: - return "X2" - case RegX3: - return "X3" - case RegX4: - return "X4" - case RegX5: - return "X5" - case RegX6: - return "X6" - case RegX7: - return "X7" - case RegX8: - return "X8" - case RegX9: - return "X9" - case RegX10: - return "X10" - case RegX11: - return "X11" - case RegX12: - return "X12" - case RegX13: - return "X13" - case RegX14: - return "X14" - case RegX15: - return "X15" - default: - return "nil" - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl.go b/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl.go deleted file mode 100644 index 8479d81c31..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl.go +++ /dev/null @@ -1,2812 +0,0 @@ -package amd64 - -import ( - "encoding/binary" - "errors" - "fmt" - "math" - - "github.com/tetratelabs/wazero/internal/asm" -) - -// nodeImpl implements asm.Node for amd64. -type nodeImpl struct { - // jumpTarget holds the target node in the linked for the jump-kind instruction. - jumpTarget *nodeImpl - - // prev and next hold the prev/next node from this node in the assembled linked list. - prev, next *nodeImpl - - // forwardJumpOrigins hold all the nodes trying to jump into this node as a - // singly linked list. In other words, all the nodes with .jumpTarget == this. - forwardJumpOrigins *nodeImpl - - staticConst *asm.StaticConst - - dstConst asm.ConstantValue - offsetInBinary asm.NodeOffsetInBinary - srcConst asm.ConstantValue - instruction asm.Instruction - - // readInstructionAddressBeforeTargetInstruction holds the instruction right before the target of - // read instruction address instruction. See asm.assemblerBase.CompileReadInstructionAddress. - readInstructionAddressBeforeTargetInstruction asm.Instruction - flag nodeFlag - types operandTypes - srcReg, dstReg asm.Register - srcMemIndex, dstMemIndex asm.Register - srcMemScale, dstMemScale byte - arg byte - - // staticConstReferrersAdded true if this node is already added into AssemblerImpl.staticConstReferrers. - // Only used when staticConst is not nil. Through re-assembly, we might end up adding multiple times which causes unnecessary - // allocations, so we use this flag to do it once. - staticConstReferrersAdded bool -} - -type nodeFlag byte - -const ( - // nodeFlagInitializedForEncoding is always set to indicate that node is already initialized. Notably, this is used to judge - // whether a jump is backward or forward before encoding. - nodeFlagInitializedForEncoding nodeFlag = 1 << iota - nodeFlagBackwardJump - // nodeFlagShortForwardJump is set to false by default and only used by forward branch jumps, which means .jumpTarget != nil and - // the target node is encoded after this node. False by default means that we Encode all the jumps with jumpTarget - // as short jump (i.e. relative signed 8-bit integer offset jump) and try to Encode as small as possible. - nodeFlagShortForwardJump -) - -func (n *nodeImpl) isInitializedForEncoding() bool { - return n.flag&nodeFlagInitializedForEncoding != 0 -} - -func (n *nodeImpl) isJumpNode() bool { - return n.jumpTarget != nil -} - -func (n *nodeImpl) isBackwardJump() bool { - return n.isJumpNode() && (n.flag&nodeFlagBackwardJump != 0) -} - -func (n *nodeImpl) isForwardJump() bool { - return n.isJumpNode() && (n.flag&nodeFlagBackwardJump == 0) -} - -func (n *nodeImpl) isForwardShortJump() bool { - return n.isForwardJump() && n.flag&nodeFlagShortForwardJump != 0 -} - -// AssignJumpTarget implements asm.Node.AssignJumpTarget. -func (n *nodeImpl) AssignJumpTarget(target asm.Node) { - n.jumpTarget = target.(*nodeImpl) -} - -// AssignDestinationConstant implements asm.Node.AssignDestinationConstant. -func (n *nodeImpl) AssignDestinationConstant(value asm.ConstantValue) { - n.dstConst = value -} - -// AssignSourceConstant implements asm.Node.AssignSourceConstant. -func (n *nodeImpl) AssignSourceConstant(value asm.ConstantValue) { - n.srcConst = value -} - -// OffsetInBinary implements asm.Node.OffsetInBinary. -func (n *nodeImpl) OffsetInBinary() asm.NodeOffsetInBinary { - return n.offsetInBinary -} - -// String implements fmt.Stringer. -// -// This is for debugging purpose, and the format is almost same as the AT&T assembly syntax, -// meaning that this should look like "INSTRUCTION ${from}, ${to}" where each operand -// might be embraced by '[]' to represent the memory location. -func (n *nodeImpl) String() (ret string) { - instName := InstructionName(n.instruction) - switch n.types { - case operandTypesNoneToNone: - ret = instName - case operandTypesNoneToRegister: - ret = fmt.Sprintf("%s %s", instName, RegisterName(n.dstReg)) - case operandTypesNoneToMemory: - if n.dstMemIndex != asm.NilRegister { - ret = fmt.Sprintf("%s [%s + 0x%x + %s*0x%x]", instName, - RegisterName(n.dstReg), n.dstConst, RegisterName(n.dstMemIndex), n.dstMemScale) - } else { - ret = fmt.Sprintf("%s [%s + 0x%x]", instName, RegisterName(n.dstReg), n.dstConst) - } - case operandTypesNoneToBranch: - ret = fmt.Sprintf("%s {%v}", instName, n.jumpTarget) - case operandTypesRegisterToNone: - ret = fmt.Sprintf("%s %s", instName, RegisterName(n.srcReg)) - case operandTypesRegisterToRegister: - ret = fmt.Sprintf("%s %s, %s", instName, RegisterName(n.srcReg), RegisterName(n.dstReg)) - case operandTypesRegisterToMemory: - if n.dstMemIndex != asm.NilRegister { - ret = fmt.Sprintf("%s %s, [%s + 0x%x + %s*0x%x]", instName, RegisterName(n.srcReg), - RegisterName(n.dstReg), n.dstConst, RegisterName(n.dstMemIndex), n.dstMemScale) - } else { - ret = fmt.Sprintf("%s %s, [%s + 0x%x]", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), n.dstConst) - } - case operandTypesRegisterToConst: - ret = fmt.Sprintf("%s %s, 0x%x", instName, RegisterName(n.srcReg), n.dstConst) - case operandTypesMemoryToRegister: - if n.srcMemIndex != asm.NilRegister { - ret = fmt.Sprintf("%s [%s + %#x + %s*%#x], %s", instName, - RegisterName(n.srcReg), n.srcConst, RegisterName(n.srcMemIndex), n.srcMemScale, RegisterName(n.dstReg)) - } else { - ret = fmt.Sprintf("%s [%s + 0x%x], %s", instName, RegisterName(n.srcReg), n.srcConst, RegisterName(n.dstReg)) - } - case operandTypesMemoryToConst: - if n.srcMemIndex != asm.NilRegister { - ret = fmt.Sprintf("%s [%s + %#x + %s*0x%x], 0x%x", instName, - RegisterName(n.srcReg), n.srcConst, RegisterName(n.srcMemIndex), n.srcMemScale, n.dstConst) - } else { - ret = fmt.Sprintf("%s [%s + %#x], 0x%x", instName, RegisterName(n.srcReg), n.srcConst, n.dstConst) - } - case operandTypesConstToMemory: - if n.dstMemIndex != asm.NilRegister { - ret = fmt.Sprintf("%s 0x%x, [%s + 0x%x + %s*0x%x]", instName, n.srcConst, - RegisterName(n.dstReg), n.dstConst, RegisterName(n.dstMemIndex), n.dstMemScale) - } else { - ret = fmt.Sprintf("%s 0x%x, [%s + 0x%x]", instName, n.srcConst, RegisterName(n.dstReg), n.dstConst) - } - case operandTypesConstToRegister: - ret = fmt.Sprintf("%s 0x%x, %s", instName, n.srcConst, RegisterName(n.dstReg)) - case operandTypesStaticConstToRegister: - ret = fmt.Sprintf("%s $%#x, %s", instName, n.staticConst.Raw, RegisterName(n.dstReg)) - case operandTypesRegisterToStaticConst: - ret = fmt.Sprintf("%s %s, $%#x", instName, RegisterName(n.srcReg), n.staticConst.Raw) - } - return -} - -type operandTypes byte - -const ( - operandTypesNoneToNone operandTypes = iota - operandTypesNoneToRegister - operandTypesNoneToMemory - operandTypesNoneToBranch - operandTypesRegisterToNone - operandTypesRegisterToRegister - operandTypesRegisterToMemory - operandTypesRegisterToConst - operandTypesMemoryToRegister - operandTypesMemoryToConst - operandTypesConstToRegister - operandTypesConstToMemory - operandTypesStaticConstToRegister - operandTypesRegisterToStaticConst -) - -// String implements fmt.Stringer -func (o operandTypes) String() (ret string) { - switch o { - case operandTypesNoneToNone: - ret = "NoneToNone" - case operandTypesNoneToRegister: - ret = "NoneToRegister" - case operandTypesNoneToMemory: - ret = "NoneToMemory" - case operandTypesNoneToBranch: - ret = "NoneToBranch" - case operandTypesRegisterToNone: - ret = "RegisterToNone" - case operandTypesRegisterToRegister: - ret = "RegisterToRegister" - case operandTypesRegisterToMemory: - ret = "RegisterToMemory" - case operandTypesRegisterToConst: - ret = "RegisterToConst" - case operandTypesMemoryToRegister: - ret = "MemoryToRegister" - case operandTypesMemoryToConst: - ret = "MemoryToConst" - case operandTypesConstToRegister: - ret = "ConstToRegister" - case operandTypesConstToMemory: - ret = "ConstToMemory" - case operandTypesStaticConstToRegister: - ret = "StaticConstToRegister" - case operandTypesRegisterToStaticConst: - ret = "RegisterToStaticConst" - } - return -} - -type ( - // AssemblerImpl implements Assembler. - AssemblerImpl struct { - root *nodeImpl - current *nodeImpl - asm.BaseAssemblerImpl - readInstructionAddressNodes []*nodeImpl - - // staticConstReferrers maintains the list of static const referrers which requires the - // offset resolution after finalizing the binary layout. - staticConstReferrers []staticConstReferrer - - nodePool nodePool - pool asm.StaticConstPool - - // MaxDisplacementForConstantPool is fixed to defaultMaxDisplacementForConstantPool - // but have it as an exported field here for testability. - MaxDisplacementForConstantPool int - - forceReAssemble bool - } - - // staticConstReferrer represents a referrer of a asm.StaticConst. - staticConstReferrer struct { - n *nodeImpl - // instLen is the encoded length of the instruction for `n`. - instLen int - } -) - -func NewAssembler() *AssemblerImpl { - return &AssemblerImpl{ - nodePool: nodePool{index: nodePageSize}, - pool: asm.NewStaticConstPool(), - MaxDisplacementForConstantPool: defaultMaxDisplacementForConstantPool, - } -} - -const nodePageSize = 128 - -type nodePage = [nodePageSize]nodeImpl - -// nodePool is the central allocation pool for nodeImpl used by a single AssemblerImpl. -// This reduces the allocations over compilation by reusing AssemblerImpl. -type nodePool struct { - pages []*nodePage - index int -} - -// allocNode allocates a new nodeImpl for use from the pool. -// This expands the pool if there is no space left for it. -func (n *nodePool) allocNode() *nodeImpl { - if n.index == nodePageSize { - if len(n.pages) == cap(n.pages) { - n.pages = append(n.pages, new(nodePage)) - } else { - i := len(n.pages) - n.pages = n.pages[:i+1] - if n.pages[i] == nil { - n.pages[i] = new(nodePage) - } - } - n.index = 0 - } - ret := &n.pages[len(n.pages)-1][n.index] - n.index++ - return ret -} - -func (n *nodePool) reset() { - for _, ns := range n.pages { - pages := ns[:] - for i := range pages { - pages[i] = nodeImpl{} - } - } - n.pages = n.pages[:0] - n.index = nodePageSize -} - -// AllocateNOP implements asm.AssemblerBase. -func (a *AssemblerImpl) AllocateNOP() asm.Node { - n := a.nodePool.allocNode() - n.instruction = NOP - n.types = operandTypesNoneToNone - return n -} - -// Add implements asm.AssemblerBase. -func (a *AssemblerImpl) Add(n asm.Node) { - a.addNode(n.(*nodeImpl)) -} - -// Reset implements asm.AssemblerBase. -func (a *AssemblerImpl) Reset() { - pool := a.pool - pool.Reset() - *a = AssemblerImpl{ - nodePool: a.nodePool, - pool: pool, - readInstructionAddressNodes: a.readInstructionAddressNodes[:0], - staticConstReferrers: a.staticConstReferrers[:0], - BaseAssemblerImpl: asm.BaseAssemblerImpl{ - SetBranchTargetOnNextNodes: a.SetBranchTargetOnNextNodes[:0], - JumpTableEntries: a.JumpTableEntries[:0], - }, - } - a.nodePool.reset() -} - -// newNode creates a new Node and appends it into the linked list. -func (a *AssemblerImpl) newNode(instruction asm.Instruction, types operandTypes) *nodeImpl { - n := a.nodePool.allocNode() - n.instruction = instruction - n.types = types - a.addNode(n) - return n -} - -// addNode appends the new node into the linked list. -func (a *AssemblerImpl) addNode(node *nodeImpl) { - if a.root == nil { - a.root = node - a.current = node - } else { - parent := a.current - parent.next = node - node.prev = parent - a.current = node - } - - for _, o := range a.SetBranchTargetOnNextNodes { - origin := o.(*nodeImpl) - origin.jumpTarget = node - } - // Reuse the underlying slice to avoid re-allocations. - a.SetBranchTargetOnNextNodes = a.SetBranchTargetOnNextNodes[:0] -} - -// encodeNode encodes the given node into writer. -func (a *AssemblerImpl) encodeNode(buf asm.Buffer, n *nodeImpl) (err error) { - switch n.types { - case operandTypesNoneToNone: - err = a.encodeNoneToNone(buf, n) - case operandTypesNoneToRegister: - err = a.encodeNoneToRegister(buf, n) - case operandTypesNoneToMemory: - err = a.encodeNoneToMemory(buf, n) - case operandTypesNoneToBranch: - // Branching operand can be encoded as relative jumps. - err = a.encodeRelativeJump(buf, n) - case operandTypesRegisterToNone: - err = a.encodeRegisterToNone(buf, n) - case operandTypesRegisterToRegister: - err = a.encodeRegisterToRegister(buf, n) - case operandTypesRegisterToMemory: - err = a.encodeRegisterToMemory(buf, n) - case operandTypesRegisterToConst: - err = a.encodeRegisterToConst(buf, n) - case operandTypesMemoryToRegister: - err = a.encodeMemoryToRegister(buf, n) - case operandTypesMemoryToConst: - err = a.encodeMemoryToConst(buf, n) - case operandTypesConstToRegister: - err = a.encodeConstToRegister(buf, n) - case operandTypesConstToMemory: - err = a.encodeConstToMemory(buf, n) - case operandTypesStaticConstToRegister: - err = a.encodeStaticConstToRegister(buf, n) - case operandTypesRegisterToStaticConst: - err = a.encodeRegisterToStaticConst(buf, n) - default: - err = fmt.Errorf("encoder undefined for [%s] operand type", n.types) - } - if err != nil { - err = fmt.Errorf("%w: %s", err, n) // Ensure the error is debuggable by including the string value of the node. - } - return -} - -// Assemble implements asm.AssemblerBase -func (a *AssemblerImpl) Assemble(buf asm.Buffer) error { - a.initializeNodesForEncoding() - - // Continue encoding until we are not forced to re-assemble which happens when - // a short relative jump ends up the offset larger than 8-bit length. - for { - err := a.encode(buf) - if err != nil { - return err - } - - if !a.forceReAssemble { - break - } else { - // We reset the length of buffer but don't delete the underlying slice since - // the binary size will roughly the same after reassemble. - buf.Reset() - // Reset the re-assemble flag in order to avoid the infinite loop! - a.forceReAssemble = false - } - } - - code := buf.Bytes() - for _, n := range a.readInstructionAddressNodes { - if err := a.finalizeReadInstructionAddressNode(code, n); err != nil { - return err - } - } - - // Now that we've finished the layout, fill out static consts offsets. - for i := range a.staticConstReferrers { - ref := &a.staticConstReferrers[i] - n, instLen := ref.n, ref.instLen - // Calculate the displacement between the RIP (the offset _after_ n) and the static constant. - displacement := int(n.staticConst.OffsetInBinary) - int(n.OffsetInBinary()) - instLen - // The offset must be stored at the 4 bytes from the tail of this n. See AssemblerImpl.encodeStaticConstImpl for detail. - displacementOffsetInInstruction := n.OffsetInBinary() + uint64(instLen-4) - binary.LittleEndian.PutUint32(code[displacementOffsetInInstruction:], uint32(int32(displacement))) - } - - return a.FinalizeJumpTableEntry(code) -} - -// initializeNodesForEncoding initializes nodeImpl.flag and determine all the jumps -// are forward or backward jump. -func (a *AssemblerImpl) initializeNodesForEncoding() { - for n := a.root; n != nil; n = n.next { - n.flag |= nodeFlagInitializedForEncoding - if target := n.jumpTarget; target != nil { - if target.isInitializedForEncoding() { - // This means the target exists behind. - n.flag |= nodeFlagBackwardJump - } else { - // Otherwise, this is forward jump. - // We start with assuming that the jump can be short (8-bit displacement). - // If it doens't fit, we change this flag in resolveRelativeForwardJump. - n.flag |= nodeFlagShortForwardJump - - // If the target node is also the branching instruction, we replace the target with the NOP - // node so that we can avoid the collision of the target.forwardJumpOrigins both as destination and origins. - if target.types == operandTypesNoneToBranch { - // Allocate the NOP node from the pool. - nop := a.nodePool.allocNode() - nop.instruction = NOP - nop.types = operandTypesNoneToNone - // Insert it between target.prev and target: [target.prev, target] -> [target.prev, nop, target] - prev := target.prev - nop.prev = prev - prev.next = nop - nop.next = target - target.prev = nop - n.jumpTarget = nop - target = nop - } - - // We add this node `n` into the end of the linked list (.forwardJumpOrigins) beginning from the `target.forwardJumpOrigins`. - // Insert the current `n` as the head of the list. - n.forwardJumpOrigins = target.forwardJumpOrigins - target.forwardJumpOrigins = n - } - } - } -} - -func (a *AssemblerImpl) encode(buf asm.Buffer) error { - for n := a.root; n != nil; n = n.next { - // If an instruction needs NOP padding, we do so before encoding it. - // - // This is necessary to avoid Intel's jump erratum; see in Section 2.1 - // in for when we have to pad NOP: - // https://www.intel.com/content/dam/support/us/en/documents/processors/mitigations-jump-conditional-code-erratum.pdf - // - // This logic used to be implemented in a function called maybeNOPPadding, - // but the complexity of the logic made it impossible for the compiler to - // inline. Since this function is on a hot code path, we inlined the - // initial checks to skip the function call when instructions do not need - // NOP padding. - switch info := nopPaddingInfo[n.instruction]; { - case info.jmp: - if err := a.encodeJmpNOPPadding(buf, n); err != nil { - return err - } - case info.onNextJmp: - if err := a.encodeOnNextJmpNOPPAdding(buf, n); err != nil { - return err - } - } - - // After the padding, we can finalize the offset of this instruction in the binary. - n.offsetInBinary = uint64(buf.Len()) - - if err := a.encodeNode(buf, n); err != nil { - return err - } - - if n.forwardJumpOrigins != nil { - if err := a.resolveForwardRelativeJumps(buf, n); err != nil { - return fmt.Errorf("invalid relative forward jumps: %w", err) - } - } - - a.maybeFlushConstants(buf, n.next == nil) - } - return nil -} - -var nopPaddingInfo = [instructionEnd]struct { - jmp, onNextJmp bool -}{ - RET: {jmp: true}, - JMP: {jmp: true}, - JCC: {jmp: true}, - JCS: {jmp: true}, - JEQ: {jmp: true}, - JGE: {jmp: true}, - JGT: {jmp: true}, - JHI: {jmp: true}, - JLE: {jmp: true}, - JLS: {jmp: true}, - JLT: {jmp: true}, - JMI: {jmp: true}, - JNE: {jmp: true}, - JPC: {jmp: true}, - JPS: {jmp: true}, - // The possible fused jump instructions if the next node is a conditional jump instruction. - CMPL: {onNextJmp: true}, - CMPQ: {onNextJmp: true}, - TESTL: {onNextJmp: true}, - TESTQ: {onNextJmp: true}, - ADDL: {onNextJmp: true}, - ADDQ: {onNextJmp: true}, - SUBL: {onNextJmp: true}, - SUBQ: {onNextJmp: true}, - ANDL: {onNextJmp: true}, - ANDQ: {onNextJmp: true}, - INCQ: {onNextJmp: true}, - DECQ: {onNextJmp: true}, -} - -func (a *AssemblerImpl) encodeJmpNOPPadding(buf asm.Buffer, n *nodeImpl) error { - // In order to know the instruction length before writing into the binary, - // we try encoding it. - prevLen := buf.Len() - - // Assign the temporary offset which may or may not be correct depending on the padding decision. - n.offsetInBinary = uint64(prevLen) - - // Encode the node and get the instruction length. - if err := a.encodeNode(buf, n); err != nil { - return err - } - instructionLen := int32(buf.Len() - prevLen) - - // Revert the written bytes. - buf.Truncate(prevLen) - return a.encodeNOPPadding(buf, instructionLen) -} - -func (a *AssemblerImpl) encodeOnNextJmpNOPPAdding(buf asm.Buffer, n *nodeImpl) error { - instructionLen, err := a.fusedInstructionLength(buf, n) - if err != nil { - return err - } - return a.encodeNOPPadding(buf, instructionLen) -} - -// encodeNOPPadding maybe appends NOP instructions before the node `n`. -// This is necessary to avoid Intel's jump erratum: -// https://www.intel.com/content/dam/support/us/en/documents/processors/mitigations-jump-conditional-code-erratum.pdf -func (a *AssemblerImpl) encodeNOPPadding(buf asm.Buffer, instructionLen int32) error { - const boundaryInBytes int32 = 32 - const mask = boundaryInBytes - 1 - var padNum int - currentPos := int32(buf.Len()) - if used := currentPos & mask; used+instructionLen >= boundaryInBytes { - padNum = int(boundaryInBytes - used) - } - a.padNOP(buf, padNum) - return nil -} - -// fusedInstructionLength returns the length of "macro fused instruction" if the -// instruction sequence starting from `n` can be fused by processor. Otherwise, -// returns zero. -func (a *AssemblerImpl) fusedInstructionLength(buf asm.Buffer, n *nodeImpl) (ret int32, err error) { - // Find the next non-NOP instruction. - next := n.next - for ; next != nil && next.instruction == NOP; next = next.next { - } - - if next == nil { - return - } - - inst, jmpInst := n.instruction, next.instruction - - if !nopPaddingInfo[jmpInst].jmp { - // If the next instruction is not jump kind, the instruction will not be fused. - return - } - - // How to determine whether the instruction can be fused is described in - // Section 3.4.2.2 of "Intel Optimization Manual": - // https://www.intel.com/content/dam/doc/manual/64-ia-32-architectures-optimization-manual.pdf - isTest := inst == TESTL || inst == TESTQ - isCmp := inst == CMPQ || inst == CMPL - isTestCmp := isTest || isCmp - if isTestCmp && (n.types == operandTypesMemoryToConst || n.types == operandTypesConstToMemory) { - // The manual says: "CMP and TEST can not be fused when comparing MEM-IMM". - return - } - - // Implement the decision according to the table 3-1 in the manual. - isAnd := inst == ANDL || inst == ANDQ - if !isTest && !isAnd { - if jmpInst == JMI || jmpInst == JPL || jmpInst == JPS || jmpInst == JPC { - // These jumps are only fused for TEST or AND. - return - } - isAdd := inst == ADDL || inst == ADDQ - isSub := inst == SUBL || inst == SUBQ - if !isCmp && !isAdd && !isSub { - if jmpInst == JCS || jmpInst == JCC || jmpInst == JHI || jmpInst == JLS { - // Thses jumpst are only fused for TEST, AND, CMP, ADD, or SUB. - return - } - } - } - - // Now the instruction is ensured to be fused by the processor. - // In order to know the fused instruction length before writing into the binary, - // we try encoding it. - savedLen := uint64(buf.Len()) - - // Encode the nodes into the buffer. - if err = a.encodeNode(buf, n); err != nil { - return - } - if err = a.encodeNode(buf, next); err != nil { - return - } - - ret = int32(uint64(buf.Len()) - savedLen) - - // Revert the written bytes. - buf.Truncate(int(savedLen)) - return -} - -// nopOpcodes is the multi byte NOP instructions table derived from section 5.8 "Code Padding with Operand-Size Override and Multibyte NOP" -// in "AMD Software Optimization Guide for AMD Family 15h Processors" https://www.amd.com/system/files/TechDocs/47414_15h_sw_opt_guide.pdf -var nopOpcodes = [][11]byte{ - {0x90}, - {0x66, 0x90}, - {0x0f, 0x1f, 0x00}, - {0x0f, 0x1f, 0x40, 0x00}, - {0x0f, 0x1f, 0x44, 0x00, 0x00}, - {0x66, 0x0f, 0x1f, 0x44, 0x00, 0x00}, - {0x0f, 0x1f, 0x80, 0x00, 0x00, 0x00, 0x00}, - {0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, - {0x66, 0x66, 0x66, 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00}, -} - -func (a *AssemblerImpl) padNOP(buf asm.Buffer, num int) { - for num > 0 { - singleNopNum := num - if singleNopNum > len(nopOpcodes) { - singleNopNum = len(nopOpcodes) - } - buf.AppendBytes(nopOpcodes[singleNopNum-1][:singleNopNum]) - num -= singleNopNum - } -} - -// CompileStandAlone implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileStandAlone(instruction asm.Instruction) asm.Node { - return a.newNode(instruction, operandTypesNoneToNone) -} - -// CompileConstToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileConstToRegister( - instruction asm.Instruction, - value asm.ConstantValue, - destinationReg asm.Register, -) (inst asm.Node) { - n := a.newNode(instruction, operandTypesConstToRegister) - n.srcConst = value - n.dstReg = destinationReg - return n -} - -// CompileRegisterToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileRegisterToRegister(instruction asm.Instruction, from, to asm.Register) { - n := a.newNode(instruction, operandTypesRegisterToRegister) - n.srcReg = from - n.dstReg = to -} - -// CompileMemoryToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileMemoryToRegister( - instruction asm.Instruction, - sourceBaseReg asm.Register, - sourceOffsetConst asm.ConstantValue, - destinationReg asm.Register, -) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.srcReg = sourceBaseReg - n.srcConst = sourceOffsetConst - n.dstReg = destinationReg -} - -// CompileRegisterToMemory implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileRegisterToMemory( - instruction asm.Instruction, - sourceRegister, destinationBaseRegister asm.Register, - destinationOffsetConst asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesRegisterToMemory) - n.srcReg = sourceRegister - n.dstReg = destinationBaseRegister - n.dstConst = destinationOffsetConst -} - -// CompileJump implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileJump(jmpInstruction asm.Instruction) asm.Node { - return a.newNode(jmpInstruction, operandTypesNoneToBranch) -} - -// CompileJumpToMemory implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileJumpToMemory( - jmpInstruction asm.Instruction, - baseReg asm.Register, - offset asm.ConstantValue, -) { - n := a.newNode(jmpInstruction, operandTypesNoneToMemory) - n.dstReg = baseReg - n.dstConst = offset -} - -// CompileJumpToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileJumpToRegister(jmpInstruction asm.Instruction, reg asm.Register) { - n := a.newNode(jmpInstruction, operandTypesNoneToRegister) - n.dstReg = reg -} - -// CompileReadInstructionAddress implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileReadInstructionAddress( - destinationRegister asm.Register, - beforeAcquisitionTargetInstruction asm.Instruction, -) { - n := a.newNode(LEAQ, operandTypesMemoryToRegister) - n.dstReg = destinationRegister - n.readInstructionAddressBeforeTargetInstruction = beforeAcquisitionTargetInstruction -} - -// CompileRegisterToRegisterWithArg implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileRegisterToRegisterWithArg( - instruction asm.Instruction, - from, to asm.Register, - arg byte, -) { - n := a.newNode(instruction, operandTypesRegisterToRegister) - n.srcReg = from - n.dstReg = to - n.arg = arg -} - -// CompileMemoryWithIndexToRegister implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileMemoryWithIndexToRegister( - instruction asm.Instruction, - srcBaseReg asm.Register, - srcOffsetConst asm.ConstantValue, - srcIndex asm.Register, - srcScale int16, - dstReg asm.Register, -) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.srcReg = srcBaseReg - n.srcConst = srcOffsetConst - n.srcMemIndex = srcIndex - n.srcMemScale = byte(srcScale) - n.dstReg = dstReg -} - -// CompileMemoryWithIndexAndArgToRegister implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileMemoryWithIndexAndArgToRegister( - instruction asm.Instruction, - srcBaseReg asm.Register, - srcOffsetConst asm.ConstantValue, - srcIndex asm.Register, - srcScale int16, - dstReg asm.Register, - arg byte, -) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.srcReg = srcBaseReg - n.srcConst = srcOffsetConst - n.srcMemIndex = srcIndex - n.srcMemScale = byte(srcScale) - n.dstReg = dstReg - n.arg = arg -} - -// CompileRegisterToMemoryWithIndex implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileRegisterToMemoryWithIndex( - instruction asm.Instruction, - srcReg, dstBaseReg asm.Register, - dstOffsetConst asm.ConstantValue, - dstIndex asm.Register, - dstScale int16, -) { - n := a.newNode(instruction, operandTypesRegisterToMemory) - n.srcReg = srcReg - n.dstReg = dstBaseReg - n.dstConst = dstOffsetConst - n.dstMemIndex = dstIndex - n.dstMemScale = byte(dstScale) -} - -// CompileRegisterToMemoryWithIndexAndArg implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileRegisterToMemoryWithIndexAndArg( - instruction asm.Instruction, - srcReg, dstBaseReg asm.Register, - dstOffsetConst asm.ConstantValue, - dstIndex asm.Register, - dstScale int16, - arg byte, -) { - n := a.newNode(instruction, operandTypesRegisterToMemory) - n.srcReg = srcReg - n.dstReg = dstBaseReg - n.dstConst = dstOffsetConst - n.dstMemIndex = dstIndex - n.dstMemScale = byte(dstScale) - n.arg = arg -} - -// CompileRegisterToConst implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileRegisterToConst( - instruction asm.Instruction, - srcRegister asm.Register, - value asm.ConstantValue, -) asm.Node { - n := a.newNode(instruction, operandTypesRegisterToConst) - n.srcReg = srcRegister - n.dstConst = value - return n -} - -// CompileRegisterToNone implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileRegisterToNone(instruction asm.Instruction, register asm.Register) { - n := a.newNode(instruction, operandTypesRegisterToNone) - n.srcReg = register -} - -// CompileNoneToRegister implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileNoneToRegister(instruction asm.Instruction, register asm.Register) { - n := a.newNode(instruction, operandTypesNoneToRegister) - n.dstReg = register -} - -// CompileNoneToMemory implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileNoneToMemory( - instruction asm.Instruction, - baseReg asm.Register, - offset asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesNoneToMemory) - n.dstReg = baseReg - n.dstConst = offset -} - -// CompileConstToMemory implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileConstToMemory( - instruction asm.Instruction, - value asm.ConstantValue, - dstbaseReg asm.Register, - dstOffset asm.ConstantValue, -) asm.Node { - n := a.newNode(instruction, operandTypesConstToMemory) - n.srcConst = value - n.dstReg = dstbaseReg - n.dstConst = dstOffset - return n -} - -// CompileMemoryToConst implements the same method as documented on amd64.Assembler. -func (a *AssemblerImpl) CompileMemoryToConst( - instruction asm.Instruction, - srcBaseReg asm.Register, - srcOffset, value asm.ConstantValue, -) asm.Node { - n := a.newNode(instruction, operandTypesMemoryToConst) - n.srcReg = srcBaseReg - n.srcConst = srcOffset - n.dstConst = value - return n -} - -func errorEncodingUnsupported(n *nodeImpl) error { - return fmt.Errorf("%s is unsupported for %s type", InstructionName(n.instruction), n.types) -} - -func (a *AssemblerImpl) encodeNoneToNone(buf asm.Buffer, n *nodeImpl) (err error) { - // Throughout the encoding methods, we use this pair of base offset and - // code buffer to write instructions. - // - // The code buffer is allocated at the end of the current buffer to a size - // large enough to hold all the bytes that may be written by the method. - // - // We use Go's append builtin to write to the buffer because it allows the - // compiler to generate much better code than if we made calls to write - // methods to mutate an encapsulated byte slice. - // - // At the end of the method, we truncate the buffer size back to the base - // plus the length of the code buffer so the end of the buffer points right - // after the last byte that was written. - base := buf.Len() - code := buf.Append(4)[:0] - - switch n.instruction { - case CDQ: - // https://www.felixcloutier.com/x86/cwd:cdq:cqo - code = append(code, 0x99) - case CQO: - // https://www.felixcloutier.com/x86/cwd:cdq:cqo - code = append(code, rexPrefixW, 0x99) - case NOP: - // Simply optimize out the NOP instructions. - case RET: - // https://www.felixcloutier.com/x86/ret - code = append(code, 0xc3) - case UD2: - // https://mudongliang.github.io/x86/html/file_module_x86_id_318.html - code = append(code, 0x0f, 0x0b) - case REPMOVSQ: - code = append(code, 0xf3, rexPrefixW, 0xa5) - case REPSTOSQ: - code = append(code, 0xf3, rexPrefixW, 0xab) - case STD: - code = append(code, 0xfd) - case CLD: - code = append(code, 0xfc) - default: - err = errorEncodingUnsupported(n) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeNoneToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - regBits, prefix := register3bits(n.dstReg, registerSpecifierPositionModRMFieldRM) - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM := 0b11_000_000 | // Specifying that opeand is register. - regBits - if n.instruction == JMP { - // JMP's opcode is defined as "FF /4" meaning that we have to have "4" - // in 4-6th bits in the ModRM byte. https://www.felixcloutier.com/x86/jmp - modRM |= 0b00_100_000 - } else if n.instruction == NEGQ { - prefix |= rexPrefixW - modRM |= 0b00_011_000 - } else if n.instruction == INCQ { - prefix |= rexPrefixW - } else if n.instruction == DECQ { - prefix |= rexPrefixW - modRM |= 0b00_001_000 - } else { - if RegSP <= n.dstReg && n.dstReg <= RegDI { - // If the destination is one byte length register, we need to have the default prefix. - // https: //wiki.osdev.org/X86-64_Instruction_Encoding#Registers - prefix |= rexPrefixDefault - } - } - - base := buf.Len() - code := buf.Append(4)[:0] - - if prefix != rexPrefixNone { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#Encoding - code = append(code, prefix) - } - - switch n.instruction { - case JMP: - // https://www.felixcloutier.com/x86/jmp - code = append(code, 0xff, modRM) - case SETCC: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x93, modRM) - case SETCS: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x92, modRM) - case SETEQ: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x94, modRM) - case SETGE: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9d, modRM) - case SETGT: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9f, modRM) - case SETHI: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x97, modRM) - case SETLE: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9e, modRM) - case SETLS: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x96, modRM) - case SETLT: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9c, modRM) - case SETNE: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x95, modRM) - case SETPC: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9b, modRM) - case SETPS: - // https://www.felixcloutier.com/x86/setcc - code = append(code, 0x0f, 0x9a, modRM) - case NEGQ: - // https://www.felixcloutier.com/x86/neg - code = append(code, 0xf7, modRM) - case INCQ: - // https://www.felixcloutier.com/x86/inc - code = append(code, 0xff, modRM) - case DECQ: - // https://www.felixcloutier.com/x86/dec - code = append(code, 0xff, modRM) - default: - err = errorEncodingUnsupported(n) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeNoneToMemory(buf asm.Buffer, n *nodeImpl) (err error) { - rexPrefix, modRM, sbi, sbiExist, displacementWidth, err := n.getMemoryLocation(true) - if err != nil { - return err - } - - var opcode byte - switch n.instruction { - case INCQ: - // https://www.felixcloutier.com/x86/inc - rexPrefix |= rexPrefixW - opcode = 0xff - case DECQ: - // https://www.felixcloutier.com/x86/dec - rexPrefix |= rexPrefixW - modRM |= 0b00_001_000 // DEC needs "/1" extension in ModRM. - opcode = 0xff - case JMP: - // https://www.felixcloutier.com/x86/jmp - modRM |= 0b00_100_000 // JMP needs "/4" extension in ModRM. - opcode = 0xff - default: - return errorEncodingUnsupported(n) - } - - base := buf.Len() - code := buf.Append(12)[:0] - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode, modRM) - - if sbiExist { - code = append(code, sbi) - } - - if displacementWidth != 0 { - code = appendConst(code, n.dstConst, displacementWidth) - } - - buf.Truncate(base + len(code)) - return -} - -type relativeJumpOpcode struct{ short, long []byte } - -func (o relativeJumpOpcode) instructionLen(short bool) int64 { - if short { - return int64(len(o.short)) + 1 // 1 byte = 8 bit offset - } else { - return int64(len(o.long)) + 4 // 4 byte = 32 bit offset - } -} - -var relativeJumpOpcodes = [...]relativeJumpOpcode{ - // https://www.felixcloutier.com/x86/jcc - JCC: {short: []byte{0x73}, long: []byte{0x0f, 0x83}}, - JCS: {short: []byte{0x72}, long: []byte{0x0f, 0x82}}, - JEQ: {short: []byte{0x74}, long: []byte{0x0f, 0x84}}, - JGE: {short: []byte{0x7d}, long: []byte{0x0f, 0x8d}}, - JGT: {short: []byte{0x7f}, long: []byte{0x0f, 0x8f}}, - JHI: {short: []byte{0x77}, long: []byte{0x0f, 0x87}}, - JLE: {short: []byte{0x7e}, long: []byte{0x0f, 0x8e}}, - JLS: {short: []byte{0x76}, long: []byte{0x0f, 0x86}}, - JLT: {short: []byte{0x7c}, long: []byte{0x0f, 0x8c}}, - JMI: {short: []byte{0x78}, long: []byte{0x0f, 0x88}}, - JPL: {short: []byte{0x79}, long: []byte{0x0f, 0x89}}, - JNE: {short: []byte{0x75}, long: []byte{0x0f, 0x85}}, - JPC: {short: []byte{0x7b}, long: []byte{0x0f, 0x8b}}, - JPS: {short: []byte{0x7a}, long: []byte{0x0f, 0x8a}}, - // https://www.felixcloutier.com/x86/jmp - JMP: {short: []byte{0xeb}, long: []byte{0xe9}}, -} - -func (a *AssemblerImpl) resolveForwardRelativeJumps(buf asm.Buffer, target *nodeImpl) (err error) { - offsetInBinary := int64(target.OffsetInBinary()) - origin := target.forwardJumpOrigins - for ; origin != nil; origin = origin.forwardJumpOrigins { - shortJump := origin.isForwardShortJump() - op := relativeJumpOpcodes[origin.instruction] - instructionLen := op.instructionLen(shortJump) - - // Calculate the offset from the EIP (at the time of executing this jump instruction) - // to the target instruction. This value is always >= 0 as here we only handle forward jumps. - offset := offsetInBinary - (int64(origin.OffsetInBinary()) + instructionLen) - if shortJump { - if offset > math.MaxInt8 { - // This forces reassemble in the outer loop inside AssemblerImpl.Assemble(). - a.forceReAssemble = true - // From the next reAssemble phases, this forward jump will be encoded long jump and - // allocate 32-bit offset bytes by default. This means that this `origin` node - // will always enter the "long jump offset encoding" block below - origin.flag ^= nodeFlagShortForwardJump - } else { - buf.Bytes()[origin.OffsetInBinary()+uint64(instructionLen)-1] = byte(offset) - } - } else { // long jump offset encoding. - if offset > math.MaxInt32 { - return fmt.Errorf("too large jump offset %d for encoding %s", offset, InstructionName(origin.instruction)) - } - binary.LittleEndian.PutUint32(buf.Bytes()[origin.OffsetInBinary()+uint64(instructionLen)-4:], uint32(offset)) - } - } - return nil -} - -func (a *AssemblerImpl) encodeRelativeJump(buf asm.Buffer, n *nodeImpl) (err error) { - if n.jumpTarget == nil { - err = fmt.Errorf("jump target must not be nil for relative %s", InstructionName(n.instruction)) - return - } - - op := relativeJumpOpcodes[n.instruction] - var isShortJump bool - // offsetOfEIP means the offset of EIP register at the time of executing this jump instruction. - // Relative jump instructions can be encoded with the signed 8-bit or 32-bit integer offsets from the EIP. - var offsetOfEIP int64 = 0 // We set zero and resolve later once the target instruction is encoded for forward jumps - if n.isBackwardJump() { - // If this is the backward jump, we can calculate the exact offset now. - offsetOfJumpInstruction := int64(n.jumpTarget.OffsetInBinary()) - int64(n.OffsetInBinary()) - isShortJump = offsetOfJumpInstruction-2 >= math.MinInt8 - offsetOfEIP = offsetOfJumpInstruction - op.instructionLen(isShortJump) - } else { - // For forward jumps, we resolve the offset when we Encode the target node. See AssemblerImpl.ResolveForwardRelativeJumps. - isShortJump = n.isForwardShortJump() - } - - if offsetOfEIP < math.MinInt32 { // offsetOfEIP is always <= 0 as we don't calculate it for forward jump here. - return fmt.Errorf("too large jump offset %d for encoding %s", offsetOfEIP, InstructionName(n.instruction)) - } - - base := buf.Len() - code := buf.Append(6)[:0] - - if isShortJump { - code = append(code, op.short...) - code = append(code, byte(offsetOfEIP)) - } else { - code = append(code, op.long...) - code = appendUint32(code, uint32(offsetOfEIP)) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeRegisterToNone(buf asm.Buffer, n *nodeImpl) (err error) { - regBits, prefix := register3bits(n.srcReg, registerSpecifierPositionModRMFieldRM) - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM := 0b11_000_000 | // Specifying that opeand is register. - regBits - - var opcode byte - switch n.instruction { - case DIVL: - // https://www.felixcloutier.com/x86/div - modRM |= 0b00_110_000 - opcode = 0xf7 - case DIVQ: - // https://www.felixcloutier.com/x86/div - prefix |= rexPrefixW - modRM |= 0b00_110_000 - opcode = 0xf7 - case IDIVL: - // https://www.felixcloutier.com/x86/idiv - modRM |= 0b00_111_000 - opcode = 0xf7 - case IDIVQ: - // https://www.felixcloutier.com/x86/idiv - prefix |= rexPrefixW - modRM |= 0b00_111_000 - opcode = 0xf7 - case MULL: - // https://www.felixcloutier.com/x86/mul - modRM |= 0b00_100_000 - opcode = 0xf7 - case MULQ: - // https://www.felixcloutier.com/x86/mul - prefix |= rexPrefixW - modRM |= 0b00_100_000 - opcode = 0xf7 - default: - err = errorEncodingUnsupported(n) - } - - base := buf.Len() - code := buf.Append(3)[:0] - - if prefix != rexPrefixNone { - code = append(code, prefix) - } - - code = append(code, opcode, modRM) - - buf.Truncate(base + len(code)) - return -} - -var registerToRegisterOpcode = [instructionEnd]*struct { - opcode []byte - rPrefix rexPrefix - mandatoryPrefix byte - srcOnModRMReg bool - isSrc8bit bool - needArg bool -}{ - // https://www.felixcloutier.com/x86/add - ADDL: {opcode: []byte{0x1}, srcOnModRMReg: true}, - ADDQ: {opcode: []byte{0x1}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/and - ANDL: {opcode: []byte{0x21}, srcOnModRMReg: true}, - ANDQ: {opcode: []byte{0x21}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/cmp - CMPL: {opcode: []byte{0x39}}, - CMPQ: {opcode: []byte{0x39}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/cmovcc - CMOVQCS: {opcode: []byte{0x0f, 0x42}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/addsd - ADDSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x58}}, - // https://www.felixcloutier.com/x86/addss - ADDSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x58}}, - // https://www.felixcloutier.com/x86/addpd - ANDPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x54}}, - // https://www.felixcloutier.com/x86/addps - ANDPS: {opcode: []byte{0x0f, 0x54}}, - // https://www.felixcloutier.com/x86/bsr - BSRL: {opcode: []byte{0xf, 0xbd}}, - BSRQ: {opcode: []byte{0xf, 0xbd}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/comisd - COMISD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x2f}}, - // https://www.felixcloutier.com/x86/comiss - COMISS: {opcode: []byte{0x0f, 0x2f}}, - // https://www.felixcloutier.com/x86/cvtsd2ss - CVTSD2SS: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x5a}}, - // https://www.felixcloutier.com/x86/cvtsi2sd - CVTSL2SD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x2a}}, - // https://www.felixcloutier.com/x86/cvtsi2sd - CVTSQ2SD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x2a}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/cvtsi2ss - CVTSL2SS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x2a}}, - // https://www.felixcloutier.com/x86/cvtsi2ss - CVTSQ2SS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x2a}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/cvtss2sd - CVTSS2SD: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5a}}, - // https://www.felixcloutier.com/x86/cvttsd2si - CVTTSD2SL: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x2c}}, - CVTTSD2SQ: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x2c}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/cvttss2si - CVTTSS2SL: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x2c}}, - CVTTSS2SQ: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x2c}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/divsd - DIVSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x5e}}, - // https://www.felixcloutier.com/x86/divss - DIVSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5e}}, - // https://www.felixcloutier.com/x86/lzcnt - LZCNTL: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xbd}}, - LZCNTQ: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xbd}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/maxsd - MAXSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x5f}}, - // https://www.felixcloutier.com/x86/maxss - MAXSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5f}}, - // https://www.felixcloutier.com/x86/minsd - MINSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x5d}}, - // https://www.felixcloutier.com/x86/minss - MINSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5d}}, - // https://www.felixcloutier.com/x86/movsx:movsxd - MOVBLSX: {opcode: []byte{0x0f, 0xbe}, isSrc8bit: true}, - // https://www.felixcloutier.com/x86/movzx - MOVBLZX: {opcode: []byte{0x0f, 0xb6}, isSrc8bit: true}, - // https://www.felixcloutier.com/x86/movzx - MOVWLZX: {opcode: []byte{0x0f, 0xb7}, isSrc8bit: true}, - // https://www.felixcloutier.com/x86/movsx:movsxd - MOVBQSX: {opcode: []byte{0x0f, 0xbe}, rPrefix: rexPrefixW, isSrc8bit: true}, - // https://www.felixcloutier.com/x86/movsx:movsxd - MOVLQSX: {opcode: []byte{0x63}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/movsx:movsxd - MOVWQSX: {opcode: []byte{0x0f, 0xbf}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/movsx:movsxd - MOVWLSX: {opcode: []byte{0x0f, 0xbf}}, - // https://www.felixcloutier.com/x86/imul - IMULQ: {opcode: []byte{0x0f, 0xaf}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/mulss - MULSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x59}}, - // https://www.felixcloutier.com/x86/mulsd - MULSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x59}}, - // https://www.felixcloutier.com/x86/or - ORL: {opcode: []byte{0x09}, srcOnModRMReg: true}, - ORQ: {opcode: []byte{0x09}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/orpd - ORPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x56}}, - // https://www.felixcloutier.com/x86/orps - ORPS: {opcode: []byte{0x0f, 0x56}}, - // https://www.felixcloutier.com/x86/popcnt - POPCNTL: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xb8}}, - POPCNTQ: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xb8}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/roundss - ROUNDSS: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x0a}, needArg: true}, - // https://www.felixcloutier.com/x86/roundsd - ROUNDSD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x0b}, needArg: true}, - // https://www.felixcloutier.com/x86/sqrtss - SQRTSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x51}}, - // https://www.felixcloutier.com/x86/sqrtsd - SQRTSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x51}}, - // https://www.felixcloutier.com/x86/sub - SUBL: {opcode: []byte{0x29}, srcOnModRMReg: true}, - SUBQ: {opcode: []byte{0x29}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/subss - SUBSS: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5c}}, - // https://www.felixcloutier.com/x86/subsd - SUBSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x5c}}, - // https://www.felixcloutier.com/x86/test - TESTL: {opcode: []byte{0x85}, srcOnModRMReg: true}, - TESTQ: {opcode: []byte{0x85}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/tzcnt - TZCNTL: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xbc}}, - TZCNTQ: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xbc}, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/ucomisd - UCOMISD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x2e}}, - // https://www.felixcloutier.com/x86/ucomiss - UCOMISS: {opcode: []byte{0x0f, 0x2e}}, - // https://www.felixcloutier.com/x86/xchg - XCHGQ: {opcode: []byte{0x87}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/xor - XORL: {opcode: []byte{0x31}, srcOnModRMReg: true}, - XORQ: {opcode: []byte{0x31}, rPrefix: rexPrefixW, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/xorpd - XORPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x57}}, - XORPS: {opcode: []byte{0x0f, 0x57}}, - // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x20}, needArg: true}, - // https://www.felixcloutier.com/x86/pinsrw - PINSRW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xc4}, needArg: true}, - // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x22}, needArg: true}, - // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - PINSRQ: {mandatoryPrefix: 0x66, rPrefix: rexPrefixW, opcode: []byte{0x0f, 0x3a, 0x22}, needArg: true}, - // https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 - MOVDQU: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x6f}}, - // https://www.felixcloutier.com/x86/movdqa:vmovdqa32:vmovdqa64 - MOVDQA: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x6f}}, - // https://www.felixcloutier.com/x86/paddb:paddw:paddd:paddq - PADDB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xfc}}, - PADDW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xfd}}, - PADDD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xfe}}, - PADDQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd4}}, - // https://www.felixcloutier.com/x86/psubb:psubw:psubd - PSUBB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf8}}, - PSUBW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf9}}, - PSUBD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xfa}}, - // https://www.felixcloutier.com/x86/psubq - PSUBQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xfb}}, - // https://www.felixcloutier.com/x86/addps - ADDPS: {opcode: []byte{0x0f, 0x58}}, - // https://www.felixcloutier.com/x86/addpd - ADDPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x58}}, - // https://www.felixcloutier.com/x86/subps - SUBPS: {opcode: []byte{0x0f, 0x5c}}, - // https://www.felixcloutier.com/x86/subpd - SUBPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x5c}}, - // https://www.felixcloutier.com/x86/pxor - PXOR: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xef}}, - // https://www.felixcloutier.com/x86/pand - PAND: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xdb}}, - // https://www.felixcloutier.com/x86/por - POR: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xeb}}, - // https://www.felixcloutier.com/x86/pandn - PANDN: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xdf}}, - // https://www.felixcloutier.com/x86/pshufb - PSHUFB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x0}}, - // https://www.felixcloutier.com/x86/pshufd - PSHUFD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x70}, needArg: true}, - // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x14}, needArg: true, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/pextrw - PEXTRW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xc5}, needArg: true}, - // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x16}, needArg: true, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - PEXTRQ: {rPrefix: rexPrefixW, mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x16}, needArg: true, srcOnModRMReg: true}, - // https://www.felixcloutier.com/x86/insertps - INSERTPS: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x21}, needArg: true}, - // https://www.felixcloutier.com/x86/movlhps - MOVLHPS: {opcode: []byte{0x0f, 0x16}}, - // https://www.felixcloutier.com/x86/ptest - PTEST: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x17}}, - // https://www.felixcloutier.com/x86/pcmpeqb:pcmpeqw:pcmpeqd - PCMPEQB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x74}}, - PCMPEQW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x75}}, - PCMPEQD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x76}}, - // https://www.felixcloutier.com/x86/pcmpeqq - PCMPEQQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x29}}, - // https://www.felixcloutier.com/x86/paddusb:paddusw - PADDUSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xdc}}, - // https://www.felixcloutier.com/x86/movsd - MOVSD: {mandatoryPrefix: 0xf2, opcode: []byte{0x0f, 0x10}}, - // https://www.felixcloutier.com/x86/packsswb:packssdw - PACKSSWB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x63}}, - // https://www.felixcloutier.com/x86/pmovmskb - PMOVMSKB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd7}}, - // https://www.felixcloutier.com/x86/movmskps - MOVMSKPS: {opcode: []byte{0x0f, 0x50}}, - // https://www.felixcloutier.com/x86/movmskpd - MOVMSKPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x50}}, - // https://www.felixcloutier.com/x86/psraw:psrad:psraq - PSRAD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe2}}, - // https://www.felixcloutier.com/x86/psraw:psrad:psraq - PSRAW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe1}}, - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd3}}, - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd2}}, - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - PSRLW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd1}}, - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf1}}, - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf2}}, - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - PSLLQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf3}}, - // https://www.felixcloutier.com/x86/punpcklbw:punpcklwd:punpckldq:punpcklqdq - PUNPCKLBW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x60}}, - // https://www.felixcloutier.com/x86/punpckhbw:punpckhwd:punpckhdq:punpckhqdq - PUNPCKHBW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x68}}, - // https://www.felixcloutier.com/x86/cmpps - CMPPS: {opcode: []byte{0x0f, 0xc2}, needArg: true}, - // https://www.felixcloutier.com/x86/cmppd - CMPPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xc2}, needArg: true}, - // https://www.felixcloutier.com/x86/pcmpgtq - PCMPGTQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x37}}, - // https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x66}}, - // https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x65}}, - // https://www.felixcloutier.com/x86/pcmpgtb:pcmpgtw:pcmpgtd - PCMPGTB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x64}}, - // https://www.felixcloutier.com/x86/pminsd:pminsq - PMINSD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x39}}, - // https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3d}}, - // https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xee}}, - // https://www.felixcloutier.com/x86/pmaxsb:pmaxsw:pmaxsd:pmaxsq - PMAXSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3c}}, - // https://www.felixcloutier.com/x86/pminsb:pminsw - PMINSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xea}}, - // https://www.felixcloutier.com/x86/pminsb:pminsw - PMINSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x38}}, - // https://www.felixcloutier.com/x86/pminud:pminuq - PMINUD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3b}}, - // https://www.felixcloutier.com/x86/pminub:pminuw - PMINUW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3a}}, - // https://www.felixcloutier.com/x86/pminub:pminuw - PMINUB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xda}}, - // https://www.felixcloutier.com/x86/pmaxud:pmaxuq - PMAXUD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3f}}, - // https://www.felixcloutier.com/x86/pmaxub:pmaxuw - PMAXUW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x3e}}, - // https://www.felixcloutier.com/x86/pmaxub:pmaxuw - PMAXUB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xde}}, - // https://www.felixcloutier.com/x86/pmullw - PMULLW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd5}}, - // https://www.felixcloutier.com/x86/pmulld:pmullq - PMULLD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x40}}, - // https://www.felixcloutier.com/x86/pmuludq - PMULUDQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf4}}, - // https://www.felixcloutier.com/x86/psubsb:psubsw - PSUBSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe8}}, - // https://www.felixcloutier.com/x86/psubsb:psubsw - PSUBSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe9}}, - // https://www.felixcloutier.com/x86/psubusb:psubusw - PSUBUSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd8}}, - // https://www.felixcloutier.com/x86/psubusb:psubusw - PSUBUSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xd9}}, - // https://www.felixcloutier.com/x86/paddsb:paddsw - PADDSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xed}}, - // https://www.felixcloutier.com/x86/paddsb:paddsw - PADDSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xec}}, - // https://www.felixcloutier.com/x86/paddusb:paddusw - PADDUSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xdd}}, - // https://www.felixcloutier.com/x86/pavgb:pavgw - PAVGB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe0}}, - // https://www.felixcloutier.com/x86/pavgb:pavgw - PAVGW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe3}}, - // https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x1c}}, - // https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x1d}}, - // https://www.felixcloutier.com/x86/pabsb:pabsw:pabsd:pabsq - PABSD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x1e}}, - // https://www.felixcloutier.com/x86/blendvpd - BLENDVPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x15}}, - // https://www.felixcloutier.com/x86/maxpd - MAXPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x5f}}, - // https://www.felixcloutier.com/x86/maxps - MAXPS: {opcode: []byte{0x0f, 0x5f}}, - // https://www.felixcloutier.com/x86/minpd - MINPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x5d}}, - // https://www.felixcloutier.com/x86/minps - MINPS: {opcode: []byte{0x0f, 0x5d}}, - // https://www.felixcloutier.com/x86/andnpd - ANDNPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x55}}, - // https://www.felixcloutier.com/x86/andnps - ANDNPS: {opcode: []byte{0x0f, 0x55}}, - // https://www.felixcloutier.com/x86/mulps - MULPS: {opcode: []byte{0x0f, 0x59}}, - // https://www.felixcloutier.com/x86/mulpd - MULPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x59}}, - // https://www.felixcloutier.com/x86/divps - DIVPS: {opcode: []byte{0x0f, 0x5e}}, - // https://www.felixcloutier.com/x86/divpd - DIVPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x5e}}, - // https://www.felixcloutier.com/x86/sqrtps - SQRTPS: {opcode: []byte{0x0f, 0x51}}, - // https://www.felixcloutier.com/x86/sqrtpd - SQRTPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x51}}, - // https://www.felixcloutier.com/x86/roundps - ROUNDPS: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x08}, needArg: true}, - // https://www.felixcloutier.com/x86/roundpd - ROUNDPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x09}, needArg: true}, - // https://www.felixcloutier.com/x86/palignr - PALIGNR: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x3a, 0x0f}, needArg: true}, - // https://www.felixcloutier.com/x86/punpcklbw:punpcklwd:punpckldq:punpcklqdq - PUNPCKLWD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x61}}, - // https://www.felixcloutier.com/x86/punpckhbw:punpckhwd:punpckhdq:punpckhqdq - PUNPCKHWD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x69}}, - // https://www.felixcloutier.com/x86/pmulhuw - PMULHUW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe4}}, - // https://www.felixcloutier.com/x86/pmuldq - PMULDQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x28}}, - // https://www.felixcloutier.com/x86/pmulhrsw - PMULHRSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x0b}}, - // https://www.felixcloutier.com/x86/pmovsx - PMOVSXBW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x20}}, - // https://www.felixcloutier.com/x86/pmovsx - PMOVSXWD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x23}}, - // https://www.felixcloutier.com/x86/pmovsx - PMOVSXDQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x25}}, - // https://www.felixcloutier.com/x86/pmovzx - PMOVZXBW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x30}}, - // https://www.felixcloutier.com/x86/pmovzx - PMOVZXWD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x33}}, - // https://www.felixcloutier.com/x86/pmovzx - PMOVZXDQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x35}}, - // https://www.felixcloutier.com/x86/pmulhw - PMULHW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe5}}, - // https://www.felixcloutier.com/x86/cmpps - CMPEQPS: {opcode: []byte{0x0f, 0xc2}, needArg: true}, - // https://www.felixcloutier.com/x86/cmppd - CMPEQPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xc2}, needArg: true}, - // https://www.felixcloutier.com/x86/cvttps2dq - CVTTPS2DQ: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x5b}}, - // https://www.felixcloutier.com/x86/cvtdq2ps - CVTDQ2PS: {opcode: []byte{0x0f, 0x5b}}, - // https://www.felixcloutier.com/x86/cvtdq2pd - CVTDQ2PD: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0xe6}}, - // https://www.felixcloutier.com/x86/cvtpd2ps - CVTPD2PS: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x5a}}, - // https://www.felixcloutier.com/x86/cvtps2pd - CVTPS2PD: {opcode: []byte{0x0f, 0x5a}}, - // https://www.felixcloutier.com/x86/movupd - MOVUPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x10}}, - // https://www.felixcloutier.com/x86/shufps - SHUFPS: {opcode: []byte{0x0f, 0xc6}, needArg: true}, - // https://www.felixcloutier.com/x86/pmaddwd - PMADDWD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xf5}}, - // https://www.felixcloutier.com/x86/unpcklps - UNPCKLPS: {opcode: []byte{0x0f, 0x14}}, - // https://www.felixcloutier.com/x86/packuswb - PACKUSWB: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x67}}, - // https://www.felixcloutier.com/x86/packsswb:packssdw - PACKSSDW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x6b}}, - // https://www.felixcloutier.com/x86/packusdw - PACKUSDW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x2b}}, - // https://www.felixcloutier.com/x86/pmaddubsw - PMADDUBSW: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x38, 0x04}}, - // https://www.felixcloutier.com/x86/cvttpd2dq - CVTTPD2DQ: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0xe6}}, -} - -var registerToRegisterShiftOpcode = [instructionEnd]*struct { - opcode []byte - rPrefix rexPrefix - modRMExtension byte -}{ - // https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - ROLL: {opcode: []byte{0xd3}}, - ROLQ: {opcode: []byte{0xd3}, rPrefix: rexPrefixW}, - RORL: {opcode: []byte{0xd3}, modRMExtension: 0b00_001_000}, - RORQ: {opcode: []byte{0xd3}, modRMExtension: 0b00_001_000, rPrefix: rexPrefixW}, - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - SARL: {opcode: []byte{0xd3}, modRMExtension: 0b00_111_000}, - SARQ: {opcode: []byte{0xd3}, modRMExtension: 0b00_111_000, rPrefix: rexPrefixW}, - SHLL: {opcode: []byte{0xd3}, modRMExtension: 0b00_100_000}, - SHLQ: {opcode: []byte{0xd3}, modRMExtension: 0b00_100_000, rPrefix: rexPrefixW}, - SHRL: {opcode: []byte{0xd3}, modRMExtension: 0b00_101_000}, - SHRQ: {opcode: []byte{0xd3}, modRMExtension: 0b00_101_000, rPrefix: rexPrefixW}, -} - -func (a *AssemblerImpl) encodeRegisterToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - // Alias for readability - inst := n.instruction - base := buf.Len() - code := buf.Append(8)[:0] - - switch inst { - case MOVL, MOVQ: - var ( - opcode []byte - mandatoryPrefix byte - srcOnModRMReg bool - rPrefix rexPrefix - ) - srcIsFloat, dstIsFloat := isVectorRegister(n.srcReg), isVectorRegister(n.dstReg) - f2f := srcIsFloat && dstIsFloat - if f2f { - // https://www.felixcloutier.com/x86/movq - opcode, mandatoryPrefix = []byte{0x0f, 0x7e}, 0xf3 - } else if srcIsFloat && !dstIsFloat { - // https://www.felixcloutier.com/x86/movd:movq - opcode, mandatoryPrefix, srcOnModRMReg = []byte{0x0f, 0x7e}, 0x66, true - } else if !srcIsFloat && dstIsFloat { - // https://www.felixcloutier.com/x86/movd:movq - opcode, mandatoryPrefix, srcOnModRMReg = []byte{0x0f, 0x6e}, 0x66, false - } else { - // https://www.felixcloutier.com/x86/mov - opcode, srcOnModRMReg = []byte{0x89}, true - } - - rexPrefix, modRM, err := n.getRegisterToRegisterModRM(srcOnModRMReg) - if err != nil { - return err - } - rexPrefix |= rPrefix - - if inst == MOVQ && !f2f { - rexPrefix |= rexPrefixW - } - if mandatoryPrefix != 0 { - code = append(code, mandatoryPrefix) - } - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, opcode...) - code = append(code, modRM) - buf.Truncate(base + len(code)) - return nil - } - - if op := registerToRegisterOpcode[inst]; op != nil { - rexPrefix, modRM, err := n.getRegisterToRegisterModRM(op.srcOnModRMReg) - if err != nil { - return err - } - rexPrefix |= op.rPrefix - - if op.isSrc8bit && RegSP <= n.srcReg && n.srcReg <= RegDI { - // If an operand register is 8-bit length of SP, BP, DI, or SI register, we need to have the default prefix. - // https://wiki.osdev.org/X86-64_Instruction_Encoding#Registers - rexPrefix |= rexPrefixDefault - } - - if op.mandatoryPrefix != 0 { - code = append(code, op.mandatoryPrefix) - } - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, op.opcode...) - code = append(code, modRM) - - if op.needArg { - code = append(code, n.arg) - } - } else if op := registerToRegisterShiftOpcode[inst]; op != nil { - reg3bits, rexPrefix := register3bits(n.dstReg, registerSpecifierPositionModRMFieldRM) - rexPrefix |= op.rPrefix - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM := 0b11_000_000 | - (op.modRMExtension) | - reg3bits - code = append(code, op.opcode...) - code = append(code, modRM) - } else { - return errorEncodingUnsupported(n) - } - - buf.Truncate(base + len(code)) - return nil -} - -func (a *AssemblerImpl) encodeRegisterToMemory(buf asm.Buffer, n *nodeImpl) (err error) { - rexPrefix, modRM, sbi, sbiExist, displacementWidth, err := n.getMemoryLocation(true) - if err != nil { - return err - } - - var opcode []byte - var mandatoryPrefix byte - var isShiftInstruction bool - var needArg bool - switch n.instruction { - case CMPL: - // https://www.felixcloutier.com/x86/cmp - opcode = []byte{0x3b} - case CMPQ: - // https://www.felixcloutier.com/x86/cmp - rexPrefix |= rexPrefixW - opcode = []byte{0x3b} - case MOVB: - // https://www.felixcloutier.com/x86/mov - opcode = []byte{0x88} - // 1 byte register operands need default prefix for the following registers. - if n.srcReg >= RegSP && n.srcReg <= RegDI { - rexPrefix |= rexPrefixDefault - } - case MOVL: - if isVectorRegister(n.srcReg) { - // https://www.felixcloutier.com/x86/movd:movq - opcode = []byte{0x0f, 0x7e} - mandatoryPrefix = 0x66 - } else { - // https://www.felixcloutier.com/x86/mov - opcode = []byte{0x89} - } - case MOVQ: - if isVectorRegister(n.srcReg) { - // https://www.felixcloutier.com/x86/movq - opcode = []byte{0x0f, 0xd6} - mandatoryPrefix = 0x66 - } else { - // https://www.felixcloutier.com/x86/mov - rexPrefix |= rexPrefixW - opcode = []byte{0x89} - } - case MOVW: - // https://www.felixcloutier.com/x86/mov - // Note: Need 0x66 to indicate that the operand size is 16-bit. - // https://wiki.osdev.org/X86-64_Instruction_Encoding#Operand-size_and_address-size_override_prefix - mandatoryPrefix = 0x66 - opcode = []byte{0x89} - case SARL: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - modRM |= 0b00_111_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case SARQ: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - rexPrefix |= rexPrefixW - modRM |= 0b00_111_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case SHLL: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - modRM |= 0b00_100_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case SHLQ: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - rexPrefix |= rexPrefixW - modRM |= 0b00_100_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case SHRL: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - modRM |= 0b00_101_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case SHRQ: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - rexPrefix |= rexPrefixW - modRM |= 0b00_101_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case ROLL: - // https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - opcode = []byte{0xd3} - isShiftInstruction = true - case ROLQ: - // https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - rexPrefix |= rexPrefixW - opcode = []byte{0xd3} - isShiftInstruction = true - case RORL: - // https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - modRM |= 0b00_001_000 - opcode = []byte{0xd3} - isShiftInstruction = true - case RORQ: - // https://www.felixcloutier.com/x86/rcl:rcr:rol:ror - rexPrefix |= rexPrefixW - opcode = []byte{0xd3} - modRM |= 0b00_001_000 - isShiftInstruction = true - case MOVDQU: - // https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 - mandatoryPrefix = 0xf3 - opcode = []byte{0x0f, 0x7f} - case PEXTRB: // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x14} - needArg = true - case PEXTRW: // https://www.felixcloutier.com/x86/pextrw - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x15} - needArg = true - case PEXTRD: // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x16} - needArg = true - case PEXTRQ: // https://www.felixcloutier.com/x86/pextrb:pextrd:pextrq - mandatoryPrefix = 0x66 - rexPrefix |= rexPrefixW // REX.W - opcode = []byte{0x0f, 0x3a, 0x16} - needArg = true - default: - return errorEncodingUnsupported(n) - } - - if !isShiftInstruction { - srcReg3Bits, prefix := register3bits(n.srcReg, registerSpecifierPositionModRMFieldReg) - - rexPrefix |= prefix - modRM |= srcReg3Bits << 3 // Place the source register on ModRM:reg - } else { - if n.srcReg != RegCX { - return fmt.Errorf("shifting instruction %s require CX register as src but got %s", InstructionName(n.instruction), RegisterName(n.srcReg)) - } - } - - base := buf.Len() - code := buf.Append(16)[:0] - - if mandatoryPrefix != 0 { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#Mandatory_prefix - code = append(code, mandatoryPrefix) - } - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode...) - code = append(code, modRM) - - if sbiExist { - code = append(code, sbi) - } - - if displacementWidth != 0 { - code = appendConst(code, n.dstConst, displacementWidth) - } - - if needArg { - code = append(code, n.arg) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeRegisterToConst(buf asm.Buffer, n *nodeImpl) (err error) { - regBits, prefix := register3bits(n.srcReg, registerSpecifierPositionModRMFieldRM) - - base := buf.Len() - code := buf.Append(10)[:0] - - switch n.instruction { - case CMPL, CMPQ: - if n.instruction == CMPQ { - prefix |= rexPrefixW - } - if prefix != rexPrefixNone { - code = append(code, prefix) - } - is8bitConst := fitInSigned8bit(n.dstConst) - // https://www.felixcloutier.com/x86/cmp - if n.srcReg == RegAX && !is8bitConst { - code = append(code, 0x3d) - } else { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_111_000 | // CMP with immediate needs "/7" extension. - regBits - if is8bitConst { - code = append(code, 0x83, modRM) - } else { - code = append(code, 0x81, modRM) - } - } - default: - err = errorEncodingUnsupported(n) - } - - if fitInSigned8bit(n.dstConst) { - code = append(code, byte(n.dstConst)) - } else { - code = appendUint32(code, uint32(n.dstConst)) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) finalizeReadInstructionAddressNode(code []byte, n *nodeImpl) (err error) { - // Find the target instruction node. - targetNode := n - for ; targetNode != nil; targetNode = targetNode.next { - if targetNode.instruction == n.readInstructionAddressBeforeTargetInstruction { - targetNode = targetNode.next - break - } - } - - if targetNode == nil { - return errors.New("BUG: target instruction not found for read instruction address") - } - - offset := targetNode.OffsetInBinary() - (n.OffsetInBinary() + 7 /* 7 = the length of the LEAQ instruction */) - if offset >= math.MaxInt32 { - return errors.New("BUG: too large offset for LEAQ instruction") - } - - binary.LittleEndian.PutUint32(code[n.OffsetInBinary()+3:], uint32(int32(offset))) - return nil -} - -func (a *AssemblerImpl) encodeReadInstructionAddress(buf asm.Buffer, n *nodeImpl) error { - dstReg3Bits, rexPrefix := register3bits(n.dstReg, registerSpecifierPositionModRMFieldReg) - - a.readInstructionAddressNodes = append(a.readInstructionAddressNodes, n) - - // https://www.felixcloutier.com/x86/lea - opcode := byte(0x8d) - rexPrefix |= rexPrefixW - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#32.2F64-bit_addressing - modRM := 0b00_000_101 | // Indicate "LEAQ [RIP + 32bit displacement], dstReg" encoding. - (dstReg3Bits << 3) // Place the dstReg on ModRM:reg. - - code := buf.Append(7) - code[0] = rexPrefix - code[1] = opcode - code[2] = modRM - binary.LittleEndian.PutUint32(code[3:], 0) // Preserve - return nil -} - -func (a *AssemblerImpl) encodeMemoryToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - if n.instruction == LEAQ && n.readInstructionAddressBeforeTargetInstruction != NONE { - return a.encodeReadInstructionAddress(buf, n) - } - - rexPrefix, modRM, sbi, sbiExist, displacementWidth, err := n.getMemoryLocation(false) - if err != nil { - return err - } - - dstReg3Bits, prefix := register3bits(n.dstReg, registerSpecifierPositionModRMFieldReg) - rexPrefix |= prefix - modRM |= dstReg3Bits << 3 // Place the destination register on ModRM:reg - - var mandatoryPrefix byte - var opcode []byte - var needArg bool - - switch n.instruction { - case ADDL: - // https://www.felixcloutier.com/x86/add - opcode = []byte{0x03} - case ADDQ: - // https://www.felixcloutier.com/x86/add - rexPrefix |= rexPrefixW - opcode = []byte{0x03} - case CMPL: - // https://www.felixcloutier.com/x86/cmp - opcode = []byte{0x39} - case CMPQ: - // https://www.felixcloutier.com/x86/cmp - rexPrefix |= rexPrefixW - opcode = []byte{0x39} - case LEAQ: - // https://www.felixcloutier.com/x86/lea - rexPrefix |= rexPrefixW - opcode = []byte{0x8d} - case MOVBLSX: - // https://www.felixcloutier.com/x86/movsx:movsxd - opcode = []byte{0x0f, 0xbe} - case MOVBLZX: - // https://www.felixcloutier.com/x86/movzx - opcode = []byte{0x0f, 0xb6} - case MOVBQSX: - // https://www.felixcloutier.com/x86/movsx:movsxd - rexPrefix |= rexPrefixW - opcode = []byte{0x0f, 0xbe} - case MOVBQZX: - // https://www.felixcloutier.com/x86/movzx - rexPrefix |= rexPrefixW - opcode = []byte{0x0f, 0xb6} - case MOVLQSX: - // https://www.felixcloutier.com/x86/movsx:movsxd - rexPrefix |= rexPrefixW - opcode = []byte{0x63} - case MOVLQZX: - // https://www.felixcloutier.com/x86/mov - // Note: MOVLQZX means zero extending 32bit reg to 64-bit reg and - // that is semantically equivalent to MOV 32bit to 32bit. - opcode = []byte{0x8B} - case MOVL: - // https://www.felixcloutier.com/x86/mov - // Note: MOVLQZX means zero extending 32bit reg to 64-bit reg and - // that is semantically equivalent to MOV 32bit to 32bit. - if isVectorRegister(n.dstReg) { - // https://www.felixcloutier.com/x86/movd:movq - opcode = []byte{0x0f, 0x6e} - mandatoryPrefix = 0x66 - } else { - // https://www.felixcloutier.com/x86/mov - opcode = []byte{0x8B} - } - case MOVQ: - if isVectorRegister(n.dstReg) { - // https://www.felixcloutier.com/x86/movq - opcode = []byte{0x0f, 0x7e} - mandatoryPrefix = 0xf3 - } else { - // https://www.felixcloutier.com/x86/mov - rexPrefix |= rexPrefixW - opcode = []byte{0x8B} - } - case MOVWLSX: - // https://www.felixcloutier.com/x86/movsx:movsxd - opcode = []byte{0x0f, 0xbf} - case MOVWLZX: - // https://www.felixcloutier.com/x86/movzx - opcode = []byte{0x0f, 0xb7} - case MOVWQSX: - // https://www.felixcloutier.com/x86/movsx:movsxd - rexPrefix |= rexPrefixW - opcode = []byte{0x0f, 0xbf} - case MOVWQZX: - // https://www.felixcloutier.com/x86/movzx - rexPrefix |= rexPrefixW - opcode = []byte{0x0f, 0xb7} - case SUBQ: - // https://www.felixcloutier.com/x86/sub - rexPrefix |= rexPrefixW - opcode = []byte{0x2b} - case SUBSD: - // https://www.felixcloutier.com/x86/subsd - opcode = []byte{0x0f, 0x5c} - mandatoryPrefix = 0xf2 - case SUBSS: - // https://www.felixcloutier.com/x86/subss - opcode = []byte{0x0f, 0x5c} - mandatoryPrefix = 0xf3 - case UCOMISD: - // https://www.felixcloutier.com/x86/ucomisd - opcode = []byte{0x0f, 0x2e} - mandatoryPrefix = 0x66 - case UCOMISS: - // https://www.felixcloutier.com/x86/ucomiss - opcode = []byte{0x0f, 0x2e} - case MOVDQU: - // https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 - mandatoryPrefix = 0xf3 - opcode = []byte{0x0f, 0x6f} - case PMOVSXBW: // https://www.felixcloutier.com/x86/pmovsx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x20} - case PMOVSXWD: // https://www.felixcloutier.com/x86/pmovsx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x23} - case PMOVSXDQ: // https://www.felixcloutier.com/x86/pmovsx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x25} - case PMOVZXBW: // https://www.felixcloutier.com/x86/pmovzx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x30} - case PMOVZXWD: // https://www.felixcloutier.com/x86/pmovzx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x33} - case PMOVZXDQ: // https://www.felixcloutier.com/x86/pmovzx - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x38, 0x35} - case PINSRB: // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x20} - needArg = true - case PINSRW: // https://www.felixcloutier.com/x86/pinsrw - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0xc4} - needArg = true - case PINSRD: // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x22} - needArg = true - case PINSRQ: // https://www.felixcloutier.com/x86/pinsrb:pinsrd:pinsrq - rexPrefix |= rexPrefixW - mandatoryPrefix = 0x66 - opcode = []byte{0x0f, 0x3a, 0x22} - needArg = true - default: - return errorEncodingUnsupported(n) - } - - base := buf.Len() - code := buf.Append(16)[:0] - - if mandatoryPrefix != 0 { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#Mandatory_prefix - code = append(code, mandatoryPrefix) - } - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode...) - code = append(code, modRM) - - if sbiExist { - code = append(code, sbi) - } - - if displacementWidth != 0 { - code = appendConst(code, n.srcConst, displacementWidth) - } - - if needArg { - code = append(code, n.arg) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeConstToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - regBits, rexPrefix := register3bits(n.dstReg, registerSpecifierPositionModRMFieldRM) - - isFloatReg := isVectorRegister(n.dstReg) - switch n.instruction { - case PSLLD, PSLLQ, PSRLD, PSRLQ, PSRAW, PSRLW, PSLLW, PSRAD: - if !isFloatReg { - return fmt.Errorf("%s needs float register but got %s", InstructionName(n.instruction), RegisterName(n.dstReg)) - } - default: - if isFloatReg { - return fmt.Errorf("%s needs int register but got %s", InstructionName(n.instruction), RegisterName(n.dstReg)) - } - } - - if n.instruction != MOVQ && !fitIn32bit(n.srcConst) { - return fmt.Errorf("constant must fit in 32-bit integer for %s, but got %d", InstructionName(n.instruction), n.srcConst) - } else if (n.instruction == SHLQ || n.instruction == SHRQ) && (n.srcConst < 0 || n.srcConst > math.MaxUint8) { - return fmt.Errorf("constant must fit in positive 8-bit integer for %s, but got %d", InstructionName(n.instruction), n.srcConst) - } else if (n.instruction == PSLLD || - n.instruction == PSLLQ || - n.instruction == PSRLD || - n.instruction == PSRLQ) && (n.srcConst < math.MinInt8 || n.srcConst > math.MaxInt8) { - return fmt.Errorf("constant must fit in signed 8-bit integer for %s, but got %d", InstructionName(n.instruction), n.srcConst) - } - - base := buf.Len() - code := buf.Append(32)[:0] - - isSigned8bitConst := fitInSigned8bit(n.srcConst) - switch inst := n.instruction; inst { - case ADDQ: - // https://www.felixcloutier.com/x86/add - rexPrefix |= rexPrefixW - if n.dstReg == RegAX && !isSigned8bitConst { - code = append(code, rexPrefix, 0x05) - } else { - modRM := 0b11_000_000 | // Specifying that opeand is register. - regBits - if isSigned8bitConst { - code = append(code, rexPrefix, 0x83, modRM) - } else { - code = append(code, rexPrefix, 0x81, modRM) - } - } - if isSigned8bitConst { - code = append(code, byte(n.srcConst)) - } else { - code = appendUint32(code, uint32(n.srcConst)) - } - case ANDQ: - // https://www.felixcloutier.com/x86/and - rexPrefix |= rexPrefixW - if n.dstReg == RegAX && !isSigned8bitConst { - code = append(code, rexPrefix, 0x25) - } else { - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_100_000 | // AND with immediate needs "/4" extension. - regBits - if isSigned8bitConst { - code = append(code, rexPrefix, 0x83, modRM) - } else { - code = append(code, rexPrefix, 0x81, modRM) - } - } - if fitInSigned8bit(n.srcConst) { - code = append(code, byte(n.srcConst)) - } else { - code = appendUint32(code, uint32(n.srcConst)) - } - case TESTQ: - // https://www.felixcloutier.com/x86/test - rexPrefix |= rexPrefixW - if n.dstReg == RegAX && !isSigned8bitConst { - code = append(code, rexPrefix, 0xa9) - } else { - modRM := 0b11_000_000 | // Specifying that operand is register - regBits - code = append(code, rexPrefix, 0xf7, modRM) - } - code = appendUint32(code, uint32(n.srcConst)) - case MOVL: - // https://www.felixcloutier.com/x86/mov - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, 0xb8|regBits) - code = appendUint32(code, uint32(n.srcConst)) - case MOVQ: - // https://www.felixcloutier.com/x86/mov - if fitIn32bit(n.srcConst) { - if n.srcConst > math.MaxInt32 { - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, 0xb8|regBits) - } else { - rexPrefix |= rexPrefixW - modRM := 0b11_000_000 | // Specifying that opeand is register. - regBits - code = append(code, rexPrefix, 0xc7, modRM) - } - code = appendUint32(code, uint32(n.srcConst)) - } else { - rexPrefix |= rexPrefixW - code = append(code, rexPrefix, 0xb8|regBits) - code = appendUint64(code, uint64(n.srcConst)) - } - case SHLQ: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - rexPrefix |= rexPrefixW - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_100_000 | // SHL with immediate needs "/4" extension. - regBits - if n.srcConst == 1 { - code = append(code, rexPrefix, 0xd1, modRM) - } else { - code = append(code, rexPrefix, 0xc1, modRM, byte(n.srcConst)) - } - case SHRQ: - // https://www.felixcloutier.com/x86/sal:sar:shl:shr - rexPrefix |= rexPrefixW - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_101_000 | // SHR with immediate needs "/5" extension. - regBits - if n.srcConst == 1 { - code = append(code, rexPrefix, 0xd1, modRM) - } else { - code = append(code, rexPrefix, 0xc1, modRM, byte(n.srcConst)) - } - case PSLLD: - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_110_000 | // PSLL with immediate needs "/6" extension. - regBits - if rexPrefix != rexPrefixNone { - code = append(code, 0x66, rexPrefix, 0x0f, 0x72, modRM, byte(n.srcConst)) - } else { - code = append(code, 0x66, 0x0f, 0x72, modRM, byte(n.srcConst)) - } - case PSLLQ: - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_110_000 | // PSLL with immediate needs "/6" extension. - regBits - if rexPrefix != rexPrefixNone { - code = append(code, 0x66, rexPrefix, 0x0f, 0x73, modRM, byte(n.srcConst)) - } else { - code = append(code, 0x66, 0x0f, 0x73, modRM, byte(n.srcConst)) - } - case PSRLD: - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - modRM := 0b11_000_000 | // Specifying that operand is register. - 0b00_010_000 | // PSRL with immediate needs "/2" extension. - regBits - if rexPrefix != rexPrefixNone { - code = append(code, 0x66, rexPrefix, 0x0f, 0x72, modRM, byte(n.srcConst)) - } else { - code = append(code, 0x66, 0x0f, 0x72, modRM, byte(n.srcConst)) - } - case PSRLQ: - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - modRM := 0b11_000_000 | // Specifying that operand is register. - 0b00_010_000 | // PSRL with immediate needs "/2" extension. - regBits - if rexPrefix != rexPrefixNone { - code = append(code, 0x66, rexPrefix, 0x0f, 0x73, modRM, byte(n.srcConst)) - } else { - code = append(code, 0x66, 0x0f, 0x73, modRM, byte(n.srcConst)) - } - case PSRAW, PSRAD: - // https://www.felixcloutier.com/x86/psraw:psrad:psraq - modRM := 0b11_000_000 | // Specifying that operand is register. - 0b00_100_000 | // PSRAW with immediate needs "/4" extension. - regBits - code = append(code, 0x66) - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - var op byte - if inst == PSRAD { - op = 0x72 - } else { // PSRAW - op = 0x71 - } - - code = append(code, 0x0f, op, modRM, byte(n.srcConst)) - case PSRLW: - // https://www.felixcloutier.com/x86/psrlw:psrld:psrlq - modRM := 0b11_000_000 | // Specifying that operand is register. - 0b00_010_000 | // PSRLW with immediate needs "/2" extension. - regBits - code = append(code, 0x66) - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, 0x0f, 0x71, modRM, byte(n.srcConst)) - case PSLLW: - // https://www.felixcloutier.com/x86/psllw:pslld:psllq - modRM := 0b11_000_000 | // Specifying that operand is register. - 0b00_110_000 | // PSLLW with immediate needs "/6" extension. - regBits - code = append(code, 0x66) - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - code = append(code, 0x0f, 0x71, modRM, byte(n.srcConst)) - case XORL, XORQ: - // https://www.felixcloutier.com/x86/xor - if inst == XORQ { - rexPrefix |= rexPrefixW - } - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - if n.dstReg == RegAX && !isSigned8bitConst { - code = append(code, 0x35) - } else { - modRM := 0b11_000_000 | // Specifying that opeand is register. - 0b00_110_000 | // XOR with immediate needs "/6" extension. - regBits - if isSigned8bitConst { - code = append(code, 0x83, modRM) - } else { - code = append(code, 0x81, modRM) - } - } - if fitInSigned8bit(n.srcConst) { - code = append(code, byte(n.srcConst)) - } else { - code = appendUint32(code, uint32(n.srcConst)) - } - default: - err = errorEncodingUnsupported(n) - } - - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeMemoryToConst(buf asm.Buffer, n *nodeImpl) (err error) { - if !fitIn32bit(n.dstConst) { - return fmt.Errorf("too large target const %d for %s", n.dstConst, InstructionName(n.instruction)) - } - - rexPrefix, modRM, sbi, sbiExist, displacementWidth, err := n.getMemoryLocation(false) - if err != nil { - return err - } - - // Alias for readability. - c := n.dstConst - - var opcode, constWidth byte - switch n.instruction { - case CMPL: - // https://www.felixcloutier.com/x86/cmp - if fitInSigned8bit(c) { - opcode = 0x83 - constWidth = 8 - } else { - opcode = 0x81 - constWidth = 32 - } - modRM |= 0b00_111_000 - default: - return errorEncodingUnsupported(n) - } - - base := buf.Len() - code := buf.Append(20)[:0] - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode, modRM) - - if sbiExist { - code = append(code, sbi) - } - - if displacementWidth != 0 { - code = appendConst(code, n.srcConst, displacementWidth) - } - - code = appendConst(code, c, constWidth) - buf.Truncate(base + len(code)) - return -} - -func (a *AssemblerImpl) encodeConstToMemory(buf asm.Buffer, n *nodeImpl) (err error) { - rexPrefix, modRM, sbi, sbiExist, displacementWidth, err := n.getMemoryLocation(true) - if err != nil { - return err - } - - // Alias for readability. - inst := n.instruction - c := n.srcConst - - if inst == MOVB && !fitInSigned8bit(c) { - return fmt.Errorf("too large load target const %d for MOVB", c) - } else if !fitIn32bit(c) { - return fmt.Errorf("too large load target const %d for %s", c, InstructionName(n.instruction)) - } - - var constWidth, opcode byte - switch inst { - case MOVB: - opcode = 0xc6 - constWidth = 8 - case MOVL: - opcode = 0xc7 - constWidth = 32 - case MOVQ: - rexPrefix |= rexPrefixW - opcode = 0xc7 - constWidth = 32 - default: - return errorEncodingUnsupported(n) - } - - base := buf.Len() - code := buf.Append(20)[:0] - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode, modRM) - - if sbiExist { - code = append(code, sbi) - } - - if displacementWidth != 0 { - code = appendConst(code, n.dstConst, displacementWidth) - } - - code = appendConst(code, c, constWidth) - - buf.Truncate(base + len(code)) - return -} - -func appendUint32(code []byte, v uint32) []byte { - b := [4]byte{} - binary.LittleEndian.PutUint32(b[:], uint32(v)) - return append(code, b[:]...) -} - -func appendUint64(code []byte, v uint64) []byte { - b := [8]byte{} - binary.LittleEndian.PutUint64(b[:], uint64(v)) - return append(code, b[:]...) -} - -func appendConst(code []byte, v int64, length byte) []byte { - switch length { - case 8: - return append(code, byte(v)) - case 32: - return appendUint32(code, uint32(v)) - default: - return appendUint64(code, uint64(v)) - } -} - -func (n *nodeImpl) getMemoryLocation(dstMem bool) (p rexPrefix, modRM byte, sbi byte, sbiExist bool, displacementWidth byte, err error) { - var baseReg, indexReg asm.Register - var offset asm.ConstantValue - var scale byte - if dstMem { - baseReg, offset, indexReg, scale = n.dstReg, n.dstConst, n.dstMemIndex, n.dstMemScale - } else { - baseReg, offset, indexReg, scale = n.srcReg, n.srcConst, n.srcMemIndex, n.srcMemScale - } - - if !fitIn32bit(offset) { - err = errors.New("offset does not fit in 32-bit integer") - return - } - - if baseReg == asm.NilRegister && indexReg != asm.NilRegister { - // [(index*scale) + displacement] addressing is possible, but we haven't used it for now. - err = errors.New("addressing without base register but with index is not implemented") - } else if baseReg == asm.NilRegister { - modRM = 0b00_000_100 // Indicate that the memory location is specified by SIB. - sbi, sbiExist = byte(0b00_100_101), true - displacementWidth = 32 - } else if indexReg == asm.NilRegister { - modRM, p = register3bits(baseReg, registerSpecifierPositionModRMFieldRM) - - // Create ModR/M byte so that this instruction takes [R/M + displacement] operand if displacement !=0 - // and otherwise [R/M]. - withoutDisplacement := offset == 0 && - // If the target register is R13 or BP, we have to keep [R/M + displacement] even if the value - // is zero since it's not [R/M] operand is not defined for these two registers. - // https://wiki.osdev.org/X86-64_Instruction_Encoding#32.2F64-bit_addressing - baseReg != RegR13 && baseReg != RegBP - if withoutDisplacement { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b00_000_000 // Specifying that operand is memory without displacement - displacementWidth = 0 - } else if fitInSigned8bit(offset) { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b01_000_000 // Specifying that operand is memory + 8bit displacement. - displacementWidth = 8 - } else { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b10_000_000 // Specifying that operand is memory + 32bit displacement. - displacementWidth = 32 - } - - // For SP and R12 register, we have [SIB + displacement] if the const is non-zero, otherwise [SIP]. - // https://wiki.osdev.org/X86-64_Instruction_Encoding#32.2F64-bit_addressing - // - // Thefore we emit the SIB byte before the const so that [SIB + displacement] ends up [register + displacement]. - // https://wiki.osdev.org/X86-64_Instruction_Encoding#32.2F64-bit_addressing_2 - if baseReg == RegSP || baseReg == RegR12 { - sbi, sbiExist = byte(0b00_100_100), true - } - } else { - if indexReg == RegSP { - err = errors.New("SP cannot be used for SIB index") - return - } - - modRM = 0b00_000_100 // Indicate that the memory location is specified by SIB. - - withoutDisplacement := offset == 0 && - // For R13 and BP, base registers cannot be encoded "without displacement" mod (i.e. 0b00 mod). - baseReg != RegR13 && baseReg != RegBP - if withoutDisplacement { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b00_000_000 // Specifying that operand is SIB without displacement - displacementWidth = 0 - } else if fitInSigned8bit(offset) { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b01_000_000 // Specifying that operand is SIB + 8bit displacement. - displacementWidth = 8 - } else { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM |= 0b10_000_000 // Specifying that operand is SIB + 32bit displacement. - displacementWidth = 32 - } - - var baseRegBits byte - baseRegBits, p = register3bits(baseReg, registerSpecifierPositionModRMFieldRM) - - var indexRegBits byte - var indexRegPrefix rexPrefix - indexRegBits, indexRegPrefix = register3bits(indexReg, registerSpecifierPositionSIBIndex) - p |= indexRegPrefix - - sbi, sbiExist = baseRegBits|(indexRegBits<<3), true - switch scale { - case 1: - sbi |= 0b00_000_000 - case 2: - sbi |= 0b01_000_000 - case 4: - sbi |= 0b10_000_000 - case 8: - sbi |= 0b11_000_000 - default: - err = fmt.Errorf("scale in SIB must be one of 1, 2, 4, 8 but got %d", scale) - return - } - - } - return -} - -// getRegisterToRegisterModRM does XXXX -// -// TODO: srcOnModRMReg can be deleted after golang-asm removal. This is necessary to match our implementation -// with golang-asm, but in practice, there are equivalent opcodes to always have src on ModRM:reg without ambiguity. -func (n *nodeImpl) getRegisterToRegisterModRM(srcOnModRMReg bool) (rexPrefix, modRM byte, err error) { - var reg3bits, rm3bits byte - if srcOnModRMReg { - reg3bits, rexPrefix = register3bits(n.srcReg, - // Indicate that srcReg will be specified by ModRM:reg. - registerSpecifierPositionModRMFieldReg) - - var dstRexPrefix byte - rm3bits, dstRexPrefix = register3bits(n.dstReg, - // Indicate that dstReg will be specified by ModRM:r/m. - registerSpecifierPositionModRMFieldRM) - rexPrefix |= dstRexPrefix - } else { - rm3bits, rexPrefix = register3bits(n.srcReg, - // Indicate that srcReg will be specified by ModRM:r/m. - registerSpecifierPositionModRMFieldRM) - - var dstRexPrefix byte - reg3bits, dstRexPrefix = register3bits(n.dstReg, - // Indicate that dstReg will be specified by ModRM:reg. - registerSpecifierPositionModRMFieldReg) - rexPrefix |= dstRexPrefix - } - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#ModR.2FM - modRM = 0b11_000_000 | // Specifying that dst operand is register. - (reg3bits << 3) | - rm3bits - - return -} - -// RexPrefix represents REX prefix https://wiki.osdev.org/X86-64_Instruction_Encoding#REX_prefix -type rexPrefix = byte - -// REX prefixes are independent of each other and can be combined with OR. -const ( - rexPrefixNone rexPrefix = 0x0000_0000 // Indicates that the instruction doesn't need RexPrefix. - rexPrefixDefault rexPrefix = 0b0100_0000 - rexPrefixW = 0b0000_1000 | rexPrefixDefault // REX.W - rexPrefixR = 0b0000_0100 | rexPrefixDefault // REX.R - rexPrefixX = 0b0000_0010 | rexPrefixDefault // REX.X - rexPrefixB = 0b0000_0001 | rexPrefixDefault // REX.B -) - -// registerSpecifierPosition represents the position in the instruction bytes where an operand register is placed. -type registerSpecifierPosition byte - -const ( - registerSpecifierPositionModRMFieldReg registerSpecifierPosition = iota - registerSpecifierPositionModRMFieldRM - registerSpecifierPositionSIBIndex -) - -var regInfo = [...]struct { - bits byte - needRex bool -}{ - RegAX: {bits: 0b000}, - RegCX: {bits: 0b001}, - RegDX: {bits: 0b010}, - RegBX: {bits: 0b011}, - RegSP: {bits: 0b100}, - RegBP: {bits: 0b101}, - RegSI: {bits: 0b110}, - RegDI: {bits: 0b111}, - RegR8: {bits: 0b000, needRex: true}, - RegR9: {bits: 0b001, needRex: true}, - RegR10: {bits: 0b010, needRex: true}, - RegR11: {bits: 0b011, needRex: true}, - RegR12: {bits: 0b100, needRex: true}, - RegR13: {bits: 0b101, needRex: true}, - RegR14: {bits: 0b110, needRex: true}, - RegR15: {bits: 0b111, needRex: true}, - RegX0: {bits: 0b000}, - RegX1: {bits: 0b001}, - RegX2: {bits: 0b010}, - RegX3: {bits: 0b011}, - RegX4: {bits: 0b100}, - RegX5: {bits: 0b101}, - RegX6: {bits: 0b110}, - RegX7: {bits: 0b111}, - RegX8: {bits: 0b000, needRex: true}, - RegX9: {bits: 0b001, needRex: true}, - RegX10: {bits: 0b010, needRex: true}, - RegX11: {bits: 0b011, needRex: true}, - RegX12: {bits: 0b100, needRex: true}, - RegX13: {bits: 0b101, needRex: true}, - RegX14: {bits: 0b110, needRex: true}, - RegX15: {bits: 0b111, needRex: true}, -} - -func register3bits( - reg asm.Register, - registerSpecifierPosition registerSpecifierPosition, -) (bits byte, prefix rexPrefix) { - info := regInfo[reg] - bits = info.bits - if info.needRex { - // https://wiki.osdev.org/X86-64_Instruction_Encoding#REX_prefix - switch registerSpecifierPosition { - case registerSpecifierPositionModRMFieldReg: - prefix = rexPrefixR - case registerSpecifierPositionModRMFieldRM: - prefix = rexPrefixB - case registerSpecifierPositionSIBIndex: - prefix = rexPrefixX - } - } - return -} - -func fitIn32bit(v int64) bool { - return math.MinInt32 <= v && v <= math.MaxUint32 -} - -func fitInSigned8bit(v int64) bool { - return math.MinInt8 <= v && v <= math.MaxInt8 -} - -func isVectorRegister(r asm.Register) bool { - return RegX0 <= r && r <= RegX15 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl_staticconst.go b/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl_staticconst.go deleted file mode 100644 index 17a7f228cf..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/amd64/impl_staticconst.go +++ /dev/null @@ -1,181 +0,0 @@ -package amd64 - -import ( - "fmt" - "math" - - "github.com/tetratelabs/wazero/internal/asm" -) - -// defaultMaxDisplacementForConstantPool is the maximum displacement allowed for literal move instructions which access -// the constant pool. This is set as 2 ^30 conservatively while the actual limit is 2^31 since we actually allow this -// limit plus max(length(c) for c in the pool) so we must ensure that limit is less than 2^31. -const defaultMaxDisplacementForConstantPool = 1 << 30 - -func (a *AssemblerImpl) maybeFlushConstants(buf asm.Buffer, isEndOfFunction bool) { - if a.pool.Empty() { - return - } - - if isEndOfFunction || - // If the distance between (the first use in binary) and (end of constant pool) can be larger - // than MaxDisplacementForConstantPool, we have to emit the constant pool now, otherwise - // a const might be unreachable by a literal move whose maximum offset is +- 2^31. - ((a.pool.PoolSizeInBytes+buf.Len())-int(a.pool.FirstUseOffsetInBinary)) >= a.MaxDisplacementForConstantPool { - - if !isEndOfFunction { - // Adds the jump instruction to skip the constants if this is not the end of function. - // - // TODO: consider NOP padding for this jump, though this rarely happens as most functions should be - // small enough to fit all consts after the end of function. - if a.pool.PoolSizeInBytes >= math.MaxInt8-2 { - // long (near-relative) jump: https://www.felixcloutier.com/x86/jmp - buf.AppendByte(0xe9) - buf.AppendUint32(uint32(a.pool.PoolSizeInBytes)) - } else { - // short jump: https://www.felixcloutier.com/x86/jmp - buf.AppendByte(0xeb) - buf.AppendByte(byte(a.pool.PoolSizeInBytes)) - } - } - - for _, c := range a.pool.Consts { - c.SetOffsetInBinary(uint64(buf.Len())) - buf.AppendBytes(c.Raw) - } - - a.pool.Reset() - } -} - -func (a *AssemblerImpl) encodeRegisterToStaticConst(buf asm.Buffer, n *nodeImpl) (err error) { - var opc []byte - var rex byte - switch n.instruction { - case CMPL: - opc, rex = []byte{0x3b}, rexPrefixNone - case CMPQ: - opc, rex = []byte{0x3b}, rexPrefixW - default: - return errorEncodingUnsupported(n) - } - return a.encodeStaticConstImpl(buf, n, opc, rex, 0) -} - -var staticConstToRegisterOpcodes = [...]struct { - opcode, vopcode []byte - mandatoryPrefix, vmandatoryPrefix byte - rex rexPrefix -}{ - // https://www.felixcloutier.com/x86/movdqu:vmovdqu8:vmovdqu16:vmovdqu32:vmovdqu64 - MOVDQU: {mandatoryPrefix: 0xf3, opcode: []byte{0x0f, 0x6f}}, - // https://www.felixcloutier.com/x86/lea - LEAQ: {opcode: []byte{0x8d}, rex: rexPrefixW}, - // https://www.felixcloutier.com/x86/movupd - MOVUPD: {mandatoryPrefix: 0x66, opcode: []byte{0x0f, 0x10}}, - // https://www.felixcloutier.com/x86/mov - MOVL: {opcode: []byte{0x8b}, vopcode: []byte{0x0f, 0x6e}, vmandatoryPrefix: 0x66}, - MOVQ: {opcode: []byte{0x8b}, rex: rexPrefixW, vopcode: []byte{0x0f, 0x7e}, vmandatoryPrefix: 0xf3}, - // https://www.felixcloutier.com/x86/ucomisd - UCOMISD: {opcode: []byte{0x0f, 0x2e}, mandatoryPrefix: 0x66}, - // https://www.felixcloutier.com/x86/ucomiss - UCOMISS: {opcode: []byte{0x0f, 0x2e}}, - // https://www.felixcloutier.com/x86/subss - SUBSS: {opcode: []byte{0x0f, 0x5c}, mandatoryPrefix: 0xf3}, - // https://www.felixcloutier.com/x86/subsd - SUBSD: {opcode: []byte{0x0f, 0x5c}, mandatoryPrefix: 0xf2}, - // https://www.felixcloutier.com/x86/cmp - CMPL: {opcode: []byte{0x39}}, - CMPQ: {opcode: []byte{0x39}, rex: rexPrefixW}, - // https://www.felixcloutier.com/x86/add - ADDL: {opcode: []byte{0x03}}, - ADDQ: {opcode: []byte{0x03}, rex: rexPrefixW}, -} - -func (a *AssemblerImpl) encodeStaticConstToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - var opc []byte - var rex, mandatoryPrefix byte - info := staticConstToRegisterOpcodes[n.instruction] - switch n.instruction { - case MOVL, MOVQ: - if isVectorRegister(n.dstReg) { - opc, mandatoryPrefix = info.vopcode, info.vmandatoryPrefix - break - } - fallthrough - default: - opc, rex, mandatoryPrefix = info.opcode, info.rex, info.mandatoryPrefix - } - return a.encodeStaticConstImpl(buf, n, opc, rex, mandatoryPrefix) -} - -// encodeStaticConstImpl encodes an instruction where mod:r/m points to the memory location of the static constant n.staticConst, -// and the other operand is the register given at n.srcReg or n.dstReg. -func (a *AssemblerImpl) encodeStaticConstImpl(buf asm.Buffer, n *nodeImpl, opcode []byte, rex rexPrefix, mandatoryPrefix byte) error { - a.pool.AddConst(n.staticConst, uint64(buf.Len())) - - var reg asm.Register - if n.dstReg != asm.NilRegister { - reg = n.dstReg - } else { - reg = n.srcReg - } - - reg3Bits, rexPrefix := register3bits(reg, registerSpecifierPositionModRMFieldReg) - rexPrefix |= rex - - base := buf.Len() - code := buf.Append(len(opcode) + 7)[:0] - - if mandatoryPrefix != 0 { - code = append(code, mandatoryPrefix) - } - - if rexPrefix != rexPrefixNone { - code = append(code, rexPrefix) - } - - code = append(code, opcode...) - - // https://wiki.osdev.org/X86-64_Instruction_Encoding#32.2F64-bit_addressing - modRM := 0b00_000_101 | // Indicate "[RIP + 32bit displacement]" encoding. - (reg3Bits << 3) // Place the reg on ModRM:reg. - code = append(code, modRM) - - // Preserve 4 bytes for displacement which will be filled after we finalize the location. - code = append(code, 0, 0, 0, 0) - - if !n.staticConstReferrersAdded { - a.staticConstReferrers = append(a.staticConstReferrers, staticConstReferrer{n: n, instLen: len(code)}) - n.staticConstReferrersAdded = true - } - - buf.Truncate(base + len(code)) - return nil -} - -// CompileStaticConstToRegister implements Assembler.CompileStaticConstToRegister. -func (a *AssemblerImpl) CompileStaticConstToRegister(instruction asm.Instruction, c *asm.StaticConst, dstReg asm.Register) (err error) { - if len(c.Raw)%2 != 0 { - err = fmt.Errorf("the length of a static constant must be even but was %d", len(c.Raw)) - return - } - - n := a.newNode(instruction, operandTypesStaticConstToRegister) - n.dstReg = dstReg - n.staticConst = c - return -} - -// CompileRegisterToStaticConst implements Assembler.CompileRegisterToStaticConst. -func (a *AssemblerImpl) CompileRegisterToStaticConst(instruction asm.Instruction, srcReg asm.Register, c *asm.StaticConst) (err error) { - if len(c.Raw)%2 != 0 { - err = fmt.Errorf("the length of a static constant must be even but was %d", len(c.Raw)) - return - } - - n := a.newNode(instruction, operandTypesRegisterToStaticConst) - n.srcReg = srcReg - n.staticConst = c - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/assembler.go b/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/assembler.go deleted file mode 100644 index 628350d4dd..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/assembler.go +++ /dev/null @@ -1,115 +0,0 @@ -package arm64 - -import ( - "github.com/tetratelabs/wazero/internal/asm" -) - -// Assembler is the interface for arm64 specific assembler. -type Assembler interface { - asm.AssemblerBase - - // CompileMemoryWithRegisterOffsetToRegister adds an instruction where source operand is the memory address - // specified as `srcBaseReg + srcOffsetReg` and dst is the register `dstReg`. - CompileMemoryWithRegisterOffsetToRegister(instruction asm.Instruction, srcBaseReg, srcOffsetReg, dstReg asm.Register) - - // CompileRegisterToMemoryWithRegisterOffset adds an instruction where source operand is the register `srcReg`, - // and the destination is the memory address specified as `dstBaseReg + dstOffsetReg` - CompileRegisterToMemoryWithRegisterOffset(instruction asm.Instruction, srcReg, dstBaseReg, dstOffsetReg asm.Register) - - // CompileTwoRegistersToRegister adds an instruction where source operands consists of two registers `src1` and `src2`, - // and the destination is the register `dst`. - CompileTwoRegistersToRegister(instruction asm.Instruction, src1, src2, dst asm.Register) - - // CompileThreeRegistersToRegister adds an instruction where source operands consist of three registers - // `src1`, `src2` and `src3`, and destination operands consist of `dst` register. - CompileThreeRegistersToRegister(instruction asm.Instruction, src1, src2, src3, dst asm.Register) - - // CompileTwoRegistersToNone adds an instruction where source operands consist of two registers `src1` and `src2`, - // and destination operand is unspecified. - CompileTwoRegistersToNone(instruction asm.Instruction, src1, src2 asm.Register) - - // CompileRegisterAndConstToNone adds an instruction where source operands consist of one register `src` and - // constant `srcConst`, and destination operand is unspecified. - CompileRegisterAndConstToNone(instruction asm.Instruction, src asm.Register, srcConst asm.ConstantValue) - - // CompileRegisterAndConstToRegister adds an instruction where source operands consist of one register `src` and - // constant `srcConst`, and destination operand is a register `dst`. - CompileRegisterAndConstToRegister(instruction asm.Instruction, src asm.Register, srcConst asm.ConstantValue, dst asm.Register) - - // CompileLeftShiftedRegisterToRegister adds an instruction where source operand is the "left shifted register" - // represented as `srcReg << shiftNum` and the destination is the register `dstReg`. - CompileLeftShiftedRegisterToRegister( - instruction asm.Instruction, - shiftedSourceReg asm.Register, - shiftNum asm.ConstantValue, - srcReg, dstReg asm.Register, - ) - - // CompileConditionalRegisterSet adds an instruction to set 1 on dstReg if the condition satisfies, - // otherwise set 0. - CompileConditionalRegisterSet(cond asm.ConditionalRegisterState, dstReg asm.Register) - - // CompileMemoryToVectorRegister adds an instruction where source operands is the memory address specified by - // `srcBaseReg+srcOffset` and the destination is `dstReg` vector register. - CompileMemoryToVectorRegister(instruction asm.Instruction, srcBaseReg asm.Register, srcOffset asm.ConstantValue, - dstReg asm.Register, arrangement VectorArrangement) - - // CompileMemoryWithRegisterOffsetToVectorRegister is the same as CompileMemoryToVectorRegister except that the - // offset is specified by the `srcOffsetRegister` register. - CompileMemoryWithRegisterOffsetToVectorRegister(instruction asm.Instruction, srcBaseReg, - srcOffsetRegister asm.Register, dstReg asm.Register, arrangement VectorArrangement) - - // CompileVectorRegisterToMemory adds an instruction where source operand is `srcReg` vector register and the - // destination is the memory address specified by `dstBaseReg+dstOffset`. - CompileVectorRegisterToMemory(instruction asm.Instruction, srcReg, dstBaseReg asm.Register, - dstOffset asm.ConstantValue, arrangement VectorArrangement) - - // CompileVectorRegisterToMemoryWithRegisterOffset is the same as CompileVectorRegisterToMemory except that the - // offset is specified by the `dstOffsetRegister` register. - CompileVectorRegisterToMemoryWithRegisterOffset(instruction asm.Instruction, srcReg, dstBaseReg, - dstOffsetRegister asm.Register, arrangement VectorArrangement) - - // CompileRegisterToVectorRegister adds an instruction where source operand is `srcReg` general purpose register and - // the destination is the `dstReg` vector register. The destination vector's arrangement and index of element can be - // given by `arrangement` and `index`, but not all the instructions will use them. - CompileRegisterToVectorRegister(instruction asm.Instruction, srcReg, dstReg asm.Register, - arrangement VectorArrangement, index VectorIndex) - - // CompileVectorRegisterToRegister adds an instruction where destination operand is `dstReg` general purpose register - // and the source is the `srcReg` vector register. The source vector's arrangement and index of element can be - // given by `arrangement` and `index`, but not all the instructions will use them. - CompileVectorRegisterToRegister(instruction asm.Instruction, srcReg, dstReg asm.Register, - arrangement VectorArrangement, index VectorIndex) - - // CompileVectorRegisterToVectorRegister adds an instruction where both source and destination operands are vector - // registers. The vector's arrangement can be specified `arrangement`, and the source and destination element's - // index are given by `srcIndex` and `dstIndex` respectively, but not all the instructions will use them. - CompileVectorRegisterToVectorRegister(instruction asm.Instruction, srcReg, dstReg asm.Register, - arrangement VectorArrangement, srcIndex, dstIndex VectorIndex) - - // CompileVectorRegisterToVectorRegisterWithConst is the same as CompileVectorRegisterToVectorRegister but the - // additional constant can be provided. - // For example, the const can be used to specify the shift amount for USHLL instruction. - CompileVectorRegisterToVectorRegisterWithConst(instruction asm.Instruction, srcReg, dstReg asm.Register, - arrangement VectorArrangement, c asm.ConstantValue) - - // CompileStaticConstToRegister adds an instruction where the source operand is StaticConstant located in - // the memory and the destination is the dstReg. - CompileStaticConstToRegister(instruction asm.Instruction, c *asm.StaticConst, dstReg asm.Register) - - // CompileStaticConstToVectorRegister adds an instruction where the source operand is StaticConstant located in - // the memory and the destination is the dstReg. - CompileStaticConstToVectorRegister(instruction asm.Instruction, c *asm.StaticConst, dstReg asm.Register, - arrangement VectorArrangement) - - // CompileTwoVectorRegistersToVectorRegister adds an instruction where source are two vectors and destination is one - // vector. The vector's arrangement can be specified `arrangement`. - CompileTwoVectorRegistersToVectorRegister(instruction asm.Instruction, srcReg, srcReg2, dstReg asm.Register, - arrangement VectorArrangement) - - // CompileTwoVectorRegistersToVectorRegisterWithConst is the same as CompileTwoVectorRegistersToVectorRegister except - // that this also accept additional constant. - // For example EXIT instruction needs the extraction target immediate as const. - CompileTwoVectorRegistersToVectorRegisterWithConst(instruction asm.Instruction, srcReg, srcReg2, dstReg asm.Register, - arrangement VectorArrangement, c asm.ConstantValue) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/consts.go b/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/consts.go deleted file mode 100644 index 47ed3cc2d4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/consts.go +++ /dev/null @@ -1,1476 +0,0 @@ -package arm64 - -import ( - "fmt" - - "github.com/tetratelabs/wazero/internal/asm" -) - -// Arm64-specific register states. -// -// Note: Naming conventions intentionally match the Go assembler: https://go.dev/doc/asm -// See https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/condition-codes-1-condition-flags-and-codes -const ( - // CondEQ is the eq (equal) condition code - CondEQ = asm.ConditionalRegisterStateUnset + 1 + iota - // CondNE is the ne (not equal) condition code - CondNE - // CondHS is the hs (unsigned higher or same) condition code - CondHS - // CondLO is the lo (unsigned lower) condition code - CondLO - // CondMI is the mi (negative) condition code - CondMI - // CondPL is the pl (positive or zero) condition code - CondPL - // CondVS is the vs (signed overflow) condition code - CondVS - // CondVC is the vc (no signed overflow) condition code - CondVC - // CondHI is the hi (unsigned higher) condition code - CondHI - // CondLS is the ls (unsigned lower or same) condition code - CondLS - // CondGE is the ge (signed greater than or equal) condition code - CondGE - // CondLT is the lt (signed less than) condition code - CondLT - // CondGT is the gt (signed greater than) condition code - CondGT - // CondLE is the le (signed less than or equal) condition code - CondLE - // CondAL is the al (always executed) condition code - CondAL - // CondNV has the same meaning as CondAL - CondNV -) - -// Arm64-specific registers. -// -// Note: Naming conventions intentionally match the Go assembler: https://go.dev/doc/asm -// See https://developer.arm.com/documentation/dui0801/a/Overview-of-AArch64-state/Predeclared-core-register-names-in-AArch64-state -const ( - // Integer registers. - - // RegR0 is the R0 register - RegR0 asm.Register = asm.NilRegister + 1 + iota - // RegR1 is the R1 register - RegR1 - // RegR2 is the R2 register - RegR2 - // RegR3 is the R3 register - RegR3 - // RegR4 is the R4 register - RegR4 - // RegR5 is the R5 register - RegR5 - // RegR6 is the R6 register - RegR6 - // RegR7 is the R7 register - RegR7 - // RegR8 is the R8 register - RegR8 - // RegR9 is the R9 register - RegR9 - // RegR10 is the R10 register - RegR10 - // RegR11 is the R11 register - RegR11 - // RegR12 is the R12 register - RegR12 - // RegR13 is the R13 register - RegR13 - // RegR14 is the R14 register - RegR14 - // RegR15 is the R15 register - RegR15 - // RegR16 is the R16 register - RegR16 - // RegR17 is the R17 register - RegR17 - // RegR18 is the R18 register - RegR18 - // RegR19 is the R19 register - RegR19 - // RegR20 is the R20 register - RegR20 - // RegR21 is the R21 register - RegR21 - // RegR22 is the R22 register - RegR22 - // RegR23 is the R23 register - RegR23 - // RegR24 is the R24 register - RegR24 - // RegR25 is the R25 register - RegR25 - // RegR26 is the R26 register - RegR26 - // RegR27 is the R27 register - RegR27 - // RegR28 is the R28 register - RegR28 - // RegR29 is the R29 register - RegR29 - // RegR30 is the R30 register - RegR30 - // RegRZR is the RZR register (read-only, always returning zero) - RegRZR - // RegSP is the SP register - RegSP - - // Scalar floating point registers. - - // RegV0 is the V0 register - RegV0 - // RegV1 is the V1 register - RegV1 - // RegV2 is the V2 register - RegV2 - // RegV3 is the V3 register - RegV3 - // RegV4 is the V4 register - RegV4 - // RegV5 is the V5 register - RegV5 - // RegV6 is the V6 register - RegV6 - // RegV7 is the V7 register - RegV7 - // RegV8 is the V8 register - RegV8 - // RegV9 is the V9 register - RegV9 - // RegV10 is the V10 register - RegV10 - // RegV11 is the V11 register - RegV11 - // RegV12 is the V12 register - RegV12 - // RegV13 is the V13 register - RegV13 - // RegV14 is the V14 register - RegV14 - // RegV15 is the V15 register - RegV15 - // RegV16 is the V16 register - RegV16 - // RegV17 is the V17 register - RegV17 - // RegV18 is the V18 register - RegV18 - // RegV19 is the V19 register - RegV19 - // RegV20 is the V20 register - RegV20 - // RegV21 is the V21 register - RegV21 - // RegV22 is the V22 register - RegV22 - // RegV23 is the V23 register - RegV23 - // RegV24 is the V24 register - RegV24 - // RegV25 is the V25 register - RegV25 - // RegV26 is the V26 register - RegV26 - // RegV27 is the V27 register - RegV27 - // RegV28 is the V28 register - RegV28 - // RegV29 is the V29 register - RegV29 - // RegV30 is the V30 register - RegV30 - // RegV31 is the V31 register - RegV31 - - // Floating point status register. - - // RegFPSR is the FPSR register - RegFPSR - - // Assign each conditional register state to the unique register ID. - // This is to reduce the size of nodeImpl struct without having dedicated field - // for conditional register state which would not be used by most nodes. - // This is taking advantage of the fact that conditional operations are always - // on a single register and condition code, and never two registers. - - // RegCondEQ encodes CondEQ into a field that would otherwise store a register - RegCondEQ - // RegCondNE encodes CondNE into a field that would otherwise store a register - RegCondNE - // RegCondHS encodes CondHS into a field that would otherwise store a register - RegCondHS - // RegCondLO encodes CondLO into a field that would otherwise store a register - RegCondLO - // RegCondMI encodes CondMI into a field that would otherwise store a register - RegCondMI - // RegCondPL encodes CondPL into a field that would otherwise store a register - RegCondPL - // RegCondVS encodes CondVS into a field that would otherwise store a register - RegCondVS - // RegCondVC encodes CondVC into a field that would otherwise store a register - RegCondVC - // RegCondHI encodes CondHI into a field that would otherwise store a register - RegCondHI - // RegCondLS encodes CondLS into a field that would otherwise store a register - RegCondLS - // RegCondGE encodes CondGE into a field that would otherwise store a register - RegCondGE - // RegCondLT encodes CondLT into a field that would otherwise store a register - RegCondLT - // RegCondGT encodes CondGT into a field that would otherwise store a register - RegCondGT - // RegCondLE encodes CondLE into a field that would otherwise store a register - RegCondLE - // RegCondAL encodes CondAL into a field that would otherwise store a register - RegCondAL - // RegCondNV encodes CondNV into a field that would otherwise store a register - RegCondNV -) - -// conditionalRegisterStateToRegister cast a conditional register to its unique register ID. -// See the comment on RegCondEQ above. -func conditionalRegisterStateToRegister(c asm.ConditionalRegisterState) asm.Register { - switch c { - case CondEQ: - return RegCondEQ - case CondNE: - return RegCondNE - case CondHS: - return RegCondHS - case CondLO: - return RegCondLO - case CondMI: - return RegCondMI - case CondPL: - return RegCondPL - case CondVS: - return RegCondVS - case CondVC: - return RegCondVC - case CondHI: - return RegCondHI - case CondLS: - return RegCondLS - case CondGE: - return RegCondGE - case CondLT: - return RegCondLT - case CondGT: - return RegCondGT - case CondLE: - return RegCondLE - case CondAL: - return RegCondAL - case CondNV: - return RegCondNV - } - return asm.NilRegister -} - -// RegisterName returns the name of a given register -func RegisterName(r asm.Register) string { - switch r { - case asm.NilRegister: - return "nil" - case RegR0: - return "R0" - case RegR1: - return "R1" - case RegR2: - return "R2" - case RegR3: - return "R3" - case RegR4: - return "R4" - case RegR5: - return "R5" - case RegR6: - return "R6" - case RegR7: - return "R7" - case RegR8: - return "R8" - case RegR9: - return "R9" - case RegR10: - return "R10" - case RegR11: - return "R11" - case RegR12: - return "R12" - case RegR13: - return "R13" - case RegR14: - return "R14" - case RegR15: - return "R15" - case RegR16: - return "R16" - case RegR17: - return "R17" - case RegR18: - return "R18" - case RegR19: - return "R19" - case RegR20: - return "R20" - case RegR21: - return "R21" - case RegR22: - return "R22" - case RegR23: - return "R23" - case RegR24: - return "R24" - case RegR25: - return "R25" - case RegR26: - return "R26" - case RegR27: - return "R27" - case RegR28: - return "R28" - case RegR29: - return "R29" - case RegR30: - return "R30" - case RegRZR: - return "RZR" - case RegSP: - return "SP" - case RegV0: - return "V0" - case RegV1: - return "V1" - case RegV2: - return "V2" - case RegV3: - return "V3" - case RegV4: - return "V4" - case RegV5: - return "V5" - case RegV6: - return "V6" - case RegV7: - return "V7" - case RegV8: - return "V8" - case RegV9: - return "V9" - case RegV10: - return "V10" - case RegV11: - return "V11" - case RegV12: - return "V12" - case RegV13: - return "V13" - case RegV14: - return "V14" - case RegV15: - return "V15" - case RegV16: - return "V16" - case RegV17: - return "V17" - case RegV18: - return "V18" - case RegV19: - return "V19" - case RegV20: - return "V20" - case RegV21: - return "V21" - case RegV22: - return "V22" - case RegV23: - return "V23" - case RegV24: - return "V24" - case RegV25: - return "V25" - case RegV26: - return "V26" - case RegV27: - return "V27" - case RegV28: - return "V28" - case RegV29: - return "V29" - case RegV30: - return "V30" - case RegV31: - return "V31" - case RegFPSR: - return "FPSR" - case RegCondEQ: - return "COND_EQ" - case RegCondNE: - return "COND_NE" - case RegCondHS: - return "COND_HS" - case RegCondLO: - return "COND_LO" - case RegCondMI: - return "COND_MI" - case RegCondPL: - return "COND_PL" - case RegCondVS: - return "COND_VS" - case RegCondVC: - return "COND_VC" - case RegCondHI: - return "COND_HI" - case RegCondLS: - return "COND_LS" - case RegCondGE: - return "COND_GE" - case RegCondLT: - return "COND_LT" - case RegCondGT: - return "COND_GT" - case RegCondLE: - return "COND_LE" - case RegCondAL: - return "COND_AL" - case RegCondNV: - return "COND_NV" - } - return "UNKNOWN" -} - -// Arm64-specific instructions. -// -// Note: This only defines arm64 instructions used by wazero's compiler. -// Note: Naming conventions partially match the Go assembler: https://go.dev/doc/asm -const ( - // NOP is the NOP instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/NOP - NOP asm.Instruction = iota - // RET is the RET instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/RET - RET - // ADD is the ADD instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ADD--shifted-register- - ADD - // ADDS is the ADDS instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ADDS--shifted-register- - ADDS - // ADDW is the ADD instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ADD--shifted-register- - ADDW - // ADR is the ADR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ADR - ADR - // AND is the AND instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/AND--shifted-register- - AND - // ANDIMM32 is the AND(immediate) instruction in 32-bit mode https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/AND--immediate---Bitwise-AND--immediate--?lang=en - ANDIMM32 - // ANDIMM64 is the AND(immediate) instruction in 64-bit mode https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/AND--immediate---Bitwise-AND--immediate--?lang=en - ANDIMM64 - // ANDW is the AND instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/AND--register- - ANDW - // ASR is the ASR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ASR--register- - ASR - // ASRW is the ASR instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ASR--register- - ASRW - // B is the B instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/B - B - - // Below are B.cond instructions. - // * https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/B-cond - // * https://developer.arm.com/documentation/dui0802/a/A32-and-T32-Instructions/Condition-codes - - // BCONDEQ is the B.cond instruction with CondEQ. - BCONDEQ - // BCONDGE is the B.cond instruction with CondGE. - BCONDGE - // BCONDGT is the B.cond instruction with CondGT. - BCONDGT - // BCONDHI is the B.cond instruction with CondHI. - BCONDHI - // BCONDHS is the B.cond instruction with CondHS. - BCONDHS - // BCONDLE is the B.cond instruction with CondLE. - BCONDLE - // BCONDLO is the B.cond instruction with CondLO. - BCONDLO - // BCONDLS is the B.cond instruction with CondLS. - BCONDLS - // BCONDLT is the B.cond instruction with CondLT. - BCONDLT - // BCONDMI is the B.cond instruction with CondMI. - BCONDMI - // BCONDPL is the B.cond instruction with CondPL. - BCONDPL - // BCONDNE is the B.cond instruction with CondNE. - BCONDNE - // BCONDVS is the B.cond instruction with CondVS. - BCONDVS - // BCONDVC is the B.cond instruction with CondVC. - BCONDVC - - // CLZ is the CLZ instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/CLZ - CLZ - // CLZW is the CLZ instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/CLZ - CLZW - // CMP is the CMP instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/CMP--shifted-register- - CMP - // CMPW is the CMP instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/CMP--shifted-register- - CMPW - // CSET is the CSET instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/CSET - CSET - // EOR is the EOR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/EOR--shifted-register- - EOR - // EORW is the EOR instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/EOR--shifted-register- - EORW - // FABSD is the FABS instruction, for double-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FABS--scalar- - FABSD - // FABSS is the FABS instruction, for single-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FABS--scalar- - FABSS - // FADDD is the FADD instruction, for double-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FADD--scalar- - FADDD - // FADDS is the FADD instruction, for single-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FADD--scalar- - FADDS - // FCMPD is the FCMP instruction, for double-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCMP - FCMPD - // FCMPS is the FCMP instruction, for single-precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCMP - FCMPS - // FCVTDS is the FCVT instruction, for single to double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVT - FCVTDS - // FCVTSD is the FCVT instruction, for double to single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVT - FCVTSD - // FCVTZSD is the FCVTZS instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZS--scalar--integer- - FCVTZSD - // FCVTZSDW is the FCVTZS instruction, for double precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZS--scalar--integer- - FCVTZSDW - // FCVTZSS is the FCVTZS instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZS--scalar--integer- - FCVTZSS - // FCVTZSSW is the FCVTZS instruction, for single precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZS--scalar--integer- - FCVTZSSW - // FCVTZUD is the FCVTZU instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZU--scalar--integer- - FCVTZUD - // FCVTZUDW is the FCVTZU instruction, for double precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZU--scalar--integer- - FCVTZUDW - // FCVTZUS is the FCVTZU instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZU--scalar--integer- - FCVTZUS - // FCVTZUSW is the FCVTZU instruction, for single precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FCVTZU--scalar--integer- - FCVTZUSW - // FDIVD is the FDIV instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FDIV--scalar- - FDIVD - // FDIVS is the FDIV instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FDIV--scalar- - FDIVS - // FMAXD is the FMAX instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMAX--scalar- - FMAXD - // FMAXS is the FMAX instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMAX--scalar- - FMAXS - // FMIND is the FMIN instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMIN--scalar- - FMIND - // FMINS is the FMIN instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMIN--scalar- - FMINS - // FMOVD is the FMOV instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMOV--register- - FMOVD - // FMOVS is the FMOV instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMOV--register- - FMOVS - // FMULD is the FMUL instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMUL--scalar- - FMULD - // FMULS is the FMUL instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FMUL--scalar- - FMULS - // FNEGD is the FNEG instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FNEG--scalar- - FNEGD - // FNEGS is the FNEG instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FNEG--scalar- - FNEGS - // FRINTMD is the FRINTM instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTM--scalar- - FRINTMD - // FRINTMS is the FRINTM instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTM--scalar- - FRINTMS - // FRINTND is the FRINTN instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTN--scalar- - FRINTND - // FRINTNS is the FRINTN instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTN--scalar- - FRINTNS - // FRINTPD is the FRINTP instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTP--scalar- - FRINTPD - // FRINTPS is the FRINTP instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTP--scalar- - FRINTPS - // FRINTZD is the FRINTZ instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTZ--scalar- - FRINTZD - // FRINTZS is the FRINTZ instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FRINTZ--scalar- - FRINTZS - // FSQRTD is the FSQRT instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FSQRT--scalar- - FSQRTD - // FSQRTS is the FSQRT instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FSQRT--scalar- - FSQRTS - // FSUBD is the FSUB instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FSUB--scalar- - FSUBD - // FSUBS is the FSUB instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/FSUB--scalar- - FSUBS - // LSL is the LSL instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/LSL--register- - LSL - // LSLW is the LSL instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/LSL--register- - LSLW - // LSR is the LSR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/LSR--register- - LSR - // LSRW is the LSR instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/LSR--register- - LSRW - // FLDRD is the LDR (SIMD&FP) instruction for double precisions. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/LDR--register--SIMD-FP---Load-SIMD-FP-Register--register-offset--?lang=en - FLDRD - // FLDRS is the LDR (SIMD&FP) instruction for single precisions. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/LDR--register--SIMD-FP---Load-SIMD-FP-Register--register-offset--?lang=en - FLDRS - // LDRD is the LDR instruction in 64-bit mode. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LDR--register---Load-Register--register--?lang=en - LDRD - // LDRW is the LDR instruction in 32-bit mode. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LDR--register---Load-Register--register--?lang=en - LDRW - // LDRSBD is the LDRSB instruction in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRSB--register- - LDRSBD - // LDRSBW is the LDRSB instruction in 32-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRSB--register- - LDRSBW - // LDRB is the LDRB instruction. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRB--register- - LDRB - // LDRSHD is the LDRSHW instruction in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRSH--register- - LDRSHD - // LDRSHW is the LDRSHW instruction in 32-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRSH--register- - LDRSHW - // LDRH is the LDRH instruction. https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRH--register- - LDRH - // LDRSW is the LDRSW instruction https://developer.arm.com/documentation/dui0802/a/A64-Data-Transfer-Instructions/LDRSW--register- - LDRSW - // FSTRD is the STR (SIMD&FP) instruction for double precisions. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/STR--immediate--SIMD-FP---Store-SIMD-FP-register--immediate-offset--?lang=en - FSTRD - // FSTRS is the STR (SIMD&FP) instruction for single precisions. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/STR--immediate--SIMD-FP---Store-SIMD-FP-register--immediate-offset--?lang=en - FSTRS - // STRD is the STR instruction in 64-bit mode. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/STR--register---Store-Register--register--?lang=en - STRD - // STRW is the STR instruction in 32-bit mode. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/STR--register---Store-Register--register--?lang=en - STRW - // STRH is the STRH instruction. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/STRH--register---Store-Register-Halfword--register--?lang=en - STRH - // STRB is the STRB instruction. https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/STRB--register---Store-Register-Byte--register--?lang=en - STRB - // MOVD moves a double word from register to register, or const to register. - MOVD - // MOVW moves a word from register to register, or const to register. - MOVW - // MRS is the MRS instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MRS - MRS - // MSR is the MSR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MSR--register- - MSR - // MSUB is the MSUB instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MSUB - MSUB - // MSUBW is the MSUB instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MSUB - MSUBW - // MUL is the MUL instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MUL - MUL - // MULW is the MUL instruction, in 32-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MUL - MULW - // NEG is the NEG instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/NEG - NEG - // NEGW is the NEG instruction, in 32-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/NEG - NEGW - // ORR is the ORR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ORR--shifted-register- - ORR - // ORRW is the ORR instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ORR--shifted-register- - ORRW - // RBIT is the RBIT instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/RBIT - RBIT - // RBITW is the RBIT instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/RBIT - RBITW - // ROR is the ROR instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ROR--register- - ROR - // RORW is the RORW instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/ROR--register- - RORW - // SCVTFD is the SCVTF instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/SCVTF--scalar--integer- - SCVTFD - // SCVTFS is the SCVTF instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/SCVTF--scalar--integer- - SCVTFS - // SCVTFWD is the SCVTF instruction, for double precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/SCVTF--scalar--integer- - SCVTFWD - // SCVTFWS is the SCVTF instruction, for single precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/SCVTF--scalar--integer- - SCVTFWS - // SDIV is the SDIV instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SDIV - SDIV - // SDIVW is the SDIV instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SDIV - SDIVW - // SUB is the SUB instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SUB--shifted-register- - SUB - // SUBS is the SUBS instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SUBS--shifted-register- - SUBS - // SUBW is the SUB instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SUB--shifted-register- - SUBW - // SXTB is the SXTB instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SXTB - SXTB - // SXTBW is the SXTB instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SXTB - SXTBW - // SXTH is the SXTH instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SXTH - SXTH - // SXTHW is the SXTH instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SXTH - SXTHW - // SXTW is the SXTW instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/SXTW - SXTW - // UCVTFD is the UCVTF instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/UCVTF--scalar--integer- - UCVTFD - // UCVTFS is the UCVTF instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/UCVTF--scalar--integer- - UCVTFS - // UCVTFWD is the UCVTF instruction, for double precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/UCVTF--scalar--integer- - UCVTFWD - // UCVTFWS is the UCVTF instruction, for single precision in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-Floating-point-Instructions/UCVTF--scalar--integer- - UCVTFWS - // UDIV is the UDIV instruction. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UDIV - UDIV - // UDIVW is the UDIV instruction, in 64-bit mode. https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/UDIV - UDIVW - // VBIT is the BIT instruction. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/BIT--vector- - VBIT - // VCNT is the CNT instruction. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/CNT--vector- - VCNT - // VMOV has different semantics depending on the types of operands: - // - LDR(SIMD&FP) if the src is memory and dst is a vector: https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/LDR--immediate--SIMD-FP---Load-SIMD-FP-Register--immediate-offset-- - // - LDR(literal, SIMD&FP) if the src is static const and dst is a vector: https://developer.arm.com/documentation/dui0801/h/A64-Floating-point-Instructions/LDR--literal--SIMD-and-FP- - // - STR(SIMD&FP) if the dst is memory and src is a vector: https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/STR--immediate--SIMD-FP---Store-SIMD-FP-register--immediate-offset-- - VMOV - // UMOV is the UMOV instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMOV--Unsigned-Move-vector-element-to-general-purpose-register-?lang=en - UMOV - // INSGEN is the INS(general) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/INS--general---Insert-vector-element-from-general-purpose-register-?lang=en - INSGEN - // INSELEM is the INS(element) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/INS--element---Insert-vector-element-from-another-vector-element-?lang=en - INSELEM - // UADDLV is the UADDLV(vector) instruction. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/UADDLV--vector- - UADDLV - // VADD is the ADD(vector) instruction. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/ADD--vector- - VADD - // VFADDS is the FADD(vector) instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/FADD--vector- - VFADDS - // VFADDD is the FADD(vector) instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/FADD--vector- - VFADDD - // VSUB is the SUB(vector) instruction. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/SUB--vector- - VSUB - // VFSUBS is the FSUB(vector) instruction, for single precision. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/FSUB--vector- - VFSUBS - // VFSUBD is the FSUB(vector) instruction, for double precision. https://developer.arm.com/documentation/dui0802/a/A64-Advanced-SIMD-Vector-Instructions/FSUB--vector- - VFSUBD - // SSHL is the SSHL(vector,register) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHL--Signed-Shift-Left--register--?lang=en - SSHL - // SSHLL is the SSHLL(vector,immediate) instruction. https://developer.arm.com/documentation/dui0801/h/A64-SIMD-Vector-Instructions/SSHLL--SSHLL2--vector- - SSHLL - // USHL is the USHL(vector,register) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHL--Signed-Shift-Left--register--?lang=en - USHL - // USHLL is the USHLL(vector,immediate) instruction. https://developer.arm.com/documentation/dui0801/h/A64-SIMD-Vector-Instructions/SSHLL--SSHLL2--vector- - USHLL - // LD1R is the LD1R instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/LD1R--Load-one-single-element-structure-and-Replicate-to-all-lanes--of-one-register-- - LD1R - // SMOV32 is the 32-bit variant of SMOV(vector) instruction. https://developer.arm.com/documentation/100069/0610/A64-SIMD-Vector-Instructions/SMOV--vector- - SMOV32 - // DUPGEN is the DUP(general) instruction. https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/DUP--general---Duplicate-general-purpose-register-to-vector- - DUPGEN - // DUPELEM is the DUP(element) instruction. https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/DUP--element---Duplicate-vector-element-to-vector-or-scalar- - DUPELEM - // UMAXP is the UMAXP(vector) instruction. https://developer.arm.com/documentation/dui0801/g/A64-SIMD-Vector-Instructions/UMAXP--vector- - UMAXP - // UMINV is the UMINV(vector) instruction. https://developer.arm.com/documentation/100069/0610/A64-SIMD-Vector-Instructions/UMINV--vector- - UMINV - // CMEQ is the CMEQ(vector, register) instruction. https://developer.arm.com/documentation/dui0801/g/A64-SIMD-Vector-Instructions/CMEQ--vector--register- - CMEQ - // CMEQZERO is the CMEP(zero) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMEQ--zero---Compare-bitwise-Equal-to-zero--vector--?lang=en - CMEQZERO - // ADDP is the ADDP(scalar) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ADDP--scalar---Add-Pair-of-elements--scalar--?lang=en - ADDP - // VADDP is the ADDP(vector) instruction. https://developer.arm.com/documentation/dui0801/g/A64-SIMD-Vector-Instructions/ADDP--vector- - // Note: prefixed by V to distinguish from the non-vector variant of ADDP(scalar). - VADDP - // TBL1 is the TBL instruction whose source is one vector. https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/TBL--Table-vector-Lookup- - TBL1 - // TBL2 is the TBL instruction whose source is two vectors. https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/TBL--Table-vector-Lookup- - TBL2 - // NOT is the NOT(vector) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/NOT--Bitwise-NOT--vector--?lang=en - NOT - // VAND is the AND(vector) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/AND--vector---Bitwise-AND--vector-- - // Note: prefixed by V to distinguish from the non-vector variant of AND. - VAND - // VORR is the ORR(vector) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/ORR--vector--register---Bitwise-inclusive-OR--vector--register-- - // Note: prefixed by V to distinguish from the non-vector variant of ORR. - VORR - // BSL https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/BSL--Bitwise-Select- - BSL - // BIC is the BIC(vector) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/BIC--vector--register---Bitwise-bit-Clear--vector--register-- - BIC - // VFNEG is the FNEG(vector) instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/FNEG--vector---Floating-point-Negate--vector-- - // Note: prefixed by V to distinguish from the non-vector variant of FNEG. - VFNEG - // ADDV is the ADDV instruction https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/ADDV--Add-across-Vector- - ADDV - // ZIP1 is the ZIP1 instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ZIP1--Zip-vectors--primary--?lang=en - ZIP1 - // SSHR is the SSHR(immediate,vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHR--Signed-Shift-Right--immediate--?lang=en - SSHR - // EXT is the EXT instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/EXT--Extract-vector-from-pair-of-vectors-?lang=en - EXT - // CMGT is the CMGT(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMGT--register---Compare-signed-Greater-than--vector--?lang=en - CMGT - // CMHI is the CMHI(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMHI--register---Compare-unsigned-Higher--vector--?lang=en - CMHI - // CMGE is the CMGE(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMGE--register---Compare-signed-Greater-than-or-Equal--vector--?lang=en - CMGE - // CMHS is the CMHS(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMHS--register---Compare-unsigned-Higher-or-Same--vector--?lang=en - CMHS - // FCMEQ is the FCMEQ(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMEQ--register---Floating-point-Compare-Equal--vector--?lang=en - FCMEQ - // FCMGT is the FCMGT(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMGT--register---Floating-point-Compare-Greater-than--vector--?lang=en - FCMGT - // FCMGE is the FCMGE(register) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMGE--register---Floating-point-Compare-Greater-than-or-Equal--vector--?lang=en - FCMGE - // VFMUL is the FMUL(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMUL--vector---Floating-point-Multiply--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFMUL - // VFDIV is the FDIV(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FDIV--vector---Floating-point-Divide--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFDIV - // VFSQRT is the FSQRT(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FSQRT--vector---Floating-point-Square-Root--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFSQRT - // VFMIN is the FMIN(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMIN--vector---Floating-point-minimum--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFMIN - // VFMAX is the FMAX(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMAX--vector---Floating-point-Maximum--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFMAX - // VFABS is the FABS(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FABS--vector---Floating-point-Absolute-value--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFABS - // VFRINTP is the FRINTP(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTP--vector---Floating-point-Round-to-Integral--toward-Plus-infinity--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFRINTP - // VFRINTM is the FRINTM(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTM--vector---Floating-point-Round-to-Integral--toward-Minus-infinity--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFRINTM - // VFRINTZ is the FRINTZ(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTZ--vector---Floating-point-Round-to-Integral--toward-Zero--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFRINTZ - // VFRINTN is the FRINTN(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTN--vector---Floating-point-Round-to-Integral--to-nearest-with-ties-to-even--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFRINTN - // VMUL is the MUL(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/MUL--vector---Multiply--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VMUL - // VNEG is the NEG(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/NEG--vector---Negate--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VNEG - // VABS is the ABS(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ABS--Absolute-value--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VABS - // VSQADD is the SQADD(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQADD--Signed-saturating-Add-?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VSQADD - // VUQADD is the UQADD(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQADD--Unsigned-saturating-Add-?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VUQADD - // VSQSUB is the SQSUB(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQSUB--Signed-saturating-Subtract-?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VSQSUB - // VUQSUB is the UQSUB(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQSUB--Unsigned-saturating-Subtract-?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VUQSUB - // SMIN is the SMIN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMIN--Signed-Minimum--vector--?lang=en - SMIN - // SMAX is the SMAX instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMAX--Signed-Maximum--vector--?lang=en - SMAX - // UMIN is the UMIN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMIN--Unsigned-Minimum--vector--?lang=en - UMIN - // UMAX is the UMAX instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMAX--Unsigned-Maximum--vector--?lang=en - UMAX - // URHADD is the URHADD instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/URHADD--Unsigned-Rounding-Halving-Add-?lang=en - URHADD - // REV64 is the REV64 instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/REV64--Reverse-elements-in-64-bit-doublewords--vector--?lang=en - REV64 - // XTN is the XTN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/XTN--XTN2--Extract-Narrow-?lang=en - XTN - // VUMLAL is the UMLAL(vector) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMLAL--UMLAL2--vector---Unsigned-Multiply-Add-Long--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VUMLAL - // SHLL is the SHLL instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SHLL--SHLL2--Shift-Left-Long--by-element-size--?lang=en - SHLL - // SADDLP is the SADDLP instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SADDLP--Signed-Add-Long-Pairwise-?lang=en - SADDLP - // UADDLP is the UADDLP instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UADDLP--Unsigned-Add-Long-Pairwise-?lang=en - UADDLP - // SSHLL2 is the SSHLL2(vector,immediate) instruction. https://developer.arm.com/documentation/dui0801/h/A64-SIMD-Vector-Instructions/SSHLL--SSHLL2--vector- - SSHLL2 - // USHLL2 is the USHLL2(vector,immediate) instruction. https://developer.arm.com/documentation/dui0801/h/A64-SIMD-Vector-Instructions/SSHLL--SSHLL2--vector- - USHLL2 - // SQRDMULH is the SQRDMULH(vector) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQRDMULH--vector---Signed-saturating-Rounding-Doubling-Multiply-returning-High-half-?lang=en - SQRDMULH - // SMULL is the SMULL(vector) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMULL--SMULL2--vector---Signed-Multiply-Long--vector--?lang=en - SMULL - // SMULL2 is the SMULL2(vector) instruction. https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMULL--SMULL2--vector---Signed-Multiply-Long--vector--?lang=en - SMULL2 - // UMULL is the UMULL instruction. https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - UMULL - // UMULL2 is the UMULL2 instruction. https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - UMULL2 - // VFCVTZS is the FCVTZS(vector,integer) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTZS--vector--integer---Floating-point-Convert-to-Signed-integer--rounding-toward-Zero--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFCVTZS - // VFCVTZU is the FCVTZU(vector,integer) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTZU--vector--integer---Floating-point-Convert-to-Unsigned-integer--rounding-toward-Zero--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VFCVTZU - // SQXTN is the SQXTN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTN--SQXTN2--Signed-saturating-extract-Narrow-?lang=en - SQXTN - // UQXTN is the UQXTN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQXTN--UQXTN2--Unsigned-saturating-extract-Narrow-?lang=en - UQXTN - // SQXTN2 is the SQXTN2 instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTN--SQXTN2--Signed-saturating-extract-Narrow-?lang=en - SQXTN2 - // SQXTUN is the SQXTUN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTUN--SQXTUN2--Signed-saturating-extract-Unsigned-Narrow-?lang=en - SQXTUN - // SQXTUN2 is the SQXTUN2 instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTUN--SQXTUN2--Signed-saturating-extract-Unsigned-Narrow-?lang=en - SQXTUN2 - // VSCVTF is the SCVTF(vector, integer) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SCVTF--vector--integer---Signed-integer-Convert-to-Floating-point--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VSCVTF - // VUCVTF is the UCVTF(vector, integer) instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UCVTF--vector--integer---Unsigned-integer-Convert-to-Floating-point--vector--?lang=en - // Note: prefixed by V to distinguish from the non-vector variant. - VUCVTF - // FCVTL is the FCVTL instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTL--FCVTL2--Floating-point-Convert-to-higher-precision-Long--vector--?lang=en - FCVTL - // FCVTN is the FCVTN instruction https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTN--FCVTN2--Floating-point-Convert-to-lower-precision-Narrow--vector--?lang=en - FCVTN - - // UDF is the UDF instruction https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/UDF--Permanently-Undefined-?lang=en - UDF - - // instructionEnd is always placed at the bottom of this iota definition to be used in the test. - instructionEnd -) - -// VectorArrangement is the arrangement of data within a vector register. -type VectorArrangement byte - -const ( - // VectorArrangementNone is an arrangement indicating no data is stored. - VectorArrangementNone VectorArrangement = iota - // VectorArrangement8B is an arrangement of 8 bytes (64-bit vector) - VectorArrangement8B - // VectorArrangement16B is an arrangement of 16 bytes (128-bit vector) - VectorArrangement16B - // VectorArrangement4H is an arrangement of 4 half precisions (64-bit vector) - VectorArrangement4H - // VectorArrangement8H is an arrangement of 8 half precisions (128-bit vector) - VectorArrangement8H - // VectorArrangement2S is an arrangement of 2 single precisions (64-bit vector) - VectorArrangement2S - // VectorArrangement4S is an arrangement of 4 single precisions (128-bit vector) - VectorArrangement4S - // VectorArrangement1D is an arrangement of 1 double precision (64-bit vector) - VectorArrangement1D - // VectorArrangement2D is an arrangement of 2 double precisions (128-bit vector) - VectorArrangement2D - - // Assign each vector size specifier to a vector arrangement ID. - // Instructions can only have an arrangement or a size specifier, but not both, so it - // simplifies the internal representation of vector instructions by being able to - // store either into the same field. - - // VectorArrangementB is a size specifier of byte - VectorArrangementB - // VectorArrangementH is a size specifier of word (16-bit) - VectorArrangementH - // VectorArrangementS is a size specifier of double word (32-bit) - VectorArrangementS - // VectorArrangementD is a size specifier of quad word (64-bit) - VectorArrangementD - // VectorArrangementQ is a size specifier of the entire vector (128-bit) - VectorArrangementQ -) - -func (v VectorArrangement) String() (ret string) { - switch v { - case VectorArrangement8B: - ret = "8B" - case VectorArrangement16B: - ret = "16B" - case VectorArrangement4H: - ret = "4H" - case VectorArrangement8H: - ret = "8H" - case VectorArrangement2S: - ret = "2S" - case VectorArrangement4S: - ret = "4S" - case VectorArrangement1D: - ret = "1D" - case VectorArrangement2D: - ret = "2D" - case VectorArrangementB: - ret = "B" - case VectorArrangementH: - ret = "H" - case VectorArrangementS: - ret = "S" - case VectorArrangementD: - ret = "D" - case VectorArrangementQ: - ret = "Q" - case VectorArrangementNone: - ret = "none" - default: - panic(v) - } - return -} - -// VectorIndex is the index of an element of a vector register -type VectorIndex byte - -// VectorIndexNone indicates no vector index specified. -const VectorIndexNone = ^VectorIndex(0) - -// InstructionName returns the name of the given instruction -func InstructionName(i asm.Instruction) string { - switch i { - case NOP: - return "NOP" - case RET: - return "RET" - case ADD: - return "ADD" - case ADDS: - return "ADDS" - case ADDW: - return "ADDW" - case ADR: - return "ADR" - case AND: - return "AND" - case ANDIMM32: - return "ANDIMM32" - case ANDIMM64: - return "ANDIMM64" - case ANDW: - return "ANDW" - case ASR: - return "ASR" - case ASRW: - return "ASRW" - case B: - return "B" - case BCONDEQ: - return "BCONDEQ" - case BCONDGE: - return "BCONDGE" - case BCONDGT: - return "BCONDGT" - case BCONDHI: - return "BCONDHI" - case BCONDHS: - return "BCONDHS" - case BCONDLE: - return "BCONDLE" - case BCONDLO: - return "BCONDLO" - case BCONDLS: - return "BCONDLS" - case BCONDLT: - return "BCONDLT" - case BCONDMI: - return "BCONDMI" - case BCONDPL: - return "BCONDPL" - case BCONDNE: - return "BCONDNE" - case BCONDVS: - return "BCONDVS" - case BCONDVC: - return "BCONDVC" - case CLZ: - return "CLZ" - case CLZW: - return "CLZW" - case CMP: - return "CMP" - case CMPW: - return "CMPW" - case CSET: - return "CSET" - case EOR: - return "EOR" - case EORW: - return "EORW" - case FABSD: - return "FABSD" - case FABSS: - return "FABSS" - case FADDD: - return "FADDD" - case FADDS: - return "FADDS" - case FCMPD: - return "FCMPD" - case FCMPS: - return "FCMPS" - case FCVTDS: - return "FCVTDS" - case FCVTSD: - return "FCVTSD" - case FCVTZSD: - return "FCVTZSD" - case FCVTZSDW: - return "FCVTZSDW" - case FCVTZSS: - return "FCVTZSS" - case FCVTZSSW: - return "FCVTZSSW" - case FCVTZUD: - return "FCVTZUD" - case FCVTZUDW: - return "FCVTZUDW" - case FCVTZUS: - return "FCVTZUS" - case FCVTZUSW: - return "FCVTZUSW" - case FDIVD: - return "FDIVD" - case FDIVS: - return "FDIVS" - case FMAXD: - return "FMAXD" - case FMAXS: - return "FMAXS" - case FMIND: - return "FMIND" - case FMINS: - return "FMINS" - case FMOVD: - return "FMOVD" - case FMOVS: - return "FMOVS" - case FMULD: - return "FMULD" - case FMULS: - return "FMULS" - case FNEGD: - return "FNEGD" - case FNEGS: - return "FNEGS" - case FRINTMD: - return "FRINTMD" - case FRINTMS: - return "FRINTMS" - case FRINTND: - return "FRINTND" - case FRINTNS: - return "FRINTNS" - case FRINTPD: - return "FRINTPD" - case FRINTPS: - return "FRINTPS" - case FRINTZD: - return "FRINTZD" - case FRINTZS: - return "FRINTZS" - case FSQRTD: - return "FSQRTD" - case FSQRTS: - return "FSQRTS" - case FSUBD: - return "FSUBD" - case FSUBS: - return "FSUBS" - case LSL: - return "LSL" - case LSLW: - return "LSLW" - case LSR: - return "LSR" - case LSRW: - return "LSRW" - case LDRSBD: - return "LDRSBD" - case LDRSBW: - return "LDRSBW" - case LDRB: - return "LDRB" - case MOVD: - return "MOVD" - case LDRSHD: - return "LDRSHD" - case LDRSHW: - return "LDRSHW" - case LDRH: - return "LDRH" - case LDRSW: - return "LDRSW" - case STRD: - return "STRD" - case STRW: - return "STRW" - case STRH: - return "STRH" - case STRB: - return "STRB" - case MOVW: - return "MOVW" - case MRS: - return "MRS" - case MSR: - return "MSR" - case MSUB: - return "MSUB" - case MSUBW: - return "MSUBW" - case MUL: - return "MUL" - case MULW: - return "MULW" - case NEG: - return "NEG" - case NEGW: - return "NEGW" - case ORR: - return "ORR" - case ORRW: - return "ORRW" - case RBIT: - return "RBIT" - case RBITW: - return "RBITW" - case ROR: - return "ROR" - case RORW: - return "RORW" - case SCVTFD: - return "SCVTFD" - case SCVTFS: - return "SCVTFS" - case SCVTFWD: - return "SCVTFWD" - case SCVTFWS: - return "SCVTFWS" - case SDIV: - return "SDIV" - case SDIVW: - return "SDIVW" - case SUB: - return "SUB" - case SUBS: - return "SUBS" - case SUBW: - return "SUBW" - case SXTB: - return "SXTB" - case SXTBW: - return "SXTBW" - case SXTH: - return "SXTH" - case SXTHW: - return "SXTHW" - case SXTW: - return "SXTW" - case UCVTFD: - return "UCVTFD" - case UCVTFS: - return "UCVTFS" - case UCVTFWD: - return "UCVTFWD" - case UCVTFWS: - return "UCVTFWS" - case UDIV: - return "UDIV" - case UDIVW: - return "UDIVW" - case VBIT: - return "VBIT" - case VCNT: - return "VCNT" - case UADDLV: - return "UADDLV" - case VMOV: - return "VMOV" - case INSELEM: - return "INSELEM" - case UMOV: - return "UMOV" - case INSGEN: - return "INSGEN" - case VADD: - return "VADD" - case VFADDS: - return "VFADDS" - case VFADDD: - return "VFADDD" - case VSUB: - return "VSUB" - case VFSUBS: - return "VFSUBS" - case VFSUBD: - return "VFSUBD" - case SSHL: - return "SSHL" - case USHL: - return "USHL" - case SSHLL: - return "SSHLL" - case USHLL: - return "USHLL" - case LD1R: - return "LD1R" - case SMOV32: - return "SMOV32" - case DUPGEN: - return "DUPGEN" - case DUPELEM: - return "DUPELEM" - case UMAXP: - return "UMAXP" - case UMINV: - return "UMINV" - case CMEQ: - return "CMEQ" - case ADDP: - return "ADDP" - case VADDP: - return "VADDP" - case TBL1: - return "TBL1" - case TBL2: - return "TBL2" - case NOT: - return "NOT" - case VAND: - return "VAND" - case VORR: - return "VORR" - case BSL: - return "BSL" - case BIC: - return "BIC" - case VFNEG: - return "VFNEG" - case ADDV: - return "ADDV" - case CMEQZERO: - return "CMEQZERO" - case ZIP1: - return "ZIP1" - case SSHR: - return "SSHR" - case EXT: - return "EXT" - case CMGT: - return "CMGT" - case CMHI: - return "CMHI" - case CMGE: - return "CMGE" - case CMHS: - return "CMHS" - case FCMEQ: - return "FCMEQ" - case FCMGT: - return "FCMGT" - case FCMGE: - return "FCMGE" - case VFMUL: - return "VFMUL" - case VFDIV: - return "VFDIV" - case VFSQRT: - return "VFSQRT" - case VFMIN: - return "VFMIN" - case VFMAX: - return "VFMAX" - case VFABS: - return "VFABS" - case VFRINTP: - return "VFRINTP" - case VFRINTM: - return "VFRINTM" - case VFRINTZ: - return "VFRINTZ" - case VFRINTN: - return "VFRINTN" - case VMUL: - return "VMUL" - case VNEG: - return "VNEG" - case VABS: - return "VABS" - case VSQADD: - return "VSQADD" - case VUQADD: - return "VUQADD" - case SMIN: - return "SMIN" - case SMAX: - return "SMAX" - case UMIN: - return "UMIN" - case UMAX: - return "UMAX" - case URHADD: - return "URHADD" - case VSQSUB: - return "VSQSUB" - case VUQSUB: - return "VUQSUB" - case REV64: - return "REV64" - case XTN: - return "XTN" - case VUMLAL: - return "VUMLAL" - case SHLL: - return "SHLL" - case SSHLL2: - return "SSHLL2" - case USHLL2: - return "USHLL2" - case SQRDMULH: - return "SQRDMULH" - case SADDLP: - return "SADDLP" - case UADDLP: - return "UADDLP" - case SMULL: - return "SMULL" - case SMULL2: - return "SMULL2" - case UMULL: - return "UMULL" - case UMULL2: - return "UMULL2" - case VFCVTZS: - return "VFCVTZS" - case VFCVTZU: - return "VFCVTZU" - case SQXTN: - return "SQXTN" - case UQXTN: - return "UQXTN" - case SQXTN2: - return "SQXTN2" - case SQXTUN: - return "SQXTUN" - case SQXTUN2: - return "SQXTUN2" - case VSCVTF: - return "VSCVTF" - case VUCVTF: - return "VUCVTF" - case FCVTL: - return "FCVTL" - case FCVTN: - return "FCVTN" - case FSTRD: - return "FSTRD" - case FSTRS: - return "FSTRS" - case LDRD: - return "LDRD" - case LDRW: - return "LDRW" - case FLDRD: - return "FLDRD" - case FLDRS: - return "FLDRS" - case UDF: - return "UDF" - } - panic(fmt.Errorf("unknown instruction %d", i)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/impl.go b/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/impl.go deleted file mode 100644 index 00bc0d9952..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/arm64/impl.go +++ /dev/null @@ -1,3900 +0,0 @@ -package arm64 - -import ( - "encoding/binary" - "errors" - "fmt" - - "github.com/tetratelabs/wazero/internal/asm" -) - -type nodeImpl struct { - // jumpTarget holds the target node in the linked for the jump-kind instruction. - jumpTarget *nodeImpl - // next holds the next node from this node in the assembled linked list. - next *nodeImpl - staticConst *asm.StaticConst - - instruction asm.Instruction - types operandTypes - srcReg, srcReg2, dstReg, dstReg2 asm.Register - srcConst, dstConst asm.ConstantValue - - offsetInBinary asm.NodeOffsetInBinary - - // readInstructionAddressBeforeTargetInstruction holds the instruction right before the target of - // read instruction address instruction. See asm.assemblerBase.CompileReadInstructionAddress. - readInstructionAddressBeforeTargetInstruction asm.Instruction - - vectorArrangement VectorArrangement - srcVectorIndex, dstVectorIndex VectorIndex -} - -// AssignJumpTarget implements the same method as documented on asm.Node. -func (n *nodeImpl) AssignJumpTarget(target asm.Node) { - n.jumpTarget = target.(*nodeImpl) -} - -// AssignDestinationConstant implements the same method as documented on asm.Node. -func (n *nodeImpl) AssignDestinationConstant(value asm.ConstantValue) { - n.dstConst = value -} - -// AssignSourceConstant implements the same method as documented on asm.Node. -func (n *nodeImpl) AssignSourceConstant(value asm.ConstantValue) { - n.srcConst = value -} - -// OffsetInBinary implements the same method as documented on asm.Node. -func (n *nodeImpl) OffsetInBinary() asm.NodeOffsetInBinary { - return n.offsetInBinary -} - -// String implements fmt.Stringer. -// -// This is for debugging purpose, and the format is similar to the AT&T assembly syntax, -// meaning that this should look like "INSTRUCTION ${from}, ${to}" where each operand -// might be embraced by '[]' to represent the memory location, and multiple operands -// are embraced by `()`. -func (n *nodeImpl) String() (ret string) { - instName := InstructionName(n.instruction) - switch n.types { - case operandTypesNoneToNone: - ret = instName - case operandTypesNoneToRegister: - ret = fmt.Sprintf("%s %s", instName, RegisterName(n.dstReg)) - case operandTypesNoneToBranch: - ret = fmt.Sprintf("%s {%v}", instName, n.jumpTarget) - case operandTypesRegisterToRegister: - ret = fmt.Sprintf("%s %s, %s", instName, RegisterName(n.srcReg), RegisterName(n.dstReg)) - case operandTypesLeftShiftedRegisterToRegister: - ret = fmt.Sprintf("%s (%s, %s << %d), %s", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2), n.srcConst, RegisterName(n.dstReg)) - case operandTypesTwoRegistersToRegister: - ret = fmt.Sprintf("%s (%s, %s), %s", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2), RegisterName(n.dstReg)) - case operandTypesThreeRegistersToRegister: - ret = fmt.Sprintf("%s (%s, %s, %s), %s)", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2), RegisterName(n.dstReg), RegisterName(n.dstReg2)) - case operandTypesTwoRegistersToNone: - ret = fmt.Sprintf("%s (%s, %s)", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2)) - case operandTypesRegisterAndConstToNone: - ret = fmt.Sprintf("%s (%s, 0x%x)", instName, RegisterName(n.srcReg), n.srcConst) - case operandTypesRegisterAndConstToRegister: - ret = fmt.Sprintf("%s (%s, 0x%x), %s", instName, RegisterName(n.srcReg), n.srcConst, RegisterName(n.dstReg)) - case operandTypesRegisterToMemory: - if n.dstReg2 != asm.NilRegister { - ret = fmt.Sprintf("%s %s, [%s + %s]", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), RegisterName(n.dstReg2)) - } else { - ret = fmt.Sprintf("%s %s, [%s + 0x%x]", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), n.dstConst) - } - case operandTypesMemoryToRegister: - if n.srcReg2 != asm.NilRegister { - ret = fmt.Sprintf("%s [%s + %s], %s", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2), RegisterName(n.dstReg)) - } else { - ret = fmt.Sprintf("%s [%s + 0x%x], %s", instName, RegisterName(n.srcReg), n.srcConst, RegisterName(n.dstReg)) - } - case operandTypesConstToRegister: - ret = fmt.Sprintf("%s 0x%x, %s", instName, n.srcConst, RegisterName(n.dstReg)) - case operandTypesRegisterToVectorRegister: - ret = fmt.Sprintf("%s %s, %s.%s[%d]", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), n.vectorArrangement, n.dstVectorIndex) - case operandTypesVectorRegisterToRegister: - ret = fmt.Sprintf("%s %s.%s[%d], %s", instName, RegisterName(n.srcReg), n.vectorArrangement, n.srcVectorIndex, RegisterName(n.dstReg)) - case operandTypesVectorRegisterToMemory: - if n.dstReg2 != asm.NilRegister { - ret = fmt.Sprintf("%s %s.%s, [%s + %s]", instName, RegisterName(n.srcReg), n.vectorArrangement, RegisterName(n.dstReg), RegisterName(n.dstReg2)) - } else { - ret = fmt.Sprintf("%s %s.%s, [%s + 0x%x]", instName, RegisterName(n.srcReg), n.vectorArrangement, RegisterName(n.dstReg), n.dstConst) - } - case operandTypesMemoryToVectorRegister: - ret = fmt.Sprintf("%s [%s], %s.%s", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), n.vectorArrangement) - case operandTypesVectorRegisterToVectorRegister: - ret = fmt.Sprintf("%s %[2]s.%[4]s, %[3]s.%[4]s", instName, RegisterName(n.srcReg), RegisterName(n.dstReg), n.vectorArrangement) - case operandTypesStaticConstToVectorRegister: - ret = fmt.Sprintf("%s $%#x %s.%s", instName, n.staticConst.Raw, RegisterName(n.dstReg), n.vectorArrangement) - case operandTypesTwoVectorRegistersToVectorRegister: - ret = fmt.Sprintf("%s (%s.%[5]s, %[3]s.%[5]s), %[4]s.%[5]s", instName, RegisterName(n.srcReg), RegisterName(n.srcReg2), RegisterName(n.dstReg), n.vectorArrangement) - } - return -} - -// operandTypes represents types of operands of a node. -type operandTypes byte - -const ( - operandTypesNoneToNone operandTypes = iota - operandTypesNoneToRegister - operandTypesNoneToBranch - operandTypesRegisterToRegister - operandTypesLeftShiftedRegisterToRegister - operandTypesTwoRegistersToRegister - operandTypesThreeRegistersToRegister - operandTypesTwoRegistersToNone - operandTypesRegisterAndConstToNone - operandTypesRegisterAndConstToRegister - operandTypesRegisterToMemory - operandTypesMemoryToRegister - operandTypesConstToRegister - operandTypesRegisterToVectorRegister - operandTypesVectorRegisterToRegister - operandTypesMemoryToVectorRegister - operandTypesVectorRegisterToMemory - operandTypesVectorRegisterToVectorRegister - operandTypesTwoVectorRegistersToVectorRegister - operandTypesStaticConstToVectorRegister -) - -// String implements fmt.Stringer -func (o operandTypes) String() (ret string) { - switch o { - case operandTypesNoneToNone: - ret = "NoneToNone" - case operandTypesNoneToRegister: - ret = "NoneToRegister" - case operandTypesNoneToBranch: - ret = "NoneToBranch" - case operandTypesRegisterToRegister: - ret = "RegisterToRegister" - case operandTypesLeftShiftedRegisterToRegister: - ret = "LeftShiftedRegisterToRegister" - case operandTypesTwoRegistersToRegister: - ret = "TwoRegistersToRegister" - case operandTypesThreeRegistersToRegister: - ret = "ThreeRegistersToRegister" - case operandTypesTwoRegistersToNone: - ret = "TwoRegistersToNone" - case operandTypesRegisterAndConstToNone: - ret = "RegisterAndConstToNone" - case operandTypesRegisterAndConstToRegister: - ret = "RegisterAndConstToRegister" - case operandTypesRegisterToMemory: - ret = "RegisterToMemory" - case operandTypesMemoryToRegister: - ret = "MemoryToRegister" - case operandTypesConstToRegister: - ret = "ConstToRegister" - case operandTypesRegisterToVectorRegister: - ret = "RegisterToVectorRegister" - case operandTypesVectorRegisterToRegister: - ret = "VectorRegisterToRegister" - case operandTypesMemoryToVectorRegister: - ret = "MemoryToVectorRegister" - case operandTypesVectorRegisterToMemory: - ret = "VectorRegisterToMemory" - case operandTypesVectorRegisterToVectorRegister: - ret = "VectorRegisterToVectorRegister" - case operandTypesTwoVectorRegistersToVectorRegister: - ret = "TwoVectorRegistersToVectorRegister" - case operandTypesStaticConstToVectorRegister: - ret = "StaticConstToVectorRegister" - } - return -} - -const ( - maxSignedInt26 int64 = 1<<25 - 1 - minSignedInt26 int64 = -(1 << 25) - - maxSignedInt19 int64 = 1<<19 - 1 - minSignedInt19 int64 = -(1 << 19) -) - -// AssemblerImpl implements Assembler. -type AssemblerImpl struct { - root *nodeImpl - current *nodeImpl - asm.BaseAssemblerImpl - relativeJumpNodes []*nodeImpl - adrInstructionNodes []*nodeImpl - nodePool nodePool - pool asm.StaticConstPool - nodeCount int - - // MaxDisplacementForConstantPool is fixed to defaultMaxDisplacementForConstPool - // but have it as a field here for testability. - MaxDisplacementForConstantPool int - - temporaryRegister asm.Register -} - -const nodePageSize = 128 - -type nodePage = [nodePageSize]nodeImpl - -// nodePool is the central allocation pool for nodeImpl used by a single AssemblerImpl. -// This reduces the allocations over compilation by reusing AssemblerImpl. -type nodePool struct { - pages []*nodePage - index int -} - -// allocNode allocates a new nodeImpl for use from the pool. -// This expands the pool if there is no space left for it. -func (n *nodePool) allocNode() *nodeImpl { - if n.index == nodePageSize { - if len(n.pages) == cap(n.pages) { - n.pages = append(n.pages, new(nodePage)) - } else { - i := len(n.pages) - n.pages = n.pages[:i+1] - if n.pages[i] == nil { - n.pages[i] = new(nodePage) - } - } - n.index = 0 - } - ret := &n.pages[len(n.pages)-1][n.index] - n.index++ - return ret -} - -func (n *nodePool) reset() { - for _, ns := range n.pages { - pages := ns[:] - for i := range pages { - pages[i] = nodeImpl{} - } - } - n.pages = n.pages[:0] - n.index = nodePageSize -} - -func NewAssembler(temporaryRegister asm.Register) *AssemblerImpl { - return &AssemblerImpl{ - nodePool: nodePool{index: nodePageSize}, - temporaryRegister: temporaryRegister, - pool: asm.NewStaticConstPool(), - MaxDisplacementForConstantPool: defaultMaxDisplacementForConstPool, - } -} - -// AllocateNOP implements asm.AssemblerBase. -func (a *AssemblerImpl) AllocateNOP() asm.Node { - n := a.nodePool.allocNode() - n.instruction = NOP - n.types = operandTypesNoneToNone - return n -} - -// Add implements asm.AssemblerBase. -func (a *AssemblerImpl) Add(n asm.Node) { - a.addNode(n.(*nodeImpl)) -} - -// Reset implements asm.AssemblerBase. -func (a *AssemblerImpl) Reset() { - pool := a.pool - pool.Reset() - *a = AssemblerImpl{ - nodePool: a.nodePool, - pool: pool, - temporaryRegister: a.temporaryRegister, - adrInstructionNodes: a.adrInstructionNodes[:0], - relativeJumpNodes: a.relativeJumpNodes[:0], - BaseAssemblerImpl: asm.BaseAssemblerImpl{ - SetBranchTargetOnNextNodes: a.SetBranchTargetOnNextNodes[:0], - JumpTableEntries: a.JumpTableEntries[:0], - }, - } - a.nodePool.reset() -} - -// newNode creates a new Node and appends it into the linked list. -func (a *AssemblerImpl) newNode(instruction asm.Instruction, types operandTypes) *nodeImpl { - n := a.nodePool.allocNode() - n.instruction = instruction - n.types = types - - a.addNode(n) - return n -} - -// addNode appends the new node into the linked list. -func (a *AssemblerImpl) addNode(node *nodeImpl) { - a.nodeCount++ - - if a.root == nil { - a.root = node - a.current = node - } else { - parent := a.current - parent.next = node - a.current = node - } - - for _, o := range a.SetBranchTargetOnNextNodes { - origin := o.(*nodeImpl) - origin.jumpTarget = node - } - // Reuse the underlying slice to avoid re-allocations. - a.SetBranchTargetOnNextNodes = a.SetBranchTargetOnNextNodes[:0] -} - -// Assemble implements asm.AssemblerBase -func (a *AssemblerImpl) Assemble(buf asm.Buffer) error { - // arm64 has 32-bit fixed length instructions, - // but note that some nodes are encoded as multiple instructions, - // so the resulting binary might not be the size of count*8. - buf.Grow(a.nodeCount * 8) - - for n := a.root; n != nil; n = n.next { - n.offsetInBinary = uint64(buf.Len()) - if err := a.encodeNode(buf, n); err != nil { - return err - } - a.maybeFlushConstPool(buf, n.next == nil) - } - - code := buf.Bytes() - - if err := a.FinalizeJumpTableEntry(code); err != nil { - return err - } - - for _, rel := range a.relativeJumpNodes { - if err := a.relativeBranchFinalize(code, rel); err != nil { - return err - } - } - - for _, adr := range a.adrInstructionNodes { - if err := a.finalizeADRInstructionNode(code, adr); err != nil { - return err - } - } - return nil -} - -const defaultMaxDisplacementForConstPool = (1 << 20) - 1 - 4 // -4 for unconditional branch to skip the constants. - -// maybeFlushConstPool flushes the constant pool if endOfBinary or a boundary condition was met. -func (a *AssemblerImpl) maybeFlushConstPool(buf asm.Buffer, endOfBinary bool) { - if a.pool.Empty() { - return - } - - // If endOfBinary = true, we no longer need to emit the instructions, therefore - // flush all the constants. - if endOfBinary || - // Also, if the offset between the first usage of the constant pool and - // the first constant would exceed 2^20 -1(= 2MiB-1), which is the maximum offset - // for LDR(literal)/ADR instruction, flush all the constants in the pool. - (buf.Len()+a.pool.PoolSizeInBytes-int(a.pool.FirstUseOffsetInBinary)) >= a.MaxDisplacementForConstantPool { - - // Before emitting consts, we have to add br instruction to skip the const pool. - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L1123-L1129 - skipOffset := a.pool.PoolSizeInBytes/4 + 1 - if a.pool.PoolSizeInBytes%4 != 0 { - skipOffset++ - } - if endOfBinary { - // If this is the end of binary, we never reach this block, - // so offset can be zero (which is the behavior of Go's assembler). - skipOffset = 0 - } - - buf.Append4Bytes( - byte(skipOffset), - byte(skipOffset>>8), - byte(skipOffset>>16), - 0x14, - ) - - // Then adding the consts into the binary. - for _, c := range a.pool.Consts { - c.SetOffsetInBinary(uint64(buf.Len())) - buf.AppendBytes(c.Raw) - } - - // arm64 instructions are 4-byte (32-bit) aligned, so we must pad the zero consts here. - if pad := buf.Len() % 4; pad != 0 { - buf.AppendBytes(make([]byte, 4-pad)) - } - - // After the flush, reset the constant pool. - a.pool.Reset() - } -} - -// encodeNode encodes the given node into writer. -func (a *AssemblerImpl) encodeNode(buf asm.Buffer, n *nodeImpl) (err error) { - switch n.types { - case operandTypesNoneToNone: - err = a.encodeNoneToNone(buf, n) - case operandTypesNoneToRegister: - err = a.encodeJumpToRegister(buf, n) - case operandTypesNoneToBranch: - err = a.encodeRelativeBranch(buf, n) - case operandTypesRegisterToRegister: - err = a.encodeRegisterToRegister(buf, n) - case operandTypesLeftShiftedRegisterToRegister: - err = a.encodeLeftShiftedRegisterToRegister(buf, n) - case operandTypesTwoRegistersToRegister: - err = a.encodeTwoRegistersToRegister(buf, n) - case operandTypesThreeRegistersToRegister: - err = a.encodeThreeRegistersToRegister(buf, n) - case operandTypesTwoRegistersToNone: - err = a.encodeTwoRegistersToNone(buf, n) - case operandTypesRegisterAndConstToNone: - err = a.encodeRegisterAndConstToNone(buf, n) - case operandTypesRegisterToMemory: - err = a.encodeRegisterToMemory(buf, n) - case operandTypesMemoryToRegister: - err = a.encodeMemoryToRegister(buf, n) - case operandTypesRegisterAndConstToRegister, operandTypesConstToRegister: - err = a.encodeConstToRegister(buf, n) - case operandTypesRegisterToVectorRegister: - err = a.encodeRegisterToVectorRegister(buf, n) - case operandTypesVectorRegisterToRegister: - err = a.encodeVectorRegisterToRegister(buf, n) - case operandTypesMemoryToVectorRegister: - err = a.encodeMemoryToVectorRegister(buf, n) - case operandTypesVectorRegisterToMemory: - err = a.encodeVectorRegisterToMemory(buf, n) - case operandTypesVectorRegisterToVectorRegister: - err = a.encodeVectorRegisterToVectorRegister(buf, n) - case operandTypesStaticConstToVectorRegister: - err = a.encodeStaticConstToVectorRegister(buf, n) - case operandTypesTwoVectorRegistersToVectorRegister: - err = a.encodeTwoVectorRegistersToVectorRegister(buf, n) - default: - err = fmt.Errorf("encoder undefined for [%s] operand type", n.types) - } - if err != nil { - err = fmt.Errorf("%w: %s", err, n) // Ensure the error is debuggable by including the string value of the node. - } - return -} - -// CompileStandAlone implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileStandAlone(instruction asm.Instruction) asm.Node { - return a.newNode(instruction, operandTypesNoneToNone) -} - -// CompileConstToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileConstToRegister( - instruction asm.Instruction, - value asm.ConstantValue, - destinationReg asm.Register, -) (inst asm.Node) { - n := a.newNode(instruction, operandTypesConstToRegister) - n.srcConst = value - n.dstReg = destinationReg - return n -} - -// CompileRegisterToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileRegisterToRegister(instruction asm.Instruction, from, to asm.Register) { - n := a.newNode(instruction, operandTypesRegisterToRegister) - n.srcReg = from - n.dstReg = to -} - -// CompileMemoryToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileMemoryToRegister( - instruction asm.Instruction, - sourceBaseReg asm.Register, - sourceOffsetConst asm.ConstantValue, - destinationReg asm.Register, -) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.srcReg = sourceBaseReg - n.srcConst = sourceOffsetConst - n.dstReg = destinationReg -} - -// CompileRegisterToMemory implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileRegisterToMemory( - instruction asm.Instruction, - sourceRegister, destinationBaseRegister asm.Register, - destinationOffsetConst asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesRegisterToMemory) - n.srcReg = sourceRegister - n.dstReg = destinationBaseRegister - n.dstConst = destinationOffsetConst -} - -// CompileJump implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileJump(jmpInstruction asm.Instruction) asm.Node { - return a.newNode(jmpInstruction, operandTypesNoneToBranch) -} - -// CompileJumpToRegister implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileJumpToRegister(jmpInstruction asm.Instruction, reg asm.Register) { - n := a.newNode(jmpInstruction, operandTypesNoneToRegister) - n.dstReg = reg -} - -// CompileReadInstructionAddress implements the same method as documented on asm.AssemblerBase. -func (a *AssemblerImpl) CompileReadInstructionAddress( - destinationRegister asm.Register, - beforeAcquisitionTargetInstruction asm.Instruction, -) { - n := a.newNode(ADR, operandTypesMemoryToRegister) - n.dstReg = destinationRegister - n.readInstructionAddressBeforeTargetInstruction = beforeAcquisitionTargetInstruction -} - -// CompileMemoryWithRegisterOffsetToRegister implements Assembler.CompileMemoryWithRegisterOffsetToRegister -func (a *AssemblerImpl) CompileMemoryWithRegisterOffsetToRegister( - instruction asm.Instruction, - srcBaseReg, srcOffsetReg, dstReg asm.Register, -) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.dstReg = dstReg - n.srcReg = srcBaseReg - n.srcReg2 = srcOffsetReg -} - -// CompileRegisterToMemoryWithRegisterOffset implements Assembler.CompileRegisterToMemoryWithRegisterOffset -func (a *AssemblerImpl) CompileRegisterToMemoryWithRegisterOffset( - instruction asm.Instruction, - srcReg, dstBaseReg, dstOffsetReg asm.Register, -) { - n := a.newNode(instruction, operandTypesRegisterToMemory) - n.srcReg = srcReg - n.dstReg = dstBaseReg - n.dstReg2 = dstOffsetReg -} - -// CompileTwoRegistersToRegister implements Assembler.CompileTwoRegistersToRegister -func (a *AssemblerImpl) CompileTwoRegistersToRegister(instruction asm.Instruction, src1, src2, dst asm.Register) { - n := a.newNode(instruction, operandTypesTwoRegistersToRegister) - n.srcReg = src1 - n.srcReg2 = src2 - n.dstReg = dst -} - -// CompileThreeRegistersToRegister implements Assembler.CompileThreeRegistersToRegister -func (a *AssemblerImpl) CompileThreeRegistersToRegister( - instruction asm.Instruction, - src1, src2, src3, dst asm.Register, -) { - n := a.newNode(instruction, operandTypesThreeRegistersToRegister) - n.srcReg = src1 - n.srcReg2 = src2 - n.dstReg = src3 // To minimize the size of nodeImpl struct, we reuse dstReg for the third source operand. - n.dstReg2 = dst -} - -// CompileTwoRegistersToNone implements Assembler.CompileTwoRegistersToNone -func (a *AssemblerImpl) CompileTwoRegistersToNone(instruction asm.Instruction, src1, src2 asm.Register) { - n := a.newNode(instruction, operandTypesTwoRegistersToNone) - n.srcReg = src1 - n.srcReg2 = src2 -} - -// CompileRegisterAndConstToNone implements Assembler.CompileRegisterAndConstToNone -func (a *AssemblerImpl) CompileRegisterAndConstToNone( - instruction asm.Instruction, - src asm.Register, - srcConst asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesRegisterAndConstToNone) - n.srcReg = src - n.srcConst = srcConst -} - -// CompileRegisterAndConstToRegister implements Assembler.CompileRegisterAndConstToRegister -func (a *AssemblerImpl) CompileRegisterAndConstToRegister( - instruction asm.Instruction, - src asm.Register, - srcConst asm.ConstantValue, - dst asm.Register, -) { - n := a.newNode(instruction, operandTypesRegisterAndConstToRegister) - n.srcReg = src - n.srcConst = srcConst - n.dstReg = dst -} - -// CompileLeftShiftedRegisterToRegister implements Assembler.CompileLeftShiftedRegisterToRegister -func (a *AssemblerImpl) CompileLeftShiftedRegisterToRegister( - instruction asm.Instruction, - shiftedSourceReg asm.Register, - shiftNum asm.ConstantValue, - srcReg, dstReg asm.Register, -) { - n := a.newNode(instruction, operandTypesLeftShiftedRegisterToRegister) - n.srcReg = srcReg - n.srcReg2 = shiftedSourceReg - n.srcConst = shiftNum - n.dstReg = dstReg -} - -// CompileConditionalRegisterSet implements Assembler.CompileConditionalRegisterSet -func (a *AssemblerImpl) CompileConditionalRegisterSet(cond asm.ConditionalRegisterState, dstReg asm.Register) { - n := a.newNode(CSET, operandTypesRegisterToRegister) - n.srcReg = conditionalRegisterStateToRegister(cond) - n.dstReg = dstReg -} - -// CompileMemoryToVectorRegister implements Assembler.CompileMemoryToVectorRegister -func (a *AssemblerImpl) CompileMemoryToVectorRegister( - instruction asm.Instruction, srcBaseReg asm.Register, dstOffset asm.ConstantValue, dstReg asm.Register, arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesMemoryToVectorRegister) - n.srcReg = srcBaseReg - n.srcConst = dstOffset - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -// CompileMemoryWithRegisterOffsetToVectorRegister implements Assembler.CompileMemoryWithRegisterOffsetToVectorRegister -func (a *AssemblerImpl) CompileMemoryWithRegisterOffsetToVectorRegister(instruction asm.Instruction, - srcBaseReg, srcOffsetRegister asm.Register, dstReg asm.Register, arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesMemoryToVectorRegister) - n.srcReg = srcBaseReg - n.srcReg2 = srcOffsetRegister - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -// CompileVectorRegisterToMemory implements Assembler.CompileVectorRegisterToMemory -func (a *AssemblerImpl) CompileVectorRegisterToMemory( - instruction asm.Instruction, srcReg, dstBaseReg asm.Register, dstOffset asm.ConstantValue, arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesVectorRegisterToMemory) - n.srcReg = srcReg - n.dstReg = dstBaseReg - n.dstConst = dstOffset - n.vectorArrangement = arrangement -} - -// CompileVectorRegisterToMemoryWithRegisterOffset implements Assembler.CompileVectorRegisterToMemoryWithRegisterOffset -func (a *AssemblerImpl) CompileVectorRegisterToMemoryWithRegisterOffset(instruction asm.Instruction, - srcReg, dstBaseReg, dstOffsetRegister asm.Register, arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesVectorRegisterToMemory) - n.srcReg = srcReg - n.dstReg = dstBaseReg - n.dstReg2 = dstOffsetRegister - n.vectorArrangement = arrangement -} - -// CompileRegisterToVectorRegister implements Assembler.CompileRegisterToVectorRegister -func (a *AssemblerImpl) CompileRegisterToVectorRegister( - instruction asm.Instruction, srcReg, dstReg asm.Register, arrangement VectorArrangement, index VectorIndex, -) { - n := a.newNode(instruction, operandTypesRegisterToVectorRegister) - n.srcReg = srcReg - n.dstReg = dstReg - n.vectorArrangement = arrangement - n.dstVectorIndex = index -} - -// CompileVectorRegisterToRegister implements Assembler.CompileVectorRegisterToRegister -func (a *AssemblerImpl) CompileVectorRegisterToRegister(instruction asm.Instruction, srcReg, dstReg asm.Register, - arrangement VectorArrangement, index VectorIndex, -) { - n := a.newNode(instruction, operandTypesVectorRegisterToRegister) - n.srcReg = srcReg - n.dstReg = dstReg - n.vectorArrangement = arrangement - n.srcVectorIndex = index -} - -// CompileVectorRegisterToVectorRegister implements Assembler.CompileVectorRegisterToVectorRegister -func (a *AssemblerImpl) CompileVectorRegisterToVectorRegister( - instruction asm.Instruction, srcReg, dstReg asm.Register, arrangement VectorArrangement, srcIndex, dstIndex VectorIndex, -) { - n := a.newNode(instruction, operandTypesVectorRegisterToVectorRegister) - n.srcReg = srcReg - n.dstReg = dstReg - n.vectorArrangement = arrangement - n.srcVectorIndex = srcIndex - n.dstVectorIndex = dstIndex -} - -// CompileVectorRegisterToVectorRegisterWithConst implements Assembler.CompileVectorRegisterToVectorRegisterWithConst -func (a *AssemblerImpl) CompileVectorRegisterToVectorRegisterWithConst(instruction asm.Instruction, - srcReg, dstReg asm.Register, arrangement VectorArrangement, c asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesVectorRegisterToVectorRegister) - n.srcReg = srcReg - n.srcConst = c - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -// CompileStaticConstToRegister implements Assembler.CompileStaticConstToVectorRegister -func (a *AssemblerImpl) CompileStaticConstToRegister(instruction asm.Instruction, c *asm.StaticConst, dstReg asm.Register) { - n := a.newNode(instruction, operandTypesMemoryToRegister) - n.staticConst = c - n.dstReg = dstReg -} - -// CompileStaticConstToVectorRegister implements Assembler.CompileStaticConstToVectorRegister -func (a *AssemblerImpl) CompileStaticConstToVectorRegister(instruction asm.Instruction, - c *asm.StaticConst, dstReg asm.Register, arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesStaticConstToVectorRegister) - n.staticConst = c - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -// CompileTwoVectorRegistersToVectorRegister implements Assembler.CompileTwoVectorRegistersToVectorRegister. -func (a *AssemblerImpl) CompileTwoVectorRegistersToVectorRegister(instruction asm.Instruction, srcReg, srcReg2, dstReg asm.Register, - arrangement VectorArrangement, -) { - n := a.newNode(instruction, operandTypesTwoVectorRegistersToVectorRegister) - n.srcReg = srcReg - n.srcReg2 = srcReg2 - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -// CompileTwoVectorRegistersToVectorRegisterWithConst implements Assembler.CompileTwoVectorRegistersToVectorRegisterWithConst. -func (a *AssemblerImpl) CompileTwoVectorRegistersToVectorRegisterWithConst(instruction asm.Instruction, - srcReg, srcReg2, dstReg asm.Register, arrangement VectorArrangement, c asm.ConstantValue, -) { - n := a.newNode(instruction, operandTypesTwoVectorRegistersToVectorRegister) - n.srcReg = srcReg - n.srcReg2 = srcReg2 - n.srcConst = c - n.dstReg = dstReg - n.vectorArrangement = arrangement -} - -func errorEncodingUnsupported(n *nodeImpl) error { - return fmt.Errorf("%s is unsupported for %s type", InstructionName(n.instruction), n.types) -} - -func (a *AssemblerImpl) encodeNoneToNone(buf asm.Buffer, n *nodeImpl) error { - switch n.instruction { - case UDF: - buf.Append4Bytes(0, 0, 0, 0) - return nil - case NOP: - return nil - default: - return errorEncodingUnsupported(n) - } -} - -func (a *AssemblerImpl) encodeJumpToRegister(buf asm.Buffer, n *nodeImpl) error { - // "Unconditional branch (register)" in https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Branches--Exception-Generating-and-System-instructions - var opc byte - switch n.instruction { - case RET: - opc = 0b0010 - case B: - opc = 0b0000 - default: - return errorEncodingUnsupported(n) - } - - regBits, err := intRegisterBits(n.dstReg) - if err != nil { - return fmt.Errorf("invalid destination register: %w", err) - } - - buf.Append4Bytes( - 0x00|(regBits<<5), - 0x00|(regBits>>3), - 0b000_11111|(opc<<5), - 0b1101011_0|(opc>>3), - ) - return err -} - -func (a *AssemblerImpl) relativeBranchFinalize(code []byte, n *nodeImpl) error { - var condBits byte - const condBitsUnconditional = 0xff // Indicates this is not conditional jump. - - // https://developer.arm.com/documentation/den0024/a/CHDEEABE - switch n.instruction { - case B: - condBits = condBitsUnconditional - case BCONDEQ: - condBits = 0b0000 - case BCONDGE: - condBits = 0b1010 - case BCONDGT: - condBits = 0b1100 - case BCONDHI: - condBits = 0b1000 - case BCONDHS: - condBits = 0b0010 - case BCONDLE: - condBits = 0b1101 - case BCONDLO: - condBits = 0b0011 - case BCONDLS: - condBits = 0b1001 - case BCONDLT: - condBits = 0b1011 - case BCONDMI: - condBits = 0b0100 - case BCONDPL: - condBits = 0b0101 - case BCONDNE: - condBits = 0b0001 - case BCONDVS: - condBits = 0b0110 - case BCONDVC: - condBits = 0b0111 - } - - branchInstOffset := int64(n.OffsetInBinary()) - offset := int64(n.jumpTarget.OffsetInBinary()) - branchInstOffset - if offset%4 != 0 { - return errors.New("BUG: relative jump offset must be 4 bytes aligned") - } - - branchInst := code[branchInstOffset : branchInstOffset+4] - if condBits == condBitsUnconditional { - imm26 := offset >> 2 // divide by 4. - if imm26 < minSignedInt26 || imm26 > maxSignedInt26 { - // In theory this could happen if a Wasm binary has a huge single label (more than 128MB for a single block), - // and in that case, we use load the offset into a register and do the register jump, but to avoid the complexity, - // we impose this limit for now as that would be *unlikely* happen in practice. - return fmt.Errorf("relative jump offset %d/4 must be within %d and %d", offset, minSignedInt26, maxSignedInt26) - } - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/B--Branch-?lang=en - branchInst[0] = byte(imm26) - branchInst[1] = byte(imm26 >> 8) - branchInst[2] = byte(imm26 >> 16) - branchInst[3] = (byte(imm26 >> 24 & 0b000000_11)) | 0b000101_00 - } else { - imm19 := offset >> 2 // divide by 4. - if imm19 < minSignedInt19 || imm19 > maxSignedInt19 { - // This should be a bug in our compiler as the conditional jumps are only used in the small offsets (~a few bytes), - // and if ever happens, compiler can be fixed. - return fmt.Errorf("BUG: relative jump offset %d/4(=%d) must be within %d and %d", offset, imm19, minSignedInt19, maxSignedInt19) - } - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/B-cond--Branch-conditionally-?lang=en - branchInst[0] = (byte(imm19<<5) & 0b111_0_0000) | condBits - branchInst[1] = byte(imm19 >> 3) - branchInst[2] = byte(imm19 >> 11) - branchInst[3] = 0b01010100 - } - return nil -} - -func (a *AssemblerImpl) encodeRelativeBranch(buf asm.Buffer, n *nodeImpl) error { - switch n.instruction { - case B, BCONDEQ, BCONDGE, BCONDGT, BCONDHI, BCONDHS, BCONDLE, BCONDLO, BCONDLS, BCONDLT, BCONDMI, BCONDNE, BCONDVS, BCONDVC, BCONDPL: - default: - return errorEncodingUnsupported(n) - } - - if n.jumpTarget == nil { - return fmt.Errorf("branch target must be set for %s", InstructionName(n.instruction)) - } - - // At this point, we don't yet know that target's branch, so emit the placeholder (4 bytes). - buf.Append4Bytes(0, 0, 0, 0) - a.relativeJumpNodes = append(a.relativeJumpNodes, n) - return nil -} - -func checkRegisterToRegisterType(src, dst asm.Register, requireSrcInt, requireDstInt bool) (err error) { - isSrcInt, isDstInt := isIntRegister(src), isIntRegister(dst) - if isSrcInt && !requireSrcInt { - err = fmt.Errorf("src requires float register but got %s", RegisterName(src)) - } else if !isSrcInt && requireSrcInt { - err = fmt.Errorf("src requires int register but got %s", RegisterName(src)) - } else if isDstInt && !requireDstInt { - err = fmt.Errorf("dst requires float register but got %s", RegisterName(dst)) - } else if !isDstInt && requireDstInt { - err = fmt.Errorf("dst requires int register but got %s", RegisterName(dst)) - } - return -} - -func (a *AssemblerImpl) encodeRegisterToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - switch inst := n.instruction; inst { - case ADD, ADDW, SUB: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en#addsub_shift - var sfops byte - switch inst { - case ADD: - sfops = 0b100 - case ADDW: - case SUB: - sfops = 0b110 - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - dstRegBits>>3, - srcRegBits, - (sfops<<5)|0b01011, - ) - case CLZ, CLZW, RBIT, RBITW: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - var sf, opcode byte - switch inst { - case CLZ: - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/CLZ--Count-Leading-Zeros-?lang=en - sf, opcode = 0b1, 0b000_100 - case CLZW: - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/CLZ--Count-Leading-Zeros-?lang=en - sf, opcode = 0b0, 0b000_100 - case RBIT: - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/RBIT--Reverse-Bits-?lang=en - sf, opcode = 0b1, 0b000_000 - case RBITW: - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/RBIT--Reverse-Bits-?lang=en - sf, opcode = 0b0, 0b000_000 - } - if inst == CLZ { - sf = 1 - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - opcode<<2|(srcRegBits>>3), - 0b110_00000, - (sf<<7)|0b0_1011010, - ) - case CSET: - if !isConditionalRegister(n.srcReg) { - return fmt.Errorf("CSET requires conditional register but got %s", RegisterName(n.srcReg)) - } - - dstRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - // CSET encodes the conditional bits with its least significant bit inverted. - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/CSET--Conditional-Set--an-alias-of-CSINC-?lang=en - // - // https://developer.arm.com/documentation/den0024/a/CHDEEABE - var conditionalBits byte - switch n.srcReg { - case RegCondEQ: - conditionalBits = 0b0001 - case RegCondNE: - conditionalBits = 0b0000 - case RegCondHS: - conditionalBits = 0b0011 - case RegCondLO: - conditionalBits = 0b0010 - case RegCondMI: - conditionalBits = 0b0101 - case RegCondPL: - conditionalBits = 0b0100 - case RegCondVS: - conditionalBits = 0b0111 - case RegCondVC: - conditionalBits = 0b0110 - case RegCondHI: - conditionalBits = 0b1001 - case RegCondLS: - conditionalBits = 0b1000 - case RegCondGE: - conditionalBits = 0b1011 - case RegCondLT: - conditionalBits = 0b1010 - case RegCondGT: - conditionalBits = 0b1101 - case RegCondLE: - conditionalBits = 0b1100 - case RegCondAL: - conditionalBits = 0b1111 - case RegCondNV: - conditionalBits = 0b1110 - } - - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/CSET--Conditional-Set--an-alias-of-CSINC-?lang=en - buf.Append4Bytes( - 0b111_00000|dstRegBits, - (conditionalBits<<4)|0b0000_0111, - 0b100_11111, - 0b10011010, - ) - - case FABSD, FABSS, FNEGD, FNEGS, FSQRTD, FSQRTS, FCVTSD, FCVTDS, FRINTMD, FRINTMS, - FRINTND, FRINTNS, FRINTPD, FRINTPS, FRINTZD, FRINTZS: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, false, false); err != nil { - return - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en#floatdp1 - var tp, opcode byte - switch inst { - case FABSD: - opcode, tp = 0b000001, 0b01 - case FABSS: - opcode, tp = 0b000001, 0b00 - case FNEGD: - opcode, tp = 0b000010, 0b01 - case FNEGS: - opcode, tp = 0b000010, 0b00 - case FSQRTD: - opcode, tp = 0b000011, 0b01 - case FSQRTS: - opcode, tp = 0b000011, 0b00 - case FCVTSD: - opcode, tp = 0b000101, 0b00 - case FCVTDS: - opcode, tp = 0b000100, 0b01 - case FRINTMD: - opcode, tp = 0b001010, 0b01 - case FRINTMS: - opcode, tp = 0b001010, 0b00 - case FRINTND: - opcode, tp = 0b001000, 0b01 - case FRINTNS: - opcode, tp = 0b001000, 0b00 - case FRINTPD: - opcode, tp = 0b001001, 0b01 - case FRINTPS: - opcode, tp = 0b001001, 0b00 - case FRINTZD: - opcode, tp = 0b001011, 0b01 - case FRINTZS: - opcode, tp = 0b001011, 0b00 - } - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - (opcode<<7)|0b0_10000_00|(srcRegBits>>3), - tp<<6|0b00_1_00000|opcode>>1, - 0b0_00_11110, - ) - - case FADDD, FADDS, FDIVS, FDIVD, FMAXD, FMAXS, FMIND, FMINS, FMULS, FMULD: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, false, false); err != nil { - return - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - // "Floating-point data-processing (2 source)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en#floatdp1 - var tp, opcode byte - switch inst { - case FADDD: - opcode, tp = 0b0010, 0b01 - case FADDS: - opcode, tp = 0b0010, 0b00 - case FDIVD: - opcode, tp = 0b0001, 0b01 - case FDIVS: - opcode, tp = 0b0001, 0b00 - case FMAXD: - opcode, tp = 0b0100, 0b01 - case FMAXS: - opcode, tp = 0b0100, 0b00 - case FMIND: - opcode, tp = 0b0101, 0b01 - case FMINS: - opcode, tp = 0b0101, 0b00 - case FMULS: - opcode, tp = 0b0000, 0b00 - case FMULD: - opcode, tp = 0b0000, 0b01 - } - - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - opcode<<4|0b0000_10_00|(dstRegBits>>3), - tp<<6|0b00_1_00000|srcRegBits, - 0b0001_1110, - ) - - case FCVTZSD, FCVTZSDW, FCVTZSS, FCVTZSSW, FCVTZUD, FCVTZUDW, FCVTZUS, FCVTZUSW: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, false, true); err != nil { - return - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - // "Conversion between floating-point and integer" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en#floatdp1 - var sf, tp, opcode byte - switch inst { - case FCVTZSD: // Double to signed 64-bit - sf, tp, opcode = 0b1, 0b01, 0b000 - case FCVTZSDW: // Double to signed 32-bit. - sf, tp, opcode = 0b0, 0b01, 0b000 - case FCVTZSS: // Single to signed 64-bit. - sf, tp, opcode = 0b1, 0b00, 0b000 - case FCVTZSSW: // Single to signed 32-bit. - sf, tp, opcode = 0b0, 0b00, 0b000 - case FCVTZUD: // Double to unsigned 64-bit. - sf, tp, opcode = 0b1, 0b01, 0b001 - case FCVTZUDW: // Double to unsigned 32-bit. - sf, tp, opcode = 0b0, 0b01, 0b001 - case FCVTZUS: // Single to unsigned 64-bit. - sf, tp, opcode = 0b1, 0b00, 0b001 - case FCVTZUSW: // Single to unsigned 32-bit. - sf, tp, opcode = 0b0, 0b00, 0b001 - } - - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - 0|(srcRegBits>>3), - tp<<6|0b00_1_11_000|opcode, - sf<<7|0b0_0_0_11110, - ) - - case FMOVD, FMOVS: - isSrcInt, isDstInt := isIntRegister(n.srcReg), isIntRegister(n.dstReg) - if isSrcInt && isDstInt { - return errors.New("FMOV needs at least one of operands to be integer") - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMOV--register---Floating-point-Move-register-without-conversion-?lang=en - if !isSrcInt && !isDstInt { // Float to float. - var tp byte - if inst == FMOVD { - tp = 0b01 - } - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - 0b0_10000_00|(srcRegBits>>3), - tp<<6|0b00_1_00000, - 0b000_11110, - ) - } else if isSrcInt && !isDstInt { // Int to float. - var tp, sf byte - if inst == FMOVD { - tp, sf = 0b01, 0b1 - } - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - srcRegBits>>3, - tp<<6|0b00_1_00_111, - sf<<7|0b0_00_11110, - ) - } else { // Float to int. - var tp, sf byte - if inst == FMOVD { - tp, sf = 0b01, 0b1 - } - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - srcRegBits>>3, - tp<<6|0b00_1_00_110, - sf<<7|0b0_00_11110, - ) - } - - case MOVD, MOVW: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - if n.srcReg == RegSP || n.dstReg == RegSP { - // Moving between stack pointers. - // https://developer.arm.com/documentation/ddi0602/2021-12/Base-Instructions/MOV--to-from-SP---Move-between-register-and-stack-pointer--an-alias-of-ADD--immediate-- - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - srcRegBits>>3, - 0x0, - 0b1001_0001, - ) - return - } - - if n.srcReg == RegRZR && inst == MOVD { - // If this is 64-bit mov from zero register, then we encode this as MOVK. - // See "Move wide (immediate)" in - // https://developer.arm.com/documentation/ddi0602/2021-06/Index-by-Encoding/Data-Processing----Immediate - buf.Append4Bytes( - dstRegBits, - 0x0, - 0b1000_0000, - 0b1_10_10010, - ) - } else { - // MOV can be encoded as ORR (shifted register): "ORR Wd, WZR, Wm". - // https://developer.arm.com/documentation/100069/0609/A64-General-Instructions/MOV--register- - var sf byte - if inst == MOVD { - sf = 0b1 - } - buf.Append4Bytes( - (zeroRegisterBits<<5)|dstRegBits, - zeroRegisterBits>>3, - 0b000_00000|srcRegBits, - sf<<7|0b0_01_01010, - ) - } - - case MRS: - if n.srcReg != RegFPSR { - return fmt.Errorf("MRS has only support for FPSR register as a src but got %s", RegisterName(n.srcReg)) - } - - // For how to specify FPSR register, see "Accessing FPSR" in: - // https://developer.arm.com/documentation/ddi0595/2021-12/AArch64-Registers/FPSR--Floating-point-Status-Register?lang=en - dstRegBits := registerBits(n.dstReg) - buf.Append4Bytes( - 0b001<<5|dstRegBits, - 0b0100<<4|0b0100, - 0b0011_0000|0b11<<3|0b011, - 0b1101_0101, - ) - - case MSR: - if n.dstReg != RegFPSR { - return fmt.Errorf("MSR has only support for FPSR register as a dst but got %s", RegisterName(n.srcReg)) - } - - // For how to specify FPSR register, see "Accessing FPSR" in: - // https://developer.arm.com/documentation/ddi0595/2021-12/AArch64-Registers/FPSR--Floating-point-Status-Register?lang=en - srcRegBits := registerBits(n.srcReg) - buf.Append4Bytes( - 0b001<<5|srcRegBits, - 0b0100<<4|0b0100, - 0b0001_0000|0b11<<3|0b011, - 0b1101_0101, - ) - - case MUL, MULW: - // Multiplications are encoded as MADD (zero register, src, dst), dst = zero + (src * dst) = src * dst. - // See "Data-processing (3 source)" in - // https://developer.arm.com/documentation/ddi0602/2021-06/Index-by-Encoding/Data-Processing----Register?lang=en - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - var sf byte - if inst == MUL { - sf = 0b1 - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - buf.Append4Bytes( - dstRegBits<<5|dstRegBits, - zeroRegisterBits<<2|dstRegBits>>3, - srcRegBits, - sf<<7|0b11011, - ) - - case NEG, NEGW: - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - // NEG is encoded as "SUB dst, XZR, src" = "dst = 0 - src" - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en#addsub_shift - var sf byte - if inst == NEG { - sf = 0b1 - } - - buf.Append4Bytes( - (zeroRegisterBits<<5)|dstRegBits, - zeroRegisterBits>>3, - srcRegBits, - sf<<7|0b0_10_00000|0b0_00_01011, - ) - - case SDIV, SDIVW, UDIV, UDIVW: - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - // See "Data-processing (2 source)" in - // https://developer.arm.com/documentation/ddi0602/2021-06/Index-by-Encoding/Data-Processing----Register?lang=en - var sf, opcode byte - switch inst { - case SDIV: - sf, opcode = 0b1, 0b000011 - case SDIVW: - sf, opcode = 0b0, 0b000011 - case UDIV: - sf, opcode = 0b1, 0b000010 - case UDIVW: - sf, opcode = 0b0, 0b000010 - } - - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - opcode<<2|(dstRegBits>>3), - 0b110_00000|srcRegBits, - sf<<7|0b0_00_11010, - ) - - case SCVTFD, SCVTFWD, SCVTFS, SCVTFWS, UCVTFD, UCVTFS, UCVTFWD, UCVTFWS: - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, false); err != nil { - return - } - - // "Conversion between floating-point and integer" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en#floatdp1 - var sf, tp, opcode byte - switch inst { - case SCVTFD: // 64-bit integer to double - sf, tp, opcode = 0b1, 0b01, 0b010 - case SCVTFWD: // 32-bit integer to double - sf, tp, opcode = 0b0, 0b01, 0b010 - case SCVTFS: // 64-bit integer to single - sf, tp, opcode = 0b1, 0b00, 0b010 - case SCVTFWS: // 32-bit integer to single - sf, tp, opcode = 0b0, 0b00, 0b010 - case UCVTFD: // 64-bit to double - sf, tp, opcode = 0b1, 0b01, 0b011 - case UCVTFWD: // 32-bit to double - sf, tp, opcode = 0b0, 0b01, 0b011 - case UCVTFS: // 64-bit to single - sf, tp, opcode = 0b1, 0b00, 0b011 - case UCVTFWS: // 32-bit to single - sf, tp, opcode = 0b0, 0b00, 0b011 - } - - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - srcRegBits>>3, - tp<<6|0b00_1_00_000|opcode, - sf<<7|0b0_0_0_11110, - ) - - case SXTB, SXTBW, SXTH, SXTHW, SXTW: - if err = checkRegisterToRegisterType(n.srcReg, n.dstReg, true, true); err != nil { - return - } - - srcRegBits, dstRegBits := registerBits(n.srcReg), registerBits(n.dstReg) - if n.srcReg == RegRZR { - // If the source is zero register, we encode as MOV dst, zero. - var sf byte - if inst == MOVD { - sf = 0b1 - } - buf.Append4Bytes( - (zeroRegisterBits<<5)|dstRegBits, - zeroRegisterBits>>3, - 0b000_00000|srcRegBits, - sf<<7|0b0_01_01010, - ) - return - } - - // SXTB is encoded as "SBFM Wd, Wn, #0, #7" - // https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/SXTB - // SXTH is encoded as "SBFM Wd, Wn, #0, #15" - // https://developer.arm.com/documentation/dui0801/g/A64-General-Instructions/SXTH - // SXTW is encoded as "SBFM Xd, Xn, #0, #31" - // https://developer.arm.com/documentation/dui0802/b/A64-General-Instructions/SXTW - - var n, sf, imms, opc byte - switch inst { - case SXTB: - n, sf, imms = 0b1, 0b1, 0x7 - case SXTBW: - n, sf, imms = 0b0, 0b0, 0x7 - case SXTH: - n, sf, imms = 0b1, 0b1, 0xf - case SXTHW: - n, sf, imms = 0b0, 0b0, 0xf - case SXTW: - n, sf, imms = 0b1, 0b1, 0x1f - } - - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - imms<<2|(srcRegBits>>3), - n<<6, - sf<<7|opc<<5|0b10011, - ) - default: - return errorEncodingUnsupported(n) - } - return -} - -func (a *AssemblerImpl) encodeLeftShiftedRegisterToRegister(buf asm.Buffer, n *nodeImpl) error { - baseRegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - shiftTargetRegBits, err := intRegisterBits(n.srcReg2) - if err != nil { - return err - } - dstRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - switch n.instruction { - case ADD: - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en#addsub_shift - const logicalLeftShiftBits = 0b00 - if n.srcConst < 0 || n.srcConst > 64 { - return fmt.Errorf("shift amount must fit in unsigned 6-bit integer (0-64) but got %d", n.srcConst) - } - shiftByte := byte(n.srcConst) - buf.Append4Bytes( - (baseRegBits<<5)|dstRegBits, - (shiftByte<<2)|(baseRegBits>>3), - (logicalLeftShiftBits<<6)|shiftTargetRegBits, - 0b1000_1011, - ) - return err - default: - return errorEncodingUnsupported(n) - } -} - -func (a *AssemblerImpl) encodeTwoRegistersToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - switch inst := n.instruction; inst { - case AND, ANDW, ORR, ORRW, EOR, EORW: - // See "Logical (shifted register)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en - srcRegBits, srcReg2Bits, dstRegBits := registerBits(n.srcReg), registerBits(n.srcReg2), registerBits(n.dstReg) - var sf, opc byte - switch inst { - case AND: - sf, opc = 0b1, 0b00 - case ANDW: - sf, opc = 0b0, 0b00 - case ORR: - sf, opc = 0b1, 0b01 - case ORRW: - sf, opc = 0b0, 0b01 - case EOR: - sf, opc = 0b1, 0b10 - case EORW: - sf, opc = 0b0, 0b10 - } - buf.Append4Bytes( - (srcReg2Bits<<5)|dstRegBits, - srcReg2Bits>>3, - srcRegBits, - sf<<7|opc<<5|0b01010, - ) - case ASR, ASRW, LSL, LSLW, LSR, LSRW, ROR, RORW: - // See "Data-processing (2 source)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en - srcRegBits, srcReg2Bits, dstRegBits := registerBits(n.srcReg), registerBits(n.srcReg2), registerBits(n.dstReg) - - var sf, opcode byte - switch inst { - case ASR: - sf, opcode = 0b1, 0b001010 - case ASRW: - sf, opcode = 0b0, 0b001010 - case LSL: - sf, opcode = 0b1, 0b001000 - case LSLW: - sf, opcode = 0b0, 0b001000 - case LSR: - sf, opcode = 0b1, 0b001001 - case LSRW: - sf, opcode = 0b0, 0b001001 - case ROR: - sf, opcode = 0b1, 0b001011 - case RORW: - sf, opcode = 0b0, 0b001011 - } - buf.Append4Bytes( - (srcReg2Bits<<5)|dstRegBits, - opcode<<2|(srcReg2Bits>>3), - 0b110_00000|srcRegBits, - sf<<7|0b0_00_11010, - ) - case SDIV, SDIVW, UDIV, UDIVW: - srcRegBits, srcReg2Bits, dstRegBits := registerBits(n.srcReg), registerBits(n.srcReg2), registerBits(n.dstReg) - - // See "Data-processing (2 source)" in - // https://developer.arm.com/documentation/ddi0602/2021-06/Index-by-Encoding/Data-Processing----Register?lang=en - var sf, opcode byte - switch inst { - case SDIV: - sf, opcode = 0b1, 0b000011 - case SDIVW: - sf, opcode = 0b0, 0b000011 - case UDIV: - sf, opcode = 0b1, 0b000010 - case UDIVW: - sf, opcode = 0b0, 0b000010 - } - - buf.Append4Bytes( - (srcReg2Bits<<5)|dstRegBits, - opcode<<2|(srcReg2Bits>>3), - 0b110_00000|srcRegBits, - sf<<7|0b0_00_11010, - ) - case SUB, SUBW: - srcRegBits, srcReg2Bits, dstRegBits := registerBits(n.srcReg), registerBits(n.srcReg2), registerBits(n.dstReg) - - // See "Add/subtract (shifted register)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en - var sf byte - if inst == SUB { - sf = 0b1 - } - - buf.Append4Bytes( - (srcReg2Bits<<5)|dstRegBits, - srcReg2Bits>>3, - srcRegBits, - sf<<7|0b0_10_01011, - ) - case FSUBD, FSUBS: - srcRegBits, srcReg2Bits, dstRegBits := registerBits(n.srcReg), registerBits(n.srcReg2), registerBits(n.dstReg) - - // See "Floating-point data-processing (2 source)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - var tp byte - if inst == FSUBD { - tp = 0b01 - } - buf.Append4Bytes( - (srcReg2Bits<<5)|dstRegBits, - 0b0011_10_00|(srcReg2Bits>>3), - tp<<6|0b00_1_00000|srcRegBits, - 0b0_00_11110, - ) - default: - return errorEncodingUnsupported(n) - } - return -} - -func (a *AssemblerImpl) encodeThreeRegistersToRegister(buf asm.Buffer, n *nodeImpl) error { - switch n.instruction { - case MSUB, MSUBW: - // Dst = Src2 - (Src1 * Src3) - // "Data-processing (3 source)" in: - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en - src1RegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - src2RegBits, err := intRegisterBits(n.srcReg2) - if err != nil { - return err - } - src3RegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - dstRegBits, err := intRegisterBits(n.dstReg2) - if err != nil { - return err - } - - var sf byte // is zero for MSUBW (32-bit MSUB). - if n.instruction == MSUB { - sf = 0b1 - } - - buf.Append4Bytes( - (src3RegBits<<5)|dstRegBits, - 0b1_0000000|(src2RegBits<<2)|(src3RegBits>>3), - src1RegBits, - sf<<7|0b00_11011, - ) - return nil - default: - return errorEncodingUnsupported(n) - } -} - -func (a *AssemblerImpl) encodeTwoRegistersToNone(buf asm.Buffer, n *nodeImpl) error { - switch n.instruction { - case CMPW, CMP: - // Compare on two registers is an alias for "SUBS (src1, src2) ZERO" - // which can be encoded as SUBS (shifted registers) with zero shifting. - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Register?lang=en#addsub_shift - src1RegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - src2RegBits, err := intRegisterBits(n.srcReg2) - if err != nil { - return err - } - - var op byte - if n.instruction == CMP { - op = 0b111 - } else { - op = 0b011 - } - - buf.Append4Bytes( - (src2RegBits<<5)|zeroRegisterBits, - src2RegBits>>3, - src1RegBits, - 0b01011|(op<<5), - ) - return nil - case FCMPS, FCMPD: - // "Floating-point compare" section in: - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - src1RegBits, err := vectorRegisterBits(n.srcReg) - if err != nil { - return err - } - src2RegBits, err := vectorRegisterBits(n.srcReg2) - if err != nil { - return err - } - - var ftype byte // is zero for FCMPS (single precision float compare). - if n.instruction == FCMPD { - ftype = 0b01 - } - buf.Append4Bytes( - src2RegBits<<5, - 0b001000_00|(src2RegBits>>3), - ftype<<6|0b1_00000|src1RegBits, - 0b000_11110, - ) - return nil - default: - return errorEncodingUnsupported(n) - } -} - -func (a *AssemblerImpl) encodeRegisterAndConstToNone(buf asm.Buffer, n *nodeImpl) error { - if n.instruction != CMP { - return errorEncodingUnsupported(n) - } - - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/CMP--immediate---Compare--immediate---an-alias-of-SUBS--immediate--?lang=en - if n.srcConst < 0 || n.srcConst > 4095 { - return fmt.Errorf("immediate for CMP must fit in 0 to 4095 but got %d", n.srcConst) - } else if n.srcReg == RegRZR { - return errors.New("zero register is not supported for CMP (immediate)") - } - - srcRegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - - buf.Append4Bytes( - (srcRegBits<<5)|zeroRegisterBits, - (byte(n.srcConst)<<2)|(srcRegBits>>3), - byte(n.srcConst>>6), - 0b111_10001, - ) - return nil -} - -func fitInSigned9Bits(v int64) bool { - return v >= -256 && v <= 255 -} - -func (a *AssemblerImpl) encodeLoadOrStoreWithRegisterOffset( - buf asm.Buffer, baseRegBits, offsetRegBits, targetRegBits byte, opcode, size, v byte, -) { - // See "Load/store register (register offset)". - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldst_regoff - buf.Append4Bytes( - (baseRegBits<<5)|targetRegBits, - 0b011_010_00|(baseRegBits>>3), - opcode<<6|0b00_1_00000|offsetRegBits, - size<<6|v<<2|0b00_111_0_00, - ) -} - -// validateMemoryOffset validates the memory offset if the given offset can be encoded in the assembler. -// In theory, offset can be any, but for simplicity of our homemade assembler, we limit the offset range -// that can be encoded enough for supporting compiler. -func validateMemoryOffset(offset int64) error { - if offset > 255 && offset%4 != 0 { - // This is because we only have large offsets for load/store with Wasm value stack or reading type IDs, and its offset - // is always multiplied by 4 or 8 (== the size of uint32 or uint64 == the type of wasm.FunctionTypeID or value stack in Go) - return fmt.Errorf("large memory offset (>255) must be a multiple of 4 but got %d", offset) - } else if offset < -256 { // 9-bit signed integer's minimum = 2^8. - return fmt.Errorf("negative memory offset must be larget than or equal -256 but got %d", offset) - } else if offset > 1<<31-1 { - return fmt.Errorf("large memory offset must be less than %d but got %d", 1<<31-1, offset) - } else { - return nil - } -} - -// encodeLoadOrStoreWithConstOffset encodes load/store instructions with the constant offset. -// -// Note: Encoding strategy intentionally matches the Go assembler: https://go.dev/doc/asm -func (a *AssemblerImpl) encodeLoadOrStoreWithConstOffset( - buf asm.Buffer, - baseRegBits, targetRegBits byte, - offset int64, - opcode, size, v byte, - datasize, datasizeLog2 int64, -) (err error) { - if err = validateMemoryOffset(offset); err != nil { - return - } - - if fitInSigned9Bits(offset) { - // See "LDAPR/STLR (unscaled immediate)" - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldapstl_unscaled - if offset < 0 || offset%datasize != 0 { - // This case is encoded as one "unscaled signed store". - buf.Append4Bytes( - (baseRegBits<<5)|targetRegBits, - byte(offset<<4)|(baseRegBits>>3), - opcode<<6|(0b00_00_11111&byte(offset>>4)), - size<<6|v<<2|0b00_1_11_0_00, - ) - return - } - } - - // At this point we have the assumption that offset is positive. - // Plus if it is a multiple of datasize, then it can be encoded as a single "unsigned immediate". - if offset%datasize == 0 && - offset < (1<<12)<>3), - opcode<<6|0b00_111111&byte(m>>6), - size<<6|v<<2|0b00_1_11_0_01, - ) - return - } - - // Otherwise, we need multiple instructions. - tmpRegBits := registerBits(a.temporaryRegister) - offset32 := int32(offset) - - // Go's assembler adds a const into the const pool at this point, - // regardless of its usage; e.g. if we enter the then block of the following if statement, - // the const is not used but it is added into the const pool. - c := asm.NewStaticConst(make([]byte, 4)) - binary.LittleEndian.PutUint32(c.Raw, uint32(offset)) - a.pool.AddConst(c, uint64(buf.Len())) - - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L3529-L3532 - // If the offset is within 24-bits, we can load it with two ADD instructions. - hi := offset32 - (offset32 & (0xfff << uint(datasizeLog2))) - if hi&^0xfff000 == 0 { - var sfops byte = 0b100 - m := ((offset32 - hi) >> datasizeLog2) & 0xfff - hi >>= 12 - - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L3534-L3535 - buf.Append4Bytes( - (baseRegBits<<5)|tmpRegBits, - (byte(hi)<<2)|(baseRegBits>>3), - 0b01<<6 /* shift by 12 */ |byte(hi>>6), - sfops<<5|0b10001, - ) - - buf.Append4Bytes( - (tmpRegBits<<5)|targetRegBits, - (byte(m<<2))|(tmpRegBits>>3), - opcode<<6|0b00_111111&byte(m>>6), - size<<6|v<<2|0b00_1_11_0_01, - ) - } else { - // This case we load the const via ldr(literal) into tem register, - // and the target const is placed after this instruction below. - loadLiteralOffsetInBinary := uint64(buf.Len()) - - // First we emit the ldr(literal) with offset zero as we don't yet know the const's placement in the binary. - // https://developer.arm.com/documentation/ddi0596/2020-12/Base-Instructions/LDR--literal---Load-Register--literal-- - buf.Append4Bytes(tmpRegBits, 0x0, 0x0, 0b00_011_0_00) - - // Set the callback for the constant, and we set properly the offset in the callback. - - c.AddOffsetFinalizedCallback(func(offsetOfConst uint64) { - // ldr(literal) encodes offset divided by 4. - offset := (int(offsetOfConst) - int(loadLiteralOffsetInBinary)) / 4 - bin := buf.Bytes() - bin[loadLiteralOffsetInBinary] |= byte(offset << 5) - bin[loadLiteralOffsetInBinary+1] |= byte(offset >> 3) - bin[loadLiteralOffsetInBinary+2] |= byte(offset >> 11) - }) - - // Then, load the constant with the register offset. - // https://developer.arm.com/documentation/ddi0596/2020-12/Base-Instructions/LDR--register---Load-Register--register-- - buf.Append4Bytes( - (baseRegBits<<5)|targetRegBits, - 0b011_010_00|(baseRegBits>>3), - opcode<<6|0b00_1_00000|tmpRegBits, - size<<6|v<<2|0b00_111_0_00, - ) - } - return -} - -func (a *AssemblerImpl) encodeRegisterToMemory(buf asm.Buffer, n *nodeImpl) (err error) { - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldst_regoff - var ( - size, v byte - datasize, datasizeLog2 int64 - isTargetFloat bool - ) - switch n.instruction { - case STRD: - size, v, datasize, datasizeLog2 = 0b11, 0x0, 8, 3 - case STRW: - size, v, datasize, datasizeLog2 = 0b10, 0x0, 4, 2 - case STRH: - size, v, datasize, datasizeLog2 = 0b01, 0x0, 2, 1 - case STRB: - size, v, datasize, datasizeLog2 = 0b00, 0x0, 1, 0 - case FSTRD: - size, v, datasize, datasizeLog2, isTargetFloat = 0b11, 0x1, 8, 3, true - case FSTRS: - size, v, datasize, datasizeLog2, isTargetFloat = 0b10, 0x1, 4, 2, true - default: - return errorEncodingUnsupported(n) - } - - var srcRegBits byte - if isTargetFloat { - srcRegBits, err = vectorRegisterBits(n.srcReg) - } else { - srcRegBits, err = intRegisterBits(n.srcReg) - } - if err != nil { - return - } - - baseRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - const opcode = 0x00 // opcode for store instructions. - if n.dstReg2 != asm.NilRegister { - offsetRegBits, err := intRegisterBits(n.dstReg2) - if err != nil { - return err - } - a.encodeLoadOrStoreWithRegisterOffset(buf, baseRegBits, offsetRegBits, srcRegBits, opcode, size, v) - } else { - err = a.encodeLoadOrStoreWithConstOffset(buf, baseRegBits, srcRegBits, n.dstConst, opcode, size, v, datasize, datasizeLog2) - } - return -} - -func (a *AssemblerImpl) encodeADR(buf asm.Buffer, n *nodeImpl) (err error) { - dstRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - adrInstructionOffsetInBinary := uint64(buf.Len()) - - // At this point, we don't yet know the target offset to read from, - // so we emit the ADR instruction with 0 offset, and replace later in the callback. - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/ADR--Form-PC-relative-address-?lang=en - buf.Append4Bytes(dstRegBits, 0x0, 0x0, 0b10000) - - // This case, the ADR's target offset is for the staticConst's initial address. - if sc := n.staticConst; sc != nil { - a.pool.AddConst(sc, adrInstructionOffsetInBinary) - sc.AddOffsetFinalizedCallback(func(offsetOfConst uint64) { - adrInstructionBytes := buf.Bytes()[adrInstructionOffsetInBinary : adrInstructionOffsetInBinary+4] - offset := int(offsetOfConst) - int(adrInstructionOffsetInBinary) - - // See https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/ADR--Form-PC-relative-address-?lang=en - adrInstructionBytes[3] |= byte(offset & 0b00000011 << 5) - offset >>= 2 - adrInstructionBytes[0] |= byte(offset << 5) - offset >>= 3 - adrInstructionBytes[1] |= byte(offset) - offset >>= 8 - adrInstructionBytes[2] |= byte(offset) - }) - return - } else { - a.adrInstructionNodes = append(a.adrInstructionNodes, n) - } - return -} - -func (a *AssemblerImpl) finalizeADRInstructionNode(code []byte, n *nodeImpl) (err error) { - // Find the target instruction node. - targetNode := n - for ; targetNode != nil; targetNode = targetNode.next { - if targetNode.instruction == n.readInstructionAddressBeforeTargetInstruction { - targetNode = targetNode.next - break - } - } - - if targetNode == nil { - return fmt.Errorf("BUG: target instruction %s not found for ADR", InstructionName(n.readInstructionAddressBeforeTargetInstruction)) - } - - offset := targetNode.OffsetInBinary() - n.OffsetInBinary() - if i64 := int64(offset); i64 >= 1<<20 || i64 < -1<<20 { - // We could support offset over 20-bit range by special casing them here, - // but 20-bit range should be enough for our impl. If the necessity comes up, - // we could add the special casing here to support arbitrary large offset. - return fmt.Errorf("BUG: too large offset for ADR: %#x", offset) - } - - adrInstructionBytes := code[n.OffsetInBinary() : n.OffsetInBinary()+4] - // According to the binary format of ADR instruction: - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/ADR--Form-PC-relative-address-?lang=en - adrInstructionBytes[3] |= byte(offset & 0b00000011 << 5) - offset >>= 2 - adrInstructionBytes[0] |= byte(offset << 5) - offset >>= 3 - adrInstructionBytes[1] |= byte(offset) - offset >>= 8 - adrInstructionBytes[2] |= byte(offset) - return nil -} - -func (a *AssemblerImpl) encodeMemoryToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldst_regoff - var ( - size, v, opcode byte - datasize, datasizeLog2 int64 - isTargetFloat bool - ) - switch n.instruction { - case ADR: - return a.encodeADR(buf, n) - case FLDRD: - size, v, datasize, datasizeLog2, opcode, isTargetFloat = 0b11, 0x1, 8, 3, 0b01, true - case FLDRS: - size, v, datasize, datasizeLog2, opcode, isTargetFloat = 0b10, 0x1, 4, 2, 0b01, true - case LDRD: - size, v, datasize, datasizeLog2, opcode = 0b11, 0x0, 8, 3, 0b01 - case LDRW: - size, v, datasize, datasizeLog2, opcode = 0b10, 0x0, 4, 2, 0b01 - case LDRSHD: - size, v, datasize, datasizeLog2, opcode = 0b01, 0x0, 2, 1, 0b10 - case LDRSHW: - size, v, datasize, datasizeLog2, opcode = 0b01, 0x0, 2, 1, 0b11 - case LDRH: - size, v, datasize, datasizeLog2, opcode = 0b01, 0x0, 2, 1, 0b01 - case LDRSBD: - size, v, datasize, datasizeLog2, opcode = 0b00, 0x0, 1, 0, 0b10 - case LDRSBW: - size, v, datasize, datasizeLog2, opcode = 0b00, 0x0, 1, 0, 0b11 - case LDRB: - size, v, datasize, datasizeLog2, opcode = 0b00, 0x0, 1, 0, 0b01 - case LDRSW: - size, v, datasize, datasizeLog2, opcode = 0b10, 0x0, 4, 2, 0b10 - default: - return errorEncodingUnsupported(n) - } - - var dstRegBits byte - if isTargetFloat { - dstRegBits, err = vectorRegisterBits(n.dstReg) - } else { - dstRegBits, err = intRegisterBits(n.dstReg) - } - if err != nil { - return - } - baseRegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - - if n.srcReg2 != asm.NilRegister { - offsetRegBits, err := intRegisterBits(n.srcReg2) - if err != nil { - return err - } - a.encodeLoadOrStoreWithRegisterOffset(buf, baseRegBits, offsetRegBits, dstRegBits, opcode, - size, v) - } else { - err = a.encodeLoadOrStoreWithConstOffset(buf, baseRegBits, dstRegBits, n.srcConst, opcode, - size, v, datasize, datasizeLog2) - } - return -} - -// const16bitAligned check if the value is on the 16-bit alignment. -// If so, returns the shift num divided by 16, and otherwise -1. -func const16bitAligned(v int64) (ret int) { - ret = -1 - for s := 0; s < 64; s += 16 { - if (uint64(v) &^ (uint64(0xffff) << uint(s))) == 0 { - ret = s / 16 - break - } - } - return -} - -// isBitMaskImmediate determines if the value can be encoded as "bitmask immediate". -// -// Such an immediate is a 32-bit or 64-bit pattern viewed as a vector of identical elements of size e = 2, 4, 8, 16, 32, or 64 bits. -// Each element contains the same sub-pattern: a single run of 1 to e-1 non-zero bits, rotated by 0 to e-1 bits. -// -// See https://developer.arm.com/documentation/dui0802/b/A64-General-Instructions/MOV--bitmask-immediate- -func isBitMaskImmediate(x uint64) bool { - // All zeros and ones are not "bitmask immediate" by defainition. - if x == 0 || x == 0xffff_ffff_ffff_ffff { - return false - } - - switch { - case x != x>>32|x<<32: - // e = 64 - case x != x>>16|x<<48: - // e = 32 (x == x>>32|x<<32). - // e.g. 0x00ff_ff00_00ff_ff00 - x = uint64(int32(x)) - case x != x>>8|x<<56: - // e = 16 (x == x>>16|x<<48). - // e.g. 0x00ff_00ff_00ff_00ff - x = uint64(int16(x)) - case x != x>>4|x<<60: - // e = 8 (x == x>>8|x<<56). - // e.g. 0x0f0f_0f0f_0f0f_0f0f - x = uint64(int8(x)) - default: - // e = 4 or 2. - return true - } - return sequenceOfSetbits(x) || sequenceOfSetbits(^x) -} - -// sequenceOfSetbits returns true if the number's binary representation is the sequence set bit (1). -// For example: 0b1110 -> true, 0b1010 -> false -func sequenceOfSetbits(x uint64) bool { - y := getLowestBit(x) - // If x is a sequence of set bit, this should results in the number - // with only one set bit (i.e. power of two). - y += x - return (y-1)&y == 0 -} - -func getLowestBit(x uint64) uint64 { - // See https://stackoverflow.com/questions/12247186/find-the-lowest-set-bit - return x & (^x + 1) -} - -func (a *AssemblerImpl) addOrSub64BitRegisters(buf asm.Buffer, sfops byte, sp bool, dstRegBits, src1RegBits, src2RegBits byte) { - // src1Reg = src1Reg +/- src2Reg - if sp { - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/ADD--extended-register---Add--extended-register--?lang=en - buf.Append4Bytes( - (src1RegBits<<5)|dstRegBits, - 0b011<<5|src1RegBits>>3, - 1<<5|src2RegBits, - sfops<<5|0b01011, - ) - } else { - buf.Append4Bytes( - (src1RegBits<<5)|dstRegBits, - src1RegBits>>3, - src2RegBits, - sfops<<5|0b01011, - ) - } -} - -func bitmaskImmediate(c uint64, is64bit bool) (immr, imms, N byte) { - var size uint32 - switch { - case c != c>>32|c<<32: - size = 64 - case c != c>>16|c<<48: - size = 32 - c = uint64(int32(c)) - case c != c>>8|c<<56: - size = 16 - c = uint64(int16(c)) - case c != c>>4|c<<60: - size = 8 - c = uint64(int8(c)) - case c != c>>2|c<<62: - size = 4 - c = uint64(int64(c<<60) >> 60) - default: - size = 2 - c = uint64(int64(c<<62) >> 62) - } - - neg := false - if int64(c) < 0 { - c = ^c - neg = true - } - - onesSize, nonZeroPos := getOnesSequenceSize(c) - if neg { - nonZeroPos = onesSize + nonZeroPos - onesSize = size - onesSize - } - - var mode byte = 32 - if is64bit { - N, mode = 0b1, 64 - } - - immr = byte((size - nonZeroPos) & (size - 1) & uint32(mode-1)) - imms = byte((onesSize - 1) | 63&^(size<<1-1)) - return -} - -func (a *AssemblerImpl) encodeConstToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - // Alias for readability. - c := n.srcConst - - dstRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - // See "Logical (immediate)" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Immediate - switch n.instruction { - case ANDIMM32: - var sf, opc byte = 0b0, 0b00 - if !isBitMaskImmediate(uint64(c)) { - err = fmt.Errorf("const %d must be valid bitmask immediate for %s", c, InstructionName(ANDIMM64)) - return - } - immr, imms, N := bitmaskImmediate(uint64(c), false) - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - imms<<2|dstRegBits>>3, - N<<6|immr, - sf<<7|opc<<5|0b10010, - ) - return - case ANDIMM64: - var sf, opc byte = 0b1, 0b00 - if !isBitMaskImmediate(uint64(c)) { - err = fmt.Errorf("const %d must be valid bitmask immediate for %s", c, InstructionName(ANDIMM64)) - return - } - immr, imms, N := bitmaskImmediate(uint64(c), true) - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - imms<<2|dstRegBits>>3, - N<<6|immr, - sf<<7|opc<<5|0b10010, - ) - return - } - - switch inst := n.instruction; inst { - case ADD, ADDS, SUB, SUBS: - srcRegBits := dstRegBits - if n.srcReg != asm.NilRegister { - srcRegBits, err = intRegisterBits(n.srcReg) - if err != nil { - return err - } - } - - var sfops byte - if inst == ADD { - sfops = 0b100 - } else if inst == ADDS { - sfops = 0b101 - } else if inst == SUB { - sfops = 0b110 - } else if inst == SUBS { - sfops = 0b111 - } - - isSP := n.srcReg == RegSP || n.dstReg == RegSP - if c == 0 { - // If the constant equals zero, we encode it as ADD (register) with zero register. - a.addOrSub64BitRegisters(buf, sfops, isSP, dstRegBits, srcRegBits, zeroRegisterBits) - return - } - - if c >= 0 && (c <= 0xfff || (c&0xfff) == 0 && (uint64(c>>12) <= 0xfff)) { - // If the const can be represented as "imm12" or "imm12 << 12": one instruction - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L2992 - - if c <= 0xfff { - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - (byte(c)<<2)|(srcRegBits>>3), - byte(c>>6), - sfops<<5|0b10001, - ) - } else { - c >>= 12 - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - (byte(c)<<2)|(srcRegBits>>3), - 0b01<<6 /* shift by 12 */ |byte(c>>6), - sfops<<5|0b10001, - ) - } - return - } - - if t := const16bitAligned(c); t >= 0 { - // If the const can fit within 16-bit alignment, for example, 0xffff, 0xffff_0000 or 0xffff_0000_0000_0000 - // We could load it into temporary with movk. - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L4029 - tmpRegBits := registerBits(a.temporaryRegister) - - // MOVZ $c, tmpReg with shifting. - a.load16bitAlignedConst(buf, c>>(16*t), byte(t), tmpRegBits, false, true) - - // ADD/SUB tmpReg, dstReg - a.addOrSub64BitRegisters(buf, sfops, isSP, dstRegBits, srcRegBits, tmpRegBits) - return - } else if t := const16bitAligned(^c); t >= 0 { - // Also if the reverse of the const can fit within 16-bit range, do the same ^^. - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L4029 - tmpRegBits := registerBits(a.temporaryRegister) - - // MOVN $c, tmpReg with shifting. - a.load16bitAlignedConst(buf, ^c>>(16*t), byte(t), tmpRegBits, true, true) - - // ADD/SUB tmpReg, dstReg - a.addOrSub64BitRegisters(buf, sfops, isSP, dstRegBits, srcRegBits, tmpRegBits) - return - } - - if uc := uint64(c); isBitMaskImmediate(uc) { - // If the const can be represented as "bitmask immediate", we load it via ORR into temp register. - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L6570-L6583 - tmpRegBits := registerBits(a.temporaryRegister) - // OOR $c, tmpReg - a.loadConstViaBitMaskImmediate(buf, uc, tmpRegBits, true) - - // ADD/SUB tmpReg, dstReg - a.addOrSub64BitRegisters(buf, sfops, isSP, dstRegBits, srcRegBits, tmpRegBits) - return - } - - // If the value fits within 24-bit, then we emit two add instructions - if 0 <= c && c <= 0xffffff && inst != SUBS && inst != ADDS { - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L3849-L3862 - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - (byte(c)<<2)|(dstRegBits>>3), - byte(c&0xfff>>6), - sfops<<5|0b10001, - ) - c = c >> 12 - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - (byte(c)<<2)|(dstRegBits>>3), - 0b01_000000 /* shift by 12 */ |byte(c>>6), - sfops<<5|0b10001, - ) - return - } - - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L3163-L3203 - // Otherwise we use MOVZ and MOVNs for loading const into tmpRegister. - tmpRegBits := registerBits(a.temporaryRegister) - a.load64bitConst(buf, c, tmpRegBits) - a.addOrSub64BitRegisters(buf, sfops, isSP, dstRegBits, srcRegBits, tmpRegBits) - case MOVW: - if c == 0 { - buf.Append4Bytes( - (zeroRegisterBits<<5)|dstRegBits, - zeroRegisterBits>>3, - 0b000_00000|zeroRegisterBits, - 0b0_01_01010, - ) - return - } - - // Following the logic here: - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L1637 - c32 := uint32(c) - ic := int64(c32) - if ic >= 0 && (ic <= 0xfff || (ic&0xfff) == 0 && (uint64(ic>>12) <= 0xfff)) { - if isBitMaskImmediate(uint64(c)) { - a.loadConstViaBitMaskImmediate(buf, uint64(c), dstRegBits, false) - return - } - } - - if t := const16bitAligned(int64(c32)); t >= 0 { - // If the const can fit within 16-bit alignment, for example, 0xffff, 0xffff_0000 or 0xffff_0000_0000_0000 - // We could load it into temporary with movk. - a.load16bitAlignedConst(buf, int64(c32)>>(16*t), byte(t), dstRegBits, false, false) - } else if t := const16bitAligned(int64(^c32)); t >= 0 { - // Also, if the reverse of the const can fit within 16-bit range, do the same ^^. - a.load16bitAlignedConst(buf, int64(^c32)>>(16*t), byte(t), dstRegBits, true, false) - } else if isBitMaskImmediate(uint64(c)) { - a.loadConstViaBitMaskImmediate(buf, uint64(c), dstRegBits, false) - } else { - // Otherwise, we use MOVZ and MOVK to load it. - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L6623-L6630 - c16 := uint16(c32) - // MOVZ: https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - buf.Append4Bytes( - (byte(c16)<<5)|dstRegBits, - byte(c16>>3), - 1<<7|byte(c16>>11), - 0b0_10_10010, - ) - // MOVK: https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVK - c16 = uint16(c32 >> 16) - if c16 != 0 { - buf.Append4Bytes( - (byte(c16)<<5)|dstRegBits, - byte(c16>>3), - 1<<7|0b0_01_00000 /* shift by 16 */ |byte(c16>>11), - 0b0_11_10010, - ) - } - } - case MOVD: - // Following the logic here: - // https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L1798-L1852 - if c >= 0 && (c <= 0xfff || (c&0xfff) == 0 && (uint64(c>>12) <= 0xfff)) { - if isBitMaskImmediate(uint64(c)) { - a.loadConstViaBitMaskImmediate(buf, uint64(c), dstRegBits, true) - return - } - } - - if t := const16bitAligned(c); t >= 0 { - // If the const can fit within 16-bit alignment, for example, 0xffff, 0xffff_0000 or 0xffff_0000_0000_0000 - // We could load it into temporary with movk. - a.load16bitAlignedConst(buf, c>>(16*t), byte(t), dstRegBits, false, true) - } else if t := const16bitAligned(^c); t >= 0 { - // Also, if the reverse of the const can fit within 16-bit range, do the same ^^. - a.load16bitAlignedConst(buf, (^c)>>(16*t), byte(t), dstRegBits, true, true) - } else if isBitMaskImmediate(uint64(c)) { - a.loadConstViaBitMaskImmediate(buf, uint64(c), dstRegBits, true) - } else { - a.load64bitConst(buf, c, dstRegBits) - } - case LSR: - if c == 0 { - err = errors.New("LSR with zero constant should be optimized out") - return - } else if c < 0 || c > 63 { - err = fmt.Errorf("LSR requires immediate to be within 0 to 63, but got %d", c) - return - } - - // LSR(immediate) is an alias of UBFM - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LSR--immediate---Logical-Shift-Right--immediate---an-alias-of-UBFM-?lang=en - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - 0b111111_00|dstRegBits>>3, - 0b01_000000|byte(c), - 0b110_10011, - ) - case LSL: - if c == 0 { - err = errors.New("LSL with zero constant should be optimized out") - return - } else if c < 0 || c > 63 { - err = fmt.Errorf("LSL requires immediate to be within 0 to 63, but got %d", c) - return - } - - // LSL(immediate) is an alias of UBFM - // https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/LSL--immediate---Logical-Shift-Left--immediate---an-alias-of-UBFM- - cb := byte(c) - buf.Append4Bytes( - (dstRegBits<<5)|dstRegBits, - (0b111111-cb)<<2|dstRegBits>>3, - 0b01_000000|(64-cb), - 0b110_10011, - ) - - default: - return errorEncodingUnsupported(n) - } - return -} - -func (a *AssemblerImpl) movk(buf asm.Buffer, v uint64, shfitNum int, dstRegBits byte) { - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVK - buf.Append4Bytes( - (byte(v)<<5)|dstRegBits, - byte(v>>3), - 1<<7|byte(shfitNum)<<5|(0b000_11111&byte(v>>11)), - 0b1_11_10010, - ) -} - -func (a *AssemblerImpl) movz(buf asm.Buffer, v uint64, shfitNum int, dstRegBits byte) { - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - buf.Append4Bytes( - (byte(v)<<5)|dstRegBits, - byte(v>>3), - 1<<7|byte(shfitNum)<<5|(0b000_11111&byte(v>>11)), - 0b1_10_10010, - ) -} - -func (a *AssemblerImpl) movn(buf asm.Buffer, v uint64, shfitNum int, dstRegBits byte) { - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - buf.Append4Bytes( - (byte(v)<<5)|dstRegBits, - byte(v>>3), - 1<<7|byte(shfitNum)<<5|(0b000_11111&byte(v>>11)), - 0b1_00_10010, - ) -} - -// load64bitConst loads a 64-bit constant into the register, following the same logic to decide how to load large 64-bit -// consts as in the Go assembler. -// -// See https://github.com/golang/go/blob/release-branch.go1.15/src/cmd/internal/obj/arm64/asm7.go#L6632-L6759 -func (a *AssemblerImpl) load64bitConst(buf asm.Buffer, c int64, dstRegBits byte) { - var bits [4]uint64 - var zeros, negs int - for i := 0; i < 4; i++ { - bits[i] = uint64((c >> uint(i*16)) & 0xffff) - if v := bits[i]; v == 0 { - zeros++ - } else if v == 0xffff { - negs++ - } - } - - if zeros == 3 { - // one MOVZ instruction. - for i, v := range bits { - if v != 0 { - a.movz(buf, v, i, dstRegBits) - } - } - } else if negs == 3 { - // one MOVN instruction. - for i, v := range bits { - if v != 0xffff { - v = ^v - a.movn(buf, v, i, dstRegBits) - } - } - } else if zeros == 2 { - // one MOVZ then one OVK. - var movz bool - for i, v := range bits { - if !movz && v != 0 { // MOVZ. - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - a.movz(buf, v, i, dstRegBits) - movz = true - } else if v != 0 { - a.movk(buf, v, i, dstRegBits) - } - } - - } else if negs == 2 { - // one MOVN then one or two MOVK. - var movn bool - for i, v := range bits { // Emit MOVN. - if !movn && v != 0xffff { - v = ^v - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVN - a.movn(buf, v, i, dstRegBits) - movn = true - } else if v != 0xffff { - a.movk(buf, v, i, dstRegBits) - } - } - - } else if zeros == 1 { - // one MOVZ then two MOVK. - var movz bool - for i, v := range bits { - if !movz && v != 0 { // MOVZ. - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - a.movz(buf, v, i, dstRegBits) - movz = true - } else if v != 0 { - a.movk(buf, v, i, dstRegBits) - } - } - - } else if negs == 1 { - // one MOVN then two MOVK. - var movn bool - for i, v := range bits { // Emit MOVN. - if !movn && v != 0xffff { - v = ^v - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVN - a.movn(buf, v, i, dstRegBits) - movn = true - } else if v != 0xffff { - a.movk(buf, v, i, dstRegBits) - } - } - - } else { - // one MOVZ then tree MOVK. - var movz bool - for i, v := range bits { - if !movz && v != 0 { // MOVZ. - // https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - a.movz(buf, v, i, dstRegBits) - movz = true - } else if v != 0 { - a.movk(buf, v, i, dstRegBits) - } - } - - } -} - -func (a *AssemblerImpl) load16bitAlignedConst(buf asm.Buffer, c int64, shiftNum byte, regBits byte, reverse bool, dst64bit bool) { - var lastByte byte - if reverse { - // MOVN: https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVZ - lastByte = 0b0_00_10010 - } else { - // MOVZ: https://developer.arm.com/documentation/dui0802/a/A64-General-Instructions/MOVN - lastByte = 0b0_10_10010 - } - if dst64bit { - lastByte |= 0b1 << 7 - } - buf.Append4Bytes( - (byte(c)<<5)|regBits, - byte(c>>3), - 1<<7|(shiftNum<<5)|byte(c>>11), - lastByte, - ) -} - -// loadConstViaBitMaskImmediate loads the constant with ORR (bitmask immediate). -// https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/ORR--immediate---Bitwise-OR--immediate--?lang=en -func (a *AssemblerImpl) loadConstViaBitMaskImmediate(buf asm.Buffer, c uint64, regBits byte, dst64bit bool) { - var size uint32 - switch { - case c != c>>32|c<<32: - size = 64 - case c != c>>16|c<<48: - size = 32 - c = uint64(int32(c)) - case c != c>>8|c<<56: - size = 16 - c = uint64(int16(c)) - case c != c>>4|c<<60: - size = 8 - c = uint64(int8(c)) - case c != c>>2|c<<62: - size = 4 - c = uint64(int64(c<<60) >> 60) - default: - size = 2 - c = uint64(int64(c<<62) >> 62) - } - - neg := false - if int64(c) < 0 { - c = ^c - neg = true - } - - onesSize, nonZeroPos := getOnesSequenceSize(c) - if neg { - nonZeroPos = onesSize + nonZeroPos - onesSize = size - onesSize - } - - // See the following article for understanding the encoding. - // https://dinfuehr.github.io/blog/encoding-of-immediate-values-on-aarch64/ - var n byte - mode := 32 - if dst64bit && size == 64 { - n = 0b1 - mode = 64 - } - - r := byte((size - nonZeroPos) & (size - 1) & uint32(mode-1)) - s := byte((onesSize - 1) | 63&^(size<<1-1)) - - var sf byte - if dst64bit { - sf = 0b1 - } - buf.Append4Bytes( - (zeroRegisterBits<<5)|regBits, - s<<2|(zeroRegisterBits>>3), - n<<6|r, - sf<<7|0b0_01_10010, - ) -} - -func getOnesSequenceSize(x uint64) (size, nonZeroPos uint32) { - // Take 0b00111000 for example: - y := getLowestBit(x) // = 0b0000100 - nonZeroPos = setBitPos(y) // = 2 - size = setBitPos(x+y) - nonZeroPos // = setBitPos(0b0100000) - 2 = 5 - 2 = 3 - return -} - -func setBitPos(x uint64) (ret uint32) { - for ; ; ret++ { - if x == 0b1 { - break - } - x = x >> 1 - } - return -} - -func checkArrangementIndexPair(arr VectorArrangement, index VectorIndex) (err error) { - if arr == VectorArrangementNone { - return nil - } - var valid bool - switch arr { - case VectorArrangement8B: - valid = index < 8 - case VectorArrangement16B: - valid = index < 16 - case VectorArrangement4H: - valid = index < 4 - case VectorArrangement8H: - valid = index < 8 - case VectorArrangement2S: - valid = index < 2 - case VectorArrangement4S: - valid = index < 4 - case VectorArrangement1D: - valid = index < 1 - case VectorArrangement2D: - valid = index < 2 - case VectorArrangementB: - valid = index < 16 - case VectorArrangementH: - valid = index < 8 - case VectorArrangementS: - valid = index < 4 - case VectorArrangementD: - valid = index < 2 - } - if !valid { - err = fmt.Errorf("invalid arrangement and index pair: %s[%d]", arr, index) - } - return -} - -func (a *AssemblerImpl) encodeMemoryToVectorRegister(buf asm.Buffer, n *nodeImpl) (err error) { - srcBaseRegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - - dstVectorRegBits, err := vectorRegisterBits(n.dstReg) - if err != nil { - return err - } - - switch n.instruction { - case VMOV: // translated as LDR(immediate,SIMD&FP) - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/LDR--immediate--SIMD-FP---Load-SIMD-FP-Register--immediate-offset--?lang=en - var size, opcode byte - var dataSize, dataSizeLog2 int64 - switch n.vectorArrangement { - case VectorArrangementB: - size, opcode, dataSize, dataSizeLog2 = 0b00, 0b01, 1, 0 - case VectorArrangementH: - size, opcode, dataSize, dataSizeLog2 = 0b01, 0b01, 2, 1 - case VectorArrangementS: - size, opcode, dataSize, dataSizeLog2 = 0b10, 0b01, 4, 2 - case VectorArrangementD: - size, opcode, dataSize, dataSizeLog2 = 0b11, 0b01, 8, 3 - case VectorArrangementQ: - size, opcode, dataSize, dataSizeLog2 = 0b00, 0b11, 16, 4 - } - const v = 1 // v as in https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldst_pos - if n.srcReg2 != asm.NilRegister { - offsetRegBits, err := intRegisterBits(n.srcReg2) - if err != nil { - return err - } - a.encodeLoadOrStoreWithRegisterOffset(buf, srcBaseRegBits, offsetRegBits, dstVectorRegBits, opcode, size, v) - } else { - err = a.encodeLoadOrStoreWithConstOffset(buf, srcBaseRegBits, dstVectorRegBits, - n.srcConst, opcode, size, v, dataSize, dataSizeLog2) - } - case LD1R: - if n.srcReg2 != asm.NilRegister || n.srcConst != 0 { - return fmt.Errorf("offset for %s is not implemented", InstructionName(LD1R)) - } - - var size, q byte - switch n.vectorArrangement { - case VectorArrangement8B: - size, q = 0b00, 0b0 - case VectorArrangement16B: - size, q = 0b00, 0b1 - case VectorArrangement4H: - size, q = 0b01, 0b0 - case VectorArrangement8H: - size, q = 0b01, 0b1 - case VectorArrangement2S: - size, q = 0b10, 0b0 - case VectorArrangement4S: - size, q = 0b10, 0b1 - case VectorArrangement1D: - size, q = 0b11, 0b0 - case VectorArrangement2D: - size, q = 0b11, 0b1 - } - - // No offset encoding. - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/LD1R--Load-one-single-element-structure-and-Replicate-to-all-lanes--of-one-register--?lang=en#iclass_as_post_index - buf.Append4Bytes( - (srcBaseRegBits<<5)|dstVectorRegBits, - 0b11_000000|size<<2|srcBaseRegBits>>3, - 0b01_000000, - q<<6|0b1101, - ) - default: - return errorEncodingUnsupported(n) - } - return -} - -func arrangementSizeQ(arr VectorArrangement) (size, q byte) { - switch arr { - case VectorArrangement8B: - size, q = 0b00, 0 - case VectorArrangement16B: - size, q = 0b00, 1 - case VectorArrangement4H: - size, q = 0b01, 0 - case VectorArrangement8H: - size, q = 0b01, 1 - case VectorArrangement2S: - size, q = 0b10, 0 - case VectorArrangement4S: - size, q = 0b10, 1 - case VectorArrangement1D: - size, q = 0b11, 0 - case VectorArrangement2D: - size, q = 0b11, 1 - } - return -} - -func (a *AssemblerImpl) encodeVectorRegisterToMemory(buf asm.Buffer, n *nodeImpl) (err error) { - srcVectorRegBits, err := vectorRegisterBits(n.srcReg) - if err != nil { - return err - } - - dstBaseRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - switch n.instruction { - case VMOV: // translated as STR(immediate,SIMD&FP) - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/STR--immediate--SIMD-FP---Store-SIMD-FP-register--immediate-offset-- - var size, opcode byte - var dataSize, dataSizeLog2 int64 - switch n.vectorArrangement { - case VectorArrangementB: - size, opcode, dataSize, dataSizeLog2 = 0b00, 0b00, 1, 0 - case VectorArrangementH: - size, opcode, dataSize, dataSizeLog2 = 0b01, 0b00, 2, 1 - case VectorArrangementS: - size, opcode, dataSize, dataSizeLog2 = 0b10, 0b00, 4, 2 - case VectorArrangementD: - size, opcode, dataSize, dataSizeLog2 = 0b11, 0b00, 8, 3 - case VectorArrangementQ: - size, opcode, dataSize, dataSizeLog2 = 0b00, 0b10, 16, 4 - } - const v = 1 // v as in https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Loads-and-Stores?lang=en#ldst_pos - - if n.dstReg2 != asm.NilRegister { - offsetRegBits, err := intRegisterBits(n.dstReg2) - if err != nil { - return err - } - a.encodeLoadOrStoreWithRegisterOffset(buf, dstBaseRegBits, offsetRegBits, srcVectorRegBits, opcode, size, v) - } else { - err = a.encodeLoadOrStoreWithConstOffset(buf, dstBaseRegBits, srcVectorRegBits, - n.dstConst, opcode, size, v, dataSize, dataSizeLog2) - } - default: - return errorEncodingUnsupported(n) - } - return -} - -func (a *AssemblerImpl) encodeStaticConstToVectorRegister(buf asm.Buffer, n *nodeImpl) (err error) { - if n.instruction != VMOV { - return errorEncodingUnsupported(n) - } - - dstRegBits, err := vectorRegisterBits(n.dstReg) - if err != nil { - return err - } - - // LDR (literal, SIMD&FP) - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/LDR--literal--SIMD-FP---Load-SIMD-FP-Register--PC-relative-literal-- - var opc byte - var constLength int - switch n.vectorArrangement { - case VectorArrangementS: - opc, constLength = 0b00, 4 - case VectorArrangementD: - opc, constLength = 0b01, 8 - case VectorArrangementQ: - opc, constLength = 0b10, 16 - } - - loadLiteralOffsetInBinary := uint64(buf.Len()) - a.pool.AddConst(n.staticConst, loadLiteralOffsetInBinary) - - if len(n.staticConst.Raw) != constLength { - return fmt.Errorf("invalid const length for %s: want %d but was %d", - n.vectorArrangement, constLength, len(n.staticConst.Raw)) - } - - buf.Append4Bytes(dstRegBits, 0x0, 0x0, opc<<6|0b11100) - n.staticConst.AddOffsetFinalizedCallback(func(offsetOfConst uint64) { - // LDR (literal, SIMD&FP) encodes offset divided by 4. - offset := (int(offsetOfConst) - int(loadLiteralOffsetInBinary)) / 4 - bin := buf.Bytes() - bin[loadLiteralOffsetInBinary] |= byte(offset << 5) - bin[loadLiteralOffsetInBinary+1] |= byte(offset >> 3) - bin[loadLiteralOffsetInBinary+2] |= byte(offset >> 11) - }) - return -} - -// advancedSIMDTwoRegisterMisc holds information to encode instructions as "Advanced SIMD two-register miscellaneous" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDTwoRegisterMisc = map[asm.Instruction]struct { - qAndSize map[VectorArrangement]qAndSize - u, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/NOT--Bitwise-NOT--vector--?lang=en - NOT: { - u: 0b1, opcode: 0b00101, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FNEG--vector---Floating-point-Negate--vector--?lang=en - VFNEG: { - u: 0b1, opcode: 0b01111, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FABS--vector---Floating-point-Absolute-value--vector--?lang=en - VFABS: {u: 0, opcode: 0b01111, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b11, q: 0b1}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FSQRT--vector---Floating-point-Square-Root--vector--?lang=en - VFSQRT: {u: 1, opcode: 0b11111, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b11, q: 0b1}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTM--vector---Floating-point-Round-to-Integral--toward-Minus-infinity--vector--?lang=en - VFRINTM: {u: 0, opcode: 0b11001, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b01, q: 0b1}, - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTN--vector---Floating-point-Round-to-Integral--to-nearest-with-ties-to-even--vector--?lang=en - VFRINTN: {u: 0, opcode: 0b11000, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b01, q: 0b1}, - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTP--vector---Floating-point-Round-to-Integral--toward-Plus-infinity--vector--?lang=en - VFRINTP: {u: 0, opcode: 0b11000, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b11, q: 0b1}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FRINTZ--vector---Floating-point-Round-to-Integral--toward-Zero--vector--?lang=en - VFRINTZ: {u: 0, opcode: 0b11001, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b11, q: 0b1}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CNT--Population-Count-per-byte-?lang=en - VCNT: {u: 0b0, opcode: 0b00101, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {size: 0b00, q: 0b0}, - VectorArrangement16B: {size: 0b00, q: 0b1}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/NEG--vector---Negate--vector--?lang=en - VNEG: {u: 0b1, opcode: 0b01011, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ABS--Absolute-value--vector--?lang=en - VABS: {u: 0b0, opcode: 0b01011, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/REV64--Reverse-elements-in-64-bit-doublewords--vector--?lang=en - REV64: {u: 0b0, opcode: 0b00000, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/XTN--XTN2--Extract-Narrow-?lang=en - XTN: {u: 0b0, opcode: 0b10010, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {q: 0, size: 0b10}, - VectorArrangement4S: {q: 0, size: 0b01}, - VectorArrangement8H: {q: 0, size: 0b00}, - }}, - SHLL: {u: 0b1, opcode: 0b10011, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b00, size: 0b00}, - VectorArrangement4H: {q: 0b00, size: 0b01}, - VectorArrangement2S: {q: 0b00, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMEQ--zero---Compare-bitwise-Equal-to-zero--vector--?lang=en - CMEQZERO: {u: 0b0, opcode: 0b01001, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SADDLP--Signed-Add-Long-Pairwise-?lang=en - SADDLP: {u: 0b0, opcode: 0b00010, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UADDLP--Unsigned-Add-Long-Pairwise-?lang=en - UADDLP: {u: 0b1, opcode: 0b00010, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTZS--vector--integer---Floating-point-Convert-to-Signed-integer--rounding-toward-Zero--vector--?lang=en - VFCVTZS: {u: 0b0, opcode: 0b11011, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTZU--vector--integer---Floating-point-Convert-to-Unsigned-integer--rounding-toward-Zero--vector--?lang=en - VFCVTZU: {u: 0b1, opcode: 0b11011, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTN--SQXTN2--Signed-saturating-extract-Narrow-?lang=en - SQXTN: {u: 0b0, opcode: 0b10100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b0, size: 0b00}, - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement2S: {q: 0b0, size: 0b10}, - }}, - - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTN--SQXTN2--Signed-saturating-extract-Narrow-?lang=en - SQXTN2: {u: 0b0, opcode: 0b10100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {q: 0b1, size: 0b00}, - VectorArrangement8H: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQXTN--UQXTN2--Unsigned-saturating-extract-Narrow-?lang=en - UQXTN: {u: 0b1, opcode: 0b10100, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTUN--SQXTUN2--Signed-saturating-extract-Unsigned-Narrow-?lang=en - SQXTUN: {u: 0b1, opcode: 0b10010, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b0, size: 0b00}, - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement2S: {q: 0b0, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQXTUN--SQXTUN2--Signed-saturating-extract-Unsigned-Narrow-?lang=en - SQXTUN2: {u: 0b1, opcode: 0b10010, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {q: 0b1, size: 0b00}, - VectorArrangement8H: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SCVTF--vector--integer---Signed-integer-Convert-to-Floating-point--vector--?lang=en - VSCVTF: {u: 0b0, opcode: 0b11101, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b00}, - VectorArrangement2S: {q: 0b0, size: 0b00}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UCVTF--vector--integer---Unsigned-integer-Convert-to-Floating-point--vector--?lang=en - VUCVTF: {u: 0b1, opcode: 0b11101, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b00}, - VectorArrangement2S: {q: 0b0, size: 0b00}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTL--FCVTL2--Floating-point-Convert-to-higher-precision-Long--vector--?lang=en - FCVTL: {u: 0b0, opcode: 0b10111, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2S: {size: 0b01, q: 0b0}, - VectorArrangement4H: {size: 0b00, q: 0b0}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCVTN--FCVTN2--Floating-point-Convert-to-lower-precision-Narrow--vector--?lang=en - FCVTN: {u: 0b0, opcode: 0b10110, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2S: {size: 0b01, q: 0b0}, - VectorArrangement4H: {size: 0b00, q: 0b0}, - }}, -} - -// advancedSIMDThreeDifferent holds information to encode instructions as "Advanced SIMD three different" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDThreeDifferent = map[asm.Instruction]struct { - qAndSize map[VectorArrangement]qAndSize - u, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMLAL--UMLAL2--vector---Unsigned-Multiply-Add-Long--vector--?lang=en - VUMLAL: {u: 0b1, opcode: 0b1000, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2S: {q: 0b0, size: 0b10}, - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement8B: {q: 0b0, size: 0b00}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMULL--SMULL2--vector---Signed-Multiply-Long--vector--?lang=en - SMULL: {u: 0b0, opcode: 0b1100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b0, size: 0b00}, - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement2S: {q: 0b0, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMULL--SMULL2--vector---Signed-Multiply-Long--vector--?lang=en - SMULL2: {u: 0b0, opcode: 0b1100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {q: 0b1, size: 0b00}, - VectorArrangement8H: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - UMULL: {u: 0b1, opcode: 0b1100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b0, size: 0b00}, - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement2S: {q: 0b0, size: 0b10}, - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - UMULL2: {u: 0b1, opcode: 0b1100, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {q: 0b1, size: 0b00}, - VectorArrangement8H: {q: 0b1, size: 0b01}, - VectorArrangement4S: {q: 0b1, size: 0b10}, - }}, -} - -// advancedSIMDThreeSame holds information to encode instructions as "Advanced SIMD three same" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDThreeSame = map[asm.Instruction]struct { - qAndSize map[VectorArrangement]qAndSize - u, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/AND--vector---Bitwise-AND--vector--?lang=en - VAND: { - u: 0b0, opcode: 0b00011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/BSL--Bitwise-Select-?lang=en - BSL: { - u: 0b1, opcode: 0b00011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b01, q: 0b1}, - VectorArrangement8B: {size: 0b01, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/EOR--vector---Bitwise-Exclusive-OR--vector--?lang=en - EOR: { - u: 0b1, opcode: 0b00011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ORR--vector--register---Bitwise-inclusive-OR--vector--register--?lang=en - VORR: { - u: 0b0, opcode: 0b00011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b10, q: 0b1}, - VectorArrangement8B: {size: 0b10, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/BIC--vector--register---Bitwise-bit-Clear--vector--register--?lang=en - BIC: { - u: 0b0, opcode: 0b00011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b01, q: 0b1}, - VectorArrangement8B: {size: 0b01, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FADD--vector---Floating-point-Add--vector--?lang=en - VFADDS: { - u: 0b0, opcode: 0b11010, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FADD--vector---Floating-point-Add--vector--?lang=en - VFADDD: { - u: 0b0, opcode: 0b11010, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FSUB--vector---Floating-point-Subtract--vector--?lang=en - VFSUBS: { - u: 0b0, opcode: 0b11010, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FSUB--vector---Floating-point-Subtract--vector--?lang=en - VFSUBD: { - u: 0b0, opcode: 0b11010, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement2D: {size: 0b11, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMAXP--Unsigned-Maximum-Pairwise-?lang=en - UMAXP: {u: 0b1, opcode: 0b10100, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMEQ--register---Compare-bitwise-Equal--vector--?lang=en - CMEQ: {u: 0b1, opcode: 0b10001, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/dui0801/g/A64-SIMD-Vector-Instructions/ADDP--vector- - VADDP: {u: 0b0, opcode: 0b10111, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ADD--vector---Add--vector--?lang=en - VADD: {u: 0, opcode: 0b10000, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SUB--vector---Subtract--vector--?lang=en - VSUB: {u: 1, opcode: 0b10000, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHL--Signed-Shift-Left--register--?lang=en - SSHL: {u: 0, opcode: 0b01000, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHL--Signed-Shift-Left--register--?lang=en - USHL: {u: 0b1, opcode: 0b01000, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMGT--register---Compare-signed-Greater-than--vector--?lang=en - CMGT: {u: 0b0, opcode: 0b00110, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMHI--register---Compare-unsigned-Higher--vector--?lang=en - CMHI: {u: 0b1, opcode: 0b00110, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMGE--register---Compare-signed-Greater-than-or-Equal--vector--?lang=en - CMGE: {u: 0b0, opcode: 0b00111, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/CMHS--register---Compare-unsigned-Higher-or-Same--vector--?lang=en - CMHS: {u: 0b1, opcode: 0b00111, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMEQ--register---Floating-point-Compare-Equal--vector--?lang=en - FCMEQ: { - u: 0b0, opcode: 0b11100, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMGT--register---Floating-point-Compare-Greater-than--vector--?lang=en - FCMGT: { - u: 0b1, opcode: 0b11100, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FCMGE--register---Floating-point-Compare-Greater-than-or-Equal--vector--?lang=en - FCMGE: { - u: 0b1, opcode: 0b11100, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMIN--vector---Floating-point-minimum--vector--?lang=en - VFMIN: { - u: 0b0, opcode: 0b11110, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMAX--vector---Floating-point-Maximum--vector--?lang=en - VFMAX: { - u: 0b0, opcode: 0b11110, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FMUL--vector---Floating-point-Multiply--vector--?lang=en - VFMUL: { - u: 0b1, opcode: 0b11011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/FDIV--vector---Floating-point-Divide--vector--?lang=en - VFDIV: { - u: 0b1, opcode: 0b11111, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4S: {size: 0b00, q: 0b1}, - VectorArrangement2S: {size: 0b00, q: 0b0}, - VectorArrangement2D: {size: 0b01, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/MUL--vector---Multiply--vector--?lang=en - VMUL: {u: 0b0, opcode: 0b10011, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQADD--Signed-saturating-Add-?lang=en - VSQADD: {u: 0b0, opcode: 0b00001, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQADD--Unsigned-saturating-Add-?lang=en - VUQADD: {u: 0b1, opcode: 0b00001, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMIN--Signed-Minimum--vector--?lang=en - SMIN: {u: 0b0, opcode: 0b01101, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMAX--Signed-Maximum--vector--?lang=en - SMAX: {u: 0b0, opcode: 0b01100, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMIN--Unsigned-Minimum--vector--?lang=en - UMIN: {u: 0b1, opcode: 0b01101, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMAX--Unsigned-Maximum--vector--?lang=en - UMAX: {u: 0b1, opcode: 0b01100, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/URHADD--Unsigned-Rounding-Halving-Add-?lang=en - URHADD: {u: 0b1, opcode: 0b00010, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SQSUB--Signed-saturating-Subtract-?lang=en - VSQSUB: {u: 0b0, opcode: 0b00101, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UQSUB--Unsigned-saturating-Subtract-?lang=en - VUQSUB: {u: 0b1, opcode: 0b00101, qAndSize: defaultQAndSize}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/BIT--Bitwise-Insert-if-True-?lang=en - VBIT: {u: 0b1, opcode: 0b00011, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement8B: {q: 0b0, size: 0b10}, - VectorArrangement16B: {q: 0b1, size: 0b10}, - }}, - SQRDMULH: {u: 0b1, opcode: 0b10110, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement4H: {q: 0b0, size: 0b01}, - VectorArrangement8H: {q: 0b1, size: 0b01}, - VectorArrangement2S: {q: 0b0, size: 0b10}, - VectorArrangement4S: {q: 0b1, size: 0b10}, - }}, -} - -// aAndSize is a pair of "Q" and "size" that appear in https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -type qAndSize struct{ q, size byte } - -// defaultQAndSize maps a vector arrangement to the default qAndSize which is encoded by many instructions. -var defaultQAndSize = map[VectorArrangement]qAndSize{ - VectorArrangement8B: {size: 0b00, q: 0b0}, - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement4H: {size: 0b01, q: 0b0}, - VectorArrangement8H: {size: 0b01, q: 0b1}, - VectorArrangement2S: {size: 0b10, q: 0b0}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - VectorArrangement1D: {size: 0b11, q: 0b0}, - VectorArrangement2D: {size: 0b11, q: 0b1}, -} - -// advancedSIMDAcrossLanes holds information to encode instructions as "Advanced SIMD across lanes" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDAcrossLanes = map[asm.Instruction]struct { - qAndSize map[VectorArrangement]qAndSize - u, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ADDV--Add-across-Vector-?lang=en - ADDV: { - u: 0b0, opcode: 0b11011, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - VectorArrangement8H: {size: 0b01, q: 0b1}, - VectorArrangement4H: {size: 0b01, q: 0b0}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - }, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMINV--Unsigned-Minimum-across-Vector-?lang=en - UMINV: { - u: 0b1, opcode: 0b11010, - qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - VectorArrangement8H: {size: 0b01, q: 0b1}, - VectorArrangement4H: {size: 0b01, q: 0b0}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - }, - }, - UADDLV: {u: 0b1, opcode: 0b00011, qAndSize: map[VectorArrangement]qAndSize{ - VectorArrangement16B: {size: 0b00, q: 0b1}, - VectorArrangement8B: {size: 0b00, q: 0b0}, - VectorArrangement8H: {size: 0b01, q: 0b1}, - VectorArrangement4H: {size: 0b01, q: 0b0}, - VectorArrangement4S: {size: 0b10, q: 0b1}, - }}, -} - -// advancedSIMDScalarPairwise holds information to encode instructions as "Advanced SIMD scalar pairwise" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDScalarPairwise = map[asm.Instruction]struct { - size map[VectorArrangement]byte - u, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/ADDP--scalar---Add-Pair-of-elements--scalar--?lang=en - ADDP: {u: 0b0, opcode: 0b11011, size: map[VectorArrangement]byte{VectorArrangement2D: 0b11}}, -} - -// advancedSIMDCopy holds information to encode instructions as "Advanced SIMD copy" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDCopy = map[asm.Instruction]struct { - // TODO: extract common implementation of resolver. - resolver func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) - op byte -}{ - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/DUP--element---Duplicate-vector-element-to-vector-or-scalar-?lang=en - DUPELEM: {op: 0, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - imm4 = 0b0000 - q = 0b1 - - switch arr { - case VectorArrangementB: - imm5 |= 0b1 - imm5 |= byte(srcIndex) << 1 - case VectorArrangementH: - imm5 |= 0b10 - imm5 |= byte(srcIndex) << 2 - case VectorArrangementS: - imm5 |= 0b100 - imm5 |= byte(srcIndex) << 3 - case VectorArrangementD: - imm5 |= 0b1000 - imm5 |= byte(srcIndex) << 4 - default: - err = fmt.Errorf("unsupported arrangement for DUPELEM: %d", arr) - } - - return - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/DUP--general---Duplicate-general-purpose-register-to-vector-?lang=en - DUPGEN: {op: 0b0, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - imm4 = 0b0001 - switch arr { - case VectorArrangement8B: - imm5 = 0b1 - case VectorArrangement16B: - imm5 = 0b1 - q = 0b1 - case VectorArrangement4H: - imm5 = 0b10 - case VectorArrangement8H: - imm5 = 0b10 - q = 0b1 - case VectorArrangement2S: - imm5 = 0b100 - case VectorArrangement4S: - imm5 = 0b100 - q = 0b1 - case VectorArrangement2D: - imm5 = 0b1000 - q = 0b1 - default: - err = fmt.Errorf("unsupported arrangement for DUPGEN: %s", arr) - } - return - }}, - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/INS--general---Insert-vector-element-from-general-purpose-register-?lang=en - INSGEN: {op: 0b0, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - imm4, q = 0b0011, 0b1 - switch arr { - case VectorArrangementB: - imm5 |= 0b1 - imm5 |= byte(dstIndex) << 1 - case VectorArrangementH: - imm5 |= 0b10 - imm5 |= byte(dstIndex) << 2 - case VectorArrangementS: - imm5 |= 0b100 - imm5 |= byte(dstIndex) << 3 - case VectorArrangementD: - imm5 |= 0b1000 - imm5 |= byte(dstIndex) << 4 - default: - err = fmt.Errorf("unsupported arrangement for INSGEN: %s", arr) - } - return - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/UMOV--Unsigned-Move-vector-element-to-general-purpose-register-?lang=en - UMOV: {op: 0b0, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - imm4 = 0b0111 - switch arr { - case VectorArrangementB: - imm5 |= 0b1 - imm5 |= byte(srcIndex) << 1 - case VectorArrangementH: - imm5 |= 0b10 - imm5 |= byte(srcIndex) << 2 - case VectorArrangementS: - imm5 |= 0b100 - imm5 |= byte(srcIndex) << 3 - case VectorArrangementD: - imm5 |= 0b1000 - imm5 |= byte(srcIndex) << 4 - q = 0b1 - default: - err = fmt.Errorf("unsupported arrangement for UMOV: %s", arr) - } - return - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SMOV--Signed-Move-vector-element-to-general-purpose-register-?lang=en - SMOV32: {op: 0b0, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - imm4 = 0b0101 - switch arr { - case VectorArrangementB: - imm5 |= 0b1 - imm5 |= byte(srcIndex) << 1 - case VectorArrangementH: - imm5 |= 0b10 - imm5 |= byte(srcIndex) << 2 - default: - err = fmt.Errorf("unsupported arrangement for SMOV32: %s", arr) - } - return - }}, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/INS--element---Insert-vector-element-from-another-vector-element-?lang=en - INSELEM: {op: 0b1, resolver: func(srcIndex, dstIndex VectorIndex, arr VectorArrangement) (imm5, imm4, q byte, err error) { - q = 0b1 - switch arr { - case VectorArrangementB: - imm5 |= 0b1 - imm5 |= byte(dstIndex) << 1 - imm4 = byte(srcIndex) - case VectorArrangementH: - imm5 |= 0b10 - imm5 |= byte(dstIndex) << 2 - imm4 = byte(srcIndex) << 1 - case VectorArrangementS: - imm5 |= 0b100 - imm5 |= byte(dstIndex) << 3 - imm4 = byte(srcIndex) << 2 - case VectorArrangementD: - imm5 |= 0b1000 - imm5 |= byte(dstIndex) << 4 - imm4 = byte(srcIndex) << 3 - default: - err = fmt.Errorf("unsupported arrangement for INSELEM: %d", arr) - } - return - }}, -} - -// advancedSIMDTableLookup holds information to encode instructions as "Advanced SIMD table lookup" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDTableLookup = map[asm.Instruction]struct { - q map[VectorArrangement]byte - op, op2, Len byte -}{ - TBL1: {op: 0, op2: 0, Len: 0b00, q: map[VectorArrangement]byte{VectorArrangement16B: 0b1, VectorArrangement8B: 0b0}}, - TBL2: {op: 0, op2: 0, Len: 0b01, q: map[VectorArrangement]byte{VectorArrangement16B: 0b1, VectorArrangement8B: 0b0}}, -} - -// advancedSIMDShiftByImmediate holds information to encode instructions as "Advanced SIMD shift by immediate" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDShiftByImmediate = map[asm.Instruction]struct { - q map[VectorArrangement]byte - immResolver func(shiftAmount int64, arr VectorArrangement) (immh, immb byte, err error) - U, opcode byte -}{ - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/SSHLL--SSHLL2--Signed-Shift-Left-Long--immediate-- - SSHLL: { - U: 0b0, opcode: 0b10100, - q: map[VectorArrangement]byte{VectorArrangement8B: 0b0, VectorArrangement4H: 0b0, VectorArrangement2S: 0b0}, - immResolver: immResolverForSIMDSiftLeftByImmediate, - }, - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/SSHLL--SSHLL2--Signed-Shift-Left-Long--immediate-- - SSHLL2: { - U: 0b0, opcode: 0b10100, - q: map[VectorArrangement]byte{VectorArrangement16B: 0b1, VectorArrangement8H: 0b1, VectorArrangement4S: 0b1}, - immResolver: immResolverForSIMDSiftLeftByImmediate, - }, - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/USHLL--USHLL2--Unsigned-Shift-Left-Long--immediate-- - USHLL: { - U: 0b1, opcode: 0b10100, - q: map[VectorArrangement]byte{VectorArrangement8B: 0b0, VectorArrangement4H: 0b0, VectorArrangement2S: 0b0}, - immResolver: immResolverForSIMDSiftLeftByImmediate, - }, - // https://developer.arm.com/documentation/ddi0596/2020-12/SIMD-FP-Instructions/USHLL--USHLL2--Unsigned-Shift-Left-Long--immediate-- - USHLL2: { - U: 0b1, opcode: 0b10100, - q: map[VectorArrangement]byte{VectorArrangement16B: 0b1, VectorArrangement8H: 0b1, VectorArrangement4S: 0b1}, - immResolver: immResolverForSIMDSiftLeftByImmediate, - }, - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/SSHR--Signed-Shift-Right--immediate--?lang=en - SSHR: { - U: 0b0, opcode: 0b00000, - q: map[VectorArrangement]byte{ - VectorArrangement16B: 0b1, VectorArrangement8H: 0b1, VectorArrangement4S: 0b1, VectorArrangement2D: 0b1, - VectorArrangement8B: 0b0, VectorArrangement4H: 0b0, VectorArrangement2S: 0b0, - }, - immResolver: func(shiftAmount int64, arr VectorArrangement) (immh, immb byte, err error) { - switch arr { - case VectorArrangement16B, VectorArrangement8B: - immh = 0b0001 - immb = 8 - byte(shiftAmount&0b111) - case VectorArrangement8H, VectorArrangement4H: - v := 16 - byte(shiftAmount&0b1111) - immb = v & 0b111 - immh = 0b0010 | (v >> 3) - case VectorArrangement4S, VectorArrangement2S: - v := 32 - byte(shiftAmount&0b11111) - immb = v & 0b111 - immh = 0b0100 | (v >> 3) - case VectorArrangement2D: - v := 64 - byte(shiftAmount&0b111111) - immb = v & 0b111 - immh = 0b1000 | (v >> 3) - default: - err = fmt.Errorf("unsupported arrangement %s", arr) - } - return - }, - }, -} - -// advancedSIMDPermute holds information to encode instructions as "Advanced SIMD permute" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -var advancedSIMDPermute = map[asm.Instruction]struct { - opcode byte -}{ - ZIP1: {opcode: 0b011}, -} - -func immResolverForSIMDSiftLeftByImmediate(shiftAmount int64, arr VectorArrangement) (immh, immb byte, err error) { - switch arr { - case VectorArrangement16B, VectorArrangement8B: - immb = byte(shiftAmount) - immh = 0b0001 - case VectorArrangement8H, VectorArrangement4H: - immb = byte(shiftAmount) & 0b111 - immh = 0b0010 | byte(shiftAmount>>3) - case VectorArrangement4S, VectorArrangement2S: - immb = byte(shiftAmount) & 0b111 - immh = 0b0100 | byte(shiftAmount>>3) - default: - err = fmt.Errorf("unsupported arrangement %s", arr) - } - return -} - -// encodeAdvancedSIMDCopy encodes instruction as "Advanced SIMD copy" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -func (a *AssemblerImpl) encodeAdvancedSIMDCopy(buf asm.Buffer, srcRegBits, dstRegBits, op, imm5, imm4, q byte) { - buf.Append4Bytes( - (srcRegBits<<5)|dstRegBits, - imm4<<3|0b1<<2|srcRegBits>>3, - imm5, - q<<6|op<<5|0b1110, - ) -} - -// encodeAdvancedSIMDThreeSame encodes instruction as "Advanced SIMD three same" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -func (a *AssemblerImpl) encodeAdvancedSIMDThreeSame(buf asm.Buffer, src1, src2, dst, opcode, size, q, u byte) { - buf.Append4Bytes( - (src2<<5)|dst, - opcode<<3|1<<2|src2>>3, - size<<6|0b1<<5|src1, - q<<6|u<<5|0b1110, - ) -} - -// encodeAdvancedSIMDThreeDifferent encodes instruction as "Advanced SIMD three different" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -func (a *AssemblerImpl) encodeAdvancedSIMDThreeDifferent(buf asm.Buffer, src1, src2, dst, opcode, size, q, u byte) { - buf.Append4Bytes( - (src2<<5)|dst, - opcode<<4|src2>>3, - size<<6|0b1<<5|src1, - q<<6|u<<5|0b1110, - ) -} - -// encodeAdvancedSIMDPermute encodes instruction as "Advanced SIMD permute" in -// https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en -func (a *AssemblerImpl) encodeAdvancedSIMDPermute(buf asm.Buffer, src1, src2, dst, opcode, size, q byte) { - buf.Append4Bytes( - (src2<<5)|dst, - opcode<<4|0b1<<3|src2>>3, - size<<6|src1, - q<<6|0b1110, - ) -} - -func (a *AssemblerImpl) encodeVectorRegisterToVectorRegister(buf asm.Buffer, n *nodeImpl) (err error) { - var srcVectorRegBits byte - if n.srcReg != RegRZR { - srcVectorRegBits, err = vectorRegisterBits(n.srcReg) - } else if n.instruction == CMEQZERO { - // CMEQZERO has RegRZR as the src, and we apply the instruction to the same register as the destination. - srcVectorRegBits, err = vectorRegisterBits(n.dstReg) - } - - if err != nil { - return err - } - - dstVectorRegBits, err := vectorRegisterBits(n.dstReg) - if err != nil { - return err - } - - if simdCopy, ok := advancedSIMDCopy[n.instruction]; ok { - imm5, imm4, q, err := simdCopy.resolver(n.srcVectorIndex, n.dstVectorIndex, n.vectorArrangement) - if err != nil { - return err - } - a.encodeAdvancedSIMDCopy(buf, srcVectorRegBits, dstVectorRegBits, simdCopy.op, imm5, imm4, q) - return nil - } - - if scalarPairwise, ok := advancedSIMDScalarPairwise[n.instruction]; ok { - // See "Advanced SIMD scalar pairwise" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - size, ok := scalarPairwise.size[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - buf.Append4Bytes( - (srcVectorRegBits<<5)|dstVectorRegBits, - scalarPairwise.opcode<<4|1<<3|srcVectorRegBits>>3, - size<<6|0b11<<4|scalarPairwise.opcode>>4, - 0b1<<6|scalarPairwise.u<<5|0b11110, - ) - return - } - - if twoRegMisc, ok := advancedSIMDTwoRegisterMisc[n.instruction]; ok { - // See "Advanced SIMD two-register miscellaneous" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - qs, ok := twoRegMisc.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - buf.Append4Bytes( - (srcVectorRegBits<<5)|dstVectorRegBits, - twoRegMisc.opcode<<4|0b1<<3|srcVectorRegBits>>3, - qs.size<<6|0b1<<5|twoRegMisc.opcode>>4, - qs.q<<6|twoRegMisc.u<<5|0b01110, - ) - return nil - } - - if threeSame, ok := advancedSIMDThreeSame[n.instruction]; ok { - qs, ok := threeSame.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - a.encodeAdvancedSIMDThreeSame(buf, srcVectorRegBits, dstVectorRegBits, dstVectorRegBits, threeSame.opcode, qs.size, qs.q, threeSame.u) - return nil - } - - if threeDifferent, ok := advancedSIMDThreeDifferent[n.instruction]; ok { - qs, ok := threeDifferent.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - a.encodeAdvancedSIMDThreeDifferent(buf, srcVectorRegBits, dstVectorRegBits, dstVectorRegBits, threeDifferent.opcode, qs.size, qs.q, threeDifferent.u) - return nil - } - - if acrossLanes, ok := advancedSIMDAcrossLanes[n.instruction]; ok { - // See "Advanced SIMD across lanes" in - // https://developer.arm.com/documentation/ddi0596/2021-12/Index-by-Encoding/Data-Processing----Scalar-Floating-Point-and-Advanced-SIMD?lang=en - qs, ok := acrossLanes.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - buf.Append4Bytes( - (srcVectorRegBits<<5)|dstVectorRegBits, - acrossLanes.opcode<<4|0b1<<3|srcVectorRegBits>>3, - qs.size<<6|0b11000<<1|acrossLanes.opcode>>4, - qs.q<<6|acrossLanes.u<<5|0b01110, - ) - return nil - } - - if lookup, ok := advancedSIMDTableLookup[n.instruction]; ok { - q, ok := lookup.q[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - buf.Append4Bytes( - (srcVectorRegBits<<5)|dstVectorRegBits, - lookup.Len<<5|lookup.op<<4|srcVectorRegBits>>3, - lookup.op2<<6|dstVectorRegBits, - q<<6|0b1110, - ) - return - } - - if shiftByImmediate, ok := advancedSIMDShiftByImmediate[n.instruction]; ok { - immh, immb, err := shiftByImmediate.immResolver(n.srcConst, n.vectorArrangement) - if err != nil { - return err - } - - q, ok := shiftByImmediate.q[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - - buf.Append4Bytes( - (srcVectorRegBits<<5)|dstVectorRegBits, - shiftByImmediate.opcode<<3|0b1<<2|srcVectorRegBits>>3, - immh<<3|immb, - q<<6|shiftByImmediate.U<<5|0b1111, - ) - return nil - } - - if permute, ok := advancedSIMDPermute[n.instruction]; ok { - size, q := arrangementSizeQ(n.vectorArrangement) - a.encodeAdvancedSIMDPermute(buf, srcVectorRegBits, dstVectorRegBits, dstVectorRegBits, permute.opcode, size, q) - return - } - return errorEncodingUnsupported(n) -} - -func (a *AssemblerImpl) encodeTwoVectorRegistersToVectorRegister(buf asm.Buffer, n *nodeImpl) (err error) { - var srcRegBits, srcRegBits2, dstRegBits byte - srcRegBits, err = vectorRegisterBits(n.srcReg) - if err != nil { - return err - } - - srcRegBits2, err = vectorRegisterBits(n.srcReg2) - if err != nil { - return err - } - - dstRegBits, err = vectorRegisterBits(n.dstReg) - if err != nil { - return err - } - - if threeSame, ok := advancedSIMDThreeSame[n.instruction]; ok { - qs, ok := threeSame.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - a.encodeAdvancedSIMDThreeSame(buf, srcRegBits, srcRegBits2, dstRegBits, threeSame.opcode, qs.size, qs.q, threeSame.u) - return nil - } - - if threeDifferent, ok := advancedSIMDThreeDifferent[n.instruction]; ok { - qs, ok := threeDifferent.qAndSize[n.vectorArrangement] - if !ok { - return fmt.Errorf("unsupported vector arrangement %s for %s", n.vectorArrangement, InstructionName(n.instruction)) - } - a.encodeAdvancedSIMDThreeDifferent(buf, srcRegBits, srcRegBits2, dstRegBits, threeDifferent.opcode, qs.size, qs.q, threeDifferent.u) - return nil - } - - if permute, ok := advancedSIMDPermute[n.instruction]; ok { - size, q := arrangementSizeQ(n.vectorArrangement) - a.encodeAdvancedSIMDPermute(buf, srcRegBits, srcRegBits2, dstRegBits, permute.opcode, size, q) - return - } - - if n.instruction == EXT { - // EXT is the only instruction in "Advanced SIMD extract", so inline the encoding here. - // https://developer.arm.com/documentation/ddi0596/2021-12/SIMD-FP-Instructions/EXT--Extract-vector-from-pair-of-vectors-?lang=en - var q, imm4 byte - switch n.vectorArrangement { - case VectorArrangement16B: - imm4 = 0b1111 & byte(n.srcConst) - q = 0b1 - case VectorArrangement8B: - imm4 = 0b111 & byte(n.srcConst) - default: - return fmt.Errorf("invalid arrangement %s for EXT", n.vectorArrangement) - } - buf.Append4Bytes( - (srcRegBits2<<5)|dstRegBits, - imm4<<3|srcRegBits2>>3, - srcRegBits, - q<<6|0b101110, - ) - return - } - return -} - -func (a *AssemblerImpl) encodeVectorRegisterToRegister(buf asm.Buffer, n *nodeImpl) (err error) { - if err = checkArrangementIndexPair(n.vectorArrangement, n.srcVectorIndex); err != nil { - return - } - - srcVecRegBits, err := vectorRegisterBits(n.srcReg) - if err != nil { - return err - } - - dstRegBits, err := intRegisterBits(n.dstReg) - if err != nil { - return err - } - - if simdCopy, ok := advancedSIMDCopy[n.instruction]; ok { - imm5, imm4, q, err := simdCopy.resolver(n.srcVectorIndex, n.dstVectorIndex, n.vectorArrangement) - if err != nil { - return err - } - a.encodeAdvancedSIMDCopy(buf, srcVecRegBits, dstRegBits, simdCopy.op, imm5, imm4, q) - return nil - } - return errorEncodingUnsupported(n) -} - -func (a *AssemblerImpl) encodeRegisterToVectorRegister(buf asm.Buffer, n *nodeImpl) (err error) { - srcRegBits, err := intRegisterBits(n.srcReg) - if err != nil { - return err - } - - dstVectorRegBits, err := vectorRegisterBits(n.dstReg) - if err != nil { - return err - } - - if simdCopy, ok := advancedSIMDCopy[n.instruction]; ok { - imm5, imm4, q, err := simdCopy.resolver(n.srcVectorIndex, n.dstVectorIndex, n.vectorArrangement) - if err != nil { - return err - } - a.encodeAdvancedSIMDCopy(buf, srcRegBits, dstVectorRegBits, simdCopy.op, imm5, imm4, q) - return nil - } - return errorEncodingUnsupported(n) -} - -var zeroRegisterBits byte = 0b11111 - -func isIntRegister(r asm.Register) bool { - return RegR0 <= r && r <= RegSP -} - -func isVectorRegister(r asm.Register) bool { - return RegV0 <= r && r <= RegV31 -} - -func isConditionalRegister(r asm.Register) bool { - return RegCondEQ <= r && r <= RegCondNV -} - -func intRegisterBits(r asm.Register) (ret byte, err error) { - if !isIntRegister(r) { - err = fmt.Errorf("%s is not integer", RegisterName(r)) - } else if r == RegSP { - // SP has the same bit representations as RegRZR. - r = RegRZR - } - ret = byte(r - RegR0) - return -} - -func vectorRegisterBits(r asm.Register) (ret byte, err error) { - if !isVectorRegister(r) { - err = fmt.Errorf("%s is not vector", RegisterName(r)) - } else { - ret = byte(r - RegV0) - } - return -} - -func registerBits(r asm.Register) (ret byte) { - if isIntRegister(r) { - if r == RegSP { - // SP has the same bit representations as RegRZR. - r = RegRZR - } - ret = byte(r - RegR0) - } else { - ret = byte(r - RegV0) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/assembler.go b/vendor/github.com/tetratelabs/wazero/internal/asm/assembler.go deleted file mode 100644 index dd34f78633..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/assembler.go +++ /dev/null @@ -1,209 +0,0 @@ -package asm - -import ( - "fmt" - "math" -) - -// Register represents architecture-specific registers. -type Register byte - -// NilRegister is the only architecture-independent register, and -// can be used to indicate that no register is specified. -const NilRegister Register = 0 - -// Instruction represents architecture-specific instructions. -type Instruction uint16 // to accommodate the high cardinality of vector ops - -// ConditionalRegisterState represents architecture-specific conditional -// register's states. -type ConditionalRegisterState byte - -// ConditionalRegisterStateUnset is the only architecture-independent conditional state, and -// can be used to indicate that no conditional state is specified. -const ConditionalRegisterStateUnset ConditionalRegisterState = 0 - -// Node represents a node in the linked list of assembled operations. -type Node interface { - fmt.Stringer - - // AssignJumpTarget assigns the given target node as the destination of - // jump instruction for this Node. - AssignJumpTarget(target Node) - - // AssignDestinationConstant assigns the given constant as the destination - // of the instruction for this node. - AssignDestinationConstant(value ConstantValue) - - // AssignSourceConstant assigns the given constant as the source - // of the instruction for this node. - AssignSourceConstant(value ConstantValue) - - // OffsetInBinary returns the offset of this node in the assembled binary. - OffsetInBinary() NodeOffsetInBinary -} - -// NodeOffsetInBinary represents an offset of this node in the final binary. -type NodeOffsetInBinary = uint64 - -// ConstantValue represents a constant value used in an instruction. -type ConstantValue = int64 - -// StaticConst represents an arbitrary constant bytes which are pooled and emitted by assembler into the binary. -// These constants can be referenced by instructions. -type StaticConst struct { - // offsetFinalizedCallbacks holds callbacks which are called when .OffsetInBinary is finalized by assembler implementation. - offsetFinalizedCallbacks []func(offsetOfConstInBinary uint64) - - Raw []byte - // OffsetInBinary is the offset of this static const in the result binary. - OffsetInBinary uint64 -} - -// NewStaticConst returns the pointer to the new NewStaticConst for given bytes. -func NewStaticConst(raw []byte) *StaticConst { - return &StaticConst{Raw: raw} -} - -// AddOffsetFinalizedCallback adds a callback into offsetFinalizedCallbacks. -func (s *StaticConst) AddOffsetFinalizedCallback(cb func(offsetOfConstInBinary uint64)) { - s.offsetFinalizedCallbacks = append(s.offsetFinalizedCallbacks, cb) -} - -// SetOffsetInBinary finalizes the offset of this StaticConst, and invokes callbacks. -func (s *StaticConst) SetOffsetInBinary(offset uint64) { - s.OffsetInBinary = offset - for _, cb := range s.offsetFinalizedCallbacks { - cb(offset) - } -} - -// StaticConstPool holds a bulk of StaticConst which are yet to be emitted into the binary. -type StaticConstPool struct { - // addedConsts is used to deduplicate the consts to reduce the final size of binary. - // Note: we can use map on .consts field and remove this field, - // but we have the separate field for deduplication in order to have deterministic assembling behavior. - addedConsts map[*StaticConst]struct{} - - Consts []*StaticConst - // FirstUseOffsetInBinary holds the offset of the first instruction which accesses this const pool . - FirstUseOffsetInBinary NodeOffsetInBinary - // PoolSizeInBytes is the current size of the pool in bytes. - PoolSizeInBytes int -} - -func NewStaticConstPool() StaticConstPool { - return StaticConstPool{addedConsts: map[*StaticConst]struct{}{}, FirstUseOffsetInBinary: math.MaxUint64} -} - -// Reset resets the *StaticConstPool for reuse. -func (p *StaticConstPool) Reset() { - for _, c := range p.Consts { - delete(p.addedConsts, c) - } - // Reuse the slice to avoid re-allocations. - p.Consts = p.Consts[:0] - p.PoolSizeInBytes = 0 - p.FirstUseOffsetInBinary = math.MaxUint64 -} - -// Empty returns true if StaticConstPool is empty. -func (p *StaticConstPool) Empty() bool { - return p.FirstUseOffsetInBinary == math.MaxUint64 -} - -// AddConst adds a *StaticConst into the pool if it's not already added. -func (p *StaticConstPool) AddConst(c *StaticConst, useOffset NodeOffsetInBinary) { - if _, ok := p.addedConsts[c]; ok { - return - } - - if p.Empty() { - p.FirstUseOffsetInBinary = useOffset - } - - c.offsetFinalizedCallbacks = c.offsetFinalizedCallbacks[:0] - - p.Consts = append(p.Consts, c) - p.PoolSizeInBytes += len(c.Raw) - p.addedConsts[c] = struct{}{} -} - -// AssemblerBase is the common interface for assemblers among multiple architectures. -// -// Note: some of them can be implemented in an arch-independent way, but not all can be -// implemented as such. However, we intentionally put such arch-dependant methods here -// in order to provide the common documentation interface. -type AssemblerBase interface { - // Reset resets the state of Assembler implementation and mark it ready for - // the compilation of the new function compilation. - Reset() - - // Assemble produces the final binary for the assembled operations. - Assemble(Buffer) error - - // SetJumpTargetOnNext instructs the assembler that the next node must be - // assigned to the given node's jump destination. - SetJumpTargetOnNext(node Node) - - // BuildJumpTable calculates the offsets between the first instruction `initialInstructions[0]` - // and others (e.g. initialInstructions[3]), and wrote the calculated offsets into pre-allocated - // `table` StaticConst in little endian. - BuildJumpTable(table *StaticConst, initialInstructions []Node) - - // AllocateNOP allocates Node for NOP instruction. - AllocateNOP() Node - - // Add appends the given `Node` in the assembled linked list. - Add(Node) - - // CompileStandAlone adds an instruction to take no arguments. - CompileStandAlone(instruction Instruction) Node - - // CompileConstToRegister adds an instruction where source operand is `value` as constant and destination is `destinationReg` register. - CompileConstToRegister(instruction Instruction, value ConstantValue, destinationReg Register) Node - - // CompileRegisterToRegister adds an instruction where source and destination operands are registers. - CompileRegisterToRegister(instruction Instruction, from, to Register) - - // CompileMemoryToRegister adds an instruction where source operands is the memory address specified by `sourceBaseReg+sourceOffsetConst` - // and the destination is `destinationReg` register. - CompileMemoryToRegister( - instruction Instruction, - sourceBaseReg Register, - sourceOffsetConst ConstantValue, - destinationReg Register, - ) - - // CompileRegisterToMemory adds an instruction where source operand is `sourceRegister` register and the destination is the - // memory address specified by `destinationBaseRegister+destinationOffsetConst`. - CompileRegisterToMemory( - instruction Instruction, - sourceRegister Register, - destinationBaseRegister Register, - destinationOffsetConst ConstantValue, - ) - - // CompileJump adds jump-type instruction and returns the corresponding Node in the assembled linked list. - CompileJump(jmpInstruction Instruction) Node - - // CompileJumpToRegister adds jump-type instruction whose destination is the memory address specified by `reg` register. - CompileJumpToRegister(jmpInstruction Instruction, reg Register) - - // CompileReadInstructionAddress adds an ADR instruction to set the absolute address of "target instruction" - // into destinationRegister. "target instruction" is specified by beforeTargetInst argument and - // the target is determined by "the instruction right after beforeTargetInst type". - // - // For example, if `beforeTargetInst == RET` and we have the instruction sequence like - // `ADR -> X -> Y -> ... -> RET -> MOV`, then the `ADR` instruction emitted by this function set the absolute - // address of `MOV` instruction into the destination register. - CompileReadInstructionAddress(destinationRegister Register, beforeAcquisitionTargetInstruction Instruction) -} - -// JumpTableMaximumOffset represents the limit on the size of jump table in bytes. -// When users try loading an extremely large WebAssembly binary which contains a br_table -// statement with approximately 4294967296 (2^32) targets. Realistically speaking, that kind of binary -// could result in more than ten gigabytes of native compiled code where we have to care about -// huge stacks whose height might exceed 32-bit range, and such huge stack doesn't work with the -// current implementation. -const JumpTableMaximumOffset = math.MaxUint32 diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/buffer.go b/vendor/github.com/tetratelabs/wazero/internal/asm/buffer.go deleted file mode 100644 index 0476c380ea..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/buffer.go +++ /dev/null @@ -1,235 +0,0 @@ -package asm - -import ( - "encoding/binary" - "fmt" - "unsafe" - - "github.com/tetratelabs/wazero/internal/platform" -) - -var zero [16]byte - -// CodeSegment represents a memory mapped segment where native CPU instructions -// are written. -// -// To construct code segments, the program must call Next to obtain a buffer -// view capable of writing data at the end of the segment. Next must be called -// before generating the code of a function because it aligns the next write on -// 16 bytes. -// -// Instances of CodeSegment hold references to memory which is NOT managed by -// the garbage collector and therefore must be released *manually* by calling -// their Unmap method to prevent memory leaks. -// -// The zero value is a valid, empty code segment, equivalent to being -// constructed by calling NewCodeSegment(nil). -type CodeSegment struct { - code []byte - size int -} - -// NewCodeSegment constructs a CodeSegment value from a byte slice. -// -// No validation is made that the byte slice is a memory mapped region which can -// be unmapped on Close. -func NewCodeSegment(code []byte) *CodeSegment { - return &CodeSegment{code: code, size: len(code)} -} - -// Map allocates a memory mapping of the given size to the code segment. -// -// Note that programs only need to use this method to initialize the code -// segment to a specific content (e.g. when loading pre-compiled code from a -// file), otherwise the backing memory mapping is allocated on demand when code -// is written to the code segment via Buffers returned by calls to Next. -// -// The method errors is the segment is already backed by a memory mapping. -func (seg *CodeSegment) Map(size int) error { - if seg.code != nil { - return fmt.Errorf("code segment already initialized to memory mapping of size %d", len(seg.code)) - } - b, err := platform.MmapCodeSegment(size) - if err != nil { - return err - } - seg.code = b - seg.size = size - return nil -} - -// Close unmaps the underlying memory region held by the code segment, clearing -// its state back to an empty code segment. -// -// The value is still usable after unmapping its memory, a new memory area can -// be allocated by calling Map or writing to the segment. -func (seg *CodeSegment) Unmap() error { - if seg.code != nil { - if err := platform.MunmapCodeSegment(seg.code[:cap(seg.code)]); err != nil { - return err - } - seg.code = nil - seg.size = 0 - } - return nil -} - -// Addr returns the address of the beginning of the code segment as a uintptr. -func (seg *CodeSegment) Addr() uintptr { - if len(seg.code) > 0 { - return uintptr(unsafe.Pointer(&seg.code[0])) - } - return 0 -} - -// Size returns the size of code segment, which is less or equal to the length -// of the byte slice returned by Len or Bytes. -func (seg *CodeSegment) Size() uintptr { - return uintptr(seg.size) -} - -// Len returns the length of the byte slice referencing the memory mapping of -// the code segment. -func (seg *CodeSegment) Len() int { - return len(seg.code) -} - -// Bytes returns a byte slice to the memory mapping of the code segment. -// -// The returned slice remains valid until more bytes are written to a buffer -// of the code segment, or Unmap is called. -func (seg *CodeSegment) Bytes() []byte { - return seg.code -} - -// Next returns a buffer pointed at the end of the code segment to support -// writing more code instructions to it. -// -// Buffers are passed by value, but they hold a reference to the code segment -// that they were created from. -func (seg *CodeSegment) NextCodeSection() Buffer { - // Align 16-bytes boundary. - seg.AppendBytes(zero[:seg.size&15]) - return Buffer{CodeSegment: seg, off: seg.size} -} - -// Append appends n bytes to the code segment, returning a slice to the appended -// memory region. -// -// The underlying code segment may be reallocated if it was too short to hold -// n more bytes, which invalidates any addresses previously returned by calls -// to Addr. -func (seg *CodeSegment) Append(n int) []byte { - seg.size += n - if seg.size > len(seg.code) { - seg.growToSize() - } - return seg.code[seg.size-n:] -} - -// AppendByte appends a single byte to the code segment. -// -// The underlying code segment may be reallocated if it was too short to hold -// one more byte, which invalidates any addresses previously returned by calls -// to Addr. -func (seg *CodeSegment) AppendByte(b byte) { - seg.size++ - if seg.size > len(seg.code) { - seg.growToSize() - } - seg.code[seg.size-1] = b -} - -// AppendBytes appends a copy of b to the code segment. -// -// The underlying code segment may be reallocated if it was too short to hold -// len(b) more bytes, which invalidates any addresses previously returned by -// calls to Addr. -func (seg *CodeSegment) AppendBytes(b []byte) { - copy(seg.Append(len(b)), b) -} - -// AppendUint32 appends a 32 bits integer to the code segment. -// -// The underlying code segment may be reallocated if it was too short to hold -// four more bytes, which invalidates any addresses previously returned by calls -// to Addr. -func (seg *CodeSegment) AppendUint32(u uint32) { - seg.size += 4 - if seg.size > len(seg.code) { - seg.growToSize() - } - // This can be replaced by an unsafe operation to assign the uint32, which - // keeps the function cost below the inlining threshold. However, it did not - // show any improvements in arm64 benchmarks so we retained this safer code. - binary.LittleEndian.PutUint32(seg.code[seg.size-4:], u) -} - -// growMode grows the code segment so that another section can be added to it. -// -// The method is marked go:noinline so that it doesn't get inline in Append, -// and AppendByte, which keeps the inlining score of those methods low enough -// that they can be inlined at the call sites. -// -//go:noinline -func (seg *CodeSegment) growToSize() { - seg.Grow(0) -} - -// Grow ensure that the capacity of the code segment is large enough to hold n -// more bytes. -// -// The underlying code segment may be reallocated if it was too short, which -// invalidates any addresses previously returned by calls to Addr. -func (seg *CodeSegment) Grow(n int) { - size := len(seg.code) - want := seg.size + n - if size >= want { - return - } - if size == 0 { - size = 65536 - } - for size < want { - size *= 2 - } - b, err := platform.RemapCodeSegment(seg.code, size) - if err != nil { - // The only reason for growing the buffer to error is if we run - // out of memory, so panic for now as it greatly simplifies error - // handling to assume writing to the buffer would never fail. - panic(err) - } - seg.code = b -} - -// Buffer is a reference type representing a section beginning at the end of a -// code segment where new instructions can be written. -type Buffer struct { - *CodeSegment - off int -} - -func (buf Buffer) Cap() int { - return len(buf.code) - buf.off -} - -func (buf Buffer) Len() int { - return buf.size - buf.off -} - -func (buf Buffer) Bytes() []byte { - return buf.code[buf.off:buf.size:buf.size] -} - -func (buf Buffer) Reset() { - buf.size = buf.off -} - -func (buf Buffer) Truncate(n int) { - buf.size = buf.off + n -} - -func (buf Buffer) Append4Bytes(a, b, c, d byte) { - buf.AppendUint32(uint32(a) | uint32(b)<<8 | uint32(c)<<16 | uint32(d)<<24) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/asm/impl.go b/vendor/github.com/tetratelabs/wazero/internal/asm/impl.go deleted file mode 100644 index 6c54816378..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/asm/impl.go +++ /dev/null @@ -1,59 +0,0 @@ -package asm - -import ( - "encoding/binary" - "fmt" -) - -// BaseAssemblerImpl includes code common to all architectures. -// -// Note: When possible, add code here instead of in architecture-specific files to reduce drift: -// As this is internal, exporting symbols only to reduce duplication is ok. -type BaseAssemblerImpl struct { - // SetBranchTargetOnNextNodes holds branch kind instructions (BR, conditional BR, etc.) - // where we want to set the next coming instruction as the destination of these BR instructions. - SetBranchTargetOnNextNodes []Node - - // JumpTableEntries holds the information to build jump tables. - JumpTableEntries []JumpTableEntry -} - -// JumpTableEntry is the necessary data to build a jump table. -// This is exported for testing purpose. -type JumpTableEntry struct { - t *StaticConst - labelInitialInstructions []Node -} - -// SetJumpTargetOnNext implements AssemblerBase.SetJumpTargetOnNext -func (a *BaseAssemblerImpl) SetJumpTargetOnNext(node Node) { - a.SetBranchTargetOnNextNodes = append(a.SetBranchTargetOnNextNodes, node) -} - -// BuildJumpTable implements AssemblerBase.BuildJumpTable -func (a *BaseAssemblerImpl) BuildJumpTable(table *StaticConst, labelInitialInstructions []Node) { - a.JumpTableEntries = append(a.JumpTableEntries, JumpTableEntry{ - t: table, - labelInitialInstructions: labelInitialInstructions, - }) -} - -// FinalizeJumpTableEntry finalizes the build tables inside the given code. -func (a *BaseAssemblerImpl) FinalizeJumpTableEntry(code []byte) (err error) { - for i := range a.JumpTableEntries { - ent := &a.JumpTableEntries[i] - labelInitialInstructions := ent.labelInitialInstructions - table := ent.t - // Compile the offset table for each target. - base := labelInitialInstructions[0].OffsetInBinary() - for i, nop := range labelInitialInstructions { - if nop.OffsetInBinary()-base >= JumpTableMaximumOffset { - return fmt.Errorf("too large br_table") - } - // We store the offset from the beginning of the L0's initial instruction. - binary.LittleEndian.PutUint32(code[table.OffsetInBinary+uint64(i*4):table.OffsetInBinary+uint64((i+1)*4)], - uint32(nop.OffsetInBinary())-uint32(base)) - } - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/bitpack/offset_array.go b/vendor/github.com/tetratelabs/wazero/internal/bitpack/offset_array.go deleted file mode 100644 index 8cafd18824..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/bitpack/offset_array.go +++ /dev/null @@ -1,224 +0,0 @@ -package bitpack - -import ( - "math" -) - -// OffsetArray is an interface representing read-only views of arrays of 64 bits -// offsets. -type OffsetArray interface { - // Returns the value at index i. - // - // The method complexity may be anywhere between O(1) and O(N). - Index(i int) uint64 - // Returns the number of offsets in the array. - // - // The method complexity must be O(1). - Len() int -} - -// OffsetArrayLen is a helper function to access the length of an offset array. -// It is similar to calling Len on the array but handles the special case where -// the array is nil, in which case it returns zero. -func OffsetArrayLen(array OffsetArray) int { - if array != nil { - return array.Len() - } - return 0 -} - -// NewOffsetArray constructs a new array of offsets from the slice of values -// passed as argument. The slice is not retained, the returned array always -// holds a copy of the values. -// -// The underlying implementation of the offset array applies a compression -// mechanism derived from Frame-of-Reference and Delta Encoding to minimize -// the memory footprint of the array. This compression model works best when -// the input is made of ordered values, otherwise the deltas between values -// are likely to be too large to benefit from delta encoding. -// -// See https://lemire.me/blog/2012/02/08/effective-compression-using-frame-of-reference-and-delta-coding/ -func NewOffsetArray(values []uint64) OffsetArray { - if len(values) == 0 { - return emptyOffsetArray{} - } - if len(values) <= smallOffsetArrayCapacity { - return newSmallOffsetArray(values) - } - - maxDelta := uint64(0) - lastValue := values[0] - // TODO: the pre-processing we perform here can be optimized using SIMD - // instructions. - for _, value := range values[1:] { - if delta := value - lastValue; delta > maxDelta { - maxDelta = delta - } - lastValue = value - } - - switch { - case maxDelta > math.MaxUint32: - return newOffsetArray(values) - case maxDelta > math.MaxUint16: - return newDeltaArray[uint32](values) - case maxDelta > math.MaxUint8: - return newDeltaArray[uint16](values) - case maxDelta > 15: - return newDeltaArray[uint8](values) - default: - return newDeltaArrayUint4(values) - } -} - -type offsetArray struct { - values []uint64 -} - -func newOffsetArray(values []uint64) *offsetArray { - a := &offsetArray{ - values: make([]uint64, len(values)), - } - copy(a.values, values) - return a -} - -func (a *offsetArray) Index(i int) uint64 { - return a.values[i] -} - -func (a *offsetArray) Len() int { - return len(a.values) -} - -type emptyOffsetArray struct{} - -func (emptyOffsetArray) Index(int) uint64 { - panic("index out of bounds") -} - -func (emptyOffsetArray) Len() int { - return 0 -} - -const smallOffsetArrayCapacity = 7 - -type smallOffsetArray struct { - length int - values [smallOffsetArrayCapacity]uint64 -} - -func newSmallOffsetArray(values []uint64) *smallOffsetArray { - a := &smallOffsetArray{length: len(values)} - copy(a.values[:], values) - return a -} - -func (a *smallOffsetArray) Index(i int) uint64 { - if i < 0 || i >= a.length { - panic("index out of bounds") - } - return a.values[i] -} - -func (a *smallOffsetArray) Len() int { - return a.length -} - -type uintType interface { - uint8 | uint16 | uint32 | uint64 -} - -type deltaArray[T uintType] struct { - deltas []T - firstValue uint64 -} - -func newDeltaArray[T uintType](values []uint64) *deltaArray[T] { - a := &deltaArray[T]{ - deltas: make([]T, len(values)-1), - firstValue: values[0], - } - lastValue := values[0] - for i, value := range values[1:] { - a.deltas[i] = T(value - lastValue) - lastValue = value - } - return a -} - -func (a *deltaArray[T]) Index(i int) uint64 { - if i < 0 || i >= a.Len() { - panic("index out of bounds") - } - value := a.firstValue - // TODO: computing the prefix sum can be vectorized; - // see https://en.algorithmica.org/hpc/algorithms/prefix/ - for _, delta := range a.deltas[:i] { - value += uint64(delta) - } - return value -} - -func (a *deltaArray[T]) Len() int { - return len(a.deltas) + 1 -} - -// deltaArrayUint4 is a specialization of deltaArray which packs 4 bits integers -// to hold deltas between 0 and 15; based on the analysis of compiling Python, -// it appeared that most source offset deltas were under 16, so using this -// data structure cuts by 50% the memory needed compared to deltaArray[uint8]. -// -// Here is the distribution of source offset deltas for Python 3.13: -// -// - <=15 : 10240 -// - <=255 : 9565 -// - <=65535 : 1163 -// -// Memory profiles showed that using deltaArrayUint4 (compared to deltaArray[T]) -// dropped the memory footprint of source mappings for Python from 6MB to 4.5MB. -type deltaArrayUint4 struct { - deltas []byte - numValues int - firstValue uint64 -} - -func newDeltaArrayUint4(values []uint64) *deltaArrayUint4 { - a := &deltaArrayUint4{ - deltas: make([]byte, len(values)/2+1), - numValues: len(values), - firstValue: values[0], - } - lastValue := values[0] - for i, value := range values[1:] { - a.assign(i, value-lastValue) - lastValue = value - } - return a -} - -func (a *deltaArrayUint4) assign(i int, v uint64) { - index, shift := uint(i)>>1, 4*(uint(i)&1) - a.deltas[index] &= ^(0xF << shift) - a.deltas[index] |= byte(v) << shift -} - -func (a *deltaArrayUint4) index(i int) uint64 { - index, shift := uint(i)>>1, 4*(uint(i)&1) - return uint64((a.deltas[index] >> shift) & 0xF) -} - -func (a *deltaArrayUint4) Index(i int) uint64 { - if i < 0 || i >= a.Len() { - panic("index out of bounds") - } - value := a.firstValue - for j := 0; j < i; j++ { - value += a.index(j) - } - return value -} - -func (a *deltaArrayUint4) Len() int { - return a.numValues -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/descriptor/table.go b/vendor/github.com/tetratelabs/wazero/internal/descriptor/table.go deleted file mode 100644 index 542958bc7e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/descriptor/table.go +++ /dev/null @@ -1,164 +0,0 @@ -package descriptor - -import "math/bits" - -// Table is a data structure mapping 32 bit descriptor to items. -// -// # Negative keys are invalid. -// -// Negative keys (e.g. -1) are invalid inputs and will return a corresponding -// not-found value. This matches POSIX behavior of file descriptors. -// See https://pubs.opengroup.org/onlinepubs/9699919799/functions/dirfd.html#tag_16_90 -// -// # Data structure design -// -// The data structure optimizes for memory density and lookup performance, -// trading off compute at insertion time. This is a useful compromise for the -// use cases we employ it with: items are usually accessed a lot more often -// than they are inserted, each operation requires a table lookup, so we are -// better off spending extra compute to insert items in the table in order to -// get cheaper lookups. Memory efficiency is also crucial to support scaling -// with programs that maintain thousands of items: having a high or non-linear -// memory-to-item ratio could otherwise be used as an attack vector by -// malicious applications attempting to damage performance of the host. -type Table[Key ~int32, Item any] struct { - masks []uint64 - items []Item -} - -// Len returns the number of items stored in the table. -func (t *Table[Key, Item]) Len() (n int) { - // We could make this a O(1) operation if we cached the number of items in - // the table. More state usually means more problems, so until we have a - // clear need for this, the simple implementation may be a better trade off. - for _, mask := range t.masks { - n += bits.OnesCount64(mask) - } - return n -} - -// grow ensures that t has enough room for n items, potentially reallocating the -// internal buffers if their capacity was too small to hold this many items. -func (t *Table[Key, Item]) grow(n int) { - // Round up to a multiple of 64 since this is the smallest increment due to - // using 64 bits masks. - n = (n*64 + 63) / 64 - - if n > len(t.masks) { - masks := make([]uint64, n) - copy(masks, t.masks) - - items := make([]Item, n*64) - copy(items, t.items) - - t.masks = masks - t.items = items - } -} - -// Insert inserts the given item to the table, returning the key that it is -// mapped to or false if the table was full. -// -// The method does not perform deduplication, it is possible for the same item -// to be inserted multiple times, each insertion will return a different key. -func (t *Table[Key, Item]) Insert(item Item) (key Key, ok bool) { - offset := 0 -insert: - // Note: this loop could be made a lot more efficient using vectorized - // operations: 256 bits vector registers would yield a theoretical 4x - // speed up (e.g. using AVX2). - for index, mask := range t.masks[offset:] { - if ^mask != 0 { // not full? - shift := bits.TrailingZeros64(^mask) - index += offset - key = Key(index)*64 + Key(shift) - t.items[key] = item - t.masks[index] = mask | uint64(1<= 0 - } - } - - offset = len(t.masks) - n := 2 * len(t.masks) - if n == 0 { - n = 1 - } - - t.grow(n) - goto insert -} - -// Lookup returns the item associated with the given key (may be nil). -func (t *Table[Key, Item]) Lookup(key Key) (item Item, found bool) { - if key < 0 { // invalid key - return - } - if i := int(key); i >= 0 && i < len(t.items) { - index := uint(key) / 64 - shift := uint(key) % 64 - if (t.masks[index] & (1 << shift)) != 0 { - item, found = t.items[i], true - } - } - return -} - -// InsertAt inserts the given `item` at the item descriptor `key`. This returns -// false if the insert was impossible due to negative key. -func (t *Table[Key, Item]) InsertAt(item Item, key Key) bool { - if key < 0 { - return false - } - if diff := int(key) - t.Len(); diff > 0 { - t.grow(diff) - } - index := uint(key) / 64 - shift := uint(key) % 64 - t.masks[index] |= 1 << shift - t.items[key] = item - return true -} - -// Delete deletes the item stored at the given key from the table. -func (t *Table[Key, Item]) Delete(key Key) { - if key < 0 { // invalid key - return - } - if index, shift := key/64, key%64; int(index) < len(t.masks) { - mask := t.masks[index] - if (mask & (1 << shift)) != 0 { - var zero Item - t.items[key] = zero - t.masks[index] = mask & ^uint64(1< arm64.RegSP { - // Skips arm64.RegSP which is not a real register. - ret-- - } - return -} - -func registerFromMaskShift(s int) asm.Register { - if s < 32 { - return arm64.RegR0 + asm.Register(s) - } else { - // Skips arm64.RegSP which is not a real register. - return arm64.RegR0 + asm.Register(s) + 1 - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_arm64.s b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_arm64.s deleted file mode 100644 index bec947286b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_arm64.s +++ /dev/null @@ -1,21 +0,0 @@ -#include "funcdata.h" -#include "textflag.h" - -// nativecall(codeSegment, ce, moduleInstanceAddress) -TEXT ·nativecall(SB), NOSPLIT|NOFRAME, $0-24 - // Load the address of *callEngine into arm64ReservedRegisterForCallEngine. - MOVD ce+8(FP), R0 - - // In arm64, return address is stored in R30 after jumping into the code. - // We save the return address value into archContext.compilerReturnAddress in Engine. - // Note that the const 144 drifts after editting Engine or archContext struct. See TestArchContextOffsetInEngine. - MOVD R30, 144(R0) - - // Load the address of *wasm.ModuleInstance into arm64CallingConventionModuleInstanceAddressRegister. - MOVD moduleInstanceAddress+16(FP), R29 - - // Load the address of native code. - MOVD codeSegment+0(FP), R1 - - // Jump to native code. - JMP (R1) diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.go deleted file mode 100644 index e53ac8dffa..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !amd64 && !arm64 - -package compiler - -import ( - "fmt" - "runtime" - - "github.com/tetratelabs/wazero/internal/asm" -) - -// archContext is empty on an unsupported architecture. -type archContext struct{} - -// newCompiler panics with an unsupported error. -func newCompiler() compiler { - panic(fmt.Sprintf("unsupported GOARCH %s", runtime.GOARCH)) -} - -func registerMaskShift(r asm.Register) (ret int) { - panic(fmt.Sprintf("unsupported GOARCH %s", runtime.GOARCH)) -} - -func registerFromMaskShift(s int) asm.Register { - panic(fmt.Sprintf("unsupported GOARCH %s", runtime.GOARCH)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.s b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.s deleted file mode 100644 index ad057fbb2b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/arch_other.s +++ /dev/null @@ -1,3 +0,0 @@ -//go:build !arm64 && !amd64 - -TEXT ·nativecall(SB), $0-16 diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler.go deleted file mode 100644 index b2c79becc0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler.go +++ /dev/null @@ -1,335 +0,0 @@ -package compiler - -import ( - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// compiler is the interface of architecture-specific native code compiler, -// and this is responsible for compiling native code for all wazeroir operations. -type compiler interface { - Init(functionType *wasm.FunctionType, ir *wazeroir.CompilationResult, withListener bool) - - // String is for debugging purpose. - String() string - // compilePreamble is called before compiling any wazeroir operation. - // This is used, for example, to initialize the reserved registers, etc. - compilePreamble() error - // compile generates the native code into buf. - // stackPointerCeil is the max stack pointer that the target function would reach. - compile(buf asm.Buffer) (stackPointerCeil uint64, err error) - // compileGoHostFunction adds the trampoline code from which native code can jump into the Go-defined host function. - // TODO: maybe we wouldn't need to have trampoline for host functions. - compileGoDefinedHostFunction() error - // compileLabel notify compilers of the beginning of a label. - // Return true if the compiler decided to skip the entire label. - // See wazeroir.NewOperationLabel - compileLabel(o *wazeroir.UnionOperation) (skipThisLabel bool) - // compileUnreachable adds instruction to perform wazeroir.OperationUnreachable. - compileUnreachable() error - // compileSet adds instruction to perform wazeroir.OperationSet. - compileSet(o *wazeroir.UnionOperation) error - // compileGlobalGet adds instructions to perform wazeroir.OperationGlobalGet. - compileGlobalGet(o *wazeroir.UnionOperation) error - // compileGlobalSet adds instructions to perform wazeroir.OperationGlobalSet. - compileGlobalSet(o *wazeroir.UnionOperation) error - // compileBr adds instructions to perform wazeroir.NewOperationBr. - compileBr(o *wazeroir.UnionOperation) error - // compileBrIf adds instructions to perform wazeroir.NewOperationBrIf. - compileBrIf(o *wazeroir.UnionOperation) error - // compileBrTable adds instructions to perform wazeroir.NewOperationBrTable. - compileBrTable(o *wazeroir.UnionOperation) error - // compileCall adds instructions to perform wazeroir.OperationCall. - compileCall(o *wazeroir.UnionOperation) error - // compileCallIndirect adds instructions to perform wazeroir.OperationCallIndirect. - compileCallIndirect(o *wazeroir.UnionOperation) error - // compileDrop adds instructions to perform wazeroir.NewOperationDrop. - compileDrop(o *wazeroir.UnionOperation) error - // compileSelect adds instructions to perform wazeroir.OperationSelect. - compileSelect(o *wazeroir.UnionOperation) error - // compilePick adds instructions to perform wazeroir.OperationPick. - compilePick(o *wazeroir.UnionOperation) error - // compileAdd adds instructions to perform wazeroir.OperationAdd. - compileAdd(o *wazeroir.UnionOperation) error - // compileSub adds instructions to perform wazeroir.OperationSub. - compileSub(o *wazeroir.UnionOperation) error - // compileMul adds instructions to perform wazeroir.OperationMul. - compileMul(o *wazeroir.UnionOperation) error - // compileClz adds instructions to perform wazeroir.OperationClz. - compileClz(o *wazeroir.UnionOperation) error - // compileCtz adds instructions to perform wazeroir.OperationCtz. - compileCtz(o *wazeroir.UnionOperation) error - // compilePopcnt adds instructions to perform wazeroir.OperationPopcnt. - compilePopcnt(o *wazeroir.UnionOperation) error - // compileDiv adds instructions to perform wazeroir.OperationDiv. - compileDiv(o *wazeroir.UnionOperation) error - // compileRem adds instructions to perform wazeroir.OperationRem. - compileRem(o *wazeroir.UnionOperation) error - // compileAnd adds instructions to perform wazeroir.OperationAnd. - compileAnd(o *wazeroir.UnionOperation) error - // compileOr adds instructions to perform wazeroir.OperationOr. - compileOr(o *wazeroir.UnionOperation) error - // compileXor adds instructions to perform wazeroir.OperationXor. - compileXor(o *wazeroir.UnionOperation) error - // compileShl adds instructions to perform wazeroir.OperationShl. - compileShl(o *wazeroir.UnionOperation) error - // compileShr adds instructions to perform wazeroir.OperationShr. - compileShr(o *wazeroir.UnionOperation) error - // compileRotl adds instructions to perform wazeroir.OperationRotl. - compileRotl(o *wazeroir.UnionOperation) error - // compileRotr adds instructions to perform wazeroir.OperationRotr. - compileRotr(o *wazeroir.UnionOperation) error - // compileNeg adds instructions to perform wazeroir.OperationAbs. - compileAbs(o *wazeroir.UnionOperation) error - // compileNeg adds instructions to perform wazeroir.OperationNeg. - compileNeg(o *wazeroir.UnionOperation) error - // compileCeil adds instructions to perform wazeroir.OperationCeil. - compileCeil(o *wazeroir.UnionOperation) error - // compileFloor adds instructions to perform wazeroir.OperationFloor. - compileFloor(o *wazeroir.UnionOperation) error - // compileTrunc adds instructions to perform wazeroir.OperationTrunc. - compileTrunc(o *wazeroir.UnionOperation) error - // compileNearest adds instructions to perform wazeroir.OperationNearest. - compileNearest(o *wazeroir.UnionOperation) error - // compileSqrt adds instructions perform wazeroir.OperationSqrt. - compileSqrt(o *wazeroir.UnionOperation) error - // compileMin adds instructions perform wazeroir.OperationMin. - compileMin(o *wazeroir.UnionOperation) error - // compileMax adds instructions perform wazeroir.OperationMax. - compileMax(o *wazeroir.UnionOperation) error - // compileCopysign adds instructions to perform wazeroir.OperationCopysign. - compileCopysign(o *wazeroir.UnionOperation) error - // compileI32WrapFromI64 adds instructions to perform wazeroir.OperationI32WrapFromI64. - compileI32WrapFromI64() error - // compileITruncFromF adds instructions to perform wazeroir.NewOperationITruncFromF. - compileITruncFromF(o *wazeroir.UnionOperation) error - // compileFConvertFromI adds instructions to perform wazeroir.NewOperationFConvertFromI. - compileFConvertFromI(o *wazeroir.UnionOperation) error - // compileF32DemoteFromF64 adds instructions to perform wazeroir.OperationF32DemoteFromF64. - compileF32DemoteFromF64() error - // compileF64PromoteFromF32 adds instructions to perform wazeroir.OperationF64PromoteFromF32. - compileF64PromoteFromF32() error - // compileI32ReinterpretFromF32 adds instructions to perform wazeroir.OperationI32ReinterpretFromF32. - compileI32ReinterpretFromF32() error - // compileI64ReinterpretFromF64 adds instructions to perform wazeroir.OperationI64ReinterpretFromF64. - compileI64ReinterpretFromF64() error - // compileF32ReinterpretFromI32 adds instructions to perform wazeroir.OperationF32ReinterpretFromI32. - compileF32ReinterpretFromI32() error - // compileF64ReinterpretFromI64 adds instructions to perform wazeroir.OperationF64ReinterpretFromI64. - compileF64ReinterpretFromI64() error - // compileExtend adds instructions to perform wazeroir.NewOperationExtend. - compileExtend(o *wazeroir.UnionOperation) error - // compileEq adds instructions to perform wazeroir.OperationEq. - compileEq(o *wazeroir.UnionOperation) error - // compileEq adds instructions to perform wazeroir.OperationNe. - compileNe(o *wazeroir.UnionOperation) error - // compileEq adds instructions to perform wazeroir.OperationEqz. - compileEqz(o *wazeroir.UnionOperation) error - // compileLt adds instructions to perform wazeroir.OperationLt. - compileLt(o *wazeroir.UnionOperation) error - // compileGt adds instructions to perform wazeroir.OperationGt. - compileGt(o *wazeroir.UnionOperation) error - // compileLe adds instructions to perform wazeroir.OperationLe. - compileLe(o *wazeroir.UnionOperation) error - // compileLe adds instructions to perform wazeroir.OperationGe. - compileGe(o *wazeroir.UnionOperation) error - // compileLoad adds instructions to perform wazeroir.OperationLoad. - compileLoad(o *wazeroir.UnionOperation) error - // compileLoad8 adds instructions to perform wazeroir.OperationLoad8. - compileLoad8(o *wazeroir.UnionOperation) error - // compileLoad16 adds instructions to perform wazeroir.OperationLoad16. - compileLoad16(o *wazeroir.UnionOperation) error - // compileLoad32 adds instructions to perform wazeroir.OperationLoad32. - compileLoad32(o *wazeroir.UnionOperation) error - // compileStore adds instructions to perform wazeroir.OperationStore. - compileStore(o *wazeroir.UnionOperation) error - // compileStore8 adds instructions to perform wazeroir.OperationStore8. - compileStore8(o *wazeroir.UnionOperation) error - // compileStore16 adds instructions to perform wazeroir.OperationStore16. - compileStore16(o *wazeroir.UnionOperation) error - // compileStore32 adds instructions to perform wazeroir.OperationStore32. - compileStore32(o *wazeroir.UnionOperation) error - // compileMemorySize adds instruction to perform wazeroir.OperationMemoryGrow. - compileMemoryGrow() error - // compileMemorySize adds instruction to perform wazeroir.OperationMemorySize. - compileMemorySize() error - // compileConstI32 adds instruction to perform wazeroir.NewOperationConstI32. - compileConstI32(o *wazeroir.UnionOperation) error - // compileConstI64 adds instruction to perform wazeroir.NewOperationConstI64. - compileConstI64(o *wazeroir.UnionOperation) error - // compileConstF32 adds instruction to perform wazeroir.NewOperationConstF32. - compileConstF32(o *wazeroir.UnionOperation) error - // compileConstF64 adds instruction to perform wazeroir.NewOperationConstF64. - compileConstF64(o *wazeroir.UnionOperation) error - // compileSignExtend32From8 adds instructions to perform wazeroir.OperationSignExtend32From8. - compileSignExtend32From8() error - // compileSignExtend32From16 adds instructions to perform wazeroir.OperationSignExtend32From16. - compileSignExtend32From16() error - // compileSignExtend64From8 adds instructions to perform wazeroir.OperationSignExtend64From8. - compileSignExtend64From8() error - // compileSignExtend64From16 adds instructions to perform wazeroir.OperationSignExtend64From16. - compileSignExtend64From16() error - // compileSignExtend64From32 adds instructions to perform wazeroir.OperationSignExtend64From32. - compileSignExtend64From32() error - // compileMemoryInit adds instructions to perform wazeroir.NewOperationMemoryInit. - compileMemoryInit(*wazeroir.UnionOperation) error - // compileDataDrop adds instructions to perform wazeroir.NewOperationDataDrop. - compileDataDrop(*wazeroir.UnionOperation) error - // compileMemoryCopy adds instructions to perform wazeroir.OperationMemoryCopy. - compileMemoryCopy() error - // compileMemoryFill adds instructions to perform wazeroir.OperationMemoryFill. - compileMemoryFill() error - // compileTableInit adds instructions to perform wazeroir.NewOperationTableInit. - compileTableInit(*wazeroir.UnionOperation) error - // compileTableCopy adds instructions to perform wazeroir.NewOperationTableCopy. - compileTableCopy(*wazeroir.UnionOperation) error - // compileElemDrop adds instructions to perform wazeroir.NewOperationElemDrop. - compileElemDrop(*wazeroir.UnionOperation) error - // compileRefFunc adds instructions to perform wazeroir.NewOperationRefFunc. - compileRefFunc(*wazeroir.UnionOperation) error - // compileTableGet adds instructions to perform wazeroir.NewOperationTableGet. - compileTableGet(*wazeroir.UnionOperation) error - // compileTableSet adds instructions to perform wazeroir.NewOperationTableSet. - compileTableSet(*wazeroir.UnionOperation) error - // compileTableGrow adds instructions to perform wazeroir.NewOperationTableGrow. - compileTableGrow(*wazeroir.UnionOperation) error - // compileTableSize adds instructions to perform wazeroir.NewOperationTableSize. - compileTableSize(*wazeroir.UnionOperation) error - // compileTableFill adds instructions to perform wazeroir.NewOperationTableFill. - compileTableFill(*wazeroir.UnionOperation) error - // compileV128Const adds instructions to perform wazeroir.NewOperationV128Const. - compileV128Const(*wazeroir.UnionOperation) error - // compileV128Add adds instructions to perform wazeroir.OperationV128Add. - compileV128Add(o *wazeroir.UnionOperation) error - // compileV128Sub adds instructions to perform wazeroir.OperationV128Sub. - compileV128Sub(o *wazeroir.UnionOperation) error - // compileV128Load adds instructions to perform wazeroir.OperationV128Load. - compileV128Load(o *wazeroir.UnionOperation) error - // compileV128LoadLane adds instructions to perform wazeroir.OperationV128LoadLane. - compileV128LoadLane(o *wazeroir.UnionOperation) error - // compileV128Store adds instructions to perform wazeroir.NewOperationV128Store. - compileV128Store(o *wazeroir.UnionOperation) error - // compileV128StoreLane adds instructions to perform wazeroir.NewOperationV128StoreLane. - compileV128StoreLane(o *wazeroir.UnionOperation) error - // compileV128ExtractLane adds instructions to perform wazeroir.NewOperationV128ExtractLane. - compileV128ExtractLane(o *wazeroir.UnionOperation) error - // compileV128ReplaceLane adds instructions to perform wazeroir.NewOperationV128ReplaceLane. - compileV128ReplaceLane(o *wazeroir.UnionOperation) error - // compileV128Splat adds instructions to perform wazeroir.NewOperationV128Splat. - compileV128Splat(o *wazeroir.UnionOperation) error - // compileV128Shuffle adds instructions to perform wazeroir.NewOperationV128Shuffle. - compileV128Shuffle(o *wazeroir.UnionOperation) error - // compileV128Swizzle adds instructions to perform wazeroir.OperationV128Swizzle. - compileV128Swizzle(o *wazeroir.UnionOperation) error - // compileV128AnyTrue adds instructions to perform wazeroir.OperationV128AnyTrue. - compileV128AnyTrue(o *wazeroir.UnionOperation) error - // compileV128AllTrue adds instructions to perform wazeroir.NewOperationV128AllTrue. - compileV128AllTrue(o *wazeroir.UnionOperation) error - // compileV128BitMask adds instructions to perform wazeroir.NewOperationV128BitMask. - compileV128BitMask(*wazeroir.UnionOperation) error - // compileV128And adds instructions to perform wazeroir.OperationV128And. - compileV128And(*wazeroir.UnionOperation) error - // compileV128Not adds instructions to perform wazeroir.OperationV128Not. - compileV128Not(*wazeroir.UnionOperation) error - // compileV128Or adds instructions to perform wazeroir.OperationV128Or. - compileV128Or(*wazeroir.UnionOperation) error - // compileV128Xor adds instructions to perform wazeroir.OperationV128Xor. - compileV128Xor(*wazeroir.UnionOperation) error - // compileV128Bitselect adds instructions to perform wazeroir.OperationV128Bitselect. - compileV128Bitselect(*wazeroir.UnionOperation) error - // compileV128AndNot adds instructions to perform wazeroir.OperationV128AndNot. - compileV128AndNot(*wazeroir.UnionOperation) error - // compileV128Shr adds instructions to perform wazeroir.NewOperationV128Shr. - compileV128Shr(*wazeroir.UnionOperation) error - // compileV128Shl adds instructions to perform wazeroir.NewOperationV128Shl. - compileV128Shl(*wazeroir.UnionOperation) error - // compileV128Cmp adds instructions to perform wazeroir.NewOperationV128Cmp. - compileV128Cmp(*wazeroir.UnionOperation) error - // compileV128AddSat adds instructions to perform wazeroir.NewOperationV128AddSat. - compileV128AddSat(*wazeroir.UnionOperation) error - // compileV128SubSat adds instructions to perform wazeroir.NewOperationV128SubSat. - compileV128SubSat(*wazeroir.UnionOperation) error - // compileV128Mul adds instructions to perform wazeroir.NewOperationV128Mul. - compileV128Mul(*wazeroir.UnionOperation) error - // compileV128Div adds instructions to perform wazeroir.NewOperationV128Div. - compileV128Div(*wazeroir.UnionOperation) error - // compileV128Neg adds instructions to perform wazeroir.NewOperationV128Neg. - compileV128Neg(*wazeroir.UnionOperation) error - // compileV128Sqrt adds instructions to perform wazeroir.NewOperationV128Sqrt. - compileV128Sqrt(*wazeroir.UnionOperation) error - // compileV128Abs adds instructions to perform wazeroir.NewOperationV128Abs. - compileV128Abs(*wazeroir.UnionOperation) error - // compileV128Popcnt adds instructions to perform wazeroir.NewOperationV128Popcnt. - compileV128Popcnt(*wazeroir.UnionOperation) error - // compileV128Min adds instructions to perform wazeroir.NewOperationV128Min. - compileV128Min(*wazeroir.UnionOperation) error - // compileV128Max adds instructions to perform wazeroir.NewOperationV128Max. - compileV128Max(*wazeroir.UnionOperation) error - // compileV128AvgrU adds instructions to perform wazeroir.NewOperationV128AvgrU. - compileV128AvgrU(*wazeroir.UnionOperation) error - // compileV128Pmin adds instructions to perform wazeroir.NewOperationV128Pmin. - compileV128Pmin(*wazeroir.UnionOperation) error - // compileV128Pmax adds instructions to perform wazeroir.NewOperationV128Pmax. - compileV128Pmax(*wazeroir.UnionOperation) error - // compileV128Ceil adds instructions to perform wazeroir.NewOperationV128Ceil. - compileV128Ceil(*wazeroir.UnionOperation) error - // compileV128Floor adds instructions to perform wazeroir.NewOperationV128Floor. - compileV128Floor(*wazeroir.UnionOperation) error - // compileV128Trunc adds instructions to perform wazeroir.NewOperationV128Trunc. - compileV128Trunc(*wazeroir.UnionOperation) error - // compileV128Nearest adds instructions to perform wazeroir.NewOperationV128Nearest. - compileV128Nearest(*wazeroir.UnionOperation) error - // compileV128Extend adds instructions to perform wazeroir.NewOperationV128Extend. - compileV128Extend(*wazeroir.UnionOperation) error - // compileV128ExtMul adds instructions to perform wazeroir.NewOperationV128ExtMul. - compileV128ExtMul(*wazeroir.UnionOperation) error - // compileV128Q15mulrSatS adds instructions to perform wazeroir.OperationV128Q15mulrSatS. - compileV128Q15mulrSatS(*wazeroir.UnionOperation) error - // compileV128ExtAddPairwise adds instructions to perform wazeroir.NewOperationV128ExtAddPairwise. - compileV128ExtAddPairwise(o *wazeroir.UnionOperation) error - // compileV128FloatPromote adds instructions to perform wazeroir.OperationV128FloatPromote. - compileV128FloatPromote(o *wazeroir.UnionOperation) error - // compileV128FloatDemote adds instructions to perform wazeroir.OperationV128FloatDemote. - compileV128FloatDemote(o *wazeroir.UnionOperation) error - // compileV128FConvertFromI adds instructions to perform wazeroir.NewOperationV128FConvertFromI. - compileV128FConvertFromI(o *wazeroir.UnionOperation) error - // compileV128Dot adds instructions to perform wazeroir.OperationV128Dot. - compileV128Dot(o *wazeroir.UnionOperation) error - // compileV128Narrow adds instructions to perform wazeroir.NewOperationV128Narrow. - compileV128Narrow(o *wazeroir.UnionOperation) error - // compileV128ITruncSatFromF adds instructions to perform wazeroir.NewOperationV128ITruncSatFromF. - compileV128ITruncSatFromF(o *wazeroir.UnionOperation) error - - // compileBuiltinFunctionCheckExitCode adds instructions to perform wazeroir.OperationBuiltinFunctionCheckExitCode. - compileBuiltinFunctionCheckExitCode() error - - // compileReleaseRegisterToStack adds instructions to write the value on a register back to memory stack region. - compileReleaseRegisterToStack(loc *runtimeValueLocation) - // compileLoadValueOnStackToRegister adds instructions to load the value located on the stack to the assigned register. - compileLoadValueOnStackToRegister(loc *runtimeValueLocation) - - // maybeCompileMoveTopConditionalToGeneralPurposeRegister moves the top value on the stack - // if the value is located on a conditional register. - // - // This is usually called at the beginning of methods on compiler interface where we possibly - // compile instructions without saving the conditional register value. - // The compileXXX functions without calling this function is saving the conditional - // value to the stack or register by invoking compileEnsureOnRegister for the top. - maybeCompileMoveTopConditionalToGeneralPurposeRegister() error - // allocateRegister returns an unused register of the given type. The register will be taken - // either from the free register pool or by stealing a used register. - // - // Note: resulting registers will not be marked as used so the call site should - // mark it used if necessary. - allocateRegister(t registerType) (reg asm.Register, err error) - // runtimeValueLocationStack returns the current runtimeValueLocationStack of the compiler implementation. - runtimeValueLocationStack() *runtimeValueLocationStack - // pushRuntimeValueLocationOnRegister pushes a new runtimeValueLocation on a register `reg` and of the type `vt`. - pushRuntimeValueLocationOnRegister(reg asm.Register, vt runtimeValueType) (ret *runtimeValueLocation) - // pushRuntimeValueLocationOnRegister pushes a new vector value's runtimeValueLocation on a register `reg`. - pushVectorRuntimeValueLocationOnRegister(reg asm.Register) (lowerBitsLocation *runtimeValueLocation) - // compileNOP compiles NOP instruction and returns the corresponding asm.Node in the assembled native code. - // This is used to emit DWARF based stack traces. - compileNOP() asm.Node -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_drop.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_drop.go deleted file mode 100644 index 342cee0e1d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_drop.go +++ /dev/null @@ -1,126 +0,0 @@ -package compiler - -import ( - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// compileDropRange adds instruction to drop the values on the target range -// in an architecture independent way. -func compileDropRange(c compiler, raw uint64) (err error) { - r := wazeroir.InclusiveRangeFromU64(raw) - locationStack := c.runtimeValueLocationStack() - if r.Start < 0 { - return - } else if r.Start == 0 { - for i := 0; i <= int(r.End); i++ { - if loc := locationStack.pop(); loc.onRegister() { - locationStack.releaseRegister(loc) - } - } - return - } - - // If the top value is alive, we must ensure that it is not located as a conditional. - // Otherwise, the conditional flag might end up modified by the following operation. - if err = c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return - } - - dropValues, liveValues := locationStack.dropsLivesForInclusiveRange(r) - - // Frees all the registers used by drop target values. - for i := range dropValues { - dv := &dropValues[i] - if dv.onRegister() { - locationStack.releaseRegister(dv) - } - } - - // These registers are not nil if a live value of that type is currently located on the memory stack. - // In order to migrate these values, we can use them below. - gpTmp, vecTmp, err := getTemporariesForStackedLiveValues(c, liveValues) - if err != nil { - return err - } - - // Reset the stack pointer below the end. - locationStack.sp -= uint64(len(liveValues) + len(dropValues)) - - // Push back the live values again. - for i := range liveValues { - live := &liveValues[i] - migrateLiveValue(c, live, gpTmp, vecTmp) - } - return -} - -// migrateLiveValue migrates the live value `live` into the top of the stack. It might be located on the stack -// and in that case, we have to load it into either `generalPurposeTmpReg` or `vectorTmpReg` temporarily, and -// write it back into the *new* stack location. -func migrateLiveValue(c compiler, live *runtimeValueLocation, generalPurposeTmpReg, vectorTmpReg asm.Register) { - if live.valueType == runtimeValueTypeV128Hi { - // Higher bits of vector was already handled together with the lower bits. - return - } - - previouslyOnStack := live.onStack() - if previouslyOnStack { - // If the value is on the stack, load the value on the old location into the temporary value, - // and then write it back to the new memory location below. - switch live.getRegisterType() { - case registerTypeGeneralPurpose: - live.setRegister(generalPurposeTmpReg) - case registerTypeVector: - live.setRegister(vectorTmpReg) - } - // Load the value into tmp. - c.compileLoadValueOnStackToRegister(live) - } - - var newLocation *runtimeValueLocation - if live.valueType == runtimeValueTypeV128Lo { - newLocation = c.pushVectorRuntimeValueLocationOnRegister(live.register) - } else { - newLocation = c.pushRuntimeValueLocationOnRegister(live.register, live.valueType) - } - - if previouslyOnStack { - // This case, the location is on the temporary register. Therefore, - // we have to release the value there into the *new* memory location - // so that the tmp can be used for subsequent live value migrations. - c.compileReleaseRegisterToStack(newLocation) - } -} - -func getTemporariesForStackedLiveValues(c compiler, liveValues []runtimeValueLocation) (gpTmp, vecTmp asm.Register, err error) { - gpTmp, vecTmp = asm.NilRegister, asm.NilRegister - for i := range liveValues { - l := &liveValues[i] - if l.onStack() { - if rt := l.getRegisterType(); rt == registerTypeGeneralPurpose && gpTmp == asm.NilRegister { - gpTmp, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return - } - } else if rt == registerTypeVector && vecTmp == asm.NilRegister { - vecTmp, err = c.allocateRegister(registerTypeVector) - if err != nil { - return - } - } - } - } - return -} - -// dropsLivesForInclusiveRange returns the live and drop target values for the given wazeroir.InclusiveRange. -func (v *runtimeValueLocationStack) dropsLivesForInclusiveRange( - r wazeroir.InclusiveRange, -) (dropValues, liveValues []runtimeValueLocation) { - // liveValues are must be pushed backed after dropping the target range. - liveValues = v.stack[v.sp-uint64(r.Start) : v.sp] - // dropValues are the values on the drop target range. - dropValues = v.stack[v.sp-uint64(r.End)-1 : v.sp-uint64(r.Start)] - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_value_location.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_value_location.go deleted file mode 100644 index 30036fed1b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/compiler_value_location.go +++ /dev/null @@ -1,425 +0,0 @@ -package compiler - -import ( - "fmt" - "strings" - - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/wasm" -) - -var ( - // unreservedGeneralPurposeRegisters contains unreserved general purpose registers of integer type. - unreservedGeneralPurposeRegisters []asm.Register - - // unreservedVectorRegisters contains unreserved vector registers. - unreservedVectorRegisters []asm.Register -) - -func isGeneralPurposeRegister(r asm.Register) bool { - return unreservedGeneralPurposeRegisters[0] <= r && r <= unreservedGeneralPurposeRegisters[len(unreservedGeneralPurposeRegisters)-1] -} - -func isVectorRegister(r asm.Register) bool { - return unreservedVectorRegisters[0] <= r && r <= unreservedVectorRegisters[len(unreservedVectorRegisters)-1] -} - -// runtimeValueLocation corresponds to each variable pushed onto the wazeroir (virtual) stack, -// and it has the information about where it exists in the physical machine. -// It might exist in registers, or maybe on in the non-virtual physical stack allocated in memory. -type runtimeValueLocation struct { - valueType runtimeValueType - // register is set to asm.NilRegister if the value is stored in the memory stack. - register asm.Register - // conditionalRegister is set to conditionalRegisterStateUnset if the value is not on the conditional register. - conditionalRegister asm.ConditionalRegisterState - // stackPointer is the location of this value in the memory stack at runtime, - stackPointer uint64 -} - -func (v *runtimeValueLocation) getRegisterType() (ret registerType) { - switch v.valueType { - case runtimeValueTypeI32, runtimeValueTypeI64: - ret = registerTypeGeneralPurpose - case runtimeValueTypeF32, runtimeValueTypeF64, - runtimeValueTypeV128Lo, runtimeValueTypeV128Hi: - ret = registerTypeVector - default: - panic("BUG") - } - return -} - -type runtimeValueType byte - -const ( - runtimeValueTypeNone runtimeValueType = iota - runtimeValueTypeI32 - runtimeValueTypeI64 - runtimeValueTypeF32 - runtimeValueTypeF64 - runtimeValueTypeV128Lo - runtimeValueTypeV128Hi -) - -func (r runtimeValueType) String() (ret string) { - switch r { - case runtimeValueTypeI32: - ret = "i32" - case runtimeValueTypeI64: - ret = "i64" - case runtimeValueTypeF32: - ret = "f32" - case runtimeValueTypeF64: - ret = "f64" - case runtimeValueTypeV128Lo: - ret = "v128.lo" - case runtimeValueTypeV128Hi: - ret = "v128.hi" - } - return -} - -func (v *runtimeValueLocation) setRegister(reg asm.Register) { - v.register = reg - v.conditionalRegister = asm.ConditionalRegisterStateUnset -} - -func (v *runtimeValueLocation) onRegister() bool { - return v.register != asm.NilRegister && v.conditionalRegister == asm.ConditionalRegisterStateUnset -} - -func (v *runtimeValueLocation) onStack() bool { - return v.register == asm.NilRegister && v.conditionalRegister == asm.ConditionalRegisterStateUnset -} - -func (v *runtimeValueLocation) onConditionalRegister() bool { - return v.conditionalRegister != asm.ConditionalRegisterStateUnset -} - -func (v *runtimeValueLocation) String() string { - var location string - if v.onStack() { - location = fmt.Sprintf("stack(%d)", v.stackPointer) - } else if v.onConditionalRegister() { - location = fmt.Sprintf("conditional(%d)", v.conditionalRegister) - } else if v.onRegister() { - location = fmt.Sprintf("register(%s)", registerNameFn(v.register)) - } - return fmt.Sprintf("{type=%s,location=%s}", v.valueType, location) -} - -func newRuntimeValueLocationStack() runtimeValueLocationStack { - return runtimeValueLocationStack{ - unreservedVectorRegisters: unreservedVectorRegisters, - unreservedGeneralPurposeRegisters: unreservedGeneralPurposeRegisters, - } -} - -// runtimeValueLocationStack represents the wazeroir virtual stack -// where each item holds the location information about where it exists -// on the physical machine at runtime. -// -// Notably this is only used in the compilation phase, not runtime, -// and we change the state of this struct at every wazeroir operation we compile. -// In this way, we can see where the operands of an operation (for example, -// two variables for wazeroir add operation.) exist and check the necessity for -// moving the variable to registers to perform actual CPU instruction -// to achieve wazeroir's add operation. -type runtimeValueLocationStack struct { - // stack holds all the variables. - stack []runtimeValueLocation - // sp is the current stack pointer. - sp uint64 - // usedRegisters is the bit map to track the used registers. - usedRegisters usedRegistersMask - // stackPointerCeil tracks max(.sp) across the lifespan of this struct. - stackPointerCeil uint64 - // unreservedGeneralPurposeRegisters and unreservedVectorRegisters hold - // architecture dependent unreserved register list. - unreservedGeneralPurposeRegisters, unreservedVectorRegisters []asm.Register -} - -func (v *runtimeValueLocationStack) reset() { - stack := v.stack[:0] - *v = runtimeValueLocationStack{ - unreservedVectorRegisters: unreservedVectorRegisters, - unreservedGeneralPurposeRegisters: unreservedGeneralPurposeRegisters, - stack: stack, - } -} - -func (v *runtimeValueLocationStack) String() string { - var stackStr []string - for i := uint64(0); i < v.sp; i++ { - stackStr = append(stackStr, v.stack[i].String()) - } - usedRegisters := v.usedRegisters.list() - return fmt.Sprintf("sp=%d, stack=[%s], used_registers=[%s]", v.sp, strings.Join(stackStr, ","), strings.Join(usedRegisters, ",")) -} - -// cloneFrom clones the values on `from` into self except for the slice of .stack field. -// The content on .stack will be copied from the origin to self, and grow the underlying slice -// if necessary. -func (v *runtimeValueLocationStack) cloneFrom(from runtimeValueLocationStack) { - // Assigns the same values for fields except for the stack which we want to reuse. - prev := v.stack - *v = from - v.stack = prev[:cap(prev)] // Expand the length to the capacity so that we can minimize "diff" below. - // Copy the content in the stack. - if diff := int(from.sp) - len(v.stack); diff > 0 { - v.stack = append(v.stack, make([]runtimeValueLocation, diff)...) - } - copy(v.stack, from.stack[:from.sp]) -} - -// pushRuntimeValueLocationOnRegister creates a new runtimeValueLocation with a given register and pushes onto -// the location stack. -func (v *runtimeValueLocationStack) pushRuntimeValueLocationOnRegister(reg asm.Register, vt runtimeValueType) (loc *runtimeValueLocation) { - loc = v.push(reg, asm.ConditionalRegisterStateUnset) - loc.valueType = vt - return -} - -// pushRuntimeValueLocationOnRegister creates a new runtimeValueLocation and pushes onto the location stack. -func (v *runtimeValueLocationStack) pushRuntimeValueLocationOnStack() (loc *runtimeValueLocation) { - loc = v.push(asm.NilRegister, asm.ConditionalRegisterStateUnset) - loc.valueType = runtimeValueTypeNone - return -} - -// pushRuntimeValueLocationOnRegister creates a new runtimeValueLocation with a given conditional register state -// and pushes onto the location stack. -func (v *runtimeValueLocationStack) pushRuntimeValueLocationOnConditionalRegister(state asm.ConditionalRegisterState) (loc *runtimeValueLocation) { - loc = v.push(asm.NilRegister, state) - loc.valueType = runtimeValueTypeI32 - return -} - -// push a runtimeValueLocation onto the stack. -func (v *runtimeValueLocationStack) push(reg asm.Register, conditionalRegister asm.ConditionalRegisterState) (ret *runtimeValueLocation) { - if v.sp >= uint64(len(v.stack)) { - // This case we need to grow the stack capacity by appending the item, - // rather than indexing. - v.stack = append(v.stack, runtimeValueLocation{}) - } - ret = &v.stack[v.sp] - ret.register, ret.conditionalRegister, ret.stackPointer = reg, conditionalRegister, v.sp - v.sp++ - // stackPointerCeil must be set after sp is incremented since - // we skip the stack grow if len(stack) >= basePointer+stackPointerCeil. - if v.sp > v.stackPointerCeil { - v.stackPointerCeil = v.sp - } - return -} - -func (v *runtimeValueLocationStack) pop() (loc *runtimeValueLocation) { - v.sp-- - loc = &v.stack[v.sp] - return -} - -func (v *runtimeValueLocationStack) popV128() (loc *runtimeValueLocation) { - v.sp -= 2 - loc = &v.stack[v.sp] - return -} - -func (v *runtimeValueLocationStack) peek() (loc *runtimeValueLocation) { - loc = &v.stack[v.sp-1] - return -} - -func (v *runtimeValueLocationStack) releaseRegister(loc *runtimeValueLocation) { - v.markRegisterUnused(loc.register) - loc.register = asm.NilRegister - loc.conditionalRegister = asm.ConditionalRegisterStateUnset -} - -func (v *runtimeValueLocationStack) markRegisterUnused(regs ...asm.Register) { - for _, reg := range regs { - v.usedRegisters.remove(reg) - } -} - -func (v *runtimeValueLocationStack) markRegisterUsed(regs ...asm.Register) { - for _, reg := range regs { - v.usedRegisters.add(reg) - } -} - -type registerType byte - -const ( - registerTypeGeneralPurpose registerType = iota - // registerTypeVector represents a vector register which can be used for either scalar float - // operation or SIMD vector operation depending on the instruction by which the register is used. - // - // Note: In normal assembly language, scalar float and vector register have different notations as - // Vn is for vectors and Qn is for scalar floats on arm64 for example. But on physical hardware, - // they are placed on the same locations. (Qn means the lower 64-bit of Vn vector register on arm64). - // - // In wazero, for the sake of simplicity in the register allocation, we intentionally conflate these two types - // and delegate the decision to the assembler which is aware of the instruction types for which these registers are used. - registerTypeVector -) - -func (tp registerType) String() (ret string) { - switch tp { - case registerTypeGeneralPurpose: - ret = "int" - case registerTypeVector: - ret = "vector" - } - return -} - -// takeFreeRegister searches for unused registers. Any found are marked used and returned. -func (v *runtimeValueLocationStack) takeFreeRegister(tp registerType) (reg asm.Register, found bool) { - var targetRegs []asm.Register - switch tp { - case registerTypeVector: - targetRegs = v.unreservedVectorRegisters - case registerTypeGeneralPurpose: - targetRegs = v.unreservedGeneralPurposeRegisters - } - for _, candidate := range targetRegs { - if v.usedRegisters.exist(candidate) { - continue - } - return candidate, true - } - return 0, false -} - -// Search through the stack, and steal the register from the last used -// variable on the stack. -func (v *runtimeValueLocationStack) takeStealTargetFromUsedRegister(tp registerType) (*runtimeValueLocation, bool) { - for i := uint64(0); i < v.sp; i++ { - loc := &v.stack[i] - if loc.onRegister() { - switch tp { - case registerTypeVector: - if loc.valueType == runtimeValueTypeV128Hi { - panic("BUG: V128Hi must be above the corresponding V128Lo") - } - if isVectorRegister(loc.register) { - return loc, true - } - case registerTypeGeneralPurpose: - if isGeneralPurposeRegister(loc.register) { - return loc, true - } - } - } - } - return nil, false -} - -// init sets up the runtimeValueLocationStack which reflects the state of -// the stack at the beginning of the function. -// -// See the diagram in callEngine.stack. -func (v *runtimeValueLocationStack) init(sig *wasm.FunctionType) { - for _, t := range sig.Params { - loc := v.pushRuntimeValueLocationOnStack() - switch t { - case wasm.ValueTypeI32: - loc.valueType = runtimeValueTypeI32 - case wasm.ValueTypeI64, wasm.ValueTypeFuncref, wasm.ValueTypeExternref: - loc.valueType = runtimeValueTypeI64 - case wasm.ValueTypeF32: - loc.valueType = runtimeValueTypeF32 - case wasm.ValueTypeF64: - loc.valueType = runtimeValueTypeF64 - case wasm.ValueTypeV128: - loc.valueType = runtimeValueTypeV128Lo - hi := v.pushRuntimeValueLocationOnStack() - hi.valueType = runtimeValueTypeV128Hi - default: - panic("BUG") - } - } - - // If the len(results) > len(args), the slots for all results are reserved after - // arguments, so we reflect that into the location stack. - for i := 0; i < sig.ResultNumInUint64-sig.ParamNumInUint64; i++ { - _ = v.pushRuntimeValueLocationOnStack() - } - - // Then push the control frame fields. - for i := 0; i < callFrameDataSizeInUint64; i++ { - loc := v.pushRuntimeValueLocationOnStack() - loc.valueType = runtimeValueTypeI64 - } -} - -// getCallFrameLocations returns each field of callFrame's runtime location. -// -// See the diagram in callEngine.stack. -func (v *runtimeValueLocationStack) getCallFrameLocations(sig *wasm.FunctionType) ( - returnAddress, callerStackBasePointerInBytes, callerFunction *runtimeValueLocation, -) { - offset := callFrameOffset(sig) - return &v.stack[offset], &v.stack[offset+1], &v.stack[offset+2] -} - -// pushCallFrame pushes a call frame's runtime locations onto the stack assuming that -// the function call parameters are already pushed there. -// -// See the diagram in callEngine.stack. -func (v *runtimeValueLocationStack) pushCallFrame(callTargetFunctionType *wasm.FunctionType) ( - returnAddress, callerStackBasePointerInBytes, callerFunction *runtimeValueLocation, -) { - // If len(results) > len(args), we reserve the slots for the results below the call frame. - reservedSlotsBeforeCallFrame := callTargetFunctionType.ResultNumInUint64 - callTargetFunctionType.ParamNumInUint64 - for i := 0; i < reservedSlotsBeforeCallFrame; i++ { - v.pushRuntimeValueLocationOnStack() - } - - // Push the runtime location for each field of callFrame struct. Note that each of them has - // uint64 type, and therefore must be treated as runtimeValueTypeI64. - - // callFrame.returnAddress - returnAddress = v.pushRuntimeValueLocationOnStack() - returnAddress.valueType = runtimeValueTypeI64 - // callFrame.returnStackBasePointerInBytes - callerStackBasePointerInBytes = v.pushRuntimeValueLocationOnStack() - callerStackBasePointerInBytes.valueType = runtimeValueTypeI64 - // callFrame.function - callerFunction = v.pushRuntimeValueLocationOnStack() - callerFunction.valueType = runtimeValueTypeI64 - return -} - -// usedRegistersMask tracks the used registers in its bits. -type usedRegistersMask uint64 - -// add adds the given `r` to the mask. -func (u *usedRegistersMask) add(r asm.Register) { - *u = *u | (1 << registerMaskShift(r)) -} - -// remove drops the given `r` from the mask. -func (u *usedRegistersMask) remove(r asm.Register) { - *u = *u & ^(1 << registerMaskShift(r)) -} - -// exist returns true if the given `r` is used. -func (u *usedRegistersMask) exist(r asm.Register) bool { - shift := registerMaskShift(r) - return (*u & (1 << shift)) > 0 -} - -// list returns the list of debug string of used registers. -// Only used for debugging and testing. -func (u *usedRegistersMask) list() (ret []string) { - mask := *u - for i := 0; i < 64; i++ { - if mask&(1< 0 { - ret = append(ret, registerNameFn(registerFromMaskShift(i))) - } - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go deleted file mode 100644 index d5ec8e27b6..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine.go +++ /dev/null @@ -1,1563 +0,0 @@ -package compiler - -import ( - "context" - "errors" - "fmt" - "reflect" - "runtime" - "sort" - "sync" - "unsafe" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/experimental" - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/bitpack" - "github.com/tetratelabs/wazero/internal/filecache" - "github.com/tetratelabs/wazero/internal/internalapi" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/internal/version" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wasmdebug" - "github.com/tetratelabs/wazero/internal/wasmruntime" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// NOTE: The offset of many of the struct fields defined here are referenced from -// assembly using the constants below such as moduleEngineFunctionsOffset. -// If changing a struct, update the constant and associated tests as needed. -type ( - // engine is a Compiler implementation of wasm.Engine - engine struct { - enabledFeatures api.CoreFeatures - codes map[wasm.ModuleID]*compiledModule // guarded by mutex. - fileCache filecache.Cache - mux sync.RWMutex - // setFinalizer defaults to runtime.SetFinalizer, but overridable for tests. - setFinalizer func(obj interface{}, finalizer interface{}) - wazeroVersion string - } - - // moduleEngine implements wasm.ModuleEngine - moduleEngine struct { - // See note at top of file before modifying this struct. - - // functions are the functions in a module instances. - // The index is module instance-scoped. We intentionally avoid using map - // as the underlying memory region is accessed by assembly directly by using - // codesElement0Address. - functions []function - } - - // callEngine holds context per moduleEngine.Call, and shared across all the - // function calls originating from the same moduleEngine.Call execution. - // - // This implements api.Function. - callEngine struct { - internalapi.WazeroOnlyType - - // See note at top of file before modifying this struct. - - // These contexts are read and written by compiled code. - // Note: structs are embedded to reduce the costs to access fields inside them. Also, this eases field offset - // calculation. - moduleContext - stackContext - exitContext - archContext - - // The following fields are not accessed by compiled code directly. - - // stack is the go-allocated stack for holding values and call frames. - // Note: We never edit len or cap in compiled code, so we won't get screwed when GC comes in. - // - // At any point of execution, say currently executing function F2 which was called by F1, then - // the stack should look like like: - // - // [..., arg0, arg1, ..., argN, _, _, _, v1, v2, v3, .... - // ^ { } - // | F1's callFrame - // | - // stackBasePointer - // - // where - // - callFrame is the F1's callFrame which called F2. It contains F1's return address, F1's base pointer, and F1's *function. - // - stackBasePointer is the stack base pointer stored at (callEngine stackContext.stackBasePointerInBytes) - // - arg0, ..., argN are the function parameters, and v1, v2, v3,... are the local variables - // including the non-function param locals as well as the temporary variable produced by instructions (e.g i32.const). - // - // If the F2 makes a function call to F3 which takes two arguments, then the stack will become: - // - // [..., arg0, arg1, ..., argN, _, _, _, v1, v2, v3, _, _, _ - // { } ^ { } - // F1's callFrame | F2's callFrame - // | - // stackBasePointer - // where - // - F2's callFrame is pushed above the v2 and v3 (arguments for F3). - // - The previous stackBasePointer (pointed at arg0) was saved inside the F2's callFrame. - // - // Then, if F3 returns one result, say w1, then the result will look like: - // - // [..., arg0, arg1, ..., argN, _, _, _, v1, w1, ... - // ^ { } - // | F1's callFrame - // | - // stackBasePointer - // - // where - // - stackBasePointer was reverted to the position at arg0 - // - The result from F3 was pushed above v1 - // - // If the number of parameters is smaller than that of return values, then the empty slots are reserved - // below the callFrame to store the results on teh return. - // For example, if F3 takes no parameter but returns N(>0) results, then the stack - // after making a call against F3 will look like: - // - // [..., arg0, arg1, ..., argN, _, _, _, v1, v2, v3, res_1, _, res_N, _, _, _ - // { } ^ { } - // F1's callFrame | F2's callFrame - // | - // stackBasePointer - // where res_1, ..., res_N are the reserved slots below the call frame. In general, - // the number of reserved slots equals max(0, len(results)-len(params). - // - // This reserved slots are necessary to save the result values onto the stack while not destroying - // the callFrame value on function returns. - stack []uint64 - - // initialFn is the initial function for this call engine. - initialFn *function - - // stackIterator provides a way to iterate over the stack for Listeners. - // It is setup and valid only during a call to a Listener hook. - stackIterator stackIterator - - ensureTermination bool - } - - // moduleContext holds the per-function call specific module information. - // This is subject to be manipulated from compiled native code whenever we make function calls. - moduleContext struct { - // See note at top of file before modifying this struct. - - // fn holds the currently executed *function. - fn *function - - // moduleInstance is the address of module instance from which we initialize - // the following fields. This is set whenever we enter a function or return from function calls. - // - // On the entry to the native code, this must be initialized to zero to let native code preamble know - // that this is the initial function call (which leads to moduleContext initialization pass). - moduleInstance *wasm.ModuleInstance //lint:ignore U1000 This is only used by Compiler code. - - // globalElement0Address is the address of the first element in the global slice, - // i.e. &ModuleInstance.Globals[0] as uintptr. - globalElement0Address uintptr - // memoryElement0Address is the address of the first element in the global slice, - // i.e. &ModuleInstance.Memory.Buffer[0] as uintptr. - memoryElement0Address uintptr - // memorySliceLen is the length of the memory buffer, i.e. len(ModuleInstance.Memory.Buffer). - memorySliceLen uint64 - // memoryInstance holds the memory instance for this module instance. - memoryInstance *wasm.MemoryInstance - // tableElement0Address is the address of the first item in the tables slice, - // i.e. &ModuleInstance.Tables[0] as uintptr. - tablesElement0Address uintptr - - // functionsElement0Address is &moduleContext.functions[0] as uintptr. - functionsElement0Address uintptr - - // typeIDsElement0Address holds the &ModuleInstance.TypeIDs[0] as uintptr. - typeIDsElement0Address uintptr - - // dataInstancesElement0Address holds the &ModuleInstance.DataInstances[0] as uintptr. - dataInstancesElement0Address uintptr - - // elementInstancesElement0Address holds the &ModuleInstance.ElementInstances[0] as uintptr. - elementInstancesElement0Address uintptr - } - - // stackContext stores the data to access engine.stack. - stackContext struct { - // See note at top of file before modifying this struct. - - // stackPointer on .stack field which is accessed by stack[stackBasePointer+stackBasePointerInBytes*8]. - // - // Note: stackPointer is not used in assembly since the native code knows exact position of - // each variable in the value stack from the info from compilation. - // Therefore, only updated when native code exit from the Compiler world and go back to the Go function. - stackPointer uint64 - - // stackBasePointerInBytes is updated whenever we make function calls. - // Background: Functions might be compiled as if they use the stack from the bottom. - // However, in reality, they have to use it from the middle of the stack depending on - // when these function calls are made. So instead of accessing stack via stackPointer alone, - // functions are compiled, so they access the stack via [stackBasePointer](fixed for entire function) + [stackPointer]. - // More precisely, stackBasePointer is set to [callee's stack pointer] + [callee's stack base pointer] - [caller's params]. - // This way, compiled functions can be independent of the timing of functions calls made against them. - stackBasePointerInBytes uint64 - - // stackElement0Address is &engine.stack[0] as uintptr. - // Note: this is updated when growing the stack in builtinFunctionGrowStack. - stackElement0Address uintptr - - // stackLenInBytes is len(engine.stack[0]) * 8 (bytes). - // Note: this is updated when growing the stack in builtinFunctionGrowStack. - stackLenInBytes uint64 - } - - // exitContext will be manipulated whenever compiled native code returns into the Go function. - exitContext struct { - // See note at top of file before modifying this struct. - - // Where we store the status code of Compiler execution. - statusCode nativeCallStatusCode - - // Set when statusCode == compilerStatusCallBuiltInFunction - // Indicating the function call index. - builtinFunctionCallIndex wasm.Index - - // returnAddress is the return address which the engine jumps into - // after executing a builtin function or host function. - returnAddress uintptr - - // callerModuleInstance holds the caller's wasm.ModuleInstance, and is only valid if currently executing a host function. - callerModuleInstance *wasm.ModuleInstance - } - - // callFrame holds the information to which the caller function can return. - // This is mixed in callEngine.stack with other Wasm values just like any other - // native program (where the stack is the system stack though), and we retrieve the struct - // with unsafe pointer casts. - callFrame struct { - // See note at top of file before modifying this struct. - - // returnAddress is the return address to which the engine jumps when the callee function returns. - returnAddress uintptr - // returnStackBasePointerInBytes is the stack base pointer to set on stackContext.stackBasePointerInBytes - // when the callee function returns. - returnStackBasePointerInBytes uint64 - // function is the caller *function, and is used to retrieve the stack trace. - // Note: should be possible to revive *function from returnAddress, but might be costly. - function *function - } - - // Function corresponds to function instance in Wasm, and is created from `code`. - function struct { - // See note at top of file before modifying this struct. - - // codeInitialAddress is the pre-calculated pointer pointing to the initial byte of .codeSegment slice. - // That mean codeInitialAddress always equals uintptr(unsafe.Pointer(&.codeSegment[0])) - // and we cache the value (uintptr(unsafe.Pointer(&.codeSegment[0]))) to this field, - // so we don't need to repeat the calculation on each function call. - codeInitialAddress uintptr - // moduleInstance holds the address of source.ModuleInstance. - moduleInstance *wasm.ModuleInstance - // typeID is the corresponding wasm.FunctionTypeID for funcType. - typeID wasm.FunctionTypeID - // funcType is the function type for this function. Created during compilation. - funcType *wasm.FunctionType - // parent holds code from which this is created. - parent *compiledFunction - } - - compiledModule struct { - executable asm.CodeSegment - functions []compiledFunction - source *wasm.Module - ensureTermination bool - } - - // compiledFunction corresponds to a function in a module (not instantiated one). This holds the machine code - // compiled by wazero compiler. - compiledFunction struct { - // codeSegment is holding the compiled native code as a byte slice. - executableOffset uintptr - // See the doc for codeStaticData type. - // stackPointerCeil is the max of the stack pointer this function can reach. Lazily applied via maybeGrowStack. - stackPointerCeil uint64 - - index wasm.Index - goFunc interface{} - listener experimental.FunctionListener - parent *compiledModule - sourceOffsetMap sourceOffsetMap - } - - // sourceOffsetMap holds the information to retrieve the original offset in - // the Wasm binary from the offset in the native binary. - // - // The fields are implemented as bit-packed arrays of 64 bits integers to - // reduce the memory footprint. Indexing into such arrays is not as fast as - // indexing into a simple slice, but the source offset map is intended to be - // used for debugging, lookups into the arrays should not appear on code - // paths that are critical to the application performance. - // - // The bitpack.OffsetArray fields may be nil, use bitpack.OffsetArrayLen to - // determine whether they are empty prior to indexing into the arrays to - // avoid panics caused by accessing nil pointers. - sourceOffsetMap struct { - // See note at top of file before modifying this struct. - - // irOperationOffsetsInNativeBinary is index-correlated with irOperationSourceOffsetsInWasmBinary, - // and maps each index (corresponding to each IR Operation) to the offset in the compiled native code. - irOperationOffsetsInNativeBinary bitpack.OffsetArray - // irOperationSourceOffsetsInWasmBinary is index-correlated with irOperationOffsetsInNativeBinary. - // See wazeroir.CompilationResult irOperationOffsetsInNativeBinary. - irOperationSourceOffsetsInWasmBinary bitpack.OffsetArray - } - - // functionListenerInvocation captures arguments needed to perform function - // listener invocations when unwinding the call stack. - functionListenerInvocation struct { - experimental.FunctionListener - def api.FunctionDefinition - } -) - -// Native code reads/writes Go's structs with the following constants. -// See TestVerifyOffsetValue for how to derive these values. -const ( - // Offsets for moduleEngine.functions - moduleEngineFunctionsOffset = 0 - - // Offsets for callEngine moduleContext. - callEngineModuleContextFnOffset = 0 - callEngineModuleContextModuleInstanceOffset = 8 - callEngineModuleContextGlobalElement0AddressOffset = 16 - callEngineModuleContextMemoryElement0AddressOffset = 24 - callEngineModuleContextMemorySliceLenOffset = 32 - callEngineModuleContextMemoryInstanceOffset = 40 - callEngineModuleContextTablesElement0AddressOffset = 48 - callEngineModuleContextFunctionsElement0AddressOffset = 56 - callEngineModuleContextTypeIDsElement0AddressOffset = 64 - callEngineModuleContextDataInstancesElement0AddressOffset = 72 - callEngineModuleContextElementInstancesElement0AddressOffset = 80 - - // Offsets for callEngine stackContext. - callEngineStackContextStackPointerOffset = 88 - callEngineStackContextStackBasePointerInBytesOffset = 96 - callEngineStackContextStackElement0AddressOffset = 104 - callEngineStackContextStackLenInBytesOffset = 112 - - // Offsets for callEngine exitContext. - callEngineExitContextNativeCallStatusCodeOffset = 120 - callEngineExitContextBuiltinFunctionCallIndexOffset = 124 - callEngineExitContextReturnAddressOffset = 128 - callEngineExitContextCallerModuleInstanceOffset = 136 - - // Offsets for function. - functionCodeInitialAddressOffset = 0 - functionModuleInstanceOffset = 8 - functionTypeIDOffset = 16 - functionSize = 40 - - // Offsets for wasm.ModuleInstance. - moduleInstanceGlobalsOffset = 32 - moduleInstanceMemoryOffset = 56 - moduleInstanceTablesOffset = 64 - moduleInstanceEngineOffset = 88 - moduleInstanceTypeIDsOffset = 104 - moduleInstanceDataInstancesOffset = 128 - moduleInstanceElementInstancesOffset = 152 - - // Offsets for wasm.TableInstance. - tableInstanceTableOffset = 0 - tableInstanceTableLenOffset = 8 - - // Offsets for wasm.MemoryInstance. - memoryInstanceBufferOffset = 0 - memoryInstanceBufferLenOffset = 8 - - // Offsets for wasm.GlobalInstance. - globalInstanceValueOffset = 8 - - // Offsets for Go's interface. - // https://research.swtch.com/interfaces - // https://github.com/golang/go/blob/release-branch.go1.20/src/runtime/runtime2.go#L207-L210 - interfaceDataOffset = 8 - - // Consts for wasm.DataInstance. - dataInstanceStructSize = 24 - - // Consts for wasm.ElementInstance. - elementInstanceStructSize = 32 - - // pointerSizeLog2 satisfies: 1 << pointerSizeLog2 = sizeOf(uintptr) - pointerSizeLog2 = 3 - - // callFrameDataSizeInUint64 is the size of callFrame struct per 8 bytes (= size of uint64). - callFrameDataSizeInUint64 = 24 / 8 -) - -// nativeCallStatusCode represents the result of `nativecall`. -// This is set by the native code. -type nativeCallStatusCode uint32 - -const ( - // nativeCallStatusCodeReturned means the nativecall reaches the end of function, and returns successfully. - nativeCallStatusCodeReturned nativeCallStatusCode = iota - // nativeCallStatusCodeCallGoHostFunction means the nativecall returns to make a host function call. - nativeCallStatusCodeCallGoHostFunction - // nativeCallStatusCodeCallBuiltInFunction means the nativecall returns to make a builtin function call. - nativeCallStatusCodeCallBuiltInFunction - // nativeCallStatusCodeUnreachable means the function invocation reaches "unreachable" instruction. - nativeCallStatusCodeUnreachable - // nativeCallStatusCodeInvalidFloatToIntConversion means an invalid conversion of integer to floats happened. - nativeCallStatusCodeInvalidFloatToIntConversion - // nativeCallStatusCodeMemoryOutOfBounds means an out-of-bounds memory access happened. - nativeCallStatusCodeMemoryOutOfBounds - // nativeCallStatusCodeInvalidTableAccess means either offset to the table was out of bounds of table, or - // the target element in the table was uninitialized during call_indirect instruction. - nativeCallStatusCodeInvalidTableAccess - // nativeCallStatusCodeTypeMismatchOnIndirectCall means the type check failed during call_indirect. - nativeCallStatusCodeTypeMismatchOnIndirectCall - nativeCallStatusIntegerOverflow - nativeCallStatusIntegerDivisionByZero - nativeCallStatusModuleClosed -) - -// causePanic causes a panic with the corresponding error to the nativeCallStatusCode. -func (s nativeCallStatusCode) causePanic() { - var err error - switch s { - case nativeCallStatusIntegerOverflow: - err = wasmruntime.ErrRuntimeIntegerOverflow - case nativeCallStatusIntegerDivisionByZero: - err = wasmruntime.ErrRuntimeIntegerDivideByZero - case nativeCallStatusCodeInvalidFloatToIntConversion: - err = wasmruntime.ErrRuntimeInvalidConversionToInteger - case nativeCallStatusCodeUnreachable: - err = wasmruntime.ErrRuntimeUnreachable - case nativeCallStatusCodeMemoryOutOfBounds: - err = wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess - case nativeCallStatusCodeInvalidTableAccess: - err = wasmruntime.ErrRuntimeInvalidTableAccess - case nativeCallStatusCodeTypeMismatchOnIndirectCall: - err = wasmruntime.ErrRuntimeIndirectCallTypeMismatch - } - panic(err) -} - -func (s nativeCallStatusCode) String() (ret string) { - switch s { - case nativeCallStatusCodeReturned: - ret = "returned" - case nativeCallStatusCodeCallGoHostFunction: - ret = "call_host_function" - case nativeCallStatusCodeCallBuiltInFunction: - ret = "call_builtin_function" - case nativeCallStatusCodeUnreachable: - ret = "unreachable" - case nativeCallStatusCodeInvalidFloatToIntConversion: - ret = "invalid float to int conversion" - case nativeCallStatusCodeMemoryOutOfBounds: - ret = "memory out of bounds" - case nativeCallStatusCodeInvalidTableAccess: - ret = "invalid table access" - case nativeCallStatusCodeTypeMismatchOnIndirectCall: - ret = "type mismatch on indirect call" - case nativeCallStatusIntegerOverflow: - ret = "integer overflow" - case nativeCallStatusIntegerDivisionByZero: - ret = "integer division by zero" - case nativeCallStatusModuleClosed: - ret = "module closed" - default: - panic("BUG") - } - return -} - -// releaseCompiledModule is a runtime.SetFinalizer function that munmaps the compiledModule.executable. -func releaseCompiledModule(cm *compiledModule) { - if err := cm.executable.Unmap(); err != nil { - // munmap failure cannot recover, and happen asynchronously on the - // finalizer thread. While finalizer functions can return errors, - // they are ignored. - panic(fmt.Errorf("compiler: failed to munmap code segment: %w", err)) - } -} - -// CompiledModuleCount implements the same method as documented on wasm.Engine. -func (e *engine) CompiledModuleCount() uint32 { - return uint32(len(e.codes)) -} - -// DeleteCompiledModule implements the same method as documented on wasm.Engine. -func (e *engine) DeleteCompiledModule(module *wasm.Module) { - e.deleteCompiledModule(module) -} - -// Close implements the same method as documented on wasm.Engine. -func (e *engine) Close() (err error) { - e.mux.Lock() - defer e.mux.Unlock() - // Releasing the references to compiled codes including the memory-mapped machine codes. - e.codes = nil - return -} - -// CompileModule implements the same method as documented on wasm.Engine. -func (e *engine) CompileModule(_ context.Context, module *wasm.Module, listeners []experimental.FunctionListener, ensureTermination bool) error { - if _, ok, err := e.getCompiledModule(module, listeners); ok { // cache hit! - return nil - } else if err != nil { - return err - } - - irCompiler, err := wazeroir.NewCompiler(e.enabledFeatures, callFrameDataSizeInUint64, module, ensureTermination) - if err != nil { - return err - } - - var withGoFunc bool - localFuncs, importedFuncs := len(module.FunctionSection), module.ImportFunctionCount - cm := &compiledModule{ - functions: make([]compiledFunction, localFuncs), - ensureTermination: ensureTermination, - source: module, - } - - if localFuncs == 0 { - return e.addCompiledModule(module, cm, withGoFunc) - } - - // As this uses mmap, we need to munmap on the compiled machine code when it's GCed. - e.setFinalizer(cm, releaseCompiledModule) - ln := len(listeners) - cmp := newCompiler() - asmNodes := new(asmNodes) - offsets := new(offsets) - - // The executable code is allocated in memory mappings held by the - // CodeSegment, which gros on demand when it exhausts its capacity. - var executable asm.CodeSegment - defer func() { - // At the end of the function, the executable is set on the compiled - // module and the local variable cleared; until then, the function owns - // the memory mapping and is reponsible for clearing it if it returns - // due to an error. Note that an error at this stage is not recoverable - // so we panic if we fail to unmap the memory segment. - if err := executable.Unmap(); err != nil { - panic(fmt.Errorf("compiler: failed to munmap code segment: %w", err)) - } - }() - - for i := range module.CodeSection { - typ := &module.TypeSection[module.FunctionSection[i]] - buf := executable.NextCodeSection() - funcIndex := wasm.Index(i) - compiledFn := &cm.functions[i] - compiledFn.executableOffset = executable.Size() - compiledFn.parent = cm - compiledFn.index = importedFuncs + funcIndex - if i < ln { - compiledFn.listener = listeners[i] - } - - if codeSeg := &module.CodeSection[i]; codeSeg.GoFunc != nil { - cmp.Init(typ, nil, compiledFn.listener != nil) - withGoFunc = true - if err = compileGoDefinedHostFunction(buf, cmp); err != nil { - def := module.FunctionDefinition(compiledFn.index) - return fmt.Errorf("error compiling host go func[%s]: %w", def.DebugName(), err) - } - compiledFn.goFunc = codeSeg.GoFunc - } else { - ir, err := irCompiler.Next() - if err != nil { - return fmt.Errorf("failed to lower func[%d]: %v", i, err) - } - cmp.Init(typ, ir, compiledFn.listener != nil) - - compiledFn.stackPointerCeil, compiledFn.sourceOffsetMap, err = compileWasmFunction(buf, cmp, ir, asmNodes, offsets) - if err != nil { - def := module.FunctionDefinition(compiledFn.index) - return fmt.Errorf("error compiling wasm func[%s]: %w", def.DebugName(), err) - } - } - } - - if runtime.GOARCH == "arm64" { - // On arm64, we cannot give all of rwx at the same time, so we change it to exec. - if err := platform.MprotectRX(executable.Bytes()); err != nil { - return err - } - } - cm.executable, executable = executable, asm.CodeSegment{} - return e.addCompiledModule(module, cm, withGoFunc) -} - -// NewModuleEngine implements the same method as documented on wasm.Engine. -func (e *engine) NewModuleEngine(module *wasm.Module, instance *wasm.ModuleInstance) (wasm.ModuleEngine, error) { - me := &moduleEngine{ - functions: make([]function, len(module.FunctionSection)+int(module.ImportFunctionCount)), - } - - // Note: imported functions are resolved in moduleEngine.ResolveImportedFunction. - - cm, ok, err := e.getCompiledModule(module, - // listeners arg is not needed here since NewModuleEngine is called after CompileModule which - // ensures the association of listener with *code. - nil) - if !ok { - return nil, errors.New("source module must be compiled before instantiation") - } else if err != nil { - return nil, err - } - - for i := range cm.functions { - c := &cm.functions[i] - offset := int(module.ImportFunctionCount) + i - typeIndex := module.FunctionSection[i] - me.functions[offset] = function{ - codeInitialAddress: cm.executable.Addr() + c.executableOffset, - moduleInstance: instance, - typeID: instance.TypeIDs[typeIndex], - funcType: &module.TypeSection[typeIndex], - parent: c, - } - } - return me, nil -} - -// ResolveImportedFunction implements wasm.ModuleEngine. -func (e *moduleEngine) ResolveImportedFunction(index, indexInImportedModule wasm.Index, importedModuleEngine wasm.ModuleEngine) { - imported := importedModuleEngine.(*moduleEngine) - // Copies the content from the import target moduleEngine. - e.functions[index] = imported.functions[indexInImportedModule] -} - -// FunctionInstanceReference implements the same method as documented on wasm.ModuleEngine. -func (e *moduleEngine) FunctionInstanceReference(funcIndex wasm.Index) wasm.Reference { - return uintptr(unsafe.Pointer(&e.functions[funcIndex])) -} - -// NewFunction implements wasm.ModuleEngine. -func (e *moduleEngine) NewFunction(index wasm.Index) api.Function { - return e.newFunction(&e.functions[index]) -} - -func (e *moduleEngine) newFunction(f *function) api.Function { - initStackSize := initialStackSize - if initialStackSize < f.parent.stackPointerCeil { - initStackSize = f.parent.stackPointerCeil * 2 - } - return e.newCallEngine(initStackSize, f) -} - -// LookupFunction implements the same method as documented on wasm.ModuleEngine. -func (e *moduleEngine) LookupFunction(t *wasm.TableInstance, typeId wasm.FunctionTypeID, tableOffset wasm.Index) (f api.Function, err error) { - if tableOffset >= uint32(len(t.References)) || t.Type != wasm.RefTypeFuncref { - err = wasmruntime.ErrRuntimeInvalidTableAccess - return - } - rawPtr := t.References[tableOffset] - if rawPtr == 0 { - err = wasmruntime.ErrRuntimeInvalidTableAccess - return - } - - tf := functionFromUintptr(rawPtr) - if tf.typeID != typeId { - err = wasmruntime.ErrRuntimeIndirectCallTypeMismatch - return - } - f = e.newFunction(tf) - return -} - -// functionFromUintptr resurrects the original *function from the given uintptr -// which comes from either funcref table or OpcodeRefFunc instruction. -func functionFromUintptr(ptr uintptr) *function { - // Wraps ptrs as the double pointer in order to avoid the unsafe access as detected by race detector. - // - // For example, if we have (*function)(unsafe.Pointer(ptr)) instead, then the race detector's "checkptr" - // subroutine wanrs as "checkptr: pointer arithmetic result points to invalid allocation" - // https://github.com/golang/go/blob/1ce7fcf139417d618c2730010ede2afb41664211/src/runtime/checkptr.go#L69 - var wrapped *uintptr = &ptr - return *(**function)(unsafe.Pointer(wrapped)) -} - -// Definition implements the same method as documented on wasm.ModuleEngine. -func (ce *callEngine) Definition() api.FunctionDefinition { - return ce.initialFn.definition() -} - -func (f *function) definition() api.FunctionDefinition { - compiled := f.parent - return compiled.parent.source.FunctionDefinition(compiled.index) -} - -// Call implements the same method as documented on wasm.ModuleEngine. -func (ce *callEngine) Call(ctx context.Context, params ...uint64) (results []uint64, err error) { - ft := ce.initialFn.funcType - if n := ft.ParamNumInUint64; n != len(params) { - return nil, fmt.Errorf("expected %d params, but passed %d", n, len(params)) - } - return ce.call(ctx, params, nil) -} - -// CallWithStack implements the same method as documented on wasm.ModuleEngine. -func (ce *callEngine) CallWithStack(ctx context.Context, stack []uint64) error { - params, results, err := wasm.SplitCallStack(ce.initialFn.funcType, stack) - if err != nil { - return err - } - _, err = ce.call(ctx, params, results) - return err -} - -func (ce *callEngine) call(ctx context.Context, params, results []uint64) (_ []uint64, err error) { - m := ce.initialFn.moduleInstance - if ce.ensureTermination { - select { - case <-ctx.Done(): - // If the provided context is already done, close the call context - // and return the error. - m.CloseWithCtxErr(ctx) - return nil, m.FailIfClosed() - default: - } - } - - // We ensure that this Call method never panics as - // this Call method is indirectly invoked by embedders via store.CallFunction, - // and we have to make sure that all the runtime errors, including the one happening inside - // host functions, will be captured as errors, not panics. - defer func() { - err = ce.deferredOnCall(ctx, m, recover()) - if err == nil { - // If the module closed during the call, and the call didn't err for another reason, set an ExitError. - err = m.FailIfClosed() - } - }() - - ft := ce.initialFn.funcType - ce.initializeStack(ft, params) - - if ce.ensureTermination { - done := m.CloseModuleOnCanceledOrTimeout(ctx) - defer done() - } - - ce.execWasmFunction(ctx, m) - - // This returns a safe copy of the results, instead of a slice view. If we - // returned a re-slice, the caller could accidentally or purposefully - // corrupt the stack of subsequent calls. - if results == nil && ft.ResultNumInUint64 > 0 { - results = make([]uint64, ft.ResultNumInUint64) - } - copy(results, ce.stack) - return results, nil -} - -// initializeStack initializes callEngine.stack before entering native code. -// -// The stack must look like, if len(params) < len(results): -// -// [arg0, arg1, ..., argN, 0, 0, 0, ... -// { } ^ -// callFrame | -// | -// stackPointer -// -// else: -// -// [arg0, arg1, ..., argN, _, _, _, 0, 0, 0, ... -// | | { } ^ -// |reserved| callFrame | -// | | | -// |--------> stackPointer -// len(results)-len(params) -// -// where we reserve the slots below the callframe with the length len(results)-len(params). -// -// Note: callFrame { } is zeroed to indicate that the initial "caller" is this callEngine, not the Wasm function. -// -// See callEngine.stack as well. -func (ce *callEngine) initializeStack(tp *wasm.FunctionType, args []uint64) { - for _, v := range args { - ce.pushValue(v) - } - - ce.stackPointer = uint64(callFrameOffset(tp)) - - for i := 0; i < callFrameDataSizeInUint64; i++ { - ce.stack[ce.stackPointer] = 0 - ce.stackPointer++ - } -} - -// callFrameOffset returns the offset of the call frame from the stack base pointer. -// -// See the diagram in callEngine.stack. -func callFrameOffset(funcType *wasm.FunctionType) (ret int) { - ret = funcType.ResultNumInUint64 - if ret < funcType.ParamNumInUint64 { - ret = funcType.ParamNumInUint64 - } - return -} - -// deferredOnCall takes the recovered value `recovered`, and wraps it -// with the call frame stack traces when not nil. This also resets -// the state of callEngine so that it can be used for the subsequent calls. -// -// This is defined for testability. -func (ce *callEngine) deferredOnCall(ctx context.Context, m *wasm.ModuleInstance, recovered interface{}) (err error) { - if recovered != nil { - builder := wasmdebug.NewErrorBuilder() - - // Unwinds call frames from the values stack, starting from the - // current function `ce.fn`, and the current stack base pointer `ce.stackBasePointerInBytes`. - fn := ce.fn - pc := uint64(ce.returnAddress) - stackBasePointer := int(ce.stackBasePointerInBytes >> 3) - functionListeners := make([]functionListenerInvocation, 0, 16) - - for { - def := fn.definition() - - // sourceInfo holds the source code information corresponding to the frame. - // It is not empty only when the DWARF is enabled. - var sources []string - if p := fn.parent; p.parent.executable.Bytes() != nil { - if fn.parent.sourceOffsetMap.irOperationSourceOffsetsInWasmBinary != nil { - offset := fn.getSourceOffsetInWasmBinary(pc) - sources = p.parent.source.DWARFLines.Line(offset) - } - } - builder.AddFrame(def.DebugName(), def.ParamTypes(), def.ResultTypes(), sources) - - if fn.parent.listener != nil { - functionListeners = append(functionListeners, functionListenerInvocation{ - FunctionListener: fn.parent.listener, - def: fn.definition(), - }) - } - - callFrameOffset := callFrameOffset(fn.funcType) - if stackBasePointer != 0 { - frame := *(*callFrame)(unsafe.Pointer(&ce.stack[stackBasePointer+callFrameOffset])) - fn = frame.function - pc = uint64(frame.returnAddress) - stackBasePointer = int(frame.returnStackBasePointerInBytes >> 3) - } else { // base == 0 means that this was the last call frame stacked. - break - } - } - - err = builder.FromRecovered(recovered) - for i := range functionListeners { - functionListeners[i].Abort(ctx, m, functionListeners[i].def, err) - } - } - - // Allows the reuse of CallEngine. - ce.stackBasePointerInBytes, ce.stackPointer, ce.moduleInstance = 0, 0, nil - ce.moduleContext.fn = ce.initialFn - return -} - -// getSourceOffsetInWasmBinary returns the corresponding offset in the original Wasm binary's code section -// for the given pc (which is an absolute address in the memory). -// If needPreviousInstr equals true, this returns the previous instruction's offset for the given pc. -func (f *function) getSourceOffsetInWasmBinary(pc uint64) uint64 { - srcMap := &f.parent.sourceOffsetMap - n := bitpack.OffsetArrayLen(srcMap.irOperationOffsetsInNativeBinary) + 1 - - // Calculate the offset in the compiled native binary. - pcOffsetInNativeBinary := pc - uint64(f.codeInitialAddress) - - // Then, do the binary search on the list of offsets in the native binary - // for all the IR operations. This returns the index of the *next* IR - // operation of the one corresponding to the origin of this pc. - // See sort.Search. - // - // TODO: the underlying implementation of irOperationOffsetsInNativeBinary - // uses uses delta encoding an calls to the Index method might require a - // O(N) scan of the underlying array, turning binary search into a - // O(N*log(N)) operation. If this code path ends up being a bottleneck, - // we could add a Search method on the bitpack.OffsetArray types to delegate - // the lookup to the underlying data structure, allowing for the selection - // of a more optimized version of the algorithm. If you do so, please add a - // benchmark to verify the impact on compute time. - index := sort.Search(n, func(i int) bool { - if i == n-1 { - return true - } - return srcMap.irOperationOffsetsInNativeBinary.Index(i) >= pcOffsetInNativeBinary - }) - if index == 0 && bitpack.OffsetArrayLen(srcMap.irOperationSourceOffsetsInWasmBinary) > 0 { - // When pc is the beginning of the function, the next IR - // operation (returned by sort.Search) is the first of the - // offset map. - return srcMap.irOperationSourceOffsetsInWasmBinary.Index(0) - } - - if index == n || index == 0 { // This case, somehow pc is not found in the source offset map. - return 0 - } else { - return srcMap.irOperationSourceOffsetsInWasmBinary.Index(index - 1) - } -} - -func NewEngine(_ context.Context, enabledFeatures api.CoreFeatures, fileCache filecache.Cache) wasm.Engine { - return newEngine(enabledFeatures, fileCache) -} - -func newEngine(enabledFeatures api.CoreFeatures, fileCache filecache.Cache) *engine { - return &engine{ - enabledFeatures: enabledFeatures, - codes: map[wasm.ModuleID]*compiledModule{}, - setFinalizer: runtime.SetFinalizer, - fileCache: fileCache, - wazeroVersion: version.GetWazeroVersion(), - } -} - -// Do not make this variable as constant, otherwise there would be -// dangerous memory access from native code. -// -// Background: Go has a mechanism called "goroutine stack-shrink" where Go -// runtime shrinks Goroutine's stack when it is GCing. Shrinking means that -// all the contents on the goroutine stack will be relocated by runtime, -// Therefore, the memory address of these contents change undeterministically. -// Not only shrinks, but also Go runtime grows the goroutine stack at any point -// of function call entries, which also might end up relocating contents. -// -// On the other hand, we hold pointers to the data region of value stack and -// call-frame stack slices and use these raw pointers from native code. -// Therefore, it is dangerous if these two stacks are allocated on stack -// as these stack's address might be changed by Goroutine which we cannot -// detect. -// -// By declaring these values as `var`, slices created via `make([]..., var)` -// will never be allocated on stack [1]. This means accessing these slices via -// raw pointers is safe: As of version 1.18, Go's garbage collector never relocates -// heap-allocated objects (aka no compaction of memory [2]). -// -// On Go upgrades, re-validate heap-allocation via `go build -gcflags='-m' ./internal/engine/compiler/...`. -// -// [1] https://github.com/golang/go/blob/68ecdc2c70544c303aa923139a5f16caf107d955/src/cmd/compile/internal/escape/utils.go#L206-L208 -// [2] https://github.com/golang/go/blob/68ecdc2c70544c303aa923139a5f16caf107d955/src/runtime/mgc.go#L9 -// [3] https://mayurwadekar2.medium.com/escape-analysis-in-golang-ee40a1c064c1 -// [4] https://medium.com/@yulang.chu/go-stack-or-heap-2-slices-which-keep-in-stack-have-limitation-of-size-b3f3adfd6190 -var initialStackSize uint64 = 512 - -func (e *moduleEngine) newCallEngine(stackSize uint64, fn *function) *callEngine { - ce := &callEngine{ - stack: make([]uint64, stackSize), - archContext: newArchContext(), - initialFn: fn, - moduleContext: moduleContext{fn: fn}, - ensureTermination: fn.parent.parent.ensureTermination, - } - - stackHeader := (*reflect.SliceHeader)(unsafe.Pointer(&ce.stack)) - ce.stackContext = stackContext{ - stackElement0Address: stackHeader.Data, - stackLenInBytes: uint64(stackHeader.Len) << 3, - } - return ce -} - -func (ce *callEngine) popValue() (ret uint64) { - ce.stackContext.stackPointer-- - ret = ce.stack[ce.stackTopIndex()] - return -} - -func (ce *callEngine) pushValue(v uint64) { - ce.stack[ce.stackTopIndex()] = v - ce.stackContext.stackPointer++ -} - -func (ce *callEngine) stackTopIndex() uint64 { - return ce.stackContext.stackPointer + (ce.stackContext.stackBasePointerInBytes >> 3) -} - -const ( - builtinFunctionIndexMemoryGrow wasm.Index = iota - builtinFunctionIndexGrowStack - builtinFunctionIndexTableGrow - builtinFunctionIndexFunctionListenerBefore - builtinFunctionIndexFunctionListenerAfter - builtinFunctionIndexCheckExitCode - // builtinFunctionIndexBreakPoint is internal (only for wazero developers). Disabled by default. - builtinFunctionIndexBreakPoint -) - -func (ce *callEngine) execWasmFunction(ctx context.Context, m *wasm.ModuleInstance) { - codeAddr := ce.initialFn.codeInitialAddress - modAddr := ce.initialFn.moduleInstance - -entry: - { - // Call into the native code. - nativecall(codeAddr, ce, modAddr) - - // Check the status code from Compiler code. - switch status := ce.exitContext.statusCode; status { - case nativeCallStatusCodeReturned: - case nativeCallStatusCodeCallGoHostFunction: - calleeHostFunction := ce.moduleContext.fn - base := int(ce.stackBasePointerInBytes >> 3) - - // In the compiler engine, ce.stack has enough capacity for the - // max of param or result length, so we don't need to grow when - // there are more results than parameters. - stackLen := calleeHostFunction.funcType.ParamNumInUint64 - if resultLen := calleeHostFunction.funcType.ResultNumInUint64; resultLen > stackLen { - stackLen = resultLen - } - stack := ce.stack[base : base+stackLen] - - fn := calleeHostFunction.parent.goFunc - switch fn := fn.(type) { - case api.GoModuleFunction: - fn.Call(ctx, ce.callerModuleInstance, stack) - case api.GoFunction: - fn.Call(ctx, stack) - } - - codeAddr, modAddr = ce.returnAddress, ce.moduleInstance - goto entry - case nativeCallStatusCodeCallBuiltInFunction: - caller := ce.moduleContext.fn - switch ce.exitContext.builtinFunctionCallIndex { - case builtinFunctionIndexMemoryGrow: - ce.builtinFunctionMemoryGrow(caller.moduleInstance.MemoryInstance) - case builtinFunctionIndexGrowStack: - ce.builtinFunctionGrowStack(caller.parent.stackPointerCeil) - case builtinFunctionIndexTableGrow: - ce.builtinFunctionTableGrow(caller.moduleInstance.Tables) - case builtinFunctionIndexFunctionListenerBefore: - ce.builtinFunctionFunctionListenerBefore(ctx, m, caller) - case builtinFunctionIndexFunctionListenerAfter: - ce.builtinFunctionFunctionListenerAfter(ctx, m, caller) - case builtinFunctionIndexCheckExitCode: - // Note: this operation must be done in Go, not native code. The reason is that - // native code cannot be preempted and that means it can block forever if there are not - // enough OS threads (which we don't have control over). - if err := m.FailIfClosed(); err != nil { - panic(err) - } - } - if false { - if ce.exitContext.builtinFunctionCallIndex == builtinFunctionIndexBreakPoint { - runtime.Breakpoint() - } - } - - codeAddr, modAddr = ce.returnAddress, ce.moduleInstance - goto entry - default: - status.causePanic() - } - } -} - -// callStackCeiling is the maximum WebAssembly call frame stack height. This allows wazero to raise -// wasm.ErrCallStackOverflow instead of overflowing the Go runtime. -// -// The default value should suffice for most use cases. Those wishing to change this can via `go build -ldflags`. -// -// TODO: allows to configure this via context? -var callStackCeiling = uint64(5000000) // in uint64 (8 bytes) == 40000000 bytes in total == 40mb. - -func (ce *callEngine) builtinFunctionGrowStack(stackPointerCeil uint64) { - oldLen := uint64(len(ce.stack)) - if callStackCeiling < oldLen { - panic(wasmruntime.ErrRuntimeStackOverflow) - } - - // Extends the stack's length to oldLen*2+stackPointerCeil. - newLen := oldLen<<1 + (stackPointerCeil) - newStack := make([]uint64, newLen) - top := ce.stackTopIndex() - copy(newStack[:top], ce.stack[:top]) - ce.stack = newStack - stackHeader := (*reflect.SliceHeader)(unsafe.Pointer(&ce.stack)) - ce.stackContext.stackElement0Address = stackHeader.Data - ce.stackContext.stackLenInBytes = newLen << 3 -} - -func (ce *callEngine) builtinFunctionMemoryGrow(mem *wasm.MemoryInstance) { - newPages := ce.popValue() - - if res, ok := mem.Grow(uint32(newPages)); !ok { - ce.pushValue(uint64(0xffffffff)) // = -1 in signed 32-bit integer. - } else { - ce.pushValue(uint64(res)) - } - - // Update the moduleContext fields as they become stale after the update ^^. - bufSliceHeader := (*reflect.SliceHeader)(unsafe.Pointer(&mem.Buffer)) - ce.moduleContext.memorySliceLen = uint64(bufSliceHeader.Len) - ce.moduleContext.memoryElement0Address = bufSliceHeader.Data -} - -func (ce *callEngine) builtinFunctionTableGrow(tables []*wasm.TableInstance) { - tableIndex := uint32(ce.popValue()) - table := tables[tableIndex] // verified not to be out of range by the func validation at compilation phase. - num := ce.popValue() - ref := ce.popValue() - res := table.Grow(uint32(num), uintptr(ref)) - ce.pushValue(uint64(res)) -} - -// stackIterator implements experimental.StackIterator. -type stackIterator struct { - stack []uint64 - fn *function - base int - pc uint64 - started bool -} - -func (si *stackIterator) reset(stack []uint64, fn *function, base int, pc uint64) { - si.stack = stack - si.fn = fn - si.base = base - si.pc = pc - si.started = false -} - -func (si *stackIterator) clear() { - si.stack = nil - si.fn = nil - si.base = 0 - si.started = false -} - -// Next implements the same method as documented on experimental.StackIterator. -func (si *stackIterator) Next() bool { - if !si.started { - si.started = true - return true - } - - if si.fn == nil || si.base == 0 { - return false - } - - frame := si.base + callFrameOffset(si.fn.funcType) - si.pc = si.stack[frame+0] - si.base = int(si.stack[frame+1] >> 3) - // *function lives in the third field of callFrame struct. This must be - // aligned with the definition of callFrame struct. - si.fn = *(**function)(unsafe.Pointer(&si.stack[frame+2])) - return si.fn != nil -} - -// ProgramCounter implements the same method as documented on experimental.StackIterator. -func (si *stackIterator) ProgramCounter() experimental.ProgramCounter { - return experimental.ProgramCounter(si.pc) -} - -// Function implements the same method as documented on experimental.StackIterator. -func (si *stackIterator) Function() experimental.InternalFunction { - return internalFunction{si.fn} -} - -// Parameters implements the same method as documented on experimental.StackIterator. -func (si *stackIterator) Parameters() []uint64 { - return si.stack[si.base : si.base+si.fn.funcType.ParamNumInUint64] -} - -// internalFunction implements experimental.InternalFunction. -type internalFunction struct{ *function } - -// Definition implements the same method as documented on experimental.InternalFunction. -func (f internalFunction) Definition() api.FunctionDefinition { - return f.definition() -} - -// SourceOffsetForPC implements the same method as documented on experimental.InternalFunction. -func (f internalFunction) SourceOffsetForPC(pc experimental.ProgramCounter) uint64 { - p := f.parent - if bitpack.OffsetArrayLen(p.sourceOffsetMap.irOperationSourceOffsetsInWasmBinary) == 0 { - return 0 // source not available - } - return f.getSourceOffsetInWasmBinary(uint64(pc)) -} - -func (ce *callEngine) builtinFunctionFunctionListenerBefore(ctx context.Context, mod api.Module, fn *function) { - base := int(ce.stackBasePointerInBytes >> 3) - pc := uint64(ce.returnAddress) - ce.stackIterator.reset(ce.stack, fn, base, pc) - - params := ce.stack[base : base+fn.funcType.ParamNumInUint64] - fn.parent.listener.Before(ctx, mod, fn.definition(), params, &ce.stackIterator) - - ce.stackIterator.clear() -} - -func (ce *callEngine) builtinFunctionFunctionListenerAfter(ctx context.Context, mod api.Module, fn *function) { - base := int(ce.stackBasePointerInBytes >> 3) - fn.parent.listener.After(ctx, mod, fn.definition(), ce.stack[base:base+fn.funcType.ResultNumInUint64]) -} - -func compileGoDefinedHostFunction(buf asm.Buffer, cmp compiler) error { - if err := cmp.compileGoDefinedHostFunction(); err != nil { - return err - } - _, err := cmp.compile(buf) - return err -} - -type asmNodes struct { - nodes []asm.Node -} - -type offsets struct { - values []uint64 -} - -func compileWasmFunction(buf asm.Buffer, cmp compiler, ir *wazeroir.CompilationResult, asmNodes *asmNodes, offsets *offsets) (spCeil uint64, sm sourceOffsetMap, err error) { - if err = cmp.compilePreamble(); err != nil { - err = fmt.Errorf("failed to emit preamble: %w", err) - return - } - - needSourceOffsets := len(ir.IROperationSourceOffsetsInWasmBinary) > 0 - var irOpBegins []asm.Node - if needSourceOffsets { - irOpBegins = append(asmNodes.nodes[:0], make([]asm.Node, len(ir.Operations))...) - defer func() { asmNodes.nodes = irOpBegins }() - } - - var skip bool - for i := range ir.Operations { - op := &ir.Operations[i] - if needSourceOffsets { - // If this compilation requires source offsets for DWARF based back trace, - // we emit a NOP node at the beginning of each IR operation to get the - // binary offset of the beginning of the corresponding compiled native code. - irOpBegins[i] = cmp.compileNOP() - } - - // Compiler determines whether skip the entire label. - // For example, if the label doesn't have any caller, - // we don't need to generate native code at all as we never reach the region. - if op.Kind == wazeroir.OperationKindLabel { - skip = cmp.compileLabel(op) - } - if skip { - continue - } - - if false { - fmt.Printf("compiling op=%s: %s\n", op.Kind, cmp) - } - switch op.Kind { - case wazeroir.OperationKindUnreachable: - err = cmp.compileUnreachable() - case wazeroir.OperationKindLabel: - // label op is already handled ^^. - case wazeroir.OperationKindBr: - err = cmp.compileBr(op) - case wazeroir.OperationKindBrIf: - err = cmp.compileBrIf(op) - case wazeroir.OperationKindBrTable: - err = cmp.compileBrTable(op) - case wazeroir.OperationKindCall: - err = cmp.compileCall(op) - case wazeroir.OperationKindCallIndirect: - err = cmp.compileCallIndirect(op) - case wazeroir.OperationKindDrop: - err = cmp.compileDrop(op) - case wazeroir.OperationKindSelect: - err = cmp.compileSelect(op) - case wazeroir.OperationKindPick: - err = cmp.compilePick(op) - case wazeroir.OperationKindSet: - err = cmp.compileSet(op) - case wazeroir.OperationKindGlobalGet: - err = cmp.compileGlobalGet(op) - case wazeroir.OperationKindGlobalSet: - err = cmp.compileGlobalSet(op) - case wazeroir.OperationKindLoad: - err = cmp.compileLoad(op) - case wazeroir.OperationKindLoad8: - err = cmp.compileLoad8(op) - case wazeroir.OperationKindLoad16: - err = cmp.compileLoad16(op) - case wazeroir.OperationKindLoad32: - err = cmp.compileLoad32(op) - case wazeroir.OperationKindStore: - err = cmp.compileStore(op) - case wazeroir.OperationKindStore8: - err = cmp.compileStore8(op) - case wazeroir.OperationKindStore16: - err = cmp.compileStore16(op) - case wazeroir.OperationKindStore32: - err = cmp.compileStore32(op) - case wazeroir.OperationKindMemorySize: - err = cmp.compileMemorySize() - case wazeroir.OperationKindMemoryGrow: - err = cmp.compileMemoryGrow() - case wazeroir.OperationKindConstI32: - err = cmp.compileConstI32(op) - case wazeroir.OperationKindConstI64: - err = cmp.compileConstI64(op) - case wazeroir.OperationKindConstF32: - err = cmp.compileConstF32(op) - case wazeroir.OperationKindConstF64: - err = cmp.compileConstF64(op) - case wazeroir.OperationKindEq: - err = cmp.compileEq(op) - case wazeroir.OperationKindNe: - err = cmp.compileNe(op) - case wazeroir.OperationKindEqz: - err = cmp.compileEqz(op) - case wazeroir.OperationKindLt: - err = cmp.compileLt(op) - case wazeroir.OperationKindGt: - err = cmp.compileGt(op) - case wazeroir.OperationKindLe: - err = cmp.compileLe(op) - case wazeroir.OperationKindGe: - err = cmp.compileGe(op) - case wazeroir.OperationKindAdd: - err = cmp.compileAdd(op) - case wazeroir.OperationKindSub: - err = cmp.compileSub(op) - case wazeroir.OperationKindMul: - err = cmp.compileMul(op) - case wazeroir.OperationKindClz: - err = cmp.compileClz(op) - case wazeroir.OperationKindCtz: - err = cmp.compileCtz(op) - case wazeroir.OperationKindPopcnt: - err = cmp.compilePopcnt(op) - case wazeroir.OperationKindDiv: - err = cmp.compileDiv(op) - case wazeroir.OperationKindRem: - err = cmp.compileRem(op) - case wazeroir.OperationKindAnd: - err = cmp.compileAnd(op) - case wazeroir.OperationKindOr: - err = cmp.compileOr(op) - case wazeroir.OperationKindXor: - err = cmp.compileXor(op) - case wazeroir.OperationKindShl: - err = cmp.compileShl(op) - case wazeroir.OperationKindShr: - err = cmp.compileShr(op) - case wazeroir.OperationKindRotl: - err = cmp.compileRotl(op) - case wazeroir.OperationKindRotr: - err = cmp.compileRotr(op) - case wazeroir.OperationKindAbs: - err = cmp.compileAbs(op) - case wazeroir.OperationKindNeg: - err = cmp.compileNeg(op) - case wazeroir.OperationKindCeil: - err = cmp.compileCeil(op) - case wazeroir.OperationKindFloor: - err = cmp.compileFloor(op) - case wazeroir.OperationKindTrunc: - err = cmp.compileTrunc(op) - case wazeroir.OperationKindNearest: - err = cmp.compileNearest(op) - case wazeroir.OperationKindSqrt: - err = cmp.compileSqrt(op) - case wazeroir.OperationKindMin: - err = cmp.compileMin(op) - case wazeroir.OperationKindMax: - err = cmp.compileMax(op) - case wazeroir.OperationKindCopysign: - err = cmp.compileCopysign(op) - case wazeroir.OperationKindI32WrapFromI64: - err = cmp.compileI32WrapFromI64() - case wazeroir.OperationKindITruncFromF: - err = cmp.compileITruncFromF(op) - case wazeroir.OperationKindFConvertFromI: - err = cmp.compileFConvertFromI(op) - case wazeroir.OperationKindF32DemoteFromF64: - err = cmp.compileF32DemoteFromF64() - case wazeroir.OperationKindF64PromoteFromF32: - err = cmp.compileF64PromoteFromF32() - case wazeroir.OperationKindI32ReinterpretFromF32: - err = cmp.compileI32ReinterpretFromF32() - case wazeroir.OperationKindI64ReinterpretFromF64: - err = cmp.compileI64ReinterpretFromF64() - case wazeroir.OperationKindF32ReinterpretFromI32: - err = cmp.compileF32ReinterpretFromI32() - case wazeroir.OperationKindF64ReinterpretFromI64: - err = cmp.compileF64ReinterpretFromI64() - case wazeroir.OperationKindExtend: - err = cmp.compileExtend(op) - case wazeroir.OperationKindSignExtend32From8: - err = cmp.compileSignExtend32From8() - case wazeroir.OperationKindSignExtend32From16: - err = cmp.compileSignExtend32From16() - case wazeroir.OperationKindSignExtend64From8: - err = cmp.compileSignExtend64From8() - case wazeroir.OperationKindSignExtend64From16: - err = cmp.compileSignExtend64From16() - case wazeroir.OperationKindSignExtend64From32: - err = cmp.compileSignExtend64From32() - case wazeroir.OperationKindMemoryInit: - err = cmp.compileMemoryInit(op) - case wazeroir.OperationKindDataDrop: - err = cmp.compileDataDrop(op) - case wazeroir.OperationKindMemoryCopy: - err = cmp.compileMemoryCopy() - case wazeroir.OperationKindMemoryFill: - err = cmp.compileMemoryFill() - case wazeroir.OperationKindTableInit: - err = cmp.compileTableInit(op) - case wazeroir.OperationKindElemDrop: - err = cmp.compileElemDrop(op) - case wazeroir.OperationKindTableCopy: - err = cmp.compileTableCopy(op) - case wazeroir.OperationKindRefFunc: - err = cmp.compileRefFunc(op) - case wazeroir.OperationKindTableGet: - err = cmp.compileTableGet(op) - case wazeroir.OperationKindTableSet: - err = cmp.compileTableSet(op) - case wazeroir.OperationKindTableGrow: - err = cmp.compileTableGrow(op) - case wazeroir.OperationKindTableSize: - err = cmp.compileTableSize(op) - case wazeroir.OperationKindTableFill: - err = cmp.compileTableFill(op) - case wazeroir.OperationKindV128Const: - err = cmp.compileV128Const(op) - case wazeroir.OperationKindV128Add: - err = cmp.compileV128Add(op) - case wazeroir.OperationKindV128Sub: - err = cmp.compileV128Sub(op) - case wazeroir.OperationKindV128Load: - err = cmp.compileV128Load(op) - case wazeroir.OperationKindV128LoadLane: - err = cmp.compileV128LoadLane(op) - case wazeroir.OperationKindV128Store: - err = cmp.compileV128Store(op) - case wazeroir.OperationKindV128StoreLane: - err = cmp.compileV128StoreLane(op) - case wazeroir.OperationKindV128ExtractLane: - err = cmp.compileV128ExtractLane(op) - case wazeroir.OperationKindV128ReplaceLane: - err = cmp.compileV128ReplaceLane(op) - case wazeroir.OperationKindV128Splat: - err = cmp.compileV128Splat(op) - case wazeroir.OperationKindV128Shuffle: - err = cmp.compileV128Shuffle(op) - case wazeroir.OperationKindV128Swizzle: - err = cmp.compileV128Swizzle(op) - case wazeroir.OperationKindV128AnyTrue: - err = cmp.compileV128AnyTrue(op) - case wazeroir.OperationKindV128AllTrue: - err = cmp.compileV128AllTrue(op) - case wazeroir.OperationKindV128BitMask: - err = cmp.compileV128BitMask(op) - case wazeroir.OperationKindV128And: - err = cmp.compileV128And(op) - case wazeroir.OperationKindV128Not: - err = cmp.compileV128Not(op) - case wazeroir.OperationKindV128Or: - err = cmp.compileV128Or(op) - case wazeroir.OperationKindV128Xor: - err = cmp.compileV128Xor(op) - case wazeroir.OperationKindV128Bitselect: - err = cmp.compileV128Bitselect(op) - case wazeroir.OperationKindV128AndNot: - err = cmp.compileV128AndNot(op) - case wazeroir.OperationKindV128Shl: - err = cmp.compileV128Shl(op) - case wazeroir.OperationKindV128Shr: - err = cmp.compileV128Shr(op) - case wazeroir.OperationKindV128Cmp: - err = cmp.compileV128Cmp(op) - case wazeroir.OperationKindV128AddSat: - err = cmp.compileV128AddSat(op) - case wazeroir.OperationKindV128SubSat: - err = cmp.compileV128SubSat(op) - case wazeroir.OperationKindV128Mul: - err = cmp.compileV128Mul(op) - case wazeroir.OperationKindV128Div: - err = cmp.compileV128Div(op) - case wazeroir.OperationKindV128Neg: - err = cmp.compileV128Neg(op) - case wazeroir.OperationKindV128Sqrt: - err = cmp.compileV128Sqrt(op) - case wazeroir.OperationKindV128Abs: - err = cmp.compileV128Abs(op) - case wazeroir.OperationKindV128Popcnt: - err = cmp.compileV128Popcnt(op) - case wazeroir.OperationKindV128Min: - err = cmp.compileV128Min(op) - case wazeroir.OperationKindV128Max: - err = cmp.compileV128Max(op) - case wazeroir.OperationKindV128AvgrU: - err = cmp.compileV128AvgrU(op) - case wazeroir.OperationKindV128Pmin: - err = cmp.compileV128Pmin(op) - case wazeroir.OperationKindV128Pmax: - err = cmp.compileV128Pmax(op) - case wazeroir.OperationKindV128Ceil: - err = cmp.compileV128Ceil(op) - case wazeroir.OperationKindV128Floor: - err = cmp.compileV128Floor(op) - case wazeroir.OperationKindV128Trunc: - err = cmp.compileV128Trunc(op) - case wazeroir.OperationKindV128Nearest: - err = cmp.compileV128Nearest(op) - case wazeroir.OperationKindV128Extend: - err = cmp.compileV128Extend(op) - case wazeroir.OperationKindV128ExtMul: - err = cmp.compileV128ExtMul(op) - case wazeroir.OperationKindV128Q15mulrSatS: - err = cmp.compileV128Q15mulrSatS(op) - case wazeroir.OperationKindV128ExtAddPairwise: - err = cmp.compileV128ExtAddPairwise(op) - case wazeroir.OperationKindV128FloatPromote: - err = cmp.compileV128FloatPromote(op) - case wazeroir.OperationKindV128FloatDemote: - err = cmp.compileV128FloatDemote(op) - case wazeroir.OperationKindV128FConvertFromI: - err = cmp.compileV128FConvertFromI(op) - case wazeroir.OperationKindV128Dot: - err = cmp.compileV128Dot(op) - case wazeroir.OperationKindV128Narrow: - err = cmp.compileV128Narrow(op) - case wazeroir.OperationKindV128ITruncSatFromF: - err = cmp.compileV128ITruncSatFromF(op) - case wazeroir.OperationKindBuiltinFunctionCheckExitCode: - err = cmp.compileBuiltinFunctionCheckExitCode() - default: - err = errors.New("unsupported") - } - if err != nil { - err = fmt.Errorf("operation %s: %w", op.Kind.String(), err) - return - } - } - - spCeil, err = cmp.compile(buf) - if err != nil { - err = fmt.Errorf("failed to compile: %w", err) - return - } - - if needSourceOffsets { - offsetInNativeBin := append(offsets.values[:0], make([]uint64, len(irOpBegins))...) - offsets.values = offsetInNativeBin - for i, nop := range irOpBegins { - offsetInNativeBin[i] = nop.OffsetInBinary() - } - sm.irOperationOffsetsInNativeBinary = bitpack.NewOffsetArray(offsetInNativeBin) - sm.irOperationSourceOffsetsInWasmBinary = bitpack.NewOffsetArray(ir.IROperationSourceOffsetsInWasmBinary) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine_cache.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine_cache.go deleted file mode 100644 index e6b3b0e914..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/engine_cache.go +++ /dev/null @@ -1,233 +0,0 @@ -package compiler - -import ( - "bytes" - "encoding/binary" - "fmt" - "io" - "runtime" - - "github.com/tetratelabs/wazero/experimental" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/internal/u32" - "github.com/tetratelabs/wazero/internal/u64" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func (e *engine) deleteCompiledModule(module *wasm.Module) { - e.mux.Lock() - defer e.mux.Unlock() - delete(e.codes, module.ID) - - // Note: we do not call e.Cache.Delete, as the lifetime of - // the content is up to the implementation of extencache.Cache interface. -} - -func (e *engine) addCompiledModule(module *wasm.Module, cm *compiledModule, withGoFunc bool) (err error) { - e.addCompiledModuleToMemory(module, cm) - if !withGoFunc { - err = e.addCompiledModuleToCache(module, cm) - } - return -} - -func (e *engine) getCompiledModule(module *wasm.Module, listeners []experimental.FunctionListener) (cm *compiledModule, ok bool, err error) { - cm, ok = e.getCompiledModuleFromMemory(module) - if ok { - return - } - cm, ok, err = e.getCompiledModuleFromCache(module) - if ok { - e.addCompiledModuleToMemory(module, cm) - if len(listeners) > 0 { - // Files do not contain the actual listener instances (it's impossible to cache them as files!), so assign each here. - for i := range cm.functions { - cm.functions[i].listener = listeners[i] - } - } - } - return -} - -func (e *engine) addCompiledModuleToMemory(module *wasm.Module, cm *compiledModule) { - e.mux.Lock() - defer e.mux.Unlock() - e.codes[module.ID] = cm -} - -func (e *engine) getCompiledModuleFromMemory(module *wasm.Module) (cm *compiledModule, ok bool) { - e.mux.RLock() - defer e.mux.RUnlock() - cm, ok = e.codes[module.ID] - return -} - -func (e *engine) addCompiledModuleToCache(module *wasm.Module, cm *compiledModule) (err error) { - if e.fileCache == nil || module.IsHostModule { - return - } - err = e.fileCache.Add(module.ID, serializeCompiledModule(e.wazeroVersion, cm)) - return -} - -func (e *engine) getCompiledModuleFromCache(module *wasm.Module) (cm *compiledModule, hit bool, err error) { - if e.fileCache == nil || module.IsHostModule { - return - } - - // Check if the entries exist in the external cache. - var cached io.ReadCloser - cached, hit, err = e.fileCache.Get(module.ID) - if !hit || err != nil { - return - } - - // Otherwise, we hit the cache on external cache. - // We retrieve *code structures from `cached`. - var staleCache bool - // Note: cached.Close is ensured to be called in deserializeCodes. - cm, staleCache, err = deserializeCompiledModule(e.wazeroVersion, cached, module) - if err != nil { - hit = false - return - } else if staleCache { - return nil, false, e.fileCache.Delete(module.ID) - } - - cm.source = module - return -} - -var wazeroMagic = "WAZERO" // version must be synced with the tag of the wazero library. - -func serializeCompiledModule(wazeroVersion string, cm *compiledModule) io.Reader { - buf := bytes.NewBuffer(nil) - // First 6 byte: WAZERO header. - buf.WriteString(wazeroMagic) - // Next 1 byte: length of version: - buf.WriteByte(byte(len(wazeroVersion))) - // Version of wazero. - buf.WriteString(wazeroVersion) - if cm.ensureTermination { - buf.WriteByte(1) - } else { - buf.WriteByte(0) - } - // Number of *code (== locally defined functions in the module): 4 bytes. - buf.Write(u32.LeBytes(uint32(len(cm.functions)))) - for i := 0; i < len(cm.functions); i++ { - f := &cm.functions[i] - // The stack pointer ceil (8 bytes). - buf.Write(u64.LeBytes(f.stackPointerCeil)) - // The offset of this function in the executable (8 bytes). - buf.Write(u64.LeBytes(uint64(f.executableOffset))) - } - // The length of code segment (8 bytes). - buf.Write(u64.LeBytes(uint64(cm.executable.Len()))) - // Append the native code. - buf.Write(cm.executable.Bytes()) - return bytes.NewReader(buf.Bytes()) -} - -func deserializeCompiledModule(wazeroVersion string, reader io.ReadCloser, module *wasm.Module) (cm *compiledModule, staleCache bool, err error) { - defer reader.Close() - cacheHeaderSize := len(wazeroMagic) + 1 /* version size */ + len(wazeroVersion) + 1 /* ensure termination */ + 4 /* number of functions */ - - // Read the header before the native code. - header := make([]byte, cacheHeaderSize) - n, err := reader.Read(header) - if err != nil { - return nil, false, fmt.Errorf("compilationcache: error reading header: %v", err) - } - - if n != cacheHeaderSize { - return nil, false, fmt.Errorf("compilationcache: invalid header length: %d", n) - } - - // Check the version compatibility. - versionSize := int(header[len(wazeroMagic)]) - - cachedVersionBegin, cachedVersionEnd := len(wazeroMagic)+1, len(wazeroMagic)+1+versionSize - if cachedVersionEnd >= len(header) { - staleCache = true - return - } else if cachedVersion := string(header[cachedVersionBegin:cachedVersionEnd]); cachedVersion != wazeroVersion { - staleCache = true - return - } - - ensureTermination := header[cachedVersionEnd] != 0 - functionsNum := binary.LittleEndian.Uint32(header[len(header)-4:]) - cm = &compiledModule{functions: make([]compiledFunction, functionsNum), ensureTermination: ensureTermination} - - imported := module.ImportFunctionCount - - var eightBytes [8]byte - for i := uint32(0); i < functionsNum; i++ { - f := &cm.functions[i] - f.parent = cm - - // Read the stack pointer ceil. - if f.stackPointerCeil, err = readUint64(reader, &eightBytes); err != nil { - err = fmt.Errorf("compilationcache: error reading func[%d] stack pointer ceil: %v", i, err) - return - } - - // Read the offset of each function in the executable. - var offset uint64 - if offset, err = readUint64(reader, &eightBytes); err != nil { - err = fmt.Errorf("compilationcache: error reading func[%d] executable offset: %v", i, err) - return - } - f.executableOffset = uintptr(offset) - f.index = imported + i - } - - executableLen, err := readUint64(reader, &eightBytes) - if err != nil { - err = fmt.Errorf("compilationcache: error reading executable size: %v", err) - return - } - - if executableLen > 0 { - if err = cm.executable.Map(int(executableLen)); err != nil { - err = fmt.Errorf("compilationcache: error mmapping executable (len=%d): %v", executableLen, err) - return - } - - _, err = io.ReadFull(reader, cm.executable.Bytes()) - if err != nil { - err = fmt.Errorf("compilationcache: error reading executable (len=%d): %v", executableLen, err) - return - } - - if runtime.GOARCH == "arm64" { - // On arm64, we cannot give all of rwx at the same time, so we change it to exec. - if err = platform.MprotectRX(cm.executable.Bytes()); err != nil { - return - } - } - } - return -} - -// readUint64 strictly reads an uint64 in little-endian byte order, using the -// given array as a buffer. This returns io.EOF if less than 8 bytes were read. -func readUint64(reader io.Reader, b *[8]byte) (uint64, error) { - s := b[0:8] - n, err := reader.Read(s) - if err != nil { - return 0, err - } else if n < 8 { // more strict than reader.Read - return 0, io.EOF - } - - // Read the u64 from the underlying buffer. - ret := binary.LittleEndian.Uint64(s) - - // Clear the underlying array. - for i := 0; i < 8; i++ { - b[i] = 0 - } - return ret, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_amd64.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_amd64.go deleted file mode 100644 index 79b299ec9d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_amd64.go +++ /dev/null @@ -1,5208 +0,0 @@ -package compiler - -// This file implements the compiler for amd64/x86_64 target. -// Please refer to https://www.felixcloutier.com/x86/index.html -// if unfamiliar with amd64 instructions used here. - -import ( - "fmt" - "math" - - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/asm/amd64" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/internal/u32" - "github.com/tetratelabs/wazero/internal/u64" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -var ( - _minimum32BitSignedInt int32 = math.MinInt32 - _maximum32BitSignedInt int32 = math.MaxInt32 - _maximum32BitUnsignedInt uint32 = math.MaxUint32 - _minimum64BitSignedInt int64 = math.MinInt64 - _maximum64BitSignedInt int64 = math.MaxInt64 - _maximum64BitUnsignedInt uint64 = math.MaxUint64 - _float32SignBitMask uint32 = 1 << 31 - _float32RestBitMask = ^_float32SignBitMask - _float64SignBitMask uint64 = 1 << 63 - _float64RestBitMask = ^_float64SignBitMask - _float32ForMinimumSigned32bitInteger = uint32(0xCF00_0000) - _float64ForMinimumSigned32bitInteger = uint64(0xC1E0_0000_0020_0000) - _float32ForMinimumSigned64bitInteger = uint32(0xDF00_0000) - _float64ForMinimumSigned64bitInteger = uint64(0xC3E0_0000_0000_0000) - _float32ForMaximumSigned32bitIntPlusOne = uint32(0x4F00_0000) - _float64ForMaximumSigned32bitIntPlusOne = uint64(0x41E0_0000_0000_0000) - _float32ForMaximumSigned64bitIntPlusOne = uint32(0x5F00_0000) - _float64ForMaximumSigned64bitIntPlusOne = uint64(0x43E0_0000_0000_0000) -) - -var ( - // amd64ReservedRegisterForCallEngine: pointer to callEngine (i.e. *callEngine as uintptr) - amd64ReservedRegisterForCallEngine = amd64.RegR13 - // amd64ReservedRegisterForStackBasePointerAddress: stack base pointer's address (callEngine.stackBasePointer) in the current function call. - amd64ReservedRegisterForStackBasePointerAddress = amd64.RegR14 - // amd64ReservedRegisterForMemory: pointer to the memory slice's data (i.e. &memory.Buffer[0] as uintptr). - amd64ReservedRegisterForMemory = amd64.RegR15 -) - -var ( - amd64UnreservedVectorRegisters = []asm.Register{ //nolint - amd64.RegX0, amd64.RegX1, amd64.RegX2, amd64.RegX3, - amd64.RegX4, amd64.RegX5, amd64.RegX6, amd64.RegX7, - amd64.RegX8, amd64.RegX9, amd64.RegX10, amd64.RegX11, - amd64.RegX12, amd64.RegX13, amd64.RegX14, amd64.RegX15, - } - // Note that we never invoke "call" instruction, - // so we don't need to care about the calling convention. - // TODO: Maybe it is safe just save rbp, rsp somewhere - // in Go-allocated variables, and reuse these registers - // in compiled functions and write them back before returns. - amd64UnreservedGeneralPurposeRegisters = []asm.Register{ //nolint - amd64.RegAX, amd64.RegCX, amd64.RegDX, amd64.RegBX, - amd64.RegSI, amd64.RegDI, amd64.RegR8, amd64.RegR9, - amd64.RegR10, amd64.RegR11, amd64.RegR12, - } -) - -// amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister holds *wasm.ModuleInstance of the -// next executing function instance. The value is set and used when making function calls -// or function returns in the ModuleContextInitialization. See compileModuleContextInitialization. -var amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister = amd64.RegR12 - -func (c *amd64Compiler) String() string { - return c.locationStack.String() -} - -// compileNOP implements compiler.compileNOP for the amd64 architecture. -func (c *amd64Compiler) compileNOP() asm.Node { - return c.assembler.CompileStandAlone(amd64.NOP) -} - -type amd64Compiler struct { - assembler amd64.Assembler - ir *wazeroir.CompilationResult - cpuFeatures platform.CpuFeatureFlags - // locationStack holds the state of wazeroir virtual stack. - // and each item is either placed in register or the actual memory stack. - locationStack *runtimeValueLocationStack - // labels hold per wazeroir label specific information in this function. - labels [wazeroir.LabelKindNum][]amd64LabelInfo - // stackPointerCeil is the greatest stack pointer value (from runtimeValueLocationStack) seen during compilation. - stackPointerCeil uint64 - // assignStackPointerCeilNeeded holds an asm.Node whose AssignDestinationConstant must be called with the determined stack pointer ceiling. - assignStackPointerCeilNeeded asm.Node - compiledTrapTargets [nativeCallStatusModuleClosed]asm.Node - withListener bool - typ *wasm.FunctionType - // locationStackForEntrypoint is the initial location stack for all functions. To reuse the allocated stack, - // we cache it here, and reset and set to .locationStack in the Init method. - locationStackForEntrypoint runtimeValueLocationStack - // frameIDMax tracks the maximum value of frame id per function. - frameIDMax int - brTableTmp []runtimeValueLocation - - fourZeros, - eightZeros, - minimum32BitSignedInt, - maximum32BitSignedInt, - maximum32BitUnsignedInt, - minimum64BitSignedInt, - maximum64BitSignedInt, - maximum64BitUnsignedInt, - float32SignBitMask, - float32RestBitMask, - float64SignBitMask, - float64RestBitMask, - float32ForMinimumSigned32bitInteger, - float64ForMinimumSigned32bitInteger, - float32ForMinimumSigned64bitInteger, - float64ForMinimumSigned64bitInteger, - float32ForMaximumSigned32bitIntPlusOne, - float64ForMaximumSigned32bitIntPlusOne, - float32ForMaximumSigned64bitIntPlusOne, - float64ForMaximumSigned64bitIntPlusOne *asm.StaticConst -} - -func newAmd64Compiler() compiler { - c := &amd64Compiler{ - assembler: amd64.NewAssembler(), - locationStackForEntrypoint: newRuntimeValueLocationStack(), - cpuFeatures: platform.CpuFeatures, - } - - c.fourZeros = asm.NewStaticConst([]byte{0, 0, 0, 0}) - c.eightZeros = asm.NewStaticConst([]byte{0, 0, 0, 0, 0, 0, 0, 0}) - c.minimum32BitSignedInt = asm.NewStaticConst(u32.LeBytes(uint32(_minimum32BitSignedInt))) - c.maximum32BitSignedInt = asm.NewStaticConst(u32.LeBytes(uint32(_maximum32BitSignedInt))) - c.maximum32BitUnsignedInt = asm.NewStaticConst(u32.LeBytes(_maximum32BitUnsignedInt)) - c.minimum64BitSignedInt = asm.NewStaticConst(u64.LeBytes(uint64(_minimum64BitSignedInt))) - c.maximum64BitSignedInt = asm.NewStaticConst(u64.LeBytes(uint64(_maximum64BitSignedInt))) - c.maximum64BitUnsignedInt = asm.NewStaticConst(u64.LeBytes(_maximum64BitUnsignedInt)) - c.float32SignBitMask = asm.NewStaticConst(u32.LeBytes(_float32SignBitMask)) - c.float32RestBitMask = asm.NewStaticConst(u32.LeBytes(_float32RestBitMask)) - c.float64SignBitMask = asm.NewStaticConst(u64.LeBytes(_float64SignBitMask)) - c.float64RestBitMask = asm.NewStaticConst(u64.LeBytes(_float64RestBitMask)) - c.float32ForMinimumSigned32bitInteger = asm.NewStaticConst(u32.LeBytes(_float32ForMinimumSigned32bitInteger)) - c.float64ForMinimumSigned32bitInteger = asm.NewStaticConst(u64.LeBytes(_float64ForMinimumSigned32bitInteger)) - c.float32ForMinimumSigned64bitInteger = asm.NewStaticConst(u32.LeBytes(_float32ForMinimumSigned64bitInteger)) - c.float64ForMinimumSigned64bitInteger = asm.NewStaticConst(u64.LeBytes(_float64ForMinimumSigned64bitInteger)) - c.float32ForMaximumSigned32bitIntPlusOne = asm.NewStaticConst(u32.LeBytes(_float32ForMaximumSigned32bitIntPlusOne)) - c.float64ForMaximumSigned32bitIntPlusOne = asm.NewStaticConst(u64.LeBytes(_float64ForMaximumSigned32bitIntPlusOne)) - c.float32ForMaximumSigned64bitIntPlusOne = asm.NewStaticConst(u32.LeBytes(_float32ForMaximumSigned64bitIntPlusOne)) - c.float64ForMaximumSigned64bitIntPlusOne = asm.NewStaticConst(u64.LeBytes(_float64ForMaximumSigned64bitIntPlusOne)) - return c -} - -// Init implements compiler.Init. -func (c *amd64Compiler) Init(typ *wasm.FunctionType, ir *wazeroir.CompilationResult, withListener bool) { - c.assembler.Reset() - c.locationStackForEntrypoint.reset() - c.resetLabels() - *c = amd64Compiler{ - ir: ir, - withListener: withListener, - typ: typ, - assembler: c.assembler, - cpuFeatures: c.cpuFeatures, - labels: c.labels, - locationStackForEntrypoint: c.locationStackForEntrypoint, - brTableTmp: c.brTableTmp, - fourZeros: c.fourZeros, - eightZeros: c.eightZeros, - minimum32BitSignedInt: c.minimum32BitSignedInt, - maximum32BitSignedInt: c.maximum32BitSignedInt, - maximum32BitUnsignedInt: c.maximum32BitUnsignedInt, - minimum64BitSignedInt: c.minimum64BitSignedInt, - maximum64BitSignedInt: c.maximum64BitSignedInt, - maximum64BitUnsignedInt: c.maximum64BitUnsignedInt, - float32SignBitMask: c.float32SignBitMask, - float32RestBitMask: c.float32RestBitMask, - float64SignBitMask: c.float64SignBitMask, - float64RestBitMask: c.float64RestBitMask, - float32ForMinimumSigned32bitInteger: c.float32ForMinimumSigned32bitInteger, - float64ForMinimumSigned32bitInteger: c.float64ForMinimumSigned32bitInteger, - float32ForMinimumSigned64bitInteger: c.float32ForMinimumSigned64bitInteger, - float64ForMinimumSigned64bitInteger: c.float64ForMinimumSigned64bitInteger, - float32ForMaximumSigned32bitIntPlusOne: c.float32ForMaximumSigned32bitIntPlusOne, - float64ForMaximumSigned32bitIntPlusOne: c.float64ForMaximumSigned32bitIntPlusOne, - float32ForMaximumSigned64bitIntPlusOne: c.float32ForMaximumSigned64bitIntPlusOne, - float64ForMaximumSigned64bitIntPlusOne: c.float64ForMaximumSigned64bitIntPlusOne, - } - - // Reuses the initial location stack for the compilation of subsequent functions. - c.locationStack = &c.locationStackForEntrypoint -} - -// resetLabels resets the existing content in arm64Compiler.labels so that -// we could reuse the allocated slices and stacks in the subsequent compilations. -func (c *amd64Compiler) resetLabels() { - for i := range c.labels { - for j := range c.labels[i] { - if j > c.frameIDMax { - // Only need to reset until the maximum frame id. This makes the compilation faster for large binary. - break - } - l := &c.labels[i][j] - l.initialInstruction = nil - l.stackInitialized = false - l.initialStack.reset() - } - } -} - -// runtimeValueLocationStack implements compilerImpl.runtimeValueLocationStack for the amd64 architecture. -func (c *amd64Compiler) runtimeValueLocationStack() *runtimeValueLocationStack { - return c.locationStack -} - -// setLocationStack sets the given runtimeValueLocationStack to .locationStack field, -// while allowing us to track runtimeValueLocationStack.stackPointerCeil across multiple stacks. -// This is called when we branch into different block. -func (c *amd64Compiler) setLocationStack(newStack *runtimeValueLocationStack) { - if c.stackPointerCeil < c.locationStack.stackPointerCeil { - c.stackPointerCeil = c.locationStack.stackPointerCeil - } - c.locationStack = newStack -} - -// pushRuntimeValueLocationOnRegister implements compiler.pushRuntimeValueLocationOnRegister for amd64. -func (c *amd64Compiler) pushRuntimeValueLocationOnRegister(reg asm.Register, vt runtimeValueType) (ret *runtimeValueLocation) { - ret = c.locationStack.pushRuntimeValueLocationOnRegister(reg, vt) - c.locationStack.markRegisterUsed(reg) - return -} - -// pushVectorRuntimeValueLocationOnRegister implements compiler.pushVectorRuntimeValueLocationOnRegister for amd64. -func (c *amd64Compiler) pushVectorRuntimeValueLocationOnRegister(reg asm.Register) (lowerBitsLocation *runtimeValueLocation) { - lowerBitsLocation = c.locationStack.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeV128Lo) - c.locationStack.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeV128Hi) - c.locationStack.markRegisterUsed(reg) - return -} - -type amd64LabelInfo struct { - // initialInstruction is the initial instruction for this label so other block can jump into it. - initialInstruction asm.Node - // initialStack is the initial value location stack from which we start compiling this label. - initialStack runtimeValueLocationStack - stackInitialized bool -} - -func (c *amd64Compiler) label(label wazeroir.Label) *amd64LabelInfo { - kind := label.Kind() - frames := c.labels[kind] - frameID := label.FrameID() - if c.frameIDMax < frameID { - c.frameIDMax = frameID - } - // If the frameID is not allocated yet, expand the slice by twice of the diff, - // so that we could reduce the allocation in the subsequent compilation. - if diff := frameID - len(frames) + 1; diff > 0 { - for i := 0; i < diff; i++ { - frames = append(frames, amd64LabelInfo{initialStack: newRuntimeValueLocationStack()}) - } - c.labels[kind] = frames - } - return &frames[frameID] -} - -// compileBuiltinFunctionCheckExitCode implements compiler.compileBuiltinFunctionCheckExitCode for the amd64 architecture. -func (c *amd64Compiler) compileBuiltinFunctionCheckExitCode() error { - if err := c.compileCallBuiltinFunction(builtinFunctionIndexCheckExitCode); err != nil { - return err - } - - // After the function call, we have to initialize the stack base pointer and memory reserved registers. - c.compileReservedStackBasePointerInitialization() - c.compileReservedMemoryPointerInitialization() - return nil -} - -// compileGoDefinedHostFunction constructs the entire code to enter the host function implementation, -// and return to the caller. -func (c *amd64Compiler) compileGoDefinedHostFunction() error { - // First we must update the location stack to reflect the number of host function inputs. - c.locationStack.init(c.typ) - - if c.withListener { - if err := c.compileCallBuiltinFunction(builtinFunctionIndexFunctionListenerBefore); err != nil { - return err - } - } - - // Host function needs access to the caller's Function Instance, and the caller's information is stored in the stack - // (as described in the doc of callEngine.stack). Here, we get the caller's *wasm.FunctionInstance from the stack, - // and save it in callEngine.exitContext.callerFunctionInstance so we can pass it to the host function - // without sacrificing the performance. - c.compileReservedStackBasePointerInitialization() - // Alias for readability. - tmp := amd64.RegAX - // Get the location of the callerFunction (*function) in the stack, which depends on the signature. - _, _, callerFunction := c.locationStack.getCallFrameLocations(c.typ) - // Load the value into the tmp register: tmp = &function{..} - callerFunction.setRegister(tmp) - c.compileLoadValueOnStackToRegister(callerFunction) - // tmp = *(tmp+functionSourceOffset) = &wasm.ModuleInstance{...} - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, functionModuleInstanceOffset, tmp) - // Load it onto callEngine.exitContext.callerFunctionInstance. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - tmp, - amd64ReservedRegisterForCallEngine, callEngineExitContextCallerModuleInstanceOffset) - // Reset the state of callerFunction value location so that we won't mess up subsequent code generation below. - c.locationStack.releaseRegister(callerFunction) - - if err := c.compileCallGoHostFunction(); err != nil { - return err - } - - // Initializes the reserved stack base pointer which is used to retrieve the call frame stack. - c.compileReservedStackBasePointerInitialization() - - // Go function can change the module state in arbitrary way, so we have to force - // the callEngine.moduleContext initialization on the function return. To do so, - // we zero-out callEngine.moduleInstance. - c.assembler.CompileConstToMemory(amd64.MOVQ, - 0, amd64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset) - return c.compileReturnFunction() -} - -// compile implements compiler.compile for the amd64 architecture. -func (c *amd64Compiler) compile(buf asm.Buffer) (stackPointerCeil uint64, err error) { - // c.stackPointerCeil tracks the stack pointer ceiling (max seen) value across all runtimeValueLocationStack(s) - // used for all labels (via setLocationStack), excluding the current one. - // Hence, we check here if the final block's max one exceeds the current c.stackPointerCeil. - stackPointerCeil = c.stackPointerCeil - if stackPointerCeil < c.locationStack.stackPointerCeil { - stackPointerCeil = c.locationStack.stackPointerCeil - } - - // Now that the max stack pointer is determined, we are invoking the callback. - // Note this MUST be called before Assemble() below. - c.assignStackPointerCeil(stackPointerCeil) - - err = c.assembler.Assemble(buf) - return -} - -// compileUnreachable implements compiler.compileUnreachable for the amd64 architecture. -func (c *amd64Compiler) compileUnreachable() error { - c.compileExitFromNativeCode(nativeCallStatusCodeUnreachable) - return nil -} - -// assignStackPointerCeil implements compilerImpl.assignStackPointerCeil for the amd64 architecture. -func (c *amd64Compiler) assignStackPointerCeil(ceil uint64) { - if c.assignStackPointerCeilNeeded != nil { - c.assignStackPointerCeilNeeded.AssignDestinationConstant(int64(ceil) << 3) - } -} - -// compileSet implements compiler.compileSet for the amd64 architecture. -func (c *amd64Compiler) compileSet(o *wazeroir.UnionOperation) error { - depth := int(o.U1) - isTargetVector := o.B3 - - setTargetIndex := int(c.locationStack.sp) - 1 - depth - - if isTargetVector { - _ = c.locationStack.pop() // ignore the higher 64-bits. - } - v := c.locationStack.pop() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - targetLocation := &c.locationStack.stack[setTargetIndex] - if targetLocation.onRegister() { - // We no longer need the register previously used by the target location. - c.locationStack.markRegisterUnused(targetLocation.register) - } - - reg := v.register - targetLocation.setRegister(reg) - targetLocation.valueType = v.valueType - if isTargetVector { - hi := &c.locationStack.stack[setTargetIndex+1] - hi.setRegister(reg) - } - return nil -} - -// compileGlobalGet implements compiler.compileGlobalGet for the amd64 architecture. -func (c *amd64Compiler) compileGlobalGet(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - intReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, move the pointer to the global slice into the allocated register. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextGlobalElement0AddressOffset, intReg) - - index := o.U1 - - // Now, move the location of the global instance into the register. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, intReg, 8*int64(index), intReg) - - // When an integer, reuse the pointer register for the value. Otherwise, allocate a float register for it. - valueReg := intReg - var vt runtimeValueType - var inst asm.Instruction - switch c.ir.Globals[index].ValType { - case wasm.ValueTypeI32: - inst = amd64.MOVL - vt = runtimeValueTypeI32 - case wasm.ValueTypeI64, wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - inst = amd64.MOVQ - vt = runtimeValueTypeI64 - case wasm.ValueTypeF32: - inst = amd64.MOVL - vt = runtimeValueTypeF32 - valueReg, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - case wasm.ValueTypeF64: - inst = amd64.MOVQ - vt = runtimeValueTypeF64 - valueReg, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - case wasm.ValueTypeV128: - inst = amd64.MOVDQU - vt = runtimeValueTypeV128Lo - valueReg, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - default: - panic("BUG: unknown runtime value type") - } - - // Using the register holding the pointer to the target instance, move its value into a register. - c.assembler.CompileMemoryToRegister(inst, intReg, globalInstanceValueOffset, valueReg) - - // Record that the retrieved global value on the top of the stack is now in a register. - if vt == runtimeValueTypeV128Lo { - c.pushVectorRuntimeValueLocationOnRegister(valueReg) - } else { - c.pushRuntimeValueLocationOnRegister(valueReg, vt) - } - return nil -} - -// compileGlobalSet implements compiler.compileGlobalSet for the amd64 architecture. -func (c *amd64Compiler) compileGlobalSet(o *wazeroir.UnionOperation) error { - index := o.U1 - - wasmValueType := c.ir.Globals[index].ValType - isV128 := wasmValueType == wasm.ValueTypeV128 - - // First, move the value to set into a temporary register. - val := c.locationStack.pop() - if isV128 { - // The previous val is higher 64-bits, and have to use lower 64-bit's runtimeValueLocation for allocation, etc. - val = c.locationStack.pop() - } - if err := c.compileEnsureOnRegister(val); err != nil { - return err - } - - // Allocate a register to hold the memory location of the target global instance. - intReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, move the pointer to the global slice into the allocated register. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextGlobalElement0AddressOffset, intReg) - - // Now, move the location of the global instance into the register. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, intReg, 8*int64(index), intReg) - - // Now ready to write the value to the global instance location. - var inst asm.Instruction - if isV128 { - inst = amd64.MOVDQU - } else if wasmValueType == wasm.ValueTypeI32 || wasmValueType == wasm.ValueTypeF32 { - inst = amd64.MOVL - } else { - inst = amd64.MOVQ - } - c.assembler.CompileRegisterToMemory(inst, val.register, intReg, globalInstanceValueOffset) - - // Since the value is now written to memory, release the value register. - c.locationStack.releaseRegister(val) - return nil -} - -// compileBr implements compiler.compileBr for the amd64 architecture. -func (c *amd64Compiler) compileBr(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - return c.branchInto(wazeroir.Label(o.U1)) -} - -// branchInto adds instruction necessary to jump into the given branch target. -func (c *amd64Compiler) branchInto(target wazeroir.Label) error { - if target.IsReturnTarget() { - return c.compileReturnFunction() - } else { - if c.ir.LabelCallers[target] > 1 { - // We can only re-use register state if when there's a single call-site. - // Release existing values on registers to the stack if there's multiple ones to have - // the consistent value location state at the beginning of label. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - } - // Set the initial stack of the target label, so we can start compiling the label - // with the appropriate value locations. Note we clone the stack here as we maybe - // manipulate the stack before compiler reaches the label. - targetLabel := c.label(target) - if !targetLabel.stackInitialized { - targetLabel.initialStack.cloneFrom(*c.locationStack) - targetLabel.stackInitialized = true - } - jmp := c.assembler.CompileJump(amd64.JMP) - c.assignJumpTarget(target, jmp) - } - return nil -} - -// compileBrIf implements compiler.compileBrIf for the amd64 architecture. -func (c *amd64Compiler) compileBrIf(o *wazeroir.UnionOperation) error { - cond := c.locationStack.pop() - var jmpWithCond asm.Node - if cond.onConditionalRegister() { - var inst asm.Instruction - switch cond.conditionalRegister { - case amd64.ConditionalRegisterStateE: - inst = amd64.JEQ - case amd64.ConditionalRegisterStateNE: - inst = amd64.JNE - case amd64.ConditionalRegisterStateS: - inst = amd64.JMI - case amd64.ConditionalRegisterStateNS: - inst = amd64.JPL - case amd64.ConditionalRegisterStateG: - inst = amd64.JGT - case amd64.ConditionalRegisterStateGE: - inst = amd64.JGE - case amd64.ConditionalRegisterStateL: - inst = amd64.JLT - case amd64.ConditionalRegisterStateLE: - inst = amd64.JLE - case amd64.ConditionalRegisterStateA: - inst = amd64.JHI - case amd64.ConditionalRegisterStateAE: - inst = amd64.JCC - case amd64.ConditionalRegisterStateB: - inst = amd64.JCS - case amd64.ConditionalRegisterStateBE: - inst = amd64.JLS - } - jmpWithCond = c.assembler.CompileJump(inst) - } else { - // Usually the comparison operand for br_if is on the conditional register, - // but in some cases, they are on the stack or register. - // For example, the following code - // i64.const 1 - // local.get 1 - // i64.add - // br_if .... - // will try to use the result of i64.add, which resides on the (virtual) stack, - // as the operand for br_if instruction. - if err := c.compileEnsureOnRegister(cond); err != nil { - return err - } - // Check if the value not equals zero. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, cond.register, cond.register) - - // Emit jump instruction which jumps when the value does not equals zero. - jmpWithCond = c.assembler.CompileJump(amd64.JNE) - c.locationStack.markRegisterUnused(cond.register) - } - - // Make sure that the next coming label is the else jump target. - thenTarget := wazeroir.Label(o.U1) - elseTarget := wazeroir.Label(o.U2) - thenToDrop := o.U3 - - // Here's the diagram of how we organize the instructions necessarily for brif operation. - // - // jmp_with_cond -> jmp (.Else) -> Then operations... - // |---------(satisfied)------------^^^ - // - // Note that .Else branch doesn't have ToDrop as .Else is in reality - // corresponding to either If's Else block or Br_if's else block in Wasm. - - // Emit the else branch. - if elseTarget.IsReturnTarget() { - if err := c.compileReturnFunction(); err != nil { - return err - } - } else { - labelInfo := c.label(elseTarget) - if !labelInfo.stackInitialized { - labelInfo.initialStack.cloneFrom(*c.locationStack) - labelInfo.stackInitialized = true - } - - elseJmp := c.assembler.CompileJump(amd64.JMP) - c.assignJumpTarget(elseTarget, elseJmp) - } - - // Handle then branch. - c.assembler.SetJumpTargetOnNext(jmpWithCond) - if err := compileDropRange(c, thenToDrop); err != nil { - return err - } - if thenTarget.IsReturnTarget() { - return c.compileReturnFunction() - } else { - thenLabel := thenTarget - if c.ir.LabelCallers[thenLabel] > 1 { - // We can only re-use register state if when there's a single call-site. - // Release existing values on registers to the stack if there's multiple ones to have - // the consistent value location state at the beginning of label. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - } - // Set the initial stack of the target label, so we can start compiling the label - // with the appropriate value locations. Note we clone the stack here as we maybe - // manipulate the stack before compiler reaches the label. - labelInfo := c.label(thenLabel) - if !labelInfo.stackInitialized { - labelInfo.initialStack.cloneFrom(*c.locationStack) - labelInfo.stackInitialized = true - } - thenJmp := c.assembler.CompileJump(amd64.JMP) - c.assignJumpTarget(thenLabel, thenJmp) - return nil - } -} - -// compileBrTable implements compiler.compileBrTable for the amd64 architecture. -func (c *amd64Compiler) compileBrTable(o *wazeroir.UnionOperation) error { - index := c.locationStack.pop() - - // If the operation only consists of the default target, we branch into it and return early. - if len(o.Us) == 2 { - c.locationStack.releaseRegister(index) - if err := compileDropRange(c, o.Us[1]); err != nil { - return err - } - return c.branchInto(wazeroir.Label(o.Us[0])) - } - - // Otherwise, we jump into the selected branch. - if err := c.compileEnsureOnRegister(index); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, we move the length of target list into the tmp register. - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(len(o.Us)/2-1), tmp) - - // Then, we compare the value with the length of targets. - c.assembler.CompileRegisterToRegister(amd64.CMPL, tmp, index.register) - - // If the value is larger than the length, - // we round the index to the length as the spec states that - // if the index is larger than or equal the length of list, - // branch into the default branch. - c.assembler.CompileRegisterToRegister(amd64.CMOVQCS, tmp, index.register) - - // We prepare the static data which holds the offset of - // each target's first instruction (incl. default) - // relative to the beginning of label tables. - // - // For example, if we have targets=[L0, L1] and default=L_DEFAULT, - // we emit the the code like this at [Emit the code for each targets and default branch] below. - // - // L0: - // 0x123001: XXXX, ... - // ..... - // L1: - // 0x123005: YYY, ... - // ..... - // L_DEFAULT: - // 0x123009: ZZZ, ... - // - // then offsetData becomes like [0x0, 0x5, 0x8]. - // By using this offset list, we could jump into the label for the index by - // "jmp offsetData[index]+0x123001" and "0x123001" can be acquired by "LEA" - // instruction. - // - // Note: We store each offset of 32-bite unsigned integer as 4 consecutive bytes. So more precisely, - // the above example's offsetData would be [0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0]. - // - // Note: this is similar to how GCC implements Switch statements in C. - offsetData := asm.NewStaticConst(make([]byte, 4*(len(o.Us)/2))) - - // Load the offsetData's address into tmp. - if err = c.assembler.CompileStaticConstToRegister(amd64.LEAQ, offsetData, tmp); err != nil { - return err - } - - // Now we have the address of first byte of offsetData in tmp register. - // So the target offset's first byte is at tmp+index*4 as we store - // the offset as 4 bytes for a 32-byte integer. - // Here, we store the offset into the index.register. - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVL, tmp, 0, index.register, 4, index.register) - - // Now we read the address of the beginning of the jump table. - // In the above example, this corresponds to reading the address of 0x123001. - c.assembler.CompileReadInstructionAddress(tmp, amd64.JMP) - - // Now we have the address of L0 in tmp register, and the offset to the target label in the index.register. - // So we could achieve the br_table jump by adding them and jump into the resulting address. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, index.register, tmp) - - c.assembler.CompileJumpToRegister(amd64.JMP, tmp) - - // We no longer need the index's register, so mark it unused. - c.locationStack.markRegisterUnused(index.register) - - // [Emit the code for each targets and default branch] - labelInitialInstructions := make([]asm.Node, len(o.Us)/2) - - // Since we might end up having the different stack state in each branch, - // we need to save the initial stack state here, and use the same initial state - // for each iteration. - initialLocationStack := c.getSavedTemporaryLocationStack() - - for i := range labelInitialInstructions { - // Emit the initial instruction of each target. - // We use NOP as we don't yet know the next instruction in each label. - // Assembler would optimize out this NOP during code generation, so this is harmless. - labelInitialInstructions[i] = c.assembler.CompileStandAlone(amd64.NOP) - - targetLabel := wazeroir.Label(o.Us[i*2]) - targetToDrop := o.Us[i*2+1] - if err = compileDropRange(c, targetToDrop); err != nil { - return err - } - if err = c.branchInto(targetLabel); err != nil { - return err - } - // After the iteration, reset the stack's state with initialLocationStack. - c.locationStack.cloneFrom(initialLocationStack) - } - - c.assembler.BuildJumpTable(offsetData, labelInitialInstructions) - return nil -} - -func (c *amd64Compiler) getSavedTemporaryLocationStack() runtimeValueLocationStack { - initialLocationStack := *c.locationStack // Take copy! - // Use c.brTableTmp for the underlying stack so that we could reduce the allocations. - if diff := int(initialLocationStack.sp) - len(c.brTableTmp); diff > 0 { - c.brTableTmp = append(c.brTableTmp, make([]runtimeValueLocation, diff)...) - } - copy(c.brTableTmp, initialLocationStack.stack[:initialLocationStack.sp]) - initialLocationStack.stack = c.brTableTmp - return initialLocationStack -} - -func (c *amd64Compiler) assignJumpTarget(label wazeroir.Label, jmpInstruction asm.Node) { - jmpTargetLabel := c.label(label) - targetInst := jmpTargetLabel.initialInstruction - if targetInst == nil { - // If the label isn't compiled yet, allocate the NOP node, and set as the initial instruction. - targetInst = c.assembler.AllocateNOP() - jmpTargetLabel.initialInstruction = targetInst - } - jmpInstruction.AssignJumpTarget(targetInst) -} - -// compileLabel implements compiler.compileLabel for the amd64 architecture. -func (c *amd64Compiler) compileLabel(o *wazeroir.UnionOperation) (skipLabel bool) { - label := wazeroir.Label(o.U1) - labelInfo := c.label(label) - - // If initialStack is not set, that means this label has never been reached. - if !labelInfo.stackInitialized { - skipLabel = true - return - } - - // We use NOP as a beginning of instructions in a label. - if labelBegin := labelInfo.initialInstruction; labelBegin == nil { - // We use NOP as a beginning of instructions in a label. - // This should be eventually optimized out by assembler. - labelInfo.initialInstruction = c.assembler.CompileStandAlone(amd64.NOP) - } else { - c.assembler.Add(labelBegin) - } - - // Set the initial stack. - c.setLocationStack(&labelInfo.initialStack) - return -} - -// compileCall implements compiler.compileCall for the amd64 architecture. -func (c *amd64Compiler) compileCall(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - functionIndex := o.U1 - - target := c.ir.Functions[functionIndex] - targetType := &c.ir.Types[target] - - targetAddressRegister, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, push the index to the callEngine.functionsElement0Address into the target register. - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(functionIndex)*functionSize, targetAddressRegister) - - // Next, we add the address of the first item of callEngine.functions slice (= &callEngine.functions[0]) - // to the target register. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, amd64ReservedRegisterForCallEngine, - callEngineModuleContextFunctionsElement0AddressOffset, targetAddressRegister) - - if err := c.compileCallFunctionImpl(targetAddressRegister, targetType); err != nil { - return err - } - return nil -} - -// compileCallIndirect implements compiler.compileCallIndirect for the amd64 architecture. -func (c *amd64Compiler) compileCallIndirect(o *wazeroir.UnionOperation) error { - offset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(offset); err != nil { - return nil - } - typeIndex := o.U1 - tableIndex := o.U2 - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp) - - tmp2, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp2) - - // Load the address of the target table: tmp = &module.Tables[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - // tmp = &module.Tables[0] + Index*8 = &module.Tables[0] + sizeOf(*TableInstance)*index = module.Tables[o.TableIndex]. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(tableIndex*8), tmp) - - // Then, we need to trap if the offset exceeds the length of table. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, tmp, tableInstanceTableLenOffset, offset.register) - c.compileMaybeExitFromNativeCode(amd64.JHI, nativeCallStatusCodeInvalidTableAccess) - - // next we check if the target's type matches the operation's one. - // In order to get the type instance's address, we have to multiply the offset - // by 8 as the offset is the "length" of table in Go's "[]uintptr{}", - // and size of uintptr equals 8 bytes == (2^3). - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, offset.register) - - // Adds the address of wasm.Table[0] stored as callEngine.tableElement0Address to the offset. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - tmp, tableInstanceTableOffset, offset.register) - - // "offset = (*offset) (== table[offset] == *code type)" - c.assembler.CompileMemoryToRegister(amd64.MOVQ, offset.register, 0, offset.register) - - // At this point offset.register holds the address of *code (as uintptr) at wasm.Table[offset]. - // - // Check if the value of table[offset] equals zero, meaning that the target is uninitialized. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, offset.register, offset.register) - - // Skipped if the target is initialized. - c.compileMaybeExitFromNativeCode(amd64.JNE, nativeCallStatusCodeInvalidTableAccess) - - // Next, we need to check the type matches, i.e. table[offset].source.TypeID == targetFunctionType's typeID. - // - // "tmp2 = [&moduleInstance.TypeIDs[0] + index * 4] (== moduleInstance.TypeIDs[index])" - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTypeIDsElement0AddressOffset, - tmp2) - c.assembler.CompileMemoryToRegister(amd64.MOVL, tmp2, int64(typeIndex)*4, tmp2) - - // Skipped if the type matches. - c.assembler.CompileMemoryToRegister(amd64.CMPL, offset.register, functionTypeIDOffset, tmp2) - c.compileMaybeExitFromNativeCode(amd64.JEQ, nativeCallStatusCodeTypeMismatchOnIndirectCall) - targetFunctionType := &c.ir.Types[typeIndex] - if err = c.compileCallFunctionImpl(offset.register, targetFunctionType); err != nil { - return nil - } - - // The offset register should be marked as un-used as we consumed in the function call. - c.locationStack.markRegisterUnused(offset.register, tmp, tmp2) - return nil -} - -// compileDrop implements compiler.compileDrop for the amd64 architecture. -func (c *amd64Compiler) compileDrop(o *wazeroir.UnionOperation) error { - return compileDropRange(c, o.U1) -} - -// compileSelectV128Impl implements compileSelect for vector values. -func (c *amd64Compiler) compileSelectV128Impl(selectorReg asm.Register) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Compare the conditional value with zero. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, selectorReg, selectorReg) - - // Set the jump if the top value is not zero. - jmpIfNotZero := c.assembler.CompileJump(amd64.JNE) - - // In this branch, we select the value of x2, so we move the value into x1.register so that - // we can have the result in x1.register regardless of the selection. - c.assembler.CompileRegisterToRegister(amd64.MOVDQU, x2.register, x1.register) - - // Else, we don't need to adjust value, just need to jump to the next instruction. - c.assembler.SetJumpTargetOnNext(jmpIfNotZero) - - // As noted, the result exists in x1.register regardless of the selector. - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - // Plus, x2.register is no longer used. - c.locationStack.markRegisterUnused(x2.register) - c.locationStack.markRegisterUnused(selectorReg) - return nil -} - -// compileSelect implements compiler.compileSelect for the amd64 architecture. -// -// The emitted native code depends on whether the values are on -// the physical registers or memory stack, or maybe conditional register. -func (c *amd64Compiler) compileSelect(o *wazeroir.UnionOperation) error { - cv := c.locationStack.pop() - if err := c.compileEnsureOnRegister(cv); err != nil { - return err - } - - isTargetVector := o.B3 - if isTargetVector { - return c.compileSelectV128Impl(cv.register) - } - - x2 := c.locationStack.pop() - // We do not consume x1 here, but modify the value according to - // the conditional value "c" above. - peekedX1 := c.locationStack.peek() - - // Compare the conditional value with zero. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, cv.register, cv.register) - - // Now we can use c.register as temporary location. - // We alias it here for readability. - tmpRegister := cv.register - - // Set the jump if the top value is not zero. - jmpIfNotZero := c.assembler.CompileJump(amd64.JNE) - - // If the value is zero, we must place the value of x2 onto the stack position of x1. - - // First we copy the value of x2 to the temporary register if x2 is not currently on a register. - if x2.onStack() { - x2.register = tmpRegister - c.compileLoadValueOnStackToRegister(x2) - } - - // - // At this point x2's value is always on a register. - // - - // Then release the value in the x2's register to the x1's stack position. - if peekedX1.onRegister() { - c.assembler.CompileRegisterToRegister(amd64.MOVQ, x2.register, peekedX1.register) - } else { - peekedX1.register = x2.register - c.compileReleaseRegisterToStack(peekedX1) // Note inside we mark the register unused! - } - - // Else, we don't need to adjust value, just need to jump to the next instruction. - c.assembler.SetJumpTargetOnNext(jmpIfNotZero) - - // In any case, we don't need x2 and c anymore! - c.locationStack.releaseRegister(x2) - c.locationStack.releaseRegister(cv) - return nil -} - -// compilePick implements compiler.compilePick for the amd64 architecture. -func (c *amd64Compiler) compilePick(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - depth := o.U1 - isTargetVector := o.B3 - - // TODO: if we track the type of values on the stack, - // we could optimize the instruction according to the bit size of the value. - // For now, we just move the entire register i.e. as a quad word (8 bytes). - pickTarget := &c.locationStack.stack[c.locationStack.sp-1-uint64(depth)] - reg, err := c.allocateRegister(pickTarget.getRegisterType()) - if err != nil { - return err - } - - if pickTarget.onRegister() { - var inst asm.Instruction - if isTargetVector { - inst = amd64.MOVDQU - } else if pickTarget.valueType == runtimeValueTypeI32 { // amd64 cannot copy single-precisions between registers. - inst = amd64.MOVL - } else { - inst = amd64.MOVQ - } - c.assembler.CompileRegisterToRegister(inst, pickTarget.register, reg) - } else if pickTarget.onStack() { - // Copy the value from the stack. - var inst asm.Instruction - if isTargetVector { - inst = amd64.MOVDQU - } else if pickTarget.valueType == runtimeValueTypeI32 || pickTarget.valueType == runtimeValueTypeF32 { - inst = amd64.MOVL - } else { - inst = amd64.MOVQ - } - // Note: stack pointers are ensured not to exceed 2^27 so this offset never exceeds 32-bit range. - c.assembler.CompileMemoryToRegister(inst, amd64ReservedRegisterForStackBasePointerAddress, - int64(pickTarget.stackPointer)*8, reg) - } - // Now we already placed the picked value on the register, - // so push the location onto the stack. - if isTargetVector { - c.pushVectorRuntimeValueLocationOnRegister(reg) - } else { - c.pushRuntimeValueLocationOnRegister(reg, pickTarget.valueType) - } - return nil -} - -// compileAdd implements compiler.compileAdd for the amd64 architecture. -func (c *amd64Compiler) compileAdd(o *wazeroir.UnionOperation) error { - // TODO: if the previous instruction is const, then - // this can be optimized. Same goes for other arithmetic instructions. - - var instruction asm.Instruction - - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - instruction = amd64.ADDL - case wazeroir.UnsignedTypeI64: - instruction = amd64.ADDQ - case wazeroir.UnsignedTypeF32: - instruction = amd64.ADDSS - case wazeroir.UnsignedTypeF64: - instruction = amd64.ADDSD - } - - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.peek() // Note this is peek, pop! - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // x1 += x2. - c.assembler.CompileRegisterToRegister(instruction, x2.register, x1.register) - - // We no longer need x2 register after ADD operation here, - // so we release it. - c.locationStack.releaseRegister(x2) - return nil -} - -// compileSub implements compiler.compileSub for the amd64 architecture. -func (c *amd64Compiler) compileSub(o *wazeroir.UnionOperation) error { - // TODO: if the previous instruction is const, then - // this can be optimized. Same goes for other arithmetic instructions. - - var instruction asm.Instruction - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - instruction = amd64.SUBL - case wazeroir.UnsignedTypeI64: - instruction = amd64.SUBQ - case wazeroir.UnsignedTypeF32: - instruction = amd64.SUBSS - case wazeroir.UnsignedTypeF64: - instruction = amd64.SUBSD - } - - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.peek() // Note this is peek, pop! - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // x1 -= x2. - c.assembler.CompileRegisterToRegister(instruction, x2.register, x1.register) - - // We no longer need x2 register after ADD operation here, - // so we release it. - c.locationStack.releaseRegister(x2) - return nil -} - -// compileMul implements compiler.compileMul for the amd64 architecture. -func (c *amd64Compiler) compileMul(o *wazeroir.UnionOperation) (err error) { - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - err = c.compileMulForInts(true, amd64.MULL) - case wazeroir.UnsignedTypeI64: - err = c.compileMulForInts(false, amd64.MULQ) - case wazeroir.UnsignedTypeF32: - err = c.compileMulForFloats(amd64.MULSS) - case wazeroir.UnsignedTypeF64: - err = c.compileMulForFloats(amd64.MULSD) - } - return -} - -// compileMulForInts emits instructions to perform integer multiplication for -// top two values on the stack. If unfamiliar with the convention for integer -// multiplication on x86, see https://www.felixcloutier.com/x86/mul. -// -// In summary, one of the values must be on the AX register, -// and the mul instruction stores the overflow info in DX register which we don't use. -// Here, we mean "the overflow info" by 65 bit or higher part of the result for 64 bit case. -// -// So, we have to ensure that -// 1. Previously located value on DX must be saved to memory stack. That is because -// the existing value will be overridden after the mul execution. -// 2. One of the operands (x1 or x2) must be on AX register. -// -// See https://www.felixcloutier.com/x86/mul#description for detail semantics. -func (c *amd64Compiler) compileMulForInts(is32Bit bool, mulInstruction asm.Instruction) error { - const ( - resultRegister = amd64.RegAX - reservedRegister = amd64.RegDX - ) - - x2 := c.locationStack.pop() - x1 := c.locationStack.pop() - - var valueOnAX *runtimeValueLocation - if x1.register == resultRegister { - valueOnAX = x1 - } else if x2.register == resultRegister { - valueOnAX = x2 - } else { - valueOnAX = x2 - // This case we move x2 to AX register. - c.onValueReleaseRegisterToStack(resultRegister) - if x2.onConditionalRegister() { - c.compileMoveConditionalToGeneralPurposeRegister(x2, resultRegister) - } else if x2.onStack() { - x2.setRegister(resultRegister) - c.compileLoadValueOnStackToRegister(x2) - c.locationStack.markRegisterUsed(resultRegister) - } else { - var inst asm.Instruction - if is32Bit { - inst = amd64.MOVL - } else { - inst = amd64.MOVQ - } - c.assembler.CompileRegisterToRegister(inst, x2.register, resultRegister) - - // We no longer uses the prev register of x2. - c.locationStack.releaseRegister(x2) - x2.setRegister(resultRegister) - c.locationStack.markRegisterUsed(resultRegister) - } - } - - // We have to make sure that at this point the operands must be on registers. - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // We have to save the existing value on DX. - // If the DX register is used by either x1 or x2, we don't need to - // save the value because it is consumed by mul anyway. - if x1.register != reservedRegister && x2.register != reservedRegister { - c.onValueReleaseRegisterToStack(reservedRegister) - } - - // Now ready to emit the mul instruction. - if x1 == valueOnAX { - c.assembler.CompileRegisterToNone(mulInstruction, x2.register) - } else { - c.assembler.CompileRegisterToNone(mulInstruction, x1.register) - } - - c.locationStack.markRegisterUnused(x2.register) - c.locationStack.markRegisterUnused(x1.register) - - // Now we have the result in the AX register, - // so we record it. - c.pushRuntimeValueLocationOnRegister(resultRegister, x1.valueType) - return nil -} - -func (c *amd64Compiler) compileMulForFloats(instruction asm.Instruction) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // x1 *= x2. - c.assembler.CompileRegisterToRegister(instruction, x2.register, x1.register) - - // We no longer need x2 register after MUL operation here, - // so we release it. - c.locationStack.releaseRegister(x2) - return nil -} - -// compileClz implements compiler.compileClz for the amd64 architecture. -func (c *amd64Compiler) compileClz(o *wazeroir.UnionOperation) error { - target := c.locationStack.pop() - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - if c.cpuFeatures.HasExtra(platform.CpuExtraFeatureABM) { - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileRegisterToRegister(amd64.LZCNTL, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.LZCNTQ, target.register, target.register) - } - } else { - // On processors that do not support LZCNT, we combine BSR (calculating - // most significant set bit) with XOR. This logic is described in - // "Replace Raw Assembly Code with Builtin Intrinsics" section in: - // https://developer.apple.com/documentation/apple-silicon/addressing-architectural-differences-in-your-macos-code. - - // First, we have to check if the target is non-zero as BSR is undefined - // on zero. See https://www.felixcloutier.com/x86/bsr. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, target.register, target.register) - jmpIfNonZero := c.assembler.CompileJump(amd64.JNE) - - // If the value is zero, we just push the const value. - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileConstToRegister(amd64.MOVL, int64(32), target.register) - } else { - c.assembler.CompileConstToRegister(amd64.MOVL, int64(64), target.register) - } - - // Emit the jmp instruction to jump to the position right after - // the non-zero case. - jmpAtEndOfZero := c.assembler.CompileJump(amd64.JMP) - - // Start emitting non-zero case. - c.assembler.SetJumpTargetOnNext(jmpIfNonZero) - // First, we calculate the most significant set bit. - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileRegisterToRegister(amd64.BSRL, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.BSRQ, target.register, target.register) - } - - // Now we XOR the value with the bit length minus one. - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileConstToRegister(amd64.XORL, 31, target.register) - } else { - c.assembler.CompileConstToRegister(amd64.XORQ, 63, target.register) - } - - // Finally the end jump instruction of zero case must target towards - // the next instruction. - c.assembler.SetJumpTargetOnNext(jmpAtEndOfZero) - } - - // We reused the same register of target for the result. - c.locationStack.markRegisterUnused(target.register) - c.pushRuntimeValueLocationOnRegister(target.register, target.valueType) - return nil -} - -// compileCtz implements compiler.compileCtz for the amd64 architecture. -func (c *amd64Compiler) compileCtz(o *wazeroir.UnionOperation) error { - target := c.locationStack.pop() - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - if c.cpuFeatures.HasExtra(platform.CpuExtraFeatureABM) { - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileRegisterToRegister(amd64.TZCNTL, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.TZCNTQ, target.register, target.register) - } - } else { - // On processors that do not support TZCNT, the BSF instruction is - // executed instead. The key difference between TZCNT and BSF - // instruction is that if source operand is zero, the content of - // destination operand is undefined. - // https://www.felixcloutier.com/x86/tzcnt.html - - // First we compare the target with zero. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, target.register, target.register) - jmpIfNonZero := c.assembler.CompileJump(amd64.JNE) - - // If the value is zero, we just push the const value. - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileConstToRegister(amd64.MOVL, int64(32), target.register) - } else { - c.assembler.CompileConstToRegister(amd64.MOVL, int64(64), target.register) - } - - // Emit the jmp instruction to jump to the position right after - // the non-zero case. - jmpAtEndOfZero := c.assembler.CompileJump(amd64.JMP) - - // Otherwise, emit the TZCNT. - c.assembler.SetJumpTargetOnNext(jmpIfNonZero) - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileRegisterToRegister(amd64.TZCNTL, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.TZCNTQ, target.register, target.register) - } - - // Finally the end jump instruction of zero case must target towards - // the next instruction. - c.assembler.SetJumpTargetOnNext(jmpAtEndOfZero) - } - - // We reused the same register of target for the result. - c.locationStack.markRegisterUnused(target.register) - c.pushRuntimeValueLocationOnRegister(target.register, target.valueType) - return nil -} - -// compilePopcnt implements compiler.compilePopcnt for the amd64 architecture. -func (c *amd64Compiler) compilePopcnt(o *wazeroir.UnionOperation) error { - target := c.locationStack.pop() - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - if unsignedInt == wazeroir.UnsignedInt32 { - c.assembler.CompileRegisterToRegister(amd64.POPCNTL, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.POPCNTQ, target.register, target.register) - } - - // We reused the same register of target for the result. - c.locationStack.markRegisterUnused(target.register) - c.pushRuntimeValueLocationOnRegister(target.register, target.valueType) - return nil -} - -// compileDiv implements compiler.compileDiv for the amd64 architecture. -func (c *amd64Compiler) compileDiv(o *wazeroir.UnionOperation) (err error) { - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeUint32: - err = c.compileDivForInts(true, false) - case wazeroir.SignedTypeUint64: - err = c.compileDivForInts(false, false) - case wazeroir.SignedTypeInt32: - err = c.compileDivForInts(true, true) - case wazeroir.SignedTypeInt64: - err = c.compileDivForInts(false, true) - case wazeroir.SignedTypeFloat32: - err = c.compileDivForFloats(true) - case wazeroir.SignedTypeFloat64: - err = c.compileDivForFloats(false) - } - return -} - -// compileDivForInts emits the instructions to perform division on the top -// two values of integer type on the stack and puts the quotient of the result -// onto the stack. For example, stack [..., 10, 3] results in [..., 3] where -// the remainder is discarded. -func (c *amd64Compiler) compileDivForInts(is32Bit bool, signed bool) error { - if err := c.performDivisionOnInts(false, is32Bit, signed); err != nil { - return err - } - // Now we have the quotient of the division result in the AX register, - // so we record it. - if is32Bit { - c.pushRuntimeValueLocationOnRegister(amd64.RegAX, runtimeValueTypeI32) - } else { - c.pushRuntimeValueLocationOnRegister(amd64.RegAX, runtimeValueTypeI64) - } - return nil -} - -// compileRem implements compiler.compileRem for the amd64 architecture. -func (c *amd64Compiler) compileRem(o *wazeroir.UnionOperation) (err error) { - var vt runtimeValueType - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedInt32: - err = c.performDivisionOnInts(true, true, true) - vt = runtimeValueTypeI32 - case wazeroir.SignedInt64: - err = c.performDivisionOnInts(true, false, true) - vt = runtimeValueTypeI64 - case wazeroir.SignedUint32: - err = c.performDivisionOnInts(true, true, false) - vt = runtimeValueTypeI32 - case wazeroir.SignedUint64: - err = c.performDivisionOnInts(true, false, false) - vt = runtimeValueTypeI64 - } - if err != nil { - return err - } - - // Now we have the remainder of the division result in the DX register, - // so we record it. - c.pushRuntimeValueLocationOnRegister(amd64.RegDX, vt) - return -} - -// performDivisionOnInts emits the instructions to do divisions on top two integers on the stack -// via DIV (unsigned div) and IDIV (signed div) instructions. -// See the following explanation of these instructions' semantics from https://www.lri.fr/~filliatr/ens/compil/x86-64.pdf -// -// >> Division requires special arrangements: idiv (signed) and div (unsigned) operate on a 2n-byte dividend and -// >> an n-byte divisor to produce an n-byte quotient and n-byte remainder. The dividend always lives in a fixed pair of -// >> registers (%edx and %eax for the 32-bit case; %rdx and %rax for the 64-bit case); the divisor is specified as the -// >> source operand in the instruction. The quotient goes in %eax (resp. %rax); the remainder in %edx (resp. %rdx). For -// >> signed division, the cltd (resp. ctqo) instruction is used to prepare %edx (resp. %rdx) with the sign extension of -// >> %eax (resp. %rax). For example, if a,b, c are memory locations holding quad words, then we could set c = a/b -// >> using the sequence: movq a(%rip), %rax; ctqo; idivq b(%rip); movq %rax, c(%rip). -// -// tl;dr is that the division result is placed in AX and DX registers after instructions emitted by this function -// where AX holds the quotient while DX the remainder of the division result. -func (c *amd64Compiler) performDivisionOnInts(isRem, is32Bit, signed bool) error { - const ( - quotientRegister = amd64.RegAX - remainderRegister = amd64.RegDX - ) - - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - // Ensures that previous values on these registers are saved to memory. - c.onValueReleaseRegisterToStack(quotientRegister) - c.onValueReleaseRegisterToStack(remainderRegister) - - // In order to ensure x2 is placed on a temporary register for x2 value other than AX and DX, - // we mark them as used here. - c.locationStack.markRegisterUsed(quotientRegister) - c.locationStack.markRegisterUsed(remainderRegister) - - // Ensure that x2 is placed on a register which is not either AX or DX. - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - // Now we successfully place x2 on a temp register, so we no longer need to - // mark these registers used. - c.locationStack.markRegisterUnused(quotientRegister) - c.locationStack.markRegisterUnused(remainderRegister) - - // Check if the x2 equals zero. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.TESTL, x2.register, x2.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.TESTQ, x2.register, x2.register) - } - - // Skipped if the divisor is nonzero. - c.compileMaybeExitFromNativeCode(amd64.JNE, nativeCallStatusIntegerDivisionByZero) - - // next, we ensure that x1 is placed on AX. - x1 := c.locationStack.pop() - if x1.onRegister() && x1.register != quotientRegister { - // Move x1 to quotientRegister. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.MOVL, x1.register, quotientRegister) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVQ, x1.register, quotientRegister) - } - c.locationStack.markRegisterUnused(x1.register) - x1.setRegister(quotientRegister) - } else if x1.onStack() { - x1.setRegister(quotientRegister) - c.compileLoadValueOnStackToRegister(x1) - } - - // Note: at this point, x1 is placed on AX, x2 is on a register which is not AX or DX. - - isSignedRem := isRem && signed - isSignedDiv := !isRem && signed - var signedRemMinusOneDivisorJmp asm.Node - if isSignedRem { - // If this is for getting remainder of signed division, - // we have to treat the special case where the divisor equals -1. - // For example, if this is 32-bit case, the result of (-2^31) / -1 equals (quotient=2^31, remainder=0) - // where quotient doesn't fit in the 32-bit range whose maximum is 2^31-1. - // x86 in this case cause floating point exception, but according to the Wasm spec - // if the divisor equals -1, the result must be zero (not undefined!) as opposed to be "undefined" - // for divisions on (-2^31) / -1 where we do not need to emit the special branches. - // For detail, please refer to https://stackoverflow.com/questions/56303282/why-idiv-with-1-causes-floating-point-exception - - // First we store zero into the remainder result register (DX) and compare the divisor with -1. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.XORL, remainderRegister, remainderRegister) - c.assembler.CompileRegisterToConst(amd64.CMPL, x2.register, -1) - } else { - c.assembler.CompileRegisterToRegister(amd64.XORQ, remainderRegister, remainderRegister) - c.assembler.CompileRegisterToConst(amd64.CMPQ, x2.register, -1) - } - - // If it equals minus one, we skip the normal case. - signedRemMinusOneDivisorJmp = c.assembler.CompileJump(amd64.JEQ) - } else if isSignedDiv { - // For signed division, we have to have branches for "math.MinInt{32,64} / -1" - // case which results in the floating point exception via division error as - // the resulting value exceeds the maximum of signed int. - - // First we compare the division with -1. - if is32Bit { - c.assembler.CompileRegisterToConst(amd64.CMPL, x2.register, -1) - } else { - c.assembler.CompileRegisterToConst(amd64.CMPQ, x2.register, -1) - } - - // If it doesn't equal minus one, we jump to the normal case. - nonMinusOneDivisorJmp := c.assembler.CompileJump(amd64.JNE) - - // next we check if the quotient is the most negative value for the signed integer. - // That means whether or not we try to do (math.MinInt32 / -1) or (math.MinInt64 / -1) respectively. - if is32Bit { - if err := c.assembler.CompileRegisterToStaticConst(amd64.CMPL, x1.register, c.minimum32BitSignedInt); err != nil { - return err - } - } else { - if err := c.assembler.CompileRegisterToStaticConst(amd64.CMPQ, x1.register, c.minimum64BitSignedInt); err != nil { - return err - } - } - - // Trap if we are trying to do (math.MinInt32 / -1) or (math.MinInt64 / -1), - // as that is the overflow in division as the result becomes 2^31 which is larger than - // the maximum of signed 32-bit int (2^31-1). - c.compileMaybeExitFromNativeCode(amd64.JNE, nativeCallStatusIntegerOverflow) - // Set the normal case's jump target. - c.assembler.SetJumpTargetOnNext(nonMinusOneDivisorJmp) - } - - // Now ready to emit the div instruction. - // Since the div instructions takes 2n byte dividend placed in DX:AX registers... - // * signed case - we need to sign-extend the dividend into DX register via CDQ (32 bit) or CQO (64 bit). - // * unsigned case - we need to zero DX register via "XOR DX DX" - if is32Bit && signed { - // Emit sign-extension to have 64 bit dividend over DX and AX registers. - c.assembler.CompileStandAlone(amd64.CDQ) - c.assembler.CompileRegisterToNone(amd64.IDIVL, x2.register) - } else if is32Bit && !signed { - // Zeros DX register to have 64 bit dividend over DX and AX registers. - c.assembler.CompileRegisterToRegister(amd64.XORQ, amd64.RegDX, amd64.RegDX) - c.assembler.CompileRegisterToNone(amd64.DIVL, x2.register) - } else if !is32Bit && signed { - // Emits sign-extension to have 128 bit dividend over DX and AX registers. - c.assembler.CompileStandAlone(amd64.CQO) - c.assembler.CompileRegisterToNone(amd64.IDIVQ, x2.register) - } else if !is32Bit && !signed { - // Zeros DX register to have 128 bit dividend over DX and AX registers. - c.assembler.CompileRegisterToRegister(amd64.XORQ, amd64.RegDX, amd64.RegDX) - c.assembler.CompileRegisterToNone(amd64.DIVQ, x2.register) - } - - // If this is signed rem instruction, we must set the jump target of - // the exit jump from division -1 case towards the next instruction. - if signedRemMinusOneDivisorJmp != nil { - c.assembler.SetJumpTargetOnNext(signedRemMinusOneDivisorJmp) - } - - // We mark them as unused so that we can push one of them onto the location stack at call sites. - c.locationStack.markRegisterUnused(remainderRegister) - c.locationStack.markRegisterUnused(quotientRegister) - c.locationStack.markRegisterUnused(x2.register) - return nil -} - -// compileDivForFloats emits the instructions to perform division -// on the top two values of float type on the stack, placing the result back onto the stack. -// For example, stack [..., 1.0, 4.0] results in [..., 0.25]. -func (c *amd64Compiler) compileDivForFloats(is32Bit bool) error { - if is32Bit { - return c.compileSimpleBinaryOp(amd64.DIVSS) - } else { - return c.compileSimpleBinaryOp(amd64.DIVSD) - } -} - -// compileAnd implements compiler.compileAnd for the amd64 architecture. -func (c *amd64Compiler) compileAnd(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileSimpleBinaryOp(amd64.ANDL) - case wazeroir.UnsignedInt64: - err = c.compileSimpleBinaryOp(amd64.ANDQ) - } - return -} - -// compileOr implements compiler.compileOr for the amd64 architecture. -func (c *amd64Compiler) compileOr(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileSimpleBinaryOp(amd64.ORL) - case wazeroir.UnsignedInt64: - err = c.compileSimpleBinaryOp(amd64.ORQ) - } - return -} - -// compileXor implements compiler.compileXor for the amd64 architecture. -func (c *amd64Compiler) compileXor(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileSimpleBinaryOp(amd64.XORL) - case wazeroir.UnsignedInt64: - err = c.compileSimpleBinaryOp(amd64.XORQ) - } - return -} - -// compileSimpleBinaryOp emits instructions to pop two values from the stack -// and perform the given instruction on these two values and push the result -// onto the stack. -func (c *amd64Compiler) compileSimpleBinaryOp(instruction asm.Instruction) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(instruction, x2.register, x1.register) - - // We consumed x2 register after the operation here, - // so we release it. - c.locationStack.releaseRegister(x2) - - // We already stored the result in the register used by x1 - // so we record it. - c.locationStack.markRegisterUnused(x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileShl implements compiler.compileShl for the amd64 architecture. -func (c *amd64Compiler) compileShl(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileShiftOp(amd64.SHLL, false) - case wazeroir.UnsignedInt64: - err = c.compileShiftOp(amd64.SHLQ, true) - } - return -} - -// compileShr implements compiler.compileShr for the amd64 architecture. -func (c *amd64Compiler) compileShr(o *wazeroir.UnionOperation) (err error) { - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedInt32: - err = c.compileShiftOp(amd64.SARL, true) - case wazeroir.SignedInt64: - err = c.compileShiftOp(amd64.SARQ, false) - case wazeroir.SignedUint32: - err = c.compileShiftOp(amd64.SHRL, true) - case wazeroir.SignedUint64: - err = c.compileShiftOp(amd64.SHRQ, false) - } - return -} - -// compileRotl implements compiler.compileRotl for the amd64 architecture. -func (c *amd64Compiler) compileRotl(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileShiftOp(amd64.ROLL, true) - case wazeroir.UnsignedInt64: - err = c.compileShiftOp(amd64.ROLQ, false) - } - return -} - -// compileRotr implements compiler.compileRotr for the amd64 architecture. -func (c *amd64Compiler) compileRotr(o *wazeroir.UnionOperation) (err error) { - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.compileShiftOp(amd64.RORL, true) - case wazeroir.UnsignedInt64: - err = c.compileShiftOp(amd64.RORQ, false) - } - return -} - -// compileShiftOp adds instructions for shift operations (SHR, SHL, ROTR, ROTL) -// where we have to place the second value (shift counts) on the CX register. -func (c *amd64Compiler) compileShiftOp(instruction asm.Instruction, is32Bit bool) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - x2 := c.locationStack.pop() - - // Ensures that x2 (holding shift counts) is placed on the CX register. - const shiftCountRegister = amd64.RegCX - if (x2.onRegister() && x2.register != shiftCountRegister) || x2.onStack() { - // If another value lives on the CX register, we release it to the stack. - c.onValueReleaseRegisterToStack(shiftCountRegister) - - if x2.onRegister() { - x2r := x2.register - // If x2 lives on a register, we move the value to CX. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.MOVL, x2r, shiftCountRegister) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVQ, x2r, shiftCountRegister) - } - // We no longer place any value on the original register, so we record it. - c.locationStack.markRegisterUnused(x2r) - } else { - // If it is on stack, we just move the memory allocated value to the CX register. - x2.setRegister(shiftCountRegister) - c.compileLoadValueOnStackToRegister(x2) - } - c.locationStack.markRegisterUsed(shiftCountRegister) - } - - x1 := c.locationStack.peek() // Note this is peek! - x1r := x1.register - - if x1.onRegister() { - c.assembler.CompileRegisterToRegister(instruction, shiftCountRegister, x1r) - } else { - // Shift target can be placed on a memory location. - // Note: stack pointers are ensured not to exceed 2^27 so this offset never exceeds 32-bit range. - c.assembler.CompileRegisterToMemory(instruction, shiftCountRegister, amd64ReservedRegisterForStackBasePointerAddress, int64(x1.stackPointer)*8) - } - - // We consumed x2 register after the operation here, - // so we release it. - c.locationStack.markRegisterUnused(shiftCountRegister) - return nil -} - -// compileAbs implements compiler.compileAbs for the amd64 architecture. -// -// See the following discussions for how we could take the abs of floats on x86 assembly. -// https://stackoverflow.com/questions/32408665/fastest-way-to-compute-absolute-value-using-sse/32422471#32422471 -// https://stackoverflow.com/questions/44630015/how-would-fabsdouble-be-implemented-on-x86-is-it-an-expensive-operation -func (c *amd64Compiler) compileAbs(o *wazeroir.UnionOperation) (err error) { - target := c.locationStack.peek() // Note this is peek! - if err = c.compileEnsureOnRegister(target); err != nil { - return err - } - - // First shift left by one to clear the sign bit, and then shift right by one. - if wazeroir.Float(o.B1) == wazeroir.Float32 { - c.assembler.CompileConstToRegister(amd64.PSLLD, 1, target.register) - c.assembler.CompileConstToRegister(amd64.PSRLD, 1, target.register) - } else { - c.assembler.CompileConstToRegister(amd64.PSLLQ, 1, target.register) - c.assembler.CompileConstToRegister(amd64.PSRLQ, 1, target.register) - } - return nil -} - -// compileNeg implements compiler.compileNeg for the amd64 architecture. -func (c *amd64Compiler) compileNeg(o *wazeroir.UnionOperation) (err error) { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - tmpReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // First we move the sign-bit mask (placed in memory) to the tmp register, - // since we cannot take XOR directly with float reg and const. - // And then negate the value by XOR it with the sign-bit mask. - if wazeroir.Float(o.B1) == wazeroir.Float32 { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.float32SignBitMask, tmpReg) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.XORPS, tmpReg, target.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.float64SignBitMask, tmpReg) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.XORPD, tmpReg, target.register) - } - return nil -} - -// compileCeil implements compiler.compileCeil for the amd64 architecture. -func (c *amd64Compiler) compileCeil(o *wazeroir.UnionOperation) (err error) { - // Internally, ceil can be performed via ROUND instruction with 0x02 mode. - // See https://android.googlesource.com/platform/bionic/+/882b8af/libm/x86_64/ceilf.S for example. - return c.compileRoundInstruction(wazeroir.Float(o.B1) == wazeroir.Float32, 0x02) -} - -// compileFloor implements compiler.compileFloor for the amd64 architecture. -func (c *amd64Compiler) compileFloor(o *wazeroir.UnionOperation) (err error) { - // Internally, floor can be performed via ROUND instruction with 0x01 mode. - // See https://android.googlesource.com/platform/bionic/+/882b8af/libm/x86_64/floorf.S for example. - return c.compileRoundInstruction(wazeroir.Float(o.B1) == wazeroir.Float32, 0x01) -} - -// compileTrunc implements compiler.compileTrunc for the amd64 architecture. -func (c *amd64Compiler) compileTrunc(o *wazeroir.UnionOperation) error { - // Internally, trunc can be performed via ROUND instruction with 0x03 mode. - // See https://android.googlesource.com/platform/bionic/+/882b8af/libm/x86_64/truncf.S for example. - return c.compileRoundInstruction(wazeroir.Float(o.B1) == wazeroir.Float32, 0x03) -} - -// compileNearest implements compiler.compileNearest for the amd64 architecture. -func (c *amd64Compiler) compileNearest(o *wazeroir.UnionOperation) error { - // Nearest can be performed via ROUND instruction with 0x00 mode. - return c.compileRoundInstruction(wazeroir.Float(o.B1) == wazeroir.Float32, 0x00) -} - -func (c *amd64Compiler) compileRoundInstruction(is32Bit bool, mode int64) error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - if is32Bit { - c.assembler.CompileRegisterToRegisterWithArg(amd64.ROUNDSS, target.register, target.register, byte(mode)) - } else { - c.assembler.CompileRegisterToRegisterWithArg(amd64.ROUNDSD, target.register, target.register, byte(mode)) - } - return nil -} - -// compileMin implements compiler.compileMin for the amd64 architecture. -func (c *amd64Compiler) compileMin(o *wazeroir.UnionOperation) error { - is32Bit := wazeroir.Float(o.B1) == wazeroir.Float32 - if is32Bit { - return c.compileMinOrMax(is32Bit, true, amd64.MINSS) - } else { - return c.compileMinOrMax(is32Bit, true, amd64.MINSD) - } -} - -// compileMax implements compiler.compileMax for the amd64 architecture. -func (c *amd64Compiler) compileMax(o *wazeroir.UnionOperation) error { - is32Bit := wazeroir.Float(o.B1) == wazeroir.Float32 - if is32Bit { - return c.compileMinOrMax(is32Bit, false, amd64.MAXSS) - } else { - return c.compileMinOrMax(is32Bit, false, amd64.MAXSD) - } -} - -// emitMinOrMax adds instructions to pop two values from the stack, and push back either minimum or -// minimum of these two values onto the stack according to the minOrMaxInstruction argument. -// minOrMaxInstruction must be one of MAXSS, MAXSD, MINSS or MINSD. -// Note: These native min/max instructions are almost compatible with min/max in the Wasm specification, -// but it is slightly different with respect to the NaN handling. -// Native min/max instructions return non-NaN value if exactly one of target values -// is NaN. For example native_{min,max}(5.0, NaN) returns always 5.0, not NaN. -// However, WebAssembly specifies that min/max must always return NaN if one of values is NaN. -// Therefore, in this function, we have to add conditional jumps to check if one of values is NaN before -// the native min/max, which is why we cannot simply emit a native min/max instruction here. -// -// For the semantics, see wazeroir.Min and wazeroir.Max for detail. -func (c *amd64Compiler) compileMinOrMax(is32Bit, isMin bool, minOrMaxInstruction asm.Instruction) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Check if this is (either x1 or x2 is NaN) or (x1 equals x2) case - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.UCOMISS, x2.register, x1.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.UCOMISD, x2.register, x1.register) - } - - // At this point, we have the three cases of conditional flags below - // (See https://www.felixcloutier.com/x86/ucomiss#operation for detail.) - // - // 1) Two values are NaN-free and different: All flags are cleared. - // 2) Two values are NaN-free and equal: Only ZF flags is set. - // 3) One of Two values is NaN: ZF, PF and CF flags are set. - - // Jump instruction to handle 1) case by checking the ZF flag - // as ZF is only set for 2) and 3) cases. - nanFreeOrDiffJump := c.assembler.CompileJump(amd64.JNE) - - // Start handling 2) and 3). - - // Jump if one of two values is NaN by checking the parity flag (PF). - includeNaNJmp := c.assembler.CompileJump(amd64.JPS) - - // Start handling 2). - - // Before we exit this case, we have to ensure that positive zero (or negative zero for min instruction) is - // returned if two values are positive and negative zeros. - var inst asm.Instruction - switch { - case is32Bit && isMin: - inst = amd64.ORPS - case !is32Bit && isMin: - inst = amd64.ORPD - case is32Bit && !isMin: - inst = amd64.ANDPS - case !is32Bit && !isMin: - inst = amd64.ANDPD - } - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - sameExitJmp := c.assembler.CompileJump(amd64.JMP) - - // start handling 3). - c.assembler.SetJumpTargetOnNext(includeNaNJmp) - - // We emit the ADD instruction to produce the NaN in x1. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.ADDSS, x2.register, x1.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.ADDSD, x2.register, x1.register) - } - - // Exit from the NaN case branch. - nanExitJmp := c.assembler.CompileJump(amd64.JMP) - - // Start handling 1). - c.assembler.SetJumpTargetOnNext(nanFreeOrDiffJump) - - // Now handle the NaN-free and different values case. - c.assembler.CompileRegisterToRegister(minOrMaxInstruction, x2.register, x1.register) - - // Set the jump target of 1) and 2) cases to the next instruction after 3) case. - c.assembler.SetJumpTargetOnNext(nanExitJmp) - c.assembler.SetJumpTargetOnNext(sameExitJmp) - - // Record that we consumed the x2 and placed the minOrMax result in the x1's register. - c.locationStack.markRegisterUnused(x2.register) - c.locationStack.markRegisterUnused(x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileCopysign implements compiler.compileCopysign for the amd64 architecture. -func (c *amd64Compiler) compileCopysign(o *wazeroir.UnionOperation) error { - is32Bit := wazeroir.Float(o.B1) == wazeroir.Float32 - - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - tmpReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Move the rest bit mask to the temp register. - if is32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.float32RestBitMask, tmpReg) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.float64RestBitMask, tmpReg) - } - if err != nil { - return err - } - - // Clear the sign bit of x1 via AND with the mask. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.ANDPS, tmpReg, x1.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.ANDPD, tmpReg, x1.register) - } - - // Move the sign bit mask to the temp register. - if is32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.float32SignBitMask, tmpReg) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.float64SignBitMask, tmpReg) - } - if err != nil { - return err - } - - // Clear the non-sign bits of x2 via AND with the mask. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.ANDPS, tmpReg, x2.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.ANDPD, tmpReg, x2.register) - } - - // Finally, copy the sign bit of x2 to x1. - if is32Bit { - c.assembler.CompileRegisterToRegister(amd64.ORPS, x2.register, x1.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.ORPD, x2.register, x1.register) - } - - // Record that we consumed the x2 and placed the copysign result in the x1's register. - c.locationStack.markRegisterUnused(x2.register) - c.locationStack.markRegisterUnused(x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileSqrt implements compiler.compileSqrt for the amd64 architecture. -func (c *amd64Compiler) compileSqrt(o *wazeroir.UnionOperation) error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - if wazeroir.Float(o.B1) == wazeroir.Float32 { - c.assembler.CompileRegisterToRegister(amd64.SQRTSS, target.register, target.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.SQRTSD, target.register, target.register) - } - return nil -} - -// compileI32WrapFromI64 implements compiler.compileI32WrapFromI64 for the amd64 architecture. -func (c *amd64Compiler) compileI32WrapFromI64() error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.MOVL, target.register, target.register) - target.valueType = runtimeValueTypeI32 - return nil -} - -// compileITruncFromF implements compiler.compileITruncFromF for the amd64 architecture. -// -// Note: in the following implementation, we use CVTSS2SI and CVTSD2SI to convert floats to signed integers. -// According to the Intel manual ([1],[2]), if the source float value is either +-Inf or NaN, or it exceeds representative ranges -// of target signed integer, then the instruction returns "masked" response float32SignBitMask (or float64SignBitMask for 64 bit case). -// [1] Chapter 11.5.2, SIMD Floating-Point Exception Conditions in "Vol 1, Intel® 64 and IA-32 Architectures Manual" -// -// https://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-1-manual.html -// -// [2] https://xem.github.io/minix86/manual/intel-x86-and-64-manual-vol1/o_7281d5ea06a5b67a-268.html -func (c *amd64Compiler) compileITruncFromF(o *wazeroir.UnionOperation) (err error) { - inputType := wazeroir.Float(o.B1) - outputType := wazeroir.SignedInt(o.B2) - nonTrapping := o.B3 - if inputType == wazeroir.Float32 && outputType == wazeroir.SignedInt32 { - err = c.emitSignedI32TruncFromFloat(true, nonTrapping) - } else if inputType == wazeroir.Float32 && outputType == wazeroir.SignedInt64 { - err = c.emitSignedI64TruncFromFloat(true, nonTrapping) - } else if inputType == wazeroir.Float64 && outputType == wazeroir.SignedInt32 { - err = c.emitSignedI32TruncFromFloat(false, nonTrapping) - } else if inputType == wazeroir.Float64 && outputType == wazeroir.SignedInt64 { - err = c.emitSignedI64TruncFromFloat(false, nonTrapping) - } else if inputType == wazeroir.Float32 && outputType == wazeroir.SignedUint32 { - err = c.emitUnsignedI32TruncFromFloat(true, nonTrapping) - } else if inputType == wazeroir.Float32 && outputType == wazeroir.SignedUint64 { - err = c.emitUnsignedI64TruncFromFloat(true, nonTrapping) - } else if inputType == wazeroir.Float64 && outputType == wazeroir.SignedUint32 { - err = c.emitUnsignedI32TruncFromFloat(false, nonTrapping) - } else if inputType == wazeroir.Float64 && outputType == wazeroir.SignedUint64 { - err = c.emitUnsignedI64TruncFromFloat(false, nonTrapping) - } - return -} - -// emitUnsignedI32TruncFromFloat implements compileITruncFromF when the destination type is a 32-bit unsigned integer. -func (c *amd64Compiler) emitUnsignedI32TruncFromFloat(isFloat32Bit, nonTrapping bool) error { - source := c.locationStack.pop() - if err := c.compileEnsureOnRegister(source); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, we check the source float value is above or equal math.MaxInt32+1. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.float32ForMaximumSigned32bitIntPlusOne, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.float64ForMaximumSigned32bitIntPlusOne, source.register) - } - if err != nil { - return err - } - - // Check the parity flag (set when the value is NaN), and if it is set, we should raise an exception. - var nonTrappingNaNJump asm.Node - if nonTrapping { - jmpIfNotNaN := c.assembler.CompileJump(amd64.JPC) // jump if parity is not set. - // In non trapping case, NaN is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORL, result, result) - nonTrappingNaNJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotNaN) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPC, nativeCallStatusCodeInvalidFloatToIntConversion) - } - - // Jump if the source float value is above or equal math.MaxInt32+1. - jmpAboveOrEqualMaxIn32PlusOne := c.assembler.CompileJump(amd64.JCC) - - // next we convert the value as a signed integer. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SL, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SL, source.register, result) - } - - // Then if the result is minus, it is invalid conversion from minus float (incl. -Inf). - c.assembler.CompileRegisterToRegister(amd64.TESTL, result, result) - - var nonTrappingMinusJump asm.Node - if nonTrapping { - jmpIfNotMinusOrMinusInf := c.assembler.CompileJump(amd64.JPL) - // In non trapping case, the minus value is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORL, result, result) - nonTrappingMinusJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotMinusOrMinusInf) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPL, nativeCallStatusIntegerOverflow) - } - - // Otherwise, the values is valid. - okJmpForLessThanMaxInt32PlusOne := c.assembler.CompileJump(amd64.JMP) - - // Now, start handling the case where the original float value is above or equal math.MaxInt32+1. - // - // First, we subtract the math.MaxInt32+1 from the original value so it can fit in signed 32-bit integer. - c.assembler.SetJumpTargetOnNext(jmpAboveOrEqualMaxIn32PlusOne) - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.SUBSS, c.float32ForMaximumSigned32bitIntPlusOne, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.SUBSD, c.float64ForMaximumSigned32bitIntPlusOne, source.register) - } - if err != nil { - return err - } - - // Then, convert the subtracted value as a signed 32-bit integer. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SL, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SL, source.register, result) - } - - // next, we have to check if the value is from NaN, +Inf. - // NaN or +Inf cases result in 0x8000_0000 according to the semantics of conversion, - // This means we check if the result int value is minus or not. - c.assembler.CompileRegisterToRegister(amd64.TESTL, result, result) - - // If the result is minus, the conversion is invalid (from NaN or +Inf) - var nonTrappingAboveOrEqualMaxInt32PlusOne asm.Node - if nonTrapping { - jmpIfNotPlusInf := c.assembler.CompileJump(amd64.JPL) - err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.maximum32BitUnsignedInt, result) - if err != nil { - return err - } - nonTrappingAboveOrEqualMaxInt32PlusOne = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotPlusInf) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPL, nativeCallStatusIntegerOverflow) - } - - // Otherwise, we successfully converted the source float minus (math.MaxInt32+1) to int. - // So, we retrieve the original source float value by adding the sign mask. - if err = c.assembler.CompileStaticConstToRegister(amd64.ADDL, c.float32SignBitMask, result); err != nil { - return err - } - - // We jump to the next instructions for valid cases. - c.assembler.SetJumpTargetOnNext(okJmpForLessThanMaxInt32PlusOne) - if nonTrapping { - c.assembler.SetJumpTargetOnNext(nonTrappingAboveOrEqualMaxInt32PlusOne) - c.assembler.SetJumpTargetOnNext(nonTrappingMinusJump) - c.assembler.SetJumpTargetOnNext(nonTrappingNaNJump) - } - - // We consumed the source's register and placed the conversion result - // in the result register. - c.locationStack.markRegisterUnused(source.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return nil -} - -// emitUnsignedI32TruncFromFloat implements compileITruncFromF when the destination type is a 64-bit unsigned integer. -func (c *amd64Compiler) emitUnsignedI64TruncFromFloat(isFloat32Bit, nonTrapping bool) error { - source := c.locationStack.pop() - if err := c.compileEnsureOnRegister(source); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First, we check the source float value is above or equal math.MaxInt64+1. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.float32ForMaximumSigned64bitIntPlusOne, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.float64ForMaximumSigned64bitIntPlusOne, source.register) - } - if err != nil { - return err - } - - // Check the parity flag (set when the value is NaN), and if it is set, we should raise an exception. - var nonTrappingNaNJump asm.Node - if nonTrapping { - jmpIfNotNaN := c.assembler.CompileJump(amd64.JPC) // jump if parity is c.not set. - // In non trapping case, NaN is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORQ, result, result) - nonTrappingNaNJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotNaN) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPC, nativeCallStatusCodeInvalidFloatToIntConversion) - } - - // Jump if the source float values is above or equal math.MaxInt64+1. - jmpAboveOrEqualMaxIn32PlusOne := c.assembler.CompileJump(amd64.JCC) - - // next we convert the value as a signed integer. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SQ, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SQ, source.register, result) - } - - // Then if the result is minus, it is invalid conversion from minus float (incl. -Inf). - c.assembler.CompileRegisterToRegister(amd64.TESTQ, result, result) - - var nonTrappingMinusJump asm.Node - if nonTrapping { - jmpIfNotMinusOrMinusInf := c.assembler.CompileJump(amd64.JPL) - // In non trapping case, the minus value is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORQ, result, result) - nonTrappingMinusJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotMinusOrMinusInf) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPL, nativeCallStatusIntegerOverflow) - } - - // Otherwise, the values is valid. - okJmpForLessThanMaxInt64PlusOne := c.assembler.CompileJump(amd64.JMP) - - // Now, start handling the case where the original float value is above or equal math.MaxInt64+1. - // - // First, we subtract the math.MaxInt64+1 from the original value so it can fit in signed 64-bit integer. - c.assembler.SetJumpTargetOnNext(jmpAboveOrEqualMaxIn32PlusOne) - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.SUBSS, c.float32ForMaximumSigned64bitIntPlusOne, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.SUBSD, c.float64ForMaximumSigned64bitIntPlusOne, source.register) - } - if err != nil { - return err - } - - // Then, convert the subtracted value as a signed 64-bit integer. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SQ, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SQ, source.register, result) - } - - // next, we have to check if the value is from NaN, +Inf. - // NaN or +Inf cases result in 0x8000_0000 according to the semantics of conversion, - // This means we check if the result int value is minus or not. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, result, result) - - // If the result is minus, the conversion is invalid (from NaN or +Inf) - var nonTrappingAboveOrEqualMaxInt64PlusOne asm.Node - if nonTrapping { - jmpIfNotPlusInf := c.assembler.CompileJump(amd64.JPL) - err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.maximum64BitUnsignedInt, result) - if err != nil { - return err - } - nonTrappingAboveOrEqualMaxInt64PlusOne = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotPlusInf) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPL, nativeCallStatusIntegerOverflow) - } - - // Otherwise, we successfully converted the the source float minus (math.MaxInt64+1) to int. - // So, we retrieve the original source float value by adding the sign mask. - if err = c.assembler.CompileStaticConstToRegister(amd64.ADDQ, c.float64SignBitMask, result); err != nil { - return err - } - - // We jump to the next instructions for valid cases. - c.assembler.SetJumpTargetOnNext(okJmpForLessThanMaxInt64PlusOne) - if nonTrapping { - c.assembler.SetJumpTargetOnNext(nonTrappingAboveOrEqualMaxInt64PlusOne) - c.assembler.SetJumpTargetOnNext(nonTrappingMinusJump) - c.assembler.SetJumpTargetOnNext(nonTrappingNaNJump) - } - - // We consumed the source's register and placed the conversion result - // in the result register. - c.locationStack.markRegisterUnused(source.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI64) - return nil -} - -// emitSignedI32TruncFromFloat implements compileITruncFromF when the destination type is a 32-bit signed integer. -func (c *amd64Compiler) emitSignedI32TruncFromFloat(isFloat32Bit, nonTrapping bool) error { - source := c.locationStack.pop() - if err := c.compileEnsureOnRegister(source); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First we unconditionally convert source to integer via CVTTSS2SI (CVTTSD2SI for 64bit float). - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SL, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SL, source.register, result) - } - - // We compare the conversion result with the sign bit mask to check if it is either - // 1) the source float value is either +-Inf or NaN, or it exceeds representative ranges of 32bit signed integer, or - // 2) the source equals the minimum signed 32-bit (=-2147483648.000000) whose bit pattern is float32ForMinimumSigned32bitIntegerAddress for 32 bit float - // or float64ForMinimumSigned32bitIntegerAddress for 64bit float. - err = c.assembler.CompileStaticConstToRegister(amd64.CMPL, c.float32SignBitMask, result) - if err != nil { - return err - } - - // Otherwise, jump to exit as the result is valid. - okJmp := c.assembler.CompileJump(amd64.JNE) - - // Start handling the case of 1) and 2). - // First, check if the value is NaN. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.UCOMISS, source.register, source.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.UCOMISD, source.register, source.register) - } - - // Check the parity flag (set when the value is NaN), and if it is set, we should raise an exception. - var nontrappingNanJump asm.Node - if nonTrapping { - jmpIfNotNaN := c.assembler.CompileJump(amd64.JPC) // jump if parity is not set. - // In non trapping case, NaN is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORL, result, result) - nontrappingNanJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotNaN) - } else { - // If the value is NaN, we return the function with nativeCallStatusCodeInvalidFloatToIntConversion. - c.compileMaybeExitFromNativeCode(amd64.JPC, nativeCallStatusCodeInvalidFloatToIntConversion) - } - - // Check if the value is larger than or equal the minimum 32-bit integer value, - // meaning that the value exceeds the lower bound of 32-bit signed integer range. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.float32ForMinimumSigned32bitInteger, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.float64ForMinimumSigned32bitInteger, source.register) - } - if err != nil { - return err - } - - if !nonTrapping { - // Trap if the value does not exceed the lower bound. - if isFloat32Bit { - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusIntegerOverflow) - } else { - c.compileMaybeExitFromNativeCode(amd64.JHI, nativeCallStatusIntegerOverflow) - } - - // At this point, the value is the minimum signed 32-bit int (=-2147483648.000000) or larger than 32-bit maximum. - // So, check if the value equals the minimum signed 32-bit int. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.fourZeros, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.eightZeros, source.register) - } - if err != nil { - return err - } - - // Trap if the value is not minus (= the minimum signed 32-bit int). - c.compileMaybeExitFromNativeCode(amd64.JCS, nativeCallStatusIntegerOverflow) - - // We jump to the next instructions for valid cases. - c.assembler.SetJumpTargetOnNext(okJmp) - } else { - // Jump if the value does not exceed the lower bound. - var jmpIfNotExceedsLowerBound asm.Node - if isFloat32Bit { - jmpIfNotExceedsLowerBound = c.assembler.CompileJump(amd64.JCC) - } else { - jmpIfNotExceedsLowerBound = c.assembler.CompileJump(amd64.JHI) - } - - // If the value exceeds the lower bound, we "saturate" it to the minimum. - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.minimum32BitSignedInt, result); err != nil { - return err - } - nonTrappingSaturatedMinimumJump := c.assembler.CompileJump(amd64.JMP) - - // Otherwise, the value is the minimum signed 32-bit int (=-2147483648.000000) or larger than 32-bit maximum. - c.assembler.SetJumpTargetOnNext(jmpIfNotExceedsLowerBound) - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.fourZeros, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.eightZeros, source.register) - } - if err != nil { - return err - } - jmpIfMinimumSignedInt := c.assembler.CompileJump(amd64.JCS) // jump if the value is minus (= the minimum signed 32-bit int). - - // If the value exceeds signed 32-bit maximum, we saturate it to the maximum. - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVL, c.maximum32BitSignedInt, result); err != nil { - return err - } - - c.assembler.SetJumpTargetOnNext(okJmp) - c.assembler.SetJumpTargetOnNext(nontrappingNanJump) - c.assembler.SetJumpTargetOnNext(nonTrappingSaturatedMinimumJump) - c.assembler.SetJumpTargetOnNext(jmpIfMinimumSignedInt) - } - - // We consumed the source's register and placed the conversion result - // in the result register. - c.locationStack.markRegisterUnused(source.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return nil -} - -// emitSignedI64TruncFromFloat implements compileITruncFromF when the destination type is a 64-bit signed integer. -func (c *amd64Compiler) emitSignedI64TruncFromFloat(isFloat32Bit, nonTrapping bool) error { - source := c.locationStack.pop() - if err := c.compileEnsureOnRegister(source); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // First we unconditionally convert source to integer via CVTTSS2SI (CVTTSD2SI for 64bit float). - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.CVTTSS2SQ, source.register, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTTSD2SQ, source.register, result) - } - - // We compare the conversion result with the sign bit mask to check if it is either - // 1) the source float value is either +-Inf or NaN, or it exceeds representative ranges of 32bit signed integer, or - // 2) the source equals the minimum signed 32-bit (=-9223372036854775808.0) whose bit pattern is float32ForMinimumSigned64bitIntegerAddress for 32 bit float - // or float64ForMinimumSigned64bitIntegerAddress for 64bit float. - err = c.assembler.CompileStaticConstToRegister(amd64.CMPQ, c.float64SignBitMask, result) - if err != nil { - return err - } - - // Otherwise, we simply jump to exit as the result is valid. - okJmp := c.assembler.CompileJump(amd64.JNE) - - // Start handling the case of 1) and 2). - // First, check if the value is NaN. - if isFloat32Bit { - c.assembler.CompileRegisterToRegister(amd64.UCOMISS, source.register, source.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.UCOMISD, source.register, source.register) - } - - // Check the parity flag (set when the value is NaN), and if it is set, we should raise an exception. - var nontrappingNanJump asm.Node - if nonTrapping { - jmpIfNotNaN := c.assembler.CompileJump(amd64.JPC) // jump if parity is not set. - // In non trapping case, NaN is casted as zero. - // Zero out the result register by XOR itsself. - c.assembler.CompileRegisterToRegister(amd64.XORQ, result, result) - nontrappingNanJump = c.assembler.CompileJump(amd64.JMP) - c.assembler.SetJumpTargetOnNext(jmpIfNotNaN) - } else { - c.compileMaybeExitFromNativeCode(amd64.JPC, nativeCallStatusCodeInvalidFloatToIntConversion) - } - - // Check if the value is larger than or equal the minimum 64-bit integer value, - // meaning that the value exceeds the lower bound of 64-bit signed integer range. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.float32ForMinimumSigned64bitInteger, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.float64ForMinimumSigned64bitInteger, source.register) - } - if err != nil { - return err - } - - if !nonTrapping { - // Jump if the value is -Inf. - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusIntegerOverflow) - - // At this point, the value is the minimum signed 64-bit int (=-9223372036854775808.0) or larger than 64-bit maximum. - // So, check if the value equals the minimum signed 64-bit int. - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.fourZeros, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.eightZeros, source.register) - } - if err != nil { - return err - } - - // Trap if the value is not minus (= the minimum signed 64-bit int). - c.compileMaybeExitFromNativeCode(amd64.JCS, nativeCallStatusIntegerOverflow) - - // We jump to the next instructions for valid cases. - c.assembler.SetJumpTargetOnNext(okJmp) - } else { - // Jump if the value is not -Inf. - jmpIfNotExceedsLowerBound := c.assembler.CompileJump(amd64.JCC) - - // If the value exceeds the lower bound, we "saturate" it to the minimum. - err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.minimum64BitSignedInt, result) - if err != nil { - return err - } - - nonTrappingSaturatedMinimumJump := c.assembler.CompileJump(amd64.JMP) - - // Otherwise, the value is the minimum signed 64-bit int (=-9223372036854775808.0) or larger than 64-bit maximum. - // So, check if the value equals the minimum signed 64-bit int. - c.assembler.SetJumpTargetOnNext(jmpIfNotExceedsLowerBound) - if isFloat32Bit { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISS, c.fourZeros, source.register) - } else { - err = c.assembler.CompileStaticConstToRegister(amd64.UCOMISD, c.eightZeros, source.register) - } - if err != nil { - return err - } - - jmpIfMinimumSignedInt := c.assembler.CompileJump(amd64.JCS) // jump if the value is minus (= the minimum signed 64-bit int). - - // If the value exceeds signed 64-bit maximum, we saturate it to the maximum. - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVQ, c.maximum64BitSignedInt, result); err != nil { - return err - } - - c.assembler.SetJumpTargetOnNext(okJmp) - c.assembler.SetJumpTargetOnNext(jmpIfMinimumSignedInt) - c.assembler.SetJumpTargetOnNext(nonTrappingSaturatedMinimumJump) - c.assembler.SetJumpTargetOnNext(nontrappingNanJump) - } - - // We consumed the source's register and placed the conversion result - // in the result register. - c.locationStack.markRegisterUnused(source.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI64) - return nil -} - -// compileFConvertFromI implements compiler.compileFConvertFromI for the amd64 architecture. -func (c *amd64Compiler) compileFConvertFromI(o *wazeroir.UnionOperation) (err error) { - inputType := wazeroir.SignedInt(o.B1) - outputType := wazeroir.Float(o.B2) - if outputType == wazeroir.Float32 && inputType == wazeroir.SignedInt32 { - err = c.compileSimpleConversion(amd64.CVTSL2SS, registerTypeVector, runtimeValueTypeF32) // = CVTSI2SS for 32bit int - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedInt64 { - err = c.compileSimpleConversion(amd64.CVTSQ2SS, registerTypeVector, runtimeValueTypeF32) // = CVTSI2SS for 64bit int - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedInt32 { - err = c.compileSimpleConversion(amd64.CVTSL2SD, registerTypeVector, runtimeValueTypeF64) // = CVTSI2SD for 32bit int - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedInt64 { - err = c.compileSimpleConversion(amd64.CVTSQ2SD, registerTypeVector, runtimeValueTypeF64) // = CVTSI2SD for 64bit int - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedUint32 { - // See the following link for why we use 64bit conversion for unsigned 32bit integer sources: - // https://stackoverflow.com/questions/41495498/fpu-operations-generated-by-gcc-during-casting-integer-to-float. - // - // Here's the summary: - // >> CVTSI2SS is indeed designed for converting a signed integer to a scalar single-precision float, - // >> not an unsigned integer like you have here. So what gives? Well, a 64-bit processor has 64-bit wide - // >> registers available, so the unsigned 32-bit input values can be stored as signed 64-bit intermediate values, - // >> which allows CVTSI2SS to be used after all. - err = c.compileSimpleConversion(amd64.CVTSQ2SS, registerTypeVector, runtimeValueTypeF32) // = CVTSI2SS for 64bit int. - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedUint32 { - // For the same reason above, we use 64bit conversion for unsigned 32bit. - err = c.compileSimpleConversion(amd64.CVTSQ2SD, registerTypeVector, runtimeValueTypeF64) // = CVTSI2SD for 64bit int. - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedUint64 { - err = c.emitUnsignedInt64ToFloatConversion(true) - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedUint64 { - err = c.emitUnsignedInt64ToFloatConversion(false) - } - return -} - -// emitUnsignedInt64ToFloatConversion is handling the case of unsigned 64-bit integer -// in compileFConvertFromI. -func (c *amd64Compiler) emitUnsignedInt64ToFloatConversion(isFloat32bit bool) error { - // The logic here is exactly the same as GCC emits for the following code: - // - // float convert(int num) { - // float foo; - // uint64_t ptr1 = 100; - // foo = (float)(ptr1); - // return foo; - // } - // - // which is compiled by GCC as - // - // convert: - // push rbp - // mov rbp, rsp - // mov DWORD PTR [rbp-20], edi - // mov DWORD PTR [rbp-4], 100 - // mov eax, DWORD PTR [rbp-4] - // test rax, rax - // js .handle_sign_bit_case - // cvtsi2ss xmm0, rax - // jmp .exit - // .handle_sign_bit_case: - // mov rdx, rax - // shr rdx - // and eax, 1 - // or rdx, rax - // cvtsi2ss xmm0, rdx - // addsd xmm0, xmm0 - // .exit: ... - // - // tl;dr is that we have a branch depending on whether or not sign bit is set. - - origin := c.locationStack.pop() - if err := c.compileEnsureOnRegister(origin); err != nil { - return err - } - - dest, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(dest) - - tmpReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Check if the most significant bit (sign bit) is set. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, origin.register, origin.register) - - // Jump if the sign bit is set. - jmpIfSignbitSet := c.assembler.CompileJump(amd64.JMI) - - // Otherwise, we could fit the unsigned int into float32. - // So, we convert it to float32 and emit jump instruction to exit from this branch. - if isFloat32bit { - c.assembler.CompileRegisterToRegister(amd64.CVTSQ2SS, origin.register, dest) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTSQ2SD, origin.register, dest) - } - exitFromSignbitUnSet := c.assembler.CompileJump(amd64.JMP) - - // Now handling the case where sign-bit is set. - // We emit the following sequences: - // mov tmpReg, origin - // shr tmpReg, 1 - // and origin, 1 - // or tmpReg, origin - // cvtsi2ss xmm0, tmpReg - // addsd xmm0, xmm0 - - c.assembler.SetJumpTargetOnNext(jmpIfSignbitSet) - c.assembler.CompileRegisterToRegister(amd64.MOVQ, origin.register, tmpReg) - c.assembler.CompileConstToRegister(amd64.SHRQ, 1, tmpReg) - c.assembler.CompileConstToRegister(amd64.ANDQ, 1, origin.register) - c.assembler.CompileRegisterToRegister(amd64.ORQ, origin.register, tmpReg) - if isFloat32bit { - c.assembler.CompileRegisterToRegister(amd64.CVTSQ2SS, tmpReg, dest) - } else { - c.assembler.CompileRegisterToRegister(amd64.CVTSQ2SD, tmpReg, dest) - } - if isFloat32bit { - c.assembler.CompileRegisterToRegister(amd64.ADDSS, dest, dest) - } else { - c.assembler.CompileRegisterToRegister(amd64.ADDSD, dest, dest) - } - - // Now, we finished the sign-bit set branch. - // We have to make the exit jump target of sign-bit unset branch - // towards the next instruction. - c.assembler.SetJumpTargetOnNext(exitFromSignbitUnSet) - - // We consumed the origin's register and placed the conversion result - // in the dest register. - c.locationStack.markRegisterUnused(origin.register) - if isFloat32bit { - c.pushRuntimeValueLocationOnRegister(dest, runtimeValueTypeF32) - } else { - c.pushRuntimeValueLocationOnRegister(dest, runtimeValueTypeF64) - } - return nil -} - -// compileSimpleConversion pops a value type from the stack, and applies the -// given instruction on it, and push the result onto a register of the given type. -func (c *amd64Compiler) compileSimpleConversion(convInstruction asm.Instruction, - destinationRegisterType registerType, destinationValueType runtimeValueType, -) error { - origin := c.locationStack.pop() - if err := c.compileEnsureOnRegister(origin); err != nil { - return err - } - - dest, err := c.allocateRegister(destinationRegisterType) - if err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(convInstruction, origin.register, dest) - - c.locationStack.markRegisterUnused(origin.register) - c.pushRuntimeValueLocationOnRegister(dest, destinationValueType) - return nil -} - -// compileF32DemoteFromF64 implements compiler.compileF32DemoteFromF64 for the amd64 architecture. -func (c *amd64Compiler) compileF32DemoteFromF64() error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.CVTSD2SS, target.register, target.register) - target.valueType = runtimeValueTypeF32 - return nil -} - -// compileF64PromoteFromF32 implements compiler.compileF64PromoteFromF32 for the amd64 architecture. -func (c *amd64Compiler) compileF64PromoteFromF32() error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.CVTSS2SD, target.register, target.register) - target.valueType = runtimeValueTypeF64 - return nil -} - -// compileI32ReinterpretFromF32 implements compiler.compileI32ReinterpretFromF32 for the amd64 architecture. -func (c *amd64Compiler) compileI32ReinterpretFromF32() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeI32 - return nil - } - return c.compileSimpleConversion(amd64.MOVL, registerTypeGeneralPurpose, runtimeValueTypeI32) -} - -// compileI64ReinterpretFromF64 implements compiler.compileI64ReinterpretFromF64 for the amd64 architecture. -func (c *amd64Compiler) compileI64ReinterpretFromF64() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeI64 - return nil - } - return c.compileSimpleConversion(amd64.MOVQ, registerTypeGeneralPurpose, runtimeValueTypeI64) -} - -// compileF32ReinterpretFromI32 implements compiler.compileF32ReinterpretFromI32 for the amd64 architecture. -func (c *amd64Compiler) compileF32ReinterpretFromI32() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeF32 - return nil - } - return c.compileSimpleConversion(amd64.MOVL, registerTypeVector, runtimeValueTypeF32) -} - -// compileF64ReinterpretFromI64 implements compiler.compileF64ReinterpretFromI64 for the amd64 architecture. -func (c *amd64Compiler) compileF64ReinterpretFromI64() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeF64 - return nil - } - return c.compileSimpleConversion(amd64.MOVQ, registerTypeVector, runtimeValueTypeF64) -} - -// compileExtend implements compiler.compileExtend for the amd64 architecture. -func (c *amd64Compiler) compileExtend(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - signed := o.B1 != 0 - if signed { - inst = amd64.MOVLQSX // = MOVSXD https://www.felixcloutier.com/x86/movsx:movsxd - } else { - inst = amd64.MOVL - } - return c.compileExtendImpl(inst, runtimeValueTypeI64) -} - -// compileSignExtend32From8 implements compiler.compileSignExtend32From8 for the amd64 architecture. -func (c *amd64Compiler) compileSignExtend32From8() error { - return c.compileExtendImpl(amd64.MOVBLSX, runtimeValueTypeI32) -} - -// compileSignExtend32From16 implements compiler.compileSignExtend32From16 for the amd64 architecture. -func (c *amd64Compiler) compileSignExtend32From16() error { - return c.compileExtendImpl(amd64.MOVWLSX, runtimeValueTypeI32) -} - -// compileSignExtend64From8 implements compiler.compileSignExtend64From8 for the amd64 architecture. -func (c *amd64Compiler) compileSignExtend64From8() error { - return c.compileExtendImpl(amd64.MOVBQSX, runtimeValueTypeI64) -} - -// compileSignExtend64From16 implements compiler.compileSignExtend64From16 for the amd64 architecture. -func (c *amd64Compiler) compileSignExtend64From16() error { - return c.compileExtendImpl(amd64.MOVWQSX, runtimeValueTypeI64) -} - -// compileSignExtend64From32 implements compiler.compileSignExtend64From32 for the amd64 architecture. -func (c *amd64Compiler) compileSignExtend64From32() error { - return c.compileExtendImpl(amd64.MOVLQSX, runtimeValueTypeI64) -} - -func (c *amd64Compiler) compileExtendImpl(inst asm.Instruction, destinationType runtimeValueType) error { - target := c.locationStack.peek() // Note this is peek! - if err := c.compileEnsureOnRegister(target); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(inst, target.register, target.register) - target.valueType = destinationType - return nil -} - -// compileEq implements compiler.compileEq for the amd64 architecture. -func (c *amd64Compiler) compileEq(o *wazeroir.UnionOperation) error { - return c.compileEqOrNe(wazeroir.UnsignedType(o.B1), true) -} - -// compileNe implements compiler.compileNe for the amd64 architecture. -func (c *amd64Compiler) compileNe(o *wazeroir.UnionOperation) error { - return c.compileEqOrNe(wazeroir.UnsignedType(o.B1), false) -} - -func (c *amd64Compiler) compileEqOrNe(t wazeroir.UnsignedType, shouldEqual bool) (err error) { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - // x1 and x2 are temporary registers only used for the cmp operation. Release them. - c.locationStack.releaseRegister(x1) - c.locationStack.releaseRegister(x2) - - switch t { - case wazeroir.UnsignedTypeI32: - err = c.compileEqOrNeForInts(x1r, x2r, amd64.CMPL, shouldEqual) - case wazeroir.UnsignedTypeI64: - err = c.compileEqOrNeForInts(x1r, x2r, amd64.CMPQ, shouldEqual) - case wazeroir.UnsignedTypeF32: - err = c.compileEqOrNeForFloats(x1r, x2r, amd64.UCOMISS, shouldEqual) - case wazeroir.UnsignedTypeF64: - err = c.compileEqOrNeForFloats(x1r, x2r, amd64.UCOMISD, shouldEqual) - } - if err != nil { - return - } - return -} - -func (c *amd64Compiler) compileEqOrNeForInts(x1Reg, x2Reg asm.Register, cmpInstruction asm.Instruction, - shouldEqual bool, -) error { - c.assembler.CompileRegisterToRegister(cmpInstruction, x2Reg, x1Reg) - - // Record that the result is on the conditional register. - var condReg asm.ConditionalRegisterState - if shouldEqual { - condReg = amd64.ConditionalRegisterStateE - } else { - condReg = amd64.ConditionalRegisterStateNE - } - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(condReg) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// For float EQ and NE, we have to take NaN values into account. -// Notably, Wasm specification states that if one of targets is NaN, -// the result must be zero for EQ or one for NE. -func (c *amd64Compiler) compileEqOrNeForFloats(x1Reg, x2Reg asm.Register, cmpInstruction asm.Instruction, shouldEqual bool) error { - // Before we allocate the result, we have to reserve two int registers. - nanFragReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(nanFragReg) - cmpResultReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Then, execute the comparison. - c.assembler.CompileRegisterToRegister(cmpInstruction, x2Reg, x1Reg) - - // First, we get the parity flag which indicates whether one of values was NaN. - if shouldEqual { - // Set 1 if two values are NOT NaN. - c.assembler.CompileNoneToRegister(amd64.SETPC, nanFragReg) - } else { - // Set 1 if one of values is NaN. - c.assembler.CompileNoneToRegister(amd64.SETPS, nanFragReg) - } - - // next, we get the usual comparison flag. - if shouldEqual { - // Set 1 if equal. - c.assembler.CompileNoneToRegister(amd64.SETEQ, cmpResultReg) - } else { - // Set 1 if not equal. - c.assembler.CompileNoneToRegister(amd64.SETNE, cmpResultReg) - } - - // Do "and" or "or" operations on these two flags to get the actual result. - if shouldEqual { - c.assembler.CompileRegisterToRegister(amd64.ANDL, nanFragReg, cmpResultReg) - } else { - c.assembler.CompileRegisterToRegister(amd64.ORL, nanFragReg, cmpResultReg) - } - - // Clear the unnecessary bits by zero extending the first byte. - // This is necessary the upper bits (5 to 32 bits) of SET* instruction result is undefined. - c.assembler.CompileRegisterToRegister(amd64.MOVBLZX, cmpResultReg, cmpResultReg) - - // Now we have the result in cmpResultReg register, so we record it. - c.pushRuntimeValueLocationOnRegister(cmpResultReg, runtimeValueTypeI32) - // Also, we no longer need nanFragRegister. - c.locationStack.markRegisterUnused(nanFragReg) - return nil -} - -// compileEqz implements compiler.compileEqz for the amd64 architecture. -func (c *amd64Compiler) compileEqz(o *wazeroir.UnionOperation) (err error) { - v := c.locationStack.pop() - if err = c.compileEnsureOnRegister(v); err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - err = c.assembler.CompileStaticConstToRegister(amd64.CMPL, c.fourZeros, v.register) - case wazeroir.UnsignedInt64: - err = c.assembler.CompileStaticConstToRegister(amd64.CMPQ, c.eightZeros, v.register) - } - if err != nil { - return err - } - - // v is consumed by the cmp operation so release it. - c.locationStack.releaseRegister(v) - - // Finally, record that the result is on the conditional register. - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(amd64.ConditionalRegisterStateE) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// compileLt implements compiler.compileLt for the amd64 architecture. -func (c *amd64Compiler) compileLt(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Emit the compare instruction. - var resultConditionState asm.ConditionalRegisterState - var inst asm.Instruction - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeInt32: - resultConditionState = amd64.ConditionalRegisterStateL - inst = amd64.CMPL - case wazeroir.SignedTypeUint32: - resultConditionState = amd64.ConditionalRegisterStateB - inst = amd64.CMPL - case wazeroir.SignedTypeInt64: - inst = amd64.CMPQ - resultConditionState = amd64.ConditionalRegisterStateL - case wazeroir.SignedTypeUint64: - resultConditionState = amd64.ConditionalRegisterStateB - inst = amd64.CMPQ - case wazeroir.SignedTypeFloat32: - resultConditionState = amd64.ConditionalRegisterStateA - inst = amd64.COMISS - case wazeroir.SignedTypeFloat64: - resultConditionState = amd64.ConditionalRegisterStateA - inst = amd64.COMISD - } - c.assembler.CompileRegisterToRegister(inst, x1.register, x2.register) - - // x1 and x2 are temporary registers only used for the cmp operation. Release them. - c.locationStack.releaseRegister(x1) - c.locationStack.releaseRegister(x2) - - // Finally, record that the result is on the conditional register. - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(resultConditionState) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// compileGt implements compiler.compileGt for the amd64 architecture. -func (c *amd64Compiler) compileGt(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Emit the compare instruction. - var resultConditionState asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeInt32: - resultConditionState = amd64.ConditionalRegisterStateG - c.assembler.CompileRegisterToRegister(amd64.CMPL, x1.register, x2.register) - case wazeroir.SignedTypeUint32: - c.assembler.CompileRegisterToRegister(amd64.CMPL, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateA - case wazeroir.SignedTypeInt64: - c.assembler.CompileRegisterToRegister(amd64.CMPQ, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateG - case wazeroir.SignedTypeUint64: - c.assembler.CompileRegisterToRegister(amd64.CMPQ, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateA - case wazeroir.SignedTypeFloat32: - c.assembler.CompileRegisterToRegister(amd64.UCOMISS, x2.register, x1.register) - resultConditionState = amd64.ConditionalRegisterStateA - case wazeroir.SignedTypeFloat64: - c.assembler.CompileRegisterToRegister(amd64.UCOMISD, x2.register, x1.register) - resultConditionState = amd64.ConditionalRegisterStateA - } - - // x1 and x2 are temporary registers only used for the cmp operation. Release them. - c.locationStack.releaseRegister(x1) - c.locationStack.releaseRegister(x2) - - // Finally, record that the result is on the conditional register. - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(resultConditionState) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// compileLe implements compiler.compileLe for the amd64 architecture. -func (c *amd64Compiler) compileLe(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Emit the compare instruction. - var inst asm.Instruction - var resultConditionState asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeInt32: - resultConditionState = amd64.ConditionalRegisterStateLE - inst = amd64.CMPL - case wazeroir.SignedTypeUint32: - resultConditionState = amd64.ConditionalRegisterStateBE - inst = amd64.CMPL - case wazeroir.SignedTypeInt64: - resultConditionState = amd64.ConditionalRegisterStateLE - inst = amd64.CMPQ - case wazeroir.SignedTypeUint64: - resultConditionState = amd64.ConditionalRegisterStateBE - inst = amd64.CMPQ - case wazeroir.SignedTypeFloat32: - resultConditionState = amd64.ConditionalRegisterStateAE - inst = amd64.UCOMISS - case wazeroir.SignedTypeFloat64: - resultConditionState = amd64.ConditionalRegisterStateAE - inst = amd64.UCOMISD - } - c.assembler.CompileRegisterToRegister(inst, x1.register, x2.register) - - // x1 and x2 are temporary registers only used for the cmp operation. Release them. - c.locationStack.releaseRegister(x1) - c.locationStack.releaseRegister(x2) - - // Finally, record that the result is on the conditional register. - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(resultConditionState) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// compileGe implements compiler.compileGe for the amd64 architecture. -func (c *amd64Compiler) compileGe(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.pop() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Emit the compare instruction. - var resultConditionState asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeInt32: - c.assembler.CompileRegisterToRegister(amd64.CMPL, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateGE - case wazeroir.SignedTypeUint32: - c.assembler.CompileRegisterToRegister(amd64.CMPL, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateAE - case wazeroir.SignedTypeInt64: - c.assembler.CompileRegisterToRegister(amd64.CMPQ, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateGE - case wazeroir.SignedTypeUint64: - c.assembler.CompileRegisterToRegister(amd64.CMPQ, x1.register, x2.register) - resultConditionState = amd64.ConditionalRegisterStateAE - case wazeroir.SignedTypeFloat32: - c.assembler.CompileRegisterToRegister(amd64.COMISS, x2.register, x1.register) - resultConditionState = amd64.ConditionalRegisterStateAE - case wazeroir.SignedTypeFloat64: - c.assembler.CompileRegisterToRegister(amd64.COMISD, x2.register, x1.register) - resultConditionState = amd64.ConditionalRegisterStateAE - } - - // x1 and x2 are temporary registers only used for the cmp operation. Release them. - c.locationStack.releaseRegister(x1) - c.locationStack.releaseRegister(x2) - - // Finally, record that the result is on the conditional register. - loc := c.locationStack.pushRuntimeValueLocationOnConditionalRegister(resultConditionState) - loc.valueType = runtimeValueTypeI32 - return nil -} - -// compileLoad implements compiler.compileLoad for the amd64 architecture. -func (c *amd64Compiler) compileLoad(o *wazeroir.UnionOperation) error { - var ( - isIntType bool - movInst asm.Instruction - targetSizeInBytes int64 - vt runtimeValueType - ) - - unsignedType := wazeroir.UnsignedType(o.B1) - offset := uint32(o.U2) - - switch unsignedType { - case wazeroir.UnsignedTypeI32: - isIntType = true - movInst = amd64.MOVL - targetSizeInBytes = 32 / 8 - vt = runtimeValueTypeI32 - case wazeroir.UnsignedTypeI64: - isIntType = true - movInst = amd64.MOVQ - targetSizeInBytes = 64 / 8 - vt = runtimeValueTypeI64 - case wazeroir.UnsignedTypeF32: - isIntType = false - movInst = amd64.MOVL - targetSizeInBytes = 32 / 8 - vt = runtimeValueTypeF32 - case wazeroir.UnsignedTypeF64: - isIntType = false - movInst = amd64.MOVQ - targetSizeInBytes = 64 / 8 - vt = runtimeValueTypeF64 - } - - reg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - if isIntType { - // For integer types, read the corresponding bytes from the offset to the memory - // and store the value to the int register. - c.assembler.CompileMemoryWithIndexToRegister(movInst, - // we access memory as memory.Buffer[ceil-targetSizeInBytes: ceil]. - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - reg) - c.pushRuntimeValueLocationOnRegister(reg, vt) - } else { - // For float types, we read the value to the float register. - floatReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(movInst, - // we access memory as memory.Buffer[ceil-targetSizeInBytes: ceil]. - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - floatReg) - c.pushRuntimeValueLocationOnRegister(floatReg, vt) - // We no longer need the int register so mark it unused. - c.locationStack.markRegisterUnused(reg) - } - return nil -} - -// compileLoad8 implements compiler.compileLoad8 for the amd64 architecture. -func (c *amd64Compiler) compileLoad8(o *wazeroir.UnionOperation) error { - const targetSizeInBytes = 1 - offset := uint32(o.U2) - reg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - // Then move a byte at the offset to the register. - // Note that Load8 is only for integer types. - var inst asm.Instruction - var vt runtimeValueType - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedInt32: - inst = amd64.MOVBLSX - vt = runtimeValueTypeI32 - case wazeroir.SignedUint32: - inst = amd64.MOVBLZX - vt = runtimeValueTypeI32 - case wazeroir.SignedInt64: - inst = amd64.MOVBQSX - vt = runtimeValueTypeI64 - case wazeroir.SignedUint64: - inst = amd64.MOVBQZX - vt = runtimeValueTypeI64 - } - - c.assembler.CompileMemoryWithIndexToRegister(inst, - // we access memory as memory.Buffer[ceil-targetSizeInBytes: ceil]. - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - reg) - - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil -} - -// compileLoad16 implements compiler.compileLoad16 for the amd64 architecture. -func (c *amd64Compiler) compileLoad16(o *wazeroir.UnionOperation) error { - const targetSizeInBytes = 16 / 8 - offset := uint32(o.U2) - reg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - // Then move 2 bytes at the offset to the register. - // Note that Load16 is only for integer types. - var inst asm.Instruction - var vt runtimeValueType - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedInt32: - inst = amd64.MOVWLSX - vt = runtimeValueTypeI32 - case wazeroir.SignedInt64: - inst = amd64.MOVWQSX - vt = runtimeValueTypeI64 - case wazeroir.SignedUint32: - inst = amd64.MOVWLZX - vt = runtimeValueTypeI32 - case wazeroir.SignedUint64: - inst = amd64.MOVWQZX - vt = runtimeValueTypeI64 - } - - c.assembler.CompileMemoryWithIndexToRegister(inst, - // we access memory as memory.Buffer[ceil-targetSizeInBytes: ceil]. - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - reg) - - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil -} - -// compileLoad32 implements compiler.compileLoad32 for the amd64 architecture. -func (c *amd64Compiler) compileLoad32(o *wazeroir.UnionOperation) error { - const targetSizeInBytes = 32 / 8 - offset := uint32(o.U2) - reg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - // Then move 4 bytes at the offset to the register. - var inst asm.Instruction - signed := o.B1 == 1 - if signed { - inst = amd64.MOVLQSX - } else { - inst = amd64.MOVLQZX - } - c.assembler.CompileMemoryWithIndexToRegister(inst, - // We access memory as memory.Buffer[ceil-targetSizeInBytes: ceil]. - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - reg) - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeI64) - return nil -} - -// compileMemoryAccessCeilSetup pops the top value from the stack (called "base"), stores "base + offsetArg + targetSizeInBytes" -// into a register, and returns the stored register. We call the result "ceil" because we access the memory -// as memory.Buffer[ceil-targetSizeInBytes: ceil]. -// -// Note: this also emits the instructions to check the out-of-bounds memory access. -// In other words, if the ceil exceeds the memory size, the code exits with nativeCallStatusCodeMemoryOutOfBounds status. -func (c *amd64Compiler) compileMemoryAccessCeilSetup(offsetArg uint32, targetSizeInBytes int64) (asm.Register, error) { - base := c.locationStack.pop() - if err := c.compileEnsureOnRegister(base); err != nil { - return asm.NilRegister, err - } - - result := base.register - if offsetConst := int64(offsetArg) + targetSizeInBytes; offsetConst <= math.MaxInt32 { - c.assembler.CompileConstToRegister(amd64.ADDQ, offsetConst, result) - } else if offsetConst <= math.MaxUint32 { - // Note: in practice, this branch rarely happens as in this case, the wasm binary know that - // memory has more than 1 GBi or at least tries to access above 1 GBi memory region. - // - // This case, we cannot directly add the offset to a register by ADDQ(const) instruction. - // That is because the imm32 const is sign-extended to 64-bit in ADDQ(const), and we end up - // making offsetConst as the negative number, which is wrong. - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return asm.NilRegister, err - } - c.assembler.CompileConstToRegister(amd64.MOVL, int64(uint32(offsetConst)), tmp) - c.assembler.CompileRegisterToRegister(amd64.ADDQ, tmp, result) - } else { - // If the offset const is too large, we exit with nativeCallStatusCodeMemoryOutOfBounds. - c.compileExitFromNativeCode(nativeCallStatusCodeMemoryOutOfBounds) - return result, nil - } - - // Now we compare the value with the memory length which is held by callEngine. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, result) - - // Trap if the value is out-of-bounds of memory length. - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeMemoryOutOfBounds) - - c.locationStack.markRegisterUnused(result) - return result, nil -} - -// compileStore implements compiler.compileStore for the amd64 architecture. -func (c *amd64Compiler) compileStore(o *wazeroir.UnionOperation) error { - var movInst asm.Instruction - var targetSizeInByte int64 - unsignedType := wazeroir.UnsignedType(o.B1) - offset := uint32(o.U2) - switch unsignedType { - case wazeroir.UnsignedTypeI32, wazeroir.UnsignedTypeF32: - movInst = amd64.MOVL - targetSizeInByte = 32 / 8 - case wazeroir.UnsignedTypeI64, wazeroir.UnsignedTypeF64: - movInst = amd64.MOVQ - targetSizeInByte = 64 / 8 - } - return c.compileStoreImpl(offset, movInst, targetSizeInByte) -} - -// compileStore8 implements compiler.compileStore8 for the amd64 architecture. -func (c *amd64Compiler) compileStore8(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), amd64.MOVB, 1) -} - -// compileStore32 implements compiler.compileStore32 for the amd64 architecture. -func (c *amd64Compiler) compileStore16(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), amd64.MOVW, 16/8) -} - -// compileStore32 implements compiler.compileStore32 for the amd64 architecture. -func (c *amd64Compiler) compileStore32(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), amd64.MOVL, 32/8) -} - -func (c *amd64Compiler) compileStoreImpl(offsetConst uint32, inst asm.Instruction, targetSizeInBytes int64) error { - val := c.locationStack.pop() - if err := c.compileEnsureOnRegister(val); err != nil { - return err - } - - reg, err := c.compileMemoryAccessCeilSetup(offsetConst, targetSizeInBytes) - if err != nil { - return nil - } - - c.assembler.CompileRegisterToMemoryWithIndex( - inst, val.register, - amd64ReservedRegisterForMemory, -targetSizeInBytes, reg, 1, - ) - - // We no longer need both the value and base registers. - c.locationStack.releaseRegister(val) - c.locationStack.markRegisterUnused(reg) - return nil -} - -// compileMemoryGrow implements compiler.compileMemoryGrow for the amd64 architecture. -func (c *amd64Compiler) compileMemoryGrow() error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - if err := c.compileCallBuiltinFunction(builtinFunctionIndexMemoryGrow); err != nil { - return err - } - - // After the function call, we have to initialize the stack base pointer and memory reserved registers. - c.compileReservedStackBasePointerInitialization() - c.compileReservedMemoryPointerInitialization() - return nil -} - -// compileMemorySize implements compiler.compileMemorySize for the amd64 architecture. -func (c *amd64Compiler) compileMemorySize() error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - loc := c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeI32) - - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, loc.register) - - // WebAssembly's memory.size returns the page size (65536) of memory region. - // That is equivalent to divide the len of memory slice by 65536 and - // that can be calculated as SHR by 16 bits as 65536 = 2^16. - c.assembler.CompileConstToRegister(amd64.SHRQ, wasm.MemoryPageSizeInBits, loc.register) - return nil -} - -// compileMemoryInit implements compiler.compileMemoryInit for the amd64 architecture. -func (c *amd64Compiler) compileMemoryInit(o *wazeroir.UnionOperation) error { - dataIndex := uint32(o.U1) - return c.compileInitImpl(false, dataIndex, 0) -} - -// compileInitImpl implements compileTableInit and compileMemoryInit. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *amd64Compiler) compileInitImpl(isTable bool, index, tableIndex uint32) error { - outOfBoundsErrorStatus := nativeCallStatusCodeMemoryOutOfBounds - if isTable { - outOfBoundsErrorStatus = nativeCallStatusCodeInvalidTableAccess - } - - copySize := c.locationStack.pop() - if err := c.compileEnsureOnRegister(copySize); err != nil { - return err - } - - sourceOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(sourceOffset); err != nil { - return err - } - - destinationOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(destinationOffset); err != nil { - return err - } - - instanceAddr, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(instanceAddr) - if isTable { - c.compileLoadElemInstanceAddress(index, instanceAddr) - } else { - c.compileLoadDataInstanceAddress(index, instanceAddr) - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp) - - // sourceOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, sourceOffset.register) - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, destinationOffset.register) - - // Check instance bounds and if exceeds the length, exit with out of bounds error. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - instanceAddr, 8, // DataInstance and Element instance holds the length is stored at offset 8. - sourceOffset.register) - c.compileMaybeExitFromNativeCode(amd64.JCC, outOfBoundsErrorStatus) - - // Check destination bounds and if exceeds the length, exit with out of bounds error. - if isTable { - // Load the target table's address. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(tableIndex*8), tmp) - // Compare length. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, tmp, tableInstanceTableLenOffset, destinationOffset.register) - } else { - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - destinationOffset.register) - } - - c.compileMaybeExitFromNativeCode(amd64.JCC, outOfBoundsErrorStatus) - - // Otherwise, ready to copy the value from source to destination. - // - // If the copy size equal zero, we skip the entire instructions below. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, copySize.register, copySize.register) - skipJump := c.assembler.CompileJump(amd64.JEQ) - - var scale int16 - var memToReg, regToMem asm.Instruction - if isTable { - // Each element is of type uintptr; 2^3 = 1 << pointerSizeLog2. - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, sourceOffset.register) - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, destinationOffset.register) - // destinationOffset += table buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - tmp, tableInstanceTableOffset, destinationOffset.register) - // sourceOffset += data buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - instanceAddr, 0, sourceOffset.register) - - // For tables, we move 8 bytes at once. - memToReg = amd64.MOVQ - regToMem = memToReg - scale = 8 - } else { - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, amd64ReservedRegisterForMemory, destinationOffset.register) - - // sourceOffset += data buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, instanceAddr, 0, sourceOffset.register) - - // Move one byte at once. - memToReg = amd64.MOVBQZX - regToMem = amd64.MOVB - scale = 1 - } - - // Negate the counter. - c.assembler.CompileNoneToRegister(amd64.NEGQ, copySize.register) - - beginCopyLoop := c.assembler.CompileStandAlone(amd64.NOP) - - c.assembler.CompileMemoryWithIndexToRegister(memToReg, - sourceOffset.register, 0, copySize.register, scale, - tmp) - // [destinationOffset + (size.register)] = tmp. - c.assembler.CompileRegisterToMemoryWithIndex(regToMem, - tmp, - destinationOffset.register, 0, copySize.register, scale, - ) - - // size += 1 - c.assembler.CompileNoneToRegister(amd64.INCQ, copySize.register) - c.assembler.CompileJump(amd64.JMI).AssignJumpTarget(beginCopyLoop) - - c.locationStack.markRegisterUnused(copySize.register, sourceOffset.register, - destinationOffset.register, instanceAddr, tmp) - c.assembler.SetJumpTargetOnNext(skipJump) - return nil -} - -// compileDataDrop implements compiler.compileDataDrop for the amd64 architecture. -func (c *amd64Compiler) compileDataDrop(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - dataIndex := uint32(o.U1) - c.compileLoadDataInstanceAddress(dataIndex, tmp) - - // Clears the content of DataInstance[o.DataIndex] (== []byte type). - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 0) - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 8) - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 16) - return nil -} - -func (c *amd64Compiler) compileLoadDataInstanceAddress(dataIndex uint32, dst asm.Register) { - // dst = dataIndex * dataInstanceStructSize. - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(dataIndex)*dataInstanceStructSize, dst) - - // dst = &moduleInstance.DataInstances[0] + dst - // = &moduleInstance.DataInstances[0] + dataIndex*dataInstanceStructSize - // = &moduleInstance.DataInstances[dataIndex] - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextDataInstancesElement0AddressOffset, - dst, - ) -} - -// compileCopyLoopImpl implements a REP MOVSQ memory copy for the given range with support for both directions. -func (c *amd64Compiler) compileCopyLoopImpl(destinationOffset, sourceOffset, copySize *runtimeValueLocation, backwards bool, bwOffset uint8) { - // skip if nothing to copy - c.assembler.CompileRegisterToRegister(amd64.TESTQ, copySize.register, copySize.register) - emptyEightGroupsJump := c.assembler.CompileJump(amd64.JEQ) - - // Prepare registers for swaps. There will never be more than 3 XCHGs in total. - restoreCrossing := c.compilePreventCrossedTargetRegisters( - []*runtimeValueLocation{destinationOffset, sourceOffset, copySize}, - []asm.Register{amd64.RegDI, amd64.RegSI, amd64.RegCX}) - - // Prepare registers for REP MOVSQ: copy from rsi to rdi, rcx times. - c.compileMaybeSwapRegisters(destinationOffset.register, amd64.RegDI) - c.compileMaybeSwapRegisters(sourceOffset.register, amd64.RegSI) - c.compileMaybeSwapRegisters(copySize.register, amd64.RegCX) - - // Point on first byte of first quadword to copy. - if backwards { - c.assembler.CompileConstToRegister(amd64.ADDQ, -int64(bwOffset), amd64.RegDI) - c.assembler.CompileConstToRegister(amd64.ADDQ, -int64(bwOffset), amd64.RegSI) - // Set REP prefix direction backwards. - c.assembler.CompileStandAlone(amd64.STD) - } - - c.assembler.CompileStandAlone(amd64.REPMOVSQ) - - if backwards { - // Reset direction. - c.assembler.CompileStandAlone(amd64.CLD) - } - - // Restore registers. - c.compileMaybeSwapRegisters(destinationOffset.register, amd64.RegDI) - c.compileMaybeSwapRegisters(sourceOffset.register, amd64.RegSI) - c.compileMaybeSwapRegisters(copySize.register, amd64.RegCX) - restoreCrossing() - - c.assembler.SetJumpTargetOnNext(emptyEightGroupsJump) - c.assembler.CompileStandAlone(amd64.NOP) -} - -// compileMemoryCopyLoopImpl is used for directly copying after bounds/direction check. -func (c *amd64Compiler) compileMemoryCopyLoopImpl(destinationOffset, sourceOffset, copySize *runtimeValueLocation, tmp asm.Register, backwards bool) { - // Point on first byte to be copied depending on direction. - if backwards { - c.assembler.CompileNoneToRegister(amd64.DECQ, sourceOffset.register) - c.assembler.CompileNoneToRegister(amd64.DECQ, destinationOffset.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, sourceOffset.register) - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, destinationOffset.register) - } - - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, amd64ReservedRegisterForMemory, destinationOffset.register) - // sourceOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, amd64ReservedRegisterForMemory, sourceOffset.register) - - // Copy copySize % 8 bytes in loop to allow copying in 8 byte groups afterward. - beginLoop := c.assembler.CompileStandAlone(amd64.NOP) - - // Check copySize % 8 == 0. - c.assembler.CompileConstToRegister(amd64.TESTQ, 7, copySize.register) - breakLoop := c.assembler.CompileJump(amd64.JEQ) - - c.assembler.CompileMemoryToRegister(amd64.MOVBQZX, sourceOffset.register, 0, tmp) - c.assembler.CompileRegisterToMemory(amd64.MOVB, tmp, destinationOffset.register, 0) - - if backwards { - c.assembler.CompileNoneToRegister(amd64.DECQ, sourceOffset.register) - c.assembler.CompileNoneToRegister(amd64.DECQ, destinationOffset.register) - } else { - c.assembler.CompileNoneToRegister(amd64.INCQ, sourceOffset.register) - c.assembler.CompileNoneToRegister(amd64.INCQ, destinationOffset.register) - } - - c.assembler.CompileNoneToRegister(amd64.DECQ, copySize.register) - c.assembler.CompileJump(amd64.JMP).AssignJumpTarget(beginLoop) - c.assembler.SetJumpTargetOnNext(breakLoop) - - // compileCopyLoopImpl counts in groups of 8 bytes, so we have to divide the copySize by 8. - c.assembler.CompileConstToRegister(amd64.SHRQ, 3, copySize.register) - - c.compileCopyLoopImpl(destinationOffset, sourceOffset, copySize, backwards, 7) -} - -// compileMemoryCopy implements compiler.compileMemoryCopy for the amd64 architecture. -// -// This uses efficient `REP MOVSQ` instructions to copy in quadword (8 bytes) batches. The remaining bytes -// are copied with a simple `MOV` loop. It uses backward copying for overlapped segments. -func (c *amd64Compiler) compileMemoryCopy() error { - copySize := c.locationStack.pop() - if err := c.compileEnsureOnRegister(copySize); err != nil { - return err - } - - sourceOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(sourceOffset); err != nil { - return err - } - - destinationOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(destinationOffset); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp) - - // sourceOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, sourceOffset.register) - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, destinationOffset.register) - // tmp = max(sourceOffset, destinationOffset). - c.assembler.CompileRegisterToRegister(amd64.CMPQ, sourceOffset.register, destinationOffset.register) - c.assembler.CompileRegisterToRegister(amd64.MOVQ, sourceOffset.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.CMOVQCS, destinationOffset.register, tmp) - - // Check maximum bounds and if exceeds the length, exit with out of bounds error. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, tmp) - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeMemoryOutOfBounds) - - // Skip zero size. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, copySize.register, copySize.register) - skipJump := c.assembler.CompileJump(amd64.JEQ) - - // If dest < source, we can copy forwards - c.assembler.CompileRegisterToRegister(amd64.CMPQ, destinationOffset.register, sourceOffset.register) - destLowerThanSourceJump := c.assembler.CompileJump(amd64.JLS) - - // If source + size < dest, we can copy forwards - c.assembler.CompileRegisterToRegister(amd64.MOVQ, destinationOffset.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.CMPQ, sourceOffset.register, tmp) - sourceBoundLowerThanDestJump := c.assembler.CompileJump(amd64.JLS) - - // Copy backwards. - c.compileMemoryCopyLoopImpl(destinationOffset, sourceOffset, copySize, tmp, true) - endJump := c.assembler.CompileJump(amd64.JMP) - - // Copy forwards. - c.assembler.SetJumpTargetOnNext(destLowerThanSourceJump) - c.assembler.SetJumpTargetOnNext(sourceBoundLowerThanDestJump) - c.compileMemoryCopyLoopImpl(destinationOffset, sourceOffset, copySize, tmp, false) - - c.locationStack.markRegisterUnused(copySize.register, sourceOffset.register, - destinationOffset.register, tmp) - c.assembler.SetJumpTargetOnNext(skipJump) - c.assembler.SetJumpTargetOnNext(endJump) - - return nil -} - -// compileFillLoopImpl implements a REP STOSQ fill loop. -func (c *amd64Compiler) compileFillLoopImpl(destinationOffset, value, fillSize *runtimeValueLocation, tmp asm.Register, replicateByte bool) { - // Skip if nothing to fill. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, fillSize.register, fillSize.register) - emptyEightGroupsJump := c.assembler.CompileJump(amd64.JEQ) - - if replicateByte { - // Truncate value.register to a single byte - c.assembler.CompileConstToRegister(amd64.ANDQ, 0xff, value.register) - // Replicate single byte onto full 8-byte register. - c.assembler.CompileConstToRegister(amd64.MOVQ, 0x0101010101010101, tmp) - c.assembler.CompileRegisterToRegister(amd64.IMULQ, tmp, value.register) - } - - // Prepare registers for swaps. There will never be more than 3 XCHGs in total. - restoreCrossing := c.compilePreventCrossedTargetRegisters( - []*runtimeValueLocation{destinationOffset, value, fillSize}, - []asm.Register{amd64.RegDI, amd64.RegAX, amd64.RegCX}) - - // Prepare registers for REP STOSQ: fill at [rdi] with rax, rcx times. - c.compileMaybeSwapRegisters(destinationOffset.register, amd64.RegDI) - c.compileMaybeSwapRegisters(value.register, amd64.RegAX) - c.compileMaybeSwapRegisters(fillSize.register, amd64.RegCX) - - c.assembler.CompileStandAlone(amd64.REPSTOSQ) - - // Restore registers. - c.compileMaybeSwapRegisters(destinationOffset.register, amd64.RegDI) - c.compileMaybeSwapRegisters(value.register, amd64.RegAX) - c.compileMaybeSwapRegisters(fillSize.register, amd64.RegCX) - restoreCrossing() - - c.assembler.SetJumpTargetOnNext(emptyEightGroupsJump) -} - -// compileMemoryFill implements compiler.compileMemoryFill for the amd64 architecture. -// -// This function uses efficient `REP STOSQ` instructions to copy in quadword (8 bytes) batches -// if the size if above 15 bytes. For smaller sizes, a simple MOVB copy loop is the best -// option. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *amd64Compiler) compileFillImpl(isTable bool, tableIndex uint32) error { - copySize := c.locationStack.pop() - if err := c.compileEnsureOnRegister(copySize); err != nil { - return err - } - - value := c.locationStack.pop() - if err := c.compileEnsureOnRegister(value); err != nil { - return err - } - - destinationOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(destinationOffset); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp) - - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, destinationOffset.register) - - // Check destination bounds and if exceeds the length, exit with out of bounds error. - if isTable { - // tmp = &tables[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - tmp) - - // tmp = [tmp + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(tableIndex)*8, tmp) - - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - tmp, tableInstanceTableLenOffset, - destinationOffset.register) - } else { - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - destinationOffset.register) - } - if isTable { - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeInvalidTableAccess) - } else { - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeMemoryOutOfBounds) - } - - // Otherwise, ready to copy the value from source to destination. - // - // If the copy size equal zero, we skip the entire instructions below. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, copySize.register, copySize.register) - skipJump := c.assembler.CompileJump(amd64.JEQ) - - // destinationOffset -= size. - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, destinationOffset.register) - - if isTable { - // Each element is of type uintptr; 2^3 = 1 << pointerSizeLog2. - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, destinationOffset.register) - // destinationOffset += table buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, tmp, tableInstanceTableOffset, destinationOffset.register) - - } else { - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, amd64ReservedRegisterForMemory, destinationOffset.register) - - // Copy first % 16 bytes with simple MOVB instruction. - beginCopyLoop := c.assembler.CompileStandAlone(amd64.NOP) - c.assembler.CompileConstToRegister(amd64.TESTQ, 15, copySize.register) - breakLoop := c.assembler.CompileJump(amd64.JEQ) - - c.assembler.CompileRegisterToMemory(amd64.MOVB, value.register, destinationOffset.register, 0) - - c.assembler.CompileNoneToRegister(amd64.INCQ, destinationOffset.register) - c.assembler.CompileNoneToRegister(amd64.DECQ, copySize.register) - c.assembler.CompileJump(amd64.JMP).AssignJumpTarget(beginCopyLoop) - - c.assembler.SetJumpTargetOnNext(breakLoop) - // compileFillLoopImpl counts in groups of 8 bytes, so we have to divide the copySize by 8. - c.assembler.CompileConstToRegister(amd64.SHRQ, 3, copySize.register) - } - - c.compileFillLoopImpl(destinationOffset, value, copySize, tmp, !isTable) - - c.locationStack.markRegisterUnused(copySize.register, value.register, - destinationOffset.register, tmp) - c.assembler.SetJumpTargetOnNext(skipJump) - return nil -} - -// compileMemoryFill implements compiler.compileMemoryFill for the amd64 architecture. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *amd64Compiler) compileMemoryFill() error { - return c.compileFillImpl(false, 0) -} - -// compileTableInit implements compiler.compileTableInit for the amd64 architecture. -func (c *amd64Compiler) compileTableInit(o *wazeroir.UnionOperation) error { - elemIndex := uint32(o.U1) - tableIndex := uint32(o.U2) - return c.compileInitImpl(true, elemIndex, tableIndex) -} - -// compileTableCopyLoopImpl is used for directly copying after bounds/direction check. -func (c *amd64Compiler) compileTableCopyLoopImpl(srcTableIndex, dstTableIndex uint32, destinationOffset, sourceOffset, copySize *runtimeValueLocation, tmp asm.Register, backwards bool) { - // Point on first byte to be copied. - if !backwards { - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, sourceOffset.register) - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, destinationOffset.register) - } - - // Each element is of type uintptr; 2^3 = 1 << pointerSizeLog2. - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, sourceOffset.register) - c.assembler.CompileConstToRegister(amd64.SHLQ, pointerSizeLog2, destinationOffset.register) - // destinationOffset += table buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(dstTableIndex*8), tmp) - c.assembler.CompileMemoryToRegister(amd64.ADDQ, tmp, tableInstanceTableOffset, destinationOffset.register) - // sourceOffset += table buffer's absolute address. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(srcTableIndex*8), tmp) - c.assembler.CompileMemoryToRegister(amd64.ADDQ, tmp, tableInstanceTableOffset, sourceOffset.register) - - c.compileCopyLoopImpl(destinationOffset, sourceOffset, copySize, backwards, 8) -} - -// compileTableCopy implements compiler.compileTableCopy for the amd64 architecture. -// -// It uses efficient `REP MOVSB` instructions for optimized copying. It uses backward copying for -// overlapped segments. -func (c *amd64Compiler) compileTableCopy(o *wazeroir.UnionOperation) error { - copySize := c.locationStack.pop() - if err := c.compileEnsureOnRegister(copySize); err != nil { - return err - } - - sourceOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(sourceOffset); err != nil { - return err - } - - destinationOffset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(destinationOffset); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // sourceOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, sourceOffset.register) - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(amd64.ADDQ, copySize.register, destinationOffset.register) - - srcTableIndex := uint32(o.U1) - dstTableIndex := uint32(o.U2) - - // Check source bounds and if exceeds the length, exit with out of bounds error. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(srcTableIndex*8), tmp) - c.assembler.CompileMemoryToRegister(amd64.CMPQ, tmp, tableInstanceTableLenOffset, sourceOffset.register) - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeInvalidTableAccess) - - // Check destination bounds and if exceeds the length, exit with out of bounds error. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, tmp) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, int64(dstTableIndex*8), tmp) - c.assembler.CompileMemoryToRegister(amd64.CMPQ, tmp, tableInstanceTableLenOffset, destinationOffset.register) - c.compileMaybeExitFromNativeCode(amd64.JCC, nativeCallStatusCodeInvalidTableAccess) - - // Skip zero size. - c.assembler.CompileRegisterToRegister(amd64.TESTQ, copySize.register, copySize.register) - skipJump := c.assembler.CompileJump(amd64.JEQ) - - // If dest < source, we can copy forwards. - c.assembler.CompileRegisterToRegister(amd64.CMPQ, destinationOffset.register, sourceOffset.register) - destLowerThanSourceJump := c.assembler.CompileJump(amd64.JLS) - - // If source + size < dest, we can copy forwards. - c.assembler.CompileRegisterToRegister(amd64.MOVQ, destinationOffset.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.SUBQ, copySize.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.CMPQ, sourceOffset.register, tmp) - sourceBoundLowerThanDestJump := c.assembler.CompileJump(amd64.JLS) - - // Copy backwards. - c.compileTableCopyLoopImpl(srcTableIndex, dstTableIndex, destinationOffset, sourceOffset, copySize, tmp, true) - endJump := c.assembler.CompileJump(amd64.JMP) - - // Copy forwards. - c.assembler.SetJumpTargetOnNext(destLowerThanSourceJump) - c.assembler.SetJumpTargetOnNext(sourceBoundLowerThanDestJump) - c.compileTableCopyLoopImpl(srcTableIndex, dstTableIndex, destinationOffset, sourceOffset, copySize, tmp, false) - - c.locationStack.markRegisterUnused(copySize.register, sourceOffset.register, - destinationOffset.register, tmp) - c.assembler.SetJumpTargetOnNext(skipJump) - c.assembler.SetJumpTargetOnNext(endJump) - return nil -} - -// compileElemDrop implements compiler.compileElemDrop for the amd64 architecture. -func (c *amd64Compiler) compileElemDrop(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - elemIndex := uint32(o.U1) - c.compileLoadElemInstanceAddress(elemIndex, tmp) - - // Clears the content of ElementInstances[o.ElemIndex].References (== []uintptr{} type). - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 0) - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 8) - c.assembler.CompileConstToMemory(amd64.MOVQ, 0, tmp, 16) - return nil -} - -func (c *amd64Compiler) compileLoadElemInstanceAddress(elemIndex uint32, dst asm.Register) { - // dst = elemIndex * elementInstanceStructSize - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(elemIndex)*elementInstanceStructSize, dst) - - // dst = &moduleInstance.ElementInstances[0] + dst - // = &moduleInstance.ElementInstances[0] + elemIndex*elementInstanceStructSize - // = &moduleInstance.ElementInstances[elemIndex] - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextElementInstancesElement0AddressOffset, - dst, - ) -} - -// compileTableGet implements compiler.compileTableGet for the amd64 architecture. -func (c *amd64Compiler) compileTableGet(o *wazeroir.UnionOperation) error { - ref, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(ref) - - offset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(offset); err != nil { - return err - } - - // ref = &tables[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - ref) - - // ref = [ref + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, ref, tableIndex*8, ref) - - // Out of bounds check. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, ref, tableInstanceTableLenOffset, offset.register) - c.compileMaybeExitFromNativeCode(amd64.JHI, nativeCallStatusCodeInvalidTableAccess) - - // ref = [&tables[TableIndex] + tableInstanceTableOffset] = &tables[TableIndex].References[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, ref, tableInstanceTableOffset, ref) - - // ref = [ref + 0 + offset.register * 8] - // = [&tables[TableIndex].References[0] + sizeOf(uintptr) * offset] - // = [&tables[TableIndex].References[offset]] - // = tables[TableIndex].References[offset] - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVQ, ref, - 0, offset.register, 8, ref, - ) - - c.locationStack.markRegisterUnused(offset.register) - c.pushRuntimeValueLocationOnRegister(ref, runtimeValueTypeI64) // table elements are opaque 64-bit at runtime. - return nil -} - -// compileTableSet implements compiler.compileTableSet for the amd64 architecture. -func (c *amd64Compiler) compileTableSet(o *wazeroir.UnionOperation) error { - ref := c.locationStack.pop() - if err := c.compileEnsureOnRegister(ref); err != nil { - return err - } - - offset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(offset); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // tmp = &tables[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - tmp) - - // ref = [ref + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, tableIndex*8, tmp) - - // Out of bounds check. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, tmp, tableInstanceTableLenOffset, offset.register) - c.compileMaybeExitFromNativeCode(amd64.JHI, nativeCallStatusCodeInvalidTableAccess) - - // tmp = [&tables[TableIndex] + tableInstanceTableOffset] = &tables[TableIndex].References[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmp, tableInstanceTableOffset, tmp) - - // [tmp + 0 + offset.register * 8] = ref - // [&tables[TableIndex].References[0] + sizeOf(uintptr) * offset] = ref - // [&tables[TableIndex].References[offset]] = ref - // tables[TableIndex].References[offset] = ref - c.assembler.CompileRegisterToMemoryWithIndex(amd64.MOVQ, - ref.register, - tmp, 0, offset.register, 8) - - c.locationStack.markRegisterUnused(offset.register, ref.register) - return nil -} - -// compileTableGrow implements compiler.compileTableGrow for the amd64 architecture. -func (c *amd64Compiler) compileTableGrow(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - // Pushes the table index. - tableIndex := uint32(o.U1) - if err := c.compileConstI32Impl(tableIndex); err != nil { - return err - } - - // Table grow cannot be done in assembly just like memory grow as it involves with allocation in Go. - // Therefore, call out to the built function for this purpose. - if err := c.compileCallBuiltinFunction(builtinFunctionIndexTableGrow); err != nil { - return err - } - - // TableGrow consumes three values (table index, number of items, initial value). - for i := 0; i < 3; i++ { - c.locationStack.pop() - } - - // Then, the previous length was pushed as the result. - loc := c.locationStack.pushRuntimeValueLocationOnStack() - loc.valueType = runtimeValueTypeI32 - - // After return, we re-initialize reserved registers just like preamble of functions. - c.compileReservedStackBasePointerInitialization() - c.compileReservedMemoryPointerInitialization() - return nil -} - -// compileTableSize implements compiler.compileTableSize for the amd64 architecture. -func (c *amd64Compiler) compileTableSize(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // result = &tables[0] - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - result) - - // result = [result + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, result, tableIndex*8, result) - - // result = [result + tableInstanceTableLenOffset] - // = [tables[TableIndex] + tableInstanceTableLenOffset] - // = len(tables[TableIndex]) - c.assembler.CompileMemoryToRegister(amd64.MOVQ, result, tableInstanceTableLenOffset, result) - - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return nil -} - -// compileTableFill implements compiler.compileTableFill for the amd64 architecture. -func (c *amd64Compiler) compileTableFill(o *wazeroir.UnionOperation) error { - tableIndex := uint32(o.U1) - return c.compileFillImpl(true, tableIndex) -} - -// compileRefFunc implements compiler.compileRefFunc for the amd64 architecture. -func (c *amd64Compiler) compileRefFunc(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - ref, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - functionIndex := int64(o.U1) - c.assembler.CompileConstToRegister(amd64.MOVQ, functionIndex*functionSize, ref) - - // ref = [amd64ReservedRegisterForCallEngine + callEngineModuleContextFunctionsElement0AddressOffset + int64(o.FunctionIndex)*functionSize] - // = &moduleEngine.functions[index] - c.assembler.CompileMemoryToRegister( - amd64.ADDQ, amd64ReservedRegisterForCallEngine, callEngineModuleContextFunctionsElement0AddressOffset, - ref, - ) - - c.pushRuntimeValueLocationOnRegister(ref, runtimeValueTypeI64) - return nil -} - -// compileConstI32 implements compiler.compileConstI32 for the amd64 architecture. -func (c *amd64Compiler) compileConstI32(o *wazeroir.UnionOperation) error { - return c.compileConstI32Impl(uint32(o.U1)) -} - -func (c *amd64Compiler) compileConstI32Impl(v uint32) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeI32) - c.assembler.CompileConstToRegister(amd64.MOVL, int64(v), reg) - return nil -} - -// compileConstI64 implements compiler.compileConstI64 for the amd64 architecture. -func (c *amd64Compiler) compileConstI64(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeI64) - - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(o.U1), reg) - return nil -} - -// compileConstF32 implements compiler.compileConstF32 for the amd64 architecture. -func (c *amd64Compiler) compileConstF32(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeF32) - - // We cannot directly load the value from memory to float regs, - // so we move it to int reg temporarily. - tmpReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - c.assembler.CompileConstToRegister(amd64.MOVL, int64(o.U1) /*math.Float32bits(o.Value)*/, tmpReg) - c.assembler.CompileRegisterToRegister(amd64.MOVL, tmpReg, reg) - return nil -} - -// compileConstF64 implements compiler.compileConstF64 for the amd64 architecture. -func (c *amd64Compiler) compileConstF64(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeF64) - - // We cannot directly load the value from memory to float regs, - // so we move it to int reg temporarily. - tmpReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(o.U1) /* math.Float64bits(o.Value) */, tmpReg) - c.assembler.CompileRegisterToRegister(amd64.MOVQ, tmpReg, reg) - return nil -} - -// compileLoadValueOnStackToRegister implements compiler.compileLoadValueOnStackToRegister for amd64. -func (c *amd64Compiler) compileLoadValueOnStackToRegister(loc *runtimeValueLocation) { - var inst asm.Instruction - switch loc.valueType { - case runtimeValueTypeV128Lo: - inst = amd64.MOVDQU - case runtimeValueTypeV128Hi: - panic("BUG: V128Hi must be be loaded to a register along with V128Lo") - case runtimeValueTypeI32, runtimeValueTypeF32: - inst = amd64.MOVL - case runtimeValueTypeI64, runtimeValueTypeF64: - inst = amd64.MOVQ - default: - panic("BUG: unknown runtime value type") - } - - // Copy the value from the stack. - c.assembler.CompileMemoryToRegister(inst, - // Note: stack pointers are ensured not to exceed 2^27 so this offset never exceeds 32-bit range. - amd64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8, - loc.register) - - if loc.valueType == runtimeValueTypeV128Lo { - // Higher 64-bits are loaded as well ^^. - hi := &c.locationStack.stack[loc.stackPointer+1] - hi.setRegister(loc.register) - } -} - -// maybeCompileMoveTopConditionalToGeneralPurposeRegister moves the top value on the stack -// if the value is located on a conditional register. -// -// This is usually called at the beginning of methods on compiler interface where we possibly -// compile instructions without saving the conditional register value. -// The compileXXX functions without calling this function is saving the conditional -// value to the stack or register by invoking compileEnsureOnRegister for the top. -func (c *amd64Compiler) maybeCompileMoveTopConditionalToGeneralPurposeRegister() (err error) { - if c.locationStack.sp > 0 { - if loc := c.locationStack.peek(); loc.onConditionalRegister() { - if err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc); err != nil { - return err - } - } - } - return -} - -// loadConditionalRegisterToGeneralPurposeRegister saves the conditional register value -// to a general purpose register. -func (c *amd64Compiler) compileLoadConditionalRegisterToGeneralPurposeRegister(loc *runtimeValueLocation) error { - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.compileMoveConditionalToGeneralPurposeRegister(loc, reg) - return nil -} - -func (c *amd64Compiler) compileMoveConditionalToGeneralPurposeRegister(loc *runtimeValueLocation, reg asm.Register) { - // Set the flag bit to the destination. See - // - https://c9x.me/x86/html/file_module_x86_id_288.html - // - https://github.com/golang/go/blob/master/src/cmd/internal/obj/x86/asm6.go#L1453-L1468 - // to translate conditionalRegisterState* to amd64.SET* - var inst asm.Instruction - switch loc.conditionalRegister { - case amd64.ConditionalRegisterStateE: - inst = amd64.SETEQ - case amd64.ConditionalRegisterStateNE: - inst = amd64.SETNE - case amd64.ConditionalRegisterStateS: - inst = amd64.SETMI - case amd64.ConditionalRegisterStateNS: - inst = amd64.SETPL - case amd64.ConditionalRegisterStateG: - inst = amd64.SETGT - case amd64.ConditionalRegisterStateGE: - inst = amd64.SETGE - case amd64.ConditionalRegisterStateL: - inst = amd64.SETLT - case amd64.ConditionalRegisterStateLE: - inst = amd64.SETLE - case amd64.ConditionalRegisterStateA: - inst = amd64.SETHI - case amd64.ConditionalRegisterStateAE: - inst = amd64.SETCC - case amd64.ConditionalRegisterStateB: - inst = amd64.SETCS - case amd64.ConditionalRegisterStateBE: - inst = amd64.SETLS - } - - c.assembler.CompileNoneToRegister(inst, reg) - - // Then we reset the unnecessary bit. - c.assembler.CompileConstToRegister(amd64.ANDQ, 0x1, reg) - - // Mark it uses the register. - loc.setRegister(reg) - c.locationStack.markRegisterUsed(reg) -} - -// allocateRegister implements compiler.allocateRegister for amd64. -func (c *amd64Compiler) allocateRegister(t registerType) (reg asm.Register, err error) { - var ok bool - // Try to get the unused register. - reg, ok = c.locationStack.takeFreeRegister(t) - if ok { - return - } - - // If not found, we have to steal the register. - stealTarget, ok := c.locationStack.takeStealTargetFromUsedRegister(t) - if !ok { - err = fmt.Errorf("cannot steal register") - return - } - - // Release the steal target register value onto stack location. - reg = stealTarget.register - c.compileReleaseRegisterToStack(stealTarget) - return -} - -// callFunction adds instructions to call a function whose address equals either addr parameter or the value on indexReg. -// -// Note: this is the counterpart for returnFunction, and see the comments there as well -// to understand how the function calls are achieved. -func (c *amd64Compiler) compileCallFunctionImpl(functionAddressRegister asm.Register, functype *wasm.FunctionType) error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - c.locationStack.markRegisterUsed(functionAddressRegister) - - // Obtain a temporary register to be used in the followings. - tmpRegister, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - // This in theory never happen as all the registers must be free except codeAddressRegister. - return fmt.Errorf("could not find enough free registers") - } - - // The stack should look like: - // - // reserved slots for results (if len(results) > len(args)) - // | | - // ,arg0, ..., argN, ..., _, .returnAddress, .returnStackBasePointerInBytes, .function, .... - // | | | - // | callFrame{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^} - // | - // nextStackBasePointerOffset - // - // where callFrame is used to return to this currently executed function. - - nextStackBasePointerOffset := int64(c.locationStack.sp) - int64(functype.ParamNumInUint64) - - callFrameReturnAddressLoc, callFrameStackBasePointerInBytesLoc, callFrameFunctionLoc := c.locationStack.pushCallFrame(functype) - - // Save the current stack base pointer at callFrameStackBasePointerInBytesLoc. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, - tmpRegister) - callFrameStackBasePointerInBytesLoc.setRegister(tmpRegister) - c.compileReleaseRegisterToStack(callFrameStackBasePointerInBytesLoc) - - // Set callEngine.stackContext.stackBasePointer for the next function. - c.assembler.CompileConstToRegister(amd64.ADDQ, nextStackBasePointerOffset<<3, tmpRegister) - - // Write the calculated value to callEngine.stackContext.stackBasePointer. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset) - - // Save the currently executed *function (placed at callEngine.moduleContext.fn) into callFrameFunctionLoc. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset, - tmpRegister) - callFrameFunctionLoc.setRegister(tmpRegister) - c.compileReleaseRegisterToStack(callFrameFunctionLoc) - - // Set callEngine.moduleContext.fn to the next *function. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, functionAddressRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset) - - // Write the return address into callFrameReturnAddressLoc. - c.assembler.CompileReadInstructionAddress(tmpRegister, amd64.JMP) - callFrameReturnAddressLoc.setRegister(tmpRegister) - c.compileReleaseRegisterToStack(callFrameReturnAddressLoc) - - if amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister == functionAddressRegister { - // This case we must move the value on targetFunctionAddressRegister to another register, otherwise - // the address (jump target below) will be modified and result in segfault. - // See #526. - c.assembler.CompileRegisterToRegister(amd64.MOVQ, functionAddressRegister, tmpRegister) - functionAddressRegister = tmpRegister - } - - // Also, we have to put the target function's *wasm.ModuleInstance into amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, functionAddressRegister, functionModuleInstanceOffset, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - - // And jump into the initial address of the target function. - c.assembler.CompileJumpToMemory(amd64.JMP, functionAddressRegister, functionCodeInitialAddressOffset) - - // All the registers used are temporary, so we mark them unused. - c.locationStack.markRegisterUnused(tmpRegister, functionAddressRegister) - - // On the function return, we have to initialize the state. - if err := c.compileModuleContextInitialization(); err != nil { - return err - } - - // Due to the change to callEngine.stackContext.stackBasePointer. - c.compileReservedStackBasePointerInitialization() - - // Due to the change to callEngine.moduleContext.moduleInstance as that might result in - // the memory instance manipulation. - c.compileReservedMemoryPointerInitialization() - - // We consumed the function parameters, the call frame stack and reserved slots during the call. - c.locationStack.sp = uint64(nextStackBasePointerOffset) - - // Now the function results are pushed by the call. - for _, t := range functype.Results { - loc := c.locationStack.pushRuntimeValueLocationOnStack() - switch t { - case wasm.ValueTypeI32: - loc.valueType = runtimeValueTypeI32 - case wasm.ValueTypeI64, wasm.ValueTypeFuncref, wasm.ValueTypeExternref: - loc.valueType = runtimeValueTypeI64 - case wasm.ValueTypeF32: - loc.valueType = runtimeValueTypeF32 - case wasm.ValueTypeF64: - loc.valueType = runtimeValueTypeF64 - case wasm.ValueTypeV128: - loc.valueType = runtimeValueTypeV128Lo - hi := c.locationStack.pushRuntimeValueLocationOnStack() - hi.valueType = runtimeValueTypeV128Hi - default: - panic("BUG: invalid type: " + wasm.ValueTypeName(t)) - } - } - return nil -} - -// returnFunction adds instructions to return from the current callframe back to the caller's frame. -// If this is the current one is the origin, we return to the callEngine.execWasmFunction with the Returned status. -// Otherwise, we jump into the callers' return address stored in callFrame.returnAddress while setting -// up all the necessary change on the callEngine's state. -// -// Note: this is the counterpart for callFunction, and see the comments there as well -// to understand how the function calls are achieved. -func (c *amd64Compiler) compileReturnFunction() error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - if c.withListener { - if err := c.compileCallBuiltinFunction(builtinFunctionIndexFunctionListenerAfter); err != nil { - return err - } - // After return, we re-initialize the stack base pointer as that is used to return to the caller below. - c.compileReservedStackBasePointerInitialization() - } - - // amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister holds the module instance's address - // so mark it used so that it won't be used as a free register. - c.locationStack.markRegisterUsed(amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - defer c.locationStack.markRegisterUnused(amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - - // Obtain a temporary register to be used in the following. - returnAddressRegister, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - panic("BUG: all the registers should be free at this point: " + c.locationStack.String()) - } - - returnAddress, callerStackBasePointerInBytes, callerFunction := c.locationStack.getCallFrameLocations(c.typ) - - // A zero return address means return from the execution. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForStackBasePointerAddress, int64(returnAddress.stackPointer)*8, - returnAddressRegister, - ) - c.assembler.CompileRegisterToRegister(amd64.TESTQ, returnAddressRegister, returnAddressRegister) - - c.compileMaybeExitFromNativeCode(amd64.JNE, nativeCallStatusCodeReturned) - - // Alias for readability. - tmpRegister := amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister - - // First, restore the stackContext.stackBasePointerInBytesOffset from callerStackBasePointerInBytes. - callerStackBasePointerInBytes.setRegister(tmpRegister) - c.compileLoadValueOnStackToRegister(callerStackBasePointerInBytes) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - tmpRegister, amd64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset) - - // Next, restore moduleContext.fn from callerFunction. - callerFunction.setRegister(tmpRegister) - c.compileLoadValueOnStackToRegister(callerFunction) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - tmpRegister, amd64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset) - - // Also, we have to put the target function's *wasm.ModuleInstance into amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - tmpRegister, functionModuleInstanceOffset, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - - // Then, jump into the return address! - c.assembler.CompileJumpToRegister(amd64.JMP, returnAddressRegister) - return nil -} - -func (c *amd64Compiler) compileCallGoHostFunction() error { - return c.compileCallGoFunction(nativeCallStatusCodeCallGoHostFunction) -} - -func (c *amd64Compiler) compileCallBuiltinFunction(index wasm.Index) error { - // Set the functionAddress to the callEngine.exitContext functionCallAddress. - c.assembler.CompileConstToMemory(amd64.MOVL, int64(index), amd64ReservedRegisterForCallEngine, callEngineExitContextBuiltinFunctionCallIndexOffset) - return c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction) -} - -func (c *amd64Compiler) compileCallGoFunction(compilerStatus nativeCallStatusCode) error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - c.compileExitFromNativeCode(compilerStatus) - return nil -} - -// compileReleaseAllRegistersToStack add the instructions to release all the LIVE value -// in the value location stack at this point into the stack memory location. -func (c *amd64Compiler) compileReleaseAllRegistersToStack() (err error) { - for i := uint64(0); i < c.locationStack.sp; i++ { - if loc := &c.locationStack.stack[i]; loc.onRegister() { - c.compileReleaseRegisterToStack(loc) - } else if loc.onConditionalRegister() { - if err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc); err != nil { - return - } - c.compileReleaseRegisterToStack(loc) - } - } - return -} - -func (c *amd64Compiler) onValueReleaseRegisterToStack(reg asm.Register) { - for i := uint64(0); i < c.locationStack.sp; i++ { - prevValue := &c.locationStack.stack[i] - if prevValue.register == reg { - c.compileReleaseRegisterToStack(prevValue) - break - } - } -} - -// compileReleaseRegisterToStack implements compiler.compileReleaseRegisterToStack for amd64. -func (c *amd64Compiler) compileReleaseRegisterToStack(loc *runtimeValueLocation) { - var inst asm.Instruction - switch loc.valueType { - case runtimeValueTypeV128Lo: - inst = amd64.MOVDQU - case runtimeValueTypeV128Hi: - panic("BUG: V128Hi must be released to the stack along with V128Lo") - case runtimeValueTypeI32, runtimeValueTypeF32: - inst = amd64.MOVL - case runtimeValueTypeI64, runtimeValueTypeF64: - inst = amd64.MOVQ - default: - panic("BUG: unknown runtime value type") - } - - c.assembler.CompileRegisterToMemory(inst, loc.register, - // Note: stack pointers are ensured not to exceed 2^27 so this offset never exceeds 32-bit range. - amd64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8) - - // Mark the register is free. - c.locationStack.releaseRegister(loc) - - if loc.valueType == runtimeValueTypeV128Lo { - // Higher 64-bits are released as well ^^. - hi := &c.locationStack.stack[loc.stackPointer+1] - c.locationStack.releaseRegister(hi) - } -} - -func (c *amd64Compiler) compileMaybeExitFromNativeCode(skipCondition asm.Instruction, status nativeCallStatusCode) { - if target := c.compiledTrapTargets[status]; target != nil { - // We've already compiled this. - // Invert the return condition to jump into the appropriate target. - var returnCondition asm.Instruction - switch skipCondition { - case amd64.JHI: - returnCondition = amd64.JLS - case amd64.JLS: - returnCondition = amd64.JHI - case amd64.JNE: - returnCondition = amd64.JEQ - case amd64.JEQ: - returnCondition = amd64.JNE - case amd64.JCC: - returnCondition = amd64.JCS - case amd64.JCS: - returnCondition = amd64.JCC - case amd64.JPC: - returnCondition = amd64.JPS - case amd64.JPS: - returnCondition = amd64.JPC - case amd64.JPL: - returnCondition = amd64.JMI - case amd64.JMI: - returnCondition = amd64.JPL - default: - panic("BUG: couldn't invert condition") - } - c.assembler.CompileJump(returnCondition).AssignJumpTarget(target) - } else { - skip := c.assembler.CompileJump(skipCondition) - c.compileExitFromNativeCode(status) - c.assembler.SetJumpTargetOnNext(skip) - } -} - -func (c *amd64Compiler) compileExitFromNativeCode(status nativeCallStatusCode) { - if target := c.compiledTrapTargets[status]; target != nil { - c.assembler.CompileJump(amd64.JMP).AssignJumpTarget(target) - } - - switch status { - case nativeCallStatusCodeReturned: - // Save the target for reuse. - c.compiledTrapTargets[status] = c.compileNOP() - case nativeCallStatusCodeCallGoHostFunction, nativeCallStatusCodeCallBuiltInFunction: - // Read the return address, and write it to callEngine.exitContext.returnAddress. - returnAddressReg, ok := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !ok { - panic("BUG: cannot take free register") - } - c.assembler.CompileReadInstructionAddress(returnAddressReg, amd64.RET) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - returnAddressReg, amd64ReservedRegisterForCallEngine, callEngineExitContextReturnAddressOffset) - default: - if c.ir.IROperationSourceOffsetsInWasmBinary != nil { - // This case, the execution traps and we want the top frame's source position in the stack trace. - // Take RegR15 and store the instruction address onto callEngine.returnAddress. - returnAddressReg := amd64.RegR15 - c.assembler.CompileReadInstructionAddress(returnAddressReg, amd64.MOVQ) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - returnAddressReg, amd64ReservedRegisterForCallEngine, callEngineExitContextReturnAddressOffset) - } else { - // We won't use the source position, so just save the target for reuse. - c.compiledTrapTargets[status] = c.compileNOP() - } - } - - // Write the status to callEngine.exitContext.statusCode. - c.assembler.CompileConstToMemory(amd64.MOVB, int64(status), - amd64ReservedRegisterForCallEngine, callEngineExitContextNativeCallStatusCodeOffset) - - // Write back the cached SP to the actual eng.stackPointer. - c.assembler.CompileConstToMemory(amd64.MOVQ, int64(c.locationStack.sp), - amd64ReservedRegisterForCallEngine, callEngineStackContextStackPointerOffset) - - c.assembler.CompileStandAlone(amd64.RET) -} - -func (c *amd64Compiler) compilePreamble() (err error) { - // We assume all function parameters are already pushed onto the stack by - // the caller. - c.locationStack.init(c.typ) - - if err := c.compileModuleContextInitialization(); err != nil { - return err - } - - // Check if it's necessary to grow the value stack by using max stack pointer. - if err = c.compileMaybeGrowStack(); err != nil { - return err - } - - if c.withListener { - if err = c.compileCallBuiltinFunction(builtinFunctionIndexFunctionListenerBefore); err != nil { - return err - } - } - - c.compileReservedStackBasePointerInitialization() - - // Finally, we initialize the reserved memory register based on the module context. - c.compileReservedMemoryPointerInitialization() - return -} - -func (c *amd64Compiler) compileReservedStackBasePointerInitialization() { - // First, make reservedRegisterForStackBasePointer point to the beginning of the slice backing array. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackElement0AddressOffset, - amd64ReservedRegisterForStackBasePointerAddress) - - // next we move the base pointer (callEngine.stackBasePointer) to the tmp register. - c.assembler.CompileMemoryToRegister(amd64.ADDQ, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, - amd64ReservedRegisterForStackBasePointerAddress, - ) -} - -func (c *amd64Compiler) compileReservedMemoryPointerInitialization() { - if c.ir.HasMemory || c.ir.UsesMemory { - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemoryElement0AddressOffset, - amd64ReservedRegisterForMemory, - ) - } -} - -// compileMaybeGrowStack adds instructions to check the necessity to grow the value stack, -// and if so, make the builtin function call to do so. These instructions are called in the function's -// preamble. -func (c *amd64Compiler) compileMaybeGrowStack() error { - tmpRegister, ok := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !ok { - panic("BUG: cannot take free register") - } - - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackLenInBytesOffset, tmpRegister) - c.assembler.CompileMemoryToRegister(amd64.SUBQ, - amd64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, tmpRegister) - - // If stack base pointer + max stack pointer > stackLen, we need to grow the stack. - cmpWithStackPointerCeil := c.assembler.CompileRegisterToConst(amd64.CMPQ, tmpRegister, 0) - c.assignStackPointerCeilNeeded = cmpWithStackPointerCeil - - // Jump if we have no need to grow. - jmpIfNoNeedToGrowStack := c.assembler.CompileJump(amd64.JCC) - - // Otherwise, we have to make the builtin function call to grow the call stack. - if err := c.compileCallBuiltinFunction(builtinFunctionIndexGrowStack); err != nil { - return err - } - - c.assembler.SetJumpTargetOnNext(jmpIfNoNeedToGrowStack) - return nil -} - -// compileModuleContextInitialization adds instructions to initialize callEngine.ModuleContext's fields based on -// callEngine.ModuleContext.ModuleInstanceAddress. -// This is called in two cases: in function preamble, and on the return from (non-Go) function calls. -func (c *amd64Compiler) compileModuleContextInitialization() error { - // amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister holds the module instance's address - // so mark it used so that it won't be used as a free register until the module context initialization finishes. - c.locationStack.markRegisterUsed(amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - defer c.locationStack.markRegisterUnused(amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - - // Obtain the temporary registers to be used in the followings. - tmpRegister, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - // This in theory never happen as all the registers must be free except indexReg. - return fmt.Errorf("could not find enough free registers") - } - c.locationStack.markRegisterUsed(tmpRegister) - tmpRegister2, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - // This in theory never happen as all the registers must be free except indexReg. - return fmt.Errorf("could not find enough free registers") - } - c.locationStack.markRegisterUsed(tmpRegister2) - - // If the module instance address stays the same, we could skip the entire code below. - // The rationale/idea for this is that, in almost all use cases, users instantiate a single - // Wasm binary and run the functions from it, rather than doing import/export on multiple - // binaries. As a result, this cmp and jmp instruction sequence below must be easy for - // x64 CPU to do branch prediction since almost 100% jump happens across function calls. - c.assembler.CompileMemoryToRegister(amd64.CMPQ, - amd64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset, amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister) - jmpIfModuleNotChange := c.assembler.CompileJump(amd64.JEQ) - - // If engine.ModuleContext.ModuleInstance is not equal the value on amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, - // we have to put the new value there. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset) - - // Also, we have to update the following fields: - // * callEngine.moduleContext.globalElement0Address - // * callEngine.moduleContext.tableElement0Address - // * callEngine.moduleContext.memoryInstance - // * callEngine.moduleContext.memoryElement0Address - // * callEngine.moduleContext.memorySliceLen - // * callEngine.moduleContext.codesElement0Address - // * callEngine.moduleContext.typeIDsElement0Address - // * callEngine.moduleContext.dataInstancesElement0Address - // * callEngine.moduleContext.elementInstancesElement0Address - - // Update globalElement0Address. - // - // Note: if there's global.get or set instruction in the function, the existence of the globals - // is ensured by function validation at module instantiation phase, and that's why it is ok to - // skip the initialization if the module's globals slice is empty. - if len(c.ir.Globals) > 0 { - // Since ModuleInstance.Globals is []*globalInstance, internally - // the address of the first item in the underlying array lies exactly on the globals offset. - // See https://go.dev/blog/slices-intro if unfamiliar. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceGlobalsOffset, tmpRegister) - - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister, amd64ReservedRegisterForCallEngine, callEngineModuleContextGlobalElement0AddressOffset) - } - - // Update tableElement0Address. - // - // Note: if there's table instruction in the function, the existence of the table - // is ensured by function validation at module instantiation phase, and that's - // why it is ok to skip the initialization if the module's table doesn't exist. - if c.ir.HasTable { - // First, we need to read the *wasm.Table. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceTablesOffset, tmpRegister) - - // At this point, tmpRegister holds the address of ModuleInstance.Table. - // So we are ready to read and put the first item's address stored in Table.Table. - // Here we read the value into tmpRegister2. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset) - - // Finally, we put &ModuleInstance.TypeIDs[0] into moduleContext.typeIDsElement0Address. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceTypeIDsOffset, tmpRegister) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, - tmpRegister, amd64ReservedRegisterForCallEngine, callEngineModuleContextTypeIDsElement0AddressOffset) - } - - // Update memoryElement0Address and memorySliceLen. - // - // Note: if there's memory instruction in the function, memory instance must be non-nil. - // That is ensured by function validation at module instantiation phase, and that's - // why it is ok to skip the initialization if the module's memory instance is nil. - if c.ir.HasMemory { - c.assembler.CompileMemoryToRegister(amd64.MOVQ, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceMemoryOffset, - tmpRegister) - - // Set memory instance. - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemoryInstanceOffset) - - // Set length. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmpRegister, memoryInstanceBufferLenOffset, tmpRegister2) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister2, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset) - - // Set element zero address. - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmpRegister, memoryInstanceBufferOffset, tmpRegister2) - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister2, - amd64ReservedRegisterForCallEngine, callEngineModuleContextMemoryElement0AddressOffset) - } - - // Update moduleContext.codesElement0Address - { - // "tmpRegister = [moduleInstanceAddressRegister + moduleInstanceEngineOffset + interfaceDataOffset] (== *moduleEngine)" - // - // Go's interface is laid out on memory as two quad words as struct {tab, data uintptr} - // where tab points to the interface table, and the latter points to the actual - // implementation of interface. This case, we extract "data" pointer as *moduleEngine. - // See the following references for detail: - // * https://research.swtch.com/interfaces - // * https://github.com/golang/go/blob/release-branch.go1.20/src/runtime/runtime2.go#L207-L210 - c.assembler.CompileMemoryToRegister(amd64.MOVQ, amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceEngineOffset+interfaceDataOffset, tmpRegister) - - // "tmpRegister = [tmpRegister + moduleEnginecodesOffset] (== &moduleEngine.codes[0])" - c.assembler.CompileMemoryToRegister(amd64.MOVQ, tmpRegister, moduleEngineFunctionsOffset, tmpRegister) - - // "callEngine.moduleContext.functionsElement0Address = tmpRegister". - c.assembler.CompileRegisterToMemory(amd64.MOVQ, tmpRegister, amd64ReservedRegisterForCallEngine, - callEngineModuleContextFunctionsElement0AddressOffset) - } - - // Update dataInstancesElement0Address. - if c.ir.HasDataInstances { - // "tmpRegister = &moduleInstance.DataInstances[0]" - c.assembler.CompileMemoryToRegister( - amd64.MOVQ, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceDataInstancesOffset, - tmpRegister, - ) - // "callEngine.moduleContext.dataInstancesElement0Address = tmpRegister". - c.assembler.CompileRegisterToMemory( - amd64.MOVQ, - tmpRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextDataInstancesElement0AddressOffset, - ) - } - - // Update callEngine.moduleContext.elementInstancesElement0Address - if c.ir.HasElementInstances { - // "tmpRegister = &moduleInstance.ElementInstnaces[0]" - c.assembler.CompileMemoryToRegister( - amd64.MOVQ, - amd64CallingConventionDestinationFunctionModuleInstanceAddressRegister, moduleInstanceElementInstancesOffset, - tmpRegister, - ) - // "callEngine.moduleContext.dataInstancesElement0Address = tmpRegister". - c.assembler.CompileRegisterToMemory( - amd64.MOVQ, - tmpRegister, - amd64ReservedRegisterForCallEngine, callEngineModuleContextElementInstancesElement0AddressOffset, - ) - } - - c.locationStack.markRegisterUnused(tmpRegister, tmpRegister2) - - // Set the jump target towards the next instruction for the case where module instance address hasn't changed. - c.assembler.SetJumpTargetOnNext(jmpIfModuleNotChange) - return nil -} - -// compileEnsureOnRegister ensures that the given value is located on a -// general purpose register of an appropriate type. -func (c *amd64Compiler) compileEnsureOnRegister(loc *runtimeValueLocation) (err error) { - if loc.onStack() { - // Allocate the register. - reg, err := c.allocateRegister(loc.getRegisterType()) - if err != nil { - return err - } - - // Mark it uses the register. - loc.setRegister(reg) - c.locationStack.markRegisterUsed(reg) - - c.compileLoadValueOnStackToRegister(loc) - } else if loc.onConditionalRegister() { - err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc) - } - return -} - -// compileMaybeSwapRegisters swaps two registers if they're not equal. -func (c *amd64Compiler) compileMaybeSwapRegisters(reg1, reg2 asm.Register) { - if reg1 != reg2 { - c.assembler.CompileRegisterToRegister(amd64.XCHGQ, reg1, reg2) - } -} - -// compilePreventCrossedTargetRegisters swaps registers in such a way, that for neither runtimeValueLocation from locs its -// corresponding register with the same index from targets is occupied by some other runtimeValueLocation from locs. It returns a -// closure to restore the original register placement. -// -// This function makes it possible to safely exchange one set of registers with another, where a register might be in both sets. -// Each register will correspond either to itself or another register not present in its own set. -// -// For example, if we have locs = [AX, BX, CX], targets = [BX, SI, AX], then it'll do two swaps -// to make locs = [BX, CX, AX]. -func (c *amd64Compiler) compilePreventCrossedTargetRegisters(locs []*runtimeValueLocation, targets []asm.Register) (restore func()) { - type swap struct{ srcIndex, dstIndex int } - var swaps []swap - for i := range locs { - targetLocation := -1 // -1 means not found. - for j := range locs { - if locs[j].register == targets[i] { - targetLocation = j - break - } - } - if targetLocation != -1 && targetLocation != i { - c.compileMaybeSwapRegisters(locs[i].register, locs[targetLocation].register) - locs[i].register, locs[targetLocation].register = locs[targetLocation].register, locs[i].register - swaps = append(swaps, swap{i, targetLocation}) - } - } - return func() { - // Restore in reverse order because a register can be moved multiple times. - for i := len(swaps) - 1; i >= 0; i -= 1 { - r1, r2 := swaps[i].srcIndex, swaps[i].dstIndex - c.compileMaybeSwapRegisters(locs[r1].register, locs[r2].register) - locs[r1].register, locs[r2].register = locs[r2].register, locs[r1].register - } - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_arm64.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_arm64.go deleted file mode 100644 index af02481885..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_arm64.go +++ /dev/null @@ -1,4355 +0,0 @@ -// This file implements the compiler for arm64 target. -// Please refer to https://developer.arm.com/documentation/102374/latest/ -// if unfamiliar with arm64 instructions and semantics. -package compiler - -import ( - "bytes" - "errors" - "fmt" - "math" - - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/asm/arm64" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -type arm64Compiler struct { - assembler arm64.Assembler - ir *wazeroir.CompilationResult - // locationStack holds the state of wazeroir virtual stack. - // and each item is either placed in register or the actual memory stack. - locationStack *runtimeValueLocationStack - // labels maps a label (e.g. ".L1_then") to *arm64LabelInfo. - labels [wazeroir.LabelKindNum][]arm64LabelInfo - // stackPointerCeil is the greatest stack pointer value (from runtimeValueLocationStack) seen during compilation. - stackPointerCeil uint64 - // assignStackPointerCeilNeeded holds an asm.Node whose AssignDestinationConstant must be called with the determined stack pointer ceiling. - assignStackPointerCeilNeeded asm.Node - compiledTrapTargets [nativeCallStatusModuleClosed]asm.Node - withListener bool - typ *wasm.FunctionType - br *bytes.Reader - // locationStackForEntrypoint is the initial location stack for all functions. To reuse the allocated stack, - // we cache it here, and reset and set to .locationStack in the Init method. - locationStackForEntrypoint runtimeValueLocationStack - // frameIDMax tracks the maximum value of frame id per function. - frameIDMax int - brTableTmp []runtimeValueLocation -} - -func newArm64Compiler() compiler { - return &arm64Compiler{ - assembler: arm64.NewAssembler(arm64ReservedRegisterForTemporary), - locationStackForEntrypoint: newRuntimeValueLocationStack(), - br: bytes.NewReader(nil), - } -} - -// Init implements compiler.Init. -func (c *arm64Compiler) Init(typ *wasm.FunctionType, ir *wazeroir.CompilationResult, withListener bool) { - c.assembler.Reset() - c.locationStackForEntrypoint.reset() - c.resetLabels() - - *c = arm64Compiler{ - ir: ir, - withListener: withListener, - typ: typ, - assembler: c.assembler, - labels: c.labels, - br: c.br, - brTableTmp: c.brTableTmp, - locationStackForEntrypoint: c.locationStackForEntrypoint, - } - - // Reuses the initial location stack for the compilation of subsequent functions. - c.locationStack = &c.locationStackForEntrypoint -} - -// resetLabels resets the existing content in arm64Compiler.labels so that -// we could reuse the allocated slices and stacks in the subsequent compilations. -func (c *arm64Compiler) resetLabels() { - for i := range c.labels { - for j := range c.labels[i] { - if j > c.frameIDMax { - // Only need to reset until the maximum frame id. This makes the compilation faster for large binary. - break - } - l := &c.labels[i][j] - l.initialInstruction = nil - l.stackInitialized = false - l.initialStack.reset() - } - } -} - -var ( - arm64UnreservedVectorRegisters = []asm.Register{ - arm64.RegV0, arm64.RegV1, arm64.RegV2, arm64.RegV3, - arm64.RegV4, arm64.RegV5, arm64.RegV6, arm64.RegV7, arm64.RegV8, - arm64.RegV9, arm64.RegV10, arm64.RegV11, arm64.RegV12, arm64.RegV13, - arm64.RegV14, arm64.RegV15, arm64.RegV16, arm64.RegV17, arm64.RegV18, - arm64.RegV19, arm64.RegV20, arm64.RegV21, arm64.RegV22, arm64.RegV23, - arm64.RegV24, arm64.RegV25, arm64.RegV26, arm64.RegV27, arm64.RegV28, - arm64.RegV29, arm64.RegV30, arm64.RegV31, - } - - // Note (see arm64 section in https://go.dev/doc/asm): - // * RegR18 is reserved as a platform register, and we don't use it in Compiler. - // * RegR28 is reserved for Goroutine by Go runtime, and we don't use it in Compiler. - arm64UnreservedGeneralPurposeRegisters = []asm.Register{ //nolint - arm64.RegR3, arm64.RegR4, arm64.RegR5, arm64.RegR6, arm64.RegR7, arm64.RegR8, - arm64.RegR9, arm64.RegR10, arm64.RegR11, arm64.RegR12, arm64.RegR13, - arm64.RegR14, arm64.RegR15, arm64.RegR16, arm64.RegR17, arm64.RegR19, - arm64.RegR20, arm64.RegR21, arm64.RegR22, arm64.RegR23, arm64.RegR24, - arm64.RegR25, arm64.RegR26, arm64.RegR29, arm64.RegR30, - } -) - -const ( - // arm64ReservedRegisterForCallEngine holds the pointer to callEngine instance (i.e. *callEngine as uintptr) - arm64ReservedRegisterForCallEngine = arm64.RegR0 - // arm64ReservedRegisterForStackBasePointerAddress holds stack base pointer's address (callEngine.stackBasePointer) in the current function call. - arm64ReservedRegisterForStackBasePointerAddress = arm64.RegR1 - // arm64ReservedRegisterForMemory holds the pointer to the memory slice's data (i.e. &memory.Buffer[0] as uintptr). - arm64ReservedRegisterForMemory = arm64.RegR2 - // arm64ReservedRegisterForTemporary is the temporary register which is available at any point of execution, but its content shouldn't be supposed to live beyond the single operation. - // Note: we choose R27 as that is the temporary register used in Go's assembler. - arm64ReservedRegisterForTemporary = arm64.RegR27 -) - -var arm64CallingConventionModuleInstanceAddressRegister = arm64.RegR29 - -const ( - // arm64CallEngineArchContextCompilerCallReturnAddressOffset is the offset of archContext.nativeCallReturnAddress in callEngine. - arm64CallEngineArchContextCompilerCallReturnAddressOffset = 144 - // arm64CallEngineArchContextMinimum32BitSignedIntOffset is the offset of archContext.minimum32BitSignedIntAddress in callEngine. - arm64CallEngineArchContextMinimum32BitSignedIntOffset = 152 - // arm64CallEngineArchContextMinimum64BitSignedIntOffset is the offset of archContext.minimum64BitSignedIntAddress in callEngine. - arm64CallEngineArchContextMinimum64BitSignedIntOffset = 160 -) - -func isZeroRegister(r asm.Register) bool { - return r == arm64.RegRZR -} - -// compileNOP implements compiler.compileNOP for the arm64 architecture. -func (c *arm64Compiler) compileNOP() asm.Node { - return c.assembler.CompileStandAlone(arm64.NOP) -} - -// compile implements compiler.compile for the arm64 architecture. -func (c *arm64Compiler) compile(buf asm.Buffer) (stackPointerCeil uint64, err error) { - // c.stackPointerCeil tracks the stack pointer ceiling (max seen) value across all runtimeValueLocationStack(s) - // used for all labels (via setLocationStack), excluding the current one. - // Hence, we check here if the final block's max one exceeds the current c.stackPointerCeil. - stackPointerCeil = c.stackPointerCeil - if stackPointerCeil < c.locationStack.stackPointerCeil { - stackPointerCeil = c.locationStack.stackPointerCeil - } - - // Now that the ceil of stack pointer is determined, we are invoking the callback. - // Note: this must be called before Assemble() below. - c.assignStackPointerCeil(stackPointerCeil) - - err = c.assembler.Assemble(buf) - return -} - -// arm64LabelInfo holds a wazeroir label specific information in this function. -type arm64LabelInfo struct { - // initialInstruction is the initial instruction for this label so other block can branch into it. - initialInstruction asm.Node - // initialStack is the initial value location stack from which we start compiling this label. - initialStack runtimeValueLocationStack - stackInitialized bool -} - -// assignStackPointerCeil implements compilerImpl.assignStackPointerCeil for the arm64 architecture. -func (c *arm64Compiler) assignStackPointerCeil(ceil uint64) { - if c.assignStackPointerCeilNeeded != nil { - c.assignStackPointerCeilNeeded.AssignSourceConstant(int64(ceil) << 3) - } -} - -func (c *arm64Compiler) label(label wazeroir.Label) *arm64LabelInfo { - kind := label.Kind() - frames := c.labels[kind] - frameID := label.FrameID() - if c.frameIDMax < frameID { - c.frameIDMax = frameID - } - // If the frameID is not allocated yet, expand the slice by twice of the diff, - // so that we could reduce the allocation in the subsequent compilation. - if diff := frameID - len(frames) + 1; diff > 0 { - for i := 0; i < diff; i++ { - frames = append(frames, arm64LabelInfo{initialStack: newRuntimeValueLocationStack()}) - } - c.labels[kind] = frames - } - return &frames[frameID] -} - -// runtimeValueLocationStack implements compilerImpl.runtimeValueLocationStack for the amd64 architecture. -func (c *arm64Compiler) runtimeValueLocationStack() *runtimeValueLocationStack { - return c.locationStack -} - -// pushRuntimeValueLocationOnRegister implements compiler.pushRuntimeValueLocationOnRegister for arm64. -func (c *arm64Compiler) pushRuntimeValueLocationOnRegister(reg asm.Register, vt runtimeValueType) (ret *runtimeValueLocation) { - ret = c.locationStack.pushRuntimeValueLocationOnRegister(reg, vt) - c.markRegisterUsed(reg) - return -} - -// pushVectorRuntimeValueLocationOnRegister implements compiler.pushVectorRuntimeValueLocationOnRegister for arm64. -func (c *arm64Compiler) pushVectorRuntimeValueLocationOnRegister(reg asm.Register) (lowerBitsLocation *runtimeValueLocation) { - lowerBitsLocation = c.locationStack.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeV128Lo) - c.locationStack.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeV128Hi) - c.markRegisterUsed(reg) - return -} - -func (c *arm64Compiler) markRegisterUsed(regs ...asm.Register) { - for _, reg := range regs { - if !isZeroRegister(reg) && reg != asm.NilRegister { - c.locationStack.markRegisterUsed(reg) - } - } -} - -func (c *arm64Compiler) markRegisterUnused(regs ...asm.Register) { - for _, reg := range regs { - if !isZeroRegister(reg) && reg != asm.NilRegister { - c.locationStack.markRegisterUnused(reg) - } - } -} - -func (c *arm64Compiler) String() (ret string) { return c.locationStack.String() } - -// compilePreamble implements compiler.compilePreamble for the arm64 architecture. -func (c *arm64Compiler) compilePreamble() error { - c.markRegisterUsed(arm64CallingConventionModuleInstanceAddressRegister) - defer c.markRegisterUnused(arm64CallingConventionModuleInstanceAddressRegister) - - c.locationStack.init(c.typ) - - // Check if it's necessary to grow the value stack before entering function body. - if err := c.compileMaybeGrowStack(); err != nil { - return err - } - - if err := c.compileModuleContextInitialization(); err != nil { - return err - } - - if c.withListener { - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexFunctionListenerBefore); err != nil { - return err - } - } - - // We must initialize the stack base pointer register so that we can manipulate the stack properly. - c.compileReservedStackBasePointerRegisterInitialization() - - c.compileReservedMemoryRegisterInitialization() - - return nil -} - -// compileMaybeGrowStack adds instructions to check the necessity to grow the value stack, -// and if so, make the builtin function call to do so. These instructions are called in the function's -// preamble. -func (c *arm64Compiler) compileMaybeGrowStack() error { - tmpX, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - panic("BUG: all the registers should be free at this point") - } - c.markRegisterUsed(tmpX) - tmpY, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - panic("BUG: all the registers should be free at this point") - } - c.markRegisterUsed(tmpY) - - // "tmpX = len(ce.stack)" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackLenInBytesOffset, - tmpX, - ) - - // "tmpY = ce.stackBasePointer" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, - tmpY, - ) - - // "tmpX = tmpX - tmpY", in other words "tmpX = len(ce.stack) - ce.stackBasePointer" - c.assembler.CompileRegisterToRegister( - arm64.SUB, - tmpY, - tmpX, - ) - - // "tmpY = stackPointerCeil" - loadStackPointerCeil := c.assembler.CompileConstToRegister( - arm64.MOVD, - math.MaxInt32, - tmpY, - ) - // At this point of compilation, we don't know the value of stack point ceil, - // so we lazily resolve the value later. - c.assignStackPointerCeilNeeded = loadStackPointerCeil - - // Compare tmpX (len(ce.stack) - ce.stackBasePointer) and tmpY (ce.stackPointerCeil) - c.assembler.CompileTwoRegistersToNone(arm64.CMP, tmpX, tmpY) - - // If ceil > stackLen - stack base pointer, we need to grow the stack by calling builtin Go function. - brIfStackOK := c.assembler.CompileJump(arm64.BCONDLS) - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexGrowStack); err != nil { - return err - } - - // Otherwise, skip calling it. - c.assembler.SetJumpTargetOnNext(brIfStackOK) - - c.markRegisterUnused(tmpX, tmpY) - return nil -} - -// returnFunction emits instructions to return from the current function frame. -// If the current frame is the bottom, the code goes back to the Go code with nativeCallStatusCodeReturned status. -// Otherwise, we branch into the caller's return address. -func (c *arm64Compiler) compileReturnFunction() error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - if c.withListener { - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexFunctionListenerAfter); err != nil { - return err - } - // After return, we re-initialize the stack base pointer as that is used to return to the caller below. - c.compileReservedStackBasePointerRegisterInitialization() - } - - // arm64CallingConventionModuleInstanceAddressRegister holds the module intstance's address - // so mark it used so that it won't be used as a free register. - c.locationStack.markRegisterUsed(arm64CallingConventionModuleInstanceAddressRegister) - defer c.locationStack.markRegisterUnused(arm64CallingConventionModuleInstanceAddressRegister) - - returnAddress, callerStackBasePointerInBytes, callerFunction := c.locationStack.getCallFrameLocations(c.typ) - - // If the return address is zero, meaning that we return from the execution. - returnAddress.setRegister(arm64ReservedRegisterForTemporary) - c.compileLoadValueOnStackToRegister(returnAddress) - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, arm64.RegRZR) - - // Br if the address does not equal zero, otherwise, exit. - // If the address doesn't equal zero, return br into returnAddressRegister (caller's return address). - c.compileMaybeExitFromNativeCode(arm64.BCONDNE, nativeCallStatusCodeReturned) - - // Alias for readability. - tmp := arm64CallingConventionModuleInstanceAddressRegister - - // First, restore the stackContext.stackBasePointerInBytesOffset from callerStackBasePointerInBytes. - callerStackBasePointerInBytes.setRegister(tmp) - c.compileLoadValueOnStackToRegister(callerStackBasePointerInBytes) - c.assembler.CompileRegisterToMemory(arm64.STRD, tmp, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset) - - // Next, restore moduleContext.fn from callerFunction. - callerFunction.setRegister(tmp) - c.compileLoadValueOnStackToRegister(callerFunction) - c.assembler.CompileRegisterToMemory(arm64.STRD, tmp, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset) - - // Also, we have to put the target function's *wasm.ModuleInstance into arm64CallingConventionModuleInstanceAddressRegister. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - tmp, functionModuleInstanceOffset, - arm64CallingConventionModuleInstanceAddressRegister) - - c.assembler.CompileJumpToRegister(arm64.B, returnAddress.register) - return nil -} - -func (c *arm64Compiler) compileMaybeExitFromNativeCode(skipCondition asm.Instruction, status nativeCallStatusCode) { - if target := c.compiledTrapTargets[status]; target != nil { - // We've already compiled this. - // Invert the condition to jump into the appropriate target. - var trapCondition asm.Instruction - switch skipCondition { - case arm64.BCONDEQ: - trapCondition = arm64.BCONDNE - case arm64.BCONDNE: - trapCondition = arm64.BCONDEQ - case arm64.BCONDLO: - trapCondition = arm64.BCONDHS - case arm64.BCONDHS: - trapCondition = arm64.BCONDLO - case arm64.BCONDLS: - trapCondition = arm64.BCONDHI - case arm64.BCONDHI: - trapCondition = arm64.BCONDLS - case arm64.BCONDVS: - trapCondition = arm64.BCONDVC - case arm64.BCONDVC: - trapCondition = arm64.BCONDVS - default: - panic("BUG: couldn't invert condition") - } - c.assembler.CompileJump(trapCondition).AssignJumpTarget(target) - } else { - skip := c.assembler.CompileJump(skipCondition) - c.compileExitFromNativeCode(status) - c.assembler.SetJumpTargetOnNext(skip) - } -} - -// compileExitFromNativeCode adds instructions to give the control back to ce.exec with the given status code. -func (c *arm64Compiler) compileExitFromNativeCode(status nativeCallStatusCode) { - if target := c.compiledTrapTargets[status]; target != nil { - c.assembler.CompileJump(arm64.B).AssignJumpTarget(target) - } - - switch status { - case nativeCallStatusCodeReturned: - // Save the target for reuse. - c.compiledTrapTargets[status] = c.compileNOP() - case nativeCallStatusCodeCallGoHostFunction, nativeCallStatusCodeCallBuiltInFunction: - // Read the return address, and write it to callEngine.exitContext.returnAddress. - c.assembler.CompileReadInstructionAddress(arm64ReservedRegisterForTemporary, arm64.RET) - c.assembler.CompileRegisterToMemory( - arm64.STRD, arm64ReservedRegisterForTemporary, - arm64ReservedRegisterForCallEngine, callEngineExitContextReturnAddressOffset, - ) - default: - if c.ir.IROperationSourceOffsetsInWasmBinary != nil { - // This case, the execution traps, and we want the top frame's source position in the stack trace. - // We store the instruction address onto callEngine.returnAddress. - c.assembler.CompileReadInstructionAddress(arm64ReservedRegisterForTemporary, arm64.STRD) - c.assembler.CompileRegisterToMemory( - arm64.STRD, arm64ReservedRegisterForTemporary, - arm64ReservedRegisterForCallEngine, callEngineExitContextReturnAddressOffset, - ) - } else { - // We won't use the source position, so just save the target for reuse. - c.compiledTrapTargets[status] = c.compileNOP() - } - } - - // Write the current stack pointer to the ce.stackPointer. - c.assembler.CompileConstToRegister(arm64.MOVD, int64(c.locationStack.sp), arm64ReservedRegisterForTemporary) - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64ReservedRegisterForTemporary, arm64ReservedRegisterForCallEngine, - callEngineStackContextStackPointerOffset) - - // Write the status to callEngine.exitContext.statusCode. - if status != 0 { - c.assembler.CompileConstToRegister(arm64.MOVW, int64(status), arm64ReservedRegisterForTemporary) - c.assembler.CompileRegisterToMemory(arm64.STRW, arm64ReservedRegisterForTemporary, - arm64ReservedRegisterForCallEngine, callEngineExitContextNativeCallStatusCodeOffset) - } else { - // If the status == 0, we use zero register to store zero. - c.assembler.CompileRegisterToMemory(arm64.STRW, arm64.RegRZR, - arm64ReservedRegisterForCallEngine, callEngineExitContextNativeCallStatusCodeOffset) - } - - // The return address to the Go code is stored in archContext.compilerReturnAddress which - // is embedded in ce. We load the value to the tmpRegister, and then - // invoke RET with that register. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, arm64CallEngineArchContextCompilerCallReturnAddressOffset, - arm64ReservedRegisterForTemporary) - - c.assembler.CompileJumpToRegister(arm64.RET, arm64ReservedRegisterForTemporary) -} - -// compileGoHostFunction implements compiler.compileHostFunction for the arm64 architecture. -func (c *arm64Compiler) compileGoDefinedHostFunction() error { - // First we must update the location stack to reflect the number of host function inputs. - c.locationStack.init(c.typ) - - if c.withListener { - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, - builtinFunctionIndexFunctionListenerBefore); err != nil { - return err - } - } - - // Host function needs access to the caller's Function Instance, and the caller's information is stored in the stack - // (as described in the doc of callEngine.stack). Here, we get the caller's *wasm.FunctionInstance from the stack, - // and save it in callEngine.exitContext.callerFunctionInstance so we can pass it to the host function - // without sacrificing the performance. - c.compileReservedStackBasePointerRegisterInitialization() - // Alias for readability. - tmp := arm64CallingConventionModuleInstanceAddressRegister - // Get the location of the callerFunction (*function) in the stack, which depends on the signature. - _, _, callerFunction := c.locationStack.getCallFrameLocations(c.typ) - // Load the value into the tmp register: tmp = &function{..} - callerFunction.setRegister(tmp) - c.compileLoadValueOnStackToRegister(callerFunction) - // tmp = *(tmp+functionModuleInstanceOffset) = &wasm.ModuleInstance{...} - c.assembler.CompileMemoryToRegister(arm64.LDRD, tmp, functionModuleInstanceOffset, tmp) - // Load it onto callEngine.exitContext.callerModuleInstance. - c.assembler.CompileRegisterToMemory(arm64.STRD, - tmp, - arm64ReservedRegisterForCallEngine, callEngineExitContextCallerModuleInstanceOffset) - // Reset the state of callerFunction value location so that we won't mess up subsequent code generation below. - c.locationStack.releaseRegister(callerFunction) - - if err := c.compileCallGoFunction(nativeCallStatusCodeCallGoHostFunction, 0); err != nil { - return err - } - - // Initializes the reserved stack base pointer which is used to retrieve the call frame stack. - c.compileReservedStackBasePointerRegisterInitialization() - - // Go function can change the module state in arbitrary way, so we have to force - // the callEngine.moduleContext initialization on the function return. To do so, - // we zero-out callEngine.moduleInstance. - c.assembler.CompileRegisterToMemory(arm64.STRD, - arm64.RegRZR, - arm64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset) - - return c.compileReturnFunction() -} - -// setLocationStack sets the given runtimeValueLocationStack to .locationStack field, -// while allowing us to track runtimeValueLocationStack.stackPointerCeil across multiple stacks. -// This is called when we branch into different block. -func (c *arm64Compiler) setLocationStack(newStack *runtimeValueLocationStack) { - if c.stackPointerCeil < c.locationStack.stackPointerCeil { - c.stackPointerCeil = c.locationStack.stackPointerCeil - } - c.locationStack = newStack -} - -// compileBuiltinFunctionCheckExitCode implements compiler.compileBuiltinFunctionCheckExitCode for the arm64 architecture. -func (c *arm64Compiler) compileBuiltinFunctionCheckExitCode() error { - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexCheckExitCode); err != nil { - return err - } - - // After return, we re-initialize reserved registers just like preamble of functions. - c.compileReservedStackBasePointerRegisterInitialization() - c.compileReservedMemoryRegisterInitialization() - return nil -} - -// compileLabel implements compiler.compileLabel for the arm64 architecture. -func (c *arm64Compiler) compileLabel(o *wazeroir.UnionOperation) (skipThisLabel bool) { - labelKey := wazeroir.Label(o.U1) - labelInfo := c.label(labelKey) - - // If initialStack is not set, that means this label has never been reached. - if !labelInfo.stackInitialized { - skipThisLabel = true - return - } - - if labelBegin := labelInfo.initialInstruction; labelBegin == nil { - // We use NOP as a beginning of instructions in a label. - // This should be eventually optimized out by assembler. - labelInfo.initialInstruction = c.assembler.CompileStandAlone(arm64.NOP) - } else { - c.assembler.Add(labelBegin) - } - - // Set the initial stack. - c.setLocationStack(&labelInfo.initialStack) - return false -} - -// compileUnreachable implements compiler.compileUnreachable for the arm64 architecture. -func (c *arm64Compiler) compileUnreachable() error { - c.compileExitFromNativeCode(nativeCallStatusCodeUnreachable) - return nil -} - -// compileSet implements compiler.compileSet for the arm64 architecture. -func (c *arm64Compiler) compileSet(o *wazeroir.UnionOperation) error { - depth := int(o.U1) - isTargetVector := o.B3 - - setTargetIndex := int(c.locationStack.sp) - 1 - depth - - if isTargetVector { - _ = c.locationStack.pop() - } - v := c.locationStack.pop() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - targetLocation := &c.locationStack.stack[setTargetIndex] - if targetLocation.onRegister() { - // We no longer need the register previously used by the target location. - c.markRegisterUnused(targetLocation.register) - } - - reg := v.register - targetLocation.setRegister(reg) - targetLocation.valueType = v.valueType - if isTargetVector { - hi := &c.locationStack.stack[setTargetIndex+1] - hi.setRegister(reg) - } - return nil -} - -// compileGlobalGet implements compiler.compileGlobalGet for the arm64 architecture. -func (c *arm64Compiler) compileGlobalGet(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - index := uint32(o.U1) - - wasmValueType := c.ir.Globals[index].ValType - isV128 := wasmValueType == wasm.ValueTypeV128 - // Get the address of globals[index] into globalAddressReg. - globalAddressReg, err := c.compileReadGlobalAddress(index) - if err != nil { - return err - } - - if isV128 { - resultReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileConstToRegister(arm64.ADD, globalInstanceValueOffset, globalAddressReg) - c.assembler.CompileMemoryToVectorRegister(arm64.VMOV, globalAddressReg, 0, - resultReg, arm64.VectorArrangementQ) - - c.pushVectorRuntimeValueLocationOnRegister(resultReg) - } else { - ldr := arm64.NOP - var result asm.Register - var vt runtimeValueType - switch wasmValueType { - case wasm.ValueTypeI32: - ldr = arm64.LDRW - vt = runtimeValueTypeI32 - result = globalAddressReg - case wasm.ValueTypeI64, wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - ldr = arm64.LDRD - vt = runtimeValueTypeI64 - result = globalAddressReg - case wasm.ValueTypeF32: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - ldr = arm64.FLDRS - vt = runtimeValueTypeF32 - case wasm.ValueTypeF64: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - ldr = arm64.FLDRD - vt = runtimeValueTypeF64 - } - - // "result = [globalAddressReg + globalInstanceValueOffset] (== globals[index].Val)" - c.assembler.CompileMemoryToRegister( - ldr, - globalAddressReg, globalInstanceValueOffset, - result, - ) - - c.pushRuntimeValueLocationOnRegister(result, vt) - } - return nil -} - -// compileGlobalSet implements compiler.compileGlobalSet for the arm64 architecture. -func (c *arm64Compiler) compileGlobalSet(o *wazeroir.UnionOperation) error { - index := uint32(o.U1) - - wasmValueType := c.ir.Globals[index].ValType - isV128 := wasmValueType == wasm.ValueTypeV128 - - var val *runtimeValueLocation - if isV128 { - val = c.locationStack.popV128() - } else { - val = c.locationStack.pop() - } - if err := c.compileEnsureOnRegister(val); err != nil { - return err - } - - globalInstanceAddressRegister, err := c.compileReadGlobalAddress(index) - if err != nil { - return err - } - - if isV128 { - c.assembler.CompileVectorRegisterToMemory(arm64.VMOV, - val.register, globalInstanceAddressRegister, globalInstanceValueOffset, - arm64.VectorArrangementQ) - } else { - var str asm.Instruction - switch c.ir.Globals[index].ValType { - case wasm.ValueTypeI32: - str = arm64.STRW - case wasm.ValueTypeI64, wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - str = arm64.STRD - case wasm.ValueTypeF32: - str = arm64.FSTRS - case wasm.ValueTypeF64: - str = arm64.FSTRD - } - - // At this point "globalInstanceAddressRegister = globals[index]". - // Therefore, this means "globals[index].Val = val.register" - c.assembler.CompileRegisterToMemory( - str, - val.register, - globalInstanceAddressRegister, globalInstanceValueOffset, - ) - } - - c.markRegisterUnused(val.register) - return nil -} - -// compileReadGlobalAddress adds instructions to store the absolute address of the global instance at globalIndex into a register -func (c *arm64Compiler) compileReadGlobalAddress(globalIndex uint32) (destinationRegister asm.Register, err error) { - // TODO: rethink about the type used in store `globals []*GlobalInstance`. - // If we use `[]GlobalInstance` instead, we could reduce one MOV instruction here. - - destinationRegister, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return - } - - // "destinationRegister = globalIndex * 8" - c.assembler.CompileConstToRegister( - // globalIndex is an index to []*GlobalInstance, therefore - // we have to multiply it by the size of *GlobalInstance == the pointer size == 8. - arm64.MOVD, int64(globalIndex)*8, destinationRegister, - ) - - // "arm64ReservedRegisterForTemporary = &globals[0]" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextGlobalElement0AddressOffset, - arm64ReservedRegisterForTemporary, - ) - - // "destinationRegister = [arm64ReservedRegisterForTemporary + destinationRegister] (== globals[globalIndex])". - c.assembler.CompileMemoryWithRegisterOffsetToRegister( - arm64.LDRD, - arm64ReservedRegisterForTemporary, destinationRegister, - destinationRegister, - ) - return -} - -// compileBr implements compiler.compileBr for the arm64 architecture. -func (c *arm64Compiler) compileBr(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - return c.compileBranchInto(wazeroir.Label(o.U1)) -} - -// compileBrIf implements compiler.compileBrIf for the arm64 architecture. -func (c *arm64Compiler) compileBrIf(o *wazeroir.UnionOperation) error { - cond := c.locationStack.pop() - - var conditionalBR asm.Node - if cond.onConditionalRegister() { - // If the cond is on a conditional register, it corresponds to one of "conditional codes" - // https://developer.arm.com/documentation/dui0801/a/Condition-Codes/Condition-code-suffixes - // Here we represent the conditional codes by using arm64.COND_** registers, and that means the - // conditional jump can be performed if we use arm64.B**. - // For example, if we have arm64.CondEQ on cond, that means we performed compileEq right before - // this compileBrIf and BrIf can be achieved by arm64.BCONDEQ. - var brInst asm.Instruction - switch cond.conditionalRegister { - case arm64.CondEQ: - brInst = arm64.BCONDEQ - case arm64.CondNE: - brInst = arm64.BCONDNE - case arm64.CondHS: - brInst = arm64.BCONDHS - case arm64.CondLO: - brInst = arm64.BCONDLO - case arm64.CondMI: - brInst = arm64.BCONDMI - case arm64.CondHI: - brInst = arm64.BCONDHI - case arm64.CondLS: - brInst = arm64.BCONDLS - case arm64.CondGE: - brInst = arm64.BCONDGE - case arm64.CondLT: - brInst = arm64.BCONDLT - case arm64.CondGT: - brInst = arm64.BCONDGT - case arm64.CondLE: - brInst = arm64.BCONDLE - default: - // BUG: This means that we use the cond.conditionalRegister somewhere in this file, - // but not covered in switch ^. That shouldn't happen. - return fmt.Errorf("unsupported condition for br_if: %v", cond.conditionalRegister) - } - conditionalBR = c.assembler.CompileJump(brInst) - } else { - // If the value is not on the conditional register, we compare the value with the zero register, - // and then do the conditional BR if the value doesn't equal zero. - if err := c.compileEnsureOnRegister(cond); err != nil { - return err - } - // Compare the value with zero register. Note that the value is ensured to be i32 by function validation phase, - // so we use CMPW (32-bit compare) here. - c.assembler.CompileTwoRegistersToNone(arm64.CMPW, cond.register, arm64.RegRZR) - - conditionalBR = c.assembler.CompileJump(arm64.BCONDNE) - - c.markRegisterUnused(cond.register) - } - - // Emit the code for branching into else branch. - elseTarget := wazeroir.Label(o.U2) - if err := c.compileBranchInto(elseTarget); err != nil { - return err - } - // We branch into here from the original conditional BR (conditionalBR). - c.assembler.SetJumpTargetOnNext(conditionalBR) - thenTarget := wazeroir.Label(o.U1) - if err := compileDropRange(c, o.U3); err != nil { - return err - } - return c.compileBranchInto(thenTarget) -} - -func (c *arm64Compiler) compileBranchInto(target wazeroir.Label) error { - if target.IsReturnTarget() { - return c.compileReturnFunction() - } else { - if c.ir.LabelCallers[target] > 1 { - // We can only re-use register state if when there's a single call-site. - // Release existing values on registers to the stack if there's multiple ones to have - // the consistent value location state at the beginning of label. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - } - // Set the initial stack of the target label, so we can start compiling the label - // with the appropriate value locations. Note we clone the stack here as we maybe - // manipulate the stack before compiler reaches the label. - targetLabel := c.label(target) - if !targetLabel.stackInitialized { - targetLabel.initialStack.cloneFrom(*c.locationStack) - targetLabel.stackInitialized = true - } - - br := c.assembler.CompileJump(arm64.B) - c.assignBranchTarget(target, br) - return nil - } -} - -// assignBranchTarget assigns the given label's initial instruction to the destination of br. -func (c *arm64Compiler) assignBranchTarget(label wazeroir.Label, br asm.Node) { - target := c.label(label) - - targetInst := target.initialInstruction - if targetInst == nil { - // If the label isn't compiled yet, allocate the NOP node, and set as the initial instruction. - targetInst = c.assembler.AllocateNOP() - target.initialInstruction = targetInst - } - - br.AssignJumpTarget(targetInst) -} - -// compileBrTable implements compiler.compileBrTable for the arm64 architecture. -func (c *arm64Compiler) compileBrTable(o *wazeroir.UnionOperation) error { - // If the operation only consists of the default target, we branch into it and return early. - if len(o.Us) == 2 { - loc := c.locationStack.pop() - if loc.onRegister() { - c.markRegisterUnused(loc.register) - } - if err := compileDropRange(c, o.Us[1]); err != nil { - return err - } - return c.compileBranchInto(wazeroir.Label(o.Us[0])) - } - - index := c.locationStack.pop() - if err := c.compileEnsureOnRegister(index); err != nil { - return err - } - - if isZeroRegister(index.register) { - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - index.setRegister(reg) - c.markRegisterUsed(reg) - - // Zero the value on a picked register. - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, reg) - } - - tmpReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Load the branch table's length. - // "tmpReg = len(o.Targets)" - c.assembler.CompileConstToRegister(arm64.MOVW, int64(len(o.Us)/2-1), tmpReg) - // Compare the length with offset. - c.assembler.CompileTwoRegistersToNone(arm64.CMPW, tmpReg, index.register) - // If the value exceeds the length, we will branch into the default target (corresponding to len(o.Targets) index). - brDefaultIndex := c.assembler.CompileJump(arm64.BCONDLO) - c.assembler.CompileRegisterToRegister(arm64.MOVW, tmpReg, index.register) - c.assembler.SetJumpTargetOnNext(brDefaultIndex) - - // We prepare the asm.StaticConst which holds the offset of - // each target's first instruction (incl. default) - // relative to the beginning of label tables. - // - // For example, if we have targets=[L0, L1] and default=L_DEFAULT, - // we emit the code like this at [Emit the code for each target and default branch] below. - // - // L0: - // 0x123001: XXXX, ... - // ..... - // L1: - // 0x123005: YYY, ... - // ..... - // L_DEFAULT: - // 0x123009: ZZZ, ... - // - // then offsetData becomes like [0x0, 0x5, 0x8]. - // By using this offset list, we could jump into the label for the index by - // "jmp offsetData[index]+0x123001" and "0x123001" can be acquired by ADR instruction. - // - // Note: We store each offset of 32-bit unsigned integer as 4 consecutive bytes. So more precisely, - // the above example's offsetData would be [0x0, 0x0, 0x0, 0x0, 0x5, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0]. - // - // Note: this is similar to how GCC implements Switch statements in C. - offsetData := asm.NewStaticConst(make([]byte, 4*(len(o.Us)/2))) - - // "tmpReg = &offsetData[0]" - c.assembler.CompileStaticConstToRegister(arm64.ADR, offsetData, tmpReg) - - // "index.register = tmpReg + (index.register << 2) (== &offsetData[offset])" - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, index.register, 2, tmpReg, index.register) - - // "index.register = *index.register (== offsetData[offset])" - c.assembler.CompileMemoryToRegister(arm64.LDRW, index.register, 0, index.register) - - // Now we read the address of the beginning of the jump table. - // In the above example, this corresponds to reading the address of 0x123001. - c.assembler.CompileReadInstructionAddress(tmpReg, arm64.B) - - // Now we have the address of L0 in tmp register, and the offset to the target label in the index.register. - // So we could achieve the br_table jump by adding them and jump into the resulting address. - c.assembler.CompileRegisterToRegister(arm64.ADD, tmpReg, index.register) - - c.assembler.CompileJumpToRegister(arm64.B, index.register) - - // We no longer need the index's register, so mark it unused. - c.markRegisterUnused(index.register) - - // [Emit the code for each targets and default branch] - labelInitialInstructions := make([]asm.Node, len(o.Us)/2) - - // Since we might end up having the different stack state in each branch, - // we need to save the initial stack state here, and use the same initial state - // for each iteration. - initialLocationStack := c.getSavedTemporaryLocationStack() - - for i := range labelInitialInstructions { - // Emit the initial instruction of each target where - // we use NOP as we don't yet know the next instruction in each label. - init := c.assembler.CompileStandAlone(arm64.NOP) - labelInitialInstructions[i] = init - - targetLabel := wazeroir.Label(o.Us[i*2]) - targetToDrop := o.Us[i*2+1] - if err = compileDropRange(c, targetToDrop); err != nil { - return err - } - if err = c.compileBranchInto(targetLabel); err != nil { - return err - } - // After the iteration, reset the stack's state with initialLocationStack. - c.locationStack.cloneFrom(initialLocationStack) - } - - c.assembler.BuildJumpTable(offsetData, labelInitialInstructions) - return nil -} - -func (c *arm64Compiler) getSavedTemporaryLocationStack() runtimeValueLocationStack { - initialLocationStack := *c.locationStack // Take copy! - // Use c.brTableTmp for the underlying stack so that we could reduce the allocations. - if diff := int(initialLocationStack.sp) - len(c.brTableTmp); diff > 0 { - c.brTableTmp = append(c.brTableTmp, make([]runtimeValueLocation, diff)...) - } - copy(c.brTableTmp, initialLocationStack.stack[:initialLocationStack.sp]) - initialLocationStack.stack = c.brTableTmp - return initialLocationStack -} - -// compileCall implements compiler.compileCall for the arm64 architecture. -func (c *arm64Compiler) compileCall(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - functionIndex := o.U1 - - tp := &c.ir.Types[c.ir.Functions[functionIndex]] - - targetFunctionAddressReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(targetFunctionAddressReg) - defer c.markRegisterUnused(targetFunctionAddressReg) - - // 3) Set rc.next to specify which function is executed on the current call frame. - // - // First, we read the address of the first item of ce.functions slice (= &ce.functions[0]) - // into tmp. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFunctionsElement0AddressOffset, - targetFunctionAddressReg) - - c.assembler.CompileConstToRegister( - arm64.ADD, - int64(functionIndex)*functionSize, // * 8 because the size of *function equals 8 bytes. - targetFunctionAddressReg) - - return c.compileCallImpl(targetFunctionAddressReg, tp) -} - -// compileCallImpl implements compiler.compileCall and compiler.compileCallIndirect for the arm64 architecture. -func (c *arm64Compiler) compileCallImpl(targetFunctionAddressRegister asm.Register, functype *wasm.FunctionType) error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - tmp, ok := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !ok { - panic("BUG: cannot take a free register") - } - - // The stack should look like: - // - // reserved slots for results (if len(results) > len(args)) - // | | - // ,arg0, ..., argN, ..., _, .returnAddress, .returnStackBasePointerInBytes, .function, .... - // | | | - // | callFrame{^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^} - // | - // nextStackBasePointerOffset - // - // where callFrame is used to return to this currently executed function. - - nextStackBasePointerOffset := int64(c.locationStack.sp) - int64(functype.ParamNumInUint64) - - callFrameReturnAddressLoc, callFrameStackBasePointerInBytesLoc, callFrameFunctionLoc := c.locationStack.pushCallFrame(functype) - - // Save the current stack base pointer at callFrameStackBasePointerInBytesLoc. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, - tmp) - callFrameStackBasePointerInBytesLoc.setRegister(tmp) - c.compileReleaseRegisterToStack(callFrameStackBasePointerInBytesLoc) - - // Set callEngine.stackContext.stackBasePointer for the next function. - c.assembler.CompileConstToRegister(arm64.ADD, nextStackBasePointerOffset<<3, tmp) - c.assembler.CompileRegisterToMemory(arm64.STRD, - tmp, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset) - - // Save the currently executed *function (placed at callEngine.moduleContext.fn) into callFrameFunctionLoc. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset, - tmp) - callFrameFunctionLoc.setRegister(tmp) - c.compileReleaseRegisterToStack(callFrameFunctionLoc) - - // Set callEngine.moduleContext.fn to the next *function. - c.assembler.CompileRegisterToMemory(arm64.STRD, - targetFunctionAddressRegister, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFnOffset) - - // Write the return address into callFrameReturnAddressLoc. - c.assembler.CompileReadInstructionAddress(tmp, arm64.B) - callFrameReturnAddressLoc.setRegister(tmp) - c.compileReleaseRegisterToStack(callFrameReturnAddressLoc) - - if targetFunctionAddressRegister == arm64CallingConventionModuleInstanceAddressRegister { - // This case we must move the value on targetFunctionAddressRegister to another register, otherwise - // the address (jump target below) will be modified and result in segfault. - // See #526. - c.assembler.CompileRegisterToRegister(arm64.MOVD, targetFunctionAddressRegister, tmp) - targetFunctionAddressRegister = tmp - } - - // Also, we have to put the code's moduleInstance address into arm64CallingConventionModuleInstanceAddressRegister. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - targetFunctionAddressRegister, functionModuleInstanceOffset, - arm64CallingConventionModuleInstanceAddressRegister, - ) - - // Then, br into the target function's initial address. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - targetFunctionAddressRegister, functionCodeInitialAddressOffset, - targetFunctionAddressRegister) - - c.assembler.CompileJumpToRegister(arm64.B, targetFunctionAddressRegister) - - // We consumed the function parameters, the call frame stack and reserved slots during the call. - c.locationStack.sp = uint64(nextStackBasePointerOffset) - - // Also, the function results were pushed by the call. - for _, t := range functype.Results { - loc := c.locationStack.pushRuntimeValueLocationOnStack() - switch t { - case wasm.ValueTypeI32: - loc.valueType = runtimeValueTypeI32 - case wasm.ValueTypeI64, wasm.ValueTypeFuncref, wasm.ValueTypeExternref: - loc.valueType = runtimeValueTypeI64 - case wasm.ValueTypeF32: - loc.valueType = runtimeValueTypeF32 - case wasm.ValueTypeF64: - loc.valueType = runtimeValueTypeF64 - case wasm.ValueTypeV128: - loc.valueType = runtimeValueTypeV128Lo - hi := c.locationStack.pushRuntimeValueLocationOnStack() - hi.valueType = runtimeValueTypeV128Hi - } - } - - if err := c.compileModuleContextInitialization(); err != nil { - return err - } - - // On the function return, we initialize the state for this function. - c.compileReservedStackBasePointerRegisterInitialization() - - c.compileReservedMemoryRegisterInitialization() - return nil -} - -// compileCallIndirect implements compiler.compileCallIndirect for the arm64 architecture. -func (c *arm64Compiler) compileCallIndirect(o *wazeroir.UnionOperation) (err error) { - offset := c.locationStack.pop() - if err = c.compileEnsureOnRegister(offset); err != nil { - return err - } - typeIndex := o.U1 - tableIndex := o.U2 - - offsetReg := offset.register - if isZeroRegister(offsetReg) { - offsetReg, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(offsetReg) - - // Zero the value on a picked register. - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, offsetReg) - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(tmp) - - tmp2, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(tmp2) - - // First, we need to check if the offset doesn't exceed the length of table. - // "tmp = &Tables[0]" - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - tmp, - ) - // tmp = [tmp + TableIndex*8] = [&Tables[0] + TableIndex*sizeOf(*tableInstance)] = Tables[tableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - tmp, int64(tableIndex)*8, - tmp, - ) - // tmp2 = [tmp + tableInstanceTableLenOffset] = len(Tables[tableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, tmp, tableInstanceTableLenOffset, tmp2) - - // "cmp tmp2, offset" - c.assembler.CompileTwoRegistersToNone(arm64.CMP, tmp2, offsetReg) - - // If it exceeds len(table), we trap. - c.compileMaybeExitFromNativeCode(arm64.BCONDLO, nativeCallStatusCodeInvalidTableAccess) - // Otherwise, we proceed to do function type check. - - // We need to obtain the absolute address of table element. - // "tmp = &Tables[tableIndex].table[0]" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - tmp, tableInstanceTableOffset, - tmp, - ) - // "offset = tmp + (offset << pointerSizeLog2) (== &table[offset])" - // Here we left shifting by 3 in order to get the offset in bytes, - // and the table element type is uintptr which is 8 bytes. - c.assembler.CompileLeftShiftedRegisterToRegister( - arm64.ADD, - offsetReg, pointerSizeLog2, - tmp, - offsetReg, - ) - - // "offset = (*offset) (== table[offset])" - c.assembler.CompileMemoryToRegister(arm64.LDRD, offsetReg, 0, offsetReg) - - // Check if the value of table[offset] equals zero, meaning that the target element is uninitialized. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, offsetReg) - - // Skipped if the target is initialized. - c.compileMaybeExitFromNativeCode(arm64.BCONDNE, nativeCallStatusCodeInvalidTableAccess) - - // next we check the type matches, i.e. table[offset].source.TypeID == targetFunctionType. - // "tmp = table[offset].typeID" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - offsetReg, functionTypeIDOffset, - tmp, - ) - // "tmp2 = ModuleInstance.TypeIDs[index]" - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTypeIDsElement0AddressOffset, - tmp2) - c.assembler.CompileMemoryToRegister(arm64.LDRW, tmp2, int64(typeIndex)*4, tmp2) - - // Compare these two values, and if they equal, we are ready to make function call. - c.assembler.CompileTwoRegistersToNone(arm64.CMPW, tmp, tmp2) - // Skipped if the type matches. - c.compileMaybeExitFromNativeCode(arm64.BCONDEQ, nativeCallStatusCodeTypeMismatchOnIndirectCall) - - targetFunctionType := &c.ir.Types[typeIndex] - if err := c.compileCallImpl(offsetReg, targetFunctionType); err != nil { - return err - } - - // The offset register should be marked as un-used as we consumed in the function call. - c.markRegisterUnused(offsetReg, tmp, tmp2) - return nil -} - -// compileDrop implements compiler.compileDrop for the arm64 architecture. -func (c *arm64Compiler) compileDrop(o *wazeroir.UnionOperation) error { - return compileDropRange(c, o.U1) -} - -func (c *arm64Compiler) compileSelectV128Impl(selectorRegister asm.Register) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileTwoRegistersToNone(arm64.CMPW, arm64.RegRZR, selectorRegister) - brIfNotZero := c.assembler.CompileJump(arm64.BCONDNE) - - // In this branch, we select the value of x2, so we move the value into x1.register so that - // we can have the result in x1.register regardless of the selection. - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VORR, - x2.register, x2.register, x1.register, arm64.VectorArrangement16B) - - c.assembler.SetJumpTargetOnNext(brIfNotZero) - - // As noted, the result exists in x1.register regardless of the selector. - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - // Plus, x2.register is no longer used. - c.markRegisterUnused(x2.register) - return nil -} - -// compileSelect implements compiler.compileSelect for the arm64 architecture. -func (c *arm64Compiler) compileSelect(o *wazeroir.UnionOperation) error { - cv, err := c.popValueOnRegister() - if err != nil { - return err - } - - isTargetVector := o.B3 - if isTargetVector { - return c.compileSelectV128Impl(cv.register) - } - - c.markRegisterUsed(cv.register) - - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) && isZeroRegister(x2.register) { - // If both values are zero, the result is always zero. - c.pushRuntimeValueLocationOnRegister(arm64.RegRZR, x1.valueType) - c.markRegisterUnused(cv.register) - return nil - } - - // In the following, we emit the code so that x1's register contains the chosen value - // no matter which of original x1 or x2 is selected. - // - // If x1 is currently on zero register, we cannot place the result because - // "MOV arm64.RegRZR x2.register" results in arm64.RegRZR regardless of the value. - // So we explicitly assign a general purpose register to x1 here. - if isZeroRegister(x1.register) { - // Mark x2 and cv's registers are used so they won't be chosen. - c.markRegisterUsed(x2.register) - // Pick the non-zero register for x1. - x1Reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - x1.setRegister(x1Reg) - // And zero our the picked register. - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, x1Reg) - } - - // At this point, x1 is non-zero register, and x2 is either general purpose or zero register. - - c.assembler.CompileTwoRegistersToNone(arm64.CMPW, arm64.RegRZR, cv.register) - brIfNotZero := c.assembler.CompileJump(arm64.BCONDNE) - - // If cv == 0, we move the value of x2 to the x1.register. - - switch x1.valueType { - case runtimeValueTypeI32: - // TODO: use 32-bit mov - c.assembler.CompileRegisterToRegister(arm64.MOVD, x2.register, x1.register) - case runtimeValueTypeI64: - c.assembler.CompileRegisterToRegister(arm64.MOVD, x2.register, x1.register) - case runtimeValueTypeF32: - // TODO: use 32-bit mov - c.assembler.CompileRegisterToRegister(arm64.FMOVD, x2.register, x1.register) - case runtimeValueTypeF64: - c.assembler.CompileRegisterToRegister(arm64.FMOVD, x2.register, x1.register) - default: - return errors.New("TODO: implement vector type select") - } - - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - - // Otherwise, nothing to do for select. - c.assembler.SetJumpTargetOnNext(brIfNotZero) - - // Only x1.register is reused. - c.markRegisterUnused(cv.register, x2.register) - return nil -} - -// compilePick implements compiler.compilePick for the arm64 architecture. -func (c *arm64Compiler) compilePick(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - depth := o.U1 - isTargetVector := o.B3 - - pickTarget := &c.locationStack.stack[c.locationStack.sp-1-uint64(depth)] - pickedRegister, err := c.allocateRegister(pickTarget.getRegisterType()) - if err != nil { - return err - } - - if pickTarget.onRegister() { // Copy the value to the pickedRegister. - switch pickTarget.valueType { - case runtimeValueTypeI32: - c.assembler.CompileRegisterToRegister(arm64.MOVW, pickTarget.register, pickedRegister) - case runtimeValueTypeI64: - c.assembler.CompileRegisterToRegister(arm64.MOVD, pickTarget.register, pickedRegister) - case runtimeValueTypeF32: - c.assembler.CompileRegisterToRegister(arm64.FMOVS, pickTarget.register, pickedRegister) - case runtimeValueTypeF64: - c.assembler.CompileRegisterToRegister(arm64.FMOVD, pickTarget.register, pickedRegister) - case runtimeValueTypeV128Lo: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VORR, - pickTarget.register, pickTarget.register, pickedRegister, arm64.VectorArrangement16B) - case runtimeValueTypeV128Hi: - panic("BUG") // since pick target must point to the lower 64-bits of vectors. - } - } else if pickTarget.onStack() { - // Temporarily assign a register to the pick target, and then load the value. - pickTarget.setRegister(pickedRegister) - c.compileLoadValueOnStackToRegister(pickTarget) - - // After the load, we revert the register assignment to the pick target. - pickTarget.setRegister(asm.NilRegister) - if isTargetVector { - hi := &c.locationStack.stack[pickTarget.stackPointer+1] - hi.setRegister(asm.NilRegister) - } - } - - // Now we have the value of the target on the pickedRegister, - // so push the location. - c.pushRuntimeValueLocationOnRegister(pickedRegister, pickTarget.valueType) - if isTargetVector { - c.pushRuntimeValueLocationOnRegister(pickedRegister, runtimeValueTypeV128Hi) - } - return nil -} - -// compileAdd implements compiler.compileAdd for the arm64 architecture. -func (c *arm64Compiler) compileAdd(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - // Addition can be nop if one of operands is zero. - if isZeroRegister(x1.register) { - c.pushRuntimeValueLocationOnRegister(x2.register, x1.valueType) - return nil - } else if isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst asm.Instruction - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - inst = arm64.ADDW - case wazeroir.UnsignedTypeI64: - inst = arm64.ADD - case wazeroir.UnsignedTypeF32: - inst = arm64.FADDS - case wazeroir.UnsignedTypeF64: - inst = arm64.FADDD - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - // The result is placed on a register for x1, so record it. - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileSub implements compiler.compileSub for the arm64 architecture. -func (c *arm64Compiler) compileSub(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - // If both of registers are zeros, this can be nop and push the zero register. - if isZeroRegister(x1.register) && isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(arm64.RegRZR, x1.valueType) - return nil - } - - // At this point, at least one of x1 or x2 registers is non zero. - // Choose the non-zero register as destination. - destinationReg := x1.register - if isZeroRegister(x1.register) { - destinationReg = x2.register - } - - var inst asm.Instruction - var vt runtimeValueType - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - inst = arm64.SUBW - vt = runtimeValueTypeI32 - case wazeroir.UnsignedTypeI64: - inst = arm64.SUB - vt = runtimeValueTypeI64 - case wazeroir.UnsignedTypeF32: - inst = arm64.FSUBS - vt = runtimeValueTypeF32 - case wazeroir.UnsignedTypeF64: - inst = arm64.FSUBD - vt = runtimeValueTypeF64 - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, destinationReg) - c.pushRuntimeValueLocationOnRegister(destinationReg, vt) - return nil -} - -// compileMul implements compiler.compileMul for the arm64 architecture. -func (c *arm64Compiler) compileMul(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - // Multiplication can be done by putting a zero register if one of operands is zero. - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(arm64.RegRZR, x1.valueType) - return nil - } - - var inst asm.Instruction - var vt runtimeValueType - unsignedType := wazeroir.UnsignedType(o.B1) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - inst = arm64.MULW - vt = runtimeValueTypeI32 - case wazeroir.UnsignedTypeI64: - inst = arm64.MUL - vt = runtimeValueTypeI64 - case wazeroir.UnsignedTypeF32: - inst = arm64.FMULS - vt = runtimeValueTypeF32 - case wazeroir.UnsignedTypeF64: - inst = arm64.FMULD - vt = runtimeValueTypeF64 - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - // The result is placed on a register for x1, so record it. - c.pushRuntimeValueLocationOnRegister(x1.register, vt) - return nil -} - -// compileClz implements compiler.compileClz for the arm64 architecture. -func (c *arm64Compiler) compileClz(o *wazeroir.UnionOperation) error { - v, err := c.popValueOnRegister() - if err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - if isZeroRegister(v.register) { - // If the target is zero register, the result is always 32 (or 64 for 64-bits), - // so we allocate a register and put the const on it. - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - var vt runtimeValueType - if unsignedInt == wazeroir.UnsignedInt32 { - vt = runtimeValueTypeI32 - c.assembler.CompileConstToRegister(arm64.MOVW, 32, reg) - } else { - vt = runtimeValueTypeI64 - c.assembler.CompileConstToRegister(arm64.MOVD, 64, reg) - } - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil - } - - reg := v.register - var vt runtimeValueType - if unsignedInt == wazeroir.UnsignedInt32 { - vt = runtimeValueTypeI32 - c.assembler.CompileRegisterToRegister(arm64.CLZW, reg, reg) - } else { - vt = runtimeValueTypeI64 - c.assembler.CompileRegisterToRegister(arm64.CLZ, reg, reg) - } - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil -} - -// compileCtz implements compiler.compileCtz for the arm64 architecture. -func (c *arm64Compiler) compileCtz(o *wazeroir.UnionOperation) error { - v, err := c.popValueOnRegister() - if err != nil { - return err - } - - unsignedInt := wazeroir.UnsignedInt(o.B1) - reg := v.register - if isZeroRegister(reg) { - // If the target is zero register, the result is always 32 (or 64 for 64-bits), - // so we allocate a register and put the const on it. - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - var vt runtimeValueType - if unsignedInt == wazeroir.UnsignedInt32 { - vt = runtimeValueTypeI32 - c.assembler.CompileConstToRegister(arm64.MOVW, 32, reg) - } else { - vt = runtimeValueTypeI64 - c.assembler.CompileConstToRegister(arm64.MOVD, 64, reg) - } - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil - } - - // Since arm64 doesn't have an instruction directly counting trailing zeros, - // we reverse the bits first, and then do CLZ, which is exactly the same as - // gcc implements __builtin_ctz for arm64. - var vt runtimeValueType - if unsignedInt == wazeroir.UnsignedInt32 { - vt = runtimeValueTypeI32 - c.assembler.CompileRegisterToRegister(arm64.RBITW, reg, reg) - c.assembler.CompileRegisterToRegister(arm64.CLZW, reg, reg) - } else { - vt = runtimeValueTypeI64 - c.assembler.CompileRegisterToRegister(arm64.RBIT, reg, reg) - c.assembler.CompileRegisterToRegister(arm64.CLZ, reg, reg) - } - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil -} - -// compilePopcnt implements compiler.compilePopcnt for the arm64 architecture. -func (c *arm64Compiler) compilePopcnt(o *wazeroir.UnionOperation) error { - v, err := c.popValueOnRegister() - if err != nil { - return err - } - - reg := v.register - if isZeroRegister(reg) { - c.pushRuntimeValueLocationOnRegister(reg, v.valueType) - return nil - } - - freg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // arm64 doesn't have an instruction for population count on scalar register, - // so we use the vector one (VCNT). - // This exactly what the official Go implements bits.OneCount. - // For example, "func () int { return bits.OneCount(10) }" is compiled as - // - // MOVD $10, R0 ;; Load 10. - // FMOVD R0, F0 - // VCNT V0.B8, V0.B8 - // UADDLV V0.B8, V0 - // - var movInst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - if unsignedInt == wazeroir.UnsignedInt32 { - movInst = arm64.FMOVS - } else { - movInst = arm64.FMOVD - } - c.assembler.CompileRegisterToRegister(movInst, reg, freg) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.VCNT, freg, freg, - arm64.VectorArrangement16B, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.UADDLV, freg, freg, arm64.VectorArrangement8B, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileRegisterToRegister(movInst, freg, reg) - - c.pushRuntimeValueLocationOnRegister(reg, v.valueType) - return nil -} - -// compileDiv implements compiler.compileDiv for the arm64 architecture. -func (c *arm64Compiler) compileDiv(o *wazeroir.UnionOperation) error { - dividend, divisor, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - signedType := wazeroir.SignedType(o.B1) - - // If the divisor is on the zero register, exit from the function deterministically. - if isZeroRegister(divisor.register) { - // Push any value so that the subsequent instruction can have a consistent location stack state. - v := c.locationStack.pushRuntimeValueLocationOnStack() - switch signedType { - case wazeroir.SignedTypeInt32, wazeroir.SignedTypeUint32: - v.valueType = runtimeValueTypeI32 - case wazeroir.SignedTypeUint64, wazeroir.SignedTypeInt64: - v.valueType = runtimeValueTypeI64 - } - c.compileExitFromNativeCode(nativeCallStatusIntegerDivisionByZero) - return nil - } - - var inst asm.Instruction - var vt runtimeValueType - switch signedType { - case wazeroir.SignedTypeUint32: - inst = arm64.UDIVW - if err := c.compileIntegerDivPrecheck(true, false, dividend.register, divisor.register); err != nil { - return err - } - vt = runtimeValueTypeI32 - case wazeroir.SignedTypeUint64: - if err := c.compileIntegerDivPrecheck(false, false, dividend.register, divisor.register); err != nil { - return err - } - inst = arm64.UDIV - vt = runtimeValueTypeI64 - case wazeroir.SignedTypeInt32: - if err := c.compileIntegerDivPrecheck(true, true, dividend.register, divisor.register); err != nil { - return err - } - inst = arm64.SDIVW - vt = runtimeValueTypeI32 - case wazeroir.SignedTypeInt64: - if err := c.compileIntegerDivPrecheck(false, true, dividend.register, divisor.register); err != nil { - return err - } - inst = arm64.SDIV - vt = runtimeValueTypeI64 - case wazeroir.SignedTypeFloat32: - inst = arm64.FDIVS - vt = runtimeValueTypeF32 - case wazeroir.SignedTypeFloat64: - inst = arm64.FDIVD - vt = runtimeValueTypeF64 - } - - c.assembler.CompileRegisterToRegister(inst, divisor.register, dividend.register) - - c.pushRuntimeValueLocationOnRegister(dividend.register, vt) - return nil -} - -// compileIntegerDivPrecheck adds instructions to check if the divisor and dividend are sound for division operation. -// First, this adds instructions to check if the divisor equals zero, and if so, exits the function. -// Plus, for signed divisions, check if the result might result in overflow or not. -func (c *arm64Compiler) compileIntegerDivPrecheck(is32Bit, isSigned bool, dividend, divisor asm.Register) error { - // We check the divisor value equals zero. - var cmpInst, movInst, loadInst asm.Instruction - var minValueOffsetInVM int64 - if is32Bit { - cmpInst = arm64.CMPW - movInst = arm64.MOVW - loadInst = arm64.LDRW - minValueOffsetInVM = arm64CallEngineArchContextMinimum32BitSignedIntOffset - } else { - cmpInst = arm64.CMP - movInst = arm64.MOVD - loadInst = arm64.LDRD - minValueOffsetInVM = arm64CallEngineArchContextMinimum64BitSignedIntOffset - } - c.assembler.CompileTwoRegistersToNone(cmpInst, arm64.RegRZR, divisor) - - // If it is zero, we exit with nativeCallStatusIntegerDivisionByZero. - c.compileMaybeExitFromNativeCode(arm64.BCONDNE, nativeCallStatusIntegerDivisionByZero) - // Otherwise, we proceed. - - // If the operation is a signed integer div, we have to do an additional check on overflow. - if isSigned { - // For signed division, we have to have branches for "math.MinInt{32,64} / -1" - // case which results in the overflow. - - // First, we compare the divisor with -1. - c.assembler.CompileConstToRegister(movInst, -1, arm64ReservedRegisterForTemporary) - c.assembler.CompileTwoRegistersToNone(cmpInst, arm64ReservedRegisterForTemporary, divisor) - - // If they not equal, we skip the following check. - brIfDivisorNonMinusOne := c.assembler.CompileJump(arm64.BCONDNE) - - // Otherwise, we further check if the dividend equals math.MinInt32 or MinInt64. - c.assembler.CompileMemoryToRegister( - loadInst, - arm64ReservedRegisterForCallEngine, minValueOffsetInVM, - arm64ReservedRegisterForTemporary, - ) - c.assembler.CompileTwoRegistersToNone(cmpInst, arm64ReservedRegisterForTemporary, dividend) - - // If they not equal, we are safe to execute the division. - // Otherwise, we raise overflow error. - c.compileMaybeExitFromNativeCode(arm64.BCONDNE, nativeCallStatusIntegerOverflow) - - c.assembler.SetJumpTargetOnNext(brIfDivisorNonMinusOne) - } - return nil -} - -// compileRem implements compiler.compileRem for the arm64 architecture. -func (c *arm64Compiler) compileRem(o *wazeroir.UnionOperation) error { - dividend, divisor, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - dividendReg := dividend.register - divisorReg := divisor.register - - // If the divisor is on the zero register, exit from the function deterministically. - if isZeroRegister(divisor.register) { - // Push any value so that the subsequent instruction can have a consistent location stack state. - v := c.locationStack.pushRuntimeValueLocationOnStack() - v.valueType = runtimeValueTypeI32 - c.compileExitFromNativeCode(nativeCallStatusIntegerDivisionByZero) - return nil - } - - var divInst, msubInst, cmpInst asm.Instruction - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedUint32: - divInst = arm64.UDIVW - msubInst = arm64.MSUBW - cmpInst = arm64.CMPW - case wazeroir.SignedUint64: - divInst = arm64.UDIV - msubInst = arm64.MSUB - cmpInst = arm64.CMP - case wazeroir.SignedInt32: - divInst = arm64.SDIVW - msubInst = arm64.MSUBW - cmpInst = arm64.CMPW - case wazeroir.SignedInt64: - divInst = arm64.SDIV - msubInst = arm64.MSUB - cmpInst = arm64.CMP - } - - // We check the divisor value equals zero. - c.assembler.CompileTwoRegistersToNone(cmpInst, arm64.RegRZR, divisorReg) - - // If it is zero, we exit with nativeCallStatusIntegerDivisionByZero. - c.compileMaybeExitFromNativeCode(arm64.BCONDNE, nativeCallStatusIntegerDivisionByZero) - // Otherwise, we proceed. - - // Temporarily mark them used to allocate a result register while keeping these values. - c.markRegisterUsed(dividend.register, divisor.register) - - resultReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // arm64 doesn't have an instruction for rem, we use calculate it by two instructions: UDIV (SDIV for signed) and MSUB. - // This exactly the same code that Clang emits. - // [input: x0=dividend, x1=divisor] - // >> UDIV x2, x0, x1 - // >> MSUB x3, x2, x1, x0 - // [result: x2=quotient, x3=remainder] - // - c.assembler.CompileTwoRegistersToRegister(divInst, divisorReg, dividendReg, resultReg) - // ResultReg = dividendReg - (divisorReg * resultReg) - c.assembler.CompileThreeRegistersToRegister(msubInst, divisorReg, dividendReg, resultReg, resultReg) - - c.markRegisterUnused(dividend.register, divisor.register) - c.pushRuntimeValueLocationOnRegister(resultReg, dividend.valueType) - return nil -} - -// compileAnd implements compiler.compileAnd for the arm64 architecture. -func (c *arm64Compiler) compileAnd(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - // If either of the registers x1 or x2 is zero, - // the result will always be zero. - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(arm64.RegRZR, x1.valueType) - return nil - } - - // At this point, at least one of x1 or x2 registers is non zero. - // Choose the non-zero register as destination. - destinationReg := x1.register - if isZeroRegister(x1.register) { - destinationReg = x2.register - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.ANDW - case wazeroir.UnsignedInt64: - inst = arm64.AND - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, destinationReg) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileOr implements compiler.compileOr for the arm64 architecture. -func (c *arm64Compiler) compileOr(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) { - c.pushRuntimeValueLocationOnRegister(x2.register, x2.valueType) - return nil - } - if isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.ORRW - case wazeroir.UnsignedInt64: - inst = arm64.ORR - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileXor implements compiler.compileXor for the arm64 architecture. -func (c *arm64Compiler) compileXor(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - // At this point, at least one of x1 or x2 registers is non zero. - // Choose the non-zero register as destination. - destinationReg := x1.register - if isZeroRegister(x1.register) { - destinationReg = x2.register - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.EORW - case wazeroir.UnsignedInt64: - inst = arm64.EOR - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, destinationReg) - c.pushRuntimeValueLocationOnRegister(destinationReg, x1.valueType) - return nil -} - -// compileShl implements compiler.compileShl for the arm64 architecture. -func (c *arm64Compiler) compileShl(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.LSLW - case wazeroir.UnsignedInt64: - inst = arm64.LSL - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileShr implements compiler.compileShr for the arm64 architecture. -func (c *arm64Compiler) compileShr(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst asm.Instruction - signedInt := wazeroir.SignedInt(o.B1) - switch signedInt { - case wazeroir.SignedInt32: - inst = arm64.ASRW - case wazeroir.SignedInt64: - inst = arm64.ASR - case wazeroir.SignedUint32: - inst = arm64.LSRW - case wazeroir.SignedUint64: - inst = arm64.LSR - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileRotl implements compiler.compileRotl for the arm64 architecture. -func (c *arm64Compiler) compileRotl(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst, neginst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.RORW - neginst = arm64.NEGW - case wazeroir.UnsignedInt64: - inst = arm64.ROR - neginst = arm64.NEG - } - - // Arm64 doesn't have rotate left instruction. - // The shift amount needs to be converted to a negative number, similar to assembly output of bits.RotateLeft. - c.assembler.CompileRegisterToRegister(neginst, x2.register, x2.register) - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileRotr implements compiler.compileRotr for the arm64 architecture. -func (c *arm64Compiler) compileRotr(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - if isZeroRegister(x1.register) || isZeroRegister(x2.register) { - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.RORW - case wazeroir.UnsignedInt64: - inst = arm64.ROR - } - - c.assembler.CompileTwoRegistersToRegister(inst, x2.register, x1.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileAbs implements compiler.compileAbs for the arm64 architecture. -func (c *arm64Compiler) compileAbs(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FABSS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FABSD, runtimeValueTypeF64) - } -} - -// compileNeg implements compiler.compileNeg for the arm64 architecture. -func (c *arm64Compiler) compileNeg(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FNEGS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FNEGD, runtimeValueTypeF64) - } -} - -// compileCeil implements compiler.compileCeil for the arm64 architecture. -func (c *arm64Compiler) compileCeil(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FRINTPS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FRINTPD, runtimeValueTypeF64) - } -} - -// compileFloor implements compiler.compileFloor for the arm64 architecture. -func (c *arm64Compiler) compileFloor(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FRINTMS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FRINTMD, runtimeValueTypeF64) - } -} - -// compileTrunc implements compiler.compileTrunc for the arm64 architecture. -func (c *arm64Compiler) compileTrunc(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FRINTZS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FRINTZD, runtimeValueTypeF64) - } -} - -// compileNearest implements compiler.compileNearest for the arm64 architecture. -func (c *arm64Compiler) compileNearest(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FRINTNS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FRINTND, runtimeValueTypeF64) - } -} - -// compileSqrt implements compiler.compileSqrt for the arm64 architecture. -func (c *arm64Compiler) compileSqrt(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleUnop(arm64.FSQRTS, runtimeValueTypeF32) - } else { - return c.compileSimpleUnop(arm64.FSQRTD, runtimeValueTypeF64) - } -} - -// compileMin implements compiler.compileMin for the arm64 architecture. -func (c *arm64Compiler) compileMin(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleFloatBinop(arm64.FMINS) - } else { - return c.compileSimpleFloatBinop(arm64.FMIND) - } -} - -// compileMax implements compiler.compileMax for the arm64 architecture. -func (c *arm64Compiler) compileMax(o *wazeroir.UnionOperation) error { - if wazeroir.Float(o.B1) == wazeroir.Float32 { - return c.compileSimpleFloatBinop(arm64.FMAXS) - } else { - return c.compileSimpleFloatBinop(arm64.FMAXD) - } -} - -func (c *arm64Compiler) compileSimpleFloatBinop(inst asm.Instruction) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileCopysign implements compiler.compileCopysign for the arm64 architecture. -func (c *arm64Compiler) compileCopysign(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var ldr asm.Instruction - var minValueOffsetInVM int64 - if wazeroir.Float(o.B1) == wazeroir.Float32 { - ldr = arm64.FLDRS - minValueOffsetInVM = arm64CallEngineArchContextMinimum32BitSignedIntOffset - } else { - ldr = arm64.FLDRD - minValueOffsetInVM = arm64CallEngineArchContextMinimum64BitSignedIntOffset - } - - c.markRegisterUsed(x1.register, x2.register) - freg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // This is exactly the same code emitted by GCC for "__builtin_copysign": - // - // mov x0, -9223372036854775808 - // fmov d2, x0 - // vbit v0.8b, v1.8b, v2.8b - // - // "mov freg, -9223372036854775808 (stored at ce.minimum64BitSignedInt)" - c.assembler.CompileMemoryToRegister( - ldr, - arm64ReservedRegisterForCallEngine, minValueOffsetInVM, - freg, - ) - - // VBIT inserts each bit from the first operand into the destination if the corresponding bit of the second operand is 1, - // otherwise it leaves the destination bit unchanged. - // See https://developer.arm.com/documentation/dui0801/g/Advanced-SIMD-Instructions--32-bit-/VBIT - // - // "vbit vreg.8b, x2vreg.8b, x1vreg.8b" == "inserting 64th bit of x2 into x1". - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VBIT, - freg, x2.register, x1.register, arm64.VectorArrangement16B) - - c.markRegisterUnused(x2.register) - c.pushRuntimeValueLocationOnRegister(x1.register, x1.valueType) - return nil -} - -// compileI32WrapFromI64 implements compiler.compileI32WrapFromI64 for the arm64 architecture. -func (c *arm64Compiler) compileI32WrapFromI64() error { - return c.compileSimpleUnop(arm64.MOVW, runtimeValueTypeI32) -} - -// compileITruncFromF implements compiler.compileITruncFromF for the arm64 architecture. -func (c *arm64Compiler) compileITruncFromF(o *wazeroir.UnionOperation) error { - // Clear the floating point status register (FPSR). - c.assembler.CompileRegisterToRegister(arm64.MSR, arm64.RegRZR, arm64.RegFPSR) - - var vt runtimeValueType - var convinst asm.Instruction - inputType := wazeroir.Float(o.B1) - outputType := wazeroir.SignedInt(o.B2) - nonTrapping := o.B3 - - is32bitFloat := inputType == wazeroir.Float32 - if is32bitFloat && outputType == wazeroir.SignedInt32 { - convinst = arm64.FCVTZSSW - vt = runtimeValueTypeI32 - } else if is32bitFloat && outputType == wazeroir.SignedInt64 { - convinst = arm64.FCVTZSS - vt = runtimeValueTypeI64 - } else if !is32bitFloat && outputType == wazeroir.SignedInt32 { - convinst = arm64.FCVTZSDW - vt = runtimeValueTypeI32 - } else if !is32bitFloat && outputType == wazeroir.SignedInt64 { - convinst = arm64.FCVTZSD - vt = runtimeValueTypeI64 - } else if is32bitFloat && outputType == wazeroir.SignedUint32 { - convinst = arm64.FCVTZUSW - vt = runtimeValueTypeI32 - } else if is32bitFloat && outputType == wazeroir.SignedUint64 { - convinst = arm64.FCVTZUS - vt = runtimeValueTypeI64 - } else if !is32bitFloat && outputType == wazeroir.SignedUint32 { - convinst = arm64.FCVTZUDW - vt = runtimeValueTypeI32 - } else if !is32bitFloat && outputType == wazeroir.SignedUint64 { - convinst = arm64.FCVTZUD - vt = runtimeValueTypeI64 - } - - source, err := c.popValueOnRegister() - if err != nil { - return err - } - sourceReg := source.register - - destinationReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(convinst, sourceReg, destinationReg) - c.pushRuntimeValueLocationOnRegister(destinationReg, vt) - - if !nonTrapping { - // Obtain the floating point status register value into the general purpose register, - // so that we can check if the conversion resulted in undefined behavior. - c.assembler.CompileRegisterToRegister(arm64.MRS, arm64.RegFPSR, arm64ReservedRegisterForTemporary) - // Check if the conversion was undefined by comparing the status with 1. - // See https://developer.arm.com/documentation/ddi0595/2020-12/AArch64-Registers/FPSR--Floating-point-Status-Register - c.assembler.CompileRegisterAndConstToNone(arm64.CMP, arm64ReservedRegisterForTemporary, 1) - - brOK := c.assembler.CompileJump(arm64.BCONDNE) - - // If so, exit the execution with errors depending on whether or not the source value is NaN. - var floatcmp asm.Instruction - if is32bitFloat { - floatcmp = arm64.FCMPS - } else { - floatcmp = arm64.FCMPD - } - c.assembler.CompileTwoRegistersToNone(floatcmp, sourceReg, sourceReg) - // VS flag is set if at least one of values for FCMP is NaN. - // https://developer.arm.com/documentation/dui0801/g/Condition-Codes/Comparison-of-condition-code-meanings-in-integer-and-floating-point-code - // If the source value is not NaN, the operation was overflow. - c.compileMaybeExitFromNativeCode(arm64.BCONDVS, nativeCallStatusIntegerOverflow) - - // Otherwise, the operation was invalid as this is trying to convert NaN to integer. - c.compileExitFromNativeCode(nativeCallStatusCodeInvalidFloatToIntConversion) - - // Otherwise, we branch into the next instruction. - c.assembler.SetJumpTargetOnNext(brOK) - } - return nil -} - -// compileFConvertFromI implements compiler.compileFConvertFromI for the arm64 architecture. -func (c *arm64Compiler) compileFConvertFromI(o *wazeroir.UnionOperation) error { - var convinst asm.Instruction - inputType := wazeroir.SignedInt(o.B1) - outputType := wazeroir.Float(o.B2) - - if outputType == wazeroir.Float32 && inputType == wazeroir.SignedInt32 { - convinst = arm64.SCVTFWS - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedInt64 { - convinst = arm64.SCVTFS - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedInt32 { - convinst = arm64.SCVTFWD - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedInt64 { - convinst = arm64.SCVTFD - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedUint32 { - convinst = arm64.UCVTFWS - } else if outputType == wazeroir.Float32 && inputType == wazeroir.SignedUint64 { - convinst = arm64.UCVTFS - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedUint32 { - convinst = arm64.UCVTFWD - } else if outputType == wazeroir.Float64 && inputType == wazeroir.SignedUint64 { - convinst = arm64.UCVTFD - } - - var vt runtimeValueType - if outputType == wazeroir.Float32 { - vt = runtimeValueTypeF32 - } else { - vt = runtimeValueTypeF64 - } - return c.compileSimpleConversion(convinst, registerTypeVector, vt) -} - -// compileF32DemoteFromF64 implements compiler.compileF32DemoteFromF64 for the arm64 architecture. -func (c *arm64Compiler) compileF32DemoteFromF64() error { - return c.compileSimpleUnop(arm64.FCVTDS, runtimeValueTypeF32) -} - -// compileF64PromoteFromF32 implements compiler.compileF64PromoteFromF32 for the arm64 architecture. -func (c *arm64Compiler) compileF64PromoteFromF32() error { - return c.compileSimpleUnop(arm64.FCVTSD, runtimeValueTypeF64) -} - -// compileI32ReinterpretFromF32 implements compiler.compileI32ReinterpretFromF32 for the arm64 architecture. -func (c *arm64Compiler) compileI32ReinterpretFromF32() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeI32 - return nil - } - return c.compileSimpleConversion(arm64.FMOVS, registerTypeGeneralPurpose, runtimeValueTypeI32) -} - -// compileI64ReinterpretFromF64 implements compiler.compileI64ReinterpretFromF64 for the arm64 architecture. -func (c *arm64Compiler) compileI64ReinterpretFromF64() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeI64 - return nil - } - return c.compileSimpleConversion(arm64.FMOVD, registerTypeGeneralPurpose, runtimeValueTypeI64) -} - -// compileF32ReinterpretFromI32 implements compiler.compileF32ReinterpretFromI32 for the arm64 architecture. -func (c *arm64Compiler) compileF32ReinterpretFromI32() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeF32 - return nil - } - return c.compileSimpleConversion(arm64.FMOVS, registerTypeVector, runtimeValueTypeF32) -} - -// compileF64ReinterpretFromI64 implements compiler.compileF64ReinterpretFromI64 for the arm64 architecture. -func (c *arm64Compiler) compileF64ReinterpretFromI64() error { - if peek := c.locationStack.peek(); peek.onStack() { - // If the value is on the stack, this is no-op as there is nothing to do for converting type. - peek.valueType = runtimeValueTypeF64 - return nil - } - return c.compileSimpleConversion(arm64.FMOVD, registerTypeVector, runtimeValueTypeF64) -} - -func (c *arm64Compiler) compileSimpleConversion(inst asm.Instruction, destinationRegType registerType, resultRuntimeValueType runtimeValueType) error { - source, err := c.popValueOnRegister() - if err != nil { - return err - } - - destinationReg, err := c.allocateRegister(destinationRegType) - if err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(inst, source.register, destinationReg) - c.pushRuntimeValueLocationOnRegister(destinationReg, resultRuntimeValueType) - return nil -} - -// compileExtend implements compiler.compileExtend for the arm64 architecture. -func (c *arm64Compiler) compileExtend(o *wazeroir.UnionOperation) error { - signed := o.B1 != 0 - if signed { - return c.compileSimpleUnop(arm64.SXTW, runtimeValueTypeI64) - } else { - return c.compileSimpleUnop(arm64.MOVW, runtimeValueTypeI64) - } -} - -// compileSignExtend32From8 implements compiler.compileSignExtend32From8 for the arm64 architecture. -func (c *arm64Compiler) compileSignExtend32From8() error { - return c.compileSimpleUnop(arm64.SXTBW, runtimeValueTypeI32) -} - -// compileSignExtend32From16 implements compiler.compileSignExtend32From16 for the arm64 architecture. -func (c *arm64Compiler) compileSignExtend32From16() error { - return c.compileSimpleUnop(arm64.SXTHW, runtimeValueTypeI32) -} - -// compileSignExtend64From8 implements compiler.compileSignExtend64From8 for the arm64 architecture. -func (c *arm64Compiler) compileSignExtend64From8() error { - return c.compileSimpleUnop(arm64.SXTB, runtimeValueTypeI64) -} - -// compileSignExtend64From16 implements compiler.compileSignExtend64From16 for the arm64 architecture. -func (c *arm64Compiler) compileSignExtend64From16() error { - return c.compileSimpleUnop(arm64.SXTH, runtimeValueTypeI64) -} - -// compileSignExtend64From32 implements compiler.compileSignExtend64From32 for the arm64 architecture. -func (c *arm64Compiler) compileSignExtend64From32() error { - return c.compileSimpleUnop(arm64.SXTW, runtimeValueTypeI64) -} - -func (c *arm64Compiler) compileSimpleUnop(inst asm.Instruction, resultRuntimeValueType runtimeValueType) error { - v, err := c.popValueOnRegister() - if err != nil { - return err - } - reg := v.register - c.assembler.CompileRegisterToRegister(inst, reg, reg) - c.pushRuntimeValueLocationOnRegister(reg, resultRuntimeValueType) - return nil -} - -// compileEq implements compiler.compileEq for the arm64 architecture. -func (c *arm64Compiler) compileEq(o *wazeroir.UnionOperation) error { - return c.emitEqOrNe(true, wazeroir.UnsignedType(o.B1)) -} - -// compileNe implements compiler.compileNe for the arm64 architecture. -func (c *arm64Compiler) compileNe(o *wazeroir.UnionOperation) error { - return c.emitEqOrNe(false, wazeroir.UnsignedType(o.B1)) -} - -// emitEqOrNe implements compiler.compileEq and compiler.compileNe for the arm64 architecture. -func (c *arm64Compiler) emitEqOrNe(isEq bool, unsignedType wazeroir.UnsignedType) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var inst asm.Instruction - switch unsignedType { - case wazeroir.UnsignedTypeI32: - inst = arm64.CMPW - case wazeroir.UnsignedTypeI64: - inst = arm64.CMP - case wazeroir.UnsignedTypeF32: - inst = arm64.FCMPS - case wazeroir.UnsignedTypeF64: - inst = arm64.FCMPD - } - - c.assembler.CompileTwoRegistersToNone(inst, x2.register, x1.register) - - // Push the comparison result as a conditional register value. - cond := arm64.CondNE - if isEq { - cond = arm64.CondEQ - } - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(cond) - return nil -} - -// compileEqz implements compiler.compileEqz for the arm64 architecture. -func (c *arm64Compiler) compileEqz(o *wazeroir.UnionOperation) error { - x1, err := c.popValueOnRegister() - if err != nil { - return err - } - - var inst asm.Instruction - unsignedInt := wazeroir.UnsignedInt(o.B1) - switch unsignedInt { - case wazeroir.UnsignedInt32: - inst = arm64.CMPW - case wazeroir.UnsignedInt64: - inst = arm64.CMP - } - - c.assembler.CompileTwoRegistersToNone(inst, arm64.RegRZR, x1.register) - - // Push the comparison result as a conditional register value. - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(arm64.CondEQ) - return nil -} - -// compileLt implements compiler.compileLt for the arm64 architecture. -func (c *arm64Compiler) compileLt(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var inst asm.Instruction - var conditionalRegister asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeUint32: - inst = arm64.CMPW - conditionalRegister = arm64.CondLO - case wazeroir.SignedTypeUint64: - inst = arm64.CMP - conditionalRegister = arm64.CondLO - case wazeroir.SignedTypeInt32: - inst = arm64.CMPW - conditionalRegister = arm64.CondLT - case wazeroir.SignedTypeInt64: - inst = arm64.CMP - conditionalRegister = arm64.CondLT - case wazeroir.SignedTypeFloat32: - inst = arm64.FCMPS - conditionalRegister = arm64.CondMI - case wazeroir.SignedTypeFloat64: - inst = arm64.FCMPD - conditionalRegister = arm64.CondMI - } - - c.assembler.CompileTwoRegistersToNone(inst, x2.register, x1.register) - - // Push the comparison result as a conditional register value. - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(conditionalRegister) - return nil -} - -// compileGt implements compiler.compileGt for the arm64 architecture. -func (c *arm64Compiler) compileGt(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var inst asm.Instruction - var conditionalRegister asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeUint32: - inst = arm64.CMPW - conditionalRegister = arm64.CondHI - case wazeroir.SignedTypeUint64: - inst = arm64.CMP - conditionalRegister = arm64.CondHI - case wazeroir.SignedTypeInt32: - inst = arm64.CMPW - conditionalRegister = arm64.CondGT - case wazeroir.SignedTypeInt64: - inst = arm64.CMP - conditionalRegister = arm64.CondGT - case wazeroir.SignedTypeFloat32: - inst = arm64.FCMPS - conditionalRegister = arm64.CondGT - case wazeroir.SignedTypeFloat64: - inst = arm64.FCMPD - conditionalRegister = arm64.CondGT - } - - c.assembler.CompileTwoRegistersToNone(inst, x2.register, x1.register) - - // Push the comparison result as a conditional register value. - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(conditionalRegister) - return nil -} - -// compileLe implements compiler.compileLe for the arm64 architecture. -func (c *arm64Compiler) compileLe(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var inst asm.Instruction - var conditionalRegister asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeUint32: - inst = arm64.CMPW - conditionalRegister = arm64.CondLS - case wazeroir.SignedTypeUint64: - inst = arm64.CMP - conditionalRegister = arm64.CondLS - case wazeroir.SignedTypeInt32: - inst = arm64.CMPW - conditionalRegister = arm64.CondLE - case wazeroir.SignedTypeInt64: - inst = arm64.CMP - conditionalRegister = arm64.CondLE - case wazeroir.SignedTypeFloat32: - inst = arm64.FCMPS - conditionalRegister = arm64.CondLS - case wazeroir.SignedTypeFloat64: - inst = arm64.FCMPD - conditionalRegister = arm64.CondLS - } - - c.assembler.CompileTwoRegistersToNone(inst, x2.register, x1.register) - - // Push the comparison result as a conditional register value. - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(conditionalRegister) - return nil -} - -// compileGe implements compiler.compileGe for the arm64 architecture. -func (c *arm64Compiler) compileGe(o *wazeroir.UnionOperation) error { - x1, x2, err := c.popTwoValuesOnRegisters() - if err != nil { - return err - } - - var inst asm.Instruction - var conditionalRegister asm.ConditionalRegisterState - signedType := wazeroir.SignedType(o.B1) - switch signedType { - case wazeroir.SignedTypeUint32: - inst = arm64.CMPW - conditionalRegister = arm64.CondHS - case wazeroir.SignedTypeUint64: - inst = arm64.CMP - conditionalRegister = arm64.CondHS - case wazeroir.SignedTypeInt32: - inst = arm64.CMPW - conditionalRegister = arm64.CondGE - case wazeroir.SignedTypeInt64: - inst = arm64.CMP - conditionalRegister = arm64.CondGE - case wazeroir.SignedTypeFloat32: - inst = arm64.FCMPS - conditionalRegister = arm64.CondGE - case wazeroir.SignedTypeFloat64: - inst = arm64.FCMPD - conditionalRegister = arm64.CondGE - } - - c.assembler.CompileTwoRegistersToNone(inst, x2.register, x1.register) - - // Push the comparison result as a conditional register value. - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(conditionalRegister) - return nil -} - -// compileLoad implements compiler.compileLoad for the arm64 architecture. -func (c *arm64Compiler) compileLoad(o *wazeroir.UnionOperation) error { - var ( - isFloat bool - loadInst asm.Instruction - targetSizeInBytes int64 - vt runtimeValueType - ) - - unsignedType := wazeroir.UnsignedType(o.B1) - offset := uint32(o.U2) - - switch unsignedType { - case wazeroir.UnsignedTypeI32: - loadInst = arm64.LDRW - targetSizeInBytes = 32 / 8 - vt = runtimeValueTypeI32 - case wazeroir.UnsignedTypeI64: - loadInst = arm64.LDRD - targetSizeInBytes = 64 / 8 - vt = runtimeValueTypeI64 - case wazeroir.UnsignedTypeF32: - loadInst = arm64.FLDRS - isFloat = true - targetSizeInBytes = 32 / 8 - vt = runtimeValueTypeF32 - case wazeroir.UnsignedTypeF64: - loadInst = arm64.FLDRD - isFloat = true - targetSizeInBytes = 64 / 8 - vt = runtimeValueTypeF64 - } - return c.compileLoadImpl(offset, loadInst, targetSizeInBytes, isFloat, vt) -} - -// compileLoad8 implements compiler.compileLoad8 for the arm64 architecture. -func (c *arm64Compiler) compileLoad8(o *wazeroir.UnionOperation) error { - var loadInst asm.Instruction - var vt runtimeValueType - - signedInt := wazeroir.SignedInt(o.B1) - offset := uint32(o.U2) - - switch signedInt { - case wazeroir.SignedInt32: - loadInst = arm64.LDRSBW - vt = runtimeValueTypeI32 - case wazeroir.SignedInt64: - loadInst = arm64.LDRSBD - vt = runtimeValueTypeI64 - case wazeroir.SignedUint32: - loadInst = arm64.LDRB - vt = runtimeValueTypeI32 - case wazeroir.SignedUint64: - loadInst = arm64.LDRB - vt = runtimeValueTypeI64 - } - return c.compileLoadImpl(offset, loadInst, 1, false, vt) -} - -// compileLoad16 implements compiler.compileLoad16 for the arm64 architecture. -func (c *arm64Compiler) compileLoad16(o *wazeroir.UnionOperation) error { - var loadInst asm.Instruction - var vt runtimeValueType - - signedInt := wazeroir.SignedInt(o.B1) - offset := uint32(o.U2) - - switch signedInt { - case wazeroir.SignedInt32: - loadInst = arm64.LDRSHW - vt = runtimeValueTypeI32 - case wazeroir.SignedInt64: - loadInst = arm64.LDRSHD - vt = runtimeValueTypeI64 - case wazeroir.SignedUint32: - loadInst = arm64.LDRH - vt = runtimeValueTypeI32 - case wazeroir.SignedUint64: - loadInst = arm64.LDRH - vt = runtimeValueTypeI64 - } - return c.compileLoadImpl(offset, loadInst, 16/8, false, vt) -} - -// compileLoad32 implements compiler.compileLoad32 for the arm64 architecture. -func (c *arm64Compiler) compileLoad32(o *wazeroir.UnionOperation) error { - var loadInst asm.Instruction - signed := o.B1 == 1 - offset := uint32(o.U2) - - if signed { - loadInst = arm64.LDRSW - } else { - loadInst = arm64.LDRW - } - return c.compileLoadImpl(offset, loadInst, 32/8, false, runtimeValueTypeI64) -} - -// compileLoadImpl implements compileLoadImpl* variants for arm64 architecture. -func (c *arm64Compiler) compileLoadImpl(offsetArg uint32, loadInst asm.Instruction, - targetSizeInBytes int64, isFloat bool, resultRuntimeValueType runtimeValueType, -) error { - offsetReg, err := c.compileMemoryAccessOffsetSetup(offsetArg, targetSizeInBytes) - if err != nil { - return err - } - - resultRegister := offsetReg - if isFloat { - resultRegister, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - } - - // "resultRegister = [arm64ReservedRegisterForMemory + offsetReg]" - // In other words, "resultRegister = memory.Buffer[offset: offset+targetSizeInBytes]" - c.assembler.CompileMemoryWithRegisterOffsetToRegister( - loadInst, - arm64ReservedRegisterForMemory, offsetReg, - resultRegister, - ) - - c.pushRuntimeValueLocationOnRegister(resultRegister, resultRuntimeValueType) - return nil -} - -// compileStore implements compiler.compileStore for the arm64 architecture. -func (c *arm64Compiler) compileStore(o *wazeroir.UnionOperation) error { - var movInst asm.Instruction - var targetSizeInBytes int64 - unsignedType := wazeroir.UnsignedType(o.B1) - offset := uint32(o.U2) - switch unsignedType { - case wazeroir.UnsignedTypeI32: - movInst = arm64.STRW - targetSizeInBytes = 32 / 8 - case wazeroir.UnsignedTypeI64: - movInst = arm64.STRD - targetSizeInBytes = 64 / 8 - case wazeroir.UnsignedTypeF32: - movInst = arm64.FSTRS - targetSizeInBytes = 32 / 8 - case wazeroir.UnsignedTypeF64: - movInst = arm64.FSTRD - targetSizeInBytes = 64 / 8 - } - return c.compileStoreImpl(offset, movInst, targetSizeInBytes) -} - -// compileStore8 implements compiler.compileStore8 for the arm64 architecture. -func (c *arm64Compiler) compileStore8(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), arm64.STRB, 1) -} - -// compileStore16 implements compiler.compileStore16 for the arm64 architecture. -func (c *arm64Compiler) compileStore16(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), arm64.STRH, 16/8) -} - -// compileStore32 implements compiler.compileStore32 for the arm64 architecture. -func (c *arm64Compiler) compileStore32(o *wazeroir.UnionOperation) error { - return c.compileStoreImpl(uint32(o.U2), arm64.STRW, 32/8) -} - -// compileStoreImpl implements compleStore* variants for arm64 architecture. -func (c *arm64Compiler) compileStoreImpl(offsetArg uint32, storeInst asm.Instruction, targetSizeInBytes int64) error { - val, err := c.popValueOnRegister() - if err != nil { - return err - } - // Mark temporarily used as compileMemoryAccessOffsetSetup might try allocating register. - c.markRegisterUsed(val.register) - - offsetReg, err := c.compileMemoryAccessOffsetSetup(offsetArg, targetSizeInBytes) - if err != nil { - return err - } - - // "[arm64ReservedRegisterForMemory + offsetReg] = val.register" - // In other words, "memory.Buffer[offset: offset+targetSizeInBytes] = val.register" - c.assembler.CompileRegisterToMemoryWithRegisterOffset( - storeInst, val.register, - arm64ReservedRegisterForMemory, offsetReg, - ) - - c.markRegisterUnused(val.register) - return nil -} - -// compileMemoryAccessOffsetSetup pops the top value from the stack (called "base"), stores "base + offsetArg" -// into a register, and returns the stored register. We call the result "offset" because we access the memory -// as memory.Buffer[offset: offset+targetSizeInBytes]. -// -// Note: this also emits the instructions to check the out of bounds memory access. -// In other words, if the offset+targetSizeInBytes exceeds the memory size, the code exits with nativeCallStatusCodeMemoryOutOfBounds status. -func (c *arm64Compiler) compileMemoryAccessOffsetSetup(offsetArg uint32, targetSizeInBytes int64) (offsetRegister asm.Register, err error) { - base, err := c.popValueOnRegister() - if err != nil { - return 0, err - } - - offsetRegister = base.register - if isZeroRegister(base.register) { - offsetRegister, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, offsetRegister) - } - - if offsetConst := int64(offsetArg) + targetSizeInBytes; offsetConst <= math.MaxUint32 { - // "offsetRegister = base + offsetArg + targetSizeInBytes" - c.assembler.CompileConstToRegister(arm64.ADD, offsetConst, offsetRegister) - } else { - // If the offset const is too large, we exit with nativeCallStatusCodeMemoryOutOfBounds. - c.compileExitFromNativeCode(nativeCallStatusCodeMemoryOutOfBounds) - return - } - - // "arm64ReservedRegisterForTemporary = len(memory.Buffer)" - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - arm64ReservedRegisterForTemporary) - - // Check if offsetRegister(= base+offsetArg+targetSizeInBytes) > len(memory.Buffer). - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, offsetRegister) - - // If offsetRegister(= base+offsetArg+targetSizeInBytes) exceeds the memory length, - // we exit the function with nativeCallStatusCodeMemoryOutOfBounds. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, nativeCallStatusCodeMemoryOutOfBounds) - - // Otherwise, we subtract targetSizeInBytes from offsetRegister. - c.assembler.CompileConstToRegister(arm64.SUB, targetSizeInBytes, offsetRegister) - return offsetRegister, nil -} - -// compileMemoryGrow implements compileMemoryGrow variants for arm64 architecture. -func (c *arm64Compiler) compileMemoryGrow() error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexMemoryGrow); err != nil { - return err - } - - // After return, we re-initialize reserved registers just like preamble of functions. - c.compileReservedStackBasePointerRegisterInitialization() - c.compileReservedMemoryRegisterInitialization() - return nil -} - -// compileMemorySize implements compileMemorySize variants for arm64 architecture. -func (c *arm64Compiler) compileMemorySize() error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // "reg = len(memory.Buffer)" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - reg, - ) - - // memory.size loads the page size of memory, so we have to divide by the page size. - // "reg = reg >> wasm.MemoryPageSizeInBits (== reg / wasm.MemoryPageSize) " - c.assembler.CompileConstToRegister( - arm64.LSR, - wasm.MemoryPageSizeInBits, - reg, - ) - - c.pushRuntimeValueLocationOnRegister(reg, runtimeValueTypeI32) - return nil -} - -// compileCallGoFunction adds instructions to call a Go function whose address equals the addr parameter. -// compilerStatus is set before making call, and it should be either nativeCallStatusCodeCallBuiltInFunction or -// nativeCallStatusCodeCallGoHostFunction. -func (c *arm64Compiler) compileCallGoFunction(compilerStatus nativeCallStatusCode, builtinFunction wasm.Index) error { - // Release all the registers as our calling convention requires the caller-save. - if err := c.compileReleaseAllRegistersToStack(); err != nil { - return err - } - - if compilerStatus == nativeCallStatusCodeCallBuiltInFunction { - // Set the target function address to ce.functionCallAddress - // "tmp = $index" - c.assembler.CompileConstToRegister( - arm64.MOVD, - int64(builtinFunction), - arm64ReservedRegisterForTemporary, - ) - // "[arm64ReservedRegisterForCallEngine + callEngineExitContextFunctionCallAddressOffset] = tmp" - // In other words, "ce.functionCallAddress = tmp (== $addr)" - c.assembler.CompileRegisterToMemory( - arm64.STRW, - arm64ReservedRegisterForTemporary, - arm64ReservedRegisterForCallEngine, callEngineExitContextBuiltinFunctionCallIndexOffset, - ) - } - - c.compileExitFromNativeCode(compilerStatus) - return nil -} - -// compileConstI32 implements compiler.compileConstI32 for the arm64 architecture. -func (c *arm64Compiler) compileConstI32(o *wazeroir.UnionOperation) error { - return c.compileIntConstant(true, o.U1) -} - -// compileConstI64 implements compiler.compileConstI64 for the arm64 architecture. -func (c *arm64Compiler) compileConstI64(o *wazeroir.UnionOperation) error { - return c.compileIntConstant(false, o.U1) -} - -// compileIntConstant adds instructions to load an integer constant. -// is32bit is true if the target value is originally 32-bit const, false otherwise. -// value holds the (zero-extended for 32-bit case) load target constant. -func (c *arm64Compiler) compileIntConstant(is32bit bool, value uint64) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - var inst asm.Instruction - var vt runtimeValueType - if is32bit { - inst = arm64.MOVW - vt = runtimeValueTypeI32 - } else { - inst = arm64.MOVD - vt = runtimeValueTypeI64 - } - - if value == 0 { - c.pushRuntimeValueLocationOnRegister(arm64.RegRZR, vt) - } else { - // Take a register to load the value. - reg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - c.assembler.CompileConstToRegister(inst, int64(value), reg) - - c.pushRuntimeValueLocationOnRegister(reg, vt) - } - return nil -} - -// compileConstF32 implements compiler.compileConstF32 for the arm64 architecture. -func (c *arm64Compiler) compileConstF32(o *wazeroir.UnionOperation) error { - return c.compileFloatConstant(true, o.U1 /*uint64(math.Float32bits(o.Value))*/) -} - -// compileConstF64 implements compiler.compileConstF64 for the arm64 architecture. -func (c *arm64Compiler) compileConstF64(o *wazeroir.UnionOperation) error { - return c.compileFloatConstant(false, o.U1 /*math.Float64bits(o.Value)*/) -} - -// compileFloatConstant adds instructions to load a float constant. -// is32bit is true if the target value is originally 32-bit const, false otherwise. -// value holds the (zero-extended for 32-bit case) bit representation of load target float constant. -func (c *arm64Compiler) compileFloatConstant(is32bit bool, value uint64) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - // Take a register to load the value. - reg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - tmpReg := arm64.RegRZR - if value != 0 { - tmpReg = arm64ReservedRegisterForTemporary - var inst asm.Instruction - if is32bit { - inst = arm64.MOVW - } else { - inst = arm64.MOVD - } - c.assembler.CompileConstToRegister(inst, int64(value), tmpReg) - } - - // Use FMOV instruction to move the value on integer register into the float one. - var inst asm.Instruction - var vt runtimeValueType - if is32bit { - vt = runtimeValueTypeF32 - inst = arm64.FMOVS - } else { - vt = runtimeValueTypeF64 - inst = arm64.FMOVD - } - c.assembler.CompileRegisterToRegister(inst, tmpReg, reg) - - c.pushRuntimeValueLocationOnRegister(reg, vt) - return nil -} - -// compileMemoryInit implements compiler.compileMemoryInit for the arm64 architecture. -func (c *arm64Compiler) compileMemoryInit(o *wazeroir.UnionOperation) error { - dataIndex := uint32(o.U1) - return c.compileInitImpl(false, dataIndex, 0) -} - -// compileInitImpl implements compileTableInit and compileMemoryInit. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *arm64Compiler) compileInitImpl(isTable bool, index, tableIndex uint32) error { - outOfBoundsErrorStatus := nativeCallStatusCodeMemoryOutOfBounds - if isTable { - outOfBoundsErrorStatus = nativeCallStatusCodeInvalidTableAccess - } - - copySize, err := c.popValueOnRegister() - if err != nil { - return err - } - c.markRegisterUsed(copySize.register) - - sourceOffset, err := c.popValueOnRegister() - if err != nil { - return err - } - if isZeroRegister(sourceOffset.register) { - sourceOffset.register, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, sourceOffset.register) - } - c.markRegisterUsed(sourceOffset.register) - - destinationOffset, err := c.popValueOnRegister() - if err != nil { - return err - } - if isZeroRegister(destinationOffset.register) { - destinationOffset.register, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, destinationOffset.register) - } - c.markRegisterUsed(destinationOffset.register) - - tableInstanceAddressReg := asm.NilRegister - if isTable { - tableInstanceAddressReg, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(tableInstanceAddressReg) - } - - if !isZeroRegister(copySize.register) { - // sourceOffset += size. - c.assembler.CompileRegisterToRegister(arm64.ADD, copySize.register, sourceOffset.register) - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(arm64.ADD, copySize.register, destinationOffset.register) - } - - instanceAddr, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - if isTable { - c.compileLoadElemInstanceAddress(index, instanceAddr) - } else { - c.compileLoadDataInstanceAddress(index, instanceAddr) - } - - // Check data instance bounds. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - instanceAddr, 8, // DataInstance and Element instance holds the length is stored at offset 8. - arm64ReservedRegisterForTemporary) - - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, sourceOffset.register) - // If not, raise out of bounds memory access error. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, outOfBoundsErrorStatus) - - // Otherwise, ready to copy the value from destination to source. - // Check destination bounds. - if isTable { - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // tableInstanceAddressReg = arm64ReservedRegisterForTemporary + tableIndex*8 - // = &tables[0] + sizeOf(*tableInstance)*8 - // = &tables[tableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(tableIndex)*8, - tableInstanceAddressReg) - // arm64ReservedRegisterForTemporary = [tableInstanceAddressReg+tableInstanceTableLenOffset] = len(tables[tableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - tableInstanceAddressReg, tableInstanceTableLenOffset, - arm64ReservedRegisterForTemporary) - } else { - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - arm64ReservedRegisterForTemporary) - } - - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, destinationOffset.register) - // If not, raise out of bounds memory access error. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, outOfBoundsErrorStatus) - - // Otherwise, ready to copy the value from source to destination. - if !isZeroRegister(copySize.register) { - // If the size equals zero, we can skip the entire instructions beflow. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, copySize.register) - skipCopyJump := c.assembler.CompileJump(arm64.BCONDEQ) - - var ldr, str asm.Instruction - var movSize int64 - if isTable { - ldr, str = arm64.LDRD, arm64.STRD - movSize = 8 - - // arm64ReservedRegisterForTemporary = &Table[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, tableInstanceAddressReg, - tableInstanceTableOffset, arm64ReservedRegisterForTemporary) - // destinationOffset = (destinationOffset<< pointerSizeLog2) + arm64ReservedRegisterForTemporary - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - destinationOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, destinationOffset.register) - - // arm64ReservedRegisterForTemporary = &ElementInstance.References[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, instanceAddr, 0, arm64ReservedRegisterForTemporary) - // sourceOffset = (sourceOffset<< pointerSizeLog2) + arm64ReservedRegisterForTemporary - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - sourceOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, sourceOffset.register) - - // copySize = copySize << pointerSizeLog2 - c.assembler.CompileConstToRegister(arm64.LSL, pointerSizeLog2, copySize.register) - } else { - ldr, str = arm64.LDRB, arm64.STRB - movSize = 1 - - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, destinationOffset.register) - - // sourceOffset += data buffer's absolute address. - c.assembler.CompileMemoryToRegister(arm64.LDRD, instanceAddr, 0, arm64ReservedRegisterForTemporary) - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForTemporary, sourceOffset.register) - - } - - // Negate the counter. - c.assembler.CompileRegisterToRegister(arm64.NEG, copySize.register, copySize.register) - - beginCopyLoop := c.assembler.CompileStandAlone(arm64.NOP) - - // arm64ReservedRegisterForTemporary = [sourceOffset + (size.register)] - c.assembler.CompileMemoryWithRegisterOffsetToRegister(ldr, - sourceOffset.register, copySize.register, - arm64ReservedRegisterForTemporary) - // [destinationOffset + (size.register)] = arm64ReservedRegisterForTemporary. - c.assembler.CompileRegisterToMemoryWithRegisterOffset(str, - arm64ReservedRegisterForTemporary, - destinationOffset.register, copySize.register, - ) - - // Decrement the size counter and if the value is still negative, continue the loop. - c.assembler.CompileConstToRegister(arm64.ADDS, movSize, copySize.register) - c.assembler.CompileJump(arm64.BCONDMI).AssignJumpTarget(beginCopyLoop) - - c.assembler.SetJumpTargetOnNext(skipCopyJump) - } - - c.markRegisterUnused(copySize.register, sourceOffset.register, - destinationOffset.register, instanceAddr, tableInstanceAddressReg) - return nil -} - -// compileDataDrop implements compiler.compileDataDrop for the arm64 architecture. -func (c *arm64Compiler) compileDataDrop(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - dataIndex := uint32(o.U1) - c.compileLoadDataInstanceAddress(dataIndex, tmp) - - // Clears the content of DataInstance[o.DataIndex] (== []byte type). - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 0) - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 8) - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 16) - return nil -} - -func (c *arm64Compiler) compileLoadDataInstanceAddress(dataIndex uint32, dst asm.Register) { - // dst = dataIndex * dataInstanceStructSize - c.assembler.CompileConstToRegister(arm64.MOVD, int64(dataIndex)*dataInstanceStructSize, dst) - - // arm64ReservedRegisterForTemporary = &moduleInstance.DataInstances[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextDataInstancesElement0AddressOffset, - arm64ReservedRegisterForTemporary, - ) - - // dst = arm64ReservedRegisterForTemporary + dst - // = &moduleInstance.DataInstances[0] + dataIndex*dataInstanceStructSize - // = &moduleInstance.DataInstances[dataIndex] - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForTemporary, dst) -} - -// compileMemoryCopy implements compiler.compileMemoryCopy for the arm64 architecture. -func (c *arm64Compiler) compileMemoryCopy() error { - return c.compileCopyImpl(false, 0, 0) -} - -// compileCopyImpl implements compileTableCopy and compileMemoryCopy. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *arm64Compiler) compileCopyImpl(isTable bool, srcTableIndex, dstTableIndex uint32) error { - outOfBoundsErrorStatus := nativeCallStatusCodeMemoryOutOfBounds - if isTable { - outOfBoundsErrorStatus = nativeCallStatusCodeInvalidTableAccess - } - - copySize, err := c.popValueOnRegister() - if err != nil { - return err - } - c.markRegisterUsed(copySize.register) - - sourceOffset, err := c.popValueOnRegister() - if err != nil { - return err - } - if isZeroRegister(sourceOffset.register) { - sourceOffset.register, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, sourceOffset.register) - } - c.markRegisterUsed(sourceOffset.register) - - destinationOffset, err := c.popValueOnRegister() - if err != nil { - return err - } - if isZeroRegister(destinationOffset.register) { - destinationOffset.register, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, destinationOffset.register) - } - c.markRegisterUsed(destinationOffset.register) - - if !isZeroRegister(copySize.register) { - // sourceOffset += size. - c.assembler.CompileRegisterToRegister(arm64.ADD, copySize.register, sourceOffset.register) - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(arm64.ADD, copySize.register, destinationOffset.register) - } - - if isTable { - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = arm64ReservedRegisterForTemporary + srcTableIndex*8 - // = &tables[0] + sizeOf(*tableInstance)*8 - // = &tables[srcTableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(srcTableIndex)*8, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForTemporary+tableInstanceTableLenOffset] = len(tables[srcTableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - arm64ReservedRegisterForTemporary) - } else { - // arm64ReservedRegisterForTemporary = len(memoryInst.Buffer). - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - arm64ReservedRegisterForTemporary) - } - - // Check memory len >= sourceOffset. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, sourceOffset.register) - // If not, raise out of bounds memory access error. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, outOfBoundsErrorStatus) - - // Otherwise, check memory len >= destinationOffset. - if isTable { - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = arm64ReservedRegisterForTemporary + dstTableIndex*8 - // = &tables[0] + sizeOf(*tableInstance)*8 - // = &tables[dstTableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(dstTableIndex)*8, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForTemporary+tableInstanceTableLenOffset] = len(tables[dstTableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - arm64ReservedRegisterForTemporary) - } - - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, destinationOffset.register) - // If not, raise out of bounds memory access error. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, outOfBoundsErrorStatus) - - // Otherwise, ready to copy the value from source to destination. - var ldr, str asm.Instruction - var movSize int64 - if isTable { - ldr, str = arm64.LDRD, arm64.STRD - movSize = 8 - } else { - ldr, str = arm64.LDRB, arm64.STRB - movSize = 1 - } - - // If the size equals zero, we can skip the entire instructions beflow. - if !isZeroRegister(copySize.register) { - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, copySize.register) - skipCopyJump := c.assembler.CompileJump(arm64.BCONDEQ) - - // If source offet < destination offset: for (i = size-1; i >= 0; i--) dst[i] = src[i]; - c.assembler.CompileTwoRegistersToNone(arm64.CMP, sourceOffset.register, destinationOffset.register) - destLowerThanSourceJump := c.assembler.CompileJump(arm64.BCONDLS) - var endJump asm.Node - { - // sourceOffset -= size. - c.assembler.CompileRegisterToRegister(arm64.SUB, copySize.register, sourceOffset.register) - // destinationOffset -= size. - c.assembler.CompileRegisterToRegister(arm64.SUB, copySize.register, destinationOffset.register) - - if isTable { - // arm64ReservedRegisterForTemporary = &Tables[dstTableIndex].Table[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, - callEngineModuleContextTablesElement0AddressOffset, arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(dstTableIndex)*8, - arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - arm64ReservedRegisterForTemporary) - // destinationOffset = (destinationOffset<< pointerSizeLog2) + &Table[dstTableIndex].Table[0] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - destinationOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, destinationOffset.register) - - // arm64ReservedRegisterForTemporary = &Tables[srcTableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, - callEngineModuleContextTablesElement0AddressOffset, arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(srcTableIndex)*8, - arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - arm64ReservedRegisterForTemporary) - // sourceOffset = (sourceOffset<< 3) + &Table[0] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - sourceOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, sourceOffset.register) - - // copySize = copySize << pointerSizeLog2 as each element has 8 bytes and we copy one by one. - c.assembler.CompileConstToRegister(arm64.LSL, pointerSizeLog2, copySize.register) - } else { - // sourceOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, sourceOffset.register) - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, destinationOffset.register) - } - - beginCopyLoop := c.assembler.CompileStandAlone(arm64.NOP) - - // size -= 1 - c.assembler.CompileConstToRegister(arm64.SUBS, movSize, copySize.register) - - // arm64ReservedRegisterForTemporary = [sourceOffset + (size.register)] - c.assembler.CompileMemoryWithRegisterOffsetToRegister(ldr, - sourceOffset.register, copySize.register, - arm64ReservedRegisterForTemporary) - // [destinationOffset + (size.register)] = arm64ReservedRegisterForTemporary. - c.assembler.CompileRegisterToMemoryWithRegisterOffset(str, - arm64ReservedRegisterForTemporary, - destinationOffset.register, copySize.register, - ) - - // If the value on the copySize.register is not equal zero, continue the loop. - c.assembler.CompileJump(arm64.BCONDNE).AssignJumpTarget(beginCopyLoop) - - // Otherwise, exit the loop. - endJump = c.assembler.CompileJump(arm64.B) - } - - // Else (destination offet < source offset): for (i = 0; i < size; i++) dst[counter-1-i] = src[counter-1-i]; - c.assembler.SetJumpTargetOnNext(destLowerThanSourceJump) - { - - if isTable { - // arm64ReservedRegisterForTemporary = &Tables[dstTableIndex].Table[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, - callEngineModuleContextTablesElement0AddressOffset, arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(dstTableIndex)*8, - arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - arm64ReservedRegisterForTemporary) - // destinationOffset = (destinationOffset<< interfaceDataySizeLog2) + &Table[dstTableIndex].Table[0] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - destinationOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, destinationOffset.register) - - // arm64ReservedRegisterForTemporary = &Tables[srcTableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, - callEngineModuleContextTablesElement0AddressOffset, arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(srcTableIndex)*8, - arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - arm64ReservedRegisterForTemporary) - // sourceOffset = (sourceOffset<< 3) + &Table[0] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - sourceOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, sourceOffset.register) - - // copySize = copySize << pointerSizeLog2 as each element has 8 bytes and we copy one by one. - c.assembler.CompileConstToRegister(arm64.LSL, pointerSizeLog2, copySize.register) - } else { - // sourceOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, sourceOffset.register) - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, destinationOffset.register) - } - - // Negate the counter. - c.assembler.CompileRegisterToRegister(arm64.NEG, copySize.register, copySize.register) - - beginCopyLoop := c.assembler.CompileStandAlone(arm64.NOP) - - // arm64ReservedRegisterForTemporary = [sourceOffset + (size.register)] - c.assembler.CompileMemoryWithRegisterOffsetToRegister(ldr, - sourceOffset.register, copySize.register, - arm64ReservedRegisterForTemporary) - // [destinationOffset + (size.register)] = arm64ReservedRegisterForTemporary. - c.assembler.CompileRegisterToMemoryWithRegisterOffset(str, - arm64ReservedRegisterForTemporary, - destinationOffset.register, copySize.register, - ) - - // size += 1 - c.assembler.CompileConstToRegister(arm64.ADDS, movSize, copySize.register) - c.assembler.CompileJump(arm64.BCONDMI).AssignJumpTarget(beginCopyLoop) - } - c.assembler.SetJumpTargetOnNext(skipCopyJump) - c.assembler.SetJumpTargetOnNext(endJump) - } - - // Mark all of the operand registers. - c.markRegisterUnused(copySize.register, sourceOffset.register, destinationOffset.register) - - return nil -} - -// compileMemoryFill implements compiler.compileMemoryCopy for the arm64 architecture. -func (c *arm64Compiler) compileMemoryFill() error { - return c.compileFillImpl(false, 0) -} - -// compileFillImpl implements TableFill and MemoryFill. -// -// TODO: the compiled code in this function should be reused and compile at once as -// the code is independent of any module. -func (c *arm64Compiler) compileFillImpl(isTable bool, tableIndex uint32) error { - outOfBoundsErrorStatus := nativeCallStatusCodeMemoryOutOfBounds - if isTable { - outOfBoundsErrorStatus = nativeCallStatusCodeInvalidTableAccess - } - - fillSize, err := c.popValueOnRegister() - if err != nil { - return err - } - c.markRegisterUsed(fillSize.register) - - value, err := c.popValueOnRegister() - if err != nil { - return err - } - c.markRegisterUsed(value.register) - - destinationOffset, err := c.popValueOnRegister() - if err != nil { - return err - } - if isZeroRegister(destinationOffset.register) { - destinationOffset.register, err = c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.MOVD, arm64.RegRZR, destinationOffset.register) - } - c.markRegisterUsed(destinationOffset.register) - - // destinationOffset += size. - c.assembler.CompileRegisterToRegister(arm64.ADD, fillSize.register, destinationOffset.register) - - if isTable { - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = arm64ReservedRegisterForTemporary + srcTableIndex*8 - // = &tables[0] + sizeOf(*tableInstance)*8 - // = &tables[srcTableIndex] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(tableIndex)*8, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForTemporary+tableInstanceTableLenOffset] = len(tables[srcTableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - arm64ReservedRegisterForTemporary) - } else { - // arm64ReservedRegisterForTemporary = len(memoryInst.Buffer). - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - arm64ReservedRegisterForTemporary) - } - - // Check len >= destinationOffset. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64ReservedRegisterForTemporary, destinationOffset.register) - - // If not, raise the runtime error. - c.compileMaybeExitFromNativeCode(arm64.BCONDLS, outOfBoundsErrorStatus) - - // Otherwise, ready to copy the value from destination to source. - // If the size equals zero, we can skip the entire instructions below. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, fillSize.register) - skipCopyJump := c.assembler.CompileJump(arm64.BCONDEQ) - - // destinationOffset -= size. - c.assembler.CompileRegisterToRegister(arm64.SUB, fillSize.register, destinationOffset.register) - - var str asm.Instruction - var movSize int64 - if isTable { - str = arm64.STRD - movSize = 8 - - // arm64ReservedRegisterForTemporary = &Tables[dstTableIndex].Table[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, - callEngineModuleContextTablesElement0AddressOffset, arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, int64(tableIndex)*8, - arm64ReservedRegisterForTemporary) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - arm64ReservedRegisterForTemporary) - // destinationOffset = (destinationOffset<< pointerSizeLog2) + &Table[dstTableIndex].Table[0] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - destinationOffset.register, pointerSizeLog2, - arm64ReservedRegisterForTemporary, destinationOffset.register) - - // copySize = copySize << pointerSizeLog2 as each element has 8 bytes and we copy one by one. - c.assembler.CompileConstToRegister(arm64.LSL, pointerSizeLog2, fillSize.register) - } else { - str = arm64.STRB - movSize = 1 - - // destinationOffset += memory buffer's absolute address. - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, destinationOffset.register) - } - - // Naively implement the copy with "for loop" by copying byte one by one. - beginCopyLoop := c.assembler.CompileStandAlone(arm64.NOP) - - // size -= 1 - c.assembler.CompileConstToRegister(arm64.SUBS, movSize, fillSize.register) - - // [destinationOffset + (size.register)] = arm64ReservedRegisterForTemporary. - c.assembler.CompileRegisterToMemoryWithRegisterOffset(str, - value.register, - destinationOffset.register, fillSize.register, - ) - - // If the value on the copySizeRgister.register is not equal zero, continue the loop. - continueJump := c.assembler.CompileJump(arm64.BCONDNE) - continueJump.AssignJumpTarget(beginCopyLoop) - - // Mark all of the operand registers. - c.markRegisterUnused(fillSize.register, value.register, destinationOffset.register) - - c.assembler.SetJumpTargetOnNext(skipCopyJump) - return nil -} - -// compileTableInit implements compiler.compileTableInit for the arm64 architecture. -func (c *arm64Compiler) compileTableInit(o *wazeroir.UnionOperation) error { - elemIndex := uint32(o.U1) - tableIndex := uint32(o.U2) - return c.compileInitImpl(true, elemIndex, tableIndex) -} - -// compileTableCopy implements compiler.compileTableCopy for the arm64 architecture. -func (c *arm64Compiler) compileTableCopy(o *wazeroir.UnionOperation) error { - return c.compileCopyImpl(true, uint32(o.U1), uint32(o.U2)) -} - -// compileElemDrop implements compiler.compileElemDrop for the arm64 architecture. -func (c *arm64Compiler) compileElemDrop(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - elemIndex := uint32(o.U1) - c.compileLoadElemInstanceAddress(elemIndex, tmp) - - // Clears the content of ElementInstances[o.ElemIndex] (== []interface{} type). - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 0) - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 8) - c.assembler.CompileRegisterToMemory(arm64.STRD, arm64.RegRZR, tmp, 16) - return nil -} - -func (c *arm64Compiler) compileLoadElemInstanceAddress(elemIndex uint32, dst asm.Register) { - // dst = dataIndex * elementInstanceStructSize - c.assembler.CompileConstToRegister(arm64.MOVD, int64(elemIndex)*elementInstanceStructSize, dst) - - // arm64ReservedRegisterForTemporary = &moduleInstance.ElementInstances[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextElementInstancesElement0AddressOffset, - arm64ReservedRegisterForTemporary, - ) - - // dst = arm64ReservedRegisterForTemporary + dst - // = &moduleInstance.ElementInstances[0] + elemIndex*elementInstanceStructSize - // = &moduleInstance.ElementInstances[elemIndex] - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForTemporary, dst) -} - -// compileRefFunc implements compiler.compileRefFunc for the arm64 architecture. -func (c *arm64Compiler) compileRefFunc(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - ref, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForCallEngine + callEngineModuleContextFunctionsElement0AddressOffset] - // = &moduleEngine.functions[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFunctionsElement0AddressOffset, - ref) - - // ref = ref + int64(o.FunctionIndex)*sizeOf(function) - // = &moduleEngine.functions[index] - functionIndex := int64(o.U1) - c.assembler.CompileConstToRegister(arm64.ADD, - functionIndex*functionSize, - ref, - ) - - c.pushRuntimeValueLocationOnRegister(ref, runtimeValueTypeI64) - return nil -} - -// compileTableGet implements compiler.compileTableGet for the arm64 architecture. -func (c *arm64Compiler) compileTableGet(o *wazeroir.UnionOperation) error { - ref, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(ref) - - offset, err := c.popValueOnRegister() - if err != nil { - return err - } - - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForTemporary + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableIndex*8, - arm64ReservedRegisterForTemporary) - - // Out of bounds check. - // ref = [&tables[TableIndex] + tableInstanceTableLenOffset] = len(tables[TableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - ref, - ) - // "cmp ref, offset" - c.assembler.CompileTwoRegistersToNone(arm64.CMP, ref, offset.register) - - // If it exceeds len(table), we exit the execution. - c.compileMaybeExitFromNativeCode(arm64.BCONDLO, nativeCallStatusCodeInvalidTableAccess) - - // ref = [&tables[TableIndex] + tableInstanceTableOffset] = &tables[TableIndex].References[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - ref, - ) - - // ref = (offset << pointerSizeLog2) + ref - // = &tables[TableIndex].References[0] + sizeOf(uintptr) * offset - // = &tables[TableIndex].References[offset] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - offset.register, pointerSizeLog2, ref, ref) - - // ref = [&tables[TableIndex]] = load the Reference's pointer as uint64. - c.assembler.CompileMemoryToRegister(arm64.LDRD, ref, 0, ref) - - c.pushRuntimeValueLocationOnRegister(ref, runtimeValueTypeI64) // table elements are opaque 64-bit at runtime. - return nil -} - -// compileTableSet implements compiler.compileTableSet for the arm64 architecture. -func (c *arm64Compiler) compileTableSet(o *wazeroir.UnionOperation) error { - ref := c.locationStack.pop() - if err := c.compileEnsureOnRegister(ref); err != nil { - return err - } - - offset := c.locationStack.pop() - if err := c.compileEnsureOnRegister(offset); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = arm64ReservedRegisterForTemporary + TableIndex*8 - // = &tables[0] + TableIndex*sizeOf(*tableInstance) - // = &tables[TableIndex] - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableIndex*8, - arm64ReservedRegisterForTemporary) - - // Out of bounds check. - // tmp = [&tables[TableIndex] + tableInstanceTableLenOffset] = len(tables[TableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - tmp, - ) - // "cmp tmp, offset" - c.assembler.CompileTwoRegistersToNone(arm64.CMP, tmp, offset.register) - - // If it exceeds len(table), we exit the execution. - c.compileMaybeExitFromNativeCode(arm64.BCONDLO, nativeCallStatusCodeInvalidTableAccess) - - // tmp = [&tables[TableIndex] + tableInstanceTableOffset] = &tables[TableIndex].References[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableOffset, - tmp, - ) - - // tmp = (offset << pointerSizeLog2) + tmp - // = &tables[TableIndex].References[0] + sizeOf(uintptr) * offset - // = &tables[TableIndex].References[offset] - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, offset.register, pointerSizeLog2, tmp, tmp) - - // Set the reference's raw pointer. - c.assembler.CompileRegisterToMemory(arm64.STRD, ref.register, tmp, 0) - - c.markRegisterUnused(offset.register, ref.register, tmp) - return nil -} - -// compileTableGrow implements compiler.compileTableGrow for the arm64 architecture. -func (c *arm64Compiler) compileTableGrow(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - // Pushes the table index. - tableIndex := o.U1 - if err := c.compileIntConstant(true, tableIndex); err != nil { - return err - } - - // Table grow cannot be done in assembly just like memory grow as it involves with allocation in Go. - // Therefore, call out to the built function for this purpose. - if err := c.compileCallGoFunction(nativeCallStatusCodeCallBuiltInFunction, builtinFunctionIndexTableGrow); err != nil { - return err - } - - // TableGrow consumes three values (table index, number of items, initial value). - for i := 0; i < 3; i++ { - c.locationStack.pop() - } - - // Then, the previous length was pushed as the result. - v := c.locationStack.pushRuntimeValueLocationOnStack() - v.valueType = runtimeValueTypeI32 - - // After return, we re-initialize reserved registers just like preamble of functions. - c.compileReservedStackBasePointerRegisterInitialization() - c.compileReservedMemoryRegisterInitialization() - return nil -} - -// compileTableSize implements compiler.compileTableSize for the arm64 architecture. -func (c *arm64Compiler) compileTableSize(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.markRegisterUsed(result) - - // arm64ReservedRegisterForTemporary = &tables[0] - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - arm64ReservedRegisterForTemporary) - // arm64ReservedRegisterForTemporary = [arm64ReservedRegisterForTemporary + TableIndex*8] - // = [&tables[0] + TableIndex*sizeOf(*tableInstance)] - // = [&tables[TableIndex]] = tables[TableIndex]. - tableIndex := int64(o.U1) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableIndex*8, - arm64ReservedRegisterForTemporary) - - // result = [&tables[TableIndex] + tableInstanceTableLenOffset] = len(tables[TableIndex]) - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForTemporary, tableInstanceTableLenOffset, - result, - ) - - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return nil -} - -// compileTableFill implements compiler.compileTableFill for the arm64 architecture. -func (c *arm64Compiler) compileTableFill(o *wazeroir.UnionOperation) error { - tableIndex := uint32(o.U1) - return c.compileFillImpl(true, tableIndex) -} - -// popTwoValuesOnRegisters pops two values from the location stacks, ensures -// these two values are located on registers, and mark them unused. -// -// TODO: we’d usually prefix this with compileXXX as this might end up emitting instructions, -// but the name seems awkward. -func (c *arm64Compiler) popTwoValuesOnRegisters() (x1, x2 *runtimeValueLocation, err error) { - x2 = c.locationStack.pop() - if err = c.compileEnsureOnRegister(x2); err != nil { - return - } - - x1 = c.locationStack.pop() - if err = c.compileEnsureOnRegister(x1); err != nil { - return - } - - c.markRegisterUnused(x2.register) - c.markRegisterUnused(x1.register) - return -} - -// popValueOnRegister pops one value from the location stack, ensures -// that it is located on a register, and mark it unused. -// -// TODO: we’d usually prefix this with compileXXX as this might end up emitting instructions, -// but the name seems awkward. -func (c *arm64Compiler) popValueOnRegister() (v *runtimeValueLocation, err error) { - v = c.locationStack.pop() - if err = c.compileEnsureOnRegister(v); err != nil { - return - } - - c.markRegisterUnused(v.register) - return -} - -// compileEnsureOnRegister emits instructions to ensure that a value is located on a register. -func (c *arm64Compiler) compileEnsureOnRegister(loc *runtimeValueLocation) (err error) { - if loc.onStack() { - reg, err := c.allocateRegister(loc.getRegisterType()) - if err != nil { - return err - } - - // Record that the value holds the register and the register is marked used. - loc.setRegister(reg) - c.markRegisterUsed(reg) - - c.compileLoadValueOnStackToRegister(loc) - } else if loc.onConditionalRegister() { - err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc) - } - return -} - -// maybeCompileMoveTopConditionalToGeneralPurposeRegister moves the top value on the stack -// if the value is located on a conditional register. -// -// This is usually called at the beginning of methods on compiler interface where we possibly -// compile instructions without saving the conditional register value. -// compile* functions without calling this function is saving the conditional -// value to the stack or register by invoking ensureOnGeneralPurposeRegister for the top. -func (c *arm64Compiler) maybeCompileMoveTopConditionalToGeneralPurposeRegister() (err error) { - if c.locationStack.sp > 0 { - if loc := c.locationStack.peek(); loc.onConditionalRegister() { - err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc) - } - } - return -} - -// loadConditionalRegisterToGeneralPurposeRegister saves the conditional register value -// to a general purpose register. -func (c *arm64Compiler) compileLoadConditionalRegisterToGeneralPurposeRegister(loc *runtimeValueLocation) error { - reg, err := c.allocateRegister(loc.getRegisterType()) - if err != nil { - return err - } - - c.markRegisterUsed(reg) - c.assembler.CompileConditionalRegisterSet(loc.conditionalRegister, reg) - - // Record that now the value is located on a general purpose register. - loc.setRegister(reg) - return nil -} - -// compileLoadValueOnStackToRegister implements compiler.compileLoadValueOnStackToRegister for arm64. -func (c *arm64Compiler) compileLoadValueOnStackToRegister(loc *runtimeValueLocation) { - switch loc.valueType { - case runtimeValueTypeI32: - c.assembler.CompileMemoryToRegister(arm64.LDRW, arm64ReservedRegisterForStackBasePointerAddress, - int64(loc.stackPointer)*8, loc.register) - case runtimeValueTypeI64: - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForStackBasePointerAddress, - int64(loc.stackPointer)*8, loc.register) - case runtimeValueTypeF32: - c.assembler.CompileMemoryToRegister(arm64.FLDRS, arm64ReservedRegisterForStackBasePointerAddress, - int64(loc.stackPointer)*8, loc.register) - case runtimeValueTypeF64: - c.assembler.CompileMemoryToRegister(arm64.FLDRD, arm64ReservedRegisterForStackBasePointerAddress, - int64(loc.stackPointer)*8, loc.register) - case runtimeValueTypeV128Lo: - c.assembler.CompileMemoryToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8, loc.register, - arm64.VectorArrangementQ) - // Higher 64-bits are loaded as well ^^. - hi := &c.locationStack.stack[loc.stackPointer+1] - hi.setRegister(loc.register) - case runtimeValueTypeV128Hi: - panic("BUG: V128Hi must be be loaded to a register along with V128Lo") - } -} - -// allocateRegister implements compiler.allocateRegister for arm64. -func (c *arm64Compiler) allocateRegister(t registerType) (reg asm.Register, err error) { - var ok bool - // Try to get the unused register. - reg, ok = c.locationStack.takeFreeRegister(t) - if ok { - return - } - - // If not found, we have to steal the register. - stealTarget, ok := c.locationStack.takeStealTargetFromUsedRegister(t) - if !ok { - err = fmt.Errorf("cannot steal register") - return - } - - // Release the steal target register value onto stack location. - reg = stealTarget.register - c.compileReleaseRegisterToStack(stealTarget) - return -} - -// compileReleaseAllRegistersToStack adds instructions to store all the values located on -// either general purpose or conditional registers onto the memory stack. -// See releaseRegisterToStack. -func (c *arm64Compiler) compileReleaseAllRegistersToStack() (err error) { - for i := uint64(0); i < c.locationStack.sp; i++ { - if loc := &c.locationStack.stack[i]; loc.onRegister() { - c.compileReleaseRegisterToStack(loc) - } else if loc.onConditionalRegister() { - if err = c.compileLoadConditionalRegisterToGeneralPurposeRegister(loc); err != nil { - return - } - c.compileReleaseRegisterToStack(loc) - } - } - return -} - -// releaseRegisterToStack adds an instruction to write the value on a register back to memory stack region. -func (c *arm64Compiler) compileReleaseRegisterToStack(loc *runtimeValueLocation) { - switch loc.valueType { - case runtimeValueTypeI32: - c.assembler.CompileRegisterToMemory(arm64.STRW, loc.register, arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8) - case runtimeValueTypeI64: - c.assembler.CompileRegisterToMemory(arm64.STRD, loc.register, arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8) - case runtimeValueTypeF32: - c.assembler.CompileRegisterToMemory(arm64.FSTRS, loc.register, arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8) - case runtimeValueTypeF64: - c.assembler.CompileRegisterToMemory(arm64.FSTRD, loc.register, arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8) - case runtimeValueTypeV128Lo: - c.assembler.CompileVectorRegisterToMemory(arm64.VMOV, - loc.register, arm64ReservedRegisterForStackBasePointerAddress, int64(loc.stackPointer)*8, - arm64.VectorArrangementQ) - // Higher 64-bits are released as well ^^. - hi := &c.locationStack.stack[loc.stackPointer+1] - c.locationStack.releaseRegister(hi) - case runtimeValueTypeV128Hi: - panic("BUG: V128Hi must be released to the stack along with V128Lo") - default: - panic("BUG") - } - - // Mark the register is free. - c.locationStack.releaseRegister(loc) -} - -// compileReservedStackBasePointerRegisterInitialization adds instructions to initialize arm64ReservedRegisterForStackBasePointerAddress -// so that it points to the absolute address of the stack base for this function. -func (c *arm64Compiler) compileReservedStackBasePointerRegisterInitialization() { - // First, load the address of the first element in the value stack into arm64ReservedRegisterForStackBasePointerAddress temporarily. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackElement0AddressOffset, - arm64ReservedRegisterForStackBasePointerAddress) - - // next we move the base pointer (ce.stackBasePointer) to arm64ReservedRegisterForTemporary. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineStackContextStackBasePointerInBytesOffset, - arm64ReservedRegisterForTemporary) - - // Finally, we calculate "callEngineStackContextStackBasePointerInBytesOffset + arm64ReservedRegisterForTemporary" - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForTemporary, arm64ReservedRegisterForStackBasePointerAddress) -} - -func (c *arm64Compiler) compileReservedMemoryRegisterInitialization() { - if c.ir.HasMemory || c.ir.UsesMemory { - // "arm64ReservedRegisterForMemory = ce.MemoryElement0Address" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemoryElement0AddressOffset, - arm64ReservedRegisterForMemory, - ) - } -} - -// compileModuleContextInitialization adds instructions to initialize ce.moduleContext's fields based on -// ce.moduleContext.ModuleInstanceAddress. -// This is called in two cases: in function preamble, and on the return from (non-Go) function calls. -func (c *arm64Compiler) compileModuleContextInitialization() error { - tmpX, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - panic("BUG: all the registers should be free at this point") - } - c.markRegisterUsed(tmpX) - tmpY, found := c.locationStack.takeFreeRegister(registerTypeGeneralPurpose) - if !found { - panic("BUG: all the registers should be free at this point") - } - c.markRegisterUsed(tmpY) - - // "tmpX = ce.ModuleInstanceAddress" - c.assembler.CompileMemoryToRegister(arm64.LDRD, arm64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset, tmpX) - - // If the module instance address stays the same, we could skip the entire code below. - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64CallingConventionModuleInstanceAddressRegister, tmpX) - brIfModuleUnchanged := c.assembler.CompileJump(arm64.BCONDEQ) - - // Otherwise, update the moduleEngine.moduleContext.ModuleInstanceAddress. - c.assembler.CompileRegisterToMemory(arm64.STRD, - arm64CallingConventionModuleInstanceAddressRegister, - arm64ReservedRegisterForCallEngine, callEngineModuleContextModuleInstanceOffset, - ) - - // Also, we have to update the following fields: - // * callEngine.moduleContext.globalElement0Address - // * callEngine.moduleContext.memoryElement0Address - // * callEngine.moduleContext.memorySliceLen - // * callEngine.moduleContext.memoryInstance - // * callEngine.moduleContext.tableElement0Address - // * callEngine.moduleContext.tableSliceLen - // * callEngine.moduleContext.functionsElement0Address - // * callEngine.moduleContext.typeIDsElement0Address - // * callEngine.moduleContext.dataInstancesElement0Address - // * callEngine.moduleContext.elementInstancesElement0Address - - // Update globalElement0Address. - // - // Note: if there's global.get or set instruction in the function, the existence of the globals - // is ensured by function validation at module instantiation phase, and that's why it is ok to - // skip the initialization if the module's globals slice is empty. - if len(c.ir.Globals) > 0 { - // "tmpX = &moduleInstance.Globals[0]" - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceGlobalsOffset, - tmpX, - ) - - // "ce.GlobalElement0Address = tmpX (== &moduleInstance.Globals[0])" - c.assembler.CompileRegisterToMemory( - arm64.STRD, tmpX, - arm64ReservedRegisterForCallEngine, callEngineModuleContextGlobalElement0AddressOffset, - ) - } - - // Update memoryElement0Address and memorySliceLen. - // - // Note: if there's memory instruction in the function, memory instance must be non-nil. - // That is ensured by function validation at module instantiation phase, and that's - // why it is ok to skip the initialization if the module's memory instance is nil. - if c.ir.HasMemory { - // "tmpX = moduleInstance.Memory" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceMemoryOffset, - tmpX, - ) - - // First, set ce.memoryInstance - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpX, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemoryInstanceOffset, - ) - - // Next, we write the memory length into ce.MemorySliceLen. - // - // "tmpY = [tmpX + memoryInstanceBufferLenOffset] (== len(memory.Buffer))" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - tmpX, memoryInstanceBufferLenOffset, - tmpY, - ) - // "ce.MemorySliceLen = tmpY". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpY, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemorySliceLenOffset, - ) - - // Finally, we write ce.memoryElement0Address. - // - // "tmpY = *tmpX (== &memory.Buffer[0])" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - tmpX, memoryInstanceBufferOffset, - tmpY, - ) - // "ce.memoryElement0Address = tmpY". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpY, - arm64ReservedRegisterForCallEngine, callEngineModuleContextMemoryElement0AddressOffset, - ) - } - - // Update tableElement0Address, tableSliceLen and typeIDsElement0Address. - // - // Note: if there's table instruction in the function, the existence of the table - // is ensured by function validation at module instantiation phase, and that's - // why it is ok to skip the initialization if the module's table doesn't exist. - if c.ir.HasTable { - // "tmpX = &tables[0] (type of **wasm.Table)" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceTablesOffset, - tmpX, - ) - - // Update ce.tableElement0Address. - // "ce.tableElement0Address = tmpX". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpX, - arm64ReservedRegisterForCallEngine, callEngineModuleContextTablesElement0AddressOffset, - ) - - // Finally, we put &ModuleInstance.TypeIDs[0] into moduleContext.typeIDsElement0Address. - c.assembler.CompileMemoryToRegister(arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceTypeIDsOffset, tmpX) - c.assembler.CompileRegisterToMemory(arm64.STRD, - tmpX, arm64ReservedRegisterForCallEngine, callEngineModuleContextTypeIDsElement0AddressOffset) - } - - // Update callEngine.moduleContext.functionsElement0Address - { - // "tmpX = [moduleInstanceAddressRegister + moduleInstanceEngineOffset + interfaceDataOffset] (== *moduleEngine)" - // - // Go's interface is laid out on memory as two quad words as struct {tab, data uintptr} - // where tab points to the interface table, and the latter points to the actual - // implementation of interface. This case, we extract "data" pointer as *moduleEngine. - // See the following references for detail: - // * https://research.swtch.com/interfaces - // * https://github.com/golang/go/blob/release-branch.go1.20/src/runtime/runtime2.go#L207-L210 - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceEngineOffset+interfaceDataOffset, - tmpX, - ) - - // "tmpY = [tmpX + moduleEngineFunctionsOffset] (== &moduleEngine.functions[0])" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - tmpX, moduleEngineFunctionsOffset, - tmpY, - ) - - // "callEngine.moduleContext.functionsElement0Address = tmpY". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpY, - arm64ReservedRegisterForCallEngine, callEngineModuleContextFunctionsElement0AddressOffset, - ) - } - - // Update dataInstancesElement0Address. - if c.ir.HasDataInstances { - // "tmpX = &moduleInstance.DataInstances[0]" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceDataInstancesOffset, - tmpX, - ) - // "callEngine.moduleContext.dataInstancesElement0Address = tmpX". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpX, - arm64ReservedRegisterForCallEngine, callEngineModuleContextDataInstancesElement0AddressOffset, - ) - } - - // Update callEngine.moduleContext.elementInstancesElement0Address - if c.ir.HasElementInstances { - // "tmpX = &moduleInstance.DataInstances[0]" - c.assembler.CompileMemoryToRegister( - arm64.LDRD, - arm64CallingConventionModuleInstanceAddressRegister, moduleInstanceElementInstancesOffset, - tmpX, - ) - // "callEngine.moduleContext.dataInstancesElement0Address = tmpX". - c.assembler.CompileRegisterToMemory( - arm64.STRD, - tmpX, - arm64ReservedRegisterForCallEngine, callEngineModuleContextElementInstancesElement0AddressOffset, - ) - } - - c.assembler.SetJumpTargetOnNext(brIfModuleUnchanged) - c.markRegisterUnused(tmpX, tmpY) - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_amd64.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_amd64.go deleted file mode 100644 index d6c111db4e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_amd64.go +++ /dev/null @@ -1,2812 +0,0 @@ -package compiler - -import ( - "errors" - - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/asm/amd64" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// compileV128Const implements compiler.compileV128Const for amd64 architecture. -func (c *amd64Compiler) compileV128Const(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - lo, hi := o.U1, o.U2 - - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // We cannot directly load the value from memory to float regs, - // so we move it to int reg temporarily. - tmpReg, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Move the lower 64-bits. - if lo == 0 { - c.assembler.CompileRegisterToRegister(amd64.XORQ, tmpReg, tmpReg) - } else { - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(lo), tmpReg) - } - c.assembler.CompileRegisterToRegister(amd64.MOVQ, tmpReg, result) - - if lo != 0 && hi == 0 { - c.assembler.CompileRegisterToRegister(amd64.XORQ, tmpReg, tmpReg) - } else if hi != 0 { - c.assembler.CompileConstToRegister(amd64.MOVQ, int64(hi), tmpReg) - } - // Move the higher 64-bits with PINSRQ at the second element of 64x2 vector. - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, tmpReg, result, 1) - - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128Add implements compiler.compileV128Add for amd64 architecture. -func (c *amd64Compiler) compileV128Add(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - inst = amd64.PADDB - case wazeroir.ShapeI16x8: - inst = amd64.PADDW - case wazeroir.ShapeI32x4: - inst = amd64.PADDD - case wazeroir.ShapeI64x2: - inst = amd64.PADDQ - case wazeroir.ShapeF32x4: - inst = amd64.ADDPS - case wazeroir.ShapeF64x2: - inst = amd64.ADDPD - } - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - c.locationStack.markRegisterUnused(x2.register) - return nil -} - -// compileV128Sub implements compiler.compileV128Sub for amd64 architecture. -func (c *amd64Compiler) compileV128Sub(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - inst = amd64.PSUBB - case wazeroir.ShapeI16x8: - inst = amd64.PSUBW - case wazeroir.ShapeI32x4: - inst = amd64.PSUBD - case wazeroir.ShapeI64x2: - inst = amd64.PSUBQ - case wazeroir.ShapeF32x4: - inst = amd64.SUBPS - case wazeroir.ShapeF64x2: - inst = amd64.SUBPD - } - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - c.locationStack.markRegisterUnused(x2.register) - return nil -} - -// compileV128Load implements compiler.compileV128Load for amd64 architecture. -func (c *amd64Compiler) compileV128Load(o *wazeroir.UnionOperation) error { - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - offset := uint32(o.U2) - loadType := wazeroir.V128LoadType(o.B1) - - switch loadType { - case wazeroir.V128LoadType128: - err = c.compileV128LoadImpl(amd64.MOVDQU, offset, 16, result) - case wazeroir.V128LoadType8x8s: - err = c.compileV128LoadImpl(amd64.PMOVSXBW, offset, 8, result) - case wazeroir.V128LoadType8x8u: - err = c.compileV128LoadImpl(amd64.PMOVZXBW, offset, 8, result) - case wazeroir.V128LoadType16x4s: - err = c.compileV128LoadImpl(amd64.PMOVSXWD, offset, 8, result) - case wazeroir.V128LoadType16x4u: - err = c.compileV128LoadImpl(amd64.PMOVZXWD, offset, 8, result) - case wazeroir.V128LoadType32x2s: - err = c.compileV128LoadImpl(amd64.PMOVSXDQ, offset, 8, result) - case wazeroir.V128LoadType32x2u: - err = c.compileV128LoadImpl(amd64.PMOVZXDQ, offset, 8, result) - case wazeroir.V128LoadType8Splat: - reg, err := c.compileMemoryAccessCeilSetup(offset, 1) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVBQZX, amd64ReservedRegisterForMemory, -1, - reg, 1, reg) - // pinsrb $0, reg, result - // pxor tmpVReg, tmpVReg - // pshufb tmpVReg, result - c.locationStack.markRegisterUsed(result) - tmpVReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRB, reg, result, 0) - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmpVReg, tmpVReg) - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, tmpVReg, result) - case wazeroir.V128LoadType16Splat: - reg, err := c.compileMemoryAccessCeilSetup(offset, 2) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVWQZX, amd64ReservedRegisterForMemory, -2, - reg, 1, reg) - // pinsrw $0, reg, result - // pinsrw $1, reg, result - // pshufd $0, result, result (result = result[0,0,0,0]) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRW, reg, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRW, reg, result, 1) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, result, result, 0) - case wazeroir.V128LoadType32Splat: - reg, err := c.compileMemoryAccessCeilSetup(offset, 4) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVLQZX, amd64ReservedRegisterForMemory, -4, - reg, 1, reg) - // pinsrd $0, reg, result - // pshufd $0, result, result (result = result[0,0,0,0]) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRD, reg, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, result, result, 0) - case wazeroir.V128LoadType64Splat: - reg, err := c.compileMemoryAccessCeilSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVQ, amd64ReservedRegisterForMemory, -8, - reg, 1, reg) - // pinsrq $0, reg, result - // pinsrq $1, reg, result - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, reg, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, reg, result, 1) - case wazeroir.V128LoadType32zero: - err = c.compileV128LoadImpl(amd64.MOVL, offset, 4, result) - case wazeroir.V128LoadType64zero: - err = c.compileV128LoadImpl(amd64.MOVQ, offset, 8, result) - } - - if err != nil { - return err - } - - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -func (c *amd64Compiler) compileV128LoadImpl(inst asm.Instruction, offset uint32, targetSizeInBytes int64, dst asm.Register) error { - offsetReg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexToRegister(inst, amd64ReservedRegisterForMemory, -targetSizeInBytes, - offsetReg, 1, dst) - return nil -} - -// compileV128LoadLane implements compiler.compileV128LoadLane for amd64. -func (c *amd64Compiler) compileV128LoadLane(o *wazeroir.UnionOperation) error { - targetVector := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(targetVector); err != nil { - return err - } - - laneSize, laneIndex := o.B1, o.B2 - offset := uint32(o.U2) - - var insertInst asm.Instruction - switch laneSize { - case 8: - insertInst = amd64.PINSRB - case 16: - insertInst = amd64.PINSRW - case 32: - insertInst = amd64.PINSRD - case 64: - insertInst = amd64.PINSRQ - } - - targetSizeInBytes := int64(laneSize / 8) - offsetReg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - c.assembler.CompileMemoryWithIndexAndArgToRegister(insertInst, amd64ReservedRegisterForMemory, -targetSizeInBytes, - offsetReg, 1, targetVector.register, laneIndex) - - c.pushVectorRuntimeValueLocationOnRegister(targetVector.register) - return nil -} - -// compileV128Store implements compiler.compileV128Store for amd64. -func (c *amd64Compiler) compileV128Store(o *wazeroir.UnionOperation) error { - val := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(val); err != nil { - return err - } - - const targetSizeInBytes = 16 - offset := uint32(o.U2) - offsetReg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - c.assembler.CompileRegisterToMemoryWithIndex(amd64.MOVDQU, val.register, - amd64ReservedRegisterForMemory, -targetSizeInBytes, offsetReg, 1) - - c.locationStack.markRegisterUnused(val.register, offsetReg) - return nil -} - -// compileV128StoreLane implements compiler.compileV128StoreLane for amd64. -func (c *amd64Compiler) compileV128StoreLane(o *wazeroir.UnionOperation) error { - var storeInst asm.Instruction - laneSize := o.B1 - laneIndex := o.B2 - offset := uint32(o.U2) - switch laneSize { - case 8: - storeInst = amd64.PEXTRB - case 16: - storeInst = amd64.PEXTRW - case 32: - storeInst = amd64.PEXTRD - case 64: - storeInst = amd64.PEXTRQ - } - - val := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(val); err != nil { - return err - } - - targetSizeInBytes := int64(laneSize / 8) - offsetReg, err := c.compileMemoryAccessCeilSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - c.assembler.CompileRegisterToMemoryWithIndexAndArg(storeInst, val.register, - amd64ReservedRegisterForMemory, -targetSizeInBytes, offsetReg, 1, laneIndex) - - c.locationStack.markRegisterUnused(val.register, offsetReg) - return nil -} - -// compileV128ExtractLane implements compiler.compileV128ExtractLane for amd64. -func (c *amd64Compiler) compileV128ExtractLane(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vreg := v.register - shape := o.B1 - laneIndex := o.B2 - signed := o.B3 - switch shape { - case wazeroir.ShapeI8x16: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRB, vreg, result, laneIndex) - if signed { - c.assembler.CompileRegisterToRegister(amd64.MOVBLSX, result, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVBLZX, result, result) - } - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - c.locationStack.markRegisterUnused(vreg) - case wazeroir.ShapeI16x8: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRW, vreg, result, laneIndex) - if signed { - c.assembler.CompileRegisterToRegister(amd64.MOVWLSX, result, result) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVWLZX, result, result) - } - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - c.locationStack.markRegisterUnused(vreg) - case wazeroir.ShapeI32x4: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRD, vreg, result, laneIndex) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - c.locationStack.markRegisterUnused(vreg) - case wazeroir.ShapeI64x2: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRQ, vreg, result, laneIndex) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI64) - c.locationStack.markRegisterUnused(vreg) - case wazeroir.ShapeF32x4: - if laneIndex != 0 { - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, vreg, vreg, laneIndex) - } - c.pushRuntimeValueLocationOnRegister(vreg, runtimeValueTypeF32) - case wazeroir.ShapeF64x2: - if laneIndex != 0 { - // This case we can assume LaneIndex == 1. - // We have to modify the val.register as, for example: - // 0b11 0b10 0b01 0b00 - // | | | | - // [x3, x2, x1, x0] -> [x0, x0, x3, x2] - // where val.register = [x3, x2, x1, x0] and each xN = 32bits. - // Then, we interpret the register as float64, therefore, the float64 value is obtained as [x3, x2]. - arg := byte(0b00_00_11_10) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, vreg, vreg, arg) - } - c.pushRuntimeValueLocationOnRegister(vreg, runtimeValueTypeF64) - } - - return nil -} - -// compileV128ReplaceLane implements compiler.compileV128ReplaceLane for amd64. -func (c *amd64Compiler) compileV128ReplaceLane(o *wazeroir.UnionOperation) error { - origin := c.locationStack.pop() - if err := c.compileEnsureOnRegister(origin); err != nil { - return err - } - - vector := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(vector); err != nil { - return err - } - - shape := o.B1 - laneIndex := o.B2 - switch shape { - case wazeroir.ShapeI8x16: - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRB, origin.register, vector.register, laneIndex) - case wazeroir.ShapeI16x8: - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRW, origin.register, vector.register, laneIndex) - case wazeroir.ShapeI32x4: - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRD, origin.register, vector.register, laneIndex) - case wazeroir.ShapeI64x2: - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, origin.register, vector.register, laneIndex) - case wazeroir.ShapeF32x4: - c.assembler.CompileRegisterToRegisterWithArg(amd64.INSERTPS, origin.register, vector.register, - // In INSERTPS instruction, the destination index is encoded at 4 and 5 bits of the argument. - // See https://www.felixcloutier.com/x86/insertps - laneIndex<<4, - ) - case wazeroir.ShapeF64x2: - if laneIndex == 0 { - c.assembler.CompileRegisterToRegister(amd64.MOVSD, origin.register, vector.register) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVLHPS, origin.register, vector.register) - } - } - - c.pushVectorRuntimeValueLocationOnRegister(vector.register) - c.locationStack.markRegisterUnused(origin.register) - return nil -} - -// compileV128Splat implements compiler.compileV128Splat for amd64. -func (c *amd64Compiler) compileV128Splat(o *wazeroir.UnionOperation) (err error) { - origin := c.locationStack.pop() - if err = c.compileEnsureOnRegister(origin); err != nil { - return - } - - var result asm.Register - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(result) - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRB, origin.register, result, 0) - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp) - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, tmp, result) - case wazeroir.ShapeI16x8: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(result) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRW, origin.register, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRW, origin.register, result, 1) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, result, result, 0) - case wazeroir.ShapeI32x4: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(result) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRD, origin.register, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, result, result, 0) - case wazeroir.ShapeI64x2: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(result) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, origin.register, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, origin.register, result, 1) - case wazeroir.ShapeF32x4: - result = origin.register - c.assembler.CompileRegisterToRegisterWithArg(amd64.INSERTPS, origin.register, result, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, result, result, 0) - case wazeroir.ShapeF64x2: - result = origin.register - c.assembler.CompileRegisterToRegister(amd64.MOVQ, origin.register, result) - c.assembler.CompileRegisterToRegister(amd64.MOVLHPS, origin.register, result) - } - - c.locationStack.markRegisterUnused(origin.register) - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128Shuffle implements compiler.compileV128Shuffle for amd64. -func (c *amd64Compiler) compileV128Shuffle(o *wazeroir.UnionOperation) error { - w := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(w); err != nil { - return err - } - - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - wr, vr := w.register, v.register - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - consts := [32]byte{} - lanes := o.Us - for i, unsignedLane := range lanes { - lane := byte(unsignedLane) - if lane < 16 { - consts[i+16] = 0x80 - consts[i] = lane - } else { - consts[i+16] = lane - 16 - consts[i] = 0x80 - } - } - - err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(consts[:16]), tmp) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, tmp, vr) - err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(consts[16:]), tmp) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, tmp, wr) - c.assembler.CompileRegisterToRegister(amd64.ORPS, vr, wr) - - c.pushVectorRuntimeValueLocationOnRegister(wr) - c.locationStack.markRegisterUnused(vr) - return nil -} - -var swizzleConst = [16]byte{ - 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, - 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, -} - -// compileV128Swizzle implements compiler.compileV128Swizzle for amd64. -func (c *amd64Compiler) compileV128Swizzle(*wazeroir.UnionOperation) error { - index := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(index); err != nil { - return err - } - - base := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(base); err != nil { - return err - } - - idxReg, baseReg := index.register, base.register - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(swizzleConst[:]), tmp) - if err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PADDUSB, tmp, idxReg) - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, idxReg, baseReg) - - c.pushVectorRuntimeValueLocationOnRegister(baseReg) - c.locationStack.markRegisterUnused(idxReg) - return nil -} - -// compileV128AnyTrue implements compiler.compileV128AnyTrue for amd64. -func (c *amd64Compiler) compileV128AnyTrue(*wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vreg := v.register - - c.assembler.CompileRegisterToRegister(amd64.PTEST, vreg, vreg) - - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(amd64.ConditionalRegisterStateNE) - c.locationStack.markRegisterUnused(vreg) - return nil -} - -// compileV128AllTrue implements compiler.compileV128AllTrue for amd64. -func (c *amd64Compiler) compileV128AllTrue(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var cmpInst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - cmpInst = amd64.PCMPEQB - case wazeroir.ShapeI16x8: - cmpInst = amd64.PCMPEQW - case wazeroir.ShapeI32x4: - cmpInst = amd64.PCMPEQD - case wazeroir.ShapeI64x2: - cmpInst = amd64.PCMPEQQ - } - - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp) - c.assembler.CompileRegisterToRegister(cmpInst, v.register, tmp) - c.assembler.CompileRegisterToRegister(amd64.PTEST, tmp, tmp) - c.locationStack.markRegisterUnused(v.register, tmp) - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(amd64.ConditionalRegisterStateE) - return nil -} - -// compileV128BitMask implements compiler.compileV128BitMask for amd64. -func (c *amd64Compiler) compileV128BitMask(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - c.assembler.CompileRegisterToRegister(amd64.PMOVMSKB, v.register, result) - case wazeroir.ShapeI16x8: - // When we have: - // R1 = [R1(w1), R1(w2), R1(w3), R1(w4), R1(w5), R1(w6), R1(w7), R1(v8)] - // R2 = [R2(w1), R2(w2), R2(w3), R2(v4), R2(w5), R2(w6), R2(w7), R2(v8)] - // where RX(wn) is n-th signed word (16-bit) of RX register, - // - // "PACKSSWB R1, R2" produces - // R1 = [ - // byte_sat(R1(w1)), byte_sat(R1(w2)), byte_sat(R1(w3)), byte_sat(R1(w4)), - // byte_sat(R1(w5)), byte_sat(R1(w6)), byte_sat(R1(w7)), byte_sat(R1(w8)), - // byte_sat(R2(w1)), byte_sat(R2(w2)), byte_sat(R2(w3)), byte_sat(R2(w4)), - // byte_sat(R2(w5)), byte_sat(R2(w6)), byte_sat(R2(w7)), byte_sat(R2(w8)), - // ] - // where R1 is the destination register, and - // byte_sat(w) = int8(w) if w fits as signed 8-bit, - // 0x80 if w is less than 0x80 - // 0x7F if w is greater than 0x7f - // - // See https://www.felixcloutier.com/x86/packsswb:packssdw for detail. - // - // Therefore, v.register ends up having i-th and (i+8)-th bit set if i-th lane is negative (for i in 0..8). - c.assembler.CompileRegisterToRegister(amd64.PACKSSWB, v.register, v.register) - c.assembler.CompileRegisterToRegister(amd64.PMOVMSKB, v.register, result) - // Clear the higher bits than 8. - c.assembler.CompileConstToRegister(amd64.SHRQ, 8, result) - case wazeroir.ShapeI32x4: - c.assembler.CompileRegisterToRegister(amd64.MOVMSKPS, v.register, result) - case wazeroir.ShapeI64x2: - c.assembler.CompileRegisterToRegister(amd64.MOVMSKPD, v.register, result) - } - - c.locationStack.markRegisterUnused(v.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return nil -} - -// compileV128And implements compiler.compileV128And for amd64. -func (c *amd64Compiler) compileV128And(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PAND, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Not implements compiler.compileV128Not for amd64. -func (c *amd64Compiler) compileV128Not(*wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Set all bits on tmp register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, tmp) - // Then XOR with tmp to reverse all bits on v.register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, v.register) - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return nil -} - -// compileV128Or implements compiler.compileV128Or for amd64. -func (c *amd64Compiler) compileV128Or(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.POR, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Xor implements compiler.compileV128Xor for amd64. -func (c *amd64Compiler) compileV128Xor(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Bitselect implements compiler.compileV128Bitselect for amd64. -func (c *amd64Compiler) compileV128Bitselect(*wazeroir.UnionOperation) error { - selector := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(selector); err != nil { - return err - } - - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // The following logic is equivalent to v128.or(v128.and(v1, selector), v128.and(v2, v128.not(selector))) - // See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#bitwise-select - c.assembler.CompileRegisterToRegister(amd64.PAND, selector.register, x1.register) - c.assembler.CompileRegisterToRegister(amd64.PANDN, x2.register, selector.register) - c.assembler.CompileRegisterToRegister(amd64.POR, selector.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register, selector.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128AndNot implements compiler.compileV128AndNot for amd64. -func (c *amd64Compiler) compileV128AndNot(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PANDN, x1.register, x2.register) - - c.locationStack.markRegisterUnused(x1.register) - c.pushVectorRuntimeValueLocationOnRegister(x2.register) - return nil -} - -// compileV128Shr implements compiler.compileV128Shr for amd64. -func (c *amd64Compiler) compileV128Shr(o *wazeroir.UnionOperation) error { - // https://stackoverflow.com/questions/35002937/sse-simd-shift-with-one-byte-element-size-granularity - shape := o.B1 - signed := o.B3 - if shape == wazeroir.ShapeI8x16 { - return c.compileV128ShrI8x16Impl(signed) - } else if shape == wazeroir.ShapeI64x2 && signed { - return c.compileV128ShrI64x2SignedImpl() - } else { - return c.compileV128ShrImpl(o) - } -} - -// compileV128ShrImpl implements shift right instructions except for i8x16 (logical/arithmetic) and i64x2 (arithmetic). -func (c *amd64Compiler) compileV128ShrImpl(o *wazeroir.UnionOperation) error { - s := c.locationStack.pop() - if err := c.compileEnsureOnRegister(s); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var moduleConst int64 - var shift asm.Instruction - shape := o.B1 - signed := o.B3 - switch shape { - case wazeroir.ShapeI16x8: - moduleConst = 0xf // modulo 16. - if signed { - shift = amd64.PSRAW - } else { - shift = amd64.PSRLW - } - case wazeroir.ShapeI32x4: - moduleConst = 0x1f // modulo 32. - if signed { - shift = amd64.PSRAD - } else { - shift = amd64.PSRLD - } - case wazeroir.ShapeI64x2: - moduleConst = 0x3f // modulo 64. - shift = amd64.PSRLQ - } - - gpShiftAmount := s.register - c.assembler.CompileConstToRegister(amd64.ANDQ, moduleConst, gpShiftAmount) - c.assembler.CompileRegisterToRegister(amd64.MOVL, gpShiftAmount, vecTmp) - c.assembler.CompileRegisterToRegister(shift, vecTmp, x1.register) - - c.locationStack.markRegisterUnused(gpShiftAmount) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128ShrI64x2SignedImpl implements compiler.compileV128Shr for i64x2 signed (arithmetic) shift. -// PSRAQ instruction requires AVX, so we emulate it without AVX instructions. https://www.felixcloutier.com/x86/psraw:psrad:psraq -func (c *amd64Compiler) compileV128ShrI64x2SignedImpl() error { - const shiftCountRegister = amd64.RegCX - - s := c.locationStack.pop() - if s.register != shiftCountRegister { - // If another value lives on the CX register, we release it to the stack. - c.onValueReleaseRegisterToStack(shiftCountRegister) - if s.onStack() { - s.setRegister(shiftCountRegister) - c.compileLoadValueOnStackToRegister(s) - } else if s.onConditionalRegister() { - c.compileMoveConditionalToGeneralPurposeRegister(s, shiftCountRegister) - } else { // already on register. - old := s.register - c.assembler.CompileRegisterToRegister(amd64.MOVL, old, shiftCountRegister) - s.setRegister(shiftCountRegister) - c.locationStack.markRegisterUnused(old) - } - } - - c.locationStack.markRegisterUsed(shiftCountRegister) - tmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - // Extract each lane into tmp, execute SHR on tmp, and write it back to the lane. - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRQ, x1.register, tmp, 0) - c.assembler.CompileRegisterToRegister(amd64.SARQ, shiftCountRegister, tmp) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, tmp, x1.register, 0) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PEXTRQ, x1.register, tmp, 1) - c.assembler.CompileRegisterToRegister(amd64.SARQ, shiftCountRegister, tmp) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PINSRQ, tmp, x1.register, 1) - - c.locationStack.markRegisterUnused(shiftCountRegister) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// i8x16LogicalSHRMaskTable is necessary for emulating non-existent packed bytes logical right shifts on amd64. -// The mask is applied after performing packed word shifts on the value to clear out the unnecessary bits. -var i8x16LogicalSHRMaskTable = [8 * 16]byte{ // (the number of possible shift amount 0, 1, ..., 7.) * 16 bytes. - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // for 0 shift - 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, // for 1 shift - 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, // for 2 shift - 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, // for 3 shift - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, // for 4 shift - 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, // for 5 shift - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, // for 6 shift - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // for 7 shift -} - -// compileV128ShrI64x2SignedImpl implements compiler.compileV128Shr for i8x16 signed logical/arithmetic shifts. -// amd64 doesn't have packed byte shifts, so we need this special casing. -// See https://stackoverflow.com/questions/35002937/sse-simd-shift-with-one-byte-element-size-granularity -func (c *amd64Compiler) compileV128ShrI8x16Impl(signed bool) error { - s := c.locationStack.pop() - if err := c.compileEnsureOnRegister(s); err != nil { - return err - } - - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - gpShiftAmount := s.register - c.assembler.CompileConstToRegister(amd64.ANDQ, 0x7, gpShiftAmount) // mod 8. - - if signed { - c.locationStack.markRegisterUsed(vecTmp) - vecTmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - vreg := v.register - - // Copy the value from v.register to vecTmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vreg, vecTmp) - - // Assuming that we have - // vreg = [b1, ..., b16] - // vecTmp = [b1, ..., b16] - // at this point, then we use PUNPCKLBW and PUNPCKHBW to produce: - // vreg = [b1, b1, b2, b2, ..., b8, b8] - // vecTmp = [b9, b9, b10, b10, ..., b16, b16] - c.assembler.CompileRegisterToRegister(amd64.PUNPCKLBW, vreg, vreg) - c.assembler.CompileRegisterToRegister(amd64.PUNPCKHBW, vecTmp, vecTmp) - - // Adding 8 to the shift amount, and then move the amount to vecTmp2. - c.assembler.CompileConstToRegister(amd64.ADDQ, 0x8, gpShiftAmount) - c.assembler.CompileRegisterToRegister(amd64.MOVL, gpShiftAmount, vecTmp2) - - // Perform the word packed arithmetic right shifts on vreg and vecTmp. - // This changes these two registers as: - // vreg = [xxx, b1 >> s, xxx, b2 >> s, ..., xxx, b8 >> s] - // vecTmp = [xxx, b9 >> s, xxx, b10 >> s, ..., xxx, b16 >> s] - // where xxx is 1 or 0 depending on each byte's sign, and ">>" is the arithmetic shift on a byte. - c.assembler.CompileRegisterToRegister(amd64.PSRAW, vecTmp2, vreg) - c.assembler.CompileRegisterToRegister(amd64.PSRAW, vecTmp2, vecTmp) - - // Finally, we can get the result by packing these two word vectors. - c.assembler.CompileRegisterToRegister(amd64.PACKSSWB, vecTmp, vreg) - - c.locationStack.markRegisterUnused(gpShiftAmount, vecTmp) - c.pushVectorRuntimeValueLocationOnRegister(vreg) - } else { - c.assembler.CompileRegisterToRegister(amd64.MOVL, gpShiftAmount, vecTmp) - // amd64 doesn't have packed byte shifts, so we packed word shift here, and then mark-out - // the unnecessary bits below. - c.assembler.CompileRegisterToRegister(amd64.PSRLW, vecTmp, v.register) - - gpTmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Read the initial address of the mask table into gpTmp register. - err = c.assembler.CompileStaticConstToRegister(amd64.LEAQ, asm.NewStaticConst(i8x16LogicalSHRMaskTable[:]), gpTmp) - if err != nil { - return err - } - - // We have to get the mask according to the shift amount, so we first have to do - // gpShiftAmount << 4 = gpShiftAmount*16 to get the initial offset of the mask (16 is the size of each mask in bytes). - c.assembler.CompileConstToRegister(amd64.SHLQ, 4, gpShiftAmount) - - // Now ready to read the content of the mask into the vecTmp. - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVDQU, - gpTmp, 0, gpShiftAmount, 1, - vecTmp, - ) - - // Finally, clear out the unnecessary - c.assembler.CompileRegisterToRegister(amd64.PAND, vecTmp, v.register) - - c.locationStack.markRegisterUnused(gpShiftAmount) - c.pushVectorRuntimeValueLocationOnRegister(v.register) - } - return nil -} - -// i8x16SHLMaskTable is necessary for emulating non-existent packed bytes left shifts on amd64. -// The mask is applied after performing packed word shifts on the value to clear out the unnecessary bits. -var i8x16SHLMaskTable = [8 * 16]byte{ // (the number of possible shift amount 0, 1, ..., 7.) * 16 bytes. - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, // for 0 shift - 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, // for 1 shift - 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, // for 2 shift - 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, // for 3 shift - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, // for 4 shift - 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, // for 5 shift - 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, // for 6 shift - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, // for 7 shift -} - -// compileV128Shl implements compiler.compileV128Shl for amd64. -func (c *amd64Compiler) compileV128Shl(o *wazeroir.UnionOperation) error { - s := c.locationStack.pop() - if err := c.compileEnsureOnRegister(s); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var modulo int64 - var shift asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - modulo = 0x7 // modulo 8. - // x86 doesn't have packed bytes shift, so we use PSLLW and mask-out the redundant bits. - // See https://stackoverflow.com/questions/35002937/sse-simd-shift-with-one-byte-element-size-granularity - shift = amd64.PSLLW - case wazeroir.ShapeI16x8: - modulo = 0xf // modulo 16. - shift = amd64.PSLLW - case wazeroir.ShapeI32x4: - modulo = 0x1f // modulo 32. - shift = amd64.PSLLD - case wazeroir.ShapeI64x2: - modulo = 0x3f // modulo 64. - shift = amd64.PSLLQ - } - - gpShiftAmount := s.register - c.assembler.CompileConstToRegister(amd64.ANDQ, modulo, gpShiftAmount) - c.assembler.CompileRegisterToRegister(amd64.MOVL, gpShiftAmount, vecTmp) - c.assembler.CompileRegisterToRegister(shift, vecTmp, x1.register) - - if shape == wazeroir.ShapeI8x16 { - gpTmp, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - // Read the initial address of the mask table into gpTmp register. - err = c.assembler.CompileStaticConstToRegister(amd64.LEAQ, asm.NewStaticConst(i8x16SHLMaskTable[:]), gpTmp) - if err != nil { - return err - } - - // We have to get the mask according to the shift amount, so we first have to do - // gpShiftAmount << 4 = gpShiftAmount*16 to get the initial offset of the mask (16 is the size of each mask in bytes). - c.assembler.CompileConstToRegister(amd64.SHLQ, 4, gpShiftAmount) - - // Now ready to read the content of the mask into the vecTmp. - c.assembler.CompileMemoryWithIndexToRegister(amd64.MOVDQU, - gpTmp, 0, gpShiftAmount, 1, - vecTmp, - ) - - // Finally, clear out the unnecessary - c.assembler.CompileRegisterToRegister(amd64.PAND, vecTmp, x1.register) - } - - c.locationStack.markRegisterUnused(gpShiftAmount) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Cmp implements compiler.compileV128Cmp for amd64. -func (c *amd64Compiler) compileV128Cmp(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - const ( - // See https://www.felixcloutier.com/x86/cmppd and https://www.felixcloutier.com/x86/cmpps - floatEqualArg = 0 - floatLessThanArg = 1 - floatLessThanOrEqualArg = 2 - floatNotEqualARg = 4 - ) - - x1Reg, x2Reg, result := x1.register, x2.register, asm.NilRegister - v128CmpType := o.B1 - switch v128CmpType { - case wazeroir.V128CmpTypeF32x4Eq: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x2Reg, x1Reg, floatEqualArg) - result = x1Reg - case wazeroir.V128CmpTypeF32x4Ne: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x2Reg, x1Reg, floatNotEqualARg) - result = x1Reg - case wazeroir.V128CmpTypeF32x4Lt: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x2Reg, x1Reg, floatLessThanArg) - result = x1Reg - case wazeroir.V128CmpTypeF32x4Gt: - // Without AVX, there's no float Gt instruction, so we swap the register and use Lt instead. - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x1Reg, x2Reg, floatLessThanArg) - result = x2Reg - case wazeroir.V128CmpTypeF32x4Le: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x2Reg, x1Reg, floatLessThanOrEqualArg) - result = x1Reg - case wazeroir.V128CmpTypeF32x4Ge: - // Without AVX, there's no float Ge instruction, so we swap the register and use Le instead. - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, x1Reg, x2Reg, floatLessThanOrEqualArg) - result = x2Reg - case wazeroir.V128CmpTypeF64x2Eq: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x2Reg, x1Reg, floatEqualArg) - result = x1Reg - case wazeroir.V128CmpTypeF64x2Ne: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x2Reg, x1Reg, floatNotEqualARg) - result = x1Reg - case wazeroir.V128CmpTypeF64x2Lt: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x2Reg, x1Reg, floatLessThanArg) - result = x1Reg - case wazeroir.V128CmpTypeF64x2Gt: - // Without AVX, there's no float Gt instruction, so we swap the register and use Lt instead. - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x1Reg, x2Reg, floatLessThanArg) - result = x2Reg - case wazeroir.V128CmpTypeF64x2Le: - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x2Reg, x1Reg, floatLessThanOrEqualArg) - result = x1Reg - case wazeroir.V128CmpTypeF64x2Ge: - // Without AVX, there's no float Ge instruction, so we swap the register and use Le instead. - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, x1Reg, x2Reg, floatLessThanOrEqualArg) - result = x2Reg - case wazeroir.V128CmpTypeI8x16Eq: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQB, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI8x16Ne: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQB, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI8x16LtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTB, x1Reg, x2Reg) - result = x2Reg - case wazeroir.V128CmpTypeI8x16LtU, wazeroir.V128CmpTypeI8x16GtU: - // Take the unsigned min/max values on each byte on x1 and x2 onto x1Reg. - if v128CmpType == wazeroir.V128CmpTypeI8x16LtU { - c.assembler.CompileRegisterToRegister(amd64.PMINUB, x2Reg, x1Reg) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUB, x2Reg, x1Reg) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQB, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI8x16GtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTB, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI8x16LeS, wazeroir.V128CmpTypeI8x16LeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Copy the value on the src to tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI8x16LeS { - c.assembler.CompileRegisterToRegister(amd64.PMINSB, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMINUB, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQB, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI8x16GeS, wazeroir.V128CmpTypeI8x16GeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI8x16GeS { - c.assembler.CompileRegisterToRegister(amd64.PMAXSB, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUB, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQB, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8Eq: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8Ne: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8LtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTW, x1Reg, x2Reg) - result = x2Reg - case wazeroir.V128CmpTypeI16x8LtU, wazeroir.V128CmpTypeI16x8GtU: - // Take the unsigned min/max values on each byte on x1 and x2 onto x1Reg. - if v128CmpType == wazeroir.V128CmpTypeI16x8LtU { - c.assembler.CompileRegisterToRegister(amd64.PMINUW, x2Reg, x1Reg) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUW, x2Reg, x1Reg) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8GtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTW, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8LeS, wazeroir.V128CmpTypeI16x8LeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Copy the value on the src to tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI16x8LeS { - c.assembler.CompileRegisterToRegister(amd64.PMINSW, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMINUW, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI16x8GeS, wazeroir.V128CmpTypeI16x8GeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI16x8GeS { - c.assembler.CompileRegisterToRegister(amd64.PMAXSW, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUW, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4Eq: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4Ne: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4LtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTD, x1Reg, x2Reg) - result = x2Reg - case wazeroir.V128CmpTypeI32x4LtU, wazeroir.V128CmpTypeI32x4GtU: - // Take the unsigned min/max values on each byte on x1 and x2 onto x1Reg. - if v128CmpType == wazeroir.V128CmpTypeI32x4LtU { - c.assembler.CompileRegisterToRegister(amd64.PMINUD, x2Reg, x1Reg) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUD, x2Reg, x1Reg) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4GtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTD, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4LeS, wazeroir.V128CmpTypeI32x4LeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Copy the value on the src to tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI32x4LeS { - c.assembler.CompileRegisterToRegister(amd64.PMINSD, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMINUD, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI32x4GeS, wazeroir.V128CmpTypeI32x4GeU: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1Reg, tmp) - if v128CmpType == wazeroir.V128CmpTypeI32x4GeS { - c.assembler.CompileRegisterToRegister(amd64.PMAXSD, x2Reg, tmp) - } else { - c.assembler.CompileRegisterToRegister(amd64.PMAXUD, x2Reg, tmp) - } - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI64x2Eq: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQQ, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI64x2Ne: - c.assembler.CompileRegisterToRegister(amd64.PCMPEQQ, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI64x2LtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTQ, x1Reg, x2Reg) - result = x2Reg - case wazeroir.V128CmpTypeI64x2GtS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTQ, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI64x2LeS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTQ, x2Reg, x1Reg) - // Set all bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x2Reg, x2Reg) - // Swap the bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x2Reg, x1Reg) - result = x1Reg - case wazeroir.V128CmpTypeI64x2GeS: - c.assembler.CompileRegisterToRegister(amd64.PCMPGTQ, x1Reg, x2Reg) - // Set all bits on x1Reg register. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, x1Reg, x1Reg) - // Swap the bits on x2Reg register. - c.assembler.CompileRegisterToRegister(amd64.PXOR, x1Reg, x2Reg) - result = x2Reg - } - - c.locationStack.markRegisterUnused(x1Reg, x2Reg) - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128AddSat implements compiler.compileV128AddSat for amd64. -func (c *amd64Compiler) compileV128AddSat(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - switch shape { - case wazeroir.ShapeI8x16: - if signed { - inst = amd64.PADDSB - } else { - inst = amd64.PADDUSB - } - case wazeroir.ShapeI16x8: - if signed { - inst = amd64.PADDSW - } else { - inst = amd64.PADDUSW - } - } - - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128SubSat implements compiler.compileV128SubSat for amd64. -func (c *amd64Compiler) compileV128SubSat(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - switch shape { - case wazeroir.ShapeI8x16: - if signed { - inst = amd64.PSUBSB - } else { - inst = amd64.PSUBUSB - } - case wazeroir.ShapeI16x8: - if signed { - inst = amd64.PSUBSW - } else { - inst = amd64.PSUBUSW - } - } - - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Mul implements compiler.compileV128Mul for amd64. -func (c *amd64Compiler) compileV128Mul(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI16x8: - inst = amd64.PMULLW - case wazeroir.ShapeI32x4: - inst = amd64.PMULLD - case wazeroir.ShapeI64x2: - return c.compileV128MulI64x2() - case wazeroir.ShapeF32x4: - inst = amd64.MULPS - case wazeroir.ShapeF64x2: - inst = amd64.MULPD - } - - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128MulI64x2 implements V128Mul for i64x2. -func (c *amd64Compiler) compileV128MulI64x2() error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - tmp1, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(tmp1) - - tmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Assuming that we have - // x1r = [p1, p2] = [p1_lo, p1_hi, p2_lo, p2_high] - // x2r = [q1, q2] = [q1_lo, q1_hi, q2_lo, q2_high] - // where pN and qN are 64-bit (quad word) lane, and pN_lo, pN_hi, qN_lo and qN_hi are 32-bit (double word) lane. - - // Copy x1's value into tmp1. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1r, tmp1) - // And do the logical right shift by 32-bit on tmp1, which makes tmp1 = [0, p1_high, 0, p2_high] - c.assembler.CompileConstToRegister(amd64.PSRLQ, 32, tmp1) - - // Execute "pmuludq x2r,tmp1", which makes tmp1 = [p1_high*q1_lo, p2_high*q2_lo] where each lane is 64-bit. - c.assembler.CompileRegisterToRegister(amd64.PMULUDQ, x2r, tmp1) - - // Copy x2's value into tmp2. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x2r, tmp2) - // And do the logical right shift by 32-bit on tmp2, which makes tmp2 = [0, q1_high, 0, q2_high] - c.assembler.CompileConstToRegister(amd64.PSRLQ, 32, tmp2) - - // Execute "pmuludq x1r,tmp2", which makes tmp2 = [p1_lo*q1_high, p2_lo*q2_high] where each lane is 64-bit. - c.assembler.CompileRegisterToRegister(amd64.PMULUDQ, x1r, tmp2) - - // Adds tmp1 and tmp2 and do the logical left shift by 32-bit, - // which makes tmp1 = [(p1_lo*q1_high+p1_high*q1_lo)<<32, (p2_lo*q2_high+p2_high*q2_lo)<<32] - c.assembler.CompileRegisterToRegister(amd64.PADDQ, tmp2, tmp1) - c.assembler.CompileConstToRegister(amd64.PSLLQ, 32, tmp1) - - // Execute "pmuludq x2r,x1r", which makes x1r = [p1_lo*q1_lo, p2_lo*q2_lo] where each lane is 64-bit. - c.assembler.CompileRegisterToRegister(amd64.PMULUDQ, x2r, x1r) - - // Finally, we get the result by adding x1r and tmp1, - // which makes x1r = [(p1_lo*q1_high+p1_high*q1_lo)<<32+p1_lo*q1_lo, (p2_lo*q2_high+p2_high*q2_lo)<<32+p2_lo*q2_lo] - c.assembler.CompileRegisterToRegister(amd64.PADDQ, tmp1, x1r) - - c.locationStack.markRegisterUnused(x2r, tmp1) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -// compileV128Div implements compiler.compileV128Div for amd64. -func (c *amd64Compiler) compileV128Div(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - inst = amd64.DIVPS - case wazeroir.ShapeF64x2: - inst = amd64.DIVPD - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Neg implements compiler.compileV128Neg for amd64. -func (c *amd64Compiler) compileV128Neg(o *wazeroir.UnionOperation) error { - shape := o.B1 - if shape <= wazeroir.ShapeI64x2 { - return c.compileV128NegInt(shape) - } else { - return c.compileV128NegFloat(shape) - } -} - -// compileV128NegInt implements compiler.compileV128Neg for integer lanes. -func (c *amd64Compiler) compileV128NegInt(s wazeroir.Shape) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var subInst asm.Instruction - switch s { - case wazeroir.ShapeI8x16: - subInst = amd64.PSUBB - case wazeroir.ShapeI16x8: - subInst = amd64.PSUBW - case wazeroir.ShapeI32x4: - subInst = amd64.PSUBD - case wazeroir.ShapeI64x2: - subInst = amd64.PSUBQ - } - - c.assembler.CompileRegisterToRegister(amd64.PXOR, result, result) - c.assembler.CompileRegisterToRegister(subInst, v.register, result) - - c.locationStack.markRegisterUnused(v.register) - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128NegInt implements compiler.compileV128Neg for float lanes. -func (c *amd64Compiler) compileV128NegFloat(s wazeroir.Shape) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var leftShiftInst, xorInst asm.Instruction - var leftShiftAmount asm.ConstantValue - if s == wazeroir.ShapeF32x4 { - leftShiftInst, leftShiftAmount, xorInst = amd64.PSLLD, 31, amd64.XORPS - } else { - leftShiftInst, leftShiftAmount, xorInst = amd64.PSLLQ, 63, amd64.XORPD - } - - // Clear all bits on tmp. - c.assembler.CompileRegisterToRegister(amd64.XORPS, tmp, tmp) - // Set all bits on tmp by CMPPD with arg=0 (== pseudo CMPEQPD instruction). - // See https://www.felixcloutier.com/x86/cmpps - // - // Note: if we do not clear all the bits ^ with XORPS, this might end up not setting ones on some lane - // if the lane is NaN. - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPD, tmp, tmp, 0x8) - // Do the left shift on each lane to set only the most significant bit in each. - c.assembler.CompileConstToRegister(leftShiftInst, leftShiftAmount, tmp) - // Get the negated result by XOR on each lane with tmp. - c.assembler.CompileRegisterToRegister(xorInst, tmp, v.register) - - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return nil -} - -// compileV128Sqrt implements compiler.compileV128Sqrt for amd64. -func (c *amd64Compiler) compileV128Sqrt(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeF64x2: - inst = amd64.SQRTPD - case wazeroir.ShapeF32x4: - inst = amd64.SQRTPS - } - - c.assembler.CompileRegisterToRegister(inst, v.register, v.register) - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return nil -} - -// compileV128Abs implements compiler.compileV128Abs for amd64. -func (c *amd64Compiler) compileV128Abs(o *wazeroir.UnionOperation) error { - shape := o.B1 - if shape == wazeroir.ShapeI64x2 { - return c.compileV128AbsI64x2() - } - - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - result := v.register - switch shape { - case wazeroir.ShapeI8x16: - c.assembler.CompileRegisterToRegister(amd64.PABSB, result, result) - case wazeroir.ShapeI16x8: - c.assembler.CompileRegisterToRegister(amd64.PABSW, result, result) - case wazeroir.ShapeI32x4: - c.assembler.CompileRegisterToRegister(amd64.PABSD, result, result) - case wazeroir.ShapeF32x4: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Set all bits on tmp. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, tmp) - // Shift right packed single floats by 1 to clear the sign bits. - c.assembler.CompileConstToRegister(amd64.PSRLD, 1, tmp) - // Clear the sign bit of vr. - c.assembler.CompileRegisterToRegister(amd64.ANDPS, tmp, result) - case wazeroir.ShapeF64x2: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Set all bits on tmp. - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, tmp) - // Shift right packed single floats by 1 to clear the sign bits. - c.assembler.CompileConstToRegister(amd64.PSRLQ, 1, tmp) - // Clear the sign bit of vr. - c.assembler.CompileRegisterToRegister(amd64.ANDPD, tmp, result) - } - - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128AbsI64x2 implements compileV128Abs for i64x2 lanes. -func (c *amd64Compiler) compileV128AbsI64x2() error { - // See https://www.felixcloutier.com/x86/blendvpd - const blendMaskReg = amd64.RegX0 - c.onValueReleaseRegisterToStack(blendMaskReg) - c.locationStack.markRegisterUsed(blendMaskReg) - - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - if vr == blendMaskReg { - return errors.New("BUG: X0 must not be used") - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.locationStack.markRegisterUsed(tmp) - - // Copy the value to tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp) - - // Clear all bits on blendMaskReg. - c.assembler.CompileRegisterToRegister(amd64.PXOR, blendMaskReg, blendMaskReg) - // Subtract vr from blendMaskReg. - c.assembler.CompileRegisterToRegister(amd64.PSUBQ, vr, blendMaskReg) - // Copy the subtracted value ^^ back into vr. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, blendMaskReg, vr) - - c.assembler.CompileRegisterToRegister(amd64.BLENDVPD, tmp, vr) - - c.locationStack.markRegisterUnused(blendMaskReg, tmp) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -var ( - popcntMask = [16]byte{ - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - } - // popcntTable holds each index's Popcnt, for example popcntTable[5] holds popcnt(0x05). - popcntTable = [16]byte{ - 0x00, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x03, - 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04, - } -) - -// compileV128Popcnt implements compiler.compileV128Popcnt for amd64. -func (c *amd64Compiler) compileV128Popcnt(operation *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - tmp1, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(tmp1) - - tmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(tmp2) - - tmp3, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Read the popcntMask into tmp1, and we have - // tmp1 = [0xf, ..., 0xf] - if err := c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(popcntMask[:]), tmp1); err != nil { - return err - } - - // Copy the original value into tmp2. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp2) - - // Given that we have: - // v = [b1, ..., b16] where bn = hn:ln and hn and ln are higher and lower 4-bits of bn. - // - // Take PAND on tmp1 and tmp2, and we have - // tmp2 = [l1, ..., l16]. - c.assembler.CompileRegisterToRegister(amd64.PAND, tmp1, tmp2) - - // Do logical (packed word) right shift by 4 on vr and PAND with vr and tmp1, meaning that we have - // vr = [h1, ...., h16]. - c.assembler.CompileConstToRegister(amd64.PSRLW, 4, vr) - c.assembler.CompileRegisterToRegister(amd64.PAND, tmp1, vr) - - // Read the popcntTable into tmp1, and we have - // tmp1 = [0x00, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x03, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04] - if err := c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(popcntTable[:]), tmp1); err != nil { - return err - } - - // Copy the tmp1 into tmp3, and we have - // tmp3 = [0x00, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x03, 0x01, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x04] - c.assembler.CompileRegisterToRegister(amd64.MOVDQU, tmp1, tmp3) - - // tmp3 = [popcnt(l1), ..., popcnt(l16)]. - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, tmp2, tmp3) - - // tmp1 = [popcnt(h1), ..., popcnt(h16)]. - c.assembler.CompileRegisterToRegister(amd64.PSHUFB, vr, tmp1) - - // vr = tmp1 = [popcnt(h1), ..., popcnt(h16)]. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, tmp1, vr) - - // vr += tmp3 = [popcnt(h1)+popcnt(l1), ..., popcnt(h16)+popcnt(l16)] = [popcnt(b1), ..., popcnt(b16)]. - c.assembler.CompileRegisterToRegister(amd64.PADDB, tmp3, vr) - - c.locationStack.markRegisterUnused(tmp1, tmp2) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128Min implements compiler.compileV128Min for amd64. -func (c *amd64Compiler) compileV128Min(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - shape := o.B1 - if shape >= wazeroir.ShapeF32x4 { - return c.compileV128FloatMinImpl(shape == wazeroir.ShapeF32x4, x1.register, x2.register) - } - - signed := o.B3 - var inst asm.Instruction - switch shape { - case wazeroir.ShapeI8x16: - if signed { - inst = amd64.PMINSB - } else { - inst = amd64.PMINUB - } - case wazeroir.ShapeI16x8: - if signed { - inst = amd64.PMINSW - } else { - inst = amd64.PMINUW - } - case wazeroir.ShapeI32x4: - if signed { - inst = amd64.PMINSD - } else { - inst = amd64.PMINUD - } - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128FloatMinImpl implements compiler.compileV128Min for float lanes. -func (c *amd64Compiler) compileV128FloatMinImpl(is32bit bool, x1r, x2r asm.Register) error { - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var min, cmp, andn, or, srl /* shit right logical */ asm.Instruction - var shiftNumToInverseNaN asm.ConstantValue - if is32bit { - min, cmp, andn, or, srl, shiftNumToInverseNaN = amd64.MINPS, amd64.CMPPS, amd64.ANDNPS, amd64.ORPS, amd64.PSRLD, 0xa - } else { - min, cmp, andn, or, srl, shiftNumToInverseNaN = amd64.MINPD, amd64.CMPPD, amd64.ANDNPD, amd64.ORPD, amd64.PSRLQ, 0xd - } - - // Let v1 and v2 be the operand values on x1r and x2r at this point. - - // Copy the value into tmp: tmp=v1 - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1r, tmp) - // tmp=min(v1, v2) - c.assembler.CompileRegisterToRegister(min, x2r, tmp) - // x2r=min(v2, v1) - c.assembler.CompileRegisterToRegister(min, x1r, x2r) - // x1r=min(v2, v1) - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x2r, x1r) - - // x2r = -0 if (v1 == -0 || x2 == -0) && v1 != NaN && v2 !=NaN - // NaN if v1 == NaN || v2 == NaN - // min(v1, v2) otherwise - c.assembler.CompileRegisterToRegister(or, tmp, x2r) - // x1r = 0^ (set all bits) if v1 == NaN || v2 == NaN - // 0 otherwise - c.assembler.CompileRegisterToRegisterWithArg(cmp, tmp, x1r, 3) - // x2r = -0 if (v1 == -0 || x2 == -0) && v1 != NaN && v2 !=NaN - // ^0 if v1 == NaN || v2 == NaN - // min(v1, v2) otherwise - c.assembler.CompileRegisterToRegister(or, x1r, x2r) - // x1r = set all bits on the mantissa bits - // 0 otherwise - c.assembler.CompileConstToRegister(srl, shiftNumToInverseNaN, x1r) - // x1r = x2r and !x1r - // = -0 if (v1 == -0 || x2 == -0) && v1 != NaN && v2 !=NaN - // set all bits on exponential and sign bit (== NaN) if v1 == NaN || v2 == NaN - // min(v1, v2) otherwise - c.assembler.CompileRegisterToRegister(andn, x2r, x1r) - - c.locationStack.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -// compileV128Max implements compiler.compileV128Max for amd64. -func (c *amd64Compiler) compileV128Max(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - shape := o.B1 - if shape >= wazeroir.ShapeF32x4 { - return c.compileV128FloatMaxImpl(shape == wazeroir.ShapeF32x4, x1.register, x2.register) - } - - signed := o.B3 - var inst asm.Instruction - switch shape { - case wazeroir.ShapeI8x16: - if signed { - inst = amd64.PMAXSB - } else { - inst = amd64.PMAXUB - } - case wazeroir.ShapeI16x8: - if signed { - inst = amd64.PMAXSW - } else { - inst = amd64.PMAXUW - } - case wazeroir.ShapeI32x4: - if signed { - inst = amd64.PMAXSD - } else { - inst = amd64.PMAXUD - } - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128FloatMaxImpl implements compiler.compileV128Max for float lanes. -func (c *amd64Compiler) compileV128FloatMaxImpl(is32bit bool, x1r, x2r asm.Register) error { - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - var max, cmp, andn, or, xor, sub, srl /* shit right logical */ asm.Instruction - var shiftNumToInverseNaN asm.ConstantValue - if is32bit { - max, cmp, andn, or, xor, sub, srl, shiftNumToInverseNaN = amd64.MAXPS, amd64.CMPPS, amd64.ANDNPS, amd64.ORPS, amd64.XORPS, amd64.SUBPS, amd64.PSRLD, 0xa - } else { - max, cmp, andn, or, xor, sub, srl, shiftNumToInverseNaN = amd64.MAXPD, amd64.CMPPD, amd64.ANDNPD, amd64.ORPD, amd64.XORPD, amd64.SUBPD, amd64.PSRLQ, 0xd - } - - // Let v1 and v2 be the operand values on x1r and x2r at this point. - - // Copy the value into tmp: tmp=v2 - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x2r, tmp) - // tmp=max(v2, v1) - c.assembler.CompileRegisterToRegister(max, x1r, tmp) - // x1r=max(v1, v2) - c.assembler.CompileRegisterToRegister(max, x2r, x1r) - // x2r=max(v1, v2) - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1r, x2r) - - // x2r = -0 if (v1 == -0 && v2 == 0) || (v1 == 0 && v2 == -0) - // 0 if (v1 == 0 && v2 == 0) - // -0 if (v1 == -0 && v2 == -0) - // v1^v2 if v1 == NaN || v2 == NaN - // 0 otherwise - c.assembler.CompileRegisterToRegister(xor, tmp, x2r) - // x1r = -0 if (v1 == -0 && v2 == 0) || (v1 == 0 && v2 == -0) - // 0 if (v1 == 0 && v2 == 0) - // -0 if (v1 == -0 && v2 == -0) - // NaN if v1 == NaN || v2 == NaN - // max(v1, v2) otherwise - c.assembler.CompileRegisterToRegister(or, x2r, x1r) - // Copy x1r into tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1r, tmp) - // tmp = 0 if (v1 == -0 && v2 == 0) || (v1 == 0 && v2 == -0) || (v1 == 0 && v2 == 0) - // -0 if (v1 == -0 && v2 == -0) - // NaN if v1 == NaN || v2 == NaN - // max(v1, v2) otherwise - // - // Note: -0 - (-0) = 0 (!= -0) in floating point operation. - c.assembler.CompileRegisterToRegister(sub, x2r, tmp) - // x1r = 0^ if v1 == NaN || v2 == NaN - c.assembler.CompileRegisterToRegisterWithArg(cmp, x1r, x1r, 3) - // x1r = set all bits on the mantissa bits - // 0 otherwise - c.assembler.CompileConstToRegister(srl, shiftNumToInverseNaN, x1r) - c.assembler.CompileRegisterToRegister(andn, tmp, x1r) - - c.locationStack.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -// compileV128AvgrU implements compiler.compileV128AvgrU for amd64. -func (c *amd64Compiler) compileV128AvgrU(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - inst = amd64.PAVGB - case wazeroir.ShapeI16x8: - inst = amd64.PAVGW - } - - c.assembler.CompileRegisterToRegister(inst, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Pmin implements compiler.compileV128Pmin for amd64. -func (c *amd64Compiler) compileV128Pmin(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var min asm.Instruction - if o.B1 == wazeroir.ShapeF32x4 { - min = amd64.MINPS - } else { - min = amd64.MINPD - } - - x1r, v2r := x1.register, x2.register - - c.assembler.CompileRegisterToRegister(min, x1r, v2r) - - c.locationStack.markRegisterUnused(x1r) - c.pushVectorRuntimeValueLocationOnRegister(v2r) - return nil -} - -// compileV128Pmax implements compiler.compileV128Pmax for amd64. -func (c *amd64Compiler) compileV128Pmax(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var min asm.Instruction - if o.B1 == wazeroir.ShapeF32x4 { - min = amd64.MAXPS - } else { - min = amd64.MAXPD - } - - x1r, v2r := x1.register, x2.register - - c.assembler.CompileRegisterToRegister(min, x1r, v2r) - - c.locationStack.markRegisterUnused(x1r) - c.pushVectorRuntimeValueLocationOnRegister(v2r) - return nil -} - -// compileV128Ceil implements compiler.compileV128Ceil for amd64. -func (c *amd64Compiler) compileV128Ceil(o *wazeroir.UnionOperation) error { - // See https://www.felixcloutier.com/x86/roundpd - const roundModeCeil = 0x2 - return c.compileV128RoundImpl(o.B1 == wazeroir.ShapeF32x4, roundModeCeil) -} - -// compileV128Floor implements compiler.compileV128Floor for amd64. -func (c *amd64Compiler) compileV128Floor(o *wazeroir.UnionOperation) error { - // See https://www.felixcloutier.com/x86/roundpd - const roundModeFloor = 0x1 - return c.compileV128RoundImpl(o.B1 == wazeroir.ShapeF32x4, roundModeFloor) -} - -// compileV128Trunc implements compiler.compileV128Trunc for amd64. -func (c *amd64Compiler) compileV128Trunc(o *wazeroir.UnionOperation) error { - // See https://www.felixcloutier.com/x86/roundpd - const roundModeTrunc = 0x3 - return c.compileV128RoundImpl(o.B1 == wazeroir.ShapeF32x4, roundModeTrunc) -} - -// compileV128Nearest implements compiler.compileV128Nearest for amd64. -func (c *amd64Compiler) compileV128Nearest(o *wazeroir.UnionOperation) error { - // See https://www.felixcloutier.com/x86/roundpd - const roundModeNearest = 0x0 - return c.compileV128RoundImpl(o.B1 == wazeroir.ShapeF32x4, roundModeNearest) -} - -// compileV128RoundImpl implements compileV128Nearest compileV128Trunc compileV128Floor and compileV128Ceil -// with ROUNDPS (32-bit lane) and ROUNDPD (64-bit lane). -func (c *amd64Compiler) compileV128RoundImpl(is32bit bool, mode byte) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - var round asm.Instruction - if is32bit { - round = amd64.ROUNDPS - } else { - round = amd64.ROUNDPD - } - - c.assembler.CompileRegisterToRegisterWithArg(round, vr, vr, mode) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128Extend implements compiler.compileV128Extend for amd64. -func (c *amd64Compiler) compileV128Extend(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - originShape := o.B1 - signed := o.B2 == 1 - useLow := o.B3 - if !useLow { - // We have to shift the higher 64-bits into the lower ones before the actual extending instruction. - // Shifting right by 0x8 * 8 = 64bits and concatenate itself. - // See https://www.felixcloutier.com/x86/palignr - c.assembler.CompileRegisterToRegisterWithArg(amd64.PALIGNR, v.register, v.register, 0x8) - } - - var extend asm.Instruction - switch originShape { - case wazeroir.ShapeI8x16: - if signed { - extend = amd64.PMOVSXBW - } else { - extend = amd64.PMOVZXBW - } - case wazeroir.ShapeI16x8: - if signed { - extend = amd64.PMOVSXWD - } else { - extend = amd64.PMOVZXWD - } - case wazeroir.ShapeI32x4: - if signed { - extend = amd64.PMOVSXDQ - } else { - extend = amd64.PMOVZXDQ - } - } - - c.assembler.CompileRegisterToRegister(extend, vr, vr) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128ExtMul implements compiler.compileV128ExtMul for amd64. -func (c *amd64Compiler) compileV128ExtMul(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - originShape := o.B1 - signed := o.B2 == 1 - useLow := o.B3 - switch originShape { - case wazeroir.ShapeI8x16: - if !useLow { - // We have to shift the higher 64-bits into the lower ones before the actual extending instruction. - // Shifting right by 0x8 * 8 = 64bits and concatenate itself. - // See https://www.felixcloutier.com/x86/palignr - c.assembler.CompileRegisterToRegisterWithArg(amd64.PALIGNR, x1r, x1r, 0x8) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PALIGNR, x2r, x2r, 0x8) - } - - var ext asm.Instruction - if signed { - ext = amd64.PMOVSXBW - } else { - ext = amd64.PMOVZXBW - } - - // Signed or Zero extend lower half packed bytes to packed words. - c.assembler.CompileRegisterToRegister(ext, x1r, x1r) - c.assembler.CompileRegisterToRegister(ext, x2r, x2r) - - c.assembler.CompileRegisterToRegister(amd64.PMULLW, x2r, x1r) - case wazeroir.ShapeI16x8: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Copy the value on x1r to tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, x1r, tmp) - - // Multiply the values and store the lower 16-bits into x1r. - c.assembler.CompileRegisterToRegister(amd64.PMULLW, x2r, x1r) - if signed { - // Signed multiply the values and store the higher 16-bits into tmp. - c.assembler.CompileRegisterToRegister(amd64.PMULHW, x2r, tmp) - } else { - // Unsigned multiply the values and store the higher 16-bits into tmp. - c.assembler.CompileRegisterToRegister(amd64.PMULHUW, x2r, tmp) - } - - // Unpack lower or higher half of vectors (tmp and x1r) and concatenate them. - if useLow { - c.assembler.CompileRegisterToRegister(amd64.PUNPCKLWD, tmp, x1r) - } else { - c.assembler.CompileRegisterToRegister(amd64.PUNPCKHWD, tmp, x1r) - } - case wazeroir.ShapeI32x4: - var shuffleOrder byte - // Given that the original state of the register is as [v1, v2, v3, v4] where vN = a word, - if useLow { - // This makes the register as [v1, v1, v2, v2] - shuffleOrder = 0b01010000 - } else { - // This makes the register as [v3, v3, v4, v4] - shuffleOrder = 0b11111010 - } - // See https://www.felixcloutier.com/x86/pshufd - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, x1r, x1r, shuffleOrder) - c.assembler.CompileRegisterToRegisterWithArg(amd64.PSHUFD, x2r, x2r, shuffleOrder) - - var mul asm.Instruction - if signed { - mul = amd64.PMULDQ - } else { - mul = amd64.PMULUDQ - } - c.assembler.CompileRegisterToRegister(mul, x2r, x1r) - } - - c.locationStack.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -var q15mulrSatSMask = [16]byte{ - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, -} - -// compileV128Q15mulrSatS implements compiler.compileV128Q15mulrSatS for amd64. -func (c *amd64Compiler) compileV128Q15mulrSatS(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - // See https://github.com/WebAssembly/simd/pull/365 for the following logic. - if err := c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(q15mulrSatSMask[:]), tmp); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PMULHRSW, x2r, x1r) - c.assembler.CompileRegisterToRegister(amd64.PCMPEQW, x1r, tmp) - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, x1r) - - c.locationStack.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -var ( - allOnesI8x16 = [16]byte{0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1} - allOnesI16x8 = [16]byte{0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0} - - extAddPairwiseI16x8uMask = [16 * 2]byte{ - 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, - } -) - -// compileV128ExtAddPairwise implements compiler.compileV128ExtAddPairwise for amd64. -func (c *amd64Compiler) compileV128ExtAddPairwise(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - originShape := o.B1 - signed := o.B3 - switch originShape { - case wazeroir.ShapeI8x16: - allOnesReg, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(allOnesI8x16[:]), allOnesReg); err != nil { - return err - } - - var result asm.Register - // See https://www.felixcloutier.com/x86/pmaddubsw for detail. - if signed { - // Interpret vr's value as signed byte and multiply with one and add pairwise, which results in pairwise - // signed extadd. - c.assembler.CompileRegisterToRegister(amd64.PMADDUBSW, vr, allOnesReg) - result = allOnesReg - } else { - // Interpreter tmp (all ones) as signed byte meaning that all the multiply-add is unsigned. - c.assembler.CompileRegisterToRegister(amd64.PMADDUBSW, allOnesReg, vr) - result = vr - } - - if result != vr { - c.locationStack.markRegisterUnused(vr) - } - c.pushVectorRuntimeValueLocationOnRegister(result) - case wazeroir.ShapeI16x8: - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - if signed { - // See https://www.felixcloutier.com/x86/pmaddwd - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(allOnesI16x8[:]), tmp); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PMADDWD, tmp, vr) - c.pushVectorRuntimeValueLocationOnRegister(vr) - } else { - - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(extAddPairwiseI16x8uMask[:16]), tmp); err != nil { - return err - } - - // Flip the sign bits on vr. - // - // Assuming that vr = [w1, ..., w8], now we have, - // vr[i] = int8(-w1) for i = 0...8 - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, vr) - - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(allOnesI16x8[:]), tmp); err != nil { - return err - } - - // For i = 0,..4 (as this results in i32x4 lanes), now we have - // vr[i] = int32(-wn + -w(n+1)) = int32(-(wn + w(n+1))) - c.assembler.CompileRegisterToRegister(amd64.PMADDWD, tmp, vr) - - // tmp[i] = [0, 0, 1, 0] = int32(math.MaxInt16+1) - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(extAddPairwiseI16x8uMask[16:]), tmp); err != nil { - return err - } - - // vr[i] = int32(-(wn + w(n+1))) + int32(math.MaxInt16+1) = int32((wn + w(n+1))) = uint32(wn + w(n+1)). - c.assembler.CompileRegisterToRegister(amd64.PADDD, tmp, vr) - c.pushVectorRuntimeValueLocationOnRegister(vr) - } - } - return nil -} - -// compileV128FloatPromote implements compiler.compileV128FloatPromote for amd64. -func (c *amd64Compiler) compileV128FloatPromote(*wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - c.assembler.CompileRegisterToRegister(amd64.CVTPS2PD, vr, vr) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128FloatDemote implements compiler.compileV128FloatDemote for amd64. -func (c *amd64Compiler) compileV128FloatDemote(*wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - c.assembler.CompileRegisterToRegister(amd64.CVTPD2PS, vr, vr) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128Dot implements compiler.compileV128Dot for amd64. -func (c *amd64Compiler) compileV128Dot(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileRegisterToRegister(amd64.PMADDWD, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -var fConvertFromIMask = [16]byte{ - 0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -} - -// compileV128FConvertFromI implements compiler.compileV128FConvertFromI for amd64. -func (c *amd64Compiler) compileV128FConvertFromI(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - destinationShape := o.B1 - signed := o.B3 - - switch destinationShape { - case wazeroir.ShapeF32x4: - if signed { - c.assembler.CompileRegisterToRegister(amd64.CVTDQ2PS, vr, vr) - } else { - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Copy the value into tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp) - - // Clear the higher 16-bits of tmp. - c.assembler.CompileConstToRegister(amd64.PSLLD, 0xa, tmp) - c.assembler.CompileConstToRegister(amd64.PSRLD, 0xa, tmp) - - // Subtract the higher 16-bits from vr == clear the lower 16-bits of vr. - c.assembler.CompileRegisterToRegister(amd64.PSUBD, tmp, vr) - - // Convert the lower 16-bits in tmp. - c.assembler.CompileRegisterToRegister(amd64.CVTDQ2PS, tmp, tmp) - - // Left shift by one and convert vr, meaning that halved conversion result of higher 16-bits in vr. - c.assembler.CompileConstToRegister(amd64.PSRLD, 1, vr) - c.assembler.CompileRegisterToRegister(amd64.CVTDQ2PS, vr, vr) - - // Double the converted halved higher 16bits. - c.assembler.CompileRegisterToRegister(amd64.ADDPS, vr, vr) - - // Get the conversion result by add tmp (holding lower 16-bit conversion) into vr. - c.assembler.CompileRegisterToRegister(amd64.ADDPS, tmp, vr) - } - case wazeroir.ShapeF64x2: - if signed { - c.assembler.CompileRegisterToRegister(amd64.CVTDQ2PD, vr, vr) - } else { - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // tmp = [0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, asm.NewStaticConst(fConvertFromIMask[:16]), tmp); err != nil { - return err - } - - // Given that we have vr = [d1, d2, d3, d4], this results in - // vr = [d1, [0x00, 0x00, 0x30, 0x43], d2, [0x00, 0x00, 0x30, 0x43]] - // = [float64(uint32(d1)) + 0x1.0p52, float64(uint32(d2)) + 0x1.0p52] - // ^See https://stackoverflow.com/questions/13269523/can-all-32-bit-ints-be-exactly-represented-as-a-double - c.assembler.CompileRegisterToRegister(amd64.UNPCKLPS, tmp, vr) - - // tmp = [float64(0x1.0p52), float64(0x1.0p52)] - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVDQU, - asm.NewStaticConst(twop52[:]), tmp); err != nil { - return err - } - - // Now, we get the result as - // vr = [float64(uint32(d1)), float64(uint32(d2))] - // because the following equality always satisfies: - // float64(0x1.0p52 + float64(uint32(x))) - float64(0x1.0p52 + float64(uint32(y))) = float64(uint32(x)) - float64(uint32(y)) - c.assembler.CompileRegisterToRegister(amd64.SUBPD, tmp, vr) - } - } - - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} - -// compileV128Narrow implements compiler.compileV128Narrow for amd64. -func (c *amd64Compiler) compileV128Narrow(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var narrow asm.Instruction - originShape := o.B1 - signed := o.B3 - switch originShape { - case wazeroir.ShapeI16x8: - if signed { - narrow = amd64.PACKSSWB - } else { - narrow = amd64.PACKUSWB - } - case wazeroir.ShapeI32x4: - if signed { - narrow = amd64.PACKSSDW - } else { - narrow = amd64.PACKUSDW - } - } - c.assembler.CompileRegisterToRegister(narrow, x2.register, x1.register) - - c.locationStack.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -var ( - // i32sMaxOnF64x2 holds math.MaxInt32(=2147483647.0) on two f64 lanes. - i32sMaxOnF64x2 = [16]byte{ - 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xdf, 0x41, // float64(2147483647.0) - 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xdf, 0x41, // float64(2147483647.0) - } - - // i32sMaxOnF64x2 holds math.MaxUint32(=4294967295.0) on two f64 lanes. - i32uMaxOnF64x2 = [16]byte{ - 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xef, 0x41, // float64(4294967295.0) - 0x00, 0x00, 0xe0, 0xff, 0xff, 0xff, 0xef, 0x41, // float64(4294967295.0) - } - - // twop52 holds two float64(0x1.0p52) on two f64 lanes. 0x1.0p52 is special in the sense that - // with this exponent, the mantissa represents a corresponding uint32 number, and arithmetics, - // like addition or subtraction, the resulted floating point holds exactly the same - // bit representations in 32-bit integer on its mantissa. - // - // Note: the name twop52 is common across various compiler ecosystem. - // E.g. https://github.com/llvm/llvm-project/blob/92ab024f81e5b64e258b7c3baaf213c7c26fcf40/compiler-rt/lib/builtins/floatdidf.c#L28 - // E.g. https://opensource.apple.com/source/clang/clang-425.0.24/src/projects/compiler-rt/lib/floatdidf.c.auto.html - twop52 = [16]byte{ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43, // float64(0x1.0p52) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43, // float64(0x1.0p52) - } -) - -// compileV128ITruncSatFromF implements compiler.compileV128ITruncSatFromF for amd64. -func (c *amd64Compiler) compileV128ITruncSatFromF(o *wazeroir.UnionOperation) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - vr := v.register - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.locationStack.markRegisterUsed(tmp) - - originShape := o.B1 - signed := o.B3 - switch originShape { - case wazeroir.ShapeF32x4: - if signed { - // Copy the value into tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp) - - // Assuming we have vr = [v1, v2, v3, v4]. - // - // Set all bits if lane is not NaN on tmp. - // tmp[i] = 0xffffffff if vi != NaN - // = 0 if vi == NaN - c.assembler.CompileRegisterToRegister(amd64.CMPEQPS, tmp, tmp) - - // Clear NaN lanes on vr, meaning that - // vr[i] = vi if vi != NaN - // 0 if vi == NaN - c.assembler.CompileRegisterToRegister(amd64.ANDPS, tmp, vr) - - // tmp[i] = ^vi if vi != NaN - // = 0xffffffff if vi == NaN - // which means that tmp[i] & 0x80000000 != 0 if and only if vi is negative. - c.assembler.CompileRegisterToRegister(amd64.PXOR, vr, tmp) - - // vr[i] = int32(vi) if vi != NaN and vr is not overflowing. - // = 0x80000000 if vi != NaN and vr is overflowing (See https://www.felixcloutier.com/x86/cvttps2dq) - // = 0 if vi == NaN - c.assembler.CompileRegisterToRegister(amd64.CVTTPS2DQ, vr, vr) - - // Below, we have to convert 0x80000000 into 0x7FFFFFFF for positive overflowing lane. - // - // tmp[i] = 0x80000000 if vi is positive - // = any satisfying any&0x80000000 = 0 if vi is negative or zero. - c.assembler.CompileRegisterToRegister(amd64.PAND, vr, tmp) - - // Arithmetic right shifting tmp by 31, meaning that we have - // tmp[i] = 0xffffffff if vi is positive, 0 otherwise. - c.assembler.CompileConstToRegister(amd64.PSRAD, 0x1f, tmp) - - // Flipping 0x80000000 if vi is positive, otherwise keep intact. - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, vr) - } else { - tmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // See https://github.com/bytecodealliance/wasmtime/pull/2440 - // Note: even v8 doesn't seem to have support for this i32x4.tranc_sat_f32x4_u. - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp) - c.assembler.CompileRegisterToRegister(amd64.MAXPS, tmp, vr) - c.assembler.CompileRegisterToRegister(amd64.PCMPEQD, tmp, tmp) - c.assembler.CompileConstToRegister(amd64.PSRLD, 0x1, tmp) - c.assembler.CompileRegisterToRegister(amd64.CVTDQ2PS, tmp, tmp) - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp2) - c.assembler.CompileRegisterToRegister(amd64.CVTTPS2DQ, vr, vr) - c.assembler.CompileRegisterToRegister(amd64.SUBPS, tmp, tmp2) - c.assembler.CompileRegisterToRegisterWithArg(amd64.CMPPS, tmp2, tmp, 0x2) // == CMPLEPS - c.assembler.CompileRegisterToRegister(amd64.CVTTPS2DQ, tmp2, tmp2) - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp2) - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp) - c.assembler.CompileRegisterToRegister(amd64.PMAXSD, tmp, tmp2) - c.assembler.CompileRegisterToRegister(amd64.PADDD, tmp2, vr) - } - case wazeroir.ShapeF64x2: - tmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - if signed { - // Copy the value into tmp. - c.assembler.CompileRegisterToRegister(amd64.MOVDQA, vr, tmp) - - // Set all bits for non-NaN lanes, zeros otherwise. - // I.e. tmp[i] = 0xffffffff_ffffffff if vi != NaN, 0 otherwise. - c.assembler.CompileRegisterToRegister(amd64.CMPEQPD, tmp, tmp) - - // Load the 2147483647 into tmp2's each lane. - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVUPD, asm.NewStaticConst(i32sMaxOnF64x2[:]), tmp2); err != nil { - return err - } - - // tmp[i] = 2147483647 if vi != NaN, 0 otherwise. - c.assembler.CompileRegisterToRegister(amd64.ANDPS, tmp2, tmp) - - // MINPD returns the source register's value as-is, so we have - // vr[i] = vi if vi != NaN - // = 0 if vi == NaN - c.assembler.CompileRegisterToRegister(amd64.MINPD, tmp, vr) - - c.assembler.CompileRegisterToRegister(amd64.CVTTPD2DQ, vr, vr) - } else { - // Clears all bits on tmp. - c.assembler.CompileRegisterToRegister(amd64.PXOR, tmp, tmp) - - // vr[i] = vi if vi != NaN && vi > 0 - // = 0 if vi == NaN || vi <= 0 - c.assembler.CompileRegisterToRegister(amd64.MAXPD, tmp, vr) - - // tmp2[i] = float64(math.MaxUint32) = math.MaxUint32 - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVUPD, asm.NewStaticConst(i32uMaxOnF64x2[:]), tmp2); err != nil { - return err - } - - // vr[i] = vi if vi != NaN && vi > 0 && vi <= math.MaxUint32 - // = 0 otherwise - c.assembler.CompileRegisterToRegister(amd64.MINPD, tmp2, vr) - - // Round the floating points into integer. - c.assembler.CompileRegisterToRegisterWithArg(amd64.ROUNDPD, vr, vr, 0x3) - - // tmp2[i] = float64(0x1.0p52) - if err = c.assembler.CompileStaticConstToRegister(amd64.MOVUPD, asm.NewStaticConst(twop52[:]), tmp2); err != nil { - return err - } - - // vr[i] = float64(0x1.0p52) + float64(uint32(vi)) if vi != NaN && vi > 0 && vi <= math.MaxUint32 - // = 0 otherwise - // - // This means that vr[i] holds exactly the same bit of uint32(vi) in its lower 32-bits. - c.assembler.CompileRegisterToRegister(amd64.ADDPD, tmp2, vr) - - // At this point, we have - // vr = [uint32(v0), float64(0x1.0p52), uint32(v1), float64(0x1.0p52)] - // tmp = [0, 0, 0, 0] - // as 32x4 lanes. Therefore, SHUFPS with 0b00_00_10_00 results in - // vr = [vr[00], vr[10], tmp[00], tmp[00]] = [vr[00], vr[10], 0, 0] - // meaning that for i = 0 and 1, we have - // vr[i] = uint32(vi) if vi != NaN && vi > 0 && vi <= math.MaxUint32 - // = 0 otherwise. - c.assembler.CompileRegisterToRegisterWithArg(amd64.SHUFPS, tmp, vr, 0b00_00_10_00) - } - } - - c.locationStack.markRegisterUnused(tmp) - c.pushVectorRuntimeValueLocationOnRegister(vr) - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_arm64.go b/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_arm64.go deleted file mode 100644 index 70aa4a0190..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/compiler/impl_vec_arm64.go +++ /dev/null @@ -1,1592 +0,0 @@ -package compiler - -import ( - "github.com/tetratelabs/wazero/internal/asm" - "github.com/tetratelabs/wazero/internal/asm/arm64" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// compileV128Const implements compiler.compileV128Const for arm64. -func (c *arm64Compiler) compileV128Const(o *wazeroir.UnionOperation) error { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - - lo, hi := o.U1, o.U2 - - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Moves the lower 64-bits as a scalar float. - intReg := arm64ReservedRegisterForTemporary - if lo == 0 { - intReg = arm64.RegRZR - } else { - c.assembler.CompileConstToRegister(arm64.MOVD, int64(lo), arm64ReservedRegisterForTemporary) - } - c.assembler.CompileRegisterToRegister(arm64.FMOVD, intReg, result) - - // Then, insert the higher bits with INS(vector,general). - intReg = arm64ReservedRegisterForTemporary - if hi == 0 { - intReg = arm64.RegRZR - } else { - c.assembler.CompileConstToRegister(arm64.MOVD, int64(hi), arm64ReservedRegisterForTemporary) - } - // "ins Vn.D[1], intReg" - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, intReg, result, arm64.VectorArrangementD, 1) - - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128Add implements compiler.compileV128Add for arm64. -func (c *arm64Compiler) compileV128Add(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - var arr arm64.VectorArrangement - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - inst = arm64.VADD - arr = arm64.VectorArrangement16B - case wazeroir.ShapeI16x8: - inst = arm64.VADD - arr = arm64.VectorArrangement8H - case wazeroir.ShapeI32x4: - inst = arm64.VADD - arr = arm64.VectorArrangement4S - case wazeroir.ShapeI64x2: - inst = arm64.VADD - arr = arm64.VectorArrangement2D - case wazeroir.ShapeF32x4: - inst = arm64.VFADDS - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - inst = arm64.VFADDD - arr = arm64.VectorArrangement2D - } - - c.assembler.CompileVectorRegisterToVectorRegister(inst, x1r, x2r, arr, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.pushVectorRuntimeValueLocationOnRegister(x2r) - c.markRegisterUnused(x1r) - return nil -} - -// compileV128Sub implements compiler.compileV128Sub for arm64. -func (c *arm64Compiler) compileV128Sub(o *wazeroir.UnionOperation) (err error) { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - var arr arm64.VectorArrangement - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - inst = arm64.VSUB - arr = arm64.VectorArrangement16B - case wazeroir.ShapeI16x8: - inst = arm64.VSUB - arr = arm64.VectorArrangement8H - case wazeroir.ShapeI32x4: - inst = arm64.VSUB - arr = arm64.VectorArrangement4S - case wazeroir.ShapeI64x2: - inst = arm64.VSUB - arr = arm64.VectorArrangement2D - case wazeroir.ShapeF32x4: - inst = arm64.VFSUBS - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - inst = arm64.VFSUBD - arr = arm64.VectorArrangement2D - } - - c.assembler.CompileVectorRegisterToVectorRegister(inst, x2r, x1r, arr, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.pushVectorRuntimeValueLocationOnRegister(x1r) - c.markRegisterUnused(x2r) - return -} - -// compileV128Load implements compiler.compileV128Load for arm64. -func (c *arm64Compiler) compileV128Load(o *wazeroir.UnionOperation) (err error) { - if err := c.maybeCompileMoveTopConditionalToGeneralPurposeRegister(); err != nil { - return err - } - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - offset := uint32(o.U2) - loadType := wazeroir.V128LoadType(o.B1) - - switch loadType { - case wazeroir.V128LoadType128: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 16) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementQ, - ) - case wazeroir.V128LoadType8x8s: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.SSHLL, result, result, - arm64.VectorArrangement8B, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType8x8u: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.USHLL, result, result, - arm64.VectorArrangement8B, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType16x4s: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.SSHLL, result, result, - arm64.VectorArrangement4H, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType16x4u: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.USHLL, result, result, - arm64.VectorArrangement4H, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType32x2s: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.SSHLL, result, result, - arm64.VectorArrangement2S, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType32x2u: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.USHLL, result, result, - arm64.VectorArrangement2S, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128LoadType8Splat: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 1) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, offset) - c.assembler.CompileMemoryToVectorRegister(arm64.LD1R, offset, 0, result, arm64.VectorArrangement16B) - case wazeroir.V128LoadType16Splat: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 2) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, offset) - c.assembler.CompileMemoryToVectorRegister(arm64.LD1R, offset, 0, result, arm64.VectorArrangement8H) - case wazeroir.V128LoadType32Splat: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 4) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, offset) - c.assembler.CompileMemoryToVectorRegister(arm64.LD1R, offset, 0, result, arm64.VectorArrangement4S) - case wazeroir.V128LoadType64Splat: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileRegisterToRegister(arm64.ADD, arm64ReservedRegisterForMemory, offset) - c.assembler.CompileMemoryToVectorRegister(arm64.LD1R, offset, 0, result, arm64.VectorArrangement2D) - case wazeroir.V128LoadType32zero: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 4) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementS, - ) - case wazeroir.V128LoadType64zero: - offset, err := c.compileMemoryAccessOffsetSetup(offset, 8) - if err != nil { - return err - } - c.assembler.CompileMemoryWithRegisterOffsetToVectorRegister(arm64.VMOV, - arm64ReservedRegisterForMemory, offset, result, arm64.VectorArrangementD, - ) - } - - c.pushVectorRuntimeValueLocationOnRegister(result) - return -} - -// compileV128LoadLane implements compiler.compileV128LoadLane for arm64. -func (c *arm64Compiler) compileV128LoadLane(o *wazeroir.UnionOperation) (err error) { - targetVector := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(targetVector); err != nil { - return - } - - laneSize, laneIndex := o.B1, o.B2 - offset := uint32(o.U2) - - targetSizeInBytes := int64(laneSize / 8) - source, err := c.compileMemoryAccessOffsetSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - var loadInst asm.Instruction - var arr arm64.VectorArrangement - switch laneSize { - case 8: - arr = arm64.VectorArrangementB - loadInst = arm64.LDRB - case 16: - arr = arm64.VectorArrangementH - loadInst = arm64.LDRH - case 32: - loadInst = arm64.LDRW - arr = arm64.VectorArrangementS - case 64: - loadInst = arm64.LDRD - arr = arm64.VectorArrangementD - } - - c.assembler.CompileMemoryWithRegisterOffsetToRegister(loadInst, arm64ReservedRegisterForMemory, source, source) - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, source, targetVector.register, arr, arm64.VectorIndex(laneIndex)) - - c.pushVectorRuntimeValueLocationOnRegister(targetVector.register) - c.locationStack.markRegisterUnused(source) - return -} - -// compileV128Store implements compiler.compileV128Store for arm64. -func (c *arm64Compiler) compileV128Store(o *wazeroir.UnionOperation) (err error) { - v := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(v); err != nil { - return - } - - const targetSizeInBytes = 16 - offset := uint32(o.U2) - offsetReg, err := c.compileMemoryAccessOffsetSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - c.assembler.CompileVectorRegisterToMemoryWithRegisterOffset(arm64.VMOV, - v.register, arm64ReservedRegisterForMemory, offsetReg, arm64.VectorArrangementQ) - - c.markRegisterUnused(v.register) - return -} - -// compileV128StoreLane implements compiler.compileV128StoreLane for arm64. -func (c *arm64Compiler) compileV128StoreLane(o *wazeroir.UnionOperation) (err error) { - var arr arm64.VectorArrangement - var storeInst asm.Instruction - laneSize := o.B1 - laneIndex := o.B2 - offset := uint32(o.U2) - switch laneSize { - case 8: - storeInst = arm64.STRB - arr = arm64.VectorArrangementB - case 16: - storeInst = arm64.STRH - arr = arm64.VectorArrangementH - case 32: - storeInst = arm64.STRW - arr = arm64.VectorArrangementS - case 64: - storeInst = arm64.STRD - arr = arm64.VectorArrangementD - } - - v := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(v); err != nil { - return - } - - targetSizeInBytes := int64(laneSize / 8) - offsetReg, err := c.compileMemoryAccessOffsetSetup(offset, targetSizeInBytes) - if err != nil { - return err - } - - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v.register, arm64ReservedRegisterForTemporary, arr, - arm64.VectorIndex(laneIndex)) - - c.assembler.CompileRegisterToMemoryWithRegisterOffset(storeInst, - arm64ReservedRegisterForTemporary, arm64ReservedRegisterForMemory, offsetReg) - - c.locationStack.markRegisterUnused(v.register) - return -} - -// compileV128ExtractLane implements compiler.compileV128ExtractLane for arm64. -func (c *arm64Compiler) compileV128ExtractLane(o *wazeroir.UnionOperation) (err error) { - v := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(v); err != nil { - return - } - - shape := o.B1 - laneIndex := o.B2 - signed := o.B3 - switch shape { - case wazeroir.ShapeI8x16: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - var inst asm.Instruction - if signed { - inst = arm64.SMOV32 - } else { - inst = arm64.UMOV - } - c.assembler.CompileVectorRegisterToRegister(inst, v.register, result, - arm64.VectorArrangementB, arm64.VectorIndex(laneIndex)) - - c.locationStack.markRegisterUnused(v.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - case wazeroir.ShapeI16x8: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - var inst asm.Instruction - if signed { - inst = arm64.SMOV32 - } else { - inst = arm64.UMOV - } - c.assembler.CompileVectorRegisterToRegister(inst, v.register, result, - arm64.VectorArrangementH, arm64.VectorIndex(laneIndex)) - - c.locationStack.markRegisterUnused(v.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - case wazeroir.ShapeI32x4: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v.register, result, - arm64.VectorArrangementS, arm64.VectorIndex(laneIndex)) - - c.locationStack.markRegisterUnused(v.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - case wazeroir.ShapeI64x2: - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v.register, result, - arm64.VectorArrangementD, arm64.VectorIndex(laneIndex)) - - c.locationStack.markRegisterUnused(v.register) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI64) - case wazeroir.ShapeF32x4: - c.assembler.CompileVectorRegisterToVectorRegister(arm64.INSELEM, v.register, v.register, - arm64.VectorArrangementS, arm64.VectorIndex(laneIndex), 0) - c.pushRuntimeValueLocationOnRegister(v.register, runtimeValueTypeF32) - case wazeroir.ShapeF64x2: - c.assembler.CompileVectorRegisterToVectorRegister(arm64.INSELEM, v.register, v.register, - arm64.VectorArrangementD, arm64.VectorIndex(laneIndex), 0) - c.pushRuntimeValueLocationOnRegister(v.register, runtimeValueTypeF64) - } - return -} - -// compileV128ReplaceLane implements compiler.compileV128ReplaceLane for arm64. -func (c *arm64Compiler) compileV128ReplaceLane(o *wazeroir.UnionOperation) (err error) { - origin := c.locationStack.pop() - if err = c.compileEnsureOnRegister(origin); err != nil { - return - } - - vector := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(vector); err != nil { - return - } - - shape := o.B1 - laneIndex := o.B2 - switch shape { - case wazeroir.ShapeI8x16: - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, origin.register, vector.register, - arm64.VectorArrangementB, arm64.VectorIndex(laneIndex)) - case wazeroir.ShapeI16x8: - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, origin.register, vector.register, - arm64.VectorArrangementH, arm64.VectorIndex(laneIndex)) - case wazeroir.ShapeI32x4: - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, origin.register, vector.register, - arm64.VectorArrangementS, arm64.VectorIndex(laneIndex)) - case wazeroir.ShapeI64x2: - c.assembler.CompileRegisterToVectorRegister(arm64.INSGEN, origin.register, vector.register, - arm64.VectorArrangementD, arm64.VectorIndex(laneIndex)) - case wazeroir.ShapeF32x4: - c.assembler.CompileVectorRegisterToVectorRegister(arm64.INSELEM, origin.register, vector.register, - arm64.VectorArrangementS, 0, arm64.VectorIndex(laneIndex)) - case wazeroir.ShapeF64x2: - c.assembler.CompileVectorRegisterToVectorRegister(arm64.INSELEM, origin.register, vector.register, - arm64.VectorArrangementD, 0, arm64.VectorIndex(laneIndex)) - } - - c.locationStack.markRegisterUnused(origin.register) - c.pushVectorRuntimeValueLocationOnRegister(vector.register) - return -} - -// compileV128Splat implements compiler.compileV128Splat for arm64. -func (c *arm64Compiler) compileV128Splat(o *wazeroir.UnionOperation) (err error) { - origin := c.locationStack.pop() - if err = c.compileEnsureOnRegister(origin); err != nil { - return - } - - var result asm.Register - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return - } - c.assembler.CompileRegisterToVectorRegister(arm64.DUPGEN, origin.register, result, - arm64.VectorArrangement16B, arm64.VectorIndexNone) - case wazeroir.ShapeI16x8: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return - } - c.assembler.CompileRegisterToVectorRegister(arm64.DUPGEN, origin.register, result, - arm64.VectorArrangement8H, arm64.VectorIndexNone) - case wazeroir.ShapeI32x4: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return - } - c.assembler.CompileRegisterToVectorRegister(arm64.DUPGEN, origin.register, result, - arm64.VectorArrangement4S, arm64.VectorIndexNone) - case wazeroir.ShapeI64x2: - result, err = c.allocateRegister(registerTypeVector) - if err != nil { - return - } - c.assembler.CompileRegisterToVectorRegister(arm64.DUPGEN, origin.register, result, - arm64.VectorArrangement2D, arm64.VectorIndexNone) - case wazeroir.ShapeF32x4: - result = origin.register - c.assembler.CompileVectorRegisterToVectorRegister(arm64.DUPELEM, origin.register, result, - arm64.VectorArrangementS, 0, arm64.VectorIndexNone) - case wazeroir.ShapeF64x2: - result = origin.register - c.assembler.CompileVectorRegisterToVectorRegister(arm64.DUPELEM, origin.register, result, - arm64.VectorArrangementD, 0, arm64.VectorIndexNone) - } - - c.locationStack.markRegisterUnused(origin.register) - c.pushVectorRuntimeValueLocationOnRegister(result) - return -} - -func (c *arm64Compiler) onValueReleaseRegisterToStack(reg asm.Register) { - for i := uint64(0); i < c.locationStack.sp; i++ { - prevValue := &c.locationStack.stack[i] - if prevValue.register == reg { - c.compileReleaseRegisterToStack(prevValue) - break - } - } -} - -// compileV128Shuffle implements compiler.compileV128Shuffle for arm64. -func (c *arm64Compiler) compileV128Shuffle(o *wazeroir.UnionOperation) (err error) { - // Shuffle needs two operands (v, w) must be next to each other. - // For simplicity, we use V29 for v and V30 for w values respectively. - const vReg, wReg = arm64.RegV29, arm64.RegV30 - - // Ensures that w value is placed on wReg. - w := c.locationStack.popV128() - if w.register != wReg { - // If wReg is already in use, save the value onto the stack. - c.onValueReleaseRegisterToStack(wReg) - - if w.onRegister() { - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VORR, - w.register, w.register, wReg, arm64.VectorArrangement16B) - // We no longer use the old register. - c.markRegisterUnused(w.register) - } else { // on stack - w.setRegister(wReg) - c.compileLoadValueOnStackToRegister(w) - } - } - - // Ensures that v value is placed on wReg. - v := c.locationStack.popV128() - if v.register != vReg { - // If vReg is already in use, save the value onto the stack. - c.onValueReleaseRegisterToStack(vReg) - - if v.onRegister() { - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VORR, - v.register, v.register, vReg, arm64.VectorArrangement16B) - // We no longer use the old register. - c.markRegisterUnused(v.register) - } else { // on stack - v.setRegister(vReg) - c.compileLoadValueOnStackToRegister(v) - } - } - - c.locationStack.markRegisterUsed(vReg, wReg) - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - lanes := make([]byte, len(o.Us)) - for i, lane := range o.Us { - lanes[i] = byte(lane) - } - c.assembler.CompileStaticConstToVectorRegister(arm64.VMOV, asm.NewStaticConst(lanes), result, arm64.VectorArrangementQ) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.TBL2, vReg, result, arm64.VectorArrangement16B, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.locationStack.markRegisterUnused(vReg, wReg) - c.pushVectorRuntimeValueLocationOnRegister(result) - return -} - -// compileV128Swizzle implements compiler.compileV128Swizzle for arm64. -func (c *arm64Compiler) compileV128Swizzle(*wazeroir.UnionOperation) (err error) { - indexVec := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(indexVec); err != nil { - return - } - baseVec := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(baseVec); err != nil { - return - } - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.TBL1, baseVec.register, indexVec.register, - arm64.VectorArrangement16B, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.markRegisterUnused(baseVec.register) - c.pushVectorRuntimeValueLocationOnRegister(indexVec.register) - return -} - -// compileV128AnyTrue implements compiler.compileV128AnyTrue for arm64. -func (c *arm64Compiler) compileV128AnyTrue(*wazeroir.UnionOperation) (err error) { - vector := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(vector); err != nil { - return - } - - v := vector.register - c.assembler.CompileVectorRegisterToVectorRegister(arm64.UMAXP, v, v, - arm64.VectorArrangement16B, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, arm64ReservedRegisterForTemporary, - arm64.VectorArrangementD, 0) - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, arm64ReservedRegisterForTemporary) - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(arm64.CondNE) - - c.locationStack.markRegisterUnused(v) - return -} - -// compileV128AllTrue implements compiler.compileV128AllTrue for arm64. -func (c *arm64Compiler) compileV128AllTrue(o *wazeroir.UnionOperation) (err error) { - vector := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(vector); err != nil { - return - } - - v := vector.register - shape := o.B1 - if shape == wazeroir.ShapeI64x2 { - c.assembler.CompileVectorRegisterToVectorRegister(arm64.CMEQZERO, arm64.RegRZR, v, - arm64.VectorArrangement2D, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileVectorRegisterToVectorRegister(arm64.ADDP, v, v, - arm64.VectorArrangement2D, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileTwoRegistersToNone(arm64.FCMPD, v, v) - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(arm64.CondEQ) - } else { - var arr arm64.VectorArrangement - switch shape { - case wazeroir.ShapeI8x16: - arr = arm64.VectorArrangement16B - case wazeroir.ShapeI16x8: - arr = arm64.VectorArrangement8H - case wazeroir.ShapeI32x4: - arr = arm64.VectorArrangement4S - } - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.UMINV, v, v, - arr, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, arm64ReservedRegisterForTemporary, - arm64.VectorArrangementD, 0) - c.assembler.CompileTwoRegistersToNone(arm64.CMP, arm64.RegRZR, arm64ReservedRegisterForTemporary) - c.locationStack.pushRuntimeValueLocationOnConditionalRegister(arm64.CondNE) - } - c.markRegisterUnused(v) - return -} - -var ( - i8x16BitmaskConst = [16]byte{ - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - } - i16x8BitmaskConst = [16]byte{ - 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00, - 0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x80, 0x00, - } - i32x4BitmaskConst = [16]byte{ - 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, - } -) - -// compileV128BitMask implements compiler.compileV128BitMask for arm64. -func (c *arm64Compiler) compileV128BitMask(o *wazeroir.UnionOperation) (err error) { - vector := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(vector); err != nil { - return - } - - v := vector.register - - result, err := c.allocateRegister(registerTypeGeneralPurpose) - if err != nil { - return err - } - - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16: - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Right arithmetic shift on the original vector and store the result into vecTmp. So we have: - // v[i] = 0xff if vi<0, 0 otherwise. - c.assembler.CompileVectorRegisterToVectorRegisterWithConst(arm64.SSHR, v, v, arm64.VectorArrangement16B, 7) - - // Load the bit mask into vecTmp. - c.assembler.CompileStaticConstToVectorRegister(arm64.VMOV, asm.NewStaticConst(i8x16BitmaskConst[:]), vecTmp, arm64.VectorArrangementQ) - - // Lane-wise logical AND with i8x16BitmaskConst, meaning that we have - // v[i] = (1 << i) if vi<0, 0 otherwise. - // - // Below, we use the following notation: - // wi := (1 << i) if vi<0, 0 otherwise. - c.assembler.CompileVectorRegisterToVectorRegister(arm64.VAND, vecTmp, v, arm64.VectorArrangement16B, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - // Swap the lower and higher 8 byte elements, and write it into vecTmp, meaning that we have - // vecTmp[i] = w(i+8) if i < 8, w(i-8) otherwise. - // - c.assembler.CompileTwoVectorRegistersToVectorRegisterWithConst(arm64.EXT, v, v, vecTmp, arm64.VectorArrangement16B, 0x8) - - // v = [w0, w8, ..., w7, w15] - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.ZIP1, vecTmp, v, v, arm64.VectorArrangement16B) - - // v.h[0] = w0 + ... + w15 - c.assembler.CompileVectorRegisterToVectorRegister(arm64.ADDV, v, v, - arm64.VectorArrangement8H, arm64.VectorIndexNone, arm64.VectorIndexNone) - - // Extract the v.h[0] as the result. - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, result, arm64.VectorArrangementH, 0) - case wazeroir.ShapeI16x8: - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - // Right arithmetic shift on the original vector and store the result into vecTmp. So we have: - // v[i] = 0xffff if vi<0, 0 otherwise. - c.assembler.CompileVectorRegisterToVectorRegisterWithConst(arm64.SSHR, v, v, arm64.VectorArrangement8H, 15) - - // Load the bit mask into vecTmp. - c.assembler.CompileStaticConstToVectorRegister(arm64.VMOV, asm.NewStaticConst(i16x8BitmaskConst[:]), vecTmp, arm64.VectorArrangementQ) - - // Lane-wise logical AND with i16x8BitmaskConst, meaning that we have - // v[i] = (1 << i) if vi<0, 0 otherwise for i=0..3 - // = (1 << (i+4)) if vi<0, 0 otherwise for i=3..7 - c.assembler.CompileVectorRegisterToVectorRegister(arm64.VAND, vecTmp, v, arm64.VectorArrangement16B, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.ADDV, v, v, - arm64.VectorArrangement8H, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, result, arm64.VectorArrangementH, 0) - case wazeroir.ShapeI32x4: - vecTmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Right arithmetic shift on the original vector and store the result into vecTmp. So we have: - // v[i] = 0xffffffff if vi<0, 0 otherwise. - c.assembler.CompileVectorRegisterToVectorRegisterWithConst(arm64.SSHR, v, v, arm64.VectorArrangement4S, 32) - - // Load the bit mask into vecTmp. - c.assembler.CompileStaticConstToVectorRegister(arm64.VMOV, - asm.NewStaticConst(i32x4BitmaskConst[:]), vecTmp, arm64.VectorArrangementQ) - - // Lane-wise logical AND with i16x8BitmaskConst, meaning that we have - // v[i] = (1 << i) if vi<0, 0 otherwise for i in [0, 1] - // = (1 << (i+4)) if vi<0, 0 otherwise for i in [2, 3] - c.assembler.CompileVectorRegisterToVectorRegister(arm64.VAND, vecTmp, v, arm64.VectorArrangement16B, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.ADDV, v, v, - arm64.VectorArrangement4S, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, result, arm64.VectorArrangementS, 0) - case wazeroir.ShapeI64x2: - // Move the lower 64-bit int into result, - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, result, - arm64.VectorArrangementD, 0) - // Move the higher 64-bit int into arm64ReservedRegisterForTemporary. - c.assembler.CompileVectorRegisterToRegister(arm64.UMOV, v, arm64ReservedRegisterForTemporary, - arm64.VectorArrangementD, 1) - - // Move the sign bit into the least significant bit. - c.assembler.CompileConstToRegister(arm64.LSR, 63, result) - c.assembler.CompileConstToRegister(arm64.LSR, 63, arm64ReservedRegisterForTemporary) - - // result = (arm64ReservedRegisterForTemporary<<1) | result - c.assembler.CompileLeftShiftedRegisterToRegister(arm64.ADD, - arm64ReservedRegisterForTemporary, 1, result, result) - } - - c.markRegisterUnused(v) - c.pushRuntimeValueLocationOnRegister(result, runtimeValueTypeI32) - return -} - -// compileV128And implements compiler.compileV128And for arm64. -func (c *arm64Compiler) compileV128And(*wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.VAND, arm64.VectorArrangement16B) -} - -// compileV128Not implements compiler.compileV128Not for arm64. -func (c *arm64Compiler) compileV128Not(*wazeroir.UnionOperation) error { - return c.compileV128UniOp(arm64.NOT, arm64.VectorArrangement16B) -} - -// compileV128Or implements compiler.compileV128Or for arm64. -func (c *arm64Compiler) compileV128Or(*wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.VORR, arm64.VectorArrangement16B) -} - -// compileV128Xor implements compiler.compileV128Xor for arm64. -func (c *arm64Compiler) compileV128Xor(*wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.EOR, arm64.VectorArrangement16B) -} - -// compileV128Bitselect implements compiler.compileV128Bitselect for arm64. -func (c *arm64Compiler) compileV128Bitselect(*wazeroir.UnionOperation) error { - selector := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(selector); err != nil { - return err - } - - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.BSL, - x2.register, x1.register, selector.register, arm64.VectorArrangement16B) - - c.markRegisterUnused(x1.register, x2.register) - c.pushVectorRuntimeValueLocationOnRegister(selector.register) - return nil -} - -// compileV128AndNot implements compiler.compileV128AndNot for arm64. -func (c *arm64Compiler) compileV128AndNot(*wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.BIC, arm64.VectorArrangement16B) -} - -func (c *arm64Compiler) compileV128UniOp(inst asm.Instruction, arr arm64.VectorArrangement) error { - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - c.assembler.CompileVectorRegisterToVectorRegister(inst, v.register, v.register, arr, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return nil -} - -func (c *arm64Compiler) compileV128x2BinOp(inst asm.Instruction, arr arm64.VectorArrangement) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - c.assembler.CompileVectorRegisterToVectorRegister(inst, x2.register, x1.register, arr, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(x1.register) - return nil -} - -// compileV128Shr implements compiler.compileV128Shr for arm64. -func (c *arm64Compiler) compileV128Shr(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - if signed { - inst = arm64.SSHL - } else { - inst = arm64.USHL - } - return c.compileV128ShiftImpl(shape, inst, true) -} - -// compileV128Shl implements compiler.compileV128Shl for arm64. -func (c *arm64Compiler) compileV128Shl(o *wazeroir.UnionOperation) error { - return c.compileV128ShiftImpl(o.B1 /*shape*/, arm64.SSHL, false) -} - -func (c *arm64Compiler) compileV128ShiftImpl(shape wazeroir.Shape, ins asm.Instruction, rightShift bool) error { - s := c.locationStack.pop() - if s.register == arm64.RegRZR { - // If the shift amount is zero register, nothing to do here. - return nil - } - - var modulo asm.ConstantValue - var arr arm64.VectorArrangement - switch shape { - case wazeroir.ShapeI8x16: - modulo = 0x7 // modulo 8. - arr = arm64.VectorArrangement16B - case wazeroir.ShapeI16x8: - modulo = 0xf // modulo 16. - arr = arm64.VectorArrangement8H - case wazeroir.ShapeI32x4: - modulo = 0x1f // modulo 32. - arr = arm64.VectorArrangement4S - case wazeroir.ShapeI64x2: - modulo = 0x3f // modulo 64. - arr = arm64.VectorArrangement2D - } - - if err := c.compileEnsureOnRegister(s); err != nil { - return err - } - - v := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(v); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.assembler.CompileConstToRegister(arm64.ANDIMM32, modulo, s.register) - - if rightShift { - // Negate the amount to make this as right shift. - c.assembler.CompileRegisterToRegister(arm64.NEG, s.register, s.register) - } - - // Copy the shift amount into a vector register as SSHL requires it to be there. - c.assembler.CompileRegisterToVectorRegister(arm64.DUPGEN, s.register, tmp, - arr, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToVectorRegister(ins, tmp, v.register, arr, - arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.markRegisterUnused(s.register) - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return nil -} - -// compileV128Cmp implements compiler.compileV128Cmp for arm64. -func (c *arm64Compiler) compileV128Cmp(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - var arr arm64.VectorArrangement - v128CmpType := o.B1 - if v128CmpType <= wazeroir.V128CmpTypeI8x16GeU { - arr = arm64.VectorArrangement16B - } else if v128CmpType <= wazeroir.V128CmpTypeI16x8GeU { - arr = arm64.VectorArrangement8H - } else if v128CmpType <= wazeroir.V128CmpTypeI32x4GeU { - arr = arm64.VectorArrangement4S - } else if v128CmpType <= wazeroir.V128CmpTypeI64x2GeS { - arr = arm64.VectorArrangement2D - } else if v128CmpType <= wazeroir.V128CmpTypeF32x4Ge { - arr = arm64.VectorArrangement4S - } else { // f64x2 - arr = arm64.VectorArrangement2D - } - - result := x1.register - switch v128CmpType { - case wazeroir.V128CmpTypeI8x16Eq, wazeroir.V128CmpTypeI16x8Eq, wazeroir.V128CmpTypeI32x4Eq, wazeroir.V128CmpTypeI64x2Eq: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMEQ, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeI8x16Ne, wazeroir.V128CmpTypeI16x8Ne, wazeroir.V128CmpTypeI32x4Ne, wazeroir.V128CmpTypeI64x2Ne: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMEQ, x1.register, x2.register, result, arr) - // Reverse the condition by flipping all bits. - c.assembler.CompileVectorRegisterToVectorRegister(arm64.NOT, result, result, - arm64.VectorArrangement16B, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128CmpTypeI8x16LtS, wazeroir.V128CmpTypeI16x8LtS, wazeroir.V128CmpTypeI32x4LtS, wazeroir.V128CmpTypeI64x2LtS: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMGT, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeI8x16LtU, wazeroir.V128CmpTypeI16x8LtU, wazeroir.V128CmpTypeI32x4LtU: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMHI, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeI8x16GtS, wazeroir.V128CmpTypeI16x8GtS, wazeroir.V128CmpTypeI32x4GtS, wazeroir.V128CmpTypeI64x2GtS: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMGT, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeI8x16GtU, wazeroir.V128CmpTypeI16x8GtU, wazeroir.V128CmpTypeI32x4GtU: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMHI, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeI8x16LeS, wazeroir.V128CmpTypeI16x8LeS, wazeroir.V128CmpTypeI32x4LeS, wazeroir.V128CmpTypeI64x2LeS: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMGE, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeI8x16LeU, wazeroir.V128CmpTypeI16x8LeU, wazeroir.V128CmpTypeI32x4LeU: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMHS, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeI8x16GeS, wazeroir.V128CmpTypeI16x8GeS, wazeroir.V128CmpTypeI32x4GeS, wazeroir.V128CmpTypeI64x2GeS: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMGE, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeI8x16GeU, wazeroir.V128CmpTypeI16x8GeU, wazeroir.V128CmpTypeI32x4GeU: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.CMHS, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeF32x4Eq, wazeroir.V128CmpTypeF64x2Eq: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMEQ, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeF32x4Ne, wazeroir.V128CmpTypeF64x2Ne: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMEQ, x2.register, x1.register, result, arr) - // Reverse the condition by flipping all bits. - c.assembler.CompileVectorRegisterToVectorRegister(arm64.NOT, result, result, - arm64.VectorArrangement16B, arm64.VectorIndexNone, arm64.VectorIndexNone) - case wazeroir.V128CmpTypeF32x4Lt, wazeroir.V128CmpTypeF64x2Lt: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGT, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeF32x4Le, wazeroir.V128CmpTypeF64x2Le: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGE, x1.register, x2.register, result, arr) - case wazeroir.V128CmpTypeF32x4Gt, wazeroir.V128CmpTypeF64x2Gt: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGT, x2.register, x1.register, result, arr) - case wazeroir.V128CmpTypeF32x4Ge, wazeroir.V128CmpTypeF64x2Ge: - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGE, x2.register, x1.register, result, arr) - } - - c.markRegisterUnused(x2.register) - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128AddSat implements compiler.compileV128AddSat for arm64. -func (c *arm64Compiler) compileV128AddSat(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - if signed { - inst = arm64.VSQADD - } else { - inst = arm64.VUQADD - } - return c.compileV128x2BinOp(inst, defaultArrangementForShape(shape)) -} - -// compileV128SubSat implements compiler.compileV128SubSat for arm64. -func (c *arm64Compiler) compileV128SubSat(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - if signed { - inst = arm64.VSQSUB - } else { - inst = arm64.VUQSUB - } - return c.compileV128x2BinOp(inst, defaultArrangementForShape(shape)) -} - -// compileV128Mul implements compiler.compileV128Mul for arm64. -func (c *arm64Compiler) compileV128Mul(o *wazeroir.UnionOperation) (err error) { - shape := o.B1 - switch shape { - case wazeroir.ShapeI8x16, wazeroir.ShapeI16x8, wazeroir.ShapeI32x4: - err = c.compileV128x2BinOp(arm64.VMUL, defaultArrangementForShape(shape)) - case wazeroir.ShapeF32x4, wazeroir.ShapeF64x2: - err = c.compileV128x2BinOp(arm64.VFMUL, defaultArrangementForShape(shape)) - case wazeroir.ShapeI64x2: - x2 := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(x2); err != nil { - return - } - - x1 := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(x1); err != nil { - return - } - - src1, src2 := x1.register, x2.register - - tmp1, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - c.markRegisterUsed(tmp1) - - tmp2, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - c.markRegisterUsed(tmp2) - - tmp3, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - // Following the algorithm in https://chromium-review.googlesource.com/c/v8/v8/+/1781696 - c.assembler.CompileVectorRegisterToVectorRegister(arm64.REV64, src2, tmp2, - arm64.VectorArrangement4S, arm64.VectorIndexNone, arm64.VectorIndexNone) - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VMUL, src1, tmp2, tmp2, arm64.VectorArrangement4S) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.XTN, src1, tmp1, - arm64.VectorArrangement2D, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.VADDP, tmp2, tmp2, arm64.VectorArrangement4S, - arm64.VectorIndexNone, arm64.VectorIndexNone, - ) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.XTN, src2, tmp3, - arm64.VectorArrangement2D, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileVectorRegisterToVectorRegister(arm64.SHLL, tmp2, src1, - arm64.VectorArrangement2S, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VUMLAL, tmp3, tmp1, src1, arm64.VectorArrangement2S) - - c.markRegisterUnused(src2, tmp1, tmp2) - c.pushVectorRuntimeValueLocationOnRegister(src1) - } - return -} - -// compileV128Div implements compiler.compileV128Div for arm64. -func (c *arm64Compiler) compileV128Div(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - var inst asm.Instruction - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - inst = arm64.VFDIV - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - inst = arm64.VFDIV - } - return c.compileV128x2BinOp(inst, arr) -} - -// compileV128Neg implements compiler.compileV128Neg for arm64. -func (c *arm64Compiler) compileV128Neg(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - if shape <= wazeroir.ShapeI64x2 { // Integer lanes - inst = arm64.VNEG - } else { // Floating point lanes - inst = arm64.VFNEG - } - return c.compileV128UniOp(inst, defaultArrangementForShape(shape)) -} - -// compileV128Sqrt implements compiler.compileV128Sqrt for arm64. -func (c *arm64Compiler) compileV128Sqrt(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return c.compileV128UniOp(arm64.VFSQRT, arr) -} - -// compileV128Abs implements compiler.compileV128Abs for arm64. -func (c *arm64Compiler) compileV128Abs(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - if shape <= wazeroir.ShapeI64x2 { // Integer lanes - inst = arm64.VABS - } else { // Floating point lanes - inst = arm64.VFABS - } - return c.compileV128UniOp(inst, defaultArrangementForShape(shape)) -} - -// compileV128Popcnt implements compiler.compileV128Popcnt for arm64. -func (c *arm64Compiler) compileV128Popcnt(o *wazeroir.UnionOperation) error { - return c.compileV128UniOp(arm64.VCNT, defaultArrangementForShape(o.B1)) -} - -// compileV128Min implements compiler.compileV128Min for arm64. -func (c *arm64Compiler) compileV128Min(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - if shape <= wazeroir.ShapeI64x2 { // Integer lanes - if signed { - inst = arm64.SMIN - } else { - inst = arm64.UMIN - } - } else { // Floating point lanes - inst = arm64.VFMIN - } - return c.compileV128x2BinOp(inst, defaultArrangementForShape(shape)) -} - -func defaultArrangementForShape(s wazeroir.Shape) (arr arm64.VectorArrangement) { - switch s { - case wazeroir.ShapeI8x16: - arr = arm64.VectorArrangement16B - case wazeroir.ShapeI16x8: - arr = arm64.VectorArrangement8H - case wazeroir.ShapeI32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeI64x2: - arr = arm64.VectorArrangement2D - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return -} - -// compileV128Max implements compiler.compileV128Max for arm64. -func (c *arm64Compiler) compileV128Max(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - shape := o.B1 - signed := o.B3 - if shape <= wazeroir.ShapeI64x2 { // Integer lanes - if signed { - inst = arm64.SMAX - } else { - inst = arm64.UMAX - } - } else { // Floating point lanes - inst = arm64.VFMAX - } - return c.compileV128x2BinOp(inst, defaultArrangementForShape(shape)) -} - -// compileV128AvgrU implements compiler.compileV128AvgrU for arm64. -func (c *arm64Compiler) compileV128AvgrU(o *wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.URHADD, defaultArrangementForShape(o.B1)) -} - -// compileV128Pmin implements compiler.compileV128Pmin for arm64. -func (c *arm64Compiler) compileV128Pmin(o *wazeroir.UnionOperation) error { - return c.compileV128PseudoMinOrMax(defaultArrangementForShape(o.B1), false) -} - -// compileV128Pmax implements compiler.compileV128Pmax for arm64. -func (c *arm64Compiler) compileV128Pmax(o *wazeroir.UnionOperation) error { - return c.compileV128PseudoMinOrMax(defaultArrangementForShape(o.B1), true) -} - -// compileV128PseudoMinOrMax implements compileV128Pmax and compileV128Pmin. -func (c *arm64Compiler) compileV128PseudoMinOrMax(arr arm64.VectorArrangement, max bool) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - result, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - // Sets all bits on each lane if x1r's lane satisfies the condition (min or max), zeros otherwise. - if max { - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGT, x1r, x2r, result, arr) - } else { - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.FCMGT, x2r, x1r, result, arr) - } - // Select each bit based on the result bits ^. - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.BSL, x1r, x2r, result, arm64.VectorArrangement16B) - - c.markRegisterUnused(x1r, x2r) - c.pushVectorRuntimeValueLocationOnRegister(result) - return nil -} - -// compileV128Ceil implements compiler.compileV128Ceil for arm64. -func (c *arm64Compiler) compileV128Ceil(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return c.compileV128UniOp(arm64.VFRINTP, arr) -} - -// compileV128Floor implements compiler.compileV128Floor for arm64. -func (c *arm64Compiler) compileV128Floor(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return c.compileV128UniOp(arm64.VFRINTM, arr) -} - -// compileV128Trunc implements compiler.compileV128Trunc for arm64. -func (c *arm64Compiler) compileV128Trunc(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return c.compileV128UniOp(arm64.VFRINTZ, arr) -} - -// compileV128Nearest implements compiler.compileV128Nearest for arm64. -func (c *arm64Compiler) compileV128Nearest(o *wazeroir.UnionOperation) error { - var arr arm64.VectorArrangement - shape := o.B1 - switch shape { - case wazeroir.ShapeF32x4: - arr = arm64.VectorArrangement4S - case wazeroir.ShapeF64x2: - arr = arm64.VectorArrangement2D - } - return c.compileV128UniOp(arm64.VFRINTN, arr) -} - -// compileV128Extend implements compiler.compileV128Extend for arm64. -func (c *arm64Compiler) compileV128Extend(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - var arr arm64.VectorArrangement - originShape := o.B1 - signed := o.B2 == 1 - useLow := o.B3 - if useLow { - if signed { - inst = arm64.SSHLL - } else { - inst = arm64.USHLL - } - - switch originShape { - case wazeroir.ShapeI8x16: - arr = arm64.VectorArrangement8B - case wazeroir.ShapeI16x8: - arr = arm64.VectorArrangement4H - case wazeroir.ShapeI32x4: - arr = arm64.VectorArrangement2S - } - } else { - if signed { - inst = arm64.SSHLL2 - } else { - inst = arm64.USHLL2 - } - arr = defaultArrangementForShape(originShape) - } - - return c.compileV128UniOp(inst, arr) -} - -// compileV128ExtMul implements compiler.compileV128ExtMul for arm64. -func (c *arm64Compiler) compileV128ExtMul(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - var arr arm64.VectorArrangement - originShape := o.B1 - signed := o.B2 == 1 - useLow := o.B3 - if useLow { - if signed { - inst = arm64.SMULL - } else { - inst = arm64.UMULL - } - - switch originShape { - case wazeroir.ShapeI8x16: - arr = arm64.VectorArrangement8B - case wazeroir.ShapeI16x8: - arr = arm64.VectorArrangement4H - case wazeroir.ShapeI32x4: - arr = arm64.VectorArrangement2S - } - } else { - if signed { - inst = arm64.SMULL2 - } else { - inst = arm64.UMULL2 - } - arr = defaultArrangementForShape(originShape) - } - - return c.compileV128x2BinOp(inst, arr) -} - -// compileV128Q15mulrSatS implements compiler.compileV128Q15mulrSatS for arm64. -func (c *arm64Compiler) compileV128Q15mulrSatS(*wazeroir.UnionOperation) error { - return c.compileV128x2BinOp(arm64.SQRDMULH, arm64.VectorArrangement8H) -} - -// compileV128ExtAddPairwise implements compiler.compileV128ExtAddPairwise for arm64. -func (c *arm64Compiler) compileV128ExtAddPairwise(o *wazeroir.UnionOperation) error { - var inst asm.Instruction - originShape := o.B1 - signed := o.B3 - if signed { - inst = arm64.SADDLP - } else { - inst = arm64.UADDLP - } - return c.compileV128UniOp(inst, defaultArrangementForShape(originShape)) -} - -// compileV128FloatPromote implements compiler.compileV128FloatPromote for arm64. -func (c *arm64Compiler) compileV128FloatPromote(*wazeroir.UnionOperation) error { - return c.compileV128UniOp(arm64.FCVTL, arm64.VectorArrangement2S) -} - -// compileV128FloatDemote implements compiler.compileV128FloatDemote for arm64. -func (c *arm64Compiler) compileV128FloatDemote(*wazeroir.UnionOperation) error { - return c.compileV128UniOp(arm64.FCVTN, arm64.VectorArrangement2S) -} - -// compileV128FConvertFromI implements compiler.compileV128FConvertFromI for arm64. -func (c *arm64Compiler) compileV128FConvertFromI(o *wazeroir.UnionOperation) (err error) { - destinationShape := o.B1 - signed := o.B3 - - if destinationShape == wazeroir.ShapeF32x4 { - if signed { - err = c.compileV128UniOp(arm64.VSCVTF, defaultArrangementForShape(destinationShape)) - } else { - err = c.compileV128UniOp(arm64.VUCVTF, defaultArrangementForShape(destinationShape)) - } - return - } else { // f64x2 - v := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(v); err != nil { - return - } - vr := v.register - - var expand, convert asm.Instruction - if signed { - expand, convert = arm64.SSHLL, arm64.VSCVTF - } else { - expand, convert = arm64.USHLL, arm64.VUCVTF - } - - // Expand lower two 32-bit lanes as two 64-bit lanes. - c.assembler.CompileVectorRegisterToVectorRegisterWithConst(expand, vr, vr, arm64.VectorArrangement2S, 0) - // Convert these two 64-bit (integer) values on each lane as double precision values. - c.assembler.CompileVectorRegisterToVectorRegister(convert, vr, vr, arm64.VectorArrangement2D, - arm64.VectorIndexNone, arm64.VectorIndexNone) - c.pushVectorRuntimeValueLocationOnRegister(vr) - } - return -} - -// compileV128Dot implements compiler.compileV128Dot for arm64. -func (c *arm64Compiler) compileV128Dot(*wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - tmp, err := c.allocateRegister(registerTypeVector) - if err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - // Multiply lower integers and get the 32-bit results into tmp. - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.SMULL, x1r, x2r, tmp, arm64.VectorArrangement4H) - // Multiply higher integers and get the 32-bit results into x1r. - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.SMULL2, x1r, x2r, x1r, arm64.VectorArrangement8H) - // Adds these two results into x1r. - c.assembler.CompileTwoVectorRegistersToVectorRegister(arm64.VADDP, x1r, tmp, x1r, arm64.VectorArrangement4S) - - c.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - - return nil -} - -// compileV128Narrow implements compiler.compileV128Narrow for arm64. -func (c *arm64Compiler) compileV128Narrow(o *wazeroir.UnionOperation) error { - x2 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x2); err != nil { - return err - } - - x1 := c.locationStack.popV128() - if err := c.compileEnsureOnRegister(x1); err != nil { - return err - } - - x1r, x2r := x1.register, x2.register - - var arr, arr2 arm64.VectorArrangement - originShape := o.B1 - signed := o.B3 - switch originShape { - case wazeroir.ShapeI16x8: - arr = arm64.VectorArrangement8B - arr2 = arm64.VectorArrangement16B - case wazeroir.ShapeI32x4: - arr = arm64.VectorArrangement4H - arr2 = arm64.VectorArrangement8H - } - - var lo, hi asm.Instruction - if signed { - lo, hi = arm64.SQXTN, arm64.SQXTN2 - } else { - lo, hi = arm64.SQXTUN, arm64.SQXTUN2 - } - - // Narrow lanes on x1r and write them into lower-half of x1r. - c.assembler.CompileVectorRegisterToVectorRegister(lo, x1r, x1r, arr, arm64.VectorIndexNone, arm64.VectorIndexNone) - // Narrow lanes on x2r and write them into higher-half of x1r. - c.assembler.CompileVectorRegisterToVectorRegister(hi, x2r, x1r, arr2, arm64.VectorIndexNone, arm64.VectorIndexNone) - - c.markRegisterUnused(x2r) - c.pushVectorRuntimeValueLocationOnRegister(x1r) - return nil -} - -// compileV128ITruncSatFromF implements compiler.compileV128ITruncSatFromF for arm64. -func (c *arm64Compiler) compileV128ITruncSatFromF(o *wazeroir.UnionOperation) (err error) { - v := c.locationStack.popV128() - if err = c.compileEnsureOnRegister(v); err != nil { - return err - } - - originShape := o.B1 - signed := o.B3 - var cvt asm.Instruction - if signed { - cvt = arm64.VFCVTZS - } else { - cvt = arm64.VFCVTZU - } - - c.assembler.CompileVectorRegisterToVectorRegister(cvt, v.register, v.register, - defaultArrangementForShape(originShape), arm64.VectorIndexNone, arm64.VectorIndexNone, - ) - - if originShape == wazeroir.ShapeF64x2 { - var narrow asm.Instruction - if signed { - narrow = arm64.SQXTN - } else { - narrow = arm64.UQXTN - } - c.assembler.CompileVectorRegisterToVectorRegister(narrow, v.register, v.register, - arm64.VectorArrangement2S, arm64.VectorIndexNone, arm64.VectorIndexNone, - ) - } - - c.pushVectorRuntimeValueLocationOnRegister(v.register) - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go b/vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go deleted file mode 100644 index ad3e7f7603..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/engine/interpreter/interpreter.go +++ /dev/null @@ -1,4147 +0,0 @@ -package interpreter - -import ( - "context" - "encoding/binary" - "errors" - "fmt" - "math" - "math/bits" - "sync" - "unsafe" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/experimental" - "github.com/tetratelabs/wazero/internal/filecache" - "github.com/tetratelabs/wazero/internal/internalapi" - "github.com/tetratelabs/wazero/internal/moremath" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wasmdebug" - "github.com/tetratelabs/wazero/internal/wasmruntime" - "github.com/tetratelabs/wazero/internal/wazeroir" -) - -// callStackCeiling is the maximum WebAssembly call frame stack height. This allows wazero to raise -// wasm.ErrCallStackOverflow instead of overflowing the Go runtime. -// -// The default value should suffice for most use cases. Those wishing to change this can via `go build -ldflags`. -var callStackCeiling = 2000 - -// engine is an interpreter implementation of wasm.Engine -type engine struct { - enabledFeatures api.CoreFeatures - compiledFunctions map[wasm.ModuleID][]compiledFunction // guarded by mutex. - mux sync.RWMutex - // labelAddressResolutionCache is the temporary cache used to map LabelKind -> FrameID -> the index to the body. - labelAddressResolutionCache [wazeroir.LabelKindNum][]uint64 -} - -func NewEngine(_ context.Context, enabledFeatures api.CoreFeatures, _ filecache.Cache) wasm.Engine { - return &engine{ - enabledFeatures: enabledFeatures, - compiledFunctions: map[wasm.ModuleID][]compiledFunction{}, - } -} - -// Close implements the same method as documented on wasm.Engine. -func (e *engine) Close() (err error) { - return -} - -// CompiledModuleCount implements the same method as documented on wasm.Engine. -func (e *engine) CompiledModuleCount() uint32 { - return uint32(len(e.compiledFunctions)) -} - -// DeleteCompiledModule implements the same method as documented on wasm.Engine. -func (e *engine) DeleteCompiledModule(m *wasm.Module) { - e.deleteCompiledFunctions(m) -} - -func (e *engine) deleteCompiledFunctions(module *wasm.Module) { - e.mux.Lock() - defer e.mux.Unlock() - delete(e.compiledFunctions, module.ID) -} - -func (e *engine) addCompiledFunctions(module *wasm.Module, fs []compiledFunction) { - e.mux.Lock() - defer e.mux.Unlock() - e.compiledFunctions[module.ID] = fs -} - -func (e *engine) getCompiledFunctions(module *wasm.Module) (fs []compiledFunction, ok bool) { - e.mux.RLock() - defer e.mux.RUnlock() - fs, ok = e.compiledFunctions[module.ID] - return -} - -// moduleEngine implements wasm.ModuleEngine -type moduleEngine struct { - // codes are the compiled functions in a module instances. - // The index is module instance-scoped. - functions []function - - // parentEngine holds *engine from which this module engine is created from. - parentEngine *engine -} - -// callEngine holds context per moduleEngine.Call, and shared across all the -// function calls originating from the same moduleEngine.Call execution. -// -// This implements api.Function. -type callEngine struct { - internalapi.WazeroOnlyType - - // stack contains the operands. - // Note that all the values are represented as uint64. - stack []uint64 - - // frames are the function call stack. - frames []*callFrame - - // f is the initial function for this call engine. - f *function - - // stackiterator for Listeners to walk frames and stack. - stackIterator stackIterator -} - -func (e *moduleEngine) newCallEngine(compiled *function) *callEngine { - return &callEngine{f: compiled} -} - -func (ce *callEngine) pushValue(v uint64) { - ce.stack = append(ce.stack, v) -} - -func (ce *callEngine) pushValues(v []uint64) { - ce.stack = append(ce.stack, v...) -} - -func (ce *callEngine) popValue() (v uint64) { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase - // and wazeroir translation - // before compilation. - stackTopIndex := len(ce.stack) - 1 - v = ce.stack[stackTopIndex] - ce.stack = ce.stack[:stackTopIndex] - return -} - -func (ce *callEngine) popValues(v []uint64) { - stackTopIndex := len(ce.stack) - len(v) - copy(v, ce.stack[stackTopIndex:]) - ce.stack = ce.stack[:stackTopIndex] -} - -// peekValues peeks api.ValueType values from the stack and returns them. -func (ce *callEngine) peekValues(count int) []uint64 { - if count == 0 { - return nil - } - stackLen := len(ce.stack) - return ce.stack[stackLen-count : stackLen] -} - -func (ce *callEngine) drop(raw uint64) { - r := wazeroir.InclusiveRangeFromU64(raw) - if r.Start == -1 { - return - } else if r.Start == 0 { - ce.stack = ce.stack[:int32(len(ce.stack))-1-r.End] - } else { - newStack := ce.stack[:int32(len(ce.stack))-1-r.End] - newStack = append(newStack, ce.stack[int32(len(ce.stack))-r.Start:]...) - ce.stack = newStack - } -} - -func (ce *callEngine) pushFrame(frame *callFrame) { - if callStackCeiling <= len(ce.frames) { - panic(wasmruntime.ErrRuntimeStackOverflow) - } - ce.frames = append(ce.frames, frame) -} - -func (ce *callEngine) popFrame() (frame *callFrame) { - // No need to check stack bound as we can assume that all the operations are valid thanks to validateFunction at - // module validation phase and wazeroir translation before compilation. - oneLess := len(ce.frames) - 1 - frame = ce.frames[oneLess] - ce.frames = ce.frames[:oneLess] - return -} - -type callFrame struct { - // pc is the program counter representing the current position in code.body. - pc uint64 - // f is the compiled function used in this function frame. - f *function - // base index in the frame of this function, used to detect the count of - // values on the stack. - base int -} - -type compiledFunction struct { - source *wasm.Module - body []wazeroir.UnionOperation - listener experimental.FunctionListener - offsetsInWasmBinary []uint64 - hostFn interface{} - ensureTermination bool - index wasm.Index -} - -type function struct { - funcType *wasm.FunctionType - moduleInstance *wasm.ModuleInstance - typeID wasm.FunctionTypeID - parent *compiledFunction -} - -// functionFromUintptr resurrects the original *function from the given uintptr -// which comes from either funcref table or OpcodeRefFunc instruction. -func functionFromUintptr(ptr uintptr) *function { - // Wraps ptrs as the double pointer in order to avoid the unsafe access as detected by race detector. - // - // For example, if we have (*function)(unsafe.Pointer(ptr)) instead, then the race detector's "checkptr" - // subroutine wanrs as "checkptr: pointer arithmetic result points to invalid allocation" - // https://github.com/golang/go/blob/1ce7fcf139417d618c2730010ede2afb41664211/src/runtime/checkptr.go#L69 - var wrapped *uintptr = &ptr - return *(**function)(unsafe.Pointer(wrapped)) -} - -// stackIterator implements experimental.StackIterator. -type stackIterator struct { - stack []uint64 - frames []*callFrame - started bool - fn *function - pc uint64 -} - -func (si *stackIterator) reset(stack []uint64, frames []*callFrame, f *function) { - si.fn = f - si.pc = 0 - si.stack = stack - si.frames = frames - si.started = false -} - -func (si *stackIterator) clear() { - si.stack = nil - si.frames = nil - si.started = false - si.fn = nil -} - -// Next implements the same method as documented on experimental.StackIterator. -func (si *stackIterator) Next() bool { - if !si.started { - si.started = true - return true - } - - if len(si.frames) == 0 { - return false - } - - frame := si.frames[len(si.frames)-1] - si.stack = si.stack[:frame.base] - si.fn = frame.f - si.pc = frame.pc - si.frames = si.frames[:len(si.frames)-1] - return true -} - -// Function implements the same method as documented on -// experimental.StackIterator. -func (si *stackIterator) Function() experimental.InternalFunction { - return internalFunction{si.fn} -} - -// ProgramCounter implements the same method as documented on -// experimental.StackIterator. -func (si *stackIterator) ProgramCounter() experimental.ProgramCounter { - return experimental.ProgramCounter(si.pc) -} - -// Parameters implements the same method as documented on -// experimental.StackIterator. -func (si *stackIterator) Parameters() []uint64 { - paramsCount := si.fn.funcType.ParamNumInUint64 - top := len(si.stack) - return si.stack[top-paramsCount:] -} - -// internalFunction implements experimental.InternalFunction. -type internalFunction struct{ *function } - -// Definition implements the same method as documented on -// experimental.InternalFunction. -func (f internalFunction) Definition() api.FunctionDefinition { - return f.definition() -} - -// SourceOffsetForPC implements the same method as documented on -// experimental.InternalFunction. -func (f internalFunction) SourceOffsetForPC(pc experimental.ProgramCounter) uint64 { - offsetsMap := f.parent.offsetsInWasmBinary - if uint64(pc) < uint64(len(offsetsMap)) { - return offsetsMap[pc] - } - return 0 -} - -// interpreter mode doesn't maintain call frames in the stack, so pass the zero size to the IR. -const callFrameStackSize = 0 - -// CompileModule implements the same method as documented on wasm.Engine. -func (e *engine) CompileModule(_ context.Context, module *wasm.Module, listeners []experimental.FunctionListener, ensureTermination bool) error { - if _, ok := e.getCompiledFunctions(module); ok { // cache hit! - return nil - } - - funcs := make([]compiledFunction, len(module.FunctionSection)) - irCompiler, err := wazeroir.NewCompiler(e.enabledFeatures, callFrameStackSize, module, ensureTermination) - if err != nil { - return err - } - imported := module.ImportFunctionCount - for i := range module.CodeSection { - var lsn experimental.FunctionListener - if i < len(listeners) { - lsn = listeners[i] - } - - compiled := &funcs[i] - // If this is the host function, there's nothing to do as the runtime representation of - // host function in interpreter is its Go function itself as opposed to Wasm functions, - // which need to be compiled down to wazeroir. - if codeSeg := &module.CodeSection[i]; codeSeg.GoFunc != nil { - compiled.hostFn = codeSeg.GoFunc - } else { - ir, err := irCompiler.Next() - if err != nil { - return err - } - err = e.lowerIR(ir, compiled) - if err != nil { - def := module.FunctionDefinition(uint32(i) + module.ImportFunctionCount) - return fmt.Errorf("failed to lower func[%s] to wazeroir: %w", def.DebugName(), err) - } - } - compiled.source = module - compiled.ensureTermination = ensureTermination - compiled.listener = lsn - compiled.index = imported + uint32(i) - } - e.addCompiledFunctions(module, funcs) - return nil -} - -// NewModuleEngine implements the same method as documented on wasm.Engine. -func (e *engine) NewModuleEngine(module *wasm.Module, instance *wasm.ModuleInstance) (wasm.ModuleEngine, error) { - me := &moduleEngine{ - parentEngine: e, - functions: make([]function, len(module.FunctionSection)+int(module.ImportFunctionCount)), - } - - codes, ok := e.getCompiledFunctions(module) - if !ok { - return nil, errors.New("source module must be compiled before instantiation") - } - - for i := range codes { - c := &codes[i] - offset := i + int(module.ImportFunctionCount) - typeIndex := module.FunctionSection[i] - me.functions[offset] = function{ - moduleInstance: instance, - typeID: instance.TypeIDs[typeIndex], - funcType: &module.TypeSection[typeIndex], - parent: c, - } - } - return me, nil -} - -// lowerIR lowers the wazeroir operations to engine friendly struct. -func (e *engine) lowerIR(ir *wazeroir.CompilationResult, ret *compiledFunction) error { - // Copy the body from the result. - ret.body = make([]wazeroir.UnionOperation, len(ir.Operations)) - copy(ret.body, ir.Operations) - // Also copy the offsets if necessary. - if offsets := ir.IROperationSourceOffsetsInWasmBinary; len(offsets) > 0 { - ret.offsetsInWasmBinary = make([]uint64, len(offsets)) - copy(ret.offsetsInWasmBinary, offsets) - } - - // First, we iterate all labels, and resolve the address. - for i := range ret.body { - op := &ret.body[i] - switch op.Kind { - case wazeroir.OperationKindLabel: - label := wazeroir.Label(op.U1) - address := uint64(i) - - kind, fid := label.Kind(), label.FrameID() - frameToAddresses := e.labelAddressResolutionCache[label.Kind()] - // Expand the slice if necessary. - if diff := fid - len(frameToAddresses) + 1; diff > 0 { - for j := 0; j < diff; j++ { - frameToAddresses = append(frameToAddresses, 0) - } - } - frameToAddresses[fid] = address - e.labelAddressResolutionCache[kind] = frameToAddresses - } - } - - // Then resolve the label as the index to the body. - for i := range ret.body { - op := &ret.body[i] - switch op.Kind { - case wazeroir.OperationKindBr: - e.setLabelAddress(&op.U1, wazeroir.Label(op.U1)) - case wazeroir.OperationKindBrIf: - e.setLabelAddress(&op.U1, wazeroir.Label(op.U1)) - e.setLabelAddress(&op.U2, wazeroir.Label(op.U2)) - case wazeroir.OperationKindBrTable: - for j := 0; j < len(op.Us); j += 2 { - target := op.Us[j] - e.setLabelAddress(&op.Us[j], wazeroir.Label(target)) - } - } - } - - // Reuses the slices for the subsequent compilation, so clear the content here. - for i := range e.labelAddressResolutionCache { - e.labelAddressResolutionCache[i] = e.labelAddressResolutionCache[i][:0] - } - return nil -} - -func (e *engine) setLabelAddress(op *uint64, label wazeroir.Label) { - if label.IsReturnTarget() { - // Jmp to the end of the possible binary. - *op = math.MaxUint64 - } else { - *op = e.labelAddressResolutionCache[label.Kind()][label.FrameID()] - } -} - -// ResolveImportedFunction implements wasm.ModuleEngine. -func (e *moduleEngine) ResolveImportedFunction(index, indexInImportedModule wasm.Index, importedModuleEngine wasm.ModuleEngine) { - imported := importedModuleEngine.(*moduleEngine) - e.functions[index] = imported.functions[indexInImportedModule] -} - -// FunctionInstanceReference implements the same method as documented on wasm.ModuleEngine. -func (e *moduleEngine) FunctionInstanceReference(funcIndex wasm.Index) wasm.Reference { - return uintptr(unsafe.Pointer(&e.functions[funcIndex])) -} - -// NewFunction implements the same method as documented on wasm.ModuleEngine. -func (e *moduleEngine) NewFunction(index wasm.Index) (ce api.Function) { - // Note: The input parameters are pre-validated, so a compiled function is only absent on close. Updates to - // code on close aren't locked, neither is this read. - compiled := &e.functions[index] - return e.newCallEngine(compiled) -} - -// LookupFunction implements the same method as documented on wasm.ModuleEngine. -func (e *moduleEngine) LookupFunction(t *wasm.TableInstance, typeId wasm.FunctionTypeID, tableOffset wasm.Index) (f api.Function, err error) { - if tableOffset >= uint32(len(t.References)) { - err = wasmruntime.ErrRuntimeInvalidTableAccess - return - } - rawPtr := t.References[tableOffset] - if rawPtr == 0 { - err = wasmruntime.ErrRuntimeInvalidTableAccess - return - } - - tf := functionFromUintptr(rawPtr) - if tf.typeID != typeId { - err = wasmruntime.ErrRuntimeIndirectCallTypeMismatch - return - } - - f = e.newCallEngine(tf) - return -} - -// Definition implements the same method as documented on api.Function. -func (ce *callEngine) Definition() api.FunctionDefinition { - return ce.f.definition() -} - -func (f *function) definition() api.FunctionDefinition { - compiled := f.parent - return compiled.source.FunctionDefinition(compiled.index) -} - -// Call implements the same method as documented on api.Function. -func (ce *callEngine) Call(ctx context.Context, params ...uint64) (results []uint64, err error) { - ft := ce.f.funcType - if n := ft.ParamNumInUint64; n != len(params) { - return nil, fmt.Errorf("expected %d params, but passed %d", n, len(params)) - } - return ce.call(ctx, params, nil) -} - -// CallWithStack implements the same method as documented on api.Function. -func (ce *callEngine) CallWithStack(ctx context.Context, stack []uint64) error { - params, results, err := wasm.SplitCallStack(ce.f.funcType, stack) - if err != nil { - return err - } - _, err = ce.call(ctx, params, results) - return err -} - -func (ce *callEngine) call(ctx context.Context, params, results []uint64) (_ []uint64, err error) { - m := ce.f.moduleInstance - if ce.f.parent.ensureTermination { - select { - case <-ctx.Done(): - // If the provided context is already done, close the call context - // and return the error. - m.CloseWithCtxErr(ctx) - return nil, m.FailIfClosed() - default: - } - } - - defer func() { - // If the module closed during the call, and the call didn't err for another reason, set an ExitError. - if err == nil { - err = m.FailIfClosed() - } - // TODO: ^^ Will not fail if the function was imported from a closed module. - - if v := recover(); v != nil { - err = ce.recoverOnCall(ctx, m, v) - } - }() - - ce.pushValues(params) - - if ce.f.parent.ensureTermination { - done := m.CloseModuleOnCanceledOrTimeout(ctx) - defer done() - } - - ce.callFunction(ctx, m, ce.f) - - // This returns a safe copy of the results, instead of a slice view. If we - // returned a re-slice, the caller could accidentally or purposefully - // corrupt the stack of subsequent calls. - ft := ce.f.funcType - if results == nil && ft.ResultNumInUint64 > 0 { - results = make([]uint64, ft.ResultNumInUint64) - } - ce.popValues(results) - return results, nil -} - -// functionListenerInvocation captures arguments needed to perform function -// listener invocations when unwinding the call stack. -type functionListenerInvocation struct { - experimental.FunctionListener - def api.FunctionDefinition -} - -// recoverOnCall takes the recovered value `recoverOnCall`, and wraps it -// with the call frame stack traces. Also, reset the state of callEngine -// so that it can be used for the subsequent calls. -func (ce *callEngine) recoverOnCall(ctx context.Context, m *wasm.ModuleInstance, v interface{}) (err error) { - builder := wasmdebug.NewErrorBuilder() - frameCount := len(ce.frames) - functionListeners := make([]functionListenerInvocation, 0, 16) - - for i := 0; i < frameCount; i++ { - frame := ce.popFrame() - f := frame.f - def := f.definition() - var sources []string - if parent := frame.f.parent; parent.body != nil && len(parent.offsetsInWasmBinary) > 0 { - sources = parent.source.DWARFLines.Line(parent.offsetsInWasmBinary[frame.pc]) - } - builder.AddFrame(def.DebugName(), def.ParamTypes(), def.ResultTypes(), sources) - if f.parent.listener != nil { - functionListeners = append(functionListeners, functionListenerInvocation{ - FunctionListener: f.parent.listener, - def: f.definition(), - }) - } - } - - err = builder.FromRecovered(v) - for i := range functionListeners { - functionListeners[i].Abort(ctx, m, functionListeners[i].def, err) - } - - // Allows the reuse of CallEngine. - ce.stack, ce.frames = ce.stack[:0], ce.frames[:0] - return -} - -func (ce *callEngine) callFunction(ctx context.Context, m *wasm.ModuleInstance, f *function) { - if f.parent.hostFn != nil { - ce.callGoFuncWithStack(ctx, m, f) - } else if lsn := f.parent.listener; lsn != nil { - ce.callNativeFuncWithListener(ctx, m, f, lsn) - } else { - ce.callNativeFunc(ctx, m, f) - } -} - -func (ce *callEngine) callGoFunc(ctx context.Context, m *wasm.ModuleInstance, f *function, stack []uint64) { - typ := f.funcType - lsn := f.parent.listener - if lsn != nil { - params := stack[:typ.ParamNumInUint64] - ce.stackIterator.reset(ce.stack, ce.frames, f) - lsn.Before(ctx, m, f.definition(), params, &ce.stackIterator) - ce.stackIterator.clear() - } - frame := &callFrame{f: f, base: len(ce.stack)} - ce.pushFrame(frame) - - fn := f.parent.hostFn - switch fn := fn.(type) { - case api.GoModuleFunction: - fn.Call(ctx, m, stack) - case api.GoFunction: - fn.Call(ctx, stack) - } - - ce.popFrame() - if lsn != nil { - // TODO: This doesn't get the error due to use of panic to propagate them. - results := stack[:typ.ResultNumInUint64] - lsn.After(ctx, m, f.definition(), results) - } -} - -func (ce *callEngine) callNativeFunc(ctx context.Context, m *wasm.ModuleInstance, f *function) { - frame := &callFrame{f: f, base: len(ce.stack)} - moduleInst := f.moduleInstance - functions := moduleInst.Engine.(*moduleEngine).functions - memoryInst := moduleInst.MemoryInstance - globals := moduleInst.Globals - tables := moduleInst.Tables - typeIDs := moduleInst.TypeIDs - dataInstances := moduleInst.DataInstances - elementInstances := moduleInst.ElementInstances - ce.pushFrame(frame) - body := frame.f.parent.body - bodyLen := uint64(len(body)) - for frame.pc < bodyLen { - op := &body[frame.pc] - // TODO: add description of each operation/case - // on, for example, how many args are used, - // how the stack is modified, etc. - switch op.Kind { - case wazeroir.OperationKindBuiltinFunctionCheckExitCode: - if err := m.FailIfClosed(); err != nil { - panic(err) - } - frame.pc++ - case wazeroir.OperationKindUnreachable: - panic(wasmruntime.ErrRuntimeUnreachable) - case wazeroir.OperationKindBr: - frame.pc = op.U1 - case wazeroir.OperationKindBrIf: - if ce.popValue() > 0 { - ce.drop(op.U3) - frame.pc = op.U1 - } else { - frame.pc = op.U2 - } - case wazeroir.OperationKindBrTable: - v := ce.popValue() - defaultAt := uint64(len(op.Us))/2 - 1 - if v > defaultAt { - v = defaultAt - } - v *= 2 - ce.drop(op.Us[v+1]) - frame.pc = op.Us[v] - case wazeroir.OperationKindCall: - ce.callFunction(ctx, f.moduleInstance, &functions[op.U1]) - frame.pc++ - case wazeroir.OperationKindCallIndirect: - offset := ce.popValue() - table := tables[op.U2] - if offset >= uint64(len(table.References)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } - rawPtr := table.References[offset] - if rawPtr == 0 { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } - - tf := functionFromUintptr(rawPtr) - if tf.typeID != typeIDs[op.U1] { - panic(wasmruntime.ErrRuntimeIndirectCallTypeMismatch) - } - - ce.callFunction(ctx, f.moduleInstance, tf) - frame.pc++ - case wazeroir.OperationKindDrop: - ce.drop(op.U1) - frame.pc++ - case wazeroir.OperationKindSelect: - c := ce.popValue() - if op.B3 { // Target is vector. - x2Hi, x2Lo := ce.popValue(), ce.popValue() - if c == 0 { - _, _ = ce.popValue(), ce.popValue() // discard the x1's lo and hi bits. - ce.pushValue(x2Lo) - ce.pushValue(x2Hi) - } - } else { - v2 := ce.popValue() - if c == 0 { - _ = ce.popValue() - ce.pushValue(v2) - } - } - frame.pc++ - case wazeroir.OperationKindPick: - index := len(ce.stack) - 1 - int(op.U1) - ce.pushValue(ce.stack[index]) - if op.B3 { // V128 value target. - ce.pushValue(ce.stack[index+1]) - } - frame.pc++ - case wazeroir.OperationKindSet: - if op.B3 { // V128 value target. - lowIndex := len(ce.stack) - 1 - int(op.U1) - highIndex := lowIndex + 1 - hi, lo := ce.popValue(), ce.popValue() - ce.stack[lowIndex], ce.stack[highIndex] = lo, hi - } else { - index := len(ce.stack) - 1 - int(op.U1) - ce.stack[index] = ce.popValue() - } - frame.pc++ - case wazeroir.OperationKindGlobalGet: - g := globals[op.U1] - ce.pushValue(g.Val) - if g.Type.ValType == wasm.ValueTypeV128 { - ce.pushValue(g.ValHi) - } - frame.pc++ - case wazeroir.OperationKindGlobalSet: - g := globals[op.U1] - if g.Type.ValType == wasm.ValueTypeV128 { - g.ValHi = ce.popValue() - } - g.Val = ce.popValue() - frame.pc++ - case wazeroir.OperationKindLoad: - offset := ce.popMemoryOffset(op) - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32, wazeroir.UnsignedTypeF32: - if val, ok := memoryInst.ReadUint32Le(offset); !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } else { - ce.pushValue(uint64(val)) - } - case wazeroir.UnsignedTypeI64, wazeroir.UnsignedTypeF64: - if val, ok := memoryInst.ReadUint64Le(offset); !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } else { - ce.pushValue(val) - } - } - frame.pc++ - case wazeroir.OperationKindLoad8: - val, ok := memoryInst.ReadByte(ce.popMemoryOffset(op)) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - - switch wazeroir.SignedInt(op.B1) { - case wazeroir.SignedInt32: - ce.pushValue(uint64(uint32(int8(val)))) - case wazeroir.SignedInt64: - ce.pushValue(uint64(int8(val))) - case wazeroir.SignedUint32, wazeroir.SignedUint64: - ce.pushValue(uint64(val)) - } - frame.pc++ - case wazeroir.OperationKindLoad16: - - val, ok := memoryInst.ReadUint16Le(ce.popMemoryOffset(op)) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - - switch wazeroir.SignedInt(op.B1) { - case wazeroir.SignedInt32: - ce.pushValue(uint64(uint32(int16(val)))) - case wazeroir.SignedInt64: - ce.pushValue(uint64(int16(val))) - case wazeroir.SignedUint32, wazeroir.SignedUint64: - ce.pushValue(uint64(val)) - } - frame.pc++ - case wazeroir.OperationKindLoad32: - val, ok := memoryInst.ReadUint32Le(ce.popMemoryOffset(op)) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - - if op.B1 == 1 { // Signed - ce.pushValue(uint64(int32(val))) - } else { - ce.pushValue(uint64(val)) - } - frame.pc++ - case wazeroir.OperationKindStore: - val := ce.popValue() - offset := ce.popMemoryOffset(op) - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32, wazeroir.UnsignedTypeF32: - if !memoryInst.WriteUint32Le(offset, uint32(val)) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - case wazeroir.UnsignedTypeI64, wazeroir.UnsignedTypeF64: - if !memoryInst.WriteUint64Le(offset, val) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - } - frame.pc++ - case wazeroir.OperationKindStore8: - val := byte(ce.popValue()) - offset := ce.popMemoryOffset(op) - if !memoryInst.WriteByte(offset, val) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - frame.pc++ - case wazeroir.OperationKindStore16: - val := uint16(ce.popValue()) - offset := ce.popMemoryOffset(op) - if !memoryInst.WriteUint16Le(offset, val) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - frame.pc++ - case wazeroir.OperationKindStore32: - val := uint32(ce.popValue()) - offset := ce.popMemoryOffset(op) - if !memoryInst.WriteUint32Le(offset, val) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - frame.pc++ - case wazeroir.OperationKindMemorySize: - ce.pushValue(uint64(memoryInst.PageSize())) - frame.pc++ - case wazeroir.OperationKindMemoryGrow: - n := ce.popValue() - if res, ok := memoryInst.Grow(uint32(n)); !ok { - ce.pushValue(uint64(0xffffffff)) // = -1 in signed 32-bit integer. - } else { - ce.pushValue(uint64(res)) - } - frame.pc++ - case wazeroir.OperationKindConstI32, wazeroir.OperationKindConstI64, - wazeroir.OperationKindConstF32, wazeroir.OperationKindConstF64: - ce.pushValue(op.U1) - frame.pc++ - case wazeroir.OperationKindEq: - var b bool - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32: - v2, v1 := ce.popValue(), ce.popValue() - b = uint32(v1) == uint32(v2) - case wazeroir.UnsignedTypeI64: - v2, v1 := ce.popValue(), ce.popValue() - b = v1 == v2 - case wazeroir.UnsignedTypeF32: - v2, v1 := ce.popValue(), ce.popValue() - b = math.Float32frombits(uint32(v2)) == math.Float32frombits(uint32(v1)) - case wazeroir.UnsignedTypeF64: - v2, v1 := ce.popValue(), ce.popValue() - b = math.Float64frombits(v2) == math.Float64frombits(v1) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindNe: - var b bool - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32, wazeroir.UnsignedTypeI64: - v2, v1 := ce.popValue(), ce.popValue() - b = v1 != v2 - case wazeroir.UnsignedTypeF32: - v2, v1 := ce.popValue(), ce.popValue() - b = math.Float32frombits(uint32(v2)) != math.Float32frombits(uint32(v1)) - case wazeroir.UnsignedTypeF64: - v2, v1 := ce.popValue(), ce.popValue() - b = math.Float64frombits(v2) != math.Float64frombits(v1) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindEqz: - if ce.popValue() == 0 { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindLt: - v2 := ce.popValue() - v1 := ce.popValue() - var b bool - switch wazeroir.SignedType(op.B1) { - case wazeroir.SignedTypeInt32: - b = int32(v1) < int32(v2) - case wazeroir.SignedTypeInt64: - b = int64(v1) < int64(v2) - case wazeroir.SignedTypeUint32, wazeroir.SignedTypeUint64: - b = v1 < v2 - case wazeroir.SignedTypeFloat32: - b = math.Float32frombits(uint32(v1)) < math.Float32frombits(uint32(v2)) - case wazeroir.SignedTypeFloat64: - b = math.Float64frombits(v1) < math.Float64frombits(v2) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindGt: - v2 := ce.popValue() - v1 := ce.popValue() - var b bool - switch wazeroir.SignedType(op.B1) { - case wazeroir.SignedTypeInt32: - b = int32(v1) > int32(v2) - case wazeroir.SignedTypeInt64: - b = int64(v1) > int64(v2) - case wazeroir.SignedTypeUint32, wazeroir.SignedTypeUint64: - b = v1 > v2 - case wazeroir.SignedTypeFloat32: - b = math.Float32frombits(uint32(v1)) > math.Float32frombits(uint32(v2)) - case wazeroir.SignedTypeFloat64: - b = math.Float64frombits(v1) > math.Float64frombits(v2) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindLe: - v2 := ce.popValue() - v1 := ce.popValue() - var b bool - switch wazeroir.SignedType(op.B1) { - case wazeroir.SignedTypeInt32: - b = int32(v1) <= int32(v2) - case wazeroir.SignedTypeInt64: - b = int64(v1) <= int64(v2) - case wazeroir.SignedTypeUint32, wazeroir.SignedTypeUint64: - b = v1 <= v2 - case wazeroir.SignedTypeFloat32: - b = math.Float32frombits(uint32(v1)) <= math.Float32frombits(uint32(v2)) - case wazeroir.SignedTypeFloat64: - b = math.Float64frombits(v1) <= math.Float64frombits(v2) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindGe: - v2 := ce.popValue() - v1 := ce.popValue() - var b bool - switch wazeroir.SignedType(op.B1) { - case wazeroir.SignedTypeInt32: - b = int32(v1) >= int32(v2) - case wazeroir.SignedTypeInt64: - b = int64(v1) >= int64(v2) - case wazeroir.SignedTypeUint32, wazeroir.SignedTypeUint64: - b = v1 >= v2 - case wazeroir.SignedTypeFloat32: - b = math.Float32frombits(uint32(v1)) >= math.Float32frombits(uint32(v2)) - case wazeroir.SignedTypeFloat64: - b = math.Float64frombits(v1) >= math.Float64frombits(v2) - } - if b { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindAdd: - v2 := ce.popValue() - v1 := ce.popValue() - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32: - v := uint32(v1) + uint32(v2) - ce.pushValue(uint64(v)) - case wazeroir.UnsignedTypeI64: - ce.pushValue(v1 + v2) - case wazeroir.UnsignedTypeF32: - ce.pushValue(addFloat32bits(uint32(v1), uint32(v2))) - case wazeroir.UnsignedTypeF64: - v := math.Float64frombits(v1) + math.Float64frombits(v2) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindSub: - v2 := ce.popValue() - v1 := ce.popValue() - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32: - ce.pushValue(uint64(uint32(v1) - uint32(v2))) - case wazeroir.UnsignedTypeI64: - ce.pushValue(v1 - v2) - case wazeroir.UnsignedTypeF32: - ce.pushValue(subFloat32bits(uint32(v1), uint32(v2))) - case wazeroir.UnsignedTypeF64: - v := math.Float64frombits(v1) - math.Float64frombits(v2) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindMul: - v2 := ce.popValue() - v1 := ce.popValue() - switch wazeroir.UnsignedType(op.B1) { - case wazeroir.UnsignedTypeI32: - ce.pushValue(uint64(uint32(v1) * uint32(v2))) - case wazeroir.UnsignedTypeI64: - ce.pushValue(v1 * v2) - case wazeroir.UnsignedTypeF32: - ce.pushValue(mulFloat32bits(uint32(v1), uint32(v2))) - case wazeroir.UnsignedTypeF64: - v := math.Float64frombits(v2) * math.Float64frombits(v1) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindClz: - v := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(bits.LeadingZeros32(uint32(v)))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(bits.LeadingZeros64(v))) - } - frame.pc++ - case wazeroir.OperationKindCtz: - v := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(bits.TrailingZeros32(uint32(v)))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(bits.TrailingZeros64(v))) - } - frame.pc++ - case wazeroir.OperationKindPopcnt: - v := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(bits.OnesCount32(uint32(v)))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(bits.OnesCount64(v))) - } - frame.pc++ - case wazeroir.OperationKindDiv: - // If an integer, check we won't divide by zero. - t := wazeroir.SignedType(op.B1) - v2, v1 := ce.popValue(), ce.popValue() - switch t { - case wazeroir.SignedTypeFloat32, wazeroir.SignedTypeFloat64: // not integers - default: - if v2 == 0 { - panic(wasmruntime.ErrRuntimeIntegerDivideByZero) - } - } - - switch t { - case wazeroir.SignedTypeInt32: - d := int32(v2) - n := int32(v1) - if n == math.MinInt32 && d == -1 { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - ce.pushValue(uint64(uint32(n / d))) - case wazeroir.SignedTypeInt64: - d := int64(v2) - n := int64(v1) - if n == math.MinInt64 && d == -1 { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - ce.pushValue(uint64(n / d)) - case wazeroir.SignedTypeUint32: - d := uint32(v2) - n := uint32(v1) - ce.pushValue(uint64(n / d)) - case wazeroir.SignedTypeUint64: - d := v2 - n := v1 - ce.pushValue(n / d) - case wazeroir.SignedTypeFloat32: - ce.pushValue(divFloat32bits(uint32(v1), uint32(v2))) - case wazeroir.SignedTypeFloat64: - ce.pushValue(math.Float64bits(math.Float64frombits(v1) / math.Float64frombits(v2))) - } - frame.pc++ - case wazeroir.OperationKindRem: - v2, v1 := ce.popValue(), ce.popValue() - if v2 == 0 { - panic(wasmruntime.ErrRuntimeIntegerDivideByZero) - } - switch wazeroir.SignedInt(op.B1) { - case wazeroir.SignedInt32: - d := int32(v2) - n := int32(v1) - ce.pushValue(uint64(uint32(n % d))) - case wazeroir.SignedInt64: - d := int64(v2) - n := int64(v1) - ce.pushValue(uint64(n % d)) - case wazeroir.SignedUint32: - d := uint32(v2) - n := uint32(v1) - ce.pushValue(uint64(n % d)) - case wazeroir.SignedUint64: - d := v2 - n := v1 - ce.pushValue(n % d) - } - frame.pc++ - case wazeroir.OperationKindAnd: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(uint32(v2) & uint32(v1))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(v2 & v1)) - } - frame.pc++ - case wazeroir.OperationKindOr: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(uint32(v2) | uint32(v1))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(v2 | v1)) - } - frame.pc++ - case wazeroir.OperationKindXor: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(uint32(v2) ^ uint32(v1))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(v2 ^ v1)) - } - frame.pc++ - case wazeroir.OperationKindShl: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(uint32(v1) << (uint32(v2) % 32))) - } else { - // UnsignedInt64 - ce.pushValue(v1 << (v2 % 64)) - } - frame.pc++ - case wazeroir.OperationKindShr: - v2 := ce.popValue() - v1 := ce.popValue() - switch wazeroir.SignedInt(op.B1) { - case wazeroir.SignedInt32: - ce.pushValue(uint64(uint32(int32(v1) >> (uint32(v2) % 32)))) - case wazeroir.SignedInt64: - ce.pushValue(uint64(int64(v1) >> (v2 % 64))) - case wazeroir.SignedUint32: - ce.pushValue(uint64(uint32(v1) >> (uint32(v2) % 32))) - case wazeroir.SignedUint64: - ce.pushValue(v1 >> (v2 % 64)) - } - frame.pc++ - case wazeroir.OperationKindRotl: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(bits.RotateLeft32(uint32(v1), int(v2)))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(bits.RotateLeft64(v1, int(v2)))) - } - frame.pc++ - case wazeroir.OperationKindRotr: - v2 := ce.popValue() - v1 := ce.popValue() - if op.B1 == 0 { - // UnsignedInt32 - ce.pushValue(uint64(bits.RotateLeft32(uint32(v1), -int(v2)))) - } else { - // UnsignedInt64 - ce.pushValue(uint64(bits.RotateLeft64(v1, -int(v2)))) - } - frame.pc++ - case wazeroir.OperationKindAbs: - if op.B1 == 0 { - // Float32 - const mask uint32 = 1 << 31 - ce.pushValue(uint64(uint32(ce.popValue()) &^ mask)) - } else { - // Float64 - const mask uint64 = 1 << 63 - ce.pushValue(ce.popValue() &^ mask) - } - frame.pc++ - case wazeroir.OperationKindNeg: - if op.B1 == 0 { - // Float32 - v := -math.Float32frombits(uint32(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := -math.Float64frombits(ce.popValue()) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindCeil: - if op.B1 == 0 { - // Float32 - v := moremath.WasmCompatCeilF32(math.Float32frombits(uint32(ce.popValue()))) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := moremath.WasmCompatCeilF64(math.Float64frombits(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindFloor: - if op.B1 == 0 { - // Float32 - v := moremath.WasmCompatFloorF32(math.Float32frombits(uint32(ce.popValue()))) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := moremath.WasmCompatFloorF64(math.Float64frombits(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindTrunc: - if op.B1 == 0 { - // Float32 - v := moremath.WasmCompatTruncF32(math.Float32frombits(uint32(ce.popValue()))) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := moremath.WasmCompatTruncF64(math.Float64frombits(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindNearest: - if op.B1 == 0 { - // Float32 - f := math.Float32frombits(uint32(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(moremath.WasmCompatNearestF32(f)))) - } else { - // Float64 - f := math.Float64frombits(ce.popValue()) - ce.pushValue(math.Float64bits(moremath.WasmCompatNearestF64(f))) - } - frame.pc++ - case wazeroir.OperationKindSqrt: - if op.B1 == 0 { - // Float32 - v := math.Sqrt(float64(math.Float32frombits(uint32(ce.popValue())))) - ce.pushValue(uint64(math.Float32bits(float32(v)))) - } else { - // Float64 - v := math.Sqrt(math.Float64frombits(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - frame.pc++ - case wazeroir.OperationKindMin: - if op.B1 == 0 { - // Float32 - ce.pushValue(WasmCompatMin32bits(uint32(ce.popValue()), uint32(ce.popValue()))) - } else { - v2 := math.Float64frombits(ce.popValue()) - v1 := math.Float64frombits(ce.popValue()) - ce.pushValue(math.Float64bits(moremath.WasmCompatMin64(v1, v2))) - } - frame.pc++ - case wazeroir.OperationKindMax: - if op.B1 == 0 { - ce.pushValue(WasmCompatMax32bits(uint32(ce.popValue()), uint32(ce.popValue()))) - } else { - // Float64 - v2 := math.Float64frombits(ce.popValue()) - v1 := math.Float64frombits(ce.popValue()) - ce.pushValue(math.Float64bits(moremath.WasmCompatMax64(v1, v2))) - } - frame.pc++ - case wazeroir.OperationKindCopysign: - if op.B1 == 0 { - // Float32 - v2 := uint32(ce.popValue()) - v1 := uint32(ce.popValue()) - const signbit = 1 << 31 - ce.pushValue(uint64(v1&^signbit | v2&signbit)) - } else { - // Float64 - v2 := ce.popValue() - v1 := ce.popValue() - const signbit = 1 << 63 - ce.pushValue(v1&^signbit | v2&signbit) - } - frame.pc++ - case wazeroir.OperationKindI32WrapFromI64: - ce.pushValue(uint64(uint32(ce.popValue()))) - frame.pc++ - case wazeroir.OperationKindITruncFromF: - if op.B1 == 0 { - // Float32 - switch wazeroir.SignedInt(op.B2) { - case wazeroir.SignedInt32: - v := math.Trunc(float64(math.Float32frombits(uint32(ce.popValue())))) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - v = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < math.MinInt32 || v > math.MaxInt32 { - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing sources. - if v < 0 { - v = math.MinInt32 - } else { - v = math.MaxInt32 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(uint32(int32(v)))) - case wazeroir.SignedInt64: - v := math.Trunc(float64(math.Float32frombits(uint32(ce.popValue())))) - res := int64(v) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - res = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < math.MinInt64 || v >= math.MaxInt64 { - // Note: math.MaxInt64 is rounded up to math.MaxInt64+1 in 64-bit float representation, - // and that's why we use '>=' not '>' to check overflow. - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing sources. - if v < 0 { - res = math.MinInt64 - } else { - res = math.MaxInt64 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(res)) - case wazeroir.SignedUint32: - v := math.Trunc(float64(math.Float32frombits(uint32(ce.popValue())))) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - v = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < 0 || v > math.MaxUint32 { - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - v = 0 - } else { - v = math.MaxUint32 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(uint32(v))) - case wazeroir.SignedUint64: - v := math.Trunc(float64(math.Float32frombits(uint32(ce.popValue())))) - res := uint64(v) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - res = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < 0 || v >= math.MaxUint64 { - // Note: math.MaxUint64 is rounded up to math.MaxUint64+1 in 64-bit float representation, - // and that's why we use '>=' not '>' to check overflow. - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - res = 0 - } else { - res = math.MaxUint64 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(res) - } - } else { - // Float64 - switch wazeroir.SignedInt(op.B2) { - case wazeroir.SignedInt32: - v := math.Trunc(math.Float64frombits(ce.popValue())) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - v = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < math.MinInt32 || v > math.MaxInt32 { - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - v = math.MinInt32 - } else { - v = math.MaxInt32 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(uint32(int32(v)))) - case wazeroir.SignedInt64: - v := math.Trunc(math.Float64frombits(ce.popValue())) - res := int64(v) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - res = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < math.MinInt64 || v >= math.MaxInt64 { - // Note: math.MaxInt64 is rounded up to math.MaxInt64+1 in 64-bit float representation, - // and that's why we use '>=' not '>' to check overflow. - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - res = math.MinInt64 - } else { - res = math.MaxInt64 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(res)) - case wazeroir.SignedUint32: - v := math.Trunc(math.Float64frombits(ce.popValue())) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - v = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < 0 || v > math.MaxUint32 { - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - v = 0 - } else { - v = math.MaxUint32 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(uint64(uint32(v))) - case wazeroir.SignedUint64: - v := math.Trunc(math.Float64frombits(ce.popValue())) - res := uint64(v) - if math.IsNaN(v) { // NaN cannot be compared with themselves, so we have to use IsNaN - if op.B3 { - // non-trapping conversion must cast nan to zero. - res = 0 - } else { - panic(wasmruntime.ErrRuntimeInvalidConversionToInteger) - } - } else if v < 0 || v >= math.MaxUint64 { - // Note: math.MaxUint64 is rounded up to math.MaxUint64+1 in 64-bit float representation, - // and that's why we use '>=' not '>' to check overflow. - if op.B3 { - // non-trapping conversion must "saturate" the value for overflowing source. - if v < 0 { - res = 0 - } else { - res = math.MaxUint64 - } - } else { - panic(wasmruntime.ErrRuntimeIntegerOverflow) - } - } - ce.pushValue(res) - } - } - frame.pc++ - case wazeroir.OperationKindFConvertFromI: - switch wazeroir.SignedInt(op.B1) { - case wazeroir.SignedInt32: - if op.B2 == 0 { - // Float32 - v := float32(int32(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := float64(int32(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - case wazeroir.SignedInt64: - if op.B2 == 0 { - // Float32 - v := float32(int64(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := float64(int64(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - case wazeroir.SignedUint32: - if op.B2 == 0 { - // Float32 - v := float32(uint32(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := float64(uint32(ce.popValue())) - ce.pushValue(math.Float64bits(v)) - } - case wazeroir.SignedUint64: - if op.B2 == 0 { - // Float32 - v := float32(ce.popValue()) - ce.pushValue(uint64(math.Float32bits(v))) - } else { - // Float64 - v := float64(ce.popValue()) - ce.pushValue(math.Float64bits(v)) - } - } - frame.pc++ - case wazeroir.OperationKindF32DemoteFromF64: - v := float32(math.Float64frombits(ce.popValue())) - ce.pushValue(uint64(math.Float32bits(v))) - frame.pc++ - case wazeroir.OperationKindF64PromoteFromF32: - v := float64(math.Float32frombits(uint32(ce.popValue()))) - ce.pushValue(math.Float64bits(v)) - frame.pc++ - case wazeroir.OperationKindExtend: - if op.B1 == 1 { - // Signed. - v := int64(int32(ce.popValue())) - ce.pushValue(uint64(v)) - } else { - v := uint64(uint32(ce.popValue())) - ce.pushValue(v) - } - frame.pc++ - case wazeroir.OperationKindSignExtend32From8: - v := uint32(int8(ce.popValue())) - ce.pushValue(uint64(v)) - frame.pc++ - case wazeroir.OperationKindSignExtend32From16: - v := uint32(int16(ce.popValue())) - ce.pushValue(uint64(v)) - frame.pc++ - case wazeroir.OperationKindSignExtend64From8: - v := int64(int8(ce.popValue())) - ce.pushValue(uint64(v)) - frame.pc++ - case wazeroir.OperationKindSignExtend64From16: - v := int64(int16(ce.popValue())) - ce.pushValue(uint64(v)) - frame.pc++ - case wazeroir.OperationKindSignExtend64From32: - v := int64(int32(ce.popValue())) - ce.pushValue(uint64(v)) - frame.pc++ - case wazeroir.OperationKindMemoryInit: - dataInstance := dataInstances[op.U1] - copySize := ce.popValue() - inDataOffset := ce.popValue() - inMemoryOffset := ce.popValue() - if inDataOffset+copySize > uint64(len(dataInstance)) || - inMemoryOffset+copySize > uint64(len(memoryInst.Buffer)) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } else if copySize != 0 { - copy(memoryInst.Buffer[inMemoryOffset:inMemoryOffset+copySize], dataInstance[inDataOffset:]) - } - frame.pc++ - case wazeroir.OperationKindDataDrop: - dataInstances[op.U1] = nil - frame.pc++ - case wazeroir.OperationKindMemoryCopy: - memLen := uint64(len(memoryInst.Buffer)) - copySize := ce.popValue() - sourceOffset := ce.popValue() - destinationOffset := ce.popValue() - if sourceOffset+copySize > memLen || destinationOffset+copySize > memLen { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } else if copySize != 0 { - copy(memoryInst.Buffer[destinationOffset:], - memoryInst.Buffer[sourceOffset:sourceOffset+copySize]) - } - frame.pc++ - case wazeroir.OperationKindMemoryFill: - fillSize := ce.popValue() - value := byte(ce.popValue()) - offset := ce.popValue() - if fillSize+offset > uint64(len(memoryInst.Buffer)) { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } else if fillSize != 0 { - // Uses the copy trick for faster filling buffer. - // https://gist.github.com/taylorza/df2f89d5f9ab3ffd06865062a4cf015d - buf := memoryInst.Buffer[offset : offset+fillSize] - buf[0] = value - for i := 1; i < len(buf); i *= 2 { - copy(buf[i:], buf[:i]) - } - } - frame.pc++ - case wazeroir.OperationKindTableInit: - elementInstance := elementInstances[op.U1] - copySize := ce.popValue() - inElementOffset := ce.popValue() - inTableOffset := ce.popValue() - table := tables[op.U2] - if inElementOffset+copySize > uint64(len(elementInstance.References)) || - inTableOffset+copySize > uint64(len(table.References)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } else if copySize != 0 { - copy(table.References[inTableOffset:inTableOffset+copySize], elementInstance.References[inElementOffset:]) - } - frame.pc++ - case wazeroir.OperationKindElemDrop: - elementInstances[op.U1].References = nil - frame.pc++ - case wazeroir.OperationKindTableCopy: - srcTable, dstTable := tables[op.U1].References, tables[op.U2].References - copySize := ce.popValue() - sourceOffset := ce.popValue() - destinationOffset := ce.popValue() - if sourceOffset+copySize > uint64(len(srcTable)) || destinationOffset+copySize > uint64(len(dstTable)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } else if copySize != 0 { - copy(dstTable[destinationOffset:], srcTable[sourceOffset:sourceOffset+copySize]) - } - frame.pc++ - case wazeroir.OperationKindRefFunc: - ce.pushValue(uint64(uintptr(unsafe.Pointer(&functions[op.U1])))) - frame.pc++ - case wazeroir.OperationKindTableGet: - table := tables[op.U1] - - offset := ce.popValue() - if offset >= uint64(len(table.References)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } - - ce.pushValue(uint64(table.References[offset])) - frame.pc++ - case wazeroir.OperationKindTableSet: - table := tables[op.U1] - ref := ce.popValue() - - offset := ce.popValue() - if offset >= uint64(len(table.References)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } - - table.References[offset] = uintptr(ref) // externrefs are opaque uint64. - frame.pc++ - case wazeroir.OperationKindTableSize: - table := tables[op.U1] - ce.pushValue(uint64(len(table.References))) - frame.pc++ - case wazeroir.OperationKindTableGrow: - table := tables[op.U1] - num, ref := ce.popValue(), ce.popValue() - ret := table.Grow(uint32(num), uintptr(ref)) - ce.pushValue(uint64(ret)) - frame.pc++ - case wazeroir.OperationKindTableFill: - table := tables[op.U1] - num := ce.popValue() - ref := uintptr(ce.popValue()) - offset := ce.popValue() - if num+offset > uint64(len(table.References)) { - panic(wasmruntime.ErrRuntimeInvalidTableAccess) - } else if num > 0 { - // Uses the copy trick for faster filling the region with the value. - // https://gist.github.com/taylorza/df2f89d5f9ab3ffd06865062a4cf015d - targetRegion := table.References[offset : offset+num] - targetRegion[0] = ref - for i := 1; i < len(targetRegion); i *= 2 { - copy(targetRegion[i:], targetRegion[:i]) - } - } - frame.pc++ - case wazeroir.OperationKindV128Const: - lo, hi := op.U1, op.U2 - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Add: - yHigh, yLow := ce.popValue(), ce.popValue() - xHigh, xLow := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - ce.pushValue( - uint64(uint8(xLow>>8)+uint8(yLow>>8))<<8 | uint64(uint8(xLow)+uint8(yLow)) | - uint64(uint8(xLow>>24)+uint8(yLow>>24))<<24 | uint64(uint8(xLow>>16)+uint8(yLow>>16))<<16 | - uint64(uint8(xLow>>40)+uint8(yLow>>40))<<40 | uint64(uint8(xLow>>32)+uint8(yLow>>32))<<32 | - uint64(uint8(xLow>>56)+uint8(yLow>>56))<<56 | uint64(uint8(xLow>>48)+uint8(yLow>>48))<<48, - ) - ce.pushValue( - uint64(uint8(xHigh>>8)+uint8(yHigh>>8))<<8 | uint64(uint8(xHigh)+uint8(yHigh)) | - uint64(uint8(xHigh>>24)+uint8(yHigh>>24))<<24 | uint64(uint8(xHigh>>16)+uint8(yHigh>>16))<<16 | - uint64(uint8(xHigh>>40)+uint8(yHigh>>40))<<40 | uint64(uint8(xHigh>>32)+uint8(yHigh>>32))<<32 | - uint64(uint8(xHigh>>56)+uint8(yHigh>>56))<<56 | uint64(uint8(xHigh>>48)+uint8(yHigh>>48))<<48, - ) - case wazeroir.ShapeI16x8: - ce.pushValue( - uint64(uint16(xLow>>16+yLow>>16))<<16 | uint64(uint16(xLow)+uint16(yLow)) | - uint64(uint16(xLow>>48+yLow>>48))<<48 | uint64(uint16(xLow>>32+yLow>>32))<<32, - ) - ce.pushValue( - uint64(uint16(xHigh>>16)+uint16(yHigh>>16))<<16 | uint64(uint16(xHigh)+uint16(yHigh)) | - uint64(uint16(xHigh>>48)+uint16(yHigh>>48))<<48 | uint64(uint16(xHigh>>32)+uint16(yHigh>>32))<<32, - ) - case wazeroir.ShapeI32x4: - ce.pushValue(uint64(uint32(xLow>>32)+uint32(yLow>>32))<<32 | uint64(uint32(xLow)+uint32(yLow))) - ce.pushValue(uint64(uint32(xHigh>>32)+uint32(yHigh>>32))<<32 | uint64(uint32(xHigh)+uint32(yHigh))) - case wazeroir.ShapeI64x2: - ce.pushValue(xLow + yLow) - ce.pushValue(xHigh + yHigh) - case wazeroir.ShapeF32x4: - ce.pushValue( - addFloat32bits(uint32(xLow), uint32(yLow)) | addFloat32bits(uint32(xLow>>32), uint32(yLow>>32))<<32, - ) - ce.pushValue( - addFloat32bits(uint32(xHigh), uint32(yHigh)) | addFloat32bits(uint32(xHigh>>32), uint32(yHigh>>32))<<32, - ) - case wazeroir.ShapeF64x2: - ce.pushValue(math.Float64bits(math.Float64frombits(xLow) + math.Float64frombits(yLow))) - ce.pushValue(math.Float64bits(math.Float64frombits(xHigh) + math.Float64frombits(yHigh))) - } - frame.pc++ - case wazeroir.OperationKindV128Sub: - yHigh, yLow := ce.popValue(), ce.popValue() - xHigh, xLow := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - ce.pushValue( - uint64(uint8(xLow>>8)-uint8(yLow>>8))<<8 | uint64(uint8(xLow)-uint8(yLow)) | - uint64(uint8(xLow>>24)-uint8(yLow>>24))<<24 | uint64(uint8(xLow>>16)-uint8(yLow>>16))<<16 | - uint64(uint8(xLow>>40)-uint8(yLow>>40))<<40 | uint64(uint8(xLow>>32)-uint8(yLow>>32))<<32 | - uint64(uint8(xLow>>56)-uint8(yLow>>56))<<56 | uint64(uint8(xLow>>48)-uint8(yLow>>48))<<48, - ) - ce.pushValue( - uint64(uint8(xHigh>>8)-uint8(yHigh>>8))<<8 | uint64(uint8(xHigh)-uint8(yHigh)) | - uint64(uint8(xHigh>>24)-uint8(yHigh>>24))<<24 | uint64(uint8(xHigh>>16)-uint8(yHigh>>16))<<16 | - uint64(uint8(xHigh>>40)-uint8(yHigh>>40))<<40 | uint64(uint8(xHigh>>32)-uint8(yHigh>>32))<<32 | - uint64(uint8(xHigh>>56)-uint8(yHigh>>56))<<56 | uint64(uint8(xHigh>>48)-uint8(yHigh>>48))<<48, - ) - case wazeroir.ShapeI16x8: - ce.pushValue( - uint64(uint16(xLow>>16)-uint16(yLow>>16))<<16 | uint64(uint16(xLow)-uint16(yLow)) | - uint64(uint16(xLow>>48)-uint16(yLow>>48))<<48 | uint64(uint16(xLow>>32)-uint16(yLow>>32))<<32, - ) - ce.pushValue( - uint64(uint16(xHigh>>16)-uint16(yHigh>>16))<<16 | uint64(uint16(xHigh)-uint16(yHigh)) | - uint64(uint16(xHigh>>48)-uint16(yHigh>>48))<<48 | uint64(uint16(xHigh>>32)-uint16(yHigh>>32))<<32, - ) - case wazeroir.ShapeI32x4: - ce.pushValue(uint64(uint32(xLow>>32-yLow>>32))<<32 | uint64(uint32(xLow)-uint32(yLow))) - ce.pushValue(uint64(uint32(xHigh>>32-yHigh>>32))<<32 | uint64(uint32(xHigh)-uint32(yHigh))) - case wazeroir.ShapeI64x2: - ce.pushValue(xLow - yLow) - ce.pushValue(xHigh - yHigh) - case wazeroir.ShapeF32x4: - ce.pushValue( - subFloat32bits(uint32(xLow), uint32(yLow)) | subFloat32bits(uint32(xLow>>32), uint32(yLow>>32))<<32, - ) - ce.pushValue( - subFloat32bits(uint32(xHigh), uint32(yHigh)) | subFloat32bits(uint32(xHigh>>32), uint32(yHigh>>32))<<32, - ) - case wazeroir.ShapeF64x2: - ce.pushValue(math.Float64bits(math.Float64frombits(xLow) - math.Float64frombits(yLow))) - ce.pushValue(math.Float64bits(math.Float64frombits(xHigh) - math.Float64frombits(yHigh))) - } - frame.pc++ - case wazeroir.OperationKindV128Load: - offset := ce.popMemoryOffset(op) - switch op.B1 { - case wazeroir.V128LoadType128: - lo, ok := memoryInst.ReadUint64Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(lo) - hi, ok := memoryInst.ReadUint64Le(offset + 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(hi) - case wazeroir.V128LoadType8x8s: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue( - uint64(uint16(int8(data[3])))<<48 | uint64(uint16(int8(data[2])))<<32 | uint64(uint16(int8(data[1])))<<16 | uint64(uint16(int8(data[0]))), - ) - ce.pushValue( - uint64(uint16(int8(data[7])))<<48 | uint64(uint16(int8(data[6])))<<32 | uint64(uint16(int8(data[5])))<<16 | uint64(uint16(int8(data[4]))), - ) - case wazeroir.V128LoadType8x8u: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue( - uint64(data[3])<<48 | uint64(data[2])<<32 | uint64(data[1])<<16 | uint64(data[0]), - ) - ce.pushValue( - uint64(data[7])<<48 | uint64(data[6])<<32 | uint64(data[5])<<16 | uint64(data[4]), - ) - case wazeroir.V128LoadType16x4s: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue( - uint64(int16(binary.LittleEndian.Uint16(data[2:])))<<32 | - uint64(uint32(int16(binary.LittleEndian.Uint16(data)))), - ) - ce.pushValue( - uint64(uint32(int16(binary.LittleEndian.Uint16(data[6:]))))<<32 | - uint64(uint32(int16(binary.LittleEndian.Uint16(data[4:])))), - ) - case wazeroir.V128LoadType16x4u: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue( - uint64(binary.LittleEndian.Uint16(data[2:]))<<32 | uint64(binary.LittleEndian.Uint16(data)), - ) - ce.pushValue( - uint64(binary.LittleEndian.Uint16(data[6:]))<<32 | uint64(binary.LittleEndian.Uint16(data[4:])), - ) - case wazeroir.V128LoadType32x2s: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(uint64(int32(binary.LittleEndian.Uint32(data)))) - ce.pushValue(uint64(int32(binary.LittleEndian.Uint32(data[4:])))) - case wazeroir.V128LoadType32x2u: - data, ok := memoryInst.Read(offset, 8) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(uint64(binary.LittleEndian.Uint32(data))) - ce.pushValue(uint64(binary.LittleEndian.Uint32(data[4:]))) - case wazeroir.V128LoadType8Splat: - v, ok := memoryInst.ReadByte(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - v8 := uint64(v)<<56 | uint64(v)<<48 | uint64(v)<<40 | uint64(v)<<32 | - uint64(v)<<24 | uint64(v)<<16 | uint64(v)<<8 | uint64(v) - ce.pushValue(v8) - ce.pushValue(v8) - case wazeroir.V128LoadType16Splat: - v, ok := memoryInst.ReadUint16Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - v4 := uint64(v)<<48 | uint64(v)<<32 | uint64(v)<<16 | uint64(v) - ce.pushValue(v4) - ce.pushValue(v4) - case wazeroir.V128LoadType32Splat: - v, ok := memoryInst.ReadUint32Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - vv := uint64(v)<<32 | uint64(v) - ce.pushValue(vv) - ce.pushValue(vv) - case wazeroir.V128LoadType64Splat: - lo, ok := memoryInst.ReadUint64Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(lo) - ce.pushValue(lo) - case wazeroir.V128LoadType32zero: - lo, ok := memoryInst.ReadUint32Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(uint64(lo)) - ce.pushValue(0) - case wazeroir.V128LoadType64zero: - lo, ok := memoryInst.ReadUint64Le(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - ce.pushValue(lo) - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindV128LoadLane: - hi, lo := ce.popValue(), ce.popValue() - offset := ce.popMemoryOffset(op) - switch op.B1 { - case 8: - b, ok := memoryInst.ReadByte(offset) - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - if op.B2 < 8 { - s := op.B2 << 3 - lo = (lo & ^(0xff << s)) | uint64(b)<>(op.B2*8))) - } else { - ok = memoryInst.WriteByte(offset, byte(hi>>((op.B2-8)*8))) - } - case 16: - if op.B2 < 4 { - ok = memoryInst.WriteUint16Le(offset, uint16(lo>>(op.B2*16))) - } else { - ok = memoryInst.WriteUint16Le(offset, uint16(hi>>((op.B2-4)*16))) - } - case 32: - if op.B2 < 2 { - ok = memoryInst.WriteUint32Le(offset, uint32(lo>>(op.B2*32))) - } else { - ok = memoryInst.WriteUint32Le(offset, uint32(hi>>((op.B2-2)*32))) - } - case 64: - if op.B2 == 0 { - ok = memoryInst.WriteUint64Le(offset, lo) - } else { - ok = memoryInst.WriteUint64Le(offset, hi) - } - } - if !ok { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - frame.pc++ - case wazeroir.OperationKindV128ReplaceLane: - v := ce.popValue() - hi, lo := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - if op.B2 < 8 { - s := op.B2 << 3 - lo = (lo & ^(0xff << s)) | uint64(byte(v))<> (op.B2 * 8)) - } else { - u8 = byte(hi >> ((op.B2 - 8) * 8)) - } - if op.B3 { - // sign-extend. - v = uint64(uint32(int8(u8))) - } else { - v = uint64(u8) - } - case wazeroir.ShapeI16x8: - var u16 uint16 - if op.B2 < 4 { - u16 = uint16(lo >> (op.B2 * 16)) - } else { - u16 = uint16(hi >> ((op.B2 - 4) * 16)) - } - if op.B3 { - // sign-extend. - v = uint64(uint32(int16(u16))) - } else { - v = uint64(u16) - } - case wazeroir.ShapeI32x4, wazeroir.ShapeF32x4: - if op.B2 < 2 { - v = uint64(uint32(lo >> (op.B2 * 32))) - } else { - v = uint64(uint32(hi >> ((op.B2 - 2) * 32))) - } - case wazeroir.ShapeI64x2, wazeroir.ShapeF64x2: - if op.B2 == 0 { - v = lo - } else { - v = hi - } - } - ce.pushValue(v) - frame.pc++ - case wazeroir.OperationKindV128Splat: - v := ce.popValue() - var hi, lo uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - v8 := uint64(byte(v))<<56 | uint64(byte(v))<<48 | uint64(byte(v))<<40 | uint64(byte(v))<<32 | - uint64(byte(v))<<24 | uint64(byte(v))<<16 | uint64(byte(v))<<8 | uint64(byte(v)) - hi, lo = v8, v8 - case wazeroir.ShapeI16x8: - v4 := uint64(uint16(v))<<48 | uint64(uint16(v))<<32 | uint64(uint16(v))<<16 | uint64(uint16(v)) - hi, lo = v4, v4 - case wazeroir.ShapeI32x4, wazeroir.ShapeF32x4: - v2 := uint64(uint32(v))<<32 | uint64(uint32(v)) - lo, hi = v2, v2 - case wazeroir.ShapeI64x2, wazeroir.ShapeF64x2: - lo, hi = v, v - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Swizzle: - idxHi, idxLo := ce.popValue(), ce.popValue() - baseHi, baseLo := ce.popValue(), ce.popValue() - var newVal [16]byte - for i := 0; i < 16; i++ { - var id byte - if i < 8 { - id = byte(idxLo >> (i * 8)) - } else { - id = byte(idxHi >> ((i - 8) * 8)) - } - if id < 8 { - newVal[i] = byte(baseLo >> (id * 8)) - } else if id < 16 { - newVal[i] = byte(baseHi >> ((id - 8) * 8)) - } - } - ce.pushValue(binary.LittleEndian.Uint64(newVal[:8])) - ce.pushValue(binary.LittleEndian.Uint64(newVal[8:])) - frame.pc++ - case wazeroir.OperationKindV128Shuffle: - xHi, xLo, yHi, yLo := ce.popValue(), ce.popValue(), ce.popValue(), ce.popValue() - var newVal [16]byte - for i, l := range op.Us { - if l < 8 { - newVal[i] = byte(yLo >> (l * 8)) - } else if l < 16 { - newVal[i] = byte(yHi >> ((l - 8) * 8)) - } else if l < 24 { - newVal[i] = byte(xLo >> ((l - 16) * 8)) - } else if l < 32 { - newVal[i] = byte(xHi >> ((l - 24) * 8)) - } - } - ce.pushValue(binary.LittleEndian.Uint64(newVal[:8])) - ce.pushValue(binary.LittleEndian.Uint64(newVal[8:])) - frame.pc++ - case wazeroir.OperationKindV128AnyTrue: - hi, lo := ce.popValue(), ce.popValue() - if hi != 0 || lo != 0 { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindV128AllTrue: - hi, lo := ce.popValue(), ce.popValue() - var ret bool - switch op.B1 { - case wazeroir.ShapeI8x16: - ret = (uint8(lo) != 0) && (uint8(lo>>8) != 0) && (uint8(lo>>16) != 0) && (uint8(lo>>24) != 0) && - (uint8(lo>>32) != 0) && (uint8(lo>>40) != 0) && (uint8(lo>>48) != 0) && (uint8(lo>>56) != 0) && - (uint8(hi) != 0) && (uint8(hi>>8) != 0) && (uint8(hi>>16) != 0) && (uint8(hi>>24) != 0) && - (uint8(hi>>32) != 0) && (uint8(hi>>40) != 0) && (uint8(hi>>48) != 0) && (uint8(hi>>56) != 0) - case wazeroir.ShapeI16x8: - ret = (uint16(lo) != 0) && (uint16(lo>>16) != 0) && (uint16(lo>>32) != 0) && (uint16(lo>>48) != 0) && - (uint16(hi) != 0) && (uint16(hi>>16) != 0) && (uint16(hi>>32) != 0) && (uint16(hi>>48) != 0) - case wazeroir.ShapeI32x4: - ret = (uint32(lo) != 0) && (uint32(lo>>32) != 0) && - (uint32(hi) != 0) && (uint32(hi>>32) != 0) - case wazeroir.ShapeI64x2: - ret = (lo != 0) && - (hi != 0) - } - if ret { - ce.pushValue(1) - } else { - ce.pushValue(0) - } - frame.pc++ - case wazeroir.OperationKindV128BitMask: - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#bitmask-extraction - hi, lo := ce.popValue(), ce.popValue() - var res uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 8; i++ { - if int8(lo>>(i*8)) < 0 { - res |= 1 << i - } - } - for i := 0; i < 8; i++ { - if int8(hi>>(i*8)) < 0 { - res |= 1 << (i + 8) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 4; i++ { - if int16(lo>>(i*16)) < 0 { - res |= 1 << i - } - } - for i := 0; i < 4; i++ { - if int16(hi>>(i*16)) < 0 { - res |= 1 << (i + 4) - } - } - case wazeroir.ShapeI32x4: - for i := 0; i < 2; i++ { - if int32(lo>>(i*32)) < 0 { - res |= 1 << i - } - } - for i := 0; i < 2; i++ { - if int32(hi>>(i*32)) < 0 { - res |= 1 << (i + 2) - } - } - case wazeroir.ShapeI64x2: - if int64(lo) < 0 { - res |= 0b01 - } - if int(hi) < 0 { - res |= 0b10 - } - } - ce.pushValue(res) - frame.pc++ - case wazeroir.OperationKindV128And: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - ce.pushValue(x1Lo & x2Lo) - ce.pushValue(x1Hi & x2Hi) - frame.pc++ - case wazeroir.OperationKindV128Not: - hi, lo := ce.popValue(), ce.popValue() - ce.pushValue(^lo) - ce.pushValue(^hi) - frame.pc++ - case wazeroir.OperationKindV128Or: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - ce.pushValue(x1Lo | x2Lo) - ce.pushValue(x1Hi | x2Hi) - frame.pc++ - case wazeroir.OperationKindV128Xor: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - ce.pushValue(x1Lo ^ x2Lo) - ce.pushValue(x1Hi ^ x2Hi) - frame.pc++ - case wazeroir.OperationKindV128Bitselect: - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#bitwise-select - cHi, cLo := ce.popValue(), ce.popValue() - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - // v128.or(v128.and(v1, c), v128.and(v2, v128.not(c))) - ce.pushValue((x1Lo & cLo) | (x2Lo & (^cLo))) - ce.pushValue((x1Hi & cHi) | (x2Hi & (^cHi))) - frame.pc++ - case wazeroir.OperationKindV128AndNot: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - ce.pushValue(x1Lo & (^x2Lo)) - ce.pushValue(x1Hi & (^x2Hi)) - frame.pc++ - case wazeroir.OperationKindV128Shl: - s := ce.popValue() - hi, lo := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - s = s % 8 - lo = uint64(uint8(lo<>8)<>16)<>24)<>32)<>40)<>48)<>56)<>8)<>16)<>24)<>32)<>40)<>48)<>56)<>16)<>32)<>48)<>16)<>32)<>48)<>32)<>32)<>s)) | - uint64(uint8(int8(lo>>8)>>s))<<8 | - uint64(uint8(int8(lo>>16)>>s))<<16 | - uint64(uint8(int8(lo>>24)>>s))<<24 | - uint64(uint8(int8(lo>>32)>>s))<<32 | - uint64(uint8(int8(lo>>40)>>s))<<40 | - uint64(uint8(int8(lo>>48)>>s))<<48 | - uint64(uint8(int8(lo>>56)>>s))<<56 - hi = uint64(uint8(int8(hi)>>s)) | - uint64(uint8(int8(hi>>8)>>s))<<8 | - uint64(uint8(int8(hi>>16)>>s))<<16 | - uint64(uint8(int8(hi>>24)>>s))<<24 | - uint64(uint8(int8(hi>>32)>>s))<<32 | - uint64(uint8(int8(hi>>40)>>s))<<40 | - uint64(uint8(int8(hi>>48)>>s))<<48 | - uint64(uint8(int8(hi>>56)>>s))<<56 - } else { - lo = uint64(uint8(lo)>>s) | - uint64(uint8(lo>>8)>>s)<<8 | - uint64(uint8(lo>>16)>>s)<<16 | - uint64(uint8(lo>>24)>>s)<<24 | - uint64(uint8(lo>>32)>>s)<<32 | - uint64(uint8(lo>>40)>>s)<<40 | - uint64(uint8(lo>>48)>>s)<<48 | - uint64(uint8(lo>>56)>>s)<<56 - hi = uint64(uint8(hi)>>s) | - uint64(uint8(hi>>8)>>s)<<8 | - uint64(uint8(hi>>16)>>s)<<16 | - uint64(uint8(hi>>24)>>s)<<24 | - uint64(uint8(hi>>32)>>s)<<32 | - uint64(uint8(hi>>40)>>s)<<40 | - uint64(uint8(hi>>48)>>s)<<48 | - uint64(uint8(hi>>56)>>s)<<56 - } - case wazeroir.ShapeI16x8: - s = s % 16 - if op.B3 { // signed - lo = uint64(uint16(int16(lo)>>s)) | - uint64(uint16(int16(lo>>16)>>s))<<16 | - uint64(uint16(int16(lo>>32)>>s))<<32 | - uint64(uint16(int16(lo>>48)>>s))<<48 - hi = uint64(uint16(int16(hi)>>s)) | - uint64(uint16(int16(hi>>16)>>s))<<16 | - uint64(uint16(int16(hi>>32)>>s))<<32 | - uint64(uint16(int16(hi>>48)>>s))<<48 - } else { - lo = uint64(uint16(lo)>>s) | - uint64(uint16(lo>>16)>>s)<<16 | - uint64(uint16(lo>>32)>>s)<<32 | - uint64(uint16(lo>>48)>>s)<<48 - hi = uint64(uint16(hi)>>s) | - uint64(uint16(hi>>16)>>s)<<16 | - uint64(uint16(hi>>32)>>s)<<32 | - uint64(uint16(hi>>48)>>s)<<48 - } - case wazeroir.ShapeI32x4: - s = s % 32 - if op.B3 { - lo = uint64(uint32(int32(lo)>>s)) | uint64(uint32(int32(lo>>32)>>s))<<32 - hi = uint64(uint32(int32(hi)>>s)) | uint64(uint32(int32(hi>>32)>>s))<<32 - } else { - lo = uint64(uint32(lo)>>s) | uint64(uint32(lo>>32)>>s)<<32 - hi = uint64(uint32(hi)>>s) | uint64(uint32(hi>>32)>>s)<<32 - } - case wazeroir.ShapeI64x2: - s = s % 64 - if op.B3 { // signed - lo = uint64(int64(lo) >> s) - hi = uint64(int64(hi) >> s) - } else { - lo = lo >> s - hi = hi >> s - } - - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Cmp: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - var result []bool - switch op.B1 { - case wazeroir.V128CmpTypeI8x16Eq: - result = []bool{ - byte(x1Lo>>0) == byte(x2Lo>>0), byte(x1Lo>>8) == byte(x2Lo>>8), - byte(x1Lo>>16) == byte(x2Lo>>16), byte(x1Lo>>24) == byte(x2Lo>>24), - byte(x1Lo>>32) == byte(x2Lo>>32), byte(x1Lo>>40) == byte(x2Lo>>40), - byte(x1Lo>>48) == byte(x2Lo>>48), byte(x1Lo>>56) == byte(x2Lo>>56), - byte(x1Hi>>0) == byte(x2Hi>>0), byte(x1Hi>>8) == byte(x2Hi>>8), - byte(x1Hi>>16) == byte(x2Hi>>16), byte(x1Hi>>24) == byte(x2Hi>>24), - byte(x1Hi>>32) == byte(x2Hi>>32), byte(x1Hi>>40) == byte(x2Hi>>40), - byte(x1Hi>>48) == byte(x2Hi>>48), byte(x1Hi>>56) == byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16Ne: - result = []bool{ - byte(x1Lo>>0) != byte(x2Lo>>0), byte(x1Lo>>8) != byte(x2Lo>>8), - byte(x1Lo>>16) != byte(x2Lo>>16), byte(x1Lo>>24) != byte(x2Lo>>24), - byte(x1Lo>>32) != byte(x2Lo>>32), byte(x1Lo>>40) != byte(x2Lo>>40), - byte(x1Lo>>48) != byte(x2Lo>>48), byte(x1Lo>>56) != byte(x2Lo>>56), - byte(x1Hi>>0) != byte(x2Hi>>0), byte(x1Hi>>8) != byte(x2Hi>>8), - byte(x1Hi>>16) != byte(x2Hi>>16), byte(x1Hi>>24) != byte(x2Hi>>24), - byte(x1Hi>>32) != byte(x2Hi>>32), byte(x1Hi>>40) != byte(x2Hi>>40), - byte(x1Hi>>48) != byte(x2Hi>>48), byte(x1Hi>>56) != byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16LtS: - result = []bool{ - int8(x1Lo>>0) < int8(x2Lo>>0), int8(x1Lo>>8) < int8(x2Lo>>8), - int8(x1Lo>>16) < int8(x2Lo>>16), int8(x1Lo>>24) < int8(x2Lo>>24), - int8(x1Lo>>32) < int8(x2Lo>>32), int8(x1Lo>>40) < int8(x2Lo>>40), - int8(x1Lo>>48) < int8(x2Lo>>48), int8(x1Lo>>56) < int8(x2Lo>>56), - int8(x1Hi>>0) < int8(x2Hi>>0), int8(x1Hi>>8) < int8(x2Hi>>8), - int8(x1Hi>>16) < int8(x2Hi>>16), int8(x1Hi>>24) < int8(x2Hi>>24), - int8(x1Hi>>32) < int8(x2Hi>>32), int8(x1Hi>>40) < int8(x2Hi>>40), - int8(x1Hi>>48) < int8(x2Hi>>48), int8(x1Hi>>56) < int8(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16LtU: - result = []bool{ - byte(x1Lo>>0) < byte(x2Lo>>0), byte(x1Lo>>8) < byte(x2Lo>>8), - byte(x1Lo>>16) < byte(x2Lo>>16), byte(x1Lo>>24) < byte(x2Lo>>24), - byte(x1Lo>>32) < byte(x2Lo>>32), byte(x1Lo>>40) < byte(x2Lo>>40), - byte(x1Lo>>48) < byte(x2Lo>>48), byte(x1Lo>>56) < byte(x2Lo>>56), - byte(x1Hi>>0) < byte(x2Hi>>0), byte(x1Hi>>8) < byte(x2Hi>>8), - byte(x1Hi>>16) < byte(x2Hi>>16), byte(x1Hi>>24) < byte(x2Hi>>24), - byte(x1Hi>>32) < byte(x2Hi>>32), byte(x1Hi>>40) < byte(x2Hi>>40), - byte(x1Hi>>48) < byte(x2Hi>>48), byte(x1Hi>>56) < byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16GtS: - result = []bool{ - int8(x1Lo>>0) > int8(x2Lo>>0), int8(x1Lo>>8) > int8(x2Lo>>8), - int8(x1Lo>>16) > int8(x2Lo>>16), int8(x1Lo>>24) > int8(x2Lo>>24), - int8(x1Lo>>32) > int8(x2Lo>>32), int8(x1Lo>>40) > int8(x2Lo>>40), - int8(x1Lo>>48) > int8(x2Lo>>48), int8(x1Lo>>56) > int8(x2Lo>>56), - int8(x1Hi>>0) > int8(x2Hi>>0), int8(x1Hi>>8) > int8(x2Hi>>8), - int8(x1Hi>>16) > int8(x2Hi>>16), int8(x1Hi>>24) > int8(x2Hi>>24), - int8(x1Hi>>32) > int8(x2Hi>>32), int8(x1Hi>>40) > int8(x2Hi>>40), - int8(x1Hi>>48) > int8(x2Hi>>48), int8(x1Hi>>56) > int8(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16GtU: - result = []bool{ - byte(x1Lo>>0) > byte(x2Lo>>0), byte(x1Lo>>8) > byte(x2Lo>>8), - byte(x1Lo>>16) > byte(x2Lo>>16), byte(x1Lo>>24) > byte(x2Lo>>24), - byte(x1Lo>>32) > byte(x2Lo>>32), byte(x1Lo>>40) > byte(x2Lo>>40), - byte(x1Lo>>48) > byte(x2Lo>>48), byte(x1Lo>>56) > byte(x2Lo>>56), - byte(x1Hi>>0) > byte(x2Hi>>0), byte(x1Hi>>8) > byte(x2Hi>>8), - byte(x1Hi>>16) > byte(x2Hi>>16), byte(x1Hi>>24) > byte(x2Hi>>24), - byte(x1Hi>>32) > byte(x2Hi>>32), byte(x1Hi>>40) > byte(x2Hi>>40), - byte(x1Hi>>48) > byte(x2Hi>>48), byte(x1Hi>>56) > byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16LeS: - result = []bool{ - int8(x1Lo>>0) <= int8(x2Lo>>0), int8(x1Lo>>8) <= int8(x2Lo>>8), - int8(x1Lo>>16) <= int8(x2Lo>>16), int8(x1Lo>>24) <= int8(x2Lo>>24), - int8(x1Lo>>32) <= int8(x2Lo>>32), int8(x1Lo>>40) <= int8(x2Lo>>40), - int8(x1Lo>>48) <= int8(x2Lo>>48), int8(x1Lo>>56) <= int8(x2Lo>>56), - int8(x1Hi>>0) <= int8(x2Hi>>0), int8(x1Hi>>8) <= int8(x2Hi>>8), - int8(x1Hi>>16) <= int8(x2Hi>>16), int8(x1Hi>>24) <= int8(x2Hi>>24), - int8(x1Hi>>32) <= int8(x2Hi>>32), int8(x1Hi>>40) <= int8(x2Hi>>40), - int8(x1Hi>>48) <= int8(x2Hi>>48), int8(x1Hi>>56) <= int8(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16LeU: - result = []bool{ - byte(x1Lo>>0) <= byte(x2Lo>>0), byte(x1Lo>>8) <= byte(x2Lo>>8), - byte(x1Lo>>16) <= byte(x2Lo>>16), byte(x1Lo>>24) <= byte(x2Lo>>24), - byte(x1Lo>>32) <= byte(x2Lo>>32), byte(x1Lo>>40) <= byte(x2Lo>>40), - byte(x1Lo>>48) <= byte(x2Lo>>48), byte(x1Lo>>56) <= byte(x2Lo>>56), - byte(x1Hi>>0) <= byte(x2Hi>>0), byte(x1Hi>>8) <= byte(x2Hi>>8), - byte(x1Hi>>16) <= byte(x2Hi>>16), byte(x1Hi>>24) <= byte(x2Hi>>24), - byte(x1Hi>>32) <= byte(x2Hi>>32), byte(x1Hi>>40) <= byte(x2Hi>>40), - byte(x1Hi>>48) <= byte(x2Hi>>48), byte(x1Hi>>56) <= byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16GeS: - result = []bool{ - int8(x1Lo>>0) >= int8(x2Lo>>0), int8(x1Lo>>8) >= int8(x2Lo>>8), - int8(x1Lo>>16) >= int8(x2Lo>>16), int8(x1Lo>>24) >= int8(x2Lo>>24), - int8(x1Lo>>32) >= int8(x2Lo>>32), int8(x1Lo>>40) >= int8(x2Lo>>40), - int8(x1Lo>>48) >= int8(x2Lo>>48), int8(x1Lo>>56) >= int8(x2Lo>>56), - int8(x1Hi>>0) >= int8(x2Hi>>0), int8(x1Hi>>8) >= int8(x2Hi>>8), - int8(x1Hi>>16) >= int8(x2Hi>>16), int8(x1Hi>>24) >= int8(x2Hi>>24), - int8(x1Hi>>32) >= int8(x2Hi>>32), int8(x1Hi>>40) >= int8(x2Hi>>40), - int8(x1Hi>>48) >= int8(x2Hi>>48), int8(x1Hi>>56) >= int8(x2Hi>>56), - } - case wazeroir.V128CmpTypeI8x16GeU: - result = []bool{ - byte(x1Lo>>0) >= byte(x2Lo>>0), byte(x1Lo>>8) >= byte(x2Lo>>8), - byte(x1Lo>>16) >= byte(x2Lo>>16), byte(x1Lo>>24) >= byte(x2Lo>>24), - byte(x1Lo>>32) >= byte(x2Lo>>32), byte(x1Lo>>40) >= byte(x2Lo>>40), - byte(x1Lo>>48) >= byte(x2Lo>>48), byte(x1Lo>>56) >= byte(x2Lo>>56), - byte(x1Hi>>0) >= byte(x2Hi>>0), byte(x1Hi>>8) >= byte(x2Hi>>8), - byte(x1Hi>>16) >= byte(x2Hi>>16), byte(x1Hi>>24) >= byte(x2Hi>>24), - byte(x1Hi>>32) >= byte(x2Hi>>32), byte(x1Hi>>40) >= byte(x2Hi>>40), - byte(x1Hi>>48) >= byte(x2Hi>>48), byte(x1Hi>>56) >= byte(x2Hi>>56), - } - case wazeroir.V128CmpTypeI16x8Eq: - result = []bool{ - uint16(x1Lo>>0) == uint16(x2Lo>>0), uint16(x1Lo>>16) == uint16(x2Lo>>16), - uint16(x1Lo>>32) == uint16(x2Lo>>32), uint16(x1Lo>>48) == uint16(x2Lo>>48), - uint16(x1Hi>>0) == uint16(x2Hi>>0), uint16(x1Hi>>16) == uint16(x2Hi>>16), - uint16(x1Hi>>32) == uint16(x2Hi>>32), uint16(x1Hi>>48) == uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8Ne: - result = []bool{ - uint16(x1Lo>>0) != uint16(x2Lo>>0), uint16(x1Lo>>16) != uint16(x2Lo>>16), - uint16(x1Lo>>32) != uint16(x2Lo>>32), uint16(x1Lo>>48) != uint16(x2Lo>>48), - uint16(x1Hi>>0) != uint16(x2Hi>>0), uint16(x1Hi>>16) != uint16(x2Hi>>16), - uint16(x1Hi>>32) != uint16(x2Hi>>32), uint16(x1Hi>>48) != uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8LtS: - result = []bool{ - int16(x1Lo>>0) < int16(x2Lo>>0), int16(x1Lo>>16) < int16(x2Lo>>16), - int16(x1Lo>>32) < int16(x2Lo>>32), int16(x1Lo>>48) < int16(x2Lo>>48), - int16(x1Hi>>0) < int16(x2Hi>>0), int16(x1Hi>>16) < int16(x2Hi>>16), - int16(x1Hi>>32) < int16(x2Hi>>32), int16(x1Hi>>48) < int16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8LtU: - result = []bool{ - uint16(x1Lo>>0) < uint16(x2Lo>>0), uint16(x1Lo>>16) < uint16(x2Lo>>16), - uint16(x1Lo>>32) < uint16(x2Lo>>32), uint16(x1Lo>>48) < uint16(x2Lo>>48), - uint16(x1Hi>>0) < uint16(x2Hi>>0), uint16(x1Hi>>16) < uint16(x2Hi>>16), - uint16(x1Hi>>32) < uint16(x2Hi>>32), uint16(x1Hi>>48) < uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8GtS: - result = []bool{ - int16(x1Lo>>0) > int16(x2Lo>>0), int16(x1Lo>>16) > int16(x2Lo>>16), - int16(x1Lo>>32) > int16(x2Lo>>32), int16(x1Lo>>48) > int16(x2Lo>>48), - int16(x1Hi>>0) > int16(x2Hi>>0), int16(x1Hi>>16) > int16(x2Hi>>16), - int16(x1Hi>>32) > int16(x2Hi>>32), int16(x1Hi>>48) > int16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8GtU: - result = []bool{ - uint16(x1Lo>>0) > uint16(x2Lo>>0), uint16(x1Lo>>16) > uint16(x2Lo>>16), - uint16(x1Lo>>32) > uint16(x2Lo>>32), uint16(x1Lo>>48) > uint16(x2Lo>>48), - uint16(x1Hi>>0) > uint16(x2Hi>>0), uint16(x1Hi>>16) > uint16(x2Hi>>16), - uint16(x1Hi>>32) > uint16(x2Hi>>32), uint16(x1Hi>>48) > uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8LeS: - result = []bool{ - int16(x1Lo>>0) <= int16(x2Lo>>0), int16(x1Lo>>16) <= int16(x2Lo>>16), - int16(x1Lo>>32) <= int16(x2Lo>>32), int16(x1Lo>>48) <= int16(x2Lo>>48), - int16(x1Hi>>0) <= int16(x2Hi>>0), int16(x1Hi>>16) <= int16(x2Hi>>16), - int16(x1Hi>>32) <= int16(x2Hi>>32), int16(x1Hi>>48) <= int16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8LeU: - result = []bool{ - uint16(x1Lo>>0) <= uint16(x2Lo>>0), uint16(x1Lo>>16) <= uint16(x2Lo>>16), - uint16(x1Lo>>32) <= uint16(x2Lo>>32), uint16(x1Lo>>48) <= uint16(x2Lo>>48), - uint16(x1Hi>>0) <= uint16(x2Hi>>0), uint16(x1Hi>>16) <= uint16(x2Hi>>16), - uint16(x1Hi>>32) <= uint16(x2Hi>>32), uint16(x1Hi>>48) <= uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8GeS: - result = []bool{ - int16(x1Lo>>0) >= int16(x2Lo>>0), int16(x1Lo>>16) >= int16(x2Lo>>16), - int16(x1Lo>>32) >= int16(x2Lo>>32), int16(x1Lo>>48) >= int16(x2Lo>>48), - int16(x1Hi>>0) >= int16(x2Hi>>0), int16(x1Hi>>16) >= int16(x2Hi>>16), - int16(x1Hi>>32) >= int16(x2Hi>>32), int16(x1Hi>>48) >= int16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI16x8GeU: - result = []bool{ - uint16(x1Lo>>0) >= uint16(x2Lo>>0), uint16(x1Lo>>16) >= uint16(x2Lo>>16), - uint16(x1Lo>>32) >= uint16(x2Lo>>32), uint16(x1Lo>>48) >= uint16(x2Lo>>48), - uint16(x1Hi>>0) >= uint16(x2Hi>>0), uint16(x1Hi>>16) >= uint16(x2Hi>>16), - uint16(x1Hi>>32) >= uint16(x2Hi>>32), uint16(x1Hi>>48) >= uint16(x2Hi>>48), - } - case wazeroir.V128CmpTypeI32x4Eq: - result = []bool{ - uint32(x1Lo>>0) == uint32(x2Lo>>0), uint32(x1Lo>>32) == uint32(x2Lo>>32), - uint32(x1Hi>>0) == uint32(x2Hi>>0), uint32(x1Hi>>32) == uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4Ne: - result = []bool{ - uint32(x1Lo>>0) != uint32(x2Lo>>0), uint32(x1Lo>>32) != uint32(x2Lo>>32), - uint32(x1Hi>>0) != uint32(x2Hi>>0), uint32(x1Hi>>32) != uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4LtS: - result = []bool{ - int32(x1Lo>>0) < int32(x2Lo>>0), int32(x1Lo>>32) < int32(x2Lo>>32), - int32(x1Hi>>0) < int32(x2Hi>>0), int32(x1Hi>>32) < int32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4LtU: - result = []bool{ - uint32(x1Lo>>0) < uint32(x2Lo>>0), uint32(x1Lo>>32) < uint32(x2Lo>>32), - uint32(x1Hi>>0) < uint32(x2Hi>>0), uint32(x1Hi>>32) < uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4GtS: - result = []bool{ - int32(x1Lo>>0) > int32(x2Lo>>0), int32(x1Lo>>32) > int32(x2Lo>>32), - int32(x1Hi>>0) > int32(x2Hi>>0), int32(x1Hi>>32) > int32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4GtU: - result = []bool{ - uint32(x1Lo>>0) > uint32(x2Lo>>0), uint32(x1Lo>>32) > uint32(x2Lo>>32), - uint32(x1Hi>>0) > uint32(x2Hi>>0), uint32(x1Hi>>32) > uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4LeS: - result = []bool{ - int32(x1Lo>>0) <= int32(x2Lo>>0), int32(x1Lo>>32) <= int32(x2Lo>>32), - int32(x1Hi>>0) <= int32(x2Hi>>0), int32(x1Hi>>32) <= int32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4LeU: - result = []bool{ - uint32(x1Lo>>0) <= uint32(x2Lo>>0), uint32(x1Lo>>32) <= uint32(x2Lo>>32), - uint32(x1Hi>>0) <= uint32(x2Hi>>0), uint32(x1Hi>>32) <= uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4GeS: - result = []bool{ - int32(x1Lo>>0) >= int32(x2Lo>>0), int32(x1Lo>>32) >= int32(x2Lo>>32), - int32(x1Hi>>0) >= int32(x2Hi>>0), int32(x1Hi>>32) >= int32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI32x4GeU: - result = []bool{ - uint32(x1Lo>>0) >= uint32(x2Lo>>0), uint32(x1Lo>>32) >= uint32(x2Lo>>32), - uint32(x1Hi>>0) >= uint32(x2Hi>>0), uint32(x1Hi>>32) >= uint32(x2Hi>>32), - } - case wazeroir.V128CmpTypeI64x2Eq: - result = []bool{x1Lo == x2Lo, x1Hi == x2Hi} - case wazeroir.V128CmpTypeI64x2Ne: - result = []bool{x1Lo != x2Lo, x1Hi != x2Hi} - case wazeroir.V128CmpTypeI64x2LtS: - result = []bool{int64(x1Lo) < int64(x2Lo), int64(x1Hi) < int64(x2Hi)} - case wazeroir.V128CmpTypeI64x2GtS: - result = []bool{int64(x1Lo) > int64(x2Lo), int64(x1Hi) > int64(x2Hi)} - case wazeroir.V128CmpTypeI64x2LeS: - result = []bool{int64(x1Lo) <= int64(x2Lo), int64(x1Hi) <= int64(x2Hi)} - case wazeroir.V128CmpTypeI64x2GeS: - result = []bool{int64(x1Lo) >= int64(x2Lo), int64(x1Hi) >= int64(x2Hi)} - case wazeroir.V128CmpTypeF32x4Eq: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) == math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) == math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) == math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) == math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF32x4Ne: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) != math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) != math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) != math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) != math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF32x4Lt: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) < math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) < math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) < math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) < math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF32x4Gt: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) > math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) > math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) > math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) > math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF32x4Le: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) <= math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) <= math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) <= math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) <= math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF32x4Ge: - result = []bool{ - math.Float32frombits(uint32(x1Lo>>0)) >= math.Float32frombits(uint32(x2Lo>>0)), - math.Float32frombits(uint32(x1Lo>>32)) >= math.Float32frombits(uint32(x2Lo>>32)), - math.Float32frombits(uint32(x1Hi>>0)) >= math.Float32frombits(uint32(x2Hi>>0)), - math.Float32frombits(uint32(x1Hi>>32)) >= math.Float32frombits(uint32(x2Hi>>32)), - } - case wazeroir.V128CmpTypeF64x2Eq: - result = []bool{ - math.Float64frombits(x1Lo) == math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) == math.Float64frombits(x2Hi), - } - case wazeroir.V128CmpTypeF64x2Ne: - result = []bool{ - math.Float64frombits(x1Lo) != math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) != math.Float64frombits(x2Hi), - } - case wazeroir.V128CmpTypeF64x2Lt: - result = []bool{ - math.Float64frombits(x1Lo) < math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) < math.Float64frombits(x2Hi), - } - case wazeroir.V128CmpTypeF64x2Gt: - result = []bool{ - math.Float64frombits(x1Lo) > math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) > math.Float64frombits(x2Hi), - } - case wazeroir.V128CmpTypeF64x2Le: - result = []bool{ - math.Float64frombits(x1Lo) <= math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) <= math.Float64frombits(x2Hi), - } - case wazeroir.V128CmpTypeF64x2Ge: - result = []bool{ - math.Float64frombits(x1Lo) >= math.Float64frombits(x2Lo), - math.Float64frombits(x1Hi) >= math.Float64frombits(x2Hi), - } - } - - var retLo, retHi uint64 - laneNum := len(result) - switch laneNum { - case 16: - for i, b := range result { - if b { - if i < 8 { - retLo |= 0xff << (i * 8) - } else { - retHi |= 0xff << ((i - 8) * 8) - } - } - } - case 8: - for i, b := range result { - if b { - if i < 4 { - retLo |= 0xffff << (i * 16) - } else { - retHi |= 0xffff << ((i - 4) * 16) - } - } - } - case 4: - for i, b := range result { - if b { - if i < 2 { - retLo |= 0xffff_ffff << (i * 32) - } else { - retHi |= 0xffff_ffff << ((i - 2) * 32) - } - } - } - case 2: - if result[0] { - retLo = ^uint64(0) - } - if result[1] { - retHi = ^uint64(0) - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128AddSat: - x2hi, x2Lo := ce.popValue(), ce.popValue() - x1hi, x1Lo := ce.popValue(), ce.popValue() - - var retLo, retHi uint64 - - // Lane-wise addition while saturating the overflowing values. - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#saturating-integer-addition - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 16; i++ { - var v, w byte - if i < 8 { - v, w = byte(x1Lo>>(i*8)), byte(x2Lo>>(i*8)) - } else { - v, w = byte(x1hi>>((i-8)*8)), byte(x2hi>>((i-8)*8)) - } - - var uv uint64 - if op.B3 { // signed - if subbed := int64(int8(v)) + int64(int8(w)); subbed < math.MinInt8 { - uv = uint64(byte(0x80)) - } else if subbed > math.MaxInt8 { - uv = uint64(byte(0x7f)) - } else { - uv = uint64(byte(int8(subbed))) - } - } else { - if subbed := int64(v) + int64(w); subbed < 0 { - uv = uint64(byte(0)) - } else if subbed > math.MaxUint8 { - uv = uint64(byte(0xff)) - } else { - uv = uint64(byte(subbed)) - } - } - - if i < 8 { // first 8 lanes are on lower 64bits. - retLo |= uv << (i * 8) - } else { - retHi |= uv << ((i - 8) * 8) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 8; i++ { - var v, w uint16 - if i < 4 { - v, w = uint16(x1Lo>>(i*16)), uint16(x2Lo>>(i*16)) - } else { - v, w = uint16(x1hi>>((i-4)*16)), uint16(x2hi>>((i-4)*16)) - } - - var uv uint64 - if op.B3 { // signed - if added := int64(int16(v)) + int64(int16(w)); added < math.MinInt16 { - uv = uint64(uint16(0x8000)) - } else if added > math.MaxInt16 { - uv = uint64(uint16(0x7fff)) - } else { - uv = uint64(uint16(int16(added))) - } - } else { - if added := int64(v) + int64(w); added < 0 { - uv = uint64(uint16(0)) - } else if added > math.MaxUint16 { - uv = uint64(uint16(0xffff)) - } else { - uv = uint64(uint16(added)) - } - } - - if i < 4 { // first 4 lanes are on lower 64bits. - retLo |= uv << (i * 16) - } else { - retHi |= uv << ((i - 4) * 16) - } - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128SubSat: - x2hi, x2Lo := ce.popValue(), ce.popValue() - x1hi, x1Lo := ce.popValue(), ce.popValue() - - var retLo, retHi uint64 - - // Lane-wise subtraction while saturating the overflowing values. - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#saturating-integer-subtraction - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 16; i++ { - var v, w byte - if i < 8 { - v, w = byte(x1Lo>>(i*8)), byte(x2Lo>>(i*8)) - } else { - v, w = byte(x1hi>>((i-8)*8)), byte(x2hi>>((i-8)*8)) - } - - var uv uint64 - if op.B3 { // signed - if subbed := int64(int8(v)) - int64(int8(w)); subbed < math.MinInt8 { - uv = uint64(byte(0x80)) - } else if subbed > math.MaxInt8 { - uv = uint64(byte(0x7f)) - } else { - uv = uint64(byte(int8(subbed))) - } - } else { - if subbed := int64(v) - int64(w); subbed < 0 { - uv = uint64(byte(0)) - } else if subbed > math.MaxUint8 { - uv = uint64(byte(0xff)) - } else { - uv = uint64(byte(subbed)) - } - } - - if i < 8 { - retLo |= uv << (i * 8) - } else { - retHi |= uv << ((i - 8) * 8) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 8; i++ { - var v, w uint16 - if i < 4 { - v, w = uint16(x1Lo>>(i*16)), uint16(x2Lo>>(i*16)) - } else { - v, w = uint16(x1hi>>((i-4)*16)), uint16(x2hi>>((i-4)*16)) - } - - var uv uint64 - if op.B3 { // signed - if subbed := int64(int16(v)) - int64(int16(w)); subbed < math.MinInt16 { - uv = uint64(uint16(0x8000)) - } else if subbed > math.MaxInt16 { - uv = uint64(uint16(0x7fff)) - } else { - uv = uint64(uint16(int16(subbed))) - } - } else { - if subbed := int64(v) - int64(w); subbed < 0 { - uv = uint64(uint16(0)) - } else if subbed > math.MaxUint16 { - uv = uint64(uint16(0xffff)) - } else { - uv = uint64(uint16(subbed)) - } - } - - if i < 4 { - retLo |= uv << (i * 16) - } else { - retHi |= uv << ((i - 4) * 16) - } - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Mul: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI16x8: - retHi = uint64(uint16(x1hi)*uint16(x2hi)) | (uint64(uint16(x1hi>>16)*uint16(x2hi>>16)) << 16) | - (uint64(uint16(x1hi>>32)*uint16(x2hi>>32)) << 32) | (uint64(uint16(x1hi>>48)*uint16(x2hi>>48)) << 48) - retLo = uint64(uint16(x1lo)*uint16(x2lo)) | (uint64(uint16(x1lo>>16)*uint16(x2lo>>16)) << 16) | - (uint64(uint16(x1lo>>32)*uint16(x2lo>>32)) << 32) | (uint64(uint16(x1lo>>48)*uint16(x2lo>>48)) << 48) - case wazeroir.ShapeI32x4: - retHi = uint64(uint32(x1hi)*uint32(x2hi)) | (uint64(uint32(x1hi>>32)*uint32(x2hi>>32)) << 32) - retLo = uint64(uint32(x1lo)*uint32(x2lo)) | (uint64(uint32(x1lo>>32)*uint32(x2lo>>32)) << 32) - case wazeroir.ShapeI64x2: - retHi = x1hi * x2hi - retLo = x1lo * x2lo - case wazeroir.ShapeF32x4: - retHi = mulFloat32bits(uint32(x1hi), uint32(x2hi)) | mulFloat32bits(uint32(x1hi>>32), uint32(x2hi>>32))<<32 - retLo = mulFloat32bits(uint32(x1lo), uint32(x2lo)) | mulFloat32bits(uint32(x1lo>>32), uint32(x2lo>>32))<<32 - case wazeroir.ShapeF64x2: - retHi = math.Float64bits(math.Float64frombits(x1hi) * math.Float64frombits(x2hi)) - retLo = math.Float64bits(math.Float64frombits(x1lo) * math.Float64frombits(x2lo)) - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Div: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - if op.B1 == wazeroir.ShapeF64x2 { - retHi = math.Float64bits(math.Float64frombits(x1hi) / math.Float64frombits(x2hi)) - retLo = math.Float64bits(math.Float64frombits(x1lo) / math.Float64frombits(x2lo)) - } else { - retHi = divFloat32bits(uint32(x1hi), uint32(x2hi)) | divFloat32bits(uint32(x1hi>>32), uint32(x2hi>>32))<<32 - retLo = divFloat32bits(uint32(x1lo), uint32(x2lo)) | divFloat32bits(uint32(x1lo>>32), uint32(x2lo>>32))<<32 - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Neg: - hi, lo := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - lo = uint64(-byte(lo)) | (uint64(-byte(lo>>8)) << 8) | - (uint64(-byte(lo>>16)) << 16) | (uint64(-byte(lo>>24)) << 24) | - (uint64(-byte(lo>>32)) << 32) | (uint64(-byte(lo>>40)) << 40) | - (uint64(-byte(lo>>48)) << 48) | (uint64(-byte(lo>>56)) << 56) - hi = uint64(-byte(hi)) | (uint64(-byte(hi>>8)) << 8) | - (uint64(-byte(hi>>16)) << 16) | (uint64(-byte(hi>>24)) << 24) | - (uint64(-byte(hi>>32)) << 32) | (uint64(-byte(hi>>40)) << 40) | - (uint64(-byte(hi>>48)) << 48) | (uint64(-byte(hi>>56)) << 56) - case wazeroir.ShapeI16x8: - hi = uint64(-uint16(hi)) | (uint64(-uint16(hi>>16)) << 16) | - (uint64(-uint16(hi>>32)) << 32) | (uint64(-uint16(hi>>48)) << 48) - lo = uint64(-uint16(lo)) | (uint64(-uint16(lo>>16)) << 16) | - (uint64(-uint16(lo>>32)) << 32) | (uint64(-uint16(lo>>48)) << 48) - case wazeroir.ShapeI32x4: - hi = uint64(-uint32(hi)) | (uint64(-uint32(hi>>32)) << 32) - lo = uint64(-uint32(lo)) | (uint64(-uint32(lo>>32)) << 32) - case wazeroir.ShapeI64x2: - hi = -hi - lo = -lo - case wazeroir.ShapeF32x4: - hi = uint64(math.Float32bits(-math.Float32frombits(uint32(hi)))) | - (uint64(math.Float32bits(-math.Float32frombits(uint32(hi>>32)))) << 32) - lo = uint64(math.Float32bits(-math.Float32frombits(uint32(lo)))) | - (uint64(math.Float32bits(-math.Float32frombits(uint32(lo>>32)))) << 32) - case wazeroir.ShapeF64x2: - hi = math.Float64bits(-math.Float64frombits(hi)) - lo = math.Float64bits(-math.Float64frombits(lo)) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Sqrt: - hi, lo := ce.popValue(), ce.popValue() - if op.B1 == wazeroir.ShapeF64x2 { - hi = math.Float64bits(math.Sqrt(math.Float64frombits(hi))) - lo = math.Float64bits(math.Sqrt(math.Float64frombits(lo))) - } else { - hi = uint64(math.Float32bits(float32(math.Sqrt(float64(math.Float32frombits(uint32(hi))))))) | - (uint64(math.Float32bits(float32(math.Sqrt(float64(math.Float32frombits(uint32(hi>>32))))))) << 32) - lo = uint64(math.Float32bits(float32(math.Sqrt(float64(math.Float32frombits(uint32(lo))))))) | - (uint64(math.Float32bits(float32(math.Sqrt(float64(math.Float32frombits(uint32(lo>>32))))))) << 32) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Abs: - hi, lo := ce.popValue(), ce.popValue() - switch op.B1 { - case wazeroir.ShapeI8x16: - lo = uint64(i8Abs(byte(lo))) | (uint64(i8Abs(byte(lo>>8))) << 8) | - (uint64(i8Abs(byte(lo>>16))) << 16) | (uint64(i8Abs(byte(lo>>24))) << 24) | - (uint64(i8Abs(byte(lo>>32))) << 32) | (uint64(i8Abs(byte(lo>>40))) << 40) | - (uint64(i8Abs(byte(lo>>48))) << 48) | (uint64(i8Abs(byte(lo>>56))) << 56) - hi = uint64(i8Abs(byte(hi))) | (uint64(i8Abs(byte(hi>>8))) << 8) | - (uint64(i8Abs(byte(hi>>16))) << 16) | (uint64(i8Abs(byte(hi>>24))) << 24) | - (uint64(i8Abs(byte(hi>>32))) << 32) | (uint64(i8Abs(byte(hi>>40))) << 40) | - (uint64(i8Abs(byte(hi>>48))) << 48) | (uint64(i8Abs(byte(hi>>56))) << 56) - case wazeroir.ShapeI16x8: - hi = uint64(i16Abs(uint16(hi))) | (uint64(i16Abs(uint16(hi>>16))) << 16) | - (uint64(i16Abs(uint16(hi>>32))) << 32) | (uint64(i16Abs(uint16(hi>>48))) << 48) - lo = uint64(i16Abs(uint16(lo))) | (uint64(i16Abs(uint16(lo>>16))) << 16) | - (uint64(i16Abs(uint16(lo>>32))) << 32) | (uint64(i16Abs(uint16(lo>>48))) << 48) - case wazeroir.ShapeI32x4: - hi = uint64(i32Abs(uint32(hi))) | (uint64(i32Abs(uint32(hi>>32))) << 32) - lo = uint64(i32Abs(uint32(lo))) | (uint64(i32Abs(uint32(lo>>32))) << 32) - case wazeroir.ShapeI64x2: - if int64(hi) < 0 { - hi = -hi - } - if int64(lo) < 0 { - lo = -lo - } - case wazeroir.ShapeF32x4: - hi = hi &^ (1<<31 | 1<<63) - lo = lo &^ (1<<31 | 1<<63) - case wazeroir.ShapeF64x2: - hi = hi &^ (1 << 63) - lo = lo &^ (1 << 63) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Popcnt: - hi, lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - for i := 0; i < 16; i++ { - var v byte - if i < 8 { - v = byte(lo >> (i * 8)) - } else { - v = byte(hi >> ((i - 8) * 8)) - } - - var cnt uint64 - for i := 0; i < 8; i++ { - if (v>>i)&0b1 != 0 { - cnt++ - } - } - - if i < 8 { - retLo |= cnt << (i * 8) - } else { - retHi |= cnt << ((i - 8) * 8) - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Min: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - if op.B3 { // signed - retLo = uint64(i8MinS(uint8(x1lo>>8), uint8(x2lo>>8)))<<8 | uint64(i8MinS(uint8(x1lo), uint8(x2lo))) | - uint64(i8MinS(uint8(x1lo>>24), uint8(x2lo>>24)))<<24 | uint64(i8MinS(uint8(x1lo>>16), uint8(x2lo>>16)))<<16 | - uint64(i8MinS(uint8(x1lo>>40), uint8(x2lo>>40)))<<40 | uint64(i8MinS(uint8(x1lo>>32), uint8(x2lo>>32)))<<32 | - uint64(i8MinS(uint8(x1lo>>56), uint8(x2lo>>56)))<<56 | uint64(i8MinS(uint8(x1lo>>48), uint8(x2lo>>48)))<<48 - retHi = uint64(i8MinS(uint8(x1hi>>8), uint8(x2hi>>8)))<<8 | uint64(i8MinS(uint8(x1hi), uint8(x2hi))) | - uint64(i8MinS(uint8(x1hi>>24), uint8(x2hi>>24)))<<24 | uint64(i8MinS(uint8(x1hi>>16), uint8(x2hi>>16)))<<16 | - uint64(i8MinS(uint8(x1hi>>40), uint8(x2hi>>40)))<<40 | uint64(i8MinS(uint8(x1hi>>32), uint8(x2hi>>32)))<<32 | - uint64(i8MinS(uint8(x1hi>>56), uint8(x2hi>>56)))<<56 | uint64(i8MinS(uint8(x1hi>>48), uint8(x2hi>>48)))<<48 - } else { - retLo = uint64(i8MinU(uint8(x1lo>>8), uint8(x2lo>>8)))<<8 | uint64(i8MinU(uint8(x1lo), uint8(x2lo))) | - uint64(i8MinU(uint8(x1lo>>24), uint8(x2lo>>24)))<<24 | uint64(i8MinU(uint8(x1lo>>16), uint8(x2lo>>16)))<<16 | - uint64(i8MinU(uint8(x1lo>>40), uint8(x2lo>>40)))<<40 | uint64(i8MinU(uint8(x1lo>>32), uint8(x2lo>>32)))<<32 | - uint64(i8MinU(uint8(x1lo>>56), uint8(x2lo>>56)))<<56 | uint64(i8MinU(uint8(x1lo>>48), uint8(x2lo>>48)))<<48 - retHi = uint64(i8MinU(uint8(x1hi>>8), uint8(x2hi>>8)))<<8 | uint64(i8MinU(uint8(x1hi), uint8(x2hi))) | - uint64(i8MinU(uint8(x1hi>>24), uint8(x2hi>>24)))<<24 | uint64(i8MinU(uint8(x1hi>>16), uint8(x2hi>>16)))<<16 | - uint64(i8MinU(uint8(x1hi>>40), uint8(x2hi>>40)))<<40 | uint64(i8MinU(uint8(x1hi>>32), uint8(x2hi>>32)))<<32 | - uint64(i8MinU(uint8(x1hi>>56), uint8(x2hi>>56)))<<56 | uint64(i8MinU(uint8(x1hi>>48), uint8(x2hi>>48)))<<48 - } - case wazeroir.ShapeI16x8: - if op.B3 { // signed - retLo = uint64(i16MinS(uint16(x1lo), uint16(x2lo))) | - uint64(i16MinS(uint16(x1lo>>16), uint16(x2lo>>16)))<<16 | - uint64(i16MinS(uint16(x1lo>>32), uint16(x2lo>>32)))<<32 | - uint64(i16MinS(uint16(x1lo>>48), uint16(x2lo>>48)))<<48 - retHi = uint64(i16MinS(uint16(x1hi), uint16(x2hi))) | - uint64(i16MinS(uint16(x1hi>>16), uint16(x2hi>>16)))<<16 | - uint64(i16MinS(uint16(x1hi>>32), uint16(x2hi>>32)))<<32 | - uint64(i16MinS(uint16(x1hi>>48), uint16(x2hi>>48)))<<48 - } else { - retLo = uint64(i16MinU(uint16(x1lo), uint16(x2lo))) | - uint64(i16MinU(uint16(x1lo>>16), uint16(x2lo>>16)))<<16 | - uint64(i16MinU(uint16(x1lo>>32), uint16(x2lo>>32)))<<32 | - uint64(i16MinU(uint16(x1lo>>48), uint16(x2lo>>48)))<<48 - retHi = uint64(i16MinU(uint16(x1hi), uint16(x2hi))) | - uint64(i16MinU(uint16(x1hi>>16), uint16(x2hi>>16)))<<16 | - uint64(i16MinU(uint16(x1hi>>32), uint16(x2hi>>32)))<<32 | - uint64(i16MinU(uint16(x1hi>>48), uint16(x2hi>>48)))<<48 - } - case wazeroir.ShapeI32x4: - if op.B3 { // signed - retLo = uint64(i32MinS(uint32(x1lo), uint32(x2lo))) | - uint64(i32MinS(uint32(x1lo>>32), uint32(x2lo>>32)))<<32 - retHi = uint64(i32MinS(uint32(x1hi), uint32(x2hi))) | - uint64(i32MinS(uint32(x1hi>>32), uint32(x2hi>>32)))<<32 - } else { - retLo = uint64(i32MinU(uint32(x1lo), uint32(x2lo))) | - uint64(i32MinU(uint32(x1lo>>32), uint32(x2lo>>32)))<<32 - retHi = uint64(i32MinU(uint32(x1hi), uint32(x2hi))) | - uint64(i32MinU(uint32(x1hi>>32), uint32(x2hi>>32)))<<32 - } - case wazeroir.ShapeF32x4: - retHi = WasmCompatMin32bits(uint32(x1hi), uint32(x2hi)) | - WasmCompatMin32bits(uint32(x1hi>>32), uint32(x2hi>>32))<<32 - retLo = WasmCompatMin32bits(uint32(x1lo), uint32(x2lo)) | - WasmCompatMin32bits(uint32(x1lo>>32), uint32(x2lo>>32))<<32 - case wazeroir.ShapeF64x2: - retHi = math.Float64bits(moremath.WasmCompatMin64( - math.Float64frombits(x1hi), - math.Float64frombits(x2hi), - )) - retLo = math.Float64bits(moremath.WasmCompatMin64( - math.Float64frombits(x1lo), - math.Float64frombits(x2lo), - )) - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Max: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - if op.B3 { // signed - retLo = uint64(i8MaxS(uint8(x1lo>>8), uint8(x2lo>>8)))<<8 | uint64(i8MaxS(uint8(x1lo), uint8(x2lo))) | - uint64(i8MaxS(uint8(x1lo>>24), uint8(x2lo>>24)))<<24 | uint64(i8MaxS(uint8(x1lo>>16), uint8(x2lo>>16)))<<16 | - uint64(i8MaxS(uint8(x1lo>>40), uint8(x2lo>>40)))<<40 | uint64(i8MaxS(uint8(x1lo>>32), uint8(x2lo>>32)))<<32 | - uint64(i8MaxS(uint8(x1lo>>56), uint8(x2lo>>56)))<<56 | uint64(i8MaxS(uint8(x1lo>>48), uint8(x2lo>>48)))<<48 - retHi = uint64(i8MaxS(uint8(x1hi>>8), uint8(x2hi>>8)))<<8 | uint64(i8MaxS(uint8(x1hi), uint8(x2hi))) | - uint64(i8MaxS(uint8(x1hi>>24), uint8(x2hi>>24)))<<24 | uint64(i8MaxS(uint8(x1hi>>16), uint8(x2hi>>16)))<<16 | - uint64(i8MaxS(uint8(x1hi>>40), uint8(x2hi>>40)))<<40 | uint64(i8MaxS(uint8(x1hi>>32), uint8(x2hi>>32)))<<32 | - uint64(i8MaxS(uint8(x1hi>>56), uint8(x2hi>>56)))<<56 | uint64(i8MaxS(uint8(x1hi>>48), uint8(x2hi>>48)))<<48 - } else { - retLo = uint64(i8MaxU(uint8(x1lo>>8), uint8(x2lo>>8)))<<8 | uint64(i8MaxU(uint8(x1lo), uint8(x2lo))) | - uint64(i8MaxU(uint8(x1lo>>24), uint8(x2lo>>24)))<<24 | uint64(i8MaxU(uint8(x1lo>>16), uint8(x2lo>>16)))<<16 | - uint64(i8MaxU(uint8(x1lo>>40), uint8(x2lo>>40)))<<40 | uint64(i8MaxU(uint8(x1lo>>32), uint8(x2lo>>32)))<<32 | - uint64(i8MaxU(uint8(x1lo>>56), uint8(x2lo>>56)))<<56 | uint64(i8MaxU(uint8(x1lo>>48), uint8(x2lo>>48)))<<48 - retHi = uint64(i8MaxU(uint8(x1hi>>8), uint8(x2hi>>8)))<<8 | uint64(i8MaxU(uint8(x1hi), uint8(x2hi))) | - uint64(i8MaxU(uint8(x1hi>>24), uint8(x2hi>>24)))<<24 | uint64(i8MaxU(uint8(x1hi>>16), uint8(x2hi>>16)))<<16 | - uint64(i8MaxU(uint8(x1hi>>40), uint8(x2hi>>40)))<<40 | uint64(i8MaxU(uint8(x1hi>>32), uint8(x2hi>>32)))<<32 | - uint64(i8MaxU(uint8(x1hi>>56), uint8(x2hi>>56)))<<56 | uint64(i8MaxU(uint8(x1hi>>48), uint8(x2hi>>48)))<<48 - } - case wazeroir.ShapeI16x8: - if op.B3 { // signed - retLo = uint64(i16MaxS(uint16(x1lo), uint16(x2lo))) | - uint64(i16MaxS(uint16(x1lo>>16), uint16(x2lo>>16)))<<16 | - uint64(i16MaxS(uint16(x1lo>>32), uint16(x2lo>>32)))<<32 | - uint64(i16MaxS(uint16(x1lo>>48), uint16(x2lo>>48)))<<48 - retHi = uint64(i16MaxS(uint16(x1hi), uint16(x2hi))) | - uint64(i16MaxS(uint16(x1hi>>16), uint16(x2hi>>16)))<<16 | - uint64(i16MaxS(uint16(x1hi>>32), uint16(x2hi>>32)))<<32 | - uint64(i16MaxS(uint16(x1hi>>48), uint16(x2hi>>48)))<<48 - } else { - retLo = uint64(i16MaxU(uint16(x1lo), uint16(x2lo))) | - uint64(i16MaxU(uint16(x1lo>>16), uint16(x2lo>>16)))<<16 | - uint64(i16MaxU(uint16(x1lo>>32), uint16(x2lo>>32)))<<32 | - uint64(i16MaxU(uint16(x1lo>>48), uint16(x2lo>>48)))<<48 - retHi = uint64(i16MaxU(uint16(x1hi), uint16(x2hi))) | - uint64(i16MaxU(uint16(x1hi>>16), uint16(x2hi>>16)))<<16 | - uint64(i16MaxU(uint16(x1hi>>32), uint16(x2hi>>32)))<<32 | - uint64(i16MaxU(uint16(x1hi>>48), uint16(x2hi>>48)))<<48 - } - case wazeroir.ShapeI32x4: - if op.B3 { // signed - retLo = uint64(i32MaxS(uint32(x1lo), uint32(x2lo))) | - uint64(i32MaxS(uint32(x1lo>>32), uint32(x2lo>>32)))<<32 - retHi = uint64(i32MaxS(uint32(x1hi), uint32(x2hi))) | - uint64(i32MaxS(uint32(x1hi>>32), uint32(x2hi>>32)))<<32 - } else { - retLo = uint64(i32MaxU(uint32(x1lo), uint32(x2lo))) | - uint64(i32MaxU(uint32(x1lo>>32), uint32(x2lo>>32)))<<32 - retHi = uint64(i32MaxU(uint32(x1hi), uint32(x2hi))) | - uint64(i32MaxU(uint32(x1hi>>32), uint32(x2hi>>32)))<<32 - } - case wazeroir.ShapeF32x4: - retHi = WasmCompatMax32bits(uint32(x1hi), uint32(x2hi)) | - WasmCompatMax32bits(uint32(x1hi>>32), uint32(x2hi>>32))<<32 - retLo = WasmCompatMax32bits(uint32(x1lo), uint32(x2lo)) | - WasmCompatMax32bits(uint32(x1lo>>32), uint32(x2lo>>32))<<32 - case wazeroir.ShapeF64x2: - retHi = math.Float64bits(moremath.WasmCompatMax64( - math.Float64frombits(x1hi), - math.Float64frombits(x2hi), - )) - retLo = math.Float64bits(moremath.WasmCompatMax64( - math.Float64frombits(x1lo), - math.Float64frombits(x2lo), - )) - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128AvgrU: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - retLo = uint64(i8RoundingAverage(uint8(x1lo>>8), uint8(x2lo>>8)))<<8 | uint64(i8RoundingAverage(uint8(x1lo), uint8(x2lo))) | - uint64(i8RoundingAverage(uint8(x1lo>>24), uint8(x2lo>>24)))<<24 | uint64(i8RoundingAverage(uint8(x1lo>>16), uint8(x2lo>>16)))<<16 | - uint64(i8RoundingAverage(uint8(x1lo>>40), uint8(x2lo>>40)))<<40 | uint64(i8RoundingAverage(uint8(x1lo>>32), uint8(x2lo>>32)))<<32 | - uint64(i8RoundingAverage(uint8(x1lo>>56), uint8(x2lo>>56)))<<56 | uint64(i8RoundingAverage(uint8(x1lo>>48), uint8(x2lo>>48)))<<48 - retHi = uint64(i8RoundingAverage(uint8(x1hi>>8), uint8(x2hi>>8)))<<8 | uint64(i8RoundingAverage(uint8(x1hi), uint8(x2hi))) | - uint64(i8RoundingAverage(uint8(x1hi>>24), uint8(x2hi>>24)))<<24 | uint64(i8RoundingAverage(uint8(x1hi>>16), uint8(x2hi>>16)))<<16 | - uint64(i8RoundingAverage(uint8(x1hi>>40), uint8(x2hi>>40)))<<40 | uint64(i8RoundingAverage(uint8(x1hi>>32), uint8(x2hi>>32)))<<32 | - uint64(i8RoundingAverage(uint8(x1hi>>56), uint8(x2hi>>56)))<<56 | uint64(i8RoundingAverage(uint8(x1hi>>48), uint8(x2hi>>48)))<<48 - case wazeroir.ShapeI16x8: - retLo = uint64(i16RoundingAverage(uint16(x1lo), uint16(x2lo))) | - uint64(i16RoundingAverage(uint16(x1lo>>16), uint16(x2lo>>16)))<<16 | - uint64(i16RoundingAverage(uint16(x1lo>>32), uint16(x2lo>>32)))<<32 | - uint64(i16RoundingAverage(uint16(x1lo>>48), uint16(x2lo>>48)))<<48 - retHi = uint64(i16RoundingAverage(uint16(x1hi), uint16(x2hi))) | - uint64(i16RoundingAverage(uint16(x1hi>>16), uint16(x2hi>>16)))<<16 | - uint64(i16RoundingAverage(uint16(x1hi>>32), uint16(x2hi>>32)))<<32 | - uint64(i16RoundingAverage(uint16(x1hi>>48), uint16(x2hi>>48)))<<48 - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Pmin: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - if op.B1 == wazeroir.ShapeF32x4 { - if flt32(math.Float32frombits(uint32(x2lo)), math.Float32frombits(uint32(x1lo))) { - retLo = x2lo & 0x00000000_ffffffff - } else { - retLo = x1lo & 0x00000000_ffffffff - } - if flt32(math.Float32frombits(uint32(x2lo>>32)), math.Float32frombits(uint32(x1lo>>32))) { - retLo |= x2lo & 0xffffffff_00000000 - } else { - retLo |= x1lo & 0xffffffff_00000000 - } - if flt32(math.Float32frombits(uint32(x2hi)), math.Float32frombits(uint32(x1hi))) { - retHi = x2hi & 0x00000000_ffffffff - } else { - retHi = x1hi & 0x00000000_ffffffff - } - if flt32(math.Float32frombits(uint32(x2hi>>32)), math.Float32frombits(uint32(x1hi>>32))) { - retHi |= x2hi & 0xffffffff_00000000 - } else { - retHi |= x1hi & 0xffffffff_00000000 - } - } else { - if flt64(math.Float64frombits(x2lo), math.Float64frombits(x1lo)) { - retLo = x2lo - } else { - retLo = x1lo - } - if flt64(math.Float64frombits(x2hi), math.Float64frombits(x1hi)) { - retHi = x2hi - } else { - retHi = x1hi - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Pmax: - x2hi, x2lo := ce.popValue(), ce.popValue() - x1hi, x1lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - if op.B1 == wazeroir.ShapeF32x4 { - if flt32(math.Float32frombits(uint32(x1lo)), math.Float32frombits(uint32(x2lo))) { - retLo = x2lo & 0x00000000_ffffffff - } else { - retLo = x1lo & 0x00000000_ffffffff - } - if flt32(math.Float32frombits(uint32(x1lo>>32)), math.Float32frombits(uint32(x2lo>>32))) { - retLo |= x2lo & 0xffffffff_00000000 - } else { - retLo |= x1lo & 0xffffffff_00000000 - } - if flt32(math.Float32frombits(uint32(x1hi)), math.Float32frombits(uint32(x2hi))) { - retHi = x2hi & 0x00000000_ffffffff - } else { - retHi = x1hi & 0x00000000_ffffffff - } - if flt32(math.Float32frombits(uint32(x1hi>>32)), math.Float32frombits(uint32(x2hi>>32))) { - retHi |= x2hi & 0xffffffff_00000000 - } else { - retHi |= x1hi & 0xffffffff_00000000 - } - } else { - if flt64(math.Float64frombits(x1lo), math.Float64frombits(x2lo)) { - retLo = x2lo - } else { - retLo = x1lo - } - if flt64(math.Float64frombits(x1hi), math.Float64frombits(x2hi)) { - retHi = x2hi - } else { - retHi = x1hi - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Ceil: - hi, lo := ce.popValue(), ce.popValue() - if op.B1 == wazeroir.ShapeF32x4 { - lo = uint64(math.Float32bits(moremath.WasmCompatCeilF32(math.Float32frombits(uint32(lo))))) | - (uint64(math.Float32bits(moremath.WasmCompatCeilF32(math.Float32frombits(uint32(lo>>32))))) << 32) - hi = uint64(math.Float32bits(moremath.WasmCompatCeilF32(math.Float32frombits(uint32(hi))))) | - (uint64(math.Float32bits(moremath.WasmCompatCeilF32(math.Float32frombits(uint32(hi>>32))))) << 32) - } else { - lo = math.Float64bits(moremath.WasmCompatCeilF64(math.Float64frombits(lo))) - hi = math.Float64bits(moremath.WasmCompatCeilF64(math.Float64frombits(hi))) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Floor: - hi, lo := ce.popValue(), ce.popValue() - if op.B1 == wazeroir.ShapeF32x4 { - lo = uint64(math.Float32bits(moremath.WasmCompatFloorF32(math.Float32frombits(uint32(lo))))) | - (uint64(math.Float32bits(moremath.WasmCompatFloorF32(math.Float32frombits(uint32(lo>>32))))) << 32) - hi = uint64(math.Float32bits(moremath.WasmCompatFloorF32(math.Float32frombits(uint32(hi))))) | - (uint64(math.Float32bits(moremath.WasmCompatFloorF32(math.Float32frombits(uint32(hi>>32))))) << 32) - } else { - lo = math.Float64bits(moremath.WasmCompatFloorF64(math.Float64frombits(lo))) - hi = math.Float64bits(moremath.WasmCompatFloorF64(math.Float64frombits(hi))) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Trunc: - hi, lo := ce.popValue(), ce.popValue() - if op.B1 == wazeroir.ShapeF32x4 { - lo = uint64(math.Float32bits(moremath.WasmCompatTruncF32(math.Float32frombits(uint32(lo))))) | - (uint64(math.Float32bits(moremath.WasmCompatTruncF32(math.Float32frombits(uint32(lo>>32))))) << 32) - hi = uint64(math.Float32bits(moremath.WasmCompatTruncF32(math.Float32frombits(uint32(hi))))) | - (uint64(math.Float32bits(moremath.WasmCompatTruncF32(math.Float32frombits(uint32(hi>>32))))) << 32) - } else { - lo = math.Float64bits(moremath.WasmCompatTruncF64(math.Float64frombits(lo))) - hi = math.Float64bits(moremath.WasmCompatTruncF64(math.Float64frombits(hi))) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Nearest: - hi, lo := ce.popValue(), ce.popValue() - if op.B1 == wazeroir.ShapeF32x4 { - lo = uint64(math.Float32bits(moremath.WasmCompatNearestF32(math.Float32frombits(uint32(lo))))) | - (uint64(math.Float32bits(moremath.WasmCompatNearestF32(math.Float32frombits(uint32(lo>>32))))) << 32) - hi = uint64(math.Float32bits(moremath.WasmCompatNearestF32(math.Float32frombits(uint32(hi))))) | - (uint64(math.Float32bits(moremath.WasmCompatNearestF32(math.Float32frombits(uint32(hi>>32))))) << 32) - } else { - lo = math.Float64bits(moremath.WasmCompatNearestF64(math.Float64frombits(lo))) - hi = math.Float64bits(moremath.WasmCompatNearestF64(math.Float64frombits(hi))) - } - ce.pushValue(lo) - ce.pushValue(hi) - frame.pc++ - case wazeroir.OperationKindV128Extend: - hi, lo := ce.popValue(), ce.popValue() - var origin uint64 - if op.B3 { // use lower 64 bits - origin = lo - } else { - origin = hi - } - - signed := op.B2 == 1 - - var retHi, retLo uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 8; i++ { - v8 := byte(origin >> (i * 8)) - - var v16 uint16 - if signed { - v16 = uint16(int8(v8)) - } else { - v16 = uint16(v8) - } - - if i < 4 { - retLo |= uint64(v16) << (i * 16) - } else { - retHi |= uint64(v16) << ((i - 4) * 16) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 4; i++ { - v16 := uint16(origin >> (i * 16)) - - var v32 uint32 - if signed { - v32 = uint32(int16(v16)) - } else { - v32 = uint32(v16) - } - - if i < 2 { - retLo |= uint64(v32) << (i * 32) - } else { - retHi |= uint64(v32) << ((i - 2) * 32) - } - } - case wazeroir.ShapeI32x4: - v32Lo := uint32(origin) - v32Hi := uint32(origin >> 32) - if signed { - retLo = uint64(int32(v32Lo)) - retHi = uint64(int32(v32Hi)) - } else { - retLo = uint64(v32Lo) - retHi = uint64(v32Hi) - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128ExtMul: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - var x1, x2 uint64 - if op.B3 { // use lower 64 bits - x1, x2 = x1Lo, x2Lo - } else { - x1, x2 = x1Hi, x2Hi - } - - signed := op.B2 == 1 - - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 8; i++ { - v1, v2 := byte(x1>>(i*8)), byte(x2>>(i*8)) - - var v16 uint16 - if signed { - v16 = uint16(int16(int8(v1)) * int16(int8(v2))) - } else { - v16 = uint16(v1) * uint16(v2) - } - - if i < 4 { - retLo |= uint64(v16) << (i * 16) - } else { - retHi |= uint64(v16) << ((i - 4) * 16) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 4; i++ { - v1, v2 := uint16(x1>>(i*16)), uint16(x2>>(i*16)) - - var v32 uint32 - if signed { - v32 = uint32(int32(int16(v1)) * int32(int16(v2))) - } else { - v32 = uint32(v1) * uint32(v2) - } - - if i < 2 { - retLo |= uint64(v32) << (i * 32) - } else { - retHi |= uint64(v32) << ((i - 2) * 32) - } - } - case wazeroir.ShapeI32x4: - v1Lo, v2Lo := uint32(x1), uint32(x2) - v1Hi, v2Hi := uint32(x1>>32), uint32(x2>>32) - if signed { - retLo = uint64(int64(int32(v1Lo)) * int64(int32(v2Lo))) - retHi = uint64(int64(int32(v1Hi)) * int64(int32(v2Hi))) - } else { - retLo = uint64(v1Lo) * uint64(v2Lo) - retHi = uint64(v1Hi) * uint64(v2Hi) - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Q15mulrSatS: - x2hi, x2Lo := ce.popValue(), ce.popValue() - x1hi, x1Lo := ce.popValue(), ce.popValue() - var retLo, retHi uint64 - for i := 0; i < 8; i++ { - var v, w int16 - if i < 4 { - v, w = int16(uint16(x1Lo>>(i*16))), int16(uint16(x2Lo>>(i*16))) - } else { - v, w = int16(uint16(x1hi>>((i-4)*16))), int16(uint16(x2hi>>((i-4)*16))) - } - - var uv uint64 - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#saturating-integer-q-format-rounding-multiplication - if calc := ((int32(v) * int32(w)) + 0x4000) >> 15; calc < math.MinInt16 { - uv = uint64(uint16(0x8000)) - } else if calc > math.MaxInt16 { - uv = uint64(uint16(0x7fff)) - } else { - uv = uint64(uint16(int16(calc))) - } - - if i < 4 { - retLo |= uv << (i * 16) - } else { - retHi |= uv << ((i - 4) * 16) - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128ExtAddPairwise: - hi, lo := ce.popValue(), ce.popValue() - - signed := op.B3 - - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI8x16: - for i := 0; i < 8; i++ { - var v1, v2 byte - if i < 4 { - v1, v2 = byte(lo>>((i*2)*8)), byte(lo>>((i*2+1)*8)) - } else { - v1, v2 = byte(hi>>(((i-4)*2)*8)), byte(hi>>(((i-4)*2+1)*8)) - } - - var v16 uint16 - if signed { - v16 = uint16(int16(int8(v1)) + int16(int8(v2))) - } else { - v16 = uint16(v1) + uint16(v2) - } - - if i < 4 { - retLo |= uint64(v16) << (i * 16) - } else { - retHi |= uint64(v16) << ((i - 4) * 16) - } - } - case wazeroir.ShapeI16x8: - for i := 0; i < 4; i++ { - var v1, v2 uint16 - if i < 2 { - v1, v2 = uint16(lo>>((i*2)*16)), uint16(lo>>((i*2+1)*16)) - } else { - v1, v2 = uint16(hi>>(((i-2)*2)*16)), uint16(hi>>(((i-2)*2+1)*16)) - } - - var v32 uint32 - if signed { - v32 = uint32(int32(int16(v1)) + int32(int16(v2))) - } else { - v32 = uint32(v1) + uint32(v2) - } - - if i < 2 { - retLo |= uint64(v32) << (i * 32) - } else { - retHi |= uint64(v32) << ((i - 2) * 32) - } - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128FloatPromote: - _, toPromote := ce.popValue(), ce.popValue() - ce.pushValue(math.Float64bits(float64(math.Float32frombits(uint32(toPromote))))) - ce.pushValue(math.Float64bits(float64(math.Float32frombits(uint32(toPromote >> 32))))) - frame.pc++ - case wazeroir.OperationKindV128FloatDemote: - hi, lo := ce.popValue(), ce.popValue() - ce.pushValue( - uint64(math.Float32bits(float32(math.Float64frombits(lo)))) | - (uint64(math.Float32bits(float32(math.Float64frombits(hi)))) << 32), - ) - ce.pushValue(0) - frame.pc++ - case wazeroir.OperationKindV128FConvertFromI: - hi, lo := ce.popValue(), ce.popValue() - v1, v2, v3, v4 := uint32(lo), uint32(lo>>32), uint32(hi), uint32(hi>>32) - signed := op.B3 - - var retLo, retHi uint64 - switch op.B1 { // Destination shape. - case wazeroir.ShapeF32x4: // f32x4 from signed/unsigned i32x4 - if signed { - retLo = uint64(math.Float32bits(float32(int32(v1)))) | - (uint64(math.Float32bits(float32(int32(v2)))) << 32) - retHi = uint64(math.Float32bits(float32(int32(v3)))) | - (uint64(math.Float32bits(float32(int32(v4)))) << 32) - } else { - retLo = uint64(math.Float32bits(float32(v1))) | - (uint64(math.Float32bits(float32(v2))) << 32) - retHi = uint64(math.Float32bits(float32(v3))) | - (uint64(math.Float32bits(float32(v4))) << 32) - } - case wazeroir.ShapeF64x2: // f64x2 from signed/unsigned i32x4 - if signed { - retLo, retHi = math.Float64bits(float64(int32(v1))), math.Float64bits(float64(int32(v2))) - } else { - retLo, retHi = math.Float64bits(float64(v1)), math.Float64bits(float64(v2)) - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Narrow: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - signed := op.B3 - - var retLo, retHi uint64 - switch op.B1 { - case wazeroir.ShapeI16x8: // signed/unsigned i16x8 to i8x16 - for i := 0; i < 8; i++ { - var v16 uint16 - if i < 4 { - v16 = uint16(x1Lo >> (i * 16)) - } else { - v16 = uint16(x1Hi >> ((i - 4) * 16)) - } - - var v byte - if signed { - if s := int16(v16); s > math.MaxInt8 { - v = math.MaxInt8 - } else if s < math.MinInt8 { - s = math.MinInt8 - v = byte(s) - } else { - v = byte(v16) - } - } else { - if s := int16(v16); s > math.MaxUint8 { - v = math.MaxUint8 - } else if s < 0 { - v = 0 - } else { - v = byte(v16) - } - } - retLo |= uint64(v) << (i * 8) - } - for i := 0; i < 8; i++ { - var v16 uint16 - if i < 4 { - v16 = uint16(x2Lo >> (i * 16)) - } else { - v16 = uint16(x2Hi >> ((i - 4) * 16)) - } - - var v byte - if signed { - if s := int16(v16); s > math.MaxInt8 { - v = math.MaxInt8 - } else if s < math.MinInt8 { - s = math.MinInt8 - v = byte(s) - } else { - v = byte(v16) - } - } else { - if s := int16(v16); s > math.MaxUint8 { - v = math.MaxUint8 - } else if s < 0 { - v = 0 - } else { - v = byte(v16) - } - } - retHi |= uint64(v) << (i * 8) - } - case wazeroir.ShapeI32x4: // signed/unsigned i32x4 to i16x8 - for i := 0; i < 4; i++ { - var v32 uint32 - if i < 2 { - v32 = uint32(x1Lo >> (i * 32)) - } else { - v32 = uint32(x1Hi >> ((i - 2) * 32)) - } - - var v uint16 - if signed { - if s := int32(v32); s > math.MaxInt16 { - v = math.MaxInt16 - } else if s < math.MinInt16 { - s = math.MinInt16 - v = uint16(s) - } else { - v = uint16(v32) - } - } else { - if s := int32(v32); s > math.MaxUint16 { - v = math.MaxUint16 - } else if s < 0 { - v = 0 - } else { - v = uint16(v32) - } - } - retLo |= uint64(v) << (i * 16) - } - - for i := 0; i < 4; i++ { - var v32 uint32 - if i < 2 { - v32 = uint32(x2Lo >> (i * 32)) - } else { - v32 = uint32(x2Hi >> ((i - 2) * 32)) - } - - var v uint16 - if signed { - if s := int32(v32); s > math.MaxInt16 { - v = math.MaxInt16 - } else if s < math.MinInt16 { - s = math.MinInt16 - v = uint16(s) - } else { - v = uint16(v32) - } - } else { - if s := int32(v32); s > math.MaxUint16 { - v = math.MaxUint16 - } else if s < 0 { - v = 0 - } else { - v = uint16(v32) - } - } - retHi |= uint64(v) << (i * 16) - } - } - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - case wazeroir.OperationKindV128Dot: - x2Hi, x2Lo := ce.popValue(), ce.popValue() - x1Hi, x1Lo := ce.popValue(), ce.popValue() - ce.pushValue( - uint64(uint32(int32(int16(x1Lo>>0))*int32(int16(x2Lo>>0))+int32(int16(x1Lo>>16))*int32(int16(x2Lo>>16)))) | - (uint64(uint32(int32(int16(x1Lo>>32))*int32(int16(x2Lo>>32))+int32(int16(x1Lo>>48))*int32(int16(x2Lo>>48)))) << 32), - ) - ce.pushValue( - uint64(uint32(int32(int16(x1Hi>>0))*int32(int16(x2Hi>>0))+int32(int16(x1Hi>>16))*int32(int16(x2Hi>>16)))) | - (uint64(uint32(int32(int16(x1Hi>>32))*int32(int16(x2Hi>>32))+int32(int16(x1Hi>>48))*int32(int16(x2Hi>>48)))) << 32), - ) - frame.pc++ - case wazeroir.OperationKindV128ITruncSatFromF: - hi, lo := ce.popValue(), ce.popValue() - signed := op.B3 - var retLo, retHi uint64 - - switch op.B1 { - case wazeroir.ShapeF32x4: // f32x4 to i32x4 - for i, f64 := range [4]float64{ - math.Trunc(float64(math.Float32frombits(uint32(lo)))), - math.Trunc(float64(math.Float32frombits(uint32(lo >> 32)))), - math.Trunc(float64(math.Float32frombits(uint32(hi)))), - math.Trunc(float64(math.Float32frombits(uint32(hi >> 32)))), - } { - - var v uint32 - if math.IsNaN(f64) { - v = 0 - } else if signed { - if f64 < math.MinInt32 { - f64 = math.MinInt32 - } else if f64 > math.MaxInt32 { - f64 = math.MaxInt32 - } - v = uint32(int32(f64)) - } else { - if f64 < 0 { - f64 = 0 - } else if f64 > math.MaxUint32 { - f64 = math.MaxUint32 - } - v = uint32(f64) - } - - if i < 2 { - retLo |= uint64(v) << (i * 32) - } else { - retHi |= uint64(v) << ((i - 2) * 32) - } - } - - case wazeroir.ShapeF64x2: // f64x2 to i32x4 - for i, f := range [2]float64{ - math.Trunc(math.Float64frombits(lo)), - math.Trunc(math.Float64frombits(hi)), - } { - var v uint32 - if math.IsNaN(f) { - v = 0 - } else if signed { - if f < math.MinInt32 { - f = math.MinInt32 - } else if f > math.MaxInt32 { - f = math.MaxInt32 - } - v = uint32(int32(f)) - } else { - if f < 0 { - f = 0 - } else if f > math.MaxUint32 { - f = math.MaxUint32 - } - v = uint32(f) - } - - retLo |= uint64(v) << (i * 32) - } - } - - ce.pushValue(retLo) - ce.pushValue(retHi) - frame.pc++ - default: - frame.pc++ - } - } - ce.popFrame() -} - -func WasmCompatMax32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(moremath.WasmCompatMax32( - math.Float32frombits(v1), - math.Float32frombits(v2), - ))) -} - -func WasmCompatMin32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(moremath.WasmCompatMin32( - math.Float32frombits(v1), - math.Float32frombits(v2), - ))) -} - -func addFloat32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(math.Float32frombits(v1) + math.Float32frombits(v2))) -} - -func subFloat32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(math.Float32frombits(v1) - math.Float32frombits(v2))) -} - -func mulFloat32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(math.Float32frombits(v1) * math.Float32frombits(v2))) -} - -func divFloat32bits(v1, v2 uint32) uint64 { - return uint64(math.Float32bits(math.Float32frombits(v1) / math.Float32frombits(v2))) -} - -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#xref-exec-numerics-op-flt-mathrm-flt-n-z-1-z-2 -func flt32(z1, z2 float32) bool { - if z1 != z1 || z2 != z2 { - return false - } else if z1 == z2 { - return false - } else if math.IsInf(float64(z1), 1) { - return false - } else if math.IsInf(float64(z1), -1) { - return true - } else if math.IsInf(float64(z2), 1) { - return true - } else if math.IsInf(float64(z2), -1) { - return false - } - return z1 < z2 -} - -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#xref-exec-numerics-op-flt-mathrm-flt-n-z-1-z-2 -func flt64(z1, z2 float64) bool { - if z1 != z1 || z2 != z2 { - return false - } else if z1 == z2 { - return false - } else if math.IsInf(z1, 1) { - return false - } else if math.IsInf(z1, -1) { - return true - } else if math.IsInf(z2, 1) { - return true - } else if math.IsInf(z2, -1) { - return false - } - return z1 < z2 -} - -func i8RoundingAverage(v1, v2 byte) byte { - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#lane-wise-integer-rounding-average - return byte((uint16(v1) + uint16(v2) + uint16(1)) / 2) -} - -func i16RoundingAverage(v1, v2 uint16) uint16 { - // https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/simd/SIMD.md#lane-wise-integer-rounding-average - return uint16((uint32(v1) + uint32(v2) + 1) / 2) -} - -func i8Abs(v byte) byte { - if i := int8(v); i < 0 { - return byte(-i) - } else { - return byte(i) - } -} - -func i8MaxU(v1, v2 byte) byte { - if v1 < v2 { - return v2 - } else { - return v1 - } -} - -func i8MinU(v1, v2 byte) byte { - if v1 > v2 { - return v2 - } else { - return v1 - } -} - -func i8MaxS(v1, v2 byte) byte { - if int8(v1) < int8(v2) { - return v2 - } else { - return v1 - } -} - -func i8MinS(v1, v2 byte) byte { - if int8(v1) > int8(v2) { - return v2 - } else { - return v1 - } -} - -func i16MaxU(v1, v2 uint16) uint16 { - if v1 < v2 { - return v2 - } else { - return v1 - } -} - -func i16MinU(v1, v2 uint16) uint16 { - if v1 > v2 { - return v2 - } else { - return v1 - } -} - -func i16MaxS(v1, v2 uint16) uint16 { - if int16(v1) < int16(v2) { - return v2 - } else { - return v1 - } -} - -func i16MinS(v1, v2 uint16) uint16 { - if int16(v1) > int16(v2) { - return v2 - } else { - return v1 - } -} - -func i32MaxU(v1, v2 uint32) uint32 { - if v1 < v2 { - return v2 - } else { - return v1 - } -} - -func i32MinU(v1, v2 uint32) uint32 { - if v1 > v2 { - return v2 - } else { - return v1 - } -} - -func i32MaxS(v1, v2 uint32) uint32 { - if int32(v1) < int32(v2) { - return v2 - } else { - return v1 - } -} - -func i32MinS(v1, v2 uint32) uint32 { - if int32(v1) > int32(v2) { - return v2 - } else { - return v1 - } -} - -func i16Abs(v uint16) uint16 { - if i := int16(v); i < 0 { - return uint16(-i) - } else { - return uint16(i) - } -} - -func i32Abs(v uint32) uint32 { - if i := int32(v); i < 0 { - return uint32(-i) - } else { - return uint32(i) - } -} - -func (ce *callEngine) callNativeFuncWithListener(ctx context.Context, m *wasm.ModuleInstance, f *function, fnl experimental.FunctionListener) context.Context { - def, typ := f.definition(), f.funcType - - ce.stackIterator.reset(ce.stack, ce.frames, f) - fnl.Before(ctx, m, def, ce.peekValues(len(typ.Params)), &ce.stackIterator) - ce.stackIterator.clear() - ce.callNativeFunc(ctx, m, f) - fnl.After(ctx, m, def, ce.peekValues(len(typ.Results))) - return ctx -} - -// popMemoryOffset takes a memory offset off the stack for use in load and store instructions. -// As the top of stack value is 64-bit, this ensures it is in range before returning it. -func (ce *callEngine) popMemoryOffset(op *wazeroir.UnionOperation) uint32 { - // TODO: Document what 'us' is and why we expect to look at value 1. - offset := op.U2 + ce.popValue() - if offset > math.MaxUint32 { - panic(wasmruntime.ErrRuntimeOutOfBoundsMemoryAccess) - } - return uint32(offset) -} - -func (ce *callEngine) callGoFuncWithStack(ctx context.Context, m *wasm.ModuleInstance, f *function) { - typ := f.funcType - paramLen := typ.ParamNumInUint64 - resultLen := typ.ResultNumInUint64 - stackLen := paramLen - - // In the interpreter engine, ce.stack may only have capacity to store - // parameters. Grow when there are more results than parameters. - if growLen := resultLen - paramLen; growLen > 0 { - for i := 0; i < growLen; i++ { - ce.stack = append(ce.stack, 0) - } - stackLen += growLen - } - - // Pass the stack elements to the go function. - stack := ce.stack[len(ce.stack)-stackLen:] - ce.callGoFunc(ctx, m, f, stack) - - // Shrink the stack when there were more parameters than results. - if shrinkLen := paramLen - resultLen; shrinkLen > 0 { - ce.stack = ce.stack[0 : len(ce.stack)-shrinkLen] - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go b/vendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go deleted file mode 100644 index b2dbd46507..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/filecache/compilationcache.go +++ /dev/null @@ -1,42 +0,0 @@ -package filecache - -import ( - "crypto/sha256" - "io" -) - -// Cache allows the compiler engine to skip compilation of wasm to machine code -// where doing so is redundant for the same wasm binary and version of wazero. -// -// This augments the default in-memory cache of compiled functions, by -// decoupling it from a wazero.Runtime instance. Concretely, a runtime loses -// its cache once closed. This cache allows the runtime to rebuild its -// in-memory cache quicker, significantly reducing first-hit penalty on a hit. -// -// See New for the example implementation. -type Cache interface { - // Get is called when the runtime is trying to get the cached compiled functions. - // Implementations are supposed to return compiled function in io.Reader with ok=true - // if the key exists on the cache. In the case of not-found, this should return - // ok=false with err=nil. content.Close() is automatically called by - // the caller of this Get. - // - // Note: the returned content won't go through the validation pass of Wasm binary - // which is applied when the binary is compiled from scratch without cache hit. - Get(key Key) (content io.ReadCloser, ok bool, err error) - // - // Add is called when the runtime is trying to add the new cache entry. - // The given `content` must be un-modified, and returned as-is in Get method. - // - // Note: the `content` is ensured to be safe through the validation phase applied on the Wasm binary. - Add(key Key, content io.Reader) (err error) - // - // Delete is called when the cache on the `key` returned by Get is no longer usable, and - // must be purged. Specifically, this is called happens when the wazero's version has been changed. - // For example, that is when there's a difference between the version of compiling wazero and the - // version of the currently used wazero. - Delete(key Key) (err error) -} - -// Key represents the 256-bit unique identifier assigned to each cache entry. -type Key = [sha256.Size]byte diff --git a/vendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go b/vendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go deleted file mode 100644 index a3030588bf..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/filecache/file_cache.go +++ /dev/null @@ -1,91 +0,0 @@ -package filecache - -import ( - "encoding/hex" - "errors" - "io" - "os" - "path" - "sync" -) - -// New returns a new Cache implemented by fileCache. -func New(dir string) Cache { - return newFileCache(dir) -} - -func newFileCache(dir string) *fileCache { - return &fileCache{dirPath: dir} -} - -// fileCache persists compiled functions into dirPath. -// -// Note: this can be expanded to do binary signing/verification, set TTL on each entry, etc. -type fileCache struct { - dirPath string - mux sync.RWMutex -} - -type fileReadCloser struct { - *os.File - fc *fileCache -} - -func (fc *fileCache) path(key Key) string { - return path.Join(fc.dirPath, hex.EncodeToString(key[:])) -} - -func (fc *fileCache) Get(key Key) (content io.ReadCloser, ok bool, err error) { - // TODO: take lock per key for more efficiency vs the complexity of impl. - fc.mux.RLock() - unlock := fc.mux.RUnlock - defer func() { - if unlock != nil { - unlock() - } - }() - - f, err := os.Open(fc.path(key)) - if errors.Is(err, os.ErrNotExist) { - return nil, false, nil - } else if err != nil { - return nil, false, err - } else { - // Unlock is done inside the content.Close() at the call site. - unlock = nil - return &fileReadCloser{File: f, fc: fc}, true, nil - } -} - -// Close wraps the os.File Close to release the read lock on fileCache. -func (f *fileReadCloser) Close() (err error) { - defer f.fc.mux.RUnlock() - err = f.File.Close() - return -} - -func (fc *fileCache) Add(key Key, content io.Reader) (err error) { - // TODO: take lock per key for more efficiency vs the complexity of impl. - fc.mux.Lock() - defer fc.mux.Unlock() - - file, err := os.Create(fc.path(key)) - if err != nil { - return - } - defer file.Close() - _, err = io.Copy(file, content) - return -} - -func (fc *fileCache) Delete(key Key) (err error) { - // TODO: take lock per key for more efficiency vs the complexity of impl. - fc.mux.Lock() - defer fc.mux.Unlock() - - err = os.Remove(fc.path(key)) - if errors.Is(err, os.ErrNotExist) { - err = nil - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants.go deleted file mode 100644 index 868b9c16a3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !windows && !js && !illumos && !solaris - -package fsapi - -import "syscall" - -// Simple aliases to constants in the syscall package for portability with -// platforms which do not have them (e.g. windows) -const ( - O_DIRECTORY = syscall.O_DIRECTORY - O_NOFOLLOW = syscall.O_NOFOLLOW - O_NONBLOCK = syscall.O_NONBLOCK -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_js.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_js.go deleted file mode 100644 index af73ddb66c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_js.go +++ /dev/null @@ -1,8 +0,0 @@ -package fsapi - -// See the comments on the same constants in constants_windows.go -const ( - O_DIRECTORY = 1 << 29 - O_NOFOLLOW = 1 << 30 - O_NONBLOCK = 1 << 31 -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_sun.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_sun.go deleted file mode 100644 index a0de49b73f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_sun.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build illumos || solaris - -package fsapi - -import "syscall" - -// See https://github.com/illumos/illumos-gate/blob/edd580643f2cf1434e252cd7779e83182ea84945/usr/src/uts/common/sys/fcntl.h#L90 -const ( - O_DIRECTORY = 0x1000000 - O_NOFOLLOW = syscall.O_NOFOLLOW - O_NONBLOCK = syscall.O_NONBLOCK -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_windows.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_windows.go deleted file mode 100644 index 33aed87052..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/constants_windows.go +++ /dev/null @@ -1,24 +0,0 @@ -package fsapi - -import "syscall" - -// Windows does not have these constants, we declare placeholders which should -// not conflict with other open flags. These placeholders are not declared as -// value zero so code written in a way which expects them to be bit flags still -// works as expected. -// -// Since those placeholder are not interpreted by the open function, the unix -// features they represent are also not implemented on windows: -// -// - O_DIRECTORY allows programs to ensure that the opened file is a directory. -// This could be emulated by doing a stat call on the file after opening it -// to verify that it is in fact a directory, then closing it and returning an -// error if it is not. -// -// - O_NOFOLLOW allows programs to ensure that if the opened file is a symbolic -// link, the link itself is opened instead of its target. -const ( - O_DIRECTORY = 1 << 29 - O_NOFOLLOW = 1 << 30 - O_NONBLOCK = syscall.O_NONBLOCK -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/dir.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/dir.go deleted file mode 100644 index c28783b461..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/dir.go +++ /dev/null @@ -1,99 +0,0 @@ -package fsapi - -import ( - "fmt" - "io/fs" - "syscall" - "time" -) - -// Dirent is an entry read from a directory. -// -// This is a portable variant of syscall.Dirent containing fields needed for -// WebAssembly ABI including WASI snapshot-01 and wasi-filesystem. Unlike -// fs.DirEntry, this may include the Ino. -type Dirent struct { - // ^^ Dirent name matches syscall.Dirent - - // Name is the base name of the directory entry. - Name string - - // Ino is the file serial number, or zero if not available. - Ino uint64 - - // Type is fs.FileMode masked on fs.ModeType. For example, zero is a - // regular file, fs.ModeDir is a directory and fs.ModeIrregular is unknown. - Type fs.FileMode -} - -func (d *Dirent) String() string { - return fmt.Sprintf("name=%s, type=%v, ino=%d", d.Name, d.Type, d.Ino) -} - -// IsDir returns true if the Type is fs.ModeDir. -func (d *Dirent) IsDir() bool { - return d.Type == fs.ModeDir -} - -// DirFile is embeddable to reduce the amount of functions to implement a file. -type DirFile struct{} - -// IsAppend implements File.IsAppend -func (DirFile) IsAppend() bool { - return false -} - -// SetAppend implements File.SetAppend -func (DirFile) SetAppend(bool) syscall.Errno { - return syscall.EISDIR -} - -// IsNonblock implements File.IsNonblock -func (DirFile) IsNonblock() bool { - return false -} - -// SetNonblock implements File.SetNonblock -func (DirFile) SetNonblock(bool) syscall.Errno { - return syscall.EISDIR -} - -// IsDir implements File.IsDir -func (DirFile) IsDir() (bool, syscall.Errno) { - return true, 0 -} - -// Read implements File.Read -func (DirFile) Read([]byte) (int, syscall.Errno) { - return 0, syscall.EISDIR -} - -// Pread implements File.Pread -func (DirFile) Pread([]byte, int64) (int, syscall.Errno) { - return 0, syscall.EISDIR -} - -// Seek implements File.Seek -func (DirFile) Seek(int64, int) (int64, syscall.Errno) { - return 0, syscall.EISDIR -} - -// PollRead implements File.PollRead -func (DirFile) PollRead(*time.Duration) (ready bool, errno syscall.Errno) { - return false, syscall.ENOSYS -} - -// Write implements File.Write -func (DirFile) Write([]byte) (int, syscall.Errno) { - return 0, syscall.EISDIR -} - -// Pwrite implements File.Pwrite -func (DirFile) Pwrite([]byte, int64) (int, syscall.Errno) { - return 0, syscall.EISDIR -} - -// Truncate implements File.Truncate -func (DirFile) Truncate(int64) syscall.Errno { - return syscall.EISDIR -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/file.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/file.go deleted file mode 100644 index 2d6ad0372e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/file.go +++ /dev/null @@ -1,382 +0,0 @@ -package fsapi - -import ( - "io/fs" - "syscall" - "time" -) - -// File is a writeable fs.File bridge backed by syscall functions needed for ABI -// including WASI and runtime.GOOS=js. -// -// Implementations should embed UnimplementedFile for forward compatability. Any -// unsupported method or parameter should return syscall.ENOSYS. -// -// # Errors -// -// All methods that can return an error return a syscall.Errno, which is zero -// on success. -// -// Restricting to syscall.Errno matches current WebAssembly host functions, -// which are constrained to well-known error codes. For example, `GOOS=js` maps -// hard coded values and panics otherwise. More commonly, WASI maps syscall -// errors to u32 numeric values. -// -// # Notes -// -// A writable filesystem abstraction is not yet implemented as of Go 1.20. See -// https://github.com/golang/go/issues/45757 -type File interface { - // Ino returns the inode (Stat_t.Ino) of this file, zero if unknown or an - // error there was an error retrieving it. - // - // # Errors - // - // Possible errors are those from Stat, except syscall.ENOSYS should not - // be returned. Zero should be returned if there is no implementation. - // - // # Notes - // - // - Some implementations implement this with a cached call to Stat. - Ino() (uint64, syscall.Errno) - - // IsNonblock returns true if the file was opened with O_NONBLOCK, or - // SetNonblock was successfully enabled on this file. - // - // # Notes - // - // - This might not match the underlying state of the file descriptor if - // the file was not opened via OpenFile. - IsNonblock() bool - - // SetNonblock toggles the non-blocking mode (O_NONBLOCK) of this file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.SetNonblock and `fcntl` with O_NONBLOCK in - // POSIX. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html - SetNonblock(enable bool) syscall.Errno - - // IsAppend returns true if the file was opened with syscall.O_APPEND, or - // SetAppend was successfully enabled on this file. - // - // # Notes - // - // - This might not match the underlying state of the file descriptor if - // the file was not opened via OpenFile. - IsAppend() bool - - // SetAppend toggles the append mode (syscall.O_APPEND) of this file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - There is no `O_APPEND` for `fcntl` in POSIX, so implementations may - // have to re-open the underlying file to apply this. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html - SetAppend(enable bool) syscall.Errno - - // Stat is similar to syscall.Fstat. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.Fstat and `fstatat` with `AT_FDCWD` in POSIX. - // See https://pubs.opengroup.org/onlinepubs/9699919799/functions/stat.html - // - A fs.FileInfo backed implementation sets atim, mtim and ctim to the - // same value. - // - Windows allows you to stat a closed directory. - Stat() (Stat_t, syscall.Errno) - - // IsDir returns true if this file is a directory or an error there was an - // error retrieving this information. - // - // # Errors - // - // Possible errors are those from Stat. - // - // # Notes - // - // - Some implementations implement this with a cached call to Stat. - IsDir() (bool, syscall.Errno) - - // Read attempts to read all bytes in the file into `buf`, and returns the - // count read even on error. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed or not readable. - // - syscall.EISDIR: the file was a directory. - // - // # Notes - // - // - This is like io.Reader and `read` in POSIX, preferring semantics of - // io.Reader. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html - // - Unlike io.Reader, there is no io.EOF returned on end-of-file. To - // read the file completely, the caller must repeat until `n` is zero. - Read(buf []byte) (n int, errno syscall.Errno) - - // Pread attempts to read all bytes in the file into `p`, starting at the - // offset `off`, and returns the count read even on error. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed or not readable. - // - syscall.EINVAL: the offset was negative. - // - syscall.EISDIR: the file was a directory. - // - // # Notes - // - // - This is like io.ReaderAt and `pread` in POSIX, preferring semantics - // of io.ReaderAt. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html - // - Unlike io.ReaderAt, there is no io.EOF returned on end-of-file. To - // read the file completely, the caller must repeat until `n` is zero. - Pread(buf []byte, off int64) (n int, errno syscall.Errno) - - // Seek attempts to set the next offset for Read or Write and returns the - // resulting absolute offset or an error. - // - // # Parameters - // - // The `offset` parameters is interpreted in terms of `whence`: - // - io.SeekStart: relative to the start of the file, e.g. offset=0 sets - // the next Read or Write to the beginning of the file. - // - io.SeekCurrent: relative to the current offset, e.g. offset=16 sets - // the next Read or Write 16 bytes past the prior. - // - io.SeekEnd: relative to the end of the file, e.g. offset=-1 sets the - // next Read or Write to the last byte in the file. - // - // # Behavior when a directory - // - // The only supported use case for a directory is seeking to `offset` zero - // (`whence` = io.SeekStart). This should have the same behavior as - // os.File, which resets any internal state used by Readdir. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed or not readable. - // - syscall.EINVAL: the offset was negative. - // - // # Notes - // - // - This is like io.Seeker and `fseek` in POSIX, preferring semantics - // of io.Seeker. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/fseek.html - Seek(offset int64, whence int) (newOffset int64, errno syscall.Errno) - - // PollRead returns if the file has data ready to be read or an error. - // - // # Parameters - // - // The `timeout` parameter when nil blocks up to forever. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - // # Notes - // - // - This is like `poll` in POSIX, for a single file. - // See https://pubs.opengroup.org/onlinepubs/9699919799/functions/poll.html - // - No-op files, such as those which read from /dev/null, should return - // immediately true to avoid hangs (because data will never become - // available). - PollRead(timeout *time.Duration) (ready bool, errno syscall.Errno) - - // Readdir reads the contents of the directory associated with file and - // returns a slice of up to n Dirent values in an arbitrary order. This is - // a stateful function, so subsequent calls return any next values. - // - // If n > 0, Readdir returns at most n entries or an error. - // If n <= 0, Readdir returns all remaining entries or an error. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.ENOTDIR: the file was not a directory - // - // # Notes - // - // - This is like `Readdir` on os.File, but unlike `readdir` in POSIX. - // See https://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html - // - For portability reasons, no error is returned at the end of the - // directory, when the file is closed or removed while open. - // See https://github.com/ziglang/zig/blob/0.10.1/lib/std/fs.zig#L635-L637 - Readdir(n int) (dirents []Dirent, errno syscall.Errno) - // ^-- TODO: consider being more like POSIX, for example, returning a - // closeable Dirent object that can iterate on demand. This would - // centralize sizing logic needed by wasi, particularly extra dirents - // stored in the sys.FileEntry type. It could possibly reduce the need to - // reopen the whole file. - - // Write attempts to write all bytes in `p` to the file, and returns the - // count written even on error. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file was closed, not writeable, or a directory. - // - // # Notes - // - // - This is like io.Writer and `write` in POSIX, preferring semantics of - // io.Writer. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html - Write(buf []byte) (n int, errno syscall.Errno) - - // Pwrite attempts to write all bytes in `p` to the file at the given - // offset `off`, and returns the count written even on error. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed or not writeable. - // - syscall.EINVAL: the offset was negative. - // - syscall.EISDIR: the file was a directory. - // - // # Notes - // - // - This is like io.WriterAt and `pwrite` in POSIX, preferring semantics - // of io.WriterAt. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html - Pwrite(buf []byte, off int64) (n int, errno syscall.Errno) - - // Truncate truncates a file to a specified length. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - syscall.EINVAL: the `size` is negative. - // - syscall.EISDIR: the file was a directory. - // - // # Notes - // - // - This is like syscall.Ftruncate and `ftruncate` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html - // - Windows does not error when calling Truncate on a closed file. - Truncate(size int64) syscall.Errno - - // Sync synchronizes changes to the file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.Fsync and `fsync` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html - // - This returns with no error instead of syscall.ENOSYS when - // unimplemented. This prevents fake filesystems from erring. - // - Windows does not error when calling Sync on a closed file. - Sync() syscall.Errno - - // Datasync synchronizes the data of a file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.Fdatasync and `fdatasync` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html - // - This returns with no error instead of syscall.ENOSYS when - // unimplemented. This prevents fake filesystems from erring. - // - As this is commonly missing, some implementations dispatch to Sync. - Datasync() syscall.Errno - - // Chmod changes the mode of the file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.Fchmod and `fchmod` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchmod.html - // - Windows ignores the execute bit, and any permissions come back as - // group and world. For example, chmod of 0400 reads back as 0444, and - // 0700 0666. Also, permissions on directories aren't supported at all. - Chmod(fs.FileMode) syscall.Errno - - // Chown changes the owner and group of a file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.Fchown and `fchown` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchown.html - // - This always returns syscall.ENOSYS on windows. - Chown(uid, gid int) syscall.Errno - - // Utimens set file access and modification times of this file, at - // nanosecond precision. - // - // # Parameters - // - // The `times` parameter includes the access and modification timestamps to - // assign. Special syscall.Timespec NSec values UTIME_NOW and UTIME_OMIT may be - // specified instead of real timestamps. A nil `times` parameter behaves the - // same as if both were set to UTIME_NOW. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EBADF: the file or directory was closed. - // - // # Notes - // - // - This is like syscall.UtimesNano and `futimens` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html - // - Windows requires files to be open with syscall.O_RDWR, which means you - // cannot use this to update timestamps on a directory (syscall.EPERM). - Utimens(times *[2]syscall.Timespec) syscall.Errno - - // Close closes the underlying file. - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - // # Notes - // - // - This is like syscall.Close and `close` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html - Close() syscall.Errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/fs.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/fs.go deleted file mode 100644 index 9a46bfe6c6..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/fs.go +++ /dev/null @@ -1,365 +0,0 @@ -package fsapi - -import ( - "io/fs" - "syscall" -) - -// FS is a writeable fs.FS bridge backed by syscall functions needed for ABI -// including WASI and runtime.GOOS=js. -// -// Implementations should embed UnimplementedFS for forward compatability. Any -// unsupported method or parameter should return syscall.ENO -// -// # Errors -// -// All methods that can return an error return a syscall.Errno, which is zero -// on success. -// -// Restricting to syscall.Errno matches current WebAssembly host functions, -// which are constrained to well-known error codes. For example, `GOOS=js` maps -// hard coded values and panics otherwise. More commonly, WASI maps syscall -// errors to u32 numeric values. -// -// # Notes -// -// A writable filesystem abstraction is not yet implemented as of Go 1.20. See -// https://github.com/golang/go/issues/45757 -type FS interface { - // String should return a human-readable format of the filesystem - // - // For example, if this filesystem is backed by the real directory - // "/tmp/wasm", the expected value is "/tmp/wasm". - // - // When the host filesystem isn't a real filesystem, substitute a symbolic, - // human-readable name. e.g. "virtual" - String() string - - // OpenFile opens a file. It should be closed via Close on File. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` or `flag` is invalid. - // - syscall.EISDIR: the path was a directory, but flag included - // syscall.O_RDWR or syscall.O_WRONLY - // - syscall.ENOENT: `path` doesn't exist and `flag` doesn't contain - // os.O_CREATE. - // - // # Constraints on the returned file - // - // Implementations that can read flags should enforce them regardless of - // the type returned. For example, while os.File implements io.Writer, - // attempts to write to a directory or a file opened with os.O_RDONLY fail - // with a syscall.EBADF. - // - // Some implementations choose whether to enforce read-only opens, namely - // fs.FS. While fs.FS is supported (Adapt), wazero cannot runtime enforce - // open flags. Instead, we encourage good behavior and test our built-in - // implementations. - // - // # Notes - // - // - This is like os.OpenFile, except the path is relative to this file - // system, and syscall.Errno is returned instead of os.PathError. - // - flag are the same as os.OpenFile, for example, os.O_CREATE. - // - Implications of permissions when os.O_CREATE are described in Chmod - // notes. - // - This is like `open` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html - OpenFile(path string, flag int, perm fs.FileMode) (File, syscall.Errno) - // ^^ TODO: Consider syscall.Open, though this implies defining and - // coercing flags and perms similar to what is done in os.OpenFile. - - // Lstat gets file status without following symbolic links. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.ENOENT: `path` doesn't exist. - // - // # Notes - // - // - This is like syscall.Lstat, except the `path` is relative to this - // file system. - // - This is like `lstat` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/lstat.html - // - An fs.FileInfo backed implementation sets atim, mtim and ctim to the - // same value. - // - When the path is a symbolic link, the stat returned is for the link, - // not the file it refers to. - Lstat(path string) (Stat_t, syscall.Errno) - - // Stat gets file status. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.ENOENT: `path` doesn't exist. - // - // # Notes - // - // - This is like syscall.Stat, except the `path` is relative to this - // file system. - // - This is like `stat` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/stat.html - // - An fs.FileInfo backed implementation sets atim, mtim and ctim to the - // same value. - // - When the path is a symbolic link, the stat returned is for the file - // it refers to. - Stat(path string) (Stat_t, syscall.Errno) - - // Mkdir makes a directory. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.EEXIST: `path` exists and is a directory. - // - syscall.ENOTDIR: `path` exists and is a file. - // - // # Notes - // - // - This is like syscall.Mkdir, except the `path` is relative to this - // file system. - // - This is like `mkdir` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html - // - Implications of permissions are described in Chmod notes. - Mkdir(path string, perm fs.FileMode) syscall.Errno - // ^^ TODO: Consider syscall.Mkdir, though this implies defining and - // coercing flags and perms similar to what is done in os.Mkdir. - - // Chmod changes the mode of the file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.ENOENT: `path` does not exist. - // - // # Notes - // - // - This is like syscall.Chmod, except the `path` is relative to this - // file system. - // - This is like `chmod` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/chmod.html - // - Windows ignores the execute bit, and any permissions come back as - // group and world. For example, chmod of 0400 reads back as 0444, and - // 0700 0666. Also, permissions on directories aren't supported at all. - Chmod(path string, perm fs.FileMode) syscall.Errno - - // Chown changes the owner and group of a file. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.ENOENT: `path` does not exist. - // - // # Notes - // - // - This is like syscall.Chown, except the `path` is relative to this - // file system. - // - This is like `chown` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html - // - This always returns syscall.ENOSYS on windows. - Chown(path string, uid, gid int) syscall.Errno - - // Lchown changes the owner and group of a symbolic link. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.ENOENT: `path` does not exist. - // - // # Notes - // - // - This is like syscall.Lchown, except the `path` is relative to this - // file system. - // - This is like `lchown` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html - // - Windows will always return syscall.ENOSYS - Lchown(path string, uid, gid int) syscall.Errno - - // Rename renames file or directory. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `from` or `to` is invalid. - // - syscall.ENOENT: `from` or `to` don't exist. - // - syscall.ENOTDIR: `from` is a directory and `to` exists as a file. - // - syscall.EISDIR: `from` is a file and `to` exists as a directory. - // - syscall.ENOTEMPTY: `both from` and `to` are existing directory, but - // `to` is not empty. - // - // # Notes - // - // - This is like syscall.Rename, except the paths are relative to this - // file system. - // - This is like `rename` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/rename.html - // - Windows doesn't let you overwrite an existing directory. - Rename(from, to string) syscall.Errno - - // Rmdir removes a directory. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.ENOENT: `path` doesn't exist. - // - syscall.ENOTDIR: `path` exists, but isn't a directory. - // - syscall.ENOTEMPTY: `path` exists, but isn't empty. - // - // # Notes - // - // - This is like syscall.Rmdir, except the `path` is relative to this - // file system. - // - This is like `rmdir` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/rmdir.html - // - As of Go 1.19, Windows maps syscall.ENOTDIR to syscall.ENOENT. - Rmdir(path string) syscall.Errno - - // Unlink removes a directory entry. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.ENOENT: `path` doesn't exist. - // - syscall.EISDIR: `path` exists, but is a directory. - // - // # Notes - // - // - This is like syscall.Unlink, except the `path` is relative to this - // file system. - // - This is like `unlink` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html - // - On Windows, syscall.Unlink doesn't delete symlink to directory unlike other platforms. Implementations might - // want to combine syscall.RemoveDirectory with syscall.Unlink in order to delete such links on Windows. - // See https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-removedirectorya - Unlink(path string) syscall.Errno - - // Link creates a "hard" link from oldPath to newPath, in contrast to a - // soft link (via Symlink). - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EPERM: `oldPath` is invalid. - // - syscall.ENOENT: `oldPath` doesn't exist. - // - syscall.EISDIR: `newPath` exists, but is a directory. - // - // # Notes - // - // - This is like syscall.Link, except the `oldPath` is relative to this - // file system. - // - This is like `link` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html - Link(oldPath, newPath string) syscall.Errno - - // Symlink creates a "soft" link from oldPath to newPath, in contrast to a - // hard link (via Link). - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EPERM: `oldPath` or `newPath` is invalid. - // - syscall.EEXIST: `newPath` exists. - // - // # Notes - // - // - This is like syscall.Symlink, except the `oldPath` is relative to - // this file system. - // - This is like `symlink` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/symlink.html - // - Only `newPath` is relative to this file system and `oldPath` is kept - // as-is. That is because the link is only resolved relative to the - // directory when dereferencing it (e.g. ReadLink). - // See https://github.com/bytecodealliance/cap-std/blob/v1.0.4/cap-std/src/fs/dir.rs#L404-L409 - // for how others implement this. - // - Symlinks in Windows requires `SeCreateSymbolicLinkPrivilege`. - // Otherwise, syscall.EPERM results. - // See https://learn.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/create-symbolic-links - Symlink(oldPath, linkName string) syscall.Errno - - // Readlink reads the contents of a symbolic link. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - // # Notes - // - // - This is like syscall.Readlink, except the path is relative to this - // filesystem. - // - This is like `readlink` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html - // - On Windows, the path separator is different from other platforms, - // but to provide consistent results to Wasm, this normalizes to a "/" - // separator. - Readlink(path string) (string, syscall.Errno) - - // Truncate truncates a file to a specified length. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid or size is negative. - // - syscall.ENOENT: `path` doesn't exist. - // - syscall.EISDIR: `path` is a directory. - // - syscall.EACCES: `path` doesn't have write access. - // - // # Notes - // - // - This is like syscall.Truncate, except the path is relative to this - // filesystem. - // - This is like `truncate` in POSIX. See - // https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html - Truncate(path string, size int64) syscall.Errno - - // Utimens set file access and modification times on a path relative to - // this file system, at nanosecond precision. - // - // # Parameters - // - // The `times` parameter includes the access and modification timestamps to - // assign. Special syscall.Timespec NSec values platform.UTIME_NOW and - // platform.UTIME_OMIT may be specified instead of real timestamps. A nil - // `times` parameter behaves the same as if both were set to - // platform.UTIME_NOW. - // - // When the `symlinkFollow` parameter is true and the path is a symbolic link, - // the target of expanding that link is updated. - // - // # Errors - // - // A zero syscall.Errno is success. The below are expected otherwise: - // - syscall.ENOSYS: the implementation does not support this function. - // - syscall.EINVAL: `path` is invalid. - // - syscall.EEXIST: `path` exists and is a directory. - // - syscall.ENOTDIR: `path` exists and is a file. - // - // # Notes - // - // - This is like syscall.UtimesNano and `utimensat` with `AT_FDCWD` in - // POSIX. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html - Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/stat.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/stat.go deleted file mode 100644 index 3901a6aff9..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/stat.go +++ /dev/null @@ -1,48 +0,0 @@ -package fsapi - -import "io/fs" - -// Stat_t is similar to syscall.Stat_t, and fields frequently used by -// WebAssembly ABI including WASI snapshot-01, GOOS=js and wasi-filesystem. -// -// # Note -// -// Zero values may be returned where not available. For example, fs.FileInfo -// implementations may not be able to provide Ino values. -type Stat_t struct { - // Dev is the device ID of device containing the file. - Dev uint64 - - // Ino is the file serial number. - Ino uint64 - - // Uid is the user ID that owns the file, or zero if unsupported. - // For example, this is unsupported on some virtual filesystems or windows. - Uid uint32 - - // Gid is the group ID that owns the file, or zero if unsupported. - // For example, this is unsupported on some virtual filesystems or windows. - Gid uint32 - - // Mode is the same as Mode on fs.FileInfo containing bits to identify the - // type of the file (fs.ModeType) and its permissions (fs.ModePerm). - Mode fs.FileMode - - /// Nlink is the number of hard links to the file. - Nlink uint64 - // ^^ uint64 not uint16 to accept widest syscall.Stat_t.Nlink - - // Size is the length in bytes for regular files. For symbolic links, this - // is length in bytes of the pathname contained in the symbolic link. - Size int64 - // ^^ int64 not uint64 to defer to fs.FileInfo - - // Atim is the last data access timestamp in epoch nanoseconds. - Atim int64 - - // Mtim is the last data modification timestamp in epoch nanoseconds. - Mtim int64 - - // Ctim is the last file status change timestamp in epoch nanoseconds. - Ctim int64 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/fsapi/unimplemented.go b/vendor/github.com/tetratelabs/wazero/internal/fsapi/unimplemented.go deleted file mode 100644 index 7a57468ba7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/fsapi/unimplemented.go +++ /dev/null @@ -1,205 +0,0 @@ -package fsapi - -import ( - "io/fs" - "syscall" - "time" -) - -// UnimplementedFS is an FS that returns syscall.ENOSYS for all functions, -// This should be embedded to have forward compatible implementations. -type UnimplementedFS struct{} - -// String implements fmt.Stringer -func (UnimplementedFS) String() string { - return "Unimplemented:/" -} - -// Open implements the same method as documented on fs.FS -func (UnimplementedFS) Open(name string) (fs.File, error) { - return nil, &fs.PathError{Op: "open", Path: name, Err: syscall.ENOSYS} -} - -// OpenFile implements FS.OpenFile -func (UnimplementedFS) OpenFile(path string, flag int, perm fs.FileMode) (File, syscall.Errno) { - return nil, syscall.ENOSYS -} - -// Lstat implements FS.Lstat -func (UnimplementedFS) Lstat(path string) (Stat_t, syscall.Errno) { - return Stat_t{}, syscall.ENOSYS -} - -// Stat implements FS.Stat -func (UnimplementedFS) Stat(path string) (Stat_t, syscall.Errno) { - return Stat_t{}, syscall.ENOSYS -} - -// Readlink implements FS.Readlink -func (UnimplementedFS) Readlink(path string) (string, syscall.Errno) { - return "", syscall.ENOSYS -} - -// Mkdir implements FS.Mkdir -func (UnimplementedFS) Mkdir(path string, perm fs.FileMode) syscall.Errno { - return syscall.ENOSYS -} - -// Chmod implements FS.Chmod -func (UnimplementedFS) Chmod(path string, perm fs.FileMode) syscall.Errno { - return syscall.ENOSYS -} - -// Chown implements FS.Chown -func (UnimplementedFS) Chown(path string, uid, gid int) syscall.Errno { - return syscall.ENOSYS -} - -// Lchown implements FS.Lchown -func (UnimplementedFS) Lchown(path string, uid, gid int) syscall.Errno { - return syscall.ENOSYS -} - -// Rename implements FS.Rename -func (UnimplementedFS) Rename(from, to string) syscall.Errno { - return syscall.ENOSYS -} - -// Rmdir implements FS.Rmdir -func (UnimplementedFS) Rmdir(path string) syscall.Errno { - return syscall.ENOSYS -} - -// Link implements FS.Link -func (UnimplementedFS) Link(_, _ string) syscall.Errno { - return syscall.ENOSYS -} - -// Symlink implements FS.Symlink -func (UnimplementedFS) Symlink(_, _ string) syscall.Errno { - return syscall.ENOSYS -} - -// Unlink implements FS.Unlink -func (UnimplementedFS) Unlink(path string) syscall.Errno { - return syscall.ENOSYS -} - -// Utimens implements FS.Utimens -func (UnimplementedFS) Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno { - return syscall.ENOSYS -} - -// Truncate implements FS.Truncate -func (UnimplementedFS) Truncate(string, int64) syscall.Errno { - return syscall.ENOSYS -} - -// UnimplementedFile is a File that returns syscall.ENOSYS for all functions, -// except where no-op are otherwise documented. -// -// This should be embedded to have forward compatible implementations. -type UnimplementedFile struct{} - -// Ino implements File.Ino -func (UnimplementedFile) Ino() (uint64, syscall.Errno) { - return 0, 0 -} - -// IsAppend implements File.IsAppend -func (UnimplementedFile) IsAppend() bool { - return false -} - -// SetAppend implements File.SetAppend -func (UnimplementedFile) SetAppend(bool) syscall.Errno { - return syscall.ENOSYS -} - -// IsNonblock implements File.IsNonblock -func (UnimplementedFile) IsNonblock() bool { - return false -} - -// SetNonblock implements File.SetNonblock -func (UnimplementedFile) SetNonblock(bool) syscall.Errno { - return syscall.ENOSYS -} - -// Stat implements File.Stat -func (UnimplementedFile) Stat() (Stat_t, syscall.Errno) { - return Stat_t{}, syscall.ENOSYS -} - -// IsDir implements File.IsDir -func (UnimplementedFile) IsDir() (bool, syscall.Errno) { - return false, syscall.ENOSYS -} - -// Read implements File.Read -func (UnimplementedFile) Read([]byte) (int, syscall.Errno) { - return 0, syscall.ENOSYS -} - -// Pread implements File.Pread -func (UnimplementedFile) Pread([]byte, int64) (int, syscall.Errno) { - return 0, syscall.ENOSYS -} - -// Seek implements File.Seek -func (UnimplementedFile) Seek(int64, int) (int64, syscall.Errno) { - return 0, syscall.ENOSYS -} - -// Readdir implements File.Readdir -func (UnimplementedFile) Readdir(int) (dirents []Dirent, errno syscall.Errno) { - return nil, syscall.ENOSYS -} - -// PollRead implements File.PollRead -func (UnimplementedFile) PollRead(*time.Duration) (ready bool, errno syscall.Errno) { - return false, syscall.ENOSYS -} - -// Write implements File.Write -func (UnimplementedFile) Write([]byte) (int, syscall.Errno) { - return 0, syscall.ENOSYS -} - -// Pwrite implements File.Pwrite -func (UnimplementedFile) Pwrite([]byte, int64) (int, syscall.Errno) { - return 0, syscall.ENOSYS -} - -// Truncate implements File.Truncate -func (UnimplementedFile) Truncate(int64) syscall.Errno { - return syscall.ENOSYS -} - -// Sync implements File.Sync -func (UnimplementedFile) Sync() syscall.Errno { - return 0 // not syscall.ENOSYS -} - -// Datasync implements File.Datasync -func (UnimplementedFile) Datasync() syscall.Errno { - return 0 // not syscall.ENOSYS -} - -// Chmod implements File.Chmod -func (UnimplementedFile) Chmod(fs.FileMode) syscall.Errno { - return syscall.ENOSYS -} - -// Chown implements File.Chown -func (UnimplementedFile) Chown(int, int) syscall.Errno { - return syscall.ENOSYS -} - -// Utimens implements File.Utimens -func (UnimplementedFile) Utimens(*[2]syscall.Timespec) syscall.Errno { - return syscall.ENOSYS -} - -// Close implements File.Close -func (UnimplementedFile) Close() (errno syscall.Errno) { return } diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/argsenv.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/argsenv.go deleted file mode 100644 index f41a5b16f7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/argsenv.go +++ /dev/null @@ -1,73 +0,0 @@ -package gojs - -import ( - "encoding/binary" - "errors" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/util" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// Constants about memory layout. See REFERENCE.md -const ( - endOfPageZero = uint32(4096) // runtime.minLegalPointer - maxArgsAndEnviron = uint32(8192) // ld.wasmMinDataAddr - runtime.minLegalPointer - wasmMinDataAddr = endOfPageZero + maxArgsAndEnviron // ld.wasmMinDataAddr -) - -var le = binary.LittleEndian - -// WriteArgsAndEnviron writes arguments and environment variables to memory, so -// they can be read by main, Go compiles as the function export "run". -func WriteArgsAndEnviron(mod api.Module) (argc, argv uint32, err error) { - mem := mod.Memory() - sysCtx := mod.(*wasm.ModuleInstance).Sys - args := sysCtx.Args() - environ := sysCtx.Environ() - - argc = uint32(len(args)) - offset := endOfPageZero - - strPtr := func(val []byte, field string, i int) (ptr uint32) { - // TODO: return err and format "%s[%d], field, i" - ptr = offset - util.MustWrite(mem, field, offset, append(val, 0)) - offset += uint32(len(val) + 1) - if pad := offset % 8; pad != 0 { - offset += 8 - pad - } - return - } - - argvPtrLen := len(args) + 1 + len(environ) + 1 - argvPtrs := make([]uint32, 0, argvPtrLen) - for i, arg := range args { - argvPtrs = append(argvPtrs, strPtr(arg, "args", i)) - } - argvPtrs = append(argvPtrs, 0) - - for i, env := range environ { - argvPtrs = append(argvPtrs, strPtr(env, "env", i)) - } - argvPtrs = append(argvPtrs, 0) - - argv = offset - - stop := uint32(argvPtrLen << 3) // argvPtrLen * 8 - if offset+stop >= wasmMinDataAddr { - err = errors.New("total length of command line and environment variables exceeds limit") - } - - buf, ok := mem.Read(argv, stop) - if !ok { - panic("out of memory reading argvPtrs") - } - pos := uint32(0) - for _, ptr := range argvPtrs { - le.PutUint64(buf[pos:], uint64(ptr)) - pos += 8 - } - - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/builtin.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/builtin.go deleted file mode 100644 index e69e807fce..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/builtin.go +++ /dev/null @@ -1,58 +0,0 @@ -package gojs - -import ( - "github.com/tetratelabs/wazero/internal/gojs/config" - "github.com/tetratelabs/wazero/internal/gojs/goos" -) - -// newJsGlobal = js.Global() // js.go init -func newJsGlobal(config *config.Config) *jsVal { - var fetchProperty interface{} = goos.Undefined - uid, gid, euid := config.Uid, config.Gid, config.Euid - groups := config.Groups - proc := &processState{ - cwd: config.Workdir, - umask: config.Umask, - } - rt := config.Rt - - if config.Rt != nil { - fetchProperty = goos.RefHttpFetch - } - - return newJsVal(goos.RefValueGlobal, "global"). - addProperties(map[string]interface{}{ - "Object": objectConstructor, - "Array": arrayConstructor, - "crypto": jsCrypto, - "Uint8Array": uint8ArrayConstructor, - "fetch": fetchProperty, - "AbortController": goos.Undefined, - "Headers": headersConstructor, - "process": newJsProcess(uid, gid, euid, groups, proc), - "fs": newJsFs(proc), - "Date": jsDateConstructor, - }). - addFunction("fetch", &httpFetch{rt}) -} - -var ( - // Values below are not built-in, but verifiable by looking at Go's source. - // When marked "XX.go init", these are eagerly referenced during syscall.init - - // jsGo is not a constant - - // objectConstructor is used by js.ValueOf to make `map[string]any`. - // Get("Object") // js.go init - objectConstructor = newJsVal(goos.RefObjectConstructor, "Object") - - // arrayConstructor is used by js.ValueOf to make `[]any`. - // Get("Array") // js.go init - arrayConstructor = newJsVal(goos.RefArrayConstructor, "Array") - - // uint8ArrayConstructor = js.Global().Get("Uint8Array") - // // fs_js.go, rand_js.go, roundtrip_js.go init - // - // It has only one invocation pattern: `buf := uint8Array.New(len(b))` - uint8ArrayConstructor = newJsVal(goos.RefUint8ArrayConstructor, "Uint8Array") -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/config/config.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/config/config.go deleted file mode 100644 index 4fb239350e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/config/config.go +++ /dev/null @@ -1,71 +0,0 @@ -// Package config exists to avoid dependency cycles when keeping most of gojs -// code internal. -package config - -import ( - "fmt" - "net/http" - "os" - "path/filepath" - "runtime" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -type Config struct { - OsWorkdir bool - OsUser bool - - Uid, Gid, Euid int - Groups []int - - // Workdir is the actual working directory value. - Workdir string - Umask uint32 - Rt http.RoundTripper -} - -func NewConfig() *Config { - return &Config{ - OsWorkdir: false, - OsUser: false, - Uid: 0, - Gid: 0, - Euid: 0, - Groups: []int{0}, - Workdir: "/", - Umask: uint32(0o0022), - Rt: nil, - } -} - -func (c *Config) Clone() *Config { - ret := *c // copy except maps which share a ref - return &ret -} - -func (c *Config) Init() error { - if c.OsWorkdir { - workdir, err := os.Getwd() - if err != nil { - return err - } - // Ensure if used on windows, the input path is translated to a POSIX one. - workdir = platform.ToPosixPath(workdir) - // Strip the volume of the path, for example C:\ - c.Workdir = workdir[len(filepath.VolumeName(workdir)):] - } - - // Windows does not support any of these properties - if c.OsUser && runtime.GOOS != "windows" { - c.Uid = syscall.Getuid() - c.Gid = syscall.Getgid() - c.Euid = syscall.Geteuid() - var err error - if c.Groups, err = syscall.Getgroups(); err != nil { - return fmt.Errorf("couldn't read groups: %w", err) - } - } - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/crypto.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/crypto.go deleted file mode 100644 index 7b528da397..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/crypto.go +++ /dev/null @@ -1,31 +0,0 @@ -package gojs - -import ( - "context" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goos" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// jsCrypto is used by crypto/rand.Read to gets random values. -// -// It has only one invocation pattern: -// -// jsCrypto.Call("getRandomValues", a /* uint8Array */) -// -// This is defined as `Get("crypto")` in rand_js.go init -var jsCrypto = newJsVal(goos.RefJsCrypto, custom.NameCrypto). - addFunction(custom.NameCryptoGetRandomValues, cryptoGetRandomValues{}) - -// cryptoGetRandomValues implements jsFn -type cryptoGetRandomValues struct{} - -func (cryptoGetRandomValues) invoke(_ context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - randSource := mod.(*wasm.ModuleInstance).Sys.RandSource() - - r := args[0].(*goos.ByteArray) - n, err := randSource.Read(r.Unwrap()) - return uint32(n), err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/crypto.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/crypto.go deleted file mode 100644 index ba7cc6d6f7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/crypto.go +++ /dev/null @@ -1,17 +0,0 @@ -package custom - -const ( - NameCrypto = "crypto" - NameCryptoGetRandomValues = "getRandomValues" -) - -// CryptoNameSection are the functions defined in the object named NameCrypto. -// Results here are those set to the current event object, but effectively are -// results of the host function. -var CryptoNameSection = map[string]*Names{ - NameCryptoGetRandomValues: { - Name: NameCryptoGetRandomValues, - ParamNames: []string{"r"}, - ResultNames: []string{"n"}, - }, -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/date.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/date.go deleted file mode 100644 index 0649122ac3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/date.go +++ /dev/null @@ -1,17 +0,0 @@ -package custom - -const ( - NameDate = "Date" - NameDateGetTimezoneOffset = "getTimezoneOffset" -) - -// DateNameSection are the functions defined in the object named NameDate. -// Results here are those set to the current event object, but effectively are -// results of the host function. -var DateNameSection = map[string]*Names{ - NameDateGetTimezoneOffset: { - Name: NameDateGetTimezoneOffset, - ParamNames: []string{}, - ResultNames: []string{"tz"}, - }, -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/fs.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/fs.go deleted file mode 100644 index fbdd8eeadf..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/fs.go +++ /dev/null @@ -1,248 +0,0 @@ -package custom - -import "io/fs" - -const ( - NameFs = "fs" - NameFsOpen = "open" - NameFsStat = "stat" - NameFsFstat = "fstat" - NameFsLstat = "lstat" - NameFsClose = "close" - NameFsWrite = "write" - NameFsRead = "read" - NameFsReaddir = "readdir" - NameFsMkdir = "mkdir" - NameFsRmdir = "rmdir" - NameFsRename = "rename" - NameFsUnlink = "unlink" - NameFsUtimes = "utimes" - NameFsChmod = "chmod" - NameFsFchmod = "fchmod" - NameFsChown = "chown" - NameFsFchown = "fchown" - NameFsLchown = "lchown" - NameFsTruncate = "truncate" - NameFsFtruncate = "ftruncate" - NameFsReadlink = "readlink" - NameFsLink = "link" - NameFsSymlink = "symlink" - NameFsFsync = "fsync" -) - -// FsNameSection are the functions defined in the object named NameFs. Results -// here are those set to the current event object, but effectively are results -// of the host function. -var FsNameSection = map[string]*Names{ - NameFsOpen: { - Name: NameFsOpen, - ParamNames: []string{"path", "flags", "perm", NameCallback}, - ResultNames: []string{"err", "fd"}, - }, - NameFsStat: { - Name: NameFsStat, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "stat"}, - }, - NameFsFstat: { - Name: NameFsFstat, - ParamNames: []string{"fd", NameCallback}, - ResultNames: []string{"err", "stat"}, - }, - NameFsLstat: { - Name: NameFsLstat, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "stat"}, - }, - NameFsClose: { - Name: NameFsClose, - ParamNames: []string{"fd", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsRead: { - Name: NameFsRead, - ParamNames: []string{"fd", "buf", "offset", "byteCount", "fOffset", NameCallback}, - ResultNames: []string{"err", "n"}, - }, - NameFsWrite: { - Name: NameFsWrite, - ParamNames: []string{"fd", "buf", "offset", "byteCount", "fOffset", NameCallback}, - ResultNames: []string{"err", "n"}, - }, - NameFsReaddir: { - Name: NameFsReaddir, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "dirents"}, - }, - NameFsMkdir: { - Name: NameFsMkdir, - ParamNames: []string{"path", "perm", NameCallback}, - ResultNames: []string{"err", "fd"}, - }, - NameFsRmdir: { - Name: NameFsRmdir, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsRename: { - Name: NameFsRename, - ParamNames: []string{"from", "to", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsUnlink: { - Name: NameFsUnlink, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsUtimes: { - Name: NameFsUtimes, - ParamNames: []string{"path", "atime", "mtime", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsChmod: { - Name: NameFsChmod, - ParamNames: []string{"path", "mode", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsFchmod: { - Name: NameFsFchmod, - ParamNames: []string{"fd", "mode", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsChown: { - Name: NameFsChown, - ParamNames: []string{"path", "uid", "gid", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsFchown: { - Name: NameFsFchown, - ParamNames: []string{"fd", "uid", "gid", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsLchown: { - Name: NameFsLchown, - ParamNames: []string{"path", "uid", "gid", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsTruncate: { - Name: NameFsTruncate, - ParamNames: []string{"path", "length", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsFtruncate: { - Name: NameFsFtruncate, - ParamNames: []string{"fd", "length", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsReadlink: { - Name: NameFsReadlink, - ParamNames: []string{"path", NameCallback}, - ResultNames: []string{"err", "dst"}, - }, - NameFsLink: { - Name: NameFsLink, - ParamNames: []string{"path", "link", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsSymlink: { - Name: NameFsSymlink, - ParamNames: []string{"path", "link", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, - NameFsFsync: { - Name: NameFsFsync, - ParamNames: []string{"fd", NameCallback}, - ResultNames: []string{"err", "ok"}, - }, -} - -// mode constants from syscall_js.go -const ( - S_IFSOCK = uint32(0o000140000) - S_IFLNK = uint32(0o000120000) - S_IFREG = uint32(0o000100000) - S_IFBLK = uint32(0o000060000) - S_IFDIR = uint32(0o000040000) - S_IFCHR = uint32(0o000020000) - S_IFIFO = uint32(0o000010000) - - S_ISUID = uint32(0o004000) - S_ISGID = uint32(0o002000) - S_ISVTX = uint32(0o001000) -) - -// ToJsMode is required because the mode property read in `GOOS=js` is -// incompatible with normal go. Particularly the directory flag isn't the same. -func ToJsMode(fm fs.FileMode) (jsMode uint32) { - switch { - case fm.IsRegular(): - jsMode = S_IFREG - case fm.IsDir(): - jsMode = S_IFDIR - case fm&fs.ModeSymlink != 0: - jsMode = S_IFLNK - case fm&fs.ModeDevice != 0: - // Unlike ModeDevice and ModeCharDevice, S_IFCHR and S_IFBLK are set - // mutually exclusively. - if fm&fs.ModeCharDevice != 0 { - jsMode = S_IFCHR - } else { - jsMode = S_IFBLK - } - case fm&fs.ModeNamedPipe != 0: - jsMode = S_IFIFO - case fm&fs.ModeSocket != 0: - jsMode = S_IFSOCK - default: // unknown - jsMode = 0 - } - - jsMode |= uint32(fm & fs.ModePerm) - - if fm&fs.ModeSetgid != 0 { - jsMode |= S_ISGID - } - if fm&fs.ModeSetuid != 0 { - jsMode |= S_ISUID - } - if fm&fs.ModeSticky != 0 { - jsMode |= S_ISVTX - } - return -} - -// FromJsMode is required because the mode property read in `GOOS=js` is -// incompatible with normal go. Particularly the directory flag isn't the same. -func FromJsMode(jsMode, umask uint32) (fm fs.FileMode) { - switch { - case jsMode&S_IFREG != 0: // zero - case jsMode&S_IFDIR != 0: - fm = fs.ModeDir - case jsMode&S_IFLNK != 0: - fm = fs.ModeSymlink - case jsMode&S_IFCHR != 0: - fm = fs.ModeDevice | fs.ModeCharDevice - case jsMode&S_IFBLK != 0: - fm = fs.ModeDevice - case jsMode&S_IFIFO != 0: - fm = fs.ModeNamedPipe - case jsMode&S_IFSOCK != 0: - fm = fs.ModeSocket - default: // unknown - fm = 0 - } - - fm |= fs.FileMode(jsMode) & fs.ModePerm - - if jsMode&S_ISGID != 0 { - fm |= fs.ModeSetgid - } - if jsMode&S_ISUID != 0 { - fm |= fs.ModeSetuid - } - if jsMode&S_ISVTX != 0 { - fm |= fs.ModeSticky - } - fm &= ^(fs.FileMode(umask)) - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/names.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/names.go deleted file mode 100644 index 9c39122e20..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/names.go +++ /dev/null @@ -1,196 +0,0 @@ -// Package custom is similar to the WebAssembly Custom Sections. These are -// needed because `GOARCH=wasm GOOS=js` functions aren't defined naturally -// in WebAssembly. For example, every function has a single parameter "sp", -// which implicitly maps to stack parameters in this package. -package custom - -const ( - // NamePadding is a marker for a parameter which has no purpose, except - // padding. It should not be logged. - NamePadding = "padding" -) - -type Names struct { - // Name is the WebAssembly function name. - Name string - - // ParamNames are the parameters read in 8-byte strides from the stack - // pointer (SP). This may be nil or include NamePadding. - ParamNames []string - - // ResultNames are the results written in 8-byte strides from the stack - // pointer (SP), after ParamNames. - ResultNames []string -} - -const ( - NameCallback = "callback" - NameDebug = "debug" -) - -const ( - NameRuntimeWasmExit = "runtime.wasmExit" - NameRuntimeWasmWrite = "runtime.wasmWrite" - NameRuntimeResetMemoryDataView = "runtime.resetMemoryDataView" - NameRuntimeNanotime1 = "runtime.nanotime1" - NameRuntimeWalltime = "runtime.walltime" - NameRuntimeScheduleTimeoutEvent = "runtime.scheduleTimeoutEvent" - NameRuntimeClearTimeoutEvent = "runtime.clearTimeoutEvent" - NameRuntimeGetRandomData = "runtime.getRandomData" -) - -const ( - NameSyscallFinalizeRef = "syscall/js.finalizeRef" - NameSyscallStringVal = "syscall/js.stringVal" - NameSyscallValueGet = "syscall/js.valueGet" - NameSyscallValueSet = "syscall/js.valueSet" - NameSyscallValueDelete = "syscall/js.valueDelete" // stubbed - NameSyscallValueIndex = "syscall/js.valueIndex" - NameSyscallValueSetIndex = "syscall/js.valueSetIndex" // stubbed - NameSyscallValueCall = "syscall/js.valueCall" - NameSyscallValueInvoke = "syscall/js.valueInvoke" // stubbed - NameSyscallValueNew = "syscall/js.valueNew" - NameSyscallValueLength = "syscall/js.valueLength" - NameSyscallValuePrepareString = "syscall/js.valuePrepareString" - NameSyscallValueLoadString = "syscall/js.valueLoadString" - NameSyscallValueInstanceOf = "syscall/js.valueInstanceOf" // stubbed - NameSyscallCopyBytesToGo = "syscall/js.copyBytesToGo" - NameSyscallCopyBytesToJS = "syscall/js.copyBytesToJS" -) - -var NameSection = map[string]*Names{ - NameDebug: { - Name: NameDebug, - ParamNames: []string{}, - ResultNames: []string{}, - }, - - NameRuntimeWasmExit: { - Name: NameRuntimeWasmExit, - ParamNames: []string{"code"}, - ResultNames: []string{}, - }, - NameRuntimeWasmWrite: { - Name: NameRuntimeWasmWrite, - ParamNames: []string{"fd", "p", "p_len"}, - ResultNames: []string{}, - }, - NameRuntimeResetMemoryDataView: { - Name: NameRuntimeResetMemoryDataView, - ParamNames: []string{}, - ResultNames: []string{}, - }, - NameRuntimeNanotime1: { - Name: NameRuntimeNanotime1, - ParamNames: []string{}, - ResultNames: []string{"nsec"}, - }, - NameRuntimeWalltime: { - Name: NameRuntimeWalltime, - ParamNames: []string{}, - ResultNames: []string{"sec", "nsec"}, - }, - NameRuntimeScheduleTimeoutEvent: { - Name: NameRuntimeScheduleTimeoutEvent, - ParamNames: []string{"ms"}, - ResultNames: []string{"id"}, - }, - NameRuntimeClearTimeoutEvent: { - Name: NameRuntimeClearTimeoutEvent, - ParamNames: []string{"id"}, - ResultNames: []string{}, - }, - NameRuntimeGetRandomData: { - Name: NameRuntimeGetRandomData, - ParamNames: []string{"r", "r_len"}, - ResultNames: []string{}, - }, - - NameSyscallFinalizeRef: { - Name: NameSyscallFinalizeRef, - ParamNames: []string{"r"}, - ResultNames: []string{}, - }, - NameSyscallStringVal: { - Name: NameSyscallStringVal, - ParamNames: []string{"x", "x_len"}, - ResultNames: []string{"r"}, - }, - NameSyscallValueGet: { - Name: NameSyscallValueGet, - ParamNames: []string{"v", "p", "p_len"}, - ResultNames: []string{"r"}, - }, - NameSyscallValueSet: { - Name: NameSyscallValueSet, - ParamNames: []string{"v", "p", "p_len", "x"}, - ResultNames: []string{}, - }, - NameSyscallValueDelete: { - Name: NameSyscallValueDelete, - ParamNames: []string{"v", "p", "p_len"}, - ResultNames: []string{}, - }, - NameSyscallValueIndex: { - Name: NameSyscallValueIndex, - ParamNames: []string{"v", "i"}, - ResultNames: []string{"r"}, - }, - NameSyscallValueSetIndex: { - Name: NameSyscallValueSetIndex, - ParamNames: []string{"v", "i", "x"}, - ResultNames: []string{}, - }, - NameSyscallValueCall: { - Name: NameSyscallValueCall, - ParamNames: []string{"v", "m", "m_len", "args", "args_len", NamePadding}, - ResultNames: []string{"res", "ok"}, - }, - NameSyscallValueInvoke: { - Name: NameSyscallValueInvoke, - ParamNames: []string{"v", "args", "args_len", NamePadding}, - ResultNames: []string{"res", "ok"}, - }, - NameSyscallValueNew: { - Name: NameSyscallValueNew, - ParamNames: []string{"v", "args", "args_len", NamePadding}, - ResultNames: []string{"res", "ok"}, - }, - NameSyscallValueLength: { - Name: NameSyscallValueLength, - ParamNames: []string{"v"}, - ResultNames: []string{"len"}, - }, - NameSyscallValuePrepareString: { - Name: NameSyscallValuePrepareString, - ParamNames: []string{"v"}, - ResultNames: []string{"str", "length"}, - }, - NameSyscallValueLoadString: { - Name: NameSyscallValueLoadString, - ParamNames: []string{"v", "b", "b_len"}, - ResultNames: []string{}, - }, - NameSyscallValueInstanceOf: { - Name: NameSyscallValueInstanceOf, - ParamNames: []string{"v", "t"}, - ResultNames: []string{"ok"}, - }, - NameSyscallCopyBytesToGo: { - Name: NameSyscallCopyBytesToGo, - ParamNames: []string{"dst", "dst_len", NamePadding, "src"}, - ResultNames: []string{"n", "ok"}, - }, - NameSyscallCopyBytesToJS: { - Name: NameSyscallCopyBytesToJS, - ParamNames: []string{"dst", "src", "src_len", NamePadding}, - ResultNames: []string{"n", "ok"}, - }, -} - -var NameSectionSyscallValueCall = map[string]map[string]*Names{ - NameCrypto: CryptoNameSection, - NameDate: DateNameSection, - NameFs: FsNameSection, - NameProcess: ProcessNameSection, -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/process.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/process.go deleted file mode 100644 index c288a618fc..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/custom/process.go +++ /dev/null @@ -1,53 +0,0 @@ -package custom - -const ( - NameProcess = "process" - NameProcessCwd = "cwd" - NameProcessChdir = "chdir" - NameProcessGetuid = "getuid" - NameProcessGetgid = "getgid" - NameProcessGeteuid = "geteuid" - NameProcessGetgroups = "getgroups" - NameProcessUmask = "umask" -) - -// ProcessNameSection are the functions defined in the object named NameProcess. -// Results here are those set to the current event object, but effectively are -// results of the host function. -var ProcessNameSection = map[string]*Names{ - NameProcessCwd: { - Name: NameProcessCwd, - ParamNames: []string{}, - ResultNames: []string{"cwd"}, - }, - NameProcessChdir: { - Name: NameProcessChdir, - ParamNames: []string{"path"}, - ResultNames: []string{"err"}, - }, - NameProcessGetuid: { - Name: NameProcessGetuid, - ParamNames: []string{}, - ResultNames: []string{"uid"}, - }, - NameProcessGetgid: { - Name: NameProcessGetgid, - ParamNames: []string{}, - ResultNames: []string{"gid"}, - }, - NameProcessGeteuid: { - Name: NameProcessGeteuid, - ParamNames: []string{}, - ResultNames: []string{"euid"}, - }, - NameProcessGetgroups: { - Name: NameProcessGetgroups, - ParamNames: []string{}, - ResultNames: []string{"groups"}, - }, - NameProcessUmask: { - Name: NameProcessUmask, - ParamNames: []string{"mask"}, - ResultNames: []string{"oldmask"}, - }, -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/errno.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/errno.go deleted file mode 100644 index afc6ee07f5..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/errno.go +++ /dev/null @@ -1,113 +0,0 @@ -package gojs - -import ( - "io" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// Errno is a (GOARCH=wasm) error, which must match a key in mapJSError. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/tables_js.go#L371-L494 -type Errno struct { - s string -} - -// Error implements error. -func (e *Errno) Error() string { - return e.s -} - -// This order match constants from wasi_snapshot_preview1.ErrnoSuccess for -// easier maintenance. -var ( - // ErrnoAcces Permission denied. - ErrnoAcces = &Errno{"EACCES"} - // ErrnoAgain Resource unavailable, or operation would block. - ErrnoAgain = &Errno{"EAGAIN"} - // ErrnoBadf Bad file descriptor. - ErrnoBadf = &Errno{"EBADF"} - // ErrnoExist File exists. - ErrnoExist = &Errno{"EEXIST"} - // ErrnoFault Bad address. - ErrnoFault = &Errno{"EFAULT"} - // ErrnoIntr Interrupted function. - ErrnoIntr = &Errno{"EINTR"} - // ErrnoInval Invalid argument. - ErrnoInval = &Errno{"EINVAL"} - // ErrnoIo I/O error. - ErrnoIo = &Errno{"EIO"} - // ErrnoIsdir Is a directory. - ErrnoIsdir = &Errno{"EISDIR"} - // ErrnoLoop Too many levels of symbolic links. - ErrnoLoop = &Errno{"ELOOP"} - // ErrnoNametoolong Filename too long. - ErrnoNametoolong = &Errno{"ENAMETOOLONG"} - // ErrnoNoent No such file or directory. - ErrnoNoent = &Errno{"ENOENT"} - // ErrnoNosys function not supported. - ErrnoNosys = &Errno{"ENOSYS"} - // ErrnoNotdir Not a directory or a symbolic link to a directory. - ErrnoNotdir = &Errno{"ENOTDIR"} - // ErrnoNotempty Directory not empty. - ErrnoNotempty = &Errno{"ENOTEMPTY"} - // ErrnoNotsup Not supported, or operation not supported on socket. - ErrnoNotsup = &Errno{"ENOTSUP"} - // ErrnoPerm Operation not permitted. - ErrnoPerm = &Errno{"EPERM"} - // ErrnoRofs read-only file system. - ErrnoRofs = &Errno{"EROFS"} -) - -// ToErrno maps I/O errors as the message must be the code, ex. "EINVAL", not -// the message, e.g. "invalid argument". -// -// This should match wasi_snapshot_preview1.ToErrno for maintenance ease. -func ToErrno(err error) *Errno { - if err == nil || err == io.EOF { - return nil // io.EOF has no value in GOOS=js, and isn't an error. - } - errno := platform.UnwrapOSError(err) - - switch errno { - case syscall.EACCES: - return ErrnoAcces - case syscall.EAGAIN: - return ErrnoAgain - case syscall.EBADF: - return ErrnoBadf - case syscall.EEXIST: - return ErrnoExist - case syscall.EFAULT: - return ErrnoFault - case syscall.EINTR: - return ErrnoIntr - case syscall.EINVAL: - return ErrnoInval - case syscall.EIO: - return ErrnoIo - case syscall.EISDIR: - return ErrnoIsdir - case syscall.ELOOP: - return ErrnoLoop - case syscall.ENAMETOOLONG: - return ErrnoNametoolong - case syscall.ENOENT: - return ErrnoNoent - case syscall.ENOSYS: - return ErrnoNosys - case syscall.ENOTDIR: - return ErrnoNotdir - case syscall.ENOTEMPTY: - return ErrnoNotempty - case syscall.ENOTSUP: - return ErrnoNotsup - case syscall.EPERM: - return ErrnoPerm - case syscall.EROFS: - return ErrnoRofs - default: - return ErrnoIo - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/fs.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/fs.go deleted file mode 100644 index 3ecd5d0cca..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/fs.go +++ /dev/null @@ -1,731 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - "os" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goos" - "github.com/tetratelabs/wazero/internal/gojs/util" - internalsys "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/internal/wasm" -) - -var ( - // jsfsConstants = jsfs Get("constants") // fs_js.go init - jsfsConstants = newJsVal(goos.RefJsfsConstants, "constants"). - addProperties(map[string]interface{}{ - "O_WRONLY": oWRONLY, - "O_RDWR": oRDWR, - "O_CREAT": oCREAT, - "O_TRUNC": oTRUNC, - "O_APPEND": oAPPEND, - "O_EXCL": oEXCL, - }) - - // oWRONLY = jsfsConstants Get("O_WRONLY").Int() // fs_js.go init - oWRONLY = float64(os.O_WRONLY) - - // oRDWR = jsfsConstants Get("O_RDWR").Int() // fs_js.go init - oRDWR = float64(os.O_RDWR) - - // o CREAT = jsfsConstants Get("O_CREAT").Int() // fs_js.go init - oCREAT = float64(os.O_CREATE) - - // oTRUNC = jsfsConstants Get("O_TRUNC").Int() // fs_js.go init - oTRUNC = float64(os.O_TRUNC) - - // oAPPEND = jsfsConstants Get("O_APPEND").Int() // fs_js.go init - oAPPEND = float64(os.O_APPEND) - - // oEXCL = jsfsConstants Get("O_EXCL").Int() // fs_js.go init - oEXCL = float64(os.O_EXCL) -) - -// jsfs = js.Global().Get("fs") // fs_js.go init -// -// js.fsCall conventions: -// * funcWrapper callback is the last parameter -// - arg0 is error and up to one result in arg1 -func newJsFs(proc *processState) *jsVal { - return newJsVal(goos.RefJsfs, custom.NameFs). - addProperties(map[string]interface{}{ - "constants": jsfsConstants, // = jsfs.Get("constants") // init - }). - addFunction(custom.NameFsOpen, &jsfsOpen{proc: proc}). - addFunction(custom.NameFsStat, &jsfsStat{proc: proc}). - addFunction(custom.NameFsFstat, jsfsFstat{}). - addFunction(custom.NameFsLstat, &jsfsLstat{proc: proc}). - addFunction(custom.NameFsClose, jsfsClose{}). - addFunction(custom.NameFsRead, jsfsRead{}). - addFunction(custom.NameFsWrite, jsfsWrite{}). - addFunction(custom.NameFsReaddir, &jsfsReaddir{proc: proc}). - addFunction(custom.NameFsMkdir, &jsfsMkdir{proc: proc}). - addFunction(custom.NameFsRmdir, &jsfsRmdir{proc: proc}). - addFunction(custom.NameFsRename, &jsfsRename{proc: proc}). - addFunction(custom.NameFsUnlink, &jsfsUnlink{proc: proc}). - addFunction(custom.NameFsUtimes, &jsfsUtimes{proc: proc}). - addFunction(custom.NameFsChmod, &jsfsChmod{proc: proc}). - addFunction(custom.NameFsFchmod, jsfsFchmod{}). - addFunction(custom.NameFsChown, &jsfsChown{proc: proc}). - addFunction(custom.NameFsFchown, jsfsFchown{}). - addFunction(custom.NameFsLchown, &jsfsLchown{proc: proc}). - addFunction(custom.NameFsTruncate, &jsfsTruncate{proc: proc}). - addFunction(custom.NameFsFtruncate, jsfsFtruncate{}). - addFunction(custom.NameFsReadlink, &jsfsReadlink{proc: proc}). - addFunction(custom.NameFsLink, &jsfsLink{proc: proc}). - addFunction(custom.NameFsSymlink, &jsfsSymlink{proc: proc}). - addFunction(custom.NameFsFsync, jsfsFsync{}) -} - -// jsfsOpen implements implements jsFn for syscall.Open -// -// jsFD /* Int */, err := fsCall("open", path, flags, perm) -type jsfsOpen struct { - proc *processState -} - -func (o *jsfsOpen) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(o.proc.cwd, args[0].(string)) - flags := toUint64(args[1]) // flags are derived from constants like oWRONLY - perm := custom.FromJsMode(goos.ValueToUint32(args[2]), o.proc.umask) - callback := args[3].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd, errno := fsc.OpenFile(fsc.RootFS(), path, int(flags), perm) - - return callback.invoke(ctx, mod, goos.RefJsfs, maybeError(errno), fd) // note: error first -} - -// jsfsStat implements jsFn for syscall.Stat -// -// jsSt, err := fsCall("stat", path) -type jsfsStat struct { - proc *processState -} - -func (s *jsfsStat) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(s.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - stat, err := syscallStat(mod, path) - return callback.invoke(ctx, mod, goos.RefJsfs, err, stat) // note: error first -} - -// syscallStat is like syscall.Stat -func syscallStat(mod api.Module, path string) (*jsSt, error) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - if st, errno := fsc.RootFS().Stat(path); errno != 0 { - return nil, errno - } else { - return newJsSt(st), nil - } -} - -// jsfsLstat implements jsFn for syscall.Lstat -// -// jsSt, err := fsCall("lstat", path) -type jsfsLstat struct { - proc *processState -} - -func (l *jsfsLstat) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(l.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - lstat, err := syscallLstat(mod, path) - - return callback.invoke(ctx, mod, goos.RefJsfs, err, lstat) // note: error first -} - -// syscallLstat is like syscall.Lstat -func syscallLstat(mod api.Module, path string) (*jsSt, error) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - if st, errno := fsc.RootFS().Lstat(path); errno != 0 { - return nil, errno - } else { - return newJsSt(st), nil - } -} - -// jsfsFstat implements jsFn for syscall.Open -// -// stat, err := fsCall("fstat", fd); err == nil && stat.Call("isDirectory").Bool() -type jsfsFstat struct{} - -func (jsfsFstat) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := goos.ValueToInt32(args[0]) - callback := args[1].(funcWrapper) - - fstat, err := syscallFstat(fsc, fd) - return callback.invoke(ctx, mod, goos.RefJsfs, err, fstat) // note: error first -} - -// syscallFstat is like syscall.Fstat -func syscallFstat(fsc *internalsys.FSContext, fd int32) (*jsSt, error) { - f, ok := fsc.LookupFile(fd) - if !ok { - return nil, syscall.EBADF - } - - if st, errno := f.File.Stat(); errno != 0 { - return nil, errno - } else { - return newJsSt(st), nil - } -} - -func newJsSt(st fsapi.Stat_t) *jsSt { - ret := &jsSt{} - ret.isDir = st.Mode.IsDir() - ret.dev = st.Dev - ret.ino = st.Ino - ret.uid = st.Uid - ret.gid = st.Gid - ret.mode = custom.ToJsMode(st.Mode) - ret.nlink = uint32(st.Nlink) - ret.size = st.Size - ret.atimeMs = st.Atim / 1e6 - ret.mtimeMs = st.Mtim / 1e6 - ret.ctimeMs = st.Ctim / 1e6 - return ret -} - -// jsfsClose implements jsFn for syscall.Close -type jsfsClose struct{} - -func (jsfsClose) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - fd := goos.ValueToInt32(args[0]) - callback := args[1].(funcWrapper) - - errno := fsc.CloseFile(fd) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsRead implements jsFn for syscall.Read and syscall.Pread, called by -// src/internal/poll/fd_unix.go poll.Read. -// -// n, err := fsCall("read", fd, buf, 0, len(b), nil) -type jsfsRead struct{} - -func (jsfsRead) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - buf, ok := args[1].(*goos.ByteArray) - if !ok { - return nil, fmt.Errorf("arg[1] is %v not a []byte", args[1]) - } - offset := goos.ValueToUint32(args[2]) - byteCount := goos.ValueToUint32(args[3]) - fOffset := args[4] // nil unless Pread - callback := args[5].(funcWrapper) - - var err error - n, errno := syscallRead(mod, fd, fOffset, buf.Unwrap()[offset:offset+byteCount]) - if errno != 0 { - err = errno - } - // It is safe to cast to uint32 because n <= uint32(byteCount). - return callback.invoke(ctx, mod, goos.RefJsfs, err, uint32(n)) // note: error first -} - -// syscallRead is like syscall.Read -func syscallRead(mod api.Module, fd int32, offset interface{}, buf []byte) (n int, errno syscall.Errno) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - if f, ok := fsc.LookupFile(fd); !ok { - return 0, syscall.EBADF - } else if offset != nil { - return f.File.Pread(buf, toInt64(offset)) - } else { - return f.File.Read(buf) - } -} - -// jsfsWrite implements jsFn for syscall.Write and syscall.Pwrite. -// -// Notably, offset is non-nil in Pwrite. -// -// n, err := fsCall("write", fd, buf, 0, len(b), nil) -type jsfsWrite struct{} - -func (jsfsWrite) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - buf, ok := args[1].(*goos.ByteArray) - if !ok { - return nil, fmt.Errorf("arg[1] is %v not a []byte", args[1]) - } - offset := goos.ValueToUint32(args[2]) - byteCount := goos.ValueToUint32(args[3]) - fOffset := args[4] // nil unless Pwrite - callback := args[5].(funcWrapper) - - if byteCount > 0 { // empty is possible on EOF - n, errno := syscallWrite(mod, fd, fOffset, buf.Unwrap()[offset:offset+byteCount]) - var err error - if errno != 0 { - err = errno - } - // It is safe to cast to uint32 because n <= uint32(byteCount). - return callback.invoke(ctx, mod, goos.RefJsfs, err, uint32(n)) // note: error first - } - return callback.invoke(ctx, mod, goos.RefJsfs, nil, goos.RefValueZero) -} - -// syscallWrite is like syscall.Write -func syscallWrite(mod api.Module, fd int32, offset interface{}, buf []byte) (n int, errno syscall.Errno) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - if f, ok := fsc.LookupFile(fd); !ok { - errno = syscall.EBADF - } else if offset != nil { - n, errno = f.File.Pwrite(buf, toInt64(offset)) - } else { - n, errno = f.File.Write(buf) - } - if errno == syscall.ENOSYS { - errno = syscall.EBADF // e.g. unimplemented for write - } - return -} - -// jsfsReaddir implements jsFn for syscall.Open -// -// dir, err := fsCall("readdir", path) -// dir.Length(), dir.Index(i).String() -type jsfsReaddir struct { - proc *processState -} - -func (r *jsfsReaddir) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(r.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - stat, err := syscallReaddir(ctx, mod, path) - return callback.invoke(ctx, mod, goos.RefJsfs, err, stat) // note: error first -} - -func syscallReaddir(_ context.Context, mod api.Module, name string) (*objectArray, error) { - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - - // don't allocate a file descriptor - f, errno := fsc.RootFS().OpenFile(name, os.O_RDONLY, 0) - if errno != 0 { - return nil, errno - } - defer f.Close() //nolint - - if dirents, errno := f.Readdir(-1); errno != 0 { - return nil, errno - } else { - entries := make([]interface{}, 0, len(dirents)) - for _, e := range dirents { - entries = append(entries, e.Name) - } - return &objectArray{entries}, nil - } -} - -// jsfsMkdir implements implements jsFn for fs.Mkdir -// -// jsFD /* Int */, err := fsCall("mkdir", path, perm) -type jsfsMkdir struct { - proc *processState -} - -func (m *jsfsMkdir) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(m.proc.cwd, args[0].(string)) - perm := custom.FromJsMode(goos.ValueToUint32(args[1]), m.proc.umask) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - root := fsc.RootFS() - - var fd int32 - var errno syscall.Errno - // We need at least read access to open the file descriptor - if perm == 0 { - perm = 0o0500 - } - if errno = root.Mkdir(path, perm); errno == 0 { - fd, errno = fsc.OpenFile(root, path, os.O_RDONLY, 0) - } - - return callback.invoke(ctx, mod, goos.RefJsfs, maybeError(errno), fd) // note: error first -} - -// jsfsRmdir implements jsFn for the following -// -// _, err := fsCall("rmdir", path) // syscall.Rmdir -type jsfsRmdir struct { - proc *processState -} - -func (r *jsfsRmdir) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(r.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Rmdir(path) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsRename implements jsFn for the following -// -// _, err := fsCall("rename", from, to) // syscall.Rename -type jsfsRename struct { - proc *processState -} - -func (r *jsfsRename) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - cwd := r.proc.cwd - from := util.ResolvePath(cwd, args[0].(string)) - to := util.ResolvePath(cwd, args[1].(string)) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Rename(from, to) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsUnlink implements jsFn for the following -// -// _, err := fsCall("unlink", path) // syscall.Unlink -type jsfsUnlink struct { - proc *processState -} - -func (u *jsfsUnlink) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(u.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Unlink(path) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsUtimes implements jsFn for the following -// -// _, err := fsCall("utimes", path, atime, mtime) // syscall.Utimens -type jsfsUtimes struct { - proc *processState -} - -func (u *jsfsUtimes) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(u.proc.cwd, args[0].(string)) - atimeSec := toInt64(args[1]) - mtimeSec := toInt64(args[2]) - callback := args[3].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - times := [2]syscall.Timespec{ - syscall.NsecToTimespec(atimeSec * 1e9), syscall.NsecToTimespec(mtimeSec * 1e9), - } - errno := fsc.RootFS().Utimens(path, ×, true) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsChmod implements jsFn for the following -// -// _, err := fsCall("chmod", path, mode) // syscall.Chmod -type jsfsChmod struct { - proc *processState -} - -func (c *jsfsChmod) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(c.proc.cwd, args[0].(string)) - mode := custom.FromJsMode(goos.ValueToUint32(args[1]), 0) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Chmod(path, mode) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsFchmod implements jsFn for the following -// -// _, err := fsCall("fchmod", fd, mode) // syscall.Fchmod -type jsfsFchmod struct{} - -func (jsfsFchmod) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - mode := custom.FromJsMode(goos.ValueToUint32(args[1]), 0) - callback := args[2].(funcWrapper) - - // Check to see if the file descriptor is available - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - var errno syscall.Errno - if f, ok := fsc.LookupFile(fd); !ok { - errno = syscall.EBADF - } else { - errno = f.File.Chmod(mode) - } - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsChown implements jsFn for the following -// -// _, err := fsCall("chown", path, uint32(uid), uint32(gid)) // syscall.Chown -type jsfsChown struct { - proc *processState -} - -func (c *jsfsChown) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(c.proc.cwd, args[0].(string)) - uid := goos.ValueToInt32(args[1]) - gid := goos.ValueToInt32(args[2]) - callback := args[3].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Chown(path, int(uid), int(gid)) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsFchown implements jsFn for the following -// -// _, err := fsCall("fchown", fd, uint32(uid), uint32(gid)) // syscall.Fchown -type jsfsFchown struct{} - -func (jsfsFchown) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - uid := goos.ValueToUint32(args[1]) - gid := goos.ValueToUint32(args[2]) - callback := args[3].(funcWrapper) - - // Check to see if the file descriptor is available - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - var errno syscall.Errno - if f, ok := fsc.LookupFile(fd); !ok { - errno = syscall.EBADF - } else { - errno = f.File.Chown(int(uid), int(gid)) - } - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsLchown implements jsFn for the following -// -// _, err := fsCall("lchown", path, uint32(uid), uint32(gid)) // syscall.Lchown -type jsfsLchown struct { - proc *processState -} - -func (l *jsfsLchown) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(l.proc.cwd, args[0].(string)) - uid := goos.ValueToUint32(args[1]) - gid := goos.ValueToUint32(args[2]) - callback := args[3].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Lchown(path, int(uid), int(gid)) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsTruncate implements jsFn for the following -// -// _, err := fsCall("truncate", path, length) // syscall.Truncate -type jsfsTruncate struct { - proc *processState -} - -func (t *jsfsTruncate) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(t.proc.cwd, args[0].(string)) - length := toInt64(args[1]) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Truncate(path, length) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsFtruncate implements jsFn for the following -// -// _, err := fsCall("ftruncate", fd, length) // syscall.Ftruncate -type jsfsFtruncate struct{} - -func (jsfsFtruncate) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - length := toInt64(args[1]) - callback := args[2].(funcWrapper) - - // Check to see if the file descriptor is available - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - var errno syscall.Errno - if f, ok := fsc.LookupFile(fd); !ok { - errno = syscall.EBADF - } else { - errno = f.File.Truncate(length) - } - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsReadlink implements jsFn for syscall.Readlink -// -// dst, err := fsCall("readlink", path) // syscall.Readlink -type jsfsReadlink struct { - proc *processState -} - -func (r *jsfsReadlink) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - path := util.ResolvePath(r.proc.cwd, args[0].(string)) - callback := args[1].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - dst, errno := fsc.RootFS().Readlink(path) - - return callback.invoke(ctx, mod, goos.RefJsfs, maybeError(errno), dst) // note: error first -} - -// jsfsLink implements jsFn for the following -// -// _, err := fsCall("link", path, link) // syscall.Link -type jsfsLink struct { - proc *processState -} - -func (l *jsfsLink) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - cwd := l.proc.cwd - path := util.ResolvePath(cwd, args[0].(string)) - link := util.ResolvePath(cwd, args[1].(string)) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Link(path, link) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsSymlink implements jsFn for the following -// -// _, err := fsCall("symlink", path, link) // syscall.Symlink -type jsfsSymlink struct { - proc *processState -} - -func (s *jsfsSymlink) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - dst := args[0].(string) // The dst of a symlink must not be resolved, as it should be resolved during readLink. - link := util.ResolvePath(s.proc.cwd, args[1].(string)) - callback := args[2].(funcWrapper) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - errno := fsc.RootFS().Symlink(dst, link) - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsfsFsync implements jsFn for the following -// -// _, err := fsCall("fsync", fd) // syscall.Fsync -type jsfsFsync struct{} - -func (jsfsFsync) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - fd := goos.ValueToInt32(args[0]) - callback := args[1].(funcWrapper) - - // Check to see if the file descriptor is available - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - var errno syscall.Errno - if f, ok := fsc.LookupFile(fd); !ok { - errno = syscall.EBADF - } else { - errno = f.File.Sync() - } - - return jsfsInvoke(ctx, mod, callback, errno) -} - -// jsSt is pre-parsed from fs_js.go setStat to avoid thrashing -type jsSt struct { - isDir bool - dev uint64 - ino uint64 - mode uint32 - nlink uint32 - uid uint32 - gid uint32 - rdev int64 - size int64 - blksize int32 - blocks int32 - atimeMs int64 - mtimeMs int64 - ctimeMs int64 -} - -// String implements fmt.Stringer -func (s *jsSt) String() string { - return fmt.Sprintf("{isDir=%v,mode=%s,size=%d,mtimeMs=%d}", s.isDir, custom.FromJsMode(s.mode, 0), s.size, s.mtimeMs) -} - -// Get implements the same method as documented on goos.GetFunction -func (s *jsSt) Get(propertyKey string) interface{} { - switch propertyKey { - case "dev": - return s.dev - case "ino": - return s.ino - case "mode": - return s.mode - case "nlink": - return s.nlink - case "uid": - return s.uid - case "gid": - return s.gid - case "rdev": - return s.rdev - case "size": - return s.size - case "blksize": - return s.blksize - case "blocks": - return s.blocks - case "atimeMs": - return s.atimeMs - case "mtimeMs": - return s.mtimeMs - case "ctimeMs": - return s.ctimeMs - } - panic(fmt.Sprintf("TODO: stat.%s", propertyKey)) -} - -// call implements jsCall.call -func (s *jsSt) call(_ context.Context, _ api.Module, _ goos.Ref, method string, _ ...interface{}) (interface{}, error) { - if method == "isDirectory" { - return s.isDir, nil - } - panic(fmt.Sprintf("TODO: stat.%s", method)) -} - -func jsfsInvoke(ctx context.Context, mod api.Module, callback funcWrapper, err syscall.Errno) (interface{}, error) { - return callback.invoke(ctx, mod, goos.RefJsfs, maybeError(err), err == 0) // note: error first -} - -func maybeError(errno syscall.Errno) error { - if errno != 0 { - return errno - } - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/goarch/wasm.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/goarch/wasm.go deleted file mode 100644 index 9f2f56c37c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/goarch/wasm.go +++ /dev/null @@ -1,180 +0,0 @@ -// Package goarch isolates code from runtime.GOARCH=wasm in a way that avoids -// cyclic dependencies when re-used from other packages. -package goarch - -import ( - "context" - "encoding/binary" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/util" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// StubFunction stubs functions not used in Go's main source tree. -// This traps (unreachable opcode) to ensure the function is never called. -func StubFunction(name string) *wasm.HostFunc { - return &wasm.HostFunc{ - ExportName: name, - Name: name, - ParamTypes: []wasm.ValueType{wasm.ValueTypeI32}, - ParamNames: []string{"sp"}, - Code: wasm.Code{GoFunc: api.GoModuleFunc(func(ctx context.Context, _ api.Module, stack []uint64) {})}, - } -} - -var le = binary.LittleEndian - -type Stack interface { - // Name is the function name being invoked. - Name() string - - Param(i int) uint64 - - // ParamBytes reads a byte slice, given its memory offset and length (stack - // positions i, i+1) - ParamBytes(mem api.Memory, i int) []byte - - // ParamString reads a string, given its memory offset and length (stack - // positions i, i+1) - ParamString(mem api.Memory, i int) string - - ParamInt32(i int) int32 - - ParamUint32(i int) uint32 - - // Refresh the stack from the current stack pointer (SP). - // - // Note: This is needed prior to storing a value when in an operation that - // can trigger a Go event handler. - Refresh(api.Module) - - SetResult(i int, v uint64) - - SetResultBool(i int, v bool) - - SetResultI32(i int, v int32) - - SetResultI64(i int, v int64) - - SetResultUint32(i int, v uint32) -} - -func NewStack(name string, mem api.Memory, sp uint32) Stack { - names := custom.NameSection[name] - s := &stack{name: name, paramCount: len(names.ParamNames), resultCount: len(names.ResultNames)} - s.refresh(mem, sp) - return s -} - -type stack struct { - name string - paramCount, resultCount int - buf []byte -} - -// Name implements Stack.Name -func (s *stack) Name() string { - return s.name -} - -// Param implements Stack.Param -func (s *stack) Param(i int) (res uint64) { - pos := i << 3 - res = le.Uint64(s.buf[pos:]) - return -} - -// ParamBytes implements Stack.ParamBytes -func (s *stack) ParamBytes(mem api.Memory, i int) (res []byte) { - offset := s.ParamUint32(i) - byteCount := s.ParamUint32(i + 1) - return util.MustRead(mem, s.name, i, offset, byteCount) -} - -// ParamString implements Stack.ParamString -func (s *stack) ParamString(mem api.Memory, i int) string { - return string(s.ParamBytes(mem, i)) // safe copy of guest memory -} - -// ParamInt32 implements Stack.ParamInt32 -func (s *stack) ParamInt32(i int) int32 { - return int32(s.Param(i)) -} - -// ParamUint32 implements Stack.ParamUint32 -func (s *stack) ParamUint32(i int) uint32 { - return uint32(s.Param(i)) -} - -// Refresh implements Stack.Refresh -func (s *stack) Refresh(mod api.Module) { - s.refresh(mod.Memory(), GetSP(mod)) -} - -func (s *stack) refresh(mem api.Memory, sp uint32) { - count := uint32(s.paramCount + s.resultCount) - buf, ok := mem.Read(sp+8, count<<3) - if !ok { - panic("out of memory reading stack") - } - s.buf = buf -} - -// SetResult implements Stack.SetResult -func (s *stack) SetResult(i int, v uint64) { - pos := (s.paramCount + i) << 3 - le.PutUint64(s.buf[pos:], v) -} - -// SetResultBool implements Stack.SetResultBool -func (s *stack) SetResultBool(i int, v bool) { - if v { - s.SetResultUint32(i, 1) - } else { - s.SetResultUint32(i, 0) - } -} - -// SetResultI32 implements Stack.SetResultI32 -func (s *stack) SetResultI32(i int, v int32) { - s.SetResult(i, uint64(v)) -} - -// SetResultI64 implements Stack.SetResultI64 -func (s *stack) SetResultI64(i int, v int64) { - s.SetResult(i, uint64(v)) -} - -// SetResultUint32 implements Stack.SetResultUint32 -func (s *stack) SetResultUint32(i int, v uint32) { - s.SetResult(i, uint64(v)) -} - -// GetSP gets the stack pointer, which is needed prior to storing a value when -// in an operation that can trigger a Go event handler. -// -// See https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L210-L213 -func GetSP(mod api.Module) uint32 { - // Cheat by reading global[0] directly instead of through a function proxy. - // https://github.com/golang/go/blob/go1.20/src/runtime/rt0_js_wasm.s#L87-L90 - return uint32(mod.(*wasm.ModuleInstance).GlobalVal(0)) -} - -func NewFunc(name string, goFunc Func) *wasm.HostFunc { - return util.NewFunc(name, (&stackFunc{name: name, f: goFunc}).Call) -} - -type Func func(context.Context, api.Module, Stack) - -type stackFunc struct { - name string - f Func -} - -// Call implements the same method as defined on api.GoModuleFunction. -func (f *stackFunc) Call(ctx context.Context, mod api.Module, wasmStack []uint64) { - s := NewStack(f.name, mod.Memory(), uint32(wasmStack[0])) - f.f(ctx, mod, s) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/goos/goos.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/goos/goos.go deleted file mode 100644 index e46d93be6a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/goos/goos.go +++ /dev/null @@ -1,311 +0,0 @@ -// Package goos isolates code from runtime.GOOS=js in a way that avoids cyclic -// dependencies when re-used from other packages. -package goos - -import ( - "context" - "encoding/binary" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/goarch" - "github.com/tetratelabs/wazero/internal/gojs/util" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// Ref is used to identify a JavaScript value, since the value itself cannot -// be passed to WebAssembly. -// -// The JavaScript value "undefined" is represented by the value 0. -// -// A JavaScript number (64-bit float, except 0 and NaN) is represented by its -// IEEE 754 binary representation. -// -// All other values are represented as an IEEE 754 binary representation of NaN -// with bits 0-31 used as an ID and bits 32-34 used to differentiate between -// string, symbol, function and object. -type Ref uint64 - -const ( - // predefined - - IdValueNaN uint32 = iota - IdValueZero - IdValueNull - IdValueTrue - IdValueFalse - IdValueGlobal - IdJsGo - - // The below are derived from analyzing `*_js.go` source. - - IdObjectConstructor - IdArrayConstructor - IdJsProcess - IdJsfs - IdJsfsConstants - IdUint8ArrayConstructor - IdJsCrypto - IdJsDateConstructor - IdJsDate - IdHttpFetch - IdHttpHeaders - NextID -) - -const ( - RefValueUndefined = Ref(0) - RefValueNaN = (NanHead|Ref(TypeFlagNone))<<32 | Ref(IdValueNaN) - RefValueZero = (NanHead|Ref(TypeFlagNone))<<32 | Ref(IdValueZero) - RefValueNull = (NanHead|Ref(TypeFlagNone))<<32 | Ref(IdValueNull) - RefValueTrue = (NanHead|Ref(TypeFlagNone))<<32 | Ref(IdValueTrue) - RefValueFalse = (NanHead|Ref(TypeFlagNone))<<32 | Ref(IdValueFalse) - RefValueGlobal = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdValueGlobal) - RefJsGo = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdJsGo) - - RefObjectConstructor = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdObjectConstructor) - RefArrayConstructor = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdArrayConstructor) - RefJsProcess = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdJsProcess) - RefJsfs = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdJsfs) - RefJsfsConstants = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdJsfsConstants) - RefUint8ArrayConstructor = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdUint8ArrayConstructor) - RefJsCrypto = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdJsCrypto) - RefJsDateConstructor = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdJsDateConstructor) - RefJsDate = (NanHead|Ref(TypeFlagObject))<<32 | Ref(IdJsDate) - RefHttpFetch = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdHttpFetch) - RefHttpHeadersConstructor = (NanHead|Ref(TypeFlagFunction))<<32 | Ref(IdHttpHeaders) -) - -type TypeFlag byte - -// the type flags need to be in sync with gojs.js -const ( - TypeFlagNone TypeFlag = iota - TypeFlagObject - TypeFlagString - TypeFlagSymbol //nolint - TypeFlagFunction -) - -func ValueRef(id uint32, typeFlag TypeFlag) Ref { - return (NanHead|Ref(typeFlag))<<32 | Ref(id) -} - -var le = binary.LittleEndian - -// NanHead are the upper 32 bits of a Ref which are set if the value is not encoded as an IEEE 754 number (see above). -const NanHead = 0x7FF80000 - -func (ref Ref) ParseFloat() (v float64, ok bool) { - if (ref>>32)&NanHead != NanHead { - v = api.DecodeF64(uint64(ref)) - ok = true - } - return -} - -// GetLastEventArgs returns the arguments to the last event created by -// custom.NameSyscallValueCall. -type GetLastEventArgs func(context.Context) []interface{} - -type ValLoader func(context.Context, Ref) interface{} - -type Stack interface { - goarch.Stack - - ParamRef(i int) Ref - - ParamRefs(mem api.Memory, i int) []Ref - - ParamVal(ctx context.Context, i int, loader ValLoader) interface{} - - // ParamVals is used by functions whose final parameter is an arg array. - ParamVals(ctx context.Context, mem api.Memory, i int, loader ValLoader) []interface{} - - SetResultRef(i int, v Ref) -} - -type stack struct { - s goarch.Stack -} - -// Name implements the same method as documented on goarch.Stack -func (s *stack) Name() string { - return s.s.Name() -} - -// Param implements the same method as documented on goarch.Stack -func (s *stack) Param(i int) uint64 { - return s.s.Param(i) -} - -// ParamBytes implements the same method as documented on goarch.Stack -func (s *stack) ParamBytes(mem api.Memory, i int) []byte { - return s.s.ParamBytes(mem, i) -} - -// ParamRef implements Stack.ParamRef -func (s *stack) ParamRef(i int) Ref { - return Ref(s.s.Param(i)) -} - -// ParamRefs implements Stack.ParamRefs -func (s *stack) ParamRefs(mem api.Memory, i int) []Ref { - offset := s.s.ParamUint32(i) - size := s.s.ParamUint32(i + 1) - byteCount := size << 3 // size * 8 - - result := make([]Ref, 0, size) - - buf := util.MustRead(mem, s.Name(), i, offset, byteCount) - for pos := uint32(0); pos < byteCount; pos += 8 { - ref := Ref(le.Uint64(buf[pos:])) - result = append(result, ref) - } - return result -} - -// ParamString implements the same method as documented on goarch.Stack -func (s *stack) ParamString(mem api.Memory, i int) string { - return s.s.ParamString(mem, i) -} - -// ParamInt32 implements the same method as documented on goarch.Stack -func (s *stack) ParamInt32(i int) int32 { - return s.s.ParamInt32(i) -} - -// ParamUint32 implements the same method as documented on goarch.Stack -func (s *stack) ParamUint32(i int) uint32 { - return s.s.ParamUint32(i) -} - -// ParamVal implements Stack.ParamVal -func (s *stack) ParamVal(ctx context.Context, i int, loader ValLoader) interface{} { - ref := s.ParamRef(i) - return loader(ctx, ref) -} - -// ParamVals implements Stack.ParamVals -func (s *stack) ParamVals(ctx context.Context, mem api.Memory, i int, loader ValLoader) []interface{} { - offset := s.s.ParamUint32(i) - size := s.s.ParamUint32(i + 1) - byteCount := size << 3 // size * 8 - - result := make([]interface{}, 0, size) - - buf := util.MustRead(mem, s.Name(), i, offset, byteCount) - for pos := uint32(0); pos < byteCount; pos += 8 { - ref := Ref(le.Uint64(buf[pos:])) - result = append(result, loader(ctx, ref)) - } - return result -} - -// Refresh implements the same method as documented on goarch.Stack -func (s *stack) Refresh(mod api.Module) { - s.s.Refresh(mod) -} - -// SetResult implements the same method as documented on goarch.Stack -func (s *stack) SetResult(i int, v uint64) { - s.s.SetResult(i, v) -} - -// SetResultBool implements the same method as documented on goarch.Stack -func (s *stack) SetResultBool(i int, v bool) { - s.s.SetResultBool(i, v) -} - -// SetResultI32 implements the same method as documented on goarch.Stack -func (s *stack) SetResultI32(i int, v int32) { - s.s.SetResultI32(i, v) -} - -// SetResultI64 implements the same method as documented on goarch.Stack -func (s *stack) SetResultI64(i int, v int64) { - s.s.SetResultI64(i, v) -} - -// SetResultRef implements Stack.SetResultRef -func (s *stack) SetResultRef(i int, v Ref) { - s.s.SetResult(i, uint64(v)) -} - -// SetResultUint32 implements the same method as documented on goarch.Stack -func (s *stack) SetResultUint32(i int, v uint32) { - s.s.SetResultUint32(i, v) -} - -func NewFunc(name string, goFunc Func) *wasm.HostFunc { - sf := &stackFunc{name: name, f: goFunc} - return util.NewFunc(name, sf.Call) -} - -type Func func(context.Context, api.Module, Stack) - -type stackFunc struct { - name string - f Func -} - -// Call implements the same method as defined on api.GoModuleFunction. -func (f *stackFunc) Call(ctx context.Context, mod api.Module, wasmStack []uint64) { - s := NewStack(f.name, mod.Memory(), uint32(wasmStack[0])) - f.f(ctx, mod, s) -} - -func NewStack(name string, mem api.Memory, sp uint32) *stack { - return &stack{goarch.NewStack(name, mem, sp)} -} - -var Undefined = struct{ name string }{name: "undefined"} - -func ValueToUint32(arg interface{}) uint32 { - if arg == RefValueZero || arg == Undefined { - return 0 - } else if u, ok := arg.(uint32); ok { - return u - } - return uint32(arg.(float64)) -} - -func ValueToInt32(arg interface{}) int32 { - if arg == RefValueZero || arg == Undefined { - return 0 - } else if u, ok := arg.(int); ok { - return int32(u) - } - return int32(uint32(arg.(float64))) -} - -// GetFunction allows getting a JavaScript property by name. -type GetFunction interface { - Get(propertyKey string) interface{} -} - -// ByteArray is a result of uint8ArrayConstructor which temporarily stores -// binary data outside linear memory. -// -// Note: This is a wrapper because a slice is not hashable. -type ByteArray struct { - slice []byte -} - -func WrapByteArray(buf []byte) *ByteArray { - return &ByteArray{buf} -} - -// Unwrap returns the underlying byte slice -func (a *ByteArray) Unwrap() []byte { - return a.slice -} - -// Get implements GetFunction -func (a *ByteArray) Get(propertyKey string) interface{} { - switch propertyKey { - case "byteLength": - return uint32(len(a.slice)) - } - panic(fmt.Sprintf("TODO: get byteArray.%s", propertyKey)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/http.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/http.go deleted file mode 100644 index 13130dfebd..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/http.go +++ /dev/null @@ -1,156 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - "io" - "net/http" - "net/textproto" - "sort" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/goos" -) - -// headersConstructor = Get("Headers").New() // http.Roundtrip && "fetch" -var headersConstructor = newJsVal(goos.RefHttpHeadersConstructor, "Headers") - -// httpFetch implements jsFn for http.RoundTripper -// -// Reference in roundtrip_js.go init -// -// jsFetchMissing = js.Global().Get("fetch").IsUndefined() -// -// In http.Transport RoundTrip, this returns a promise -// -// fetchPromise := js.Global().Call("fetch", req.URL.String(), opt) -type httpFetch struct{ rt http.RoundTripper } - -func (h *httpFetch) invoke(ctx context.Context, _ api.Module, args ...interface{}) (interface{}, error) { - rt := h.rt - if rt == nil { - panic("unexpected to reach here without roundtripper as property is nil checked") - } - url := args[0].(string) - properties := args[1].(*object).properties - req, err := http.NewRequestWithContext(ctx, properties["method"].(string), url, nil) - if err != nil { - return nil, err - } - // TODO: headers properties[headers] - v := &fetchPromise{rt: rt, req: req} - return v, nil -} - -type fetchPromise struct { - rt http.RoundTripper - req *http.Request -} - -// call implements jsCall.call -func (p *fetchPromise) call(ctx context.Context, mod api.Module, this goos.Ref, method string, args ...interface{}) (interface{}, error) { - if method == "then" { - if res, err := p.rt.RoundTrip(p.req); err != nil { - failure := args[1].(funcWrapper) - // HTTP is at the GOOS=js abstraction, so we can return any error. - return failure.invoke(ctx, mod, this, err) - } else { - success := args[0].(funcWrapper) - return success.invoke(ctx, mod, this, &fetchResult{res: res}) - } - } - panic(fmt.Sprintf("TODO: fetchPromise.%s", method)) -} - -type fetchResult struct { - res *http.Response -} - -// Get implements the same method as documented on goos.GetFunction -func (s *fetchResult) Get(propertyKey string) interface{} { - switch propertyKey { - case "headers": - names := make([]string, 0, len(s.res.Header)) - for k := range s.res.Header { - names = append(names, k) - } - // Sort names for consistent iteration - sort.Strings(names) - h := &headers{names: names, headers: s.res.Header} - return h - case "body": - // return undefined as arrayPromise is more complicated than an array. - return goos.Undefined - case "status": - return uint32(s.res.StatusCode) - } - panic(fmt.Sprintf("TODO: get fetchResult.%s", propertyKey)) -} - -// call implements jsCall.call -func (s *fetchResult) call(_ context.Context, _ api.Module, _ goos.Ref, method string, _ ...interface{}) (interface{}, error) { - switch method { - case "arrayBuffer": - v := &arrayPromise{reader: s.res.Body} - return v, nil - } - panic(fmt.Sprintf("TODO: call fetchResult.%s", method)) -} - -type headers struct { - headers http.Header - names []string - i int -} - -// Get implements the same method as documented on goos.GetFunction -func (h *headers) Get(propertyKey string) interface{} { - switch propertyKey { - case "done": - return h.i == len(h.names) - case "value": - name := h.names[h.i] - value := h.headers.Get(name) - h.i++ - return &objectArray{[]interface{}{name, value}} - } - panic(fmt.Sprintf("TODO: get headers.%s", propertyKey)) -} - -// call implements jsCall.call -func (h *headers) call(_ context.Context, _ api.Module, _ goos.Ref, method string, args ...interface{}) (interface{}, error) { - switch method { - case "entries": - // Sort names for consistent iteration - sort.Strings(h.names) - return h, nil - case "next": - return h, nil - case "append": - name := textproto.CanonicalMIMEHeaderKey(args[0].(string)) - value := args[1].(string) - h.names = append(h.names, name) - h.headers.Add(name, value) - return nil, nil - } - panic(fmt.Sprintf("TODO: call headers.%s", method)) -} - -type arrayPromise struct { - reader io.ReadCloser -} - -// call implements jsCall.call -func (p *arrayPromise) call(ctx context.Context, mod api.Module, this goos.Ref, method string, args ...interface{}) (interface{}, error) { - switch method { - case "then": - defer p.reader.Close() - if b, err := io.ReadAll(p.reader); err != nil { - // HTTP is at the GOOS=js abstraction, so we can return any error. - return args[1].(funcWrapper).invoke(ctx, mod, this, err) - } else { - return args[0].(funcWrapper).invoke(ctx, mod, this, goos.WrapByteArray(b)) - } - } - panic(fmt.Sprintf("TODO: call arrayPromise.%s", method)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/js.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/js.go deleted file mode 100644 index 2667fa6e40..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/js.go +++ /dev/null @@ -1,83 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/goos" -) - -// jsFn is a jsCall.call function, configured via jsVal.addFunction. -// -// Note: This is not a `func` because we need it to be a hashable type. -type jsFn interface { - invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) -} - -// jsCall allows calling a method/function by name. -type jsCall interface { - call(ctx context.Context, mod api.Module, this goos.Ref, method string, args ...interface{}) (interface{}, error) -} - -func newJsVal(ref goos.Ref, name string) *jsVal { - return &jsVal{ref: ref, name: name, properties: map[string]interface{}{}, functions: map[string]jsFn{}} -} - -// jsVal corresponds to a generic js.Value in go, when `GOOS=js`. -type jsVal struct { - // ref is the constant reference used for built-in values, such as - // objectConstructor. - ref goos.Ref - name string - properties map[string]interface{} - functions map[string]jsFn -} - -func (v *jsVal) addProperties(properties map[string]interface{}) *jsVal { - for k, val := range properties { - v.properties[k] = val - } - return v -} - -func (v *jsVal) addFunction(method string, fn jsFn) *jsVal { - v.functions[method] = fn - // If fn returns an error, js.Call does a type lookup to verify it is a - // function. - // See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L389 - v.properties[method] = fn - return v -} - -// Get implements the same method as documented on goos.GetFunction -func (v *jsVal) Get(propertyKey string) interface{} { - if v, ok := v.properties[propertyKey]; ok { - return v - } - panic(fmt.Sprintf("TODO: get %s.%s", v.name, propertyKey)) -} - -// call implements jsCall.call -func (v *jsVal) call(ctx context.Context, mod api.Module, this goos.Ref, method string, args ...interface{}) (interface{}, error) { - if v, ok := v.functions[method]; ok { - return v.invoke(ctx, mod, args...) - } - panic(fmt.Sprintf("TODO: call %s.%s", v.name, method)) -} - -// objectArray is a result of arrayConstructor typically used to pass -// indexed arguments. -// -// Note: This is a wrapper because a slice is not hashable. -type objectArray struct { - slice []interface{} -} - -// object is a result of objectConstructor typically used to pass named -// arguments. -// -// Note: This is a wrapper because a map is not hashable. -type object struct { - properties map[string]interface{} -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/process.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/process.go deleted file mode 100644 index adcf17da2e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/process.go +++ /dev/null @@ -1,103 +0,0 @@ -package gojs - -import ( - "context" - "path" - "syscall" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goos" - "github.com/tetratelabs/wazero/internal/gojs/util" -) - -// processState are the mutable fields of the current process. -type processState struct { - cwd string - umask uint32 -} - -func newJsProcess(uid, gid, euid int, groups []int, proc *processState) *jsVal { - uidRef := toFloatRef(float64(uid)) - gidRef := toFloatRef(float64(gid)) - euidRef := toFloatRef(float64(euid)) - groupSlice := make([]interface{}, 0, len(groups)) - for _, group := range groups { - groupSlice = append(groupSlice, toFloatRef(float64(group))) - } - - // jsProcess = js.Global().Get("process") // fs_js.go init - return newJsVal(goos.RefJsProcess, custom.NameProcess). - addProperties(map[string]interface{}{ - "pid": float64(1), // Get("pid").Int() in syscall_js.go for syscall.Getpid - "ppid": goos.RefValueZero, // Get("ppid").Int() in syscall_js.go for syscall.Getppid - }). - addFunction(custom.NameProcessCwd, &processCwd{proc: proc}). // syscall.Cwd in fs_js.go - addFunction(custom.NameProcessChdir, &processChdir{proc: proc}). // syscall.Chdir in fs_js.go - addFunction(custom.NameProcessGetuid, getId(uidRef)). // syscall.Getuid in syscall_js.go - addFunction(custom.NameProcessGetgid, getId(gidRef)). // syscall.Getgid in syscall_js.go - addFunction(custom.NameProcessGeteuid, getId(euidRef)). // syscall.Geteuid in syscall_js.go - addFunction(custom.NameProcessGetgroups, returnSlice(groupSlice)). // syscall.Getgroups in syscall_js.go - addFunction(custom.NameProcessUmask, &processUmask{proc: proc}) // syscall.Umask in syscall_js.go -} - -// processCwd implements jsFn for fs.Open syscall.Getcwd in fs_js.go -type processCwd struct { - proc *processState -} - -func (p *processCwd) invoke(_ context.Context, _ api.Module, _ ...interface{}) (interface{}, error) { - return p.proc.cwd, nil -} - -// processChdir implements jsFn for fs.Open syscall.Chdir in fs_js.go -type processChdir struct { - proc *processState -} - -func (p *processChdir) invoke(_ context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - oldWd := p.proc.cwd - newWd := util.ResolvePath(oldWd, args[0].(string)) - - newWd = path.Clean(newWd) - if newWd == oldWd { // handle . - return nil, nil - } - - if s, err := syscallStat(mod, newWd); err != nil { - return nil, err - } else if !s.isDir { - return nil, syscall.ENOTDIR - } else { - p.proc.cwd = newWd - return nil, nil - } -} - -// processUmask implements jsFn for fs.Open syscall.Umask in fs_js.go -type processUmask struct { - proc *processState -} - -func (p *processUmask) invoke(_ context.Context, _ api.Module, args ...interface{}) (interface{}, error) { - newUmask := goos.ValueToUint32(args[0]) - - oldUmask := p.proc.umask - p.proc.umask = newUmask - - return oldUmask, nil -} - -// getId implements jsFn for syscall.Getuid, syscall.Getgid and syscall.Geteuid in syscall_js.go -type getId goos.Ref - -func (i getId) invoke(_ context.Context, _ api.Module, _ ...interface{}) (interface{}, error) { - return goos.Ref(i), nil -} - -// returnSlice implements jsFn for syscall.Getgroups in syscall_js.go -type returnSlice []interface{} - -func (s returnSlice) invoke(context.Context, api.Module, ...interface{}) (interface{}, error) { - return &objectArray{slice: s}, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/run/gojs.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/run/gojs.go deleted file mode 100644 index 1f9745a161..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/run/gojs.go +++ /dev/null @@ -1,44 +0,0 @@ -// Package run exists to avoid dependency cycles when keeping most of gojs -// code internal. -package run - -import ( - "context" - - "github.com/tetratelabs/wazero" - "github.com/tetratelabs/wazero/internal/gojs" - "github.com/tetratelabs/wazero/internal/gojs/config" -) - -func RunAndReturnState( - ctx context.Context, - r wazero.Runtime, - compiled wazero.CompiledModule, - moduleConfig wazero.ModuleConfig, - config *config.Config, -) (*gojs.State, error) { - if err := config.Init(); err != nil { - return nil, err - } - - // Instantiate the module compiled by go, noting it has no init function. - mod, err := r.InstantiateModule(ctx, compiled, moduleConfig) - if err != nil { - return nil, err - } - defer mod.Close(ctx) - - // Extract the args and env from the module Config and write it to memory. - argc, argv, err := gojs.WriteArgsAndEnviron(mod) - if err != nil { - return nil, err - } - - // Create host-side state for JavaScript values and events. - s := gojs.NewState(config) - ctx = context.WithValue(ctx, gojs.StateKey{}, s) - - // Invoke the run function. - _, err = mod.ExportedFunction("run").Call(ctx, uint64(argc), uint64(argv)) - return s, err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/runtime.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/runtime.go deleted file mode 100644 index dc6c3a0b66..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/runtime.go +++ /dev/null @@ -1,165 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - "syscall" - "time" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goarch" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// Debug has unknown use, so stubbed. -// -// See https://github.com/golang/go/blob/go1.20/src/cmd/link/internal/wasm/asm.go#L131-L136 -var Debug = goarch.StubFunction(custom.NameDebug) - -// TODO: should this call runtime.Breakpoint()? - -// WasmExit implements runtime.wasmExit which supports runtime.exit. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.go#L24 -var WasmExit = goarch.NewFunc(custom.NameRuntimeWasmExit, wasmExit) - -func wasmExit(ctx context.Context, mod api.Module, stack goarch.Stack) { - code := stack.ParamUint32(0) - - getState(ctx).close() - _ = mod.CloseWithExitCode(ctx, code) -} - -// WasmWrite implements runtime.wasmWrite which supports runtime.write and -// runtime.writeErr. This implements `println`. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/os_js.go#L30 -var WasmWrite = goarch.NewFunc(custom.NameRuntimeWasmWrite, wasmWrite) - -func wasmWrite(_ context.Context, mod api.Module, stack goarch.Stack) { - fd := stack.ParamInt32(0) - p := stack.ParamBytes(mod.Memory(), 1 /*, 2 */) - - fsc := mod.(*wasm.ModuleInstance).Sys.FS() - if f, ok := fsc.LookupFile(fd); ok { - _, errno := f.File.Write(p) - switch errno { - case 0: - return // success - case syscall.ENOSYS: - return // e.g. unimplemented for write - case syscall.EBADF: - return // e.g. not opened for write - default: - panic(fmt.Errorf("error writing p: %w", errno)) - } - } else { - panic(fmt.Errorf("fd %d invalid", fd)) - } -} - -// ResetMemoryDataView signals wasm.OpcodeMemoryGrow happened, indicating any -// cached view of memory should be reset. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/mem_js.go#L82 -var ResetMemoryDataView = goarch.NewFunc(custom.NameRuntimeResetMemoryDataView, resetMemoryDataView) - -func resetMemoryDataView(context.Context, api.Module, goarch.Stack) { - // context state does not cache a memory view, and all byte slices used - // are safely copied. Also, user-defined functions are not supported. - // Hence, there's currently no known reason to reset anything. -} - -// Nanotime1 implements runtime.nanotime which supports time.Since. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.s#L117 -var Nanotime1 = goarch.NewFunc(custom.NameRuntimeNanotime1, nanotime1) - -func nanotime1(_ context.Context, mod api.Module, stack goarch.Stack) { - nsec := mod.(*wasm.ModuleInstance).Sys.Nanotime() - - stack.SetResultI64(0, nsec) -} - -// Walltime implements runtime.walltime which supports time.Now. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.s#L121 -var Walltime = goarch.NewFunc(custom.NameRuntimeWalltime, walltime) - -func walltime(_ context.Context, mod api.Module, stack goarch.Stack) { - sec, nsec := mod.(*wasm.ModuleInstance).Sys.Walltime() - - stack.SetResultI64(0, sec) - stack.SetResultI32(1, nsec) -} - -// ScheduleTimeoutEvent implements runtime.scheduleTimeoutEvent which supports -// runtime.notetsleepg used by runtime.signal_recv. -// -// Unlike other most functions prefixed by "runtime.", this both launches a -// goroutine and invokes code compiled into wasm "resume". -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.s#L125 -var ScheduleTimeoutEvent = goarch.NewFunc(custom.NameRuntimeScheduleTimeoutEvent, scheduleTimeoutEvent) - -// Note: Signal handling is not implemented in GOOS=js. -func scheduleTimeoutEvent(ctx context.Context, mod api.Module, stack goarch.Stack) { - ms := stack.Param(0) - - s := getState(ctx) - id := s._nextCallbackTimeoutID - stack.SetResultUint32(0, id) - s._nextCallbackTimeoutID++ - - cleared := make(chan bool) - timeout := time.Millisecond * time.Duration(ms) - s._scheduledTimeouts[id] = cleared - - // As wasm is currently not concurrent, a timeout on another goroutine may - // not make sense. However, this implements what wasm_exec.js does anyway. - go func() { - select { - case <-cleared: // do nothing - case <-time.After(timeout): - if _, err := mod.ExportedFunction("resume").Call(ctx); err != nil { - println(err) - } - } - }() -} - -// ClearTimeoutEvent implements runtime.clearTimeoutEvent which supports -// runtime.notetsleepg used by runtime.signal_recv. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.s#L129 -var ClearTimeoutEvent = goarch.NewFunc(custom.NameRuntimeClearTimeoutEvent, clearTimeoutEvent) - -// Note: Signal handling is not implemented in GOOS=js. -func clearTimeoutEvent(ctx context.Context, _ api.Module, stack goarch.Stack) { - id := stack.ParamUint32(0) - s := getState(ctx) - if cancel, ok := s._scheduledTimeouts[id]; ok { - delete(s._scheduledTimeouts, id) - cancel <- true - } -} - -// GetRandomData implements runtime.getRandomData, which initializes the seed -// for runtime.fastrand. -// -// See https://github.com/golang/go/blob/go1.20/src/runtime/sys_wasm.s#L133 -var GetRandomData = goarch.NewFunc(custom.NameRuntimeGetRandomData, getRandomData) - -func getRandomData(_ context.Context, mod api.Module, stack goarch.Stack) { - r := stack.ParamBytes(mod.Memory(), 0 /*, 1 */) - - randSource := mod.(*wasm.ModuleInstance).Sys.RandSource() - - bufLen := len(r) - if n, err := randSource.Read(r); err != nil { - panic(fmt.Errorf("RandSource.Read(r /* len=%d */) failed: %w", bufLen, err)) - } else if n != bufLen { - panic(fmt.Errorf("RandSource.Read(r /* len=%d */) read %d bytes", bufLen, n)) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/state.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/state.go deleted file mode 100644 index 57ba3ea11c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/state.go +++ /dev/null @@ -1,243 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - "math" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/config" - "github.com/tetratelabs/wazero/internal/gojs/goos" - "github.com/tetratelabs/wazero/internal/gojs/values" -) - -func NewState(config *config.Config) *State { - return &State{ - values: values.NewValues(), - valueGlobal: newJsGlobal(config), - _nextCallbackTimeoutID: 1, - _scheduledTimeouts: map[uint32]chan bool{}, - } -} - -// StateKey is a context.Context Value key. The value must be a state pointer. -type StateKey struct{} - -func getState(ctx context.Context) *State { - return ctx.Value(StateKey{}).(*State) -} - -// GetLastEventArgs implements goos.GetLastEventArgs -func GetLastEventArgs(ctx context.Context) []interface{} { - if ls := ctx.Value(StateKey{}).(*State)._lastEvent; ls != nil { - if args := ls.args; args != nil { - return args.slice - } - } - return nil -} - -type event struct { - // id is the funcWrapper.id - id uint32 - this goos.Ref - args *objectArray - result interface{} -} - -// Get implements the same method as documented on goos.GetFunction -func (e *event) Get(propertyKey string) interface{} { - switch propertyKey { - case "id": - return e.id - case "this": // ex fs - return e.this - case "args": - return e.args - } - panic(fmt.Sprintf("TODO: event.%s", propertyKey)) -} - -var NaN = math.NaN() - -// LoadValue reads up to 8 bytes at the memory offset `addr` to return the -// value written by storeValue. -// -// See https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L122-L133 -func LoadValue(ctx context.Context, ref goos.Ref) interface{} { //nolint - switch ref { - case 0: - return goos.Undefined - case goos.RefValueNaN: - return NaN - case goos.RefValueZero: - return float64(0) - case goos.RefValueNull: - return nil - case goos.RefValueTrue: - return true - case goos.RefValueFalse: - return false - case goos.RefValueGlobal: - return getState(ctx).valueGlobal - case goos.RefJsGo: - return getState(ctx) - case goos.RefObjectConstructor: - return objectConstructor - case goos.RefArrayConstructor: - return arrayConstructor - case goos.RefJsProcess: - return getState(ctx).valueGlobal.Get("process") - case goos.RefJsfs: - return getState(ctx).valueGlobal.Get("fs") - case goos.RefJsfsConstants: - return jsfsConstants - case goos.RefUint8ArrayConstructor: - return uint8ArrayConstructor - case goos.RefJsCrypto: - return jsCrypto - case goos.RefJsDateConstructor: - return jsDateConstructor - case goos.RefJsDate: - return jsDate - case goos.RefHttpHeadersConstructor: - return headersConstructor - default: - if f, ok := ref.ParseFloat(); ok { // numbers are passed through as a Ref - return f - } - return getState(ctx).values.Get(uint32(ref)) - } -} - -// storeValue stores a value prior to returning to wasm from a host function. -// This returns 8 bytes to represent either the value or a reference to it. -// Any side effects besides memory must be cleaned up on wasmExit. -// -// See https://github.com/golang/go/blob/de4748c47c67392a57f250714509f590f68ad395/misc/wasm/wasm_exec.js#L135-L183 -func storeValue(ctx context.Context, v interface{}) goos.Ref { //nolint - // allow-list because we control all implementations - if v == goos.Undefined { - return goos.RefValueUndefined - } else if v == nil { - return goos.RefValueNull - } else if r, ok := v.(goos.Ref); ok { - return r - } else if b, ok := v.(bool); ok { - if b { - return goos.RefValueTrue - } else { - return goos.RefValueFalse - } - } else if c, ok := v.(*jsVal); ok { - return c.ref // already stored - } else if _, ok := v.(*event); ok { - id := getState(ctx).values.Increment(v) - return goos.ValueRef(id, goos.TypeFlagFunction) - } else if _, ok := v.(funcWrapper); ok { - id := getState(ctx).values.Increment(v) - return goos.ValueRef(id, goos.TypeFlagFunction) - } else if _, ok := v.(jsFn); ok { - id := getState(ctx).values.Increment(v) - return goos.ValueRef(id, goos.TypeFlagFunction) - } else if _, ok := v.(string); ok { - id := getState(ctx).values.Increment(v) - return goos.ValueRef(id, goos.TypeFlagString) - } else if i32, ok := v.(int32); ok { - return toFloatRef(float64(i32)) - } else if u32, ok := v.(uint32); ok { - return toFloatRef(float64(u32)) - } else if i64, ok := v.(int64); ok { - return toFloatRef(float64(i64)) - } else if u64, ok := v.(uint64); ok { - return toFloatRef(float64(u64)) - } else if f64, ok := v.(float64); ok { - return toFloatRef(f64) - } - id := getState(ctx).values.Increment(v) - return goos.ValueRef(id, goos.TypeFlagObject) -} - -func toFloatRef(f float64) goos.Ref { - if f == 0 { - return goos.RefValueZero - } - // numbers are encoded as float and passed through as a Ref - return goos.Ref(api.EncodeF64(f)) -} - -// State holds state used by the "go" imports used by gojs. -// Note: This is module-scoped. -type State struct { - values *values.Values - _pendingEvent *event - // _lastEvent was the last _pendingEvent value - _lastEvent *event - - valueGlobal *jsVal - - _nextCallbackTimeoutID uint32 - _scheduledTimeouts map[uint32]chan bool -} - -// Get implements the same method as documented on goos.GetFunction -func (s *State) Get(propertyKey string) interface{} { - switch propertyKey { - case "_pendingEvent": - return s._pendingEvent - } - panic(fmt.Sprintf("TODO: state.%s", propertyKey)) -} - -// call implements jsCall.call -func (s *State) call(_ context.Context, _ api.Module, _ goos.Ref, method string, args ...interface{}) (interface{}, error) { - switch method { - case "_makeFuncWrapper": - return funcWrapper(args[0].(float64)), nil - } - panic(fmt.Sprintf("TODO: state.%s", method)) -} - -// close releases any state including values and underlying slices for garbage -// collection. -func (s *State) close() { - // _scheduledTimeouts may have in-flight goroutines, so cancel them. - for k, cancel := range s._scheduledTimeouts { - delete(s._scheduledTimeouts, k) - cancel <- true - } - // Reset all state recursively to their initial values. This allows our - // unit tests to check we closed everything. - s._scheduledTimeouts = map[uint32]chan bool{} - s.values.Reset() - s._pendingEvent = nil - s._lastEvent = nil - s._nextCallbackTimeoutID = 1 -} - -func toInt64(arg interface{}) int64 { - if arg == goos.RefValueZero || arg == goos.Undefined { - return 0 - } else if u, ok := arg.(int64); ok { - return u - } - return int64(arg.(float64)) -} - -func toUint64(arg interface{}) uint64 { - if arg == goos.RefValueZero || arg == goos.Undefined { - return 0 - } else if u, ok := arg.(uint64); ok { - return u - } - return uint64(arg.(float64)) -} - -// valueString returns the string form of JavaScript string, boolean and number types. -func valueString(v interface{}) string { //nolint - if s, ok := v.(string); ok { - return s - } else { - return fmt.Sprintf("%v", v) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/syscall.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/syscall.go deleted file mode 100644 index 8a8dca15f1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/syscall.go +++ /dev/null @@ -1,381 +0,0 @@ -package gojs - -import ( - "context" - "fmt" - "net/http" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goarch" - "github.com/tetratelabs/wazero/internal/gojs/goos" - "github.com/tetratelabs/wazero/sys" -) - -// FinalizeRef implements js.finalizeRef, which is used as a -// runtime.SetFinalizer on the given reference. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L61 -var FinalizeRef = goos.NewFunc(custom.NameSyscallFinalizeRef, finalizeRef) - -func finalizeRef(ctx context.Context, _ api.Module, stack goos.Stack) { - r := stack.ParamRef(0) - - id := uint32(r) // 32-bits of the ref are the ID - - getState(ctx).values.Decrement(id) -} - -// StringVal implements js.stringVal, which is used to load the string for -// `js.ValueOf(x)`. For example, this is used when setting HTTP headers. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L212 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L305-L308 -var StringVal = goos.NewFunc(custom.NameSyscallStringVal, stringVal) - -func stringVal(ctx context.Context, mod api.Module, stack goos.Stack) { - x := stack.ParamString(mod.Memory(), 0) - - r := storeValue(ctx, x) - - stack.SetResultRef(0, r) -} - -// ValueGet implements js.valueGet, which is used to load a js.Value property -// by name, e.g. `v.Get("address")`. Notably, this is used by js.handleEvent to -// get the pending event. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L295 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L311-L316 -var ValueGet = goos.NewFunc(custom.NameSyscallValueGet, valueGet) - -func valueGet(ctx context.Context, mod api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - p := stack.ParamString(mod.Memory(), 1 /*, 2 */) - - var result interface{} - if g, ok := v.(goos.GetFunction); ok { - result = g.Get(p) - } else if e, ok := v.(error); ok { - switch p { - case "message": // js (GOOS=js) error, can be anything. - result = e.Error() - case "code": // syscall (GOARCH=wasm) error, must match key in mapJSError in fs_js.go - result = ToErrno(e).Error() - default: - panic(fmt.Errorf("TODO: valueGet(v=%v, p=%s)", v, p)) - } - } else { - panic(fmt.Errorf("TODO: valueGet(v=%v, p=%s)", v, p)) - } - - r := storeValue(ctx, result) - stack.SetResultRef(0, r) -} - -// ValueSet implements js.valueSet, which is used to store a js.Value property -// by name, e.g. `v.Set("address", a)`. Notably, this is used by js.handleEvent -// set the event result. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L309 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L318-L322 -var ValueSet = goos.NewFunc(custom.NameSyscallValueSet, valueSet) - -func valueSet(ctx context.Context, mod api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - p := stack.ParamString(mod.Memory(), 1 /*, 2 */) - x := stack.ParamVal(ctx, 3, LoadValue) - - if p := p; v == getState(ctx) { - switch p { - case "_pendingEvent": - if x == nil { // syscall_js.handleEvent - s := v.(*State) - s._lastEvent = s._pendingEvent - s._pendingEvent = nil - return - } - } - } else if e, ok := v.(*event); ok { // syscall_js.handleEvent - switch p { - case "result": - e.result = x - return - } - } else if m, ok := v.(*object); ok { - m.properties[p] = x // e.g. opt.Set("method", req.Method) - return - } - panic(fmt.Errorf("TODO: valueSet(v=%v, p=%s, x=%v)", v, p, x)) -} - -// ValueDelete is stubbed as it isn't used in Go's main source tree. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L321 -var ValueDelete = goarch.StubFunction(custom.NameSyscallValueDelete) - -// ValueIndex implements js.valueIndex, which is used to load a js.Value property -// by index, e.g. `v.Index(0)`. Notably, this is used by js.handleEvent to read -// event arguments -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L334 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L331-L334 -var ValueIndex = goos.NewFunc(custom.NameSyscallValueIndex, valueIndex) - -func valueIndex(ctx context.Context, _ api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - i := stack.ParamUint32(1) - - result := v.(*objectArray).slice[i] - - r := storeValue(ctx, result) - stack.SetResultRef(0, r) -} - -// ValueSetIndex is stubbed as it is only used for js.ValueOf when the input is -// []interface{}, which doesn't appear to occur in Go's source tree. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L348 -var ValueSetIndex = goarch.StubFunction(custom.NameSyscallValueSetIndex) - -// ValueCall implements js.valueCall, which is used to call a js.Value function -// by name, e.g. `document.Call("createElement", "div")`. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L394 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L343-L358 -var ValueCall = goos.NewFunc(custom.NameSyscallValueCall, valueCall) - -func valueCall(ctx context.Context, mod api.Module, stack goos.Stack) { - mem := mod.Memory() - vRef := stack.ParamRef(0) - m := stack.ParamString(mem, 1 /*, 2 */) - args := stack.ParamVals(ctx, mem, 3 /*, 4 */, LoadValue) - // 5 = padding - - v := LoadValue(ctx, vRef) - c, isCall := v.(jsCall) - if !isCall { - panic(fmt.Errorf("TODO: valueCall(v=%v, m=%s, args=%v)", v, m, args)) - } - - var res goos.Ref - var ok bool - if result, err := c.call(ctx, mod, vRef, m, args...); err != nil { - res = storeValue(ctx, err) - } else { - res = storeValue(ctx, result) - ok = true - } - - stack.Refresh(mod) - stack.SetResultRef(0, res) - stack.SetResultBool(1, ok) -} - -// ValueInvoke is stubbed as it isn't used in Go's main source tree. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L413 -var ValueInvoke = goarch.StubFunction(custom.NameSyscallValueInvoke) - -// ValueNew implements js.valueNew, which is used to call a js.Value, e.g. -// `array.New(2)`. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L432 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L378-L392 -var ValueNew = goos.NewFunc(custom.NameSyscallValueNew, valueNew) - -func valueNew(ctx context.Context, mod api.Module, stack goos.Stack) { - mem := mod.Memory() - vRef := stack.ParamRef(0) - args := stack.ParamVals(ctx, mem, 1 /*, 2 */, LoadValue) - // 3 = padding - - var res goos.Ref - var ok bool - switch vRef { - case goos.RefArrayConstructor: - result := &objectArray{} - res = storeValue(ctx, result) - ok = true - case goos.RefUint8ArrayConstructor: - var result interface{} - a := args[0] - if n, ok := a.(float64); ok { - result = goos.WrapByteArray(make([]byte, uint32(n))) - } else if _, ok := a.(*goos.ByteArray); ok { - // In case of wrapping, increment the counter of the same ref. - // uint8arrayWrapper := uint8Array.New(args[0]) - result = stack.ParamRefs(mem, 1)[0] - } else { - panic(fmt.Errorf("TODO: valueNew(v=%v, args=%v)", vRef, args)) - } - res = storeValue(ctx, result) - ok = true - case goos.RefObjectConstructor: - result := &object{properties: map[string]interface{}{}} - res = storeValue(ctx, result) - ok = true - case goos.RefHttpHeadersConstructor: - result := &headers{headers: http.Header{}} - res = storeValue(ctx, result) - ok = true - case goos.RefJsDateConstructor: - res = goos.RefJsDate - ok = true - default: - panic(fmt.Errorf("TODO: valueNew(v=%v, args=%v)", vRef, args)) - } - - stack.Refresh(mod) - stack.SetResultRef(0, res) - stack.SetResultBool(1, ok) -} - -// ValueLength implements js.valueLength, which is used to load the length -// property of a value, e.g. `array.length`. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L372 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L395-L398 -var ValueLength = goos.NewFunc(custom.NameSyscallValueLength, valueLength) - -func valueLength(ctx context.Context, _ api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - - len := len(v.(*objectArray).slice) - - stack.SetResultUint32(0, uint32(len)) -} - -// ValuePrepareString implements js.valuePrepareString, which is used to load -// the string for `o.String()` (via js.jsString) for string, boolean and -// number types. Notably, http.Transport uses this in RoundTrip to coerce the -// URL to a string. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L531 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L401-L406 -var ValuePrepareString = goos.NewFunc(custom.NameSyscallValuePrepareString, valuePrepareString) - -func valuePrepareString(ctx context.Context, _ api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - - s := valueString(v) - - sRef := storeValue(ctx, s) - sLen := uint32(len(s)) - - stack.SetResultRef(0, sRef) - stack.SetResultUint32(1, sLen) -} - -// ValueLoadString implements js.valueLoadString, which is used copy a string -// value for `o.String()`. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L533 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L409-L413 -var ValueLoadString = goos.NewFunc(custom.NameSyscallValueLoadString, valueLoadString) - -func valueLoadString(ctx context.Context, mod api.Module, stack goos.Stack) { - v := stack.ParamVal(ctx, 0, LoadValue) - b := stack.ParamBytes(mod.Memory(), 1 /*, 2 */) - - s := valueString(v) - copy(b, s) -} - -// ValueInstanceOf is stubbed as it isn't used in Go's main source tree. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L543 -var ValueInstanceOf = goarch.StubFunction(custom.NameSyscallValueInstanceOf) - -// CopyBytesToGo copies a JavaScript managed byte array to linear memory. -// For example, this is used to read an HTTP response body. -// -// # Results -// -// - n is the count of bytes written. -// - ok is false if the src was not a uint8Array. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L569 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L437-L449 -var CopyBytesToGo = goos.NewFunc(custom.NameSyscallCopyBytesToGo, copyBytesToGo) - -func copyBytesToGo(ctx context.Context, mod api.Module, stack goos.Stack) { - dst := stack.ParamBytes(mod.Memory(), 0 /*, 1 */) - // padding = 2 - src := stack.ParamVal(ctx, 3, LoadValue) - - var n uint32 - var ok bool - if src, isBuf := src.(*goos.ByteArray); isBuf { - n = uint32(copy(dst, src.Unwrap())) - ok = true - } - - stack.SetResultUint32(0, n) - stack.SetResultBool(1, ok) -} - -// CopyBytesToJS copies linear memory to a JavaScript managed byte array. -// For example, this is used to read an HTTP request body. -// -// # Results -// -// - n is the count of bytes written. -// - ok is false if the dst was not a uint8Array. -// -// See https://github.com/golang/go/blob/go1.20/src/syscall/js/js.go#L583 -// and https://github.com/golang/go/blob/go1.20/misc/wasm/wasm_exec.js#L438-L448 -var CopyBytesToJS = goos.NewFunc(custom.NameSyscallCopyBytesToJS, copyBytesToJS) - -func copyBytesToJS(ctx context.Context, mod api.Module, stack goos.Stack) { - dst := stack.ParamVal(ctx, 0, LoadValue) - src := stack.ParamBytes(mod.Memory(), 1 /*, 2 */) - // padding = 3 - - var n uint32 - var ok bool - if dst, isBuf := dst.(*goos.ByteArray); isBuf { - if dst != nil { // empty is possible on EOF - n = uint32(copy(dst.Unwrap(), src)) - } - ok = true - } - - stack.SetResultUint32(0, n) - stack.SetResultBool(1, ok) -} - -// funcWrapper is the result of go's js.FuncOf ("_makeFuncWrapper" here). -// -// This ID is managed on the Go side an increments (possibly rolling over). -type funcWrapper uint32 - -// invoke implements jsFn -func (f funcWrapper) invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error) { - e := &event{id: uint32(f), this: args[0].(goos.Ref)} - - if len(args) > 1 { // Ensure arguments are hashable. - e.args = &objectArray{args[1:]} - for i, v := range e.args.slice { - if s, ok := v.([]byte); ok { - args[i] = goos.WrapByteArray(s) - } else if s, ok := v.([]interface{}); ok { - args[i] = &objectArray{s} - } else if e, ok := v.(error); ok { - args[i] = e - } - } - } - - getState(ctx)._pendingEvent = e // Note: _pendingEvent reference is cleared during resume! - - if _, err := mod.ExportedFunction("resume").Call(ctx); err != nil { - if _, ok := err.(*sys.ExitError); ok { - return nil, nil // allow error-handling to unwind when wasm calls exit due to a panic - } else { - return nil, err - } - } - - return e.result, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/time.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/time.go deleted file mode 100644 index 8b40b7d849..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/time.go +++ /dev/null @@ -1,28 +0,0 @@ -package gojs - -import ( - "context" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/gojs/goos" -) - -var ( - // jsDateConstructor returns jsDate. - // - // This is defined as `Get("Date")` in zoneinfo_js.go time.initLocal - jsDateConstructor = newJsVal(goos.RefJsDateConstructor, custom.NameDate) - - // jsDate is used inline in zoneinfo_js.go for time.initLocal. - // `.Call("getTimezoneOffset").Int()` returns a timezone offset. - jsDate = newJsVal(goos.RefJsDate, custom.NameDate). - addFunction(custom.NameDateGetTimezoneOffset, jsDateGetTimezoneOffset{}) -) - -// jsDateGetTimezoneOffset implements jsFn -type jsDateGetTimezoneOffset struct{} - -func (jsDateGetTimezoneOffset) invoke(context.Context, api.Module, ...interface{}) (interface{}, error) { - return uint32(0), nil // UTC -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/util/util.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/util/util.go deleted file mode 100644 index 5fc29aab0b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/util/util.go +++ /dev/null @@ -1,70 +0,0 @@ -package util - -import ( - "fmt" - pathutil "path" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/gojs/custom" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// MustWrite is like api.Memory except that it panics if the offset -// is out of range. -func MustWrite(mem api.Memory, fieldName string, offset uint32, val []byte) { - if ok := mem.Write(offset, val); !ok { - panic(fmt.Errorf("out of memory writing %s", fieldName)) - } -} - -// MustRead is like api.Memory except that it panics if the offset and -// byteCount are out of range. -func MustRead(mem api.Memory, funcName string, paramIdx int, offset, byteCount uint32) []byte { - buf, ok := mem.Read(offset, byteCount) - if ok { - return buf - } - var paramName string - if names, ok := custom.NameSection[funcName]; ok { - if paramIdx < len(names.ParamNames) { - paramName = names.ParamNames[paramIdx] - } - } - if paramName == "" { - paramName = fmt.Sprintf("%s param[%d]", funcName, paramIdx) - } - panic(fmt.Errorf("out of memory reading %s", paramName)) -} - -func NewFunc(name string, goFunc api.GoModuleFunc) *wasm.HostFunc { - return &wasm.HostFunc{ - ExportName: name, - Name: name, - ParamTypes: []api.ValueType{api.ValueTypeI32}, - ParamNames: []string{"sp"}, - Code: wasm.Code{GoFunc: goFunc}, - } -} - -// ResolvePath is needed when a non-absolute path is given to a function. -// Unlike other host ABI, GOOS=js maintains the CWD host side. -func ResolvePath(cwd, path string) (resolved string) { - pathLen := len(path) - switch { - case pathLen == 0: - return cwd - case pathLen == 1 && path[0] == '.': - return cwd - case path[0] == '/': - resolved = pathutil.Clean(path) - default: - resolved = pathutil.Join(cwd, path) - } - - // If there's a trailing slash, we need to retain it for symlink edge - // cases. See https://github.com/golang/go/issues/27225 - if len(resolved) > 1 && path[pathLen-1] == '/' { - return resolved + "/" - } - return resolved -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/gojs/values/values.go b/vendor/github.com/tetratelabs/wazero/internal/gojs/values/values.go deleted file mode 100644 index 53dce81aa7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/gojs/values/values.go +++ /dev/null @@ -1,73 +0,0 @@ -package values - -import ( - "fmt" - - "github.com/tetratelabs/wazero/internal/gojs/goos" -) - -func NewValues() *Values { - ret := &Values{} - ret.Reset() - return ret -} - -type Values struct { - // Below is needed to avoid exhausting the ID namespace finalizeRef reclaims - // See https://go-review.googlesource.com/c/go/+/203600 - - values []interface{} // values indexed by ID, nil - goRefCounts []uint32 // recount pair-indexed with values - ids map[interface{}]uint32 // live values - idPool []uint32 // reclaimed IDs (values[i] = nil, goRefCounts[i] nil -} - -func (j *Values) Get(id uint32) interface{} { - index := id - goos.NextID - if index >= uint32(len(j.values)) { - panic(fmt.Errorf("id %d is out of range %d", id, len(j.values))) - } - if v := j.values[index]; v == nil { - panic(fmt.Errorf("value for %d was nil", id)) - } else { - return v - } -} - -func (j *Values) Increment(v interface{}) uint32 { - id, ok := j.ids[v] - if !ok { - if len(j.idPool) == 0 { - id, j.values, j.goRefCounts = uint32(len(j.values)), append(j.values, v), append(j.goRefCounts, 0) - } else { - id, j.idPool = j.idPool[len(j.idPool)-1], j.idPool[:len(j.idPool)-1] - j.values[id], j.goRefCounts[id] = v, 0 - } - j.ids[v] = id - } - j.goRefCounts[id]++ - - return id + goos.NextID -} - -func (j *Values) Decrement(id uint32) { - // Special IDs are not goos.Refcounted. - if id < goos.NextID { - return - } - id -= goos.NextID - j.goRefCounts[id]-- - if j.goRefCounts[id] == 0 { - v := j.values[id] - j.values[id] = nil - delete(j.ids, v) - j.idPool = append(j.idPool, id) - } -} - -func (j *Values) Reset() { - j.values = nil - j.goRefCounts = nil - j.ids = map[interface{}]uint32{} - j.idPool = nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go b/vendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go deleted file mode 100644 index 0c9298957f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/ieee754/ieee754.go +++ /dev/null @@ -1,29 +0,0 @@ -package ieee754 - -import ( - "encoding/binary" - "io" - "math" -) - -// DecodeFloat32 decodes a float32 in IEEE 754 binary representation. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#floating-point%E2%91%A2 -func DecodeFloat32(buf []byte) (float32, error) { - if len(buf) < 4 { - return 0, io.ErrUnexpectedEOF - } - - raw := binary.LittleEndian.Uint32(buf[:4]) - return math.Float32frombits(raw), nil -} - -// DecodeFloat64 decodes a float64 in IEEE 754 binary representation. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#floating-point%E2%91%A2 -func DecodeFloat64(buf []byte) (float64, error) { - if len(buf) < 8 { - return 0, io.ErrUnexpectedEOF - } - - raw := binary.LittleEndian.Uint64(buf) - return math.Float64frombits(raw), nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/integration_test/engine/testdata/infinite_loop.wasm b/vendor/github.com/tetratelabs/wazero/internal/integration_test/engine/testdata/infinite_loop.wasm deleted file mode 100644 index 6b5794135936f712d7f1929787147f8eb794fcd8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48 zcmZQbEY4+QU|?WmVN76PU}j=uU>9WM&CE;7%*!lEjnB!?FJNHc;$&oJV0PeP;N}JZ DyyyqS diff --git a/vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/fac.wasm b/vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/fac.wasm deleted file mode 100644 index 5e3dcb064bfe5d81eb127a037a6c4c8ceb3b8da1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 146 zcmW;Eu?oUK5CqVf+cSwClB&JR?l zI#@(aDwjbOFQBUf>sua=rDV8GFBSH7q4`5AJ0wFSGEyTGzYz(SExI-Y9Q-rSSF9U* W(SLGzvvpX#?&Eag!dWUhf{!12^%+6{ diff --git a/vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/mem_grow.wasm b/vendor/github.com/tetratelabs/wazero/internal/integration_test/vs/testdata/mem_grow.wasm deleted file mode 100644 index a2c9f66d0f0408979282d9cb627d387cc046d0b4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmV~$I}Uh*;v`Dq|V!-}AF6>= 7 - - // The encoding unsigned numbers is simpler as it only needs to check if the value is non-zero to tell if there - // are more bits to encode. Signed is a little more complicated as you have to double-check the sign bit. - // If either case, set the high-order bit to tell the reader there are more bytes in this int. - if (value != -1 || s == 0) && (value != 0 || s != 0) { - b |= 0x80 - } - - // Append b into the buffer - buf = append(buf, b) - if b&0x80 == 0 { - break - } - } - return buf -} - -// EncodeUint32 encodes the value into a buffer in LEB128 format -// -// See https://en.wikipedia.org/wiki/LEB128#Encode_unsigned_integer -func EncodeUint32(value uint32) []byte { - return EncodeUint64(uint64(value)) -} - -// EncodeUint64 encodes the value into a buffer in LEB128 format -// -// See https://en.wikipedia.org/wiki/LEB128#Encode_unsigned_integer -func EncodeUint64(value uint64) (buf []byte) { - // This is effectively a do/while loop where we take 7 bits of the value and encode them until it is zero. - for { - // Take 7 remaining low-order bits from the value into b. - b := uint8(value & 0x7f) - value = value >> 7 - - // If there are remaining bits, the value won't be zero: Set the high- - // order bit to tell the reader there are more bytes in this uint. - if value != 0 { - b |= 0x80 - } - - // Append b into the buffer - buf = append(buf, b) - if b&0x80 == 0 { - return buf - } - } -} - -type nextByte func(i int) (byte, error) - -func DecodeUint32(r io.ByteReader) (ret uint32, bytesRead uint64, err error) { - return decodeUint32(func(_ int) (byte, error) { return r.ReadByte() }) -} - -func LoadUint32(buf []byte) (ret uint32, bytesRead uint64, err error) { - return decodeUint32(func(i int) (byte, error) { - if i >= len(buf) { - return 0, io.EOF - } - return buf[i], nil - }) -} - -func decodeUint32(next nextByte) (ret uint32, bytesRead uint64, err error) { - // Derived from https://github.com/golang/go/blob/go1.20/src/encoding/binary/varint.go - // with the modification on the overflow handling tailored for 32-bits. - var s uint32 - for i := 0; i < maxVarintLen32; i++ { - b, err := next(i) - if err != nil { - return 0, 0, err - } - if b < 0x80 { - // Unused bits must be all zero. - if i == maxVarintLen32-1 && (b&0xf0) > 0 { - return 0, 0, errOverflow32 - } - return ret | uint32(b)<= bufLen { - return 0, 0, io.EOF - } - b := buf[i] - if b < 0x80 { - // Unused bits (non first bit) must all be zero. - if i == maxVarintLen64-1 && b > 1 { - return 0, 0, errOverflow64 - } - return ret | uint64(b)<= len(buf) { - return 0, io.EOF - } - return buf[i], nil - }) -} - -func decodeInt32(next nextByte) (ret int32, bytesRead uint64, err error) { - var shift int - var b byte - for { - b, err = next(int(bytesRead)) - if err != nil { - return 0, 0, fmt.Errorf("readByte failed: %w", err) - } - ret |= (int32(b) & 0x7f) << shift - shift += 7 - bytesRead++ - if b&0x80 == 0 { - if shift < 32 && (b&0x40) != 0 { - ret |= ^0 << shift - } - // Over flow checks. - // fixme: can be optimized. - if bytesRead > maxVarintLen32 { - return 0, 0, errOverflow32 - } else if unused := b & 0b00110000; bytesRead == maxVarintLen32 && ret < 0 && unused != 0b00110000 { - return 0, 0, errOverflow32 - } else if bytesRead == maxVarintLen32 && ret >= 0 && unused != 0x00 { - return 0, 0, errOverflow32 - } - return - } - } -} - -// DecodeInt33AsInt64 is a special cased decoder for wasm.BlockType which is encoded as a positive signed integer, yet -// still needs to fit the 32-bit range of allowed indices. Hence, this is 33, not 32-bit! -// -// See https://webassembly.github.io/spec/core/binary/instructions.html#control-instructions -func DecodeInt33AsInt64(r io.ByteReader) (ret int64, bytesRead uint64, err error) { - var shift int - var b int64 - var rb byte - for shift < 35 { - rb, err = r.ReadByte() - if err != nil { - return 0, 0, fmt.Errorf("readByte failed: %w", err) - } - b = int64(rb) - ret |= (b & int33Mask2) << shift - shift += 7 - bytesRead++ - if b&int33Mask == 0 { - break - } - } - - // fixme: can be optimized - if shift < 33 && (b&int33Mask3) == int33Mask3 { - ret |= int33Mask4 << shift - } - ret = ret & int33Mask4 - - // if 33rd bit == 1, we translate it as a corresponding signed-33bit minus value - if ret&int33Mask5 > 0 { - ret = ret - int33Mask6 - } - // Over flow checks. - // fixme: can be optimized. - if bytesRead > maxVarintLen33 { - return 0, 0, errOverflow33 - } else if unused := b & 0b00100000; bytesRead == maxVarintLen33 && ret < 0 && unused != 0b00100000 { - return 0, 0, errOverflow33 - } else if bytesRead == maxVarintLen33 && ret >= 0 && unused != 0x00 { - return 0, 0, errOverflow33 - } - return ret, bytesRead, nil -} - -func DecodeInt64(r io.ByteReader) (ret int64, bytesRead uint64, err error) { - return decodeInt64(func(_ int) (byte, error) { return r.ReadByte() }) -} - -func LoadInt64(buf []byte) (ret int64, bytesRead uint64, err error) { - return decodeInt64(func(i int) (byte, error) { - if i >= len(buf) { - return 0, io.EOF - } - return buf[i], nil - }) -} - -func decodeInt64(next nextByte) (ret int64, bytesRead uint64, err error) { - var shift int - var b byte - for { - b, err = next(int(bytesRead)) - if err != nil { - return 0, 0, fmt.Errorf("readByte failed: %w", err) - } - ret |= (int64(b) & 0x7f) << shift - shift += 7 - bytesRead++ - if b&0x80 == 0 { - if shift < 64 && (b&int64Mask3) == int64Mask3 { - ret |= int64Mask4 << shift - } - // Over flow checks. - // fixme: can be optimized. - if bytesRead > maxVarintLen64 { - return 0, 0, errOverflow64 - } else if unused := b & 0b00111110; bytesRead == maxVarintLen64 && ret < 0 && unused != 0b00111110 { - return 0, 0, errOverflow64 - } else if bytesRead == maxVarintLen64 && ret >= 0 && unused != 0x00 { - return 0, 0, errOverflow64 - } - return - } - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go b/vendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go deleted file mode 100644 index 4741f07bb9..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/moremath/moremath.go +++ /dev/null @@ -1,271 +0,0 @@ -package moremath - -import ( - "math" -) - -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/syntax/values.html#floating-point -const ( - // F32CanonicalNaNBits is the 32-bit float where payload's MSB equals 1 and others are all zero. - F32CanonicalNaNBits = uint32(0x7fc0_0000) - // F32CanonicalNaNBitsMask can be used to judge the value `v` is canonical nan as "v&F32CanonicalNaNBitsMask == F32CanonicalNaNBits" - F32CanonicalNaNBitsMask = uint32(0x7fff_ffff) - // F64CanonicalNaNBits is the 64-bit float where payload's MSB equals 1 and others are all zero. - F64CanonicalNaNBits = uint64(0x7ff8_0000_0000_0000) - // F64CanonicalNaNBitsMask can be used to judge the value `v` is canonical nan as "v&F64CanonicalNaNBitsMask == F64CanonicalNaNBits" - F64CanonicalNaNBitsMask = uint64(0x7fff_ffff_ffff_ffff) - // F32ArithmeticNaNPayloadMSB is used to extract the most significant bit of payload of 32-bit arithmetic NaN values - F32ArithmeticNaNPayloadMSB = uint32(0x0040_0000) - // F32ExponentMask is used to extract the exponent of 32-bit floating point. - F32ExponentMask = uint32(0x7f80_0000) - // F32ArithmeticNaNBits is an example 32-bit arithmetic NaN. - F32ArithmeticNaNBits = F32CanonicalNaNBits | 0b1 // Set first bit to make this different from the canonical NaN. - // F64ArithmeticNaNPayloadMSB is used to extract the most significant bit of payload of 64-bit arithmetic NaN values - F64ArithmeticNaNPayloadMSB = uint64(0x0008_0000_0000_0000) - // F64ExponentMask is used to extract the exponent of 64-bit floating point. - F64ExponentMask = uint64(0x7ff0_0000_0000_0000) - // F64ArithmeticNaNBits is an example 64-bit arithmetic NaN. - F64ArithmeticNaNBits = F64CanonicalNaNBits | 0b1 // Set first bit to make this different from the canonical NaN. -) - -// WasmCompatMin64 is the Wasm spec compatible variant of math.Min for 64-bit floating points. -func WasmCompatMin64(x, y float64) float64 { - switch { - case math.IsNaN(x) || math.IsNaN(y): - return returnF64NaNBinOp(x, y) - case math.IsInf(x, -1) || math.IsInf(y, -1): - return math.Inf(-1) - case x == 0 && x == y: - if math.Signbit(x) { - return x - } - return y - } - if x < y { - return x - } - return y -} - -// WasmCompatMin32 is the Wasm spec compatible variant of math.Min for 32-bit floating points. -func WasmCompatMin32(x, y float32) float32 { - x64, y64 := float64(x), float64(y) - switch { - case math.IsNaN(x64) || math.IsNaN(y64): - return returnF32NaNBinOp(x, y) - case math.IsInf(x64, -1) || math.IsInf(y64, -1): - return float32(math.Inf(-1)) - case x == 0 && x == y: - if math.Signbit(x64) { - return x - } - return y - } - if x < y { - return x - } - return y -} - -// WasmCompatMax64 is the Wasm spec compatible variant of math.Max for 64-bit floating points. -func WasmCompatMax64(x, y float64) float64 { - switch { - case math.IsNaN(x) || math.IsNaN(y): - return returnF64NaNBinOp(x, y) - case math.IsInf(x, 1) || math.IsInf(y, 1): - return math.Inf(1) - case x == 0 && x == y: - if math.Signbit(x) { - return y - } - return x - } - if x > y { - return x - } - return y -} - -// WasmCompatMax32 is the Wasm spec compatible variant of math.Max for 32-bit floating points. -func WasmCompatMax32(x, y float32) float32 { - x64, y64 := float64(x), float64(y) - switch { - case math.IsNaN(x64) || math.IsNaN(y64): - return returnF32NaNBinOp(x, y) - case math.IsInf(x64, 1) || math.IsInf(y64, 1): - return float32(math.Inf(1)) - case x == 0 && x == y: - if math.Signbit(x64) { - return y - } - return x - } - if x > y { - return x - } - return y -} - -// WasmCompatNearestF32 is the Wasm spec compatible variant of math.Round, used for Nearest instruction. -// For example, this converts 1.9 to 2.0, and this has the semantics of LLVM's rint intrinsic. -// -// e.g. math.Round(-4.5) results in -5 while this results in -4. -// -// See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic. -func WasmCompatNearestF32(f float32) float32 { - var res float32 - // TODO: look at https://github.com/bytecodealliance/wasmtime/pull/2171 and reconsider this algorithm - if f != 0 { - ceil := float32(math.Ceil(float64(f))) - floor := float32(math.Floor(float64(f))) - distToCeil := math.Abs(float64(f - ceil)) - distToFloor := math.Abs(float64(f - floor)) - h := ceil / 2.0 - if distToCeil < distToFloor { - res = ceil - } else if distToCeil == distToFloor && float32(math.Floor(float64(h))) == h { - res = ceil - } else { - res = floor - } - } else { - res = f - } - return returnF32UniOp(f, res) -} - -// WasmCompatNearestF64 is the Wasm spec compatible variant of math.Round, used for Nearest instruction. -// For example, this converts 1.9 to 2.0, and this has the semantics of LLVM's rint intrinsic. -// -// e.g. math.Round(-4.5) results in -5 while this results in -4. -// -// See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic. -func WasmCompatNearestF64(f float64) float64 { - // TODO: look at https://github.com/bytecodealliance/wasmtime/pull/2171 and reconsider this algorithm - var res float64 - if f != 0 { - ceil := math.Ceil(f) - floor := math.Floor(f) - distToCeil := math.Abs(f - ceil) - distToFloor := math.Abs(f - floor) - h := ceil / 2.0 - if distToCeil < distToFloor { - res = ceil - } else if distToCeil == distToFloor && math.Floor(h) == h { - res = ceil - } else { - res = floor - } - } else { - res = f - } - return returnF64UniOp(f, res) -} - -// WasmCompatCeilF32 is the same as math.Ceil on 32-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatCeilF32(f float32) float32 { - return returnF32UniOp(f, float32(math.Ceil(float64(f)))) -} - -// WasmCompatCeilF64 is the same as math.Ceil on 64-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatCeilF64(f float64) float64 { - return returnF64UniOp(f, math.Ceil(f)) -} - -// WasmCompatFloorF32 is the same as math.Floor on 32-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatFloorF32(f float32) float32 { - return returnF32UniOp(f, float32(math.Floor(float64(f)))) -} - -// WasmCompatFloorF64 is the same as math.Floor on 64-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatFloorF64(f float64) float64 { - return returnF64UniOp(f, math.Floor(f)) -} - -// WasmCompatTruncF32 is the same as math.Trunc on 32-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatTruncF32(f float32) float32 { - return returnF32UniOp(f, float32(math.Trunc(float64(f)))) -} - -// WasmCompatTruncF64 is the same as math.Trunc on 64-bit except that -// the returned NaN value follows the Wasm specification on NaN -// propagation. -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func WasmCompatTruncF64(f float64) float64 { - return returnF64UniOp(f, math.Trunc(f)) -} - -func f32IsNaN(v float32) bool { - return v != v // this is how NaN is defined. -} - -func f64IsNaN(v float64) bool { - return v != v // this is how NaN is defined. -} - -// returnF32UniOp returns the result of 32-bit unary operation. This accepts `original` which is the operand, -// and `result` which is its result. This returns the `result` as-is if the result is not NaN. Otherwise, this follows -// the same logic as in the reference interpreter as well as the amd64 and arm64 floating point handling. -func returnF32UniOp(original, result float32) float32 { - // Following the same logic as in the reference interpreter: - // https://github.com/WebAssembly/spec/blob/d48af683f5e6d00c13f775ab07d29a15daf92203/interpreter/exec/fxx.ml#L115-L122 - if !f32IsNaN(result) { - return result - } - if !f32IsNaN(original) { - return math.Float32frombits(F32CanonicalNaNBits) - } - return math.Float32frombits(math.Float32bits(original) | F32CanonicalNaNBits) -} - -// returnF32UniOp returns the result of 64-bit unary operation. This accepts `original` which is the operand, -// and `result` which is its result. This returns the `result` as-is if the result is not NaN. Otherwise, this follows -// the same logic as in the reference interpreter as well as the amd64 and arm64 floating point handling. -func returnF64UniOp(original, result float64) float64 { - // Following the same logic as in the reference interpreter (== amd64 and arm64's behavior): - // https://github.com/WebAssembly/spec/blob/d48af683f5e6d00c13f775ab07d29a15daf92203/interpreter/exec/fxx.ml#L115-L122 - if !f64IsNaN(result) { - return result - } - if !f64IsNaN(original) { - return math.Float64frombits(F64CanonicalNaNBits) - } - return math.Float64frombits(math.Float64bits(original) | F64CanonicalNaNBits) -} - -// returnF64NaNBinOp returns a NaN for 64-bit binary operations. `x` and `y` are original floats -// and at least one of them is NaN. The returned NaN is guaranteed to comply with the NaN propagation -// procedure: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func returnF64NaNBinOp(x, y float64) float64 { - if f64IsNaN(x) { - return math.Float64frombits(math.Float64bits(x) | F64CanonicalNaNBits) - } else { - return math.Float64frombits(math.Float64bits(y) | F64CanonicalNaNBits) - } -} - -// returnF64NaNBinOp returns a NaN for 32-bit binary operations. `x` and `y` are original floats -// and at least one of them is NaN. The returned NaN is guaranteed to comply with the NaN propagation -// procedure: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/numerics.html#nan-propagation -func returnF32NaNBinOp(x, y float32) float32 { - if f32IsNaN(x) { - return math.Float32frombits(math.Float32bits(x) | F32CanonicalNaNBits) - } else { - return math.Float32frombits(math.Float32bits(y) | F32CanonicalNaNBits) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go b/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go deleted file mode 100644 index 2702d31629..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.go +++ /dev/null @@ -1,79 +0,0 @@ -package platform - -const ( - // CpuFeatureSSE3 is the flag to query CpuFeatureFlags.Has for SSEv3 capabilities - CpuFeatureSSE3 = uint64(1) - // CpuFeatureSSE4_1 is the flag to query CpuFeatureFlags.Has for SSEv4.1 capabilities - CpuFeatureSSE4_1 = uint64(1) << 19 - // CpuFeatureSSE4_2 is the flag to query CpuFeatureFlags.Has for SSEv4.2 capabilities - CpuFeatureSSE4_2 = uint64(1) << 20 -) - -const ( - // CpuExtraFeatureABM is the flag to query CpuFeatureFlags.HasExtra for Advanced Bit Manipulation capabilities (e.g. LZCNT) - CpuExtraFeatureABM = uint64(1) << 5 -) - -// CpuFeatures exposes the capabilities for this CPU, queried via the Has, HasExtra methods -var CpuFeatures CpuFeatureFlags = loadCpuFeatureFlags() - -// CpuFeatureFlags exposes methods for querying CPU capabilities -type CpuFeatureFlags interface { - // Has returns true when the specified flag (represented as uint64) is supported - Has(cpuFeature uint64) bool - // HasExtra returns true when the specified extraFlag (represented as uint64) is supported - HasExtra(cpuFeature uint64) bool -} - -// cpuFeatureFlags implements CpuFeatureFlags interface -type cpuFeatureFlags struct { - flags uint64 - extraFlags uint64 -} - -// cpuid exposes the CPUID instruction to the Go layer (https://www.amd.com/system/files/TechDocs/25481.pdf) -// implemented in impl_amd64.s -func cpuid(arg1, arg2 uint32) (eax, ebx, ecx, edx uint32) - -// cpuidAsBitmap combines the result of invoking cpuid to uint64 bitmap -func cpuidAsBitmap(arg1, arg2 uint32) uint64 { - _ /* eax */, _ /* ebx */, ecx, edx := cpuid(arg1, arg2) - return (uint64(edx) << 32) | uint64(ecx) -} - -// loadStandardRange load flags from the standard range, panics otherwise -func loadStandardRange(id uint32) uint64 { - // ensure that the id is in the valid range, returned by cpuid(0,0) - maxRange, _, _, _ := cpuid(0, 0) - if id > maxRange { - panic("cannot query standard CPU flags") - } - return cpuidAsBitmap(id, 0) -} - -// loadStandardRange load flags from the extended range, panics otherwise -func loadExtendedRange(id uint32) uint64 { - // ensure that the id is in the valid range, returned by cpuid(0x80000000,0) - maxRange, _, _, _ := cpuid(0x80000000, 0) - if id > maxRange { - panic("cannot query extended CPU flags") - } - return cpuidAsBitmap(id, 0) -} - -func loadCpuFeatureFlags() CpuFeatureFlags { - return &cpuFeatureFlags{ - flags: loadStandardRange(1), - extraFlags: loadExtendedRange(0x80000001), - } -} - -// Has implements the same method on the CpuFeatureFlags interface -func (f *cpuFeatureFlags) Has(cpuFeature uint64) bool { - return (f.flags & cpuFeature) != 0 -} - -// HasExtra implements the same method on the CpuFeatureFlags interface -func (f *cpuFeatureFlags) HasExtra(cpuFeature uint64) bool { - return (f.extraFlags & cpuFeature) != 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.s b/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.s deleted file mode 100644 index 8d483f3a6f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/cpuid_amd64.s +++ /dev/null @@ -1,14 +0,0 @@ -#include "textflag.h" - -// lifted from github.com/intel-go/cpuid and src/internal/cpu/cpu_x86.s -// func cpuid(arg1, arg2 uint32) (eax, ebx, ecx, edx uint32) -TEXT ·cpuid(SB), NOSPLIT, $0-24 - MOVL arg1+0(FP), AX - MOVL arg2+4(FP), CX - CPUID - MOVL AX, eax+8(FP) - MOVL BX, ebx+12(FP) - MOVL CX, ecx+16(FP) - MOVL DX, edx+20(FP) - RET - diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go b/vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go deleted file mode 100644 index c141f00f0c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/crypto.go +++ /dev/null @@ -1,17 +0,0 @@ -package platform - -import ( - "io" - "math/rand" -) - -// seed is a fixed seed value for NewFakeRandSource. -// -// Trivia: While arbitrary, 42 was chosen as it is the "Ultimate Answer" in -// the Douglas Adams novel "The Hitchhiker's Guide to the Galaxy." -const seed = int64(42) - -// NewFakeRandSource returns a deterministic source of random values. -func NewFakeRandSource() io.Reader { - return rand.New(rand.NewSource(seed)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/errno.go b/vendor/github.com/tetratelabs/wazero/internal/platform/errno.go deleted file mode 100644 index 43e0342690..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/errno.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !windows - -package platform - -import "syscall" - -func adjustErrno(err syscall.Errno) syscall.Errno { - return err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/errno_windows.go b/vendor/github.com/tetratelabs/wazero/internal/platform/errno_windows.go deleted file mode 100644 index d07e10cb3c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/errno_windows.go +++ /dev/null @@ -1,72 +0,0 @@ -package platform - -import "syscall" - -// See https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- -const ( - // ERROR_ACCESS_DENIED is a Windows error returned by syscall.Unlink - // instead of syscall.EACCES - ERROR_ACCESS_DENIED = syscall.Errno(5) - - // ERROR_INVALID_HANDLE is a Windows error returned by syscall.Write - // instead of syscall.EBADF - ERROR_INVALID_HANDLE = syscall.Errno(6) - - // ERROR_FILE_EXISTS is a Windows error returned by os.OpenFile - // instead of syscall.EEXIST - ERROR_FILE_EXISTS = syscall.Errno(0x50) - - // ERROR_INVALID_NAME is a Windows error returned by open when a file - // path has a trailing slash - ERROR_INVALID_NAME = syscall.Errno(0x7B) - - // ERROR_NEGATIVE_SEEK is a Windows error returned by os.Truncate - // instead of syscall.EINVAL - ERROR_NEGATIVE_SEEK = syscall.Errno(0x83) - - // ERROR_DIR_NOT_EMPTY is a Windows error returned by syscall.Rmdir - // instead of syscall.ENOTEMPTY - ERROR_DIR_NOT_EMPTY = syscall.Errno(0x91) - - // ERROR_ALREADY_EXISTS is a Windows error returned by os.Mkdir - // instead of syscall.EEXIST - ERROR_ALREADY_EXISTS = syscall.Errno(0xB7) - - // ERROR_DIRECTORY is a Windows error returned by syscall.Rmdir - // instead of syscall.ENOTDIR - ERROR_DIRECTORY = syscall.Errno(0x10B) -) - -// See https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699- -const ( - // ERROR_PRIVILEGE_NOT_HELD is a Windows error returned by os.Symlink - // instead of syscall.EPERM. - // - // Note: This can happen when trying to create symlinks w/o admin perms. - ERROR_PRIVILEGE_NOT_HELD = syscall.Errno(0x522) -) - -func adjustErrno(err syscall.Errno) syscall.Errno { - // Note: In windows, ERROR_PATH_NOT_FOUND(0x3) maps to syscall.ENOTDIR - switch err { - case ERROR_ALREADY_EXISTS: - return syscall.EEXIST - case ERROR_DIRECTORY: - return syscall.ENOTDIR - case ERROR_DIR_NOT_EMPTY: - return syscall.ENOTEMPTY - case ERROR_FILE_EXISTS: - return syscall.EEXIST - case ERROR_INVALID_HANDLE: - return syscall.EBADF - case ERROR_ACCESS_DENIED: - // POSIX read and write functions expect EBADF, not EACCES when not - // open for reading or writing. - return syscall.EBADF - case ERROR_PRIVILEGE_NOT_HELD: - return syscall.EPERM - case ERROR_NEGATIVE_SEEK, ERROR_INVALID_NAME: - return syscall.EINVAL - } - return err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/error.go b/vendor/github.com/tetratelabs/wazero/internal/platform/error.go deleted file mode 100644 index 3219e5265e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/error.go +++ /dev/null @@ -1,52 +0,0 @@ -package platform - -import ( - "io" - "io/fs" - "os" - "syscall" -) - -// UnwrapOSError returns a syscall.Errno or zero if the input is nil. -func UnwrapOSError(err error) syscall.Errno { - if err == nil { - return 0 - } - err = underlyingError(err) - if se, ok := err.(syscall.Errno); ok { - return adjustErrno(se) - } - // Below are all the fs.ErrXXX in fs.go. - // - // Note: Once we have our own file type, we should never see these. - switch err { - case nil, io.EOF: - return 0 // EOF is not a syscall.Errno - case fs.ErrInvalid: - return syscall.EINVAL - case fs.ErrPermission: - return syscall.EPERM - case fs.ErrExist: - return syscall.EEXIST - case fs.ErrNotExist: - return syscall.ENOENT - case fs.ErrClosed: - return syscall.EBADF - } - return syscall.EIO -} - -// underlyingError returns the underlying error if a well-known OS error type. -// -// This impl is basically the same as os.underlyingError in os/error.go -func underlyingError(err error) error { - switch err := err.(type) { - case *os.PathError: - return err.Err - case *os.LinkError: - return err.Err - case *os.SyscallError: - return err.Err - } - return err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset.go b/vendor/github.com/tetratelabs/wazero/internal/platform/fdset.go deleted file mode 100644 index 0e8a13d5c6..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset.go +++ /dev/null @@ -1,23 +0,0 @@ -package platform - -// Set adds the given fd to the set. -func (f *FdSet) Set(fd int) { - f.Bits[fd/nfdbits] |= (1 << (uintptr(fd) % nfdbits)) -} - -// Clear removes the given fd from the set. -func (f *FdSet) Clear(fd int) { - f.Bits[fd/nfdbits] &^= (1 << (uintptr(fd) % nfdbits)) -} - -// IsSet returns true when fd is in the set. -func (f *FdSet) IsSet(fd int) bool { - return f.Bits[fd/nfdbits]&(1<<(uintptr(fd)%nfdbits)) != 0 -} - -// Zero clears the set. -func (f *FdSet) Zero() { - for i := range f.Bits { - f.Bits[i] = 0 - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_darwin.go b/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_darwin.go deleted file mode 100644 index da52339cbc..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_darwin.go +++ /dev/null @@ -1,8 +0,0 @@ -package platform - -import "syscall" - -const nfdbits = 0x20 - -// FdSet re-exports syscall.FdSet with utility methods. -type FdSet syscall.FdSet diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_linux.go b/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_linux.go deleted file mode 100644 index f392caf4c1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_linux.go +++ /dev/null @@ -1,8 +0,0 @@ -package platform - -import "syscall" - -const nfdbits = 0x40 - -// FdSet re-exports syscall.FdSet with utility methods. -type FdSet syscall.FdSet diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_unsupported.go deleted file mode 100644 index b5aa3c1561..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/fdset_unsupported.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build !darwin && !linux - -package platform - -const nfdbits = 0x40 - -// FdSet mocks syscall.FdSet on systems that do not support it. -type FdSet struct { - Bits [16]int64 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go deleted file mode 100644 index 55906e827e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_linux.go +++ /dev/null @@ -1,76 +0,0 @@ -package platform - -import ( - "math/bits" - "os" - "sort" - "strconv" - "strings" - "syscall" -) - -const ( - // https://man7.org/linux/man-pages/man2/mmap.2.html - __MAP_HUGE_SHIFT = 26 - __MAP_HUGETLB = 0x40000 -) - -var hugePagesConfigs []hugePagesConfig - -type hugePagesConfig struct { - size int - flag int -} - -func (hpc *hugePagesConfig) match(size int) bool { - return (size & (hpc.size - 1)) == 0 -} - -func init() { - dirents, err := os.ReadDir("/sys/kernel/mm/hugepages/") - if err != nil { - return - } - - for _, dirent := range dirents { - name := dirent.Name() - if !strings.HasPrefix(name, "hugepages-") { - continue - } - if !strings.HasSuffix(name, "kB") { - continue - } - n, err := strconv.ParseUint(name[10:len(name)-2], 10, 64) - if err != nil { - continue - } - if bits.OnesCount64(n) != 1 { - continue - } - n *= 1024 - hugePagesConfigs = append(hugePagesConfigs, hugePagesConfig{ - size: int(n), - flag: int(bits.TrailingZeros64(n)<<__MAP_HUGE_SHIFT) | __MAP_HUGETLB, - }) - } - - sort.Slice(hugePagesConfigs, func(i, j int) bool { - return hugePagesConfigs[i].size > hugePagesConfigs[j].size - }) -} - -func mmapCodeSegment(size, prot int) ([]byte, error) { - flags := syscall.MAP_ANON | syscall.MAP_PRIVATE - - for _, hugePagesConfig := range hugePagesConfigs { - if hugePagesConfig.match(size) { - b, err := syscall.Mmap(-1, 0, size, prot, flags|hugePagesConfig.flag) - if err != nil { - continue - } - return b, nil - } - } - - return syscall.Mmap(-1, 0, size, prot, flags) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go deleted file mode 100644 index 620cdd3c65..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_other.go +++ /dev/null @@ -1,18 +0,0 @@ -// This uses syscall.Mprotect. Go's SDK only supports this on darwin and linux. -//go:build darwin || freebsd - -package platform - -import "syscall" - -func mmapCodeSegment(size, prot int) ([]byte, error) { - return syscall.Mmap( - -1, - 0, - size, - prot, - // Anonymous as this is not an actual file, but a memory, - // Private as this is in-process memory region. - syscall.MAP_ANON|syscall.MAP_PRIVATE, - ) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go deleted file mode 100644 index 03b6cc6018..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unix.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build darwin || linux || freebsd - -package platform - -import ( - "syscall" - "unsafe" -) - -const ( - mmapProtAMD64 = syscall.PROT_READ | syscall.PROT_WRITE | syscall.PROT_EXEC - mmapProtARM64 = syscall.PROT_READ | syscall.PROT_WRITE -) - -func munmapCodeSegment(code []byte) error { - return syscall.Munmap(code) -} - -// mmapCodeSegmentAMD64 gives all read-write-exec permission to the mmap region -// to enter the function. Otherwise, segmentation fault exception is raised. -func mmapCodeSegmentAMD64(size int) ([]byte, error) { - // The region must be RWX: RW for writing native codes, X for executing the region. - return mmapCodeSegment(size, mmapProtAMD64) -} - -// mmapCodeSegmentARM64 cannot give all read-write-exec permission to the mmap region. -// Otherwise, the mmap systemcall would raise an error. Here we give read-write -// to the region so that we can write contents at call-sites. Callers are responsible to -// execute MprotectRX on the returned buffer. -func mmapCodeSegmentARM64(size int) ([]byte, error) { - // The region must be RW: RW for writing native codes. - return mmapCodeSegment(size, mmapProtARM64) -} - -// MprotectRX is like syscall.Mprotect with RX permission, defined locally so that freebsd compiles. -func MprotectRX(b []byte) (err error) { - var _p0 unsafe.Pointer - if len(b) > 0 { - _p0 = unsafe.Pointer(&b[0]) - } - const prot = syscall.PROT_READ | syscall.PROT_EXEC - _, _, e1 := syscall.Syscall(syscall.SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) - if e1 != 0 { - err = syscall.Errno(e1) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go deleted file mode 100644 index b9de9a1f74..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_unsupported.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !(darwin || linux || freebsd || windows) - -package platform - -import ( - "fmt" - "runtime" -) - -var errUnsupported = fmt.Errorf("mmap unsupported on GOOS=%s. Use interpreter instead.", runtime.GOOS) - -func munmapCodeSegment(code []byte) error { - panic(errUnsupported) -} - -func mmapCodeSegmentAMD64(size int) ([]byte, error) { - panic(errUnsupported) -} - -func mmapCodeSegmentARM64(size int) ([]byte, error) { - panic(errUnsupported) -} - -func MprotectRX(b []byte) (err error) { - panic(errUnsupported) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go deleted file mode 100644 index fb8944b42d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mmap_windows.go +++ /dev/null @@ -1,106 +0,0 @@ -package platform - -import ( - "fmt" - "reflect" - "syscall" - "unsafe" -) - -var ( - kernel32 = syscall.NewLazyDLL("kernel32.dll") - procVirtualAlloc = kernel32.NewProc("VirtualAlloc") - procVirtualProtect = kernel32.NewProc("VirtualProtect") - procVirtualFree = kernel32.NewProc("VirtualFree") -) - -const ( - windows_MEM_COMMIT uintptr = 0x00001000 - windows_MEM_RELEASE uintptr = 0x00008000 - windows_PAGE_READWRITE uintptr = 0x00000004 - windows_PAGE_EXECUTE_READ uintptr = 0x00000020 - windows_PAGE_EXECUTE_READWRITE uintptr = 0x00000040 -) - -func munmapCodeSegment(code []byte) error { - return freeMemory(code) -} - -// allocateMemory commits the memory region via the "VirtualAlloc" function. -// See https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualalloc -func allocateMemory(size uintptr, protect uintptr) (uintptr, error) { - address := uintptr(0) // system determines where to allocate the region. - alloctype := windows_MEM_COMMIT - if r, _, err := procVirtualAlloc.Call(address, size, alloctype, protect); r == 0 { - return 0, fmt.Errorf("compiler: VirtualAlloc error: %w", ensureErr(err)) - } else { - return r, nil - } -} - -// freeMemory releases the memory region via the "VirtualFree" function. -// See https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualfree -func freeMemory(code []byte) error { - address := unsafe.Pointer(&code[0]) - size := uintptr(0) // size must be 0 because we're using MEM_RELEASE. - freetype := windows_MEM_RELEASE - if r, _, err := procVirtualFree.Call(uintptr(address), size, freetype); r == 0 { - return fmt.Errorf("compiler: VirtualFree error: %w", ensureErr(err)) - } - return nil -} - -func virtualProtect(address, size, newprotect uintptr, oldprotect *uint32) error { - if r, _, err := procVirtualProtect.Call(address, size, newprotect, uintptr(unsafe.Pointer(oldprotect))); r == 0 { - return fmt.Errorf("compiler: VirtualProtect error: %w", ensureErr(err)) - } - return nil -} - -func mmapCodeSegmentAMD64(size int) ([]byte, error) { - p, err := allocateMemory(uintptr(size), windows_PAGE_EXECUTE_READWRITE) - if err != nil { - return nil, err - } - - var mem []byte - sh := (*reflect.SliceHeader)(unsafe.Pointer(&mem)) - sh.Data = p - sh.Len = size - sh.Cap = size - return mem, err -} - -func mmapCodeSegmentARM64(size int) ([]byte, error) { - p, err := allocateMemory(uintptr(size), windows_PAGE_READWRITE) - if err != nil { - return nil, err - } - - var mem []byte - sh := (*reflect.SliceHeader)(unsafe.Pointer(&mem)) - sh.Data = p - sh.Len = size - sh.Cap = size - return mem, nil -} - -var old = uint32(windows_PAGE_READWRITE) - -func MprotectRX(b []byte) (err error) { - err = virtualProtect(uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), windows_PAGE_EXECUTE_READ, &old) - return -} - -// ensureErr returns syscall.EINVAL when the input error is nil. -// -// We are supposed to use "GetLastError" which is more precise, but it is not safe to execute in goroutines. While -// "GetLastError" is thread-local, goroutines are not pinned to threads. -// -// See https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror -func ensureErr(err error) error { - if err != nil { - return err - } - return syscall.EINVAL -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_other.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_other.go deleted file mode 100644 index 5be501c196..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_other.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build !(darwin || linux || freebsd) - -package platform - -func remapCodeSegmentAMD64(code []byte, size int) ([]byte, error) { - b, err := mmapCodeSegmentAMD64(size) - if err != nil { - return nil, err - } - copy(b, code) - mustMunmapCodeSegment(code) - return b, nil -} - -func remapCodeSegmentARM64(code []byte, size int) ([]byte, error) { - b, err := mmapCodeSegmentARM64(size) - if err != nil { - return nil, err - } - copy(b, code) - mustMunmapCodeSegment(code) - return b, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_unix.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_unix.go deleted file mode 100644 index 5017aaf7a4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/mremap_unix.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build darwin || linux || freebsd - -package platform - -func remapCodeSegmentAMD64(code []byte, size int) ([]byte, error) { - return remapCodeSegment(code, size, mmapProtAMD64) -} - -func remapCodeSegmentARM64(code []byte, size int) ([]byte, error) { - return remapCodeSegment(code, size, mmapProtARM64) -} - -func remapCodeSegment(code []byte, size, prot int) ([]byte, error) { - b, err := mmapCodeSegment(size, prot) - if err != nil { - return nil, err - } - copy(b, code) - mustMunmapCodeSegment(code) - return b, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/path.go b/vendor/github.com/tetratelabs/wazero/internal/platform/path.go deleted file mode 100644 index 361049ae25..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/path.go +++ /dev/null @@ -1,6 +0,0 @@ -//go:build !windows - -package platform - -// ToPosixPath returns the input, as only windows might return backslashes. -func ToPosixPath(in string) string { return in } diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go b/vendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go deleted file mode 100644 index 77c4187d95..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/path_windows.go +++ /dev/null @@ -1,17 +0,0 @@ -package platform - -import "strings" - -// ToPosixPath returns the input, converting any backslashes to forward ones. -func ToPosixPath(in string) string { - // strings.Map only allocates on change, which is good enough especially as - // path.Join uses forward slash even on windows. - return strings.Map(windowsToPosixSeparator, in) -} - -func windowsToPosixSeparator(r rune) rune { - if r == '\\' { - return '/' - } - return r -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go b/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go deleted file mode 100644 index 267db88098..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/platform.go +++ /dev/null @@ -1,85 +0,0 @@ -// Package platform includes runtime-specific code needed for the compiler or otherwise. -// -// Note: This is a dependency-free alternative to depending on parts of Go's x/sys. -// See /RATIONALE.md for more context. -package platform - -import ( - "runtime" - "strings" -) - -// TODO: IsAtLeastGo120 -var IsGo120 = strings.Contains(runtime.Version(), "go1.20") - -// archRequirementsVerified is set by platform-specific init to true if the platform is supported -var archRequirementsVerified bool - -// CompilerSupported is exported for tests and includes constraints here and also the assembler. -func CompilerSupported() bool { - switch runtime.GOOS { - case "darwin", "windows", "linux", "freebsd": - default: - return false - } - - return archRequirementsVerified -} - -// MmapCodeSegment copies the code into the executable region and returns the byte slice of the region. -// -// See https://man7.org/linux/man-pages/man2/mmap.2.html for mmap API and flags. -func MmapCodeSegment(size int) ([]byte, error) { - if size == 0 { - panic("BUG: MmapCodeSegment with zero length") - } - if runtime.GOARCH == "amd64" { - return mmapCodeSegmentAMD64(size) - } else { - return mmapCodeSegmentARM64(size) - } -} - -// RemapCodeSegment reallocates the memory mapping of an existing code segment -// to increase its size. The previous code mapping is unmapped and must not be -// reused after the function returns. -// -// This is similar to mremap(2) on linux, and emulated on platforms which do not -// have this syscall. -// -// See https://man7.org/linux/man-pages/man2/mremap.2.html -func RemapCodeSegment(code []byte, size int) ([]byte, error) { - if size < len(code) { - panic("BUG: RemapCodeSegment with size less than code") - } - if code == nil { - return MmapCodeSegment(size) - } - if runtime.GOARCH == "amd64" { - return remapCodeSegmentAMD64(code, size) - } else { - return remapCodeSegmentARM64(code, size) - } -} - -// MunmapCodeSegment unmaps the given memory region. -func MunmapCodeSegment(code []byte) error { - if len(code) == 0 { - panic("BUG: MunmapCodeSegment with zero length") - } - return munmapCodeSegment(code) -} - -// mustMunmapCodeSegment panics instead of returning an error to the -// application. -// -// # Why panic? -// -// It is less disruptive to the application to leak the previous block if it -// could be unmapped than to leak the new block and return an error. -// Realistically, either scenarios are pretty hard to debug, so we panic. -func mustMunmapCodeSegment(code []byte) { - if err := munmapCodeSegment(code); err != nil { - panic(err) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/platform_amd64.go b/vendor/github.com/tetratelabs/wazero/internal/platform/platform_amd64.go deleted file mode 100644 index 4437e98f95..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/platform_amd64.go +++ /dev/null @@ -1,7 +0,0 @@ -package platform - -// init verifies that the current CPU supports the required AMD64 instructions -func init() { - // Ensure SSE4.1 is supported. - archRequirementsVerified = CpuFeatures.Has(CpuFeatureSSE4_1) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/platform_arm64.go b/vendor/github.com/tetratelabs/wazero/internal/platform/platform_arm64.go deleted file mode 100644 index caac58a3d8..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/platform_arm64.go +++ /dev/null @@ -1,7 +0,0 @@ -package platform - -// init verifies that the current CPU supports the required ARM64 features -func init() { - // No further checks currently needed. - archRequirementsVerified = true -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/time.go b/vendor/github.com/tetratelabs/wazero/internal/platform/time.go deleted file mode 100644 index fa9da1acb2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/time.go +++ /dev/null @@ -1,76 +0,0 @@ -package platform - -import ( - "sync/atomic" - "time" - - "github.com/tetratelabs/wazero/sys" -) - -const ( - ms = int64(time.Millisecond) - // FakeEpochNanos is midnight UTC 2022-01-01 and exposed for testing - FakeEpochNanos = 1640995200000 * ms -) - -// NewFakeWalltime implements sys.Walltime with FakeEpochNanos that increases by 1ms each reading. -// See /RATIONALE.md -func NewFakeWalltime() sys.Walltime { - // AddInt64 returns the new value. Adjust so the first reading will be FakeEpochNanos - t := FakeEpochNanos - ms - return func() (sec int64, nsec int32) { - wt := atomic.AddInt64(&t, ms) - return wt / 1e9, int32(wt % 1e9) - } -} - -// NewFakeNanotime implements sys.Nanotime that increases by 1ms each reading. -// See /RATIONALE.md -func NewFakeNanotime() sys.Nanotime { - // AddInt64 returns the new value. Adjust so the first reading will be zero. - t := int64(0) - ms - return func() int64 { - return atomic.AddInt64(&t, ms) - } -} - -// FakeNanosleep implements sys.Nanosleep by returning without sleeping. -var FakeNanosleep = sys.Nanosleep(func(int64) {}) - -// FakeOsyield implements sys.Osyield by returning without yielding. -var FakeOsyield = sys.Osyield(func() {}) - -// Walltime implements sys.Walltime with time.Now. -// -// Note: This is only notably less efficient than it could be is reading -// runtime.walltime(). time.Now defensively reads nanotime also, just in case -// time.Since is used. This doubles the performance impact. However, wall time -// is likely to be read less frequently than Nanotime. Also, doubling the cost -// matters less on fast platforms that can return both in <=100ns. -func Walltime() (sec int64, nsec int32) { - t := time.Now() - return t.Unix(), int32(t.Nanosecond()) -} - -// nanoBase uses time.Now to ensure a monotonic clock reading on all platforms -// via time.Since. -var nanoBase = time.Now() - -// nanotimePortable implements sys.Nanotime with time.Since. -// -// Note: This is less efficient than it could be is reading runtime.nanotime(), -// Just to do that requires CGO. -func nanotimePortable() int64 { - return time.Since(nanoBase).Nanoseconds() -} - -// Nanotime implements sys.Nanotime with runtime.nanotime() if CGO is available -// and time.Since if not. -func Nanotime() int64 { - return nanotime() -} - -// Nanosleep implements sys.Nanosleep with time.Sleep. -func Nanosleep(ns int64) { - time.Sleep(time.Duration(ns)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go b/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go deleted file mode 100644 index ff01d90cea..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/time_cgo.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build cgo && !windows - -package platform - -import _ "unsafe" // for go:linkname - -// nanotime uses runtime.nanotime as it is available on all platforms and -// benchmarks faster than using time.Since. -// -//go:linkname nanotime runtime.nanotime -func nanotime() int64 diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/time_notcgo.go b/vendor/github.com/tetratelabs/wazero/internal/platform/time_notcgo.go deleted file mode 100644 index 0697b7c700..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/time_notcgo.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !cgo && !windows - -package platform - -func nanotime() int64 { - return nanotimePortable() -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go b/vendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go deleted file mode 100644 index 58731fc8e7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/platform/time_windows.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build windows - -package platform - -import ( - "math/bits" - "time" - "unsafe" -) - -var ( - _QueryPerformanceCounter = kernel32.NewProc("QueryPerformanceCounter") - _QueryPerformanceFrequency = kernel32.NewProc("QueryPerformanceFrequency") -) - -var qpcfreq uint64 - -func init() { - _, _, _ = _QueryPerformanceFrequency.Call(uintptr(unsafe.Pointer(&qpcfreq))) -} - -// On Windows, time.Time handled in time package cannot have the nanosecond precision. -// The reason is that by default, it doesn't use QueryPerformanceCounter[1], but instead, use "interrupt time" -// which doesn't support nanoseconds precision (though it is a monotonic) [2, 3, 4, 5]. -// -// [1] https://learn.microsoft.com/en-us/windows/win32/api/profileapi/nf-profileapi-queryperformancecounter -// [2] https://github.com/golang/go/blob/0cd309e12818f988693bf8e4d9f1453331dcf9f2/src/runtime/sys_windows_amd64.s#L297-L298 -// [3] https://github.com/golang/go/blob/0cd309e12818f988693bf8e4d9f1453331dcf9f2/src/runtime/os_windows.go#L549-L551 -// [4] https://github.com/golang/go/blob/master/src/runtime/time_windows.h#L7-L13 -// [5] http://web.archive.org/web/20210411000829/https://wrkhpi.wordpress.com/2007/08/09/getting-os-information-the-kuser_shared_data-structure/ -// -// Therefore, on Windows, we directly invoke the syscall for QPC instead of time.Now or runtime.nanotime. -// See https://github.com/golang/go/issues/31160 for example. -func nanotime() int64 { - var counter uint64 - _, _, _ = _QueryPerformanceCounter.Call(uintptr(unsafe.Pointer(&counter))) - hi, lo := bits.Mul64(counter, uint64(time.Second)) - nanos, _ := bits.Div64(hi, lo, qpcfreq) - return int64(nanos) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sock/sock.go b/vendor/github.com/tetratelabs/wazero/internal/sock/sock.go deleted file mode 100644 index 6c0be1516b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sock/sock.go +++ /dev/null @@ -1,88 +0,0 @@ -package sock - -import ( - "fmt" - "net" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" -) - -// TCPSock is a pseudo-file representing a TCP socket. -type TCPSock interface { - fsapi.File - - Accept() (TCPConn, syscall.Errno) -} - -// TCPConn is a pseudo-file representing a TCP connection. -type TCPConn interface { - fsapi.File - - // Recvfrom only supports the flag sysfs.MSG_PEEK - Recvfrom(p []byte, flags int) (n int, errno syscall.Errno) - - Shutdown(how int) syscall.Errno -} - -// ConfigKey is a context.Context Value key. Its associated value should be a Config. -type ConfigKey struct{} - -// Config is an internal struct meant to implement -// the interface in experimental/sock/Config. -type Config struct { - // TCPAddresses is a slice of the configured host:port pairs. - TCPAddresses []TCPAddress -} - -// TCPAddress is a host:port pair to pre-open. -type TCPAddress struct { - // Host is the host name for this listener. - Host string - // Port is the port number for this listener. - Port int -} - -// WithTCPListener implements the method of the same name in experimental/sock/Config. -// -// However, to avoid cyclic dependencies, this is returning the *Config in this scope. -// The interface is implemented in experimental/sock/Config via delegation. -func (c *Config) WithTCPListener(host string, port int) *Config { - ret := c.clone() - ret.TCPAddresses = append(ret.TCPAddresses, TCPAddress{host, port}) - return &ret -} - -// Makes a deep copy of this sockConfig. -func (c *Config) clone() Config { - ret := *c - ret.TCPAddresses = make([]TCPAddress, 0, len(c.TCPAddresses)) - ret.TCPAddresses = append(ret.TCPAddresses, c.TCPAddresses...) - return ret -} - -// BuildTCPListeners build listeners from the current configuration. -func (c *Config) BuildTCPListeners() (tcpListeners []*net.TCPListener, err error) { - for _, tcpAddr := range c.TCPAddresses { - var ln net.Listener - ln, err = net.Listen("tcp", tcpAddr.String()) - if err != nil { - break - } - if tcpln, ok := ln.(*net.TCPListener); ok { - tcpListeners = append(tcpListeners, tcpln) - } - } - if err != nil { - // An error occurred, cleanup. - for _, l := range tcpListeners { - _ = l.Close() // Ignore errors, we are already cleaning. - } - tcpListeners = nil - } - return -} - -func (t TCPAddress) String() string { - return fmt.Sprintf("%s:%d", t.Host, t.Port) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/fs.go b/vendor/github.com/tetratelabs/wazero/internal/sys/fs.go deleted file mode 100644 index 3f1eb6e545..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/fs.go +++ /dev/null @@ -1,482 +0,0 @@ -package sys - -import ( - "io" - "io/fs" - "net" - "path" - "syscall" - - "github.com/tetratelabs/wazero/internal/descriptor" - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" - socketapi "github.com/tetratelabs/wazero/internal/sock" - "github.com/tetratelabs/wazero/internal/sysfs" -) - -const ( - FdStdin int32 = iota - FdStdout - FdStderr - // FdPreopen is the file descriptor of the first pre-opened directory. - // - // # Why file descriptor 3? - // - // While not specified, the most common WASI implementation, wasi-libc, - // expects POSIX style file descriptor allocation, where the lowest - // available number is used to open the next file. Since 1 and 2 are taken - // by stdout and stderr, the next is 3. - // - https://github.com/WebAssembly/WASI/issues/122 - // - https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_14 - // - https://github.com/WebAssembly/wasi-libc/blob/wasi-sdk-16/libc-bottom-half/sources/preopens.c#L215 - FdPreopen -) - -const modeDevice = fs.ModeDevice | 0o640 - -// FileEntry maps a path to an open file in a file system. -type FileEntry struct { - // Name is the name of the directory up to its pre-open, or the pre-open - // name itself when IsPreopen. - // - // # Notes - // - // - This can drift on rename. - // - This relates to the guest path, which is not the real file path - // except if the entire host filesystem was made available. - Name string - - // IsPreopen is a directory that is lazily opened. - IsPreopen bool - - // FS is the filesystem associated with the pre-open. - FS fsapi.FS - - // File is always non-nil. - File fsapi.File -} - -const direntBufSize = 16 - -// Readdir is the status of a prior fs.ReadDirFile call. -type Readdir struct { - // cursor is the current position in the buffer. - cursor uint64 - - // countRead is the total count of files read including Dirents. - // - // Notes: - // - // * countRead is the index of the next file in the list. This is - // also the value that Cookie returns, so it should always be - // higher or equal than the cookie given in Rewind. - // - // * this can overflow to negative, which means our implementation - // doesn't support writing greater than max int64 entries. - // countRead uint64 - countRead uint64 - - // dirents is a fixed buffer of size direntBufSize. Notably, - // directory listing are not rewindable, so we keep entries around in case - // the caller mis-estimated their buffer and needs a few still cached. - // - // Note: This is wasi-specific and needs to be refactored. - // In wasi preview1, dot and dot-dot entries are required to exist, but the - // reverse is true for preview2. More importantly, preview2 holds separate - // stateful dir-entry-streams per file. - dirents []fsapi.Dirent - - // dirInit seeks and reset the provider for dirents to the beginning - // and returns an initial batch (e.g. dot directories). - dirInit func() ([]fsapi.Dirent, syscall.Errno) - - // dirReader fetches a new batch of direntBufSize elements. - dirReader func(n uint64) ([]fsapi.Dirent, syscall.Errno) -} - -// NewReaddir is a constructor for Readdir. It takes a dirInit -func NewReaddir( - dirInit func() ([]fsapi.Dirent, syscall.Errno), - dirReader func(n uint64) ([]fsapi.Dirent, syscall.Errno), -) (*Readdir, syscall.Errno) { - d := &Readdir{dirReader: dirReader, dirInit: dirInit} - return d, d.init() -} - -// init resets the cursor and invokes the dirInit, dirReader -// methods to reset the internal state of the Readdir struct. -// -// Note: this is different from Reset, because it will not short-circuit -// when cursor is already 0, but it will force an unconditional reload. -func (d *Readdir) init() syscall.Errno { - d.cursor = 0 - d.countRead = 0 - // Reset the buffer to the initial state. - initialDirents, errno := d.dirInit() - if errno != 0 { - return errno - } - if len(initialDirents) > direntBufSize { - return syscall.EINVAL - } - d.dirents = initialDirents - // Fill the buffer with more data. - count := direntBufSize - len(initialDirents) - if count == 0 { - // No need to fill up the buffer further. - return 0 - } - dirents, errno := d.dirReader(uint64(count)) - if errno != 0 { - return errno - } - d.dirents = append(d.dirents, dirents...) - return 0 -} - -// newReaddirFromFileEntry is a constructor for Readdir that takes a FileEntry to initialize. -func newReaddirFromFileEntry(f *FileEntry) (*Readdir, syscall.Errno) { - // Generate the dotEntries only once and return it many times in the dirInit closure. - dotEntries, errno := synthesizeDotEntries(f) - if errno != 0 { - return nil, errno - } - dirInit := func() ([]fsapi.Dirent, syscall.Errno) { - // Ensure we always rewind to the beginning when we re-init. - if _, errno := f.File.Seek(0, io.SeekStart); errno != 0 { - return nil, errno - } - // Return the dotEntries that we have already generated outside the closure. - return dotEntries, 0 - } - dirReader := func(n uint64) ([]fsapi.Dirent, syscall.Errno) { return f.File.Readdir(int(n)) } - return NewReaddir(dirInit, dirReader) -} - -// synthesizeDotEntries generates a slice of the two elements "." and "..". -func synthesizeDotEntries(f *FileEntry) (result []fsapi.Dirent, errno syscall.Errno) { - dotIno, errno := f.File.Ino() - if errno != 0 { - return nil, errno - } - result = append(result, fsapi.Dirent{Name: ".", Ino: dotIno, Type: fs.ModeDir}) - dotDotIno := uint64(0) - if !f.IsPreopen && f.Name != "." { - if st, errno := f.FS.Stat(path.Dir(f.Name)); errno != 0 { - return nil, errno - } else { - dotDotIno = st.Ino - } - } - result = append(result, fsapi.Dirent{Name: "..", Ino: dotDotIno, Type: fs.ModeDir}) - return result, 0 -} - -// Reset seeks the internal cursor to 0 and refills the buffer. -func (d *Readdir) Reset() syscall.Errno { - if d.countRead == 0 { - return 0 - } - return d.init() -} - -// Skip is equivalent to calling n times Advance. -func (d *Readdir) Skip(n uint64) { - end := d.countRead + n - var err syscall.Errno = 0 - for d.countRead < end && err == 0 { - err = d.Advance() - } -} - -// Cookie returns a cookie representing the current state of the ReadDir struct. -// -// Note: this returns the countRead field, but it is an implementation detail. -func (d *Readdir) Cookie() uint64 { - return d.countRead -} - -// Rewind seeks the internal cursor to the state represented by the cookie. -// It returns a syscall.Errno if the cursor was reset and an I/O error occurred while trying to re-init. -func (d *Readdir) Rewind(cookie int64) syscall.Errno { - unsignedCookie := uint64(cookie) - switch { - case cookie < 0 || unsignedCookie > d.countRead: - // the cookie can neither be negative nor can it be larger than countRead. - return syscall.EINVAL - case cookie == 0 && d.countRead == 0: - return 0 - case cookie == 0 && d.countRead != 0: - // This means that there was a previous call to the dir, but cookie is reset. - // This happens when the program calls rewinddir, for example: - // https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/cloudlibc/src/libc/dirent/rewinddir.c#L10-L12 - return d.Reset() - case unsignedCookie < d.countRead: - if cookie/direntBufSize != int64(d.countRead)/direntBufSize { - // The cookie is not 0, but it points into a window before the current one. - return syscall.ENOSYS - } - // We are allowed to rewind back to a previous offset within the current window. - d.countRead = unsignedCookie - d.cursor = d.countRead % direntBufSize - return 0 - default: - // The cookie is valid. - return 0 - } -} - -// Peek emits the current value. -// It returns syscall.ENOENT when there are no entries left in the directory. -func (d *Readdir) Peek() (*fsapi.Dirent, syscall.Errno) { - switch { - case d.cursor == uint64(len(d.dirents)): - // We're past the buf size, fill it up again. - dirents, errno := d.dirReader(direntBufSize) - if errno != 0 { - return nil, errno - } - d.dirents = append(d.dirents, dirents...) - fallthrough - default: // d.cursor < direntBufSize FIXME - if d.cursor == uint64(len(d.dirents)) { - return nil, syscall.ENOENT - } - dirent := &d.dirents[d.cursor] - return dirent, 0 - } -} - -// Advance advances the internal counters and indices to the next value. -// It also empties and refill the buffer with the next set of values when the internal cursor -// reaches the end of it. -func (d *Readdir) Advance() syscall.Errno { - if d.cursor == uint64(len(d.dirents)) { - return syscall.ENOENT - } - d.cursor++ - d.countRead++ - return 0 -} - -type FSContext struct { - // rootFS is the root ("/") mount. - rootFS fsapi.FS - - // openedFiles is a map of file descriptor numbers (>=FdPreopen) to open files - // (or directories) and defaults to empty. - // TODO: This is unguarded, so not goroutine-safe! - openedFiles FileTable - - // readdirs is a map of numeric identifiers to Readdir structs - // and defaults to empty. - // TODO: This is unguarded, so not goroutine-safe! - readdirs ReaddirTable -} - -// FileTable is a specialization of the descriptor.Table type used to map file -// descriptors to file entries. -type FileTable = descriptor.Table[int32, *FileEntry] - -// ReaddirTable is a specialization of the descriptor.Table type used to map file -// descriptors to Readdir structs. -type ReaddirTable = descriptor.Table[int32, *Readdir] - -// RootFS returns the underlying filesystem. Any files that should be added to -// the table should be inserted via InsertFile. -func (c *FSContext) RootFS() fsapi.FS { - return c.rootFS -} - -// OpenFile opens the file into the table and returns its file descriptor. -// The result must be closed by CloseFile or Close. -func (c *FSContext) OpenFile(fs fsapi.FS, path string, flag int, perm fs.FileMode) (int32, syscall.Errno) { - if f, errno := fs.OpenFile(path, flag, perm); errno != 0 { - return 0, errno - } else { - fe := &FileEntry{FS: fs, File: f} - if path == "/" || path == "." { - fe.Name = "" - } else { - fe.Name = path - } - if newFD, ok := c.openedFiles.Insert(fe); !ok { - return 0, syscall.EBADF - } else { - return newFD, 0 - } - } -} - -// SockAccept accepts a socketapi.TCPConn into the file table and returns -// its file descriptor. -func (c *FSContext) SockAccept(sockFD int32, nonblock bool) (int32, syscall.Errno) { - var sock socketapi.TCPSock - if e, ok := c.LookupFile(sockFD); !ok || !e.IsPreopen { - return 0, syscall.EBADF // Not a preopen - } else if sock, ok = e.File.(socketapi.TCPSock); !ok { - return 0, syscall.EBADF // Not a sock - } - - var conn socketapi.TCPConn - var errno syscall.Errno - if conn, errno = sock.Accept(); errno != 0 { - return 0, errno - } else if nonblock { - if errno = conn.SetNonblock(true); errno != 0 { - _ = conn.Close() - return 0, errno - } - } - - fe := &FileEntry{File: conn} - if newFD, ok := c.openedFiles.Insert(fe); !ok { - return 0, syscall.EBADF - } else { - return newFD, 0 - } -} - -// LookupFile returns a file if it is in the table. -func (c *FSContext) LookupFile(fd int32) (*FileEntry, bool) { - return c.openedFiles.Lookup(fd) -} - -// LookupReaddir returns a Readdir struct or creates an empty one if it was not present. -// -// Note: this currently assumes that idx == fd, where fd is the file descriptor of the directory. -// CloseFile will delete this idx from the internal store. In the future, idx may be independent -// of a file fd, and the idx may have to be disposed with an explicit CloseReaddir. -func (c *FSContext) LookupReaddir(idx int32, f *FileEntry) (*Readdir, syscall.Errno) { - if item, _ := c.readdirs.Lookup(idx); item != nil { - return item, 0 - } else { - item, err := newReaddirFromFileEntry(f) - if err != 0 { - return nil, err - } - ok := c.readdirs.InsertAt(item, idx) - if !ok { - return nil, syscall.EINVAL - } - return item, 0 - } -} - -// CloseReaddir delete the Readdir struct at the given index -// -// Note: Currently only necessary in tests. In the future, the idx will have to be disposed explicitly, -// unless we maintain a map fd -> []idx, and we let CloseFile close all the idx in []idx. -func (c *FSContext) CloseReaddir(idx int32) { - c.readdirs.Delete(idx) -} - -// Renumber assigns the file pointed by the descriptor `from` to `to`. -func (c *FSContext) Renumber(from, to int32) syscall.Errno { - fromFile, ok := c.openedFiles.Lookup(from) - if !ok || to < 0 { - return syscall.EBADF - } else if fromFile.IsPreopen { - return syscall.ENOTSUP - } - - // If toFile is already open, we close it to prevent windows lock issues. - // - // The doc is unclear and other implementations do nothing for already-opened To FDs. - // https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-fd_renumberfd-fd-to-fd---errno - // https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-common/src/snapshots/preview_1.rs#L531-L546 - if toFile, ok := c.openedFiles.Lookup(to); ok { - if toFile.IsPreopen { - return syscall.ENOTSUP - } - _ = toFile.File.Close() - } - - c.openedFiles.Delete(from) - if !c.openedFiles.InsertAt(fromFile, to) { - return syscall.EBADF - } - return 0 -} - -// CloseFile returns any error closing the existing file. -func (c *FSContext) CloseFile(fd int32) syscall.Errno { - f, ok := c.openedFiles.Lookup(fd) - if !ok { - return syscall.EBADF - } - c.openedFiles.Delete(fd) - c.readdirs.Delete(fd) - return platform.UnwrapOSError(f.File.Close()) -} - -// Close implements io.Closer -func (c *FSContext) Close() (err error) { - // Close any files opened in this context - c.openedFiles.Range(func(fd int32, entry *FileEntry) bool { - if errno := entry.File.Close(); errno != 0 { - err = errno // This means err returned == the last non-nil error. - } - return true - }) - // A closed FSContext cannot be reused so clear the state instead of - // using Reset. - c.openedFiles = FileTable{} - c.readdirs = ReaddirTable{} - return -} - -// NewFSContext creates a FSContext with stdio streams and an optional -// pre-opened filesystem. -// -// If `preopened` is not UnimplementedFS, it is inserted into -// the file descriptor table as FdPreopen. -func (c *Context) NewFSContext( - stdin io.Reader, - stdout, stderr io.Writer, - rootFS fsapi.FS, - tcpListeners []*net.TCPListener, -) (err error) { - c.fsc.rootFS = rootFS - inFile, err := stdinFileEntry(stdin) - if err != nil { - return err - } - c.fsc.openedFiles.Insert(inFile) - outWriter, err := stdioWriterFileEntry("stdout", stdout) - if err != nil { - return err - } - c.fsc.openedFiles.Insert(outWriter) - errWriter, err := stdioWriterFileEntry("stderr", stderr) - if err != nil { - return err - } - c.fsc.openedFiles.Insert(errWriter) - - if _, ok := rootFS.(fsapi.UnimplementedFS); ok { - // don't add to the pre-opens - } else if comp, ok := rootFS.(*sysfs.CompositeFS); ok { - preopens := comp.FS() - for i, p := range comp.GuestPaths() { - c.fsc.openedFiles.Insert(&FileEntry{ - FS: preopens[i], - Name: p, - IsPreopen: true, - File: &lazyDir{fs: rootFS}, - }) - } - } else { - c.fsc.openedFiles.Insert(&FileEntry{ - FS: rootFS, - Name: "/", - IsPreopen: true, - File: &lazyDir{fs: rootFS}, - }) - } - - for _, tl := range tcpListeners { - c.fsc.openedFiles.Insert(&FileEntry{IsPreopen: true, File: sysfs.NewTCPListenerFile(tl)}) - } - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/lazy.go b/vendor/github.com/tetratelabs/wazero/internal/sys/lazy.go deleted file mode 100644 index df68b51b6e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/lazy.go +++ /dev/null @@ -1,136 +0,0 @@ -package sys - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" -) - -// compile-time check to ensure lazyDir implements internalapi.File. -var _ fsapi.File = (*lazyDir)(nil) - -type lazyDir struct { - fsapi.DirFile - - fs fsapi.FS - f fsapi.File -} - -// Ino implements the same method as documented on internalapi.File -func (r *lazyDir) Ino() (uint64, syscall.Errno) { - if f, ok := r.file(); !ok { - return 0, syscall.EBADF - } else { - return f.Ino() - } -} - -// IsAppend implements the same method as documented on internalapi.File -func (r *lazyDir) IsAppend() bool { - return false -} - -// SetAppend implements the same method as documented on internalapi.File -func (r *lazyDir) SetAppend(bool) syscall.Errno { - return syscall.EISDIR -} - -// Seek implements the same method as documented on internalapi.File -func (r *lazyDir) Seek(offset int64, whence int) (newOffset int64, errno syscall.Errno) { - if f, ok := r.file(); !ok { - return 0, syscall.EBADF - } else { - return f.Seek(offset, whence) - } -} - -// Stat implements the same method as documented on internalapi.File -func (r *lazyDir) Stat() (fsapi.Stat_t, syscall.Errno) { - if f, ok := r.file(); !ok { - return fsapi.Stat_t{}, syscall.EBADF - } else { - return f.Stat() - } -} - -// Readdir implements the same method as documented on internalapi.File -func (r *lazyDir) Readdir(n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - if f, ok := r.file(); !ok { - return nil, syscall.EBADF - } else { - return f.Readdir(n) - } -} - -// Sync implements the same method as documented on internalapi.File -func (r *lazyDir) Sync() syscall.Errno { - if f, ok := r.file(); !ok { - return syscall.EBADF - } else { - return f.Sync() - } -} - -// Datasync implements the same method as documented on internalapi.File -func (r *lazyDir) Datasync() syscall.Errno { - if f, ok := r.file(); !ok { - return syscall.EBADF - } else { - return f.Datasync() - } -} - -// Chmod implements the same method as documented on internalapi.File -func (r *lazyDir) Chmod(mode fs.FileMode) syscall.Errno { - if f, ok := r.file(); !ok { - return syscall.EBADF - } else { - return f.Chmod(mode) - } -} - -// Chown implements the same method as documented on internalapi.File -func (r *lazyDir) Chown(uid, gid int) syscall.Errno { - if f, ok := r.file(); !ok { - return syscall.EBADF - } else { - return f.Chown(uid, gid) - } -} - -// Utimens implements the same method as documented on internalapi.File -func (r *lazyDir) Utimens(times *[2]syscall.Timespec) syscall.Errno { - if f, ok := r.file(); !ok { - return syscall.EBADF - } else { - return f.Utimens(times) - } -} - -// file returns the underlying file or false if it doesn't exist. -func (r *lazyDir) file() (fsapi.File, bool) { - if f := r.f; r.f != nil { - return f, true - } - var errno syscall.Errno - r.f, errno = r.fs.OpenFile(".", os.O_RDONLY, 0) - switch errno { - case 0: - return r.f, true - case syscall.ENOENT: - return nil, false - default: - panic(errno) // unexpected - } -} - -// Close implements fs.File -func (r *lazyDir) Close() syscall.Errno { - f := r.f - if f == nil { - return 0 // never opened - } - return f.Close() -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/stdio.go b/vendor/github.com/tetratelabs/wazero/internal/sys/stdio.go deleted file mode 100644 index c9e852c5eb..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/stdio.go +++ /dev/null @@ -1,121 +0,0 @@ -package sys - -import ( - "io" - "os" - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/internal/sysfs" -) - -// StdinFile is a fs.ModeDevice file for use implementing FdStdin. -// This is safer than reading from os.DevNull as it can never overrun -// operating system file descriptors. -type StdinFile struct { - noopStdinFile - io.Reader -} - -// Read implements the same method as documented on internalapi.File -func (f *StdinFile) Read(buf []byte) (int, syscall.Errno) { - n, err := f.Reader.Read(buf) - return n, platform.UnwrapOSError(err) -} - -type writerFile struct { - noopStdoutFile - - w io.Writer -} - -// Write implements the same method as documented on internalapi.File -func (f *writerFile) Write(buf []byte) (int, syscall.Errno) { - n, err := f.w.Write(buf) - return n, platform.UnwrapOSError(err) -} - -// noopStdinFile is a fs.ModeDevice file for use implementing FdStdin. This is -// safer than reading from os.DevNull as it can never overrun operating system -// file descriptors. -type noopStdinFile struct { - noopStdioFile -} - -// AccessMode implements the same method as documented on internalapi.File -func (noopStdinFile) AccessMode() int { - return syscall.O_RDONLY -} - -// Read implements the same method as documented on internalapi.File -func (noopStdinFile) Read([]byte) (int, syscall.Errno) { - return 0, 0 // Always EOF -} - -// PollRead implements the same method as documented on internalapi.File -func (noopStdinFile) PollRead(*time.Duration) (ready bool, errno syscall.Errno) { - return true, 0 // always ready to read nothing -} - -// noopStdoutFile is a fs.ModeDevice file for use implementing FdStdout and -// FdStderr. -type noopStdoutFile struct { - noopStdioFile -} - -// AccessMode implements the same method as documented on internalapi.File -func (noopStdoutFile) AccessMode() int { - return syscall.O_WRONLY -} - -// Write implements the same method as documented on internalapi.File -func (noopStdoutFile) Write(buf []byte) (int, syscall.Errno) { - return len(buf), 0 // same as io.Discard -} - -type noopStdioFile struct { - fsapi.UnimplementedFile -} - -// Stat implements the same method as documented on internalapi.File -func (noopStdioFile) Stat() (fsapi.Stat_t, syscall.Errno) { - return fsapi.Stat_t{Mode: modeDevice, Nlink: 1}, 0 -} - -// IsDir implements the same method as documented on internalapi.File -func (noopStdioFile) IsDir() (bool, syscall.Errno) { - return false, 0 -} - -// Close implements the same method as documented on internalapi.File -func (noopStdioFile) Close() (errno syscall.Errno) { return } - -func stdinFileEntry(r io.Reader) (*FileEntry, error) { - if r == nil { - return &FileEntry{Name: "stdin", IsPreopen: true, File: &noopStdinFile{}}, nil - } else if f, ok := r.(*os.File); ok { - if f, err := sysfs.NewStdioFile(true, f); err != nil { - return nil, err - } else { - return &FileEntry{Name: "stdin", IsPreopen: true, File: f}, nil - } - } else { - return &FileEntry{Name: "stdin", IsPreopen: true, File: &StdinFile{Reader: r}}, nil - } -} - -func stdioWriterFileEntry(name string, w io.Writer) (*FileEntry, error) { - if w == nil { - return &FileEntry{Name: name, IsPreopen: true, File: &noopStdoutFile{}}, nil - } else if f, ok := w.(*os.File); ok { - if f, err := sysfs.NewStdioFile(false, f); err != nil { - return nil, err - } else { - return &FileEntry{Name: name, IsPreopen: true, File: f}, nil - } - } else { - return &FileEntry{Name: name, IsPreopen: true, File: &writerFile{w: w}}, nil - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/sys.go b/vendor/github.com/tetratelabs/wazero/internal/sys/sys.go deleted file mode 100644 index f035712eee..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/sys.go +++ /dev/null @@ -1,232 +0,0 @@ -package sys - -import ( - "errors" - "fmt" - "io" - "net" - "time" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/sys" -) - -// Context holds module-scoped system resources currently only supported by -// built-in host functions. -type Context struct { - args, environ [][]byte - argsSize, environSize uint32 - - walltime sys.Walltime - walltimeResolution sys.ClockResolution - nanotime sys.Nanotime - nanotimeResolution sys.ClockResolution - nanosleep sys.Nanosleep - osyield sys.Osyield - randSource io.Reader - fsc FSContext -} - -// Args is like os.Args and defaults to nil. -// -// Note: The count will never be more than math.MaxUint32. -// See wazero.ModuleConfig WithArgs -func (c *Context) Args() [][]byte { - return c.args -} - -// ArgsSize is the size to encode Args as Null-terminated strings. -// -// Note: To get the size without null-terminators, subtract the length of Args from this value. -// See wazero.ModuleConfig WithArgs -// See https://en.wikipedia.org/wiki/Null-terminated_string -func (c *Context) ArgsSize() uint32 { - return c.argsSize -} - -// Environ are "key=value" entries like os.Environ and default to nil. -// -// Note: The count will never be more than math.MaxUint32. -// See wazero.ModuleConfig WithEnv -func (c *Context) Environ() [][]byte { - return c.environ -} - -// EnvironSize is the size to encode Environ as Null-terminated strings. -// -// Note: To get the size without null-terminators, subtract the length of Environ from this value. -// See wazero.ModuleConfig WithEnv -// See https://en.wikipedia.org/wiki/Null-terminated_string -func (c *Context) EnvironSize() uint32 { - return c.environSize -} - -// Walltime implements platform.Walltime. -func (c *Context) Walltime() (sec int64, nsec int32) { - return c.walltime() -} - -// WalltimeNanos returns platform.Walltime as epoch nanoseconds. -func (c *Context) WalltimeNanos() int64 { - sec, nsec := c.Walltime() - return (sec * time.Second.Nanoseconds()) + int64(nsec) -} - -// WalltimeResolution returns resolution of Walltime. -func (c *Context) WalltimeResolution() sys.ClockResolution { - return c.walltimeResolution -} - -// Nanotime implements sys.Nanotime. -func (c *Context) Nanotime() int64 { - return c.nanotime() -} - -// NanotimeResolution returns resolution of Nanotime. -func (c *Context) NanotimeResolution() sys.ClockResolution { - return c.nanotimeResolution -} - -// Nanosleep implements sys.Nanosleep. -func (c *Context) Nanosleep(ns int64) { - c.nanosleep(ns) -} - -// Osyield implements sys.Osyield. -func (c *Context) Osyield() { - c.osyield() -} - -// FS returns the possibly empty (UnimplementedFS) file system context. -func (c *Context) FS() *FSContext { - return &c.fsc -} - -// RandSource is a source of random bytes and defaults to a deterministic source. -// see wazero.ModuleConfig WithRandSource -func (c *Context) RandSource() io.Reader { - return c.randSource -} - -// DefaultContext returns Context with no values set except a possible nil -// fsapi.FS. -// -// Note: This is only used for testing. -func DefaultContext(fs fsapi.FS) *Context { - if sysCtx, err := NewContext(0, nil, nil, nil, nil, nil, nil, nil, 0, nil, 0, nil, nil, fs, nil); err != nil { - panic(fmt.Errorf("BUG: DefaultContext should never error: %w", err)) - } else { - return sysCtx - } -} - -// NewContext is a factory function which helps avoid needing to know defaults or exporting all fields. -// Note: max is exposed for testing. max is only used for env/args validation. -func NewContext( - max uint32, - args, environ [][]byte, - stdin io.Reader, - stdout, stderr io.Writer, - randSource io.Reader, - walltime sys.Walltime, - walltimeResolution sys.ClockResolution, - nanotime sys.Nanotime, - nanotimeResolution sys.ClockResolution, - nanosleep sys.Nanosleep, - osyield sys.Osyield, - rootFS fsapi.FS, - tcpListeners []*net.TCPListener, -) (sysCtx *Context, err error) { - sysCtx = &Context{args: args, environ: environ} - - if sysCtx.argsSize, err = nullTerminatedByteCount(max, args); err != nil { - return nil, fmt.Errorf("args invalid: %w", err) - } - - if sysCtx.environSize, err = nullTerminatedByteCount(max, environ); err != nil { - return nil, fmt.Errorf("environ invalid: %w", err) - } - - if randSource == nil { - sysCtx.randSource = platform.NewFakeRandSource() - } else { - sysCtx.randSource = randSource - } - - if walltime != nil { - if clockResolutionInvalid(walltimeResolution) { - return nil, fmt.Errorf("invalid Walltime resolution: %d", walltimeResolution) - } - sysCtx.walltime = walltime - sysCtx.walltimeResolution = walltimeResolution - } else { - sysCtx.walltime = platform.NewFakeWalltime() - sysCtx.walltimeResolution = sys.ClockResolution(time.Microsecond.Nanoseconds()) - } - - if nanotime != nil { - if clockResolutionInvalid(nanotimeResolution) { - return nil, fmt.Errorf("invalid Nanotime resolution: %d", nanotimeResolution) - } - sysCtx.nanotime = nanotime - sysCtx.nanotimeResolution = nanotimeResolution - } else { - sysCtx.nanotime = platform.NewFakeNanotime() - sysCtx.nanotimeResolution = sys.ClockResolution(time.Nanosecond) - } - - if nanosleep != nil { - sysCtx.nanosleep = nanosleep - } else { - sysCtx.nanosleep = platform.FakeNanosleep - } - - if osyield != nil { - sysCtx.osyield = osyield - } else { - sysCtx.osyield = platform.FakeOsyield - } - - if rootFS != nil { - err = sysCtx.NewFSContext(stdin, stdout, stderr, rootFS, tcpListeners) - } else { - err = sysCtx.NewFSContext(stdin, stdout, stderr, fsapi.UnimplementedFS{}, tcpListeners) - } - - return -} - -// clockResolutionInvalid returns true if the value stored isn't reasonable. -func clockResolutionInvalid(resolution sys.ClockResolution) bool { - return resolution < 1 || resolution > sys.ClockResolution(time.Hour.Nanoseconds()) -} - -// nullTerminatedByteCount ensures the count or Nul-terminated length of the elements doesn't exceed max, and that no -// element includes the nul character. -func nullTerminatedByteCount(max uint32, elements [][]byte) (uint32, error) { - count := uint32(len(elements)) - if count > max { - return 0, errors.New("exceeds maximum count") - } - - // The buffer size is the total size including null terminators. The null terminator count == value count, sum - // count with each value length. This works because in Go, the length of a string is the same as its byte count. - bufSize, maxSize := uint64(count), uint64(max) // uint64 to allow summing without overflow - for _, e := range elements { - // As this is null-terminated, We have to validate there are no null characters in the string. - for _, c := range e { - if c == 0 { - return 0, errors.New("contains NUL character") - } - } - - nextSize := bufSize + uint64(len(e)) - if nextSize > maxSize { - return 0, errors.New("exceeds maximum size") - } - bufSize = nextSize - - } - return uint32(bufSize), nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/empty.txt b/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/empty.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/sub/test.txt b/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/sub/test.txt deleted file mode 100644 index 75a0f48772..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/sub/test.txt +++ /dev/null @@ -1 +0,0 @@ -greet sub sub dir diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/test.txt b/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/test.txt deleted file mode 100644 index 4b45af5ed2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/sub/test.txt +++ /dev/null @@ -1 +0,0 @@ -greet sub dir diff --git a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/test.txt b/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/test.txt deleted file mode 100644 index fcb5845aa7..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sys/testdata/test.txt +++ /dev/null @@ -1 +0,0 @@ -animals diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go deleted file mode 100644 index 022ca69762..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/adapter.go +++ /dev/null @@ -1,78 +0,0 @@ -package sysfs - -import ( - "fmt" - "io/fs" - "path" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" -) - -// Adapt adapts the input to api.FS unless it is already one. Use NewDirFS instead -// of os.DirFS as it handles interop issues such as windows support. -// -// Note: This performs no flag verification on OpenFile. fsapi.FS cannot read -// flags as there is no parameter to pass them through with. Moreover, fsapi.FS -// documentation does not require the file to be present. In summary, we can't -// enforce flag behavior. -func Adapt(fs fs.FS) fsapi.FS { - if fs == nil { - return fsapi.UnimplementedFS{} - } - if sys, ok := fs.(fsapi.FS); ok { - return sys - } - return &adapter{fs: fs} -} - -type adapter struct { - fsapi.UnimplementedFS - fs fs.FS -} - -// String implements fmt.Stringer -func (a *adapter) String() string { - return fmt.Sprintf("%v", a.fs) -} - -// OpenFile implements the same method as documented on api.FS -func (a *adapter) OpenFile(path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - return OpenFSFile(a.fs, cleanPath(path), flag, perm) -} - -// Stat implements the same method as documented on api.FS -func (a *adapter) Stat(path string) (fsapi.Stat_t, syscall.Errno) { - f, errno := a.OpenFile(path, syscall.O_RDONLY, 0) - if errno != 0 { - return fsapi.Stat_t{}, errno - } - defer f.Close() - return f.Stat() -} - -// Lstat implements the same method as documented on api.FS -func (a *adapter) Lstat(path string) (fsapi.Stat_t, syscall.Errno) { - // At this time, we make the assumption that api.FS instances do not support - // symbolic links, therefore Lstat is the same as Stat. This is obviously - // not true but until api.FS has a solid story for how to handle symlinks we - // are better off not making a decision that would be difficult to revert - // later on. - // - // For further discussions on the topic, see: - // https://github.com/golang/go/issues/49580 - return a.Stat(path) -} - -func cleanPath(name string) string { - if len(name) == 0 { - return name - } - // fs.ValidFile cannot be rooted (start with '/') - cleaned := name - if name[0] == '/' { - cleaned = name[1:] - } - cleaned = path.Clean(cleaned) // e.g. "sub/." -> "sub" - return cleaned -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown.go deleted file mode 100644 index 93c774c923..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown.go +++ /dev/null @@ -1,30 +0,0 @@ -package sysfs - -import ( - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// Chown is like os.Chown, except it returns a syscall.Errno, not a -// fs.PathError. For example, this returns syscall.ENOENT if the path doesn't -// exist. A syscall.Errno of zero is success. -// -// Note: This always returns syscall.ENOSYS on windows. -// See https://linux.die.net/man/3/chown -func Chown(path string, uid, gid int) syscall.Errno { - err := os.Chown(path, uid, gid) - return platform.UnwrapOSError(err) -} - -// Lchown is like os.Lchown, except it returns a syscall.Errno, not a -// fs.PathError. For example, this returns syscall.ENOENT if the path doesn't -// exist. A syscall.Errno of zero is success. -// -// Note: This always returns syscall.ENOSYS on windows. -// See https://linux.die.net/man/3/lchown -func Lchown(path string, uid, gid int) syscall.Errno { - err := os.Lchown(path, uid, gid) - return platform.UnwrapOSError(err) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unix.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unix.go deleted file mode 100644 index 5907a9d980..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unix.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !windows - -package sysfs - -import ( - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func fchown(fd uintptr, uid, gid int) syscall.Errno { - return platform.UnwrapOSError(syscall.Fchown(int(fd), uid, gid)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unsupported.go deleted file mode 100644 index 5e7fd79be9..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/chown_unsupported.go +++ /dev/null @@ -1,11 +0,0 @@ -//go:build windows - -package sysfs - -import "syscall" - -// fchown is not supported on windows. For example, syscall.Fchown returns -// syscall.EWINDOWS, which is the same as syscall.ENOSYS. -func fchown(fd uintptr, uid, gid int) syscall.Errno { - return syscall.ENOSYS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go deleted file mode 100644 index 715a952dfa..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_linux.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build linux - -package sysfs - -import ( - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func datasync(f *os.File) syscall.Errno { - return platform.UnwrapOSError(syscall.Fdatasync(int(f.Fd()))) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go deleted file mode 100644 index 4261f56575..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/datasync_unsupported.go +++ /dev/null @@ -1,13 +0,0 @@ -//go:build !linux - -package sysfs - -import ( - "os" - "syscall" -) - -func datasync(f *os.File) syscall.Errno { - // Attempt to sync everything, even if we only need to sync the data. - return fsync(f) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go deleted file mode 100644 index 8462e846f8..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/dir.go +++ /dev/null @@ -1,26 +0,0 @@ -package sysfs - -import ( - "io" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func adjustReaddirErr(f fsapi.File, isClosed bool, err error) syscall.Errno { - if err == io.EOF { - return 0 // e.g. Readdir on darwin returns io.EOF, but linux doesn't. - } else if errno := platform.UnwrapOSError(err); errno != 0 { - errno = dirError(f, isClosed, errno) - // Ignore errors when the file was closed or removed. - switch errno { - case syscall.EIO, syscall.EBADF: // closed while open - return 0 - case syscall.ENOENT: // Linux error when removed while open - return 0 - } - return errno - } - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go deleted file mode 100644 index 5f2645de80..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/dirfs.go +++ /dev/null @@ -1,146 +0,0 @@ -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func NewDirFS(dir string) fsapi.FS { - return &dirFS{ - dir: dir, - cleanedDir: ensureTrailingPathSeparator(dir), - } -} - -func ensureTrailingPathSeparator(dir string) string { - if !os.IsPathSeparator(dir[len(dir)-1]) { - return dir + string(os.PathSeparator) - } - return dir -} - -type dirFS struct { - fsapi.UnimplementedFS - dir string - // cleanedDir is for easier OS-specific concatenation, as it always has - // a trailing path separator. - cleanedDir string -} - -// String implements fmt.Stringer -func (d *dirFS) String() string { - return d.dir -} - -// OpenFile implements the same method as documented on api.FS -func (d *dirFS) OpenFile(path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - return OpenOSFile(d.join(path), flag, perm) -} - -// Lstat implements the same method as documented on api.FS -func (d *dirFS) Lstat(path string) (fsapi.Stat_t, syscall.Errno) { - return lstat(d.join(path)) -} - -// Stat implements the same method as documented on api.FS -func (d *dirFS) Stat(path string) (fsapi.Stat_t, syscall.Errno) { - return stat(d.join(path)) -} - -// Mkdir implements the same method as documented on api.FS -func (d *dirFS) Mkdir(path string, perm fs.FileMode) (errno syscall.Errno) { - err := os.Mkdir(d.join(path), perm) - if errno = platform.UnwrapOSError(err); errno == syscall.ENOTDIR { - errno = syscall.ENOENT - } - return -} - -// Chmod implements the same method as documented on api.FS -func (d *dirFS) Chmod(path string, perm fs.FileMode) syscall.Errno { - err := os.Chmod(d.join(path), perm) - return platform.UnwrapOSError(err) -} - -// Chown implements the same method as documented on api.FS -func (d *dirFS) Chown(path string, uid, gid int) syscall.Errno { - return Chown(d.join(path), uid, gid) -} - -// Lchown implements the same method as documented on api.FS -func (d *dirFS) Lchown(path string, uid, gid int) syscall.Errno { - return Lchown(d.join(path), uid, gid) -} - -// Rename implements the same method as documented on api.FS -func (d *dirFS) Rename(from, to string) syscall.Errno { - from, to = d.join(from), d.join(to) - return Rename(from, to) -} - -// Readlink implements the same method as documented on api.FS -func (d *dirFS) Readlink(path string) (string, syscall.Errno) { - // Note: do not use syscall.Readlink as that causes race on Windows. - // In any case, syscall.Readlink does almost the same logic as os.Readlink. - dst, err := os.Readlink(d.join(path)) - if err != nil { - return "", platform.UnwrapOSError(err) - } - return platform.ToPosixPath(dst), 0 -} - -// Link implements the same method as documented on api.FS -func (d *dirFS) Link(oldName, newName string) syscall.Errno { - err := os.Link(d.join(oldName), d.join(newName)) - return platform.UnwrapOSError(err) -} - -// Rmdir implements the same method as documented on api.FS -func (d *dirFS) Rmdir(path string) syscall.Errno { - err := syscall.Rmdir(d.join(path)) - return platform.UnwrapOSError(err) -} - -// Unlink implements the same method as documented on api.FS -func (d *dirFS) Unlink(path string) (err syscall.Errno) { - return Unlink(d.join(path)) -} - -// Symlink implements the same method as documented on api.FS -func (d *dirFS) Symlink(oldName, link string) syscall.Errno { - // Note: do not resolve `oldName` relative to this dirFS. The link result is always resolved - // when dereference the `link` on its usage (e.g. readlink, read, etc). - // https://github.com/bytecodealliance/cap-std/blob/v1.0.4/cap-std/src/fs/dir.rs#L404-L409 - err := os.Symlink(oldName, d.join(link)) - return platform.UnwrapOSError(err) -} - -// Utimens implements the same method as documented on api.FS -func (d *dirFS) Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno { - return Utimens(d.join(path), times, symlinkFollow) -} - -// Truncate implements the same method as documented on api.FS -func (d *dirFS) Truncate(path string, size int64) syscall.Errno { - // Use os.Truncate as syscall.Truncate doesn't exist on Windows. - err := os.Truncate(d.join(path), size) - return platform.UnwrapOSError(err) -} - -func (d *dirFS) join(path string) string { - switch path { - case "", ".", "/": - if d.cleanedDir == "/" { - return "/" - } - // cleanedDir includes an unnecessary delimiter for the root path. - return d.cleanedDir[:len(d.cleanedDir)-1] - } - // TODO: Enforce similar to safefilepath.FromFS(path), but be careful as - // relative path inputs are allowed. e.g. dir or path == ../ - return d.cleanedDir + path -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/file.go deleted file mode 100644 index f4a7cbf8aa..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file.go +++ /dev/null @@ -1,434 +0,0 @@ -package sysfs - -import ( - "io" - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func NewStdioFile(stdin bool, f fs.File) (fsapi.File, error) { - // Return constant stat, which has fake times, but keep the underlying - // file mode. Fake times are needed to pass wasi-testsuite. - // https://github.com/WebAssembly/wasi-testsuite/blob/af57727/tests/rust/src/bin/fd_filestat_get.rs#L1-L19 - var mode fs.FileMode - if st, err := f.Stat(); err != nil { - return nil, err - } else { - mode = st.Mode() - } - var flag int - if stdin { - flag = syscall.O_RDONLY - } else { - flag = syscall.O_WRONLY - } - var file fsapi.File - if of, ok := f.(*os.File); ok { - // This is ok because functions that need path aren't used by stdioFile - file = newOsFile("", flag, 0, of) - } else { - file = &fsFile{file: f} - } - return &stdioFile{File: file, st: fsapi.Stat_t{Mode: mode, Nlink: 1}}, nil -} - -func OpenFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) { - if flag&fsapi.O_DIRECTORY != 0 && flag&(syscall.O_WRONLY|syscall.O_RDWR) != 0 { - return nil, syscall.EISDIR // invalid to open a directory writeable - } - return openFile(path, flag, perm) -} - -func OpenOSFile(path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - f, errno := OpenFile(path, flag, perm) - if errno != 0 { - return nil, errno - } - return newOsFile(path, flag, perm, f), 0 -} - -func OpenFSFile(fs fs.FS, path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - if flag&fsapi.O_DIRECTORY != 0 && flag&(syscall.O_WRONLY|syscall.O_RDWR) != 0 { - return nil, syscall.EISDIR // invalid to open a directory writeable - } - f, err := fs.Open(path) - if errno := platform.UnwrapOSError(err); errno != 0 { - return nil, errno - } - // Don't return an os.File because the path is not absolute. osFile needs - // the path to be real and certain fs.File impls are subrooted. - return &fsFile{fs: fs, name: path, file: f}, 0 -} - -type stdioFile struct { - fsapi.File - st fsapi.Stat_t -} - -// IsDir implements File.IsDir -func (f *stdioFile) IsDir() (bool, syscall.Errno) { - return false, 0 -} - -// Stat implements File.Stat -func (f *stdioFile) Stat() (fsapi.Stat_t, syscall.Errno) { - return f.st, 0 -} - -// Close implements File.Close -func (f *stdioFile) Close() syscall.Errno { - return 0 -} - -// fsFile is used for wrapped os.File, like os.Stdin or any fs.File -// implementation. Notably, this does not have access to the full file path. -// so certain operations can't be supported, such as inode lookups on Windows. -type fsFile struct { - fsapi.UnimplementedFile - - // fs is the file-system that opened the file, or nil when wrapped for - // pre-opens like stdio. - fs fs.FS - - // name is what was used in fs for Open, so it may not be the actual path. - name string - - // file is always set, possibly an os.File like os.Stdin. - file fs.File - - // closed is true when closed was called. This ensures proper syscall.EBADF - closed bool - - // cachedStat includes fields that won't change while a file is open. - cachedSt *cachedStat -} - -type cachedStat struct { - // fileType is the same as what's documented on Dirent. - fileType fs.FileMode - - // ino is the same as what's documented on Dirent. - ino uint64 -} - -// cachedStat returns the cacheable parts of platform.sys.Stat_t or an error if -// they couldn't be retrieved. -func (f *fsFile) cachedStat() (fileType fs.FileMode, ino uint64, errno syscall.Errno) { - if f.cachedSt == nil { - if _, errno = f.Stat(); errno != 0 { - return - } - } - return f.cachedSt.fileType, f.cachedSt.ino, 0 -} - -// Ino implements File.Ino -func (f *fsFile) Ino() (uint64, syscall.Errno) { - if _, ino, errno := f.cachedStat(); errno != 0 { - return 0, errno - } else { - return ino, 0 - } -} - -// IsAppend implements File.IsAppend -func (f *fsFile) IsAppend() bool { - return false -} - -// SetAppend implements File.SetAppend -func (f *fsFile) SetAppend(bool) (errno syscall.Errno) { - return fileError(f, f.closed, syscall.ENOSYS) -} - -// IsDir implements File.IsDir -func (f *fsFile) IsDir() (bool, syscall.Errno) { - if ft, _, errno := f.cachedStat(); errno != 0 { - return false, errno - } else if ft.Type() == fs.ModeDir { - return true, 0 - } - return false, 0 -} - -// Stat implements File.Stat -func (f *fsFile) Stat() (st fsapi.Stat_t, errno syscall.Errno) { - if f.closed { - errno = syscall.EBADF - return - } - - // While some functions in fsapi.File need the full path, especially in - // Windows, stat does not. Casting here allows os.DirFS to return inode - // information. - if of, ok := f.file.(*os.File); ok { - if st, errno = statFile(of); errno != 0 { - return - } - return f.cacheStat(st) - } else if t, err := f.file.Stat(); err != nil { - errno = platform.UnwrapOSError(err) - return - } else { - st = StatFromDefaultFileInfo(t) - return f.cacheStat(st) - } -} - -func (f *fsFile) cacheStat(st fsapi.Stat_t) (fsapi.Stat_t, syscall.Errno) { - f.cachedSt = &cachedStat{fileType: st.Mode & fs.ModeType, ino: st.Ino} - return st, 0 -} - -// Read implements File.Read -func (f *fsFile) Read(buf []byte) (n int, errno syscall.Errno) { - if n, errno = read(f.file, buf); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Pread implements File.Pread -func (f *fsFile) Pread(buf []byte, off int64) (n int, errno syscall.Errno) { - if ra, ok := f.file.(io.ReaderAt); ok { - if n, errno = pread(ra, buf, off); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return - } - - // See /RATIONALE.md "fd_pread: io.Seeker fallback when io.ReaderAt is not supported" - if rs, ok := f.file.(io.ReadSeeker); ok { - // Determine the current position in the file, as we need to revert it. - currentOffset, err := rs.Seek(0, io.SeekCurrent) - if err != nil { - return 0, fileError(f, f.closed, platform.UnwrapOSError(err)) - } - - // Put the read position back when complete. - defer func() { _, _ = rs.Seek(currentOffset, io.SeekStart) }() - - // If the current offset isn't in sync with this reader, move it. - if off != currentOffset { - if _, err = rs.Seek(off, io.SeekStart); err != nil { - return 0, fileError(f, f.closed, platform.UnwrapOSError(err)) - } - } - - n, err = rs.Read(buf) - if errno = platform.UnwrapOSError(err); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - } else { - errno = syscall.ENOSYS // unsupported - } - return -} - -// Seek implements File.Seek. -func (f *fsFile) Seek(offset int64, whence int) (newOffset int64, errno syscall.Errno) { - // If this is a directory, and we're attempting to seek to position zero, - // we have to re-open the file to ensure the directory state is reset. - var isDir bool - if offset == 0 && whence == io.SeekStart { - if isDir, errno = f.IsDir(); errno != 0 { - return - } else if isDir { - return 0, f.reopen() - } - } - - if s, ok := f.file.(io.Seeker); ok { - if newOffset, errno = seek(s, offset, whence); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - } else { - errno = syscall.ENOSYS // unsupported - } - return -} - -func (f *fsFile) reopen() syscall.Errno { - _ = f.close() - var err error - f.file, err = f.fs.Open(f.name) - return platform.UnwrapOSError(err) -} - -// Readdir implements File.Readdir. Notably, this uses fs.ReadDirFile if -// available. -func (f *fsFile) Readdir(n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - if of, ok := f.file.(*os.File); ok { - // We can't use f.name here because it is the path up to the fsapi.FS, - // not necessarily the real path. For this reason, Windows may not be - // able to populate inodes. However, Darwin and Linux will. - if dirents, errno = readdir(of, "", n); errno != 0 { - errno = adjustReaddirErr(f, f.closed, errno) - } - return - } - - // Try with fs.ReadDirFile which is available on api.FS implementations - // like embed:fs. - if rdf, ok := f.file.(fs.ReadDirFile); ok { - entries, e := rdf.ReadDir(n) - if errno = adjustReaddirErr(f, f.closed, e); errno != 0 { - return - } - dirents = make([]fsapi.Dirent, 0, len(entries)) - for _, e := range entries { - // By default, we don't attempt to read inode data - dirents = append(dirents, fsapi.Dirent{Name: e.Name(), Type: e.Type()}) - } - } else { - errno = syscall.ENOTDIR - } - return -} - -// Write implements File.Write -func (f *fsFile) Write(buf []byte) (n int, errno syscall.Errno) { - if w, ok := f.file.(io.Writer); ok { - if n, errno = write(w, buf); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - } else { - errno = syscall.ENOSYS // unsupported - } - return -} - -// Pwrite implements File.Pwrite -func (f *fsFile) Pwrite(buf []byte, off int64) (n int, errno syscall.Errno) { - if wa, ok := f.file.(io.WriterAt); ok { - if n, errno = pwrite(wa, buf, off); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - } else { - errno = syscall.ENOSYS // unsupported - } - return -} - -// Close implements File.Close -func (f *fsFile) Close() syscall.Errno { - if f.closed { - return 0 - } - f.closed = true - return f.close() -} - -func (f *fsFile) close() syscall.Errno { - return platform.UnwrapOSError(f.file.Close()) -} - -// dirError is used for commands that work against a directory, but not a file. -func dirError(f fsapi.File, isClosed bool, errno syscall.Errno) syscall.Errno { - if vErrno := validate(f, isClosed, false, true); vErrno != 0 { - return vErrno - } - return errno -} - -// fileError is used for commands that work against a file, but not a directory. -func fileError(f fsapi.File, isClosed bool, errno syscall.Errno) syscall.Errno { - if vErrno := validate(f, isClosed, true, false); vErrno != 0 { - return vErrno - } - return errno -} - -// validate is used to making syscalls which will fail. -func validate(f fsapi.File, isClosed, wantFile, wantDir bool) syscall.Errno { - if isClosed { - return syscall.EBADF - } - - isDir, errno := f.IsDir() - if errno != 0 { - return errno - } - - if wantFile && isDir { - return syscall.EISDIR - } else if wantDir && !isDir { - return syscall.ENOTDIR - } - return 0 -} - -func read(r io.Reader, buf []byte) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length reads. - } - - n, err := r.Read(buf) - return n, platform.UnwrapOSError(err) -} - -func pread(ra io.ReaderAt, buf []byte, off int64) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length reads. - } - - n, err := ra.ReadAt(buf, off) - return n, platform.UnwrapOSError(err) -} - -func seek(s io.Seeker, offset int64, whence int) (int64, syscall.Errno) { - if uint(whence) > io.SeekEnd { - return 0, syscall.EINVAL // negative or exceeds the largest valid whence - } - - newOffset, err := s.Seek(offset, whence) - return newOffset, platform.UnwrapOSError(err) -} - -func readdir(f *os.File, path string, n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - fis, e := f.Readdir(n) - if errno = platform.UnwrapOSError(e); errno != 0 { - return - } - - dirents = make([]fsapi.Dirent, 0, len(fis)) - - // linux/darwin won't have to fan out to lstat, but windows will. - var ino uint64 - for fi := range fis { - t := fis[fi] - if ino, errno = inoFromFileInfo(path, t); errno != 0 { - return - } - dirents = append(dirents, fsapi.Dirent{Name: t.Name(), Ino: ino, Type: t.Mode().Type()}) - } - return -} - -func write(w io.Writer, buf []byte) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length writes. - } - - n, err := w.Write(buf) - return n, platform.UnwrapOSError(err) -} - -func pwrite(w io.WriterAt, buf []byte, off int64) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // less overhead on zero-length writes. - } - - n, err := w.WriteAt(buf, off) - return n, platform.UnwrapOSError(err) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_test.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_test.go deleted file mode 100644 index 3f10c61269..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_test.go +++ /dev/null @@ -1,1061 +0,0 @@ -package sysfs - -import ( - "embed" - "io" - "io/fs" - "os" - "path" - "runtime" - "strings" - "syscall" - "testing" - gofstest "testing/fstest" - "time" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" - "github.com/tetratelabs/wazero/internal/testing/require" -) - -//go:embed file_test.go -var embedFS embed.FS - -var ( - //go:embed testdata - testdata embed.FS - wazeroFile = "wazero.txt" - emptyFile = "empty.txt" -) - -func TestStdioFileSetNonblock(t *testing.T) { - // Test using os.Pipe as it is known to support non-blocking reads. - r, w, err := os.Pipe() - require.NoError(t, err) - defer r.Close() - defer w.Close() - - rF, err := NewStdioFile(true, r) - require.NoError(t, err) - - errno := rF.SetNonblock(true) - require.EqualErrno(t, 0, errno) - require.True(t, rF.IsNonblock()) - - errno = rF.SetNonblock(false) - require.EqualErrno(t, 0, errno) - require.False(t, rF.IsNonblock()) -} - -func TestRegularFileSetNonblock(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("Nonblock on regular files is not supported on Windows") - } - - // Test using os.Pipe as it is known to support non-blocking reads. - r, w, err := os.Pipe() - require.NoError(t, err) - defer r.Close() - defer w.Close() - - rF := newOsFile("", syscall.O_RDONLY, 0, r) - - errno := rF.SetNonblock(true) - require.EqualErrno(t, 0, errno) - require.True(t, rF.IsNonblock()) - - // Read from the file without ever writing to it should not block. - buf := make([]byte, 8) - _, e := rF.Read(buf) - require.EqualErrno(t, syscall.EAGAIN, e) - - errno = rF.SetNonblock(false) - require.EqualErrno(t, 0, errno) - require.False(t, rF.IsNonblock()) -} - -func TestReadFdNonblock(t *testing.T) { - // Test using os.Pipe as it is known to support non-blocking reads. - r, w, err := os.Pipe() - require.NoError(t, err) - defer r.Close() - defer w.Close() - - fd := r.Fd() - err = setNonblock(fd, true) - require.NoError(t, err) - - // Read from the file without ever writing to it should not block. - buf := make([]byte, 8) - _, e := readFd(fd, buf) - if runtime.GOOS == "windows" { - require.EqualErrno(t, syscall.ENOSYS, e) - } else { - require.EqualErrno(t, syscall.EAGAIN, e) - } -} - -func TestFileSetAppend(t *testing.T) { - tmpDir := t.TempDir() - - fPath := path.Join(tmpDir, "file") - require.NoError(t, os.WriteFile(fPath, []byte("0123456789"), 0o600)) - - // Open without APPEND. - f, errno := OpenOSFile(fPath, os.O_RDWR, 0o600) - require.EqualErrno(t, 0, errno) - require.False(t, f.IsAppend()) - - // Set the APPEND flag. - require.EqualErrno(t, 0, f.SetAppend(true)) - require.True(t, f.IsAppend()) - - requireFileContent := func(exp string) { - buf, err := os.ReadFile(fPath) - require.NoError(t, err) - require.Equal(t, exp, string(buf)) - } - - // with O_APPEND flag, the data is appended to buffer. - _, errno = f.Write([]byte("wazero")) - require.EqualErrno(t, 0, errno) - requireFileContent("0123456789wazero") - - // Remove the APPEND flag. - require.EqualErrno(t, 0, f.SetAppend(false)) - require.False(t, f.IsAppend()) - - // without O_APPEND flag, the data writes at offset zero - _, errno = f.Write([]byte("wazero")) - require.EqualErrno(t, 0, errno) - requireFileContent("wazero6789wazero") -} - -func TestFileIno(t *testing.T) { - tmpDir := t.TempDir() - dirFS, embedFS, mapFS := dirEmbedMapFS(t, tmpDir) - - // get the expected inode - st, errno := stat(tmpDir) - require.EqualErrno(t, 0, errno) - - tests := []struct { - name string - fs fs.FS - expectedIno uint64 - }{ - {name: "os.DirFS", fs: dirFS, expectedIno: st.Ino}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - d, errno := OpenFSFile(tc.fs, ".", syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer d.Close() - - ino, errno := d.Ino() - require.EqualErrno(t, 0, errno) - if !canReadDirInode() { - tc.expectedIno = 0 - } - require.Equal(t, tc.expectedIno, ino) - }) - } - - t.Run("OS", func(t *testing.T) { - d, errno := OpenOSFile(tmpDir, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer d.Close() - - ino, errno := d.Ino() - require.EqualErrno(t, 0, errno) - if canReadDirInode() { - require.Equal(t, st.Ino, ino) - } else { - require.Zero(t, ino) - } - }) -} - -func canReadDirInode() bool { - if runtime.GOOS != "windows" { - return true - } else { - return strings.HasPrefix(runtime.Version(), "go1.20") - } -} - -func TestFileIsDir(t *testing.T) { - dirFS, embedFS, mapFS := dirEmbedMapFS(t, t.TempDir()) - - tests := []struct { - name string - fs fs.FS - }{ - {name: "os.DirFS", fs: dirFS}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - t.Run("file", func(t *testing.T) { - f, errno := OpenFSFile(tc.fs, wazeroFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - isDir, errno := f.IsDir() - require.EqualErrno(t, 0, errno) - require.False(t, isDir) - }) - - t.Run("dir", func(t *testing.T) { - d, errno := OpenFSFile(tc.fs, ".", syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer d.Close() - - isDir, errno := d.IsDir() - require.EqualErrno(t, 0, errno) - require.True(t, isDir) - }) - }) - } - - t.Run("OS dir", func(t *testing.T) { - d, errno := OpenOSFile(t.TempDir(), syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer d.Close() - - isDir, errno := d.IsDir() - require.EqualErrno(t, 0, errno) - require.True(t, isDir) - }) -} - -func TestFileReadAndPread(t *testing.T) { - dirFS, embedFS, mapFS := dirEmbedMapFS(t, t.TempDir()) - - tests := []struct { - name string - fs fs.FS - }{ - {name: "os.DirFS", fs: dirFS}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - buf := make([]byte, 3) - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - f, errno := OpenFSFile(tc.fs, wazeroFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - // The file should be readable (base case) - requireRead(t, f, buf) - require.Equal(t, "waz", string(buf)) - buf = buf[:] - - // We should be able to pread from zero also - requirePread(t, f, buf, 0) - require.Equal(t, "waz", string(buf)) - buf = buf[:] - - // If the offset didn't change, read should expect the next three chars. - requireRead(t, f, buf) - require.Equal(t, "ero", string(buf)) - buf = buf[:] - - // We should also be able pread from any offset - requirePread(t, f, buf, 2) - require.Equal(t, "zer", string(buf)) - }) - } -} - -func TestFilePollRead(t *testing.T) { - // Test using os.Pipe as it is known to support poll. - r, w, err := os.Pipe() - require.NoError(t, err) - defer r.Close() - defer w.Close() - - rF, err := NewStdioFile(true, r) - require.NoError(t, err) - buf := make([]byte, 10) - timeout := time.Duration(0) // return immediately - - // When there's nothing in the pipe, it isn't ready. - ready, errno := rF.PollRead(&timeout) - if runtime.GOOS == "windows" { - require.EqualErrno(t, syscall.ENOSYS, errno) - t.Skip("TODO: windows File.PollRead") - } - require.EqualErrno(t, 0, errno) - require.False(t, ready) - - // Write to the pipe to make the data available - expected := []byte("wazero") - _, err = w.Write([]byte("wazero")) - require.NoError(t, err) - - // We should now be able to poll ready - ready, errno = rF.PollRead(&timeout) - require.EqualErrno(t, 0, errno) - require.True(t, ready) - - // We should now be able to read from the pipe - n, errno := rF.Read(buf) - require.EqualErrno(t, 0, errno) - require.Equal(t, len(expected), n) - require.Equal(t, expected, buf[:len(expected)]) -} - -func requireRead(t *testing.T, f fsapi.File, buf []byte) { - n, errno := f.Read(buf) - require.EqualErrno(t, 0, errno) - require.Equal(t, len(buf), n) -} - -func requirePread(t *testing.T, f fsapi.File, buf []byte, off int64) { - n, errno := f.Pread(buf, off) - require.EqualErrno(t, 0, errno) - require.Equal(t, len(buf), n) -} - -func TestFileRead_empty(t *testing.T) { - dirFS, embedFS, mapFS := dirEmbedMapFS(t, t.TempDir()) - - tests := []struct { - name string - fs fs.FS - }{ - {name: "os.DirFS", fs: dirFS}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - buf := make([]byte, 3) - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - f, errno := OpenFSFile(tc.fs, emptyFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - t.Run("Read", func(t *testing.T) { - // We should be able to read an empty file - n, errno := f.Read(buf) - require.EqualErrno(t, 0, errno) - require.Zero(t, n) - }) - - t.Run("Pread", func(t *testing.T) { - n, errno := f.Pread(buf, 0) - require.EqualErrno(t, 0, errno) - require.Zero(t, n) - }) - }) - } -} - -type maskFS struct { - fs.FS -} - -func (m *maskFS) Open(name string) (fs.File, error) { - f, err := m.FS.Open(name) - return struct{ fs.File }{f}, err -} - -func TestFilePread_Unsupported(t *testing.T) { - embedFS, err := fs.Sub(testdata, "testdata") - require.NoError(t, err) - - f, errno := OpenFSFile(&maskFS{embedFS}, emptyFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - buf := make([]byte, 3) - _, errno = f.Pread(buf, 0) - require.EqualErrno(t, syscall.ENOSYS, errno) -} - -func TestFileRead_Errors(t *testing.T) { - // Create the file - path := path.Join(t.TempDir(), emptyFile) - - // Open the file write-only - flag := syscall.O_WRONLY | syscall.O_CREAT - f := requireOpenFile(t, path, flag, 0o600) - defer f.Close() - buf := make([]byte, 5) - - tests := []struct { - name string - fn func(fsapi.File) syscall.Errno - }{ - {name: "Read", fn: func(f fsapi.File) syscall.Errno { - _, errno := f.Read(buf) - return errno - }}, - {name: "Pread", fn: func(f fsapi.File) syscall.Errno { - _, errno := f.Pread(buf, 0) - return errno - }}, - } - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - t.Run("EBADF when not open for reading", func(t *testing.T) { - // The descriptor exists, but not open for reading - errno := tc.fn(f) - require.EqualErrno(t, syscall.EBADF, errno) - }) - testEISDIR(t, tc.fn) - }) - } -} - -func TestFileSeek(t *testing.T) { - dirFS, embedFS, mapFS := dirEmbedMapFS(t, t.TempDir()) - - tests := []struct { - name string - fs fs.FS - }{ - {name: "os.DirFS", fs: dirFS}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - buf := make([]byte, 3) - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - f, errno := OpenFSFile(tc.fs, wazeroFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - // Shouldn't be able to use an invalid whence - _, errno = f.Seek(0, io.SeekEnd+1) - require.EqualErrno(t, syscall.EINVAL, errno) - _, errno = f.Seek(0, -1) - require.EqualErrno(t, syscall.EINVAL, errno) - - // Shouldn't be able to seek before the file starts. - _, errno = f.Seek(-1, io.SeekStart) - require.EqualErrno(t, syscall.EINVAL, errno) - - requireRead(t, f, buf) // read 3 bytes - - // Seek to the start - newOffset, errno := f.Seek(0, io.SeekStart) - require.EqualErrno(t, 0, errno) - - // verify we can re-read from the beginning now. - require.Zero(t, newOffset) - requireRead(t, f, buf) // read 3 bytes again - require.Equal(t, "waz", string(buf)) - buf = buf[:] - - // Seek to the start with zero allows you to read it back. - newOffset, errno = f.Seek(0, io.SeekCurrent) - require.EqualErrno(t, 0, errno) - require.Equal(t, int64(3), newOffset) - - // Seek to the last two bytes - newOffset, errno = f.Seek(-2, io.SeekEnd) - require.EqualErrno(t, 0, errno) - - // verify we can read the last two bytes - require.Equal(t, int64(5), newOffset) - n, errno := f.Read(buf) - require.EqualErrno(t, 0, errno) - require.Equal(t, 2, n) - require.Equal(t, "o\n", string(buf[:2])) - - t.Run("directory seek to zero", func(t *testing.T) { - d, errno := OpenFSFile(tc.fs, ".", syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer d.Close() - - _, errno = d.Seek(0, io.SeekStart) - require.EqualErrno(t, 0, errno) - }) - }) - } - - t.Run("os.File directory seek to zero", func(t *testing.T) { - d := requireOpenFile(t, os.TempDir(), syscall.O_RDONLY|fsapi.O_DIRECTORY, 0o666) - defer d.Close() - - _, errno := d.Seek(0, io.SeekStart) - require.EqualErrno(t, 0, errno) - }) - - seekToZero := func(f fsapi.File) syscall.Errno { - _, errno := f.Seek(0, io.SeekStart) - return errno - } - testEBADFIfFileClosed(t, seekToZero) -} - -func requireSeek(t *testing.T, f fsapi.File, off int64, whence int) int64 { - n, errno := f.Seek(off, whence) - require.EqualErrno(t, 0, errno) - return n -} - -func TestFileSeek_empty(t *testing.T) { - dirFS, embedFS, mapFS := dirEmbedMapFS(t, t.TempDir()) - - tests := []struct { - name string - fs fs.FS - }{ - {name: "os.DirFS", fs: dirFS}, - {name: "embed.api.FS", fs: embedFS}, - {name: "fstest.MapFS", fs: mapFS}, - } - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - f, errno := OpenFSFile(tc.fs, emptyFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - t.Run("Start", func(t *testing.T) { - require.Zero(t, requireSeek(t, f, 0, io.SeekStart)) - }) - - t.Run("Current", func(t *testing.T) { - require.Zero(t, requireSeek(t, f, 0, io.SeekCurrent)) - }) - - t.Run("End", func(t *testing.T) { - require.Zero(t, requireSeek(t, f, 0, io.SeekEnd)) - }) - }) - } -} - -func TestFileSeek_Unsupported(t *testing.T) { - embedFS, err := fs.Sub(testdata, "testdata") - require.NoError(t, err) - - f, errno := OpenFSFile(&maskFS{embedFS}, emptyFile, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - _, errno = f.Seek(0, io.SeekCurrent) - require.EqualErrno(t, syscall.ENOSYS, errno) -} - -func TestFileWriteAndPwrite(t *testing.T) { - // fsapi.FS doesn't support writes, and there is no other built-in - // implementation except os.File. - path := path.Join(t.TempDir(), wazeroFile) - f := requireOpenFile(t, path, syscall.O_RDWR|os.O_CREATE, 0o600) - defer f.Close() - - text := "wazero" - buf := make([]byte, 3) - copy(buf, text[:3]) - - // The file should be writeable - requireWrite(t, f, buf) - - // We should be able to pwrite at gap - requirePwrite(t, f, buf, 6) - - copy(buf, text[3:]) - - // If the offset didn't change, the next chars will write after the - // first - requireWrite(t, f, buf) - - // We should be able to pwrite the same bytes as above - requirePwrite(t, f, buf, 9) - - // We should also be able to pwrite past the above. - requirePwrite(t, f, buf, 12) - - b, err := os.ReadFile(path) - require.NoError(t, err) - - // We expect to have written the text two and a half times: - // 1. Write: (file offset 0) "waz" - // 2. Pwrite: offset 6 "waz" - // 3. Write: (file offset 3) "ero" - // 4. Pwrite: offset 9 "ero" - // 4. Pwrite: offset 12 "ero" - require.Equal(t, "wazerowazeroero", string(b)) -} - -func requireWrite(t *testing.T, f fsapi.File, buf []byte) { - n, errno := f.Write(buf) - require.EqualErrno(t, 0, errno) - require.Equal(t, len(buf), n) -} - -func requirePwrite(t *testing.T, f fsapi.File, buf []byte, off int64) { - n, errno := f.Pwrite(buf, off) - require.EqualErrno(t, 0, errno) - require.Equal(t, len(buf), n) -} - -func TestFileWrite_empty(t *testing.T) { - // fsapi.FS doesn't support writes, and there is no other built-in - // implementation except os.File. - path := path.Join(t.TempDir(), emptyFile) - f := requireOpenFile(t, path, syscall.O_RDWR|os.O_CREATE, 0o600) - defer f.Close() - - tests := []struct { - name string - fn func(fsapi.File, []byte) (int, syscall.Errno) - }{ - {name: "Write", fn: func(f fsapi.File, buf []byte) (int, syscall.Errno) { - return f.Write(buf) - }}, - {name: "Pwrite from zero", fn: func(f fsapi.File, buf []byte) (int, syscall.Errno) { - return f.Pwrite(buf, 0) - }}, - {name: "Pwrite from 3", fn: func(f fsapi.File, buf []byte) (int, syscall.Errno) { - return f.Pwrite(buf, 3) - }}, - } - - var emptyBuf []byte - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - n, errno := tc.fn(f, emptyBuf) - require.EqualErrno(t, 0, errno) - require.Zero(t, n) - - // The file should be empty - b, err := os.ReadFile(path) - require.NoError(t, err) - require.Zero(t, len(b)) - }) - } -} - -func TestFileWrite_Unsupported(t *testing.T) { - embedFS, err := fs.Sub(testdata, "testdata") - require.NoError(t, err) - - // Use syscall.O_RDWR so that it fails due to type not flags - f, errno := OpenFSFile(&maskFS{embedFS}, wazeroFile, syscall.O_RDWR, 0) - require.EqualErrno(t, 0, errno) - defer f.Close() - - tests := []struct { - name string - fn func(fsapi.File, []byte) (int, syscall.Errno) - }{ - {name: "Write", fn: func(f fsapi.File, buf []byte) (int, syscall.Errno) { - return f.Write(buf) - }}, - {name: "Pwrite", fn: func(f fsapi.File, buf []byte) (int, syscall.Errno) { - return f.Pwrite(buf, 0) - }}, - } - - buf := []byte("wazero") - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - _, errno := tc.fn(f, buf) - require.EqualErrno(t, syscall.ENOSYS, errno) - }) - } -} - -func TestFileWrite_Errors(t *testing.T) { - // Create the file - path := path.Join(t.TempDir(), emptyFile) - of, err := os.Create(path) - require.NoError(t, err) - require.NoError(t, of.Close()) - - // Open the file read-only - flag := syscall.O_RDONLY - f := requireOpenFile(t, path, flag, 0o600) - defer f.Close() - buf := []byte("wazero") - - tests := []struct { - name string - fn func(fsapi.File) syscall.Errno - }{ - {name: "Write", fn: func(f fsapi.File) syscall.Errno { - _, errno := f.Write(buf) - return errno - }}, - {name: "Pwrite", fn: func(f fsapi.File) syscall.Errno { - _, errno := f.Pwrite(buf, 0) - return errno - }}, - } - - for _, tc := range tests { - tc := tc - - t.Run(tc.name, func(t *testing.T) { - t.Run("EBADF when not open for writing", func(t *testing.T) { - // The descriptor exists, but not open for writing - errno := tc.fn(f) - require.EqualErrno(t, syscall.EBADF, errno) - }) - testEISDIR(t, tc.fn) - }) - } -} - -func TestFileSync_NoError(t *testing.T) { - testSync_NoError(t, fsapi.File.Sync) -} - -func TestFileDatasync_NoError(t *testing.T) { - testSync_NoError(t, fsapi.File.Datasync) -} - -func testSync_NoError(t *testing.T, sync func(fsapi.File) syscall.Errno) { - roPath := "file_test.go" - ro, errno := OpenFSFile(embedFS, roPath, syscall.O_RDONLY, 0) - require.EqualErrno(t, 0, errno) - defer ro.Close() - - rwPath := path.Join(t.TempDir(), "datasync") - rw, errno := OpenOSFile(rwPath, syscall.O_CREAT|syscall.O_RDWR, 0o600) - require.EqualErrno(t, 0, errno) - defer rw.Close() - - tests := []struct { - name string - f fsapi.File - }{ - {name: "UnimplementedFile", f: fsapi.UnimplementedFile{}}, - {name: "File of read-only fs.File", f: ro}, - {name: "File of os.File", f: rw}, - } - - for _, tt := range tests { - tc := tt - - t.Run(tc.name, func(t *testing.T) { - require.EqualErrno(t, 0, sync(tc.f)) - }) - } -} - -func TestFileSync(t *testing.T) { - testSync(t, fsapi.File.Sync) -} - -func TestFileDatasync(t *testing.T) { - testSync(t, fsapi.File.Datasync) -} - -// testSync doesn't guarantee sync works because the operating system may -// sync anyway. There is no test in Go for syscall.Fdatasync, but closest is -// similar to below. Effectively, this only tests that things don't error. -func testSync(t *testing.T, sync func(fsapi.File) syscall.Errno) { - // Even though it is invalid, try to sync a directory - dPath := t.TempDir() - d := requireOpenFile(t, dPath, syscall.O_RDONLY, 0) - defer d.Close() - - errno := sync(d) - require.EqualErrno(t, 0, errno) - - fPath := path.Join(dPath, t.Name()) - - f := requireOpenFile(t, fPath, syscall.O_RDWR|os.O_CREATE, 0o600) - defer f.Close() - - expected := "hello world!" - - // Write the expected data - _, errno = f.Write([]byte(expected)) - require.EqualErrno(t, 0, errno) - - // Sync the data. - errno = sync(f) - require.EqualErrno(t, 0, errno) - - // Rewind while the file is still open. - _, errno = f.Seek(0, io.SeekStart) - require.EqualErrno(t, 0, errno) - - // Read data from the file - buf := make([]byte, 50) - n, errno := f.Read(buf) - require.EqualErrno(t, 0, errno) - - // It may be the case that sync worked. - require.Equal(t, expected, string(buf[:n])) - - // Windows allows you to sync a closed file - if runtime.GOOS != "windows" { - testEBADFIfFileClosed(t, sync) - testEBADFIfDirClosed(t, sync) - } -} - -func TestFileTruncate(t *testing.T) { - content := []byte("123456") - - tests := []struct { - name string - size int64 - expectedContent []byte - expectedErr error - }{ - { - name: "one less", - size: 5, - expectedContent: []byte("12345"), - }, - { - name: "same", - size: 6, - expectedContent: content, - }, - { - name: "zero", - size: 0, - expectedContent: []byte(""), - }, - { - name: "larger", - size: 106, - expectedContent: append(content, make([]byte, 100)...), - }, - } - - for _, tt := range tests { - tc := tt - t.Run(tc.name, func(t *testing.T) { - tmpDir := t.TempDir() - - fPath := path.Join(tmpDir, tc.name) - f := openForWrite(t, fPath, content) - defer f.Close() - - errno := f.Truncate(tc.size) - require.EqualErrno(t, 0, errno) - - actual, err := os.ReadFile(fPath) - require.NoError(t, err) - require.Equal(t, tc.expectedContent, actual) - }) - } - - truncateToZero := func(f fsapi.File) syscall.Errno { - return f.Truncate(0) - } - - if runtime.GOOS != "windows" { - // TODO: os.Truncate on windows passes even when closed - testEBADFIfFileClosed(t, truncateToZero) - } - - testEISDIR(t, truncateToZero) - - t.Run("negative", func(t *testing.T) { - tmpDir := t.TempDir() - - f := openForWrite(t, path.Join(tmpDir, "truncate"), content) - defer f.Close() - - errno := f.Truncate(-1) - require.EqualErrno(t, syscall.EINVAL, errno) - }) -} - -func TestFileUtimens(t *testing.T) { - switch runtime.GOOS { - case "linux", "darwin": // supported - case "freebsd": // TODO: support freebsd w/o CGO - case "windows": - if !platform.IsGo120 { - t.Skip("windows only works after Go 1.20") // TODO: possibly 1.19 ;) - } - default: // expect ENOSYS and callers need to fall back to Utimens - t.Skip("unsupported GOOS", runtime.GOOS) - } - - testUtimens(t, true) - - testEBADFIfFileClosed(t, func(f fsapi.File) syscall.Errno { - return f.Utimens(nil) - }) - testEBADFIfDirClosed(t, func(d fsapi.File) syscall.Errno { - return d.Utimens(nil) - }) -} - -func TestNewStdioFile(t *testing.T) { - // simulate regular file attached to stdin - f, err := os.CreateTemp(t.TempDir(), "somefile") - require.NoError(t, err) - defer f.Close() - - stdin, err := NewStdioFile(true, os.Stdin) - require.NoError(t, err) - stdinStat, err := os.Stdin.Stat() - require.NoError(t, err) - - stdinFile, err := NewStdioFile(true, f) - require.NoError(t, err) - - stdout, err := NewStdioFile(false, os.Stdout) - require.NoError(t, err) - stdoutStat, err := os.Stdout.Stat() - require.NoError(t, err) - - stdoutFile, err := NewStdioFile(false, f) - require.NoError(t, err) - - tests := []struct { - name string - f fsapi.File - // Depending on how the tests run, os.Stdin won't necessarily be a char - // device. We compare against an os.File, to account for this. - expectedType fs.FileMode - }{ - { - name: "stdin", - f: stdin, - expectedType: stdinStat.Mode().Type(), - }, - { - name: "stdin file", - f: stdinFile, - expectedType: 0, // normal file - }, - { - name: "stdout", - f: stdout, - expectedType: stdoutStat.Mode().Type(), - }, - { - name: "stdout file", - f: stdoutFile, - expectedType: 0, // normal file - }, - } - - for _, tt := range tests { - tc := tt - - t.Run(tc.name+" Stat", func(t *testing.T) { - st, errno := tc.f.Stat() - require.EqualErrno(t, 0, errno) - require.Equal(t, tc.expectedType, st.Mode&fs.ModeType) - require.Equal(t, uint64(1), st.Nlink) - - // Fake times are needed to pass wasi-testsuite. - // See https://github.com/WebAssembly/wasi-testsuite/blob/af57727/tests/rust/src/bin/fd_filestat_get.rs#L1-L19 - require.Zero(t, st.Ctim) - require.Zero(t, st.Mtim) - require.Zero(t, st.Atim) - }) - } -} - -func testEBADFIfDirClosed(t *testing.T, fn func(fsapi.File) syscall.Errno) bool { - return t.Run("EBADF if dir closed", func(t *testing.T) { - d := requireOpenFile(t, t.TempDir(), syscall.O_RDONLY, 0o755) - - // close the directory underneath - require.EqualErrno(t, 0, d.Close()) - - require.EqualErrno(t, syscall.EBADF, fn(d)) - }) -} - -func testEBADFIfFileClosed(t *testing.T, fn func(fsapi.File) syscall.Errno) bool { - return t.Run("EBADF if file closed", func(t *testing.T) { - tmpDir := t.TempDir() - - f := openForWrite(t, path.Join(tmpDir, "EBADF"), []byte{1, 2, 3, 4}) - - // close the file underneath - require.EqualErrno(t, 0, f.Close()) - - require.EqualErrno(t, syscall.EBADF, fn(f)) - }) -} - -func testEISDIR(t *testing.T, fn func(fsapi.File) syscall.Errno) bool { - return t.Run("EISDIR if directory", func(t *testing.T) { - f := requireOpenFile(t, os.TempDir(), syscall.O_RDONLY|fsapi.O_DIRECTORY, 0o666) - defer f.Close() - - require.EqualErrno(t, syscall.EISDIR, fn(f)) - }) -} - -func openForWrite(t *testing.T, path string, content []byte) fsapi.File { - require.NoError(t, os.WriteFile(path, content, 0o0666)) - f := requireOpenFile(t, path, syscall.O_RDWR, 0o666) - _, errno := f.Write(content) - require.EqualErrno(t, 0, errno) - return f -} - -func requireOpenFile(t *testing.T, path string, flag int, perm fs.FileMode) fsapi.File { - f, errno := OpenOSFile(path, flag, perm) - require.EqualErrno(t, 0, errno) - return f -} - -func dirEmbedMapFS(t *testing.T, tmpDir string) (fs.FS, fs.FS, fs.FS) { - embedFS, err := fs.Sub(testdata, "testdata") - require.NoError(t, err) - - f, err := embedFS.Open(wazeroFile) - require.NoError(t, err) - defer f.Close() - - bytes, err := io.ReadAll(f) - require.NoError(t, err) - - mapFS := gofstest.MapFS{ - emptyFile: &gofstest.MapFile{}, - wazeroFile: &gofstest.MapFile{Data: bytes}, - } - - // Write a file as can't open "testdata" in scratch tests because they - // can't read the original filesystem. - require.NoError(t, os.WriteFile(path.Join(tmpDir, emptyFile), nil, 0o600)) - require.NoError(t, os.WriteFile(path.Join(tmpDir, wazeroFile), bytes, 0o600)) - dirFS := os.DirFS(tmpDir) - return dirFS, embedFS, mapFS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go deleted file mode 100644 index e451df820b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unix.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build unix || darwin || linux - -package sysfs - -import ( - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -const NonBlockingFileIoSupported = true - -// readFd exposes syscall.Read. -func readFd(fd uintptr, buf []byte) (int, syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // Short-circuit 0-len reads. - } - n, err := syscall.Read(int(fd), buf) - errno := platform.UnwrapOSError(err) - return n, errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go deleted file mode 100644 index cb4bddb339..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/file_unsupported.go +++ /dev/null @@ -1,12 +0,0 @@ -//go:build !unix && !linux && !darwin - -package sysfs - -import "syscall" - -const NonBlockingFileIoSupported = false - -// readFd returns ENOSYS on unsupported platforms. -func readFd(fd uintptr, buf []byte) (int, syscall.Errno) { - return -1, syscall.ENOSYS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go deleted file mode 100644 index 1c2bceadc4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens.go +++ /dev/null @@ -1,132 +0,0 @@ -package sysfs - -import ( - "syscall" - "time" - "unsafe" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -const ( - // UTIME_NOW is a special syscall.Timespec NSec value used to set the - // file's timestamp to a value close to, but not greater than the current - // system time. - UTIME_NOW = _UTIME_NOW - - // UTIME_OMIT is a special syscall.Timespec NSec value used to avoid - // setting the file's timestamp. - UTIME_OMIT = _UTIME_OMIT -) - -// Utimens set file access and modification times on a path resolved to the -// current working directory, at nanosecond precision. -// -// # Parameters -// -// The `times` parameter includes the access and modification timestamps to -// assign. Special syscall.Timespec NSec values UTIME_NOW and UTIME_OMIT may be -// specified instead of real timestamps. A nil `times` parameter behaves the -// same as if both were set to UTIME_NOW. -// -// When the `symlinkFollow` parameter is true and the path is a symbolic link, -// the target of expanding that link is updated. -// -// # Errors -// -// A zero syscall.Errno is success. The below are expected otherwise: -// - syscall.ENOSYS: the implementation does not support this function. -// - syscall.EINVAL: `path` is invalid. -// - syscall.EEXIST: `path` exists and is a directory. -// - syscall.ENOTDIR: `path` exists and is a file. -// -// # Notes -// -// - This is like syscall.UtimesNano and `utimensat` with `AT_FDCWD` in -// POSIX. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html -func Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno { - err := utimens(path, times, symlinkFollow) - return platform.UnwrapOSError(err) -} - -var _zero uintptr //nolint:unused - -func timesToPtr(times *[2]syscall.Timespec) unsafe.Pointer { //nolint:unused - var _p0 unsafe.Pointer - if times != nil { - _p0 = unsafe.Pointer(×[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - return _p0 -} - -func utimensPortable(path string, times *[2]syscall.Timespec, symlinkFollow bool) error { //nolint:unused - if !symlinkFollow { - return syscall.ENOSYS - } - - // Handle when both inputs are current system time. - if times == nil || times[0].Nsec == UTIME_NOW && times[1].Nsec == UTIME_NOW { - ts := nowTimespec() - return syscall.UtimesNano(path, []syscall.Timespec{ts, ts}) - } - - // When both inputs are omitted, there is nothing to change. - if times[0].Nsec == UTIME_OMIT && times[1].Nsec == UTIME_OMIT { - return nil - } - - // Handle when neither input are special values - if times[0].Nsec != UTIME_NOW && times[1].Nsec != UTIME_NOW && - times[0].Nsec != UTIME_OMIT && times[1].Nsec != UTIME_OMIT { - return syscall.UtimesNano(path, times[:]) - } - - // Now, either atim or mtim is a special value, but not both. - - // Now, either one of the inputs is a special value, or neither. This means - // we don't have a risk of re-reading the clock or re-doing stat. - if atim, err := normalizeTimespec(path, times, 0); err != 0 { - return err - } else if mtim, err := normalizeTimespec(path, times, 1); err != 0 { - return err - } else { - return syscall.UtimesNano(path, []syscall.Timespec{atim, mtim}) - } -} - -func normalizeTimespec(path string, times *[2]syscall.Timespec, i int) (ts syscall.Timespec, err syscall.Errno) { //nolint:unused - switch times[i].Nsec { - case UTIME_NOW: // declined in Go per golang/go#31880. - ts = nowTimespec() - return - case UTIME_OMIT: - // UTIME_OMIT is expensive until progress is made in Go, as it requires a - // stat to read-back the value to re-apply. - // - https://github.com/golang/go/issues/32558. - // - https://go-review.googlesource.com/c/go/+/219638 (unmerged) - var st fsapi.Stat_t - if st, err = stat(path); err != 0 { - return - } - switch i { - case 0: - ts = syscall.NsecToTimespec(st.Atim) - case 1: - ts = syscall.NsecToTimespec(st.Mtim) - default: - panic("BUG") - } - return - default: // not special - ts = times[i] - return - } -} - -func nowTimespec() syscall.Timespec { //nolint:unused - now := time.Now().UnixNano() - return syscall.NsecToTimespec(now) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go deleted file mode 100644 index f4ede33778..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.go +++ /dev/null @@ -1,49 +0,0 @@ -package sysfs - -import ( - "syscall" - _ "unsafe" // for go:linkname -) - -const ( - _AT_FDCWD = -0x2 - _AT_SYMLINK_NOFOLLOW = 0x0020 - _UTIME_NOW = -1 - _UTIME_OMIT = -2 - SupportsSymlinkNoFollow = true -) - -//go:noescape -//go:linkname utimensat syscall.utimensat -func utimensat(dirfd int, path string, times *[2]syscall.Timespec, flags int) error - -func utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) error { - var flags int - if !symlinkFollow { - flags = _AT_SYMLINK_NOFOLLOW - } - return utimensat(_AT_FDCWD, path, times, flags) -} - -func futimens(fd uintptr, times *[2]syscall.Timespec) error { - _p0 := timesToPtr(times) - - // Warning: futimens only exists since High Sierra (10.13). - _, _, e1 := syscall_syscall6(libc_futimens_trampoline_addr, fd, uintptr(_p0), 0, 0, 0, 0) - if e1 != 0 { - return e1 - } - return nil -} - -// libc_futimens_trampoline_addr is the address of the -// `libc_futimens_trampoline` symbol, defined in `futimens_darwin.s`. -// -// We use this to invoke the syscall through syscall_syscall6 imported below. -var libc_futimens_trampoline_addr uintptr - -// Imports the futimens symbol from libc as `libc_futimens`. -// -// Note: CGO mechanisms are used in darwin regardless of the CGO_ENABLED value -// or the "cgo" build flag. See /RATIONALE.md for why. -//go:cgo_import_dynamic libc_futimens futimens "/usr/lib/libSystem.B.dylib" diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s deleted file mode 100644 index b86aecdf09..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_darwin.s +++ /dev/null @@ -1,8 +0,0 @@ -// lifted from golang.org/x/sys unix -#include "textflag.h" - -TEXT libc_futimens_trampoline<>(SB), NOSPLIT, $0-0 - JMP libc_futimens(SB) - -GLOBL ·libc_futimens_trampoline_addr(SB), RODATA, $8 -DATA ·libc_futimens_trampoline_addr(SB)/8, $libc_futimens_trampoline<>(SB) diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go deleted file mode 100644 index a7ae264d2b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_linux.go +++ /dev/null @@ -1,43 +0,0 @@ -package sysfs - -import ( - "syscall" - "unsafe" - _ "unsafe" // for go:linkname -) - -const ( - _AT_FDCWD = -0x64 - _AT_SYMLINK_NOFOLLOW = 0x100 - _UTIME_NOW = (1 << 30) - 1 - _UTIME_OMIT = (1 << 30) - 2 - SupportsSymlinkNoFollow = true -) - -func utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) (err error) { - var flags int - if !symlinkFollow { - flags = _AT_SYMLINK_NOFOLLOW - } - - var _p0 *byte - _p0, err = syscall.BytePtrFromString(path) - if err != nil { - return - } - return utimensat(_AT_FDCWD, uintptr(unsafe.Pointer(_p0)), times, flags) -} - -// On linux, implement futimens via utimensat with the NUL path. -func futimens(fd uintptr, times *[2]syscall.Timespec) error { - return utimensat(int(fd), 0 /* NUL */, times, 0) -} - -// utimensat is like syscall.utimensat special-cased to accept a NUL string for the path value. -func utimensat(dirfd int, strPtr uintptr, times *[2]syscall.Timespec, flags int) (err error) { - _, _, e1 := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(dirfd), strPtr, uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go deleted file mode 100644 index 60860e6c48..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_unsupported.go +++ /dev/null @@ -1,23 +0,0 @@ -//go:build !windows && !linux && !darwin - -package sysfs - -import "syscall" - -// Define values even if not used except as sentinels. -const ( - _UTIME_NOW = -1 - _UTIME_OMIT = -2 - SupportsSymlinkNoFollow = false -) - -func utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) error { - return utimensPortable(path, times, symlinkFollow) -} - -func futimens(fd uintptr, times *[2]syscall.Timespec) error { - // Go exports syscall.Futimes, which is microsecond granularity, and - // WASI tests expect nanosecond. We don't yet have a way to invoke the - // futimens syscall portably. - return syscall.ENOSYS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go deleted file mode 100644 index 39696067ee..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/futimens_windows.go +++ /dev/null @@ -1,72 +0,0 @@ -package sysfs - -import ( - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// Define values even if not used except as sentinels. -const ( - _UTIME_NOW = -1 - _UTIME_OMIT = -2 - SupportsSymlinkNoFollow = false -) - -func utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) error { - return utimensPortable(path, times, symlinkFollow) -} - -func futimens(fd uintptr, times *[2]syscall.Timespec) error { - // Before Go 1.20, ERROR_INVALID_HANDLE was returned for too many reasons. - // Kick out so that callers can use path-based operations instead. - if !platform.IsGo120 { - return syscall.ENOSYS - } - - // Per docs, zero isn't a valid timestamp as it cannot be differentiated - // from nil. In both cases, it is a marker like syscall.UTIME_OMIT. - // See https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfiletime - a, w := timespecToFiletime(times) - - if a == nil && w == nil { - return nil // both omitted, so nothing to change - } - - // Attempt to get the stat by handle, which works for normal files - h := syscall.Handle(fd) - - // Note: This returns ERROR_ACCESS_DENIED when the input is a directory. - return syscall.SetFileTime(h, nil, a, w) -} - -func timespecToFiletime(times *[2]syscall.Timespec) (a, w *syscall.Filetime) { - // Handle when both inputs are current system time. - if times == nil || times[0].Nsec == UTIME_NOW && times[1].Nsec == UTIME_NOW { - now := time.Now().UnixNano() - ft := syscall.NsecToFiletime(now) - return &ft, &ft - } - - // Now, either one of the inputs is current time, or neither. This - // means we don't have a risk of re-reading the clock. - a = timespecToFileTime(times, 0) - w = timespecToFileTime(times, 1) - return -} - -func timespecToFileTime(times *[2]syscall.Timespec, i int) *syscall.Filetime { - if times[i].Nsec == UTIME_OMIT { - return nil - } - - var nsec int64 - if times[i].Nsec == UTIME_NOW { - nsec = time.Now().UnixNano() - } else { - nsec = syscall.TimespecToNsec(times[i]) - } - ft := syscall.NsecToFiletime(nsec) - return &ft -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go deleted file mode 100644 index 1ac13e5397..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !windows - -package sysfs - -import "syscall" - -func setNonblock(fd uintptr, enable bool) error { - return syscall.SetNonblock(int(fd), enable) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go deleted file mode 100644 index d4a29ac331..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_windows.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build windows - -package sysfs - -import "syscall" - -func setNonblock(fd uintptr, enable bool) error { - return syscall.SetNonblock(syscall.Handle(fd), enable) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file.go deleted file mode 100644 index 473f8ca638..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !windows && !js && !illumos && !solaris - -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func newOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) fsapi.File { - return newDefaultOsFile(openPath, openFlag, openPerm, f) -} - -// OpenFile is like os.OpenFile except it returns syscall.Errno. A zero -// syscall.Errno is success. -func openFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) { - f, err := os.OpenFile(path, flag, perm) - // Note: This does not return a fsapi.File because fsapi.FS that returns - // one may want to hide the real OS path. For example, this is needed for - // pre-opens. - return f, platform.UnwrapOSError(err) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_js.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_js.go deleted file mode 100644 index e473acbe48..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_js.go +++ /dev/null @@ -1,19 +0,0 @@ -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func newOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) File { - return newDefaultOsFile(openPath, openFlag, openPerm, f) -} - -func openFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) { - flag &= ^(O_DIRECTORY | O_NOFOLLOW) // erase placeholders - f, err := os.OpenFile(path, flag, perm) - return f, platform.UnwrapOSError(err) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_sun.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_sun.go deleted file mode 100644 index e23b7185c2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_sun.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build illumos || solaris - -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func newOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) fsapi.File { - return newDefaultOsFile(openPath, openFlag, openPerm, f) -} - -func openFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) { - f, err := os.OpenFile(path, flag, perm) - return f, platform.UnwrapOSError(err) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go deleted file mode 100644 index d9297d7e8b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/open_file_windows.go +++ /dev/null @@ -1,199 +0,0 @@ -package sysfs - -import ( - "io/fs" - "os" - "strings" - "syscall" - "unsafe" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func newOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) fsapi.File { - return &windowsOsFile{ - osFile: osFile{path: openPath, flag: openFlag, perm: openPerm, file: f, fd: f.Fd()}, - } -} - -func openFile(path string, flag int, perm fs.FileMode) (*os.File, syscall.Errno) { - isDir := flag&fsapi.O_DIRECTORY > 0 - flag &= ^(fsapi.O_DIRECTORY | fsapi.O_NOFOLLOW) // erase placeholders - - // TODO: document why we are opening twice - fd, err := open(path, flag|syscall.O_CLOEXEC, uint32(perm)) - if err == nil { - return os.NewFile(uintptr(fd), path), 0 - } - - // TODO: Set FILE_SHARE_DELETE for directory as well. - f, err := os.OpenFile(path, flag, perm) - errno := platform.UnwrapOSError(err) - if errno == 0 { - return f, 0 - } - - switch errno { - case syscall.EINVAL: - // WASI expects ENOTDIR for a file path with a trailing slash. - if strings.HasSuffix(path, "/") { - errno = syscall.ENOTDIR - } - // To match expectations of WASI, e.g. TinyGo TestStatBadDir, return - // ENOENT, not ENOTDIR. - case syscall.ENOTDIR: - errno = syscall.ENOENT - case syscall.ENOENT: - if isSymlink(path) { - // Either symlink or hard link not found. We change the returned - // errno depending on if it is symlink or not to have consistent - // behavior across OSes. - if isDir { - // Dangling symlink dir must raise ENOTDIR. - errno = syscall.ENOTDIR - } else { - errno = syscall.ELOOP - } - } - } - return f, errno -} - -func isSymlink(path string) bool { - if st, e := os.Lstat(path); e == nil && st.Mode()&os.ModeSymlink != 0 { - return true - } - return false -} - -// # Differences from syscall.Open -// -// This code is based on syscall.Open from the below link with some differences -// https://github.com/golang/go/blame/go1.20/src/syscall/syscall_windows.go#L308-L379 -// -// - syscall.O_CREAT doesn't imply syscall.GENERIC_WRITE as that breaks -// flag expectations in wasi. -// - add support for setting FILE_SHARE_DELETE. -func open(path string, mode int, perm uint32) (fd syscall.Handle, err error) { - if len(path) == 0 { - return syscall.InvalidHandle, syscall.ERROR_FILE_NOT_FOUND - } - pathp, err := syscall.UTF16PtrFromString(path) - if err != nil { - return syscall.InvalidHandle, err - } - var access uint32 - switch mode & (syscall.O_RDONLY | syscall.O_WRONLY | syscall.O_RDWR) { - case syscall.O_RDONLY: - access = syscall.GENERIC_READ - case syscall.O_WRONLY: - access = syscall.GENERIC_WRITE - case syscall.O_RDWR: - access = syscall.GENERIC_READ | syscall.GENERIC_WRITE - } - if mode&syscall.O_APPEND != 0 { - access &^= syscall.GENERIC_WRITE - access |= syscall.FILE_APPEND_DATA - } - sharemode := uint32(syscall.FILE_SHARE_READ | syscall.FILE_SHARE_WRITE | syscall.FILE_SHARE_DELETE) - var sa *syscall.SecurityAttributes - if mode&syscall.O_CLOEXEC == 0 { - var _sa syscall.SecurityAttributes - _sa.Length = uint32(unsafe.Sizeof(sa)) - _sa.InheritHandle = 1 - sa = &_sa - } - var createmode uint32 - switch { - case mode&(syscall.O_CREAT|syscall.O_EXCL) == (syscall.O_CREAT | syscall.O_EXCL): - createmode = syscall.CREATE_NEW - case mode&(syscall.O_CREAT|syscall.O_TRUNC) == (syscall.O_CREAT | syscall.O_TRUNC): - createmode = syscall.CREATE_ALWAYS - case mode&syscall.O_CREAT == syscall.O_CREAT: - createmode = syscall.OPEN_ALWAYS - case mode&syscall.O_TRUNC == syscall.O_TRUNC: - createmode = syscall.TRUNCATE_EXISTING - default: - createmode = syscall.OPEN_EXISTING - } - var attrs uint32 = syscall.FILE_ATTRIBUTE_NORMAL - if perm&syscall.S_IWRITE == 0 { - attrs = syscall.FILE_ATTRIBUTE_READONLY - if createmode == syscall.CREATE_ALWAYS { - // We have been asked to create a read-only file. - // If the file already exists, the semantics of - // the Unix open system call is to preserve the - // existing permissions. If we pass CREATE_ALWAYS - // and FILE_ATTRIBUTE_READONLY to CreateFile, - // and the file already exists, CreateFile will - // change the file permissions. - // Avoid that to preserve the Unix semantics. - h, e := syscall.CreateFile(pathp, access, sharemode, sa, syscall.TRUNCATE_EXISTING, syscall.FILE_ATTRIBUTE_NORMAL, 0) - switch e { - case syscall.ERROR_FILE_NOT_FOUND, syscall.ERROR_PATH_NOT_FOUND: - // File does not exist. These are the same - // errors as Errno.Is checks for ErrNotExist. - // Carry on to create the file. - default: - // Success or some different error. - return h, e - } - } - } - - if platform.IsGo120 { - // This shouldn't be included before 1.20 to have consistent behavior. - // https://github.com/golang/go/commit/0f0aa5d8a6a0253627d58b3aa083b24a1091933f - if createmode == syscall.OPEN_EXISTING && access == syscall.GENERIC_READ { - // Necessary for opening directory handles. - attrs |= syscall.FILE_FLAG_BACKUP_SEMANTICS - } - } - - h, e := syscall.CreateFile(pathp, access, sharemode, sa, createmode, attrs, 0) - return h, e -} - -// windowsOsFile overrides osFile to special case directory handling in Windows. -type windowsOsFile struct { - osFile - - dirInitialized bool -} - -// Readdir implements File.Readdir -func (f *windowsOsFile) Readdir(n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - if errno = f.maybeInitDir(); errno != 0 { - return - } - - return f.osFile.Readdir(n) -} - -func (f *windowsOsFile) maybeInitDir() syscall.Errno { - if f.dirInitialized { - return 0 - } - - if isDir, errno := f.IsDir(); errno != 0 { - return errno - } else if !isDir { - return syscall.ENOTDIR - } - - // On Windows, once the directory is opened, changes to the directory are - // not visible on ReadDir on that already-opened file handle. - // - // To provide consistent behavior with other platforms, we re-open it. - if errno := f.osFile.Close(); errno != 0 { - return errno - } - newW, errno := openFile(f.path, f.flag, f.perm) - if errno != 0 { - return errno - } - f.osFile.file = newW - f.dirInitialized = true - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go deleted file mode 100644 index 95798f4820..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/osfile.go +++ /dev/null @@ -1,268 +0,0 @@ -package sysfs - -import ( - "io" - "io/fs" - "os" - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func newDefaultOsFile(openPath string, openFlag int, openPerm fs.FileMode, f *os.File) fsapi.File { - return &osFile{path: openPath, flag: openFlag, perm: openPerm, file: f, fd: f.Fd()} -} - -// osFile is a file opened with this package, and uses os.File or syscalls to -// implement api.File. -type osFile struct { - path string - flag int - perm fs.FileMode - file *os.File - fd uintptr - - // closed is true when closed was called. This ensures proper syscall.EBADF - closed bool - - // cachedStat includes fields that won't change while a file is open. - cachedSt *cachedStat -} - -// cachedStat returns the cacheable parts of platform.sys.Stat_t or an error if -// they couldn't be retrieved. -func (f *osFile) cachedStat() (fileType fs.FileMode, ino uint64, errno syscall.Errno) { - if f.cachedSt == nil { - if _, errno = f.Stat(); errno != 0 { - return - } - } - return f.cachedSt.fileType, f.cachedSt.ino, 0 -} - -// Ino implements the same method as documented on fsapi.File -func (f *osFile) Ino() (uint64, syscall.Errno) { - if _, ino, errno := f.cachedStat(); errno != 0 { - return 0, errno - } else { - return ino, 0 - } -} - -// IsAppend implements File.IsAppend -func (f *osFile) IsAppend() bool { - return f.flag&syscall.O_APPEND == syscall.O_APPEND -} - -// SetAppend implements the same method as documented on fsapi.File -func (f *osFile) SetAppend(enable bool) (errno syscall.Errno) { - if enable { - f.flag |= syscall.O_APPEND - } else { - f.flag &= ^syscall.O_APPEND - } - - // Clear any create flag, as we are re-opening, not re-creating. - f.flag &= ^syscall.O_CREAT - - // appendMode (bool) cannot be changed later, so we have to re-open the - // file. https://github.com/golang/go/blob/go1.20/src/os/file_unix.go#L60 - return fileError(f, f.closed, f.reopen()) -} - -func (f *osFile) reopen() (errno syscall.Errno) { - // Clear any create flag, as we are re-opening, not re-creating. - f.flag &= ^syscall.O_CREAT - - _ = f.close() - f.file, errno = OpenFile(f.path, f.flag, f.perm) - return -} - -// IsNonblock implements the same method as documented on fsapi.File -func (f *osFile) IsNonblock() bool { - return f.flag&fsapi.O_NONBLOCK == fsapi.O_NONBLOCK -} - -// SetNonblock implements the same method as documented on fsapi.File -func (f *osFile) SetNonblock(enable bool) (errno syscall.Errno) { - if enable { - f.flag |= fsapi.O_NONBLOCK - } else { - f.flag &= ^fsapi.O_NONBLOCK - } - if err := setNonblock(f.fd, enable); err != nil { - return fileError(f, f.closed, platform.UnwrapOSError(err)) - } - return 0 -} - -// IsDir implements the same method as documented on fsapi.File -func (f *osFile) IsDir() (bool, syscall.Errno) { - if ft, _, errno := f.cachedStat(); errno != 0 { - return false, errno - } else if ft.Type() == fs.ModeDir { - return true, 0 - } - return false, 0 -} - -// Stat implements the same method as documented on fsapi.File -func (f *osFile) Stat() (fsapi.Stat_t, syscall.Errno) { - if f.closed { - return fsapi.Stat_t{}, syscall.EBADF - } - - st, errno := statFile(f.file) - switch errno { - case 0: - f.cachedSt = &cachedStat{fileType: st.Mode & fs.ModeType, ino: st.Ino} - case syscall.EIO: - errno = syscall.EBADF - } - return st, errno -} - -// Read implements the same method as documented on fsapi.File -func (f *osFile) Read(buf []byte) (n int, errno syscall.Errno) { - if len(buf) == 0 { - return 0, 0 // Short-circuit 0-len reads. - } - if NonBlockingFileIoSupported && f.IsNonblock() { - n, errno = readFd(f.fd, buf) - } else { - n, errno = read(f.file, buf) - } - if errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Pread implements the same method as documented on fsapi.File -func (f *osFile) Pread(buf []byte, off int64) (n int, errno syscall.Errno) { - if n, errno = pread(f.file, buf, off); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Seek implements the same method as documented on fsapi.File -func (f *osFile) Seek(offset int64, whence int) (newOffset int64, errno syscall.Errno) { - if newOffset, errno = seek(f.file, offset, whence); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - - // If the error was trying to rewind a directory, re-open it. Notably, - // seeking to zero on a directory doesn't work on Windows with Go 1.18. - if errno == syscall.EISDIR && offset == 0 && whence == io.SeekStart { - return 0, f.reopen() - } - } - return -} - -// PollRead implements the same method as documented on fsapi.File -func (f *osFile) PollRead(timeout *time.Duration) (ready bool, errno syscall.Errno) { - fdSet := platform.FdSet{} - fd := int(f.fd) - fdSet.Set(fd) - nfds := fd + 1 // See https://man7.org/linux/man-pages/man2/select.2.html#:~:text=condition%20has%20occurred.-,nfds,-This%20argument%20should - count, err := _select(nfds, &fdSet, nil, nil, timeout) - if errno = platform.UnwrapOSError(err); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return count > 0, errno -} - -// Readdir implements File.Readdir. Notably, this uses "Readdir", not -// "ReadDir", from os.File. -func (f *osFile) Readdir(n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - if dirents, errno = readdir(f.file, f.path, n); errno != 0 { - errno = adjustReaddirErr(f, f.closed, errno) - } - return -} - -// Write implements the same method as documented on fsapi.File -func (f *osFile) Write(buf []byte) (n int, errno syscall.Errno) { - if n, errno = write(f.file, buf); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Pwrite implements the same method as documented on fsapi.File -func (f *osFile) Pwrite(buf []byte, off int64) (n int, errno syscall.Errno) { - if n, errno = pwrite(f.file, buf, off); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Truncate implements the same method as documented on fsapi.File -func (f *osFile) Truncate(size int64) (errno syscall.Errno) { - if errno = platform.UnwrapOSError(f.file.Truncate(size)); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Sync implements the same method as documented on fsapi.File -func (f *osFile) Sync() syscall.Errno { - return fsync(f.file) -} - -// Datasync implements the same method as documented on fsapi.File -func (f *osFile) Datasync() syscall.Errno { - return datasync(f.file) -} - -// Chmod implements the same method as documented on fsapi.File -func (f *osFile) Chmod(mode fs.FileMode) syscall.Errno { - if f.closed { - return syscall.EBADF - } - - return platform.UnwrapOSError(f.file.Chmod(mode)) -} - -// Chown implements the same method as documented on fsapi.File -func (f *osFile) Chown(uid, gid int) syscall.Errno { - if f.closed { - return syscall.EBADF - } - - return fchown(f.fd, uid, gid) -} - -// Utimens implements the same method as documented on fsapi.File -func (f *osFile) Utimens(times *[2]syscall.Timespec) syscall.Errno { - if f.closed { - return syscall.EBADF - } - - err := futimens(f.fd, times) - return platform.UnwrapOSError(err) -} - -// Close implements the same method as documented on fsapi.File -func (f *osFile) Close() syscall.Errno { - if f.closed { - return 0 - } - f.closed = true - return f.close() -} - -func (f *osFile) close() syscall.Errno { - return platform.UnwrapOSError(f.file.Close()) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go deleted file mode 100644 index b83778f97c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/readfs.go +++ /dev/null @@ -1,260 +0,0 @@ -package sysfs - -import ( - "io/fs" - "os" - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/fsapi" -) - -// NewReadFS is used to mask an existing api.FS for reads. Notably, this allows -// the CLI to do read-only mounts of directories the host user can write, but -// doesn't want the guest wasm to. For example, Python libraries shouldn't be -// written to at runtime by the python wasm file. -func NewReadFS(fs fsapi.FS) fsapi.FS { - if _, ok := fs.(*readFS); ok { - return fs - } else if _, ok = fs.(fsapi.UnimplementedFS); ok { - return fs // unimplemented is read-only - } - return &readFS{fs: fs} -} - -type readFS struct { - fs fsapi.FS -} - -// String implements fmt.Stringer -func (r *readFS) String() string { - return r.fs.String() -} - -// OpenFile implements the same method as documented on api.FS -func (r *readFS) OpenFile(path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - // TODO: Once the real implementation is complete, move the below to - // /RATIONALE.md. Doing this while the type is unstable creates - // documentation drift as we expect a lot of reshaping meanwhile. - // - // Callers of this function expect to either open a valid file handle, or - // get an error, if they can't. We want to return ENOSYS if opened for - // anything except reads. - // - // Instead, we could return a fake no-op file on O_WRONLY. However, this - // hurts observability because a later write error to that file will be on - // a different source code line than the root cause which is opening with - // an unsupported flag. - // - // The tricky part is os.RD_ONLY is typically defined as zero, so while the - // parameter is named flag, the part about opening read vs write isn't a - // typical bitflag. We can't compare against zero anyway, because even if - // there isn't a current flag to OR in with that, there may be in the - // future. What we do instead is mask the flags about read/write mode and - // check if they are the opposite of read or not. - switch flag & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR) { - case os.O_WRONLY, os.O_RDWR: - if flag&fsapi.O_DIRECTORY != 0 { - return nil, syscall.EISDIR - } - return nil, syscall.ENOSYS - default: // os.O_RDONLY (or no flag) so we are ok! - } - - f, errno := r.fs.OpenFile(path, flag, perm) - if errno != 0 { - return nil, errno - } - return &readFile{f: f}, 0 -} - -// compile-time check to ensure readFile implements api.File. -var _ fsapi.File = (*readFile)(nil) - -type readFile struct { - f fsapi.File -} - -// Ino implements the same method as documented on fsapi.File. -func (r *readFile) Ino() (uint64, syscall.Errno) { - return r.f.Ino() -} - -// IsNonblock implements the same method as documented on fsapi.File. -func (r *readFile) IsNonblock() bool { - return r.f.IsNonblock() -} - -// SetNonblock implements the same method as documented on fsapi.File. -func (r *readFile) SetNonblock(enabled bool) syscall.Errno { - return r.f.SetNonblock(enabled) -} - -// IsAppend implements the same method as documented on fsapi.File. -func (r *readFile) IsAppend() bool { - return r.f.IsAppend() -} - -// SetAppend implements the same method as documented on fsapi.File. -func (r *readFile) SetAppend(enabled bool) syscall.Errno { - return r.f.SetAppend(enabled) -} - -// Stat implements the same method as documented on fsapi.File. -func (r *readFile) Stat() (fsapi.Stat_t, syscall.Errno) { - return r.f.Stat() -} - -// IsDir implements the same method as documented on fsapi.File. -func (r *readFile) IsDir() (bool, syscall.Errno) { - return r.f.IsDir() -} - -// Read implements the same method as documented on fsapi.File. -func (r *readFile) Read(buf []byte) (int, syscall.Errno) { - return r.f.Read(buf) -} - -// Pread implements the same method as documented on fsapi.File. -func (r *readFile) Pread(buf []byte, offset int64) (int, syscall.Errno) { - return r.f.Pread(buf, offset) -} - -// Seek implements the same method as documented on fsapi.File. -func (r *readFile) Seek(offset int64, whence int) (int64, syscall.Errno) { - return r.f.Seek(offset, whence) -} - -// Readdir implements the same method as documented on fsapi.File. -func (r *readFile) Readdir(n int) (dirents []fsapi.Dirent, errno syscall.Errno) { - return r.f.Readdir(n) -} - -// Write implements the same method as documented on fsapi.File. -func (r *readFile) Write([]byte) (int, syscall.Errno) { - return 0, r.writeErr() -} - -// Pwrite implements the same method as documented on fsapi.File. -func (r *readFile) Pwrite([]byte, int64) (n int, errno syscall.Errno) { - return 0, r.writeErr() -} - -// Truncate implements the same method as documented on fsapi.File. -func (r *readFile) Truncate(int64) syscall.Errno { - return r.writeErr() -} - -// Sync implements the same method as documented on fsapi.File. -func (r *readFile) Sync() syscall.Errno { - return syscall.EBADF -} - -// Datasync implements the same method as documented on fsapi.File. -func (r *readFile) Datasync() syscall.Errno { - return syscall.EBADF -} - -// Chmod implements the same method as documented on fsapi.File. -func (r *readFile) Chmod(fs.FileMode) syscall.Errno { - return syscall.EBADF -} - -// Chown implements the same method as documented on fsapi.File. -func (r *readFile) Chown(int, int) syscall.Errno { - return syscall.EBADF -} - -// Utimens implements the same method as documented on fsapi.File. -func (r *readFile) Utimens(*[2]syscall.Timespec) syscall.Errno { - return syscall.EBADF -} - -func (r *readFile) writeErr() syscall.Errno { - if isDir, errno := r.IsDir(); errno != 0 { - return errno - } else if isDir { - return syscall.EISDIR - } - return syscall.EBADF -} - -// Close implements the same method as documented on fsapi.File. -func (r *readFile) Close() syscall.Errno { - return r.f.Close() -} - -// PollRead implements File.PollRead -func (r *readFile) PollRead(timeout *time.Duration) (ready bool, errno syscall.Errno) { - return r.f.PollRead(timeout) -} - -// Lstat implements the same method as documented on api.FS -func (r *readFS) Lstat(path string) (fsapi.Stat_t, syscall.Errno) { - return r.fs.Lstat(path) -} - -// Stat implements the same method as documented on api.FS -func (r *readFS) Stat(path string) (fsapi.Stat_t, syscall.Errno) { - return r.fs.Stat(path) -} - -// Readlink implements the same method as documented on api.FS -func (r *readFS) Readlink(path string) (dst string, err syscall.Errno) { - return r.fs.Readlink(path) -} - -// Mkdir implements the same method as documented on api.FS -func (r *readFS) Mkdir(path string, perm fs.FileMode) syscall.Errno { - return syscall.EROFS -} - -// Chmod implements the same method as documented on api.FS -func (r *readFS) Chmod(path string, perm fs.FileMode) syscall.Errno { - return syscall.EROFS -} - -// Chown implements the same method as documented on api.FS -func (r *readFS) Chown(path string, uid, gid int) syscall.Errno { - return syscall.EROFS -} - -// Lchown implements the same method as documented on api.FS -func (r *readFS) Lchown(path string, uid, gid int) syscall.Errno { - return syscall.EROFS -} - -// Rename implements the same method as documented on api.FS -func (r *readFS) Rename(from, to string) syscall.Errno { - return syscall.EROFS -} - -// Rmdir implements the same method as documented on api.FS -func (r *readFS) Rmdir(path string) syscall.Errno { - return syscall.EROFS -} - -// Link implements the same method as documented on api.FS -func (r *readFS) Link(_, _ string) syscall.Errno { - return syscall.EROFS -} - -// Symlink implements the same method as documented on api.FS -func (r *readFS) Symlink(_, _ string) syscall.Errno { - return syscall.EROFS -} - -// Unlink implements the same method as documented on api.FS -func (r *readFS) Unlink(path string) syscall.Errno { - return syscall.EROFS -} - -// Utimens implements the same method as documented on api.FS -func (r *readFS) Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno { - return syscall.EROFS -} - -// Truncate implements the same method as documented on api.FS -func (r *readFS) Truncate(string, int64) syscall.Errno { - return syscall.EROFS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename.go deleted file mode 100644 index b107bc19d0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename.go +++ /dev/null @@ -1,16 +0,0 @@ -//go:build !windows - -package sysfs - -import ( - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func Rename(from, to string) syscall.Errno { - if from == to { - return 0 - } - return platform.UnwrapOSError(syscall.Rename(from, to)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go deleted file mode 100644 index 25e53d4ff0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rename_windows.go +++ /dev/null @@ -1,47 +0,0 @@ -package sysfs - -import ( - "errors" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func Rename(from, to string) syscall.Errno { - if from == to { - return 0 - } - - fromStat, err := os.Stat(from) - if err != nil { - return syscall.ENOENT - } - - if toStat, err := os.Stat(to); err == nil { - fromIsDir, toIsDir := fromStat.IsDir(), toStat.IsDir() - if fromIsDir && !toIsDir { // dir to file - return syscall.ENOTDIR - } else if !fromIsDir && toIsDir { // file to dir - return syscall.EISDIR - } else if !fromIsDir && !toIsDir { // file to file - // Use os.Rename instead of syscall.Rename in order to allow the overrides of the existing file. - // Underneath os.Rename, it uses MoveFileEx instead of MoveFile (used by syscall.Rename). - return platform.UnwrapOSError(os.Rename(from, to)) - } else { // dir to dir - if dirs, _ := os.ReadDir(to); len(dirs) == 0 { - // On Windows, renaming to the empty dir will be rejected, - // so first we remove the empty dir, and then rename to it. - if err := os.Remove(to); err != nil { - return platform.UnwrapOSError(err) - } - return platform.UnwrapOSError(syscall.Rename(from, to)) - } - return syscall.ENOTEMPTY - } - } else if !errors.Is(err, syscall.ENOENT) { // Failed to stat the destination. - return platform.UnwrapOSError(err) - } else { // Destination not-exist. - return platform.UnwrapOSError(syscall.Rename(from, to)) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rootfs.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/rootfs.go deleted file mode 100644 index 75bd839f44..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/rootfs.go +++ /dev/null @@ -1,559 +0,0 @@ -package sysfs - -import ( - "fmt" - "io" - "io/fs" - "strings" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" -) - -func NewRootFS(fs []fsapi.FS, guestPaths []string) (fsapi.FS, error) { - switch len(fs) { - case 0: - return fsapi.UnimplementedFS{}, nil - case 1: - if StripPrefixesAndTrailingSlash(guestPaths[0]) == "" { - return fs[0], nil - } - } - - ret := &CompositeFS{ - string: stringFS(fs, guestPaths), - fs: make([]fsapi.FS, len(fs)), - guestPaths: make([]string, len(fs)), - cleanedGuestPaths: make([]string, len(fs)), - rootGuestPaths: map[string]int{}, - rootIndex: -1, - } - - copy(ret.guestPaths, guestPaths) - copy(ret.fs, fs) - - for i, guestPath := range guestPaths { - // Clean the prefix in the same way path matches will. - cleaned := StripPrefixesAndTrailingSlash(guestPath) - if cleaned == "" { - if ret.rootIndex != -1 { - return nil, fmt.Errorf("multiple root filesystems are invalid: %s", ret.string) - } - ret.rootIndex = i - } else if strings.HasPrefix(cleaned, "..") { - // ../ mounts are special cased and aren't returned in a directory - // listing, so we can ignore them for now. - } else if strings.Contains(cleaned, "/") { - return nil, fmt.Errorf("only single-level guest paths allowed: %s", ret.string) - } else { - ret.rootGuestPaths[cleaned] = i - } - ret.cleanedGuestPaths[i] = cleaned - } - - // Ensure there is always a root match to keep runtime logic simpler. - if ret.rootIndex == -1 { - ret.rootIndex = len(fs) - ret.cleanedGuestPaths = append(ret.cleanedGuestPaths, "") - ret.fs = append(ret.fs, &fakeRootFS{}) - } - return ret, nil -} - -type CompositeFS struct { - fsapi.UnimplementedFS - // string is cached for convenience. - string string - // fs is index-correlated with cleanedGuestPaths - fs []fsapi.FS - // guestPaths are the original paths supplied by the end user, cleaned as - // cleanedGuestPaths. - guestPaths []string - // cleanedGuestPaths to match in precedence order, ascending. - cleanedGuestPaths []string - // rootGuestPaths are cleanedGuestPaths that exist directly under root, such as - // "tmp". - rootGuestPaths map[string]int - // rootIndex is the index in fs that is the root filesystem - rootIndex int -} - -// String implements fmt.Stringer -func (c *CompositeFS) String() string { - return c.string -} - -func stringFS(fs []fsapi.FS, guestPaths []string) string { - var ret strings.Builder - ret.WriteString("[") - writeMount(&ret, fs[0], guestPaths[0]) - for i, f := range fs[1:] { - ret.WriteString(" ") - writeMount(&ret, f, guestPaths[i+1]) - } - ret.WriteString("]") - return ret.String() -} - -func writeMount(ret *strings.Builder, f fsapi.FS, guestPath string) { - ret.WriteString(f.String()) - ret.WriteString(":") - ret.WriteString(guestPath) - if _, ok := f.(*readFS); ok { - ret.WriteString(":ro") - } -} - -// GuestPaths returns the underlying pre-open paths in original order. -func (c *CompositeFS) GuestPaths() (guestPaths []string) { - return c.guestPaths -} - -// FS returns the underlying filesystems in original order. -func (c *CompositeFS) FS() (fs []fsapi.FS) { - fs = make([]fsapi.FS, len(c.guestPaths)) - copy(fs, c.fs) - return -} - -// OpenFile implements the same method as documented on api.FS -func (c *CompositeFS) OpenFile(path string, flag int, perm fs.FileMode) (f fsapi.File, err syscall.Errno) { - matchIndex, relativePath := c.chooseFS(path) - - f, err = c.fs[matchIndex].OpenFile(relativePath, flag, perm) - if err != 0 { - return - } - - // Ensure the root directory listing includes any prefix mounts. - if matchIndex == c.rootIndex { - switch path { - case ".", "/", "": - if len(c.rootGuestPaths) > 0 { - f = &openRootDir{path: path, c: c, f: f} - } - } - } - return -} - -// An openRootDir is a root directory open for reading, which has mounts inside -// of it. -type openRootDir struct { - fsapi.DirFile - - path string - c *CompositeFS - f fsapi.File // the directory file itself - dirents []fsapi.Dirent // the directory contents - direntsI int // the read offset, an index into the files slice -} - -// Ino implements the same method as documented on fsapi.File -func (d *openRootDir) Ino() (uint64, syscall.Errno) { - return d.f.Ino() -} - -// Stat implements the same method as documented on fsapi.File -func (d *openRootDir) Stat() (fsapi.Stat_t, syscall.Errno) { - return d.f.Stat() -} - -// Seek implements the same method as documented on fsapi.File -func (d *openRootDir) Seek(offset int64, whence int) (newOffset int64, errno syscall.Errno) { - if offset != 0 || whence != io.SeekStart { - errno = syscall.ENOSYS - return - } - d.dirents = nil - d.direntsI = 0 - return d.f.Seek(offset, whence) -} - -// Readdir implements the same method as documented on fsapi.File -func (d *openRootDir) Readdir(count int) (dirents []fsapi.Dirent, errno syscall.Errno) { - if d.dirents == nil { - if errno = d.readdir(); errno != 0 { - return - } - } - - // logic similar to go:embed - n := len(d.dirents) - d.direntsI - if n == 0 { - return - } - if count > 0 && n > count { - n = count - } - dirents = make([]fsapi.Dirent, n) - for i := range dirents { - dirents[i] = d.dirents[d.direntsI+i] - } - d.direntsI += n - return -} - -func (d *openRootDir) readdir() (errno syscall.Errno) { - // readDir reads the directory fully into d.dirents, replacing any entries that - // correspond to prefix matches or appending them to the end. - if d.dirents, errno = d.f.Readdir(-1); errno != 0 { - return - } - - remaining := make(map[string]int, len(d.c.rootGuestPaths)) - for k, v := range d.c.rootGuestPaths { - remaining[k] = v - } - - for i := range d.dirents { - e := d.dirents[i] - if fsI, ok := remaining[e.Name]; ok { - if d.dirents[i], errno = d.rootEntry(e.Name, fsI); errno != 0 { - return - } - delete(remaining, e.Name) - } - } - - var di fsapi.Dirent - for n, fsI := range remaining { - if di, errno = d.rootEntry(n, fsI); errno != 0 { - return - } - d.dirents = append(d.dirents, di) - } - return -} - -// Sync implements the same method as documented on fsapi.File -func (d *openRootDir) Sync() syscall.Errno { - return d.f.Sync() -} - -// Datasync implements the same method as documented on fsapi.File -func (d *openRootDir) Datasync() syscall.Errno { - return d.f.Datasync() -} - -// Chmod implements the same method as documented on fsapi.File -func (d *openRootDir) Chmod(fs.FileMode) syscall.Errno { - return syscall.ENOSYS -} - -// Chown implements the same method as documented on fsapi.File -func (d *openRootDir) Chown(int, int) syscall.Errno { - return syscall.ENOSYS -} - -// Utimens implements the same method as documented on fsapi.File -func (d *openRootDir) Utimens(*[2]syscall.Timespec) syscall.Errno { - return syscall.ENOSYS -} - -// Close implements fs.File -func (d *openRootDir) Close() syscall.Errno { - return d.f.Close() -} - -func (d *openRootDir) rootEntry(name string, fsI int) (fsapi.Dirent, syscall.Errno) { - if st, errno := d.c.fs[fsI].Stat("."); errno != 0 { - return fsapi.Dirent{}, errno - } else { - return fsapi.Dirent{Name: name, Ino: st.Ino, Type: st.Mode.Type()}, 0 - } -} - -// Lstat implements the same method as documented on api.FS -func (c *CompositeFS) Lstat(path string) (fsapi.Stat_t, syscall.Errno) { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Lstat(relativePath) -} - -// Stat implements the same method as documented on api.FS -func (c *CompositeFS) Stat(path string) (fsapi.Stat_t, syscall.Errno) { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Stat(relativePath) -} - -// Mkdir implements the same method as documented on api.FS -func (c *CompositeFS) Mkdir(path string, perm fs.FileMode) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Mkdir(relativePath, perm) -} - -// Chmod implements the same method as documented on api.FS -func (c *CompositeFS) Chmod(path string, perm fs.FileMode) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Chmod(relativePath, perm) -} - -// Chown implements the same method as documented on api.FS -func (c *CompositeFS) Chown(path string, uid, gid int) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Chown(relativePath, uid, gid) -} - -// Lchown implements the same method as documented on api.FS -func (c *CompositeFS) Lchown(path string, uid, gid int) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Lchown(relativePath, uid, gid) -} - -// Rename implements the same method as documented on api.FS -func (c *CompositeFS) Rename(from, to string) syscall.Errno { - fromFS, fromPath := c.chooseFS(from) - toFS, toPath := c.chooseFS(to) - if fromFS != toFS { - return syscall.ENOSYS // not yet anyway - } - return c.fs[fromFS].Rename(fromPath, toPath) -} - -// Readlink implements the same method as documented on api.FS -func (c *CompositeFS) Readlink(path string) (string, syscall.Errno) { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Readlink(relativePath) -} - -// Link implements the same method as documented on api.FS -func (c *CompositeFS) Link(oldName, newName string) syscall.Errno { - fromFS, oldNamePath := c.chooseFS(oldName) - toFS, newNamePath := c.chooseFS(newName) - if fromFS != toFS { - return syscall.ENOSYS // not yet anyway - } - return c.fs[fromFS].Link(oldNamePath, newNamePath) -} - -// Utimens implements the same method as documented on api.FS -func (c *CompositeFS) Utimens(path string, times *[2]syscall.Timespec, symlinkFollow bool) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Utimens(relativePath, times, symlinkFollow) -} - -// Symlink implements the same method as documented on api.FS -func (c *CompositeFS) Symlink(oldName, link string) (err syscall.Errno) { - fromFS, oldNamePath := c.chooseFS(oldName) - toFS, linkPath := c.chooseFS(link) - if fromFS != toFS { - return syscall.ENOSYS // not yet anyway - } - return c.fs[fromFS].Symlink(oldNamePath, linkPath) -} - -// Truncate implements the same method as documented on api.FS -func (c *CompositeFS) Truncate(path string, size int64) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Truncate(relativePath, size) -} - -// Rmdir implements the same method as documented on api.FS -func (c *CompositeFS) Rmdir(path string) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Rmdir(relativePath) -} - -// Unlink implements the same method as documented on api.FS -func (c *CompositeFS) Unlink(path string) syscall.Errno { - matchIndex, relativePath := c.chooseFS(path) - return c.fs[matchIndex].Unlink(relativePath) -} - -// chooseFS chooses the best fs and the relative path to use for the input. -func (c *CompositeFS) chooseFS(path string) (matchIndex int, relativePath string) { - matchIndex = -1 - matchPrefixLen := 0 - pathI, pathLen := stripPrefixesAndTrailingSlash(path) - - // Last is the highest precedence, so we iterate backwards. The last longest - // match wins. e.g. the pre-open "tmp" wins vs "" regardless of order. - for i := len(c.fs) - 1; i >= 0; i-- { - prefix := c.cleanedGuestPaths[i] - if eq, match := hasPathPrefix(path, pathI, pathLen, prefix); eq { - // When the input equals the prefix, there cannot be a longer match - // later. The relative path is the fsapi.FS root, so return empty - // string. - matchIndex = i - relativePath = "" - return - } else if match { - // Check to see if this is a longer match - prefixLen := len(prefix) - if prefixLen > matchPrefixLen || matchIndex == -1 { - matchIndex = i - matchPrefixLen = prefixLen - } - } // Otherwise, keep looking for a match - } - - // Now, we know the path != prefix, but it matched an existing fs, because - // setup ensures there's always a root filesystem. - - // If this was a root path match the cleaned path is the relative one to - // pass to the underlying filesystem. - if matchPrefixLen == 0 { - // Avoid re-slicing when the input is already clean - if pathI == 0 && len(path) == pathLen { - relativePath = path - } else { - relativePath = path[pathI:pathLen] - } - return - } - - // Otherwise, it is non-root match: the relative path is past "$prefix/" - pathI += matchPrefixLen + 1 // e.g. prefix=foo, path=foo/bar -> bar - relativePath = path[pathI:pathLen] - return -} - -// hasPathPrefix compares an input path against a prefix, both cleaned by -// stripPrefixesAndTrailingSlash. This returns a pair of eq, match to allow an -// early short circuit on match. -// -// Note: This is case-sensitive because POSIX paths are compared case -// sensitively. -func hasPathPrefix(path string, pathI, pathLen int, prefix string) (eq, match bool) { - matchLen := pathLen - pathI - if prefix == "" { - return matchLen == 0, true // e.g. prefix=, path=foo - } - - prefixLen := len(prefix) - // reset pathLen temporarily to represent the length to match as opposed to - // the length of the string (that may contain leading slashes). - if matchLen == prefixLen { - if pathContainsPrefix(path, pathI, prefixLen, prefix) { - return true, true // e.g. prefix=bar, path=bar - } - return false, false - } else if matchLen < prefixLen { - return false, false // e.g. prefix=fooo, path=foo - } - - if path[pathI+prefixLen] != '/' { - return false, false // e.g. prefix=foo, path=fooo - } - - // Not equal, but maybe a match. e.g. prefix=foo, path=foo/bar - return false, pathContainsPrefix(path, pathI, prefixLen, prefix) -} - -// pathContainsPrefix is faster than strings.HasPrefix even if we didn't cache -// the index,len. See benchmarks. -func pathContainsPrefix(path string, pathI, prefixLen int, prefix string) bool { - for i := 0; i < prefixLen; i++ { - if path[pathI] != prefix[i] { - return false // e.g. prefix=bar, path=foo or foo/bar - } - pathI++ - } - return true // e.g. prefix=foo, path=foo or foo/bar -} - -func StripPrefixesAndTrailingSlash(path string) string { - pathI, pathLen := stripPrefixesAndTrailingSlash(path) - return path[pathI:pathLen] -} - -// stripPrefixesAndTrailingSlash skips any leading "./" or "/" such that the -// result index begins with another string. A result of "." coerces to the -// empty string "" because the current directory is handled by the guest. -// -// Results are the offset/len pair which is an optimization to avoid re-slicing -// overhead, as this function is called for every path operation. -// -// Note: Relative paths should be handled by the guest, as that's what knows -// what the current directory is. However, paths that escape the current -// directory e.g. "../.." have been found in `tinygo test` and this -// implementation takes care to avoid it. -func stripPrefixesAndTrailingSlash(path string) (pathI, pathLen int) { - // strip trailing slashes - pathLen = len(path) - for ; pathLen > 0 && path[pathLen-1] == '/'; pathLen-- { - } - - pathI = 0 -loop: - for pathI < pathLen { - switch path[pathI] { - case '/': - pathI++ - case '.': - nextI := pathI + 1 - if nextI < pathLen && path[nextI] == '/' { - pathI = nextI + 1 - } else if nextI == pathLen { - pathI = nextI - } else { - break loop - } - default: - break loop - } - } - return -} - -type fakeRootFS struct { - fsapi.UnimplementedFS -} - -// OpenFile implements the same method as documented on api.FS -func (fakeRootFS) OpenFile(path string, flag int, perm fs.FileMode) (fsapi.File, syscall.Errno) { - switch path { - case ".", "/", "": - return fakeRootDir{}, 0 - } - return nil, syscall.ENOENT -} - -type fakeRootDir struct { - fsapi.DirFile -} - -// Ino implements the same method as documented on fsapi.File -func (fakeRootDir) Ino() (uint64, syscall.Errno) { - return 0, 0 -} - -// Stat implements the same method as documented on fsapi.File -func (fakeRootDir) Stat() (fsapi.Stat_t, syscall.Errno) { - return fsapi.Stat_t{Mode: fs.ModeDir, Nlink: 1}, 0 -} - -// Readdir implements the same method as documented on fsapi.File -func (fakeRootDir) Readdir(int) (dirents []fsapi.Dirent, errno syscall.Errno) { - return // empty -} - -// Sync implements the same method as documented on fsapi.File -func (fakeRootDir) Sync() syscall.Errno { - return 0 -} - -// Datasync implements the same method as documented on fsapi.File -func (fakeRootDir) Datasync() syscall.Errno { - return 0 -} - -// Chmod implements the same method as documented on fsapi.File -func (fakeRootDir) Chmod(fs.FileMode) syscall.Errno { - return syscall.ENOSYS -} - -// Chown implements the same method as documented on fsapi.File -func (fakeRootDir) Chown(int, int) syscall.Errno { - return syscall.ENOSYS -} - -// Utimens implements the same method as documented on fsapi.File -func (fakeRootDir) Utimens(*[2]syscall.Timespec) syscall.Errno { - return syscall.ENOSYS -} - -// Close implements the same method as documented on fsapi.File -func (fakeRootDir) Close() syscall.Errno { - return 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select.go deleted file mode 100644 index ac0861fda4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select.go +++ /dev/null @@ -1,36 +0,0 @@ -package sysfs - -import ( - "time" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// _select exposes the select(2) syscall. This is named as such to avoid -// colliding with they keyword select while not exporting the function. -// -// # Notes on Parameters -// -// For convenience, we expose a pointer to a time.Duration instead of a pointer to a syscall.Timeval. -// It must be a pointer because `nil` means "wait forever". -// -// However, notice that select(2) may mutate the pointed Timeval on some platforms, -// for instance if the call returns early. -// -// This implementation *will not* update the pointed time.Duration value accordingly. -// -// See also: https://github.com/golang/sys/blob/master/unix/syscall_unix_test.go#L606-L617 -// -// # Notes on the Syscall -// -// Because this is a blocking syscall, it will also block the carrier thread of the goroutine, -// preventing any means to support context cancellation directly. -// -// There are ways to obviate this issue. We outline here one idea, that is however not currently implemented. -// A common approach to support context cancellation is to add a signal file descriptor to the set, -// e.g. the read-end of a pipe or an eventfd on Linux. -// When the context is canceled, we may unblock a Select call by writing to the fd, causing it to return immediately. -// This however requires to do a bit of housekeeping to hide the "special" FD from the end-user. -func _select(n int, r, w, e *platform.FdSet, timeout *time.Duration) (int, error) { - return syscall_select(n, r, w, e, timeout) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.go deleted file mode 100644 index eabf4f455b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.go +++ /dev/null @@ -1,45 +0,0 @@ -package sysfs - -import ( - "syscall" - "time" - "unsafe" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// syscall_select invokes select on Darwin, with the given timeout Duration. -// We implement our own version instead of relying on syscall.Select because the latter -// only returns the error and discards the result. -func syscall_select(n int, r, w, e *platform.FdSet, timeout *time.Duration) (int, error) { - var t *syscall.Timeval - if timeout != nil { - tv := syscall.NsecToTimeval(timeout.Nanoseconds()) - t = &tv - } - result, _, errno := syscall_syscall6( - libc_select_trampoline_addr, - uintptr(n), - uintptr(unsafe.Pointer(r)), - uintptr(unsafe.Pointer(w)), - uintptr(unsafe.Pointer(e)), - uintptr(unsafe.Pointer(t)), - 0) - res := int(result) - if errno == 0 { - return res, nil - } - return res, errno -} - -// libc_select_trampoline_addr is the address of the -// `libc_select_trampoline` symbol, defined in `select_darwin.s`. -// -// We use this to invoke the syscall through syscall_syscall6 imported below. -var libc_select_trampoline_addr uintptr - -// Imports the select symbol from libc as `libc_select`. -// -// Note: CGO mechanisms are used in darwin regardless of the CGO_ENABLED value -// or the "cgo" build flag. See /RATIONALE.md for why. -//go:cgo_import_dynamic libc_select select "/usr/lib/libSystem.B.dylib" diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.s b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.s deleted file mode 100644 index 16e65e8ec6..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_darwin.s +++ /dev/null @@ -1,8 +0,0 @@ -// lifted from golang.org/x/sys unix -#include "textflag.h" - -TEXT libc_select_trampoline<>(SB), NOSPLIT, $0-0 - JMP libc_select(SB) - -GLOBL ·libc_select_trampoline_addr(SB), RODATA, $8 -DATA ·libc_select_trampoline_addr(SB)/8, $libc_select_trampoline<>(SB) diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_linux.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_linux.go deleted file mode 100644 index aae5e48f66..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_linux.go +++ /dev/null @@ -1,18 +0,0 @@ -package sysfs - -import ( - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// syscall_select invokes select on Unix (unless Darwin), with the given timeout Duration. -func syscall_select(n int, r, w, e *platform.FdSet, timeout *time.Duration) (int, error) { - var t *syscall.Timeval - if timeout != nil { - tv := syscall.NsecToTimeval(timeout.Nanoseconds()) - t = &tv - } - return syscall.Select(n, (*syscall.FdSet)(r), (*syscall.FdSet)(w), (*syscall.FdSet)(e), t) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_unsupported.go deleted file mode 100644 index 5244374b32..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_unsupported.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !darwin && !linux && !windows - -package sysfs - -import ( - "syscall" - "time" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func syscall_select(n int, r, w, e *platform.FdSet, timeout *time.Duration) (int, error) { - return -1, syscall.ENOSYS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_windows.go deleted file mode 100644 index 811c648d60..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/select_windows.go +++ /dev/null @@ -1,127 +0,0 @@ -package sysfs - -import ( - "context" - "syscall" - "time" - "unsafe" - - "github.com/tetratelabs/wazero/internal/platform" -) - -// wasiFdStdin is the constant value for stdin on Wasi. -// We need this constant because on Windows os.Stdin.Fd() != 0. -const wasiFdStdin = 0 - -// pollInterval is the interval between each calls to peekNamedPipe in pollNamedPipe -const pollInterval = 100 * time.Millisecond - -var kernel32 = syscall.NewLazyDLL("kernel32.dll") - -// procPeekNamedPipe is the syscall.LazyProc in kernel32 for PeekNamedPipe -var procPeekNamedPipe = kernel32.NewProc("PeekNamedPipe") - -// syscall_select emulates the select syscall on Windows for two, well-known cases, returns syscall.ENOSYS for all others. -// If r contains fd 0, and it is a regular file, then it immediately returns 1 (data ready on stdin) -// and r will have the fd 0 bit set. -// If r contains fd 0, and it is a FILE_TYPE_CHAR, then it invokes PeekNamedPipe to check the buffer for input; -// if there is data ready, then it returns 1 and r will have fd 0 bit set. -// If n==0 it will wait for the given timeout duration, but it will return syscall.ENOSYS if timeout is nil, -// i.e. it won't block indefinitely. -// -// Note: idea taken from https://stackoverflow.com/questions/6839508/test-if-stdin-has-input-for-c-windows-and-or-linux -// PeekNamedPipe: https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-peeknamedpipe -// "GetFileType can assist in determining what device type the handle refers to. A console handle presents as FILE_TYPE_CHAR." -// https://learn.microsoft.com/en-us/windows/console/console-handles -func syscall_select(n int, r, w, e *platform.FdSet, timeout *time.Duration) (int, error) { - if n == 0 { - // Don't block indefinitely. - if timeout == nil { - return -1, syscall.ENOSYS - } - time.Sleep(*timeout) - return 0, nil - } - if r.IsSet(wasiFdStdin) { - fileType, err := syscall.GetFileType(syscall.Stdin) - if err != nil { - return 0, err - } - if fileType&syscall.FILE_TYPE_CHAR != 0 { - res, err := pollNamedPipe(context.TODO(), syscall.Stdin, timeout) - if err != nil { - return -1, err - } - if !res { - r.Zero() - return 0, nil - } - } - r.Zero() - r.Set(wasiFdStdin) - return 1, nil - } - return -1, syscall.ENOSYS -} - -// pollNamedPipe polls the given named pipe handle for the given duration. -// -// The implementation actually polls every 100 milliseconds until it reaches the given duration. -// The duration may be nil, in which case it will wait undefinely. The given ctx is -// used to allow for cancellation. Currently used only in tests. -func pollNamedPipe(ctx context.Context, pipeHandle syscall.Handle, duration *time.Duration) (bool, error) { - // Short circuit when the duration is zero. - if duration != nil && *duration == time.Duration(0) { - return peekNamedPipe(pipeHandle) - } - - // Ticker that emits at every pollInterval. - tick := time.NewTicker(pollInterval) - tichCh := tick.C - defer tick.Stop() - - // Timer that expires after the given duration. - // Initialize afterCh as nil: the select below will wait forever. - var afterCh <-chan time.Time - if duration != nil { - // If duration is not nil, instantiate the timer. - after := time.NewTimer(*duration) - defer after.Stop() - afterCh = after.C - } - - for { - select { - case <-ctx.Done(): - return false, nil - case <-afterCh: - return false, nil - case <-tichCh: - res, err := peekNamedPipe(pipeHandle) - if err != nil { - return false, err - } - if res { - return true, nil - } - } - } -} - -// peekNamedPipe partially exposes PeekNamedPipe from the Win32 API -// see https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-peeknamedpipe -func peekNamedPipe(handle syscall.Handle) (bool, error) { - var totalBytesAvail uint32 - totalBytesPtr := unsafe.Pointer(&totalBytesAvail) - _, _, err := procPeekNamedPipe.Call( - uintptr(handle), // [in] HANDLE hNamedPipe, - 0, // [out, optional] LPVOID lpBuffer, - 0, // [in] DWORD nBufferSize, - 0, // [out, optional] LPDWORD lpBytesRead - uintptr(totalBytesPtr), // [out, optional] LPDWORD lpTotalBytesAvail, - 0) // [out, optional] LPDWORD lpBytesLeftThisMessage - if err == syscall.Errno(0) { - return totalBytesAvail > 0, nil - } - return totalBytesAvail > 0, err -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go deleted file mode 100644 index 62bef426fb..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock.go +++ /dev/null @@ -1,37 +0,0 @@ -package sysfs - -import ( - "net" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - socketapi "github.com/tetratelabs/wazero/internal/sock" -) - -// NewTCPListenerFile creates a socketapi.TCPSock for a given *net.TCPListener. -func NewTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock { - return newTCPListenerFile(tl) -} - -// baseSockFile implements base behavior for all TCPSock, TCPConn files, -// regardless the platform. -type baseSockFile struct { - fsapi.UnimplementedFile -} - -var _ fsapi.File = (*baseSockFile)(nil) - -// IsDir implements the same method as documented on File.IsDir -func (*baseSockFile) IsDir() (bool, syscall.Errno) { - // We need to override this method because WASI-libc prestats the FD - // and the default impl returns ENOSYS otherwise. - return false, 0 -} - -// Stat implements the same method as documented on File.Stat -func (f *baseSockFile) Stat() (fs fsapi.Stat_t, errno syscall.Errno) { - // The mode is not really important, but it should be neither a regular file nor a directory. - fs.Mode = os.ModeIrregular - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go deleted file mode 100644 index aa3d3bb59d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unix.go +++ /dev/null @@ -1,155 +0,0 @@ -//go:build linux || darwin - -package sysfs - -import ( - "net" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" - socketapi "github.com/tetratelabs/wazero/internal/sock" -) - -// MSG_PEEK is the constant syscall.MSG_PEEK -const MSG_PEEK = syscall.MSG_PEEK - -// newTCPListenerFile is a constructor for a socketapi.TCPSock. -// -// Note: the implementation of socketapi.TCPSock goes straight -// to the syscall layer, bypassing most of the Go library. -// For an alternative approach, consider winTcpListenerFile -// where most APIs are implemented with regular Go std-lib calls. -func newTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock { - conn, err := tl.File() - if err != nil { - panic(err) - } - fd := conn.Fd() - // We need to duplicate this file handle, or the lifecycle will be tied - // to the TCPListener. We rely on the TCPListener only to set up - // the connection correctly and parse/resolve the TCP Address - // (notice we actually rely on the listener in the Windows implementation). - sysfd, err := syscall.Dup(int(fd)) - if err != nil { - panic(err) - } - return &tcpListenerFile{fd: uintptr(sysfd), addr: tl.Addr().(*net.TCPAddr)} -} - -var _ socketapi.TCPSock = (*tcpListenerFile)(nil) - -type tcpListenerFile struct { - baseSockFile - - fd uintptr - addr *net.TCPAddr -} - -// Accept implements the same method as documented on socketapi.TCPSock -func (f *tcpListenerFile) Accept() (socketapi.TCPConn, syscall.Errno) { - nfd, _, err := syscall.Accept(int(f.fd)) - errno := platform.UnwrapOSError(err) - if errno != 0 { - return nil, errno - } - return &tcpConnFile{fd: uintptr(nfd)}, 0 -} - -// SetNonblock implements the same method as documented on fsapi.File -func (f *tcpListenerFile) SetNonblock(enabled bool) syscall.Errno { - return platform.UnwrapOSError(setNonblock(f.fd, enabled)) -} - -// Close implements the same method as documented on fsapi.File -func (f *tcpListenerFile) Close() syscall.Errno { - return platform.UnwrapOSError(syscall.Close(int(f.fd))) -} - -// Addr is exposed for testing. -func (f *tcpListenerFile) Addr() *net.TCPAddr { - return f.addr -} - -var _ socketapi.TCPConn = (*tcpConnFile)(nil) - -type tcpConnFile struct { - baseSockFile - - fd uintptr - - // closed is true when closed was called. This ensures proper syscall.EBADF - closed bool -} - -func newTcpConn(tc *net.TCPConn) socketapi.TCPConn { - f, err := tc.File() - if err != nil { - panic(err) - } - return &tcpConnFile{fd: f.Fd()} -} - -// SetNonblock implements the same method as documented on fsapi.File -func (f *tcpConnFile) SetNonblock(enabled bool) (errno syscall.Errno) { - return platform.UnwrapOSError(setNonblock(f.fd, enabled)) -} - -// Read implements the same method as documented on fsapi.File -func (f *tcpConnFile) Read(buf []byte) (n int, errno syscall.Errno) { - n, err := syscall.Read(int(f.fd), buf) - if err != nil { - // Defer validation overhead until we've already had an error. - errno = platform.UnwrapOSError(err) - errno = fileError(f, f.closed, errno) - } - return n, errno -} - -// Write implements the same method as documented on fsapi.File -func (f *tcpConnFile) Write(buf []byte) (n int, errno syscall.Errno) { - n, err := syscall.Write(int(f.fd), buf) - if err != nil { - // Defer validation overhead until we've already had an error. - errno = platform.UnwrapOSError(err) - errno = fileError(f, f.closed, errno) - } - return n, errno -} - -// Recvfrom implements the same method as documented on socketapi.TCPConn -func (f *tcpConnFile) Recvfrom(p []byte, flags int) (n int, errno syscall.Errno) { - if flags != MSG_PEEK { - errno = syscall.EINVAL - return - } - n, _, recvfromErr := syscall.Recvfrom(int(f.fd), p, MSG_PEEK) - errno = platform.UnwrapOSError(recvfromErr) - return n, errno -} - -// Shutdown implements the same method as documented on fsapi.Conn -func (f *tcpConnFile) Shutdown(how int) syscall.Errno { - var err error - switch how { - case syscall.SHUT_RD, syscall.SHUT_WR: - err = syscall.Shutdown(int(f.fd), how) - case syscall.SHUT_RDWR: - return f.close() - default: - return syscall.EINVAL - } - return platform.UnwrapOSError(err) -} - -// Close implements the same method as documented on fsapi.File -func (f *tcpConnFile) Close() syscall.Errno { - return f.close() -} - -func (f *tcpConnFile) close() syscall.Errno { - if f.closed { - return 0 - } - f.closed = true - return platform.UnwrapOSError(syscall.Shutdown(int(f.fd), syscall.SHUT_RDWR)) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go deleted file mode 100644 index 57e8eb10a2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_unsupported.go +++ /dev/null @@ -1,26 +0,0 @@ -//go:build !linux && !darwin && !windows - -package sysfs - -import ( - "net" - "syscall" - - socketapi "github.com/tetratelabs/wazero/internal/sock" -) - -// MSG_PEEK is a filler value. -const MSG_PEEK = 0x2 - -func newTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock { - return &unsupportedSockFile{} -} - -type unsupportedSockFile struct { - baseSockFile -} - -// Accept implements the same method as documented on socketapi.TCPSock -func (f *unsupportedSockFile) Accept() (socketapi.TCPConn, syscall.Errno) { - return nil, syscall.ENOSYS -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go deleted file mode 100644 index 9f3b46913a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sock_windows.go +++ /dev/null @@ -1,192 +0,0 @@ -//go:build windows - -package sysfs - -import ( - "net" - "syscall" - "unsafe" - - "github.com/tetratelabs/wazero/internal/platform" - socketapi "github.com/tetratelabs/wazero/internal/sock" -) - -// MSG_PEEK is the flag PEEK for syscall.Recvfrom on Windows. -// This constant is not exported on this platform. -const MSG_PEEK = 0x2 - -var ( - // modws2_32 is WinSock. - modws2_32 = syscall.NewLazyDLL("ws2_32.dll") - // procrecvfrom exposes recvfrom from WinSock. - procrecvfrom = modws2_32.NewProc("recvfrom") -) - -// recvfrom exposes the underlying syscall in Windows. -// -// Note: since we are only using this to expose MSG_PEEK, -// we do not need really need all the parameters that are actually -// allowed in WinSock. -// We ignore `from *sockaddr` and `fromlen *int`. -func recvfrom(s syscall.Handle, buf []byte, flags int32) (n int, errno syscall.Errno) { - var _p0 *byte - if len(buf) > 0 { - _p0 = &buf[0] - } - r0, _, e1 := syscall.SyscallN( - procrecvfrom.Addr(), - uintptr(s), - uintptr(unsafe.Pointer(_p0)), - uintptr(len(buf)), - uintptr(flags), - 0, // from *sockaddr (optional) - 0) // fromlen *int (optional) - return int(r0), e1 -} - -// newTCPListenerFile is a constructor for a socketapi.TCPSock. -// -// Note: currently the Windows implementation of socketapi.TCPSock -// returns a winTcpListenerFile, which is a specialized TCPSock -// that delegates to a .net.TCPListener. -// The current strategy is to delegate most behavior to the Go -// standard library, instead of invoke syscalls/Win32 APIs -// because they are sensibly different from Unix's. -func newTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock { - return &winTcpListenerFile{tl: tl} -} - -var _ socketapi.TCPSock = (*winTcpListenerFile)(nil) - -type winTcpListenerFile struct { - baseSockFile - - tl *net.TCPListener -} - -// Accept implements the same method as documented on socketapi.TCPSock -func (f *winTcpListenerFile) Accept() (socketapi.TCPConn, syscall.Errno) { - conn, err := f.tl.Accept() - if err != nil { - return nil, platform.UnwrapOSError(err) - } - return &winTcpConnFile{tc: conn.(*net.TCPConn)}, 0 -} - -// SetNonblock implements the same method as documented on fsapi.File -func (f *winTcpListenerFile) SetNonblock(enabled bool) syscall.Errno { - return 0 // setNonblock() is a no-op on Windows -} - -// Close implements the same method as documented on fsapi.File -func (f *winTcpListenerFile) Close() syscall.Errno { - return platform.UnwrapOSError(f.tl.Close()) -} - -// Addr is exposed for testing. -func (f *winTcpListenerFile) Addr() *net.TCPAddr { - return f.tl.Addr().(*net.TCPAddr) -} - -var _ socketapi.TCPConn = (*winTcpConnFile)(nil) - -type winTcpConnFile struct { - baseSockFile - - tc *net.TCPConn - - // closed is true when closed was called. This ensures proper syscall.EBADF - closed bool -} - -func newTcpConn(tc *net.TCPConn) socketapi.TCPConn { - return &winTcpConnFile{tc: tc} -} - -// SetNonblock implements the same method as documented on fsapi.File -func (f *winTcpConnFile) SetNonblock(enabled bool) (errno syscall.Errno) { - syscallConn, err := f.tc.SyscallConn() - if err != nil { - return platform.UnwrapOSError(err) - } - - // Prioritize the error from setNonblock over Control - if controlErr := syscallConn.Control(func(fd uintptr) { - errno = platform.UnwrapOSError(setNonblock(fd, enabled)) - }); errno == 0 { - errno = platform.UnwrapOSError(controlErr) - } - return -} - -// Read implements the same method as documented on fsapi.File -func (f *winTcpConnFile) Read(buf []byte) (n int, errno syscall.Errno) { - if n, errno = read(f.tc, buf); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Write implements the same method as documented on fsapi.File -func (f *winTcpConnFile) Write(buf []byte) (n int, errno syscall.Errno) { - if n, errno = write(f.tc, buf); errno != 0 { - // Defer validation overhead until we've already had an error. - errno = fileError(f, f.closed, errno) - } - return -} - -// Recvfrom implements the same method as documented on socketapi.TCPConn -func (f *winTcpConnFile) Recvfrom(p []byte, flags int) (n int, errno syscall.Errno) { - if flags != MSG_PEEK { - errno = syscall.EINVAL - return - } - conn := f.tc - syscallConn, err := conn.SyscallConn() - if err != nil { - errno = platform.UnwrapOSError(err) - return - } - - // Prioritize the error from recvfrom over Control - if controlErr := syscallConn.Control(func(fd uintptr) { - var recvfromErr error - n, recvfromErr = recvfrom(syscall.Handle(fd), p, MSG_PEEK) - errno = platform.UnwrapOSError(recvfromErr) - }); errno == 0 { - errno = platform.UnwrapOSError(controlErr) - } - return -} - -// Shutdown implements the same method as documented on fsapi.Conn -func (f *winTcpConnFile) Shutdown(how int) syscall.Errno { - // FIXME: can userland shutdown listeners? - var err error - switch how { - case syscall.SHUT_RD: - err = f.tc.CloseRead() - case syscall.SHUT_WR: - err = f.tc.CloseWrite() - case syscall.SHUT_RDWR: - return f.close() - default: - return syscall.EINVAL - } - return platform.UnwrapOSError(err) -} - -// Close implements the same method as documented on fsapi.File -func (f *winTcpConnFile) Close() syscall.Errno { - return f.close() -} - -func (f *winTcpConnFile) close() syscall.Errno { - if f.closed { - return 0 - } - f.closed = true - return f.Shutdown(syscall.SHUT_RDWR) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go deleted file mode 100644 index 60690fd90b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat.go +++ /dev/null @@ -1,32 +0,0 @@ -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func defaultStatFile(f *os.File) (fsapi.Stat_t, syscall.Errno) { - if t, err := f.Stat(); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } else { - return statFromFileInfo(t), 0 - } -} - -func StatFromDefaultFileInfo(t fs.FileInfo) fsapi.Stat_t { - st := fsapi.Stat_t{} - st.Ino = 0 - st.Dev = 0 - st.Mode = t.Mode() - st.Nlink = 1 - st.Size = t.Size() - mtim := t.ModTime().UnixNano() // Set all times to the mod time - st.Atim = mtim - st.Mtim = mtim - st.Ctim = mtim - return st -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_bsd.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_bsd.go deleted file mode 100644 index 8297e8502a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_bsd.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build (amd64 || arm64) && (darwin || freebsd) - -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func lstat(path string) (fsapi.Stat_t, syscall.Errno) { - if t, err := os.Lstat(path); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } else { - return statFromFileInfo(t), 0 - } -} - -func stat(path string) (fsapi.Stat_t, syscall.Errno) { - if t, err := os.Stat(path); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } else { - return statFromFileInfo(t), 0 - } -} - -func statFile(f *os.File) (fsapi.Stat_t, syscall.Errno) { - return defaultStatFile(f) -} - -func inoFromFileInfo(_ string, t fs.FileInfo) (ino uint64, err syscall.Errno) { - if d, ok := t.Sys().(*syscall.Stat_t); ok { - ino = d.Ino - } - return -} - -func statFromFileInfo(t fs.FileInfo) fsapi.Stat_t { - if d, ok := t.Sys().(*syscall.Stat_t); ok { - st := fsapi.Stat_t{} - st.Dev = uint64(d.Dev) - st.Ino = d.Ino - st.Uid = d.Uid - st.Gid = d.Gid - st.Mode = t.Mode() - st.Nlink = uint64(d.Nlink) - st.Size = d.Size - atime := d.Atimespec - st.Atim = atime.Sec*1e9 + atime.Nsec - mtime := d.Mtimespec - st.Mtim = mtime.Sec*1e9 + mtime.Nsec - ctime := d.Ctimespec - st.Ctim = ctime.Sec*1e9 + ctime.Nsec - return st - } - return StatFromDefaultFileInfo(t) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_linux.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_linux.go deleted file mode 100644 index e90f29b513..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_linux.go +++ /dev/null @@ -1,63 +0,0 @@ -//go:build (amd64 || arm64 || riscv64) && linux - -// Note: This expression is not the same as compiler support, even if it looks -// similar. Platform functions here are used in interpreter mode as well. - -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func lstat(path string) (fsapi.Stat_t, syscall.Errno) { - if t, err := os.Lstat(path); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } else { - return statFromFileInfo(t), 0 - } -} - -func stat(path string) (fsapi.Stat_t, syscall.Errno) { - if t, err := os.Stat(path); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } else { - return statFromFileInfo(t), 0 - } -} - -func statFile(f *os.File) (fsapi.Stat_t, syscall.Errno) { - return defaultStatFile(f) -} - -func inoFromFileInfo(_ string, t fs.FileInfo) (ino uint64, err syscall.Errno) { - if d, ok := t.Sys().(*syscall.Stat_t); ok { - ino = d.Ino - } - return -} - -func statFromFileInfo(t fs.FileInfo) fsapi.Stat_t { - if d, ok := t.Sys().(*syscall.Stat_t); ok { - st := fsapi.Stat_t{} - st.Dev = uint64(d.Dev) - st.Ino = uint64(d.Ino) - st.Uid = d.Uid - st.Gid = d.Gid - st.Mode = t.Mode() - st.Nlink = uint64(d.Nlink) - st.Size = d.Size - atime := d.Atim - st.Atim = atime.Sec*1e9 + atime.Nsec - mtime := d.Mtim - st.Mtim = mtime.Sec*1e9 + mtime.Nsec - ctime := d.Ctim - st.Ctim = ctime.Sec*1e9 + ctime.Nsec - return st - } - return StatFromDefaultFileInfo(t) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go deleted file mode 100644 index 4c2b70550e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_unsupported.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build (!((amd64 || arm64 || riscv64) && linux) && !((amd64 || arm64) && (darwin || freebsd)) && !((amd64 || arm64) && windows)) || js - -package sysfs - -import ( - "io/fs" - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func lstat(path string) (fsapi.Stat_t, syscall.Errno) { - t, err := os.Lstat(path) - if errno := platform.UnwrapOSError(err); errno == 0 { - return statFromFileInfo(t), 0 - } else { - return fsapi.Stat_t{}, errno - } -} - -func stat(path string) (fsapi.Stat_t, syscall.Errno) { - t, err := os.Stat(path) - if errno := platform.UnwrapOSError(err); errno == 0 { - return statFromFileInfo(t), 0 - } else { - return fsapi.Stat_t{}, errno - } -} - -func statFile(f *os.File) (fsapi.Stat_t, syscall.Errno) { - return defaultStatFile(f) -} - -func inoFromFileInfo(_ string, t fs.FileInfo) (ino uint64, err syscall.Errno) { - return -} - -func statFromFileInfo(t fs.FileInfo) fsapi.Stat_t { - return StatFromDefaultFileInfo(t) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go deleted file mode 100644 index 4b05727e15..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/stat_windows.go +++ /dev/null @@ -1,142 +0,0 @@ -//go:build (amd64 || arm64) && windows - -package sysfs - -import ( - "io/fs" - "os" - "path" - "syscall" - - "github.com/tetratelabs/wazero/internal/fsapi" - "github.com/tetratelabs/wazero/internal/platform" -) - -func lstat(path string) (fsapi.Stat_t, syscall.Errno) { - attrs := uint32(syscall.FILE_FLAG_BACKUP_SEMANTICS) - // Use FILE_FLAG_OPEN_REPARSE_POINT, otherwise CreateFile will follow symlink. - // See https://docs.microsoft.com/en-us/windows/desktop/FileIO/symbolic-link-effects-on-file-systems-functions#createfile-and-createfiletransacted - attrs |= syscall.FILE_FLAG_OPEN_REPARSE_POINT - return statPath(attrs, path) -} - -func stat(path string) (fsapi.Stat_t, syscall.Errno) { - attrs := uint32(syscall.FILE_FLAG_BACKUP_SEMANTICS) - return statPath(attrs, path) -} - -func statPath(createFileAttrs uint32, path string) (fsapi.Stat_t, syscall.Errno) { - if len(path) == 0 { - return fsapi.Stat_t{}, syscall.ENOENT - } - pathp, err := syscall.UTF16PtrFromString(path) - if err != nil { - return fsapi.Stat_t{}, syscall.EINVAL - } - - // open the file handle - h, err := syscall.CreateFile(pathp, 0, 0, nil, - syscall.OPEN_EXISTING, createFileAttrs, 0) - if err != nil { - // To match expectations of WASI, e.g. TinyGo TestStatBadDir, return - // ENOENT, not ENOTDIR. - if err == syscall.ENOTDIR { - err = syscall.ENOENT - } - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } - defer syscall.CloseHandle(h) - - return statHandle(h) -} - -func statFile(f *os.File) (fsapi.Stat_t, syscall.Errno) { - // Attempt to get the stat by handle, which works for normal files - st, err := statHandle(syscall.Handle(f.Fd())) - - // ERROR_INVALID_HANDLE happens before Go 1.20. Don't fail as we only - // use that approach to fill in inode data, which is not critical. - // - // Note: statHandle uses UnwrapOSError which coerces - // ERROR_INVALID_HANDLE to EBADF. - if err != syscall.EBADF { - return st, err - } - return defaultStatFile(f) -} - -// inoFromFileInfo uses stat to get the inode information of the file. -func inoFromFileInfo(filePath string, t fs.FileInfo) (ino uint64, errno syscall.Errno) { - if filePath == "" { - // This is a fs.File backed implementation which doesn't have access to - // the original file path. - return - } - // ino is no not in Win32FileAttributeData - inoPath := path.Clean(path.Join(filePath, t.Name())) - var st fsapi.Stat_t - if st, errno = lstat(inoPath); errno == 0 { - ino = st.Ino - } - return -} - -func statFromFileInfo(t fs.FileInfo) fsapi.Stat_t { - if d, ok := t.Sys().(*syscall.Win32FileAttributeData); ok { - st := fsapi.Stat_t{} - st.Ino = 0 // not in Win32FileAttributeData - st.Dev = 0 // not in Win32FileAttributeData - st.Mode = t.Mode() - st.Nlink = 1 // not in Win32FileAttributeData - st.Size = t.Size() - st.Atim = d.LastAccessTime.Nanoseconds() - st.Mtim = d.LastWriteTime.Nanoseconds() - st.Ctim = d.CreationTime.Nanoseconds() - return st - } else { - return StatFromDefaultFileInfo(t) - } -} - -func statHandle(h syscall.Handle) (fsapi.Stat_t, syscall.Errno) { - winFt, err := syscall.GetFileType(h) - if err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } - - var fi syscall.ByHandleFileInformation - if err = syscall.GetFileInformationByHandle(h, &fi); err != nil { - return fsapi.Stat_t{}, platform.UnwrapOSError(err) - } - - var m fs.FileMode - if fi.FileAttributes&syscall.FILE_ATTRIBUTE_READONLY != 0 { - m |= 0o444 - } else { - m |= 0o666 - } - - switch { // check whether this is a symlink first - case fi.FileAttributes&syscall.FILE_ATTRIBUTE_REPARSE_POINT != 0: - m |= fs.ModeSymlink - case winFt == syscall.FILE_TYPE_PIPE: - m |= fs.ModeNamedPipe - case winFt == syscall.FILE_TYPE_CHAR: - m |= fs.ModeDevice | fs.ModeCharDevice - case fi.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY != 0: - m |= fs.ModeDir | 0o111 // e.g. 0o444 -> 0o555 - } - - st := fsapi.Stat_t{} - // FileIndex{High,Low} can be combined and used as a unique identifier like inode. - // https://learn.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information - st.Dev = uint64(fi.VolumeSerialNumber) - st.Ino = (uint64(fi.FileIndexHigh) << 32) | uint64(fi.FileIndexLow) - st.Mode = m - st.Nlink = uint64(fi.NumberOfLinks) - st.Size = int64(fi.FileSizeHigh)<<32 + int64(fi.FileSizeLow) - st.Atim = fi.LastAccessTime.Nanoseconds() - st.Mtim = fi.LastWriteTime.Nanoseconds() - st.Ctim = fi.CreationTime.Nanoseconds() - return st, 0 -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go deleted file mode 100644 index ba336c8d5d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync.go +++ /dev/null @@ -1,14 +0,0 @@ -//go:build !windows - -package sysfs - -import ( - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func fsync(f *os.File) syscall.Errno { - return platform.UnwrapOSError(f.Sync()) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go deleted file mode 100644 index e83dc3044a..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sync_windows.go +++ /dev/null @@ -1,21 +0,0 @@ -package sysfs - -import ( - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func fsync(f *os.File) syscall.Errno { - errno := platform.UnwrapOSError(f.Sync()) - // Coerce error performing stat on a directory to 0, as it won't work - // on Windows. - switch errno { - case syscall.EACCES /* Go 1.20 */, syscall.EBADF /* Go 1.18 */ : - if st, err := f.Stat(); err == nil && st.IsDir() { - errno = 0 - } - } - return errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go deleted file mode 100644 index 9fde5baa50..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/syscall6_darwin.go +++ /dev/null @@ -1,13 +0,0 @@ -package sysfs - -import ( - "syscall" - _ "unsafe" -) - -// syscall_syscall6 is a private symbol that we link below. We need to use this -// instead of syscall.Syscall6 because the public syscall.Syscall6 won't work -// when fn is an address. -// -//go:linkname syscall_syscall6 syscall.syscall6 -func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go deleted file mode 100644 index e0ebfe5b9f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/sysfs.go +++ /dev/null @@ -1,6 +0,0 @@ -// Package sysfs includes a low-level filesystem interface and utilities needed -// for WebAssembly host functions (ABI) such as WASI and runtime.GOOS=js. -// -// The name sysfs was chosen because wazero's public API has a "sys" package, -// which was named after https://github.com/golang/sys. -package sysfs diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/empty.txt b/vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/empty.txt deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/wazero.txt b/vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/wazero.txt deleted file mode 100644 index 3058e80561..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/testdata/wazero.txt +++ /dev/null @@ -1 +0,0 @@ -wazero diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink.go deleted file mode 100644 index 37b74e182f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink.go +++ /dev/null @@ -1,17 +0,0 @@ -//go:build !windows - -package sysfs - -import ( - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func Unlink(name string) (errno syscall.Errno) { - err := syscall.Unlink(name) - if errno = platform.UnwrapOSError(err); errno == syscall.EPERM { - errno = syscall.EISDIR - } - return errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go b/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go deleted file mode 100644 index 410ea8444b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/sysfs/unlink_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -//go:build windows - -package sysfs - -import ( - "os" - "syscall" - - "github.com/tetratelabs/wazero/internal/platform" -) - -func Unlink(name string) syscall.Errno { - err := syscall.Unlink(name) - if err == nil { - return 0 - } - errno := platform.UnwrapOSError(err) - if errno == syscall.EBADF { - lstat, errLstat := os.Lstat(name) - if errLstat == nil && lstat.Mode()&os.ModeSymlink != 0 { - errno = platform.UnwrapOSError(os.Remove(name)) - } else { - errno = syscall.EISDIR - } - } - return errno -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/u32/u32.go b/vendor/github.com/tetratelabs/wazero/internal/u32/u32.go deleted file mode 100644 index 5960a6f0cc..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/u32/u32.go +++ /dev/null @@ -1,11 +0,0 @@ -package u32 - -// LeBytes returns a byte slice corresponding to the 4 bytes in the uint32 in little-endian byte order. -func LeBytes(v uint32) []byte { - return []byte{ - byte(v), - byte(v >> 8), - byte(v >> 16), - byte(v >> 24), - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/u64/u64.go b/vendor/github.com/tetratelabs/wazero/internal/u64/u64.go deleted file mode 100644 index 65c7cd124b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/u64/u64.go +++ /dev/null @@ -1,15 +0,0 @@ -package u64 - -// LeBytes returns a byte slice corresponding to the 8 bytes in the uint64 in little-endian byte order. -func LeBytes(v uint64) []byte { - return []byte{ - byte(v), - byte(v >> 8), - byte(v >> 16), - byte(v >> 24), - byte(v >> 32), - byte(v >> 40), - byte(v >> 48), - byte(v >> 56), - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/version/version.go b/vendor/github.com/tetratelabs/wazero/internal/version/version.go deleted file mode 100644 index 9261df0f7e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/version/version.go +++ /dev/null @@ -1,52 +0,0 @@ -package version - -import ( - "runtime/debug" - "strings" -) - -// Default is the default version value used when none was found. -const Default = "dev" - -// version holds the current version from the go.mod of downstream users or set by ldflag for wazero CLI. -var version string - -// GetWazeroVersion returns the current version of wazero either in the go.mod or set by ldflag for wazero CLI. -// -// If this is not CLI, this assumes that downstream users of wazero imports wazero as "github.com/tetratelabs/wazero". -// To be precise, the returned string matches the require statement there. -// For example, if the go.mod has "require github.com/tetratelabs/wazero 0.1.2-12314124-abcd", -// then this returns "0.1.2-12314124-abcd". -// -// Note: this is tested in ./testdata/main_test.go with a separate go.mod to pretend as the wazero user. -func GetWazeroVersion() (ret string) { - if len(version) != 0 { - return version - } - - info, ok := debug.ReadBuildInfo() - if ok { - for _, dep := range info.Deps { - // Note: here's the assumption that wazero is imported as github.com/tetratelabs/wazero. - if strings.Contains(dep.Path, "github.com/tetratelabs/wazero") { - ret = dep.Version - } - } - - // In wazero CLI, wazero is a main module, so we have to get the version info from info.Main. - if versionMissing(ret) { - ret = info.Main.Version - } - } - if versionMissing(ret) { - return Default // don't return parens - } - - // Cache for the subsequent calls. - version = ret - return ret -} - -func versionMissing(ret string) bool { - return ret == "" || ret == "(devel)" // pkg.go defaults to (devel) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/args.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/args.go deleted file mode 100644 index 212d3b2de2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/args.go +++ /dev/null @@ -1,6 +0,0 @@ -package wasip1 - -const ( - ArgsGetName = "args_get" - ArgsSizesGetName = "args_sizes_get" -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go deleted file mode 100644 index 1d1b8c12d8..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/clock.go +++ /dev/null @@ -1,16 +0,0 @@ -package wasip1 - -const ( - ClockResGetName = "clock_res_get" - ClockTimeGetName = "clock_time_get" -) - -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-clockid-enumu32 -const ( - // ClockIDRealtime is the name ID named "realtime" like sys.Walltime - ClockIDRealtime = iota - // ClockIDMonotonic is the name ID named "monotonic" like sys.Nanotime - ClockIDMonotonic - // Note: clockIDProcessCputime and clockIDThreadCputime were removed by - // WASI maintainers: https://github.com/WebAssembly/wasi-libc/pull/294 -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go deleted file mode 100644 index 2b0d598283..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/environ.go +++ /dev/null @@ -1,6 +0,0 @@ -package wasip1 - -const ( - EnvironGetName = "environ_get" - EnvironSizesGetName = "environ_sizes_get" -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go deleted file mode 100644 index b4ec34eb76..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/errno.go +++ /dev/null @@ -1,311 +0,0 @@ -package wasip1 - -import ( - "fmt" - "syscall" -) - -// Errno is neither uint16 nor an alias for parity with wasm.ValueType. -type Errno = uint32 - -// ErrnoName returns the POSIX error code name, except ErrnoSuccess, which is -// not an error. e.g. Errno2big -> "E2BIG" -func ErrnoName(errno uint32) string { - if int(errno) < len(errnoToString) { - return errnoToString[errno] - } - return fmt.Sprintf("errno(%d)", errno) -} - -// Note: Below prefers POSIX symbol names over WASI ones, even if the docs are from WASI. -// See https://linux.die.net/man/3/errno -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#variants-1 -const ( - // ErrnoSuccess No error occurred. System call completed successfully. - ErrnoSuccess Errno = iota - // Errno2big Argument list too long. - Errno2big - // ErrnoAcces Permission denied. - ErrnoAcces - // ErrnoAddrinuse Address in use. - ErrnoAddrinuse - // ErrnoAddrnotavail Address not available. - ErrnoAddrnotavail - // ErrnoAfnosupport Address family not supported. - ErrnoAfnosupport - // ErrnoAgain Resource unavailable, or operation would block. - ErrnoAgain - // ErrnoAlready Connection already in progress. - ErrnoAlready - // ErrnoBadf Bad file descriptor. - ErrnoBadf - // ErrnoBadmsg Bad message. - ErrnoBadmsg - // ErrnoBusy Device or resource busy. - ErrnoBusy - // ErrnoCanceled Operation canceled. - ErrnoCanceled - // ErrnoChild No child processes. - ErrnoChild - // ErrnoConnaborted Connection aborted. - ErrnoConnaborted - // ErrnoConnrefused Connection refused. - ErrnoConnrefused - // ErrnoConnreset Connection reset. - ErrnoConnreset - // ErrnoDeadlk Resource deadlock would occur. - ErrnoDeadlk - // ErrnoDestaddrreq Destination address required. - ErrnoDestaddrreq - // ErrnoDom Mathematics argument out of domain of function. - ErrnoDom - // ErrnoDquot Reserved. - ErrnoDquot - // ErrnoExist File exists. - ErrnoExist - // ErrnoFault Bad address. - ErrnoFault - // ErrnoFbig File too large. - ErrnoFbig - // ErrnoHostunreach Host is unreachable. - ErrnoHostunreach - // ErrnoIdrm Identifier removed. - ErrnoIdrm - // ErrnoIlseq Illegal byte sequence. - ErrnoIlseq - // ErrnoInprogress Operation in progress. - ErrnoInprogress - // ErrnoIntr Interrupted function. - ErrnoIntr - // ErrnoInval Invalid argument. - ErrnoInval - // ErrnoIo I/O error. - ErrnoIo - // ErrnoIsconn Socket is connected. - ErrnoIsconn - // ErrnoIsdir Is a directory. - ErrnoIsdir - // ErrnoLoop Too many levels of symbolic links. - ErrnoLoop - // ErrnoMfile File descriptor value too large. - ErrnoMfile - // ErrnoMlink Too many links. - ErrnoMlink - // ErrnoMsgsize Message too large. - ErrnoMsgsize - // ErrnoMultihop Reserved. - ErrnoMultihop - // ErrnoNametoolong Filename too long. - ErrnoNametoolong - // ErrnoNetdown Network is down. - ErrnoNetdown - // ErrnoNetreset Connection aborted by network. - ErrnoNetreset - // ErrnoNetunreach Network unreachable. - ErrnoNetunreach - // ErrnoNfile Too many files open in system. - ErrnoNfile - // ErrnoNobufs No buffer space available. - ErrnoNobufs - // ErrnoNodev No such device. - ErrnoNodev - // ErrnoNoent No such file or directory. - ErrnoNoent - // ErrnoNoexec Executable file format error. - ErrnoNoexec - // ErrnoNolck No locks available. - ErrnoNolck - // ErrnoNolink Reserved. - ErrnoNolink - // ErrnoNomem Not enough space. - ErrnoNomem - // ErrnoNomsg No message of the desired type. - ErrnoNomsg - // ErrnoNoprotoopt No message of the desired type. - ErrnoNoprotoopt - // ErrnoNospc No space left on device. - ErrnoNospc - // ErrnoNosys function not supported. - ErrnoNosys - // ErrnoNotconn The socket is not connected. - ErrnoNotconn - // ErrnoNotdir Not a directory or a symbolic link to a directory. - ErrnoNotdir - // ErrnoNotempty Directory not empty. - ErrnoNotempty - // ErrnoNotrecoverable State not recoverable. - ErrnoNotrecoverable - // ErrnoNotsock Not a socket. - ErrnoNotsock - // ErrnoNotsup Not supported, or operation not supported on socket. - ErrnoNotsup - // ErrnoNotty Inappropriate I/O control operation. - ErrnoNotty - // ErrnoNxio No such device or address. - ErrnoNxio - // ErrnoOverflow Value too large to be stored in data type. - ErrnoOverflow - // ErrnoOwnerdead Previous owner died. - ErrnoOwnerdead - // ErrnoPerm Operation not permitted. - ErrnoPerm - // ErrnoPipe Broken pipe. - ErrnoPipe - // ErrnoProto Protocol error. - ErrnoProto - // ErrnoProtonosupport Protocol error. - ErrnoProtonosupport - // ErrnoPrototype Protocol wrong type for socket. - ErrnoPrototype - // ErrnoRange Result too large. - ErrnoRange - // ErrnoRofs Read-only file system. - ErrnoRofs - // ErrnoSpipe Invalid seek. - ErrnoSpipe - // ErrnoSrch No such process. - ErrnoSrch - // ErrnoStale Reserved. - ErrnoStale - // ErrnoTimedout Connection timed out. - ErrnoTimedout - // ErrnoTxtbsy Text file busy. - ErrnoTxtbsy - // ErrnoXdev Cross-device link. - ErrnoXdev - - // Note: ErrnoNotcapable was removed by WASI maintainers. - // See https://github.com/WebAssembly/wasi-libc/pull/294 -) - -var errnoToString = [...]string{ - "ESUCCESS", - "E2BIG", - "EACCES", - "EADDRINUSE", - "EADDRNOTAVAIL", - "EAFNOSUPPORT", - "EAGAIN", - "EALREADY", - "EBADF", - "EBADMSG", - "EBUSY", - "ECANCELED", - "ECHILD", - "ECONNABORTED", - "ECONNREFUSED", - "ECONNRESET", - "EDEADLK", - "EDESTADDRREQ", - "EDOM", - "EDQUOT", - "EEXIST", - "EFAULT", - "EFBIG", - "EHOSTUNREACH", - "EIDRM", - "EILSEQ", - "EINPROGRESS", - "EINTR", - "EINVAL", - "EIO", - "EISCONN", - "EISDIR", - "ELOOP", - "EMFILE", - "EMLINK", - "EMSGSIZE", - "EMULTIHOP", - "ENAMETOOLONG", - "ENETDOWN", - "ENETRESET", - "ENETUNREACH", - "ENFILE", - "ENOBUFS", - "ENODEV", - "ENOENT", - "ENOEXEC", - "ENOLCK", - "ENOLINK", - "ENOMEM", - "ENOMSG", - "ENOPROTOOPT", - "ENOSPC", - "ENOSYS", - "ENOTCONN", - "ENOTDIR", - "ENOTEMPTY", - "ENOTRECOVERABLE", - "ENOTSOCK", - "ENOTSUP", - "ENOTTY", - "ENXIO", - "EOVERFLOW", - "EOWNERDEAD", - "EPERM", - "EPIPE", - "EPROTO", - "EPROTONOSUPPORT", - "EPROTOTYPE", - "ERANGE", - "EROFS", - "ESPIPE", - "ESRCH", - "ESTALE", - "ETIMEDOUT", - "ETXTBSY", - "EXDEV", - "ENOTCAPABLE", -} - -// ToErrno coerces the error to a WASI Errno. -// -// Note: Coercion isn't centralized in sys.FSContext because ABI use different -// error codes. For example, wasi-filesystem and GOOS=js don't map to these -// Errno. -func ToErrno(errno syscall.Errno) Errno { - switch errno { - case 0: - return ErrnoSuccess - case syscall.EACCES: - return ErrnoAcces - case syscall.EAGAIN: - return ErrnoAgain - case syscall.EBADF: - return ErrnoBadf - case syscall.EEXIST: - return ErrnoExist - case syscall.EFAULT: - return ErrnoFault - case syscall.EINTR: - return ErrnoIntr - case syscall.EINVAL: - return ErrnoInval - case syscall.EIO: - return ErrnoIo - case syscall.EISDIR: - return ErrnoIsdir - case syscall.ELOOP: - return ErrnoLoop - case syscall.ENAMETOOLONG: - return ErrnoNametoolong - case syscall.ENOENT: - return ErrnoNoent - case syscall.ENOSYS: - return ErrnoNosys - case syscall.ENOTDIR: - return ErrnoNotdir - case syscall.ENOTEMPTY: - return ErrnoNotempty - case syscall.ENOTSOCK: - return ErrnoNotsock - case syscall.ENOTSUP: - return ErrnoNotsup - case syscall.EPERM: - return ErrnoPerm - case syscall.EROFS: - return ErrnoRofs - default: - return ErrnoIo - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go deleted file mode 100644 index ed8df1edc4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/fs.go +++ /dev/null @@ -1,164 +0,0 @@ -package wasip1 - -import ( - "fmt" -) - -const ( - FdAdviseName = "fd_advise" - FdAllocateName = "fd_allocate" - FdCloseName = "fd_close" - FdDatasyncName = "fd_datasync" - FdFdstatGetName = "fd_fdstat_get" - FdFdstatSetFlagsName = "fd_fdstat_set_flags" - FdFdstatSetRightsName = "fd_fdstat_set_rights" - FdFilestatGetName = "fd_filestat_get" - FdFilestatSetSizeName = "fd_filestat_set_size" - FdFilestatSetTimesName = "fd_filestat_set_times" - FdPreadName = "fd_pread" - FdPrestatGetName = "fd_prestat_get" - FdPrestatDirNameName = "fd_prestat_dir_name" - FdPwriteName = "fd_pwrite" - FdReadName = "fd_read" - FdReaddirName = "fd_readdir" - FdRenumberName = "fd_renumber" - FdSeekName = "fd_seek" - FdSyncName = "fd_sync" - FdTellName = "fd_tell" - FdWriteName = "fd_write" - - PathCreateDirectoryName = "path_create_directory" - PathFilestatGetName = "path_filestat_get" - PathFilestatSetTimesName = "path_filestat_set_times" - PathLinkName = "path_link" - PathOpenName = "path_open" - PathReadlinkName = "path_readlink" - PathRemoveDirectoryName = "path_remove_directory" - PathRenameName = "path_rename" - PathSymlinkName = "path_symlink" - PathUnlinkFileName = "path_unlink_file" -) - -// oflags are open flags used by path_open -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-oflags-flagsu16 -const ( - // O_CREAT creates a file if it does not exist. - O_CREAT uint16 = 1 << iota //nolint - // O_DIRECTORY fails if not a directory. - O_DIRECTORY - // O_EXCL fails if file already exists. - O_EXCL //nolint - // O_TRUNC truncates the file to size 0. - O_TRUNC //nolint -) - -func OflagsString(oflags int) string { - return flagsString(oflagNames[:], oflags) -} - -var oflagNames = [...]string{ - "CREAT", - "DIRECTORY", - "EXCL", - "TRUNC", -} - -// file descriptor flags -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fdflags -const ( - FD_APPEND uint16 = 1 << iota //nolint - FD_DSYNC - FD_NONBLOCK - FD_RSYNC - FD_SYNC -) - -func FdFlagsString(fdflags int) string { - return flagsString(fdflagNames[:], fdflags) -} - -var fdflagNames = [...]string{ - "APPEND", - "DSYNC", - "NONBLOCK", - "RSYNC", - "SYNC", -} - -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#lookupflags -const ( - // LOOKUP_SYMLINK_FOLLOW expands a path if it resolves into a symbolic - // link. - LOOKUP_SYMLINK_FOLLOW uint16 = 1 << iota //nolint -) - -var lookupflagNames = [...]string{ - "SYMLINK_FOLLOW", -} - -func LookupflagsString(lookupflags int) string { - return flagsString(lookupflagNames[:], lookupflags) -} - -// DirentSize is the size of the dirent struct, which should be followed by the -// length of a file name. -const DirentSize = uint32(24) - -const ( - FILETYPE_UNKNOWN uint8 = iota - FILETYPE_BLOCK_DEVICE - FILETYPE_CHARACTER_DEVICE - FILETYPE_DIRECTORY - FILETYPE_REGULAR_FILE - FILETYPE_SOCKET_DGRAM - FILETYPE_SOCKET_STREAM - FILETYPE_SYMBOLIC_LINK -) - -// FiletypeName returns string name of the file type. -func FiletypeName(filetype uint8) string { - if int(filetype) < len(filetypeToString) { - return filetypeToString[filetype] - } - return fmt.Sprintf("filetype(%d)", filetype) -} - -var filetypeToString = [...]string{ - "UNKNOWN", - "BLOCK_DEVICE", - "CHARACTER_DEVICE", - "DIRECTORY", - "REGULAR_FILE", - "SOCKET_DGRAM", - "SOCKET_STREAM", - "SYMBOLIC_LINK", -} - -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#fstflags -const ( - FstflagsAtim uint16 = 1 << iota - FstflagsAtimNow - FstflagsMtim - FstflagsMtimNow -) - -var fstflagNames = [...]string{ - "ATIM", - "ATIM_NOW", - "MTIM", - "MTIM_NOW", -} - -func FstflagsString(fdflags int) string { - return flagsString(fstflagNames[:], fdflags) -} - -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-advice-enumu8 -const ( - FdAdviceNormal byte = iota - FdAdviceSequential - FdAdviceRandom - FdAdviceWillNeed - FdAdviceDontNeed - FdAdviceNoReuse -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go deleted file mode 100644 index 9bde768f2b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/poll.go +++ /dev/null @@ -1,15 +0,0 @@ -package wasip1 - -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-eventtype-enumu8 -const ( - // EventTypeClock is the timeout event named "name". - EventTypeClock = iota - // EventTypeFdRead is the data available event named "fd_read". - EventTypeFdRead - // EventTypeFdWrite is the capacity available event named "fd_write". - EventTypeFdWrite -) - -const ( - PollOneoffName = "poll_oneoff" -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go deleted file mode 100644 index 50b040c98e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/proc.go +++ /dev/null @@ -1,6 +0,0 @@ -package wasip1 - -const ( - ProcExitName = "proc_exit" - ProcRaiseName = "proc_raise" -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/random.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/random.go deleted file mode 100644 index 2364533740..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/random.go +++ /dev/null @@ -1,3 +0,0 @@ -package wasip1 - -const RandomGetName = "random_get" diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go deleted file mode 100644 index 3b6919cf07..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/rights.go +++ /dev/null @@ -1,148 +0,0 @@ -package wasip1 - -// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-rights-flagsu64 -const ( - // RIGHT_FD_DATASYNC is the right to invoke fd_datasync. If RIGHT_PATH_OPEN - // is set, includes the right to invoke path_open with FD_DSYNC. - RIGHT_FD_DATASYNC uint32 = 1 << iota //nolint - - // RIGHT_FD_READ is he right to invoke fd_read and sock_recv. If - // RIGHT_FD_SYNC is set, includes the right to invoke fd_pread. - RIGHT_FD_READ - - // RIGHT_FD_SEEK is the right to invoke fd_seek. This flag implies - // RIGHT_FD_TELL. - RIGHT_FD_SEEK - - // RIGHT_FDSTAT_SET_FLAGS is the right to invoke fd_fdstat_set_flags. - RIGHT_FDSTAT_SET_FLAGS - - // RIGHT_FD_SYNC The right to invoke fd_sync. If path_open is set, includes - // the right to invoke path_open with FD_RSYNC and FD_DSYNC. - RIGHT_FD_SYNC - - // RIGHT_FD_TELL is the right to invoke fd_seek in such a way that the file - // offset remains unaltered (i.e., whence::cur with offset zero), or to - // invoke fd_tell. - RIGHT_FD_TELL - - // RIGHT_FD_WRITE is the right to invoke fd_write and sock_send. If - // RIGHT_FD_SEEK is set, includes the right to invoke fd_pwrite. - RIGHT_FD_WRITE - - // RIGHT_FD_ADVISE is the right to invoke fd_advise. - RIGHT_FD_ADVISE - - // RIGHT_FD_ALLOCATE is the right to invoke fd_allocate. - RIGHT_FD_ALLOCATE - - // RIGHT_PATH_CREATE_DIRECTORY is the right to invoke - // path_create_directory. - RIGHT_PATH_CREATE_DIRECTORY - - // RIGHT_PATH_CREATE_FILE when RIGHT_PATH_OPEN is set, the right to invoke - // path_open with O_CREATE. - RIGHT_PATH_CREATE_FILE - - // RIGHT_PATH_LINK_SOURCE is the right to invoke path_link with the file - // descriptor as the source directory. - RIGHT_PATH_LINK_SOURCE - - // RIGHT_PATH_LINK_TARGET is the right to invoke path_link with the file - // descriptor as the target directory. - RIGHT_PATH_LINK_TARGET - - // RIGHT_PATH_OPEN is the right to invoke path_open. - RIGHT_PATH_OPEN - - // RIGHT_FD_READDIR is the right to invoke fd_readdir. - RIGHT_FD_READDIR - - // RIGHT_PATH_READLINK is the right to invoke path_readlink. - RIGHT_PATH_READLINK - - // RIGHT_PATH_RENAME_SOURCE is the right to invoke path_rename with the - // file descriptor as the source directory. - RIGHT_PATH_RENAME_SOURCE - - // RIGHT_PATH_RENAME_TARGET is the right to invoke path_rename with the - // file descriptor as the target directory. - RIGHT_PATH_RENAME_TARGET - - // RIGHT_PATH_FILESTAT_GET is the right to invoke path_filestat_get. - RIGHT_PATH_FILESTAT_GET - - // RIGHT_PATH_FILESTAT_SET_SIZE is the right to change a file's size (there - // is no path_filestat_set_size). If RIGHT_PATH_OPEN is set, includes the - // right to invoke path_open with O_TRUNC. - RIGHT_PATH_FILESTAT_SET_SIZE - - // RIGHT_PATH_FILESTAT_SET_TIMES is the right to invoke - // path_filestat_set_times. - RIGHT_PATH_FILESTAT_SET_TIMES - - // RIGHT_FD_FILESTAT_GET is the right to invoke fd_filestat_get. - RIGHT_FD_FILESTAT_GET - - // RIGHT_FD_FILESTAT_SET_SIZE is the right to invoke fd_filestat_set_size. - RIGHT_FD_FILESTAT_SET_SIZE - - // RIGHT_FD_FILESTAT_SET_TIMES is the right to invoke - // fd_filestat_set_times. - RIGHT_FD_FILESTAT_SET_TIMES - - // RIGHT_PATH_SYMLINK is the right to invoke path_symlink. - RIGHT_PATH_SYMLINK - - // RIGHT_PATH_REMOVE_DIRECTORY is the right to invoke - // path_remove_directory. - RIGHT_PATH_REMOVE_DIRECTORY - - // RIGHT_PATH_UNLINK_FILE is the right to invoke path_unlink_file. - RIGHT_PATH_UNLINK_FILE - - // RIGHT_POLL_FD_READWRITE when RIGHT_FD_READ is set, includes the right to - // invoke poll_oneoff to subscribe to eventtype::fd_read. If RIGHT_FD_WRITE - // is set, includes the right to invoke poll_oneoff to subscribe to - // eventtype::fd_write. - RIGHT_POLL_FD_READWRITE - - // RIGHT_SOCK_SHUTDOWN is the right to invoke sock_shutdown. - RIGHT_SOCK_SHUTDOWN -) - -func RightsString(rights int) string { - return flagsString(rightNames[:], rights) -} - -var rightNames = [...]string{ - "FD_DATASYNC", - "FD_READ", - "FD_SEEK", - "FDSTAT_SET_FLAGS", - "FD_SYNC", - "FD_TELL", - "FD_WRITE", - "FD_ADVISE", - "FD_ALLOCATE", - "PATH_CREATE_DIRECTORY", - "PATH_CREATE_FILE", - "PATH_LINK_SOURCE", - "PATH_LINK_TARGET", - "PATH_OPEN", - "FD_READDIR", - "PATH_READLINK", - "PATH_RENAME_SOURCE", - "PATH_RENAME_TARGET", - "PATH_FILESTAT_GET", - "PATH_FILESTAT_SET_SIZE", - "PATH_FILESTAT_SET_TIMES", - "FD_FILESTAT_GET", - "FD_FILESTAT_SET_SIZE", - "FD_FILESTAT_SET_TIMES", - "PATH_SYMLINK", - "PATH_REMOVE_DIRECTORY", - "PATH_UNLINK_FILE", - "POLL_FD_READWRITE", - "SOCK_SHUTDOWN", -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go deleted file mode 100644 index bc6e393858..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/sched.go +++ /dev/null @@ -1,3 +0,0 @@ -package wasip1 - -const SchedYieldName = "sched_yield" diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go deleted file mode 100644 index 90d33ece8f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/sock.go +++ /dev/null @@ -1,71 +0,0 @@ -package wasip1 - -import "strconv" - -const ( - SockAcceptName = "sock_accept" - SockRecvName = "sock_recv" - SockSendName = "sock_send" - SockShutdownName = "sock_shutdown" -) - -// SD Flags indicate which channels on a socket to shut down. -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-sdflags-flagsu8 -const ( - // SD_RD disables further receive operations. - SD_RD uint8 = 1 << iota //nolint - // SD_WR disables further send operations. - SD_WR -) - -func SdFlagsString(sdflags int) string { - return flagsString(sdflagNames[:], sdflags) -} - -var sdflagNames = [...]string{ - "RD", - "WR", -} - -// SI Flags are flags provided to sock_send. As there are currently no flags defined, it must be set to zero. -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-siflags-u16 - -func SiFlagsString(siflags int) string { - if siflags == 0 { - return "" - } - return strconv.Itoa(siflags) -} - -// RI Flags are flags provided to sock_recv. -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-riflags-flagsu16 -const ( - // RI_RECV_PEEK returns the message without removing it from the socket's receive queue - RI_RECV_PEEK uint8 = 1 << iota //nolint - // RI_RECV_WAITALL on byte-stream sockets, block until the full amount of data can be returned. - RI_RECV_WAITALL -) - -func RiFlagsString(riflags int) string { - return flagsString(riflagNames[:], riflags) -} - -var riflagNames = [...]string{ - "RECV_PEEK", - "RECV_WAITALL", -} - -// RO Flags are flags returned by sock_recv. -// https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#-roflags-flagsu16 -const ( - // RO_RECV_DATA_TRUNCATED is returned by sock_recv when message data has been truncated. - RO_RECV_DATA_TRUNCATED uint8 = 1 << iota //nolint -) - -func RoFlagsString(roflags int) string { - return flagsString(roflagNames[:], roflags) -} - -var roflagNames = [...]string{ - "RECV_DATA_TRUNCATED", -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go b/vendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go deleted file mode 100644 index 299feea2f9..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasip1/wasi.go +++ /dev/null @@ -1,26 +0,0 @@ -// Package wasip1 is a helper to remove package cycles re-using constants. -package wasip1 - -import ( - "strings" -) - -// InternalModuleName is not named ModuleName, to avoid a clash on dot imports. -const InternalModuleName = "wasi_snapshot_preview1" - -func flagsString(names []string, f int) string { - var builder strings.Builder - first := true - for i, sf := range names { - target := 1 << i - if target&f != 0 { - if !first { - builder.WriteByte('|') - } else { - first = false - } - builder.WriteString(sf) - } - } - return builder.String() -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go deleted file mode 100644 index 2fac9196c1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/code.go +++ /dev/null @@ -1,100 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - "math" - - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeCode(r *bytes.Reader, codeSectionStart uint64, ret *wasm.Code) (err error) { - ss, _, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("get the size of code: %w", err) - } - remaining := int64(ss) - - // Parse #locals. - ls, bytesRead, err := leb128.DecodeUint32(r) - remaining -= int64(bytesRead) - if err != nil { - return fmt.Errorf("get the size locals: %v", err) - } else if remaining < 0 { - return io.EOF - } - - // Validate the locals. - bytesRead = 0 - var sum uint64 - for i := uint32(0); i < ls; i++ { - num, n, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("read n of locals: %v", err) - } else if remaining < 0 { - return io.EOF - } - - sum += uint64(num) - - b, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read type of local: %v", err) - } - - bytesRead += n + 1 - switch vt := b; vt { - case wasm.ValueTypeI32, wasm.ValueTypeF32, wasm.ValueTypeI64, wasm.ValueTypeF64, - wasm.ValueTypeFuncref, wasm.ValueTypeExternref, wasm.ValueTypeV128: - default: - return fmt.Errorf("invalid local type: 0x%x", vt) - } - } - - if sum > math.MaxUint32 { - return fmt.Errorf("too many locals: %d", sum) - } - - // Rewind the buffer. - _, err = r.Seek(-int64(bytesRead), io.SeekCurrent) - if err != nil { - return err - } - - localTypes := make([]wasm.ValueType, 0, sum) - for i := uint32(0); i < ls; i++ { - num, bytesRead, err := leb128.DecodeUint32(r) - remaining -= int64(bytesRead) + 1 // +1 for the subsequent ReadByte - if err != nil { - return fmt.Errorf("read n of locals: %v", err) - } else if remaining < 0 { - return io.EOF - } - - b, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read type of local: %v", err) - } - - for j := uint32(0); j < num; j++ { - localTypes = append(localTypes, b) - } - } - - bodyOffsetInCodeSection := codeSectionStart - uint64(r.Len()) - body := make([]byte, remaining) - if _, err = io.ReadFull(r, body); err != nil { - return fmt.Errorf("read body: %w", err) - } - - if endIndex := len(body) - 1; endIndex < 0 || body[endIndex] != wasm.OpcodeEnd { - return fmt.Errorf("expr not end with OpcodeEnd") - } - - ret.BodyOffsetInCodeSection = bodyOffsetInCodeSection - ret.LocalTypes = localTypes - ret.Body = body - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go deleted file mode 100644 index edfc0a086b..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/const_expr.go +++ /dev/null @@ -1,105 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/ieee754" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeConstantExpression(r *bytes.Reader, enabledFeatures api.CoreFeatures, ret *wasm.ConstantExpression) error { - b, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read opcode: %v", err) - } - - remainingBeforeData := int64(r.Len()) - offsetAtData := r.Size() - remainingBeforeData - - opcode := b - switch opcode { - case wasm.OpcodeI32Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - _, _, err = leb128.DecodeInt32(r) - case wasm.OpcodeI64Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - _, _, err = leb128.DecodeInt64(r) - case wasm.OpcodeF32Const: - buf := make([]byte, 4) - if _, err := io.ReadFull(r, buf); err != nil { - return fmt.Errorf("read f32 constant: %v", err) - } - _, err = ieee754.DecodeFloat32(buf) - case wasm.OpcodeF64Const: - buf := make([]byte, 8) - if _, err := io.ReadFull(r, buf); err != nil { - return fmt.Errorf("read f64 constant: %v", err) - } - _, err = ieee754.DecodeFloat64(buf) - case wasm.OpcodeGlobalGet: - _, _, err = leb128.DecodeUint32(r) - case wasm.OpcodeRefNull: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - return fmt.Errorf("ref.null is not supported as %w", err) - } - reftype, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read reference type for ref.null: %w", err) - } else if reftype != wasm.RefTypeFuncref && reftype != wasm.RefTypeExternref { - return fmt.Errorf("invalid type for ref.null: 0x%x", reftype) - } - case wasm.OpcodeRefFunc: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - return fmt.Errorf("ref.func is not supported as %w", err) - } - // Parsing index. - _, _, err = leb128.DecodeUint32(r) - case wasm.OpcodeVecPrefix: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureSIMD); err != nil { - return fmt.Errorf("vector instructions are not supported as %w", err) - } - opcode, err = r.ReadByte() - if err != nil { - return fmt.Errorf("read vector instruction opcode suffix: %w", err) - } - - if opcode != wasm.OpcodeVecV128Const { - return fmt.Errorf("invalid vector opcode for const expression: %#x", opcode) - } - - remainingBeforeData = int64(r.Len()) - offsetAtData = r.Size() - remainingBeforeData - - n, err := r.Read(make([]byte, 16)) - if err != nil { - return fmt.Errorf("read vector const instruction immediates: %w", err) - } else if n != 16 { - return fmt.Errorf("read vector const instruction immediates: needs 16 bytes but was %d bytes", n) - } - default: - return fmt.Errorf("%v for const expression opt code: %#x", ErrInvalidByte, b) - } - - if err != nil { - return fmt.Errorf("read value: %v", err) - } - - if b, err = r.ReadByte(); err != nil { - return fmt.Errorf("look for end opcode: %v", err) - } - - if b != wasm.OpcodeEnd { - return fmt.Errorf("constant expression has been not terminated") - } - - ret.Data = make([]byte, remainingBeforeData-int64(r.Len())-1) - if _, err = r.ReadAt(ret.Data, offsetAtData); err != nil { - return fmt.Errorf("error re-buffering ConstantExpression.Data") - } - ret.Opcode = opcode - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go deleted file mode 100644 index 771f8c3273..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/custom.go +++ /dev/null @@ -1,22 +0,0 @@ -package binary - -import ( - "bytes" - - "github.com/tetratelabs/wazero/internal/wasm" -) - -// decodeCustomSection deserializes the data **not** associated with the "name" key in SectionIDCustom. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#custom-section%E2%91%A0 -func decodeCustomSection(r *bytes.Reader, name string, limit uint64) (result *wasm.CustomSection, err error) { - buf := make([]byte, limit) - _, err = r.Read(buf) - - result = &wasm.CustomSection{ - Name: name, - Data: buf, - } - - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go deleted file mode 100644 index 054ccb3c66..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/data.go +++ /dev/null @@ -1,79 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// dataSegmentPrefix represents three types of data segments. -// -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#data-section -type dataSegmentPrefix = uint32 - -const ( - // dataSegmentPrefixActive is the prefix for the version 1.0 compatible data segment, which is classified as "active" in 2.0. - dataSegmentPrefixActive dataSegmentPrefix = 0x0 - // dataSegmentPrefixPassive prefixes the "passive" data segment as in version 2.0 specification. - dataSegmentPrefixPassive dataSegmentPrefix = 0x1 - // dataSegmentPrefixActiveWithMemoryIndex is the active prefix with memory index encoded which is defined for futur use as of 2.0. - dataSegmentPrefixActiveWithMemoryIndex dataSegmentPrefix = 0x2 -) - -func decodeDataSegment(r *bytes.Reader, enabledFeatures api.CoreFeatures, ret *wasm.DataSegment) (err error) { - dataSegmentPrefx, _, err := leb128.DecodeUint32(r) - if err != nil { - err = fmt.Errorf("read data segment prefix: %w", err) - return - } - - if dataSegmentPrefx != dataSegmentPrefixActive { - if err = enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - err = fmt.Errorf("non-zero prefix for data segment is invalid as %w", err) - return - } - } - - switch dataSegmentPrefx { - case dataSegmentPrefixActive, - dataSegmentPrefixActiveWithMemoryIndex: - // Active data segment as in - // https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#data-section - if dataSegmentPrefx == 0x2 { - d, _, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("read memory index: %v", err) - } else if d != 0 { - return fmt.Errorf("memory index must be zero but was %d", d) - } - } - - err = decodeConstantExpression(r, enabledFeatures, &ret.OffsetExpression) - if err != nil { - return fmt.Errorf("read offset expression: %v", err) - } - case dataSegmentPrefixPassive: - // Passive data segment doesn't need const expr nor memory index encoded. - // https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#data-section - ret.Passive = true - default: - err = fmt.Errorf("invalid data segment prefix: 0x%x", dataSegmentPrefx) - return - } - - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - err = fmt.Errorf("get the size of vector: %v", err) - return - } - - ret.Init = make([]byte, vs) - if _, err = io.ReadFull(r, ret.Init); err != nil { - err = fmt.Errorf("read bytes for init: %v", err) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go deleted file mode 100644 index 62000484ba..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/decoder.go +++ /dev/null @@ -1,193 +0,0 @@ -package binary - -import ( - "bytes" - "debug/dwarf" - "errors" - "fmt" - "io" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" - "github.com/tetratelabs/wazero/internal/wasmdebug" -) - -// DecodeModule implements wasm.DecodeModule for the WebAssembly 1.0 (20191205) Binary Format -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-format%E2%91%A0 -func DecodeModule( - binary []byte, - enabledFeatures api.CoreFeatures, - memoryLimitPages uint32, - memoryCapacityFromMax, - dwarfEnabled, storeCustomSections bool, -) (*wasm.Module, error) { - r := bytes.NewReader(binary) - - // Magic number. - buf := make([]byte, 4) - if _, err := io.ReadFull(r, buf); err != nil || !bytes.Equal(buf, Magic) { - return nil, ErrInvalidMagicNumber - } - - // Version. - if _, err := io.ReadFull(r, buf); err != nil || !bytes.Equal(buf, version) { - return nil, ErrInvalidVersion - } - - memSizer := newMemorySizer(memoryLimitPages, memoryCapacityFromMax) - - m := &wasm.Module{} - var info, line, str, abbrev, ranges []byte // For DWARF Data. - for { - // TODO: except custom sections, all others are required to be in order, but we aren't checking yet. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#modules%E2%91%A0%E2%93%AA - sectionID, err := r.ReadByte() - if err == io.EOF { - break - } else if err != nil { - return nil, fmt.Errorf("read section id: %w", err) - } - - sectionSize, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of section %s: %v", wasm.SectionIDName(sectionID), err) - } - - sectionContentStart := r.Len() - switch sectionID { - case wasm.SectionIDCustom: - // First, validate the section and determine if the section for this name has already been set - name, nameSize, decodeErr := decodeUTF8(r, "custom section name") - if decodeErr != nil { - err = decodeErr - break - } else if sectionSize < nameSize { - err = fmt.Errorf("malformed custom section %s", name) - break - } else if name == "name" && m.NameSection != nil { - err = fmt.Errorf("redundant custom section %s", name) - break - } - - // Now, either decode the NameSection or CustomSection - limit := sectionSize - nameSize - - var c *wasm.CustomSection - if name != "name" { - if storeCustomSections || dwarfEnabled { - c, err = decodeCustomSection(r, name, uint64(limit)) - if err != nil { - return nil, fmt.Errorf("failed to read custom section name[%s]: %w", name, err) - } - m.CustomSections = append(m.CustomSections, c) - if dwarfEnabled { - switch name { - case ".debug_info": - info = c.Data - case ".debug_line": - line = c.Data - case ".debug_str": - str = c.Data - case ".debug_abbrev": - abbrev = c.Data - case ".debug_ranges": - ranges = c.Data - } - } - } else { - if _, err = io.CopyN(io.Discard, r, int64(limit)); err != nil { - return nil, fmt.Errorf("failed to skip name[%s]: %w", name, err) - } - } - } else { - m.NameSection, err = decodeNameSection(r, uint64(limit)) - } - case wasm.SectionIDType: - m.TypeSection, err = decodeTypeSection(enabledFeatures, r) - case wasm.SectionIDImport: - m.ImportSection, m.ImportPerModule, m.ImportFunctionCount, m.ImportGlobalCount, m.ImportMemoryCount, m.ImportTableCount, err = decodeImportSection(r, memSizer, memoryLimitPages, enabledFeatures) - if err != nil { - return nil, err // avoid re-wrapping the error. - } - case wasm.SectionIDFunction: - m.FunctionSection, err = decodeFunctionSection(r) - case wasm.SectionIDTable: - m.TableSection, err = decodeTableSection(r, enabledFeatures) - case wasm.SectionIDMemory: - m.MemorySection, err = decodeMemorySection(r, memSizer, memoryLimitPages) - case wasm.SectionIDGlobal: - if m.GlobalSection, err = decodeGlobalSection(r, enabledFeatures); err != nil { - return nil, err // avoid re-wrapping the error. - } - case wasm.SectionIDExport: - m.ExportSection, m.Exports, err = decodeExportSection(r) - case wasm.SectionIDStart: - if m.StartSection != nil { - return nil, errors.New("multiple start sections are invalid") - } - m.StartSection, err = decodeStartSection(r) - case wasm.SectionIDElement: - m.ElementSection, err = decodeElementSection(r, enabledFeatures) - case wasm.SectionIDCode: - m.CodeSection, err = decodeCodeSection(r) - case wasm.SectionIDData: - m.DataSection, err = decodeDataSection(r, enabledFeatures) - case wasm.SectionIDDataCount: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - return nil, fmt.Errorf("data count section not supported as %v", err) - } - m.DataCountSection, err = decodeDataCountSection(r) - default: - err = ErrInvalidSectionID - } - - readBytes := sectionContentStart - r.Len() - if err == nil && int(sectionSize) != readBytes { - err = fmt.Errorf("invalid section length: expected to be %d but got %d", sectionSize, readBytes) - } - - if err != nil { - return nil, fmt.Errorf("section %s: %v", wasm.SectionIDName(sectionID), err) - } - } - - if dwarfEnabled { - d, _ := dwarf.New(abbrev, nil, nil, info, line, nil, ranges, str) - m.DWARFLines = wasmdebug.NewDWARFLines(d) - } - - functionCount, codeCount := m.SectionElementCount(wasm.SectionIDFunction), m.SectionElementCount(wasm.SectionIDCode) - if functionCount != codeCount { - return nil, fmt.Errorf("function and code section have inconsistent lengths: %d != %d", functionCount, codeCount) - } - return m, nil -} - -// memorySizer derives min, capacity and max pages from decoded wasm. -type memorySizer func(minPages uint32, maxPages *uint32) (min uint32, capacity uint32, max uint32) - -// newMemorySizer sets capacity to minPages unless max is defined and -// memoryCapacityFromMax is true. -func newMemorySizer(memoryLimitPages uint32, memoryCapacityFromMax bool) memorySizer { - return func(minPages uint32, maxPages *uint32) (min, capacity, max uint32) { - if maxPages != nil { - if memoryCapacityFromMax { - return minPages, *maxPages, *maxPages - } - // This is an invalid value: let it propagate, we will fail later. - if *maxPages > wasm.MemoryLimitPages { - return minPages, minPages, *maxPages - } - // This is a valid value, but it goes over the run-time limit: return the limit. - if *maxPages > memoryLimitPages { - return minPages, minPages, memoryLimitPages - } - return minPages, minPages, *maxPages - } - if memoryCapacityFromMax { - return minPages, memoryLimitPages, memoryLimitPages - } - return minPages, minPages, memoryLimitPages - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go deleted file mode 100644 index 538b98343e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/element.go +++ /dev/null @@ -1,272 +0,0 @@ -package binary - -import ( - "bytes" - "errors" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func ensureElementKindFuncRef(r *bytes.Reader) error { - elemKind, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read element prefix: %w", err) - } - if elemKind != 0x0 { // ElemKind is fixed to 0x0 now: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#element-section - return fmt.Errorf("element kind must be zero but was 0x%x", elemKind) - } - return nil -} - -func decodeElementInitValueVector(r *bytes.Reader) ([]wasm.Index, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - vec := make([]wasm.Index, vs) - for i := range vec { - u32, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("read function index: %w", err) - } - - if u32 >= wasm.MaximumFunctionIndex { - return nil, fmt.Errorf("too large function index in Element init: %d", u32) - } - vec[i] = u32 - } - return vec, nil -} - -func decodeElementConstExprVector(r *bytes.Reader, elemType wasm.RefType, enabledFeatures api.CoreFeatures) ([]wasm.Index, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("failed to get the size of constexpr vector: %w", err) - } - vec := make([]wasm.Index, vs) - for i := range vec { - var expr wasm.ConstantExpression - err := decodeConstantExpression(r, enabledFeatures, &expr) - if err != nil { - return nil, err - } - switch expr.Opcode { - case wasm.OpcodeRefFunc: - if elemType != wasm.RefTypeFuncref { - return nil, fmt.Errorf("element type mismatch: want %s, but constexpr has funcref", wasm.RefTypeName(elemType)) - } - v, _, _ := leb128.LoadUint32(expr.Data) - if v >= wasm.MaximumFunctionIndex { - return nil, fmt.Errorf("too large function index in Element init: %d", v) - } - vec[i] = v - case wasm.OpcodeRefNull: - if elemType != expr.Data[0] { - return nil, fmt.Errorf("element type mismatch: want %s, but constexpr has %s", - wasm.RefTypeName(elemType), wasm.RefTypeName(expr.Data[0])) - } - vec[i] = wasm.ElementInitNullReference - case wasm.OpcodeGlobalGet: - i32, _, _ := leb128.LoadInt32(expr.Data) - if elemType != wasm.RefTypeFuncref { - return nil, fmt.Errorf("element type mismatch: want %s, but requires funcref", wasm.RefTypeName(elemType)) - } - // Resolving the function index is done at instantiation phase. See the comment on - // wasm.ElementInitImportedGlobalFunctionReference. - vec[i] = wasm.ElementInitImportedGlobalFunctionReference | wasm.Index(i32) - default: - return nil, fmt.Errorf("const expr must be either ref.null or ref.func but was %s", wasm.InstructionName(expr.Opcode)) - } - } - return vec, nil -} - -func decodeElementRefType(r *bytes.Reader) (ret wasm.RefType, err error) { - ret, err = r.ReadByte() - if err != nil { - err = fmt.Errorf("read element ref type: %w", err) - return - } - if ret != wasm.RefTypeFuncref && ret != wasm.RefTypeExternref { - return 0, errors.New("ref type must be funcref or externref for element as of WebAssembly 2.0") - } - return -} - -const ( - // The prefix is explained at https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#element-section - - // elementSegmentPrefixLegacy is the legacy prefix and is only valid one before CoreFeatureBulkMemoryOperations. - elementSegmentPrefixLegacy = iota - // elementSegmentPrefixPassiveFuncrefValueVector is the passive element whose indexes are encoded as vec(varint), and reftype is fixed to funcref. - elementSegmentPrefixPassiveFuncrefValueVector - // elementSegmentPrefixActiveFuncrefValueVectorWithTableIndex is the same as elementSegmentPrefixPassiveFuncrefValueVector but active and table index is encoded. - elementSegmentPrefixActiveFuncrefValueVectorWithTableIndex - // elementSegmentPrefixDeclarativeFuncrefValueVector is the same as elementSegmentPrefixPassiveFuncrefValueVector but declarative. - elementSegmentPrefixDeclarativeFuncrefValueVector - // elementSegmentPrefixActiveFuncrefConstExprVector is active whoce reftype is fixed to funcref and indexes are encoded as vec(const_expr). - elementSegmentPrefixActiveFuncrefConstExprVector - // elementSegmentPrefixPassiveConstExprVector is passive whoce indexes are encoded as vec(const_expr), and reftype is encoded. - elementSegmentPrefixPassiveConstExprVector - // elementSegmentPrefixPassiveConstExprVector is active whoce indexes are encoded as vec(const_expr), and reftype and table index are encoded. - elementSegmentPrefixActiveConstExprVector - // elementSegmentPrefixDeclarativeConstExprVector is declarative whoce indexes are encoded as vec(const_expr), and reftype is encoded. - elementSegmentPrefixDeclarativeConstExprVector -) - -func decodeElementSegment(r *bytes.Reader, enabledFeatures api.CoreFeatures, ret *wasm.ElementSegment) error { - prefix, _, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("read element prefix: %w", err) - } - - if prefix != elementSegmentPrefixLegacy { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - return fmt.Errorf("non-zero prefix for element segment is invalid as %w", err) - } - } - - // Encoding depends on the prefix and described at https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#element-section - switch prefix { - case elementSegmentPrefixLegacy: - // Legacy prefix which is WebAssembly 1.0 compatible. - err = decodeConstantExpression(r, enabledFeatures, &ret.OffsetExpr) - if err != nil { - return fmt.Errorf("read expr for offset: %w", err) - } - - ret.Init, err = decodeElementInitValueVector(r) - if err != nil { - return err - } - - ret.Mode = wasm.ElementModeActive - ret.Type = wasm.RefTypeFuncref - return nil - case elementSegmentPrefixPassiveFuncrefValueVector: - // Prefix 1 requires funcref. - if err = ensureElementKindFuncRef(r); err != nil { - return err - } - - ret.Init, err = decodeElementInitValueVector(r) - if err != nil { - return err - } - ret.Mode = wasm.ElementModePassive - ret.Type = wasm.RefTypeFuncref - return nil - case elementSegmentPrefixActiveFuncrefValueVectorWithTableIndex: - ret.TableIndex, _, err = leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("get size of vector: %w", err) - } - - if ret.TableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("table index must be zero but was %d: %w", ret.TableIndex, err) - } - } - - err := decodeConstantExpression(r, enabledFeatures, &ret.OffsetExpr) - if err != nil { - return fmt.Errorf("read expr for offset: %w", err) - } - - // Prefix 2 requires funcref. - if err = ensureElementKindFuncRef(r); err != nil { - return err - } - - ret.Init, err = decodeElementInitValueVector(r) - if err != nil { - return err - } - - ret.Mode = wasm.ElementModeActive - ret.Type = wasm.RefTypeFuncref - return nil - case elementSegmentPrefixDeclarativeFuncrefValueVector: - // Prefix 3 requires funcref. - if err = ensureElementKindFuncRef(r); err != nil { - return err - } - ret.Init, err = decodeElementInitValueVector(r) - if err != nil { - return err - } - ret.Type = wasm.RefTypeFuncref - ret.Mode = wasm.ElementModeDeclarative - return nil - case elementSegmentPrefixActiveFuncrefConstExprVector: - err := decodeConstantExpression(r, enabledFeatures, &ret.OffsetExpr) - if err != nil { - return fmt.Errorf("read expr for offset: %w", err) - } - - ret.Init, err = decodeElementConstExprVector(r, wasm.RefTypeFuncref, enabledFeatures) - if err != nil { - return err - } - ret.Mode = wasm.ElementModeActive - ret.Type = wasm.RefTypeFuncref - return nil - case elementSegmentPrefixPassiveConstExprVector: - ret.Type, err = decodeElementRefType(r) - if err != nil { - return err - } - ret.Init, err = decodeElementConstExprVector(r, ret.Type, enabledFeatures) - if err != nil { - return err - } - ret.Mode = wasm.ElementModePassive - return nil - case elementSegmentPrefixActiveConstExprVector: - ret.TableIndex, _, err = leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("get size of vector: %w", err) - } - - if ret.TableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("table index must be zero but was %d: %w", ret.TableIndex, err) - } - } - err := decodeConstantExpression(r, enabledFeatures, &ret.OffsetExpr) - if err != nil { - return fmt.Errorf("read expr for offset: %w", err) - } - - ret.Type, err = decodeElementRefType(r) - if err != nil { - return err - } - - ret.Init, err = decodeElementConstExprVector(r, ret.Type, enabledFeatures) - if err != nil { - return err - } - - ret.Mode = wasm.ElementModeActive - return nil - case elementSegmentPrefixDeclarativeConstExprVector: - ret.Type, err = decodeElementRefType(r) - if err != nil { - return err - } - ret.Init, err = decodeElementConstExprVector(r, ret.Type, enabledFeatures) - if err != nil { - return err - } - - ret.Mode = wasm.ElementModeDeclarative - return nil - default: - return fmt.Errorf("invalid element segment prefix: 0x%x", prefix) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go deleted file mode 100644 index b9125b0387..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/errors.go +++ /dev/null @@ -1,11 +0,0 @@ -package binary - -import "errors" - -var ( - ErrInvalidByte = errors.New("invalid byte") - ErrInvalidMagicNumber = errors.New("invalid magic number") - ErrInvalidVersion = errors.New("invalid version header") - ErrInvalidSectionID = errors.New("invalid section id") - ErrCustomSectionNotFound = errors.New("custom section not found") -) diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go deleted file mode 100644 index 925e9c499f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/export.go +++ /dev/null @@ -1,32 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeExport(r *bytes.Reader, ret *wasm.Export) (err error) { - if ret.Name, _, err = decodeUTF8(r, "export name"); err != nil { - return - } - - b, err := r.ReadByte() - if err != nil { - err = fmt.Errorf("error decoding export kind: %w", err) - return - } - - ret.Type = b - switch ret.Type { - case wasm.ExternTypeFunc, wasm.ExternTypeTable, wasm.ExternTypeMemory, wasm.ExternTypeGlobal: - if ret.Index, _, err = leb128.DecodeUint32(r); err != nil { - err = fmt.Errorf("error decoding export index: %w", err) - } - default: - err = fmt.Errorf("%w: invalid byte for exportdesc: %#x", ErrInvalidByte, b) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go deleted file mode 100644 index bb9e2b649e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/function.go +++ /dev/null @@ -1,56 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeFunctionType(enabledFeatures api.CoreFeatures, r *bytes.Reader, ret *wasm.FunctionType) (err error) { - b, err := r.ReadByte() - if err != nil { - return fmt.Errorf("read leading byte: %w", err) - } - - if b != 0x60 { - return fmt.Errorf("%w: %#x != 0x60", ErrInvalidByte, b) - } - - paramCount, _, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("could not read parameter count: %w", err) - } - - paramTypes, err := decodeValueTypes(r, paramCount) - if err != nil { - return fmt.Errorf("could not read parameter types: %w", err) - } - - resultCount, _, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("could not read result count: %w", err) - } - - // Guard >1.0 feature multi-value - if resultCount > 1 { - if err = enabledFeatures.RequireEnabled(api.CoreFeatureMultiValue); err != nil { - return fmt.Errorf("multiple result types invalid as %v", err) - } - } - - resultTypes, err := decodeValueTypes(r, resultCount) - if err != nil { - return fmt.Errorf("could not read result types: %w", err) - } - - ret.Params = paramTypes - ret.Results = resultTypes - - // cache the key for the function type - _ = ret.String() - - return nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go deleted file mode 100644 index 4e1c16fda4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/global.go +++ /dev/null @@ -1,50 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// decodeGlobal returns the api.Global decoded with the WebAssembly 1.0 (20191205) Binary Format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-global -func decodeGlobal(r *bytes.Reader, enabledFeatures api.CoreFeatures, ret *wasm.Global) (err error) { - ret.Type, err = decodeGlobalType(r) - if err != nil { - return err - } - - err = decodeConstantExpression(r, enabledFeatures, &ret.Init) - return -} - -// decodeGlobalType returns the wasm.GlobalType decoded with the WebAssembly 1.0 (20191205) Binary Format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-globaltype -func decodeGlobalType(r *bytes.Reader) (wasm.GlobalType, error) { - vt, err := decodeValueTypes(r, 1) - if err != nil { - return wasm.GlobalType{}, fmt.Errorf("read value type: %w", err) - } - - ret := wasm.GlobalType{ - ValType: vt[0], - } - - b, err := r.ReadByte() - if err != nil { - return wasm.GlobalType{}, fmt.Errorf("read mutablity: %w", err) - } - - switch mut := b; mut { - case 0x00: // not mutable - case 0x01: // mutable - ret.Mutable = true - default: - return wasm.GlobalType{}, fmt.Errorf("%w for mutability: %#x != 0x00 or 0x01", ErrInvalidByte, mut) - } - return ret, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go deleted file mode 100644 index 29ba1b599e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/header.go +++ /dev/null @@ -1,9 +0,0 @@ -package binary - -// Magic is the 4 byte preamble (literally "\0asm") of the binary format -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-magic -var Magic = []byte{0x00, 0x61, 0x73, 0x6D} - -// version is format version and doesn't change between known specification versions -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-version -var version = []byte{0x01, 0x00, 0x00, 0x00} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go deleted file mode 100644 index 666636177c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/import.go +++ /dev/null @@ -1,52 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeImport( - r *bytes.Reader, - idx uint32, - memorySizer memorySizer, - memoryLimitPages uint32, - enabledFeatures api.CoreFeatures, - ret *wasm.Import, -) (err error) { - if ret.Module, _, err = decodeUTF8(r, "import module"); err != nil { - err = fmt.Errorf("import[%d] error decoding module: %w", idx, err) - return - } - - if ret.Name, _, err = decodeUTF8(r, "import name"); err != nil { - err = fmt.Errorf("import[%d] error decoding name: %w", idx, err) - return - } - - b, err := r.ReadByte() - if err != nil { - err = fmt.Errorf("import[%d] error decoding type: %w", idx, err) - return - } - ret.Type = b - switch ret.Type { - case wasm.ExternTypeFunc: - ret.DescFunc, _, err = leb128.DecodeUint32(r) - case wasm.ExternTypeTable: - err = decodeTable(r, enabledFeatures, &ret.DescTable) - case wasm.ExternTypeMemory: - ret.DescMem, err = decodeMemory(r, memorySizer, memoryLimitPages) - case wasm.ExternTypeGlobal: - ret.DescGlobal, err = decodeGlobalType(r) - default: - err = fmt.Errorf("%w: invalid byte for importdesc: %#x", ErrInvalidByte, b) - } - if err != nil { - err = fmt.Errorf("import[%d] %s[%s.%s]: %w", idx, wasm.ExternTypeName(ret.Type), ret.Module, ret.Name, err) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go deleted file mode 100644 index 1ec8d7c302..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/limits.go +++ /dev/null @@ -1,42 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/internal/leb128" -) - -// decodeLimitsType returns the `limitsType` (min, max) decoded with the WebAssembly 1.0 (20191205) Binary Format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#limits%E2%91%A6 -func decodeLimitsType(r *bytes.Reader) (min uint32, max *uint32, err error) { - var flag byte - if flag, err = r.ReadByte(); err != nil { - err = fmt.Errorf("read leading byte: %v", err) - return - } - - switch flag { - case 0x00: - min, _, err = leb128.DecodeUint32(r) - if err != nil { - err = fmt.Errorf("read min of limit: %v", err) - } - case 0x01: - min, _, err = leb128.DecodeUint32(r) - if err != nil { - err = fmt.Errorf("read min of limit: %v", err) - return - } - var m uint32 - if m, _, err = leb128.DecodeUint32(r); err != nil { - err = fmt.Errorf("read max of limit: %v", err) - } else { - max = &m - } - default: - err = fmt.Errorf("%v for limits: %#x != 0x00 or 0x01", ErrInvalidByte, flag) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go deleted file mode 100644 index fd6b32a670..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/memory.go +++ /dev/null @@ -1,26 +0,0 @@ -package binary - -import ( - "bytes" - - "github.com/tetratelabs/wazero/internal/wasm" -) - -// decodeMemory returns the api.Memory decoded with the WebAssembly 1.0 (20191205) Binary Format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-memory -func decodeMemory( - r *bytes.Reader, - memorySizer func(minPages uint32, maxPages *uint32) (min, capacity, max uint32), - memoryLimitPages uint32, -) (*wasm.Memory, error) { - min, maxP, err := decodeLimitsType(r) - if err != nil { - return nil, err - } - - min, capacity, max := memorySizer(min, maxP) - mem := &wasm.Memory{Min: min, Cap: capacity, Max: max, IsMaxEncoded: maxP != nil} - - return mem, mem.Validate(memoryLimitPages) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go deleted file mode 100644 index 56fb96dc82..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/names.go +++ /dev/null @@ -1,151 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -const ( - // subsectionIDModuleName contains only the module name. - subsectionIDModuleName = uint8(0) - // subsectionIDFunctionNames is a map of indices to function names, in ascending order by function index - subsectionIDFunctionNames = uint8(1) - // subsectionIDLocalNames contain a map of function indices to a map of local indices to their names, in ascending - // order by function and local index - subsectionIDLocalNames = uint8(2) -) - -// decodeNameSection deserializes the data associated with the "name" key in SectionIDCustom according to the -// standard: -// -// * ModuleName decode from subsection 0 -// * FunctionNames decode from subsection 1 -// * LocalNames decode from subsection 2 -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-namesec -func decodeNameSection(r *bytes.Reader, limit uint64) (result *wasm.NameSection, err error) { - // TODO: add leb128 functions that work on []byte and offset. While using a reader allows us to reuse reader-based - // leb128 functions, it is less efficient, causes untestable code and in some cases more complex vs plain []byte. - result = &wasm.NameSection{} - - // subsectionID is decoded if known, and skipped if not - var subsectionID uint8 - // subsectionSize is the length to skip when the subsectionID is unknown - var subsectionSize uint32 - var bytesRead uint64 - for limit > 0 { - if subsectionID, err = r.ReadByte(); err != nil { - if err == io.EOF { - return result, nil - } - // TODO: untestable as this can't fail for a reason beside EOF reading a byte from a buffer - return nil, fmt.Errorf("failed to read a subsection ID: %w", err) - } - limit-- - - if subsectionSize, bytesRead, err = leb128.DecodeUint32(r); err != nil { - return nil, fmt.Errorf("failed to read the size of subsection[%d]: %w", subsectionID, err) - } - limit -= bytesRead - - switch subsectionID { - case subsectionIDModuleName: - if result.ModuleName, _, err = decodeUTF8(r, "module name"); err != nil { - return nil, err - } - case subsectionIDFunctionNames: - if result.FunctionNames, err = decodeFunctionNames(r); err != nil { - return nil, err - } - case subsectionIDLocalNames: - if result.LocalNames, err = decodeLocalNames(r); err != nil { - return nil, err - } - default: // Skip other subsections. - // Note: Not Seek because it doesn't err when given an offset past EOF. Rather, it leads to undefined state. - if _, err = io.CopyN(io.Discard, r, int64(subsectionSize)); err != nil { - return nil, fmt.Errorf("failed to skip subsection[%d]: %w", subsectionID, err) - } - } - limit -= uint64(subsectionSize) - } - return -} - -func decodeFunctionNames(r *bytes.Reader) (wasm.NameMap, error) { - functionCount, err := decodeFunctionCount(r, subsectionIDFunctionNames) - if err != nil { - return nil, err - } - - result := make(wasm.NameMap, functionCount) - for i := uint32(0); i < functionCount; i++ { - functionIndex, err := decodeFunctionIndex(r, subsectionIDFunctionNames) - if err != nil { - return nil, err - } - - name, _, err := decodeUTF8(r, "function[%d] name", functionIndex) - if err != nil { - return nil, err - } - result[i] = wasm.NameAssoc{Index: functionIndex, Name: name} - } - return result, nil -} - -func decodeLocalNames(r *bytes.Reader) (wasm.IndirectNameMap, error) { - functionCount, err := decodeFunctionCount(r, subsectionIDLocalNames) - if err != nil { - return nil, err - } - - result := make(wasm.IndirectNameMap, functionCount) - for i := uint32(0); i < functionCount; i++ { - functionIndex, err := decodeFunctionIndex(r, subsectionIDLocalNames) - if err != nil { - return nil, err - } - - localCount, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("failed to read the local count for function[%d]: %w", functionIndex, err) - } - - locals := make(wasm.NameMap, localCount) - for j := uint32(0); j < localCount; j++ { - localIndex, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("failed to read a local index of function[%d]: %w", functionIndex, err) - } - - name, _, err := decodeUTF8(r, "function[%d] local[%d] name", functionIndex, localIndex) - if err != nil { - return nil, err - } - locals[j] = wasm.NameAssoc{Index: localIndex, Name: name} - } - result[i] = wasm.NameMapAssoc{Index: functionIndex, NameMap: locals} - } - return result, nil -} - -func decodeFunctionIndex(r *bytes.Reader, subsectionID uint8) (uint32, error) { - functionIndex, _, err := leb128.DecodeUint32(r) - if err != nil { - return 0, fmt.Errorf("failed to read a function index in subsection[%d]: %w", subsectionID, err) - } - return functionIndex, nil -} - -func decodeFunctionCount(r *bytes.Reader, subsectionID uint8) (uint32, error) { - functionCount, _, err := leb128.DecodeUint32(r) - if err != nil { - return 0, fmt.Errorf("failed to read the function count of subsection[%d]: %w", subsectionID, err) - } - return functionCount, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go deleted file mode 100644 index a4111572fa..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/section.go +++ /dev/null @@ -1,225 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeTypeSection(enabledFeatures api.CoreFeatures, r *bytes.Reader) ([]wasm.FunctionType, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]wasm.FunctionType, vs) - for i := uint32(0); i < vs; i++ { - if err = decodeFunctionType(enabledFeatures, r, &result[i]); err != nil { - return nil, fmt.Errorf("read %d-th type: %v", i, err) - } - } - return result, nil -} - -// decodeImportSection decodes the decoded import segments plus the count per wasm.ExternType. -func decodeImportSection( - r *bytes.Reader, - memorySizer memorySizer, - memoryLimitPages uint32, - enabledFeatures api.CoreFeatures, -) (result []wasm.Import, - perModule map[string][]*wasm.Import, - funcCount, globalCount, memoryCount, tableCount wasm.Index, err error, -) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - err = fmt.Errorf("get size of vector: %w", err) - return - } - - perModule = make(map[string][]*wasm.Import) - result = make([]wasm.Import, vs) - for i := uint32(0); i < vs; i++ { - imp := &result[i] - if err = decodeImport(r, i, memorySizer, memoryLimitPages, enabledFeatures, imp); err != nil { - return - } - switch imp.Type { - case wasm.ExternTypeFunc: - imp.IndexPerType = funcCount - funcCount++ - case wasm.ExternTypeGlobal: - imp.IndexPerType = globalCount - globalCount++ - case wasm.ExternTypeMemory: - imp.IndexPerType = memoryCount - memoryCount++ - case wasm.ExternTypeTable: - imp.IndexPerType = tableCount - tableCount++ - } - perModule[imp.Module] = append(perModule[imp.Module], imp) - } - return -} - -func decodeFunctionSection(r *bytes.Reader) ([]uint32, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]uint32, vs) - for i := uint32(0); i < vs; i++ { - if result[i], _, err = leb128.DecodeUint32(r); err != nil { - return nil, fmt.Errorf("get type index: %w", err) - } - } - return result, err -} - -func decodeTableSection(r *bytes.Reader, enabledFeatures api.CoreFeatures) ([]wasm.Table, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("error reading size") - } - if vs > 1 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return nil, fmt.Errorf("at most one table allowed in module as %w", err) - } - } - - ret := make([]wasm.Table, vs) - for i := range ret { - err = decodeTable(r, enabledFeatures, &ret[i]) - if err != nil { - return nil, err - } - } - return ret, nil -} - -func decodeMemorySection( - r *bytes.Reader, - memorySizer memorySizer, - memoryLimitPages uint32, -) (*wasm.Memory, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("error reading size") - } - if vs > 1 { - return nil, fmt.Errorf("at most one memory allowed in module, but read %d", vs) - } else if vs == 0 { - // memory count can be zero. - return nil, nil - } - - return decodeMemory(r, memorySizer, memoryLimitPages) -} - -func decodeGlobalSection(r *bytes.Reader, enabledFeatures api.CoreFeatures) ([]wasm.Global, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]wasm.Global, vs) - for i := uint32(0); i < vs; i++ { - if err = decodeGlobal(r, enabledFeatures, &result[i]); err != nil { - return nil, fmt.Errorf("global[%d]: %w", i, err) - } - } - return result, nil -} - -func decodeExportSection(r *bytes.Reader) ([]wasm.Export, map[string]*wasm.Export, error) { - vs, _, sizeErr := leb128.DecodeUint32(r) - if sizeErr != nil { - return nil, nil, fmt.Errorf("get size of vector: %v", sizeErr) - } - - exportMap := make(map[string]*wasm.Export, vs) - exportSection := make([]wasm.Export, vs) - for i := wasm.Index(0); i < vs; i++ { - export := &exportSection[i] - err := decodeExport(r, export) - if err != nil { - return nil, nil, fmt.Errorf("read export: %w", err) - } - if _, ok := exportMap[export.Name]; ok { - return nil, nil, fmt.Errorf("export[%d] duplicates name %q", i, export.Name) - } else { - exportMap[export.Name] = export - } - } - return exportSection, exportMap, nil -} - -func decodeStartSection(r *bytes.Reader) (*wasm.Index, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get function index: %w", err) - } - return &vs, nil -} - -func decodeElementSection(r *bytes.Reader, enabledFeatures api.CoreFeatures) ([]wasm.ElementSegment, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]wasm.ElementSegment, vs) - for i := uint32(0); i < vs; i++ { - if err = decodeElementSegment(r, enabledFeatures, &result[i]); err != nil { - return nil, fmt.Errorf("read element: %w", err) - } - } - return result, nil -} - -func decodeCodeSection(r *bytes.Reader) ([]wasm.Code, error) { - codeSectionStart := uint64(r.Len()) - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]wasm.Code, vs) - for i := uint32(0); i < vs; i++ { - err = decodeCode(r, codeSectionStart, &result[i]) - if err != nil { - return nil, fmt.Errorf("read %d-th code segment: %v", i, err) - } - } - return result, nil -} - -func decodeDataSection(r *bytes.Reader, enabledFeatures api.CoreFeatures) ([]wasm.DataSegment, error) { - vs, _, err := leb128.DecodeUint32(r) - if err != nil { - return nil, fmt.Errorf("get size of vector: %w", err) - } - - result := make([]wasm.DataSegment, vs) - for i := uint32(0); i < vs; i++ { - if err = decodeDataSegment(r, enabledFeatures, &result[i]); err != nil { - return nil, fmt.Errorf("read data segment: %w", err) - } - } - return result, nil -} - -func decodeDataCountSection(r *bytes.Reader) (count *uint32, err error) { - v, _, err := leb128.DecodeUint32(r) - if err != nil && err != io.EOF { - // data count is optional, so EOF is fine. - return nil, err - } - return &v, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go deleted file mode 100644 index cb5aa75e7c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/table.go +++ /dev/null @@ -1,39 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasm" -) - -// decodeTable returns the wasm.Table decoded with the WebAssembly 1.0 (20191205) Binary Format. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-table -func decodeTable(r *bytes.Reader, enabledFeatures api.CoreFeatures, ret *wasm.Table) (err error) { - ret.Type, err = r.ReadByte() - if err != nil { - return fmt.Errorf("read leading byte: %v", err) - } - - if ret.Type != wasm.RefTypeFuncref { - if err = enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("table type funcref is invalid: %w", err) - } - } - - ret.Min, ret.Max, err = decodeLimitsType(r) - if err != nil { - return fmt.Errorf("read limits: %v", err) - } - if ret.Min > wasm.MaximumFunctionIndex { - return fmt.Errorf("table min must be at most %d", wasm.MaximumFunctionIndex) - } - if ret.Max != nil { - if *ret.Max < ret.Min { - return fmt.Errorf("table size minimum must not be greater than maximum") - } - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go deleted file mode 100644 index 755ee5ea3e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/binary/value.go +++ /dev/null @@ -1,60 +0,0 @@ -package binary - -import ( - "bytes" - "fmt" - "io" - "unicode/utf8" - "unsafe" - - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -func decodeValueTypes(r *bytes.Reader, num uint32) ([]wasm.ValueType, error) { - if num == 0 { - return nil, nil - } - - ret := make([]wasm.ValueType, num) - _, err := io.ReadFull(r, ret) - if err != nil { - return nil, err - } - - for _, v := range ret { - switch v { - case wasm.ValueTypeI32, wasm.ValueTypeF32, wasm.ValueTypeI64, wasm.ValueTypeF64, - wasm.ValueTypeExternref, wasm.ValueTypeFuncref, wasm.ValueTypeV128: - default: - return nil, fmt.Errorf("invalid value type: %d", v) - } - } - return ret, nil -} - -// decodeUTF8 decodes a size prefixed string from the reader, returning it and the count of bytes read. -// contextFormat and contextArgs apply an error format when present -func decodeUTF8(r *bytes.Reader, contextFormat string, contextArgs ...interface{}) (string, uint32, error) { - size, sizeOfSize, err := leb128.DecodeUint32(r) - if err != nil { - return "", 0, fmt.Errorf("failed to read %s size: %w", fmt.Sprintf(contextFormat, contextArgs...), err) - } - - if size == 0 { - return "", uint32(sizeOfSize), nil - } - - buf := make([]byte, size) - if _, err = io.ReadFull(r, buf); err != nil { - return "", 0, fmt.Errorf("failed to read %s: %w", fmt.Sprintf(contextFormat, contextArgs...), err) - } - - if !utf8.Valid(buf) { - return "", 0, fmt.Errorf("%s is not valid UTF-8", fmt.Sprintf(contextFormat, contextArgs...)) - } - - // TODO: use unsafe.String after flooring Go 1.20. - ret := *(*string)(unsafe.Pointer(&buf)) - return ret, size + uint32(sizeOfSize), nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/counts.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/counts.go deleted file mode 100644 index 685a409419..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/counts.go +++ /dev/null @@ -1,51 +0,0 @@ -package wasm - -import "fmt" - -// SectionElementCount returns the count of elements in a given section ID -// -// For example... -// * SectionIDType returns the count of FunctionType -// * SectionIDCustom returns the count of CustomSections plus one if NameSection is present -// * SectionIDHostFunction returns the count of HostFunctionSection -// * SectionIDExport returns the count of unique export names -func (m *Module) SectionElementCount(sectionID SectionID) uint32 { // element as in vector elements! - switch sectionID { - case SectionIDCustom: - numCustomSections := uint32(len(m.CustomSections)) - if m.NameSection != nil { - numCustomSections++ - } - return numCustomSections - case SectionIDType: - return uint32(len(m.TypeSection)) - case SectionIDImport: - return uint32(len(m.ImportSection)) - case SectionIDFunction: - return uint32(len(m.FunctionSection)) - case SectionIDTable: - return uint32(len(m.TableSection)) - case SectionIDMemory: - if m.MemorySection != nil { - return 1 - } - return 0 - case SectionIDGlobal: - return uint32(len(m.GlobalSection)) - case SectionIDExport: - return uint32(len(m.ExportSection)) - case SectionIDStart: - if m.StartSection != nil { - return 1 - } - return 0 - case SectionIDElement: - return uint32(len(m.ElementSection)) - case SectionIDCode: - return uint32(len(m.CodeSection)) - case SectionIDData: - return uint32(len(m.DataSection)) - default: - panic(fmt.Errorf("BUG: unknown section: %d", sectionID)) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/engine.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/engine.go deleted file mode 100644 index 0d03243283..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/engine.go +++ /dev/null @@ -1,54 +0,0 @@ -package wasm - -import ( - "context" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/experimental" -) - -// Engine is a Store-scoped mechanism to compile functions declared or imported by a module. -// This is a top-level type implemented by an interpreter or compiler. -type Engine interface { - // Close closes this engine, and releases all the compiled cache. - Close() (err error) - - // CompileModule implements the same method as documented on wasm.Engine. - CompileModule(ctx context.Context, module *Module, listeners []experimental.FunctionListener, ensureTermination bool) error - - // CompiledModuleCount is exported for testing, to track the size of the compilation cache. - CompiledModuleCount() uint32 - - // DeleteCompiledModule releases compilation caches for the given module (source). - // Note: it is safe to call this function for a module from which module instances are instantiated even when these - // module instances have outstanding calls. - DeleteCompiledModule(module *Module) - - // NewModuleEngine compiles down the function instances in a module, and returns ModuleEngine for the module. - // - // * module is the source module from which moduleFunctions are instantiated. This is used for caching. - // * instance is the *ModuleInstance which is created from `module`. - // - // Note: Input parameters must be pre-validated with wasm.Module Validate, to ensure no fields are invalid - // due to reasons such as out-of-bounds. - NewModuleEngine(module *Module, instance *ModuleInstance) (ModuleEngine, error) -} - -// ModuleEngine implements function calls for a given module. -type ModuleEngine interface { - // NewFunction returns an api.Function for the given function pointed by the given Index. - NewFunction(index Index) api.Function - - // ResolveImportedFunction is used to add imported functions needed to make this ModuleEngine fully functional. - // - `index` is the function Index of this imported function. - // - `indexInImportedModule` is the function Index of the imported function in the imported module. - // - `importedModuleEngine` is the ModuleEngine for the imported ModuleInstance. - ResolveImportedFunction(index, indexInImportedModule Index, importedModuleEngine ModuleEngine) - - // LookupFunction returns the api.Function created from the function in the function table at the given offset. - LookupFunction(t *TableInstance, typeId FunctionTypeID, tableOffset Index) (api.Function, error) - - // FunctionInstanceReference returns Reference for the given Index for a FunctionInstance. The returned values are used by - // the initialization via ElementSegment. - FunctionInstanceReference(funcIndex Index) Reference -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go deleted file mode 100644 index e9aef72c8d..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/func_validation.go +++ /dev/null @@ -1,1954 +0,0 @@ -package wasm - -import ( - "bytes" - "errors" - "fmt" - "strconv" - "strings" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" -) - -// The wazero specific limitation described at RATIONALE.md. -const maximumValuesOnStack = 1 << 27 - -// validateFunction validates the instruction sequence of a function. -// following the specification https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#instructions%E2%91%A2. -// -// * idx is the index in the FunctionSection -// * functions are the function index, which is prefixed by imports. The value is the TypeSection index. -// * globals are the global index, which is prefixed by imports. -// * memory is the potentially imported memory and can be nil. -// * table is the potentially imported table and can be nil. -// * declaredFunctionIndexes is the set of function indexes declared by declarative element segments which can be acceed by OpcodeRefFunc instruction. -// -// Returns an error if the instruction sequence is not valid, -// or potentially it can exceed the maximum number of values on the stack. -func (m *Module) validateFunction(sts *stacks, enabledFeatures api.CoreFeatures, idx Index, functions []Index, - globals []GlobalType, memory *Memory, tables []Table, declaredFunctionIndexes map[Index]struct{}, br *bytes.Reader, -) error { - return m.validateFunctionWithMaxStackValues(sts, enabledFeatures, idx, functions, globals, memory, tables, maximumValuesOnStack, declaredFunctionIndexes, br) -} - -func readMemArg(pc uint64, body []byte) (align, offset uint32, read uint64, err error) { - align, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - err = fmt.Errorf("read memory align: %v", err) - return - } - read += num - - offset, num, err = leb128.LoadUint32(body[pc+num:]) - if err != nil { - err = fmt.Errorf("read memory offset: %v", err) - return - } - - read += num - return align, offset, read, nil -} - -// validateFunctionWithMaxStackValues is like validateFunction, but allows overriding maxStackValues for testing. -// -// * stacks is to track the state of Wasm value and control frame stacks at anypoint of execution, and reused to reduce allocation. -// * maxStackValues is the maximum height of values stack which the target is allowed to reach. -func (m *Module) validateFunctionWithMaxStackValues( - sts *stacks, - enabledFeatures api.CoreFeatures, - idx Index, - functions []Index, - globals []GlobalType, - memory *Memory, - tables []Table, - maxStackValues int, - declaredFunctionIndexes map[Index]struct{}, - br *bytes.Reader, -) error { - functionType := &m.TypeSection[m.FunctionSection[idx]] - code := &m.CodeSection[idx] - body := code.Body - localTypes := code.LocalTypes - - sts.reset(functionType) - valueTypeStack := &sts.vs - // We start with the outermost control block which is for function return if the code branches into it. - controlBlockStack := &sts.cs - - // Now start walking through all the instructions in the body while tracking - // control blocks and value types to check the validity of all instructions. - for pc := uint64(0); pc < uint64(len(body)); pc++ { - op := body[pc] - if false { - var instName string - if op == OpcodeMiscPrefix { - instName = MiscInstructionName(body[pc+1]) - } else if op == OpcodeVecPrefix { - instName = VectorInstructionName(body[pc+1]) - } else { - instName = InstructionName(op) - } - fmt.Printf("handling %s, stack=%s, blocks: %v\n", instName, valueTypeStack.stack, controlBlockStack) - } - - if OpcodeI32Load <= op && op <= OpcodeI64Store32 { - if memory == nil { - return fmt.Errorf("memory must exist for %s", InstructionName(op)) - } - pc++ - align, _, read, err := readMemArg(pc, body) - if err != nil { - return err - } - pc += read - 1 - switch op { - case OpcodeI32Load: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI32) - case OpcodeF32Load: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeF32) - case OpcodeI32Store: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeF32Store: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI64Load: - if 1< 64/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI64) - case OpcodeF64Load: - if 1< 64/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeF64) - case OpcodeI64Store: - if 1< 64/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeF64Store: - if 1< 64/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI32Load8S: - if 1< 1 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32Load8U: - if 1< 1 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Load8S, OpcodeI64Load8U: - if 1< 1 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI32Store8: - if 1< 1 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI64Store8: - if 1< 1 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI32Load16S, OpcodeI32Load16U: - if 1< 16/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Load16S, OpcodeI64Load16U: - if 1< 16/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI32Store16: - if 1< 16/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI64Store16: - if 1< 16/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - case OpcodeI64Load32S, OpcodeI64Load32U: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI64Store32: - if 1< 32/8 { - return fmt.Errorf("invalid memory alignment") - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return err - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - } - } else if OpcodeMemorySize <= op && op <= OpcodeMemoryGrow { - if memory == nil { - return fmt.Errorf("memory must exist for %s", InstructionName(op)) - } - pc++ - val, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } - if val != 0 || num != 1 { - return fmt.Errorf("memory instruction reserved bytes not zero with 1 byte") - } - switch Opcode(op) { - case OpcodeMemoryGrow: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return err - } - valueTypeStack.push(ValueTypeI32) - case OpcodeMemorySize: - valueTypeStack.push(ValueTypeI32) - } - pc += num - 1 - } else if OpcodeI32Const <= op && op <= OpcodeF64Const { - pc++ - switch Opcode(op) { - case OpcodeI32Const: - _, num, err := leb128.LoadInt32(body[pc:]) - if err != nil { - return fmt.Errorf("read i32 immediate: %s", err) - } - pc += num - 1 - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Const: - _, num, err := leb128.LoadInt64(body[pc:]) - if err != nil { - return fmt.Errorf("read i64 immediate: %v", err) - } - valueTypeStack.push(ValueTypeI64) - pc += num - 1 - case OpcodeF32Const: - valueTypeStack.push(ValueTypeF32) - pc += 3 - case OpcodeF64Const: - valueTypeStack.push(ValueTypeF64) - pc += 7 - } - } else if OpcodeLocalGet <= op && op <= OpcodeGlobalSet { - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } - pc += num - 1 - switch op { - case OpcodeLocalGet: - inputLen := uint32(len(functionType.Params)) - if l := uint32(len(localTypes)) + inputLen; index >= l { - return fmt.Errorf("invalid local index for %s %d >= %d(=len(locals)+len(parameters))", - OpcodeLocalGetName, index, l) - } - if index < inputLen { - valueTypeStack.push(functionType.Params[index]) - } else { - valueTypeStack.push(localTypes[index-inputLen]) - } - case OpcodeLocalSet: - inputLen := uint32(len(functionType.Params)) - if l := uint32(len(localTypes)) + inputLen; index >= l { - return fmt.Errorf("invalid local index for %s %d >= %d(=len(locals)+len(parameters))", - OpcodeLocalSetName, index, l) - } - var expType ValueType - if index < inputLen { - expType = functionType.Params[index] - } else { - expType = localTypes[index-inputLen] - } - if err := valueTypeStack.popAndVerifyType(expType); err != nil { - return err - } - case OpcodeLocalTee: - inputLen := uint32(len(functionType.Params)) - if l := uint32(len(localTypes)) + inputLen; index >= l { - return fmt.Errorf("invalid local index for %s %d >= %d(=len(locals)+len(parameters))", - OpcodeLocalTeeName, index, l) - } - var expType ValueType - if index < inputLen { - expType = functionType.Params[index] - } else { - expType = localTypes[index-inputLen] - } - if err := valueTypeStack.popAndVerifyType(expType); err != nil { - return err - } - valueTypeStack.push(expType) - case OpcodeGlobalGet: - if index >= uint32(len(globals)) { - return fmt.Errorf("invalid index for %s", OpcodeGlobalGetName) - } - valueTypeStack.push(globals[index].ValType) - case OpcodeGlobalSet: - if index >= uint32(len(globals)) { - return fmt.Errorf("invalid global index") - } else if !globals[index].Mutable { - return fmt.Errorf("%s when not mutable", OpcodeGlobalSetName) - } else if err := valueTypeStack.popAndVerifyType( - globals[index].ValType); err != nil { - return err - } - } - } else if op == OpcodeBr { - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } else if int(index) >= len(controlBlockStack.stack) { - return fmt.Errorf("invalid %s operation: index out of range", OpcodeBrName) - } - pc += num - 1 - // Check type soundness. - target := &controlBlockStack.stack[len(controlBlockStack.stack)-int(index)-1] - var targetResultType []ValueType - if target.op == OpcodeLoop { - targetResultType = target.blockType.Params - } else { - targetResultType = target.blockType.Results - } - if err = valueTypeStack.popResults(op, targetResultType, false); err != nil { - return err - } - // br instruction is stack-polymorphic. - valueTypeStack.unreachable() - } else if op == OpcodeBrIf { - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } else if int(index) >= len(controlBlockStack.stack) { - return fmt.Errorf( - "invalid ln param given for %s: index=%d with %d for the current label stack length", - OpcodeBrIfName, index, len(controlBlockStack.stack)) - } - pc += num - 1 - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the required operand for %s", OpcodeBrIfName) - } - // Check type soundness. - target := &controlBlockStack.stack[len(controlBlockStack.stack)-int(index)-1] - var targetResultType []ValueType - if target.op == OpcodeLoop { - targetResultType = target.blockType.Params - } else { - targetResultType = target.blockType.Results - } - if err := valueTypeStack.popResults(op, targetResultType, false); err != nil { - return err - } - // Push back the result - for _, t := range targetResultType { - valueTypeStack.push(t) - } - } else if op == OpcodeBrTable { - pc++ - br.Reset(body[pc:]) - nl, num, err := leb128.DecodeUint32(br) - if err != nil { - return fmt.Errorf("read immediate: %w", err) - } - - list := make([]uint32, nl) - for i := uint32(0); i < nl; i++ { - l, n, err := leb128.DecodeUint32(br) - if err != nil { - return fmt.Errorf("read immediate: %w", err) - } - num += n - list[i] = l - } - ln, n, err := leb128.DecodeUint32(br) - if err != nil { - return fmt.Errorf("read immediate: %w", err) - } else if int(ln) >= len(controlBlockStack.stack) { - return fmt.Errorf( - "invalid ln param given for %s: ln=%d with %d for the current label stack length", - OpcodeBrTableName, ln, len(controlBlockStack.stack)) - } - pc += n + num - 1 - // Check type soundness. - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the required operand for %s", OpcodeBrTableName) - } - lnLabel := &controlBlockStack.stack[len(controlBlockStack.stack)-1-int(ln)] - var defaultLabelType []ValueType - // Below, we might modify the slice in case of unreachable. Therefore, - // we have to copy the content of block result types, otherwise the original - // function type might result in invalid value types if the block is the outermost label - // which equals the function's type. - if lnLabel.op != OpcodeLoop { // Loop operation doesn't require results since the continuation is the beginning of the loop. - defaultLabelType = make([]ValueType, len(lnLabel.blockType.Results)) - copy(defaultLabelType, lnLabel.blockType.Results) - } else { - defaultLabelType = make([]ValueType, len(lnLabel.blockType.Params)) - copy(defaultLabelType, lnLabel.blockType.Params) - } - - if enabledFeatures.IsEnabled(api.CoreFeatureReferenceTypes) { - // As of reference-types proposal, br_table on unreachable state - // can choose unknown types for expected parameter types for each label. - // https://github.com/WebAssembly/reference-types/pull/116 - for i := range defaultLabelType { - index := len(defaultLabelType) - 1 - i - exp := defaultLabelType[index] - actual, err := valueTypeStack.pop() - if err != nil { - return err - } - if actual == valueTypeUnknown { - // Re-assign the expected type to unknown. - defaultLabelType[index] = valueTypeUnknown - } else if actual != exp { - return typeMismatchError(true, OpcodeBrTableName, actual, exp, i) - } - } - } else { - if err = valueTypeStack.popResults(op, defaultLabelType, false); err != nil { - return err - } - } - - for _, l := range list { - if int(l) >= len(controlBlockStack.stack) { - return fmt.Errorf("invalid l param given for %s", OpcodeBrTableName) - } - label := &controlBlockStack.stack[len(controlBlockStack.stack)-1-int(l)] - var tableLabelType []ValueType - if label.op != OpcodeLoop { - tableLabelType = label.blockType.Results - } else { - tableLabelType = label.blockType.Params - } - if len(defaultLabelType) != len(tableLabelType) { - return fmt.Errorf("inconsistent block type length for %s at %d; %v (ln=%d) != %v (l=%d)", OpcodeBrTableName, l, defaultLabelType, ln, tableLabelType, l) - } - for i := range defaultLabelType { - if defaultLabelType[i] != valueTypeUnknown && defaultLabelType[i] != tableLabelType[i] { - return fmt.Errorf("incosistent block type for %s at %d", OpcodeBrTableName, l) - } - } - } - - // br_table instruction is stack-polymorphic. - valueTypeStack.unreachable() - } else if op == OpcodeCall { - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } - pc += num - 1 - if int(index) >= len(functions) { - return fmt.Errorf("invalid function index") - } - funcType := &m.TypeSection[functions[index]] - for i := 0; i < len(funcType.Params); i++ { - if err := valueTypeStack.popAndVerifyType(funcType.Params[len(funcType.Params)-1-i]); err != nil { - return fmt.Errorf("type mismatch on %s operation param type: %v", OpcodeCallName, err) - } - } - for _, exp := range funcType.Results { - valueTypeStack.push(exp) - } - } else if op == OpcodeCallIndirect { - pc++ - typeIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } - pc += num - - if int(typeIndex) >= len(m.TypeSection) { - return fmt.Errorf("invalid type index at %s: %d", OpcodeCallIndirectName, typeIndex) - } - - tableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read table index: %v", err) - } - pc += num - 1 - if tableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("table index must be zero but was %d: %w", tableIndex, err) - } - } - - if tableIndex >= uint32(len(tables)) { - return fmt.Errorf("unknown table index: %d", tableIndex) - } - - table := tables[tableIndex] - if table.Type != RefTypeFuncref { - return fmt.Errorf("table is not funcref type but was %s for %s", RefTypeName(table.Type), OpcodeCallIndirectName) - } - - if err = valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the offset in table for %s", OpcodeCallIndirectName) - } - funcType := &m.TypeSection[typeIndex] - for i := 0; i < len(funcType.Params); i++ { - if err = valueTypeStack.popAndVerifyType(funcType.Params[len(funcType.Params)-1-i]); err != nil { - return fmt.Errorf("type mismatch on %s operation input type", OpcodeCallIndirectName) - } - } - for _, exp := range funcType.Results { - valueTypeStack.push(exp) - } - } else if OpcodeI32Eqz <= op && op <= OpcodeI64Extend32S { - switch op { - case OpcodeI32Eqz: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeI32EqzName, err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32Eq, OpcodeI32Ne, OpcodeI32LtS, - OpcodeI32LtU, OpcodeI32GtS, OpcodeI32GtU, OpcodeI32LeS, - OpcodeI32LeU, OpcodeI32GeS, OpcodeI32GeU: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the 1st i32 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the 2nd i32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Eqz: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeI64EqzName, err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Eq, OpcodeI64Ne, OpcodeI64LtS, - OpcodeI64LtU, OpcodeI64GtS, OpcodeI64GtU, - OpcodeI64LeS, OpcodeI64LeU, OpcodeI64GeS, OpcodeI64GeU: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the 1st i64 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the 2nd i64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeF32Eq, OpcodeF32Ne, OpcodeF32Lt, OpcodeF32Gt, OpcodeF32Le, OpcodeF32Ge: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the 1st f32 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the 2nd f32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeF64Eq, OpcodeF64Ne, OpcodeF64Lt, OpcodeF64Gt, OpcodeF64Le, OpcodeF64Ge: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the 1st f64 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the 2nd f64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32Clz, OpcodeI32Ctz, OpcodeI32Popcnt: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the i32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32Add, OpcodeI32Sub, OpcodeI32Mul, OpcodeI32DivS, - OpcodeI32DivU, OpcodeI32RemS, OpcodeI32RemU, OpcodeI32And, - OpcodeI32Or, OpcodeI32Xor, OpcodeI32Shl, OpcodeI32ShrS, - OpcodeI32ShrU, OpcodeI32Rotl, OpcodeI32Rotr: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the 1st operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the 2nd operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Clz, OpcodeI64Ctz, OpcodeI64Popcnt: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the i64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI64Add, OpcodeI64Sub, OpcodeI64Mul, OpcodeI64DivS, - OpcodeI64DivU, OpcodeI64RemS, OpcodeI64RemU, OpcodeI64And, - OpcodeI64Or, OpcodeI64Xor, OpcodeI64Shl, OpcodeI64ShrS, - OpcodeI64ShrU, OpcodeI64Rotl, OpcodeI64Rotr: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the 1st i64 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the 2nd i64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeF32Abs, OpcodeF32Neg, OpcodeF32Ceil, - OpcodeF32Floor, OpcodeF32Trunc, OpcodeF32Nearest, - OpcodeF32Sqrt: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the 1st f32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF32Add, OpcodeF32Sub, OpcodeF32Mul, - OpcodeF32Div, OpcodeF32Min, OpcodeF32Max, - OpcodeF32Copysign: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the 1st f32 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the 2nd f32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF64Abs, OpcodeF64Neg, OpcodeF64Ceil, - OpcodeF64Floor, OpcodeF64Trunc, OpcodeF64Nearest, - OpcodeF64Sqrt: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the 1st f64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeF64Add, OpcodeF64Sub, OpcodeF64Mul, - OpcodeF64Div, OpcodeF64Min, OpcodeF64Max, - OpcodeF64Copysign: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the 1st f64 operand for %s: %v", InstructionName(op), err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the 2nd f64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeI32WrapI64: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeI32WrapI64Name, err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32TruncF32S, OpcodeI32TruncF32U: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the f32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI32TruncF64S, OpcodeI32TruncF64U: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the f64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64ExtendI32S, OpcodeI64ExtendI32U: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the i32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI64TruncF32S, OpcodeI64TruncF32U: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the f32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeI64TruncF64S, OpcodeI64TruncF64U: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the f64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeF32ConvertI32S, OpcodeF32ConvertI32U: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the i32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF32ConvertI64S, OpcodeF32ConvertI64U: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the i64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF32DemoteF64: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeF32DemoteF64Name, err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF64ConvertI32S, OpcodeF64ConvertI32U: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the i32 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeF64ConvertI64S, OpcodeF64ConvertI64U: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the i64 operand for %s: %v", InstructionName(op), err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeF64PromoteF32: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeF64PromoteF32Name, err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeI32ReinterpretF32: - if err := valueTypeStack.popAndVerifyType(ValueTypeF32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeI32ReinterpretF32Name, err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64ReinterpretF64: - if err := valueTypeStack.popAndVerifyType(ValueTypeF64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeI64ReinterpretF64Name, err) - } - valueTypeStack.push(ValueTypeI64) - case OpcodeF32ReinterpretI32: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeF32ReinterpretI32Name, err) - } - valueTypeStack.push(ValueTypeF32) - case OpcodeF64ReinterpretI64: - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeF64ReinterpretI64Name, err) - } - valueTypeStack.push(ValueTypeF64) - case OpcodeI32Extend8S, OpcodeI32Extend16S: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureSignExtensionOps); err != nil { - return fmt.Errorf("%s invalid as %v", instructionNames[op], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", instructionNames[op], err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeI64Extend8S, OpcodeI64Extend16S, OpcodeI64Extend32S: - if err := enabledFeatures.RequireEnabled(api.CoreFeatureSignExtensionOps); err != nil { - return fmt.Errorf("%s invalid as %v", instructionNames[op], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI64); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", instructionNames[op], err) - } - valueTypeStack.push(ValueTypeI64) - default: - return fmt.Errorf("invalid numeric instruction 0x%x", op) - } - } else if op >= OpcodeRefNull && op <= OpcodeRefFunc { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("%s invalid as %v", instructionNames[op], err) - } - switch op { - case OpcodeRefNull: - pc++ - switch reftype := body[pc]; reftype { - case ValueTypeExternref: - valueTypeStack.push(ValueTypeExternref) - case ValueTypeFuncref: - valueTypeStack.push(ValueTypeFuncref) - default: - return fmt.Errorf("unknown type for ref.null: 0x%x", reftype) - } - case OpcodeRefIsNull: - tp, err := valueTypeStack.pop() - if err != nil { - return fmt.Errorf("cannot pop the operand for ref.is_null: %v", err) - } else if !isReferenceValueType(tp) && tp != valueTypeUnknown { - return fmt.Errorf("type mismatch: expected reference type but was %s", ValueTypeName(tp)) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeRefFunc: - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read function index for ref.func: %v", err) - } - if _, ok := declaredFunctionIndexes[index]; !ok { - return fmt.Errorf("undeclared function index %d for ref.func", index) - } - pc += num - 1 - valueTypeStack.push(ValueTypeFuncref) - } - } else if op == OpcodeTableGet || op == OpcodeTableSet { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("%s is invalid as %v", InstructionName(op), err) - } - pc++ - tableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("read immediate: %v", err) - } - if tableIndex >= uint32(len(tables)) { - return fmt.Errorf("table of index %d not found", tableIndex) - } - - refType := tables[tableIndex].Type - if op == OpcodeTableGet { - if err := valueTypeStack.popAndVerifyType(api.ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for table.get: %v", err) - } - valueTypeStack.push(refType) - } else { - if err := valueTypeStack.popAndVerifyType(refType); err != nil { - return fmt.Errorf("cannot pop the operand for table.set: %v", err) - } - if err := valueTypeStack.popAndVerifyType(api.ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for table.set: %v", err) - } - } - pc += num - 1 - } else if op == OpcodeMiscPrefix { - pc++ - // A misc opcode is encoded as an unsigned variable 32-bit integer. - miscOp32, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read misc opcode: %v", err) - } - pc += num - 1 - miscOpcode := byte(miscOp32) - // If the misc opcode is beyond byte range, it is highly likely this is an invalid binary, or - // it is due to the new opcode from a new proposal. In the latter case, we have to - // change the alias type of OpcodeMisc (which is currently byte) to uint32. - if uint32(byte(miscOp32)) != miscOp32 { - return fmt.Errorf("invalid misc opcode: %#x", miscOp32) - } - if miscOpcode >= OpcodeMiscI32TruncSatF32S && miscOpcode <= OpcodeMiscI64TruncSatF64U { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureNonTrappingFloatToIntConversion); err != nil { - return fmt.Errorf("%s invalid as %v", miscInstructionNames[miscOpcode], err) - } - var inType, outType ValueType - switch miscOpcode { - case OpcodeMiscI32TruncSatF32S, OpcodeMiscI32TruncSatF32U: - inType, outType = ValueTypeF32, ValueTypeI32 - case OpcodeMiscI32TruncSatF64S, OpcodeMiscI32TruncSatF64U: - inType, outType = ValueTypeF64, ValueTypeI32 - case OpcodeMiscI64TruncSatF32S, OpcodeMiscI64TruncSatF32U: - inType, outType = ValueTypeF32, ValueTypeI64 - case OpcodeMiscI64TruncSatF64S, OpcodeMiscI64TruncSatF64U: - inType, outType = ValueTypeF64, ValueTypeI64 - } - if err := valueTypeStack.popAndVerifyType(inType); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", miscInstructionNames[miscOpcode], err) - } - valueTypeStack.push(outType) - } else if miscOpcode >= OpcodeMiscMemoryInit && miscOpcode <= OpcodeMiscTableCopy { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureBulkMemoryOperations); err != nil { - return fmt.Errorf("%s invalid as %v", miscInstructionNames[miscOpcode], err) - } - var params []ValueType - // Handle opcodes added in bulk-memory-operations/WebAssembly 2.0. - switch miscOpcode { - case OpcodeMiscDataDrop: - if m.DataCountSection == nil { - return fmt.Errorf("%s requires data count section", MiscInstructionName(miscOpcode)) - } - - // We need to read the index to the data section. - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read data segment index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if int(index) >= len(m.DataSection) { - return fmt.Errorf("index %d out of range of data section(len=%d)", index, len(m.DataSection)) - } - pc += num - 1 - case OpcodeMiscMemoryInit, OpcodeMiscMemoryCopy, OpcodeMiscMemoryFill: - if memory == nil { - return fmt.Errorf("memory must exist for %s", MiscInstructionName(miscOpcode)) - } - params = []ValueType{ValueTypeI32, ValueTypeI32, ValueTypeI32} - - if miscOpcode == OpcodeMiscMemoryInit { - if m.DataCountSection == nil { - return fmt.Errorf("%s requires data count section", MiscInstructionName(miscOpcode)) - } - - // We need to read the index to the data section. - pc++ - index, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read data segment index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if int(index) >= len(m.DataSection) { - return fmt.Errorf("index %d out of range of data section(len=%d)", index, len(m.DataSection)) - } - pc += num - 1 - } - - pc++ - val, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read memory index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if val != 0 || num != 1 { - return fmt.Errorf("%s reserved byte must be zero encoded with 1 byte", MiscInstructionName(miscOpcode)) - } - if miscOpcode == OpcodeMiscMemoryCopy { - pc++ - // memory.copy needs two memory index which are reserved as zero. - val, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read memory index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if val != 0 || num != 1 { - return fmt.Errorf("%s reserved byte must be zero encoded with 1 byte", MiscInstructionName(miscOpcode)) - } - } - - case OpcodeMiscTableInit: - params = []ValueType{ValueTypeI32, ValueTypeI32, ValueTypeI32} - pc++ - elementIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read element segment index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if int(elementIndex) >= len(m.ElementSection) { - return fmt.Errorf("index %d out of range of element section(len=%d)", elementIndex, len(m.ElementSection)) - } - pc += num - - tableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read source table index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if tableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("source table index must be zero for %s as %v", MiscInstructionName(miscOpcode), err) - } - } - if tableIndex >= uint32(len(tables)) { - return fmt.Errorf("table of index %d not found", tableIndex) - } - - if m.ElementSection[elementIndex].Type != tables[tableIndex].Type { - return fmt.Errorf("type mismatch for table.init: element type %s does not match table type %s", - RefTypeName(m.ElementSection[elementIndex].Type), - RefTypeName(tables[tableIndex].Type), - ) - } - pc += num - 1 - case OpcodeMiscElemDrop: - pc++ - elementIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read element segment index for %s: %v", MiscInstructionName(miscOpcode), err) - } else if int(elementIndex) >= len(m.ElementSection) { - return fmt.Errorf("index %d out of range of element section(len=%d)", elementIndex, len(m.ElementSection)) - } - pc += num - 1 - case OpcodeMiscTableCopy: - params = []ValueType{ValueTypeI32, ValueTypeI32, ValueTypeI32} - pc++ - - dstTableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read destination table index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if dstTableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("destination table index must be zero for %s as %v", MiscInstructionName(miscOpcode), err) - } - } - if dstTableIndex >= uint32(len(tables)) { - return fmt.Errorf("table of index %d not found", dstTableIndex) - } - pc += num - - srcTableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read source table index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if srcTableIndex != 0 { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("source table index must be zero for %s as %v", MiscInstructionName(miscOpcode), err) - } - } - if srcTableIndex >= uint32(len(tables)) { - return fmt.Errorf("table of index %d not found", srcTableIndex) - } - - if tables[srcTableIndex].Type != tables[dstTableIndex].Type { - return fmt.Errorf("table type mismatch for table.copy: %s (src) != %s (dst)", - RefTypeName(tables[srcTableIndex].Type), RefTypeName(tables[dstTableIndex].Type)) - } - - pc += num - 1 - } - for _, p := range params { - if err := valueTypeStack.popAndVerifyType(p); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", miscInstructionNames[miscOpcode], err) - } - } - } else if miscOpcode >= OpcodeMiscTableGrow && miscOpcode <= OpcodeMiscTableFill { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("%s invalid as %v", miscInstructionNames[miscOpcode], err) - } - - pc++ - tableIndex, num, err := leb128.LoadUint32(body[pc:]) - if err != nil { - return fmt.Errorf("failed to read table index for %s: %v", MiscInstructionName(miscOpcode), err) - } - if tableIndex >= uint32(len(tables)) { - return fmt.Errorf("table of index %d not found", tableIndex) - } - pc += num - 1 - - var params, results []ValueType - reftype := tables[tableIndex].Type - if miscOpcode == OpcodeMiscTableGrow { - params = []ValueType{ValueTypeI32, reftype} - results = []ValueType{ValueTypeI32} - } else if miscOpcode == OpcodeMiscTableSize { - results = []ValueType{ValueTypeI32} - } else if miscOpcode == OpcodeMiscTableFill { - params = []ValueType{ValueTypeI32, reftype, ValueTypeI32} - } - - for _, p := range params { - if err := valueTypeStack.popAndVerifyType(p); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", miscInstructionNames[miscOpcode], err) - } - } - for _, r := range results { - valueTypeStack.push(r) - } - } - } else if op == OpcodeVecPrefix { - pc++ - // Vector instructions come with two bytes where the first byte is always OpcodeVecPrefix, - // and the second byte determines the actual instruction. - vecOpcode := body[pc] - if err := enabledFeatures.RequireEnabled(api.CoreFeatureSIMD); err != nil { - return fmt.Errorf("%s invalid as %v", vectorInstructionName[vecOpcode], err) - } - - switch vecOpcode { - case OpcodeVecV128Const: - // Read 128-bit = 16 bytes constants - if int(pc+16) >= len(body) { - return fmt.Errorf("cannot read constant vector value for %s", vectorInstructionName[vecOpcode]) - } - pc += 16 - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128AnyTrue, OpcodeVecI8x16AllTrue, OpcodeVecI16x8AllTrue, OpcodeVecI32x4AllTrue, OpcodeVecI64x2AllTrue, - OpcodeVecI8x16BitMask, OpcodeVecI16x8BitMask, OpcodeVecI32x4BitMask, OpcodeVecI64x2BitMask: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeI32) - case OpcodeVecV128Load, OpcodeVecV128Load8x8s, OpcodeVecV128Load8x8u, OpcodeVecV128Load16x4s, OpcodeVecV128Load16x4u, - OpcodeVecV128Load32x2s, OpcodeVecV128Load32x2u, OpcodeVecV128Load8Splat, OpcodeVecV128Load16Splat, - OpcodeVecV128Load32Splat, OpcodeVecV128Load64Splat, - OpcodeVecV128Load32zero, OpcodeVecV128Load64zero: - if memory == nil { - return fmt.Errorf("memory must exist for %s", VectorInstructionName(vecOpcode)) - } - pc++ - align, _, read, err := readMemArg(pc, body) - if err != nil { - return err - } - pc += read - 1 - var maxAlign uint32 - switch vecOpcode { - case OpcodeVecV128Load: - maxAlign = 128 / 8 - case OpcodeVecV128Load8x8s, OpcodeVecV128Load8x8u, OpcodeVecV128Load16x4s, OpcodeVecV128Load16x4u, - OpcodeVecV128Load32x2s, OpcodeVecV128Load32x2u: - maxAlign = 64 / 8 - case OpcodeVecV128Load8Splat: - maxAlign = 1 - case OpcodeVecV128Load16Splat: - maxAlign = 16 / 8 - case OpcodeVecV128Load32Splat: - maxAlign = 32 / 8 - case OpcodeVecV128Load64Splat: - maxAlign = 64 / 8 - case OpcodeVecV128Load32zero: - maxAlign = 32 / 8 - case OpcodeVecV128Load64zero: - maxAlign = 64 / 8 - } - - if 1< maxAlign { - return fmt.Errorf("invalid memory alignment %d for %s", align, VectorInstructionName(vecOpcode)) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", VectorInstructionName(vecOpcode), err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128Store: - if memory == nil { - return fmt.Errorf("memory must exist for %s", VectorInstructionName(vecOpcode)) - } - pc++ - align, _, read, err := readMemArg(pc, body) - if err != nil { - return err - } - pc += read - 1 - if 1< 128/8 { - return fmt.Errorf("invalid memory alignment %d for %s", align, OpcodeVecV128StoreName) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeVecV128StoreName, err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", OpcodeVecV128StoreName, err) - } - case OpcodeVecV128Load8Lane, OpcodeVecV128Load16Lane, OpcodeVecV128Load32Lane, OpcodeVecV128Load64Lane: - if memory == nil { - return fmt.Errorf("memory must exist for %s", VectorInstructionName(vecOpcode)) - } - attr := vecLoadLanes[vecOpcode] - pc++ - align, _, read, err := readMemArg(pc, body) - if err != nil { - return err - } - if 1< attr.alignMax { - return fmt.Errorf("invalid memory alignment %d for %s", align, vectorInstructionName[vecOpcode]) - } - pc += read - if pc >= uint64(len(body)) { - return fmt.Errorf("lane for %s not found", OpcodeVecV128Load64LaneName) - } - lane := body[pc] - if lane >= attr.laneCeil { - return fmt.Errorf("invalid lane index %d >= %d for %s", lane, attr.laneCeil, vectorInstructionName[vecOpcode]) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128Store8Lane, OpcodeVecV128Store16Lane, OpcodeVecV128Store32Lane, OpcodeVecV128Store64Lane: - if memory == nil { - return fmt.Errorf("memory must exist for %s", VectorInstructionName(vecOpcode)) - } - attr := vecStoreLanes[vecOpcode] - pc++ - align, _, read, err := readMemArg(pc, body) - if err != nil { - return err - } - if 1< attr.alignMax { - return fmt.Errorf("invalid memory alignment %d for %s", align, vectorInstructionName[vecOpcode]) - } - pc += read - if pc >= uint64(len(body)) { - return fmt.Errorf("lane for %s not found", vectorInstructionName[vecOpcode]) - } - lane := body[pc] - if lane >= attr.laneCeil { - return fmt.Errorf("invalid lane index %d >= %d for %s", lane, attr.laneCeil, vectorInstructionName[vecOpcode]) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - case OpcodeVecI8x16ExtractLaneS, - OpcodeVecI8x16ExtractLaneU, - OpcodeVecI16x8ExtractLaneS, - OpcodeVecI16x8ExtractLaneU, - OpcodeVecI32x4ExtractLane, - OpcodeVecI64x2ExtractLane, - OpcodeVecF32x4ExtractLane, - OpcodeVecF64x2ExtractLane: - pc++ - if pc >= uint64(len(body)) { - return fmt.Errorf("lane for %s not found", vectorInstructionName[vecOpcode]) - } - attr := vecExtractLanes[vecOpcode] - lane := body[pc] - if lane >= attr.laneCeil { - return fmt.Errorf("invalid lane index %d >= %d for %s", lane, attr.laneCeil, vectorInstructionName[vecOpcode]) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(attr.resultType) - case OpcodeVecI8x16ReplaceLane, OpcodeVecI16x8ReplaceLane, OpcodeVecI32x4ReplaceLane, - OpcodeVecI64x2ReplaceLane, OpcodeVecF32x4ReplaceLane, OpcodeVecF64x2ReplaceLane: - pc++ - if pc >= uint64(len(body)) { - return fmt.Errorf("lane for %s not found", vectorInstructionName[vecOpcode]) - } - attr := vecReplaceLanes[vecOpcode] - lane := body[pc] - if lane >= attr.laneCeil { - return fmt.Errorf("invalid lane index %d >= %d for %s", lane, attr.laneCeil, vectorInstructionName[vecOpcode]) - } - if err := valueTypeStack.popAndVerifyType(attr.paramType); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecI8x16Splat, OpcodeVecI16x8Splat, OpcodeVecI32x4Splat, - OpcodeVecI64x2Splat, OpcodeVecF32x4Splat, OpcodeVecF64x2Splat: - tp := vecSplatValueTypes[vecOpcode] - if err := valueTypeStack.popAndVerifyType(tp); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecI8x16Swizzle, OpcodeVecV128And, OpcodeVecV128Or, OpcodeVecV128Xor, OpcodeVecV128AndNot: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128Bitselect: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128Not: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecV128i8x16Shuffle: - pc++ - if pc+15 >= uint64(len(body)) { - return fmt.Errorf("16 lane indexes for %s not found", vectorInstructionName[vecOpcode]) - } - lanes := body[pc : pc+16] - for i, l := range lanes { - if l >= 32 { - return fmt.Errorf("invalid lane index[%d] %d >= %d for %s", i, l, 32, vectorInstructionName[vecOpcode]) - } - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - pc += 15 - case OpcodeVecI8x16Shl, OpcodeVecI8x16ShrS, OpcodeVecI8x16ShrU, - OpcodeVecI16x8Shl, OpcodeVecI16x8ShrS, OpcodeVecI16x8ShrU, - OpcodeVecI32x4Shl, OpcodeVecI32x4ShrS, OpcodeVecI32x4ShrU, - OpcodeVecI64x2Shl, OpcodeVecI64x2ShrS, OpcodeVecI64x2ShrU: - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecI8x16Eq, OpcodeVecI8x16Ne, OpcodeVecI8x16LtS, OpcodeVecI8x16LtU, OpcodeVecI8x16GtS, - OpcodeVecI8x16GtU, OpcodeVecI8x16LeS, OpcodeVecI8x16LeU, OpcodeVecI8x16GeS, OpcodeVecI8x16GeU, - OpcodeVecI16x8Eq, OpcodeVecI16x8Ne, OpcodeVecI16x8LtS, OpcodeVecI16x8LtU, OpcodeVecI16x8GtS, - OpcodeVecI16x8GtU, OpcodeVecI16x8LeS, OpcodeVecI16x8LeU, OpcodeVecI16x8GeS, OpcodeVecI16x8GeU, - OpcodeVecI32x4Eq, OpcodeVecI32x4Ne, OpcodeVecI32x4LtS, OpcodeVecI32x4LtU, OpcodeVecI32x4GtS, - OpcodeVecI32x4GtU, OpcodeVecI32x4LeS, OpcodeVecI32x4LeU, OpcodeVecI32x4GeS, OpcodeVecI32x4GeU, - OpcodeVecI64x2Eq, OpcodeVecI64x2Ne, OpcodeVecI64x2LtS, OpcodeVecI64x2GtS, OpcodeVecI64x2LeS, - OpcodeVecI64x2GeS, OpcodeVecF32x4Eq, OpcodeVecF32x4Ne, OpcodeVecF32x4Lt, OpcodeVecF32x4Gt, - OpcodeVecF32x4Le, OpcodeVecF32x4Ge, OpcodeVecF64x2Eq, OpcodeVecF64x2Ne, OpcodeVecF64x2Lt, - OpcodeVecF64x2Gt, OpcodeVecF64x2Le, OpcodeVecF64x2Ge, - OpcodeVecI32x4DotI16x8S, - OpcodeVecI8x16NarrowI16x8S, OpcodeVecI8x16NarrowI16x8U, OpcodeVecI16x8NarrowI32x4S, OpcodeVecI16x8NarrowI32x4U: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - case OpcodeVecI8x16Neg, OpcodeVecI16x8Neg, OpcodeVecI32x4Neg, OpcodeVecI64x2Neg, OpcodeVecF32x4Neg, OpcodeVecF64x2Neg, - OpcodeVecF32x4Sqrt, OpcodeVecF64x2Sqrt, - OpcodeVecI8x16Abs, OpcodeVecI8x16Popcnt, OpcodeVecI16x8Abs, OpcodeVecI32x4Abs, OpcodeVecI64x2Abs, - OpcodeVecF32x4Abs, OpcodeVecF64x2Abs, - OpcodeVecF32x4Ceil, OpcodeVecF32x4Floor, OpcodeVecF32x4Trunc, OpcodeVecF32x4Nearest, - OpcodeVecF64x2Ceil, OpcodeVecF64x2Floor, OpcodeVecF64x2Trunc, OpcodeVecF64x2Nearest, - OpcodeVecI16x8ExtendLowI8x16S, OpcodeVecI16x8ExtendHighI8x16S, OpcodeVecI16x8ExtendLowI8x16U, OpcodeVecI16x8ExtendHighI8x16U, - OpcodeVecI32x4ExtendLowI16x8S, OpcodeVecI32x4ExtendHighI16x8S, OpcodeVecI32x4ExtendLowI16x8U, OpcodeVecI32x4ExtendHighI16x8U, - OpcodeVecI64x2ExtendLowI32x4S, OpcodeVecI64x2ExtendHighI32x4S, OpcodeVecI64x2ExtendLowI32x4U, OpcodeVecI64x2ExtendHighI32x4U, - OpcodeVecI16x8ExtaddPairwiseI8x16S, OpcodeVecI16x8ExtaddPairwiseI8x16U, - OpcodeVecI32x4ExtaddPairwiseI16x8S, OpcodeVecI32x4ExtaddPairwiseI16x8U, - OpcodeVecF64x2PromoteLowF32x4Zero, OpcodeVecF32x4DemoteF64x2Zero, - OpcodeVecF32x4ConvertI32x4S, OpcodeVecF32x4ConvertI32x4U, - OpcodeVecF64x2ConvertLowI32x4S, OpcodeVecF64x2ConvertLowI32x4U, - OpcodeVecI32x4TruncSatF32x4S, OpcodeVecI32x4TruncSatF32x4U, OpcodeVecI32x4TruncSatF64x2SZero, OpcodeVecI32x4TruncSatF64x2UZero: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - - case OpcodeVecI8x16Add, OpcodeVecI8x16AddSatS, OpcodeVecI8x16AddSatU, OpcodeVecI8x16Sub, OpcodeVecI8x16SubSatS, OpcodeVecI8x16SubSatU, - OpcodeVecI16x8Add, OpcodeVecI16x8AddSatS, OpcodeVecI16x8AddSatU, OpcodeVecI16x8Sub, OpcodeVecI16x8SubSatS, OpcodeVecI16x8SubSatU, OpcodeVecI16x8Mul, - OpcodeVecI32x4Add, OpcodeVecI32x4Sub, OpcodeVecI32x4Mul, - OpcodeVecI64x2Add, OpcodeVecI64x2Sub, OpcodeVecI64x2Mul, - OpcodeVecF32x4Add, OpcodeVecF32x4Sub, OpcodeVecF32x4Mul, OpcodeVecF32x4Div, - OpcodeVecF64x2Add, OpcodeVecF64x2Sub, OpcodeVecF64x2Mul, OpcodeVecF64x2Div, - OpcodeVecI8x16MinS, OpcodeVecI8x16MinU, OpcodeVecI8x16MaxS, OpcodeVecI8x16MaxU, - OpcodeVecI8x16AvgrU, - OpcodeVecI16x8MinS, OpcodeVecI16x8MinU, OpcodeVecI16x8MaxS, OpcodeVecI16x8MaxU, - OpcodeVecI16x8AvgrU, - OpcodeVecI32x4MinS, OpcodeVecI32x4MinU, OpcodeVecI32x4MaxS, OpcodeVecI32x4MaxU, - OpcodeVecF32x4Min, OpcodeVecF32x4Max, OpcodeVecF64x2Min, OpcodeVecF64x2Max, - OpcodeVecF32x4Pmin, OpcodeVecF32x4Pmax, OpcodeVecF64x2Pmin, OpcodeVecF64x2Pmax, - OpcodeVecI16x8Q15mulrSatS, - OpcodeVecI16x8ExtMulLowI8x16S, OpcodeVecI16x8ExtMulHighI8x16S, OpcodeVecI16x8ExtMulLowI8x16U, OpcodeVecI16x8ExtMulHighI8x16U, - OpcodeVecI32x4ExtMulLowI16x8S, OpcodeVecI32x4ExtMulHighI16x8S, OpcodeVecI32x4ExtMulLowI16x8U, OpcodeVecI32x4ExtMulHighI16x8U, - OpcodeVecI64x2ExtMulLowI32x4S, OpcodeVecI64x2ExtMulHighI32x4S, OpcodeVecI64x2ExtMulLowI32x4U, OpcodeVecI64x2ExtMulHighI32x4U: - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - if err := valueTypeStack.popAndVerifyType(ValueTypeV128); err != nil { - return fmt.Errorf("cannot pop the operand for %s: %v", vectorInstructionName[vecOpcode], err) - } - valueTypeStack.push(ValueTypeV128) - default: - return fmt.Errorf("TODO: SIMD instruction %s will be implemented in #506", vectorInstructionName[vecOpcode]) - } - } else if op == OpcodeBlock { - br.Reset(body[pc+1:]) - bt, num, err := DecodeBlockType(m.TypeSection, br, enabledFeatures) - if err != nil { - return fmt.Errorf("read block: %w", err) - } - controlBlockStack.push(pc, 0, 0, bt, num, 0) - if err = valueTypeStack.popParams(op, bt.Params, false); err != nil { - return err - } - // Plus we have to push any block params again. - for _, p := range bt.Params { - valueTypeStack.push(p) - } - valueTypeStack.pushStackLimit(len(bt.Params)) - pc += num - } else if op == OpcodeLoop { - br.Reset(body[pc+1:]) - bt, num, err := DecodeBlockType(m.TypeSection, br, enabledFeatures) - if err != nil { - return fmt.Errorf("read block: %w", err) - } - controlBlockStack.push(pc, 0, 0, bt, num, op) - if err = valueTypeStack.popParams(op, bt.Params, false); err != nil { - return err - } - // Plus we have to push any block params again. - for _, p := range bt.Params { - valueTypeStack.push(p) - } - valueTypeStack.pushStackLimit(len(bt.Params)) - pc += num - } else if op == OpcodeIf { - br.Reset(body[pc+1:]) - bt, num, err := DecodeBlockType(m.TypeSection, br, enabledFeatures) - if err != nil { - return fmt.Errorf("read block: %w", err) - } - controlBlockStack.push(pc, 0, 0, bt, num, op) - if err = valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("cannot pop the operand for 'if': %v", err) - } - if err = valueTypeStack.popParams(op, bt.Params, false); err != nil { - return err - } - // Plus we have to push any block params again. - for _, p := range bt.Params { - valueTypeStack.push(p) - } - valueTypeStack.pushStackLimit(len(bt.Params)) - pc += num - } else if op == OpcodeElse { - if len(controlBlockStack.stack) == 0 { - return fmt.Errorf("redundant Else instruction at %#x", pc) - } - bl := &controlBlockStack.stack[len(controlBlockStack.stack)-1] - bl.elseAt = pc - // Check the type soundness of the instructions *before* entering this else Op. - if err := valueTypeStack.popResults(OpcodeIf, bl.blockType.Results, true); err != nil { - return err - } - // Before entering instructions inside else, we pop all the values pushed by then block. - valueTypeStack.resetAtStackLimit() - // Plus we have to push any block params again. - for _, p := range bl.blockType.Params { - valueTypeStack.push(p) - } - } else if op == OpcodeEnd { - if len(controlBlockStack.stack) == 0 { - return fmt.Errorf("redundant End instruction at %#x", pc) - } - bl := controlBlockStack.pop() - bl.endAt = pc - - // OpcodeEnd can end a block or the function itself. Check to see what it is: - - ifMissingElse := bl.op == OpcodeIf && bl.elseAt <= bl.startAt - if ifMissingElse { - // If this is the end of block without else, the number of block's results and params must be same. - // Otherwise, the value stack would result in the inconsistent state at runtime. - if !bytes.Equal(bl.blockType.Results, bl.blockType.Params) { - return typeCountError(false, OpcodeElseName, bl.blockType.Params, bl.blockType.Results) - } - // -1 skips else, to handle if block without else properly. - bl.elseAt = bl.endAt - 1 - } - - // Determine the block context - ctx := "" // the outer-most block: the function return - if bl.op == OpcodeIf && !ifMissingElse && bl.elseAt > 0 { - ctx = OpcodeElseName - } else if bl.op != 0 { - ctx = InstructionName(bl.op) - } - - // Check return types match - if err := valueTypeStack.requireStackValues(false, ctx, bl.blockType.Results, true); err != nil { - return err - } - - // Put the result types at the end after resetting at the stack limit - // since we might have Any type between the limit and the current top. - valueTypeStack.resetAtStackLimit() - for _, exp := range bl.blockType.Results { - valueTypeStack.push(exp) - } - // We exit if/loop/block, so reset the constraints on the stack manipulation - // on values previously pushed by outer blocks. - valueTypeStack.popStackLimit() - } else if op == OpcodeReturn { - // Same formatting as OpcodeEnd on the outer-most block - if err := valueTypeStack.requireStackValues(false, "", functionType.Results, false); err != nil { - return err - } - // return instruction is stack-polymorphic. - valueTypeStack.unreachable() - } else if op == OpcodeDrop { - _, err := valueTypeStack.pop() - if err != nil { - return fmt.Errorf("invalid drop: %v", err) - } - } else if op == OpcodeSelect || op == OpcodeTypedSelect { - if err := valueTypeStack.popAndVerifyType(ValueTypeI32); err != nil { - return fmt.Errorf("type mismatch on 3rd select operand: %v", err) - } - v1, err := valueTypeStack.pop() - if err != nil { - return fmt.Errorf("invalid select: %v", err) - } - v2, err := valueTypeStack.pop() - if err != nil { - return fmt.Errorf("invalid select: %v", err) - } - - if op == OpcodeTypedSelect { - if err := enabledFeatures.RequireEnabled(api.CoreFeatureReferenceTypes); err != nil { - return fmt.Errorf("%s is invalid as %w", InstructionName(op), err) - } - pc++ - if numTypeImmeidates := body[pc]; numTypeImmeidates != 1 { - return fmt.Errorf("too many type immediates for %s", InstructionName(op)) - } - pc++ - tp := body[pc] - if tp != ValueTypeI32 && tp != ValueTypeI64 && tp != ValueTypeF32 && tp != ValueTypeF64 && - tp != api.ValueTypeExternref && tp != ValueTypeFuncref && tp != ValueTypeV128 { - return fmt.Errorf("invalid type %s for %s", ValueTypeName(tp), OpcodeTypedSelectName) - } - } else if isReferenceValueType(v1) || isReferenceValueType(v2) { - return fmt.Errorf("reference types cannot be used for non typed select instruction") - } - - if v1 != v2 && v1 != valueTypeUnknown && v2 != valueTypeUnknown { - return fmt.Errorf("type mismatch on 1st and 2nd select operands") - } - if v1 == valueTypeUnknown { - valueTypeStack.push(v2) - } else { - valueTypeStack.push(v1) - } - } else if op == OpcodeUnreachable { - // unreachable instruction is stack-polymorphic. - valueTypeStack.unreachable() - } else if op == OpcodeNop { - } else { - return fmt.Errorf("invalid instruction 0x%x", op) - } - } - - if len(controlBlockStack.stack) > 0 { - return fmt.Errorf("ill-nested block exists") - } - if valueTypeStack.maximumStackPointer > maxStackValues { - return fmt.Errorf("function may have %d stack values, which exceeds limit %d", valueTypeStack.maximumStackPointer, maxStackValues) - } - return nil -} - -var vecExtractLanes = [...]struct { - laneCeil byte - resultType ValueType -}{ - OpcodeVecI8x16ExtractLaneS: {laneCeil: 16, resultType: ValueTypeI32}, - OpcodeVecI8x16ExtractLaneU: {laneCeil: 16, resultType: ValueTypeI32}, - OpcodeVecI16x8ExtractLaneS: {laneCeil: 8, resultType: ValueTypeI32}, - OpcodeVecI16x8ExtractLaneU: {laneCeil: 8, resultType: ValueTypeI32}, - OpcodeVecI32x4ExtractLane: {laneCeil: 4, resultType: ValueTypeI32}, - OpcodeVecI64x2ExtractLane: {laneCeil: 2, resultType: ValueTypeI64}, - OpcodeVecF32x4ExtractLane: {laneCeil: 4, resultType: ValueTypeF32}, - OpcodeVecF64x2ExtractLane: {laneCeil: 2, resultType: ValueTypeF64}, -} - -var vecReplaceLanes = [...]struct { - laneCeil byte - paramType ValueType -}{ - OpcodeVecI8x16ReplaceLane: {laneCeil: 16, paramType: ValueTypeI32}, - OpcodeVecI16x8ReplaceLane: {laneCeil: 8, paramType: ValueTypeI32}, - OpcodeVecI32x4ReplaceLane: {laneCeil: 4, paramType: ValueTypeI32}, - OpcodeVecI64x2ReplaceLane: {laneCeil: 2, paramType: ValueTypeI64}, - OpcodeVecF32x4ReplaceLane: {laneCeil: 4, paramType: ValueTypeF32}, - OpcodeVecF64x2ReplaceLane: {laneCeil: 2, paramType: ValueTypeF64}, -} - -var vecStoreLanes = [...]struct { - alignMax uint32 - laneCeil byte -}{ - OpcodeVecV128Store64Lane: {alignMax: 64 / 8, laneCeil: 128 / 64}, - OpcodeVecV128Store32Lane: {alignMax: 32 / 8, laneCeil: 128 / 32}, - OpcodeVecV128Store16Lane: {alignMax: 16 / 8, laneCeil: 128 / 16}, - OpcodeVecV128Store8Lane: {alignMax: 1, laneCeil: 128 / 8}, -} - -var vecLoadLanes = [...]struct { - alignMax uint32 - laneCeil byte -}{ - OpcodeVecV128Load64Lane: {alignMax: 64 / 8, laneCeil: 128 / 64}, - OpcodeVecV128Load32Lane: {alignMax: 32 / 8, laneCeil: 128 / 32}, - OpcodeVecV128Load16Lane: {alignMax: 16 / 8, laneCeil: 128 / 16}, - OpcodeVecV128Load8Lane: {alignMax: 1, laneCeil: 128 / 8}, -} - -var vecSplatValueTypes = [...]ValueType{ - OpcodeVecI8x16Splat: ValueTypeI32, - OpcodeVecI16x8Splat: ValueTypeI32, - OpcodeVecI32x4Splat: ValueTypeI32, - OpcodeVecI64x2Splat: ValueTypeI64, - OpcodeVecF32x4Splat: ValueTypeF32, - OpcodeVecF64x2Splat: ValueTypeF64, -} - -type stacks struct { - vs valueTypeStack - cs controlBlockStack -} - -func (sts *stacks) reset(functionType *FunctionType) { - // Reset valueStack for reuse. - sts.vs.stack = sts.vs.stack[:0] - sts.vs.stackLimits = sts.vs.stackLimits[:0] - sts.vs.maximumStackPointer = 0 - sts.cs.stack = sts.cs.stack[:0] - sts.cs.stack = append(sts.cs.stack, controlBlock{blockType: functionType}) -} - -type controlBlockStack struct { - stack []controlBlock -} - -func (s *controlBlockStack) pop() *controlBlock { - tail := len(s.stack) - 1 - ret := &s.stack[tail] - s.stack = s.stack[:tail] - return ret -} - -func (s *controlBlockStack) push(startAt, elseAt, endAt uint64, blockType *FunctionType, blockTypeBytes uint64, op Opcode) { - s.stack = append(s.stack, controlBlock{ - startAt: startAt, - elseAt: elseAt, - endAt: endAt, - blockType: blockType, - blockTypeBytes: blockTypeBytes, - op: op, - }) -} - -type valueTypeStack struct { - stack []ValueType - stackLimits []int - maximumStackPointer int - // requireStackValuesTmp is used in requireStackValues function to reduce the allocation. - requireStackValuesTmp []ValueType -} - -// Only used in the analyzeFunction below. -const valueTypeUnknown = ValueType(0xFF) - -func (s *valueTypeStack) tryPop() (vt ValueType, limit int, ok bool) { - if len(s.stackLimits) > 0 { - limit = s.stackLimits[len(s.stackLimits)-1] - } - stackLen := len(s.stack) - if stackLen <= limit { - return - } else if stackLen == limit+1 && s.stack[limit] == valueTypeUnknown { - vt = valueTypeUnknown - ok = true - return - } else { - vt = s.stack[stackLen-1] - s.stack = s.stack[:stackLen-1] - ok = true - return - } -} - -func (s *valueTypeStack) pop() (ValueType, error) { - if vt, limit, ok := s.tryPop(); ok { - return vt, nil - } else { - return 0, fmt.Errorf("invalid operation: trying to pop at %d with limit %d", len(s.stack), limit) - } -} - -// popAndVerifyType returns an error if the stack value is unexpected. -func (s *valueTypeStack) popAndVerifyType(expected ValueType) error { - have, _, ok := s.tryPop() - if !ok { - return fmt.Errorf("%s missing", ValueTypeName(expected)) - } - if have != expected && have != valueTypeUnknown && expected != valueTypeUnknown { - return fmt.Errorf("type mismatch: expected %s, but was %s", ValueTypeName(expected), ValueTypeName(have)) - } - return nil -} - -func (s *valueTypeStack) push(v ValueType) { - s.stack = append(s.stack, v) - if sp := len(s.stack); sp > s.maximumStackPointer { - s.maximumStackPointer = sp - } -} - -func (s *valueTypeStack) unreachable() { - s.resetAtStackLimit() - s.stack = append(s.stack, valueTypeUnknown) -} - -func (s *valueTypeStack) resetAtStackLimit() { - if len(s.stackLimits) != 0 { - s.stack = s.stack[:s.stackLimits[len(s.stackLimits)-1]] - } else { - s.stack = s.stack[:0] - } -} - -func (s *valueTypeStack) popStackLimit() { - if len(s.stackLimits) != 0 { - s.stackLimits = s.stackLimits[:len(s.stackLimits)-1] - } -} - -// pushStackLimit pushes the control frame's bottom of the stack. -func (s *valueTypeStack) pushStackLimit(params int) { - limit := len(s.stack) - params - s.stackLimits = append(s.stackLimits, limit) -} - -func (s *valueTypeStack) popParams(oc Opcode, want []ValueType, checkAboveLimit bool) error { - return s.requireStackValues(true, InstructionName(oc), want, checkAboveLimit) -} - -func (s *valueTypeStack) popResults(oc Opcode, want []ValueType, checkAboveLimit bool) error { - return s.requireStackValues(false, InstructionName(oc), want, checkAboveLimit) -} - -func (s *valueTypeStack) requireStackValues( - isParam bool, - context string, - want []ValueType, - checkAboveLimit bool, -) error { - limit := 0 - if len(s.stackLimits) > 0 { - limit = s.stackLimits[len(s.stackLimits)-1] - } - // Iterate backwards as we are comparing the desired slice against stack value types. - countWanted := len(want) - - // First, check if there are enough values on the stack. - s.requireStackValuesTmp = s.requireStackValuesTmp[:0] - for i := countWanted - 1; i >= 0; i-- { - popped, _, ok := s.tryPop() - if !ok { - if len(s.requireStackValuesTmp) > len(want) { - return typeCountError(isParam, context, s.requireStackValuesTmp, want) - } - return typeCountError(isParam, context, s.requireStackValuesTmp, want) - } - s.requireStackValuesTmp = append(s.requireStackValuesTmp, popped) - } - - // Now, check if there are too many values. - if checkAboveLimit { - if !(limit == len(s.stack) || (limit+1 == len(s.stack) && s.stack[limit] == valueTypeUnknown)) { - return typeCountError(isParam, context, append(s.stack, want...), want) - } - } - - // Finally, check the types of the values: - for i, v := range s.requireStackValuesTmp { - nextWant := want[countWanted-i-1] // have is in reverse order (stack) - if v != nextWant && v != valueTypeUnknown && nextWant != valueTypeUnknown { - return typeMismatchError(isParam, context, v, nextWant, i) - } - } - return nil -} - -// typeMismatchError returns an error similar to go compiler's error on type mismatch. -func typeMismatchError(isParam bool, context string, have ValueType, want ValueType, i int) error { - var ret strings.Builder - ret.WriteString("cannot use ") - ret.WriteString(ValueTypeName(have)) - if context != "" { - ret.WriteString(" in ") - ret.WriteString(context) - ret.WriteString(" block") - } - if isParam { - ret.WriteString(" as param") - } else { - ret.WriteString(" as result") - } - ret.WriteString("[") - ret.WriteString(strconv.Itoa(i)) - ret.WriteString("] type ") - ret.WriteString(ValueTypeName(want)) - return errors.New(ret.String()) -} - -// typeCountError returns an error similar to go compiler's error on type count mismatch. -func typeCountError(isParam bool, context string, have []ValueType, want []ValueType) error { - var ret strings.Builder - if len(have) > len(want) { - ret.WriteString("too many ") - } else { - ret.WriteString("not enough ") - } - if isParam { - ret.WriteString("params") - } else { - ret.WriteString("results") - } - if context != "" { - if isParam { - ret.WriteString(" for ") - } else { - ret.WriteString(" in ") - } - ret.WriteString(context) - ret.WriteString(" block") - } - ret.WriteString("\n\thave (") - writeValueTypes(have, &ret) - ret.WriteString(")\n\twant (") - writeValueTypes(want, &ret) - ret.WriteByte(')') - return errors.New(ret.String()) -} - -func writeValueTypes(vts []ValueType, ret *strings.Builder) { - switch len(vts) { - case 0: - case 1: - ret.WriteString(ValueTypeName(vts[0])) - default: - ret.WriteString(ValueTypeName(vts[0])) - for _, vt := range vts[1:] { - ret.WriteString(", ") - ret.WriteString(ValueTypeName(vt)) - } - } -} - -func (s *valueTypeStack) String() string { - var typeStrs, limits []string - for _, v := range s.stack { - var str string - if v == valueTypeUnknown { - str = "unknown" - } else { - str = ValueTypeName(v) - } - typeStrs = append(typeStrs, str) - } - for _, d := range s.stackLimits { - limits = append(limits, fmt.Sprintf("%d", d)) - } - return fmt.Sprintf("{stack: [%s], limits: [%s]}", - strings.Join(typeStrs, ", "), strings.Join(limits, ",")) -} - -type controlBlock struct { - startAt, elseAt, endAt uint64 - blockType *FunctionType - blockTypeBytes uint64 - // op is zero when the outermost block - op Opcode -} - -// DecodeBlockType decodes the type index from a positive 33-bit signed integer. Negative numbers indicate up to one -// WebAssembly 1.0 (20191205) compatible result type. Positive numbers are decoded when `enabledFeatures` include -// CoreFeatureMultiValue and include an index in the Module.TypeSection. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-blocktype -// See https://github.com/WebAssembly/spec/blob/wg-2.0.draft1/proposals/multi-value/Overview.md -func DecodeBlockType(types []FunctionType, r *bytes.Reader, enabledFeatures api.CoreFeatures) (*FunctionType, uint64, error) { - raw, num, err := leb128.DecodeInt33AsInt64(r) - if err != nil { - return nil, 0, fmt.Errorf("decode int33: %w", err) - } - - var ret *FunctionType - switch raw { - case -64: // 0x40 in original byte = nil - ret = blockType_v_v - case -1: // 0x7f in original byte = i32 - ret = blockType_v_i32 - case -2: // 0x7e in original byte = i64 - ret = blockType_v_i64 - case -3: // 0x7d in original byte = f32 - ret = blockType_v_f32 - case -4: // 0x7c in original byte = f64 - ret = blockType_v_f64 - case -5: // 0x7b in original byte = v128 - ret = blockType_v_v128 - case -16: // 0x70 in original byte = funcref - ret = blockType_v_funcref - case -17: // 0x6f in original byte = externref - ret = blockType_v_externref - default: - if err = enabledFeatures.RequireEnabled(api.CoreFeatureMultiValue); err != nil { - return nil, num, fmt.Errorf("block with function type return invalid as %v", err) - } - if raw < 0 || (raw >= int64(len(types))) { - return nil, 0, fmt.Errorf("type index out of range: %d", raw) - } - ret = &types[raw] - } - return ret, num, err -} - -// These block types are defined as globals in order to avoid allocations in DecodeBlockType. -var ( - blockType_v_v = &FunctionType{} - blockType_v_i32 = &FunctionType{Results: []ValueType{ValueTypeI32}, ResultNumInUint64: 1} - blockType_v_i64 = &FunctionType{Results: []ValueType{ValueTypeI64}, ResultNumInUint64: 1} - blockType_v_f32 = &FunctionType{Results: []ValueType{ValueTypeF32}, ResultNumInUint64: 1} - blockType_v_f64 = &FunctionType{Results: []ValueType{ValueTypeF64}, ResultNumInUint64: 1} - blockType_v_v128 = &FunctionType{Results: []ValueType{ValueTypeV128}, ResultNumInUint64: 2} - blockType_v_funcref = &FunctionType{Results: []ValueType{ValueTypeFuncref}, ResultNumInUint64: 1} - blockType_v_externref = &FunctionType{Results: []ValueType{ValueTypeExternref}, ResultNumInUint64: 1} -) - -// SplitCallStack returns the input stack resliced to the count of params and -// results, or errors if it isn't long enough for either. -func SplitCallStack(ft *FunctionType, stack []uint64) (params []uint64, results []uint64, err error) { - stackLen := len(stack) - if n := ft.ParamNumInUint64; n > stackLen { - return nil, nil, fmt.Errorf("need %d params, but stack size is %d", n, stackLen) - } else if n > 0 { - params = stack[:n] - } - if n := ft.ResultNumInUint64; n > stackLen { - return nil, nil, fmt.Errorf("need %d results, but stack size is %d", n, stackLen) - } else if n > 0 { - results = stack[:n] - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go deleted file mode 100644 index c5f6e91217..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/function_definition.go +++ /dev/null @@ -1,188 +0,0 @@ -package wasm - -import ( - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/internalapi" - "github.com/tetratelabs/wazero/internal/wasmdebug" -) - -// ImportedFunctions returns the definitions of each imported function. -// -// Note: Unlike ExportedFunctions, there is no unique constraint on imports. -func (m *Module) ImportedFunctions() (ret []api.FunctionDefinition) { - for i := uint32(0); i < m.ImportFunctionCount; i++ { - ret = append(ret, m.FunctionDefinition(i)) - } - return -} - -// ExportedFunctions returns the definitions of each exported function. -func (m *Module) ExportedFunctions() map[string]api.FunctionDefinition { - ret := map[string]api.FunctionDefinition{} - for i := range m.ExportSection { - exp := &m.ExportSection[i] - if exp.Type == ExternTypeFunc { - d := m.FunctionDefinition(exp.Index) - ret[exp.Name] = d - } - } - return ret -} - -// FunctionDefinition returns the FunctionDefinition for the given `index`. -func (m *Module) FunctionDefinition(index Index) *FunctionDefinition { - // TODO: function initialization is lazy, but bulk. Make it per function. - m.buildFunctionDefinitions() - return &m.FunctionDefinitionSection[index] -} - -// buildFunctionDefinitions generates function metadata that can be parsed from -// the module. This must be called after all validation. -func (m *Module) buildFunctionDefinitions() { - m.functionDefinitionSectionInitOnce.Do(m.buildFunctionDefinitionsOnce) -} - -func (m *Module) buildFunctionDefinitionsOnce() { - var moduleName string - var functionNames NameMap - var localNames, resultNames IndirectNameMap - if m.NameSection != nil { - moduleName = m.NameSection.ModuleName - functionNames = m.NameSection.FunctionNames - localNames = m.NameSection.LocalNames - resultNames = m.NameSection.ResultNames - } - - importCount := m.ImportFunctionCount - m.FunctionDefinitionSection = make([]FunctionDefinition, importCount+uint32(len(m.FunctionSection))) - - importFuncIdx := Index(0) - for i := range m.ImportSection { - imp := &m.ImportSection[i] - if imp.Type != ExternTypeFunc { - continue - } - - def := &m.FunctionDefinitionSection[importFuncIdx] - def.importDesc = imp - def.index = importFuncIdx - def.Functype = &m.TypeSection[imp.DescFunc] - importFuncIdx++ - } - - for codeIndex, typeIndex := range m.FunctionSection { - code := &m.CodeSection[codeIndex] - idx := importFuncIdx + Index(codeIndex) - def := &m.FunctionDefinitionSection[idx] - def.index = idx - def.Functype = &m.TypeSection[typeIndex] - def.goFunc = code.GoFunc - } - - n, nLen := 0, len(functionNames) - for i := range m.FunctionDefinitionSection { - d := &m.FunctionDefinitionSection[i] - // The function name section begins with imports, but can be sparse. - // This keeps track of how far in the name section we've searched. - funcIdx := d.index - var funcName string - for ; n < nLen; n++ { - next := &functionNames[n] - if next.Index > funcIdx { - break // we have function names, but starting at a later index. - } else if next.Index == funcIdx { - funcName = next.Name - break - } - } - - d.moduleName = moduleName - d.name = funcName - d.Debugname = wasmdebug.FuncName(moduleName, funcName, funcIdx) - d.paramNames = paramNames(localNames, funcIdx, len(d.Functype.Params)) - d.resultNames = paramNames(resultNames, funcIdx, len(d.Functype.Results)) - - for i := range m.ExportSection { - e := &m.ExportSection[i] - if e.Type == ExternTypeFunc && e.Index == funcIdx { - d.exportNames = append(d.exportNames, e.Name) - } - } - } -} - -// FunctionDefinition implements api.FunctionDefinition -type FunctionDefinition struct { - internalapi.WazeroOnlyType - moduleName string - index Index - name string - // Debugname is exported for testing purpose. - Debugname string - goFunc interface{} - // Functype is exported for testing purpose. - Functype *FunctionType - importDesc *Import - exportNames []string - paramNames []string - resultNames []string -} - -// ModuleName implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) ModuleName() string { - return f.moduleName -} - -// Index implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) Index() uint32 { - return f.index -} - -// Name implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) Name() string { - return f.name -} - -// DebugName implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) DebugName() string { - return f.Debugname -} - -// Import implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) Import() (moduleName, name string, isImport bool) { - if f.importDesc != nil { - importDesc := f.importDesc - moduleName, name, isImport = importDesc.Module, importDesc.Name, true - } - return -} - -// ExportNames implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) ExportNames() []string { - return f.exportNames -} - -// GoFunction implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) GoFunction() interface{} { - return f.goFunc -} - -// ParamTypes implements api.FunctionDefinition ParamTypes. -func (f *FunctionDefinition) ParamTypes() []ValueType { - return f.Functype.Params -} - -// ParamNames implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) ParamNames() []string { - return f.paramNames -} - -// ResultTypes implements api.FunctionDefinition ResultTypes. -func (f *FunctionDefinition) ResultTypes() []ValueType { - return f.Functype.Results -} - -// ResultNames implements the same method as documented on api.FunctionDefinition. -func (f *FunctionDefinition) ResultNames() []string { - return f.resultNames -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/global.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/global.go deleted file mode 100644 index 6320e0dea4..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/global.go +++ /dev/null @@ -1,56 +0,0 @@ -package wasm - -import ( - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/internalapi" -) - -// constantGlobal wraps GlobalInstance to implement api.Global. -type constantGlobal struct { - internalapi.WazeroOnlyType - g *GlobalInstance -} - -// Type implements api.Global. -func (g constantGlobal) Type() api.ValueType { - return g.g.Type.ValType -} - -// Get implements api.Global. -func (g constantGlobal) Get() uint64 { - return g.g.Val -} - -// String implements api.Global. -func (g constantGlobal) String() string { - return g.g.String() -} - -// mutableGlobal extends constantGlobal to allow updates. -type mutableGlobal struct { - internalapi.WazeroOnlyType - g *GlobalInstance -} - -// Type implements api.Global. -func (g mutableGlobal) Type() api.ValueType { - return g.g.Type.ValType -} - -// Get implements api.Global. -func (g mutableGlobal) Get() uint64 { - return g.g.Val -} - -// String implements api.Global. -func (g mutableGlobal) String() string { - return g.g.String() -} - -// Set implements the same method as documented on api.MutableGlobal. -func (g mutableGlobal) Set(v uint64) { - g.g.Val = v -} - -// compile-time check to ensure mutableGlobal is a api.Global. -var _ api.Global = mutableGlobal{} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go deleted file mode 100644 index 9510c2588e..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/gofunc.go +++ /dev/null @@ -1,279 +0,0 @@ -package wasm - -import ( - "bytes" - "context" - "errors" - "fmt" - "math" - "reflect" - - "github.com/tetratelabs/wazero/api" -) - -type paramsKind byte - -const ( - paramsKindNoContext paramsKind = iota - paramsKindContext - paramsKindContextModule -) - -// Below are reflection code to get the interface type used to parse functions and set values. - -var ( - moduleType = reflect.TypeOf((*api.Module)(nil)).Elem() - goContextType = reflect.TypeOf((*context.Context)(nil)).Elem() - errorType = reflect.TypeOf((*error)(nil)).Elem() -) - -// compile-time check to ensure reflectGoModuleFunction implements -// api.GoModuleFunction. -var _ api.GoModuleFunction = (*reflectGoModuleFunction)(nil) - -type reflectGoModuleFunction struct { - fn *reflect.Value - params, results []ValueType -} - -// Call implements the same method as documented on api.GoModuleFunction. -func (f *reflectGoModuleFunction) Call(ctx context.Context, mod api.Module, stack []uint64) { - callGoFunc(ctx, mod, f.fn, stack) -} - -// EqualTo is exposed for testing. -func (f *reflectGoModuleFunction) EqualTo(that interface{}) bool { - if f2, ok := that.(*reflectGoModuleFunction); !ok { - return false - } else { - // TODO compare reflect pointers - return bytes.Equal(f.params, f2.params) && bytes.Equal(f.results, f2.results) - } -} - -// compile-time check to ensure reflectGoFunction implements api.GoFunction. -var _ api.GoFunction = (*reflectGoFunction)(nil) - -type reflectGoFunction struct { - fn *reflect.Value - pk paramsKind - params, results []ValueType -} - -// EqualTo is exposed for testing. -func (f *reflectGoFunction) EqualTo(that interface{}) bool { - if f2, ok := that.(*reflectGoFunction); !ok { - return false - } else { - // TODO compare reflect pointers - return f.pk == f2.pk && - bytes.Equal(f.params, f2.params) && bytes.Equal(f.results, f2.results) - } -} - -// Call implements the same method as documented on api.GoFunction. -func (f *reflectGoFunction) Call(ctx context.Context, stack []uint64) { - if f.pk == paramsKindNoContext { - ctx = nil - } - callGoFunc(ctx, nil, f.fn, stack) -} - -// callGoFunc executes the reflective function by converting params to Go -// types. The results of the function call are converted back to api.ValueType. -func callGoFunc(ctx context.Context, mod api.Module, fn *reflect.Value, stack []uint64) { - tp := fn.Type() - - var in []reflect.Value - pLen := tp.NumIn() - if pLen != 0 { - in = make([]reflect.Value, pLen) - - i := 0 - if ctx != nil { - in[0] = newContextVal(ctx) - i++ - } - if mod != nil { - in[1] = newModuleVal(mod) - i++ - } - - for j := 0; i < pLen; i++ { - next := tp.In(i) - val := reflect.New(next).Elem() - k := next.Kind() - raw := stack[j] - j++ - - switch k { - case reflect.Float32: - val.SetFloat(float64(math.Float32frombits(uint32(raw)))) - case reflect.Float64: - val.SetFloat(math.Float64frombits(raw)) - case reflect.Uint32, reflect.Uint64, reflect.Uintptr: - val.SetUint(raw) - case reflect.Int32, reflect.Int64: - val.SetInt(int64(raw)) - default: - panic(fmt.Errorf("BUG: param[%d] has an invalid type: %v", i, k)) - } - in[i] = val - } - } - - // Execute the host function and push back the call result onto the stack. - for i, ret := range fn.Call(in) { - switch ret.Kind() { - case reflect.Float32: - stack[i] = uint64(math.Float32bits(float32(ret.Float()))) - case reflect.Float64: - stack[i] = math.Float64bits(ret.Float()) - case reflect.Uint32, reflect.Uint64, reflect.Uintptr: - stack[i] = ret.Uint() - case reflect.Int32, reflect.Int64: - stack[i] = uint64(ret.Int()) - default: - panic(fmt.Errorf("BUG: result[%d] has an invalid type: %v", i, ret.Kind())) - } - } -} - -func newContextVal(ctx context.Context) reflect.Value { - val := reflect.New(goContextType).Elem() - val.Set(reflect.ValueOf(ctx)) - return val -} - -func newModuleVal(m api.Module) reflect.Value { - val := reflect.New(moduleType).Elem() - val.Set(reflect.ValueOf(m)) - return val -} - -// MustParseGoReflectFuncCode parses Code from the go function or panics. -// -// Exposing this simplifies FunctionDefinition of host functions in built-in host -// modules and tests. -func MustParseGoReflectFuncCode(fn interface{}) Code { - _, _, code, err := parseGoReflectFunc(fn) - if err != nil { - panic(err) - } - return code -} - -func parseGoReflectFunc(fn interface{}) (params, results []ValueType, code Code, err error) { - fnV := reflect.ValueOf(fn) - p := fnV.Type() - - if fnV.Kind() != reflect.Func { - err = fmt.Errorf("kind != func: %s", fnV.Kind().String()) - return - } - - pk, kindErr := kind(p) - if kindErr != nil { - err = kindErr - return - } - - pOffset := 0 - switch pk { - case paramsKindNoContext: - case paramsKindContext: - pOffset = 1 - case paramsKindContextModule: - pOffset = 2 - } - - pCount := p.NumIn() - pOffset - if pCount > 0 { - params = make([]ValueType, pCount) - } - for i := 0; i < len(params); i++ { - pI := p.In(i + pOffset) - if t, ok := getTypeOf(pI.Kind()); ok { - params[i] = t - continue - } - - // Now, we will definitely err, decide which message is best - var arg0Type reflect.Type - if hc := pI.Implements(moduleType); hc { - arg0Type = moduleType - } else if gc := pI.Implements(goContextType); gc { - arg0Type = goContextType - } - - if arg0Type != nil { - err = fmt.Errorf("param[%d] is a %s, which may be defined only once as param[0]", i+pOffset, arg0Type) - } else { - err = fmt.Errorf("param[%d] is unsupported: %s", i+pOffset, pI.Kind()) - } - return - } - - rCount := p.NumOut() - if rCount > 0 { - results = make([]ValueType, rCount) - } - for i := 0; i < len(results); i++ { - rI := p.Out(i) - if t, ok := getTypeOf(rI.Kind()); ok { - results[i] = t - continue - } - - // Now, we will definitely err, decide which message is best - if rI.Implements(errorType) { - err = fmt.Errorf("result[%d] is an error, which is unsupported", i) - } else { - err = fmt.Errorf("result[%d] is unsupported: %s", i, rI.Kind()) - } - return - } - - code = Code{} - if pk == paramsKindContextModule { - code.GoFunc = &reflectGoModuleFunction{fn: &fnV, params: params, results: results} - } else { - code.GoFunc = &reflectGoFunction{pk: pk, fn: &fnV, params: params, results: results} - } - return -} - -func kind(p reflect.Type) (paramsKind, error) { - pCount := p.NumIn() - if pCount > 0 && p.In(0).Kind() == reflect.Interface { - p0 := p.In(0) - if p0.Implements(moduleType) { - return 0, errors.New("invalid signature: api.Module parameter must be preceded by context.Context") - } else if p0.Implements(goContextType) { - if pCount >= 2 && p.In(1).Implements(moduleType) { - return paramsKindContextModule, nil - } - return paramsKindContext, nil - } - } - // Without context param allows portability with reflective runtimes. - // This allows people to more easily port to wazero. - return paramsKindNoContext, nil -} - -func getTypeOf(kind reflect.Kind) (ValueType, bool) { - switch kind { - case reflect.Float64: - return ValueTypeF64, true - case reflect.Float32: - return ValueTypeF32, true - case reflect.Int32, reflect.Uint32: - return ValueTypeI32, true - case reflect.Int64, reflect.Uint64: - return ValueTypeI64, true - case reflect.Uintptr: - return ValueTypeExternref, true - default: - return 0x00, false - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/host.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/host.go deleted file mode 100644 index bb9c40f591..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/host.go +++ /dev/null @@ -1,179 +0,0 @@ -package wasm - -import ( - "errors" - "fmt" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasmdebug" -) - -type HostFuncExporter interface { - ExportHostFunc(*HostFunc) -} - -// HostFunc is a function with an inlined type, used for NewHostModule. -// Any corresponding FunctionType will be reused or added to the Module. -type HostFunc struct { - // ExportName is the only value returned by api.FunctionDefinition. - ExportName string - - // Name is equivalent to the same method on api.FunctionDefinition. - Name string - - // ParamTypes is equivalent to the same method on api.FunctionDefinition. - ParamTypes []ValueType - - // ParamNames is equivalent to the same method on api.FunctionDefinition. - ParamNames []string - - // ResultTypes is equivalent to the same method on api.FunctionDefinition. - ResultTypes []ValueType - - // ResultNames is equivalent to the same method on api.FunctionDefinition. - ResultNames []string - - // Code is the equivalent function in the SectionIDCode. - Code Code -} - -// WithGoModuleFunc returns a copy of the function, replacing its Code.GoFunc. -func (f *HostFunc) WithGoModuleFunc(fn api.GoModuleFunc) *HostFunc { - ret := *f - ret.Code.GoFunc = fn - return &ret -} - -// NewHostModule is defined internally for use in WASI tests and to keep the code size in the root directory small. -func NewHostModule( - moduleName string, - exportNames []string, - nameToHostFunc map[string]*HostFunc, - enabledFeatures api.CoreFeatures, -) (m *Module, err error) { - if moduleName != "" { - m = &Module{NameSection: &NameSection{ModuleName: moduleName}} - } else { - return nil, errors.New("a module name must not be empty") - } - - if exportCount := uint32(len(nameToHostFunc)); exportCount > 0 { - m.ExportSection = make([]Export, 0, exportCount) - m.Exports = make(map[string]*Export, exportCount) - if err = addFuncs(m, exportNames, nameToHostFunc, enabledFeatures); err != nil { - return - } - } - - m.IsHostModule = true - // Uses the address of *wasm.Module as the module ID so that host functions can have each state per compilation. - // Downside of this is that compilation cache on host functions (trampoline codes for Go functions and - // Wasm codes for Wasm-implemented host functions) are not available and compiles each time. On the other hand, - // compilation of host modules is not costly as it's merely small trampolines vs the real-world native Wasm binary. - // TODO: refactor engines so that we can properly cache compiled machine codes for host modules. - m.AssignModuleID([]byte(fmt.Sprintf("@@@@@@@@%p", m)), // @@@@@@@@ = any 8 bytes different from Wasm header. - false, false) - return -} - -func addFuncs( - m *Module, - exportNames []string, - nameToHostFunc map[string]*HostFunc, - enabledFeatures api.CoreFeatures, -) (err error) { - if m.NameSection == nil { - m.NameSection = &NameSection{} - } - moduleName := m.NameSection.ModuleName - - for _, k := range exportNames { - hf := nameToHostFunc[k] - if hf.Name == "" { - hf.Name = k // default name to export name - } - switch hf.Code.GoFunc.(type) { - case api.GoModuleFunction, api.GoFunction: - continue // already parsed - } - - // Resolve the code using reflection - hf.ParamTypes, hf.ResultTypes, hf.Code, err = parseGoReflectFunc(hf.Code.GoFunc) - if err != nil { - return fmt.Errorf("func[%s.%s] %w", moduleName, k, err) - } - - // Assign names to the function, if they exist. - params := hf.ParamTypes - if paramNames := hf.ParamNames; paramNames != nil { - if paramNamesLen := len(paramNames); paramNamesLen != len(params) { - return fmt.Errorf("func[%s.%s] has %d params, but %d params names", moduleName, k, paramNamesLen, len(params)) - } - } - - results := hf.ResultTypes - if resultNames := hf.ResultNames; resultNames != nil { - if resultNamesLen := len(resultNames); resultNamesLen != len(results) { - return fmt.Errorf("func[%s.%s] has %d results, but %d results names", moduleName, k, resultNamesLen, len(results)) - } - } - } - - funcCount := uint32(len(exportNames)) - m.NameSection.FunctionNames = make([]NameAssoc, 0, funcCount) - m.FunctionSection = make([]Index, 0, funcCount) - m.CodeSection = make([]Code, 0, funcCount) - - idx := Index(0) - for _, name := range exportNames { - hf := nameToHostFunc[name] - debugName := wasmdebug.FuncName(moduleName, name, idx) - typeIdx, typeErr := m.maybeAddType(hf.ParamTypes, hf.ResultTypes, enabledFeatures) - if typeErr != nil { - return fmt.Errorf("func[%s] %v", debugName, typeErr) - } - m.FunctionSection = append(m.FunctionSection, typeIdx) - m.CodeSection = append(m.CodeSection, hf.Code) - - export := hf.ExportName - m.ExportSection = append(m.ExportSection, Export{Type: ExternTypeFunc, Name: export, Index: idx}) - m.Exports[export] = &m.ExportSection[len(m.ExportSection)-1] - m.NameSection.FunctionNames = append(m.NameSection.FunctionNames, NameAssoc{Index: idx, Name: hf.Name}) - - if len(hf.ParamNames) > 0 { - localNames := NameMapAssoc{Index: idx} - for i, n := range hf.ParamNames { - localNames.NameMap = append(localNames.NameMap, NameAssoc{Index: Index(i), Name: n}) - } - m.NameSection.LocalNames = append(m.NameSection.LocalNames, localNames) - } - if len(hf.ResultNames) > 0 { - resultNames := NameMapAssoc{Index: idx} - for i, n := range hf.ResultNames { - resultNames.NameMap = append(resultNames.NameMap, NameAssoc{Index: Index(i), Name: n}) - } - m.NameSection.ResultNames = append(m.NameSection.ResultNames, resultNames) - } - idx++ - } - return nil -} - -func (m *Module) maybeAddType(params, results []ValueType, enabledFeatures api.CoreFeatures) (Index, error) { - if len(results) > 1 { - // Guard >1.0 feature multi-value - if err := enabledFeatures.RequireEnabled(api.CoreFeatureMultiValue); err != nil { - return 0, fmt.Errorf("multiple result types invalid as %v", err) - } - } - for i := range m.TypeSection { - t := &m.TypeSection[i] - if t.EqualsSignature(params, results) { - return Index(i), nil - } - } - - result := m.SectionElementCount(SectionIDType) - m.TypeSection = append(m.TypeSection, FunctionType{Params: params, Results: results}) - return result, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go deleted file mode 100644 index ba65e9a2e3..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/instruction.go +++ /dev/null @@ -1,1550 +0,0 @@ -package wasm - -// Opcode is the binary Opcode of an instruction. See also InstructionName -type Opcode = byte - -const ( - // OpcodeUnreachable causes an unconditional trap. - OpcodeUnreachable Opcode = 0x00 - // OpcodeNop does nothing - OpcodeNop Opcode = 0x01 - // OpcodeBlock brackets a sequence of instructions. A branch instruction on an if label breaks out to after its - // OpcodeEnd. - OpcodeBlock Opcode = 0x02 - // OpcodeLoop brackets a sequence of instructions. A branch instruction on a loop label will jump back to the - // beginning of its block. - OpcodeLoop Opcode = 0x03 - // OpcodeIf brackets a sequence of instructions. When the top of the stack evaluates to 1, the block is executed. - // Zero jumps to the optional OpcodeElse. A branch instruction on an if label breaks out to after its OpcodeEnd. - OpcodeIf Opcode = 0x04 - // OpcodeElse brackets a sequence of instructions enclosed by an OpcodeIf. A branch instruction on a then label - // breaks out to after the OpcodeEnd on the enclosing OpcodeIf. - OpcodeElse Opcode = 0x05 - // OpcodeEnd terminates a control instruction OpcodeBlock, OpcodeLoop or OpcodeIf. - OpcodeEnd Opcode = 0x0b - - // OpcodeBr is a stack-polymorphic opcode that performs an unconditional branch. How the stack is modified depends - // on whether the "br" is enclosed by a loop, and if CoreFeatureMultiValue is enabled. - // - // Here are the rules in pseudocode about how the stack is modified based on the "br" operand L (label): - // if L is loop: append(L.originalStackWithoutInputs, N-values popped from the stack) where N == L.inputs - // else: append(L.originalStackWithoutInputs, N-values popped from the stack) where N == L.results - // - // In WebAssembly 1.0 (20191205), N can be zero or one. When CoreFeatureMultiValue is enabled, N can be more than one, - // depending on the type use of the label L. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefsyntax-instr-controlmathsfbrl - OpcodeBr Opcode = 0x0c - // ^^ TODO: Add a diagram to help explain br l means that branch into AFTER l for non-loop labels - - OpcodeBrIf Opcode = 0x0d - OpcodeBrTable Opcode = 0x0e - OpcodeReturn Opcode = 0x0f - OpcodeCall Opcode = 0x10 - OpcodeCallIndirect Opcode = 0x11 - - // parametric instructions - - OpcodeDrop Opcode = 0x1a - OpcodeSelect Opcode = 0x1b - OpcodeTypedSelect Opcode = 0x1c - - // variable instructions - - OpcodeLocalGet Opcode = 0x20 - OpcodeLocalSet Opcode = 0x21 - OpcodeLocalTee Opcode = 0x22 - OpcodeGlobalGet Opcode = 0x23 - OpcodeGlobalSet Opcode = 0x24 - - // Below are toggled with CoreFeatureReferenceTypes - - OpcodeTableGet Opcode = 0x25 - OpcodeTableSet Opcode = 0x26 - - // memory instructions - - OpcodeI32Load Opcode = 0x28 - OpcodeI64Load Opcode = 0x29 - OpcodeF32Load Opcode = 0x2a - OpcodeF64Load Opcode = 0x2b - OpcodeI32Load8S Opcode = 0x2c - OpcodeI32Load8U Opcode = 0x2d - OpcodeI32Load16S Opcode = 0x2e - OpcodeI32Load16U Opcode = 0x2f - OpcodeI64Load8S Opcode = 0x30 - OpcodeI64Load8U Opcode = 0x31 - OpcodeI64Load16S Opcode = 0x32 - OpcodeI64Load16U Opcode = 0x33 - OpcodeI64Load32S Opcode = 0x34 - OpcodeI64Load32U Opcode = 0x35 - OpcodeI32Store Opcode = 0x36 - OpcodeI64Store Opcode = 0x37 - OpcodeF32Store Opcode = 0x38 - OpcodeF64Store Opcode = 0x39 - OpcodeI32Store8 Opcode = 0x3a - OpcodeI32Store16 Opcode = 0x3b - OpcodeI64Store8 Opcode = 0x3c - OpcodeI64Store16 Opcode = 0x3d - OpcodeI64Store32 Opcode = 0x3e - OpcodeMemorySize Opcode = 0x3f - OpcodeMemoryGrow Opcode = 0x40 - - // const instructions - - OpcodeI32Const Opcode = 0x41 - OpcodeI64Const Opcode = 0x42 - OpcodeF32Const Opcode = 0x43 - OpcodeF64Const Opcode = 0x44 - - // numeric instructions - - OpcodeI32Eqz Opcode = 0x45 - OpcodeI32Eq Opcode = 0x46 - OpcodeI32Ne Opcode = 0x47 - OpcodeI32LtS Opcode = 0x48 - OpcodeI32LtU Opcode = 0x49 - OpcodeI32GtS Opcode = 0x4a - OpcodeI32GtU Opcode = 0x4b - OpcodeI32LeS Opcode = 0x4c - OpcodeI32LeU Opcode = 0x4d - OpcodeI32GeS Opcode = 0x4e - OpcodeI32GeU Opcode = 0x4f - - OpcodeI64Eqz Opcode = 0x50 - OpcodeI64Eq Opcode = 0x51 - OpcodeI64Ne Opcode = 0x52 - OpcodeI64LtS Opcode = 0x53 - OpcodeI64LtU Opcode = 0x54 - OpcodeI64GtS Opcode = 0x55 - OpcodeI64GtU Opcode = 0x56 - OpcodeI64LeS Opcode = 0x57 - OpcodeI64LeU Opcode = 0x58 - OpcodeI64GeS Opcode = 0x59 - OpcodeI64GeU Opcode = 0x5a - - OpcodeF32Eq Opcode = 0x5b - OpcodeF32Ne Opcode = 0x5c - OpcodeF32Lt Opcode = 0x5d - OpcodeF32Gt Opcode = 0x5e - OpcodeF32Le Opcode = 0x5f - OpcodeF32Ge Opcode = 0x60 - - OpcodeF64Eq Opcode = 0x61 - OpcodeF64Ne Opcode = 0x62 - OpcodeF64Lt Opcode = 0x63 - OpcodeF64Gt Opcode = 0x64 - OpcodeF64Le Opcode = 0x65 - OpcodeF64Ge Opcode = 0x66 - - OpcodeI32Clz Opcode = 0x67 - OpcodeI32Ctz Opcode = 0x68 - OpcodeI32Popcnt Opcode = 0x69 - OpcodeI32Add Opcode = 0x6a - OpcodeI32Sub Opcode = 0x6b - OpcodeI32Mul Opcode = 0x6c - OpcodeI32DivS Opcode = 0x6d - OpcodeI32DivU Opcode = 0x6e - OpcodeI32RemS Opcode = 0x6f - OpcodeI32RemU Opcode = 0x70 - OpcodeI32And Opcode = 0x71 - OpcodeI32Or Opcode = 0x72 - OpcodeI32Xor Opcode = 0x73 - OpcodeI32Shl Opcode = 0x74 - OpcodeI32ShrS Opcode = 0x75 - OpcodeI32ShrU Opcode = 0x76 - OpcodeI32Rotl Opcode = 0x77 - OpcodeI32Rotr Opcode = 0x78 - - OpcodeI64Clz Opcode = 0x79 - OpcodeI64Ctz Opcode = 0x7a - OpcodeI64Popcnt Opcode = 0x7b - OpcodeI64Add Opcode = 0x7c - OpcodeI64Sub Opcode = 0x7d - OpcodeI64Mul Opcode = 0x7e - OpcodeI64DivS Opcode = 0x7f - OpcodeI64DivU Opcode = 0x80 - OpcodeI64RemS Opcode = 0x81 - OpcodeI64RemU Opcode = 0x82 - OpcodeI64And Opcode = 0x83 - OpcodeI64Or Opcode = 0x84 - OpcodeI64Xor Opcode = 0x85 - OpcodeI64Shl Opcode = 0x86 - OpcodeI64ShrS Opcode = 0x87 - OpcodeI64ShrU Opcode = 0x88 - OpcodeI64Rotl Opcode = 0x89 - OpcodeI64Rotr Opcode = 0x8a - - OpcodeF32Abs Opcode = 0x8b - OpcodeF32Neg Opcode = 0x8c - OpcodeF32Ceil Opcode = 0x8d - OpcodeF32Floor Opcode = 0x8e - OpcodeF32Trunc Opcode = 0x8f - OpcodeF32Nearest Opcode = 0x90 - OpcodeF32Sqrt Opcode = 0x91 - OpcodeF32Add Opcode = 0x92 - OpcodeF32Sub Opcode = 0x93 - OpcodeF32Mul Opcode = 0x94 - OpcodeF32Div Opcode = 0x95 - OpcodeF32Min Opcode = 0x96 - OpcodeF32Max Opcode = 0x97 - OpcodeF32Copysign Opcode = 0x98 - - OpcodeF64Abs Opcode = 0x99 - OpcodeF64Neg Opcode = 0x9a - OpcodeF64Ceil Opcode = 0x9b - OpcodeF64Floor Opcode = 0x9c - OpcodeF64Trunc Opcode = 0x9d - OpcodeF64Nearest Opcode = 0x9e - OpcodeF64Sqrt Opcode = 0x9f - OpcodeF64Add Opcode = 0xa0 - OpcodeF64Sub Opcode = 0xa1 - OpcodeF64Mul Opcode = 0xa2 - OpcodeF64Div Opcode = 0xa3 - OpcodeF64Min Opcode = 0xa4 - OpcodeF64Max Opcode = 0xa5 - OpcodeF64Copysign Opcode = 0xa6 - - OpcodeI32WrapI64 Opcode = 0xa7 - OpcodeI32TruncF32S Opcode = 0xa8 - OpcodeI32TruncF32U Opcode = 0xa9 - OpcodeI32TruncF64S Opcode = 0xaa - OpcodeI32TruncF64U Opcode = 0xab - - OpcodeI64ExtendI32S Opcode = 0xac - OpcodeI64ExtendI32U Opcode = 0xad - OpcodeI64TruncF32S Opcode = 0xae - OpcodeI64TruncF32U Opcode = 0xaf - OpcodeI64TruncF64S Opcode = 0xb0 - OpcodeI64TruncF64U Opcode = 0xb1 - - OpcodeF32ConvertI32S Opcode = 0xb2 - OpcodeF32ConvertI32U Opcode = 0xb3 - OpcodeF32ConvertI64S Opcode = 0xb4 - OpcodeF32ConvertI64U Opcode = 0xb5 - OpcodeF32DemoteF64 Opcode = 0xb6 - - OpcodeF64ConvertI32S Opcode = 0xb7 - OpcodeF64ConvertI32U Opcode = 0xb8 - OpcodeF64ConvertI64S Opcode = 0xb9 - OpcodeF64ConvertI64U Opcode = 0xba - OpcodeF64PromoteF32 Opcode = 0xbb - - OpcodeI32ReinterpretF32 Opcode = 0xbc - OpcodeI64ReinterpretF64 Opcode = 0xbd - OpcodeF32ReinterpretI32 Opcode = 0xbe - OpcodeF64ReinterpretI64 Opcode = 0xbf - - // OpcodeRefNull pushes a null reference value whose type is specified by immediate to this opcode. - // This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well. - // - // Currently only supported in the constant expression in element segments. - OpcodeRefNull = 0xd0 - // OpcodeRefIsNull pops a reference value, and pushes 1 if it is null, 0 otherwise. - // This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well. - // - // Currently not supported. - OpcodeRefIsNull = 0xd1 - // OpcodeRefFunc pushes a funcref value whose index equals the immediate to this opcode. - // This is defined in the reference-types proposal, but necessary for CoreFeatureBulkMemoryOperations as well. - // - // Currently, this is only supported in the constant expression in element segments. - OpcodeRefFunc = 0xd2 - - // Below are toggled with CoreFeatureSignExtensionOps - - // OpcodeI32Extend8S extends a signed 8-bit integer to a 32-bit integer. - // Note: This is dependent on the flag CoreFeatureSignExtensionOps - OpcodeI32Extend8S Opcode = 0xc0 - - // OpcodeI32Extend16S extends a signed 16-bit integer to a 32-bit integer. - // Note: This is dependent on the flag CoreFeatureSignExtensionOps - OpcodeI32Extend16S Opcode = 0xc1 - - // OpcodeI64Extend8S extends a signed 8-bit integer to a 64-bit integer. - // Note: This is dependent on the flag CoreFeatureSignExtensionOps - OpcodeI64Extend8S Opcode = 0xc2 - - // OpcodeI64Extend16S extends a signed 16-bit integer to a 64-bit integer. - // Note: This is dependent on the flag CoreFeatureSignExtensionOps - OpcodeI64Extend16S Opcode = 0xc3 - - // OpcodeI64Extend32S extends a signed 32-bit integer to a 64-bit integer. - // Note: This is dependent on the flag CoreFeatureSignExtensionOps - OpcodeI64Extend32S Opcode = 0xc4 - - // OpcodeMiscPrefix is the prefix of various multi-byte opcodes. - // Introduced in CoreFeatureNonTrappingFloatToIntConversion, but used in other - // features, such as CoreFeatureBulkMemoryOperations. - OpcodeMiscPrefix Opcode = 0xfc - - // OpcodeVecPrefix is the prefix of all vector isntructions introduced in - // CoreFeatureSIMD. - OpcodeVecPrefix Opcode = 0xfd -) - -// OpcodeMisc represents opcodes of the miscellaneous operations. -// Such an operations has multi-byte encoding which is prefixed by OpcodeMiscPrefix. -type OpcodeMisc = byte - -const ( - // Below are toggled with CoreFeatureNonTrappingFloatToIntConversion. - // https://github.com/WebAssembly/spec/blob/ce4b6c4d47eb06098cc7ab2e81f24748da822f20/proposals/nontrapping-float-to-int-conversion/Overview.md - - OpcodeMiscI32TruncSatF32S OpcodeMisc = 0x00 - OpcodeMiscI32TruncSatF32U OpcodeMisc = 0x01 - OpcodeMiscI32TruncSatF64S OpcodeMisc = 0x02 - OpcodeMiscI32TruncSatF64U OpcodeMisc = 0x03 - OpcodeMiscI64TruncSatF32S OpcodeMisc = 0x04 - OpcodeMiscI64TruncSatF32U OpcodeMisc = 0x05 - OpcodeMiscI64TruncSatF64S OpcodeMisc = 0x06 - OpcodeMiscI64TruncSatF64U OpcodeMisc = 0x07 - - // Below are toggled with CoreFeatureBulkMemoryOperations. - // Opcodes are those new in document/core/appendix/index-instructions.rst (the commit that merged the feature). - // See https://github.com/WebAssembly/spec/commit/7fa2f20a6df4cf1c114582c8cb60f5bfcdbf1be1 - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#bulk-memory-and-table-instructions - - OpcodeMiscMemoryInit OpcodeMisc = 0x08 - OpcodeMiscDataDrop OpcodeMisc = 0x09 - OpcodeMiscMemoryCopy OpcodeMisc = 0x0a - OpcodeMiscMemoryFill OpcodeMisc = 0x0b - OpcodeMiscTableInit OpcodeMisc = 0x0c - OpcodeMiscElemDrop OpcodeMisc = 0x0d - OpcodeMiscTableCopy OpcodeMisc = 0x0e - - // Below are toggled with CoreFeatureReferenceTypes - - OpcodeMiscTableGrow OpcodeMisc = 0x0f - OpcodeMiscTableSize OpcodeMisc = 0x10 - OpcodeMiscTableFill OpcodeMisc = 0x11 -) - -// OpcodeVec represents an opcode of a vector instructions which has -// multi-byte encoding and is prefixed by OpcodeMiscPrefix. -// -// These opcodes are toggled with CoreFeatureSIMD. -type OpcodeVec = byte - -const ( - // Loads and stores. - - OpcodeVecV128Load OpcodeVec = 0x00 - OpcodeVecV128Load8x8s OpcodeVec = 0x01 - OpcodeVecV128Load8x8u OpcodeVec = 0x02 - OpcodeVecV128Load16x4s OpcodeVec = 0x03 - OpcodeVecV128Load16x4u OpcodeVec = 0x04 - OpcodeVecV128Load32x2s OpcodeVec = 0x05 - OpcodeVecV128Load32x2u OpcodeVec = 0x06 - OpcodeVecV128Load8Splat OpcodeVec = 0x07 - OpcodeVecV128Load16Splat OpcodeVec = 0x08 - OpcodeVecV128Load32Splat OpcodeVec = 0x09 - OpcodeVecV128Load64Splat OpcodeVec = 0x0a - - OpcodeVecV128Load32zero OpcodeVec = 0x5c - OpcodeVecV128Load64zero OpcodeVec = 0x5d - - OpcodeVecV128Store OpcodeVec = 0x0b - OpcodeVecV128Load8Lane OpcodeVec = 0x54 - OpcodeVecV128Load16Lane OpcodeVec = 0x55 - OpcodeVecV128Load32Lane OpcodeVec = 0x56 - OpcodeVecV128Load64Lane OpcodeVec = 0x57 - OpcodeVecV128Store8Lane OpcodeVec = 0x58 - OpcodeVecV128Store16Lane OpcodeVec = 0x59 - OpcodeVecV128Store32Lane OpcodeVec = 0x5a - OpcodeVecV128Store64Lane OpcodeVec = 0x5b - - // OpcodeVecV128Const is the vector const instruction. - OpcodeVecV128Const OpcodeVec = 0x0c - - // OpcodeVecV128i8x16Shuffle is the vector shuffle instruction. - OpcodeVecV128i8x16Shuffle OpcodeVec = 0x0d - - // Extrac and replaces. - - OpcodeVecI8x16ExtractLaneS OpcodeVec = 0x15 - OpcodeVecI8x16ExtractLaneU OpcodeVec = 0x16 - OpcodeVecI8x16ReplaceLane OpcodeVec = 0x17 - OpcodeVecI16x8ExtractLaneS OpcodeVec = 0x18 - OpcodeVecI16x8ExtractLaneU OpcodeVec = 0x19 - OpcodeVecI16x8ReplaceLane OpcodeVec = 0x1a - OpcodeVecI32x4ExtractLane OpcodeVec = 0x1b - OpcodeVecI32x4ReplaceLane OpcodeVec = 0x1c - OpcodeVecI64x2ExtractLane OpcodeVec = 0x1d - OpcodeVecI64x2ReplaceLane OpcodeVec = 0x1e - OpcodeVecF32x4ExtractLane OpcodeVec = 0x1f - OpcodeVecF32x4ReplaceLane OpcodeVec = 0x20 - OpcodeVecF64x2ExtractLane OpcodeVec = 0x21 - OpcodeVecF64x2ReplaceLane OpcodeVec = 0x22 - - // Splat and swizzle. - - OpcodeVecI8x16Swizzle OpcodeVec = 0x0e - OpcodeVecI8x16Splat OpcodeVec = 0x0f - OpcodeVecI16x8Splat OpcodeVec = 0x10 - OpcodeVecI32x4Splat OpcodeVec = 0x11 - OpcodeVecI64x2Splat OpcodeVec = 0x12 - OpcodeVecF32x4Splat OpcodeVec = 0x13 - OpcodeVecF64x2Splat OpcodeVec = 0x14 - - // i8 comparisons. - - OpcodeVecI8x16Eq OpcodeVec = 0x23 - OpcodeVecI8x16Ne OpcodeVec = 0x24 - OpcodeVecI8x16LtS OpcodeVec = 0x25 - OpcodeVecI8x16LtU OpcodeVec = 0x26 - OpcodeVecI8x16GtS OpcodeVec = 0x27 - OpcodeVecI8x16GtU OpcodeVec = 0x28 - OpcodeVecI8x16LeS OpcodeVec = 0x29 - OpcodeVecI8x16LeU OpcodeVec = 0x2a - OpcodeVecI8x16GeS OpcodeVec = 0x2b - OpcodeVecI8x16GeU OpcodeVec = 0x2c - - // i16 comparisons. - - OpcodeVecI16x8Eq OpcodeVec = 0x2d - OpcodeVecI16x8Ne OpcodeVec = 0x2e - OpcodeVecI16x8LtS OpcodeVec = 0x2f - OpcodeVecI16x8LtU OpcodeVec = 0x30 - OpcodeVecI16x8GtS OpcodeVec = 0x31 - OpcodeVecI16x8GtU OpcodeVec = 0x32 - OpcodeVecI16x8LeS OpcodeVec = 0x33 - OpcodeVecI16x8LeU OpcodeVec = 0x34 - OpcodeVecI16x8GeS OpcodeVec = 0x35 - OpcodeVecI16x8GeU OpcodeVec = 0x36 - - // i32 comparisons. - - OpcodeVecI32x4Eq OpcodeVec = 0x37 - OpcodeVecI32x4Ne OpcodeVec = 0x38 - OpcodeVecI32x4LtS OpcodeVec = 0x39 - OpcodeVecI32x4LtU OpcodeVec = 0x3a - OpcodeVecI32x4GtS OpcodeVec = 0x3b - OpcodeVecI32x4GtU OpcodeVec = 0x3c - OpcodeVecI32x4LeS OpcodeVec = 0x3d - OpcodeVecI32x4LeU OpcodeVec = 0x3e - OpcodeVecI32x4GeS OpcodeVec = 0x3f - OpcodeVecI32x4GeU OpcodeVec = 0x40 - - // i64 comparisons. - - OpcodeVecI64x2Eq OpcodeVec = 0xd6 - OpcodeVecI64x2Ne OpcodeVec = 0xd7 - OpcodeVecI64x2LtS OpcodeVec = 0xd8 - OpcodeVecI64x2GtS OpcodeVec = 0xd9 - OpcodeVecI64x2LeS OpcodeVec = 0xda - OpcodeVecI64x2GeS OpcodeVec = 0xdb - - // f32 comparisons. - - OpcodeVecF32x4Eq OpcodeVec = 0x41 - OpcodeVecF32x4Ne OpcodeVec = 0x42 - OpcodeVecF32x4Lt OpcodeVec = 0x43 - OpcodeVecF32x4Gt OpcodeVec = 0x44 - OpcodeVecF32x4Le OpcodeVec = 0x45 - OpcodeVecF32x4Ge OpcodeVec = 0x46 - - // f64 comparisons. - - OpcodeVecF64x2Eq OpcodeVec = 0x47 - OpcodeVecF64x2Ne OpcodeVec = 0x48 - OpcodeVecF64x2Lt OpcodeVec = 0x49 - OpcodeVecF64x2Gt OpcodeVec = 0x4a - OpcodeVecF64x2Le OpcodeVec = 0x4b - OpcodeVecF64x2Ge OpcodeVec = 0x4c - - // v128 logical instructions. - - OpcodeVecV128Not OpcodeVec = 0x4d - OpcodeVecV128And OpcodeVec = 0x4e - OpcodeVecV128AndNot OpcodeVec = 0x4f - OpcodeVecV128Or OpcodeVec = 0x50 - OpcodeVecV128Xor OpcodeVec = 0x51 - OpcodeVecV128Bitselect OpcodeVec = 0x52 - OpcodeVecV128AnyTrue OpcodeVec = 0x53 - - // i8 misc. - - OpcodeVecI8x16Abs OpcodeVec = 0x60 - OpcodeVecI8x16Neg OpcodeVec = 0x61 - OpcodeVecI8x16Popcnt OpcodeVec = 0x62 - OpcodeVecI8x16AllTrue OpcodeVec = 0x63 - OpcodeVecI8x16BitMask OpcodeVec = 0x64 - OpcodeVecI8x16NarrowI16x8S OpcodeVec = 0x65 - OpcodeVecI8x16NarrowI16x8U OpcodeVec = 0x66 - - OpcodeVecI8x16Shl OpcodeVec = 0x6b - OpcodeVecI8x16ShrS OpcodeVec = 0x6c - OpcodeVecI8x16ShrU OpcodeVec = 0x6d - OpcodeVecI8x16Add OpcodeVec = 0x6e - OpcodeVecI8x16AddSatS OpcodeVec = 0x6f - - OpcodeVecI8x16AddSatU OpcodeVec = 0x70 - OpcodeVecI8x16Sub OpcodeVec = 0x71 - OpcodeVecI8x16SubSatS OpcodeVec = 0x72 - OpcodeVecI8x16SubSatU OpcodeVec = 0x73 - OpcodeVecI8x16MinS OpcodeVec = 0x76 - OpcodeVecI8x16MinU OpcodeVec = 0x77 - OpcodeVecI8x16MaxS OpcodeVec = 0x78 - OpcodeVecI8x16MaxU OpcodeVec = 0x79 - OpcodeVecI8x16AvgrU OpcodeVec = 0x7b - - // i16 misc. - - OpcodeVecI16x8ExtaddPairwiseI8x16S OpcodeVec = 0x7c - OpcodeVecI16x8ExtaddPairwiseI8x16U OpcodeVec = 0x7d - OpcodeVecI16x8Abs OpcodeVec = 0x80 - OpcodeVecI16x8Neg OpcodeVec = 0x81 - OpcodeVecI16x8Q15mulrSatS OpcodeVec = 0x82 - OpcodeVecI16x8AllTrue OpcodeVec = 0x83 - OpcodeVecI16x8BitMask OpcodeVec = 0x84 - OpcodeVecI16x8NarrowI32x4S OpcodeVec = 0x85 - OpcodeVecI16x8NarrowI32x4U OpcodeVec = 0x86 - OpcodeVecI16x8ExtendLowI8x16S OpcodeVec = 0x87 - OpcodeVecI16x8ExtendHighI8x16S OpcodeVec = 0x88 - OpcodeVecI16x8ExtendLowI8x16U OpcodeVec = 0x89 - OpcodeVecI16x8ExtendHighI8x16U OpcodeVec = 0x8a - OpcodeVecI16x8Shl OpcodeVec = 0x8b - OpcodeVecI16x8ShrS OpcodeVec = 0x8c - OpcodeVecI16x8ShrU OpcodeVec = 0x8d - OpcodeVecI16x8Add OpcodeVec = 0x8e - OpcodeVecI16x8AddSatS OpcodeVec = 0x8f - OpcodeVecI16x8AddSatU OpcodeVec = 0x90 - OpcodeVecI16x8Sub OpcodeVec = 0x91 - OpcodeVecI16x8SubSatS OpcodeVec = 0x92 - OpcodeVecI16x8SubSatU OpcodeVec = 0x93 - OpcodeVecI16x8Mul OpcodeVec = 0x95 - OpcodeVecI16x8MinS OpcodeVec = 0x96 - OpcodeVecI16x8MinU OpcodeVec = 0x97 - OpcodeVecI16x8MaxS OpcodeVec = 0x98 - OpcodeVecI16x8MaxU OpcodeVec = 0x99 - OpcodeVecI16x8AvgrU OpcodeVec = 0x9b - OpcodeVecI16x8ExtMulLowI8x16S OpcodeVec = 0x9c - OpcodeVecI16x8ExtMulHighI8x16S OpcodeVec = 0x9d - OpcodeVecI16x8ExtMulLowI8x16U OpcodeVec = 0x9e - OpcodeVecI16x8ExtMulHighI8x16U OpcodeVec = 0x9f - - // i32 misc. - - OpcodeVecI32x4ExtaddPairwiseI16x8S OpcodeVec = 0x7e - OpcodeVecI32x4ExtaddPairwiseI16x8U OpcodeVec = 0x7f - OpcodeVecI32x4Abs OpcodeVec = 0xa0 - OpcodeVecI32x4Neg OpcodeVec = 0xa1 - OpcodeVecI32x4AllTrue OpcodeVec = 0xa3 - OpcodeVecI32x4BitMask OpcodeVec = 0xa4 - OpcodeVecI32x4ExtendLowI16x8S OpcodeVec = 0xa7 - OpcodeVecI32x4ExtendHighI16x8S OpcodeVec = 0xa8 - OpcodeVecI32x4ExtendLowI16x8U OpcodeVec = 0xa9 - OpcodeVecI32x4ExtendHighI16x8U OpcodeVec = 0xaa - OpcodeVecI32x4Shl OpcodeVec = 0xab - OpcodeVecI32x4ShrS OpcodeVec = 0xac - OpcodeVecI32x4ShrU OpcodeVec = 0xad - OpcodeVecI32x4Add OpcodeVec = 0xae - OpcodeVecI32x4Sub OpcodeVec = 0xb1 - OpcodeVecI32x4Mul OpcodeVec = 0xb5 - OpcodeVecI32x4MinS OpcodeVec = 0xb6 - OpcodeVecI32x4MinU OpcodeVec = 0xb7 - OpcodeVecI32x4MaxS OpcodeVec = 0xb8 - OpcodeVecI32x4MaxU OpcodeVec = 0xb9 - OpcodeVecI32x4DotI16x8S OpcodeVec = 0xba - OpcodeVecI32x4ExtMulLowI16x8S OpcodeVec = 0xbc - OpcodeVecI32x4ExtMulHighI16x8S OpcodeVec = 0xbd - OpcodeVecI32x4ExtMulLowI16x8U OpcodeVec = 0xbe - OpcodeVecI32x4ExtMulHighI16x8U OpcodeVec = 0xbf - - // i64 misc. - - OpcodeVecI64x2Abs OpcodeVec = 0xc0 - OpcodeVecI64x2Neg OpcodeVec = 0xc1 - OpcodeVecI64x2AllTrue OpcodeVec = 0xc3 - OpcodeVecI64x2BitMask OpcodeVec = 0xc4 - OpcodeVecI64x2ExtendLowI32x4S OpcodeVec = 0xc7 - OpcodeVecI64x2ExtendHighI32x4S OpcodeVec = 0xc8 - OpcodeVecI64x2ExtendLowI32x4U OpcodeVec = 0xc9 - OpcodeVecI64x2ExtendHighI32x4U OpcodeVec = 0xca - OpcodeVecI64x2Shl OpcodeVec = 0xcb - OpcodeVecI64x2ShrS OpcodeVec = 0xcc - OpcodeVecI64x2ShrU OpcodeVec = 0xcd - OpcodeVecI64x2Add OpcodeVec = 0xce - OpcodeVecI64x2Sub OpcodeVec = 0xd1 - OpcodeVecI64x2Mul OpcodeVec = 0xd5 - OpcodeVecI64x2ExtMulLowI32x4S OpcodeVec = 0xdc - OpcodeVecI64x2ExtMulHighI32x4S OpcodeVec = 0xdd - OpcodeVecI64x2ExtMulLowI32x4U OpcodeVec = 0xde - OpcodeVecI64x2ExtMulHighI32x4U OpcodeVec = 0xdf - - // f32 misc. - - OpcodeVecF32x4Ceil OpcodeVec = 0x67 - OpcodeVecF32x4Floor OpcodeVec = 0x68 - OpcodeVecF32x4Trunc OpcodeVec = 0x69 - OpcodeVecF32x4Nearest OpcodeVec = 0x6a - OpcodeVecF32x4Abs OpcodeVec = 0xe0 - OpcodeVecF32x4Neg OpcodeVec = 0xe1 - OpcodeVecF32x4Sqrt OpcodeVec = 0xe3 - OpcodeVecF32x4Add OpcodeVec = 0xe4 - OpcodeVecF32x4Sub OpcodeVec = 0xe5 - OpcodeVecF32x4Mul OpcodeVec = 0xe6 - OpcodeVecF32x4Div OpcodeVec = 0xe7 - OpcodeVecF32x4Min OpcodeVec = 0xe8 - OpcodeVecF32x4Max OpcodeVec = 0xe9 - OpcodeVecF32x4Pmin OpcodeVec = 0xea - OpcodeVecF32x4Pmax OpcodeVec = 0xeb - - // f64 misc. - - OpcodeVecF64x2Ceil OpcodeVec = 0x74 - OpcodeVecF64x2Floor OpcodeVec = 0x75 - OpcodeVecF64x2Trunc OpcodeVec = 0x7a - OpcodeVecF64x2Nearest OpcodeVec = 0x94 - OpcodeVecF64x2Abs OpcodeVec = 0xec - OpcodeVecF64x2Neg OpcodeVec = 0xed - OpcodeVecF64x2Sqrt OpcodeVec = 0xef - OpcodeVecF64x2Add OpcodeVec = 0xf0 - OpcodeVecF64x2Sub OpcodeVec = 0xf1 - OpcodeVecF64x2Mul OpcodeVec = 0xf2 - OpcodeVecF64x2Div OpcodeVec = 0xf3 - OpcodeVecF64x2Min OpcodeVec = 0xf4 - OpcodeVecF64x2Max OpcodeVec = 0xf5 - OpcodeVecF64x2Pmin OpcodeVec = 0xf6 - OpcodeVecF64x2Pmax OpcodeVec = 0xf7 - - // conversions. - - OpcodeVecI32x4TruncSatF32x4S OpcodeVec = 0xf8 - OpcodeVecI32x4TruncSatF32x4U OpcodeVec = 0xf9 - OpcodeVecF32x4ConvertI32x4S OpcodeVec = 0xfa - OpcodeVecF32x4ConvertI32x4U OpcodeVec = 0xfb - OpcodeVecI32x4TruncSatF64x2SZero OpcodeVec = 0xfc - OpcodeVecI32x4TruncSatF64x2UZero OpcodeVec = 0xfd - OpcodeVecF64x2ConvertLowI32x4S OpcodeVec = 0xfe - OpcodeVecF64x2ConvertLowI32x4U OpcodeVec = 0xff - OpcodeVecF32x4DemoteF64x2Zero OpcodeVec = 0x5e - OpcodeVecF64x2PromoteLowF32x4Zero OpcodeVec = 0x5f -) - -const ( - OpcodeUnreachableName = "unreachable" - OpcodeNopName = "nop" - OpcodeBlockName = "block" - OpcodeLoopName = "loop" - OpcodeIfName = "if" - OpcodeElseName = "else" - OpcodeEndName = "end" - OpcodeBrName = "br" - OpcodeBrIfName = "br_if" - OpcodeBrTableName = "br_table" - OpcodeReturnName = "return" - OpcodeCallName = "call" - OpcodeCallIndirectName = "call_indirect" - OpcodeDropName = "drop" - OpcodeSelectName = "select" - OpcodeTypedSelectName = "typed_select" - OpcodeLocalGetName = "local.get" - OpcodeLocalSetName = "local.set" - OpcodeLocalTeeName = "local.tee" - OpcodeGlobalGetName = "global.get" - OpcodeGlobalSetName = "global.set" - OpcodeI32LoadName = "i32.load" - OpcodeI64LoadName = "i64.load" - OpcodeF32LoadName = "f32.load" - OpcodeF64LoadName = "f64.load" - OpcodeI32Load8SName = "i32.load8_s" - OpcodeI32Load8UName = "i32.load8_u" - OpcodeI32Load16SName = "i32.load16_s" - OpcodeI32Load16UName = "i32.load16_u" - OpcodeI64Load8SName = "i64.load8_s" - OpcodeI64Load8UName = "i64.load8_u" - OpcodeI64Load16SName = "i64.load16_s" - OpcodeI64Load16UName = "i64.load16_u" - OpcodeI64Load32SName = "i64.load32_s" - OpcodeI64Load32UName = "i64.load32_u" - OpcodeI32StoreName = "i32.store" - OpcodeI64StoreName = "i64.store" - OpcodeF32StoreName = "f32.store" - OpcodeF64StoreName = "f64.store" - OpcodeI32Store8Name = "i32.store8" - OpcodeI32Store16Name = "i32.store16" - OpcodeI64Store8Name = "i64.store8" - OpcodeI64Store16Name = "i64.store16" - OpcodeI64Store32Name = "i64.store32" - OpcodeMemorySizeName = "memory.size" - OpcodeMemoryGrowName = "memory.grow" - OpcodeI32ConstName = "i32.const" - OpcodeI64ConstName = "i64.const" - OpcodeF32ConstName = "f32.const" - OpcodeF64ConstName = "f64.const" - OpcodeI32EqzName = "i32.eqz" - OpcodeI32EqName = "i32.eq" - OpcodeI32NeName = "i32.ne" - OpcodeI32LtSName = "i32.lt_s" - OpcodeI32LtUName = "i32.lt_u" - OpcodeI32GtSName = "i32.gt_s" - OpcodeI32GtUName = "i32.gt_u" - OpcodeI32LeSName = "i32.le_s" - OpcodeI32LeUName = "i32.le_u" - OpcodeI32GeSName = "i32.ge_s" - OpcodeI32GeUName = "i32.ge_u" - OpcodeI64EqzName = "i64.eqz" - OpcodeI64EqName = "i64.eq" - OpcodeI64NeName = "i64.ne" - OpcodeI64LtSName = "i64.lt_s" - OpcodeI64LtUName = "i64.lt_u" - OpcodeI64GtSName = "i64.gt_s" - OpcodeI64GtUName = "i64.gt_u" - OpcodeI64LeSName = "i64.le_s" - OpcodeI64LeUName = "i64.le_u" - OpcodeI64GeSName = "i64.ge_s" - OpcodeI64GeUName = "i64.ge_u" - OpcodeF32EqName = "f32.eq" - OpcodeF32NeName = "f32.ne" - OpcodeF32LtName = "f32.lt" - OpcodeF32GtName = "f32.gt" - OpcodeF32LeName = "f32.le" - OpcodeF32GeName = "f32.ge" - OpcodeF64EqName = "f64.eq" - OpcodeF64NeName = "f64.ne" - OpcodeF64LtName = "f64.lt" - OpcodeF64GtName = "f64.gt" - OpcodeF64LeName = "f64.le" - OpcodeF64GeName = "f64.ge" - OpcodeI32ClzName = "i32.clz" - OpcodeI32CtzName = "i32.ctz" - OpcodeI32PopcntName = "i32.popcnt" - OpcodeI32AddName = "i32.add" - OpcodeI32SubName = "i32.sub" - OpcodeI32MulName = "i32.mul" - OpcodeI32DivSName = "i32.div_s" - OpcodeI32DivUName = "i32.div_u" - OpcodeI32RemSName = "i32.rem_s" - OpcodeI32RemUName = "i32.rem_u" - OpcodeI32AndName = "i32.and" - OpcodeI32OrName = "i32.or" - OpcodeI32XorName = "i32.xor" - OpcodeI32ShlName = "i32.shl" - OpcodeI32ShrSName = "i32.shr_s" - OpcodeI32ShrUName = "i32.shr_u" - OpcodeI32RotlName = "i32.rotl" - OpcodeI32RotrName = "i32.rotr" - OpcodeI64ClzName = "i64.clz" - OpcodeI64CtzName = "i64.ctz" - OpcodeI64PopcntName = "i64.popcnt" - OpcodeI64AddName = "i64.add" - OpcodeI64SubName = "i64.sub" - OpcodeI64MulName = "i64.mul" - OpcodeI64DivSName = "i64.div_s" - OpcodeI64DivUName = "i64.div_u" - OpcodeI64RemSName = "i64.rem_s" - OpcodeI64RemUName = "i64.rem_u" - OpcodeI64AndName = "i64.and" - OpcodeI64OrName = "i64.or" - OpcodeI64XorName = "i64.xor" - OpcodeI64ShlName = "i64.shl" - OpcodeI64ShrSName = "i64.shr_s" - OpcodeI64ShrUName = "i64.shr_u" - OpcodeI64RotlName = "i64.rotl" - OpcodeI64RotrName = "i64.rotr" - OpcodeF32AbsName = "f32.abs" - OpcodeF32NegName = "f32.neg" - OpcodeF32CeilName = "f32.ceil" - OpcodeF32FloorName = "f32.floor" - OpcodeF32TruncName = "f32.trunc" - OpcodeF32NearestName = "f32.nearest" - OpcodeF32SqrtName = "f32.sqrt" - OpcodeF32AddName = "f32.add" - OpcodeF32SubName = "f32.sub" - OpcodeF32MulName = "f32.mul" - OpcodeF32DivName = "f32.div" - OpcodeF32MinName = "f32.min" - OpcodeF32MaxName = "f32.max" - OpcodeF32CopysignName = "f32.copysign" - OpcodeF64AbsName = "f64.abs" - OpcodeF64NegName = "f64.neg" - OpcodeF64CeilName = "f64.ceil" - OpcodeF64FloorName = "f64.floor" - OpcodeF64TruncName = "f64.trunc" - OpcodeF64NearestName = "f64.nearest" - OpcodeF64SqrtName = "f64.sqrt" - OpcodeF64AddName = "f64.add" - OpcodeF64SubName = "f64.sub" - OpcodeF64MulName = "f64.mul" - OpcodeF64DivName = "f64.div" - OpcodeF64MinName = "f64.min" - OpcodeF64MaxName = "f64.max" - OpcodeF64CopysignName = "f64.copysign" - OpcodeI32WrapI64Name = "i32.wrap_i64" - OpcodeI32TruncF32SName = "i32.trunc_f32_s" - OpcodeI32TruncF32UName = "i32.trunc_f32_u" - OpcodeI32TruncF64SName = "i32.trunc_f64_s" - OpcodeI32TruncF64UName = "i32.trunc_f64_u" - OpcodeI64ExtendI32SName = "i64.extend_i32_s" - OpcodeI64ExtendI32UName = "i64.extend_i32_u" - OpcodeI64TruncF32SName = "i64.trunc_f32_s" - OpcodeI64TruncF32UName = "i64.trunc_f32_u" - OpcodeI64TruncF64SName = "i64.trunc_f64_s" - OpcodeI64TruncF64UName = "i64.trunc_f64_u" - OpcodeF32ConvertI32SName = "f32.convert_i32_s" - OpcodeF32ConvertI32UName = "f32.convert_i32_u" - OpcodeF32ConvertI64SName = "f32.convert_i64_s" - OpcodeF32ConvertI64UName = "f32.convert_i64u" - OpcodeF32DemoteF64Name = "f32.demote_f64" - OpcodeF64ConvertI32SName = "f64.convert_i32_s" - OpcodeF64ConvertI32UName = "f64.convert_i32_u" - OpcodeF64ConvertI64SName = "f64.convert_i64_s" - OpcodeF64ConvertI64UName = "f64.convert_i64_u" - OpcodeF64PromoteF32Name = "f64.promote_f32" - OpcodeI32ReinterpretF32Name = "i32.reinterpret_f32" - OpcodeI64ReinterpretF64Name = "i64.reinterpret_f64" - OpcodeF32ReinterpretI32Name = "f32.reinterpret_i32" - OpcodeF64ReinterpretI64Name = "f64.reinterpret_i64" - - OpcodeRefNullName = "ref.null" - OpcodeRefIsNullName = "ref.is_null" - OpcodeRefFuncName = "ref.func" - - OpcodeTableGetName = "table.get" - OpcodeTableSetName = "table.set" - - // Below are toggled with CoreFeatureSignExtensionOps - - OpcodeI32Extend8SName = "i32.extend8_s" - OpcodeI32Extend16SName = "i32.extend16_s" - OpcodeI64Extend8SName = "i64.extend8_s" - OpcodeI64Extend16SName = "i64.extend16_s" - OpcodeI64Extend32SName = "i64.extend32_s" - - OpcodeMiscPrefixName = "misc_prefix" - OpcodeVecPrefixName = "vector_prefix" -) - -var instructionNames = [256]string{ - OpcodeUnreachable: OpcodeUnreachableName, - OpcodeNop: OpcodeNopName, - OpcodeBlock: OpcodeBlockName, - OpcodeLoop: OpcodeLoopName, - OpcodeIf: OpcodeIfName, - OpcodeElse: OpcodeElseName, - OpcodeEnd: OpcodeEndName, - OpcodeBr: OpcodeBrName, - OpcodeBrIf: OpcodeBrIfName, - OpcodeBrTable: OpcodeBrTableName, - OpcodeReturn: OpcodeReturnName, - OpcodeCall: OpcodeCallName, - OpcodeCallIndirect: OpcodeCallIndirectName, - OpcodeDrop: OpcodeDropName, - OpcodeSelect: OpcodeSelectName, - OpcodeTypedSelect: OpcodeTypedSelectName, - OpcodeLocalGet: OpcodeLocalGetName, - OpcodeLocalSet: OpcodeLocalSetName, - OpcodeLocalTee: OpcodeLocalTeeName, - OpcodeGlobalGet: OpcodeGlobalGetName, - OpcodeGlobalSet: OpcodeGlobalSetName, - OpcodeI32Load: OpcodeI32LoadName, - OpcodeI64Load: OpcodeI64LoadName, - OpcodeF32Load: OpcodeF32LoadName, - OpcodeF64Load: OpcodeF64LoadName, - OpcodeI32Load8S: OpcodeI32Load8SName, - OpcodeI32Load8U: OpcodeI32Load8UName, - OpcodeI32Load16S: OpcodeI32Load16SName, - OpcodeI32Load16U: OpcodeI32Load16UName, - OpcodeI64Load8S: OpcodeI64Load8SName, - OpcodeI64Load8U: OpcodeI64Load8UName, - OpcodeI64Load16S: OpcodeI64Load16SName, - OpcodeI64Load16U: OpcodeI64Load16UName, - OpcodeI64Load32S: OpcodeI64Load32SName, - OpcodeI64Load32U: OpcodeI64Load32UName, - OpcodeI32Store: OpcodeI32StoreName, - OpcodeI64Store: OpcodeI64StoreName, - OpcodeF32Store: OpcodeF32StoreName, - OpcodeF64Store: OpcodeF64StoreName, - OpcodeI32Store8: OpcodeI32Store8Name, - OpcodeI32Store16: OpcodeI32Store16Name, - OpcodeI64Store8: OpcodeI64Store8Name, - OpcodeI64Store16: OpcodeI64Store16Name, - OpcodeI64Store32: OpcodeI64Store32Name, - OpcodeMemorySize: OpcodeMemorySizeName, - OpcodeMemoryGrow: OpcodeMemoryGrowName, - OpcodeI32Const: OpcodeI32ConstName, - OpcodeI64Const: OpcodeI64ConstName, - OpcodeF32Const: OpcodeF32ConstName, - OpcodeF64Const: OpcodeF64ConstName, - OpcodeI32Eqz: OpcodeI32EqzName, - OpcodeI32Eq: OpcodeI32EqName, - OpcodeI32Ne: OpcodeI32NeName, - OpcodeI32LtS: OpcodeI32LtSName, - OpcodeI32LtU: OpcodeI32LtUName, - OpcodeI32GtS: OpcodeI32GtSName, - OpcodeI32GtU: OpcodeI32GtUName, - OpcodeI32LeS: OpcodeI32LeSName, - OpcodeI32LeU: OpcodeI32LeUName, - OpcodeI32GeS: OpcodeI32GeSName, - OpcodeI32GeU: OpcodeI32GeUName, - OpcodeI64Eqz: OpcodeI64EqzName, - OpcodeI64Eq: OpcodeI64EqName, - OpcodeI64Ne: OpcodeI64NeName, - OpcodeI64LtS: OpcodeI64LtSName, - OpcodeI64LtU: OpcodeI64LtUName, - OpcodeI64GtS: OpcodeI64GtSName, - OpcodeI64GtU: OpcodeI64GtUName, - OpcodeI64LeS: OpcodeI64LeSName, - OpcodeI64LeU: OpcodeI64LeUName, - OpcodeI64GeS: OpcodeI64GeSName, - OpcodeI64GeU: OpcodeI64GeUName, - OpcodeF32Eq: OpcodeF32EqName, - OpcodeF32Ne: OpcodeF32NeName, - OpcodeF32Lt: OpcodeF32LtName, - OpcodeF32Gt: OpcodeF32GtName, - OpcodeF32Le: OpcodeF32LeName, - OpcodeF32Ge: OpcodeF32GeName, - OpcodeF64Eq: OpcodeF64EqName, - OpcodeF64Ne: OpcodeF64NeName, - OpcodeF64Lt: OpcodeF64LtName, - OpcodeF64Gt: OpcodeF64GtName, - OpcodeF64Le: OpcodeF64LeName, - OpcodeF64Ge: OpcodeF64GeName, - OpcodeI32Clz: OpcodeI32ClzName, - OpcodeI32Ctz: OpcodeI32CtzName, - OpcodeI32Popcnt: OpcodeI32PopcntName, - OpcodeI32Add: OpcodeI32AddName, - OpcodeI32Sub: OpcodeI32SubName, - OpcodeI32Mul: OpcodeI32MulName, - OpcodeI32DivS: OpcodeI32DivSName, - OpcodeI32DivU: OpcodeI32DivUName, - OpcodeI32RemS: OpcodeI32RemSName, - OpcodeI32RemU: OpcodeI32RemUName, - OpcodeI32And: OpcodeI32AndName, - OpcodeI32Or: OpcodeI32OrName, - OpcodeI32Xor: OpcodeI32XorName, - OpcodeI32Shl: OpcodeI32ShlName, - OpcodeI32ShrS: OpcodeI32ShrSName, - OpcodeI32ShrU: OpcodeI32ShrUName, - OpcodeI32Rotl: OpcodeI32RotlName, - OpcodeI32Rotr: OpcodeI32RotrName, - OpcodeI64Clz: OpcodeI64ClzName, - OpcodeI64Ctz: OpcodeI64CtzName, - OpcodeI64Popcnt: OpcodeI64PopcntName, - OpcodeI64Add: OpcodeI64AddName, - OpcodeI64Sub: OpcodeI64SubName, - OpcodeI64Mul: OpcodeI64MulName, - OpcodeI64DivS: OpcodeI64DivSName, - OpcodeI64DivU: OpcodeI64DivUName, - OpcodeI64RemS: OpcodeI64RemSName, - OpcodeI64RemU: OpcodeI64RemUName, - OpcodeI64And: OpcodeI64AndName, - OpcodeI64Or: OpcodeI64OrName, - OpcodeI64Xor: OpcodeI64XorName, - OpcodeI64Shl: OpcodeI64ShlName, - OpcodeI64ShrS: OpcodeI64ShrSName, - OpcodeI64ShrU: OpcodeI64ShrUName, - OpcodeI64Rotl: OpcodeI64RotlName, - OpcodeI64Rotr: OpcodeI64RotrName, - OpcodeF32Abs: OpcodeF32AbsName, - OpcodeF32Neg: OpcodeF32NegName, - OpcodeF32Ceil: OpcodeF32CeilName, - OpcodeF32Floor: OpcodeF32FloorName, - OpcodeF32Trunc: OpcodeF32TruncName, - OpcodeF32Nearest: OpcodeF32NearestName, - OpcodeF32Sqrt: OpcodeF32SqrtName, - OpcodeF32Add: OpcodeF32AddName, - OpcodeF32Sub: OpcodeF32SubName, - OpcodeF32Mul: OpcodeF32MulName, - OpcodeF32Div: OpcodeF32DivName, - OpcodeF32Min: OpcodeF32MinName, - OpcodeF32Max: OpcodeF32MaxName, - OpcodeF32Copysign: OpcodeF32CopysignName, - OpcodeF64Abs: OpcodeF64AbsName, - OpcodeF64Neg: OpcodeF64NegName, - OpcodeF64Ceil: OpcodeF64CeilName, - OpcodeF64Floor: OpcodeF64FloorName, - OpcodeF64Trunc: OpcodeF64TruncName, - OpcodeF64Nearest: OpcodeF64NearestName, - OpcodeF64Sqrt: OpcodeF64SqrtName, - OpcodeF64Add: OpcodeF64AddName, - OpcodeF64Sub: OpcodeF64SubName, - OpcodeF64Mul: OpcodeF64MulName, - OpcodeF64Div: OpcodeF64DivName, - OpcodeF64Min: OpcodeF64MinName, - OpcodeF64Max: OpcodeF64MaxName, - OpcodeF64Copysign: OpcodeF64CopysignName, - OpcodeI32WrapI64: OpcodeI32WrapI64Name, - OpcodeI32TruncF32S: OpcodeI32TruncF32SName, - OpcodeI32TruncF32U: OpcodeI32TruncF32UName, - OpcodeI32TruncF64S: OpcodeI32TruncF64SName, - OpcodeI32TruncF64U: OpcodeI32TruncF64UName, - OpcodeI64ExtendI32S: OpcodeI64ExtendI32SName, - OpcodeI64ExtendI32U: OpcodeI64ExtendI32UName, - OpcodeI64TruncF32S: OpcodeI64TruncF32SName, - OpcodeI64TruncF32U: OpcodeI64TruncF32UName, - OpcodeI64TruncF64S: OpcodeI64TruncF64SName, - OpcodeI64TruncF64U: OpcodeI64TruncF64UName, - OpcodeF32ConvertI32S: OpcodeF32ConvertI32SName, - OpcodeF32ConvertI32U: OpcodeF32ConvertI32UName, - OpcodeF32ConvertI64S: OpcodeF32ConvertI64SName, - OpcodeF32ConvertI64U: OpcodeF32ConvertI64UName, - OpcodeF32DemoteF64: OpcodeF32DemoteF64Name, - OpcodeF64ConvertI32S: OpcodeF64ConvertI32SName, - OpcodeF64ConvertI32U: OpcodeF64ConvertI32UName, - OpcodeF64ConvertI64S: OpcodeF64ConvertI64SName, - OpcodeF64ConvertI64U: OpcodeF64ConvertI64UName, - OpcodeF64PromoteF32: OpcodeF64PromoteF32Name, - OpcodeI32ReinterpretF32: OpcodeI32ReinterpretF32Name, - OpcodeI64ReinterpretF64: OpcodeI64ReinterpretF64Name, - OpcodeF32ReinterpretI32: OpcodeF32ReinterpretI32Name, - OpcodeF64ReinterpretI64: OpcodeF64ReinterpretI64Name, - - OpcodeRefNull: OpcodeRefNullName, - OpcodeRefIsNull: OpcodeRefIsNullName, - OpcodeRefFunc: OpcodeRefFuncName, - - OpcodeTableGet: OpcodeTableGetName, - OpcodeTableSet: OpcodeTableSetName, - - // Below are toggled with CoreFeatureSignExtensionOps - - OpcodeI32Extend8S: OpcodeI32Extend8SName, - OpcodeI32Extend16S: OpcodeI32Extend16SName, - OpcodeI64Extend8S: OpcodeI64Extend8SName, - OpcodeI64Extend16S: OpcodeI64Extend16SName, - OpcodeI64Extend32S: OpcodeI64Extend32SName, - - OpcodeMiscPrefix: OpcodeMiscPrefixName, - OpcodeVecPrefix: OpcodeVecPrefixName, -} - -// InstructionName returns the instruction corresponding to this binary Opcode. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#a7-index-of-instructions -func InstructionName(oc Opcode) string { - return instructionNames[oc] -} - -const ( - OpcodeI32TruncSatF32SName = "i32.trunc_sat_f32_s" - OpcodeI32TruncSatF32UName = "i32.trunc_sat_f32_u" - OpcodeI32TruncSatF64SName = "i32.trunc_sat_f64_s" - OpcodeI32TruncSatF64UName = "i32.trunc_sat_f64_u" - OpcodeI64TruncSatF32SName = "i64.trunc_sat_f32_s" - OpcodeI64TruncSatF32UName = "i64.trunc_sat_f32_u" - OpcodeI64TruncSatF64SName = "i64.trunc_sat_f64_s" - OpcodeI64TruncSatF64UName = "i64.trunc_sat_f64_u" - - OpcodeMemoryInitName = "memory.init" - OpcodeDataDropName = "data.drop" - OpcodeMemoryCopyName = "memory.copy" - OpcodeMemoryFillName = "memory.fill" - OpcodeTableInitName = "table.init" - OpcodeElemDropName = "elem.drop" - OpcodeTableCopyName = "table.copy" - OpcodeTableGrowName = "table.grow" - OpcodeTableSizeName = "table.size" - OpcodeTableFillName = "table.fill" -) - -var miscInstructionNames = [256]string{ - OpcodeMiscI32TruncSatF32S: OpcodeI32TruncSatF32SName, - OpcodeMiscI32TruncSatF32U: OpcodeI32TruncSatF32UName, - OpcodeMiscI32TruncSatF64S: OpcodeI32TruncSatF64SName, - OpcodeMiscI32TruncSatF64U: OpcodeI32TruncSatF64UName, - OpcodeMiscI64TruncSatF32S: OpcodeI64TruncSatF32SName, - OpcodeMiscI64TruncSatF32U: OpcodeI64TruncSatF32UName, - OpcodeMiscI64TruncSatF64S: OpcodeI64TruncSatF64SName, - OpcodeMiscI64TruncSatF64U: OpcodeI64TruncSatF64UName, - - OpcodeMiscMemoryInit: OpcodeMemoryInitName, - OpcodeMiscDataDrop: OpcodeDataDropName, - OpcodeMiscMemoryCopy: OpcodeMemoryCopyName, - OpcodeMiscMemoryFill: OpcodeMemoryFillName, - OpcodeMiscTableInit: OpcodeTableInitName, - OpcodeMiscElemDrop: OpcodeElemDropName, - OpcodeMiscTableCopy: OpcodeTableCopyName, - OpcodeMiscTableGrow: OpcodeTableGrowName, - OpcodeMiscTableSize: OpcodeTableSizeName, - OpcodeMiscTableFill: OpcodeTableFillName, -} - -// MiscInstructionName returns the instruction corresponding to this miscellaneous Opcode. -func MiscInstructionName(oc OpcodeMisc) string { - return miscInstructionNames[oc] -} - -const ( - OpcodeVecV128LoadName = "v128.load" - OpcodeVecV128Load8x8SName = "v128.load8x8_s" - OpcodeVecV128Load8x8UName = "v128.load8x8_u" - OpcodeVecV128Load16x4SName = "v128.load16x4_s" - OpcodeVecV128Load16x4UName = "v128.load16x4_u" - OpcodeVecV128Load32x2SName = "v128.load32x2_s" - OpcodeVecV128Load32x2UName = "v128.load32x2_u" - OpcodeVecV128Load8SplatName = "v128.load8_splat" - OpcodeVecV128Load16SplatName = "v128.load16_splat" - OpcodeVecV128Load32SplatName = "v128.load32_splat" - OpcodeVecV128Load64SplatName = "v128.load64_splat" - OpcodeVecV128Load32zeroName = "v128.load32_zero" - OpcodeVecV128Load64zeroName = "v128.load64_zero" - OpcodeVecV128StoreName = "v128.store" - OpcodeVecV128Load8LaneName = "v128.load8_lane" - OpcodeVecV128Load16LaneName = "v128.load16_lane" - OpcodeVecV128Load32LaneName = "v128.load32_lane" - OpcodeVecV128Load64LaneName = "v128.load64_lane" - OpcodeVecV128Store8LaneName = "v128.store8_lane" - OpcodeVecV128Store16LaneName = "v128.store16_lane" - OpcodeVecV128Store32LaneName = "v128.store32_lane" - OpcodeVecV128Store64LaneName = "v128.store64_lane" - OpcodeVecV128ConstName = "v128.const" - OpcodeVecV128i8x16ShuffleName = "v128.shuffle" - OpcodeVecI8x16ExtractLaneSName = "i8x16.extract_lane_s" - OpcodeVecI8x16ExtractLaneUName = "i8x16.extract_lane_u" - OpcodeVecI8x16ReplaceLaneName = "i8x16.replace_lane" - OpcodeVecI16x8ExtractLaneSName = "i16x8.extract_lane_s" - OpcodeVecI16x8ExtractLaneUName = "i16x8.extract_lane_u" - OpcodeVecI16x8ReplaceLaneName = "i16x8.replace_lane" - OpcodeVecI32x4ExtractLaneName = "i32x4.extract_lane" - OpcodeVecI32x4ReplaceLaneName = "i32x4.replace_lane" - OpcodeVecI64x2ExtractLaneName = "i64x2.extract_lane" - OpcodeVecI64x2ReplaceLaneName = "i64x2.replace_lane" - OpcodeVecF32x4ExtractLaneName = "f32x4.extract_lane" - OpcodeVecF32x4ReplaceLaneName = "f32x4.replace_lane" - OpcodeVecF64x2ExtractLaneName = "f64x2.extract_lane" - OpcodeVecF64x2ReplaceLaneName = "f64x2.replace_lane" - OpcodeVecI8x16SwizzleName = "i8x16.swizzle" - OpcodeVecI8x16SplatName = "i8x16.splat" - OpcodeVecI16x8SplatName = "i16x8.splat" - OpcodeVecI32x4SplatName = "i32x4.splat" - OpcodeVecI64x2SplatName = "i64x2.splat" - OpcodeVecF32x4SplatName = "f32x4.splat" - OpcodeVecF64x2SplatName = "f64x2.splat" - OpcodeVecI8x16EqName = "i8x16.eq" - OpcodeVecI8x16NeName = "i8x16.ne" - OpcodeVecI8x16LtSName = "i8x16.lt_s" - OpcodeVecI8x16LtUName = "i8x16.lt_u" - OpcodeVecI8x16GtSName = "i8x16.gt_s" - OpcodeVecI8x16GtUName = "i8x16.gt_u" - OpcodeVecI8x16LeSName = "i8x16.le_s" - OpcodeVecI8x16LeUName = "i8x16.le_u" - OpcodeVecI8x16GeSName = "i8x16.ge_s" - OpcodeVecI8x16GeUName = "i8x16.ge_u" - OpcodeVecI16x8EqName = "i16x8.eq" - OpcodeVecI16x8NeName = "i16x8.ne" - OpcodeVecI16x8LtSName = "i16x8.lt_s" - OpcodeVecI16x8LtUName = "i16x8.lt_u" - OpcodeVecI16x8GtSName = "i16x8.gt_s" - OpcodeVecI16x8GtUName = "i16x8.gt_u" - OpcodeVecI16x8LeSName = "i16x8.le_s" - OpcodeVecI16x8LeUName = "i16x8.le_u" - OpcodeVecI16x8GeSName = "i16x8.ge_s" - OpcodeVecI16x8GeUName = "i16x8.ge_u" - OpcodeVecI32x4EqName = "i32x4.eq" - OpcodeVecI32x4NeName = "i32x4.ne" - OpcodeVecI32x4LtSName = "i32x4.lt_s" - OpcodeVecI32x4LtUName = "i32x4.lt_u" - OpcodeVecI32x4GtSName = "i32x4.gt_s" - OpcodeVecI32x4GtUName = "i32x4.gt_u" - OpcodeVecI32x4LeSName = "i32x4.le_s" - OpcodeVecI32x4LeUName = "i32x4.le_u" - OpcodeVecI32x4GeSName = "i32x4.ge_s" - OpcodeVecI32x4GeUName = "i32x4.ge_u" - OpcodeVecI64x2EqName = "i64x2.eq" - OpcodeVecI64x2NeName = "i64x2.ne" - OpcodeVecI64x2LtSName = "i64x2.lt" - OpcodeVecI64x2GtSName = "i64x2.gt" - OpcodeVecI64x2LeSName = "i64x2.le" - OpcodeVecI64x2GeSName = "i64x2.ge" - OpcodeVecF32x4EqName = "f32x4.eq" - OpcodeVecF32x4NeName = "f32x4.ne" - OpcodeVecF32x4LtName = "f32x4.lt" - OpcodeVecF32x4GtName = "f32x4.gt" - OpcodeVecF32x4LeName = "f32x4.le" - OpcodeVecF32x4GeName = "f32x4.ge" - OpcodeVecF64x2EqName = "f64x2.eq" - OpcodeVecF64x2NeName = "f64x2.ne" - OpcodeVecF64x2LtName = "f64x2.lt" - OpcodeVecF64x2GtName = "f64x2.gt" - OpcodeVecF64x2LeName = "f64x2.le" - OpcodeVecF64x2GeName = "f64x2.ge" - OpcodeVecV128NotName = "v128.not" - OpcodeVecV128AndName = "v128.and" - OpcodeVecV128AndNotName = "v128.andnot" - OpcodeVecV128OrName = "v128.or" - OpcodeVecV128XorName = "v128.xor" - OpcodeVecV128BitselectName = "v128.bitselect" - OpcodeVecV128AnyTrueName = "v128.any_true" - OpcodeVecI8x16AbsName = "i8x16.abs" - OpcodeVecI8x16NegName = "i8x16.neg" - OpcodeVecI8x16PopcntName = "i8x16.popcnt" - OpcodeVecI8x16AllTrueName = "i8x16.all_true" - OpcodeVecI8x16BitMaskName = "i8x16.bitmask" - OpcodeVecI8x16NarrowI16x8SName = "i8x16.narrow_i16x8_s" - OpcodeVecI8x16NarrowI16x8UName = "i8x16.narrow_i16x8_u" - OpcodeVecI8x16ShlName = "i8x16.shl" - OpcodeVecI8x16ShrSName = "i8x16.shr_s" - OpcodeVecI8x16ShrUName = "i8x16.shr_u" - OpcodeVecI8x16AddName = "i8x16.add" - OpcodeVecI8x16AddSatSName = "i8x16.add_sat_s" - OpcodeVecI8x16AddSatUName = "i8x16.add_sat_u" - OpcodeVecI8x16SubName = "i8x16.sub" - OpcodeVecI8x16SubSatSName = "i8x16.sub_s" - OpcodeVecI8x16SubSatUName = "i8x16.sub_u" - OpcodeVecI8x16MinSName = "i8x16.min_s" - OpcodeVecI8x16MinUName = "i8x16.min_u" - OpcodeVecI8x16MaxSName = "i8x16.max_s" - OpcodeVecI8x16MaxUName = "i8x16.max_u" - OpcodeVecI8x16AvgrUName = "i8x16.avgr_u" - OpcodeVecI16x8ExtaddPairwiseI8x16SName = "i16x8.extadd_pairwise_i8x16_s" - OpcodeVecI16x8ExtaddPairwiseI8x16UName = "i16x8.extadd_pairwise_i8x16_u" - OpcodeVecI16x8AbsName = "i16x8.abs" - OpcodeVecI16x8NegName = "i16x8.neg" - OpcodeVecI16x8Q15mulrSatSName = "i16x8.q15mulr_sat_s" - OpcodeVecI16x8AllTrueName = "i16x8.all_true" - OpcodeVecI16x8BitMaskName = "i16x8.bitmask" - OpcodeVecI16x8NarrowI32x4SName = "i16x8.narrow_i32x4_s" - OpcodeVecI16x8NarrowI32x4UName = "i16x8.narrow_i32x4_u" - OpcodeVecI16x8ExtendLowI8x16SName = "i16x8.extend_low_i8x16_s" - OpcodeVecI16x8ExtendHighI8x16SName = "i16x8.extend_high_i8x16_s" - OpcodeVecI16x8ExtendLowI8x16UName = "i16x8.extend_low_i8x16_u" - OpcodeVecI16x8ExtendHighI8x16UName = "i16x8.extend_high_i8x16_u" - OpcodeVecI16x8ShlName = "i16x8.shl" - OpcodeVecI16x8ShrSName = "i16x8.shr_s" - OpcodeVecI16x8ShrUName = "i16x8.shr_u" - OpcodeVecI16x8AddName = "i16x8.add" - OpcodeVecI16x8AddSatSName = "i16x8.add_sat_s" - OpcodeVecI16x8AddSatUName = "i16x8.add_sat_u" - OpcodeVecI16x8SubName = "i16x8.sub" - OpcodeVecI16x8SubSatSName = "i16x8.sub_sat_s" - OpcodeVecI16x8SubSatUName = "i16x8.sub_sat_u" - OpcodeVecI16x8MulName = "i16x8.mul" - OpcodeVecI16x8MinSName = "i16x8.min_s" - OpcodeVecI16x8MinUName = "i16x8.min_u" - OpcodeVecI16x8MaxSName = "i16x8.max_s" - OpcodeVecI16x8MaxUName = "i16x8.max_u" - OpcodeVecI16x8AvgrUName = "i16x8.avgr_u" - OpcodeVecI16x8ExtMulLowI8x16SName = "i16x8.extmul_low_i8x16_s" - OpcodeVecI16x8ExtMulHighI8x16SName = "i16x8.extmul_high_i8x16_s" - OpcodeVecI16x8ExtMulLowI8x16UName = "i16x8.extmul_low_i8x16_u" - OpcodeVecI16x8ExtMulHighI8x16UName = "i16x8.extmul_high_i8x16_u" - OpcodeVecI32x4ExtaddPairwiseI16x8SName = "i32x4.extadd_pairwise_i16x8_s" - OpcodeVecI32x4ExtaddPairwiseI16x8UName = "i32x4.extadd_pairwise_i16x8_u" - OpcodeVecI32x4AbsName = "i32x4.abs" - OpcodeVecI32x4NegName = "i32x4.neg" - OpcodeVecI32x4AllTrueName = "i32x4.all_true" - OpcodeVecI32x4BitMaskName = "i32x4.bitmask" - OpcodeVecI32x4ExtendLowI16x8SName = "i32x4.extend_low_i16x8_s" - OpcodeVecI32x4ExtendHighI16x8SName = "i32x4.extend_high_i16x8_s" - OpcodeVecI32x4ExtendLowI16x8UName = "i32x4.extend_low_i16x8_u" - OpcodeVecI32x4ExtendHighI16x8UName = "i32x4.extend_high_i16x8_u" - OpcodeVecI32x4ShlName = "i32x4.shl" - OpcodeVecI32x4ShrSName = "i32x4.shr_s" - OpcodeVecI32x4ShrUName = "i32x4.shr_u" - OpcodeVecI32x4AddName = "i32x4.add" - OpcodeVecI32x4SubName = "i32x4.sub" - OpcodeVecI32x4MulName = "i32x4.mul" - OpcodeVecI32x4MinSName = "i32x4.min_s" - OpcodeVecI32x4MinUName = "i32x4.min_u" - OpcodeVecI32x4MaxSName = "i32x4.max_s" - OpcodeVecI32x4MaxUName = "i32x4.max_u" - OpcodeVecI32x4DotI16x8SName = "i32x4.dot_i16x8_s" - OpcodeVecI32x4ExtMulLowI16x8SName = "i32x4.extmul_low_i16x8_s" - OpcodeVecI32x4ExtMulHighI16x8SName = "i32x4.extmul_high_i16x8_s" - OpcodeVecI32x4ExtMulLowI16x8UName = "i32x4.extmul_low_i16x8_u" - OpcodeVecI32x4ExtMulHighI16x8UName = "i32x4.extmul_high_i16x8_u" - OpcodeVecI64x2AbsName = "i64x2.abs" - OpcodeVecI64x2NegName = "i64x2.neg" - OpcodeVecI64x2AllTrueName = "i64x2.all_true" - OpcodeVecI64x2BitMaskName = "i64x2.bitmask" - OpcodeVecI64x2ExtendLowI32x4SName = "i64x2.extend_low_i32x4_s" - OpcodeVecI64x2ExtendHighI32x4SName = "i64x2.extend_high_i32x4_s" - OpcodeVecI64x2ExtendLowI32x4UName = "i64x2.extend_low_i32x4_u" - OpcodeVecI64x2ExtendHighI32x4UName = "i64x2.extend_high_i32x4_u" - OpcodeVecI64x2ShlName = "i64x2.shl" - OpcodeVecI64x2ShrSName = "i64x2.shr_s" - OpcodeVecI64x2ShrUName = "i64x2.shr_u" - OpcodeVecI64x2AddName = "i64x2.add" - OpcodeVecI64x2SubName = "i64x2.sub" - OpcodeVecI64x2MulName = "i64x2.mul" - OpcodeVecI64x2ExtMulLowI32x4SName = "i64x2.extmul_low_i32x4_s" - OpcodeVecI64x2ExtMulHighI32x4SName = "i64x2.extmul_high_i32x4_s" - OpcodeVecI64x2ExtMulLowI32x4UName = "i64x2.extmul_low_i32x4_u" - OpcodeVecI64x2ExtMulHighI32x4UName = "i64x2.extmul_high_i32x4_u" - OpcodeVecF32x4CeilName = "f32x4.ceil" - OpcodeVecF32x4FloorName = "f32x4.floor" - OpcodeVecF32x4TruncName = "f32x4.trunc" - OpcodeVecF32x4NearestName = "f32x4.nearest" - OpcodeVecF32x4AbsName = "f32x4.abs" - OpcodeVecF32x4NegName = "f32x4.neg" - OpcodeVecF32x4SqrtName = "f32x4.sqrt" - OpcodeVecF32x4AddName = "f32x4.add" - OpcodeVecF32x4SubName = "f32x4.sub" - OpcodeVecF32x4MulName = "f32x4.mul" - OpcodeVecF32x4DivName = "f32x4.div" - OpcodeVecF32x4MinName = "f32x4.min" - OpcodeVecF32x4MaxName = "f32x4.max" - OpcodeVecF32x4PminName = "f32x4.pmin" - OpcodeVecF32x4PmaxName = "f32x4.pmax" - OpcodeVecF64x2CeilName = "f64x2.ceil" - OpcodeVecF64x2FloorName = "f64x2.floor" - OpcodeVecF64x2TruncName = "f64x2.trunc" - OpcodeVecF64x2NearestName = "f64x2.nearest" - OpcodeVecF64x2AbsName = "f64x2.abs" - OpcodeVecF64x2NegName = "f64x2.neg" - OpcodeVecF64x2SqrtName = "f64x2.sqrt" - OpcodeVecF64x2AddName = "f64x2.add" - OpcodeVecF64x2SubName = "f64x2.sub" - OpcodeVecF64x2MulName = "f64x2.mul" - OpcodeVecF64x2DivName = "f64x2.div" - OpcodeVecF64x2MinName = "f64x2.min" - OpcodeVecF64x2MaxName = "f64x2.max" - OpcodeVecF64x2PminName = "f64x2.pmin" - OpcodeVecF64x2PmaxName = "f64x2.pmax" - OpcodeVecI32x4TruncSatF32x4SName = "i32x4.trunc_sat_f32x4_s" - OpcodeVecI32x4TruncSatF32x4UName = "i32x4.trunc_sat_f32x4_u" - OpcodeVecF32x4ConvertI32x4SName = "f32x4.convert_i32x4_s" - OpcodeVecF32x4ConvertI32x4UName = "f32x4.convert_i32x4_u" - OpcodeVecI32x4TruncSatF64x2SZeroName = "i32x4.trunc_sat_f64x2_s_zero" - OpcodeVecI32x4TruncSatF64x2UZeroName = "i32x4.trunc_sat_f64x2_u_zero" - OpcodeVecF64x2ConvertLowI32x4SName = "f64x2.convert_low_i32x4_s" - OpcodeVecF64x2ConvertLowI32x4UName = "f64x2.convert_low_i32x4_u" - OpcodeVecF32x4DemoteF64x2ZeroName = "f32x4.demote_f64x2_zero" - OpcodeVecF64x2PromoteLowF32x4ZeroName = "f64x2.promote_low_f32x4" -) - -var vectorInstructionName = map[OpcodeVec]string{ - OpcodeVecV128Load: OpcodeVecV128LoadName, - OpcodeVecV128Load8x8s: OpcodeVecV128Load8x8SName, - OpcodeVecV128Load8x8u: OpcodeVecV128Load8x8UName, - OpcodeVecV128Load16x4s: OpcodeVecV128Load16x4SName, - OpcodeVecV128Load16x4u: OpcodeVecV128Load16x4UName, - OpcodeVecV128Load32x2s: OpcodeVecV128Load32x2SName, - OpcodeVecV128Load32x2u: OpcodeVecV128Load32x2UName, - OpcodeVecV128Load8Splat: OpcodeVecV128Load8SplatName, - OpcodeVecV128Load16Splat: OpcodeVecV128Load16SplatName, - OpcodeVecV128Load32Splat: OpcodeVecV128Load32SplatName, - OpcodeVecV128Load64Splat: OpcodeVecV128Load64SplatName, - OpcodeVecV128Load32zero: OpcodeVecV128Load32zeroName, - OpcodeVecV128Load64zero: OpcodeVecV128Load64zeroName, - OpcodeVecV128Store: OpcodeVecV128StoreName, - OpcodeVecV128Load8Lane: OpcodeVecV128Load8LaneName, - OpcodeVecV128Load16Lane: OpcodeVecV128Load16LaneName, - OpcodeVecV128Load32Lane: OpcodeVecV128Load32LaneName, - OpcodeVecV128Load64Lane: OpcodeVecV128Load64LaneName, - OpcodeVecV128Store8Lane: OpcodeVecV128Store8LaneName, - OpcodeVecV128Store16Lane: OpcodeVecV128Store16LaneName, - OpcodeVecV128Store32Lane: OpcodeVecV128Store32LaneName, - OpcodeVecV128Store64Lane: OpcodeVecV128Store64LaneName, - OpcodeVecV128Const: OpcodeVecV128ConstName, - OpcodeVecV128i8x16Shuffle: OpcodeVecV128i8x16ShuffleName, - OpcodeVecI8x16ExtractLaneS: OpcodeVecI8x16ExtractLaneSName, - OpcodeVecI8x16ExtractLaneU: OpcodeVecI8x16ExtractLaneUName, - OpcodeVecI8x16ReplaceLane: OpcodeVecI8x16ReplaceLaneName, - OpcodeVecI16x8ExtractLaneS: OpcodeVecI16x8ExtractLaneSName, - OpcodeVecI16x8ExtractLaneU: OpcodeVecI16x8ExtractLaneUName, - OpcodeVecI16x8ReplaceLane: OpcodeVecI16x8ReplaceLaneName, - OpcodeVecI32x4ExtractLane: OpcodeVecI32x4ExtractLaneName, - OpcodeVecI32x4ReplaceLane: OpcodeVecI32x4ReplaceLaneName, - OpcodeVecI64x2ExtractLane: OpcodeVecI64x2ExtractLaneName, - OpcodeVecI64x2ReplaceLane: OpcodeVecI64x2ReplaceLaneName, - OpcodeVecF32x4ExtractLane: OpcodeVecF32x4ExtractLaneName, - OpcodeVecF32x4ReplaceLane: OpcodeVecF32x4ReplaceLaneName, - OpcodeVecF64x2ExtractLane: OpcodeVecF64x2ExtractLaneName, - OpcodeVecF64x2ReplaceLane: OpcodeVecF64x2ReplaceLaneName, - OpcodeVecI8x16Swizzle: OpcodeVecI8x16SwizzleName, - OpcodeVecI8x16Splat: OpcodeVecI8x16SplatName, - OpcodeVecI16x8Splat: OpcodeVecI16x8SplatName, - OpcodeVecI32x4Splat: OpcodeVecI32x4SplatName, - OpcodeVecI64x2Splat: OpcodeVecI64x2SplatName, - OpcodeVecF32x4Splat: OpcodeVecF32x4SplatName, - OpcodeVecF64x2Splat: OpcodeVecF64x2SplatName, - OpcodeVecI8x16Eq: OpcodeVecI8x16EqName, - OpcodeVecI8x16Ne: OpcodeVecI8x16NeName, - OpcodeVecI8x16LtS: OpcodeVecI8x16LtSName, - OpcodeVecI8x16LtU: OpcodeVecI8x16LtUName, - OpcodeVecI8x16GtS: OpcodeVecI8x16GtSName, - OpcodeVecI8x16GtU: OpcodeVecI8x16GtUName, - OpcodeVecI8x16LeS: OpcodeVecI8x16LeSName, - OpcodeVecI8x16LeU: OpcodeVecI8x16LeUName, - OpcodeVecI8x16GeS: OpcodeVecI8x16GeSName, - OpcodeVecI8x16GeU: OpcodeVecI8x16GeUName, - OpcodeVecI16x8Eq: OpcodeVecI16x8EqName, - OpcodeVecI16x8Ne: OpcodeVecI16x8NeName, - OpcodeVecI16x8LtS: OpcodeVecI16x8LtSName, - OpcodeVecI16x8LtU: OpcodeVecI16x8LtUName, - OpcodeVecI16x8GtS: OpcodeVecI16x8GtSName, - OpcodeVecI16x8GtU: OpcodeVecI16x8GtUName, - OpcodeVecI16x8LeS: OpcodeVecI16x8LeSName, - OpcodeVecI16x8LeU: OpcodeVecI16x8LeUName, - OpcodeVecI16x8GeS: OpcodeVecI16x8GeSName, - OpcodeVecI16x8GeU: OpcodeVecI16x8GeUName, - OpcodeVecI32x4Eq: OpcodeVecI32x4EqName, - OpcodeVecI32x4Ne: OpcodeVecI32x4NeName, - OpcodeVecI32x4LtS: OpcodeVecI32x4LtSName, - OpcodeVecI32x4LtU: OpcodeVecI32x4LtUName, - OpcodeVecI32x4GtS: OpcodeVecI32x4GtSName, - OpcodeVecI32x4GtU: OpcodeVecI32x4GtUName, - OpcodeVecI32x4LeS: OpcodeVecI32x4LeSName, - OpcodeVecI32x4LeU: OpcodeVecI32x4LeUName, - OpcodeVecI32x4GeS: OpcodeVecI32x4GeSName, - OpcodeVecI32x4GeU: OpcodeVecI32x4GeUName, - OpcodeVecI64x2Eq: OpcodeVecI64x2EqName, - OpcodeVecI64x2Ne: OpcodeVecI64x2NeName, - OpcodeVecI64x2LtS: OpcodeVecI64x2LtSName, - OpcodeVecI64x2GtS: OpcodeVecI64x2GtSName, - OpcodeVecI64x2LeS: OpcodeVecI64x2LeSName, - OpcodeVecI64x2GeS: OpcodeVecI64x2GeSName, - OpcodeVecF32x4Eq: OpcodeVecF32x4EqName, - OpcodeVecF32x4Ne: OpcodeVecF32x4NeName, - OpcodeVecF32x4Lt: OpcodeVecF32x4LtName, - OpcodeVecF32x4Gt: OpcodeVecF32x4GtName, - OpcodeVecF32x4Le: OpcodeVecF32x4LeName, - OpcodeVecF32x4Ge: OpcodeVecF32x4GeName, - OpcodeVecF64x2Eq: OpcodeVecF64x2EqName, - OpcodeVecF64x2Ne: OpcodeVecF64x2NeName, - OpcodeVecF64x2Lt: OpcodeVecF64x2LtName, - OpcodeVecF64x2Gt: OpcodeVecF64x2GtName, - OpcodeVecF64x2Le: OpcodeVecF64x2LeName, - OpcodeVecF64x2Ge: OpcodeVecF64x2GeName, - OpcodeVecV128Not: OpcodeVecV128NotName, - OpcodeVecV128And: OpcodeVecV128AndName, - OpcodeVecV128AndNot: OpcodeVecV128AndNotName, - OpcodeVecV128Or: OpcodeVecV128OrName, - OpcodeVecV128Xor: OpcodeVecV128XorName, - OpcodeVecV128Bitselect: OpcodeVecV128BitselectName, - OpcodeVecV128AnyTrue: OpcodeVecV128AnyTrueName, - OpcodeVecI8x16Abs: OpcodeVecI8x16AbsName, - OpcodeVecI8x16Neg: OpcodeVecI8x16NegName, - OpcodeVecI8x16Popcnt: OpcodeVecI8x16PopcntName, - OpcodeVecI8x16AllTrue: OpcodeVecI8x16AllTrueName, - OpcodeVecI8x16BitMask: OpcodeVecI8x16BitMaskName, - OpcodeVecI8x16NarrowI16x8S: OpcodeVecI8x16NarrowI16x8SName, - OpcodeVecI8x16NarrowI16x8U: OpcodeVecI8x16NarrowI16x8UName, - OpcodeVecI8x16Shl: OpcodeVecI8x16ShlName, - OpcodeVecI8x16ShrS: OpcodeVecI8x16ShrSName, - OpcodeVecI8x16ShrU: OpcodeVecI8x16ShrUName, - OpcodeVecI8x16Add: OpcodeVecI8x16AddName, - OpcodeVecI8x16AddSatS: OpcodeVecI8x16AddSatSName, - OpcodeVecI8x16AddSatU: OpcodeVecI8x16AddSatUName, - OpcodeVecI8x16Sub: OpcodeVecI8x16SubName, - OpcodeVecI8x16SubSatS: OpcodeVecI8x16SubSatSName, - OpcodeVecI8x16SubSatU: OpcodeVecI8x16SubSatUName, - OpcodeVecI8x16MinS: OpcodeVecI8x16MinSName, - OpcodeVecI8x16MinU: OpcodeVecI8x16MinUName, - OpcodeVecI8x16MaxS: OpcodeVecI8x16MaxSName, - OpcodeVecI8x16MaxU: OpcodeVecI8x16MaxUName, - OpcodeVecI8x16AvgrU: OpcodeVecI8x16AvgrUName, - OpcodeVecI16x8ExtaddPairwiseI8x16S: OpcodeVecI16x8ExtaddPairwiseI8x16SName, - OpcodeVecI16x8ExtaddPairwiseI8x16U: OpcodeVecI16x8ExtaddPairwiseI8x16UName, - OpcodeVecI16x8Abs: OpcodeVecI16x8AbsName, - OpcodeVecI16x8Neg: OpcodeVecI16x8NegName, - OpcodeVecI16x8Q15mulrSatS: OpcodeVecI16x8Q15mulrSatSName, - OpcodeVecI16x8AllTrue: OpcodeVecI16x8AllTrueName, - OpcodeVecI16x8BitMask: OpcodeVecI16x8BitMaskName, - OpcodeVecI16x8NarrowI32x4S: OpcodeVecI16x8NarrowI32x4SName, - OpcodeVecI16x8NarrowI32x4U: OpcodeVecI16x8NarrowI32x4UName, - OpcodeVecI16x8ExtendLowI8x16S: OpcodeVecI16x8ExtendLowI8x16SName, - OpcodeVecI16x8ExtendHighI8x16S: OpcodeVecI16x8ExtendHighI8x16SName, - OpcodeVecI16x8ExtendLowI8x16U: OpcodeVecI16x8ExtendLowI8x16UName, - OpcodeVecI16x8ExtendHighI8x16U: OpcodeVecI16x8ExtendHighI8x16UName, - OpcodeVecI16x8Shl: OpcodeVecI16x8ShlName, - OpcodeVecI16x8ShrS: OpcodeVecI16x8ShrSName, - OpcodeVecI16x8ShrU: OpcodeVecI16x8ShrUName, - OpcodeVecI16x8Add: OpcodeVecI16x8AddName, - OpcodeVecI16x8AddSatS: OpcodeVecI16x8AddSatSName, - OpcodeVecI16x8AddSatU: OpcodeVecI16x8AddSatUName, - OpcodeVecI16x8Sub: OpcodeVecI16x8SubName, - OpcodeVecI16x8SubSatS: OpcodeVecI16x8SubSatSName, - OpcodeVecI16x8SubSatU: OpcodeVecI16x8SubSatUName, - OpcodeVecI16x8Mul: OpcodeVecI16x8MulName, - OpcodeVecI16x8MinS: OpcodeVecI16x8MinSName, - OpcodeVecI16x8MinU: OpcodeVecI16x8MinUName, - OpcodeVecI16x8MaxS: OpcodeVecI16x8MaxSName, - OpcodeVecI16x8MaxU: OpcodeVecI16x8MaxUName, - OpcodeVecI16x8AvgrU: OpcodeVecI16x8AvgrUName, - OpcodeVecI16x8ExtMulLowI8x16S: OpcodeVecI16x8ExtMulLowI8x16SName, - OpcodeVecI16x8ExtMulHighI8x16S: OpcodeVecI16x8ExtMulHighI8x16SName, - OpcodeVecI16x8ExtMulLowI8x16U: OpcodeVecI16x8ExtMulLowI8x16UName, - OpcodeVecI16x8ExtMulHighI8x16U: OpcodeVecI16x8ExtMulHighI8x16UName, - OpcodeVecI32x4ExtaddPairwiseI16x8S: OpcodeVecI32x4ExtaddPairwiseI16x8SName, - OpcodeVecI32x4ExtaddPairwiseI16x8U: OpcodeVecI32x4ExtaddPairwiseI16x8UName, - OpcodeVecI32x4Abs: OpcodeVecI32x4AbsName, - OpcodeVecI32x4Neg: OpcodeVecI32x4NegName, - OpcodeVecI32x4AllTrue: OpcodeVecI32x4AllTrueName, - OpcodeVecI32x4BitMask: OpcodeVecI32x4BitMaskName, - OpcodeVecI32x4ExtendLowI16x8S: OpcodeVecI32x4ExtendLowI16x8SName, - OpcodeVecI32x4ExtendHighI16x8S: OpcodeVecI32x4ExtendHighI16x8SName, - OpcodeVecI32x4ExtendLowI16x8U: OpcodeVecI32x4ExtendLowI16x8UName, - OpcodeVecI32x4ExtendHighI16x8U: OpcodeVecI32x4ExtendHighI16x8UName, - OpcodeVecI32x4Shl: OpcodeVecI32x4ShlName, - OpcodeVecI32x4ShrS: OpcodeVecI32x4ShrSName, - OpcodeVecI32x4ShrU: OpcodeVecI32x4ShrUName, - OpcodeVecI32x4Add: OpcodeVecI32x4AddName, - OpcodeVecI32x4Sub: OpcodeVecI32x4SubName, - OpcodeVecI32x4Mul: OpcodeVecI32x4MulName, - OpcodeVecI32x4MinS: OpcodeVecI32x4MinSName, - OpcodeVecI32x4MinU: OpcodeVecI32x4MinUName, - OpcodeVecI32x4MaxS: OpcodeVecI32x4MaxSName, - OpcodeVecI32x4MaxU: OpcodeVecI32x4MaxUName, - OpcodeVecI32x4DotI16x8S: OpcodeVecI32x4DotI16x8SName, - OpcodeVecI32x4ExtMulLowI16x8S: OpcodeVecI32x4ExtMulLowI16x8SName, - OpcodeVecI32x4ExtMulHighI16x8S: OpcodeVecI32x4ExtMulHighI16x8SName, - OpcodeVecI32x4ExtMulLowI16x8U: OpcodeVecI32x4ExtMulLowI16x8UName, - OpcodeVecI32x4ExtMulHighI16x8U: OpcodeVecI32x4ExtMulHighI16x8UName, - OpcodeVecI64x2Abs: OpcodeVecI64x2AbsName, - OpcodeVecI64x2Neg: OpcodeVecI64x2NegName, - OpcodeVecI64x2AllTrue: OpcodeVecI64x2AllTrueName, - OpcodeVecI64x2BitMask: OpcodeVecI64x2BitMaskName, - OpcodeVecI64x2ExtendLowI32x4S: OpcodeVecI64x2ExtendLowI32x4SName, - OpcodeVecI64x2ExtendHighI32x4S: OpcodeVecI64x2ExtendHighI32x4SName, - OpcodeVecI64x2ExtendLowI32x4U: OpcodeVecI64x2ExtendLowI32x4UName, - OpcodeVecI64x2ExtendHighI32x4U: OpcodeVecI64x2ExtendHighI32x4UName, - OpcodeVecI64x2Shl: OpcodeVecI64x2ShlName, - OpcodeVecI64x2ShrS: OpcodeVecI64x2ShrSName, - OpcodeVecI64x2ShrU: OpcodeVecI64x2ShrUName, - OpcodeVecI64x2Add: OpcodeVecI64x2AddName, - OpcodeVecI64x2Sub: OpcodeVecI64x2SubName, - OpcodeVecI64x2Mul: OpcodeVecI64x2MulName, - OpcodeVecI64x2ExtMulLowI32x4S: OpcodeVecI64x2ExtMulLowI32x4SName, - OpcodeVecI64x2ExtMulHighI32x4S: OpcodeVecI64x2ExtMulHighI32x4SName, - OpcodeVecI64x2ExtMulLowI32x4U: OpcodeVecI64x2ExtMulLowI32x4UName, - OpcodeVecI64x2ExtMulHighI32x4U: OpcodeVecI64x2ExtMulHighI32x4UName, - OpcodeVecF32x4Ceil: OpcodeVecF32x4CeilName, - OpcodeVecF32x4Floor: OpcodeVecF32x4FloorName, - OpcodeVecF32x4Trunc: OpcodeVecF32x4TruncName, - OpcodeVecF32x4Nearest: OpcodeVecF32x4NearestName, - OpcodeVecF32x4Abs: OpcodeVecF32x4AbsName, - OpcodeVecF32x4Neg: OpcodeVecF32x4NegName, - OpcodeVecF32x4Sqrt: OpcodeVecF32x4SqrtName, - OpcodeVecF32x4Add: OpcodeVecF32x4AddName, - OpcodeVecF32x4Sub: OpcodeVecF32x4SubName, - OpcodeVecF32x4Mul: OpcodeVecF32x4MulName, - OpcodeVecF32x4Div: OpcodeVecF32x4DivName, - OpcodeVecF32x4Min: OpcodeVecF32x4MinName, - OpcodeVecF32x4Max: OpcodeVecF32x4MaxName, - OpcodeVecF32x4Pmin: OpcodeVecF32x4PminName, - OpcodeVecF32x4Pmax: OpcodeVecF32x4PmaxName, - OpcodeVecF64x2Ceil: OpcodeVecF64x2CeilName, - OpcodeVecF64x2Floor: OpcodeVecF64x2FloorName, - OpcodeVecF64x2Trunc: OpcodeVecF64x2TruncName, - OpcodeVecF64x2Nearest: OpcodeVecF64x2NearestName, - OpcodeVecF64x2Abs: OpcodeVecF64x2AbsName, - OpcodeVecF64x2Neg: OpcodeVecF64x2NegName, - OpcodeVecF64x2Sqrt: OpcodeVecF64x2SqrtName, - OpcodeVecF64x2Add: OpcodeVecF64x2AddName, - OpcodeVecF64x2Sub: OpcodeVecF64x2SubName, - OpcodeVecF64x2Mul: OpcodeVecF64x2MulName, - OpcodeVecF64x2Div: OpcodeVecF64x2DivName, - OpcodeVecF64x2Min: OpcodeVecF64x2MinName, - OpcodeVecF64x2Max: OpcodeVecF64x2MaxName, - OpcodeVecF64x2Pmin: OpcodeVecF64x2PminName, - OpcodeVecF64x2Pmax: OpcodeVecF64x2PmaxName, - OpcodeVecI32x4TruncSatF32x4S: OpcodeVecI32x4TruncSatF32x4SName, - OpcodeVecI32x4TruncSatF32x4U: OpcodeVecI32x4TruncSatF32x4UName, - OpcodeVecF32x4ConvertI32x4S: OpcodeVecF32x4ConvertI32x4SName, - OpcodeVecF32x4ConvertI32x4U: OpcodeVecF32x4ConvertI32x4UName, - OpcodeVecI32x4TruncSatF64x2SZero: OpcodeVecI32x4TruncSatF64x2SZeroName, - OpcodeVecI32x4TruncSatF64x2UZero: OpcodeVecI32x4TruncSatF64x2UZeroName, - OpcodeVecF64x2ConvertLowI32x4S: OpcodeVecF64x2ConvertLowI32x4SName, - OpcodeVecF64x2ConvertLowI32x4U: OpcodeVecF64x2ConvertLowI32x4UName, - OpcodeVecF32x4DemoteF64x2Zero: OpcodeVecF32x4DemoteF64x2ZeroName, - OpcodeVecF64x2PromoteLowF32x4Zero: OpcodeVecF64x2PromoteLowF32x4ZeroName, -} - -// VectorInstructionName returns the instruction name corresponding to the vector Opcode. -func VectorInstructionName(oc OpcodeVec) (ret string) { - return vectorInstructionName[oc] -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go deleted file mode 100644 index e2d994f9cd..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/memory.go +++ /dev/null @@ -1,286 +0,0 @@ -package wasm - -import ( - "encoding/binary" - "fmt" - "math" - "reflect" - "sync" - "unsafe" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/internalapi" -) - -const ( - // MemoryPageSize is the unit of memory length in WebAssembly, - // and is defined as 2^16 = 65536. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instances%E2%91%A0 - MemoryPageSize = uint32(65536) - // MemoryLimitPages is maximum number of pages defined (2^16). - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#grow-mem - MemoryLimitPages = uint32(65536) - // MemoryPageSizeInBits satisfies the relation: "1 << MemoryPageSizeInBits == MemoryPageSize". - MemoryPageSizeInBits = 16 -) - -// compile-time check to ensure MemoryInstance implements api.Memory -var _ api.Memory = &MemoryInstance{} - -// MemoryInstance represents a memory instance in a store, and implements api.Memory. -// -// Note: In WebAssembly 1.0 (20191205), there may be up to one Memory per store, which means the precise memory is always -// wasm.Store Memories index zero: `store.Memories[0]` -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instances%E2%91%A0. -type MemoryInstance struct { - internalapi.WazeroOnlyType - - Buffer []byte - Min, Cap, Max uint32 - // mux is used to prevent overlapping calls to Grow. - mux sync.RWMutex - // definition is known at compile time. - definition api.MemoryDefinition -} - -// NewMemoryInstance creates a new instance based on the parameters in the SectionIDMemory. -func NewMemoryInstance(memSec *Memory) *MemoryInstance { - min := MemoryPagesToBytesNum(memSec.Min) - capacity := MemoryPagesToBytesNum(memSec.Cap) - return &MemoryInstance{ - Buffer: make([]byte, min, capacity), - Min: memSec.Min, - Cap: memSec.Cap, - Max: memSec.Max, - } -} - -// Definition implements the same method as documented on api.Memory. -func (m *MemoryInstance) Definition() api.MemoryDefinition { - return m.definition -} - -// Size implements the same method as documented on api.Memory. -func (m *MemoryInstance) Size() uint32 { - return m.size() -} - -// ReadByte implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadByte(offset uint32) (byte, bool) { - if offset >= m.size() { - return 0, false - } - return m.Buffer[offset], true -} - -// ReadUint16Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadUint16Le(offset uint32) (uint16, bool) { - if !m.hasSize(offset, 2) { - return 0, false - } - return binary.LittleEndian.Uint16(m.Buffer[offset : offset+2]), true -} - -// ReadUint32Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadUint32Le(offset uint32) (uint32, bool) { - return m.readUint32Le(offset) -} - -// ReadFloat32Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadFloat32Le(offset uint32) (float32, bool) { - v, ok := m.readUint32Le(offset) - if !ok { - return 0, false - } - return math.Float32frombits(v), true -} - -// ReadUint64Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadUint64Le(offset uint32) (uint64, bool) { - return m.readUint64Le(offset) -} - -// ReadFloat64Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) ReadFloat64Le(offset uint32) (float64, bool) { - v, ok := m.readUint64Le(offset) - if !ok { - return 0, false - } - return math.Float64frombits(v), true -} - -// Read implements the same method as documented on api.Memory. -func (m *MemoryInstance) Read(offset, byteCount uint32) ([]byte, bool) { - if !m.hasSize(offset, uint64(byteCount)) { - return nil, false - } - return m.Buffer[offset : offset+byteCount : offset+byteCount], true -} - -// WriteByte implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteByte(offset uint32, v byte) bool { - if offset >= m.size() { - return false - } - m.Buffer[offset] = v - return true -} - -// WriteUint16Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteUint16Le(offset uint32, v uint16) bool { - if !m.hasSize(offset, 2) { - return false - } - binary.LittleEndian.PutUint16(m.Buffer[offset:], v) - return true -} - -// WriteUint32Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteUint32Le(offset, v uint32) bool { - return m.writeUint32Le(offset, v) -} - -// WriteFloat32Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteFloat32Le(offset uint32, v float32) bool { - return m.writeUint32Le(offset, math.Float32bits(v)) -} - -// WriteUint64Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteUint64Le(offset uint32, v uint64) bool { - return m.writeUint64Le(offset, v) -} - -// WriteFloat64Le implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteFloat64Le(offset uint32, v float64) bool { - return m.writeUint64Le(offset, math.Float64bits(v)) -} - -// Write implements the same method as documented on api.Memory. -func (m *MemoryInstance) Write(offset uint32, val []byte) bool { - if !m.hasSize(offset, uint64(len(val))) { - return false - } - copy(m.Buffer[offset:], val) - return true -} - -// WriteString implements the same method as documented on api.Memory. -func (m *MemoryInstance) WriteString(offset uint32, val string) bool { - if !m.hasSize(offset, uint64(len(val))) { - return false - } - copy(m.Buffer[offset:], val) - return true -} - -// MemoryPagesToBytesNum converts the given pages into the number of bytes contained in these pages. -func MemoryPagesToBytesNum(pages uint32) (bytesNum uint64) { - return uint64(pages) << MemoryPageSizeInBits -} - -// Grow implements the same method as documented on api.Memory. -func (m *MemoryInstance) Grow(delta uint32) (result uint32, ok bool) { - // We take write-lock here as the following might result in a new slice - m.mux.Lock() - defer m.mux.Unlock() - - currentPages := memoryBytesNumToPages(uint64(len(m.Buffer))) - if delta == 0 { - return currentPages, true - } - - // If exceeds the max of memory size, we push -1 according to the spec. - newPages := currentPages + delta - if newPages > m.Max { - return 0, false - } else if newPages > m.Cap { // grow the memory. - m.Buffer = append(m.Buffer, make([]byte, MemoryPagesToBytesNum(delta))...) - m.Cap = newPages - return currentPages, true - } else { // We already have the capacity we need. - sp := (*reflect.SliceHeader)(unsafe.Pointer(&m.Buffer)) - sp.Len = int(MemoryPagesToBytesNum(newPages)) - return currentPages, true - } -} - -// PageSize returns the current memory buffer size in pages. -func (m *MemoryInstance) PageSize() (result uint32) { - return memoryBytesNumToPages(uint64(len(m.Buffer))) -} - -// PagesToUnitOfBytes converts the pages to a human-readable form similar to what's specified. e.g. 1 -> "64Ki" -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instances%E2%91%A0 -func PagesToUnitOfBytes(pages uint32) string { - k := pages * 64 - if k < 1024 { - return fmt.Sprintf("%d Ki", k) - } - m := k / 1024 - if m < 1024 { - return fmt.Sprintf("%d Mi", m) - } - g := m / 1024 - if g < 1024 { - return fmt.Sprintf("%d Gi", g) - } - return fmt.Sprintf("%d Ti", g/1024) -} - -// Below are raw functions used to implement the api.Memory API: - -// memoryBytesNumToPages converts the given number of bytes into the number of pages. -func memoryBytesNumToPages(bytesNum uint64) (pages uint32) { - return uint32(bytesNum >> MemoryPageSizeInBits) -} - -// size returns the size in bytes of the buffer. -func (m *MemoryInstance) size() uint32 { - return uint32(len(m.Buffer)) // We don't lock here because size can't become smaller. -} - -// hasSize returns true if Len is sufficient for byteCount at the given offset. -// -// Note: This is always fine, because memory can grow, but never shrink. -func (m *MemoryInstance) hasSize(offset uint32, byteCount uint64) bool { - return uint64(offset)+byteCount <= uint64(len(m.Buffer)) // uint64 prevents overflow on add -} - -// readUint32Le implements ReadUint32Le without using a context. This is extracted as both ints and floats are stored in -// memory as uint32le. -func (m *MemoryInstance) readUint32Le(offset uint32) (uint32, bool) { - if !m.hasSize(offset, 4) { - return 0, false - } - return binary.LittleEndian.Uint32(m.Buffer[offset : offset+4]), true -} - -// readUint64Le implements ReadUint64Le without using a context. This is extracted as both ints and floats are stored in -// memory as uint64le. -func (m *MemoryInstance) readUint64Le(offset uint32) (uint64, bool) { - if !m.hasSize(offset, 8) { - return 0, false - } - return binary.LittleEndian.Uint64(m.Buffer[offset : offset+8]), true -} - -// writeUint32Le implements WriteUint32Le without using a context. This is extracted as both ints and floats are stored -// in memory as uint32le. -func (m *MemoryInstance) writeUint32Le(offset uint32, v uint32) bool { - if !m.hasSize(offset, 4) { - return false - } - binary.LittleEndian.PutUint32(m.Buffer[offset:], v) - return true -} - -// writeUint64Le implements WriteUint64Le without using a context. This is extracted as both ints and floats are stored -// in memory as uint64le. -func (m *MemoryInstance) writeUint64Le(offset uint32, v uint64) bool { - if !m.hasSize(offset, 8) { - return false - } - binary.LittleEndian.PutUint64(m.Buffer[offset:], v) - return true -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go deleted file mode 100644 index 03d6fd3030..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/memory_definition.go +++ /dev/null @@ -1,128 +0,0 @@ -package wasm - -import ( - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/internalapi" -) - -// ImportedMemories implements the same method as documented on wazero.CompiledModule. -func (m *Module) ImportedMemories() (ret []api.MemoryDefinition) { - for i := range m.MemoryDefinitionSection { - d := &m.MemoryDefinitionSection[i] - if d.importDesc != nil { - ret = append(ret, d) - } - } - return -} - -// ExportedMemories implements the same method as documented on wazero.CompiledModule. -func (m *Module) ExportedMemories() map[string]api.MemoryDefinition { - ret := map[string]api.MemoryDefinition{} - for i := range m.MemoryDefinitionSection { - d := &m.MemoryDefinitionSection[i] - for _, e := range d.exportNames { - ret[e] = d - } - } - return ret -} - -// BuildMemoryDefinitions generates memory metadata that can be parsed from -// the module. This must be called after all validation. -// -// Note: This is exported for wazero.Runtime `CompileModule`. -func (m *Module) BuildMemoryDefinitions() { - var moduleName string - if m.NameSection != nil { - moduleName = m.NameSection.ModuleName - } - - memoryCount := m.ImportMemoryCount - if m.MemorySection != nil { - memoryCount++ - } - - if memoryCount == 0 { - return - } - - m.MemoryDefinitionSection = make([]MemoryDefinition, 0, memoryCount) - importMemIdx := Index(0) - for i := range m.ImportSection { - imp := &m.ImportSection[i] - if imp.Type != ExternTypeMemory { - continue - } - - m.MemoryDefinitionSection = append(m.MemoryDefinitionSection, MemoryDefinition{ - importDesc: &[2]string{imp.Module, imp.Name}, - index: importMemIdx, - memory: imp.DescMem, - }) - importMemIdx++ - } - - if m.MemorySection != nil { - m.MemoryDefinitionSection = append(m.MemoryDefinitionSection, MemoryDefinition{ - index: importMemIdx, - memory: m.MemorySection, - }) - } - - for i := range m.MemoryDefinitionSection { - d := &m.MemoryDefinitionSection[i] - d.moduleName = moduleName - for i := range m.ExportSection { - e := &m.ExportSection[i] - if e.Type == ExternTypeMemory && e.Index == d.index { - d.exportNames = append(d.exportNames, e.Name) - } - } - } -} - -// MemoryDefinition implements api.MemoryDefinition -type MemoryDefinition struct { - internalapi.WazeroOnlyType - moduleName string - index Index - importDesc *[2]string - exportNames []string - memory *Memory -} - -// ModuleName implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) ModuleName() string { - return f.moduleName -} - -// Index implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) Index() uint32 { - return f.index -} - -// Import implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) Import() (moduleName, name string, isImport bool) { - if importDesc := f.importDesc; importDesc != nil { - moduleName, name, isImport = importDesc[0], importDesc[1], true - } - return -} - -// ExportNames implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) ExportNames() []string { - return f.exportNames -} - -// Min implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) Min() uint32 { - return f.memory.Min -} - -// Max implements the same method as documented on api.MemoryDefinition. -func (f *MemoryDefinition) Max() (max uint32, encoded bool) { - max = f.memory.Max - encoded = f.memory.IsMaxEncoded - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/module.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/module.go deleted file mode 100644 index ba2c032ac2..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/module.go +++ /dev/null @@ -1,1060 +0,0 @@ -package wasm - -import ( - "bytes" - "crypto/sha256" - "errors" - "fmt" - "io" - "sort" - "strings" - "sync" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/ieee754" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasmdebug" -) - -// Module is a WebAssembly binary representation. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#modules%E2%91%A8 -// -// Differences from the specification: -// * NameSection is the only key ("name") decoded from the SectionIDCustom. -// * ExportSection is represented as a map for lookup convenience. -// * Code.GoFunc is contains any go `func`. It may be present when Code.Body is not. -type Module struct { - // TypeSection contains the unique FunctionType of functions imported or defined in this module. - // - // Note: Currently, there is no type ambiguity in the index as WebAssembly 1.0 only defines function type. - // In the future, other types may be introduced to support CoreFeatures such as module linking. - // - // Note: In the Binary Format, this is SectionIDType. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#types%E2%91%A0%E2%91%A0 - TypeSection []FunctionType - - // ImportSection contains imported functions, tables, memories or globals required for instantiation - // (Store.Instantiate). - // - // Note: there are no unique constraints relating to the two-level namespace of Import.Module and Import.Name. - // - // Note: In the Binary Format, this is SectionIDImport. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#import-section%E2%91%A0 - ImportSection []Import - // ImportFunctionCount ImportGlobalCount ImportMemoryCount, and ImportTableCount are - // the cached import count per ExternType set during decoding. - ImportFunctionCount, - ImportGlobalCount, - ImportMemoryCount, - ImportTableCount Index - // ImportPerModule maps a module name to the list of Import to be imported from the module. - // This is used to do fast import resolution during instantiation. - ImportPerModule map[string][]*Import - - // FunctionSection contains the index in TypeSection of each function defined in this module. - // - // Note: The function Index space begins with imported functions and ends with those defined in this module. - // For example, if there are two imported functions and one defined in this module, the function Index 3 is defined - // in this module at FunctionSection[0]. - // - // Note: FunctionSection is index correlated with the CodeSection. If given the same position, e.g. 2, a function - // type is at TypeSection[FunctionSection[2]], while its locals and body are at CodeSection[2]. - // - // Note: In the Binary Format, this is SectionIDFunction. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#function-section%E2%91%A0 - FunctionSection []Index - - // TableSection contains each table defined in this module. - // - // Note: The table Index space begins with imported tables and ends with those defined in this module. - // For example, if there are two imported tables and one defined in this module, the table Index 3 is defined in - // this module at TableSection[0]. - // - // Note: Version 1.0 (20191205) of the WebAssembly spec allows at most one table definition per module, so the - // length of the TableSection can be zero or one, and can only be one if there is no imported table. - // - // Note: In the Binary Format, this is SectionIDTable. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#table-section%E2%91%A0 - TableSection []Table - - // MemorySection contains each memory defined in this module. - // - // Note: The memory Index space begins with imported memories and ends with those defined in this module. - // For example, if there are two imported memories and one defined in this module, the memory Index 3 is defined in - // this module at TableSection[0]. - // - // Note: Version 1.0 (20191205) of the WebAssembly spec allows at most one memory definition per module, so the - // length of the MemorySection can be zero or one, and can only be one if there is no imported memory. - // - // Note: In the Binary Format, this is SectionIDMemory. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-section%E2%91%A0 - MemorySection *Memory - - // GlobalSection contains each global defined in this module. - // - // Global indexes are offset by any imported globals because the global index begins with imports, followed by - // ones defined in this module. For example, if there are two imported globals and three defined in this module, the - // global at index 3 is defined in this module at GlobalSection[0]. - // - // Note: In the Binary Format, this is SectionIDGlobal. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#global-section%E2%91%A0 - GlobalSection []Global - - // ExportSection contains each export defined in this module. - // - // Note: In the Binary Format, this is SectionIDExport. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#exports%E2%91%A0 - ExportSection []Export - // Exports maps a name to Export, and is convenient for fast look up of exported instances at runtime. - // Each item of this map points to an element of ExportSection. - Exports map[string]*Export - - // StartSection is the index of a function to call before returning from Store.Instantiate. - // - // Note: The index here is not the position in the FunctionSection, rather in the function index, which - // begins with imported functions. - // - // Note: In the Binary Format, this is SectionIDStart. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#start-section%E2%91%A0 - StartSection *Index - - // Note: In the Binary Format, this is SectionIDElement. - ElementSection []ElementSegment - - // CodeSection is index-correlated with FunctionSection and contains each - // function's locals and body. - // - // When present, the HostFunctionSection of the same index must be nil. - // - // Note: In the Binary Format, this is SectionIDCode. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#code-section%E2%91%A0 - CodeSection []Code - - // Note: In the Binary Format, this is SectionIDData. - DataSection []DataSegment - - // NameSection is set when the SectionIDCustom "name" was successfully decoded from the binary format. - // - // Note: This is the only SectionIDCustom defined in the WebAssembly 1.0 (20191205) Binary Format. - // Others are skipped as they are not used in wazero. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#name-section%E2%91%A0 - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#custom-section%E2%91%A0 - NameSection *NameSection - - // CustomSections are set when the SectionIDCustom other than "name" were successfully decoded from the binary format. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#custom-section%E2%91%A0 - CustomSections []*CustomSection - - // DataCountSection is the optional section and holds the number of data segments in the data section. - // - // Note: This may exist in WebAssembly 2.0 or WebAssembly 1.0 with CoreFeatureBulkMemoryOperations. - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#data-count-section - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#bulk-memory-and-table-instructions - DataCountSection *uint32 - - // ID is the sha256 value of the source wasm plus the configurations which affect the runtime representation of - // Wasm binary. This is only used for caching. - ID ModuleID - - // IsHostModule true if this is the host module, false otherwise. - IsHostModule bool - - // functionDefinitionSectionInitOnce guards FunctionDefinitionSection so that it is initialized exactly once. - functionDefinitionSectionInitOnce sync.Once - - // FunctionDefinitionSection is a wazero-specific section. - FunctionDefinitionSection []FunctionDefinition - - // MemoryDefinitionSection is a wazero-specific section. - MemoryDefinitionSection []MemoryDefinition - - // DWARFLines is used to emit DWARF based stack trace. This is created from the multiple custom sections - // as described in https://yurydelendik.github.io/webassembly-dwarf/, though it is not specified in the Wasm - // specification: https://github.com/WebAssembly/debugging/issues/1 - DWARFLines *wasmdebug.DWARFLines -} - -// ModuleID represents sha256 hash value uniquely assigned to Module. -type ModuleID = [sha256.Size]byte - -// The wazero specific limitation described at RATIONALE.md. -// TL;DR; We multiply by 8 (to get offsets in bytes) and the multiplication result must be less than 32bit max -const ( - MaximumGlobals = uint32(1 << 27) - MaximumFunctionIndex = uint32(1 << 27) - MaximumTableIndex = uint32(1 << 27) -) - -// AssignModuleID calculates a sha256 checksum on `wasm` and other args, and set Module.ID to the result. -// See the doc on Module.ID on what it's used for. -func (m *Module) AssignModuleID(wasm []byte, withListener, withEnsureTermination bool) { - h := sha256.New() - h.Write(wasm) - // Use the pre-allocated space on m.ID to append the booleans to sha256 hash. - m.ID[0] = boolToByte(withListener) - m.ID[1] = boolToByte(withEnsureTermination) - h.Write(m.ID[:2]) - // Get checksum by passing the slice underlying m.ID. - h.Sum(m.ID[:0]) -} - -func boolToByte(b bool) (ret byte) { - if b { - ret = 1 - } - return -} - -// typeOfFunction returns the wasm.FunctionType for the given function space index or nil. -func (m *Module) typeOfFunction(funcIdx Index) *FunctionType { - typeSectionLength, importedFunctionCount := uint32(len(m.TypeSection)), m.ImportFunctionCount - if funcIdx < importedFunctionCount { - // Imports are not exclusively functions. This is the current function index in the loop. - cur := Index(0) - for i := range m.ImportSection { - imp := &m.ImportSection[i] - if imp.Type != ExternTypeFunc { - continue - } - if funcIdx == cur { - if imp.DescFunc >= typeSectionLength { - return nil - } - return &m.TypeSection[imp.DescFunc] - } - cur++ - } - } - - funcSectionIdx := funcIdx - m.ImportFunctionCount - if funcSectionIdx >= uint32(len(m.FunctionSection)) { - return nil - } - typeIdx := m.FunctionSection[funcSectionIdx] - if typeIdx >= typeSectionLength { - return nil - } - return &m.TypeSection[typeIdx] -} - -func (m *Module) Validate(enabledFeatures api.CoreFeatures) error { - for i := range m.TypeSection { - tp := &m.TypeSection[i] - tp.CacheNumInUint64() - } - - if err := m.validateStartSection(); err != nil { - return err - } - - functions, globals, memory, tables, err := m.AllDeclarations() - if err != nil { - return err - } - - if err = m.validateImports(enabledFeatures); err != nil { - return err - } - - if err = m.validateGlobals(globals, uint32(len(functions)), MaximumGlobals); err != nil { - return err - } - - if err = m.validateMemory(memory, globals, enabledFeatures); err != nil { - return err - } - - if err = m.validateExports(enabledFeatures, functions, globals, memory, tables); err != nil { - return err - } - - if m.CodeSection != nil { - if err = m.validateFunctions(enabledFeatures, functions, globals, memory, tables, MaximumFunctionIndex); err != nil { - return err - } - } // No need to validate host functions as NewHostModule validates - - if err = m.validateTable(enabledFeatures, tables, MaximumTableIndex); err != nil { - return err - } - - if err = m.validateDataCountSection(); err != nil { - return err - } - return nil -} - -func (m *Module) validateStartSection() error { - // Check the start function is valid. - // TODO: this should be verified during decode so that errors have the correct source positions - if m.StartSection != nil { - startIndex := *m.StartSection - ft := m.typeOfFunction(startIndex) - if ft == nil { // TODO: move this check to decoder so that a module can never be decoded invalidly - return fmt.Errorf("invalid start function: func[%d] has an invalid type", startIndex) - } - if len(ft.Params) > 0 || len(ft.Results) > 0 { - return fmt.Errorf("invalid start function: func[%d] must have an empty (nullary) signature: %s", startIndex, ft) - } - } - return nil -} - -func (m *Module) validateGlobals(globals []GlobalType, numFuncts, maxGlobals uint32) error { - if uint32(len(globals)) > maxGlobals { - return fmt.Errorf("too many globals in a module") - } - - // Global initialization constant expression can only reference the imported globals. - // See the note on https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#constant-expressions%E2%91%A0 - importedGlobals := globals[:m.ImportGlobalCount] - for i := range m.GlobalSection { - g := &m.GlobalSection[i] - if err := validateConstExpression(importedGlobals, numFuncts, &g.Init, g.Type.ValType); err != nil { - return err - } - } - return nil -} - -func (m *Module) validateFunctions(enabledFeatures api.CoreFeatures, functions []Index, globals []GlobalType, memory *Memory, tables []Table, maximumFunctionIndex uint32) error { - if uint32(len(functions)) > maximumFunctionIndex { - return fmt.Errorf("too many functions (%d) in a module", len(functions)) - } - - functionCount := m.SectionElementCount(SectionIDFunction) - codeCount := m.SectionElementCount(SectionIDCode) - if functionCount == 0 && codeCount == 0 { - return nil - } - - typeCount := m.SectionElementCount(SectionIDType) - if codeCount != functionCount { - return fmt.Errorf("code count (%d) != function count (%d)", codeCount, functionCount) - } - - declaredFuncIndexes, err := m.declaredFunctionIndexes() - if err != nil { - return err - } - - // Create bytes.Reader once as it causes allocation, and - // we frequently need it (e.g. on every If instruction). - br := bytes.NewReader(nil) - // Also, we reuse the stacks across multiple function validations to reduce allocations. - vs := &stacks{} - for idx, typeIndex := range m.FunctionSection { - if typeIndex >= typeCount { - return fmt.Errorf("invalid %s: type section index %d out of range", m.funcDesc(SectionIDFunction, Index(idx)), typeIndex) - } - c := &m.CodeSection[idx] - if c.GoFunc != nil { - continue - } - if err = m.validateFunction(vs, enabledFeatures, Index(idx), functions, globals, memory, tables, declaredFuncIndexes, br); err != nil { - return fmt.Errorf("invalid %s: %w", m.funcDesc(SectionIDFunction, Index(idx)), err) - } - } - return nil -} - -// declaredFunctionIndexes returns a set of function indexes that can be used as an immediate for OpcodeRefFunc instruction. -// -// The criteria for which function indexes can be available for that instruction is vague in the spec: -// -// - "References: the list of function indices that occur in the module outside functions and can hence be used to form references inside them." -// - https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/valid/conventions.html#contexts -// - "Ref is the set funcidx(module with functions=ε, start=ε) , i.e., the set of function indices occurring in the module, except in its functions or start function." -// - https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/valid/modules.html#valid-module -// -// To clarify, we reverse-engineer logic required to pass the WebAssembly Core specification 2.0 test suite: -// https://github.com/WebAssembly/spec/blob/d39195773112a22b245ffbe864bab6d1182ccb06/test/core/ref_func.wast#L78-L115 -// -// To summarize, the function indexes OpcodeRefFunc can refer include: -// - existing in an element section regardless of its mode (active, passive, declarative). -// - defined as globals whose value type is ValueRefFunc. -// - used as an exported function. -// -// See https://github.com/WebAssembly/reference-types/issues/31 -// See https://github.com/WebAssembly/reference-types/issues/76 -func (m *Module) declaredFunctionIndexes() (ret map[Index]struct{}, err error) { - ret = map[uint32]struct{}{} - - for i := range m.ExportSection { - exp := &m.ExportSection[i] - if exp.Type == ExternTypeFunc { - ret[exp.Index] = struct{}{} - } - } - - for i := range m.GlobalSection { - g := &m.GlobalSection[i] - if g.Init.Opcode == OpcodeRefFunc { - var index uint32 - index, _, err = leb128.LoadUint32(g.Init.Data) - if err != nil { - err = fmt.Errorf("%s[%d] failed to initialize: %w", SectionIDName(SectionIDGlobal), i, err) - return - } - ret[index] = struct{}{} - } - } - - for i := range m.ElementSection { - elem := &m.ElementSection[i] - for _, index := range elem.Init { - if index != ElementInitNullReference { - ret[index] = struct{}{} - } - } - } - return -} - -func (m *Module) funcDesc(sectionID SectionID, sectionIndex Index) string { - // Try to improve the error message by collecting any exports: - var exportNames []string - funcIdx := sectionIndex + m.ImportFunctionCount - for i := range m.ExportSection { - exp := &m.ExportSection[i] - if exp.Index == funcIdx && exp.Type == ExternTypeFunc { - exportNames = append(exportNames, fmt.Sprintf("%q", exp.Name)) - } - } - sectionIDName := SectionIDName(sectionID) - if exportNames == nil { - return fmt.Sprintf("%s[%d]", sectionIDName, sectionIndex) - } - sort.Strings(exportNames) // go map keys do not iterate consistently - return fmt.Sprintf("%s[%d] export[%s]", sectionIDName, sectionIndex, strings.Join(exportNames, ",")) -} - -func (m *Module) validateMemory(memory *Memory, globals []GlobalType, _ api.CoreFeatures) error { - var activeElementCount int - for i := range m.DataSection { - d := &m.DataSection[i] - if !d.IsPassive() { - activeElementCount++ - } - } - if activeElementCount > 0 && memory == nil { - return fmt.Errorf("unknown memory") - } - - // Constant expression can only reference imported globals. - // https://github.com/WebAssembly/spec/blob/5900d839f38641989a9d8df2df4aee0513365d39/test/core/data.wast#L84-L91 - importedGlobals := globals[:m.ImportGlobalCount] - for i := range m.DataSection { - d := &m.DataSection[i] - if !d.IsPassive() { - if err := validateConstExpression(importedGlobals, 0, &d.OffsetExpression, ValueTypeI32); err != nil { - return fmt.Errorf("calculate offset: %w", err) - } - } - } - return nil -} - -func (m *Module) validateImports(enabledFeatures api.CoreFeatures) error { - for i := range m.ImportSection { - imp := &m.ImportSection[i] - if imp.Module == "" { - return fmt.Errorf("import[%d] has an empty module name", i) - } - switch imp.Type { - case ExternTypeFunc: - if int(imp.DescFunc) >= len(m.TypeSection) { - return fmt.Errorf("invalid import[%q.%q] function: type index out of range", imp.Module, imp.Name) - } - case ExternTypeGlobal: - if !imp.DescGlobal.Mutable { - continue - } - if err := enabledFeatures.RequireEnabled(api.CoreFeatureMutableGlobal); err != nil { - return fmt.Errorf("invalid import[%q.%q] global: %w", imp.Module, imp.Name, err) - } - } - } - return nil -} - -func (m *Module) validateExports(enabledFeatures api.CoreFeatures, functions []Index, globals []GlobalType, memory *Memory, tables []Table) error { - for i := range m.ExportSection { - exp := &m.ExportSection[i] - index := exp.Index - switch exp.Type { - case ExternTypeFunc: - if index >= uint32(len(functions)) { - return fmt.Errorf("unknown function for export[%q]", exp.Name) - } - case ExternTypeGlobal: - if index >= uint32(len(globals)) { - return fmt.Errorf("unknown global for export[%q]", exp.Name) - } - if !globals[index].Mutable { - continue - } - if err := enabledFeatures.RequireEnabled(api.CoreFeatureMutableGlobal); err != nil { - return fmt.Errorf("invalid export[%q] global[%d]: %w", exp.Name, index, err) - } - case ExternTypeMemory: - if index > 0 || memory == nil { - return fmt.Errorf("memory for export[%q] out of range", exp.Name) - } - case ExternTypeTable: - if index >= uint32(len(tables)) { - return fmt.Errorf("table for export[%q] out of range", exp.Name) - } - } - } - return nil -} - -func validateConstExpression(globals []GlobalType, numFuncs uint32, expr *ConstantExpression, expectedType ValueType) (err error) { - var actualType ValueType - switch expr.Opcode { - case OpcodeI32Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - _, _, err = leb128.LoadInt32(expr.Data) - if err != nil { - return fmt.Errorf("read i32: %w", err) - } - actualType = ValueTypeI32 - case OpcodeI64Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - _, _, err = leb128.LoadInt64(expr.Data) - if err != nil { - return fmt.Errorf("read i64: %w", err) - } - actualType = ValueTypeI64 - case OpcodeF32Const: - _, err = ieee754.DecodeFloat32(expr.Data) - if err != nil { - return fmt.Errorf("read f32: %w", err) - } - actualType = ValueTypeF32 - case OpcodeF64Const: - _, err = ieee754.DecodeFloat64(expr.Data) - if err != nil { - return fmt.Errorf("read f64: %w", err) - } - actualType = ValueTypeF64 - case OpcodeGlobalGet: - id, _, err := leb128.LoadUint32(expr.Data) - if err != nil { - return fmt.Errorf("read index of global: %w", err) - } - if uint32(len(globals)) <= id { - return fmt.Errorf("global index out of range") - } - actualType = globals[id].ValType - case OpcodeRefNull: - if len(expr.Data) == 0 { - return fmt.Errorf("read reference type for ref.null: %w", io.ErrShortBuffer) - } - reftype := expr.Data[0] - if reftype != RefTypeFuncref && reftype != RefTypeExternref { - return fmt.Errorf("invalid type for ref.null: 0x%x", reftype) - } - actualType = reftype - case OpcodeRefFunc: - index, _, err := leb128.LoadUint32(expr.Data) - if err != nil { - return fmt.Errorf("read i32: %w", err) - } else if index >= numFuncs { - return fmt.Errorf("ref.func index out of range [%d] with length %d", index, numFuncs-1) - } - actualType = ValueTypeFuncref - case OpcodeVecV128Const: - if len(expr.Data) != 16 { - return fmt.Errorf("%s needs 16 bytes but was %d bytes", OpcodeVecV128ConstName, len(expr.Data)) - } - actualType = ValueTypeV128 - default: - return fmt.Errorf("invalid opcode for const expression: 0x%x", expr.Opcode) - } - - if actualType != expectedType { - return fmt.Errorf("const expression type mismatch expected %s but got %s", - ValueTypeName(expectedType), ValueTypeName(actualType)) - } - return nil -} - -func (m *Module) validateDataCountSection() (err error) { - if m.DataCountSection != nil && int(*m.DataCountSection) != len(m.DataSection) { - err = fmt.Errorf("data count section (%d) doesn't match the length of data section (%d)", - *m.DataCountSection, len(m.DataSection)) - } - return -} - -func (m *ModuleInstance) buildGlobals(module *Module, funcRefResolver func(funcIndex Index) Reference) { - importedGlobals := m.Globals[:module.ImportGlobalCount] - for i := Index(0); i < Index(len(module.GlobalSection)); i++ { - gs := &module.GlobalSection[i] - g := &GlobalInstance{} - m.Globals[i+module.ImportGlobalCount] = g - g.Type = gs.Type - g.initialize(importedGlobals, &gs.Init, funcRefResolver) - } -} - -func paramNames(localNames IndirectNameMap, funcIdx uint32, paramLen int) []string { - for i := range localNames { - nm := &localNames[i] - // Only build parameter names if we have one for each. - if nm.Index != funcIdx || len(nm.NameMap) < paramLen { - continue - } - - ret := make([]string, paramLen) - for j := range nm.NameMap { - p := &nm.NameMap[j] - if int(p.Index) < paramLen { - ret[p.Index] = p.Name - } - } - return ret - } - return nil -} - -func (m *ModuleInstance) buildMemory(module *Module) { - memSec := module.MemorySection - if memSec != nil { - m.MemoryInstance = NewMemoryInstance(memSec) - m.MemoryInstance.definition = &module.MemoryDefinitionSection[0] - } -} - -// Index is the offset in an index, not necessarily an absolute position in a Module section. This is because -// indexs are often preceded by a corresponding type in the Module.ImportSection. -// -// For example, the function index starts with any ExternTypeFunc in the Module.ImportSection followed by -// the Module.FunctionSection -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-index -type Index = uint32 - -// FunctionType is a possibly empty function signature. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#function-types%E2%91%A0 -type FunctionType struct { - // Params are the possibly empty sequence of value types accepted by a function with this signature. - Params []ValueType - - // Results are the possibly empty sequence of value types returned by a function with this signature. - // - // Note: In WebAssembly 1.0 (20191205), there can be at most one result. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#result-types%E2%91%A0 - Results []ValueType - - // string is cached as it is used both for String and key - string string - - // ParamNumInUint64 is the number of uint64 values requires to represent the Wasm param type. - ParamNumInUint64 int - - // ResultsNumInUint64 is the number of uint64 values requires to represent the Wasm result type. - ResultNumInUint64 int -} - -func (f *FunctionType) CacheNumInUint64() { - if f.ParamNumInUint64 == 0 { - for _, tp := range f.Params { - f.ParamNumInUint64++ - if tp == ValueTypeV128 { - f.ParamNumInUint64++ - } - } - } - - if f.ResultNumInUint64 == 0 { - for _, tp := range f.Results { - f.ResultNumInUint64++ - if tp == ValueTypeV128 { - f.ResultNumInUint64++ - } - } - } -} - -// EqualsSignature returns true if the function type has the same parameters and results. -func (f *FunctionType) EqualsSignature(params []ValueType, results []ValueType) bool { - return bytes.Equal(f.Params, params) && bytes.Equal(f.Results, results) -} - -// key gets or generates the key for Store.typeIDs. e.g. "i32_v" for one i32 parameter and no (void) result. -func (f *FunctionType) key() string { - if f.string != "" { - return f.string - } - var ret string - for _, b := range f.Params { - ret += ValueTypeName(b) - } - if len(f.Params) == 0 { - ret += "v_" - } else { - ret += "_" - } - for _, b := range f.Results { - ret += ValueTypeName(b) - } - if len(f.Results) == 0 { - ret += "v" - } - f.string = ret - return ret -} - -// String implements fmt.Stringer. -func (f *FunctionType) String() string { - return f.key() -} - -// Import is the binary representation of an import indicated by Type -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-import -type Import struct { - Type ExternType - // Module is the possibly empty primary namespace of this import - Module string - // Module is the possibly empty secondary namespace of this import - Name string - // DescFunc is the index in Module.TypeSection when Type equals ExternTypeFunc - DescFunc Index - // DescTable is the inlined Table when Type equals ExternTypeTable - DescTable Table - // DescMem is the inlined Memory when Type equals ExternTypeMemory - DescMem *Memory - // DescGlobal is the inlined GlobalType when Type equals ExternTypeGlobal - DescGlobal GlobalType - // IndexPerType has the index of this import per ExternType. - IndexPerType Index -} - -// Memory describes the limits of pages (64KB) in a memory. -type Memory struct { - Min, Cap, Max uint32 - // IsMaxEncoded true if the Max is encoded in the original binary. - IsMaxEncoded bool -} - -// Validate ensures values assigned to Min, Cap and Max are within valid thresholds. -func (m *Memory) Validate(memoryLimitPages uint32) error { - min, capacity, max := m.Min, m.Cap, m.Max - - if max > memoryLimitPages { - return fmt.Errorf("max %d pages (%s) over limit of %d pages (%s)", - max, PagesToUnitOfBytes(max), memoryLimitPages, PagesToUnitOfBytes(memoryLimitPages)) - } else if min > memoryLimitPages { - return fmt.Errorf("min %d pages (%s) over limit of %d pages (%s)", - min, PagesToUnitOfBytes(min), memoryLimitPages, PagesToUnitOfBytes(memoryLimitPages)) - } else if min > max { - return fmt.Errorf("min %d pages (%s) > max %d pages (%s)", - min, PagesToUnitOfBytes(min), max, PagesToUnitOfBytes(max)) - } else if capacity < min { - return fmt.Errorf("capacity %d pages (%s) less than minimum %d pages (%s)", - capacity, PagesToUnitOfBytes(capacity), min, PagesToUnitOfBytes(min)) - } else if capacity > memoryLimitPages { - return fmt.Errorf("capacity %d pages (%s) over limit of %d pages (%s)", - capacity, PagesToUnitOfBytes(capacity), memoryLimitPages, PagesToUnitOfBytes(memoryLimitPages)) - } - return nil -} - -type GlobalType struct { - ValType ValueType - Mutable bool -} - -type Global struct { - Type GlobalType - Init ConstantExpression -} - -type ConstantExpression struct { - Opcode Opcode - Data []byte -} - -// Export is the binary representation of an export indicated by Type -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-export -type Export struct { - Type ExternType - - // Name is what the host refers to this definition as. - Name string - - // Index is the index of the definition to export, the index is by Type - // e.g. If ExternTypeFunc, this is a position in the function index. - Index Index -} - -// Code is an entry in the Module.CodeSection containing the locals and body of the function. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-code -type Code struct { - // LocalTypes are any function-scoped variables in insertion order. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-local - LocalTypes []ValueType - - // Body is a sequence of expressions ending in OpcodeEnd - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-expr - Body []byte - - // GoFunc is non-nil when IsHostFunction and defined in go, either - // api.GoFunction or api.GoModuleFunction. When present, LocalTypes and Body must - // be nil. - // - // Note: This has no serialization format, so is not encodable. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#host-functions%E2%91%A2 - GoFunc interface{} - - // BodyOffsetInCodeSection is the offset of the beginning of the body in the code section. - // This is used for DWARF based stack trace where a program counter represents an offset in code section. - BodyOffsetInCodeSection uint64 -} - -type DataSegment struct { - OffsetExpression ConstantExpression - Init []byte - Passive bool -} - -// IsPassive returns true if this data segment is "passive" in the sense that memory offset and -// index is determined at runtime and used by OpcodeMemoryInitName instruction in the bulk memory -// operations proposal. -// -// See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#bulk-memory-and-table-instructions -func (d *DataSegment) IsPassive() bool { - return d.Passive -} - -// NameSection represent the known custom name subsections defined in the WebAssembly Binary Format -// -// Note: This can be nil if no names were decoded for any reason including configuration. -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#name-section%E2%91%A0 -type NameSection struct { - // ModuleName is the symbolic identifier for a module. e.g. math - // - // Note: This can be empty for any reason including configuration. - ModuleName string - - // FunctionNames is an association of a function index to its symbolic identifier. e.g. add - // - // * the key (idx) is in the function index, where module defined functions are preceded by imported ones. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#functions%E2%91%A7 - // - // For example, assuming the below text format is the second import, you would expect FunctionNames[1] = "mul" - // (import "Math" "Mul" (func $mul (param $x f32) (param $y f32) (result f32))) - // - // Note: FunctionNames are only used for debugging. At runtime, functions are called based on raw numeric index. - // Note: This can be nil for any reason including configuration. - FunctionNames NameMap - - // LocalNames contains symbolic names for function parameters or locals that have one. - // - // Note: In the Text Format, function local names can inherit parameter - // names from their type. Here are some examples: - // * (module (import (func (param $x i32) (param i32))) (func (type 0))) = [{0, {x,0}}] - // * (module (import (func (param i32) (param $y i32))) (func (type 0) (local $z i32))) = [0, [{y,1},{z,2}]] - // * (module (func (param $x i32) (local $y i32) (local $z i32))) = [{x,0},{y,1},{z,2}] - // - // Note: LocalNames are only used for debugging. At runtime, locals are called based on raw numeric index. - // Note: This can be nil for any reason including configuration. - LocalNames IndirectNameMap - - // ResultNames is a wazero-specific mechanism to store result names. - ResultNames IndirectNameMap -} - -// CustomSection contains the name and raw data of a custom section. -type CustomSection struct { - Name string - Data []byte -} - -// NameMap associates an index with any associated names. -// -// Note: Often the index bridges multiple sections. For example, the function index starts with any -// ExternTypeFunc in the Module.ImportSection followed by the Module.FunctionSection -// -// Note: NameMap is unique by NameAssoc.Index, but NameAssoc.Name needn't be unique. -// Note: When encoding in the Binary format, this must be ordered by NameAssoc.Index -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-namemap -type NameMap []NameAssoc - -type NameAssoc struct { - Index Index - Name string -} - -// IndirectNameMap associates an index with an association of names. -// -// Note: IndirectNameMap is unique by NameMapAssoc.Index, but NameMapAssoc.NameMap needn't be unique. -// Note: When encoding in the Binary format, this must be ordered by NameMapAssoc.Index -// https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-indirectnamemap -type IndirectNameMap []NameMapAssoc - -type NameMapAssoc struct { - Index Index - NameMap NameMap -} - -// AllDeclarations returns all declarations for functions, globals, memories and tables in a module including imported ones. -func (m *Module) AllDeclarations() (functions []Index, globals []GlobalType, memory *Memory, tables []Table, err error) { - for i := range m.ImportSection { - imp := &m.ImportSection[i] - switch imp.Type { - case ExternTypeFunc: - functions = append(functions, imp.DescFunc) - case ExternTypeGlobal: - globals = append(globals, imp.DescGlobal) - case ExternTypeMemory: - memory = imp.DescMem - case ExternTypeTable: - tables = append(tables, imp.DescTable) - } - } - - functions = append(functions, m.FunctionSection...) - for i := range m.GlobalSection { - g := &m.GlobalSection[i] - globals = append(globals, g.Type) - } - if m.MemorySection != nil { - if memory != nil { // shouldn't be possible due to Validate - err = errors.New("at most one table allowed in module") - return - } - memory = m.MemorySection - } - if m.TableSection != nil { - tables = append(tables, m.TableSection...) - } - return -} - -// SectionID identifies the sections of a Module in the WebAssembly 1.0 (20191205) Binary Format. -// -// Note: these are defined in the wasm package, instead of the binary package, as a key per section is needed regardless -// of format, and deferring to the binary type avoids confusion. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#sections%E2%91%A0 -type SectionID = byte - -const ( - // SectionIDCustom includes the standard defined NameSection and possibly others not defined in the standard. - SectionIDCustom SectionID = iota // don't add anything not in https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#sections%E2%91%A0 - SectionIDType - SectionIDImport - SectionIDFunction - SectionIDTable - SectionIDMemory - SectionIDGlobal - SectionIDExport - SectionIDStart - SectionIDElement - SectionIDCode - SectionIDData - - // SectionIDDataCount may exist in WebAssembly 2.0 or WebAssembly 1.0 with CoreFeatureBulkMemoryOperations enabled. - // - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/binary/modules.html#data-count-section - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/appendix/changes.html#bulk-memory-and-table-instructions - SectionIDDataCount -) - -// SectionIDName returns the canonical name of a module section. -// https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#sections%E2%91%A0 -func SectionIDName(sectionID SectionID) string { - switch sectionID { - case SectionIDCustom: - return "custom" - case SectionIDType: - return "type" - case SectionIDImport: - return "import" - case SectionIDFunction: - return "function" - case SectionIDTable: - return "table" - case SectionIDMemory: - return "memory" - case SectionIDGlobal: - return "global" - case SectionIDExport: - return "export" - case SectionIDStart: - return "start" - case SectionIDElement: - return "element" - case SectionIDCode: - return "code" - case SectionIDData: - return "data" - case SectionIDDataCount: - return "data_count" - } - return "unknown" -} - -// ValueType is an alias of api.ValueType defined to simplify imports. -type ValueType = api.ValueType - -const ( - ValueTypeI32 = api.ValueTypeI32 - ValueTypeI64 = api.ValueTypeI64 - ValueTypeF32 = api.ValueTypeF32 - ValueTypeF64 = api.ValueTypeF64 - // TODO: ValueTypeV128 is not exposed in the api pkg yet. - ValueTypeV128 ValueType = 0x7b - // TODO: ValueTypeFuncref is not exposed in the api pkg yet. - ValueTypeFuncref ValueType = 0x70 - ValueTypeExternref = api.ValueTypeExternref -) - -// ValueTypeName is an alias of api.ValueTypeName defined to simplify imports. -func ValueTypeName(t ValueType) string { - if t == ValueTypeFuncref { - return "funcref" - } else if t == ValueTypeV128 { - return "v128" - } - return api.ValueTypeName(t) -} - -func isReferenceValueType(vt ValueType) bool { - return vt == ValueTypeExternref || vt == ValueTypeFuncref -} - -// ExternType is an alias of api.ExternType defined to simplify imports. -type ExternType = api.ExternType - -const ( - ExternTypeFunc = api.ExternTypeFunc - ExternTypeFuncName = api.ExternTypeFuncName - ExternTypeTable = api.ExternTypeTable - ExternTypeTableName = api.ExternTypeTableName - ExternTypeMemory = api.ExternTypeMemory - ExternTypeMemoryName = api.ExternTypeMemoryName - ExternTypeGlobal = api.ExternTypeGlobal - ExternTypeGlobalName = api.ExternTypeGlobalName -) - -// ExternTypeName is an alias of api.ExternTypeName defined to simplify imports. -func ExternTypeName(t ValueType) string { - return api.ExternTypeName(t) -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go deleted file mode 100644 index 20cdcd96ac..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/module_instance.go +++ /dev/null @@ -1,238 +0,0 @@ -package wasm - -import ( - "context" - "errors" - "fmt" - "sync/atomic" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/sys" -) - -// FailIfClosed returns a sys.ExitError if CloseWithExitCode was called. -func (m *ModuleInstance) FailIfClosed() (err error) { - if closed := atomic.LoadUint64(&m.Closed); closed != 0 { - switch closed & exitCodeFlagMask { - case exitCodeFlagResourceClosed: - case exitCodeFlagResourceNotClosed: - // This happens when this module is closed asynchronously in CloseModuleOnCanceledOrTimeout, - // and the closure of resources have been deferred here. - _ = m.ensureResourcesClosed(context.Background()) - } - return sys.NewExitError(uint32(closed >> 32)) // Unpack the high order bits as the exit code. - } - return nil -} - -// CloseModuleOnCanceledOrTimeout take a context `ctx`, which might be a Cancel or Timeout context, -// and spawns the Goroutine to check the context is canceled ot deadline exceeded. If it reaches -// one of the conditions, it sets the appropriate exit code. -// -// Callers of this function must invoke the returned context.CancelFunc to release the spawned Goroutine. -func (m *ModuleInstance) CloseModuleOnCanceledOrTimeout(ctx context.Context) context.CancelFunc { - // Creating an empty channel in this case is a bit more efficient than - // creating a context.Context and canceling it with the same effect. We - // really just need to be notified when to stop listening to the users - // context. Closing the channel will unblock the select in the goroutine - // causing it to return an stop listening to ctx.Done(). - cancelChan := make(chan struct{}) - go m.closeModuleOnCanceledOrTimeout(ctx, cancelChan) - return func() { close(cancelChan) } -} - -// closeModuleOnCanceledOrTimeout is extracted from CloseModuleOnCanceledOrTimeout for testing. -func (m *ModuleInstance) closeModuleOnCanceledOrTimeout(ctx context.Context, cancelChan <-chan struct{}) { - select { - case <-ctx.Done(): - select { - case <-cancelChan: - // In some cases by the time this goroutine is scheduled, the caller - // has already closed both the context and the cancelChan. In this - // case go will randomize which branch of the outer select to enter - // and we don't want to close the module. - default: - // This is the same logic as CloseWithCtxErr except this calls closeWithExitCodeWithoutClosingResource - // so that we can defer the resource closure in FailIfClosed. - switch { - case errors.Is(ctx.Err(), context.Canceled): - // TODO: figure out how to report error here. - _ = m.closeWithExitCodeWithoutClosingResource(sys.ExitCodeContextCanceled) - case errors.Is(ctx.Err(), context.DeadlineExceeded): - // TODO: figure out how to report error here. - _ = m.closeWithExitCodeWithoutClosingResource(sys.ExitCodeDeadlineExceeded) - } - } - case <-cancelChan: - } -} - -// CloseWithCtxErr closes the module with an exit code based on the type of -// error reported by the context. -// -// If the context's error is unknown or nil, the module does not close. -func (m *ModuleInstance) CloseWithCtxErr(ctx context.Context) { - switch { - case errors.Is(ctx.Err(), context.Canceled): - // TODO: figure out how to report error here. - _ = m.CloseWithExitCode(ctx, sys.ExitCodeContextCanceled) - case errors.Is(ctx.Err(), context.DeadlineExceeded): - // TODO: figure out how to report error here. - _ = m.CloseWithExitCode(ctx, sys.ExitCodeDeadlineExceeded) - } -} - -// Name implements the same method as documented on api.Module -func (m *ModuleInstance) Name() string { - return m.ModuleName -} - -// String implements the same method as documented on api.Module -func (m *ModuleInstance) String() string { - return fmt.Sprintf("Module[%s]", m.Name()) -} - -// Close implements the same method as documented on api.Module. -func (m *ModuleInstance) Close(ctx context.Context) (err error) { - return m.CloseWithExitCode(ctx, 0) -} - -// CloseWithExitCode implements the same method as documented on api.Module. -func (m *ModuleInstance) CloseWithExitCode(ctx context.Context, exitCode uint32) (err error) { - if !m.setExitCode(exitCode, exitCodeFlagResourceClosed) { - return nil // not an error to have already closed - } - _ = m.s.deleteModule(m) - return m.ensureResourcesClosed(ctx) -} - -func (m *ModuleInstance) closeWithExitCodeWithoutClosingResource(exitCode uint32) (err error) { - if !m.setExitCode(exitCode, exitCodeFlagResourceNotClosed) { - return nil // not an error to have already closed - } - _ = m.s.deleteModule(m) - return nil -} - -// closeWithExitCode is the same as CloseWithExitCode besides this doesn't delete it from Store.moduleList. -func (m *ModuleInstance) closeWithExitCode(ctx context.Context, exitCode uint32) (err error) { - if !m.setExitCode(exitCode, exitCodeFlagResourceClosed) { - return nil // not an error to have already closed - } - return m.ensureResourcesClosed(ctx) -} - -type exitCodeFlag = uint64 - -const exitCodeFlagMask = 0xff - -const ( - // exitCodeFlagResourceClosed indicates that the module was closed and resources were already closed. - exitCodeFlagResourceClosed = 1 << iota - // exitCodeFlagResourceNotClosed indicates that the module was closed while resources are not closed yet. - exitCodeFlagResourceNotClosed -) - -func (m *ModuleInstance) setExitCode(exitCode uint32, flag exitCodeFlag) bool { - closed := flag | uint64(exitCode)<<32 // Store exitCode as high-order bits. - return atomic.CompareAndSwapUint64(&m.Closed, 0, closed) -} - -// ensureResourcesClosed ensures that resources assigned to ModuleInstance is released. -// Multiple calls to this function is safe. -func (m *ModuleInstance) ensureResourcesClosed(ctx context.Context) (err error) { - if sysCtx := m.Sys; sysCtx != nil { // nil if from HostModuleBuilder - if err = sysCtx.FS().Close(); err != nil { - return err - } - m.Sys = nil - } - - if m.CodeCloser == nil { - return - } - if e := m.CodeCloser.Close(ctx); e != nil && err == nil { - err = e - } - m.CodeCloser = nil - return -} - -// Memory implements the same method as documented on api.Module. -func (m *ModuleInstance) Memory() api.Memory { - return m.MemoryInstance -} - -// ExportedMemory implements the same method as documented on api.Module. -func (m *ModuleInstance) ExportedMemory(name string) api.Memory { - _, err := m.getExport(name, ExternTypeMemory) - if err != nil { - return nil - } - // We Assume that we have at most one memory. - return m.MemoryInstance -} - -// ExportedMemoryDefinitions implements the same method as documented on -// api.Module. -func (m *ModuleInstance) ExportedMemoryDefinitions() map[string]api.MemoryDefinition { - // Special case as we currently only support one memory. - if mem := m.MemoryInstance; mem != nil { - // Now, find out if it is exported - for name, exp := range m.Exports { - if exp.Type == ExternTypeMemory { - return map[string]api.MemoryDefinition{name: mem.definition} - } - } - } - return map[string]api.MemoryDefinition{} -} - -// ExportedFunction implements the same method as documented on api.Module. -func (m *ModuleInstance) ExportedFunction(name string) api.Function { - exp, err := m.getExport(name, ExternTypeFunc) - if err != nil { - return nil - } - return m.Engine.NewFunction(exp.Index) -} - -// ExportedFunctionDefinitions implements the same method as documented on -// api.Module. -func (m *ModuleInstance) ExportedFunctionDefinitions() map[string]api.FunctionDefinition { - result := map[string]api.FunctionDefinition{} - for name, exp := range m.Exports { - if exp.Type == ExternTypeFunc { - result[name] = m.Source.FunctionDefinition(exp.Index) - } - } - return result -} - -// GlobalVal is an internal hack to get the lower 64 bits of a global. -func (m *ModuleInstance) GlobalVal(idx Index) uint64 { - return m.Globals[idx].Val -} - -// ExportedGlobal implements the same method as documented on api.Module. -func (m *ModuleInstance) ExportedGlobal(name string) api.Global { - exp, err := m.getExport(name, ExternTypeGlobal) - if err != nil { - return nil - } - g := m.Globals[exp.Index] - if g.Type.Mutable { - return mutableGlobal{g: g} - } - return constantGlobal{g: g} -} - -// NumGlobal implements experimental.InternalModule. -func (m *ModuleInstance) NumGlobal() int { - return len(m.Globals) -} - -// Global implements experimental.InternalModule. -func (m *ModuleInstance) Global(idx int) api.Global { - return constantGlobal{g: m.Globals[idx]} -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/store.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/store.go deleted file mode 100644 index 70af5e6fa0..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/store.go +++ /dev/null @@ -1,618 +0,0 @@ -package wasm - -import ( - "context" - "encoding/binary" - "fmt" - "sync" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/internalapi" - "github.com/tetratelabs/wazero/internal/leb128" - internalsys "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/sys" -) - -// nameToModuleShrinkThreshold is the size the nameToModule map can grow to -// before it starts to be monitored for shrinking. -// The capacity will never be smaller than this once the threshold is met. -const nameToModuleShrinkThreshold = 100 - -type ( - // Store is the runtime representation of "instantiated" Wasm module and objects. - // Multiple modules can be instantiated within a single store, and each instance, - // (e.g. function instance) can be referenced by other module instances in a Store via Module.ImportSection. - // - // Every type whose name ends with "Instance" suffix belongs to exactly one store. - // - // Note that store is not thread (concurrency) safe, meaning that using single Store - // via multiple goroutines might result in race conditions. In that case, the invocation - // and access to any methods and field of Store must be guarded by mutex. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#store%E2%91%A0 - Store struct { - // moduleList ensures modules are closed in reverse initialization order. - moduleList *ModuleInstance // guarded by mux - - // nameToModule holds the instantiated Wasm modules by module name from Instantiate. - // It ensures no race conditions instantiating two modules of the same name. - nameToModule map[string]*ModuleInstance // guarded by mux - - // nameToModuleCap tracks the growth of the nameToModule map in order to - // track when to shrink it. - nameToModuleCap int // guarded by mux - - // EnabledFeatures are read-only to allow optimizations. - EnabledFeatures api.CoreFeatures - - // Engine is a global context for a Store which is in responsible for compilation and execution of Wasm modules. - Engine Engine - - // typeIDs maps each FunctionType.String() to a unique FunctionTypeID. This is used at runtime to - // do type-checks on indirect function calls. - typeIDs map[string]FunctionTypeID - - // functionMaxTypes represents the limit on the number of function types in a store. - // Note: this is fixed to 2^27 but have this a field for testability. - functionMaxTypes uint32 - - // mux is used to guard the fields from concurrent access. - mux sync.RWMutex - } - - // ModuleInstance represents instantiated wasm module. - // The difference from the spec is that in wazero, a ModuleInstance holds pointers - // to the instances, rather than "addresses" (i.e. index to Store.Functions, Globals, etc) for convenience. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#syntax-moduleinst - // - // This implements api.Module. - ModuleInstance struct { - internalapi.WazeroOnlyType - - // Closed is used both to guard moduleEngine.CloseWithExitCode and to store the exit code. - // - // The update value is closedType + exitCode << 32. This ensures an exit code of zero isn't mistaken for never closed. - // - // Note: Exclusively reading and updating this with atomics guarantees cross-goroutine observations. - // See /RATIONALE.md - // - // TODO: Retype this to atomic.Unit64 when Go 1.18 is no longer supported. Until then, keep Closed at the top of - // this struct. See PR #1299 for an implementation and discussion. - Closed uint64 - - ModuleName string - Exports map[string]*Export - Globals []*GlobalInstance - MemoryInstance *MemoryInstance - Tables []*TableInstance - - // Engine implements function calls for this module. - Engine ModuleEngine - - // TypeIDs is index-correlated with types and holds typeIDs which is uniquely assigned to a type by store. - // This is necessary to achieve fast runtime type checking for indirect function calls at runtime. - TypeIDs []FunctionTypeID - - // DataInstances holds data segments bytes of the module. - // This is only used by bulk memory operations. - // - // https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/runtime.html#data-instances - DataInstances []DataInstance - - // ElementInstances holds the element instance, and each holds the references to either functions - // or external objects (unimplemented). - ElementInstances []ElementInstance - - // Sys is exposed for use in special imports such as WASI, assemblyscript - // and gojs. - // - // # Notes - // - // - This is a part of ModuleInstance so that scope and Close is coherent. - // - This is not exposed outside this repository (as a host function - // parameter) because we haven't thought through capabilities based - // security implications. - Sys *internalsys.Context - - // CodeCloser is non-nil when the code should be closed after this module. - CodeCloser api.Closer - - // s is the Store on which this module is instantiated. - s *Store - // prev and next hold the nodes in the linked list of ModuleInstance held by Store. - prev, next *ModuleInstance - // Source is a pointer to the Module from which this ModuleInstance derives. - Source *Module - } - - // DataInstance holds bytes corresponding to the data segment in a module. - // - // https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/runtime.html#data-instances - DataInstance = []byte - - // GlobalInstance represents a global instance in a store. - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#global-instances%E2%91%A0 - GlobalInstance struct { - Type GlobalType - // Val holds a 64-bit representation of the actual value. - Val uint64 - // ValHi is only used for vector type globals, and holds the higher bits of the vector. - ValHi uint64 - // ^^ TODO: this should be guarded with atomics when mutable - } - - // FunctionTypeID is a uniquely assigned integer for a function type. - // This is wazero specific runtime object and specific to a store, - // and used at runtime to do type-checks on indirect function calls. - FunctionTypeID uint32 -) - -// The wazero specific limitations described at RATIONALE.md. -const maximumFunctionTypes = 1 << 27 - -// GetFunctionTypeID is used by emscripten. -func (m *ModuleInstance) GetFunctionTypeID(t *FunctionType) (FunctionTypeID, error) { - return m.s.GetFunctionTypeID(t) -} - -func (m *ModuleInstance) buildElementInstances(elements []ElementSegment) { - m.ElementInstances = make([]ElementInstance, len(elements)) - for i, elm := range elements { - if elm.Type == RefTypeFuncref && elm.Mode == ElementModePassive { - // Only passive elements can be access as element instances. - // See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/syntax/modules.html#element-segments - inits := elm.Init - elemInst := &m.ElementInstances[i] - elemInst.References = make([]Reference, len(inits)) - elemInst.Type = RefTypeFuncref - for j, idx := range inits { - if idx != ElementInitNullReference { - elemInst.References[j] = m.Engine.FunctionInstanceReference(idx) - } - } - } - } -} - -func (m *ModuleInstance) applyElements(elems []ElementSegment) { - for elemI := range elems { - elem := &elems[elemI] - if !elem.IsActive() || - // Per https://github.com/WebAssembly/spec/issues/1427 init can be no-op. - len(elem.Init) == 0 { - continue - } - var offset uint32 - if elem.OffsetExpr.Opcode == OpcodeGlobalGet { - // Ignore error as it's already validated. - globalIdx, _, _ := leb128.LoadUint32(elem.OffsetExpr.Data) - global := m.Globals[globalIdx] - offset = uint32(global.Val) - } else { - // Ignore error as it's already validated. - o, _, _ := leb128.LoadInt32(elem.OffsetExpr.Data) - offset = uint32(o) - } - - table := m.Tables[elem.TableIndex] - references := table.References - if int(offset)+len(elem.Init) > len(references) { - // ErrElementOffsetOutOfBounds is the error raised when the active element offset exceeds the table length. - // Before CoreFeatureReferenceTypes, this was checked statically before instantiation, after the proposal, - // this must be raised as runtime error (as in assert_trap in spectest), not even an instantiation error. - // https://github.com/WebAssembly/spec/blob/d39195773112a22b245ffbe864bab6d1182ccb06/test/core/linking.wast#L264-L274 - // - // In wazero, we ignore it since in any way, the instantiated module and engines are fine and can be used - // for function invocations. - return - } - - if table.Type == RefTypeExternref { - for i := 0; i < len(elem.Init); i++ { - references[offset+uint32(i)] = Reference(0) - } - } else { - for i, init := range elem.Init { - if init == ElementInitNullReference { - continue - } - - var ref Reference - if index, ok := unwrapElementInitGlobalReference(init); ok { - global := m.Globals[index] - ref = Reference(global.Val) - } else { - ref = m.Engine.FunctionInstanceReference(index) - } - references[offset+uint32(i)] = ref - } - } - } -} - -// validateData ensures that data segments are valid in terms of memory boundary. -// Note: this is used only when bulk-memory/reference type feature is disabled. -func (m *ModuleInstance) validateData(data []DataSegment) (err error) { - for i := range data { - d := &data[i] - if !d.IsPassive() { - offset := int(executeConstExpressionI32(m.Globals, &d.OffsetExpression)) - ceil := offset + len(d.Init) - if offset < 0 || ceil > len(m.MemoryInstance.Buffer) { - return fmt.Errorf("%s[%d]: out of bounds memory access", SectionIDName(SectionIDData), i) - } - } - } - return -} - -// applyData uses the given data segments and mutate the memory according to the initial contents on it -// and populate the `DataInstances`. This is called after all the validation phase passes and out of -// bounds memory access error here is not a validation error, but rather a runtime error. -func (m *ModuleInstance) applyData(data []DataSegment) error { - m.DataInstances = make([][]byte, len(data)) - for i := range data { - d := &data[i] - m.DataInstances[i] = d.Init - if !d.IsPassive() { - offset := executeConstExpressionI32(m.Globals, &d.OffsetExpression) - if offset < 0 || int(offset)+len(d.Init) > len(m.MemoryInstance.Buffer) { - return fmt.Errorf("%s[%d]: out of bounds memory access", SectionIDName(SectionIDData), i) - } - copy(m.MemoryInstance.Buffer[offset:], d.Init) - } - } - return nil -} - -// GetExport returns an export of the given name and type or errs if not exported or the wrong type. -func (m *ModuleInstance) getExport(name string, et ExternType) (*Export, error) { - exp, ok := m.Exports[name] - if !ok { - return nil, fmt.Errorf("%q is not exported in module %q", name, m.ModuleName) - } - if exp.Type != et { - return nil, fmt.Errorf("export %q in module %q is a %s, not a %s", name, m.ModuleName, ExternTypeName(exp.Type), ExternTypeName(et)) - } - return exp, nil -} - -func NewStore(enabledFeatures api.CoreFeatures, engine Engine) *Store { - return &Store{ - nameToModule: map[string]*ModuleInstance{}, - nameToModuleCap: nameToModuleShrinkThreshold, - EnabledFeatures: enabledFeatures, - Engine: engine, - typeIDs: map[string]FunctionTypeID{}, - functionMaxTypes: maximumFunctionTypes, - } -} - -// Instantiate uses name instead of the Module.NameSection ModuleName as it allows instantiating the same module under -// different names safely and concurrently. -// -// * ctx: the default context used for function calls. -// * name: the name of the module. -// * sys: the system context, which will be closed (SysContext.Close) on ModuleInstance.Close. -// -// Note: Module.Validate must be called prior to instantiation. -func (s *Store) Instantiate( - ctx context.Context, - module *Module, - name string, - sys *internalsys.Context, - typeIDs []FunctionTypeID, -) (*ModuleInstance, error) { - // Instantiate the module and add it to the store so that other modules can import it. - m, err := s.instantiate(ctx, module, name, sys, typeIDs) - if err != nil { - return nil, err - } - - // Now that the instantiation is complete without error, add it. - if err = s.registerModule(m); err != nil { - _ = m.Close(ctx) - return nil, err - } - return m, nil -} - -func (s *Store) instantiate( - ctx context.Context, - module *Module, - name string, - sysCtx *internalsys.Context, - typeIDs []FunctionTypeID, -) (m *ModuleInstance, err error) { - m = &ModuleInstance{ModuleName: name, TypeIDs: typeIDs, Sys: sysCtx, s: s, Source: module} - - m.Tables = make([]*TableInstance, int(module.ImportTableCount)+len(module.TableSection)) - m.Globals = make([]*GlobalInstance, int(module.ImportGlobalCount)+len(module.GlobalSection)) - m.Engine, err = s.Engine.NewModuleEngine(module, m) - if err != nil { - return nil, err - } - - if err = m.resolveImports(module); err != nil { - return nil, err - } - - err = m.buildTables(module, - // As of reference-types proposal, boundary check must be done after instantiation. - s.EnabledFeatures.IsEnabled(api.CoreFeatureReferenceTypes)) - if err != nil { - return nil, err - } - - m.buildGlobals(module, m.Engine.FunctionInstanceReference) - m.buildMemory(module) - m.Exports = module.Exports - - // As of reference types proposal, data segment validation must happen after instantiation, - // and the side effect must persist even if there's out of bounds error after instantiation. - // https://github.com/WebAssembly/spec/blob/d39195773112a22b245ffbe864bab6d1182ccb06/test/core/linking.wast#L395-L405 - if !s.EnabledFeatures.IsEnabled(api.CoreFeatureReferenceTypes) { - if err = m.validateData(module.DataSection); err != nil { - return nil, err - } - } - - // After engine creation, we can create the funcref element instances and initialize funcref type globals. - m.buildElementInstances(module.ElementSection) - - // Now all the validation passes, we are safe to mutate memory instances (possibly imported ones). - if err = m.applyData(module.DataSection); err != nil { - return nil, err - } - - m.applyElements(module.ElementSection) - - // Execute the start function. - if module.StartSection != nil { - funcIdx := *module.StartSection - ce := m.Engine.NewFunction(funcIdx) - _, err = ce.Call(ctx) - if exitErr, ok := err.(*sys.ExitError); ok { // Don't wrap an exit error! - return nil, exitErr - } else if err != nil { - return nil, fmt.Errorf("start %s failed: %w", module.funcDesc(SectionIDFunction, funcIdx), err) - } - } - return -} - -func (m *ModuleInstance) resolveImports(module *Module) (err error) { - for moduleName, imports := range module.ImportPerModule { - var importedModule *ModuleInstance - importedModule, err = m.s.module(moduleName) - if err != nil { - return err - } - - for _, i := range imports { - var imported *Export - imported, err = importedModule.getExport(i.Name, i.Type) - if err != nil { - return - } - - switch i.Type { - case ExternTypeFunc: - expectedType := &module.TypeSection[i.DescFunc] - src := importedModule.Source - actual := src.typeOfFunction(imported.Index) - if !actual.EqualsSignature(expectedType.Params, expectedType.Results) { - err = errorInvalidImport(i, fmt.Errorf("signature mismatch: %s != %s", expectedType, actual)) - return - } - - m.Engine.ResolveImportedFunction(i.IndexPerType, imported.Index, importedModule.Engine) - case ExternTypeTable: - expected := i.DescTable - importedTable := importedModule.Tables[imported.Index] - if expected.Type != importedTable.Type { - err = errorInvalidImport(i, fmt.Errorf("table type mismatch: %s != %s", - RefTypeName(expected.Type), RefTypeName(importedTable.Type))) - return - } - - if expected.Min > importedTable.Min { - err = errorMinSizeMismatch(i, expected.Min, importedTable.Min) - return - } - - if expected.Max != nil { - expectedMax := *expected.Max - if importedTable.Max == nil { - err = errorNoMax(i, expectedMax) - return - } else if expectedMax < *importedTable.Max { - err = errorMaxSizeMismatch(i, expectedMax, *importedTable.Max) - return - } - } - m.Tables[i.IndexPerType] = importedTable - case ExternTypeMemory: - expected := i.DescMem - importedMemory := importedModule.MemoryInstance - - if expected.Min > memoryBytesNumToPages(uint64(len(importedMemory.Buffer))) { - err = errorMinSizeMismatch(i, expected.Min, importedMemory.Min) - return - } - - if expected.Max < importedMemory.Max { - err = errorMaxSizeMismatch(i, expected.Max, importedMemory.Max) - return - } - m.MemoryInstance = importedMemory - case ExternTypeGlobal: - expected := i.DescGlobal - importedGlobal := importedModule.Globals[imported.Index] - - if expected.Mutable != importedGlobal.Type.Mutable { - err = errorInvalidImport(i, fmt.Errorf("mutability mismatch: %t != %t", - expected.Mutable, importedGlobal.Type.Mutable)) - return - } - - if expected.ValType != importedGlobal.Type.ValType { - err = errorInvalidImport(i, fmt.Errorf("value type mismatch: %s != %s", - ValueTypeName(expected.ValType), ValueTypeName(importedGlobal.Type.ValType))) - return - } - m.Globals[i.IndexPerType] = importedGlobal - } - } - } - return -} - -func errorMinSizeMismatch(i *Import, expected, actual uint32) error { - return errorInvalidImport(i, fmt.Errorf("minimum size mismatch: %d > %d", expected, actual)) -} - -func errorNoMax(i *Import, expected uint32) error { - return errorInvalidImport(i, fmt.Errorf("maximum size mismatch: %d, but actual has no max", expected)) -} - -func errorMaxSizeMismatch(i *Import, expected, actual uint32) error { - return errorInvalidImport(i, fmt.Errorf("maximum size mismatch: %d < %d", expected, actual)) -} - -func errorInvalidImport(i *Import, err error) error { - return fmt.Errorf("import %s[%s.%s]: %w", ExternTypeName(i.Type), i.Module, i.Name, err) -} - -// executeConstExpressionI32 executes the ConstantExpression which returns ValueTypeI32. -// The validity of the expression is ensured when calling this function as this is only called -// during instantiation phrase, and the validation happens in compilation (validateConstExpression). -func executeConstExpressionI32(importedGlobals []*GlobalInstance, expr *ConstantExpression) (ret int32) { - switch expr.Opcode { - case OpcodeI32Const: - ret, _, _ = leb128.LoadInt32(expr.Data) - case OpcodeGlobalGet: - id, _, _ := leb128.LoadUint32(expr.Data) - g := importedGlobals[id] - ret = int32(g.Val) - } - return -} - -// initialize initializes the value of this global instance given the const expr and imported globals. -// funcRefResolver is called to get the actual funcref (engine specific) from the OpcodeRefFunc const expr. -// -// Global initialization constant expression can only reference the imported globals. -// See the note on https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#constant-expressions%E2%91%A0 -func (g *GlobalInstance) initialize(importedGlobals []*GlobalInstance, expr *ConstantExpression, funcRefResolver func(funcIndex Index) Reference) { - switch expr.Opcode { - case OpcodeI32Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - v, _, _ := leb128.LoadInt32(expr.Data) - g.Val = uint64(uint32(v)) - case OpcodeI64Const: - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - v, _, _ := leb128.LoadInt64(expr.Data) - g.Val = uint64(v) - case OpcodeF32Const: - g.Val = uint64(binary.LittleEndian.Uint32(expr.Data)) - case OpcodeF64Const: - g.Val = binary.LittleEndian.Uint64(expr.Data) - case OpcodeGlobalGet: - id, _, _ := leb128.LoadUint32(expr.Data) - importedG := importedGlobals[id] - switch importedG.Type.ValType { - case ValueTypeI32: - g.Val = uint64(uint32(importedG.Val)) - case ValueTypeI64: - g.Val = importedG.Val - case ValueTypeF32: - g.Val = importedG.Val - case ValueTypeF64: - g.Val = importedG.Val - case ValueTypeV128: - g.Val, g.ValHi = importedG.Val, importedG.ValHi - case ValueTypeFuncref, ValueTypeExternref: - g.Val = importedG.Val - } - case OpcodeRefNull: - switch expr.Data[0] { - case ValueTypeExternref, ValueTypeFuncref: - g.Val = 0 // Reference types are opaque 64bit pointer at runtime. - } - case OpcodeRefFunc: - v, _, _ := leb128.LoadUint32(expr.Data) - g.Val = uint64(funcRefResolver(v)) - case OpcodeVecV128Const: - g.Val, g.ValHi = binary.LittleEndian.Uint64(expr.Data[0:8]), binary.LittleEndian.Uint64(expr.Data[8:16]) - } -} - -// String implements api.Global. -func (g *GlobalInstance) String() string { - switch g.Type.ValType { - case ValueTypeI32, ValueTypeI64: - return fmt.Sprintf("global(%d)", g.Val) - case ValueTypeF32: - return fmt.Sprintf("global(%f)", api.DecodeF32(g.Val)) - case ValueTypeF64: - return fmt.Sprintf("global(%f)", api.DecodeF64(g.Val)) - default: - panic(fmt.Errorf("BUG: unknown value type %X", g.Type.ValType)) - } -} - -func (s *Store) GetFunctionTypeIDs(ts []FunctionType) ([]FunctionTypeID, error) { - ret := make([]FunctionTypeID, len(ts)) - for i := range ts { - t := &ts[i] - inst, err := s.GetFunctionTypeID(t) - if err != nil { - return nil, err - } - ret[i] = inst - } - return ret, nil -} - -func (s *Store) GetFunctionTypeID(t *FunctionType) (FunctionTypeID, error) { - s.mux.RLock() - key := t.key() - id, ok := s.typeIDs[key] - s.mux.RUnlock() - if !ok { - s.mux.Lock() - defer s.mux.Unlock() - // Check again in case another goroutine has already added the type. - if id, ok = s.typeIDs[key]; ok { - return id, nil - } - l := len(s.typeIDs) - if uint32(l) >= s.functionMaxTypes { - return 0, fmt.Errorf("too many function types in a store") - } - id = FunctionTypeID(l) - s.typeIDs[key] = id - } - return id, nil -} - -// CloseWithExitCode implements the same method as documented on wazero.Runtime. -func (s *Store) CloseWithExitCode(ctx context.Context, exitCode uint32) (err error) { - s.mux.Lock() - defer s.mux.Unlock() - // Close modules in reverse initialization order. - for m := s.moduleList; m != nil; m = m.next { - // If closing this module errs, proceed anyway to close the others. - if e := m.closeWithExitCode(ctx, exitCode); e != nil && err == nil { - // TODO: use multiple errors handling in Go 1.20. - err = e // first error - } - } - s.moduleList = nil - s.nameToModule = nil - s.nameToModuleCap = 0 - s.typeIDs = nil - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go deleted file mode 100644 index 17c63e38e6..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/store_module_list.go +++ /dev/null @@ -1,97 +0,0 @@ -package wasm - -import ( - "errors" - "fmt" - - "github.com/tetratelabs/wazero/api" -) - -// deleteModule makes the moduleName available for instantiation again. -func (s *Store) deleteModule(m *ModuleInstance) error { - s.mux.Lock() - defer s.mux.Unlock() - - // Remove this module name. - if m.prev != nil { - m.prev.next = m.next - } - if m.next != nil { - m.next.prev = m.prev - } - if s.moduleList == m { - s.moduleList = m.next - } - // Clear the m state so it does not enter any other branch - // on subsequent calls to deleteModule. - m.prev = nil - m.next = nil - - if m.ModuleName != "" { - delete(s.nameToModule, m.ModuleName) - - // Shrink the map if it's allocated more than twice the size of the list - newCap := len(s.nameToModule) - if newCap < nameToModuleShrinkThreshold { - newCap = nameToModuleShrinkThreshold - } - if newCap*2 <= s.nameToModuleCap { - nameToModule := make(map[string]*ModuleInstance, newCap) - for k, v := range s.nameToModule { - nameToModule[k] = v - } - s.nameToModule = nameToModule - s.nameToModuleCap = newCap - } - } - return nil -} - -// module returns the module of the given name or error if not in this store -func (s *Store) module(moduleName string) (*ModuleInstance, error) { - s.mux.RLock() - defer s.mux.RUnlock() - m, ok := s.nameToModule[moduleName] - if !ok { - return nil, fmt.Errorf("module[%s] not instantiated", moduleName) - } - return m, nil -} - -// registerModule registers a ModuleInstance into the store. -// This makes the ModuleInstance visible for import if it's not anonymous, and ensures it is closed when the store is. -func (s *Store) registerModule(m *ModuleInstance) error { - s.mux.Lock() - defer s.mux.Unlock() - - if s.nameToModule == nil { - return errors.New("already closed") - } - - if m.ModuleName != "" { - if _, ok := s.nameToModule[m.ModuleName]; ok { - return fmt.Errorf("module[%s] has already been instantiated", m.ModuleName) - } - s.nameToModule[m.ModuleName] = m - if len(s.nameToModule) > s.nameToModuleCap { - s.nameToModuleCap = len(s.nameToModule) - } - } - - // Add the newest node to the moduleNamesList as the head. - m.next = s.moduleList - if m.next != nil { - m.next.prev = m - } - s.moduleList = m - return nil -} - -// Module implements wazero.Runtime Module -func (s *Store) Module(moduleName string) api.Module { - m, err := s.module(moduleName) - if err != nil { - return nil - } - return m -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasm/table.go b/vendor/github.com/tetratelabs/wazero/internal/wasm/table.go deleted file mode 100644 index b202e8af0f..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasm/table.go +++ /dev/null @@ -1,340 +0,0 @@ -package wasm - -import ( - "fmt" - "math" - "sync" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" -) - -// Table describes the limits of elements and its type in a table. -type Table struct { - Min uint32 - Max *uint32 - Type RefType -} - -// RefType is either RefTypeFuncref or RefTypeExternref as of WebAssembly core 2.0. -type RefType = byte - -const ( - // RefTypeFuncref represents a reference to a function. - RefTypeFuncref = ValueTypeFuncref - // RefTypeExternref represents a reference to a host object, which is not currently supported in wazero. - RefTypeExternref = ValueTypeExternref -) - -func RefTypeName(t RefType) (ret string) { - switch t { - case RefTypeFuncref: - ret = "funcref" - case RefTypeExternref: - ret = "externref" - default: - ret = fmt.Sprintf("unknown(0x%x)", t) - } - return -} - -// ElementMode represents a mode of element segment which is either active, passive or declarative. -// -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/syntax/modules.html#element-segments -type ElementMode = byte - -const ( - // ElementModeActive is the mode which requires the runtime to initialize table with the contents in .Init field combined with OffsetExpr. - ElementModeActive ElementMode = iota - // ElementModePassive is the mode which doesn't require the runtime to initialize table, and only used with OpcodeTableInitName. - ElementModePassive - // ElementModeDeclarative is introduced in reference-types proposal which can be used to declare function indexes used by OpcodeRefFunc. - ElementModeDeclarative -) - -// ElementSegment are initialization instructions for a TableInstance -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#syntax-elem -type ElementSegment struct { - // OffsetExpr returns the table element offset to apply to Init indices. - // Note: This can be validated prior to instantiation unless it includes OpcodeGlobalGet (an imported global). - OffsetExpr ConstantExpression - - // TableIndex is the table's index to which this element segment is applied. - // Note: This is used if and only if the Mode is active. - TableIndex Index - - // Followings are set/used regardless of the Mode. - - // Init indices are (nullable) table elements where each index is the function index by which the module initialize the table. - Init []Index - - // Type holds the type of this element segment, which is the RefType in WebAssembly 2.0. - Type RefType - - // Mode is the mode of this element segment. - Mode ElementMode -} - -const ( - // ElementInitNullReference represents the null reference in ElementSegment's Init. - // In Wasm spec, an init item represents either Function's Index or null reference, - // and in wazero, we limit the maximum number of functions available in a module to - // MaximumFunctionIndex. Therefore, it is safe to use 1 << 31 to represent the null - // reference in Element segments. - ElementInitNullReference Index = 1 << 31 - // ElementInitImportedGlobalFunctionReference represents an init item which is resolved via an imported global constexpr. - // The actual function reference stored at Global is only known at instantiation-time, so we set this flag - // to items of ElementSegment.Init at binary decoding, and unwrap this flag at instantiation to resolve the value. - // - // This might collide the init element resolved via ref.func instruction which is resolved with the func index at decoding, - // but in practice, that is not allowed in wazero thanks to our limit MaximumFunctionIndex. Thus, it is safe to set this flag - // in init element to indicate as such. - ElementInitImportedGlobalFunctionReference Index = 1 << 30 -) - -// unwrapElementInitGlobalReference takes an item of the init vector of an ElementSegment, -// and returns the Global index if it is supposed to get generated from a global. -// ok is true if the given init item is as such. -func unwrapElementInitGlobalReference(init Index) (_ Index, ok bool) { - if init&ElementInitImportedGlobalFunctionReference == ElementInitImportedGlobalFunctionReference { - return init &^ ElementInitImportedGlobalFunctionReference, true - } - return init, false -} - -// IsActive returns true if the element segment is "active" mode which requires the runtime to initialize table -// with the contents in .Init field. -func (e *ElementSegment) IsActive() bool { - return e.Mode == ElementModeActive -} - -// TableInstance represents a table of (RefTypeFuncref) elements in a module. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#table-instances%E2%91%A0 -type TableInstance struct { - // References holds references whose type is either RefTypeFuncref or RefTypeExternref (unsupported). - // - // Currently, only function references are supported. - References []Reference - - // Min is the minimum (function) elements in this table and cannot grow to accommodate ElementSegment. - Min uint32 - - // Max if present is the maximum (function) elements in this table, or nil if unbounded. - Max *uint32 - - // Type is either RefTypeFuncref or RefTypeExternRef. - Type RefType - - // mux is used to prevent overlapping calls to Grow. - mux sync.RWMutex -} - -// ElementInstance represents an element instance in a module. -// -// See https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/runtime.html#element-instances -type ElementInstance struct { - // References holds references whose type is either RefTypeFuncref or RefTypeExternref (unsupported). - References []Reference - // Type is the RefType of the references in this instance's References. - Type RefType -} - -// Reference is the runtime representation of RefType which is either RefTypeFuncref or RefTypeExternref. -type Reference = uintptr - -// validateTable ensures any ElementSegment is valid. This caches results via Module.validatedActiveElementSegments. -// Note: limitsType are validated by decoders, so not re-validated here. -func (m *Module) validateTable(enabledFeatures api.CoreFeatures, tables []Table, maximumTableIndex uint32) error { - if len(tables) > int(maximumTableIndex) { - return fmt.Errorf("too many tables in a module: %d given with limit %d", len(tables), maximumTableIndex) - } - - importedTableCount := m.ImportTableCount - - // Create bounds checks as these can err prior to instantiation - funcCount := m.ImportFunctionCount + m.SectionElementCount(SectionIDFunction) - globalsCount := m.ImportGlobalCount + m.SectionElementCount(SectionIDGlobal) - - // Now, we have to figure out which table elements can be resolved before instantiation and also fail early if there - // are any imported globals that are known to be invalid by their declarations. - for i := range m.ElementSection { - elem := &m.ElementSection[i] - idx := Index(i) - initCount := uint32(len(elem.Init)) - - if elem.Type == RefTypeFuncref { - // Any offset applied is to the element, not the function index: validate here if the funcidx is sound. - for ei, init := range elem.Init { - if init == ElementInitNullReference { - continue - } - index, ok := unwrapElementInitGlobalReference(init) - if ok { - if index >= globalsCount { - return fmt.Errorf("%s[%d].init[%d] globalidx %d out of range", SectionIDName(SectionIDElement), idx, ei, index) - } - } else { - if index >= funcCount { - return fmt.Errorf("%s[%d].init[%d] funcidx %d out of range", SectionIDName(SectionIDElement), idx, ei, index) - } - } - } - } else { - for j, elem := range elem.Init { - if elem != ElementInitNullReference { - return fmt.Errorf("%s[%d].init[%d] must be ref.null but was %v", SectionIDName(SectionIDElement), idx, j, elem) - } - } - } - - if elem.IsActive() { - if len(tables) <= int(elem.TableIndex) { - return fmt.Errorf("unknown table %d as active element target", elem.TableIndex) - } - - t := tables[elem.TableIndex] - if t.Type != elem.Type { - return fmt.Errorf("element type mismatch: table has %s but element has %s", - RefTypeName(t.Type), RefTypeName(elem.Type), - ) - } - - // global.get needs to be discovered during initialization - oc := elem.OffsetExpr.Opcode - if oc == OpcodeGlobalGet { - globalIdx, _, err := leb128.LoadUint32(elem.OffsetExpr.Data) - if err != nil { - return fmt.Errorf("%s[%d] couldn't read global.get parameter: %w", SectionIDName(SectionIDElement), idx, err) - } else if err = m.verifyImportGlobalI32(SectionIDElement, idx, globalIdx); err != nil { - return err - } - } else if oc == OpcodeI32Const { - // Per https://github.com/WebAssembly/spec/blob/wg-1.0/test/core/elem.wast#L117 we must pass if imported - // table has set its min=0. Per https://github.com/WebAssembly/spec/blob/wg-1.0/test/core/elem.wast#L142, we - // have to do fail if module-defined min=0. - if !enabledFeatures.IsEnabled(api.CoreFeatureReferenceTypes) && elem.TableIndex >= importedTableCount { - // Treat constants as signed as their interpretation is not yet known per /RATIONALE.md - o, _, err := leb128.LoadInt32(elem.OffsetExpr.Data) - if err != nil { - return fmt.Errorf("%s[%d] couldn't read i32.const parameter: %w", SectionIDName(SectionIDElement), idx, err) - } - offset := Index(o) - if err = checkSegmentBounds(t.Min, uint64(initCount)+uint64(offset), idx); err != nil { - return err - } - } - } else { - return fmt.Errorf("%s[%d] has an invalid const expression: %s", SectionIDName(SectionIDElement), idx, InstructionName(oc)) - } - } - } - return nil -} - -// buildTable returns TableInstances if the module defines or imports a table. -// - importedTables: returned as `tables` unmodified. -// - importedGlobals: include all instantiated, imported globals. -// -// If the result `init` is non-nil, it is the `tableInit` parameter of Engine.NewModuleEngine. -// -// Note: An error is only possible when an ElementSegment.OffsetExpr is out of range of the TableInstance.Min. -func (m *ModuleInstance) buildTables(module *Module, skipBoundCheck bool) (err error) { - idx := module.ImportTableCount - for i := range module.TableSection { - tsec := &module.TableSection[i] - // The module defining the table is the one that sets its Min/Max etc. - m.Tables[idx] = &TableInstance{ - References: make([]Reference, tsec.Min), Min: tsec.Min, Max: tsec.Max, - Type: tsec.Type, - } - idx++ - } - - if !skipBoundCheck { - for elemI := range module.ElementSection { // Do not loop over the value since elementSegments is a slice of value. - elem := &module.ElementSection[elemI] - table := m.Tables[elem.TableIndex] - var offset uint32 - if elem.OffsetExpr.Opcode == OpcodeGlobalGet { - // Ignore error as it's already validated. - globalIdx, _, _ := leb128.LoadUint32(elem.OffsetExpr.Data) - global := m.Globals[globalIdx] - offset = uint32(global.Val) - } else { // i32.const - // Ignore error as it's already validated. - o, _, _ := leb128.LoadInt32(elem.OffsetExpr.Data) - offset = uint32(o) - } - - // Check to see if we are out-of-bounds - initCount := uint64(len(elem.Init)) - if err = checkSegmentBounds(table.Min, uint64(offset)+initCount, Index(elemI)); err != nil { - return - } - } - } - return -} - -// checkSegmentBounds fails if the capacity needed for an ElementSegment.Init is larger than limitsType.Min -// -// WebAssembly 1.0 (20191205) doesn't forbid growing to accommodate element segments, and spectests are inconsistent. -// For example, the spectests enforce elements within Table limitsType.Min, but ignore Import.DescTable min. What this -// means is we have to delay offset checks on imported tables until we link to them. -// e.g. https://github.com/WebAssembly/spec/blob/wg-1.0/test/core/elem.wast#L117 wants pass on min=0 for import -// e.g. https://github.com/WebAssembly/spec/blob/wg-1.0/test/core/elem.wast#L142 wants fail on min=0 module-defined -func checkSegmentBounds(min uint32, requireMin uint64, idx Index) error { // uint64 in case offset was set to -1 - if requireMin > uint64(min) { - return fmt.Errorf("%s[%d].init exceeds min table size", SectionIDName(SectionIDElement), idx) - } - return nil -} - -func (m *Module) verifyImportGlobalI32(sectionID SectionID, sectionIdx Index, idx uint32) error { - ig := uint32(math.MaxUint32) // +1 == 0 - for i := range m.ImportSection { - imp := &m.ImportSection[i] - if imp.Type == ExternTypeGlobal { - ig++ - if ig == idx { - if imp.DescGlobal.ValType != ValueTypeI32 { - return fmt.Errorf("%s[%d] (global.get %d): import[%d].global.ValType != i32", SectionIDName(sectionID), sectionIdx, idx, i) - } - return nil - } - } - } - return fmt.Errorf("%s[%d] (global.get %d): out of range of imported globals", SectionIDName(sectionID), sectionIdx, idx) -} - -// Grow appends the `initialRef` by `delta` times into the References slice. -// Returns -1 if the operation is not valid, otherwise the old length of the table. -// -// https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/instructions.html#xref-syntax-instructions-syntax-instr-table-mathsf-table-grow-x -func (t *TableInstance) Grow(delta uint32, initialRef Reference) (currentLen uint32) { - // We take write-lock here as the following might result in a new slice - t.mux.Lock() - defer t.mux.Unlock() - - currentLen = uint32(len(t.References)) - if delta == 0 { - return - } - - if newLen := int64(currentLen) + int64(delta); // adding as 64bit ints to avoid overflow. - newLen >= math.MaxUint32 || (t.Max != nil && newLen > int64(*t.Max)) { - return 0xffffffff // = -1 in signed 32-bit integer. - } - t.References = append(t.References, make([]uintptr, delta)...) - - // Uses the copy trick for faster filling the new region with the initial value. - // https://gist.github.com/taylorza/df2f89d5f9ab3ffd06865062a4cf015d - newRegion := t.References[currentLen:] - newRegion[0] = initialRef - for i := 1; i < len(newRegion); i *= 2 { - copy(newRegion[i:], newRegion[:i]) - } - return -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go b/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go deleted file mode 100644 index 0aa6136959..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/debug.go +++ /dev/null @@ -1,157 +0,0 @@ -// Package wasmdebug contains utilities used to give consistent search keys between stack traces and error messages. -// Note: This is named wasmdebug to avoid conflicts with the normal go module. -// Note: This only imports "api" as importing "wasm" would create a cyclic dependency. -package wasmdebug - -import ( - "fmt" - "runtime" - "runtime/debug" - "strconv" - "strings" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/wasmruntime" - "github.com/tetratelabs/wazero/sys" -) - -// FuncName returns the naming convention of "moduleName.funcName". -// -// - moduleName is the possibly empty name the module was instantiated with. -// - funcName is the name in the Custom Name section. -// - funcIdx is the position in the function index, prefixed with -// imported functions. -// -// Note: "moduleName.$funcIdx" is used when the funcName is empty, as commonly -// the case in TinyGo. -func FuncName(moduleName, funcName string, funcIdx uint32) string { - var ret strings.Builder - - // Start module.function - ret.WriteString(moduleName) - ret.WriteByte('.') - if funcName == "" { - ret.WriteByte('$') - ret.WriteString(strconv.Itoa(int(funcIdx))) - } else { - ret.WriteString(funcName) - } - - return ret.String() -} - -// signature returns a formatted signature similar to how it is defined in Go. -// -// * paramTypes should be from wasm.FunctionType -// * resultTypes should be from wasm.FunctionType -// TODO: add paramNames -func signature(funcName string, paramTypes []api.ValueType, resultTypes []api.ValueType) string { - var ret strings.Builder - ret.WriteString(funcName) - - // Start params - ret.WriteByte('(') - paramCount := len(paramTypes) - switch paramCount { - case 0: - case 1: - ret.WriteString(api.ValueTypeName(paramTypes[0])) - default: - ret.WriteString(api.ValueTypeName(paramTypes[0])) - for _, vt := range paramTypes[1:] { - ret.WriteByte(',') - ret.WriteString(api.ValueTypeName(vt)) - } - } - ret.WriteByte(')') - - // Start results - resultCount := len(resultTypes) - switch resultCount { - case 0: - case 1: - ret.WriteByte(' ') - ret.WriteString(api.ValueTypeName(resultTypes[0])) - default: // As this is used for errors, don't panic if there are multiple returns, even if that's invalid! - ret.WriteByte(' ') - ret.WriteByte('(') - ret.WriteString(api.ValueTypeName(resultTypes[0])) - for _, vt := range resultTypes[1:] { - ret.WriteByte(',') - ret.WriteString(api.ValueTypeName(vt)) - } - ret.WriteByte(')') - } - - return ret.String() -} - -// ErrorBuilder helps build consistent errors, particularly adding a WASM stack trace. -// -// AddFrame should be called beginning at the frame that panicked until no more frames exist. Once done, call Format. -type ErrorBuilder interface { - // AddFrame adds the next frame. - // - // * funcName should be from FuncName - // * paramTypes should be from wasm.FunctionType - // * resultTypes should be from wasm.FunctionType - // * sources is the source code information for this frame and can be empty. - // - // Note: paramTypes and resultTypes are present because signature misunderstanding, mismatch or overflow are common. - AddFrame(funcName string, paramTypes, resultTypes []api.ValueType, sources []string) - - // FromRecovered returns an error with the wasm stack trace appended to it. - FromRecovered(recovered interface{}) error -} - -func NewErrorBuilder() ErrorBuilder { - return &stackTrace{} -} - -type stackTrace struct { - frames []string -} - -// GoRuntimeErrorTracePrefix is the prefix coming before the Go runtime stack trace included in the face of runtime.Error. -// This is exported for testing purpose. -const GoRuntimeErrorTracePrefix = "Go runtime stack trace:" - -func (s *stackTrace) FromRecovered(recovered interface{}) error { - if false { - debug.PrintStack() - } - - if exitErr, ok := recovered.(*sys.ExitError); ok { // Don't wrap an exit error! - return exitErr - } - - stack := strings.Join(s.frames, "\n\t") - - // If the error was internal, don't mention it was recovered. - if wasmErr, ok := recovered.(*wasmruntime.Error); ok { - return fmt.Errorf("wasm error: %w\nwasm stack trace:\n\t%s", wasmErr, stack) - } - - // If we have a runtime.Error, something severe happened which should include the stack trace. This could be - // a nil pointer from wazero or a user-defined function from HostModuleBuilder. - if runtimeErr, ok := recovered.(runtime.Error); ok { - return fmt.Errorf("%w (recovered by wazero)\nwasm stack trace:\n\t%s\n\n%s\n%s", - runtimeErr, stack, GoRuntimeErrorTracePrefix, debug.Stack()) - } - - // At this point we expect the error was from a function defined by HostModuleBuilder that intentionally called panic. - if runtimeErr, ok := recovered.(error); ok { // e.g. panic(errors.New("whoops")) - return fmt.Errorf("%w (recovered by wazero)\nwasm stack trace:\n\t%s", runtimeErr, stack) - } else { // e.g. panic("whoops") - return fmt.Errorf("%v (recovered by wazero)\nwasm stack trace:\n\t%s", recovered, stack) - } -} - -// AddFrame implements ErrorBuilder.AddFrame -func (s *stackTrace) AddFrame(funcName string, paramTypes, resultTypes []api.ValueType, sources []string) { - sig := signature(funcName, paramTypes, resultTypes) - s.frames = append(s.frames, sig) - for _, source := range sources { - s.frames = append(s.frames, "\t"+source) - } -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go b/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go deleted file mode 100644 index 3b0d3a7a62..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasmdebug/dwarf.go +++ /dev/null @@ -1,226 +0,0 @@ -package wasmdebug - -import ( - "debug/dwarf" - "errors" - "fmt" - "io" - "sort" - "strings" - "sync" -) - -// DWARFLines is used to retrieve source code line information from the DWARF data. -type DWARFLines struct { - // d is created by DWARF custom sections. - d *dwarf.Data - // linesPerEntry maps dwarf.Offset for dwarf.Entry to the list of lines contained by the entry. - // The value is sorted in the increasing order by the address. - linesPerEntry map[dwarf.Offset][]line - mux sync.Mutex -} - -type line struct { - addr uint64 - pos dwarf.LineReaderPos -} - -// NewDWARFLines returns DWARFLines for the given *dwarf.Data. -func NewDWARFLines(d *dwarf.Data) *DWARFLines { - if d == nil { - return nil - } - return &DWARFLines{d: d, linesPerEntry: map[dwarf.Offset][]line{}} -} - -// isTombstoneAddr returns true if the given address is invalid a.k.a tombstone address which was made no longer valid -// by linker. According to the DWARF spec[1], the value is encoded as 0xffffffff for Wasm (as 32-bit target), -// but some tools encode it either in -1, -2 [2] or 1<<32 (This might not be by tools, but by debug/dwarf package's bug). -// -// [1] https://dwarfstd.org/issues/200609.1.html -// [2] https://github.com/WebAssembly/binaryen/blob/97178d08d4a20d2a5e3a6be813fc6a7079ef86e1/src/wasm/wasm-debug.cpp#L651-L660 -// [3] https://reviews.llvm.org/D81784 -func isTombstoneAddr(addr uint64) bool { - addr32 := int32(addr) - return addr32 == -1 || addr32 == -2 || - addr32 == 0 // This covers 1 <<32. -} - -// Line returns the line information for the given instructionOffset which is an offset in -// the code section of the original Wasm binary. Returns empty string if the info is not found. -func (d *DWARFLines) Line(instructionOffset uint64) (ret []string) { - if d == nil { - return - } - - // DWARFLines is created per Wasm binary, so there's a possibility that multiple instances - // created from a same binary face runtime error at the same time, and that results in - // concurrent access to this function. - d.mux.Lock() - defer d.mux.Unlock() - - r := d.d.Reader() - - var inlinedRoutines []*dwarf.Entry - var cu *dwarf.Entry - var inlinedDone bool -entry: - for { - ent, err := r.Next() - if err != nil || ent == nil { - break - } - - // If we already found the compilation unit and relevant inlined routines, we can stop searching entries. - if cu != nil && inlinedDone { - break - } - - switch ent.Tag { - case dwarf.TagCompileUnit, dwarf.TagInlinedSubroutine: - default: - // Only CompileUnit and InlinedSubroutines are relevant. - continue - } - - // Check if the entry spans the range which contains the target instruction. - ranges, err := d.d.Ranges(ent) - if err != nil { - continue - } - for _, pcs := range ranges { - start, end := pcs[0], pcs[1] - if isTombstoneAddr(start) || isTombstoneAddr(end) { - continue - } - if start <= instructionOffset && instructionOffset < end { - switch ent.Tag { - case dwarf.TagCompileUnit: - cu = ent - case dwarf.TagInlinedSubroutine: - inlinedRoutines = append(inlinedRoutines, ent) - // Search inlined subroutines until all the children. - inlinedDone = !ent.Children - // Not that "children" in the DWARF spec is defined as the next entry to this entry. - // See "2.3 Relationship of Debugging Information Entries" in https://dwarfstd.org/doc/DWARF4.pdf - } - continue entry - } - } - } - - // If the relevant compilation unit is not found, nothing we can do with this DWARF info. - if cu == nil { - return - } - - lineReader, err := d.d.LineReader(cu) - if err != nil || lineReader == nil { - return - } - var lines []line - var ok bool - var le dwarf.LineEntry - // Get the lines inside the entry. - if lines, ok = d.linesPerEntry[cu.Offset]; !ok { - // If not found, we create the list of lines by reading all the LineEntries in the Entry. - // - // Note that the dwarf.LineEntry.SeekPC API shouldn't be used because the Go's dwarf package assumes that - // all the line entries in an Entry are sorted in increasing order which *might not* be true - // for some languages. Such order requirement is not a part of DWARF specification, - // and in fact Zig language tends to emit interleaved line information. - // - // Thus, here we read all line entries here, and sort them in the increasing order wrt addresses. - for { - pos := lineReader.Tell() - err = lineReader.Next(&le) - if errors.Is(err, io.EOF) { - break - } else if err != nil { - return - } - // TODO: Maybe we should ignore tombstone addresses by using isTombstoneAddr, - // but not sure if that would be an issue in practice. - lines = append(lines, line{addr: le.Address, pos: pos}) - } - sort.Slice(lines, func(i, j int) bool { return lines[i].addr < lines[j].addr }) - d.linesPerEntry[cu.Offset] = lines // Caches for the future inquiries for the same Entry. - } - - // Now we have the lines for this entry. We can find the corresponding source line for instructionOffset - // via binary search on the list. - n := len(lines) - index := sort.Search(n, func(i int) bool { return lines[i].addr >= instructionOffset }) - - if index == n { // This case the address is not found. See the doc sort.Search. - return - } - - ln := lines[index] - if ln.addr != instructionOffset { - // If the address doesn't match exactly, the previous entry is the one that contains the instruction. - // That can happen anytime as the DWARF spec allows it, and other tools can handle it in this way conventionally - // https://github.com/gimli-rs/addr2line/blob/3a2dbaf84551a06a429f26e9c96071bb409b371f/src/lib.rs#L236-L242 - // https://github.com/kateinoigakukun/wasminspect/blob/f29f052f1b03104da9f702508ac0c1bbc3530ae4/crates/debugger/src/dwarf/mod.rs#L453-L459 - if index-1 < 0 { - return - } - ln = lines[index-1] - } - - // Advance the line reader for the found position. - lineReader.Seek(ln.pos) - err = lineReader.Next(&le) - - if err != nil { - // If we reach this block, that means there's a bug in the []line creation logic above. - panic("BUG: stored dwarf.LineReaderPos is invalid") - } - - // In the inlined case, the line info is the innermost inlined function call. - inlined := len(inlinedRoutines) != 0 - prefix := fmt.Sprintf("%#x: ", instructionOffset) - ret = append(ret, formatLine(prefix, le.File.Name, int64(le.Line), int64(le.Column), inlined)) - - if inlined { - prefix = strings.Repeat(" ", len(prefix)) - files := lineReader.Files() - // inlinedRoutines contain the inlined call information in the reverse order (children is higher than parent), - // so we traverse the reverse order and emit the inlined calls. - for i := len(inlinedRoutines) - 1; i >= 0; i-- { - inlined := inlinedRoutines[i] - fileIndex, ok := inlined.Val(dwarf.AttrCallFile).(int64) - if !ok { - return - } else if fileIndex >= int64(len(files)) { - // This in theory shouldn't happen according to the spec, but guard against ill-formed DWARF info. - return - } - fileName := files[fileIndex] - line, _ := inlined.Val(dwarf.AttrCallLine).(int64) - col, _ := inlined.Val(dwarf.AttrCallColumn).(int64) - ret = append(ret, formatLine(prefix, fileName.Name, line, col, - // Last one is the origin of the inlined function calls. - i != 0)) - } - } - return -} - -func formatLine(prefix, fileName string, line, col int64, inlined bool) string { - builder := strings.Builder{} - builder.WriteString(prefix) - builder.WriteString(fileName) - - if line != 0 { - builder.WriteString(fmt.Sprintf(":%d", line)) - if col != 0 { - builder.WriteString(fmt.Sprintf(":%d", col)) - } - } - - if inlined { - builder.WriteString(" (inlined)") - } - return builder.String() -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go b/vendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go deleted file mode 100644 index 43f951e0df..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wasmruntime/errors.go +++ /dev/null @@ -1,44 +0,0 @@ -// Package wasmruntime contains internal symbols shared between modules for error handling. -// Note: This is named wasmruntime to avoid conflicts with the normal go module. -// Note: This only imports "api" as importing "wasm" would create a cyclic dependency. -package wasmruntime - -var ( - // ErrRuntimeStackOverflow indicates that there are too many function calls, - // and the Engine terminated the execution. - ErrRuntimeStackOverflow = New("stack overflow") - // ErrRuntimeInvalidConversionToInteger indicates the Wasm function tries to - // convert NaN floating point value to integers during trunc variant instructions. - ErrRuntimeInvalidConversionToInteger = New("invalid conversion to integer") - // ErrRuntimeIntegerOverflow indicates that an integer arithmetic resulted in - // overflow value. For example, when the program tried to truncate a float value - // which doesn't fit in the range of target integer. - ErrRuntimeIntegerOverflow = New("integer overflow") - // ErrRuntimeIntegerDivideByZero indicates that an integer div or rem instructions - // was executed with 0 as the divisor. - ErrRuntimeIntegerDivideByZero = New("integer divide by zero") - // ErrRuntimeUnreachable means "unreachable" instruction was executed by the program. - ErrRuntimeUnreachable = New("unreachable") - // ErrRuntimeOutOfBoundsMemoryAccess indicates that the program tried to access the - // region beyond the linear memory. - ErrRuntimeOutOfBoundsMemoryAccess = New("out of bounds memory access") - // ErrRuntimeInvalidTableAccess means either offset to the table was out of bounds of table, or - // the target element in the table was uninitialized during call_indirect instruction. - ErrRuntimeInvalidTableAccess = New("invalid table access") - // ErrRuntimeIndirectCallTypeMismatch indicates that the type check failed during call_indirect. - ErrRuntimeIndirectCallTypeMismatch = New("indirect call type mismatch") -) - -// Error is returned by a wasm.Engine during the execution of Wasm functions, and they indicate that the Wasm runtime -// state is unrecoverable. -type Error struct { - s string -} - -func New(text string) *Error { - return &Error{s: text} -} - -func (e *Error) Error() string { - return e.s -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/compiler.go b/vendor/github.com/tetratelabs/wazero/internal/wazeroir/compiler.go deleted file mode 100644 index 47ddc92bfa..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/compiler.go +++ /dev/null @@ -1,3068 +0,0 @@ -package wazeroir - -import ( - "bytes" - "encoding/binary" - "fmt" - "math" - "strings" - - "github.com/tetratelabs/wazero/api" - "github.com/tetratelabs/wazero/internal/leb128" - "github.com/tetratelabs/wazero/internal/wasm" -) - -type controlFrameKind byte - -const ( - controlFrameKindBlockWithContinuationLabel controlFrameKind = iota - controlFrameKindBlockWithoutContinuationLabel - controlFrameKindFunction - controlFrameKindLoop - controlFrameKindIfWithElse - controlFrameKindIfWithoutElse -) - -type ( - controlFrame struct { - frameID uint32 - // originalStackLen holds the number of values on the stack - // when Start executing this control frame minus params for the block. - originalStackLenWithoutParam int - blockType *wasm.FunctionType - kind controlFrameKind - } - controlFrames struct{ frames []controlFrame } -) - -func (c *controlFrame) ensureContinuation() { - // Make sure that if the frame is block and doesn't have continuation, - // change the Kind so we can emit the continuation block - // later when we reach the End instruction of this frame. - if c.kind == controlFrameKindBlockWithoutContinuationLabel { - c.kind = controlFrameKindBlockWithContinuationLabel - } -} - -func (c *controlFrame) asLabel() Label { - switch c.kind { - case controlFrameKindBlockWithContinuationLabel, - controlFrameKindBlockWithoutContinuationLabel: - return NewLabel(LabelKindContinuation, c.frameID) - case controlFrameKindLoop: - return NewLabel(LabelKindHeader, c.frameID) - case controlFrameKindFunction: - return NewLabel(LabelKindReturn, 0) - case controlFrameKindIfWithElse, - controlFrameKindIfWithoutElse: - return NewLabel(LabelKindContinuation, c.frameID) - } - panic(fmt.Sprintf("unreachable: a bug in wazeroir implementation: %v", c.kind)) -} - -func (c *controlFrames) functionFrame() *controlFrame { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase. - return &c.frames[0] -} - -func (c *controlFrames) get(n int) *controlFrame { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase. - return &c.frames[len(c.frames)-n-1] -} - -func (c *controlFrames) top() *controlFrame { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase. - return &c.frames[len(c.frames)-1] -} - -func (c *controlFrames) empty() bool { - return len(c.frames) == 0 -} - -func (c *controlFrames) pop() (frame *controlFrame) { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase. - frame = c.top() - c.frames = c.frames[:len(c.frames)-1] - return -} - -func (c *controlFrames) push(frame controlFrame) { - c.frames = append(c.frames, frame) -} - -func (c *Compiler) initializeStack() { - // Reuse the existing slice. - c.localIndexToStackHeightInUint64 = c.localIndexToStackHeightInUint64[:0] - var current int - for _, lt := range c.sig.Params { - c.localIndexToStackHeightInUint64 = append(c.localIndexToStackHeightInUint64, current) - if lt == wasm.ValueTypeV128 { - current++ - } - current++ - } - - if c.callFrameStackSizeInUint64 > 0 { - // We reserve the stack slots for result values below the return call frame slots. - if diff := c.sig.ResultNumInUint64 - c.sig.ParamNumInUint64; diff > 0 { - current += diff - } - } - - // Non-func param locals Start after the return call frame. - current += c.callFrameStackSizeInUint64 - - for _, lt := range c.localTypes { - c.localIndexToStackHeightInUint64 = append(c.localIndexToStackHeightInUint64, current) - if lt == wasm.ValueTypeV128 { - current++ - } - current++ - } - - // Push function arguments. - for _, t := range c.sig.Params { - c.stackPush(wasmValueTypeToUnsignedType(t)) - } - - if c.callFrameStackSizeInUint64 > 0 { - // Reserve the stack slots for results. - for i := 0; i < c.sig.ResultNumInUint64-c.sig.ParamNumInUint64; i++ { - c.stackPush(UnsignedTypeI64) - } - - // Reserve the stack slots for call frame. - for i := 0; i < c.callFrameStackSizeInUint64; i++ { - c.stackPush(UnsignedTypeI64) - } - } -} - -// Compiler is in charge of lowering raw Wasm function body to get CompilationResult. -// This is created per *wasm.Module and reused for all functions in it to reduce memory allocations. -type Compiler struct { - module *wasm.Module - enabledFeatures api.CoreFeatures - callFrameStackSizeInUint64 int - stack []UnsignedType - currentFrameID uint32 - controlFrames controlFrames - unreachableState struct { - on bool - depth int - } - pc, currentOpPC uint64 - result CompilationResult - - // body holds the code for the function's body where Wasm instructions are stored. - body []byte - // sig is the function type of the target function. - sig *wasm.FunctionType - // localTypes holds the target function locals' value types except function params. - localTypes []wasm.ValueType - // localIndexToStackHeightInUint64 maps the local index (starting with function params) to the stack height - // where the local is places. This is the necessary mapping for functions who contain vector type locals. - localIndexToStackHeightInUint64 []int - - // types hold all the function types in the module where the targe function exists. - types []wasm.FunctionType - // funcs holds the type indexes for all declared functions in the module where the target function exists. - funcs []uint32 - // globals holds the global types for all declared globals in the module where the target function exists. - globals []wasm.GlobalType - - // needSourceOffset is true if this module requires DWARF based stack trace. - needSourceOffset bool - // bodyOffsetInCodeSection is the offset of the body of this function in the original Wasm binary's code section. - bodyOffsetInCodeSection uint64 - - ensureTermination bool - // Pre-allocated bytes.Reader to be used in various places. - br *bytes.Reader - funcTypeToSigs funcTypeToIRSignatures - - next int -} - -//lint:ignore U1000 for debugging only. -func (c *Compiler) stackDump() string { - strs := make([]string, 0, len(c.stack)) - for _, s := range c.stack { - strs = append(strs, s.String()) - } - return "[" + strings.Join(strs, ", ") + "]" -} - -func (c *Compiler) markUnreachable() { - c.unreachableState.on = true -} - -func (c *Compiler) resetUnreachable() { - c.unreachableState.on = false -} - -type CompilationResult struct { - // Operations holds wazeroir operations compiled from Wasm instructions in a Wasm function. - Operations []UnionOperation - - // IROperationSourceOffsetsInWasmBinary is index-correlated with Operation and maps each operation to the corresponding source instruction's - // offset in the original WebAssembly binary. - // Non nil only when the given Wasm module has the DWARF section. - IROperationSourceOffsetsInWasmBinary []uint64 - - // LabelCallers maps Label to the number of callers to that label. - // Here "callers" means that the call-sites which jumps to the label with br, br_if or br_table - // instructions. - // - // Note: zero possible and allowed in wasm. e.g. - // - // (block - // (br 0) - // (block i32.const 1111) - // ) - // - // This example the label corresponding to `(block i32.const 1111)` is never be reached at runtime because `br 0` exits the function before we reach there - LabelCallers map[Label]uint32 - // UsesMemory is true if this function might use memory. - UsesMemory bool - - // The following fields are per-module values, not per-function. - - // Globals holds all the declarations of globals in the module from which this function is compiled. - Globals []wasm.GlobalType - // Functions holds all the declarations of function in the module from which this function is compiled, including itself. - Functions []wasm.Index - // Types holds all the types in the module from which this function is compiled. - Types []wasm.FunctionType - // HasMemory is true if the module from which this function is compiled has memory declaration. - HasMemory bool - // HasTable is true if the module from which this function is compiled has table declaration. - HasTable bool - // HasDataInstances is true if the module has data instances which might be used by memory.init or data.drop instructions. - HasDataInstances bool - // HasDataInstances is true if the module has element instances which might be used by table.init or elem.drop instructions. - HasElementInstances bool -} - -// NewCompiler returns the new *Compiler for the given parameters. -// Use Compiler.Next function to get compilation result per function. -func NewCompiler(enabledFeatures api.CoreFeatures, callFrameStackSizeInUint64 int, module *wasm.Module, ensureTermination bool) (*Compiler, error) { - functions, globals, mem, tables, err := module.AllDeclarations() - if err != nil { - return nil, err - } - - hasMemory, hasTable, hasDataInstances, hasElementInstances := mem != nil, len(tables) > 0, - len(module.DataSection) > 0, len(module.ElementSection) > 0 - - types := module.TypeSection - - c := &Compiler{ - module: module, - enabledFeatures: enabledFeatures, - controlFrames: controlFrames{}, - callFrameStackSizeInUint64: callFrameStackSizeInUint64, - result: CompilationResult{ - Globals: globals, - Functions: functions, - Types: types, - HasMemory: hasMemory, - HasTable: hasTable, - HasDataInstances: hasDataInstances, - HasElementInstances: hasElementInstances, - LabelCallers: map[Label]uint32{}, - }, - globals: globals, - funcs: functions, - types: types, - ensureTermination: ensureTermination, - br: bytes.NewReader(nil), - funcTypeToSigs: funcTypeToIRSignatures{ - indirectCalls: make([]*signature, len(types)), - directCalls: make([]*signature, len(types)), - wasmTypes: types, - }, - needSourceOffset: module.DWARFLines != nil, - } - return c, nil -} - -// Next returns the next CompilationResult for this Compiler. -func (c *Compiler) Next() (*CompilationResult, error) { - funcIndex := c.next - code := &c.module.CodeSection[funcIndex] - sig := &c.types[c.module.FunctionSection[funcIndex]] - - // Reset the previous result. - c.result.Operations = c.result.Operations[:0] - c.result.IROperationSourceOffsetsInWasmBinary = c.result.IROperationSourceOffsetsInWasmBinary[:0] - c.result.UsesMemory = false - // Clears the existing entries in LabelCallers. - for frameID := uint32(0); frameID <= c.currentFrameID; frameID++ { - for k := LabelKind(0); k < LabelKindNum; k++ { - delete(c.result.LabelCallers, NewLabel(k, frameID)) - } - } - // Reset the previous states. - c.pc = 0 - c.currentOpPC = 0 - c.currentFrameID = 0 - c.unreachableState.on, c.unreachableState.depth = false, 0 - - if err := c.compile(sig, code.Body, code.LocalTypes, code.BodyOffsetInCodeSection); err != nil { - return nil, err - } - c.next++ - return &c.result, nil -} - -// Compile lowers given function instance into wazeroir operations -// so that the resulting operations can be consumed by the interpreter -// or the Compiler compilation engine. -func (c *Compiler) compile(sig *wasm.FunctionType, body []byte, localTypes []wasm.ValueType, bodyOffsetInCodeSection uint64) error { - // Set function specific fields. - c.body = body - c.localTypes = localTypes - c.sig = sig - c.bodyOffsetInCodeSection = bodyOffsetInCodeSection - - // Reuses the underlying slices. - c.stack = c.stack[:0] - c.controlFrames.frames = c.controlFrames.frames[:0] - - c.initializeStack() - - // Emit const expressions for locals. - // Note that here we don't take function arguments - // into account, meaning that callers must push - // arguments before entering into the function body. - for _, t := range c.localTypes { - c.emitDefaultValue(t) - } - - // Insert the function control frame. - c.controlFrames.push(controlFrame{ - frameID: c.nextFrameID(), - blockType: c.sig, - kind: controlFrameKindFunction, - }) - - // Now, enter the function body. - for !c.controlFrames.empty() && c.pc < uint64(len(c.body)) { - if err := c.handleInstruction(); err != nil { - return fmt.Errorf("handling instruction: %w", err) - } - } - return nil -} - -// Translate the current Wasm instruction to wazeroir's operations, -// and emit the results into c.results. -func (c *Compiler) handleInstruction() error { - op := c.body[c.pc] - c.currentOpPC = c.pc - if false { - var instName string - if op == wasm.OpcodeVecPrefix { - instName = wasm.VectorInstructionName(c.body[c.pc+1]) - } else if op == wasm.OpcodeMiscPrefix { - instName = wasm.MiscInstructionName(c.body[c.pc+1]) - } else { - instName = wasm.InstructionName(op) - } - fmt.Printf("handling %s, unreachable_state(on=%v,depth=%d), stack=%v\n", - instName, c.unreachableState.on, c.unreachableState.depth, c.stack, - ) - } - - var peekValueType UnsignedType - if len(c.stack) > 0 { - peekValueType = c.stackPeek() - } - - // Modify the stack according the current instruction. - // Note that some instructions will read "index" in - // applyToStack and advance c.pc inside the function. - index, err := c.applyToStack(op) - if err != nil { - return fmt.Errorf("apply stack failed for %s: %w", wasm.InstructionName(op), err) - } - // Now we handle each instruction, and - // emit the corresponding wazeroir operations to the results. -operatorSwitch: - switch op { - case wasm.OpcodeUnreachable: - c.emit(NewOperationUnreachable()) - c.markUnreachable() - case wasm.OpcodeNop: - // Nop is noop! - case wasm.OpcodeBlock: - c.br.Reset(c.body[c.pc+1:]) - bt, num, err := wasm.DecodeBlockType(c.types, c.br, c.enabledFeatures) - if err != nil { - return fmt.Errorf("reading block type for block instruction: %w", err) - } - c.pc += num - - if c.unreachableState.on { - // If it is currently in unreachable, - // just remove the entire block. - c.unreachableState.depth++ - break operatorSwitch - } - - // Create a new frame -- entering this block. - frame := controlFrame{ - frameID: c.nextFrameID(), - originalStackLenWithoutParam: len(c.stack) - len(bt.Params), - kind: controlFrameKindBlockWithoutContinuationLabel, - blockType: bt, - } - c.controlFrames.push(frame) - - case wasm.OpcodeLoop: - c.br.Reset(c.body[c.pc+1:]) - bt, num, err := wasm.DecodeBlockType(c.types, c.br, c.enabledFeatures) - if err != nil { - return fmt.Errorf("reading block type for loop instruction: %w", err) - } - c.pc += num - - if c.unreachableState.on { - // If it is currently in unreachable, - // just remove the entire block. - c.unreachableState.depth++ - break operatorSwitch - } - - // Create a new frame -- entering loop. - frame := controlFrame{ - frameID: c.nextFrameID(), - originalStackLenWithoutParam: len(c.stack) - len(bt.Params), - kind: controlFrameKindLoop, - blockType: bt, - } - c.controlFrames.push(frame) - - // Prep labels for inside and the continuation of this loop. - loopLabel := NewLabel(LabelKindHeader, frame.frameID) - c.result.LabelCallers[loopLabel]++ - - // Emit the branch operation to enter inside the loop. - c.emit(NewOperationBr(loopLabel)) - c.emit(NewOperationLabel(loopLabel)) - - // Insert the exit code check on the loop header, which is the only necessary point in the function body - // to prevent infinite loop. - // - // Note that this is a little aggressive: this checks the exit code regardless the loop header is actually - // the loop. In other words, this checks even when no br/br_if/br_table instructions jumping to this loop - // exist. However, in reality, that shouldn't be an issue since such "noop" loop header will highly likely be - // optimized out by almost all guest language compilers which have the control flow optimization passes. - if c.ensureTermination { - c.emit(NewOperationBuiltinFunctionCheckExitCode()) - } - case wasm.OpcodeIf: - c.br.Reset(c.body[c.pc+1:]) - bt, num, err := wasm.DecodeBlockType(c.types, c.br, c.enabledFeatures) - if err != nil { - return fmt.Errorf("reading block type for if instruction: %w", err) - } - c.pc += num - - if c.unreachableState.on { - // If it is currently in unreachable, - // just remove the entire block. - c.unreachableState.depth++ - break operatorSwitch - } - - // Create a new frame -- entering if. - frame := controlFrame{ - frameID: c.nextFrameID(), - originalStackLenWithoutParam: len(c.stack) - len(bt.Params), - // Note this will be set to controlFrameKindIfWithElse - // when else opcode found later. - kind: controlFrameKindIfWithoutElse, - blockType: bt, - } - c.controlFrames.push(frame) - - // Prep labels for if and else of this if. - thenLabel := NewLabel(LabelKindHeader, frame.frameID) - elseLabel := NewLabel(LabelKindElse, frame.frameID) - c.result.LabelCallers[thenLabel]++ - c.result.LabelCallers[elseLabel]++ - - // Emit the branch operation to enter the then block. - c.emit(NewOperationBrIf(thenLabel, elseLabel, NopInclusiveRange)) - c.emit(NewOperationLabel(thenLabel)) - case wasm.OpcodeElse: - frame := c.controlFrames.top() - if c.unreachableState.on && c.unreachableState.depth > 0 { - // If it is currently in unreachable, and the nested if, - // just remove the entire else block. - break operatorSwitch - } else if c.unreachableState.on { - // If it is currently in unreachable, and the non-nested if, - // reset the stack so we can correctly handle the else block. - top := c.controlFrames.top() - c.stack = c.stack[:top.originalStackLenWithoutParam] - top.kind = controlFrameKindIfWithElse - - // Re-push the parameters to the if block so that else block can use them. - for _, t := range frame.blockType.Params { - c.stackPush(wasmValueTypeToUnsignedType(t)) - } - - // We are no longer unreachable in else frame, - // so emit the correct label, and reset the unreachable state. - elseLabel := NewLabel(LabelKindElse, frame.frameID) - c.resetUnreachable() - c.emit( - NewOperationLabel(elseLabel), - ) - break operatorSwitch - } - - // Change the Kind of this If block, indicating that - // the if has else block. - frame.kind = controlFrameKindIfWithElse - - // We need to reset the stack so that - // the values pushed inside the then block - // do not affect the else block. - dropOp := NewOperationDrop(c.getFrameDropRange(frame, false)) - - // Reset the stack manipulated by the then block, and re-push the block param types to the stack. - - c.stack = c.stack[:frame.originalStackLenWithoutParam] - for _, t := range frame.blockType.Params { - c.stackPush(wasmValueTypeToUnsignedType(t)) - } - - // Prep labels for else and the continuation of this if block. - elseLabel := NewLabel(LabelKindElse, frame.frameID) - continuationLabel := NewLabel(LabelKindContinuation, frame.frameID) - c.result.LabelCallers[continuationLabel]++ - - // Emit the instructions for exiting the if loop, - // and then the initiation of else block. - c.emit(dropOp) - // Jump to the continuation of this block. - c.emit(NewOperationBr(continuationLabel)) - // Initiate the else block. - c.emit(NewOperationLabel(elseLabel)) - case wasm.OpcodeEnd: - if c.unreachableState.on && c.unreachableState.depth > 0 { - c.unreachableState.depth-- - break operatorSwitch - } else if c.unreachableState.on { - c.resetUnreachable() - - frame := c.controlFrames.pop() - if c.controlFrames.empty() { - return nil - } - - c.stack = c.stack[:frame.originalStackLenWithoutParam] - for _, t := range frame.blockType.Results { - c.stackPush(wasmValueTypeToUnsignedType(t)) - } - - continuationLabel := NewLabel(LabelKindContinuation, frame.frameID) - if frame.kind == controlFrameKindIfWithoutElse { - // Emit the else label. - elseLabel := NewLabel(LabelKindElse, frame.frameID) - c.result.LabelCallers[continuationLabel]++ - c.emit(NewOperationLabel(elseLabel)) - c.emit(NewOperationBr(continuationLabel)) - c.emit(NewOperationLabel(continuationLabel)) - } else { - c.emit( - NewOperationLabel(continuationLabel), - ) - } - - break operatorSwitch - } - - frame := c.controlFrames.pop() - - // We need to reset the stack so that - // the values pushed inside the block. - dropOp := NewOperationDrop(c.getFrameDropRange(frame, true)) - c.stack = c.stack[:frame.originalStackLenWithoutParam] - - // Push the result types onto the stack. - for _, t := range frame.blockType.Results { - c.stackPush(wasmValueTypeToUnsignedType(t)) - } - - // Emit the instructions according to the Kind of the current control frame. - switch frame.kind { - case controlFrameKindFunction: - if !c.controlFrames.empty() { - // Should never happen. If so, there's a bug in the translation. - panic("bug: found more function control frames") - } - // Return from function. - c.emit(dropOp) - c.emit(NewOperationBr(NewLabel(LabelKindReturn, 0))) - case controlFrameKindIfWithoutElse: - // This case we have to emit "empty" else label. - elseLabel := NewLabel(LabelKindElse, frame.frameID) - continuationLabel := NewLabel(LabelKindContinuation, frame.frameID) - c.result.LabelCallers[continuationLabel] += 2 - c.emit(dropOp) - c.emit(NewOperationBr(continuationLabel)) - // Emit the else which soon branches into the continuation. - c.emit(NewOperationLabel(elseLabel)) - c.emit(NewOperationBr(continuationLabel)) - // Initiate the continuation. - c.emit(NewOperationLabel(continuationLabel)) - case controlFrameKindBlockWithContinuationLabel, - controlFrameKindIfWithElse: - continuationLabel := NewLabel(LabelKindContinuation, frame.frameID) - c.result.LabelCallers[continuationLabel]++ - c.emit(dropOp) - c.emit(NewOperationBr(continuationLabel)) - c.emit(NewOperationLabel(continuationLabel)) - case controlFrameKindLoop, controlFrameKindBlockWithoutContinuationLabel: - c.emit( - dropOp, - ) - default: - // Should never happen. If so, there's a bug in the translation. - panic(fmt.Errorf("bug: invalid control frame Kind: 0x%x", frame.kind)) - } - - case wasm.OpcodeBr: - targetIndex, n, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("read the target for br_if: %w", err) - } - c.pc += n - - if c.unreachableState.on { - // If it is currently in unreachable, br is no-op. - break operatorSwitch - } - - targetFrame := c.controlFrames.get(int(targetIndex)) - targetFrame.ensureContinuation() - dropOp := NewOperationDrop(c.getFrameDropRange(targetFrame, false)) - targetID := targetFrame.asLabel() - c.result.LabelCallers[targetID]++ - c.emit(dropOp) - c.emit(NewOperationBr(targetID)) - // Br operation is stack-polymorphic, and mark the state as unreachable. - // That means subsequent instructions in the current control frame are "unreachable" - // and can be safely removed. - c.markUnreachable() - case wasm.OpcodeBrIf: - targetIndex, n, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("read the target for br_if: %w", err) - } - c.pc += n - - if c.unreachableState.on { - // If it is currently in unreachable, br-if is no-op. - break operatorSwitch - } - - targetFrame := c.controlFrames.get(int(targetIndex)) - targetFrame.ensureContinuation() - drop := c.getFrameDropRange(targetFrame, false) - target := targetFrame.asLabel() - c.result.LabelCallers[target]++ - - continuationLabel := NewLabel(LabelKindHeader, c.nextFrameID()) - c.result.LabelCallers[continuationLabel]++ - c.emit(NewOperationBrIf(target, continuationLabel, drop)) - // Start emitting else block operations. - c.emit(NewOperationLabel(continuationLabel)) - case wasm.OpcodeBrTable: - c.br.Reset(c.body[c.pc+1:]) - r := c.br - numTargets, n, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("error reading number of targets in br_table: %w", err) - } - c.pc += n - - if c.unreachableState.on { - // If it is currently in unreachable, br_table is no-op. - // But before proceeding to the next instruction, we must advance the pc - // according to the number of br_table targets. - for i := uint32(0); i <= numTargets; i++ { // inclusive as we also need to read the index of default target. - _, n, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("error reading target %d in br_table: %w", i, err) - } - c.pc += n - } - break operatorSwitch - } - - // Read the branch targets. - s := numTargets * 2 - targetLabels := make([]uint64, 2+s) // (label, InclusiveRange) * (default+numTargets) - for i := uint32(0); i < s; i += 2 { - l, n, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("error reading target %d in br_table: %w", i, err) - } - c.pc += n - targetFrame := c.controlFrames.get(int(l)) - targetFrame.ensureContinuation() - drop := c.getFrameDropRange(targetFrame, false) - targetLabel := targetFrame.asLabel() - targetLabels[i] = uint64(targetLabel) - targetLabels[i+1] = drop.AsU64() - c.result.LabelCallers[targetLabel]++ - } - - // Prep default target control frame. - l, n, err := leb128.DecodeUint32(r) - if err != nil { - return fmt.Errorf("error reading default target of br_table: %w", err) - } - c.pc += n - defaultTargetFrame := c.controlFrames.get(int(l)) - defaultTargetFrame.ensureContinuation() - defaultTargetDrop := c.getFrameDropRange(defaultTargetFrame, false) - defaultLabel := defaultTargetFrame.asLabel() - c.result.LabelCallers[defaultLabel]++ - targetLabels[s] = uint64(defaultLabel) - targetLabels[s+1] = defaultTargetDrop.AsU64() - c.emit(NewOperationBrTable(targetLabels)) - - // br_table operation is stack-polymorphic, and mark the state as unreachable. - // That means subsequent instructions in the current control frame are "unreachable" - // and can be safely removed. - c.markUnreachable() - case wasm.OpcodeReturn: - functionFrame := c.controlFrames.functionFrame() - dropOp := NewOperationDrop(c.getFrameDropRange(functionFrame, false)) - - // Cleanup the stack and then jmp to function frame's continuation (meaning return). - c.emit(dropOp) - c.emit(NewOperationBr(functionFrame.asLabel())) - - // Return operation is stack-polymorphic, and mark the state as unreachable. - // That means subsequent instructions in the current control frame are "unreachable" - // and can be safely removed. - c.markUnreachable() - case wasm.OpcodeCall: - c.emit( - NewOperationCall(index), - ) - case wasm.OpcodeCallIndirect: - typeIndex := index - tableIndex, n, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("read target for br_table: %w", err) - } - c.pc += n - c.emit( - NewOperationCallIndirect(typeIndex, tableIndex), - ) - case wasm.OpcodeDrop: - r := InclusiveRange{Start: 0, End: 0} - if peekValueType == UnsignedTypeV128 { - // InclusiveRange is the range in uint64 representation, so dropping a vector value on top - // should be translated as drop [0..1] inclusively. - r.End++ - } - c.emit(NewOperationDrop(r)) - case wasm.OpcodeSelect: - // If it is on the unreachable state, ignore the instruction. - if c.unreachableState.on { - break operatorSwitch - } - isTargetVector := c.stackPeek() == UnsignedTypeV128 - c.emit( - NewOperationSelect(isTargetVector), - ) - case wasm.OpcodeTypedSelect: - // Skips two bytes: vector size fixed to 1, and the value type for select. - c.pc += 2 - // If it is on the unreachable state, ignore the instruction. - if c.unreachableState.on { - break operatorSwitch - } - // Typed select is semantically equivalent to select at runtime. - isTargetVector := c.stackPeek() == UnsignedTypeV128 - c.emit( - NewOperationSelect(isTargetVector), - ) - case wasm.OpcodeLocalGet: - depth := c.localDepth(index) - if isVector := c.localType(index) == wasm.ValueTypeV128; !isVector { - c.emit( - // -1 because we already manipulated the stack before - // called localDepth ^^. - NewOperationPick(depth-1, isVector), - ) - } else { - c.emit( - // -2 because we already manipulated the stack before - // called localDepth ^^. - NewOperationPick(depth-2, isVector), - ) - } - case wasm.OpcodeLocalSet: - depth := c.localDepth(index) - - isVector := c.localType(index) == wasm.ValueTypeV128 - if isVector { - c.emit( - // +2 because we already popped the operands for this operation from the c.stack before - // called localDepth ^^, - NewOperationSet(depth+2, isVector), - ) - } else { - c.emit( - // +1 because we already popped the operands for this operation from the c.stack before - // called localDepth ^^, - NewOperationSet(depth+1, isVector), - ) - } - case wasm.OpcodeLocalTee: - depth := c.localDepth(index) - isVector := c.localType(index) == wasm.ValueTypeV128 - if isVector { - c.emit(NewOperationPick(1, isVector)) - c.emit(NewOperationSet(depth+2, isVector)) - } else { - c.emit( - NewOperationPick(0, isVector)) - c.emit(NewOperationSet(depth+1, isVector)) - } - case wasm.OpcodeGlobalGet: - c.emit( - NewOperationGlobalGet(index), - ) - case wasm.OpcodeGlobalSet: - c.emit( - NewOperationGlobalSet(index), - ) - case wasm.OpcodeI32Load: - imm, err := c.readMemoryArg(wasm.OpcodeI32LoadName) - if err != nil { - return err - } - c.emit(NewOperationLoad(UnsignedTypeI32, imm)) - case wasm.OpcodeI64Load: - imm, err := c.readMemoryArg(wasm.OpcodeI64LoadName) - if err != nil { - return err - } - c.emit(NewOperationLoad(UnsignedTypeI64, imm)) - case wasm.OpcodeF32Load: - imm, err := c.readMemoryArg(wasm.OpcodeF32LoadName) - if err != nil { - return err - } - c.emit(NewOperationLoad(UnsignedTypeF32, imm)) - case wasm.OpcodeF64Load: - imm, err := c.readMemoryArg(wasm.OpcodeF64LoadName) - if err != nil { - return err - } - c.emit(NewOperationLoad(UnsignedTypeF64, imm)) - case wasm.OpcodeI32Load8S: - imm, err := c.readMemoryArg(wasm.OpcodeI32Load8SName) - if err != nil { - return err - } - c.emit(NewOperationLoad8(SignedInt32, imm)) - case wasm.OpcodeI32Load8U: - imm, err := c.readMemoryArg(wasm.OpcodeI32Load8UName) - if err != nil { - return err - } - c.emit(NewOperationLoad8(SignedUint32, imm)) - case wasm.OpcodeI32Load16S: - imm, err := c.readMemoryArg(wasm.OpcodeI32Load16SName) - if err != nil { - return err - } - c.emit(NewOperationLoad16(SignedInt32, imm)) - case wasm.OpcodeI32Load16U: - imm, err := c.readMemoryArg(wasm.OpcodeI32Load16UName) - if err != nil { - return err - } - c.emit(NewOperationLoad16(SignedUint32, imm)) - case wasm.OpcodeI64Load8S: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load8SName) - if err != nil { - return err - } - c.emit(NewOperationLoad8(SignedInt64, imm)) - case wasm.OpcodeI64Load8U: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load8UName) - if err != nil { - return err - } - c.emit(NewOperationLoad8(SignedUint64, imm)) - case wasm.OpcodeI64Load16S: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load16SName) - if err != nil { - return err - } - c.emit(NewOperationLoad16(SignedInt64, imm)) - case wasm.OpcodeI64Load16U: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load16UName) - if err != nil { - return err - } - c.emit(NewOperationLoad16(SignedUint64, imm)) - case wasm.OpcodeI64Load32S: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load32SName) - if err != nil { - return err - } - c.emit(NewOperationLoad32(true, imm)) - case wasm.OpcodeI64Load32U: - imm, err := c.readMemoryArg(wasm.OpcodeI64Load32UName) - if err != nil { - return err - } - c.emit(NewOperationLoad32(false, imm)) - case wasm.OpcodeI32Store: - imm, err := c.readMemoryArg(wasm.OpcodeI32StoreName) - if err != nil { - return err - } - c.emit( - NewOperationStore(UnsignedTypeI32, imm), - ) - case wasm.OpcodeI64Store: - imm, err := c.readMemoryArg(wasm.OpcodeI64StoreName) - if err != nil { - return err - } - c.emit( - NewOperationStore(UnsignedTypeI64, imm), - ) - case wasm.OpcodeF32Store: - imm, err := c.readMemoryArg(wasm.OpcodeF32StoreName) - if err != nil { - return err - } - c.emit( - NewOperationStore(UnsignedTypeF32, imm), - ) - case wasm.OpcodeF64Store: - imm, err := c.readMemoryArg(wasm.OpcodeF64StoreName) - if err != nil { - return err - } - c.emit( - NewOperationStore(UnsignedTypeF64, imm), - ) - case wasm.OpcodeI32Store8: - imm, err := c.readMemoryArg(wasm.OpcodeI32Store8Name) - if err != nil { - return err - } - c.emit( - NewOperationStore8(imm), - ) - case wasm.OpcodeI32Store16: - imm, err := c.readMemoryArg(wasm.OpcodeI32Store16Name) - if err != nil { - return err - } - c.emit( - NewOperationStore16(imm), - ) - case wasm.OpcodeI64Store8: - imm, err := c.readMemoryArg(wasm.OpcodeI64Store8Name) - if err != nil { - return err - } - c.emit( - NewOperationStore8(imm), - ) - case wasm.OpcodeI64Store16: - imm, err := c.readMemoryArg(wasm.OpcodeI64Store16Name) - if err != nil { - return err - } - c.emit( - NewOperationStore16(imm), - ) - case wasm.OpcodeI64Store32: - imm, err := c.readMemoryArg(wasm.OpcodeI64Store32Name) - if err != nil { - return err - } - c.emit( - NewOperationStore32(imm), - ) - case wasm.OpcodeMemorySize: - c.result.UsesMemory = true - c.pc++ // Skip the reserved one byte. - c.emit( - NewOperationMemorySize(), - ) - case wasm.OpcodeMemoryGrow: - c.result.UsesMemory = true - c.pc++ // Skip the reserved one byte. - c.emit( - NewOperationMemoryGrow(), - ) - case wasm.OpcodeI32Const: - val, num, err := leb128.LoadInt32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationConstI32(uint32(val)), - ) - case wasm.OpcodeI64Const: - val, num, err := leb128.LoadInt64(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i64.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationConstI64(uint64(val)), - ) - case wasm.OpcodeF32Const: - v := math.Float32frombits(binary.LittleEndian.Uint32(c.body[c.pc+1:])) - c.pc += 4 - c.emit( - NewOperationConstF32(v), - ) - case wasm.OpcodeF64Const: - v := math.Float64frombits(binary.LittleEndian.Uint64(c.body[c.pc+1:])) - c.pc += 8 - c.emit( - NewOperationConstF64(v), - ) - case wasm.OpcodeI32Eqz: - c.emit( - NewOperationEqz(UnsignedInt32), - ) - case wasm.OpcodeI32Eq: - c.emit( - NewOperationEq(UnsignedTypeI32), - ) - case wasm.OpcodeI32Ne: - c.emit( - NewOperationNe(UnsignedTypeI32), - ) - case wasm.OpcodeI32LtS: - c.emit( - NewOperationLt(SignedTypeInt32), - ) - case wasm.OpcodeI32LtU: - c.emit( - NewOperationLt(SignedTypeUint32), - ) - case wasm.OpcodeI32GtS: - c.emit( - NewOperationGt(SignedTypeInt32), - ) - case wasm.OpcodeI32GtU: - c.emit( - NewOperationGt(SignedTypeUint32), - ) - case wasm.OpcodeI32LeS: - c.emit( - NewOperationLe(SignedTypeInt32), - ) - case wasm.OpcodeI32LeU: - c.emit( - NewOperationLe(SignedTypeUint32), - ) - case wasm.OpcodeI32GeS: - c.emit( - NewOperationGe(SignedTypeInt32), - ) - case wasm.OpcodeI32GeU: - c.emit( - NewOperationGe(SignedTypeUint32), - ) - case wasm.OpcodeI64Eqz: - c.emit( - NewOperationEqz(UnsignedInt64), - ) - case wasm.OpcodeI64Eq: - c.emit( - NewOperationEq(UnsignedTypeI64), - ) - case wasm.OpcodeI64Ne: - c.emit( - NewOperationNe(UnsignedTypeI64), - ) - case wasm.OpcodeI64LtS: - c.emit( - NewOperationLt(SignedTypeInt64), - ) - case wasm.OpcodeI64LtU: - c.emit( - NewOperationLt(SignedTypeUint64), - ) - case wasm.OpcodeI64GtS: - c.emit( - NewOperationGt(SignedTypeInt64), - ) - case wasm.OpcodeI64GtU: - c.emit( - NewOperationGt(SignedTypeUint64), - ) - case wasm.OpcodeI64LeS: - c.emit( - NewOperationLe(SignedTypeInt64), - ) - case wasm.OpcodeI64LeU: - c.emit( - NewOperationLe(SignedTypeUint64), - ) - case wasm.OpcodeI64GeS: - c.emit( - NewOperationGe(SignedTypeInt64), - ) - case wasm.OpcodeI64GeU: - c.emit( - NewOperationGe(SignedTypeUint64), - ) - case wasm.OpcodeF32Eq: - c.emit( - NewOperationEq(UnsignedTypeF32), - ) - case wasm.OpcodeF32Ne: - c.emit( - NewOperationNe(UnsignedTypeF32), - ) - case wasm.OpcodeF32Lt: - c.emit( - NewOperationLt(SignedTypeFloat32), - ) - case wasm.OpcodeF32Gt: - c.emit( - NewOperationGt(SignedTypeFloat32), - ) - case wasm.OpcodeF32Le: - c.emit( - NewOperationLe(SignedTypeFloat32), - ) - case wasm.OpcodeF32Ge: - c.emit( - NewOperationGe(SignedTypeFloat32), - ) - case wasm.OpcodeF64Eq: - c.emit( - NewOperationEq(UnsignedTypeF64), - ) - case wasm.OpcodeF64Ne: - c.emit( - NewOperationNe(UnsignedTypeF64), - ) - case wasm.OpcodeF64Lt: - c.emit( - NewOperationLt(SignedTypeFloat64), - ) - case wasm.OpcodeF64Gt: - c.emit( - NewOperationGt(SignedTypeFloat64), - ) - case wasm.OpcodeF64Le: - c.emit( - NewOperationLe(SignedTypeFloat64), - ) - case wasm.OpcodeF64Ge: - c.emit( - NewOperationGe(SignedTypeFloat64), - ) - case wasm.OpcodeI32Clz: - c.emit( - NewOperationClz(UnsignedInt32), - ) - case wasm.OpcodeI32Ctz: - c.emit( - NewOperationCtz(UnsignedInt32), - ) - case wasm.OpcodeI32Popcnt: - c.emit( - NewOperationPopcnt(UnsignedInt32), - ) - case wasm.OpcodeI32Add: - c.emit( - NewOperationAdd(UnsignedTypeI32), - ) - case wasm.OpcodeI32Sub: - c.emit( - NewOperationSub(UnsignedTypeI32), - ) - case wasm.OpcodeI32Mul: - c.emit( - NewOperationMul(UnsignedTypeI32), - ) - case wasm.OpcodeI32DivS: - c.emit( - NewOperationDiv(SignedTypeInt32), - ) - case wasm.OpcodeI32DivU: - c.emit( - NewOperationDiv(SignedTypeUint32), - ) - case wasm.OpcodeI32RemS: - c.emit( - NewOperationRem(SignedInt32), - ) - case wasm.OpcodeI32RemU: - c.emit( - NewOperationRem(SignedUint32), - ) - case wasm.OpcodeI32And: - c.emit( - NewOperationAnd(UnsignedInt32), - ) - case wasm.OpcodeI32Or: - c.emit( - NewOperationOr(UnsignedInt32), - ) - case wasm.OpcodeI32Xor: - c.emit( - NewOperationXor(UnsignedInt64), - ) - case wasm.OpcodeI32Shl: - c.emit( - NewOperationShl(UnsignedInt32), - ) - case wasm.OpcodeI32ShrS: - c.emit( - NewOperationShr(SignedInt32), - ) - case wasm.OpcodeI32ShrU: - c.emit( - NewOperationShr(SignedUint32), - ) - case wasm.OpcodeI32Rotl: - c.emit( - NewOperationRotl(UnsignedInt32), - ) - case wasm.OpcodeI32Rotr: - c.emit( - NewOperationRotr(UnsignedInt32), - ) - case wasm.OpcodeI64Clz: - c.emit( - NewOperationClz(UnsignedInt64), - ) - case wasm.OpcodeI64Ctz: - c.emit( - NewOperationCtz(UnsignedInt64), - ) - case wasm.OpcodeI64Popcnt: - c.emit( - NewOperationPopcnt(UnsignedInt64), - ) - case wasm.OpcodeI64Add: - c.emit( - NewOperationAdd(UnsignedTypeI64), - ) - case wasm.OpcodeI64Sub: - c.emit( - NewOperationSub(UnsignedTypeI64), - ) - case wasm.OpcodeI64Mul: - c.emit( - NewOperationMul(UnsignedTypeI64), - ) - case wasm.OpcodeI64DivS: - c.emit( - NewOperationDiv(SignedTypeInt64), - ) - case wasm.OpcodeI64DivU: - c.emit( - NewOperationDiv(SignedTypeUint64), - ) - case wasm.OpcodeI64RemS: - c.emit( - NewOperationRem(SignedInt64), - ) - case wasm.OpcodeI64RemU: - c.emit( - NewOperationRem(SignedUint64), - ) - case wasm.OpcodeI64And: - c.emit( - NewOperationAnd(UnsignedInt64), - ) - case wasm.OpcodeI64Or: - c.emit( - NewOperationOr(UnsignedInt64), - ) - case wasm.OpcodeI64Xor: - c.emit( - NewOperationXor(UnsignedInt64), - ) - case wasm.OpcodeI64Shl: - c.emit( - NewOperationShl(UnsignedInt64), - ) - case wasm.OpcodeI64ShrS: - c.emit( - NewOperationShr(SignedInt64), - ) - case wasm.OpcodeI64ShrU: - c.emit( - NewOperationShr(SignedUint64), - ) - case wasm.OpcodeI64Rotl: - c.emit( - NewOperationRotl(UnsignedInt64), - ) - case wasm.OpcodeI64Rotr: - c.emit( - NewOperationRotr(UnsignedInt64), - ) - case wasm.OpcodeF32Abs: - c.emit( - NewOperationAbs(Float32), - ) - case wasm.OpcodeF32Neg: - c.emit( - NewOperationNeg(Float32), - ) - case wasm.OpcodeF32Ceil: - c.emit( - NewOperationCeil(Float32), - ) - case wasm.OpcodeF32Floor: - c.emit( - NewOperationFloor(Float32), - ) - case wasm.OpcodeF32Trunc: - c.emit( - NewOperationTrunc(Float32), - ) - case wasm.OpcodeF32Nearest: - c.emit( - NewOperationNearest(Float32), - ) - case wasm.OpcodeF32Sqrt: - c.emit( - NewOperationSqrt(Float32), - ) - case wasm.OpcodeF32Add: - c.emit( - NewOperationAdd(UnsignedTypeF32), - ) - case wasm.OpcodeF32Sub: - c.emit( - NewOperationSub(UnsignedTypeF32), - ) - case wasm.OpcodeF32Mul: - c.emit( - NewOperationMul(UnsignedTypeF32), - ) - case wasm.OpcodeF32Div: - c.emit( - NewOperationDiv(SignedTypeFloat32), - ) - case wasm.OpcodeF32Min: - c.emit( - NewOperationMin(Float32), - ) - case wasm.OpcodeF32Max: - c.emit( - NewOperationMax(Float32), - ) - case wasm.OpcodeF32Copysign: - c.emit( - NewOperationCopysign(Float32), - ) - case wasm.OpcodeF64Abs: - c.emit( - NewOperationAbs(Float64), - ) - case wasm.OpcodeF64Neg: - c.emit( - NewOperationNeg(Float64), - ) - case wasm.OpcodeF64Ceil: - c.emit( - NewOperationCeil(Float64), - ) - case wasm.OpcodeF64Floor: - c.emit( - NewOperationFloor(Float64), - ) - case wasm.OpcodeF64Trunc: - c.emit( - NewOperationTrunc(Float64), - ) - case wasm.OpcodeF64Nearest: - c.emit( - NewOperationNearest(Float64), - ) - case wasm.OpcodeF64Sqrt: - c.emit( - NewOperationSqrt(Float64), - ) - case wasm.OpcodeF64Add: - c.emit( - NewOperationAdd(UnsignedTypeF64), - ) - case wasm.OpcodeF64Sub: - c.emit( - NewOperationSub(UnsignedTypeF64), - ) - case wasm.OpcodeF64Mul: - c.emit( - NewOperationMul(UnsignedTypeF64), - ) - case wasm.OpcodeF64Div: - c.emit( - NewOperationDiv(SignedTypeFloat64), - ) - case wasm.OpcodeF64Min: - c.emit( - NewOperationMin(Float64), - ) - case wasm.OpcodeF64Max: - c.emit( - NewOperationMax(Float64), - ) - case wasm.OpcodeF64Copysign: - c.emit( - NewOperationCopysign(Float64), - ) - case wasm.OpcodeI32WrapI64: - c.emit( - NewOperationI32WrapFromI64(), - ) - case wasm.OpcodeI32TruncF32S: - c.emit( - NewOperationITruncFromF(Float32, SignedInt32, false), - ) - case wasm.OpcodeI32TruncF32U: - c.emit( - NewOperationITruncFromF(Float32, SignedUint32, false), - ) - case wasm.OpcodeI32TruncF64S: - c.emit( - NewOperationITruncFromF(Float64, SignedInt32, false), - ) - case wasm.OpcodeI32TruncF64U: - c.emit( - NewOperationITruncFromF(Float64, SignedUint32, false), - ) - case wasm.OpcodeI64ExtendI32S: - c.emit( - NewOperationExtend(true), - ) - case wasm.OpcodeI64ExtendI32U: - c.emit( - NewOperationExtend(false), - ) - case wasm.OpcodeI64TruncF32S: - c.emit( - NewOperationITruncFromF(Float32, SignedInt64, false), - ) - case wasm.OpcodeI64TruncF32U: - c.emit( - NewOperationITruncFromF(Float32, SignedUint64, false), - ) - case wasm.OpcodeI64TruncF64S: - c.emit( - NewOperationITruncFromF(Float64, SignedInt64, false), - ) - case wasm.OpcodeI64TruncF64U: - c.emit( - NewOperationITruncFromF(Float64, SignedUint64, false), - ) - case wasm.OpcodeF32ConvertI32S: - c.emit( - NewOperationFConvertFromI(SignedInt32, Float32), - ) - case wasm.OpcodeF32ConvertI32U: - c.emit( - NewOperationFConvertFromI(SignedUint32, Float32), - ) - case wasm.OpcodeF32ConvertI64S: - c.emit( - NewOperationFConvertFromI(SignedInt64, Float32), - ) - case wasm.OpcodeF32ConvertI64U: - c.emit( - NewOperationFConvertFromI(SignedUint64, Float32), - ) - case wasm.OpcodeF32DemoteF64: - c.emit( - NewOperationF32DemoteFromF64(), - ) - case wasm.OpcodeF64ConvertI32S: - c.emit( - NewOperationFConvertFromI(SignedInt32, Float64), - ) - case wasm.OpcodeF64ConvertI32U: - c.emit( - NewOperationFConvertFromI(SignedUint32, Float64), - ) - case wasm.OpcodeF64ConvertI64S: - c.emit( - NewOperationFConvertFromI(SignedInt64, Float64), - ) - case wasm.OpcodeF64ConvertI64U: - c.emit( - NewOperationFConvertFromI(SignedUint64, Float64), - ) - case wasm.OpcodeF64PromoteF32: - c.emit( - NewOperationF64PromoteFromF32(), - ) - case wasm.OpcodeI32ReinterpretF32: - c.emit( - NewOperationI32ReinterpretFromF32(), - ) - case wasm.OpcodeI64ReinterpretF64: - c.emit( - NewOperationI64ReinterpretFromF64(), - ) - case wasm.OpcodeF32ReinterpretI32: - c.emit( - NewOperationF32ReinterpretFromI32(), - ) - case wasm.OpcodeF64ReinterpretI64: - c.emit( - NewOperationF64ReinterpretFromI64(), - ) - case wasm.OpcodeI32Extend8S: - c.emit( - NewOperationSignExtend32From8(), - ) - case wasm.OpcodeI32Extend16S: - c.emit( - NewOperationSignExtend32From16(), - ) - case wasm.OpcodeI64Extend8S: - c.emit( - NewOperationSignExtend64From8(), - ) - case wasm.OpcodeI64Extend16S: - c.emit( - NewOperationSignExtend64From16(), - ) - case wasm.OpcodeI64Extend32S: - c.emit( - NewOperationSignExtend64From32(), - ) - case wasm.OpcodeRefFunc: - c.pc++ - index, num, err := leb128.LoadUint32(c.body[c.pc:]) - if err != nil { - return fmt.Errorf("failed to read function index for ref.func: %v", err) - } - c.pc += num - 1 - c.emit( - NewOperationRefFunc(index), - ) - case wasm.OpcodeRefNull: - c.pc++ // Skip the type of reftype as every ref value is opaque pointer. - c.emit( - NewOperationConstI64(0), - ) - case wasm.OpcodeRefIsNull: - // Simply compare the opaque pointer (i64) with zero. - c.emit( - NewOperationEqz(UnsignedInt64), - ) - case wasm.OpcodeTableGet: - c.pc++ - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc:]) - if err != nil { - return fmt.Errorf("failed to read function index for table.get: %v", err) - } - c.pc += num - 1 - c.emit( - NewOperationTableGet(tableIndex), - ) - case wasm.OpcodeTableSet: - c.pc++ - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc:]) - if err != nil { - return fmt.Errorf("failed to read function index for table.set: %v", err) - } - c.pc += num - 1 - c.emit( - NewOperationTableSet(tableIndex), - ) - case wasm.OpcodeMiscPrefix: - c.pc++ - // A misc opcode is encoded as an unsigned variable 32-bit integer. - miscOp, num, err := leb128.LoadUint32(c.body[c.pc:]) - if err != nil { - return fmt.Errorf("failed to read misc opcode: %v", err) - } - c.pc += num - 1 - switch byte(miscOp) { - case wasm.OpcodeMiscI32TruncSatF32S: - c.emit( - NewOperationITruncFromF(Float32, SignedInt32, true), - ) - case wasm.OpcodeMiscI32TruncSatF32U: - c.emit( - NewOperationITruncFromF(Float32, SignedUint32, true), - ) - case wasm.OpcodeMiscI32TruncSatF64S: - c.emit( - NewOperationITruncFromF(Float64, SignedInt32, true), - ) - case wasm.OpcodeMiscI32TruncSatF64U: - c.emit( - NewOperationITruncFromF(Float64, SignedUint32, true), - ) - case wasm.OpcodeMiscI64TruncSatF32S: - c.emit( - NewOperationITruncFromF(Float32, SignedInt64, true), - ) - case wasm.OpcodeMiscI64TruncSatF32U: - c.emit( - NewOperationITruncFromF(Float32, SignedUint64, true), - ) - case wasm.OpcodeMiscI64TruncSatF64S: - c.emit( - NewOperationITruncFromF(Float64, SignedInt64, true), - ) - case wasm.OpcodeMiscI64TruncSatF64U: - c.emit( - NewOperationITruncFromF(Float64, SignedUint64, true), - ) - case wasm.OpcodeMiscMemoryInit: - c.result.UsesMemory = true - dataIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num + 1 // +1 to skip the memory index which is fixed to zero. - c.emit( - NewOperationMemoryInit(dataIndex), - ) - case wasm.OpcodeMiscDataDrop: - dataIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationDataDrop(dataIndex), - ) - case wasm.OpcodeMiscMemoryCopy: - c.result.UsesMemory = true - c.pc += 2 // +2 to skip two memory indexes which are fixed to zero. - c.emit( - NewOperationMemoryCopy(), - ) - case wasm.OpcodeMiscMemoryFill: - c.result.UsesMemory = true - c.pc += 1 // +1 to skip the memory index which is fixed to zero. - c.emit( - NewOperationMemoryFill(), - ) - case wasm.OpcodeMiscTableInit: - elemIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - // Read table index which is fixed to zero currently. - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationTableInit(elemIndex, tableIndex), - ) - case wasm.OpcodeMiscElemDrop: - elemIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationElemDrop(elemIndex), - ) - case wasm.OpcodeMiscTableCopy: - // Read the source table inde.g. - dst, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - // Read the destination table inde.g. - src, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationTableCopy(src, dst), - ) - case wasm.OpcodeMiscTableGrow: - // Read the source table inde.g. - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationTableGrow(tableIndex), - ) - case wasm.OpcodeMiscTableSize: - // Read the source table inde.g. - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationTableSize(tableIndex), - ) - case wasm.OpcodeMiscTableFill: - // Read the source table index. - tableIndex, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return fmt.Errorf("reading i32.const value: %v", err) - } - c.pc += num - c.emit( - NewOperationTableFill(tableIndex), - ) - default: - return fmt.Errorf("unsupported misc instruction in wazeroir: 0x%x", op) - } - case wasm.OpcodeVecPrefix: - c.pc++ - switch vecOp := c.body[c.pc]; vecOp { - case wasm.OpcodeVecV128Const: - c.pc++ - lo := binary.LittleEndian.Uint64(c.body[c.pc : c.pc+8]) - c.pc += 8 - hi := binary.LittleEndian.Uint64(c.body[c.pc : c.pc+8]) - c.emit( - NewOperationV128Const(lo, hi), - ) - c.pc += 7 - case wasm.OpcodeVecV128Load: - arg, err := c.readMemoryArg(wasm.OpcodeI32LoadName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType128, arg), - ) - case wasm.OpcodeVecV128Load8x8s: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load8x8SName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType8x8s, arg), - ) - case wasm.OpcodeVecV128Load8x8u: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load8x8UName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType8x8u, arg), - ) - case wasm.OpcodeVecV128Load16x4s: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load16x4SName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType16x4s, arg), - ) - case wasm.OpcodeVecV128Load16x4u: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load16x4UName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType16x4u, arg), - ) - case wasm.OpcodeVecV128Load32x2s: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load32x2SName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType32x2s, arg), - ) - case wasm.OpcodeVecV128Load32x2u: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load32x2UName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType32x2u, arg), - ) - case wasm.OpcodeVecV128Load8Splat: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load8SplatName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType8Splat, arg), - ) - case wasm.OpcodeVecV128Load16Splat: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load16SplatName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType16Splat, arg), - ) - case wasm.OpcodeVecV128Load32Splat: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load32SplatName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType32Splat, arg), - ) - case wasm.OpcodeVecV128Load64Splat: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load64SplatName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType64Splat, arg), - ) - case wasm.OpcodeVecV128Load32zero: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load32zeroName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType32zero, arg), - ) - case wasm.OpcodeVecV128Load64zero: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load64zeroName) - if err != nil { - return err - } - c.emit( - NewOperationV128Load(V128LoadType64zero, arg), - ) - case wasm.OpcodeVecV128Load8Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load8LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128LoadLane(laneIndex, 8, arg), - ) - case wasm.OpcodeVecV128Load16Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load16LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128LoadLane(laneIndex, 16, arg), - ) - case wasm.OpcodeVecV128Load32Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load32LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128LoadLane(laneIndex, 32, arg), - ) - case wasm.OpcodeVecV128Load64Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Load64LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128LoadLane(laneIndex, 64, arg), - ) - case wasm.OpcodeVecV128Store: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128StoreName) - if err != nil { - return err - } - c.emit( - NewOperationV128Store(arg), - ) - case wasm.OpcodeVecV128Store8Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Store8LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128StoreLane(laneIndex, 8, arg), - ) - case wasm.OpcodeVecV128Store16Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Store16LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128StoreLane(laneIndex, 16, arg), - ) - case wasm.OpcodeVecV128Store32Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Store32LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128StoreLane(laneIndex, 32, arg), - ) - case wasm.OpcodeVecV128Store64Lane: - arg, err := c.readMemoryArg(wasm.OpcodeVecV128Store64LaneName) - if err != nil { - return err - } - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128StoreLane(laneIndex, 64, arg), - ) - case wasm.OpcodeVecI8x16ExtractLaneS: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, true, ShapeI8x16), - ) - case wasm.OpcodeVecI8x16ExtractLaneU: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeI8x16), - ) - case wasm.OpcodeVecI16x8ExtractLaneS: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, true, ShapeI16x8), - ) - case wasm.OpcodeVecI16x8ExtractLaneU: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeI16x8), - ) - case wasm.OpcodeVecI32x4ExtractLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeI32x4), - ) - case wasm.OpcodeVecI64x2ExtractLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeI64x2), - ) - case wasm.OpcodeVecF32x4ExtractLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeF32x4), - ) - case wasm.OpcodeVecF64x2ExtractLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ExtractLane(laneIndex, false, ShapeF64x2), - ) - case wasm.OpcodeVecI8x16ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeI8x16), - ) - case wasm.OpcodeVecI16x8ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeI16x8), - ) - case wasm.OpcodeVecI32x4ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeI32x4), - ) - case wasm.OpcodeVecI64x2ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeI64x2), - ) - case wasm.OpcodeVecF32x4ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeF32x4), - ) - case wasm.OpcodeVecF64x2ReplaceLane: - c.pc++ - laneIndex := c.body[c.pc] - c.emit( - NewOperationV128ReplaceLane(laneIndex, ShapeF64x2), - ) - case wasm.OpcodeVecI8x16Splat: - c.emit( - NewOperationV128Splat(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8Splat: - c.emit( - NewOperationV128Splat(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Splat: - c.emit( - NewOperationV128Splat(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Splat: - c.emit( - NewOperationV128Splat(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Splat: - c.emit( - NewOperationV128Splat(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Splat: - c.emit( - NewOperationV128Splat(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16Swizzle: - c.emit( - NewOperationV128Swizzle(), - ) - case wasm.OpcodeVecV128i8x16Shuffle: - c.pc++ - lanes := make([]uint64, 16) - for i := uint64(0); i < 16; i++ { - lanes[i] = uint64(c.body[c.pc+i]) - } - op := NewOperationV128Shuffle(lanes) - c.emit(op) - c.pc += 15 - case wasm.OpcodeVecV128AnyTrue: - c.emit( - NewOperationV128AnyTrue(), - ) - case wasm.OpcodeVecI8x16AllTrue: - c.emit( - NewOperationV128AllTrue(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8AllTrue: - c.emit( - NewOperationV128AllTrue(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4AllTrue: - c.emit( - NewOperationV128AllTrue(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2AllTrue: - c.emit( - NewOperationV128AllTrue(ShapeI64x2), - ) - case wasm.OpcodeVecI8x16BitMask: - c.emit( - NewOperationV128BitMask(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8BitMask: - c.emit( - NewOperationV128BitMask(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4BitMask: - c.emit( - NewOperationV128BitMask(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2BitMask: - c.emit( - NewOperationV128BitMask(ShapeI64x2), - ) - case wasm.OpcodeVecV128And: - c.emit( - NewOperationV128And(), - ) - case wasm.OpcodeVecV128Not: - c.emit( - NewOperationV128Not(), - ) - case wasm.OpcodeVecV128Or: - c.emit( - NewOperationV128Or(), - ) - case wasm.OpcodeVecV128Xor: - c.emit( - NewOperationV128Xor(), - ) - case wasm.OpcodeVecV128Bitselect: - c.emit( - NewOperationV128Bitselect(), - ) - case wasm.OpcodeVecV128AndNot: - c.emit( - NewOperationV128AndNot(), - ) - case wasm.OpcodeVecI8x16Shl: - c.emit( - NewOperationV128Shl(ShapeI8x16), - ) - case wasm.OpcodeVecI8x16ShrS: - c.emit( - NewOperationV128Shr(ShapeI8x16, true), - ) - case wasm.OpcodeVecI8x16ShrU: - c.emit( - NewOperationV128Shr(ShapeI8x16, false), - ) - case wasm.OpcodeVecI16x8Shl: - c.emit( - NewOperationV128Shl(ShapeI16x8), - ) - case wasm.OpcodeVecI16x8ShrS: - c.emit( - NewOperationV128Shr(ShapeI16x8, true), - ) - case wasm.OpcodeVecI16x8ShrU: - c.emit( - NewOperationV128Shr(ShapeI16x8, false), - ) - case wasm.OpcodeVecI32x4Shl: - c.emit( - NewOperationV128Shl(ShapeI32x4), - ) - case wasm.OpcodeVecI32x4ShrS: - c.emit( - NewOperationV128Shr(ShapeI32x4, true), - ) - case wasm.OpcodeVecI32x4ShrU: - c.emit( - NewOperationV128Shr(ShapeI32x4, false), - ) - case wasm.OpcodeVecI64x2Shl: - c.emit( - NewOperationV128Shl(ShapeI64x2), - ) - case wasm.OpcodeVecI64x2ShrS: - c.emit( - NewOperationV128Shr(ShapeI64x2, true), - ) - case wasm.OpcodeVecI64x2ShrU: - c.emit( - NewOperationV128Shr(ShapeI64x2, false), - ) - case wasm.OpcodeVecI8x16Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16Eq), - ) - case wasm.OpcodeVecI8x16Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16Ne), - ) - case wasm.OpcodeVecI8x16LtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16LtS), - ) - case wasm.OpcodeVecI8x16LtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16LtU), - ) - case wasm.OpcodeVecI8x16GtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16GtS), - ) - case wasm.OpcodeVecI8x16GtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16GtU), - ) - case wasm.OpcodeVecI8x16LeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16LeS), - ) - case wasm.OpcodeVecI8x16LeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16LeU), - ) - case wasm.OpcodeVecI8x16GeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16GeS), - ) - case wasm.OpcodeVecI8x16GeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI8x16GeU), - ) - case wasm.OpcodeVecI16x8Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8Eq), - ) - case wasm.OpcodeVecI16x8Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8Ne), - ) - case wasm.OpcodeVecI16x8LtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8LtS), - ) - case wasm.OpcodeVecI16x8LtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8LtU), - ) - case wasm.OpcodeVecI16x8GtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8GtS), - ) - case wasm.OpcodeVecI16x8GtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8GtU), - ) - case wasm.OpcodeVecI16x8LeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8LeS), - ) - case wasm.OpcodeVecI16x8LeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8LeU), - ) - case wasm.OpcodeVecI16x8GeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8GeS), - ) - case wasm.OpcodeVecI16x8GeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI16x8GeU), - ) - case wasm.OpcodeVecI32x4Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4Eq), - ) - case wasm.OpcodeVecI32x4Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4Ne), - ) - case wasm.OpcodeVecI32x4LtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4LtS), - ) - case wasm.OpcodeVecI32x4LtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4LtU), - ) - case wasm.OpcodeVecI32x4GtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4GtS), - ) - case wasm.OpcodeVecI32x4GtU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4GtU), - ) - case wasm.OpcodeVecI32x4LeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4LeS), - ) - case wasm.OpcodeVecI32x4LeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4LeU), - ) - case wasm.OpcodeVecI32x4GeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4GeS), - ) - case wasm.OpcodeVecI32x4GeU: - c.emit( - NewOperationV128Cmp(V128CmpTypeI32x4GeU), - ) - case wasm.OpcodeVecI64x2Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2Eq), - ) - case wasm.OpcodeVecI64x2Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2Ne), - ) - case wasm.OpcodeVecI64x2LtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2LtS), - ) - case wasm.OpcodeVecI64x2GtS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2GtS), - ) - case wasm.OpcodeVecI64x2LeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2LeS), - ) - case wasm.OpcodeVecI64x2GeS: - c.emit( - NewOperationV128Cmp(V128CmpTypeI64x2GeS), - ) - case wasm.OpcodeVecF32x4Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Eq), - ) - case wasm.OpcodeVecF32x4Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Ne), - ) - case wasm.OpcodeVecF32x4Lt: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Lt), - ) - case wasm.OpcodeVecF32x4Gt: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Gt), - ) - case wasm.OpcodeVecF32x4Le: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Le), - ) - case wasm.OpcodeVecF32x4Ge: - c.emit( - NewOperationV128Cmp(V128CmpTypeF32x4Ge), - ) - case wasm.OpcodeVecF64x2Eq: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Eq), - ) - case wasm.OpcodeVecF64x2Ne: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Ne), - ) - case wasm.OpcodeVecF64x2Lt: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Lt), - ) - case wasm.OpcodeVecF64x2Gt: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Gt), - ) - case wasm.OpcodeVecF64x2Le: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Le), - ) - case wasm.OpcodeVecF64x2Ge: - c.emit( - NewOperationV128Cmp(V128CmpTypeF64x2Ge), - ) - case wasm.OpcodeVecI8x16Neg: - c.emit( - NewOperationV128Neg(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8Neg: - c.emit( - NewOperationV128Neg(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Neg: - c.emit( - NewOperationV128Neg(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Neg: - c.emit( - NewOperationV128Neg(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Neg: - c.emit( - NewOperationV128Neg(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Neg: - c.emit( - NewOperationV128Neg(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16Add: - c.emit( - NewOperationV128Add(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8Add: - c.emit( - NewOperationV128Add(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Add: - c.emit( - NewOperationV128Add(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Add: - c.emit( - NewOperationV128Add(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Add: - c.emit( - NewOperationV128Add(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Add: - c.emit( - NewOperationV128Add(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16Sub: - c.emit( - NewOperationV128Sub(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8Sub: - c.emit( - NewOperationV128Sub(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Sub: - c.emit( - NewOperationV128Sub(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Sub: - c.emit( - NewOperationV128Sub(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Sub: - c.emit( - NewOperationV128Sub(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Sub: - c.emit( - NewOperationV128Sub(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16AddSatS: - c.emit( - NewOperationV128AddSat(ShapeI8x16, true), - ) - case wasm.OpcodeVecI8x16AddSatU: - c.emit( - NewOperationV128AddSat(ShapeI8x16, false), - ) - case wasm.OpcodeVecI16x8AddSatS: - c.emit( - NewOperationV128AddSat(ShapeI16x8, true), - ) - case wasm.OpcodeVecI16x8AddSatU: - c.emit( - NewOperationV128AddSat(ShapeI16x8, false), - ) - case wasm.OpcodeVecI8x16SubSatS: - c.emit( - NewOperationV128SubSat(ShapeI8x16, true), - ) - case wasm.OpcodeVecI8x16SubSatU: - c.emit( - NewOperationV128SubSat(ShapeI8x16, false), - ) - case wasm.OpcodeVecI16x8SubSatS: - c.emit( - NewOperationV128SubSat(ShapeI16x8, true), - ) - case wasm.OpcodeVecI16x8SubSatU: - c.emit( - NewOperationV128SubSat(ShapeI16x8, false), - ) - case wasm.OpcodeVecI16x8Mul: - c.emit( - NewOperationV128Mul(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Mul: - c.emit( - NewOperationV128Mul(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Mul: - c.emit( - NewOperationV128Mul(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Mul: - c.emit( - NewOperationV128Mul(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Mul: - c.emit( - NewOperationV128Mul(ShapeF64x2), - ) - case wasm.OpcodeVecF32x4Sqrt: - c.emit( - NewOperationV128Sqrt(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Sqrt: - c.emit( - NewOperationV128Sqrt(ShapeF64x2), - ) - case wasm.OpcodeVecF32x4Div: - c.emit( - NewOperationV128Div(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Div: - c.emit( - NewOperationV128Div(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16Abs: - c.emit( - NewOperationV128Abs(ShapeI8x16), - ) - case wasm.OpcodeVecI8x16Popcnt: - c.emit( - NewOperationV128Popcnt(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8Abs: - c.emit( - NewOperationV128Abs(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4Abs: - c.emit( - NewOperationV128Abs(ShapeI32x4), - ) - case wasm.OpcodeVecI64x2Abs: - c.emit( - NewOperationV128Abs(ShapeI64x2), - ) - case wasm.OpcodeVecF32x4Abs: - c.emit( - NewOperationV128Abs(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Abs: - c.emit( - NewOperationV128Abs(ShapeF64x2), - ) - case wasm.OpcodeVecI8x16MinS: - c.emit( - NewOperationV128Min(ShapeI8x16, true), - ) - case wasm.OpcodeVecI8x16MinU: - c.emit( - NewOperationV128Min(ShapeI8x16, false), - ) - case wasm.OpcodeVecI8x16MaxS: - c.emit( - NewOperationV128Max(ShapeI8x16, true), - ) - case wasm.OpcodeVecI8x16MaxU: - c.emit( - NewOperationV128Max(ShapeI8x16, false), - ) - case wasm.OpcodeVecI8x16AvgrU: - c.emit( - NewOperationV128AvgrU(ShapeI8x16), - ) - case wasm.OpcodeVecI16x8MinS: - c.emit( - NewOperationV128Min(ShapeI16x8, true), - ) - case wasm.OpcodeVecI16x8MinU: - c.emit( - NewOperationV128Min(ShapeI16x8, false), - ) - case wasm.OpcodeVecI16x8MaxS: - c.emit( - NewOperationV128Max(ShapeI16x8, true), - ) - case wasm.OpcodeVecI16x8MaxU: - c.emit( - NewOperationV128Max(ShapeI16x8, false), - ) - case wasm.OpcodeVecI16x8AvgrU: - c.emit( - NewOperationV128AvgrU(ShapeI16x8), - ) - case wasm.OpcodeVecI32x4MinS: - c.emit( - NewOperationV128Min(ShapeI32x4, true), - ) - case wasm.OpcodeVecI32x4MinU: - c.emit( - NewOperationV128Min(ShapeI32x4, false), - ) - case wasm.OpcodeVecI32x4MaxS: - c.emit( - NewOperationV128Max(ShapeI32x4, true), - ) - case wasm.OpcodeVecI32x4MaxU: - c.emit( - NewOperationV128Max(ShapeI32x4, false), - ) - case wasm.OpcodeVecF32x4Min: - c.emit( - NewOperationV128Min(ShapeF32x4, false), - ) - case wasm.OpcodeVecF32x4Max: - c.emit( - NewOperationV128Max(ShapeF32x4, false), - ) - case wasm.OpcodeVecF64x2Min: - c.emit( - NewOperationV128Min(ShapeF64x2, false), - ) - case wasm.OpcodeVecF64x2Max: - c.emit( - NewOperationV128Max(ShapeF64x2, false), - ) - case wasm.OpcodeVecF32x4Pmin: - c.emit( - NewOperationV128Pmin(ShapeF32x4), - ) - case wasm.OpcodeVecF32x4Pmax: - c.emit( - NewOperationV128Pmax(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Pmin: - c.emit( - NewOperationV128Pmin(ShapeF64x2), - ) - case wasm.OpcodeVecF64x2Pmax: - c.emit( - NewOperationV128Pmax(ShapeF64x2), - ) - case wasm.OpcodeVecF32x4Ceil: - c.emit( - NewOperationV128Ceil(ShapeF32x4), - ) - case wasm.OpcodeVecF32x4Floor: - c.emit( - NewOperationV128Floor(ShapeF32x4), - ) - case wasm.OpcodeVecF32x4Trunc: - c.emit( - NewOperationV128Trunc(ShapeF32x4), - ) - case wasm.OpcodeVecF32x4Nearest: - c.emit( - NewOperationV128Nearest(ShapeF32x4), - ) - case wasm.OpcodeVecF64x2Ceil: - c.emit( - NewOperationV128Ceil(ShapeF64x2), - ) - case wasm.OpcodeVecF64x2Floor: - c.emit( - NewOperationV128Floor(ShapeF64x2), - ) - case wasm.OpcodeVecF64x2Trunc: - c.emit( - NewOperationV128Trunc(ShapeF64x2), - ) - case wasm.OpcodeVecF64x2Nearest: - c.emit( - NewOperationV128Nearest(ShapeF64x2), - ) - case wasm.OpcodeVecI16x8ExtendLowI8x16S: - c.emit( - NewOperationV128Extend(ShapeI8x16, true, true), - ) - case wasm.OpcodeVecI16x8ExtendHighI8x16S: - c.emit( - NewOperationV128Extend(ShapeI8x16, true, false), - ) - case wasm.OpcodeVecI16x8ExtendLowI8x16U: - c.emit( - NewOperationV128Extend(ShapeI8x16, false, true), - ) - case wasm.OpcodeVecI16x8ExtendHighI8x16U: - c.emit( - NewOperationV128Extend(ShapeI8x16, false, false), - ) - case wasm.OpcodeVecI32x4ExtendLowI16x8S: - c.emit( - NewOperationV128Extend(ShapeI16x8, true, true), - ) - case wasm.OpcodeVecI32x4ExtendHighI16x8S: - c.emit( - NewOperationV128Extend(ShapeI16x8, true, false), - ) - case wasm.OpcodeVecI32x4ExtendLowI16x8U: - c.emit( - NewOperationV128Extend(ShapeI16x8, false, true), - ) - case wasm.OpcodeVecI32x4ExtendHighI16x8U: - c.emit( - NewOperationV128Extend(ShapeI16x8, false, false), - ) - case wasm.OpcodeVecI64x2ExtendLowI32x4S: - c.emit( - NewOperationV128Extend(ShapeI32x4, true, true), - ) - case wasm.OpcodeVecI64x2ExtendHighI32x4S: - c.emit( - NewOperationV128Extend(ShapeI32x4, true, false), - ) - case wasm.OpcodeVecI64x2ExtendLowI32x4U: - c.emit( - NewOperationV128Extend(ShapeI32x4, false, true), - ) - case wasm.OpcodeVecI64x2ExtendHighI32x4U: - c.emit( - NewOperationV128Extend(ShapeI32x4, false, false), - ) - case wasm.OpcodeVecI16x8Q15mulrSatS: - c.emit( - NewOperationV128Q15mulrSatS(), - ) - case wasm.OpcodeVecI16x8ExtMulLowI8x16S: - c.emit( - NewOperationV128ExtMul(ShapeI8x16, true, true), - ) - case wasm.OpcodeVecI16x8ExtMulHighI8x16S: - c.emit( - NewOperationV128ExtMul(ShapeI8x16, true, false), - ) - case wasm.OpcodeVecI16x8ExtMulLowI8x16U: - c.emit( - NewOperationV128ExtMul(ShapeI8x16, false, true), - ) - case wasm.OpcodeVecI16x8ExtMulHighI8x16U: - c.emit( - NewOperationV128ExtMul(ShapeI8x16, false, false), - ) - case wasm.OpcodeVecI32x4ExtMulLowI16x8S: - c.emit( - NewOperationV128ExtMul(ShapeI16x8, true, true), - ) - case wasm.OpcodeVecI32x4ExtMulHighI16x8S: - c.emit( - NewOperationV128ExtMul(ShapeI16x8, true, false), - ) - case wasm.OpcodeVecI32x4ExtMulLowI16x8U: - c.emit( - NewOperationV128ExtMul(ShapeI16x8, false, true), - ) - case wasm.OpcodeVecI32x4ExtMulHighI16x8U: - c.emit( - NewOperationV128ExtMul(ShapeI16x8, false, false), - ) - case wasm.OpcodeVecI64x2ExtMulLowI32x4S: - c.emit( - NewOperationV128ExtMul(ShapeI32x4, true, true), - ) - case wasm.OpcodeVecI64x2ExtMulHighI32x4S: - c.emit( - NewOperationV128ExtMul(ShapeI32x4, true, false), - ) - case wasm.OpcodeVecI64x2ExtMulLowI32x4U: - c.emit( - NewOperationV128ExtMul(ShapeI32x4, false, true), - ) - case wasm.OpcodeVecI64x2ExtMulHighI32x4U: - c.emit( - NewOperationV128ExtMul(ShapeI32x4, false, false), - ) - case wasm.OpcodeVecI16x8ExtaddPairwiseI8x16S: - c.emit( - NewOperationV128ExtAddPairwise(ShapeI8x16, true), - ) - case wasm.OpcodeVecI16x8ExtaddPairwiseI8x16U: - c.emit( - NewOperationV128ExtAddPairwise(ShapeI8x16, false), - ) - case wasm.OpcodeVecI32x4ExtaddPairwiseI16x8S: - c.emit( - NewOperationV128ExtAddPairwise(ShapeI16x8, true), - ) - case wasm.OpcodeVecI32x4ExtaddPairwiseI16x8U: - c.emit( - NewOperationV128ExtAddPairwise(ShapeI16x8, false), - ) - case wasm.OpcodeVecF64x2PromoteLowF32x4Zero: - c.emit( - NewOperationV128FloatPromote(), - ) - case wasm.OpcodeVecF32x4DemoteF64x2Zero: - c.emit( - NewOperationV128FloatDemote(), - ) - case wasm.OpcodeVecF32x4ConvertI32x4S: - c.emit( - NewOperationV128FConvertFromI(ShapeF32x4, true), - ) - case wasm.OpcodeVecF32x4ConvertI32x4U: - c.emit( - NewOperationV128FConvertFromI(ShapeF32x4, false), - ) - case wasm.OpcodeVecF64x2ConvertLowI32x4S: - c.emit( - NewOperationV128FConvertFromI(ShapeF64x2, true), - ) - case wasm.OpcodeVecF64x2ConvertLowI32x4U: - c.emit( - NewOperationV128FConvertFromI(ShapeF64x2, false), - ) - case wasm.OpcodeVecI32x4DotI16x8S: - c.emit( - NewOperationV128Dot(), - ) - case wasm.OpcodeVecI8x16NarrowI16x8S: - c.emit( - NewOperationV128Narrow(ShapeI16x8, true), - ) - case wasm.OpcodeVecI8x16NarrowI16x8U: - c.emit( - NewOperationV128Narrow(ShapeI16x8, false), - ) - case wasm.OpcodeVecI16x8NarrowI32x4S: - c.emit( - NewOperationV128Narrow(ShapeI32x4, true), - ) - case wasm.OpcodeVecI16x8NarrowI32x4U: - c.emit( - NewOperationV128Narrow(ShapeI32x4, false), - ) - case wasm.OpcodeVecI32x4TruncSatF32x4S: - c.emit( - NewOperationV128ITruncSatFromF(ShapeF32x4, true), - ) - case wasm.OpcodeVecI32x4TruncSatF32x4U: - c.emit( - NewOperationV128ITruncSatFromF(ShapeF32x4, false), - ) - case wasm.OpcodeVecI32x4TruncSatF64x2SZero: - c.emit( - NewOperationV128ITruncSatFromF(ShapeF64x2, true), - ) - case wasm.OpcodeVecI32x4TruncSatF64x2UZero: - c.emit( - NewOperationV128ITruncSatFromF(ShapeF64x2, false), - ) - default: - return fmt.Errorf("unsupported vector instruction in wazeroir: %s", wasm.VectorInstructionName(vecOp)) - } - default: - return fmt.Errorf("unsupported instruction in wazeroir: 0x%x", op) - } - - // Move the program counter to point to the next instruction. - c.pc++ - return nil -} - -func (c *Compiler) nextFrameID() (id uint32) { - id = c.currentFrameID + 1 - c.currentFrameID++ - return -} - -func (c *Compiler) applyToStack(opcode wasm.Opcode) (index uint32, err error) { - switch opcode { - case - // These are the opcodes that is coupled with "index" immediate - // and it DOES affect the signature of opcode. - wasm.OpcodeCall, - wasm.OpcodeCallIndirect, - wasm.OpcodeLocalGet, - wasm.OpcodeLocalSet, - wasm.OpcodeLocalTee, - wasm.OpcodeGlobalGet, - wasm.OpcodeGlobalSet: - // Assumes that we are at the opcode now so skip it before read immediates. - v, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return 0, fmt.Errorf("reading immediates: %w", err) - } - c.pc += num - index = v - default: - // Note that other opcodes are free of index - // as it doesn't affect the signature of opt code. - // In other words, the "index" argument of wasmOpcodeSignature - // is ignored there. - } - - if c.unreachableState.on { - return 0, nil - } - - // Retrieve the signature of the opcode. - s, err := c.wasmOpcodeSignature(opcode, index) - if err != nil { - return 0, err - } - - // Manipulate the stack according to the signature. - // Note that the following algorithm assumes that - // the unknown type is unique in the signature, - // and is determined by the actual type on the stack. - // The determined type is stored in this typeParam. - var typeParam UnsignedType - var typeParamFound bool - for i := range s.in { - want := s.in[len(s.in)-1-i] - actual := c.stackPop() - if want == UnsignedTypeUnknown && typeParamFound { - want = typeParam - } else if want == UnsignedTypeUnknown { - want = actual - typeParam = want - typeParamFound = true - } - if want != actual { - return 0, fmt.Errorf("input signature mismatch: want %s but have %s", want, actual) - } - } - - for _, target := range s.out { - if target == UnsignedTypeUnknown && !typeParamFound { - return 0, fmt.Errorf("cannot determine type of unknown result") - } else if target == UnsignedTypeUnknown { - c.stackPush(typeParam) - } else { - c.stackPush(target) - } - } - - return index, nil -} - -func (c *Compiler) stackPeek() (ret UnsignedType) { - ret = c.stack[len(c.stack)-1] - return -} - -func (c *Compiler) stackPop() (ret UnsignedType) { - // No need to check stack bound - // as we can assume that all the operations - // are valid thanks to validateFunction - // at module validation phase. - ret = c.stack[len(c.stack)-1] - c.stack = c.stack[:len(c.stack)-1] - return -} - -func (c *Compiler) stackPush(ts UnsignedType) { - c.stack = append(c.stack, ts) -} - -// emit adds the operations into the result. -func (c *Compiler) emit(op UnionOperation) { - if !c.unreachableState.on { - switch op.Kind { - case OperationKindDrop: - // If the drop range is nil, - // we could remove such operations. - // That happens when drop operation is unnecessary. - // i.e. when there's no need to adjust stack before jmp. - if int64(op.U1) == -1 { - return - } - } - c.result.Operations = append(c.result.Operations, op) - if c.needSourceOffset { - c.result.IROperationSourceOffsetsInWasmBinary = append(c.result.IROperationSourceOffsetsInWasmBinary, - c.currentOpPC+c.bodyOffsetInCodeSection) - } - } -} - -// Emit const expression with default values of the given type. -func (c *Compiler) emitDefaultValue(t wasm.ValueType) { - switch t { - case wasm.ValueTypeI32: - c.stackPush(UnsignedTypeI32) - c.emit(NewOperationConstI32(0)) - case wasm.ValueTypeI64, wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - c.stackPush(UnsignedTypeI64) - c.emit(NewOperationConstI64(0)) - case wasm.ValueTypeF32: - c.stackPush(UnsignedTypeF32) - c.emit(NewOperationConstF32(0)) - case wasm.ValueTypeF64: - c.stackPush(UnsignedTypeF64) - c.emit(NewOperationConstF64(0)) - case wasm.ValueTypeV128: - c.stackPush(UnsignedTypeV128) - c.emit(NewOperationV128Const(0, 0)) - } -} - -// Returns the "depth" (starting from top of the stack) -// of the n-th local. -func (c *Compiler) localDepth(index wasm.Index) int { - height := c.localIndexToStackHeightInUint64[index] - return c.stackLenInUint64(len(c.stack)) - 1 - int(height) -} - -func (c *Compiler) localType(index wasm.Index) (t wasm.ValueType) { - if params := uint32(len(c.sig.Params)); index < params { - t = c.sig.Params[index] - } else { - t = c.localTypes[index-params] - } - return -} - -// getFrameDropRange returns the range (starting from top of the stack) that spans across the (uint64) stack. The range is -// supposed to be dropped from the stack when the given frame exists or branch into it. -// -// * frame is the control frame which the call-site is trying to branch into or exit. -// * isEnd true if the call-site is handling wasm.OpcodeEnd. -func (c *Compiler) getFrameDropRange(frame *controlFrame, isEnd bool) InclusiveRange { - var start int - if !isEnd && frame.kind == controlFrameKindLoop { - // If this is not End and the call-site is trying to branch into the Loop control frame, - // we have to Start executing from the beginning of the loop block. - // Therefore, we have to pass the inputs to the frame. - start = frame.blockType.ParamNumInUint64 - } else { - start = frame.blockType.ResultNumInUint64 - } - var end int - if frame.kind == controlFrameKindFunction { - // On the function return, we eliminate all the contents on the stack - // including locals (existing below of frame.originalStackLen) - end = c.stackLenInUint64(len(c.stack)) - 1 - } else { - end = c.stackLenInUint64(len(c.stack)) - 1 - c.stackLenInUint64(frame.originalStackLenWithoutParam) - } - if start <= end { - return InclusiveRange{Start: int32(start), End: int32(end)} - } else { - return NopInclusiveRange - } -} - -func (c *Compiler) stackLenInUint64(ceil int) (ret int) { - for i := 0; i < ceil; i++ { - if c.stack[i] == UnsignedTypeV128 { - ret += 2 - } else { - ret++ - } - } - return -} - -func (c *Compiler) readMemoryArg(tag string) (MemoryArg, error) { - c.result.UsesMemory = true - alignment, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return MemoryArg{}, fmt.Errorf("reading alignment for %s: %w", tag, err) - } - c.pc += num - offset, num, err := leb128.LoadUint32(c.body[c.pc+1:]) - if err != nil { - return MemoryArg{}, fmt.Errorf("reading offset for %s: %w", tag, err) - } - c.pc += num - return MemoryArg{Offset: offset, Alignment: alignment}, nil -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/format.go b/vendor/github.com/tetratelabs/wazero/internal/wazeroir/format.go deleted file mode 100644 index 789de00297..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/format.go +++ /dev/null @@ -1,24 +0,0 @@ -package wazeroir - -import ( - "bytes" -) - -const EntrypointLabel = ".entrypoint" - -func Format(ops []UnionOperation) string { - buf := bytes.NewBuffer(nil) - - _, _ = buf.WriteString(EntrypointLabel + "\n") - for i := range ops { - op := &ops[i] - str := op.String() - isLabel := op.Kind == OperationKindLabel - if !isLabel { - const indent = "\t" - str = indent + str - } - _, _ = buf.WriteString(str + "\n") - } - return buf.String() -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/operations.go b/vendor/github.com/tetratelabs/wazero/internal/wazeroir/operations.go deleted file mode 100644 index 4041944a48..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/operations.go +++ /dev/null @@ -1,2567 +0,0 @@ -package wazeroir - -import ( - "fmt" - "math" - "strings" -) - -// UnsignedInt represents unsigned 32-bit or 64-bit integers. -type UnsignedInt byte - -const ( - UnsignedInt32 UnsignedInt = iota - UnsignedInt64 -) - -// String implements fmt.Stringer. -func (s UnsignedInt) String() (ret string) { - switch s { - case UnsignedInt32: - ret = "i32" - case UnsignedInt64: - ret = "i64" - } - return -} - -// SignedInt represents signed or unsigned integers. -type SignedInt byte - -const ( - SignedInt32 SignedInt = iota - SignedInt64 - SignedUint32 - SignedUint64 -) - -// String implements fmt.Stringer. -func (s SignedInt) String() (ret string) { - switch s { - case SignedUint32: - ret = "u32" - case SignedUint64: - ret = "u64" - case SignedInt32: - ret = "s32" - case SignedInt64: - ret = "s64" - } - return -} - -// Float represents the scalar double or single precision floating points. -type Float byte - -const ( - Float32 Float = iota - Float64 -) - -// String implements fmt.Stringer. -func (s Float) String() (ret string) { - switch s { - case Float32: - ret = "f32" - case Float64: - ret = "f64" - } - return -} - -// UnsignedType is the union of UnsignedInt, Float and V128 vector type. -type UnsignedType byte - -const ( - UnsignedTypeI32 UnsignedType = iota - UnsignedTypeI64 - UnsignedTypeF32 - UnsignedTypeF64 - UnsignedTypeV128 - UnsignedTypeUnknown -) - -// String implements fmt.Stringer. -func (s UnsignedType) String() (ret string) { - switch s { - case UnsignedTypeI32: - ret = "i32" - case UnsignedTypeI64: - ret = "i64" - case UnsignedTypeF32: - ret = "f32" - case UnsignedTypeF64: - ret = "f64" - case UnsignedTypeV128: - ret = "v128" - case UnsignedTypeUnknown: - ret = "unknown" - } - return -} - -// SignedType is the union of SignedInt and Float types. -type SignedType byte - -const ( - SignedTypeInt32 SignedType = iota - SignedTypeUint32 - SignedTypeInt64 - SignedTypeUint64 - SignedTypeFloat32 - SignedTypeFloat64 -) - -// String implements fmt.Stringer. -func (s SignedType) String() (ret string) { - switch s { - case SignedTypeInt32: - ret = "s32" - case SignedTypeUint32: - ret = "u32" - case SignedTypeInt64: - ret = "s64" - case SignedTypeUint64: - ret = "u64" - case SignedTypeFloat32: - ret = "f32" - case SignedTypeFloat64: - ret = "f64" - } - return -} - -// OperationKind is the Kind of each implementation of Operation interface. -type OperationKind uint16 - -// String implements fmt.Stringer. -func (o OperationKind) String() (ret string) { - switch o { - case OperationKindUnreachable: - ret = "Unreachable" - case OperationKindLabel: - ret = "label" - case OperationKindBr: - ret = "Br" - case OperationKindBrIf: - ret = "BrIf" - case OperationKindBrTable: - ret = "BrTable" - case OperationKindCall: - ret = "Call" - case OperationKindCallIndirect: - ret = "CallIndirect" - case OperationKindDrop: - ret = "Drop" - case OperationKindSelect: - ret = "Select" - case OperationKindPick: - ret = "Pick" - case OperationKindSet: - ret = "Swap" - case OperationKindGlobalGet: - ret = "GlobalGet" - case OperationKindGlobalSet: - ret = "GlobalSet" - case OperationKindLoad: - ret = "Load" - case OperationKindLoad8: - ret = "Load8" - case OperationKindLoad16: - ret = "Load16" - case OperationKindLoad32: - ret = "Load32" - case OperationKindStore: - ret = "Store" - case OperationKindStore8: - ret = "Store8" - case OperationKindStore16: - ret = "Store16" - case OperationKindStore32: - ret = "Store32" - case OperationKindMemorySize: - ret = "MemorySize" - case OperationKindMemoryGrow: - ret = "MemoryGrow" - case OperationKindConstI32: - ret = "ConstI32" - case OperationKindConstI64: - ret = "ConstI64" - case OperationKindConstF32: - ret = "ConstF32" - case OperationKindConstF64: - ret = "ConstF64" - case OperationKindEq: - ret = "Eq" - case OperationKindNe: - ret = "Ne" - case OperationKindEqz: - ret = "Eqz" - case OperationKindLt: - ret = "Lt" - case OperationKindGt: - ret = "Gt" - case OperationKindLe: - ret = "Le" - case OperationKindGe: - ret = "Ge" - case OperationKindAdd: - ret = "Add" - case OperationKindSub: - ret = "Sub" - case OperationKindMul: - ret = "Mul" - case OperationKindClz: - ret = "Clz" - case OperationKindCtz: - ret = "Ctz" - case OperationKindPopcnt: - ret = "Popcnt" - case OperationKindDiv: - ret = "Div" - case OperationKindRem: - ret = "Rem" - case OperationKindAnd: - ret = "And" - case OperationKindOr: - ret = "Or" - case OperationKindXor: - ret = "Xor" - case OperationKindShl: - ret = "Shl" - case OperationKindShr: - ret = "Shr" - case OperationKindRotl: - ret = "Rotl" - case OperationKindRotr: - ret = "Rotr" - case OperationKindAbs: - ret = "Abs" - case OperationKindNeg: - ret = "Neg" - case OperationKindCeil: - ret = "Ceil" - case OperationKindFloor: - ret = "Floor" - case OperationKindTrunc: - ret = "Trunc" - case OperationKindNearest: - ret = "Nearest" - case OperationKindSqrt: - ret = "Sqrt" - case OperationKindMin: - ret = "Min" - case OperationKindMax: - ret = "Max" - case OperationKindCopysign: - ret = "Copysign" - case OperationKindI32WrapFromI64: - ret = "I32WrapFromI64" - case OperationKindITruncFromF: - ret = "ITruncFromF" - case OperationKindFConvertFromI: - ret = "FConvertFromI" - case OperationKindF32DemoteFromF64: - ret = "F32DemoteFromF64" - case OperationKindF64PromoteFromF32: - ret = "F64PromoteFromF32" - case OperationKindI32ReinterpretFromF32: - ret = "I32ReinterpretFromF32" - case OperationKindI64ReinterpretFromF64: - ret = "I64ReinterpretFromF64" - case OperationKindF32ReinterpretFromI32: - ret = "F32ReinterpretFromI32" - case OperationKindF64ReinterpretFromI64: - ret = "F64ReinterpretFromI64" - case OperationKindExtend: - ret = "Extend" - case OperationKindMemoryInit: - ret = "MemoryInit" - case OperationKindDataDrop: - ret = "DataDrop" - case OperationKindMemoryCopy: - ret = "MemoryCopy" - case OperationKindMemoryFill: - ret = "MemoryFill" - case OperationKindTableInit: - ret = "TableInit" - case OperationKindElemDrop: - ret = "ElemDrop" - case OperationKindTableCopy: - ret = "TableCopy" - case OperationKindRefFunc: - ret = "RefFunc" - case OperationKindTableGet: - ret = "TableGet" - case OperationKindTableSet: - ret = "TableSet" - case OperationKindTableSize: - ret = "TableSize" - case OperationKindTableGrow: - ret = "TableGrow" - case OperationKindTableFill: - ret = "TableFill" - case OperationKindV128Const: - ret = "ConstV128" - case OperationKindV128Add: - ret = "V128Add" - case OperationKindV128Sub: - ret = "V128Sub" - case OperationKindV128Load: - ret = "V128Load" - case OperationKindV128LoadLane: - ret = "V128LoadLane" - case OperationKindV128Store: - ret = "V128Store" - case OperationKindV128StoreLane: - ret = "V128StoreLane" - case OperationKindV128ExtractLane: - ret = "V128ExtractLane" - case OperationKindV128ReplaceLane: - ret = "V128ReplaceLane" - case OperationKindV128Splat: - ret = "V128Splat" - case OperationKindV128Shuffle: - ret = "V128Shuffle" - case OperationKindV128Swizzle: - ret = "V128Swizzle" - case OperationKindV128AnyTrue: - ret = "V128AnyTrue" - case OperationKindV128AllTrue: - ret = "V128AllTrue" - case OperationKindV128And: - ret = "V128And" - case OperationKindV128Not: - ret = "V128Not" - case OperationKindV128Or: - ret = "V128Or" - case OperationKindV128Xor: - ret = "V128Xor" - case OperationKindV128Bitselect: - ret = "V128Bitselect" - case OperationKindV128AndNot: - ret = "V128AndNot" - case OperationKindV128BitMask: - ret = "V128BitMask" - case OperationKindV128Shl: - ret = "V128Shl" - case OperationKindV128Shr: - ret = "V128Shr" - case OperationKindV128Cmp: - ret = "V128Cmp" - case OperationKindSignExtend32From8: - ret = "SignExtend32From8" - case OperationKindSignExtend32From16: - ret = "SignExtend32From16" - case OperationKindSignExtend64From8: - ret = "SignExtend64From8" - case OperationKindSignExtend64From16: - ret = "SignExtend64From16" - case OperationKindSignExtend64From32: - ret = "SignExtend64From32" - case OperationKindV128AddSat: - ret = "V128AddSat" - case OperationKindV128SubSat: - ret = "V128SubSat" - case OperationKindV128Mul: - ret = "V128Mul" - case OperationKindV128Div: - ret = "V128Div" - case OperationKindV128Neg: - ret = "V128Neg" - case OperationKindV128Sqrt: - ret = "V128Sqrt" - case OperationKindV128Abs: - ret = "V128Abs" - case OperationKindV128Popcnt: - ret = "V128Popcnt" - case OperationKindV128Min: - ret = "V128Min" - case OperationKindV128Max: - ret = "V128Max" - case OperationKindV128AvgrU: - ret = "V128AvgrU" - case OperationKindV128Ceil: - ret = "V128Ceil" - case OperationKindV128Floor: - ret = "V128Floor" - case OperationKindV128Trunc: - ret = "V128Trunc" - case OperationKindV128Nearest: - ret = "V128Nearest" - case OperationKindV128Pmin: - ret = "V128Pmin" - case OperationKindV128Pmax: - ret = "V128Pmax" - case OperationKindV128Extend: - ret = "V128Extend" - case OperationKindV128ExtMul: - ret = "V128ExtMul" - case OperationKindV128Q15mulrSatS: - ret = "V128Q15mulrSatS" - case OperationKindV128ExtAddPairwise: - ret = "V128ExtAddPairwise" - case OperationKindV128FloatPromote: - ret = "V128FloatPromote" - case OperationKindV128FloatDemote: - ret = "V128FloatDemote" - case OperationKindV128FConvertFromI: - ret = "V128FConvertFromI" - case OperationKindV128Dot: - ret = "V128Dot" - case OperationKindV128Narrow: - ret = "V128Narrow" - case OperationKindV128ITruncSatFromF: - ret = "V128ITruncSatFromF" - case OperationKindBuiltinFunctionCheckExitCode: - ret = "BuiltinFunctionCheckExitCode" - default: - panic(fmt.Errorf("unknown operation %d", o)) - } - return -} - -const ( - // OperationKindUnreachable is the Kind for NewOperationUnreachable. - OperationKindUnreachable OperationKind = iota - // OperationKindLabel is the Kind for NewOperationLabel. - OperationKindLabel - // OperationKindBr is the Kind for NewOperationBr. - OperationKindBr - // OperationKindBrIf is the Kind for NewOperationBrIf. - OperationKindBrIf - // OperationKindBrTable is the Kind for NewOperationBrTable. - OperationKindBrTable - // OperationKindCall is the Kind for NewOperationCall. - OperationKindCall - // OperationKindCallIndirect is the Kind for NewOperationCallIndirect. - OperationKindCallIndirect - // OperationKindDrop is the Kind for NewOperationDrop. - OperationKindDrop - // OperationKindSelect is the Kind for NewOperationSelect. - OperationKindSelect - // OperationKindPick is the Kind for NewOperationPick. - OperationKindPick - // OperationKindSet is the Kind for NewOperationSet. - OperationKindSet - // OperationKindGlobalGet is the Kind for NewOperationGlobalGet. - OperationKindGlobalGet - // OperationKindGlobalSet is the Kind for NewOperationGlobalSet. - OperationKindGlobalSet - // OperationKindLoad is the Kind for NewOperationLoad. - OperationKindLoad - // OperationKindLoad8 is the Kind for NewOperationLoad8. - OperationKindLoad8 - // OperationKindLoad16 is the Kind for NewOperationLoad16. - OperationKindLoad16 - // OperationKindLoad32 is the Kind for NewOperationLoad32. - OperationKindLoad32 - // OperationKindStore is the Kind for NewOperationStore. - OperationKindStore - // OperationKindStore8 is the Kind for NewOperationStore8. - OperationKindStore8 - // OperationKindStore16 is the Kind for NewOperationStore16. - OperationKindStore16 - // OperationKindStore32 is the Kind for NewOperationStore32. - OperationKindStore32 - // OperationKindMemorySize is the Kind for NewOperationMemorySize. - OperationKindMemorySize - // OperationKindMemoryGrow is the Kind for NewOperationMemoryGrow. - OperationKindMemoryGrow - // OperationKindConstI32 is the Kind for NewOperationConstI32. - OperationKindConstI32 - // OperationKindConstI64 is the Kind for NewOperationConstI64. - OperationKindConstI64 - // OperationKindConstF32 is the Kind for NewOperationConstF32. - OperationKindConstF32 - // OperationKindConstF64 is the Kind for NewOperationConstF64. - OperationKindConstF64 - // OperationKindEq is the Kind for NewOperationEq. - OperationKindEq - // OperationKindNe is the Kind for NewOperationNe. - OperationKindNe - // OperationKindEqz is the Kind for NewOperationEqz. - OperationKindEqz - // OperationKindLt is the Kind for NewOperationLt. - OperationKindLt - // OperationKindGt is the Kind for NewOperationGt. - OperationKindGt - // OperationKindLe is the Kind for NewOperationLe. - OperationKindLe - // OperationKindGe is the Kind for NewOperationGe. - OperationKindGe - // OperationKindAdd is the Kind for NewOperationAdd. - OperationKindAdd - // OperationKindSub is the Kind for NewOperationSub. - OperationKindSub - // OperationKindMul is the Kind for NewOperationMul. - OperationKindMul - // OperationKindClz is the Kind for NewOperationClz. - OperationKindClz - // OperationKindCtz is the Kind for NewOperationCtz. - OperationKindCtz - // OperationKindPopcnt is the Kind for NewOperationPopcnt. - OperationKindPopcnt - // OperationKindDiv is the Kind for NewOperationDiv. - OperationKindDiv - // OperationKindRem is the Kind for NewOperationRem. - OperationKindRem - // OperationKindAnd is the Kind for NewOperationAnd. - OperationKindAnd - // OperationKindOr is the Kind for NewOperationOr. - OperationKindOr - // OperationKindXor is the Kind for NewOperationXor. - OperationKindXor - // OperationKindShl is the Kind for NewOperationShl. - OperationKindShl - // OperationKindShr is the Kind for NewOperationShr. - OperationKindShr - // OperationKindRotl is the Kind for NewOperationRotl. - OperationKindRotl - // OperationKindRotr is the Kind for NewOperationRotr. - OperationKindRotr - // OperationKindAbs is the Kind for NewOperationAbs. - OperationKindAbs - // OperationKindNeg is the Kind for NewOperationNeg. - OperationKindNeg - // OperationKindCeil is the Kind for NewOperationCeil. - OperationKindCeil - // OperationKindFloor is the Kind for NewOperationFloor. - OperationKindFloor - // OperationKindTrunc is the Kind for NewOperationTrunc. - OperationKindTrunc - // OperationKindNearest is the Kind for NewOperationNearest. - OperationKindNearest - // OperationKindSqrt is the Kind for NewOperationSqrt. - OperationKindSqrt - // OperationKindMin is the Kind for NewOperationMin. - OperationKindMin - // OperationKindMax is the Kind for NewOperationMax. - OperationKindMax - // OperationKindCopysign is the Kind for NewOperationCopysign. - OperationKindCopysign - // OperationKindI32WrapFromI64 is the Kind for NewOperationI32WrapFromI64. - OperationKindI32WrapFromI64 - // OperationKindITruncFromF is the Kind for NewOperationITruncFromF. - OperationKindITruncFromF - // OperationKindFConvertFromI is the Kind for NewOperationFConvertFromI. - OperationKindFConvertFromI - // OperationKindF32DemoteFromF64 is the Kind for NewOperationF32DemoteFromF64. - OperationKindF32DemoteFromF64 - // OperationKindF64PromoteFromF32 is the Kind for NewOperationF64PromoteFromF32. - OperationKindF64PromoteFromF32 - // OperationKindI32ReinterpretFromF32 is the Kind for NewOperationI32ReinterpretFromF32. - OperationKindI32ReinterpretFromF32 - // OperationKindI64ReinterpretFromF64 is the Kind for NewOperationI64ReinterpretFromF64. - OperationKindI64ReinterpretFromF64 - // OperationKindF32ReinterpretFromI32 is the Kind for NewOperationF32ReinterpretFromI32. - OperationKindF32ReinterpretFromI32 - // OperationKindF64ReinterpretFromI64 is the Kind for NewOperationF64ReinterpretFromI64. - OperationKindF64ReinterpretFromI64 - // OperationKindExtend is the Kind for NewOperationExtend. - OperationKindExtend - // OperationKindSignExtend32From8 is the Kind for NewOperationSignExtend32From8. - OperationKindSignExtend32From8 - // OperationKindSignExtend32From16 is the Kind for NewOperationSignExtend32From16. - OperationKindSignExtend32From16 - // OperationKindSignExtend64From8 is the Kind for NewOperationSignExtend64From8. - OperationKindSignExtend64From8 - // OperationKindSignExtend64From16 is the Kind for NewOperationSignExtend64From16. - OperationKindSignExtend64From16 - // OperationKindSignExtend64From32 is the Kind for NewOperationSignExtend64From32. - OperationKindSignExtend64From32 - // OperationKindMemoryInit is the Kind for NewOperationMemoryInit. - OperationKindMemoryInit - // OperationKindDataDrop is the Kind for NewOperationDataDrop. - OperationKindDataDrop - // OperationKindMemoryCopy is the Kind for NewOperationMemoryCopy. - OperationKindMemoryCopy - // OperationKindMemoryFill is the Kind for NewOperationMemoryFill. - OperationKindMemoryFill - // OperationKindTableInit is the Kind for NewOperationTableInit. - OperationKindTableInit - // OperationKindElemDrop is the Kind for NewOperationElemDrop. - OperationKindElemDrop - // OperationKindTableCopy is the Kind for NewOperationTableCopy. - OperationKindTableCopy - // OperationKindRefFunc is the Kind for NewOperationRefFunc. - OperationKindRefFunc - // OperationKindTableGet is the Kind for NewOperationTableGet. - OperationKindTableGet - // OperationKindTableSet is the Kind for NewOperationTableSet. - OperationKindTableSet - // OperationKindTableSize is the Kind for NewOperationTableSize. - OperationKindTableSize - // OperationKindTableGrow is the Kind for NewOperationTableGrow. - OperationKindTableGrow - // OperationKindTableFill is the Kind for NewOperationTableFill. - OperationKindTableFill - - // Vector value related instructions are prefixed by V128. - - // OperationKindV128Const is the Kind for NewOperationV128Const. - OperationKindV128Const - // OperationKindV128Add is the Kind for NewOperationV128Add. - OperationKindV128Add - // OperationKindV128Sub is the Kind for NewOperationV128Sub. - OperationKindV128Sub - // OperationKindV128Load is the Kind for NewOperationV128Load. - OperationKindV128Load - // OperationKindV128LoadLane is the Kind for NewOperationV128LoadLane. - OperationKindV128LoadLane - // OperationKindV128Store is the Kind for NewOperationV128Store. - OperationKindV128Store - // OperationKindV128StoreLane is the Kind for NewOperationV128StoreLane. - OperationKindV128StoreLane - // OperationKindV128ExtractLane is the Kind for NewOperationV128ExtractLane. - OperationKindV128ExtractLane - // OperationKindV128ReplaceLane is the Kind for NewOperationV128ReplaceLane. - OperationKindV128ReplaceLane - // OperationKindV128Splat is the Kind for NewOperationV128Splat. - OperationKindV128Splat - // OperationKindV128Shuffle is the Kind for NewOperationV128Shuffle. - OperationKindV128Shuffle - // OperationKindV128Swizzle is the Kind for NewOperationV128Swizzle. - OperationKindV128Swizzle - // OperationKindV128AnyTrue is the Kind for NewOperationV128AnyTrue. - OperationKindV128AnyTrue - // OperationKindV128AllTrue is the Kind for NewOperationV128AllTrue. - OperationKindV128AllTrue - // OperationKindV128BitMask is the Kind for NewOperationV128BitMask. - OperationKindV128BitMask - // OperationKindV128And is the Kind for NewOperationV128And. - OperationKindV128And - // OperationKindV128Not is the Kind for NewOperationV128Not. - OperationKindV128Not - // OperationKindV128Or is the Kind for NewOperationV128Or. - OperationKindV128Or - // OperationKindV128Xor is the Kind for NewOperationV128Xor. - OperationKindV128Xor - // OperationKindV128Bitselect is the Kind for NewOperationV128Bitselect. - OperationKindV128Bitselect - // OperationKindV128AndNot is the Kind for NewOperationV128AndNot. - OperationKindV128AndNot - // OperationKindV128Shl is the Kind for NewOperationV128Shl. - OperationKindV128Shl - // OperationKindV128Shr is the Kind for NewOperationV128Shr. - OperationKindV128Shr - // OperationKindV128Cmp is the Kind for NewOperationV128Cmp. - OperationKindV128Cmp - // OperationKindV128AddSat is the Kind for NewOperationV128AddSat. - OperationKindV128AddSat - // OperationKindV128SubSat is the Kind for NewOperationV128SubSat. - OperationKindV128SubSat - // OperationKindV128Mul is the Kind for NewOperationV128Mul. - OperationKindV128Mul - // OperationKindV128Div is the Kind for NewOperationV128Div. - OperationKindV128Div - // OperationKindV128Neg is the Kind for NewOperationV128Neg. - OperationKindV128Neg - // OperationKindV128Sqrt is the Kind for NewOperationV128Sqrt. - OperationKindV128Sqrt - // OperationKindV128Abs is the Kind for NewOperationV128Abs. - OperationKindV128Abs - // OperationKindV128Popcnt is the Kind for NewOperationV128Popcnt. - OperationKindV128Popcnt - // OperationKindV128Min is the Kind for NewOperationV128Min. - OperationKindV128Min - // OperationKindV128Max is the Kind for NewOperationV128Max. - OperationKindV128Max - // OperationKindV128AvgrU is the Kind for NewOperationV128AvgrU. - OperationKindV128AvgrU - // OperationKindV128Pmin is the Kind for NewOperationV128Pmin. - OperationKindV128Pmin - // OperationKindV128Pmax is the Kind for NewOperationV128Pmax. - OperationKindV128Pmax - // OperationKindV128Ceil is the Kind for NewOperationV128Ceil. - OperationKindV128Ceil - // OperationKindV128Floor is the Kind for NewOperationV128Floor. - OperationKindV128Floor - // OperationKindV128Trunc is the Kind for NewOperationV128Trunc. - OperationKindV128Trunc - // OperationKindV128Nearest is the Kind for NewOperationV128Nearest. - OperationKindV128Nearest - // OperationKindV128Extend is the Kind for NewOperationV128Extend. - OperationKindV128Extend - // OperationKindV128ExtMul is the Kind for NewOperationV128ExtMul. - OperationKindV128ExtMul - // OperationKindV128Q15mulrSatS is the Kind for NewOperationV128Q15mulrSatS. - OperationKindV128Q15mulrSatS - // OperationKindV128ExtAddPairwise is the Kind for NewOperationV128ExtAddPairwise. - OperationKindV128ExtAddPairwise - // OperationKindV128FloatPromote is the Kind for NewOperationV128FloatPromote. - OperationKindV128FloatPromote - // OperationKindV128FloatDemote is the Kind for NewOperationV128FloatDemote. - OperationKindV128FloatDemote - // OperationKindV128FConvertFromI is the Kind for NewOperationV128FConvertFromI. - OperationKindV128FConvertFromI - // OperationKindV128Dot is the Kind for NewOperationV128Dot. - OperationKindV128Dot - // OperationKindV128Narrow is the Kind for NewOperationV128Narrow. - OperationKindV128Narrow - // OperationKindV128ITruncSatFromF is the Kind for NewOperationV128ITruncSatFromF. - OperationKindV128ITruncSatFromF - - // OperationKindBuiltinFunctionCheckExitCode is the Kind for NewOperationBuiltinFunctionCheckExitCode. - OperationKindBuiltinFunctionCheckExitCode - - // operationKindEnd is always placed at the bottom of this iota definition to be used in the test. - operationKindEnd -) - -// NewOperationBuiltinFunctionCheckExitCode is a constructor for UnionOperation with Kind OperationKindBuiltinFunctionCheckExitCode. -// -// OperationBuiltinFunctionCheckExitCode corresponds to the instruction to check the api.Module is already closed due to -// context.DeadlineExceeded, context.Canceled, or the explicit call of CloseWithExitCode on api.Module. -func NewOperationBuiltinFunctionCheckExitCode() UnionOperation { - return UnionOperation{Kind: OperationKindBuiltinFunctionCheckExitCode} -} - -// Label is the unique identifier for each block in a single function in wazeroir -// where "block" consists of multiple operations, and must End with branching operations -// (e.g. OperationKindBr or OperationKindBrIf). -type Label uint64 - -// Kind returns the LabelKind encoded in this Label. -func (l Label) Kind() LabelKind { - return LabelKind(uint32(l)) -} - -// FrameID returns the frame id encoded in this Label. -func (l Label) FrameID() int { - return int(uint32(l >> 32)) -} - -// NewLabel is a constructor for a Label. -func NewLabel(kind LabelKind, frameID uint32) Label { - return Label(kind) | Label(frameID)<<32 -} - -// String implements fmt.Stringer. -func (l Label) String() (ret string) { - frameID := l.FrameID() - switch l.Kind() { - case LabelKindHeader: - ret = fmt.Sprintf(".L%d", frameID) - case LabelKindElse: - ret = fmt.Sprintf(".L%d_else", frameID) - case LabelKindContinuation: - ret = fmt.Sprintf(".L%d_cont", frameID) - case LabelKindReturn: - return ".return" - } - return -} - -func (l Label) IsReturnTarget() bool { - return l.Kind() == LabelKindReturn -} - -// LabelKind is the Kind of the label. -type LabelKind = byte - -const ( - // LabelKindHeader is the header for various blocks. For example, the "then" block of - // wasm.OpcodeIfName in Wasm has the label of this Kind. - LabelKindHeader LabelKind = iota - // LabelKindElse is the Kind of label for "else" block of wasm.OpcodeIfName in Wasm. - LabelKindElse - // LabelKindContinuation is the Kind of label which is the continuation of blocks. - // For example, for wasm text like - // (func - // .... - // (if (local.get 0) (then (nop)) (else (nop))) - // return - // ) - // we have the continuation block (of if-block) corresponding to "return" opcode. - LabelKindContinuation - LabelKindReturn - LabelKindNum -) - -// UnionOperation implements Operation and is the compilation (engine.lowerIR) result of a wazeroir.Operation. -// -// Not all operations result in a UnionOperation, e.g. wazeroir.OperationI32ReinterpretFromF32, and some operations are -// more complex than others, e.g. wazeroir.NewOperationBrTable. -// -// Note: This is a form of union type as it can store fields needed for any operation. Hence, most fields are opaque and -// only relevant when in context of its kind. -type UnionOperation struct { - // Kind determines how to interpret the other fields in this struct. - Kind OperationKind - B1, B2 byte - B3 bool - U1, U2 uint64 - U3 uint64 - Us []uint64 -} - -// String implements fmt.Stringer. -func (o UnionOperation) String() string { - switch o.Kind { - case OperationKindUnreachable, - OperationKindSelect, - OperationKindMemorySize, - OperationKindMemoryGrow, - OperationKindI32WrapFromI64, - OperationKindF32DemoteFromF64, - OperationKindF64PromoteFromF32, - OperationKindI32ReinterpretFromF32, - OperationKindI64ReinterpretFromF64, - OperationKindF32ReinterpretFromI32, - OperationKindF64ReinterpretFromI64, - OperationKindSignExtend32From8, - OperationKindSignExtend32From16, - OperationKindSignExtend64From8, - OperationKindSignExtend64From16, - OperationKindSignExtend64From32, - OperationKindMemoryInit, - OperationKindDataDrop, - OperationKindMemoryCopy, - OperationKindMemoryFill, - OperationKindTableInit, - OperationKindElemDrop, - OperationKindTableCopy, - OperationKindRefFunc, - OperationKindTableGet, - OperationKindTableSet, - OperationKindTableSize, - OperationKindTableGrow, - OperationKindTableFill, - OperationKindBuiltinFunctionCheckExitCode: - return o.Kind.String() - - case OperationKindCall, - OperationKindGlobalGet, - OperationKindGlobalSet: - return fmt.Sprintf("%s %d", o.Kind, o.B1) - - case OperationKindLabel: - return Label(o.U1).String() - - case OperationKindBr: - return fmt.Sprintf("%s %s", o.Kind, Label(o.U1).String()) - - case OperationKindBrIf: - thenTarget := Label(o.U1) - elseTarget := Label(o.U2) - return fmt.Sprintf("%s %s, %s", o.Kind, thenTarget, elseTarget) - - case OperationKindBrTable: - var targets []string - var defaultLabel Label - if len(o.Us) > 0 { - targets = make([]string, len(o.Us)-1) - for i, t := range o.Us[1:] { - targets[i] = Label(t).String() - } - defaultLabel = Label(o.Us[0]) - } - return fmt.Sprintf("%s [%s] %s", o.Kind, strings.Join(targets, ","), defaultLabel) - - case OperationKindCallIndirect: - return fmt.Sprintf("%s: type=%d, table=%d", o.Kind, o.U1, o.U2) - - case OperationKindDrop: - start := int64(o.U1) - end := int64(o.U2) - return fmt.Sprintf("%s %d..%d", o.Kind, start, end) - - case OperationKindPick, OperationKindSet: - return fmt.Sprintf("%s %d (is_vector=%v)", o.Kind, o.U1, o.B3) - - case OperationKindLoad, OperationKindStore: - return fmt.Sprintf("%s.%s (align=%d, offset=%d)", UnsignedType(o.B1), o.Kind, o.U1, o.U2) - - case OperationKindLoad8, - OperationKindLoad16: - return fmt.Sprintf("%s.%s (align=%d, offset=%d)", SignedType(o.B1), o.Kind, o.U1, o.U2) - - case OperationKindStore8, - OperationKindStore16, - OperationKindStore32: - return fmt.Sprintf("%s (align=%d, offset=%d)", o.Kind, o.U1, o.U2) - - case OperationKindLoad32: - var t string - if o.B1 == 1 { - t = "i64" - } else { - t = "u64" - } - return fmt.Sprintf("%s.%s (align=%d, offset=%d)", t, o.Kind, o.U1, o.U2) - - case OperationKindEq, - OperationKindNe, - OperationKindAdd, - OperationKindSub, - OperationKindMul: - return fmt.Sprintf("%s.%s", UnsignedType(o.B1), o.Kind) - - case OperationKindEqz, - OperationKindClz, - OperationKindCtz, - OperationKindPopcnt, - OperationKindAnd, - OperationKindOr, - OperationKindXor, - OperationKindShl, - OperationKindRotl, - OperationKindRotr: - return fmt.Sprintf("%s.%s", UnsignedInt(o.B1), o.Kind) - - case OperationKindRem, OperationKindShr: - return fmt.Sprintf("%s.%s", SignedInt(o.B1), o.Kind) - - case OperationKindLt, - OperationKindGt, - OperationKindLe, - OperationKindGe, - OperationKindDiv: - return fmt.Sprintf("%s.%s", SignedType(o.B1), o.Kind) - - case OperationKindAbs, - OperationKindNeg, - OperationKindCeil, - OperationKindFloor, - OperationKindTrunc, - OperationKindNearest, - OperationKindSqrt, - OperationKindMin, - OperationKindMax, - OperationKindCopysign: - return fmt.Sprintf("%s.%s", Float(o.B1), o.Kind) - - case OperationKindConstI32, - OperationKindConstI64: - return fmt.Sprintf("%s %#x", o.Kind, o.U1) - - case OperationKindConstF32: - return fmt.Sprintf("%s %f", o.Kind, math.Float32frombits(uint32(o.U1))) - case OperationKindConstF64: - return fmt.Sprintf("%s %f", o.Kind, math.Float64frombits(o.U1)) - - case OperationKindITruncFromF: - return fmt.Sprintf("%s.%s.%s (non_trapping=%v)", SignedInt(o.B2), o.Kind, Float(o.B1), o.B3) - case OperationKindFConvertFromI: - return fmt.Sprintf("%s.%s.%s", Float(o.B2), o.Kind, SignedInt(o.B1)) - case OperationKindExtend: - var in, out string - if o.B3 { - in = "i32" - out = "i64" - } else { - in = "u32" - out = "u64" - } - return fmt.Sprintf("%s.%s.%s", out, o.Kind, in) - - case OperationKindV128Const: - return fmt.Sprintf("%s [%#x, %#x]", o.Kind, o.U1, o.U2) - case OperationKindV128Add, - OperationKindV128Sub: - return fmt.Sprintf("%s (shape=%s)", o.Kind, shapeName(o.B1)) - case OperationKindV128Load, - OperationKindV128LoadLane, - OperationKindV128Store, - OperationKindV128StoreLane, - OperationKindV128ExtractLane, - OperationKindV128ReplaceLane, - OperationKindV128Splat, - OperationKindV128Shuffle, - OperationKindV128Swizzle, - OperationKindV128AnyTrue, - OperationKindV128AllTrue, - OperationKindV128BitMask, - OperationKindV128And, - OperationKindV128Not, - OperationKindV128Or, - OperationKindV128Xor, - OperationKindV128Bitselect, - OperationKindV128AndNot, - OperationKindV128Shl, - OperationKindV128Shr, - OperationKindV128Cmp, - OperationKindV128AddSat, - OperationKindV128SubSat, - OperationKindV128Mul, - OperationKindV128Div, - OperationKindV128Neg, - OperationKindV128Sqrt, - OperationKindV128Abs, - OperationKindV128Popcnt, - OperationKindV128Min, - OperationKindV128Max, - OperationKindV128AvgrU, - OperationKindV128Pmin, - OperationKindV128Pmax, - OperationKindV128Ceil, - OperationKindV128Floor, - OperationKindV128Trunc, - OperationKindV128Nearest, - OperationKindV128Extend, - OperationKindV128ExtMul, - OperationKindV128Q15mulrSatS, - OperationKindV128ExtAddPairwise, - OperationKindV128FloatPromote, - OperationKindV128FloatDemote, - OperationKindV128FConvertFromI, - OperationKindV128Dot, - OperationKindV128Narrow: - return o.Kind.String() - - case OperationKindV128ITruncSatFromF: - if o.B3 { - return fmt.Sprintf("%s.%sS", o.Kind, shapeName(o.B1)) - } else { - return fmt.Sprintf("%s.%sU", o.Kind, shapeName(o.B1)) - } - - default: - panic(fmt.Sprintf("TODO: %v", o.Kind)) - } -} - -// NewOperationUnreachable is a constructor for UnionOperation with OperationKindUnreachable -// -// This corresponds to wasm.OpcodeUnreachable. -// -// The engines are expected to exit the execution with wasmruntime.ErrRuntimeUnreachable error. -func NewOperationUnreachable() UnionOperation { - return UnionOperation{Kind: OperationKindUnreachable} -} - -// NewOperationLabel is a constructor for UnionOperation with OperationKindLabel. -// -// This is used to inform the engines of the beginning of a label. -func NewOperationLabel(label Label) UnionOperation { - return UnionOperation{Kind: OperationKindLabel, U1: uint64(label)} -} - -// NewOperationBr is a constructor for UnionOperation with OperationKindBr. -// -// The engines are expected to branch into U1 label. -func NewOperationBr(target Label) UnionOperation { - return UnionOperation{Kind: OperationKindBr, U1: uint64(target)} -} - -// NewOperationBrIf is a constructor for UnionOperation with OperationKindBrIf. -// -// The engines are expected to pop a value and branch into U1 label if the value equals 1. -// Otherwise, the code branches into U2 label. -func NewOperationBrIf(thenTarget, elseTarget Label, thenDrop InclusiveRange) UnionOperation { - return UnionOperation{ - Kind: OperationKindBrIf, - U1: uint64(thenTarget), - U2: uint64(elseTarget), - U3: thenDrop.AsU64(), - } -} - -// NewOperationBrTable is a constructor for UnionOperation with OperationKindBrTable. -// -// This corresponds to wasm.OpcodeBrTableName except that the label -// here means the wazeroir level, not the ones of Wasm. -// -// The engines are expected to do the br_table operation based on the default (Us[len(Us)-1], Us[len(Us)-2]) and -// targets (Us[:len(Us)-1], Rs[:len(Us)-1]). More precisely, this pops a value from the stack (called "index") -// and decides which branch we go into next based on the value. -// -// For example, assume we have operations like {default: L_DEFAULT, targets: [L0, L1, L2]}. -// If "index" >= len(defaults), then branch into the L_DEFAULT label. -// Otherwise, we enter label of targets[index]. -func NewOperationBrTable(targetLabelsAndRanges []uint64) UnionOperation { - return UnionOperation{ - Kind: OperationKindBrTable, - Us: targetLabelsAndRanges, - } -} - -// NewOperationCall is a constructor for UnionOperation with OperationKindCall. -// -// This corresponds to wasm.OpcodeCallName, and engines are expected to -// enter into a function whose index equals OperationCall.FunctionIndex. -func NewOperationCall(functionIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindCall, U1: uint64(functionIndex)} -} - -// NewOperationCallIndirect implements Operation. -// -// This corresponds to wasm.OpcodeCallIndirectName, and engines are expected to -// consume the one value from the top of stack (called "offset"), -// and make a function call against the function whose function address equals -// Tables[OperationCallIndirect.TableIndex][offset]. -// -// Note: This is called indirect function call in the sense that the target function is indirectly -// determined by the current state (top value) of the stack. -// Therefore, two checks are performed at runtime before entering the target function: -// 1) whether "offset" exceeds the length of table Tables[OperationCallIndirect.TableIndex]. -// 2) whether the type of the function table[offset] matches the function type specified by OperationCallIndirect.TypeIndex. -func NewOperationCallIndirect(typeIndex, tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindCallIndirect, U1: uint64(typeIndex), U2: uint64(tableIndex)} -} - -// InclusiveRange is the range which spans across the value stack starting from the top to the bottom, and -// both boundary are included in the range. -type InclusiveRange struct { - Start, End int32 -} - -// AsU64 is be used to convert InclusiveRange to uint64 so that it can be stored in UnionOperation. -func (i InclusiveRange) AsU64() uint64 { - return uint64(uint32(i.Start))<<32 | uint64(uint32(i.End)) -} - -// InclusiveRangeFromU64 retrieves InclusiveRange from the given uint64 which is stored in UnionOperation. -func InclusiveRangeFromU64(v uint64) InclusiveRange { - return InclusiveRange{ - Start: int32(uint32(v >> 32)), - End: int32(uint32(v)), - } -} - -// NopInclusiveRange is InclusiveRange which corresponds to no-operation. -var NopInclusiveRange = InclusiveRange{Start: -1, End: -1} - -// NewOperationDrop is a constructor for UnionOperation with OperationKindDrop. -// -// The engines are expected to discard the values selected by NewOperationDrop.Depth which -// starts from the top of the stack to the bottom. -// -// depth spans across the uint64 value stack at runtime to be dropped by this operation. -func NewOperationDrop(depth InclusiveRange) UnionOperation { - return UnionOperation{Kind: OperationKindDrop, U1: depth.AsU64()} -} - -// NewOperationSelect is a constructor for UnionOperation with OperationKindSelect. -// -// This corresponds to wasm.OpcodeSelect. -// -// The engines are expected to pop three values, say [..., x2, x1, c], then if the value "c" equals zero, -// "x1" is pushed back onto the stack and, otherwise "x2" is pushed back. -// -// isTargetVector true if the selection target value's type is wasm.ValueTypeV128. -func NewOperationSelect(isTargetVector bool) UnionOperation { - return UnionOperation{Kind: OperationKindSelect, B3: isTargetVector} -} - -// NewOperationPick is a constructor for UnionOperation with OperationKindPick. -// -// The engines are expected to copy a value pointed by depth, and push the -// copied value onto the top of the stack. -// -// depth is the location of the pick target in the uint64 value stack at runtime. -// If isTargetVector=true, this points to the location of the lower 64-bits of the vector. -func NewOperationPick(depth int, isTargetVector bool) UnionOperation { - return UnionOperation{Kind: OperationKindPick, U1: uint64(depth), B3: isTargetVector} -} - -// NewOperationSet is a constructor for UnionOperation with OperationKindSet. -// -// The engines are expected to set the top value of the stack to the location specified by -// depth. -// -// depth is the location of the set target in the uint64 value stack at runtime. -// If isTargetVector=true, this points the location of the lower 64-bits of the vector. -func NewOperationSet(depth int, isTargetVector bool) UnionOperation { - return UnionOperation{Kind: OperationKindSet, U1: uint64(depth), B3: isTargetVector} -} - -// NewOperationGlobalGet is a constructor for UnionOperation with OperationKindGlobalGet. -// -// The engines are expected to read the global value specified by OperationGlobalGet.Index, -// and push the copy of the value onto the stack. -// -// See wasm.OpcodeGlobalGet. -func NewOperationGlobalGet(index uint32) UnionOperation { - return UnionOperation{Kind: OperationKindGlobalGet, U1: uint64(index)} -} - -// NewOperationGlobalSet is a constructor for UnionOperation with OperationKindGlobalSet. -// -// The engines are expected to consume the value from the top of the stack, -// and write the value into the global specified by OperationGlobalSet.Index. -// -// See wasm.OpcodeGlobalSet. -func NewOperationGlobalSet(index uint32) UnionOperation { - return UnionOperation{Kind: OperationKindGlobalSet, U1: uint64(index)} -} - -// MemoryArg is the "memarg" to all memory instructions. -// -// See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#memory-instructions%E2%91%A0 -type MemoryArg struct { - // Alignment the expected alignment (expressed as the exponent of a power of 2). Default to the natural alignment. - // - // "Natural alignment" is defined here as the smallest power of two that can hold the size of the value type. Ex - // wasm.ValueTypeI64 is encoded in 8 little-endian bytes. 2^3 = 8, so the natural alignment is three. - Alignment uint32 - - // Offset is the address offset added to the instruction's dynamic address operand, yielding a 33-bit effective - // address that is the zero-based index at which the memory is accessed. Default to zero. - Offset uint32 -} - -// NewOperationLoad is a constructor for UnionOperation with OperationKindLoad. -// -// This corresponds to wasm.OpcodeI32LoadName wasm.OpcodeI64LoadName wasm.OpcodeF32LoadName and wasm.OpcodeF64LoadName. -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationLoad(unsignedType UnsignedType, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindLoad, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationLoad8 is a constructor for UnionOperation with OperationKindLoad8. -// -// This corresponds to wasm.OpcodeI32Load8SName wasm.OpcodeI32Load8UName wasm.OpcodeI64Load8SName wasm.OpcodeI64Load8UName. -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationLoad8(signedInt SignedInt, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindLoad8, B1: byte(signedInt), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationLoad16 is a constructor for UnionOperation with OperationKindLoad16. -// -// This corresponds to wasm.OpcodeI32Load16SName wasm.OpcodeI32Load16UName wasm.OpcodeI64Load16SName wasm.OpcodeI64Load16UName. -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationLoad16(signedInt SignedInt, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindLoad16, B1: byte(signedInt), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationLoad32 is a constructor for UnionOperation with OperationKindLoad32. -// -// This corresponds to wasm.OpcodeI64Load32SName wasm.OpcodeI64Load32UName. -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise load the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationLoad32(signed bool, arg MemoryArg) UnionOperation { - sigB := byte(0) - if signed { - sigB = 1 - } - return UnionOperation{Kind: OperationKindLoad32, B1: sigB, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationStore is a constructor for UnionOperation with OperationKindStore. -// -// # This corresponds to wasm.OpcodeI32StoreName wasm.OpcodeI64StoreName wasm.OpcodeF32StoreName wasm.OpcodeF64StoreName -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationStore(unsignedType UnsignedType, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindStore, B1: byte(unsignedType), U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationStore8 is a constructor for UnionOperation with OperationKindStore8. -// -// # This corresponds to wasm.OpcodeI32Store8Name wasm.OpcodeI64Store8Name -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationStore8(arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindStore8, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationStore16 is a constructor for UnionOperation with OperationKindStore16. -// -// # This corresponds to wasm.OpcodeI32Store16Name wasm.OpcodeI64Store16Name -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationStore16(arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindStore16, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationStore32 is a constructor for UnionOperation with OperationKindStore32. -// -// # This corresponds to wasm.OpcodeI64Store32Name -// -// The engines are expected to check the boundary of memory length, and exit the execution if this exceeds the boundary, -// otherwise store the corresponding value following the semantics of the corresponding WebAssembly instruction. -func NewOperationStore32(arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindStore32, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationMemorySize is a constructor for UnionOperation with OperationKindMemorySize. -// -// This corresponds to wasm.OpcodeMemorySize. -// -// The engines are expected to push the current page size of the memory onto the stack. -func NewOperationMemorySize() UnionOperation { - return UnionOperation{Kind: OperationKindMemorySize} -} - -// NewOperationMemoryGrow is a constructor for UnionOperation with OperationKindMemoryGrow. -// -// This corresponds to wasm.OpcodeMemoryGrow. -// -// The engines are expected to pop one value from the top of the stack, then -// execute wasm.MemoryInstance Grow with the value, and push the previous -// page size of the memory onto the stack. -func NewOperationMemoryGrow() UnionOperation { - return UnionOperation{Kind: OperationKindMemoryGrow} -} - -// NewOperationConstI32 is a constructor for UnionOperation with OperationConstI32. -// -// This corresponds to wasm.OpcodeI32Const. -func NewOperationConstI32(value uint32) UnionOperation { - return UnionOperation{Kind: OperationKindConstI32, U1: uint64(value)} -} - -// NewOperationConstI64 is a constructor for UnionOperation with OperationConstI64. -// -// This corresponds to wasm.OpcodeI64Const. -func NewOperationConstI64(value uint64) UnionOperation { - return UnionOperation{Kind: OperationKindConstI64, U1: value} -} - -// NewOperationConstF32 is a constructor for UnionOperation with OperationConstF32. -// -// This corresponds to wasm.OpcodeF32Const. -func NewOperationConstF32(value float32) UnionOperation { - return UnionOperation{Kind: OperationKindConstF32, U1: uint64(math.Float32bits(value))} -} - -// NewOperationConstF64 is a constructor for UnionOperation with OperationConstF64. -// -// This corresponds to wasm.OpcodeF64Const. -func NewOperationConstF64(value float64) UnionOperation { - return UnionOperation{Kind: OperationKindConstF64, U1: math.Float64bits(value)} -} - -// NewOperationEq is a constructor for UnionOperation with OperationKindEq. -// -// This corresponds to wasm.OpcodeI32EqName wasm.OpcodeI64EqName wasm.OpcodeF32EqName wasm.OpcodeF64EqName -func NewOperationEq(b UnsignedType) UnionOperation { - return UnionOperation{Kind: OperationKindEq, B1: byte(b)} -} - -// NewOperationNe is a constructor for UnionOperation with OperationKindNe. -// -// This corresponds to wasm.OpcodeI32NeName wasm.OpcodeI64NeName wasm.OpcodeF32NeName wasm.OpcodeF64NeName -func NewOperationNe(b UnsignedType) UnionOperation { - return UnionOperation{Kind: OperationKindNe, B1: byte(b)} -} - -// NewOperationEqz is a constructor for UnionOperation with OperationKindEqz. -// -// This corresponds to wasm.OpcodeI32EqzName wasm.OpcodeI64EqzName -func NewOperationEqz(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindEqz, B1: byte(b)} -} - -// NewOperationLt is a constructor for UnionOperation with OperationKindLt. -// -// This corresponds to wasm.OpcodeI32LtS wasm.OpcodeI32LtU wasm.OpcodeI64LtS wasm.OpcodeI64LtU wasm.OpcodeF32Lt wasm.OpcodeF64Lt -func NewOperationLt(b SignedType) UnionOperation { - return UnionOperation{Kind: OperationKindLt, B1: byte(b)} -} - -// NewOperationGt is a constructor for UnionOperation with OperationKindGt. -// -// This corresponds to wasm.OpcodeI32GtS wasm.OpcodeI32GtU wasm.OpcodeI64GtS wasm.OpcodeI64GtU wasm.OpcodeF32Gt wasm.OpcodeF64Gt -func NewOperationGt(b SignedType) UnionOperation { - return UnionOperation{Kind: OperationKindGt, B1: byte(b)} -} - -// NewOperationLe is a constructor for UnionOperation with OperationKindLe. -// -// This corresponds to wasm.OpcodeI32LeS wasm.OpcodeI32LeU wasm.OpcodeI64LeS wasm.OpcodeI64LeU wasm.OpcodeF32Le wasm.OpcodeF64Le -func NewOperationLe(b SignedType) UnionOperation { - return UnionOperation{Kind: OperationKindLe, B1: byte(b)} -} - -// NewOperationGe is a constructor for UnionOperation with OperationKindGe. -// -// This corresponds to wasm.OpcodeI32GeS wasm.OpcodeI32GeU wasm.OpcodeI64GeS wasm.OpcodeI64GeU wasm.OpcodeF32Ge wasm.OpcodeF64Ge -// NewOperationGe is the constructor for OperationGe -func NewOperationGe(b SignedType) UnionOperation { - return UnionOperation{Kind: OperationKindGe, B1: byte(b)} -} - -// NewOperationAdd is a constructor for UnionOperation with OperationKindAdd. -// -// This corresponds to wasm.OpcodeI32AddName wasm.OpcodeI64AddName wasm.OpcodeF32AddName wasm.OpcodeF64AddName. -func NewOperationAdd(b UnsignedType) UnionOperation { - return UnionOperation{Kind: OperationKindAdd, B1: byte(b)} -} - -// NewOperationSub is a constructor for UnionOperation with OperationKindSub. -// -// This corresponds to wasm.OpcodeI32SubName wasm.OpcodeI64SubName wasm.OpcodeF32SubName wasm.OpcodeF64SubName. -func NewOperationSub(b UnsignedType) UnionOperation { - return UnionOperation{Kind: OperationKindSub, B1: byte(b)} -} - -// NewOperationMul is a constructor for UnionOperation with wperationKindMul. -// -// This corresponds to wasm.OpcodeI32MulName wasm.OpcodeI64MulName wasm.OpcodeF32MulName wasm.OpcodeF64MulName. -// NewOperationMul is the constructor for OperationMul -func NewOperationMul(b UnsignedType) UnionOperation { - return UnionOperation{Kind: OperationKindMul, B1: byte(b)} -} - -// NewOperationClz is a constructor for UnionOperation with OperationKindClz. -// -// This corresponds to wasm.OpcodeI32ClzName wasm.OpcodeI64ClzName. -// -// The engines are expected to count up the leading zeros in the -// current top of the stack, and push the count result. -// For example, stack of [..., 0x00_ff_ff_ff] results in [..., 8]. -// See wasm.OpcodeI32Clz wasm.OpcodeI64Clz -func NewOperationClz(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindClz, B1: byte(b)} -} - -// NewOperationCtz is a constructor for UnionOperation with OperationKindCtz. -// -// This corresponds to wasm.OpcodeI32CtzName wasm.OpcodeI64CtzName. -// -// The engines are expected to count up the trailing zeros in the -// current top of the stack, and push the count result. -// For example, stack of [..., 0xff_ff_ff_00] results in [..., 8]. -func NewOperationCtz(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindCtz, B1: byte(b)} -} - -// NewOperationPopcnt is a constructor for UnionOperation with OperationKindPopcnt. -// -// This corresponds to wasm.OpcodeI32PopcntName wasm.OpcodeI64PopcntName. -// -// The engines are expected to count up the number of set bits in the -// current top of the stack, and push the count result. -// For example, stack of [..., 0b00_00_00_11] results in [..., 2]. -func NewOperationPopcnt(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindPopcnt, B1: byte(b)} -} - -// NewOperationDiv is a constructor for UnionOperation with OperationKindDiv. -// -// This corresponds to wasm.OpcodeI32DivS wasm.OpcodeI32DivU wasm.OpcodeI64DivS -// -// wasm.OpcodeI64DivU wasm.OpcodeF32Div wasm.OpcodeF64Div. -func NewOperationDiv(b SignedType) UnionOperation { - return UnionOperation{Kind: OperationKindDiv, B1: byte(b)} -} - -// NewOperationRem is a constructor for UnionOperation with OperationKindRem. -// -// This corresponds to wasm.OpcodeI32RemS wasm.OpcodeI32RemU wasm.OpcodeI64RemS wasm.OpcodeI64RemU. -// -// The engines are expected to perform division on the top -// two values of integer type on the stack and puts the remainder of the result -// onto the stack. For example, stack [..., 10, 3] results in [..., 1] where -// the quotient is discarded. -// NewOperationRem is the constructor for OperationRem -func NewOperationRem(b SignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindRem, B1: byte(b)} -} - -// NewOperationAnd is a constructor for UnionOperation with OperationKindAnd. -// -// # This corresponds to wasm.OpcodeI32AndName wasm.OpcodeI64AndName -// -// The engines are expected to perform "And" operation on -// top two values on the stack, and pushes the result. -func NewOperationAnd(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindAnd, B1: byte(b)} -} - -// NewOperationOr is a constructor for UnionOperation with OperationKindOr. -// -// # This corresponds to wasm.OpcodeI32OrName wasm.OpcodeI64OrName -// -// The engines are expected to perform "Or" operation on -// top two values on the stack, and pushes the result. -func NewOperationOr(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindOr, B1: byte(b)} -} - -// NewOperationXor is a constructor for UnionOperation with OperationKindXor. -// -// # This corresponds to wasm.OpcodeI32XorName wasm.OpcodeI64XorName -// -// The engines are expected to perform "Xor" operation on -// top two values on the stack, and pushes the result. -func NewOperationXor(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindXor, B1: byte(b)} -} - -// NewOperationShl is a constructor for UnionOperation with OperationKindShl. -// -// # This corresponds to wasm.OpcodeI32ShlName wasm.OpcodeI64ShlName -// -// The engines are expected to perform "Shl" operation on -// top two values on the stack, and pushes the result. -func NewOperationShl(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindShl, B1: byte(b)} -} - -// NewOperationShr is a constructor for UnionOperation with OperationKindShr. -// -// # This corresponds to wasm.OpcodeI32ShrSName wasm.OpcodeI32ShrUName wasm.OpcodeI64ShrSName wasm.OpcodeI64ShrUName -// -// If OperationShr.Type is signed integer, then, the engines are expected to perform arithmetic right shift on the two -// top values on the stack, otherwise do the logical right shift. -func NewOperationShr(b SignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindShr, B1: byte(b)} -} - -// NewOperationRotl is a constructor for UnionOperation with OperationKindRotl. -// -// # This corresponds to wasm.OpcodeI32RotlName wasm.OpcodeI64RotlName -// -// The engines are expected to perform "Rotl" operation on -// top two values on the stack, and pushes the result. -func NewOperationRotl(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindRotl, B1: byte(b)} -} - -// NewOperationRotr is a constructor for UnionOperation with OperationKindRotr. -// -// # This corresponds to wasm.OpcodeI32RotrName wasm.OpcodeI64RotrName -// -// The engines are expected to perform "Rotr" operation on -// top two values on the stack, and pushes the result. -func NewOperationRotr(b UnsignedInt) UnionOperation { - return UnionOperation{Kind: OperationKindRotr, B1: byte(b)} -} - -// NewOperationAbs is a constructor for UnionOperation with OperationKindAbs. -// -// This corresponds to wasm.OpcodeF32Abs wasm.OpcodeF64Abs -func NewOperationAbs(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindAbs, B1: byte(b)} -} - -// NewOperationNeg is a constructor for UnionOperation with OperationKindNeg. -// -// This corresponds to wasm.OpcodeF32Neg wasm.OpcodeF64Neg -func NewOperationNeg(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindNeg, B1: byte(b)} -} - -// NewOperationCeil is a constructor for UnionOperation with OperationKindCeil. -// -// This corresponds to wasm.OpcodeF32CeilName wasm.OpcodeF64CeilName -func NewOperationCeil(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindCeil, B1: byte(b)} -} - -// NewOperationFloor is a constructor for UnionOperation with OperationKindFloor. -// -// This corresponds to wasm.OpcodeF32FloorName wasm.OpcodeF64FloorName -func NewOperationFloor(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindFloor, B1: byte(b)} -} - -// NewOperationTrunc is a constructor for UnionOperation with OperationKindTrunc. -// -// This corresponds to wasm.OpcodeF32TruncName wasm.OpcodeF64TruncName -func NewOperationTrunc(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindTrunc, B1: byte(b)} -} - -// NewOperationNearest is a constructor for UnionOperation with OperationKindNearest. -// -// # This corresponds to wasm.OpcodeF32NearestName wasm.OpcodeF64NearestName -// -// Note: this is *not* equivalent to math.Round and instead has the same -// the semantics of LLVM's rint intrinsic. See https://llvm.org/docs/LangRef.html#llvm-rint-intrinsic. -// For example, math.Round(-4.5) produces -5 while we want to produce -4. -func NewOperationNearest(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindNearest, B1: byte(b)} -} - -// NewOperationSqrt is a constructor for UnionOperation with OperationKindSqrt. -// -// This corresponds to wasm.OpcodeF32SqrtName wasm.OpcodeF64SqrtName -func NewOperationSqrt(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindSqrt, B1: byte(b)} -} - -// NewOperationMin is a constructor for UnionOperation with OperationKindMin. -// -// # This corresponds to wasm.OpcodeF32MinName wasm.OpcodeF64MinName -// -// The engines are expected to pop two values from the stack, and push back the maximum of -// these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 1.9]. -// -// Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN, -// which is a different behavior different from math.Min. -func NewOperationMin(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindMin, B1: byte(b)} -} - -// NewOperationMax is a constructor for UnionOperation with OperationKindMax. -// -// # This corresponds to wasm.OpcodeF32MaxName wasm.OpcodeF64MaxName -// -// The engines are expected to pop two values from the stack, and push back the maximum of -// these two values onto the stack. For example, stack [..., 100.1, 1.9] results in [..., 100.1]. -// -// Note: WebAssembly specifies that min/max must always return NaN if one of values is NaN, -// which is a different behavior different from math.Max. -func NewOperationMax(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindMax, B1: byte(b)} -} - -// NewOperationCopysign is a constructor for UnionOperation with OperationKindCopysign. -// -// # This corresponds to wasm.OpcodeF32CopysignName wasm.OpcodeF64CopysignName -// -// The engines are expected to pop two float values from the stack, and copy the signbit of -// the first-popped value to the last one. -// For example, stack [..., 1.213, -5.0] results in [..., -1.213]. -func NewOperationCopysign(b Float) UnionOperation { - return UnionOperation{Kind: OperationKindCopysign, B1: byte(b)} -} - -// NewOperationI32WrapFromI64 is a constructor for UnionOperation with OperationKindI32WrapFromI64. -// -// This corresponds to wasm.OpcodeI32WrapI64 and equivalent to uint64(uint32(v)) in Go. -// -// The engines are expected to replace the 64-bit int on top of the stack -// with the corresponding 32-bit integer. -func NewOperationI32WrapFromI64() UnionOperation { - return UnionOperation{Kind: OperationKindI32WrapFromI64} -} - -// NewOperationITruncFromF is a constructor for UnionOperation with OperationKindITruncFromF. -// -// This corresponds to -// -// wasm.OpcodeI32TruncF32SName wasm.OpcodeI32TruncF32UName wasm.OpcodeI32TruncF64SName -// wasm.OpcodeI32TruncF64UName wasm.OpcodeI64TruncF32SName wasm.OpcodeI64TruncF32UName wasm.OpcodeI64TruncF64SName -// wasm.OpcodeI64TruncF64UName. wasm.OpcodeI32TruncSatF32SName wasm.OpcodeI32TruncSatF32UName -// wasm.OpcodeI32TruncSatF64SName wasm.OpcodeI32TruncSatF64UName wasm.OpcodeI64TruncSatF32SName -// wasm.OpcodeI64TruncSatF32UName wasm.OpcodeI64TruncSatF64SName wasm.OpcodeI64TruncSatF64UName -// -// See [1] and [2] for when we encounter undefined behavior in the WebAssembly specification if NewOperationITruncFromF.NonTrapping == false. -// To summarize, if the source float value is NaN or doesn't fit in the destination range of integers (incl. +=Inf), -// then the runtime behavior is undefined. In wazero, the engines are expected to exit the execution in these undefined cases with -// wasmruntime.ErrRuntimeInvalidConversionToInteger error. -// -// [1] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-umathrmtruncmathsfu_m-n-z for unsigned integers. -// [2] https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#-hrefop-trunc-smathrmtruncmathsfs_m-n-z for signed integers. -// -// nonTrapping true if this conversion is "nontrapping" in the sense of the -// https://github.com/WebAssembly/spec/blob/ce4b6c4d47eb06098cc7ab2e81f24748da822f20/proposals/nontrapping-float-to-int-conversion/Overview.md -func NewOperationITruncFromF(inputType Float, outputType SignedInt, nonTrapping bool) UnionOperation { - return UnionOperation{ - Kind: OperationKindITruncFromF, - B1: byte(inputType), - B2: byte(outputType), - B3: nonTrapping, - } -} - -// NewOperationFConvertFromI is a constructor for UnionOperation with OperationKindFConvertFromI. -// -// This corresponds to -// -// wasm.OpcodeF32ConvertI32SName wasm.OpcodeF32ConvertI32UName wasm.OpcodeF32ConvertI64SName wasm.OpcodeF32ConvertI64UName -// wasm.OpcodeF64ConvertI32SName wasm.OpcodeF64ConvertI32UName wasm.OpcodeF64ConvertI64SName wasm.OpcodeF64ConvertI64UName -// -// and equivalent to float32(uint32(x)), float32(int32(x)), etc in Go. -func NewOperationFConvertFromI(inputType SignedInt, outputType Float) UnionOperation { - return UnionOperation{ - Kind: OperationKindFConvertFromI, - B1: byte(inputType), - B2: byte(outputType), - } -} - -// NewOperationF32DemoteFromF64 is a constructor for UnionOperation with OperationKindF32DemoteFromF64. -// -// This corresponds to wasm.OpcodeF32DemoteF64 and is equivalent float32(float64(v)). -func NewOperationF32DemoteFromF64() UnionOperation { - return UnionOperation{Kind: OperationKindF32DemoteFromF64} -} - -// NewOperationF64PromoteFromF32 is a constructor for UnionOperation with OperationKindF64PromoteFromF32. -// -// This corresponds to wasm.OpcodeF64PromoteF32 and is equivalent float64(float32(v)). -func NewOperationF64PromoteFromF32() UnionOperation { - return UnionOperation{Kind: OperationKindF64PromoteFromF32} -} - -// NewOperationI32ReinterpretFromF32 is a constructor for UnionOperation with OperationKindI32ReinterpretFromF32. -// -// This corresponds to wasm.OpcodeI32ReinterpretF32Name. -func NewOperationI32ReinterpretFromF32() UnionOperation { - return UnionOperation{Kind: OperationKindI32ReinterpretFromF32} -} - -// NewOperationI64ReinterpretFromF64 is a constructor for UnionOperation with OperationKindI64ReinterpretFromF64. -// -// This corresponds to wasm.OpcodeI64ReinterpretF64Name. -func NewOperationI64ReinterpretFromF64() UnionOperation { - return UnionOperation{Kind: OperationKindI64ReinterpretFromF64} -} - -// NewOperationF32ReinterpretFromI32 is a constructor for UnionOperation with OperationKindF32ReinterpretFromI32. -// -// This corresponds to wasm.OpcodeF32ReinterpretI32Name. -func NewOperationF32ReinterpretFromI32() UnionOperation { - return UnionOperation{Kind: OperationKindF32ReinterpretFromI32} -} - -// NewOperationF64ReinterpretFromI64 is a constructor for UnionOperation with OperationKindF64ReinterpretFromI64. -// -// This corresponds to wasm.OpcodeF64ReinterpretI64Name. -func NewOperationF64ReinterpretFromI64() UnionOperation { - return UnionOperation{Kind: OperationKindF64ReinterpretFromI64} -} - -// NewOperationExtend is a constructor for UnionOperation with OperationKindExtend. -// -// # This corresponds to wasm.OpcodeI64ExtendI32SName wasm.OpcodeI64ExtendI32UName -// -// The engines are expected to extend the 32-bit signed or unsigned int on top of the stack -// as a 64-bit integer of corresponding signedness. For unsigned case, this is just reinterpreting the -// underlying bit pattern as 64-bit integer. For signed case, this is sign-extension which preserves the -// original integer's sign. -func NewOperationExtend(signed bool) UnionOperation { - op := UnionOperation{Kind: OperationKindExtend} - if signed { - op.B1 = 1 - } - return op -} - -// NewOperationSignExtend32From8 is a constructor for UnionOperation with OperationKindSignExtend32From8. -// -// This corresponds to wasm.OpcodeI32Extend8SName. -// -// The engines are expected to sign-extend the first 8-bits of 32-bit in as signed 32-bit int. -func NewOperationSignExtend32From8() UnionOperation { - return UnionOperation{Kind: OperationKindSignExtend32From8} -} - -// NewOperationSignExtend32From16 is a constructor for UnionOperation with OperationKindSignExtend32From16. -// -// This corresponds to wasm.OpcodeI32Extend16SName. -// -// The engines are expected to sign-extend the first 16-bits of 32-bit in as signed 32-bit int. -func NewOperationSignExtend32From16() UnionOperation { - return UnionOperation{Kind: OperationKindSignExtend32From16} -} - -// NewOperationSignExtend64From8 is a constructor for UnionOperation with OperationKindSignExtend64From8. -// -// This corresponds to wasm.OpcodeI64Extend8SName. -// -// The engines are expected to sign-extend the first 8-bits of 64-bit in as signed 32-bit int. -func NewOperationSignExtend64From8() UnionOperation { - return UnionOperation{Kind: OperationKindSignExtend64From8} -} - -// NewOperationSignExtend64From16 is a constructor for UnionOperation with OperationKindSignExtend64From16. -// -// This corresponds to wasm.OpcodeI64Extend16SName. -// -// The engines are expected to sign-extend the first 16-bits of 64-bit in as signed 32-bit int. -func NewOperationSignExtend64From16() UnionOperation { - return UnionOperation{Kind: OperationKindSignExtend64From16} -} - -// NewOperationSignExtend64From32 is a constructor for UnionOperation with OperationKindSignExtend64From32. -// -// This corresponds to wasm.OpcodeI64Extend32SName. -// -// The engines are expected to sign-extend the first 32-bits of 64-bit in as signed 32-bit int. -func NewOperationSignExtend64From32() UnionOperation { - return UnionOperation{Kind: OperationKindSignExtend64From32} -} - -// NewOperationMemoryInit is a constructor for UnionOperation with OperationKindMemoryInit. -// -// This corresponds to wasm.OpcodeMemoryInitName. -// -// dataIndex is the index of the data instance in ModuleInstance.DataInstances -// by which this operation instantiates a part of the memory. -func NewOperationMemoryInit(dataIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindMemoryInit, U1: uint64(dataIndex)} -} - -// NewOperationDataDrop implements Operation. -// -// This corresponds to wasm.OpcodeDataDropName. -// -// dataIndex is the index of the data instance in ModuleInstance.DataInstances -// which this operation drops. -func NewOperationDataDrop(dataIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindDataDrop, U1: uint64(dataIndex)} -} - -// NewOperationMemoryCopy is a consuctor for UnionOperation with OperationKindMemoryCopy. -// -// This corresponds to wasm.OpcodeMemoryCopyName. -func NewOperationMemoryCopy() UnionOperation { - return UnionOperation{Kind: OperationKindMemoryCopy} -} - -// NewOperationMemoryFill is a consuctor for UnionOperation with OperationKindMemoryFill. -func NewOperationMemoryFill() UnionOperation { - return UnionOperation{Kind: OperationKindMemoryFill} -} - -// NewOperationTableInit is a constructor for UnionOperation with OperationKindTableInit. -// -// This corresponds to wasm.OpcodeTableInitName. -// -// elemIndex is the index of the element by which this operation initializes a part of the table. -// tableIndex is the index of the table on which this operation initialize by the target element. -func NewOperationTableInit(elemIndex, tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableInit, U1: uint64(elemIndex), U2: uint64(tableIndex)} -} - -// NewOperationElemDrop is a constructor for UnionOperation with OperationKindElemDrop. -// -// This corresponds to wasm.OpcodeElemDropName. -// -// elemIndex is the index of the element which this operation drops. -func NewOperationElemDrop(elemIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindElemDrop, U1: uint64(elemIndex)} -} - -// NewOperationTableCopy implements Operation. -// -// This corresponds to wasm.OpcodeTableCopyName. -func NewOperationTableCopy(srcTableIndex, dstTableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableCopy, U1: uint64(srcTableIndex), U2: uint64(dstTableIndex)} -} - -// NewOperationRefFunc constructor for UnionOperation with OperationKindRefFunc. -// -// This corresponds to wasm.OpcodeRefFuncName, and engines are expected to -// push the opaque pointer value of engine specific func for the given FunctionIndex. -// -// Note: in wazero, we express any reference types (funcref or externref) as opaque pointers which is uint64. -// Therefore, the engine implementations emit instructions to push the address of *function onto the stack. -func NewOperationRefFunc(functionIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindRefFunc, U1: uint64(functionIndex)} -} - -// NewOperationTableGet constructor for UnionOperation with OperationKindTableGet. -// -// This corresponds to wasm.OpcodeTableGetName. -func NewOperationTableGet(tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableGet, U1: uint64(tableIndex)} -} - -// NewOperationTableSet constructor for UnionOperation with OperationKindTableSet. -// -// This corresponds to wasm.OpcodeTableSetName. -func NewOperationTableSet(tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableSet, U1: uint64(tableIndex)} -} - -// NewOperationTableSize constructor for UnionOperation with OperationKindTableSize. -// -// This corresponds to wasm.OpcodeTableSizeName. -func NewOperationTableSize(tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableSize, U1: uint64(tableIndex)} -} - -// NewOperationTableGrow constructor for UnionOperation with OperationKindTableGrow. -// -// This corresponds to wasm.OpcodeTableGrowName. -func NewOperationTableGrow(tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableGrow, U1: uint64(tableIndex)} -} - -// NewOperationTableFill constructor for UnionOperation with OperationKindTableFill. -// -// This corresponds to wasm.OpcodeTableFillName. -func NewOperationTableFill(tableIndex uint32) UnionOperation { - return UnionOperation{Kind: OperationKindTableFill, U1: uint64(tableIndex)} -} - -// NewOperationV128Const constructor for UnionOperation with OperationKindV128Const -func NewOperationV128Const(lo, hi uint64) UnionOperation { - return UnionOperation{Kind: OperationKindV128Const, U1: lo, U2: hi} -} - -// Shape corresponds to a shape of v128 values. -// https://webassembly.github.io/spec/core/syntax/instructions.html#syntax-shape -type Shape = byte - -const ( - ShapeI8x16 Shape = iota - ShapeI16x8 - ShapeI32x4 - ShapeI64x2 - ShapeF32x4 - ShapeF64x2 -) - -func shapeName(s Shape) (ret string) { - switch s { - case ShapeI8x16: - ret = "I8x16" - case ShapeI16x8: - ret = "I16x8" - case ShapeI32x4: - ret = "I32x4" - case ShapeI64x2: - ret = "I64x2" - case ShapeF32x4: - ret = "F32x4" - case ShapeF64x2: - ret = "F64x2" - } - return -} - -// NewOperationV128Add constructor for UnionOperation with OperationKindV128Add. -// -// This corresponds to wasm.OpcodeVecI8x16AddName wasm.OpcodeVecI16x8AddName wasm.OpcodeVecI32x4AddName -// -// wasm.OpcodeVecI64x2AddName wasm.OpcodeVecF32x4AddName wasm.OpcodeVecF64x2AddName -func NewOperationV128Add(shape Shape) UnionOperation { - return UnionOperation{Kind: OperationKindV128Add, B1: shape} -} - -// NewOperationV128Sub constructor for UnionOperation with OperationKindV128Sub. -// -// This corresponds to wasm.OpcodeVecI8x16SubName wasm.OpcodeVecI16x8SubName wasm.OpcodeVecI32x4SubName -// -// wasm.OpcodeVecI64x2SubName wasm.OpcodeVecF32x4SubName wasm.OpcodeVecF64x2SubName -func NewOperationV128Sub(shape Shape) UnionOperation { - return UnionOperation{Kind: OperationKindV128Sub, B1: shape} -} - -// V128LoadType represents a type of wasm.OpcodeVecV128Load* instructions. -type V128LoadType = byte - -const ( - // V128LoadType128 corresponds to wasm.OpcodeVecV128LoadName. - V128LoadType128 V128LoadType = iota - // V128LoadType8x8s corresponds to wasm.OpcodeVecV128Load8x8SName. - V128LoadType8x8s - // V128LoadType8x8u corresponds to wasm.OpcodeVecV128Load8x8UName. - V128LoadType8x8u - // V128LoadType16x4s corresponds to wasm.OpcodeVecV128Load16x4SName - V128LoadType16x4s - // V128LoadType16x4u corresponds to wasm.OpcodeVecV128Load16x4UName - V128LoadType16x4u - // V128LoadType32x2s corresponds to wasm.OpcodeVecV128Load32x2SName - V128LoadType32x2s - // V128LoadType32x2u corresponds to wasm.OpcodeVecV128Load32x2UName - V128LoadType32x2u - // V128LoadType8Splat corresponds to wasm.OpcodeVecV128Load8SplatName - V128LoadType8Splat - // V128LoadType16Splat corresponds to wasm.OpcodeVecV128Load16SplatName - V128LoadType16Splat - // V128LoadType32Splat corresponds to wasm.OpcodeVecV128Load32SplatName - V128LoadType32Splat - // V128LoadType64Splat corresponds to wasm.OpcodeVecV128Load64SplatName - V128LoadType64Splat - // V128LoadType32zero corresponds to wasm.OpcodeVecV128Load32zeroName - V128LoadType32zero - // V128LoadType64zero corresponds to wasm.OpcodeVecV128Load64zeroName - V128LoadType64zero -) - -// NewOperationV128Load is a constructor for UnionOperation with OperationKindV128Load. -// -// This corresponds to -// -// wasm.OpcodeVecV128LoadName wasm.OpcodeVecV128Load8x8SName wasm.OpcodeVecV128Load8x8UName -// wasm.OpcodeVecV128Load16x4SName wasm.OpcodeVecV128Load16x4UName wasm.OpcodeVecV128Load32x2SName -// wasm.OpcodeVecV128Load32x2UName wasm.OpcodeVecV128Load8SplatName wasm.OpcodeVecV128Load16SplatName -// wasm.OpcodeVecV128Load32SplatName wasm.OpcodeVecV128Load64SplatName wasm.OpcodeVecV128Load32zeroName -// wasm.OpcodeVecV128Load64zeroName -func NewOperationV128Load(loadType V128LoadType, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindV128Load, B1: loadType, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationV128LoadLane is a constructor for UnionOperation with OperationKindV128LoadLane. -// -// This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName -// -// wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName. -// -// laneIndex is >=0 && <(128/LaneSize). -// laneSize is either 8, 16, 32, or 64. -func NewOperationV128LoadLane(laneIndex, laneSize byte, arg MemoryArg) UnionOperation { - return UnionOperation{Kind: OperationKindV128LoadLane, B1: laneSize, B2: laneIndex, U1: uint64(arg.Alignment), U2: uint64(arg.Offset)} -} - -// NewOperationV128Store is a constructor for UnionOperation with OperationKindV128Store. -// -// This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName -// -// wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName. -func NewOperationV128Store(arg MemoryArg) UnionOperation { - return UnionOperation{ - Kind: OperationKindV128Store, - U1: uint64(arg.Alignment), - U2: uint64(arg.Offset), - } -} - -// NewOperationV128StoreLane implements Operation. -// -// This corresponds to wasm.OpcodeVecV128Load8LaneName wasm.OpcodeVecV128Load16LaneName -// -// wasm.OpcodeVecV128Load32LaneName wasm.OpcodeVecV128Load64LaneName. -// -// laneIndex is >=0 && <(128/LaneSize). -// laneSize is either 8, 16, 32, or 64. -func NewOperationV128StoreLane(laneIndex byte, laneSize byte, arg MemoryArg) UnionOperation { - return UnionOperation{ - Kind: OperationKindV128StoreLane, - B1: laneSize, - B2: laneIndex, - U1: uint64(arg.Alignment), - U2: uint64(arg.Offset), - } -} - -// NewOperationV128ExtractLane is a constructor for UnionOperation with OperationKindV128ExtractLane. -// -// This corresponds to -// -// wasm.OpcodeVecI8x16ExtractLaneSName wasm.OpcodeVecI8x16ExtractLaneUName -// wasm.OpcodeVecI16x8ExtractLaneSName wasm.OpcodeVecI16x8ExtractLaneUName -// wasm.OpcodeVecI32x4ExtractLaneName wasm.OpcodeVecI64x2ExtractLaneName -// wasm.OpcodeVecF32x4ExtractLaneName wasm.OpcodeVecF64x2ExtractLaneName. -// -// laneIndex is >=0 && =0 && = l { - return nil, fmt.Errorf("invalid local index for local.get %d >= %d", index, l) - } - var t wasm.ValueType - if index < inputLen { - t = c.sig.Params[index] - } else { - t = c.localTypes[index-inputLen] - } - return wasmValueTypeToUnsignedOutSignature(t), nil - case wasm.OpcodeLocalSet: - inputLen := uint32(len(c.sig.Params)) - if l := uint32(len(c.localTypes)) + inputLen; index >= l { - return nil, fmt.Errorf("invalid local index for local.get %d >= %d", index, l) - } - var t wasm.ValueType - if index < inputLen { - t = c.sig.Params[index] - } else { - t = c.localTypes[index-inputLen] - } - return wasmValueTypeToUnsignedInSignature(t), nil - case wasm.OpcodeLocalTee: - inputLen := uint32(len(c.sig.Params)) - if l := uint32(len(c.localTypes)) + inputLen; index >= l { - return nil, fmt.Errorf("invalid local index for local.get %d >= %d", index, l) - } - var t wasm.ValueType - if index < inputLen { - t = c.sig.Params[index] - } else { - t = c.localTypes[index-inputLen] - } - return wasmValueTypeToUnsignedInOutSignature(t), nil - case wasm.OpcodeGlobalGet: - if len(c.globals) <= int(index) { - return nil, fmt.Errorf("invalid global index for global.get %d >= %d", index, len(c.globals)) - } - return wasmValueTypeToUnsignedOutSignature(c.globals[index].ValType), nil - case wasm.OpcodeGlobalSet: - if len(c.globals) <= int(index) { - return nil, fmt.Errorf("invalid global index for global.get %d >= %d", index, len(c.globals)) - } - return wasmValueTypeToUnsignedInSignature(c.globals[index].ValType), nil - case wasm.OpcodeI32Load: - return signature_I32_I32, nil - case wasm.OpcodeI64Load: - return signature_I32_I64, nil - case wasm.OpcodeF32Load: - return signature_I32_F32, nil - case wasm.OpcodeF64Load: - return signature_I32_F64, nil - case wasm.OpcodeI32Load8S, wasm.OpcodeI32Load8U, wasm.OpcodeI32Load16S, wasm.OpcodeI32Load16U: - return signature_I32_I32, nil - case wasm.OpcodeI64Load8S, wasm.OpcodeI64Load8U, wasm.OpcodeI64Load16S, wasm.OpcodeI64Load16U, - wasm.OpcodeI64Load32S, wasm.OpcodeI64Load32U: - return signature_I32_I64, nil - case wasm.OpcodeI32Store: - return signature_I32I32_None, nil - case wasm.OpcodeI64Store: - return signature_I32I64_None, nil - case wasm.OpcodeF32Store: - return signature_I32F32_None, nil - case wasm.OpcodeF64Store: - return signature_I32F64_None, nil - case wasm.OpcodeI32Store8: - return signature_I32I32_None, nil - case wasm.OpcodeI32Store16: - return signature_I32I32_None, nil - case wasm.OpcodeI64Store8: - return signature_I32I64_None, nil - case wasm.OpcodeI64Store16: - return signature_I32I64_None, nil - case wasm.OpcodeI64Store32: - return signature_I32I64_None, nil - case wasm.OpcodeMemorySize: - return signature_None_I32, nil - case wasm.OpcodeMemoryGrow: - return signature_I32_I32, nil - case wasm.OpcodeI32Const: - return signature_None_I32, nil - case wasm.OpcodeI64Const: - return signature_None_I64, nil - case wasm.OpcodeF32Const: - return signature_None_F32, nil - case wasm.OpcodeF64Const: - return signature_None_F64, nil - case wasm.OpcodeI32Eqz: - return signature_I32_I32, nil - case wasm.OpcodeI32Eq, wasm.OpcodeI32Ne, wasm.OpcodeI32LtS, - wasm.OpcodeI32LtU, wasm.OpcodeI32GtS, wasm.OpcodeI32GtU, - wasm.OpcodeI32LeS, wasm.OpcodeI32LeU, wasm.OpcodeI32GeS, - wasm.OpcodeI32GeU: - return signature_I32I32_I32, nil - case wasm.OpcodeI64Eqz: - return signature_I64_I32, nil - case wasm.OpcodeI64Eq, wasm.OpcodeI64Ne, wasm.OpcodeI64LtS, - wasm.OpcodeI64LtU, wasm.OpcodeI64GtS, wasm.OpcodeI64GtU, - wasm.OpcodeI64LeS, wasm.OpcodeI64LeU, wasm.OpcodeI64GeS, - wasm.OpcodeI64GeU: - return signature_I64I64_I32, nil - case wasm.OpcodeF32Eq, wasm.OpcodeF32Ne, wasm.OpcodeF32Lt, - wasm.OpcodeF32Gt, wasm.OpcodeF32Le, wasm.OpcodeF32Ge: - return signature_F32F32_I32, nil - case wasm.OpcodeF64Eq, wasm.OpcodeF64Ne, wasm.OpcodeF64Lt, - wasm.OpcodeF64Gt, wasm.OpcodeF64Le, wasm.OpcodeF64Ge: - return signature_F64F64_I32, nil - case wasm.OpcodeI32Clz, wasm.OpcodeI32Ctz, wasm.OpcodeI32Popcnt: - return signature_I32_I32, nil - case wasm.OpcodeI32Add, wasm.OpcodeI32Sub, wasm.OpcodeI32Mul, - wasm.OpcodeI32DivS, wasm.OpcodeI32DivU, wasm.OpcodeI32RemS, - wasm.OpcodeI32RemU, wasm.OpcodeI32And, wasm.OpcodeI32Or, - wasm.OpcodeI32Xor, wasm.OpcodeI32Shl, wasm.OpcodeI32ShrS, - wasm.OpcodeI32ShrU, wasm.OpcodeI32Rotl, wasm.OpcodeI32Rotr: - return signature_I32I32_I32, nil - case wasm.OpcodeI64Clz, wasm.OpcodeI64Ctz, wasm.OpcodeI64Popcnt: - return signature_I64_I64, nil - case wasm.OpcodeI64Add, wasm.OpcodeI64Sub, wasm.OpcodeI64Mul, - wasm.OpcodeI64DivS, wasm.OpcodeI64DivU, wasm.OpcodeI64RemS, - wasm.OpcodeI64RemU, wasm.OpcodeI64And, wasm.OpcodeI64Or, - wasm.OpcodeI64Xor, wasm.OpcodeI64Shl, wasm.OpcodeI64ShrS, - wasm.OpcodeI64ShrU, wasm.OpcodeI64Rotl, wasm.OpcodeI64Rotr: - return signature_I64I64_I64, nil - case wasm.OpcodeF32Abs, wasm.OpcodeF32Neg, wasm.OpcodeF32Ceil, - wasm.OpcodeF32Floor, wasm.OpcodeF32Trunc, wasm.OpcodeF32Nearest, - wasm.OpcodeF32Sqrt: - return signature_F32_F32, nil - case wasm.OpcodeF32Add, wasm.OpcodeF32Sub, wasm.OpcodeF32Mul, - wasm.OpcodeF32Div, wasm.OpcodeF32Min, wasm.OpcodeF32Max, - wasm.OpcodeF32Copysign: - return signature_F32F32_F32, nil - case wasm.OpcodeF64Abs, wasm.OpcodeF64Neg, wasm.OpcodeF64Ceil, - wasm.OpcodeF64Floor, wasm.OpcodeF64Trunc, wasm.OpcodeF64Nearest, - wasm.OpcodeF64Sqrt: - return signature_F64_F64, nil - case wasm.OpcodeF64Add, wasm.OpcodeF64Sub, wasm.OpcodeF64Mul, - wasm.OpcodeF64Div, wasm.OpcodeF64Min, wasm.OpcodeF64Max, - wasm.OpcodeF64Copysign: - return signature_F64F64_F64, nil - case wasm.OpcodeI32WrapI64: - return signature_I64_I32, nil - case wasm.OpcodeI32TruncF32S, wasm.OpcodeI32TruncF32U: - return signature_F32_I32, nil - case wasm.OpcodeI32TruncF64S, wasm.OpcodeI32TruncF64U: - return signature_F64_I32, nil - case wasm.OpcodeI64ExtendI32S, wasm.OpcodeI64ExtendI32U: - return signature_I32_I64, nil - case wasm.OpcodeI64TruncF32S, wasm.OpcodeI64TruncF32U: - return signature_F32_I64, nil - case wasm.OpcodeI64TruncF64S, wasm.OpcodeI64TruncF64U: - return signature_F64_I64, nil - case wasm.OpcodeF32ConvertI32S, wasm.OpcodeF32ConvertI32U: - return signature_I32_F32, nil - case wasm.OpcodeF32ConvertI64S, wasm.OpcodeF32ConvertI64U: - return signature_I64_F32, nil - case wasm.OpcodeF32DemoteF64: - return signature_F64_F32, nil - case wasm.OpcodeF64ConvertI32S, wasm.OpcodeF64ConvertI32U: - return signature_I32_F64, nil - case wasm.OpcodeF64ConvertI64S, wasm.OpcodeF64ConvertI64U: - return signature_I64_F64, nil - case wasm.OpcodeF64PromoteF32: - return signature_F32_F64, nil - case wasm.OpcodeI32ReinterpretF32: - return signature_F32_I32, nil - case wasm.OpcodeI64ReinterpretF64: - return signature_F64_I64, nil - case wasm.OpcodeF32ReinterpretI32: - return signature_I32_F32, nil - case wasm.OpcodeF64ReinterpretI64: - return signature_I64_F64, nil - case wasm.OpcodeI32Extend8S, wasm.OpcodeI32Extend16S: - return signature_I32_I32, nil - case wasm.OpcodeI64Extend8S, wasm.OpcodeI64Extend16S, wasm.OpcodeI64Extend32S: - return signature_I64_I64, nil - case wasm.OpcodeTableGet: - // table.get takes table's offset and pushes the ref type value of opaque pointer as i64 value onto the stack. - return signature_I32_I64, nil - case wasm.OpcodeTableSet: - // table.set takes table's offset and the ref type value of opaque pointer as i64 value. - return signature_I32I64_None, nil - case wasm.OpcodeRefFunc: - // ref.func is translated as pushing the compiled function's opaque pointer (uint64) at wazeroir layer. - return signature_None_I64, nil - case wasm.OpcodeRefIsNull: - // ref.is_null is translated as checking if the uint64 on the top of the stack (opaque pointer) is zero or not. - return signature_I64_I32, nil - case wasm.OpcodeRefNull: - // ref.null is translated as i64.const 0. - return signature_None_I64, nil - case wasm.OpcodeMiscPrefix: - switch miscOp := c.body[c.pc+1]; miscOp { - case wasm.OpcodeMiscI32TruncSatF32S, wasm.OpcodeMiscI32TruncSatF32U: - return signature_F32_I32, nil - case wasm.OpcodeMiscI32TruncSatF64S, wasm.OpcodeMiscI32TruncSatF64U: - return signature_F64_I32, nil - case wasm.OpcodeMiscI64TruncSatF32S, wasm.OpcodeMiscI64TruncSatF32U: - return signature_F32_I64, nil - case wasm.OpcodeMiscI64TruncSatF64S, wasm.OpcodeMiscI64TruncSatF64U: - return signature_F64_I64, nil - case wasm.OpcodeMiscMemoryInit, wasm.OpcodeMiscMemoryCopy, wasm.OpcodeMiscMemoryFill, - wasm.OpcodeMiscTableInit, wasm.OpcodeMiscTableCopy: - return signature_I32I32I32_None, nil - case wasm.OpcodeMiscDataDrop, wasm.OpcodeMiscElemDrop: - return signature_None_None, nil - case wasm.OpcodeMiscTableGrow: - return signature_I64I32_I32, nil - case wasm.OpcodeMiscTableSize: - return signature_None_I32, nil - case wasm.OpcodeMiscTableFill: - return signature_I32I64I32_None, nil - default: - return nil, fmt.Errorf("unsupported misc instruction in wazeroir: 0x%x", op) - } - case wasm.OpcodeVecPrefix: - switch vecOp := c.body[c.pc+1]; vecOp { - case wasm.OpcodeVecV128Const: - return signature_None_V128, nil - case wasm.OpcodeVecV128Load, wasm.OpcodeVecV128Load8x8s, wasm.OpcodeVecV128Load8x8u, - wasm.OpcodeVecV128Load16x4s, wasm.OpcodeVecV128Load16x4u, wasm.OpcodeVecV128Load32x2s, - wasm.OpcodeVecV128Load32x2u, wasm.OpcodeVecV128Load8Splat, wasm.OpcodeVecV128Load16Splat, - wasm.OpcodeVecV128Load32Splat, wasm.OpcodeVecV128Load64Splat, wasm.OpcodeVecV128Load32zero, - wasm.OpcodeVecV128Load64zero: - return signature_I32_V128, nil - case wasm.OpcodeVecV128Load8Lane, wasm.OpcodeVecV128Load16Lane, - wasm.OpcodeVecV128Load32Lane, wasm.OpcodeVecV128Load64Lane: - return signature_I32V128_V128, nil - case wasm.OpcodeVecV128Store, - wasm.OpcodeVecV128Store8Lane, - wasm.OpcodeVecV128Store16Lane, - wasm.OpcodeVecV128Store32Lane, - wasm.OpcodeVecV128Store64Lane: - return signature_I32V128_None, nil - case wasm.OpcodeVecI8x16ExtractLaneS, - wasm.OpcodeVecI8x16ExtractLaneU, - wasm.OpcodeVecI16x8ExtractLaneS, - wasm.OpcodeVecI16x8ExtractLaneU, - wasm.OpcodeVecI32x4ExtractLane: - return signature_V128_I32, nil - case wasm.OpcodeVecI64x2ExtractLane: - return signature_V128_I64, nil - case wasm.OpcodeVecF32x4ExtractLane: - return signature_V128_F32, nil - case wasm.OpcodeVecF64x2ExtractLane: - return signature_V128_F64, nil - case wasm.OpcodeVecI8x16ReplaceLane, wasm.OpcodeVecI16x8ReplaceLane, wasm.OpcodeVecI32x4ReplaceLane, - wasm.OpcodeVecI8x16Shl, wasm.OpcodeVecI8x16ShrS, wasm.OpcodeVecI8x16ShrU, - wasm.OpcodeVecI16x8Shl, wasm.OpcodeVecI16x8ShrS, wasm.OpcodeVecI16x8ShrU, - wasm.OpcodeVecI32x4Shl, wasm.OpcodeVecI32x4ShrS, wasm.OpcodeVecI32x4ShrU, - wasm.OpcodeVecI64x2Shl, wasm.OpcodeVecI64x2ShrS, wasm.OpcodeVecI64x2ShrU: - return signature_V128I32_V128, nil - case wasm.OpcodeVecI64x2ReplaceLane: - return signature_V128I64_V128, nil - case wasm.OpcodeVecF32x4ReplaceLane: - return signature_V128F32_V128, nil - case wasm.OpcodeVecF64x2ReplaceLane: - return signature_V128F64_V128, nil - case wasm.OpcodeVecI8x16Splat, - wasm.OpcodeVecI16x8Splat, - wasm.OpcodeVecI32x4Splat: - return signature_I32_V128, nil - case wasm.OpcodeVecI64x2Splat: - return signature_I64_V128, nil - case wasm.OpcodeVecF32x4Splat: - return signature_F32_V128, nil - case wasm.OpcodeVecF64x2Splat: - return signature_F64_V128, nil - case wasm.OpcodeVecV128i8x16Shuffle, wasm.OpcodeVecI8x16Swizzle, wasm.OpcodeVecV128And, wasm.OpcodeVecV128Or, wasm.OpcodeVecV128Xor, wasm.OpcodeVecV128AndNot: - return signature_V128V128_V128, nil - case wasm.OpcodeVecI8x16AllTrue, wasm.OpcodeVecI16x8AllTrue, wasm.OpcodeVecI32x4AllTrue, wasm.OpcodeVecI64x2AllTrue, - wasm.OpcodeVecV128AnyTrue, - wasm.OpcodeVecI8x16BitMask, wasm.OpcodeVecI16x8BitMask, wasm.OpcodeVecI32x4BitMask, wasm.OpcodeVecI64x2BitMask: - return signature_V128_I32, nil - case wasm.OpcodeVecV128Not, wasm.OpcodeVecI8x16Neg, wasm.OpcodeVecI16x8Neg, wasm.OpcodeVecI32x4Neg, wasm.OpcodeVecI64x2Neg, - wasm.OpcodeVecF32x4Neg, wasm.OpcodeVecF64x2Neg, wasm.OpcodeVecF32x4Sqrt, wasm.OpcodeVecF64x2Sqrt, - wasm.OpcodeVecI8x16Abs, wasm.OpcodeVecI8x16Popcnt, wasm.OpcodeVecI16x8Abs, wasm.OpcodeVecI32x4Abs, wasm.OpcodeVecI64x2Abs, - wasm.OpcodeVecF32x4Abs, wasm.OpcodeVecF64x2Abs, - wasm.OpcodeVecF32x4Ceil, wasm.OpcodeVecF32x4Floor, wasm.OpcodeVecF32x4Trunc, wasm.OpcodeVecF32x4Nearest, - wasm.OpcodeVecF64x2Ceil, wasm.OpcodeVecF64x2Floor, wasm.OpcodeVecF64x2Trunc, wasm.OpcodeVecF64x2Nearest, - wasm.OpcodeVecI16x8ExtendLowI8x16S, wasm.OpcodeVecI16x8ExtendHighI8x16S, wasm.OpcodeVecI16x8ExtendLowI8x16U, wasm.OpcodeVecI16x8ExtendHighI8x16U, - wasm.OpcodeVecI32x4ExtendLowI16x8S, wasm.OpcodeVecI32x4ExtendHighI16x8S, wasm.OpcodeVecI32x4ExtendLowI16x8U, wasm.OpcodeVecI32x4ExtendHighI16x8U, - wasm.OpcodeVecI64x2ExtendLowI32x4S, wasm.OpcodeVecI64x2ExtendHighI32x4S, wasm.OpcodeVecI64x2ExtendLowI32x4U, wasm.OpcodeVecI64x2ExtendHighI32x4U, - wasm.OpcodeVecI16x8ExtaddPairwiseI8x16S, wasm.OpcodeVecI16x8ExtaddPairwiseI8x16U, wasm.OpcodeVecI32x4ExtaddPairwiseI16x8S, wasm.OpcodeVecI32x4ExtaddPairwiseI16x8U, - wasm.OpcodeVecF64x2PromoteLowF32x4Zero, wasm.OpcodeVecF32x4DemoteF64x2Zero, - wasm.OpcodeVecF32x4ConvertI32x4S, wasm.OpcodeVecF32x4ConvertI32x4U, - wasm.OpcodeVecF64x2ConvertLowI32x4S, wasm.OpcodeVecF64x2ConvertLowI32x4U, - wasm.OpcodeVecI32x4TruncSatF32x4S, wasm.OpcodeVecI32x4TruncSatF32x4U, - wasm.OpcodeVecI32x4TruncSatF64x2SZero, wasm.OpcodeVecI32x4TruncSatF64x2UZero: - return signature_V128_V128, nil - case wasm.OpcodeVecV128Bitselect: - return signature_V128V128V128_V32, nil - case wasm.OpcodeVecI8x16Eq, wasm.OpcodeVecI8x16Ne, wasm.OpcodeVecI8x16LtS, wasm.OpcodeVecI8x16LtU, wasm.OpcodeVecI8x16GtS, - wasm.OpcodeVecI8x16GtU, wasm.OpcodeVecI8x16LeS, wasm.OpcodeVecI8x16LeU, wasm.OpcodeVecI8x16GeS, wasm.OpcodeVecI8x16GeU, - wasm.OpcodeVecI16x8Eq, wasm.OpcodeVecI16x8Ne, wasm.OpcodeVecI16x8LtS, wasm.OpcodeVecI16x8LtU, wasm.OpcodeVecI16x8GtS, - wasm.OpcodeVecI16x8GtU, wasm.OpcodeVecI16x8LeS, wasm.OpcodeVecI16x8LeU, wasm.OpcodeVecI16x8GeS, wasm.OpcodeVecI16x8GeU, - wasm.OpcodeVecI32x4Eq, wasm.OpcodeVecI32x4Ne, wasm.OpcodeVecI32x4LtS, wasm.OpcodeVecI32x4LtU, wasm.OpcodeVecI32x4GtS, - wasm.OpcodeVecI32x4GtU, wasm.OpcodeVecI32x4LeS, wasm.OpcodeVecI32x4LeU, wasm.OpcodeVecI32x4GeS, wasm.OpcodeVecI32x4GeU, - wasm.OpcodeVecI64x2Eq, wasm.OpcodeVecI64x2Ne, wasm.OpcodeVecI64x2LtS, wasm.OpcodeVecI64x2GtS, wasm.OpcodeVecI64x2LeS, - wasm.OpcodeVecI64x2GeS, wasm.OpcodeVecF32x4Eq, wasm.OpcodeVecF32x4Ne, wasm.OpcodeVecF32x4Lt, wasm.OpcodeVecF32x4Gt, - wasm.OpcodeVecF32x4Le, wasm.OpcodeVecF32x4Ge, wasm.OpcodeVecF64x2Eq, wasm.OpcodeVecF64x2Ne, wasm.OpcodeVecF64x2Lt, - wasm.OpcodeVecF64x2Gt, wasm.OpcodeVecF64x2Le, wasm.OpcodeVecF64x2Ge, - wasm.OpcodeVecI8x16Add, wasm.OpcodeVecI8x16AddSatS, wasm.OpcodeVecI8x16AddSatU, wasm.OpcodeVecI8x16Sub, - wasm.OpcodeVecI8x16SubSatS, wasm.OpcodeVecI8x16SubSatU, - wasm.OpcodeVecI16x8Add, wasm.OpcodeVecI16x8AddSatS, wasm.OpcodeVecI16x8AddSatU, wasm.OpcodeVecI16x8Sub, - wasm.OpcodeVecI16x8SubSatS, wasm.OpcodeVecI16x8SubSatU, wasm.OpcodeVecI16x8Mul, - wasm.OpcodeVecI32x4Add, wasm.OpcodeVecI32x4Sub, wasm.OpcodeVecI32x4Mul, - wasm.OpcodeVecI64x2Add, wasm.OpcodeVecI64x2Sub, wasm.OpcodeVecI64x2Mul, - wasm.OpcodeVecF32x4Add, wasm.OpcodeVecF32x4Sub, wasm.OpcodeVecF32x4Mul, wasm.OpcodeVecF32x4Div, - wasm.OpcodeVecF64x2Add, wasm.OpcodeVecF64x2Sub, wasm.OpcodeVecF64x2Mul, wasm.OpcodeVecF64x2Div, - wasm.OpcodeVecI8x16MinS, wasm.OpcodeVecI8x16MinU, wasm.OpcodeVecI8x16MaxS, wasm.OpcodeVecI8x16MaxU, wasm.OpcodeVecI8x16AvgrU, - wasm.OpcodeVecI16x8MinS, wasm.OpcodeVecI16x8MinU, wasm.OpcodeVecI16x8MaxS, wasm.OpcodeVecI16x8MaxU, wasm.OpcodeVecI16x8AvgrU, - wasm.OpcodeVecI32x4MinS, wasm.OpcodeVecI32x4MinU, wasm.OpcodeVecI32x4MaxS, wasm.OpcodeVecI32x4MaxU, - wasm.OpcodeVecF32x4Min, wasm.OpcodeVecF32x4Max, wasm.OpcodeVecF64x2Min, wasm.OpcodeVecF64x2Max, - wasm.OpcodeVecF32x4Pmin, wasm.OpcodeVecF32x4Pmax, wasm.OpcodeVecF64x2Pmin, wasm.OpcodeVecF64x2Pmax, - wasm.OpcodeVecI16x8Q15mulrSatS, - wasm.OpcodeVecI16x8ExtMulLowI8x16S, wasm.OpcodeVecI16x8ExtMulHighI8x16S, wasm.OpcodeVecI16x8ExtMulLowI8x16U, wasm.OpcodeVecI16x8ExtMulHighI8x16U, - wasm.OpcodeVecI32x4ExtMulLowI16x8S, wasm.OpcodeVecI32x4ExtMulHighI16x8S, wasm.OpcodeVecI32x4ExtMulLowI16x8U, wasm.OpcodeVecI32x4ExtMulHighI16x8U, - wasm.OpcodeVecI64x2ExtMulLowI32x4S, wasm.OpcodeVecI64x2ExtMulHighI32x4S, wasm.OpcodeVecI64x2ExtMulLowI32x4U, wasm.OpcodeVecI64x2ExtMulHighI32x4U, - wasm.OpcodeVecI32x4DotI16x8S, - wasm.OpcodeVecI8x16NarrowI16x8S, wasm.OpcodeVecI8x16NarrowI16x8U, wasm.OpcodeVecI16x8NarrowI32x4S, wasm.OpcodeVecI16x8NarrowI32x4U: - return signature_V128V128_V128, nil - default: - return nil, fmt.Errorf("unsupported vector instruction in wazeroir: %s", wasm.VectorInstructionName(vecOp)) - } - default: - return nil, fmt.Errorf("unsupported instruction in wazeroir: 0x%x", op) - } -} - -// funcTypeToIRSignatures is the central cache for a module to get the *signature -// for function calls. -type funcTypeToIRSignatures struct { - directCalls []*signature - indirectCalls []*signature - wasmTypes []wasm.FunctionType -} - -// get returns the *signature for the direct or indirect function call against functions whose type is at `typeIndex`. -func (f *funcTypeToIRSignatures) get(typeIndex wasm.Index, indirect bool) *signature { - var sig *signature - if indirect { - sig = f.indirectCalls[typeIndex] - } else { - sig = f.directCalls[typeIndex] - } - if sig != nil { - return sig - } - - tp := &f.wasmTypes[typeIndex] - if indirect { - sig = &signature{ - in: make([]UnsignedType, 0, len(tp.Params)+1), // +1 to reserve space for call indirect index. - out: make([]UnsignedType, 0, len(tp.Results)), - } - } else { - sig = &signature{ - in: make([]UnsignedType, 0, len(tp.Params)), - out: make([]UnsignedType, 0, len(tp.Results)), - } - } - - for _, vt := range tp.Params { - sig.in = append(sig.in, wasmValueTypeToUnsignedType(vt)) - } - for _, vt := range tp.Results { - sig.out = append(sig.out, wasmValueTypeToUnsignedType(vt)) - } - - if indirect { - sig.in = append(sig.in, UnsignedTypeI32) - f.indirectCalls[typeIndex] = sig - } else { - f.directCalls[typeIndex] = sig - } - return sig -} - -func wasmValueTypeToUnsignedType(vt wasm.ValueType) UnsignedType { - switch vt { - case wasm.ValueTypeI32: - return UnsignedTypeI32 - case wasm.ValueTypeI64, - // From wazeroir layer, ref type values are opaque 64-bit pointers. - wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - return UnsignedTypeI64 - case wasm.ValueTypeF32: - return UnsignedTypeF32 - case wasm.ValueTypeF64: - return UnsignedTypeF64 - case wasm.ValueTypeV128: - return UnsignedTypeV128 - } - panic("unreachable") -} - -func wasmValueTypeToUnsignedOutSignature(vt wasm.ValueType) *signature { - switch vt { - case wasm.ValueTypeI32: - return signature_None_I32 - case wasm.ValueTypeI64, - // From wazeroir layer, ref type values are opaque 64-bit pointers. - wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - return signature_None_I64 - case wasm.ValueTypeF32: - return signature_None_F32 - case wasm.ValueTypeF64: - return signature_None_F64 - case wasm.ValueTypeV128: - return signature_None_V128 - } - panic("unreachable") -} - -func wasmValueTypeToUnsignedInSignature(vt wasm.ValueType) *signature { - switch vt { - case wasm.ValueTypeI32: - return signature_I32_None - case wasm.ValueTypeI64, - // From wazeroir layer, ref type values are opaque 64-bit pointers. - wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - return signature_I64_None - case wasm.ValueTypeF32: - return signature_F32_None - case wasm.ValueTypeF64: - return signature_F64_None - case wasm.ValueTypeV128: - return signature_V128_None - } - panic("unreachable") -} - -func wasmValueTypeToUnsignedInOutSignature(vt wasm.ValueType) *signature { - switch vt { - case wasm.ValueTypeI32: - return signature_I32_I32 - case wasm.ValueTypeI64, - // From wazeroir layer, ref type values are opaque 64-bit pointers. - wasm.ValueTypeExternref, wasm.ValueTypeFuncref: - return signature_I64_I64 - case wasm.ValueTypeF32: - return signature_F32_F32 - case wasm.ValueTypeF64: - return signature_F64_F64 - case wasm.ValueTypeV128: - return signature_V128_V128 - } - panic("unreachable") -} diff --git a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/wazeroir.go b/vendor/github.com/tetratelabs/wazero/internal/wazeroir/wazeroir.go deleted file mode 100644 index 894c4598b1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/internal/wazeroir/wazeroir.go +++ /dev/null @@ -1,8 +0,0 @@ -// Package wazeroir is a pkg to compile down the standard Wasm binary to wazero's specific IR (wazeroir). -// The wazeroir is inspired by microwasm format (a.k.a. LightbeamIR), previously used -// in the lightbeam compiler in Wasmtime, though it is not specified and only exists -// in the previous codebase of wasmtime -// e.g. https://github.com/bytecodealliance/wasmtime/blob/v0.29.0/crates/lightbeam/src/microwasm.rs -// -// See RATIONALE.md for detail. -package wazeroir diff --git a/vendor/github.com/tetratelabs/wazero/netlify.toml b/vendor/github.com/tetratelabs/wazero/netlify.toml deleted file mode 100644 index 6c4751a153..0000000000 --- a/vendor/github.com/tetratelabs/wazero/netlify.toml +++ /dev/null @@ -1,15 +0,0 @@ -[build] - base = "site" - publish = "public" - -[build.environment] - HUGO_VERSION = "0.112.5" - -[context.production] - command = "git submodule update --init && hugo --gc --minify" - -[context.deploy-preview] - command = "git submodule update --init && hugo --gc --minify -b $DEPLOY_PRIME_URL" - -[context.branch-deploy] - command = "git submodule update --init && hugo --gc --minify -b $DEPLOY_PRIME_URL" diff --git a/vendor/github.com/tetratelabs/wazero/runtime.go b/vendor/github.com/tetratelabs/wazero/runtime.go deleted file mode 100644 index 0a944175e1..0000000000 --- a/vendor/github.com/tetratelabs/wazero/runtime.go +++ /dev/null @@ -1,370 +0,0 @@ -package wazero - -import ( - "context" - "fmt" - "sync/atomic" - - "github.com/tetratelabs/wazero/api" - experimentalapi "github.com/tetratelabs/wazero/experimental" - internalsock "github.com/tetratelabs/wazero/internal/sock" - internalsys "github.com/tetratelabs/wazero/internal/sys" - "github.com/tetratelabs/wazero/internal/wasm" - binaryformat "github.com/tetratelabs/wazero/internal/wasm/binary" - "github.com/tetratelabs/wazero/sys" -) - -// Runtime allows embedding of WebAssembly modules. -// -// The below is an example of basic initialization: -// -// ctx := context.Background() -// r := wazero.NewRuntime(ctx) -// defer r.Close(ctx) // This closes everything this Runtime created. -// -// mod, _ := r.Instantiate(ctx, wasm) -// -// # Notes -// -// - This is an interface for decoupling, not third-party implementations. -// All implementations are in wazero. -// - Closing this closes any CompiledModule or Module it instantiated. -type Runtime interface { - // Instantiate instantiates a module from the WebAssembly binary (%.wasm) - // with default configuration. - // - // Here's an example: - // ctx := context.Background() - // r := wazero.NewRuntime(ctx) - // defer r.Close(ctx) // This closes everything this Runtime created. - // - // mod, _ := r.Instantiate(ctx, wasm) - // - // # Notes - // - // - See notes on InstantiateModule for error scenarios. - // - See InstantiateWithConfig for configuration overrides. - Instantiate(ctx context.Context, source []byte) (api.Module, error) - - // InstantiateWithConfig instantiates a module from the WebAssembly binary - // (%.wasm) or errs for reasons including exit or validation. - // - // Here's an example: - // ctx := context.Background() - // r := wazero.NewRuntime(ctx) - // defer r.Close(ctx) // This closes everything this Runtime created. - // - // mod, _ := r.InstantiateWithConfig(ctx, wasm, - // wazero.NewModuleConfig().WithName("rotate")) - // - // # Notes - // - // - See notes on InstantiateModule for error scenarios. - // - If you aren't overriding defaults, use Instantiate. - // - This is a convenience utility that chains CompileModule with - // InstantiateModule. To instantiate the same source multiple times, - // use CompileModule as InstantiateModule avoids redundant decoding - // and/or compilation. - InstantiateWithConfig(ctx context.Context, source []byte, config ModuleConfig) (api.Module, error) - - // NewHostModuleBuilder lets you create modules out of functions defined in Go. - // - // Below defines and instantiates a module named "env" with one function: - // - // ctx := context.Background() - // hello := func() { - // fmt.Fprintln(stdout, "hello!") - // } - // _, err := r.NewHostModuleBuilder("env"). - // NewFunctionBuilder().WithFunc(hello).Export("hello"). - // Instantiate(ctx, r) - // - // Note: empty `moduleName` is not allowed. - NewHostModuleBuilder(moduleName string) HostModuleBuilder - - // CompileModule decodes the WebAssembly binary (%.wasm) or errs if invalid. - // Any pre-compilation done after decoding wasm is dependent on RuntimeConfig. - // - // There are two main reasons to use CompileModule instead of Instantiate: - // - Improve performance when the same module is instantiated multiple times under different names - // - Reduce the amount of errors that can occur during InstantiateModule. - // - // # Notes - // - // - The resulting module name defaults to what was binary from the custom name section. - // - Any pre-compilation done after decoding the source is dependent on RuntimeConfig. - // - // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#name-section%E2%91%A0 - CompileModule(ctx context.Context, binary []byte) (CompiledModule, error) - - // InstantiateModule instantiates the module or errs for reasons including - // exit or validation. - // - // Here's an example: - // mod, _ := n.InstantiateModule(ctx, compiled, wazero.NewModuleConfig(). - // WithName("prod")) - // - // # Errors - // - // While CompiledModule is pre-validated, there are a few situations which - // can cause an error: - // - The module name is already in use. - // - The module has a table element initializer that resolves to an index - // outside the Table minimum size. - // - The module has a start function, and it failed to execute. - // - The module was compiled to WASI and exited with a non-zero exit - // code, you'll receive a sys.ExitError. - // - RuntimeConfig.WithCloseOnContextDone was enabled and a context - // cancellation or deadline triggered before a start function returned. - InstantiateModule(ctx context.Context, compiled CompiledModule, config ModuleConfig) (api.Module, error) - - // CloseWithExitCode closes all the modules that have been initialized in this Runtime with the provided exit code. - // An error is returned if any module returns an error when closed. - // - // Here's an example: - // ctx := context.Background() - // r := wazero.NewRuntime(ctx) - // defer r.CloseWithExitCode(ctx, 2) // This closes everything this Runtime created. - // - // // Everything below here can be closed, but will anyway due to above. - // _, _ = wasi_snapshot_preview1.InstantiateSnapshotPreview1(ctx, r) - // mod, _ := r.Instantiate(ctx, wasm) - CloseWithExitCode(ctx context.Context, exitCode uint32) error - - // Module returns an instantiated module in this runtime or nil if there aren't any. - Module(moduleName string) api.Module - - // Closer closes all compiled code by delegating to CloseWithExitCode with an exit code of zero. - api.Closer -} - -// NewRuntime returns a runtime with a configuration assigned by NewRuntimeConfig. -func NewRuntime(ctx context.Context) Runtime { - return NewRuntimeWithConfig(ctx, NewRuntimeConfig()) -} - -// NewRuntimeWithConfig returns a runtime with the given configuration. -func NewRuntimeWithConfig(ctx context.Context, rConfig RuntimeConfig) Runtime { - config := rConfig.(*runtimeConfig) - var engine wasm.Engine - var cacheImpl *cache - if c := config.cache; c != nil { - // If the Cache is configured, we share the engine. - cacheImpl = c.(*cache) - engine = cacheImpl.initEngine(config.engineKind, config.newEngine, ctx, config.enabledFeatures) - } else { - // Otherwise, we create a new engine. - engine = config.newEngine(ctx, config.enabledFeatures, nil) - } - store := wasm.NewStore(config.enabledFeatures, engine) - zero := uint64(0) - return &runtime{ - cache: cacheImpl, - store: store, - enabledFeatures: config.enabledFeatures, - memoryLimitPages: config.memoryLimitPages, - memoryCapacityFromMax: config.memoryCapacityFromMax, - dwarfDisabled: config.dwarfDisabled, - storeCustomSections: config.storeCustomSections, - closed: &zero, - ensureTermination: config.ensureTermination, - } -} - -// runtime allows decoupling of public interfaces from internal representation. -type runtime struct { - store *wasm.Store - cache *cache - enabledFeatures api.CoreFeatures - memoryLimitPages uint32 - memoryCapacityFromMax bool - dwarfDisabled bool - storeCustomSections bool - - // closed is the pointer used both to guard moduleEngine.CloseWithExitCode and to store the exit code. - // - // The update value is 1 + exitCode << 32. This ensures an exit code of zero isn't mistaken for never closed. - // - // Note: Exclusively reading and updating this with atomics guarantees cross-goroutine observations. - // See /RATIONALE.md - closed *uint64 - - ensureTermination bool -} - -// Module implements Runtime.Module. -func (r *runtime) Module(moduleName string) api.Module { - if len(moduleName) == 0 { - return nil - } - return r.store.Module(moduleName) -} - -// CompileModule implements Runtime.CompileModule -func (r *runtime) CompileModule(ctx context.Context, binary []byte) (CompiledModule, error) { - if err := r.failIfClosed(); err != nil { - return nil, err - } - - internal, err := binaryformat.DecodeModule(binary, r.enabledFeatures, - r.memoryLimitPages, r.memoryCapacityFromMax, !r.dwarfDisabled, r.storeCustomSections) - if err != nil { - return nil, err - } else if err = internal.Validate(r.enabledFeatures); err != nil { - // TODO: decoders should validate before returning, as that allows - // them to err with the correct position in the wasm binary. - return nil, err - } - - // Now that the module is validated, cache the memory definitions. - // TODO: lazy initialization of memory definition. - internal.BuildMemoryDefinitions() - - c := &compiledModule{module: internal, compiledEngine: r.store.Engine} - - // typeIDs are static and compile-time known. - typeIDs, err := r.store.GetFunctionTypeIDs(internal.TypeSection) - if err != nil { - return nil, err - } - c.typeIDs = typeIDs - - listeners, err := buildFunctionListeners(ctx, internal) - if err != nil { - return nil, err - } - internal.AssignModuleID(binary, len(listeners) > 0, r.ensureTermination) - if err = r.store.Engine.CompileModule(ctx, internal, listeners, r.ensureTermination); err != nil { - return nil, err - } - return c, nil -} - -func buildFunctionListeners(ctx context.Context, internal *wasm.Module) ([]experimentalapi.FunctionListener, error) { - // Test to see if internal code are using an experimental feature. - fnlf := ctx.Value(experimentalapi.FunctionListenerFactoryKey{}) - if fnlf == nil { - return nil, nil - } - factory := fnlf.(experimentalapi.FunctionListenerFactory) - importCount := internal.ImportFunctionCount - listeners := make([]experimentalapi.FunctionListener, len(internal.FunctionSection)) - for i := 0; i < len(listeners); i++ { - listeners[i] = factory.NewFunctionListener(internal.FunctionDefinition(uint32(i) + importCount)) - } - return listeners, nil -} - -// failIfClosed returns an error if CloseWithExitCode was called implicitly (by Close) or explicitly. -func (r *runtime) failIfClosed() error { - if closed := atomic.LoadUint64(r.closed); closed != 0 { - return fmt.Errorf("runtime closed with exit_code(%d)", uint32(closed>>32)) - } - return nil -} - -// Instantiate implements Runtime.Instantiate -func (r *runtime) Instantiate(ctx context.Context, binary []byte) (api.Module, error) { - return r.InstantiateWithConfig(ctx, binary, NewModuleConfig()) -} - -// InstantiateWithConfig implements Runtime.InstantiateWithConfig -func (r *runtime) InstantiateWithConfig(ctx context.Context, binary []byte, config ModuleConfig) (api.Module, error) { - if compiled, err := r.CompileModule(ctx, binary); err != nil { - return nil, err - } else { - compiled.(*compiledModule).closeWithModule = true - return r.InstantiateModule(ctx, compiled, config) - } -} - -// InstantiateModule implements Runtime.InstantiateModule. -func (r *runtime) InstantiateModule( - ctx context.Context, - compiled CompiledModule, - mConfig ModuleConfig, -) (mod api.Module, err error) { - if err = r.failIfClosed(); err != nil { - return nil, err - } - - code := compiled.(*compiledModule) - config := mConfig.(*moduleConfig) - - // Only build listeners on a guest module. A host module doesn't have - // memory, and a guest without memory can't use listeners anyway. - if !code.module.IsHostModule { - if sockConfig, ok := ctx.Value(internalsock.ConfigKey{}).(*internalsock.Config); ok { - config.sockConfig = sockConfig - } - } - - var sysCtx *internalsys.Context - if sysCtx, err = config.toSysContext(); err != nil { - return - } - - name := config.name - if !config.nameSet && code.module.NameSection != nil && code.module.NameSection.ModuleName != "" { - name = code.module.NameSection.ModuleName - } - - // Instantiate the module. - mod, err = r.store.Instantiate(ctx, code.module, name, sysCtx, code.typeIDs) - if err != nil { - // If there was an error, don't leak the compiled module. - if code.closeWithModule { - _ = code.Close(ctx) // don't overwrite the error - } - return - } - - // Attach the code closer so that anything afterwards closes the compiled code when closing the module. - if code.closeWithModule { - mod.(*wasm.ModuleInstance).CodeCloser = code - } - - // Now, invoke any start functions, failing at first error. - for _, fn := range config.startFunctions { - start := mod.ExportedFunction(fn) - if start == nil { - continue - } - if _, err = start.Call(ctx); err != nil { - _ = mod.Close(ctx) // Don't leak the module on error. - - if se, ok := err.(*sys.ExitError); ok { - if se.ExitCode() == 0 { // Don't err on success. - err = nil - } - return // Don't wrap an exit error - } - err = fmt.Errorf("module[%s] function[%s] failed: %w", name, fn, err) - return - } - } - return -} - -// Close implements api.Closer embedded in Runtime. -func (r *runtime) Close(ctx context.Context) error { - return r.CloseWithExitCode(ctx, 0) -} - -// CloseWithExitCode implements Runtime.CloseWithExitCode -// -// Note: it also marks the internal `closed` field -func (r *runtime) CloseWithExitCode(ctx context.Context, exitCode uint32) error { - closed := uint64(1) + uint64(exitCode)<<32 // Store exitCode as high-order bits. - if !atomic.CompareAndSwapUint64(r.closed, 0, closed) { - return nil - } - err := r.store.CloseWithExitCode(ctx, exitCode) - if r.cache == nil { - // Close the engine if the cache is not configured, which means that this engine is scoped in this runtime. - if errCloseEngine := r.store.Engine.Close(); errCloseEngine != nil { - return errCloseEngine - } - } - return err -} diff --git a/vendor/github.com/tetratelabs/wazero/sys/clock.go b/vendor/github.com/tetratelabs/wazero/sys/clock.go deleted file mode 100644 index 1c91ce246c..0000000000 --- a/vendor/github.com/tetratelabs/wazero/sys/clock.go +++ /dev/null @@ -1,26 +0,0 @@ -package sys - -// ClockResolution is a positive granularity of clock precision in -// nanoseconds. For example, if the resolution is 1us, this returns 1000. -// -// Note: Some implementations return arbitrary resolution because there's -// no perfect alternative. For example, according to the source in time.go, -// windows monotonic resolution can be 15ms. See /RATIONALE.md. -type ClockResolution uint32 - -// Walltime returns the current unix/epoch time, seconds since midnight UTC -// 1 January 1970, with a nanosecond fraction. -type Walltime func() (sec int64, nsec int32) - -// Nanotime returns nanoseconds since an arbitrary start point, used to measure -// elapsed time. This is sometimes referred to as a tick or monotonic time. -// -// Note: There are no constraints on the value return except that it -// increments. For example, -1 is a valid if the next value is >= 0. -type Nanotime func() int64 - -// Nanosleep puts the current goroutine to sleep for at least ns nanoseconds. -type Nanosleep func(ns int64) - -// Osyield yields the processor, typically to implement spin-wait loops. -type Osyield func() diff --git a/vendor/github.com/tetratelabs/wazero/sys/error.go b/vendor/github.com/tetratelabs/wazero/sys/error.go deleted file mode 100644 index c3efbad964..0000000000 --- a/vendor/github.com/tetratelabs/wazero/sys/error.go +++ /dev/null @@ -1,83 +0,0 @@ -// Package sys includes constants and types used by both public and internal APIs. -package sys - -import ( - "context" - "fmt" -) - -// These two special exit codes are reserved by wazero for context Cancel and Timeout integrations. -// The assumption here is that well-behaving Wasm programs won't use these two exit codes. -const ( - // ExitCodeContextCanceled corresponds to context.Canceled and returned by ExitError.ExitCode in that case. - ExitCodeContextCanceled uint32 = 0xffffffff - // ExitCodeDeadlineExceeded corresponds to context.DeadlineExceeded and returned by ExitError.ExitCode in that case. - ExitCodeDeadlineExceeded uint32 = 0xefffffff -) - -// ExitError is returned to a caller of api.Function when api.Module CloseWithExitCode was invoked, -// or context.Context passed to api.Function Call was canceled or reached the Timeout. -// -// ExitCode zero value means success while any other value is an error. -// -// Here's an example of how to get the exit code: -// -// main := module.ExportedFunction("main") -// if err := main(ctx); err != nil { -// if exitErr, ok := err.(*sys.ExitError); ok { -// // This means your module exited with non-zero code! -// } -// --snip-- -// -// Note: While possible the reason of this was "proc_exit" from "wasi_snapshot_preview1", it could be from other host -// functions, for example an AssemblyScript's abort handler, or any arbitrary caller of CloseWithExitCode. -// -// See https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#proc_exit and -// https://www.assemblyscript.org/concepts.html#special-imports -// -// Note: In the case of context cancellation or timeout, the api.Module from which the api.Function created is closed. -type ExitError struct { - // Note: this is a struct not a uint32 type as it was originally one and - // we don't want to break call-sites that cast into it. - exitCode uint32 -} - -var exitZero = &ExitError{} - -func NewExitError(exitCode uint32) *ExitError { - if exitCode == 0 { - return exitZero - } - return &ExitError{exitCode: exitCode} -} - -// ExitCode returns zero on success, and an arbitrary value otherwise. -func (e *ExitError) ExitCode() uint32 { - return e.exitCode -} - -// Error implements the error interface. -func (e *ExitError) Error() string { - switch e.exitCode { - case ExitCodeContextCanceled: - return fmt.Sprintf("module closed with %s", context.Canceled) - case ExitCodeDeadlineExceeded: - return fmt.Sprintf("module closed with %s", context.DeadlineExceeded) - default: - return fmt.Sprintf("module closed with exit_code(%d)", e.exitCode) - } -} - -// Is allows use via errors.Is -func (e *ExitError) Is(err error) bool { - if target, ok := err.(*ExitError); ok { - return e.exitCode == target.exitCode - } - if e.exitCode == ExitCodeContextCanceled && err == context.Canceled { - return true - } - if e.exitCode == ExitCodeDeadlineExceeded && err == context.DeadlineExceeded { - return true - } - return false -} diff --git a/vendor/github.com/tetratelabs/wazero/testdata/index.html b/vendor/github.com/tetratelabs/wazero/testdata/index.html deleted file mode 100644 index 69e9da4114..0000000000 --- a/vendor/github.com/tetratelabs/wazero/testdata/index.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/vendor/github.com/timakin/bodyclose/LICENSE b/vendor/github.com/timakin/bodyclose/LICENSE deleted file mode 100644 index 6957f1889c..0000000000 --- a/vendor/github.com/timakin/bodyclose/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Seiji Takahashi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go b/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go deleted file mode 100644 index 27042a1537..0000000000 --- a/vendor/github.com/timakin/bodyclose/passes/bodyclose/bodyclose.go +++ /dev/null @@ -1,388 +0,0 @@ -package bodyclose - -import ( - "fmt" - "go/ast" - "go/types" - "strconv" - "strings" - - "github.com/gostaticanalysis/analysisutil" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/ssa" -) - -var Analyzer = &analysis.Analyzer{ - Name: "bodyclose", - Doc: Doc, - Run: new(runner).run, - Requires: []*analysis.Analyzer{ - buildssa.Analyzer, - }, -} - -const ( - Doc = "checks whether HTTP response body is closed successfully" - - nethttpPath = "net/http" - closeMethod = "Close" -) - -type runner struct { - pass *analysis.Pass - resObj types.Object - resTyp *types.Pointer - bodyObj types.Object - closeMthd *types.Func - skipFile map[*ast.File]bool -} - -// run executes an analysis for the pass. The receiver is passed -// by value because this func is called in parallel for different passes. -func (r runner) run(pass *analysis.Pass) (interface{}, error) { - r.pass = pass - funcs := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA).SrcFuncs - - r.resObj = analysisutil.LookupFromImports(pass.Pkg.Imports(), nethttpPath, "Response") - if r.resObj == nil { - // skip checking - return nil, nil - } - - resNamed, ok := r.resObj.Type().(*types.Named) - if !ok { - return nil, fmt.Errorf("cannot find http.Response") - } - r.resTyp = types.NewPointer(resNamed) - - resStruct, ok := r.resObj.Type().Underlying().(*types.Struct) - if !ok { - return nil, fmt.Errorf("cannot find http.Response") - } - for i := 0; i < resStruct.NumFields(); i++ { - field := resStruct.Field(i) - if field.Id() == "Body" { - r.bodyObj = field - - break - } - } - if r.bodyObj == nil { - return nil, fmt.Errorf("cannot find the object http.Response.Body") - } - bodyNamed := r.bodyObj.Type().(*types.Named) - bodyItrf := bodyNamed.Underlying().(*types.Interface) - for i := 0; i < bodyItrf.NumMethods(); i++ { - bmthd := bodyItrf.Method(i) - if bmthd.Id() == closeMethod { - r.closeMthd = bmthd - - break - } - } - - r.skipFile = map[*ast.File]bool{} -FuncLoop: - for _, f := range funcs { - // skip if the function is just referenced - for i := 0; i < f.Signature.Results().Len(); i++ { - if f.Signature.Results().At(i).Type().String() == r.resTyp.String() { - continue FuncLoop - } - } - - for _, b := range f.Blocks { - for i := range b.Instrs { - pos := b.Instrs[i].Pos() - if r.isopen(b, i) { - pass.Reportf(pos, "response body must be closed") - } - } - } - } - - return nil, nil -} - -func (r *runner) isopen(b *ssa.BasicBlock, i int) bool { - call, ok := r.getReqCall(b.Instrs[i]) - if !ok { - return false - } - - if len(*call.Referrers()) == 0 { - return true - } - cRefs := *call.Referrers() - for _, cRef := range cRefs { - val, ok := r.getResVal(cRef) - if !ok { - continue - } - - if len(*val.Referrers()) == 0 { - return true - } - resRefs := *val.Referrers() - for _, resRef := range resRefs { - switch resRef := resRef.(type) { - case *ssa.Store: // Call in Closure function / Response is global variable - if _, ok := resRef.Addr.(*ssa.Global); ok { - // Referrers for globals are always nil, so skip. - return false - } - - if len(*resRef.Addr.Referrers()) == 0 { - return true - } - - for _, aref := range *resRef.Addr.Referrers() { - if c, ok := aref.(*ssa.MakeClosure); ok { - f := c.Fn.(*ssa.Function) - if r.noImportedNetHTTP(f) { - // skip this - return false - } - called := r.isClosureCalled(c) - - return r.calledInFunc(f, called) - } - - } - case *ssa.Call, *ssa.Defer: // Indirect function call - // Hacky way to extract CommonCall - var call ssa.CallCommon - switch rr := resRef.(type) { - case *ssa.Call: - call = rr.Call - case *ssa.Defer: - call = rr.Call - } - - if f, ok := call.Value.(*ssa.Function); ok { - for _, b := range f.Blocks { - for i, bi := range b.Instrs { - if r.isCloseCall(bi) { - return false - } - - if r.isopen(b, i) { - return true - } - } - } - } - case *ssa.FieldAddr: // Normal reference to response entity - if resRef.Referrers() == nil { - return true - } - - bRefs := *resRef.Referrers() - - for _, bRef := range bRefs { - bOp, ok := r.getBodyOp(bRef) - if !ok { - continue - } - if len(*bOp.Referrers()) == 0 { - return true - } - ccalls := *bOp.Referrers() - for _, ccall := range ccalls { - if r.isCloseCall(ccall) { - return false - } - } - } - } - } - } - - return true -} - -func (r *runner) getReqCall(instr ssa.Instruction) (*ssa.Call, bool) { - call, ok := instr.(*ssa.Call) - if !ok { - return nil, false - } - if !strings.Contains(call.Type().String(), r.resTyp.String()) { - return nil, false - } - return call, true -} - -func (r *runner) getResVal(instr ssa.Instruction) (ssa.Value, bool) { - switch instr := instr.(type) { - case *ssa.FieldAddr: - if instr.X.Type().String() == r.resTyp.String() { - return instr.X.(ssa.Value), true - } - case ssa.Value: - if instr.Type().String() == r.resTyp.String() { - return instr, true - } - case *ssa.Store: - if instr.Val.Type().String() == r.resTyp.String() { - return instr.Val, true - } - } - return nil, false -} - -func (r *runner) getBodyOp(instr ssa.Instruction) (*ssa.UnOp, bool) { - op, ok := instr.(*ssa.UnOp) - if !ok { - return nil, false - } - if op.Type() != r.bodyObj.Type() { - return nil, false - } - return op, true -} - -func (r *runner) isCloseCall(ccall ssa.Instruction) bool { - switch ccall := ccall.(type) { - case *ssa.Defer: - if ccall.Call.Method != nil && ccall.Call.Method.Name() == r.closeMthd.Name() { - return true - } - case *ssa.Call: - if ccall.Call.Method != nil && ccall.Call.Method.Name() == r.closeMthd.Name() { - return true - } - case *ssa.ChangeInterface: - if ccall.Type().String() == "io.Closer" { - closeMtd := ccall.Type().Underlying().(*types.Interface).Method(0) - crs := *ccall.Referrers() - for _, cs := range crs { - if cs, ok := cs.(*ssa.Defer); ok { - if val, ok := cs.Common().Value.(*ssa.Function); ok { - for _, b := range val.Blocks { - for _, instr := range b.Instrs { - if c, ok := instr.(*ssa.Call); ok { - if c.Call.Method == closeMtd { - return true - } - } - } - } - } - } - - if returnOp, ok := cs.(*ssa.Return); ok { - for _, resultValue := range returnOp.Results { - if resultValue.Type().String() == "io.Closer" { - return true - } - } - } - } - } - case *ssa.Return: - for _, resultValue := range ccall.Results { - if resultValue.Type().String() == "io.ReadCloser" { - return true - } - } - } - return false -} - -func (r *runner) isClosureCalled(c *ssa.MakeClosure) bool { - refs := *c.Referrers() - if len(refs) == 0 { - return false - } - for _, ref := range refs { - switch ref.(type) { - case *ssa.Call, *ssa.Defer: - return true - } - } - return false -} - -func (r *runner) noImportedNetHTTP(f *ssa.Function) (ret bool) { - obj := f.Object() - if obj == nil { - return false - } - - file := analysisutil.File(r.pass, obj.Pos()) - if file == nil { - return false - } - - if skip, has := r.skipFile[file]; has { - return skip - } - defer func() { - r.skipFile[file] = ret - }() - - for _, impt := range file.Imports { - path, err := strconv.Unquote(impt.Path.Value) - if err != nil { - continue - } - path = analysisutil.RemoveVendor(path) - if path == nethttpPath { - return false - } - } - - return true -} - -func (r *runner) calledInFunc(f *ssa.Function, called bool) bool { - for _, b := range f.Blocks { - for i, instr := range b.Instrs { - switch instr := instr.(type) { - case *ssa.UnOp: - refs := *instr.Referrers() - if len(refs) == 0 { - return true - } - for _, r := range refs { - if v, ok := r.(ssa.Value); ok { - if ptr, ok := v.Type().(*types.Pointer); !ok || !isNamedType(ptr.Elem(), "io", "ReadCloser") { - continue - } - vrefs := *v.Referrers() - for _, vref := range vrefs { - if vref, ok := vref.(*ssa.UnOp); ok { - vrefs := *vref.Referrers() - if len(vrefs) == 0 { - return true - } - for _, vref := range vrefs { - if c, ok := vref.(*ssa.Call); ok { - if c.Call.Method != nil && c.Call.Method.Name() == closeMethod { - return !called - } - } - } - } - } - } - - } - default: - return r.isopen(b, i) || !called - } - } - } - return false -} - -// isNamedType reports whether t is the named type path.name. -func isNamedType(t types.Type, path, name string) bool { - n, ok := t.(*types.Named) - if !ok { - return false - } - obj := n.Obj() - return obj.Name() == name && obj.Pkg() != nil && obj.Pkg().Path() == path -} diff --git a/vendor/github.com/timonwong/loggercheck/.codecov.yml b/vendor/github.com/timonwong/loggercheck/.codecov.yml deleted file mode 100644 index ef90457cac..0000000000 --- a/vendor/github.com/timonwong/loggercheck/.codecov.yml +++ /dev/null @@ -1,16 +0,0 @@ -coverage: - range: 70..90 # green if 90+, red if 70- - status: - patch: - # coverage status for pull request diff - default: - threshold: 1% # allow a little drop - project: - # coverage status for whole project - default: - target: auto # use coverage of base commit as target - threshold: 1% # allow a little drop - -ignore: - - "plugin/**" - - "cmd/**" diff --git a/vendor/github.com/timonwong/loggercheck/.gitignore b/vendor/github.com/timonwong/loggercheck/.gitignore deleted file mode 100644 index 33df0df91c..0000000000 --- a/vendor/github.com/timonwong/loggercheck/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -.vscode/ -.idea/ - -bin/ -vendor/ - -dist/ - -cover.out diff --git a/vendor/github.com/timonwong/loggercheck/.golangci.yml b/vendor/github.com/timonwong/loggercheck/.golangci.yml deleted file mode 100644 index 2873278937..0000000000 --- a/vendor/github.com/timonwong/loggercheck/.golangci.yml +++ /dev/null @@ -1,94 +0,0 @@ -linters-settings: - dupl: - threshold: 100 - funlen: - lines: 100 - statements: 50 - goconst: - min-len: 2 - min-occurrences: 3 - gocritic: - enabled-tags: - - diagnostic - - experimental - - opinionated - - performance - - style - disabled-checks: - - whyNoLint - gocyclo: - min-complexity: 15 - goimports: - local-prefixes: github.com/timonwong/loggercheck - gomnd: - # don't include the "operation" and "assign" - checks: - - argument - - case - - condition - - return - ignored-numbers: - - '0' - - '1' - - '2' - - '3' - ignored-functions: - - strings.SplitN - - strconv.ParseInt - govet: - check-shadowing: true - lll: - line-length: 140 - misspell: - locale: US - nolintlint: - allow-unused: false # report any unused nolint directives - require-explanation: false # don't require an explanation for nolint directives - require-specific: false # don't require nolint directives to be specific about which linter is being skipped -linters: - disable-all: true - enable: - - bodyclose - - dogsled - - dupl - - errcheck - - exportloopref - - funlen - - gochecknoinits - - goconst - - gocritic - - gocyclo - - gofumpt - - goimports - - gomnd - - goprintffuncname - - gosec - - gosimple - - govet - - ineffassign - - lll - - misspell - - nakedret - - noctx - - nolintlint - - revive - - staticcheck - - stylecheck - - typecheck - - unconvert - - unparam - - unused - - whitespace - -issues: - # Excluding configuration per-path, per-linter, per-text and per-source - exclude-rules: - - path: _test\.go - linters: - - gomnd - -run: - timeout: 5m - go: '1.17' - skip-dirs: - - testdata \ No newline at end of file diff --git a/vendor/github.com/timonwong/loggercheck/.goreleaser.yml b/vendor/github.com/timonwong/loggercheck/.goreleaser.yml deleted file mode 100644 index 55ffe7ea03..0000000000 --- a/vendor/github.com/timonwong/loggercheck/.goreleaser.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -project_name: loggercheck - -release: - github: - owner: timonwong - name: loggercheck - -builds: - - binary: loggercheck - goos: - - darwin - - windows - - linux - goarch: - - '386' - - amd64 - - arm - - arm64 - goarm: - - '7' - env: - - CGO_ENABLED=0 - ignore: - - goos: darwin - goarch: '386' - main: ./cmd/loggercheck/ - flags: - - -trimpath - ldflags: -s -w - -archives: - - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' - format_overrides: - - goos: windows - format: zip - files: - - LICENSE - - README.md - -snapshot: - name_template: '{{ incpatch .Version }}-next' - -checksum: - name_template: 'checksums.txt' - -changelog: - sort: asc - filters: - exclude: - - '(?i)^docs?:' - - '(?i)^docs\([^:]+\):' - - '(?i)^docs\[[^:]+\]:' - - '^tests?:' - - '(?i)^dev:' - - '^build\(deps\): bump .* in /docs \(#\d+\)' - - '^build\(deps\): bump .* in /\.github/peril \(#\d+\)' - - Merge pull request - - Merge branch diff --git a/vendor/github.com/timonwong/loggercheck/LICENSE b/vendor/github.com/timonwong/loggercheck/LICENSE deleted file mode 100644 index fb65310900..0000000000 --- a/vendor/github.com/timonwong/loggercheck/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Timon Wong - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/timonwong/loggercheck/Makefile b/vendor/github.com/timonwong/loggercheck/Makefile deleted file mode 100644 index 37bf872024..0000000000 --- a/vendor/github.com/timonwong/loggercheck/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -.PHONY: lint -lint: - golangci-lint run ./... - -.PHONY: test-deps -test-deps: - cd testdata/src/a && go mod vendor - -.PHONY: test -test: test-deps - go test -v -covermode=atomic -coverprofile=cover.out -coverpkg ./... ./... - -.PHONY: build -build: - go build -o bin/loggercheck ./cmd/loggercheck - -.PHONY: build-plugin -build-plugin: - CGO_ENABLED=1 go build -o bin/loggercheck.so -buildmode=plugin ./plugin - -.PHONY: build-all -build-all: build build-plugin diff --git a/vendor/github.com/timonwong/loggercheck/README.md b/vendor/github.com/timonwong/loggercheck/README.md deleted file mode 100644 index 14aeca3717..0000000000 --- a/vendor/github.com/timonwong/loggercheck/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# loggercheck - -## Description - -A linter checks the odd number of key and value pairs for common logger libraries: -- [kitlog](https://github.com/go-kit/log) -- [klog](https://github.com/kubernetes/klog) -- [logr](https://github.com/go-logr/logr) -- [zap](https://github.com/uber-go/zap) - -## Badges - -![Build Status](https://github.com/timonwong/loggercheck/workflows/CI/badge.svg) -[![Coverage](https://img.shields.io/codecov/c/github/timonwong/loggercheck?token=Nutf41gwoG)](https://app.codecov.io/gh/timonwong/loggercheck) -[![License](https://img.shields.io/github/license/timonwong/loggercheck.svg)](/LICENSE) -[![Release](https://img.shields.io/github/release/timonwong/loggercheck.svg)](https://github.com/timonwong/loggercheck/releases/latest) - -## Install - -```shel -go install github.com/timonwong/loggercheck/cmd/loggercheck -``` - -## Usage - -``` -loggercheck: Checks key value pairs for common logger libraries (kitlog,logr,klog,zap). - -Usage: loggercheck [-flag] [package] - - -Flags: - -V print version and exit - -all - no effect (deprecated) - -c int - display offending line with this many lines of context (default -1) - -cpuprofile string - write CPU profile to this file - -debug string - debug flags, any subset of "fpstv" - -disable value - comma-separated list of disabled logger checker (kitlog,klog,logr,zap) (default kitlog) - -fix - apply all suggested fixes - -flags - print analyzer flags in JSON - -json - emit JSON output - -memprofile string - write memory profile to this file - -noprintflike - require printf-like format specifier not present in args - -requirestringkey - require all logging keys to be inlined constant strings - -rulefile string - path to a file contains a list of rules - -source - no effect (deprecated) - -tags string - no effect (deprecated) - -test - indicates whether test files should be analyzed, too (default true) - -trace string - write trace log to this file - -v no effect (deprecated) -``` - -## Example - -```go -package a - -import ( - "context" - "fmt" - - "github.com/go-logr/logr" -) - -func Example() { - log := logr.Discard() - log = log.WithValues("key") - log.Info("message", "key1", "value1", "key2", "value2", "key3") - log.Error(fmt.Errorf("error"), "message", "key1", "value1", "key2") - log.Error(fmt.Errorf("error"), "message", "key1", "value1", "key2", "value2") - - var log2 logr.Logger - log2 = log - log2.Info("message", "key1") - - log3 := logr.FromContextOrDiscard(context.TODO()) - log3.Error(fmt.Errorf("error"), "message", "key1") -} -``` - -``` -a.go:12:23: odd number of arguments passed as key-value pairs for logging -a.go:13:22: odd number of arguments passed as key-value pairs for logging -a.go:14:44: odd number of arguments passed as key-value pairs for logging -a.go:19:23: odd number of arguments passed as key-value pairs for logging -a.go:22:45: odd number of arguments passed as key-value pairs for logging -``` \ No newline at end of file diff --git a/vendor/github.com/timonwong/loggercheck/internal/bytebufferpool/pool.go b/vendor/github.com/timonwong/loggercheck/internal/bytebufferpool/pool.go deleted file mode 100644 index 9d88d21c49..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/bytebufferpool/pool.go +++ /dev/null @@ -1,22 +0,0 @@ -package bytebufferpool - -import ( - "bytes" - "sync" -) - -var pool = sync.Pool{ - New: func() interface{} { - return new(bytes.Buffer) - }, -} - -func Get() *bytes.Buffer { - buf := pool.Get().(*bytes.Buffer) - buf.Reset() - return buf -} - -func Put(buf *bytes.Buffer) { - pool.Put(buf) -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/checkers/checker.go b/vendor/github.com/timonwong/loggercheck/internal/checkers/checker.go deleted file mode 100644 index 5615636efb..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/checkers/checker.go +++ /dev/null @@ -1,59 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" -) - -type Config struct { - RequireStringKey bool - NoPrintfLike bool -} - -type CallContext struct { - Expr *ast.CallExpr - Func *types.Func - Signature *types.Signature -} - -type Checker interface { - FilterKeyAndValues(pass *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr - CheckLoggingKey(pass *analysis.Pass, keyAndValues []ast.Expr) - CheckPrintfLikeSpecifier(pass *analysis.Pass, args []ast.Expr) -} - -func ExecuteChecker(c Checker, pass *analysis.Pass, call CallContext, cfg Config) { - params := call.Signature.Params() - nparams := params.Len() // variadic => nonzero - startIndex := nparams - 1 - - lastArg := params.At(nparams - 1) - iface, ok := lastArg.Type().(*types.Slice).Elem().(*types.Interface) - if !ok || !iface.Empty() { - return // final (args) param is not ...interface{} - } - - keyValuesArgs := c.FilterKeyAndValues(pass, call.Expr.Args[startIndex:]) - - if len(keyValuesArgs)%2 != 0 { - firstArg := keyValuesArgs[0] - lastArg := keyValuesArgs[len(keyValuesArgs)-1] - pass.Report(analysis.Diagnostic{ - Pos: firstArg.Pos(), - End: lastArg.End(), - Category: DiagnosticCategory, - Message: "odd number of arguments passed as key-value pairs for logging", - }) - } - - if cfg.RequireStringKey { - c.CheckLoggingKey(pass, keyValuesArgs) - } - - if cfg.NoPrintfLike { - // Check all args - c.CheckPrintfLikeSpecifier(pass, call.Expr.Args) - } -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/checkers/common.go b/vendor/github.com/timonwong/loggercheck/internal/checkers/common.go deleted file mode 100644 index 42cbd01937..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/checkers/common.go +++ /dev/null @@ -1,49 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/constant" - "go/printer" - "go/token" - "go/types" - "unicode/utf8" - - "golang.org/x/tools/go/analysis" - - "github.com/timonwong/loggercheck/internal/bytebufferpool" -) - -const ( - DiagnosticCategory = "logging" -) - -// extractValueFromStringArg returns true if the argument is a string type (literal or constant). -func extractValueFromStringArg(pass *analysis.Pass, arg ast.Expr) (value string, ok bool) { - if typeAndValue, ok := pass.TypesInfo.Types[arg]; ok { - if typ, ok := typeAndValue.Type.(*types.Basic); ok && typ.Kind() == types.String && typeAndValue.Value != nil { - return constant.StringVal(typeAndValue.Value), true - } - } - - return "", false -} - -func renderNodeEllipsis(fset *token.FileSet, v interface{}) string { - const maxLen = 20 - - buf := bytebufferpool.Get() - defer bytebufferpool.Put(buf) - - _ = printer.Fprint(buf, fset, v) - s := buf.String() - if utf8.RuneCountInString(s) > maxLen { - // Copied from go/constant/value.go - i := 0 - for n := 0; n < maxLen-3; n++ { - _, size := utf8.DecodeRuneInString(s[i:]) - i += size - } - s = s[:i] + "..." - } - return s -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/checkers/general.go b/vendor/github.com/timonwong/loggercheck/internal/checkers/general.go deleted file mode 100644 index 6512cce30d..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/checkers/general.go +++ /dev/null @@ -1,68 +0,0 @@ -package checkers - -import ( - "fmt" - "go/ast" - - "golang.org/x/tools/go/analysis" - - "github.com/timonwong/loggercheck/internal/checkers/printf" - "github.com/timonwong/loggercheck/internal/stringutil" -) - -type General struct{} - -func (g General) FilterKeyAndValues(_ *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr { - return keyAndValues -} - -func (g General) CheckLoggingKey(pass *analysis.Pass, keyAndValues []ast.Expr) { - for i := 0; i < len(keyAndValues); i += 2 { - arg := keyAndValues[i] - if value, ok := extractValueFromStringArg(pass, arg); ok { - if stringutil.IsASCII(value) { - continue - } - - pass.Report(analysis.Diagnostic{ - Pos: arg.Pos(), - End: arg.End(), - Category: DiagnosticCategory, - Message: fmt.Sprintf( - "logging keys are expected to be alphanumeric strings, please remove any non-latin characters from %q", - value), - }) - } else { - pass.Report(analysis.Diagnostic{ - Pos: arg.Pos(), - End: arg.End(), - Category: DiagnosticCategory, - Message: fmt.Sprintf( - "logging keys are expected to be inlined constant strings, please replace %q provided with string", - renderNodeEllipsis(pass.Fset, arg)), - }) - } - } -} - -func (g General) CheckPrintfLikeSpecifier(pass *analysis.Pass, args []ast.Expr) { - for _, arg := range args { - format, ok := extractValueFromStringArg(pass, arg) - if !ok { - continue - } - - if specifier, ok := printf.IsPrintfLike(format); ok { - pass.Report(analysis.Diagnostic{ - Pos: arg.Pos(), - End: arg.End(), - Category: DiagnosticCategory, - Message: fmt.Sprintf("logging message should not use format specifier %q", specifier), - }) - - return // One error diagnostic is enough - } - } -} - -var _ Checker = (*General)(nil) diff --git a/vendor/github.com/timonwong/loggercheck/internal/checkers/printf/printf.go b/vendor/github.com/timonwong/loggercheck/internal/checkers/printf/printf.go deleted file mode 100644 index b38f46f201..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/checkers/printf/printf.go +++ /dev/null @@ -1,252 +0,0 @@ -package printf - -import ( - "strconv" - "strings" - "unicode/utf8" -) - -// Copied from golang.org/x/tools -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -type printVerb struct { - verb rune // User may provide verb through Formatter; could be a rune. - flags string // known flags are all ASCII -} - -// Common flag sets for printf verbs. -const ( - noFlag = "" - numFlag = " -+.0" - sharpNumFlag = " -+.0#" - allFlags = " -+.0#" -) - -// printVerbs identifies which flags are known to printf for each verb. -var printVerbs = []printVerb{ - // '-' is a width modifier, always valid. - // '.' is a precision for float, max width for strings. - // '+' is required sign for numbers, Go format for %v. - // '#' is alternate format for several verbs. - // ' ' is spacer for numbers - {'%', noFlag}, - {'b', sharpNumFlag}, - {'c', "-"}, - {'d', numFlag}, - {'e', sharpNumFlag}, - {'E', sharpNumFlag}, - {'f', sharpNumFlag}, - {'F', sharpNumFlag}, - {'g', sharpNumFlag}, - {'G', sharpNumFlag}, - {'o', sharpNumFlag}, - {'O', sharpNumFlag}, - {'p', "-#"}, - {'q', " -+.0#"}, - {'s', " -+.0"}, - {'t', "-"}, - {'T', "-"}, - {'U', "-#"}, - {'v', allFlags}, - {'w', allFlags}, - {'x', sharpNumFlag}, - {'X', sharpNumFlag}, -} - -// formatState holds the parsed representation of a printf directive such as "%3.*[4]d". -// It is constructed by parsePrintfVerb. -type formatState struct { - verb rune // the format verb: 'd' for "%d" - format string // the full format directive from % through verb, "%.3d". - flags []byte // the list of # + etc. - // Used only during parse. - hasIndex bool // Whether the argument is indexed. - indexPending bool // Whether we have an indexed argument that has not resolved. - nbytes int // number of bytes of the format string consumed. -} - -// parseFlags accepts any printf flags. -func (s *formatState) parseFlags() { - for s.nbytes < len(s.format) { - switch c := s.format[s.nbytes]; c { - case '#', '0', '+', '-', ' ': - s.flags = append(s.flags, c) - s.nbytes++ - default: - return - } - } -} - -// scanNum advances through a decimal number if present. -func (s *formatState) scanNum() { - for ; s.nbytes < len(s.format); s.nbytes++ { - c := s.format[s.nbytes] - if c < '0' || '9' < c { - return - } - } -} - -func stringIndexAt(s, substr string, start int) int { - idx := strings.Index(s[start:], substr) - if idx < 0 { - return idx - } - return idx + start -} - -// parseIndex scans an index expression. It returns false if there is a syntax error. -func (s *formatState) parseIndex() bool { - if s.nbytes == len(s.format) || s.format[s.nbytes] != '[' { - return true - } - // Argument index present. - s.nbytes++ // skip '[' - start := s.nbytes - s.scanNum() - ok := true - if s.nbytes == len(s.format) || s.nbytes == start || s.format[s.nbytes] != ']' { - ok = false - s.nbytes = stringIndexAt(s.format, "]", start) - if s.nbytes < 0 { - return false - } - } - arg32, err := strconv.ParseInt(s.format[start:s.nbytes], 10, 32) - if err != nil || !ok || arg32 <= 0 { - return false - } - s.nbytes++ // skip ']' - s.hasIndex = true - s.indexPending = true - return true -} - -// parseNum scans a width or precision (or *). -func (s *formatState) parseNum() { - if s.nbytes < len(s.format) && s.format[s.nbytes] == '*' { - if s.indexPending { // Absorb it. - s.indexPending = false - } - s.nbytes++ - } else { - s.scanNum() - } -} - -// parsePrecision scans for a precision. It returns false if there's a bad index expression. -func (s *formatState) parsePrecision() bool { - // If there's a period, there may be a precision. - if s.nbytes < len(s.format) && s.format[s.nbytes] == '.' { - s.flags = append(s.flags, '.') // Treat precision as a flag. - s.nbytes++ - if !s.parseIndex() { - return false - } - s.parseNum() - } - return true -} - -// parsePrintfVerb looks the formatting directive that begins the format string -// and returns a formatState that encodes what the directive wants, without looking -// at the actual arguments present in the call. The result is nil if there is an error. -func parsePrintfVerb(format string) *formatState { - state := &formatState{ - format: format, - flags: make([]byte, 0, 5), //nolint:gomnd - nbytes: 1, // There's guaranteed to be a percent sign. - } - - // There may be flags. - state.parseFlags() - // There may be an index. - if !state.parseIndex() { - return nil - } - // There may be a width. - state.parseNum() - // There may be a precision. - if !state.parsePrecision() { - return nil - } - // Now a verb, possibly prefixed by an index (which we may already have). - if !state.indexPending && !state.parseIndex() { - return nil - } - if state.nbytes == len(state.format) { - // missing verb at end of string - return nil - } - verb, w := utf8.DecodeRuneInString(state.format[state.nbytes:]) - state.verb = verb - state.nbytes += w - state.format = state.format[:state.nbytes] - return state -} - -func containsAll(s string, pattern []byte) bool { - for _, c := range pattern { - if !strings.ContainsRune(s, rune(c)) { - return false - } - } - return true -} - -func isPrintfArg(state *formatState) bool { - var v printVerb - found := false - // Linear scan is fast enough for a small list. - for _, v = range printVerbs { - if v.verb == state.verb { - found = true - break - } - } - - if !found { - // unknown verb, just skip - return false - } - - if !containsAll(v.flags, state.flags) { - // unrecognized format flag, just skip - return false - } - - return true -} - -func IsPrintfLike(format string) (firstSpecifier string, ok bool) { - if !strings.Contains(format, "%") { - return "", false - } - - for i, w := 0, 0; i < len(format); i += w { - w = 1 - if format[i] != '%' { - continue - } - - state := parsePrintfVerb(format[i:]) - if state == nil { - return "", false - } - - w = len(state.format) - if !isPrintfArg(state) { - return "", false - } - - if !ok { - firstSpecifier = state.format - ok = true - } - } - - return -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/checkers/zap.go b/vendor/github.com/timonwong/loggercheck/internal/checkers/zap.go deleted file mode 100644 index 2356f83482..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/checkers/zap.go +++ /dev/null @@ -1,42 +0,0 @@ -package checkers - -import ( - "go/ast" - "go/types" - - "golang.org/x/tools/go/analysis" -) - -type Zap struct { - General -} - -func (z Zap) FilterKeyAndValues(pass *analysis.Pass, keyAndValues []ast.Expr) []ast.Expr { - // Check the argument count - filtered := make([]ast.Expr, 0, len(keyAndValues)) - for _, arg := range keyAndValues { - // Skip any zapcore.Field we found - switch arg := arg.(type) { - case *ast.CallExpr, *ast.Ident: - typ := pass.TypesInfo.TypeOf(arg) - switch typ := typ.(type) { - case *types.Named: - obj := typ.Obj() - // This is a strongly-typed field. Consume it and move on. - // Actually it's go.uber.org/zap/zapcore.Field, however for simplicity - // we don't check the import path - if obj != nil && obj.Name() == "Field" { - continue - } - default: - // pass - } - } - - filtered = append(filtered, arg) - } - - return filtered -} - -var _ Checker = (*Zap)(nil) diff --git a/vendor/github.com/timonwong/loggercheck/internal/rules/rules.go b/vendor/github.com/timonwong/loggercheck/internal/rules/rules.go deleted file mode 100644 index 27d6ebb274..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/rules/rules.go +++ /dev/null @@ -1,201 +0,0 @@ -package rules - -import ( - "bufio" - "errors" - "fmt" - "go/types" - "io" - "strings" - - "github.com/timonwong/loggercheck/internal/bytebufferpool" -) - -var ErrInvalidRule = errors.New("invalid rule format") - -const CustomRulesetName = "custom" - -type Ruleset struct { - Name string - PackageImport string - Rules []FuncRule - - ruleIndicesByFuncName map[string][]int -} - -func (rs *Ruleset) Match(fn *types.Func) bool { - // PackageImport is already checked (by indices), skip checking it here - sig := fn.Type().(*types.Signature) // it's safe since we already checked - - // Fail fast if the function name is not in the rule list. - indices, ok := rs.ruleIndicesByFuncName[fn.Name()] - if !ok { - return false - } - - for _, idx := range indices { - rule := &rs.Rules[idx] - if matchRule(rule, sig) { - return true - } - } - - return false -} - -func receiverTypeOf(recvType types.Type) string { - buf := bytebufferpool.Get() - defer bytebufferpool.Put(buf) - - var recvNamed *types.Named - switch recvType := recvType.(type) { - case *types.Pointer: - buf.WriteByte('*') - if elem, ok := recvType.Elem().(*types.Named); ok { - recvNamed = elem - } - case *types.Named: - recvNamed = recvType - } - - if recvNamed == nil { - // not supported type - return "" - } - - buf.WriteString(recvNamed.Obj().Name()) - typeParams := recvNamed.TypeParams() - if typeParamsLen := typeParams.Len(); typeParamsLen > 0 { - buf.WriteByte('[') - for i := 0; i < typeParamsLen; i++ { - if i > 0 { - // comma as separator - buf.WriteByte(',') - } - p := typeParams.At(i) - buf.WriteString(p.Obj().Name()) - } - buf.WriteByte(']') - } - - return buf.String() -} - -func matchRule(p *FuncRule, sig *types.Signature) bool { - // we do not check package import here since it's already checked in Match() - recv := sig.Recv() - isReceiver := recv != nil - if isReceiver != p.IsReceiver { - return false - } - - if isReceiver { - recvType := recv.Type() - receiverType := receiverTypeOf(recvType) - if receiverType != p.ReceiverType { - return false - } - } - - return true -} - -type FuncRule struct { // package import should be accessed from Rulset - ReceiverType string - FuncName string - IsReceiver bool -} - -func ParseFuncRule(rule string) (packageImport string, pat FuncRule, err error) { - lastDot := strings.LastIndexFunc(rule, func(r rune) bool { - return r == '.' || r == '/' - }) - if lastDot == -1 || rule[lastDot] == '/' { - return "", pat, ErrInvalidRule - } - - importOrReceiver := rule[:lastDot] - pat.FuncName = rule[lastDot+1:] - - if strings.HasPrefix(rule, "(") { // package - if !strings.HasSuffix(importOrReceiver, ")") { - return "", FuncRule{}, ErrInvalidRule - } - - var isPointerReceiver bool - pat.IsReceiver = true - receiver := importOrReceiver[1 : len(importOrReceiver)-1] - if strings.HasPrefix(receiver, "*") { - isPointerReceiver = true - receiver = receiver[1:] - } - - typeDotIdx := strings.LastIndexFunc(receiver, func(r rune) bool { - return r == '.' || r == '/' - }) - if typeDotIdx == -1 || receiver[typeDotIdx] == '/' { - return "", FuncRule{}, ErrInvalidRule - } - receiverType := receiver[typeDotIdx+1:] - if isPointerReceiver { - receiverType = "*" + receiverType - } - pat.ReceiverType = receiverType - packageImport = receiver[:typeDotIdx] - } else { - packageImport = importOrReceiver - } - - return packageImport, pat, nil -} - -func ParseRules(lines []string) (result []Ruleset, err error) { - rulesByImport := make(map[string][]FuncRule) - for i, line := range lines { - if line == "" { - continue - } - - if strings.HasPrefix(line, "#") { // comments - continue - } - - packageImport, pat, err := ParseFuncRule(line) - if err != nil { - return nil, fmt.Errorf("error parse rule at line %d: %w", i+1, err) - } - rulesByImport[packageImport] = append(rulesByImport[packageImport], pat) - } - - for packageImport, rules := range rulesByImport { - ruleIndicesByFuncName := make(map[string][]int, len(rules)) - for idx, rule := range rules { - fnName := rule.FuncName - ruleIndicesByFuncName[fnName] = append(ruleIndicesByFuncName[fnName], idx) - } - - result = append(result, Ruleset{ - Name: CustomRulesetName, // NOTE(timonwong) Always "custom" for custom rule - PackageImport: packageImport, - Rules: rules, - ruleIndicesByFuncName: ruleIndicesByFuncName, - }) - } - return result, nil -} - -func ParseRuleFile(r io.Reader) (result []Ruleset, err error) { - // Rule files are relatively small, so read it into string slice first. - var lines []string - - scanner := bufio.NewScanner(r) - for scanner.Scan() { - line := strings.TrimSpace(scanner.Text()) - lines = append(lines, line) - } - if err := scanner.Err(); err != nil { - return nil, err - } - - return ParseRules(lines) -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/sets/string.go b/vendor/github.com/timonwong/loggercheck/internal/sets/string.go deleted file mode 100644 index daf8d57fce..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/sets/string.go +++ /dev/null @@ -1,59 +0,0 @@ -package sets - -import ( - "sort" - "strings" -) - -type Empty struct{} - -type StringSet map[string]Empty - -func NewString(items ...string) StringSet { - s := make(StringSet) - s.Insert(items...) - return s -} - -func (s StringSet) Insert(items ...string) { - for _, item := range items { - s[item] = Empty{} - } -} - -func (s StringSet) Has(item string) bool { - _, contained := s[item] - return contained -} - -func (s StringSet) List() []string { - if len(s) == 0 { - return nil - } - - res := make([]string, 0, len(s)) - for key := range s { - res = append(res, key) - } - sort.Strings(res) - return res -} - -// Set implements flag.Value interface. -func (s *StringSet) Set(v string) error { - v = strings.TrimSpace(v) - if v == "" { - *s = nil - return nil - } - - parts := strings.Split(v, ",") - set := NewString(parts...) - *s = set - return nil -} - -// String implements flag.Value interface -func (s StringSet) String() string { - return strings.Join(s.List(), ",") -} diff --git a/vendor/github.com/timonwong/loggercheck/internal/stringutil/is.go b/vendor/github.com/timonwong/loggercheck/internal/stringutil/is.go deleted file mode 100644 index a36b742fc4..0000000000 --- a/vendor/github.com/timonwong/loggercheck/internal/stringutil/is.go +++ /dev/null @@ -1,15 +0,0 @@ -package stringutil - -import "unicode/utf8" - -// IsASCII returns true if string are ASCII. -func IsASCII(s string) bool { - for _, r := range s { - if r >= utf8.RuneSelf { - // Not ASCII. - return false - } - } - - return true -} diff --git a/vendor/github.com/timonwong/loggercheck/loggercheck.go b/vendor/github.com/timonwong/loggercheck/loggercheck.go deleted file mode 100644 index 8bd10aee80..0000000000 --- a/vendor/github.com/timonwong/loggercheck/loggercheck.go +++ /dev/null @@ -1,196 +0,0 @@ -package loggercheck - -import ( - "flag" - "fmt" - "go/ast" - "go/types" - "os" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - "golang.org/x/tools/go/types/typeutil" - - "github.com/timonwong/loggercheck/internal/checkers" - "github.com/timonwong/loggercheck/internal/rules" - "github.com/timonwong/loggercheck/internal/sets" -) - -const Doc = `Checks key value pairs for common logger libraries (kitlog,klog,logr,zap).` - -func NewAnalyzer(opts ...Option) *analysis.Analyzer { - l := newLoggerCheck(opts...) - a := &analysis.Analyzer{ - Name: "loggercheck", - Doc: Doc, - Flags: *l.fs, - Run: l.run, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - } - return a -} - -type loggercheck struct { - fs *flag.FlagSet - - disable sets.StringSet // flag -disable - ruleFile string // flag -rulefile - requireStringKey bool // flag -requirestringkey - noPrintfLike bool // flag -noprintflike - - rules []string // used for external integration, for example golangci-lint - rulesetList []rules.Ruleset // populate at runtime - rulesetIndicesByImport map[string][]int // ruleset index, populate at runtime -} - -func newLoggerCheck(opts ...Option) *loggercheck { - fs := flag.NewFlagSet("loggercheck", flag.ExitOnError) - l := &loggercheck{ - fs: fs, - disable: sets.NewString("kitlog"), - rulesetList: append([]rules.Ruleset{}, staticRuleList...), // ensure we make a clone of static rules first - } - - fs.StringVar(&l.ruleFile, "rulefile", "", "path to a file contains a list of rules") - fs.Var(&l.disable, "disable", "comma-separated list of disabled logger checker (kitlog,klog,logr,zap)") - fs.BoolVar(&l.requireStringKey, "requirestringkey", false, "require all logging keys to be inlined constant strings") - fs.BoolVar(&l.noPrintfLike, "noprintflike", false, "require printf-like format specifier not present in args") - - for _, opt := range opts { - opt(l) - } - - return l -} - -func (l *loggercheck) isCheckerDisabled(name string) bool { - return l.disable.Has(name) -} - -// vendorLessPath returns the devendorized version of the import path ipath. -// For example: "a/vendor/github.com/go-logr/logr" will become "github.com/go-logr/logr". -func vendorLessPath(ipath string) string { - if i := strings.LastIndex(ipath, "/vendor/"); i >= 0 { - return ipath[i+len("/vendor/"):] - } - return ipath -} - -func (l *loggercheck) getCheckerForFunc(fn *types.Func) checkers.Checker { - pkg := fn.Pkg() - if pkg == nil { - return nil - } - - pkgPath := vendorLessPath(pkg.Path()) - indices := l.rulesetIndicesByImport[pkgPath] - - for _, idx := range indices { - rs := &l.rulesetList[idx] - if l.isCheckerDisabled(rs.Name) { - // Skip ignored logger checker. - continue - } - - if !rs.Match(fn) { - continue - } - - checker := checkerByRulesetName[rs.Name] - if checker == nil { - return checkers.General{} - } - return checker - } - - return nil -} - -func (l *loggercheck) checkLoggerArguments(pass *analysis.Pass, call *ast.CallExpr) { - fn, _ := typeutil.Callee(pass.TypesInfo, call).(*types.Func) - if fn == nil { - return // function pointer is not supported - } - - sig, ok := fn.Type().(*types.Signature) - if !ok || !sig.Variadic() { - return // not variadic - } - - // ellipsis args is hard, just skip - if call.Ellipsis.IsValid() { - return - } - - checker := l.getCheckerForFunc(fn) - if checker == nil { - return - } - - checkers.ExecuteChecker(checker, pass, checkers.CallContext{ - Expr: call, - Func: fn, - Signature: sig, - }, checkers.Config{ - RequireStringKey: l.requireStringKey, - NoPrintfLike: l.noPrintfLike, - }) -} - -func (l *loggercheck) processConfig() error { - if l.ruleFile != "" { // flags takes precedence over configs - f, err := os.Open(l.ruleFile) - if err != nil { - return fmt.Errorf("failed to open rule file: %w", err) - } - defer f.Close() - - custom, err := rules.ParseRuleFile(f) - if err != nil { - return fmt.Errorf("failed to parse rule file: %w", err) - } - l.rulesetList = append(l.rulesetList, custom...) - } else if len(l.rules) > 0 { - custom, err := rules.ParseRules(l.rules) - if err != nil { - return fmt.Errorf("failed to parse rules: %w", err) - } - l.rulesetList = append(l.rulesetList, custom...) - } - - // Build index - indices := make(map[string][]int) - for i, rs := range l.rulesetList { - indices[rs.PackageImport] = append(indices[rs.PackageImport], i) - } - l.rulesetIndicesByImport = indices - - return nil -} - -func (l *loggercheck) run(pass *analysis.Pass) (interface{}, error) { - err := l.processConfig() - if err != nil { - return nil, err - } - - insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CallExpr)(nil), - } - insp.Preorder(nodeFilter, func(node ast.Node) { - call := node.(*ast.CallExpr) - - typ := pass.TypesInfo.Types[call.Fun].Type - if typ == nil { - // Skip checking functions with unknown type. - return - } - - l.checkLoggerArguments(pass, call) - }) - - return nil, nil -} diff --git a/vendor/github.com/timonwong/loggercheck/options.go b/vendor/github.com/timonwong/loggercheck/options.go deleted file mode 100644 index 6b5f00af1e..0000000000 --- a/vendor/github.com/timonwong/loggercheck/options.go +++ /dev/null @@ -1,31 +0,0 @@ -package loggercheck - -import ( - "github.com/timonwong/loggercheck/internal/sets" -) - -type Option func(*loggercheck) - -func WithDisable(disable []string) Option { - return func(l *loggercheck) { - l.disable = sets.NewString(disable...) - } -} - -func WithRules(customRules []string) Option { - return func(l *loggercheck) { - l.rules = customRules - } -} - -func WithRequireStringKey(requireStringKey bool) Option { - return func(l *loggercheck) { - l.requireStringKey = requireStringKey - } -} - -func WithNoPrintfLike(noPrintfLike bool) Option { - return func(l *loggercheck) { - l.noPrintfLike = noPrintfLike - } -} diff --git a/vendor/github.com/timonwong/loggercheck/staticrules.go b/vendor/github.com/timonwong/loggercheck/staticrules.go deleted file mode 100644 index f955b34341..0000000000 --- a/vendor/github.com/timonwong/loggercheck/staticrules.go +++ /dev/null @@ -1,68 +0,0 @@ -package loggercheck - -import ( - "errors" - "fmt" - - "github.com/timonwong/loggercheck/internal/checkers" - "github.com/timonwong/loggercheck/internal/rules" -) - -var ( - staticRuleList = []rules.Ruleset{ - mustNewStaticRuleSet("logr", []string{ - "(github.com/go-logr/logr.Logger).Error", - "(github.com/go-logr/logr.Logger).Info", - "(github.com/go-logr/logr.Logger).WithValues", - }), - mustNewStaticRuleSet("klog", []string{ - "k8s.io/klog/v2.InfoS", - "k8s.io/klog/v2.InfoSDepth", - "k8s.io/klog/v2.ErrorS", - "(k8s.io/klog/v2.Verbose).InfoS", - "(k8s.io/klog/v2.Verbose).InfoSDepth", - "(k8s.io/klog/v2.Verbose).ErrorS", - }), - mustNewStaticRuleSet("zap", []string{ - "(*go.uber.org/zap.SugaredLogger).With", - "(*go.uber.org/zap.SugaredLogger).Debugw", - "(*go.uber.org/zap.SugaredLogger).Infow", - "(*go.uber.org/zap.SugaredLogger).Warnw", - "(*go.uber.org/zap.SugaredLogger).Errorw", - "(*go.uber.org/zap.SugaredLogger).DPanicw", - "(*go.uber.org/zap.SugaredLogger).Panicw", - "(*go.uber.org/zap.SugaredLogger).Fatalw", - }), - mustNewStaticRuleSet("kitlog", []string{ - "github.com/go-kit/log.With", - "github.com/go-kit/log.WithPrefix", - "github.com/go-kit/log.WithSuffix", - "(github.com/go-kit/log.Logger).Log", - }), - } - checkerByRulesetName = map[string]checkers.Checker{ - // by default, checkers.General will be used. - "zap": checkers.Zap{}, - } -) - -// mustNewStaticRuleSet only called at init, catch errors during development. -// In production it will not panic. -func mustNewStaticRuleSet(name string, lines []string) rules.Ruleset { - if len(lines) == 0 { - panic(errors.New("no rules provided")) - } - - rulesetList, err := rules.ParseRules(lines) - if err != nil { - panic(err) - } - - if len(rulesetList) != 1 { - panic(fmt.Errorf("expected 1 ruleset, got %d", len(rulesetList))) - } - - ruleset := rulesetList[0] - ruleset.Name = name - return ruleset -} diff --git a/vendor/github.com/tomarrell/wrapcheck/v2/LICENSE b/vendor/github.com/tomarrell/wrapcheck/v2/LICENSE deleted file mode 100644 index b5d9d30d38..0000000000 --- a/vendor/github.com/tomarrell/wrapcheck/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Tom Arrell - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/tomarrell/wrapcheck/v2/wrapcheck/wrapcheck.go b/vendor/github.com/tomarrell/wrapcheck/v2/wrapcheck/wrapcheck.go deleted file mode 100644 index 6da17bd867..0000000000 --- a/vendor/github.com/tomarrell/wrapcheck/v2/wrapcheck/wrapcheck.go +++ /dev/null @@ -1,439 +0,0 @@ -package wrapcheck - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "regexp" - "strings" - - "github.com/gobwas/glob" - "golang.org/x/tools/go/analysis" -) - -var DefaultIgnoreSigs = []string{ - ".Errorf(", - "errors.New(", - "errors.Unwrap(", - "errors.Join(", - ".Wrap(", - ".Wrapf(", - ".WithMessage(", - ".WithMessagef(", - ".WithStack(", -} - -// WrapcheckConfig is the set of configuration values which configure the -// behaviour of the linter. -type WrapcheckConfig struct { - // IgnoreSigs defines a list of substrings which if contained within the - // signature of the function call returning the error, will be ignored. This - // allows you to specify functions that wrapcheck will not report as - // unwrapped. - // - // For example, an ignoreSig of `[]string{"errors.New("}` will ignore errors - // returned from the stdlib package error's function: - // - // `func errors.New(message string) error` - // - // Due to the signature containing the substring `errors.New(`. - // - // Note: Setting this value will intentionally override the default ignored - // sigs. To achieve the same behaviour as default, you should add the default - // list to your config. - IgnoreSigs []string `mapstructure:"ignoreSigs" yaml:"ignoreSigs"` - - // IgnoreSigRegexps defines a list of regular expressions which if matched - // to the signature of the function call returning the error, will be ignored. This - // allows you to specify functions that wrapcheck will not report as - // unwrapped. - // - // For example, an ignoreSigRegexp of `[]string{"\.New.*Err\("}`` will ignore errors - // returned from any signature whose method name starts with "New" and ends with "Err" - // due to the signature matching the regular expression `\.New.*Err\(`. - // - // Note that this is similar to the ignoreSigs configuration, but provides - // slightly more flexibility in defining rules by which signatures will be - // ignored. - IgnoreSigRegexps []string `mapstructure:"ignoreSigRegexps" yaml:"ignoreSigRegexps"` - - // IgnorePackageGlobs defines a list of globs which, if matching the package - // of the function returning the error, will ignore the error when doing - // wrapcheck analysis. - // - // This is useful for broadly ignoring packages and subpackages from wrapcheck - // analysis. For example, to ignore all errors from all packages and - // subpackages of "encoding" you may include the configuration: - // - // -- .wrapcheck.yaml - // ignorePackageGlobs: - // - encoding/* - IgnorePackageGlobs []string `mapstructure:"ignorePackageGlobs" yaml:"ignorePackageGlobs"` - - // IgnoreInterfaceRegexps defines a list of regular expressions which, if matched - // to a underlying interface name, will ignore unwrapped errors returned from a - // function whose call is defined on the given interface. - // - // For example, an ignoreInterfaceRegexps of `[]string{"Transac(tor|tion)"}` will ignore errors - // returned from any function whose call is defined on a interface named 'Transactor' - // or 'Transaction' due to the name matching the regular expression `Transac(tor|tion)`. - IgnoreInterfaceRegexps []string `mapstructure:"ignoreInterfaceRegexps" yaml:"ignoreInterfaceRegexps"` -} - -func NewDefaultConfig() WrapcheckConfig { - return WrapcheckConfig{ - IgnoreSigs: DefaultIgnoreSigs, - IgnoreSigRegexps: []string{}, - IgnorePackageGlobs: []string{}, - IgnoreInterfaceRegexps: []string{}, - } -} - -func NewAnalyzer(cfg WrapcheckConfig) *analysis.Analyzer { - return &analysis.Analyzer{ - Name: "wrapcheck", - Doc: "Checks that errors returned from external packages are wrapped", - Run: run(cfg), - } -} - -func run(cfg WrapcheckConfig) func(*analysis.Pass) (interface{}, error) { - // Precompile the regexps, report the error - var ( - ignoreSigRegexp []*regexp.Regexp - ignoreInterfaceRegexps []*regexp.Regexp - ignorePackageGlobs []glob.Glob - err error - ) - - ignoreSigRegexp, err = compileRegexps(cfg.IgnoreSigRegexps) - if err == nil { - ignoreInterfaceRegexps, err = compileRegexps(cfg.IgnoreInterfaceRegexps) - } - if err == nil { - ignorePackageGlobs, err = compileGlobs(cfg.IgnorePackageGlobs) - } - - return func(pass *analysis.Pass) (interface{}, error) { - if err != nil { - return nil, err - } - - for _, file := range pass.Files { - ast.Inspect(file, func(n ast.Node) bool { - ret, ok := n.(*ast.ReturnStmt) - if !ok { - return true - } - - if len(ret.Results) < 1 { - return true - } - - // Iterate over the values to be returned looking for errors - for _, expr := range ret.Results { - // Check if the return expression is a function call, if it is, we need - // to handle it by checking the return params of the function. - retFn, ok := expr.(*ast.CallExpr) - if ok { - // If the return type of the function is a single error. This will not - // match an error within multiple return values, for that, the below - // tuple check is required. - - if isError(pass.TypesInfo.TypeOf(expr)) { - reportUnwrapped(pass, retFn, retFn.Pos(), cfg, ignoreSigRegexp, ignoreInterfaceRegexps, ignorePackageGlobs) - return true - } - - // Check if one of the return values from the function is an error - tup, ok := pass.TypesInfo.TypeOf(expr).(*types.Tuple) - if !ok { - return true - } - - // Iterate over the return values of the function looking for error - // types - for i := 0; i < tup.Len(); i++ { - v := tup.At(i) - if v == nil { - return true - } - if isError(v.Type()) { - reportUnwrapped(pass, retFn, expr.Pos(), cfg, ignoreSigRegexp, ignoreInterfaceRegexps, ignorePackageGlobs) - return true - } - } - } - - if !isError(pass.TypesInfo.TypeOf(expr)) { - continue - } - - ident, ok := expr.(*ast.Ident) - if !ok { - return true - } - - var call *ast.CallExpr - - // Attempt to find the most recent short assign - if shortAss := prevErrAssign(pass, file, ident); shortAss != nil { - call, ok = shortAss.Rhs[0].(*ast.CallExpr) - if !ok { - return true - } - } else if isUnresolved(file, ident) { - // TODO Check if the identifier is unresolved, and try to resolve it in - // another file. - return true - } else { - // Check for ValueSpec nodes in order to locate a possible var - // declaration. - if ident.Obj == nil { - return true - } - - vSpec, ok := ident.Obj.Decl.(*ast.ValueSpec) - if !ok { - // We couldn't find a short or var assign for this error return. - // This is an error. Where did this identifier come from? Possibly a - // function param. - // - // TODO decide how to handle this case, whether to follow function - // param back, or assert wrapping at call site. - - return true - } - - if len(vSpec.Values) < 1 { - return true - } - - call, ok = vSpec.Values[0].(*ast.CallExpr) - if !ok { - return true - } - } - - // Make sure there is a call identified as producing the error being - // returned, otherwise just bail - if call == nil { - return true - } - - reportUnwrapped(pass, call, ident.NamePos, cfg, ignoreSigRegexp, ignoreInterfaceRegexps, ignorePackageGlobs) - } - - return true - }) - } - - return nil, nil - } -} - -// Report unwrapped takes a call expression and an identifier and reports -// if the call is unwrapped. -func reportUnwrapped( - pass *analysis.Pass, - call *ast.CallExpr, - tokenPos token.Pos, - cfg WrapcheckConfig, - regexpsSig []*regexp.Regexp, - regexpsInter []*regexp.Regexp, - pkgGlobs []glob.Glob, -) { - - sel, ok := call.Fun.(*ast.SelectorExpr) - if !ok { - return - } - - // Check for ignored signatures - fnSig := pass.TypesInfo.ObjectOf(sel.Sel).String() - if contains(cfg.IgnoreSigs, fnSig) { - return - } else if containsMatch(regexpsSig, fnSig) { - return - } - - // Check if the underlying type of the "x" in x.y.z is an interface, as - // errors returned from interface types should be wrapped, unless ignored - // as per `ignoreInterfaceRegexps` - if isInterface(pass, sel) { - pkgPath := pass.TypesInfo.ObjectOf(sel.Sel).Pkg().Path() - name := types.TypeString(pass.TypesInfo.TypeOf(sel.X), func(p *types.Package) string { return p.Name() }) - if !containsMatch(regexpsInter, name) && !containsMatchGlob(pkgGlobs, pkgPath) { - pass.Reportf(tokenPos, "error returned from interface method should be wrapped: sig: %s", fnSig) - return - } - } - - // Check whether the function being called comes from another package, - // as functions called across package boundaries which returns errors - // should be wrapped - if isFromOtherPkg(pass, sel, pkgGlobs) { - pass.Reportf(tokenPos, "error returned from external package is unwrapped: sig: %s", fnSig) - return - } -} - -// isInterface returns whether the function call is one defined on an interface. -func isInterface(pass *analysis.Pass, sel *ast.SelectorExpr) bool { - _, ok := pass.TypesInfo.TypeOf(sel.X).Underlying().(*types.Interface) - - return ok -} - -// isFromotherPkg returns whether the function is defined in the package -// currently under analysis or is considered external. It will ignore packages -// defined in config.IgnorePackageGlobs. -func isFromOtherPkg(pass *analysis.Pass, sel *ast.SelectorExpr, pkgGlobs []glob.Glob) bool { - // The package of the function that we are calling which returns the error - fn := pass.TypesInfo.ObjectOf(sel.Sel) - if containsMatchGlob(pkgGlobs, fn.Pkg().Path()) { - return false - } - - // If it's not a package name, then we should check the selector to make sure - // that it's an identifier from the same package - if pass.Pkg.Path() == fn.Pkg().Path() { - return false - } - - return true -} - -// prevErrAssign traverses the AST of a file looking for the most recent -// assignment to an error declaration which is specified by the returnIdent -// identifier. -// -// This only returns short form assignments and reassignments, e.g. `:=` and -// `=`. This does not include `var` statements. This function will return nil if -// the only declaration is a `var` (aka ValueSpec) declaration. -func prevErrAssign(pass *analysis.Pass, file *ast.File, returnIdent *ast.Ident) *ast.AssignStmt { - // A slice containing all the assignments which contain an identifier - // referring to the source declaration of the error. This is to catch - // cases where err is defined once, and then reassigned multiple times - // within the same block. In these cases, we should check the method of - // the most recent call. - var assigns []*ast.AssignStmt - - // Find all assignments which have the same declaration - ast.Inspect(file, func(n ast.Node) bool { - if ass, ok := n.(*ast.AssignStmt); ok { - for _, expr := range ass.Lhs { - if !isError(pass.TypesInfo.TypeOf(expr)) { - continue - } - - if assIdent, ok := expr.(*ast.Ident); ok { - if assIdent.Obj == nil || returnIdent.Obj == nil { - // If we can't find the Obj for one of the identifiers, just skip - // it. - return true - } else if assIdent.Obj.Decl == returnIdent.Obj.Decl { - assigns = append(assigns, ass) - } - } - } - } - - return true - }) - - // Iterate through the assignments, comparing the token positions to - // find the assignment that directly precedes the return position - var mostRecentAssign *ast.AssignStmt - - for _, ass := range assigns { - if ass.Pos() > returnIdent.Pos() { - break - } - - mostRecentAssign = ass - } - - return mostRecentAssign -} - -func contains(slice []string, el string) bool { - for _, s := range slice { - if strings.Contains(el, s) { - return true - } - } - - return false -} - -func containsMatch(regexps []*regexp.Regexp, el string) bool { - for _, re := range regexps { - if re.MatchString(el) { - return true - } - } - - return false -} - -func containsMatchGlob(globs []glob.Glob, el string) bool { - for _, g := range globs { - if g.Match(el) { - return true - } - } - - return false -} - -// isError returns whether or not the provided type interface is an error -func isError(typ types.Type) bool { - if typ == nil { - return false - } - - return typ.String() == "error" -} - -func isUnresolved(file *ast.File, ident *ast.Ident) bool { - for _, unresolvedIdent := range file.Unresolved { - if unresolvedIdent.Pos() == ident.Pos() { - return true - } - } - - return false -} - -// compileRegexps compiles a set of regular expressions returning them for use, -// or the first encountered error due to an invalid expression. -func compileRegexps(regexps []string) ([]*regexp.Regexp, error) { - compiledRegexps := make([]*regexp.Regexp, len(regexps)) - for idx, reg := range regexps { - re, err := regexp.Compile(reg) - if err != nil { - return nil, fmt.Errorf("unable to compile regexp %s: %v\n", reg, err) - } - - compiledRegexps[idx] = re - } - - return compiledRegexps, nil -} - -// compileGlobs compiles a set of globs, returning them for use, -// or the first encountered error due to an invalid expression. -func compileGlobs(globs []string) ([]glob.Glob, error) { - compiledGlobs := make([]glob.Glob, len(globs)) - for idx, globString := range globs { - glob, err := glob.Compile(globString) - if err != nil { - return nil, fmt.Errorf("unable to compile globs %s: %v\n", glob, err) - } - - compiledGlobs[idx] = glob - } - return compiledGlobs, nil -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/.editorconfig b/vendor/github.com/tommy-muehle/go-mnd/v2/.editorconfig deleted file mode 100644 index fe2c20fb0b..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false - -[*.json] -indent_size = 2 - -[*.{yaml,yml}] -indent_size = 2 - -[Makefile] -indent_style = tab diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/.gitattributes b/vendor/github.com/tommy-muehle/go-mnd/v2/.gitattributes deleted file mode 100644 index 005358190d..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -/.gitattributes export-ignore -/.gitignore export-ignore -/.editorconfig export-ignore -/.goreleaser.yml export-ignore -/.github/ export-ignore -/examples/ export-ignore -/testdata/ export-ignore -/tools/ export-ignore -/Makefile export-ignore diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/.gitignore b/vendor/github.com/tommy-muehle/go-mnd/v2/.gitignore deleted file mode 100644 index abc11b3303..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -build/ -dist/ -coverage.txt diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/.goreleaser.yml b/vendor/github.com/tommy-muehle/go-mnd/v2/.goreleaser.yml deleted file mode 100644 index 7516de0b95..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/.goreleaser.yml +++ /dev/null @@ -1,54 +0,0 @@ -env: - - GO_VERSION=1.16 - -before: - hooks: - - go mod download - -builds: - - main: ./cmd/mnd/main.go - binary: mnd - goos: - - windows - - darwin - - linux - goarch: - - amd64 - ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.buildTime={{.Date}}`. - -archives: - - format: tar.gz - format_overrides: - - goos: windows - format: zip - -brews: - - name: mnd - tap: - owner: tommy-muehle - name: homebrew-tap - folder: Formula - homepage: https://github.com/tommy-muehle/go-mnd - description: Magic number detector for Go - test: | - system "#{bin}/mnd --version" - install: | - bin.install "mnd" - -dockers: - - - goos: linux - goarch: amd64 - image_templates: - - "tommymuehle/go-mnd:latest" - - "tommymuehle/go-mnd:{{ .Tag }}" - build_flag_templates: - - "--build-arg=GO_VERSION={{.Env.GO_VERSION}}" - extra_files: - - checks - - cmd - - config - - analyzer.go - - entrypoint.sh - - go.mod - - go.sum diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/Dockerfile b/vendor/github.com/tommy-muehle/go-mnd/v2/Dockerfile deleted file mode 100644 index 25c8d5475b..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -ARG GO_VERSION=1.16 - -FROM golang:${GO_VERSION}-alpine AS builder -RUN apk add --update --no-cache make git curl gcc libc-dev -RUN mkdir -p /build -WORKDIR /build -COPY . /build/ -RUN go mod download -RUN go build -o go-mnd cmd/mnd/main.go - -FROM golang:${GO_VERSION}-alpine -RUN apk add --update --no-cache bash git gcc libc-dev -COPY --from=builder /build/go-mnd /bin/go-mnd -COPY entrypoint.sh /bin/entrypoint.sh -VOLUME /app -WORKDIR /app -ENTRYPOINT ["/bin/entrypoint.sh"] diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/LICENSE b/vendor/github.com/tommy-muehle/go-mnd/v2/LICENSE deleted file mode 100644 index 8825fad20c..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2019 Tommy Muehle - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/Makefile b/vendor/github.com/tommy-muehle/go-mnd/v2/Makefile deleted file mode 100644 index a21c1dcac4..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -GIT_TAG?= $(shell git describe --abbrev=0) - -GO_VERSION = 1.16 -BUILDFLAGS := '-w -s' - -IMAGE_REPO = "tommymuehle" -BIN = "go-mnd" - -clean: - rm -rf build dist coverage.txt - -test: - go test -race ./... - -test-coverage: - go test -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./checks,./config - -build: - go build -o build/$(BIN) cmd/mnd/main.go - -image: - @echo "Building the Docker image..." - docker build --rm -t $(IMAGE_REPO)/$(BIN):$(GIT_TAG) --build-arg GO_VERSION=$(GO_VERSION) . - docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):$(GIT_TAG) - docker tag $(IMAGE_REPO)/$(BIN):$(GIT_TAG) $(IMAGE_REPO)/$(BIN):latest - -image-push: image - @echo "Pushing the Docker image..." - docker push $(IMAGE_REPO)/$(BIN):$(GIT_TAG) - docker push $(IMAGE_REPO)/$(BIN):latest - -.PHONY: clean test test-coverage build image image-push diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/README.md b/vendor/github.com/tommy-muehle/go-mnd/v2/README.md deleted file mode 100644 index bca0815db7..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/README.md +++ /dev/null @@ -1,230 +0,0 @@ -# go-mnd - Magic number detector for Golang - - - -A vet analyzer to detect magic numbers. - -> **What is a magic number?** -> A magic number is a numeric literal that is not defined as a constant, but which may change, and therefore can be hard to update. It's considered a bad programming practice to use numbers directly in any source code without an explanation. It makes programs harder to read, understand, and maintain. - -## Project status - -![CI](https://github.com/tommy-muehle/go-mnd/workflows/CI/badge.svg) -[![Go Report Card](https://goreportcard.com/badge/github.com/tommy-muehle/go-mnd)](https://goreportcard.com/report/github.com/tommy-muehle/go-mnd) -[![codecov](https://codecov.io/gh/tommy-muehle/go-mnd/branch/master/graph/badge.svg)](https://codecov.io/gh/tommy-muehle/go-mnd) - -## Install - -### Local - -This analyzer requires Golang in version >= 1.12 because it's depends on the **go/analysis** API. - -``` -go get -u github.com/tommy-muehle/go-mnd/v2/cmd/mnd -``` - -### Github action - -You can run go-mnd as a GitHub action as follows: - -``` -name: Example workflow -on: - push: - branches: - - master - pull_request: - branches: - - master -jobs: - tests: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout Source - uses: actions/checkout@v2 - - name: Run go-mnd - uses: tommy-muehle/go-mnd@master - with: - args: ./... -``` - -### GitLab CI - -You can run go-mnd inside a GitLab CI pipeline as follows: - -``` -stages: - - lint - -go:lint:mnd: - stage: lint - needs: [] - image: golang:latest - before_script: - - go get -u github.com/tommy-muehle/go-mnd/v2/cmd/mnd - - go mod tidy - - go mod vendor - script: - - go vet -vettool $(which mnd) ./... -``` - -### Homebrew - -To install with [Homebrew](https://brew.sh/), run: - -``` -brew tap tommy-muehle/tap && brew install tommy-muehle/tap/mnd -``` - -### Docker - -To get the latest available Docker image: - -``` -docker pull tommymuehle/go-mnd -``` - -### Windows - -On Windows download the [latest release](https://github.com/tommy-muehle/go-mnd/releases). - -## Usage - -[![asciicast](https://asciinema.org/a/231021.svg)](https://asciinema.org/a/231021) - -``` -go vet -vettool $(which mnd) ./... -``` - -or directly - -``` -mnd ./... -``` - -or via Docker - -``` -docker run --rm -v "$PWD":/app -w /app tommymuehle/go-mnd:latest ./... -``` - -## Options - -The ```-checks``` option let's you define a comma separated list of checks. - -The ```-ignored-numbers``` option let's you define a comma separated list of numbers to ignore. -For example: `-ignored-numbers=1000,10_000,3.14159264` - -The ```-ignored-functions``` option let's you define a comma separated list of function name regexp patterns to exclude. -For example: `-ignored-functions=math.*,http.StatusText,make` - -The ```-ignored-files``` option let's you define a comma separated list of filename regexp patterns to exclude. -For example: `-ignored-files=magic_.*.go,.*_numbers.go` - -## Checks - -By default this detector analyses arguments, assigns, cases, conditions, operations and return statements. - -* argument - -``` -t := http.StatusText(200) -``` - -* assign - -``` -c := &http.Client{ - Timeout: 5 * time.Second, -} -``` - -* case - -``` -switch x { - case 3: -} -``` - -* condition - -``` -if x > 7 { -} -``` - -* operation - -``` -var x, y int -y = 10 * x -``` - -* return - -``` -return 3 -``` - -## Excludes - -By default the numbers 0 and 1 as well as test files are excluded! - -### Further known excludes - -The function "Date" in the "Time" package. - -``` -t := time.Date(2017, time.September, 26, 12, 13, 14, 0, time.UTC) -``` - -Additional custom excludes can be defined via option flag. - -## Development - -### Build - -You can build the binary with: - -``` -make -``` - -### Tests - -You can run all unit tests using: - -``` -make test -``` - -And with coverage report: - -``` -make test-coverage -``` - -### Docker image - -You can also build locally the docker image by using the command: - -``` -make image -``` - -## Stickers - -

    - Stickers image - Sticker image -

    - -Just drop me a message via Twitter DM or email if you want some go-mnd stickers -for you or your Gopher usergroup. - -## License - -The MIT License (MIT). Please see [LICENSE](LICENSE) for more information. diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/action.yml b/vendor/github.com/tommy-muehle/go-mnd/v2/action.yml deleted file mode 100644 index 3a1f8eb110..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/action.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: 'go-mnd' -description: 'Runs the Golang magic number detector' -author: '@tommy-muehle' - -inputs: - args: - description: 'Arguments for go-mnd' - required: true - default: '-h' - -runs: - using: 'docker' - image: 'Dockerfile' - args: - - ${{ inputs.args }} - -branding: - icon: 'check-circle' - color: 'blue' diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/analyzer.go b/vendor/github.com/tommy-muehle/go-mnd/v2/analyzer.go deleted file mode 100644 index bf658f42d5..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/analyzer.go +++ /dev/null @@ -1,118 +0,0 @@ -package magic_numbers - -import ( - "flag" - "go/ast" - "strings" - - "github.com/tommy-muehle/go-mnd/v2/checks" - "github.com/tommy-muehle/go-mnd/v2/config" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const Doc = `magic number detector` - -var Analyzer = &analysis.Analyzer{ - Name: "mnd", - Doc: Doc, - Run: run, - Flags: options(), - Requires: []*analysis.Analyzer{inspect.Analyzer}, - RunDespiteErrors: true, -} - -type Checker interface { - NodeFilter() []ast.Node - Check(n ast.Node) -} - -func options() flag.FlagSet { - options := flag.NewFlagSet("", flag.ExitOnError) - options.String("excludes", "", "deprecated: use ignored-files instead") - options.String("ignored-files", "", "comma separated list of file patterns to exclude from analysis") - options.String("ignored-functions", "", "comma separated list of function patterns to exclude from analysis") - options.String("ignored-numbers", "", "comma separated list of numbers to exclude from analysis") - options.String( - "checks", - checks.ArgumentCheck+","+ - checks.CaseCheck+","+ - checks.ConditionCheck+","+ - checks.OperationCheck+","+ - checks.ReturnCheck+","+ - checks.AssignCheck, - "comma separated list of checks", - ) - - return *options -} - -func run(pass *analysis.Pass) (interface{}, error) { - var ignoredFiles string - - ignoredFiles = strings.Join( - []string{ - pass.Analyzer.Flags.Lookup("excludes").Value.String(), // is deprecated - pass.Analyzer.Flags.Lookup("ignored-files").Value.String(), - }, - ",", - ) - - if ignoredFiles == "," { - ignoredFiles = "" - } - - conf := config.WithOptions( - config.WithCustomChecks(pass.Analyzer.Flags.Lookup("checks").Value.String()), - config.WithIgnoredFiles(ignoredFiles), - config.WithIgnoredFunctions(pass.Analyzer.Flags.Lookup("ignored-functions").Value.String()), - config.WithIgnoredNumbers(pass.Analyzer.Flags.Lookup("ignored-numbers").Value.String()), - ) - - var checker []Checker - if conf.IsCheckEnabled(checks.ArgumentCheck) { - checker = append(checker, checks.NewArgumentAnalyzer(pass, conf)) - } - - if conf.IsCheckEnabled(checks.CaseCheck) { - checker = append(checker, checks.NewCaseAnalyzer(pass, conf)) - } - - if conf.IsCheckEnabled(checks.ConditionCheck) { - checker = append(checker, checks.NewConditionAnalyzer(pass, conf)) - } - - if conf.IsCheckEnabled(checks.OperationCheck) { - checker = append(checker, checks.NewOperationAnalyzer(pass, conf)) - } - - if conf.IsCheckEnabled(checks.ReturnCheck) { - checker = append(checker, checks.NewReturnAnalyzer(pass, conf)) - } - - if conf.IsCheckEnabled(checks.AssignCheck) { - checker = append(checker, checks.NewAssignAnalyzer(pass, conf)) - } - - i := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - for _, c := range checker { - c := c - i.Preorder(c.NodeFilter(), func(node ast.Node) { - for _, exclude := range conf.IgnoredFiles { - if exclude.String() == "" { - continue - } - if exclude.MatchString(pass.Fset.Position(node.Pos()).Filename) { - return - } - } - - c.Check(node) - }) - } - - return nil, nil -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/argument.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/argument.go deleted file mode 100644 index 5d880f0f96..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/argument.go +++ /dev/null @@ -1,125 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - "strconv" - "sync" - - "golang.org/x/tools/go/analysis" - - "github.com/tommy-muehle/go-mnd/v2/config" -) - -const ArgumentCheck = "argument" - -// constantDefinitions is used to save lines (by number) which contain a constant definition. -var constantDefinitions = map[string]bool{} -var mu sync.RWMutex - -type ArgumentAnalyzer struct { - config *config.Config - pass *analysis.Pass -} - -func NewArgumentAnalyzer(pass *analysis.Pass, config *config.Config) *ArgumentAnalyzer { - return &ArgumentAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *ArgumentAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.GenDecl)(nil), - (*ast.CallExpr)(nil), - } -} - -func (a *ArgumentAnalyzer) Check(n ast.Node) { - switch expr := n.(type) { - case *ast.CallExpr: - a.checkCallExpr(expr) - case *ast.GenDecl: - if expr.Tok != token.CONST { - return - } - - for _, x := range expr.Specs { - pos := a.pass.Fset.Position(x.Pos()) - - mu.Lock() - constantDefinitions[pos.Filename+":"+strconv.Itoa(pos.Line)] = true - mu.Unlock() - } - } -} - -func (a *ArgumentAnalyzer) checkCallExpr(expr *ast.CallExpr) { - pos := a.pass.Fset.Position(expr.Pos()) - - mu.RLock() - ok := constantDefinitions[pos.Filename+":"+strconv.Itoa(pos.Line)] - mu.RUnlock() - - if ok { - return - } - - switch f := expr.Fun.(type) { - case *ast.SelectorExpr: - switch prefix := f.X.(type) { - case *ast.Ident: - if a.config.IsIgnoredFunction(prefix.Name + "." + f.Sel.Name) { - return - } - } - case *ast.Ident: - if a.config.IsIgnoredFunction(f.Name) { - return - } - } - - for i, arg := range expr.Args { - switch x := arg.(type) { - case *ast.BasicLit: - if !a.isMagicNumber(x) { - continue - } - // If it's a magic number and has no previous element, report it - if i == 0 { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ArgumentCheck) - } else { - // Otherwise check all args - switch expr.Args[i].(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ArgumentCheck) - } - } - } - case *ast.BinaryExpr: - a.checkBinaryExpr(x) - } - } -} - -func (a *ArgumentAnalyzer) checkBinaryExpr(expr *ast.BinaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ArgumentCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, ArgumentCheck) - } - } -} - -func (a *ArgumentAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/assign.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/assign.go deleted file mode 100644 index f930d08805..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/assign.go +++ /dev/null @@ -1,86 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - config "github.com/tommy-muehle/go-mnd/v2/config" -) - -const AssignCheck = "assign" - -type AssignAnalyzer struct { - pass *analysis.Pass - config *config.Config -} - -func NewAssignAnalyzer(pass *analysis.Pass, config *config.Config) *AssignAnalyzer { - return &AssignAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *AssignAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.KeyValueExpr)(nil), - (*ast.AssignStmt)(nil), - } -} - -func (a *AssignAnalyzer) Check(n ast.Node) { - switch expr := n.(type) { - case *ast.KeyValueExpr: - switch x := expr.Value.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, AssignCheck) - } - case *ast.BinaryExpr: - a.checkBinaryExpr(x) - } - case *ast.AssignStmt: - for _, e := range expr.Rhs { - switch y := e.(type) { - case *ast.UnaryExpr: - a.checkUnaryExpr(y) - case *ast.BinaryExpr: - switch x := y.Y.(type) { - case *ast.UnaryExpr: - a.checkUnaryExpr(x) - } - } - } - } -} - -func (a *AssignAnalyzer) checkUnaryExpr(expr *ast.UnaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, AssignCheck) - } - } -} - -func (a *AssignAnalyzer) checkBinaryExpr(expr *ast.BinaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, AssignCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, AssignCheck) - } - } -} - -func (a *AssignAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/case.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/case.go deleted file mode 100644 index 228cab4b8e..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/case.go +++ /dev/null @@ -1,68 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - config "github.com/tommy-muehle/go-mnd/v2/config" -) - -const CaseCheck = "case" - -type CaseAnalyzer struct { - pass *analysis.Pass - config *config.Config -} - -func NewCaseAnalyzer(pass *analysis.Pass, config *config.Config) *CaseAnalyzer { - return &CaseAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *CaseAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.CaseClause)(nil), - } -} - -func (a *CaseAnalyzer) Check(n ast.Node) { - caseClause, ok := n.(*ast.CaseClause) - if !ok { - return - } - - for _, c := range caseClause.List { - switch x := c.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, CaseCheck) - } - case *ast.BinaryExpr: - a.checkBinaryExpr(x) - } - } -} - -func (a *CaseAnalyzer) checkBinaryExpr(expr *ast.BinaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, CaseCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, CaseCheck) - } - } -} - -func (a *CaseAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/checks.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/checks.go deleted file mode 100644 index deff0c7bf0..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/checks.go +++ /dev/null @@ -1,3 +0,0 @@ -package checks - -const reportMsg = "Magic number: %v, in <%s> detected" diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/condition.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/condition.go deleted file mode 100644 index 20f892ede4..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/condition.go +++ /dev/null @@ -1,55 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - config "github.com/tommy-muehle/go-mnd/v2/config" -) - -const ConditionCheck = "condition" - -type ConditionAnalyzer struct { - pass *analysis.Pass - config *config.Config -} - -func NewConditionAnalyzer(pass *analysis.Pass, config *config.Config) *ConditionAnalyzer { - return &ConditionAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *ConditionAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.IfStmt)(nil), - } -} - -func (a *ConditionAnalyzer) Check(n ast.Node) { - expr, ok := n.(*ast.IfStmt).Cond.(*ast.BinaryExpr) - if !ok { - return - } - - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ConditionCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, ConditionCheck) - } - } -} - -func (a *ConditionAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/operation.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/operation.go deleted file mode 100644 index ddf3a03631..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/operation.go +++ /dev/null @@ -1,77 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - config "github.com/tommy-muehle/go-mnd/v2/config" -) - -const OperationCheck = "operation" - -type OperationAnalyzer struct { - pass *analysis.Pass - config *config.Config -} - -func NewOperationAnalyzer(pass *analysis.Pass, config *config.Config) *OperationAnalyzer { - return &OperationAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *OperationAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.AssignStmt)(nil), - (*ast.ParenExpr)(nil), - } -} - -func (a *OperationAnalyzer) Check(n ast.Node) { - switch expr := n.(type) { - case *ast.ParenExpr: - switch x := expr.X.(type) { - case *ast.BinaryExpr: - a.checkBinaryExpr(x) - } - case *ast.AssignStmt: - for _, y := range expr.Rhs { - switch x := y.(type) { - case *ast.BinaryExpr: - switch xExpr := x.X.(type) { - case *ast.BinaryExpr: - a.checkBinaryExpr(xExpr) - } - switch yExpr := x.Y.(type) { - case *ast.BinaryExpr: - a.checkBinaryExpr(yExpr) - } - - a.checkBinaryExpr(x) - } - } - } -} - -func (a *OperationAnalyzer) checkBinaryExpr(expr *ast.BinaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, OperationCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, OperationCheck) - } - } -} - -func (a *OperationAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/return.go b/vendor/github.com/tommy-muehle/go-mnd/v2/checks/return.go deleted file mode 100644 index bc53940c7d..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/checks/return.go +++ /dev/null @@ -1,68 +0,0 @@ -package checks - -import ( - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - - config "github.com/tommy-muehle/go-mnd/v2/config" -) - -const ReturnCheck = "return" - -type ReturnAnalyzer struct { - pass *analysis.Pass - config *config.Config -} - -func NewReturnAnalyzer(pass *analysis.Pass, config *config.Config) *ReturnAnalyzer { - return &ReturnAnalyzer{ - pass: pass, - config: config, - } -} - -func (a *ReturnAnalyzer) NodeFilter() []ast.Node { - return []ast.Node{ - (*ast.ReturnStmt)(nil), - } -} - -func (a *ReturnAnalyzer) Check(n ast.Node) { - stmt, ok := n.(*ast.ReturnStmt) - if !ok { - return - } - - for _, expr := range stmt.Results { - switch x := expr.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ReturnCheck) - } - case *ast.BinaryExpr: - a.checkBinaryExpr(x) - } - } -} - -func (a *ReturnAnalyzer) checkBinaryExpr(expr *ast.BinaryExpr) { - switch x := expr.X.(type) { - case *ast.BasicLit: - if a.isMagicNumber(x) { - a.pass.Reportf(x.Pos(), reportMsg, x.Value, ReturnCheck) - } - } - - switch y := expr.Y.(type) { - case *ast.BasicLit: - if a.isMagicNumber(y) { - a.pass.Reportf(y.Pos(), reportMsg, y.Value, ReturnCheck) - } - } -} - -func (a *ReturnAnalyzer) isMagicNumber(l *ast.BasicLit) bool { - return (l.Kind == token.FLOAT || l.Kind == token.INT) && !a.config.IsIgnoredNumber(l.Value) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/config/config.go b/vendor/github.com/tommy-muehle/go-mnd/v2/config/config.go deleted file mode 100644 index b9fc91e5ec..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/config/config.go +++ /dev/null @@ -1,124 +0,0 @@ -package config - -import ( - "regexp" - "strings" -) - -type Config struct { - Checks map[string]bool - IgnoredNumbers map[string]struct{} - IgnoredFunctions []*regexp.Regexp - IgnoredFiles []*regexp.Regexp -} - -type Option func(config *Config) - -func DefaultConfig() *Config { - return &Config{ - Checks: map[string]bool{}, - IgnoredNumbers: map[string]struct{}{ - "0": {}, - "0.0": {}, - "1": {}, - "1.0": {}, - }, - IgnoredFiles: []*regexp.Regexp{ - regexp.MustCompile(`_test.go`), - }, - IgnoredFunctions: []*regexp.Regexp{ - regexp.MustCompile(`time.Date`), - regexp.MustCompile(`strconv.FormatInt`), - regexp.MustCompile(`strconv.FormatUint`), - regexp.MustCompile(`strconv.FormatFloat`), - regexp.MustCompile(`strconv.ParseInt`), - regexp.MustCompile(`strconv.ParseUint`), - regexp.MustCompile(`strconv.ParseFloat`), - }, - } -} - -func WithOptions(options ...Option) *Config { - c := DefaultConfig() - - for _, option := range options { - option(c) - } - - return c -} - -func WithIgnoredFunctions(excludes string) Option { - return func(config *Config) { - for _, exclude := range strings.Split(excludes, ",") { - if exclude == "" { - continue - } - config.IgnoredFunctions = append(config.IgnoredFunctions, regexp.MustCompile(exclude)) - } - } -} - -func WithIgnoredFiles(excludes string) Option { - return func(config *Config) { - for _, exclude := range strings.Split(excludes, ",") { - if exclude == "" { - continue - } - config.IgnoredFiles = append(config.IgnoredFiles, regexp.MustCompile(exclude)) - } - } -} - -func WithIgnoredNumbers(numbers string) Option { - return func(config *Config) { - for _, number := range strings.Split(numbers, ",") { - if number == "" { - continue - } - config.IgnoredNumbers[config.removeDigitSeparator(number)] = struct{}{} - } - } -} - -func WithCustomChecks(checks string) Option { - return func(config *Config) { - if checks == "" { - return - } - - for name, _ := range config.Checks { - config.Checks[name] = false - } - - for _, name := range strings.Split(checks, ",") { - if name == "" { - continue - } - config.Checks[name] = true - } - } -} - -func (c *Config) IsCheckEnabled(name string) bool { - return c.Checks[name] -} - -func (c *Config) IsIgnoredNumber(number string) bool { - _, ok := c.IgnoredNumbers[c.removeDigitSeparator(number)] - return ok -} - -func (c *Config) IsIgnoredFunction(f string) bool { - for _, pattern := range c.IgnoredFunctions { - if pattern.MatchString(f) { - return true - } - } - - return false -} - -func (c *Config) removeDigitSeparator(number string) string { - return strings.Replace(number, "_", "", -1) -} diff --git a/vendor/github.com/tommy-muehle/go-mnd/v2/entrypoint.sh b/vendor/github.com/tommy-muehle/go-mnd/v2/entrypoint.sh deleted file mode 100644 index cabc2f63db..0000000000 --- a/vendor/github.com/tommy-muehle/go-mnd/v2/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Expand the arguments into an array of strings. This is required because the GitHub action -# provides all arguments concatenated as a single string. -ARGS=("$@") - -/bin/go-mnd "${ARGS[*]}" diff --git a/vendor/github.com/toqueteos/webbrowser/.travis.yml b/vendor/github.com/toqueteos/webbrowser/.travis.yml deleted file mode 100644 index b55b114ab9..0000000000 --- a/vendor/github.com/toqueteos/webbrowser/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - 1.2 - - 1.12 - - tip - -script: - - go build ./... diff --git a/vendor/github.com/toqueteos/webbrowser/CONTRIBUTING.md b/vendor/github.com/toqueteos/webbrowser/CONTRIBUTING.md deleted file mode 100644 index b9f7bf82a2..0000000000 --- a/vendor/github.com/toqueteos/webbrowser/CONTRIBUTING.md +++ /dev/null @@ -1,11 +0,0 @@ -# webbrowser contributing guide - -Any changes are welcomed! - -1. Be nice. -2. Don't be afraid to ask, but please try search first. - -## Looking for contact info? - -- Twitter: [@toqueteos](https://twitter.com/toqueteos) -- Mail: `toqueteos AT gmail DOT com` diff --git a/vendor/github.com/toqueteos/webbrowser/LICENSE.md b/vendor/github.com/toqueteos/webbrowser/LICENSE.md deleted file mode 100644 index 0d67949ef3..0000000000 --- a/vendor/github.com/toqueteos/webbrowser/LICENSE.md +++ /dev/null @@ -1,19 +0,0 @@ -The MIT License (MIT) -Copyright (c) 2013-19 by Carlos Cobo and contributors. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/toqueteos/webbrowser/README.md b/vendor/github.com/toqueteos/webbrowser/README.md deleted file mode 100644 index 2ce091afb6..0000000000 --- a/vendor/github.com/toqueteos/webbrowser/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# webbrowser [![Build Status](https://travis-ci.org/toqueteos/webbrowser.png?branch=master)](https://travis-ci.org/toqueteos/webbrowser) [![GoDoc](http://godoc.org/github.com/toqueteos/webbrowser?status.png)](http://godoc.org/github.com/toqueteos/webbrowser) [![Sourcegraph](https://sourcegraph.com/github.com/toqueteos/webbrowser/-/badge.svg)](https://sourcegraph.com/github.com/toqueteos/webbrowser?badge) - -webbrowser provides a simple API for opening web pages on your default browser. - -It's inspired on [Python's webbrowser](http://docs.python.org/3/library/webbrowser.html) package but lacks some of its features (open new window). - -It just opens a webpage, most browsers will open it on a new tab. - -## Installation - -As simple as: - -```bash -go get -u github.com/toqueteos/webbrowser -``` - -## Usage - -```go -package main - -import "github.com/toqueteos/webbrowser" - -func main() { - webbrowser.Open("http://golang.org") -} -``` - -That's it! - -## Crossplatform support - -The package works on: - -- [x] `android` (verified by 3rd party) -- [x] `darwin` -- [x] `freebsd` (verified by 3rd party) -- [x] `linux` -- [x] `netbsd` (verified by 3rd party) -- [x] `openbsd` (verified by 3rd party) -- [x] `windows` - -## License - -It is licensed under the MIT open source license, please see the [LICENSE.md](https://github.com/toqueteos/webbrowser/blob/master/LICENSE.md) file for more information. - -## Thanks... - -Miki Tebeka wrote a nicer version that wasn't on godoc.org when I did this, [check it out!](https://bitbucket.org/tebeka/go-wise/src/d8db9bf5c4d1/desktop.go?at=default). - -## Already disliking it? - -No problem! There's alternative libraries that may be better to your needs: - -- https://github.com/pkg/browser, it does what webbrowser does and more! -- https://github.com/skratchdot/open-golang, it even provides a `xdg-open` implementation in case you don't have it! diff --git a/vendor/github.com/toqueteos/webbrowser/webbrowser.go b/vendor/github.com/toqueteos/webbrowser/webbrowser.go deleted file mode 100644 index f4f19b6b3d..0000000000 --- a/vendor/github.com/toqueteos/webbrowser/webbrowser.go +++ /dev/null @@ -1,137 +0,0 @@ -// Package webbrowser provides a simple API for opening web pages on your -// default browser. -package webbrowser - -import ( - "errors" - "fmt" - "net/url" - "os" - "os/exec" - "runtime" - "strings" -) - -var ( - ErrCantOpenBrowser = errors.New("webbrowser: can't open browser") - ErrNoCandidates = errors.New("webbrowser: no browser candidate found for your OS") -) - -// Candidates contains a list of registered `Browser`s that will be tried with Open. -var Candidates []Browser - -type Browser interface { - // Command returns a ready to be used Cmd that will open an URL. - Command(string) (*exec.Cmd, error) - // Open tries to open a URL in your default browser. NOTE: This may cause - // your program to hang until the browser process is closed in some OSes, - // see https://github.com/toqueteos/webbrowser/issues/4. - Open(string) error -} - -// Open tries to open a URL in your default browser ensuring you have a display -// set up and not running this from SSH. NOTE: This may cause your program to -// hang until the browser process is closed in some OSes, see -// https://github.com/toqueteos/webbrowser/issues/4. -func Open(s string) (err error) { - if len(Candidates) == 0 { - return ErrNoCandidates - } - - // Try to determine if there's a display available (only linux) and we - // aren't on a terminal (all but windows). - switch runtime.GOOS { - case "linux": - // No display, no need to open a browser. Lynx users **MAY** have - // something to say about this. - if os.Getenv("DISPLAY") == "" { - return fmt.Errorf("webbrowser: tried to open %q, no screen found", s) - } - fallthrough - case "darwin": - // Check SSH env vars. - if os.Getenv("SSH_CLIENT") != "" || os.Getenv("SSH_TTY") != "" { - return fmt.Errorf("webbrowser: tried to open %q, but you are running a shell session", s) - } - } - - // Try all candidates - for _, candidate := range Candidates { - err := candidate.Open(s) - if err == nil { - return nil - } - } - - return ErrCantOpenBrowser -} - -func init() { - // Register the default Browser for current OS, if it exists. - if os, ok := osCommand[runtime.GOOS]; ok { - Candidates = append(Candidates, browserCommand{os.cmd, os.args}) - } -} - -var ( - osCommand = map[string]*browserCommand{ - "android": &browserCommand{"xdg-open", nil}, - "darwin": &browserCommand{"open", nil}, - "freebsd": &browserCommand{"xdg-open", nil}, - "linux": &browserCommand{"xdg-open", nil}, - "netbsd": &browserCommand{"xdg-open", nil}, - "openbsd": &browserCommand{"xdg-open", nil}, // It may be open instead - "windows": &browserCommand{"cmd", []string{"/c", "start"}}, - } - winSchemes = [3]string{"https", "http", "file"} -) - -type browserCommand struct { - cmd string - args []string -} - -func (b browserCommand) Command(s string) (*exec.Cmd, error) { - u, err := url.Parse(s) - if err != nil { - return nil, err - } - - validUrl := ensureValidURL(u) - - b.args = append(b.args, validUrl) - - return exec.Command(b.cmd, b.args...), nil -} - -func (b browserCommand) Open(s string) error { - cmd, err := b.Command(s) - if err != nil { - return err - } - - return cmd.Run() -} - -func ensureScheme(u *url.URL) { - for _, s := range winSchemes { - if u.Scheme == s { - return - } - } - u.Scheme = "http" -} - -func ensureValidURL(u *url.URL) string { - // Enforce a scheme (windows requires scheme to be set to work properly). - ensureScheme(u) - s := u.String() - - // Escape characters not allowed by cmd/bash - switch runtime.GOOS { - case "windows": - s = strings.Replace(s, "&", `^&`, -1) - } - - return s -} diff --git a/vendor/github.com/ulikunitz/xz/.gitignore b/vendor/github.com/ulikunitz/xz/.gitignore deleted file mode 100644 index eb3d5f5173..0000000000 --- a/vendor/github.com/ulikunitz/xz/.gitignore +++ /dev/null @@ -1,28 +0,0 @@ -# .gitignore - -TODO.html -README.html - -lzma/writer.txt -lzma/reader.txt - -cmd/gxz/gxz -cmd/xb/xb - -# test executables -*.test - -# profile files -*.out - -# vim swap file -.*.swp - -# executables on windows -*.exe - -# default compression test file -enwik8* - -# file generated by example -example.xz \ No newline at end of file diff --git a/vendor/github.com/ulikunitz/xz/LICENSE b/vendor/github.com/ulikunitz/xz/LICENSE deleted file mode 100644 index 8a7f0877d3..0000000000 --- a/vendor/github.com/ulikunitz/xz/LICENSE +++ /dev/null @@ -1,26 +0,0 @@ -Copyright (c) 2014-2022 Ulrich Kunitz -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* My name, Ulrich Kunitz, may not be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/ulikunitz/xz/README.md b/vendor/github.com/ulikunitz/xz/README.md deleted file mode 100644 index 5547185213..0000000000 --- a/vendor/github.com/ulikunitz/xz/README.md +++ /dev/null @@ -1,77 +0,0 @@ -# Package xz - -This Go language package supports the reading and writing of xz -compressed streams. It includes also a gxz command for compressing and -decompressing data. The package is completely written in Go and doesn't -have any dependency on any C code. - -The package is currently under development. There might be bugs and APIs -are not considered stable. At this time the package cannot compete with -the xz tool regarding compression speed and size. The algorithms there -have been developed over a long time and are highly optimized. However -there are a number of improvements planned and I'm very optimistic about -parallel compression and decompression. Stay tuned! - -## Using the API - -The following example program shows how to use the API. - -```go -package main - -import ( - "bytes" - "io" - "log" - "os" - - "github.com/ulikunitz/xz" -) - -func main() { - const text = "The quick brown fox jumps over the lazy dog.\n" - var buf bytes.Buffer - // compress text - w, err := xz.NewWriter(&buf) - if err != nil { - log.Fatalf("xz.NewWriter error %s", err) - } - if _, err := io.WriteString(w, text); err != nil { - log.Fatalf("WriteString error %s", err) - } - if err := w.Close(); err != nil { - log.Fatalf("w.Close error %s", err) - } - // decompress buffer and write output to stdout - r, err := xz.NewReader(&buf) - if err != nil { - log.Fatalf("NewReader error %s", err) - } - if _, err = io.Copy(os.Stdout, r); err != nil { - log.Fatalf("io.Copy error %s", err) - } -} -``` - -## Documentation - -You can find the full documentation at [pkg.go.dev](https://pkg.go.dev/github.com/ulikunitz/xz). - -## Using the gxz compression tool - -The package includes a gxz command line utility for compression and -decompression. - -Use following command for installation: - - $ go get github.com/ulikunitz/xz/cmd/gxz - -To test it call the following command. - - $ gxz bigfile - -After some time a much smaller file bigfile.xz will replace bigfile. -To decompress it use the following command. - - $ gxz -d bigfile.xz - diff --git a/vendor/github.com/ulikunitz/xz/SECURITY.md b/vendor/github.com/ulikunitz/xz/SECURITY.md deleted file mode 100644 index 5f7ec01b3b..0000000000 --- a/vendor/github.com/ulikunitz/xz/SECURITY.md +++ /dev/null @@ -1,10 +0,0 @@ -# Security Policy - -## Supported Versions - -Currently the last minor version v0.5.x is supported. - -## Reporting a Vulnerability - -Report a vulnerability by creating a Github issue at -. Expect a response in a week. diff --git a/vendor/github.com/ulikunitz/xz/TODO.md b/vendor/github.com/ulikunitz/xz/TODO.md deleted file mode 100644 index a3d6f19250..0000000000 --- a/vendor/github.com/ulikunitz/xz/TODO.md +++ /dev/null @@ -1,372 +0,0 @@ -# TODO list - -## Release v0.5.x - -1. Support check flag in gxz command. - -## Release v0.6 - -1. Review encoder and check for lzma improvements under xz. -2. Fix binary tree matcher. -3. Compare compression ratio with xz tool using comparable parameters and optimize parameters -4. rename operation action and make it a simple type of size 8 -5. make maxMatches, wordSize parameters -6. stop searching after a certain length is found (parameter sweetLen) - -## Release v0.7 - -1. Optimize code -2. Do statistical analysis to get linear presets. -3. Test sync.Pool compatability for xz and lzma Writer and Reader -4. Fuzz optimized code. - -## Release v0.8 - -1. Support parallel go routines for writing and reading xz files. -2. Support a ReaderAt interface for xz files with small block sizes. -3. Improve compatibility between gxz and xz -4. Provide manual page for gxz - -## Release v0.9 - -1. Improve documentation -2. Fuzz again - -## Release v1.0 - -1. Full functioning gxz -2. Add godoc URL to README.md (godoc.org) -3. Resolve all issues. -4. Define release candidates. -5. Public announcement. - -## Package lzma - -### v0.6 - -* Rewrite Encoder into a simple greedy one-op-at-a-time encoder including - * simple scan at the dictionary head for the same byte - * use the killer byte (requiring matches to get longer, the first test should be the byte that would make the match longer) - -## Optimizations - -* There may be a lot of false sharing in lzma. State; check whether this can be improved by reorganizing the internal structure of it. - -* Check whether batching encoding and decoding improves speed. - -### DAG optimizations - -* Use full buffer to create minimal bit-length above range encoder. -* Might be too slow (see v0.4) - -### Different match finders - -* hashes with 2, 3 characters additional to 4 characters -* binary trees with 2-7 characters (uint64 as key, use uint32 as - - pointers into a an array) - -* rb-trees with 2-7 characters (uint64 as key, use uint32 as pointers - - into an array with bit-steeling for the colors) - -## Release Procedure - -* execute goch -l for all packages; probably with lower param like 0.5. -* check orthography with gospell -* Write release notes in doc/relnotes. -* Update README.md -* xb copyright . in xz directory to ensure all new files have Copyright header -* `VERSION= go generate github.com/ulikunitz/xz/...` to update version files -* Execute test for Linux/amd64, Linux/x86 and Windows/amd64. -* Update TODO.md - write short log entry -* `git checkout master && git merge dev` -* `git tag -a ` -* `git push` - -## Log - -### 2022-12-12 - -Matt Dantay (@bodgit) reported an issue with the LZMA reader. The implementation -returned an error if the dictionary size was less than 4096 byte, but the -recommendation stated the actual used window size should be set to 4096 byte in -that case. It actually was the pull request -[#52](https://github.com/ulikunitz/xz/pull/52). The new patch v0.5.11 will fix -it. - -### 2021-02-02 - -Mituo Heijo has fuzzed xz and found a bug in the function readIndexBody. The -function allocated a slice of records immediately after reading the value -without further checks. Sincex the number has been too large the make function -did panic. The fix is to check the number against the expected number of records -before allocating the records. - -### 2020-12-17 - -Release v0.5.9 fixes warnings, a typo and adds SECURITY.md. - -One fix is interesting. - -```go -const ( - a byte = 0x1 - b = 0x2 -) -``` - -The constants a and b don't have the same type. Correct is - -```go -const ( - a byte = 0x1 - b byte = 0x2 -) -``` - -### 2020-08-19 - -Release v0.5.8 fixes issue -[issue #35](https://github.com/ulikunitz/xz/issues/35). - -### 2020-02-24 - -Release v0.5.7 supports the check-ID None and fixes -[issue #27](https://github.com/ulikunitz/xz/issues/27). - -### 2019-02-20 - -Release v0.5.6 supports the go.mod file. - -### 2018-10-28 - -Release v0.5.5 fixes issues #19 observing ErrLimit outputs. - -### 2017-06-05 - -Release v0.5.4 fixes issues #15 of another problem with the padding size -check for the xz block header. I removed the check completely. - -### 2017-02-15 - -Release v0.5.3 fixes issue #12 regarding the decompression of an empty -XZ stream. Many thanks to Tomasz Kłak, who reported the issue. - -### 2016-12-02 - -Release v0.5.2 became necessary to allow the decoding of xz files with -4-byte padding in the block header. Many thanks to Greg, who reported -the issue. - -### 2016-07-23 - -Release v0.5.1 became necessary to fix problems with 32-bit platforms. -Many thanks to Bruno Brigas, who reported the issue. - -### 2016-07-04 - -Release v0.5 provides improvements to the compressor and provides support for -the decompression of xz files with multiple xz streams. - -### 2016-01-31 - -Another compression rate increase by checking the byte at length of the -best match first, before checking the whole prefix. This makes the -compressor even faster. We have now a large time budget to beat the -compression ratio of the xz tool. For enwik8 we have now over 40 seconds -to reduce the compressed file size for another 7 MiB. - -### 2016-01-30 - -I simplified the encoder. Speed and compression rate increased -dramatically. A high compression rate affects also the decompression -speed. The approach with the buffer and optimizing for operation -compression rate has not been successful. Going for the maximum length -appears to be the best approach. - -### 2016-01-28 - -The release v0.4 is ready. It provides a working xz implementation, -which is rather slow, but works and is interoperable with the xz tool. -It is an important milestone. - -### 2016-01-10 - -I have the first working implementation of an xz reader and writer. I'm -happy about reaching this milestone. - -### 2015-12-02 - -I'm now ready to implement xz because, I have a working LZMA2 -implementation. I decided today that v0.4 will use the slow encoder -using the operations buffer to be able to go back, if I intend to do so. - -### 2015-10-21 - -I have restarted the work on the library. While trying to implement -LZMA2, I discovered that I need to resimplify the encoder and decoder -functions. The option approach is too complicated. Using a limited byte -writer and not caring for written bytes at all and not to try to handle -uncompressed data simplifies the LZMA encoder and decoder much. -Processing uncompressed data and handling limits is a feature of the -LZMA2 format not of LZMA. - -I learned an interesting method from the LZO format. If the last copy is -too far away they are moving the head one 2 bytes and not 1 byte to -reduce processing times. - -### 2015-08-26 - -I have now reimplemented the lzma package. The code is reasonably fast, -but can still be optimized. The next step is to implement LZMA2 and then -xz. - -### 2015-07-05 - -Created release v0.3. The version is the foundation for a full xz -implementation that is the target of v0.4. - -### 2015-06-11 - -The gflag package has been developed because I couldn't use flag and -pflag for a fully compatible support of gzip's and lzma's options. It -seems to work now quite nicely. - -### 2015-06-05 - -The overflow issue was interesting to research, however Henry S. Warren -Jr. Hacker's Delight book was very helpful as usual and had the issue -explained perfectly. Fefe's information on his website was based on the -C FAQ and quite bad, because it didn't address the issue of -MININT == -MININT. - -### 2015-06-04 - -It has been a productive day. I improved the interface of lzma. Reader -and lzma. Writer and fixed the error handling. - -### 2015-06-01 - -By computing the bit length of the LZMA operations I was able to -improve the greedy algorithm implementation. By using an 8 MByte buffer -the compression rate was not as good as for xz but already better then -gzip default. - -Compression is currently slow, but this is something we will be able to -improve over time. - -### 2015-05-26 - -Checked the license of ogier/pflag. The binary lzmago binary should -include the license terms for the pflag library. - -I added the endorsement clause as used by Google for the Go sources the -LICENSE file. - -### 2015-05-22 - -The package lzb contains now the basic implementation for creating or -reading LZMA byte streams. It allows the support for the implementation -of the DAG-shortest-path algorithm for the compression function. - -### 2015-04-23 - -Completed yesterday the lzbase classes. I'm a little bit concerned that -using the components may require too much code, but on the other hand -there is a lot of flexibility. - -### 2015-04-22 - -Implemented Reader and Writer during the Bayern game against Porto. The -second half gave me enough time. - -### 2015-04-21 - -While showering today morning I discovered that the design for OpEncoder -and OpDecoder doesn't work, because encoding/decoding might depend on -the current status of the dictionary. This is not exactly the right way -to start the day. - -Therefore we need to keep the Reader and Writer design. This time around -we simplify it by ignoring size limits. These can be added by wrappers -around the Reader and Writer interfaces. The Parameters type isn't -needed anymore. - -However I will implement a ReaderState and WriterState type to use -static typing to ensure the right State object is combined with the -right lzbase. Reader and lzbase. Writer. - -As a start I have implemented ReaderState and WriterState to ensure -that the state for reading is only used by readers and WriterState only -used by Writers. - -### 2015-04-20 - -Today I implemented the OpDecoder and tested OpEncoder and OpDecoder. - -### 2015-04-08 - -Came up with a new simplified design for lzbase. I implemented already -the type State that replaces OpCodec. - -### 2015-04-06 - -The new lzma package is now fully usable and lzmago is using it now. The -old lzma package has been completely removed. - -### 2015-04-05 - -Implemented lzma. Reader and tested it. - -### 2015-04-04 - -Implemented baseReader by adapting code form lzma. Reader. - -### 2015-04-03 - -The opCodec has been copied yesterday to lzma2. opCodec has a high -number of dependencies on other files in lzma2. Therefore I had to copy -almost all files from lzma. - -### 2015-03-31 - -Removed only a TODO item. - -However in Francesco Campoy's presentation "Go for Javaneros -(Javaïstes?)" is the the idea that using an embedded field E, all the -methods of E will be defined on T. If E is an interface T satisfies E. - - - -I have never used this, but it seems to be a cool idea. - -### 2015-03-30 - -Finished the type writerDict and wrote a simple test. - -### 2015-03-25 - -I started to implement the writerDict. - -### 2015-03-24 - -After thinking long about the LZMA2 code and several false starts, I -have now a plan to create a self-sufficient lzma2 package that supports -the classic LZMA format as well as LZMA2. The core idea is to support a -baseReader and baseWriter type that support the basic LZMA stream -without any headers. Both types must support the reuse of dictionaries -and the opCodec. - -### 2015-01-10 - -1. Implemented simple lzmago tool -2. Tested tool against large 4.4G file - * compression worked correctly; tested decompression with lzma - * decompression hits a full buffer condition -3. Fixed a bug in the compressor and wrote a test for it -4. Executed full cycle for 4.4 GB file; performance can be improved ;-) - -### 2015-01-11 - -* Release v0.2 because of the working LZMA encoder and decoder diff --git a/vendor/github.com/ulikunitz/xz/bits.go b/vendor/github.com/ulikunitz/xz/bits.go deleted file mode 100644 index b30f1ec97d..0000000000 --- a/vendor/github.com/ulikunitz/xz/bits.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "io" -) - -// putUint32LE puts the little-endian representation of x into the first -// four bytes of p. -func putUint32LE(p []byte, x uint32) { - p[0] = byte(x) - p[1] = byte(x >> 8) - p[2] = byte(x >> 16) - p[3] = byte(x >> 24) -} - -// putUint64LE puts the little-endian representation of x into the first -// eight bytes of p. -func putUint64LE(p []byte, x uint64) { - p[0] = byte(x) - p[1] = byte(x >> 8) - p[2] = byte(x >> 16) - p[3] = byte(x >> 24) - p[4] = byte(x >> 32) - p[5] = byte(x >> 40) - p[6] = byte(x >> 48) - p[7] = byte(x >> 56) -} - -// uint32LE converts a little endian representation to an uint32 value. -func uint32LE(p []byte) uint32 { - return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | - uint32(p[3])<<24 -} - -// putUvarint puts a uvarint representation of x into the byte slice. -func putUvarint(p []byte, x uint64) int { - i := 0 - for x >= 0x80 { - p[i] = byte(x) | 0x80 - x >>= 7 - i++ - } - p[i] = byte(x) - return i + 1 -} - -// errOverflow indicates an overflow of the 64-bit unsigned integer. -var errOverflowU64 = errors.New("xz: uvarint overflows 64-bit unsigned integer") - -// readUvarint reads a uvarint from the given byte reader. -func readUvarint(r io.ByteReader) (x uint64, n int, err error) { - const maxUvarintLen = 10 - - var s uint - i := 0 - for { - b, err := r.ReadByte() - if err != nil { - return x, i, err - } - i++ - if i > maxUvarintLen { - return x, i, errOverflowU64 - } - if b < 0x80 { - if i == maxUvarintLen && b > 1 { - return x, i, errOverflowU64 - } - return x | uint64(b)< 0 { - k = 4 - k - } - return k -} - -/*** Header ***/ - -// headerMagic stores the magic bytes for the header -var headerMagic = []byte{0xfd, '7', 'z', 'X', 'Z', 0x00} - -// HeaderLen provides the length of the xz file header. -const HeaderLen = 12 - -// Constants for the checksum methods supported by xz. -const ( - None byte = 0x0 - CRC32 byte = 0x1 - CRC64 byte = 0x4 - SHA256 byte = 0xa -) - -// errInvalidFlags indicates that flags are invalid. -var errInvalidFlags = errors.New("xz: invalid flags") - -// verifyFlags returns the error errInvalidFlags if the value is -// invalid. -func verifyFlags(flags byte) error { - switch flags { - case None, CRC32, CRC64, SHA256: - return nil - default: - return errInvalidFlags - } -} - -// flagstrings maps flag values to strings. -var flagstrings = map[byte]string{ - None: "None", - CRC32: "CRC-32", - CRC64: "CRC-64", - SHA256: "SHA-256", -} - -// flagString returns the string representation for the given flags. -func flagString(flags byte) string { - s, ok := flagstrings[flags] - if !ok { - return "invalid" - } - return s -} - -// newHashFunc returns a function that creates hash instances for the -// hash method encoded in flags. -func newHashFunc(flags byte) (newHash func() hash.Hash, err error) { - switch flags { - case None: - newHash = newNoneHash - case CRC32: - newHash = newCRC32 - case CRC64: - newHash = newCRC64 - case SHA256: - newHash = sha256.New - default: - err = errInvalidFlags - } - return -} - -// header provides the actual content of the xz file header: the flags. -type header struct { - flags byte -} - -// Errors returned by readHeader. -var errHeaderMagic = errors.New("xz: invalid header magic bytes") - -// ValidHeader checks whether data is a correct xz file header. The -// length of data must be HeaderLen. -func ValidHeader(data []byte) bool { - var h header - err := h.UnmarshalBinary(data) - return err == nil -} - -// String returns a string representation of the flags. -func (h header) String() string { - return flagString(h.flags) -} - -// UnmarshalBinary reads header from the provided data slice. -func (h *header) UnmarshalBinary(data []byte) error { - // header length - if len(data) != HeaderLen { - return errors.New("xz: wrong file header length") - } - - // magic header - if !bytes.Equal(headerMagic, data[:6]) { - return errHeaderMagic - } - - // checksum - crc := crc32.NewIEEE() - crc.Write(data[6:8]) - if uint32LE(data[8:]) != crc.Sum32() { - return errors.New("xz: invalid checksum for file header") - } - - // stream flags - if data[6] != 0 { - return errInvalidFlags - } - flags := data[7] - if err := verifyFlags(flags); err != nil { - return err - } - - h.flags = flags - return nil -} - -// MarshalBinary generates the xz file header. -func (h *header) MarshalBinary() (data []byte, err error) { - if err = verifyFlags(h.flags); err != nil { - return nil, err - } - - data = make([]byte, 12) - copy(data, headerMagic) - data[7] = h.flags - - crc := crc32.NewIEEE() - crc.Write(data[6:8]) - putUint32LE(data[8:], crc.Sum32()) - - return data, nil -} - -/*** Footer ***/ - -// footerLen defines the length of the footer. -const footerLen = 12 - -// footerMagic contains the footer magic bytes. -var footerMagic = []byte{'Y', 'Z'} - -// footer represents the content of the xz file footer. -type footer struct { - indexSize int64 - flags byte -} - -// String prints a string representation of the footer structure. -func (f footer) String() string { - return fmt.Sprintf("%s index size %d", flagString(f.flags), f.indexSize) -} - -// Minimum and maximum for the size of the index (backward size). -const ( - minIndexSize = 4 - maxIndexSize = (1 << 32) * 4 -) - -// MarshalBinary converts footer values into an xz file footer. Note -// that the footer value is checked for correctness. -func (f *footer) MarshalBinary() (data []byte, err error) { - if err = verifyFlags(f.flags); err != nil { - return nil, err - } - if !(minIndexSize <= f.indexSize && f.indexSize <= maxIndexSize) { - return nil, errors.New("xz: index size out of range") - } - if f.indexSize%4 != 0 { - return nil, errors.New( - "xz: index size not aligned to four bytes") - } - - data = make([]byte, footerLen) - - // backward size (index size) - s := (f.indexSize / 4) - 1 - putUint32LE(data[4:], uint32(s)) - // flags - data[9] = f.flags - // footer magic - copy(data[10:], footerMagic) - - // CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[4:10]) - putUint32LE(data, crc.Sum32()) - - return data, nil -} - -// UnmarshalBinary sets the footer value by unmarshalling an xz file -// footer. -func (f *footer) UnmarshalBinary(data []byte) error { - if len(data) != footerLen { - return errors.New("xz: wrong footer length") - } - - // magic bytes - if !bytes.Equal(data[10:], footerMagic) { - return errors.New("xz: footer magic invalid") - } - - // CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[4:10]) - if uint32LE(data) != crc.Sum32() { - return errors.New("xz: footer checksum error") - } - - var g footer - // backward size (index size) - g.indexSize = (int64(uint32LE(data[4:])) + 1) * 4 - - // flags - if data[8] != 0 { - return errInvalidFlags - } - g.flags = data[9] - if err := verifyFlags(g.flags); err != nil { - return err - } - - *f = g - return nil -} - -/*** Block Header ***/ - -// blockHeader represents the content of an xz block header. -type blockHeader struct { - compressedSize int64 - uncompressedSize int64 - filters []filter -} - -// String converts the block header into a string. -func (h blockHeader) String() string { - var buf bytes.Buffer - first := true - if h.compressedSize >= 0 { - fmt.Fprintf(&buf, "compressed size %d", h.compressedSize) - first = false - } - if h.uncompressedSize >= 0 { - if !first { - buf.WriteString(" ") - } - fmt.Fprintf(&buf, "uncompressed size %d", h.uncompressedSize) - first = false - } - for _, f := range h.filters { - if !first { - buf.WriteString(" ") - } - fmt.Fprintf(&buf, "filter %s", f) - first = false - } - return buf.String() -} - -// Masks for the block flags. -const ( - filterCountMask = 0x03 - compressedSizePresent = 0x40 - uncompressedSizePresent = 0x80 - reservedBlockFlags = 0x3C -) - -// errIndexIndicator signals that an index indicator (0x00) has been found -// instead of an expected block header indicator. -var errIndexIndicator = errors.New("xz: found index indicator") - -// readBlockHeader reads the block header. -func readBlockHeader(r io.Reader) (h *blockHeader, n int, err error) { - var buf bytes.Buffer - buf.Grow(20) - - // block header size - z, err := io.CopyN(&buf, r, 1) - n = int(z) - if err != nil { - return nil, n, err - } - s := buf.Bytes()[0] - if s == 0 { - return nil, n, errIndexIndicator - } - - // read complete header - headerLen := (int(s) + 1) * 4 - buf.Grow(headerLen - 1) - z, err = io.CopyN(&buf, r, int64(headerLen-1)) - n += int(z) - if err != nil { - return nil, n, err - } - - // unmarshal block header - h = new(blockHeader) - if err = h.UnmarshalBinary(buf.Bytes()); err != nil { - return nil, n, err - } - - return h, n, nil -} - -// readSizeInBlockHeader reads the uncompressed or compressed size -// fields in the block header. The present value informs the function -// whether the respective field is actually present in the header. -func readSizeInBlockHeader(r io.ByteReader, present bool) (n int64, err error) { - if !present { - return -1, nil - } - x, _, err := readUvarint(r) - if err != nil { - return 0, err - } - if x >= 1<<63 { - return 0, errors.New("xz: size overflow in block header") - } - return int64(x), nil -} - -// UnmarshalBinary unmarshals the block header. -func (h *blockHeader) UnmarshalBinary(data []byte) error { - // Check header length - s := data[0] - if data[0] == 0 { - return errIndexIndicator - } - headerLen := (int(s) + 1) * 4 - if len(data) != headerLen { - return fmt.Errorf("xz: data length %d; want %d", len(data), - headerLen) - } - n := headerLen - 4 - - // Check CRC-32 - crc := crc32.NewIEEE() - crc.Write(data[:n]) - if crc.Sum32() != uint32LE(data[n:]) { - return errors.New("xz: checksum error for block header") - } - - // Block header flags - flags := data[1] - if flags&reservedBlockFlags != 0 { - return errors.New("xz: reserved block header flags set") - } - - r := bytes.NewReader(data[2:n]) - - // Compressed size - var err error - h.compressedSize, err = readSizeInBlockHeader( - r, flags&compressedSizePresent != 0) - if err != nil { - return err - } - - // Uncompressed size - h.uncompressedSize, err = readSizeInBlockHeader( - r, flags&uncompressedSizePresent != 0) - if err != nil { - return err - } - - h.filters, err = readFilters(r, int(flags&filterCountMask)+1) - if err != nil { - return err - } - - // Check padding - // Since headerLen is a multiple of 4 we don't need to check - // alignment. - k := r.Len() - // The standard spec says that the padding should have not more - // than 3 bytes. However we found paddings of 4 or 5 in the - // wild. See https://github.com/ulikunitz/xz/pull/11 and - // https://github.com/ulikunitz/xz/issues/15 - // - // The only reasonable approach seems to be to ignore the - // padding size. We still check that all padding bytes are zero. - if !allZeros(data[n-k : n]) { - return errPadding - } - return nil -} - -// MarshalBinary marshals the binary header. -func (h *blockHeader) MarshalBinary() (data []byte, err error) { - if !(minFilters <= len(h.filters) && len(h.filters) <= maxFilters) { - return nil, errors.New("xz: filter count wrong") - } - for i, f := range h.filters { - if i < len(h.filters)-1 { - if f.id() == lzmaFilterID { - return nil, errors.New( - "xz: LZMA2 filter is not the last") - } - } else { - // last filter - if f.id() != lzmaFilterID { - return nil, errors.New("xz: " + - "last filter must be the LZMA2 filter") - } - } - } - - var buf bytes.Buffer - // header size must set at the end - buf.WriteByte(0) - - // flags - flags := byte(len(h.filters) - 1) - if h.compressedSize >= 0 { - flags |= compressedSizePresent - } - if h.uncompressedSize >= 0 { - flags |= uncompressedSizePresent - } - buf.WriteByte(flags) - - p := make([]byte, 10) - if h.compressedSize >= 0 { - k := putUvarint(p, uint64(h.compressedSize)) - buf.Write(p[:k]) - } - if h.uncompressedSize >= 0 { - k := putUvarint(p, uint64(h.uncompressedSize)) - buf.Write(p[:k]) - } - - for _, f := range h.filters { - fp, err := f.MarshalBinary() - if err != nil { - return nil, err - } - buf.Write(fp) - } - - // padding - for i := padLen(int64(buf.Len())); i > 0; i-- { - buf.WriteByte(0) - } - - // crc place holder - buf.Write(p[:4]) - - data = buf.Bytes() - if len(data)%4 != 0 { - panic("data length not aligned") - } - s := len(data)/4 - 1 - if !(1 < s && s <= 255) { - panic("wrong block header size") - } - data[0] = byte(s) - - crc := crc32.NewIEEE() - crc.Write(data[:len(data)-4]) - putUint32LE(data[len(data)-4:], crc.Sum32()) - - return data, nil -} - -// Constants used for marshalling and unmarshalling filters in the xz -// block header. -const ( - minFilters = 1 - maxFilters = 4 - minReservedID = 1 << 62 -) - -// filter represents a filter in the block header. -type filter interface { - id() uint64 - UnmarshalBinary(data []byte) error - MarshalBinary() (data []byte, err error) - reader(r io.Reader, c *ReaderConfig) (fr io.Reader, err error) - writeCloser(w io.WriteCloser, c *WriterConfig) (fw io.WriteCloser, err error) - // filter must be last filter - last() bool -} - -// readFilter reads a block filter from the block header. At this point -// in time only the LZMA2 filter is supported. -func readFilter(r io.Reader) (f filter, err error) { - br := lzma.ByteReader(r) - - // index - id, _, err := readUvarint(br) - if err != nil { - return nil, err - } - - var data []byte - switch id { - case lzmaFilterID: - data = make([]byte, lzmaFilterLen) - data[0] = lzmaFilterID - if _, err = io.ReadFull(r, data[1:]); err != nil { - return nil, err - } - f = new(lzmaFilter) - default: - if id >= minReservedID { - return nil, errors.New( - "xz: reserved filter id in block stream header") - } - return nil, errors.New("xz: invalid filter id") - } - if err = f.UnmarshalBinary(data); err != nil { - return nil, err - } - return f, err -} - -// readFilters reads count filters. At this point in time only the count -// 1 is supported. -func readFilters(r io.Reader, count int) (filters []filter, err error) { - if count != 1 { - return nil, errors.New("xz: unsupported filter count") - } - f, err := readFilter(r) - if err != nil { - return nil, err - } - return []filter{f}, err -} - -/*** Index ***/ - -// record describes a block in the xz file index. -type record struct { - unpaddedSize int64 - uncompressedSize int64 -} - -// readRecord reads an index record. -func readRecord(r io.ByteReader) (rec record, n int, err error) { - u, k, err := readUvarint(r) - n += k - if err != nil { - return rec, n, err - } - rec.unpaddedSize = int64(u) - if rec.unpaddedSize < 0 { - return rec, n, errors.New("xz: unpadded size negative") - } - - u, k, err = readUvarint(r) - n += k - if err != nil { - return rec, n, err - } - rec.uncompressedSize = int64(u) - if rec.uncompressedSize < 0 { - return rec, n, errors.New("xz: uncompressed size negative") - } - - return rec, n, nil -} - -// MarshalBinary converts an index record in its binary encoding. -func (rec *record) MarshalBinary() (data []byte, err error) { - // maximum length of a uvarint is 10 - p := make([]byte, 20) - n := putUvarint(p, uint64(rec.unpaddedSize)) - n += putUvarint(p[n:], uint64(rec.uncompressedSize)) - return p[:n], nil -} - -// writeIndex writes the index, a sequence of records. -func writeIndex(w io.Writer, index []record) (n int64, err error) { - crc := crc32.NewIEEE() - mw := io.MultiWriter(w, crc) - - // index indicator - k, err := mw.Write([]byte{0}) - n += int64(k) - if err != nil { - return n, err - } - - // number of records - p := make([]byte, 10) - k = putUvarint(p, uint64(len(index))) - k, err = mw.Write(p[:k]) - n += int64(k) - if err != nil { - return n, err - } - - // list of records - for _, rec := range index { - p, err := rec.MarshalBinary() - if err != nil { - return n, err - } - k, err = mw.Write(p) - n += int64(k) - if err != nil { - return n, err - } - } - - // index padding - k, err = mw.Write(make([]byte, padLen(int64(n)))) - n += int64(k) - if err != nil { - return n, err - } - - // crc32 checksum - putUint32LE(p, crc.Sum32()) - k, err = w.Write(p[:4]) - n += int64(k) - - return n, err -} - -// readIndexBody reads the index from the reader. It assumes that the -// index indicator has already been read. -func readIndexBody(r io.Reader, expectedRecordLen int) (records []record, n int64, err error) { - crc := crc32.NewIEEE() - // index indicator - crc.Write([]byte{0}) - - br := lzma.ByteReader(io.TeeReader(r, crc)) - - // number of records - u, k, err := readUvarint(br) - n += int64(k) - if err != nil { - return nil, n, err - } - recLen := int(u) - if recLen < 0 || uint64(recLen) != u { - return nil, n, errors.New("xz: record number overflow") - } - if recLen != expectedRecordLen { - return nil, n, fmt.Errorf( - "xz: index length is %d; want %d", - recLen, expectedRecordLen) - } - - // list of records - records = make([]record, recLen) - for i := range records { - records[i], k, err = readRecord(br) - n += int64(k) - if err != nil { - return nil, n, err - } - } - - p := make([]byte, padLen(int64(n+1)), 4) - k, err = io.ReadFull(br.(io.Reader), p) - n += int64(k) - if err != nil { - return nil, n, err - } - if !allZeros(p) { - return nil, n, errors.New("xz: non-zero byte in index padding") - } - - // crc32 - s := crc.Sum32() - p = p[:4] - k, err = io.ReadFull(br.(io.Reader), p) - n += int64(k) - if err != nil { - return records, n, err - } - if uint32LE(p) != s { - return nil, n, errors.New("xz: wrong checksum for index") - } - - return records, n, nil -} diff --git a/vendor/github.com/ulikunitz/xz/fox-check-none.xz b/vendor/github.com/ulikunitz/xz/fox-check-none.xz deleted file mode 100644 index 46043f7dc89b610dc3badb9db3426620c4c97462..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 96 zcmexsUKJ6=z`*cd=%ynRgCe6CkX@qxbTK1?PDnLRM*R tL9s%9S!$6&2~avGv8qxbB|lw{3#g5Ofzej?!NQIFY(?{`7{LOOQ2>-O93KDx diff --git a/vendor/github.com/ulikunitz/xz/fox.xz b/vendor/github.com/ulikunitz/xz/fox.xz deleted file mode 100644 index 4b820bd5a16e83fe5db4fb315639a4337f862483..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 104 zcmexsUKJ6=z`*kC+7>q^21Q0O1_p)_{ill=8FWH2QWXkIGn2Cwl8W-n^AytZD-^Oy za|?dFO$zmVVdxt0+m!4eq- E0K@hlng9R* diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go b/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go deleted file mode 100644 index dae159db50..0000000000 --- a/vendor/github.com/ulikunitz/xz/internal/hash/cyclic_poly.go +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// CyclicPoly provides a cyclic polynomial rolling hash. -type CyclicPoly struct { - h uint64 - p []uint64 - i int -} - -// ror rotates the unsigned 64-bit integer to right. The argument s must be -// less than 64. -func ror(x uint64, s uint) uint64 { - return (x >> s) | (x << (64 - s)) -} - -// NewCyclicPoly creates a new instance of the CyclicPoly structure. The -// argument n gives the number of bytes for which a hash will be executed. -// This number must be positive; the method panics if this isn't the case. -func NewCyclicPoly(n int) *CyclicPoly { - if n < 1 { - panic("argument n must be positive") - } - return &CyclicPoly{p: make([]uint64, 0, n)} -} - -// Len returns the length of the byte sequence for which a hash is generated. -func (r *CyclicPoly) Len() int { - return cap(r.p) -} - -// RollByte hashes the next byte and returns a hash value. The complete becomes -// available after at least Len() bytes have been hashed. -func (r *CyclicPoly) RollByte(x byte) uint64 { - y := hash[x] - if len(r.p) < cap(r.p) { - r.h = ror(r.h, 1) ^ y - r.p = append(r.p, y) - } else { - r.h ^= ror(r.p[r.i], uint(cap(r.p)-1)) - r.h = ror(r.h, 1) ^ y - r.p[r.i] = y - r.i = (r.i + 1) % cap(r.p) - } - return r.h -} - -// Stores the hash for the individual bytes. -var hash = [256]uint64{ - 0x2e4fc3f904065142, 0xc790984cfbc99527, - 0x879f95eb8c62f187, 0x3b61be86b5021ef2, - 0x65a896a04196f0a5, 0xc5b307b80470b59e, - 0xd3bff376a70df14b, 0xc332f04f0b3f1701, - 0x753b5f0e9abf3e0d, 0xb41538fdfe66ef53, - 0x1906a10c2c1c0208, 0xfb0c712a03421c0d, - 0x38be311a65c9552b, 0xfee7ee4ca6445c7e, - 0x71aadeded184f21e, 0xd73426fccda23b2d, - 0x29773fb5fb9600b5, 0xce410261cd32981a, - 0xfe2848b3c62dbc2d, 0x459eaaff6e43e11c, - 0xc13e35fc9c73a887, 0xf30ed5c201e76dbc, - 0xa5f10b3910482cea, 0x2945d59be02dfaad, - 0x06ee334ff70571b5, 0xbabf9d8070f44380, - 0xee3e2e9912ffd27c, 0x2a7118d1ea6b8ea7, - 0x26183cb9f7b1664c, 0xea71dac7da068f21, - 0xea92eca5bd1d0bb7, 0x415595862defcd75, - 0x248a386023c60648, 0x9cf021ab284b3c8a, - 0xfc9372df02870f6c, 0x2b92d693eeb3b3fc, - 0x73e799d139dc6975, 0x7b15ae312486363c, - 0xb70e5454a2239c80, 0x208e3fb31d3b2263, - 0x01f563cabb930f44, 0x2ac4533d2a3240d8, - 0x84231ed1064f6f7c, 0xa9f020977c2a6d19, - 0x213c227271c20122, 0x09fe8a9a0a03d07a, - 0x4236dc75bcaf910c, 0x460a8b2bead8f17e, - 0xd9b27be1aa07055f, 0xd202d5dc4b11c33e, - 0x70adb010543bea12, 0xcdae938f7ea6f579, - 0x3f3d870208672f4d, 0x8e6ccbce9d349536, - 0xe4c0871a389095ae, 0xf5f2a49152bca080, - 0x9a43f9b97269934e, 0xc17b3753cb6f475c, - 0xd56d941e8e206bd4, 0xac0a4f3e525eda00, - 0xa06d5a011912a550, 0x5537ed19537ad1df, - 0xa32fe713d611449d, 0x2a1d05b47c3b579f, - 0x991d02dbd30a2a52, 0x39e91e7e28f93eb0, - 0x40d06adb3e92c9ac, 0x9b9d3afde1c77c97, - 0x9a3f3f41c02c616f, 0x22ecd4ba00f60c44, - 0x0b63d5d801708420, 0x8f227ca8f37ffaec, - 0x0256278670887c24, 0x107e14877dbf540b, - 0x32c19f2786ac1c05, 0x1df5b12bb4bc9c61, - 0xc0cac129d0d4c4e2, 0x9fdb52ee9800b001, - 0x31f601d5d31c48c4, 0x72ff3c0928bcaec7, - 0xd99264421147eb03, 0x535a2d6d38aefcfe, - 0x6ba8b4454a916237, 0xfa39366eaae4719c, - 0x10f00fd7bbb24b6f, 0x5bd23185c76c84d4, - 0xb22c3d7e1b00d33f, 0x3efc20aa6bc830a8, - 0xd61c2503fe639144, 0x30ce625441eb92d3, - 0xe5d34cf359e93100, 0xa8e5aa13f2b9f7a5, - 0x5c2b8d851ca254a6, 0x68fb6c5e8b0d5fdf, - 0xc7ea4872c96b83ae, 0x6dd5d376f4392382, - 0x1be88681aaa9792f, 0xfef465ee1b6c10d9, - 0x1f98b65ed43fcb2e, 0x4d1ca11eb6e9a9c9, - 0x7808e902b3857d0b, 0x171c9c4ea4607972, - 0x58d66274850146df, 0x42b311c10d3981d1, - 0x647fa8c621c41a4c, 0xf472771c66ddfedc, - 0x338d27e3f847b46b, 0x6402ce3da97545ce, - 0x5162db616fc38638, 0x9c83be97bc22a50e, - 0x2d3d7478a78d5e72, 0xe621a9b938fd5397, - 0x9454614eb0f81c45, 0x395fb6e742ed39b6, - 0x77dd9179d06037bf, 0xc478d0fee4d2656d, - 0x35d9d6cb772007af, 0x83a56e92c883f0f6, - 0x27937453250c00a1, 0x27bd6ebc3a46a97d, - 0x9f543bf784342d51, 0xd158f38c48b0ed52, - 0x8dd8537c045f66b4, 0x846a57230226f6d5, - 0x6b13939e0c4e7cdf, 0xfca25425d8176758, - 0x92e5fc6cd52788e6, 0x9992e13d7a739170, - 0x518246f7a199e8ea, 0xf104c2a71b9979c7, - 0x86b3ffaabea4768f, 0x6388061cf3e351ad, - 0x09d9b5295de5bbb5, 0x38bf1638c2599e92, - 0x1d759846499e148d, 0x4c0ff015e5f96ef4, - 0xa41a94cfa270f565, 0x42d76f9cb2326c0b, - 0x0cf385dd3c9c23ba, 0x0508a6c7508d6e7a, - 0x337523aabbe6cf8d, 0x646bb14001d42b12, - 0xc178729d138adc74, 0xf900ef4491f24086, - 0xee1a90d334bb5ac4, 0x9755c92247301a50, - 0xb999bf7c4ff1b610, 0x6aeeb2f3b21e8fc9, - 0x0fa8084cf91ac6ff, 0x10d226cf136e6189, - 0xd302057a07d4fb21, 0x5f03800e20a0fcc3, - 0x80118d4ae46bd210, 0x58ab61a522843733, - 0x51edd575c5432a4b, 0x94ee6ff67f9197f7, - 0x765669e0e5e8157b, 0xa5347830737132f0, - 0x3ba485a69f01510c, 0x0b247d7b957a01c3, - 0x1b3d63449fd807dc, 0x0fdc4721c30ad743, - 0x8b535ed3829b2b14, 0xee41d0cad65d232c, - 0xe6a99ed97a6a982f, 0x65ac6194c202003d, - 0x692accf3a70573eb, 0xcc3c02c3e200d5af, - 0x0d419e8b325914a3, 0x320f160f42c25e40, - 0x00710d647a51fe7a, 0x3c947692330aed60, - 0x9288aa280d355a7a, 0xa1806a9b791d1696, - 0x5d60e38496763da1, 0x6c69e22e613fd0f4, - 0x977fc2a5aadffb17, 0xfb7bd063fc5a94ba, - 0x460c17992cbaece1, 0xf7822c5444d3297f, - 0x344a9790c69b74aa, 0xb80a42e6cae09dce, - 0x1b1361eaf2b1e757, 0xd84c1e758e236f01, - 0x88e0b7be347627cc, 0x45246009b7a99490, - 0x8011c6dd3fe50472, 0xc341d682bffb99d7, - 0x2511be93808e2d15, 0xd5bc13d7fd739840, - 0x2a3cd030679ae1ec, 0x8ad9898a4b9ee157, - 0x3245fef0a8eaf521, 0x3d6d8dbbb427d2b0, - 0x1ed146d8968b3981, 0x0c6a28bf7d45f3fc, - 0x4a1fd3dbcee3c561, 0x4210ff6a476bf67e, - 0xa559cce0d9199aac, 0xde39d47ef3723380, - 0xe5b69d848ce42e35, 0xefa24296f8e79f52, - 0x70190b59db9a5afc, 0x26f166cdb211e7bf, - 0x4deaf2df3c6b8ef5, 0xf171dbdd670f1017, - 0xb9059b05e9420d90, 0x2f0da855c9388754, - 0x611d5e9ab77949cc, 0x2912038ac01163f4, - 0x0231df50402b2fba, 0x45660fc4f3245f58, - 0xb91cc97c7c8dac50, 0xb72d2aafe4953427, - 0xfa6463f87e813d6b, 0x4515f7ee95d5c6a2, - 0x1310e1c1a48d21c3, 0xad48a7810cdd8544, - 0x4d5bdfefd5c9e631, 0xa43ed43f1fdcb7de, - 0xe70cfc8fe1ee9626, 0xef4711b0d8dda442, - 0xb80dd9bd4dab6c93, 0xa23be08d31ba4d93, - 0x9b37db9d0335a39c, 0x494b6f870f5cfebc, - 0x6d1b3c1149dda943, 0x372c943a518c1093, - 0xad27af45e77c09c4, 0x3b6f92b646044604, - 0xac2917909f5fcf4f, 0x2069a60e977e5557, - 0x353a469e71014de5, 0x24be356281f55c15, - 0x2b6d710ba8e9adea, 0x404ad1751c749c29, - 0xed7311bf23d7f185, 0xba4f6976b4acc43e, - 0x32d7198d2bc39000, 0xee667019014d6e01, - 0x494ef3e128d14c83, 0x1f95a152baecd6be, - 0x201648dff1f483a5, 0x68c28550c8384af6, - 0x5fc834a6824a7f48, 0x7cd06cb7365eaf28, - 0xd82bbd95e9b30909, 0x234f0d1694c53f6d, - 0xd2fb7f4a96d83f4a, 0xff0d5da83acac05e, - 0xf8f6b97f5585080a, 0x74236084be57b95b, - 0xa25e40c03bbc36ad, 0x6b6e5c14ce88465b, - 0x4378ffe93e1528c5, 0x94ca92a17118e2d2, -} diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go b/vendor/github.com/ulikunitz/xz/internal/hash/doc.go deleted file mode 100644 index b4cf8b75e4..0000000000 --- a/vendor/github.com/ulikunitz/xz/internal/hash/doc.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package hash provides rolling hashes. - -Rolling hashes have to be used for maintaining the positions of n-byte -sequences in the dictionary buffer. - -The package provides currently the Rabin-Karp rolling hash and a Cyclic -Polynomial hash. Both support the Hashes method to be used with an interface. -*/ -package hash diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go b/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go deleted file mode 100644 index 5322342ee3..0000000000 --- a/vendor/github.com/ulikunitz/xz/internal/hash/rabin_karp.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// A is the default constant for Robin-Karp rolling hash. This is a random -// prime. -const A = 0x97b548add41d5da1 - -// RabinKarp supports the computation of a rolling hash. -type RabinKarp struct { - A uint64 - // a^n - aOldest uint64 - h uint64 - p []byte - i int -} - -// NewRabinKarp creates a new RabinKarp value. The argument n defines the -// length of the byte sequence to be hashed. The default constant will will be -// used. -func NewRabinKarp(n int) *RabinKarp { - return NewRabinKarpConst(n, A) -} - -// NewRabinKarpConst creates a new RabinKarp value. The argument n defines the -// length of the byte sequence to be hashed. The argument a provides the -// constant used to compute the hash. -func NewRabinKarpConst(n int, a uint64) *RabinKarp { - if n <= 0 { - panic("number of bytes n must be positive") - } - aOldest := uint64(1) - // There are faster methods. For the small n required by the LZMA - // compressor O(n) is sufficient. - for i := 0; i < n; i++ { - aOldest *= a - } - return &RabinKarp{ - A: a, aOldest: aOldest, - p: make([]byte, 0, n), - } -} - -// Len returns the length of the byte sequence. -func (r *RabinKarp) Len() int { - return cap(r.p) -} - -// RollByte computes the hash after x has been added. -func (r *RabinKarp) RollByte(x byte) uint64 { - if len(r.p) < cap(r.p) { - r.h += uint64(x) - r.h *= r.A - r.p = append(r.p, x) - } else { - r.h -= uint64(r.p[r.i]) * r.aOldest - r.h += uint64(x) - r.h *= r.A - r.p[r.i] = x - r.i = (r.i + 1) % cap(r.p) - } - return r.h -} diff --git a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go b/vendor/github.com/ulikunitz/xz/internal/hash/roller.go deleted file mode 100644 index a989833561..0000000000 --- a/vendor/github.com/ulikunitz/xz/internal/hash/roller.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package hash - -// Roller provides an interface for rolling hashes. The hash value will become -// valid after hash has been called Len times. -type Roller interface { - Len() int - RollByte(x byte) uint64 -} - -// Hashes computes all hash values for the array p. Note that the state of the -// roller is changed. -func Hashes(r Roller, p []byte) []uint64 { - n := r.Len() - if len(p) < n { - return nil - } - h := make([]uint64, len(p)-n+1) - for i := 0; i < n-1; i++ { - r.RollByte(p[i]) - } - for i := range h { - h[i] = r.RollByte(p[i+n-1]) - } - return h -} diff --git a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go b/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go deleted file mode 100644 index f4627ea113..0000000000 --- a/vendor/github.com/ulikunitz/xz/internal/xlog/xlog.go +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xlog provides a simple logging package that allows to disable -// certain message categories. It defines a type, Logger, with multiple -// methods for formatting output. The package has also a predefined -// 'standard' Logger accessible through helper function Print[f|ln], -// Fatal[f|ln], Panic[f|ln], Warn[f|ln], Print[f|ln] and Debug[f|ln] -// that are easier to use then creating a Logger manually. That logger -// writes to standard error and prints the date and time of each logged -// message, which can be configured using the function SetFlags. -// -// The Fatal functions call os.Exit(1) after the message is output -// unless not suppressed by the flags. The Panic functions call panic -// after the writing the log message unless suppressed. -package xlog - -import ( - "fmt" - "io" - "os" - "runtime" - "sync" - "time" -) - -// The flags define what information is prefixed to each log entry -// generated by the Logger. The Lno* versions allow the suppression of -// specific output. The bits are or'ed together to control what will be -// printed. There is no control over the order of the items printed and -// the format. The full format is: -// -// 2009-01-23 01:23:23.123123 /a/b/c/d.go:23: message -const ( - Ldate = 1 << iota // the date: 2009-01-23 - Ltime // the time: 01:23:23 - Lmicroseconds // microsecond resolution: 01:23:23.123123 - Llongfile // full file name and line number: /a/b/c/d.go:23 - Lshortfile // final file name element and line number: d.go:23 - Lnopanic // suppresses output from Panic[f|ln] but not the panic call - Lnofatal // suppresses output from Fatal[f|ln] but not the exit - Lnowarn // suppresses output from Warn[f|ln] - Lnoprint // suppresses output from Print[f|ln] - Lnodebug // suppresses output from Debug[f|ln] - // initial values for the standard logger - Lstdflags = Ldate | Ltime | Lnodebug -) - -// A Logger represents an active logging object that generates lines of -// output to an io.Writer. Each logging operation if not suppressed -// makes a single call to the Writer's Write method. A Logger can be -// used simultaneously from multiple goroutines; it guarantees to -// serialize access to the Writer. -type Logger struct { - mu sync.Mutex // ensures atomic writes; and protects the following - // fields - prefix string // prefix to write at beginning of each line - flag int // properties - out io.Writer // destination for output - buf []byte // for accumulating text to write -} - -// New creates a new Logger. The out argument sets the destination to -// which the log output will be written. The prefix appears at the -// beginning of each log line. The flag argument defines the logging -// properties. -func New(out io.Writer, prefix string, flag int) *Logger { - return &Logger{out: out, prefix: prefix, flag: flag} -} - -// std is the standard logger used by the package scope functions. -var std = New(os.Stderr, "", Lstdflags) - -// itoa converts the integer to ASCII. A negative widths will avoid -// zero-padding. The function supports only non-negative integers. -func itoa(buf *[]byte, i int, wid int) { - var u = uint(i) - if u == 0 && wid <= 1 { - *buf = append(*buf, '0') - return - } - var b [32]byte - bp := len(b) - for ; u > 0 || wid > 0; u /= 10 { - bp-- - wid-- - b[bp] = byte(u%10) + '0' - } - *buf = append(*buf, b[bp:]...) -} - -// formatHeader puts the header into the buf field of the buffer. -func (l *Logger) formatHeader(t time.Time, file string, line int) { - l.buf = append(l.buf, l.prefix...) - if l.flag&(Ldate|Ltime|Lmicroseconds) != 0 { - if l.flag&Ldate != 0 { - year, month, day := t.Date() - itoa(&l.buf, year, 4) - l.buf = append(l.buf, '-') - itoa(&l.buf, int(month), 2) - l.buf = append(l.buf, '-') - itoa(&l.buf, day, 2) - l.buf = append(l.buf, ' ') - } - if l.flag&(Ltime|Lmicroseconds) != 0 { - hour, min, sec := t.Clock() - itoa(&l.buf, hour, 2) - l.buf = append(l.buf, ':') - itoa(&l.buf, min, 2) - l.buf = append(l.buf, ':') - itoa(&l.buf, sec, 2) - if l.flag&Lmicroseconds != 0 { - l.buf = append(l.buf, '.') - itoa(&l.buf, t.Nanosecond()/1e3, 6) - } - l.buf = append(l.buf, ' ') - } - } - if l.flag&(Lshortfile|Llongfile) != 0 { - if l.flag&Lshortfile != 0 { - short := file - for i := len(file) - 1; i > 0; i-- { - if file[i] == '/' { - short = file[i+1:] - break - } - } - file = short - } - l.buf = append(l.buf, file...) - l.buf = append(l.buf, ':') - itoa(&l.buf, line, -1) - l.buf = append(l.buf, ": "...) - } -} - -func (l *Logger) output(calldepth int, now time.Time, s string) error { - var file string - var line int - if l.flag&(Lshortfile|Llongfile) != 0 { - l.mu.Unlock() - var ok bool - _, file, line, ok = runtime.Caller(calldepth) - if !ok { - file = "???" - line = 0 - } - l.mu.Lock() - } - l.buf = l.buf[:0] - l.formatHeader(now, file, line) - l.buf = append(l.buf, s...) - if len(s) == 0 || s[len(s)-1] != '\n' { - l.buf = append(l.buf, '\n') - } - _, err := l.out.Write(l.buf) - return err -} - -// Output writes the string s with the header controlled by the flags to -// the l.out writer. A newline will be appended if s doesn't end in a -// newline. Calldepth is used to recover the PC, although all current -// calls of Output use the call depth 2. Access to the function is serialized. -func (l *Logger) Output(calldepth, noflag int, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprint(v...) - return l.output(calldepth+1, now, s) -} - -// Outputf works like output but formats the output like Printf. -func (l *Logger) Outputf(calldepth int, noflag int, format string, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprintf(format, v...) - return l.output(calldepth+1, now, s) -} - -// Outputln works like output but formats the output like Println. -func (l *Logger) Outputln(calldepth int, noflag int, v ...interface{}) error { - now := time.Now() - l.mu.Lock() - defer l.mu.Unlock() - if l.flag&noflag != 0 { - return nil - } - s := fmt.Sprintln(v...) - return l.output(calldepth+1, now, s) -} - -// Panic prints the message like Print and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panic(v ...interface{}) { - l.Output(2, Lnopanic, v...) - s := fmt.Sprint(v...) - panic(s) -} - -// Panic prints the message like Print and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panic(v ...interface{}) { - std.Output(2, Lnopanic, v...) - s := fmt.Sprint(v...) - panic(s) -} - -// Panicf prints the message like Printf and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panicf(format string, v ...interface{}) { - l.Outputf(2, Lnopanic, format, v...) - s := fmt.Sprintf(format, v...) - panic(s) -} - -// Panicf prints the message like Printf and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panicf(format string, v ...interface{}) { - std.Outputf(2, Lnopanic, format, v...) - s := fmt.Sprintf(format, v...) - panic(s) -} - -// Panicln prints the message like Println and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func (l *Logger) Panicln(v ...interface{}) { - l.Outputln(2, Lnopanic, v...) - s := fmt.Sprintln(v...) - panic(s) -} - -// Panicln prints the message like Println and calls panic. The printing -// might be suppressed by the flag Lnopanic. -func Panicln(v ...interface{}) { - std.Outputln(2, Lnopanic, v...) - s := fmt.Sprintln(v...) - panic(s) -} - -// Fatal prints the message like Print and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatal(v ...interface{}) { - l.Output(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatal prints the message like Print and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatal(v ...interface{}) { - std.Output(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatalf prints the message like Printf and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatalf(format string, v ...interface{}) { - l.Outputf(2, Lnofatal, format, v...) - os.Exit(1) -} - -// Fatalf prints the message like Printf and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatalf(format string, v ...interface{}) { - std.Outputf(2, Lnofatal, format, v...) - os.Exit(1) -} - -// Fatalln prints the message like Println and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func (l *Logger) Fatalln(format string, v ...interface{}) { - l.Outputln(2, Lnofatal, v...) - os.Exit(1) -} - -// Fatalln prints the message like Println and calls os.Exit(1). The -// printing might be suppressed by the flag Lnofatal. -func Fatalln(format string, v ...interface{}) { - std.Outputln(2, Lnofatal, v...) - os.Exit(1) -} - -// Warn prints the message like Print. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warn(v ...interface{}) { - l.Output(2, Lnowarn, v...) -} - -// Warn prints the message like Print. The printing might be suppressed -// by the flag Lnowarn. -func Warn(v ...interface{}) { - std.Output(2, Lnowarn, v...) -} - -// Warnf prints the message like Printf. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warnf(format string, v ...interface{}) { - l.Outputf(2, Lnowarn, format, v...) -} - -// Warnf prints the message like Printf. The printing might be suppressed -// by the flag Lnowarn. -func Warnf(format string, v ...interface{}) { - std.Outputf(2, Lnowarn, format, v...) -} - -// Warnln prints the message like Println. The printing might be suppressed -// by the flag Lnowarn. -func (l *Logger) Warnln(v ...interface{}) { - l.Outputln(2, Lnowarn, v...) -} - -// Warnln prints the message like Println. The printing might be suppressed -// by the flag Lnowarn. -func Warnln(v ...interface{}) { - std.Outputln(2, Lnowarn, v...) -} - -// Print prints the message like fmt.Print. The printing might be suppressed -// by the flag Lnoprint. -func (l *Logger) Print(v ...interface{}) { - l.Output(2, Lnoprint, v...) -} - -// Print prints the message like fmt.Print. The printing might be suppressed -// by the flag Lnoprint. -func Print(v ...interface{}) { - std.Output(2, Lnoprint, v...) -} - -// Printf prints the message like fmt.Printf. The printing might be suppressed -// by the flag Lnoprint. -func (l *Logger) Printf(format string, v ...interface{}) { - l.Outputf(2, Lnoprint, format, v...) -} - -// Printf prints the message like fmt.Printf. The printing might be suppressed -// by the flag Lnoprint. -func Printf(format string, v ...interface{}) { - std.Outputf(2, Lnoprint, format, v...) -} - -// Println prints the message like fmt.Println. The printing might be -// suppressed by the flag Lnoprint. -func (l *Logger) Println(v ...interface{}) { - l.Outputln(2, Lnoprint, v...) -} - -// Println prints the message like fmt.Println. The printing might be -// suppressed by the flag Lnoprint. -func Println(v ...interface{}) { - std.Outputln(2, Lnoprint, v...) -} - -// Debug prints the message like Print. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debug(v ...interface{}) { - l.Output(2, Lnodebug, v...) -} - -// Debug prints the message like Print. The printing might be suppressed -// by the flag Lnodebug. -func Debug(v ...interface{}) { - std.Output(2, Lnodebug, v...) -} - -// Debugf prints the message like Printf. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debugf(format string, v ...interface{}) { - l.Outputf(2, Lnodebug, format, v...) -} - -// Debugf prints the message like Printf. The printing might be suppressed -// by the flag Lnodebug. -func Debugf(format string, v ...interface{}) { - std.Outputf(2, Lnodebug, format, v...) -} - -// Debugln prints the message like Println. The printing might be suppressed -// by the flag Lnodebug. -func (l *Logger) Debugln(v ...interface{}) { - l.Outputln(2, Lnodebug, v...) -} - -// Debugln prints the message like Println. The printing might be suppressed -// by the flag Lnodebug. -func Debugln(v ...interface{}) { - std.Outputln(2, Lnodebug, v...) -} - -// Flags returns the current flags used by the logger. -func (l *Logger) Flags() int { - l.mu.Lock() - defer l.mu.Unlock() - return l.flag -} - -// Flags returns the current flags used by the standard logger. -func Flags() int { - return std.Flags() -} - -// SetFlags sets the flags of the logger. -func (l *Logger) SetFlags(flag int) { - l.mu.Lock() - defer l.mu.Unlock() - l.flag = flag -} - -// SetFlags sets the flags for the standard logger. -func SetFlags(flag int) { - std.SetFlags(flag) -} - -// Prefix returns the prefix used by the logger. -func (l *Logger) Prefix() string { - l.mu.Lock() - defer l.mu.Unlock() - return l.prefix -} - -// Prefix returns the prefix used by the standard logger of the package. -func Prefix() string { - return std.Prefix() -} - -// SetPrefix sets the prefix for the logger. -func (l *Logger) SetPrefix(prefix string) { - l.mu.Lock() - defer l.mu.Unlock() - l.prefix = prefix -} - -// SetPrefix sets the prefix of the standard logger of the package. -func SetPrefix(prefix string) { - std.SetPrefix(prefix) -} - -// SetOutput sets the output of the logger. -func (l *Logger) SetOutput(w io.Writer) { - l.mu.Lock() - defer l.mu.Unlock() - l.out = w -} - -// SetOutput sets the output for the standard logger of the package. -func SetOutput(w io.Writer) { - std.SetOutput(w) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bintree.go b/vendor/github.com/ulikunitz/xz/lzma/bintree.go deleted file mode 100644 index 2b39da6f75..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/bintree.go +++ /dev/null @@ -1,522 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "unicode" -) - -// node represents a node in the binary tree. -type node struct { - // x is the search value - x uint32 - // p parent node - p uint32 - // l left child - l uint32 - // r right child - r uint32 -} - -// wordLen is the number of bytes represented by the v field of a node. -const wordLen = 4 - -// binTree supports the identification of the next operation based on a -// binary tree. -// -// Nodes will be identified by their index into the ring buffer. -type binTree struct { - dict *encoderDict - // ring buffer of nodes - node []node - // absolute offset of the entry for the next node. Position 4 - // byte larger. - hoff int64 - // front position in the node ring buffer - front uint32 - // index of the root node - root uint32 - // current x value - x uint32 - // preallocated array - data []byte -} - -// null represents the nonexistent index. We can't use zero because it -// would always exist or we would need to decrease the index for each -// reference. -const null uint32 = 1<<32 - 1 - -// newBinTree initializes the binTree structure. The capacity defines -// the size of the buffer and defines the maximum distance for which -// matches will be found. -func newBinTree(capacity int) (t *binTree, err error) { - if capacity < 1 { - return nil, errors.New( - "newBinTree: capacity must be larger than zero") - } - if int64(capacity) >= int64(null) { - return nil, errors.New( - "newBinTree: capacity must less 2^{32}-1") - } - t = &binTree{ - node: make([]node, capacity), - hoff: -int64(wordLen), - root: null, - data: make([]byte, maxMatchLen), - } - return t, nil -} - -func (t *binTree) SetDict(d *encoderDict) { t.dict = d } - -// WriteByte writes a single byte into the binary tree. -func (t *binTree) WriteByte(c byte) error { - t.x = (t.x << 8) | uint32(c) - t.hoff++ - if t.hoff < 0 { - return nil - } - v := t.front - if int64(v) < t.hoff { - // We are overwriting old nodes stored in the tree. - t.remove(v) - } - t.node[v].x = t.x - t.add(v) - t.front++ - if int64(t.front) >= int64(len(t.node)) { - t.front = 0 - } - return nil -} - -// Writes writes a sequence of bytes into the binTree structure. -func (t *binTree) Write(p []byte) (n int, err error) { - for _, c := range p { - t.WriteByte(c) - } - return len(p), nil -} - -// add puts the node v into the tree. The node must not be part of the -// tree before. -func (t *binTree) add(v uint32) { - vn := &t.node[v] - // Set left and right to null indices. - vn.l, vn.r = null, null - // If the binary tree is empty make v the root. - if t.root == null { - t.root = v - vn.p = null - return - } - x := vn.x - p := t.root - // Search for the right leave link and add the new node. - for { - pn := &t.node[p] - if x <= pn.x { - if pn.l == null { - pn.l = v - vn.p = p - return - } - p = pn.l - } else { - if pn.r == null { - pn.r = v - vn.p = p - return - } - p = pn.r - } - } -} - -// parent returns the parent node index of v and the pointer to v value -// in the parent. -func (t *binTree) parent(v uint32) (p uint32, ptr *uint32) { - if t.root == v { - return null, &t.root - } - p = t.node[v].p - if t.node[p].l == v { - ptr = &t.node[p].l - } else { - ptr = &t.node[p].r - } - return -} - -// Remove node v. -func (t *binTree) remove(v uint32) { - vn := &t.node[v] - p, ptr := t.parent(v) - l, r := vn.l, vn.r - if l == null { - // Move the right child up. - *ptr = r - if r != null { - t.node[r].p = p - } - return - } - if r == null { - // Move the left child up. - *ptr = l - t.node[l].p = p - return - } - - // Search the in-order predecessor u. - un := &t.node[l] - ur := un.r - if ur == null { - // In order predecessor is l. Move it up. - un.r = r - t.node[r].p = l - un.p = p - *ptr = l - return - } - var u uint32 - for { - // Look for the max value in the tree where l is root. - u = ur - ur = t.node[u].r - if ur == null { - break - } - } - // replace u with ul - un = &t.node[u] - ul := un.l - up := un.p - t.node[up].r = ul - if ul != null { - t.node[ul].p = up - } - - // replace v by u - un.l, un.r = l, r - t.node[l].p = u - t.node[r].p = u - *ptr = u - un.p = p -} - -// search looks for the node that have the value x or for the nodes that -// brace it. The node highest in the tree with the value x will be -// returned. All other nodes with the same value live in left subtree of -// the returned node. -func (t *binTree) search(v uint32, x uint32) (a, b uint32) { - a, b = null, null - if v == null { - return - } - for { - vn := &t.node[v] - if x <= vn.x { - if x == vn.x { - return v, v - } - b = v - if vn.l == null { - return - } - v = vn.l - } else { - a = v - if vn.r == null { - return - } - v = vn.r - } - } -} - -// max returns the node with maximum value in the subtree with v as -// root. -func (t *binTree) max(v uint32) uint32 { - if v == null { - return null - } - for { - r := t.node[v].r - if r == null { - return v - } - v = r - } -} - -// min returns the node with the minimum value in the subtree with v as -// root. -func (t *binTree) min(v uint32) uint32 { - if v == null { - return null - } - for { - l := t.node[v].l - if l == null { - return v - } - v = l - } -} - -// pred returns the in-order predecessor of node v. -func (t *binTree) pred(v uint32) uint32 { - if v == null { - return null - } - u := t.max(t.node[v].l) - if u != null { - return u - } - for { - p := t.node[v].p - if p == null { - return null - } - if t.node[p].r == v { - return p - } - v = p - } -} - -// succ returns the in-order successor of node v. -func (t *binTree) succ(v uint32) uint32 { - if v == null { - return null - } - u := t.min(t.node[v].r) - if u != null { - return u - } - for { - p := t.node[v].p - if p == null { - return null - } - if t.node[p].l == v { - return p - } - v = p - } -} - -// xval converts the first four bytes of a into an 32-bit unsigned -// integer in big-endian order. -func xval(a []byte) uint32 { - var x uint32 - switch len(a) { - default: - x |= uint32(a[3]) - fallthrough - case 3: - x |= uint32(a[2]) << 8 - fallthrough - case 2: - x |= uint32(a[1]) << 16 - fallthrough - case 1: - x |= uint32(a[0]) << 24 - case 0: - } - return x -} - -// dumpX converts value x into a four-letter string. -func dumpX(x uint32) string { - a := make([]byte, 4) - for i := 0; i < 4; i++ { - c := byte(x >> uint((3-i)*8)) - if unicode.IsGraphic(rune(c)) { - a[i] = c - } else { - a[i] = '.' - } - } - return string(a) -} - -/* -// dumpNode writes a representation of the node v into the io.Writer. -func (t *binTree) dumpNode(w io.Writer, v uint32, indent int) { - if v == null { - return - } - - vn := &t.node[v] - - t.dumpNode(w, vn.r, indent+2) - - for i := 0; i < indent; i++ { - fmt.Fprint(w, " ") - } - if vn.p == null { - fmt.Fprintf(w, "node %d %q parent null\n", v, dumpX(vn.x)) - } else { - fmt.Fprintf(w, "node %d %q parent %d\n", v, dumpX(vn.x), vn.p) - } - - t.dumpNode(w, vn.l, indent+2) -} - -// dump prints a representation of the binary tree into the writer. -func (t *binTree) dump(w io.Writer) error { - bw := bufio.NewWriter(w) - t.dumpNode(bw, t.root, 0) - return bw.Flush() -} -*/ - -func (t *binTree) distance(v uint32) int { - dist := int(t.front) - int(v) - if dist <= 0 { - dist += len(t.node) - } - return dist -} - -type matchParams struct { - rep [4]uint32 - // length when match will be accepted - nAccept int - // nodes to check - check int - // finish if length get shorter - stopShorter bool -} - -func (t *binTree) match(m match, distIter func() (int, bool), p matchParams, -) (r match, checked int, accepted bool) { - buf := &t.dict.buf - for { - if checked >= p.check { - return m, checked, true - } - dist, ok := distIter() - if !ok { - return m, checked, false - } - checked++ - if m.n > 0 { - i := buf.rear - dist + m.n - 1 - if i < 0 { - i += len(buf.data) - } else if i >= len(buf.data) { - i -= len(buf.data) - } - if buf.data[i] != t.data[m.n-1] { - if p.stopShorter { - return m, checked, false - } - continue - } - } - n := buf.matchLen(dist, t.data) - switch n { - case 0: - if p.stopShorter { - return m, checked, false - } - continue - case 1: - if uint32(dist-minDistance) != p.rep[0] { - continue - } - } - if n < m.n || (n == m.n && int64(dist) >= m.distance) { - continue - } - m = match{int64(dist), n} - if n >= p.nAccept { - return m, checked, true - } - } -} - -func (t *binTree) NextOp(rep [4]uint32) operation { - // retrieve maxMatchLen data - n, _ := t.dict.buf.Peek(t.data[:maxMatchLen]) - if n == 0 { - panic("no data in buffer") - } - t.data = t.data[:n] - - var ( - m match - x, u, v uint32 - iterPred, iterSucc func() (int, bool) - ) - p := matchParams{ - rep: rep, - nAccept: maxMatchLen, - check: 32, - } - i := 4 - iterSmall := func() (dist int, ok bool) { - i-- - if i <= 0 { - return 0, false - } - return i, true - } - m, checked, accepted := t.match(m, iterSmall, p) - if accepted { - goto end - } - p.check -= checked - x = xval(t.data) - u, v = t.search(t.root, x) - if u == v && len(t.data) == 4 { - iter := func() (dist int, ok bool) { - if u == null { - return 0, false - } - dist = t.distance(u) - u, v = t.search(t.node[u].l, x) - if u != v { - u = null - } - return dist, true - } - m, _, _ = t.match(m, iter, p) - goto end - } - p.stopShorter = true - iterSucc = func() (dist int, ok bool) { - if v == null { - return 0, false - } - dist = t.distance(v) - v = t.succ(v) - return dist, true - } - m, checked, accepted = t.match(m, iterSucc, p) - if accepted { - goto end - } - p.check -= checked - iterPred = func() (dist int, ok bool) { - if u == null { - return 0, false - } - dist = t.distance(u) - u = t.pred(u) - return dist, true - } - m, _, _ = t.match(m, iterPred, p) -end: - if m.n == 0 { - return lit{t.data[0]} - } - return m -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bitops.go b/vendor/github.com/ulikunitz/xz/lzma/bitops.go deleted file mode 100644 index 2010917092..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/bitops.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -/* Naming conventions follows the CodeReviewComments in the Go Wiki. */ - -// ntz32Const is used by the functions NTZ and NLZ. -const ntz32Const = 0x04d7651f - -// ntz32Table is a helper table for de Bruijn algorithm by Danny Dubé. -// See Henry S. Warren, Jr. "Hacker's Delight" section 5-1 figure 5-26. -var ntz32Table = [32]int8{ - 0, 1, 2, 24, 3, 19, 6, 25, - 22, 4, 20, 10, 16, 7, 12, 26, - 31, 23, 18, 5, 21, 9, 15, 11, - 30, 17, 8, 14, 29, 13, 28, 27, -} - -/* -// ntz32 computes the number of trailing zeros for an unsigned 32-bit integer. -func ntz32(x uint32) int { - if x == 0 { - return 32 - } - x = (x & -x) * ntz32Const - return int(ntz32Table[x>>27]) -} -*/ - -// nlz32 computes the number of leading zeros for an unsigned 32-bit integer. -func nlz32(x uint32) int { - // Smear left most bit to the right - x |= x >> 1 - x |= x >> 2 - x |= x >> 4 - x |= x >> 8 - x |= x >> 16 - // Use ntz mechanism to calculate nlz. - x++ - if x == 0 { - return 0 - } - x *= ntz32Const - return 32 - int(ntz32Table[x>>27]) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/breader.go b/vendor/github.com/ulikunitz/xz/lzma/breader.go deleted file mode 100644 index 9dfdf28b22..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/breader.go +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// breader provides the ReadByte function for a Reader. It doesn't read -// more data from the reader than absolutely necessary. -type breader struct { - io.Reader - // helper slice to save allocations - p []byte -} - -// ByteReader converts an io.Reader into an io.ByteReader. -func ByteReader(r io.Reader) io.ByteReader { - br, ok := r.(io.ByteReader) - if !ok { - return &breader{r, make([]byte, 1)} - } - return br -} - -// ReadByte read byte function. -func (r *breader) ReadByte() (c byte, err error) { - n, err := r.Reader.Read(r.p) - if n < 1 { - if err == nil { - err = errors.New("breader.ReadByte: no data") - } - return 0, err - } - return r.p[0], nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/buffer.go b/vendor/github.com/ulikunitz/xz/lzma/buffer.go deleted file mode 100644 index af41d5b2dc..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/buffer.go +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" -) - -// buffer provides a circular buffer of bytes. If the front index equals -// the rear index the buffer is empty. As a consequence front cannot be -// equal rear for a full buffer. So a full buffer has a length that is -// one byte less the the length of the data slice. -type buffer struct { - data []byte - front int - rear int -} - -// newBuffer creates a buffer with the given size. -func newBuffer(size int) *buffer { - return &buffer{data: make([]byte, size+1)} -} - -// Cap returns the capacity of the buffer. -func (b *buffer) Cap() int { - return len(b.data) - 1 -} - -// Resets the buffer. The front and rear index are set to zero. -func (b *buffer) Reset() { - b.front = 0 - b.rear = 0 -} - -// Buffered returns the number of bytes buffered. -func (b *buffer) Buffered() int { - delta := b.front - b.rear - if delta < 0 { - delta += len(b.data) - } - return delta -} - -// Available returns the number of bytes available for writing. -func (b *buffer) Available() int { - delta := b.rear - 1 - b.front - if delta < 0 { - delta += len(b.data) - } - return delta -} - -// addIndex adds a non-negative integer to the index i and returns the -// resulting index. The function takes care of wrapping the index as -// well as potential overflow situations. -func (b *buffer) addIndex(i int, n int) int { - // subtraction of len(b.data) prevents overflow - i += n - len(b.data) - if i < 0 { - i += len(b.data) - } - return i -} - -// Read reads bytes from the buffer into p and returns the number of -// bytes read. The function never returns an error but might return less -// data than requested. -func (b *buffer) Read(p []byte) (n int, err error) { - n, err = b.Peek(p) - b.rear = b.addIndex(b.rear, n) - return n, err -} - -// Peek reads bytes from the buffer into p without changing the buffer. -// Peek will never return an error but might return less data than -// requested. -func (b *buffer) Peek(p []byte) (n int, err error) { - m := b.Buffered() - n = len(p) - if m < n { - n = m - p = p[:n] - } - k := copy(p, b.data[b.rear:]) - if k < n { - copy(p[k:], b.data) - } - return n, nil -} - -// Discard skips the n next bytes to read from the buffer, returning the -// bytes discarded. -// -// If Discards skips fewer than n bytes, it returns an error. -func (b *buffer) Discard(n int) (discarded int, err error) { - if n < 0 { - return 0, errors.New("buffer.Discard: negative argument") - } - m := b.Buffered() - if m < n { - n = m - err = errors.New( - "buffer.Discard: discarded less bytes then requested") - } - b.rear = b.addIndex(b.rear, n) - return n, err -} - -// ErrNoSpace indicates that there is insufficient space for the Write -// operation. -var ErrNoSpace = errors.New("insufficient space") - -// Write puts data into the buffer. If less bytes are written than -// requested ErrNoSpace is returned. -func (b *buffer) Write(p []byte) (n int, err error) { - m := b.Available() - n = len(p) - if m < n { - n = m - p = p[:m] - err = ErrNoSpace - } - k := copy(b.data[b.front:], p) - if k < n { - copy(b.data, p[k:]) - } - b.front = b.addIndex(b.front, n) - return n, err -} - -// WriteByte writes a single byte into the buffer. The error ErrNoSpace -// is returned if no single byte is available in the buffer for writing. -func (b *buffer) WriteByte(c byte) error { - if b.Available() < 1 { - return ErrNoSpace - } - b.data[b.front] = c - b.front = b.addIndex(b.front, 1) - return nil -} - -// prefixLen returns the length of the common prefix of a and b. -func prefixLen(a, b []byte) int { - if len(a) > len(b) { - a, b = b, a - } - for i, c := range a { - if b[i] != c { - return i - } - } - return len(a) -} - -// matchLen returns the length of the common prefix for the given -// distance from the rear and the byte slice p. -func (b *buffer) matchLen(distance int, p []byte) int { - var n int - i := b.rear - distance - if i < 0 { - if n = prefixLen(p, b.data[len(b.data)+i:]); n < -i { - return n - } - p = p[n:] - i = 0 - } - n += prefixLen(p, b.data[i:]) - return n -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go b/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go deleted file mode 100644 index f27e31a4a8..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/bytewriter.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// ErrLimit indicates that the limit of the LimitedByteWriter has been -// reached. -var ErrLimit = errors.New("limit reached") - -// LimitedByteWriter provides a byte writer that can be written until a -// limit is reached. The field N provides the number of remaining -// bytes. -type LimitedByteWriter struct { - BW io.ByteWriter - N int64 -} - -// WriteByte writes a single byte to the limited byte writer. It returns -// ErrLimit if the limit has been reached. If the byte is successfully -// written the field N of the LimitedByteWriter will be decremented by -// one. -func (l *LimitedByteWriter) WriteByte(c byte) error { - if l.N <= 0 { - return ErrLimit - } - if err := l.BW.WriteByte(c); err != nil { - return err - } - l.N-- - return nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoder.go b/vendor/github.com/ulikunitz/xz/lzma/decoder.go deleted file mode 100644 index 3765484e61..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/decoder.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -// decoder decodes a raw LZMA stream without any header. -type decoder struct { - // dictionary; the rear pointer of the buffer will be used for - // reading the data. - Dict *decoderDict - // decoder state - State *state - // range decoder - rd *rangeDecoder - // start stores the head value of the dictionary for the LZMA - // stream - start int64 - // size of uncompressed data - size int64 - // end-of-stream encountered - eos bool - // EOS marker found - eosMarker bool -} - -// newDecoder creates a new decoder instance. The parameter size provides -// the expected byte size of the decompressed data. If the size is -// unknown use a negative value. In that case the decoder will look for -// a terminating end-of-stream marker. -func newDecoder(br io.ByteReader, state *state, dict *decoderDict, size int64) (d *decoder, err error) { - rd, err := newRangeDecoder(br) - if err != nil { - return nil, err - } - d = &decoder{ - State: state, - Dict: dict, - rd: rd, - size: size, - start: dict.pos(), - } - return d, nil -} - -// Reopen restarts the decoder with a new byte reader and a new size. Reopen -// resets the Decompressed counter to zero. -func (d *decoder) Reopen(br io.ByteReader, size int64) error { - var err error - if d.rd, err = newRangeDecoder(br); err != nil { - return err - } - d.start = d.Dict.pos() - d.size = size - d.eos = false - return nil -} - -// decodeLiteral decodes a single literal from the LZMA stream. -func (d *decoder) decodeLiteral() (op operation, err error) { - litState := d.State.litState(d.Dict.byteAt(1), d.Dict.head) - match := d.Dict.byteAt(int(d.State.rep[0]) + 1) - s, err := d.State.litCodec.Decode(d.rd, d.State.state, match, litState) - if err != nil { - return nil, err - } - return lit{s}, nil -} - -// errEOS indicates that an EOS marker has been found. -var errEOS = errors.New("EOS marker found") - -// readOp decodes the next operation from the compressed stream. It -// returns the operation. If an explicit end of stream marker is -// identified the eos error is returned. -func (d *decoder) readOp() (op operation, err error) { - // Value of the end of stream (EOS) marker - const eosDist = 1<<32 - 1 - - state, state2, posState := d.State.states(d.Dict.head) - - b, err := d.State.isMatch[state2].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - // literal - op, err := d.decodeLiteral() - if err != nil { - return nil, err - } - d.State.updateStateLiteral() - return op, nil - } - b, err = d.State.isRep[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - // simple match - d.State.rep[3], d.State.rep[2], d.State.rep[1] = - d.State.rep[2], d.State.rep[1], d.State.rep[0] - - d.State.updateStateMatch() - // The length decoder returns the length offset. - n, err := d.State.lenCodec.Decode(d.rd, posState) - if err != nil { - return nil, err - } - // The dist decoder returns the distance offset. The actual - // distance is 1 higher. - d.State.rep[0], err = d.State.distCodec.Decode(d.rd, n) - if err != nil { - return nil, err - } - if d.State.rep[0] == eosDist { - d.eosMarker = true - return nil, errEOS - } - op = match{n: int(n) + minMatchLen, - distance: int64(d.State.rep[0]) + minDistance} - return op, nil - } - b, err = d.State.isRepG0[state].Decode(d.rd) - if err != nil { - return nil, err - } - dist := d.State.rep[0] - if b == 0 { - // rep match 0 - b, err = d.State.isRepG0Long[state2].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - d.State.updateStateShortRep() - op = match{n: 1, distance: int64(dist) + minDistance} - return op, nil - } - } else { - b, err = d.State.isRepG1[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - dist = d.State.rep[1] - } else { - b, err = d.State.isRepG2[state].Decode(d.rd) - if err != nil { - return nil, err - } - if b == 0 { - dist = d.State.rep[2] - } else { - dist = d.State.rep[3] - d.State.rep[3] = d.State.rep[2] - } - d.State.rep[2] = d.State.rep[1] - } - d.State.rep[1] = d.State.rep[0] - d.State.rep[0] = dist - } - n, err := d.State.repLenCodec.Decode(d.rd, posState) - if err != nil { - return nil, err - } - d.State.updateStateRep() - op = match{n: int(n) + minMatchLen, distance: int64(dist) + minDistance} - return op, nil -} - -// apply takes the operation and transforms the decoder dictionary accordingly. -func (d *decoder) apply(op operation) error { - var err error - switch x := op.(type) { - case match: - err = d.Dict.writeMatch(x.distance, x.n) - case lit: - err = d.Dict.WriteByte(x.b) - default: - panic("op is neither a match nor a literal") - } - return err -} - -// decompress fills the dictionary unless no space for new data is -// available. If the end of the LZMA stream has been reached io.EOF will -// be returned. -func (d *decoder) decompress() error { - if d.eos { - return io.EOF - } - for d.Dict.Available() >= maxMatchLen { - op, err := d.readOp() - switch err { - case nil: - // break - case errEOS: - d.eos = true - if !d.rd.possiblyAtEnd() { - return errDataAfterEOS - } - if d.size >= 0 && d.size != d.Decompressed() { - return errSize - } - return io.EOF - case io.EOF: - d.eos = true - return io.ErrUnexpectedEOF - default: - return err - } - if err = d.apply(op); err != nil { - return err - } - if d.size >= 0 && d.Decompressed() >= d.size { - d.eos = true - if d.Decompressed() > d.size { - return errSize - } - if !d.rd.possiblyAtEnd() { - switch _, err = d.readOp(); err { - case nil: - return errSize - case io.EOF: - return io.ErrUnexpectedEOF - case errEOS: - break - default: - return err - } - } - return io.EOF - } - } - return nil -} - -// Errors that may be returned while decoding data. -var ( - errDataAfterEOS = errors.New("lzma: data after end of stream marker") - errSize = errors.New("lzma: wrong uncompressed data size") -) - -// Read reads data from the buffer. If no more data is available io.EOF is -// returned. -func (d *decoder) Read(p []byte) (n int, err error) { - var k int - for { - // Read of decoder dict never returns an error. - k, err = d.Dict.Read(p[n:]) - if err != nil { - panic(fmt.Errorf("dictionary read error %s", err)) - } - if k == 0 && d.eos { - return n, io.EOF - } - n += k - if n >= len(p) { - return n, nil - } - if err = d.decompress(); err != nil && err != io.EOF { - return n, err - } - } -} - -// Decompressed returns the number of bytes decompressed by the decoder. -func (d *decoder) Decompressed() int64 { - return d.Dict.pos() - d.start -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go deleted file mode 100644 index d5b814f0a4..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/decoderdict.go +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// decoderDict provides the dictionary for the decoder. The whole -// dictionary is used as reader buffer. -type decoderDict struct { - buf buffer - head int64 -} - -// newDecoderDict creates a new decoder dictionary. The whole dictionary -// will be used as reader buffer. -func newDecoderDict(dictCap int) (d *decoderDict, err error) { - // lower limit supports easy test cases - if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { - return nil, errors.New("lzma: dictCap out of range") - } - d = &decoderDict{buf: *newBuffer(dictCap)} - return d, nil -} - -// Reset clears the dictionary. The read buffer is not changed, so the -// buffered data can still be read. -func (d *decoderDict) Reset() { - d.head = 0 -} - -// WriteByte writes a single byte into the dictionary. It is used to -// write literals into the dictionary. -func (d *decoderDict) WriteByte(c byte) error { - if err := d.buf.WriteByte(c); err != nil { - return err - } - d.head++ - return nil -} - -// pos returns the position of the dictionary head. -func (d *decoderDict) pos() int64 { return d.head } - -// dictLen returns the actual length of the dictionary. -func (d *decoderDict) dictLen() int { - capacity := d.buf.Cap() - if d.head >= int64(capacity) { - return capacity - } - return int(d.head) -} - -// byteAt returns a byte stored in the dictionary. If the distance is -// non-positive or exceeds the current length of the dictionary the zero -// byte is returned. -func (d *decoderDict) byteAt(dist int) byte { - if !(0 < dist && dist <= d.dictLen()) { - return 0 - } - i := d.buf.front - dist - if i < 0 { - i += len(d.buf.data) - } - return d.buf.data[i] -} - -// writeMatch writes the match at the top of the dictionary. The given -// distance must point in the current dictionary and the length must not -// exceed the maximum length 273 supported in LZMA. -// -// The error value ErrNoSpace indicates that no space is available in -// the dictionary for writing. You need to read from the dictionary -// first. -func (d *decoderDict) writeMatch(dist int64, length int) error { - if !(0 < dist && dist <= int64(d.dictLen())) { - return errors.New("writeMatch: distance out of range") - } - if !(0 < length && length <= maxMatchLen) { - return errors.New("writeMatch: length out of range") - } - if length > d.buf.Available() { - return ErrNoSpace - } - d.head += int64(length) - - i := d.buf.front - int(dist) - if i < 0 { - i += len(d.buf.data) - } - for length > 0 { - var p []byte - if i >= d.buf.front { - p = d.buf.data[i:] - i = 0 - } else { - p = d.buf.data[i:d.buf.front] - i = d.buf.front - } - if len(p) > length { - p = p[:length] - } - if _, err := d.buf.Write(p); err != nil { - panic(fmt.Errorf("d.buf.Write returned error %s", err)) - } - length -= len(p) - } - return nil -} - -// Write writes the given bytes into the dictionary and advances the -// head. -func (d *decoderDict) Write(p []byte) (n int, err error) { - n, err = d.buf.Write(p) - d.head += int64(n) - return n, err -} - -// Available returns the number of available bytes for writing into the -// decoder dictionary. -func (d *decoderDict) Available() int { return d.buf.Available() } - -// Read reads data from the buffer contained in the decoder dictionary. -func (d *decoderDict) Read(p []byte) (n int, err error) { return d.buf.Read(p) } diff --git a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go b/vendor/github.com/ulikunitz/xz/lzma/directcodec.go deleted file mode 100644 index 76b713106f..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/directcodec.go +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// directCodec allows the encoding and decoding of values with a fixed number -// of bits. The number of bits must be in the range [1,32]. -type directCodec byte - -// Bits returns the number of bits supported by this codec. -func (dc directCodec) Bits() int { - return int(dc) -} - -// Encode uses the range encoder to encode a value with the fixed number of -// bits. The most-significant bit is encoded first. -func (dc directCodec) Encode(e *rangeEncoder, v uint32) error { - for i := int(dc) - 1; i >= 0; i-- { - if err := e.DirectEncodeBit(v >> uint(i)); err != nil { - return err - } - } - return nil -} - -// Decode uses the range decoder to decode a value with the given number of -// given bits. The most-significant bit is decoded first. -func (dc directCodec) Decode(d *rangeDecoder) (v uint32, err error) { - for i := int(dc) - 1; i >= 0; i-- { - x, err := d.DirectDecodeBit() - if err != nil { - return 0, err - } - v = (v << 1) | x - } - return v, nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go b/vendor/github.com/ulikunitz/xz/lzma/distcodec.go deleted file mode 100644 index b447d8ec42..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/distcodec.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// Constants used by the distance codec. -const ( - // minimum supported distance - minDistance = 1 - // maximum supported distance, value is used for the eos marker. - maxDistance = 1 << 32 - // number of the supported len states - lenStates = 4 - // start for the position models - startPosModel = 4 - // first index with align bits support - endPosModel = 14 - // bits for the position slots - posSlotBits = 6 - // number of align bits - alignBits = 4 -) - -// distCodec provides encoding and decoding of distance values. -type distCodec struct { - posSlotCodecs [lenStates]treeCodec - posModel [endPosModel - startPosModel]treeReverseCodec - alignCodec treeReverseCodec -} - -// deepcopy initializes dc as deep copy of the source. -func (dc *distCodec) deepcopy(src *distCodec) { - if dc == src { - return - } - for i := range dc.posSlotCodecs { - dc.posSlotCodecs[i].deepcopy(&src.posSlotCodecs[i]) - } - for i := range dc.posModel { - dc.posModel[i].deepcopy(&src.posModel[i]) - } - dc.alignCodec.deepcopy(&src.alignCodec) -} - -// newDistCodec creates a new distance codec. -func (dc *distCodec) init() { - for i := range dc.posSlotCodecs { - dc.posSlotCodecs[i] = makeTreeCodec(posSlotBits) - } - for i := range dc.posModel { - posSlot := startPosModel + i - bits := (posSlot >> 1) - 1 - dc.posModel[i] = makeTreeReverseCodec(bits) - } - dc.alignCodec = makeTreeReverseCodec(alignBits) -} - -// lenState converts the value l to a supported lenState value. -func lenState(l uint32) uint32 { - if l >= lenStates { - l = lenStates - 1 - } - return l -} - -// Encode encodes the distance using the parameter l. Dist can have values from -// the full range of uint32 values. To get the distance offset the actual match -// distance has to be decreased by 1. A distance offset of 0xffffffff (eos) -// indicates the end of the stream. -func (dc *distCodec) Encode(e *rangeEncoder, dist uint32, l uint32) (err error) { - // Compute the posSlot using nlz32 - var posSlot uint32 - var bits uint32 - if dist < startPosModel { - posSlot = dist - } else { - bits = uint32(30 - nlz32(dist)) - posSlot = startPosModel - 2 + (bits << 1) - posSlot += (dist >> uint(bits)) & 1 - } - - if err = dc.posSlotCodecs[lenState(l)].Encode(e, posSlot); err != nil { - return - } - - switch { - case posSlot < startPosModel: - return nil - case posSlot < endPosModel: - tc := &dc.posModel[posSlot-startPosModel] - return tc.Encode(dist, e) - } - dic := directCodec(bits - alignBits) - if err = dic.Encode(e, dist>>alignBits); err != nil { - return - } - return dc.alignCodec.Encode(dist, e) -} - -// Decode decodes the distance offset using the parameter l. The dist value -// 0xffffffff (eos) indicates the end of the stream. Add one to the distance -// offset to get the actual match distance. -func (dc *distCodec) Decode(d *rangeDecoder, l uint32) (dist uint32, err error) { - posSlot, err := dc.posSlotCodecs[lenState(l)].Decode(d) - if err != nil { - return - } - - // posSlot equals distance - if posSlot < startPosModel { - return posSlot, nil - } - - // posSlot uses the individual models - bits := (posSlot >> 1) - 1 - dist = (2 | (posSlot & 1)) << bits - var u uint32 - if posSlot < endPosModel { - tc := &dc.posModel[posSlot-startPosModel] - if u, err = tc.Decode(d); err != nil { - return 0, err - } - dist += u - return dist, nil - } - - // posSlots use direct encoding and a single model for the four align - // bits. - dic := directCodec(bits - alignBits) - if u, err = dic.Decode(d); err != nil { - return 0, err - } - dist += u << alignBits - if u, err = dc.alignCodec.Decode(d); err != nil { - return 0, err - } - dist += u - return dist, nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoder.go b/vendor/github.com/ulikunitz/xz/lzma/encoder.go deleted file mode 100644 index e409383181..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/encoder.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "fmt" - "io" -) - -// opLenMargin provides the upper limit of the number of bytes required -// to encode a single operation. -const opLenMargin = 16 - -// compressFlags control the compression process. -type compressFlags uint32 - -// Values for compressFlags. -const ( - // all data should be compressed, even if compression is not - // optimal. - all compressFlags = 1 << iota -) - -// encoderFlags provide the flags for an encoder. -type encoderFlags uint32 - -// Flags for the encoder. -const ( - // eosMarker requests an EOS marker to be written. - eosMarker encoderFlags = 1 << iota -) - -// Encoder compresses data buffered in the encoder dictionary and writes -// it into a byte writer. -type encoder struct { - dict *encoderDict - state *state - re *rangeEncoder - start int64 - // generate eos marker - marker bool - limit bool - margin int -} - -// newEncoder creates a new encoder. If the byte writer must be -// limited use LimitedByteWriter provided by this package. The flags -// argument supports the eosMarker flag, controlling whether a -// terminating end-of-stream marker must be written. -func newEncoder(bw io.ByteWriter, state *state, dict *encoderDict, - flags encoderFlags) (e *encoder, err error) { - - re, err := newRangeEncoder(bw) - if err != nil { - return nil, err - } - e = &encoder{ - dict: dict, - state: state, - re: re, - marker: flags&eosMarker != 0, - start: dict.Pos(), - margin: opLenMargin, - } - if e.marker { - e.margin += 5 - } - return e, nil -} - -// Write writes the bytes from p into the dictionary. If not enough -// space is available the data in the dictionary buffer will be -// compressed to make additional space available. If the limit of the -// underlying writer has been reached ErrLimit will be returned. -func (e *encoder) Write(p []byte) (n int, err error) { - for { - k, err := e.dict.Write(p[n:]) - n += k - if err == ErrNoSpace { - if err = e.compress(0); err != nil { - return n, err - } - continue - } - return n, err - } -} - -// Reopen reopens the encoder with a new byte writer. -func (e *encoder) Reopen(bw io.ByteWriter) error { - var err error - if e.re, err = newRangeEncoder(bw); err != nil { - return err - } - e.start = e.dict.Pos() - e.limit = false - return nil -} - -// writeLiteral writes a literal into the LZMA stream -func (e *encoder) writeLiteral(l lit) error { - var err error - state, state2, _ := e.state.states(e.dict.Pos()) - if err = e.state.isMatch[state2].Encode(e.re, 0); err != nil { - return err - } - litState := e.state.litState(e.dict.ByteAt(1), e.dict.Pos()) - match := e.dict.ByteAt(int(e.state.rep[0]) + 1) - err = e.state.litCodec.Encode(e.re, l.b, state, match, litState) - if err != nil { - return err - } - e.state.updateStateLiteral() - return nil -} - -// iverson implements the Iverson operator as proposed by Donald Knuth in his -// book Concrete Mathematics. -func iverson(ok bool) uint32 { - if ok { - return 1 - } - return 0 -} - -// writeMatch writes a repetition operation into the operation stream -func (e *encoder) writeMatch(m match) error { - var err error - if !(minDistance <= m.distance && m.distance <= maxDistance) { - panic(fmt.Errorf("match distance %d out of range", m.distance)) - } - dist := uint32(m.distance - minDistance) - if !(minMatchLen <= m.n && m.n <= maxMatchLen) && - !(dist == e.state.rep[0] && m.n == 1) { - panic(fmt.Errorf( - "match length %d out of range; dist %d rep[0] %d", - m.n, dist, e.state.rep[0])) - } - state, state2, posState := e.state.states(e.dict.Pos()) - if err = e.state.isMatch[state2].Encode(e.re, 1); err != nil { - return err - } - g := 0 - for ; g < 4; g++ { - if e.state.rep[g] == dist { - break - } - } - b := iverson(g < 4) - if err = e.state.isRep[state].Encode(e.re, b); err != nil { - return err - } - n := uint32(m.n - minMatchLen) - if b == 0 { - // simple match - e.state.rep[3], e.state.rep[2], e.state.rep[1], e.state.rep[0] = - e.state.rep[2], e.state.rep[1], e.state.rep[0], dist - e.state.updateStateMatch() - if err = e.state.lenCodec.Encode(e.re, n, posState); err != nil { - return err - } - return e.state.distCodec.Encode(e.re, dist, n) - } - b = iverson(g != 0) - if err = e.state.isRepG0[state].Encode(e.re, b); err != nil { - return err - } - if b == 0 { - // g == 0 - b = iverson(m.n != 1) - if err = e.state.isRepG0Long[state2].Encode(e.re, b); err != nil { - return err - } - if b == 0 { - e.state.updateStateShortRep() - return nil - } - } else { - // g in {1,2,3} - b = iverson(g != 1) - if err = e.state.isRepG1[state].Encode(e.re, b); err != nil { - return err - } - if b == 1 { - // g in {2,3} - b = iverson(g != 2) - err = e.state.isRepG2[state].Encode(e.re, b) - if err != nil { - return err - } - if b == 1 { - e.state.rep[3] = e.state.rep[2] - } - e.state.rep[2] = e.state.rep[1] - } - e.state.rep[1] = e.state.rep[0] - e.state.rep[0] = dist - } - e.state.updateStateRep() - return e.state.repLenCodec.Encode(e.re, n, posState) -} - -// writeOp writes a single operation to the range encoder. The function -// checks whether there is enough space available to close the LZMA -// stream. -func (e *encoder) writeOp(op operation) error { - if e.re.Available() < int64(e.margin) { - return ErrLimit - } - switch x := op.(type) { - case lit: - return e.writeLiteral(x) - case match: - return e.writeMatch(x) - default: - panic("unexpected operation") - } -} - -// compress compressed data from the dictionary buffer. If the flag all -// is set, all data in the dictionary buffer will be compressed. The -// function returns ErrLimit if the underlying writer has reached its -// limit. -func (e *encoder) compress(flags compressFlags) error { - n := 0 - if flags&all == 0 { - n = maxMatchLen - 1 - } - d := e.dict - m := d.m - for d.Buffered() > n { - op := m.NextOp(e.state.rep) - if err := e.writeOp(op); err != nil { - return err - } - d.Discard(op.Len()) - } - return nil -} - -// eosMatch is a pseudo operation that indicates the end of the stream. -var eosMatch = match{distance: maxDistance, n: minMatchLen} - -// Close terminates the LZMA stream. If requested the end-of-stream -// marker will be written. If the byte writer limit has been or will be -// reached during compression of the remaining data in the buffer the -// LZMA stream will be closed and data will remain in the buffer. -func (e *encoder) Close() error { - err := e.compress(all) - if err != nil && err != ErrLimit { - return err - } - if e.marker { - if err := e.writeMatch(eosMatch); err != nil { - return err - } - } - err = e.re.Close() - return err -} - -// Compressed returns the number bytes of the input data that been -// compressed. -func (e *encoder) Compressed() int64 { - return e.dict.Pos() - e.start -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go b/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go deleted file mode 100644 index 4b3916eaba..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/encoderdict.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -// matcher is an interface that supports the identification of the next -// operation. -type matcher interface { - io.Writer - SetDict(d *encoderDict) - NextOp(rep [4]uint32) operation -} - -// encoderDict provides the dictionary of the encoder. It includes an -// additional buffer atop of the actual dictionary. -type encoderDict struct { - buf buffer - m matcher - head int64 - capacity int - // preallocated array - data [maxMatchLen]byte -} - -// newEncoderDict creates the encoder dictionary. The argument bufSize -// defines the size of the additional buffer. -func newEncoderDict(dictCap, bufSize int, m matcher) (d *encoderDict, err error) { - if !(1 <= dictCap && int64(dictCap) <= MaxDictCap) { - return nil, errors.New( - "lzma: dictionary capacity out of range") - } - if bufSize < 1 { - return nil, errors.New( - "lzma: buffer size must be larger than zero") - } - d = &encoderDict{ - buf: *newBuffer(dictCap + bufSize), - capacity: dictCap, - m: m, - } - m.SetDict(d) - return d, nil -} - -// Discard discards n bytes. Note that n must not be larger than -// MaxMatchLen. -func (d *encoderDict) Discard(n int) { - p := d.data[:n] - k, _ := d.buf.Read(p) - if k < n { - panic(fmt.Errorf("lzma: can't discard %d bytes", n)) - } - d.head += int64(n) - d.m.Write(p) -} - -// Len returns the data available in the encoder dictionary. -func (d *encoderDict) Len() int { - n := d.buf.Available() - if int64(n) > d.head { - return int(d.head) - } - return n -} - -// DictLen returns the actual length of data in the dictionary. -func (d *encoderDict) DictLen() int { - if d.head < int64(d.capacity) { - return int(d.head) - } - return d.capacity -} - -// Available returns the number of bytes that can be written by a -// following Write call. -func (d *encoderDict) Available() int { - return d.buf.Available() - d.DictLen() -} - -// Write writes data into the dictionary buffer. Note that the position -// of the dictionary head will not be moved. If there is not enough -// space in the buffer ErrNoSpace will be returned. -func (d *encoderDict) Write(p []byte) (n int, err error) { - m := d.Available() - if len(p) > m { - p = p[:m] - err = ErrNoSpace - } - var e error - if n, e = d.buf.Write(p); e != nil { - err = e - } - return n, err -} - -// Pos returns the position of the head. -func (d *encoderDict) Pos() int64 { return d.head } - -// ByteAt returns the byte at the given distance. -func (d *encoderDict) ByteAt(distance int) byte { - if !(0 < distance && distance <= d.Len()) { - return 0 - } - i := d.buf.rear - distance - if i < 0 { - i += len(d.buf.data) - } - return d.buf.data[i] -} - -// CopyN copies the last n bytes from the dictionary into the provided -// writer. This is used for copying uncompressed data into an -// uncompressed segment. -func (d *encoderDict) CopyN(w io.Writer, n int) (written int, err error) { - if n <= 0 { - return 0, nil - } - m := d.Len() - if n > m { - n = m - err = ErrNoSpace - } - i := d.buf.rear - n - var e error - if i < 0 { - i += len(d.buf.data) - if written, e = w.Write(d.buf.data[i:]); e != nil { - return written, e - } - i = 0 - } - var k int - k, e = w.Write(d.buf.data[i:d.buf.rear]) - written += k - if e != nil { - err = e - } - return written, err -} - -// Buffered returns the number of bytes in the buffer. -func (d *encoderDict) Buffered() int { return d.buf.Buffered() } diff --git a/vendor/github.com/ulikunitz/xz/lzma/fox.lzma b/vendor/github.com/ulikunitz/xz/lzma/fox.lzma deleted file mode 100644 index 5edad633266eb5173a7c39761dc8b9e71efbfe80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67 zcma!LU}#|Y4+RWbQXGqzRntCtR~%i$`d{za%}WYWYfXMUl6~Q5_UjH?=5CuO0w(I5 UuQ#VXelz{mI_3ZW`W7$%0HEw6g#Z8m diff --git a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go b/vendor/github.com/ulikunitz/xz/lzma/hashtable.go deleted file mode 100644 index f66e9cdd9e..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/hashtable.go +++ /dev/null @@ -1,309 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - - "github.com/ulikunitz/xz/internal/hash" -) - -/* For compression we need to find byte sequences that match the byte - * sequence at the dictionary head. A hash table is a simple method to - * provide this capability. - */ - -// maxMatches limits the number of matches requested from the Matches -// function. This controls the speed of the overall encoding. -const maxMatches = 16 - -// shortDists defines the number of short distances supported by the -// implementation. -const shortDists = 8 - -// The minimum is somehow arbitrary but the maximum is limited by the -// memory requirements of the hash table. -const ( - minTableExponent = 9 - maxTableExponent = 20 -) - -// newRoller contains the function used to create an instance of the -// hash.Roller. -var newRoller = func(n int) hash.Roller { return hash.NewCyclicPoly(n) } - -// hashTable stores the hash table including the rolling hash method. -// -// We implement chained hashing into a circular buffer. Each entry in -// the circular buffer stores the delta distance to the next position with a -// word that has the same hash value. -type hashTable struct { - dict *encoderDict - // actual hash table - t []int64 - // circular list data with the offset to the next word - data []uint32 - front int - // mask for computing the index for the hash table - mask uint64 - // hash offset; initial value is -int64(wordLen) - hoff int64 - // length of the hashed word - wordLen int - // hash roller for computing the hash values for the Write - // method - wr hash.Roller - // hash roller for computing arbitrary hashes - hr hash.Roller - // preallocated slices - p [maxMatches]int64 - distances [maxMatches + shortDists]int -} - -// hashTableExponent derives the hash table exponent from the dictionary -// capacity. -func hashTableExponent(n uint32) int { - e := 30 - nlz32(n) - switch { - case e < minTableExponent: - e = minTableExponent - case e > maxTableExponent: - e = maxTableExponent - } - return e -} - -// newHashTable creates a new hash table for words of length wordLen -func newHashTable(capacity int, wordLen int) (t *hashTable, err error) { - if !(0 < capacity) { - return nil, errors.New( - "newHashTable: capacity must not be negative") - } - exp := hashTableExponent(uint32(capacity)) - if !(1 <= wordLen && wordLen <= 4) { - return nil, errors.New("newHashTable: " + - "argument wordLen out of range") - } - n := 1 << uint(exp) - if n <= 0 { - panic("newHashTable: exponent is too large") - } - t = &hashTable{ - t: make([]int64, n), - data: make([]uint32, capacity), - mask: (uint64(1) << uint(exp)) - 1, - hoff: -int64(wordLen), - wordLen: wordLen, - wr: newRoller(wordLen), - hr: newRoller(wordLen), - } - return t, nil -} - -func (t *hashTable) SetDict(d *encoderDict) { t.dict = d } - -// buffered returns the number of bytes that are currently hashed. -func (t *hashTable) buffered() int { - n := t.hoff + 1 - switch { - case n <= 0: - return 0 - case n >= int64(len(t.data)): - return len(t.data) - } - return int(n) -} - -// addIndex adds n to an index ensuring that is stays inside the -// circular buffer for the hash chain. -func (t *hashTable) addIndex(i, n int) int { - i += n - len(t.data) - if i < 0 { - i += len(t.data) - } - return i -} - -// putDelta puts the delta instance at the current front of the circular -// chain buffer. -func (t *hashTable) putDelta(delta uint32) { - t.data[t.front] = delta - t.front = t.addIndex(t.front, 1) -} - -// putEntry puts a new entry into the hash table. If there is already a -// value stored it is moved into the circular chain buffer. -func (t *hashTable) putEntry(h uint64, pos int64) { - if pos < 0 { - return - } - i := h & t.mask - old := t.t[i] - 1 - t.t[i] = pos + 1 - var delta int64 - if old >= 0 { - delta = pos - old - if delta > 1<<32-1 || delta > int64(t.buffered()) { - delta = 0 - } - } - t.putDelta(uint32(delta)) -} - -// WriteByte converts a single byte into a hash and puts them into the hash -// table. -func (t *hashTable) WriteByte(b byte) error { - h := t.wr.RollByte(b) - t.hoff++ - t.putEntry(h, t.hoff) - return nil -} - -// Write converts the bytes provided into hash tables and stores the -// abbreviated offsets into the hash table. The method will never return an -// error. -func (t *hashTable) Write(p []byte) (n int, err error) { - for _, b := range p { - // WriteByte doesn't generate an error. - t.WriteByte(b) - } - return len(p), nil -} - -// getMatches the matches for a specific hash. The functions returns the -// number of positions found. -// -// TODO: Make a getDistances because that we are actually interested in. -func (t *hashTable) getMatches(h uint64, positions []int64) (n int) { - if t.hoff < 0 || len(positions) == 0 { - return 0 - } - buffered := t.buffered() - tailPos := t.hoff + 1 - int64(buffered) - rear := t.front - buffered - if rear >= 0 { - rear -= len(t.data) - } - // get the slot for the hash - pos := t.t[h&t.mask] - 1 - delta := pos - tailPos - for { - if delta < 0 { - return n - } - positions[n] = tailPos + delta - n++ - if n >= len(positions) { - return n - } - i := rear + int(delta) - if i < 0 { - i += len(t.data) - } - u := t.data[i] - if u == 0 { - return n - } - delta -= int64(u) - } -} - -// hash computes the rolling hash for the word stored in p. For correct -// results its length must be equal to t.wordLen. -func (t *hashTable) hash(p []byte) uint64 { - var h uint64 - for _, b := range p { - h = t.hr.RollByte(b) - } - return h -} - -// Matches fills the positions slice with potential matches. The -// functions returns the number of positions filled into positions. The -// byte slice p must have word length of the hash table. -func (t *hashTable) Matches(p []byte, positions []int64) int { - if len(p) != t.wordLen { - panic(fmt.Errorf( - "byte slice must have length %d", t.wordLen)) - } - h := t.hash(p) - return t.getMatches(h, positions) -} - -// NextOp identifies the next operation using the hash table. -// -// TODO: Use all repetitions to find matches. -func (t *hashTable) NextOp(rep [4]uint32) operation { - // get positions - data := t.dict.data[:maxMatchLen] - n, _ := t.dict.buf.Peek(data) - data = data[:n] - var p []int64 - if n < t.wordLen { - p = t.p[:0] - } else { - p = t.p[:maxMatches] - n = t.Matches(data[:t.wordLen], p) - p = p[:n] - } - - // convert positions in potential distances - head := t.dict.head - dists := append(t.distances[:0], 1, 2, 3, 4, 5, 6, 7, 8) - for _, pos := range p { - dis := int(head - pos) - if dis > shortDists { - dists = append(dists, dis) - } - } - - // check distances - var m match - dictLen := t.dict.DictLen() - for _, dist := range dists { - if dist > dictLen { - continue - } - - // Here comes a trick. We are only interested in matches - // that are longer than the matches we have been found - // before. So before we test the whole byte sequence at - // the given distance, we test the first byte that would - // make the match longer. If it doesn't match the byte - // to match, we don't to care any longer. - i := t.dict.buf.rear - dist + m.n - if i < 0 { - i += len(t.dict.buf.data) - } - if t.dict.buf.data[i] != data[m.n] { - // We can't get a longer match. Jump to the next - // distance. - continue - } - - n := t.dict.buf.matchLen(dist, data) - switch n { - case 0: - continue - case 1: - if uint32(dist-minDistance) != rep[0] { - continue - } - } - if n > m.n { - m = match{int64(dist), n} - if n == len(data) { - // No better match will be found. - break - } - } - } - - if m.n == 0 { - return lit{data[0]} - } - return m -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/header.go b/vendor/github.com/ulikunitz/xz/lzma/header.go deleted file mode 100644 index 1ae7d80cab..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/header.go +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// uint32LE reads an uint32 integer from a byte slice -func uint32LE(b []byte) uint32 { - x := uint32(b[3]) << 24 - x |= uint32(b[2]) << 16 - x |= uint32(b[1]) << 8 - x |= uint32(b[0]) - return x -} - -// uint64LE converts the uint64 value stored as little endian to an uint64 -// value. -func uint64LE(b []byte) uint64 { - x := uint64(b[7]) << 56 - x |= uint64(b[6]) << 48 - x |= uint64(b[5]) << 40 - x |= uint64(b[4]) << 32 - x |= uint64(b[3]) << 24 - x |= uint64(b[2]) << 16 - x |= uint64(b[1]) << 8 - x |= uint64(b[0]) - return x -} - -// putUint32LE puts an uint32 integer into a byte slice that must have at least -// a length of 4 bytes. -func putUint32LE(b []byte, x uint32) { - b[0] = byte(x) - b[1] = byte(x >> 8) - b[2] = byte(x >> 16) - b[3] = byte(x >> 24) -} - -// putUint64LE puts the uint64 value into the byte slice as little endian -// value. The byte slice b must have at least place for 8 bytes. -func putUint64LE(b []byte, x uint64) { - b[0] = byte(x) - b[1] = byte(x >> 8) - b[2] = byte(x >> 16) - b[3] = byte(x >> 24) - b[4] = byte(x >> 32) - b[5] = byte(x >> 40) - b[6] = byte(x >> 48) - b[7] = byte(x >> 56) -} - -// noHeaderSize defines the value of the length field in the LZMA header. -const noHeaderSize uint64 = 1<<64 - 1 - -// HeaderLen provides the length of the LZMA file header. -const HeaderLen = 13 - -// header represents the header of an LZMA file. -type header struct { - properties Properties - dictCap int - // uncompressed size; negative value if no size is given - size int64 -} - -// marshalBinary marshals the header. -func (h *header) marshalBinary() (data []byte, err error) { - if err = h.properties.verify(); err != nil { - return nil, err - } - if !(0 <= h.dictCap && int64(h.dictCap) <= MaxDictCap) { - return nil, fmt.Errorf("lzma: DictCap %d out of range", - h.dictCap) - } - - data = make([]byte, 13) - - // property byte - data[0] = h.properties.Code() - - // dictionary capacity - putUint32LE(data[1:5], uint32(h.dictCap)) - - // uncompressed size - var s uint64 - if h.size > 0 { - s = uint64(h.size) - } else { - s = noHeaderSize - } - putUint64LE(data[5:], s) - - return data, nil -} - -// unmarshalBinary unmarshals the header. -func (h *header) unmarshalBinary(data []byte) error { - if len(data) != HeaderLen { - return errors.New("lzma.unmarshalBinary: data has wrong length") - } - - // properties - var err error - if h.properties, err = PropertiesForCode(data[0]); err != nil { - return err - } - - // dictionary capacity - h.dictCap = int(uint32LE(data[1:])) - if h.dictCap < 0 { - return errors.New( - "LZMA header: dictionary capacity exceeds maximum " + - "integer") - } - - // uncompressed size - s := uint64LE(data[5:]) - if s == noHeaderSize { - h.size = -1 - } else { - h.size = int64(s) - if h.size < 0 { - return errors.New( - "LZMA header: uncompressed size " + - "out of int64 range") - } - } - - return nil -} - -// validDictCap checks whether the dictionary capacity is correct. This -// is used to weed out wrong file headers. -func validDictCap(dictcap int) bool { - if int64(dictcap) == MaxDictCap { - return true - } - for n := uint(10); n < 32; n++ { - if dictcap == 1<= 10 or 2^32-1. If -// there is an explicit size it must not exceed 256 GiB. The length of -// the data argument must be HeaderLen. -func ValidHeader(data []byte) bool { - var h header - if err := h.unmarshalBinary(data); err != nil { - return false - } - if !validDictCap(h.dictCap) { - return false - } - return h.size < 0 || h.size <= 1<<38 -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/header2.go b/vendor/github.com/ulikunitz/xz/lzma/header2.go deleted file mode 100644 index 081fc840b6..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/header2.go +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" - "io" -) - -const ( - // maximum size of compressed data in a chunk - maxCompressed = 1 << 16 - // maximum size of uncompressed data in a chunk - maxUncompressed = 1 << 21 -) - -// chunkType represents the type of an LZMA2 chunk. Note that this -// value is an internal representation and no actual encoding of a LZMA2 -// chunk header. -type chunkType byte - -// Possible values for the chunk type. -const ( - // end of stream - cEOS chunkType = iota - // uncompressed; reset dictionary - cUD - // uncompressed; no reset of dictionary - cU - // LZMA compressed; no reset - cL - // LZMA compressed; reset state - cLR - // LZMA compressed; reset state; new property value - cLRN - // LZMA compressed; reset state; new property value; reset dictionary - cLRND -) - -// chunkTypeStrings provide a string representation for the chunk types. -var chunkTypeStrings = [...]string{ - cEOS: "EOS", - cU: "U", - cUD: "UD", - cL: "L", - cLR: "LR", - cLRN: "LRN", - cLRND: "LRND", -} - -// String returns a string representation of the chunk type. -func (c chunkType) String() string { - if !(cEOS <= c && c <= cLRND) { - return "unknown" - } - return chunkTypeStrings[c] -} - -// Actual encodings for the chunk types in the value. Note that the high -// uncompressed size bits are stored in the header byte additionally. -const ( - hEOS = 0 - hUD = 1 - hU = 2 - hL = 1 << 7 - hLR = 1<<7 | 1<<5 - hLRN = 1<<7 | 1<<6 - hLRND = 1<<7 | 1<<6 | 1<<5 -) - -// errHeaderByte indicates an unsupported value for the chunk header -// byte. These bytes starts the variable-length chunk header. -var errHeaderByte = errors.New("lzma: unsupported chunk header byte") - -// headerChunkType converts the header byte into a chunk type. It -// ignores the uncompressed size bits in the chunk header byte. -func headerChunkType(h byte) (c chunkType, err error) { - if h&hL == 0 { - // no compression - switch h { - case hEOS: - c = cEOS - case hUD: - c = cUD - case hU: - c = cU - default: - return 0, errHeaderByte - } - return - } - switch h & hLRND { - case hL: - c = cL - case hLR: - c = cLR - case hLRN: - c = cLRN - case hLRND: - c = cLRND - default: - return 0, errHeaderByte - } - return -} - -// uncompressedHeaderLen provides the length of an uncompressed header -const uncompressedHeaderLen = 3 - -// headerLen returns the length of the LZMA2 header for a given chunk -// type. -func headerLen(c chunkType) int { - switch c { - case cEOS: - return 1 - case cU, cUD: - return uncompressedHeaderLen - case cL, cLR: - return 5 - case cLRN, cLRND: - return 6 - } - panic(fmt.Errorf("unsupported chunk type %d", c)) -} - -// chunkHeader represents the contents of a chunk header. -type chunkHeader struct { - ctype chunkType - uncompressed uint32 - compressed uint16 - props Properties -} - -// String returns a string representation of the chunk header. -func (h *chunkHeader) String() string { - return fmt.Sprintf("%s %d %d %s", h.ctype, h.uncompressed, - h.compressed, &h.props) -} - -// UnmarshalBinary reads the content of the chunk header from the data -// slice. The slice must have the correct length. -func (h *chunkHeader) UnmarshalBinary(data []byte) error { - if len(data) == 0 { - return errors.New("no data") - } - c, err := headerChunkType(data[0]) - if err != nil { - return err - } - - n := headerLen(c) - if len(data) < n { - return errors.New("incomplete data") - } - if len(data) > n { - return errors.New("invalid data length") - } - - *h = chunkHeader{ctype: c} - if c == cEOS { - return nil - } - - h.uncompressed = uint32(uint16BE(data[1:3])) - if c <= cU { - return nil - } - h.uncompressed |= uint32(data[0]&^hLRND) << 16 - - h.compressed = uint16BE(data[3:5]) - if c <= cLR { - return nil - } - - h.props, err = PropertiesForCode(data[5]) - return err -} - -// MarshalBinary encodes the chunk header value. The function checks -// whether the content of the chunk header is correct. -func (h *chunkHeader) MarshalBinary() (data []byte, err error) { - if h.ctype > cLRND { - return nil, errors.New("invalid chunk type") - } - if err = h.props.verify(); err != nil { - return nil, err - } - - data = make([]byte, headerLen(h.ctype)) - - switch h.ctype { - case cEOS: - return data, nil - case cUD: - data[0] = hUD - case cU: - data[0] = hU - case cL: - data[0] = hL - case cLR: - data[0] = hLR - case cLRN: - data[0] = hLRN - case cLRND: - data[0] = hLRND - } - - putUint16BE(data[1:3], uint16(h.uncompressed)) - if h.ctype <= cU { - return data, nil - } - data[0] |= byte(h.uncompressed>>16) &^ hLRND - - putUint16BE(data[3:5], h.compressed) - if h.ctype <= cLR { - return data, nil - } - - data[5] = h.props.Code() - return data, nil -} - -// readChunkHeader reads the chunk header from the IO reader. -func readChunkHeader(r io.Reader) (h *chunkHeader, err error) { - p := make([]byte, 1, 6) - if _, err = io.ReadFull(r, p); err != nil { - return - } - c, err := headerChunkType(p[0]) - if err != nil { - return - } - p = p[:headerLen(c)] - if _, err = io.ReadFull(r, p[1:]); err != nil { - return - } - h = new(chunkHeader) - if err = h.UnmarshalBinary(p); err != nil { - return nil, err - } - return h, nil -} - -// uint16BE converts a big-endian uint16 representation to an uint16 -// value. -func uint16BE(p []byte) uint16 { - return uint16(p[0])<<8 | uint16(p[1]) -} - -// putUint16BE puts the big-endian uint16 presentation into the given -// slice. -func putUint16BE(p []byte, x uint16) { - p[0] = byte(x >> 8) - p[1] = byte(x) -} - -// chunkState is used to manage the state of the chunks -type chunkState byte - -// start and stop define the initial and terminating state of the chunk -// state -const ( - start chunkState = 'S' - stop chunkState = 'T' -) - -// errors for the chunk state handling -var ( - errChunkType = errors.New("lzma: unexpected chunk type") - errState = errors.New("lzma: wrong chunk state") -) - -// next transitions state based on chunk type input -func (c *chunkState) next(ctype chunkType) error { - switch *c { - // start state - case 'S': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cLRND: - *c = 'L' - default: - return errChunkType - } - // normal LZMA mode - case 'L': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cU: - *c = 'U' - case cL, cLR, cLRN, cLRND: - break - default: - return errChunkType - } - // reset required - case 'R': - switch ctype { - case cEOS: - *c = 'T' - case cUD, cU: - break - case cLRN, cLRND: - *c = 'L' - default: - return errChunkType - } - // uncompressed - case 'U': - switch ctype { - case cEOS: - *c = 'T' - case cUD: - *c = 'R' - case cU: - break - case cL, cLR, cLRN, cLRND: - *c = 'L' - default: - return errChunkType - } - // terminal state - case 'T': - return errChunkType - default: - return errState - } - return nil -} - -// defaultChunkType returns the default chunk type for each chunk state. -func (c chunkState) defaultChunkType() chunkType { - switch c { - case 'S': - return cLRND - case 'L', 'U': - return cL - case 'R': - return cLRN - default: - // no error - return cEOS - } -} - -// maxDictCap defines the maximum dictionary capacity supported by the -// LZMA2 dictionary capacity encoding. -const maxDictCap = 1<<32 - 1 - -// maxDictCapCode defines the maximum dictionary capacity code. -const maxDictCapCode = 40 - -// The function decodes the dictionary capacity byte, but doesn't change -// for the correct range of the given byte. -func decodeDictCap(c byte) int64 { - return (2 | int64(c)&1) << (11 + (c>>1)&0x1f) -} - -// DecodeDictCap decodes the encoded dictionary capacity. The function -// returns an error if the code is out of range. -func DecodeDictCap(c byte) (n int64, err error) { - if c >= maxDictCapCode { - if c == maxDictCapCode { - return maxDictCap, nil - } - return 0, errors.New("lzma: invalid dictionary size code") - } - return decodeDictCap(c), nil -} - -// EncodeDictCap encodes a dictionary capacity. The function returns the -// code for the capacity that is greater or equal n. If n exceeds the -// maximum support dictionary capacity, the maximum value is returned. -func EncodeDictCap(n int64) byte { - a, b := byte(0), byte(40) - for a < b { - c := a + (b-a)>>1 - m := decodeDictCap(c) - if n <= m { - if n == m { - return c - } - b = c - } else { - a = c + 1 - } - } - return a -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go b/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go deleted file mode 100644 index 1ea5320a0c..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/lengthcodec.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import "errors" - -// maxPosBits defines the number of bits of the position value that are used to -// to compute the posState value. The value is used to select the tree codec -// for length encoding and decoding. -const maxPosBits = 4 - -// minMatchLen and maxMatchLen give the minimum and maximum values for -// encoding and decoding length values. minMatchLen is also used as base -// for the encoded length values. -const ( - minMatchLen = 2 - maxMatchLen = minMatchLen + 16 + 256 - 1 -) - -// lengthCodec support the encoding of the length value. -type lengthCodec struct { - choice [2]prob - low [1 << maxPosBits]treeCodec - mid [1 << maxPosBits]treeCodec - high treeCodec -} - -// deepcopy initializes the lc value as deep copy of the source value. -func (lc *lengthCodec) deepcopy(src *lengthCodec) { - if lc == src { - return - } - lc.choice = src.choice - for i := range lc.low { - lc.low[i].deepcopy(&src.low[i]) - } - for i := range lc.mid { - lc.mid[i].deepcopy(&src.mid[i]) - } - lc.high.deepcopy(&src.high) -} - -// init initializes a new length codec. -func (lc *lengthCodec) init() { - for i := range lc.choice { - lc.choice[i] = probInit - } - for i := range lc.low { - lc.low[i] = makeTreeCodec(3) - } - for i := range lc.mid { - lc.mid[i] = makeTreeCodec(3) - } - lc.high = makeTreeCodec(8) -} - -// Encode encodes the length offset. The length offset l can be compute by -// subtracting minMatchLen (2) from the actual length. -// -// l = length - minMatchLen -func (lc *lengthCodec) Encode(e *rangeEncoder, l uint32, posState uint32, -) (err error) { - if l > maxMatchLen-minMatchLen { - return errors.New("lengthCodec.Encode: l out of range") - } - if l < 8 { - if err = lc.choice[0].Encode(e, 0); err != nil { - return - } - return lc.low[posState].Encode(e, l) - } - if err = lc.choice[0].Encode(e, 1); err != nil { - return - } - if l < 16 { - if err = lc.choice[1].Encode(e, 0); err != nil { - return - } - return lc.mid[posState].Encode(e, l-8) - } - if err = lc.choice[1].Encode(e, 1); err != nil { - return - } - if err = lc.high.Encode(e, l-16); err != nil { - return - } - return nil -} - -// Decode reads the length offset. Add minMatchLen to compute the actual length -// to the length offset l. -func (lc *lengthCodec) Decode(d *rangeDecoder, posState uint32, -) (l uint32, err error) { - var b uint32 - if b, err = lc.choice[0].Decode(d); err != nil { - return - } - if b == 0 { - l, err = lc.low[posState].Decode(d) - return - } - if b, err = lc.choice[1].Decode(d); err != nil { - return - } - if b == 0 { - l, err = lc.mid[posState].Decode(d) - l += 8 - return - } - l, err = lc.high.Decode(d) - l += 16 - return -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go b/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go deleted file mode 100644 index e4ef5fc59c..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/literalcodec.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// literalCodec supports the encoding of literal. It provides 768 probability -// values per literal state. The upper 512 probabilities are used with the -// context of a match bit. -type literalCodec struct { - probs []prob -} - -// deepcopy initializes literal codec c as a deep copy of the source. -func (c *literalCodec) deepcopy(src *literalCodec) { - if c == src { - return - } - c.probs = make([]prob, len(src.probs)) - copy(c.probs, src.probs) -} - -// init initializes the literal codec. -func (c *literalCodec) init(lc, lp int) { - switch { - case !(minLC <= lc && lc <= maxLC): - panic("lc out of range") - case !(minLP <= lp && lp <= maxLP): - panic("lp out of range") - } - c.probs = make([]prob, 0x300<= 7 { - m := uint32(match) - for { - matchBit := (m >> 7) & 1 - m <<= 1 - bit := (r >> 7) & 1 - r <<= 1 - i := ((1 + matchBit) << 8) | symbol - if err = probs[i].Encode(e, bit); err != nil { - return - } - symbol = (symbol << 1) | bit - if matchBit != bit { - break - } - if symbol >= 0x100 { - break - } - } - } - for symbol < 0x100 { - bit := (r >> 7) & 1 - r <<= 1 - if err = probs[symbol].Encode(e, bit); err != nil { - return - } - symbol = (symbol << 1) | bit - } - return nil -} - -// Decode decodes a literal byte using the range decoder as well as the LZMA -// state, a match byte, and the literal state. -func (c *literalCodec) Decode(d *rangeDecoder, - state uint32, match byte, litState uint32, -) (s byte, err error) { - k := litState * 0x300 - probs := c.probs[k : k+0x300] - symbol := uint32(1) - if state >= 7 { - m := uint32(match) - for { - matchBit := (m >> 7) & 1 - m <<= 1 - i := ((1 + matchBit) << 8) | symbol - bit, err := d.DecodeBit(&probs[i]) - if err != nil { - return 0, err - } - symbol = (symbol << 1) | bit - if matchBit != bit { - break - } - if symbol >= 0x100 { - break - } - } - } - for symbol < 0x100 { - bit, err := d.DecodeBit(&probs[symbol]) - if err != nil { - return 0, err - } - symbol = (symbol << 1) | bit - } - s = byte(symbol - 0x100) - return s, nil -} - -// minLC and maxLC define the range for LC values. -const ( - minLC = 0 - maxLC = 8 -) - -// minLC and maxLC define the range for LP values. -const ( - minLP = 0 - maxLP = 4 -) diff --git a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go b/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go deleted file mode 100644 index 02dfb8bf51..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/matchalgorithm.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import "errors" - -// MatchAlgorithm identifies an algorithm to find matches in the -// dictionary. -type MatchAlgorithm byte - -// Supported matcher algorithms. -const ( - HashTable4 MatchAlgorithm = iota - BinaryTree -) - -// maStrings are used by the String method. -var maStrings = map[MatchAlgorithm]string{ - HashTable4: "HashTable4", - BinaryTree: "BinaryTree", -} - -// String returns a string representation of the Matcher. -func (a MatchAlgorithm) String() string { - if s, ok := maStrings[a]; ok { - return s - } - return "unknown" -} - -var errUnsupportedMatchAlgorithm = errors.New( - "lzma: unsupported match algorithm value") - -// verify checks whether the matcher value is supported. -func (a MatchAlgorithm) verify() error { - if _, ok := maStrings[a]; !ok { - return errUnsupportedMatchAlgorithm - } - return nil -} - -func (a MatchAlgorithm) new(dictCap int) (m matcher, err error) { - switch a { - case HashTable4: - return newHashTable(dictCap, 4) - case BinaryTree: - return newBinTree(dictCap) - } - return nil, errUnsupportedMatchAlgorithm -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/operation.go b/vendor/github.com/ulikunitz/xz/lzma/operation.go deleted file mode 100644 index 7b7eddc3d4..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/operation.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "fmt" - "unicode" -) - -// operation represents an operation on the dictionary during encoding or -// decoding. -type operation interface { - Len() int -} - -// rep represents a repetition at the given distance and the given length -type match struct { - // supports all possible distance values, including the eos marker - distance int64 - // length - n int -} - -// Len returns the number of bytes matched. -func (m match) Len() int { - return m.n -} - -// String returns a string representation for the repetition. -func (m match) String() string { - return fmt.Sprintf("M{%d,%d}", m.distance, m.n) -} - -// lit represents a single byte literal. -type lit struct { - b byte -} - -// Len returns 1 for the single byte literal. -func (l lit) Len() int { - return 1 -} - -// String returns a string representation for the literal. -func (l lit) String() string { - var c byte - if unicode.IsPrint(rune(l.b)) { - c = l.b - } else { - c = '.' - } - return fmt.Sprintf("L{%c/%02x}", c, l.b) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/prob.go b/vendor/github.com/ulikunitz/xz/lzma/prob.go deleted file mode 100644 index 2feccba11d..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/prob.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// movebits defines the number of bits used for the updates of probability -// values. -const movebits = 5 - -// probbits defines the number of bits of a probability value. -const probbits = 11 - -// probInit defines 0.5 as initial value for prob values. -const probInit prob = 1 << (probbits - 1) - -// Type prob represents probabilities. The type can also be used to encode and -// decode single bits. -type prob uint16 - -// Dec decreases the probability. The decrease is proportional to the -// probability value. -func (p *prob) dec() { - *p -= *p >> movebits -} - -// Inc increases the probability. The Increase is proportional to the -// difference of 1 and the probability value. -func (p *prob) inc() { - *p += ((1 << probbits) - *p) >> movebits -} - -// Computes the new bound for a given range using the probability value. -func (p prob) bound(r uint32) uint32 { - return (r >> probbits) * uint32(p) -} - -// Bits returns 1. One is the number of bits that can be encoded or decoded -// with a single prob value. -func (p prob) Bits() int { - return 1 -} - -// Encode encodes the least-significant bit of v. Note that the p value will be -// changed. -func (p *prob) Encode(e *rangeEncoder, v uint32) error { - return e.EncodeBit(v, p) -} - -// Decode decodes a single bit. Note that the p value will change. -func (p *prob) Decode(d *rangeDecoder) (v uint32, err error) { - return d.DecodeBit(p) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/properties.go b/vendor/github.com/ulikunitz/xz/lzma/properties.go deleted file mode 100644 index 15b754ccb9..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/properties.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "fmt" -) - -// maximum and minimum values for the LZMA properties. -const ( - minPB = 0 - maxPB = 4 -) - -// maxPropertyCode is the possible maximum of a properties code byte. -const maxPropertyCode = (maxPB+1)*(maxLP+1)*(maxLC+1) - 1 - -// Properties contains the parameters LC, LP and PB. The parameter LC -// defines the number of literal context bits; parameter LP the number -// of literal position bits and PB the number of position bits. -type Properties struct { - LC int - LP int - PB int -} - -// String returns the properties in a string representation. -func (p *Properties) String() string { - return fmt.Sprintf("LC %d LP %d PB %d", p.LC, p.LP, p.PB) -} - -// PropertiesForCode converts a properties code byte into a Properties value. -func PropertiesForCode(code byte) (p Properties, err error) { - if code > maxPropertyCode { - return p, errors.New("lzma: invalid properties code") - } - p.LC = int(code % 9) - code /= 9 - p.LP = int(code % 5) - code /= 5 - p.PB = int(code % 5) - return p, err -} - -// verify checks the properties for correctness. -func (p *Properties) verify() error { - if p == nil { - return errors.New("lzma: properties are nil") - } - if !(minLC <= p.LC && p.LC <= maxLC) { - return errors.New("lzma: lc out of range") - } - if !(minLP <= p.LP && p.LP <= maxLP) { - return errors.New("lzma: lp out of range") - } - if !(minPB <= p.PB && p.PB <= maxPB) { - return errors.New("lzma: pb out of range") - } - return nil -} - -// Code converts the properties to a byte. The function assumes that -// the properties components are all in range. -func (p Properties) Code() byte { - return byte((p.PB*5+p.LP)*9 + p.LC) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go b/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go deleted file mode 100644 index 4b0fee3ff8..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/rangecodec.go +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" -) - -// rangeEncoder implements range encoding of single bits. The low value can -// overflow therefore we need uint64. The cache value is used to handle -// overflows. -type rangeEncoder struct { - lbw *LimitedByteWriter - nrange uint32 - low uint64 - cacheLen int64 - cache byte -} - -// maxInt64 provides the maximal value of the int64 type -const maxInt64 = 1<<63 - 1 - -// newRangeEncoder creates a new range encoder. -func newRangeEncoder(bw io.ByteWriter) (re *rangeEncoder, err error) { - lbw, ok := bw.(*LimitedByteWriter) - if !ok { - lbw = &LimitedByteWriter{BW: bw, N: maxInt64} - } - return &rangeEncoder{ - lbw: lbw, - nrange: 0xffffffff, - cacheLen: 1}, nil -} - -// Available returns the number of bytes that still can be written. The -// method takes the bytes that will be currently written by Close into -// account. -func (e *rangeEncoder) Available() int64 { - return e.lbw.N - (e.cacheLen + 4) -} - -// writeByte writes a single byte to the underlying writer. An error is -// returned if the limit is reached. The written byte will be counted if -// the underlying writer doesn't return an error. -func (e *rangeEncoder) writeByte(c byte) error { - if e.Available() < 1 { - return ErrLimit - } - return e.lbw.WriteByte(c) -} - -// DirectEncodeBit encodes the least-significant bit of b with probability 1/2. -func (e *rangeEncoder) DirectEncodeBit(b uint32) error { - e.nrange >>= 1 - e.low += uint64(e.nrange) & (0 - (uint64(b) & 1)) - - // normalize - const top = 1 << 24 - if e.nrange >= top { - return nil - } - e.nrange <<= 8 - return e.shiftLow() -} - -// EncodeBit encodes the least significant bit of b. The p value will be -// updated by the function depending on the bit encoded. -func (e *rangeEncoder) EncodeBit(b uint32, p *prob) error { - bound := p.bound(e.nrange) - if b&1 == 0 { - e.nrange = bound - p.inc() - } else { - e.low += uint64(bound) - e.nrange -= bound - p.dec() - } - - // normalize - const top = 1 << 24 - if e.nrange >= top { - return nil - } - e.nrange <<= 8 - return e.shiftLow() -} - -// Close writes a complete copy of the low value. -func (e *rangeEncoder) Close() error { - for i := 0; i < 5; i++ { - if err := e.shiftLow(); err != nil { - return err - } - } - return nil -} - -// shiftLow shifts the low value for 8 bit. The shifted byte is written into -// the byte writer. The cache value is used to handle overflows. -func (e *rangeEncoder) shiftLow() error { - if uint32(e.low) < 0xff000000 || (e.low>>32) != 0 { - tmp := e.cache - for { - err := e.writeByte(tmp + byte(e.low>>32)) - if err != nil { - return err - } - tmp = 0xff - e.cacheLen-- - if e.cacheLen <= 0 { - if e.cacheLen < 0 { - panic("negative cacheLen") - } - break - } - } - e.cache = byte(uint32(e.low) >> 24) - } - e.cacheLen++ - e.low = uint64(uint32(e.low) << 8) - return nil -} - -// rangeDecoder decodes single bits of the range encoding stream. -type rangeDecoder struct { - br io.ByteReader - nrange uint32 - code uint32 -} - -// newRangeDecoder initializes a range decoder. It reads five bytes from the -// reader and therefore may return an error. -func newRangeDecoder(br io.ByteReader) (d *rangeDecoder, err error) { - d = &rangeDecoder{br: br, nrange: 0xffffffff} - - b, err := d.br.ReadByte() - if err != nil { - return nil, err - } - if b != 0 { - return nil, errors.New("newRangeDecoder: first byte not zero") - } - - for i := 0; i < 4; i++ { - if err = d.updateCode(); err != nil { - return nil, err - } - } - - if d.code >= d.nrange { - return nil, errors.New("newRangeDecoder: d.code >= d.nrange") - } - - return d, nil -} - -// possiblyAtEnd checks whether the decoder may be at the end of the stream. -func (d *rangeDecoder) possiblyAtEnd() bool { - return d.code == 0 -} - -// DirectDecodeBit decodes a bit with probability 1/2. The return value b will -// contain the bit at the least-significant position. All other bits will be -// zero. -func (d *rangeDecoder) DirectDecodeBit() (b uint32, err error) { - d.nrange >>= 1 - d.code -= d.nrange - t := 0 - (d.code >> 31) - d.code += d.nrange & t - b = (t + 1) & 1 - - // d.code will stay less then d.nrange - - // normalize - // assume d.code < d.nrange - const top = 1 << 24 - if d.nrange >= top { - return b, nil - } - d.nrange <<= 8 - // d.code < d.nrange will be maintained - return b, d.updateCode() -} - -// decodeBit decodes a single bit. The bit will be returned at the -// least-significant position. All other bits will be zero. The probability -// value will be updated. -func (d *rangeDecoder) DecodeBit(p *prob) (b uint32, err error) { - bound := p.bound(d.nrange) - if d.code < bound { - d.nrange = bound - p.inc() - b = 0 - } else { - d.code -= bound - d.nrange -= bound - p.dec() - b = 1 - } - // normalize - // assume d.code < d.nrange - const top = 1 << 24 - if d.nrange >= top { - return b, nil - } - d.nrange <<= 8 - // d.code < d.nrange will be maintained - return b, d.updateCode() -} - -// updateCode reads a new byte into the code. -func (d *rangeDecoder) updateCode() error { - b, err := d.br.ReadByte() - if err != nil { - return err - } - d.code = (d.code << 8) | uint32(b) - return nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader.go b/vendor/github.com/ulikunitz/xz/lzma/reader.go deleted file mode 100644 index ae911c3893..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/reader.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lzma supports the decoding and encoding of LZMA streams. -// Reader and Writer support the classic LZMA format. Reader2 and -// Writer2 support the decoding and encoding of LZMA2 streams. -// -// The package is written completely in Go and doesn't rely on any external -// library. -package lzma - -import ( - "errors" - "io" -) - -// ReaderConfig stores the parameters for the reader of the classic LZMA -// format. -type ReaderConfig struct { - DictCap int -} - -// fill converts the zero values of the configuration to the default values. -func (c *ReaderConfig) fill() { - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } -} - -// Verify checks the reader configuration for errors. Zero values will -// be replaced by default values. -func (c *ReaderConfig) Verify() error { - c.fill() - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - return nil -} - -// Reader provides a reader for LZMA files or streams. -type Reader struct { - lzma io.Reader - h header - d *decoder -} - -// NewReader creates a new reader for an LZMA stream using the classic -// format. NewReader reads and checks the header of the LZMA stream. -func NewReader(lzma io.Reader) (r *Reader, err error) { - return ReaderConfig{}.NewReader(lzma) -} - -// NewReader creates a new reader for an LZMA stream in the classic -// format. The function reads and verifies the the header of the LZMA -// stream. -func (c ReaderConfig) NewReader(lzma io.Reader) (r *Reader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - data := make([]byte, HeaderLen) - if _, err := io.ReadFull(lzma, data); err != nil { - if err == io.EOF { - return nil, errors.New("lzma: unexpected EOF") - } - return nil, err - } - r = &Reader{lzma: lzma} - if err = r.h.unmarshalBinary(data); err != nil { - return nil, err - } - if r.h.dictCap < MinDictCap { - r.h.dictCap = MinDictCap - } - dictCap := r.h.dictCap - if c.DictCap > dictCap { - dictCap = c.DictCap - } - - state := newState(r.h.properties) - dict, err := newDecoderDict(dictCap) - if err != nil { - return nil, err - } - r.d, err = newDecoder(ByteReader(lzma), state, dict, r.h.size) - if err != nil { - return nil, err - } - return r, nil -} - -// EOSMarker indicates that an EOS marker has been encountered. -func (r *Reader) EOSMarker() bool { - return r.d.eosMarker -} - -// Read returns uncompressed data. -func (r *Reader) Read(p []byte) (n int, err error) { - return r.d.Read(p) -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/reader2.go b/vendor/github.com/ulikunitz/xz/lzma/reader2.go deleted file mode 100644 index f36e265050..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/reader2.go +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "errors" - "io" - - "github.com/ulikunitz/xz/internal/xlog" -) - -// Reader2Config stores the parameters for the LZMA2 reader. -// format. -type Reader2Config struct { - DictCap int -} - -// fill converts the zero values of the configuration to the default values. -func (c *Reader2Config) fill() { - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } -} - -// Verify checks the reader configuration for errors. Zero configuration values -// will be replaced by default values. -func (c *Reader2Config) Verify() error { - c.fill() - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - return nil -} - -// Reader2 supports the reading of LZMA2 chunk sequences. Note that the -// first chunk should have a dictionary reset and the first compressed -// chunk a properties reset. The chunk sequence may not be terminated by -// an end-of-stream chunk. -type Reader2 struct { - r io.Reader - err error - - dict *decoderDict - ur *uncompressedReader - decoder *decoder - chunkReader io.Reader - - cstate chunkState -} - -// NewReader2 creates a reader for an LZMA2 chunk sequence. -func NewReader2(lzma2 io.Reader) (r *Reader2, err error) { - return Reader2Config{}.NewReader2(lzma2) -} - -// NewReader2 creates an LZMA2 reader using the given configuration. -func (c Reader2Config) NewReader2(lzma2 io.Reader) (r *Reader2, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - r = &Reader2{r: lzma2, cstate: start} - r.dict, err = newDecoderDict(c.DictCap) - if err != nil { - return nil, err - } - if err = r.startChunk(); err != nil { - r.err = err - } - return r, nil -} - -// uncompressed tests whether the chunk type specifies an uncompressed -// chunk. -func uncompressed(ctype chunkType) bool { - return ctype == cU || ctype == cUD -} - -// startChunk parses a new chunk. -func (r *Reader2) startChunk() error { - r.chunkReader = nil - header, err := readChunkHeader(r.r) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - xlog.Debugf("chunk header %v", header) - if err = r.cstate.next(header.ctype); err != nil { - return err - } - if r.cstate == stop { - return io.EOF - } - if header.ctype == cUD || header.ctype == cLRND { - r.dict.Reset() - } - size := int64(header.uncompressed) + 1 - if uncompressed(header.ctype) { - if r.ur != nil { - r.ur.Reopen(r.r, size) - } else { - r.ur = newUncompressedReader(r.r, r.dict, size) - } - r.chunkReader = r.ur - return nil - } - br := ByteReader(io.LimitReader(r.r, int64(header.compressed)+1)) - if r.decoder == nil { - state := newState(header.props) - r.decoder, err = newDecoder(br, state, r.dict, size) - if err != nil { - return err - } - r.chunkReader = r.decoder - return nil - } - switch header.ctype { - case cLR: - r.decoder.State.Reset() - case cLRN, cLRND: - r.decoder.State = newState(header.props) - } - err = r.decoder.Reopen(br, size) - if err != nil { - return err - } - r.chunkReader = r.decoder - return nil -} - -// Read reads data from the LZMA2 chunk sequence. -func (r *Reader2) Read(p []byte) (n int, err error) { - if r.err != nil { - return 0, r.err - } - for n < len(p) { - var k int - k, err = r.chunkReader.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - err = r.startChunk() - if err == nil { - continue - } - } - r.err = err - return n, err - } - if k == 0 { - r.err = errors.New("lzma: Reader2 doesn't get data") - return n, r.err - } - } - return n, nil -} - -// EOS returns whether the LZMA2 stream has been terminated by an -// end-of-stream chunk. -func (r *Reader2) EOS() bool { - return r.cstate == stop -} - -// uncompressedReader is used to read uncompressed chunks. -type uncompressedReader struct { - lr io.LimitedReader - Dict *decoderDict - eof bool - err error -} - -// newUncompressedReader initializes a new uncompressedReader. -func newUncompressedReader(r io.Reader, dict *decoderDict, size int64) *uncompressedReader { - ur := &uncompressedReader{ - lr: io.LimitedReader{R: r, N: size}, - Dict: dict, - } - return ur -} - -// Reopen reinitializes an uncompressed reader. -func (ur *uncompressedReader) Reopen(r io.Reader, size int64) { - ur.err = nil - ur.eof = false - ur.lr = io.LimitedReader{R: r, N: size} -} - -// fill reads uncompressed data into the dictionary. -func (ur *uncompressedReader) fill() error { - if !ur.eof { - n, err := io.CopyN(ur.Dict, &ur.lr, int64(ur.Dict.Available())) - if err != io.EOF { - return err - } - ur.eof = true - if n > 0 { - return nil - } - } - if ur.lr.N != 0 { - return io.ErrUnexpectedEOF - } - return io.EOF -} - -// Read reads uncompressed data from the limited reader. -func (ur *uncompressedReader) Read(p []byte) (n int, err error) { - if ur.err != nil { - return 0, ur.err - } - for { - var k int - k, err = ur.Dict.Read(p[n:]) - n += k - if n >= len(p) { - return n, nil - } - if err != nil { - break - } - err = ur.fill() - if err != nil { - break - } - } - ur.err = err - return n, err -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/state.go b/vendor/github.com/ulikunitz/xz/lzma/state.go deleted file mode 100644 index 34779c513c..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/state.go +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// states defines the overall state count -const states = 12 - -// State maintains the full state of the operation encoding or decoding -// process. -type state struct { - rep [4]uint32 - isMatch [states << maxPosBits]prob - isRepG0Long [states << maxPosBits]prob - isRep [states]prob - isRepG0 [states]prob - isRepG1 [states]prob - isRepG2 [states]prob - litCodec literalCodec - lenCodec lengthCodec - repLenCodec lengthCodec - distCodec distCodec - state uint32 - posBitMask uint32 - Properties Properties -} - -// initProbSlice initializes a slice of probabilities. -func initProbSlice(p []prob) { - for i := range p { - p[i] = probInit - } -} - -// Reset sets all state information to the original values. -func (s *state) Reset() { - p := s.Properties - *s = state{ - Properties: p, - // dict: s.dict, - posBitMask: (uint32(1) << uint(p.PB)) - 1, - } - initProbSlice(s.isMatch[:]) - initProbSlice(s.isRep[:]) - initProbSlice(s.isRepG0[:]) - initProbSlice(s.isRepG1[:]) - initProbSlice(s.isRepG2[:]) - initProbSlice(s.isRepG0Long[:]) - s.litCodec.init(p.LC, p.LP) - s.lenCodec.init() - s.repLenCodec.init() - s.distCodec.init() -} - -// newState creates a new state from the give Properties. -func newState(p Properties) *state { - s := &state{Properties: p} - s.Reset() - return s -} - -// deepcopy initializes s as a deep copy of the source. -func (s *state) deepcopy(src *state) { - if s == src { - return - } - s.rep = src.rep - s.isMatch = src.isMatch - s.isRepG0Long = src.isRepG0Long - s.isRep = src.isRep - s.isRepG0 = src.isRepG0 - s.isRepG1 = src.isRepG1 - s.isRepG2 = src.isRepG2 - s.litCodec.deepcopy(&src.litCodec) - s.lenCodec.deepcopy(&src.lenCodec) - s.repLenCodec.deepcopy(&src.repLenCodec) - s.distCodec.deepcopy(&src.distCodec) - s.state = src.state - s.posBitMask = src.posBitMask - s.Properties = src.Properties -} - -// cloneState creates a new clone of the give state. -func cloneState(src *state) *state { - s := new(state) - s.deepcopy(src) - return s -} - -// updateStateLiteral updates the state for a literal. -func (s *state) updateStateLiteral() { - switch { - case s.state < 4: - s.state = 0 - return - case s.state < 10: - s.state -= 3 - return - } - s.state -= 6 -} - -// updateStateMatch updates the state for a match. -func (s *state) updateStateMatch() { - if s.state < 7 { - s.state = 7 - } else { - s.state = 10 - } -} - -// updateStateRep updates the state for a repetition. -func (s *state) updateStateRep() { - if s.state < 7 { - s.state = 8 - } else { - s.state = 11 - } -} - -// updateStateShortRep updates the state for a short repetition. -func (s *state) updateStateShortRep() { - if s.state < 7 { - s.state = 9 - } else { - s.state = 11 - } -} - -// states computes the states of the operation codec. -func (s *state) states(dictHead int64) (state1, state2, posState uint32) { - state1 = s.state - posState = uint32(dictHead) & s.posBitMask - state2 = (s.state << maxPosBits) | posState - return -} - -// litState computes the literal state. -func (s *state) litState(prev byte, dictHead int64) uint32 { - lp, lc := uint(s.Properties.LP), uint(s.Properties.LC) - litState := ((uint32(dictHead) & ((1 << lp) - 1)) << lc) | - (uint32(prev) >> (8 - lc)) - return litState -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go b/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go deleted file mode 100644 index 36b29b5982..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/treecodecs.go +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -// treeCodec encodes or decodes values with a fixed bit size. It is using a -// tree of probability value. The root of the tree is the most-significant bit. -type treeCodec struct { - probTree -} - -// makeTreeCodec makes a tree codec. The bits value must be inside the range -// [1,32]. -func makeTreeCodec(bits int) treeCodec { - return treeCodec{makeProbTree(bits)} -} - -// deepcopy initializes tc as a deep copy of the source. -func (tc *treeCodec) deepcopy(src *treeCodec) { - tc.probTree.deepcopy(&src.probTree) -} - -// Encode uses the range encoder to encode a fixed-bit-size value. -func (tc *treeCodec) Encode(e *rangeEncoder, v uint32) (err error) { - m := uint32(1) - for i := int(tc.bits) - 1; i >= 0; i-- { - b := (v >> uint(i)) & 1 - if err := e.EncodeBit(b, &tc.probs[m]); err != nil { - return err - } - m = (m << 1) | b - } - return nil -} - -// Decodes uses the range decoder to decode a fixed-bit-size value. Errors may -// be caused by the range decoder. -func (tc *treeCodec) Decode(d *rangeDecoder) (v uint32, err error) { - m := uint32(1) - for j := 0; j < int(tc.bits); j++ { - b, err := d.DecodeBit(&tc.probs[m]) - if err != nil { - return 0, err - } - m = (m << 1) | b - } - return m - (1 << uint(tc.bits)), nil -} - -// treeReverseCodec is another tree codec, where the least-significant bit is -// the start of the probability tree. -type treeReverseCodec struct { - probTree -} - -// deepcopy initializes the treeReverseCodec as a deep copy of the -// source. -func (tc *treeReverseCodec) deepcopy(src *treeReverseCodec) { - tc.probTree.deepcopy(&src.probTree) -} - -// makeTreeReverseCodec creates treeReverseCodec value. The bits argument must -// be in the range [1,32]. -func makeTreeReverseCodec(bits int) treeReverseCodec { - return treeReverseCodec{makeProbTree(bits)} -} - -// Encode uses range encoder to encode a fixed-bit-size value. The range -// encoder may cause errors. -func (tc *treeReverseCodec) Encode(v uint32, e *rangeEncoder) (err error) { - m := uint32(1) - for i := uint(0); i < uint(tc.bits); i++ { - b := (v >> i) & 1 - if err := e.EncodeBit(b, &tc.probs[m]); err != nil { - return err - } - m = (m << 1) | b - } - return nil -} - -// Decodes uses the range decoder to decode a fixed-bit-size value. Errors -// returned by the range decoder will be returned. -func (tc *treeReverseCodec) Decode(d *rangeDecoder) (v uint32, err error) { - m := uint32(1) - for j := uint(0); j < uint(tc.bits); j++ { - b, err := d.DecodeBit(&tc.probs[m]) - if err != nil { - return 0, err - } - m = (m << 1) | b - v |= b << j - } - return v, nil -} - -// probTree stores enough probability values to be used by the treeEncode and -// treeDecode methods of the range coder types. -type probTree struct { - probs []prob - bits byte -} - -// deepcopy initializes the probTree value as a deep copy of the source. -func (t *probTree) deepcopy(src *probTree) { - if t == src { - return - } - t.probs = make([]prob, len(src.probs)) - copy(t.probs, src.probs) - t.bits = src.bits -} - -// makeProbTree initializes a probTree structure. -func makeProbTree(bits int) probTree { - if !(1 <= bits && bits <= 32) { - panic("bits outside of range [1,32]") - } - t := probTree{ - bits: byte(bits), - probs: make([]prob, 1< 0 { - c.SizeInHeader = true - } - if !c.SizeInHeader { - c.EOSMarker = true - } -} - -// Verify checks WriterConfig for errors. Verify will replace zero -// values with default values. -func (c *WriterConfig) Verify() error { - c.fill() - var err error - if c == nil { - return errors.New("lzma: WriterConfig is nil") - } - if c.Properties == nil { - return errors.New("lzma: WriterConfig has no Properties set") - } - if err = c.Properties.verify(); err != nil { - return err - } - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - if !(maxMatchLen <= c.BufSize) { - return errors.New("lzma: lookahead buffer size too small") - } - if c.SizeInHeader { - if c.Size < 0 { - return errors.New("lzma: negative size not supported") - } - } else if !c.EOSMarker { - return errors.New("lzma: EOS marker is required") - } - if err = c.Matcher.verify(); err != nil { - return err - } - - return nil -} - -// header returns the header structure for this configuration. -func (c *WriterConfig) header() header { - h := header{ - properties: *c.Properties, - dictCap: c.DictCap, - size: -1, - } - if c.SizeInHeader { - h.size = c.Size - } - return h -} - -// Writer writes an LZMA stream in the classic format. -type Writer struct { - h header - bw io.ByteWriter - buf *bufio.Writer - e *encoder -} - -// NewWriter creates a new LZMA writer for the classic format. The -// method will write the header to the underlying stream. -func (c WriterConfig) NewWriter(lzma io.Writer) (w *Writer, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer{h: c.header()} - - var ok bool - w.bw, ok = lzma.(io.ByteWriter) - if !ok { - w.buf = bufio.NewWriter(lzma) - w.bw = w.buf - } - state := newState(w.h.properties) - m, err := c.Matcher.new(w.h.dictCap) - if err != nil { - return nil, err - } - dict, err := newEncoderDict(w.h.dictCap, c.BufSize, m) - if err != nil { - return nil, err - } - var flags encoderFlags - if c.EOSMarker { - flags = eosMarker - } - if w.e, err = newEncoder(w.bw, state, dict, flags); err != nil { - return nil, err - } - - if err = w.writeHeader(); err != nil { - return nil, err - } - return w, nil -} - -// NewWriter creates a new LZMA writer using the classic format. The -// function writes the header to the underlying stream. -func NewWriter(lzma io.Writer) (w *Writer, err error) { - return WriterConfig{}.NewWriter(lzma) -} - -// writeHeader writes the LZMA header into the stream. -func (w *Writer) writeHeader() error { - data, err := w.h.marshalBinary() - if err != nil { - return err - } - _, err = w.bw.(io.Writer).Write(data) - return err -} - -// Write puts data into the Writer. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.h.size >= 0 { - m := w.h.size - m -= w.e.Compressed() + int64(w.e.dict.Buffered()) - if m < 0 { - m = 0 - } - if m < int64(len(p)) { - p = p[:m] - err = ErrNoSpace - } - } - var werr error - if n, werr = w.e.Write(p); werr != nil { - err = werr - } - return n, err -} - -// Close closes the writer stream. It ensures that all data from the -// buffer will be compressed and the LZMA stream will be finished. -func (w *Writer) Close() error { - if w.h.size >= 0 { - n := w.e.Compressed() + int64(w.e.dict.Buffered()) - if n != w.h.size { - return errSize - } - } - err := w.e.Close() - if w.buf != nil { - ferr := w.buf.Flush() - if err == nil { - err = ferr - } - } - return err -} diff --git a/vendor/github.com/ulikunitz/xz/lzma/writer2.go b/vendor/github.com/ulikunitz/xz/lzma/writer2.go deleted file mode 100644 index 97bbafa116..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzma/writer2.go +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lzma - -import ( - "bytes" - "errors" - "io" -) - -// Writer2Config is used to create a Writer2 using parameters. -type Writer2Config struct { - // The properties for the encoding. If the it is nil the value - // {LC: 3, LP: 0, PB: 2} will be chosen. - Properties *Properties - // The capacity of the dictionary. If DictCap is zero, the value - // 8 MiB will be chosen. - DictCap int - // Size of the lookahead buffer; value 0 indicates default size - // 4096 - BufSize int - // Match algorithm - Matcher MatchAlgorithm -} - -// fill replaces zero values with default values. -func (c *Writer2Config) fill() { - if c.Properties == nil { - c.Properties = &Properties{LC: 3, LP: 0, PB: 2} - } - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } - if c.BufSize == 0 { - c.BufSize = 4096 - } -} - -// Verify checks the Writer2Config for correctness. Zero values will be -// replaced by default values. -func (c *Writer2Config) Verify() error { - c.fill() - var err error - if c == nil { - return errors.New("lzma: WriterConfig is nil") - } - if c.Properties == nil { - return errors.New("lzma: WriterConfig has no Properties set") - } - if err = c.Properties.verify(); err != nil { - return err - } - if !(MinDictCap <= c.DictCap && int64(c.DictCap) <= MaxDictCap) { - return errors.New("lzma: dictionary capacity is out of range") - } - if !(maxMatchLen <= c.BufSize) { - return errors.New("lzma: lookahead buffer size too small") - } - if c.Properties.LC+c.Properties.LP > 4 { - return errors.New("lzma: sum of lc and lp exceeds 4") - } - if err = c.Matcher.verify(); err != nil { - return err - } - return nil -} - -// Writer2 supports the creation of an LZMA2 stream. But note that -// written data is buffered, so call Flush or Close to write data to the -// underlying writer. The Close method writes the end-of-stream marker -// to the stream. So you may be able to concatenate the output of two -// writers as long the output of the first writer has only been flushed -// but not closed. -// -// Any change to the fields Properties, DictCap must be done before the -// first call to Write, Flush or Close. -type Writer2 struct { - w io.Writer - - start *state - encoder *encoder - - cstate chunkState - ctype chunkType - - buf bytes.Buffer - lbw LimitedByteWriter -} - -// NewWriter2 creates an LZMA2 chunk sequence writer with the default -// parameters and options. -func NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { - return Writer2Config{}.NewWriter2(lzma2) -} - -// NewWriter2 creates a new LZMA2 writer using the given configuration. -func (c Writer2Config) NewWriter2(lzma2 io.Writer) (w *Writer2, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer2{ - w: lzma2, - start: newState(*c.Properties), - cstate: start, - ctype: start.defaultChunkType(), - } - w.buf.Grow(maxCompressed) - w.lbw = LimitedByteWriter{BW: &w.buf, N: maxCompressed} - m, err := c.Matcher.new(c.DictCap) - if err != nil { - return nil, err - } - d, err := newEncoderDict(c.DictCap, c.BufSize, m) - if err != nil { - return nil, err - } - w.encoder, err = newEncoder(&w.lbw, cloneState(w.start), d, 0) - if err != nil { - return nil, err - } - return w, nil -} - -// written returns the number of bytes written to the current chunk -func (w *Writer2) written() int { - if w.encoder == nil { - return 0 - } - return int(w.encoder.Compressed()) + w.encoder.dict.Buffered() -} - -// errClosed indicates that the writer is closed. -var errClosed = errors.New("lzma: writer closed") - -// Writes data to LZMA2 stream. Note that written data will be buffered. -// Use Flush or Close to ensure that data is written to the underlying -// writer. -func (w *Writer2) Write(p []byte) (n int, err error) { - if w.cstate == stop { - return 0, errClosed - } - for n < len(p) { - m := maxUncompressed - w.written() - if m <= 0 { - panic("lzma: maxUncompressed reached") - } - var q []byte - if n+m < len(p) { - q = p[n : n+m] - } else { - q = p[n:] - } - k, err := w.encoder.Write(q) - n += k - if err != nil && err != ErrLimit { - return n, err - } - if err == ErrLimit || k == m { - if err = w.flushChunk(); err != nil { - return n, err - } - } - } - return n, nil -} - -// writeUncompressedChunk writes an uncompressed chunk to the LZMA2 -// stream. -func (w *Writer2) writeUncompressedChunk() error { - u := w.encoder.Compressed() - if u <= 0 { - return errors.New("lzma: can't write empty uncompressed chunk") - } - if u > maxUncompressed { - panic("overrun of uncompressed data limit") - } - switch w.ctype { - case cLRND: - w.ctype = cUD - default: - w.ctype = cU - } - w.encoder.state = w.start - - header := chunkHeader{ - ctype: w.ctype, - uncompressed: uint32(u - 1), - } - hdata, err := header.MarshalBinary() - if err != nil { - return err - } - if _, err = w.w.Write(hdata); err != nil { - return err - } - _, err = w.encoder.dict.CopyN(w.w, int(u)) - return err -} - -// writeCompressedChunk writes a compressed chunk to the underlying -// writer. -func (w *Writer2) writeCompressedChunk() error { - if w.ctype == cU || w.ctype == cUD { - panic("chunk type uncompressed") - } - - u := w.encoder.Compressed() - if u <= 0 { - return errors.New("writeCompressedChunk: empty chunk") - } - if u > maxUncompressed { - panic("overrun of uncompressed data limit") - } - c := w.buf.Len() - if c <= 0 { - panic("no compressed data") - } - if c > maxCompressed { - panic("overrun of compressed data limit") - } - header := chunkHeader{ - ctype: w.ctype, - uncompressed: uint32(u - 1), - compressed: uint16(c - 1), - props: w.encoder.state.Properties, - } - hdata, err := header.MarshalBinary() - if err != nil { - return err - } - if _, err = w.w.Write(hdata); err != nil { - return err - } - _, err = io.Copy(w.w, &w.buf) - return err -} - -// writes a single chunk to the underlying writer. -func (w *Writer2) writeChunk() error { - u := int(uncompressedHeaderLen + w.encoder.Compressed()) - c := headerLen(w.ctype) + w.buf.Len() - if u < c { - return w.writeUncompressedChunk() - } - return w.writeCompressedChunk() -} - -// flushChunk terminates the current chunk. The encoder will be reset -// to support the next chunk. -func (w *Writer2) flushChunk() error { - if w.written() == 0 { - return nil - } - var err error - if err = w.encoder.Close(); err != nil { - return err - } - if err = w.writeChunk(); err != nil { - return err - } - w.buf.Reset() - w.lbw.N = maxCompressed - if err = w.encoder.Reopen(&w.lbw); err != nil { - return err - } - if err = w.cstate.next(w.ctype); err != nil { - return err - } - w.ctype = w.cstate.defaultChunkType() - w.start = cloneState(w.encoder.state) - return nil -} - -// Flush writes all buffered data out to the underlying stream. This -// could result in multiple chunks to be created. -func (w *Writer2) Flush() error { - if w.cstate == stop { - return errClosed - } - for w.written() > 0 { - if err := w.flushChunk(); err != nil { - return err - } - } - return nil -} - -// Close terminates the LZMA2 stream with an EOS chunk. -func (w *Writer2) Close() error { - if w.cstate == stop { - return errClosed - } - if err := w.Flush(); err != nil { - return nil - } - // write zero byte EOS chunk - _, err := w.w.Write([]byte{0}) - if err != nil { - return err - } - w.cstate = stop - return nil -} diff --git a/vendor/github.com/ulikunitz/xz/lzmafilter.go b/vendor/github.com/ulikunitz/xz/lzmafilter.go deleted file mode 100644 index bd5f42ee82..0000000000 --- a/vendor/github.com/ulikunitz/xz/lzmafilter.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "fmt" - "io" - - "github.com/ulikunitz/xz/lzma" -) - -// LZMA filter constants. -const ( - lzmaFilterID = 0x21 - lzmaFilterLen = 3 -) - -// lzmaFilter declares the LZMA2 filter information stored in an xz -// block header. -type lzmaFilter struct { - dictCap int64 -} - -// String returns a representation of the LZMA filter. -func (f lzmaFilter) String() string { - return fmt.Sprintf("LZMA dict cap %#x", f.dictCap) -} - -// id returns the ID for the LZMA2 filter. -func (f lzmaFilter) id() uint64 { return lzmaFilterID } - -// MarshalBinary converts the lzmaFilter in its encoded representation. -func (f lzmaFilter) MarshalBinary() (data []byte, err error) { - c := lzma.EncodeDictCap(f.dictCap) - return []byte{lzmaFilterID, 1, c}, nil -} - -// UnmarshalBinary unmarshals the given data representation of the LZMA2 -// filter. -func (f *lzmaFilter) UnmarshalBinary(data []byte) error { - if len(data) != lzmaFilterLen { - return errors.New("xz: data for LZMA2 filter has wrong length") - } - if data[0] != lzmaFilterID { - return errors.New("xz: wrong LZMA2 filter id") - } - if data[1] != 1 { - return errors.New("xz: wrong LZMA2 filter size") - } - dc, err := lzma.DecodeDictCap(data[2]) - if err != nil { - return errors.New("xz: wrong LZMA2 dictionary size property") - } - - f.dictCap = dc - return nil -} - -// reader creates a new reader for the LZMA2 filter. -func (f lzmaFilter) reader(r io.Reader, c *ReaderConfig) (fr io.Reader, - err error) { - - config := new(lzma.Reader2Config) - if c != nil { - config.DictCap = c.DictCap - } - dc := int(f.dictCap) - if dc < 1 { - return nil, errors.New("xz: LZMA2 filter parameter " + - "dictionary capacity overflow") - } - if dc > config.DictCap { - config.DictCap = dc - } - - fr, err = config.NewReader2(r) - if err != nil { - return nil, err - } - return fr, nil -} - -// writeCloser creates a io.WriteCloser for the LZMA2 filter. -func (f lzmaFilter) writeCloser(w io.WriteCloser, c *WriterConfig, -) (fw io.WriteCloser, err error) { - config := new(lzma.Writer2Config) - if c != nil { - *config = lzma.Writer2Config{ - Properties: c.Properties, - DictCap: c.DictCap, - BufSize: c.BufSize, - Matcher: c.Matcher, - } - } - - dc := int(f.dictCap) - if dc < 1 { - return nil, errors.New("xz: LZMA2 filter parameter " + - "dictionary capacity overflow") - } - if dc > config.DictCap { - config.DictCap = dc - } - - fw, err = config.NewWriter2(w) - if err != nil { - return nil, err - } - return fw, nil -} - -// last returns true, because an LZMA2 filter must be the last filter in -// the filter list. -func (f lzmaFilter) last() bool { return true } diff --git a/vendor/github.com/ulikunitz/xz/make-docs b/vendor/github.com/ulikunitz/xz/make-docs deleted file mode 100644 index a8c612ce17..0000000000 --- a/vendor/github.com/ulikunitz/xz/make-docs +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -x -pandoc -t html5 -f markdown -s --css=doc/md.css -o README.html README.md -pandoc -t html5 -f markdown -s --css=doc/md.css -o TODO.html TODO.md diff --git a/vendor/github.com/ulikunitz/xz/none-check.go b/vendor/github.com/ulikunitz/xz/none-check.go deleted file mode 100644 index 6a56a26128..0000000000 --- a/vendor/github.com/ulikunitz/xz/none-check.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import "hash" - -type noneHash struct{} - -func (h noneHash) Write(p []byte) (n int, err error) { return len(p), nil } - -func (h noneHash) Sum(b []byte) []byte { return b } - -func (h noneHash) Reset() {} - -func (h noneHash) Size() int { return 0 } - -func (h noneHash) BlockSize() int { return 0 } - -func newNoneHash() hash.Hash { - return &noneHash{} -} diff --git a/vendor/github.com/ulikunitz/xz/reader.go b/vendor/github.com/ulikunitz/xz/reader.go deleted file mode 100644 index bde1412cfe..0000000000 --- a/vendor/github.com/ulikunitz/xz/reader.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package xz supports the compression and decompression of xz files. It -// supports version 1.0.4 of the specification without the non-LZMA2 -// filters. See http://tukaani.org/xz/xz-file-format-1.0.4.txt -package xz - -import ( - "bytes" - "errors" - "fmt" - "hash" - "io" - - "github.com/ulikunitz/xz/internal/xlog" - "github.com/ulikunitz/xz/lzma" -) - -// ReaderConfig defines the parameters for the xz reader. The -// SingleStream parameter requests the reader to assume that the -// underlying stream contains only a single stream. -type ReaderConfig struct { - DictCap int - SingleStream bool -} - -// Verify checks the reader parameters for Validity. Zero values will be -// replaced by default values. -func (c *ReaderConfig) Verify() error { - if c == nil { - return errors.New("xz: reader parameters are nil") - } - lc := lzma.Reader2Config{DictCap: c.DictCap} - if err := lc.Verify(); err != nil { - return err - } - return nil -} - -// Reader supports the reading of one or multiple xz streams. -type Reader struct { - ReaderConfig - - xz io.Reader - sr *streamReader -} - -// streamReader decodes a single xz stream -type streamReader struct { - ReaderConfig - - xz io.Reader - br *blockReader - newHash func() hash.Hash - h header - index []record -} - -// NewReader creates a new xz reader using the default parameters. -// The function reads and checks the header of the first XZ stream. The -// reader will process multiple streams including padding. -func NewReader(xz io.Reader) (r *Reader, err error) { - return ReaderConfig{}.NewReader(xz) -} - -// NewReader creates an xz stream reader. The created reader will be -// able to process multiple streams and padding unless a SingleStream -// has been set in the reader configuration c. -func (c ReaderConfig) NewReader(xz io.Reader) (r *Reader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - r = &Reader{ - ReaderConfig: c, - xz: xz, - } - if r.sr, err = c.newStreamReader(xz); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return nil, err - } - return r, nil -} - -var errUnexpectedData = errors.New("xz: unexpected data after stream") - -// Read reads uncompressed data from the stream. -func (r *Reader) Read(p []byte) (n int, err error) { - for n < len(p) { - if r.sr == nil { - if r.SingleStream { - data := make([]byte, 1) - _, err = io.ReadFull(r.xz, data) - if err != io.EOF { - return n, errUnexpectedData - } - return n, io.EOF - } - for { - r.sr, err = r.ReaderConfig.newStreamReader(r.xz) - if err != errPadding { - break - } - } - if err != nil { - return n, err - } - } - k, err := r.sr.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - r.sr = nil - continue - } - return n, err - } - } - return n, nil -} - -var errPadding = errors.New("xz: padding (4 zero bytes) encountered") - -// newStreamReader creates a new xz stream reader using the given configuration -// parameters. NewReader reads and checks the header of the xz stream. -func (c ReaderConfig) newStreamReader(xz io.Reader) (r *streamReader, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - data := make([]byte, HeaderLen) - if _, err := io.ReadFull(xz, data[:4]); err != nil { - return nil, err - } - if bytes.Equal(data[:4], []byte{0, 0, 0, 0}) { - return nil, errPadding - } - if _, err = io.ReadFull(xz, data[4:]); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return nil, err - } - r = &streamReader{ - ReaderConfig: c, - xz: xz, - index: make([]record, 0, 4), - } - if err = r.h.UnmarshalBinary(data); err != nil { - return nil, err - } - xlog.Debugf("xz header %s", r.h) - if r.newHash, err = newHashFunc(r.h.flags); err != nil { - return nil, err - } - return r, nil -} - -// readTail reads the index body and the xz footer. -func (r *streamReader) readTail() error { - index, n, err := readIndexBody(r.xz, len(r.index)) - if err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - - for i, rec := range r.index { - if rec != index[i] { - return fmt.Errorf("xz: record %d is %v; want %v", - i, rec, index[i]) - } - } - - p := make([]byte, footerLen) - if _, err = io.ReadFull(r.xz, p); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return err - } - var f footer - if err = f.UnmarshalBinary(p); err != nil { - return err - } - xlog.Debugf("xz footer %s", f) - if f.flags != r.h.flags { - return errors.New("xz: footer flags incorrect") - } - if f.indexSize != int64(n)+1 { - return errors.New("xz: index size in footer wrong") - } - return nil -} - -// Read reads actual data from the xz stream. -func (r *streamReader) Read(p []byte) (n int, err error) { - for n < len(p) { - if r.br == nil { - bh, hlen, err := readBlockHeader(r.xz) - if err != nil { - if err == errIndexIndicator { - if err = r.readTail(); err != nil { - return n, err - } - return n, io.EOF - } - return n, err - } - xlog.Debugf("block %v", *bh) - r.br, err = r.ReaderConfig.newBlockReader(r.xz, bh, - hlen, r.newHash()) - if err != nil { - return n, err - } - } - k, err := r.br.Read(p[n:]) - n += k - if err != nil { - if err == io.EOF { - r.index = append(r.index, r.br.record()) - r.br = nil - } else { - return n, err - } - } - } - return n, nil -} - -// countingReader is a reader that counts the bytes read. -type countingReader struct { - r io.Reader - n int64 -} - -// Read reads data from the wrapped reader and adds it to the n field. -func (lr *countingReader) Read(p []byte) (n int, err error) { - n, err = lr.r.Read(p) - lr.n += int64(n) - return n, err -} - -// blockReader supports the reading of a block. -type blockReader struct { - lxz countingReader - header *blockHeader - headerLen int - n int64 - hash hash.Hash - r io.Reader -} - -// newBlockReader creates a new block reader. -func (c *ReaderConfig) newBlockReader(xz io.Reader, h *blockHeader, - hlen int, hash hash.Hash) (br *blockReader, err error) { - - br = &blockReader{ - lxz: countingReader{r: xz}, - header: h, - headerLen: hlen, - hash: hash, - } - - fr, err := c.newFilterReader(&br.lxz, h.filters) - if err != nil { - return nil, err - } - if br.hash.Size() != 0 { - br.r = io.TeeReader(fr, br.hash) - } else { - br.r = fr - } - - return br, nil -} - -// uncompressedSize returns the uncompressed size of the block. -func (br *blockReader) uncompressedSize() int64 { - return br.n -} - -// compressedSize returns the compressed size of the block. -func (br *blockReader) compressedSize() int64 { - return br.lxz.n -} - -// unpaddedSize computes the unpadded size for the block. -func (br *blockReader) unpaddedSize() int64 { - n := int64(br.headerLen) - n += br.compressedSize() - n += int64(br.hash.Size()) - return n -} - -// record returns the index record for the current block. -func (br *blockReader) record() record { - return record{br.unpaddedSize(), br.uncompressedSize()} -} - -// Read reads data from the block. -func (br *blockReader) Read(p []byte) (n int, err error) { - n, err = br.r.Read(p) - br.n += int64(n) - - u := br.header.uncompressedSize - if u >= 0 && br.uncompressedSize() > u { - return n, errors.New("xz: wrong uncompressed size for block") - } - c := br.header.compressedSize - if c >= 0 && br.compressedSize() > c { - return n, errors.New("xz: wrong compressed size for block") - } - if err != io.EOF { - return n, err - } - if br.uncompressedSize() < u || br.compressedSize() < c { - return n, io.ErrUnexpectedEOF - } - - s := br.hash.Size() - k := padLen(br.lxz.n) - q := make([]byte, k+s, k+2*s) - if _, err = io.ReadFull(br.lxz.r, q); err != nil { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return n, err - } - if !allZeros(q[:k]) { - return n, errors.New("xz: non-zero block padding") - } - checkSum := q[k:] - computedSum := br.hash.Sum(checkSum[s:]) - if !bytes.Equal(checkSum, computedSum) { - return n, errors.New("xz: checksum error for block") - } - return n, io.EOF -} - -func (c *ReaderConfig) newFilterReader(r io.Reader, f []filter) (fr io.Reader, - err error) { - - if err = verifyFilters(f); err != nil { - return nil, err - } - - fr = r - for i := len(f) - 1; i >= 0; i-- { - fr, err = f[i].reader(fr, c) - if err != nil { - return nil, err - } - } - return fr, nil -} diff --git a/vendor/github.com/ulikunitz/xz/writer.go b/vendor/github.com/ulikunitz/xz/writer.go deleted file mode 100644 index f693e0aef7..0000000000 --- a/vendor/github.com/ulikunitz/xz/writer.go +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright 2014-2022 Ulrich Kunitz. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package xz - -import ( - "errors" - "fmt" - "hash" - "io" - - "github.com/ulikunitz/xz/lzma" -) - -// WriterConfig describe the parameters for an xz writer. -type WriterConfig struct { - Properties *lzma.Properties - DictCap int - BufSize int - BlockSize int64 - // checksum method: CRC32, CRC64 or SHA256 (default: CRC64) - CheckSum byte - // Forces NoChecksum (default: false) - NoCheckSum bool - // match algorithm - Matcher lzma.MatchAlgorithm -} - -// fill replaces zero values with default values. -func (c *WriterConfig) fill() { - if c.Properties == nil { - c.Properties = &lzma.Properties{LC: 3, LP: 0, PB: 2} - } - if c.DictCap == 0 { - c.DictCap = 8 * 1024 * 1024 - } - if c.BufSize == 0 { - c.BufSize = 4096 - } - if c.BlockSize == 0 { - c.BlockSize = maxInt64 - } - if c.CheckSum == 0 { - c.CheckSum = CRC64 - } - if c.NoCheckSum { - c.CheckSum = None - } -} - -// Verify checks the configuration for errors. Zero values will be -// replaced by default values. -func (c *WriterConfig) Verify() error { - if c == nil { - return errors.New("xz: writer configuration is nil") - } - c.fill() - lc := lzma.Writer2Config{ - Properties: c.Properties, - DictCap: c.DictCap, - BufSize: c.BufSize, - Matcher: c.Matcher, - } - if err := lc.Verify(); err != nil { - return err - } - if c.BlockSize <= 0 { - return errors.New("xz: block size out of range") - } - if err := verifyFlags(c.CheckSum); err != nil { - return err - } - return nil -} - -// filters creates the filter list for the given parameters. -func (c *WriterConfig) filters() []filter { - return []filter{&lzmaFilter{int64(c.DictCap)}} -} - -// maxInt64 defines the maximum 64-bit signed integer. -const maxInt64 = 1<<63 - 1 - -// verifyFilters checks the filter list for the length and the right -// sequence of filters. -func verifyFilters(f []filter) error { - if len(f) == 0 { - return errors.New("xz: no filters") - } - if len(f) > 4 { - return errors.New("xz: more than four filters") - } - for _, g := range f[:len(f)-1] { - if g.last() { - return errors.New("xz: last filter is not last") - } - } - if !f[len(f)-1].last() { - return errors.New("xz: wrong last filter") - } - return nil -} - -// newFilterWriteCloser converts a filter list into a WriteCloser that -// can be used by a blockWriter. -func (c *WriterConfig) newFilterWriteCloser(w io.Writer, f []filter) (fw io.WriteCloser, err error) { - if err = verifyFilters(f); err != nil { - return nil, err - } - fw = nopWriteCloser(w) - for i := len(f) - 1; i >= 0; i-- { - fw, err = f[i].writeCloser(fw, c) - if err != nil { - return nil, err - } - } - return fw, nil -} - -// nopWCloser implements a WriteCloser with a Close method not doing -// anything. -type nopWCloser struct { - io.Writer -} - -// Close returns nil and doesn't do anything else. -func (c nopWCloser) Close() error { - return nil -} - -// nopWriteCloser converts the Writer into a WriteCloser with a Close -// function that does nothing beside returning nil. -func nopWriteCloser(w io.Writer) io.WriteCloser { - return nopWCloser{w} -} - -// Writer compresses data written to it. It is an io.WriteCloser. -type Writer struct { - WriterConfig - - xz io.Writer - bw *blockWriter - newHash func() hash.Hash - h header - index []record - closed bool -} - -// newBlockWriter creates a new block writer writes the header out. -func (w *Writer) newBlockWriter() error { - var err error - w.bw, err = w.WriterConfig.newBlockWriter(w.xz, w.newHash()) - if err != nil { - return err - } - if err = w.bw.writeHeader(w.xz); err != nil { - return err - } - return nil -} - -// closeBlockWriter closes a block writer and records the sizes in the -// index. -func (w *Writer) closeBlockWriter() error { - var err error - if err = w.bw.Close(); err != nil { - return err - } - w.index = append(w.index, w.bw.record()) - return nil -} - -// NewWriter creates a new xz writer using default parameters. -func NewWriter(xz io.Writer) (w *Writer, err error) { - return WriterConfig{}.NewWriter(xz) -} - -// NewWriter creates a new Writer using the given configuration parameters. -func (c WriterConfig) NewWriter(xz io.Writer) (w *Writer, err error) { - if err = c.Verify(); err != nil { - return nil, err - } - w = &Writer{ - WriterConfig: c, - xz: xz, - h: header{c.CheckSum}, - index: make([]record, 0, 4), - } - if w.newHash, err = newHashFunc(c.CheckSum); err != nil { - return nil, err - } - data, err := w.h.MarshalBinary() - if err != nil { - return nil, fmt.Errorf("w.h.MarshalBinary(): error %w", err) - } - if _, err = xz.Write(data); err != nil { - return nil, err - } - if err = w.newBlockWriter(); err != nil { - return nil, err - } - return w, nil - -} - -// Write compresses the uncompressed data provided. -func (w *Writer) Write(p []byte) (n int, err error) { - if w.closed { - return 0, errClosed - } - for { - k, err := w.bw.Write(p[n:]) - n += k - if err != errNoSpace { - return n, err - } - if err = w.closeBlockWriter(); err != nil { - return n, err - } - if err = w.newBlockWriter(); err != nil { - return n, err - } - } -} - -// Close closes the writer and adds the footer to the Writer. Close -// doesn't close the underlying writer. -func (w *Writer) Close() error { - if w.closed { - return errClosed - } - w.closed = true - var err error - if err = w.closeBlockWriter(); err != nil { - return err - } - - f := footer{flags: w.h.flags} - if f.indexSize, err = writeIndex(w.xz, w.index); err != nil { - return err - } - data, err := f.MarshalBinary() - if err != nil { - return err - } - if _, err = w.xz.Write(data); err != nil { - return err - } - return nil -} - -// countingWriter is a writer that counts all data written to it. -type countingWriter struct { - w io.Writer - n int64 -} - -// Write writes data to the countingWriter. -func (cw *countingWriter) Write(p []byte) (n int, err error) { - n, err = cw.w.Write(p) - cw.n += int64(n) - if err == nil && cw.n < 0 { - return n, errors.New("xz: counter overflow") - } - return -} - -// blockWriter is writes a single block. -type blockWriter struct { - cxz countingWriter - // mw combines io.WriteCloser w and the hash. - mw io.Writer - w io.WriteCloser - n int64 - blockSize int64 - closed bool - headerLen int - - filters []filter - hash hash.Hash -} - -// newBlockWriter creates a new block writer. -func (c *WriterConfig) newBlockWriter(xz io.Writer, hash hash.Hash) (bw *blockWriter, err error) { - bw = &blockWriter{ - cxz: countingWriter{w: xz}, - blockSize: c.BlockSize, - filters: c.filters(), - hash: hash, - } - bw.w, err = c.newFilterWriteCloser(&bw.cxz, bw.filters) - if err != nil { - return nil, err - } - if bw.hash.Size() != 0 { - bw.mw = io.MultiWriter(bw.w, bw.hash) - } else { - bw.mw = bw.w - } - return bw, nil -} - -// writeHeader writes the header. If the function is called after Close -// the commpressedSize and uncompressedSize fields will be filled. -func (bw *blockWriter) writeHeader(w io.Writer) error { - h := blockHeader{ - compressedSize: -1, - uncompressedSize: -1, - filters: bw.filters, - } - if bw.closed { - h.compressedSize = bw.compressedSize() - h.uncompressedSize = bw.uncompressedSize() - } - data, err := h.MarshalBinary() - if err != nil { - return err - } - if _, err = w.Write(data); err != nil { - return err - } - bw.headerLen = len(data) - return nil -} - -// compressed size returns the amount of data written to the underlying -// stream. -func (bw *blockWriter) compressedSize() int64 { - return bw.cxz.n -} - -// uncompressedSize returns the number of data written to the -// blockWriter -func (bw *blockWriter) uncompressedSize() int64 { - return bw.n -} - -// unpaddedSize returns the sum of the header length, the uncompressed -// size of the block and the hash size. -func (bw *blockWriter) unpaddedSize() int64 { - if bw.headerLen <= 0 { - panic("xz: block header not written") - } - n := int64(bw.headerLen) - n += bw.compressedSize() - n += int64(bw.hash.Size()) - return n -} - -// record returns the record for the current stream. Call Close before -// calling this method. -func (bw *blockWriter) record() record { - return record{bw.unpaddedSize(), bw.uncompressedSize()} -} - -var errClosed = errors.New("xz: writer already closed") - -var errNoSpace = errors.New("xz: no space") - -// Write writes uncompressed data to the block writer. -func (bw *blockWriter) Write(p []byte) (n int, err error) { - if bw.closed { - return 0, errClosed - } - - t := bw.blockSize - bw.n - if int64(len(p)) > t { - err = errNoSpace - p = p[:t] - } - - var werr error - n, werr = bw.mw.Write(p) - bw.n += int64(n) - if werr != nil { - return n, werr - } - return n, err -} - -// Close closes the writer. -func (bw *blockWriter) Close() error { - if bw.closed { - return errClosed - } - bw.closed = true - if err := bw.w.Close(); err != nil { - return err - } - s := bw.hash.Size() - k := padLen(bw.cxz.n) - p := make([]byte, k+s) - bw.hash.Sum(p[k:k]) - if _, err := bw.cxz.w.Write(p); err != nil { - return err - } - return nil -} diff --git a/vendor/github.com/ultraware/funlen/LICENSE b/vendor/github.com/ultraware/funlen/LICENSE deleted file mode 100644 index dca75556d8..0000000000 --- a/vendor/github.com/ultraware/funlen/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2018 Ultraware Consultancy and Development B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/ultraware/funlen/README.md b/vendor/github.com/ultraware/funlen/README.md deleted file mode 100644 index af2187694e..0000000000 --- a/vendor/github.com/ultraware/funlen/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Funlen linter - -Funlen is a linter that checks for long functions. It can check both on the number of lines and the number of statements. - -The default limits are 60 lines and 40 statements. You can configure these. - -## Description - -The intent for the funlen linter is to fit a function within one screen. If you need to scroll through a long function, tracing variables back to their definition or even just finding matching brackets can become difficult. - -Besides checking lines there's also a separate check for the number of statements, which gives a clearer idea of how much is actually being done in a function. - -The default values are used internally, but might to be adjusted for your specific environment. - -## Installation - -Funlen is included in [golangci-lint](https://github.com/golangci/golangci-lint/). Install it and enable funlen. - -# Exclude for tests - -golangci-lint offers a way to exclude linters in certain cases. More info can be found here: https://golangci-lint.run/usage/configuration/#issues-configuration. - -## Disable funlen for \_test.go files - -You can utilize the issues configuration in `.golangci.yml` to exclude the funlen linter for all test files: - -```yaml -issues: - exclude-rules: - # disable funlen for all _test.go files - - path: _test.go - linters: - - funlen -``` - -## Disable funlen only for Test funcs - -If you want to keep funlen enabled for example in helper functions in test files but disable it specifically for Test funcs, you can use the following configuration: - -```yaml -issues: - exclude-rules: - # disable funlen for test funcs - - source: "^func Test" - linters: - - funlen -``` diff --git a/vendor/github.com/ultraware/funlen/main.go b/vendor/github.com/ultraware/funlen/main.go deleted file mode 100644 index b68ddb926f..0000000000 --- a/vendor/github.com/ultraware/funlen/main.go +++ /dev/null @@ -1,124 +0,0 @@ -package funlen - -import ( - "fmt" - "go/ast" - "go/token" - "reflect" -) - -const ( - defaultLineLimit = 60 - defaultStmtLimit = 40 -) - -// Run runs this linter on the provided code -func Run(file *ast.File, fset *token.FileSet, lineLimit int, stmtLimit int, ignoreComments bool) []Message { - if lineLimit == 0 { - lineLimit = defaultLineLimit - } - if stmtLimit == 0 { - stmtLimit = defaultStmtLimit - } - - cmap := ast.NewCommentMap(fset, file, file.Comments) - - var msgs []Message - for _, f := range file.Decls { - decl, ok := f.(*ast.FuncDecl) - if !ok || decl.Body == nil { // decl.Body can be nil for e.g. cgo - continue - } - - if stmtLimit > 0 { - if stmts := parseStmts(decl.Body.List); stmts > stmtLimit { - msgs = append(msgs, makeStmtMessage(fset, decl.Name, stmts, stmtLimit)) - continue - } - } - - if lineLimit > 0 { - if lines := getLines(fset, decl, cmap.Filter(decl), ignoreComments); lines > lineLimit { - msgs = append(msgs, makeLineMessage(fset, decl.Name, lines, lineLimit)) - } - } - } - - return msgs -} - -// Message contains a message -type Message struct { - Pos token.Position - Message string -} - -func makeLineMessage(fset *token.FileSet, funcInfo *ast.Ident, lines, lineLimit int) Message { - return Message{ - fset.Position(funcInfo.Pos()), - fmt.Sprintf("Function '%s' is too long (%d > %d)\n", funcInfo.Name, lines, lineLimit), - } -} - -func makeStmtMessage(fset *token.FileSet, funcInfo *ast.Ident, stmts, stmtLimit int) Message { - return Message{ - fset.Position(funcInfo.Pos()), - fmt.Sprintf("Function '%s' has too many statements (%d > %d)\n", funcInfo.Name, stmts, stmtLimit), - } -} - -func getLines(fset *token.FileSet, f *ast.FuncDecl, cmap ast.CommentMap, ignoreComments bool) int { // nolint: interfacer - var lineCount int - var commentCount int - - lineCount = fset.Position(f.End()).Line - fset.Position(f.Pos()).Line - 1 - - if !ignoreComments { - return lineCount - } - - for _, c := range cmap.Comments() { - // If the CommenGroup's lines are inside the function - // count how many comments are in the CommentGroup - if (fset.Position(c.Pos()).Line > fset.Position(f.Pos()).Line) && - (fset.Position(c.End()).Line < fset.Position(f.End()).Line) { - commentCount += len(c.List) - } - } - - return lineCount - commentCount -} - -func parseStmts(s []ast.Stmt) (total int) { - for _, v := range s { - total++ - switch stmt := v.(type) { - case *ast.BlockStmt: - total += parseStmts(stmt.List) - 1 - case *ast.ForStmt, *ast.RangeStmt, *ast.IfStmt, - *ast.SwitchStmt, *ast.TypeSwitchStmt, *ast.SelectStmt: - total += parseBodyListStmts(stmt) - case *ast.CaseClause: - total += parseStmts(stmt.Body) - case *ast.AssignStmt: - total += checkInlineFunc(stmt.Rhs[0]) - case *ast.GoStmt: - total += checkInlineFunc(stmt.Call.Fun) - case *ast.DeferStmt: - total += checkInlineFunc(stmt.Call.Fun) - } - } - return -} - -func checkInlineFunc(stmt ast.Expr) int { - if block, ok := stmt.(*ast.FuncLit); ok { - return parseStmts(block.Body.List) - } - return 0 -} - -func parseBodyListStmts(t interface{}) int { - i := reflect.ValueOf(t).Elem().FieldByName(`Body`).Elem().FieldByName(`List`).Interface() - return parseStmts(i.([]ast.Stmt)) -} diff --git a/vendor/github.com/ultraware/whitespace/LICENSE b/vendor/github.com/ultraware/whitespace/LICENSE deleted file mode 100644 index dca75556d8..0000000000 --- a/vendor/github.com/ultraware/whitespace/LICENSE +++ /dev/null @@ -1,7 +0,0 @@ -Copyright 2018 Ultraware Consultancy and Development B.V. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/github.com/ultraware/whitespace/README.md b/vendor/github.com/ultraware/whitespace/README.md deleted file mode 100644 index f99ecce36c..0000000000 --- a/vendor/github.com/ultraware/whitespace/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Whitespace linter - -Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc. - -## Installation guide - -To install as a standalone linter, run `go install github.com/ultraware/whitespace`. - -Whitespace is also included in [golangci-lint](https://github.com/golangci/golangci-lint/). Install it and enable whitespace. diff --git a/vendor/github.com/ultraware/whitespace/whitespace.go b/vendor/github.com/ultraware/whitespace/whitespace.go deleted file mode 100644 index 350e9b7e4e..0000000000 --- a/vendor/github.com/ultraware/whitespace/whitespace.go +++ /dev/null @@ -1,307 +0,0 @@ -package whitespace - -import ( - "flag" - "go/ast" - "go/token" - "strings" - - "golang.org/x/tools/go/analysis" -) - -// MessageType describes what should happen to fix the warning. -type MessageType uint8 - -// List of MessageTypes. -const ( - MessageTypeRemove MessageType = iota + 1 - MessageTypeAdd -) - -// RunningMode describes the mode the linter is run in. This can be either -// native or golangci-lint. -type RunningMode uint8 - -const ( - RunningModeNative RunningMode = iota - RunningModeGolangCI -) - -// Message contains a message and diagnostic information. -type Message struct { - // Diagnostic is what position the diagnostic should be put at. This isn't - // always the same as the fix start, f.ex. when we fix trailing newlines we - // put the diagnostic at the right bracket but we fix between the end of the - // last statement and the bracket. - Diagnostic token.Pos - - // FixStart is the span start of the fix. - FixStart token.Pos - - // FixEnd is the span end of the fix. - FixEnd token.Pos - - // LineNumbers represent the actual line numbers in the file. This is set - // when finding the diagnostic to make it easier to suggest fixes in - // golangci-lint. - LineNumbers []int - - // MessageType represents the type of message it is. - MessageType MessageType - - // Message is the diagnostic to show. - Message string -} - -// Settings contains settings for edge-cases. -type Settings struct { - Mode RunningMode - MultiIf bool - MultiFunc bool -} - -// NewAnalyzer creates a new whitespace analyzer. -func NewAnalyzer(settings *Settings) *analysis.Analyzer { - if settings == nil { - settings = &Settings{} - } - - return &analysis.Analyzer{ - Name: "whitespace", - Doc: "Whitespace is a linter that checks for unnecessary newlines at the start and end of functions, if, for, etc.", - Flags: flags(settings), - Run: func(p *analysis.Pass) (any, error) { - Run(p, settings) - return nil, nil - }, - RunDespiteErrors: true, - } -} - -func flags(settings *Settings) flag.FlagSet { - flags := flag.NewFlagSet("", flag.ExitOnError) - flags.BoolVar(&settings.MultiIf, "multi-if", settings.MultiIf, "Check that multi line if-statements have a leading newline") - flags.BoolVar(&settings.MultiFunc, "multi-func", settings.MultiFunc, "Check that multi line functions have a leading newline") - - return *flags -} - -func Run(pass *analysis.Pass, settings *Settings) []Message { - messages := []Message{} - - for _, file := range pass.Files { - filename := pass.Fset.Position(file.Pos()).Filename - if !strings.HasSuffix(filename, ".go") { - continue - } - - fileMessages := runFile(file, pass.Fset, *settings) - - if settings.Mode == RunningModeGolangCI { - messages = append(messages, fileMessages...) - continue - } - - for _, message := range fileMessages { - pass.Report(analysis.Diagnostic{ - Pos: message.Diagnostic, - Category: "whitespace", - Message: message.Message, - SuggestedFixes: []analysis.SuggestedFix{ - { - TextEdits: []analysis.TextEdit{ - { - Pos: message.FixStart, - End: message.FixEnd, - NewText: []byte("\n"), - }, - }, - }, - }, - }) - } - } - - return messages -} - -func runFile(file *ast.File, fset *token.FileSet, settings Settings) []Message { - var messages []Message - - for _, f := range file.Decls { - decl, ok := f.(*ast.FuncDecl) - if !ok || decl.Body == nil { // decl.Body can be nil for e.g. cgo - continue - } - - vis := visitor{file.Comments, fset, nil, make(map[*ast.BlockStmt]bool), settings} - ast.Walk(&vis, decl) - - messages = append(messages, vis.messages...) - } - - return messages -} - -type visitor struct { - comments []*ast.CommentGroup - fset *token.FileSet - messages []Message - wantNewline map[*ast.BlockStmt]bool - settings Settings -} - -func (v *visitor) Visit(node ast.Node) ast.Visitor { - if node == nil { - return v - } - - if stmt, ok := node.(*ast.IfStmt); ok && v.settings.MultiIf { - checkMultiLine(v, stmt.Body, stmt.Cond) - } - - if stmt, ok := node.(*ast.FuncLit); ok && v.settings.MultiFunc { - checkMultiLine(v, stmt.Body, stmt.Type) - } - - if stmt, ok := node.(*ast.FuncDecl); ok && v.settings.MultiFunc { - checkMultiLine(v, stmt.Body, stmt.Type) - } - - if stmt, ok := node.(*ast.BlockStmt); ok { - wantNewline := v.wantNewline[stmt] - - comments := v.comments - if wantNewline { - comments = nil // Comments also count as a newline if we want a newline - } - - opening, first, last := firstAndLast(comments, v.fset, stmt) - startMsg := checkStart(v.fset, opening, first) - - if wantNewline && startMsg == nil && len(stmt.List) >= 1 { - v.messages = append(v.messages, Message{ - Diagnostic: opening, - FixStart: stmt.List[0].Pos(), - FixEnd: stmt.List[0].Pos(), - LineNumbers: []int{v.fset.PositionFor(stmt.List[0].Pos(), false).Line}, - MessageType: MessageTypeAdd, - Message: "multi-line statement should be followed by a newline", - }) - } else if !wantNewline && startMsg != nil { - v.messages = append(v.messages, *startMsg) - } - - if msg := checkEnd(v.fset, stmt.Rbrace, last); msg != nil { - v.messages = append(v.messages, *msg) - } - } - - return v -} - -func checkMultiLine(v *visitor, body *ast.BlockStmt, stmtStart ast.Node) { - start, end := posLine(v.fset, stmtStart.Pos()), posLine(v.fset, stmtStart.End()) - - if end > start { // Check only multi line conditions - v.wantNewline[body] = true - } -} - -func posLine(fset *token.FileSet, pos token.Pos) int { - return fset.PositionFor(pos, false).Line -} - -func firstAndLast(comments []*ast.CommentGroup, fset *token.FileSet, stmt *ast.BlockStmt) (token.Pos, ast.Node, ast.Node) { - openingPos := stmt.Lbrace + 1 - - if len(stmt.List) == 0 { - return openingPos, nil, nil - } - - first, last := ast.Node(stmt.List[0]), ast.Node(stmt.List[len(stmt.List)-1]) - - for _, c := range comments { - // If the comment is on the same line as the opening pos (initially the - // left bracket) but it starts after the pos the comment must be after - // the bracket and where that comment ends should be considered where - // the fix should start. - if posLine(fset, c.Pos()) == posLine(fset, openingPos) && c.Pos() > openingPos { - if posLine(fset, c.End()) != posLine(fset, openingPos) { - // This is a multiline comment that spans from the `LBrace` line - // to a line further down. This should always be seen as ok! - first = c - } else { - openingPos = c.End() - } - } - - if posLine(fset, c.Pos()) == posLine(fset, stmt.Pos()) || posLine(fset, c.End()) == posLine(fset, stmt.End()) { - continue - } - - if c.Pos() < stmt.Pos() || c.End() > stmt.End() { - continue - } - - if c.Pos() < first.Pos() { - first = c - } - - if c.End() > last.End() { - last = c - } - } - - return openingPos, first, last -} - -func checkStart(fset *token.FileSet, start token.Pos, first ast.Node) *Message { - if first == nil { - return nil - } - - if posLine(fset, start)+1 < posLine(fset, first.Pos()) { - return &Message{ - Diagnostic: start, - FixStart: start, - FixEnd: first.Pos(), - LineNumbers: linesBetween(fset, start, first.Pos()), - MessageType: MessageTypeRemove, - Message: "unnecessary leading newline", - } - } - - return nil -} - -func checkEnd(fset *token.FileSet, end token.Pos, last ast.Node) *Message { - if last == nil { - return nil - } - - if posLine(fset, end)-1 > posLine(fset, last.End()) { - return &Message{ - Diagnostic: end, - FixStart: last.End(), - FixEnd: end, - LineNumbers: linesBetween(fset, last.End(), end), - MessageType: MessageTypeRemove, - Message: "unnecessary trailing newline", - } - } - - return nil -} - -func linesBetween(fset *token.FileSet, a, b token.Pos) []int { - lines := []int{} - aPosition := fset.PositionFor(a, false) - bPosition := fset.PositionFor(b, false) - - for i := aPosition.Line + 1; i < bPosition.Line; i++ { - lines = append(lines, i) - } - - return lines -} diff --git a/vendor/github.com/uudashr/gocognit/LICENSE b/vendor/github.com/uudashr/gocognit/LICENSE deleted file mode 100644 index 75d4b9c98b..0000000000 --- a/vendor/github.com/uudashr/gocognit/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2019 Nuruddin Ashr - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/uudashr/gocognit/README.md b/vendor/github.com/uudashr/gocognit/README.md deleted file mode 100644 index 57f31cf740..0000000000 --- a/vendor/github.com/uudashr/gocognit/README.md +++ /dev/null @@ -1,226 +0,0 @@ -[![GoDoc](https://godoc.org/github.com/uudashr/gocognit?status.svg)](https://godoc.org/github.com/uudashr/gocognit) -# Gocognit -Gocognit calculates cognitive complexities of functions (and methods) in Go source code. A measurement of how hard does the code is intuitively to understand. - -## Understanding the complexity - -Given code using `if` statement, -```go -func GetWords(number int) string { - if number == 1 { // +1 - return "one" - } else if number == 2 { // +1 - return "a couple" - } else if number == 3 { // +1 - return "a few" - } else { // +1 - return "lots" - } -} // Cognitive complexity = 4 -``` - -Above code can be refactored using `switch` statement, -```go -func GetWords(number int) string { - switch number { // +1 - case 1: - return "one" - case 2: - return "a couple" - case 3: - return "a few" - default: - return "lots" - } -} // Cognitive complexity = 1 -``` - -As you see above codes are the same, but the second code are easier to understand, that is why the cognitive complexity score are lower compare to the first one. - -## Comparison with cyclomatic complexity - -### Example 1 -#### Cyclomatic complexity -```go -func GetWords(number int) string { // +1 - switch number { - case 1: // +1 - return "one" - case 2: // +1 - return "a couple" - case 3: // +1 - return "a few" - default: - return "lots" - } -} // Cyclomatic complexity = 4 -``` - -#### Cognitive complexity -```go -func GetWords(number int) string { - switch number { // +1 - case 1: - return "one" - case 2: - return "a couple" - case 3: - return "a few" - default: - return "lots" - } -} // Cognitive complexity = 1 -``` - -Cognitive complexity give lower score compare to cyclomatic complexity. - -### Example 2 -#### Cyclomatic complexity -```go -func SumOfPrimes(max int) int { // +1 - var total int - -OUT: - for i := 1; i < max; i++ { // +1 - for j := 2; j < i; j++ { // +1 - if i%j == 0 { // +1 - continue OUT - } - } - total += i - } - - return total -} // Cyclomatic complexity = 4 -``` - -#### Cognitive complexity -```go -func SumOfPrimes(max int) int { - var total int - -OUT: - for i := 1; i < max; i++ { // +1 - for j := 2; j < i; j++ { // +2 (nesting = 1) - if i%j == 0 { // +3 (nesting = 2) - continue OUT // +1 - } - } - total += i - } - - return total -} // Cognitive complexity = 7 -``` - -Cognitive complexity give higher score compare to cyclomatic complexity. - -## Rules - -The cognitive complexity of a function is calculated according to the -following rules: -> Note: these rules are specific for Go, please see the [original whitepaper](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) for more complete reference. - -### Increments -There is an increment for each of the following: -1. `if`, `else if`, `else` -2. `switch`, `select` -3. `for` -4. `goto` LABEL, `break` LABEL, `continue` LABEL -5. sequence of binary logical operators -6. each method in a recursion cycle - -### Nesting level -The following structures increment the nesting level: -1. `if`, `else if`, `else` -2. `switch`, `select` -3. `for` -4. function literal or lambda - -### Nesting increments -The following structures receive a nesting increment commensurate with their nested depth inside nesting structures: -1. `if` -2. `switch`, `select` -3. `for` - -## Installation - -``` -$ go install github.com/uudashr/gocognit/cmd/gocognit@latest -``` - -or - -``` -$ go get github.com/uudashr/gocognit/cmd/gocognit -``` - -## Usage - -``` -$ gocognit -Calculate cognitive complexities of Go functions. - -Usage: - - gocognit [ ...] ... - -Flags: - - -over N show functions with complexity > N only - and return exit code 1 if the output is non-empty - -top N show the top N most complex functions only - -avg show the average complexity over all functions, - not depending on whether -over or -top are set - -json encode the output as JSON - -f format string the format to use - (default "{{.PkgName}}.{{.FuncName}}:{{.Complexity}}:{{.Pos}}") - -The (default) output fields for each line are: - - - -The (default) output fields for each line are: - - {{.Complexity}} {{.PkgName}} {{.FuncName}} {{.Pos}} - -or equal to - -The struct being passed to the template is: - - type Stat struct { - PkgName string - FuncName string - Complexity int - Pos token.Position - } -``` - -Examples: - -``` -$ gocognit . -$ gocognit main.go -$ gocognit -top 10 src/ -$ gocognit -over 25 docker -$ gocognit -avg . -$ gocognit -ignore "_test|testdata" . -``` - -The output fields for each line are: -``` - -``` - -## Ignore individual functions -Ignore individual functions by specifying `gocognit:ignore` directive. -```go -//gocognit:ignore -func IgnoreMe() { - // ... -} -``` - -## Related project -- [Gocyclo](https://github.com/fzipp/gocyclo) where the code are based on. -- [Cognitive Complexity: A new way of measuring understandability](https://www.sonarsource.com/docs/CognitiveComplexity.pdf) white paper by G. Ann Campbell. \ No newline at end of file diff --git a/vendor/github.com/uudashr/gocognit/doc.go b/vendor/github.com/uudashr/gocognit/doc.go deleted file mode 100644 index ae3d0a2264..0000000000 --- a/vendor/github.com/uudashr/gocognit/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package gocognit defines Analyzer other utilities to checks and calculate the complexity of function based on "cognitive complexity" methods. -package gocognit diff --git a/vendor/github.com/uudashr/gocognit/gocognit.go b/vendor/github.com/uudashr/gocognit/gocognit.go deleted file mode 100644 index 2bba2eb4f0..0000000000 --- a/vendor/github.com/uudashr/gocognit/gocognit.go +++ /dev/null @@ -1,399 +0,0 @@ -package gocognit - -import ( - "fmt" - "go/ast" - "go/token" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -// Stat is statistic of the complexity. -type Stat struct { - PkgName string - FuncName string - Complexity int - Pos token.Position -} - -func (s Stat) String() string { - return fmt.Sprintf("%d %s %s %s", s.Complexity, s.PkgName, s.FuncName, s.Pos) -} - -// ComplexityStats builds the complexity statistics. -func ComplexityStats(f *ast.File, fset *token.FileSet, stats []Stat) []Stat { - for _, decl := range f.Decls { - if fn, ok := decl.(*ast.FuncDecl); ok { - d := parseDirective(fn.Doc) - if d.Ignore { - continue - } - - stats = append(stats, Stat{ - PkgName: f.Name.Name, - FuncName: funcName(fn), - Complexity: Complexity(fn), - Pos: fset.Position(fn.Pos()), - }) - } - } - return stats -} - -type directive struct { - Ignore bool -} - -func parseDirective(doc *ast.CommentGroup) directive { - if doc == nil { - return directive{} - } - - for _, c := range doc.List { - if c.Text == "//gocognit:ignore" { - return directive{Ignore: true} - } - } - - return directive{} -} - -// funcName returns the name representation of a function or method: -// "(Type).Name" for methods or simply "Name" for functions. -func funcName(fn *ast.FuncDecl) string { - if fn.Recv != nil { - if fn.Recv.NumFields() > 0 { - typ := fn.Recv.List[0].Type - return fmt.Sprintf("(%s).%s", recvString(typ), fn.Name) - } - } - return fn.Name.Name -} - -// Complexity calculates the cognitive complexity of a function. -func Complexity(fn *ast.FuncDecl) int { - v := complexityVisitor{ - name: fn.Name, - } - - ast.Walk(&v, fn) - return v.complexity -} - -type complexityVisitor struct { - name *ast.Ident - complexity int - nesting int - elseNodes map[ast.Node]bool - calculatedExprs map[ast.Expr]bool -} - -func (v *complexityVisitor) incNesting() { - v.nesting++ -} - -func (v *complexityVisitor) decNesting() { - v.nesting-- -} - -func (v *complexityVisitor) incComplexity() { - v.complexity++ -} - -func (v *complexityVisitor) nestIncComplexity() { - v.complexity += (v.nesting + 1) -} - -func (v *complexityVisitor) markAsElseNode(n ast.Node) { - if v.elseNodes == nil { - v.elseNodes = make(map[ast.Node]bool) - } - - v.elseNodes[n] = true -} - -func (v *complexityVisitor) markedAsElseNode(n ast.Node) bool { - if v.elseNodes == nil { - return false - } - - return v.elseNodes[n] -} - -func (v *complexityVisitor) markCalculated(e ast.Expr) { - if v.calculatedExprs == nil { - v.calculatedExprs = make(map[ast.Expr]bool) - } - - v.calculatedExprs[e] = true -} - -func (v *complexityVisitor) isCalculated(e ast.Expr) bool { - if v.calculatedExprs == nil { - return false - } - - return v.calculatedExprs[e] -} - -// Visit implements the ast.Visitor interface. -func (v *complexityVisitor) Visit(n ast.Node) ast.Visitor { - switch n := n.(type) { - case *ast.IfStmt: - return v.visitIfStmt(n) - case *ast.SwitchStmt: - return v.visitSwitchStmt(n) - case *ast.TypeSwitchStmt: - return v.visitTypeSwitchStmt(n) - case *ast.SelectStmt: - return v.visitSelectStmt(n) - case *ast.ForStmt: - return v.visitForStmt(n) - case *ast.RangeStmt: - return v.visitRangeStmt(n) - case *ast.FuncLit: - return v.visitFuncLit(n) - case *ast.BranchStmt: - return v.visitBranchStmt(n) - case *ast.BinaryExpr: - return v.visitBinaryExpr(n) - case *ast.CallExpr: - return v.visitCallExpr(n) - } - return v -} - -func (v *complexityVisitor) visitIfStmt(n *ast.IfStmt) ast.Visitor { - v.incIfComplexity(n) - - if n := n.Init; n != nil { - ast.Walk(v, n) - } - - ast.Walk(v, n.Cond) - - pure := !v.markedAsElseNode(n) // pure `if` statement, not an `else if` - if pure { - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - } else { - ast.Walk(v, n.Body) - } - - if _, ok := n.Else.(*ast.BlockStmt); ok { - v.incComplexity() - - ast.Walk(v, n.Else) - } else if _, ok := n.Else.(*ast.IfStmt); ok { - v.markAsElseNode(n.Else) - ast.Walk(v, n.Else) - } - - return nil -} - -func (v *complexityVisitor) visitSwitchStmt(n *ast.SwitchStmt) ast.Visitor { - v.nestIncComplexity() - - if n := n.Init; n != nil { - ast.Walk(v, n) - } - - if n := n.Tag; n != nil { - ast.Walk(v, n) - } - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitTypeSwitchStmt(n *ast.TypeSwitchStmt) ast.Visitor { - v.nestIncComplexity() - - if n := n.Init; n != nil { - ast.Walk(v, n) - } - - if n := n.Assign; n != nil { - ast.Walk(v, n) - } - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitSelectStmt(n *ast.SelectStmt) ast.Visitor { - v.nestIncComplexity() - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitForStmt(n *ast.ForStmt) ast.Visitor { - v.nestIncComplexity() - - if n := n.Init; n != nil { - ast.Walk(v, n) - } - - if n := n.Cond; n != nil { - ast.Walk(v, n) - } - - if n := n.Post; n != nil { - ast.Walk(v, n) - } - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitRangeStmt(n *ast.RangeStmt) ast.Visitor { - v.nestIncComplexity() - - if n := n.Key; n != nil { - ast.Walk(v, n) - } - - if n := n.Value; n != nil { - ast.Walk(v, n) - } - - ast.Walk(v, n.X) - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitFuncLit(n *ast.FuncLit) ast.Visitor { - ast.Walk(v, n.Type) - - v.incNesting() - ast.Walk(v, n.Body) - v.decNesting() - return nil -} - -func (v *complexityVisitor) visitBranchStmt(n *ast.BranchStmt) ast.Visitor { - if n.Label != nil { - v.incComplexity() - } - return v -} - -func (v *complexityVisitor) visitBinaryExpr(n *ast.BinaryExpr) ast.Visitor { - if isBinaryLogicalOp(n.Op) && !v.isCalculated(n) { - ops := v.collectBinaryOps(n) - - var lastOp token.Token - for _, op := range ops { - if lastOp != op { - v.incComplexity() - lastOp = op - } - } - } - return v -} - -func (v *complexityVisitor) visitCallExpr(n *ast.CallExpr) ast.Visitor { - if callIdent, ok := n.Fun.(*ast.Ident); ok { - obj, name := callIdent.Obj, callIdent.Name - if obj == v.name.Obj && name == v.name.Name { - // called by same function directly (direct recursion) - v.incComplexity() - } - } - return v -} - -func (v *complexityVisitor) collectBinaryOps(exp ast.Expr) []token.Token { - v.markCalculated(exp) - if exp, ok := exp.(*ast.BinaryExpr); ok { - return mergeBinaryOps(v.collectBinaryOps(exp.X), exp.Op, v.collectBinaryOps(exp.Y)) - } - return nil -} - -func (v *complexityVisitor) incIfComplexity(n *ast.IfStmt) { - if v.markedAsElseNode(n) { - v.incComplexity() - } else { - v.nestIncComplexity() - } -} - -func mergeBinaryOps(x []token.Token, op token.Token, y []token.Token) []token.Token { - var out []token.Token - out = append(out, x...) - if isBinaryLogicalOp(op) { - out = append(out, op) - } - out = append(out, y...) - return out -} - -func isBinaryLogicalOp(op token.Token) bool { - return op == token.LAND || op == token.LOR -} - -const Doc = `Find complex function using cognitive complexity calculation. - -The gocognit analysis reports functions or methods which the complexity is over -than the specified limit.` - -// Analyzer reports a diagnostic for every function or method which is -// too complex specified by its -over flag. -var Analyzer = &analysis.Analyzer{ - Name: "gocognit", - Doc: Doc, - Requires: []*analysis.Analyzer{inspect.Analyzer}, - Run: run, -} - -var ( - over int // -over flag -) - -func init() { - Analyzer.Flags.IntVar(&over, "over", over, "show functions with complexity > N only") -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - } - inspect.Preorder(nodeFilter, func(n ast.Node) { - funcDecl := n.(*ast.FuncDecl) - - d := parseDirective(funcDecl.Doc) - if d.Ignore { - return - } - - fnName := funcName(funcDecl) - - fnComplexity := Complexity(funcDecl) - - if fnComplexity > over { - pass.Reportf(funcDecl.Pos(), "cognitive complexity %d of func %s is high (> %d)", fnComplexity, fnName, over) - } - }) - - return nil, nil -} diff --git a/vendor/github.com/uudashr/gocognit/recv.go b/vendor/github.com/uudashr/gocognit/recv.go deleted file mode 100644 index 2f20d843a4..0000000000 --- a/vendor/github.com/uudashr/gocognit/recv.go +++ /dev/null @@ -1,24 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -package gocognit - -import ( - "go/ast" -) - -// recvString returns a string representation of recv of the -// form "T", "*T", or "BADRECV" (if not a proper receiver type). -func recvString(recv ast.Expr) string { - switch t := recv.(type) { - case *ast.Ident: - return t.Name - case *ast.StarExpr: - return "*" + recvString(t.X) - case *ast.IndexExpr: - return recvString(t.X) - case *ast.IndexListExpr: - return recvString(t.X) - } - return "BADRECV" -} diff --git a/vendor/github.com/uudashr/gocognit/recv_pre118.go b/vendor/github.com/uudashr/gocognit/recv_pre118.go deleted file mode 100644 index 9e0ebfd822..0000000000 --- a/vendor/github.com/uudashr/gocognit/recv_pre118.go +++ /dev/null @@ -1,20 +0,0 @@ -//go:build !go1.18 -// +build !go1.18 - -package gocognit - -import ( - "go/ast" -) - -// recvString returns a string representation of recv of the -// form "T", "*T", or "BADRECV" (if not a proper receiver type). -func recvString(recv ast.Expr) string { - switch t := recv.(type) { - case *ast.Ident: - return t.Name - case *ast.StarExpr: - return "*" + recvString(t.X) - } - return "BADRECV" -} diff --git a/vendor/github.com/vbatts/tar-split/LICENSE b/vendor/github.com/vbatts/tar-split/LICENSE deleted file mode 100644 index ca03685b15..0000000000 --- a/vendor/github.com/vbatts/tar-split/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2015 Vincent Batts, Raleigh, NC, USA - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/common.go b/vendor/github.com/vbatts/tar-split/archive/tar/common.go deleted file mode 100644 index dee9e47e4a..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/common.go +++ /dev/null @@ -1,723 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package tar implements access to tar archives. -// -// Tape archives (tar) are a file format for storing a sequence of files that -// can be read and written in a streaming manner. -// This package aims to cover most variations of the format, -// including those produced by GNU and BSD tar tools. -package tar - -import ( - "errors" - "fmt" - "math" - "os" - "path" - "reflect" - "strconv" - "strings" - "time" -) - -// BUG: Use of the Uid and Gid fields in Header could overflow on 32-bit -// architectures. If a large value is encountered when decoding, the result -// stored in Header will be the truncated version. - -var ( - ErrHeader = errors.New("archive/tar: invalid tar header") - ErrWriteTooLong = errors.New("archive/tar: write too long") - ErrFieldTooLong = errors.New("archive/tar: header field too long") - ErrWriteAfterClose = errors.New("archive/tar: write after close") - errMissData = errors.New("archive/tar: sparse file references non-existent data") - errUnrefData = errors.New("archive/tar: sparse file contains unreferenced data") - errWriteHole = errors.New("archive/tar: write non-NUL byte in sparse hole") -) - -type headerError []string - -func (he headerError) Error() string { - const prefix = "archive/tar: cannot encode header" - var ss []string - for _, s := range he { - if s != "" { - ss = append(ss, s) - } - } - if len(ss) == 0 { - return prefix - } - return fmt.Sprintf("%s: %v", prefix, strings.Join(ss, "; and ")) -} - -// Type flags for Header.Typeflag. -const ( - // Type '0' indicates a regular file. - TypeReg = '0' - TypeRegA = '\x00' // Deprecated: Use TypeReg instead. - - // Type '1' to '6' are header-only flags and may not have a data body. - TypeLink = '1' // Hard link - TypeSymlink = '2' // Symbolic link - TypeChar = '3' // Character device node - TypeBlock = '4' // Block device node - TypeDir = '5' // Directory - TypeFifo = '6' // FIFO node - - // Type '7' is reserved. - TypeCont = '7' - - // Type 'x' is used by the PAX format to store key-value records that - // are only relevant to the next file. - // This package transparently handles these types. - TypeXHeader = 'x' - - // Type 'g' is used by the PAX format to store key-value records that - // are relevant to all subsequent files. - // This package only supports parsing and composing such headers, - // but does not currently support persisting the global state across files. - TypeXGlobalHeader = 'g' - - // Type 'S' indicates a sparse file in the GNU format. - TypeGNUSparse = 'S' - - // Types 'L' and 'K' are used by the GNU format for a meta file - // used to store the path or link name for the next file. - // This package transparently handles these types. - TypeGNULongName = 'L' - TypeGNULongLink = 'K' -) - -// Keywords for PAX extended header records. -const ( - paxNone = "" // Indicates that no PAX key is suitable - paxPath = "path" - paxLinkpath = "linkpath" - paxSize = "size" - paxUid = "uid" - paxGid = "gid" - paxUname = "uname" - paxGname = "gname" - paxMtime = "mtime" - paxAtime = "atime" - paxCtime = "ctime" // Removed from later revision of PAX spec, but was valid - paxCharset = "charset" // Currently unused - paxComment = "comment" // Currently unused - - paxSchilyXattr = "SCHILY.xattr." - - // Keywords for GNU sparse files in a PAX extended header. - paxGNUSparse = "GNU.sparse." - paxGNUSparseNumBlocks = "GNU.sparse.numblocks" - paxGNUSparseOffset = "GNU.sparse.offset" - paxGNUSparseNumBytes = "GNU.sparse.numbytes" - paxGNUSparseMap = "GNU.sparse.map" - paxGNUSparseName = "GNU.sparse.name" - paxGNUSparseMajor = "GNU.sparse.major" - paxGNUSparseMinor = "GNU.sparse.minor" - paxGNUSparseSize = "GNU.sparse.size" - paxGNUSparseRealSize = "GNU.sparse.realsize" -) - -// basicKeys is a set of the PAX keys for which we have built-in support. -// This does not contain "charset" or "comment", which are both PAX-specific, -// so adding them as first-class features of Header is unlikely. -// Users can use the PAXRecords field to set it themselves. -var basicKeys = map[string]bool{ - paxPath: true, paxLinkpath: true, paxSize: true, paxUid: true, paxGid: true, - paxUname: true, paxGname: true, paxMtime: true, paxAtime: true, paxCtime: true, -} - -// A Header represents a single header in a tar archive. -// Some fields may not be populated. -// -// For forward compatibility, users that retrieve a Header from Reader.Next, -// mutate it in some ways, and then pass it back to Writer.WriteHeader -// should do so by creating a new Header and copying the fields -// that they are interested in preserving. -type Header struct { - // Typeflag is the type of header entry. - // The zero value is automatically promoted to either TypeReg or TypeDir - // depending on the presence of a trailing slash in Name. - Typeflag byte - - Name string // Name of file entry - Linkname string // Target name of link (valid for TypeLink or TypeSymlink) - - Size int64 // Logical file size in bytes - Mode int64 // Permission and mode bits - Uid int // User ID of owner - Gid int // Group ID of owner - Uname string // User name of owner - Gname string // Group name of owner - - // If the Format is unspecified, then Writer.WriteHeader rounds ModTime - // to the nearest second and ignores the AccessTime and ChangeTime fields. - // - // To use AccessTime or ChangeTime, specify the Format as PAX or GNU. - // To use sub-second resolution, specify the Format as PAX. - ModTime time.Time // Modification time - AccessTime time.Time // Access time (requires either PAX or GNU support) - ChangeTime time.Time // Change time (requires either PAX or GNU support) - - Devmajor int64 // Major device number (valid for TypeChar or TypeBlock) - Devminor int64 // Minor device number (valid for TypeChar or TypeBlock) - - // Xattrs stores extended attributes as PAX records under the - // "SCHILY.xattr." namespace. - // - // The following are semantically equivalent: - // h.Xattrs[key] = value - // h.PAXRecords["SCHILY.xattr."+key] = value - // - // When Writer.WriteHeader is called, the contents of Xattrs will take - // precedence over those in PAXRecords. - // - // Deprecated: Use PAXRecords instead. - Xattrs map[string]string - - // PAXRecords is a map of PAX extended header records. - // - // User-defined records should have keys of the following form: - // VENDOR.keyword - // Where VENDOR is some namespace in all uppercase, and keyword may - // not contain the '=' character (e.g., "GOLANG.pkg.version"). - // The key and value should be non-empty UTF-8 strings. - // - // When Writer.WriteHeader is called, PAX records derived from the - // other fields in Header take precedence over PAXRecords. - PAXRecords map[string]string - - // Format specifies the format of the tar header. - // - // This is set by Reader.Next as a best-effort guess at the format. - // Since the Reader liberally reads some non-compliant files, - // it is possible for this to be FormatUnknown. - // - // If the format is unspecified when Writer.WriteHeader is called, - // then it uses the first format (in the order of USTAR, PAX, GNU) - // capable of encoding this Header (see Format). - Format Format -} - -// sparseEntry represents a Length-sized fragment at Offset in the file. -type sparseEntry struct{ Offset, Length int64 } - -func (s sparseEntry) endOffset() int64 { return s.Offset + s.Length } - -// A sparse file can be represented as either a sparseDatas or a sparseHoles. -// As long as the total size is known, they are equivalent and one can be -// converted to the other form and back. The various tar formats with sparse -// file support represent sparse files in the sparseDatas form. That is, they -// specify the fragments in the file that has data, and treat everything else as -// having zero bytes. As such, the encoding and decoding logic in this package -// deals with sparseDatas. -// -// However, the external API uses sparseHoles instead of sparseDatas because the -// zero value of sparseHoles logically represents a normal file (i.e., there are -// no holes in it). On the other hand, the zero value of sparseDatas implies -// that the file has no data in it, which is rather odd. -// -// As an example, if the underlying raw file contains the 10-byte data: -// var compactFile = "abcdefgh" -// -// And the sparse map has the following entries: -// var spd sparseDatas = []sparseEntry{ -// {Offset: 2, Length: 5}, // Data fragment for 2..6 -// {Offset: 18, Length: 3}, // Data fragment for 18..20 -// } -// var sph sparseHoles = []sparseEntry{ -// {Offset: 0, Length: 2}, // Hole fragment for 0..1 -// {Offset: 7, Length: 11}, // Hole fragment for 7..17 -// {Offset: 21, Length: 4}, // Hole fragment for 21..24 -// } -// -// Then the content of the resulting sparse file with a Header.Size of 25 is: -// var sparseFile = "\x00"*2 + "abcde" + "\x00"*11 + "fgh" + "\x00"*4 -type ( - sparseDatas []sparseEntry - sparseHoles []sparseEntry -) - -// validateSparseEntries reports whether sp is a valid sparse map. -// It does not matter whether sp represents data fragments or hole fragments. -func validateSparseEntries(sp []sparseEntry, size int64) bool { - // Validate all sparse entries. These are the same checks as performed by - // the BSD tar utility. - if size < 0 { - return false - } - var pre sparseEntry - for _, cur := range sp { - switch { - case cur.Offset < 0 || cur.Length < 0: - return false // Negative values are never okay - case cur.Offset > math.MaxInt64-cur.Length: - return false // Integer overflow with large length - case cur.endOffset() > size: - return false // Region extends beyond the actual size - case pre.endOffset() > cur.Offset: - return false // Regions cannot overlap and must be in order - } - pre = cur - } - return true -} - -// alignSparseEntries mutates src and returns dst where each fragment's -// starting offset is aligned up to the nearest block edge, and each -// ending offset is aligned down to the nearest block edge. -// -// Even though the Go tar Reader and the BSD tar utility can handle entries -// with arbitrary offsets and lengths, the GNU tar utility can only handle -// offsets and lengths that are multiples of blockSize. -func alignSparseEntries(src []sparseEntry, size int64) []sparseEntry { - dst := src[:0] - for _, s := range src { - pos, end := s.Offset, s.endOffset() - pos += blockPadding(+pos) // Round-up to nearest blockSize - if end != size { - end -= blockPadding(-end) // Round-down to nearest blockSize - } - if pos < end { - dst = append(dst, sparseEntry{Offset: pos, Length: end - pos}) - } - } - return dst -} - -// invertSparseEntries converts a sparse map from one form to the other. -// If the input is sparseHoles, then it will output sparseDatas and vice-versa. -// The input must have been already validated. -// -// This function mutates src and returns a normalized map where: -// * adjacent fragments are coalesced together -// * only the last fragment may be empty -// * the endOffset of the last fragment is the total size -func invertSparseEntries(src []sparseEntry, size int64) []sparseEntry { - dst := src[:0] - var pre sparseEntry - for _, cur := range src { - if cur.Length == 0 { - continue // Skip empty fragments - } - pre.Length = cur.Offset - pre.Offset - if pre.Length > 0 { - dst = append(dst, pre) // Only add non-empty fragments - } - pre.Offset = cur.endOffset() - } - pre.Length = size - pre.Offset // Possibly the only empty fragment - return append(dst, pre) -} - -// fileState tracks the number of logical (includes sparse holes) and physical -// (actual in tar archive) bytes remaining for the current file. -// -// Invariant: LogicalRemaining >= PhysicalRemaining -type fileState interface { - LogicalRemaining() int64 - PhysicalRemaining() int64 -} - -// allowedFormats determines which formats can be used. -// The value returned is the logical OR of multiple possible formats. -// If the value is FormatUnknown, then the input Header cannot be encoded -// and an error is returned explaining why. -// -// As a by-product of checking the fields, this function returns paxHdrs, which -// contain all fields that could not be directly encoded. -// A value receiver ensures that this method does not mutate the source Header. -func (h Header) allowedFormats() (format Format, paxHdrs map[string]string, err error) { - format = FormatUSTAR | FormatPAX | FormatGNU - paxHdrs = make(map[string]string) - - var whyNoUSTAR, whyNoPAX, whyNoGNU string - var preferPAX bool // Prefer PAX over USTAR - verifyString := func(s string, size int, name, paxKey string) { - // NUL-terminator is optional for path and linkpath. - // Technically, it is required for uname and gname, - // but neither GNU nor BSD tar checks for it. - tooLong := len(s) > size - allowLongGNU := paxKey == paxPath || paxKey == paxLinkpath - if hasNUL(s) || (tooLong && !allowLongGNU) { - whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%q", name, s) - format.mustNotBe(FormatGNU) - } - if !isASCII(s) || tooLong { - canSplitUSTAR := paxKey == paxPath - if _, _, ok := splitUSTARPath(s); !canSplitUSTAR || !ok { - whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%q", name, s) - format.mustNotBe(FormatUSTAR) - } - if paxKey == paxNone { - whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%q", name, s) - format.mustNotBe(FormatPAX) - } else { - paxHdrs[paxKey] = s - } - } - if v, ok := h.PAXRecords[paxKey]; ok && v == s { - paxHdrs[paxKey] = v - } - } - verifyNumeric := func(n int64, size int, name, paxKey string) { - if !fitsInBase256(size, n) { - whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%d", name, n) - format.mustNotBe(FormatGNU) - } - if !fitsInOctal(size, n) { - whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%d", name, n) - format.mustNotBe(FormatUSTAR) - if paxKey == paxNone { - whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%d", name, n) - format.mustNotBe(FormatPAX) - } else { - paxHdrs[paxKey] = strconv.FormatInt(n, 10) - } - } - if v, ok := h.PAXRecords[paxKey]; ok && v == strconv.FormatInt(n, 10) { - paxHdrs[paxKey] = v - } - } - verifyTime := func(ts time.Time, size int, name, paxKey string) { - if ts.IsZero() { - return // Always okay - } - if !fitsInBase256(size, ts.Unix()) { - whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%v", name, ts) - format.mustNotBe(FormatGNU) - } - isMtime := paxKey == paxMtime - fitsOctal := fitsInOctal(size, ts.Unix()) - if (isMtime && !fitsOctal) || !isMtime { - whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%v", name, ts) - format.mustNotBe(FormatUSTAR) - } - needsNano := ts.Nanosecond() != 0 - if !isMtime || !fitsOctal || needsNano { - preferPAX = true // USTAR may truncate sub-second measurements - if paxKey == paxNone { - whyNoPAX = fmt.Sprintf("PAX cannot encode %s=%v", name, ts) - format.mustNotBe(FormatPAX) - } else { - paxHdrs[paxKey] = formatPAXTime(ts) - } - } - if v, ok := h.PAXRecords[paxKey]; ok && v == formatPAXTime(ts) { - paxHdrs[paxKey] = v - } - } - - // Check basic fields. - var blk block - v7 := blk.V7() - ustar := blk.USTAR() - gnu := blk.GNU() - verifyString(h.Name, len(v7.Name()), "Name", paxPath) - verifyString(h.Linkname, len(v7.LinkName()), "Linkname", paxLinkpath) - verifyString(h.Uname, len(ustar.UserName()), "Uname", paxUname) - verifyString(h.Gname, len(ustar.GroupName()), "Gname", paxGname) - verifyNumeric(h.Mode, len(v7.Mode()), "Mode", paxNone) - verifyNumeric(int64(h.Uid), len(v7.UID()), "Uid", paxUid) - verifyNumeric(int64(h.Gid), len(v7.GID()), "Gid", paxGid) - verifyNumeric(h.Size, len(v7.Size()), "Size", paxSize) - verifyNumeric(h.Devmajor, len(ustar.DevMajor()), "Devmajor", paxNone) - verifyNumeric(h.Devminor, len(ustar.DevMinor()), "Devminor", paxNone) - verifyTime(h.ModTime, len(v7.ModTime()), "ModTime", paxMtime) - verifyTime(h.AccessTime, len(gnu.AccessTime()), "AccessTime", paxAtime) - verifyTime(h.ChangeTime, len(gnu.ChangeTime()), "ChangeTime", paxCtime) - - // Check for header-only types. - var whyOnlyPAX, whyOnlyGNU string - switch h.Typeflag { - case TypeReg, TypeChar, TypeBlock, TypeFifo, TypeGNUSparse: - // Exclude TypeLink and TypeSymlink, since they may reference directories. - if strings.HasSuffix(h.Name, "/") { - return FormatUnknown, nil, headerError{"filename may not have trailing slash"} - } - case TypeXHeader, TypeGNULongName, TypeGNULongLink: - return FormatUnknown, nil, headerError{"cannot manually encode TypeXHeader, TypeGNULongName, or TypeGNULongLink headers"} - case TypeXGlobalHeader: - h2 := Header{Name: h.Name, Typeflag: h.Typeflag, Xattrs: h.Xattrs, PAXRecords: h.PAXRecords, Format: h.Format} - if !reflect.DeepEqual(h, h2) { - return FormatUnknown, nil, headerError{"only PAXRecords should be set for TypeXGlobalHeader"} - } - whyOnlyPAX = "only PAX supports TypeXGlobalHeader" - format.mayOnlyBe(FormatPAX) - } - if !isHeaderOnlyType(h.Typeflag) && h.Size < 0 { - return FormatUnknown, nil, headerError{"negative size on header-only type"} - } - - // Check PAX records. - if len(h.Xattrs) > 0 { - for k, v := range h.Xattrs { - paxHdrs[paxSchilyXattr+k] = v - } - whyOnlyPAX = "only PAX supports Xattrs" - format.mayOnlyBe(FormatPAX) - } - if len(h.PAXRecords) > 0 { - for k, v := range h.PAXRecords { - switch _, exists := paxHdrs[k]; { - case exists: - continue // Do not overwrite existing records - case h.Typeflag == TypeXGlobalHeader: - paxHdrs[k] = v // Copy all records - case !basicKeys[k] && !strings.HasPrefix(k, paxGNUSparse): - paxHdrs[k] = v // Ignore local records that may conflict - } - } - whyOnlyPAX = "only PAX supports PAXRecords" - format.mayOnlyBe(FormatPAX) - } - for k, v := range paxHdrs { - if !validPAXRecord(k, v) { - return FormatUnknown, nil, headerError{fmt.Sprintf("invalid PAX record: %q", k+" = "+v)} - } - } - - // TODO(dsnet): Re-enable this when adding sparse support. - // See https://golang.org/issue/22735 - /* - // Check sparse files. - if len(h.SparseHoles) > 0 || h.Typeflag == TypeGNUSparse { - if isHeaderOnlyType(h.Typeflag) { - return FormatUnknown, nil, headerError{"header-only type cannot be sparse"} - } - if !validateSparseEntries(h.SparseHoles, h.Size) { - return FormatUnknown, nil, headerError{"invalid sparse holes"} - } - if h.Typeflag == TypeGNUSparse { - whyOnlyGNU = "only GNU supports TypeGNUSparse" - format.mayOnlyBe(FormatGNU) - } else { - whyNoGNU = "GNU supports sparse files only with TypeGNUSparse" - format.mustNotBe(FormatGNU) - } - whyNoUSTAR = "USTAR does not support sparse files" - format.mustNotBe(FormatUSTAR) - } - */ - - // Check desired format. - if wantFormat := h.Format; wantFormat != FormatUnknown { - if wantFormat.has(FormatPAX) && !preferPAX { - wantFormat.mayBe(FormatUSTAR) // PAX implies USTAR allowed too - } - format.mayOnlyBe(wantFormat) // Set union of formats allowed and format wanted - } - if format == FormatUnknown { - switch h.Format { - case FormatUSTAR: - err = headerError{"Format specifies USTAR", whyNoUSTAR, whyOnlyPAX, whyOnlyGNU} - case FormatPAX: - err = headerError{"Format specifies PAX", whyNoPAX, whyOnlyGNU} - case FormatGNU: - err = headerError{"Format specifies GNU", whyNoGNU, whyOnlyPAX} - default: - err = headerError{whyNoUSTAR, whyNoPAX, whyNoGNU, whyOnlyPAX, whyOnlyGNU} - } - } - return format, paxHdrs, err -} - -// FileInfo returns an os.FileInfo for the Header. -func (h *Header) FileInfo() os.FileInfo { - return headerFileInfo{h} -} - -// headerFileInfo implements os.FileInfo. -type headerFileInfo struct { - h *Header -} - -func (fi headerFileInfo) Size() int64 { return fi.h.Size } -func (fi headerFileInfo) IsDir() bool { return fi.Mode().IsDir() } -func (fi headerFileInfo) ModTime() time.Time { return fi.h.ModTime } -func (fi headerFileInfo) Sys() interface{} { return fi.h } - -// Name returns the base name of the file. -func (fi headerFileInfo) Name() string { - if fi.IsDir() { - return path.Base(path.Clean(fi.h.Name)) - } - return path.Base(fi.h.Name) -} - -// Mode returns the permission and mode bits for the headerFileInfo. -func (fi headerFileInfo) Mode() (mode os.FileMode) { - // Set file permission bits. - mode = os.FileMode(fi.h.Mode).Perm() - - // Set setuid, setgid and sticky bits. - if fi.h.Mode&c_ISUID != 0 { - mode |= os.ModeSetuid - } - if fi.h.Mode&c_ISGID != 0 { - mode |= os.ModeSetgid - } - if fi.h.Mode&c_ISVTX != 0 { - mode |= os.ModeSticky - } - - // Set file mode bits; clear perm, setuid, setgid, and sticky bits. - switch m := os.FileMode(fi.h.Mode) &^ 07777; m { - case c_ISDIR: - mode |= os.ModeDir - case c_ISFIFO: - mode |= os.ModeNamedPipe - case c_ISLNK: - mode |= os.ModeSymlink - case c_ISBLK: - mode |= os.ModeDevice - case c_ISCHR: - mode |= os.ModeDevice - mode |= os.ModeCharDevice - case c_ISSOCK: - mode |= os.ModeSocket - } - - switch fi.h.Typeflag { - case TypeSymlink: - mode |= os.ModeSymlink - case TypeChar: - mode |= os.ModeDevice - mode |= os.ModeCharDevice - case TypeBlock: - mode |= os.ModeDevice - case TypeDir: - mode |= os.ModeDir - case TypeFifo: - mode |= os.ModeNamedPipe - } - - return mode -} - -// sysStat, if non-nil, populates h from system-dependent fields of fi. -var sysStat func(fi os.FileInfo, h *Header) error - -const ( - // Mode constants from the USTAR spec: - // See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 - c_ISUID = 04000 // Set uid - c_ISGID = 02000 // Set gid - c_ISVTX = 01000 // Save text (sticky bit) - - // Common Unix mode constants; these are not defined in any common tar standard. - // Header.FileInfo understands these, but FileInfoHeader will never produce these. - c_ISDIR = 040000 // Directory - c_ISFIFO = 010000 // FIFO - c_ISREG = 0100000 // Regular file - c_ISLNK = 0120000 // Symbolic link - c_ISBLK = 060000 // Block special file - c_ISCHR = 020000 // Character special file - c_ISSOCK = 0140000 // Socket -) - -// FileInfoHeader creates a partially-populated Header from fi. -// If fi describes a symlink, FileInfoHeader records link as the link target. -// If fi describes a directory, a slash is appended to the name. -// -// Since os.FileInfo's Name method only returns the base name of -// the file it describes, it may be necessary to modify Header.Name -// to provide the full path name of the file. -func FileInfoHeader(fi os.FileInfo, link string) (*Header, error) { - if fi == nil { - return nil, errors.New("archive/tar: FileInfo is nil") - } - fm := fi.Mode() - h := &Header{ - Name: fi.Name(), - ModTime: fi.ModTime(), - Mode: int64(fm.Perm()), // or'd with c_IS* constants later - } - switch { - case fm.IsRegular(): - h.Typeflag = TypeReg - h.Size = fi.Size() - case fi.IsDir(): - h.Typeflag = TypeDir - h.Name += "/" - case fm&os.ModeSymlink != 0: - h.Typeflag = TypeSymlink - h.Linkname = link - case fm&os.ModeDevice != 0: - if fm&os.ModeCharDevice != 0 { - h.Typeflag = TypeChar - } else { - h.Typeflag = TypeBlock - } - case fm&os.ModeNamedPipe != 0: - h.Typeflag = TypeFifo - case fm&os.ModeSocket != 0: - return nil, fmt.Errorf("archive/tar: sockets not supported") - default: - return nil, fmt.Errorf("archive/tar: unknown file mode %v", fm) - } - if fm&os.ModeSetuid != 0 { - h.Mode |= c_ISUID - } - if fm&os.ModeSetgid != 0 { - h.Mode |= c_ISGID - } - if fm&os.ModeSticky != 0 { - h.Mode |= c_ISVTX - } - // If possible, populate additional fields from OS-specific - // FileInfo fields. - if sys, ok := fi.Sys().(*Header); ok { - // This FileInfo came from a Header (not the OS). Use the - // original Header to populate all remaining fields. - h.Uid = sys.Uid - h.Gid = sys.Gid - h.Uname = sys.Uname - h.Gname = sys.Gname - h.AccessTime = sys.AccessTime - h.ChangeTime = sys.ChangeTime - if sys.Xattrs != nil { - h.Xattrs = make(map[string]string) - for k, v := range sys.Xattrs { - h.Xattrs[k] = v - } - } - if sys.Typeflag == TypeLink { - // hard link - h.Typeflag = TypeLink - h.Size = 0 - h.Linkname = sys.Linkname - } - if sys.PAXRecords != nil { - h.PAXRecords = make(map[string]string) - for k, v := range sys.PAXRecords { - h.PAXRecords[k] = v - } - } - } - if sysStat != nil { - return h, sysStat(fi, h) - } - return h, nil -} - -// isHeaderOnlyType checks if the given type flag is of the type that has no -// data section even if a size is specified. -func isHeaderOnlyType(flag byte) bool { - switch flag { - case TypeLink, TypeSymlink, TypeChar, TypeBlock, TypeDir, TypeFifo: - return true - default: - return false - } -} - -func min(a, b int64) int64 { - if a < b { - return a - } - return b -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/format.go b/vendor/github.com/vbatts/tar-split/archive/tar/format.go deleted file mode 100644 index 1f89d0c59a..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/format.go +++ /dev/null @@ -1,303 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package tar - -import "strings" - -// Format represents the tar archive format. -// -// The original tar format was introduced in Unix V7. -// Since then, there have been multiple competing formats attempting to -// standardize or extend the V7 format to overcome its limitations. -// The most common formats are the USTAR, PAX, and GNU formats, -// each with their own advantages and limitations. -// -// The following table captures the capabilities of each format: -// -// | USTAR | PAX | GNU -// ------------------+--------+-----------+---------- -// Name | 256B | unlimited | unlimited -// Linkname | 100B | unlimited | unlimited -// Size | uint33 | unlimited | uint89 -// Mode | uint21 | uint21 | uint57 -// Uid/Gid | uint21 | unlimited | uint57 -// Uname/Gname | 32B | unlimited | 32B -// ModTime | uint33 | unlimited | int89 -// AccessTime | n/a | unlimited | int89 -// ChangeTime | n/a | unlimited | int89 -// Devmajor/Devminor | uint21 | uint21 | uint57 -// ------------------+--------+-----------+---------- -// string encoding | ASCII | UTF-8 | binary -// sub-second times | no | yes | no -// sparse files | no | yes | yes -// -// The table's upper portion shows the Header fields, where each format reports -// the maximum number of bytes allowed for each string field and -// the integer type used to store each numeric field -// (where timestamps are stored as the number of seconds since the Unix epoch). -// -// The table's lower portion shows specialized features of each format, -// such as supported string encodings, support for sub-second timestamps, -// or support for sparse files. -// -// The Writer currently provides no support for sparse files. -type Format int - -// Constants to identify various tar formats. -const ( - // Deliberately hide the meaning of constants from public API. - _ Format = (1 << iota) / 4 // Sequence of 0, 0, 1, 2, 4, 8, etc... - - // FormatUnknown indicates that the format is unknown. - FormatUnknown - - // The format of the original Unix V7 tar tool prior to standardization. - formatV7 - - // FormatUSTAR represents the USTAR header format defined in POSIX.1-1988. - // - // While this format is compatible with most tar readers, - // the format has several limitations making it unsuitable for some usages. - // Most notably, it cannot support sparse files, files larger than 8GiB, - // filenames larger than 256 characters, and non-ASCII filenames. - // - // Reference: - // http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_06 - FormatUSTAR - - // FormatPAX represents the PAX header format defined in POSIX.1-2001. - // - // PAX extends USTAR by writing a special file with Typeflag TypeXHeader - // preceding the original header. This file contains a set of key-value - // records, which are used to overcome USTAR's shortcomings, in addition to - // providing the ability to have sub-second resolution for timestamps. - // - // Some newer formats add their own extensions to PAX by defining their - // own keys and assigning certain semantic meaning to the associated values. - // For example, sparse file support in PAX is implemented using keys - // defined by the GNU manual (e.g., "GNU.sparse.map"). - // - // Reference: - // http://pubs.opengroup.org/onlinepubs/009695399/utilities/pax.html - FormatPAX - - // FormatGNU represents the GNU header format. - // - // The GNU header format is older than the USTAR and PAX standards and - // is not compatible with them. The GNU format supports - // arbitrary file sizes, filenames of arbitrary encoding and length, - // sparse files, and other features. - // - // It is recommended that PAX be chosen over GNU unless the target - // application can only parse GNU formatted archives. - // - // Reference: - // https://www.gnu.org/software/tar/manual/html_node/Standard.html - FormatGNU - - // Schily's tar format, which is incompatible with USTAR. - // This does not cover STAR extensions to the PAX format; these fall under - // the PAX format. - formatSTAR - - formatMax -) - -func (f Format) has(f2 Format) bool { return f&f2 != 0 } -func (f *Format) mayBe(f2 Format) { *f |= f2 } -func (f *Format) mayOnlyBe(f2 Format) { *f &= f2 } -func (f *Format) mustNotBe(f2 Format) { *f &^= f2 } - -var formatNames = map[Format]string{ - formatV7: "V7", FormatUSTAR: "USTAR", FormatPAX: "PAX", FormatGNU: "GNU", formatSTAR: "STAR", -} - -func (f Format) String() string { - var ss []string - for f2 := Format(1); f2 < formatMax; f2 <<= 1 { - if f.has(f2) { - ss = append(ss, formatNames[f2]) - } - } - switch len(ss) { - case 0: - return "" - case 1: - return ss[0] - default: - return "(" + strings.Join(ss, " | ") + ")" - } -} - -// Magics used to identify various formats. -const ( - magicGNU, versionGNU = "ustar ", " \x00" - magicUSTAR, versionUSTAR = "ustar\x00", "00" - trailerSTAR = "tar\x00" -) - -// Size constants from various tar specifications. -const ( - blockSize = 512 // Size of each block in a tar stream - nameSize = 100 // Max length of the name field in USTAR format - prefixSize = 155 // Max length of the prefix field in USTAR format -) - -// blockPadding computes the number of bytes needed to pad offset up to the -// nearest block edge where 0 <= n < blockSize. -func blockPadding(offset int64) (n int64) { - return -offset & (blockSize - 1) -} - -var zeroBlock block - -type block [blockSize]byte - -// Convert block to any number of formats. -func (b *block) V7() *headerV7 { return (*headerV7)(b) } -func (b *block) GNU() *headerGNU { return (*headerGNU)(b) } -func (b *block) STAR() *headerSTAR { return (*headerSTAR)(b) } -func (b *block) USTAR() *headerUSTAR { return (*headerUSTAR)(b) } -func (b *block) Sparse() sparseArray { return (sparseArray)(b[:]) } - -// GetFormat checks that the block is a valid tar header based on the checksum. -// It then attempts to guess the specific format based on magic values. -// If the checksum fails, then FormatUnknown is returned. -func (b *block) GetFormat() Format { - // Verify checksum. - var p parser - value := p.parseOctal(b.V7().Chksum()) - chksum1, chksum2 := b.ComputeChecksum() - if p.err != nil || (value != chksum1 && value != chksum2) { - return FormatUnknown - } - - // Guess the magic values. - magic := string(b.USTAR().Magic()) - version := string(b.USTAR().Version()) - trailer := string(b.STAR().Trailer()) - switch { - case magic == magicUSTAR && trailer == trailerSTAR: - return formatSTAR - case magic == magicUSTAR: - return FormatUSTAR | FormatPAX - case magic == magicGNU && version == versionGNU: - return FormatGNU - default: - return formatV7 - } -} - -// SetFormat writes the magic values necessary for specified format -// and then updates the checksum accordingly. -func (b *block) SetFormat(format Format) { - // Set the magic values. - switch { - case format.has(formatV7): - // Do nothing. - case format.has(FormatGNU): - copy(b.GNU().Magic(), magicGNU) - copy(b.GNU().Version(), versionGNU) - case format.has(formatSTAR): - copy(b.STAR().Magic(), magicUSTAR) - copy(b.STAR().Version(), versionUSTAR) - copy(b.STAR().Trailer(), trailerSTAR) - case format.has(FormatUSTAR | FormatPAX): - copy(b.USTAR().Magic(), magicUSTAR) - copy(b.USTAR().Version(), versionUSTAR) - default: - panic("invalid format") - } - - // Update checksum. - // This field is special in that it is terminated by a NULL then space. - var f formatter - field := b.V7().Chksum() - chksum, _ := b.ComputeChecksum() // Possible values are 256..128776 - f.formatOctal(field[:7], chksum) // Never fails since 128776 < 262143 - field[7] = ' ' -} - -// ComputeChecksum computes the checksum for the header block. -// POSIX specifies a sum of the unsigned byte values, but the Sun tar used -// signed byte values. -// We compute and return both. -func (b *block) ComputeChecksum() (unsigned, signed int64) { - for i, c := range b { - if 148 <= i && i < 156 { - c = ' ' // Treat the checksum field itself as all spaces. - } - unsigned += int64(c) - signed += int64(int8(c)) - } - return unsigned, signed -} - -// Reset clears the block with all zeros. -func (b *block) Reset() { - *b = block{} -} - -type headerV7 [blockSize]byte - -func (h *headerV7) Name() []byte { return h[000:][:100] } -func (h *headerV7) Mode() []byte { return h[100:][:8] } -func (h *headerV7) UID() []byte { return h[108:][:8] } -func (h *headerV7) GID() []byte { return h[116:][:8] } -func (h *headerV7) Size() []byte { return h[124:][:12] } -func (h *headerV7) ModTime() []byte { return h[136:][:12] } -func (h *headerV7) Chksum() []byte { return h[148:][:8] } -func (h *headerV7) TypeFlag() []byte { return h[156:][:1] } -func (h *headerV7) LinkName() []byte { return h[157:][:100] } - -type headerGNU [blockSize]byte - -func (h *headerGNU) V7() *headerV7 { return (*headerV7)(h) } -func (h *headerGNU) Magic() []byte { return h[257:][:6] } -func (h *headerGNU) Version() []byte { return h[263:][:2] } -func (h *headerGNU) UserName() []byte { return h[265:][:32] } -func (h *headerGNU) GroupName() []byte { return h[297:][:32] } -func (h *headerGNU) DevMajor() []byte { return h[329:][:8] } -func (h *headerGNU) DevMinor() []byte { return h[337:][:8] } -func (h *headerGNU) AccessTime() []byte { return h[345:][:12] } -func (h *headerGNU) ChangeTime() []byte { return h[357:][:12] } -func (h *headerGNU) Sparse() sparseArray { return (sparseArray)(h[386:][:24*4+1]) } -func (h *headerGNU) RealSize() []byte { return h[483:][:12] } - -type headerSTAR [blockSize]byte - -func (h *headerSTAR) V7() *headerV7 { return (*headerV7)(h) } -func (h *headerSTAR) Magic() []byte { return h[257:][:6] } -func (h *headerSTAR) Version() []byte { return h[263:][:2] } -func (h *headerSTAR) UserName() []byte { return h[265:][:32] } -func (h *headerSTAR) GroupName() []byte { return h[297:][:32] } -func (h *headerSTAR) DevMajor() []byte { return h[329:][:8] } -func (h *headerSTAR) DevMinor() []byte { return h[337:][:8] } -func (h *headerSTAR) Prefix() []byte { return h[345:][:131] } -func (h *headerSTAR) AccessTime() []byte { return h[476:][:12] } -func (h *headerSTAR) ChangeTime() []byte { return h[488:][:12] } -func (h *headerSTAR) Trailer() []byte { return h[508:][:4] } - -type headerUSTAR [blockSize]byte - -func (h *headerUSTAR) V7() *headerV7 { return (*headerV7)(h) } -func (h *headerUSTAR) Magic() []byte { return h[257:][:6] } -func (h *headerUSTAR) Version() []byte { return h[263:][:2] } -func (h *headerUSTAR) UserName() []byte { return h[265:][:32] } -func (h *headerUSTAR) GroupName() []byte { return h[297:][:32] } -func (h *headerUSTAR) DevMajor() []byte { return h[329:][:8] } -func (h *headerUSTAR) DevMinor() []byte { return h[337:][:8] } -func (h *headerUSTAR) Prefix() []byte { return h[345:][:155] } - -type sparseArray []byte - -func (s sparseArray) Entry(i int) sparseElem { return (sparseElem)(s[i*24:]) } -func (s sparseArray) IsExtended() []byte { return s[24*s.MaxEntries():][:1] } -func (s sparseArray) MaxEntries() int { return len(s) / 24 } - -type sparseElem []byte - -func (s sparseElem) Offset() []byte { return s[00:][:12] } -func (s sparseElem) Length() []byte { return s[12:][:12] } diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go b/vendor/github.com/vbatts/tar-split/archive/tar/reader.go deleted file mode 100644 index fcf3215539..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/reader.go +++ /dev/null @@ -1,925 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package tar - -import ( - "bytes" - "io" - "io/ioutil" - "strconv" - "strings" - "time" -) - -// Reader provides sequential access to the contents of a tar archive. -// Reader.Next advances to the next file in the archive (including the first), -// and then Reader can be treated as an io.Reader to access the file's data. -type Reader struct { - r io.Reader - pad int64 // Amount of padding (ignored) after current file entry - curr fileReader // Reader for current file entry - blk block // Buffer to use as temporary local storage - - // err is a persistent error. - // It is only the responsibility of every exported method of Reader to - // ensure that this error is sticky. - err error - - RawAccounting bool // Whether to enable the access needed to reassemble the tar from raw bytes. Some performance/memory hit for this. - rawBytes *bytes.Buffer // last raw bits -} - -type fileReader interface { - io.Reader - fileState - - WriteTo(io.Writer) (int64, error) -} - -// RawBytes accesses the raw bytes of the archive, apart from the file payload itself. -// This includes the header and padding. -// -// # This call resets the current rawbytes buffer -// -// Only when RawAccounting is enabled, otherwise this returns nil -func (tr *Reader) RawBytes() []byte { - if !tr.RawAccounting { - return nil - } - if tr.rawBytes == nil { - tr.rawBytes = bytes.NewBuffer(nil) - } - defer tr.rawBytes.Reset() // if we've read them, then flush them. - - return tr.rawBytes.Bytes() - -} - -// NewReader creates a new Reader reading from r. -func NewReader(r io.Reader) *Reader { - return &Reader{r: r, curr: ®FileReader{r, 0}} -} - -// Next advances to the next entry in the tar archive. -// The Header.Size determines how many bytes can be read for the next file. -// Any remaining data in the current file is automatically discarded. -// -// io.EOF is returned at the end of the input. -func (tr *Reader) Next() (*Header, error) { - if tr.err != nil { - return nil, tr.err - } - hdr, err := tr.next() - tr.err = err - return hdr, err -} - -func (tr *Reader) next() (*Header, error) { - var paxHdrs map[string]string - var gnuLongName, gnuLongLink string - - if tr.RawAccounting { - if tr.rawBytes == nil { - tr.rawBytes = bytes.NewBuffer(nil) - } else { - tr.rawBytes.Reset() - } - } - - // Externally, Next iterates through the tar archive as if it is a series of - // files. Internally, the tar format often uses fake "files" to add meta - // data that describes the next file. These meta data "files" should not - // normally be visible to the outside. As such, this loop iterates through - // one or more "header files" until it finds a "normal file". - format := FormatUSTAR | FormatPAX | FormatGNU - for { - // Discard the remainder of the file and any padding. - if err := discard(tr, tr.curr.PhysicalRemaining()); err != nil { - return nil, err - } - n, err := tryReadFull(tr.r, tr.blk[:tr.pad]) - if err != nil { - return nil, err - } - if tr.RawAccounting { - tr.rawBytes.Write(tr.blk[:n]) - } - tr.pad = 0 - - hdr, rawHdr, err := tr.readHeader() - if err != nil { - return nil, err - } - if err := tr.handleRegularFile(hdr); err != nil { - return nil, err - } - format.mayOnlyBe(hdr.Format) - - // Check for PAX/GNU special headers and files. - switch hdr.Typeflag { - case TypeXHeader, TypeXGlobalHeader: - format.mayOnlyBe(FormatPAX) - paxHdrs, err = parsePAX(tr) - if err != nil { - return nil, err - } - if hdr.Typeflag == TypeXGlobalHeader { - if err = mergePAX(hdr, paxHdrs); err != nil { - return nil, err - } - return &Header{ - Name: hdr.Name, - Typeflag: hdr.Typeflag, - Xattrs: hdr.Xattrs, - PAXRecords: hdr.PAXRecords, - Format: format, - }, nil - } - continue // This is a meta header affecting the next header - case TypeGNULongName, TypeGNULongLink: - format.mayOnlyBe(FormatGNU) - realname, err := ioutil.ReadAll(tr) - if err != nil { - return nil, err - } - - if tr.RawAccounting { - tr.rawBytes.Write(realname) - } - - var p parser - switch hdr.Typeflag { - case TypeGNULongName: - gnuLongName = p.parseString(realname) - case TypeGNULongLink: - gnuLongLink = p.parseString(realname) - } - continue // This is a meta header affecting the next header - default: - // The old GNU sparse format is handled here since it is technically - // just a regular file with additional attributes. - - if err := mergePAX(hdr, paxHdrs); err != nil { - return nil, err - } - if gnuLongName != "" { - hdr.Name = gnuLongName - } - if gnuLongLink != "" { - hdr.Linkname = gnuLongLink - } - if hdr.Typeflag == TypeRegA { - if strings.HasSuffix(hdr.Name, "/") { - hdr.Typeflag = TypeDir // Legacy archives use trailing slash for directories - } else { - hdr.Typeflag = TypeReg - } - } - - // The extended headers may have updated the size. - // Thus, setup the regFileReader again after merging PAX headers. - if err := tr.handleRegularFile(hdr); err != nil { - return nil, err - } - - // Sparse formats rely on being able to read from the logical data - // section; there must be a preceding call to handleRegularFile. - if err := tr.handleSparseFile(hdr, rawHdr); err != nil { - return nil, err - } - - // Set the final guess at the format. - if format.has(FormatUSTAR) && format.has(FormatPAX) { - format.mayOnlyBe(FormatUSTAR) - } - hdr.Format = format - return hdr, nil // This is a file, so stop - } - } -} - -// handleRegularFile sets up the current file reader and padding such that it -// can only read the following logical data section. It will properly handle -// special headers that contain no data section. -func (tr *Reader) handleRegularFile(hdr *Header) error { - nb := hdr.Size - if isHeaderOnlyType(hdr.Typeflag) { - nb = 0 - } - if nb < 0 { - return ErrHeader - } - - tr.pad = blockPadding(nb) - tr.curr = ®FileReader{r: tr.r, nb: nb} - return nil -} - -// handleSparseFile checks if the current file is a sparse format of any type -// and sets the curr reader appropriately. -func (tr *Reader) handleSparseFile(hdr *Header, rawHdr *block) error { - var spd sparseDatas - var err error - if hdr.Typeflag == TypeGNUSparse { - spd, err = tr.readOldGNUSparseMap(hdr, rawHdr) - } else { - spd, err = tr.readGNUSparsePAXHeaders(hdr) - } - - // If sp is non-nil, then this is a sparse file. - // Note that it is possible for len(sp) == 0. - if err == nil && spd != nil { - if isHeaderOnlyType(hdr.Typeflag) || !validateSparseEntries(spd, hdr.Size) { - return ErrHeader - } - sph := invertSparseEntries(spd, hdr.Size) - tr.curr = &sparseFileReader{tr.curr, sph, 0} - } - return err -} - -// readGNUSparsePAXHeaders checks the PAX headers for GNU sparse headers. -// If they are found, then this function reads the sparse map and returns it. -// This assumes that 0.0 headers have already been converted to 0.1 headers -// by the PAX header parsing logic. -func (tr *Reader) readGNUSparsePAXHeaders(hdr *Header) (sparseDatas, error) { - // Identify the version of GNU headers. - var is1x0 bool - major, minor := hdr.PAXRecords[paxGNUSparseMajor], hdr.PAXRecords[paxGNUSparseMinor] - switch { - case major == "0" && (minor == "0" || minor == "1"): - is1x0 = false - case major == "1" && minor == "0": - is1x0 = true - case major != "" || minor != "": - return nil, nil // Unknown GNU sparse PAX version - case hdr.PAXRecords[paxGNUSparseMap] != "": - is1x0 = false // 0.0 and 0.1 did not have explicit version records, so guess - default: - return nil, nil // Not a PAX format GNU sparse file. - } - hdr.Format.mayOnlyBe(FormatPAX) - - // Update hdr from GNU sparse PAX headers. - if name := hdr.PAXRecords[paxGNUSparseName]; name != "" { - hdr.Name = name - } - size := hdr.PAXRecords[paxGNUSparseSize] - if size == "" { - size = hdr.PAXRecords[paxGNUSparseRealSize] - } - if size != "" { - n, err := strconv.ParseInt(size, 10, 64) - if err != nil { - return nil, ErrHeader - } - hdr.Size = n - } - - // Read the sparse map according to the appropriate format. - if is1x0 { - return readGNUSparseMap1x0(tr.curr) - } - return readGNUSparseMap0x1(hdr.PAXRecords) -} - -// mergePAX merges paxHdrs into hdr for all relevant fields of Header. -func mergePAX(hdr *Header, paxHdrs map[string]string) (err error) { - for k, v := range paxHdrs { - if v == "" { - continue // Keep the original USTAR value - } - var id64 int64 - switch k { - case paxPath: - hdr.Name = v - case paxLinkpath: - hdr.Linkname = v - case paxUname: - hdr.Uname = v - case paxGname: - hdr.Gname = v - case paxUid: - id64, err = strconv.ParseInt(v, 10, 64) - hdr.Uid = int(id64) // Integer overflow possible - case paxGid: - id64, err = strconv.ParseInt(v, 10, 64) - hdr.Gid = int(id64) // Integer overflow possible - case paxAtime: - hdr.AccessTime, err = parsePAXTime(v) - case paxMtime: - hdr.ModTime, err = parsePAXTime(v) - case paxCtime: - hdr.ChangeTime, err = parsePAXTime(v) - case paxSize: - hdr.Size, err = strconv.ParseInt(v, 10, 64) - default: - if strings.HasPrefix(k, paxSchilyXattr) { - if hdr.Xattrs == nil { - hdr.Xattrs = make(map[string]string) - } - hdr.Xattrs[k[len(paxSchilyXattr):]] = v - } - } - if err != nil { - return ErrHeader - } - } - hdr.PAXRecords = paxHdrs - return nil -} - -// parsePAX parses PAX headers. -// If an extended header (type 'x') is invalid, ErrHeader is returned -func parsePAX(r io.Reader) (map[string]string, error) { - buf, err := ioutil.ReadAll(r) - if err != nil { - return nil, err - } - // leaving this function for io.Reader makes it more testable - if tr, ok := r.(*Reader); ok && tr.RawAccounting { - if _, err = tr.rawBytes.Write(buf); err != nil { - return nil, err - } - } - sbuf := string(buf) - - // For GNU PAX sparse format 0.0 support. - // This function transforms the sparse format 0.0 headers into format 0.1 - // headers since 0.0 headers were not PAX compliant. - var sparseMap []string - - paxHdrs := make(map[string]string) - for len(sbuf) > 0 { - key, value, residual, err := parsePAXRecord(sbuf) - if err != nil { - return nil, ErrHeader - } - sbuf = residual - - switch key { - case paxGNUSparseOffset, paxGNUSparseNumBytes: - // Validate sparse header order and value. - if (len(sparseMap)%2 == 0 && key != paxGNUSparseOffset) || - (len(sparseMap)%2 == 1 && key != paxGNUSparseNumBytes) || - strings.Contains(value, ",") { - return nil, ErrHeader - } - sparseMap = append(sparseMap, value) - default: - paxHdrs[key] = value - } - } - if len(sparseMap) > 0 { - paxHdrs[paxGNUSparseMap] = strings.Join(sparseMap, ",") - } - return paxHdrs, nil -} - -// readHeader reads the next block header and assumes that the underlying reader -// is already aligned to a block boundary. It returns the raw block of the -// header in case further processing is required. -// -// The err will be set to io.EOF only when one of the following occurs: -// - Exactly 0 bytes are read and EOF is hit. -// - Exactly 1 block of zeros is read and EOF is hit. -// - At least 2 blocks of zeros are read. -func (tr *Reader) readHeader() (*Header, *block, error) { - // Two blocks of zero bytes marks the end of the archive. - n, err := io.ReadFull(tr.r, tr.blk[:]) - if tr.RawAccounting && (err == nil || err == io.EOF) { - tr.rawBytes.Write(tr.blk[:n]) - } - if err != nil { - return nil, nil, err // EOF is okay here; exactly 0 bytes read - } - - if bytes.Equal(tr.blk[:], zeroBlock[:]) { - n, err = io.ReadFull(tr.r, tr.blk[:]) - if tr.RawAccounting && (err == nil || err == io.EOF) { - tr.rawBytes.Write(tr.blk[:n]) - } - if err != nil { - return nil, nil, err // EOF is okay here; exactly 1 block of zeros read - } - if bytes.Equal(tr.blk[:], zeroBlock[:]) { - return nil, nil, io.EOF // normal EOF; exactly 2 block of zeros read - } - return nil, nil, ErrHeader // Zero block and then non-zero block - } - - // Verify the header matches a known format. - format := tr.blk.GetFormat() - if format == FormatUnknown { - return nil, nil, ErrHeader - } - - var p parser - hdr := new(Header) - - // Unpack the V7 header. - v7 := tr.blk.V7() - hdr.Typeflag = v7.TypeFlag()[0] - hdr.Name = p.parseString(v7.Name()) - hdr.Linkname = p.parseString(v7.LinkName()) - hdr.Size = p.parseNumeric(v7.Size()) - hdr.Mode = p.parseNumeric(v7.Mode()) - hdr.Uid = int(p.parseNumeric(v7.UID())) - hdr.Gid = int(p.parseNumeric(v7.GID())) - hdr.ModTime = time.Unix(p.parseNumeric(v7.ModTime()), 0) - - // Unpack format specific fields. - if format > formatV7 { - ustar := tr.blk.USTAR() - hdr.Uname = p.parseString(ustar.UserName()) - hdr.Gname = p.parseString(ustar.GroupName()) - hdr.Devmajor = p.parseNumeric(ustar.DevMajor()) - hdr.Devminor = p.parseNumeric(ustar.DevMinor()) - - var prefix string - switch { - case format.has(FormatUSTAR | FormatPAX): - hdr.Format = format - ustar := tr.blk.USTAR() - prefix = p.parseString(ustar.Prefix()) - - // For Format detection, check if block is properly formatted since - // the parser is more liberal than what USTAR actually permits. - notASCII := func(r rune) bool { return r >= 0x80 } - if bytes.IndexFunc(tr.blk[:], notASCII) >= 0 { - hdr.Format = FormatUnknown // Non-ASCII characters in block. - } - nul := func(b []byte) bool { return int(b[len(b)-1]) == 0 } - if !(nul(v7.Size()) && nul(v7.Mode()) && nul(v7.UID()) && nul(v7.GID()) && - nul(v7.ModTime()) && nul(ustar.DevMajor()) && nul(ustar.DevMinor())) { - hdr.Format = FormatUnknown // Numeric fields must end in NUL - } - case format.has(formatSTAR): - star := tr.blk.STAR() - prefix = p.parseString(star.Prefix()) - hdr.AccessTime = time.Unix(p.parseNumeric(star.AccessTime()), 0) - hdr.ChangeTime = time.Unix(p.parseNumeric(star.ChangeTime()), 0) - case format.has(FormatGNU): - hdr.Format = format - var p2 parser - gnu := tr.blk.GNU() - if b := gnu.AccessTime(); b[0] != 0 { - hdr.AccessTime = time.Unix(p2.parseNumeric(b), 0) - } - if b := gnu.ChangeTime(); b[0] != 0 { - hdr.ChangeTime = time.Unix(p2.parseNumeric(b), 0) - } - - // Prior to Go1.8, the Writer had a bug where it would output - // an invalid tar file in certain rare situations because the logic - // incorrectly believed that the old GNU format had a prefix field. - // This is wrong and leads to an output file that mangles the - // atime and ctime fields, which are often left unused. - // - // In order to continue reading tar files created by former, buggy - // versions of Go, we skeptically parse the atime and ctime fields. - // If we are unable to parse them and the prefix field looks like - // an ASCII string, then we fallback on the pre-Go1.8 behavior - // of treating these fields as the USTAR prefix field. - // - // Note that this will not use the fallback logic for all possible - // files generated by a pre-Go1.8 toolchain. If the generated file - // happened to have a prefix field that parses as valid - // atime and ctime fields (e.g., when they are valid octal strings), - // then it is impossible to distinguish between an valid GNU file - // and an invalid pre-Go1.8 file. - // - // See https://golang.org/issues/12594 - // See https://golang.org/issues/21005 - if p2.err != nil { - hdr.AccessTime, hdr.ChangeTime = time.Time{}, time.Time{} - ustar := tr.blk.USTAR() - if s := p.parseString(ustar.Prefix()); isASCII(s) { - prefix = s - } - hdr.Format = FormatUnknown // Buggy file is not GNU - } - } - if len(prefix) > 0 { - hdr.Name = prefix + "/" + hdr.Name - } - } - return hdr, &tr.blk, p.err -} - -// readOldGNUSparseMap reads the sparse map from the old GNU sparse format. -// The sparse map is stored in the tar header if it's small enough. -// If it's larger than four entries, then one or more extension headers are used -// to store the rest of the sparse map. -// -// The Header.Size does not reflect the size of any extended headers used. -// Thus, this function will read from the raw io.Reader to fetch extra headers. -// This method mutates blk in the process. -func (tr *Reader) readOldGNUSparseMap(hdr *Header, blk *block) (sparseDatas, error) { - // Make sure that the input format is GNU. - // Unfortunately, the STAR format also has a sparse header format that uses - // the same type flag but has a completely different layout. - if blk.GetFormat() != FormatGNU { - return nil, ErrHeader - } - hdr.Format.mayOnlyBe(FormatGNU) - - var p parser - hdr.Size = p.parseNumeric(blk.GNU().RealSize()) - if p.err != nil { - return nil, p.err - } - s := blk.GNU().Sparse() - spd := make(sparseDatas, 0, s.MaxEntries()) - for { - for i := 0; i < s.MaxEntries(); i++ { - // This termination condition is identical to GNU and BSD tar. - if s.Entry(i).Offset()[0] == 0x00 { - break // Don't return, need to process extended headers (even if empty) - } - offset := p.parseNumeric(s.Entry(i).Offset()) - length := p.parseNumeric(s.Entry(i).Length()) - if p.err != nil { - return nil, p.err - } - spd = append(spd, sparseEntry{Offset: offset, Length: length}) - } - - if s.IsExtended()[0] > 0 { - // There are more entries. Read an extension header and parse its entries. - if _, err := mustReadFull(tr.r, blk[:]); err != nil { - return nil, err - } - if tr.RawAccounting { - tr.rawBytes.Write(blk[:]) - } - s = blk.Sparse() - continue - } - return spd, nil // Done - } -} - -// readGNUSparseMap1x0 reads the sparse map as stored in GNU's PAX sparse format -// version 1.0. The format of the sparse map consists of a series of -// newline-terminated numeric fields. The first field is the number of entries -// and is always present. Following this are the entries, consisting of two -// fields (offset, length). This function must stop reading at the end -// boundary of the block containing the last newline. -// -// Note that the GNU manual says that numeric values should be encoded in octal -// format. However, the GNU tar utility itself outputs these values in decimal. -// As such, this library treats values as being encoded in decimal. -func readGNUSparseMap1x0(r io.Reader) (sparseDatas, error) { - var ( - cntNewline int64 - buf bytes.Buffer - blk block - ) - - // feedTokens copies data in blocks from r into buf until there are - // at least cnt newlines in buf. It will not read more blocks than needed. - feedTokens := func(n int64) error { - for cntNewline < n { - if _, err := mustReadFull(r, blk[:]); err != nil { - return err - } - buf.Write(blk[:]) - for _, c := range blk { - if c == '\n' { - cntNewline++ - } - } - } - return nil - } - - // nextToken gets the next token delimited by a newline. This assumes that - // at least one newline exists in the buffer. - nextToken := func() string { - cntNewline-- - tok, _ := buf.ReadString('\n') - return strings.TrimRight(tok, "\n") - } - - // Parse for the number of entries. - // Use integer overflow resistant math to check this. - if err := feedTokens(1); err != nil { - return nil, err - } - numEntries, err := strconv.ParseInt(nextToken(), 10, 0) // Intentionally parse as native int - if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { - return nil, ErrHeader - } - - // Parse for all member entries. - // numEntries is trusted after this since a potential attacker must have - // committed resources proportional to what this library used. - if err := feedTokens(2 * numEntries); err != nil { - return nil, err - } - spd := make(sparseDatas, 0, numEntries) - for i := int64(0); i < numEntries; i++ { - offset, err1 := strconv.ParseInt(nextToken(), 10, 64) - length, err2 := strconv.ParseInt(nextToken(), 10, 64) - if err1 != nil || err2 != nil { - return nil, ErrHeader - } - spd = append(spd, sparseEntry{Offset: offset, Length: length}) - } - return spd, nil -} - -// readGNUSparseMap0x1 reads the sparse map as stored in GNU's PAX sparse format -// version 0.1. The sparse map is stored in the PAX headers. -func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) { - // Get number of entries. - // Use integer overflow resistant math to check this. - numEntriesStr := paxHdrs[paxGNUSparseNumBlocks] - numEntries, err := strconv.ParseInt(numEntriesStr, 10, 0) // Intentionally parse as native int - if err != nil || numEntries < 0 || int(2*numEntries) < int(numEntries) { - return nil, ErrHeader - } - - // There should be two numbers in sparseMap for each entry. - sparseMap := strings.Split(paxHdrs[paxGNUSparseMap], ",") - if len(sparseMap) == 1 && sparseMap[0] == "" { - sparseMap = sparseMap[:0] - } - if int64(len(sparseMap)) != 2*numEntries { - return nil, ErrHeader - } - - // Loop through the entries in the sparse map. - // numEntries is trusted now. - spd := make(sparseDatas, 0, numEntries) - for len(sparseMap) >= 2 { - offset, err1 := strconv.ParseInt(sparseMap[0], 10, 64) - length, err2 := strconv.ParseInt(sparseMap[1], 10, 64) - if err1 != nil || err2 != nil { - return nil, ErrHeader - } - spd = append(spd, sparseEntry{Offset: offset, Length: length}) - sparseMap = sparseMap[2:] - } - return spd, nil -} - -// Read reads from the current file in the tar archive. -// It returns (0, io.EOF) when it reaches the end of that file, -// until Next is called to advance to the next file. -// -// If the current file is sparse, then the regions marked as a hole -// are read back as NUL-bytes. -// -// Calling Read on special types like TypeLink, TypeSymlink, TypeChar, -// TypeBlock, TypeDir, and TypeFifo returns (0, io.EOF) regardless of what -// the Header.Size claims. -func (tr *Reader) Read(b []byte) (int, error) { - if tr.err != nil { - return 0, tr.err - } - n, err := tr.curr.Read(b) - if err != nil && err != io.EOF { - tr.err = err - } - return n, err -} - -// writeTo writes the content of the current file to w. -// The bytes written matches the number of remaining bytes in the current file. -// -// If the current file is sparse and w is an io.WriteSeeker, -// then writeTo uses Seek to skip past holes defined in Header.SparseHoles, -// assuming that skipped regions are filled with NULs. -// This always writes the last byte to ensure w is the right size. -// -// TODO(dsnet): Re-export this when adding sparse file support. -// See https://golang.org/issue/22735 -func (tr *Reader) writeTo(w io.Writer) (int64, error) { - if tr.err != nil { - return 0, tr.err - } - n, err := tr.curr.WriteTo(w) - if err != nil { - tr.err = err - } - return n, err -} - -// regFileReader is a fileReader for reading data from a regular file entry. -type regFileReader struct { - r io.Reader // Underlying Reader - nb int64 // Number of remaining bytes to read -} - -func (fr *regFileReader) Read(b []byte) (n int, err error) { - if int64(len(b)) > fr.nb { - b = b[:fr.nb] - } - if len(b) > 0 { - n, err = fr.r.Read(b) - fr.nb -= int64(n) - } - switch { - case err == io.EOF && fr.nb > 0: - return n, io.ErrUnexpectedEOF - case err == nil && fr.nb == 0: - return n, io.EOF - default: - return n, err - } -} - -func (fr *regFileReader) WriteTo(w io.Writer) (int64, error) { - return io.Copy(w, struct{ io.Reader }{fr}) -} - -func (fr regFileReader) LogicalRemaining() int64 { - return fr.nb -} - -func (fr regFileReader) PhysicalRemaining() int64 { - return fr.nb -} - -// sparseFileReader is a fileReader for reading data from a sparse file entry. -type sparseFileReader struct { - fr fileReader // Underlying fileReader - sp sparseHoles // Normalized list of sparse holes - pos int64 // Current position in sparse file -} - -func (sr *sparseFileReader) Read(b []byte) (n int, err error) { - finished := int64(len(b)) >= sr.LogicalRemaining() - if finished { - b = b[:sr.LogicalRemaining()] - } - - b0 := b - endPos := sr.pos + int64(len(b)) - for endPos > sr.pos && err == nil { - var nf int // Bytes read in fragment - holeStart, holeEnd := sr.sp[0].Offset, sr.sp[0].endOffset() - if sr.pos < holeStart { // In a data fragment - bf := b[:min(int64(len(b)), holeStart-sr.pos)] - nf, err = tryReadFull(sr.fr, bf) - } else { // In a hole fragment - bf := b[:min(int64(len(b)), holeEnd-sr.pos)] - nf, err = tryReadFull(zeroReader{}, bf) - } - b = b[nf:] - sr.pos += int64(nf) - if sr.pos >= holeEnd && len(sr.sp) > 1 { - sr.sp = sr.sp[1:] // Ensure last fragment always remains - } - } - - n = len(b0) - len(b) - switch { - case err == io.EOF: - return n, errMissData // Less data in dense file than sparse file - case err != nil: - return n, err - case sr.LogicalRemaining() == 0 && sr.PhysicalRemaining() > 0: - return n, errUnrefData // More data in dense file than sparse file - case finished: - return n, io.EOF - default: - return n, nil - } -} - -func (sr *sparseFileReader) WriteTo(w io.Writer) (n int64, err error) { - ws, ok := w.(io.WriteSeeker) - if ok { - if _, err := ws.Seek(0, io.SeekCurrent); err != nil { - ok = false // Not all io.Seeker can really seek - } - } - if !ok { - return io.Copy(w, struct{ io.Reader }{sr}) - } - - var writeLastByte bool - pos0 := sr.pos - for sr.LogicalRemaining() > 0 && !writeLastByte && err == nil { - var nf int64 // Size of fragment - holeStart, holeEnd := sr.sp[0].Offset, sr.sp[0].endOffset() - if sr.pos < holeStart { // In a data fragment - nf = holeStart - sr.pos - nf, err = io.CopyN(ws, sr.fr, nf) - } else { // In a hole fragment - nf = holeEnd - sr.pos - if sr.PhysicalRemaining() == 0 { - writeLastByte = true - nf-- - } - _, err = ws.Seek(nf, io.SeekCurrent) - } - sr.pos += nf - if sr.pos >= holeEnd && len(sr.sp) > 1 { - sr.sp = sr.sp[1:] // Ensure last fragment always remains - } - } - - // If the last fragment is a hole, then seek to 1-byte before EOF, and - // write a single byte to ensure the file is the right size. - if writeLastByte && err == nil { - _, err = ws.Write([]byte{0}) - sr.pos++ - } - - n = sr.pos - pos0 - switch { - case err == io.EOF: - return n, errMissData // Less data in dense file than sparse file - case err != nil: - return n, err - case sr.LogicalRemaining() == 0 && sr.PhysicalRemaining() > 0: - return n, errUnrefData // More data in dense file than sparse file - default: - return n, nil - } -} - -func (sr sparseFileReader) LogicalRemaining() int64 { - return sr.sp[len(sr.sp)-1].endOffset() - sr.pos -} -func (sr sparseFileReader) PhysicalRemaining() int64 { - return sr.fr.PhysicalRemaining() -} - -type zeroReader struct{} - -func (zeroReader) Read(b []byte) (int, error) { - for i := range b { - b[i] = 0 - } - return len(b), nil -} - -// mustReadFull is like io.ReadFull except it returns -// io.ErrUnexpectedEOF when io.EOF is hit before len(b) bytes are read. -func mustReadFull(r io.Reader, b []byte) (int, error) { - n, err := tryReadFull(r, b) - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - return n, err -} - -// tryReadFull is like io.ReadFull except it returns -// io.EOF when it is hit before len(b) bytes are read. -func tryReadFull(r io.Reader, b []byte) (n int, err error) { - for len(b) > n && err == nil { - var nn int - nn, err = r.Read(b[n:]) - n += nn - } - if len(b) == n && err == io.EOF { - err = nil - } - return n, err -} - -// discard skips n bytes in r, reporting an error if unable to do so. -func discard(tr *Reader, n int64) error { - var seekSkipped, copySkipped int64 - var err error - r := tr.r - if tr.RawAccounting { - - copySkipped, err = io.CopyN(tr.rawBytes, tr.r, n) - goto out - } - - // If possible, Seek to the last byte before the end of the data section. - // Do this because Seek is often lazy about reporting errors; this will mask - // the fact that the stream may be truncated. We can rely on the - // io.CopyN done shortly afterwards to trigger any IO errors. - if sr, ok := r.(io.Seeker); ok && n > 1 { - // Not all io.Seeker can actually Seek. For example, os.Stdin implements - // io.Seeker, but calling Seek always returns an error and performs - // no action. Thus, we try an innocent seek to the current position - // to see if Seek is really supported. - pos1, err := sr.Seek(0, io.SeekCurrent) - if pos1 >= 0 && err == nil { - // Seek seems supported, so perform the real Seek. - pos2, err := sr.Seek(n-1, io.SeekCurrent) - if pos2 < 0 || err != nil { - return err - } - seekSkipped = pos2 - pos1 - } - } - - copySkipped, err = io.CopyN(ioutil.Discard, r, n-seekSkipped) -out: - if err == io.EOF && seekSkipped+copySkipped < n { - err = io.ErrUnexpectedEOF - } - return err -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime1.go b/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime1.go deleted file mode 100644 index cf9cc79c59..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime1.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux dragonfly openbsd solaris - -package tar - -import ( - "syscall" - "time" -) - -func statAtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Atim.Unix()) -} - -func statCtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Ctim.Unix()) -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime2.go b/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime2.go deleted file mode 100644 index 6f17dbe307..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/stat_actime2.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd netbsd - -package tar - -import ( - "syscall" - "time" -) - -func statAtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Atimespec.Unix()) -} - -func statCtime(st *syscall.Stat_t) time.Time { - return time.Unix(st.Ctimespec.Unix()) -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go b/vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go deleted file mode 100644 index 868105f338..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/stat_unix.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux darwin dragonfly freebsd openbsd netbsd solaris - -package tar - -import ( - "os" - "os/user" - "runtime" - "strconv" - "sync" - "syscall" -) - -func init() { - sysStat = statUnix -} - -// userMap and groupMap caches UID and GID lookups for performance reasons. -// The downside is that renaming uname or gname by the OS never takes effect. -var userMap, groupMap sync.Map // map[int]string - -func statUnix(fi os.FileInfo, h *Header) error { - sys, ok := fi.Sys().(*syscall.Stat_t) - if !ok { - return nil - } - h.Uid = int(sys.Uid) - h.Gid = int(sys.Gid) - - // Best effort at populating Uname and Gname. - // The os/user functions may fail for any number of reasons - // (not implemented on that platform, cgo not enabled, etc). - if u, ok := userMap.Load(h.Uid); ok { - h.Uname = u.(string) - } else if u, err := user.LookupId(strconv.Itoa(h.Uid)); err == nil { - h.Uname = u.Username - userMap.Store(h.Uid, h.Uname) - } - if g, ok := groupMap.Load(h.Gid); ok { - h.Gname = g.(string) - } else if g, err := user.LookupGroupId(strconv.Itoa(h.Gid)); err == nil { - h.Gname = g.Name - groupMap.Store(h.Gid, h.Gname) - } - - h.AccessTime = statAtime(sys) - h.ChangeTime = statCtime(sys) - - // Best effort at populating Devmajor and Devminor. - if h.Typeflag == TypeChar || h.Typeflag == TypeBlock { - dev := uint64(sys.Rdev) // May be int32 or uint32 - switch runtime.GOOS { - case "linux": - // Copied from golang.org/x/sys/unix/dev_linux.go. - major := uint32((dev & 0x00000000000fff00) >> 8) - major |= uint32((dev & 0xfffff00000000000) >> 32) - minor := uint32((dev & 0x00000000000000ff) >> 0) - minor |= uint32((dev & 0x00000ffffff00000) >> 12) - h.Devmajor, h.Devminor = int64(major), int64(minor) - case "darwin": - // Copied from golang.org/x/sys/unix/dev_darwin.go. - major := uint32((dev >> 24) & 0xff) - minor := uint32(dev & 0xffffff) - h.Devmajor, h.Devminor = int64(major), int64(minor) - case "dragonfly": - // Copied from golang.org/x/sys/unix/dev_dragonfly.go. - major := uint32((dev >> 8) & 0xff) - minor := uint32(dev & 0xffff00ff) - h.Devmajor, h.Devminor = int64(major), int64(minor) - case "freebsd": - // Copied from golang.org/x/sys/unix/dev_freebsd.go. - major := uint32((dev >> 8) & 0xff) - minor := uint32(dev & 0xffff00ff) - h.Devmajor, h.Devminor = int64(major), int64(minor) - case "netbsd": - // Copied from golang.org/x/sys/unix/dev_netbsd.go. - major := uint32((dev & 0x000fff00) >> 8) - minor := uint32((dev & 0x000000ff) >> 0) - minor |= uint32((dev & 0xfff00000) >> 12) - h.Devmajor, h.Devminor = int64(major), int64(minor) - case "openbsd": - // Copied from golang.org/x/sys/unix/dev_openbsd.go. - major := uint32((dev & 0x0000ff00) >> 8) - minor := uint32((dev & 0x000000ff) >> 0) - minor |= uint32((dev & 0xffff0000) >> 8) - h.Devmajor, h.Devminor = int64(major), int64(minor) - default: - // TODO: Implement solaris (see https://golang.org/issue/8106) - } - } - return nil -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/strconv.go b/vendor/github.com/vbatts/tar-split/archive/tar/strconv.go deleted file mode 100644 index d144485a49..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/strconv.go +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package tar - -import ( - "bytes" - "fmt" - "strconv" - "strings" - "time" -) - -// hasNUL reports whether the NUL character exists within s. -func hasNUL(s string) bool { - return strings.IndexByte(s, 0) >= 0 -} - -// isASCII reports whether the input is an ASCII C-style string. -func isASCII(s string) bool { - for _, c := range s { - if c >= 0x80 || c == 0x00 { - return false - } - } - return true -} - -// toASCII converts the input to an ASCII C-style string. -// This a best effort conversion, so invalid characters are dropped. -func toASCII(s string) string { - if isASCII(s) { - return s - } - b := make([]byte, 0, len(s)) - for _, c := range s { - if c < 0x80 && c != 0x00 { - b = append(b, byte(c)) - } - } - return string(b) -} - -type parser struct { - err error // Last error seen -} - -type formatter struct { - err error // Last error seen -} - -// parseString parses bytes as a NUL-terminated C-style string. -// If a NUL byte is not found then the whole slice is returned as a string. -func (*parser) parseString(b []byte) string { - if i := bytes.IndexByte(b, 0); i >= 0 { - return string(b[:i]) - } - return string(b) -} - -// formatString copies s into b, NUL-terminating if possible. -func (f *formatter) formatString(b []byte, s string) { - if len(s) > len(b) { - f.err = ErrFieldTooLong - } - copy(b, s) - if len(s) < len(b) { - b[len(s)] = 0 - } - - // Some buggy readers treat regular files with a trailing slash - // in the V7 path field as a directory even though the full path - // recorded elsewhere (e.g., via PAX record) contains no trailing slash. - if len(s) > len(b) && b[len(b)-1] == '/' { - n := len(strings.TrimRight(s[:len(b)], "/")) - b[n] = 0 // Replace trailing slash with NUL terminator - } -} - -// fitsInBase256 reports whether x can be encoded into n bytes using base-256 -// encoding. Unlike octal encoding, base-256 encoding does not require that the -// string ends with a NUL character. Thus, all n bytes are available for output. -// -// If operating in binary mode, this assumes strict GNU binary mode; which means -// that the first byte can only be either 0x80 or 0xff. Thus, the first byte is -// equivalent to the sign bit in two's complement form. -func fitsInBase256(n int, x int64) bool { - binBits := uint(n-1) * 8 - return n >= 9 || (x >= -1< 0 && b[0]&0x80 != 0 { - // Handling negative numbers relies on the following identity: - // -a-1 == ^a - // - // If the number is negative, we use an inversion mask to invert the - // data bytes and treat the value as an unsigned number. - var inv byte // 0x00 if positive or zero, 0xff if negative - if b[0]&0x40 != 0 { - inv = 0xff - } - - var x uint64 - for i, c := range b { - c ^= inv // Inverts c only if inv is 0xff, otherwise does nothing - if i == 0 { - c &= 0x7f // Ignore signal bit in first byte - } - if (x >> 56) > 0 { - p.err = ErrHeader // Integer overflow - return 0 - } - x = x<<8 | uint64(c) - } - if (x >> 63) > 0 { - p.err = ErrHeader // Integer overflow - return 0 - } - if inv == 0xff { - return ^int64(x) - } - return int64(x) - } - - // Normal case is base-8 (octal) format. - return p.parseOctal(b) -} - -// formatNumeric encodes x into b using base-8 (octal) encoding if possible. -// Otherwise it will attempt to use base-256 (binary) encoding. -func (f *formatter) formatNumeric(b []byte, x int64) { - if fitsInOctal(len(b), x) { - f.formatOctal(b, x) - return - } - - if fitsInBase256(len(b), x) { - for i := len(b) - 1; i >= 0; i-- { - b[i] = byte(x) - x >>= 8 - } - b[0] |= 0x80 // Highest bit indicates binary format - return - } - - f.formatOctal(b, 0) // Last resort, just write zero - f.err = ErrFieldTooLong -} - -func (p *parser) parseOctal(b []byte) int64 { - // Because unused fields are filled with NULs, we need - // to skip leading NULs. Fields may also be padded with - // spaces or NULs. - // So we remove leading and trailing NULs and spaces to - // be sure. - b = bytes.Trim(b, " \x00") - - if len(b) == 0 { - return 0 - } - x, perr := strconv.ParseUint(p.parseString(b), 8, 64) - if perr != nil { - p.err = ErrHeader - } - return int64(x) -} - -func (f *formatter) formatOctal(b []byte, x int64) { - if !fitsInOctal(len(b), x) { - x = 0 // Last resort, just write zero - f.err = ErrFieldTooLong - } - - s := strconv.FormatInt(x, 8) - // Add leading zeros, but leave room for a NUL. - if n := len(b) - len(s) - 1; n > 0 { - s = strings.Repeat("0", n) + s - } - f.formatString(b, s) -} - -// fitsInOctal reports whether the integer x fits in a field n-bytes long -// using octal encoding with the appropriate NUL terminator. -func fitsInOctal(n int, x int64) bool { - octBits := uint(n-1) * 3 - return x >= 0 && (n >= 22 || x < 1<= 0 { - ss, sn = s[:pos], s[pos+1:] - } - - // Parse the seconds. - secs, err := strconv.ParseInt(ss, 10, 64) - if err != nil { - return time.Time{}, ErrHeader - } - if len(sn) == 0 { - return time.Unix(secs, 0), nil // No sub-second values - } - - // Parse the nanoseconds. - if strings.Trim(sn, "0123456789") != "" { - return time.Time{}, ErrHeader - } - if len(sn) < maxNanoSecondDigits { - sn += strings.Repeat("0", maxNanoSecondDigits-len(sn)) // Right pad - } else { - sn = sn[:maxNanoSecondDigits] // Right truncate - } - nsecs, _ := strconv.ParseInt(sn, 10, 64) // Must succeed - if len(ss) > 0 && ss[0] == '-' { - return time.Unix(secs, -1*nsecs), nil // Negative correction - } - return time.Unix(secs, nsecs), nil -} - -// formatPAXTime converts ts into a time of the form %d.%d as described in the -// PAX specification. This function is capable of negative timestamps. -func formatPAXTime(ts time.Time) (s string) { - secs, nsecs := ts.Unix(), ts.Nanosecond() - if nsecs == 0 { - return strconv.FormatInt(secs, 10) - } - - // If seconds is negative, then perform correction. - sign := "" - if secs < 0 { - sign = "-" // Remember sign - secs = -(secs + 1) // Add a second to secs - nsecs = -(nsecs - 1E9) // Take that second away from nsecs - } - return strings.TrimRight(fmt.Sprintf("%s%d.%09d", sign, secs, nsecs), "0") -} - -// parsePAXRecord parses the input PAX record string into a key-value pair. -// If parsing is successful, it will slice off the currently read record and -// return the remainder as r. -func parsePAXRecord(s string) (k, v, r string, err error) { - // The size field ends at the first space. - sp := strings.IndexByte(s, ' ') - if sp == -1 { - return "", "", s, ErrHeader - } - - // Parse the first token as a decimal integer. - n, perr := strconv.ParseInt(s[:sp], 10, 0) // Intentionally parse as native int - if perr != nil || n < 5 || int64(len(s)) < n { - return "", "", s, ErrHeader - } - - // Extract everything between the space and the final newline. - rec, nl, rem := s[sp+1:n-1], s[n-1:n], s[n:] - if nl != "\n" { - return "", "", s, ErrHeader - } - - // The first equals separates the key from the value. - eq := strings.IndexByte(rec, '=') - if eq == -1 { - return "", "", s, ErrHeader - } - k, v = rec[:eq], rec[eq+1:] - - if !validPAXRecord(k, v) { - return "", "", s, ErrHeader - } - return k, v, rem, nil -} - -// formatPAXRecord formats a single PAX record, prefixing it with the -// appropriate length. -func formatPAXRecord(k, v string) (string, error) { - if !validPAXRecord(k, v) { - return "", ErrHeader - } - - const padding = 3 // Extra padding for ' ', '=', and '\n' - size := len(k) + len(v) + padding - size += len(strconv.Itoa(size)) - record := strconv.Itoa(size) + " " + k + "=" + v + "\n" - - // Final adjustment if adding size field increased the record size. - if len(record) != size { - size = len(record) - record = strconv.Itoa(size) + " " + k + "=" + v + "\n" - } - return record, nil -} - -// validPAXRecord reports whether the key-value pair is valid where each -// record is formatted as: -// "%d %s=%s\n" % (size, key, value) -// -// Keys and values should be UTF-8, but the number of bad writers out there -// forces us to be a more liberal. -// Thus, we only reject all keys with NUL, and only reject NULs in values -// for the PAX version of the USTAR string fields. -// The key must not contain an '=' character. -func validPAXRecord(k, v string) bool { - if k == "" || strings.IndexByte(k, '=') >= 0 { - return false - } - switch k { - case paxPath, paxLinkpath, paxUname, paxGname: - return !hasNUL(v) - default: - return !hasNUL(k) - } -} diff --git a/vendor/github.com/vbatts/tar-split/archive/tar/writer.go b/vendor/github.com/vbatts/tar-split/archive/tar/writer.go deleted file mode 100644 index e80498d03e..0000000000 --- a/vendor/github.com/vbatts/tar-split/archive/tar/writer.go +++ /dev/null @@ -1,653 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package tar - -import ( - "fmt" - "io" - "path" - "sort" - "strings" - "time" -) - -// Writer provides sequential writing of a tar archive. -// Write.WriteHeader begins a new file with the provided Header, -// and then Writer can be treated as an io.Writer to supply that file's data. -type Writer struct { - w io.Writer - pad int64 // Amount of padding to write after current file entry - curr fileWriter // Writer for current file entry - hdr Header // Shallow copy of Header that is safe for mutations - blk block // Buffer to use as temporary local storage - - // err is a persistent error. - // It is only the responsibility of every exported method of Writer to - // ensure that this error is sticky. - err error -} - -// NewWriter creates a new Writer writing to w. -func NewWriter(w io.Writer) *Writer { - return &Writer{w: w, curr: ®FileWriter{w, 0}} -} - -type fileWriter interface { - io.Writer - fileState - - ReadFrom(io.Reader) (int64, error) -} - -// Flush finishes writing the current file's block padding. -// The current file must be fully written before Flush can be called. -// -// This is unnecessary as the next call to WriteHeader or Close -// will implicitly flush out the file's padding. -func (tw *Writer) Flush() error { - if tw.err != nil { - return tw.err - } - if nb := tw.curr.LogicalRemaining(); nb > 0 { - return fmt.Errorf("archive/tar: missed writing %d bytes", nb) - } - if _, tw.err = tw.w.Write(zeroBlock[:tw.pad]); tw.err != nil { - return tw.err - } - tw.pad = 0 - return nil -} - -// WriteHeader writes hdr and prepares to accept the file's contents. -// The Header.Size determines how many bytes can be written for the next file. -// If the current file is not fully written, then this returns an error. -// This implicitly flushes any padding necessary before writing the header. -func (tw *Writer) WriteHeader(hdr *Header) error { - if err := tw.Flush(); err != nil { - return err - } - tw.hdr = *hdr // Shallow copy of Header - - // Avoid usage of the legacy TypeRegA flag, and automatically promote - // it to use TypeReg or TypeDir. - if tw.hdr.Typeflag == TypeRegA { - if strings.HasSuffix(tw.hdr.Name, "/") { - tw.hdr.Typeflag = TypeDir - } else { - tw.hdr.Typeflag = TypeReg - } - } - - // Round ModTime and ignore AccessTime and ChangeTime unless - // the format is explicitly chosen. - // This ensures nominal usage of WriteHeader (without specifying the format) - // does not always result in the PAX format being chosen, which - // causes a 1KiB increase to every header. - if tw.hdr.Format == FormatUnknown { - tw.hdr.ModTime = tw.hdr.ModTime.Round(time.Second) - tw.hdr.AccessTime = time.Time{} - tw.hdr.ChangeTime = time.Time{} - } - - allowedFormats, paxHdrs, err := tw.hdr.allowedFormats() - switch { - case allowedFormats.has(FormatUSTAR): - tw.err = tw.writeUSTARHeader(&tw.hdr) - return tw.err - case allowedFormats.has(FormatPAX): - tw.err = tw.writePAXHeader(&tw.hdr, paxHdrs) - return tw.err - case allowedFormats.has(FormatGNU): - tw.err = tw.writeGNUHeader(&tw.hdr) - return tw.err - default: - return err // Non-fatal error - } -} - -func (tw *Writer) writeUSTARHeader(hdr *Header) error { - // Check if we can use USTAR prefix/suffix splitting. - var namePrefix string - if prefix, suffix, ok := splitUSTARPath(hdr.Name); ok { - namePrefix, hdr.Name = prefix, suffix - } - - // Pack the main header. - var f formatter - blk := tw.templateV7Plus(hdr, f.formatString, f.formatOctal) - f.formatString(blk.USTAR().Prefix(), namePrefix) - blk.SetFormat(FormatUSTAR) - if f.err != nil { - return f.err // Should never happen since header is validated - } - return tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag) -} - -func (tw *Writer) writePAXHeader(hdr *Header, paxHdrs map[string]string) error { - realName, realSize := hdr.Name, hdr.Size - - // TODO(dsnet): Re-enable this when adding sparse support. - // See https://golang.org/issue/22735 - /* - // Handle sparse files. - var spd sparseDatas - var spb []byte - if len(hdr.SparseHoles) > 0 { - sph := append([]sparseEntry{}, hdr.SparseHoles...) // Copy sparse map - sph = alignSparseEntries(sph, hdr.Size) - spd = invertSparseEntries(sph, hdr.Size) - - // Format the sparse map. - hdr.Size = 0 // Replace with encoded size - spb = append(strconv.AppendInt(spb, int64(len(spd)), 10), '\n') - for _, s := range spd { - hdr.Size += s.Length - spb = append(strconv.AppendInt(spb, s.Offset, 10), '\n') - spb = append(strconv.AppendInt(spb, s.Length, 10), '\n') - } - pad := blockPadding(int64(len(spb))) - spb = append(spb, zeroBlock[:pad]...) - hdr.Size += int64(len(spb)) // Accounts for encoded sparse map - - // Add and modify appropriate PAX records. - dir, file := path.Split(realName) - hdr.Name = path.Join(dir, "GNUSparseFile.0", file) - paxHdrs[paxGNUSparseMajor] = "1" - paxHdrs[paxGNUSparseMinor] = "0" - paxHdrs[paxGNUSparseName] = realName - paxHdrs[paxGNUSparseRealSize] = strconv.FormatInt(realSize, 10) - paxHdrs[paxSize] = strconv.FormatInt(hdr.Size, 10) - delete(paxHdrs, paxPath) // Recorded by paxGNUSparseName - } - */ - _ = realSize - - // Write PAX records to the output. - isGlobal := hdr.Typeflag == TypeXGlobalHeader - if len(paxHdrs) > 0 || isGlobal { - // Sort keys for deterministic ordering. - var keys []string - for k := range paxHdrs { - keys = append(keys, k) - } - sort.Strings(keys) - - // Write each record to a buffer. - var buf strings.Builder - for _, k := range keys { - rec, err := formatPAXRecord(k, paxHdrs[k]) - if err != nil { - return err - } - buf.WriteString(rec) - } - - // Write the extended header file. - var name string - var flag byte - if isGlobal { - name = realName - if name == "" { - name = "GlobalHead.0.0" - } - flag = TypeXGlobalHeader - } else { - dir, file := path.Split(realName) - name = path.Join(dir, "PaxHeaders.0", file) - flag = TypeXHeader - } - data := buf.String() - if err := tw.writeRawFile(name, data, flag, FormatPAX); err != nil || isGlobal { - return err // Global headers return here - } - } - - // Pack the main header. - var f formatter // Ignore errors since they are expected - fmtStr := func(b []byte, s string) { f.formatString(b, toASCII(s)) } - blk := tw.templateV7Plus(hdr, fmtStr, f.formatOctal) - blk.SetFormat(FormatPAX) - if err := tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag); err != nil { - return err - } - - // TODO(dsnet): Re-enable this when adding sparse support. - // See https://golang.org/issue/22735 - /* - // Write the sparse map and setup the sparse writer if necessary. - if len(spd) > 0 { - // Use tw.curr since the sparse map is accounted for in hdr.Size. - if _, err := tw.curr.Write(spb); err != nil { - return err - } - tw.curr = &sparseFileWriter{tw.curr, spd, 0} - } - */ - return nil -} - -func (tw *Writer) writeGNUHeader(hdr *Header) error { - // Use long-link files if Name or Linkname exceeds the field size. - const longName = "././@LongLink" - if len(hdr.Name) > nameSize { - data := hdr.Name + "\x00" - if err := tw.writeRawFile(longName, data, TypeGNULongName, FormatGNU); err != nil { - return err - } - } - if len(hdr.Linkname) > nameSize { - data := hdr.Linkname + "\x00" - if err := tw.writeRawFile(longName, data, TypeGNULongLink, FormatGNU); err != nil { - return err - } - } - - // Pack the main header. - var f formatter // Ignore errors since they are expected - var spd sparseDatas - var spb []byte - blk := tw.templateV7Plus(hdr, f.formatString, f.formatNumeric) - if !hdr.AccessTime.IsZero() { - f.formatNumeric(blk.GNU().AccessTime(), hdr.AccessTime.Unix()) - } - if !hdr.ChangeTime.IsZero() { - f.formatNumeric(blk.GNU().ChangeTime(), hdr.ChangeTime.Unix()) - } - // TODO(dsnet): Re-enable this when adding sparse support. - // See https://golang.org/issue/22735 - /* - if hdr.Typeflag == TypeGNUSparse { - sph := append([]sparseEntry{}, hdr.SparseHoles...) // Copy sparse map - sph = alignSparseEntries(sph, hdr.Size) - spd = invertSparseEntries(sph, hdr.Size) - - // Format the sparse map. - formatSPD := func(sp sparseDatas, sa sparseArray) sparseDatas { - for i := 0; len(sp) > 0 && i < sa.MaxEntries(); i++ { - f.formatNumeric(sa.Entry(i).Offset(), sp[0].Offset) - f.formatNumeric(sa.Entry(i).Length(), sp[0].Length) - sp = sp[1:] - } - if len(sp) > 0 { - sa.IsExtended()[0] = 1 - } - return sp - } - sp2 := formatSPD(spd, blk.GNU().Sparse()) - for len(sp2) > 0 { - var spHdr block - sp2 = formatSPD(sp2, spHdr.Sparse()) - spb = append(spb, spHdr[:]...) - } - - // Update size fields in the header block. - realSize := hdr.Size - hdr.Size = 0 // Encoded size; does not account for encoded sparse map - for _, s := range spd { - hdr.Size += s.Length - } - copy(blk.V7().Size(), zeroBlock[:]) // Reset field - f.formatNumeric(blk.V7().Size(), hdr.Size) - f.formatNumeric(blk.GNU().RealSize(), realSize) - } - */ - blk.SetFormat(FormatGNU) - if err := tw.writeRawHeader(blk, hdr.Size, hdr.Typeflag); err != nil { - return err - } - - // Write the extended sparse map and setup the sparse writer if necessary. - if len(spd) > 0 { - // Use tw.w since the sparse map is not accounted for in hdr.Size. - if _, err := tw.w.Write(spb); err != nil { - return err - } - tw.curr = &sparseFileWriter{tw.curr, spd, 0} - } - return nil -} - -type ( - stringFormatter func([]byte, string) - numberFormatter func([]byte, int64) -) - -// templateV7Plus fills out the V7 fields of a block using values from hdr. -// It also fills out fields (uname, gname, devmajor, devminor) that are -// shared in the USTAR, PAX, and GNU formats using the provided formatters. -// -// The block returned is only valid until the next call to -// templateV7Plus or writeRawFile. -func (tw *Writer) templateV7Plus(hdr *Header, fmtStr stringFormatter, fmtNum numberFormatter) *block { - tw.blk.Reset() - - modTime := hdr.ModTime - if modTime.IsZero() { - modTime = time.Unix(0, 0) - } - - v7 := tw.blk.V7() - v7.TypeFlag()[0] = hdr.Typeflag - fmtStr(v7.Name(), hdr.Name) - fmtStr(v7.LinkName(), hdr.Linkname) - fmtNum(v7.Mode(), hdr.Mode) - fmtNum(v7.UID(), int64(hdr.Uid)) - fmtNum(v7.GID(), int64(hdr.Gid)) - fmtNum(v7.Size(), hdr.Size) - fmtNum(v7.ModTime(), modTime.Unix()) - - ustar := tw.blk.USTAR() - fmtStr(ustar.UserName(), hdr.Uname) - fmtStr(ustar.GroupName(), hdr.Gname) - fmtNum(ustar.DevMajor(), hdr.Devmajor) - fmtNum(ustar.DevMinor(), hdr.Devminor) - - return &tw.blk -} - -// writeRawFile writes a minimal file with the given name and flag type. -// It uses format to encode the header format and will write data as the body. -// It uses default values for all of the other fields (as BSD and GNU tar does). -func (tw *Writer) writeRawFile(name, data string, flag byte, format Format) error { - tw.blk.Reset() - - // Best effort for the filename. - name = toASCII(name) - if len(name) > nameSize { - name = name[:nameSize] - } - name = strings.TrimRight(name, "/") - - var f formatter - v7 := tw.blk.V7() - v7.TypeFlag()[0] = flag - f.formatString(v7.Name(), name) - f.formatOctal(v7.Mode(), 0) - f.formatOctal(v7.UID(), 0) - f.formatOctal(v7.GID(), 0) - f.formatOctal(v7.Size(), int64(len(data))) // Must be < 8GiB - f.formatOctal(v7.ModTime(), 0) - tw.blk.SetFormat(format) - if f.err != nil { - return f.err // Only occurs if size condition is violated - } - - // Write the header and data. - if err := tw.writeRawHeader(&tw.blk, int64(len(data)), flag); err != nil { - return err - } - _, err := io.WriteString(tw, data) - return err -} - -// writeRawHeader writes the value of blk, regardless of its value. -// It sets up the Writer such that it can accept a file of the given size. -// If the flag is a special header-only flag, then the size is treated as zero. -func (tw *Writer) writeRawHeader(blk *block, size int64, flag byte) error { - if err := tw.Flush(); err != nil { - return err - } - if _, err := tw.w.Write(blk[:]); err != nil { - return err - } - if isHeaderOnlyType(flag) { - size = 0 - } - tw.curr = ®FileWriter{tw.w, size} - tw.pad = blockPadding(size) - return nil -} - -// splitUSTARPath splits a path according to USTAR prefix and suffix rules. -// If the path is not splittable, then it will return ("", "", false). -func splitUSTARPath(name string) (prefix, suffix string, ok bool) { - length := len(name) - if length <= nameSize || !isASCII(name) { - return "", "", false - } else if length > prefixSize+1 { - length = prefixSize + 1 - } else if name[length-1] == '/' { - length-- - } - - i := strings.LastIndex(name[:length], "/") - nlen := len(name) - i - 1 // nlen is length of suffix - plen := i // plen is length of prefix - if i <= 0 || nlen > nameSize || nlen == 0 || plen > prefixSize { - return "", "", false - } - return name[:i], name[i+1:], true -} - -// Write writes to the current file in the tar archive. -// Write returns the error ErrWriteTooLong if more than -// Header.Size bytes are written after WriteHeader. -// -// Calling Write on special types like TypeLink, TypeSymlink, TypeChar, -// TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless -// of what the Header.Size claims. -func (tw *Writer) Write(b []byte) (int, error) { - if tw.err != nil { - return 0, tw.err - } - n, err := tw.curr.Write(b) - if err != nil && err != ErrWriteTooLong { - tw.err = err - } - return n, err -} - -// readFrom populates the content of the current file by reading from r. -// The bytes read must match the number of remaining bytes in the current file. -// -// If the current file is sparse and r is an io.ReadSeeker, -// then readFrom uses Seek to skip past holes defined in Header.SparseHoles, -// assuming that skipped regions are all NULs. -// This always reads the last byte to ensure r is the right size. -// -// TODO(dsnet): Re-export this when adding sparse file support. -// See https://golang.org/issue/22735 -func (tw *Writer) readFrom(r io.Reader) (int64, error) { - if tw.err != nil { - return 0, tw.err - } - n, err := tw.curr.ReadFrom(r) - if err != nil && err != ErrWriteTooLong { - tw.err = err - } - return n, err -} - -// Close closes the tar archive by flushing the padding, and writing the footer. -// If the current file (from a prior call to WriteHeader) is not fully written, -// then this returns an error. -func (tw *Writer) Close() error { - if tw.err == ErrWriteAfterClose { - return nil - } - if tw.err != nil { - return tw.err - } - - // Trailer: two zero blocks. - err := tw.Flush() - for i := 0; i < 2 && err == nil; i++ { - _, err = tw.w.Write(zeroBlock[:]) - } - - // Ensure all future actions are invalid. - tw.err = ErrWriteAfterClose - return err // Report IO errors -} - -// regFileWriter is a fileWriter for writing data to a regular file entry. -type regFileWriter struct { - w io.Writer // Underlying Writer - nb int64 // Number of remaining bytes to write -} - -func (fw *regFileWriter) Write(b []byte) (n int, err error) { - overwrite := int64(len(b)) > fw.nb - if overwrite { - b = b[:fw.nb] - } - if len(b) > 0 { - n, err = fw.w.Write(b) - fw.nb -= int64(n) - } - switch { - case err != nil: - return n, err - case overwrite: - return n, ErrWriteTooLong - default: - return n, nil - } -} - -func (fw *regFileWriter) ReadFrom(r io.Reader) (int64, error) { - return io.Copy(struct{ io.Writer }{fw}, r) -} - -func (fw regFileWriter) LogicalRemaining() int64 { - return fw.nb -} -func (fw regFileWriter) PhysicalRemaining() int64 { - return fw.nb -} - -// sparseFileWriter is a fileWriter for writing data to a sparse file entry. -type sparseFileWriter struct { - fw fileWriter // Underlying fileWriter - sp sparseDatas // Normalized list of data fragments - pos int64 // Current position in sparse file -} - -func (sw *sparseFileWriter) Write(b []byte) (n int, err error) { - overwrite := int64(len(b)) > sw.LogicalRemaining() - if overwrite { - b = b[:sw.LogicalRemaining()] - } - - b0 := b - endPos := sw.pos + int64(len(b)) - for endPos > sw.pos && err == nil { - var nf int // Bytes written in fragment - dataStart, dataEnd := sw.sp[0].Offset, sw.sp[0].endOffset() - if sw.pos < dataStart { // In a hole fragment - bf := b[:min(int64(len(b)), dataStart-sw.pos)] - nf, err = zeroWriter{}.Write(bf) - } else { // In a data fragment - bf := b[:min(int64(len(b)), dataEnd-sw.pos)] - nf, err = sw.fw.Write(bf) - } - b = b[nf:] - sw.pos += int64(nf) - if sw.pos >= dataEnd && len(sw.sp) > 1 { - sw.sp = sw.sp[1:] // Ensure last fragment always remains - } - } - - n = len(b0) - len(b) - switch { - case err == ErrWriteTooLong: - return n, errMissData // Not possible; implies bug in validation logic - case err != nil: - return n, err - case sw.LogicalRemaining() == 0 && sw.PhysicalRemaining() > 0: - return n, errUnrefData // Not possible; implies bug in validation logic - case overwrite: - return n, ErrWriteTooLong - default: - return n, nil - } -} - -func (sw *sparseFileWriter) ReadFrom(r io.Reader) (n int64, err error) { - rs, ok := r.(io.ReadSeeker) - if ok { - if _, err := rs.Seek(0, io.SeekCurrent); err != nil { - ok = false // Not all io.Seeker can really seek - } - } - if !ok { - return io.Copy(struct{ io.Writer }{sw}, r) - } - - var readLastByte bool - pos0 := sw.pos - for sw.LogicalRemaining() > 0 && !readLastByte && err == nil { - var nf int64 // Size of fragment - dataStart, dataEnd := sw.sp[0].Offset, sw.sp[0].endOffset() - if sw.pos < dataStart { // In a hole fragment - nf = dataStart - sw.pos - if sw.PhysicalRemaining() == 0 { - readLastByte = true - nf-- - } - _, err = rs.Seek(nf, io.SeekCurrent) - } else { // In a data fragment - nf = dataEnd - sw.pos - nf, err = io.CopyN(sw.fw, rs, nf) - } - sw.pos += nf - if sw.pos >= dataEnd && len(sw.sp) > 1 { - sw.sp = sw.sp[1:] // Ensure last fragment always remains - } - } - - // If the last fragment is a hole, then seek to 1-byte before EOF, and - // read a single byte to ensure the file is the right size. - if readLastByte && err == nil { - _, err = mustReadFull(rs, []byte{0}) - sw.pos++ - } - - n = sw.pos - pos0 - switch { - case err == io.EOF: - return n, io.ErrUnexpectedEOF - case err == ErrWriteTooLong: - return n, errMissData // Not possible; implies bug in validation logic - case err != nil: - return n, err - case sw.LogicalRemaining() == 0 && sw.PhysicalRemaining() > 0: - return n, errUnrefData // Not possible; implies bug in validation logic - default: - return n, ensureEOF(rs) - } -} - -func (sw sparseFileWriter) LogicalRemaining() int64 { - return sw.sp[len(sw.sp)-1].endOffset() - sw.pos -} -func (sw sparseFileWriter) PhysicalRemaining() int64 { - return sw.fw.PhysicalRemaining() -} - -// zeroWriter may only be written with NULs, otherwise it returns errWriteHole. -type zeroWriter struct{} - -func (zeroWriter) Write(b []byte) (int, error) { - for i, c := range b { - if c != 0 { - return i, errWriteHole - } - } - return len(b), nil -} - -// ensureEOF checks whether r is at EOF, reporting ErrWriteTooLong if not so. -func ensureEOF(r io.Reader) error { - n, err := tryReadFull(r, []byte{0}) - switch { - case n > 0: - return ErrWriteTooLong - case err == io.EOF: - return nil - default: - return err - } -} diff --git a/vendor/github.com/xanzy/ssh-agent/.gitignore b/vendor/github.com/xanzy/ssh-agent/.gitignore deleted file mode 100644 index daf913b1b3..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/vendor/github.com/xanzy/ssh-agent/LICENSE b/vendor/github.com/xanzy/ssh-agent/LICENSE deleted file mode 100644 index 8f71f43fee..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/vendor/github.com/xanzy/ssh-agent/README.md b/vendor/github.com/xanzy/ssh-agent/README.md deleted file mode 100644 index e2dfcedca9..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# ssh-agent - -Create a new [agent.Agent](https://godoc.org/golang.org/x/crypto/ssh/agent#Agent) on any type of OS (so including Windows) from any [Go](https://golang.org) application. - -## Limitations - -When compiled for Windows, it will only support [Pageant](http://the.earth.li/~sgtatham/putty/0.66/htmldoc/Chapter9.html#pageant) as the SSH authentication agent. - -## Credits - -Big thanks to [Давид Мзареулян (David Mzareulyan)](https://github.com/davidmz) for creating the [go-pageant](https://github.com/davidmz/go-pageant) package! - -## Issues - -If you have an issue: report it on the [issue tracker](https://github.com/xanzy/ssh-agent/issues) - -## Author - -Sander van Harmelen () - -## License - -The files `pageant_windows.go` and `sshagent_windows.go` have their own license (see file headers). The rest of this package is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/vendor/github.com/xanzy/ssh-agent/pageant_windows.go b/vendor/github.com/xanzy/ssh-agent/pageant_windows.go deleted file mode 100644 index 1608e54cc2..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/pageant_windows.go +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright (c) 2014 David Mzareulyan -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software -// and associated documentation files (the "Software"), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, publish, distribute, -// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial -// portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -//go:build windows -// +build windows - -package sshagent - -// see https://github.com/Yasushi/putty/blob/master/windows/winpgntc.c#L155 -// see https://github.com/paramiko/paramiko/blob/master/paramiko/win_pageant.py - -import ( - "encoding/binary" - "errors" - "fmt" - "sync" - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -// Maximum size of message can be sent to pageant -const MaxMessageLen = 8192 - -var ( - ErrPageantNotFound = errors.New("pageant process not found") - ErrSendMessage = errors.New("error sending message") - - ErrMessageTooLong = errors.New("message too long") - ErrInvalidMessageFormat = errors.New("invalid message format") - ErrResponseTooLong = errors.New("response too long") -) - -const ( - agentCopydataID = 0x804e50ba - wmCopydata = 74 -) - -type copyData struct { - dwData uintptr - cbData uint32 - lpData unsafe.Pointer -} - -var ( - lock sync.Mutex - - user32dll = windows.NewLazySystemDLL("user32.dll") - winFindWindow = winAPI(user32dll, "FindWindowW") - winSendMessage = winAPI(user32dll, "SendMessageW") - - kernel32dll = windows.NewLazySystemDLL("kernel32.dll") - winGetCurrentThreadID = winAPI(kernel32dll, "GetCurrentThreadId") -) - -func winAPI(dll *windows.LazyDLL, funcName string) func(...uintptr) (uintptr, uintptr, error) { - proc := dll.NewProc(funcName) - return func(a ...uintptr) (uintptr, uintptr, error) { return proc.Call(a...) } -} - -// Query sends message msg to Pageant and returns response or error. -// 'msg' is raw agent request with length prefix -// Response is raw agent response with length prefix -func query(msg []byte) ([]byte, error) { - if len(msg) > MaxMessageLen { - return nil, ErrMessageTooLong - } - - msgLen := binary.BigEndian.Uint32(msg[:4]) - if len(msg) != int(msgLen)+4 { - return nil, ErrInvalidMessageFormat - } - - lock.Lock() - defer lock.Unlock() - - paWin := pageantWindow() - - if paWin == 0 { - return nil, ErrPageantNotFound - } - - thID, _, _ := winGetCurrentThreadID() - mapName := fmt.Sprintf("PageantRequest%08x", thID) - pMapName, _ := syscall.UTF16PtrFromString(mapName) - - mmap, err := syscall.CreateFileMapping(syscall.InvalidHandle, nil, syscall.PAGE_READWRITE, 0, MaxMessageLen+4, pMapName) - if err != nil { - return nil, err - } - defer syscall.CloseHandle(mmap) - - ptr, err := syscall.MapViewOfFile(mmap, syscall.FILE_MAP_WRITE, 0, 0, 0) - if err != nil { - return nil, err - } - defer syscall.UnmapViewOfFile(ptr) - - mmSlice := (*(*[MaxMessageLen]byte)(unsafe.Pointer(ptr)))[:] - - copy(mmSlice, msg) - - mapNameBytesZ := append([]byte(mapName), 0) - - cds := copyData{ - dwData: agentCopydataID, - cbData: uint32(len(mapNameBytesZ)), - lpData: unsafe.Pointer(&(mapNameBytesZ[0])), - } - - resp, _, _ := winSendMessage(paWin, wmCopydata, 0, uintptr(unsafe.Pointer(&cds))) - - if resp == 0 { - return nil, ErrSendMessage - } - - respLen := binary.BigEndian.Uint32(mmSlice[:4]) - if respLen > MaxMessageLen-4 { - return nil, ErrResponseTooLong - } - - respData := make([]byte, respLen+4) - copy(respData, mmSlice) - - return respData, nil -} - -func pageantWindow() uintptr { - nameP, _ := syscall.UTF16PtrFromString("Pageant") - h, _, _ := winFindWindow(uintptr(unsafe.Pointer(nameP)), uintptr(unsafe.Pointer(nameP))) - return h -} diff --git a/vendor/github.com/xanzy/ssh-agent/sshagent.go b/vendor/github.com/xanzy/ssh-agent/sshagent.go deleted file mode 100644 index 4a4ee30c93..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/sshagent.go +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright 2015, Sander van Harmelen -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -//go:build !windows -// +build !windows - -package sshagent - -import ( - "errors" - "fmt" - "net" - "os" - - "golang.org/x/crypto/ssh/agent" -) - -// New returns a new agent.Agent that uses a unix socket -func New() (agent.Agent, net.Conn, error) { - if !Available() { - return nil, nil, errors.New("SSH agent requested but SSH_AUTH_SOCK not-specified") - } - - sshAuthSock := os.Getenv("SSH_AUTH_SOCK") - - conn, err := net.Dial("unix", sshAuthSock) - if err != nil { - return nil, nil, fmt.Errorf("Error connecting to SSH_AUTH_SOCK: %v", err) - } - - return agent.NewClient(conn), conn, nil -} - -// Available returns true is a auth socket is defined -func Available() bool { - return os.Getenv("SSH_AUTH_SOCK") != "" -} diff --git a/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go b/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go deleted file mode 100644 index 175d1619d8..0000000000 --- a/vendor/github.com/xanzy/ssh-agent/sshagent_windows.go +++ /dev/null @@ -1,104 +0,0 @@ -// -// Copyright (c) 2014 David Mzareulyan -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this software -// and associated documentation files (the "Software"), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, publish, distribute, -// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -// is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or substantial -// portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING -// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -//go:build windows -// +build windows - -package sshagent - -import ( - "errors" - "io" - "net" - "sync" - - "github.com/Microsoft/go-winio" - "golang.org/x/crypto/ssh/agent" -) - -const ( - sshAgentPipe = `\\.\pipe\openssh-ssh-agent` -) - -// Available returns true if Pageant is running -func Available() bool { - if pageantWindow() != 0 { - return true - } - conn, err := winio.DialPipe(sshAgentPipe, nil) - if err != nil { - return false - } - conn.Close() - return true -} - -// New returns a new agent.Agent and the (custom) connection it uses -// to communicate with a running pagent.exe instance (see README.md) -func New() (agent.Agent, net.Conn, error) { - if pageantWindow() != 0 { - return agent.NewClient(&conn{}), nil, nil - } - conn, err := winio.DialPipe(sshAgentPipe, nil) - if err != nil { - return nil, nil, errors.New( - "SSH agent requested, but could not detect Pageant or Windows native SSH agent", - ) - } - return agent.NewClient(conn), nil, nil -} - -type conn struct { - sync.Mutex - buf []byte -} - -func (c *conn) Close() { - c.Lock() - defer c.Unlock() - c.buf = nil -} - -func (c *conn) Write(p []byte) (int, error) { - c.Lock() - defer c.Unlock() - - resp, err := query(p) - if err != nil { - return 0, err - } - - c.buf = append(c.buf, resp...) - - return len(p), nil -} - -func (c *conn) Read(p []byte) (int, error) { - c.Lock() - defer c.Unlock() - - if len(c.buf) == 0 { - return 0, io.EOF - } - - n := copy(p, c.buf) - c.buf = c.buf[n:] - - return n, nil -} diff --git a/vendor/github.com/xen0n/gosmopolitan/.editorconfig b/vendor/github.com/xen0n/gosmopolitan/.editorconfig deleted file mode 100644 index 0c0f7e7e28..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/.editorconfig +++ /dev/null @@ -1,23 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -root = true - -[*] -indent_style = space -trim_trailing_whitespace = true -end_of_line = lf -insert_final_newline = true -charset = utf-8 - -[{*.sh,*.md}] -indent_size = 4 - -[{*.yaml,*.yml}] -indent_size = 2 - -# hard tabs for Go and Makefile per best practice of file format -[*.go] -indent_style = tab - -[Makefile] -indent_style = tab diff --git a/vendor/github.com/xen0n/gosmopolitan/.gitignore b/vendor/github.com/xen0n/gosmopolitan/.gitignore deleted file mode 100644 index 1a1abaa202..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/.gitignore +++ /dev/null @@ -1,188 +0,0 @@ -# ignore the local build artifact -/gosmopolitan - -# and test artifacts -/coverage.txt - -# the following are auto-generated - -# Created by https://www.toptal.com/developers/gitignore/api/go,visualstudiocode,vim,goland -# Edit at https://www.toptal.com/developers/gitignore?templates=go,visualstudiocode,vim,goland - -### Go ### -# If you prefer the allow list template instead of the deny list, see community template: -# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore -# -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -# Go workspace file -go.work - -### GoLand ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/**/usage.statistics.xml -.idea/**/dictionaries -.idea/**/shelf - -# AWS User-specific -.idea/**/aws.xml - -# Generated files -.idea/**/contentModel.xml - -# Sensitive or high-churn files -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml -.idea/**/dbnavigator.xml - -# Gradle -.idea/**/gradle.xml -.idea/**/libraries - -# Gradle and Maven with auto-import -# When using Gradle or Maven with auto-import, you should exclude module files, -# since they will be recreated, and may cause churn. Uncomment if using -# auto-import. -# .idea/artifacts -# .idea/compiler.xml -# .idea/jarRepositories.xml -# .idea/modules.xml -# .idea/*.iml -# .idea/modules -# *.iml -# *.ipr - -# CMake -cmake-build-*/ - -# Mongo Explorer plugin -.idea/**/mongoSettings.xml - -# File-based project format -*.iws - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# SonarLint plugin -.idea/sonarlint/ - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -# Editor-based Rest Client -.idea/httpRequests - -# Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser - -### GoLand Patch ### -# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 - -# *.iml -# modules.xml -# .idea/misc.xml -# *.ipr - -# Sonarlint plugin -# https://plugins.jetbrains.com/plugin/7973-sonarlint -.idea/**/sonarlint/ - -# SonarQube Plugin -# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin -.idea/**/sonarIssues.xml - -# Markdown Navigator plugin -# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced -.idea/**/markdown-navigator.xml -.idea/**/markdown-navigator-enh.xml -.idea/**/markdown-navigator/ - -# Cache file creation bug -# See https://youtrack.jetbrains.com/issue/JBR-2257 -.idea/$CACHE_FILE$ - -# CodeStream plugin -# https://plugins.jetbrains.com/plugin/12206-codestream -.idea/codestream.xml - -# Azure Toolkit for IntelliJ plugin -# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij -.idea/**/azureSettings.xml - -### Vim ### -# Swap -[._]*.s[a-v][a-z] -!*.svg # comment out if you don't need vector files -[._]*.sw[a-p] -[._]s[a-rt-v][a-z] -[._]ss[a-gi-z] -[._]sw[a-p] - -# Session -Session.vim -Sessionx.vim - -# Temporary -.netrwhist -*~ -# Auto-generated tag files -tags -# Persistent undo -[._]*.un~ - -### VisualStudioCode ### -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets - -# Local History for Visual Studio Code -.history/ - -# Built Visual Studio Code Extensions -*.vsix - -### VisualStudioCode Patch ### -# Ignore all local history of files -.history -.ionide - -# End of https://www.toptal.com/developers/gitignore/api/go,visualstudiocode,vim,goland diff --git a/vendor/github.com/xen0n/gosmopolitan/.golangci.yml b/vendor/github.com/xen0n/gosmopolitan/.golangci.yml deleted file mode 100644 index 0bce12501a..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/.golangci.yml +++ /dev/null @@ -1,31 +0,0 @@ -run: - go: '1.19' - modules-download-mode: readonly - -linters: - enable: - - goheader - - goimports - - gosec - - gosimple - - lll - - nakedret - - revive - - stylecheck - - unused - -linters-settings: - goheader: - template: |- - SPDX-License-Identifier: GPL-3.0-or-later - goimports: - local-prefixes: github.com/xen0n/gosmopolitan - gosimple: - go: '1.19' - lll: - line-length: 120 - tab-width: 4 - nakedret: - max-func-lines: 1 - stylecheck: - go: '1.19' diff --git a/vendor/github.com/xen0n/gosmopolitan/LICENSE b/vendor/github.com/xen0n/gosmopolitan/LICENSE deleted file mode 100644 index 94a9ed024d..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/github.com/xen0n/gosmopolitan/README.md b/vendor/github.com/xen0n/gosmopolitan/README.md deleted file mode 100644 index 86a5e64e00..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# gosmopolitan - -![GitHub Workflow Status (main branch)](https://img.shields.io/github/actions/workflow/status/xen0n/gosmopolitan/go.yml?branch=main) -![Codecov](https://img.shields.io/codecov/c/gh/xen0n/gosmopolitan) -![GitHub license info](https://img.shields.io/github/license/xen0n/gosmopolitan) -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/xen0n/gosmopolitan) -[![Go Report Card](https://goreportcard.com/badge/github.com/xen0n/gosmopolitan)](https://goreportcard.com/report/github.com/xen0n/gosmopolitan) -[![Go Reference](https://pkg.go.dev/badge/github.com/xen0n/gosmopolitan.svg)](https://pkg.go.dev/github.com/xen0n/gosmopolitan) - -[简体中文](./README.zh-Hans.md) - -`gosmopolitan` checks your Go codebase for code smells that may prove to be -hindrance to internationalization ("i18n") and/or localization ("l10n"). - -The name is a wordplay on "cosmopolitan". - -## Checks - -Currently `gosmopolitan` checks for the following anti-patterns: - -* Occurrences of string literals containing characters from certain writing - systems. - - Existence of such strings often means the relevant logic is hard to - internationalize, or at least, require special care when doing i18n/l10n. - -* Usages of `time.Local`. - - An internationalized app or library should almost never process time and - date values in the timezone in which it is running; instead one should use - the respective user preference, or the timezone as dictated by the domain - logic. - -Note that local times are produced in a lot more ways than via direct casts to -`time.Local` alone, such as: - -* `time.LoadLocation("Local")` -* received from a `time.Ticker` -* functions explicitly documented to return local times - * `time.Now()` - * `time.Unix()` - * `time.UnixMilli()` - * `time.UnixMicro()` - -Proper identification of these use cases require a fairly complete dataflow -analysis pass, which is not implemented currently. In addition, right now you -have to pay close attention to externally-provided time values (such as from -your framework like Gin or gRPC) as they are not properly tracked either. - -## Caveats - -Note that the checks implemented here are only suitable for codebases with the -following characteristics, and may not suit your particular project's needs: - -* Originally developed for an audience using non-Latin writing system(s), -* Returns bare strings intended for humans containing such non-Latin characters, and -* May occasionally (or frequently) refer to the system timezone, but is - architecturally forbidden/discouraged to just treat the system timezone as - the reference timezone. - -For example, the lints may prove valuable if you're revamping a web service -originally targetting the Chinese market (hence producing strings with Chinese -characters all over the place) to be more i18n-aware. Conversely, if you want -to identify some of the i18n-naïve places in an English-only app, the linter -will output nothing. - -## golangci-lint integration - -`gosmopolitan` support [has been merged][gcl-pr] into [`golangci-lint`][gcl-home], -and will be usable out-of-the-box in golangci-lint v1.53.0 or later. - -Due to the opinionated coding style this linter advocates and checks for, if -you have `enable-all: true` in your `golangci.yml` and your project deals a -lot with Chinese text and/or `time.Local`, then you'll get flooded with lints -when you upgrade to golangci-lint v1.53.0. Just disable this linter (and -better yet, move away from `enable-all: true`) if the style does not suit your -specific use case. - -[gcl-pr]: https://github.com/golangci/golangci-lint/pull/3458 -[gcl-home]: https://golangci-lint.run - -## License - -`gosmopolitan` is licensed under the GPL license, version 3 or later. diff --git a/vendor/github.com/xen0n/gosmopolitan/README.zh-Hans.md b/vendor/github.com/xen0n/gosmopolitan/README.zh-Hans.md deleted file mode 100644 index 682d10880e..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/README.zh-Hans.md +++ /dev/null @@ -1,69 +0,0 @@ -# gosmopolitan - -![GitHub Workflow Status (main branch)](https://img.shields.io/github/actions/workflow/status/xen0n/gosmopolitan/go.yml?branch=main) -![Codecov](https://img.shields.io/codecov/c/gh/xen0n/gosmopolitan) -![GitHub license info](https://img.shields.io/github/license/xen0n/gosmopolitan) -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/xen0n/gosmopolitan) -[![Go Report Card](https://goreportcard.com/badge/github.com/xen0n/gosmopolitan)](https://goreportcard.com/report/github.com/xen0n/gosmopolitan) -[![Go Reference](https://pkg.go.dev/badge/github.com/xen0n/gosmopolitan.svg)](https://pkg.go.dev/github.com/xen0n/gosmopolitan) - -[English](./README.md) - -用 `gosmopolitan` 检查你的 Go 代码库里有没有国际化(“i18n“)或者本地化(”l10n“)的阻碍。 - -项目名字来自“cosmopolitan”的文字游戏。 - -## 检查 - -`gosmopolitan` 目前会检查以下的反模式(anti-patterns): - -* 含有来自特定书写系统字符的字符串字面量(string literals)。 - - 项目中存在这种字符串,通常意味着相关的逻辑不便于国际化,或者至少在国际化/本地化适配过程中会涉及特殊对待。 - -* `time.Local` 的使用。 - - 支持国际化的应用或程序库,几乎永远不应以程序当前运行环境的时区来处理时间、日期数据。 - 相反,在这种场景下,开发者应该使用相应的用户偏好,或者按照领域逻辑确定应该使用的时区。 - -注意:除了直接向 `time.Local` 转换之外,还有很多其他写法会产生本地时区的时刻,例如: - -* `time.LoadLocation("Local")` -* 从 `time.Ticker` 收到的值 -* 文档中明确了会返回本地时刻的函数 - * `time.Now()` - * `time.Unix()` - * `time.UnixMilli()` - * `time.UnixMicro()` - -为了正确识别这些使用场景,需要有一个相当完善的数据流分析 pass,目前还没实现。 -此外,当前您还需要自行密切注意从外部传入的时刻值(例如从您使用的 Gin 或 gRPC -之类框架传来的那些),因为这些值当前也没有被正确跟踪。 - -## 注意事项 - -请注意,本库中实现的检查仅适用于具有以下性质的代码库,因此可能不适用于您的具体场景: - -* 项目原先是为使用非拉丁字母书写系统的受众群体开发的, -* 项目会返回包含这些非拉丁字母字符的裸的字符串(即,未经处理或变换的), -* 项目可能偶尔(或者经常)引用程序当前运行环境的系统时区,但项目架构上禁止或不建议把系统时区直接作为业务参考时区使用。 - -举个例子:如果您在翻新一个本来面向中国用户群体(因此到处都在产生含有汉字的字符串)的 -web 服务,以使其更加国际化,这里的 lints 可能会很有价值。 -反之,如果您想在一个仅支持英语的应用里,寻找其中不利于国际化的那部分写法,本 -linter 则什么都不会输出。 - -## 与 golangci-lint 集成 - -`gosmopolitan` 支持[已经被合并][gcl-pr]入 [`golangci-lint`][gcl-home] 上游,在 golangci-lint v1.53.0 及以后的版本可以开箱即用。 - -[gcl-pr]: https://github.com/golangci/golangci-lint/pull/3458 -[gcl-home]: https://golangci-lint.run - -由于本 linter 倡导和检查的代码风格带有鲜明立场,如果您在 `golangci.yml` 开了 -`enable-all: true` 并且您的项目处理很多中文文本或者 `time.Local`,那么您一旦升级到 -golangci-lint v1.53.0 就将被 lints 淹没。如果这种代码风格不适合您的具体使用场景,直接禁用本 linter(或者更彻底一些,不要 `enable-all: true` 了)就好。 - -## 许可证 - -`gosmopolitan` 以 GPL v3 或更新的版本许可使用。 diff --git a/vendor/github.com/xen0n/gosmopolitan/lib.go b/vendor/github.com/xen0n/gosmopolitan/lib.go deleted file mode 100644 index 67b1151c71..0000000000 --- a/vendor/github.com/xen0n/gosmopolitan/lib.go +++ /dev/null @@ -1,385 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package gosmopolitan - -import ( - "fmt" - "go/ast" - "go/token" - "go/types" - "regexp" - "strings" - "unicode" - - "golang.org/x/text/runes" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const analyzerName = "gosmopolitan" -const analyzerDoc = "Report certain i18n/l10n anti-patterns in your Go codebase" - -type AnalyzerConfig struct { - // LookAtTests is flag controlling whether the lints are going to look at - // test files, despite other config knobs of the Go analysis tooling - // framework telling us otherwise. - // - // By default gosmopolitan does not look at test files, because i18n-aware - // apps most probably have many unmarked strings in test cases, and names - // and descriptions *of* test cases are probably in the program's original - // natural language too. - LookAtTests bool - // EscapeHatches is optionally a list of fully qualified names, in the - // `(full/pkg/path).name` form, to act as "i18n escape hatches". Inside - // call-like expressions to those names, the string literal script check - // is ignored. - // - // With this functionality in place, you can use type aliases like - // `type R = string` as markers, or have explicitly i18n-aware functions - // exempt from the checks. - EscapeHatches []string - // WatchForScripts is optionally a list of Unicode script names to watch - // for any usage in string literals. The range of supported scripts is - // determined by the [unicode.Scripts] map and values are case-sensitive. - WatchForScripts []string - // AllowTimeLocal is flag controlling whether usages of [time.Local] are - // allowed (i.e. not reported). - AllowTimeLocal bool -} - -func NewAnalyzer() *analysis.Analyzer { - var lookAtTests bool - var escapeHatchesStr string - var watchForScriptsStr string - var allowTimeLocal bool - - a := &analysis.Analyzer{ - Name: analyzerName, - Doc: analyzerDoc, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: func(p *analysis.Pass) (any, error) { - cfg := AnalyzerConfig{ - LookAtTests: lookAtTests, - EscapeHatches: strings.Split(escapeHatchesStr, ","), - WatchForScripts: strings.Split(watchForScriptsStr, ","), - AllowTimeLocal: allowTimeLocal, - } - pctx := processCtx{cfg: &cfg, p: p} - return pctx.run() - }, - RunDespiteErrors: false, - } - - a.Flags.BoolVar(&lookAtTests, - "lookattests", - false, - "also check the test files", - ) - a.Flags.StringVar( - &escapeHatchesStr, - "escapehatches", - "", - "comma-separated list of fully qualified names to act as i18n escape hatches", - ) - a.Flags.StringVar( - &watchForScriptsStr, - "watchforscripts", - "Han", - "comma-separated list of Unicode scripts to watch out for occurrence in string literals", - ) - a.Flags.BoolVar(&allowTimeLocal, - "allowtimelocal", - false, - "allow time.Local usages", - ) - - return a -} - -func NewAnalyzerWithConfig(cfg *AnalyzerConfig) *analysis.Analyzer { - return &analysis.Analyzer{ - Name: analyzerName, - Doc: analyzerDoc, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: func(p *analysis.Pass) (any, error) { - pctx := processCtx{cfg: cfg, p: p} - return pctx.run() - }, - RunDespiteErrors: false, - } -} - -var DefaultAnalyzer = NewAnalyzer() - -func validateUnicodeScriptName(name string) error { - if _, ok := unicode.Scripts[name]; !ok { - return fmt.Errorf("invalid Unicode script name: %s", name) - } - return nil -} - -// example input: ["Han", "Arabic"] -// example output: `\p{Han}|\p{Arabic}` -// assumes len(scriptNames) > 0 -func makeUnicodeScriptMatcherRegexpString(scriptNames []string) string { - var sb strings.Builder - for i, s := range scriptNames { - if i > 0 { - sb.WriteRune('|') - } - sb.WriteString(`\p{`) - sb.WriteString(s) - sb.WriteRune('}') - } - return sb.String() -} - -func makeUnicodeScriptMatcherRegexp(scriptNames []string) (*regexp.Regexp, error) { - return regexp.Compile(makeUnicodeScriptMatcherRegexpString(scriptNames)) -} - -type processCtx struct { - cfg *AnalyzerConfig - p *analysis.Pass -} - -func mapSlice[T any, U any](x []T, fn func(T) U) []U { - if x == nil { - return nil - } - y := make([]U, len(x)) - for i, v := range x { - y[i] = fn(v) - } - return y -} - -func sliceToSet[T comparable](x []T) map[T]struct{} { - // lo.SliceToMap(x, func(k T) (T, struct{}) { return k, struct{}{} }) - y := make(map[T]struct{}, len(x)) - for _, k := range x { - y[k] = struct{}{} - } - return y -} - -func getFullyQualifiedName(x types.Object) string { - pkg := x.Pkg() - if pkg == nil { - return x.Name() - } - return fmt.Sprintf("%s.%s", pkg.Path(), x.Name()) -} - -// if input is in the "(%s).%s" form, remove the parens, else return the -// unchanged input -// -// this is for maintaining compatibility with the previous FQN notation that -// was born out of my confusion (the previous notation, while commonly seen, -// seems to be only for methods or pointer receiver types; the parens-less -// form is in fact unambiguous, because Go identifiers can't contain periods.) -func unquoteInputFQN(x string) string { - if len(x) == 0 || x[0] != '(' { - return x - } - - before, after, found := strings.Cut(x[1:], ")") - if !found { - // malformed input: string in "(xxxxx" form with unclosed parens! - // in this case, only removing the opening parens might be better than - // doing nothing after all - return x[1:] - } - - // at this point, - // input: "(foo).bar" - // before: "foo" - // after: ".bar" - return before + after -} - -func (c *processCtx) run() (any, error) { - escapeHatchesSet := sliceToSet(mapSlice(c.cfg.EscapeHatches, unquoteInputFQN)) - - if len(c.cfg.WatchForScripts) == 0 { - c.cfg.WatchForScripts = []string{"Han"} - } - - for _, s := range c.cfg.WatchForScripts { - if err := validateUnicodeScriptName(s); err != nil { - return nil, err - } - } - - charRE, err := makeUnicodeScriptMatcherRegexp(c.cfg.WatchForScripts) - if err != nil { - return nil, err - } - - usq := newUnicodeScriptQuerier(c.cfg.WatchForScripts) - - insp := c.p.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - // support ignoring the test files, because test files could be full of - // i18n and l10n fixtures, and we want to focus on the actual run-time - // logic - // - // TODO: is there a way to both ignore test files earlier, and make use of - // inspect.Analyzer's cached results? currently Inspector doesn't provide - // a way to selectively travese some files' AST but not others. - isBelongingToTestFiles := func(n ast.Node) bool { - return strings.HasSuffix(c.p.Fset.File(n.Pos()).Name(), "_test.go") - } - - shouldSkipTheContainingFile := func(n ast.Node) bool { - if c.cfg.LookAtTests { - return false - } - return isBelongingToTestFiles(n) - } - - insp.Nodes(nil, func(n ast.Node, push bool) bool { - // we only need to look at each node once - if !push { - return false - } - - if shouldSkipTheContainingFile(n) { - return false - } - - // skip blocks that can contain string literals but are not otherwise - // interesting for us - switch n.(type) { - case *ast.ImportSpec, *ast.TypeSpec: - // import blocks, type declarations - return false - } - - // and don't look inside escape hatches - referentFQN := c.getFullyQualifiedNameOfReferent(n) - if referentFQN != "" { - _, isEscapeHatch := escapeHatchesSet[referentFQN] - // if isEscapeHatch: don't recurse (false) - return !isEscapeHatch - } - - // check only string literals - lit, ok := n.(*ast.BasicLit) - if !ok { - return true - } - if lit.Kind != token.STRING { - return true - } - - // report string literals containing characters of given script (in - // the sense of "writing system") - if charRE.MatchString(lit.Value) { - match := charRE.FindIndex([]byte(lit.Value)) - matchCh := []byte(lit.Value)[match[0]:match[1]] - scriptName := usq.queryScriptForRuneBytes(matchCh) - - c.p.Report(analysis.Diagnostic{ - Pos: lit.Pos() + token.Pos(match[0]), - End: lit.Pos() + token.Pos(match[1]), - Message: fmt.Sprintf("string literal contains rune in %s script", scriptName), - }) - } - - return true - }) - - if !c.cfg.AllowTimeLocal { - // check time.Local usages - insp.Nodes([]ast.Node{(*ast.Ident)(nil)}, func(n ast.Node, push bool) bool { - // we only need to look at each node once - if !push { - return false - } - - if shouldSkipTheContainingFile(n) { - return false - } - - ident := n.(*ast.Ident) - - d := c.p.TypesInfo.ObjectOf(ident) - if d == nil || d.Pkg() == nil { - return true - } - - if d.Pkg().Path() == "time" && d.Name() == "Local" { - c.p.Report(analysis.Diagnostic{ - Pos: n.Pos(), - End: n.End(), - Message: "usage of time.Local", - }) - } - - return true - }) - } - - return nil, nil -} - -func (c *processCtx) getFullyQualifiedNameOfReferent(n ast.Node) string { - var ident *ast.Ident - switch e := n.(type) { - case *ast.CallExpr: - ident = getIdentOfTypeOfExpr(e.Fun) - - case *ast.CompositeLit: - ident = getIdentOfTypeOfExpr(e.Type) - - default: - return "" - } - - referent := c.p.TypesInfo.Uses[ident] - if referent == nil { - return "" - } - - return getFullyQualifiedName(referent) -} - -func getIdentOfTypeOfExpr(e ast.Expr) *ast.Ident { - switch x := e.(type) { - case *ast.Ident: - return x - case *ast.SelectorExpr: - return x.Sel - } - return nil -} - -type unicodeScriptQuerier struct { - sets map[string]runes.Set -} - -func newUnicodeScriptQuerier(scriptNames []string) *unicodeScriptQuerier { - sets := make(map[string]runes.Set, len(scriptNames)) - for _, s := range scriptNames { - sets[s] = runes.In(unicode.Scripts[s]) - } - return &unicodeScriptQuerier{ - sets: sets, - } -} - -func (x *unicodeScriptQuerier) queryScriptForRuneBytes(b []byte) string { - r := []rune(string(b))[0] - for s, set := range x.sets { - if set.Contains(r) { - return s - } - } - return "" -} diff --git a/vendor/github.com/yagipy/maintidx/.gitignore b/vendor/github.com/yagipy/maintidx/.gitignore deleted file mode 100644 index a676215fa9..0000000000 --- a/vendor/github.com/yagipy/maintidx/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.idea -bin diff --git a/vendor/github.com/yagipy/maintidx/LICENSE b/vendor/github.com/yagipy/maintidx/LICENSE deleted file mode 100644 index b94c2ede81..0000000000 --- a/vendor/github.com/yagipy/maintidx/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 Hiroyuki Yagihashi - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/github.com/yagipy/maintidx/Makefile b/vendor/github.com/yagipy/maintidx/Makefile deleted file mode 100644 index 14b8fc9797..0000000000 --- a/vendor/github.com/yagipy/maintidx/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -build: - go build -o bin/maintidx ./cmd/maintidx diff --git a/vendor/github.com/yagipy/maintidx/README.md b/vendor/github.com/yagipy/maintidx/README.md deleted file mode 100644 index 8d5e26df08..0000000000 --- a/vendor/github.com/yagipy/maintidx/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# maintidx -`maintidx` measures the maintainability index of each function. -https://docs.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning - -## Installation -### Go version < 1.16 -```shell -go get -u github.com/yagipy/maintidx/cmd/maintidx -``` - -### Go version 1.16+ -```shell -go install github.com/yagipy/maintidx/cmd/maintidx -``` - -## Usage -### standalone -```shell -maintidx ./... -``` - -### with go run -No installation required -```shell -go run github.com/yagipy/maintidx/cmd/maintidx ./... -``` - -### with go vet -```shell -go vet -vettool=`which maintidx` ./... -``` - -## Flag -```shell -Flags: - -under int - show functions with maintainability index < N only. (default 20) -``` - -## TODO -- [ ] Setup execute env on container -- [ ] Impl cyc.Cyc.Calc() -- [ ] Move maintidx.Visitor.PrintHalstVol to halstval package -- [ ] Consider the necessity of halstvol.incrIfAllTrue -- [ ] Test under pkg file diff --git a/vendor/github.com/yagipy/maintidx/maintidx.go b/vendor/github.com/yagipy/maintidx/maintidx.go deleted file mode 100644 index 31ad9ca0c2..0000000000 --- a/vendor/github.com/yagipy/maintidx/maintidx.go +++ /dev/null @@ -1,63 +0,0 @@ -package maintidx - -import ( - "go/ast" - "go/token" - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -const doc = "maintidx measures the maintainability index of each function." - -var Analyzer = &analysis.Analyzer{ - Name: "maintidx", - Doc: doc, - Run: run, - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, -} - -var under int - -func init() { - Analyzer.Flags.IntVar(&under, "under", 20, "show functions with maintainability index < N only.") -} - -func run(pass *analysis.Pass) (interface{}, error) { - i := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - - nodeFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - } - - i.Preorder(nodeFilter, func(n ast.Node) { - switch n := n.(type) { - case *ast.FuncDecl: - v := analyze(n) - - v.Coef.Cyc.Calc() - v.Coef.HalstVol.Calc() - v.calc(loc(pass.Fset, n)) - if v.MaintIdx < under { - pass.Reportf(n.Pos(), "Function name: %v, Cyclomatic Complexity: %v, Halstead Volume: %0.2f, Maintainability Index: %v", n.Name, v.Coef.Cyc.Val, v.Coef.HalstVol.Val, v.MaintIdx) - } - } - }) - - return nil, nil -} - -func analyze(n ast.Node) Visitor { - v := NewVisitor() - ast.Walk(v, n) - return *v -} - -func loc(fs *token.FileSet, n *ast.FuncDecl) int { - f := fs.File(n.Pos()) - startLine := f.Line(n.Pos()) - endLine := f.Line(n.End()) - return endLine - startLine + 1 -} diff --git a/vendor/github.com/yagipy/maintidx/pkg/cyc/cyc.go b/vendor/github.com/yagipy/maintidx/pkg/cyc/cyc.go deleted file mode 100644 index 9ea009106b..0000000000 --- a/vendor/github.com/yagipy/maintidx/pkg/cyc/cyc.go +++ /dev/null @@ -1,36 +0,0 @@ -package cyc - -import ( - "go/ast" - "go/token" -) - -type Cyc struct { - Val int - Coef Coef -} - -type Coef struct{} - -func (c *Cyc) Analyze(n ast.Node) { - switch n := n.(type) { - case *ast.IfStmt, *ast.ForStmt, *ast.RangeStmt: - c.Val++ - case *ast.CaseClause: - if n.List != nil { - c.Val++ - } - case *ast.CommClause: - if n.Comm != nil { - c.Val++ - } - case *ast.BinaryExpr: - if n.Op == token.LAND || n.Op == token.LOR { - c.Val++ - } - } -} - -// TODO: Implement -func (c *Cyc) Calc() { -} diff --git a/vendor/github.com/yagipy/maintidx/pkg/halstvol/halstvol.go b/vendor/github.com/yagipy/maintidx/pkg/halstvol/halstvol.go deleted file mode 100644 index f0212759b1..0000000000 --- a/vendor/github.com/yagipy/maintidx/pkg/halstvol/halstvol.go +++ /dev/null @@ -1,71 +0,0 @@ -package halstvol - -import ( - "go/ast" - "math" -) - -type HalstVol struct { - Val float64 - Coef Coef -} - -type Coef struct { - Opt map[string]int - Opd map[string]int -} - -func (v *HalstVol) Analyze(n ast.Node) { - switch n := n.(type) { - case *ast.FuncDecl, *ast.GenDecl: - v.handleDecl(n) - case *ast.ParenExpr, *ast.IndexExpr, *ast.SliceExpr, *ast.TypeAssertExpr, *ast.CallExpr, *ast.StarExpr, *ast.UnaryExpr, *ast.BinaryExpr, *ast.KeyValueExpr: - v.handleExpr(n) - case *ast.BasicLit, *ast.CompositeLit: - v.handleLit(n) - case *ast.Ident: - v.handleIdent(n) - case *ast.Ellipsis: - incrIfAllTrue(v.Coef.Opt, "...", []bool{n.Ellipsis.IsValid()}) - case *ast.FuncType: - incrIfAllTrue(v.Coef.Opt, "func", []bool{n.Func.IsValid()}) - v.Coef.Opt["()"]++ - case *ast.ChanType: - incrIfAllTrue(v.Coef.Opt, "chan", []bool{n.Begin.IsValid()}) - incrIfAllTrue(v.Coef.Opt, "<-", []bool{n.Arrow.IsValid()}) - case *ast.SendStmt, *ast.IncDecStmt, *ast.AssignStmt, *ast.GoStmt, *ast.DeferStmt, *ast.ReturnStmt, *ast.BranchStmt, *ast.BlockStmt, *ast.IfStmt, *ast.SwitchStmt, *ast.SelectStmt, *ast.ForStmt, *ast.RangeStmt: - v.handleStmt(n) - case *ast.CaseClause: - v.handleCaseClause(n) - } -} - -func (v *HalstVol) Calc() { - distOpt := len(v.Coef.Opt) - distOpd := len(v.Coef.Opd) - - var sumOpt, sumOpd int - - for _, val := range v.Coef.Opt { - sumOpt += val - } - - for _, val := range v.Coef.Opd { - sumOpd += val - } - - vocab := distOpt + distOpd - length := sumOpt + sumOpd - - v.Val = float64(length) * math.Log2(float64(vocab)) -} - -// TODO: Consider the necessity -func incrIfAllTrue(coef map[string]int, sym string, cond []bool) { - for _, ok := range cond { - if !ok { - return - } - } - coef[sym]++ -} diff --git a/vendor/github.com/yagipy/maintidx/pkg/halstvol/handle.go b/vendor/github.com/yagipy/maintidx/pkg/halstvol/handle.go deleted file mode 100644 index 9f5e33500d..0000000000 --- a/vendor/github.com/yagipy/maintidx/pkg/halstvol/handle.go +++ /dev/null @@ -1,151 +0,0 @@ -package halstvol - -import "go/ast" - -func (v *HalstVol) handleDecl(decl ast.Node) { - switch n := decl.(type) { - case *ast.FuncDecl: - if n.Recv == nil { - // In the case of receiver functions, the function name is incremented in *ast.Ident - v.Coef.Opt[n.Name.Name]++ - } else { - v.Coef.Opt["()"]++ - } - case *ast.GenDecl: - if n.Lparen.IsValid() && n.Rparen.IsValid() { - v.Coef.Opt["()"]++ - } - - if n.Tok.IsOperator() { - v.Coef.Opt[n.Tok.String()]++ - } else { - v.Coef.Opd[n.Tok.String()]++ - } - } -} - -func (v *HalstVol) handleIdent(ident *ast.Ident) { - if ident.Obj == nil { - v.Coef.Opt[ident.Name]++ - } else { - if ident.Obj.Kind.String() != "func" { - v.Coef.Opd[ident.Name]++ - } - } -} - -func (v *HalstVol) handleLit(lit ast.Node) { - switch n := lit.(type) { - case *ast.BasicLit: - if n.Kind.IsLiteral() { - v.Coef.Opd[n.Value]++ - } else { - v.Coef.Opt[n.Value]++ - } - case *ast.CompositeLit: - incrIfAllTrue(v.Coef.Opt, "{}", []bool{n.Lbrace.IsValid(), n.Rbrace.IsValid()}) - } -} - -func (v *HalstVol) handleExpr(expr ast.Node) { - switch n := expr.(type) { - case *ast.ParenExpr: - incrIfAllTrue(v.Coef.Opt, "()", []bool{n.Lparen.IsValid(), n.Rparen.IsValid()}) - case *ast.IndexExpr: - incrIfAllTrue(v.Coef.Opt, "{}", []bool{n.Lbrack.IsValid(), n.Rbrack.IsValid()}) - case *ast.SliceExpr: - incrIfAllTrue(v.Coef.Opt, "[]", []bool{n.Lbrack.IsValid(), n.Rbrack.IsValid()}) - case *ast.TypeAssertExpr: - incrIfAllTrue(v.Coef.Opt, "()", []bool{n.Lparen.IsValid(), n.Rparen.IsValid()}) - case *ast.CallExpr: - incrIfAllTrue(v.Coef.Opt, "()", []bool{n.Lparen.IsValid(), n.Rparen.IsValid()}) - incrIfAllTrue(v.Coef.Opt, "...", []bool{n.Ellipsis != 0}) - case *ast.StarExpr: - incrIfAllTrue(v.Coef.Opt, "*", []bool{n.Star.IsValid()}) - case *ast.UnaryExpr: - if n.Op.IsOperator() { - v.Coef.Opt[n.Op.String()]++ - } else { - v.Coef.Opd[n.Op.String()]++ - } - case *ast.BinaryExpr: - v.Coef.Opt[n.Op.String()]++ - case *ast.KeyValueExpr: - incrIfAllTrue(v.Coef.Opt, ":", []bool{n.Colon.IsValid()}) - } -} - -func (v *HalstVol) handleStmt(stmt ast.Node) { - switch n := stmt.(type) { - case *ast.SendStmt: - incrIfAllTrue(v.Coef.Opt, "<-", []bool{n.Arrow.IsValid()}) - case *ast.IncDecStmt: - incrIfAllTrue(v.Coef.Opt, n.Tok.String(), []bool{n.Tok.IsOperator()}) - case *ast.AssignStmt: - if n.Tok.IsOperator() { - v.Coef.Opt[n.Tok.String()]++ - } - case *ast.GoStmt: - if n.Go.IsValid() { - v.Coef.Opt["go"]++ - } - case *ast.DeferStmt: - if n.Defer.IsValid() { - v.Coef.Opt["defer"]++ - } - case *ast.ReturnStmt: - if n.Return.IsValid() { - v.Coef.Opt["return"]++ - } - case *ast.BranchStmt: - if n.Tok.IsOperator() { - v.Coef.Opt[n.Tok.String()]++ - } else { - v.Coef.Opd[n.Tok.String()]++ - } - case *ast.BlockStmt: - if n.Lbrace.IsValid() && n.Rbrace.IsValid() { - v.Coef.Opt["{}"]++ - } - case *ast.IfStmt: - if n.If.IsValid() { - v.Coef.Opt["if"]++ - } - if n.Else != nil { - v.Coef.Opt["else"]++ - } - case *ast.SwitchStmt: - if n.Switch.IsValid() { - v.Coef.Opt["switch"]++ - } - case *ast.SelectStmt: - if n.Select.IsValid() { - v.Coef.Opt["select"]++ - } - case *ast.ForStmt: - if n.For.IsValid() { - v.Coef.Opt["for"]++ - } - case *ast.RangeStmt: - if n.For.IsValid() { - v.Coef.Opt["for"]++ - } - if n.Key != nil { - if n.Tok.IsOperator() { - v.Coef.Opt[n.Tok.String()]++ - } else { - v.Coef.Opd[n.Tok.String()]++ - } - } - v.Coef.Opt["range"]++ - } -} - -func (v *HalstVol) handleCaseClause(cc *ast.CaseClause) { - if cc.List == nil { - v.Coef.Opt["default"]++ - } - if cc.Colon.IsValid() { - v.Coef.Opt[":"]++ - } -} diff --git a/vendor/github.com/yagipy/maintidx/visitor.go b/vendor/github.com/yagipy/maintidx/visitor.go deleted file mode 100644 index e6f74c50d7..0000000000 --- a/vendor/github.com/yagipy/maintidx/visitor.go +++ /dev/null @@ -1,77 +0,0 @@ -package maintidx - -import ( - "github.com/yagipy/maintidx/pkg/cyc" - "github.com/yagipy/maintidx/pkg/halstvol" - "go/ast" - "math" - "sort" -) - -type Visitor struct { - MaintIdx int - Coef Coef -} - -var _ ast.Visitor = &Visitor{} - -type Coef struct { - Cyc cyc.Cyc - HalstVol halstvol.HalstVol -} - -func NewVisitor() *Visitor { - return &Visitor{ - MaintIdx: 0, - Coef: Coef{ - Cyc: cyc.Cyc{ - Val: 1, - Coef: cyc.Coef{}, - }, - HalstVol: halstvol.HalstVol{ - Val: 0.0, - Coef: halstvol.Coef{ - Opt: map[string]int{}, - Opd: map[string]int{}, - }, - }, - }, - } -} - -func (v *Visitor) Visit(n ast.Node) ast.Visitor { - v.Coef.Cyc.Analyze(n) - v.Coef.HalstVol.Analyze(n) - return v -} - -// Calc https://docs.microsoft.com/ja-jp/archive/blogs/codeanalysis/maintainability-index-range-and-meaning -func (v *Visitor) calc(loc int) { - origVal := 171.0 - 5.2*math.Log(v.Coef.HalstVol.Val) - 0.23*float64(v.Coef.Cyc.Val) - 16.2*math.Log(float64(loc)) - normVal := int(math.Max(0.0, origVal*100.0/171.0)) - v.MaintIdx = normVal -} - -// TODO: Move halstvol package -func (v *Visitor) printHalstVol() { - sortedOpt := make([]string, len(v.Coef.HalstVol.Coef.Opt)) - sortedOpd := make([]string, len(v.Coef.HalstVol.Coef.Opd)) - optIndex := 0 - opdIndex := 0 - for key := range v.Coef.HalstVol.Coef.Opt { - sortedOpt[optIndex] = key - optIndex++ - } - for key := range v.Coef.HalstVol.Coef.Opd { - sortedOpd[opdIndex] = key - opdIndex++ - } - sort.Strings(sortedOpt) - sort.Strings(sortedOpd) - for _, val := range sortedOpt { - println("operators", val, v.Coef.HalstVol.Coef.Opt[val]) - } - for _, val := range sortedOpd { - println("operands", val, v.Coef.HalstVol.Coef.Opd[val]) - } -} diff --git a/vendor/github.com/yeya24/promlinter/.gitignore b/vendor/github.com/yeya24/promlinter/.gitignore deleted file mode 100644 index bffb9a029b..0000000000 --- a/vendor/github.com/yeya24/promlinter/.gitignore +++ /dev/null @@ -1,20 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# binary -bin - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ - -.idea diff --git a/vendor/github.com/yeya24/promlinter/LICENSE b/vendor/github.com/yeya24/promlinter/LICENSE deleted file mode 100644 index 261eeb9e9f..0000000000 --- a/vendor/github.com/yeya24/promlinter/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/yeya24/promlinter/Makefile b/vendor/github.com/yeya24/promlinter/Makefile deleted file mode 100644 index d50db1ee71..0000000000 --- a/vendor/github.com/yeya24/promlinter/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -GOOS := $(if $(GOOS),$(GOOS),linux) -GOARCH := $(if $(GOARCH),$(GOARCH),amd64) -GO=CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) GO111MODULE=on go -GOVERSION = $(shell $(GO) version | cut -c 14- | cut -d' ' -f1) - -GIT_COMMIT = $(shell git rev-parse --short HEAD) - -BUILDFLAGS ?= - -ifeq ($(shell expr ${GOVERSION} \>= 1.14), 1) - BUILDFLAGS += -mod=mod -endif - -PACKAGE_LIST := go list ./... -PACKAGES := $$($(PACKAGE_LIST)) -FILES_TO_FMT := $(shell find . -path -prune -o -name '*.go' -print) - -all: format build test - -format: vet fmt - -fmt: - @echo "gofmt" - @gofmt -w ${FILES_TO_FMT} - @git diff --exit-code . - -build: mod - $(GO) build ${BUILDFLAGS} -o ./bin/promlinter cmd/promlinter/main.go - -vet: - $(GO) vet ${BUILDFLAGS} ./... - -mod: - @echo "go mod tidy" - $(GO) mod tidy - @git diff --exit-code -- go.mod - -test: - $(GO) test ${BUILDFLAGS} ./... -cover $(PACKAGES) diff --git a/vendor/github.com/yeya24/promlinter/README.md b/vendor/github.com/yeya24/promlinter/README.md deleted file mode 100644 index 4fbffaa6b8..0000000000 --- a/vendor/github.com/yeya24/promlinter/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# promlinter - -A linter for checking Prometheus metrics name via promlint. - -![usage](assets/promlinter.gif) - -## Installation - -### Go Get - -go get github.com/yeya24/promlinter/cmd/promlinter - -### Download from release - -Please go to https://github.com/yeya24/promlinter/releases. - -### Build from source - -#### Requirements - -- Go >= 1.13 -- make - -``` bash -git clone https://github.com/yeya24/promlinter.git -make build -``` - -Then you can find the `promlinter` binary file in the `./bin` directory. - -## Usage - -``` bash -usage: promlinter [] [ ...] - -Prometheus metrics linter for Go code. - -This tool can cover most of the patterns of metrics naming issues, but it cannot detect metric values that can only be determined in the runtime. - -By default it doesn't output parsing failures, if you want to see them, you can add --strict flag to enable it. - -It is also supported to disable the lint functions using repeated flag --disable. Current supported functions are: - - [Help]: Help detects issues related to the help text for a metric. - - [MetricUnits]: MetricUnits detects issues with metric unit names. - - [Counter]: Counter detects issues specific to counters, as well as patterns that should only be used with counters. - - [HistogramSummaryReserved]: HistogramSummaryReserved detects when other types of metrics use names or labels reserved for use by histograms and/or summaries. - - [MetricTypeInName]: MetricTypeInName detects when metric types are included in the metric name. - - [ReservedChars]: ReservedChars detects colons in metric names. - - [CamelCase]: CamelCase detects metric names and label names written in camelCase. - - [UnitAbbreviations]: UnitAbbreviations detects abbreviated units in the metric name. - -Flags: - -h, --help Show context-sensitive help (also try --help-long and --help-man). - --version Show application version. - -Commands: - help [...] - Show help. - - list [] [...] - List metrics name. - - lint [] [...] - Lint metrics via promlint. - -``` - -## Run tests - -``` bash -make test -``` diff --git a/vendor/github.com/yeya24/promlinter/promlinter.go b/vendor/github.com/yeya24/promlinter/promlinter.go deleted file mode 100644 index 2ed4d60a8a..0000000000 --- a/vendor/github.com/yeya24/promlinter/promlinter.go +++ /dev/null @@ -1,668 +0,0 @@ -package promlinter - -import ( - "fmt" - "go/ast" - "go/token" - "sort" - "strconv" - "strings" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/testutil/promlint" - dto "github.com/prometheus/client_model/go" -) - -var ( - metricsType map[string]dto.MetricType - constMetricArgNum map[string]int - validOptsFields map[string]bool - lintFuncText map[string][]string - LintFuncNames []string -) - -func init() { - metricsType = map[string]dto.MetricType{ - "Counter": dto.MetricType_COUNTER, - "NewCounter": dto.MetricType_COUNTER, - "NewCounterVec": dto.MetricType_COUNTER, - "Gauge": dto.MetricType_GAUGE, - "NewGauge": dto.MetricType_GAUGE, - "NewGaugeVec": dto.MetricType_GAUGE, - "NewHistogram": dto.MetricType_HISTOGRAM, - "NewHistogramVec": dto.MetricType_HISTOGRAM, - "NewSummary": dto.MetricType_SUMMARY, - "NewSummaryVec": dto.MetricType_SUMMARY, - } - - constMetricArgNum = map[string]int{ - "MustNewConstMetric": 3, - "MustNewHistogram": 4, - "MustNewSummary": 4, - "NewLazyConstMetric": 3, - } - - // Doesn't contain ConstLabels since we don't need this field here. - validOptsFields = map[string]bool{ - "Name": true, - "Namespace": true, - "Subsystem": true, - "Help": true, - } - - lintFuncText = map[string][]string{ - "Help": {"no help text"}, - "MetricUnits": {"use base unit"}, - "Counter": {"counter metrics should"}, - "HistogramSummaryReserved": {"non-histogram", "non-summary"}, - "MetricTypeInName": {"metric name should not include type"}, - "ReservedChars": {"metric names should not contain ':'"}, - "CamelCase": {"'snake_case' not 'camelCase'"}, - "lintUnitAbbreviations": {"metric names should not contain abbreviated units"}, - } - - LintFuncNames = []string{"Help", "MetricUnits", "Counter", "HistogramSummaryReserved", - "MetricTypeInName", "ReservedChars", "CamelCase", "lintUnitAbbreviations"} -} - -type Setting struct { - Strict bool - DisabledLintFuncs []string -} - -// Issue contains metric name, error text and metric position. -type Issue struct { - Text string - Metric string - Pos token.Position -} - -type MetricFamilyWithPos struct { - MetricFamily *dto.MetricFamily - Pos token.Position -} - -type visitor struct { - fs *token.FileSet - metrics []MetricFamilyWithPos - issues []Issue - strict bool -} - -type opt struct { - namespace string - subsystem string - name string -} - -func RunList(fs *token.FileSet, files []*ast.File, strict bool) []MetricFamilyWithPos { - v := &visitor{ - fs: fs, - metrics: make([]MetricFamilyWithPos, 0), - issues: make([]Issue, 0), - strict: strict, - } - - for _, file := range files { - ast.Walk(v, file) - } - - sort.Slice(v.metrics, func(i, j int) bool { - return v.metrics[i].Pos.String() < v.metrics[j].Pos.String() - }) - return v.metrics -} - -func RunLint(fs *token.FileSet, files []*ast.File, s Setting) []Issue { - v := &visitor{ - fs: fs, - metrics: make([]MetricFamilyWithPos, 0), - issues: make([]Issue, 0), - strict: s.Strict, - } - - for _, file := range files { - ast.Walk(v, file) - } - - // lint metrics - for _, mfp := range v.metrics { - problems, err := promlint.NewWithMetricFamilies([]*dto.MetricFamily{mfp.MetricFamily}).Lint() - if err != nil { - panic(err) - } - - for _, p := range problems { - for _, disabledFunc := range s.DisabledLintFuncs { - for _, pattern := range lintFuncText[disabledFunc] { - if strings.Contains(p.Text, pattern) { - goto END - } - } - } - - v.issues = append(v.issues, Issue{ - Pos: mfp.Pos, - Metric: p.Metric, - Text: p.Text, - }) - - END: - } - } - - sort.Slice(v.issues, func(i, j int) bool { - return v.issues[i].Pos.String() < v.issues[j].Pos.String() - }) - return v.issues -} - -func (v *visitor) Visit(n ast.Node) ast.Visitor { - if n == nil { - return v - } - - switch t := n.(type) { - case *ast.CallExpr: - return v.parseCallerExpr(t) - - case *ast.SendStmt: - return v.parseSendMetricChanExpr(t) - } - - return v -} - -func (v *visitor) parseCallerExpr(call *ast.CallExpr) ast.Visitor { - var ( - metricType dto.MetricType - methodName string - ok bool - ) - - switch stmt := call.Fun.(type) { - - /* - That's the case of setting alias . to client_golang/prometheus or promauto package. - - import . "github.com/prometheus/client_golang/prometheus" - metric := NewCounter(CounterOpts{}) - */ - case *ast.Ident: - if stmt.Name == "NewCounterFunc" { - return v.parseOpts(call.Args[0], dto.MetricType_COUNTER) - } - - if stmt.Name == "NewGaugeFunc" { - return v.parseOpts(call.Args[0], dto.MetricType_GAUGE) - } - - if metricType, ok = metricsType[stmt.Name]; !ok { - return v - } - methodName = stmt.Name - - /* - This case covers the most of cases to initialize metrics. - - prometheus.NewCounter(CounterOpts{}) - - promauto.With(nil).NewCounter(CounterOpts{}) - - factory := promauto.With(nil) - factory.NewCounter(CounterOpts{}) - - prometheus.NewCounterFunc() - */ - case *ast.SelectorExpr: - if stmt.Sel.Name == "NewCounterFunc" { - return v.parseOpts(call.Args[0], dto.MetricType_COUNTER) - } - - if stmt.Sel.Name == "NewGaugeFunc" { - return v.parseOpts(call.Args[0], dto.MetricType_GAUGE) - } - - if stmt.Sel.Name == "NewFamilyGenerator" && len(call.Args) == 5 { - return v.parseKSMMetrics(call.Args[0], call.Args[1], call.Args[2]) - } - - if metricType, ok = metricsType[stmt.Sel.Name]; !ok { - return v - } - methodName = stmt.Sel.Name - - default: - return v - } - - argNum := 1 - if strings.HasSuffix(methodName, "Vec") { - argNum = 2 - } - // The methods used to initialize metrics should have at least one arg. - if len(call.Args) < argNum && v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(call.Pos()), - Metric: "", - Text: fmt.Sprintf("%s should have at least %d arguments", methodName, argNum), - }) - return v - } - - if len(call.Args) == 0 { - return v - } - - return v.parseOpts(call.Args[0], metricType) -} - -func (v *visitor) parseOpts(optArg ast.Node, metricType dto.MetricType) ast.Visitor { - // position for the first arg of the CallExpr - optsPosition := v.fs.Position(optArg.Pos()) - opts, help := v.parseOptsExpr(optArg) - if opts == nil { - return v - } - currentMetric := dto.MetricFamily{ - Type: &metricType, - Help: help, - } - - metricName := prometheus.BuildFQName(opts.namespace, opts.subsystem, opts.name) - // We skip the invalid metric if the name is an empty string. - // This kind of metric declaration might be used as a stud metric - // https://github.com/thanos-io/thanos/blob/main/cmd/thanos/tools_bucket.go#L538. - if metricName == "" { - return v - } - currentMetric.Name = &metricName - - v.metrics = append(v.metrics, MetricFamilyWithPos{MetricFamily: ¤tMetric, Pos: optsPosition}) - return v -} - -// Parser for kube-state-metrics generators. -func (v *visitor) parseKSMMetrics(nameArg ast.Node, helpArg ast.Node, metricTypeArg ast.Node) ast.Visitor { - optsPosition := v.fs.Position(nameArg.Pos()) - currentMetric := dto.MetricFamily{} - name, ok := v.parseValue("name", nameArg) - if !ok { - return v - } - currentMetric.Name = &name - - help, ok := v.parseValue("help", helpArg) - if !ok { - return v - } - currentMetric.Help = &help - - switch stmt := metricTypeArg.(type) { - case *ast.SelectorExpr: - if metricType, ok := metricsType[stmt.Sel.Name]; !ok { - return v - } else { - currentMetric.Type = &metricType - } - } - - v.metrics = append(v.metrics, MetricFamilyWithPos{MetricFamily: ¤tMetric, Pos: optsPosition}) - return v -} - -func (v *visitor) parseSendMetricChanExpr(chExpr *ast.SendStmt) ast.Visitor { - var ( - ok bool - requiredArgNum int - methodName string - metricType dto.MetricType - ) - - call, ok := chExpr.Value.(*ast.CallExpr) - if !ok { - return v - } - - switch stmt := call.Fun.(type) { - case *ast.Ident: - if requiredArgNum, ok = constMetricArgNum[stmt.Name]; !ok { - return v - } - methodName = stmt.Name - - case *ast.SelectorExpr: - if requiredArgNum, ok = constMetricArgNum[stmt.Sel.Name]; !ok { - return v - } - methodName = stmt.Sel.Name - } - - if len(call.Args) < requiredArgNum && v.strict { - v.issues = append(v.issues, Issue{ - Metric: "", - Pos: v.fs.Position(call.Pos()), - Text: fmt.Sprintf("%s should have at least %d arguments", methodName, requiredArgNum), - }) - return v - } - - name, help := v.parseConstMetricOptsExpr(call.Args[0]) - if name == nil { - return v - } - - metric := &dto.MetricFamily{ - Name: name, - Help: help, - } - switch methodName { - case "MustNewConstMetric", "NewLazyConstMetric": - switch t := call.Args[1].(type) { - case *ast.Ident: - metric.Type = getConstMetricType(t.Name) - case *ast.SelectorExpr: - metric.Type = getConstMetricType(t.Sel.Name) - } - - case "MustNewHistogram": - metricType = dto.MetricType_HISTOGRAM - metric.Type = &metricType - case "MustNewSummary": - metricType = dto.MetricType_SUMMARY - metric.Type = &metricType - } - - v.metrics = append(v.metrics, MetricFamilyWithPos{MetricFamily: metric, Pos: v.fs.Position(call.Pos())}) - return v -} - -func (v *visitor) parseOptsExpr(n ast.Node) (*opt, *string) { - switch stmt := n.(type) { - case *ast.CompositeLit: - return v.parseCompositeOpts(stmt) - - case *ast.Ident: - if stmt.Obj != nil { - if decl, ok := stmt.Obj.Decl.(*ast.AssignStmt); ok && len(decl.Rhs) > 0 { - if t, ok := decl.Rhs[0].(*ast.CompositeLit); ok { - return v.parseCompositeOpts(t) - } - } - } - - case *ast.UnaryExpr: - return v.parseOptsExpr(stmt.X) - } - - return nil, nil -} - -func (v *visitor) parseCompositeOpts(stmt *ast.CompositeLit) (*opt, *string) { - metricOption := &opt{} - var help *string - for _, elt := range stmt.Elts { - kvExpr, ok := elt.(*ast.KeyValueExpr) - if !ok { - continue - } - object, ok := kvExpr.Key.(*ast.Ident) - if !ok { - continue - } - - if _, ok := validOptsFields[object.Name]; !ok { - continue - } - - // If failed to parse field value, stop parsing. - stringLiteral, ok := v.parseValue(object.Name, kvExpr.Value) - if !ok { - return nil, nil - } - - switch object.Name { - case "Namespace": - metricOption.namespace = stringLiteral - case "Subsystem": - metricOption.subsystem = stringLiteral - case "Name": - metricOption.name = stringLiteral - case "Help": - help = &stringLiteral - } - } - - return metricOption, help -} - -func (v *visitor) parseValue(object string, n ast.Node) (string, bool) { - switch t := n.(type) { - - // make sure it is string literal value - case *ast.BasicLit: - if t.Kind == token.STRING { - return mustUnquote(t.Value), true - } - - return "", false - - case *ast.Ident: - if t.Obj == nil { - return "", false - } - - if vs, ok := t.Obj.Decl.(*ast.ValueSpec); ok { - return v.parseValue(object, vs) - } - - case *ast.ValueSpec: - if len(t.Values) == 0 { - return "", false - } - return v.parseValue(object, t.Values[0]) - - // For binary expr, we only support adding two strings like `foo` + `bar`. - case *ast.BinaryExpr: - if t.Op == token.ADD { - x, ok := v.parseValue(object, t.X) - if !ok { - return "", false - } - - y, ok := v.parseValue(object, t.Y) - if !ok { - return "", false - } - - return x + y, true - } - - // We can only cover some basic cases here - case *ast.CallExpr: - return v.parseValueCallExpr(object, t) - - default: - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(n.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing %s with type %T is not supported", object, t), - }) - } - } - - return "", false -} - -func (v *visitor) parseValueCallExpr(object string, call *ast.CallExpr) (string, bool) { - var ( - methodName string - namespace string - subsystem string - name string - ok bool - ) - switch expr := call.Fun.(type) { - case *ast.SelectorExpr: - methodName = expr.Sel.Name - case *ast.Ident: - methodName = expr.Name - default: - return "", false - } - - if methodName == "BuildFQName" && len(call.Args) == 3 { - namespace, ok = v.parseValue("namespace", call.Args[0]) - if !ok { - return "", false - } - subsystem, ok = v.parseValue("subsystem", call.Args[1]) - if !ok { - return "", false - } - name, ok = v.parseValue("name", call.Args[2]) - if !ok { - return "", false - } - return prometheus.BuildFQName(namespace, subsystem, name), true - } - - if v.strict { - v.issues = append(v.issues, Issue{ - Metric: "", - Pos: v.fs.Position(call.Pos()), - Text: fmt.Sprintf("parsing %s with function %s is not supported", object, methodName), - }) - } - - return "", false -} - -func (v *visitor) parseConstMetricOptsExpr(n ast.Node) (*string, *string) { - switch stmt := n.(type) { - case *ast.CallExpr: - return v.parseNewDescCallExpr(stmt) - - case *ast.Ident: - if stmt.Obj != nil { - switch t := stmt.Obj.Decl.(type) { - case *ast.AssignStmt: - if len(t.Rhs) > 0 { - if call, ok := t.Rhs[0].(*ast.CallExpr); ok { - return v.parseNewDescCallExpr(call) - } - } - case *ast.ValueSpec: - if len(t.Values) > 0 { - if call, ok := t.Values[0].(*ast.CallExpr); ok { - return v.parseNewDescCallExpr(call) - } - } - } - - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(stmt.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing desc of type %T is not supported", stmt.Obj.Decl), - }) - } - } - - default: - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(stmt.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing desc of type %T is not supported", stmt), - }) - } - } - - return nil, nil -} - -func (v *visitor) parseNewDescCallExpr(call *ast.CallExpr) (*string, *string) { - var ( - help string - name string - ok bool - ) - - switch expr := call.Fun.(type) { - case *ast.Ident: - if expr.Name != "NewDesc" { - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(expr.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing desc with function %s is not supported", expr.Name), - }) - } - return nil, nil - } - case *ast.SelectorExpr: - if expr.Sel.Name != "NewDesc" { - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(expr.Sel.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing desc with function %s is not supported", expr.Sel.Name), - }) - } - return nil, nil - } - default: - if v.strict { - v.issues = append(v.issues, Issue{ - Pos: v.fs.Position(expr.Pos()), - Metric: "", - Text: fmt.Sprintf("parsing desc of %T is not supported", expr), - }) - } - return nil, nil - } - - // k8s.io/component-base/metrics.NewDesc has 6 args - // while prometheus.NewDesc has 4 args - if len(call.Args) < 4 && v.strict { - v.issues = append(v.issues, Issue{ - Metric: "", - Pos: v.fs.Position(call.Pos()), - Text: "NewDesc should have at least 4 args", - }) - return nil, nil - } - - name, ok = v.parseValue("fqName", call.Args[0]) - if !ok { - return nil, nil - } - help, ok = v.parseValue("help", call.Args[1]) - if !ok { - return nil, nil - } - - return &name, &help -} - -func mustUnquote(str string) string { - stringLiteral, err := strconv.Unquote(str) - if err != nil { - panic(err) - } - - return stringLiteral -} - -func getConstMetricType(name string) *dto.MetricType { - metricType := dto.MetricType_UNTYPED - if name == "CounterValue" { - metricType = dto.MetricType_COUNTER - } else if name == "GaugeValue" { - metricType = dto.MetricType_GAUGE - } - - return &metricType -} diff --git a/vendor/github.com/ykadowak/zerologlint/.goreleaser.yaml b/vendor/github.com/ykadowak/zerologlint/.goreleaser.yaml deleted file mode 100644 index f3af3f2121..0000000000 --- a/vendor/github.com/ykadowak/zerologlint/.goreleaser.yaml +++ /dev/null @@ -1,24 +0,0 @@ -before: - hooks: - - go mod tidy -builds: - - id: zerologlint - main: ./cmd/zerologlint - binary: zerologlint - env: - - CGO_ENABLED=0 - goos: - - linux - - windows - - darwin -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ incpatch .Version }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:' - - '^ci:' diff --git a/vendor/github.com/ykadowak/zerologlint/LICENSE b/vendor/github.com/ykadowak/zerologlint/LICENSE deleted file mode 100644 index 92a1e3b318..0000000000 --- a/vendor/github.com/ykadowak/zerologlint/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Yusuke Kadowaki - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/github.com/ykadowak/zerologlint/README.md b/vendor/github.com/ykadowak/zerologlint/README.md deleted file mode 100644 index b0a5fc0f9f..0000000000 --- a/vendor/github.com/ykadowak/zerologlint/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# zerologlint -![build](https://github.com/ykadowak/zerologlint/actions/workflows/testing.yaml/badge.svg) - -`zerologlint` is a linter for [zerolog](https://github.com/rs/zerolog) that can be run with `go vet` or through [golangci-lint](https://golangci-lint.run/) since `v1.53.0`. -It detects the wrong usage of `zerolog` that a user forgets to dispatch `zerolog.Event` with `Send` or `Msg` like functions, in which case nothing will be logged. For more detailed explanations of the cases it detects, see [Examples](#Example). - -## Install - -```bash -go install github.com/ykadowak/zerologlint/cmd/zerologlint@latest -``` - -## Usage -```bash -go vet -vettool=`which zerologlint` ./... -``` - -or you can also use it with [golangci-lint](https://golangci-lint.run/) since `v1.53.0`. - -## Examples -```go -package main - -import ( - "github.com/rs/zerolog" - "github.com/rs/zerolog/log" -) - -func main() { - // 1. Basic case - log.Info() // "must be dispatched by Msg or Send method" - - // 2. Nested case - log.Info(). // "must be dispatched by Msg or Send method" - Str("foo", "bar"). - Dict("dict", zerolog.Dict(). - Str("bar", "baz"). - Int("n", 1), - ) - - // 3. Reassignment case - logger := log.Info() // "must be dispatched by Msg or Send method" - if err != nil { - logger = log.Error() // "must be dispatched by Msg or Send method" - } - logger.Str("foo", "bar") - - // 4. Deferred case - defer log.Info() // "must be dispatched by Msg or Send method" - - // 5. zerolog.Logger case - logger2 := zerolog.New(os.Stdout) - logger2.Info().Send() - - // 6. Dispatch in other function case - event := log.Info() - dispatcher(event) -} - -func dispatcher(e *zerolog.Event) { - e.Send() -} -``` diff --git a/vendor/github.com/ykadowak/zerologlint/zerologlint.go b/vendor/github.com/ykadowak/zerologlint/zerologlint.go deleted file mode 100644 index 8c8fb74fc3..0000000000 --- a/vendor/github.com/ykadowak/zerologlint/zerologlint.go +++ /dev/null @@ -1,261 +0,0 @@ -package zerologlint - -import ( - "go/token" - "go/types" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/buildssa" - "golang.org/x/tools/go/ssa" - - "github.com/gostaticanalysis/comment/passes/commentmap" -) - -var Analyzer = &analysis.Analyzer{ - Name: "zerologlint", - Doc: "Detects the wrong usage of `zerolog` that a user forgets to dispatch with `Send` or `Msg`", - Run: run, - Requires: []*analysis.Analyzer{ - buildssa.Analyzer, - commentmap.Analyzer, - }, -} - -type posser interface { - Pos() token.Pos -} - -// callDefer is an interface just to hold both ssa.Call and ssa.Defer in our set -type callDefer interface { - Common() *ssa.CallCommon - Pos() token.Pos -} - -type linter struct { - // eventSet holds all the ssa block that is a zerolog.Event type instance - // that should be dispatched. - // Everytime the zerolog.Event is dispatched with Msg() or Send(), - // deletes that block from this set. - // At the end, check if the set is empty, or report the not dispatched block. - eventSet map[posser]struct{} - // deleteLater holds the ssa block that should be deleted from eventSet after - // all the inspection is done. - // this is required because `else` ssa block comes after the dispatch of `if`` block. - // e.g., if err != nil { log.Error() } else { log.Info() } log.Send() - // deleteLater takes care of the log.Info() block. - deleteLater map[posser]struct{} - recLimit uint -} - -func run(pass *analysis.Pass) (interface{}, error) { - srcFuncs := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA).SrcFuncs - - l := &linter{ - eventSet: make(map[posser]struct{}), - deleteLater: make(map[posser]struct{}), - recLimit: 100, - } - - for _, sf := range srcFuncs { - for _, b := range sf.Blocks { - for _, instr := range b.Instrs { - if c, ok := instr.(*ssa.Call); ok { - l.inspect(c) - } else if c, ok := instr.(*ssa.Defer); ok { - l.inspect(c) - } - } - } - } - - // apply deleteLater to envetSet for else branches of if-else cases - - for k := range l.deleteLater { - delete(l.eventSet, k) - } - - // At the end, if the set is clear -> ok. - // Otherwise, there must be a left zerolog.Event var that weren't dispatched. So report it. - for k := range l.eventSet { - pass.Reportf(k.Pos(), "must be dispatched by Msg or Send method") - } - - return nil, nil -} - -func (l *linter) inspect(cd callDefer) { - c := cd.Common() - - // check if it's in github.com/rs/zerolog/log since there's some - // functions in github.com/rs/zerolog that returns zerolog.Event - // which should not be included. However, zerolog.Logger receiver is an exception. - if isInLogPkg(*c) || isLoggerRecv(*c) { - if isZerologEvent(c.Value) { - // this ssa block should be dispatched afterwards at some point - l.eventSet[cd] = struct{}{} - return - } - } - - // if the call does not return zerolog.Event, - // check if the base is zerolog.Event. - // if so, check if the StaticCallee is Send() or Msg(). - // if so, remove the arg[0] from the set. - f := c.StaticCallee() - if f == nil { - return - } - if !isDispatchMethod(f) { - shouldReturn := true - for _, p := range f.Params { - if isZerologEvent(p) { - // check if this zerolog.Event as a parameter is dispatched in the function - // TODO: technically, it can be dispatched in another function that is called in this function, and - // this algorithm cannot track that. But I'm tired of thinking about that for now. - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - switch v := instr.(type) { - case *ssa.Call: - if inspectDispatchInFunction(v.Common()) { - shouldReturn = false - break - } - case *ssa.Defer: - if inspectDispatchInFunction(v.Common()) { - shouldReturn = false - break - } - } - } - } - } - } - if shouldReturn { - return - } - } - for _, arg := range c.Args { - if isZerologEvent(arg) { - // if there's branch, track both ways - // this is for the case like: - // logger := log.Info() - // if err != nil { - // logger = log.Error() - // } - // logger.Send() - // - // Similar case like below goes to the same root but that doesn't - // have any side effect. - // logger := log.Info() - // if err != nil { - // logger = logger.Str("a", "b") - // } - // logger.Send() - if phi, ok := arg.(*ssa.Phi); ok { - for _, edge := range phi.Edges { - l.dfsEdge(edge, make(map[ssa.Value]struct{}), 0) - } - } else { - val := getRootSsaValue(arg) - delete(l.eventSet, val) - } - } - } -} - -func (l *linter) dfsEdge(v ssa.Value, visit map[ssa.Value]struct{}, cnt uint) { - // only for safety - if cnt > l.recLimit { - return - } - cnt++ - - if _, ok := visit[v]; ok { - return - } - visit[v] = struct{}{} - - val := getRootSsaValue(v) - phi, ok := val.(*ssa.Phi) - if !ok { - l.deleteLater[val] = struct{}{} - return - } - for _, edge := range phi.Edges { - l.dfsEdge(edge, visit, cnt) - } -} - -func inspectDispatchInFunction(cc *ssa.CallCommon) bool { - if isDispatchMethod(cc.StaticCallee()) { - for _, arg := range cc.Args { - if isZerologEvent(arg) { - return true - } - } - } - return false -} - -func isInLogPkg(c ssa.CallCommon) bool { - switch v := c.Value.(type) { - case ssa.Member: - p := v.Package() - if p == nil { - return false - } - return strings.HasSuffix(p.Pkg.Path(), "github.com/rs/zerolog/log") - } - return false -} - -func isLoggerRecv(c ssa.CallCommon) bool { - switch f := c.Value.(type) { - case *ssa.Function: - if recv := f.Signature.Recv(); recv != nil { - return strings.HasSuffix(types.TypeString(recv.Type(), nil), "zerolog.Logger") - } - } - return false -} - -func isZerologEvent(v ssa.Value) bool { - ts := v.Type().String() - return strings.HasSuffix(ts, "github.com/rs/zerolog.Event") -} - -func isDispatchMethod(f *ssa.Function) bool { - if f == nil { - return false - } - m := f.Name() - if m == "Send" || m == "Msg" || m == "Msgf" || m == "MsgFunc" { - return true - } - return false -} - -func getRootSsaValue(v ssa.Value) ssa.Value { - if c, ok := v.(*ssa.Call); ok { - v := c.Value() - - // When there is no receiver, that's the block of zerolog.Event - // eg. Error() method in log.Error().Str("foo", "bar").Send() - if len(v.Call.Args) == 0 { - return v - } - - // Even when there is a receiver, if it's a zerolog.Logger instance, return this block - // eg. Info() method in zerolog.New(os.Stdout).Info() - root := v.Call.Args[0] - if !isZerologEvent(root) { - return v - } - - // Ok to just return the receiver because all the method in this - // chain is zerolog.Event at this point. - return getRootSsaValue(root) - } - return v -} diff --git a/vendor/gitlab.com/bosi/decorder/.gitignore b/vendor/gitlab.com/bosi/decorder/.gitignore deleted file mode 100644 index 48baa654b0..0000000000 --- a/vendor/gitlab.com/bosi/decorder/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.idea -/.env -/.env.example -/decorder -/LICENSES-3RD-PARTY -/ytt -/yq \ No newline at end of file diff --git a/vendor/gitlab.com/bosi/decorder/.gitlab-ci.params.yml b/vendor/gitlab.com/bosi/decorder/.gitlab-ci.params.yml deleted file mode 100644 index fe6b852887..0000000000 --- a/vendor/gitlab.com/bosi/decorder/.gitlab-ci.params.yml +++ /dev/null @@ -1,15 +0,0 @@ -#@data/values ---- - -app: - name: decorder - -code_quality: - enable_tests: true - enable_static_code_analyses: true - enable_license_check: true - -deployment: - enable_rc_handling: false - use_gitlab_container_registry: false - enable_image_build_and_deploy: false diff --git a/vendor/gitlab.com/bosi/decorder/.gitlab-ci.yml b/vendor/gitlab.com/bosi/decorder/.gitlab-ci.yml deleted file mode 100644 index 73e1273b34..0000000000 --- a/vendor/gitlab.com/bosi/decorder/.gitlab-ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -############################### -# This file is auto-generated # -############################### - -variables: - APP_NAME: decorder - -stages: - - test - - build - - release - -test: - stage: test - image: golang:1.21.0@sha256:b490ae1f0ece153648dd3c5d25be59a63f966b5f9e1311245c947de4506981aa - before_script: - - set -eu - - if [[ -f .env.pipeline ]];then cp .env.pipeline .env;fi - - mkdir -p ~/.ssh - - touch ~/.ssh/known_hosts - - ssh-keyscan gitlab.com > ~/.ssh/known_hosts - retry: 2 - script: - - '### run tests ###' - - make test - - make test-cover - -lint:source-code: - stage: test - image: golangci/golangci-lint:v1.54.2-alpine@sha256:e950721f6ae622dcc041f57cc0b61c3a78d4bbfc588facfc8b0166901a9f4848 - script: - - apk add make bash - - make settings - - '### run linter ###' - - golangci-lint run ./... - -license-check: - stage: test - image: golang:1.21.0@sha256:b490ae1f0ece153648dd3c5d25be59a63f966b5f9e1311245c947de4506981aa - before_script: - - set -eu - - if [[ -f .env.pipeline ]];then cp .env.pipeline .env;fi - - mkdir -p ~/.ssh - - touch ~/.ssh/known_hosts - - ssh-keyscan gitlab.com > ~/.ssh/known_hosts - script: - - '### run license-check ###' - - make check-licenses - artifacts: - paths: - - LICENSES-3RD-PARTY - expire_in: 7 days - -pages: - stage: release - image: golang:1.21.0@sha256:b490ae1f0ece153648dd3c5d25be59a63f966b5f9e1311245c947de4506981aa - only: - - tags - script: - - make gitlab-pages - artifacts: - paths: - - public/ diff --git a/vendor/gitlab.com/bosi/decorder/LICENSE.md b/vendor/gitlab.com/bosi/decorder/LICENSE.md deleted file mode 100644 index d46c30e18e..0000000000 --- a/vendor/gitlab.com/bosi/decorder/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -MIT License - -Copyright (c) 2021 Florian Bosdorff - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/gitlab.com/bosi/decorder/Makefile b/vendor/gitlab.com/bosi/decorder/Makefile deleted file mode 100644 index 8d4c05690f..0000000000 --- a/vendor/gitlab.com/bosi/decorder/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -include project-templates/base.mk - -project-templates/base.mk: - @cp -ar ~/.dotfiles/projects/golang ./project-templates - -.env: - touch .env \ No newline at end of file diff --git a/vendor/gitlab.com/bosi/decorder/README.md b/vendor/gitlab.com/bosi/decorder/README.md deleted file mode 100644 index 5947e5ca2c..0000000000 --- a/vendor/gitlab.com/bosi/decorder/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Decorder - -A declaration order linter for Go. In case of this tool declarations are `type`, `const`, `var` and `func`. - -## Rules - -This linter applies multiple rules where each can be disabled via cli parameter. - -| rule | description | cli-options | -|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| declaration order | Enforces the order of global declarations (e.g. all global constants are always defined before variables).
    You can also define a subset of declarations if you don't want to enforce the order of all of them. | * disable all checks: `-disable-dec-order-check`
    * disable type checks: `-disable-type-dec-order-check`
    * disable const checks: `-disable-const-dec-order-check`
    * disable var checks: `-disable-var-dec-order-check`
    * custom order: `-dec-order var,const,func,type` | -| declaration number | Enforces that the statements const, var and type are only used once per file. You have to use parenthesis
    to declare e.g multiple global types inside a file. | disable check: `-disable-dec-num-check` | -| init func first | Enforces the init func to be the first function in file. | disable check: `-disable-init-func-first-check` | - -You may find the implementation of the rules inside `analyzer.go`. - -Underscore var declarations can be ignored via `-ignore-underscore-vars`. - -## Installation - -```shell -go install gitlab.com/bosi/decorder/cmd/decorder -``` - -You can use the linter via golangci-lint as well: https://golangci-lint.run/usage/linters/#decorder. - -## Usage - -```shell -# with default options -decorder ./... - -# custom declaration order -decorder -dec-order var,const,func,type ./... - -# disable declaration order check -decorder -disable-dec-order-check ./... - -# disable check for multiple declarations statements -decorder -disable-dec-num-check ./... - -# disable check for multiple declarations (var only) statements -decorder -disable-var-dec-num-check ./... - -# disable check that init func is always first function -decorder -disable-init-func-first-check ./... - -# ignore underscore variables for all checks -decorder -ignore-underscore-vars ./... -``` \ No newline at end of file diff --git a/vendor/gitlab.com/bosi/decorder/analyzer.go b/vendor/gitlab.com/bosi/decorder/analyzer.go deleted file mode 100644 index 08f82ccc11..0000000000 --- a/vendor/gitlab.com/bosi/decorder/analyzer.go +++ /dev/null @@ -1,255 +0,0 @@ -package decorder - -import ( - "fmt" - "go/ast" - "go/token" - "strings" - "sync" - - "golang.org/x/tools/go/analysis" -) - -type ( - decNumChecker struct { - tokenMap map[string]token.Token - tokenCounts map[token.Token]int - decOrder []string - funcPoss []funcPos - } - - options struct { - decOrder string - ignoreUnderscoreVars bool - disableDecNumCheck bool - disableTypeDecNumCheck bool - disableConstDecNumCheck bool - disableVarDecNumCheck bool - disableDecOrderCheck bool - disableInitFuncFirstCheck bool - } - - funcPos struct { - start token.Pos - end token.Pos - } -) - -const ( - Name = "decorder" - - FlagDo = "dec-order" - FlagIuv = "ignore-underscore-vars" - FlagDdnc = "disable-dec-num-check" - FlagDtdnc = "disable-type-dec-num-check" - FlagDcdnc = "disable-const-dec-num-check" - FlagDvdnc = "disable-var-dec-num-check" - FlagDdoc = "disable-dec-order-check" - FlagDiffc = "disable-init-func-first-check" - - defaultDecOrder = "type,const,var,func" -) - -var ( - Analyzer = &analysis.Analyzer{ - Name: Name, - Doc: "check declaration order and count of types, constants, variables and functions", - Run: run, - } - - opts = options{} - - tokens = []token.Token{token.TYPE, token.CONST, token.VAR, token.FUNC} - - decNumConf = map[token.Token]bool{ - token.TYPE: false, - token.CONST: false, - token.VAR: false, - } - decLock sync.Mutex -) - -//nolint:lll -func init() { - Analyzer.Flags.StringVar(&opts.decOrder, FlagDo, defaultDecOrder, "define the required order of types, constants, variables and functions declarations inside a file") - Analyzer.Flags.BoolVar(&opts.ignoreUnderscoreVars, FlagIuv, false, "option to ignore underscore vars for dec order and dec num check") - Analyzer.Flags.BoolVar(&opts.disableDecNumCheck, FlagDdnc, false, "option to disable (all) checks for number of declarations inside file") - Analyzer.Flags.BoolVar(&opts.disableTypeDecNumCheck, FlagDtdnc, false, "option to disable check for number of type declarations inside file") - Analyzer.Flags.BoolVar(&opts.disableConstDecNumCheck, FlagDcdnc, false, "option to disable check for number of const declarations inside file") - Analyzer.Flags.BoolVar(&opts.disableVarDecNumCheck, FlagDvdnc, false, "option to disable check for number of var declarations inside file") - Analyzer.Flags.BoolVar(&opts.disableDecOrderCheck, FlagDdoc, false, "option to disable check for order of declarations inside file") - Analyzer.Flags.BoolVar(&opts.disableInitFuncFirstCheck, FlagDiffc, false, "option to disable check that init function is always first function in file") -} - -func initDec() { - decLock.Lock() - decNumConf[token.TYPE] = opts.disableTypeDecNumCheck - decNumConf[token.CONST] = opts.disableConstDecNumCheck - decNumConf[token.VAR] = opts.disableVarDecNumCheck - decLock.Unlock() -} - -func run(pass *analysis.Pass) (interface{}, error) { - initDec() - - for _, f := range pass.Files { - ast.Inspect(f, runDeclNumAndDecOrderCheck(pass)) - - if !opts.disableInitFuncFirstCheck { - ast.Inspect(f, runInitFuncFirstCheck(pass)) - } - } - - return nil, nil -} - -func runInitFuncFirstCheck(pass *analysis.Pass) func(ast.Node) bool { - nonInitFound := false - - return func(n ast.Node) bool { - dec, ok := n.(*ast.FuncDecl) - if !ok { - return true - } - - if dec.Name.Name == "init" && dec.Recv == nil { - if nonInitFound { - pass.Reportf(dec.Pos(), "init func must be the first function in file") - } - } else { - nonInitFound = true - } - - return true - } -} - -func runDeclNumAndDecOrderCheck(pass *analysis.Pass) func(ast.Node) bool { - dnc := newDecNumChecker() - - if opts.disableDecNumCheck && opts.disableDecOrderCheck { - return func(n ast.Node) bool { - return true - } - } - - return func(n ast.Node) bool { - fd, ok := n.(*ast.FuncDecl) - if ok { - return dnc.handleFuncDec(fd, pass) - } - - gd, ok := n.(*ast.GenDecl) - if !ok { - return true - } - - if dnc.isInsideFunction(gd) { - return true - } - - dnc.handleGenDecl(gd, pass) - - if !opts.disableDecOrderCheck { - dnc.handleDecOrderCheck(gd, pass) - } - - return true - } -} - -func newDecNumChecker() decNumChecker { - dnc := decNumChecker{ - tokenMap: map[string]token.Token{}, - tokenCounts: map[token.Token]int{}, - decOrder: []string{}, - funcPoss: []funcPos{}, - } - - for _, t := range tokens { - dnc.tokenCounts[t] = 0 - dnc.tokenMap[t.String()] = t - } - - for _, do := range strings.Split(opts.decOrder, ",") { - dnc.decOrder = append(dnc.decOrder, strings.TrimSpace(do)) - } - - return dnc -} - -func (dnc decNumChecker) isToLate(t token.Token) (string, bool) { - for i, do := range dnc.decOrder { - if do == t.String() { - for j := i + 1; j < len(dnc.decOrder); j++ { - if dnc.tokenCounts[dnc.tokenMap[dnc.decOrder[j]]] > 0 { - return dnc.decOrder[j], false - } - } - return "", true - } - } - - return "", true -} - -func (dnc *decNumChecker) handleGenDecl(gd *ast.GenDecl, pass *analysis.Pass) { - for _, t := range tokens { - if gd.Tok == t { - if opts.ignoreUnderscoreVars && declName(gd) == "_" { - continue - } - - dnc.tokenCounts[t]++ - - if !opts.disableDecNumCheck && !decNumConf[t] && dnc.tokenCounts[t] > 1 { - pass.Reportf(gd.Pos(), "multiple \"%s\" declarations are not allowed; use parentheses instead", t.String()) - } - } - } -} - -func declName(gd *ast.GenDecl) string { - for _, spec := range gd.Specs { - s, ok := spec.(*ast.ValueSpec) - if ok && len(s.Names) > 0 && s.Names[0] != nil { - return s.Names[0].Name - } - } - return "" -} - -func (dnc decNumChecker) handleDecOrderCheck(gd *ast.GenDecl, pass *analysis.Pass) { - l, c := dnc.isToLate(gd.Tok) - if !c { - pass.Reportf(gd.Pos(), fmtWrongOrderMsg(gd.Tok.String(), l)) - } -} - -func (dnc decNumChecker) isInsideFunction(dn *ast.GenDecl) bool { - for _, poss := range dnc.funcPoss { - if poss.start < dn.Pos() && poss.end > dn.Pos() { - return true - } - } - return false -} - -func (dnc *decNumChecker) handleFuncDec(fd *ast.FuncDecl, pass *analysis.Pass) bool { - dnc.funcPoss = append(dnc.funcPoss, funcPos{start: fd.Pos(), end: fd.End()}) - - dnc.tokenCounts[token.FUNC]++ - - if !opts.disableDecOrderCheck { - l, c := dnc.isToLate(token.FUNC) - if !c { - pass.Reportf(fd.Pos(), fmtWrongOrderMsg(token.FUNC.String(), l)) - } - } - - return true -} - -func fmtWrongOrderMsg(target string, notAfter string) string { - return fmt.Sprintf("%s must not be placed after %s (desired order: %s)", target, notAfter, opts.decOrder) -} diff --git a/vendor/gitlab.com/bosi/decorder/renovate.json b/vendor/gitlab.com/bosi/decorder/renovate.json deleted file mode 100644 index 60041578ce..0000000000 --- a/vendor/gitlab.com/bosi/decorder/renovate.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "gitlab>bosi/renovate-configs//configs/golang", - "gitlab>bosi/renovate-configs//configs/automerge" - ] -} diff --git a/vendor/gitlab.com/digitalxero/go-conventional-commit/.gitignore b/vendor/gitlab.com/digitalxero/go-conventional-commit/.gitignore deleted file mode 100644 index 7dd3ef89c1..0000000000 --- a/vendor/gitlab.com/digitalxero/go-conventional-commit/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -#junk -*.swp -.idea/ -*.orig -*_bckp -.DS_Store - -/build/ \ No newline at end of file diff --git a/vendor/gitlab.com/digitalxero/go-conventional-commit/LICENSE b/vendor/gitlab.com/digitalxero/go-conventional-commit/LICENSE deleted file mode 100644 index a41ea67f62..0000000000 --- a/vendor/gitlab.com/digitalxero/go-conventional-commit/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2019 Dj Gilcrease - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/gitlab.com/digitalxero/go-conventional-commit/Makefile b/vendor/gitlab.com/digitalxero/go-conventional-commit/Makefile deleted file mode 100644 index ff06d7db92..0000000000 --- a/vendor/gitlab.com/digitalxero/go-conventional-commit/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -.PHONY: all githooks clean deps test lint out_dir - -OUT_DIR ?= build -GOARCH ?= amd64 -GOOS ?= linux -ifeq ($(GOOS),windows) - BIN_EXTENSION=.exe -endif -SEMVER ?= 0.0.0-$(shell whoami) - -all: deps test lint build - -init: githooks - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin - -githooks: - git config core.hooksPath .githooks - -out_dir: - mkdir -p $(OUT_DIR) - -test: out_dir - go test -count=1 -race ./... -tags 'release netgo osusergo' -v -coverprofile=$(OUT_DIR)/coverage.out - go tool cover -func=$(OUT_DIR)/coverage.out - -# -# lint go code critical checks -# -# Shortcut for lint for developer -lint: out_dir - $(if $(CI), make ci_lint, make lint_local) - -lint_local: - golangci-lint run --fix -v - -# Running lint with additional checks for sonarscanner -# Used by CI -ci_lint: - golangci-lint run --out-format checkstyle > $(OUT_DIR)/lint-report.xml - -format: - go fmt ./... - -deps: - go get -u ./... - go mod tidy - go mod verify - diff --git a/vendor/gitlab.com/digitalxero/go-conventional-commit/README.md b/vendor/gitlab.com/digitalxero/go-conventional-commit/README.md deleted file mode 100644 index db0b81d216..0000000000 --- a/vendor/gitlab.com/digitalxero/go-conventional-commit/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# go-conventional-commit - -golang parser for conventional-commit messages https://www.conventionalcommits.org/ diff --git a/vendor/gitlab.com/digitalxero/go-conventional-commit/conventional_commits.go b/vendor/gitlab.com/digitalxero/go-conventional-commit/conventional_commits.go deleted file mode 100644 index ce5e6b6192..0000000000 --- a/vendor/gitlab.com/digitalxero/go-conventional-commit/conventional_commits.go +++ /dev/null @@ -1,112 +0,0 @@ -package conventional_commit - -import ( - "fmt" - "regexp" - "strings" -) - -// nolint:gochecknoglobals -var baseFormatRegex = regexp.MustCompile(`(?is)^(?:(?P[^\(!:]+)(?:\((?P[^\)]+)\))?(?P!)?: (?P[^\n\r]+))(?P.*)`) -var bodyFooterFormatRegex = regexp.MustCompile(`(?isU)^(?:(?P.*))?(?P